diff -Nru gstreamer-vaapi-0.7.0/aclocal.m4 gstreamer-vaapi-1.8.2/aclocal.m4 --- gstreamer-vaapi-0.7.0/aclocal.m4 2015-12-07 10:54:23.000000000 +0000 +++ gstreamer-vaapi-1.8.2/aclocal.m4 2016-06-09 07:27:11.000000000 +0000 @@ -20,221 +20,6 @@ If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# serial 1 (pkg-config-0.24) -# -# Copyright © 2004 Scott James Remnant . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# 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. - -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- -AC_DEFUN([PKG_PROG_PKG_CONFIG], -[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) -m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) -AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) -AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=m4_default([$1], [0.9.0]) - AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - PKG_CONFIG="" - fi -fi[]dnl -])# PKG_PROG_PKG_CONFIG - -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# Check to see whether a particular set of modules exists. Similar -# to PKG_CHECK_MODULES(), but does not set variables or print errors. -# -# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -# only at the first occurence in configure.ac, so if the first place -# it's called might be skipped (such as if it is within an "if", you -# have to call PKG_CHECK_EXISTS manually -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_EXISTS], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -if test -n "$PKG_CONFIG" && \ - AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_default([$2], [:]) -m4_ifvaln([$3], [else - $3])dnl -fi]) - -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- -m4_define([_PKG_CONFIG], -[if test -n "$$1"; then - pkg_cv_[]$1="$$1" - elif test -n "$PKG_CONFIG"; then - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes ], - [pkg_failed=yes]) - else - pkg_failed=untried -fi[]dnl -])# _PKG_CONFIG - -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- -AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi[]dnl -])# _PKG_SHORT_ERRORS_SUPPORTED - - -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# -# Note that if there is a possibility the first call to -# PKG_CHECK_MODULES might not happen, you should be sure to include an -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -# -# -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_MODULES], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl - -pkg_failed=no -AC_MSG_CHECKING([for $1]) - -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -_PKG_CONFIG([$1][_LIBS], [libs], [$2]) - -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -and $1[]_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details.]) - -if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - - m4_default([$4], [AC_MSG_ERROR( -[Package requirements ($2) were not met: - -$$1_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -_PKG_TEXT])[]dnl - ]) -elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) - m4_default([$4], [AC_MSG_FAILURE( -[The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -_PKG_TEXT - -To get pkg-config, see .])[]dnl - ]) -else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS - AC_MSG_RESULT([yes]) - $3 -fi[]dnl -])# PKG_CHECK_MODULES - - -# PKG_INSTALLDIR(DIRECTORY) -# ------------------------- -# Substitutes the variable pkgconfigdir as the location where a module -# should install pkg-config .pc files. By default the directory is -# $libdir/pkgconfig, but the default can be changed by passing -# DIRECTORY. The user can override through the --with-pkgconfigdir -# parameter. -AC_DEFUN([PKG_INSTALLDIR], -[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) -m4_pushdef([pkg_description], - [pkg-config installation directory @<:@]pkg_default[@:>@]) -AC_ARG_WITH([pkgconfigdir], - [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, - [with_pkgconfigdir=]pkg_default) -AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) -m4_popdef([pkg_default]) -m4_popdef([pkg_description]) -]) dnl PKG_INSTALLDIR - - -# PKG_NOARCH_INSTALLDIR(DIRECTORY) -# ------------------------- -# Substitutes the variable noarch_pkgconfigdir as the location where a -# module should install arch-independent pkg-config .pc files. By -# default the directory is $datadir/pkgconfig, but the default can be -# changed by passing DIRECTORY. The user can override through the -# --with-noarch-pkgconfigdir parameter. -AC_DEFUN([PKG_NOARCH_INSTALLDIR], -[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) -m4_pushdef([pkg_description], - [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) -AC_ARG_WITH([noarch-pkgconfigdir], - [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, - [with_noarch_pkgconfigdir=]pkg_default) -AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) -m4_popdef([pkg_default]) -m4_popdef([pkg_description]) -]) dnl PKG_NOARCH_INSTALLDIR - - -# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, -# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# ------------------------------------------- -# Retrieves the value of the pkg-config variable for the given module. -AC_DEFUN([PKG_CHECK_VAR], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl - -_PKG_CONFIG([$1], [variable="][$3]["], [$2]) -AS_VAR_COPY([$1], [pkg_cv_][$1]) - -AS_VAR_IF([$1], [""], [$5], [$4])dnl -])# PKG_CHECK_VAR - # Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation @@ -860,6 +645,42 @@ rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless 'enable' is passed literally. +# For symmetry, 'disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], + am_maintainer_other[ make rules and dependencies not useful + (and sometimes confusing) to the casual installer])], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. @@ -1027,6 +848,241 @@ # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# --------------------------------------------------------------------------- +# Adds support for distributing Python modules and packages. To +# install modules, copy them to $(pythondir), using the python_PYTHON +# automake variable. To install a package with the same name as the +# automake package, install to $(pkgpythondir), or use the +# pkgpython_PYTHON automake variable. +# +# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as +# locations to install python extension modules (shared libraries). +# Another macro is required to find the appropriate flags to compile +# extension modules. +# +# If your package is configured with a different prefix to python, +# users will have to add the install directory to the PYTHONPATH +# environment variable, or create a .pth file (see the python +# documentation for details). +# +# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will +# cause an error if the version of python installed on the system +# doesn't meet the requirement. MINIMUM-VERSION should consist of +# numbers and dots only. +AC_DEFUN([AM_PATH_PYTHON], + [ + dnl Find a Python interpreter. Python versions prior to 2.0 are not + dnl supported. (2.0 was released on October 16, 2000). + m4_define_default([_AM_PYTHON_INTERPRETER_LIST], +[python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7 dnl + python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0]) + + AC_ARG_VAR([PYTHON], [the Python interpreter]) + + m4_if([$1],[],[ + dnl No version check is needed. + # Find any Python interpreter. + if test -z "$PYTHON"; then + AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) + fi + am_display_PYTHON=python + ], [ + dnl A version check is needed. + if test -n "$PYTHON"; then + # If the user set $PYTHON, use it and don't search something else. + AC_MSG_CHECKING([whether $PYTHON version is >= $1]) + AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + AC_MSG_ERROR([Python interpreter is too old])]) + am_display_PYTHON=$PYTHON + else + # Otherwise, try each interpreter until we find one that satisfies + # VERSION. + AC_CACHE_CHECK([for a Python interpreter with version >= $1], + [am_cv_pathless_PYTHON],[ + for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do + test "$am_cv_pathless_PYTHON" = none && break + AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) + done]) + # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. + if test "$am_cv_pathless_PYTHON" = none; then + PYTHON=: + else + AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) + fi + am_display_PYTHON=$am_cv_pathless_PYTHON + fi + ]) + + if test "$PYTHON" = :; then + dnl Run any user-specified action, or abort. + m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) + else + + dnl Query Python for its version number. Getting [:3] seems to be + dnl the best way to do this; it's what "site.py" does in the standard + dnl library. + + AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], + [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`]) + AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) + + dnl Use the values of $prefix and $exec_prefix for the corresponding + dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made + dnl distinct variables so they can be overridden if need be. However, + dnl general consensus is that you shouldn't need this ability. + + AC_SUBST([PYTHON_PREFIX], ['${prefix}']) + AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) + + dnl At times (like when building shared libraries) you may want + dnl to know which OS platform Python thinks this is. + + AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], + [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`]) + AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) + + # Just factor out some code duplication. + am_python_setup_sysconfig="\ +import sys +# Prefer sysconfig over distutils.sysconfig, for better compatibility +# with python 3.x. See automake bug#10227. +try: + import sysconfig +except ImportError: + can_use_sysconfig = 0 +else: + can_use_sysconfig = 1 +# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs: +# +try: + from platform import python_implementation + if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7': + can_use_sysconfig = 0 +except ImportError: + pass" + + dnl Set up 4 directories: + + dnl pythondir -- where to install python scripts. This is the + dnl site-packages directory, not the python standard library + dnl directory like in previous automake betas. This behavior + dnl is more consistent with lispdir.m4 for example. + dnl Query distutils for this directory. + AC_CACHE_CHECK([for $am_display_PYTHON script directory], + [am_cv_python_pythondir], + [if test "x$prefix" = xNONE + then + am_py_prefix=$ac_default_prefix + else + am_py_prefix=$prefix + fi + am_cv_python_pythondir=`$PYTHON -c " +$am_python_setup_sysconfig +if can_use_sysconfig: + sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) +else: + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') +sys.stdout.write(sitedir)"` + case $am_cv_python_pythondir in + $am_py_prefix*) + am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` + am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` + ;; + *) + case $am_py_prefix in + /usr|/System*) ;; + *) + am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages + ;; + esac + ;; + esac + ]) + AC_SUBST([pythondir], [$am_cv_python_pythondir]) + + dnl pkgpythondir -- $PACKAGE directory under pythondir. Was + dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is + dnl more consistent with the rest of automake. + + AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) + + dnl pyexecdir -- directory for installing python extension modules + dnl (shared libraries) + dnl Query distutils for this directory. + AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], + [am_cv_python_pyexecdir], + [if test "x$exec_prefix" = xNONE + then + am_py_exec_prefix=$am_py_prefix + else + am_py_exec_prefix=$exec_prefix + fi + am_cv_python_pyexecdir=`$PYTHON -c " +$am_python_setup_sysconfig +if can_use_sysconfig: + sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'}) +else: + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') +sys.stdout.write(sitedir)"` + case $am_cv_python_pyexecdir in + $am_py_exec_prefix*) + am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` + am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` + ;; + *) + case $am_py_exec_prefix in + /usr|/System*) ;; + *) + am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages + ;; + esac + ;; + esac + ]) + AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) + + dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) + + AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) + + dnl Run any user-specified action. + $2 + fi + +]) + + +# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# --------------------------------------------------------------------------- +# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. +# Run ACTION-IF-FALSE otherwise. +# This test uses sys.hexversion instead of the string equivalent (first +# word of sys.version), in order to cope with versions such as 2.2c1. +# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000). +AC_DEFUN([AM_PYTHON_CHECK_VERSION], + [prog="import sys +# split strings by '.' and convert to numeric. Append some zeros +# because we need at least 4 digits for the hex conversion. +# map returns an iterator in Python 3.0 and a list in 2.x +minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]] +minverhex = 0 +# xrange is not present in Python 3.0 and range returns an iterator +for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]] +sys.exit(sys.hexversion < minverhex)" + AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) + # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation @@ -1365,7 +1421,24 @@ AC_SUBST([am__untar]) ]) # _AM_PROG_TAR -m4_include([m4/gtk-doc.m4]) +m4_include([common/m4/as-ac-expand.m4]) +m4_include([common/m4/as-auto-alt.m4]) +m4_include([common/m4/as-compiler-flag.m4]) +m4_include([common/m4/as-libtool.m4]) +m4_include([common/m4/as-version.m4]) +m4_include([common/m4/gst-arch.m4]) +m4_include([common/m4/gst-args.m4]) +m4_include([common/m4/gst-check.m4]) +m4_include([common/m4/gst-error.m4]) +m4_include([common/m4/gst-feature.m4]) +m4_include([common/m4/gst-glib2.m4]) +m4_include([common/m4/gst-package-release-datetime.m4]) +m4_include([common/m4/gst-platform.m4]) +m4_include([common/m4/gst-plugin-docs.m4]) +m4_include([common/m4/gst-plugindir.m4]) +m4_include([common/m4/gst.m4]) +m4_include([common/m4/gtk-doc.m4]) +m4_include([common/m4/pkg.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) diff -Nru gstreamer-vaapi-0.7.0/autogen.sh gstreamer-vaapi-1.8.2/autogen.sh --- gstreamer-vaapi-0.7.0/autogen.sh 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/autogen.sh 2016-03-24 11:36:59.000000000 +0000 @@ -0,0 +1,124 @@ +#!/bin/sh +# +# gstreamer-vaapi autogen.sh +# +# Run this to generate all the initial makefiles, etc. +# +# This file has been generated from common/autogen.sh.in via common/update-autogen + + +test -n "$srcdir" || srcdir=`dirname "$0"` +test -n "$srcdir" || srcdir=. + +olddir=`pwd` +cd "$srcdir" + +package=gstreamer-vaapi +srcfile=gstreamer-vaapi.doap + +# Make sure we have common +if test ! -f common/gst-autogen.sh; +then + echo "+ Setting up common submodule" + git submodule init +fi +git submodule update + +# source helper functions +if test ! -f common/gst-autogen.sh; +then + echo There is something wrong with your source tree. + echo You are missing common/gst-autogen.sh + exit 1 +fi +. common/gst-autogen.sh + +# install pre-commit hook for doing clean commits +if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \); +then + rm -f .git/hooks/pre-commit + if ! ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit 2> /dev/null + then + echo "Failed to create commit hook symlink, copying instead ..." + cp common/hooks/pre-commit.hook .git/hooks/pre-commit + fi +fi + +# GNU gettext automake support doesn't get along with git. +# https://bugzilla.gnome.org/show_bug.cgi?id=661128 +if test -d po ; then + touch -t 200001010000 po/gstreamer-vaapi-1.0.pot +fi + +CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc' + +if test "x$package" = "xgstreamer"; then + CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --enable-docbook --enable-failing-tests --enable-poisoning" +elif test "x$package" = "xgst-plugins-bad"; then + CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-player-tests" +fi + +autogen_options $@ + +printf "+ check for build tools" +if test -z "$NOCHECK"; then + echo + + printf " checking for autoreconf ... " + echo + which "autoreconf" 2>/dev/null || { + echo "not found! Please install the autoconf package." + exit 1 + } + + printf " checking for pkg-config ... " + echo + which "pkg-config" 2>/dev/null || { + echo "not found! Please install pkg-config." + exit 1 + } +else + echo ": skipped version checks" +fi + +# if no arguments specified then this will be printed +if test -z "$*" && test -z "$NOCONFIGURE"; then + echo "+ checking for autogen.sh options" + echo " This autogen script will automatically run ./configure as:" + echo " ./configure $CONFIGURE_DEF_OPT" + echo " To pass any additional options, please specify them on the $0" + echo " command line." +fi + +toplevel_check $srcfile + +# autopoint +if test -d po && grep ^AM_GNU_GETTEXT_VERSION configure.ac >/dev/null ; then + tool_run "autopoint" "--force" +fi + +# aclocal +if test -f acinclude.m4; then rm acinclude.m4; fi + +autoreconf --force --install || exit 1 + +test -n "$NOCONFIGURE" && { + echo "+ skipping configure stage for package $package, as requested." + echo "+ autogen.sh done." + exit 0 +} + +cd "$olddir" + +echo "+ running configure ... " +test ! -z "$CONFIGURE_DEF_OPT" && echo " default flags: $CONFIGURE_DEF_OPT" +test ! -z "$CONFIGURE_EXT_OPT" && echo " external flags: $CONFIGURE_EXT_OPT" +echo + +echo "$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT +"$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT || { + echo " configure failed" + exit 1 +} + +echo "Now type 'make' to compile $package." diff -Nru gstreamer-vaapi-0.7.0/build-aux/config.guess gstreamer-vaapi-1.8.2/build-aux/config.guess --- gstreamer-vaapi-0.7.0/build-aux/config.guess 2015-12-07 10:54:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/build-aux/config.guess 2016-06-09 07:27:12.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2016 Free Software Foundation, Inc. -timestamp='2014-03-23' +timestamp='2016-04-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -24,12 +24,12 @@ # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -168,20 +168,27 @@ # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) + arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ @@ -197,6 +204,13 @@ os=netbsd ;; esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need @@ -207,13 +221,13 @@ release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" + echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` @@ -223,6 +237,10 @@ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; @@ -235,6 +253,9 @@ *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -251,42 +272,42 @@ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 @@ -359,16 +380,16 @@ exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build - SUN_ARCH="i386" + SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` @@ -393,7 +414,7 @@ exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} @@ -579,8 +600,9 @@ else IBM_ARCH=powerpc fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi @@ -617,13 +639,13 @@ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi @@ -662,11 +684,11 @@ exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = "hppa2.0w" ] + if [ ${HP_ARCH} = hppa2.0w ] then eval $set_cc_for_build @@ -679,12 +701,12 @@ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} @@ -789,14 +811,14 @@ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) @@ -878,7 +900,7 @@ exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix @@ -901,7 +923,7 @@ EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) @@ -932,6 +954,9 @@ crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -944,6 +969,9 @@ ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -1020,7 +1048,7 @@ echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} @@ -1099,7 +1127,7 @@ # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; @@ -1248,6 +1276,9 @@ SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux${UNAME_RELEASE} + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; @@ -1261,9 +1292,9 @@ UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in @@ -1285,7 +1316,7 @@ exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi @@ -1316,7 +1347,7 @@ # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = "386"; then + if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" @@ -1358,7 +1389,7 @@ echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos @@ -1369,6 +1400,9 @@ x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; esac cat >&2 <. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -33,7 +33,7 @@ # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -53,8 +53,7 @@ me=`echo "$0" | sed -e 's,.*/,,'` usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. @@ -68,7 +67,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -117,7 +116,7 @@ case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os @@ -255,12 +254,13 @@ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ + | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ @@ -305,7 +305,7 @@ | riscv32 | riscv64 \ | rl78 | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -313,6 +313,7 @@ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -327,6 +328,9 @@ c6x) basic_machine=tic6x-unknown ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none @@ -372,12 +376,13 @@ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ + | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ @@ -424,12 +429,13 @@ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ + | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -437,6 +443,7 @@ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ + | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -513,6 +520,9 @@ basic_machine=i386-pc os=-aros ;; + asmjs) + basic_machine=asmjs-unknown + ;; aux) basic_machine=m68k-apple os=-aux @@ -774,6 +784,9 @@ basic_machine=m68k-isi os=-sysv ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; m68knommu) basic_machine=m68k-unknown os=-linux @@ -1365,11 +1378,11 @@ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ @@ -1385,7 +1398,8 @@ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1517,6 +1531,8 @@ ;; -nacl*) ;; + -ios) + ;; -none) ;; *) diff -Nru gstreamer-vaapi-0.7.0/build-aux/install-sh gstreamer-vaapi-1.8.2/build-aux/install-sh --- gstreamer-vaapi-0.7.0/build-aux/install-sh 2015-12-07 10:54:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/build-aux/install-sh 2016-06-09 07:27:12.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2013-12-25.23; # UTC +scriptversion=2014-09-12.12; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -324,34 +324,41 @@ # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) + # $RANDOM is not portable (e.g. dash); use it when possible to + # lower collision chance tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + # As "mkdir -p" follows symlinks and we work in /tmp possibly; so + # create the $tmpdir first (and fail if unsuccessful) to make sure + # that nobody tries to guess the $tmpdir name. if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi - rmdir "$tmpdir/d" "$tmpdir" + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; diff -Nru gstreamer-vaapi-0.7.0/build-aux/ltmain.sh gstreamer-vaapi-1.8.2/build-aux/ltmain.sh --- gstreamer-vaapi-0.7.0/build-aux/ltmain.sh 2015-12-07 10:54:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/build-aux/ltmain.sh 2016-06-09 07:27:08.000000000 +0000 @@ -1,9 +1,12 @@ +#! /bin/sh +## DO NOT EDIT - This file generated from ./build-aux/ltmain.in +## by inline-source v2014-01-03.01 -# libtool (GNU libtool) 2.4.2 +# libtool (GNU libtool) 2.4.6 +# Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 1996-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -23,881 +26,2112 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, -# or obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . -# Usage: $progname [OPTION]... [MODE-ARG]... -# -# Provide generalized library-building support services. -# -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --no-quiet, --no-silent -# print informational messages (default) -# --no-warn don't display warning messages -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print more informational messages than default -# --no-verbose don't print the extra informational messages -# --version print version information -# -h, --help, --help-all print short, long, or detailed help message -# -# MODE must be one of the following: -# -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory -# -# MODE-ARGS vary depending on the MODE. When passed as first option, -# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. -# Try `$progname --help --mode=MODE' for a more detailed description of MODE. -# -# When reporting a bug, please describe a test case to reproduce it and -# include the following information: -# -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.11 -# automake: $automake_version -# autoconf: $autoconf_version -# -# Report bugs to . -# GNU libtool home page: . -# General help using GNU software: . PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.2 Debian-2.4.2-1.11" -TIMESTAMP="" -package_revision=1.3337 +VERSION="2.4.6 Debian-2.4.6-0.1" +package_revision=2.4.6 -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + +## ------ ## +## Usage. ## +## ------ ## + +# Run './libtool --help' for help with using this script from the +# command line. + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# After configure completes, it has a better idea of some of the +# shell tools we need than the defaults used by the functions shared +# with bootstrap, so set those here where they can still be over- +# ridden by the user, but otherwise take precedence. + +: ${AUTOCONF="autoconf"} +: ${AUTOMAKE="automake"} + + +## -------------------------- ## +## Source external libraries. ## +## -------------------------- ## + +# Much of our low-level functionality needs to be sourced from external +# libraries, which are installed to $pkgauxdir. + +# Set a version string for this script. +scriptversion=2015-01-20.17; # UTC + +# General shell script boiler plate, and helper functions. +# Written by Gary V. Vaughan, 2004 + +# Copyright (C) 2004-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# 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 3 of the License, or +# (at your option) any later version. + +# As a special exception to the GNU General Public License, if you distribute +# this file as part of a program or library that is built using GNU Libtool, +# you may include this file under the same distribution terms that you use +# for the rest of that program. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNES 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 . + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# Evaluate this file near the top of your script to gain access to +# the functions and variables defined here: +# +# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh +# +# If you need to override any of the default environment variable +# settings, do that before evaluating this file. + + +## -------------------- ## +## Shell normalisation. ## +## -------------------- ## + +# Some shells need a little help to be as Bourne compatible as possible. +# Before doing anything else, make sure all that help has been provided! + +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac + case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} -# NLS nuisances: We save the old values to restore during execute mode. -lt_user_locale= -lt_safe_locale= -for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +# NLS nuisances: We save the old values in case they are required later. +_G_user_locale= +_G_safe_locale= +for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do - eval "if test \"\${$lt_var+set}\" = set; then - save_$lt_var=\$$lt_var - $lt_var=C - export $lt_var - lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" - lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + eval "if test set = \"\${$_G_var+set}\"; then + save_$_G_var=\$$_G_var + $_G_var=C + export $_G_var + _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" + _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done -LC_ALL=C -LANGUAGE=C -export LANGUAGE LC_ALL -$lt_unset CDPATH +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Make sure IFS has a sensible default +sp=' ' +nl=' +' +IFS="$sp $nl" +# There are apparently some retarded systems that use ';' as a PATH separator! +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" +## ------------------------- ## +## Locate command utilities. ## +## ------------------------- ## + + +# func_executable_p FILE +# ---------------------- +# Check that FILE is an executable regular file. +func_executable_p () +{ + test -f "$1" && test -x "$1" +} + + +# func_path_progs PROGS_LIST CHECK_FUNC [PATH] +# -------------------------------------------- +# Search for either a program that responds to --version with output +# containing "GNU", or else returned by CHECK_FUNC otherwise, by +# trying all the directories in PATH with each of the elements of +# PROGS_LIST. +# +# CHECK_FUNC should accept the path to a candidate program, and +# set $func_check_prog_result if it truncates its output less than +# $_G_path_prog_max characters. +func_path_progs () +{ + _G_progs_list=$1 + _G_check_func=$2 + _G_PATH=${3-"$PATH"} + + _G_path_prog_max=0 + _G_path_prog_found=false + _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} + for _G_dir in $_G_PATH; do + IFS=$_G_save_IFS + test -z "$_G_dir" && _G_dir=. + for _G_prog_name in $_G_progs_list; do + for _exeext in '' .EXE; do + _G_path_prog=$_G_dir/$_G_prog_name$_exeext + func_executable_p "$_G_path_prog" || continue + case `"$_G_path_prog" --version 2>&1` in + *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; + *) $_G_check_func $_G_path_prog + func_path_progs_result=$func_check_prog_result + ;; + esac + $_G_path_prog_found && break 3 + done + done + done + IFS=$_G_save_IFS + test -z "$func_path_progs_result" && { + echo "no acceptable sed could be found in \$PATH" >&2 + exit 1 + } +} + + +# We want to be able to use the functions in this file before configure +# has figured out where the best binaries are kept, which means we have +# to search for them ourselves - except when the results are already set +# where we skip the searches. + +# Unless the user overrides by setting SED, search the path for either GNU +# sed, or the sed that truncates its output the least. +test -z "$SED" && { + _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for _G_i in 1 2 3 4 5 6 7; do + _G_sed_script=$_G_sed_script$nl$_G_sed_script + done + echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed + _G_sed_script= + + func_check_prog_sed () + { + _G_path_prog=$1 + + _G_count=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo '' >> conftest.nl + "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + rm -f conftest.sed + SED=$func_path_progs_result +} + + +# Unless the user overrides by setting GREP, search the path for either GNU +# grep, or the grep that truncates its output the least. +test -z "$GREP" && { + func_check_prog_grep () + { + _G_path_prog=$1 + + _G_count=0 + _G_path_prog_max=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo 'GREP' >> conftest.nl + "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + GREP=$func_path_progs_result +} + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# All uppercase variable names are used for environment variables. These +# variables can be overridden by the user before calling a script that +# uses them if a suitable command of that name is not already available +# in the command search PATH. : ${CP="cp -f"} -test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${ECHO="printf %s\n"} +: ${EGREP="$GREP -E"} +: ${FGREP="$GREP -F"} +: ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} -: ${Xsed="$SED -e 1s/^X//"} - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 -EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. -EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. - -exit_status=$EXIT_SUCCESS - -# Make sure IFS has a sensible default -lt_nl=' -' -IFS=" $lt_nl" -dirname="s,/[^/]*$,," -basename="s,^.*/,," -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} # func_dirname may be replaced by extended shell implementation +## -------------------- ## +## Useful sed snippets. ## +## -------------------- ## +sed_dirname='s|/[^/]*$||' +sed_basename='s|^.*/||' -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "${1}" | $SED "$basename"` -} # func_basename may be replaced by extended shell implementation +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s|\([`"$\\]\)|\\\1|g' +# Same as above, but do not quote variable references. +sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi - func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` -} # func_dirname_and_basename may be replaced by extended shell implementation +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' +# Sed substitution that converts a w32 file name or path +# that contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname may be replaced by extended shell implementation +# Re-'\' parameter expansions in output of sed_double_quote_subst that +# were '\'-ed in input to the same. If an odd number of '\' preceded a +# '$' in input to sed_double_quote_subst, that '$' was protected from +# expansion. Since each input '\' is now two '\'s, look for any number +# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. +_G_bs='\\' +_G_bs2='\\\\' +_G_bs4='\\\\\\\\' +_G_dollar='\$' +sed_double_backslash="\ + s/$_G_bs4/&\\ +/g + s/^$_G_bs2$_G_dollar/$_G_bs&/ + s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g + s/\n//g" -# These SED scripts presuppose an absolute path with a trailing slash. -pathcar='s,^/\([^/]*\).*$,\1,' -pathcdr='s,^/[^/]*,,' -removedotparts=':dotsl - s@/\./@/@g - t dotsl - s,/\.$,/,' -collapseslashes='s@/\{1,\}@/@g' -finalslash='s,/*$,/,' +## ----------------- ## +## Global variables. ## +## ----------------- ## + +# Except for the global variables explicitly listed below, the following +# functions in the '^func_' namespace, and the '^require_' namespace +# variables initialised in the 'Resource management' section, sourcing +# this file will not pollute your global namespace with anything +# else. There's no portable way to scope variables in Bourne shell +# though, so actually running these functions will sometimes place +# results into a variable named after the function, and often use +# temporary variables in the '^_G_' namespace. If you are careful to +# avoid using those namespaces casually in your sourcing script, things +# should continue to work as you expect. And, of course, you can freely +# overwrite any of the functions or variables defined here before +# calling anything to customize them. -# func_normal_abspath PATH -# Remove doubled-up and trailing slashes, "." path components, -# and cancel out any ".." path components in PATH after making -# it an absolute path. -# value returned in "$func_normal_abspath_result" -func_normal_abspath () -{ - # Start from root dir and reassemble the path. - func_normal_abspath_result= - func_normal_abspath_tpath=$1 - func_normal_abspath_altnamespace= - case $func_normal_abspath_tpath in - "") - # Empty path, that just means $cwd. - func_stripname '' '/' "`pwd`" - func_normal_abspath_result=$func_stripname_result - return - ;; - # The next three entries are used to spot a run of precisely - # two leading slashes without using negated character classes; - # we take advantage of case's first-match behaviour. - ///*) - # Unusual form of absolute path, do nothing. - ;; - //*) - # Not necessarily an ordinary path; POSIX reserves leading '//' - # and for example Cygwin uses it to access remote file shares - # over CIFS/SMB, so we conserve a leading double slash if found. - func_normal_abspath_altnamespace=/ - ;; - /*) - # Absolute path, do nothing. - ;; - *) - # Relative path, prepend $cwd. - func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath - ;; - esac - # Cancel out all the simple stuff to save iterations. We also want - # the path to end with a slash for ease of parsing, so make sure - # there is one (and only one) here. - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` - while :; do - # Processed it all yet? - if test "$func_normal_abspath_tpath" = / ; then - # If we ascended to the root using ".." the result may be empty now. - if test -z "$func_normal_abspath_result" ; then - func_normal_abspath_result=/ - fi - break - fi - func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcar"` - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcdr"` - # Figure out what to do with it - case $func_normal_abspath_tcomponent in - "") - # Trailing empty path component, ignore it. - ;; - ..) - # Parent dir; strip last assembled component from result. - func_dirname "$func_normal_abspath_result" - func_normal_abspath_result=$func_dirname_result - ;; - *) - # Actual path component, append it. - func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent - ;; - esac - done - # Restore leading double-slash if one was found on entry. - func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result -} +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. -# func_relative_path SRCDIR DSTDIR -# generates a relative path from SRCDIR to DSTDIR, with a trailing -# slash if non-empty, suitable for immediately appending a filename -# without needing to append a separator. -# value returned in "$func_relative_path_result" -func_relative_path () -{ - func_relative_path_result= - func_normal_abspath "$1" - func_relative_path_tlibdir=$func_normal_abspath_result - func_normal_abspath "$2" - func_relative_path_tbindir=$func_normal_abspath_result - - # Ascend the tree starting from libdir - while :; do - # check if we have found a prefix of bindir - case $func_relative_path_tbindir in - $func_relative_path_tlibdir) - # found an exact match - func_relative_path_tcancelled= - break - ;; - $func_relative_path_tlibdir*) - # found a matching prefix - func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" - func_relative_path_tcancelled=$func_stripname_result - if test -z "$func_relative_path_result"; then - func_relative_path_result=. - fi - break - ;; - *) - func_dirname $func_relative_path_tlibdir - func_relative_path_tlibdir=${func_dirname_result} - if test "x$func_relative_path_tlibdir" = x ; then - # Have to descend all the way to the root! - func_relative_path_result=../$func_relative_path_result - func_relative_path_tcancelled=$func_relative_path_tbindir - break - fi - func_relative_path_result=../$func_relative_path_result - ;; - esac - done +# Allow overriding, eg assuming that you follow the convention of +# putting '$debug_cmd' at the start of all your functions, you can get +# bash to show function call trace with: +# +# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name +debug_cmd=${debug_cmd-":"} +exit_cmd=: - # Now calculate path; take care to avoid doubling-up slashes. - func_stripname '' '/' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - func_stripname '/' '/' "$func_relative_path_tcancelled" - if test "x$func_stripname_result" != x ; then - func_relative_path_result=${func_relative_path_result}/${func_stripname_result} - fi +# By convention, finish your script with: +# +# exit $exit_status +# +# so that you can set exit_status to non-zero if you want to indicate +# something went wrong during execution without actually bailing out at +# the point of failure. +exit_status=$EXIT_SUCCESS - # Normalisation. If bindir is libdir, return empty string, - # else relative path ending with a slash; either way, target - # file name can be directly appended. - if test ! -z "$func_relative_path_result"; then - func_stripname './' '' "$func_relative_path_result/" - func_relative_path_result=$func_stripname_result - fi -} +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath=$0 -# The name of this program: -func_dirname_and_basename "$progpath" -progname=$func_basename_result +# The name of this program. +progname=`$ECHO "$progpath" |$SED "$sed_basename"` -# Make sure we have an absolute path for reexecution: +# Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) - progdir=$func_dirname_result + progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` - progpath="$progdir/$progname" + progpath=$progdir/$progname ;; *) - save_IFS="$IFS" + _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do - IFS="$save_IFS" + IFS=$_G_IFS test -x "$progdir/$progname" && break done - IFS="$save_IFS" + IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` - progpath="$progdir/$progname" + progpath=$progdir/$progname ;; esac -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed="${SED}"' -e 1s/^X//' -sed_quote_subst='s/\([`"$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution that turns a string into a regex matching for the -# string literally. -sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' -# Sed substitution that converts a w32 file name or path -# which contains forward slashes, into one that contains -# (escaped) backslashes. A very naive implementation. -lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - -# Re-`\' parameter expansions in output of double_quote_subst that were -# `\'-ed in input to the same. If an odd number of `\' preceded a '$' -# in input to double_quote_subst, that '$' was protected from expansion. -# Since each input `\' is now two `\'s, look for any number of runs of -# four `\'s followed by two `\'s and then a '$'. `\' that '$'. -bs='\\' -bs2='\\\\' -bs4='\\\\\\\\' -dollar='\$' -sed_double_backslash="\ - s/$bs4/&\\ -/g - s/^$bs2$dollar/$bs&/ - s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g - s/\n//g" +## ----------------- ## +## Standard options. ## +## ----------------- ## + +# The following options affect the operation of the functions defined +# below, and should be set appropriately depending on run-time para- +# meters passed on the command line. -# Standard options: opt_dry_run=false -opt_help=false opt_quiet=false opt_verbose=false -opt_warning=: - -# func_echo arg... -# Echo program name prefixed message, along with the current mode -# name if it has been set yet. -func_echo () -{ - $ECHO "$progname: ${opt_mode+$opt_mode: }$*" -} -# func_verbose arg... -# Echo program name prefixed message in verbose mode only. -func_verbose () -{ - $opt_verbose && func_echo ${1+"$@"} +# Categories 'all' and 'none' are always available. Append any others +# you will pass as the first argument to func_warning from your own +# code. +warning_categories= + +# By default, display warnings according to 'opt_warning_types'. Set +# 'warning_func' to ':' to elide all warnings, or func_fatal_error to +# treat the next displayed warning as a fatal error. +warning_func=func_warn_and_continue + +# Set to 'all' to display all warnings, 'none' to suppress all +# warnings, or a space delimited list of some subset of +# 'warning_categories' to display only the listed warnings. +opt_warning_types=all + + +## -------------------- ## +## Resource management. ## +## -------------------- ## + +# This section contains definitions for functions that each ensure a +# particular resource (a file, or a non-empty configuration variable for +# example) is available, and if appropriate to extract default values +# from pertinent package files. Call them using their associated +# 'require_*' variable to ensure that they are executed, at most, once. +# +# It's entirely deliberate that calling these functions can set +# variables that don't obey the namespace limitations obeyed by the rest +# of this file, in order that that they be as useful as possible to +# callers. + + +# require_term_colors +# ------------------- +# Allow display of bold text on terminals that support it. +require_term_colors=func_require_term_colors +func_require_term_colors () +{ + $debug_cmd + + test -t 1 && { + # COLORTERM and USE_ANSI_COLORS environment variables take + # precedence, because most terminfo databases neglect to describe + # whether color sequences are supported. + test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} + + if test 1 = "$USE_ANSI_COLORS"; then + # Standard ANSI escape sequences + tc_reset='' + tc_bold=''; tc_standout='' + tc_red=''; tc_green='' + tc_blue=''; tc_cyan='' + else + # Otherwise trust the terminfo database after all. + test -n "`tput sgr0 2>/dev/null`" && { + tc_reset=`tput sgr0` + test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` + tc_standout=$tc_bold + test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` + test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` + test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` + test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` + test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` + } + fi + } - # A bug in bash halts the script if the last line of a function - # fails when set -e is in force, so we need another command to - # work around that: - : + require_term_colors=: } -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} -# func_error arg... -# Echo program name prefixed message to standard error. -func_error () -{ - $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 -} +## ----------------- ## +## Function library. ## +## ----------------- ## -# func_warning arg... -# Echo program name prefixed warning message to standard error. -func_warning () -{ - $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 +# This section contains a variety of useful functions to call in your +# scripts. Take note of the portable wrappers for features provided by +# some modern shells, which will fall back to slower equivalents on +# less featureful shells. - # bash bug again: - : -} -# func_fatal_error arg... -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () -{ - func_error ${1+"$@"} - exit $EXIT_FAILURE -} +# func_append VAR VALUE +# --------------------- +# Append VALUE onto the existing contents of VAR. -# func_fatal_help arg... -# Echo program name prefixed message to standard error, followed by -# a help hint, and exit. -func_fatal_help () -{ - func_error ${1+"$@"} - func_fatal_error "$help" -} -help="Try \`$progname --help' for more information." ## default + # We should try to minimise forks, especially on Windows where they are + # unreasonably slow, so skip the feature probes when bash or zsh are + # being used: + if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then + : ${_G_HAVE_ARITH_OP="yes"} + : ${_G_HAVE_XSI_OPS="yes"} + # The += operator was introduced in bash 3.1 + case $BASH_VERSION in + [12].* | 3.0 | 3.0*) ;; + *) + : ${_G_HAVE_PLUSEQ_OP="yes"} + ;; + esac + fi + # _G_HAVE_PLUSEQ_OP + # Can be empty, in which case the shell is probed, "yes" if += is + # useable or anything else if it does not work. + test -z "$_G_HAVE_PLUSEQ_OP" \ + && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ + && _G_HAVE_PLUSEQ_OP=yes + +if test yes = "$_G_HAVE_PLUSEQ_OP" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_append () + { + $debug_cmd + + eval "$1+=\$2" + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_append () + { + $debug_cmd + + eval "$1=\$$1\$2" + } +fi + + +# func_append_quoted VAR VALUE +# ---------------------------- +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +if test yes = "$_G_HAVE_PLUSEQ_OP"; then + eval 'func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1+=\\ \$func_quote_for_eval_result" + }' +else + func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1=\$$1\\ \$func_quote_for_eval_result" + } +fi + + +# func_append_uniq VAR VALUE +# -------------------------- +# Append unique VALUE onto the existing contents of VAR, assuming +# entries are delimited by the first character of VALUE. For example: +# +# func_append_uniq options " --another-option option-argument" +# +# will only append to $options if " --another-option option-argument " +# is not already present somewhere in $options already (note spaces at +# each end implied by leading space in second argument). +func_append_uniq () +{ + $debug_cmd + + eval _G_current_value='`$ECHO $'$1'`' + _G_delim=`expr "$2" : '\(.\)'` + + case $_G_delim$_G_current_value$_G_delim in + *"$2$_G_delim"*) ;; + *) func_append "$@" ;; + esac +} + + +# func_arith TERM... +# ------------------ +# Set func_arith_result to the result of evaluating TERMs. + test -z "$_G_HAVE_ARITH_OP" \ + && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ + && _G_HAVE_ARITH_OP=yes + +if test yes = "$_G_HAVE_ARITH_OP"; then + eval 'func_arith () + { + $debug_cmd + + func_arith_result=$(( $* )) + }' +else + func_arith () + { + $debug_cmd + + func_arith_result=`expr "$@"` + } +fi + + +# func_basename FILE +# ------------------ +# Set func_basename_result to FILE with everything up to and including +# the last / stripped. +if test yes = "$_G_HAVE_XSI_OPS"; then + # If this shell supports suffix pattern removal, then use it to avoid + # forking. Hide the definitions single quotes in case the shell chokes + # on unsupported syntax... + _b='func_basename_result=${1##*/}' + _d='case $1 in + */*) func_dirname_result=${1%/*}$2 ;; + * ) func_dirname_result=$3 ;; + esac' + +else + # ...otherwise fall back to using sed. + _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' + _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` + if test "X$func_dirname_result" = "X$1"; then + func_dirname_result=$3 + else + func_append func_dirname_result "$2" + fi' +fi + +eval 'func_basename () +{ + $debug_cmd + + '"$_b"' +}' + + +# func_dirname FILE APPEND NONDIR_REPLACEMENT +# ------------------------------------------- +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +eval 'func_dirname () +{ + $debug_cmd -# func_grep expression filename + '"$_d"' +}' + + +# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT +# -------------------------------------------------------- +# Perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# For efficiency, we do not delegate to the functions above but instead +# duplicate the functionality here. +eval 'func_dirname_and_basename () +{ + $debug_cmd + + '"$_b"' + '"$_d"' +}' + + +# func_echo ARG... +# ---------------- +# Echo program name prefixed message. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_echo_all ARG... +# -------------------- +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + + +# func_echo_infix_1 INFIX ARG... +# ------------------------------ +# Echo program name, followed by INFIX on the first line, with any +# additional lines not showing INFIX. +func_echo_infix_1 () +{ + $debug_cmd + + $require_term_colors + + _G_infix=$1; shift + _G_indent=$_G_infix + _G_prefix="$progname: $_G_infix: " + _G_message=$* + + # Strip color escape sequences before counting printable length + for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" + do + test -n "$_G_tc" && { + _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` + _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` + } + done + _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes + + func_echo_infix_1_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_infix_1_IFS + $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 + _G_prefix=$_G_indent + done + IFS=$func_echo_infix_1_IFS +} + + +# func_error ARG... +# ----------------- +# Echo program name prefixed message to standard error. +func_error () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 +} + + +# func_fatal_error ARG... +# ----------------------- +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + $debug_cmd + + func_error "$*" + exit $EXIT_FAILURE +} + + +# func_grep EXPRESSION FILENAME +# ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { + $debug_cmd + $GREP "$1" "$2" >/dev/null 2>&1 } -# func_mkdir_p directory-path +# func_len STRING +# --------------- +# Set func_len_result to the length of STRING. STRING may not +# start with a hyphen. + test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_len () + { + $debug_cmd + + func_len_result=${#1} + }' +else + func_len () + { + $debug_cmd + + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` + } +fi + + +# func_mkdir_p DIRECTORY-PATH +# --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { - my_directory_path="$1" - my_dir_list= + $debug_cmd + + _G_directory_path=$1 + _G_dir_list= - if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then - # Protect directory names starting with `-' - case $my_directory_path in - -*) my_directory_path="./$my_directory_path" ;; + # Protect directory names starting with '-' + case $_G_directory_path in + -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... - while test ! -d "$my_directory_path"; do + while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. - my_dir_list="$my_directory_path:$my_dir_list" + _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done - case $my_directory_path in */*) ;; *) break ;; esac + case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done - my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` - save_mkdir_p_IFS="$IFS"; IFS=':' - for my_dir in $my_dir_list; do - IFS="$save_mkdir_p_IFS" - # mkdir can fail with a `File exist' error if two processes + func_mkdir_p_IFS=$IFS; IFS=: + for _G_dir in $_G_dir_list; do + IFS=$func_mkdir_p_IFS + # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! - $MKDIR "$my_dir" 2>/dev/null || : + $MKDIR "$_G_dir" 2>/dev/null || : done - IFS="$save_mkdir_p_IFS" + IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. - test -d "$my_directory_path" || \ - func_fatal_error "Failed to create \`$1'" + test -d "$_G_directory_path" || \ + func_fatal_error "Failed to create '$1'" fi } -# func_mktempdir [string] +# func_mktempdir [BASENAME] +# ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. +# given, BASENAME is the basename for that directory. func_mktempdir () { - my_template="${TMPDIR-/tmp}/${1-$progname}" + $debug_cmd + + _G_template=${TMPDIR-/tmp}/${1-$progname} - if test "$opt_dry_run" = ":"; then + if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" + _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` - if test ! -d "$my_tmpdir"; then + if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" + _G_tmpdir=$_G_template-${RANDOM-0}$$ + + func_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$_G_tmpdir" + umask $func_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$_G_tmpdir" || \ + func_fatal_error "cannot create temporary directory '$_G_tmpdir'" + fi + + $ECHO "$_G_tmpdir" +} + + +# func_normal_abspath PATH +# ------------------------ +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +func_normal_abspath () +{ + $debug_cmd + + # These SED scripts presuppose an absolute path with a trailing slash. + _G_pathcar='s|^/\([^/]*\).*$|\1|' + _G_pathcdr='s|^/[^/]*||' + _G_removedotparts=':dotsl + s|/\./|/|g + t dotsl + s|/\.$|/|' + _G_collapseslashes='s|/\{1,\}|/|g' + _G_finalslash='s|/*$|/|' + + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` + while :; do + # Processed it all yet? + if test / = "$func_normal_abspath_tpath"; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result"; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + + +# func_notquiet ARG... +# -------------------- +# Echo program name prefixed message only when not in quiet mode. +func_notquiet () +{ + $debug_cmd + + $opt_quiet || func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + + +# func_relative_path SRCDIR DSTDIR +# -------------------------------- +# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. +func_relative_path () +{ + $debug_cmd + + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=$func_dirname_result + if test -z "$func_relative_path_tlibdir"; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test -n "$func_stripname_result"; then + func_append func_relative_path_result "/$func_stripname_result" + fi + + # Normalisation. If bindir is libdir, return '.' else relative path. + if test -n "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + fi + + test -n "$func_relative_path_result" || func_relative_path_result=. + + : +} + + +# func_quote_for_eval ARG... +# -------------------------- +# Aesthetically quote ARGs to be evaled later. +# This function returns two values: +# i) func_quote_for_eval_result +# double-quoted, suitable for a subsequent eval +# ii) func_quote_for_eval_unquoted_result +# has all characters that are still active within double +# quotes backslashified. +func_quote_for_eval () +{ + $debug_cmd + + func_quote_for_eval_unquoted_result= + func_quote_for_eval_result= + while test 0 -lt $#; do + case $1 in + *[\\\`\"\$]*) + _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; + *) + _G_unquoted_arg=$1 ;; + esac + if test -n "$func_quote_for_eval_unquoted_result"; then + func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" + else + func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" + fi + + case $_G_unquoted_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + _G_quoted_arg=\"$_G_unquoted_arg\" + ;; + *) + _G_quoted_arg=$_G_unquoted_arg + ;; + esac + + if test -n "$func_quote_for_eval_result"; then + func_append func_quote_for_eval_result " $_G_quoted_arg" + else + func_append func_quote_for_eval_result "$_G_quoted_arg" + fi + shift + done +} + + +# func_quote_for_expand ARG +# ------------------------- +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + $debug_cmd + + case $1 in + *[\\\`\"]*) + _G_arg=`$ECHO "$1" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; + *) + _G_arg=$1 ;; + esac + + case $_G_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + _G_arg=\"$_G_arg\" + ;; + esac + + func_quote_for_expand_result=$_G_arg +} + + +# func_stripname PREFIX SUFFIX NAME +# --------------------------------- +# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_stripname () + { + $debug_cmd + + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary variable first. + func_stripname_result=$3 + func_stripname_result=${func_stripname_result#"$1"} + func_stripname_result=${func_stripname_result%"$2"} + }' +else + func_stripname () + { + $debug_cmd + + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; + esac + } +fi + + +# func_show_eval CMD [FAIL_EXP] +# ----------------------------- +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + func_quote_for_expand "$_G_cmd" + eval "func_notquiet $func_quote_for_expand_result" + + $opt_dry_run || { + eval "$_G_cmd" + _G_status=$? + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_show_eval_locale CMD [FAIL_EXP] +# ------------------------------------ +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + $opt_quiet || { + func_quote_for_expand "$_G_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + $opt_dry_run || { + eval "$_G_user_locale + $_G_cmd" + _G_status=$? + eval "$_G_safe_locale" + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_tr_sh +# ---------- +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + $debug_cmd + + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_verbose ARG... +# ------------------- +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $debug_cmd + + $opt_verbose && func_echo "$*" + + : +} + + +# func_warn_and_continue ARG... +# ----------------------------- +# Echo program name prefixed warning message to standard error. +func_warn_and_continue () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 +} + + +# func_warning CATEGORY ARG... +# ---------------------------- +# Echo program name prefixed warning message to standard error. Warning +# messages can be filtered according to CATEGORY, where this function +# elides messages where CATEGORY is not listed in the global variable +# 'opt_warning_types'. +func_warning () +{ + $debug_cmd + + # CATEGORY must be in the warning_categories list! + case " $warning_categories " in + *" $1 "*) ;; + *) func_internal_error "invalid warning category '$1'" ;; + esac + + _G_category=$1 + shift + + case " $opt_warning_types " in + *" $_G_category "*) $warning_func ${1+"$@"} ;; + esac +} + + +# func_sort_ver VER1 VER2 +# ----------------------- +# 'sort -V' is not generally available. +# Note this deviates from the version comparison in automake +# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a +# but this should suffice as we won't be specifying old +# version formats or redundant trailing .0 in bootstrap.conf. +# If we did want full compatibility then we should probably +# use m4_version_compare from autoconf. +func_sort_ver () +{ + $debug_cmd + + printf '%s\n%s\n' "$1" "$2" \ + | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n +} + +# func_lt_ver PREV CURR +# --------------------- +# Return true if PREV and CURR are in the correct order according to +# func_sort_ver, otherwise false. Use it like this: +# +# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." +func_lt_ver () +{ + $debug_cmd + + test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: +#! /bin/sh + +# Set a version string for this script. +scriptversion=2014-01-07.03; # UTC + +# A portable, pluggable option parser for Bourne shell. +# Written by Gary V. Vaughan, 2010 + +# Copyright (C) 2010-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# 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 3 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, see . + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# This file is a library for parsing options in your shell scripts along +# with assorted other useful supporting features that you can make use +# of too. +# +# For the simplest scripts you might need only: +# +# #!/bin/sh +# . relative/path/to/funclib.sh +# . relative/path/to/options-parser +# scriptversion=1.0 +# func_options ${1+"$@"} +# eval set dummy "$func_options_result"; shift +# ...rest of your script... +# +# In order for the '--version' option to work, you will need to have a +# suitably formatted comment like the one at the top of this file +# starting with '# Written by ' and ending with '# warranty; '. +# +# For '-h' and '--help' to work, you will also need a one line +# description of your script's purpose in a comment directly above the +# '# Written by ' line, like the one at the top of this file. +# +# The default options also support '--debug', which will turn on shell +# execution tracing (see the comment above debug_cmd below for another +# use), and '--verbose' and the func_verbose function to allow your script +# to display verbose messages only when your user has specified +# '--verbose'. +# +# After sourcing this file, you can plug processing for additional +# options by amending the variables from the 'Configuration' section +# below, and following the instructions in the 'Option parsing' +# section further down. + +## -------------- ## +## Configuration. ## +## -------------- ## + +# You should override these variables in your script after sourcing this +# file so that they reflect the customisations you have added to the +# option parser. + +# The usage line for option parsing errors and the start of '-h' and +# '--help' output messages. You can embed shell variables for delayed +# expansion at the time the message is displayed, but you will need to +# quote other shell meta-characters carefully to prevent them being +# expanded when the contents are evaled. +usage='$progpath [OPTION]...' + +# Short help message in response to '-h' and '--help'. Add to this or +# override it after sourcing this library to reflect the full set of +# options your script accepts. +usage_message="\ + --debug enable verbose shell tracing + -W, --warnings=CATEGORY + report the warnings falling in CATEGORY [all] + -v, --verbose verbosely report processing + --version print version information and exit + -h, --help print short or long help message and exit +" + +# Additional text appended to 'usage_message' in response to '--help'. +long_help_message=" +Warning categories include: + 'all' show all warnings + 'none' turn off all the warnings + 'error' warnings are treated as fatal errors" + +# Help message printed before fatal option parsing errors. +fatal_help="Try '\$progname --help' for more information." + + + +## ------------------------- ## +## Hook function management. ## +## ------------------------- ## + +# This section contains functions for adding, removing, and running hooks +# to the main code. A hook is just a named list of of function, that can +# be run in order later on. + +# func_hookable FUNC_NAME +# ----------------------- +# Declare that FUNC_NAME will run hooks added with +# 'func_add_hook FUNC_NAME ...'. +func_hookable () +{ + $debug_cmd + + func_append hookable_fns " $1" +} + + +# func_add_hook FUNC_NAME HOOK_FUNC +# --------------------------------- +# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must +# first have been declared "hookable" by a call to 'func_hookable'. +func_add_hook () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not accept hook functions." ;; + esac + + eval func_append ${1}_hooks '" $2"' +} + + +# func_remove_hook FUNC_NAME HOOK_FUNC +# ------------------------------------ +# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +func_remove_hook () +{ + $debug_cmd + + eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' +} + + +# func_run_hooks FUNC_NAME [ARG]... +# --------------------------------- +# Run all hook functions registered to FUNC_NAME. +# It is assumed that the list of hook functions contains nothing more +# than a whitespace-delimited list of legal shell function names, and +# no effort is wasted trying to catch shell meta-characters or preserve +# whitespace. +func_run_hooks () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not support hook funcions.n" ;; + esac + + eval _G_hook_fns=\$$1_hooks; shift + + for _G_hook in $_G_hook_fns; do + eval $_G_hook '"$@"' + + # store returned options list back into positional + # parameters for next 'cmd' execution. + eval _G_hook_result=\$${_G_hook}_result + eval set dummy "$_G_hook_result"; shift + done + + func_quote_for_eval ${1+"$@"} + func_run_hooks_result=$func_quote_for_eval_result +} + + + +## --------------- ## +## Option parsing. ## +## --------------- ## + +# In order to add your own option parsing hooks, you must accept the +# full positional parameter list in your hook function, remove any +# options that you action, and then pass back the remaining unprocessed +# options in '_result', escaped suitably for +# 'eval'. Like this: +# +# my_options_prep () +# { +# $debug_cmd +# +# # Extend the existing usage message. +# usage_message=$usage_message' +# -s, --silent don'\''t print informational messages +# ' +# +# func_quote_for_eval ${1+"$@"} +# my_options_prep_result=$func_quote_for_eval_result +# } +# func_add_hook func_options_prep my_options_prep +# +# +# my_silent_option () +# { +# $debug_cmd +# +# # Note that for efficiency, we parse as many options as we can +# # recognise in a loop before passing the remainder back to the +# # caller on the first unrecognised argument we encounter. +# while test $# -gt 0; do +# opt=$1; shift +# case $opt in +# --silent|-s) opt_silent=: ;; +# # Separate non-argument short options: +# -s*) func_split_short_opt "$_G_opt" +# set dummy "$func_split_short_opt_name" \ +# "-$func_split_short_opt_arg" ${1+"$@"} +# shift +# ;; +# *) set dummy "$_G_opt" "$*"; shift; break ;; +# esac +# done +# +# func_quote_for_eval ${1+"$@"} +# my_silent_option_result=$func_quote_for_eval_result +# } +# func_add_hook func_parse_options my_silent_option +# +# +# my_option_validation () +# { +# $debug_cmd +# +# $opt_silent && $opt_verbose && func_fatal_help "\ +# '--silent' and '--verbose' options are mutually exclusive." +# +# func_quote_for_eval ${1+"$@"} +# my_option_validation_result=$func_quote_for_eval_result +# } +# func_add_hook func_validate_options my_option_validation +# +# You'll alse need to manually amend $usage_message to reflect the extra +# options you parse. It's preferable to append if you can, so that +# multiple option parsing hooks can be added safely. + + +# func_options [ARG]... +# --------------------- +# All the functions called inside func_options are hookable. See the +# individual implementations for details. +func_hookable func_options +func_options () +{ + $debug_cmd - save_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$my_tmpdir" - umask $save_mktempdir_umask - fi + func_options_prep ${1+"$@"} + eval func_parse_options \ + ${func_options_prep_result+"$func_options_prep_result"} + eval func_validate_options \ + ${func_parse_options_result+"$func_parse_options_result"} - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || \ - func_fatal_error "cannot create temporary directory \`$my_tmpdir'" - fi + eval func_run_hooks func_options \ + ${func_validate_options_result+"$func_validate_options_result"} - $ECHO "$my_tmpdir" + # save modified positional parameters for caller + func_options_result=$func_run_hooks_result } -# func_quote_for_eval arg -# Aesthetically quote ARG to be evaled later. -# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT -# is double-quoted, suitable for a subsequent eval, whereas -# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters -# which are still active within double quotes backslashified. -func_quote_for_eval () +# func_options_prep [ARG]... +# -------------------------- +# All initialisations required before starting the option parse loop. +# Note that when calling hook functions, we pass through the list of +# positional parameters. If a hook function modifies that list, and +# needs to propogate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before +# returning. +func_hookable func_options_prep +func_options_prep () { - case $1 in - *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; - *) - func_quote_for_eval_unquoted_result="$1" ;; - esac + $debug_cmd - case $func_quote_for_eval_unquoted_result in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and and variable - # expansion for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" - ;; - *) - func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" - esac + # Option defaults: + opt_verbose=false + opt_warning_types= + + func_run_hooks func_options_prep ${1+"$@"} + + # save modified positional parameters for caller + func_options_prep_result=$func_run_hooks_result } -# func_quote_for_expand arg -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () +# func_parse_options [ARG]... +# --------------------------- +# The main option parsing loop. +func_hookable func_parse_options +func_parse_options () { - case $1 in - *[\\\`\"]*) - my_arg=`$ECHO "$1" | $SED \ - -e "$double_quote_subst" -e "$sed_double_backslash"` ;; - *) - my_arg="$1" ;; - esac + $debug_cmd - case $my_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - my_arg="\"$my_arg\"" - ;; - esac + func_parse_options_result= - func_quote_for_expand_result="$my_arg" -} + # this just eases exit handling + while test $# -gt 0; do + # Defer to hook functions for initial option parsing, so they + # get priority in the event of reusing an option name. + func_run_hooks func_parse_options ${1+"$@"} + # Adjust func_parse_options positional parameters to match + eval set dummy "$func_run_hooks_result"; shift -# func_show_eval cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. -func_show_eval () -{ - my_cmd="$1" - my_fail_exp="${2-:}" + # Break out of the loop if we already parsed every option. + test $# -gt 0 || break - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } + _G_opt=$1 + shift + case $_G_opt in + --debug|-x) debug_cmd='set -x' + func_echo "enabling shell trace mode" + $debug_cmd + ;; + + --no-warnings|--no-warning|--no-warn) + set dummy --warnings none ${1+"$@"} + shift + ;; - if ${opt_dry_run-false}; then :; else - eval "$my_cmd" - my_status=$? - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi + --warnings|--warning|-W) + test $# = 0 && func_missing_arg $_G_opt && break + case " $warning_categories $1" in + *" $1 "*) + # trailing space prevents matching last $1 above + func_append_uniq opt_warning_types " $1" + ;; + *all) + opt_warning_types=$warning_categories + ;; + *none) + opt_warning_types=none + warning_func=: + ;; + *error) + opt_warning_types=$warning_categories + warning_func=func_fatal_error + ;; + *) + func_fatal_error \ + "unsupported warning category: '$1'" + ;; + esac + shift + ;; + + --verbose|-v) opt_verbose=: ;; + --version) func_version ;; + -\?|-h) func_usage ;; + --help) func_help ;; + + # Separate optargs to long options (plugins may need this): + --*=*) func_split_equals "$_G_opt" + set dummy "$func_split_equals_lhs" \ + "$func_split_equals_rhs" ${1+"$@"} + shift + ;; + + # Separate optargs to short options: + -W*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-v*|-x*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + esac + done + + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + func_parse_options_result=$func_quote_for_eval_result } -# func_show_eval_locale cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. Use the saved locale for evaluation. -func_show_eval_locale () +# func_validate_options [ARG]... +# ------------------------------ +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +func_hookable func_validate_options +func_validate_options () { - my_cmd="$1" - my_fail_exp="${2-:}" + $debug_cmd - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } + # Display all warnings if -W was not given. + test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" - if ${opt_dry_run-false}; then :; else - eval "$lt_user_locale - $my_cmd" - my_status=$? - eval "$lt_safe_locale" - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} + func_run_hooks func_validate_options ${1+"$@"} -# func_tr_sh -# Turn $1 into a string suitable for a shell variable name. -# Result is stored in $func_tr_sh_result. All characters -# not in the set a-zA-Z0-9_ are replaced with '_'. Further, -# if $1 begins with a digit, a '_' is prepended as well. -func_tr_sh () -{ - case $1 in - [0-9]* | *[!a-zA-Z0-9_]*) - func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` - ;; - * ) - func_tr_sh_result=$1 - ;; - esac + # Bail if the options were screwed! + $exit_cmd $EXIT_FAILURE + + # save modified positional parameters for caller + func_validate_options_result=$func_run_hooks_result } -# func_version -# Echo version message to standard output and exit. -func_version () -{ - $opt_debug - $SED -n '/(C)/!b go - :more - /\./!{ - N - s/\n# / / - b more - } - :go - /^# '$PROGRAM' (GNU /,/# warranty; / { - s/^# // - s/^# *$// - s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ - p - }' < "$progpath" - exit $? -} +## ----------------- ## +## Helper functions. ## +## ----------------- ## -# func_usage -# Echo short help message to standard output and exit. -func_usage () +# This section contains the helper functions used by the rest of the +# hookable option parser framework in ascii-betical order. + + +# func_fatal_help ARG... +# ---------------------- +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () { - $opt_debug + $debug_cmd - $SED -n '/^# Usage:/,/^# *.*--help/ { - s/^# // - s/^# *$// - s/\$progname/'$progname'/ - p - }' < "$progpath" - echo - $ECHO "run \`$progname --help | more' for full usage" - exit $? + eval \$ECHO \""Usage: $usage"\" + eval \$ECHO \""$fatal_help"\" + func_error ${1+"$@"} + exit $EXIT_FAILURE } -# func_help [NOEXIT] -# Echo long help message to standard output and exit, -# unless 'noexit' is passed as argument. + +# func_help +# --------- +# Echo long help message to standard output and exit. func_help () { - $opt_debug + $debug_cmd - $SED -n '/^# Usage:/,/# Report bugs to/ { - :print - s/^# // - s/^# *$// - s*\$progname*'$progname'* - s*\$host*'"$host"'* - s*\$SHELL*'"$SHELL"'* - s*\$LTCC*'"$LTCC"'* - s*\$LTCFLAGS*'"$LTCFLAGS"'* - s*\$LD*'"$LD"'* - s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ - p - d - } - /^# .* home page:/b print - /^# General help using/b print - ' < "$progpath" - ret=$? - if test -z "$1"; then - exit $ret - fi + func_usage_message + $ECHO "$long_help_message" + exit 0 } -# func_missing_arg argname + +# func_missing_arg ARGNAME +# ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { - $opt_debug + $debug_cmd - func_error "missing argument for $1." + func_error "Missing argument for '$1'." exit_cmd=exit } -# func_split_short_opt shortopt +# func_split_equals STRING +# ------------------------ +# Set func_split_equals_lhs and func_split_equals_rhs shell variables after +# splitting STRING at the '=' sign. +test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=${1%%=*} + func_split_equals_rhs=${1#*=} + test "x$func_split_equals_lhs" = "x$1" \ + && func_split_equals_rhs= + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` + func_split_equals_rhs= + test "x$func_split_equals_lhs" = "x$1" \ + || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` + } +fi #func_split_equals + + +# func_split_short_opt SHORTOPT +# ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. -func_split_short_opt () +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"} + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` + } +fi #func_split_short_opt + + +# func_usage +# ---------- +# Echo short help message to standard output and exit. +func_usage () { - my_sed_short_opt='1s/^\(..\).*$/\1/;q' - my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + $debug_cmd - func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` - func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` -} # func_split_short_opt may be replaced by extended shell implementation + func_usage_message + $ECHO "Run '$progname --help |${PAGER-more}' for full usage" + exit 0 +} -# func_split_long_opt longopt -# Set func_split_long_opt_name and func_split_long_opt_arg shell -# variables after splitting LONGOPT at the `=' sign. -func_split_long_opt () +# func_usage_message +# ------------------ +# Echo short help message to standard output. +func_usage_message () { - my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' - my_sed_long_arg='1s/^--[^=]*=//' + $debug_cmd - func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` - func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` -} # func_split_long_opt may be replaced by extended shell implementation + eval \$ECHO \""Usage: $usage"\" + echo + $SED -n 's|^# || + /^Written by/{ + x;p;x + } + h + /^Written by/q' < "$progpath" + echo + eval \$ECHO \""$usage_message"\" +} -exit_cmd=: +# func_version +# ------------ +# Echo version message to standard output and exit. +func_version () +{ + $debug_cmd + printf '%s\n' "$progname $scriptversion" + $SED -n ' + /(C)/!b go + :more + /\./!{ + N + s|\n# | | + b more + } + :go + /^# Written by /,/# warranty; / { + s|^# || + s|^# *$|| + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + p + } + /^# Written by / { + s|^# || + p + } + /^warranty; /q' < "$progpath" + exit $? +} -magic="%%%MAGIC variable%%%" -magic_exe="%%%MAGIC EXE variable%%%" +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: -# Global variables. -nonopt= -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" -extracted_archives= -extracted_serial=0 +# Set a version string. +scriptversion='(GNU libtool) 2.4.6' -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () +# func_echo ARG... +# ---------------- +# Libtool also displays the current mode in messages, so override +# funclib.sh func_echo with this custom definition. +func_echo () { - eval "${1}=\$${1}\${2}" -} # func_append may be replaced by extended shell implementation + $debug_cmd -# func_append_quoted var value -# Quote VALUE and append to the end of shell variable VAR, separated -# by a space. -func_append_quoted () -{ - func_quote_for_eval "${2}" - eval "${1}=\$${1}\\ \$func_quote_for_eval_result" -} # func_append_quoted may be replaced by extended shell implementation + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" + done + IFS=$func_echo_IFS +} -# func_arith arithmetic-term... -func_arith () +# func_warning ARG... +# ------------------- +# Libtool warnings are not categorized, so override funclib.sh +# func_warning with this simpler definition. +func_warning () { - func_arith_result=`expr "${@}"` -} # func_arith may be replaced by extended shell implementation + $debug_cmd + $warning_func ${1+"$@"} +} -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` -} # func_len may be replaced by extended shell implementation +## ---------------- ## +## Options parsing. ## +## ---------------- ## + +# Hook in the functions to make sure our own options are parsed during +# the option parsing loop. + +usage='$progpath [OPTION]... [MODE-ARG]...' + +# Short help message in response to '-h'. +usage_message="Options: + --config show all configuration variables + --debug enable verbose shell tracing + -n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --mode=MODE use operation mode MODE + --no-warnings equivalent to '-Wnone' + --preserve-dup-deps don't remove duplicate dependency libraries + --quiet, --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + -v, --verbose print more informational messages than default + --version print version information + -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] + -h, --help, --help-all print short, long, or detailed help message +" -# func_lo2o object -func_lo2o () +# Additional text appended to 'usage_message' in response to '--help'. +func_help () { - func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` -} # func_lo2o may be replaced by extended shell implementation + $debug_cmd + func_usage_message + $ECHO "$long_help_message -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` -} # func_xform may be replaced by extended shell implementation +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. When passed as first option, +'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. +Try '$progname --help --mode=MODE' for a more detailed description of MODE. + +When reporting a bug, please describe a test case to reproduce it and +include the following information: + + host-triplet: $host + shell: $SHELL + compiler: $LTCC + compiler flags: $LTCFLAGS + linker: $LD (gnu? $with_gnu_ld) + version: $progname (GNU libtool) 2.4.6 + automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` + autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` + +Report bugs to . +GNU libtool home page: . +General help using GNU software: ." + exit 0 +} + + +# func_lo2o OBJECT-NAME +# --------------------- +# Transform OBJECT-NAME from a '.lo' suffix to the platform specific +# object suffix. + +lo2o=s/\\.lo\$/.$objext/ +o2lo=s/\\.$objext\$/.lo/ + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_lo2o () + { + case $1 in + *.lo) func_lo2o_result=${1%.lo}.$objext ;; + * ) func_lo2o_result=$1 ;; + esac + }' + + # func_xform LIBOBJ-OR-SOURCE + # --------------------------- + # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) + # suffix to a '.lo' libtool-object suffix. + eval 'func_xform () + { + func_xform_result=${1%.*}.lo + }' +else + # ...otherwise fall back to using sed. + func_lo2o () + { + func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` + } + + func_xform () + { + func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` + } +fi -# func_fatal_configuration arg... +# func_fatal_configuration ARG... +# ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { - func_error ${1+"$@"} - func_error "See the $PACKAGE documentation for more information." - func_fatal_error "Fatal configuration error." + func__fatal_error ${1+"$@"} \ + "See the $PACKAGE documentation for more information." \ + "Fatal configuration error." } # func_config +# ----------- # Display the configuration for all the tags in this script. func_config () { @@ -915,17 +2149,19 @@ exit $? } + # func_features +# ------------- # Display the features supported by this script. func_features () { echo "host: $host" - if test "$build_libtool_libs" = yes; then + if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi - if test "$build_old_libs" = yes; then + if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" @@ -934,289 +2170,297 @@ exit $? } -# func_enable_tag tagname + +# func_enable_tag TAGNAME +# ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { - # Global variable: - tagname="$1" + # Global variable: + tagname=$1 - re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" - re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" - sed_extractcf="/$re_begincf/,/$re_endcf/p" - - # Validate tagname. - case $tagname in - *[!-_A-Za-z0-9,/]*) - func_fatal_error "invalid tag name: $tagname" - ;; - esac + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf=/$re_begincf/,/$re_endcf/p + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac - # Don't test for the "default" C tag, as we know it's - # there but not specially marked. - case $tagname in - CC) ;; + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; *) - if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then - taglist="$taglist $tagname" + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" - # Evaluate the configuration. Be careful to quote the path - # and the sed script, to avoid splitting on whitespace, but - # also don't use non-portable quotes within backquotes within - # quotes we have to do it in 2 steps: - extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` - eval "$extractedcf" - else - func_error "ignoring unknown tag $tagname" - fi - ;; - esac + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac } + # func_check_version_match +# ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF - else - cat >&2 <<_LT_EOF + else + cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF - fi - else - cat >&2 <<_LT_EOF + fi + else + cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF - fi + fi - exit $EXIT_MISMATCH - fi + exit $EXIT_MISMATCH + fi } -# Shorthand for --mode=foo, only valid as the first argument -case $1 in -clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; -compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; -execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; -finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; -install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; -link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; -uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; -esac +# libtool_options_prep [ARG]... +# ----------------------------- +# Preparation for options parsed by libtool. +libtool_options_prep () +{ + $debug_mode + # Option defaults: + opt_config=false + opt_dlopen= + opt_dry_run=false + opt_help=false + opt_mode= + opt_preserve_dup_deps=false + opt_quiet=false + nonopt= + preserve_args= -# Option defaults: -opt_debug=: -opt_dry_run=false -opt_config=false -opt_preserve_dup_deps=false -opt_features=false -opt_finish=false -opt_help=false -opt_help_all=false -opt_silent=: -opt_warning=: -opt_verbose=: -opt_silent=false -opt_verbose=false + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; + esac + # Pass back the list of options. + func_quote_for_eval ${1+"$@"} + libtool_options_prep_result=$func_quote_for_eval_result +} +func_add_hook func_options_prep libtool_options_prep -# Parse options once, thoroughly. This comes as soon as possible in the -# script to make things like `--version' happen as quickly as we can. -{ - # this just eases exit handling - while test $# -gt 0; do - opt="$1" - shift - case $opt in - --debug|-x) opt_debug='set -x' - func_echo "enabling shell trace mode" - $opt_debug - ;; - --dry-run|--dryrun|-n) - opt_dry_run=: - ;; - --config) - opt_config=: -func_config - ;; - --dlopen|-dlopen) - optarg="$1" - opt_dlopen="${opt_dlopen+$opt_dlopen -}$optarg" - shift - ;; - --preserve-dup-deps) - opt_preserve_dup_deps=: - ;; - --features) - opt_features=: -func_features - ;; - --finish) - opt_finish=: -set dummy --mode finish ${1+"$@"}; shift - ;; - --help) - opt_help=: - ;; - --help-all) - opt_help_all=: -opt_help=': help-all' - ;; - --mode) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_mode="$optarg" -case $optarg in - # Valid mode arguments: - clean|compile|execute|finish|install|link|relink|uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $opt" - exit_cmd=exit - break - ;; -esac - shift - ;; - --no-silent|--no-quiet) - opt_silent=false -func_append preserve_args " $opt" - ;; - --no-warning|--no-warn) - opt_warning=false -func_append preserve_args " $opt" - ;; - --no-verbose) - opt_verbose=false -func_append preserve_args " $opt" - ;; - --silent|--quiet) - opt_silent=: -func_append preserve_args " $opt" - opt_verbose=false - ;; - --verbose|-v) - opt_verbose=: -func_append preserve_args " $opt" -opt_silent=false - ;; - --tag) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_tag="$optarg" -func_append preserve_args " $opt $optarg" -func_enable_tag "$optarg" - shift - ;; - - -\?|-h) func_usage ;; - --help) func_help ;; - --version) func_version ;; - - # Separate optargs to long options: - --*=*) - func_split_long_opt "$opt" - set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} - shift - ;; - - # Separate non-argument short options: - -\?*|-h*|-n*|-v*) - func_split_short_opt "$opt" - set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - --) break ;; - -*) func_fatal_help "unrecognized option \`$opt'" ;; - *) set dummy "$opt" ${1+"$@"}; shift; break ;; - esac - done - # Validate options: +# libtool_parse_options [ARG]... +# --------------------------------- +# Provide handling for libtool specific options. +libtool_parse_options () +{ + $debug_cmd - # save first non-option argument - if test "$#" -gt 0; then - nonopt="$opt" - shift - fi + # Perform our own loop to consume as many options as possible in + # each iteration. + while test $# -gt 0; do + _G_opt=$1 + shift + case $_G_opt in + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + + --config) func_config ;; + + --dlopen|-dlopen) + opt_dlopen="${opt_dlopen+$opt_dlopen +}$1" + shift + ;; + + --preserve-dup-deps) + opt_preserve_dup_deps=: ;; + + --features) func_features ;; + + --finish) set dummy --mode finish ${1+"$@"}; shift ;; + + --help) opt_help=: ;; + + --help-all) opt_help=': help-all' ;; + + --mode) test $# = 0 && func_missing_arg $_G_opt && break + opt_mode=$1 + case $1 in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $_G_opt" + exit_cmd=exit + break + ;; + esac + shift + ;; + + --no-silent|--no-quiet) + opt_quiet=false + func_append preserve_args " $_G_opt" + ;; + + --no-warnings|--no-warning|--no-warn) + opt_warning=false + func_append preserve_args " $_G_opt" + ;; + + --no-verbose) + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --silent|--quiet) + opt_quiet=: + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --tag) test $# = 0 && func_missing_arg $_G_opt && break + opt_tag=$1 + func_append preserve_args " $_G_opt $1" + func_enable_tag "$1" + shift + ;; + + --verbose|-v) opt_quiet=false + opt_verbose=: + func_append preserve_args " $_G_opt" + ;; - # preserve --debug - test "$opt_debug" = : || func_append preserve_args " --debug" + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + esac + done - case $host in - *cygwin* | *mingw* | *pw32* | *cegcc*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps - ;; - esac - $opt_help || { - # Sanity checks first: - func_check_version_match + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + libtool_parse_options_result=$func_quote_for_eval_result +} +func_add_hook func_parse_options libtool_parse_options - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" - fi - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" - # Only execute mode is allowed to have -dlopen flags. - if test -n "$opt_dlopen" && test "$opt_mode" != execute; then - func_error "unrecognized option \`-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE +# libtool_validate_options [ARG]... +# --------------------------------- +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +libtool_validate_options () +{ + # save first non-option argument + if test 0 -lt $#; then + nonopt=$1 + shift fi - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$opt_mode' for more information." - } + # preserve --debug + test : = "$debug_cmd" || func_append preserve_args " --debug" + + case $host in + # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 + # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 + *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + $opt_help || { + # Sanity checks first: + func_check_version_match + + test yes != "$build_libtool_libs" \ + && test yes != "$build_old_libs" \ + && func_fatal_configuration "not configured to build any kind of library" + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test execute != "$opt_mode"; then + func_error "unrecognized option '-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help=$help + help="Try '$progname --help --mode=$opt_mode' for more information." + } - # Bail if the options were screwed - $exit_cmd $EXIT_FAILURE + # Pass back the unparsed argument list + func_quote_for_eval ${1+"$@"} + libtool_validate_options_result=$func_quote_for_eval_result } +func_add_hook func_validate_options libtool_validate_options + +# Process options as early as possible so that --help and --version +# can return quickly. +func_options ${1+"$@"} +eval set dummy "$func_options_result"; shift @@ -1224,24 +2468,52 @@ ## Main. ## ## ----------- ## +magic='%%%MAGIC variable%%%' +magic_exe='%%%MAGIC EXE variable%%%' + +# Global variables. +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# func_generated_by_libtool +# True iff stdin has been generated by Libtool. This function is only +# a basic sanity check; it will hardly flush out determined imposters. +func_generated_by_libtool_p () +{ + $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + # func_lalib_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. +# True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ - | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 + $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. +# True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be -# fatal anyway. Works if `file' does not exist. +# fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no @@ -1249,13 +2521,13 @@ for lalib_p_l in 1 2 3 4 do read lalib_p_line - case "$lalib_p_line" in + case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi - test "$lalib_p" = yes + test yes = "$lalib_p" } # func_ltwrapper_script_p file @@ -1264,7 +2536,8 @@ # determined imposters. func_ltwrapper_script_p () { - func_lalib_p "$1" + test -f "$1" && + $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file @@ -1289,7 +2562,7 @@ { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" + func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file @@ -1308,11 +2581,13 @@ # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { - $opt_debug + $debug_cmd + save_ifs=$IFS; IFS='~' for cmd in $1; do - IFS=$save_ifs + IFS=$sp$nl eval cmd=\"$cmd\" + IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs @@ -1324,10 +2599,11 @@ # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing -# `FILE.' does not work on cygwin managed mounts. +# 'FILE.' does not work on cygwin managed mounts. func_source () { - $opt_debug + $debug_cmd + case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; @@ -1354,10 +2630,10 @@ # store the result into func_replace_sysroot_result. func_replace_sysroot () { - case "$lt_sysroot:$1" in + case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" - func_replace_sysroot_result="=$func_stripname_result" + func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. @@ -1374,7 +2650,8 @@ # arg is usually of the form 'gcc ...' func_infer_tag () { - $opt_debug + $debug_cmd + if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do @@ -1393,7 +2670,7 @@ for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. @@ -1418,7 +2695,7 @@ # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" - func_fatal_error "specify a tag with \`--tag'" + func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi @@ -1434,15 +2711,15 @@ # but don't create it if we're doing a dry run. func_write_libtool_object () { - write_libobj=${1} - if test "$build_libtool_libs" = yes; then - write_lobj=\'${2}\' + write_libobj=$1 + if test yes = "$build_libtool_libs"; then + write_lobj=\'$2\' else write_lobj=none fi - if test "$build_old_libs" = yes; then - write_oldobj=\'${3}\' + if test yes = "$build_old_libs"; then + write_oldobj=\'$3\' else write_oldobj=none fi @@ -1450,7 +2727,7 @@ $opt_dry_run || { cat >${write_libobj}T </dev/null` - if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | - $SED -e "$lt_sed_naive_backslashify"` + $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi @@ -1514,18 +2792,19 @@ # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { - $opt_debug + $debug_cmd + # unfortunately, winepath doesn't convert paths, only file names - func_convert_core_path_wine_to_w32_result="" + func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" - if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then - func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi @@ -1554,7 +2833,8 @@ # environment variable; do not put it in $PATH. func_cygpath () { - $opt_debug + $debug_cmd + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then @@ -1563,7 +2843,7 @@ fi else func_cygpath_result= - func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath @@ -1574,10 +2854,11 @@ # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { - $opt_debug + $debug_cmd + # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` + $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 @@ -1588,13 +2869,14 @@ # func_to_host_file_result to ARG1). func_convert_file_check () { - $opt_debug - if test -z "$2" && test -n "$1" ; then + $debug_cmd + + if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" - func_error " \`$1'" + func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: - func_to_host_file_result="$1" + func_to_host_file_result=$1 fi } # end func_convert_file_check @@ -1606,10 +2888,11 @@ # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { - $opt_debug + $debug_cmd + if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" - func_error " \`$3'" + func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. @@ -1618,7 +2901,7 @@ func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else - func_to_host_path_result="$3" + func_to_host_path_result=$3 fi fi } @@ -1630,9 +2913,10 @@ # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { - $opt_debug + $debug_cmd + case $4 in - $1 ) func_to_host_path_result="$3$func_to_host_path_result" + $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in @@ -1646,7 +2930,7 @@ ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## -# invoked via `$to_host_file_cmd ARG' +# invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. @@ -1657,7 +2941,8 @@ # in func_to_host_file_result. func_to_host_file () { - $opt_debug + $debug_cmd + $to_host_file_cmd "$1" } # end func_to_host_file @@ -1669,7 +2954,8 @@ # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { - $opt_debug + $debug_cmd + case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 @@ -1687,7 +2973,7 @@ # Copy ARG to func_to_host_file_result. func_convert_file_noop () { - func_to_host_file_result="$1" + func_to_host_file_result=$1 } # end func_convert_file_noop @@ -1698,11 +2984,12 @@ # func_to_host_file_result. func_convert_file_msys_to_w32 () { - $opt_debug - func_to_host_file_result="$1" + $debug_cmd + + func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" - func_to_host_file_result="$func_convert_core_msys_to_w32_result" + func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -1714,8 +3001,9 @@ # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { - $opt_debug - func_to_host_file_result="$1" + $debug_cmd + + func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. @@ -1731,11 +3019,12 @@ # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { - $opt_debug - func_to_host_file_result="$1" + $debug_cmd + + func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" - func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -1747,12 +3036,13 @@ # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { - $opt_debug - func_to_host_file_result="$1" + $debug_cmd + + func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" - func_to_host_file_result="$func_cygpath_result" + func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -1765,13 +3055,14 @@ # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { - $opt_debug - func_to_host_file_result="$1" + $debug_cmd + + func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" - func_to_host_file_result="$func_cygpath_result" + func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -1781,7 +3072,7 @@ ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# -# invoked via `$to_host_path_cmd ARG' +# invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. @@ -1805,10 +3096,11 @@ to_host_path_cmd= func_init_to_host_path_cmd () { - $opt_debug + $debug_cmd + if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" - to_host_path_cmd="func_convert_path_${func_stripname_result}" + to_host_path_cmd=func_convert_path_$func_stripname_result fi } @@ -1818,7 +3110,8 @@ # in func_to_host_path_result. func_to_host_path () { - $opt_debug + $debug_cmd + func_init_to_host_path_cmd $to_host_path_cmd "$1" } @@ -1829,7 +3122,7 @@ # Copy ARG to func_to_host_path_result. func_convert_path_noop () { - func_to_host_path_result="$1" + func_to_host_path_result=$1 } # end func_convert_path_noop @@ -1840,8 +3133,9 @@ # func_to_host_path_result. func_convert_path_msys_to_w32 () { - $opt_debug - func_to_host_path_result="$1" + $debug_cmd + + func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; @@ -1849,7 +3143,7 @@ func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" @@ -1863,8 +3157,9 @@ # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { - $opt_debug - func_to_host_path_result="$1" + $debug_cmd + + func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" @@ -1883,14 +3178,15 @@ # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { - $opt_debug - func_to_host_path_result="$1" + $debug_cmd + + func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" @@ -1904,15 +3200,16 @@ # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { - $opt_debug - func_to_host_path_result="$1" + $debug_cmd + + func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" - func_to_host_path_result="$func_cygpath_result" + func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" @@ -1927,8 +3224,9 @@ # func_to_host_file_result. func_convert_path_nix_to_cygwin () { - $opt_debug - func_to_host_path_result="$1" + $debug_cmd + + func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them @@ -1937,7 +3235,7 @@ func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" - func_to_host_path_result="$func_cygpath_result" + func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" @@ -1946,13 +3244,31 @@ # end func_convert_path_nix_to_cygwin +# func_dll_def_p FILE +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with _LT_DLL_DEF_P in libtool.m4 +func_dll_def_p () +{ + $debug_cmd + + func_dll_def_p_tmp=`$SED -n \ + -e 's/^[ ]*//' \ + -e '/^\(;.*\)*$/d' \ + -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ + -e q \ + "$1"` + test DEF = "$func_dll_def_p_tmp" +} + + # func_mode_compile arg... func_mode_compile () { - $opt_debug + $debug_cmd + # Get the compilation command and the source file. base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" + srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal @@ -1965,12 +3281,12 @@ case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile - lastarg="$arg" + lastarg=$arg arg_mode=normal ;; target ) - libobj="$arg" + libobj=$arg arg_mode=normal continue ;; @@ -1980,7 +3296,7 @@ case $arg in -o) test -n "$libobj" && \ - func_fatal_error "you cannot specify \`-o' more than once" + func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; @@ -2009,12 +3325,12 @@ func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= - save_ifs="$IFS"; IFS=',' + save_ifs=$IFS; IFS=, for arg in $args; do - IFS="$save_ifs" + IFS=$save_ifs func_append_quoted lastarg "$arg" done - IFS="$save_ifs" + IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result @@ -2027,8 +3343,8 @@ # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # - lastarg="$srcfile" - srcfile="$arg" + lastarg=$srcfile + srcfile=$arg ;; esac # case $arg ;; @@ -2043,13 +3359,13 @@ func_fatal_error "you must specify an argument for -Xcompile" ;; target) - func_fatal_error "you must specify a target with \`-o'" + func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" - libobj="$func_basename_result" + libobj=$func_basename_result } ;; esac @@ -2069,7 +3385,7 @@ case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) - func_fatal_error "cannot determine name of library object from \`$libobj'" + func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac @@ -2078,8 +3394,8 @@ for arg in $later; do case $arg in -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" + test yes = "$build_libtool_libs" \ + || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; @@ -2105,17 +3421,17 @@ func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && func_warning "libobj name \`$libobj' may not contain shell special characters." + && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" - objname="$func_basename_result" - xdir="$func_dirname_result" - lobj=${xdir}$objdir/$objname + objname=$func_basename_result + xdir=$func_dirname_result + lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. - if test "$build_old_libs" = yes; then + if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" @@ -2127,16 +3443,16 @@ pic_mode=default ;; esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" + if test no = "$compiler_c_o"; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext + lockfile=$output_obj.lock else output_obj= need_locks=no @@ -2145,12 +3461,12 @@ # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then + if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done - elif test "$need_locks" = warn; then + elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: @@ -2158,7 +3474,7 @@ This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you +your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." @@ -2180,11 +3496,11 @@ qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then + if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile - if test "$pic_mode" != no; then + if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code @@ -2201,7 +3517,7 @@ func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' - if test "$need_locks" = warn && + if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: @@ -2212,7 +3528,7 @@ This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you +your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." @@ -2228,20 +3544,20 @@ fi # Allow error messages only from the first compilation. - if test "$suppress_opt" = yes; then + if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - if test "$pic_mode" != yes; then + if test yes = "$build_old_libs"; then + if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi - if test "$compiler_c_o" = yes; then + if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi @@ -2250,7 +3566,7 @@ func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' - if test "$need_locks" = warn && + if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: @@ -2261,7 +3577,7 @@ This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you +your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." @@ -2281,7 +3597,7 @@ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked - if test "$need_locks" != no; then + if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi @@ -2291,7 +3607,7 @@ } $opt_help || { - test "$opt_mode" = compile && func_mode_compile ${1+"$@"} + test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () @@ -2311,7 +3627,7 @@ Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated @@ -2330,16 +3646,16 @@ -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only - -shared do not build a \`.o' file suitable for static linking - -static only build a \`.o' file suitable for static linking + -shared do not build a '.o' file suitable for static linking + -static only build a '.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler -COMPILE-COMMAND is a command to be used in creating a \`standard' object file +COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." +SOURCEFILE, then substituting the C source code suffix '.c' with the +library object suffix, '.lo'." ;; execute) @@ -2352,7 +3668,7 @@ -dlopen FILE add the directory containing FILE to the library path -This mode sets the library path environment variable according to \`-dlopen' +This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated @@ -2371,7 +3687,7 @@ Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." +the '--dry-run' option if you just want to see what would be executed." ;; install) @@ -2381,7 +3697,7 @@ Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. +either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: @@ -2407,7 +3723,7 @@ -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE @@ -2421,7 +3737,8 @@ -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects + -objectlist FILE use a list of object files found in FILE to specify objects + -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information @@ -2441,20 +3758,20 @@ -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) -All other options (arguments beginning with \`-') are ignored. +All other options (arguments beginning with '-') are ignored. -Every other argument is treated as a filename. Files ending in \`.la' are +Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is +If the OUTPUT-FILE ends in '.la', then a libtool library is created, +only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. +If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created +using 'ar' and 'ranlib', or on Windows using 'lib'. -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; @@ -2465,7 +3782,7 @@ Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. @@ -2473,17 +3790,17 @@ ;; *) - func_fatal_help "invalid operation mode \`$opt_mode'" + func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo - $ECHO "Try \`$progname --help' for more information about other modes." + $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then - if test "$opt_help" = :; then + if test : = "$opt_help"; then func_mode_help else { @@ -2491,7 +3808,7 @@ for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done - } | sed -n '1p; 2,$s/^Usage:/ or: /p' + } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do @@ -2499,7 +3816,7 @@ func_mode_help done } | - sed '1d + $SED '1d /^When reporting/,/^Report/{ H d @@ -2516,16 +3833,17 @@ # func_mode_execute arg... func_mode_execute () { - $opt_debug + $debug_cmd + # The first argument is the command name. - cmd="$nonopt" + cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ - || func_fatal_help "\`$file' is not a file" + || func_fatal_help "'$file' is not a file" dir= case $file in @@ -2535,7 +3853,7 @@ # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$lib' is not a valid libtool archive" + || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= @@ -2546,18 +3864,18 @@ if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ - func_warning "\`$file' was not linked with \`-export-dynamic'" + func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." - dir="$func_dirname_result" + dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then - func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; @@ -2565,18 +3883,18 @@ *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." - dir="$func_dirname_result" + dir=$func_dirname_result ;; *) - func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" + test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then @@ -2588,7 +3906,7 @@ # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. - libtool_execute_magic="$magic" + libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= @@ -2601,12 +3919,12 @@ if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. - file="$progdir/$program" + file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. - file="$progdir/$program" + file=$progdir/$program fi ;; esac @@ -2614,7 +3932,15 @@ func_append_quoted args "$file" done - if test "X$opt_dry_run" = Xfalse; then + if $opt_dry_run; then + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" @@ -2631,25 +3957,18 @@ done # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - echo "export $shlibpath_var" - fi - $ECHO "$cmd$args" - exit $EXIT_SUCCESS + exec_cmd=\$cmd$args fi } -test "$opt_mode" = execute && func_mode_execute ${1+"$@"} +test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { - $opt_debug + $debug_cmd + libs= libdirs= admincmds= @@ -2663,11 +3982,11 @@ if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else - func_warning "\`$opt' is not a valid libtool archive" + func_warning "'$opt' is not a valid libtool archive" fi else - func_fatal_error "invalid argument \`$opt'" + func_fatal_error "invalid argument '$opt'" fi done @@ -2682,12 +4001,12 @@ # Remove sysroot references if $opt_dry_run; then for lib in $libs; do - echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do - sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done @@ -2712,7 +4031,7 @@ fi # Exit here if they wanted silent mode. - $opt_silent && exit $EXIT_SUCCESS + $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" @@ -2723,27 +4042,27 @@ echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" - $ECHO " - use the \`$flag' linker flag" + $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo @@ -2762,18 +4081,20 @@ exit $EXIT_SUCCESS } -test "$opt_mode" = finish && func_mode_finish ${1+"$@"} +test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { - $opt_debug + $debug_cmd + # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. - case $nonopt in *shtool*) :;; *) false;; esac; then + case $nonopt in *shtool*) :;; *) false;; esac + then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " @@ -2800,7 +4121,7 @@ opts= prev= install_type= - isdir=no + isdir=false stripme= no_mode=: for arg @@ -2813,7 +4134,7 @@ fi case $arg in - -d) isdir=yes ;; + -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg @@ -2831,7 +4152,7 @@ *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then - if test "x$prev" = x-m && test -n "$install_override_mode"; then + if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi @@ -2856,7 +4177,7 @@ func_fatal_help "you must specify an install program" test -n "$prev" && \ - func_fatal_help "the \`$prev' option requires an argument" + func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else @@ -2878,19 +4199,19 @@ dest=$func_stripname_result # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" + test -d "$dest" && isdir=: + if $isdir; then + destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." - destdir="$func_dirname_result" - destname="$func_basename_result" + destdir=$func_dirname_result + destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ - func_fatal_help "\`$dest' is not a directory" + func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; @@ -2899,7 +4220,7 @@ case $file in *.lo) ;; *) - func_fatal_help "\`$destdir' must be an absolute directory name" + func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done @@ -2908,7 +4229,7 @@ # This variable tells wrapper scripts just to set variables rather # than running their programs. - libtool_install_magic="$magic" + libtool_install_magic=$magic staticlibs= future_libdirs= @@ -2928,7 +4249,7 @@ # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$file' is not a valid libtool archive" + || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= @@ -2950,7 +4271,7 @@ fi func_dirname "$file" "/" "" - dir="$func_dirname_result" + dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then @@ -2964,7 +4285,7 @@ # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ - func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. @@ -2973,29 +4294,36 @@ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi - func_warning "relinking \`$file'" + func_warning "relinking '$file'" func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then - realname="$1" + realname=$1 shift - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T + srcname=$realname + test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' - tstripme="$stripme" + tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) - tstripme="" + tstripme= + ;; + esac + ;; + os2*) + case $realname in + *_dll.a) + tstripme= ;; esac ;; @@ -3006,7 +4334,7 @@ if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on + # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname @@ -3017,14 +4345,14 @@ fi # Do each command in the postinstall commands. - lib="$destdir/$realname" + lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" - name="$func_basename_result" - instname="$dir/$name"i + name=$func_basename_result + instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. @@ -3036,11 +4364,11 @@ # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then - destfile="$destdir/$destname" + destfile=$destdir/$destname else func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" + destfile=$func_basename_result + destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. @@ -3050,11 +4378,11 @@ staticdest=$func_lo2o_result ;; *.$objext) - staticdest="$destfile" + staticdest=$destfile destfile= ;; *) - func_fatal_help "cannot copy a libtool object to \`$destfile'" + func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac @@ -3063,7 +4391,7 @@ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. - if test "$build_old_libs" = yes; then + if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result @@ -3075,23 +4403,23 @@ *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then - destfile="$destdir/$destname" + destfile=$destdir/$destname else func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" + destfile=$func_basename_result + destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install - stripped_ext="" + stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result - stripped_ext=".exe" + stripped_ext=.exe fi ;; esac @@ -3119,19 +4447,19 @@ # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ - func_fatal_error "invalid libtool wrapper script \`$wrapper'" + func_fatal_error "invalid libtool wrapper script '$wrapper'" - finalize=yes + finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi - libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "\`$lib' has not been installed in \`$libdir'" - finalize=no + func_warning "'$lib' has not been installed in '$libdir'" + finalize=false fi done @@ -3139,29 +4467,29 @@ func_source "$wrapper" outputname= - if test "$fast_install" = no && test -n "$relink_command"; then + if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { - if test "$finalize" = yes; then + if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" - file="$func_basename_result" - outputname="$tmpdir/$file" + file=$func_basename_result + outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` - $opt_silent || { + $opt_quiet || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else - func_error "error: relink \`$file' with the above command before installing it" + func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi - file="$outputname" + file=$outputname else - func_warning "cannot relink \`$file'" + func_warning "cannot relink '$file'" fi } else @@ -3198,10 +4526,10 @@ for file in $staticlibs; do func_basename "$file" - name="$func_basename_result" + name=$func_basename_result # Set up the ranlib parameters. - oldlib="$destdir/$name" + oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result @@ -3216,18 +4544,18 @@ done test -n "$future_libdirs" && \ - func_warning "remember to run \`$progname --finish$future_libdirs'" + func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } -test "$opt_mode" = install && func_mode_install ${1+"$@"} +test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p @@ -3235,16 +4563,17 @@ # a dlpreopen symbol table. func_generate_dlsyms () { - $opt_debug - my_outputname="$1" - my_originator="$2" - my_pic_p="${3-no}" - my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + $debug_cmd + + my_outputname=$1 + my_originator=$2 + my_pic_p=${3-false} + my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then - my_dlsyms="${my_outputname}S.c" + my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi @@ -3255,7 +4584,7 @@ "") ;; *.c) # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${my_outputname}.nm" + nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" @@ -3263,34 +4592,36 @@ func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ -/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ -/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ +/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif -#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST -#elif defined(__osf__) +#elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + /* External symbol declarations for the compiler. */\ " - if test "$dlself" = yes; then - func_verbose "generating symbol list for \`$output'" + if test yes = "$dlself"; then + func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" @@ -3298,7 +4629,7 @@ progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 - func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done @@ -3318,10 +4649,10 @@ # Prepare the list of exported symbols if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" + export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols - eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' @@ -3331,7 +4662,7 @@ } else $opt_dry_run || { - eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in @@ -3345,22 +4676,22 @@ fi for dlprefile in $dlprefiles; do - func_verbose "extracting global C symbols from \`$dlprefile'" + func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" - name="$func_basename_result" + name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" - dlprefile_dlbasename="" + dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` - if test -n "$dlprefile_dlname" ; then + if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" - dlprefile_dlbasename="$func_basename_result" + dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" @@ -3368,7 +4699,7 @@ fi fi $opt_dry_run || { - if test -n "$dlprefile_dlbasename" ; then + if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" @@ -3424,6 +4755,11 @@ echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi + func_show_eval '$RM "${nlist}I"' + if test -n "$global_symbol_to_import"; then + eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' + fi + echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ @@ -3432,11 +4768,30 @@ void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[]; +lt_${my_prefix}_LTX_preloaded_symbols[];\ +" + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ +static void lt_syminit(void) +{ + LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; + for (; symbol->name; ++symbol) + {" + $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" + echo >> "$output_objdir/$my_dlsyms" "\ + } +}" + fi + echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = -{\ - { \"$my_originator\", (void *) 0 }," +{ {\"$my_originator\", (void *) 0}," + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ + {\"@INIT@\", (void *) <_syminit}," + fi case $need_lib_prefix in no) @@ -3478,9 +4833,7 @@ *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) - if test "X$my_pic_p" != Xno; then - pic_flag_for_symtable=" $pic_flag" - fi + $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; @@ -3497,10 +4850,10 @@ func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. - func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. - symfileobj="$output_objdir/${my_outputname}S.$objext" + symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then @@ -3518,7 +4871,7 @@ esac ;; *) - func_fatal_error "unknown suffix for \`$my_dlsyms'" + func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else @@ -3532,6 +4885,32 @@ fi } +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + # func_win32_libid arg # return the library type of file 'arg' # @@ -3541,8 +4920,9 @@ # Despite the name, also deal with 64 bit binaries. func_win32_libid () { - $opt_debug - win32_libid_type="unknown" + $debug_cmd + + win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import @@ -3552,16 +4932,29 @@ # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - func_to_tool_file "$1" func_convert_file_msys_to_w32 - win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | - $SED -n -e ' + case $nm_interface in + "MS dumpbin") + if func_cygming_ms_implib_p "$1" || + func_cygming_gnu_implib_p "$1" + then + win32_nmres=import + else + win32_nmres= + fi + ;; + *) + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' 1,100{ / I /{ - s,.*,import, + s|.*|import| p q } }'` + ;; + esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; @@ -3593,7 +4986,8 @@ # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { - $opt_debug + $debug_cmd + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } @@ -3610,7 +5004,8 @@ # specified import library. func_cygming_dll_for_implib_fallback_core () { - $opt_debug + $debug_cmd + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ @@ -3646,8 +5041,8 @@ /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the - # archive which possess that section. Heuristic: eliminate - # all those which have a first or second character that is + # archive that possess that section. Heuristic: eliminate + # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually @@ -3658,30 +5053,6 @@ $SED -e '/^\./d;/^.\./d;q' } -# func_cygming_gnu_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is a GNU/binutils-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_gnu_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` - test -n "$func_cygming_gnu_implib_tmp" -} - -# func_cygming_ms_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is an MS-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_ms_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` - test -n "$func_cygming_ms_implib_tmp" -} - # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified @@ -3695,16 +5066,17 @@ # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { - $opt_debug - if func_cygming_gnu_implib_p "$1" ; then + $debug_cmd + + if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` - elif func_cygming_ms_implib_p "$1" ; then + elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown - sharedlib_from_linklib_result="" + sharedlib_from_linklib_result= fi } @@ -3712,10 +5084,11 @@ # func_extract_an_archive dir oldlib func_extract_an_archive () { - $opt_debug - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - if test "$lock_old_archive_extraction" = yes; then + $debug_cmd + + f_ex_an_ar_dir=$1; shift + f_ex_an_ar_oldlib=$1 + if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" @@ -3724,7 +5097,7 @@ fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' - if test "$lock_old_archive_extraction" = yes; then + if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then @@ -3738,22 +5111,23 @@ # func_extract_archives gentop oldlib ... func_extract_archives () { - $opt_debug - my_gentop="$1"; shift + $debug_cmd + + my_gentop=$1; shift my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" + my_oldobjs= + my_xlib= + my_xabs= + my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" - my_xlib="$func_basename_result" + my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in @@ -3765,7 +5139,7 @@ esac done extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" + my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" @@ -3778,22 +5152,23 @@ cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` - darwin_base_archive=`basename "$darwin_archive"` + func_basename "$darwin_archive" + darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" + for darwin_arch in $darwin_arches; do + func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" + $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" + cd "unfat-$$/$darwin_base_archive-$darwin_arch" + func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" - $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do @@ -3815,7 +5190,7 @@ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done - func_extract_archives_result="$my_oldobjs" + func_extract_archives_result=$my_oldobjs } @@ -3830,7 +5205,7 @@ # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script -# will assume that the directory in which it is stored is +# will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () @@ -3841,7 +5216,7 @@ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. @@ -3898,9 +5273,9 @@ # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ which is used only on +# /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options which match +# (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and @@ -3933,7 +5308,7 @@ # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then - echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } @@ -3944,7 +5319,7 @@ lt_dump_args_N=1; for lt_arg do - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } @@ -3958,7 +5333,7 @@ *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} @@ -3968,7 +5343,7 @@ *) $ECHO "\ if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} @@ -4043,13 +5418,13 @@ test -n \"\$absdir\" && thisdir=\"\$absdir\" " - if test "$fast_install" = yes; then + if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" @@ -4066,7 +5441,7 @@ if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else - $ECHO \"\$relink_command_output\" >&2 + \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi @@ -4101,7 +5476,7 @@ fi # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" @@ -4121,7 +5496,7 @@ fi else # The program doesn't exist. - \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 @@ -4140,7 +5515,7 @@ cat < #include +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + /* declarations of non-ANSI functions */ -#if defined(__MINGW32__) +#if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif -#elif defined(__CYGWIN__) +#elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif -/* #elif defined (other platforms) ... */ +/* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ -#if defined(_MSC_VER) +#if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC -# ifndef _INTPTR_T_DEFINED -# define _INTPTR_T_DEFINED -# define intptr_t int -# endif -#elif defined(__MINGW32__) +#elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv -#elif defined(__CYGWIN__) +#elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" -/* #elif defined (other platforms) ... */ +/* #elif defined other platforms ... */ #endif -#if defined(PATH_MAX) +#if defined PATH_MAX # define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) +#elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 @@ -4234,8 +5607,8 @@ # define PATH_SEPARATOR ':' #endif -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) +#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ + defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 @@ -4268,10 +5641,10 @@ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ + if (stale) { free (stale); stale = 0; } \ } while (0) -#if defined(LT_DEBUGWRAPPER) +#if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; @@ -4300,11 +5673,16 @@ EOF cat < 0) && IS_PATH_SEPARATOR (new_value[len-1])) + size_t len = strlen (new_value); + while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { - new_value[len-1] = '\0'; + new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); @@ -5082,27 +6460,47 @@ # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { - $opt_debug + $debug_cmd + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } +# func_suncc_cstd_abi +# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! +# Several compiler flags select an ABI that is incompatible with the +# Cstd library. Avoid specifying it if any are in CXXFLAGS. +func_suncc_cstd_abi () +{ + $debug_cmd + + case " $compile_command " in + *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) + suncc_use_cstd_abi=no + ;; + *) + suncc_use_cstd_abi=yes + ;; + esac +} + # func_mode_link arg... func_mode_link () { - $opt_debug + $debug_cmd + case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra + # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not + # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. @@ -5146,10 +6544,11 @@ module=no no_install=no objs= + os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no - preload=no + preload=false prev= prevarg= release= @@ -5161,7 +6560,7 @@ vinfo= vinfo_number=no weak_libs= - single_module="${wl}-single_module" + single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. @@ -5169,15 +6568,15 @@ do case $arg in -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" + test yes != "$build_libtool_libs" \ + && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then @@ -5210,7 +6609,7 @@ # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do - arg="$1" + arg=$1 shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result @@ -5227,21 +6626,21 @@ case $prev in bindir) - bindir="$arg" + bindir=$arg prev= continue ;; dlfiles|dlprefiles) - if test "$preload" = no; then + $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" - preload=yes - fi + preload=: + } case $arg in *.la | *.lo) ;; # We handle these cases below. force) - if test "$dlself" = no; then + if test no = "$dlself"; then dlself=needless export_dynamic=yes fi @@ -5249,9 +6648,9 @@ continue ;; self) - if test "$prev" = dlprefiles; then + if test dlprefiles = "$prev"; then dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless @@ -5261,7 +6660,7 @@ continue ;; *) - if test "$prev" = dlfiles; then + if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" @@ -5272,14 +6671,14 @@ esac ;; expsyms) - export_symbols="$arg" + export_symbols=$arg test -f "$arg" \ - || func_fatal_error "symbol file \`$arg' does not exist" + || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) - export_symbols_regex="$arg" + export_symbols_regex=$arg prev= continue ;; @@ -5297,7 +6696,13 @@ continue ;; inst_prefix) - inst_prefix_dir="$arg" + inst_prefix_dir=$arg + prev= + continue + ;; + mllvm) + # Clang does not use LLVM to link, so we can simply discard any + # '-mllvm $arg' options when doing the link step. prev= continue ;; @@ -5321,21 +6726,21 @@ if test -z "$pic_object" || test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir="$func_dirname_result" + xdir=$func_dirname_result - if test "$pic_object" != none; then + if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" + pic_object=$xdir$pic_object - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue @@ -5346,7 +6751,7 @@ fi # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then + if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= @@ -5354,23 +6759,23 @@ # A PIC object. func_append libobjs " $pic_object" - arg="$pic_object" + arg=$pic_object fi # Non-PIC object. - if test "$non_pic_object" != none; then + if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" + non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" + non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else @@ -5378,7 +6783,7 @@ if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir="$func_dirname_result" + xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result @@ -5386,24 +6791,29 @@ func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else - func_fatal_error "\`$arg' is not a valid libtool object" + func_fatal_error "'$arg' is not a valid libtool object" fi fi done else - func_fatal_error "link input file \`$arg' does not exist" + func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; + os2dllname) + os2dllname=$arg + prev= + continue + ;; precious_regex) - precious_files_regex="$arg" + precious_files_regex=$arg prev= continue ;; release) - release="-$arg" + release=-$arg prev= continue ;; @@ -5415,7 +6825,7 @@ func_fatal_error "only absolute run-paths are allowed" ;; esac - if test "$prev" = rpath; then + if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; @@ -5430,7 +6840,7 @@ continue ;; shrext) - shrext_cmds="$arg" + shrext_cmds=$arg prev= continue ;; @@ -5470,7 +6880,7 @@ esac fi # test -n "$prev" - prevarg="$arg" + prevarg=$arg case $arg in -all-static) @@ -5484,7 +6894,7 @@ -allow-undefined) # FIXME: remove this flag sometime in the future. - func_fatal_error "\`-allow-undefined' must not be used because it is the default" + func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) @@ -5516,7 +6926,7 @@ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi - if test "X$arg" = "X-export-symbols"; then + if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex @@ -5550,9 +6960,9 @@ func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then - func_fatal_error "require no space between \`-L' and \`$1'" + func_fatal_error "require no space between '-L' and '$1'" else - func_fatal_error "need path for \`-L' option" + func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" @@ -5563,8 +6973,8 @@ *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ - func_fatal_error "cannot determine absolute directory name of \`$dir'" - dir="$absdir" + func_fatal_error "cannot determine absolute directory name of '$dir'" + dir=$absdir ;; esac case "$deplibs " in @@ -5599,7 +7009,7 @@ ;; -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) @@ -5607,11 +7017,11 @@ ;; *-*-os2*) # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue + test X-lc = "X$arg" && continue ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue + test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework @@ -5620,16 +7030,16 @@ ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype - test "X$arg" = "X-lc" && continue + test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue + test X-lc = "X$arg" && continue ;; esac - elif test "X$arg" = "X-lc_r"; then + elif test X-lc_r = "X$arg"; then case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; @@ -5639,6 +7049,11 @@ continue ;; + -mllvm) + prev=mllvm + continue + ;; + -module) module=yes continue @@ -5668,7 +7083,7 @@ ;; -multi_module) - single_module="${wl}-multi_module" + single_module=$wl-multi_module continue ;; @@ -5682,8 +7097,8 @@ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. - func_warning "\`-no-install' is ignored for $host" - func_warning "assuming \`-no-fast-install' instead" + func_warning "'-no-install' is ignored for $host" + func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; @@ -5701,6 +7116,11 @@ continue ;; + -os2dllname) + prev=os2dllname + continue + ;; + -o) prev=output ;; -precious-files-regex) @@ -5788,14 +7208,14 @@ func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= - save_ifs="$IFS"; IFS=',' + save_ifs=$IFS; IFS=, for flag in $args; do - IFS="$save_ifs" + IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done - IFS="$save_ifs" + IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; @@ -5804,15 +7224,15 @@ func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= - save_ifs="$IFS"; IFS=',' + save_ifs=$IFS; IFS=, for flag in $args; do - IFS="$save_ifs" + IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done - IFS="$save_ifs" + IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; @@ -5835,7 +7255,7 @@ # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" + arg=$func_quote_for_eval_result ;; # Flags to be passed through unchanged, with rationale: @@ -5847,25 +7267,49 @@ # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support - # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -specs=* GCC specs files + # -stdlib=* select c++ std lib with clang + # -fsanitize=* Clang/GCC memory and address sanitizer -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-flto*|-fwhopr*|-fuse-linker-plugin) + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ + -specs=*|-fsanitize=*) func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" + arg=$func_quote_for_eval_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; + -Z*) + if test os2 = "`expr $host : '.*\(os2\)'`"; then + # OS/2 uses -Zxxx to specify OS/2-specific options + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case $arg in + -Zlinker | -Zstack) + prev=xcompiler + ;; + esac + continue + else + # Otherwise treat like 'Some other compiler flag' below + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + fi + ;; + # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" + arg=$func_quote_for_eval_result ;; *.$objext) @@ -5886,21 +7330,21 @@ if test -z "$pic_object" || test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir="$func_dirname_result" + xdir=$func_dirname_result - if test "$pic_object" != none; then + test none = "$pic_object" || { # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" + pic_object=$xdir$pic_object - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue @@ -5911,7 +7355,7 @@ fi # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then + if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= @@ -5919,23 +7363,23 @@ # A PIC object. func_append libobjs " $pic_object" - arg="$pic_object" - fi + arg=$pic_object + } # Non-PIC object. - if test "$non_pic_object" != none; then + if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" + non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" + non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else @@ -5943,7 +7387,7 @@ if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir="$func_dirname_result" + xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result @@ -5951,7 +7395,7 @@ func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else - func_fatal_error "\`$arg' is not a valid libtool object" + func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; @@ -5967,11 +7411,11 @@ # A libtool-controlled library. func_resolve_sysroot "$arg" - if test "$prev" = dlfiles; then + if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= - elif test "$prev" = dlprefiles; then + elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= @@ -5986,7 +7430,7 @@ # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" + arg=$func_quote_for_eval_result ;; esac # arg @@ -5998,9 +7442,9 @@ done # argument parsing loop test -n "$prev" && \ - func_fatal_help "the \`$prevarg' option requires an argument" + func_fatal_help "the '$prevarg' option requires an argument" - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" @@ -6009,20 +7453,23 @@ oldlibs= # calculate the name of the file, without its directory func_basename "$output" - outputname="$func_basename_result" - libobjs_save="$libobjs" + outputname=$func_basename_result + libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` + eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + # Definition is injected by LT_CONFIG during libtool generation. + func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" + func_dirname "$output" "/" "" - output_objdir="$func_dirname_result$objdir" + output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. @@ -6045,7 +7492,7 @@ # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do - if $opt_preserve_dup_deps ; then + if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac @@ -6053,7 +7500,7 @@ func_append libs " $deplib" done - if test "$linkmode" = lib; then + if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps @@ -6085,7 +7532,7 @@ case $file in *.la) ;; *) - func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done @@ -6093,7 +7540,7 @@ prog) compile_deplibs= finalize_deplibs= - alldeplibs=no + alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" @@ -6105,32 +7552,32 @@ for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... - if test "$linkmode,$pass" = "lib,link"; then + if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done - deplibs="$tmp_deplibs" + deplibs=$tmp_deplibs fi - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass"; then + libs=$deplibs deplibs= fi - if test "$linkmode" = prog; then + if test prog = "$linkmode"; then case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; + dlopen) libs=$dlfiles ;; + dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi - if test "$linkmode,$pass" = "lib,dlpreopen"; then + if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs @@ -6151,26 +7598,26 @@ esac done done - libs="$dlprefiles" + libs=$dlprefiles fi - if test "$pass" = dlopen; then + if test dlopen = "$pass"; then # Collect dlpreopened libraries - save_deplibs="$deplibs" + save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= - found=no + found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - if test "$linkmode,$pass" = "prog,link"; then + if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" - if test "$linkmode" = lib ; then + if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; @@ -6180,13 +7627,13 @@ continue ;; -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - func_warning "\`-l' is ignored for archives/objects" + if test lib != "$linkmode" && test prog != "$linkmode"; then + func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result - if test "$linkmode" = lib; then + if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" @@ -6194,31 +7641,22 @@ for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" + lib=$searchdir/lib$name$search_ext if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes + if test .la = "$search_ext"; then + found=: else - found=no + found=false fi break 2 fi done done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library + if $found; then + # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then @@ -6226,19 +7664,19 @@ old_library= func_source "$lib" for l in $old_library $library_names; do - ll="$l" + ll=$l done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no + if test "X$ll" = "X$old_library"; then # only static version available + found=false func_dirname "$lib" "" "." - ladir="$func_dirname_result" + ladir=$func_dirname_result lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then + if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi @@ -6247,15 +7685,25 @@ *) ;; esac fi + else + # deplib doesn't seem to be a libtool library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue fi ;; # -l *.ltframework) - if test "$linkmode,$pass" = "prog,link"; then + if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" - if test "$linkmode" = lib ; then + if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; @@ -6268,18 +7716,18 @@ case $linkmode in lib) deplibs="$deplib $deplibs" - test "$pass" = conv && continue + test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) - if test "$pass" = conv; then + if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi - if test "$pass" = scan; then + if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" @@ -6290,13 +7738,13 @@ func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) - func_warning "\`-L' is ignored for archives/objects" + func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) - if test "$pass" = link; then + if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result @@ -6314,7 +7762,7 @@ lib=$func_resolve_sysroot_result ;; *.$libext) - if test "$pass" = conv; then + if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi @@ -6325,21 +7773,26 @@ case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) - valid_a_lib=no + valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes + valid_a_lib=: fi ;; pass_all) - valid_a_lib=yes + valid_a_lib=: ;; esac - if test "$valid_a_lib" != yes; then + if $valid_a_lib; then + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" @@ -6347,18 +7800,13 @@ echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." - else - echo - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) - if test "$pass" != link; then + if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" @@ -6369,10 +7817,10 @@ esac # linkmode ;; # *.$libext *.lo | *.$objext) - if test "$pass" = conv; then + if test conv = "$pass"; then deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + elif test prog = "$linkmode"; then + if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" @@ -6385,22 +7833,20 @@ continue ;; %DEPLIBS%) - alldeplibs=yes + alldeplibs=: continue ;; esac # case $deplib - if test "$found" = yes || test -f "$lib"; then : - else - func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" - fi + $found || test -f "$lib" \ + || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ - || func_fatal_error "\`$lib' is not a valid libtool archive" + || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." - ladir="$func_dirname_result" + ladir=$func_dirname_result dlname= dlopen= @@ -6430,19 +7876,19 @@ done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass" || + { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi - if test "$pass" = conv; then + if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then - func_fatal_error "cannot find name of link library for \`$lib'" + func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" @@ -6450,15 +7896,15 @@ tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps ; then + if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - func_fatal_error "\`$lib' is not a convenience library" + elif test prog != "$linkmode" && test lib != "$linkmode"; then + func_fatal_error "'$lib' is not a convenience library" fi continue fi # $pass = conv @@ -6467,26 +7913,26 @@ # Get the name of the library we link against. linklib= if test -n "$old_library" && - { test "$prefer_static_libs" = yes || - test "$prefer_static_libs,$installed" = "built,no"; }; then + { test yes = "$prefer_static_libs" || + test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do - linklib="$l" + linklib=$l done fi if test -z "$linklib"; then - func_fatal_error "cannot find name of link library for \`$lib'" + func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - func_fatal_error "cannot -dlopen a convenience library: \`$lib'" - fi + if test dlopen = "$pass"; then + test -z "$libdir" \ + && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then + test yes != "$dlopen_support" || + test no = "$build_libtool_libs" + then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't @@ -6500,40 +7946,40 @@ # We need an absolute path. case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then - func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" - abs_ladir="$ladir" + abs_ladir=$ladir fi ;; esac func_basename "$lib" - laname="$func_basename_result" + laname=$func_basename_result # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then + if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - func_warning "library \`$lib' was moved." - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" + func_warning "library '$lib' was moved." + dir=$ladir + absdir=$abs_ladir + libdir=$abs_ladir else - dir="$lt_sysroot$libdir" - absdir="$lt_sysroot$libdir" + dir=$lt_sysroot$libdir + absdir=$lt_sysroot$libdir fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" + dir=$ladir + absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" + dir=$ladir/$objdir + absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi @@ -6542,11 +7988,11 @@ name=$func_stripname_result # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir" && test "$linkmode" = prog; then - func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + if test dlpreopen = "$pass"; then + if test -z "$libdir" && test prog = "$linkmode"; then + func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi - case "$host" in + case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both @@ -6590,9 +8036,9 @@ if test -z "$libdir"; then # Link the convenience library - if test "$linkmode" = lib; then + if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then + elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else @@ -6602,14 +8048,14 @@ fi - if test "$linkmode" = prog && test "$pass" != link; then + if test prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes + linkalldeplibs=false + if test no != "$link_all_deplibs" || test -z "$library_names" || + test no = "$build_libtool_libs"; then + linkalldeplibs=: fi tmp_libs= @@ -6621,14 +8067,14 @@ ;; esac # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then + if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi - if $opt_preserve_dup_deps ; then + if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac @@ -6638,15 +8084,15 @@ continue fi # $linkmode = prog... - if test "$linkmode,$pass" = "prog,link"; then + if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && - { { test "$prefer_static_libs" = no || - test "$prefer_static_libs,$installed" = "built,yes"; } || + { { test no = "$prefer_static_libs" || + test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. - case "$temp_rpath:" in + case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac @@ -6675,9 +8121,9 @@ esac fi # $linkmode,$pass = prog,link... - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && + if $alldeplibs && + { test pass_all = "$deplibs_check_method" || + { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue @@ -6686,19 +8132,19 @@ link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs - if test "$use_static_libs" = built && test "$installed" = yes; then + if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then + { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in - *cygwin* | *mingw* | *cegcc*) + *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) - if test "$installed" = no; then + if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi @@ -6708,24 +8154,24 @@ # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! - dlopenmodule="" + dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then - dlopenmodule="$dlpremoduletest" + dlopenmodule=$dlpremoduletest break fi done - if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then + if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo - if test "$linkmode" = prog; then + if test prog = "$linkmode"; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then + if test lib = "$linkmode" && + test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. @@ -6753,43 +8199,43 @@ # figure out the soname set dummy $library_names shift - realname="$1" + realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then - soname="$dlname" + soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in - *cygwin* | mingw* | *cegcc*) + *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result - versuffix="-$major" + versuffix=-$major ;; esac eval soname=\"$soname_spec\" else - soname="$realname" + soname=$realname fi # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" + soroot=$soname func_basename "$soroot" - soname="$func_basename_result" + soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else - func_verbose "extracting exported symbol list from \`$soname'" + func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else - func_verbose "generating import library for \`$soname'" + func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library @@ -6797,58 +8243,58 @@ linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" - if test "$linkmode" = prog || test "$opt_mode" != relink; then + if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" + if test no = "$hardcode_direct"; then + add=$dir/$linklib case $host in - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; - *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; + *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir="-L$dir" ;; + *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) - # if the lib is a (non-dlopened) module then we can not + # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | - $GREP ": [^:]* bundle" >/dev/null ; then + $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then + if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else - add="$dir/$old_library" + add=$dir/$old_library fi elif test -n "$old_library"; then - add="$dir/$old_library" + add=$dir/$old_library fi fi esac - elif test "$hardcode_minus_L" = no; then + elif test no = "$hardcode_minus_L"; then case $host in - *-*-sunos*) add_shlibpath="$dir" ;; + *-*-sunos*) add_shlibpath=$dir ;; esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" + add_dir=-L$dir + add=-l$name + elif test no = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name else lib_linked=no fi ;; relink) - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$absdir" + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$dir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in @@ -6857,10 +8303,10 @@ ;; esac fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name else lib_linked=no fi @@ -6868,7 +8314,7 @@ *) lib_linked=no ;; esac - if test "$lib_linked" != yes; then + if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi @@ -6878,15 +8324,15 @@ *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi - if test "$linkmode" = prog; then + if test prog = "$linkmode"; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && - test "$hardcode_minus_L" != yes && - test "$hardcode_shlibpath_var" = yes; then + if test yes != "$hardcode_direct" && + test yes != "$hardcode_minus_L" && + test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; @@ -6895,33 +8341,33 @@ fi fi - if test "$linkmode" = prog || test "$opt_mode" = relink; then + if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$libdir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$libdir + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then + add=-l$name + elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" + test -f "$inst_prefix_dir$libdir/$linklib"; then + add=$inst_prefix_dir$libdir/$linklib else - add="$libdir/$linklib" + add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" + add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in @@ -6930,10 +8376,10 @@ ;; esac fi - add="-l$name" + add=-l$name fi - if test "$linkmode" = prog; then + if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else @@ -6941,43 +8387,43 @@ test -n "$add" && deplibs="$add $deplibs" fi fi - elif test "$linkmode" = prog; then + elif test prog = "$linkmode"; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" + if test unsupported != "$hardcode_direct"; then + test -n "$old_library" && linklib=$old_library compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi - elif test "$build_libtool_libs" = yes; then + elif test yes = "$build_libtool_libs"; then # Not a shared library - if test "$deplibs_check_method" != pass_all; then + if test pass_all != "$deplibs_check_method"; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo - $ECHO "*** Warning: This system can not link to static lib archive $lib." + $ECHO "*** Warning: This system cannot link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then + if test yes = "$module"; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." + echo "*** 'nm' from GNU binutils and a full rebuild may help." fi - if test "$build_old_libs" = no; then + if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else @@ -6990,11 +8436,11 @@ fi fi # link shared/static library? - if test "$linkmode" = lib; then + if test lib = "$linkmode"; then if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then + { test yes != "$hardcode_into_libs" || + test yes = "$build_old_libs" || + test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do @@ -7008,12 +8454,12 @@ *) func_append temp_deplibs " $libdir";; esac done - dependency_libs="$temp_deplibs" + dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do @@ -7023,7 +8469,7 @@ func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac - if $opt_preserve_dup_deps ; then + if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; @@ -7032,12 +8478,12 @@ func_append tmp_libs " $func_resolve_sysroot_result" done - if test "$link_all_deplibs" != no; then + if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in - -L*) path="$deplib" ;; + -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result @@ -7045,12 +8491,12 @@ dir=$func_dirname_result # We need an absolute path. case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then - func_warning "cannot determine absolute directory name of \`$dir'" - absdir="$dir" + func_warning "cannot determine absolute directory name of '$dir'" + absdir=$dir fi ;; esac @@ -7058,35 +8504,35 @@ case $host in *-*-darwin*) depdepl= - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do + eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names"; then + for tmp in $deplibrary_names; do depdepl=$tmp done - if test -f "$absdir/$objdir/$depdepl" ; then - depdepl="$absdir/$objdir/$depdepl" - darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -f "$absdir/$objdir/$depdepl"; then + depdepl=$absdir/$objdir/$depdepl + darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then - darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi - func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" - func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" + func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" + func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) - path="-L$absdir/$objdir" + path=-L$absdir/$objdir ;; esac else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" + func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ - func_warning "\`$deplib' seems to be moved" + func_warning "'$deplib' seems to be moved" - path="-L$absdir" + path=-L$absdir fi ;; esac @@ -7098,23 +8544,23 @@ fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs - if test "$pass" = link; then - if test "$linkmode" = "prog"; then + if test link = "$pass"; then + if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then + dependency_libs=$newdependency_libs + if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then + if test dlopen != "$pass"; then + test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do @@ -7124,12 +8570,12 @@ esac done newlib_search_path= - fi + } - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else + if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" + else + vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order @@ -7187,62 +8633,93 @@ eval $var=\"$tmp_libs\" done # for var fi + + # Add Sun CC postdeps if required: + test CXX = "$tagname" && { + case $host_os in + linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C++ 5.9 + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + + solaris*) + func_cc_basename "$CC" + case $func_cc_basename_result in + CC* | sunCC*) + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + esac + } + # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= - for i in $dependency_libs ; do + for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) - i="" + i= ;; esac - if test -n "$i" ; then + if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" + if test prog = "$linkmode"; then + dlfiles=$newdlfiles fi - if test "$linkmode" = prog || test "$linkmode" = lib; then - dlprefiles="$newdlprefiles" + if test prog = "$linkmode" || test lib = "$linkmode"; then + dlprefiles=$newdlprefiles fi case $linkmode in oldlib) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for archives" + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for archives" ;; + func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for archives" + func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ - func_warning "\`-R' is ignored for archives" + func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for archives" + func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ - func_warning "\`-release' is ignored for archives" + func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ - func_warning "\`-export-symbols' is ignored for archives" + func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no - oldlibs="$output" + oldlibs=$output func_append objs "$old_deplibs" ;; lib) - # Make sure we only generate libraries of the form `libNAME.la'. + # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" @@ -7251,10 +8728,10 @@ eval libname=\"$libname_spec\" ;; *) - test "$module" = no && \ - func_fatal_help "libtool library \`$output' must begin with \`lib'" + test no = "$module" \ + && func_fatal_help "libtool library '$output' must begin with 'lib'" - if test "$need_lib_prefix" != no; then + if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result @@ -7268,8 +8745,8 @@ esac if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + if test pass_all != "$deplibs_check_method"; then + func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" @@ -7278,21 +8755,21 @@ fi fi - test "$dlself" != no && \ - func_warning "\`-dlopen self' is ignored for libtool libraries" + test no = "$dlself" \ + || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift - test "$#" -gt 1 && \ - func_warning "ignoring multiple \`-rpath's for a libtool library" + test 1 -lt "$#" \ + && func_warning "ignoring multiple '-rpath's for a libtool library" - install_libdir="$1" + install_libdir=$1 oldlibs= if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then + if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so + # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" @@ -7301,20 +8778,20 @@ fi test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ - func_warning "\`-release' is ignored for convenience libraries" + func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. - save_ifs="$IFS"; IFS=':' + save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift - IFS="$save_ifs" + IFS=$save_ifs test -n "$7" && \ - func_fatal_help "too many parameters to \`-version-info'" + func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts @@ -7322,45 +8799,45 @@ case $vinfo_number in yes) - number_major="$1" - number_minor="$2" - number_revision="$3" + number_major=$1 + number_minor=$2 + number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix - # which has an extra 1 added just for fun + # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor - darwin|linux|osf|windows|none) + darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result - age="$number_minor" - revision="$number_revision" + age=$number_minor + revision=$number_revision ;; - freebsd-aout|freebsd-elf|qnx|sunos) - current="$number_major" - revision="$number_minor" - age="0" + freebsd-aout|qnx|sunos) + current=$number_major + revision=$number_minor + age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result - age="$number_minor" - revision="$number_minor" + age=$number_minor + revision=$number_minor lt_irix_increment=no ;; *) - func_fatal_configuration "$modename: unknown library version type \`$version_type'" + func_fatal_configuration "$modename: unknown library version type '$version_type'" ;; esac ;; no) - current="$1" - revision="$2" - age="$3" + current=$1 + revision=$2 + age=$3 ;; esac @@ -7368,30 +8845,30 @@ case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) - func_error "CURRENT \`$current' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" + func_error "CURRENT '$current' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) - func_error "REVISION \`$revision' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" + func_error "REVISION '$revision' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) - func_error "AGE \`$age' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" + func_error "AGE '$age' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then - func_error "AGE \`$age' is greater than the current interface number \`$current'" - func_fatal_error "\`$vinfo' is not valid version information" + func_error "AGE '$age' is greater than the current interface number '$current'" + func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. @@ -7406,26 +8883,36 @@ # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result - versuffix="$major.$age.$revision" + versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result - xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + # On Darwin other compilers + case $CC in + nagfor*) + verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + ;; + *) + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + esac ;; freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; + major=.$current + versuffix=.$current.$revision ;; freebsd-elf) - major=".$current" - versuffix=".$current" + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision ;; irix | nonstopux) - if test "X$lt_irix_increment" = "Xno"; then + if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 @@ -7436,69 +8923,74 @@ nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac - verstring="$verstring_prefix$major.$revision" + verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision - while test "$loop" -ne 0; do + while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result - verstring="$verstring_prefix$major.$iface:$verstring" + verstring=$verstring_prefix$major.$iface:$verstring done - # Before this point, $major must not contain `.'. + # Before this point, $major must not contain '.'. major=.$major - versuffix="$major.$revision" + versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result - versuffix="$major.$age.$revision" + versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" + versuffix=.$current.$age.$revision + verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age - while test "$loop" -ne 0; do + while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result - verstring="$verstring:${iface}.0" + verstring=$verstring:$iface.0 done # Make executables depend on our current version. - func_append verstring ":${current}.0" + func_append verstring ":$current.0" ;; qnx) - major=".$current" - versuffix=".$current" + major=.$current + versuffix=.$current + ;; + + sco) + major=.$current + versuffix=.$current ;; sunos) - major=".$current" - versuffix=".$current.$revision" + major=.$current + versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. + # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result - versuffix="-$major" + versuffix=-$major ;; *) - func_fatal_configuration "unknown library version type \`$version_type'" + func_fatal_configuration "unknown library version type '$version_type'" ;; esac @@ -7512,42 +9004,45 @@ verstring= ;; *) - verstring="0.0" + verstring=0.0 ;; esac - if test "$need_version" = no; then + if test no = "$need_version"; then versuffix= else - versuffix=".0.0" + versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then + if test yes,no = "$avoid_version,$need_version"; then major= versuffix= - verstring="" + verstring= fi # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - func_warning "undefined symbols not allowed in $host shared libraries" - build_libtool_libs=no - build_old_libs=yes + if test yes = "$allow_undefined"; then + if test unsupported = "$allow_undefined_flag"; then + if test yes = "$build_old_libs"; then + func_warning "undefined symbols not allowed in $host shared libraries; building static only" + build_libtool_libs=no + else + func_fatal_error "can't build $host shared library unless -no-undefined is specified" + fi fi else # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" + allow_undefined_flag=$no_undefined_flag fi fi - func_generate_dlsyms "$libname" "$libname" "yes" + func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" - test "X$libobjs" = "X " && libobjs= + test " " = "$libobjs" && libobjs= - if test "$opt_mode" != relink; then + if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= @@ -7556,8 +9051,8 @@ case $p in *.$objext | *.gcno) ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) + if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue @@ -7573,11 +9068,11 @@ fi # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. @@ -7598,13 +9093,13 @@ *) func_append finalize_rpath " $libdir" ;; esac done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" + old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in @@ -7614,7 +9109,7 @@ done # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" + old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in @@ -7623,7 +9118,7 @@ esac done - if test "$build_libtool_libs" = yes; then + if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) @@ -7647,7 +9142,7 @@ ;; *) # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then + if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; @@ -7663,9 +9158,9 @@ # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? - release="" - versuffix="" - major="" + release= + versuffix= + major= newdeplibs= droppeddeps=no case $deplibs_check_method in @@ -7694,20 +9189,20 @@ -l*) func_stripname -l '' "$i" name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $i "*) func_append newdeplibs " $i" - i="" + i= ;; esac fi - if test -n "$i" ; then + if test -n "$i"; then libname=`eval "\\$ECHO \"$libname_spec\""` deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` set dummy $deplib_matches; shift deplib_match=$1 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then func_append newdeplibs " $i" else droppeddeps=yes @@ -7737,20 +9232,20 @@ $opt_dry_run || $RM conftest if $LTCC $LTCFLAGS -o conftest conftest.c $i; then ldd_output=`ldd conftest` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $i "*) func_append newdeplibs " $i" - i="" + i= ;; esac fi - if test -n "$i" ; then + if test -n "$i"; then libname=`eval "\\$ECHO \"$libname_spec\""` deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` set dummy $deplib_matches; shift deplib_match=$1 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then func_append newdeplibs " $i" else droppeddeps=yes @@ -7787,24 +9282,24 @@ -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" - a_deplib="" + a_deplib= ;; esac fi - if test -n "$a_deplib" ; then + if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` if test -n "$file_magic_glob"; then libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` else libnameglob=$libname fi - test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob` + test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - if test "$want_nocaseglob" = yes; then + if test yes = "$want_nocaseglob"; then shopt -s nocaseglob potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` $nocaseglob @@ -7822,25 +9317,25 @@ # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? - potlib="$potent_lib" + potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; + *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" - a_deplib="" + a_deplib= break 2 fi done done fi - if test -n "$a_deplib" ; then + if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." @@ -7848,7 +9343,7 @@ echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then + if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" @@ -7871,30 +9366,30 @@ -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" - a_deplib="" + a_deplib= ;; esac fi - if test -n "$a_deplib" ; then + if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test + potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" - a_deplib="" + a_deplib= break 2 fi done done fi - if test -n "$a_deplib" ; then + if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." @@ -7902,7 +9397,7 @@ echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then + if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" @@ -7918,18 +9413,18 @@ done # Gone through all deplibs. ;; none | unknown | *) - newdeplibs="" + newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo - if test "X$deplibs_check_method" = "Xnone"; then + if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." @@ -7953,8 +9448,8 @@ ;; esac - if test "$droppeddeps" = yes; then - if test "$module" = yes; then + if test yes = "$droppeddeps"; then + if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" @@ -7963,12 +9458,12 @@ if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." + echo "*** 'nm' from GNU binutils and a full rebuild may help." fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else @@ -7979,14 +9474,14 @@ echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." - if test "$allow_undefined" = no; then + if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else @@ -8032,7 +9527,7 @@ *) func_append new_libs " $deplib" ;; esac done - deplibs="$new_libs" + deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= @@ -8040,25 +9535,25 @@ dlname= # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - # Remove ${wl} instances when linking with ld. + if test yes = "$build_libtool_libs"; then + # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac - if test "$hardcode_into_libs" = yes; then + if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= - rpath="$finalize_rpath" - test "$opt_mode" != relink && rpath="$compile_rpath$rpath" + rpath=$finalize_rpath + test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" + hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in @@ -8083,7 +9578,7 @@ # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" + libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then @@ -8097,8 +9592,8 @@ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi - shlibpath="$finalize_shlibpath" - test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + shlibpath=$finalize_shlibpath + test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi @@ -8108,19 +9603,19 @@ eval library_names=\"$library_names_spec\" set dummy $library_names shift - realname="$1" + realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else - soname="$realname" + soname=$realname fi if test -z "$dlname"; then dlname=$soname fi - lib="$output_objdir/$realname" + lib=$output_objdir/$realname linknames= for link do @@ -8134,7 +9629,7 @@ delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" - export_symbols="$output_objdir/$libname.uexp" + export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi @@ -8143,31 +9638,31 @@ cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile - if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. - orig_export_symbols="$export_symbols" + orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes - fi + } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" + if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' + save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do - IFS="$save_ifs" + IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in @@ -8181,7 +9676,7 @@ try_normal_branch=no ;; esac - if test "$try_normal_branch" = yes \ + if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then @@ -8192,7 +9687,7 @@ output_la=$func_basename_result save_libobjs=$libobjs save_output=$output - output=${output_objdir}/${output_la}.nm + output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" @@ -8215,8 +9710,8 @@ break fi done - IFS="$save_ifs" - if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + IFS=$save_ifs + if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi @@ -8224,16 +9719,16 @@ fi if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi - if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine + # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. @@ -8252,11 +9747,11 @@ ;; esac done - deplibs="$tmp_deplibs" + deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && - test "$compiler_needs_object" = yes && + test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. @@ -8267,7 +9762,7 @@ eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else - gentop="$output_objdir/${outputname}x" + gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience @@ -8276,18 +9771,18 @@ fi fi - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking - if test "$opt_mode" = relink; then + if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then + if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds @@ -8305,7 +9800,7 @@ fi fi - if test "X$skipped_export" != "X:" && + if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then @@ -8338,8 +9833,8 @@ last_robj= k=1 - if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then - output=${output_objdir}/${output_la}.lnkscript + if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then + output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs @@ -8351,14 +9846,14 @@ func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result - elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then - output=${output_objdir}/${output_la}.lnk + elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then + output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= - if test "$compiler_needs_object" = yes; then + if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi @@ -8373,7 +9868,7 @@ else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." - output=$output_objdir/$output_la-${k}.$objext + output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result @@ -8385,13 +9880,13 @@ func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result - if test "X$objlist" = X || + if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. - if test "$k" -eq 1 ; then + if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" @@ -8401,10 +9896,10 @@ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi - last_robj=$output_objdir/$output_la-${k}.$objext + last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result - output=$output_objdir/$output_la-${k}.$objext + output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result @@ -8416,9 +9911,9 @@ # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" - eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then - eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" @@ -8426,9 +9921,9 @@ output= fi - if ${skipped_export-false}; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" + ${skipped_export-false} && { + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. @@ -8437,16 +9932,16 @@ if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi - fi + } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' + save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do - IFS="$save_ifs" - $opt_silent || { + IFS=$save_ifs + $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } @@ -8454,7 +9949,7 @@ lt_exit=$? # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then + if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -8463,7 +9958,7 @@ exit $lt_exit } done - IFS="$save_ifs" + IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' @@ -8471,18 +9966,18 @@ fi fi - if ${skipped_export-false}; then + ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine + # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. @@ -8491,7 +9986,7 @@ export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi - fi + } libobjs=$output # Restore the value of output. @@ -8505,7 +10000,7 @@ # value of $libobjs for piecewise linking. # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then + if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else @@ -8527,7 +10022,7 @@ # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" + gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles @@ -8535,11 +10030,12 @@ test "X$libobjs" = "X " && libobjs= fi - save_ifs="$IFS"; IFS='~' + save_ifs=$IFS; IFS='~' for cmd in $cmds; do - IFS="$save_ifs" + IFS=$sp$nl eval cmd=\"$cmd\" - $opt_silent || { + IFS=$save_ifs + $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } @@ -8547,7 +10043,7 @@ lt_exit=$? # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then + if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -8556,10 +10052,10 @@ exit $lt_exit } done - IFS="$save_ifs" + IFS=$save_ifs # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then + if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then @@ -8579,39 +10075,39 @@ done # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then + if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. - dlname="$soname" + dlname=$soname fi fi ;; obj) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for objects" + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for objects" ;; + func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for objects" + func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ - func_warning "\`-R' is ignored for objects" + func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for objects" + func_warning "'-version-info' is ignored for objects" test -n "$release" && \ - func_warning "\`-release' is ignored for objects" + func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ - func_fatal_error "cannot build library object \`$output' from non-libtool objects" + func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" @@ -8619,7 +10115,7 @@ ;; *) libobj= - obj="$output" + obj=$output ;; esac @@ -8632,17 +10128,19 @@ # the extraction. reload_conv_objs= gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec and hope we can get by with - # turning comma into space.. - wl= - + # if reload_cmds runs $LD directly, get rid of -Wl from + # whole_archive_flag_spec and hope we can get by with turning comma + # into space. + case $reload_cmds in + *\$LD[\ \$]*) wl= ;; + esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else - gentop="$output_objdir/${obj}x" + gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience @@ -8651,12 +10149,12 @@ fi # If we're not building shared, we need to use non_pic_objs - test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs - output="$obj" + output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. @@ -8668,7 +10166,7 @@ exit $EXIT_SUCCESS fi - if test "$build_libtool_libs" != yes; then + test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi @@ -8678,12 +10176,12 @@ # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS - fi + } - if test -n "$pic_flag" || test "$pic_mode" != default; then + if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" - output="$libobj" + output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi @@ -8700,16 +10198,14 @@ output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for programs" + func_warning "'-version-info' is ignored for programs" test -n "$release" && \ - func_warning "\`-release' is ignored for programs" + func_warning "'-release' is ignored for programs" - test "$preload" = yes \ - && test "$dlopen_support" = unknown \ - && test "$dlopen_self" = unknown \ - && test "$dlopen_self_static" = unknown && \ - func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + $preload \ + && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ + && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) @@ -8723,11 +10219,11 @@ *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). - if test "$tagname" = CXX ; then + if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) - func_append compile_command " ${wl}-bind_at_load" - func_append finalize_command " ${wl}-bind_at_load" + func_append compile_command " $wl-bind_at_load" + func_append finalize_command " $wl-bind_at_load" ;; esac fi @@ -8763,7 +10259,7 @@ *) func_append new_libs " $deplib" ;; esac done - compile_deplibs="$new_libs" + compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" @@ -8787,7 +10283,7 @@ if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" + hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in @@ -8810,7 +10306,7 @@ fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; @@ -8827,10 +10323,10 @@ # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" + libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi - compile_rpath="$rpath" + compile_rpath=$rpath rpath= hardcode_libdirs= @@ -8838,7 +10334,7 @@ if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" + hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in @@ -8863,45 +10359,43 @@ # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" + libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi - finalize_rpath="$rpath" + finalize_rpath=$rpath - if test -n "$libobjs" && test "$build_old_libs" = yes; then + if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi - func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi - wrappers_required=yes + wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=no + wrappers_required=false ;; *cygwin* | *mingw* ) - if test "$build_libtool_libs" != yes; then - wrappers_required=no - fi + test yes = "$build_libtool_libs" || wrappers_required=false ;; *) - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - wrappers_required=no + if test no = "$need_relink" || test yes != "$build_libtool_libs"; then + wrappers_required=false fi ;; esac - if test "$wrappers_required" = no; then + $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" + link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 @@ -8914,12 +10408,12 @@ fi # Delete the generated files. - if test -f "$output_objdir/${outputname}S.${objext}"; then - func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + if test -f "$output_objdir/${outputname}S.$objext"; then + func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status - fi + } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" @@ -8949,9 +10443,9 @@ fi fi - if test "$no_install" = yes; then + if test yes = "$no_install"; then # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" + link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. @@ -8968,27 +10462,28 @@ exit $EXIT_SUCCESS fi - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - func_warning "this platform does not like uninstalled shared libraries" - func_warning "\`$output' will be relinked during installation" - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi + case $hardcode_action,$fast_install in + relink,*) + # Fast installation is not supported + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "'$output' will be relinked during installation" + ;; + *,yes) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + ;; + *,no) + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + ;; + *,needless) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command= + ;; + esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` @@ -9045,8 +10540,8 @@ func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result - cwrappersource="$output_path/$objdir/lt-$output_name.c" - cwrapper="$output_path/$output_name.exe" + cwrappersource=$output_path/$objdir/lt-$output_name.c + cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 @@ -9067,7 +10562,7 @@ trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. - if test "x$build" = "x$host" ; then + if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result @@ -9090,25 +10585,27 @@ # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save $symfileobj" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" + case $build_libtool_libs in + convenience) + oldobjs="$libobjs_save $symfileobj" + addlibs=$convenience build_libtool_libs=no - else + ;; + module) + oldobjs=$libobjs_save + addlibs=$old_convenience + build_libtool_libs=no + ;; + *) oldobjs="$old_deplibs $non_pic_objects" - if test "$preload" = yes && test -f "$symfileobj"; then - func_append oldobjs " $symfileobj" - fi - fi - addlibs="$old_convenience" - fi + $preload && test -f "$symfileobj" \ + && func_append oldobjs " $symfileobj" + addlibs=$old_convenience + ;; + esac if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" + gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs @@ -9116,13 +10613,13 @@ fi # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" + gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles @@ -9143,7 +10640,7 @@ : else echo "copying selected object files to avoid basename conflicts..." - gentop="$output_objdir/${outputname}x" + gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs @@ -9152,7 +10649,7 @@ for obj in $save_oldobjs do func_basename "$obj" - objbase="$func_basename_result" + objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) @@ -9221,18 +10718,18 @@ else # the above command should be used before it gets too long oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then + if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist - if test "X$oldobjs" = "X" ; then + if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" @@ -9249,7 +10746,7 @@ case $output in *.la) old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" + test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior @@ -9264,31 +10761,31 @@ fi done # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then + if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do - if test "$installed" = yes; then + if test yes = "$installed"; then if test -z "$install_libdir"; then break fi - output="$output_objdir/$outputname"i + output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" - name="$func_basename_result" + name=$func_basename_result func_resolve_sysroot "$deplib" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" + func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) @@ -9304,23 +10801,23 @@ *) func_append newdependency_libs " $deplib" ;; esac done - dependency_libs="$newdependency_libs" + dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" + func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done - dlfiles="$newdlfiles" + dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in @@ -9330,34 +10827,34 @@ # didn't already link the preopened objects directly into # the library: func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" + func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done - dlprefiles="$newdlprefiles" + dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done - dlfiles="$newdlfiles" + dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done - dlprefiles="$newdlprefiles" + dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin @@ -9373,10 +10870,9 @@ case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. - if test "x$bindir" != x ; - then + if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result$dlname + tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname @@ -9385,7 +10881,7 @@ esac $ECHO > $output "\ # $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. @@ -9399,7 +10895,7 @@ # The name of the static archive. old_library='$old_library' -# Linker flags that can not go in dependency_libs. +# Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. @@ -9425,7 +10921,7 @@ # Directory that this library needs to be installed in: libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then + if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi @@ -9440,27 +10936,29 @@ exit $EXIT_SUCCESS } -{ test "$opt_mode" = link || test "$opt_mode" = relink; } && - func_mode_link ${1+"$@"} +if test link = "$opt_mode" || test relink = "$opt_mode"; then + func_mode_link ${1+"$@"} +fi # func_mode_uninstall arg... func_mode_uninstall () { - $opt_debug - RM="$nonopt" + $debug_cmd + + RM=$nonopt files= - rmforce= + rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. - libtool_install_magic="$magic" + libtool_install_magic=$magic for arg do case $arg in - -f) func_append RM " $arg"; rmforce=yes ;; + -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac @@ -9473,18 +10971,18 @@ for file in $files; do func_dirname "$file" "" "." - dir="$func_dirname_result" - if test "X$dir" = X.; then - odir="$objdir" + dir=$func_dirname_result + if test . = "$dir"; then + odir=$objdir else - odir="$dir/$objdir" + odir=$dir/$objdir fi func_basename "$file" - name="$func_basename_result" - test "$opt_mode" = uninstall && odir="$dir" + name=$func_basename_result + test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates - if test "$opt_mode" = clean; then + if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; @@ -9499,11 +10997,11 @@ elif test -d "$file"; then exit_status=1 continue - elif test "$rmforce" = yes; then + elif $rmforce; then continue fi - rmfiles="$file" + rmfiles=$file case $name in *.la) @@ -9517,7 +11015,7 @@ done test -n "$old_library" && func_append rmfiles " $odir/$old_library" - case "$opt_mode" in + case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; @@ -9528,12 +11026,12 @@ uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. - func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. - func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; @@ -9549,21 +11047,19 @@ func_source $dir/$name # Add PIC object to the list of files to remove. - if test -n "$pic_object" && - test "$pic_object" != none; then + if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" && - test "$non_pic_object" != none; then + if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) - if test "$opt_mode" = clean ; then + if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) @@ -9590,12 +11086,12 @@ # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles - func_append rmfiles " $odir/$name $odir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then + func_append rmfiles " $odir/$name $odir/${name}S.$objext" + if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi - if test "X$noexename" != "X$name" ; then - func_append rmfiles " $odir/lt-${noexename}.c" + if test "X$noexename" != "X$name"; then + func_append rmfiles " $odir/lt-$noexename.c" fi fi fi @@ -9604,7 +11100,7 @@ func_show_eval "$RM $rmfiles" 'exit_status=1' done - # Try to remove the ${objdir}s in the directories where we deleted files + # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" @@ -9614,16 +11110,17 @@ exit $exit_status } -{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && - func_mode_uninstall ${1+"$@"} +if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then + func_mode_uninstall ${1+"$@"} +fi test -z "$opt_mode" && { - help="$generic_help" + help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$opt_mode'" + func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" @@ -9634,7 +11131,7 @@ # The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting +# where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support @@ -9657,5 +11154,3 @@ # mode:shell-script # sh-indentation:2 # End: -# vi:sw=2 - diff -Nru gstreamer-vaapi-0.7.0/ChangeLog gstreamer-vaapi-1.8.2/ChangeLog --- gstreamer-vaapi-0.7.0/ChangeLog 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ChangeLog 2016-06-09 08:36:15.000000000 +0000 @@ -0,0 +1,21704 @@ +=== release 1.8.2 === + +2016-06-09 Sebastian Dröge + + * configure.ac: + releasing 1.8.2 + +2016-04-29 13:11:48 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipluginbase.h: + plugin: fix macro processor check + Instead of #ifdef it should be used #if becasuse USE_GST_GL_HELPERS is always + defined in config.h, but it would be 0 or 1 depending on the configure output. + https://bugzilla.gnome.org/show_bug.cgi?id=765702 + +2016-04-29 12:53:06 +0200 Víctor Manuel Jáquez Leal + + * tests/test-display.c: + tests: display: guard possible unused variables + https://bugzilla.gnome.org/show_bug.cgi?id=765702 + +=== release 1.8.1 === + +2016-04-20 18:39:46 +0300 Sebastian Dröge + + * ChangeLog: + * NEWS: + * configure.ac: + * gstreamer-vaapi.doap: + Release 1.8.1 + +2016-04-13 20:33:32 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipluginutil.c: + plugins: fix compilation when EGL/GLX is disabled + The compiler might complain of gst_vaapi_create_display_from_handle() being + unused if both EGL and GLX are disabled. This patch avoid that compilation + error. + +2016-04-07 18:03:42 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapisurface.c: + surface: destroy derived image + If gst_vaapi_image_new_with_image() fails, the created derived image should be + destroyed, otherwise the surface cannot be processed because is being used. + https://bugzilla.gnome.org/show_bug.cgi?id=764607 + +2016-04-19 12:00:11 +0200 Víctor Manuel Jáquez Leal + + * configure.ac: + build: restrict until codecparsers <= 1.8.99 + gstreamer-codecparsers-1.0 version 1.9 includes an API/ABI break in VP9 + parser. This patch restricts the compilation of gstreamer-vaapi version 1.8 + with a gstreamer-codecparsers-1.0 version lower than 1.8.99 + +2016-04-13 14:09:00 +0200 Michael Olbrich + + * gst-libs/gst/vaapi/gstvaapicodedbufferpool.c: + libs: fix deleting a GstVaapiCodedBufferPool object + Call gst_vaapi_video_pool_finalize() in coded_buffer_pool_finalize(). + Otherwise it is not called when the pool is destroyed and all objects + referenced by the GstVaapiVideoPool are never released. + https://bugzilla.gnome.org/show_bug.cgi?id=764993 + +2016-03-30 14:37:21 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + decoder: h265: Fix offset calculation when there is more than one vps/sps/pps present in codec_data + The array_completeness, reserved bit and num_nal_units fields + in HEVCDecoderConfigurationRecord will be present for each VPS/SPS/PPS array list, + but not for each occurance of similar headers. + https://bugzilla.gnome.org/show_bug.cgi?id=764274 + +2016-03-28 13:13:56 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapivideometa_texture.c: + gltextureupload: use an array for texture type + Instead of using a single value for the texture type, use an array with 4 + elements, just as the GstVideoGLTextureUploadMeta, avoiding a buffer + overflow. + https://bugzilla.gnome.org/show_bug.cgi?id=764231 + +2016-03-24 13:36:24 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.h: + vaapidecode: GST_VAAPIDECODE macro is a cast + This patch is the continuation of commit 1e1d3b1d because the function + gst_vaapidecode_get_type() got undefined since then. + Now, the macro GST_VAAPIDECODE is a simple cast to the GstVaapiDecode + structure. The rest of the GObject handling macros were deleted too. + +=== release 1.8.0 === + +2016-03-24 13:11:05 +0200 Sebastian Dröge + + * ChangeLog: + * NEWS: + * configure.ac: + * gstreamer-vaapi.doap: + Release 1.8.0 + +=== release 1.7.91 === + +2016-03-15 12:39:20 +0200 Sebastian Dröge + + * ChangeLog: + * NEWS: + * configure.ac: + * gstreamer-vaapi.doap: + Release 1.7.91 + +2016-03-11 17:44:07 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + decoder: h265: Fix offset calculation in codec_data parsing + https://bugzilla.gnome.org/show_bug.cgi?id=762922 + +2016-03-09 20:26:31 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecodebin.c: + vaapidecodebin: don't handle jpeg decoding + As JPEG decoder has been split and demoted, it cannot be handled by + vaapidecodebin + Added a fixme comment regarding the future removal of vaapidecode. + https://bugzilla.gnome.org/show_bug.cgi?id=734093 + +2016-03-09 20:25:08 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: split out jpeg decoder + Split, as a different element, the JPEG decoder. + https://bugzilla.gnome.org/show_bug.cgi?id=734093 + +2016-03-09 18:41:49 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecode.h: + vaapidecode: register decoder with internal GType + Don't expose the the vaapidecode GType, instead expose a function + which will register element. + This is the first step to split the decoder by codecs. + https://bugzilla.gnome.org/show_bug.cgi?id=734093 + +2016-03-10 12:47:49 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: remove unused function declaration + There is no need to pre-declare gst_vaapidecode_update_sink_caps(). And fixed + code-style of the other pre-declared functions. + +2016-03-09 18:58:13 +0100 Víctor Manuel Jáquez Leal + + * docs/plugins/Makefile.am: + build: git ignore gtkdoc generated files + +2016-03-09 18:55:39 +0100 Víctor Manuel Jáquez Leal + + * m4/Makefile.am: + build: handle git ignore in m4 directory + +2016-03-04 20:17:54 -0300 Thiago Santos + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + vaapidecoder_h265: plug leak of h265 parsing info + If something goes wrong while parsing, the info object is + being leaked + https://bugzilla.gnome.org/show_bug.cgi?id=763121 + +2016-03-04 20:17:20 -0300 Thiago Santos + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + vaapidecoder_h264: plug leak of h264 parsing info + If something goes wrong while parsing, the info object is + being leaked + https://bugzilla.gnome.org/show_bug.cgi?id=763121 + +2016-03-09 11:03:28 +0900 Vineeth TM + + * gst/vaapi/gstvaapipluginutil.c: + plugins: fix gstgl and vaapi memory leaks + 1\ Unref gl_display and gl_window as soon they are not needed. + 2\ Remove an unneeded display type check, since is handled by + gst_vaapi_created_display_from_handle() + 3\ Unref vaapi's display if the display cannot be bind to a GL API. + Modified-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=763354 + +2016-03-09 14:13:24 +0900 Vineeth TM + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + vaapidisplay: Fix uninitialized value error for VA attribute + https://bugzilla.gnome.org/show_bug.cgi?id=763362 + +2016-03-08 10:47:56 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapiencode.c: + plugins: proxy information from downstream caps + Propagate to upstream the downstream information, such as fps, par, etc. + This will fix several "getcaps" critical warnings in gst-validate. + https://bugzilla.gnome.org/show_bug.cgi?id=763300 + +2016-03-04 10:51:42 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_vp9.c: + decoder: vp9: Assign values for profile and bit_depth from frame header + bit_depth field has added only in VA-API 0.39.0, added version check. + +2016-03-04 09:12:13 +0200 Sebastian Dröge + + * Makefile.am: + build: Dist gstreamer-vaapi.doap and configure.ac/autogen.sh + https://bugzilla.gnome.org/show_bug.cgi?id=763067 + +=== release 1.7.90 === + +2016-03-01 19:23:51 +0200 Sebastian Dröge + + * ChangeLog: + * NEWS: + * configure.ac: + * gstreamer-vaapi.doap: + Release 1.7.90 + +2016-03-01 16:14:47 +0200 Sebastian Dröge + + * configure.ac: + configure: Use AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO to set release date + +2016-03-01 11:35:49 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: intersect with filter in getcaps() + In commit 6034734d I forgot to add the caps filter intersection in the + getcaps() vmethod generating a regression when a capsfilter is set in the + pipeline. + This commit adds the caps filter intersection. + +2016-02-29 11:55:27 +0200 Lim Siew Hoon + + * gst-libs/gst/vaapi/gstvaapiencoder_jpeg.c: + Add memset to initialize value for VAEncSliceParameterBufferJPEG + https://bugzilla.gnome.org/show_bug.cgi?id=762850 + +2016-02-26 12:42:46 +0200 Sebastian Dröge + + * common: + Automatic update of common submodule + From b64f03f to 6f2d209 + +2016-02-24 12:36:33 +0100 Víctor Manuel Jáquez Leal + + * Makefile.am: + * configure.ac: + * m4/Makefile.am: + build: add m4 directory + Instead of rely on the automatic creation of m4 directory by aclocal, we + already control it. Later we could create our own m4 scripts in order to + unclutter configure.ac + https://bugzilla.gnome.org/show_bug.cgi?id=762528 + +2016-02-23 10:55:02 +0200 Scott D Phillips + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + decoder: hevc: Fill dependent slice segment headers while parsing + Copy the data into the dependent slice segment header from the + corresponding independent slice segment header during parsing. + Previously the reference to the "previous" independent header was + held through the parsing phase and then dereferenced during the + decoding phase. This caused all dependent headers to be populated + with the data of the AU's last independent header instead of the + proper corresponding header. + https://bugzilla.gnome.org/show_bug.cgi?id=762352 + Changes since v1: + - Reworded commit message + +2016-02-17 13:43:48 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: use video decoder getcaps() + The usage of getcaps() vmethod is preferred than to handle manually the sink's + caps query. + In order to avoid function declarations, this patch moves the class_init() + method to the end of the file. + +2016-02-17 12:51:45 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipluginbase.c: + plugins: remove deprecated code + Since we are only supporting current GStreamer version, since 1.3 + gst_buffer_pool_config_add_option() checks if the option to add is + already set. There is no need to do it ourselves. + +2016-02-19 19:03:44 -0300 Thiago Santos + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + vaapidecoder_h265: fix parsing of NALU aligned data + Don't assume the whole buffer is a single NAL, instead look for the + next start code in case there are multiple NALs per buffer. + https://bugzilla.gnome.org/show_bug.cgi?id=762328 + +2016-02-19 11:10:25 -0300 Thiago Santos + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + vaapidecoder_h264: fix parsing of NALU aligned data + Don't assume the whole buffer is a single NAL, instead look for the + next start code in case there are multiple NALs per buffer. + https://bugzilla.gnome.org/show_bug.cgi?id=762328 + +2016-02-18 10:13:53 +0900 Vineeth TM + + * gst/vaapi/gstvaapisink.c: + vaapisink: Fix event,pad,structure memory leaks + https://bugzilla.gnome.org/show_bug.cgi?id=762229 + +2016-02-17 15:40:54 +0200 Lim Siew Hoon + + * gst/vaapi/gstvaapipluginbase.c: + Add icamerasrc as dmabuf capable peer element + icamerasrc is another gstreamer plugin using to capture RAW + frames from camera device. It is based on libcamhal library. + There are some properties available to control icamera behavior. + Signed-off-by: Lim Siew Hoon + Tested & Reviewed: Zhu Haiyang + https://bugzilla.gnome.org/show_bug.cgi?id=759481 + Fixme: This is the similar workaround we done for v4l2src. + The workaround will be removed once we fix #755072 + +2016-02-17 17:15:28 +0900 Vineeth TM + + * gst/vaapi/gstvaapipluginbase.c: + vaapipluginbase: Fix structure memory leak + config structure is not being freed in all cases + https://bugzilla.gnome.org/show_bug.cgi?id=762172 + +2016-02-17 17:20:08 +0900 Vineeth TM + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: Fix videocodec state memory leak + When state is not NULL and either width/height of video info is 0, then state leaks + https://bugzilla.gnome.org/show_bug.cgi?id=762173 + +2016-02-16 15:44:48 +0000 Tim-Philipp Müller + + * gst/vaapi/gstvaapisink.c: + vaapisink: post message for application for unhandled keyboard/mouse events + Makes (most) keyboard shortcuts work in gst-play-1.0 when + the video window has focus. + +2016-02-16 08:48:43 +0900 Vineeth TM + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: Fix capsfeature memory leak + https://bugzilla.gnome.org/show_bug.cgi?id=762116 + +2016-02-16 08:15:40 +0900 Vineeth TM + + * gst/vaapi/gstvaapisink.c: + vaapisink: Fix capsfeature memory leak + caps feature allocated is not being freeing in some cases + https://bugzilla.gnome.org/show_bug.cgi?id=762111 + +2016-02-16 15:09:01 +0200 Sebastian Dröge + + * configure.ac: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapidecoder_vp8.c: + * gst-libs/gst/vaapi/gstvaapidecoder_vp9.c: + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst/vaapi/gstvaapidecodebin.c: + * gst/vaapi/gstvaapipluginutil.c: + vaapi: Fix various compiler warnings and disable -Wredundant-decls for now + +2016-02-16 14:36:39 +0200 Sebastian Dröge + + * configure.ac: + configure: Fix setting of extra compiler warning flags + +2016-02-15 18:00:49 +0100 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapibufferproxy.c: + libs: fix build error + gst_vaapi_buffer_proxy_{acquire_handle,release_handle,finalize,class} + functions are used only when libva's API version is greater than 0.36.0 + This patch guards those functions completely rather than just their + content. The patch is a continuation of commit 38f8fea4 + Original-patch-by: Vineeth TM + https://bugzilla.gnome.org/show_bug.cgi?id=762055 + +2016-02-15 10:01:54 +0900 Vineeth TM + + * tests/simple-encoder.c: + tests: simple-encoder: fix build error + argument mismatch of gsize with 'long unsigned int' + https://bugzilla.gnome.org/show_bug.cgi?id=762055 + +2016-02-04 10:16:00 +0200 Sreerenj Balachandran + + * gst/vaapi/gstvaapisink.c: + vaapisink: Fix wrong caps advertising + The get_caps() should only report the supported formats. + https://bugzilla.gnome.org/show_bug.cgi?id=761147 + +2016-02-05 18:11:29 -0300 Thiago Santos + + * common: + Automatic update of common submodule + From e97c9bb to b64f03f + +2016-02-03 19:07:40 +0100 Víctor Manuel Jáquez Leal + + * docs/plugins/gstreamer-vaapi-plugins-docs.xml.in: + * docs/plugins/gstreamer-vaapi-plugins-sections.txt: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_h265.c: + * gst/vaapi/gstvaapiencode_jpeg.c: + * gst/vaapi/gstvaapiencode_mpeg2.c: + * gst/vaapi/gstvaapiencode_vp8.c: + rename encoders to vaapi{codec}enc + Trying to comply with GStreamer's element names, this patch renames the + encoders using the name format vaapi{codec}enc. + In this way, the plugin documentation is linked correctly. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-02-03 18:42:36 +0100 Víctor Manuel Jáquez Leal + + * configure.ac: + Use new AG_GST_ARG_ENABLE_EXTRA_CHECKS #define + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-02-03 18:02:21 +0100 Víctor Manuel Jáquez Leal + + * configure.ac: + build: remove vp9 parser check + Since the VP9 parser was added in gst-plugins-bad 1.7.1 we can remove safely + the check of the parser, as we did for the others. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-02-03 17:06:48 +0100 Víctor Manuel Jáquez Leal + + * common: + * configure.ac: + Back to development + Signed-off-by: Víctor Manuel Jáquez Leal + +=== release 1.6.0 === + +2016-02-03 16:53:41 +0100 Víctor Manuel Jáquez Leal + + * configure.ac: + Release 1.6.0 + +2016-02-03 16:45:18 +0100 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h265.c: + libs: fix compiler warnings + After setting the release flags, the compiler warns about a couple + initialized variables. + Also marked a couple of set variables as unused, because they are only + used for assertion. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-29 20:41:27 +0100 Víctor Manuel Jáquez Leal + + * docs/plugins/gstreamer-vaapi-plugins-docs.xml.in: + * docs/plugins/gstreamer-vaapi-plugins-sections.txt: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecodebin.c: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_h265.c: + * gst/vaapi/gstvaapiencode_jpeg.c: + * gst/vaapi/gstvaapiencode_mpeg2.c: + * gst/vaapi/gstvaapiencode_vp8.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + docs: update plugin documentation + Update all the documentation of elements of the vaapi plugin. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-29 15:39:09 +0100 Víctor Manuel Jáquez Leal + + * Makefile.am: + * configure.ac: + * docs/Makefile.am: + * docs/plugins/Makefile.am: + * docs/plugins/gstreamer-vaapi-plugins-docs.xml.in: + * docs/plugins/gstreamer-vaapi-plugins.types: + * docs/reference/Makefile.am: + * docs/reference/plugins/Makefile.am: + * docs/reference/plugins/plugins-docs.xml.in: + * docs/reference/plugins/plugins-overrides.txt: + * docs/reference/plugins/plugins-sections.txt: + * docs/reference/plugins/plugins.types: + * docs/version.entities.in: + resurrect gtk-doc machinery + Our auto-generated documentation has been a bit neglected. This patch replaces + the 'normal' gtk-doc with the one used in GStreamer, which is adapted for + plugins, elements and libraries. + This patch also re-enables documentation generation. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-28 19:35:24 +0100 Víctor Manuel Jáquez Leal + + * ChangeLog: + * Makefile.am: + * autogen.sh: + * configure.ac: + use gst-common submodule + This is 'the' big change in gstreamer-vaapi autoconf. Now it uses the official + GStreamer common submodule. + The documentation generation has been disable temporarily since it needs a + major rework, which will be done in the following commit. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-25 16:06:03 +0100 Víctor Manuel Jáquez Leal + + * .gitmodules: + * common: + add gst-common submodule + Pointing to branch 1.6 + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-28 13:28:30 +0100 Víctor Manuel Jáquez Leal + + * gstreamer-vaapi.doap: + add doap descriptor + DOAP (Description of a Project) is an RDF Schema and XML vocabulary to + describe software projects, in particular free and open source software. + The description is used in GStreamer as in many other open source projects. + This patch adds the doap description of this project. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-02-03 11:50:13 +0100 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapidecoder_dpb.c: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapidecoder_unit.c: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiparser_frame.c: + * gst-libs/gst/vaapi/gstvaapipixmap.c: + * gst-libs/gst/vaapi/gstvaapipixmap_x11.c: + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + libs: humongous code style fix + As part of the upstreaming process of gstreamer-vaapi into the GStreamer + umbrella, we need to comply with the project's code style. This meant to + change a lot of code. + It was decided to use a single massive patch to update the code style. + I would like to apologize with the original developers of this code because of + the history breakage. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-02-03 11:04:15 +0100 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapidecoder_vp9.c: + * gst-libs/gst/vaapi/gstvaapidisplay_egl.c: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst/vaapi/gstvaapivideomemory.c: + libs: small refactors to enhance the code style + As gst-indent generated ugly code in these cases, this patch changes the used + idiomatic into other one. + No functional changes were introduced. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-02-02 17:59:57 +0100 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapicodec_objects.c: + * gst-libs/gst/vaapi/gstvaapicodedbufferpool.c: + * gst-libs/gst/vaapi/gstvaapicodedbufferproxy.c: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_vp8.c: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h265.c: + * gst-libs/gst/vaapi/gstvaapiencoder_objects.c: + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapiutils_egl.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapiutils_h265.c: + * gst-libs/gst/vaapi/gstvaapiutils_x11.c: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow_egl.c: + libs: small code style fixes + This a set of small code style fixes detected as-is by gst-indent. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-02-02 17:50:19 +0100 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapicodedbufferpool.c: + * gst-libs/gst/vaapi/gstvaapidecoder_vp8.c: + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapitexture_egl.c: + * gst-libs/gst/vaapi/gstvaapitexture_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_drm.c: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + libs: trivial comment style fixes + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-02-02 17:31:02 +0100 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapicodedbuffer.c: + * gst-libs/gst/vaapi/gstvaapiwindow_egl.c: + libs: avoid gst-indent mess up + Guard pieces of code to avoid gst-ident to mess up the following code. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-02-03 12:17:59 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecodebin.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapivideomemory.c: + plugins: fix code style + Minor code style changes by executing gst-indent in gst/vaapi directory. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-02-01 13:22:10 +0000 Tim-Philipp Müller + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + Fix some more compiler warning + Two (false) compiler warnings about variables potentially + being used uninitialized, and one about a variable being + set but not used. + https://bugzilla.gnome.org/show_bug.cgi?id=759192 + +2016-02-01 13:02:13 +0000 Tim-Philipp Müller + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipostproc.c: + * tests/simple-encoder.c: + * tests/test-filter.c: + vaapi: fix 'ISO C90 forbids mixed declarations and code' compiler warnings + Declare variables at the beginning of a code block, which + is how it's done in GStreamer. + https://bugzilla.gnome.org/show_bug.cgi?id=759192 + +2016-01-28 14:21:04 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_vp9.c: + decoder: vp9: Fix crop rectangle setting + Align with software vp9dec behaviour: Add crop rectangle + only if display_width/display_height is less than the + frame_hdr->width/frame_hdr->height + +2016-01-27 08:56:45 +0200 Sreerenj Balachandran + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: Fix renegotiation for resolution change + Always renegotiate the pool if the immediate frame which going + to be pushed has a different un-cropped resolution than the already + configured one. + +2016-01-29 15:51:49 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipluginbase.h: + plugins: use the same pre-processor macro + In gstvaapipluginbase.c we are using the macro USE_GST_GL_HELPERS to guard the + code related with GstGL. Nonetheless, in gstvaapipluginbase.h we are using + HAVE_GST_GL_GL_H macro in order to include the GstGLContext's header. + We should use only one to be homogeneous. This patch sets USE_GST_GL_HELPERS + in the header file. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-29 18:06:29 +0100 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + decoder: update a deprecated function + Somehow this didn't show up earlier, but gst_adapter_prev_timestamp() got + deprecated since GStreamer 1.0. + This patch replace it with gst_adapter_prev_pts() + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-29 13:13:56 +0100 Víctor Manuel Jáquez Leal + + * configure.ac: + build: honor configure's cache + The user might enable --config-cache when calling configure script. If so, our + configuration variables will not be correctly calculated. + This patch extracts the value of our variables either from the cache or from + the operation result. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-28 19:12:13 +0100 Víctor Manuel Jáquez Leal + + * configure.ac: + build: use common version variables + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-28 19:01:43 +0100 Víctor Manuel Jáquez Leal + + * configure.ac: + build: hard-code an unneeded macro + That macro is required for EGL's dynamic module loading, but since + gstreamer-vaapi doesn't creates dynamic modules, it is not required anymore. + That code in gst-libs/gst/vaapi/gstvaapidisplay_egl.c should be removed. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-28 17:14:51 +0100 Víctor Manuel Jáquez Leal + + * configure.ac: + build: refactorization of dependency tracking + This patch tries to avoid branching in configure.ac using a more functional + approach in macros usage. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-29 12:34:30 +0100 Víctor Manuel Jáquez Leal + + * configure.ac: + build: check for OpenGL either GLX or EGL are requested + Refactor some code in configure.ac to centralize $enable_opengl definition. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-28 16:55:44 +0100 Víctor Manuel Jáquez Leal + + * configure.ac: + build: indent and add square braces + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-28 16:50:39 +0100 Víctor Manuel Jáquez Leal + + * configure.ac: + build: upgrade autotools version dependency + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-29 11:14:34 +0100 Víctor Manuel Jáquez Leal + + * configure.ac: + build: enhance string comparisons + Add a 'x' as a prefix in string comparisons to watch out for edge cases where + the string is empty or undefined. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-28 14:29:16 +0100 Víctor Manuel Jáquez Leal + + * configure.ac: + build: remove unused variables + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-27 19:00:51 +0100 Víctor Manuel Jáquez Leal + + * configure.ac: + build: remove check for old version of gstreamer + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-27 17:55:02 +0100 Víctor Manuel Jáquez Leal + + * configure.ac: + build: remove GStreamer's parsers checks + This patch removes almost all the parsers check since they are already in place, + with the exception of the VP9 parser, since it was merged in Gstreamer 1.7. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-29 12:11:17 +0100 Víctor Manuel Jáquez Leal + + * configure.ac: + * gst/vaapi/Makefile.am: + build: add gstreamer-pbutils dependency + This dependency was added in gstvaapidecodebin with the call + gst_missing_element_message_new(). + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-27 17:53:59 +0100 Víctor Manuel Jáquez Leal + + * configure.ac: + build: fix variable declaration + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-27 17:47:32 +0100 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/Makefile.am: + build: fix when HEVC decoder is disabled + This a very pathological situation: when we have a HEVC encoder but not a HEVC + decoder. + The encoder needs functions that are only available when the decoder is + enabled. + This patch moves the utils functions into the generic sources, such as the + rest of the utils. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-27 17:20:31 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/Makefile.am: + build: remove unused EGL specific sources + These Makefile variables are not used at all. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-27 17:19:32 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/Makefile.am: + build: remove check for GStreamer 1.2 + Since we are working for current stable GStreamer 1.6 + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-26 11:49:40 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapiparse.h: + Remove more video parser crufts + This header is not used anymore since it declares parsers that are + already in GStreamer 1.6 + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-25 12:43:15 +0000 Tim-Philipp Müller + + * configure.ac: + * docs/reference/Makefile.am: + * docs/reference/libs/Makefile.am: + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/libs/libs-overrides.txt: + * docs/reference/libs/libs-sections.txt: + docs: remove library documentation which is non-public now + https://bugzilla.gnome.org/show_bug.cgi?id=759192 + +2016-01-25 12:40:49 +0000 Tim-Philipp Müller + + * Makefile.am: + * configure.ac: + * debian.upstream/Makefile.am: + * debian.upstream/changelog.in: + * debian.upstream/compat: + * debian.upstream/control.in: + * debian.upstream/copyright: + * debian.upstream/gstreamer-vaapi-doc.install.in: + * debian.upstream/gstreamer-vaapi.install.in: + * debian.upstream/rules: + Remove debian.upstream packaging + https://bugzilla.gnome.org/show_bug.cgi?id=759192 + +2016-01-22 19:27:13 +0100 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst/vaapi/gstcompat.h: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginbase.h: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapisink.c: + Remove old gst version guards + As gstreamer-vaapi now only supports from GStreamer 1.6, this patch removes + all the old GStreamer version guards. + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-22 19:23:43 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapiparse.c: + Remove video parser crufts + We forgot to remove gstvaapiparse.c when we removed all the videoparser + machinery. + Signed-off-by: Víctor Manuel Jáquez Leal + +2015-12-09 19:52:33 +0100 Víctor Manuel Jáquez Leal + + * docs/reference/libs/Makefile.am: + * docs/reference/plugins/Makefile.am: + * gst-libs/gst/vaapi/Makefile.am: + * gst/vaapi/Makefile.am: + * tests/Makefile.am: + libs: remove versioning + Since we don't install libraries anymore, it makes no sense to keep + versioning them according to the gstreamer's version. + Signed-off-by: Víctor Manuel Jáquez Leal + +2015-12-09 16:59:16 +0100 Víctor Manuel Jáquez Leal + + * configure.ac: + * debian.upstream/Makefile.am: + * debian.upstream/control.in: + * debian.upstream/libgstvaapi-dev.install.in: + * debian.upstream/libgstvaapi-drm.install.in: + * debian.upstream/libgstvaapi-glx.install.in: + * debian.upstream/libgstvaapi-wayland.install.in: + * debian.upstream/libgstvaapi-x11.install.in: + * debian.upstream/libgstvaapi.install.in: + * gst-libs/gst/vaapi/Makefile.am: + * tests/Makefile.am: + libs: make libraries no installables + Signed-off-by: Víctor Manuel Jáquez Leal + +2015-12-09 15:37:39 +0100 Víctor Manuel Jáquez Leal + + * debian.upstream/libgstvaapi-dev.install.in: + * gst-libs/gst/vaapi/Makefile.am: + Do not install libgstvaapi headers + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-19 10:40:54 +0200 Sreerenj Balachandran + + * Makefile.am: + * configure.ac: + * patches/Makefile.am: + * patches/videoparsers/0001-plugins-compile-the-built-in-video-parsers-as-vaapip.patch: + * patches/videoparsers/0002-h264parse-fix-build-with-older-GStreamer-1.x-stacks.patch: + * patches/videoparsers/0003-h264parse-default-to-byte-stream-nalu-format-Annex-B.patch: + * patches/videoparsers/0004-h264parse-Disable-3D-video-support-for-GStreamer-1.5.patch: + * patches/videoparsers/0005-videoparsers-h264-Disable-passthorugh-mode-enabling.patch: + * patches/videoparsers/0006-h265parse-include-gstvaapiparse.h.patch: + * patches/videoparsers/0007-h265parse-fix-build-with-GStreamer-1.5.patch: + * patches/videoparsers/Makefile.am: + * patches/videoparsers/series.frag: + Remove videoparser patches + +2015-12-09 15:18:11 +0100 Víctor Manuel Jáquez Leal + + * Makefile.am: + * configure.ac: + * debian.upstream/libgstvaapi-dev.install.in: + * pkgconfig/Makefile.am: + * pkgconfig/gstreamer-vaapi-drm.pc.in: + * pkgconfig/gstreamer-vaapi-glx.pc.in: + * pkgconfig/gstreamer-vaapi-wayland.pc.in: + * pkgconfig/gstreamer-vaapi-x11.pc.in: + * pkgconfig/gstreamer-vaapi.pc.in: + Remove pkg-config files + Signed-off-by: Víctor Manuel Jáquez Leal + +2015-12-09 13:24:30 +0100 Víctor Manuel Jáquez Leal + + * .gitmodules: + * Makefile.am: + * configure.ac: + * ext/Makefile.am: + * ext/codecparsers: + * gst-libs/gst/Makefile.am: + * gst-libs/gst/codecparsers/Makefile.am: + * gst-libs/gst/vaapi/Makefile.am: + * gst/vaapi/Makefile.am: + Remove codecparsers submodule + Signed-off-by: Víctor Manuel Jáquez Leal + +2015-12-08 00:36:36 +0200 Sreerenj Balachandran + + * .gitmodules: + * autogen.sh: + * configure.ac: + * debian.upstream/libgstvaapi.install.in: + * ext/Makefile.am: + * ext/libvpx/Makefile.am: + * ext/libvpx/gstlibvpx.c: + * ext/libvpx/gstlibvpx.h: + * ext/libvpx/libgstcodecparsers_vpx.vers: + * ext/libvpx/sources.frag: + * ext/libvpx/upstream: + * gst-libs/gst/codecparsers/Makefile.am: + * gst-libs/gst/codecparsers/gstvaapilibvpx.c: + Remove libvpx submodule + We will be using upstream codecparsers always. + No more internal libvpx ! + +2015-12-09 14:12:22 +0100 Víctor Manuel Jáquez Leal + + * configure.ac: + build: fix check for GstJpegParser + Right now the local JPEG parser is always compiled because the check for the + upstreamed version is broken: it looks for an non existent symbol: + GstJpegImage. + This patch changes that check for< GstJpegFrameHdr. + Signed-off-by: Víctor Manuel Jáquez Leal + +2015-10-28 09:56:46 +0100 Michael Olbrich + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: free the frame in frame_release_callback() + This basically reverts 62c3888b76afc69f714a020957e8c5dd9d98f561 (wayland: + decouple wl_buffer from frame). + Otherwise the frame may be overwritten while it is still used by the + compositer: + The frame done callback (frame_done_callback()) is called, when the + compositor is done processing the frame and hands it to the hardware. + The buffer release callback (frame_release_callback()) is called when the + buffer memory is no longer used. + This can be quite some time later: E.g. if weston (with the DRM backend) + puts the buffer on a hardware plane, then then buffer release callback is + called when the kernel is done with the buffer. This is usually when the + next frame is shown, so most likely after the frame done callback for the + next frame! + Since 70eff01d36a2870cbf06ffb91c2a941e8cb6b804 "wayland: sync() when + destroy()" the mentioned possible leak should no longer be a problem, so + reverting this change should cause no leaking buffers. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=758848 + Signed-off-by: Víctor Manuel Jáquez Leal + +2016-01-14 17:36:24 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: check ANY caps at transform_caps() + When transforming downstream caps we should check for ANY caps from peer pad, + otherwise we get a segmentation fault. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=759893 + +2016-01-13 19:17:02 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapisink.c: + vaapisink: ignore frame if its upload failed + When gst_vaapi_plugin_base_get_input_buffer() fail to copy the input buffer + into a VAAPI buffer, the return value is GST_FLOW_NOT_SUPPORTED, and it was + ignored by the vaapisink, leading to a segmentation fault. + This patch ignores the frame that generated the GST_FLOW_NOT_SUPPORTED + returned by gst_vaapi_plugin_base_get_input_buffer(), avoiding the + segmentation fault, but doing and effort to continue rendering. This is + the same behavior of ximagesink. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=759332 + +2015-12-09 18:24:50 +0200 Joel Holdsworth + + * configure.ac: + build: Don't ignore GST_PLUGIN_PATH_1_0 even if the directory doesn't exist yet + https://bugzilla.gnome.org/show_bug.cgi?id=759184 + +2015-12-08 16:14:11 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + * gst-libs/gst/vaapi/gstvaapiutils_h265.c: + * gst-libs/gst/vaapi/gstvaapiutils_h265_priv.h: + Add 10 HEVC 10 bit decoding support + Only supporting vaapidecode ! vaapisink combination for now. + Missing dependencies: + 1: No support for P010 video format in GStreamer + 2: No support for P010 vaGetImage()/vaPutimage() in vaapi-intel-driver + 3: As a result of 1&2 , we have no support for Vaapi Video memory mapping + through GstVideoMeta. + Right now we only set chroma format (YUV420 with more than 8 bits per channel) + for surface pool and keeping GST_VIDEO_FORMAT as ENCODED. The underlying format + of the surfaces is implementation (driver) defined, which is P010. + +2001-01-01 04:59:28 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.h: + gstvaapisurfacepool: Add new API to create surface pool based on chroma type + This new API gst_vaapi_surface_pool_new_with_chroma_type() is for + creating a new GstVaapiVideoPool of GstVaapiSurfaces with the specified + chroam type and dimensions. The underlying format of the surfaces is + implementation (driver) defined. + +2015-12-07 19:06:28 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapiutils.c: + Add definitions for YUV420 with more than 8 bits per channel + +2015-12-07 17:26:24 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + gstvaapiporfile: Fix string representation of HEVCMain10 profile + +2015-12-07 16:17:11 +0200 Sreerenj Balachandran + + * configure.ac: + Bump version for development + +=== release 0.7.0 === + +2015-12-07 12:52:10 +0200 Sreerenj Balachandran + + * configure.ac: + 0.7.0 + +2015-12-07 12:49:05 +0200 Sreerenj Balachandran + + * NEWS: + NEWS: Updates + +2015-12-07 12:47:04 +0200 Sreerenj Balachandran + + * AUTHORS: + AUTHORS: Update + +2015-12-07 12:39:23 +0200 Sreerenj Balachandran + + * README: + README: Update + +2015-11-26 10:34:12 +0100 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapitexture_glx.c: + texture: detect GL version and use the proper API + When receiving the texture from the application or the video sink, we must + know it size and border. To query the texture the API has changed according to + the OpenGL version used in the GL context of the application/vsink. + This patch checks the current context API type and queries the texture + according to this detected API. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=753099 + +2015-11-26 10:19:32 +0100 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapitexture_glx.c: + texture: check for expected target and format + gst_vaapi_texture_glx_new_wrapped() only handles a GL_TEXTURE_2D target and + formats GL_RGBA or GL_BGRA. + This patch adds a debugging verification of those values. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=753099 + +2015-11-26 10:26:10 +0100 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + libs: add gl3_bind_texture_2d() + Since OpenGL3.1 removed the fixed pipelines[1] enabling 2D textures is not + needed. In particular, the Intel's Mesa implementation complains if it is + called. + This patch add a new binding function for 2D textures, without enabling + gl3_bind_texture_2d()[2]. + 1. https://www.opengl.org/wiki/Fixed_Function_Pipeline + 2. https://www.opengl.org/wiki/Common_Mistakes#OOP_and_hidden_binding + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=753099 + +2015-11-26 10:14:45 +0100 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + libs: add gl_get_current_api() + In order to know which OpenGL API use, we must detect the API type of current + context. This patch adds the function gl_get_current_api() which returns the + OpenGL API type. + This function is an adaptation of gst_gl_context_get_current_gl_api() from + GstGL. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=753099 + +2015-11-27 12:29:11 +0200 Sreerenj Balachandran + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + build: Add gmodule dependency for libgstvaapi_egl + https://bugzilla.gnome.org/show_bug.cgi?id=756259 + +2015-11-27 14:24:55 +0200 Sreerenj Balachandran + + * patches/videoparsers/0005-h265parse-include-gstvaapiparse.h.patch: + * patches/videoparsers/0005-videoparsers-h264-Disable-passthorugh-mode-enabling.patch: + * patches/videoparsers/0006-h265parse-fix-build-with-GStreamer-1.5.patch: + * patches/videoparsers/0006-h265parse-include-gstvaapiparse.h.patch: + * patches/videoparsers/0007-h265parse-fix-build-with-GStreamer-1.5.patch: + * patches/videoparsers/series.frag: + patches/videoparsers: h264: Disable passthorugh mode enabling + This is a quick fix for regression introduced by the upstream + commit e8908f5aeef952566f6bccde743c7735d3f8c6ef in h264 videoparser. + The patch is disabling the passthrough mode, otherwise it will + break multi-layer mvc stream parsing. + https://bugzilla.gnome.org/show_bug.cgi?id=758656 + +2015-11-25 15:12:53 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/Makefile.am: + * patches/videoparsers/Makefile.am: + * patches/videoparsers/series.frag: + build: add gsth265parse patches conditionally + As gsth265parse was added in GStreamer 1.4, and gstreamer-vaapi still support + GStreamer 1.2, the patching of gsth265parse must be conditional to the target + GStreamer version. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=755525 + +2015-11-25 15:11:28 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/Makefile.am: + build: declare correctly parse lib built files + This is a continuation of commit fc8a0d12 + When declaring BUILT_SOURCES, those files should not be distributed. This + patch avoids the distribution of the generated source code. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=755525 + +2015-11-24 17:14:20 +0200 Sreerenj Balachandran + + * ext/libvpx/sources.frag: + build: libvpx: Add missing source file + +2015-11-23 17:21:23 +0200 Sreerenj Balachandran + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: Correctly detect the caps change + This is a quick fix for regression introuduced by the + commit 757833230bc73b8e3b4e31649e4618ba802bea51 + With out this, the gst_vaapipostproc_create() will + never get invoked. + https://bugzilla.gnome.org/show_bug.cgi?id=758543 + +2015-11-18 20:48:30 +0100 Víctor Manuel Jáquez Leal + + * ext/libvpx/Makefile.am: + * ext/libvpx/sources.frag: + build: libvpx: update the sources lists + `make dist` broke since commit f06798 (libvpx: Update the submodule to + libvpx-1.4.0) because the sources.frag does not contain all the module + sources. + This patch updates thoroughly the sources. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=755525 + +2015-11-16 17:49:01 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: don't set caps change at first set + When the source caps change, the filter is destroyed and recreated. + Nonetheless, this happens every time the vaapipostproc starts, since the caps + change detection algorithm does not take in consideration when the caps are + set by first time. + This patch intents to be an optimization, to avoid a useless filter + destroy-creation cycle when the sources caps are set for first time. + The new helper function video_info_update() is a refactorization to avoid + duplicated code. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=758007 + +2015-11-12 16:13:25 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: params video_info_changed() callers + The signature is video_info_changed(old_vip, new_vip). Nonetheless the callers + swapped the the order. This didn't raise problems since the comparison of both + structures were not affected by its semantics. + But still it would be better to fix this to keep the coherence of the code. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=758007 + +2015-09-24 10:35:44 +0000 Víctor Manuel Jáquez Leal + + * gst/vaapi/Makefile.am: + build: declare real built files + When runnig the `make dist` target from a clean tree, it fails because + if could not find the copied files from codecparsers submodule. + They weren't copied because they weren't declared as built sources. + This patch removes the stamp mechanism and use the actual file list to copy + as the built sources. Also it fixes the duplication of the parser files. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=755525 + +2015-11-17 19:37:07 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_vp9.c: + decoder: vp9: Fix last/golden/altref frame index setting + Always fill VADecPictureParameterBufferVP9 last/golden/altref indices + based on what ever reference frame indices encoded in frame header. + +2015-08-25 16:01:51 +0000 Víctor Manuel Jáquez Leal + + * debian.upstream/rules: + debian: remove custom parallel compilation + In order to build a debian package with upstream source, the user should + do + ./autogen.sh + cp -a debian.upstream debian + debuild -eDEB_BUILD_OPTIONS="parallel=8" -us -uc -b + The environment variable DEB_BUILD_OPTIONS="parallel=8" is the canonical + way to make a parallel build (-j8 in this case). + This commit removes the script in debian/rules that detects the number of + cpus, requested by the environment variable DEBIAN_BUILD_NCPUS, which is not + official in debian. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=754087 + +2015-11-16 18:22:55 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_vp9.c: + decoder: vp9: Fix PTS calculation of cloned frames + +2015-11-16 18:22:33 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_vp9.c: + decoder: vp9: Avoid unnecessary show_frame flag checking while doing picture output + We always set GST_VAAPI_PICTURE_FLAG_SKIPPED for DECODE_ONLY frames and the + gstvaapidecoder base calss is reponsible for handling those frames later on. + No need for explicit verification of frame header's show_frame in order to + do picture outputing. + +2015-11-16 18:22:14 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_vp9.c: + decoder: vp9: Fix ref picture update while doing repeat frame + Don't try to do frame decoding and reference picture update + while receiving a vp9 frame having show_existing_frame flag + set as TRUE. + +2015-11-16 18:21:56 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_vp9.c: + decoder: vp9: Add repeat-frame display handling + If vp9 frame header come up with show_existing_frame flag set, + we should duplicate the existing decoded frame as current frame to + be displayed. + +2015-11-12 11:07:38 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecodebin.c: + vaapidecodebin: add me as element co-author + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=757957 + +2015-11-12 12:47:01 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecodebin.c: + vaapidecodebin: try to get display from decoder + Rather than create a dummy display, if none has propagated as a context, we + should try to get the one from vaapidecode. + As the bin is already in READY state, the vaapidecode should be also in that + state. That means that the contexts have been negotiated, and it should have + already a display. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=757957 + +2015-11-11 19:04:25 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecodebin.c: + * gst/vaapi/gstvaapidecodebin.h: + vaapidecodebin: add postprocessor dynamically + The former approach to left the bin unfinished has some problems: the context + cannot be shared because the vaapidecode is unlinked in many cases, leading to + creating a VADisplay twice. + Initially the bin is fully functional, constructed as + (-----------------------------------) + | vaapidecodebin | + | (-------------) (-------) | + |<--| vaapidecode |--->| queue |--->| + | (-------------) (-------) | + (-----------------------------------) + When the context is shared and the VADisplay has VPP capabilities, before + changing to READY state, the bin is reconfigured dynamically, adding the + vaapipostproc element afeter the queue: + (--------------------------------------------------------) + | vaapidecodebin | + | (-------------) (-------) (---------------) | + |<--| vaapidecode |--->| queue |--->| vaapipostproc |--->| + | (-------------) (-------) (---------------) | + (--------------------------------------------------------) + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=757957 + +2015-11-11 16:33:24 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecodebin.c: + vaapidecodebin: delay the bin configuration + Delay the bin configuration until changing to READY state. This is because we + should add the vaapipostproc element until the vaapidecode has emitted the + HAVE_CONTEXT message, so de gst_bin_add() could set the context set to + vaapipostproc. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=757957 + +2015-11-13 19:39:56 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_vp9.c: + decoder: vp9: Add crop rectangle support. + Set crop rectange if: + There is display_width and display_height which is different from actual width/height + or + The changed resolution is less than the actual configured dimension of surfaces + +2015-11-13 19:23:05 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_vp9.c: + decoder: vp9: Fix the context and surface pool reset for multi resolution video + Unlike other decoders, vp9 decoder doesn't need to reset the + whole context and surfaces for each resolution change. Context + reset only needed if resolution of any frame is greater than + what actullay configured. There are streams where a bigger + resolution set in ivf header or webm header but actual resolution + of all frames are less. Also it is possible to have inter-prediction + between these multi resolution frames. + +2015-11-13 18:58:33 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_vp9.c: + decoder: vp9: Fill the VADecPictureParameterBufferVP9 width/height from frame header + Always fill width/height of VADecPictureParameterBufferVP9 from frame header. + Preliminary fix for supproting multi resolution video decode. + +2015-11-13 18:51:27 +0200 Sreerenj Balachandran + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: Add comments for corner case fixes and fix couple of indentations. + +2015-11-13 18:41:53 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_vp9.c: + decoder: vp9: Set lossless flag from frame header + +2015-11-13 18:40:52 +0200 Sreerenj Balachandran + + * ext/codecparsers: + codecparsers: Update to gst-vaapi-branch d9f25 + d9f2527: codecparsers: vp9: Set lossless flag in frame header + +2015-11-11 19:16:16 +0100 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapidecoder_vp9.c: + libs: vp9: remove unused symbols + clang complains about a couple variables and one label which were not + used. This patch removes them. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=757958 + +2015-11-10 19:00:22 +0200 Sreerenj Balachandran + + * ext/codecparsers: + codecparsers: Update to gst-vaapi-branch da251bb + da251bb: codecparsers: vp9: Optimize the memory allocation + f5759f4: codecparsers: vp9: Fix the wrong memcpy of probability arrays + +2015-11-05 12:58:52 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginbase.h: + plugin: guard pointers to pad query functions + Since gstreamer 1.4 is not required to have pad query functions if the query + vmethods are used. + This patch guards out the pad query functions for gstreamer < 1.4 + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=757629 + +2015-11-05 12:39:55 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapiencode.c: + vaapiencode: use pad query vmethods + GstVideoEncoder, the base class of vaapiencode, added support for pad queries + as virtual methods since gstreamer 1.4. This patch enables those vmethods, + while keeps support for previous versions of gstreamer. + This patch is relevant since GstVideoEncoder takes care of other queries that + we are currently ignoring. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=757629 + +2015-10-28 13:01:04 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: return pad's template caps if no display + A caps query can occur before the element has a display. In that case, the + element can return its pad's template. But when the element already has a + display, and the caps probe fails, the element shall return an empty caps, so + the auto-plug could try with another decoder. + If the element has a display and the caps probe works, then the computed caps + should be returned. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=757598 + +2015-10-28 12:59:02 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapisink.c: + plugins: don't create display at caps query + Caps query can happen before the element has a bus. The display creation should + be should occur on the context negotiation, when the bus is already configured. + Then at caps query no display should be created. + Instead of force the display creation, we graciously fail the allowed_caps() + creation. + This change only applies for vaapidecode and vaapisink. The vaapipostroc, as a + basetransform descendant, seems to be not affected by this, nor the encoders. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=757598 + +2015-11-04 21:38:42 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + plugins: fix context query handling + The current context query handling design is flawed: the function + gst_vaapi_reply_to_query() returns FALSE either if the query is not a + GST_CONTEXT_QUERY of if the query could not be handled correctly. But the + pad query function should handle differently each case. + This patch changes the gst_vaapi_reply_to_query() for + gst_vaapi_handle_context_query() and changes it usage in all the vaapi plugins + to match the correct context query handling. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=757598 + +2015-11-04 20:37:05 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipluginutil.c: + plugin: don't lose previous context at query + When processing the GST_CONTEXT_QUERY we should not lose the previous + context in the query, we should only add our display structure. + This patch copies the old context, if it is there, and stamp our display on + it. Otherwise, a new context is created. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=757598 + +2015-11-04 20:29:03 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapivideocontext.c: + * gst/vaapi/gstvaapivideocontext.h: + vaapivideocontext: add gst_vaapi_video_context_set_display() + This function set the display to an already created context. This function is + going to be used later. + Also, gst_vaapi_video_context_new_with_display() now uses this function. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=757598 + +2015-10-30 12:27:16 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapivideocontext.c: + * gst/vaapi/gstvaapivideocontext.h: + plugins: check if display is set in sync + Since the context messages are sync'ed, the display assignation happens in the + same thread, hence we can know if the display was found or not as soon we call + for it. + In order to take advantage of it, gst_vaapi_video_context_prepare() receives, + as a new parameter, the address of the plugin's display, and reports back if + the display was found and set. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=757598 + +2015-10-30 12:33:48 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapivideocontext.c: + plugins: set display through context + Instead of setting the display to the plugin directly after its creation, do + it through the gstreamer's context mechanism, avoiding double assignations. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=757598 + +2015-11-02 18:20:07 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapivideocontext.c: + vaapivideocontext: rename context structure + The context structure is named "display" which is too generic. The contrary + happens, for example, with GstGL, what uses the same name as the context, and + its logs make more sense. + This patch renames the context structure with the same name as the + context, thus GST_PTR_FORMAT can pretty print it. + https://bugzilla.gnome.org/show_bug.cgi?id=757598 + +2015-11-04 19:02:34 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapivideocontext.c: + vaapivideocontext: refactor gst_vaapi_video_context_prepare() + First, refactorized run_context_query() into _gst_context_run_query(), adding + a new parameter: the pad direction, in order to simplify the code. + Second, added a new helper function: _gst_context_query(), which is a generic + context query function. It isolates the operation of running the query and + sets the context if found, also it enhances the logs. + _gst_context_query() is similar to the one used in GstGL. Perhaps, in the + future this helper function will be merged into the core libraries of + GStreamer. + Finally, gst_vaapi_video_context_prepare() was rewritten to use + _gst_context_query(). + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=757598 + +2015-10-30 11:18:47 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapivideocontext.c: + vaapivideocontext: refactor context category debug + Refactor the extraction GST_CAT_CONTEXT logging using a only once + initializator, so we could get the debug category from different code + paths, safely. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=757598 + +2015-10-23 11:17:01 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapivideocontext.c: + gstvaapivideocontext: fix indentation + gst-indent does not handle correctly some expression like function + declaration with attributes, breaking the following expressions. + This patch makes gst-indent to ignore the attributed function + declartion so the followed function definition is not mangled, such + as happened in commit b4154a + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=757598 + +2015-11-02 16:48:27 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipluginbase.c: + plugin: chain up set_context() vmethod + Since Gstreamer 1.7, set_context() vmethod needs to be chained up with + the parent class in order to broadcast all its contexts when the element + is added into a bin: + http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=d5ded1588920c4471eefe055d09095d9e5e989b5 + There is no need to guard the call, because before GStreamer 1.7, the + set_context() vmethod was NULL in the element class, hence the conditional + call make it safe. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=757598 + +2015-11-06 10:20:34 +0100 Víctor Manuel Jáquez Leal + + * tests/simple-encoder.c: + tests: simple-encoder: remove dead code + The caps creation for codec state configuration is not used. Let's remove it. + Signed-off-by: Víctor Manuel Jáquez Leal + +2015-11-02 19:05:07 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecodebin.c: + vaapidecodebin: fix a leaked display instance + The display returned by gst_vaapi_video_context_get_display() increments the + references. Thus, we have to unref the returned display. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=757595 + +2015-11-04 16:50:44 +0100 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapidisplay_glx.h: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + libs: remove unneeded headers + Since gstvaapidisplay_glx.h do not expose gl.h/glx.h structures, it is not + required to include them in the header. It is not also required to include + them in gstvaapidisplay_glx.c, since gstvaapiutils_glx.h includes them and + exposes their structures (e.g. GLXPixmap). + Nonetheless, glext.h neither glxext.h are required to include, they are + already included conditionally by gl.h and glx.h, respectively. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=757577 + +2015-11-06 19:18:54 +0200 Sreerenj Balachandran + + * ext/codecparsers: + codecparsers: Update to gst-vaapi-branch 0ea6792 + 0ea6792: codecparsers: vp9: Add header comments + 347ffc7: codecparsers: vp9: Use g_slice_free() for releasing memory allocated from the slice allocator + +2015-11-06 15:19:38 +0200 Sreerenj Balachandran + + * gst/vaapi/gstvaapidecode.c: + VP9: plugins: Add VP9 decoder + +2015-11-06 15:12:51 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidecoder_vp9.c: + * gst-libs/gst/vaapi/gstvaapidecoder_vp9.h: + VP9: libgstvaapi: Add VP9 decoder + +2015-11-06 14:57:00 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapiprofile.h: + VP9: gstvaapiprofile: Add profile definitions + +2015-11-06 14:39:22 +0200 Sreerenj Balachandran + + * configure.ac: + VP9: build: Check availability of vp9 decoder APIs + +2015-11-06 14:24:08 +0200 Sreerenj Balachandran + + * configure.ac: + * ext/Makefile.am: + * gst-libs/gst/codecparsers/Makefile.am: + VP9: Allow building vp9 codecparser internally + +2015-11-06 12:38:46 +0200 Sreerenj Balachandran + + * ext/codecparsers: + codecparsers: Update to gst-vaapi-branch commit ac5dc1a + ac5dc1a: codecparsers: vp9: Add vp9 codec parser + e7d9217: codecparser: h264: initialize parsing structures + 403d400: codecparser: h265: initialize parsing structures + +2015-11-04 15:37:34 +0100 Víctor Manuel Jáquez Leal + + * configure.ac: + configure.ac: don't use an undefined variable + If the environment lacks of gstreamer development packages, this error will + be reported to the user: "gstreamer- was not found" + This is because we are using an undefined variable in the printed message. The + fix simple changes the variable for the hard-coded string "1.0". + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=757283 + +2015-10-16 15:55:40 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: relax guards for memory:VASurface capsfeature + Though caps features are supported since GStreamer 1.2, there are some + issues with the features caps negotiation in that version. Nonetheless, + those issues are fixed in GStreamer 1.4. So, the memoy:VASurface caps + feature negotiation is relaxed for GStreamer 1.4. + The guard is the same as in vaapisink's caps template. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=756686 + +2015-10-15 18:18:36 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: decide allocation doesn't update srccaps + The received caps query will bring the already negotiated caps, so they are + not expected to change. + This patch removes this verification which is dead code path. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=756686 + +2015-10-14 20:30:30 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + vaapidecode: use caps to check the features + Instead of calling gst_vaapi_find_preferred_caps_feature(), which is + expensive, we check the caps from the allocation query, to check the + negotiated feature. + In order to do this verification a new utility function has been implemented: + gst_vaapi_caps_feature_contains(). + As this new function shared its logic with gst_caps_has_vaapi_surface(), both + have been refactorized. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=756686 + +2015-10-14 20:22:43 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: set format before decide allocation + There is a regression from commit 3d8e5e. It was expected the buffer pool + allocation occur before the caps negotiation, but it is not. + This patch fixes this regression: the caps negotiation is done regardless the + allocation query from downstream. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=756686 + +2015-10-16 20:21:50 +0800 Lim Siew Hoon + + * configure.ac: + build: check for patch and fix yasm check + Add configure checking for GNU patch tools and fixed configure + checking YASM to correct sequence. + Signed-off-by: Lim Siew Hoon + https://bugzilla.gnome.org/show_bug.cgi?id=756690 + +2015-10-15 19:20:21 +0300 Sreerenj Balachandran + + * ext/libvpx/Makefile.am: + build: Remove disable-md5 option for libvpx build + The configure option --disable-md5 was provided in libvpx-1.3.0 which + has been removed in 1.4.0. + +2015-10-15 19:00:26 +0300 Sreerenj Balachandran + + * ext/libvpx/upstream: + libvpx: Update the submodule to libvpx-1.4.0 + libvpx git commit: c74bf6d889992c3cabe017ec353ca85c323107cd + +2015-10-15 10:59:08 +0300 Sreerenj Balachandran + + * configure.ac: + configure: mark support for GStreamer 1.2 as obsolete. + Support for GStreamer 1.2 is obsolete. i.e. it is no longer supported. + Our goal is to support the last two stable versions of GStreamer which + are 1.4 and 1.6 at the moment. + We still keep the 1.2 specific codes until the next gstreamer-vaapi-0.7 + release and will get rid of those in 0.8. + +2015-10-12 14:13:03 +0300 Sreerenj Balachandran + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: Fix buffer copy assertion + Don't try to copy the NULL buffer-codec_data. + +2015-09-28 14:57:33 +0200 Víctor Manuel Jáquez Leal + + * configure.ac: + build: allow builds against GStreamer 1.7.x + Signed-off-by: Víctor Manuel Jáquez Leal + +2015-09-23 16:02:46 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstcompat.h: + gstcompat: add gst_buffer_copy_deep() if gst < 1.5 + gst_buffer_copy_deep() was added in GStreamer 1.5. If want to use it we should + add an implementation if gstreamer-vaapi is linked to previous versions. + Signed-off-by: Víctor Manuel Jáquez Leal + +2015-09-23 12:13:41 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: simplify copy of GstVideoCodecState + Signed-off-by: Víctor Manuel Jáquez Leal + +2015-09-14 19:21:08 +0200 Víctor Manuel Jáquez Leal + + * patches/videoparsers/0006-h265parse-fix-build-with-GStreamer-1.5.patch: + * patches/videoparsers/series.frag: + patches/videoparsers: h265parser: more API fences + Add more API fences according with its version and refresh the patch. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=754845 + +2015-09-14 19:19:56 +0200 Víctor Manuel Jáquez Leal + + * patches/videoparsers/0001-h265parse-include-gstvaapiparse.h.patch: + * patches/videoparsers/0005-h265parse-include-gstvaapiparse.h.patch: + * patches/videoparsers/series.frag: + patches/videoparsers: h265parser: rename patch keeping number + Refresh the patch and rename it in order to keep the patch number. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=754845 + +2015-09-14 19:18:33 +0200 Víctor Manuel Jáquez Leal + + * patches/videoparsers/0002-h264parse-fix-build-with-older-GStreamer-1.x-stacks.patch: + patches/videoparsers: h264parser: more API fences and refresh + Add more API fences according with its version and refresh the patch. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=754845 + +2015-09-14 19:16:51 +0200 Víctor Manuel Jáquez Leal + + * patches/videoparsers/0004-h264parse-Disable-3D-video-support-for-GStreamer-1.5.patch: + * patches/videoparsers/0004-h264parse-Disable-3D-video-support-for-GStremaer-1.5.patch: + * patches/videoparsers/series.frag: + patches/videoparsers: h264parser: fix description and refresh + Fix a typo in the patch description and refresh it in order to avoid the + creation of .orig files and break the distcheck target. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=754845 + +2015-09-14 19:15:18 +0200 Víctor Manuel Jáquez Leal + + * patches/videoparsers/0001-plugins-compile-the-built-in-video-parsers-as-vaapip.patch: + * patches/videoparsers/0003-h264parse-default-to-byte-stream-nalu-format-Annex-B.patch: + patches/videoparsers: h264parser: refresh patches + In order to avoid the creation of .orig files and break the distcheck target. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=754845 + +2015-09-15 16:53:31 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/Makefile.am: + build: link libgstvaapi_parse against codec parser + GST_CODEC_PARSER_* variables are defined if builtin codec parsers are disabled + when running configure. + Right now, libgstcodecparsers links only to libgstvaapi, but libgstvaapi_parse + need it if builtin codec parsers are disabled. + This patch adds GST_CODEC_PARSER_* variables to libgstvaapi_parse + compilation. If builtin codec parsers are enable, this variable is null, so it + should work using libgstvaapi, as normal. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=754845 + +2015-09-11 16:35:30 +0200 Víctor Manuel Jáquez Leal + + * configure.ac: + build: verify for H264 MVC and H265 SPS + Currently the H264 and H265 parsers look for MVC and SPS respectively, and + the required symbols for those were added in GStreamer 1.5 + If we try to compile in GStreamer < 1.4, without enabling the builtin codec + parsers, the compilation fails, because the lack of those symbols. + This patch verifies if the installed H264 and H265 parsers have those symbols. If + they do not, the specific built in codec parsers are enabled and used. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=754845 + +2015-09-11 16:49:16 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: initialize PPS's slice_group_id + When the GstVaapiParserInfoH264 is allocated, the memory is not initialized, + so it contains random data. + When gst_h264_parser_parse_pps() fails, the PPS structure keeps slice_group_id + pointer uninitialized, leading to a segmentation fault when the memory is + freed. + This patch prevents this by initializing the slice_group_id before the PPS + parsing. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=754845 + +2015-09-15 11:01:29 +0300 Mark Nauwelaerts + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: proper numerator and denominator for forced latency framerate + https://bugzilla.gnome.org/show_bug.cgi?id=755040 + +2015-09-11 20:51:42 +0300 Sreerenj Balachandran + + * ext/codecparsers: + codecparsers: Update to gst-vaapi-branch commit f9e284b + dae1a84: h264parse/h265parse: Fix negotiation crash + 45a9f8a: codecparsers: h265 : Fix default scaling list values + 28eaaf5: codecparsers: h265: Fix the selection of Active Ref Pic Set + Signed-off-by: Sreerenj Balachandran + +2015-09-04 22:19:55 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + decoder: hevc: Don't flush dpb for EOS/EOB nal + Explicit flushing of dpb for EOS and EOB nal decoding is wrong, + the dpb_add() itself will handle the flusing(if needed) of dpb + for end of sequence and end of bitstream. + https://bugzilla.gnome.org/show_bug.cgi?id=754010 + +2015-09-04 22:11:10 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + decoder: hevc: Fix the dpb_add() based on C.5.2.3 + Follow the spec as it is in C.5.2.3, add the decoded frame to dpb + just after the PicLatencyCnt setting of existing dpb frames. + https://bugzilla.gnome.org/show_bug.cgi?id=754010 + +2015-09-04 22:02:55 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + decoder: hevc: Fix the picture addition in dpb() based on spec H265 v3 (04/2015) + This fix is based on the V3 vesion of spec which was missing in older versions. + When the current picture has PicOutputFlag equal to 1, for each picture in the + DPB that is marked as "needed for output" and follows the current picture in output order, + the associated variable PicLatencyCount is set equal to PicLatencyCount + 1 (C.5.2.3). + https://bugzilla.gnome.org/show_bug.cgi?id=754010 + +2015-09-04 22:00:36 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + decoder: h265: Fix indentation + +2015-06-13 01:39:31 +1000 Jan Schmidt + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapipluginutil.c: + multiview: initial attempt at stereo/multiview support + Add support for marking caps and buffers for multiview or + stereoscopic output. + https://bugzilla.gnome.org/show_bug.cgi?id=750835 + +2015-08-28 17:12:12 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + decoder: hevc: remove unused functions + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=754250 + +2015-08-31 13:11:54 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: remove (another) unused variable + Signed-off-by: Víctor Manuel Jáquez Leal + +2015-08-28 17:10:40 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: remove unused variable + Thus silence the compilation warnings. + +2015-08-28 16:06:08 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: compilation fix + gst_vaapi_decoder_state_changed() returns void. This patch fixes the + compilation where the toolchain uses restrictive flags as clang. + Signed-off-by: Víctor Manuel Jáquez Leal + +2015-08-29 00:27:05 +0300 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: renegotiate if caps are not equal + The use of gst_caps_is_always_compatible() for this optimization may lead to + false positives. It is better to stick to gst_caps_is_strictly_equal() to know + if it is required a re-negotiation. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=750835 + +2015-08-29 00:18:57 +0300 Sreerenj Balachandran + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecode.h: + vaapidecode: Rework the re-negotiation code to handle multi resoultion videos + Delaying the pool re-negotiation untill we push all decoded (and queued) + frames downstream. Otherwise for the multi-resolution videos, the + GstVideoVideoMemory will be having wrong resolution and which leads + to nasty behaviours, especially when using software renderers. + sample media file: RAP_B_Bossen_1.bin + case explained: + The first SPS Nal will report resoultion of 448x256 and having crop rectangles to + get the final resoultion 416x240. + Starting from 25 th frame, the resolution will change to 416x240. But parser + elements won't report this since the effective croped resolution is same in + both cases. Here the core libgstvaapi will detect this through it's internal + parsing and do all context/pool destory/reset stuffs. Also it will notify this + change to plugins in advance. But if the plugin try to do re-negotiaion of pool + immediately, this will not sync with the resolution of already decoded and queued + frames and which will lead to failure in gst_video_frame_map() in downstream(if we use the + software renderer). So we have to delay the pool renegotiation in vaapidecode, + untill we push all decoded frames downstream. + https://bugzilla.gnome.org/show_bug.cgi?id=753914 + +2015-08-28 23:43:47 +0300 Sreerenj Balachandran + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: Always keep a copy of input codec state + Currently we are sharing the input GstVideoCodecState with + GstVaapiDecoder(gst-libs/gst/vaapi) by just doing ref and unref for + each caps change. This is troublesome in many cases, for eg: if + resoultion changes with in a singe stream. Because, when ever there + is a resolution change, GstVideoDecoder will first change the Codec_state->caps + fields with new resolution, but since we are using the same codecstate (ref) + in gstvaapidecode.c, the caps check for input caps change will always fail. + https://bugzilla.gnome.org/show_bug.cgi?id=753914 + +2015-08-26 07:25:03 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + decoder: hevc: Fix the scaling list scan order + The default scan order of scaling lists are up-right-diagonal + as per hevc specification. Use the newly implemented + uprightdiagonal_to_raster conversion codecparser APIs to + get the the scaling_list values in raster order, which is + what the VA intel driver requires. + +2015-08-26 07:20:09 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + decoder: hevc: sync with the codecparser changes + The Tile Scanning Conversion process (spec 6-3 and 6-4) is implemented + in codecparsers now. Remove the duplication from gstvaapidecoder_h265 + +2015-08-26 07:04:22 +0300 Sreerenj Balachandran + + * patches/videoparsers/0002-h264parse-fix-build-with-older-GStreamer-1.x-stacks.patch: + patches/Videoparsers: update patch to fix build with older GStreamer 1.2 stacks + +2015-08-26 06:57:36 +0300 Sreerenj Balachandran + + * ext/codecparsers: + codecparsers: Update to gst-vaapi-branch commit 69550f1 + c207c6d: codecparsers: h265: Fix tile row and column parsing + 47074c5: codecparsers: h265: Add APIs for up-right-diagonal/raster scan conversion + cd28b18: codecparsers: h265: Fix the range of delta_chroma_log2_weight_denom + 1746bbe: videoparsers: Use gst_base_parse_merge_tags() + 2f0932b: h264parse: Clear SPS info after processing + f57d6b0: videoparsers: enable accept-template flag + +2015-08-25 15:38:42 +0000 Víctor Manuel Jáquez Leal + + * debian.upstream/control.in: + debian: add yasm as build dependency + As the compilation of libvpx (for vp8 parser) is enabled by default, + yasm is required by default too. + Signed-off-by: Víctor Manuel Jáquez Leal + +2015-08-14 19:21:04 +0800 Lim Siew Hoon + + * debian.upstream/rules: + debian: remove --with-gstreamer-api option + It is no longer valid in gstreamer-vaapi. + Signed-off-by: Lim Siew Hoon + [removed unused GST_API_VERSION variable] + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=753618 + +2015-08-24 19:22:14 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: rename is_cancelled to sync_failed + Since commit 065a18a3, the semantics of the variable is_cancelled did not make + sense. This commit renames this variable to sync_failed. + +2015-08-13 15:12:44 -0400 Olivier Crete + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: Don't return GST_FLOW_ERROR on flushing + Setting the sink to flushing causes gst_vaapi_window_wayland_sync() to + return FALSE which makes gst_vaapi_window_wayland_render() return + FALSE which ends up posting an ERROR message in + gst_vaapisink_show_frame_unlocked(). Solution is to just return TRUE + in the EBUSY case. + https://bugzilla.gnome.org/show_bug.cgi?id=753598 + +2015-08-06 12:28:51 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapi.c: + Revert "Marking rank of vaapidecodebin as GST_RANK_MARGINAL for now." + This reverts commit 3ccb198b513dc6ad287fe44117d03bec4d6a966a. + +2015-07-06 20:22:57 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecodebin.c: + vaapidecodebin: check for postproc instance + If the VPP's deinterlace-method is set, first we should check if the postproc + is already instanced to set it. Otherwise we just store it until the VPP is + added into the bin. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=749554 + +2015-08-06 18:48:13 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecodebin.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + vaapidecodebin: ensure VPP before going to READY + There are sometimes that the VA-API display context is not shared among the + pipeline, but it is important to know it before going to READY state (when the + pipeline is already linked). + One instance of this case is this: + gst-launch-1.0 filesrc location=media ! decodebin ! vaapipostproc ! vaapisink + This patch adds a new function in gstvaapipluginutil called + gst_vaapi_create_test_display(). Its purpose is to create a disposable VA-API + display, which only will be used for verify if the VAEntrypointVideoProc is + available by the hardware. Afterwards, it should be unrefed. + If the vaapidecodebin is going to READY state, and the element still doesn't + know if VPP is available, the last resort is to create a new instance of the + VA-API display and test for it. + https://bugzilla.gnome.org/show_bug.cgi?id=749554 + +2015-08-06 12:39:52 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecodebin.c: + vaapidecodebin: post an error message if fails + If the construction of the bin fails, post an error message in the bus. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=749554 + +2015-08-06 12:36:07 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecodebin.c: + * gst/vaapi/gstvaapidecodebin.h: + vaapidecodebin: has_vpp as a tri-state variable + has_vpp can be UNKNOWN while the context message hasn't being received. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=749554 + +2015-08-03 16:33:02 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapivideomemory.c: + gstvaapivideomemory: native format with no derived image + If USE_NATIVE_FORMATS is defined we bail out before configuring the surface + info based on the derived image configuration. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=744042 + +2015-07-23 20:07:59 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/video-format.c: + * gst-libs/gst/vaapi/video-format.h: + * gst/vaapi/gstvaapivideomemory.c: + surface pool config based on video info + First added the function gst_vaapi_video_format_get_best_native(), which + returns the best native format that matches a particular chroma type: + YUV 4:2:0 -> NV12, YUV 4:2:2 -> YUY2, YUV 4:0:0 -> Y800 + RGB32 chroma and encoded format map to NV12 too. + That format is used to configure, initially, the surface's pool for the + allocator. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=744042 + +2015-07-23 16:03:43 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapivideomemory.c: + gstvaapivideomemory: refactor gst_vaapi_video_allocator_new() + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=744042 + +2015-06-19 15:51:07 +0200 Victor Jaquez + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + gstvaapiencoder: validate chroma according to the VA's RT format + Before, only YUV420 color space where supported. With this patch, the + encoder is queried to know the supported formats and admits YUV422 + color space if its available. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=744042 + +2015-08-13 05:07:52 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + decoder: hevc: Add calculation of WpOffsetHalfRangeC + This is necessary for finding ChromaOffsetL0/ChromaOffsetL1 + prediction weight table values with out using any hard coding. + Fixme: We don't have parser API for sps_range_extension, so + assumed zero value for high_precision_offsets_enabled_flag. + Signed-off-by: Sreerenj Balachandran + +2015-08-13 04:09:44 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + decoder: hevc: Fix ChromaOffsetL0/ChromaOffsetL1 calculation + Based on ITU-T rec H265(4/2015): 7-56 + This was a wrong equation in rec H265 (4/2013): 7-44... + Signed-off-by: Sreerenj Balachandran + +2015-08-13 04:08:03 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + decoder: hevc: Fix default value assignment of pred_weight_table + +2015-08-13 03:48:43 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + decoder: hevc: Fix the value assigning for delta_chroma_log2_weight_denom + Assign only if ChromaArrayType != 0.. + Signed-off-by: Sreerenj Balachandran + +2015-08-13 03:06:32 +0300 Sreerenj Balachandran + + * ext/codecparsers: + codecparsers: Update to gst-vaapi-branch commit 1c70432 + 8e98b41: codecparsers: h265: Fix the range of delta_chroma_log2_weight_denom + 839c5bc: codecparsers: h265: Fix the parsing of ref_pic_lists_modification + Signed-off-by: Sreerenj Balachandran + +2015-08-11 08:09:10 +0300 Sreerenj Balachandran + + * ext/codecparsers: + codecparsers: Update to gst-vaapi-branch commit c18b8ad + 8a03e67: videoparsers: h265: Avoid skipping of EOS and EOB nals + a033083: videoparsers: h265: Fix the frame start detection code + Signed-off-by: Sreerenj Balachandran + +2015-08-10 05:50:50 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + decoder: hevc: Add SEI parsing + Signed-off-by: Sreerenj Balachandran + +2015-08-07 08:43:44 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + decoder: hevc: Workaround to recognize wrongly encoded main profile streams + HACK: This is a work-around to identify some main profile streams having wrong profile_idc. + There are some wrongly encoded main profile streams(eg: ENTP_C_LG_3.bin) which doesn't + have any of the profile_idc values mentioned in Annex-A, instead general_profile_idc + has been set as zero and having general_profile_compatibility_flag[general_profile_idc] + is TRUE. Assuming them as MAIN profile for now. + https://bugzilla.gnome.org/show_bug.cgi?id=753226 + Signed-off-by: Sreerenj Balachandran + +2015-08-07 08:41:57 +0300 Sreerenj Balachandran + + * patches/videoparsers/0002-h264parse-fix-build-with-older-GStreamer-1.x-stacks.patch: + patches/videoparsers: Fix the wrong source file path + This is something wrongly typed in commit 6d7b631 + +2015-08-07 08:34:55 +0300 Sreerenj Balachandran + + * ext/codecparsers: + codecparsers: Update to gst-vaapi-branch commit b8d8be4 + ee7e81b: h264parse: Don't discard first AU delimiter + 3690fb9: h264parse: Add more NAL types for debugging output + 108d368: h265parse: Avoid checking for Non Mandatory VPS NAL + ace61048: h265parse: expose compatible profiles to downstream + Signed-off-by: Sreerenj Balachandran + +2015-08-06 13:07:53 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapivideocontext.c: + * gst/vaapi/gstvaapivideocontext.h: + gstvaapivideocontext: remove unused parameter + gst_vaapi_video_context_prepare() received an unused parameter. This patch + removes it and the structure passed by the caller. + This a left over of "Removal of gstreamer-1.0 support" (commit 8b36e25f). + Signed-off-by: Víctor Manuel Jáquez Leal + +2015-08-06 04:01:24 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + decoder: hevc: Fix decoding of stream when it has temporal sublayers + We are calculating the dpb size based on max_dec_pic_buffering. + But if there are more than one temporal sublayers, we are supposed + to use the max_dec_pic_buffering[max_sub_layers_minus] for dpb + size calculation (Assuming HighestTid as max_sub_layers_minus). + Sample streams: TSCL_A_VIDYO_5.bin, TSCL_B_VIDYO_4.bin + https://bugzilla.gnome.org/show_bug.cgi?id=753226 + Signed-off-by: Sreerenj Balachandran + +2015-08-05 14:11:12 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecodebin.c: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_h265.c: + * gst/vaapi/gstvaapiencode_jpeg.c: + * gst/vaapi/gstvaapiencode_mpeg2.c: + * gst/vaapi/gstvaapiencode_vp8.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + refactor vaapi caps strings for pad templates + Refactor the main vaapi caps strings into three macros: + GST_VAAPI_MAKE_SURFACE_CAPS, GST_VAAPI_MAKE_ENC_SURFACE_CAPS and + GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS. + Those are in gstvaapipluginutil.h so all the elements could use them, instead + of re-declaring them every time. + No functional changes. + Signed-off-by: Víctor Manuel Jáquez Leal + +2015-08-05 14:15:07 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipostproc.c: + gstvaapipostproc: fix code style + Signed-off-by: Víctor Manuel Jáquez Leal + +2015-08-05 05:23:20 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + decoder: hevc: Fix the decoding of dependent slice segment + Decoding process for reference picture list construction needs to be + invoked only for P and B slice and the value for slice_type of dependent slice + segment should be taken from the previous independent slice segment header + of the same pic. + https://bugzilla.gnome.org/show_bug.cgi?id=753226 + Signed-off-by: Sreerenj Balachandran + +2015-06-22 17:38:41 +0200 Victor Jaquez + + * gst/vaapi/gstvaapipluginbase.c: + plugins: reduce the noise of warnings + Those messagse should be attached to the object, also the lack of + caps is not an error, in particular in the case of JPEG encoding. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=744042 + +2015-06-23 17:49:51 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapicontext.c: + gstvaapicontext: fix the JPEG encoder attribs value + When we query for the VAConfigAttribEncJPEG, we get a value which packs the + VAConfigAttribValEncJPEG structure, but we did not assign it. This patch + assigns the returned value to the attribute. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=744042 + +2015-06-18 17:37:46 +0200 Victor Jaquez + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + gstvaapiencoder: framerate 0/1 is valid too + Framerate 0/1 is valid, and it is particularly useful for picture + encoding, such as jpeg. This patch makes the encoder to admit that + framerate. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=744042 + +2015-07-03 09:35:16 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipostproc.c: + vaapipostroc: GLTextureUploadMeta in sink template + Advertise GLTextureUploadMeta in sink caps template. + https://bugzilla.gnome.org/show_bug.cgi?id=752130 + +2015-07-23 13:11:40 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginbase.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiuploader.c: + * gst/vaapi/gstvaapiuploader.h: + remove gstvaapiuploader + Working on bug #744042 I realized that the gstvaapiuploader is practically not + used. + This patch removes the gstvaapiuploader and add the method + gst_vaapi_plugin_base_get_allowed_raw_caps () that returns the raw caps that + the system can handle, which is used by vaapisink and vaapipostproc. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=752777 + +2015-07-27 18:49:13 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: don't lost GLTextureUpload on seek + When seeking, the decoder is reset, but the buffer pool is not + re-negotiated, but in reset_full() the code forgets if the negotiated buffer + pool has the GLTextureUpload meta. + The decoder knows that GLTextureUpload meta was negotiated in + decide_allocation(), but this method is not called when seeking. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=752929 + +2015-07-21 18:45:56 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipluginutil.c: + plugins: don't use gst_pad_get_allowed_caps() + gst_pad_get_allowed_caps() query the pad and the peer pad. In the case + decoders, that is OK, but in the case of the postproc might lead loops, + since the gst_base_transform_query_caps() forwards the query upstream + and forth. + Instead of gst_pad_get_allowed_caps() we only query the peer with + gst_pad_peer_query_caps() using the pad's template as filter. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=752558 + +2015-07-22 12:40:19 +0300 Sreerenj Balachandran + + * README: + README: updates + +2015-07-22 09:45:26 +0300 Sreerenj Balachandran + + * patches/videoparsers/0004-h264parse-Disable-3D-video-support-for-GStremaer-1.5.patch: + * patches/videoparsers/series.frag: + patches/videoparsers: h264parse: Disable 3D video support for GStremaer < 1.5 + All API/ABI changes for S3D/MVC are added in 1.5, backporting + them to older verison is not recommended. + Signed-off-by: Sreerenj Balachandran + +2015-07-22 09:41:34 +0300 Sreerenj Balachandran + + * patches/videoparsers/0002-h264parse-fix-build-with-older-GStreamer-1.x-stacks.patch: + patches/Videoparsers: update patch to fix build with older GStreamer 1.2 stacks + +2015-07-22 09:38:42 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + decoder: jpeg: Align with new API/ABI changes in codecparser + Signed-off-by: Sreerenj Balachandran + +2015-07-22 09:31:02 +0300 Sreerenj Balachandran + + * ext/codecparsers: + codecparsers: Update to gst-vaapi-branch commit 800bdb2 + ed13220: mpegvideometa: add meta transform function + 18d5efd: codecparsers: jpeg: add some padding to ScanHdr struct + 7a51722: codecparsers: jpeg: fix docs for table parsing functions + 06b8ded: codecparsers: jpeg: fix validity checking of data parsed + 387a39d: codecparsers: jpeg: fix up API + db9d6a9: codecparsers: jpeg: tweak API a little + bb6951e: codecparsers: jpeg: hide gst_jpeg_scan_for_marker_code() + f33c30c: codecparsers: jpeg: fix and optimize scan for next marker code + 4658c30: codecparsers: jpeg: fix calculation of segment size + 759bcb9: codecparsers: jpeg: fix default Huffman tables generation + b4811ee: codecparsers: jpeg: add JPEG bitstream parser + 9422464: h264parse: fix typo in log message + 9e793a0: h264parse: Move PAR calcs, and use them for stereoscopic half-aspect + 77704ce: nalutils: trivial patch to check if + 8bb9249: codecparsers: mpeg4: actually return full number of bits of resync marker + 7862f95: Revert "codecparsers: remove ignored increment of return" + 54017b1: h264parse: Add support for passing stereoscopic/multiview info + 8667ee4: h264parse: Don't switch to passthrough on set_caps() + Signed-off-by: Sreerenj Balachandran + +2015-06-29 14:27:56 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: track previous reference frames. + Improve closure of gaps in frame_num by strictly following and trying + to fill them with previous reference frames. So, they are now tracked + thus avoiding insertion of dummy ("greenish") frames. + +2015-06-29 13:16:09 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix integration of second field into the DPB. + If the new picture to be added to the DPB is not a first field, then + it shall be the second field of the previous picture that was added + before. + This removes the need for dpb_find_picture() now that we track the + immediately preceding decoded picture, in decode order. + +2015-07-06 14:38:26 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix closure of "other-field" gap. + When a dummy "other-field" is inserted, it is assumed to inherit the + reference flags from the first field, and the sliding window decoded + reference picture marking process is also executed so that corrupted + frames are moved out as early as possible. + While doing so, we also try to output frames that now contain a single + valid field picture, prior to inserting any other picture into the DPB. + Note: this may be superfluous currently based on the fact that dpb_add() + combines the two most recent pairable fields, but this process would be + further simplified later on. + +2015-06-24 13:58:17 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: track corrupted frames. + Mark the picture as "corrupted" if it is reconstructed from corrupted + references or if those references are fake, e.g. resulting from lost + frames. + This is useful for notifying the upper layer, or downstream elements, + that the decoded frame may contain artefacts. + https://bugzilla.gnome.org/show_bug.cgi?id=703921 + +2015-06-24 13:48:46 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + * gst/vaapi/gstvaapidecode.c: + decoder: add initial infrastructure for marking corrupted output. + Add initial infrastructure in core codec library and vaapidecode to mark + corrupted frames as such. A corrupted frame is such a frame that was + reconstructed from invalid references for instance. + https://bugzilla.gnome.org/show_bug.cgi?id=751434 + Signed-off-by: Gwenole Beauchesne + +2015-07-15 18:18:49 +0300 Sreerenj Balachandran + + * configure.ac: + Bump version for development + +=== release 0.6.0 === + +2015-07-15 15:49:38 +0300 Sreerenj Balachandran + + * configure.ac: + 0.6.0 + +2015-07-15 15:49:19 +0300 Sreerenj Balachandran + + * NEWS: + NEWS: updates + +2015-07-14 19:39:20 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + vaapidecoder: no wmv profiles gstreamer 1.4/1.2 + This patch fix the auto-plugging problem in gstreamer 1.2 and gstreamer 1.4 + Right now there is not a primary ranked parser for vc1 and the demuxers + delivers caps without specifying the profile. This situation is not an issue + for avdec_vc1 but for vaapidecode it is, which refuses to negotiate without a + explicit profile defined in the negotiated caps. + Nonetheless, in gstreamer 1.5 it seems not to be a problem since the + negotiation admits caps subsets try outs. + This patch solves the issue ignoring the profile negotiation in the caps. For + gstreamer < 1.5 the profile string is not handled, so the auto-plugging get + done without the vc1 parser, such as happens in gstreamer 1.5. + Signed-off-by: Víctor Manuel Jáquez Leal + +2015-07-07 20:57:20 +0300 Sreerenj Balachandran + + * gst/vaapi/gstvaapi.c: + Marking rank of vaapidecodebin as GST_RANK_MARGINAL for now. + Unfortunately vaapidecodebin element is not seems to be stable + enough for autoplugging ahead of vaapidecode. + Lowering the rank for now (cosidering the immediate 0.6 release). + See this: https://bugzilla.gnome.org/show_bug.cgi?id=749554 + Signed-off-by: Sreerenj Balachandran + +2015-07-07 13:32:18 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/Makefile.am: + build: Add missing CFLAGS to Makefile.am + +2015-07-03 15:07:02 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapifilter.c: + gstvaapifilter: Only register STE property if it supported by corresponding VA library + Fix the regression introduced in commit eb465fb. + VAProcFilterSkinToneEnhancement is avaialbe from VA >= 0.36. + Signed-off-by: Sreerenj Balachandran + +2015-07-02 17:49:25 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: no format convert on GL tex upload meta + When GL texture upload meta is negotiated, vaapipostproc shall not modify the + color format of the buffer. + https://bugzilla.gnome.org/show_bug.cgi?id=748184 + +2015-07-03 12:42:09 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapifilter.c: + gstvaapifilter: Add guard for VAProcFilterSkinToneEnhancement + VAProcFilterSkinToneEnhancement is avaialbe from VA >= 0.36. + Signed-off-by: Sreerenj Balachandran + +2015-07-02 21:57:38 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_h265.c: + encoder:h265: Fix the check for packed-header support + Use VA_ENC_PACKED_HEADER_* definition for checking. + Signed-off-by: Sreerenj Balachandran + +2015-07-02 21:37:56 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder:h264: Fix the check for packed-header support + Use VA_ENC_PACKED_HEADER_* definition for checking. + Signed-off-by: Sreerenj Balachandran + +2015-07-02 21:00:14 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: submit SEI buffering_period() and picture_timing() messages for CBR mode + One buffering_period() SEI message shall be present in every IDR access unit + when NalHrdBpPresentFlag is inferred to be equal to 1. This is the case when we + use a non-CQP mode, e.g. CBR. In other words, when + nal_hrd_parameters_present_flag is set to 1. + One picture_timing() SEI messages shall be present in every access unit + if CpbDpbDelaysPresentFlag is equal to 1 or pic_struct_present_flag is equal to 1 + https://bugzilla.gnome.org/show_bug.cgi?id=722734 + https://bugzilla.gnome.org/show_bug.cgi?id=751831 + Signed-off-by: Sreerenj Balachandran + +2015-07-01 14:16:50 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecodebin.c: + vaapidecodebin: notify if vpp is disabled + When the system is aware that VPP is not available by the VA driver, + it would be useful to notify to the user that the disable-vpp property + has changed. + https://bugzilla.gnome.org/show_bug.cgi?id=749554 + +2015-07-01 14:17:17 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecodebin.c: + * gst/vaapi/gstvaapidecodebin.h: + vaapidecodebin: enable vpp if it is available + Instead of creating and adding VPP into the bin at setup, we wait until + we are sure the VA driver supports it. We know that when the VA video + context is received by the bin. Afterwards, it is decided to instanciate + and link the VPP or not. + This is more efficient and safer than waiting the VPP to fail and then + disable it. + https://bugzilla.gnome.org/show_bug.cgi?id=749554 + +2015-07-02 12:29:32 +0300 Sreerenj Balachandran + + * tests/test-display.c: + * tests/test-windows.c: + tests: Fix compilation while enabling egl as the only renderer in build + Include missing header files gstvaapidisplay_egl.h and gstvaapiwindow_egl.h. + +2015-07-02 10:45:50 +0300 Sreerenj Balachandran + + * configure.ac: + configure: fix the build while enabling egl as the only renderer + +2015-07-02 10:25:25 +0300 Sreerenj Balachandran + + * configure.ac: + libs: Bump library major version + +2015-06-30 09:44:18 +0300 Sreerenj Balachandran + + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapidecodebin.c: + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode_jpeg.c: + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapivideobufferpool.c: + * gst/vaapi/gstvaapivideocontext.c: + * gst/vaapi/gstvaapivideomemory.c: + * gst/vaapi/gstvaapivideometa.c: + gst/vaapi: Switch to upstreram like indentation. + gst-indent for all gst/vaapi/*.c source files + +2015-06-30 09:35:37 +0300 Sreerenj Balachandran + + * gst/vaapi/gstvaapidecodebin.c: + * gst/vaapi/gstvaapidecodebin.h: + vaapidecodebin: Add property to disable VPP + Adding a new propery "disable-vpp", enabling it will prevent + the insertion of vaapipostproc child element. + This is helpful in debugging, specifically to narrow-down the + vaapidecodebin/vaapipostproc related negotiation issues. + No support for run-time disabling for now. + https://bugzilla.gnome.org/show_bug.cgi?id=745901 + +2015-06-29 13:35:59 +0300 Sreerenj Balachandran + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: Fix wrong selection of passthrough mode. + The Current code path is falling back to passthorugh mode if there is no + vpp property set by the user explictily. But we should not use the + passthrough mode if the negotiated src pad caps have a differnt color space + format than sink pad caps (Even though the user didn't set the format property + explicitly). + https://bugzilla.gnome.org/show_bug.cgi?id=748184 + Signed-off-by: Sreerenj Balachandran + +2015-06-29 13:20:28 +0300 Sreerenj Balachandran + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: prevent advanced-deinterlacing of non-native video formats. + This is a workaround to deal with the va-intel-driver for non-native + formats while doing advanced deinterlacing. The format of reference surfaces must + be same as the format used by the driver internally for motion adaptive + deinterlacing and motion compensated deinterlacing. + A permanent solution could be to do the color space conversion internally + for reference surfaces. + https://bugzilla.gnome.org/show_bug.cgi?id=730925 + Signed-off-by: Sreerenj Balachandran + +2015-06-29 13:06:30 +0300 Simon Farnsworth + + * gst/vaapi/gstvaapisink.c: + Work around ABBA deadlock between vaapisink and vaapipostproc + vaapisink takes the display lock, then does a gst_buffer_replace which can + take the lock on the gst_vaapi_video_pool. + vaapipostproc asks the gst_vaapi_video_pool for a new surface. This takes + the lock on the gst_vaapi_video_pool; if you're unlucky, there are no free + surfaces, which means that gst_vaapi_surface_create is + called. gst_vaapi_surface_create takes the display lock. + If vaapisink and vaapipostproc are in different threads, and this happens, + you get a deadlock. vaapisink holds the display lock, and wants the + gst_vaapi_video_pool lock. vaapipostproc holds the gst_vaapi_video_pool lock + and wants the display lock. + Work around this by releasing the display lock in vaapisink around the + gst_buffer_replace. + https://bugzilla.gnome.org/show_bug.cgi?id=738249 + Signed-off-by: Simon Farnsworth + Signed-off-by: Sreerenj Balachandran + +2015-04-29 16:34:07 +0200 Jacobo Aragunde Pérez + + * gst/vaapi/gstvaapidecodebin.c: + * gst/vaapi/gstvaapidecodebin.h: + vaapidecodebin: expose deinterlace-method property from inner vaapipostproc + https://bugzilla.gnome.org/show_bug.cgi?id=745901 + +2015-05-19 11:24:10 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: log negotiated caps + +2015-05-18 14:30:22 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: remove useless debug message + +2015-02-12 12:31:57 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: log negotiated src/sink caps + +2015-05-07 15:57:26 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapisink.c: + vaapisink: error handling if rendering fails + This patch enhance the code path when an error is found when rendering a + buffer. + If the video meta doesn't contain a surface proxy or a surface, a warning + message is printed. + If the rendering backend fails, a error message is posted in the bus. + https://bugzilla.gnome.org/show_bug.cgi?id=749382 + +2015-06-18 14:55:12 +0300 Sreerenj Balachandran + + * gst/vaapi/gstvaapisink.c: + vaapisink: Fix the conditional pad template creation. + +2015-06-18 13:19:26 +0300 Sreerenj Balachandran + + * tests/Makefile.am: + build: Don't build simple-encoder test program if there is no VA Encoding support + This will fix the build error against older VA-APIs <= 0.32 + +2015-06-18 12:20:37 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapibufferproxy.c: + * gst-libs/gst/vaapi/gstvaapicompat.h: + Fix build error for older VA-API versions + Provide guards for VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM and + VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME which are only availble from + VA >= 0.36. + +2015-06-17 14:20:37 +0300 Sreerenj Balachandran + + * gst/vaapi/gstvaapisink.c: + vaapisink: Fix the capsfeature advertisement in padtemplate + This fixes the regression introduced in 64acc74. + If a pad supports multiple set of capsfeatures, it needs to add + multiple equal structures with different feature sets to the caps. + Because caps structures with the same name but with a non-equal + set of caps features are not compatible. + Without this patch, playbin will autoplug xvimagesink instead of vaapisink. + https://bugzilla.gnome.org/show_bug.cgi?id=750095 + +2015-06-17 12:41:28 +0300 Adrian Cox + + * gst/vaapi/gstvaapisink.c: + vaapisink: Expose the overlay capability for compatibility with dvbsuboverlay. + https://bugzilla.gnome.org/show_bug.cgi?id=750095 + Signed-off-by: Sreerenj Balachandran + Signed-off-by: Gwenole Beauchesne + +2015-06-17 09:53:29 +0300 Olivier Crete + + * gst/vaapi/gstvaapipluginbase.c: + vaapipluginbase: Override downstream allocation reply if no pool + If the downstream replied without a pool, then override it. + https://bugzilla.gnome.org/show_bug.cgi?id=748559 + +2015-06-09 15:15:31 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + vaapipostproc: add color balance interface + https://bugzilla.gnome.org/show_bug.cgi?id=720376 + +2015-05-22 18:13:25 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst-libs/gst/vaapi/gstvaapifilter.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + vaapipostproc: add skin tone enhancement + Added the 'skin-tone-enhancement' property to vaapostproc. + https://bugzilla.gnome.org/show_bug.cgi?id=744088 + +2015-05-20 18:02:37 +0200 Víctor Manuel Jáquez Leal + + * docs/reference/libs/libs-docs.xml.in: + doc: add VA-API reference in freedesktop + +2015-06-04 19:03:44 +0200 Víctor Manuel Jáquez Leal + + * patches/videoparsers/0001-plugins-compile-the-built-in-video-parsers-as-vaapip.patch: + * patches/videoparsers/0002-h264parse-fix-build-with-older-GStreamer-1.x-stacks.patch: + * patches/videoparsers/0003-h264parse-default-to-byte-stream-nalu-format-Annex-B.patch: + patches/videoparsers: rebase all the h264parse patches + In order to avoid the creation of .orig files and break the distcheck target + +2015-06-04 18:29:15 +0200 Víctor Manuel Jáquez Leal + + * ext/libvpx/Makefile.am: + build: don't build in parallel libvpx + This fixes the distcheck -j XX target. + +2015-06-02 08:52:53 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_jpeg.c: + encoder: jpeg: Fix the packed header generation + This is a work-around to satisfy the va-intel-driver. + Normalize the quality factor and scale QM values (only for packed header + generation) similar to what VA-Intel driver is doing . Otherwise the + generated packed headers will be wrong, since the driver itself is + scaling the QM values using the normalized quality factor. + https://bugzilla.gnome.org/show_bug.cgi?id=748335 + Signed-off-by: Sreerenj Balachandran + +2015-06-02 11:46:00 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix uninitialized variables in avcC mode. + Fix uninitialized variables when decoding SPS and PPS NAL units from + "codec-data" buffers. This is particularly important when seeking ops + are involved, and the new persistent states are used more often. + https://bugzilla.gnome.org/show_bug.cgi?id=750094 + +2015-06-01 18:39:18 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: remove unneeded casting + And a code-style fix + +2015-05-21 19:38:33 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: calculate decoding latency + This is a naïve approach to the calculation of the VA-API decoding latency. It + takes into consideration when the frame-rate has some insane value. + https://bugzilla.gnome.org/show_bug.cgi?id=740419 + +2015-05-21 23:16:14 +1000 Jan Schmidt + + * configure.ac: + configure: Compiling against libgstgl requires libgstvideo + Fix detection of the GstGL helper headers in uninstalled + builds. + +2015-05-28 10:52:48 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_h265.c: + encoder: hevc: Fix the size over-flow for encoded buffer. + The approximation of 6 times compression ratio migh not + work in all cases. Especially when enabling I frames. + Provide large enough size for coded-buffer creation. + +2015-05-28 10:43:20 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_vp8.c: + encoder: vp8: Fix the size over-flow for encoded buffer. + The approximation of 4 times compression ratio will not + work in all cases. Especially when enabling I frames. + Provide large enough size for coded-buffer creation. + +2015-05-28 05:43:49 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_h265.c: + encoder: hevc: fix bug in multi slice encoding. + This is a work-around for satisfying the VA-Intel driver. + The driver only support slices begin from CTU row start address. + Multi-Slice encoding also requires a fix in va-intel-driver: + http://lists.freedesktop.org/archives/libva/2015-May/003351.html + https://bugzilla.gnome.org/show_bug.cgi?id=749854 + Signed-off-by: Sreerenj Balachandran + +2015-03-12 22:57:22 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: add initial support for loss of pictures. + Implement decoding process for gaps in frame_num (8.5.2). This + also somewhat supports unintentional loss of pictures. + https://bugzilla.gnome.org/show_bug.cgi?id=745048 + https://bugzilla.gnome.org/show_bug.cgi?id=703921 + Original-patch-by: Wind Yuan + [fixed derivation of POC, ensured clone is valid for reference, + actually fixed detection of gaps in FrameNum by PrevRefFrameNum] + Signed-off-by: Gwenole Beauchesne + +2015-05-22 11:42:52 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: add support for missing first field. + Try to identify missing first fields too, thus disregarding any + intermediate gaps in frames. We also assume that we keep the same + field sequence, i.e. if previous frames were in top-field-first + (TFF) order, then so are subsequent frames. + Note that insertion of dummy first fields need to operate in two + steps: (i) create the original first field that the current field + will inherit from, and (ii) submit that field into the DPB prior + to initializing the current (other) field POC values but after any + reference flag was set. i.e. copy reference flags from the child + (other field) to the parent (first field). + https://bugzilla.gnome.org/show_bug.cgi?id=745048 + +2015-05-07 14:00:58 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: add support for missing second field. + Interlaced H.264 video frames always have two fields to decode and + display. However, in some cases, e.g. packet loss, one of the field + can be missing. This perturbs the reference picture marking process, + whereby the number of references available in DPB no longer matches + the expected value. + This patch adds initial support for missing field within a decoded + frame. The current strategy taken is to find out the nearest field, + by POC value, and with the same parity. + https://bugzilla.gnome.org/show_bug.cgi?id=745048 + +2015-05-22 17:06:11 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: improve tracking of "top-field-first" flag. + Try to maintain a "top-field-first" (TFF) flag, even if the H.264 standard + does not mandate it. This will be useful for tracking missing fields, and + also for more correct _split_fields() implementation for frames in the DPB. + +2015-05-05 11:56:11 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: skip all pictures prior the first I-frame. + Don't try to decode pictures until the first I-frame is received within + the currently active sequence. There is no point is decoding and then + displaying frames with artifacts. + +2015-05-12 15:36:10 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix processing of EOSEQ NAL. + Fix decoding of end_of_seq() NAL unit so that to not submit the current + picture for decoding again. This is pretty vintage code that dates back + before the existing of the whole decoder units machinery. + One issue that could be arising if that code was kept is that we could + have submitted a picture, and subsequently a GstVideoCodec frame, twice. + Once without the decode_only flag set, and once with that flag set. The + end result is that the GstVideoDecoder would release the codec frame + twice, thus releasing stale data. + In short, the piece of code that is removed by this patch is for once + completely obsolete for a while, and secondly error-prone in corner + cases. + +2013-02-28 15:26:36 +0800 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + decoder: add utility function to clone picture objects. + https://bugzilla.gnome.org/show_bug.cgi?id=703921 + Signed-off-by: Wind Yuan + [added cosmetic changes, fixed propagation of "one-field" flag to + children, fixed per-codec clone modes (h264)] + Signed-off-by: Gwenole Beauchesne + +2015-05-27 23:49:18 +0300 Alban Browaeys + + * gst/vaapi/Makefile.am: + build: don't compile HEVC encoder if not supported + Fix: + (gst-plugin-scanner:16681): GStreamer-WARNING **: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvaapi.so': /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvaapi.so: undefined symbol: gst_vaapi_encoder_h265_get_default_properties + https://bugzilla.gnome.org/show_bug.cgi?id=749954 + Signed-off-by: Alban Browaeys + Signed-off-by: Sreerenj Balachandran + +2015-05-27 23:43:16 +0300 Alban Browaeys + + * gst-libs/gst/vaapi/gstvaapicompat.h: + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + HEVC: decode: add missing va_dec_hevc header + Signed-off-by: Alban Browaeys + Signed-off-by: Sreerenj Balachandran + https://bugzilla.gnome.org/show_bug.cgi?id=749953 + +2015-05-26 13:28:32 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix PTS cache for GOP start. + If the GOP temporal sequence number (TSN) is interpolated from a valid + PTS, then we need to compensate that PTS corresponding to the start of + GOP with the next picture to be decoded, which shall be an I-frame, + based on its sequence number. + https://bugzilla.gnome.org/show_bug.cgi?id=748676 + +2015-05-27 10:49:56 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: avoid crash when seeking with debug logs + Move down the debug message when the state of the decoder is verified + so the slice header is not NULL. + +2014-12-17 00:41:10 +1100 Jan Schmidt + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: Avoid crashes and warnings on re-opened decoder after a seek + Reset state and add some checks for safe state to avoid a crash and + a warning after the decoder is destroyed/recreated during a seek. + +2015-05-26 10:21:59 +0300 Sreerenj Balachandran + + * patches/videoparsers/0003-h264parse-default-to-byte-stream-nalu-format-Annex-B.patch: + * patches/videoparsers/0004-h264parse-default-to-byte-stream-nalu-format-Annex-B.patch: + * patches/videoparsers/series.frag: + patches/videoparsers: Rebase the patch on top of gst-vaapi-branch commit 20ee952 + Signed-off-by: Sreerenj Balachandran + +2015-05-26 10:03:20 +0300 Sreerenj Balachandran + + * ext/codecparsers: + codecparsers: Update to gst-vaapi-branch commit 20ee952 + b7dded3: h264parse: don't consider unknown stream-format as avc + 5110ad9: h264parse: fix up handling of input caps corner cases + e51db3e: h264parse: Remove dead code + 3d739d0: codecparser: h265: Fix the number of tile rows/columns parsing + 8482957: h265parse: Fix profile, tier and level setting in caps + 4649acb: h265parse: Fix the memory freeing of stored VPS nals + f2beeb7: h265parse: Fix source caps to report cropped dimensions + 6886a31: h264parse: Fix profile and level setting in caps + 5286c1a: h264parse: Consider SEI NALU as "HEADER" packets + eb97854: videoparsers: h264: bit-exact sync with upstream, minor changes here and there + 53074fc: build: Upgrade GStreamer dependency to 1.0 + Signed-off-by: Sreerenj Balachandran + +2015-05-26 06:01:10 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + HEVC: decode: Replace clip3 implementation with glib CLAMP macro + Signed-off-by: Sreerenj Balachandran + +2015-05-26 05:33:33 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + HEVC: decode: Update Cropping Rectangle + Signed-off-by: Sreerenj Balachandran + +2015-05-25 11:58:20 +0300 Sreerenj Balachandran + + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapiencode_h265.c: + * gst/vaapi/gstvaapiencode_h265.h: + HEVC_Encode: Add HEVC(h265) Encoder plugin + https://bugzilla.gnome.org/show_bug.cgi?id=748874 + Signed-off-by: Sreerenj Balachandran + +2015-05-25 11:38:34 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiencoder_h265.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h265.h: + HEVC_Encode: Add HEVC(h265) encoder to core libgstvaapi + https://bugzilla.gnome.org/show_bug.cgi?id=748874 + Signed-off-by: Sreerenj Balachandran + +2015-05-25 11:26:14 +0300 Sreerenj Balachandran + + * configure.ac: + HEVC_Encode: build: Check availability of VA APIs for H265 encoding. + Signed-off-by: Sreerenj Balachandran + https://bugzilla.gnome.org/show_bug.cgi?id=748874 + +2015-05-25 10:58:52 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiutils_h265.c: + * gst-libs/gst/vaapi/gstvaapiutils_h265.h: + gstvaapiutils_h265: Add H265 Tier specific utility functions + -- New API: gst_vaapi_utils_h265_get_tier_from_string() + -- New API: gst_vaapi_utils_h265_get_tier_string() + https://bugzilla.gnome.org/show_bug.cgi?id=748874 + Signed-off-by: Sreerenj Balachandran + +2015-05-19 10:57:42 +0200 Víctor Manuel Jáquez Leal + + * docs/reference/plugins/Makefile.am: + doc: conditional linking for scanner + Add x11 library only if it is enabled. + https://bugzilla.gnome.org/show_bug.cgi?id=749018 + +2015-05-19 10:37:13 +0200 Víctor Manuel Jáquez Leal + + * docs/reference/plugins/plugins.types: + doc: fix scanner compilation warning + https://bugzilla.gnome.org/show_bug.cgi?id=749018 + +2015-05-06 16:19:23 +0200 Víctor Manuel Jáquez Leal + + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/libs/libs-sections.txt: + doc: update sections and symbols + https://bugzilla.gnome.org/show_bug.cgi?id=749018 + +2015-05-13 10:38:24 +0200 Víctor Manuel Jáquez Leal + + * .gitignore: + * Makefile.am: + * debian.upstream/Makefile.am: + * docs/Makefile.am: + * docs/reference/Makefile.am: + * docs/reference/libs/Makefile.am: + * docs/reference/plugins/Makefile.am: + * ext/Makefile.am: + * ext/libvpx/Makefile.am: + * git.mk: + * gst-libs/Makefile.am: + * gst-libs/gst/Makefile.am: + * gst-libs/gst/base/Makefile.am: + * gst-libs/gst/codecparsers/Makefile.am: + * gst-libs/gst/vaapi/Makefile.am: + * gst/Makefile.am: + * gst/vaapi/Makefile.am: + * patches/Makefile.am: + * patches/videoparsers/Makefile.am: + * pkgconfig/Makefile.am: + * tests/Makefile.am: + build: use git.mk + This patch handles dinamically the gitignore files with git.mk[1]. + Removed the automake variable MAINTAINERCLANFILES in most of the + Makefile.am files since now it is handled by the top one. + 1. https://github.com/behdad/git.mk/blob/master/git.mk + https://bugzilla.gnome.org/show_bug.cgi?id=749321 + +2015-05-07 11:28:15 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: sync() when destroy() + Before pushing a the new frame, the render() method calls sync() to flush the + pending frames. Nonetheless, the last pushed frame never gets rendered, leading + to a memory leak too. + This patch calls sync() in the destroy() to flush the pending frames before + destroying the window. + Also a is_cancelled flag is added. This flag tells to not flush the event + queue again since the method failed previously or were cancelled by the user. + https://bugzilla.gnome.org/show_bug.cgi?id=749078 + +2015-05-07 15:55:40 +0200 Michael Olbrich + + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_priv.h: + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + * gst/vaapi/gstvaapisink.c: + vaapisink: implement unlock/unlock_stop for wayland + Otherwise wl_display_dispatch_queue() might prevent the pipeline from + shutting down. This can happen e.g. if the wayland compositor exits while + the pipeline is running. + Changes: + * renamed unlock()/unlock_stop() to unblock()/unblock_cancel() in gstvaapiwindow + * splitted the patch removing wl_display_dispatch_queue() + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=747492 + https://bugzilla.gnome.org/show_bug.cgi?id=749078 + +2015-05-07 12:33:34 +0200 Víctor Manuel Jáquez Leal + + * configure.ac: + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: wl_display_dispatch_queue() can block forever. + wl_display_dispatch_queue() might prevent the pipeline from shutting + down. This can happen e.g. if the wayland compositor exits while the + pipeline is running. + This patch replaces it with these steps: + - With wl_display_prepare_read() all threads announce their intention + to read. + - wl_display_read_events() is thread save. On threads reads, the other + wait for it to finish. + - With wl_display_dispatch_queue_pending() each thread dispatches its + own events. + wl_display_dispatch_queue_pending() was defined since wayland 1.0.2 + Original-patch-by: Michael Olbrich + * stripped out the unlock() unlock_stop() logic + * stripped out the poll handling + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=749078 + https://bugzilla.gnome.org/show_bug.cgi?id=747492 + +2015-05-07 18:30:33 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: rename frame for last_frame + Since frame in the private data means the last frame sent, it would + semantically better use last_frame. + Also, this patch makes use of g_atomic_pointer_{compare_and_exchange, set}() + functions. + https://bugzilla.gnome.org/show_bug.cgi?id=749078 + +2015-05-07 11:18:12 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: use a counter as sync flag + Wayland window has a pointer to the last pushed frame and use it to set the + flag for stopping the queue dispatch loop. This may lead to memory leaks, + since we are not keeping track of all the queued frames structures. + This patch removes the last pushed frame pointer and change the binary flag + for an atomic counter, keeping track of number of queued frames and use it for + the queue dispatch loop. + https://bugzilla.gnome.org/show_bug.cgi?id=749078 + +2015-05-07 10:36:17 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: decouple wl_buffer from frame + This patch takes out the wayland's buffer from the the frame structure. The + buffer is queued to wayland and destroyed in the "release" callback. The + frame is freed in the surface's "done" callback. + In this way a buffer may be leaked but not the whole frame structure. + - surface 'done' callback is used to throttle the rendering operation and to + unallocate the frame, but not the buffer. + - buffer 'release' callback is used to destroy wl_buffer. + Original-patch-by: Zhao Halley + * code rebase + * kept the the event_queue for buffer's proxy + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=749078 + +2015-05-14 16:22:36 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapisink.c: + vaapisink: fix indentation + +2015-05-13 11:54:01 +0200 Víctor Manuel Jáquez Leal + + * debian.upstream/Makefile.am: + * ext/libvpx/Makefile.am: + * gst-libs/gst/vaapi/Makefile.am: + * gst/vaapi/Makefile.am: + * tests/Makefile.am: + build: fix make distcheck + This patch fixes several issues found when running the `make distcheck` + target: + - In commit c561b8da, the update of gstcompat.h in Makefile.am was + forgotten. + - In commit c5756a91 add the simple_encoder_source_h in EXTRA_DIST was + forgotten. + - vpx.build.stamp is not generated at all, only vpx.configure.stamp. + - The make target distcleancheck failed because some autogenerated files + were not handled with the DISTCLEANFILES variable. + Note: `make distcheck -jXX` is not currently supported. + +2015-05-13 13:28:17 +0200 Víctor Manuel Jáquez Leal + + * patches/videoparsers/0001-plugins-compile-the-built-in-video-parsers-as-vaapip.patch: + * patches/videoparsers/0002-h264parse-fix-build-with-older-GStreamer-1.x-stacks.patch: + * patches/videoparsers/0004-h264parse-default-to-byte-stream-nalu-format-Annex-B.patch: + h264parse: update patches with upstream + These patches didn't applied cleanly, breaking the `make distcleancheck` + target. Re-sync'ed the patches against the current git's submodule. + +2015-05-12 16:04:33 +0200 Gwenole Beauchesne + + * tests/simple-encoder.c: + tests: simple-encoder: fix build warnings on 64-bit platforms. + Add a cosmetic change to replace VAAPI buffer with VA buffer and most + importantly fix warnings spitted out during build on 64-bit platforms. + ../../tests/simple-encoder.c:211:5: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘gssize’ [-Wformat=] + g_warning ("Invalid VAAPI buffer size (%d)", size); + ^ + ../../tests/simple-encoder.c:217:5: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘gssize’ [-Wformat=] + g_warning ("Failed to create output buffer of size %d", size); + ^ + +2015-05-08 15:54:09 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapivideocontext.h: + plugins: remove gstreamer-0.10 crumbs + GstVideoContext was used in gstreamer-0.10, which is not supported anymore. + Still, its definition was still in the code. This patch removes it. + https://bugzilla.gnome.org/show_bug.cgi?id=749113 + +2015-05-05 13:08:25 +0200 Víctor Manuel Jáquez Leal + + * tests/Makefile.am: + * tests/simple-encoder.c: + * tests/y4mreader.c: + * tests/y4mreader.h: + tests: add simple-encoder program + This patch adds a simple-encoder test program that uses libgstvaapi for video + encoding to elementary (raw) streams. Input stream is raw YUV in the Y4M + format. That can be from a regular file or standard input when the input + filename is "-". + Usage: simple-encoder [options]* + Options: + --output|-o output file name + --codec|-c codec to use for video encoding + --bitrate|-b desired bitrate (kbps) + By default, and as an initial patch, the encoded stream shall conform to the + minimally supported profile. That is "Constrained Baseline Profile" for H.264 + and "Simple Profile" for MPEG-2. Though, those are the defaults to be + generated by libgstvaapi. + You can find Y4M sample files here http://samples.mplayerhq.hu/yuv4mpeg2/ + Original-patch-by: Changzhi Wei + * general code clean-up + * removed the yuv reader thread + * re-wrote the y4m file parser + * updated used API fixed some wrong usage + * fixed a lot of memory leaks + * added the bitrate setting + * keep fps' numerator and denominator + * simplified the thread control + * removed custom logging and use glib + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=719528 + +2015-05-05 13:02:19 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapiencoder.h: + libs: trivial documentation fix + GST_VAAPI_ENCODER_STATUS_NO_SURFACE and GST_VAAPI_ENCODER_STATUS_NO_BUFFER + are not errors, so they do not have the ERROR namespace. + This patch fixes this typo in documentation. + +2015-02-15 15:01:03 +0000 Simon Farnsworth + + * gst-libs/gst/vaapi/gstvaapiwindow_priv.h: + window: Correct prototype to match implementation + On s390x, guintptr and GstVaapiID are not compatible types. The + implementation of gst_vaapi_window_new_internal() and all its callers + seem to assume that its third argument is a GstVaapiID, while the + header gives it guintptr type. + https://bugzilla.gnome.org/show_bug.cgi?id=744559 + +2015-05-04 14:24:43 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecodebin.c: + vaapidecode: add guards for disabled codecs. + Fix link when building plugin elements without HEVC support. e.g. don't + try to call into gst_vaapi_decoder_h265_set_alignment() if there is no + support HEVC enabled in libgstvaapi. + Also, drop disabled codecs from static template caps. Add the missing + HEVC static template caps into vaapidecodebin too. + +2015-04-30 13:29:48 +0200 Víctor Manuel Jáquez Leal + + * configure.ac: + * gst-libs/gst/vaapi/glibcompat.h: + build: upgrade glib dependency to 2.32 + Since bug #745728 was fixed the oldest supported version of GStreamer is + 1.2. That GStreamer release requires glib 2.32, so we can upgrade our + requirement too. + This patch changes the required version of glib in configure.ac and removes + the hacks in glibcompat.h + https://bugzilla.gnome.org/show_bug.cgi?id=748698 + +2015-04-30 13:21:08 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipluginbase.c: + plugins: check if the pool config is already set + In commit 97b768, a regression for GStreamer 1.2 was introduced: + GStreamer 1.2 doesn't check, in gst_buffer_pool_set_config() if the + config option is already set. This patch adds an inline function to + first verify if the option is not in the pool config berfore add it. + +2015-04-29 12:39:50 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: tune up a couple of log messages + In order to reduce the noise, the query type log was downgrade from INFO to + DEBUG, and the shared display address log message is assigned to the object. + +2015-04-29 12:27:43 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipluginbase.c: + plugins: check gst_buffer_pool_set_config() + Check the return value of gst_buffer_pool_set_config(). If it fails an error + message is posted in the bus. + +2015-04-29 12:24:52 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipluginbase.c: + plugins: more specific log message + Be more specific in the log message about the reason of creating a new pool. + +2015-04-29 12:22:29 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipluginbase.c: + plugins: delete unused variable + need_pool is a boolean variable extracted from the allocation query, but it is + not used afterwards. + +2015-04-27 19:21:12 -0400 Olivier Crete + + * gst/vaapi/gstvaapipluginbase.c: + vaapipluginbase: Update the pool if there was no pool in the downstream reply + Fix regression introduced by bd866479, the query after decide_allocation() + always needs a pool in the first slot. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=748559 + +2015-04-27 20:50:19 -0400 Olivier Crete + + * gst/vaapi/gstvaapivideobufferpool.c: + videopool: Free members before chaining up finalize + The finalize function in GObject frees the object memory, so + everything else needs to have been freed before. + https://bugzilla.gnome.org/show_bug.cgi?id=748563 + +2015-04-27 20:31:50 -0400 Olivier Crete + + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + wayland: don't leak the registry proxy + Release the registry proxy when closing the display. + https://bugzilla.gnome.org/show_bug.cgi?id=748564 + +2015-04-21 17:17:06 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: refactor _sync() method and rename callback + This patch only intends to improve readability: in the method + gst_vaapi_window_wayland_sync() the if/do instructions are squashed into a + single while loop. + Also renames the frame_redraw_callback() callback into frame_done_callback(), + which is a bit more aligned to Wayland API. + +2015-02-03 16:52:06 +0100 Michael Olbrich + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: free frame in buffer release callback + The Wayland compositor may still use the buffer when the frame done + callback is called. + This patch destroys the frame (which contains the buffer) until the + release callback is called. The draw termination callback only controls + the display queue dispatching. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=747492 + +2015-04-21 10:00:36 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: refactor gst_vaapidecode_internal_flush() + This a cosmetic refactor: gst_vaapidecode_internal_flush() removes its only + label; gst_vaapidecode_finish() is more readable and gst_vaapidecode_purge() + shares the same error message of gst_vaapidecode_internal_flush() when flush + fails. + +2015-04-20 13:27:27 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: refactor gst_vaapidecode_destroy() + Add the method gst_vaapidecode_purge(). This method releases the + flushed frames from the decoder. + This new method add more readablity to gst_vaapidecode_destroy() + +2015-04-16 12:53:18 -0400 Olivier Crete + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst/vaapi/gstvaapidecode.c: + vaapidecode: Tell the base class about released frames on close + The base class needs to be informed about frames that were still queued + in the decoder on release, otherwise they are leaked. + https://bugzilla.gnome.org/show_bug.cgi?id=747999 + +2015-04-19 11:19:03 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: reduce logging noise + When a frame is rejected by downstream, the message is logged twice. This + patch removes one of those logging messages. + Also, the reject of a frame doesn't mean an alarming error. This patch demotes + the log message from error to info. + +2015-04-16 20:18:13 -0400 Olivier Crete + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: Use the GstVideoDecoder error reporting function + This way, the decoder won't stop on the first decoding error, + in most cases it can recover after some glitchiness. + https://bugzilla.gnome.org/show_bug.cgi?id=744620 + +2015-04-17 19:10:35 +0000 Olivier Crete + + * gst/vaapi/gstvaapipluginbase.c: + vaapipluginbase: The allocation query can return without a pool + It is possible to return the min/max/size without actually providing + a pool. This way the source knows how many buffers downstream needs. + https://bugzilla.gnome.org/show_bug.cgi?id=748076 + +2015-04-17 16:45:22 +0300 Sreerenj Balachandran + + * ext/Makefile.am: + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapiparse.c: + * gst/vaapi/gstvaapiparse.h: + * patches/videoparsers/0001-h265parse-include-gstvaapiparse.h.patch: + * patches/videoparsers/series.frag: + plugins: Add h265 videoparser element "vaapiparse_h265" + This is a mirror of h265parse element in upstream gst-plugins-bad. + There could be additional patches but all should go to upstream. + This is for making development faster. + Note: vaapiparse_h265 will get build only for GStreamer version >= 1.4 + +2015-04-17 15:44:04 +0300 Sreerenj Balachandran + + * ext/codecparsers: + codecparsers: Update to gst-vaapi-branch commit 43a0368 + 45f1c28: codecparser: h265: Fix nal unit size checking + f25987b: codecparser: h265: Calculate crop rectangle dimensions + 639573a: codecparser: h265: Fix parsing multiple SEI messages in a single SEI Nal + 4c8ec41: Add h265 videoparser plugin source files + +2015-04-17 10:10:10 +0200 Gwenole Beauchesne + + * autogen.sh: + autogen: drop videoutils submodule. + +2015-04-17 10:36:25 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + decoder: hevc: cosmetics. + Mostly coding style updates. Avoid integer signess inconsistencies. + Optimize dpb_find_lowest_poc() to align with original h264's decoder. + +2015-04-16 14:13:59 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + decoder: hevc: Add Support for tiled video decoding + Based up on the value of uniform_spacing_flag in Picture Parameter Set, + the tile column width and tile row height should be calculated. + Equations: 6-1, 6-2 + Tiled video Descriptions: 7.3.2.3, 7.4.3.3 + +2015-04-16 14:13:21 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + decoder: hevc: Fix decoding when there are RASL pictures present. + -- Set NoRaslOutputFlag based on EOS and EOB Nal units + -- Fix PicOutputFlag setting for RASL picture + -- Fix prev_poc_lsb/prev_poc_msb calculation + -- Drop the RASL frames if NoRaslOutputFlag is TRUE for the associated IRAP picture + -- Fixed couple of crashes and added cosmetics + +2015-04-14 10:54:54 +0100 Martin Sherburn + + * gst-libs/gst/vaapi/gstvaapidisplay_drm.c: + display: drm: fix race condition setting device type + There is a race condition where g_drm_device_type can be left set to + DRM_DEVICE_RENDERNODES when it shouldn't. + If thread 1 comes in and falls into the last else statement setting up both + RENDERNODES and LEGACY types. And begins to process the first type (RENDERNODES), + it sets g_drm_device_type = RENDERNODES. + Now when thread 2 comes in and sees g_drm_device_type is RENDERNODES, it queues + up that type to be tried but then encounters the lock and has to wait until the + first thread finishes. Once the lock is acquired it will then proceed to ONLY try + RENDERNODES and fail it. But it doesn't try LEGACY. And from then on, all future + attempts will only try RENDERNODES. + So to avoid this situation I have simply moved the acquisition of the lock higher + up in the attached patch. + https://bugzilla.gnome.org/show_bug.cgi?id=747914 + +2015-04-15 15:26:12 -0400 Olivier Crete + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: Don't create filter on caps query + The problem with this is that creating the filter causes the display to + be selected, and the caps query happens while linking the element. So, + if the downstream or upstream element is using a specific display + object, it won't be propagated correctly to the postproc as it already + has a display at this point. + https://bugzilla.gnome.org/show_bug.cgi?id=747945 + +2015-04-15 15:20:17 -0400 Olivier Crete + + * gst-libs/gst/vaapi/gstvaapivideopool.c: + videopool: Release lock while allocating new object + The video pool can be accessed with the display lock held, for example, + when releasing a buffer from inside vaapisink_render, but allocating + a new object can may also take the display lock. Which means a possible + deadlock. + https://bugzilla.gnome.org/show_bug.cgi?id=747944 + +2015-04-15 17:26:43 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapisink.c: + vaapisink: use GstVideoSink vmethod show_frame() + vaapisink inherits from GstVideoSink, in order to use its functionality (such + as ::show-preroll-frame property), we should use its vmethod show_frame(), + rather than call ourselves render() and preroll(). + +2015-04-15 18:16:47 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + vaapisink: add 'handoff' signal + This patch adds the signal ::handoff and the property signal-handoffs. If the + property is set TRUE, the signal ::handoff is emitted just after the buffer is + rendered. + Based on Zhao Halley + https://bugzilla.gnome.org/show_bug.cgi?id=747905 + +2015-04-14 10:17:16 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + HEVC: silence the compiler + Fixed a couple of clang complains. + +2015-02-02 16:42:43 +0100 Michael Olbrich + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: destroy vpp buffer pool on resize + Otherwise the old buffers with the old size are used. + https://bugzilla.gnome.org/show_bug.cgi?id=747491 + +2015-04-14 10:08:47 +0200 Víctor Manuel Jáquez Leal + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + build: don't compile HEVC if not supported + HEVC decoding was added recently libva-1.5. + This patch avoids HEVC decoding support in libgstvaapi if it is not available + in the installed libva. + https://bugzilla.gnome.org/show_bug.cgi?id=747831 + +2015-04-13 16:04:59 +0300 Sreerenj Balachandran + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: Update Author name in plugin metadata + +2015-04-13 15:43:30 +0300 Sreerenj Balachandran + + * gst/vaapi/gstvaapidecode.c: + plugins: Add HEVC decoder + Signed-off-by: Sreerenj Balachandran + +2015-04-13 15:41:45 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidecoder_h265.c: + * gst-libs/gst/vaapi/gstvaapidecoder_h265.h: + HEVC: Add HEVC(h265) decoder to core libgstvaapi + Signed-off-by: Sreerenj Balachandran + +2015-04-13 14:53:46 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiutils_h265.c: + * gst-libs/gst/vaapi/gstvaapiutils_h265.h: + * gst-libs/gst/vaapi/gstvaapiutils_h265_priv.h: + HEVC: Add codec utility methods to core libgstvaapi + Signed-off-by: Sreerenj Balachandran + +2015-04-13 14:52:53 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapiprofile.h: + HEVC: gstvaapiprofile: Add profile definitions + Signed-off-by: Sreerenj Balachandran + +2015-04-13 14:52:14 +0300 Sreerenj Balachandran + + * configure.ac: + HEVC: build: Check availability of h265 decoder APIs + Signed-off-by: Sreerenj Balachandran + +2015-04-13 14:51:51 +0300 Sreerenj Balachandran + + * configure.ac: + * ext/Makefile.am: + * gst-libs/gst/codecparsers/Makefile.am: + HEVC: Allow to build h265 codecparser internally + Signed-off-by: Sreerenj Balachandran + +2015-04-08 18:05:20 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapibufferproxy.c: + * gst-libs/gst/vaapi/gstvaapibufferproxy_priv.h: + * gst-libs/gst/vaapi/gstvaapisurface.c: + guard buffer export API if not available + The support for buffer exports in VA-API was added in version 0.36. These + interfaces are for interop with EGL, OpenCL, etc. + GStreamer-VAAPI uses it for a dmabuf memory allocator. Though, gstreamer-vaapi + has to support VA-API versions ranging from 0.30.4, which doesn't support it. + This patch guards all the buffer exports handling (and dmabuf allocator) if + the detected VA-API version is below 0.36. + https://bugzilla.gnome.org/show_bug.cgi?id=746405 + +2015-04-13 11:29:35 +0300 Sreerenj Balachandran + + * ext/codecparsers: + codecparsers: Update to gst-vaapi-branch commit 9bc72b0 + 767bf22: codecparsers: h265: add helpers to convert quantization matrices + 71c8e93: codecparser: h265: skip byte alignment bits while parsing slice header + 3bf0355: codecparsre: h265: Fix the NumDeltaPocs calculation + 10e2087: codecparser: h265: Fix the NumPocTotalCurr calculatio + 2d753b8: codecparser: h265: Fix nal size calculation for EOS and EOB + +2014-12-11 12:02:38 +0100 Michael Olbrich + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: unref video codec frame twice + We get one reference when the frame is passed to decode_handle_frame() + and create another one in gst_vaapi_decoder_push_frame(). + Usually the frame is handled in gst_vaapidecode_push_decoded_frame(). + Here the frame is always released twice: + gst_video_decoder_finish_frame() + gst_video_codec_frame_unref() or + gst_video_decoder_drop_frame() + gst_video_codec_frame_unref(). + In gst_vaapidecode_reset_full() both references to the frame must be + released as well. + Signed-off-by: Víctor Manuel Jáquez Leal + https://bugzilla.gnome.org/show_bug.cgi?id=743226 + +2015-04-08 18:20:34 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + libs: remove unused variables + clang reports these unused variables. Let's get rid of them. + This patch is a missing part of commit c82e5173 + https://bugzilla.gnome.org/show_bug.cgi?id=747312 + +2015-04-03 20:38:07 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + decoder: mpeg4: remove an spurious comparison + The member size in GstMpeg4Packet is gsize which is unsigned, which cannot be + less than zero. Hence this pre-condition test is a no-op. This patch removes + that code. + https://bugzilla.gnome.org/show_bug.cgi?id=747312 + +2015-04-03 20:33:44 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: casts slice_param->slice_type + slice_type in slice_param is defined as (char *), but it is compared against a + signed integer. clang complains about this comparison. + This patch casts the variable. + https://bugzilla.gnome.org/show_bug.cgi?id=747312 + +2015-04-03 20:31:47 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapiencoder_objects.h: + encoder: avoid GstVaapiCodedBuffer redefinition + The symbol GstVaapiCodedBuffer is already defined in + gst-libs/gst/vaapi/gstvaapicodedbuffer.h which is loaded, at the end, by + gstvaapiencoder_objects.h. Clang complains about the symbol re-definition. + This patch removes that redefinition. + https://bugzilla.gnome.org/show_bug.cgi?id=747312 + +2015-04-03 20:28:22 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapidisplay_egl.c: + * gst-libs/gst/vaapi/gstvaapiencoder_vp8.c: + libs: remove unused variables + clang reports these unused variables. Let's get rid of them. + https://bugzilla.gnome.org/show_bug.cgi?id=747312 + +2015-04-03 20:27:24 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + encoder: mpeg2: use fabsf() instead of abs() + The member value in frame_rate_tab is float, the result of the abs() function + should be float too. But abs() only manages integers. + This patch replaces abs() with fabsf() to handle correctly the possible floats + values. + https://bugzilla.gnome.org/show_bug.cgi?id=747312 + +2015-04-03 20:02:29 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + decoder: cast GST_VAAPI_DECODER_STATUS_DROP_FRAME + Since GST_VAAPI_DECODER_STATUS_DROP_FRAME is not part of the enum + GstVaapiDecoderStatus, we need to cast it to avoid compiler complains. + https://bugzilla.gnome.org/show_bug.cgi?id=747312 + +2015-04-04 00:40:29 +0300 Sreerenj Balachandran + + * README: + Update README + +2015-04-04 00:06:56 +0300 Sreerenj Balachandran + + * .gitmodules: + * README: + Changing source code download links from https://gitorious to https://github + -- gitmodules: Change gstreamer-codecparsers submodule source download link + -- README: Change the gstreamer-vaapi webpage link + +2015-04-03 23:30:24 +0300 Sreerenj Balachandran + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit 1f792e4 + 87f4a7e: bytereader: add gst_byte_reader_peek_sub_reader() and _get_sub_reader() + 7d8ba7a: bytereader: use unchecked inline variant for get_remaining in more places + 2528ea6: bytereader: add gst_byte_reader_masked_scan_uint32_peek + 2b92a67: h264parse: reset the parser information when caps changes + 05eee86: codecparsers: Indent file + e27a38b: codecparsers: Add READ_UE_MAX macro + 2036471: Constify some static arrays everywhere + +2015-04-03 17:45:08 +0300 Sreerenj Balachandran + + * gst/vaapi/gstvaapivideoconverter_glx.c: + * gst/vaapi/gstvaapivideoconverter_x11.c: + Remove the gstvaapivideoconverter_*.c source files missed in commit 51b1e4a + +2015-04-03 17:09:08 +0300 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecodebin.c: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_jpeg.c: + * gst/vaapi/gstvaapiencode_mpeg2.c: + * gst/vaapi/gstvaapiencode_vp8.c: + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapivideobuffer.c: + * gst/vaapi/gstvaapivideobufferpool.c: + * gst/vaapi/gstvaapivideocontext.c: + * gst/vaapi/gstvaapivideocontext.h: + * gst/vaapi/gstvaapivideoconverter_glx.h: + * gst/vaapi/gstvaapivideoconverter_x11.h: + * gst/vaapi/gstvaapivideomemory.h: + * gst/vaapi/gstvaapivideometa_texture.c: + Removal of gstreamer-1.0 support + The support for GStreamer 1.0 has been obsoleted in 0.5.10 release. + GStreamer 1.2 is the a minimal requirement for building the gstreamer-vaapi. + This patch removes all the pre-processor conditional code compilation guarded + for gstreamer-1.0. + Thus, all the video converters were removed too. + https://bugzilla.gnome.org/show_bug.cgi?id=745728 + Signed-off-by: Gwenole Beauchesne + Signed-off-by: Sreerenj Balachandran + +2015-04-03 17:08:30 +0300 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstcompat.h: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/sysdeps.h: + * gst/vaapi/gstcompat.h: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecodebin.c: + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_jpeg.c: + * gst/vaapi/gstvaapiencode_mpeg2.c: + * gst/vaapi/gstvaapiencode_vp8.c: + * gst/vaapi/gstvaapiparse.c: + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiuploader.c: + * gst/vaapi/gstvaapivideobuffer.c: + * gst/vaapi/gstvaapivideobufferpool.c: + * gst/vaapi/gstvaapivideocontext.c: + * gst/vaapi/gstvaapivideoconverter_glx.c: + * gst/vaapi/gstvaapivideoconverter_x11.c: + * gst/vaapi/gstvaapivideomemory.c: + * gst/vaapi/gstvaapivideometa.c: + * gst/vaapi/gstvaapivideometa_texture.c: + * tests/codec.c: + update and move gstcompat.h + The purpose of gstcompat.h is to couple the API differences among + gstreamer-1.0 and gstreamer-0.10. Since gstreamer-0.10 is obsolete, the code + in this compatibility layer shall be removed. + Nevertheless, the gstcompat.h header should be kept, if new incompatibilites + appear in the future, but it shall live in gst/vaapi, not in gst-libs. + This patch removes the crumbs defined gstcompat.h and moves it to gst/vaapi. + In order to avoid layer violations, gstcompat.h includes sysdeps.h and all + the includes in gst/vaapi of sysdeps.h are replaced with gstcompat.h + https://bugzilla.gnome.org/show_bug.cgi?id=745728 + Signed-off-by: Gwenole Beauchesne + Signed-off-by: Sreerenj Balachandran + +2015-04-03 17:05:45 +0300 Víctor Manuel Jáquez Leal + + * configure.ac: + * gst/vaapi/Makefile.am: + autotools: remove gstreamer-1.0 support + This patch only removes the support of gstreamer-1.0 in the autotools + scripts. No other files are touched. + In the automake file all the converters were deprecated. + https://bugzilla.gnome.org/show_bug.cgi?id=745728 + Signed-off-by: Gwenole Beauchesne + Signed-off-by: Sreerenj Balachandran + +2015-04-03 17:03:38 +0300 Sreerenj Balachandran + + * .gitmodules: + * ext/Makefile.am: + * ext/videoutils: + Remove the gstreamer-videoutils submodule + +2015-04-03 17:01:45 +0300 Víctor Manuel Jáquez Leal + + * configure.ac: + * gst-libs/gst/Makefile.am: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/video/Makefile.am: + * gst/vaapi/Makefile.am: + * tests/Makefile.am: + Remove libgstvaapi-videoutils.so + This library was intended to add the base classes for video decoders which + where not included in gstreamer-0.10. + Since the support of gstreamer-0.10 is deprecated those classes are not + required, thus the whole library is removed. + https://bugzilla.gnome.org/show_bug.cgi?id=745728 + https://bugzilla.gnome.org/show_bug.cgi?id=732666 + Signed-off-by: Gwenole Beauchesne + +2015-04-03 16:55:43 +0300 Víctor Manuel Jáquez Leal + + * configure.ac: + * gst-libs/gst/vaapi/gstvaapicontext_overlay.c: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * tests/test-subpicture.c: + Remove HAVE_GST_VIDEO_OVERLAY_HWCAPS macro + This macro guarded the use of HAVE_GST_VIDEO_OVERLAY_HWCAPS, which was not + defined before gstreamer 0.10.35. Since the support of gstreamer-0.10 is + deprecated these guards are not required. + https://bugzilla.gnome.org/show_bug.cgi?id=745728 + https://bugzilla.gnome.org/show_bug.cgi?id=732666 + Signed-off-by: Gwenole Beauchesne + +2015-04-03 16:55:27 +0300 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstcompat.h: + * gst-libs/gst/vaapi/gstvaapicontext_overlay.c: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/video-format.c: + * gst-libs/gst/vaapi/video-format.h: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecodebin.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapidownload.h: + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_jpeg.c: + * gst/vaapi/gstvaapiencode_mpeg2.c: + * gst/vaapi/gstvaapiencode_vp8.c: + * gst/vaapi/gstvaapiparse.c: + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginbase.h: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + * gst/vaapi/gstvaapiupload.h: + * gst/vaapi/gstvaapiuploader.c: + * gst/vaapi/gstvaapivideobuffer.c: + * gst/vaapi/gstvaapivideoconverter_glx.c: + * gst/vaapi/gstvaapivideoconverter_x11.c: + * gst/vaapi/gstvaapivideometa.c: + * gst/vaapi/gstvaapivideometa.h: + * tests/test-filter.c: + * tests/test-subpicture.c: + Removal of gstreamer-0.10 support + This patch removes all the pre-processor conditional code compilation guarded + for gstreamer-0.10. + https://bugzilla.gnome.org/show_bug.cgi?id=745728 + https://bugzilla.gnome.org/show_bug.cgi?id=732666 + Signed-off-by: Gwenole Beauchesne + +2015-04-03 16:54:54 +0300 Víctor Manuel Jáquez Leal + + * configure.ac: + * debian.upstream/control.in: + * gst-libs/gst/video/Makefile.am: + * gst/vaapi/Makefile.am: + autotools: remove gstreamer-0.10 support + This patch only removes the support of gstreamer-0.10 in the autotools + scripts. No other files are touched. + The configuration parameter --gstreamer-api was deleted since now it is always + auto-detected. + The verification of vmethod query in GstBaseSinkClass was removed since it was + added in gstreamer 0.10.35. The same case for GstVideoOverlayComposition and + its format flags. + The precious variable GST_PLUGIN_PATH was removed, while GST_PLUGIN_PATH_1_0 + remained. + The automake files were changed accordingly. + Removed, in debian/control, the vaapiupload and vaapidownload descriptions. + https://bugzilla.gnome.org/show_bug.cgi?id=732666 + https://bugzilla.gnome.org/show_bug.cgi?id=745728 + Signed-off-by: Gwenole Beauchesne + +2015-03-16 23:38:18 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: add drain() vmethod + In GStremer v1.6 a new vmethod drain() was added in GstVideoDecoder + class. This patch implements this new method. + https://bugzilla.gnome.org/show_bug.cgi?id=742922 + Signed-off-by: Víctor Manuel Jáquez Leal + Signed-off-by: Sreerenj Balachandran + +2015-03-16 23:37:29 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: remove vmethod reset() + Since in bug #745728 the support for GStreamer 1.0 is going to be dropped, + this patch removes the method reset() which was deprecated in GStreamer 1.2. + https://bugzilla.gnome.org/show_bug.cgi?id=742922 + Signed-off-by: Víctor Manuel Jáquez Leal + Signed-off-by: Sreerenj Balachandran + +2015-03-16 23:36:33 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: handle flush() vmethod + Since GStreamer 1.2 the vmethod reset() in GstVideoDecoderClass was deprecated + and flush() was added. + This patch set the vmethod flush() if the installed GStreamer version is 1.2 or + superior. Otherwise, reset() is set. + v2: 1) In order to avoid symbol collision, the old method gst_vaapidecode_flush() + was renamed to gst_vaapidecode_internal_flush(). + 2) The new vmethod flush() always do a hard full reset. + v3: 1) Call gst_vaapidecode_internal_flush() first in flush() vmethod, in order to + gather all collected data with gst_video_decoder_have_frame() + https://bugzilla.gnome.org/show_bug.cgi?id=742922 + Signed-off-by: Víctor Manuel Jáquez Leal + Signed-off-by: Sreerenj Balachandran + +2015-03-16 23:10:53 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: call the correct query function + In commit 2f8c115 (vaapidecode: use the query virtual methods in 1.4) + a bug was introduced: when calling the parent's query function of the + src pad, the one of the sink pad is called instead. This patch fixes + this issue. + https://bugzilla.gnome.org/show_bug.cgi?id=746248 + +2015-03-15 00:36:45 +0200 Sreerenj Balachandran + + * .gitmodules: + gitmodules: Use https:// url instead of git:// for submodules. + Gitorious is failing to clone repositories over git:// url. + +2015-03-14 22:12:19 +0200 Julien Isorce + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + vaapidisplay: mark X11 display as compatible with EGL + GST_GL_WINDOW=x11 GST_GL_API=gles2 GST_GL_PLATFORM=egl + gst-launch-1.0 ... ! vaapidecode ! glimagesink + https://bugzilla.gnome.org/show_bug.cgi?id=745902 + Signed-off-by: Víctor Manuel Jáquez Leal + +2015-03-06 15:20:01 +0200 Olivier Crete + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: Don't crash if a buffer outlives the decoder + Sometimes, for example, when switching video streams but keeping + the same sink, the surface will be released after the decoder is + stopped and replaced. This caused a crash because the release + callback was called on an invalid pointer. + The patch adding an additional reference to the decoder object in the buffer. + https://bugzilla.gnome.org/show_bug.cgi?id=745189 + Signed-off-by: Olivier Crete + Signed-off-by: Sreerenj Balachandran + +2015-03-06 14:31:21 +0200 Sreerenj Balachandran + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: clean-ups (indentation, drop unused variables) + +2015-03-06 14:09:22 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: use the query virtual methods in 1.4 + GstVideoDecoder, the base class of vaapidecode, added support for + pad queries as virtual methods. This patch enables the use of that + support, while keeping support for lower versions of gstreamer. + This patch is important because GstVideoDecoder takes care of other + queries that might be important in the pipeline managing. + v2: 1) rebase to current master + 2) fix indentation with gst-indent + 3) simplify the patch layout + 4) fix the context query + 5) initialise the filter to NULL + 6) improve the query log message for gst-1.2 + https://bugzilla.gnome.org/show_bug.cgi?id=744406 + +2015-03-06 12:16:17 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + vaapipostproc: always activate buffer pool + The vaapipostproc has a proxy flag to know if the the buffer pool is + already active. But this fails in some situations where it is needed + to renegotiate the buffer pool. + This patch removes that flag so the renegotiation is done whenever is + required. + https://bugzilla.gnome.org/show_bug.cgi?id=745535 + +2015-03-02 17:04:20 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: fix minor memory leak in debug mode. + The gst_video_colorimetry_to_string() function returns a newly created + string that represents the GstVideoColorimetry value. So, that needs + to be released after usage, in e.g. GST_DEBUG(). + +2015-03-03 12:37:41 +0200 Sreerenj Balachandran + + * gst/vaapi/gstvaapidecodebin.h: + vaapidecodebin: Avoid usage of "__" prefix in macro names + Avoiding "__" prefix usage in Header File Guards as per + C standard recommendation. + +2015-03-03 12:31:11 +0200 Sreerenj Balachandran + + * gst/vaapi/gstvaapi.c: + plugins: Disable vaapidecodebin for GStreamer < 1.4 + There are autoplugging issues in GStreamer-1.2. + Lets disable vaapidecodebin untill we get some workarounds for this. + +2015-03-02 15:19:40 +0200 Sreerenj Balachandran + + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapidecodebin.c: + * gst/vaapi/gstvaapidecodebin.h: + plugins: Add a vaapidecodebin element + Add a "vaapidecodebin" element to vaapi plugins. + Child Elements: "vaapidecode ! queue ! vaapipostproc" + The Reasons for implementing a new bin element: + -- Help to Autoplug Hardware Accelerated Video Postprocessing element in playbin + with out any dependency to upstream gstreamer. + This is to overcome the *unacceptable* delay in upstream gstreamer to get new + features in. Eg: https://bugzilla.gnome.org/show_bug.cgi?id=687182. + Also customers using older gstreamer versions (1.2 and 1.4) will get the + benefit of autoplugging, hardware accelerated deinterlacing support etc. + -- Help to maintain a single thread implementation in vaapidecode. + This will result a dead-lock free vaapidecode in most of the cases. + More details here: https://bugzilla.gnome.org/show_bug.cgi?id=742605 + https://bugzilla.gnome.org/show_bug.cgi?id=745216 + +2015-03-02 14:59:16 +0200 Sreerenj Balachandran + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: re-indent (gst-indent) gstvaapidecode.c + +2015-03-02 14:46:38 +0200 Simon Farnsworth + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecode.h: + vaapidecode: Switch back to Single thread implementation + Because the decoder uses the thread from handle_frame() to decode a frame, + the src pad task creates an unsolveable AB-BA deadlock between + handle_frame() waiting for a free surface and decode_loop() pushing + decoded frames out. + Instead, have handle_frame() take responsibility for pushing surfaces, + and remove the deadlock completely. If you need a separate thread + downstream, you can insert a queue between vaapidecode and its downstream + to get one. + Another justification for the single thread implementation is, + there are two many point of locking in gstreamer-vaapi's current + implementation which can lead to deadlocks. + https://bugzilla.gnome.org/show_bug.cgi?id=742605 + Signed-off-by: Simon Farnsworth + Signed-off-by: Víctor Manuel Jáquez Leal + Signed-off-by: Sreerenj Balachandran + +2015-03-02 13:28:41 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginbase.c: + plugins: fix detection of upstream v4l2src element. + Improve check for upstream element that requires DMABUF buffer pool, + e.g. v4l2src element. In particular, make sure to traverse through + any additional capsfilter for instance. + Note: the traversal to the top-most upstream element could be made + more generic, but we are insofar only interested in supporting pipes + similar to v4l2src or v4l2src ! capsfilter, e.g. with an explicit + specification for a desired video camera format, or resolution. + +2015-03-02 11:12:53 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + plugins: fix allocation of DMABUF memory. + The dmabuf allocator would close the DMABUF handle passed in the init + function gst_dmabuf_allocator_alloc(). So, we need to dup() it so that + to avoid a double close, ultimately in the underlying driver that owns + the DMABUF handle. + +2015-02-26 12:28:02 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: keep src caps and output state in sync + vaapidecode keeps an output state that use the format + GST_VIDEO_FORMAT_ENCODED, while it crafts a different src caps + for a correct negotiation. + I don't see the rational behind this decoupling, it looks like + unnecessary complexity. This patch simplify this logic keeping + in sync the output state and the src caps. + This patch improves the readability of the function + gst_vaapidecode_update_src_caps() and simplify its logic. Also, + the patch validates if the buffer pool has the configuration for + the GL texture upload meta, in order to set the caps feature + meta:GLTextureUpload. Otherwise, the I420 format is set back. + https://bugzilla.gnome.org/show_bug.cgi?id=744618 + Signed-off-by: Víctor Manuel Jáquez Leal + Signed-off-by: Sreerenj Balachandran + +2015-02-26 12:26:54 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: upload meta only if feature and allocation + When vaapidecode finishes the decoding of a frame and pushes it, + if, in the decide_allocation() method, it is determined if the + next element supports the GL texture upload meta feature, the + decoder adds the buffer's meta. + Nonetheless, in the same spirit of the commit 71d3ce4d, the + determination if the next element supports the GL texture upload + meta needs to check both the preferred caps feature *and* if the + allocation query request the API type. + This patch, first removes the unused variable need_pool, and + determines the attribute has_texture_upload_meta using the + preferred caps feature *and* the allocation query. + Also, the feature passed to GstVaapPluginBase is not longer + determined by has_texture_upload_meta, but by the computed + preferred one. + https://bugzilla.gnome.org/show_bug.cgi?id=744618 + Signed-off-by: Víctor Manuel Jáquez Leal + Signed-off-by: Sreerenj Balachandran + +2015-02-26 12:24:55 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecode.h: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + vaapidecode: delayed src caps negotiation + Currently the src caps are set immediately after the sink caps are set, but in + that moment the pipeline might not fully constructed and the video sink has + not negotiated its supported caps and features. As a consequence, in many cases + of playback, the least optimized caps feature is forced. This is partially the + responsible of bug #744039. + Also, vaapidecode doesn't attend the reconfigure events from downstream, + which is a problem too, since the video sink can be changed with different + caps features. + This patch delays the src caps, setting them until the first frame arrives to + the decoder, assuming until that very moment the whole pipeline is already + negotiated. Particularly, it checks if the src pad needs to be reconfigured, + as a consequence of a reconfiguration event from downstream. + A key part of this patch is the new GstVaapiCapsFeature + GST_VAAPI_CAPS_FEATURE_NOT_NEGOTIATED, which is returned when the src pad + doesn't have a peer yet. Also, for a better report of the caps allowed + through the src pad and its peer, this patch uses gst_pad_get_allowed_caps() + instead of gst_pad_peer_query_caps() when looking for the preferred feature. + v3: move the input_state unref to close(), since videodecoder resets at + some events such as navigation. + v4: a) the state_changed() callback replaces the input_state if the media + changed, so this case is also handled. + b) since the parameter ref_state in gst_vaapidecode_update_src_caps() is + always the input_state, the parameter were removed. + c) there were a lot of repeated code handling the input_state, so I + refactored it with the function gst_vaapi_decode_input_state_replace(). + https://bugzilla.gnome.org/show_bug.cgi?id=744618 + Signed-off-by: Víctor Manuel Jáquez Leal + Signed-off-by: Sreerenj Balachandran + +2015-02-24 17:14:33 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.h: + encoder: h264: add support for more than 2 views + Add support for H.264 MVC Multiview High profile encoding with + more than 2 views. All views within the same accesss unit are + provided in increasing order of view order index (VOIdx). + Upto 10 view are supported for now. + A new property "view-ids" has been provided for the plugins to + set the view ids (which is an array of guint values) to be used + for mvc encoding. + https://bugzilla.gnome.org/show_bug.cgi?id=732453 + +2015-02-23 16:55:36 +0100 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipluginbase.c: + plugins: upload meta only if feature and allocation + Working on bug #743687, I realized that vaapidecode always adds to its buffer + pool the config option GST_BUFFER_POOL_OPTION_VIDEO_GL_TEXTURE_UPLOAD_META if + the decide_allocation()'s query has GST_VIDEO_GL_TEXTURE_UPLOAD_META_API_TYPE. + Nevertheless, there are occasions where the query has the API type, but the + last negotiated caps don't have the feature meta:GstVideoGLTextureUploadMeta. + Under this contradiction, vaapidecode adds the GLTextureUploadMeta API to its + buffer pool configuration, and adds its buffer's meta to each output buffer, + even if the negotiated caps feature is memory:SystemMemory with I420 color + format. + This kind of output buffers chokes ClutterAutoVideosSink, since it uses a map + that relates caps <-> GL upload method. If it receives a buffer with color + format I420, it assumes that it doesn't have a texture upload meta, because + only those with RGB color format has it. Our buffers, with I420 format, say + that they have the upload meta too. In that case the mapped method is a dummy + one which does nothing. I reported this issue in bug #744039 (the patch, + obviously, was rejected). + This patch workarounds the problem: the buffer pool's configuration option + GST_BUFFER_POOL_OPTION_VIDEO_GL_TEXTURE_UPLOAD_META is set if and only if the + query has the GST_VIDEO_GL_TEXTURE_UPLOAD_META_API_TYPE *and* the negotiated + caps feature is meta:GstVideoGLTextureUploadMeta. + I have tested these patches with gst-master (1.5), gst-1.4 and gst-1.2 and + in all they seem to work correctly. + https://bugzilla.gnome.org/show_bug.cgi?id=744618 + [adapted to fit current EGL changes] + Signed-off-by: Gwenole Beauchesne + +2015-02-20 15:13:03 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapitexture.h: + * gst-libs/gst/vaapi/gstvaapitexture_glx.c: + * gst-libs/gst/vaapi/gstvaapitexture_priv.h: + * gst/vaapi/gstvaapivideometa_texture.c: + plugins: add support for GstVideoGLTextureOrientation. + Add support for GstVideoGLTextureOrientation modes. In particular, + add orientation flags to the GstVaapiTexture wrapper and the GLX + implementations. Default mode is that texture memory is laid out + with top lines first, left row first. Flags indicate whether the + X or Y axis need to be inverted. + +2015-02-09 21:09:07 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapivideometa_texture.c: + plugins: add support for BGRA textures. + Some frameworks (EFL) expect BGRA textures for storage. However, + adding support for that broadly into GStreamer framework implies + two kinds of hacks: (i) libgstgl helpers currently do not support + BGRA textures correctly, (ii) we need to better parse downstream + suggested caps and intersect them with what the VA plugin elements + can offer to them for GL texturing. + +2015-01-23 09:31:57 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginutil.c: + plugins: fix support for Wayland/EGL running alongside X11. + When multiple display servers are available, the glimagesink element + (from GStreamer 1.4) may not be able to derive a global display in + Wayland. Rather, a "window"-specific display is created. In this case, + the GstGLDisplay handle available through GstGLContext is invalid. + So, try to improve heuristics for display server characterisation in + those particular situations. + +2015-02-20 15:29:17 +0100 Gwenole Beauchesne + + * configure.ac: + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapivideobufferpool.c: + * gst/vaapi/gstvaapivideometa_texture.c: + plugins: add initial support for EGL. + Add initial support for EGL through GstVideoGLTextureUploadMeta. + Fix gst_vaapi_ensure_display() to allocate a GstVaapiDisplay off the + downstream supplied GstGLContext configuration, i.e. use its native + display handle to create a GstVaapiDisplay of type X11 or Wayland ; + and use the desired OpenGL API to allocate the GstVaapiDisplayEGL + wrapper. + https://bugzilla.gnome.org/show_bug.cgi?id=741079 + +2014-12-09 11:46:58 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideometa_texture.c: + plugins: track video texture size changes. + Sync video texture sizes to GstVideoGLTextureUploadMeta private date, + i.e. GstVaapiVideoMetaTexture, on a regular basis. In particular, we + now update the texture size from the GstVideoMeta, if any, or reset + to some defaults otherwise. + +2014-12-03 15:45:52 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginbase.h: + * gst/vaapi/gstvaapipluginutil.c: + plugins: ensure VA display matches GL context expectations. + If a GstGLContext is supplied by the downstream element, then make + sure that the VA plugin element gets a compatible display to what + is requested by the GL context. e.g. re-allocate a VA/GLX display + when a GLX context is provided by the downstream element. + +2014-12-03 14:14:30 +0100 Gwenole Beauchesne + + * configure.ac: + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginbase.h: + plugins: record downstream GstGLContext. + Record GL context supplied by downstream elements. This can be useful, + and further needed, to enforce run-time check that the GL context is + compatible for use by libgstvaapi. e.g. check that we don't create a + VA/GLX display for EGL/X11 contexts. + https://bugzilla.gnome.org/show_bug.cgi?id=725643 + Original-path-by: Matthew Waters + +2014-12-01 14:52:39 +0100 Gwenole Beauchesne + + * tests/Makefile.am: + * tests/output.c: + egl: update tests. + Add initial support for EGL to tests. The new EGL backend can be selected + through the --egl command line option. The OpenGL|ES version can further + be selected with the --gles-version command line option, where the default + of 0 means "desktop" OpenGL. + +2015-01-27 16:21:04 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidisplay_egl.c: + * gst-libs/gst/vaapi/gstvaapiutils_egl.c: + * gst-libs/gst/vaapi/gstvaapiutils_egl.h: + * gst-libs/gst/vaapi/gstvaapiwindow_egl.c: + * gst-libs/gst/vaapi/gstvaapiwindow_egl.h: + egl: add windowing support. + This provides for some basic EGL window abstraction. + +2015-01-24 08:29:57 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidisplay_egl.c: + * gst-libs/gst/vaapi/gstvaapitexture_egl.c: + * gst-libs/gst/vaapi/gstvaapitexture_egl.h: + egl: add texture abstraction. + Add GstVaapiTextureEGL abstraction that can create its own GL texture, + or import a foreign allocated one, while still allowing updates from a + VA surface. + +2014-12-09 18:14:56 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapisurface_egl.c: + * gst-libs/gst/vaapi/gstvaapisurface_egl.h: + egl: allow for EGLImage imports into VA Surfaces. + Add helpers to import EGLImage objects into VA surfaces. There are + two operational modes: (i) gst_vaapi_surface_new_from_egl_image(), + which allows for implicit conversion from EGLImage to a VA surface + in native video format, and (ii) gst_vaapi_surface_new_with_egl_image(), + which exactly wraps the source EGLImage, typically in RGBA format + with linear storage. + Note: in case of (i), the EGLImage can be disposed right after the + VA surface creation call, unlike in (ii) where the user shall ensure + that the EGLImage is live until the associated VA surface is no longer + needed. + https://bugzilla.gnome.org/show_bug.cgi?id=743847 + +2015-02-20 15:27:53 +0100 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/egl_compat.h: + * gst-libs/gst/vaapi/egl_vtable.h: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_egl.c: + * gst-libs/gst/vaapi/gstvaapidisplay_egl.h: + * gst-libs/gst/vaapi/gstvaapidisplay_egl_priv.h: + * gst-libs/gst/vaapi/gstvaapiutils_egl.c: + * gst-libs/gst/vaapi/gstvaapiutils_egl.h: + * gst-libs/gst/vaapi/ogl_compat.h: + Add initial support for EGL. + Add initial support for EGL to libgstvaapi core library. The target + display server and the desired OpenGL API can be programmatically + selected at run-time. + A comprehensive set of EGL utilities are provided to support those + dynamic selection needs, but also most importantly to ensure that + the GL command stream is executed from within a single thread. + https://bugzilla.gnome.org/show_bug.cgi?id=743846 + +2015-01-30 21:38:07 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapivalue.c: + libs: initialize GValues in a thread-safe manner. + +2015-01-30 21:35:10 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapivalue.c: + libs: re-indent all GValue related source code. + +2015-01-22 22:45:24 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: partially revert 0777f35. + Reset the VA decoder after updating the base plugin caps, and most + importantly, after GstVideoDecoder negotiation. The reason behind + this is that the negotiation could trigger a last decide_allocation() + where we could actually derive a new GstVaapiDisplay to use from the + downstream element. e.g. GLX backend. + +2015-02-19 13:37:09 +0200 Sreerenj Balachandran + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: Caps query should return the list of all supported caps. + Query caps filtering should be always done on top of allowed caps instead + of existing fixed caps on a particular pad. + This fixes the mvc stream decoding when there is a base view(high profile) + and non-base view(stereo-high profile). + +2015-02-18 13:36:16 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: intersect filter from query caps + According to documentation[1] when receiving a GST_QUERY_CAPS + the return value should be all formats that this elements supports, + taking into account limitations of peer elements further downstream + or upstream, sorted by order of preference, highest preference first. + This patch add those limitations intersecting with the received + filter in the query. Also takes into account the already negotiated + caps. Also adds the processing of the query on the SRC pad. + 1. http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/section-nego-getcaps.html + https://bugzilla.gnome.org/show_bug.cgi?id=744406 + +2015-02-18 11:46:11 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapibufferproxy.c: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapiencoder_jpeg.c: + * gst/vaapi/gstvaapivideomemory.c: + Fix compiler warnings + This patch fixes some warnings that gcc 4.9 reports. + https://bugzilla.gnome.org/show_bug.cgi?id=744411 + +2015-02-18 11:22:21 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: Use GST_DEBUG_FUNCPTR for gst_vaapidecode_query() + Hence the function name is shown in the gst-inspect-1.0 information + rather than the memory address. + https://bugzilla.gnome.org/show_bug.cgi?id=744330 + +2015-02-18 11:21:35 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: log flow error name + https://bugzilla.gnome.org/show_bug.cgi?id=744387 + +2015-02-18 11:20:42 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + VC1: decoder: Ignore VC1 user BDU's + Don't return error if the processed BDU is a user one, just ignore them. + https://bugzilla.gnome.org/show_bug.cgi?id=741237 + Signed-off-by: Sreerenj Balachandran + +2015-02-18 11:19:26 +0200 Olivier Crete + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapipluginbase.c: + vaapidecode: Emit error GstMessage when returning a GST_FLOW_ERROR + This is required in GStreamer, elements should never return + GST_FLOW_ERROR without posting an ERROR message on the bus. + https://bugzilla.gnome.org/show_bug.cgi?id=744620 + +2015-02-13 13:45:32 +0200 Sreerenj Balachandran + + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapiencode_vp8.c: + * gst/vaapi/gstvaapiencode_vp8.h: + plugins: Add VP8 Encoder + +2015-02-13 13:42:04 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiencoder_vp8.c: + * gst-libs/gst/vaapi/gstvaapiencoder_vp8.h: + Add VP8 Encoder to core libgstvaapi. + +2015-02-13 13:40:19 +0200 Sreerenj Balachandran + + * configure.ac: + configure: Add Check for VP8 Encoding API + +2015-02-10 11:40:16 +0200 Lim Siew Hoon + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + decoder: vc1: Rounding control handling for VC1 simple and Main profile + Added rounding control handling for VC1 simple and Main profile + based on VC1 standard spec: section 8.3.7 + https://bugzilla.gnome.org/show_bug.cgi?id=743958 + Signed-off-by: Lim Siew Hoon + Signed-off-by: Sreerenj Balachandran + +2015-02-06 12:10:51 +0200 Sreerenj Balachandran + + * gst/vaapi/Makefile.am: + build: fix make dist when certain conditionals not met. + Fix typo which was preventing the inclusion of jpeg encoder + source files from make dist (when there is no jpeg encoder + API support in libva). + +2015-02-05 13:08:53 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_jpeg.c: + encoder: jpeg: Fix the sampling factor calculation for ENCODED format. + If the incoming raw video format is GST_VIDEO_FORMAT_ENCODED, + use native YUV420 format (which is i420) as default. + +2015-02-05 12:13:38 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + encoder: Only support YUV420 native format as input for now + Practically we should be able to support more formats, for eg: + JPEG Encoder can support YUV422, RGBA and all. + But this is causing more issues which need proper fix here and there. + +2015-02-04 18:34:59 +0200 Olivier Crete + + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst/vaapi/gstvaapidecode.c: + vaapidecode: Check the condition after taking the lock + Otherwise the condition could become true before the lock + is taken and the g_cond_signal() could be called + before the g_cond_wait(), so the g_cond_wait() is never + awoken. + https://bugzilla.gnome.org/show_bug.cgi?id=740645 + +2015-02-04 11:18:29 +0200 Sreerenj Balachandran + + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapiencode_jpeg.c: + * gst/vaapi/gstvaapiencode_jpeg.h: + plugins: Add JPEG encoder element + +2015-02-04 11:17:58 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapicontext.c: + gstvaapicontext: Add VAConfigAttribValEncJPEG to the attribute list using for VAConfig creation. + +2015-02-04 11:17:27 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapicontext.c: + gstvaapicontext: Don't use the unsupported Ratecontrol attributes for vaCreateConfig + Don't add the VAConfigAttribRateControl to the attribute list using + for the vaCreateConfig if it is not supported by the driver. + +2015-02-04 11:17:06 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + gstvaapiencoder: Use hardcoded packed_raw_data flag for JPEG Encoding + +2015-02-04 11:16:37 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + gstvaapiencoder: Fix crash when handling rate control mask + Having a ratecontrol_mask equal to zero is not a bug, but the driver + might not be supporting any kind of rate control mechanisms. + Eg: JPEG Encoding + +2015-02-04 11:16:05 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiencoder_jpeg.c: + * gst-libs/gst/vaapi/gstvaapiencoder_jpeg.h: + encoder: Add JPEG Encoder + +2015-02-04 11:15:38 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_objects.c: + * gst-libs/gst/vaapi/gstvaapiencoder_objects.h: + encoder_objects: Add QuantizationMatrix and JPEGHuffmanTable + +2015-02-04 11:15:00 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapiprofile.h: + Encode: Add support for Picture level Entrypoint + This is useful for JPEG encoding which is utilizing picture level + entrypoint instead of slice level entrypoint like h264,mpeg2 etc. + +2015-02-04 11:14:15 +0200 Sreerenj Balachandran + + * configure.ac: + configure: Add Check for JPEG encoding API + +2015-02-03 13:08:53 +0200 Sreerenj Balachandran + + * AUTHORS: + AUTHORS: Updates + +2015-02-03 13:08:01 +0200 Sreerenj Balachandran + + * configure.ac: + Bump version for development. + +=== release 0.5.10 === + +2015-02-03 10:00:42 +0200 Sreerenj Balachandran + + * configure.ac: + 0.5.10 + +2015-02-03 10:00:23 +0200 Sreerenj Balachandran + + * NEWS: + NEWS: Updates + +2015-02-02 11:43:58 +0200 Sreerenj Balachandran + + * gst/vaapi/gstvaapivideometa_texture.c: + Fix compilation error if there is no GL/gl.h header file installed + +2015-01-28 18:09:40 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.h: + plugins: drop leftover declaration. + GstVaapiVideoMemory quark is not needed any more, and the actual + implementation was already removed bfore the merge. i.e. this is + an oversight for a hunk that was not meant to be pushed. + +2015-01-26 18:30:47 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapivideobufferpool.c: + * gst/vaapi/gstvaapivideobufferpool.h: + * gst/vaapi/gstvaapivideomemory.c: + * gst/vaapi/gstvaapivideomemory.h: + plugins: add support for dma_buf exports (v4l2src). + Allow v4l2src element to connected to vaapipostproc or vaapisink when + "io-mode" is set to "dmabuf-import". In practice, this is a more likely + operational mode with uvcvideo. Supporting v4lsrc with "io-mode" set + to "dmabuf" could work, but with more demanding driver or kernel reqs. + Note: with GStreamer 1.4, v4l2src (gst-plugins-good) needs to be built + with --without-libv4l2. + https://bugzilla.gnome.org/show_bug.cgi?id=743635 + +2014-01-23 05:00:09 -0500 Wind Yuan + + * configure.ac: + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapipluginbase.c: + plugins: add support for dma_buf imports. + Allow imports of v4l2 buffers into VA surfaces for further operation + with vaapi plugins, e.g. vaapipostproc or vaapiencode_* elements. + https://bugzilla.gnome.org/show_bug.cgi?id=735362 + [fixed memory leaks, ported to new dma_buf infrastructure, cleanups] + Signed-off-by: Gwenole Beauchesne + +2014-09-15 15:27:50 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurface_drm.c: + * gst-libs/gst/vaapi/gstvaapisurface_drm.h: + surface: add support for GEM buffer imports. + Add support for GEM buffer imports. This is useful for VA/EGL interop + with legacy Mesa implementations, or when it is desired or required to + support outbound textures for instance. + https://bugzilla.gnome.org/show_bug.cgi?id=736718 + +2014-09-15 15:25:09 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurface_drm.c: + * gst-libs/gst/vaapi/gstvaapisurface_drm.h: + surface: add support for dma_buf imports. + Add new gst_vaapi_surface_new_with_dma_buf_handle() helper function + to allow for creating VA surfaces from a foreign DRM PRIME fd. The + resulting VA surface owns the supplied buffer handle. + https://bugzilla.gnome.org/show_bug.cgi?id=735362 + +2015-01-27 11:19:58 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapisurface_priv.h: + surface: add initial support for foreign buffer imports. + Add gst_vaapi_surface_new_from_buffer_proxy() helper function to + create a VA surface from an external buffer provided throug the + new GstVaapiBufferProxy object. + +2014-09-15 13:47:53 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapibufferproxy.c: + * gst-libs/gst/vaapi/gstvaapibufferproxy.h: + * gst-libs/gst/vaapi/gstvaapisurface_drm.c: + * gst-libs/gst/vaapi/gstvaapisurface_drm.h: + surface: add support for GEM buffer exports. + Add support for GEM buffer exports. This will only work with VA drivers + based off libdrm, e.g. the Intel HD Graphics VA driver. This is needed + to support interop with EGL and the "Desktop" GL specification. Indeed, + the EXT_image_dma_buf_import extension is not going to be supported in + Desktop GL, due to the lack of support for GL_TEXTURE_EXTERNAL_OES targets + there. + This is useful for implementing VA/EGL interop with legacy Mesa stacks, + in Desktop OpenGL context. + https://bugzilla.gnome.org/show_bug.cgi?id=736717 + +2014-09-15 11:48:05 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapibufferproxy.c: + * gst-libs/gst/vaapi/gstvaapibufferproxy.h: + * gst-libs/gst/vaapi/gstvaapisurface_drm.c: + * gst-libs/gst/vaapi/gstvaapisurface_drm.h: + surface: add support for dma_buf exports. + Use the new VA buffer export APIs to allow for a VA surface to be + exposed as a plain PRIME fd. This is in view to simplifying interop + with EGL or OpenCL for instance. + https://bugzilla.gnome.org/show_bug.cgi?id=735364 + +2014-09-15 10:58:51 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapibufferproxy.c: + * gst-libs/gst/vaapi/gstvaapibufferproxy.h: + * gst-libs/gst/vaapi/gstvaapibufferproxy_priv.h: + Add abstraction for exported VA buffers. + The VA buffer export APIs work for a particular lifetime starting from + vaAcquireBufferHandle() and ending with vaReleaseBufferHandle(). As such, + it could be much more convenient to support implicit releases by simply + having a refcount reaching zero. + https://bugzilla.gnome.org/show_bug.cgi?id=736721 + +2015-01-28 18:25:09 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/Makefile.am: + Add missing header file to Makefile + Add gstvaapitexture_glx.h to Makefile.am + +2015-01-27 11:44:12 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.h: + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapiuploader.c: + * gst/vaapi/gstvaapivideobufferpool.c: + * gst/vaapi/gstvaapivideomemory.c: + * gst/vaapi/gstvaapivideomemory.h: + * tests/test-surfaces.c: + videopool: add optional flags for surface pool allocation. + Reword surface pool allocation helpers so that to allow for a simple + form, e.g. gst_vaapi_surface_pool_new(format, width, height); and a + somewhat more elaborated/flexible form with optional allocation flags + and precise GstVideoInfo specification. + This is an API/ABI change, and SONAME version needs to be bumped. + +2015-01-26 23:21:56 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + * gst-libs/gst/vaapi/gstvaapiimagepool.h: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.h: + * gst-libs/gst/vaapi/gstvaapivideopool.c: + * gst-libs/gst/vaapi/gstvaapivideopool.h: + * gst-libs/gst/vaapi/gstvaapivideopool_priv.h: + videopool: re-indent all GstVaapiVideoPool related source code. + +2014-12-10 20:13:21 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + window: add toplevel display indirection for visualid and colormap. + Add GstVaapiDisplay::get_{visual_id,colormap}() helpers to help determine + the best suitable window visual id and colormap. This is an indirection in + view to supporting EGL and custom/generic replacements. + +2014-12-10 19:58:10 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_priv.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11_priv.h: + window: add toplevel API to determine the colormap. + Add GstVaapiWindowClass::get_colormap() hook to help determine the + currently active colormap bound to the supplied window, or actually + create it if it does not already exist yet. + +2014-12-10 19:36:12 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiutils_x11.c: + * gst-libs/gst/vaapi/gstvaapiutils_x11.h: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_priv.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11_priv.h: + window: add toplevel API to determine a visual id. + Add GstVaapiWindowClass::get_visual_id() function hook to help find + the best suitable visual id for the supplied window. While doing so, + also simplify the process by which an X11 window is created with a + desired Visual, i.e. now use a visual id instead of a Visual object. + +2014-12-10 18:12:24 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay_drm.c: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_drm.c: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_priv.h: + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + window: add generic helper to create windows. + Add a new generic helper function gst_vaapi_window_new() to create + a window without having the caller to check for the display type + himself. i.e. internally, there is now a GstVaapiDisplayClass hook + to create windows, and the actual backend implementation fills it in. + Add new generic helper functions gst_vaapi_texture_new_wrapped() + This is a simplification in view to supporting EGL. + +2014-12-03 11:39:24 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst/vaapi/gstvaapivideometa_texture.c: + display: add utility function to check for OpenGL rendering. + Add gst_vaapi_display_has_opengl() helper function to help determining + whether the display can support OpenGL context to be bound to it, i.e. + if the class is of type GST_VAAPI_DISPLAY_TYPE_GLX. + +2014-12-10 18:02:55 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_drm.c: + * gst-libs/gst/vaapi/gstvaapidisplay_drm_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapidisplay_glx_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11_priv.h: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapivideobuffer.c: + * gst/vaapi/gstvaapivideometa_texture.c: + display: refine the meaning of display type. + Make gst_vaapi_display_get_display_type() return the actual VA display + type. Conversely, add a gst_vaapi_display_get_class_type() function to + return the type of the GstVaapiDisplay instance. The former is used to + identify the display server onto which the application is running, and + the latter to identify the original object class. + +2014-12-02 11:23:29 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_drm.c: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + display: cosmetics (helper macros, new internal API names). + Add more helper macros to the top-level GstVaapiDisplay interfaces. + Rename a few others used internally for improved consistency. + +2014-12-01 17:08:29 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapiobject_priv.h: + * gst-libs/gst/vaapi/gstvaapipixmap_x11.c: + * gst-libs/gst/vaapi/gstvaapitexture_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + display: record native display object. + Record the underlying native display instance into the toplevel + GstVaapiDisplay object. This is useful for fast lookups to the + underlying native display, e.g. for creating an EGL display. + +2014-12-01 16:54:32 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplaycache.c: + * gst-libs/gst/vaapi/gstvaapidisplaycache.h: + display: use a recursive mutex for the display cache. + Use a recursive mutex for the display cache so that a 3rdparty display + object could be initialized during the initialization of the parent + display. + +2014-12-04 14:36:35 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapitexture.h: + * gst-libs/gst/vaapi/gstvaapitexture_glx.c: + * gst-libs/gst/vaapi/gstvaapitexture_priv.h: + texture: add generic helper to create textures. + Add new generic helper functions gst_vaapi_texture_new_wrapped() + and gst_vaapi_texture_new() to create a texture without having + the caller to uselessly check for the display type himself. i.e. + internally, there is now a GstVaapiDisplayClass hook to create + textures, and the actual backend implementation fills it in. + This is a simplification in view to supporting EGL. + +2014-10-23 17:44:23 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapitexture.h: + * gst-libs/gst/vaapi/gstvaapitexture_glx.c: + * gst-libs/gst/vaapi/gstvaapitexture_glx.h: + * gst-libs/gst/vaapi/gstvaapitexture_priv.h: + * gst/vaapi/gstvaapivideoconverter_glx.c: + * gst/vaapi/gstvaapivideometa_texture.c: + * tests/test-textures.c: + texture: move to core libgstvaapi base library. + GstVaapiTexture is a generic abstraction that could be moved to the + core libgstvaapi library. While doing this, no extra dependency needs + to be added. This means that a GstVaapitextureClass is now available + for any specific code that needs to be added, e.g. creation of the + underlying GL texture objects, or backend dependent ways to upload + a surface to the texture object. + Generic OpenGL data types (GLuint, GLenum) are also replaced with a + plain guint. + https://bugzilla.gnome.org/show_bug.cgi?id=736715 + +2014-10-23 13:11:54 +0200 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapicompat.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapitexture.c: + texture: drop support for VA/GLX interfaces. + The VA/GLX interfaces are obsolete. They used to exist for XvBA, and + ease of use, but they had other caveats to deal with. It's now better + to move on to legacy mode, whereby VA/GLX interop is two be provided + through (i) X11 Pixmap, and (ii) other modern means of buffer sharing. + https://bugzilla.gnome.org/show_bug.cgi?id=736711 + +2014-10-23 11:56:31 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapitexture.h: + * gst/vaapi/gstvaapivideoconverter_glx.c: + * gst/vaapi/gstvaapivideometa_texture.c: + * tests/test-textures.c: + texture: add support for cropping rectangle during transfer. + The gst_vaapi_texture_put_surface() function is missing a crop_rect + argument that would be used during transfer for cropping the source + surface to the desired dimensions. + Note: from a user point-of-view, he should create the GstVaapiTexture + object with the cropped size. That's the default behaviour in software + decoding pipelines that we need to cope with. + This is an API/ABI change, and SONAME version needs to be bumped. + https://bugzilla.gnome.org/show_bug.cgi?id=736712 + +2014-10-23 11:22:10 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapitexture.h: + texture: re-indent all GstVaapiTexture related source code. + +2015-01-27 11:16:34 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + surface: add more fine-grained allocation helper. + Add new gst_vaapi_surface_new_full() helper function that allocates + VA surface from a GstVideoInfo template in argument. Additional flags + may include ways to + - allocate linear storage (GST_VAAPI_SURFACE_ALLOC_FLAG_LINEAR_STORAGE) ; + - allocate with fixed strides (GST_VAPI_SURFACE_ALLOC_FLAG_FIXED_STRIDES) ; + - allocate with fixed offsets (GST_VAAPI_SURFACE_ALLOC_FLAG_FIXED_OFFSETS). + +2014-09-15 14:57:57 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapisurface_priv.h: + surface: re-indent all GstVaapiSurface related source code. + +2015-01-23 16:44:34 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + surfaceproxy: add helper to create a wrapped surface object. + Add new gst_vaapi_surface_proxy_new() helper to wrap a surface into + a proxy. The main use case for that is to convey additional information + at the proxy level that would not be suitable to the plain surface. + +2015-01-23 16:37:06 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy_priv.h: + surfaceproxy: re-indent all GstVaapiSurfaceProxy related source code. + +2015-01-27 18:02:56 +0100 Gwenole Beauchesne + + * configure.ac: + libs: bump library major version. + +2014-12-04 14:36:35 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapitypes.h: + libs: re-introduce a GST_VAAPI_ID_INVALID value. + Re-introduce a GST_VAAPI_ID_INVALID value that represents + a non-zero and invalid id. This is useful to have a value + that is still invalid for cases where zero could actually + be a valid value. + +2014-12-02 16:51:20 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiminiobject.c: + * gst-libs/gst/vaapi/gstvaapiminiobject.h: + libs: expose GstVaapiMiniObject APIs to all backends. + Make it possible to have all libgstvaapi backends (libs) access to a + common GstVaapiMiniObject API and implementation. This is a minor step + towards full exposure when needed, but restrict it to libgstvaapi at + this time. + +2014-12-02 14:15:49 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiminiobject.c: + * gst-libs/gst/vaapi/gstvaapiminiobject.h: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapiobject.h: + * gst-libs/gst/vaapi/gstvaapiobject_priv.h: + libs: re-indent all GstVaapiObject related source code. + Re-indent and provide additional minor cosmetical changes to the + GstVaapiMiniObject and GstVaapiObject source files. + +2015-01-27 16:25:21 +0200 Simon Farnsworth + + * gst/vaapi/gstvaapipluginutil.c: + pluginutil: Fix clearing of subtitle overlay + dvbsuboverlay signals no subtitles present by not setting + GstVideoOverlayCompositionMeta on a buffer. + Detect this, and remove subtitles whenever we have no overlay composition to + hand. + Signed-off-by: Simon Farnsworth + +2015-01-27 16:06:02 +0200 Michael Olbrich + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: clear state on stop + Otherwise restarting may fail because the state of vaapipluginbase and + vaapipostproc don't match. e.g. gst_vaapipostproc_set_caps() will skip + initailization and not call gst_vaapi_plugin_base_set_caps() + +2015-01-27 14:50:12 +0200 Michael Olbrich + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: don't print an error message for GST_FLOW_FLUSHING + +2015-01-27 12:38:45 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + gstvaapiencoder: Fix the negotiation issue with _ENCODED format handling + Don't error out for the video format GST_VIDEO_FORMAT_ENCODED with in gstvaapiencoder, + since the vaaapi context creation (gstvaapicontext.c) can still use the + default chroma type which is YUV420. + https://bugzilla.gnome.org/show_bug.cgi?id=743567 + https://bugzilla.gnome.org/show_bug.cgi?id=743035 + +2015-01-21 18:31:22 +0200 Sreerenj Balachandran + + * patches/videoparsers/0003-h264parse-add-initial-support-for-MVC-NAL-units.patch: + * patches/videoparsers/series.frag: + h264parse: drop patches merged upstream. + 0003-h264parse-add-initial-support-for-MVC-NAL-units.patch + +2015-01-21 18:26:12 +0200 Sreerenj Balachandran + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit d3b5c1b + 8194cac: h264parse: parse SPS subset + 64b7f52: h264parse: expose stereo-high profile + 774360a: h264parse: add initial support for MVC NAL units + 258478f: h264parser: fix stack smashing + +2015-01-19 11:30:12 +0200 Sreerenj Balachandran + + * gst/vaapi/gstvaapivideometa_texture.c: + Fix compilation error if there is no GL/gl.h header file installed + +2015-01-15 16:23:24 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: commit updated srcpad caps to base plugin. + Make sure that the GstVaapiPluginBase instance receives the new src + pad caps whenever they get updated from within the GstVaapiDecoder + decode routines. + This also ensures that downstream elements receive correctly sized + SW decoded buffers if needed. + https://bugs.tizen.org/jira/browse/TC-114 + +2015-01-15 16:19:59 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: always reset decoder on ::set_format(). + Split GstVideoDecoder::set_format() handler to first update the sink + pad caps and reset the active VA decoder instance based on those, and + then update the src pad caps whenever possible, e.g. when the caps + specify a valid video resolution. + +2015-01-15 16:14:13 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + vaapivideomemory: don't crash when trying to allocate 0x0 images. + In some occasions, a buffer pool is created for pre-initialization + purposes regardless of whether a valid image size is available or + not. However, during actual decode stage, the vaapidecode element + is expected to update the srcpad caps with the new dimensions, thus + also triggering a reset of the underlying bufferpool. + +2015-01-15 00:00:16 +0200 Sreerenj Balachandran + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit 191cb2f + 347605a: h264parse: expose compatible profiles to downstream + d1ea97e: h264parse: Fix periodic SPS/PPS sending work after a seek + 24a3126: Revert "h264parse: expose compatible profiles to downstream" + 8661740: h264parse: expose compatible profiles to downstream + 8b7ef3f: codecparsers: fix some compiler warnings + +2014-11-27 12:11:03 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: Fix the period between I/P frames + If the key-frame period is set as one, then ip_period shuld be zero + https://bugzilla.gnome.org/show_bug.cgi?id=734992 + +2014-11-27 11:21:03 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: Provide intra_idr_period value for VAEncSequenceParameterBufferH264 + https://bugzilla.gnome.org/show_bug.cgi?id=734993 + +2014-11-27 11:14:50 +0200 Sreerenj Balachandran + + * gst/vaapi/gstvaapisink.c: + vaapisink: Protect the X11 API invokations with proper locking + https://bugzilla.gnome.org/show_bug.cgi?id=739808 + +2014-11-27 11:13:20 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: fix pixel-aspect-ratio in encoded stream. + Really report sample aspect ratio (SAR) as present, and make it match + what we have obtained from the user as pixel-aspect-ratio (PAR). i.e. + really make sure VUI parameter aspect_ratio_info_present_flag is set + to TRUE and that the indication from aspect_ratio_idc is Extended_SAR. + This is a leftover from git commit a12662f. + https://bugzilla.gnome.org/show_bug.cgi?id=740360 + +2014-11-25 11:46:12 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + decoder: mpeg4: fix uninitialized variables. + Fix gst_vaapi_decoder_mpeg4_parse() to initialize the packet type to + GST_MPEG4_USER_DATA so that a parse error would result in skipping + that packet. Also fix gst_vaapi_decoder_mpeg4_decode_codec_data() to + initialize status to GST_VAAPI_DECODER_STATUS_SUCCESS. + +2014-11-25 11:41:49 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: fix profile limits. + Fix ensure_profile_limits() to lower profile to the desired limits, + only if the latter are actually known and the profile needed to be + changed to fit. + +2014-11-24 15:14:37 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: fix out caps for GLMemory. + If the best downstream capsfeature turns out to be GLMemory, then make + sure to propagate RGBA video format in caps to that element. This fixes + the following pipeline: ... ! vaapipostproc ! glimagesink. + +2014-11-24 14:25:33 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: fix check for compatible src pad capsfilters. + When an explicit output video format is selected, from an src pad + capsfilter, make sure that the downstream element actually supports + that format. In particular, fix crash with the following pipelines: + ... ! vaapipostproc ! video/x-raw,format=XXX ! xvimagesink ; where + XXX is a format not supported by xvimagesink. + While doing so, also reduce the set of src pad filter caps to the + actual set of allowed src pad caps. + +2014-11-24 14:10:11 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + * gst/vaapi/gstvaapiuploader.c: + * gst/vaapi/gstvaapiuploader.h: + plugins: re-indent all video processing related source code. + +2014-11-24 13:20:33 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + plugins: further fixes to the new "current" storage tracker. + The ensure_surface() and ensure_image() functions shall only relate + to the underlying backing store. The actual current flags are to be + updated only through ensure_{surface,image}_is_current() or very other + particular cases in GstMemory hooks. + +2014-11-21 15:43:35 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + plugins: fix "current" video memory flags. + If the surface proxy is updated into the GstVaapiVideoMemory, then + it is assumed it is the most current representation of the current + video frame. Likewise, make a few more arrangements to have the + "current " flags set more consistently. + +2014-11-21 15:23:13 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + * gst/vaapi/gstvaapivideomemory.h: + * gst/vaapi/gstvaapivideometa.c: + plugins: ensure VA surface is current prior to using it. + When interacting with SW elements, the buffers and underlying video + memory could be mapped as read/write. However, we need to use those + buffers again as plain VA surfaces, we have to make sure the VA image + is thus committed back to VA surface memory. + This fixes pipelines involving avdec_* and vaapi{postproc,sink}. + +2013-07-12 06:34:15 -0400 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapivideomemory.c: + plugins: enable memory maps for read & write. + Hence vaapisink can display buffers decoded by gst-libav, or HW decoded + buffers can be further processed in-place, e.g. with a textoverlay. + https://bugzilla.gnome.org/show_bug.cgi?id=704078 + [ported to current git master branch, amended commit message] + Signed-off-by: Gwenole Beauchesne + +2014-11-18 14:57:02 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapipostproc.c: + plugins: preserve framerate when updating src caps video format. + In the current implementation, gst_video_info_set_format() would reset + the whole GstVideoInfo structure first, prior to setting video format + and size. So, coleteral information like framerate or pixel-aspect- + ratio are lost. + Provide and use a unique gst_video_info_change_format() for overcome + this issue, i.e. only have it change the format and video size, and + copy over the rest of the fields. + https://bugzilla.gnome.org/show_bug.cgi?id=734665 + +2014-11-18 14:07:57 +0200 Sreerenj Balachandran + + * gst/vaapi/gstvaapi.c: + vaapidecode: increase the rank to GST_RANK_PRIMARY + 1 + This is for helping decodebin to autoplug the vaapidecode element. + Decodebin is selecting decoder elements only based on rank and caps. + Without overriding the autoplug-* signals there is no way to autoplug + HW decoders inside decodebin. An easier soulution is to raise the + rank of vaapidecode, so that it gets selected first. + https://bugzilla.gnome.org/show_bug.cgi?id=739332 + +2014-11-12 07:46:53 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst/vaapi/gstvaapidecode.c: + vaapidecode: only expose supported profiles when needed. + JPEG and VP8 codecs do not really support the concept of "profile". So, + don't try to expose any set that wouldn't be supported by jpegparse, or + ivfparse for instance. + https://bugzilla.gnome.org/show_bug.cgi?id=739713 + https://bugzilla.gnome.org/show_bug.cgi?id=739714 + +2014-11-13 15:13:24 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + decoder: h264: add initial support for repeat-first-field (RFF) flag. + Use the SEI pic_timing() message to track and propagate down the repeat + first field (RFF) flag. This is only initial support as there is one + other condition that could induce the RFF flag, which is not handled + yet. + +2014-11-13 15:05:19 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix picture ordering count type 0 with previous MMCO5. + Fix the decoding process for picture order count type 0 when the previous + picture had a memory_management_control_operation = 5. In particular, fix + the actual variable type for prev_pic_structure to hold the full bits of + the picture structure. + In practice, this used to work though, due to the underlying type used to + express a gboolean. + +2014-11-13 15:00:21 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix detection of top-field-first (TFF) flag. + Use the SEI pic_timing() message to track the pic_struct variable when + present, or infer it from the regular slice header flags field_pic_flag + and bottom_field_flag. This fixes temporal sequence ordering when the + output pictures are to be displayed. + https://bugzilla.gnome.org/show_bug.cgi?id=739291 + +2014-11-14 09:54:02 +0100 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit 3d05d9f. + 1241840 h264: fix derivation of MaxPicNum variable + 3bd718e h264: fix GstH264ParserResult documentation typo + b021609 h264parse: set the HEADER flag on buffers containing SPS or PPS + b08e4be h264parse: don't unnecesarily set src_caps + +2014-11-03 19:20:43 +0200 Sreerenj Balachandran + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: Add string representation of VPP functions to ElementFactoy Klass + Added the same Klass specifications used in other upstream + video postprocessing elements like videoconvert, videoscale, + videobalance and deinterlace. + An example use case is for this is to help the playsink + to autoplug the hardware accelerated deinterlacer. + +2014-11-03 19:19:20 +0200 Sreerenj Balachandran + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: Tweak the output video format setting to enable the autoplugging + This is a workaround until auto-plugging is fixed when + format=ENCODED + memory:VASurface caps feature are provided. + Use the downstream negotiated video format as the output video format + if the user didn't ask for the colorspace conversion explicitly. + Usecase: This will help to connect elements like videoscale, videorate etc + to vaapipostproc. + https://bugzilla.gnome.org/show_bug.cgi?id=739443 + +2014-10-29 17:30:30 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + vaapipostproc: allow user defined scaling mode. + Add new "scale-method" property to expose the scaling mode to use during + video processing. Note that this is only a hint, and the actual behaviour + may differ from implementation (VA driver) to implementation. + +2014-10-29 16:57:12 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst-libs/gst/vaapi/gstvaapifilter.h: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + filter: add initial support for high quality scaling. + Add support for video scaling options in VPP pipelines. Only the + DEFAULT mode is bound to exist. Others might be folded into that + mode. + +2014-10-29 16:35:46 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst-libs/gst/vaapi/gstvaapifilter.h: + filter: re-indent all GstVaapiFilter related source code. + +2014-10-29 15:45:50 +0100 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit f9d3bde. + 2218b02 h264parse: expose parsed profile and level to downstream + 3dbfab4 h264parse: return flushing if we get chained while being set to READY + d40fa8b h264: fix frame packing SEI parsing + 32d40be h264: Use proper bit_reader api while parsing buffering_period SEI + b3e022e h264: initialize some fields of pic_timing structure + a70661d vc1: fix expected level in sequence-layer parsing unit test + 6cee88d vc1: fix level values for simple/main profile + 356c189 vc1: add unit test for sequence-layer parsing + ab9f641 vc1: take care of endianness when parsing sequence-layer + 8dc8e35 mpeg4: fix vlc table used for sprite trajectory + +2014-10-29 15:46:47 +0200 Sreerenj Balachandran + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: Expose the supported profiles as caps to upstream + This will allows the playbin to fallback to Software Decoder + if the Hardware Decoder does not support a particular profile. + https://bugzilla.gnome.org/show_bug.cgi?id=730997 + +2014-10-29 15:46:12 +0200 Sreerenj Balachandran + + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode.h: + * gst/vaapi/gstvaapiencode_h264.c: + encode: Attach the codec-data to out caps only based on negotiated caps + Attach the codec_data to out_caps only if downstream needed. + For eg: h264 encoder doesn't need to stuff codec_data to the + src caps if the negotiated caps has a stream format of byte-stream. + https://bugzilla.gnome.org/show_bug.cgi?id=734902 + +2014-10-29 15:45:44 +0200 Sreerenj Balachandran + + * configure.ac: + configure: echoing installation prefix path + +2014-09-24 10:14:24 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay_drm.c: + display: add support for DRM Render-Nodes. + Add support for DRM Render-Nodes. This is a new feature that appeared + in kernel 3.12 for experimentation purposes, but was later declared + stable enough in kernel 3.15 for getting enabled by default. + This allows headless usages without authentication at all, i.e. usages + through plain ssh connections is possible. + +2014-09-24 13:44:43 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: clean-ups (indentation, drop unused variables). + +2014-09-24 13:39:55 +0200 Gwenole Beauchesne + + * configure.ac: + * gst/vaapi/gstvaapisink.c: + vaapisink: fix GstNavigation "key-press" / "key-release" events. + Fix arguments to XkbKeycodeToKeysym() for converting an X11 keycode + to a KeySym. In particular, there is no such Window argument. Also + make sure to check for, and use, the correct header + where that new function is defined. Otherwise, default to the older + XKeycodeToKeysym() function. + +2014-09-24 13:23:17 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: fix GstNavigation "mouse-move" event. + Really use the motion event coordinates to propagate the "mouse-move" + event to upper layer, instead of those from a button event. Those are + technically the same though. + +2014-09-16 14:25:40 +0300 Sreerenj Balachandran + + * gst/vaapi/gstvaapisink.c: + vaapisink: implement the GstNavigation interface + This is useful for things like DVD menus, where key/mouse events + would need to be forwarded from the upstream sink element. + https://bugzilla.gnome.org/show_bug.cgi?id=711479 + +2014-03-13 18:38:33 +0000 Simon Farnsworth + + * gst/vaapi/gstvaapipluginbase.c: + vaapipostproc: fix deinterlacing from non VA memory buffers. + When we copy a buffer because we're moving it into VA-API memory, we + need to copy flags. Otherwise, interlaced YUV buffers from a capture + source (e.g. V4L2) don't get flagged as interlaced. + https://bugzilla.gnome.org/show_bug.cgi?id=726270 + Signed-off-by: Simon Farnsworth + [reversed order of gst_buffer_copy_into() flags to match <1.0 code] + Signed-off-by: Gwenole Beauchesne + +2014-08-22 15:22:32 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: add support for GLTextureUploadMeta output. + This allows for vaapipostproc to be chained to the glimagesink element + for instance. + https://bugzilla.gnome.org/show_bug.cgi?id=735231 + +2014-08-22 15:22:32 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: add support for "download" capability. + Allow implicit conversions to raw video formats, while still keeping + VA surfaces underneath. This allows for chaining the vaapipostproc + element to a software-only element that takes care of maps/unmaps. + e.g. xvimagesink. + https://bugzilla.gnome.org/show_bug.cgi?id=720174 + +2014-08-22 18:10:54 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + vaapipostproc: use pooled vaapi video meta. + Use pooled GstVaapiVideoMeta information, i.e. always allocate that on + video buffer allocation. Also optimize copy of additional metadata info + into the resulting video buffer: only copy the video cropping info and + the source surface proxy. + https://bugzilla.gnome.org/show_bug.cgi?id=720311 + Signed-off-by: Sreerenj Balachandran + [fixed proxy leak, fixed double free on error, optimized meta copy] + Signed-off-by: Gwenole Beauchesne + +2014-08-22 15:17:29 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: fix passthrough mode. + If no explicit output surface format is supplied try to keep the one + supplied through the sink pad caps. This avoids a useless copy, even + if things are kept in GPU memory. + This is a performance regression from git commit dfa70b9. + +2014-07-05 21:00:34 +0300 Sreerenj Balachandran + + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + vaapipostproc: fix output buffer to have a GstVaapiVideoMemory. + https://bugzilla.gnome.org/show_bug.cgi?id=720311 + [used new infrastructure through base decide_allocation() impl] + Signed-off-by: Gwenole Beauchesne + +2014-08-22 11:13:36 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: enable advanced deinterlacing with same format. + If only advanced deinterlacing is requested, i.e. deinterlacing is + the only active algorithm to apply with source and output surface + formats being the same, then make sure to enable VPP processing. + Otherwise, allow fallback to bob-deinterlacing with simple rendering + flags alteration. + +2014-08-21 15:04:20 +0300 Sreerenj Balachandran + + * gst/vaapi/gstvaapivideomemory.c: + vaapivideomemory: avoid NULL pointer unref if GstVaapiImage creation failed. + https://bugzilla.gnome.org/show_bug.cgi?id=735156 + +2014-08-22 13:25:03 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginutil.c: + plugins: fix memory leaks. + +2014-08-21 14:10:36 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginbase.h: + plugins: factor out decide_allocation() hook. + Add a default decide_allocation() hook to GstVaapiPluginBase. The caps + feature argument can be used to force a bufferpool with a specific kind + of memory. + +2014-08-21 11:12:39 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideobufferpool.c: + * gst/vaapi/gstvaapivideobufferpool.h: + * gst/vaapi/gstvaapivideomemory.c: + plugins: allow bufferpool to not allocate vaapi video meta. + Add GST_VAAPI_VIDEO_BUFFER_POOL_ACQUIRE_FLAG_NO_ALLOC params flag that + can be used to disable early allocations of vaapi video metas on buffers, + thus delagating that to the bufferpool user. + +2014-08-21 10:45:31 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideobuffer.c: + * gst/vaapi/gstvaapivideobuffer.h: + * gst/vaapi/gstvaapivideobufferpool.c: + * gst/vaapi/gstvaapivideobufferpool.h: + * gst/vaapi/gstvaapivideocontext.c: + * gst/vaapi/gstvaapivideocontext.h: + * gst/vaapi/gstvaapivideoconverter_glx.c: + * gst/vaapi/gstvaapivideoconverter_glx.h: + * gst/vaapi/gstvaapivideoconverter_x11.c: + * gst/vaapi/gstvaapivideoconverter_x11.h: + * gst/vaapi/gstvaapivideomemory.c: + * gst/vaapi/gstvaapivideomemory.h: + * gst/vaapi/gstvaapivideometa.c: + * gst/vaapi/gstvaapivideometa.h: + * gst/vaapi/gstvaapivideometa_texture.c: + * gst/vaapi/gstvaapivideometa_texture.h: + plugins: re-indent all GstVaapiVideo* related source code. + +2014-08-22 15:12:46 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + surfaceproxy: fix copy to propagate view_id. + Fix gst_vaapi_surface_proxy_copy() to copy the view-id element, thus + fixing random frames skipped when vaapipostproc element is used in + passthrough mode. In that mode, GstMemory is copied, thus including + the underlying GstVaapiVideoMeta and associated GstVaapiSurfaceProxy. + +2014-08-20 16:38:45 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: fix detection of output surface format changes. + Default to I420 format for output surfaces so that to match the usual + GStreamer pipelines. Though, internally, we could still opt for NV12 + surface formats, i.e. default format=ENCODED is a hint for that, thus + delegating the decision to the VA driver. + +2014-08-20 10:59:53 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: fix construction of allowed sink pad caps. + Fix construction of the set of caps allowed on the sink pad to filter + out unsupported raw video caps with GStreamer >= 1.2. + +2014-08-20 10:37:02 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + vaapipostproc: improve heuristics for detecting native VA surfaces. + Use the new gst_caps_has_vaapi_surface() helper function to detect + whether the sink pad caps contain native VA surfaces, or not, i.e. + no raw video caps. + Also rename is_raw_yuv to get_va_surfaces to make the variable more + explicit as we just want a way to differentiate raw video caps from + VA surfaces actually. + +2014-08-12 18:33:25 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: disable discontinuity detection code. + The "discontinuity" tracking code, whereby lost frames are tentatively + detected, is inoperant if the sink pad buffer timestamps are not right + to begin with. + This is a temporary workaround until the following bug is fixed: + https://bugzilla.gnome.org/show_bug.cgi?id=734386 + +2014-08-07 14:57:26 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: fix heuristic for detecting discontinuity. + In order to make the discontinuity detection code useful, we need to + detect the lost frames in the history as early as the previous frame. + This is because some VA implementations only support one reference + frame for advanced deinterlacing. + In practice, turn the condition for detecting new frame that is beyond + the previous frame from field_duration*2 to field_duration*3, i.e. + nothing received for the past frame and a half because of possible + rounding errors when calculating the field-duration either in this + element (vaapipostproc), or from the upstream element (parser element). + This is a regression introduced with commit faefd62. + https://bugzilla.gnome.org/show_bug.cgi?id=734135 + +2014-08-20 11:43:08 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginbase.h: + plugins: fix detection of raw video caps. + Use the new gst_caps_has_vaapi_surface() helper function to better + detect raw video caps, and in particular those from RGB colorspace. + https://bugzilla.gnome.org/show_bug.cgi?id=734665 + +2014-08-20 11:30:41 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + plugins: add helper for detecting VA surfaces in caps. + Introduce new gst_caps_has_vaapi_surface() helper function to detect + whether the supplied caps has VA surfaces. With GStreamer >= 1.2, this + implies a check for memory:VASurface caps features, and format=ENCODED + for earlier versions of GStreamer. + +2014-08-12 13:01:57 +0300 Sebastian Dröge + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: start the decoder task again after finishing + This allows the element to accept data again after draining without + a hard reset or caps change happening in between. + https://bugzilla.gnome.org/show_bug.cgi?id=734616 + +2014-08-12 13:00:03 +0300 Sebastian Dröge + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: unlock condition variables before shutting down the element + Otherwise threads might wait for them, causing the shutdown of the element + to deadlock on the streaming thread. + https://bugzilla.gnome.org/show_bug.cgi?id=734616 + +2014-08-11 17:15:24 +0300 Sebastian Dröge + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: reset decoder_finish variable after stopping the decoder thread + Otherwise the element is not usable again after draining/EOS. + https://bugzilla.gnome.org/show_bug.cgi?id=734616 + +2014-08-11 17:14:53 +0300 Sebastian Dröge + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: don't try flushing the decoder instance if we didn't create one yet + This otherwise results in unnecessary error messages. + https://bugzilla.gnome.org/show_bug.cgi?id=734616 + +2014-08-01 06:32:32 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst/vaapi/Makefile.am: + build: fix with --no-undefined linker flags. + https://bugzilla.gnome.org/show_bug.cgi?id=729352 + +2014-01-23 15:44:09 +0000 Changzhi Wei + + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + vaapisink: add support for GstColorBalance interface. + https://bugzilla.gnome.org/show_bug.cgi?id=722390 + [fixed channel names, simplified range factor, fixed memory leak] + Signed-off-by: Gwenole Beauchesne + +2014-01-23 15:23:00 +0000 Changzhi Wei + + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + vaapisink: add support for colorbalance adjustment. + https://bugzilla.gnome.org/show_bug.cgi?id=722390 + [fixed and simplified tracking of colorbalance value changes] + Signed-off-by: Gwenole Beauchesne + +2014-07-31 13:18:21 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: improve installation of properties. + Simplify the creation and installation process of properties, by first + accumulating them into a g_properties[] array, and next calling into + g_object_class_install_properties(). + Also add missing docs and flags to some properties. + +2014-07-31 10:48:15 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + vaapisink: code clean-ups. + Move code around in a more logical way. Introduce GST_VAAPISINK_CAST() + helper macro and use it wherever we know the object is a GstBaseSink or + any base class. Drop explicit initializers for values that have defaults + set to zero. + +2014-07-31 10:37:57 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + vaapisink: re-indent all GstVaapiSink related source code. + +2014-07-30 17:27:50 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + vaapisink: introduce separate backends. + Introduce new backends vtable so that to have clean separation between + display dependent code and common base code. That's a "soft" separation, + we don't really need dedicated objects. + https://bugzilla.gnome.org/show_bug.cgi?id=722248 + +2014-07-30 16:47:20 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + vaapisink: drop unused "synchronous" mode. + Support for X11 "synchronous" mode was never implemented, and was only + to be useful for debugging. Drop that altogether, that's not going to + be useful in practice. + https://bugzilla.gnome.org/show_bug.cgi?id=733985 + +2014-07-30 17:32:29 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + vaapisink: drop unused variables. + Drop obsolete, and now unused, video_buffer_pool and video_buffer_size + variables. They got merged into the GstVaapiPluginBase object. + +2014-07-30 16:35:32 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + vaapisink: drop GLX rendering and fancy effects. + Rendering with GLX in vaapisink is kind of useless nowadays, including + OpenGL related fancy effects. Plain VA/GLX interfaces are also getting + deprecated in favor of EGL, or more direct buffer sharing with actual + GL textures. + Should testing of interop with GLX be needed, one could still be using + the modern cluttersink or glimagesink elements. + https://bugzilla.gnome.org/show_bug.cgi?id=733984 + +2013-11-05 14:01:11 +0100 Holger Kaelberer + + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + vaapisink: listen to window size changes on X11. + Allow dynamic changes to the window, e.g. performed by the user, and + make sure to refresh its contents, while preserving aspect ratio. + In practice, Expose and ConfigureNotify events are tracked in X11 + display mode by default. This occurs in a separte event thread, and + this is similar to what xvimagesink does. Any of those events will + trigger a reconfiguration of the window "soft" size, subsequently + the render-rect when necessary, and finally _expose() the result. + The default of handle_events=true can be changed programatically via + gst_x_overlay_handle_events(). + Thanks to Fabrice Bellet for rebasing the patch. + https://bugzilla.gnome.org/show_bug.cgi?id=711478 + [dropped XInitThreads(), cleaned up the code a little] + Signed-off-by: Gwenole Beauchesne + +2014-07-29 15:47:46 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: decode and output all pending frames on normal EOS. + The gst_vaapidecode_decode_loop() function is called within a separate + task to fetch and output all frames that were decoded so far. So, if + the decoder_loop_status is forcibly set to EOS when _finish() is called, + then we are bound to exist the task without submitting the pending + frames. + If the downstream element error'ed out, then the gst_pad_push() would + propagate up an error and so we will get it right for cutting off + _finish() early in that case. + This is a regression from 6003596. + https://bugzilla.gnome.org/show_bug.cgi?id=733897 + +2014-07-29 13:24:52 +0200 Gwenole Beauchesne + + * configure.ac: + Bump version for development. + +2014-07-29 10:31:58 +0200 Gwenole Beauchesne + + * AUTHORS: + AUTHORS: updates. + +2014-07-29 10:31:15 +0200 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2014-07-29 16:22:01 +1000 Matthew Waters + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: properly return from decode loop on downstream errors. + Fixes a hang/race on shutdown where _decode_loop() had already completed + its execution and _finish() was waiting on a GCond for decode_loop() + to complete. Also fixes the possible race where _finish() is called + but _decode_loop() endlessly returns before signalling completion + iff the decoder instance returns GST_FLOW_OK. + Found with: ... ! vaapidecode ! {glimagesink,cluttersink} + https://bugzilla.gnome.org/show_bug.cgi?id=733897 + [factored out GST_VIDEO_DECODER_STREAM_UNLOCK() call] + Signed-off-by: Gwenole Beauchesne + +2014-07-28 18:45:49 +0200 Gwenole Beauchesne + + * NEWS: + * configure.ac: + 0.5.9. + +2014-07-28 18:31:09 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: fix GstVideoOverlay::expose() implementation. + Now that we always track the currently active video buffer, it is + not necessary to automatically increase its reference since this is + implicitly performed in ::show_frame() through the get_input_buffer() + helper from GstVaapiPluginBase class. + This is a regression from a26df80. + +2014-07-28 18:00:19 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapipluginutil.c: + vaapidecode: simplify bufferpool configuration. + Rework the logics behind the configuration of an adequate bufferpool, + especially when OpenGL meta or additional capsfeatures are needed. + Besides, for GStreamer >= 1.4, the first capsfeatures that gets matched, + and that is not system memory, is now selected by default. + +2014-07-28 16:43:47 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: fix auto-plugging of vaapisink element. + Make sure to propagate memory:VASurface capsfeature to srcpad caps + only for GStreamer >= 1.5 as the plug-in elements in GStreamer 1.4 + core currently miss additional patches available in 1.5-git (1.6). + This is a temporary workaround. + +2014-07-28 15:54:46 +0300 Sreerenj Balachandran + + * configure.ac: + configure: allow builds against GStreamer git (1.5.x). + https://bugzilla.gnome.org/show_bug.cgi?id=733688 + +2014-07-28 14:20:33 +0200 Gwenole Beauchesne + + * configure.ac: + configure: fix build with GStreamer 1.4.0 release. + +2014-03-04 19:40:59 +0100 Gwenole Beauchesne + + * configure.ac: + * debian.upstream/Makefile.am: + * debian.upstream/control.in: + debian: fix packaging for new naming scheme. + +2014-07-28 11:52:06 +0200 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2014-07-28 11:39:11 +0200 Gwenole Beauchesne + + * configure.ac: + configure: mark support for GStreamer < 1.2 as deprecated. + Supporting anything thing below GStreamer 1.2 is asking for trouble + for keeping up with the required facilities to make efficient pipelines. + Users are invited to upgrade to the very latest GStreamer 1.2.x release, + at the minimum. + +2014-07-28 11:35:24 +0200 Gwenole Beauchesne + + * configure.ac: + configure: mark support for GStreamer 0.10 as obsolete. + Support for GStreamer 0.10 is obsolete. i.e. it is no longer supported + and may actually be removed altogether for a future release. There is + no real point to maintain a build for such an ancient GStreamer version + that is not even supported upstream. + +2014-07-28 10:25:26 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + vaapisink: allow a specific view component to be displayed. + If a multiview stream is decoded, multiple view components are submitted + as is downstream. It is the responsibility of the sink element to display + the required view components. By default, always select the frame buffer + that matches the view-id of the very first frame to be displayed. + However, introduce a "view-id" property to allow the selection of a + specific view component of interest to display. + +2014-07-28 10:09:34 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: always keep the last displayed buffer around. + Always record the VA surface that is currently being rendered, no matter + the fact we are using texturedblit or overlay. That's because in some + occasions, we need to refresh or resize the displayed contents based on + new events. e.g. user-resized window. + Besides, it's simpler to track the last video buffer in GstVaapiSink than + through the base sink "last-sample". + +2014-07-25 11:13:29 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginbase.h: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapisink.c: + vaapisink: add support for "display-name" property. + Add a "display-name" property to vaapisink so that the end user could + select the desired output. Keep "display-name" in-line with the existing + "display" (GstVaapiDisplayXXX type). + So, for X11 or GLX, the "display-name" is the usual display name as we + know for XOpenDisplay(); for Wayland, the "display-name" is the name used + for wl_display_connect(); and for DRM, the "display-name" is actually the + DRI device name. + https://bugzilla.gnome.org/show_bug.cgi?id=722247 + +2014-07-25 17:29:40 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + window: make gst_vaapi_window_reconfigure() thread-safe. + Ensure the X11 implementation for GstVaapiWindow::get_geometry() is + thread-safe by default, so that upper layer users don't need to handle + that explicitly. + +2013-07-29 09:28:28 +0200 Holger Kaelberer + + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + window: allow for updating size from current geometry. + Add gst_vaapi_window_reconfigure() interface to force an update of + the GstVaapiWindow "soft" size, based on the current geometry of the + underlying native window. + This can be useful for instance to synchronize the window size when + the user changed it. + Thanks to Fabrice Bellet for rebasing the patch. + [changed interface to gst_vaapi_window_reconfigure()] + Signed-off-by: Gwenole Beauchesne + +2014-07-25 16:53:41 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_drm.c: + * gst-libs/gst/vaapi/gstvaapiwindow_drm.h: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.h: + * gst-libs/gst/vaapi/gstvaapiwindow_priv.h: + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11_priv.h: + window: re-indent all GstVaapiWindow related source code. + +2014-07-25 11:24:39 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + display: add interface to retrieve the display name. + Add gst_vaapi_display_get_display_name() helper function to determine + the name associated with the underlying native display. Note that for + raw DRM backends, the display name is actually the device path. + +2014-07-25 10:55:53 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + display: fix comparison of X11 display names. + Make sure to not only compare display host names, but also the actual + display number. The screen number does not need to be checked at this + time. + +2014-07-25 15:52:06 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapivideobufferpool.c: + vaapidecode: add support for VideoAlignment bufferpool option. + Always add VideoAlignment bufferpool option if the downstream element + expects its own pool to be used but does not offer it through a proper + propose_allocation() implementation for instance, and that the ALLOCATION + query does not expose the availability of the Video Meta API. + This fixes propagation of video buffer stride information to Firefox. + +2014-07-25 15:44:58 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + vaapivideomemory: always prefer native VA surface formats. + Make sure to always prefer native internal formats for the VA surfaces + that get allocated. Also disable "direct-rendering" mode in this case. + This is needed so that to make sure that anything that gets out of the + decoder, or anything that gets into the encoder, is in native format + for the hardware, and thus the driver doesn't need to perform implicit + conversions in there. Interop with SW elements is still available with + fast implementations of VA imaging APIs. + +2014-07-24 11:58:29 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + vaapivideomemory: disallow memory shares across buffers, use a copy. + Forbid shares of GstMemory instances, and rather make copy of it. This + effectively copies the GstMemory structure and enclosed metadata, but + this does not copy the VA surface contents itself. It should though. + This fixes preroll and makes sure to not download garbage for the first + frame when a SW rendering sink is used. + +2014-07-24 06:46:22 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + * gst/vaapi/gstvaapivideomemory.h: + vaapivideomemory: use an image pool to cache objects. + Use an image pool to hold VA images to be used for downloads/uploads + of contents for the associated surface. + This is an optmization for size. So, instead of creating as many VA + images as there are buffers (then VA surfaces) allocated, we only + maintain a minimal set of live VA images, thus preserving memory + resources. + +2014-07-24 00:14:04 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + vaapivideomemory: forbid R/W mappings if non direct-rendering mode. + Disable read-write mappings if "direct-rendering" is not supported. + Since the ordering of read and write operations is not specified, + this would require to always download the VA surface on _map(), then + commit the temporary VA image back to the VA surface on _unmap(). + Some SW decoding plug-in elements still use R/W mappings though. + https://bugzilla.gnome.org/show_bug.cgi?id=733242 + +2014-07-23 23:49:53 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + vaapivideomemory: minor code clean-ups. + Fix error messages introduced in the previous commit for the _map() + imaplementation. Also use the new get_image_data() helper function + to determine the base pixels data buffer from a GstVaapiImage when + updating the video info structure from it. + +2014-07-23 18:54:13 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + * gst/vaapi/gstvaapivideomemory.h: + vaapivideomemory: add support for raw pixels mappings. + Allow raw pixels of the whole frame to be mapped read-only. i.e. in + cases where the buffer pool is allocated without VideoMeta API, thus + individual planes cannot be mapped. + This is initial support for Firefox >= 30. + https://bugzilla.gnome.org/show_bug.cgi?id=731886 + +2014-07-03 18:41:11 +0300 Sreerenj Balachandran + + * gst/vaapi/gstvaapivideomemory.c: + vaapivideomemory: fix determination of the surface pool format. + While creating the vaapi video allocator, make sure the associated + surface pool has correct format instead of defaulting to NV12 video + format even though there is no direct rendering support. + https://bugzilla.gnome.org/show_bug.cgi?id=732691 + +2014-07-23 18:01:21 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + vaapivideomemory: fix association of surface to proxy. + Make sure to always update the VA surface pointer whenever the proxy + changes. This used to only work when the VA surface is written to, in + interop with SW element ("upload" feature), and this now fixes cases + when the VA surface is needed for reading, in interop with SW element + ("download" feature). + +2014-07-23 10:23:06 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapivideomemory.c: + plugins: expose I420 format for interop with SW elements. + Always expose I420 format by default when the VA surface could be + mapped for interoperability with non harware accelerated elements. + However, the default behaviour remains the auto-plugging of vaapi + elements, down to the sink. + Side effect: "direct-rendering" mode is also disabled most of the + times as plain memcpy() from uncached speculative write combining + memory is not going to be efficient enough. + +2014-07-22 18:54:29 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapivideomemory.c: + plugins: allow download capability to vaapidecode element. + Fix support for VA surface download capability in vaapidecode element + for GStreamer >= 1.2. This is a fix to supporting libva-vdpau-driver, + but also the libva-intel-driver while performing hardware accelerated + conversions from the native VA surface format (NV12) to the desired + output VA image format. + For instance, this fixes pipelines involving vaapidecode ! xvimagesink. + https://bugzilla.gnome.org/show_bug.cgi?id=733243 + +2014-07-17 01:51:36 +0200 Fabrice Bellet + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + decoder: mpeg4: fix picture decoder return value for skipped frames. + The picture decoder should return GST_VAAPI_DECODER_STATUS_DROP_FRAME + when a frame should be skipped, so the stream processing is not stalled. + https://bugzilla.gnome.org/show_bug.cgi?id=733324 + +2014-07-04 15:13:32 +1000 Jan Schmidt + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + decoder: mpeg2: respect any input PTS provided for a frame. + The timestamp generator in gstvaapidecoder_mpeg2.c always interpolated + frame timestamps within a GOP, even when it's been fed input PTS for + every frame. + That leads to incorrect output timestamps in some situations - for example + live playback where input timestamps have been scaled based on arrival time + from the network and don't exactly match the framerate. + https://bugzilla.gnome.org/show_bug.cgi?id=732719 + +2014-01-22 08:20:59 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiobject.c: + GstVaapiObject: make gst_vaapi_object_new() more robust. + Forbid GstVaapiObject to be created without an associated klass spec. + It is mandatory that the subclass implements an adequate .finalize() + hook, so it shall provide a valid GstVaapiObjectClass. + https://bugzilla.gnome.org/show_bug.cgi?id=722757 + [made non-NULL klass argument to gst_vaapi_object_new() a requirement] + Signed-off-by: Gwenole Beauchesne + +2014-01-21 15:43:57 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiobject.c: + GstVaapiObject: initialize the derived object data with init() hook. + Call the subclass .init() function in gst_vaapi_object_new(), if + needed. The default behaviour is to zero initialize the subclass + object data, then the .init() function can be used to initialize + fields to non-default values, e.g. VA object ids to VA_INVALID_ID. + Also fix the gst_vaapi_object_new() description, which was merely + copied from GstVaapiMiniObject. + https://bugzilla.gnome.org/show_bug.cgi?id=722757 + [changed to always zero initialize the subclass] + Signed-off-by: Gwenole Beauchesne + +2014-06-13 21:45:04 +0100 Lionel Landwerlin + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: make decoder work with playbin + When playbin/decodebin builds the pipeline, it puts decoders and sinks + into different bins and forwards the queries from bins to bins. So in + the initials steps the pipeline is built iteratively by playbin and + looks like this : + [filesrc] + [filesrc] -> [typefind] + [filesrc] -> [typefind] -> [demuxer] + [filesrc] -> [typefind] -> [demuxer] -> [decoder] + At this point the decoder is asked for its SRC caps and it will make a + choice based on what gst_pad_peer_query_caps() returns. The problem is + that the caps returns at that point includes caps features like ANY, + essentially because playbin can plug in additional elements like + videoscale, videoconv or deinterlace. + This patch adds a another call to + gst_vaapi_find_preferred_caps_feature() when the decoder decides its + allocation, to make sure we asks the downstream elements when the + entire pipeline has been built. + https://bugzilla.gnome.org/show_bug.cgi?id=731645 + +2014-06-27 11:57:11 +0100 Simon Farnsworth + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: don't let tmp_rect go out of scope. + A compiler change showed me that tmp_rect went out of scope before + it was used. Move it to the beginning of the function instead. + https://bugzilla.gnome.org/show_bug.cgi?id=726363 + Signed-off-by: Simon Farnsworth + [added guards for GStreamer 0.10 builds] + Signed-off-by: Gwenole Beauchesne + +2014-07-03 22:44:40 +0200 Gwenole Beauchesne + + * AUTHORS: + AUTHORS: updates. + +2014-07-03 22:34:35 +0200 Gwenole Beauchesne + + * README: + README: updates. + Drop references to deprecated plugins (vaapiupload, vaapidownload), + mention that support for GStreamer 0.10 is deprecated, make overview + more descriptive in certain aspects. + +2014-07-03 22:21:39 +0200 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2014-07-03 19:42:02 +0200 Gwenole Beauchesne + + * README: + * configure.ac: + build: mention that support for GStreamer 0.10 is deprecated. + +2014-07-03 17:17:00 +0200 Gwenole Beauchesne + + * configure.ac: + * gst/vaapi/gstvaapidecode.c: + build: fix for GStreamer 0.10. + +2014-07-03 18:01:09 +0200 Gwenole Beauchesne + + * patches/videoparsers/0002-h264parse-fix-build-with-GStreamer-1.2.patch: + * patches/videoparsers/0002-h264parse-fix-build-with-older-GStreamer-1.x-stacks.patch: + * patches/videoparsers/series.frag: + build: fix for GStreamer 1.0.x. + +2014-07-03 13:48:48 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: detect incorrectly paired fields in frames. + When a DPB flush is required, e.g. at a natural and of stream or issued + explicitly through an IDR, try to detect any frame left in the DPB that + is interlaced but does not contain two decoded fields. In that case, mark + the picture as having a single field only. + This avoids a hang while decoding tv_cut.mkv. + +2014-07-03 11:13:33 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: simplify the DPB output process. + Simplify the dpb_output() function to exclusively rely on the frame store + buffer to output, since this is now always provided. Besides, also fix + cases where split fields would not be displayed. + This is a regression from f48b1e0. + +2014-07-01 17:20:44 +0200 Gwenole Beauchesne + + * patches/videoparsers/0003-h264parse-fix-and-optimize-NAL-collection-function.patch: + * patches/videoparsers/0005-h264parse-introduce-new-state-tracking-variables.patch: + * patches/videoparsers/0006-h264parse-improve-conditions-for-skipping-NAL-units.patch: + * patches/videoparsers/0007-h264parse-fix-collection-of-access-units-to-preserve.patch: + * patches/videoparsers/series.frag: + h264parse: drop patches merged upstream. + 0003-h264parse-fix-and-optimize-NAL-collection-function.patch + 0005-h264parse-introduce-new-state-tracking-variables.patch + 0006-h264parse-improve-conditions-for-skipping-NAL-units.patch + 0007-h264parse-fix-collection-of-access-units-to-preserve.patch + +2014-07-01 17:18:08 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix memory leak in PPS. + Cope with latest changes from codecparsers/h264. It is now required + to explicitly clear the GstH264PPS structure as it could contain + additional allocations (slice_group_ids). + +2014-07-01 17:13:56 +0200 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit 2d53b69. + c4ace00 h264parse: fix collection of access units to preserve config headers + 0f9f7c9 h264parse: improve conditions for skipping NAL units + 9ffb25c h264parse: introduce new state tracking variables + 64955d3 h264parse: fix and optimize NAL collection function + 13cd2a3 h264: clarifications and documentation fixes + 53e7dd1 h264: fix identification of EOSEQ and EOS NALs + 18f0de0 h264: fix memory leak in GstH264PPS + fdcb54c h264: fix typo in GstH264VUIParams description + fd4dae9 vp8: move up built-in range decoder private data + +2014-06-30 19:01:35 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy_priv.h: + decoder: propagate MVC metadata ("view-id", head of multiview set). + Add new GstVaapiSurfaceProxy flag FFB, which means "first frame in + bundle", and really expresses the first view component of a multi + view coded frame. e.g. in H.264 MVC, the surface proxy has flag FFB + set if VOIdx = 0. + Likewise, new API is exposed to retrieve the associated "view-id". + +2014-06-30 18:46:45 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + decoder: propagate "one-field" flags. + Allow decoders to set the "one-field" attribute when the decoded frame + genuinely has a single field, or if the second field was mis-decoded but + we still want to display the first field. + +2014-06-30 18:34:45 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + decoder: output decoded frames only once. + Make sure to output the decoded picture, and push the associated + GstVideoCodecFrame, only once. The frame fully represents what needs + to be output, included for interlaced streams. Otherwise, the base + GstVideoDecoder class would release the frame twice. + Anyway, the general process is to output decoded frames only when + they are complete. By complete, we mean a full frame was decoded or + both fields of a frame were decoded. + +2014-06-30 16:12:52 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: decode current picture earlier. + Slightly optimize decoding process by submitting the current VA surface + for decoding earlier to the hardware, and perform the reference picture + marking process and DPB update process afterwards. + This is a minor optimization to let the video decode engine kick in work + earlier, thus improving parallel resources utilization. + +2014-06-30 16:09:17 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix output of second field when first field is not in DPB. + Fix decoding of interlaced streams where a first field (e.g. B-slice) + was immediately output and the current decoded field is to be paired + with that former frame, which is no longer in DPB. + https://bugzilla.gnome.org/show_bug.cgi?id=701340 + +2014-06-30 11:06:29 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: slightly optimize the process to detect new pictures. + Optimize the process to detect new pictures or start of new access + units by checking if the previous NAL unit was the end of a picture, + or the end of the previous access unit. + +2014-06-13 15:42:53 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: handle access unit ("au") optimization. + Optimize parsing when buffers are supplied with access unit alignment. + This helps determining faster when the end of an access unit is reached. + +2014-06-28 07:25:35 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix tracking of DPB size changes. + Add support for MVC streams with multiple SPS and subset SPS headers + emitted regularly, e.g. at around every I-frame. Track the maximum + number of views in ensure_context() and really reset the DPB size to + the expected value, always. i.e. even if it decreased. dpb_reset() + only cares of ensuring the DPB allocation. + +2014-06-27 20:44:24 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix the DPB compaction process. + Fix the compaction process when the DPB is cleared for a specific + view, i.e. fix the process of filling in the holes resulting from + removing frame buffers matching the current picture. + +2014-06-27 16:38:03 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: generate new SPS only when codec config changed. + It is not necessary to periodically send SPS or subset SPS headers. + This is up to the upper layer (e.g. transport layer) to decide on + if/how to periodically submit those. For now, only generate new SPS + or subset SPS headers when the codec config changed. + Note: the upper layer could readily determine the config headers + (SPS/PPS) through the gst_vaapi_encoder_h264_get_codec_data() function. + https://bugzilla.gnome.org/show_bug.cgi?id=732083 + Signed-off-by: Gwenole Beauchesne + +2014-06-27 18:43:27 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: track encoder config changes. + Track and report when encoder configuration changed. For now, this covers + resolution, profile/level and bitrate changes. + +2014-06-27 13:15:13 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: add pixel-aspect-ratio to VUI parameters. + Report sample aspect ratio (SAR) as present, and make it match what + we have obtained from the user as pixel-aspect-ratio (PAR). i.e. the + VUI parameter aspect_ratio_info_present_flag now defaults to TRUE. + +2014-06-27 00:49:34 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: fix number of anchor and non-anchor reference pictures. + Set the value of num_anchor_refs_l0, num_anchor_refs_l1, num_non_anchor_refs_l0, + and num_non_anchor_refs_l1 to zero since the inter-view prediction is not yet + supported. + +2014-06-27 10:37:38 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: fix timing_info_present_flag value in subset SPS. + When the seq_parameter_set_data() syntax structure is present in a subset + sequence parameter set and vui_parameters_present_flag is equal to 1, then + timing_info_present_flag shall be equal to 0 (H.7.4.2.1.1). + +2014-06-26 14:39:52 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: add cpbBrNalFactor values for MVC profiles. + +2014-06-26 14:51:32 +0200 Gwenole Beauchesne + + * patches/videoparsers/0003-h264parse-add-initial-support-for-MVC-NAL-units.patch: + h264parse: fix detection of access unit boundaries for MVC. + The gst_h264_parse_collect_nal() function is a misnomer. In reality, + this function is used to determine access unit boundaries, i.e. that + is the key function for alignment=au output format generation. + +2014-06-26 14:49:53 +0200 Gwenole Beauchesne + + * patches/videoparsers/0007-h264parse-fix-collection-of-access-units-to-preserve.patch: + * patches/videoparsers/series.frag: + h264parse: fix collection of access units to preserve config headers. + Always use a GstAdapter when collecting access units (alignment="au") + in either byte-stream or avcC format. This is required to properly + preserve config headers like SPS and PPS when invalid or broken NAL + units are subsequently parsed. + More precisely, this fixes scenario like: + + where we used to reset the output frame buffer when an invalid or + broken NAL is parsed, i.e. SPS and PPS NAL units were lost, thus + preventing the next slice unit to be decoded, should this also + represent any valid data. + https://bugzilla.gnome.org/show_bug.cgi?id=732203 + +2014-06-26 14:48:08 +0200 Gwenole Beauchesne + + * patches/videoparsers/0003-h264parse-add-initial-support-for-MVC-NAL-units.patch: + * patches/videoparsers/0006-h264parse-improve-conditions-for-skipping-NAL-units.patch: + * patches/videoparsers/series.frag: + h264parse: improve conditions for skipping NAL units. + Carefully track cases when skipping broken or invalid NAL units is + necessary. In particular, always allow NAL units to be processed + and let that gst_h264_parse_process_nal() function decide on whether + the current NAL needs to be dropped or not. + This fixes parsing of streams with SEI NAL buffering_period() message + inserted between SPS and PPS, or SPS-Ext NAL following a traditional + SPS NAL unit, among other cases too. + Practical examples from the H.264 AVC conformance suite include + alphaconformanceG, CVSE2_Sony_B, CVSE3_Sony_H, CVSEFDFT3_Sony_E + when parsing in stream-format=byte-stream,alignment=au mode. + https://bugzilla.gnome.org/show_bug.cgi?id=732203 + +2014-06-26 14:45:34 +0200 Gwenole Beauchesne + + * patches/videoparsers/0003-h264parse-add-initial-support-for-MVC-NAL-units.patch: + * patches/videoparsers/0005-h264parse-introduce-new-state-tracking-variables.patch: + * patches/videoparsers/series.frag: + h264parse: introduce new state tracking variables. + Improve parser state tracking by introducing new flags reflecting + it: "got-sps", "got-pps" and "got-slice". This is an addition for + robustness purposes. + Older have_sps and have_pps variables are kept because they have + a different meaning. i.e. they are used for deciding on when to + submit updated caps or not, and rather mean "have new SPS/PPS to + be submitted?" + +2014-06-26 14:39:30 +0200 Gwenole Beauchesne + + * patches/videoparsers/0004-h264parse-default-to-byte-stream-nalu-format-Annex-B.patch: + * patches/videoparsers/series.frag: + h264parse: default to byte-stream/nalu format (Annex B). + Always default to stream-format=byte-stream,alignment=nalu if avcC + format was not detected. This is the natural stream format specified + in the standard (Annex.B): a series of NAL units prefixed with the + usual start code. + https://bugzilla.gnome.org/show_bug.cgi?id=732167 + +2014-06-26 14:37:58 +0200 Gwenole Beauchesne + + * patches/videoparsers/0003-h264parse-fix-and-optimize-NAL-collection-function.patch: + * patches/videoparsers/series.frag: + h264parse: fix and optimize NAL collection function. + Use gst_h264_parser_identify_nalu_unchecked() to identify the next + NAL unit. We don't want to parse the full NAL unit, but only the + header bytes and possibly the first RBSP byte for identifying the + first_mb_in_slice syntax element. + Also fix check for failure when returning from that function. The + only success condition for that is GST_H264_PARSER_OK, so use it. + https://bugzilla.gnome.org/show_bug.cgi?id=732154 + +2014-06-26 11:39:38 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: fix NAL unit types in packed headers. + Submit Prefix NAL headers (nal_unit_type = 14) before every packed + slice header (nal_unit_type = 1 or 5) only for the base view. In non + base views, a Coded Slice Extension NAL header (nal_unit_type = 20) + is required, with an appropriate nal_unit_header_mvc_extension() in + the NAL header bytes. + https://bugzilla.gnome.org/show_bug.cgi?id=732083 + +2014-06-25 22:05:52 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: add missing field in packed Subset SPS header. + Write the missing num_level_values_signalled_minus1 syntax element + into the packed header for subset sequence parameter set. + https://bugzilla.gnome.org/show_bug.cgi?id=732083 + +2014-06-25 22:26:32 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix marking of non-reference picture into DPB. + Fix search for a picture in the DPB that has a lower POC value than + the current picture. The dpb_find_lowest_poc() function will return + a picture with the lowest POC in DPB and that is marked as "needed + for output", but an additional check against the actual POC value + of the current picture is needed. + This is a regression from 1c46990. + https://bugzilla.gnome.org/show_bug.cgi?id=732130 + +2014-06-19 17:08:47 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix DPB clear when no decoding actually started. + Fix dpb_clear() to clear previous frame buffers only if they actually + exist to begin with. If the decoder bailed out early, e.g. when it + does not support a specific profile, that array of previous frames + might not be allocated beforehand. + +2014-02-06 08:30:10 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.h: + * gst/vaapi/gstvaapidecode.c: + decoder: h264: add support for NALU "alignment" optimization. + We can avoid scanning for start codes again if the bitstream is fed + in NALU chunks. Currently, we always scan for start codes, and keep + track of remaining bits in a GstAdapter, even if, in practice, we + are likely receiving one GstBuffer per NAL unit. i.e. h264parse with + "nal" alignment. + https://bugzilla.gnome.org/show_bug.cgi?id=723284 + [use gst_adapter_available_fast() to determine the top buffer size] + Signed-off-by: Gwenole Beauchesne + +2014-06-18 18:53:51 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix caps to report interlace-mode accordingly. + The `vaapipostproc' element could never determine if the H.264 stream + was interlaced, and thus always assumed it to be progressive. Fix the + H.264 decoder to report interlace-mode accordingly, thus allowing the + vaapipostproc element to automatically enable deinterlacing. + +2014-06-19 13:35:23 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: don't crash with dynamic framerate (0/1). + Avoid reaching an assert if dynamic framerates (0/1) are used. One + way to solve this problem is to just stick field_duration to zero. + However, this means that, in presence of interlaced streams, the + very first field will never be displayed if precise presentation + timestamps are honoured. + https://bugzilla.gnome.org/show_bug.cgi?id=729604 + +2014-02-07 12:27:50 +0000 Simon Farnsworth + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: create filter surface pool if it does not exist yet. + ensure_srcpad_buffer_pool() tries to avoid unnecessarily deleting and + recreating filter_pool. Unfortunately, this also meant it didn't create + it if it did not exist. + Fix it to always create the buffer pool if it does not exist. + https://bugzilla.gnome.org/show_bug.cgi?id=723834 + Signed-off-by: Simon Farnsworth + +2013-12-12 10:01:13 +0800 Zhao, Halley + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: reset deinterlacer state when there is a discontinuity. + Reset deinterlacer state, i.e. past reference frames used for advanced + deinterlacing, when there is some discontinuity detected in the course + of processing source buffers. + This fixes support for advanced deinterlacing when a seek occurred. + https://bugzilla.gnome.org/show_bug.cgi?id=720375 + [fixed type of pts_diff variable, fetch previous buffer PTS from the + history buffer, reduce heuristic for detecting discontinuity] + Signed-off-by: Gwenole Beauchesne + +2014-06-18 16:16:34 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: add support for crop regions in VPP mode. + Apply video cropping regions stored in GstVideoCropMeta, or in older + GstVaapiSurfaceProxy representation, to VPP pipelines. In non-VPP modes, + the crop meta are already propagated to the output buffers. + https://bugzilla.gnome.org/show_bug.cgi?id=720730 + +2014-03-14 17:49:40 +0000 Simon Farnsworth + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: make deinterlace-mode behave as expected. + deinterlace-mode didn't behave in the way you'd expect if you have + past experience of the deinterlace element. There were two bugs: + 1. "auto" mode wouldn't deinterlace "interleaved" buffers, only "mixed". + 2. "force" mode wouldn't deinterlace "mixed" buffers flagged as progressive. + Fix these up, and add assertions and error messages to detect cases that + aren't handled. + https://bugzilla.gnome.org/show_bug.cgi?id=726361 + Signed-off-by: Simon Farnsworth + Signed-off-by: Gwenole Beauchesne + +2014-01-15 16:36:29 +0000 Matthieu Bouron + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: do not discard video info props when the format changed. + gst_video_info_set_format() does not preserve video info properties. In + order to keep important information in the caps such as interlace mode, + framerate, pixel aspect ratio, ... we need to manually copy back those + properties after setting the new video format. + https://bugzilla.gnome.org/show_bug.cgi?id=722276 + +2014-02-23 01:43:39 +1100 Matthew Waters + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: plug a memory leak. + It can happen that there is a pool provided that does not advertise + the vappivideometa. We should unref that pool before using our own. + Discovered with vaapidecode ! {glimagesink,cluttersink} + https://bugzilla.gnome.org/show_bug.cgi?id=724957 + [fixed compilation by adding the missing semi-colon] + Signed-off-by: Gwenole Beauchesne + +2014-06-18 13:47:36 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: parse source data until a frame is obtained. + Parse any pending data until a complete frame is obtained. This is a + memory optimization to avoid expansion of video packets stuffed into + the GstAdapter, and a fix to EOS condition to detect there is actually + pending data that needs to be decoded, and subsequently output. + https://bugzilla.gnome.org/show_bug.cgi?id=731831 + +2014-06-05 15:32:29 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: fix multiple slices support in packed headers mode. + Handle packedi slice headers and packed raw data on a per-slice basis, + which is necessary for multi slice encoding. + +2014-06-05 15:30:38 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_objects.c: + * gst-libs/gst/vaapi/gstvaapiencoder_objects.h: + encoder: add infrastructure for per-slice handling of packed headers. + The packed slice header and packed raw data need to be paired with + the submission of VAEncSliceHeaderParameterBuffer. So handle them + on a per-slice basis insted of a per-picture basis. + [removed useless initializer] + Signed-off-by: Gwenole Beauchesne + +2014-03-07 17:40:34 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: fix initialization with "drm" display type. + Force early initializatin of the GstVaapiDisplay so that to make sure + that the sink element display object is presented first to upstream + elements, as it will be correctly featuring the requested display type + by the user. + Otherwise, we might end up in situations where a VA/X11 display is + initialized in vaapidecode, then we try VA/DRM display in vaapisink + (as requested by the "display" property), but this would cause a failure + because we cannot acquire a DRM display that was previously acquired + through another backend (e.g. VA/X11). + +2014-03-07 17:38:14 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginbase.c: + plugins: fix initialization with foreign context. + When a new display is settled through GstElement::set_context() (>= 1.2), + or GstVideoContext::set_context() (<= 1.0), then we shall also update the + associated display type. + +2014-04-28 17:44:03 +0200 Gwenole Beauchesne + + * Makefile.am: + * configure.ac: + * ext/Makefile.am: + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapiparse.c: + * gst/vaapi/gstvaapiparse.h: + * patches/Makefile.am: + * patches/videoparsers/0001-plugins-compile-the-built-in-video-parsers-as-vaapip.patch: + * patches/videoparsers/0002-h264parse-fix-build-with-GStreamer-1.2.patch: + * patches/videoparsers/0003-h264parse-add-initial-support-for-MVC-NAL-units.patch: + * patches/videoparsers/Makefile.am: + * patches/videoparsers/series.frag: + plugins: add built-in video parsers as "vaapiparse" element. + The built-in video parsers elements are built into a single DSO named + libgstvaapi_parse.so. The various video parsers could be accessed as + vaapiparse_CODEC. + For now, this only includes a modified version of h264parse so that to + support H.264 MVC encoded streams. + +2014-06-13 11:36:56 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: cope with new gst_h264_quant_matrix_*() interfaces. + New gst_h264_quant_matrix_*_get_raster_from_zigzag() were renamed + from gst_h264_video_quant_matrix_*_get_raster_from_zigzag(). + +2014-06-13 11:34:07 +0200 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit d6325ac. + 7d8d045 h264parse: use new gst_h264_video_calculate_framerate() + d2f965a h264parse: set field_pic_flag when parsing a slice header + 24c15b8 Import h264parse + a9283e5 bytereader: Use concistant derefence method + a8252c6 bytereader: Use pointer instead of index access + b1bebfc Import GstBitReader and GstByteReader + 2f58788 h264: recognize SVC NAL units + 4335da5 h264: fix SPS copy code for MVC + cf9b6dc h264: fix quantization matrix conversion routine names + b11ce2a h264: add gst_h264_video_calculate_framerate() + 126dc6f add C++ guards for MPEG-4 and VP8 parsers + +2014-06-10 18:30:21 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: factor out DPB pruning for MVC. + Factor out the removal process of unused inter-view only reference + pictures from the DPB, prior to the possible insertion of the current + picture. + Ideally, the compiler could still opt for generating two loops. But + at least, the code is now clearer for maintenance. + +2014-06-10 17:42:58 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: clean-ups. + Fix GST_VAAPI_PICTURE_IS_{INTER_VIEW,ANCHOR}() definitions to use + the base GST_VAAPI_PICTURE_FLAG_IS_SET() macro. + +2014-06-10 16:07:51 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: improve pruning of unused MVC inter-view frames. + Improve process for the removal of pictures from DPB before possible + insertion of the current picture (C.4.4) for H.264 MVC inter-view only + reference components. In particular, handle cases where picture to be + inserted is not the last one of the access unit and if it was already + output and is no longer marked as used for reference, including for + decoding next view components within the same access unit. + +2014-06-03 17:36:38 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: improve DPB bumping process for MVC. + While invoking the DPB bumping process in presence of many views, + it could be necessary to output previous pictures that are ready, + in a whole. i.e. emitting all view components from the very first + view order index zero to the very last one in its original access + unit; and not starting from the view order index of the picture + that caused the DPB bumping process to be invoked. + As a reminder, the maximum number of frames in DPB for MultiView + High profile with more than 2 views is not necessarily a multiple + of the number of views. + This fixes decoding of MVCNV-4.264. + +2014-06-06 17:56:06 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix inter-view references array growth. + Let the utility layer handle dynamic growth of the inter-view pictures + array. By definition, setting a new size to the array will effectively + grow the array, but would also fill in the newly created elements with + empty entries (NULL), thus also increasing the reported length, which + is not correct. + +2014-06-03 17:36:38 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: reduce ReferenceFrames entries to the essential set. + When decoding Multiview High profile streams with a large number of + views, it is not possible to make the VAPictureParameterBufferH264. + ReferenceFrames[] array hold the complete DPB, with all possibly + active pictures to be used for inter-view prediction in the current + access unit. + So reduce the scope of the ReferenceFrames[] array to only include + the set of reference pictures that are going to be used for decoding + the current picture. Basically, this is a union of all RefPicListX[] + array, for all slices constituting the decoded picture. + +2014-06-04 19:10:44 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix MVC inter-view prediction process. + The inter-view reference components and inter-view only reference + components that are included in the reference picture lists shall + be considered as not being marked as "used for short-term reference" + or "used for long-term reference". This means that reference flags + should all be removed from VAPictureH264.flags. + This fixes decoding of MVCNV-2.264. + +2014-06-04 19:03:18 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix detection of profile changes for MVC. + If the VA driver exposes ad-hoc H.264 MVC profiles, then we have to + be careful to detect profiles changes and not reset the underlying + VA context erroneously. In MVC situations, we could indeed get a + profile_idc change for every SPS that gets activated, alternatively + (base-view -> non-base view -> base-view, etc.). + An improved fix would be to characterize the exact profile to use + once and for all when SPS NAL units are parsed. This would also + allow for fallbacks to a base-view decoding only mode. + +2014-06-03 14:30:39 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: drop extraneous definitions. + Re-use definitions from the codecparser headers instead of duplicating + them here again. That covers NALU definitions and slice types. + +2014-04-01 11:26:04 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: remove unnecessary calcualtion of max_pic_order_cnt. + https://bugzilla.gnome.org/show_bug.cgi?id=727418 + +2014-04-01 14:23:56 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: don't allow CABAC with Extended profile. + The H.264 specification does not support CABAC entropy coding for the + Extended profile. + https://bugzilla.gnome.org/show_bug.cgi?id=727418 + +2014-05-07 00:12:39 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: use packed headers mode for MVC encoding. + Exclusively use VA drivers that support raw packed headers for encoding. + i.e. simply submit packed headers Subset SPS and Prefix NAL units. This + provides for better compatibility accross the various VA drivers and HW + generations since no particular API is needed beyond what readily exists. + +2014-05-07 00:09:45 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: add support for packed slice headers. + https://bugzilla.gnome.org/show_bug.cgi?id=722905 + +2014-05-07 00:09:19 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: store subset sps to generate the codec-data + Store the SubsetSPS nal unit which we need for MVC specific + codec_data generation. + +2014-05-07 00:08:33 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: fix MVC pipeline hang while encoding with B-frames. + Since we are encoding each view independently from each other, we + need a higher number of pre-allocated surfaces to be used as the + reconstructed frames. For Stereo High profile encoding, this means + to effectively double the number of frames to be stored in the DPB. + +2014-02-17 15:51:43 +0800 Li Xiaowei + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.h: + * gst-libs/gst/vaapi/gstvaapiutils_h264.c: + * gst/vaapi/gstvaapiencode_h264.c: + encoder: h264: add initial support for H.264 Stereo High profile. + Add initial support for Subset SPS, Prefix NAL and Slice Extension NAL + for non-base-view streams encoding, and the usual SPS, PPS and Slice + NALs for base-view encoding. + The H.264 Stereo High profile encoding mode will be turned on when the + "num-views" parameter is set to 2. The source (raw) YUV frames will be + considered as Left/Right view, alternatively. + Each of the two views has its own frames reordering pool and reference + frames list management system. Inter-view references are not supported + yet, so the views are encoded independently from each other. + Signed-off-by: Li Xiaowei + [limited to Stereo High profile per the definition of MAX_NUM_VIEWS] + Signed-off-by: Gwenole Beauchesne + +2014-02-17 11:10:26 +0800 Li Xiaowei + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: wrap pools for refs and frames reordering. + Create structures to maintain the reference frames list (RefPool) and + frames reordering (ReorderPool) logic. + This is a prerequisite for H.264 MVC support. + Signed-off-by: Li Xiaowei + +2014-02-14 15:33:15 +0800 Li Xiaowei + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: add provisional support for subset SPS headers. + Add provisions to write subset SPS headers to the bitstream in view + to supporting the H.264 MVC specification. + This assumes the libva "staging" branch is in use. + Signed-off-by: Li Xiaowei + +2013-12-18 13:47:32 +0800 Li Xiaowei + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapiutils.c: + utils: add H.264 MVC profiles. + Add "MultiView High" and "Stereo High" definitions. + Signed-off-by: Li Xiaowei + [require VA-API >= 0.35.2 for MVC profiles] + Signed-off-by: Gwenole Beauchesne + +2014-06-02 16:25:03 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapiutils.c: + utils: only enable VP8 profiles for newer VA-API versions. + VP8 decoding API appeared in VA-API >= 0.35.0. So, disable mappings + involving VP8 codec on earlier versions of the API. + +2014-05-22 10:04:46 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: compute view ids only once per slice. + Optimize lookups of view ids / view order indices by caching the result + of the calculatiosn right into the GstVaapiParserInfoH264 struct. This + terribly simplifies is_new_access_unit() and find_first_field() functions. + +2014-05-21 17:57:00 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: add support for MVC interlaced streams. + Fix support for MVC Stereo High profile streams with interlaced frames. + Also improve the detection logic of the first field. + +2014-05-20 18:08:15 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: add MVC profiles compatibility logic. + Add safe fallbacks for MVC profiles: + - all MultiView High profile streams with 2 views at most can be decoded + with a Stereo High profile compliant decoder ; + - all Stereo High profile streams with only progressive views can be + decoded with a MultiView High profile compliant decoder ; + - all drivers that support slice-level decoding could normally support + MVC profiles when the DPB holds at most 16 frames. + +2014-05-02 14:58:45 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + decoder: h264: add initial support for MVC. + https://bugzilla.gnome.org/show_bug.cgi?id=721772 + +2014-05-01 19:16:09 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: dynamically allocate the DPB. + Dynamically allocate the Decoded Picture Buffer (DPB) and add provisions + for supporting the MVC allocation requirements. + +2014-05-01 19:33:40 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix detection of access unit boundaries. + In order to have a stricter conforming implementation, we need to carefully + detect access unit boundaries. Additional operations could be necessary to + perform at those boundaries. + +2013-03-13 11:44:38 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: detect the first VCL NAL unit of a picture for MVC. + Detect the first VCL NAL unit of a picture for MVC, based on the + view_id as per H.7.4.1.2.4. Note that we only need to detect new + view components. + Signed-off-by: Gwenole Beauchesne + +2013-10-31 19:32:55 +0800 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: properly handle Prefix NAL units. + Always cache the previous NAL unit so that we could check whether + there is a Prefix NAL unit immediately preceding the current slice + or IDR NAL unit. In that case, the NAL unit metadata is copied into + the current NAL unit. Otherwise, some default values are inferred, + tentatively. e.g. view_id shall be set to 0 and inter_view_flag to 1. + [infer default values for slice if previous NAL was not a Prefix] + Signed-off-by: Gwenole Beauchesne + +2013-02-28 15:59:55 +0800 Xiaowei Li + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: add support for MVC base views. + Allow decoding for base views of MVC encoded streams. For now, just skip + the slice extension and prefix NAL units, and skip non-base view frames. + Signed-off-by: Xiaowei Li + [fixed memory leak, improved check for MVC NAL units] + Signed-off-by: Gwenole Beauchesne + +2014-05-04 14:49:28 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: simplify storage of decoded picture into DPB. + Factor out process by which the decoded picture with the lowest POC + is found, and possibly output. Likewise, the storage and marking of + a reference decoded, or non-reference decoded picture, into the DPB + could also be simplified as they mostly share the same operations. + +2014-05-02 22:40:16 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: minor clean-ups. + Make init_picture_ref_lists() more consistent with other functions + related to the reference marking process by supplying the current + picture as argument. + +2014-05-20 11:36:40 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + display: add utility function to query VA driver name. + Add gst_vaapi_display_get_vendor_string() helper function to query + the underlying VA driver name. The display object owns the resulting + string, so it shall not be deallocated. + That function is thread-safe. It could be used for debugging purposes, + for instance. + +2014-03-07 14:50:14 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay_drm.c: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplaycache.c: + * gst-libs/gst/vaapi/gstvaapidisplaycache.h: + display: make cache maintenance really MT-safe. + Make sure to initialize one GstVaapiDisplay at a time, even in threaded + environments. This makes sure the display cache is also consistent + during the whole display creation process. In the former implementation, + there were risks that display cache got updated in another thread. + +2014-05-03 15:56:51 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + context: allow dynamic growth of VA surfaces pool. + Add support for dynamic growth of the VA surfaces pool. For decoding, + this implies the recreation of the underlying VA context, as per the + requirement from VA-API. Besides, only increases are supported, not + shrinks. + +2014-05-03 15:47:53 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + context: reset VA context if VA surfaces set changed. + It is a requirement from VA-API specification that the VA context got + from vaCreateContext(), for decoding purposes, binds the supplied set + of VA surfaces. This means that if the set of VA surfaces is to be + changed for the current decode session, then the VA context needs to + be recreated with the new set of VA surfaces. + +2014-05-12 19:23:04 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix assignment of LongTermFrameIdx. + Complement fix committed as e95a42e. + The H.264 AVC standard has to say: if the field is part of a reference + frame or a complementary reference field pair, and the other field of + the same reference frame or complementary reference field pair is also + marked as "used for long-term reference", the reference frame or + complementary reference field pair is also marked as "used for long-term + reference" and assigned LongTermFrameIdx equal to long_term_frame_idx. + This fixes decoding of MR9_BT_B in strict mode. + https://bugs.freedesktop.org/show_bug.cgi?id=64624 + https://bugzilla.gnome.org/show_bug.cgi?id=724518 + +2014-05-10 06:23:29 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + decoder: h264: properly support grayscale formats. + Request the correct chroma format for decoding grayscale streams. + i.e. make lookups of the VA chroma format more generic, thus possibly + supporting more formats in the future. + This means that, if a VA driver doesn't support grayscale formats, + it is now going to fail. We cannot safely assume that maybe grayscale + was implemented on top of some YUV 4:2:0 with the chroma components + all set to 0x80. + +2014-02-06 11:14:09 +0000 Simon Farnsworth + + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst-libs/gst/vaapi/gstvaapifilter.h: + * tests/test-filter.c: + build: fix source file modes. + A few source files are marked executable in error - fix them + https://bugzilla.gnome.org/show_bug.cgi?id=723748 + Signed-off-by: Simon Farnsworth + +2014-04-29 13:22:47 +0300 Sreerenj Balachandran + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidecoder_vp8.c: + * gst/vaapi/gstvaapidecode.c: + build: fix conditional compilation of VP8 decoder. + https://bugzilla.gnome.org/show_bug.cgi?id=729170 + [added check for VASliceParameterBufferBase fields] + Signed-off-by: Gwenole Beauchesne + +2014-04-27 08:55:24 +0200 Gwenole Beauchesne + + * gst-libs/gst/codecparsers/Makefile.am: + build: fix make dist for codecparsers. + +2014-04-28 09:42:13 +0200 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit eaa3f7e. + h264: fix parsing of slice groups for map type = 2 + +2014-04-26 22:35:49 +0200 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi branch commit f44edfc. + h264: fix derivation of default scaling lists + +2013-05-24 19:00:54 +0800 Cong Zhong + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix long-term reference picture marking process. + Fix reference picture marking process with memory_management_control_op + set to 3 and 6, i.e. assign LongTermFrameIdx to a short-term reference + picture, or the current picture. + This fixes decoding of FRExt_MMCO4_Sony_B. + https://bugs.freedesktop.org/show_bug.cgi?id=64624 + https://bugzilla.gnome.org/show_bug.cgi?id=724518 + [squashed, edited to use GST_VAAPI_PICTURE_IS_COMPLETE() macro] + Signed-off-by: Gwenole Beauchesne + +2014-04-26 20:21:46 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix initialization of RefPicLists for multiple slices. + The initialization of reference picture lists (8.2.4.2) applies to all + slices. So, the RefPicList0/1 lists need to be constructed prior to + each slice submission to the HW decoder. + This fixes decoding of video sequences where frames are encoded with + multiple slices of different types, e.g. 4 slices in this order I, P, + I, and P. More precisely, CABAST3_Sony_E and CABASTBR3_Sony_B. + https://bugzilla.gnome.org/show_bug.cgi?id=724518 + +2013-06-04 15:01:46 +0800 Zhong Cong + + * ext/codecparsers: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: skip SPS extension and auxiliary slice NALs. + When NAL units of type 13 (SPS extension) or type 19 (auxiliary slice) + are present in a video, decoders shall perform the (optional) decoding + process specified for these NAL units or shall ignore them (7.4.1). + Implement option 2 (skip) for now, as alpha composition is not + supported yet during the decoding process. + This fixes decoding of the primary coded video in alphaconformanceG. + https://bugzilla.gnome.org/show_bug.cgi?id=703928 + https://bugzilla.gnome.org/show_bug.cgi?id=728869 + https://bugzilla.gnome.org/show_bug.cgi?id=724518 + [skip NAL units earlier, i.e. at parsing time] + Signed-off-by: Gwenole Beauchesne + +2013-03-07 11:32:20 +0800 Li Xiaowei + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix slice data bit offset with MVC NAL units. + When MVC slice NAL units (coded slice extension and prefix NAL) are + present, the number of NAL header bytes is 3, not 1 as usual. + Signed-off-by: Li Xiaowei + Signed-off-by: Gwenole Beauchesne + +2014-04-25 19:11:03 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix activation of picture and sequence parameters. + At the time the first VCL NAL unit of a primary coded picture is found, + and if that NAL unit was parsed to be an SPS or PPS, then the entries + in the parser may have been overriden. This means that, when the picture + is to be decoded, slice_hdr->pps could point to an invalid (the next) + PPS entry. + So, one way to solve this problem is to not use the parser PPS and + SPS info but rather maintain our own activation chain in the decoder. + https://bugzilla.gnome.org/show_bug.cgi?id=724519 + https://bugzilla.gnome.org/show_bug.cgi?id=724518 + +2014-04-25 16:24:01 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: retain SEI messages until the end of frame. + Retain the SEI messages that were parsed from the access unit until we + have completely decoded the current frame. This is done so that we can + peek at that data whenever necessary during decoding. e.g. for exposing + 3D stereoscopic information at a later stage. + +2014-04-25 14:23:11 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: add support for grayscale encoded clips. + Fix support for grayscale encoded video clips, and possibly others if + the underlying driver supports the non-YUV 4:2:0 formats. i.e. defer + the decision that a surface with the desired chroma format is not + supported to the actual VA driver implementation. + https://bugzilla.gnome.org/show_bug.cgi?id=728144 + +2014-04-25 14:16:24 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + * gst-libs/gst/vaapi/gstvaapidecoder_vp8.c: + decoder: default to YUV 4:2:0 VA surfaces. + Cope with context changes to support non-YUV 4:2:0 VA surfaces. Still, + make sure all codecs use YUV 4:2:0 output format for now, by default. + +2014-04-25 13:57:02 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + decoder: re-indent GstVaapiDecoder base object. + +2014-04-25 13:47:53 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + encoder: derive chroma type from video format. + Cope with previous VA context change to derive the correct surface chroma + type from the input video format. + +2014-04-25 13:45:31 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + context: add support for non-YUV 4:2:0 formats. + Don't force allocation of VA surfaces in YUV 4:2:0 format. Rather, allow + for the upper layer to specify the desired chroma type. If the chroma + type field is not set (or yields zero), then YUV 4:2:0 format is used + by default. + +2014-04-22 19:53:50 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vp8.c: + vp8: fix per-segment deblocking filter level in relative mode. + Fix possible bug when a per-segment deblocking filter level value + needs to be set in non-absolute mode, i.e. when the loop filter update + value is negative in delta mode. + Also clamp the resulting filter level value to 0..63 range. + +2014-04-22 17:25:15 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vp8.c: + vp8: fix check for disabling the loop filter (again). + Improve condition to disable the loop filter. The previous heuristic + used to check all filter levels, for all segments. It turns out that + only the base filter_level value defined in the frame header needs + to be checked. + This fixes 00-comprehensive-013. + +2014-04-21 18:02:21 +0200 Gwenole Beauchesne + + * gst-libs/gst/codecparsers/Makefile.am: + * gst/vaapi/Makefile.am: + build: fix make dist with certain conditionals not met. + Fix generation of source tarballs when certain conditionals are not + met. e.g. always include all buildable codecparsers sources in the + distribution tarball, fix plug-in element sources set to include X11 + and encoder bits. + +2014-04-21 17:34:59 +0200 Gwenole Beauchesne + + * ext/Makefile.am: + build: add missing files for GStreamer 0.10. + Add missing GstVideoEncoder implementation files to fix build with ancient + GStreamer 0.10 stack. + https://bugzilla.gnome.org/show_bug.cgi?id=723964 + +2014-04-19 10:17:20 +0200 Gwenole Beauchesne + + * ext/Makefile.am: + build: add missing files for VP8 bitstream parser. + Fix make dist for building the VP8 bitstream parser. + +2014-04-21 17:49:38 +0200 Gwenole Beauchesne + + * configure.ac: + * ext/libvpx/Makefile.am: + * gst-libs/gst/codecparsers/Makefile.am: + vp8: allow compilation without the built-in libvpx. + The built-in libvpx serves multiple purposes, among which the most + important ones could be: track the most up-to-date, and optimized, + range decoder; allow for future hybrid implementations (non-VLD); + and have a completely independent range decoder implementation. + +2014-04-21 17:28:27 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vp8.c: + vp8: propagate PTS from demux frame. + gst_adapter_prev_pts() is forbidden within libgstvaapi. Besides, the demuxer + or parser would already have determined the PTS from a previous stage. + +2014-04-19 07:49:30 +0200 Gwenole Beauchesne + + * Makefile.am: + * debian.upstream/libgstvaapi.install.in: + * ext/libvpx/Makefile.am: + * ext/libvpx/sources.frag: + * gst-libs/gst/codecparsers/Makefile.am: + vp8: fix compilation with built-in libvpx. + Apply correct patch from fd.o #722760 to fix several issues: update the + license terms to LGPLv2.1+, fix dependencies to built-in libvpx and fix + make dist. + +2014-02-13 21:17:23 +0100 Gwenole Beauchesne + + * .gitmodules: + * autogen.sh: + * configure.ac: + * ext/Makefile.am: + * ext/libvpx/Makefile.am: + * ext/libvpx/gstlibvpx.c: + * ext/libvpx/gstlibvpx.h: + * ext/libvpx/libgstcodecparsers_vpx.vers: + * ext/libvpx/sources.frag: + * ext/libvpx/upstream: + * gst-libs/gst/codecparsers/Makefile.am: + * gst-libs/gst/codecparsers/gstvaapilibvpx.c: + vp8: use range decoder from libvpx. + Add libvpx submodule that tracks the upstream version 1.3.0. This is + needed to build a libgstcodecparsers_vpx.so library with all symbols + placed into the GSTREAMER namespace. + +2014-04-04 19:17:17 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vp8.c: + vp8: fix check for disabling the loop filter. + +2013-12-27 07:18:24 +0800 Zhao, Halley + + * configure.ac: + * ext/Makefile.am: + * gst-libs/gst/codecparsers/Makefile.am: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapicodec_objects.c: + * gst-libs/gst/vaapi/gstvaapicodec_objects.h: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + * gst-libs/gst/vaapi/gstvaapidecoder_vp8.c: + * gst-libs/gst/vaapi/gstvaapidecoder_vp8.h: + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapiprofile.h: + * gst/vaapi/gstvaapidecode.c: + Add initial VP8 decoder. + https://bugzilla.gnome.org/show_bug.cgi?id=722761 + [complete overhaul, fixed support for resolution changes] + Signed-off-by: Gwenole Beauchesne + +2014-03-21 15:15:37 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: cope with new gst_h264_parser_parse_sei() interface. + The gst_h264_parse_parse_sei() function now returns an array of SEI + messages, instead of a single SEI message. Reason: it is allowed to + have several SEI messages packed into a single SEI NAL unit, instead + of multiple NAL units. + +2014-04-18 19:36:16 +0200 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit a454f86. + b2eb5f6 vp8: rename dboolhuff symbols + b74a881 vp8: add GStreamer native utilities + 2940ac6 add VP8 bitstream parser + +2014-04-18 19:16:56 +0200 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit d459bc5. + d459bc5 h264: set framerate even for interlaced videos + c78b82c h264: add support for Recovery Point SEI message + 7693bac h264: add support for Frame Packing Arrangement SEI message + 31fafa7 h264: add support for Stereo Video Information SEI message + 8b113a6 h264: parse seq_parameter_set_mvc_extension() + 040f9b8 h264: parse MVC syntax elements + cc18ef3 h264: add nal_reader_skip_long() helper + 7e76a48 h264: fix slice_header() parsing for MVC + caf46d8 h264: add gst_h264_parse_nalu_header() helper + f75074e h264: add gst_h264_parse_sps_data() helper + 798c397 h264: clean-up gst_h264_parser_parse_sei_message() + 4e36737 h264: fix skipping of unsupported SEI messages + 5300766 h264: fix SEI buffering_period() parsing + +2014-03-21 15:09:14 +0100 Gwenole Beauchesne + + * ext/codecparsers: + * gst-libs/gst/codecparsers/Makefile.am: + codecparsers: update to gst-vaapi-branch commit 8fadf40. + 8fadf40 h264: Fix multiple SEI messages in one SEI RBSP parsing. + 644825f h265: remove trailling 0x00 bytes as the spec doesn't allow them + 95f9f0f h264: remove trailling 0x00 bytes as the spec doesn't allow them + 766007b h265: Initialize pointer correctly that is never assigned but freed in error cases + 8ec5816 h265: Fix segfault when parsing HRD parameter + 5b1730f h265: Fix segfault when parsing VPS + 983b7f7 h265: prevent to overrun chroma_weight_l0_flag + 7ba641d h265: Fix debug output + d9f9f9b h264: not all startcodes should have 3-byte 0 prefix + +2014-02-04 18:35:28 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix robustness patch for bytestream format. + Fix parser and decoder state to sync at the right locations. This is + because we could reset the parser state, while the decoder state was + not copied yet, e.g. when parsing several NAL units from multiple frames + whereas the current frame was not decoded yet. + This is a regression brought in by commit 6fe5496. + +2014-02-18 06:56:51 +0100 Gwenole Beauchesne + + * configure.ac: + * pkgconfig/Makefile.am: + * pkgconfig/gstreamer-vaapi-drm.pc.in: + * pkgconfig/gstreamer-vaapi-glx.pc.in: + * pkgconfig/gstreamer-vaapi-wayland.pc.in: + * pkgconfig/gstreamer-vaapi-x11.pc.in: + build: fix pkgconfig file names (again). + It turns out it is more convenient to have only pkgconfig files named + after the installed GStreamer API version (1.0) instead of using all + possible subsequent names from that (1.0, 1.2, 1.4). i.e. they conflict + altogether anyway, so align pkgconfig file names to that. + +2014-02-07 09:43:51 +0100 Gwenole Beauchesne + + * debian.upstream/libgstvaapi-dev.install.in: + * gst-libs/gst/vaapi/Makefile.am: + * pkgconfig/gstreamer-vaapi.pc.in: + build: fix packaging for GStreamer 1.2. + Fix gstreamer-vaapi includedir for GStreamer 1.2 setups. i.e. use + the pkgconfig version (1.0) instead of the intended API version (1.2). + libgstvaapi1.0-dev and libgstvaapi1.2-dev packages will now conflict, + as would core GStreamer 1.0 and GStreamer 1.2 dev packages anyway. + +2014-01-24 11:27:30 +0100 Gwenole Beauchesne + + * configure.ac: + Bump version for development. + +2014-01-24 10:55:39 +0100 Gwenole Beauchesne + + * debian.upstream/control.in: + debian: fix trailing whitespace in description. + +2014-01-23 23:24:55 +0100 Gwenole Beauchesne + + * debian.upstream/control.in: + * debian.upstream/copyright: + debian: fix package description. + Try to improve package description for the compiled plug-in elements + available in there. e.g. only display vaapidownload and vaapiupload + for GStreamer 0.10 builds, display vaapiencode_* elements when VA + encoding is enabled, etc. + Also increase the copyright notice date. + +2014-01-23 22:47:19 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + build: fix warnings on 64-bit platforms. + +2014-01-23 22:44:09 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapiutils.c: + build: fix for older versions of VA-API (< 0.34.0). + Fix build with older versions of VA-API (< 0.34.0), or versions without + good enough headers for encoding support for instance. + +2014-01-23 19:36:14 +0100 Gwenole Beauchesne + + * NEWS: + * configure.ac: + 0.5.8. + +2014-01-23 19:32:28 +0100 Gwenole Beauchesne + + * README: + README: updates. + VA-API up to 0.34.0 is actually supported. Mention new video encoding + support. Update copyright years, list of supported Intel HD Graphics + hardware. + +2014-01-23 19:18:13 +0100 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2014-01-20 14:16:56 +0100 Gwenole Beauchesne + + * tests/test-filter.c: + tests: test-filter: fix "deinterlace" option parse. + Default to GST_VAAPI_DEINTERLACE_METHOD_NONE if no "deinterlace" option + string was provided, i.e. if it remained set to NULL. + +2014-01-23 18:41:24 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiutils_core.c: + * gst-libs/gst/vaapi/gstvaapiutils_core.h: + libs: factor out usages of vaGetConfigAttributes(). + Add gst_vaapi_get_config_attribute() helper function that takes a + GstVaapiDisplay and the rest of the arguments with VA types. The aim + is to have thread-safe VA helpers by default. + +2014-01-23 17:41:02 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + * gst-libs/gst/vaapi/gstvaapiutils_h264.c: + * gst-libs/gst/vaapi/gstvaapiutils_h264.h: + * gst-libs/gst/vaapi/gstvaapiutils_h264_priv.h: + * gst-libs/gst/vaapi/gstvaapiutils_mpeg2.h: + * gst-libs/gst/vaapi/gstvaapiutils_mpeg2_priv.h: + * gst-libs/gst/vaapi/gstvaapiutils_x11.c: + * gst-libs/gst/vaapi/gstvaapiutils_x11.h: + libs: re-indent all source code related to VA utilities. + +2014-01-23 17:06:08 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/libgstvaapi_priv_check.h: + libs: add missing file (libgstvaapi_priv_check.h). + +2014-01-23 15:13:06 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiencoder_priv.h: + encoder: notify the encoder of the submitted packed headers. + Make sure to configure the encoder with the set of packed headers we + intend to generate and submit. i.e. make selection of packed headers + to submit more robust. + +2014-01-23 15:10:11 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiencoder_priv.h: + encoder: fix and factor out check for supported rate-control modes. + Cache the first compatible GstVaapiProfile found if the encoder is not + configured yet. Next, factor out the code to check for the supported + rate-control modes by moving out vaGetConfigAttributes() to a separate + function, while also making sure that the attribute type is actually + supported by the encoder. + Also fix the default set of supported rate control modes to not the + "none" variant. It's totally useless to expose it at this point. + +2014-01-23 14:01:33 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapiencoder.c: + context: move rate-control mode to encoder specific config. + Move usage-specific config out of the common GstVaapiContextInfo. + Create a specialized config for encoding and move rate-control mode + to there. + +2014-01-23 13:30:41 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder.c: + context: introduce concept of usage. + Introduce GstVaapiContextUsage so that to explicitly determine the + usage of a VA context. This is useful in view to simplifying the + creation of VA context for VPP too. + +2014-01-23 11:44:12 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + context: fix get_attribute() value result. + Unknown attributes, or attributes that are not supported for the given + profile/entrypoint pair have a return value of VA_ATTRIB_NOT_SUPPORTED. + So, return failure in this case. + +2014-01-23 10:59:20 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapicontext_overlay.c: + * gst-libs/gst/vaapi/gstvaapicontext_overlay.h: + * gst-libs/gst/vaapi/gstvaapisurface.c: + context: move overlay composition to separate files. + Move GstVideoOverlayComposition handling to separate source files. + This helps keeing GstVaapiContext core implementation to the bare + minimal, i.e. simpy helpers to create a VA context and handle pool + of associated VA surfaces. + +2014-01-23 09:41:07 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder.c: + context: clean-ups. Strip down APIs. + Improve documentation and debug messages. Clean-up APIs, i.e. strip + them down to the minimal set of interfaces. They are private, so no + need expose getters for instance. + +2014-01-23 09:27:38 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + context: re-indent all GstVaapiContext related source code. + +2014-01-23 10:20:40 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidecoder_unit.h: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplaycache.h: + * gst-libs/gst/vaapi/gstvaapiminiobject.h: + * gst-libs/gst/vaapi/gstvaapiobject_priv.h: + * gst-libs/gst/vaapi/gstvaapipixmap_priv.h: + * gst-libs/gst/vaapi/gstvaapiutils.h: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + * gst-libs/gst/vaapi/gstvaapiutils_h264_priv.h: + * gst-libs/gst/vaapi/gstvaapiutils_mpeg2_priv.h: + * gst-libs/gst/vaapi/gstvaapiutils_x11.h: + * gst-libs/gst/vaapi/gstvaapiwindow_priv.h: + libs: check that private headers remain private. + Make sure that libgstvaapi private headers remain internally used to + build libgstvaapi libraries only. All header dependencies were reviewed + and checks for IN_LIBGSTVAAPI definition were added accordingly. + Also rename GST_VAAPI_CORE definition to IN_LIBGSTVAAPI_CORE to keep + consistency. + +2014-01-22 19:04:58 +0100 Gwenole Beauchesne + + * configure.ac: + Bump library major version. + Bump the library major version due to API/ABI changes that occurred in + the imaging API. In particular, GstVaapiDisplay interfaces no longer + expose any GstCaps but provide GArray based ones e.g. to determine the + set of supported decode/encode profiles. + +2014-01-22 18:54:14 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/glibcompat.h: + * gst-libs/gst/vaapi/gstvaapicodec_objects.c: + * gst-libs/gst/vaapi/gstvaapicodec_objects.h: + * gst-libs/gst/vaapi/gstvaapicodedbufferpool.c: + * gst-libs/gst/vaapi/gstvaapicodedbufferpool.h: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.h: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.h: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2_priv.h: + * gst-libs/gst/vaapi/gstvaapiencoder_objects.c: + * gst-libs/gst/vaapi/gstvaapiencoder_objects.h: + * gst-libs/gst/vaapi/gstvaapiencoder_priv.h: + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst-libs/gst/vaapi/gstvaapipixmap_x11.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapitypes.h: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils_h264.c: + * gst-libs/gst/vaapi/gstvaapiutils_h264.h: + * gst-libs/gst/vaapi/gstvaapiutils_h264_priv.h: + * gst-libs/gst/vaapi/gstvaapiutils_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiutils_mpeg2.h: + * gst-libs/gst/vaapi/gstvaapiutils_mpeg2_priv.h: + * gst-libs/gst/vaapi/gstvaapivalue.c: + * gst-libs/gst/vaapi/gstvaapivalue.h: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode.h: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_h264.h: + * gst/vaapi/gstvaapiencode_mpeg2.c: + * gst/vaapi/gstvaapiencode_mpeg2.h: + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + * gst/vaapi/gstvaapivideometa_texture.c: + * tests/simple-decoder.c: + legal: update copyright notice dates. + +2014-01-22 18:49:20 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.h: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.h: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2_priv.h: + * gst-libs/gst/vaapi/gstvaapiencoder_objects.c: + * gst-libs/gst/vaapi/gstvaapiencoder_objects.h: + * gst-libs/gst/vaapi/gstvaapiencoder_priv.h: + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode.h: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_h264.h: + * gst/vaapi/gstvaapiencode_mpeg2.c: + * gst/vaapi/gstvaapiencode_mpeg2.h: + legal: add per-file authorship information. + +2014-01-22 18:11:26 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + decoder: fix video codec frame number in standalone mode. + Set a valid GstVideoCodecFrame.system_frame_number when decoding a + stream in standalone mode. While we are at it, improve the debugging + messages to also include that frame number. + +2014-01-17 16:56:53 +0800 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + decoder: fix crash on invalid pointer for GST_DEBUG(). + When decoding failed, or that the frame was dropped, the associated + surface proxy is not guaranteed to be present. Thus, the GST_DEBUG() + message needs to check whether the proxy is actually present or not. + https://bugzilla.gnome.org/show_bug.cgi?id=722403 + [fixed gst_vaapi_surface_proxy_get_surface_id() to return VA_INVALID_ID] + Signed-off-by: Gwenole Beauchesne + +2014-01-22 17:07:24 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: disable NAL HRD parameters for now. + Don't emit NAL HRD parameters for now in the SPS headers because the + SEI buffering_period() and picture_timing() messages are not handled + yet. Some additional changes are necessary to get it right. + https://bugzilla.gnome.org/show_bug.cgi?id=722734 + +2014-01-21 19:04:41 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.h: + * gst-libs/gst/vaapi/gstvaapiutils_h264.c: + * gst-libs/gst/vaapi/gstvaapiutils_h264_priv.h: + encoder: h264: fix default CPB buffer size. + Fix default CPB buffer size to something more reasonable (1500 ms) + and that still fits the level limits. This is a non configurable + property for now. The initial CPB removal delay is also fixed to + 750 ms. + https://bugzilla.gnome.org/show_bug.cgi?id=722087 + +2014-01-22 14:43:24 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: fix bitrate encoding for HRD conformance. + Round down the calculated, or supplied, bitrate (kbps) into a multiple + of the HRD bitrate scale factor. Use a bitrate scale factor of 64 so + that to have less losses in precision. Likewise, don't round up because + that could be a strict constraint imposed by the user. + +2014-01-22 11:25:13 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: fix level lookup constraints wrt. bitrate. + Fix the level calculation involving bitrate limits. Since we are + targetting NAL HRD conformance, the check against MaxBR from the + Table A-1 limits shall involve cpbBrNalFactor depending on the + active profile. + +2014-01-21 18:01:20 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: submit sequence parameter only once. + Submit sequence parameter buffers only once, or when the bitstream + was reconfigured in a way that requires such. Always submit packed + sequence parameter buffers at I-frame period, if the VA driver needs + those. + https://bugzilla.gnome.org/show_bug.cgi?id=722737 + +2014-01-21 18:35:17 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_priv.h: + encoder: h264: only submit packed headers when required. + Make sure to submit the packed headers only if the underlying VA driver + requires those. Currently, only handle packed sequence and picture + headers. + https://bugzilla.gnome.org/show_bug.cgi?id=722737 + +2014-01-21 17:35:24 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: fix ip_period value in sequence parameter. + The VAEncSequenceParameterBuffer.ip_period value reprents the distance + between the I-frame and the next P-frame. So, this also accounts for + any additional B-frame in the middle of it. + This fixes rate control heuristics for certain VA drivers. + https://bugzilla.gnome.org/show_bug.cgi?id=722735 + +2014-01-21 17:04:40 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: fix level when bitrate is automatically computed. + Fix level characterisation when the bitrate is automatically computed + from the active coding tools. i.e. ensure the bitrate once the profile + is completely characterized but before the level calculation process. + +2014-01-21 16:05:22 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: clean-ups. + Document and rename a few functions here and there. Drop code that + caps num_bframes variable in reset_properties() since they shall + have been checked beforehand, during properties initialization. + +2014-01-21 15:28:34 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: clean-up bitwriter related utilities. + Clean-up GstBitWriter related utility functions and simplify notations. + While we are at it, also make bitstream writing more robust should an + overflow occur. We could later optimize for writing headers capped to + their maximum possible size by using the _unchecked() helper variants. + +2014-01-21 15:23:01 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264_priv.h: + encoder: h264: completely remove private headers. + Drop private header since it was originally used to expose internals + to the plugin element. The proper interface is now the properties API, + thus rendering private headers totally obsolete. + +2014-01-15 15:54:32 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: fix PPS header packing with profile < high. + Fix PPS header packing when profile is below High since 8x8 transform + mode and scaling lists are High Profile features. + +2014-01-15 15:46:19 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: always emit VUI parameters for framerate. + Always emit VUI parameters for timing_info, which includes framerate + information. + +2014-01-15 15:10:48 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: really fix frame cropping rectangle calculation. + Make frame cropping rectangle calculation future proof, i.e. exactly + follow the specification (7-18) to (7-21), and subsampling definitions + from Table 6-1. + https://bugzilla.gnome.org/show_bug.cgi?id=722089 + https://bugzilla.gnome.org/show_bug.cgi?id=722238 + +2014-01-15 12:09:14 +0100 Holger Kaelberer + + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + vaapisink: set csc render flags from sinkpad caps. + This maps GstVideoColorimetry information in vaapisink's sinkpad caps + to GST_VAAPI_COLOR_STANDARD_* flags, if per-buffer information was not + available. + https://bugzilla.gnome.org/show_bug.cgi?id=722255 + [factored out code, added SMPTE240M, handle per-buffer flags] + Signed-off-by: Gwenole Beauchesne + +2012-03-28 15:05:26 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst/vaapi/gstvaapipostproc.c: + surface: rework render flags. + Pack render flags per category and provide more flags into the color + standard category. In particular, cover for SMPTE-240M. + +2013-12-13 04:14:41 +0800 Zhao, Halley + + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + vaapipostproc: add support for colorbalance filters. + Add support for hue, saturation, brightness and constrat adjustments. + Also fix cap info local copy to match the really expected cap subtype + of interest. + https://bugzilla.gnome.org/show_bug.cgi?id=720376 + Signed-off-by: Gwenole Beauchesne + +2013-12-12 08:38:12 +0800 Zhao, Halley + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: fix support for "sharpen" filter. + Fix copy/paste error when submitting the "sharpen" value to the + GstVaapiFilter instance. + https://bugzilla.gnome.org/show_bug.cgi?id=720375 + Signed-off-by: Gwenole Beauchesne + +2013-12-20 12:05:42 +0000 Lionel Landwerlin + + * configure.ac: + * pkgconfig/gstreamer-vaapi-drm.pc.in: + * pkgconfig/gstreamer-vaapi-glx.pc.in: + * pkgconfig/gstreamer-vaapi-wayland.pc.in: + * pkgconfig/gstreamer-vaapi-x11.pc.in: + * pkgconfig/gstreamer-vaapi.pc.in: + pkgconfig: plugin dir should use PKG version not API version. + Fix the pluginsdir and includedir variables in the generated pkgconfig + (.pc) files. The location needs to be built with the PKG version in + mind instead of the API version. + While we are at it, also fix the PKG version for GStreamer >= 1.3. + https://bugzilla.gnome.org/show_bug.cgi?id=720820 + [additional fixes for includedir and pkg requirements] + Signed-off-by: Gwenole Beauchesne + +2014-01-15 10:05:45 +0100 Holger Kaelberer + + * gst/vaapi/gstvaapisink.c: + vaapisink: fix display initialization in GstVideoOverlay implementation. + When gst_vaapisink_video_overlay_set_window_handle() is called early, + before the pipeline has been set to PLAYING, the display has not yet + been initialized and _PLUGIN_BASE_DISPLAY_TYPE() is not yet + up-to-date. For this reason the foreign XID is not attached. + Now _ensure_display() is called earlier. + https://bugzilla.gnome.org/show_bug.cgi?id=722244 + Signed-off-by: Gwenole Beauchesne + +2013-10-09 13:47:54 +0300 Sreerenj Balachandran + + * gst/vaapi/gstvaapisink.c: + vaapisink: expose the raw video formats in static caps template. + Expose all raw video formats in the static caps template since the + vaapisink is supporting raw data. We will get the exact set of formats + supported by the driver dynamically through the _get_caps() routine. + https://bugzilla.gnome.org/show_bug.cgi?id=703271 + https://bugzilla.gnome.org/show_bug.cgi?id=720737 + Signed-off-by: Gwenole Beauchesne + +2013-12-11 18:08:26 +0000 Matthieu Bouron + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: query downstream caps features like GLTextureUploadMeta. + Fix vaapidecode to correctly report caps features downstream, when + a custom pipeline is built manually. + https://bugzilla.gnome.org/show_bug.cgi?id=719372 + Signed-off-by: Gwenole Beauchesne + +2013-12-17 15:27:10 +0000 Matthieu Bouron + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: add system memory caps to template caps. + Since vaapidecode provides buffer that can be mapped as regular memory, + those caps should be added to the template caps. That only applies to + GStreamer >= 1.2. + https://bugzilla.gnome.org/show_bug.cgi?id=720608 + Signed-off-by: Gwenole Beauchesne + +2013-12-17 10:26:03 +0800 Wind Yuan + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: fix hang on SIGINT. + vaapidecode hangs when pipeline is stopped without any EOS, e.g. when + +C is pressed, thus causing the srcpad task to keep running and + locked. This fixes a deadlock on state change from PAUSED to READY. + https://bugzilla.gnome.org/show_bug.cgi?id=720584 + Signed-off-by: Gwenole Beauchesne + +2013-12-17 04:23:42 -0500 Wind Yuan + + * gst/vaapi/gstvaapiencode.c: + vaapiencode: fix possible hang on SIGINT. + vaapiencode might hang when the pipeline is stopped without any EOS, + e.g. when +C is pressed, thus causing the srcpad task to keep + running and locked. This fixes a possible deadlock on state change + from PAUSED to READY. + https://bugzilla.gnome.org/show_bug.cgi?id=720584 + Signed-off-by: Gwenole Beauchesne + +2014-01-14 16:33:04 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiencode.c: + vaapiencode: fix typo in error message. + Fix incomplete error message in gst_vaapiencode_push_frame(). + +2014-01-14 19:08:36 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + plugins: add helpers to create video caps with features. + Add gst_vaapi_video_format_new_template_caps_with_features() helper + function to add the supplied caps feature string on GStreamer >= 1.2. + Add gst_vaapi_find_preferred_caps_feature() helper function to discover + the "best" caps feature to use for the supplied pad. In practice, we + will always favor memory:VASurface first, then meta:GLTextureUploadMeta, + and finally the system memory caps. + https://bugzilla.gnome.org/show_bug.cgi?id=719372 + +2014-01-09 11:54:11 +0000 Matthieu Bouron + + * gst/vaapi/gstvaapivideometa_texture.c: + plugins: don't apply overlay composition in GLTextureUpload function. + The GLTextureUpload function is not in charge of doing the overlay + composition if any. + https://bugzilla.gnome.org/show_bug.cgi?id=721859 + Signed-off-by: Gwenole Beauchesne + +2014-01-14 13:47:52 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_objects.c: + encoder: re-order submission of VA objects. + Change the submission order of VA objects so that to make that process + more logical. i.e. submit sequence parameter first, if any; next the + packed headers associated to sequece, picture or slices; and finally + the actual picture and associated slices. + +2014-01-14 12:01:11 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiencoder_objects.c: + * gst-libs/gst/vaapi/gstvaapiencoder_objects.h: + encoder: clean-up objects. + Various clean-ups to improve consistency and readability: rename some + variables, drop unused macro definitions, drop initialization of vars + that are zero-initialized from the base class, drop un-necessary casts, + allocate GPtrArrays with a destroy function. + +2014-01-13 13:41:35 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: fix frame cropping rectangle calculation. + Fix frame cropping rectangle calculation to handle horizontal resolutions + that don't match a multiple of 16 pixels, but also the vertical resolution + that was incorrectly computed for progressive sequences too. + https://bugzilla.gnome.org/show_bug.cgi?id=722089 + +2014-01-13 11:49:14 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: improve automatic bitrate calculation. + For non "Constant-QP" modes, we could provide more reasonable heuristics + for the target bitrate. In general, 48 bits per macroblock with all the + useful coding tools enable looks safe enough. Then, this rate is raised + by +10% to +15% for each coding tool that is disabled. + https://bugzilla.gnome.org/show_bug.cgi?id=719699 + +2014-01-13 11:11:25 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: support "high-compression" tuning option. + Add support for "high-compression" tuning option. First, determine the + largest supported profile by the hardware. Next, check any target limit + set by the user. Then, enable each individual coding tool based on the + resulting profile_idc value to use. + https://bugzilla.gnome.org/show_bug.cgi?id=719696 + +2014-01-12 22:24:04 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264_priv.h: + * gst-libs/gst/vaapi/gstvaapiutils_h264.c: + * gst-libs/gst/vaapi/gstvaapiutils_h264.h: + * gst/vaapi/gstvaapiencode_h264.c: + encoder: h264: allow target decoder constraints. + Allow user to precise the largest profile to use for encoding due + to target decoder constraints. For instance, if CABAC entropy coding + mode is requested by "constrained-baseline" profile only is desired, + then an error is returned during codec configuration. + Also make sure that the suitable profile we derived actually matches + what the HW can cope with. + https://bugzilla.gnome.org/show_bug.cgi?id=719694 + +2014-01-12 22:14:11 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + encoder: h264: refine size of coded buffer. + Refine the heuristic to determine the maximum size of a coded buffer + to account for the exact number of slices. set_context_info() is the + last step during codec reconfiguration, no additional change is done + afterwards, so re-using the num_slices field here is fine. + https://bugzilla.gnome.org/show_bug.cgi?id=719953 + +2013-12-13 17:36:08 +0800 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264_priv.h: + encoder: h264: expose more coding tools. + Add new H.264 coding tools to improve compression: + - "cabac": enable CABAC entropy coding (default: FALSE); + - "dct8x8": enable spatial transform 8x8 (default: FALSE). + https://bugzilla.gnome.org/show_bug.cgi?id=719693 + Signed-off-by: Gwenole Beauchesne + +2014-01-10 18:18:25 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264_priv.h: + encoder: h264: derive profile and level from active coding tools. + Automatically derive the minimum profile and level to be used for + encoding, based on the activated coding tools. The encoder will + be trying to generate a bitstream that has the best chances to be + decoded on most platforms by default. + Also change the default profile to "constrained-baseline" so that + to ensure maximum compatibility when the stream is decoded. + https://bugzilla.gnome.org/show_bug.cgi?id=719691 + +2014-01-10 17:02:44 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264_priv.h: + encoder: h264: fix hardware profile lookup. + Fix lookup for a suitable HW profile, as to be used by the underlying + hardware, based on heuristics that lead to characterize the SW profile, + i.e. the one used by the SW level encoding logic. + Also fix constraint_set0_flag (A.2.1) and constraint_set1_flag (A.2.2) + as they should respectively match the baseline and main profile. + https://bugzilla.gnome.org/show_bug.cgi?id=719827 + +2014-01-10 14:46:15 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264_priv.h: + encoder: h264: support only the byte-stream format. + The libgstvaapi core encoders are meant to support raw bitstreams only. + Henceforth, we are always producing a stream in "byte-stream" format. + However, the "codec-data" buffer which holds SPS and PPS headers is + always available. The "lengthSizeMinusOne" field is always set to 3 + so that in-place "byte-stream" format to "avc" format conversion could + be performed. + +2014-01-10 14:05:40 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264_priv.h: + * gst/vaapi/gstvaapiencode_h264.c: + encoder: h264: clean-ups. + Various clean-ups to improve consistency and readability: rename some + variables, drop unused macro definitions, drop initialization of vars + that are zero-initialized from the base class, drop un-necessary casts. + +2014-01-13 17:11:15 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + encoder: mpeg2: fix hardware profile lookup. + Fix lookup for a suitable HW profile, as to be used by the underlying + hardware, based on heuristics that lead to characterize the SW profile, + i.e. the one used by the SW level encoding logic. + +2014-01-13 16:56:04 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2_priv.h: + encoder: mpeg2: derive profile and level from active coding tools. + Automatically derive the minimum profile and level to be used for + encoding, based on the activated coding tools. Improve lookup for + the best suitable level with the new MPEG-2 helper functions. + Also change the default profile to "simple" so that to ensure maximum + compatibility when the stream is decoded. + https://bugzilla.gnome.org/show_bug.cgi?id=719703 + +2014-01-13 14:41:15 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.h: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2_priv.h: + encoder: mpeg2: clean-ups. + Various clean-ups to improve consistency and readability: drop unused + macro definitions, drop initialization of vars that are zero-initialized + from the base class, drop un-necessary casts. + +2014-01-13 10:48:25 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiencoder_priv.h: + encoder: add tuning options API. + Add encoder "tune" option to override the default behaviour that is to + favor maximum decoder compatibility at the expense of lower compression + ratios. + Expected tuning options to be developed are: + - "high-compression": improve compression, target best-in-class decoders; + - "low-latency": tune for low-latency decoding; + - "low-power": tune for encoding in low power / resources conditions. + +2014-01-12 23:17:14 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + encoder: fix bitrate units to match kbps. + Bitrate is expressed in kilobits per second (kbps). So, this exactly + means in multiple of 1000 bits, not 1024 bits. + https://bugzilla.gnome.org/show_bug.cgi?id=722086 + +2014-01-12 21:57:20 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder.h: + * gst-libs/gst/vaapi/gstvaapiencoder_objects.c: + * gst-libs/gst/vaapi/gstvaapiencoder_priv.h: + encoder: clean-ups. + Drop obsolete and unused macros. Add a few doc comments. Slightly + improve indentation of a few leftovers. + +2014-01-12 18:52:14 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder_priv.h: + * gst-libs/gst/vaapi/gstvaapivalue.c: + * gst-libs/gst/vaapi/gstvaapivalue.h: + encoder: filter out the supported set of rate-control properties. + Only expose the exact static set of supported rate-control properties + to the upper layer. For instance, if the GstVaapiEncoderXXX class does + only support CQP rate control, then only add it the the exposed enum + type. + Add helper macros and functions to build a GType for an enum subset. + +2014-01-10 13:23:48 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264_priv.h: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.h: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2_priv.h: + * gst-libs/gst/vaapi/gstvaapiencoder_priv.h: + encoder: add keyframe period API. + Add gst_vaapi_encoder_set_keyframe_period() interface to allow the + user control the maximum distance between two keyframes. This new + property can only be set prior to gst_vaapi_encoder_set_codec_state(). + A value of zero for "keyframe-period" gets it re-evaluated to the + actual framerate during encoder reconfiguration. + +2014-01-10 12:01:51 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiencoder_priv.h: + encoder: improve codec reconfiguration. + Improve codec reconfiguration to be performed only through a single + function. That is, remove the _set_context_info() hook as subclass + should not alter the parent GstVaapiContextInfo itself. Besides, the + VA context is constructed only at the final stages of reconfigure(). + +2014-01-10 11:30:25 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicodedbufferpool.c: + * gst-libs/gst/vaapi/gstvaapicodedbufferpool.h: + * gst-libs/gst/vaapi/gstvaapiencoder.c: + encoder: fix possible memory leak of coded buffer pools. + Fix gst_vaapi_encoder_reconfigure_internal() to re-/allocate the coded + buffer pool only if the coded buffer size actually changed. + +2014-01-10 10:54:22 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiencoder_priv.h: + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode.h: + encoder: add video codec-state API. + Add interface to communicate the encoder resolution and related info + like framerate, interlaced vs. progressive, etc. This new interface + supersedes gst_vaapi_encoder_set_format() and doesn't use any GstCaps + but rather use GstVideoCodecState. + Note that gst_vaapi_encoder_set_codec_state() is also a synchronization + point for codec config. This means that the encoder is reconfigured + there to match the latest properties. + +2014-01-13 17:18:42 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiencode.c: + vaapiencode: don't crash on NULL encoder on _finish(). + Don't try to destroy an encoder, in GstVideoEncoder::finish() handler, + if it was not created in the first place. Return "not-negotiated" error + since this means we did not even reach GstVideoEncoder::set_format(), + where the encoder could have been created. + This fixes a crash when the vaapiencode_* plug-in elements get deallocated + and that we failed to negotiate either pad. + https://bugzilla.gnome.org/show_bug.cgi?id=719704 + +2014-01-09 18:20:24 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode.h: + * gst/vaapi/gstvaapiencode_h264.c: + vaapiencode: use more GstVaapiPluginBase facilities. + Avoid duplication of pad references or query functions since they are + provided through the GstVaapiPluginBase object. + +2014-01-09 18:10:35 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode.h: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_h264.h: + * gst/vaapi/gstvaapiencode_mpeg2.c: + vaapiencode: fix negotiation process of output caps. + The specified caps in gst_video_encoder_set_output_state() function + arguments should not contain any resolution, pixel-aspect-ratio, + framerate, codec-data et al. Those rather should be set through the + returned GstVideoCodecState. This means that output caps creation + could be delayed until before gst_video_encoder_finish_frame() is + called. + This greatly simplifies the GstVideoEncoder::set_format() callback + by the way. + +2014-01-08 18:56:23 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiencode.c: + vaapiencode: make GstVaapiEncode an abstract type. + Make base GstVaapiEncode class an abstract type so that we cannot + create an instance from it without going through any of the codec + specific derived class. + +2014-01-09 10:09:38 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode.h: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_mpeg2.c: + vaapiencode: rename a few member functions. + Rename a few member functions to make them more consistent: + - alloc_encoder(): now reduced to allocate the encoder object only; + - alloc_buffer(): allocate buffer from srcpad, and copy bitstream. + +2014-01-08 18:36:46 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode.h: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_h264.h: + * gst/vaapi/gstvaapiencode_mpeg2.c: + vaapiencode: update for new properties API. + Update MPEG-2 and H.264 encode elements to cope with the new core + libgstvaapi properties API. i.e. all configurable properties are now + directly handled at the GstVaapiEncoder level. + Besides, this also makes sure to not use or modify the GstVaapiEncoder + private definitions directly. Private data need to remain private. + https://bugzilla.gnome.org/show_bug.cgi?id=719529 + +2014-01-06 17:46:40 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.h: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.h: + * gst-libs/gst/vaapi/gstvaapiencoder_priv.h: + encoder: add properties API. + Add interface to communicate configurable properties to the encoder. + This covers both the common ones (rate-control, bitrate), and the + codec specific properties. + https://bugzilla.gnome.org/show_bug.cgi?id=719529 + +2014-01-06 18:01:33 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264_priv.h: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2_priv.h: + * gst-libs/gst/vaapi/gstvaapiencoder_priv.h: + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_mpeg2.c: + encoder: add bitrate API. + Add gst_vaapi_encoder_set_bitrate() interface to allow the user control + the bitrate for encoding. Currently, changing this parameter is only + valid before the first frame is encoded. Should the value be modified + afterwards, then GST_VAAPI_ENCODER_STATUS_ERROR_OPERATION_FAILED is + returned. + https://bugzilla.gnome.org/show_bug.cgi?id=719529 + +2014-01-06 15:10:36 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2_priv.h: + * gst-libs/gst/vaapi/gstvaapiencoder_priv.h: + * gst-libs/gst/vaapi/gstvaapitypes.h: + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode.h: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_mpeg2.c: + encoder: add rate control API. + Add gst_vaapi_encoder_set_rate_control() interface to request a new + rate control mode for encoding. Changing the rate control mode is + only valid prior to encoding the very first frame. Afterwards, an + error ("operation-failed") is issued. + https://bugzilla.gnome.org/show_bug.cgi?id=719529 + +2014-01-03 16:57:25 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_mpeg2.c: + vaapiencode: fix indentation. + +2014-01-03 16:57:09 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264_priv.h: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiencoder_objects.c: + * gst-libs/gst/vaapi/gstvaapiencoder_priv.h: + * gst/vaapi/gstvaapiencode.h: + encoder: fix indentation. + +2014-01-13 16:20:06 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiutils_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiutils_mpeg2.h: + * gst-libs/gst/vaapi/gstvaapiutils_mpeg2_priv.h: + utils: add new MPEG-2 helper functions. + Add various helper functions to convert profile, level, chroma formats + from gstreamer-vaapi world and the MPEG-2 specification world. + +2014-01-10 19:49:52 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiutils_h264.c: + utils: h264: don't use fatal asserts. + Replace g_assert() with a g_debug() so that to not make the program + abort when an unsupported value is supplied. + +2014-01-10 19:37:44 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiutils_h264.c: + * gst-libs/gst/vaapi/gstvaapiutils_h264.h: + utils: h264: add helpers for profile and level string mappings. + Add profile and level helper functions to convert to/from strings. + +2014-01-10 18:27:20 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiutils_h264.c: + * gst-libs/gst/vaapi/gstvaapiutils_h264.h: + * gst-libs/gst/vaapi/gstvaapiutils_h264_priv.h: + utils: h264: expose levels in public header. + Instal header but only expose the + H.264 levels in there. The additional helper functions are meant + to be private for now. + +2014-01-09 09:27:40 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicodec_objects.c: + * gst-libs/gst/vaapi/gstvaapicodec_objects.h: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + codec: add helper macros to maintain object refcount. + Add gst_vaapi_mini_object_{ref,unref,replace}() helper macros so that + to avoid explicit casts to GstVaapiMiniObject in all caller sites. + +2014-01-09 09:30:49 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + codec: re-indent decoder objects. + +2014-01-09 09:10:21 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicodec_objects.c: + * gst-libs/gst/vaapi/gstvaapicodec_objects.h: + codec: re-indent base codec objects. + +2014-01-03 12:49:05 +0000 Matthieu Bouron + + * gst/vaapi/gstvaapipluginbase.c: + plugins: do not free debug category in finalize method. + Fixes a crash when multiple vaapidecode elements are finalized since + the debug category is created once in the class init method. + This is a regression from git commit 7e58d60. + https://bugzilla.gnome.org/show_bug.cgi?id=721390 + Signed-off-by: Gwenole Beauchesne + +2014-01-02 11:35:30 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/glibcompat.h: + * tests/simple-decoder.c: + tests: simple-decoder: don't use deprecated g_thread_create(). + Use g_thread_try_new() instead of the deprecated g_thread_create() + function. Provide compatibility glue for any GLib version < 2.31.2. + +2014-01-02 11:17:28 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapipixmap_x11.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * gst/vaapi/gstvaapiencode.c: + Fix printf()-like formats. + Fix formts for various GST_DEBUG et al. invocations. More precisely, + make size_t arguments use the %zu format specifier accordingly; force + XID formats to be a 32-bit unsigned integer; and fix the format used + for gst_vaapi_create_surface_with_format() error cases since we have + been using strings nowadays. + +2013-12-21 07:38:14 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/video-format.c: + * gst-libs/gst/vaapi/video-format.h: + utils: format: drop unused helper functions. + The following helper functions are no longer used, thus are removed: + - gst_vaapi_video_format_from_structure() + - gst_vaapi_video_format_from_caps() + - gst_vaapi_video_format_to_caps() + +2013-12-21 07:29:50 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/video-format.c: + * gst-libs/gst/vaapi/video-format.h: + utils: re-indent GstVideoFormat related helpers. + +2013-12-21 08:27:30 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidownload.c: + download: use GstVideoInfo facilities to build output caps. + Use standard GstVideoInfo related functions to build the output caps, + thus directly preserving additional fields as needed, instead of + manually copying them over through gst_vaapi_append_surface_caps(). + Also ensure that the input caps are fixated first. + +2013-12-21 10:41:22 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapiuploader.c: + plugins: factor out construction of template caps. + Add new helper functions to build video template caps. + - gst_vaapi_video_format_new_template_caps(): + create GstCaps with size, frame rate and PAR to full range + - gst_vaapi_video_format_new_template_caps_from_list(): + try to create a "simplified" list from the supplied formats + +2013-12-21 06:41:34 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapipostproc.c: + plugins: factor out construction of GValue from GstVideoFormat. + Add new helper functions to build GValues from GstVideoFormat: + - gst_vaapi_value_set_format(): + build a GValue from the supplied video format + - gst_vaapi_value_set_format_list(): + build a GValue list from the supplied array of video formats + +2013-12-21 06:22:30 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapivideocontext.c: + * gst/vaapi/gstvaapivideocontext.h: + plugins: re-indent common and video context creation utils. + +2013-12-20 15:31:14 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst/vaapi/gstvaapidecode.c: + * tests/test-display.c: + display: don't use GstCaps for decode or encode profiles list. + Replace gst_vaapi_display_get_{decode,encode}_caps() APIs with more + more convenient APIs that return an array of GstVaapiProfile instead + of GstCaps: gst_vaapi_display_get_{decode,encode}_profiles(). + +2013-12-20 15:15:05 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapiuploader.c: + * tests/test-display.c: + display: don't use GstCaps for image or subpicture formats list. + Replace gst_vaapi_display_get_{image,subpicture}_caps() APIs, that + returned GstCaps, with more convenient APIs that return an array of + GstVideoFormat: gst_vaapi_display_get_{image,subpicture}_formats(). + +2013-12-20 14:01:45 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + display: allocate queried resources on-demand. + Allocate the set of decoders or encoders on-demand, when they are + queried. Likewise for VA display attributes, image and subpicture + formats. + +2013-12-20 13:27:07 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_drm.c: + * gst-libs/gst/vaapi/gstvaapidisplay_drm.h: + * gst-libs/gst/vaapi/gstvaapidisplay_drm_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.h: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplaycache.c: + * gst-libs/gst/vaapi/gstvaapidisplaycache.h: + display: re-indent all GstVaapiDisplay related source code. + +2013-12-20 16:04:19 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapiprofile.h: + utils: add helper functions to get codec or profile name. + +2013-12-20 17:08:23 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + * gst/vaapi/gstvaapiuploader.c: + plugins: fix permissions for certain files. + Drop the execute bit for gstvaapiuploader.c and gstvaapipostproc.[ch] + files. + +2013-12-12 17:01:29 +0000 Matthieu Bouron + + * gst/vaapi/gstvaapivideometa_texture.c: + plugins: implement GLTextureUploadMeta user data copy. + Makes the copies of a buffer reference their own GLTextureUploadMeta + user data and prevent the original buffer accessing already freed + memory if its copies has been released and freed. + https://bugzilla.gnome.org/show_bug.cgi?id=720336 + [Propagate the original meta texture to the copy too] + Signed-off-by: Gwenole Beauchesne + +2013-12-17 18:52:23 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode.h: + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginbase.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + plugins: factor out support for raw YUV buffers on sink pads. + Factor out propose_allocation() hooks, creation of video buffer pool + for the sink pad, conversion from raw YUV buffers to VA surface backed + buffers. Update vaapidecode, vaapiencode and vaapipostproc to cope + with the new GstVaapiPluginBase abilities. + +2013-12-17 18:46:07 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstcompat.h: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecode.h: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginbase.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + plugins: factor out pad caps. + +2013-12-13 16:03:08 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + plugins: factor out video context sharing code. + +2013-12-13 13:24:24 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginbase.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + plugins: factor out GstImplementsInterface. + +2013-12-13 12:00:35 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginutil.c: + plugins: check type of display obtained from neighbours. + Fix display creation code to check that any display obtained from a + neighbour actually has the type we expect. Note: if display type is + set to "any", we can then accept any VA display type. + +2013-12-13 11:52:47 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginbase.h: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + * gst/vaapi/gstvaapiupload.c: + plugins: factor out display creation process. + Move common VA display creation code to GstVaapiPluginBase, with the + default display type remaining "any". Also add a "display-changed" + hook so that subclasses could perform additional tasks when/if the + VA display changed, due to a new display type request for instance. + All plug-ins are updated to cope with the new internal APIs. + +2013-12-13 10:24:26 +0100 Gwenole Beauchesne + + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecode.h: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapidownload.h: + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode.h: + * gst/vaapi/gstvaapipluginbase.c: + * gst/vaapi/gstvaapipluginbase.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + * gst/vaapi/gstvaapiupload.c: + * gst/vaapi/gstvaapiupload.h: + plugins: add new base object, store display in there. + Introduce a new GstVaapiPluginBase object that will contain all common + data structures and perform all common tasks. First step is to have a + single place to hold VA displays. + While we are at it, also make sure to store and subsequently release + the appropriate debug category for the subclasses. + +2013-12-11 14:04:27 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiobject.h: + * gst-libs/gst/vaapi/gstvaapiobject_priv.h: + * gst/vaapi/gstvaapivideometa_texture.c: + * gst/vaapi/gstvaapivideometa_texture.h: + plugins: fix GLTextureUploadMeta to work with different texture ids. + The GLTextureUploadMeta implementation assumed that for each upload() + sequence, the supplied texture id is always the same as the one that + was previously cached into the underlying GstVaapiTexture. Cope with + any texture id change the expense to recreate the underlying VA/GLX + resources. + https://bugzilla.gnome.org/show_bug.cgi?id=719643 + +2013-12-11 13:25:51 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapivideobufferpool.c: + * gst/vaapi/gstvaapivideometa_texture.c: + plugins: allow builds without GLX enabled for GStreamer 1.2. + Don't try to build GLTextureUploadMeta related code if GLX is not + enabled during GStreamer >= 1.2 builds. + +2013-11-20 17:20:07 +0000 Matthieu Bouron + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapivideobufferpool.c: + * gst/vaapi/gstvaapivideobufferpool.h: + * gst/vaapi/gstvaapivideometa_texture.c: + * gst/vaapi/gstvaapivideometa_texture.h: + plugins: request GLTextureUpload meta on buffers in the buffer pool. + Requesting the GLTextureUpload meta on buffers in the bufferpool + prevents such metas from being de-allocated when buffers are released + in the sink. + This is particulary useful in terms of performance when using the + GLTextureUploadMeta API since the GstVaapiTexture associated with + the target texture is stored in the meta. + https://bugzilla.gnome.org/show_bug.cgi?id=712558 + Signed-off-by: Gwenole Beauchesne + +2013-12-11 10:51:03 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideometa_texture.c: + plugins: robustify GstVideoGLTextureUploadMeta implementation. + Make GstVideoGLTextureUploadMeta::upload() implementation more robust + when the GstVaapiTexture associated with the supplied texture id could + not be created. + +2013-12-10 16:14:27 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: improve robustness when packets are missing. + Improve robustness when some expected packets where not received yet + or that were not correctly decoded. For example, don't try to decode + a picture if there was no valid frame headers parsed so far. + https://bugs.freedesktop.org/show_bug.cgi?id=57902 + +2013-12-10 14:20:55 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix decoding of BA3_SVA_C.264. + Conformance test Base_Ext_Main_profiles/BA3_SVA_C.264 complys with + extended profile specifications. However, the SPS header has the + constraint_set1_flag syntax element set to 1. This means that, if + a Main profile compliant decoder is available, then it should be + able to decode this stream. + This changes makes it possible to fall-back from Extended profile + to Main profile if constraint_set1_flag is set to 1. + https://bugzilla.gnome.org/show_bug.cgi?id=720190 + +2013-12-10 11:13:01 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiprofile.h: + * gst-libs/gst/vaapi/gstvaapiutils_h264.c: + utils: h264: add more profiles. + Add extended profile (A.2.3), high 4:2:2 profile (A.2.6), high 4:2:2 + profiles (A.2.7, A.2.10), scalable profiles (G.10.1.1, G.10.1.2) and + multiview profiles (H.10.1.1, H.10.1.2). + Document "Constrained Baseline" and "High 10" profiles. + +2013-12-10 15:21:51 +0100 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit e7d0e18. + e7d0e18 h264: complete set of NAL unit types + +2013-12-06 15:08:26 +0800 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiprofile.c: + decoder: h264: add support for constrained baseline profile. + Recognize streams marked as conforming to the "Constrained Baseline + Profile". If VA driver supports that as is, fine. Otherwise, fallback + to baseline, main or high profile. + Constrained Baseline Profile conveys coding tools that are common + to baseline profile and main profile. + https://bugzilla.gnome.org/show_bug.cgi?id=719947 + [Added fallbacks to main and high profiles] + Signed-off-by: Gwenole Beauchesne + +2013-12-09 12:46:45 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + decoder: h264: fix decoding of scaling lists. + The GStreamer codecparser layer now parses the scaling lists in zigzag + scan order, as expected, so that to match the original bitstream layout + and specification. However, further convert the scaling lists into + raster scan order to fit the existing practice in most VA drivers. + https://bugzilla.gnome.org/show_bug.cgi?id=706406 + +2013-12-09 12:07:28 +0100 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit 177c73b. + a7e3255 add H.265 (HEVC) bitstream parser + 177c73b h264: fix picture level scaling lists derivation (rule B) + 14733f1 h264: fix parsing of VCL HRD parameters + 59a0b47 h264: store quantization matrices in zig-zag order + ffb6e26 h264: add helpers to convert quantization matrices + c78a504 mpeg2: also initialize debug category in parse_sequence_header() + 719d1b0 mpeg2: turn internal consistency check into a g_assert() + 5241d8e all: remove some unused functions + 18eb312 all: fix for GST_DISABLE_GST_DEBUG + 963c04a all: make warnings more meaningful + +2013-12-06 19:05:52 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiutils_h264.c: + * gst-libs/gst/vaapi/gstvaapiutils_h264.h: + utils: add helpers for H.264 levels. + - gst_vaapi_utils_h264_get_level(): + Returns GstVaapiLevelH264 from H.264 level_idc value + - gst_vaapi_utils_h264_get_level_idc(): + Returns H.264 level_idc value from GstVaapiLevelH264 + - gst_vaapi_utils_h264_get_level_limits(): + Returns level limits as specified in Table A-1 of the H.264 standard + - gst_vaapi_utils_h264_get_level_limits_table(): + Returns the Table A-1 specification + +2013-12-06 17:34:52 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapiprofile.h: + * gst-libs/gst/vaapi/gstvaapiutils_h264.c: + utils: add new H.264 profiles. + Add "Constrained Baseline Profile" and "High 10 Profile" definitions + and helper functiions. + +2013-12-06 17:21:52 +0100 Gwenole Beauchesne + + utils: add new H.264 helper functions. + * Profiles: + - gst_vaapi_utils_h264_get_profile(): + Returns GstVaapiProfile from H.264 profile_idc value + - gst_vaapi_utils_h264_get_profile_idc(): + Returns H.264 profile_idc value from GstVaapiProfile + * Chroma formats: + - gst_vaapi_utils_h264_get_chroma_type(): + Returns GstVaapiChromaType from H.264 chroma_format_idc value + - gst_vaapi_utils_h264_get_chroma_format_idc(): + Returns H.264 chroma_format_idc value from GstVaapiChromaType + +2013-12-03 11:05:17 +0000 Matthieu Bouron + + * gst-libs/gst/base/Makefile.am: + * gst-libs/gst/vaapi/Makefile.am: + Fix missing files in distribution tarball. + https://bugzilla.gnome.org/show_bug.cgi?id=719776 + [Additional fixes and clean-ups] + Signed-off-by: Gwenole Beauchesne + +2013-12-05 18:13:54 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + encoder: fix computation of max coded buffer size (again). + The previous fix was only valid to express the maximum size of the + macroblock layer, i.e. without any headers. Now, also account for + the slice headers and top picture header, but also any other header + we might stuff into the VA coded buffer, e.g. sequence headers. + +2013-12-04 19:10:13 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + encoder: fix computation of max coded buffer size. + Fix coded buffer size for each codec. A generic issue was that the + number of macroblocks was incorrectly computed. The second issue was + specific to MPEG-2 were the max number of bits per macroblock, and + as defined by the standard, was incorrectly mapped to the (lower) + H.264 requirement. i.e. 4608 bits vs. 3200 bits limit. + +2013-12-04 18:48:35 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiencoder_priv.h: + encoder: simplify VA context initialization process. + Change get_context_info() into a set_context_info() function that + initializes common defaults into the base class, thus allowing the + subclasses to specialize the context info further on. + The set_context_info() hook is also the location where additional + context specific data could be initialized. At this point, we are + guaranteed to have valid video resolution size and framerate. i.e. + gst_vaapi_encoder_set_format() was called beforehand. + +2013-11-26 14:38:23 +0800 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + encoder: fix mpeg2 compilation error. + https://bugzilla.gnome.org/show_bug.cgi?id=719746 + Signed-off-by: Gwenole Beauchesne + +2013-12-04 17:55:18 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiencoder_priv.h: + * gst/vaapi/gstvaapiencode.c: + encoder: clean-ups and document public APIs. + Clean public APIs up so that to better align with the decoder APIs. + Most importantly, gst_vaapi_encoder_get_buffer() is changed to only + return the VA coded buffer proxy. Also provide useful documentation + for the public APIs. + +2013-12-04 17:05:17 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder.h: + * gst-libs/gst/vaapi/gstvaapiencoder_priv.h: + encoder: avoid extra allocations of GstVaapiEncoderSyncPic objects. + Kill GstVaapiEncoderSyncPic objects that are internally and temporarily + allocated. Rather, associate a GstVaapiEncPicture to a coded buffer + through GstVaapiCodedBufferProxy user-data facility. + Besides, use a GAsyncQueue to maintain a thread-safe queue object of + coded buffers. + Partial fix for the following report: + https://bugzilla.gnome.org/show_bug.cgi?id=719530 + +2013-12-03 17:04:43 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst/vaapi/gstvaapiencode.c: + encoder: refactor status codes. + Drop obsolete or unused status codes. Align some status codes with the + decoder counterparts. + +2013-12-04 11:54:40 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264_priv.h: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2_priv.h: + * gst-libs/gst/vaapi/gstvaapiencoder_priv.h: + encoder: fix subclassing process. + Fix the GstVaapiEncoderClass parent class type. Make sure to validate + subclass hooks as early as possible, i.e. in gst_vaapi_encoder_init(), + thus avoiding useless run-time checks. Also simplify the subclass + initialization process to be less error prone. + +2013-12-03 16:11:46 +0100 Gwenole Beauchesne + + encoder: rework GstVaapiCodedBuffer and related proxy. + Refactor the GstVaapiCodedBuffer APIs so that to more clearly separate + public and private interfaces. Besides, the map/unmap APIs should not + be exposed as is but appropriate accessors should be provided instead. + * GstVaapiCodedBuffer: VA coded buffer abstraction + - gst_vaapi_coded_buffer_get_size(): get coded buffer size. + - gst_vaapi_coded_buffer_copy_into(): copy coded buffer into GstBuffer + * GstVaapiCodedBufferPool: pool of VA coded buffer objects + - gst_vaapi_coded_buffer_pool_new(): create a pool of coded buffers of + the specified max size, and bound to the supplied encoder + * GstVaapiCodedBufferProxy: pool-allocated VA coded buffer object proxy + - gst_vaapi_coded_buffer_proxy_new_from_pool(): create coded buf from pool + - gst_vaapi_coded_buffer_proxy_get_buffer(): get underlying coded buffer + - gst_vaapi_coded_buffer_proxy_get_buffer_size(): get coded buffer size + Rationale: more optimized transfer functions might be provided in the + future, thus rendering the map/unmap mechanism obsolete or sub-optimal. + https://bugzilla.gnome.org/show_bug.cgi?id=719775 + +2013-11-29 14:02:52 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + plugins: fix reference leaks of VA display objects. + Fix GstElement::set_context() implementation for all plug-in elements + to avoid leaking an extra reference to the VA display, thus preventing + correct cleanup of VA resources in GStreamer 1.2 builds. + +2013-11-29 13:56:12 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapivideocontext.c: + plugins: simplify gst_vaapi_ensure_display(). + Return earlier if the creation of a VA display failed. Likewise, simplify + gst_vaapi_video_context_propagate() now that we are guaranteed to have a + valid VA display. + +2013-11-28 19:08:28 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + plugins: fix memory leaks through GstVideoMeta maps. + When GstVideoMeta maps were used, the supporting functions incorrectly + used gst_buffer_get_memory() instead of gst_buffer_peek_memory(), thus + always increasing the associated GstMemory reference count and giving + zero chance to actually release that, and subsequently the VA display. + +2013-11-28 14:15:44 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_mpeg2.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiuploader.c: + plugins: use G_PARAM_STATIC_STRINGS. + This avoids a few string copies during initialization. + +2013-11-28 17:28:11 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideometa.c: + plugins: simplify VA video meta to only reference surface proxies. + Simplify GstVaapiVideoMeta to only hold a surface proxy, which is + now allocated from a surface pool. This also means that the local + reference to the VA surface is also gone, as it could be extracted + from the associated surface proxy. + +2013-11-28 16:51:37 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideobuffer.c: + * gst/vaapi/gstvaapivideobuffer.h: + * gst/vaapi/gstvaapivideometa.c: + * gst/vaapi/gstvaapivideometa.h: + plugins: drop obsolete functions. + Drop the following functions that are not longer used: + - gst_vaapi_video_buffer_new_with_surface() + - gst_vaapi_video_meta_new_with_surface() + - gst_vaapi_video_meta_set_surface() + - gst_vaapi_video_meta_set_surface_from_pool() + +2013-11-28 16:37:31 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideometa.c: + plugins: allow VA video meta to be allocated from surface proxy pools. + Fix gst_vaapi_video_meta_new_from_pool() to allocate VA surface proxies + from surface pools instead of plain VA surfaces. This is to simplify + allocations now that surface proxies are created from a surface pool. + +2013-11-28 17:25:05 +0100 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy_priv.h: + surfaceproxy: add copy function. + Add gst_vaapi_surface_proxy_copy() function that creates a new surface + proxy with the same information from the parent proxy, except that the + user-defined destroy notify function is not copied over. + The underlying VA surface is pushed back to the video pool only when + the last reference to the parent surface proxy is released. + +2013-11-28 15:56:53 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiencoder_objects.c: + * gst-libs/gst/vaapi/gstvaapiencoder_objects.h: + * gst/vaapi/gstvaapiencode.c: + vaapiencode: optimize _handle_frame() to avoid extra allocation. + Optimize gst_vaapiencode_handle_frame() to avoid extra memory allocation, + and in particular the GstVaapiEncObjUserData object. i.e. directly use + the VA surface proxy from the source buffer. This also makes the user + data attached to the GstVideoCodecFrame more consistent between both + the decoder and encoder plug-in elements. + +2013-11-28 15:14:43 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiencode.c: + vaapiencode: fix memory leaks in _push_frame() on error. + Simplify gst_vaapiencode_push_frame(), while also removing the call + to gst_video_encoder_negotiate() since this is implicit in _finish() + if caps changed. Also fixed memory leaks that occured on error. + +2013-11-28 13:57:54 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode.h: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_h264.h: + * gst/vaapi/gstvaapiencode_mpeg2.c: + vaapiencode: additional clean-ups. + Constify pointers wherever possible. Drop unused variables, and use + consistent variable names. Fix gst_vaapiencode_h264_allocate_buffer() + to correctly report errors, especially when in-place conversion from + bytestream to avcC format failed. + +2013-11-28 13:26:40 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode.h: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_h264.h: + * gst/vaapi/gstvaapiencode_mpeg2.c: + * gst/vaapi/gstvaapiencode_mpeg2.h: + vaapiencode: move common properties to base class. + Move "rate-control" mode and "bitrate" properties to the GstVaapiEncode + base class. The actual range of supported rate control modes is currently + implemented as a plug-in element hook. This ought to be determined from + the GstVaapiEncoder object instead, i.e. from libgstvaapi. + +2013-11-28 10:54:36 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_mpeg2.c: + vaapiencode: fix plugin description and debug name. + Align the plug-in debug category to its actual name. i.e. enable debug + logs through vaapiencode_ where is mpeg2, h264, etc. Fix + the plug-in element description to make it more consistent with other + VA-API plug-ins. + +2013-11-27 16:27:31 +0100 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst-libs/gst/video/Makefile.am: + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode.h: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_mpeg2.c: + vaapiencode: add initial support for GStreamer 0.10. + +2013-11-27 16:25:59 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstcompat.h: + libs: add more GstBuffer compat glue for GStreamer 0.10. + Add gst_buffer_new_allocate() and gst_buffer_fill() implementations. + Fix gst_buffer_new_wrapped_full() implementation to handle the destroy + notify function. + +2013-11-27 15:56:51 +0100 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/video/Makefile.am: + libs: always use built-in videoutils for GStreamer 0.10. + GStreamer 0.10.36 is the latest and ultimate version to be released + from the GStreamer 0.10 branch. i.e. no further releases are to be + made. So, we can safely enable the built-in videoutils replacement + now that they are in sync with the 0.10 branch. + +2013-11-27 15:47:38 +0100 Gwenole Beauchesne + + * ext/videoutils: + videoutils: update to master commit d4a15a5. + d4a15a5 video: fix compiler warning in header with C++11 / clang-3.1 + 86096cc videodecoder: minor cosmetic changes to align a bit more with master + b4b8b52 videodecoder: allow parse function to not use all data on adapter + 2145495 videodecoder: warn if frame list gets long + 36c3753 videodecoder: Also use the object lock to protect the output_state + 518c93d videodecoder: fix seeking again + 185fb63 video: Correct usage of the base class stream lock + 170e944 videodecoder: Expose _negotiate function + +2013-11-26 12:06:07 +0000 Matthieu Bouron + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + * tests/Makefile.am: + Fix build with GStreamer >= 1.3. + http://bugzilla.gnome.org/show_bug.cgi?id=715183 + Signed-off-by: Gwenole Beauchesne + +2013-11-26 17:56:59 +0100 Gwenole Beauchesne + + * configure.ac: + configure: disable encoders with GStreamer 0.10. + Don't try to build video encoders for GStreamer 0.10. Support code is + not there yet, and probably will never for such an ancient version. + +2013-11-26 17:26:44 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiencode.c: + vaapiencode: fix error handling while allocating output buffers. + Fix default GstVideoEncoder::allocate_buffer() implementation to properly + unmap the coded buffer prior to returning an error. + +2013-11-26 17:11:22 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiencode.c: + vaapiencode: fix error handling in _finish() hook. + Fix GstVideoEncoder::finish() implementation to really return possible + errors instead of GST_FLOW_OK. That is, fix check for timeout status. + +2013-11-26 16:34:14 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode.h: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_h264.h: + * gst/vaapi/gstvaapiencode_mpeg2.c: + * gst/vaapi/gstvaapiencode_mpeg2.h: + vaapiencode: minor clean-ups. + Add a GST_VAAPIENCODE_CAST() helper to avoid run-time checks against + the GObject type system. We are guaranteed to only deal with the same + plug-in element object. + +2013-11-26 15:31:03 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_mpeg2.c: + vaapiencode: fix support for raw YUV sink buffers. + Allow vaapiencode plug-in elements to encode from raw YUV buffers. + The most efficient way to do so is to let the vaapiencode elements + allocate a buffer pool, and subsequently buffers from it. This means + that upstream elements are expected to honour downstream pools. + If upstream elements insist on providing their own allocated buffers + to the vaapiencode elements, then it possibly would be more efficient + to insert a vaapipostproc element before the vaapiencode element. + This is because vaapipostproc currently has better support than other + elements for "foreign" raw YUV buffers. + +2013-11-26 15:12:59 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiencode.c: + vaapiencode: fix support for GStreamer 1.2. + +2013-11-07 17:42:21 +0800 Wind Yuan + + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_mpeg2.c: + vaapiencode: initial port to GStreamer 1.2. + Signed-off-by: Gwenole Beauchesne + +2013-11-20 16:21:32 +0800 XuGuangxin + + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapiencode_mpeg2.c: + * gst/vaapi/gstvaapiencode_mpeg2.h: + plugins: add mpeg2 encoder element. + Add GstVaapiEncodeMPEG2 element object. The actual plug-in element + is called "vaapiencode_mpeg2". + Valid properties: + - rate-control: rate control mode (default: cqp - constant QP) + - bitrate: desired bitrate in kbps (default: auto-calculated) + - key-period: maximal distance between two key frames (default: 30) + - max-bframes: number of B-frames between I and P (default: 2) + - quantizer: constant quantizer (default: 8) + Signed-off-by: Gwenole Beauchesne + +2013-07-29 16:02:56 +0800 Wind Yuan + + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapiencode_h264.c: + * gst/vaapi/gstvaapiencode_h264.h: + plugins: add h264 encoder element. + Add GstVaapiEncodeH264 element object. The actual plug-in element + is called "vaapiencode_h264". + Valid properties: + - rate-control: rate control mode (default: none) + - bitrate: desired bitrate in kbps (default: auto-calculated) + - key-period: maximal distance between two key frames (default: 30) + - num-slices: number of slices per frame (default: 1) + - max-bframes: number of B-frames between I and P (default: 0) + - min-qp: minimal quantizer (default: 1) + - init-qp: initial quantizer (default: 26) + Signed-off-by: Gwenole Beauchesne + +2013-07-29 13:44:48 +0800 Wind Yuan + + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapiencode.c: + * gst/vaapi/gstvaapiencode.h: + plugins: add base encoder element. + vaapiencode element is based on GstVideoEncoder APIs. + Signed-off-by: Gwenole Beauchesne + +2013-11-20 16:20:15 +0800 XuGuangxin + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.h: + * gst-libs/gst/vaapi/gstvaapiencoder_mpeg2_priv.h: + encoder: add mpeg2 encoder. + Add initial support for MPEG-2 encoding. I/P/B frames are supported. + Signed-off-by: Gwenole Beauchesne + +2013-07-29 15:46:11 +0800 Wind Yuan + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.c: + * gst-libs/gst/vaapi/gstvaapiencoder_h264.h: + * gst-libs/gst/vaapi/gstvaapiencoder_h264_priv.h: + encoder: add h264 encoder. + Signed-off-by: Gwenole Beauchesne + +2013-07-29 13:34:06 +0800 Wind Yuan + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiencoder.c: + * gst-libs/gst/vaapi/gstvaapiencoder.h: + * gst-libs/gst/vaapi/gstvaapiencoder_objects.c: + * gst-libs/gst/vaapi/gstvaapiencoder_objects.h: + * gst-libs/gst/vaapi/gstvaapiencoder_priv.h: + Add initial infrastructure for video encoding. + Add initial API for video encoding: only basic interfaces and small + encoder objects are implemented so far. + Signed-off-by: Gwenole Beauchesne + +2013-07-29 15:41:23 +0800 Wind Yuan + + * configure.ac: + * gst-libs/gst/Makefile.am: + * gst-libs/gst/base/Makefile.am: + * gst-libs/gst/base/gstbitwriter.c: + * gst-libs/gst/base/gstbitwriter.h: + * gst-libs/gst/vaapi/Makefile.am: + libs: add generic bitstream writer. + GstBitWriter provides a bit writer that can write any number of bits + to a pre-allocated memory buffer. Helper functions are also provided + to write any number of bits from 8, 16, 32 and 64 bit variables. + Signed-off-by: Gwenole Beauchesne + +2013-07-12 22:07:59 +0800 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + libs: add support for rate-control to GstVaapiContext. + Extend GstVaapiContextInfo structure to hold the desired rate control + mode for encoding purposes. For decoding purposes, this field is not + used and it is initialized to GST_VAAPI_RATECONTROL_NONE. + Signed-off-by: Gwenole Beauchesne + +2013-07-12 21:33:32 +0800 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapitypes.h: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + * gst-libs/gst/vaapi/gstvaapivalue.c: + * gst-libs/gst/vaapi/gstvaapivalue.h: + libs: add rate-control attributes. + Add GstVaapiRateControl types and GType values in view to supporting + rate controls for encoding. This is meant to be used for instance in + GstVaapiContext. + Signed-off-by: Gwenole Beauchesne + +2013-11-22 11:56:51 +0100 Gwenole Beauchesne + + * configure.ac: + Bump version for development. + +2013-11-22 11:28:09 +0100 Gwenole Beauchesne + + * gst/vaapi/Makefile.am: + build: fix for Wayland headers not in standard include dirs. + Fix build when Wayland headers don't live in plain system include dirs + like /usr/include but rather in /usr/include/wayland for instance. + Original patch written by Dominique Leuenberger + https://bugzilla.gnome.org/show_bug.cgi?id=712282 + +2013-11-14 10:58:37 +0000 Ross Burton + + * gst-libs/gst/vaapi/Makefile.am: + build: link libgstvaapi-wayland against videoutils. + This library is using symbols that don't exist in GStreamer 0.10 so + it needs to link to built-in implementation (libgstvaapi-videoutils). + https://bugzilla.gnome.org/show_bug.cgi?id=712282 + Signed-off-by: Ross Burton + Signed-off-by: Gwenole Beauchesne + +2013-11-22 11:15:57 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst/vaapi/gstvaapipostproc.c: + vaapostproc: fix memory leaks. + Destroy VPP output surface pool on exit. Also avoid a possible crash + in double-free situation caused by insufficiently reference counted + array of formats returned during initialization. + +2013-11-22 10:19:06 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + vaapipostproc: fix and optimize advanced deinterlacing mode. + Fix advanced deinterlacing modes with VPP to track only up to 2 past + reference buffers. This used to be 3 past reference buffers but this + doesn't fit with the existing decode pipeline that only has 4 extra + scratch surfaces. + Also optimize references tracking to be only enabled when needed, i.e. + when advanced deinterlacing mode is used. This means that we don't + need to track past references for basic bob or weave deinterlacing. + +2013-11-22 10:04:45 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: fix "mixed" mode deinterlacing. + In "mixed" interlaced streams, the buffer contains additional flags that + specify whether the frame contained herein is interlaced or not. This means + that we can alternatively get progressive or interlaced frames. Make sure + to disable deinterlacing at the VPP level when the source buffer is no longer + interlaced. + +2013-11-22 09:49:30 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: fix memory leaks with advanced deinterlacing. + Fix memory leaks with advanced deinterlacing, i.e. when we keep track + of past buffers. Completely reset the deinterlace state, thus destroying + any buffer currently held, on _start(), _stop() and _destroy(). + +2013-11-22 06:59:51 +0100 Gwenole Beauchesne + + * README: + README: updates. + - GStreamer 1.2 APIs are supported ; + - Video Processing (VA/VPP) features. + +2013-11-22 06:45:22 +0100 Gwenole Beauchesne + + * README: + README: update for GStreamer >= 1.0.x and VPP features. + +2013-11-22 06:37:12 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/glibcompat.h: + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.h: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.h: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.h: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.h: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.h: + * gst-libs/gst/vaapi/gstvaapidisplay_drm.c: + * gst-libs/gst/vaapi/gstvaapidisplay_drm.h: + * gst-libs/gst/vaapi/gstvaapidisplay_drm_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.h: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.h: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplaycache.c: + * gst-libs/gst/vaapi/gstvaapidisplaycache.h: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + * gst-libs/gst/vaapi/gstvaapiimagepool.h: + * gst-libs/gst/vaapi/gstvaapiminiobject.h: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapiobject.h: + * gst-libs/gst/vaapi/gstvaapiobject_priv.h: + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapisurface_priv.h: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy_priv.h: + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapitexture.h: + * gst-libs/gst/vaapi/gstvaapitypes.h: + * gst-libs/gst/vaapi/gstvaapiutils_x11.c: + * gst-libs/gst/vaapi/gstvaapiutils_x11.h: + * gst-libs/gst/vaapi/gstvaapivalue.c: + * gst-libs/gst/vaapi/gstvaapivalue.h: + * gst-libs/gst/vaapi/gstvaapivideopool.c: + * gst-libs/gst/vaapi/gstvaapivideopool.h: + * gst-libs/gst/vaapi/gstvaapivideopool_priv.h: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_drm.c: + * gst-libs/gst/vaapi/gstvaapiwindow_drm.h: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.h: + * gst-libs/gst/vaapi/gstvaapiwindow_priv.h: + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11_priv.h: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapidecode.h: + * gst/vaapi/gstvaapidownload.h: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapipostproc.h: + * gst/vaapi/gstvaapisink.h: + * gst/vaapi/gstvaapivideoconverter_glx.h: + * tests/image.c: + * tests/image.h: + * tests/output.h: + * tests/test-display.c: + * tests/test-jpeg.c: + * tests/test-jpeg.h: + * tests/test-mpeg4.c: + * tests/test-mpeg4.h: + * tests/test-surfaces.c: + * tests/test-windows.c: + legal: update copyright notice dates. + +2013-11-22 05:57:18 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/glibcompat.h: + * gst-libs/gst/vaapi/gstcompat.h: + * gst-libs/gst/vaapi/gstvaapicodec_objects.c: + * gst-libs/gst/vaapi/gstvaapicodec_objects.h: + * gst-libs/gst/vaapi/gstvaapicompat.h: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapidebug.h: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_dpb.c: + * gst-libs/gst/vaapi/gstvaapidecoder_dpb.h: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.h: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.h: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.h: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.h: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst-libs/gst/vaapi/gstvaapidecoder_unit.c: + * gst-libs/gst/vaapi/gstvaapidecoder_unit.h: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.h: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_drm.c: + * gst-libs/gst/vaapi/gstvaapidisplay_drm.h: + * gst-libs/gst/vaapi/gstvaapidisplay_drm_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.h: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplaycache.c: + * gst-libs/gst/vaapi/gstvaapidisplaycache.h: + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst-libs/gst/vaapi/gstvaapifilter.h: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapiimage_priv.h: + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + * gst-libs/gst/vaapi/gstvaapiimagepool.h: + * gst-libs/gst/vaapi/gstvaapiminiobject.c: + * gst-libs/gst/vaapi/gstvaapiminiobject.h: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapiobject.h: + * gst-libs/gst/vaapi/gstvaapiobject_priv.h: + * gst-libs/gst/vaapi/gstvaapiparser_frame.c: + * gst-libs/gst/vaapi/gstvaapiparser_frame.h: + * gst-libs/gst/vaapi/gstvaapipixmap.c: + * gst-libs/gst/vaapi/gstvaapipixmap.h: + * gst-libs/gst/vaapi/gstvaapipixmap_priv.h: + * gst-libs/gst/vaapi/gstvaapipixmap_x11.c: + * gst-libs/gst/vaapi/gstvaapipixmap_x11.h: + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapiprofile.h: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.h: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapisurface_priv.h: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy_priv.h: + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapitexture.h: + * gst-libs/gst/vaapi/gstvaapitypes.h: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + * gst-libs/gst/vaapi/gstvaapiutils_x11.c: + * gst-libs/gst/vaapi/gstvaapiutils_x11.h: + * gst-libs/gst/vaapi/gstvaapivalue.c: + * gst-libs/gst/vaapi/gstvaapivalue.h: + * gst-libs/gst/vaapi/gstvaapivideopool.c: + * gst-libs/gst/vaapi/gstvaapivideopool.h: + * gst-libs/gst/vaapi/gstvaapivideopool_priv.h: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_drm.c: + * gst-libs/gst/vaapi/gstvaapiwindow_drm.h: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.h: + * gst-libs/gst/vaapi/gstvaapiwindow_priv.h: + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11_priv.h: + * gst-libs/gst/vaapi/gstvaapiworkarounds.h: + * gst-libs/gst/vaapi/sysdeps.h: + * gst-libs/gst/vaapi/video-format.c: + * gst-libs/gst/vaapi/video-format.h: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecode.h: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapidownload.h: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + * gst/vaapi/gstvaapiupload.c: + * gst/vaapi/gstvaapiupload.h: + * gst/vaapi/gstvaapiuploader.c: + * gst/vaapi/gstvaapiuploader.h: + * gst/vaapi/gstvaapivideobuffer.c: + * gst/vaapi/gstvaapivideobuffer.h: + * gst/vaapi/gstvaapivideobufferpool.c: + * gst/vaapi/gstvaapivideobufferpool.h: + * gst/vaapi/gstvaapivideocontext.c: + * gst/vaapi/gstvaapivideocontext.h: + * gst/vaapi/gstvaapivideoconverter_glx.c: + * gst/vaapi/gstvaapivideoconverter_glx.h: + * gst/vaapi/gstvaapivideoconverter_x11.c: + * gst/vaapi/gstvaapivideoconverter_x11.h: + * gst/vaapi/gstvaapivideomemory.c: + * gst/vaapi/gstvaapivideomemory.h: + * gst/vaapi/gstvaapivideometa.c: + * gst/vaapi/gstvaapivideometa.h: + * gst/vaapi/gstvaapivideometa_texture.c: + * gst/vaapi/gstvaapivideometa_texture.h: + * tests/codec.c: + * tests/codec.h: + * tests/decoder.c: + * tests/decoder.h: + * tests/image.c: + * tests/image.h: + * tests/output.c: + * tests/output.h: + * tests/simple-decoder.c: + * tests/test-decode.c: + * tests/test-decode.h: + * tests/test-display.c: + * tests/test-filter.c: + * tests/test-h264.c: + * tests/test-h264.h: + * tests/test-jpeg.c: + * tests/test-jpeg.h: + * tests/test-mpeg2.c: + * tests/test-mpeg2.h: + * tests/test-mpeg4.c: + * tests/test-mpeg4.h: + * tests/test-surfaces.c: + * tests/test-textures.c: + * tests/test-vc1.c: + * tests/test-vc1.h: + * tests/test-windows.c: + legal: add per-file authorship information. + Credit original authors on a per-file basis as we cannot expect people + to know all country-specific rules, or bother browsing through the git + history. + +2013-11-21 23:52:43 +0100 Gwenole Beauchesne + + * NEWS: + * configure.ac: + 0.5.7. + +2013-11-21 23:51:59 +0100 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2013-11-21 23:17:59 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.h: + decoder: don't include obsolete headers. + The header was removed from the public + set of APIs. So, don't make public headers (gstvaapidecoder.h) depend + on private files. + +2013-11-18 16:20:43 +0100 Gwenole Beauchesne + + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: add initial support for GStreamer 1.2. + Port vaapipostproc element to GStreamer 1.2. Support is quite minimal + right now so that to cope with auto-plugging issues/regressions. e.g. + this happens when the correct set of expected caps are being exposed. + This means that, currently, the proposed caps are not fully accurate. + +2013-11-01 10:22:17 +0800 Halley Zhao + + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + vaapipostproc: add support for denoise and sharpen filters. + Signed-off-by: Gwenole Beauchesne + +2013-11-21 19:52:56 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + vaapipostproc: add support for advanced deinterlacing. + Add initial support for advanced deinterlacing. The history buffer + size is arbitrarily set to 3 references for now. + +2013-11-21 22:32:03 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: fix deinterlacing with VPP. + Fix basic deinterlacing flags provided to gst_vaapi_set_deinterlacing() + for the first field. Render flags were supplied instead of the actual + deinterlacing flags (deint_flags). + +2013-11-21 15:08:55 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: fix transform caps. + Fix GstBaseTransform::transform_caps() implementation to always return + the complete set of allowed sink pad caps (unfixated) even if the src + pad caps we are getting are fixated. Rationale: there are just so many + possible combinations, and it was wrong to provide a unique set anyway. + As a side effect, this greatly simplifies the ability to derive src pad + caps from fixated sink pad caps. + +2013-11-01 10:31:13 +0800 Halley Zhao + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst-libs/gst/vaapi/gstvaapifilter.h: + filter: add helper to specify references for deinterlacing. + Add gst_vaapi_fitler_set_deinterlacing_references() API to submit the + list of surfaces used for forward or backward reference in advanced + deinterlacing mode, e.g. Motion-Adaptive, Motion-Compensated. + The list of surfaces used as deinterlacing references shall be live + until the next call to gst_vaapi_filter_process(). + Signed-off-by: Gwenole Beauchesne + +2013-11-21 18:44:46 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst-libs/gst/vaapi/gstvaapifilter.h: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst/vaapi/gstvaapipostproc.c: + * tests/test-filter.c: + filter: fix semantics of deinterlacing flags. + Fix deinterlacing flags to make more sense. The TFF (top-field-first) + flag is meant to specify the organization of reference frames used in + advanced deinterlacing modes. Introduce the more explicit flag TOPFIELD + to specify that the top-field of the supplied input surface is to be + used for deinterlacing. Conversely, if not set, this means that the + bottom field of the supplied input surface will be used instead. + +2013-11-21 17:20:28 +0100 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst-libs/gst/vaapi/gstvaapifilter.h: + filter: add helpers to check for supported/active operation. + Add a couple of helper functions: + - gst_vaapi_filter_has_operation(): checks whether the VA driver + advertises support for the supplied operation ; + - gst_vaapi_filter_use_operation(): checks whether the supplied + operation was already enabled to its non-default value. + +2013-11-20 15:10:17 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + libs: fix GstVaapiSurfaceProxy destroy notify call site. + The user-defined destroy notify function is meant to be called only when + the surface proxy was fully released, i.e. once it actually released the + VA surface back to the underlying pool. + +2013-08-29 13:44:22 +0800 XuGuangxin + + * gst-libs/gst/vaapi/gstvaapivideopool.c: + * gst-libs/gst/vaapi/gstvaapivideopool_priv.h: + libs: make GstVaapiVideoPool thread-safe. + https://bugzilla.gnome.org/show_bug.cgi?id=707108 + Signed-off-by: Gwenole Beauchesne + +2013-08-29 14:04:06 +0800 XuGuangxin + + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + libs: robustify decoder objects and surface proxy initialization. + Fix GstVaapiPicture, GstVaapiSlice and GstVaapiSurfaceProxy initialization + sequences to have the expected default values set beforehand in case of an + error raising up further during creation. i.e. make it possible to cleanly + destroy those partially initialized objects. + https://bugzilla.gnome.org/show_bug.cgi?id=707108 + Signed-off-by: Gwenole Beauchesne + +2013-11-21 11:01:41 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: fix decoder flush. + There are situations where gst_video_decoder_flush() is called, and + this subsequently produces a gst_video_decoder_reset() that kills the + currently active GstVideoCodecFrame. This means that it no longer + exists by the time we reach GstVideoDecoder::finish() callback, thus + possibly resulting in a crash if we assumed spare data was still + available for decode (current_frame_size > 0). + Try to honour GstVideoDecoder::reset() behaviour from GStreamer 1.0 + that means a flush, thus performing the actual operations there like + calling gst_video_decoder_have_frame() if pending data is available. + +2013-11-20 19:21:05 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecode.h: + vaapidecode: fix dead-locks with decoder task. + Review all interactions between the main video decoder stream thread + and the decode task to derive a correct sequence of operations for + decoding. Also avoid extra atomic operations that become implicit under + the GstVideoDecoder stream lock. + +2013-08-29 14:12:10 +0800 XuGuangxin + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: fix hard reset for seek cases. + Fix hard reset for seek cases by flushing the GstVaapiDecoder queue + and completely purge any decoded output frame that may come out from + it. At this stage, the GstVaapiDecoder shall be in a complete clean + state to start decoding over new buffers. + Signed-off-by: Gwenole Beauchesne + +2013-08-29 14:12:10 +0800 XuGuangxin + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecode.h: + vaapidecode: drop decode timeout, always wait for a free surface. + vaapidecode used to wait up to one second past the expected time of + presentation for the last decoded frame. This is not realistic in + practice when it comes to video pause/resume. Changed behaviour to + unconditionnally wait for a free VA surface prior to continuing the + decoding. The decode task will continue pushing the output frames to + the downstream element while also reporting errors at the same time + to the main thread. + https://bugzilla.gnome.org/show_bug.cgi?id=707108 + Signed-off-by: Gwenole Beauchesne + +2013-11-20 10:56:28 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: fix srcpad caps for GStreamer 1.2. + The srcpad caps exposed for GStreamer 1.2 were missing any useful info + like framerate, pixel-aspect-ratio, interlace-mode et al. Not to mention + that it relied on possibly un-initialized data. Fix srcpad caps to be + initialized from a sanitized copy of GstVideoDecoder output state caps. + Note: the correct way to expose the srcpad caps triggers an additional + issue in core GStreamer auto-plugging capabilities as the correct caps + to be exposed should be format=ENCODED with memory:VASurface caps feature + at the minimum. In some situations, we could determine the underlying + VA surface format, but this is not always possible. e.g. cases where it + is not allowed to expose the underlying VA surface data, or when the + VA driver implementation cannot actually provide such information. + +2013-11-20 10:45:23 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapisink.c: + plugins: streamline VA formats exposed in caps to a realistic set. + Currently, the decoder only supports YUV 4:2:0 output. So, expose the + output formats for GStreamer 1.2 in caps to a realistic subset. This + means NV12, I420 or YV12 but also ENCODED if we cannot determine the + underlying VA surface format, or if it is actually not allowed to get + access to the surface contents. + +2013-11-20 10:37:36 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapisink.c: + plugins: expose the expected format for GstVideoGLTextureUploadMeta. + Fix vaapidecode srcpad caps to only expose RGBA video format for the + meta:GstVideoGLTextureUploadMeta feature. That's only what is supported + so far. Besides, drop this meta from the vaapisink sinkpad caps since + we really don't support that for rendering. + https://bugzilla.gnome.org/show_bug.cgi?id=711828 + +2013-11-18 18:25:21 +0100 Gwenole Beauchesne + + * configure.ac: + configure: automatically detect GStreamer API version. + Automatically detect GStreamer API version. The --with-gstreamer-api + configure option now defaults to "autodetect" and configure then tries + to derive the GStreamer API version from the highest version based on + what pkg-config --modversion would report. + https://bugzilla.gnome.org/show_bug.cgi?id=711657 + +2013-11-01 13:43:11 +0800 Wind Yuan + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: fix support for raw YUV data upload on GStreamer 1.0. + Fix raw YUV data uploaded as in the following pipeline: + $ gst-launch-1.0 filesrc video.yuv ! videoparse ! vaapipostproc ! vaapisink + The main reason why it failed was that the videoparse element simply + allocates GstBuffer with raw data chunk'ed off the sink pad without + any prior knowledge of the actual frame info. i.e. it basically just + calls gst_adapter_take_buffer(). + We could avoid the extra copy performed in vaapipostproc if the videoparse + element was aware of the downstream pool and bothers copying line by + line, for each plane. This means that, for a single frame per buffer, + the optimizatin will be to allocate the video buffer downstream, map + it, and copy each line that is coming through until we need to fills + in the successive planes. + Still, optimized raw YUV uploads already worked with the following: + $ gst-launch-1.0 videotestsrc ! vaapipostproc ! vaapisink + https://bugzilla.gnome.org/show_bug.cgi?id=711250 + [clean-ups, fixed error cases to unmap and unref outbuf] + Signed-off-by: Gwenole Beauchesne + +2013-11-16 07:02:24 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: try to downgrade deinterlace-method when needed. + If the currently selected deinterlacing method is not supported by the + underlying hardware, then try to downgrade the method to a supported one. + At the minimum, basic bob-deinterlacing shall always be supported. + +2013-11-15 19:04:07 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: add initial support for deinterlacing with VPP. + Allow basic bob-deinterlacing to work when VPP is enabled. Currently, + this only covers bob-deinterlacing when the output pixel format is + explicitly set. + +2013-11-15 17:14:04 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: fix build on 64-bit platforms with GStreamer 0.10. + The size argument for GstBaseTransform::transform_size() hook is a + guint in GStreamer 0.10 APIs but a gsize in GStreamer >= 1.0.X APIs. + +2013-10-18 18:08:25 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + vaapipostproc: add initial support for scaling. + Add initial support for basic scaling with size specified through the + "width" and "height" properties. If either user-provided dimension is + zero and "force-aspect-ratio" is set to true (the default), then the + other dimension is scaled to preserve the aspect ratio. + +2013-10-18 18:08:25 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + vaapipostproc: add initial support for color conversion. + If VPP is available, we always try to implicitly convert the source + buffer to the "native" surface format for the underlying accelerator. + This means that no optimization is performed yet to propagate raw YUV + buffers to the downstream element as is, if VPP is available. i.e. it + will always cause a color conversion. + +2013-10-16 11:23:03 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: fix bug when user disabled deinterlacing. + Fix pipeline error / hang when the user disabled deinterlacing through + the deinterlace-mode=disabled property setting. + +2013-10-16 11:20:50 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + vaapipostproc: factor out operations to be applied into flags. + Even if we only support deinterlacing for now, use flags to specify + which filters are to be applied to each frame we receive in transform(). + This is preparatory work for integrating new filters. + +2013-10-04 15:37:24 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + vaapipostproc: add support for raw YUV video source buffers. + Allow video processing from raw YUV buffers coming from the sink pad, + while still producing a VA surface for the downstream elements. + +2013-10-04 16:00:56 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: add support for "mixed" interlace mode. + Add support for "mixed" interlace-mode, whereby the video frame buffer + shall be deinterlaced only if its flags mention that's actually an + interlaced frame buffer. + +2013-10-03 19:04:07 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstcompat.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + * gst/vaapi/gstvaapivideobuffer.c: + * gst/vaapi/gstvaapivideobuffer.h: + vaapipostproc: rework plug-in element. + Rewrite the vaapipostproc plug-in element so that it derives from + GstBaseTransform, thus simplifying the caps negotiation process. + +2013-10-09 17:25:10 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideobufferpool.c: + * gst/vaapi/gstvaapivideomemory.c: + * gst/vaapi/gstvaapivideomemory.h: + plugins: fix and optimize check for buffer pool allocator params. + Reset the buffer pool allocator only if the config caps changed in a + sensible way: format or resolution change. i.e. don't bother with + other caps like colorimetry et al. as this doesn't affect the way to + allocate VA surfaces or images. + +2013-10-09 10:33:55 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + plugins: enable memory maps for read & write with direct-rendering. + Enable read and write mappings only if direct-rendering is supported. + Otherwise, this means that we may need to download data from the VA + surface first for correctness, even if the VA surface doesn't need to + be read at all. i.e. sometimes, READWRITE mappings are meant for + surfaces that are written to first, and read afterwards for further + processing. + https://bugzilla.gnome.org/show_bug.cgi?id=704078 + +2013-10-09 10:06:40 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + plugins: fix check for direct-rendering support. + Fix check for direct-rendering if the creation of VA surfaces with + an explicit pixel format is not support, e.g. VA-API < 0.34.0, and + that we tried to allocate a VA surface based on the corresponding + chroma type. i.e. in that particular case, we have to make sure that + the derived image has actually the expected format. + +2013-10-09 09:47:18 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideobufferpool.c: + * gst/vaapi/gstvaapivideomemory.c: + * gst/vaapi/gstvaapivideomemory.h: + plugins: fix buffer pool reset_buffer() to reset memory resources. + Fix GstVaapiVideoBufferPool::reset_buffer() to reset the underlying + memory resources, and more particularly the VA surface proxy. Most + importantly, the GstVaapiVideoMeta is retained. Cached surface in + memory are released, thus triggering a new allocation the next time + we need to map the buffer. + +2013-10-09 09:33:56 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + * gst/vaapi/gstvaapivideomemory.h: + plugins: fix GstVaapiVideoMemory to allocate VA surface proxies. + Make sure GstVaapiVideoMemory allocates VA surface proxies from a + pool stored in the parent VA memory allocator. + This fixes the following scenario: + - VA video buffer 1 is allocated from a buffer pool + - Another video buffer is created, and inherits info from buffer 1 + - Buffer 1 is released, thus pushing it back to the buffer pool + - New buffer alloc request comes it, this yields buffer 1 back + - At this stage, buffers 1 and 2 still share the same underlying VA + surface, but buffer 2 was already submitted downstream for further + processing, thus conflicting with additional processing we were + about to perform on buffer 1. + Maybe the core GstBufferPool implementation should have been fixed + instead to actually make sure that the returned GstBuffer memory we + found from the pool is writable? + +2013-10-04 19:34:32 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapiuploader.c: + plugins: create a proxy for GstVaapiUploader allocated buffers. + Always make sure to allocate a VA surface proxy for GstVaapiUploader + allocated buffers, i.e. make gst_vaapi_uploader_get_buffer() allocate + a proxy surface. + This fixes cases where we want to retain the underlying surface longer, + instead of releasing it back to the surface pool right away. + +2013-10-04 19:30:36 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapipostproc.c: + plugins: add helper function to disable deinterlacing in caps. + Add gst_caps_set_interlaced() helper function that would reset the + interlace-mode field to "progressive" for GStreamer >= 1.0, or the + interlaced field to "false" for GStreamer 0.10. + +2013-10-01 18:26:39 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapifilter.c: + filter: fix memory leak of VPP operations. + Fix ensure_operations() to release the VPP operations array if non + NULL, prior to returning to the caller. The former function was also + renamed to a more meaningful get_operations() since the caller owns + the returned array that needs to be released. + +2013-09-04 13:53:25 +0800 Zhao Halley + + * gst-libs/gst/vaapi/gstvaapifilter.c: + filter: fix first-time operation lookup. + Fix first-time operation lookup through find_operation() if the set + of supported operations was not initially determined through the + gst_vaapi_filter_get_operations() helper function. + Signed-off-by: Gwenole Beauchesne + +2013-09-04 13:53:25 +0800 Zhao Halley + + * gst-libs/gst/vaapi/gstvaapifilter.c: + filter: fix colorbalance related subtypes. + Fix intiialization of GstVaapiFilterOpData for colorbalance related + operations. In particular, fill in the va_subtype field accordingly. + Signed-off-by: Gwenole Beauchesne + +2013-09-30 17:08:12 +0200 Víctor Manuel Jáquez Leal + + * gst-libs/gst/vaapi/gstvaapifilter.c: + filter: fix VA-API 0.34.0 symbol guards. + VASurfaceAttrib and VAProcFilterParameterBufferType are symbols + that need to be guarded for libva 0.34 and 0.33, respectively. + https://bugzilla.gnome.org/show_bug.cgi?id=709102 + Signed-off-by: Gwenole Beauchesne + +2013-10-01 17:57:11 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapisink.c: + plugins: hanle the context query in any pad. + Also this patch simplifies the code, since now the query is common for the + decoder and the sink. + https://bugzilla.gnome.org/show_bug.cgi?id=709200 + +2013-10-01 12:09:44 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapivideocontext.c: + plugins: query upstream element for a GstContext. + Fix gst_vaapi_video_context_prepare() to also query upstream elements + for a valid GstContext. Improve comments regarding the steps used to + lookup or build that context, thus conforming to the GstContext API + recommendations. + https://bugzilla.gnome.org/show_bug.cgi?id=709112 + Signed-off-by: Gwenole Beauchesne + +2013-09-26 15:21:24 +0200 Gwenole Beauchesne + + * configure.ac: + * debian.upstream/control.in: + Fix detection and packaging of GStreamer 1.2.x builds. + The GStreamer 1.2.x packages sticked to the naming convention for 1.0.x + packages, i.e. -1.0 suffix. However, for gstreamer-vaapi packaging + purposes, update the versioning to -1.2 suffix instead. + +2013-07-15 13:41:00 +0200 Víctor Manuel Jáquez Leal + + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecode.h: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapivideometa_texture.c: + * gst/vaapi/gstvaapivideometa_texture.h: + plugins: add support for GstVideoGLTextureUploadMeta. + If the allocation meta GST_VIDEO_GL_TEXTURE_UPLOAD_META_API_TYPE is + requested, and more specifically under a GLX configuration, then add + the GstVideoGLTextureUploadMeta to the output buffer. + https://bugzilla.gnome.org/show_bug.cgi?id=703236 + Signed-off-by: Gwenole Beauchesne + +2013-07-04 11:03:52 +0300 Sreerenj Balachandran + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapivideomemory.h: + plugins: add support for GstCaps features. + Move VA video buffer memory from "video/x-surface,type=vaapi" format, + as expressed in caps, to the more standard use of caps features. i.e. + add "memory:VASurface" feature attribute to the associated caps. + https://bugzilla.gnome.org/show_bug.cgi?id=703271 + Signed-off-by: Gwenole Beauchesne + +2013-07-12 12:58:57 -0400 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapisink.c: + plugins: improve ::query() debugging messages. + Fix gst_vaapidecode_query() to correctly display the query type name, + instead of randomly displaying that we shared the underlying display. + Also add debug info for the GstVaapiSink::query() handler, i.e. the + supplied query type name actually. + Signed-off-by: Gwenole Beauchesne + +2013-07-12 12:58:57 -0400 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapisink.c: + plugins: add support for GstContext API. + Add support for the new GstContext API from GStreamer 1.2.x. + - implement the GstElement::set_context() hook ; + - reply to the `context' query from downstream elements. + https://bugzilla.gnome.org/show_bug.cgi?id=703235 + Signed-off-by: Gwenole Beauchesne + +2013-05-22 12:07:52 -0400 Víctor Manuel Jáquez Leal + + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapivideocontext.c: + * gst/vaapi/gstvaapivideocontext.h: + plugins: add compat layer for GstVideoContext. + Add thin compatibility layer for the deprecated GstVideoContext API. + For GStreamer API >= 1.2, this involves the following two functions: + - gst_vaapi_video_context_prepare(): queries if a context is already + set in the pipeline ; + - gst_vaapi_video_context_propagate(): propagates the newly-created + context to the rest of the pipeline. + https://bugzilla.gnome.org/show_bug.cgi?id=703235 + Signed-off-by: Gwenole Beauchesne + +2013-05-21 12:42:39 -0400 Víctor Manuel Jáquez Leal + + * configure.ac: + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapivideobuffer.c: + plugins: initial port to GStreamer 1.2. + Port vaapidecode and vaapisink plugins to GStreamer API >= 1.2. This + is rather minimalistic so that to test the basic functionality. + Disable vaapipostproc plugin for now as further polishing is needed. + Also disable GstVideoContext interface support since this API is now + gone in 1.2.x. This is preparatory work for GstContext support. + https://bugzilla.gnome.org/show_bug.cgi?id=703235 + Signed-off-by: Gwenole Beauchesne + +2013-09-24 16:21:11 +0200 Gwenole Beauchesne + + * tests/simple-decoder.c: + tests: simple-decoder: fix for non-X11 backends. + Don't try to create pixmaps if we have not requested that feature. This + fixes execution for non-X11 backends, and most specifically DRM video + output mode. + +2013-09-24 16:22:59 +0200 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit b33bd32. + b33bd32 jpeg: fix and optimize scan for next marker code + +2013-09-23 19:14:56 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + jpeg: fix calculation of MCU count. + Fix calculation of MCU count for image sizes that are not a multiple + of 8 pixels in either dimension, but also for non-common sampling + factors like 4:2:2 in non-interleaved mode. + +2013-09-23 16:49:41 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + jpeg: add support for multiscan images. + Add support for images with multiple scans per frame. The Huffman table + can be updated before SOS, and thus possibly requiring multiple uploads + of Huffman tables to the VA driver. So, the latter must be able to cope + with multiple VA buffers of type 'huffman-table' and with the correct + sequential order. + +2013-09-23 11:41:52 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + jpeg: improve robustness when packets are missing. + Improve robustness when some expected packets where not received yet + or that were not correctly decoded. For example, don't try to decode + a picture if there was no valid frame headers. + +2013-09-20 16:46:43 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + jpeg: minor clean-ups. + Improve debugging and error messages. Rename a few variables to fit the + existing naming conventions. Change some fatal asserts to non-fatal + error codes. + +2013-09-20 10:12:08 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + jpeg: rework and optimize parser. + Split the input buffer data into decoder units that represent a JPEG + segment. Handle scan decoder unit specifically so that it can include + both the scan header (SOS) but also any other ECS or RSTi segment. + That way, we parse the input buffer stream only once at the gst-vaapi + level instead of (i) in gst_vaapi_decoder_jpeg_parse() to split the + stream into frames SOI .. EOI and (ii) in decode_buffer() to further + determine segment boundaries and decode them. + In practice, this is a +15 to +25% performance improvement. + +2013-09-17 14:29:54 +0800 Junfeng Xu + + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + jpeg: handle comment segments. + Fix decode_buffer() function to gracefully skip comment (COM) segments. + This fixes decoding of streams generated by certain cameras, e.g. like + the Logitech Pro C920. + https://bugzilla.gnome.org/show_bug.cgi?id=708208 + Signed-off-by: Junfeng Xu + +2013-09-18 17:59:44 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + jpeg: fix determination of image bounds. + Look for the exact image bounds characterised by the and + markers. Use the gst_jpeg_parse() codec parser utility function to + optimize the lookup for the next marker segment. + https://bugzilla.gnome.org/show_bug.cgi?id=707447 + +2013-09-10 15:46:09 +0800 Junfeng Xu + + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + jpeg: fix calculation of offset to next marker segment. + Fix calculation of the offset to the next marker segment since the + correction of the codecparser part to match the API specification. + i.e. the GstJpegMarkerSegment.size field represents the size in bytes + of the segment minus any marker prefix. + https://bugzilla.gnome.org/show_bug.cgi?id=707447 + Signed-off-by: Junfeng Xu + +2013-09-20 18:30:18 +0200 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit 23c7dde. + 23c7dde jpeg: fix calculation of segment size + +2013-08-31 16:00:05 +0200 Gwenole Beauchesne + + * configure.ac: + Bump version for development. + +2013-08-31 15:47:33 +0200 Gwenole Beauchesne + + * NEWS: + * configure.ac: + 0.5.6. + +2013-08-31 15:46:25 +0200 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2013-08-15 17:59:37 +0800 Wind Yuan + + * configure.ac: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + configure: fix detection of VA/JPEG decoding API. + Fix detection of VA/JPEG decoding API with non-standard libva packages. + More precisely, some packages were shipping with a header that + did not include . + https://bugzilla.gnome.org/show_bug.cgi?id=706055 + Signed-off-by: Gwenole Beauchesne + +2013-04-18 19:49:42 +0800 Zhao Halley + + * gst/vaapi/gstvaapisink.c: + vaapisink: ensure the uploader is setup for upstream allocated buffers. + In GStreamer 0.10 builds, make sure that the GstVaapiUploader helper + is setup in case upstream elements allocate buffers themselves without + honouring our GstVaapiSink::bufer_alloc() hook. + In particular, this fixes support for OGG video streams with WebKit. + https://bugzilla.gnome.org/show_bug.cgi?id=703934 + Signed-off-by: Gwenole Beauchesne + +2013-08-29 19:07:34 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: simplify get_render_buffer() for GStreamer 0.10 builds. + Implement and use gst_vaapisink_get_render_buffer() for GStreamer 0.10 + builds as well. + +2013-08-29 18:34:57 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + vaapisink: handle raw buffers not created from VA video buffer pool. + Handle raw video buffers that were not created from a VA video buffer + pool. Use the generic GstVideo API to copy buffers in GStreamer 1.0.x + builds instead of the GstVaapiUploader. + https://bugs.freedesktop.org/show_bug.cgi?id=55818 + +2013-08-29 19:33:02 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: remove extraneous size information from allowed caps. + Fix _getcaps() implementation to not report codecs with size information + filled in the returned caps. That's totally useless nowadays. Ideally, + this is a hint to insert a video parser element, thus allowing future + optimizations, but this is not a strict requirement for gstreamer-vaapi, + which is able to parse the elementary bitstreams itself. + https://bugzilla.gnome.org/show_bug.cgi?id=704734 + +2013-07-30 14:05:39 +0800 Guangxin.Xu + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecode.h: + vaapidecode: submit the last frame from output adapter to decoder. + If there is no frame delimiter at the end of the stream, e.g. no + end-of-stream or end-of-sequence marker, and that the current frame + was fully parsed correctly, then assume that last frame is complete + and submit it to the decoder. + https://bugzilla.gnome.org/show_bug.cgi?id=705123 + Signed-off-by: Guangxin.Xu + Signed-off-by: Gwenole Beauchesne + +2013-08-29 11:55:05 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecode.h: + vaapidecode: push all decoded frames from within the task. + Make sure to push all decoded frames from the task so that the unlying + VA surfaces could all be rendered from the same thread. + +2013-08-27 18:24:12 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: render the raw surface if VPP failed. + As a last resort, if video processing capabilities (VPP) are not available, + or they did not produce anything conclusive enough, then try to fallback to + the original rendering code path whereby the whole VA surface is rendered + as is, no matter of video cropping or deinterlacing requests. + Note: under those conditions, the visual outcome won't be correct but at + least, something gets displayed instead of bailing out. + +2013-08-27 18:20:08 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: add supporting for video processing. + Try to use VA/VPP processing capabilities to handle video cropping and + additional rendering flags that may not be directly supported by the + underlying hardware when exposing a suitable Wayland buffer for the + supplied VA surface. e.g. deinterlacing, different color primaries than + BT.601, etc. + +2013-08-27 16:26:22 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: add new frame redraw infrastructure. + Update the frame redraw infrastructure with a new FrameState stucture + holds all the necessary information used to display the next pending + surface. + While we are at it, delay the sync operation down to when it is actually + needed. That way, we keep performing additional tasks meanwhile. + +2013-08-27 18:06:10 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst-libs/gst/vaapi/gstvaapifilter.h: + filter: allow specification of render target regions. + Add support for rendering the source surface to a particular region within + the supplied target surface. The default background color is black. + +2013-08-26 17:14:33 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideobuffer.c: + decode: fix creation of GLX video buffers for GStreamer 0.10. + Fix creation of GstVaapiVideoBuffer objects (i) to have that type for real; + and (ii) to correctly extract the GstSurfaceConverter from the video buffer + object meta. + This fixes support for cluttersink with GStreamer 0.10 builds. + +2013-08-26 16:15:49 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: disable video cropping as picture_display_extension() is missing. + Disable video cropping in MPEG-2 codec because it is partially implemented + and actually because nobody implements it that way, and the standard spec + does not specify the display process either anyway. + Most notably, there are two possible use cases for sequence_display_extension() + horizontal_display_size & vertical_display_size: (i) guesstimating the + pixel-aspect-ratio, or (ii) implement some kind of span & scan process + in conjunction with picture_display_extension() information. + https://bugzilla.gnome.org/show_bug.cgi?id=704848 + +2013-08-16 16:58:58 +0100 Simon Farnsworth + + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + vaapisink: allow scaling to ignore aspect ratio. + Other GStreamer sinks, like xvimagesink, have a force-aspect-ratio property, + which allows you to say that you don't want the sink to respect aspect + ratio. Add the same property to vaapisink. + http://lists.freedesktop.org/archives/libva/2012-September/001298.html + Signed-off-by: Simon Farnsworth + +2013-05-14 15:19:04 +0800 Wind Yuan + + * gst/vaapi/gstvaapisink.c: + vaapisink: fix memory leak of GstVaapiUploader instance. + Make sure gst_vaapisink_ensure_uploader() checks for the existence + of a former GstVaapiUploader instance prior to forcibly creating a + new one. + https://bugzilla.gnome.org/show_bug.cgi?id=703980 + +2013-07-31 16:49:20 +0800 Guangxin.Xu + + * gst/vaapi/gstvaapisink.c: + vaapisink: fix get_caps() implementation for GStreamer 1.0. + Fix GstBaseSink::get_caps() implementation for GStreamer 1.0.X builds + by honouring the filter caps argument. More precisely, this fixes the + following pipeline: gst-launch-1.0 videotestsrc ! vaapisink + https://bugzilla.gnome.org/show_bug.cgi?id=705192 + Signed-off-by: Guangxin.Xu + Signed-off-by: Gwenole Beauchesne + +2013-08-26 11:31:06 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + mpeg4: fix double definition of GstVaapiDecoderMpeg4Class. + This fixes the following issue: + CC libgstvaapi_0.10_la-gstvaapidecoder_mpeg4.lo + gstvaapidecoder_mpeg4.c:113: error: redefinition of typedef + 'GstVaapiDecoderMpeg4Class' + gstvaapidecoder_mpeg4.c:44: note: previous declaration of + 'GstVaapiDecoderMpeg4Class' was here + make[5]: *** [libgstvaapi_0.10_la-gstvaapidecoder_mpeg4.lo] Error 1 + make[5]: Leaving directory + `/builddir/build/BUILD/gstreamer-vaapi-0.5.5.1/gst-libs/gst/vaapi' + https://bugzilla.gnome.org/show_bug.cgi?id=705148 + +2013-07-30 15:59:40 +0200 Gwenole Beauchesne + + * tests/test-filter.c: + tests: filter: add support for deinterlacing. + Add --deinterlace option to enable deinterlacing through explicit VA/VPP + deinterlacing filter. However, if --deinterlace option is not set but the + --deinterlace-flags option is set with "top-field-first", then the very + basic bob deinterlacing filter is set through VA/VPP proc pipeline flags. + +2013-07-17 17:29:41 +0800 Zhao Halley + + * tests/test-filter.c: + tests: filter: add support for denoising and sharpening. + Add --denoise option to enable noise reduction with the level specified + as the option value (float). Likewise, add --sharpen option to enable + sharpening. + Signed-off-by: Gwenole Beauchesne + +2013-07-24 14:31:34 +0200 Gwenole Beauchesne + + * tests/test-filter.c: + tests: filter: add support for frame cropping. + Add support for frame cropping through the --crop-rect|-c argument. + The format used is either 'x' , with origin at (0,0) ; + or full specification with '('? ',' ')'? 'x' . + +2013-07-23 18:00:26 +0200 Gwenole Beauchesne + + * tests/test-filter.c: + tests: filter: dump supported operations and formats. + +2013-07-08 16:54:55 +0800 Zhao Halley + + * tests/Makefile.am: + * tests/test-filter.c: + tests: add initial test for video processing. + Add minimal test case for video processing: scaling and color format + conversion. + Signed-off-by: Gwenole Beauchesne + +2013-07-29 09:23:50 +0800 Zhao Halley + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst-libs/gst/vaapi/gstvaapifilter.h: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + filter: add initial support for deinterlacing. + Add basic deinterlacing support, i.e. bob-deinterlacing whereby only + the selected field from the input surface is kept for the target surface. + Setting gst_vaapi_filter_set_deinterlacing() method argument to + GST_VAAPI_DEINTERLACE_METHOD_NONE means to disable deinterlacing. + Also move GstVaapiDeinterlaceMethod definition from vaapipostproc plug-in + to libgstvaapi core library. + Signed-off-by: Gwenole Beauchesne + +2013-07-17 17:40:41 +0800 Zhao Halley + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst-libs/gst/vaapi/gstvaapifilter.h: + filter: add support for color balance adjustment. + Add ProcAmp (color balance) adjustments for hue, saturation, brightness + and contrast. The respective range for each filter shall be the same as + for the VA display attributes. + Signed-off-by: Gwenole Beauchesne + +2013-07-17 17:37:16 +0800 Zhao Halley + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst-libs/gst/vaapi/gstvaapifilter.h: + filter: add support for sharpening. + Sharpening is configured with a float value. The supported range is + -1.0 .. 1.0 with 0.0 being the default, and that means no sharpening + operation at all. + Signed-off-by: Gwenole Beauchesne + +2013-07-17 17:29:41 +0800 Zhao Halley + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst-libs/gst/vaapi/gstvaapifilter.h: + filter: add support for denoising. + Noise reduction is configured with a float value. The supported range + is 0.0 .. 1.0 with 0.0 being the default, and that means no denoise + operation at all. + Signed-off-by: Gwenole Beauchesne + +2013-07-24 14:22:28 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst-libs/gst/vaapi/gstvaapifilter.h: + filter: add support for frame cropping. + Frame cropping is defined with a GstVaapiRectangle value. The default + behaviour is to treat the source surface as a whole + +2013-07-25 13:55:15 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapifilter.c: + filter: add helper functions. + Add helper functions to ensure an operation VA buffer is allocated to + the right size; that filter caps get parsed and assigned to the right + operation too; and that float parameters are correctly scaled to fit + the reported range from the VA driver. + +2013-07-23 15:52:45 +0200 Gwenole Beauchesne + + * configure.ac: + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapifilter.c: + * gst-libs/gst/vaapi/gstvaapifilter.h: + Add initial infrastructure for video processing. + Add initial API for video processing: only scaling and color format + conversion operations are supported. + +2013-07-24 11:53:38 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/video-format.c: + * gst-libs/gst/vaapi/video-format.h: + libs: add gst_vaapi_video_format_from_string() helper. + Add gst_vaapi_video_format_from_string() helper function to convert from + a video format string representation to a suitable GstVideoFormat. This + is just an alias to gst_video_format_from_string() for GStreamer 1.0.x + builds, and a proper iteration over all GstVideoFormat string representations + otherwise for earlier GStreamer 0.10.x builds. + +2013-07-24 11:37:23 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/video-format.c: + * gst-libs/gst/vaapi/video-format.h: + libs: add gst_vaapi_video_format_from_va_fourcc() helper. + Add gst_vaapi_video_format_from_va_fourcc() helper that converts from a + VA fourcc value to a suitable GstVideoFormat. + +2013-07-24 11:41:05 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapivalue.c: + * gst-libs/gst/vaapi/gstvaapivalue.h: + libs: add type definitions for GstVaapiPoint and GstVaapiRectangle. + Add helper functions to describe GstVaapiPoint and GstVaapiRectangle + structures as a standard GType. This could be useful to have them + described as a GValue later on. + +2013-07-26 13:57:35 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapidisplaycache.h: + libs: drop some public APIs. + Don't expose GstVaapiContext APIs and make them totally private to + libgstvaapi core library. That API would also tend to disappear in + a future revision. Likewise, don't expose GstVaapiDisplayCache API + but keep symbols visible so that the various render backends could + share a common display cache implementation in libgstvaapi. + Try to clean-up the documentation from any stale entry too. + +2013-08-23 18:35:42 +0200 Gwenole Beauchesne + + * tests/image.c: + * tests/image.h: + tests: image: allow creation of images with interleaved patterns. + Add image_generate_full() function to create interleaved color rectangles. + If flags is zero, the whole frame is generated with a unique pattern. If + flags is non-zero, then each field is handled individually. + +2013-08-23 16:25:39 +0200 Gwenole Beauchesne + + * tests/image.c: + tests: image: fix conversion from RGB to YUV. + Fix RGB to YUV conversion to preserve full data range. + +2013-07-26 13:12:28 +0200 Gwenole Beauchesne + + * tests/image.c: + tests: image: try to upload images through vaDeriveImage() too. + On some platforms, vaPutImage() would fail even if it does not involve + color format conversion or scaling, whereas copying raw pixels through + vaDeriveImage() could work instead. + +2013-07-26 10:05:06 +0200 Gwenole Beauchesne + + * tests/image.c: + tests: image: add support for packed YUV formats. + Add support for packed YUV 4:2:2 formats, i.e. YUY2 and UYVY. + +2013-07-25 18:10:40 +0200 Gwenole Beauchesne + + * tests/image.c: + tests: image: fix generation of I420/YV12 images. + U/V planes were reversed, thus producing invalid images. + +2013-07-24 13:55:04 +0200 Gwenole Beauchesne + + * tests/image.c: + tests: image: fix string representation for GstVideoFormat. + +2013-07-26 12:57:19 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapiimage_priv.h: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + image: clean image API up. + Don't expose functions that reference a GstVaapiImageRaw, those are + meant to be internal only for implementing subpictures sync. Also add + a few private definitions to avoid functions calls for retrieving + image size and format information. + +2013-07-26 11:43:49 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + image: add gst_vaapi_image_copy() helper. + Add gst_vaapi_image_copy() helper function to copy images of same format + and size. + +2013-07-22 14:53:51 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideoconverter_x11.c: + plugins: handle video cropping in X11 pixmap converter. + Use GstVideoCropMeta in GStreamer 1.0 or any other render rectangle + we could decode from the stream. + +2013-07-22 11:58:33 +0200 Gwenole Beauchesne + + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapivideobuffer.c: + * gst/vaapi/gstvaapivideoconverter_glx.c: + * gst/vaapi/gstvaapivideoconverter_x11.c: + * gst/vaapi/gstvaapivideoconverter_x11.h: + plugins: add support for "x11-pixmap" video converter type. + Install a new video converter that supports X11 pixmap targets for X11 + backends only, or make the GLX converter creation function chain up to + the X11 converter whenever requested. + +2013-07-22 09:36:08 +0200 Gwenole Beauchesne + + * tests/simple-decoder.c: + tests: simple-decoder: add support for pixmap API. + Add support for the new render-to-pixmap API. Avoid flickering on + platforms supporting video overlay by keeping up to 2 intermediate + pixmaps. + +2013-07-22 09:12:21 +0200 Gwenole Beauchesne + + * tests/simple-decoder.c: + tests: simple-decoder: add support for video cropping. + Handle video cropping information attached to a VA surface proxy. + +2013-07-22 09:03:30 +0200 Gwenole Beauchesne + + * tests/output.c: + * tests/output.h: + * tests/test-decode.c: + tests: add support for render-to-pixmap. + Add --pixmap option to test-decode so that to allow copies of VA + surface to an intermediate pixmap and rendering from that pixmap. + Only X11 backends are supported for now. + +2013-07-22 09:00:38 +0200 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11_priv.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11_priv.h: + x11: implement pixmap rendering with RENDER extension. + Use hardware accelerated XRenderComposite() function, from the RENDER + extension, to blit a pixmap to screen. Besides, this can also support + cropping and scaling. + +2013-07-19 15:05:34 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11_priv.h: + * gst-libs/gst/vaapi/gstvaapipixmap_x11.c: + * gst-libs/gst/vaapi/gstvaapipixmap_x11.h: + x11: implement pixmap API. + Implement the new render-to-pixmap API. The only supported pixmap format + that will work is xRGB, with native byte ordering. Others might work but + they were not tested. + +2013-07-22 10:10:40 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiutils_x11.c: + * gst-libs/gst/vaapi/gstvaapiutils_x11.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + x11: update x11_get_geometry() helper function with depth output. + Allow x11_get_geometry() utility function to also return the depth + assigned to the X drawable. + +2013-07-22 10:00:21 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapipixmap.c: + * gst-libs/gst/vaapi/gstvaapipixmap.h: + * gst-libs/gst/vaapi/gstvaapipixmap_priv.h: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_priv.h: + Add initial Pixmap API. + Add API to transfer VA urfaces to native pixmaps. Also add an API to + render a native pixmap, for completeness. In general, rendering to + pixmap would only be useful to certain VA drivers and use cases on + X11 display servers. e.g. GLX_EXT_texture_from_pixmap (TFP) handled + in an upper layer. + +2013-07-22 15:15:48 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/video-format.c: + * gst-libs/gst/vaapi/video-format.h: + libs: add and expose gst_vaapi_video_format_to_string() helper. + This is just a wrapper over gst_video_format_to_string() for older + GStreamer 0.10 builds. + +2013-07-18 02:54:54 -0300 Emilio López + + * gst/vaapi/gstvaapipluginutil.c: + plugins: fix display type comparison in gst_vaapi_create_display(). + After the code got moved to create the gst_vaapi_create_display() helper, + this comparison was not updated to dereference the newly-created + pointer, so the code was comparing the pointer itself to the type, and + therefore failing to retrieve the VA display. + This fixes the following error (and gets gst-vaapi decoding again): + ERROR vaapidecode gstvaapidecode.c:807:gst_vaapidecode_ensure_allowed_caps: failed to retrieve VA display + https://bugzilla.gnome.org/show_bug.cgi?id=704410 + Signed-off-by: Emilio López + +2013-07-17 11:07:39 +0200 Gwenole Beauchesne + + * configure.ac: + Bump version for development. + +2013-07-15 17:49:31 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: don't output dummy pictures. + Mark dummy pictures as output already so that we don't try to submit + them to the upper layer since this is purely internal / temporary + picture for helping the decoder. + +2013-07-15 17:43:34 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + decoder: dispose GstVideoCodecFrame earlier. + Once the picture was output, it is no longer necessary to keep an extra + reference to the underlying GstVideoCodecFrame. So, we can release it + earlier, and maybe subsequently release the associate surface proxy + earlier. + +2013-07-15 14:47:01 +0200 Gwenole Beauchesne + + * NEWS: + * configure.ac: + 0.5.5. + +2013-07-15 14:42:33 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/video-format.c: + * gst-libs/gst/vaapi/video-format.h: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapiuploader.c: + * tests/image.c: + * tests/test-display.c: + Fix new video format API. + Fix new internal video format API, based on GstVideoFormat, to not + clobber with system symbols. So replace the gst_video_format_* prefix + with gst_vaapi_video_format_ prefix, even if the format type remains + GstVideoFormat. + +2013-07-15 14:05:45 +0200 Gwenole Beauchesne + + * configure.ac: + Bump library major version. + Bump the library major version due to API/ABI changes that occurred in + the imaging API. In particular, GstVaapiImageFormat type was replaced + with the standard GstVideoFormat type. All dependent APIs were updated + to match this change. + +2013-07-15 13:44:43 +0200 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2013-06-11 15:11:34 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + decoder: fix memory leak when processing interlaced pictures. + Fix memory leak when processing interlaced pictures and that occurs + because the first field, represented as a GstVideoCodecFrame, never + gets released. i.e. when the picture is completed, this is generally + the case when the second field is successfully decoded, we need to + propagate the GstVideoCodecFrame of the first field to the original + GstVideoDecoder so that it could reclaim memory. + Otherwise, we keep accumulating the first fields into GstVideoDecoder + private frames list until the end-of-stream is reached. The frames + are eventually released there, but too late, i.e. too much memory + may have been consumed. + https://bugzilla.gnome.org/show_bug.cgi?id=701257 + +2013-07-15 11:58:31 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginutil.c: + plugins: simlpify gst_vaapi_create_display() helper. + Simplify gst_vaapi_create_display() helper as gst_vaapi_display_XXX_new() + performs the necessary validation checks for the underlying VA display + prior to returning to the caller. So, if an error occurred, then NULL is + really returned in that case. + +2013-05-24 05:04:01 -0400 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipluginutil.c: + plugins: add gst_vaapi_create_display() helper. + https://bugzilla.gnome.org/show_bug.cgi?id=703235 + Signed-off-by: Gwenole Beauchesne + +2013-07-12 17:47:07 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideobufferpool.c: + plugins: don't reallocate pool allocator for the same caps. + If the video buffer pool config doesn't have new caps, then it's not + necessary to reinstantiate the allocator. That could be a costly + operation as we could do some extra heavy checking in there. + +2013-07-12 17:14:49 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + plugins: fix ref counting of GstVaapiVideoMemory allocator. + Fix reference counting issue whereby gst_memory_init() does not hold + an extra reference to the GstAllocator. So, there could be situations + where the last instance of GstVaapiVideoAllocator gets released before + a dangling GstVaapiVideoMemory object, thus possibly leading to a crash. + +2013-07-12 15:15:07 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapiuploader.c: + vaapiupload: use implicit color conversion to NV12. + Always perform conversion of sources buffers to NV12 since this is + the way we tested for this capability in ensure_allowed_caps(). This + also saves memory bandwidth for further rendering. However, this may + not preserve quality since the YUV buffers are down-sampled to 4:2:0. + +2013-07-12 15:01:01 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapivideopool.c: + pool: fix deallocation of video pools. + The queue of free objects to used was deallocated with g_queue_free_full(). + However, this convenience function shall only be used if the original queue + was allocated with g_queue_new(). This caused memory corruption, eventually + leading to a crash. + The correct solution is to pair the g_queue_init() with the corresponding + g_queue_clear(), while iterating over all free objects to deallocate them. + +2013-03-13 17:44:52 +0800 Wind Yuan + + * gst/vaapi/gstvaapidownload.c: + vaapidownload: fix src caps format error. + This fixes direct linking of vaapidownload element to xvimagesink with + VA drivers supporting vaGetImage() from the native VA surface format to + a different VA image format. i.e. color conversion during download. + http://bugzilla.gnome.org/show_bug.cgi?id=703937 + Signed-off-by: Gwenole Beauchesne + +2013-07-11 18:26:37 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidownload.c: + vaapidownload: fix debug string for image formats. + The image is now expressed as a standard GstVideoFormat, which is not + a FOURCC but rather a regular enum value. + This is a regression introduced in commit 09397fa. + +2013-04-24 10:39:03 +0800 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapiimage.c: + image: add support for raw YUY2/UYVY image copies. + Implement raw image copies for YUY2 format. Add support for UYVY format + too, with the same copy function as for YUY2. Even though components + ordering differs, copying line strides is essentially the same. + https://bugzilla.gnome.org/show_bug.cgi?id=703939 + https://bugzilla.gnome.org/show_bug.cgi?id=703940 + Signed-off-by: Gwenole Beauchesne + +2013-07-10 15:15:11 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapiuploader.c: + plugins: clean-up video uploader helper. + Fix gst_vaapi_uploader_get_buffer() to not assign caps since they + were already negotiated beforehand, and they are not used from the + buffer in upstream elements. + Clean-up gst_vaapi_uploader_ensure_caps() to use the new image caps + represented as a GstVideoInfo. + +2013-07-10 15:03:43 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapiuploader.c: + plugins: use GstVideoInfo in video uploader helper. + +2013-07-10 10:34:24 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + plugins: allow creation of VA surfaces with explicit pixel format. + Adapt GstVaapiVideoMemory allocator to support creation of VA surfaces + with an explicit pixel format. This allows for direct rendering to + VA surface memory from a software decoder. + +2013-07-10 14:20:30 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + surface: fix surface pool creation with an explicit pixel format. + Fix creation of surface pool objects to honour explicit pixel format + specification. If this operation is not supported, then fallback to + the older interface with chroma format. + +2013-07-10 13:58:55 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurface.c: + surface: try to determine the underlying VA surface format. + If a VA surface was allocated with the chroma-format interface, try to + determine the underlying pixel format on gst_vaapi_surface_get_format(), + or return GST_VIDEO_FORMAT_ENCODED if this is not a supported operation. + +2013-07-09 19:08:37 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapisurface_priv.h: + surface: allow creation with explicit pixel format. + Make it possible to create VA surfaces with a specific pixel format. + This is a new capability brought in by VA-API >= 0.34.0. If that + capability is not built-in (e.g. using VA-API < 0.34.0), then + gst_vaapi_surface_new_with_format() will return NULL. + +2013-07-10 09:48:40 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/video-format.c: + * gst-libs/gst/vaapi/video-format.h: + surface: add helper function to get chroma type from GstVideoFormat. + Add gst_video_format_get_chroma_type() helper function to determine + the GstVaapiChromaType from a standard GStreamer video format. It is + possible to reconstruct that from GstVideoFormatInfo but it is much + simpler (and faster?) to use the local GstVideoFormatMap table. + +2013-07-09 19:13:39 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + surface: add new chroma formats. + Add new chroma formats available with VA-API >= 0.34.0. In particular, + this includes "RGB" chroma formats, and more YUV subsampled formats. + Also add a new from_GstVaapiChromaType() helper function to convert + libgstvaapi chroma type to VA chroma format. + +2013-07-10 13:32:15 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + pool: fix image pool to check for the video format to use. + Make gst_vaapi_image_pool_new() succeed, and thus returning a valid + image pool object, only if the underlying VA display does support the + requested VA image format. + +2013-07-10 13:07:37 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + * gst-libs/gst/vaapi/gstvaapiimagepool.h: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.h: + * gst-libs/gst/vaapi/gstvaapivideopool.h: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapiuploader.c: + * tests/Makefile.am: + * tests/test-surfaces.c: + Use GstVideoInfo for video pools. + Get rid of GstCaps to create surface/image pool, and use GstVideoInfo + structures instead. Those are smaller, and allows for streamlining + libgstvaapi more. + +2013-07-09 18:03:36 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/video-format.c: + Add more video formats. + Add new video format mappings to VA image formats: + - YUV: packed YUV (YUY2, UYVY), grayscale (Y800) ; + - RGB: 32-bit RGB without alpha channel (XRGB, XBGR, RGBX, BGRX). + +2013-07-10 15:52:20 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiimage.c: + image: fix debug message with video format. + Fix debug message string with image format expressed with GstVideoFormat + instead of the obsolete format that turned out to be a fourcc. + This is a regression from git commit e61c5fc. + +2013-07-09 15:28:31 +0200 Gwenole Beauchesne + + * tests/image.c: + * tests/image.h: + * tests/test-display.c: + * tests/test-textures.c: + * tests/test-windows.c: + tests: port to new video format API. + +2013-07-09 15:44:35 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapiuploader.c: + * gst/vaapi/gstvaapivideomemory.c: + plugins: port to new video format API. + +2013-07-09 16:26:11 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiimage.c: + libs: use GstVideoInfo wherever possible. + In particular, use gst_video_info_from_caps() helper function in VA image + for implementating gst_vaapi_image_get_buffer() [vaapidownload] and + gst_vaapi_image_update_from_buffer() [subpictures] in GStreamer 0.10 builds. + +2013-07-09 16:38:05 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.h: + libs: drop GstVaapiImageFormat helpers. + Drop GstVaapiImageFormat helpers since everything was moved to the new + GstVideoFormat based API. Don't bother with backwards compatibility and + just bump the library major version afterwards. + +2013-07-09 14:03:01 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + libs: port to new video format API. + +2013-07-09 15:29:59 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/video-format.c: + * gst-libs/gst/vaapi/video-format.h: + Add new video format API. + Leverage GstVideoFormat utilities from core GStreamer to provide an + adaptation layer to VA image formats. + +2013-07-09 11:13:59 +0200 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2013-07-08 18:32:00 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: fix creation of GLX texture. + Fix creation of GLX texture, to not depend on the GstCaps video size that + could be wrong, especially in presence of frame cropping. So, use the size + from the source VA surfaces. + An optimization could be to reduce the texture size to the actual visible + size on screen. i.e. scale down the texture size to match the screen dimensions, + while preserving the VA surface aspect ratio. However, some VA drivers don't + honour that. + +2013-02-18 16:28:27 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: add support for video cropping. + If the stream has a sequence_display_extenion, then attach the + display_horizontal/display_vertical dimension as the cropping + rectangle width/height to the GstVaapiPicture. + Signed-off-by: Gwenole Beauchesne + +2013-02-18 15:05:37 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: add support for video cropping. + If the Advanced profile has display_extension fields, then set the display + width/height dimension as cropping rectangle to the GstVaapiPicture. + Signed-off-by: Gwenole Beauchesne + +2013-02-15 18:50:26 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: add support for video cropping. + If the encoded stream has the frame_cropping_flag set, then associate + the cropping rectangle to GstVaapiPicture. + Signed-off-by: Gwenole Beauchesne + +2013-07-08 17:01:21 +0200 Gwenole Beauchesne + + * tests/decoder.c: + * tests/decoder.h: + * tests/test-decode.c: + * tests/test-subpicture.c: + tests: add basic support for video cropping. + Change generic decoder of sample I-frame to return a GstVaapiSurfaceProxy + instead of a plain GstVaapiSurface. This means that we can now retrieve + the frame cropping rectangle from the surface proxy, along with additional + information if ever needed. + +2013-07-08 14:50:42 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapivideometa.c: + plugins: add support for video cropping. + Add support for GstVideoCropMeta in GStreamer >= 1.0.x builds and gst-vaapi + specific meta information to hold video cropping details. Make the sink + support video cropping in X11 and GLX modes. + +2013-02-15 18:24:24 +0200 Sreerenj Balachandran + + * gst/vaapi/gstvaapivideometa.c: + * gst/vaapi/gstvaapivideometa.h: + plugins: add helper functions to set the render rectangle. + Some video clips may have a clipping region that needs to propogate to + the renderer. These helper functions make it possible to attach that + clipping region, as a GstVaapiRectangle, the the video meta associated + with the buffer. + Signed-off-by: Sreerenj Balachandran + signed-off-by: Gwenole Beauchesne + +2013-07-08 14:47:24 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy_priv.h: + surfaceproxy: allow for NULL cropping rectangle. + Make it possible associate an empty cropping rectangle to the surface + proxy, thus resetting any cropping rectangle that was previously set. + This allows for returning plain NULL when no cropping rectangle was + initially set up to the surface proxy, or if it was reset to defaults. + +2013-07-08 11:41:59 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurfaceproxy_priv.h: + surfaceproxy: clean-up helper macros. + Always use the GST_VAAPI_SURFACE_PROXY() helper macro to cast from a + proxy macro argument to a GstVaapiSurfaceProxy pointer. + +2013-07-08 11:43:27 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface_priv.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + surface: add simple surface info accessors as helper macros. + Add helper macros to retrieve the VA surface information like size + (width, height) or chroma type. This is a micro-optimization to avoid + useless function calls and NULL pointer re-checks in internal routines. + +2013-02-15 18:42:12 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy_priv.h: + decoder: add support for video cropping. + Add gst_vaapi_picture_set_crop_rect() helper function to copy the video + cropping information from raw bitstreams to each picture being decoded. + Also add helper function to surface proxy to propagate that information + outside of libgstvaapi. e.g. plug-in elements or standalone applications. + Signed-off-by: Sreerenj Balachandran + Signed-off-by: Gwenole Beauchesne + +2013-07-08 17:30:30 +0200 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit f90de0a. + f90de0a h264: fix calculation of the frame cropping rectangle + 535515c h264: parse the cropping rectangle separately + +2013-07-05 19:03:41 +0200 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit 0f68a71. + 0f68a71 mpeg2: fix video packet header size checks + +2013-06-07 20:08:43 +0800 Zhong Cong + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: reset quantization matrices on new sequence headers. + The MPEG-2 standard specifies (6.3.7) that all quantisation matrices + shall be reset to their default values when a Sequence_Header() is + decoded. + Signed-off-by: Gwenole Beauchesne + +2013-07-05 15:49:34 +0200 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: cope with latest codecparser changes. + Fix build with newer MPEG-2 codecparser where GstMpegVideoPacket are + used in individual header parsers. Also use the new slice parsing API. + +2013-07-05 17:51:26 +0200 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit dddd182. + dddd182 mpeg2: add slice header parsing API + 94e6228 mpeg2: add sequence scalable extension parsing API + 531134f mpeg2: add new API that takes GstMpegVideoPacket arguments + 4b135d3 h264: fix the return value type for the SEI palyload parsing methods + +2013-06-27 12:25:44 +0300 Sreerenj Balachandran + + * gst/vaapi/gstvaapisink.c: + vaapisink: expose the raw video formats in static caps template. + Expose all raw video formats in the static caps template since the + vaapisink is supporting raw data. We will get the exact set of formats + supported by the driver dynamically through the _get_caps() routine. + This also fixes an inconsistency wrt. GStreamer 0.10 builds. + https://bugzilla.gnome.org/show_bug.cgi?id=702178 + Signed-off-by: Gwenole Beauchesne + +2013-06-27 13:53:46 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + vaapisink: add "use-glx" property for OpenGL rendering. + Now that VA/GLX capable buffers are generated by default on X11, thus + depending on a VA/GLX display, we stil want to use vaPutSurface() for + rendering since it is faster. + Anyway, OpenGL rendering in vaapisink was only meant for testing and + enabling "fancy" effects to play with. This has no real value. So, + disable OpenGL rendering by default. + +2013-06-06 05:36:03 -0400 Víctor Manuel Jáquez Leal + + * gst/vaapi/gstvaapipluginutil.c: + plugins: try to allocate a GLX display first over an X11 one. + If the gstreamer-vaapi plug-in elements are built with GLX support, then + try to allocate a GstVaapiDisplayGLX first before resorting to a VA/X11 + display next. + https://bugzilla.gnome.org/show_bug.cgi?id=701742 + +2013-04-25 17:07:13 +0100 Lionel Landwerlin + + * configure.ac: + configure: use GST_PLUGIN_PATH_1_0 instead of GST_PLUGIN_PATH for Gst 1.0. + jhbuild sets $GST_PLUGIN_PATH_1_0 which overrides $GST_PLUGIN_PATH. + https://bugzilla.gnome.org/show_bug.cgi?id=698858 + Signed-off-by: Gwenole Beauchesne + +2013-04-27 15:15:49 +0800 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapiimage.c: + image: fix wrong check for rect bounds in copy_image(). + +2013-06-14 13:41:14 +0200 Gwenole Beauchesne + + * configure.ac: + Bump version for development. + +2013-06-14 11:47:50 +0200 Gwenole Beauchesne + + * NEWS: + * configure.ac: + 0.5.4. + +2013-06-14 11:43:46 +0200 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2013-06-14 11:39:54 +0200 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/codecparsers/Makefile.am: + configure: always build the MPEG-4 parser. + Always build the MPEG-4 parser for now as there are also core fixes + included in the parser that cannot be tested for with API checks. + +2013-06-14 11:32:36 +0200 Gwenole Beauchesne + + * configure.ac: + configure: add --enable-builtin-codecparsers [default="yes"] option. + Add flag to have all codecparsers built-in, thus ensuring that the + resulting binaries have all the necessary bug fixes and this is what + the QA has been testing anyway. + Of course, for a completely up-to-date Linux distribution, you could + also opt for --disable-builtin-codecparsers and use the system ones. + Though, some core fixes could be missing, and those cannot be tested + for with API checks. + +2013-06-14 11:14:23 +0200 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit 843ce3e. + 843ce3e jpeg: fix default Huffman tables generation. + 8655187 mpeg2: fix the pixel-aspect-ratio calculation + 21099dc mpeg2: actually store video bitrate values + dd02087 mpeg2: fix picture packet extension size check + 25948e9 mpeg2: increase min size for picture coding ext + f1f5a40 ensure the debug category is properly initialized + +2013-06-12 14:16:17 +0100 Gwenole Beauchesne + + * debian.upstream/Makefile.am: + debian: fix list of generated files for .deb packaging. + +2013-06-12 13:48:26 +0100 Gwenole Beauchesne + + * configure.ac: + * debian.upstream/Makefile.am: + * debian.upstream/control.in: + debian: fix libgstvaapi -dev package name. + Fix libgstvaapi -dev package name so that to allow installation of both + GStreamer 0.10 and 1.0.x based packages. + +2013-06-05 17:42:00 +0200 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2013-05-31 11:09:40 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + wayland: fix memory leak of display resources. + +2013-06-04 07:14:22 +0800 Zhao Halley + + * gst/vaapi/gstvaapisink.c: + vaapisink: fix build without VA/GLX support. + +2013-06-05 11:01:51 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + * gst/vaapi/gstvaapivideomemory.h: + plugins: allow buffer mappings to GstVaapiSurfaceProxy. + Allow plain gst_buffer_map() interface to work with gstreamer-vaapi + video buffers, i.e. expose the underlying GstVaapiSurfaceProxy to the + caller. This is the only sensible enough thing to do in this mode as + the underlying surface pixels need to be extracted through an explicit + call to the gst_video_frame_map() function instead. + A possible use-case of this is to implement a "handoff" signal handler + to fakesink or identity element for further processing. + +2013-06-03 10:22:44 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + plugins: silence check for direct-rendering mode in video memory. + Fix gst_vaapi_video_allocator_new() to silently check for direct-rendering + mode support, and not trigger fatal-criticals if either test surface or + image could not be created. Typical case: pixel format mismatch, e.g. NV12 + supported by most hardware vs. I420 supported by most software decoders. + +2013-06-03 10:06:29 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + plugins: improve video memory flags safety checks. + On map, ensure we have GST_MAP_WRITE flags since this is only what we + support for now. Likewise, on unmap, make sure that the VA image is + unmapped for either read or write, while still committing it to the + VA surface if write was requested. + +2013-05-30 18:17:07 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurface.c: + surface: fix memory leak through unreleased parent context. + Break the circular references between GstVaapiContext and its children + GstVaapiSurfaces. Since the VA surfaces held an extra reference to the + context, which holds a reference to its VA surfaces, then none of those + were released. + How does this impact support for subpictures? + The only situation when the parent context needs to disappear is when + it is replaced with another one because of a resolution change in the + video stream for instance, or a normal destroy. In this case, it does + not really matter to apply subpictures to the peer surfaces since they + are either gone, or those that are left in the pipe can probably bear + a reinstantiation of the subpictures for it. + So, parent_context is set to NULL when the parent context is destroyed, + other VA surfaces can still get subpictures attached to them, individually + not as a whole. i.e. subpictures for surface S1 will be created from + active composition buffers and associated to S1, subpictures for S2 will + be created from the next active composition buffers, etc. We don't try + to cache the subpictures in those cases (pending surfaces until EOS + is reached, or pending surfaces until new surfaces matching new VA context + get to be used instead). + +2013-05-27 14:01:48 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: fix one-time initialization when display property is set. + Fix gst_vaapisink_ensure_display() to perform one-time initialization + tasks even if the `display' property was explicitly set. + +2013-05-27 15:59:08 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + window: fix GLX window initialization. + Make sure to create the GLX context once the window object has completed + its creation. Since gl_resize() relies on the newly created window size, + then we cannot simply overload the GstVaapiWindowClass::create() hook. + So, we just call into gst_vaapi_window_glx_ensure_context() once the + window object is created in the gst_vaapi_window_glx_new*() functions. + +2013-05-27 17:18:40 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay_drm.c: + * gst-libs/gst/vaapi/gstvaapidisplay_drm_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11_priv.h: + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapiwindow_drm.c: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + display: validate display types. + +2013-05-27 16:13:33 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay_drm.c: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + display: drop internal NAME_PREFIX, store the real display name. + Always store a valid display name/device path, instead of adding a + particular prefix. i.e. make it simply a strdup(), or "" if it was + initially NULL. + +2013-05-27 13:17:31 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay_drm.c: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplaycache.c: + * gst-libs/gst/vaapi/gstvaapidisplaycache.h: + display: make it possible to lookup the display cache by type. + Make it possible to add extra an extra filter to most of display cache + lookup functions so that the GstVaapiDisplay instance can really match + a compatible and existing display by type, instead of relying on extra + string tags (e.g. "X11:" prefix, etc.). + +2013-05-24 16:19:23 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay_drm.c: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + display: cope with new display cache API. + +2013-05-24 16:12:01 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplaycache.c: + * gst-libs/gst/vaapi/gstvaapidisplaycache.h: + display: rework display cache API. + Simplify display cache API, while making it more flexible. We can now create + custom lookup functions with gst_vaapi_display_cache_lookup_custom(). + +2013-05-24 15:05:45 +0200 Gwenole Beauchesne + + * tests/test-display.c: + tests: improve check for display cache. + Improve check for display cache infrastructure. In particular, for X11 and + GLX backends, we need to make sure that we can create a GstVaapiDisplayX11 + from another GstVaapiDisplayGLX, i.e. underlying X11 and VA displays can be + shared. Besides, allocating a GstVaapiDisplayGLX while a GstVaapiDisplayX11 + already exists will have to generate different VA displays. + +2013-05-15 10:33:16 +0800 Zhao Halley + + * gst/vaapi/gstvaapiuploader.c: + uploader: fix memory leak in GStreamer 0.10 builds. + In GStreamer 0.10 builds, gst_vaapi_uploader_get_buffer() was used + but it exhibited a memory leak because the surface generated for the + GstVaapiVideoMeta totally lost its parent video pool. So, it was not + possible to release that surface back to the parent pool when the meta + gets released, and the memory consumption kept growing. + Signed-off-by: Gwenole Beauchesne + +2013-05-23 18:56:43 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideometa.c: + plugins: fix gst_vaapi_video_meta_new_from_pool(). + Since GST_VAAPI_IS_xxx_VIDEO_POOL() was only testing for NULL and not + the underlying object type, the gst_vaapi_video_meta_new_from_pool() + was hereby totally broken. Fixed this regression by using the newly + provided gst_vaapi_video_pool_get_object_type() function. + +2013-05-23 18:22:50 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapiuploader.c: + * gst/vaapi/gstvaapivideomemory.c: + * gst/vaapi/gstvaapivideometa.c: + plugins: cope with GST_VAAPI_IS_xxx() macros removal. + +2013-05-23 18:19:24 +0200 Gwenole Beauchesne + + * tests/decoder.c: + tests: cope with GST_VAAPI_IS_xxx() macros removal. + +2013-05-23 18:45:23 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapivideopool.c: + * gst-libs/gst/vaapi/gstvaapivideopool.h: + * gst-libs/gst/vaapi/gstvaapivideopool_priv.h: + libs: add query for GstVaapiVideoPool object types. + Add API to identify the underlying GstVaapiVideoPool object type. + +2013-05-23 18:15:48 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_drm.c: + * gst-libs/gst/vaapi/gstvaapidisplay_drm.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.h: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.h: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + * gst-libs/gst/vaapi/gstvaapiimagepool.h: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapiobject.h: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.h: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy_priv.h: + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapivideopool.c: + * gst-libs/gst/vaapi/gstvaapivideopool.h: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_drm.h: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.h: + libs: drop GST_VAAPI_IS_xxx() helper macros. + Drop obsolete GST_VAAPI_IS_xxx() helper macros since we are no longer + deriving from GObject and so those were only checking for whether the + argument was NULL or not. This is now irrelevant, and even confusing + to some extent, because we no longer have type checking. + Note: this incurs more type checking (review) but the libgstvaapi is + rather small, so this is manageable. + +2013-05-07 18:52:28 +0200 Gwenole Beauchesne + + * configure.ac: + Bump library major version. + The whole libgstvaapi libraries got a major refresh to get rid of GObject. + This is a fundamental change that requires a new SONAME. More changes are + underway to streamline the core libraries. + So far, the net result is a reduction of .text size (code) by 32KB, i.e. -10%. + On one particular test (sintel HD trailer), the total number of executed + instruction was reduced by 8%. + +2013-05-07 18:37:24 +0200 Gwenole Beauchesne + + * docs/reference/libs/Makefile.am: + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/libs/libs-sections.txt: + * docs/reference/libs/libs.core.types: + * docs/reference/libs/libs.glx.types: + * docs/reference/libs/libs.x11.types: + docs: cope with removed APIs. + Some APIs are dead because they are no longer based on GObject. + +2013-05-06 14:43:38 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + * gst/vaapi/gstvaapiuploader.c: + * gst/vaapi/gstvaapivideobufferpool.c: + * gst/vaapi/gstvaapivideoconverter_glx.c: + * gst/vaapi/gstvaapivideomemory.c: + * gst/vaapi/gstvaapivideometa.c: + plugins: cope with new GstVaapiMiniObject objects. + +2013-05-07 11:45:10 +0200 Gwenole Beauchesne + + * tests/decoder.c: + * tests/image.c: + * tests/output.c: + * tests/simple-decoder.c: + * tests/test-decode.c: + * tests/test-display.c: + * tests/test-subpicture.c: + * tests/test-surfaces.c: + * tests/test-textures.c: + * tests/test-windows.c: + tests: cope with new GstVaapiMiniObject objects. + +2013-05-07 15:38:51 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + display: fix set_synchronous() to lock display. + +2013-05-03 19:02:23 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + videopool: simplify creation of video objects pool. + +2013-05-07 18:17:10 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapitypes.h: + libs: simplify GstVaapiID definitions. + Make GstVaapiID a gsize instead of guessing an underlying integer large + enough to hold all bits of a pointer. Also drop GST_VAAPI_ID_NONE since + this is plain zero and that it is no longer passed as varargs. + +2013-05-02 16:11:53 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapi_priv.h: + * gst-libs/gst/vaapi/gstvaapiparamspecs.c: + * gst-libs/gst/vaapi/gstvaapiparamspecs.h: + * gst-libs/gst/vaapi/gstvaapivalue.c: + * gst-libs/gst/vaapi/gstvaapivalue.h: + libs: drop obsolete function helpers and objects. + Drop obsolete GstVaapiID related function helpers for passing them as + GValues. + +2013-05-07 11:39:34 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_drm.c: + * gst-libs/gst/vaapi/gstvaapidisplay_drm.h: + * gst-libs/gst/vaapi/gstvaapidisplay_drm_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.h: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11_priv.h: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapivideopool.c: + libs: use GstVaapiMiniObject for display objects. + +2013-05-06 14:07:17 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicodec_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.h: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.h: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.h: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.h: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.h: + libs: use GstVaapiMiniObject for video decoders. + Port GstVaapiDecoder and GstVaapiDecoder{MPEG2,MPEG4,JPEG,H264,VC1} to + GstVaapiMiniObject. Add gst_vaapi_decoder_set_codec_state_changed_func() + helper function to let the user add a callback to a function triggered + whenever the codec state (e.g. caps) changes. + +2013-05-03 11:01:12 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + * gst-libs/gst/vaapi/gstvaapiimagepool.h: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapivideopool.c: + * gst-libs/gst/vaapi/gstvaapivideopool.h: + * gst-libs/gst/vaapi/gstvaapivideopool_priv.h: + libs: use GstVaapiMiniObject for video object pools. + Port GstVaapiVideoPool, GstVaapiSurfacePool and GstVaapiImagePool to + GstVaapiMiniObject. Drop gst_vaapi_video_pool_get_caps() since it was + no longer used for a long time. Make object allocators static, i.e. + local to the shared library. + +2013-04-30 17:22:00 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapitexture.h: + libs: use GstVaapiObject for texture objects. + +2013-04-30 17:20:14 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_drm.c: + * gst-libs/gst/vaapi/gstvaapiwindow_drm.h: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.h: + * gst-libs/gst/vaapi/gstvaapiwindow_priv.h: + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11_priv.h: + libs: use GstVaapiObject for window objects. + +2013-04-30 17:22:15 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.h: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapivideopool.c: + libs: use GstVaapiObject for VA objects. + +2013-04-30 17:20:46 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapiobject.h: + * gst-libs/gst/vaapi/gstvaapiobject_priv.h: + Port GstVaapiObject to GstVaapiMiniObject. + +2013-04-30 10:28:30 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicodec_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_dpb.c: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiminiobject.c: + * gst-libs/gst/vaapi/gstvaapiminiobject.h: + libs: refine GstVaapiMiniObject. + Drop support for user-defined data since this capability was not used + so far and GstVaapiMiniObject represents the smallest reference counted + object type. Add missing GST_VAAPI_MINI_OBJECT_CLASS() helper macro. + Besides, since GstVaapiMiniObject is a libgstvaapi internal object, it + is also possible to further simplify the layout of the object. i.e. merge + GstVaapiMiniObjectBase into GstVaapiMiniObject. + +2013-05-07 16:43:51 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + decoder: update picture size from the bitstream. + Propagate the picture size from the bitstream to the GstVaapiDecoder, + and subsequent user who installed a signal on notify::caps. This fixes + decoding of TS streams when the demuxer failed to extract the required + information. + +2013-04-25 14:16:01 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + decoder: fix raw decoding mode. + Fix gst_vaapi_decoder_get_surface() to actually transfer ownership of the + surface proxy to the caller. + +2013-04-25 13:56:18 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst/vaapi/gstvaapidecode.c: + decoder: add gst_vaapi_decoder_get_frame_with_timeout(). + Add gst_vaapi_decoder_get_frame_with_timeout() helper function that will + wait for a frame to be decoded, until the specified timeout in microseconds, + prior to returning to the caller. + This is a fix to performance regression from 851cc0, whereby the vaapidecode + loop executed on the srcpad task was called to often, thus starving all CPU + resources. + +2013-04-19 14:38:59 +0200 Gwenole Beauchesne + + * configure.ac: + Bump version for development. + +2013-04-18 19:09:45 +0200 Gwenole Beauchesne + + * NEWS: + * configure.ac: + 0.5.3. + +2013-04-18 19:08:39 +0200 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2013-04-18 15:55:26 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: rework heuristics to detect decode timeout. + Rework heuristics to detect when downstream element ran into errors, + and thus failing to release any VA surface in due time for the current + frame to get decoded. In particular, recalibrate the render time base + when the first frame gets submitted downstream, or when there is no + timestamp that could be inferred. + +2013-04-18 15:50:02 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstcompat.h: + * gst/vaapi/gstvaapidecode.c: + vaapidecode: rework GstVideoDecoder::handle_frame() with a task. + Rework GstVideoDecoder::handle_frame() to decode the current frame, + while possibly waiting for a free surface, and separately submit all + decoded frames from a task. This makes it possible to pop and render + decoded frames as soon as possible. + +2013-04-18 10:06:15 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + plugins: use gst_object_unref() wherever applicable. + Use gst_object_unref() wherever applicable, e.g. objects derived from + GstElement, GstVideoPool, etc. + +2013-04-17 14:21:16 +0200 Gwenole Beauchesne + + * docs/reference/plugins/plugins-docs.xml.in: + * docs/reference/plugins/plugins-sections.txt: + * docs/reference/plugins/plugins.types: + docs: drop obsolete plug-ins. + Drop documentation for obsolete plug-ins, even for GStreamer 0.10. + i.e. vaapiupload and vaapidownload are no longer the recommended + plug-ins to use. + +2013-04-17 13:17:26 +0200 Gwenole Beauchesne + + * debian.upstream/rules: + debian: fix build of GStreamer 0.10 packages. + Fix build of Debian packages to scan the actual GStreamer API version + from the generated changelog file. + +2013-04-17 10:58:04 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: minor clean-ups. + Use g_clear_object() wherever appropriate and remove dead-code. + +2013-04-17 10:53:03 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: fix reference counting buf for passthrough mode. + Fix reference counting bug for passthrough mode, whereby the input buffer + was propagated as is downstream through gst_pad_push() without increasing + its reference count before. The was a problem when gst_pad_push() returns + an error and we further decrease the reference count of the input buffer. + +2013-04-17 10:18:45 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstcompat.h: + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: port to GStreamer 1.0. + Add support for interlaced streams with GStreamer 1.0 too. Basically, + this enables vaapipostproc, though it is not auto-plugged yet. We also + make sure to reply to CAPS queries, and happily handle CAPS events. + +2013-04-17 10:14:55 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + decoder: fix GstVideoCodecFrame flags for interlaced contents. + Fix support for interlaced contents with GStreamer 0.10. In particular, + propagate GstVaapiSurfaceProxy frame flags to GstVideoCodecFrame flags + correctly. + This is a regression from commit 87e5717. + +2013-04-16 13:23:41 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_frame.c: + * gst-libs/gst/vaapi/gstvaapidecoder_frame.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst-libs/gst/vaapi/gstvaapiparser_frame.c: + * gst-libs/gst/vaapi/gstvaapiparser_frame.h: + decoder: rename GstVaapiDecoderFrame to GstVaapiParserFrame. + Rename GstVaapiDecoderFrame to GstVaapiParserFrame because this data + structure was only useful to parsing and a proper GstvaapiDecoderFrame + instance will be created instead. + +2013-04-16 19:09:30 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + decoder: export presentation timestamp for raw decoding mode. + Fix regression from 0.4-branch whereby GstVaapiSurfaceProxy no longer + held any information about the expected presentation timestamp, frame + duration or additional flags like interlaced or top-field-first. + +2013-04-16 18:56:24 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + decoder: use new GstVaapiSurfaceProxy utility functions. + Use new GstVaapiSurfaceProxy internal helper functions to propagate the + necessary GstVideoCodecFrame flags to vaapidecode (GStreamer 0.10). + Also make GstVaapiDecoder push_frame() operate similarly to drop_frame(). + i.e. increase the GstVideoCodecFrame reference count in push_frame rather + than gst_vaapi_picture_output(). + +2013-04-16 18:35:48 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy_priv.h: + surfaceproxy: add more attributes for raw decoding modes. + Add more attributes for raw decoding modes, i.e. directly through the + libgstvaapi helper library. In particular, add presentation timestamp, + duration and a couple of flags (interlaced, TFF, RFF, one-field). + +2013-04-16 13:48:00 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + * gst/vaapi/gstvaapidecode.c: + * tests/simple-decoder.c: + surfaceproxy: drop user-data support from GstVaapiSurfaceProxy. + Drop user-data support from GstVaapiSurfaceProxy. Rather make it explicit + to call some user-provided function when the surface proxy is released. + +2013-04-15 12:52:51 +0400 Víctor Manuel Jáquez Leal + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + build: link libgstvaapi-glx-1.0.so against libdl. + Ensure libgstvaapi-glx*.so builds against libdl since dlsym() is used + to resolve glXGetProcAddress() from GLX libraries. This fix builds on + Fedora 17. + https://bugzilla.gnome.org/show_bug.cgi?id=698046 + Signed-off-by: Gwenole Beauchesne + +2013-04-15 14:22:57 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + decoder: fix gst_vaapi_decoder_get_codec_state(). + Fix previous commit whereby gst_vaapi_decoder_get_codec_state() was + supposed to make GstVaapiDecoder own the return GstVideoCodecState + object. Only comment was updated, not the actual code. + +2013-04-15 13:58:58 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst/vaapi/gstvaapidecode.c: + decoder: make gst_vaapi_decoder_get_codec_state() return the original state. + Make gst_vaapi_decoder_get_codec_state() return the original codec state, + i.e. make the GstVaapiDecoder object own the return state so that callers + that want an extra reference to it would just gst_video_codec_state_ref() + it before usage. This aligns the behaviour with what we had before with + gst_vaapi_decoder_get_caps(). + This is an ABI incompatible change, library major version was bumped from + previous release (0.5.2). + +2013-04-15 13:52:19 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideobufferpool.h: + * gst/vaapi/gstvaapivideoconverter_glx.h: + plugins: mark a few more functions as internal. + Mark the following functions are internal, i.e. private to the vaapi plug-in: + - gst_vaapi_video_buffer_pool_get_type() + - gst_vaapi_video_converter_glx_get_type() + - gst_vaapi_video_converter_glx_new() + +2013-04-15 13:48:43 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideobuffer.c: + plugins: implement GstSurfaceMeta API. + Implement GstSurfaceMeta API for GStreamer 1.0.x. Even though this is + an unstable/deprecated API, this makes it possible to support Clutter + sink with minimal changes. Tested against clutter-gst 1.9.92. + +2013-04-12 17:12:43 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: optimize GstVideoOverlayInterface::expose(). + When render-mode is "overlay", then it is not really useful to peek into + the GstBaseSink::last_buffer, since we have our own video_buffer already + recorded and maintained into GstVaapiSink. + +2013-04-12 17:05:06 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: fix memory leak of GstSample objects. + Fix memory leak of GstSample objects in GstVideoOverlayInterface::expose(). + This also fixes extra unreferencing of the underlying GstBuffer in the common + path afterwards (for both 0.10 or 1.0). + +2013-04-12 13:44:52 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstcompat.h: + * gst/vaapi/gstvaapi.c: + plugins: fix description for gst-inspect. + Fix the name of the plug-in element reported to gst-inspect-1.0. i.e. we + need an explicit definition for GStreamer >= 1.0 because the GST_PLUGIN_DEFINE + incorrectly uses #name for creating the plug-in name, instead of using macro + expansion (and let further expansion of macros) through e.g. G_STRINGIFY(). + +2013-04-11 09:24:44 +0200 Gwenole Beauchesne + + * README: + README: updates. + Update build requirements for GStreamer 1.0.x support. Add section for + ways to report bugs. + +2013-04-10 16:54:01 +0200 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2013-04-10 15:31:41 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst/vaapi/Makefile.am: + Fix make dist to include all source files, in any case. + Fix make dist to allow build for either GStreamer 0.10 or 1.0. i.e. make + sure to include all source files in either case while generating source + tarballs. + +2013-04-10 15:21:57 +0200 Gwenole Beauchesne + + * configure.ac: + Bump library major version. + Bump library major version, while preserving a major version of 0 for + GStreamer 1.0 based libraries, and a major version of 2 for GStreamer + 0.10 based librarieS. + +2013-04-10 14:37:42 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideomemory.c: + * gst/vaapi/gstvaapivideomemory.h: + plugins: implement direct-rendering mode for raw YUV buffer uploads. + Allow direct-rendering (writes) into target VA surfaces. + +2013-04-09 16:02:06 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideobufferpool.c: + * gst/vaapi/gstvaapivideomemory.c: + * gst/vaapi/gstvaapivideomemory.h: + plugins: implement uploads from raw YUV buffers for GStreamer 1.0. + Implement GstVideoMeta::{,un}map() to support raw YUV buffer upload when + the last component is unmapped. Downloads are not supported yet. The aim + was to first support SW decoding + HW accelerated rendering (vaapisink). + e.g. for Wayland. + +2013-04-03 11:10:41 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: submit all decoded frames before decoding a new one. + Make sure to purge all pending frames that were already decoded prior + to decoding a new one. This helps release VA surfaces as early as + possible. + +2013-04-02 16:12:16 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: reply to CAPS queries. + Handle GST_QUERY_CAPS, which is the GStreamer 1.0 mechanism to retrieve + the set of allowed caps, i.e. it works similar to GstPad::get_caps(). + This fixes fallback to SW decoding if no HW decoder is available. + +2013-03-20 11:26:38 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + decoder: fix unpaired GstBuffer map/unmaps. + This possibly fixes a few memory leaks along the way. + +2013-03-20 14:40:57 +0100 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/vaapi/gstcompat.h: + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + * gst/vaapi/gstvaapiuploader.c: + * tests/codec.c: + Allow build against either GStreamer API (0.10 or 1.0). + Introduce a new configure option --with-gstreamer-api that determines + the desired GStreamer API to use. By default, GStreamer 1.0 is selected. + Also integrate more compatibility glue into gstcompat.h and plugins. + +2012-11-08 16:41:22 +0200 Sreerenj Balachandran + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + plugins: use new video buffer pools. + Use new GstVaapiVideoBufferPool to maintain video buffers. Implement + GstBaseSink::propose_allocation() to expose that pool to upstream + elements; and also implement GstVideoDecoder::decide_allocation() to + actually use that pool (from downstream), if any, or create one. + Signed-off-by: Gwenole Beauchesne + +2012-11-08 16:41:22 +0200 Sreerenj Balachandran + + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapivideobufferpool.c: + * gst/vaapi/gstvaapivideobufferpool.h: + * gst/vaapi/gstvaapivideomemory.c: + * gst/vaapi/gstvaapivideomemory.h: + plugins: add GstVaapiVideoMemory and GstVaapiVideoBufferPool objects. + Add initial support for GstVaapiVideoMemory backed buffer pool. The memory + object currently holds a reference to GstVaapiVideoMeta. + Signed-off-by: Gwenole Beauchesne + +2013-04-04 17:36:45 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideometa.c: + * gst/vaapi/gstvaapivideometa.h: + plugins: allow copies of GstVaapiVideoMeta objects. + Make it possible to copy GstVaapiVideoMeta objects, unless they contain VA + objects created from GstVaapiVideoPool. This is mostly useful to clone a + GstVaapiVideoMeta object containing a VA surface proxy so that to alter its + rendering flags. + +2013-04-04 16:16:31 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideometa.c: + plugins: make it possible to clear VA objects from GstVaapiVideoMeta. + Fix GstVaapiVideoMeta to allow VA objects to be destroyed when they are + reset to NULL. i.e. make gst_vaapi_video_meta_set_{image,surface}() and + gst_vaapi_video_meta_set_surface_proxy() actually clear VA objects when + argument is NULL. + +2012-09-03 14:00:25 +0300 Sreerenj Balachandran + + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + * gst/vaapi/gstvaapiuploader.c: + * gst/vaapi/gstvaapivideobuffer.c: + * gst/vaapi/gstvaapivideoconverter_glx.c: + * gst/vaapi/gstvaapivideometa.c: + * gst/vaapi/gstvaapivideometa.h: + plugins: initial port to GStreamer 1.0. + Port vaapidecode and vaapisink plugins to GStreamer API >= 1.0. This + is rather minimalistic so that to test the basic functionality. + Disable vaapiupload, vaapidownload and vaapipostproc plugins. The latter + needs polishing wrt. to GStreamer 1.x functionality and the former are + totally phased out in favor of GstVaapiVideoMemory map/unmap facilities, + which are yet to be implemented. + Signed-off-by: Gwenole Beauchesne + +2013-03-21 10:12:09 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstcompat.h: + * tests/codec.c: + * tests/decoder.c: + * tests/simple-decoder.c: + * tests/test-subpicture.c: + tests: add support for GStreamer 1.0. + +2012-09-04 15:12:18 +0300 Sreerenj Balachandran + + * configure.ac: + * gst-libs/gst/vaapi/gstcompat.h: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + Add initial support for GStreamer 1.0. + This integrates support for GStreamer API >= 1.0 only in the libgstvaapi + core decoding library. The changes are kept rather minimal here so that + the library retains as little dependency as possible on core GStreamer + functionality. + Signed-off-by: Gwenole Beauchesne + +2013-04-03 15:58:57 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: improve check for raw YUV format mode. + Improve check for raw YUV format modes by avoiding checks against strings + ("video/x-raw-yuv") for each new GstBuffer allocation. In the usual case, + GstBaseSink::set_caps() is called first and if VA surface format mode is + used, then GstBaseSink::buffer_alloc() is not called. If the latter is + called before set_caps(), then we just make a full check. This one is + pretty rare though, e.g. it usually happens once for custom pipelines. + +2013-04-03 15:06:46 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginutil.c: + plugins: don't fail if there is no overlay composition to apply. + Fix gst_vaapi_apply_composition() to not fail if no overlay composition + was found. i.e. return success (TRUE). This was harmless though extra + debug messages are not nice. + This is a regression introduced by commit 95b8659. + +2013-04-03 14:59:33 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecode.h: + vaapidecode: expose the exact set of supported HW decoders. + Don't return static caps that don't mean anything for the underlying codecs + that are actually supported for decoding. i.e. always allocate a VA display + and retrieve the exact set of HW decoders available. That VA display may be + re-used later on during negotiation through GstVideoContext "prepare-context". + This fixes fallback to SW decoding if no HW decoder is available. + +2013-04-03 13:08:55 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + decoder: drop obsolete functions. + Drop the following functions that are now obsolete: + - gst_vaapi_context_get_surface() + - gst_vaapi_context_put_surface() + - gst_vaapi_context_find_surface_by_id() + - gst_vaapi_surface_proxy_new() + - gst_vaapi_surface_proxy_get_context() + - gst_vaapi_surface_proxy_set_context() + - gst_vaapi_surface_proxy_set_surface() + This is an API change. + +2013-04-03 13:14:59 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + decoder: delegate surface size check to VA context reset. + Now that the surface pool is reference counted in the surface proxy wrapper, + we can safely ignore surface size checks in gst_vaapi_decoder_ensure_context(). + Besides, this check is already performed in gst_vaapi_context_reset_full(). + +2013-04-03 11:37:44 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + decoder: simplify acquisition/release of spare surface. + Introduce gst_vaapi_surface_proxy_new_from_pool() to allocate a new surface + proxy from the context surface pool. This change also makes sure to retain + the parent surface pool in the proxy. + Besides, it was also totally useless to attach/detach parent context to + VA surface each time we acquire/release it. Since the whole context owns + all associated VA surfaces, we can mark this as such only once and for all. + +2013-03-29 10:39:37 +0100 Gwenole Beauchesne + + * configure.ac: + Bump version for development. + +2013-03-28 10:18:51 +0100 Gwenole Beauchesne + + * NEWS: + * configure.ac: + 0.5.2. + +2013-03-28 10:15:53 +0100 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2013-03-26 18:57:00 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapisink.c: + plugins: fix usage of gst_vaapi_reply_to_query(). + Make gst_vaapi_reply_to_query() first check whether the query argument + is actually a video-context query, i.e. with type GST_QUERY_TYPE_CUSTOM. + Then, make sure vaapisink propagates the query to the parent class if + it is not a video-context query. + +2013-03-26 18:45:53 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapivideobuffer.c: + * gst/vaapi/gstvaapivideobuffer.h: + plugins: streamline video buffers. + Add new gst_vaapi_video_buffer_new() helper function that allocates a video + buffer from a GstVaapiVideoMeta. Also remove obsolete and useless function + gst_vaapi_video_buffer_get_meta(). + +2013-03-26 10:31:10 +0100 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapivideometa.c: + * gst-libs/gst/vaapi/gstvaapivideometa.h: + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + * gst/vaapi/gstvaapiuploader.c: + * gst/vaapi/gstvaapivideobuffer.h: + * gst/vaapi/gstvaapivideoconverter_glx.c: + * gst/vaapi/gstvaapivideometa.c: + * gst/vaapi/gstvaapivideometa.h: + plugins: integrate GstVaapiVideoMeta from libgstvaapi. + Move GstVaapiVideoMeta from core libgstvaapi decoding library to the + actual plugin elements. That's only useful there. Also inline reference + counting code from GstVaapiMiniObject. + +2013-03-21 17:17:53 +0100 Gwenole Beauchesne + + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapipluginbuffer.c: + * gst/vaapi/gstvaapipluginbuffer.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapiupload.c: + * gst/vaapi/gstvaapiuploader.c: + * gst/vaapi/gstvaapivideobuffer.c: + * gst/vaapi/gstvaapivideobuffer.h: + plugins: drop gstvaapipluginbuffer.[ch] helper files. + Move all gst_vaapi_video_buffer_new*() helpers from gstvaapipluginbuffer.[ch] + to gstvaapivideobuffer.[ch], and drop the obsolete files. + +2013-03-21 17:06:43 +0100 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * docs/reference/libs/libs.core.types: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.h: + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapidownload.h: + * gst/vaapi/gstvaapipluginbuffer.c: + * gst/vaapi/gstvaapipostproc.h: + * gst/vaapi/gstvaapivideobuffer.c: + * gst/vaapi/gstvaapivideobuffer.h: + * gst/vaapi/gstvaapivideoconverter_glx.h: + plugins: integrate GstVaapiVideoBuffer from libgstvaapi. + Move GstVaapiVideoBuffer from core libgstvaapi decoding library to the + actual plugin elements. That's only useful there. + +2013-03-21 16:32:43 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapivideoconverter_glx.c: + plugins: use common helper function to apply compositions. + Use common gst_vaapi_apply_composition() helper function to apply compositions + attached to a buffer in vaapisink or GstVaapiVideoConverterGLX. + +2013-03-21 16:09:42 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapivideoconverter_glx.c: + * gst-libs/gst/vaapi/gstvaapivideoconverter_glx.h: + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapipluginbuffer.c: + * gst/vaapi/gstvaapivideoconverter_glx.c: + * gst/vaapi/gstvaapivideoconverter_glx.h: + plugins: integrate GstVaapiVideoConverterGLX from libgstvaapi. + Make sure libgstvaapi core decoding library doesn't include un-needed + dependencies. So, move out GstVaapiVideoConverterGLX to plugins instead. + Besides, even if the vaapisink element is not used, we are bound to have + a correctly populated GstSurfaceBuffer from vaapidecode. + Also clean-up the file along the way. + +2013-03-21 13:32:15 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: fix use of possibly uninitialized variable. + In decode_codec_data(), force initialization of format to zero so that + we can catch up cases where codec-data has neither "format" nor "wmvversion" + fields, thus making it possible to gracefully fail in this case. + +2013-03-21 13:43:46 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + jpeg: propagate buffer data as a const guchar * pointer (cosmetics). + +2013-03-21 14:36:40 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + decoder: sanitize codec-data decoding. + Add a new GstVaapiDecoder::decode_codec_data() hook to actually decode + codec-data in the decoder sub-class. Provide a common shared helper + function to do the actual work and delegating further to the sub-class. + +2013-03-21 13:41:28 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapidecoder_unit.c: + * gst-libs/gst/vaapi/gstvaapidecoder_unit.h: + decoder: get rid of GstVaapiDecoderUnit::buffer field. + Drop GstVaapiDecoderUnit buffer field (GstBuffer) since it's totally + useless nowadays as creating sub-buffers doesn't bring any value. It + actually means more memory allocations. We can't do without that in + JPEG and MPEG-4:2 decoders. + +2013-03-21 13:28:05 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + decoder: sanitize uses of codec frame input buffer (cosmetics). + Alias GST_VAAPI_DECODER_CODEC_FRAME(decoder)->input_buffer to a simple + "buffer" variable. + +2013-03-20 17:34:38 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: add helper function to apply a composition buffer. + Simplify application of a composition buffer to a GstVaapiSurface, and + all its peers, until that function is eventually promoted to libgstvaapi. + +2013-03-20 13:42:15 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: fix support for raw YUV buffers. + If the raw YUV buffer was created from vaapisink, through the buffer_alloc() + hook, then it will have a valid GstVaapiVideoMeta object attached to it. + However, we previously assumed in that case that it was a "native" VA buffer, + thus not calling into GstVaapiUploader::process(). + +2013-03-20 18:41:40 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstcompat.h: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + plugins: use modern GstElement metadata information. + Use gst_element_class_set_static_metadata() from GStreamer 1.0, which + basically is the same as gst_element_class_set_details_simple() in + GStreamer 0.10 context. + +2013-03-20 18:04:39 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + plugins: move up interfaces (cosmetics). + Move GstImplementsInterface and GstVideoContext support functions up + so that to keep a clear separation between the plugin element and its + interface hooks. + +2013-03-20 12:57:18 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiuploader.c: + plugins: upgrade to newer APIs (GstVideoInfo based helpers). + Use GstVideoInfo and gst_video_info_from_caps() helper wherever possible. + Also use the newly added gst_vaapi_image_format_from_structure() helper + in GstVaapiUploader::ensure_allowed_caps(). + +2013-03-20 14:02:48 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginbuffer.c: + plugins: fix creation of video buffer from another source buffer. + gst_vaapi_video_buffer_new_from_buffer() needs to reference the source + buffer video meta since it would be unreference'd from the get_buffer() + helper function. For other cases, we still use (steal) the newly created + video meta. + +2013-03-20 11:57:03 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginbuffer.c: + * gst/vaapi/gstvaapipluginutil.c: + plugins: include "sysdeps.h" header instead of "config.h". + +2013-03-20 18:33:23 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstcompat.h: + * tests/codec.c: + tests: modernize GstTypeFind functions. + Use the GstTypeFind hooks from GStreamer 1.0. They look safer and + exactly correspond to the expected behaviour. + +2013-03-20 11:57:57 +0100 Gwenole Beauchesne + + * tests/image.c: + * tests/image.h: + * tests/test-decode.c: + * tests/test-display.c: + * tests/test-h264.c: + * tests/test-h264.h: + * tests/test-jpeg.c: + * tests/test-jpeg.h: + * tests/test-mpeg2.c: + * tests/test-mpeg2.h: + * tests/test-mpeg4.c: + * tests/test-mpeg4.h: + * tests/test-textures.c: + * tests/test-vc1.c: + * tests/test-vc1.h: + * tests/test-windows.c: + tests: fix license templates. + +2013-03-20 11:53:59 +0100 Gwenole Beauchesne + + * tests/test-display.c: + tests: use gst_vaapi_image_format_from_structure() in test-display. + Use gst_vaapi_image_format_from_structure() helper in test-display and + then extract a VAImageFormat from it instead of relying on GstCaps for + YUV and RGB formats. + +2013-03-20 11:50:15 +0100 Gwenole Beauchesne + + * tests/codec.c: + * tests/decoder.c: + * tests/output.c: + * tests/test-decode.c: + * tests/test-display.c: + * tests/test-subpicture.c: + * tests/test-textures.c: + * tests/test-windows.c: + tests: include "sysdeps.h" header instead of "config.h". + +2013-03-20 18:25:05 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstcompat.h: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + subpicture: use gst_video_overlay_rectangle_get_pixels_unscaled_raw(). + Use newer gst_video_overlay_rectangle_get_pixels_unscaled_raw() helper + function with GStreamer 0.10 compatible semantics, or that tries to + approach the current meaning. Basically, this is also just about moving + the helper to gstcompat.h. + +2013-03-20 11:10:31 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.h: + image: add gst_vaapi_image_format_from_structure() helper. + Add helper function to convert video formats from a GstStructure to a + plain GstVaapiImageFormat. + +2013-03-20 18:12:18 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstcompat.h: + * gst-libs/gst/vaapi/sysdeps.h: + sysdeps: split out GStreamer API compatibility glue to "gstcompat.h". + +2013-03-20 11:56:15 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/sysdeps.h: + sysdeps: add more standard includes by default. + +2013-03-20 14:43:46 +0100 Gwenole Beauchesne + + * configure.ac: + configure: improve GStreamer API version checks. + +2013-03-20 11:44:10 +0100 Gwenole Beauchesne + + * configure.ac: + * debian.upstream/Makefile.am: + * debian.upstream/changelog.in: + * debian.upstream/control.in: + * debian.upstream/gstreamer-vaapi-doc.install.in: + * debian.upstream/libgstvaapi-dev.install.in: + * debian.upstream/libgstvaapi-drm.install.in: + * debian.upstream/libgstvaapi-glx.install.in: + * debian.upstream/libgstvaapi-wayland.install.in: + * debian.upstream/libgstvaapi-x11.install.in: + * debian.upstream/libgstvaapi.install.in: + * docs/reference/libs/Makefile.am: + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/plugins/Makefile.am: + * docs/reference/plugins/plugins-docs.xml.in: + * gst-libs/gst/vaapi/Makefile.am: + * gst/vaapi/Makefile.am: + * pkgconfig/Makefile.am: + * pkgconfig/gstreamer-vaapi-drm.pc.in: + * pkgconfig/gstreamer-vaapi-glx.pc.in: + * pkgconfig/gstreamer-vaapi-wayland.pc.in: + * pkgconfig/gstreamer-vaapi-x11.pc.in: + * pkgconfig/gstreamer-vaapi.pc.in: + * tests/Makefile.am: + configure: rename GST_MAJORMINOR to GST_API_VERSION. + +2013-03-20 11:28:06 +0100 Gwenole Beauchesne + + * configure.ac: + configure: improve check for H.264 codecparser. + +2013-02-26 00:38:24 +0100 Holger Kaelberer + + * gst/vaapi/gstvaapiuploader.c: + vaapiupload: fix illegal write in ensure_image(). + Fix ensure_image() to only zero-initialize the first line of each plane. + Properly initializing each plane to their full vertical resolution would + require to actually compute it based on the image format. + In particular, for NV12 images, the UV plane has half vertical resolution + vs. the Y plane. So using the full image height to initialize the UV plane + will obviously lead to a buffer overflow. Likewise for other YUV format. + Since ensure_image() is only a helper function to initialize something, + and not necessarily the whole thing, it is fine to initializ the first + line only. Besides, the target surface is not rendered either. + Signed-off-by: Gwenole Beauchesne + +2013-02-17 16:28:47 +0800 Xiang, Haihao + + * gst-libs/gst/codecparsers/Makefile.am: + * gst-libs/gst/video/Makefile.am: + build: fix compiling of local GstVideoDecoder and codecparsers. + Generated source files were missing a dependency on the complete set of + generated header files. e.g. gstvideodecoder.c requires gstvideoutils.h + to build and almost every codec parser source depends on parserutils.h. + https://bugs.freedesktop.org/show_bug.cgi?id=59575 + Signed-off-by: Xiang, Haihao + Signed-off-by: Gwenole Beauchesne + +2013-02-08 11:56:54 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: set {luma,chroma}_log2_weight_denom to 0 if no pred_weight_table(). + Force luma_log2_weight_denom and chroma_log2_weight_denom to zero if + there is no pred_weight_table() that was parsed. + This is a workaround for the VA intel-driver on Ivy Bridge. + +2013-02-07 15:42:55 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: use new profile definitions from codecparsers. + +2013-02-07 15:29:44 +0100 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit 500bc02. + 500bc02 h264: add profile enums + +2013-02-06 15:27:18 +0100 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2013-02-06 15:21:27 +0100 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit 31b1c57. + 8957fb7 mpeg2: add helpers to convert quantization matrices + 07c4034 mpeg2: store quantization matrices in zigzag scan order + +2013-01-31 11:32:24 +0100 Gwenole Beauchesne + + * tests/simple-decoder.c: + tests: simple-decoder: fix build on older platforms. + Make simple-decoder build and execute correctly on older platforms, + and more precisely older versions of glib. + +2013-01-31 11:30:12 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/glibcompat.h: + glibcompat: add replacement for g_async_queue_timeout_pop(). + g_async_queue_timeout_pop() appeared in glib 2.31.18. Implement it as + g_async_queue_timed_pop() with a GTimeVal as the final time to wait for + new data to arrive in the queue. + +2013-01-31 11:25:18 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/glibcompat.h: + glibcompat: add replacement for g_cond_wait(). + +2013-01-30 18:38:38 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix decoding of 4K videos. + Account for slice_vertical_position_extension when vertical_size > 2800. + +2013-01-30 18:54:13 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix decoding of sequence_end(). + There shall be only one place to call decode_current_picture(), and this + is in the end_frame() hook. The EOS unit is processed after end_frame() + so this means we cannot have a valid picture to decode/output at this + point. + +2013-01-30 15:10:06 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: improve robustness when packets are missing. + Improve robustness when some expected packets where not received yet + or that were not correctly decoded. For example, don't try to decode + a picture if there was no valid sequence or picture headers. + +2013-01-30 18:58:01 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + decoder: handle decode-only frames in raw API mode. + Fix gst_vaapi_decoder_get_surface() to only return frames with a valid + surface proxy, i.e. with a valid VA surface. This means that any frame + marked as decode-only is simply skipped. + +2013-01-30 16:33:48 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + decoder: allow frames to be dropped. + If the decoder was not able to decode a frame because insufficient + information was available, e.g. missing sequence or picture header, + then allow the frame to be gracefully dropped without generating + any error. + It is also possible that a frame is not meant to be displayed but + only used as a reference, so dropping that frame is also a valid + operation since GstVideoDecoder base class has extra references to + that GstVideoCodecFrame that needs to be released. + +2013-01-30 16:26:07 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: handle decode-only frames. + Decode-only frames may not have a valid surface proxy. So, simply discard + them gracefully, i.e. don't create meta data information. GstVideoDecoder + base class will properly handle this case and won't try to push any buffer + to downstream elements. + +2013-01-24 00:49:17 +0200 Sreerenj Balachandran + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: add support for post-seek semantics reset. + Implement GstVideoDecoder::reset() as a destruction of the VA decoder + and the creation of a new VA decoder. + Signed-off-by: Gwenole Beauchesne + +2013-01-30 09:38:07 +0100 Gwenole Beauchesne + + * configure.ac: + Bump version for development. + +2013-01-30 09:37:38 +0100 Gwenole Beauchesne + + * NEWS: + * configure.ac: + 0.5.1. + +2013-01-24 00:48:26 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: implement GstVaapiDecoder::flush() as a DPB flush. + +2013-01-24 17:34:43 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_frame.h: + decoder: fix documentation for GstVaapiDecoderFrame. + Drop superfluous reference to prev_slice member. + +2013-01-29 16:18:13 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + decoder: assume current frame is complete at end-of-stream. + Assume we got a complete frame when the end-of-stream is reached and that + the current codec frame contains at least one slice data unit. + +2013-01-29 14:14:45 +0100 Gwenole Beauchesne + + * NEWS: + * README: + * debian.upstream/copyright: + * gst-libs/gst/vaapi/gstvaapicodec_objects.c: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_dpb.c: + * gst-libs/gst/vaapi/gstvaapidecoder_dpb.h: + * gst-libs/gst/vaapi/gstvaapidecoder_frame.c: + * gst-libs/gst/vaapi/gstvaapidecoder_frame.h: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst-libs/gst/vaapi/gstvaapidecoder_unit.c: + * gst-libs/gst/vaapi/gstvaapidecoder_unit.h: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + * gst-libs/gst/vaapi/gstvaapiminiobject.c: + * gst-libs/gst/vaapi/gstvaapiprofile.h: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.h: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.h: + * gst-libs/gst/vaapi/gstvaapivideoconverter_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + * gst-libs/gst/vaapi/sysdeps.h: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapipluginbuffer.c: + * gst/vaapi/gstvaapipluginbuffer.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + * gst/vaapi/gstvaapiuploader.c: + * tests/output.c: + * tests/test-decode.c: + * tests/test-subpicture.c: + legal: fix year for some copyright notices (2013). + +2013-01-29 14:03:27 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.h: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.h: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.h: + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.h: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.h: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapisurface_priv.h: + * gst-libs/gst/vaapi/gstvaapiutils_x11.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.h: + * gst-libs/gst/vaapi/gstvaapivideoconverter_glx.c: + * gst-libs/gst/vaapi/gstvaapivideoconverter_glx.h: + * gst/vaapi/gstvaapidecode.h: + * gst/vaapi/gstvaapisink.h: + * tests/test-subpicture.c: + legal: fix year for some copyright notices (2012). + +2013-01-29 14:00:04 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicompat.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11_priv.h: + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + * gst-libs/gst/vaapi/gstvaapiimagepool.h: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapiobject.h: + * gst-libs/gst/vaapi/gstvaapiobject_priv.h: + * gst-libs/gst/vaapi/gstvaapiparamspecs.c: + * gst-libs/gst/vaapi/gstvaapiparamspecs.h: + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapiprofile.h: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.h: + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapitexture.h: + * gst-libs/gst/vaapi/gstvaapitypes.h: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + * gst-libs/gst/vaapi/gstvaapiutils_x11.h: + * gst-libs/gst/vaapi/gstvaapivalue.c: + * gst-libs/gst/vaapi/gstvaapivalue.h: + * gst-libs/gst/vaapi/gstvaapivideopool.c: + * gst-libs/gst/vaapi/gstvaapivideopool.h: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.h: + * tests/test-display.c: + * tests/test-surfaces.c: + * tests/test-windows.c: + legal: add Intel copyright on modified files. + +2013-01-29 13:37:41 +0100 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2013-01-28 18:09:09 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: use a local event queue to avoid lock contention. + This improves performance when rendering several surfaces from within + the same process. e.g. a tee of vaapidecode'd buffers to vaapisink. + +2013-01-28 17:28:58 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: fix thread-safe issues. + The Wayland API is not fully thread-safe and client applications shall + perform locking themselves on key functions. Besides, make sure to + release the lock if the _render() function fails. + +2013-01-28 16:37:28 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: really wait until the pending redraw completed. + Introduce gst_vaapi_window_wayland_sync() helper function to wait for + the completion of the redraw request. Use it in _render() function to + actually block until the previous draw request is completed. + +2013-01-23 10:10:35 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: fix frame_redraw callback. + The redraw callback needs to be attached to the surface prior to the + commit. Otherwise, the callback notifies the next surface repaint, + which is not the desired behaviour. i.e. we want to be notified for + the surface we have just filled. + Another isse was the redraw_pending was reset before the actual completion + of the frame redraw callback function, thus causing concurrency issues. + e.g. the callback could have been called again, but with a NULL buffer. + +2013-01-28 14:45:28 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + wayland: fix display sharing. + When the Wayland display is shared, we still have to create our own local + shell and compositor objects, since they are not propagated from the cache. + Likewise, we also need to determine the display size or vaapisink would + fail to account for the display aspect ratio, and will try to create a 0x0 + window. + +2013-01-24 17:38:53 +0100 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit 21a098e. + 21a098e vc1: fix bitplanes decoding (DIFF6 or NORM6) [residual] + f8c836a vc1: fix bitplanes decoding (DIFF6 or NORM6) + +2013-01-23 16:38:24 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: handle frames with multiple slices. + +2013-01-23 17:01:34 +0100 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit 3fba492. + 3fba492 vc1: add API to parse slice headers + +2013-01-23 11:11:25 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: handle CLOSED_ENTRY. + When CLOSED_ENTRY == 0, and if the B pictures that follow an entry-point + lack a reference anchor picture, these B pictures shall be discarded. + https://bugs.freedesktop.org/show_bug.cgi?id=59505 + +2013-01-23 10:25:52 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: cope with latest codecparser changes. + Fix build with newer VC-1 codecparser where dqsbedge was renamed to + dqbedge, and now represents either DQSBEDGE or DQDBEDGE depending on + the actual value of DQPROFILE. + +2013-01-23 10:24:04 +0100 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit 3d2c67c. + 3d2c67c vc1: simplify GstVC1VopDquant structure + +2013-01-22 10:51:40 +0100 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit 5d33da8. + 5d33da8 vc1: fix bitplanes decoding + 562bdc4 vc1: fix VOPDQUANT parser for DQUANT == 2 + 0b13d2b vc1: fix calculation of ALTPQUANT + ba88e63 vc1: fix parser for DQPROFILE in VOPDQUANT + +2013-01-22 15:47:09 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: fix size of encapsulated BDU. + Fix size of encapsulated BDUs since GstVC1BDU.size actually represents + the size of the BDU data, starting from offset, i.e. after any start + code is parsed. + This fixes a buffer overflow during the unescaping process. + +2013-01-11 17:08:00 +0800 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: fix decoding of WMV3 videos in AVI format. + The AVI demuxer (avidemux) does not set a proper "format" attribute + to the generated caps. So, try to recover the video codec format from + the "wmvversion" property instead. + Signed-off-by: Gwenole Beauchesne + +2013-01-22 13:28:13 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: review and report errors accordingly. + Use GST_ERROR() to report real errors instead of hiding them into + GST_DEBUG(). + +2013-01-22 13:50:39 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: don't create GstBuffers for all decoder units. + Don't create temporary GstBuffers for all decoder units, even if they + are lightweight "sub-buffers", since it is not really necessary to keep + the buffer data around. + +2013-01-22 16:03:18 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: implement flush() hook. + Make it a simple DPB flush. + +2013-01-22 13:44:32 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: implement {start,end}_frame() hooks. + Implement GstVaapiDecoder.start_frame() and end_frame() semantics so + that to create new VA context earlier and submit VA pictures to the + HW for decoding as soon as possible. i.e. don't wait for the next + frame to start decoding the previous one. + +2013-01-22 09:30:04 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: fix next POC for new sequence layers. + Fix next POC when a new sequence layer is reached. At this point, we + need to reset any previous reference picture, i.e. non B-frame. + +2012-08-02 17:15:26 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: port to common GstVaapiDpb interface. + Use GstVaapiDpb interface instead of maintaining our own prev and next + picture pointers. While doing so, try to derive a sensible POC value. + Signed-off-by: Gwenole Beauchesne + +2013-01-15 17:10:56 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: fix decode_sequence_end() to return success, not EOS. + +2013-01-18 17:00:18 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + decoder: simplify gst_vaapi_decoder_get_surface(). + Avoid extraenous branches, i.e. immediately return with success once we + have a decoded frame available. + +2013-01-18 16:56:15 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + decoder: optimize and clean decode_step() up. + Avoid usage of goto. Simplify decode_step() process to first accumulate all + pending buffers into the GstAdapter, and then parse and decode units from + that input adapter. Stop the process once a frame is fully decoded or an + error occurred. + +2013-01-18 14:46:23 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + display: move "vaapi" debug init to libgstvaapi_init_once(). + +2013-01-18 14:17:34 +0100 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapiversion.h.in: + display: dump gstreamer-vaapi version for debugging purposes. + +2013-01-18 14:30:48 +0100 Gwenole Beauchesne + + * tests/Makefile.am: + tests: simple-decoder: fix build with built-in videoutils. + Fix build with built-in videoutils, i.e. when system GStreamer installation + does not know about GstVideoDecoder API. + +2013-01-18 10:35:44 +0100 Gwenole Beauchesne + + * tests/simple-decoder.c: + tests: simple-decoder: flush decoded frames at EOS. + Flush the remaining decoded frames when an end-of-stream is reached. + +2013-01-18 10:25:14 +0100 Gwenole Beauchesne + + * tests/simple-decoder.c: + tests: simple-decoder: drop use of GstVaapiVideoMeta. + Don't use GstVaapiVideoMeta since that object is not guaranteed to live + in libgstvaapi forever. Rather, that'd move to plugin elements at some + point. + +2013-01-16 13:53:43 +0100 Gwenole Beauchesne + + * tests/simple-decoder.c: + tests: simple-decoder: add benchmark mode. + Add --benchmark option to enable benchmark mode where rendering is not + synchronized with presentation timestamps of the decoded surfaces. + +2013-01-16 13:29:06 +0100 Gwenole Beauchesne + + * tests/Makefile.am: + * tests/simple-decoder.c: + tests: simple-decoder: honour framerate from the bitstream. + Try to honour the framerate from the bitstream, or cap the playback to + 60 fps by default. + +2013-01-15 18:49:28 +0100 Gwenole Beauchesne + + * tests/simple-decoder.c: + tests: simple-decoder: set window size to the surface dimensions. + Set the window size to the decoded surface dimensions, if the user has + not requested the application to run in full-screen mode. Besides, no + effort is made to preserve aspect ratio or to center the video within + the mapped window. + +2013-01-15 17:33:18 +0100 Gwenole Beauchesne + + * tests/Makefile.am: + * tests/simple-decoder.c: + tests: add simple decoder application. + Add simple decoder application to show off decoding capabilities from + raw bitstreams, for debugging or performance evaluation purposes. + +2013-01-15 17:30:57 +0100 Gwenole Beauchesne + + * tests/Makefile.am: + * tests/codec.c: + * tests/codec.h: + tests: add codec helper utils. + Add helper functions to determine the codec type from a specific file + or utility functions to convert from codec type to GstCaps or from + codec name to codec type. + +2013-01-15 17:47:13 +0100 Gwenole Beauchesne + + * tests/output.c: + tests: allow fullscreen mode. + Add new --fullscreen|-f option to create new windows in fullscreen mode. + +2013-01-17 18:35:58 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: implement GstVaapiDecoder::flush() as a DPB flush. + +2013-01-17 18:07:03 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: handle end-of-stream NALU. + Handle NAL unit to actually flush any pending picture + from the DPB. + +2013-01-17 18:22:49 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: handle EOS events. + Flush all decoded frames to downstream when EOS is received. This is + performed by implementing GstVideoDecoder::finish() hook. + +2013-01-17 18:19:14 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: split gvd_handle_frame() into decode/push frames. + Split GstVideoDecoder::handle_frame() implementation into two functions: + (i) one for decoding the provided GstVideoCodecFrame and (ii) another one + for purging all decoded frames and submit them downstream. + +2013-01-17 18:33:32 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + decoder: add GstVaapiDecoder::flush() hook. + +2013-01-15 17:21:50 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + decoder: fix check for end-of-stream in raw API mode. + Make sure to immediately return GST_VAAPI_DECODER_STATUS_END_OF_STREAM + if the end-of-stream was already reached at the previous iteration. + +2013-01-15 16:55:29 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + decoder: make decode_step() return once the frame is decoded. + Make sure we always have a free surface left to use for decoding the + current frame. This means that decode_step() has to return once a frame + gets decoded. If the current adapter contains more buffers with valid + frames, they will get parsed and decoded on subsequent iterations. + +2013-01-17 15:47:17 +0100 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-branch commit b47983a. + 8840c2d h264: zero-initialize SPS VUI parameters + +2013-01-15 09:21:36 +0100 Gwenole Beauchesne + + * configure.ac: + Bump version for development. + +2013-01-15 09:21:08 +0100 Gwenole Beauchesne + + * NEWS: + * configure.ac: + 0.5.0. + +2013-01-14 11:48:58 +0100 Gwenole Beauchesne + + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapiprofile.h: + docs: expose new interfaces. + +2013-01-14 12:58:20 +0100 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2013-01-14 10:58:49 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_dpb.c: + dpb: cosmetics (clean-ups). + +2013-01-14 10:46:25 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_dpb.c: + * gst-libs/gst/vaapi/gstvaapidecoder_dpb.h: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + dpb: port to GstVaapiMiniObject. + +2013-01-14 10:21:53 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_dpb.c: + * gst-libs/gst/vaapi/gstvaapidecoder_dpb.h: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + dpb: drop GstVaapiDpb2 interface, keep only one class. + Keep only one DPB interface and rename gst_vaapi_dpb2_get_references() + to gst_vaapi_dpb_get_neighbours() so that to retrieve pictures in DPB + around the specified picture POC. + +2012-08-02 15:56:54 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_dpb.c: + * gst-libs/gst/vaapi/gstvaapidecoder_dpb.h: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + dpb: rename GstVaapiDpbMpeg2 to GstVaapiDpb2. + Move GstVaapiDpbMpeg2 API to a more generic version that could also be + useful to other decoders that require 2 reference pictures, e.g. VC-1. + Signed-off-by: Gwenole Beauchesne + +2013-01-11 16:04:30 +0100 Gwenole Beauchesne + + * configure.ac: + Bump version for pre-release. + +2013-01-11 15:57:09 +0100 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2012-07-20 12:36:33 +0200 Holger Kaelberer + + * configure.ac: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/sysdeps.h: + * tests/test-subpicture.c: + overlay: fix build without advanced GstVideoOverlayFormatFlags. + Check for global-alpha support in GstVideoOverlayComposition API. + Signed-off-by: Gwenole Beauchesne + +2013-01-04 10:19:56 +0100 Gwenole Beauchesne + + * tests/test-subpicture.c: + tests: add support for global-alpha subpictures. + Add --global-alpha option to test-subpicture. + +2013-01-10 13:09:28 +0100 Gwenole Beauchesne + + * tests/Makefile.am: + * tests/test-subpicture.c: + tests: use GstVideoOverlayComposition API for subpicture test. + +2013-01-10 11:26:17 +0100 Gwenole Beauchesne + + * tests/Makefile.am: + * tests/test-subpicture.c: + tests: use common decoder helpers for subpicture test. + Use common decoder helpers for subpicture test, thus allowing to decode + sample images in an alternate format. + +2013-01-10 11:22:38 +0100 Gwenole Beauchesne + + * tests/Makefile.am: + * tests/decoder.c: + * tests/decoder.h: + * tests/test-decode.c: + tests: add decoder helpers. + +2013-01-11 15:19:45 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + overlay: fix ordering of composition layers. + Make sure to maintain the association order of composition layers when + GstVideoOverlayRectangle objects are kept around (cached). + +2012-05-15 10:24:08 +0200 Holger Kaelberer + + * gst-libs/gst/vaapi/gstvaapicontext.c: + overlay: fix support for global-alpha. + Fix support for global-alpha subpictures. The previous changes brought + the ability to check for GstVideoOverlayRectangle changes by comparing + the underlying pixel buffer pointers. If sequence number and pixel data + did not change, then this is an indication that only the global-alpha + value changed. Now, try to update the underlying VA subpicture global-alpha + value. + Signed-off-by: Gwenole Beauchesne + +2013-01-11 11:53:05 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + overlay: detect render-rect changes. + Don't re-upload VA subpicture if only the render rectangle changed. + Rather deassociate the subpicture and re-associate it with the new + render rectangle. + +2013-01-11 11:12:26 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + overlay: fix check for pixels buffer change. + A GstVideoOverlayRectangle is created whenever the underlying pixels data + change. However, when global-alpha is supported, it is possible to re-use + the same GstVideoOverlayRectangle but with a change to the global-alpha + value. This process causes a change of sequence number, so we can no longer + check for that. + Still, if sequence numbers did not change, then there was no change in + global-alpha either. So, we need a way to compare the underlying GstBuffer + pointers. There is no API to retrieve the original pixels buffer from + a GstVideoOverlayRectangle. So, we use the following heuristics: + 1. Use gst_video_overlay_rectangle_get_pixels_unscaled_argb() with the same + format flags from which the GstVideoOverlayRectangle was created. This + will work if there was no prior consumer of the GstVideoOverlayRectangle + with alternate (non-"native") format flags. + 2. In overlay_rectangle_has_changed_pixels(), we have to use the same + gst_video_overlay_rectangle_get_pixels_unscaled_argb() function but + with flags that match the subpicture. This is needed to cope with + platforms that don't support global-alpha in HW, so the gst-video + layer takes care of that and fixes this up with a possibly new + GstBuffer, and hence pixels data (or) in-place by caching the current + global-alpha value applied. So we have to determine the rectangle + was previously used, based on what previous flags were used to + retrieve the ARGB pixels buffer. + +2013-01-10 18:42:37 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + overlay: optimize cache at the GstVideoOverlayRectangle level. + We previously assumed that an overlay composition changed if the number + of overlay rectangles in there actually changed, or that the rectangle + was updated, and thus its seqnum was also updated. + Now, we can cope with cases where the GstVideoOverlayComposition grew + by one or a few more overlay rectangles, and the initial overlay rectangles + are kept as is. + +2013-01-10 13:41:39 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + overlay: simplify caching of GstVideoOverlayComposition objects. + Create the GPtrArray once in the _init() function and destroy it only + in the _finalize() function. Then use overlay_clear() to remove all + subpicture associations for intermediate updates, don't recreate the + GPtrArray. + Make GstVaapiOverlayRectangle a reference counted object. Also make + sure that overlay_rectangle_new() actually creates and associates the + VA subpicture. + +2012-05-15 10:24:08 +0200 Holger Kaelberer + + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + overlay: add support for global-alpha. + Handle global-alpha from GstVideoOverlayComposition API. Likewise, + the same code path could also work for premultiplied-alpha but this + was not tested. + Signed-off-by: Gwenole Beauchesne + +2012-05-15 10:24:08 +0200 Holger Kaelberer + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.h: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * tests/image.c: + * tests/test-subpicture.c: + subpicture: add support for global-alpha. + Add the necessary helpers in GstVaapiDisplay to determine whether subpictures + with global alpha are supported or not. Also add accessors in GstVaapiSubpicture + to address this feature. + Signed-off-by: Gwenole Beauchesne + +2013-01-04 09:41:25 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisubpicture.h: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + subpicture: add premultiplied-alpha and global-alpha feature flags. + Add premultiplied-alpha and global-alpha feature flags, along with converters + between VA-API and gstreamer-vaapi definitions. Another round of helpers is + also necessary for GstVideoOverlayComposition API. + +2013-01-03 18:02:49 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + display: allow image/subpicture formats with additional flags. + Introduce new GstVaapiFormatInfo to store the actual GstVaapiImageFormat + and any additional flags needed. Currently, all flags are set to zero. + +2013-01-11 13:34:45 +0100 Gwenole Beauchesne + + * gst-libs/gst/codecparsers/Makefile.am: + * gst-libs/gst/video/Makefile.am: + * tests/Makefile.am: + libs: fix build of submodule wrappers. + Make sure to build codecparsers/ and videoutils/ sources against the + newly generated headers when out-of-source builds are used. + +2013-01-11 14:11:39 +0100 Gwenole Beauchesne + + * configure.ac: + configure: fix checks for packages installed in non-standard roots. + +2013-01-10 10:12:25 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiminiobject.c: + decoder: fix mini object implementation on 64-bit systems. + Use GPOINTER_TO_SIZE() instead of GPOINTER_TO_UINT() while manipulating + pointers. The latter is meant to be 32-bit only, not uintptr_t like size. + Only a gsize can hold all bits of a pointer. + Thanks to Ouping Zhang for spotting this error. + +2013-01-09 16:05:39 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: optimize scan for the end of the frame. + Heuristic: if the second start-code is available, check whether that + one marks the start of a new frame because e.g. this is a sequence + or picture header. This doesn't save much, since we already cache the + results. + +2013-01-09 13:44:18 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: optimize scan for start codes. + Accelerate scan for start codes by skipping up to 3 bytes per iteration. + A start code prefix is defined by the following bytes: 00 00 01. Thus, + for any group of 3 bytes (xx yy zz), we have the following possible cases: + 1. If zz != 1, this cannot be a start code, then skip 3 bytes; + 2. If yy != 0, this cannot be a start code, then skip 2 bytes; + 3. If xx != 0 or zz != 1, this cannot be a start code, then skip 1 byte; + 4. xx == 00, yy == 00, zz == 1, we have match! + This algorithm requires to peek bytes from the adapter. This increases the + amount of bytes copied to a temporary buffer, but this process is much faster + than scanning for all the bytes and using shift/masks. So, overall, this is + a win. + +2013-01-08 16:41:44 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: drop useless gst_adapter_peek(). + Drop useless gst_adapter_peek() since the returned buffer was not used + and this could incur superfluous memcpy(). + +2013-01-07 16:07:38 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: cosmetics: move parse_slice() down. + +2013-01-07 15:24:51 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: avoid too many allocations of parser info objects. + Move parsing back to decoding step, but keep functions separate for now. + This is needed for future optimizations that may introduce some meta data + for parsed info attached to codec frames. + +2013-01-07 14:04:22 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_unit.c: + * gst-libs/gst/vaapi/gstvaapidecoder_unit.h: + decoder: decoder units are no longer dynamically allocated objects. + +2013-01-07 13:59:07 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_frame.c: + * gst-libs/gst/vaapi/gstvaapidecoder_frame.h: + decoder: optimize pre-allocation of decoder units. + Optimize pre-allocation of decoder units, thus avoiding un-necessary + memory reallocations. The heuristic used is that we could have around + one slice unit per macroblock line. + +2013-01-07 13:41:59 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_frame.c: + * gst-libs/gst/vaapi/gstvaapidecoder_frame.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst-libs/gst/vaapi/gstvaapidecoder_unit.c: + decoder: use an array of units instead of a single-linked list. + Use a GArray to hold decoder units in a frame, instead of a single-linked + list. This makes 'append' calls faster, but not that much. At least, this + makes things clearer. + +2013-01-07 11:13:07 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapidecoder_unit.c: + * gst-libs/gst/vaapi/gstvaapidecoder_unit.h: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + decoder: refactor decoder unit API. + Allocate decoder unit earlier in the main parse() function and don't + delegate this task to derived classes. The ultimate purpose is to get + rid of dynamic allocation of decoder units. + +2013-01-07 10:48:27 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: introduce parser info instead of MPEG-2 specific decoder unit. + Use a new GstVaapiParserInfoMpeg2 data structure instead of deriving + from GstVaapiDecoderUnit for MPEG-2 specific parser information. + +2013-01-07 10:22:54 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: introduce parser info instead of H.264 specific decoder unit. + Use a new GstVaapiParserInfoH264 data structure instead of deriving + from GstVaapiDecoderUnit for H.264 specific parser information. + +2013-01-05 12:33:06 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: set default values for some header fields. + The SPS, PPS and slice headers are not fully zero-initialized in the + codecparsers/ library. Rather, the standard upstream behaviour is to + initialize only certain syntax elements with some inferred values if + they are not present in the bitstream. + At the gstreamer-vaapi decoder level, we need to further initialize + certain syntax elements with some sensible default values so that to + not complicate VA drivers that just pass those verbatim to the HW, + and also avoid an memset() of the whole decoder unit. + Signed-off-by: Sreerenj Balachandran + Signed-off-by: Gwenole Beauchesne + +2013-01-06 19:05:49 +0100 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-rebased commit b47983a. + b47983a h264: add inferred value for slice_beta_offset_div2 + +2013-01-05 17:55:47 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapipluginbuffer.c: + * gst/vaapi/gstvaapipluginbuffer.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + * gst/vaapi/gstvaapiuploader.c: + plugins: cope with new GstVaapiVideoMeta API. + Update plugin elements with the new GstVaapiVideoMeta API. + This also fixes support for subpictures/overlay because GstVideoDecoder + generates a sub-buffer from the GstVaapiVideoBuffer. So, that sub-buffer + is marked as read-only. However, when comes in the textoverlay element + for example, it checks whether the input buffer is writable. Since that + buffer read-only, then a new GstBuffer is created. Since gst_buffer_copy() + does not preserve the parent field, the generated buffer in textoverlay + is not exploitable because we lost all VA specific information. + Now, with GstVaapiVideoMeta information attached to a standard GstBuffer, + all information are preserved through gst_buffer_copy() since the latter + does copy metadata (qdata in this case). + +2013-01-05 17:37:13 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.h: + * gst-libs/gst/vaapi/gstvaapivideobuffer_glx.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer_glx.h: + * gst-libs/gst/vaapi/gstvaapivideobuffer_priv.h: + * gst-libs/gst/vaapi/gstvaapivideoconverter_glx.c: + videobuffer: wrap video meta into a surface buffer. + Make GstVaapiVideoBuffer a simple wrapper for video meta. This buffer is + no longer necessary but for compatibility with GStreamer 0.10 APIs or users + expecting a GstSurfaceBuffer like Clutter. + +2013-01-05 08:31:24 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapivideometa.c: + * gst-libs/gst/vaapi/gstvaapivideometa.h: + videobuffer: add video meta information. + Add new GstVaapiVideoMeta object that holds all information needed to + convey gst-vaapi specific data as a GstBuffer. + +2013-01-03 13:10:33 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: fix calculation of the time-out value. + Fix calculation of the time-out value for cases where no VA surface is + available for decoding. In this case, we need to wait until downstream + sink consumed at least one surface. The time-out was miscalculated as + it was always set to + one second, which is not suitable + for streams with larger gaps. + +2013-01-03 13:05:47 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + decoder: always use the calculated presentation timestamp. + Use PTS value computed by the decoder, which could also be derived from + the GstVideoCodecFrame PTS. This makes it possible to fix up the PTS if + the original one was miscomputed or only represented a DTS instead. + +2013-01-02 17:33:15 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: don't create sub-buffer for slice data. + +2013-01-03 11:16:44 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + decoder: create new context when encoded resolution changes. + Create a new VA context if the encoded surface size changes because we + need to keep the underlying surface pool until the last one was released. + Otherwise, either of the following cases could have happened: (i) release + a VA surface to an inexistent pool, or (ii) release VA surface to an + existing surface pool, but with different size. + +2013-01-02 17:23:53 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: don't create sub-buffer for slice data. + Avoid creating a GstBuffer for slice data. Rather, directly use the codec + frame input buffer data. This is possible because the codec frame is valid + until end_frame() where we submit the VA buffers for decoding. Anyway, the + slice data buffer is copied into the VA buffer when it is created. + +2013-01-02 14:45:50 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: minor clean-ups. + Drop explicit initialization of most fields that are implicitly set to + zero. Remove some useless checks for NULL pointers. + +2013-01-02 14:18:31 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: optimize scan for the second start code. + Optimize scan for the second start code, on the next parse() call so that + to avoid scanning again earlier bytes where we didn't find any start code. + +2013-01-02 14:10:20 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: use sequence_display_extension() to compute PAR. + Also compute pixel-aspect-ratio from sequence_display_extension(), + should it exist in the bitstream. + +2013-01-02 14:02:29 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: handle sequence_display_extension(). + +2012-12-27 15:18:55 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: implement {start,end}_frame() hooks. + Implement GstVaapiDecoder.start_frame() and end_frame() semantics so + that to create new VA context earlier and submit VA pictures to the + HW for decoding as soon as possible. i.e. don't wait for the next + frame to start decoding the previous one. + +2012-12-27 14:54:29 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: parse slice() header earlier. + Parse slice() header and first macroblock position earlier in _parse() + function instead of waiting for the _decode() stage. This doesn't change + anything but readability. + +2012-12-27 14:41:04 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: add codec specific decoder unit. + Introduce new GstVaapiDecoderUnitMpeg2 object, which holds the standard + GstMpegVideoPacket and additional parsed header info. Besides, we now + parse as early as in the _parse() function so that to avoid un-necessary + creation of sub-buffers in _decode() for video packets that are not slices. + +2012-12-27 18:52:43 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_frame.c: + * gst-libs/gst/vaapi/gstvaapidecoder_frame.h: + * gst-libs/gst/vaapi/gstvaapidecoder_unit.h: + decoder: introduce lists of units to decode before/after frame. + Theory of operations: all units marked as "slice" are moved to the "units" + list. Since this list only contains slice data units, the prev_slice pointer + was removed. Besides, we now maintain two extra lists of units to be decoded + before or after slice data units. + In particular, all units in the "pre_units" list will be decoded before + GstVaapiDecoder::start_frame() is called and units in the "post_units" + list will be decoded after GstVaapiDecoder::end_frame() is called. + +2013-01-02 16:06:18 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicodec_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + decoder: drop useless checks for codec objects. + Codec objects are used internally only and they are bound to be created + with a valid GstVaapiDecoder object. + +2012-12-27 10:35:45 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: use GST_ERROR to print error messages. + +2012-12-27 09:55:14 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: avoid double release of frame on error. + Don't call gst_video_decoder_drop_frame() if gst_video_decoder_finish_frame() + was already called before and it returned an error. In that case, we were + releasing the frame again, thus leading to a "double-free" condition. + +2012-12-21 14:29:01 +0100 Gwenole Beauchesne + + * .gitmodules: + * autogen.sh: + * configure.ac: + * ext/Makefile.am: + * ext/videoutils: + * gst-libs/gst/Makefile.am: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/video/Makefile.am: + * gst/vaapi/Makefile.am: + Add videoutils submodule for GstVideoDecoder APIs. + +2012-12-18 16:36:01 +0100 Gwenole Beauchesne + + * configure.ac: + configure: check for GstVideoDecoder API. + GstVideoDecoder API is part of an unreleased GStreamer 0.10 stack. In particular, + this is only available in git 0.10 branch or GStreamer >= 1.0 stack. Interested + parties may either use upstream git 0.10 branch or backport the necessary support + for GstVideoDecoder API, thus including helper tools like GstVideoCodecFrame et al. + +2012-12-18 16:21:31 +0100 Gwenole Beauchesne + + * docs/reference/libs/libs.core.types: + docs: remove obsolete gst_vaapi_surface_proxy_get_type(). + GstVaapiSurfaceProxy is no longer based on the GType system. + +2012-12-18 16:17:22 +0100 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + docs: fix entries for GstVaapiSurfaceProxy. + +2012-12-18 15:29:58 +0100 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2012-12-18 15:15:52 +0100 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + Bump library major version. + Increase library major so that to cope with API/ABI incompatible changes + since 0.4.x series and avoid user issues. + +2012-12-13 16:02:52 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + surfaceproxy: minor clean-ups. + +2012-12-13 15:51:24 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + surfaceproxy: drop accessors to obsolete attributes. + Make GstVaapiSurfaceProxy only a thin wrapper around a VA context and a + VA surface. i.e. drop any other attribute like timestamp, duration, + interlaced or top-field-first. + +2012-12-13 15:34:10 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst/vaapi/gstvaapidecode.c: + decoder: maintain decoded frames as GstVideoCodecFrame objects. + Maintain decoded surfaces as GstVideoCodecFrame objects instead of + GstVaapiSurfaceProxy objects. The latter will tend to be reduced to + the strict minimum: a context and a surface. + +2012-12-13 14:30:18 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: output all decoded frames as soon as possible. + Make sure to push all decoded frames downstream as soon as possible. + This makes sure we don't need to wait for a new frame to be ready to + be decoded before receiving new decoded frames. + This also separates the decode process and the output process. The latter + could be moved to a specific GstTask later on. + +2012-12-13 14:27:18 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + decoder: add gst_vaapi_decoder_get_frame() API. + Add new gst_vaapi_decoder_get_frame() function meant to be used with + gst_vaapi_decoder_decode(). The purpose is to return the next decoded + frame as a GstVideoCodecFrame and the associated GstVaapiSurfaceProxy + as the user-data object. + +2012-12-13 15:47:27 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: use GstBuffer flags for TFF. + Determine whether the buffer represents the top-field only by checking for + the GST_VIDEO_BUFFER_TFF flag instead of relying on the GstVaapiSurfaceProxy + flag. Also trust "interlaced" caps to determine whether the input frame + is interleaved or not. + +2012-12-13 13:27:33 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: handle video sub-buffers. + Intermediate elements may produce a sub-buffer from a valid GstVaapiVideoBuffer + for non raw YUV cases. Make sure vaapipostproc now understands those buffers. + +2012-12-18 14:57:36 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: optimize initialization process of decoder units. + Decoder units were zero-initialized, including the SPS/PPS/slice headers. + The latter don't require zero-initialization since the codecparsers/ lib + will do so for key variables already. This is not a great value per se but + at least it makes it possible to check whether the default initialization + decisions made in the codecparsers/ lib were right or not. + This can be reverted if this exposes too many issues. + +2012-12-13 11:48:06 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: minor clean-ups. + Drop explicit initialization of most fields that are implicitly set to + zero. Drop helper macros for casting to GstVaapiPictureH264 or + GstVaapiFrameStore. Also remove some useless checks for NULL pointers. + +2012-12-07 17:45:03 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: drop GstVaapiSliceH264 object. + Use standard GstVaapiSlice object from now on since we already have + parsed and recorded the slice headers (GstH264SliceHdr decode units). + +2012-12-13 10:47:25 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: detect new pictures from decode-units. + Update is_new_picture() to cope with GstVaapiDecoderUnitH264, instead + of assuming frame boundaries when first_mb_in_slice is zero. + +2012-12-13 10:21:46 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: implement {start,end}_frame() hooks. + Implement GstVaapiDecoder.start_frame() and end_frame() semantics so + that to create new VA context earlier and submit VA pictures to the + HW for decoding as soon as possible. i.e. don't wait for the next + frame to start decoding the previous one. + +2012-12-12 18:33:52 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: optimize scan for the second start code. + Optimize scan for the second start code, on the next parse() call so that + to avoid scanning again earlier bytes where we didn't find any start code. + +2012-12-06 17:25:01 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: add codec specific decoder unit. + Introduce new GstVaapiDecoderUnitH264 object, which holds the standard + NAL unit header (GstH264NalUnit) and additional parsed header info. + Besides, we now parse headers as early as in the _parse() function so + that to avoid un-necessary creation of sub-buffers in _decode() for + NAL units that are not slices. + This is a performance win by ~+1.1% only. + +2012-12-04 11:01:42 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: handle sub video-buffers. + Intermediate elements may produce a sub-buffer from a valid GstVaapiVideoBuffer + for non raw YUV cases. Make sure vaapisink now understands those buffers. + +2012-12-12 15:22:32 +0100 Sreerenj Balachandran + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: use gst_vaapi_decoder_get_codec_state(). + Directly use the GstVideoCodecState associated with the VA decoder + instead of parsing caps again. + Signed-off-by: Sreerenj Balachandran + Signed-off-by: Gwenole Beauchesne + +2012-12-04 14:53:15 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: use more standard helpers. + Use g_clear_object() [glib >= 2.28] and gst_caps_replace() helper functions + in more places. + +2012-12-04 14:45:29 +0100 Sreerenj Balachandran + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecode.h: + vaapidecode: move to GstVideoDecoder base class. + Make vaapidecode derive from the standard GstVideoDecoder base element + class. This simplifies the code to the strict minimum for the decoder + element and makes it easier to port to GStreamer 1.x API. + Signed-off-by: Sreerenj Balachandran + Signed-off-by: Gwenole Beauchesne + +2012-12-06 14:02:25 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + jpeg: initial port to new GstVaapiDecoder API + +2012-12-06 14:02:21 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: initial port to new GstVaapiDecoder API + +2012-12-06 14:02:17 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: initial port to new GstVaapiDecoder API + +2012-12-17 09:47:20 -0800 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + mpeg4: initial port to new GstVaapiDecoder API + +2012-12-06 14:01:46 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: initial port to new GstVaapiDecoder API. + +2012-12-12 15:09:21 +0100 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapiprofile.h: + decoder: use GstVideoCodecState. + Use standard GstVideoCodecState throughout GstVaapiDecoder and expose + it with a new gst_vaapi_decoder_get_codec_state() function. This makes + it possible to drop picture size (width, height) information, framerate + (fps_n, fps_d) information, pixel aspect ratio (par_n, par_d) information, + and interlace mode (is_interlaced field). + This is a new API with backwards compatibility maintained. In particular, + gst_vaapi_decoder_get_caps() is still available. + Signed-off-by: Sreerenj Balachandran + Signed-off-by: Gwenole Beauchesne + +2012-12-12 13:44:07 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * tests/test-decode.c: + * tests/test-subpicture.c: + decoder: update gst_vaapi_decoder_get_surface() semantics. + Align gst_vaapi_decoder_get_surface() semantics with the rest of the + API. That is, return a GstVaapiDecoderStatus and the decoded surface + as a handle to GstVaapiSurfaceProxy in parameter. + This is an API/ABI change. + +2012-12-07 16:40:44 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + decoder: use standard helper functions. + Use g_clear_object(), gst_buffer_replace() and gst_caps_replace() + whenever necessary. + +2012-11-29 15:06:00 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + decoder: expose new parse/decode API. + Introduce new decoding process whereby a GstVideoCodecFrame is created + first. Next, input stream buffers are accumulated into a GstAdapter, + that is then passed to the _parse() function. The GstVaapiDecoder object + accumulates all parsed units and when a complete frame or field is + detected, that GstVideoCodecFrame is passed to the _decode() function. + Ultimately, the caller receives a GstVaapiSurfaceProxy if decoding + process was successful. + +2012-12-13 10:20:35 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + decoder: add {start,end}_frame() hooks. + The start_frame() hook is called prior to traversing all decode-units + for decoding. The unit argument represents the first slice in the frame. + Some codecs (e.g. H.264) need to wait for the first slice in order to + determine the actual VA context parameters. + +2012-12-06 13:57:42 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + decoder: add new GstVaapiDecoder API. + Split decoding process into two steps: (i) parse incoming bitstreams + into simple decoder-units until the frame or field is complete; and + (ii) decode the whole frame or field at once. + This is an ABI change. + +2012-12-05 10:51:41 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidecoder_frame.c: + * gst-libs/gst/vaapi/gstvaapidecoder_frame.h: + decoder: add new "decoder-frame" object. + Introduce a new GstVaapiDecoderFrame that is just a list of decoder units + (GstVaapiDecoderUnit objects) that constitute a frame. This object is just + an extension to GstVideoCodecFrame for VA decoder purposes. It is available + as the user-data member element. + This is a libgstvaapi internal object. + +2012-12-06 09:44:01 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidecoder_unit.c: + * gst-libs/gst/vaapi/gstvaapidecoder_unit.h: + decoder: add new "decoder-unit" object. + Introduce GstVaapiDecoderUnit which represents a fragment of the source + stream to be decoded. For instance, a decode-unit will be a NAL unit for + H.264 streams, an EBDU for VC-1 streams, and a video packet for MPEG-2 + streams. + This is a libgstvaapi internal object. + +2012-12-03 14:09:01 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + Port GstVaapiFrameStore to GstVaapiMiniObject. + +2012-12-03 11:19:08 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicodec_objects.c: + * gst-libs/gst/vaapi/gstvaapicodec_objects.h: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + Port codec objects to GstVaapiMiniObject. + +2012-12-03 13:46:28 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapipluginbuffer.c: + * tests/test-decode.c: + * tests/test-subpicture.c: + surfaceproxy: port to GstVaapiMiniObject. + GstVaapiSurfaceProxy does not use any particular functionality from + GObject. Actually, it only needs a basic object type with reference + counting. + This is an API and ABI change. + +2012-11-30 17:25:07 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiminiobject.c: + * gst-libs/gst/vaapi/gstvaapiminiobject.h: + Add GstVaapiMiniObject. + Introduce a new reference counted object that is very lightweight and + also provides flags and user-data functionalities. Initialization and + finalization times are reduced by up to a factor 5x vs GstMiniObject + from GStreamer 0.10 stack. + This is a libgstvaapi internal object. + +2012-12-17 02:51:17 -0800 Gwenole Beauchesne + + * tests/Makefile.am: + * tests/test-decode.c: + * tests/test-mpeg4.c: + * tests/test-mpeg4.h: + tests: add test for MPEG-4:2 decoding. + +2012-12-17 04:42:29 -0800 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: initialize VA context before allocating the first slice. + Fix decode_slice() to ensure a VA context exists prior to creating a + new GstVaapiSliceH264, which invokes vaCreateBuffer() with some VA + context ID. i.e. the latter was not initialized, thus causing failures + on Cedar Trail for example. + +2012-12-05 09:15:32 +0800 Zhao Halley + + * configure.ac: + configure: install plugin elements in GST_PLUGIN_PATH, if set. + If GST_PLUGIN_PATH environment variable exists and points to a valid + directory, then use it as the system installation path for gst-vaapi + plugin elements. + Signed-off-by: Gwenole Beauchesne + +2012-12-17 14:27:56 +0100 Gwenole Beauchesne + + * configure.ac: + configure: downgrade glib required version to 2.28. + +2012-12-17 09:41:24 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/glibcompat.h: + * gst/vaapi/gstvaapi.c: + libs: fix compatibility with glib 2.28. + Always prefer non deprecated APIs by default and provide compatibility + glue for older glib versions when necessary. + +2012-12-17 10:10:55 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplaycache.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + libs: use glib >= 2.32 semantics for mutexes. + Use glib >= 2.32 semantics for GMutex and GRecMutex wrt. initialization + and termination. Basically, the new mutex objects can be used as static + mutex objects from the deprecated APIs, e.g. GStaticMutex and GStaticRecMutex. + +2012-12-17 04:15:53 -0800 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + libs: only export gst_vaapi_*() symbols. + This fixes symbol clashes between the gst-vaapi built-in codecparsers/ + library and the system-provided one, mainly used by videoparses/. Now, + only symbols with the gst_vaapi_* prefix will be exported, if they are + not marked as "hidden" to libgstvaapi. + +2012-11-20 18:21:41 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiuploader.c: + vaapiupload: reset direct-rendering to zero when changing caps. + Make sure to reset direct-rendering flag to zero when caps are changed, + and only derive it to one when the next checks succeed. + +2012-11-20 14:42:24 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiupload.c: + vaapiupload: fix sink caps to report the supported set of YUV caps. + Try to allocate the GstVaapiUploader helper object prior to listing the + supported image formats. Otherwise, only a single generic caps is output + with no particular pixel format referenced in there. + +2012-11-20 14:32:40 +0100 Zhao Halley + + * gst/vaapi/gstvaapiupload.c: + * gst/vaapi/gstvaapiupload.h: + vaapiupload: use new GstVaapiUploader helper. + Use GstVaapiUploader helper that automatically handles direct rendering + mode, thus making the "direct-rendering" property obsolete and hence it + is now removed. + The "direct-rendering" level 2, i.e. exposing VA surface buffers, was never + really well supported and it could actually trigger degraded performance. + Signed-off-by: Gwenole Beauchesne + +2012-11-20 15:50:56 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiuploader.c: + * gst/vaapi/gstvaapiuploader.h: + vaapisink: compute and expose the supported set of YUV caps. + Make vaapisink expose only the set of supported caps for raw YUV buffers. + Add gst_vaapi_uploader_get_caps() helper function to determine the set + of supported YUV caps as source (for images). This function actually + tries to zero and upload each image to a 64x64 test surface. Of course, + this relies on VA drivers to not claim success if vaPutImage() is not + correctly supported. + +2012-11-20 14:28:55 +0100 Gwenole Beauchesne + + * NEWS: + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + * gst/vaapi/gstvaapiuploader.c: + * gst/vaapi/gstvaapiuploader.h: + vaapisink: add support for raw YUV buffers. + Add new GstVaapiUploader helper to upload raw YUV buffers to VA surfaces. + It is up to the caller to negotiate source caps (for images) and output + caps (for surfaces). gst_vaapi_uploader_has_direct_rendering() is available + to help decide between the creation of a GstVaapiVideoBuffer or a regular + GstBuffer on sink pads. + Signed-off-by: Zhao Halley + Signed-off-by: Gwenole Beauchesne + +2012-11-20 14:36:29 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiimage.c: + image: fix GstVaapiImage map and unmap. + Fix gst_vaapi_image_map() to return TRUE and the GstVaapiImageRaw + structure correctly filled in if the image was already mapped. + Likewise, make gst_vaapi_image_unmap() return TRUE if the image + was already unmapped. + +2012-10-30 13:15:45 +0800 Wind Yuan + + * NEWS: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + videobuffer: fix memory leak for surface and image. + Fix reference leak of surface and image in GstVaapiVideoBuffer wrapper, + thus resulting on actual memory leak of GstVaapiImage when using them + for downloads/uploads from VA surfaces and more specifically surfaces + when the pipeline is shutdown. i.e. vaTerminate() was never called + because the resources were not unreferenced, and thus not deallocated + in the end. + Signed-off-by: Gwenole Beauchesne + +2012-11-19 10:04:52 +0100 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2012-11-16 18:00:10 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: fix picture size in macroblocks. + The picture size signalled by sps->{width,height} is the actual size with + cropping applied, not the original size derived from pic_width_in_mbs_minus1 + and pic_height_in_map_units_minus1. VA driver expects that original size, + uncropped. + There is another issue pending: frame cropping information needs to be + taken care of. + +2012-11-16 16:18:52 +0100 Gwenole Beauchesne + + * gst-libs/gst/codecparsers/Makefile.am: + codecparsers: always build parserutils first. + Fix commit 18245b4 so that to link and build parserutils.[ch] first. + This is needed since that's the common dependency for actual codec + parsers (gstvc1parser.c for instance). + +2012-11-15 17:50:45 +0100 Gwenole Beauchesne + + * gst-libs/gst/codecparsers/Makefile.am: + codecparsers: always build the VC-1 parser library. + ... this is useful to make sure pixel-aspect-ratio and framerate + information are correctly parsed since we have no means to detect + that at configure time. + +2012-11-08 11:40:47 +0200 Sreerenj Balachandran + + * configure.ac: + * gst-libs/gst/codecparsers/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix PAR calculation from commit bd11bae. + Invoke gst_mpeg_video_finalise_mpeg2_sequence_header() to get the + correct PAR values. While doing so, require a newer version of the + bitstream parser library. + Note: it may be necessary to also parse the Sequence_Display_Extension() + header. + Signed-off-by: Sreerenj Balachandran + Signed-off-by: Gwenole Beauchesne + +2012-11-15 15:00:43 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + Fix build with the GNU gold linker. + In particular, fix libgstvaapi-glx DSO dependencies to include libgstbase + and libgstvideo libs, e.g. for gst_video_buffer_get_overlay_composition(). + +2012-11-02 18:18:37 +0000 Rob Bradford + + * configure.ac: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland_priv.h: + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: port to 1.0 version of the protocol. + This patch updates to relect the 1.0 version of the protocol. The main + changes are the switch to wl_registry for global object notifications + and the way that the event queue and file descriptor is processed. + Signed-off-by: Gwenole Beauchesne + +2012-11-14 19:22:13 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: fix incorrect integration of previous commit (4d31e1e). + git am got confused somehow, though the end result doesn't change at + all since we require both SPS and PPS to be parsed prior to decoding + the first slice. + +2012-11-14 18:40:47 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: start decoding slices after first SPS/PPS activation. + Only start decoding slices when at least one SPS and PPS got activated. + This fixes cases when a source represents a substream of another stream + and no SPS and PPS was inserted before the first slice of the generated + substream. + +2012-11-14 14:25:34 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: fix VAPictureParameterBufferH264.ReferenceFrames[] construction. + ... for interlaced streams. The short_ref[] and long_ref[] arrays may + contain up to 32 fields but VA ReferenceFrames[] array expects up to + 16 reference frames, thus including both fields. + +2012-11-14 10:27:12 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: fix interlaced stream decoding with MMCO. + Fix decoding of interlaced streams when adaptive_ref_pic_marking_mode_flag + is equal to 1, i.e. when memory management control operations are used. In + particular, when field_pic_flag is set to 0, the new reference flags shall + be applied to both fields. + +2012-11-13 17:14:39 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: add initial support for interlaced streams. + Decoded frames are only output when they are complete, i.e. when both + fields are decoded. This also means that the "interlaced" caps is not + propagated to vaapipostproc or vaapisink elements. Another limitation + is that interlaced bitstreams with MMCO are unlikely to work. + +2012-11-13 16:35:30 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: split remove_reference_at() into finer units. + Split remove_reference_at() into a function that actually removes the + specified entry from the short-term or long-term reference picture array, + and a function that sets reference flags to the desired value, possibly + zero. The latters marks the picture as "unused for reference". + +2012-10-23 14:04:22 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + decoder: fix gst_vaapi_picture_new_field() object type. + Fix gst_vaapi_picture_new_field() to preserve the original picture type. + e.g. gst_vaapi_picture_new_field() with a GstVaapiPictureH264 argument + shall generate a GstVaapiPictureH264 object. + +2012-11-13 14:04:31 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: add picture structure for reference picture marking process. + Introduce new `structure' field to the H.264 specific picture structure + so that to simplify the reference picture marking process. That local + picture structure is derived from the original picture structure, as + defined by the syntax elements field_pic_flag and bottom_field_flag. + +2012-11-02 15:14:58 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: introduce new frame store structure. + The frame store represents a Decoded Picture Buffer entry, which can + hold up to two fields. So far, the frame store is only used to hold + full frames. + +2012-11-13 10:10:31 +0100 Gwenole Beauchesne + + * ext/codecparsers: + codecparsers: update to gst-vaapi-rebased commit 73d6aab. + 73d6aab h264: fix rbsp_more_data() implementation + 25d04cf h264: fix error code for invalid size parsed in SPS + 84798e5 fix FSF address + +2012-10-31 16:37:14 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: minor clean-ups. + Move DPB flush up if the current picture to decode is an IDR. Besides, + don't bother to check for IDR pictures in dpb_add() function since an + explicit DPB flush was already performed in this case. + +2012-10-31 14:24:09 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: simplify reference picture marking process. + ... to build the short_ref[] and long_ref[] lists from the DPB, instead + of maintaining them separately. This avoids refs/unrefs while making it + possible to generate the list based on the actual picture structure. + This also ensures that the list of generated ReferenceFrames[] actually + matches what reference frames are available in the DPB. i.e. short_ref[] + and long_ref[] entries are implied from the DPB, so there is no risk of + having "dangling" references. + +2012-10-31 11:52:03 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: introduce per-field POC in GstVaapiPictureH264. + Use the POC member available in the GstVaapiPicture base class and + get rid of the dependency on the local VAPictureH264 TopFieldOrderCnt + and BottomFieldOrderCnt. Rather, use a simple field_poc[] array + initialized to INT_MAX, so that to simplify picture POC calculation + for non frame pictures. + +2012-10-31 11:45:14 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: introduce GST_VAAPI_PICTURE_{SHORT,LONG}_TERM_REFERENCE flags. + Further get rid of GstVaapiPictureH264-local VAPictureH264.flags for + reference bits, thus simplifying the reference picture marking process + to only track a single set of reference flags. Also introduce a new + long_term_frame_idx member. + +2012-10-31 11:33:40 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: introduce GST_VAAPI_PICTURE_FLAG_IDR flag. + +2012-10-31 10:56:15 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: fill in GstVaapiPicture structure. + ... and get rid of local VAPictureH264.flags fields in GstVaapiPictureH264. + +2012-10-31 11:07:48 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: add vaapi_fill_picture() helper. + Add vaapi_fill_picture() helper function to convert GstVaapiPictureH264 + to VAPictureH264 structure. This is preparatory work to get rid of the + local VAPictureH264 member in GstVaapiPictureH264. + +2012-10-26 16:12:05 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: fix activation order of picture and sequence parameters. + Delay ensure_context() until we actually need a VA context for allocating + new VA surfaces, and then GstVaapiPictures, but also when a real activation + of a new picture parameter set occurs, thus also implying an activation + of the related sequence parameter set. + The most important thing was to drop the global pps and sps pointers since + they may not have matched the currently activated picture parameter or + sequence parameter sets at the specified decode point. + Anoter positive side-effect is that this cleans up all occurrences of + decode_current_picture() to only keep those useful in decode_picture(), + before a new picture is allocated, or in decode_sequence_end() when + an end-of-stream or end-of-sequence condition occurred. + +2012-10-26 13:17:43 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: fix scaling list generation. + ... aka fix regression from efaab79. In particular, ScalingList8x8[] + array was partially copied to the VAIQMatrixBufferH264. While we are + at it, also improve bounds checking and avoid copying 8x8 scaling + lists if transform_8x8_mode_flag is set to 0. + +2012-10-24 18:23:09 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: fix detection of picture boundaries. + Strictly follow the standard (7.4.1.2.4) to detect the first VCL NAL + unit of a primary coded picture. + +2012-10-23 14:50:14 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: optimize handling of scaling lists. + Don't copy scaling lists twice to an intermediate state. Rather, directly + use the scaling lists from GstH264PPS since they would match those provided + by SPS header, if necessary. i.e. if PPS-specific scaling lists are not + available in the bitstream. + +2012-10-23 10:33:50 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: simplify code when MMCO is 5. + Remove exit_picture() and exit_picture_poc() since PicOrderCnt(CurrPic) + is now updated accordingly to the standard. Besides, MMCO = 5 specific + operations are moved up to exec_ref_pic_marking_adaptive_mmco_5(). + +2012-10-22 11:52:13 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: fix MMCO-based reference picture marking process. + Fix adaptive memory control decoded reference picture marking process + implementation for operations 2 to 6, thus also fixing support for + long-term reference pictures. + +2012-10-22 10:50:29 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: move MMCO handlers out of the loop (cosmetics). + This change only splits each individual MMCO handler into several functions + dedicated for each operation. This is needed to perform further work later + on. + +2012-10-17 15:49:23 +0200 Gwenole Beauchesne + + * Makefile.am: + debian: fix make dist for packaging. + bzip2 tarballs are now used, so update the deb.upstream dependencies + to include dist-bzip2 instead of plain old dist, and use the correct + tar extract options to handle that format. + +2012-10-17 15:42:17 +0200 Gwenole Beauchesne + + * configure.ac: + configure: generate bzip2 tarballs in ustar format by default. + +2012-10-17 15:38:14 +0200 Gwenole Beauchesne + + * configure.ac: + configure: bump glib required version to 2.31.2. + Use new Thread API. In particular, g_mutex_init() and g_cond_init() + rather than g_mutex_new() and g_cond_new() respectively. + +2012-10-04 17:39:53 +0100 Rob Bradford + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecode.h: + vaapidecode: adopt non-deprecrated glib locking primitive pattern. + The use of heap allocated GMutex/GCond is deprecated. Instead place them + inside the structure they are locking. + These changes switch to use g_mutex_init/g_cond_init rather than the heap + allocation functions. + Because we cannot test for a NULL pointer for the GMutex/GCond we must + initialise inside the GObject _init function and clear inside the _finalize + which is guaranteed to only be called once and after the object is no longer + in use. + +2012-10-17 14:52:35 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: fix compiler warnings. + Don't care of the return value for gst_vaapi_decoder_put_buffer() + during destruction of the element. Don't print out (uninitialised) + error code when allocation of video buffer failed. + +2012-10-16 16:52:04 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: add flag to compile with strict DPB ordering mode. + Allow build with strict DPB ordering mode whereby evicted entries + are replaced by the next entries, in order instead of optimizing + it away with the last entry in the DPB. + This is only useful for debugging purpose, against a reference SW + decoder for example. + +2012-10-16 16:46:17 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: drop extra code covered by built-in codecparsers. + GstH264SliceHdr.n_emulation_prevention_bytes is bound to exist now that + a newer version of codecparsers/ are used if the system provided one is + now recent enough to have those required extensions. + +2012-10-16 16:43:43 +0200 Gwenole Beauchesne + + * gst-libs/gst/codecparsers/Makefile.am: + codecparsers: fix generation of symlinks. + Try to improve dependencies while generating symlinks to externally + maintained copy of codecparsers (derived from upstream git master + tree). + +2012-10-11 15:04:12 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: use framerate information from bitstream parser. + +2012-09-27 18:05:46 +0100 Simon Farnsworth + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: use pixel-aspect-ratio from bitstream parser. + Signed-off-by: Simon Farnsworth + Signed-off-by: Gwenole Beauchesne + +2012-09-27 18:05:46 +0100 Simon Farnsworth + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: use pixel-aspec-ratio information from bitstream parser. + Signed-off-by: Simon Farnsworth + Signed-off-by: Gwenole Beauchesne + +2012-10-11 13:49:14 +0200 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/codecparsers/Makefile.am: + codecparsers: h264: use submodule sources. + Use newer sources from the codecparsers/ submodule for + - GstH264SliceHdr.n_emulation_prevention_bytes: EPBs; + - GstH264VUIParams.{par_n,par_d}: pixel-aspect-ratio. + +2012-10-11 13:23:02 +0200 Gwenole Beauchesne + + * .gitignore: + * configure.ac: + * gst-libs/gst/codecparsers/Makefile.am: + * gst-libs/gst/codecparsers/gstjpegparser.c: + * gst-libs/gst/codecparsers/gstjpegparser.h: + * gst-libs/gst/vaapi/Makefile.am: + codecparsers: jpeg: use submodule sources. + +2012-10-11 10:03:14 +0200 Gwenole Beauchesne + + * .gitmodules: + * Makefile.am: + * autogen.sh: + * configure.ac: + * ext/Makefile.am: + * ext/codecparsers: + Add codecparsers submodule. + +2012-10-11 14:17:12 +0200 Gwenole Beauchesne + + * .gitignore: + .gitignore: updates. + +2012-10-11 13:40:37 +0200 Gwenole Beauchesne + + * autogen.sh: + autogen: fix check for gtkdocize and autoreconf. + If gtkdocize or autoreconf programs were not found, then the autogen.sh + script would fail to report that correctly because test -z was not passed + any argument (empty string "" in this case). + +2012-09-27 18:05:46 +0100 Simon Farnsworth + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: use pixel-aspect-ratio from SPS header. + Propagate pixel-aspect-ratio determined by the GStreamer codecparser + from the sequence headers. + Signed-off-by: Simon Farnsworth + Signed-off-by: Gwenole Beauchesne + +2012-10-10 10:35:20 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: add decode_nalu() helper function. + Split decode_buffer() into the core infrastructure that determines + the NAL units contained in the adapter and the actual function that + decodes the NAL unit. + +2012-10-10 10:31:39 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: fix end-of-stream conditions (flush). + Decode pending data in the adapter prior to processing the actual + code for end-of-stream. + +2012-10-10 09:45:03 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: add decode_packet() helper function. + Split decode_buffer() into the core infrastructure that determines + the packets contained in the adapter and the actual function that + decodes the packet data. + +2012-10-09 15:34:18 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix end-of-stream conditions (flush). + Decode pending data in the adapter prior to processing the actual + code for end-of-stream. Initial code from Feng Yuan. + +2012-10-09 15:40:49 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix memory leak of empty packets. + Fix memory leakage of empty packets, i.e. packets that only contain + the start code prefix. In particular, free empty user-data packets. + Besides, the codec parser will already fail gracefully if the packet + to parse does not have the minimum required size. So, we can also + completely drop the block of code that used to handle packets of size 4 + (including the start code). + +2012-10-09 15:01:38 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix return value for "no-data" conditions. + Fix return value when the second scan for start code fails. This means + there is not enough data to determine the full extents of the current + packet and the function shall return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA + in this case, instead of GST_VAAPI_DECODER_STATUS_SUCCESS. + +2012-10-09 14:48:00 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + decoder: refine semantics of gst_vaapi_decoder_put_buffer(). + Improve the semantics for gst_vaapi_decoder_put_buffer() when an empty + buffer is passed on. An empty buffer is a buffer with a NULL data pointer + or with a size equals to zero. In this case, that buffer is simply + skipped and the function returns TRUE. A NULL buffer argument still + marks the end-of-stream. + +2012-10-09 14:40:00 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + decoder: drop unused functions. + +2012-08-26 22:29:04 -0400 Wind Yuan + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: flush buffers when receiving EOS. + Signed-off-by: Gwenole Beauchesne + +2012-10-05 13:36:27 +0200 Gwenole Beauchesne + + * debian.upstream/Makefile.am: + debian: fix make dist for packaging. + +2012-10-05 12:06:27 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay_wayland_priv.h: + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: cosmetics (remove tabs). + +2012-10-04 17:39:52 +0100 Rob Bradford + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: add support for windowed mode. + Rather than always making the surface fullscreen instead implement the + set_fullscreen vfunc on GstVaapiWindow and then set the shell surface + fullscreen on not depending on that. + Reviewed-by: Joe Konno + Signed-off-by: Gwenole Beauchesne + +2012-10-01 09:21:03 +0200 Gwenole Beauchesne + + * configure.ac: + Bump version for development. + +2012-09-28 17:54:03 +0200 Gwenole Beauchesne + + * README: + * configure.ac: + Fix and document build dependencies better. + +2012-09-28 17:41:42 +0200 Gwenole Beauchesne + + * debian.upstream/control.in: + debian: fix GStreamer build dependencies. + +2012-09-28 17:39:43 +0200 Gwenole Beauchesne + + * configure.ac: + * debian.upstream/control.in: + debian: fix Wayland build dependencies. + +2012-09-28 17:38:17 +0200 Gwenole Beauchesne + + * debian.upstream/control.in: + debian: fix conditional build of packages. + Make it still possible to build package even if one of the build dependencies + for a specific video backend is not available. + +2012-09-27 11:08:58 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + utils: drop unused GLX helpers. + Remove helpers for GL_ARB_fragment_program and GL_ARB_multitexture + extensions since they are not used throughout gstreamer-vaapi. + +2012-09-27 11:04:24 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + utils: fix build with version >= 85. + Mesa recently updated the header version to Khronos version 85. + This caused the PFNGLMULTITEXCOORD2FPROC definition to be moved out of the + GL_VERSION_1_3_DEPRECATED block. However, since also defines + GL_VERSION_1_3 to 1, the definitions in are then not enabled, + thus leaving PFNGLMULTITEXCOORD2FPROC undefined as well. + Provide a PFNGLMULTITEXCOORD2FPROC replacement as an interim solution for + newer versions of the header. + +2012-09-26 16:33:16 +0200 Gwenole Beauchesne + + * configure.ac: + configure: update VA-API version requirements. + VA/DRM and VA/Wayland API are now promoted to VA-API 0.33.0 (libva 1.1.0). + +2012-09-21 16:43:38 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: review and report errors accordingly. + Use GST_ERROR() to report real errors instead of hiding them into + GST_DEBUG(). + +2012-09-20 17:58:21 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: exclusively use GstAdapter, drop sub-buffer hack. + Maintaining the sub-buffer is rather suboptimal especially since we + were also maintaining a GstAdapter. Now, we only use the GstAdapter + thus requiring minor extra parsing when receiving avcC buffers. + +2012-09-20 16:18:27 +0200 Gwenole Beauchesne + + * README: + README: updates. + +2012-09-20 16:02:39 +0200 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2012-09-20 14:38:15 +0200 Gwenole Beauchesne + + * debian.upstream/gstreamer-vaapi.install.in: + debian: fix packaging on recent Ubuntu platforms. + Use explicit GStreamer plugins path. + +2012-09-17 17:55:43 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/libs/libs.core.types: + docs: fix build for make dist. + +2012-09-14 10:30:35 -0400 Kristian Høgsberg + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: set opaque region for YUV surface. + This allows the compositor to optimize redraws and cull away changes + obscured by the video surface. + Signed-off-by: Gwenole Beauchesne + +2012-09-14 17:30:19 +0200 Gwenole Beauchesne + + * configure.ac: + configure: fix check for libva-glx and libva-drm. + +2012-09-12 13:42:49 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/glibcompat.h: + glibcompat: add replacement for g_cond_wait_until(). + +2012-09-12 13:41:47 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + plugins: include "sysdeps.h" instead of "config.h". + +2012-09-12 10:40:06 +0200 Gwenole Beauchesne + + * gst-libs/gst/codecparsers/gstjpegparser.c: + codecparsers: jpeg: add missing includes. + +2012-09-11 17:03:33 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst/vaapi/gstvaapidecode.c: + vaapidecode: don't reset decoder if codec type is the same. + Reset, i.e. destroy then create, the decoder in _setcaps() handler only + if the underlying codec type actually changed. This makes it possible + to be more tolerant with certain MPEG-2 streams that get parsed to + form caps that are compatible with the previous state but minor changes + to "codec-data". + +2012-09-11 16:41:32 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: simplify codec lookup from caps. + Add new gst_vaapi_codec_from_caps() helper to determine codec type from + the specified caps. Don't globally expose this function since this is + really trivial and only used in the vaapidecode element. + +2012-09-11 15:54:20 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecode.h: + vaapidecode: improve "no free surface" conditions. + Previously, vaapidecode would wait up to one second until a free surface + is available, or it aborts decoding. Now, vaapidecode waits until the + last decoded surface was to be presented, plus one second. Besides, end + times are now expressed relative to the monotonic clock. + +2012-09-11 10:59:33 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst/vaapi/gstvaapidecode.c: + decoder: propagate buffer duration downstream. + +2012-09-11 10:59:10 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + surfaceproxy: add "duration" property. + +2012-09-10 18:26:51 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + decoder: cope with new GstVaapiContextInfo based API. + Update decoders to report the maximum number of reference frames to use. + +2012-09-10 18:17:10 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + context: JPEG codec does not need any reference frame. + +2012-09-10 18:15:02 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + context: allow number of reference frames to be set. + Make it possible to specify the maximum number of references to use within + a single VA context. This helps reducing GPU memory allocations to the useful + number of references to be used. + +2012-09-07 16:41:16 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: fix deinterlace-{mode,method} types definition. + +2012-09-07 16:15:40 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + mpeg4: fix debug info for unsupported profile. + +2012-09-07 16:14:11 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay_drm.c: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapivalue.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer_glx.c: + * gst-libs/gst/vaapi/gstvaapivideoconverter_glx.c: + * gst-libs/gst/vaapi/gstvaapivideopool.c: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow_drm.c: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + libs: fix build in strict ISO C mode. + +2012-09-07 16:11:12 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + plugins: fix build in strict ISO C mode. + +2012-09-07 15:31:09 +0200 Gwenole Beauchesne + + * pkgconfig/gstreamer-vaapi-glx.pc.in: + * pkgconfig/gstreamer-vaapi-x11.pc.in: + * pkgconfig/gstreamer-vaapi.pc.in: + pkgconfig: fix dependencies and slightly improve description. + Drop @LIBVA_EXTRA_{CFLAGS,LIBS}@ substitutions and slightly improve + descriptions with clearer renderer names. + +2012-09-04 13:54:19 +0200 Philip Lorenz + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: acquire lock only if the mutex exists. + When playback stops the GstVaapiDecode object is reset into a clean + state. However, surfaces may still be referenced by library users and + unreferencing them after the reset triggers an access to an unset mutex. + Signed-off-by: Gwenole Beauchesne + +2012-09-07 11:58:53 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + decoder: drop extraneous return for void function. + +2012-09-07 11:57:59 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiimage.c: + image: don't use (void *) pointer arithmetic. + +2012-09-04 13:40:04 +0200 Philip Lorenz + + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.h: + * gst-libs/gst/vaapi/gstvaapiprofile.h: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapitypes.h: + * gst/vaapi/gstvaapipostproc.h: + Do not forward declare enums. + Forward declaring enums is not allowed by the C standard and aborts + compilation if the header file is included in a C++ project. + Signed-off-by: Gwenole Beauchesne + +2012-09-07 11:44:44 +0200 Gwenole Beauchesne + + * configure.ac: + configure: fix check for VA/DRM API. + +2012-09-04 11:53:18 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: fix calculation of window size. + If either dimension is out-of-bounds, then scale window to fit the + display size, even if the output is to be rotated. Use the standard + gst_video_sink_center_rect() function to center and scale the window + wrt. the outer (display) bounds. + +2012-08-28 02:45:22 -0400 Wind Yuan + + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + vaapisink: add video rotation support. + Signed-off-by: Gwenole Beauchesne + +2012-09-06 11:47:40 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginutil.h: + pluginutils: add G_PRIMITIVE_SWAP() helper macro. + This macro helps swapping variables while maintaining the correct underlying + and primitive type. + +2012-09-06 11:51:41 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + display: fix display aspect ratio when display is rotated. + +2012-09-06 11:50:21 +0200 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11_priv.h: + display: fix physical display size when display is rotated. + +2012-08-30 16:27:56 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapivalue.c: + display: fix GstVaapiRotation enumeration of values. + +2012-08-29 13:18:05 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapivideosink.c: + * gst-libs/gst/vaapi/gstvaapivideosink.h: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + vaapisink: drop obsolete GstVaapiVideoSink interface. + This interface was deprecated since 0.3.x series when the GstVideoContext + interface was added to the main GStreamer APIs. + +2012-08-27 18:34:27 +0300 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + vaapisink: automatically detect overlay rendering mode. + Retain the VA surface until another surface is to be displayed only + if VA display rendering mode is determined to be "overlay" mode. + +2012-08-24 16:30:33 +0300 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + vaapisink: retain VA surface until another one is displayed. + Keep VA surface proxy associated with the surface that is currently + being displayed. This makes sure that surface is not released back + to the pool of surfaces free to use for decoding. This is necessary + with VA driver implementations that support rendering to an overlay + pipe. Otherwise, there could be cases where we are decoding into a + surface that is being displayed, hence some flickering. + +2012-08-24 14:54:16 +0300 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.h: + vaapisink: fix build with older toolchains. + Don't re-declare GstVaapiTexture if USE_GLX mode is set. + +2012-08-29 10:13:58 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + display: partially revert 8ebe4d6. + Don't try to fix up the initial values, this could make things worse. + Simply assume the driver does not support the capability in this case. + +2012-08-28 16:08:34 +0200 Gwenole Beauchesne + + * tests/test-display.c: + tests: dump VA display properties. + +2012-08-28 18:11:32 +0300 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + display: fix validation process of properties during discovery. + Some VA drivers (e.g. EMGD) can have completely random values for initial + display attributes. So, try to improve the discovery process to check the + initial display attribute values actually fall within valid bounds. If not, + try to reset those to some sensible values like the default value reported + through vaQueryDisplayAttributes(). + +2012-08-28 13:59:50 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + display: add color balance properties. + Add support for hue, saturation, brightness and contrast attributes. + +2012-08-28 14:05:16 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + display: initialize default attribute values. + Ensure the display attribute is actually supported by trying to retrieve + its current value during GstVaapiDisplay creation. + +2012-08-28 11:09:56 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + display: raise "notify" for property changes. + +2012-08-28 10:55:59 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + display: expose display attributes as GObject properties. + Expose VA display "render-mode" and "rotation" attributes as standard + GObject properties. + +2012-08-28 16:24:15 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + display: install properties in batch. + Use g_object_class_install_properties() to install GstVaapiDisplay properties. + It is useful to maintain properties as GParamSpec so that to be able to raise + "notify" signals by id instead of by name in the future. + +2012-08-27 19:00:37 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + display: fix gst_vaapi_display_has_property(). + Append the "render-mode" and "rotation" properties, should they be supported + by the underlying VA driver. + +2012-08-22 02:18:11 -0400 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapitypes.h: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + * gst-libs/gst/vaapi/gstvaapivalue.c: + * gst-libs/gst/vaapi/gstvaapivalue.h: + display: add support for rotation modes. + Signed-off-by: Gwenole Beauchesne + +2012-08-27 18:11:37 +0300 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapitypes.h: + * gst-libs/gst/vaapi/gstvaapivalue.c: + * gst-libs/gst/vaapi/gstvaapivalue.h: + display: add support for rendering modes. + A rendering mode can be "overlay" or "texture"'ed blit. + The former mode implies that a VA surface used for rendering can't be + re-used right away for decoding, so the sink shall make provisions to + retain the associated surface proxy until the next surface is to be + displayed. + The latter mode implies that the VA surface is implicitly copied to an + intermediate backing store, or back buffer of a frame buffer, so the + associated surface proxy can be disposed right away. + +2012-08-27 17:02:49 +0300 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + display: add initial support for display attributes. + The VA display attributes are mapped to properties so that to maintain the + GStreamer terminology. Properties are to be identified by name, but internal + functions are available to lookup the property by the actual VA display + attribute type. + +2012-08-24 11:36:16 +0300 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + jpeg: fix end-of-image (EOI) handler. + decode_current_picture() was converted to return a gboolean instead + of a GstVaapiDecoderStatus, so we were not getting out of the decode + loop as expected, or could cause an error instead. + Signed-off-by: Gwenole Beauchesne + +2012-08-24 18:41:47 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: include start code into VA slice data buffer. + Integrate the start code prefix in the slice data buffer that is submitted + to the hardware. VA-API specifies that slice_data_offset is the offset to + the first byte of slice data. And, for MPEG-2, slice() data begins with + the slice_start_code. Some VA driver implementations (EMGD) expect this. + +2012-06-28 01:08:03 +0900 Javier Jardón + + * autogen.sh: + autogen: fix configure script generation when srcdir != builddir. + This patch allows for regenerating the configure script from a build + directory that is not the actual source directory. + Signed-off-by: Gwenole Beauchesne + +2012-06-28 00:22:03 +0900 Javier Jardón + + * configure.ac: + configure: use new libtool syntax. + This now requires libtool >= 2.2 to regenerate the configure script. + Signed-off-by: Gwenole Beauchesne + +2012-08-08 12:50:41 +0900 Javier Jardón + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + decoder: use g_object_notify_by_pspec(). + Use g_object_notify_by_pspec() instead of g_object_notify() so that to + avoid a property name lookup. i.e. this makes notifications faster to + the `vaapidecode' element. + Signed-off-by: Gwenole Beauchesne + +2012-08-06 19:21:03 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: handle de-interlacing flags. + VA/Wayland API was updated to allow flags for bob deinterlacing. + More elaborated filters will require a complete VA/VPP pipeline. + +2012-08-02 18:27:48 +0200 Gwenole Beauchesne + + * gst-libs/gst/codecparsers/gstjpegparser.c: + jpeg: fix default quantization tables. + Two elements in the luminance quantization table were wrong. So, + gst_jpeg_get_default_quantization_tables() now reconstructs tables + in zig-zag order from the standard ones (Tables K.1 and K.2). + +2012-08-02 15:17:57 +0200 Gwenole Beauchesne + + * gst-libs/gst/codecparsers/gstjpegparser.c: + jpeg: compute default Huffman tables. + ... instead of having them pre-calculated. This saves around 1.5 KB + of data in the DSO but requires gst_jpeg_get_default_huffman_tables() + to do more work. Though, the client application may have to call that + function at most once, only. + +2012-08-01 18:30:27 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + display: drop VAProfileNone entries from debug messages. + +2012-07-31 18:24:14 +0800 Yan Yin + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + display: query for supported display attributes. + Signed-off-by: Gwenole Beauchesne + +2012-07-31 18:22:48 +0800 Yan Yin + + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + utils: add string_of_VADisplayAttributeType() helper. + Signed-off-by: Gwenole Beauchesne + +2012-08-01 15:46:35 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: handle VA/DRM API. + This is not useful in practice but for raw performance evaluation when + the sink is invoked with display=drm sync=false. fakesink could also be + used though. + +2012-08-01 15:46:19 +0200 Gwenole Beauchesne + + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapipluginutil.c: + plugins: add support for headless pipelines. + +2012-08-01 15:44:49 +0200 Gwenole Beauchesne + + * tests/Makefile.am: + * tests/output.c: + * tests/test-display.c: + * tests/test-windows.c: + tests: add support for headless decoding. + +2012-08-01 15:44:02 +0200 Gwenole Beauchesne + + * NEWS: + * configure.ac: + * debian.upstream/Makefile.am: + * debian.upstream/control.in: + * debian.upstream/libgstvaapi-drm.install.in: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_drm.c: + * gst-libs/gst/vaapi/gstvaapidisplay_drm.h: + * gst-libs/gst/vaapi/gstvaapidisplay_drm_priv.h: + * gst-libs/gst/vaapi/gstvaapiwindow_drm.c: + * gst-libs/gst/vaapi/gstvaapiwindow_drm.h: + * pkgconfig/Makefile.am: + * pkgconfig/gstreamer-vaapi-drm.pc.in: + Add initial support for VA/DRM. + +2012-07-31 17:58:43 +0200 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + Fix build without X11 (again). + Don't try to build libgstvaapi-x11.so.* if X11 was disabled. Also shuffle + files list wrt. x11, glx and wayland backends. + +2012-07-31 11:51:57 +0200 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/vaapi/gstvaapicodec_objects.h: + * gst-libs/gst/vaapi/gstvaapicompat.h: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + jpeg: update to the latest VA-API changes (0.32.1+). + +2012-07-27 14:27:05 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland_priv.h: + * gst/vaapi/gstvaapisink.c: + wayland: implement display ::get_size*() hooks. + +2012-07-27 10:45:41 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginutil.c: + plugins: prefer X11 rendering over GLX. + Prefer X11 display over GLX so that "vaapisink" uses X11, i.e. vaPutSurface(), + for rendering instead of texturing. + +2012-07-26 09:28:51 -0400 Kristian Høgsberg + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: use scale fullscreen method. + This makes the compositor scale the surface to fit and preserves aspect + ratio. + Signed-off-by: Gwenole Beauchesne + +2012-07-26 09:27:47 -0400 Kristian Høgsberg + + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + wayland: respond to ping/pong protocol so we're not deemed unresponsive. + Signed-off-by: Gwenole Beauchesne + +2012-07-25 10:39:04 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + wayland: fix double disconnect of display. + +2012-07-24 19:58:55 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + wayland: mangle display name for cache lookups. + +2012-07-24 15:43:44 +0200 Gwenole Beauchesne + + * configure.ac: + * debian.upstream/Makefile.am: + * debian.upstream/control.in: + * debian.upstream/libgstvaapi-wayland.install.in: + * pkgconfig/Makefile.am: + * pkgconfig/gstreamer-vaapi-wayland.pc.in: + wayland: add packaging files. + +2012-07-24 15:07:48 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapisink.c: + * pkgconfig/Makefile.am: + Fix build without X11. + +2012-07-24 09:45:25 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapisink.c: + plugins: add support for Wayland. + +2012-07-23 12:56:33 +0200 Gwenole Beauchesne + + * tests/Makefile.am: + * tests/output.c: + * tests/test-display.c: + * tests/test-windows.c: + tests: add support for Wayland. + +2012-07-19 10:27:23 +0200 Sreerenj Balachandran + + * NEWS: + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.c: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland.h: + * gst-libs/gst/vaapi/gstvaapidisplay_wayland_priv.h: + * gst-libs/gst/vaapi/gstvaapiobject_priv.h: + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.c: + * gst-libs/gst/vaapi/gstvaapiwindow_wayland.h: + Add initial support for VA/Wayland. + Signed-off-by: Gwenole Beauchesne + +2012-07-25 15:11:51 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginbuffer.c: + plugins: fix creation of video buffer from surface proxy. + Fix a regression introduced with commit 8ef490a. + +2012-07-25 14:51:28 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginbuffer.c: + * gst/vaapi/gstvaapipluginutil.c: + plugins: use new display types more. + In particular, simplify gst_vaapi_reply_to_query() with display types. + Likewise for creating new video buffers. + +2012-07-25 10:02:29 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + plugins: fix display type selection and propagation. + If vaapisink is in the GStreamer pipeline, then we shall allocate a + unique GstVaapiDisplay and propagate it upstream. i.e. subsequent + queries from vaapidecode shall get a valid answer from vaapisink. + +2012-07-25 11:37:26 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + display: fix destruction of mutex. + +2012-07-25 09:16:02 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplaycache.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapisink.c: + display: add display types. + Move display types from gstvaapipluginutil.* to gstvaapidisplay.* so that + we could simplify characterization of a GstVaapiDisplay. Also rename "auto" + type to "any", and add a "display-type" attribute. + +2012-07-24 19:43:40 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + display: use prefixed display names for cache lookups. + This improves display name comparisons by always allocating a valid display + name. This also helps to disambiguate lookups by name in the global display + cache, should a new backend be implemented. + +2012-07-24 16:14:51 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginutil.h: + plugins: declare helper functions as internal. + +2012-07-24 14:31:25 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.h: + * gst-libs/gst/vaapi/gstvaapivideobuffer_glx.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer_glx.h: + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapipluginbuffer.c: + * gst/vaapi/gstvaapipluginbuffer.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapiupload.c: + videobuffer: drop deprecated functions. + Move video buffer creation routines to plugin elements. That exclusively + uses *_typed_new*() variants. + +2012-07-24 14:09:09 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapivideobuffer.h: + * gst-libs/gst/vaapi/gstvaapivideobuffer_glx.h: + videobuffer: mark video buffer creation routines as deprecated. + The vdeo buffer creation routines shall actually be internal to gstreamer-vaapi + plugin elements. So deprecate any explicit creation routines that are not the + new *_typed_new*() variants. + +2012-07-24 13:52:06 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer_glx.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer_priv.h: + videobuffer: factor out base and GLX implementations. + Introduce new typed constructors internal to gstreamer-vaapi plugin elements. + This avoids duplication of code, and makes it possible to further implement + generic video buffer creation routines that automatically map to base or GLX + variants. + +2012-07-24 10:58:32 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + utils: fix gl_create_context() with parent context set. + If GLX window was created from a foreign Display, then that same Display shall + be used for subsequent glXMakeCurrent(). This means that gl_create_context() + will now use the same Display that the parent, if available. + This fixes cluttersink with the Intel GenX VA driver. + +2012-07-23 18:37:38 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + pluginutils: improve automatic display type selection. + +2012-07-23 18:01:26 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + pluginutils: cosmetics (indentation fixes). + +2012-07-23 17:54:58 +0200 Gwenole Beauchesne + + * configure.ac: + configure: simplify video outputs summary. + +2012-07-23 17:49:08 +0200 Gwenole Beauchesne + + * configure.ac: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + configure: drop check for --enable-vaapisink-glx. + vaapisink is now built with support for multiple display types, whenever + they are enabled. The new "display" attribute is used to select a particular + renderer. + +2012-07-23 16:15:38 +0200 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/vaapi/gstvaapicompat.h: + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapiupload.c: + * tests/test-display.c: + configure: drop check for --enable-vaapi-glx. + This flag is obsolete. It was meant to explicitly enable/disable VA/GLX API + support, or fallback to TFP+FBO if this API is not found. Now, we check for + the VA/GLX API by default if --enable-glx is set. If this API is not found, + we now default to use TFP+FBO. + Note: TFP+FBO, i.e. using vaPutSurface() is now also a deprecated usage and + will be removed in the future. If GLX rendering is requested, then the VA/GLX + API shall be used as it covers most usages. e.g. AMD driver can't render to + an X pixmap yet. + +2012-07-23 15:20:23 +0200 Gwenole Beauchesne + + * tests/output.c: + tests: allow GLX output, if available and selected. + +2012-07-23 15:17:03 +0200 Gwenole Beauchesne + + * tests/Makefile.am: + * tests/output.c: + * tests/output.h: + * tests/test-decode.c: + * tests/test-subpicture.c: + * tests/test-surfaces.c: + tests: use common display and window creation routines. + Add new --output option to select the renderer. Use --list-outputs to + print a list of supported renderers. + +2012-07-23 14:15:42 +0200 Gwenole Beauchesne + + * tests/Makefile.am: + tests: move encoded bitstreams to libutils.la. + +2012-07-23 14:11:16 +0200 Gwenole Beauchesne + + * tests/Makefile.am: + tests: build convenience library for common utilities. + +2012-07-20 16:37:01 +0200 Gwenole Beauchesne + + * tests/Makefile.am: + * tests/test-display.c: + tests: simplify build with various display options. + +2012-07-23 13:28:42 +0200 Gwenole Beauchesne + + * configure.ac: + configure: improve checks for X11. + +2012-07-20 15:57:26 +0200 Gwenole Beauchesne + + * tests/Makefile.am: + configure: fix previous commit for GLX deps. + +2012-07-20 14:44:27 +0200 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + configure: improve checks for GLX. + +2012-07-20 11:45:15 +0200 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/vaapi/gstvaapicompat.h: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.h: + * gst-libs/gst/vaapi/gstvaapiutils.h: + Drop support for obsolete VA-API versions < 0.30.4. + +2012-07-20 11:16:27 +0200 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/Makefile.am: + * gst-libs/gst/gstutils_version.h.in: + * gst/vaapi/gstvaapisink.c: + vaapisink: drop checks for new APIs used by default. + GStreamer -base plugins >= 0.10.31 are now required, so the checks for + new APIs like GstXOverlay::set_window_handle() and ::set_render_rectangle() + are no longer necessary. + +2012-07-20 14:05:23 +0200 Gwenole Beauchesne + + * configure.ac: + configure: cosmetics and some minor changes. + - Better grouping of feature checks + - Sort list of config files to generate + +2012-07-19 17:55:00 +0200 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/vaapi/gstvaapicodec_objects.h: + * gst-libs/gst/vaapi/gstvaapidecoder_dpb.h: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst-libs/gst/vaapi/gstvaapisurface_priv.h: + * gst-libs/gst/vaapi/gstvaapiutils.h: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + * gst-libs/gst/vaapi/gstvaapiutils_x11.h: + Use standard G_GNUC_INTERNAL keyword instead of attribute_hidden. + +2012-07-19 17:41:25 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiutils_tsb.c: + * gst-libs/gst/vaapi/gstvaapiutils_tsb.h: + Drop obsolete GstVaapiTSB. + It has been replaced with a GstAdapter and gst_adapter_prev_pts(). + +2012-07-19 17:27:06 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + docs: add missing entries for the JPEG decoder. + +2012-07-19 17:16:28 +0200 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapidecode.c: + * tests/test-decode.c: + * tests/test-subpicture.c: + Drop all references to USE_CODEC_PARSERS. + +2012-07-19 17:00:36 +0200 Gwenole Beauchesne + + * NEWS: + * configure.ac: + * docs/reference/libs/libs-sections.txt: + * docs/reference/libs/libs.core.types: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.h: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecode.h: + * tests/test-decode.c: + * tests/test-subpicture.c: + Drop FFmpeg-based decoders. + GStreamer codecparsers-based decoders are the only supported decoders now. + Though, FFmpeg decoders are still available in gstreamer-vaapi 0.3.x series. + +2012-07-01 05:55:05 +0900 Javier Jardón + + * configure.ac: + * debian.upstream/control.in: + configure: bump glib required version to 2.28. + Signed-off-by: Gwenole Beauchesne + +2012-06-29 08:45:47 +0900 Javier Jardón + + * gst/vaapi/gstvaapidecode.h: + * gst/vaapi/gstvaapidownload.h: + * gst/vaapi/gstvaapipostproc.h: + * gst/vaapi/gstvaapisink.h: + * gst/vaapi/gstvaapiupload.h: + plugins: declare _get_type() functions as const. + Declaring a function as const enables better optimization of calls to + the function. + Signed-off-by: Gwenole Beauchesne + +2012-07-01 05:50:17 +0900 Javier Jardón + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + plugins: use g_clear_object() wherever applicable. + Signed-off-by: Gwenole Beauchesne + +2012-06-29 15:19:51 +0900 Javier Jardón + + * gst-libs/gst/vaapi/gstvaapicodec_objects.h: + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_dpb.h: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.h: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.h: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.h: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.h: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.h: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.h: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.h: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapiimagepool.h: + * gst-libs/gst/vaapi/gstvaapiobject.h: + * gst-libs/gst/vaapi/gstvaapiparamspecs.h: + * gst-libs/gst/vaapi/gstvaapisubpicture.h: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapisurfacepool.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + * gst-libs/gst/vaapi/gstvaapitexture.h: + * gst-libs/gst/vaapi/gstvaapivalue.h: + * gst-libs/gst/vaapi/gstvaapivideobuffer.h: + * gst-libs/gst/vaapi/gstvaapivideobuffer_glx.h: + * gst-libs/gst/vaapi/gstvaapivideoconverter_glx.h: + * gst-libs/gst/vaapi/gstvaapivideopool.h: + * gst-libs/gst/vaapi/gstvaapivideosink.h: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.h: + libs: declare _get_type() functions as const. + Declaring a function as const enables better optimization of calls + to the function. + Signed-off-by: Gwenole Beauchesne + +2012-07-01 05:34:15 +0900 Javier Jardón + + * gst-libs/gst/vaapi/glibcompat.h: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideoconverter_glx.c: + * gst-libs/gst/vaapi/gstvaapivideopool.c: + libs: use g_clear_object() wherever applicable. + This is a preferred thread-safe version. Also add an inline version of + g_clear_object() if compiling with glib < 2.28. + Signed-off-by: Gwenole Beauchesne + +2012-07-01 06:02:22 +0900 Javier Jardón + + * .gitignore: + * configure.ac: + * docs/reference/libs/Makefile.am: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapimarshal.list: + * gst-libs/gst/vaapi/gstvaapiobject.c: + libs: use generic g_cclosure_marshal_VOID__VOID(). + Signed-off-by: Gwenole Beauchesne + +2012-07-19 14:29:33 +0200 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/vaapi/glibcompat.h: + glibcompat: drop explicit check for g_list_free_full(). + +2012-07-19 13:58:31 +0200 Gwenole Beauchesne + + * configure.ac: + Bump version for development. + +2012-07-19 13:57:05 +0200 Gwenole Beauchesne + + * gst-libs/gst/codecparsers/Makefile.am: + jpeg: fix make dist. + +2012-06-28 00:39:10 +0900 Javier Jardón + + * autogen.sh: + * configure.ac: + * docs/Makefile.am: + configure: fix build without gtk-doc support. + Also do not generate tamplate files as all the documentation is inline. + Drop un-needed code in autogen.sh as well. + Signed-off-by: Gwenole Beauchesne + +2012-06-28 00:27:31 +0900 Javier Jardón + + * Makefile.am: + * autogen.sh: + * configure.ac: + configure: put m4 macros and autogenerated files into m4/ directory. + Signed-off-by: Gwenole Beauchesne + +2012-06-28 00:20:12 +0900 Javier Jardón + + * configure.ac: + configure: drop deprecated autoconf macros. + Bump autoconf required version to 2.58, needed for AS_HELP_STRING macro. + Signed-off-by: Gwenole Beauchesne + +2012-06-28 00:04:19 +0900 Javier Jardón + + * configure.ac: + configure: don't use AC_SUBST for some variables. + PKG_CHECK_MODULES already does this for us. + Signed-off-by: Gwenole Beauchesne + +2012-07-19 11:43:03 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapiupload.c: + plugins: add support for GstImplementsInterface. + +2012-07-01 02:58:36 +0900 Javier Jardón + + * configure.ac: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + plugins: use G_DEFINE_TYPE_* instead of deprecated GST_BOILERPLATE_*. + Signed-off-by: Gwenole Beauchesne + +2012-07-01 03:57:13 +0900 Javier Jardón + + * configure.ac: + * gst/vaapi/gstvaapisink.c: + plugins: do not use deprecated GStreamer -base symbols. + Bump GStreamer plugins -base required version to 0.10.31, needed for + gst_x_overlay_got_window_handle(). + Signed-off-by: Gwenole Beauchesne + +2012-07-01 03:57:13 +0900 Javier Jardón + + * configure.ac: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + plugins: do not use deprecated core GStreamer symbols. + Bump GStreamer required version to 0.10.14, needed for + gst_element_class_set_details_simple(). + Signed-off-by: Gwenole Beauchesne + +2012-07-19 10:54:33 +0200 Gwenole Beauchesne + + * tests/test-decode.c: + tests: fix build without JPEG decoder support. + +2012-07-17 13:44:45 +0200 Gwenole Beauchesne + + * tests/Makefile.am: + * tests/test-decode.c: + * tests/test-jpeg.c: + * tests/test-jpeg.h: + tests: add test for JPEG decoding. + +2012-07-17 13:43:32 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + jpeg: update to match latest parser API. + +2012-07-16 17:35:19 +0200 Gwenole Beauchesne + + * gst-libs/gst/codecparsers/gstjpegparser.c: + * gst-libs/gst/codecparsers/gstjpegparser.h: + codecparsers: jpeg: tweak parser API. + ... to allow for more consistent parsing API among various codec parsers. + In particular, drop use of GList. + +2012-07-16 16:24:04 +0200 Gwenole Beauchesne + + * configure.ac: + jpeg: fix configure check for VA/JPEG decoding API. + +2012-06-26 15:18:53 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + jpeg: fix build with VA-API < 0.32.0. + +2012-06-26 15:04:58 +0200 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2012-06-26 15:02:44 +0200 Gwenole Beauchesne + + * configure.ac: + Bump version for development. + +2012-06-26 14:46:40 +0200 Gwenole Beauchesne + + * NEWS: + * configure.ac: + 0.3.7. + +2012-06-26 13:34:39 +0200 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2012-06-25 16:07:55 +0800 Yan Yin + + * gst/vaapi/gstvaapipluginutil.c: + vaapiplugin: fix build when compiling without GLX. + Signed-off-by: Gwenole Beauchesne + +2012-06-26 11:03:25 +0200 Gwenole Beauchesne + + * configure.ac: + configure: disable FFmpeg-based decoders. + FFmpeg decoders are still available through the --enable-ffmpeg option + but are no longer maintained. + +2012-06-25 17:25:44 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + Fix build with recent GStreamer stack. + +2012-06-25 17:10:49 +0200 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/vaapi/gstvaapicompat.h: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + jpeg: update to current VA/JPEG decoding API. + +2012-06-21 16:06:47 +0200 Gwenole Beauchesne + + * gst-libs/gst/codecparsers/gstjpegparser.c: + * gst-libs/gst/codecparsers/gstjpegparser.h: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + codecparsers: jpeg: track valid quantization and Huffman tables. + Add valid flag to GstJpegQuantTable and GstJpegHuffmanTable so that + to determine whether a table actually changed since the last user + synchronization point. That way, this makes it possible for some + hardware accelerated decoding solution to upload only those tables + that changed. + +2012-06-05 10:10:22 +0800 Wind Yuan + + * gst-libs/gst/codecparsers/gstjpegparser.c: + codecparsers: jpeg: use U_READ_UINT*() wherever possible. + Use GstByteReader *_unchecked() variants as much as possible. + Signed-off-by: Gwenole Beauchesne + +2012-06-04 16:20:13 +0800 Wind Yuan + + * gst-libs/gst/codecparsers/gstjpegparser.c: + * gst-libs/gst/codecparsers/gstjpegparser.h: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + jpeg: add new GstJpegHuffmanTables structure. + Add new GstJpegHuffmanTables helper structure to hold all possible + AC/DC Huffman tables available to all components. + Signed-off-by: Gwenole Beauchesne + +2012-06-04 15:52:19 +0800 Wind Yuan + + * gst-libs/gst/codecparsers/gstjpegparser.c: + * gst-libs/gst/codecparsers/gstjpegparser.h: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + jpeg: make gst_jpeg_parse() support multiple scans. + gst_jpeg_parse() now gathers all scans available in the supplied + buffer. A scan comprises of the scan header and any entropy-coded + segments or restart marker following it. The size and offset to + the associated data (ECS + RST segments) are append to a new + GstJpegScanOffsetSize structure. + Signed-off-by: Gwenole Beauchesne + +2012-04-19 23:50:14 +0800 Wind Yuan + + * gst-libs/gst/codecparsers/gstjpegparser.c: + * gst-libs/gst/codecparsers/gstjpegparser.h: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + jpeg: update to match latest parser API. + Signed-off-by: Gwenole Beauchesne + +2012-04-13 01:58:39 -0400 Gwenole Beauchesne + + * gst-libs/gst/codecparsers/gstjpegparser.h: + jpeg: simplify and optimize parser API. + +2012-04-18 22:30:45 -0400 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + mpeg: fix picture used to determine backward_reference_vop_coding_type. + Complete fix brought by bf9f77b1afb0829b97e2d502057aec973c5fd7f5 + but Gwenole did not apply all the bits. + Signed-off-by: Gwenole Beauchesne + +2012-04-27 04:13:00 -0400 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + mpeg4: map Simple_Scalable profile to Advanced_Simple profile. + Signed-off-by: Gwenole Beauchesne + +2012-04-27 04:10:17 -0400 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + mpeg4: handle skipped frames (vop_hdr->coded = 0). + Gracefully skip non VOP coded frames. + Signed-off-by: Gwenole Beauchesne + +2012-04-26 04:00:41 -0400 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + mpeg4: fix timestamp issues on too fast playback. + Improve generation of presentation timestamps to be less sensitive + to input stream errors. In practise, GOP is also a synchronization + point for PTS calculation. + Signed-off-by: Gwenole Beauchesne + +2012-04-16 10:02:29 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicodec_objects.c: + Fix build without JPEG decoder. + +2012-04-12 11:48:24 +0200 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + mpeg4: fix VOP coding type of backward reference pictures. + Signed-off-by: Gwenole Beauchesne + +2012-04-11 23:02:45 -0400 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + mpeg4: fix handling of temporal reference distances. + TRD and TRB fields are not large enough to hold the difference of PTS + expressed with nanosecond resolution. So, compute them from the original + VOP info. + Signed-off-by: Gwenole Beauchesne + +2012-04-12 11:00:22 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_dpb.c: + dpb: mpeg2: cosmetics. + Define MAX_MPEG2_REFERENCES to 2 and avoid magic numbers all around. + +2012-02-10 00:21:04 +0800 Wind Yuan + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapicodec_objects.c: + * gst-libs/gst/vaapi/gstvaapicodec_objects.h: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_jpeg.h: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapiprofile.h: + * gst/vaapi/gstvaapidecode.c: + Add initial JPEG decoder. + Signed-off-by: Gwenole Beauchesne + +2012-02-10 00:21:04 +0800 Wind Yuan + + * configure.ac: + * gst-libs/gst/Makefile.am: + * gst-libs/gst/codecparsers/Makefile.am: + * gst-libs/gst/codecparsers/gstjpegparser.c: + * gst-libs/gst/codecparsers/gstjpegparser.h: + * gst-libs/gst/vaapi/Makefile.am: + codecparsers: add JPEG parser. + Signed-off-by: Gwenole Beauchesne + +2012-04-10 13:29:10 +0200 Wind Yuan + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: fix VA display type. + Fix typo whereby plain VADisplay type was used instead of the GstVaapiDisplay + wrapper. + Signed-off-by: Gwenole Beauchesne + +2012-04-10 14:28:31 +0200 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: fix includes when compiling for a single API. + +2012-04-02 18:42:12 +0200 Gwenole Beauchesne + + * NEWS: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix calculation of macroblock_offset. + Fix decoding of streams with extra slice() information before the first + macroblock(). e.g. this fixes sony-ct3.bs from conformance test. + +2012-04-02 18:09:21 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix interpolation of GOP TSN from new PTS. + New GOP TSN base could be mis-calculated. In particular, this fixes + decoding of uruseiyatsura.vob from . + +2012-04-02 16:07:58 +0200 Gwenole Beauchesne + + * NEWS: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapiprofile.h: + mpeg2: fix decoding of high profile streams. + Allow MPEG-2 High profile streams only if the HW supports that profile + or no High profile specific bits are used, and thus Main profile could + be used instead. i.e. chroma_format is 4:2:0, intra_dc_precision is not + set to 11 and no sequence_scalable_extension() was parsed. + +2012-04-02 14:51:06 +0200 Gwenole Beauchesne + + * NEWS: + * gst/vaapi/gstvaapidecode.c: + vaapidecode: report unsupported codec profiles. + Try to gracefully abort when the HW does not support the requested + profile. There is no fallback unless profiles are correctly parsed + and matched through caps beforehand. + +2012-02-07 15:23:22 +0100 Holger Kaelberer + + * NEWS: + * gst/vaapi/gstvaapisink.c: + vaapisink: don't resize a 'foreign' X-window. + Don't forcibly resize foreign X windows. The user is responsible for + their size and vaapisink shall not change this. + Signed-off-by: Gwenole Beauchesne + +2012-02-07 15:21:05 +0100 Holger Kaelberer + + * NEWS: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + vaapisink: recalculate render rect only if caps are negotiated. + Fix gst_vaapisink_xoverlay_set_window_handle() when it is called before + caps got negotiated. Besides, when a foreign window is provided by the + user, so should the render rect. + Signed-off-by: Gwenole Beauchesne + +2012-04-02 13:07:34 +0200 Gwenole Beauchesne + + * configure.ac: + Bump version for development. + +2012-04-02 10:07:33 +0200 Gwenole Beauchesne + + * configure.ac: + 0.3.6. + +2012-04-02 12:52:54 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/libs/libs-sections.txt: + * docs/reference/plugins/plugins-docs.xml.in: + * docs/reference/plugins/plugins-sections.txt: + * docs/reference/plugins/plugins.types: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapivideoconverter_glx.c: + * gst/vaapi/gstvaapipostproc.c: + Fix a few documentation issues. + +2012-04-02 10:05:57 +0200 Gwenole Beauchesne + + * NEWS: + * README: + Update introduction and changelog. + +2012-04-02 11:29:53 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_dpb.c: + * gst-libs/gst/vaapi/gstvaapidecoder_dpb.h: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: allocate dummy picture for first field based I-frame. + In P-pictures, prediction shall be made from the two most recently + decoded reference fields. However, when the first I-frame is a field, + the next field of the current picture could be a P-picture but only a + single field was decoded so far. In this case, create a dummy picture + with POC = -1 that will be used as reference. + Some VA drivers would error out if P-pictures don't have a forward + reference picture. This is true in general but not in this very specific + initial case. + +2012-04-02 10:43:30 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix simple to main profile fallback. + Allow fallback from simple to main profile when the HW decoder does + not support the former profile and that no sequence_header_extension() + is available to point out this. + +2012-03-30 03:04:40 -0400 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + mpeg4: improve error checking while decoding packets. + decode_picture() could return an error when an MPEG-4 profile is not + supported for example. In this case, the underlying VA context is not + allocated and no other proper action can be taken. Likewise on exit + from decode_slice(). + Signed-off-by: Gwenole Beauchesne + +2012-03-30 17:03:28 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_dpb.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + decoder: use POC to maintain the DPB. + Introduce a POC field in GstVaapiPicture so that to store simpler sequential + numbers. A signed 32-bit integer should be enough for 1 year of continuous + video streaming at 60 Hz. + Use this new POC value to maintain the DPB, instead of 64-bit timestamps. + This also aligns with H.264 that will be migrated to GstVaapiDpb infrastructure. + +2012-03-30 16:23:33 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: rework generation of presentation timestamps. + Always prefer PTS from the demuxer layer for GOP times. If this is invalid, + i.e. demuxer could not determine the PTS or the generated PTS is lower than + max PTS from past pictures, then try to fix it up based on the duration of + a frame. + For picture PTS, simply use the GOP PTS formerly computed then use TSN to + reconstruct a current time. Also now handle wrapped TSN correctly. + +2012-03-30 17:07:39 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: ignore empty user-data packets. + Fix tcela-8.bits conformance test. + +2012-03-29 11:13:20 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: review and report errors accordingly. + Use GST_ERROR() to report real errors instead of hiding them into + GST_DEBUG(). + +2012-03-28 19:15:47 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix invalid interlaced frame in progressive sequence. + Some streams, badly constructed, could have signaled an interlaced + frame while the sequence was meant to be progressive. Warn and force + frame to be progressive in this case. + +2012-03-28 16:08:29 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + mpeg2: add support for interlaced streams. + Pictures are submitted to the HW for rendering only when both fields + are decoded or current picture is a full frame. + +2012-03-28 14:36:30 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidecoder_dpb.c: + * gst-libs/gst/vaapi/gstvaapidecoder_dpb.h: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: add new decoded picture buffer infrastructure. + Decoded pictures are now maintained into DPB, similarly to H.264. + The same mechanism could be re-used for VC-1 and MPEG-4:2 codecs. + +2012-03-28 17:50:28 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + decoder: add first-field flag to picture. + Add first-field (FF) flag to GstVaapiPicture, thus not requiring is_first_field + member in each decoder. Rather, when a GstVaapiPicture is created, it is considered + as the first field. Any subsequent allocated field will become the second field. + +2012-03-28 16:05:58 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicodec_objects.c: + * gst-libs/gst/vaapi/gstvaapicodec_objects.h: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + decoder: allow pictures to be cloned for field decoding. + Add gst_vaapi_picture_new_field() function that clones a picture, while + preserving the parent picture surface. i.e. the surface proxy reference + count is increased and other fields copied as is. Besides, the picture + is reset into a "non-output" mode. + +2012-03-28 16:07:44 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + decoder: rework picture field flags. + Add top-field-first (TFF) and interlaced flags to GstVaapiPicture so they + could be propagated to the surface proxy when it is pushed for rendering. + Besides, top and bottom fields are now expressed with picture structure flags + from GstVaapiSurfaceRenderFlags. + +2012-03-28 14:28:26 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + decoder: add OUTPUT flag to pictures. + Allow pictures to be marked as output gst_vaapi_picture_output(). + +2012-03-28 14:24:40 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + decoder: fix semantics of SKIPPED pictures. + If GstVaapiPicture has flag SKIPPED set, this means gst_vaapi_picture_output() + will not push the underlying surface for rendering. Besides, VC-1 skipped P-frame + has nothing to do with rendering. This only means that the currently decoded + picture is just a copy of its reference picture. + +2012-03-28 15:16:17 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + * gst/vaapi/gstvaapipostproc.c: + vaapipostproc: get "interlaced" attribute from surface proxy. + Add new "interlaced" attribute to GstVaapiSurfaceProxy. Use this in + vaapipostproc so that to handles cases where bitstream is interlaced + but almost only frame pictures are generated. In this case, we should + not be alternating between top/bottom fields. + +2012-03-26 14:37:24 +0200 Gwenole Beauchesne + + * README: + * debian.upstream/control.in: + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapipostproc.c: + * gst/vaapi/gstvaapipostproc.h: + vaapipostproc: add new element for video postprocessing. + Add vaapipostproc element for video postprocessing. So far, only basic + bob deinterlacing is implemented. Interlaced mode is automatically + detected based on sink caps ("interlaced" field). + +2012-03-26 12:01:36 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.h: + * gst-libs/gst/vaapi/gstvaapivideoconverter_glx.c: + * gst/vaapi/gstvaapisink.c: + videobuffer: add surface render flags. + Allow rendering flags, as a combination of GstVaapiSurfaceRenderFlags, + to be set to the video buffer. In particular, this is mostly useful for + basic deinterlacing. + +2012-03-23 17:13:58 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicompat.h: + compat: add compatibility glue with VA-API 0.34+ (WIP). + +2012-03-23 17:11:18 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: skip all Filler Data NALs. + +2012-03-22 03:28:22 -0400 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + mpeg4: check for decoder status prior to decoding packet. + Make sure there is a VA surface free prior to decoding the current frame. + Signed-off-by: Gwenole Beauchesne + +2012-03-15 04:58:04 -0400 Wind Yuan + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecode.h: + decode: delay NEWSEGMENT event if vaapidecode element was not linked. + Rationale: playbin2 links all elements at run-time. Once vaapidecode + is created and a NEWSEGMENT event arrives, downstream element may not + be ready yet. So, delay this event until next element is chained in, + otherwise basesink could output "Received buffer without a new-segment. + Assuming timestamps start from 0". + Signed-off-by: Gwenole Beauchesne + +2012-03-13 20:33:41 -0400 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix GOP timestamps when incorrect data is received. + Some streams have incorrect GOP timestamps, or nothing set at all. + i.e. GOP time is 00:00:00 for all GOPs. Try to recover in this case + from demuxer timestamps, which are monotonic. + Signed-off-by: Gwenole Beauchesne + +2012-03-13 02:03:31 -0400 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: don't decode anything before the first sequence_header(). + Skip all pictures prior to the first sequence_header(). Besides, + skip all picture_data() if there was no prior picture_header(). + Signed-off-by: Gwenole Beauchesne + +2012-02-07 15:57:14 +0100 Holger Kaelberer + + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + ffmpeg: add support for interlaced streams. + Evaluate interlaced stream properties. + Signed-off-by: Gwenole Beauchesne + +2012-02-07 15:54:15 +0100 Holger Kaelberer + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: propagate interlaced and TFF properties downstream. + Propagate "interlaced" caps downstream and set "tff" buffer flag + appropriately to output buffers for interlaced pictures. + Signed-off-by: Gwenole Beauchesne + +2012-02-07 15:54:15 +0100 Holger Kaelberer + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + decoder: maintain caps for interlaced streams. + Extend GstVaapiDecoder base object to maintain caps with "interlaced" + property. + Signed-off-by: Gwenole Beauchesne + +2012-02-07 15:54:15 +0100 Holger Kaelberer + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + surfaceproxy: add TFF property. + Add TFF (top-field-first) property to GstVaapiSurfaceProxy. + Signed-off-by: Gwenole Beauchesne + +2012-03-16 14:21:36 +0100 Gwenole Beauchesne + + * AUTHORS: + AUTHORS: update to match current authors. + +2012-02-28 11:58:21 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix is_first_field calculation. + Reset is_first_field for frame pictures. Factor out locations where + the flag is updated. + +2012-02-24 12:56:48 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: catch incorrect picture_structure from bitstreams. + Assume "frame" picture structure if the syntax element was zero or if + progressive_frame is set. + +2012-02-24 12:53:30 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix slice_vertical_position calculation (again). + VA-API expects slice_vertical_position as the initial position from the + bitstream. i.e. the direct slice() information. VA drivers will be fixed + accordingly. + +2012-03-02 15:03:57 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + Revert "vaapidecode: fix another pad template ref leak" (Holger Kaelberer) + This reverts commit 2f127d6af473afd647a2c88f75faafd1cd718437. + For gst_element_class_get_pad_template(), no unreferencing is necessary + according to the GStreamer documentation. + +2012-03-02 13:41:16 +0100 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: fix slice_data_bit_offset calculation. + Unlike what VA-API documentation defines, the slice_data_bit_offset + represents the offset to the first macroblock in the slice data, minus + any emulation prevention bytes in the slice_header(). + This fix copes with binary-only VA drivers that won't be fixed any + time soon. Besides, this aligns with the current FFmpeg behaviour + that was based on those proprietary drivers implementing the API + incorrectly. + +2012-02-21 02:11:20 -0500 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: skip all Access Unit (AU) NALs. + Signed-off-by: Gwenole Beauchesne + +2012-02-29 03:08:46 -0500 Wind Yuan + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: fix modification process of reference picture lists. + Construction of RefPicList0/1 could be off by one element. + Signed-off-by: Gwenole Beauchesne + +2012-02-12 11:21:52 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix size calculation from sequence_extension(). + Original values from sequence_header() are 12-bit and the remaining + 2 most significant bits are coming from sequence_extension(). + Signed-off-by: Gwenole Beauchesne + +2012-02-23 16:39:14 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix slice_vertical_position calculation. + Make sure to adjust slice_vertical_position if picture structure + is a top or bottom field. + +2012-02-23 16:23:27 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + decoder: add picture structure flags. + +2012-02-23 14:42:38 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix decoding at end-of-sequence. + +2012-02-23 14:17:34 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix slice_horizontal_position calculation. + +2012-02-23 16:14:02 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: drop useless mb_y and mb_height members. + +2012-02-23 11:19:48 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix decoding of multiple slices with same slice_vertical_position. + 6.3.15 says that "some slices may have the same slice_vertical_position, + since slices may start and finish anywhere". So, we can't submit the current + picture to the HW right away since subsequent slices would be missing. + +2012-02-15 14:08:44 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiimage.c: + image: fix source stride in picture copy. + +2012-02-13 10:10:35 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + decoder: fix double buffer free with some VA drivers. + vaRenderPicture() implicitly disposes VA buffers. Some VA drivers would + push the VA buffer object into a list of free buffers to be re-used. However, + reference pictures (and data) that was kept would explicitly release the VA + buffer object later on, thus possibly destroying a valid (re-used) object. + Besides, some other VA drivers don't support correctly the vaRenderPicture() + semantics for VA buffers disposal and would leak memory if there is no explicit + vaDestroyBuffer(). The temporary workaround is to explcitily destroy VA buffers + right after vaRenderPicture(). All VA drivers need to be aligned. + +2012-02-08 18:08:49 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: complete any current picture decoder before SPS / PPS change. + This ensures the VA context is clear when the encoded resolution + changes. i.e. make sure older picture is decoded with the older + VA context before it changes. + +2012-02-08 18:07:14 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: create VA context earlier when SPS is parsed. + +2012-02-08 17:57:29 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: don't allocate too big data structures on stack. + +2012-02-07 11:07:15 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/glibcompat.h: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplaycache.c: + glib: map deprecated API to glib >= 2.32 equivalents. + GStaticMutex and GStaticRecMutex are now replaced with GMutex and + GRecMutex, which no longer require any prior call to g_thread_init(). + +2012-02-07 10:01:01 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiutils.h: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + * gst-libs/gst/vaapi/gstvaapiutils_x11.h: + glib: fix includes. + +2012-02-07 10:05:53 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicodec_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + cosmetics: fix warnings (drop unused variables). + +2012-02-06 16:11:38 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: fix another pad template ref leak. + +2012-02-06 15:54:09 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + mpeg2: fix crash when there is no free surface to decode into. + +2012-01-31 16:38:58 +0800 Zhao Halley + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + display: skip profiles which have no entrypoints. + Signed-off-by: Gwenole Beauchesne + +2012-02-05 18:28:51 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiupload.c: + vaapiupload: use g_object_unref() for GstVaapiImage. + +2012-02-05 18:24:08 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + plugins: fix pad template ref leaks. + +2012-02-02 09:23:15 +0100 Gwenole Beauchesne + + * configure.ac: + Bump version for development. + +2012-02-01 23:34:09 +0100 Gwenole Beauchesne + + * NEWS: + * configure.ac: + 0.3.4. + +2012-02-01 23:32:47 +0100 Gwenole Beauchesne + + * README: + README: updates. + Mention codecparsers-based decoders, FFmpeg is now optional. Update + list of support HW. + +2012-02-01 23:28:23 +0100 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2012-01-31 11:34:17 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + decoder: allocate proxy surface earlier. + This simplifies gst_vaapi_picture_output() to only update the presentation + timestamp and submit the proxy to the decoder for output. + +2012-01-31 11:26:37 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + decoder: fix memory leak of VA objects on exit. + On sequence end, if the last decoded picture is not output for rendering, + then the proxy surface is not created. In this case, the original surface + must be released explicitly to the context. + +2012-01-31 10:47:36 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: use GstAdapter to track input sequence. + This fixes possible memory leaks and improves performance by removing + some extra copies. + +2012-01-30 18:25:03 +0100 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/glibcompat.h: + * gst-libs/gst/vaapi/sysdeps.h: + Add glib compatibility glue for older versions. + +2012-01-30 18:12:59 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapicodec_objects.c: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplaycache.c: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapiparamspecs.c: + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapiutils_x11.c: + * gst-libs/gst/vaapi/gstvaapivalue.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer_glx.c: + * gst-libs/gst/vaapi/gstvaapivideoconverter_glx.c: + * gst-libs/gst/vaapi/gstvaapivideopool.c: + * gst-libs/gst/vaapi/gstvaapivideosink.c: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * gst-libs/gst/vaapi/sysdeps.h: + Add header for system-dependent definitions. + +2012-01-30 10:15:32 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicodec_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + decoder: optimize slice data buffers initialization. + VA drivers may have a faster means to transfer user buffers to GPU + buffers than using memcpy(). In particular, on Intel Gen graphics, we + can use pwrite(). This provides for faster upload of bitstream and can + help higher bitrates. + vaapi_create_buffer() helper function was also updated to allow for + un-mapped buffers and pre-initialized data for buffers. + +2012-01-27 17:28:50 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: simplify RefPicList reconstruction. + +2012-01-27 16:08:03 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: flush DPB when the end of the sequence is reached. + +2012-01-24 15:38:14 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: handle Decoded Picture Buffer (DPB). + +2012-01-24 09:20:25 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: fix pred_weight_table() reconstruction. + Only the explicit pred_weight_table(), possibly with the inferred default + values, shall be required. e.g. don't fill in the table if weighted_pred_flag + is not set for P/SP slices. + +2012-01-23 15:03:07 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: execute reference picture marking process (MMCO). + +2012-01-23 15:20:51 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: fix presentation timestamps. + +2012-01-18 13:38:34 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: execute reference picture marking process (sliding window). + +2012-01-17 10:42:49 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: handle avcC format for decoding buffers. + +2011-11-25 14:37:00 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + h264: handle codec-data. + Signed-off-by: Gwenole Beauchesne + +2011-08-12 17:43:55 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.c: + * gst-libs/gst/vaapi/gstvaapidecoder_h264.h: + * gst/vaapi/gstvaapidecode.c: + * tests/test-decode.c: + Add initial H.264 decoder. + +2012-01-26 15:28:42 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + decoder: retain proxy surface until the GstVaapiPicture is destroyed. + Keep a valid reference to the proxy in GstVaapiPicture so that frames + marked as "used for reference" could be kept during the lifetime of the + picture. i.e. don't release them too soon as they could be re-used right + away. + +2012-01-26 15:19:14 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + decoder: properly reference count pictures. + This fixes cases where a GstVaapiPicture would be destroyed whereas + there is still a valid instance of it in either prev, current or + next picture. + +2012-01-26 14:54:31 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + decoder: simplify output of decoded frames. + Drop obsolete gst_vaapi_decoder_push_surface() that was no longer used. + Change gst_vaapi_decoder_push_surface_proxy() semantics to assume PTS + is already set correctly and reference count increased, if necessary. + +2012-01-26 09:48:11 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapicodec_objects.c: + * gst-libs/gst/vaapi/gstvaapicodec_objects.h: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.c: + * gst-libs/gst/vaapi/gstvaapidecoder_objects.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + decoder: rework the internal VA objects API. + The new API simplifies a lot reference counting and makes it more + flexible for future additions/changes. The GstVaapiCodecInfo is + also gone. Rather, new helper macros are provided to allocate + picture, slice and quantization matrix parameter buffers. + +2012-01-24 10:21:45 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + decoder: allow slices to be attached to pictures later. + +2011-11-21 18:39:49 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + decoder: add ref_count to GstVaapiPicture. + +2012-01-23 11:48:42 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: cap window size to the maximum display size. + +2012-01-18 10:23:41 +0100 Zhao Halley + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapiworkarounds.h: + profile: match video/x-h263 as H.263 Baseline profile. + HACK: qtdemux does not report profiles for H.263. So, assume plain + "video/x-h263" is H.263 Baseline profile. + Signed-off-by: Gwenole Beauchesne + +2012-01-18 10:22:58 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapiworkarounds.h: + display: report H.263 Baseline profile. + HACK: expose GST_VAAPI_PROFILE_H263_BASELINE for decoding if MPEG-4:2 Simple + profile (VAProfileMPEG4Simple) is supported. + +2012-01-24 10:06:37 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiworkarounds.h: + Add template for workarounds. + +2012-01-18 10:47:56 +0100 Gwenole Beauchesne + + * tests/test-decode.c: + tests: error out if FFmpeg|codecparsers are not supported. + +2012-01-18 10:42:38 +0100 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapisurface_priv.h: + surface: don't expose gst_vaapi_surface_get_parent_context(). + gst_vaapi_surface_get_parent_context() was not meant to be exposed globally. + It's just an internal helper function. However, it's still possible to get + the parent context through the "parent-context" property. + +2012-01-16 14:19:00 +0100 Gwenole Beauchesne + + * tests/Makefile.am: + * tests/test-subpicture.c: + tests: fix build without FFmpeg. + +2012-01-16 14:09:57 +0100 Gwenole Beauchesne + + * configure.ac: + Bump version for development. + +2012-01-16 11:05:31 +0100 Gwenole Beauchesne + + * NEWS: + * configure.ac: + 0.3.3. + +2012-01-16 11:03:51 +0100 Gwenole Beauchesne + + * README: + * debian.upstream/copyright: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapidownload.h: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapiupload.c: + * gst/vaapi/gstvaapiupload.h: + * tests/test-decode.c: + legal: fix year for some copyright notices. + +2012-01-16 10:42:55 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.h: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.h: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapiutils_x11.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.h: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst/vaapi/gstvaapidownload.h: + * gst/vaapi/gstvaapisink.h: + * gst/vaapi/gstvaapiupload.h: + * tests/test-decode.c: + legal: add Intel copyright on modified files. + +2012-01-16 10:41:10 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapi_priv.h: + * gst-libs/gst/vaapi/gstvaapicompat.h: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapidebug.h: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11_priv.h: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.h: + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + * gst-libs/gst/vaapi/gstvaapiimagepool.h: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapiobject.h: + * gst-libs/gst/vaapi/gstvaapiobject_priv.h: + * gst-libs/gst/vaapi/gstvaapiparamspecs.c: + * gst-libs/gst/vaapi/gstvaapiparamspecs.h: + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapiprofile.h: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.h: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapitexture.h: + * gst-libs/gst/vaapi/gstvaapitypes.h: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + * gst-libs/gst/vaapi/gstvaapiutils_x11.c: + * gst-libs/gst/vaapi/gstvaapiutils_x11.h: + * gst-libs/gst/vaapi/gstvaapivalue.c: + * gst-libs/gst/vaapi/gstvaapivalue.h: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.h: + * gst-libs/gst/vaapi/gstvaapivideopool.c: + * gst-libs/gst/vaapi/gstvaapivideopool.h: + * gst-libs/gst/vaapi/gstvaapivideosink.c: + * gst-libs/gst/vaapi/gstvaapivideosink.h: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.h: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecode.h: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapidownload.h: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + * gst/vaapi/gstvaapiupload.c: + * gst/vaapi/gstvaapiupload.h: + * tests/image.c: + * tests/image.h: + * tests/test-decode.c: + * tests/test-decode.h: + * tests/test-display.c: + * tests/test-h264.c: + * tests/test-h264.h: + * tests/test-mpeg2.c: + * tests/test-mpeg2.h: + * tests/test-surfaces.c: + * tests/test-textures.c: + * tests/test-vc1.c: + * tests/test-vc1.h: + * tests/test-windows.c: + legal: fix copyright notices to include "Copyright" term. + +2011-12-09 16:44:03 +0800 Zhao Halley + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.h: + mpeg4: replace GstVaapiTSB with GstAdapter (gst-plugins-base >= 0.10.24). + Signed-off-by: Gwenole Beauchesne + +2011-12-09 16:28:11 +0800 Zhao Halley + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.h: + * gst/vaapi/gstvaapidecode.c: + Add initial MPEG-4 decoder. + Signed-off-by: Gwenole Beauchesne + +2011-11-18 15:41:40 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.h: + vc1: replace GstVaapiTSB with GstAdapter (gst-plugins-base >= 0.10.24). + Signed-off-by: Gwenole Beauchesne + +2011-10-07 11:50:20 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: fix codec-data decoding for WMV3 format. + +2011-10-07 11:12:33 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: fix presentation timestamps. + +2011-10-06 15:59:22 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: fix MV mode packing. + +2011-10-05 16:41:57 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: handle codec-data. + +2011-10-05 15:56:36 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: handle encapsulated bitstreams. + +2011-10-04 17:51:51 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: fix bitplanes decoding. + +2011-10-04 14:15:55 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: fix BFRACTION reconstruction. + +2011-09-30 17:16:23 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + vc1: fix framerate calculation. + +2011-09-30 13:40:11 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.c: + * gst-libs/gst/vaapi/gstvaapidecoder_vc1.h: + * gst/vaapi/gstvaapidecode.c: + * tests/test-decode.c: + Add initial VC-1 decoder. + +2012-01-09 17:37:34 +0100 Zhao Halley + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix first field detection. + Signed-off-by: Gwenole Beauchesne + +2012-01-06 16:44:09 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix quantisation matrix construction. + +2011-11-18 15:06:07 +0200 Sreerenj Balachandran + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.h: + mpeg2: replace GstVaapiTSB API with GstAdapter (gst-plugins-base >= 0.10.24). + Signed-off-by: Gwenole Beauchesne + +2011-09-14 18:11:57 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: fix packets spanning over two buffers. + +2011-09-12 18:20:00 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: ignore system start codes (PES headers). + +2011-09-12 18:02:53 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + mpeg2: handle closed_gop. + +2011-08-05 11:55:11 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c: + * gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.h: + * gst/vaapi/gstvaapidecode.c: + * tests/test-decode.c: + Add initial MPEG-2 decoder. + +2011-08-12 10:21:19 +0200 Gwenole Beauchesne + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapidecode.c: + * tests/test-decode.c: + Allow conditional build of GStreamer/FFmpeg bitstream parsers. + +2011-08-05 11:53:50 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + Add VA decoder helpers. + +2011-08-05 11:52:43 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.h: + decoder: add new error codes. + GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE: for unsupported profile + GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT: for unsupported chroma format + +2011-09-12 13:00:59 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiutils_tsb.c: + * gst-libs/gst/vaapi/gstvaapiutils_tsb.h: + Add timestamp buffer store helper utils. + +2011-08-04 17:29:41 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + Add VA buffer helpers. + +2012-01-13 15:03:38 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + utils: slight improvements to gl_bind_texture(). + +2012-01-13 14:13:55 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + utils: pretty-print output of gl_get_error_string(). + +2012-01-13 14:03:29 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + utils: rewrite gl_perspective() as per OpenGL FAQ 9.085. + +2012-01-13 12:09:07 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiutils.c: + utils: simplify string of VAProfile/VAEntrypoint. + +2012-01-13 11:46:55 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + utils: drop string_of_FOURCC() in favor of standard GST_FOURCC_* helpers. + +2012-01-12 17:18:47 +0100 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2012-01-12 15:34:59 +0100 Gwenole Beauchesne + + * tests/test-decode.c: + tests: check for shared VA displays (display cache). + +2012-01-12 15:30:04 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + display: always free VA display cache if it is empty. + +2012-01-12 15:03:04 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + display: use VA display cache for X11 and GLX winsys. + +2012-01-12 12:46:34 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplaycache.c: + * gst-libs/gst/vaapi/gstvaapidisplaycache.h: + display: implement a VA display cache. + +2012-01-11 14:13:06 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginutil.c: + vaapiplugin: fix gst_vaapi_ensure_display() to use system defaults. + This ensures the display name provided to gst_vaapi_display_*_new() + maps to the system defaults, instead of forcing "" that could be different + from the current DISPLAY name. + +2011-08-26 15:44:25 -0400 Nicolas Dufresne + + * gst/vaapi/gstvaapiupload.c: + vaapiupload: only set caps on newly created buffers. + Signed-off-by: Gwenole Beauchesne + +2012-01-11 14:11:30 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: ensure VA display in GstBaseSink::start() hook. + This ensures a VA display is ready by the time upstream elements request + for it. + +2011-08-26 15:44:46 -0400 Nicolas Dufresne + + * gst/vaapi/gstvaapisink.c: + vaapisink: don't leak GL texture. + Signed-off-by: Gwenole Beauchesne + +2012-01-09 16:51:35 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: fix calculation of render region. + +2012-01-09 11:23:39 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: automatically fit video to window. + +2012-01-09 10:37:30 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: implement GstXOverlay::set_render_rectangle(). + +2012-01-09 11:04:21 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiwindow.c: + window: always check geometry when the window is mapped. + +2012-01-06 17:51:59 +0100 Zhao Halley + + * gst-libs/gst/vaapi/gstvaapiutils.c: + Add missing profiles from VA-API 0.32.0. + Signed-off-by: Gwenole Beauchesne + +2012-01-06 16:48:15 +0100 Gwenole Beauchesne + + * .gitignore: + .gitignore: add test-subpicture. + +2012-01-06 11:23:21 +0100 Gwenole Beauchesne + + * configure.ac: + Bump version for development. + +2012-01-06 11:20:48 +0100 Gwenole Beauchesne + + * NEWS: + * configure.ac: + 0.3.2. + +2012-01-06 11:18:55 +0100 Gwenole Beauchesne + + * tests/Makefile.am: + tests: fix make dist (ship with test-subpicture-data.h). + +2012-01-05 17:35:12 +0100 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2012-01-05 17:09:35 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + decoder: fix possible leak of VA surfaces. + Under some circumstances, we could have leaked a surface, thus not + releasing it to the pool of available surfaces in the VA context. + The strategy is now to use a proxy earlier and automatically ref/unref + whenever necessary. In particular, during the lifetime needed for FFmpeg. + +2012-01-05 16:59:57 +0100 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + surfaceproxy: add helper to retrieve the VA surface ID. + +2012-01-05 16:44:44 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + surfaceproxy: simplify destruction. + Also make sure to always make sure to release the surface back to the + pool of surfaces in the associated VA context, if any. + +2012-01-05 16:26:49 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapidecode.c: + vaapidecode: fix deinitialization order. + +2012-01-05 14:50:26 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapicontext.c: + context: avoid self reference loops with surfaces. + +2012-01-05 11:23:01 +0100 Gwenole Beauchesne + + * debian.upstream/control.in: + debian: update control.in description for new plugins. + +2012-01-05 11:01:56 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiupload.c: + vaapiupload: use new gst_vaapi_append_surface_caps() helper. + This also fixes extra structures, beyond the one at index 0, to hold + the right additional values. + +2012-01-05 10:55:34 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiupload.c: + vaapiupload: fix sink (YUV) caps to not report type and opengl fields. + +2012-01-05 10:50:59 +0100 Gwenole Beauchesne + + * README: + * docs/reference/plugins/plugins-docs.xml.in: + * docs/reference/plugins/plugins-sections.txt: + * docs/reference/plugins/plugins.types: + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapidownload.c: + * gst/vaapi/gstvaapidownload.h: + vaapidownload: add new plugin to download pixels from VA surfaces. + +2012-01-05 11:00:39 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + vaapipluingutils: add helper to append surface caps to YUV caps. + +2012-01-05 10:29:48 +0100 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + image: add helpers to extract pixels to user buffers. + +2012-01-04 11:34:34 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiimage.c: + image: simplify initialization of raw images from video buffers. + +2012-01-04 11:29:11 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiimage.c: + image: fix update from NV12 buffers. + +2012-01-03 18:16:35 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiupload.c: + vaapiupload: fix memory leak in _init() function. + +2012-01-03 14:34:09 +0100 Gwenole Beauchesne + + * NEWS: + * README: + * debian.upstream/control.in: + * docs/reference/plugins/plugins-docs.xml.in: + * docs/reference/plugins/plugins-sections.txt: + * docs/reference/plugins/plugins.types: + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapiconvert.c: + * gst/vaapi/gstvaapiconvert.h: + * gst/vaapi/gstvaapiupload.c: + * gst/vaapi/gstvaapiupload.h: + Rename vaapiconvert element to vaapiupload. + +2012-01-03 13:54:03 +0100 Gwenole Beauchesne + + * configure.ac: + Bump version for development. + +2012-01-03 13:42:12 +0100 Gwenole Beauchesne + + * NEWS: + * configure.ac: + 0.3.1. + +2011-12-14 15:22:24 +0100 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2011-12-14 14:40:37 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapivideoconverter_glx.c: + * gst/vaapi/gstvaapisink.c: + surface: apply composition to the parent context, if requested. + +2011-12-14 14:35:13 +0100 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + context: make it possible to apply composition globally. + +2011-12-14 14:13:58 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurface.c: + surface: fix associate subpicture to not report deassociation errors. + +2011-12-14 13:46:26 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurface.c: + surface: fix typo in debug message. + +2011-12-14 13:16:21 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.h: + * gst-libs/gst/vaapi/gstvaapisurface.c: + subpicture: add helper to create subpicture from GstVideoOverlayRectangle. + +2011-12-13 16:53:15 +0100 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapisurface_priv.h: + surface: record parent context. + +2011-12-13 15:59:02 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiutils_x11.c: + * gst-libs/gst/vaapi/gstvaapivideoconverter_glx.c: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapisink.c: + Fix warnings. + +2011-12-13 15:51:58 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapivideoconverter_glx.c: + * gst/vaapi/gstvaapisink.c: + Rename gst_vaapi_surface_update_composition() to gst_vaapi_surface_set_subpictures_from_composition(). + +2011-12-13 13:40:55 +0100 Gwenole Beauchesne + + * configure.ac: + configure: check for GstVideoOverlayComposition. + +2011-12-12 18:42:44 +0100 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2011-11-25 15:00:25 -0500 Nicolas Dufresne + + * gst-libs/gst/vaapi/gstvaapivideoconverter_glx.c: + converter: add support for GstVideoOverlayComposition planes. + Signed-off-by: Gwenole Beauchesne + +2011-11-23 16:45:46 -0300 Thibault Saunier + + * gst/vaapi/gstvaapisink.c: + vaapisink: handle GstVideoOverlayComposition planes. + Signed-off-by: Gwenole Beauchesne + +2011-12-12 18:27:14 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurface.c: + surface: use unscaled overlay rectangle for blending. + +2011-12-12 18:37:13 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurface.c: + surface: fix VA image leak when an error occurred. + +2011-11-25 14:59:56 -0500 Nicolas Dufresne + + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + surface: add helper to handle GstVideoOverlayComposition. + This helper resets the subpictures to reflect the current composition + layers provided with the buffers. + Signed-off-by: Gwenole Beauchesne + +2011-12-12 18:13:19 +0100 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.h: + * gst/vaapi/gstvaapiconvert.c: + image: add gst_vaapi_image_format_from_video() helper. + +2011-12-12 16:34:07 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + image: allow updates from GstVaapiImageRaw. + +2011-12-12 14:34:03 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst/vaapi/gstvaapiconvert.c: + * tests/test-subpicture.c: + image: allow partial updates. + +2011-12-12 15:31:52 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + subpicture: fix doc for gst_vaapi_subpicture_set_image(). + +2011-12-12 13:39:20 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + display: fix has_image_format() to check against subpicture formats. + +2011-10-17 18:43:15 +0200 Gwenole Beauchesne + + * tests/test-subpicture.c: + tests: fix subpicture test. + +2011-10-14 13:00:12 -0300 Thibault Saunier + + * tests/Makefile.am: + * tests/test-subpicture-data.c: + * tests/test-subpicture-data.h: + * tests/test-subpicture.c: + tests: add test for subpictures. + Signed-off-by: Gwenole Beauchesne + +2011-11-25 12:28:04 -0500 Nicolas Dufresne + + * gst/vaapi/gstvaapiconvert.c: + * gst/vaapi/gstvaapidecode.c: + Add missing video context queries. + Signed-off-by: Gwenole Beauchesne + +2011-12-12 13:22:07 +0100 Gwenole Beauchesne + + * configure.ac: + Bump version for development. + +2011-12-12 10:04:32 +0100 Gwenole Beauchesne + + * gst-libs/gst/video/Makefile.am: + * gst-libs/gst/video/gstbasevideocodec.c: + * gst-libs/gst/video/gstbasevideocodec.h: + * gst-libs/gst/video/gstbasevideodecoder.c: + * gst-libs/gst/video/gstbasevideodecoder.h: + * gst-libs/gst/video/gstbasevideoutils.c: + * gst-libs/gst/video/gstbasevideoutils.h: + Drop unused copy of GstBaseVideoDecoder. + +2011-12-09 11:46:45 +0100 Gwenole Beauchesne + + * NEWS: + * configure.ac: + 0.3.0. + +2011-12-09 11:38:43 +0100 Gwenole Beauchesne + + * README: + README: update dependencies. + +2011-12-09 11:38:34 +0100 Gwenole Beauchesne + + * NEWS: + NEWS: updates. + +2011-12-09 11:20:04 +0100 Gwenole Beauchesne + + * configure.ac: + configure: check for GstBaseSink 'query' vfunc. + +2011-12-09 10:45:20 +0100 Gwenole Beauchesne + + * gst/vaapi/Makefile.am: + vaapiplugin: include local build dir to CFLAGS for generated files. + +2011-12-09 10:44:52 +0100 Gwenole Beauchesne + + * autogen.sh: + autogen: don't configure if NO_CONFIGURE variable is set. + +2011-12-08 11:54:59 +0100 Sreerenj Balachandran + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecode.h: + vaapidecode: return sink caps template if decoder is in NULL state. + Otherwise, the decoder would always create its own X display instead + of probing it from the downstream element, which is not reliable. + e.g. DISPLAY is not :0 or when running on Wayland. + Signed-off-by: Gwenole Beauchesne + +2011-12-08 15:44:09 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiconvert.c: + * gst/vaapi/gstvaapidecode.c: + vaapiplugin: properly set surface type to "vaapi" in caps. + +2011-12-08 15:16:14 +0100 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + decoder: drop unused headers. + +2011-11-04 19:47:25 -0400 Nicolas Dufresne + + * gst/vaapi/gstvaapiconvert.c: + * gst/vaapi/gstvaapidecode.c: + vaapiplugin: properly set opengl support in caps. + Signed-off-by: Gwenole Beauchesne + +2011-11-04 20:07:52 -0400 Nicolas Dufresne + + * gst/vaapi/gstvaapiconvert.c: + * gst/vaapi/gstvaapidecode.c: + vaapiplugin: allocate GLX buffers when supported. + Signed-off-by: Gwenole Beauchesne + +2011-11-04 19:47:09 -0400 Nicolas Dufresne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer_glx.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer_glx.h: + * gst-libs/gst/vaapi/gstvaapivideobuffer_priv.h: + * gst-libs/gst/vaapi/gstvaapivideoconverter_glx.c: + * gst-libs/gst/vaapi/gstvaapivideoconverter_glx.h: + videobuffer: add GLX buffer support. + Signed-off-by: Gwenole Beauchesne + +2011-10-06 16:06:15 -0400 Nicolas Dufresne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.h: + Port to GstSurfaceBuffer interface. + Signed-off-by: Gwenole Beauchesne + +2011-10-06 16:04:37 -0400 Nicolas Dufresne + + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapisink.c: + Don't use downstream buffer allocation. + With the new video/x-surface abstraction, we can't rely on having a VA + specific sink downstream. Also, there was no particular reason to do that. + Signed-off-by: Gwenole Beauchesne + +2011-11-04 17:16:23 -0400 Nicolas Dufresne + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst/vaapi/gstvaapiconvert.c: + * gst/vaapi/gstvaapisink.c: + * tests/Makefile.am: + * tests/test-surfaces.c: + Change caps to use new video/x-surface generic type. + Signed-off-by: Gwenole Beauchesne + +2011-11-04 16:50:15 -0400 Nicolas Dufresne + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiutils_gst.c: + * gst-libs/gst/vaapi/gstvaapiutils_gst.h: + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapiconvert.c: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapipluginutil.c: + * gst/vaapi/gstvaapipluginutil.h: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + Port to GstVideoContext interface. + This new interface allows for upstream and downstream display sharing + that works in both static and dynamic pipelines. + Signed-off-by: Gwenole Beauchesne + +2011-12-08 14:57:36 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: use GST_ERROR to print error messages. + +2011-12-08 13:30:51 +0100 Gwenole Beauchesne + + * gst/vaapi/Makefile.am: + vaapiplugin: link against VA/GLX when enabled. + +2011-12-07 19:09:55 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapiconvert.c: + * gst/vaapi/gstvaapisink.c: + Add Intel copyright information. + +2011-12-07 19:04:09 +0100 Gwenole Beauchesne + + * gst/vaapi/gstvaapisink.c: + vaapisink: allow compatibility with gst-plugins-base < 0.10.31. + +2011-12-07 18:40:35 +0100 Gwenole Beauchesne + + * .gitignore: + * configure.ac: + * gst-libs/gst/Makefile.am: + * gst-libs/gst/gstutils_version.h.in: + Add new GStreamer version check utilities. + +2011-07-28 11:14:49 +0300 Sreerenj Balachandran + + * gst/vaapi/gstvaapisink.c: + vaapisink: replace the deprecated xoverlay API with the new one. + Signed-off-by: Gwenole Beauchesne + +2011-12-07 17:31:09 +0100 Gwenole Beauchesne + + * configure.ac: + configure: allow for pre-releases. + +2011-10-13 17:08:13 -0400 Nicolas Dufresne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + display: destroy display on creation failure. + This allows element to detect that the display creation has actually + failed. + Signed-off-by: Gwenole Beauchesne + +2011-10-13 17:07:35 -0400 Nicolas Dufresne + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + display: don't crash when config is empty. + Signed-off-by: Gwenole Beauchesne + +2011-12-07 14:42:14 +0100 Gwenole Beauchesne + + * README: + * debian.upstream/copyright: + doc: mention Collabora copyrights. + +2011-12-07 14:40:20 +0100 Gwenole Beauchesne + + * .gitignore: + .gitignore: refine for generated docs. + +2011-09-14 15:12:41 -0400 Nicolas Dufresne + + * configure.ac: + * docs/reference/plugins/Makefile.am: + * gst/Makefile.am: + * gst/vaapi/Makefile.am: + * gst/vaapi/gstvaapi.c: + * gst/vaapi/gstvaapiconvert.c: + * gst/vaapi/gstvaapiconvert.h: + * gst/vaapi/gstvaapidecode.c: + * gst/vaapi/gstvaapidecode.h: + * gst/vaapi/gstvaapisink.c: + * gst/vaapi/gstvaapisink.h: + * gst/vaapiconvert/Makefile.am: + * gst/vaapiconvert/gstvaapiconvert.c: + * gst/vaapiconvert/gstvaapiconvert.h: + * gst/vaapidecode/Makefile.am: + * gst/vaapidecode/gstvaapidecode.c: + * gst/vaapidecode/gstvaapidecode.h: + * gst/vaapisink/Makefile.am: + * gst/vaapisink/gstvaapisink.c: + * gst/vaapisink/gstvaapisink.h: + Group all plugins into the same bundle + Signed-off-by: Gwenole Beauchesne + +2011-07-21 14:31:30 +0200 Gwenole Beauchesne + + * configure.ac: + Bump version for development. + +2011-12-07 14:17:32 +0100 Gwenole Beauchesne + + * configure.ac: + * debian.upstream/control.in: + debian: build against upstream libva packages. + +2011-12-07 13:52:17 +0100 Gwenole Beauchesne + + * docs/reference/libs/Makefile.am: + * docs/reference/plugins/Makefile.am: + * tests/Makefile.am: + Fix build on Ubuntu 11.10 (Oneric). + +2011-12-07 13:14:28 +0100 Gwenole Beauchesne + + * NEWS: + 0.2.7. + +2011-09-12 16:20:16 -0400 Nicolas Dufresne + + * .gitignore: + Adding ignore file + Signed-off-by: Gwenole Beauchesne + +2011-10-24 16:18:16 -0400 Nicolas Dufresne + + * gst/vaapiconvert/gstvaapiconvert.c: + * gst/vaapidecode/gstvaapidecode.c: + * gst/vaapisink/gstvaapisink.c: + Update license in plugin definition + Signed-off-by: Gwenole Beauchesne + +2011-10-12 14:00:50 +0200 Gwenole Beauchesne + + * NEWS: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + decoder: fix use of invalid data at the end-of-stream. + +2011-10-19 14:47:31 +0200 Gwenole Beauchesne + + * gst/vaapiconvert/gstvaapiconvert.c: + vaapiconvert: fix some warnings. + +2011-10-19 14:43:56 +0200 Gwenole Beauchesne + + * configure.ac: + * debian.upstream/changelog.in: + * debian.upstream/control.in: + * debian.upstream/copyright: + * gst/vaapiconvert/gstvaapiconvert.c: + * gst/vaapidecode/gstvaapidecode.c: + * gst/vaapisink/gstvaapisink.c: + Update with my current e-mail address. + +2011-10-19 14:39:21 +0200 Gwenole Beauchesne + + * NEWS: + * README: + Splitted-Desktop systems relicensed plugins and tests to LGPL v2.1+. + +2011-10-18 09:18:20 +0200 warly + + * tests/image.c: + * tests/image.h: + * tests/test-decode.c: + * tests/test-decode.h: + * tests/test-display.c: + * tests/test-h264.c: + * tests/test-h264.h: + * tests/test-mpeg2.c: + * tests/test-mpeg2.h: + * tests/test-surfaces.c: + * tests/test-textures.c: + * tests/test-vc1.c: + * tests/test-vc1.h: + * tests/test-windows.c: + switch tests licence to LGPL v2.1+ + +2011-10-18 09:06:52 +0200 warly + + * COPYING: + * README: + * debian.upstream/copyright: + * gst/vaapiconvert/gstvaapiconvert.c: + * gst/vaapiconvert/gstvaapiconvert.h: + * gst/vaapidecode/gstvaapidecode.c: + * gst/vaapidecode/gstvaapidecode.h: + * gst/vaapisink/gstvaapisink.c: + * gst/vaapisink/gstvaapisink.h: + move plugins to LGPL v2.1+ + +2011-09-14 13:07:18 +0200 Gwenole Beauchesne + + * gst/vaapidecode/gstvaapidecode.c: + vaapidecode: fix sink caps to not expose size information. + This fixes this particular issue: + GStreamer-WARNING **: pad vaapidecode0:sink returned caps which are not + a real subset of its template caps + +2011-09-14 11:34:05 +0200 Gwenole Beauchesne + + * NEWS: + * gst/vaapidecode/gstvaapidecode.c: + vaapidecode: fix decoding of MPEG-2 PS files. + +2011-09-12 13:00:04 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/Makefile.am: + Cosmetics (sort source files). + +2011-09-08 14:50:24 +0200 Gwenole Beauchesne + + * gst/vaapiconvert/gstvaapiconvert.c: + * gst/vaapiconvert/gstvaapiconvert.h: + vaapiconvert: fix direct-rendering caps detection. + +2011-09-08 14:40:08 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapiimage.c: + Fix gst_vaapi_image_new_with_image(). + +2011-09-08 13:09:17 +0200 Gwenole Beauchesne + + * gst/vaapiconvert/gstvaapiconvert.c: + vaapiconvert: warn when surface failed to be updated with image. + +2011-09-06 18:34:33 +0200 Gwenole Beauchesne + + * gst/vaapiconvert/gstvaapiconvert.c: + vaapiconvert: fix autodetection for vaDeriveImage() support. + +2011-09-06 17:47:10 +0200 Gwenole Beauchesne + + * gst/vaapiconvert/gstvaapiconvert.c: + vaapiconvert: fix memory leak (VA surface image). + +2011-09-05 16:20:20 +0200 Gwenole Beauchesne + + * NEWS: + * gst/vaapiconvert/gstvaapiconvert.c: + vaapiconvert: fix direct-rendering mode. + +2011-09-06 16:49:43 +0200 Gwenole Beauchesne + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.h: + Add gst_vaapi_video_buffer_new_from_buffer(). + Add helper function to bind a foreign buffer into a GstVaapiVideoBuffer. + Any image, surface or surface proxy will be inherited from the source buffer + if it is a GstVaapiVideoBuffer. + +2011-09-05 17:23:05 +0200 Gwenole Beauchesne + + * gst/vaapiconvert/gstvaapiconvert.c: + vaapiconvert: protect access to direct_rendering. + +2011-09-05 16:18:14 +0200 Gwenole Beauchesne + + * gst/vaapiconvert/gstvaapiconvert.c: + vaapiconvert: use gst_vaapi_display_lookup_downstream() helper to get a VA display. + +2011-08-01 14:15:39 +0200 Gwenole Beauchesne + + * NEWS: + * README: + * debian.upstream/copyright: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst/vaapidecode/gstvaapidecode.c: + * gst/vaapidecode/gstvaapidecode.h: + Add Intel copyright information. + +2011-07-22 15:59:00 +0200 Gwenole Beauchesne + + * NEWS: + Updates. + +2011-07-22 15:55:47 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + Fix build with newer FFmpeg versions. + +2011-07-22 15:39:51 +0200 Gwenole Beauchesne + + * gst/vaapidecode/gstvaapidecode.c: + * gst/vaapidecode/gstvaapidecode.h: + Fix decoding of MPEG-2 TS files. + +2011-07-22 15:34:48 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + Report caps update only once per video resolution change. + +2011-07-22 15:33:13 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapisurface.h: + Add canonical form (type name) of VA surface caps. + +2011-07-22 15:42:16 +0200 Gwenole Beauchesne + + * configure.ac: + Bump version for development. + +2011-07-19 17:38:40 +0200 Gwenole Beauchesne + + * configure.ac: + Use pretty build output with automake >= 1.11. + +2011-07-15 16:08:08 +0200 Gwenole Beauchesne + + * gst/vaapiconvert/Makefile.am: + * gst/vaapidecode/Makefile.am: + * gst/vaapisink/Makefile.am: + * tests/Makefile.am: + Fix build with libva headers not in a standard include dir. + +2011-06-14 15:59:08 +0200 Gwenole Beauchesne + + * configure.ac: + 0.2.6. + +2011-06-14 13:52:56 +0200 Gwenole Beauchesne + + * gst-libs/gst/vaapi/gstvaapi_priv.h: + * gst-libs/gst/vaapi/gstvaapicompat.h: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapidebug.h: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11_priv.h: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.h: + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + * gst-libs/gst/vaapi/gstvaapiimagepool.h: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapiobject.h: + * gst-libs/gst/vaapi/gstvaapiobject_priv.h: + * gst-libs/gst/vaapi/gstvaapiparamspecs.c: + * gst-libs/gst/vaapi/gstvaapiparamspecs.h: + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapiprofile.h: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.h: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapitexture.h: + * gst-libs/gst/vaapi/gstvaapitypes.h: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + * gst-libs/gst/vaapi/gstvaapiutils_gst.c: + * gst-libs/gst/vaapi/gstvaapiutils_gst.h: + * gst-libs/gst/vaapi/gstvaapiutils_x11.c: + * gst-libs/gst/vaapi/gstvaapiutils_x11.h: + * gst-libs/gst/vaapi/gstvaapivalue.c: + * gst-libs/gst/vaapi/gstvaapivalue.h: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.h: + * gst-libs/gst/vaapi/gstvaapivideopool.c: + * gst-libs/gst/vaapi/gstvaapivideopool.h: + * gst-libs/gst/vaapi/gstvaapivideosink.c: + * gst-libs/gst/vaapi/gstvaapivideosink.h: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.h: + * gst/vaapiconvert/gstvaapiconvert.c: + * gst/vaapiconvert/gstvaapiconvert.h: + * gst/vaapidecode/gstvaapidecode.c: + * gst/vaapidecode/gstvaapidecode.h: + * gst/vaapisink/gstvaapisink.c: + * gst/vaapisink/gstvaapisink.h: + * tests/image.c: + * tests/image.h: + * tests/test-decode.c: + * tests/test-decode.h: + * tests/test-display.c: + * tests/test-h264.c: + * tests/test-h264.h: + * tests/test-mpeg2.c: + * tests/test-mpeg2.h: + * tests/test-surfaces.c: + * tests/test-textures.c: + * tests/test-vc1.c: + * tests/test-vc1.h: + * tests/test-windows.c: + Update copyright notice. + +2011-06-14 13:51:41 +0200 Gwenole Beauchesne + + * NEWS: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapiutils_x11.c: + * gst-libs/gst/vaapi/gstvaapivalue.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideopool.c: + * gst-libs/gst/vaapi/gstvaapivideosink.c: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Fix licensing terms. + +2010-07-20 11:23:16 +0000 gb + + * NEWS: + 0.2.5. + +2010-07-20 11:21:37 +0000 gb + + * debian.upstream/copyright: + Fix license terms... + +2010-07-01 13:19:29 +0000 gb + + * gst/vaapisink/gstvaapisink.c: + Render pretty background only in use-reflection=true mode. + +2010-07-01 11:43:22 +0000 gb + + * NEWS: + Updates. + +2010-07-01 11:41:23 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + Drop the GLX 1.3 requirement. + +2010-07-01 11:38:28 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + Call the GLX/Pixmap related functions through the vtable. + +2010-07-01 11:11:18 +0000 gb + + * NEWS: + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + Drop dependency on libavformat. + +2010-06-22 15:15:46 +0000 gb + + * gst-libs/gst/video/gstbasevideodecoder.c: + * gst-libs/gst/video/gstbasevideodecoder.h: + Add gst_base_video_decoder_update_src_caps(). Don't forcibly set "interlaced" field if upstream elements did not have any. + +2010-06-22 14:06:25 +0000 gb + + * gst-libs/gst/video/gstbasevideodecoder.c: + * gst-libs/gst/video/gstbasevideoutils.c: + * gst-libs/gst/video/gstbasevideoutils.h: + Drop superfluous functions. + +2010-06-22 13:57:33 +0000 gb + + * gst-libs/gst/video/gstbasevideodecoder.c: + Really drop any dependency on libgstvideo. i.e. inline the helpers. + +2010-06-22 13:48:30 +0000 gb + + * gst-libs/gst/video/gstbasevideodecoder.c: + Further drop dependency on libgstvideo. + +2010-06-22 12:57:06 +0000 gb + + * gst-libs/gst/video/Makefile.am: + * gst-libs/gst/video/gstbasevideocodec.c: + * gst-libs/gst/video/gstbasevideocodec.h: + * gst-libs/gst/video/gstbasevideodecoder.c: + * gst-libs/gst/video/gstbasevideodecoder.h: + * gst-libs/gst/video/gstbasevideoutils.c: + * gst-libs/gst/video/gstbasevideoutils.h: + Add GstBaseVideoDecoder from gst-plugins-bad git. + +2010-06-15 12:36:16 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + Fix GLX version check. + +2010-06-14 14:46:41 +0000 gb + + * NEWS: + * configure.ac: + Bump version for development. + +2010-06-14 14:14:42 +0000 gb + + * NEWS: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + Fix decoding of some H.264 streams. e.g. Ice Age 2 trailer. + +2010-06-14 12:58:22 +0000 gb + + * NEWS: + Update changelog. + +2010-06-14 09:20:37 +0000 gb + + * gst-libs/gst/vaapi/gstvaapicompat.h: + Fix build with older VA-API 0.29-sds. + +2010-05-18 11:22:54 +0000 gb + + * gst/vaapisink/gstvaapisink.c: + * gst/vaapisink/gstvaapisink.h: + Fix upscaling in foreign window (Totem). + +2010-05-17 12:32:34 +0000 gb + + * gst/vaapisink/gstvaapisink.c: + Soft validate caps since we only care about video/x-vaapi-surface as input. _setcaps() will check for other fields. + +2010-05-17 08:55:51 +0000 gb + + * NEWS: + * gst/vaapisink/gstvaapisink.c: + Fix video rendering rect within an embedder window (Totem). + +2010-05-17 08:28:28 +0000 gb + + * NEWS: + * gst/vaapisink/gstvaapisink.c: + Disable GLX rendering when vaapisink uses a foreign X window. + +2010-05-17 08:24:42 +0000 gb + + * gst/vaapisink/gstvaapisink.c: + Simplify GLX rendering code. + +2010-05-17 07:32:10 +0000 gb + + * configure.ac: + Bump version for development. + +2010-05-16 21:44:17 +0000 gb + + * NEWS: + 0.2.3. + +2010-05-16 21:35:14 +0000 gb + + * gst/vaapidecode/gstvaapidecode.c: + Wait for at most one second for a VA surface to become available. + +2010-05-16 21:18:37 +0000 gb + + * README: + * configure.ac: + Build-Requires: gstreamer0.10 >= 0.10.10 for gst_caps_merge(). + +2010-05-16 21:17:49 +0000 gb + + * NEWS: + * README: + * gst-libs/gst/vaapi/gstvaapiprofile.c: + Fix decoder caps to report codec aliases. + +2010-05-16 21:04:32 +0000 gb + + * NEWS: + * gst/vaapidecode/gstvaapidecode.c: + * gst/vaapidecode/gstvaapidecode.h: + Fix VC-1 decoding through the playbin2 pipeline. + +2010-05-15 15:33:20 +0000 gb + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + Regularly update and expose decoder caps. + +2010-05-15 09:43:28 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + Add mechanism to reinsert buffer leftovers into the queue. + +2010-05-15 06:59:54 +0000 gb + + * NEWS: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + Fix memory leak of encoded buffers. + +2010-05-15 05:36:15 +0000 gb + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + Check for out-of-free-surfaces condition. + +2010-05-15 04:35:00 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.h: + Change GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN value to something more generic (-1). + +2010-05-15 04:25:32 +0000 gb + + * gst/vaapisink/gstvaapisink.c: + Improve debug info for gst_vaapisink_ensure_render_rect(). + +2010-05-14 05:02:05 +0000 gb + + * configure.ac: + Bump version for development. + +2010-05-13 21:52:22 +0000 gb + + * NEWS: + 0.2.2. + +2010-05-13 21:39:58 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + Improve previous fix. + +2010-05-13 21:27:43 +0000 gb + + * NEWS: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + Fix a crash in the FFmpeg decoder on close. + +2010-05-13 16:41:55 +0000 gb + + * README: + Sort platforms by name. + +2010-05-13 09:40:52 +0000 gb + + * NEWS: + * configure.ac: + Bump version for development. + +2010-05-13 09:38:47 +0000 gb + + * gst/vaapisink/gstvaapisink.c: + Add debug info for _show_frame(). + +2010-05-13 07:19:46 +0000 gb + + * Makefile.am: + Nuke older build dir. + +2010-05-13 07:19:21 +0000 gb + + * debian.upstream/control.in: + Fix packaging deps. + +2010-05-13 06:12:37 +0000 gb + + * NEWS: + Cosmetics. + +2010-05-13 06:11:42 +0000 gb + + * NEWS: + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + Fix OpenGL texture internal format (Clutter). + +2010-05-13 04:40:40 +0000 gb + + * NEWS: + Respin release. + +2010-05-13 04:27:44 +0000 gb + + * gst/vaapisink/gstvaapisink.c: + Debug video & display PARs. + +2010-05-13 04:22:31 +0000 gb + + * gst/vaapisink/gstvaapisink.c: + Use XGetGeometry() to retrieve the window size. + +2010-05-12 19:40:30 +0000 gb + + * gst/vaapisink/gstvaapisink.c: + Move code around. + +2010-05-12 19:35:45 +0000 gb + + * gst/vaapisink/gstvaapisink.c: + Ensure VA display is created prior to initializing the window from a specific XID. Also move code down. + +2010-05-12 19:18:04 +0000 gb + + * README: + Drop obsolete comment. + +2010-05-12 19:14:59 +0000 gb + + * NEWS: + 0.2.1. + +2010-05-12 19:14:35 +0000 gb + + * gst/vaapidecode/gstvaapidecode.c: + Fix GstVaapiDisplay refcounting in vaapidecode. + +2010-05-12 14:10:38 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiutils_gst.c: + Fix comment. + +2010-05-12 12:58:53 +0000 gb + + * gst/vaapisink/gstvaapisink.c: + * gst/vaapisink/gstvaapisink.h: + Fix render rect when the foreign window size changes. + +2010-05-12 11:43:50 +0000 gb + + * NEWS: + * configure.ac: + * gst/vaapisink/Makefile.am: + * gst/vaapisink/gstvaapisink.c: + Add GstXOverlay interface to vaapisink (e.g. for Totem). + +2010-05-12 10:51:21 +0000 gb + + * README: + Update deps to match configure.ac versions. + +2010-05-12 09:34:37 +0000 gb + + * gst/vaapiconvert/gstvaapiconvert.c: + * gst/vaapidecode/gstvaapidecode.c: + * gst/vaapisink/gstvaapisink.c: + Cosmetics. + +2010-05-12 09:22:49 +0000 gb + + * NEWS: + * gst/vaapidecode/Makefile.am: + * gst/vaapidecode/gstvaapidecode.c: + * gst/vaapidecode/gstvaapidecode.h: + Fix vaapidecode to expose the HW supported caps only. + +2010-05-12 08:32:34 +0000 gb + + * gst/vaapidecode/gstvaapidecode.c: + Initialize decoder earlier. + +2010-05-12 08:02:45 +0000 gb + + * NEWS: + * README: + * gst/vaapidecode/gstvaapidecode.c: + Fix integration within the playbin2 pipeline. + +2010-05-12 08:02:19 +0000 gb + + * docs/reference/libs/Makefile.am: + Exclude gstvaapiutils_gst.h from docs for now. + +2010-05-12 08:00:09 +0000 gb + + * gst/vaapiconvert/gstvaapiconvert.c: + * gst/vaapidecode/gstvaapidecode.c: + * gst/vaapisink/gstvaapisink.c: + Raise VA-API plugins ranks. + +2010-05-12 07:57:55 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiutils_gst.c: + * gst-libs/gst/vaapi/gstvaapiutils_gst.h: + Add gst_vaapi_display_lookup_downstream() helper. + +2010-05-11 16:23:17 +0000 gb + + * gst/vaapidecode/gstvaapidecode.c: + Use fixed caps on the src pad, they are not meant to change from video/x-vaapi-surface. + +2010-05-11 16:19:30 +0000 gb + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.h: + * gst/vaapisink/gstvaapisink.c: + Expose VA display through GstVaapiVideoBuffer. + +2010-05-11 16:09:49 +0000 gb + + * gst/vaapidecode/gstvaapidecode.c: + Simplify gst_vaapidecode_set_caps() and fix memory leak. + +2010-05-11 12:06:59 +0000 gb + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapivideopool.c: + * gst-libs/gst/vaapi/gstvaapivideopool.h: + Expose video pool display. + +2010-05-11 12:03:13 +0000 gb + + * gst-libs/gst/vaapi/gstvaapivideosink.c: + Stop iteration if there is no more element to examine. + +2010-05-10 09:32:47 +0000 gb + + * gst/vaapiconvert/gstvaapiconvert.c: + * gst/vaapidecode/gstvaapidecode.c: + * gst/vaapisink/gstvaapisink.c: + Improve plugin details. + +2010-05-07 06:35:31 +0000 gb + + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst/vaapiconvert/gstvaapiconvert.c: + * gst/vaapidecode/gstvaapidecode.c: + * gst/vaapisink/gstvaapisink.c: + Factor out VA surface caps. + +2010-05-05 15:36:25 +0000 gb + + * gst/vaapidecode/gstvaapidecode.c: + Add gst_vaapidecode_ensure_display() helper for set-caps. + +2010-05-05 12:57:59 +0000 gb + + * configure.ac: + Bump version for development. + +2010-05-05 12:29:28 +0000 gb + + * NEWS: + Really make it 0.2.0. + +2010-05-05 12:28:59 +0000 gb + + * README: + More docs. + +2010-05-05 11:48:31 +0000 gb + + * docs/reference/libs/Makefile.am: + Don't exclude GstVaapiParamSpecs. + +2010-05-05 11:44:06 +0000 gb + + * docs/reference/libs/Makefile.am: + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + Fix docs. + +2010-05-05 06:06:02 +0000 gb + + * gst/vaapiconvert/gstvaapiconvert.c: + * gst/vaapidecode/gstvaapidecode.c: + * gst/vaapisink/gstvaapisink.c: + Lower plugins rank for now since playbin2 auto-plugging is not working properly. User applications will have to create their own pipeline or with some hacks around playbin2. + +2010-05-04 15:03:47 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + Really link all helper libraries with libtool -no-undefined. + +2010-05-04 15:02:29 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + Link helper libraries with libtool -no-undefined. + +2010-05-04 14:59:27 +0000 gb + + * configure.ac: + * debian.upstream/gstreamer-vaapi.install.in: + * gst/vaapiconvert/Makefile.am: + * gst/vaapidecode/Makefile.am: + * gst/vaapisink/Makefile.am: + Don't build plugins with SONAME. Make them plain *.so. + +2010-05-04 08:59:27 +0000 gb + + * README: + Improve documentation for release. + +2010-05-03 22:50:56 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + Fix build with older VA-API 0.29. + +2010-05-03 22:43:01 +0000 gb + + * NEWS: + 0.2.0. + +2010-05-03 22:42:46 +0000 gb + + * tests/Makefile.am: + Fix make dist. + +2010-05-03 22:36:34 +0000 gb + + * docs/reference/libs/Makefile.am: + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/libs/libs-sections.txt: + * docs/reference/libs/libs.core.types: + * docs/reference/plugins/Makefile.am: + * docs/reference/plugins/plugins-docs.xml.in: + * docs/reference/plugins/plugins-sections.txt: + * docs/reference/plugins/plugins.types: + Add missing docs. + +2010-05-03 22:34:53 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + Fix doc. + +2010-05-03 22:28:02 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.h: + * gst/vaapidecode/gstvaapidecode.c: + * tests/test-decode.c: + Rename gst_vaapi_decoder_ffmpeg_new_from_caps() to plain gst_vaapi_decoder_ffmpeg_new(). + +2010-05-03 22:02:41 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + Extract framerate information from caps. + +2010-05-03 21:49:35 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + Move caps initialization to parent class. + +2010-05-03 21:25:46 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + Simplify. + +2010-05-03 21:25:26 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + Fix doc. + +2010-05-03 21:14:01 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + More simplifications. + +2010-05-03 20:55:17 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * tests/test-decode.c: + Simplify GstVaapiDecoder API. + +2010-05-03 20:40:27 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.h: + Drop obsolete defs. + +2010-05-03 20:34:57 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.h: + Drop obsolete decls. + +2010-05-03 17:36:01 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst/vaapidecode/gstvaapidecode.c: + Add more aliases for MPEG-4 decoding. + +2010-05-03 17:04:00 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + Use avctx->coded_{width,height} info to create the VA context. + +2010-05-03 16:54:23 +0000 gb + + * tests/test-decode.c: + * tests/test-decode.h: + Use gst_vaapi_decoder_ffmpeg_new_from_caps(). + +2010-05-03 16:41:13 +0000 gb + + * tests/test-decode.c: + * tests/test-decode.h: + * tests/test-h264.c: + * tests/test-h264.h: + * tests/test-mpeg2.c: + * tests/test-mpeg2.h: + * tests/test-vc1.c: + * tests/test-vc1.h: + Simplify tests info. + +2010-05-03 16:17:51 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + Try to improve heuristics to use an AVCodecContextParser. + +2010-05-03 15:35:22 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + Fix VC-1 decoding, it does not require any specific parser. + +2010-05-03 15:34:22 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + Fix VC-1 detection with older gstreamer libs (no "fourcc" field, but a "format" one). + +2010-05-03 15:29:18 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + Use size information from the demuxer, whenever available. i.e. fix WMV3 decoding. + +2010-05-03 15:11:32 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst/vaapidecode/gstvaapidecode.c: + * gst/vaapidecode/gstvaapidecode.h: + Add gst_vaapi_decoder_ffmpeg_new_from_caps() helper. + +2010-05-03 14:53:18 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapiprofile.h: + Improve WMV3 detection yet further. + +2010-05-03 13:44:41 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + Fix detection of plain old WMV3 contents. + +2010-05-03 12:25:07 +0000 gb + + * tests/test-vc1.c: + Add End-of-Sequence start code. + +2010-05-03 11:44:23 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst/vaapidecode/gstvaapidecode.c: + Fix VC-1 detection. + +2010-05-03 08:51:28 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + Fix build with older gstreamer libs where gst_buffer_unref() is not a plain function. + +2010-05-03 08:34:57 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + Drop obsolete (and wrong) code. + +2010-05-03 08:33:23 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + Cosmetics (spelling). + +2010-05-03 08:32:46 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + Try to fix timestamps (step 1). Looks OK on H55. + +2010-05-03 07:10:04 +0000 gb + + * debian.upstream/Makefile.am: + Ship with COPYING.LIB. + +2010-05-03 07:07:27 +0000 gb + + * COPYING.LIB: + * NEWS: + * README: + * gst-libs/gst/vaapi/gstvaapi_priv.h: + * gst-libs/gst/vaapi/gstvaapicompat.h: + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + * gst-libs/gst/vaapi/gstvaapidebug.h: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11_priv.h: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.h: + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + * gst-libs/gst/vaapi/gstvaapiimagepool.h: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapiobject.h: + * gst-libs/gst/vaapi/gstvaapiobject_priv.h: + * gst-libs/gst/vaapi/gstvaapiparamspecs.c: + * gst-libs/gst/vaapi/gstvaapiparamspecs.h: + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapiprofile.h: + * gst-libs/gst/vaapi/gstvaapisubpicture.h: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapisurfacepool.h: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + * gst-libs/gst/vaapi/gstvaapitexture.h: + * gst-libs/gst/vaapi/gstvaapitypes.h: + * gst-libs/gst/vaapi/gstvaapiutils.h: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + * gst-libs/gst/vaapi/gstvaapiutils_x11.h: + * gst-libs/gst/vaapi/gstvaapivalue.h: + * gst-libs/gst/vaapi/gstvaapivideobuffer.h: + * gst-libs/gst/vaapi/gstvaapivideopool.h: + * gst-libs/gst/vaapi/gstvaapivideosink.h: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.h: + Relicense gst-libs/ code to LGPL v2.1+. + +2010-05-03 06:49:43 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + Drop extraneous comma. + +2010-05-03 06:49:19 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + Drop variant=itu field to help codec detection. + +2010-04-30 15:50:19 +0000 gb + + * gst/vaapidecode/gstvaapidecode.c: + Decode as many surfaces as possible in gst_vaapidecode_step(). + +2010-04-30 15:37:28 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * gst/vaapidecode/gstvaapidecode.c: + * gst/vaapidecode/gstvaapidecode.h: + * tests/test-decode.c: + Drop excessive threading that over-complicates synchronisation. MPEG-2 & H.264 videos now play but there are other problems (timestamps). + +2010-04-30 13:13:50 +0000 gb + + * configure.ac: + 0.2.0. + +2010-04-30 12:04:12 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + Move VA context reset to AVCodecContext.get_context() as the surface sizes can change. + +2010-04-30 09:52:29 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + Fix gst_vaapi_display_has_{decoder,encoder}() to check for the entrypoint too. + +2010-04-30 09:48:41 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapiprofile.h: + Add GST_VAAPI_ENTRYPOINT_SLICE_ENCODE. + +2010-04-30 08:18:07 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + Document H.264 / AVC1 format case better. + +2010-04-29 23:09:07 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + Fix H.264 decoding with AVC1 format bitstreams. + +2010-04-29 22:00:37 +0000 gb + + * gst/vaapidecode/gstvaapidecode.c: + Complete initialization of the GstVaapiVideoBuffer. Some frames start to show up. + +2010-04-29 21:59:14 +0000 gb + + * gst/vaapisink/gstvaapisink.c: + Add missing GstBaseSink::buffer_alloc() override. i.e. make sure to allocate a GstVaapiVideoBuffer instead of a plain GstBuffer from the peer pad. + +2010-04-29 21:56:10 +0000 gb + + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.h: + Export gst_vaapi_video_buffer_new(). + +2010-04-29 21:12:30 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + Fix gst_vaapi_profile_get_caps() to include the "profile" field. + +2010-04-29 17:56:42 +0000 gb + + * configure.ac: + Fix comment. + +2010-04-29 17:55:58 +0000 gb + + * NEWS: + * configure.ac: + * gst/Makefile.am: + * gst/vaapidecode/Makefile.am: + * gst/vaapidecode/gstvaapidecode.c: + * gst/vaapidecode/gstvaapidecode.h: + Add FFmpeg/VAAPI decoder for the new `vaapidecode' element. + +2010-04-29 17:51:57 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + Add gst_vaapi_decoder_pause(). + +2010-04-29 17:11:32 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + Use a GstTask with start/stop semantics for the decoder thread. + +2010-04-29 16:08:46 +0000 gb + + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + Drop extraneous var. + +2010-04-29 15:45:44 +0000 gb + + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.h: + Add support for GstVaapiSurfaceProxy to GstVaapiVideoBuffer. + +2010-04-29 14:58:45 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + Fix gst_vaapi_decoder_get_surface() status. + +2010-04-29 14:28:43 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + Try to set correct timestamps to the decoded surface proxy. + +2010-04-29 12:52:27 +0000 gb + + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + * tests/test-decode.c: + Add timestamps to GstVaapiSurfaceProxy. + +2010-04-29 09:43:40 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + Fix GstVaapiDecoder::destroy(): GASyncQueue is not a GObject, likewise for GstBuffer. + +2010-04-29 09:40:38 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + Fix destructor, av_parser_close() does destroy the struct already, unliker avcodec_close()... + +2010-04-29 09:35:54 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + Prefer profile from codec-data if any was found there. + +2010-04-29 09:34:54 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + Improve heuristics to find the best profile. Use the highest one if no explicit match on "profile" field. + +2010-04-28 23:09:52 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + Make sure gst_vaapi_decoder_get_surface() gets unblocked on error. + +2010-04-28 22:30:50 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + Fix VC-1 codec initialization, it really needs an extradata buffer. + +2010-04-28 22:16:10 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + Split decoder creation with actual resources allocation and codec setup (probe). This fixes a memory leak (avctx, pctx) on destroy and most interestingly makes it possible to detect unsupported codecs. + +2010-04-28 21:58:58 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + Move gst_vaapi_decoder_ffmpeg_create() call to object constructor. + +2010-04-28 21:50:44 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * tests/test-decode.c: + Add "codec-data" property for additional codec data. e.g. VC-1 sequence headers for elementary streams. + +2010-04-28 21:20:19 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + Cosmetics (weird indentation). + +2010-04-28 21:15:55 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + Cosmetics (extraneous variable, debug message). + +2010-04-28 09:07:45 +0000 gb + + * configure.ac: + Fix check for VA-API enabled FFmpeg. + +2010-04-27 15:26:19 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + - Add PTS and framerate information. - Simplify parsing with an AVCodeParserContext. + +2010-04-27 11:59:23 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + Add more error codes. Fix documentation. + +2010-04-26 13:30:27 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + Fix gst_vaapi_profile_get_codec(). Improve gst_vaapi_profile_from_caps() for H.264 & caps with "codec-data". + +2010-04-26 11:44:32 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + * tests/test-decode.c: + Handle user end-of-streams. Add gst_vaapi_decoder_{start,stop}() helpers. + +2010-04-26 11:36:12 +0000 gb + + * tests/test-vc1.c: + Drop useless End-of-Sequence marker. + +2010-04-26 08:53:18 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + Flush stream only if avcodec_decode_video() read something. Otherwise, we might still have to seek into the stream. i.e. keep the data longer. + +2010-04-26 08:40:27 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + Use a recursive mutex so that a single thread can lock several times. This fixes decoding of MPEG-2 and H.264 because those created a GstVaapiContext later through avcodec_decode_video() that was a protected call. + +2010-04-26 08:15:58 +0000 gb + + * tests/test-h264.c: + * tests/test-vc1.c: + Regenerate correct clips. + +2010-04-23 16:11:55 +0000 gb + + * tests/Makefile.am: + * tests/test-decode.c: + * tests/test-h264.c: + * tests/test-h264.h: + * tests/test-mpeg2.c: + * tests/test-mpeg2.h: + * tests/test-vc1.c: + * tests/test-vc1.h: + Add decoder demos. Use -c (mpeg2|h264|vc1) to select the codec. + XXX: only VC-1 decoding works at this time because of awful + bugs left in GstVaapiDecoderFfmpeg et al. + +2010-04-23 16:05:58 +0000 gb + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidecoder.c: + * gst-libs/gst/vaapi/gstvaapidecoder.h: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c: + * gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.h: + * gst-libs/gst/vaapi/gstvaapidecoder_priv.h: + Add initial (multithreaded) decoder based on FFmpeg. + There are tons of bugs left: + - Decoder API not nice enough with error conditions + - FFmpeg parser is sometimes broken + - Packets queue can be lost + +2010-04-23 16:00:50 +0000 gb + + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.c: + * gst-libs/gst/vaapi/gstvaapisurfaceproxy.h: + Add surface proxy that holds a reference to the parent surface and that returns the surface to that context on destruction. + +2010-04-23 15:59:31 +0000 gb + + * gst-libs/gst/vaapi/gstvaapicontext.c: + * gst-libs/gst/vaapi/gstvaapicontext.h: + Add VA context abstraction. + +2010-04-23 10:58:19 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiprofile.h: + Fix VA profiles definitions for gst_vaapi_profile_get_codec() to work. + +2010-04-21 15:03:31 +0000 gb + + * gst-libs/gst/vaapi/gstvaapivideopool.c: + * gst-libs/gst/vaapi/gstvaapivideopool.h: + Add a means to cap the number of objects allocated in the pool. + +2010-04-21 15:02:23 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapiprofile.h: + Add VA entrypoint abstraction. + +2010-04-20 13:36:04 +0000 gb + + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapiprofile.c: + * gst-libs/gst/vaapi/gstvaapiprofile.h: + * tests/test-display.c: + Add VA profile abstraction. + +2010-04-20 07:51:23 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + Fix OpenGL rendering on G45 systems. + +2010-04-16 13:47:30 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + Fix gl_create_context() to find a GLXFBConfig compatible with the parent GL context. + +2010-04-02 11:27:23 +0000 gb + + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + Fix TFP logic and simplify the FBO model. i.e. it's not necessary to create another texture (and storage) for the TFP, simply a new texture name. + +2010-04-01 16:11:54 +0000 gb + + * gst-libs/gst/vaapi/gstvaapitexture.c: + Fix get-out conditions. + +2010-04-01 15:38:59 +0000 gb + + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + The shared GL context in GstVaapiTexture is only useful for cases where TFP+FBO are used, thus avoiding the need fully preserve the states and call into glGet*() functions that need synchronization. + +2010-04-01 13:55:19 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + Shorter structs. + +2010-04-01 13:41:24 +0000 gb + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapidisplay_glx_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11_priv.h: + * gst-libs/gst/vaapi/gstvaapiobject_priv.h: + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * tests/test-windows.c: + Make more helpers internal, thus reducing .text size further. Add gst_vaapi_display_x11_get_screen() helper along the way. + +2010-04-01 09:47:59 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapi_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapidisplay_priv.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Move GST_VAAPI_DISPLAY_VADISPLAY() and GST_VAAPI_DISPLAY_{LOCK,UNLOCK}() to gstvaapidisplay_priv.h. + +2010-03-31 15:25:19 +0000 gb + + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + Improve handling of GL contexts. + +2010-03-30 16:41:21 +0000 gb + + * configure.ac: + Simplify summary. + +2010-03-30 13:33:12 +0000 gb + + * configure.ac: + Bump version for development. + +2010-03-30 13:29:34 +0000 gb + + * configure.ac: + * debian.upstream/Makefile.am: + * debian.upstream/control.in: + Rename -dev package to libgstvaapi-dev. + +2010-03-30 13:17:12 +0000 gb + + * NEWS: + * README: + Updates. + +2010-03-30 13:05:31 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiutils.c: + Fix build with VA-API < 0.30. + +2010-03-30 13:01:34 +0000 gb + + * configure.ac: + * gst-libs/gst/vaapi/gstvaapicompat.h: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.h: + * gst-libs/gst/vaapi/gstvaapitexture.c: + * tests/test-display.c: + Enable build without VA/GLX extensions. i.e. fallback to TFP + FBO. + +2010-03-30 12:59:15 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + Add TFP and FBO helpers. + +2010-03-30 12:55:27 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + Cosmetics. Make vaapi_check_status() use GST_DEBUG() for error messages. + +2010-03-30 08:13:34 +0000 gb + + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Use a shorter function name. + +2010-03-30 08:11:50 +0000 gb + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + Add gst_vaapi_surface_query_status() wrapper. + +2010-03-30 07:50:11 +0000 gb + + * docs/reference/plugins/Makefile.am: + Fix leftover during migration. + +2010-03-30 07:46:47 +0000 gb + + * Makefile.am: + * configure.ac: + * docs/reference/plugins/Makefile.am: + * gst/Makefile.am: + * gst/vaapiconvert/Makefile.am: + * gst/vaapiconvert/gstvaapiconvert.c: + * gst/vaapiconvert/gstvaapiconvert.h: + * gst/vaapisink/Makefile.am: + * gst/vaapisink/gstvaapisink.c: + * gst/vaapisink/gstvaapisink.h: + * sys/Makefile.am: + * sys/vaapiconvert/Makefile.am: + * sys/vaapiconvert/gstvaapiconvert.c: + * sys/vaapiconvert/gstvaapiconvert.h: + * sys/vaapisink/Makefile.am: + * sys/vaapisink/gstvaapisink.c: + * sys/vaapisink/gstvaapisink.h: + Rename to gst/ as sys/ was too vague. + +2010-03-30 07:39:16 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.h: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + Try to not reference VA-API types directly. + +2010-03-29 16:24:37 +0000 gb + + * sys/vaapisink/gstvaapisink.c: + Fix reflection code to preserve aspect ratio. + +2010-03-29 16:17:38 +0000 gb + + * sys/vaapisink/gstvaapisink.c: + * sys/vaapisink/gstvaapisink.h: + Fix fullscreen mode. + +2010-03-29 15:59:44 +0000 gb + + * sys/vaapisink/gstvaapisink.c: + * sys/vaapisink/gstvaapisink.h: + Add OpenGL reflection effect ("use-reflection"). + +2010-03-29 15:51:54 +0000 gb + + * configure.ac: + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + Use a projection suitable for rotation around the Y axis. + +2010-03-29 15:03:30 +0000 gb + + * configure.ac: + * sys/vaapisink/Makefile.am: + * sys/vaapisink/gstvaapisink.c: + * sys/vaapisink/gstvaapisink.h: + Don't build vaapisink/gl by default. However, if this is enabled, use the GL renderer by default. + +2010-03-29 14:50:52 +0000 gb + + * configure.ac: + * debian.upstream/Makefile.am: + * debian.upstream/control.in: + * debian.upstream/libgstvaapi-glx.install.in: + Add libgstvaapi-glx-0 package. + +2010-03-29 14:47:49 +0000 gb + + * pkgconfig/Makefile.am: + Really fix make distclean. + +2010-03-29 14:43:22 +0000 gb + + * docs/reference/libs/Makefile.am: + Fix make dist. + +2010-03-29 14:42:57 +0000 gb + + * pkgconfig/Makefile.am: + Fix make distclean. + +2010-03-29 14:40:26 +0000 gb + + * tests/Makefile.am: + Fix make dist. + +2010-03-29 14:31:17 +0000 gb + + * docs/reference/libs/Makefile.am: + * docs/reference/libs/libs.core.types: + * docs/reference/libs/libs.glx.types: + * docs/reference/libs/libs.types: + * docs/reference/libs/libs.x11.types: + Fix doc build. + +2010-03-29 14:21:51 +0000 gb + + * sys/vaapisink/gstvaapisink.h: + Fix build without GLX. + +2010-03-29 14:13:55 +0000 gb + + * NEWS: + 0.1.2. + +2010-03-29 14:13:26 +0000 gb + + * sys/vaapisink/Makefile.am: + * sys/vaapisink/gstvaapisink.c: + * sys/vaapisink/gstvaapisink.h: + Add VA/GLX support to vaapisink. + +2010-03-29 13:40:27 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + Add glXSwapBuffers() workaround for NVIDIA. + +2010-03-29 13:27:16 +0000 gb + + * tests/Makefile.am: + * tests/test-textures.c: + Improve VA/GLX textures test. + +2010-03-29 12:51:38 +0000 gb + + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + Fix texture rendering. + +2010-03-29 11:25:20 +0000 gb + + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapitexture.c: + Fix documentation. + +2010-03-29 10:40:26 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.h: + Add gst_vaapi_window_glx_put_texture() helper. + +2010-03-29 09:09:30 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + Fix typos. + +2010-03-26 17:00:45 +0000 gb + + * tests/image.c: + * tests/image.h: + * tests/test-windows.c: + Move code around. + +2010-03-26 16:52:07 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapitexture.c: + * gst-libs/gst/vaapi/gstvaapitexture.h: + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + Add initial VA/GLX texture abstraction though the API is not good enough yet. + +2010-03-26 15:22:00 +0000 gb + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapiobject.h: + Add gst_vaapi_object_{,un}lock_display() helpers. + +2010-03-26 15:16:01 +0000 gb + + * tests/Makefile.am: + * tests/image.c: + * tests/image.h: + * tests/test-windows.c: + Factor out image utilities. + +2010-03-26 11:54:43 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + MT-Safe: lock display. + +2010-03-26 11:50:31 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + Make sure window resize completed prior to resizing the GL viewport. + +2010-03-26 11:39:20 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + gstvaapicompat.h is a private header, don't install it. + +2010-03-26 11:35:20 +0000 gb + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + Add gst_vaapi_display_{sync,flush}() helpers. + +2010-03-26 11:30:54 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * sys/vaapisink/gstvaapisink.c: + * sys/vaapisink/gstvaapisink.h: + Add "synchronous" mode. + +2010-03-26 11:02:12 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + Only add _display suffix to open & close members because they could be #define to some arbitrary value. lock/unlock are safe names. + +2010-03-26 10:09:23 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + Restore GLX context only if there is one. + +2010-03-26 09:41:12 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.h: + Add gst_vaapi_window_glx_make_current(). Handle X11 window size changes and reset the GL viewport. + +2010-03-26 08:35:24 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiwindow.c: + Check GstVaapiWindow::render() is available prior to calling it. + +2010-03-26 08:10:23 +0000 gb + + * tests/Makefile.am: + * tests/test-display.c: + * tests/test-textures.c: + Add VA/GLX display tests. + +2010-03-26 08:00:32 +0000 gb + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + Fix compile flags. + +2010-03-25 17:39:06 +0000 gb + + * docs/reference/libs/Makefile.am: + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/libs/libs-sections.txt: + * docs/reference/libs/libs.types: + Add missing API documentation. + +2010-03-25 17:28:49 +0000 gb + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.c: + * gst-libs/gst/vaapi/gstvaapidisplay_glx.h: + * gst-libs/gst/vaapi/gstvaapiutils_glx.c: + * gst-libs/gst/vaapi/gstvaapiutils_glx.h: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.c: + * gst-libs/gst/vaapi/gstvaapiwindow_glx.h: + * pkgconfig/Makefile.am: + * pkgconfig/gstreamer-vaapi-glx.pc.in: + * tests/Makefile.am: + * tests/test-textures.c: + Add initial VA/GLX support. + +2010-03-25 17:21:56 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Add missing includes (for vaapi_check_status()). + +2010-03-25 17:21:13 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidebug.h: + Only enable GST_DEBUG() if DEBUG is defined. Drop old D(bug()) stuff. + +2010-03-25 17:18:36 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.h: + Add gst_vaapi_window_x11_is_foreign_xid() helper. + +2010-03-25 17:18:06 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiutils_x11.c: + * gst-libs/gst/vaapi/gstvaapiutils_x11.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.h: + Allow derived classes to specify custom Visual and Colormap. + +2010-03-25 13:54:06 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiutils_x11.c: + * gst-libs/gst/vaapi/gstvaapiutils_x11.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Allow window creation with a specific visual (e.g. for GLX support). + +2010-03-25 13:21:19 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimage.c: + Fix return value on error (though it's the same in the end). + +2010-03-25 12:39:54 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + Simplify initialization of VADisplay. + +2010-03-25 10:04:39 +0000 gb + + * configure.ac: + Move __attribute__((visibility("hidden"))) check down. + +2010-03-25 09:49:17 +0000 gb + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.h: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * tests/test-surfaces.c: + Restore the gst_vaapi_{surface,image,subpicture}_get_id() interfaces. + +2010-03-25 09:39:17 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Use the parent display object, no need to maintain another one. + In the end, libgstvaapi-x11 reduced by 1 KB in .text vs. 0.1.1. + +2010-03-25 09:37:40 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiobject_priv.h: + Add more internal helpers. + +2010-03-24 17:40:19 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiobject_priv.h: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Rename to GST_VAAPI_OBJECT_DISPLAY(). + +2010-03-24 17:38:23 +0000 gb + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapiparamspecs.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapitypes.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + All GstVaapiID are initialized to GST_VAAPI_ID_NONE by default. Besides, all GstVaapiObject derived class shall initialize "id" to a valid value. + +2010-03-24 17:22:18 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Make GstVaapiWindow* derive from GstVaapiObject. + +2010-03-24 16:37:35 +0000 gb + + * configure.ac: + Factor out use gstreamer-vaapi (PACKAGE name). + +2010-03-24 16:35:36 +0000 gb + + * configure.ac: + Improve versioning summary. + +2010-03-24 16:27:36 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + gstvaapicompat.h is now a private header (not installed). + +2010-03-24 16:25:56 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.h: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Include gstvaapicompat.h in source files only, not headers. + +2010-03-24 16:21:20 +0000 gb + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + * sys/vaapiconvert/Makefile.am: + * sys/vaapisink/Makefile.am: + * tests/Makefile.am: + Drop tedious LIBVA_EXTRA_{CFLAGS,LIBS} definitions in Makefile.am. Override CFLAGS & LIBS instead. + +2010-03-24 16:17:49 +0000 gb + + * NEWS: + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapicompat.h: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.h: + * gst-libs/gst/vaapi/gstvaapiimageformat.h: + * gst-libs/gst/vaapi/gstvaapiparamspecs.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + * pkgconfig/gstreamer-vaapi-x11.pc.in: + * pkgconfig/gstreamer-vaapi.pc.in: + * sys/vaapiconvert/Makefile.am: + * sys/vaapisink/Makefile.am: + * tests/Makefile.am: + Add compatibility with the original VA-API 0.29. + +2010-03-24 15:18:33 +0000 gb + + * gst-libs/gst/vaapi/gstvaapivalue.h: + Add missing file (gstvaapivalue.h). + +2010-03-24 15:12:56 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + Fix g_warning() invocation. + +2010-03-24 15:11:26 +0000 gb + + * gst-libs/gst/vaapi/gstvaapisurface.c: + Deassociate subpictures while destroying the surface. + +2010-03-24 14:57:33 +0000 gb + + * gst-libs/gst/vaapi/gstvaapisurface.c: + Fix destruction order of subpictures. They should be destroyed first. + +2010-03-24 14:46:33 +0000 gb + + * NEWS: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.h: + * tests/test-windows.c: + Add support for AYUV format. + +2010-03-24 14:36:39 +0000 gb + + * tests/test-windows.c: + Simplify upload process and fallback to subpictures. + +2010-03-24 13:44:01 +0000 gb + + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapiparamspecs.c: + Fix documentation. + +2010-03-24 13:37:38 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapiparamspecs.c: + * gst-libs/gst/vaapi/gstvaapitypes.c: + * gst-libs/gst/vaapi/gstvaapitypes.h: + * gst-libs/gst/vaapi/gstvaapivalue.c: + Move GValue specific stuff to a dedicated file. + +2010-03-24 13:22:25 +0000 gb + + * tests/test-surfaces.c: + Cosmetics (lowercase for consistency). + +2010-03-24 13:21:54 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiobject.c: + Cosmetics (vertical alignment). + +2010-03-24 13:20:34 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiobject.c: + Fix return value on error. + +2010-03-24 13:19:58 +0000 gb + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapiobject.h: + * gst-libs/gst/vaapi/gstvaapiobject_priv.h: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.h: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * tests/test-surfaces.c: + Move "id" down to the GstVaapiObject base. + +2010-03-24 12:59:22 +0000 gb + + * gst-libs/gst/vaapi/gstvaapitypes.c: + Cosmetics (drop extraneous empty line). + +2010-03-24 12:57:54 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiparamspecs.c: + * gst-libs/gst/vaapi/gstvaapiparamspecs.h: + Add GParamSpecs for GstVaapiID. + +2010-03-24 12:54:52 +0000 gb + + * docs/reference/libs/libs.types: + Drop gst_vaapi_id_get_type(). + +2010-03-24 12:38:40 +0000 gb + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapitypes.h: + Add GST_VAAPI_ID_FORMAT() and GST_VAAPI_ID_ARGS() helpers. + +2010-03-24 09:52:43 +0000 gb + + * docs/reference/libs/libs-sections.txt: + * docs/reference/libs/libs.types: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapitypes.c: + * gst-libs/gst/vaapi/gstvaapitypes.h: + Add GstVaapiID abstraction. + +2010-03-24 09:22:00 +0000 gb + + * docs/reference/libs/libs.types: + Sort types. + +2010-03-24 08:35:27 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + Drop useless include (). + +2010-03-24 08:34:11 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiobject_priv.h: + Optimize GST_VAAPI_OBJECT_GET_DISPLAY to avoid a run-time check. + +2010-03-24 08:32:12 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapiobject.h: + * gst-libs/gst/vaapi/gstvaapiobject_priv.h: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Move private definitions and accessors to gstvaapiobject_priv.h. + +2010-03-24 08:16:32 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideopool.c: + * gst-libs/gst/vaapi/gstvaapivideosink.c: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Fix short descriptions. + +2010-03-23 18:45:09 +0000 gb + + * Makefile.am: + * configure.ac: + * debian.upstream/Makefile.am: + * debian.upstream/changelog.in: + * debian.upstream/compat: + * debian.upstream/control.in: + * debian.upstream/copyright: + * debian.upstream/gstreamer-vaapi-doc.install.in: + * debian.upstream/gstreamer-vaapi.install.in: + * debian.upstream/libgstvaapi-dev.install.in: + * debian.upstream/libgstvaapi-x11.install.in: + * debian.upstream/libgstvaapi.install.in: + * debian.upstream/rules: + * debian/Makefile.am: + * debian/changelog.in: + * debian/compat: + * debian/control.in: + * debian/copyright: + * debian/gstreamer-vaapi-doc.install.in: + * debian/gstreamer-vaapi.install.in: + * debian/libgstvaapi-dev.install.in: + * debian/libgstvaapi-x11.install.in: + * debian/libgstvaapi.install.in: + * debian/rules: + Generate upstream packages through make deb.upstream. + +2010-03-23 17:40:03 +0000 gb + + * configure.ac: + Bump version for development. + +2010-03-23 17:29:47 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiutils_x11.c: + Use a black background for new windows. + +2010-03-23 17:18:35 +0000 gb + + * NEWS: + 0.1.1. + +2010-03-23 17:12:40 +0000 gb + + * configure.ac: + * docs/reference/libs/libs.types: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapimarshal.list: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapiobject.h: + * tests/test-surfaces.c: + Add "destroy" signal. + +2010-03-23 16:25:20 +0000 gb + + * docs/reference/libs/libs-docs.xml.in: + Improve gst-plugins-vaapi Library reference template. + +2010-03-23 16:21:28 +0000 gb + + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapiobject.c: + * gst-libs/gst/vaapi/gstvaapiobject.h: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.h: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Make GstVaapi{Surface,Image,Subpicture} derive from a GstVaapiObject. + +2010-03-23 16:11:21 +0000 gb + + * sys/vaapisink/gstvaapisink.c: + Fix return value. + +2010-03-23 15:34:51 +0000 gb + + * sys/vaapisink/gstvaapisink.c: + Make sure VA display is valid when created with an explicit "display" name. + +2010-03-23 15:28:50 +0000 gb + + * sys/vaapisink/gstvaapisink.c: + Use plain "display" property for the X11 display name. + +2010-03-23 15:22:47 +0000 gb + + * sys/vaapiconvert/gstvaapiconvert.c: + * sys/vaapisink/gstvaapisink.c: + Document vaapiconvert & vaapisink plugins. + +2010-03-23 14:19:21 +0000 gb + + * configure.ac: + * docs/reference/Makefile.am: + * docs/reference/plugins/Makefile.am: + * docs/reference/plugins/plugins-docs.xml.in: + * docs/reference/plugins/plugins-overrides.txt: + * docs/reference/plugins/plugins-sections.txt: + * docs/reference/plugins/plugins.types: + Add plugins documentation template. + +2010-03-23 14:06:42 +0000 gb + + * sys/vaapisink/gstvaapisink.c: + * sys/vaapisink/gstvaapisink.h: + Don't export gst_vaapisink_get_display(). + +2010-03-23 13:32:36 +0000 gb + + * configure.ac: + * docs/reference/libs/libs-docs.xml.in: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + Drop introspection annotations since they require gtk-doc >= 1.12. + +2010-03-23 10:51:35 +0000 gb + + * gst-libs/gst/vaapi/gstvaapisurface.c: + Add note about the fact that the surface holds an extra reference to the subpicture. + +2010-03-23 10:49:33 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + Improve debugging messages. + +2010-03-23 10:48:58 +0000 gb + + * tests/test-windows.c: + Unref subpicture earlier as the surface is supposed to hold a reference to it. + +2010-03-23 10:36:20 +0000 gb + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * tests/test-windows.c: + Add gst_vaapi_surface_{,de}associate_subpicture() API. + +2010-03-23 08:13:37 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Wait for MapNotify or UnmapNotify events on foreign windows too. + +2010-03-23 07:42:05 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Check whether the foreign XID is mapped at binding time. + +2010-03-23 07:34:15 +0000 gb + + * sys/vaapisink/gstvaapisink.c: + Add missing includes. + +2010-03-23 07:31:04 +0000 gb + + * configure.ac: + * debian/Makefile.am: + * debian/control.in: + * debian/gstreamer-vaapi-doc.install.in: + * debian/rules: + Add -doc package. + +2010-03-23 06:41:29 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Fix warnings (drop extraneous var). + +2010-03-23 06:40:27 +0000 gb + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.h: + Add GST_VAAPI_WINDOW_XWINDOW() helper macro. + +2010-03-22 16:59:29 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiwindow.c: + Shorten condition. + +2010-03-22 16:57:20 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_priv.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Try to improve switch to fullscreen mode. + +2010-03-22 16:01:34 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiutils_x11.c: + * gst-libs/gst/vaapi/gstvaapiutils_x11.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Improve display locking and rework X event wait functions. + +2010-03-22 13:06:41 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow_priv.h: + Move _GstVaapiWindowPrivate declaration to gstvaapiwindow_priv.h. + +2010-03-22 13:05:05 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow_priv.h: + Add private API to set window size & fullscreen modes without triggering any notification or virtual functions. This is useful for derived class to fix up sizes whenever appropriate. + +2010-03-22 12:47:13 +0000 gb + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + Add gst_vaapi_window_get_fullscreen() helper and "fullscreen" property. + +2010-03-22 12:39:02 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Add gst_vaapi_window_get_display() to base. + +2010-03-22 12:16:47 +0000 gb + + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapitypes.h: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * sys/vaapisink/gstvaapisink.c: + * sys/vaapisink/gstvaapisink.h: + Add GstVaapiPoint & GstVaapiRectangle data structures. + +2010-03-22 12:05:11 +0000 gb + + * NEWS: + 0.1.1. + +2010-03-22 12:03:26 +0000 gb + + * NEWS: + * sys/vaapisink/gstvaapisink.c: + * sys/vaapisink/gstvaapisink.h: + Allow `vaapisink` to render videos in fullscreen mode. + +2010-03-22 10:51:49 +0000 gb + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Add gst_vaapi_window_set_fullscreen() API. + +2010-03-22 10:03:24 +0000 gb + + * sys/vaapisink/gstvaapisink.c: + Size window so that to respect the video and pixel aspect ratio. + +2010-03-22 09:32:01 +0000 gb + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * tests/test-display.c: + Add gst_vaapi_display_get_pixel_aspect_ratio(). + +2010-03-22 08:45:03 +0000 gb + + * docs/reference/libs/libs-sections.txt: + Updates. + +2010-03-22 08:44:38 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * tests/test-display.c: + Add display size accessors. + +2010-03-22 08:03:12 +0000 gb + + * configure.ac: + * debian/control.in: + Build-Requires: gstreamer-plugins-base >= 0.10.16. + +2010-03-21 08:45:09 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.h: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapiimagepool.h: + * gst-libs/gst/vaapi/gstvaapisubpicture.h: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapisurfacepool.h: + * gst-libs/gst/vaapi/gstvaapivideobuffer.h: + * gst-libs/gst/vaapi/gstvaapivideopool.h: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.h: + Fix documentation of *Class'es. + +2010-03-21 08:38:17 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Move GstVaapiSurfaceRenderFlags conversion to get_PutSurface_flags_from_GstVaapiSurfaceRenderFlags(). + +2010-03-21 08:22:46 +0000 gb + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + Move GstVaapiSurfaceRenderFlags to gstvaapisurface.h since this will also be useful for e.g. a gstvaapitexture.h. + +2010-03-21 08:12:52 +0000 gb + + * docs/reference/libs/libs-sections.txt: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * sys/vaapisink/gstvaapisink.c: + * tests/test-windows.c: + Rename gst_vaapi_window_put_surface_full() to plain gst_vaapi_window_put_surface(). + +2010-03-19 17:15:16 +0000 gb + + * docs/reference/libs/Makefile.am: + Fix make dist for --enable-gtk-doc builds. + +2010-03-19 17:13:59 +0000 gb + + * autogen.sh: + Improve autogen.sh. + +2010-03-19 17:11:20 +0000 gb + + * Makefile.am: + * autogen.sh: + Generate gtk-doc.make from gtkdocize. + +2010-03-19 17:04:51 +0000 gb + + * Makefile.am: + * NEWS: + * configure.ac: + * docs/Makefile.am: + * docs/reference/Makefile.am: + * docs/reference/libs/Makefile.am: + * docs/reference/libs/libs-docs.xml.in: + * docs/reference/libs/libs-overrides.txt: + * docs/reference/libs/libs-sections.txt: + * docs/reference/libs/libs.types: + Document public API for libgstvaapi-*.so.*. + +2010-03-19 16:41:52 +0000 gb + + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.h: + Document GstVaapiVideoBuffer. + +2010-03-19 16:08:48 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + * gst-libs/gst/vaapi/gstvaapiimagepool.h: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.h: + * gst-libs/gst/vaapi/gstvaapivideopool.c: + * gst-libs/gst/vaapi/gstvaapivideopool.h: + Document surface & image pools. Drop obsolete gst_vaapi_video_pool_new() function. + +2010-03-19 15:45:21 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.h: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.h: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.h: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + * gst-libs/gst/vaapi/gstvaapivideosink.c: + * gst-libs/gst/vaapi/gstvaapivideosink.h: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.h: + Add tedious documentation. + +2010-03-19 10:42:11 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + Beautify append_formats(). + +2010-03-19 10:38:45 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + Simplify GstVaapiDisplay (use GArray). + +2010-03-19 08:42:51 +0000 gb + + * NEWS: + * sys/vaapiconvert/gstvaapiconvert.c: + * sys/vaapiconvert/gstvaapiconvert.h: + Factor out direct-rendering infrastructure. + +2010-03-18 16:18:17 +0000 gb + + * sys/vaapiconvert/gstvaapiconvert.c: + * sys/vaapiconvert/gstvaapiconvert.h: + Allow user to specify inout-buffers & derive-image optimizations. + +2010-03-18 15:58:28 +0000 gb + + * sys/vaapiconvert/gstvaapiconvert.c: + Reduce number of debug messaged printed out. + +2010-03-18 15:53:50 +0000 gb + + * sys/vaapiconvert/gstvaapiconvert.c: + * sys/vaapiconvert/gstvaapiconvert.h: + Add vaDeriveImage() optimization. + +2010-03-18 15:52:20 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimage.c: + Fix gst_vaapi_image_create() from a foreign VA image. + +2010-03-18 15:28:59 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + Add gst_vaapi_surface_derive_image() API. + +2010-03-18 13:49:50 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Make it possible to bin an X11 window to GstVaapiWindowX11 with plain g_object_new() and "xid" property. i.e. get foreign window size in gst_vaapi_window_x11_create(). + +2010-03-18 13:08:17 +0000 gb + + * tests/test-windows.c: + Try YV12 & I420 image formats too. + +2010-03-18 12:59:55 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimage.c: + Split map/unmap functions into internal functions that don't check preconditions. + +2010-03-18 12:56:53 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimage.c: + Improve gst_vaapi_image_new() sanity checks. + +2010-03-18 12:52:58 +0000 gb + + * tests/test-windows.c: + Fix typo. + +2010-03-18 08:45:57 +0000 gb + + * sys/vaapiconvert/gstvaapiconvert.c: + Check if our inout buffer is still alive or default to a separate output buffer. + +2010-03-18 08:16:59 +0000 gb + + * sys/vaapiconvert/gstvaapiconvert.c: + * sys/vaapiconvert/gstvaapiconvert.h: + Factor out buffers negotiation and optimization checks. + +2010-03-18 08:02:25 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiutils_x11.c: + * gst-libs/gst/vaapi/gstvaapiutils_x11.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * sys/vaapiconvert/gstvaapiconvert.h: + Use gtypes. + +2010-03-17 10:43:02 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimage.c: + Optimize gst_vaapi_image_is_linear() and simplify gst_vaapi_image_update_from_buffer(). + +2010-03-17 07:59:31 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Add VA display locking utilities. + +2010-03-17 07:20:19 +0000 gb + + * sys/vaapisink/gstvaapisink.c: + Initialize the X window in a ::set_caps() handler. Also fix build with GStreamer < 0.10.25. i.e. use preroll/render hooks. + +2010-03-17 07:17:17 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * tests/test-windows.c: + Don't show window by default during creation. + +2010-03-17 06:49:27 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Fix gst_vaapi_window_x11_destroy(). + +2010-03-16 17:57:57 +0000 gb + + * sys/vaapiconvert/gstvaapiconvert.c: + * sys/vaapiconvert/gstvaapiconvert.h: + Alias sink & src pad buffers whenever possible. + +2010-03-16 17:57:23 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + Extend GstVaapiImage API with *_get_image(), *_is_linear(), *_get_data_size(). + +2010-03-16 17:10:02 +0000 gb + + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.h: + Make GstVaapiVideoBuffer handle two pools. i.e. both image & surface at the same time. + +2010-03-16 14:37:47 +0000 gb + + * sys/vaapiconvert/gstvaapiconvert.c: + Fix image & surface size cache. + +2010-03-16 14:12:40 +0000 gb + + * configure.ac: + Move gstreamer-vaapi package versioning to the top. + +2010-03-16 14:11:46 +0000 gb + + * configure.ac: + Bump version for development. + +2010-03-16 14:07:53 +0000 gb + + * configure.ac: + Cosmetics (shorten lines). + +2010-03-16 13:58:43 +0000 gb + + * NEWS: + * README: + Update docs. + +2010-03-16 13:53:54 +0000 gb + + * debian/Makefile.am: + * debian/changelog.in: + * debian/compat: + * debian/control.in: + * debian/copyright: + * debian/gstreamer-vaapi.install.in: + * debian/libgstvaapi-dev.install.in: + * debian/libgstvaapi-x11.install.in: + * debian/libgstvaapi.install.in: + * debian/rules: + Add debian packaging. + +2010-03-16 13:53:09 +0000 gb + + * Makefile.am: + * configure.ac: + Add debian packaging. + +2010-03-16 10:13:36 +0000 gb + + * pkgconfig/Makefile.am: + Silence GNU make extensions warning. + +2010-03-16 09:59:03 +0000 gb + + * configure.ac: + Add AM_PROG_CC_C_O, thus fixing this warning: tests/Makefile.am:16: compiling `test-display.c' with per-target flags requires `AM_PROG_CC_C_O' in `configure.ac' + +2010-03-16 09:57:25 +0000 gb + + * Makefile.am: + * configure.ac: + * pkgconfig/Makefile.am: + * pkgconfig/gstreamer-vaapi-x11.pc.in: + * pkgconfig/gstreamer-vaapi.pc.in: + Add pkgconfig files. + +2010-03-16 09:39:07 +0000 gb + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + * sys/vaapisink/Makefile.am: + * tests/Makefile.am: + Split X11 support to libgstvaapi-x11-*.so.* + +2010-03-16 09:21:15 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + Don't install private headers. + +2010-03-16 09:18:57 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidebug.h: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + Fix header guards. + +2010-03-16 09:17:41 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidebug.h: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideopool.c: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * gst-libs/gst/vaapi/vaapi_debug.h: + Rename vaapi_debug.h to gstvaapidebug.h. + +2010-03-16 09:15:48 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapiutils.c: + * gst-libs/gst/vaapi/gstvaapiutils.h: + * gst-libs/gst/vaapi/vaapi_debug.h: + * gst-libs/gst/vaapi/vaapi_utils.c: + * gst-libs/gst/vaapi/vaapi_utils.h: + Move vaapi_utils.* to gstvaapiutils.* + +2010-03-16 09:13:16 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiutils_x11.h: + Cosmetics (remove an extra line). + +2010-03-16 09:12:47 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiutils_x11.c: + * gst-libs/gst/vaapi/gstvaapiutils_x11.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Move X11 utilties to gstvaapiutils_x11.[ch]. + +2010-03-16 09:03:10 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapisinkbase.c: + * gst-libs/gst/vaapi/gstvaapisinkbase.h: + * gst-libs/gst/vaapi/gstvaapivideosink.c: + * gst-libs/gst/vaapi/gstvaapivideosink.h: + * sys/vaapiconvert/gstvaapiconvert.c: + * sys/vaapisink/gstvaapisink.c: + Rename GstVaapiSinkBase to GstVaapiVideoSink. + +2010-03-16 08:49:16 +0000 gb + + * configure.ac: + * tests/Makefile.am: + * tests/examples/Makefile.am: + * tests/examples/generic/Makefile.am: + * tests/examples/generic/test-display.c: + * tests/examples/generic/test-surfaces.c: + * tests/examples/generic/test-windows.c: + * tests/test-display.c: + * tests/test-surfaces.c: + * tests/test-windows.c: + Move tests to top-level tests/ directory. + +2010-03-16 08:43:16 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * sys/vaapiconvert/gstvaapiconvert.c: + * sys/vaapiconvert/gstvaapiconvert.h: + Handle I420 formats internally in GstVaapiImage. + +2010-03-15 17:44:35 +0000 gb + + * sys/vaapiconvert/gstvaapiconvert.c: + * sys/vaapiconvert/gstvaapiconvert.h: + Implement I420 (resp. YV12) with YV12 (resp. I420) if the driver does not. + +2010-03-15 17:43:29 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimage.c: + Implement I420 and YV12 if the underlying implementation does not. + +2010-03-15 17:10:56 +0000 gb + + * sys/vaapiconvert/Makefile.am: + * sys/vaapiconvert/gstvaapiconvert.c: + * sys/vaapiconvert/gstvaapiconvert.h: + Add initial vaapiconvert plugin. + +2010-03-15 17:09:12 +0000 gb + + * sys/vaapisink/gstvaapisink.c: + * sys/vaapisink/gstvaapisink.h: + Display frames. + +2010-03-15 16:57:37 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + Factor out. + +2010-03-15 16:57:01 +0000 gb + + * tests/examples/generic/test-windows.c: + Generate R/G/B rects. + +2010-03-15 16:13:51 +0000 gb + + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + Add gst_vaapi_surface_sync(). + +2010-03-15 16:13:37 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimage.c: + Cosmetics (reverse args order). + +2010-03-15 15:55:20 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapisurface.c: + Cosmetics. + +2010-03-15 15:12:27 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiwindow.c: + * gst-libs/gst/vaapi/gstvaapiwindow.h: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.c: + * gst-libs/gst/vaapi/gstvaapiwindow_x11.h: + * tests/examples/generic/Makefile.am: + * tests/examples/generic/test-windows.c: + Add VA/X11 window abstraction. + +2010-03-15 14:57:57 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.h: + Add VA and X11 display accessors. + +2010-03-15 14:57:30 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimage.c: + Fix preconditions. + +2010-03-15 13:32:37 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + Cosmetics. + +2010-03-15 11:49:03 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + Add gst_vaapi_{get,put}_image() API. + +2010-03-15 10:27:10 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + Add gst_vaapi_image_update_from_buffer() helper. + +2010-03-12 23:53:48 +0000 gb + + * sys/vaapisink/Makefile.am: + * sys/vaapisink/gstvaapisink.c: + * sys/vaapisink/gstvaapisink.h: + Implement GstVaapiSinkBase interface and integrate with GST_DEBUG better. + +2010-03-12 23:50:09 +0000 gb + + * tests/examples/generic/Makefile.am: + * tests/examples/generic/test-surfaces.c: + Add surface tests. + +2010-03-12 23:48:50 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapivideobuffer.c: + * gst-libs/gst/vaapi/gstvaapivideobuffer.h: + Add basic GstVaapiVideoBuffer. + +2010-03-12 23:47:47 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiimagepool.c: + * gst-libs/gst/vaapi/gstvaapiimagepool.h: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.h: + * gst-libs/gst/vaapi/gstvaapivideopool.c: + * gst-libs/gst/vaapi/gstvaapivideopool.h: + Add GstVaapiImagePool and factor out GstVaapiSurfacePool from a base GstVaapiVideoPool. + +2010-03-12 22:32:35 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + Simplify format conversion code. + +2010-03-12 22:28:01 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.h: + Add gst_vaapi_image_format_from_caps() helper. + +2010-03-12 17:45:18 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapisurfacepool.c: + * gst-libs/gst/vaapi/gstvaapisurfacepool.h: + Add VA surface pool (lazy allocator). + +2010-03-12 17:39:11 +0000 gb + + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + Add gst_vaapi_surface_get_size() helper. + +2010-03-12 10:52:08 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + Avoid use of GstStaticCaps since older gstreamer versions (0.10.22) write to it. + +2010-03-11 15:35:43 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + Reset display-name if the user provided his own X11 display. + +2010-03-11 15:21:43 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.h: + * tests/examples/generic/test-display.c: + Add gst_vaapi_display_x11_new_with_display() API. + +2010-03-11 15:04:18 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay_x11.h: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapisubpicture.h: + * gst-libs/gst/vaapi/gstvaapisurface.h: + Fix *_GET_CLASS() definitions... + +2010-03-11 15:01:00 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.h: + * tests/examples/generic/test-display.c: + API change: gst_vaapi_display_x11_new() now takes an X11 display name. + +2010-03-11 13:58:32 +0000 gb + + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + Use GstVaapiChromaType abstraction. + +2010-03-11 12:30:12 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + New refcounting policy. All getters return a reference, not a copy. So the user shall reference the object itself, should he wish so. + +2010-03-11 12:14:10 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + Don't warn on failure, just return an appropriate error or value. + +2010-03-11 12:11:36 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.h: + Filter out any format that is not supported by the library (libgstvaapi). Also sort the formats by HW preference. + +2010-03-11 10:50:27 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapisinkbase.c: + * gst-libs/gst/vaapi/gstvaapisinkbase.h: + Add helper interface that all VA-API sinks must implement. e.g. vaapisink. + +2010-03-10 13:13:51 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/vaapi_debug.h: + Use GST_DEBUG. + +2010-03-10 13:10:59 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + Fix GstVaapiImage and GstVaapiSubpicture initialization. + +2010-03-10 13:02:45 +0000 gb + + * gst-libs/gst/vaapi/gstvaapisurface.c: + Fix GstVaapiSurface initialization, override constructed() method, not constructor(). GObject C is awful... + +2010-03-10 12:25:38 +0000 gb + + * tests/examples/generic/test-display.c: + Dump caps. + +2010-03-10 12:25:19 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + Fix GstVaapiDisplay initialization. + +2010-03-10 10:43:31 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + Get VA image & subpicture formats as GstCaps. + +2010-03-10 10:41:12 +0000 gb + + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.h: + Add helper to convert from GstVaapiImageFormat to GstCaps. + +2010-03-09 12:00:32 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapisurface.c: + Cosmetics (drop unused variables). + +2010-03-05 17:11:52 +0000 gb + + * configure.ac: + * sys/vaapiconvert/Makefile.am: + * sys/vaapiconvert/gstvaapiconvert.c: + * sys/vaapiconvert/gstvaapiconvert.h: + * sys/vaapisink/Makefile.am: + * sys/vaapisink/gstvaapisink.c: + * sys/vaapisink/gstvaapisink.h: + Add boilerplate for vaapiconvert and vaapisink elements. + +2010-03-05 15:29:04 +0000 gb + + * configure.ac: + * sys/Makefile.am: + * sys/vaapiconvert/Makefile.am: + Add vaapiconvert element hierarchy. + +2010-03-05 15:26:36 +0000 gb + + * sys/vaapi/Makefile.am: + * sys/vaapisink/Makefile.am: + Rename to vaapisink. + +2010-03-05 10:07:22 +0000 gb + + * gst-libs/gst/vaapi/gstvaapisurface.c: + Shorter code (and more correct). + +2010-03-05 10:04:55 +0000 gb + + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + Add helper to get GstVaapiDisplay from a surface. + +2010-03-05 08:52:20 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + Fix subpicture formats list length. + +2010-03-04 17:41:34 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + Add utilities to check whether a VA-API driver supports specific image or subpicture format. Likewise for VA profile. + +2010-03-04 17:40:47 +0000 gb + + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.h: + Cosmetics (more checks, includes). + +2010-03-04 17:39:58 +0000 gb + + * gst-libs/gst/vaapi/gstvaapisubpicture.c: + * gst-libs/gst/vaapi/gstvaapisubpicture.h: + Really add VA subpicture abstraction. + +2010-03-04 17:39:01 +0000 gb + + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapiimage.c: + * gst-libs/gst/vaapi/gstvaapiimage.h: + * gst-libs/gst/vaapi/gstvaapiimageformat.c: + * gst-libs/gst/vaapi/gstvaapiimageformat.h: + * gst-libs/gst/vaapi/gstvaapisurface.c: + * gst-libs/gst/vaapi/gstvaapisurface.h: + Add VA surface, image, subpicture abstractions. Ported over from Gnash. + +2010-01-25 16:15:01 +0000 gb + + * configure.ac: + * gst-libs/gst/vaapi/Makefile.am: + * gst-libs/gst/vaapi/gstvaapidisplay.c: + * gst-libs/gst/vaapi/gstvaapidisplay.h: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.c: + * gst-libs/gst/vaapi/gstvaapidisplay_x11.h: + * gst-libs/gst/vaapi/vaapi_debug.h: + * gst-libs/gst/vaapi/vaapi_utils.c: + * gst-libs/gst/vaapi/vaapi_utils.h: + * tests/examples/generic/Makefile.am: + * tests/examples/generic/test-display.c: + Add initial VA display abstraction. + +2010-01-25 15:04:10 +0000 gb + + * Makefile.am: + * configure.ac: + * tests/Makefile.am: + * tests/examples/Makefile.am: + * tests/examples/generic/Makefile.am: + Add tests infrastructure. + +2010-01-25 14:59:37 +0000 gb + + * configure.ac: + Clean up VA-API checks. + +2010-01-25 13:49:55 +0000 gb + + * configure.ac: + Check for __attribute__((visibility("hidden"))). + diff -Nru gstreamer-vaapi-0.7.0/common/ChangeLog gstreamer-vaapi-1.8.2/common/ChangeLog --- gstreamer-vaapi-0.7.0/common/ChangeLog 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/ChangeLog 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,1712 @@ +2008-12-17 Edward Hervey + + * gst.supp: + And yet another variation of the GstAudioFilter leak. + +2008-12-15 Sebastian Dröge + + Patch by: Roland Illig + + * m4/gst-parser.m4: + Fix AG_GST_BISON_CHECK to handle version numbers with more than + two components (i.e. 2.4.1). Fixes bug #564507. + +2008-12-14 Edward Hervey + + * gst.supp: + And yet another variant of the GstAudioFilter leak. + +2008-12-13 Edward Hervey + + * gst.supp: + Added variants of leaks of dynamic pad templates created in + GstAudioFilter. + Add conditional jump triggered by getaddrinfo (maybe glibc-2.9). + +2008-12-12 Edward Hervey + + * gst.supp: + Fix leak in GIO called by gnomevfs. Nothing we can do about this. + +2008-12-12 Edward Hervey + + * gst.supp: + Added another suppression for dynamic pad templates, in this case + GstAudioFilter. + Added suppression for PangoLanguage which can never be freed + according to the Pango API. + +2008-12-12 Edward Hervey + + * gst.supp: + A whole bunch of suppressions detected on latest gentoo ~amd64. + Make some existing suppressions more generic (for subtle dependecy + code changes). + Added suppressions for glibc-2.9. + Added suppressions for new variants of ALSA leaks. + Added suppressions for a series of leaks in plugins registrations due + to some pad templates' caps calculated at runtime. + Added suppressions for variants of some leaks in pango/fontconfig. + Added suppressions for leak in gstffmpegcsp.c (nothing we can do + about it, but will only exist once). + +2008-12-04 Sebastian Dröge + + * m4/gst-plugin-docs.m4: + Remove the check if $have_gtk_doc equals yes as it's not defined + and $enable_gtk_doc should be good enough. + Also this restores the build of the plugin documentation. + +2008-12-01 Mark Nauwelaerts + + * gst.supp: + Add suppression variant for Ubuntu Hardy x86/64bit. + +2008-12-01 Stefan Kost + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + Simplily uninstall rule. Its closer to upstream and fixes #150331. + +2008-11-29 Sebastian Dröge + + * m4/glib-gettext.m4: + Update glib-gettext.m4 from latest stable GLib release. + +2008-11-29 Sebastian Dröge + + Patch by: Cygwin Ports maintainer + + + * gettext.patch: + Update the gettext patch for use with gettext 0.17 which is + required to build with libtool 2.2 because of conflicts. + First part of bug #556091. + +2008-11-29 Sebastian Dröge + + * m4/gtk-doc.m4: + * m4/pkg.m4: + Update gtk-doc and pkg-config m4 macros from their latest releases. + +2008-11-20 Michael Smith + + * m4/as-objc.m4: + Fix objective C test macro when none of the compilers are found at all. + +2008-10-30 Stefan Kost + + * gtk-doc.mak: + Also cp the entities here to all xinlcude based docs (workaround for + not being able to set up a search path). + +2008-10-17 Jan Schmidt + + * gtk-doc.mak: + Don't clobber the real registry cache file when + building docs. + +2008-10-07 Jan Schmidt - Sun Microsystems + + * m4/gst-error.m4: + Also disable the bogus "loop not entered at top" warnings appearing on Sparc Forte builds. + +2008-10-06 Stefan Kost + + * gtk-doc.mak: + Apply the same fix as below to gtk-doc.mak. Somehow did not end up in + CVS. + +2008-09-05 David Schleef + + * gtk-doc-plugins.mak: Fix the check for gtkdoc-rebase: don't + pass the 'which' error back to make. This fix is more specific + than what is in upstream. + +2008-09-05 David Schleef + + * gtk-doc.mak: Fix the check for gtkdoc-rebase: don't pass the + 'which' error back to make. This fix is more specific than + what is in upstream. + +2008-09-04 Stefan Kost + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + Get closer to upstream makefiles. Don't install index.sgml twice. Call + gtkdoc-rebase (if exists). + +2008-08-21 Stefan Kost + + * gtk-doc-plugins.mak: + Revert $(top_builddir) -> $(builddir) change of rev. 1.39 as there is + no variable called builddir. + +2008-07-31 Mark Nauwelaerts + + * gst.supp: + Add suppressions for Ubunty Hardy x86/64bit, similar to earlier + versions and 32bit variant. + +2008-07-31 Sebastian Dröge + + * m4/gst-feature.m4: + Remove GST_DISABLE_(ENUMTYPES|INDEX|URI). + +2008-07-21 Tim-Philipp Müller + + * m4/gst-error.m4:: + When checking for GST_ERROR_CXXFLAGS, check each compiler flag + individually, not all together. + +2008-07-20 Tim-Philipp Müller + + * m4/gst-parser.m4:: + Fix bison version number detection for older --version + output format (as bison 1.28 on OSX 10.4 outputs). + Fixes #543853. + +2008-07-12 Stefan Kost + + * plugins.xsl: + Split refsect2 also here to make "Element Pads" subtitle visible. + +2008-07-08 Sebastian Dröge + + * m4/gst-error.m4: + Add compiler flags to warn if declarations after statements or + variable length arrays are used. These are C99/GCC extensions and + are not supported by some compilers we want to support. + +2008-07-02 Mark Nauwelaerts + + * gtk-doc-plugins.mak: + Only clean doc maintainer stamps in maintainer-clean. Fixes #539977. + +2008-06-20 Sebastian Dröge + + * gstdoc-scangobj: + Always use format strings for printf-like functions, even if they just + print a string. Fixes bug #536981. + +2008-06-20 Sebastian Dröge + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + Include CFLAGS and LDFLAGS in GTKDOC_CFLAGS and GTKDOC_LDFLAGS, + otherwise the values passed to configure are ignored. + Fixes bug #536978. + +2008-06-05 Tim-Philipp Müller + + * m4/gst-error.m4: + Add -fno-strict-aliasing when compiling with -Werror, to work around + warnings caused by G_LOCK with recent GLib versions (2.16.x) (#316221). + +2008-06-05 Jan Schmidt + + * gtk-doc.mak: + Don't copy html/*.png files unless they don't already exist + in the destdir. Fixes distcheck failure caused by permissions + problems trying to copy a file into the destdir when it already + exists. + +2008-05-28 Stefan Kost + + * plugins.xsl: + The class was not shown in plugin docs. Fix typo in changelog below. + +2008-05-22 Jan Schmidt + + * gstdoc-scangobj: + Emit warnings if one of the GTypes we're expecting is 0 + when scanning. + +2008-05-21 Felipe Contreras + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + Fix installing png images when gtk-doc is disabled. + +2008-05-21 Felipe Contreras + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + Fix make clean when gtk-doc is disabled and other cleanups. + +2008-05-17 Jan Schmidt + + * gtk-doc-plugins.mak: + Be more quiet when the files don't yet exist. + +2008-05-16 Jan Schmidt + + * gstdoc-scangobj: + Add a mechanism for adding 'implicitly created' GTypes into the + scan, allowing for documenting plugin-private base classes that + provide signals or properties for public elements. + + * gtk-doc-plugins.mak: + Use $(builddir) instead of $(top_builddir) in a few places - there's + no need to hard code 'docs/plugins' as the only useable path. + +2008-05-14 Peter Kjellerstedt + + * m4/gst-feature.m4: + Report plug-ins without external dependencies that will not be built + even when the name of the plug-in is a substring of another plug-in, + e.g., goom vs. goom2k1. + +2008-05-14 Tim-Philipp Müller + + * gst.supp: + Add suppression for glibc bug on gutsy/x86-64 + +2008-05-12 Stefan Kost + + * plugins.xsl: + Improve the layout of the caps, but splitting them on ";". + +2008-05-09 Sebastian Dröge + + Patch by: Brian Cameron + + * m4/gst-default.m4: + Don't set the default audio sink to the default visualizer. + Fixes bug #532295. + +2008-05-07 Tim-Philipp Müller + + * check.mak: (help): + Document GST_CHECKS environment variable in checks 'make help'. + +2008-05-06 Sebastian Dröge + + Patch by: Marc-Andre Lureau + + * scangobj-merge.py: + Don't depend on Twisted just for the OrderedDict but implement our + own ordered dictionary class. Fixes bug #531577. + +2008-04-23 Edward Hervey + + * gst.supp: + Re-arrange latest suppressions. + Add all known suppressions for ubuntu hardy. Same as for older + ubuntus, but with different codepaths. + +2008-04-22 Edward Hervey + + * gst.supp: Make tls leak suppression a bit more generic. + +2008-04-22 Edward Hervey + + * gst.supp: Fix ommission in latest commit. + Make tls leak suppression more generic in order to cover more + distributions (and hopefully also future distributions). + +2008-04-22 Edward Hervey + + * gst.supp: Add suppressions for Hardy. + They're just the newer versions of similar suppressions we had + for the previous versions of ubuntu. + +2008-04-15 Sebastian Dröge + + * Makefile.am: + * m4/Makefile.am: + Dist all files in common. Fixes bug #527984. + +2008-04-14 Tim-Philipp Müller + + * m4/gst-function.m4: + Rename AC_CACHE_VAL cache-ids to contain '_cv_' in order to make + autoconf-2.62 complain less. + +2008-04-13 Tim-Philipp Müller + + * m4/gst-args.m4: + * m4/gst-valgrind.m4: + Bump valgrind requirement to 3.0 (which was released in August 2005). + Fixes #489269. Also, check for version >=REQ and not >REQ. + +2008-04-09 Tim-Philipp Müller + + * m4/gst-default.m4: + Add --with-default-{audiosink|audiosrc|videosink|videosrc|visualizer} + configure switches (#519417). + +2008-04-03 Tim-Philipp Müller + + * m4/gst-args.m4: + Add --disable-foo switch for dependency-less plugins (#525586). + +2008-04-01 Sebastian Dröge + + * m4/gst-parser.m4: + Unconditionally require flex 2.5.31 and bison 1.875. + +2008-03-23 Sebastian Dröge + + * m4/gst-arch.m4: + amd64/x86_64 allows unaligned memory access too. + +2008-03-21 Sebastian Dröge + + * m4/gst-dowhile.m4: + Add macro that checks if the compiler supports do {} while (0) + macros and define HAVE_DOWHILE_MACROS if it does. This is + needed by glib/gmacros.h to use something else than + if (1) else for G_STMT_START/END when compling C++, which + causes compiler warnings because of ambigious else with g++ 4.3. + +2008-03-21 Sebastian Dröge + + * m4/gst-plugin-docs.m4: + * mangle-tmpl.py: + Don't depend on PyXML and use only XML modules that are shipped + with python. Fixes bug #519635. + +2008-03-07 Edward Hervey + + * m4/gtk-doc.m4: (GTK_DOC_CHECK): + The previous commit to this file by Stefan Kost mentionned checking for + SED, but NOT checking for gtkdoc-check (wth is that doing there ??). + Therefore, removing the check for gtkdoc-check + +2008-03-03 David Schleef + + * m4/ax_create_stdint_h.m4: Oops, checked in the wrong copy of + this file. (Update from upstream) + +2008-03-03 David Schleef + + * m4/ax_create_stdint_h.m4: Update from upstream. Fixes a bug + compiling with MSVC. + +2008-03-03 Edward Hervey + + * m4/pkg.m4: + Allow override of pkg-config results, as proposed by configure --help. + This is in fact just a backport from upstream pkg.m4. + Fixes #518892 + +2008-03-03 Peter Kjellerstedt + + * ChangeLog: + Changelog surgery of my previous commit to add bugzilla reference. + * m4/gst-args.m4: + Add AG_GST_CHECK_PLUGIN and AG_GST_DISABLE_PLUGIN to make it easier + to include and exclude plug-ins without external references, i.e., + plug-ins listed in GST_PLUGINS_SELECTED. (#498222) + +2008-03-03 Sebastian Dröge + + * gst.supp: + Add another glibc suppression. + +2008-02-29 Peter Kjellerstedt + + * m4/gst-feature.m4: + Make the comment before defines generated via AG_GST_CHECK_FEATURE + look nicer. (#498222) + +2008-02-26 Jan Schmidt + + * m4/Makefile.am: + * m4/as-gcc-inline-assembly.m4: + Add Dave Schleef's GCC inline assembly detection macro + for using in gst-plugins-good in the goom 2k4 plugin. + +2008-02-25 Andy Wingo + + * gst-autogen.sh: Instead of only passing certain arguments to + configure, pass anything that we didn't handle. Much friendlier. + Fixes #34412. + +2008-02-23 Jan Schmidt + + * m4/gst-error.m4: + Store the detected compiler flags into ERROR_CFLAGS rather than + ERROR_CXXFLAGS, and use the macro that checks the C compiler, not + the C++ one. + +2008-02-23 Tim-Philipp Müller + + * m4/gst-error.m4: + Reflow checks for additional warning flags so they're not + nested, which fixes the result reporting in the configure + output. + +2008-02-22 Tim-Philipp Müller + + * m4/as-compiler-flag.m4: + Add AS_CXX_COMPILER_FLAG + + * m4/gst-error.m4: + Add AG_GST_SET_ERROR_CXXFLAGS (Forte bits need testing) + +2008-02-22 Tim-Philipp Müller + + * gtk-doc-plugins.mak: + Add 'check-inspected-versions' target; this helps identify + files that should have been removed or where the version + number should (ideally) be updated before a release + (which doesn't happen automatically if the releaser doesn't + build that plugin locally). Not adding at a distcheck hook + yet though, because it's not really that important and would + probably also be a problem on buildbots. + +2008-02-22 Sebastian Dröge + + * gst.supp: + Add even more glibc 2.7 suppressions. + +2008-02-22 Sebastian Dröge + + * gst.supp: + Add another suppression for GLib caching some values after + the first call. + +2008-02-12 Sebastian Dröge + + Patch by: + Tim Mooney + + * m4/gst-error.m4: + Use no%E_MACRO_REDEFINED on Solaris to prevent compiler warnings. + Fixes bug #515905. + +2008-02-11 Sebastian Dröge + + * gst.supp: + Add a few more glibc 2.7 suppressions to make the avisubtitle unit + test valgrind clean. Fixes bug #515703. + +2008-02-08 Stefan Kost + + * ChangeLog: + Changelog surgery for last commit. + +2008-02-08 Stefan Kost + + * m4/gtk-doc.m4: + Conditionally check for SED. Also sync a bit with upstream macro. + +2008-02-08 Stefan Kost + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + Use '$(SED)' instead of 'sed'. Don't use -i for in-place as its gnu + only, move to a temp file instead. + +2008-02-06 Stefan Kost + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + As our docs are versioned, we need to patch the index.sgml file to have + correct paths there, unless we also want to fork gtk-doc's xsl (which + we don't). This hopefully fixes xrefs between modules. + +2008-02-02 Sebastian Dröge + + * m4/gst-feature.m4: + Use printf instead of echo as "echo -e" isn't POSIX and doesn't work + with strict POSIX shells like tcsh or dash and also not every platform + has a /bin/echo that supports it. + +2008-01-24 Stefan Kost + + * ChangeLog: + ChangeLog surgery. + + * gstdoc-scangobj: + Sync the object scanner with gtk-doc fixes. Update args and hierarchy + files. + +2008-01-20 Sebastian Dröge + + * check.mak: + * coverage/lcov.mak: + * gtk-doc-plugins.mak: + * release.mak: + Use $(MAKE) instead of make to fix the build if GNU make is called + something else on the system. + + * m4/as-docbook.m4: + Fix path for docbook.xsl if we have no /etc/xml/catalog and add a + docbook-xsl search path for FreeBSD. + +2008-01-18 Sebastian Dröge + + * gst.supp: + Add a suppression for a glibc bug: + http://valgrind.org/docs/manual/faq.html#faq.exit_errors> + +2008-01-18 Sebastian Dröge + + * gst.supp: + Add some more glibc 2.7 suppressions and make the GLib suppressions + for the home/tmp/etc directory caching a bit more generic. + +2008-01-18 Sebastian Dröge + + * gst.supp: + Add some glibc 2.7 supressions as found on Debian/unstable. + +2008-01-14 Jan Schmidt + + * download-translations: + Apparently I have problems with leaving things commented out when + I edit shell scripts. + +2008-01-12 Jan Schmidt + + * download-translations: + Remove bash-isms + +2008-01-12 Jan Schmidt + + * check-exports: + Restore the cleanup rm of our tmp file which I didn't mean to leave + commented out. + +2008-01-12 Jan Schmidt + + * check-exports: + Fixes to make check-export work on both Solaris and Linux + + * m4/gst-error.m4: + Disable extra warning category (argument mismatch) as an error + on Forte, as it prevents the libcheck fail_if macros from compiling. + + * win32.mak: + Substitute the GStreamer version so things will keep working in 0.11 + +2008-01-11 Tim-Philipp Müller + + Patch by: Peter Kjellerstedt + + * m4/gst-glib2.m4: + * m4/gst-libxml2.m4: + Improve/fix output from configure if either glib-2.0 or + libxml2 are not installed (#498222). + +2008-01-09 Stefan Kost + + * coverage/lcov.mak: + Update coverage make-rules: use them conditionaly, use libtool mode + and use lcov to cleanup. + +2007-12-18 Sebastian Dröge + + * glib-gen.mak: + Also use #include "header" instead of #include
for the + headers that were used to generate the source files for the same + reason as below. + + Remove whitespace before #include. + +2007-12-18 Sebastian Dröge + + * glib-gen.mak: + Use #include "header" instead of #include
for the generated + enum C files as the file will always be in the same directory and + some compilers seem to be a bit strict about that unless . is added + to the include path. + + Include all headers that were used to generate the source files in + the C file as they're used there. + +2007-12-17 Tim-Philipp Müller + + * win32.mak: (win32), (win32defs), (win32crlf): + Make check for CR LF in Visual C++ 6.0 project files + work, based on patch by David Schleef (#496722, #393626). + +2007-12-17 Tim-Philipp Müller + + * Makefile.am: + Don't forget to dist the new win32.mak. + +2007-12-17 Tim-Philipp Müller + + * win32.mak: (win32), (win32defs): + Move common win32 Makefile foo into this new file. + +2007-12-15 Stefan Kost + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + We should have never forked this that much :/. + +2007-12-13 Tim-Philipp Müller + + * check-exports: + Fix build on the ppc64 build bot. + +2007-12-13 Tim-Philipp Müller + + * check-exports: + Suppress more unintentional exports (too much hassle to rename them, + since the win32 project files would need changing too). + +2007-12-12 Tim-Philipp Müller + + * Makefile.am: + check-exports should be disted. + +2007-12-12 Tim-Philipp Müller + + * check-exports: + Add quick'n'dirty script to check the exported symbols of a library + against the symbols in the corresponding .def file (#493983). Based + on script by Ole André Vadla Ravnås. + +2007-11-06 Jan Schmidt + + * gtk-doc-plugins.mak: + Fix distcheck by making sure the types files are treated like the + other gtkdoc-scangobj generated files. + +2007-09-21 Sebastian Dröge + + * m4/gst-args.m4: + Let the AG_GST_ARG_ENABLE_EXPERIMENTAL macro default to disable + building of experimental plugins. Nobody uses it yet and the + --enable--experimental stuff from gst-plugins-good defaults to + disable too. + +2007-09-06 Tim-Philipp Müller + + * gtk-doc-plugins.mak: + Just use the normal 'check' target and avoid a circular + dependency. + +2007-09-06 Tim-Philipp Müller + + * gtk-doc-plugins.mak: + Add rule to error out if .hierarchy file contains tabs. + +2007-08-20 Tim-Philipp Müller + + * download-translations: + * po.mak: + If there are new languages, they need to be added to po/LINGUAS. + +2007-08-20 Tim-Philipp Müller + + * download-translations: + * po.mak: + Fix up 'download-po' a bit, so that we find new translations + for languages that aren't in our po/LINGUAS file yet too. + +2007-07-16 Jan Schmidt + + * gst.supp: + Add a suppression for GLib caching the tmp dir seen on an + Ubuntu Feisty system. + +2007-07-13 Jan Schmidt + + * m4/gst-feature.m4: + If we want to use 'echo -e', call /bin/echo instead of the shell's + since -e is a bash extension, and our /bin/sh might not be being + provided by bash. + +2007-07-01 Thomas Vander Stichele + + * po.mak: + Translation project has moved. Also, no idea how this used to + work given that we weren't downloading a .po file. + +2007-06-25 Stefan Kost + + * gst-xmlinspect.py: + * plugins.xsl: + Also extract element caps for plugin-docs. Fixes parts of #117692. + +2007-06-21 Tim-Philipp Müller + + Patch by: Andreas Schwab + + * m4/gst-feature.m4: + Fix quoting (#449493). + +2007-06-10 Sebastian Dröge + + * m4/gst-parser.m4: + Only generate the parser if bison >= 1.875 _and_ flex >= 2.5.31 is + installed and use pre-generated sources otherwise. Fixes bug #444820. + +2007-05-11 Michael Smith + + * gst.supp: + Suppression variant for our good friend the TLS leak, this time for + Ubuntu Feisty/x86. + +2007-05-09 Tim-Philipp Müller + + * gtk-doc-plugins.mak: + Fix make distcheck again; change some spaces to tabs in makefile. + +2007-04-29 Thomas Vander Stichele + + * gtk-doc-plugins.mak (-module): + Error out when the html build step gives warnings, so they get + fixed properly. + +2007-04-23 Stefan Kost + + * m4/gst-feature.m4: + Add macro AG_GST_PARSE_SUBSYSTEM_DISABLES that checks the defines in + the configuration header and AC_DEFINES the setings. + +2007-04-19 Sebastian Dröge + + Patch by: Vincent Torri + + * m4/gst-parser.m4: + Put the AC_MSG_RESULT output in brackets to get it properly written to + the terminal. + +2007-04-18 Sebastian Dröge + + * m4/gst-parser.m4: + Check for flex >= 2.5.31 and set GENERATE_PARSER if we have at least + that version. Otherwise use pre-generated parser sources as we can't + raise the required flex version. HAVE_MT_SAVE_FLEX is obsolete now + as we use a new enough flex version anyway. First part of #349180 + +2007-04-10 Thomas Vander Stichele + + * m4/gst-check.m4: + Allow pre-setting the GST(PB)_TOOLS/PLUGINS_DIR variables to help + builds against older GStreamer. + +2007-03-25 Sebastian Dröge + + * m4/gst-parser.m4: + Fix the flex version check. It ignored the micro version before. + +2007-03-09 Jan Schmidt + + * check.mak: + Use the same timeout when generating valgrind suppressions as + running the valgrind test. + + * gst.supp: + Add some more suppressions and stuff. + +2007-03-08 Jan Schmidt + + * check.mak: + Make sure GSlice is disabled when building suppressions too. + + * gst.supp: + Add around *850* lines of suppressions for one-time initialisations + inside libasound and gconf/bonobo/ORBit. I feel so dirty. + +2007-03-07 Jan Schmidt + + * gst.supp: + add a suppression for this GConf flup on the FC5 buildbot. + +2007-03-06 Jan Schmidt + + * gst.supp: + Make the suppression a little more generic, to catch the FC5 + backtrace too. + +2007-03-06 Jan Schmidt + + * gst.supp: + Add a suppression for libcdio 0.76. It leaks an internal struct + when the CD-ROM device is not accessible. + +2007-02-28 Thomas Vander Stichele + + * m4/gst-arch.m4: + Move a line that was in the wrong macro + +2007-02-28 Thomas Vander Stichele + + * m4/gst.m4: + Add + * m4/gst-arch.m4: + * m4/gst-args.m4: + * m4/gst-check.m4: + * m4/gst-debuginfo.m4: + * m4/gst-default.m4: + * m4/gst-doc.m4: + * m4/gst-error.m4: + * m4/gst-feature.m4: + * m4/gst-function.m4: + * m4/gst-gettext.m4: + * m4/gst-glib2.m4: + * m4/gst-libxml2.m4: + * m4/gst-parser.m4: + * m4/gst-plugin-docs.m4: + * m4/gst-plugindir.m4: + * m4/gst-valgrind.m4: + * m4/gst-x11.m4: + Convert all macros to use AG_GST style so we can properly warn + when they're missing if configure.ac calls AG_GST_INIT + Will require update in all GStreamer modules. + +2007-02-11 Stefan Kost + + * m4/gst-args.m4: + Remove 'enable' from configure switch description as this leads to + confusing lines like "disable enable builing ...". + * m4/gst-feature.m4: + Fix comment to sound less horrible. + +2007-02-07 Tim-Philipp Müller + + Patch by: Will Newton + + * m4/gst-check.m4: + Use $PKG_CONFIG rather than pkg-config directly, the one in our path + might not be the one we want, like when cross-compiling. Also, other + macros such as PKG_CHECK_MODULES use $PKG_CONFIG, so we should + probably too just for consistency. Fixes #405288. + +2007-01-08 Tim-Philipp Müller + + * m4/gst-parser.m4: + Need to use double square brackets again so m4 doesn't remove them + (fixes #378931). + + * m4/gst-args.m4: + Use double square brackets here as well, for the same reason. + +2007-01-05 Tim-Philipp Müller + + * m4/gst-parser.m4: + Use 'sed' rather than 'tr' to strip trailing letters from version + numbers, since 'tr' might not be available and we know sed is + (#378931). + +2006-10-21 Tim-Philipp Müller + + * check.mak: + Increase default timeout under valgrind, 60 is just too short and + some tests take a bit longer these days and not everyone has a + beefy machine. + +2006-09-29 Michael Smith + + * gst.supp: + More suppressions for edgy. + +2006-09-28 Jan Schmidt + + * m4/gst-glib2.m4: + Use gmodule-no-export-2.0.pc instead of gmodule-2.0.pc - we neither + want nor need --export-dynamic (which ends up making us export a bunch + of unneeded symbols) + +2006-09-14 Tim-Philipp Müller + + * gst.supp: + Some suppressions for the more recent ld.so in ubuntu edgy. + +2006-08-23 Tim-Philipp Müller + + * gst.supp: + Shorten function trail so the suppression works on + my ubuntu dapper system with core cvs as well. + +2006-07-28 Jan Schmidt + + * gst.supp: + Extra suppressions from my Ubuntu x86_64 machine + +2006-07-24 Tim-Philipp Müller + + Patch by: Frederic Peters + + * m4/gst-parser.m4: + Need to double square brackets in .m4 files. Should fix bison + version detection with version numbers like 1.23a (#348354). + +2006-07-24 Jan Schmidt + + * check.mak: + Valgrind fails to find tests written in tests/check/ directly (rather + than a subdir) - because valgrind gets run with a filename that + doesn't contain a relative path, it goes searching /usr/bin instead. + Run with ./.... to make things work either way. + + * gtk-doc-plugins.mak: + Add $(top_builddir)/src as a place to look for plugins + when building too, since that's where gst-template keeps things + +2006-07-23 Stefan Kost + + Patch by: Frederic Peters + + * m4/gst-parser.m4: + Fix bison detection (#348354) + +2006-07-21 Stefan Kost + + * m4/gst-parser.m4: + check for bison and flex + +2006-07-13 Thomas Vander Stichele + + * m4/gst-plugin-docs.m4: + remove the configure argument for enabling plugin doc build; + having gtk-doc enabled and pyxml present is enough of a trigger + +2006-07-03 Thomas Vander Stichele + + * coverage/lcov.mak: + fix up rules to work with gst-python as well + run "make lcov" to test and generate the reports + run "make lcov-reset" to redo it after that + +2006-07-02 Thomas Vander Stichele + + * Makefile.am: + * check.mak: + add an inspect target that inspects every element feature, + so we can have that added for coverage + * coverage/lcov.mak: + add support for lcov + +2006-07-02 Thomas Vander Stichele + + * m4/gst-args.m4: + when building with gcov, reset CFLAGS and friends to O0 + +2006-07-02 Thomas Vander Stichele + + * m4/gst-args.m4: + Find the gcov that matches the gcc version + Only allow gcov if we use gcc + +2006-07-02 Thomas Vander Stichele + + * Makefile.am: + * coverage/coverage-report-entry.pl: + * coverage/coverage-report.pl: + * coverage/coverage-report.xsl: + copy coverage reporting files from dbus + +2006-07-01 Thomas Vander Stichele + + * m4/gst-args.m4: + libtool strips gcov's -f flags, so libgcov does not get + linked in. Setting GCOV_LIBS with -lgcov fixes libtool's + stripping + also show what pkg-config-path we set + +2006-06-22 Tim-Philipp Müller + + Patch by: Peter Kjellerstedt + + * m4/gst-feature.m4: + Show list of plugins without external dependencies that + will not be built as well (#344136). + +2006-06-15 Tim-Philipp Müller + + * m4/gst-plugin-docs.m4: + add GST_PLUGIN_DOCS, which checks for everything needed + to build the plugin docs (namely gtk-doc and pyxml); also + adds a new --enable-plugin-docs configure switch; will + set ENABLE_PLUGIN_DOCS conditional for use in Makefile.am + files (see #344039). + +2006-06-11 Thomas Vander Stichele + + * m4/gst-check.m4: + add GST_PKG_CHECK_MODULES, which in the normal case of checking + for a dependency lib for a plug-in only needs two arguments + to do the right thing. + * m4/gst-feature.m4: + clean up output a little of feature checking; also deal with + non-plug-in feature checks + * m4/Makefile.am: + * m4/gst-gstreamer.m4: + remove this file; it's a useless check + +2006-06-06 Thomas Vander Stichele + + * m4/gst-arch.m4: + add PPC64 so we can have separate structure sizes for it + +2006-06-05 Edward Hervey + + * gtk-doc.mak: + Check for the proper .devhelp2 file to remove. + +2006-05-31 Thomas Vander Stichele + + * gtk-doc.mak: + allow a magic variable to suppress errors from docbuilding + +2006-05-30 Thomas Vander Stichele + + * gtk-doc.mak: + error out if gtkdoc-mktmpl finds unused declarations + +2006-05-28 Edward Hervey + + * gst.supp: + Reverting previous commit. That's good to know, Edward, but why ? + +2006-05-28 Edward Hervey + + * gst.supp: + Added suppresion for memleak in g_option_context_parse on fc5-64 + +2006-05-19 Thomas Vander Stichele + + * m4/gst-check.m4: + set GSTPB_PLUGINS_DIR just like GST_PLUGINS_DIR + +2006-05-18 Tim-Philipp Müller + + * check.mak: + Fix 'make help' in check directories, it should be + 'valgrind.gen-suppressions' not 'valgrind-gen-suppressions' + (not changing target to match help string on purpose to keep + scripts etc. functional). + +2006-05-18 Thomas Vander Stichele + + Patch by: Peter Kjellerstedt + + * m4/gst-arch.m4: + add support for CRIS and CRISv32. + +2006-05-17 Jan Schmidt + + * m4/gst-args.m4: + Fix the macros for command-line supplied package and origin names + so they don't end up being configure as "" (Fixes #341479) + +2006-05-14 Jan Schmidt + + * gtk-doc.mak: + Add uninstall rule to remove .devhelp2 files. + +2006-05-09 Edward Hervey + + * gst.supp: + Add suppression for GSlice version of + g_type_init calloc leak + +2006-04-05 Michael Smith + + * gst.supp: + Delete a bogus suppression for the registry code. + Generalise a suppression for a glib bug (see #337404) + +2006-04-04 Michael Smith + + * gst.supp: + Add a leak suppression: the existing glibc-doesn't-free-TLS one + wasn't triggering here. + +2006-04-04 Michael Smith + + * gst.supp: + Add some minimally-neccesary suppressions for my x86/dapper system. + +2006-04-01 Thomas Vander Stichele + + * plugins.xsl: + Do not display an origin link if origin does not start with http + See #323798 + +2006-04-01 Thomas Vander Stichele + + * m4/gst-args.m4: + * m4/gst-feature.m4: + add more macros + * m4/gst-x11.m4: + X11-related checks + +2006-04-01 Thomas Vander Stichele + + * m4/as-version.m4: + newer version + * m4/gst-args.m4: + * m4/gst-doc.m4: + update and add other macros to be shared across projects + +2006-03-24 Thomas Vander Stichele + + * gst.supp: + add a suppression for g_parse_debug_string + +2006-03-23 Stefan Kost + + * gstdoc-scangobj: + sync fully with gtkdoc-0.15 + +2006-03-23 Stefan Kost + + * gstdoc-scangobj: + * gtk-doc.mak: + sync a little with gtk-doc mainline + +2006-03-17 Wim Taymans + + * gst.supp: + add another clone suppression + change all glibc suppressions to match 2.3.* + +2006-03-09 Thomas Vander Stichele + + * m4/check.m4: + fix test so it actually works when the normal check is used + over debian's/ubuntu's + +2006-03-08 Jan Schmidt + + * check.mak: + Set G_SLICE=always-malloc when valgrinding tests + (closes #333272) + +2006-02-21 Jan Schmidt + + * m4/gst-glib2.m4: + Fix debug output when the GLib version prerequisite is not found + +2006-02-13 Andy Wingo + + * m4/check.m4: Hack around Debian/Ubuntu's broken installation of + the PIC version of check as libcheck_pic.a. Should work with + cross-compilation too. Grr. + +2006-02-06 Thomas Vander Stichele + + * m4/gst-default.m4: + switch to auto* sinks for defaults + +2006-02-02 Wim Taymans + + * check.mak: + add a .valgrind.gen-suppressions target to aid in generating + suppressions + * gst.supp: + add more repressions from my debian glibc as of today + +2006-02-02 Thomas Vander Stichele + + * gtk-doc-plugins.mak: + only add srcdir/gst if it exists + +2006-01-30 Thomas Vander Stichele + + * release.mak: + don't complain about disted enums in win32 + +2006-01-20 Thomas Vander Stichele + + * m4/gst-check.m4: + AC_SUBST CFLAGS and LIBS + do a non-command because something is stripping out our AC_SUBST + +2006-01-20 Thomas Vander Stichele + + * m4/gst-args.m4: + * m4/gst-valgrind.m4: + properly give a "no" result manually when providing a + not-found action to fix configure output + +2006-01-20 Thomas Vander Stichele + + * m4/pkg.m4: + update with a more recent version + +2006-01-07 Thomas Vander Stichele + + * gettext.patch: + make Makefile depend on LINGUAS, so rebuilds work when adding + a language + +2006-01-03 Michael Smith + + * check.mak: + Clarify error message from valgrind test runs. + +2005-12-16 Thomas Vander Stichele + + * m4/gst-arch.m4: + define HOST_CPU + +2005-11-29 Thomas Vander Stichele + + * check.mak: + add a valgrind-forever target for tests + +2005-11-28 Thomas Vander Stichele + + * check.mak: + when a "make test.check" run fails, make it rerun the test with + at least debug level 2 + +2005-11-14 Thomas Vander Stichele + + * m4/Makefile.am: + * m4/gst-check.m4: + fix check for base plugins + * m4/gst-default.m4: + add m4 to set default elements + +2005-10-18 Thomas Vander Stichele + + * m4/gst-check.m4: + check for tools correctly + +2005-10-18 Thomas Vander Stichele + + * gtk-doc.mak: + only enable breaking on new API when make distcheck passes, + not before + +2005-10-18 Thomas Vander Stichele + + * m4/gst-check.m4: + Resurrect Julien's dead body and wipe his mind clean + +2005-10-18 Thomas Vander Stichele + + * m4/gst-check.m4: + Kill Julien + +2005-10-17 Julien MOUTTE + + * m4/gst-check.m4: I know Thomas will kill me but this + ifelse statement seems incorrect as it is always setting + required to "yes". With this one it seems to work. Fixes + build of gst-plugins-base on my setup where gstreamer-check + is definitely not present/required. + +2005-10-18 Stefan Kost + + * gtk-doc.mak: + make build break on new api that has not been added to the + sections file + +2005-10-17 Thomas Vander Stichele + + * m4/gst-glib2.m4: + * m4/Makefile.am: + * m4/gst-check.m4: + add macro for easy checks for GStreamer libs + +2005-10-16 Thomas Vander Stichele + + * m4/gst-glib2.m4: + update, warn in error cases + +2005-10-16 Thomas Vander Stichele + + * m4/gst-error.m4: + add GST_SET_DEFAULT_LEVEL + +2005-10-16 Thomas Vander Stichele + + * m4/Makefile.am: + * m4/gst-gettext.m4: + remove the AM_GNU_GETTEXT* calls, they need to be in configure.ac + * m4/gst-glib2.m4: + clean up and re-use in core soon + * m4/gst-plugindir.m4: + macro to set up PLUGINDIR and plugindir define/var + +2005-10-15 Thomas Vander Stichele + + * m4/Makefile.am: + * m4/gst-gettext.m4: + add macro for setting up gettext + +2005-10-15 Thomas Vander Stichele + + * m4/gst-args.m4: + add some .m4's for argument checking that can be shared among modules + +2005-10-15 Thomas Vander Stichele + + * m4/as-libtool.m4: + set _LT_LDFLAGS + * m4/gst-libxml2.m4: + document + +2005-10-15 Thomas Vander Stichele + + * m4/gst-arch.m4: + indent a little + add AC_REQUIRE + * m4/gst-error.m4: + clean up + +2005-10-12 Thomas Vander Stichele + + * gst-autogen.sh: + update version detection expression to catch stuff like + Libtool (libtool15) 1.5.0 + +2005-10-11 Thomas Vander Stichele + + * gst.supp: + commit 6 new suppressions related to g_module_open; can these + really not be folded into one ? + +2005-10-11 Edward Hervey + + * gst.supp: + made the suppression more generic + Added pthread memleak suppresions + Added nss_parse_* memleak suppresion (used by g_option_context_parse) + +2005-10-11 Thomas Vander Stichele + + * check.mak: + be more strict, more leak resolution + * gst.supp: + clean up the g_type_init suppressions + +2005-10-07 Thomas Vander Stichele + + * m4/Makefile.am: + * m4/gst-valgrind.m4: + put the valgrind detection in an .m4 + +2005-09-29 Thomas Vander Stichele + + * check.mak: + add some more targets, like "help", but also more intensive tests + +2005-09-23 Thomas Vander Stichele + + * gtk-doc.mak: + make certain doc warnings fatal so people maintain docs again + +2005-09-23 Thomas Vander Stichele + + * Makefile.am: + * gtk-doc-plugins.mak: + * scangobj-merge.py: + merge additions from the .signals.new and .args.new file in + the original ones, only updating if necessary + +2005-09-23 Thomas Vander Stichele + + * gst-xmlinspect.py: + * gstdoc-scangobj: + * gtk-doc-plugins.mak: + fix properly for new API; make update in plugins dir now works + +2005-09-20 Thomas Vander Stichele + + * gst-xmlinspect.py: + * gstdoc-scangobj: + some fixes for new API + * gtk-doc-plugins.mak: + set environment properly + +2005-09-17 David Schleef + + * gtk-doc-plugins.mak: Use new environment variables. + +2005-09-16 Michael Smith + + * gstdoc-scangobj: + Make the scanobj code reflect registry/plugin API changes + +2005-09-15 Thomas Vander Stichele + + * gtk-doc-plugins.mak: + split out scanobj step (which will be run by doc maintainer) + from scan step (which will be run on every build) + clean up some of the commands for make distcheck + +2005-09-15 Thomas Vander Stichele + + * gtk-doc-plugins.mak: + * mangle-tmpl.py: + first stab at reorganizing the plugins build so we can maintain + element docs + +2005-09-14 David Schleef + + * as-libtool.mak: Remove + * m4/as-libtool.m4: The libtool bug that this worked around has + been fixed. + * m4/as-version.m4: Don't define GST_RELEASE, since it causes + config.h to be regenerated needlessly, and we don't use it. + +2005-09-14 Thomas Vander Stichele + + * gtk-doc-plugins.mak: + error out on inspect failure + +2005-09-14 Michael Smith + + * glib-gen.mak: + Don't call glib-mkenums with arguments that confuse/break MinGW, + fixes 316155. + +2005-09-03 Thomas Vander Stichele + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + * m4/gst-doc.m4: + separate out gtk-doc and docbook stuff + have two separate --enable configure flags + +2005-08-26 Thomas Vander Stichele + + * check.mak: + add a .gdb target; rebuild registry for each target, otherwise + a code rebuild always triggers a reg rebuild, and it's just too + annoying + * gstdoc-scangobj: + +2005-08-21 Thomas Vander Stichele + + * check.mak: + separate out REGISTRY_ENVIRONMENT; we want to use that from + our valgrind runs, but we also want TESTS_ENVIRONMENT to contain + everything that the first test, gst-register, needs + +2005-08-21 Thomas Vander Stichele + + * check.mak: + parse output of valgrind and check for definitely lost, and error + out; somehow I was led to believe valgrind returns non-zero for + leaks, but I can't make it do that, so let's parse + +2005-08-20 Thomas Vander Stichele + + * check.mak: + for some weird reason valgrind does not report actual memleaks + if GST_PLUGIN_PATH is set to anything but the core gstreamer dir + while valgrind is running. Since the registry is going to go + anyway, I don't want to waste any more time on this; I just run + valgrind without GST_PLUGIN_PATH set. Since the registry loading + doesn't check if GST_PLUGIN_PATH got changed as a reason to rebuild + the registry, that's actually fine. + +2005-08-15 Thomas Vander Stichele + + * mangle-tmpl.py: + keep original Long_Description; only insert an include if it's + not already the first line in there + * plugins.xsl: + output more information for plugins, including an origin hyperlink + +2005-08-15 Thomas Vander Stichele + + * gst-xmlinspect.py: + a first stab at inspecting plugins and outputting an xml description + * gtk-doc-plugins.mak: + a gtk-doc using snippet for plugins documentation + * plugins.xsl: + a stylesheet to convert gst-xmlinspect.py output to docbook output + for inclusion in the gtk-doc stuff + +2005-07-20 Ronald S. Bultje + + * m4/gst-doc.m4: + s/pdf/eps/ in test for whether we output EPS images (#309379). + +2005-07-18 Andy Wingo + + * m4/as-libtool-tags.m4: Ooh, backported from libtool 1.6. Much + better. Thanks, Paolo Bonzini! + + * m4/Makefile.am (EXTRA_DIST): + * m4/as-libtool-tags.m4: New file, tries to disable some CXX and + fortran checks. + +2005-07-08 Thomas Vander Stichele + + * m4/gst-error.m4: + add macro to set ERROR_CFLAGS + +2005-06-30 Jan Schmidt + + * gst-autogen.sh: + Remove the old autoregen.sh if it exists before recreating it, + to prevent confusing any shell process that might be reading it + currently. + +2005-06-29 Thomas Vander Stichele + + * m4/gtk-doc.m4: + added + +2005-06-03 Stefan Kost + + * gst-autogen.sh: create autoregen.sh *before* shifting the options + +2005-05-17 Thomas Vander Stichele + + * gst-autogen.sh: only update autoregen.sh on actual runs + +2005-03-11 Thomas Vander Stichele + + * m4/check.m4: m4 from the check unit test suite + +2004-12-14 David Schleef + + * m4/gst-arch.m4: remove MMX stuff, since it doesn't work and + isn't needed anywhere + +2004-12-08 Thomas Vander Stichele + + * gst-autogen.sh: + allow failure command to be run so we can clean upfrom autopoint + +2004-09-03 Zeeshan Ali Khattak + * m4/gst-feature.m4: Trying to correct the GST_CHECK_CONFIGPROG macro + +2004-07-21 Benjamin Otte + + * m4/.cvsignore: exciting updates for libtool m4 files + +2004-07-12 David Schleef + + * m4/as-objc.m4: Add a macro to test for objective C + +2004-06-12 Thomas Vander Stichele + + * m4/gst-feature.m4: + not all of them support --plugin-libs, so redirect stderr + +2004-06-12 Thomas Vander Stichele + + * m4/as-scrub-include.m4: + sync with upstream to 0.1.4. Fixes #132440 + +2004-06-07 Benjamin Otte + + * m4/gst-feature.m4: + write a big marker into configure output when checking next plugin + to allow easier parsing of why plugins are(n't) built. + +2004-06-01 Thomas Vander Stichele + + * m4/as-compiler-flag.m4: + * m4/as-compiler.m4: + * m4/as-libtool.m4: + * m4/as-version.m4: + sync with upstream, change sticky options to -ko + +2004-05-24 Thomas Vander Stichele + + * m4/as-scrub-include.m4: synced with upstream + +2004-05-03 Thomas Vander Stichele + + * po.mak: + snippet for updating .po files + +2004-03-18 Thomas Vander Stichele + + * Makefile.am: + * m4/Makefile.am: + integrate these with the dist + +2004-03-17 Thomas Vander Stichele + + * release.mak: add a release target + +2004-03-09 Thomas Vander Stichele + + patch by: Stephane Loeuillet + + * m4/ax_create_stdint_h.m4: + use head -n instead of head - (#136500) + +2004-03-05 Thomas Vander Stichele + + * m4/gst-doc.m4: don't build PS without dvips binary + +2004-02-22 Julio M. Merino Vidal + + reviewed by: Benjamin Otte + + * m4/as-docbook.m4: + don't use == operator with test(1) (fixes #135115) + +2004-02-16 Thomas Vander Stichele + + * common/m4/gst-arch.m4: x86_64 is x86 too (clue from Fedora 2 test) + +2004-02-13 Thomas Vander Stichele + + * m4/gst-feature.m4: + remove AM_CONDITIONAL for the subsystem since automake 1.6.x + requires that call be in configure.ac + +2004-02-13 Thomas Vander Stichele + + * m4/gst-libxml2.m4: + take required version as argument, and default to 2.4.9 if not + specified + +2004-02-12 Thomas Vander Stichele + + * m4/gst-feature.m4: + rename and fix up GST_CHECK_DISABLE_SUBSYSTEM + +2004-02-11 Thomas Vander Stichele + + * common/m4/as-ac-expand.m4: + * common/m4/as-auto-alt.m4: + * common/m4/as-compiler-flag.m4: + * common/m4/as-compiler.m4: + * common/m4/as-docbook.m4: + * common/m4/as-libtool.m4: + * common/m4/as-scrub-include.m4: + * common/m4/as-version.m4: + * common/m4/glib-gettext.m4: + * common/m4/gst-arch.m4: + * common/m4/gst-debuginfo.m4: + * common/m4/gst-doc.m4: + * common/m4/gst-feature.m4: + * common/m4/gst-function.m4: + * common/m4/gst-glib2.m4: + * common/m4/gst-gstreamer.m4: + * common/m4/gst-libxml2.m4: + * common/m4/gst-makecontext.m4: + * common/m4/gst-mcsc.m4: + * common/m4/pkg.m4: + fix underquoted macros as reported by automake 1.8.x (#133800) + +2004-02-11 Johan Dahlin + + * gst-autogen.sh: Use A-Z instead of A-z in sed expression to + avoid a warning + +2004-02-05 Thomas Vander Stichele + + * m4/gst-doc.m4: + we use --output-format=xml and --ingnore-files options to + gtkdoc-mkdb, which got added between 0.9 and 1.0 + +2004-02-04 Thomas Vander Stichele + + * m4/as-libtool.m4: remove AM_PROG_LIBTOOL so it can move back + to configure.ac to shut up libtoolize + +2004-02-03 Thomas Vander Stichele + + * glib-gen.mak: added; used to generate enums and marshal code + +2004-01-13 Thomas Vander Stichele + + * gettext.patch: added; used by autogen.sh to make sure + GETTEXT_PACKAGE is understood from po/Makefile.in.in -> po/Makefile.in + diff -Nru gstreamer-vaapi-0.7.0/common/check-exports gstreamer-vaapi-1.8.2/common/check-exports --- gstreamer-vaapi-0.7.0/common/check-exports 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/check-exports 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,54 @@ +#!/bin/sh +# check-exports +# +# quick'n'dirty script that retrieves the list of exported symbols of a given +# library using 'nm', and compares that against the list of symbols-to-export +# of our win32/common/libfoo.def files. + +if [ $# -ne 2 ]; then + echo "Usage: $0 library.def library.so" + exit 1 +fi + +def_path="$1" +def_name="$(basename $def_path)" +lib_path="$2" + +lib_result="`mktemp /tmp/defname.XXXXXX`" + +LC_ALL=C +export LC_ALL + +# On Solaris, add -p to get the correct output format +NMARGS= +if nm -V 2>&1 |grep Solaris > /dev/null; then + NMARGS=-p +fi + +# _end is special cased because for some reason it is reported as an exported +# BSS symbol, unlike on linux where it's a local absolute symbol. +nm $NMARGS $lib_path | awk \ + '{ + if ($3 ~ /^[_]?(gst_|Gst|GST_).*/) + { + if ($2 ~ /^[BSDG]$/) + print "\t" $3 " DATA" + else if ($2 == "T") + print "\t" $3 + } + }' | sort | awk '{ if (NR == 1) print "EXPORTS"; print $0; }' \ + > $lib_result + +diffoutput=`diff -u $def_path $lib_result` +diffresult=$? + +rm $lib_result + +if test "$diffresult" -eq 0; then + exit 0; +else + echo -n "$diffoutput" >&2 + echo >&2 + exit 1; +fi + diff -Nru gstreamer-vaapi-0.7.0/common/check.mak gstreamer-vaapi-1.8.2/common/check.mak --- gstreamer-vaapi-0.7.0/common/check.mak 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/check.mak 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,247 @@ +# keep target around, since it's referenced in the modules' Makefiles +clean-local-check: + @echo + +if HAVE_VALGRIND +# hangs spectacularly on some machines, so let's not do this by default yet +check-valgrind: + $(MAKE) valgrind +else +check-valgrind: + @true +endif + +LOOPS ?= 10 +AM_TESTS_ENVIRONMENT = CK_DEFAULT_TIMEOUT=20 + +# run any given test by running make test.check +# if the test fails, run it again at at least debug level 2 +%.check: % + @$(AM_TESTS_ENVIRONMENT) \ + $* || \ + $(AM_TESTS_ENVIRONMENT) \ + GST_DEBUG=$$GST_DEBUG,*:2 \ + $* + +# just like 'check', but don't run it again if it fails (useful for debugging) +%.check-norepeat: % + @$(AM_TESTS_ENVIRONMENT) \ + $* + +# run any given test in a loop +%.torture: % + @for i in `seq 1 $(LOOPS)`; do \ + $(AM_TESTS_ENVIRONMENT) \ + $*; done + +# run any given test in an infinite loop +%.forever: % + @while true; do \ + $(AM_TESTS_ENVIRONMENT) \ + $* || break; done + +# valgrind any given test by running make test.valgrind +%.valgrind: % + @valgrind_log=$(subst /,-,$*-valgrind.log); \ + $(AM_TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=360 \ + G_SLICE=always-malloc \ + $(LIBTOOL) --mode=execute \ + $(VALGRIND_PATH) -q \ + $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \ + --tool=memcheck --leak-check=full --trace-children=yes \ + --show-possibly-lost=no \ + --leak-resolution=high --num-callers=20 \ + ./$* 2>&1 | tee $$valgrind_log ; \ + if grep "^==" $$valgrind_log > /dev/null 2>&1; then \ + rm $$valgrind_log; \ + exit 1; \ + fi ; \ + rm $$valgrind_log + +# valgrind any given test and generate suppressions for it +%.valgrind.gen-suppressions: % + @$(AM_TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=360 \ + G_SLICE=always-malloc \ + $(LIBTOOL) --mode=execute \ + $(VALGRIND_PATH) -q \ + $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \ + --tool=memcheck --leak-check=full --trace-children=yes \ + --show-possibly-lost=no \ + --leak-resolution=high --num-callers=20 \ + --gen-suppressions=all \ + ./$* 2>&1 | tee suppressions.log + +# valgrind torture any given test +%.valgrind-torture: % + @for i in `seq 1 $(LOOPS)`; do \ + $(MAKE) $*.valgrind || \ + (echo "Failure after $$i runs"; exit 1) || \ + exit 1; \ + done + @banner="All $(LOOPS) loops passed"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo $$dashes; echo $$banner; echo $$dashes + +# valgrind any given test until failure by running make test.valgrind-forever +%.valgrind-forever: % + @while $(MAKE) $*.valgrind; do \ + true; done + +# gdb any given test by running make test.gdb +%.gdb: % + @$(AM_TESTS_ENVIRONMENT) \ + CK_FORK=no \ + $(LIBTOOL) --mode=execute \ + gdb $* + +%.lcov-reset: + $(MAKE) $*.lcov-run + $(MAKE) $*.lcov-report + +%.lcov: % + $(MAKE) $*.lcov-reset + +if GST_GCOV_ENABLED +%.lcov-clean: + $(MAKE) -C $(top_builddir) lcov-clean + +%.lcov-run: + $(MAKE) $*.lcov-clean + $(MAKE) $*.check + +%.lcov-report: + $(MAKE) -C $(top_builddir) lcov-report +else +%.lcov-run: + echo "Need to reconfigure with --enable-gcov" + +%.lcov-report: + echo "Need to reconfigure with --enable-gcov" +endif + +# torture tests +torture: $(TESTS) + -rm test-registry.* + @echo "Torturing tests ..." + @for i in `seq 1 $(LOOPS)`; do \ + $(MAKE) check || \ + (echo "Failure after $$i runs"; exit 1) || \ + exit 1; \ + done + @banner="All $(LOOPS) loops passed"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo $$dashes; echo $$banner; echo $$dashes + +# forever tests +forever: $(TESTS) + -rm test-registry.* + @echo "Forever tests ..." + @while true; do \ + $(MAKE) check || \ + (echo "Failure"; exit 1) || \ + exit 1; \ + done + +# valgrind all tests +valgrind: $(TESTS) + @echo "Valgrinding tests ..." + @failed=0; valgrind_targets=""; \ + for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(TESTS)); do \ + valgrind_targets="$$valgrind_targets $$t.valgrind"; \ + done; \ + if ! $(MAKE) $$valgrind_targets ; then \ + echo "Some tests had leaks or errors under valgrind"; \ + false; \ + fi + +# valgrind all tests until failure +valgrind-forever: $(TESTS) + -rm test-registry.* + @echo "Forever valgrinding tests ..." + @while true; do \ + $(MAKE) valgrind || \ + (echo "Failure"; exit 1) || \ + exit 1; \ + done + +# valgrind torture all tests +valgrind-torture: $(TESTS) + -rm test-registry.* + @echo "Torturing and valgrinding tests ..." + @for i in `seq 1 $(LOOPS)`; do \ + $(MAKE) valgrind || \ + (echo "Failure after $$i runs"; exit 1) || \ + exit 1; \ + done + @banner="All $(LOOPS) loops passed"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo $$dashes; echo $$banner; echo $$dashes + +# valgrind all tests and generate suppressions +valgrind.gen-suppressions: $(TESTS) + @echo "Valgrinding tests ..." + @failed=0; \ + for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(TESTS)); do \ + $(MAKE) $$t.valgrind.gen-suppressions; \ + if test "$$?" -ne 0; then \ + echo "Valgrind error for test $$t"; \ + failed=`expr $$failed + 1`; \ + whicht="$$whicht $$t"; \ + fi; \ + done; \ + if test "$$failed" -ne 0; then \ + echo "$$failed tests had leaks or errors under valgrind:"; \ + echo "$$whicht"; \ + false; \ + fi + +# inspect every plugin feature +GST_INSPECT = $(GST_TOOLS_DIR)/gst-inspect-$(GST_API_VERSION) +inspect: + @echo "Inspecting features ..." + @for e in `$(AM_TESTS_ENVIRONMENT) $(GST_INSPECT) | head -n -2 \ + | cut -d: -f2`; \ + do echo Inspecting $$e; \ + $(GST_INSPECT) $$e > /dev/null 2>&1; done + +# build all tests +build-checks: $(TESTS) + +help: + @echo + @echo "make check -- run all checks" + @echo "make torture -- run all checks $(LOOPS) times" + @echo "make (dir)/(test).check -- run the given check once, repeat with GST_DEBUG=*:2 if it fails" + @echo "make (dir)/(test).check-norepeat -- run the given check once, but don't run it again if it fails" + @echo "make (dir)/(test).forever -- run the given check forever" + @echo "make (dir)/(test).torture -- run the given check $(LOOPS) times" + @echo + @echo "make (dir)/(test).gdb -- start up gdb for the given test" + @echo + @echo "make valgrind -- valgrind all tests" + @echo "make valgrind-forever -- valgrind all tests forever" + @echo "make valgrind-torture -- valgrind all tests $(LOOPS) times" + @echo "make valgrind.gen-suppressions -- generate suppressions for all tests" + @echo " and save to suppressions.log" + @echo "make (dir)/(test).valgrind -- valgrind the given test" + @echo "make (dir)/(test).valgrind-forever -- valgrind the given test forever" + @echo "make (dir)/(test).valgrind-torture -- valgrind the given test $(LOOPS) times" + @echo "make (dir)/(test).valgrind.gen-suppressions -- generate suppressions" + @echo " and save to suppressions.log" + @echo "make inspect -- inspect all plugin features" + @echo "make build-checks -- build all checks (but don't run them)" + @echo + @echo + @echo "Additionally, you can use the GST_CHECKS environment variable to" + @echo "specify which test(s) should be run. This is useful if you are" + @echo "debugging a failure in one particular test, or want to reproduce" + @echo "a race condition in a single test." + @echo + @echo "Examples:" + @echo + @echo " GST_CHECKS=test_this,test_that make element/foobar.check" + @echo " GST_CHECKS=test_many_threads make element/foobar.forever" + @echo + diff -Nru gstreamer-vaapi-0.7.0/common/coverage/coverage-report-entry.pl gstreamer-vaapi-1.8.2/common/coverage/coverage-report-entry.pl --- gstreamer-vaapi-0.7.0/common/coverage/coverage-report-entry.pl 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/coverage/coverage-report-entry.pl 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,69 @@ +#!/usr/bin/perl +# +# Copyright (C) 2006 Daniel Berrange +# +# 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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +print < + +Coverage report for $ARGV[0] + + + +

Coverage report for $ARGV[0]

+ +
+EOF
+
+
+while (<>) {
+    s/&/&/g;
+    s//>/g;
+
+    if (/^\s*function (\S+) called (\d+) returned \d+% blocks executed \d+%/) {
+	my $class = $2 > 0 ? "perfect" : "terrible";
+	$_ = "$_";
+    } elsif (/^\s*branch\s+\d+\s+taken\s+(\d+)%\s+.*$/) {
+	my $class = $1 > 0 ? "perfect" : "terrible";
+	$_ = "$_";
+    } elsif (/^\s*branch\s+\d+\s+never executed.*$/) {
+	my $class = "terrible";
+	$_ = "$_";
+    } elsif (/^\s*call\s+\d+\s+never executed.*$/) {
+	my $class = "terrible";
+	$_ = "$_";
+    } elsif (/^\s*call\s+\d+\s+returned\s+(\d+)%.*$/) {
+	my $class = $1 > 0 ? "perfect" : "terrible";
+	$_ = "$_";
+    }
+
+    print;
+}
+
+print <
+
+
+EOF
diff -Nru gstreamer-vaapi-0.7.0/common/coverage/coverage-report.pl gstreamer-vaapi-1.8.2/common/coverage/coverage-report.pl
--- gstreamer-vaapi-0.7.0/common/coverage/coverage-report.pl	1970-01-01 00:00:00.000000000 +0000
+++ gstreamer-vaapi-1.8.2/common/coverage/coverage-report.pl	2016-03-24 11:56:27.000000000 +0000
@@ -0,0 +1,125 @@
+#!/usr/bin/perl
+#
+# Copyright (C) 2006 Daniel Berrange
+#
+# 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 St, Fifth Floor, Boston, MA  02110-1301  USA
+
+use warnings;
+use strict;
+
+my %coverage = ( functions => {}, files => {} );
+
+my %filemap;
+
+my $type;
+my $name;
+
+my @functions;
+
+while (<>) {
+    if (/^Function '(.*)'\s*$/) {
+	$type = "function";
+	$name = $1;
+	$coverage{$type}->{$name} = {};
+	push @functions, $name;
+    } elsif (/^File '(.*?)'\s*$/) {
+	$type = "file";
+	$name = $1;
+	$coverage{$type}->{$name} = {};
+
+	foreach my $func (@functions) {
+	    $coverage{"function"}->{$func}->{file} = $name;
+	}
+	@functions = ();
+    } elsif (/^Lines executed:(.*)%\s*of\s*(\d+)\s*$/) {
+	$coverage{$type}->{$name}->{lines} = $2;
+	$coverage{$type}->{$name}->{linesCoverage} = $1;
+    } elsif (/^Branches executed:(.*)%\s*of\s*(\d+)\s*$/) {
+	$coverage{$type}->{$name}->{branches} = $2;
+	$coverage{$type}->{$name}->{branchesCoverage} = $1;
+    } elsif (/^Taken at least once:(.*)%\s*of\s*(\d+)\s*$/) {
+	$coverage{$type}->{$name}->{conds} = $2;
+	$coverage{$type}->{$name}->{condsCoverage} = $1;
+    } elsif (/^Calls executed:(.*)%\s*of\s*(\d+)\s*$/) {
+	$coverage{$type}->{$name}->{calls} = $2;
+	$coverage{$type}->{$name}->{callsCoverage} = $1;
+    } elsif (/^No branches$/) {
+	$coverage{$type}->{$name}->{branches} = 0;
+	$coverage{$type}->{$name}->{branchesCoverage} = "100.00";
+	$coverage{$type}->{$name}->{conds} = 0;
+	$coverage{$type}->{$name}->{condsCoverage} = "100.00";
+    } elsif (/^No calls$/) {
+	$coverage{$type}->{$name}->{calls} = 0;
+	$coverage{$type}->{$name}->{callsCoverage} = "100.00";
+    } elsif (/^\s*(.*):creating '(.*)'\s*$/) {
+	$filemap{$1} = $2;
+    } elsif (/^\s*$/) {
+	# nada
+    } else {
+	warn "Shit [$_]\n";
+    }
+}
+
+my %summary;
+foreach my $type ("function", "file") {
+    $summary{$type} = {};
+    foreach my $m ("lines", "branches", "conds", "calls") {
+	my $totalGot = 0;
+	my $totalMiss = 0;
+	my $count = 0;
+	foreach my $func (keys %{$coverage{function}}) {
+	    $count++;
+	    my $got = $coverage{function}->{$func}->{$m};
+	    $totalGot += $got;
+	    my $miss = $got * $coverage{function}->{$func}->{$m ."Coverage"} / 100;
+	    $totalMiss += $miss;
+	}
+	$summary{$type}->{$m} = sprintf("%d", $totalGot);
+	$summary{$type}->{$m . "Coverage"} = sprintf("%.2f", $totalMiss / $totalGot * 100);
+    }
+}
+
+
+
+print "\n";
+
+foreach my $type ("function", "file") {
+    printf "<%ss>\n", $type;
+    foreach my $name (sort { $a cmp $b } keys %{$coverage{$type}}) {
+	my $rec = $coverage{$type}->{$name};
+	printf "  \n", $name, ($type eq "file" ? $filemap{$name} : $filemap{$rec->{file}});
+	printf "    \n", $rec->{lines}, $rec->{linesCoverage};
+	if (exists $rec->{branches}) {
+	    printf "    \n", $rec->{branches}, $rec->{branchesCoverage};
+	}
+	if (exists $rec->{conds}) {
+	    printf "    \n", $rec->{conds}, $rec->{condsCoverage};
+	}
+	if (exists $rec->{calls}) {
+	    printf "    \n", $rec->{calls}, $rec->{callsCoverage};
+	}
+	print  "  \n";
+    }
+
+    printf "  \n";
+    printf "    \n", $summary{$type}->{lines}, $summary{$type}->{linesCoverage};
+    printf "    \n", $summary{$type}->{branches}, $summary{$type}->{branchesCoverage};
+    printf "    \n", $summary{$type}->{conds}, $summary{$type}->{condsCoverage};
+    printf "    \n", $summary{$type}->{calls}, $summary{$type}->{callsCoverage};
+    printf  "  \n";
+    printf "\n", $type;
+}
+
+print "\n";
diff -Nru gstreamer-vaapi-0.7.0/common/coverage/coverage-report.xsl gstreamer-vaapi-1.8.2/common/coverage/coverage-report.xsl
--- gstreamer-vaapi-0.7.0/common/coverage/coverage-report.xsl	1970-01-01 00:00:00.000000000 +0000
+++ gstreamer-vaapi-1.8.2/common/coverage/coverage-report.xsl	2016-03-24 11:56:27.000000000 +0000
@@ -0,0 +1,235 @@
+
+
+
+
+  
+
+  
+    
+      
+        Coverage report
+        
+      
+      
+        

Coverage report

+ + + +
+ + +

Function coverage

+ + + +
+ + + +

File coverage

+ + + +
+ + + + + + + + + + + + + + + + + + + + + odd + + + even + + + + + + + + + + + + + + odd + + + even + + + + + + +
NameLinesBranchesConditionsCalls
+
+ + + + + + + + + + + + + + Summary + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + perfect + + + excellant + + + good + + + poor + + + bad + + + terrible + + + + + % of + + +
diff -Nru gstreamer-vaapi-0.7.0/common/coverage/lcov.mak gstreamer-vaapi-1.8.2/common/coverage/lcov.mak --- gstreamer-vaapi-0.7.0/common/coverage/lcov.mak 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/coverage/lcov.mak 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,47 @@ +## .PHONY so it always rebuilds it +.PHONY: lcov-reset lcov lcov-run lcov-report lcov-upload lcov-clean + +# run lcov from scratch, always +lcov-reset: + $(MAKE) lcov-run + $(MAKE) lcov-report + +# run lcov from scratch if the dir is not there +lcov: + $(MAKE) lcov-reset + +if GST_GCOV_ENABLED +# reset lcov stats +lcov-clean: + @-rm -rf lcov + lcov --directory . --zerocounters + +# reset run coverage tests +lcov-run: + -$(MAKE) lcov-clean + -if test -d tests/check; then $(MAKE) -C tests/check inspect; fi + -$(MAKE) check + +# generate report based on current coverage data +lcov-report: + mkdir lcov + lcov --compat-libtool --directory . --capture --output-file lcov/lcov.info + lcov --list-full-path -l lcov/lcov.info | grep -v "`cd $(top_srcdir) && pwd`" | cut -d\| -f1 > lcov/remove + lcov --list-full-path -l lcov/lcov.info | grep "tests/check/" | cut -d\| -f1 >> lcov/remove + lcov --list-full-path -l lcov/lcov.info | grep "docs/plugins/" | cut -d\| -f1 >> lcov/remove + lcov -r lcov/lcov.info `cat lcov/remove` > lcov/lcov.cleaned.info + rm lcov/remove + mv lcov/lcov.cleaned.info lcov/lcov.info + genhtml -t "$(PACKAGE_STRING)" -o lcov --num-spaces 2 lcov/lcov.info + +lcov-upload: lcov + rsync -rvz -e ssh --delete lcov/* gstreamer.freedesktop.org:/srv/gstreamer.freedesktop.org/www/data/coverage/lcov/$(PACKAGE) + +else +lcov-run: + echo "Need to reconfigure with --enable-gcov" + +lcov-report: + echo "Need to reconfigure with --enable-gcov" +endif + diff -Nru gstreamer-vaapi-0.7.0/common/cruft.mak gstreamer-vaapi-1.8.2/common/cruft.mak --- gstreamer-vaapi-0.7.0/common/cruft.mak 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/cruft.mak 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,56 @@ +# checks for left-over files in the (usually uninstalled) tree, ie. for +# stuff that best be deleted to avoid problems like having old plugin binaries +# lying around. +# +# set CRUFT_FILES and/or CRUFT_DIRS in your Makefile.am when you include this + +check-cruft: + @cruft_files=""; cruft_dirs=""; \ + for f in $(CRUFT_FILES); do \ + if test -e $$f; then \ + cruft_files="$$cruft_files $$f"; \ + fi \ + done; \ + for d in $(CRUFT_DIRS); do \ + if test -e $$d; then \ + cruft_dirs="$$cruft_dirs $$d"; \ + fi \ + done; \ + if test "x$$cruft_files$$cruft_dirs" != x; then \ + echo; \ + echo "**** CRUFT ALERT *****"; \ + echo; \ + echo "The following files and directories may not be needed any "; \ + echo "longer (usually because a plugin has been merged into "; \ + echo "another plugin, moved to a different module, or been "; \ + echo "renamed), and you probably want to clean them up if you "; \ + echo "don't have local changes: "; \ + echo; \ + for f in $$cruft_files; do echo "file $$f"; done; \ + echo; \ + for d in $$cruft_dirs; do echo "directory $$d"; done; \ + echo; \ + echo "'make clean-cruft' will remove these for you."; \ + echo; \ + fi + +clean-cruft-dirs: + @for d in $(CRUFT_DIRS); do \ + if test -e $$d; then \ + rm -r "$$d" && echo "Removed directory $$d"; \ + fi \ + done + +clean-cruft-files: + @for f in $(CRUFT_FILES); do \ + if test -e $$f; then \ + rm "$$f" && echo "Removed file $$f"; \ + fi \ + done + +clean-cruft: clean-cruft-dirs clean-cruft-files + +# also might want to add this to your Makefile.am: +# +# all-local: check-cruft + diff -Nru gstreamer-vaapi-0.7.0/common/c-to-xml.py gstreamer-vaapi-1.8.2/common/c-to-xml.py --- gstreamer-vaapi-0.7.0/common/c-to-xml.py 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/c-to-xml.py 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,36 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +""" +Convert a C program to valid XML to be included in docbook +""" + +from __future__ import print_function, unicode_literals + +import sys +import os +from xml.sax import saxutils + +def main(): + if len(sys.argv) == 1: + sys.stderr.write("Please specify a source file to convert") + sys.exit(1) + source = sys.argv[1] + + if not os.path.exists(source): + sys.stderr.write("%s does not exist.\n" % source) + sys.exit(1) + + content = open(source, "r").read() + + # print header + print ('') + print ('') + print () + print ('') + + # print content + print (saxutils.escape(content)) + print ('') + +main() diff -Nru gstreamer-vaapi-0.7.0/common/download-translations gstreamer-vaapi-1.8.2/common/download-translations --- gstreamer-vaapi-0.7.0/common/download-translations 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/download-translations 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,152 @@ +#!/bin/sh +# Shell script to download the latest translations for a given GStreamer +# package from translationproject.org + + +# DOMAINS based on http://translationproject.org/extra/matrix.html +# We need to check all domains, not only po/LINGUAS, since there might be +# new translations +DOMAINS=\ +"af am ar az be bg pt_BR bs ca zh_CN cs cy da de el eo es et eu fa fi fr "\ +"ga en_GB gl gu he hi zh_HK hr hu id is it ja ko ku ky lg lt lv mk mn ms "\ +"mt nb ne nl nn or pa pl pt rm ro ru rw sk sl sq sr sv ta tq th tk "\ +"tr zh_TW uk ven vi wa xh zu" + +# for testing/debugging: +#DOMAINS="es fr hu sv pl xx" + +# check for 'diff' program +diff --version 2>/dev/null >/dev/null +if [ ! $? ]; then + echo "==== You must have the 'diff' program installed for this script ====" + exit 1 +fi + +# check for 'wget' program +wget --version 2>/dev/null >/dev/null +if [ ! $? ]; then + echo "==== You must have the 'wget' program installed for this script ====" + exit 1 +fi + +# make sure we're in the top-level directory +if [ ! -d ./po ]; then + echo "==== No ./po directory in the current working directory ====" + exit 1 +fi + +# make sure a package argument was passed to us +if [ -z "$1" ]; then + echo "Usage: $0 PACKAGE, e.g. $0 gst-plugins-good" + exit 1 +fi + +if test "$1" != "gstreamer" -a \ + "$1" != "gst-plugins-base" -a \ + "$1" != "gst-plugins-good" -a \ + "$1" != "gst-plugins-ugly" -a \ + "$1" != "gst-plugins-bad"; then + echo "Unexpected package '$1' ?!" + exit 1 +fi + +PACKAGE="$1" + +DOMAINS_TO_ADD="" +DOMAINS_UPDATED="" +DOMAINS_NOT_IN_LINGUAS="" + +echo "Downloading latest translation files for package $PACKAGE ..." +echo + +for d in $DOMAINS +do + PACKAGE_PO_URL_BASE="http://translationproject.org/latest/$PACKAGE" + PO_URL="$PACKAGE_PO_URL_BASE/$d.po" + PO_FILENAME="$PACKAGE.$d.po" + if wget -q -nc -O $PO_FILENAME $PO_URL; then + # we want all .po files in UTF-8 format really, so convert if needed.. + CHARSET=`grep Content-Type $PO_FILENAME | sed -e 's/.*charset=\(.*\)\\\\n.*/\1/'` + if test "x$CHARSET" != "xUTF-8" -a "x$CHARSET" != "xutf-8"; then + # note: things like the bugs address will be added back by make update-po + if msguniq $PO_FILENAME --no-location \ + --output-file=$PO_FILENAME.utf8 \ + --to-code=UTF-8; then + mv $PO_FILENAME.utf8 $PO_FILENAME + else + echo "**** $d: conversion from $CHARSET to UTF-8 failed ****" + fi + fi + if [ -f "po/$d.po" ]; then + # ./po/foo.po exists, so let's check if ours matches the latest from the + # translation project website + REVDATE_NEW=`grep PO-Revision-Date $PO_FILENAME`; + REVDATE_OLD=`grep PO-Revision-Date po/$d.po`; + CHARSET_OLD=`grep Content-Type po/$d.po | sed -e 's/.*charset=\(.*\)\\\\n.*/\1/'` + if test "x$REVDATE_NEW" = "x$REVDATE_OLD" -a "x$CHARSET_OLD" = "xUTF-8"; then + # note: source code line markers will be removed later by make upload-po + echo "$d.po: up-to-date" + rm -f $PO_FILENAME + else + mv $PO_FILENAME "po/$d.po" + if test "x$CHARSET_OLD" != "xUTF-8" -a "x$CHARSET_OLD" != "xutf-8"; then + echo "$d.po: update (and charset converted from $CHARSET_OLD to UTF-8)" + else + echo "$d.po: updated" + fi + DOMAINS_UPDATED="$DOMAINS_UPDATED $d" + fi + # make sure domain is listed in LINGUAS + if ! grep $d "po/LINGUAS" >/dev/null 2>/dev/null; then + DOMAINS_NOT_IN_LINGUAS="$DOMAINS_NOT_IN_LINGUAS $d" + fi + else + # ./po/foo.po doesn't exist, but foo.po exists on the translation project + # website, so it's probably a new translation + echo "$d.po: new language" + mv $PO_FILENAME "po/$d.po" + DOMAINS_UPDATED="$DOMAINS_UPDATED $d" + DOMAINS_TO_ADD="$DOMAINS_TO_ADD $d" + fi + else + rm -f $PO_FILENAME + echo "$d.po: failure (does probably not exist)" + fi +done + +if [ -n "$DOMAINS_UPDATED" ]; then + echo "====================================================================" + echo + echo "Language domains updated :$DOMAINS_UPDATED" + echo "Language domains to git add :$DOMAINS_TO_ADD" + echo + echo "Source: http://translationproject.org/latest/$PACKAGE/" + echo + if [ -n "$DOMAINS_TO_ADD" ]; then + CMD_STRING="git add" + for d in $DOMAINS_TO_ADD; do + CMD_STRING="$CMD_STRING po/$d.po" + done + echo "Please run" + echo + echo " $CMD_STRING" + echo + echo "now and add the following domains to the po/LINGUAS file:" + echo + echo " $DOMAINS_TO_ADD" + echo + echo + fi + echo "====================================================================" +fi + +if [ -n "$DOMAINS_NOT_IN_LINGUAS" ]; then + echo + echo "Existing domains missing from the po/LINGUAS file:" + echo + echo " $DOMAINS_NOT_IN_LINGUAS" + echo + echo +fi + + diff -Nru gstreamer-vaapi-0.7.0/common/extract-release-date-from-doap-file gstreamer-vaapi-1.8.2/common/extract-release-date-from-doap-file --- gstreamer-vaapi-0.7.0/common/extract-release-date-from-doap-file 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/extract-release-date-from-doap-file 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,32 @@ +#!/bin/sh +# Shell script to extract the date given a release version and a .doap file + +if test "x$1" = "x" -o "x$2" = "x" -o ! -s "$2"; then + echo "Usage: $0 RELEASE-VERSION-NUMBER DOAP-FILE" >&2; + exit 1 +fi + +if ! grep '/dev/null ; then + echo "$2 does not look lika a .doap file" >&2; + exit 1 +fi + +if ! grep "$1" "$2" >/dev/null ; then + echo "$2 contains no reference to a version $1" >&2; + exit 1 +fi + +awk 'BEGIN {x=0} +{ +if ( $0 ~ // ) {x=1; chunk=""} +if (x==1) { + if ($0 ~ //) { chunk = chunk $0 } + if ($0 ~ //) { chunk = chunk $0 } +} +if ($0 ~ /<\/release>/) {x=0; print chunk} +}' < "$2" | \ +\ +grep ''"$1"'' | \ +\ +sed -e 's/^.*//' -e 's/<\/created>.*$//' + diff -Nru gstreamer-vaapi-0.7.0/common/gettext.patch gstreamer-vaapi-1.8.2/common/gettext.patch --- gstreamer-vaapi-0.7.0/common/gettext.patch 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/gettext.patch 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,12 @@ +--- po/Makefile.in.in.orig 2006-01-07 12:03:45.000000000 +0100 ++++ po/Makefile.in.in 2006-01-07 12:04:23.000000000 +0100 +@@ -11,6 +11,9 @@ + PACKAGE = @PACKAGE@ + VERSION = @VERSION@ + ++# thomas: add GETTEXT_PACKAGE substitution as used in Makevars ++GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ ++ + SHELL = /bin/sh + @SET_MAKE@ + diff -Nru gstreamer-vaapi-0.7.0/common/glib-gen.mak gstreamer-vaapi-1.8.2/common/glib-gen.mak --- gstreamer-vaapi-0.7.0/common/glib-gen.mak 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/glib-gen.mak 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,44 @@ +# these are the variables your Makefile.am should set +# the example is based on the colorbalance interface + +#glib_enum_headers=$(colorbalance_headers) +#glib_enum_define=GST_COLOR_BALANCE +#glib_enum_prefix=gst_color_balance + +enum_headers=$(foreach h,$(glib_enum_headers),\n\#include \"$(h)\") + +# these are all the rules generating the relevant files +%-marshal.h: %-marshal.list + $(AM_V_GEN)glib-genmarshal --header --prefix=$(glib_enum_prefix)_marshal $^ > $*-marshal.h.tmp && \ + mv $*-marshal.h.tmp $*-marshal.h + +%-marshal.c: %-marshal.list + $(AM_V_GEN)echo "#include \"$*-marshal.h\"" >> $*-marshal.c.tmp && \ + glib-genmarshal --body --prefix=$(glib_enum_prefix)_marshal $^ >> $*-marshal.c.tmp && \ + mv $*-marshal.c.tmp $*-marshal.c + +%-enumtypes.h: $(glib_enum_headers) + $(AM_V_GEN)glib-mkenums \ + --fhead "#ifndef __$(glib_enum_define)_ENUM_TYPES_H__\n#define __$(glib_enum_define)_ENUM_TYPES_H__\n\n#include \n\nG_BEGIN_DECLS\n" \ + --fprod "\n/* enumerations from \"@filename@\" */\n" \ + --vhead "GType @enum_name@_get_type (void);\n#define GST_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ + --ftail "G_END_DECLS\n\n#endif /* __$(glib_enum_define)_ENUM_TYPES_H__ */" \ + $^ > $@ + +%-enumtypes.c: $(glib_enum_headers) + @if test "x$(glib_enum_headers)" = "x"; then echo "ERROR: glib_enum_headers is empty, please fix Makefile"; exit 1; fi + $(AM_V_GEN)glib-mkenums \ + --fhead "#include \"$*-enumtypes.h\"\n$(enum_headers)" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n if (g_once_init_enter (&g_define_type_id__volatile)) {\n static const G@Type@Value values[] = {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n GType g_define_type_id = g_@type@_register_static (\"@EnumName@\", values);\n g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n }\n return g_define_type_id__volatile;\n}\n" \ + $^ > $@ + +# a hack rule to make sure .Plo files exist because they get include'd +# from Makefile's +.deps/%-marshal.Plo: + @touch $@ + +.deps/%-enumtypes.Plo: + @touch $@ diff -Nru gstreamer-vaapi-0.7.0/common/gst-autogen.sh gstreamer-vaapi-1.8.2/common/gst-autogen.sh --- gstreamer-vaapi-0.7.0/common/gst-autogen.sh 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/gst-autogen.sh 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,135 @@ +# a silly hack that generates autoregen.sh but it's handy +# Remove the old autoregen.sh first to create a new file, +# as the current one may be being read by the shell executing +# this script. +if [ -f "autoregen.sh" ]; then + rm autoregen.sh +fi +echo "#!/bin/sh" > autoregen.sh +echo "./autogen.sh $@ \$@" >> autoregen.sh +chmod +x autoregen.sh + +# helper functions for autogen.sh + +debug () +# print out a debug message if DEBUG is a defined variable +{ + if test ! -z "$DEBUG" + then + echo "DEBUG: $1" + fi +} + + +autogen_options () +{ + if test "x$1" = "x"; then + return 0 + fi + + while test "x$1" != "x" ; do + optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + case "$1" in + --noconfigure) + NOCONFIGURE=defined + AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --noconfigure" + echo "+ configure run disabled" + shift + ;; + --nocheck) + AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --nocheck" + NOCHECK=defined + echo "+ autotools version check disabled" + shift + ;; + -d|--debug) + DEBUG=defined + AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --debug" + echo "+ debug output enabled" + shift + ;; + -h|--help) + echo "autogen.sh (autogen options) -- (configure options)" + echo "autogen.sh help options: " + echo " --noconfigure don't run the configure script" + echo " --nocheck don't do version checks" + echo " --debug debug the autogen process" + echo + echo " --with-autoconf PATH use autoconf in PATH" + echo " --with-automake PATH use automake in PATH" + echo + echo "Any argument either not in the above list or after a '--' will be " + echo "passed to ./configure." + exit 1 + ;; + --with-automake=*) + AUTOMAKE=$optarg + echo "+ using alternate automake in $optarg" + CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-automake=$AUTOMAKE" + shift + ;; + --with-autoconf=*) + AUTOCONF=$optarg + echo "+ using alternate autoconf in $optarg" + CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-autoconf=$AUTOCONF" + shift + ;; + --) shift ; break ;; + *) + echo "+ passing argument $1 to configure" + CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT $1" + shift + ;; + esac + done + + for arg do CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT $arg"; done + if test ! -z "$CONFIGURE_EXT_OPT" + then + echo "+ options passed to configure: $CONFIGURE_EXT_OPT" + fi +} + +toplevel_check () +{ + srcfile=$1 + test -f $srcfile || { + echo "You must run this script in the top-level $package directory" + exit 1 + } +} + +tool_run () +{ + tool=$1 + options=$2 + run_if_fail=$3 + echo "+ running $tool $options..." + $tool $options || { + echo + echo $tool failed + eval $run_if_fail + exit 1 + } +} + +install_git_hooks () +{ + if test -d .git; then + # install pre-commit hook for doing clean commits + for hook in pre-commit; do + if test ! \( -x .git/hooks/$hook -a -L .git/hooks/$hook \); then + echo "+ Installing git $hook hook" + rm -f .git/hooks/$hook + ln -s ../../common/hooks/$hook.hook .git/hooks/$hook || { + # if we couldn't create a symbolic link, try doing a plain cp + if cp common/hooks/pre-commit.hook .git/hooks/pre-commit; then + chmod +x .git/hooks/pre-commit; + else + echo "********** Couldn't install git $hook hook **********"; + fi + } + fi + done + fi +} diff -Nru gstreamer-vaapi-0.7.0/common/gstdoc-scangobj gstreamer-vaapi-1.8.2/common/gstdoc-scangobj --- gstreamer-vaapi-0.7.0/common/gstdoc-scangobj 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/gstdoc-scangobj 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,1752 @@ +#!/usr/bin/env perl +# -*- cperl -*- +# +# gtk-doc - GTK DocBook documentation generator. +# Copyright (C) 1998 Damon Chaplin +# +# 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 St, Fifth Floor, Boston, MA 02110-1301, USA. +# + +# +# This gets information about object hierarchies and signals +# by compiling a small C program. CFLAGS and LDFLAGS must be +# set appropriately before running this script. +# + +use Getopt::Long; + +my $GTK_DOC_PREFIX=`pkg-config --variable prefix gtk-doc`; +if ($GTK_DOC_PREFIX) { + chomp $GTK_DOC_PREFIX; + #print "Adding $GTK_DOC_PREFIX/share/gtk-doc/data to \@INC\n"; + unshift @INC, "$GTK_DOC_PREFIX/share/gtk-doc/data"; +} else { + unshift @INC, '/usr/share/gtk-doc/data'; +} +require "gtkdoc-common.pl"; + +# Options + +# name of documentation module +my $MODULE; +my $OUTPUT_DIR; +my $INSPECT_DIR; +my $VERBOSE; +my $PRINT_VERSION; +my $PRINT_HELP; +my $TYPE_INIT_FUNC="g_type_init ()"; + +# --nogtkinit is deprecated, as it is the default now anyway. +%optctl = (module => \$MODULE, + source => \$SOURCE, + types => \$TYPES_FILE, + nogtkinit => \$NO_GTK_INIT, + 'type-init-func' => \$TYPE_INIT_FUNC, + 'output-dir' => \$OUTPUT_DIR, + 'inspect-dir' => \$INSPECT_DIR, + 'verbose' => \$VERBOSE, + 'version' => \$PRINT_VERSION, + 'help' => \$PRINT_HELP); + +GetOptions(\%optctl, "module=s", "source=s", "types:s", "output-dir:s", "inspect-dir:s", "nogtkinit", "type-init-func:s", "verbose", "version", "help"); + +if ($NO_GTK_INIT) { + # Do nothing. This just avoids a warning. + # the option is not used anymore +} + +if ($PRINT_VERSION) { + print "1.5\n"; + exit 0; +} + +if (!$MODULE) { + $PRINT_HELP = 1; +} + +if ($PRINT_HELP) { + print <$MODULE-scan.c") || die "Cannot open $MODULE-scan.c: $!\n"; + +my $old_signals_filename = "$OUTPUT_DIR/$MODULE.signals"; +my $new_signals_filename = "$OUTPUT_DIR/$MODULE.signals.new"; +my $old_hierarchy_filename = "$OUTPUT_DIR/$MODULE.hierarchy"; +my $new_hierarchy_filename = "$OUTPUT_DIR/$MODULE.hierarchy.new"; +my $old_interfaces_filename = "$OUTPUT_DIR/$MODULE.interfaces"; +my $new_interfaces_filename = "$OUTPUT_DIR/$MODULE.interfaces.new"; +my $old_prerequisites_filename = "$OUTPUT_DIR/$MODULE.prerequisites"; +my $new_prerequisites_filename = "$OUTPUT_DIR/$MODULE.prerequisites.new"; +my $old_args_filename = "$OUTPUT_DIR/$MODULE.args"; +my $new_args_filename = "$OUTPUT_DIR/$MODULE.args.new"; +my $old_sections_filename = "$OUTPUT_DIR/$MODULE-sections"; +my $new_sections_filename = "$OUTPUT_DIR/$MODULE-sections.new"; + +my $debug_log="g_message"; +if (!defined($VERBOSE) or $VERBOSE eq "0") { + $debug_log="//$debug_log"; +} + +# write a C program to scan the types + +$includes = ""; +@types = (); +@impl_types = (); + +for () { + if (/^#include/) { + $includes .= $_; + } elsif (/^%/) { + next; + } elsif (/^\s*$/) { + next; + } elsif (/^type:(.*)$/) { + $t = $1; + chomp $t; + push @impl_types, $t; + } else { + chomp; + push @types, $_; + } +} + +$ntypes = @types + @impl_types + 1; + +print OUTPUT < +#include +#include +#include + +#include +EOT + +if ($includes) { + print OUTPUT $includes; +} else { + for (@types) { + print OUTPUT "extern GType $_ (void);\n"; + } +} + +print OUTPUT < +#endif + +static GType *object_types = NULL; + +static GString *xmlstr = NULL; + +static const gchar* +xmlprint (gint indent, const gchar *tag, const gchar *data) +{ + const gchar indent_str[] = " "; + + /* reset */ + g_string_truncate (xmlstr, 0); + g_string_append_len (xmlstr, indent_str, MIN (indent, strlen (indent_str))); + g_string_append_printf (xmlstr, "<%s>", tag); + + if (data) { + gchar *s; + + s = g_markup_escape_text (data, -1); + g_string_append (xmlstr, s); + g_free (s); + } + + g_string_append_printf (xmlstr, "\\n", tag); + return xmlstr->str; +} + +static gint +gst_feature_sort_compare (gconstpointer a, gconstpointer b) +{ + const gchar *name_a = gst_plugin_feature_get_name ((GstPluginFeature *) a); + const gchar *name_b = gst_plugin_feature_get_name ((GstPluginFeature *) b); + return strcmp (name_a, name_b); +} + +static gint +static_pad_template_compare (gconstpointer a, gconstpointer b) +{ + GstStaticPadTemplate *spt_a = (GstStaticPadTemplate *) a; + GstStaticPadTemplate *spt_b = (GstStaticPadTemplate *) b; + + /* we want SINK before SRC (enum is UNKNOWN, SRC, SINK) */ + if (spt_a->direction != spt_b->direction) + return spt_b->direction - spt_a->direction; + + /* we want ALWAYS first, SOMETIMES second, REQUEST last + * (enum is ALWAYS, SOMETIMES, REQUEST) */ + if (spt_a->presence != spt_b->presence) + return spt_a->presence - spt_b->presence; + + return strcmp (spt_a->name_template, spt_b->name_template); +} + +static GType * +get_object_types (void) +{ + gpointer g_object_class; + GList *plugins = NULL; + GList *factories = NULL; + GList *l; + GstElementFactory *factory = NULL; + GType type; + gint i = 0; + gboolean reinspect; + + /* get a list of features from plugins in our source module */ + plugins = gst_registry_get_plugin_list (gst_registry_get ()); + + xmlstr = g_string_new (""); + + reinspect = !g_file_test ("scanobj-build.stamp", G_FILE_TEST_EXISTS); + + while (plugins) { + GList *features; + GstPlugin *plugin; + const gchar *source; + FILE *inspect = NULL; + gchar *inspect_name; + + plugin = (GstPlugin *) (plugins->data); + plugins = g_list_next (plugins); + source = gst_plugin_get_source (plugin); + if (!source || strcmp (source, "$SOURCE") != 0) { + continue; + } + + /* skip static coreelements plugin with pipeline and bin element factory */ + if (gst_plugin_get_filename (plugin) == NULL) + continue; + + $debug_log ("plugin: %s source: %s", gst_plugin_get_name (plugin), source); + + if (reinspect) { + gchar *basename; + + inspect_name = g_strdup_printf ("$INSPECT_DIR" G_DIR_SEPARATOR_S "plugin-%s.xml", + gst_plugin_get_name (plugin)); + inspect = fopen (inspect_name, "w"); + if (inspect == NULL) { + g_error ("Could not open %s for writing: %s\\n", inspect_name, + g_strerror (errno)); + } + g_free (inspect_name); + + basename = g_path_get_basename (gst_plugin_get_filename (plugin)); + + /* output plugin data */ + fputs ("\\n",inspect); + fputs (xmlprint(2, "name", gst_plugin_get_name (plugin)),inspect); + fputs (xmlprint(2, "description", gst_plugin_get_description (plugin)),inspect); + fputs (xmlprint(2, "filename", gst_plugin_get_filename (plugin)),inspect); + fputs (xmlprint(2, "basename", basename),inspect); + fputs (xmlprint(2, "version", gst_plugin_get_version (plugin)),inspect); + fputs (xmlprint(2, "license", gst_plugin_get_license (plugin)),inspect); + fputs (xmlprint(2, "source", gst_plugin_get_source (plugin)),inspect); + fputs (xmlprint(2, "package", gst_plugin_get_package (plugin)),inspect); + fputs (xmlprint(2, "origin", gst_plugin_get_origin (plugin)),inspect); + fputs (" \\n", inspect); + + g_free (basename); + } + + features = + gst_registry_get_feature_list_by_plugin (gst_registry_get (), + gst_plugin_get_name (plugin)); + + /* sort factories by feature->name */ + features = g_list_sort (features, gst_feature_sort_compare); + + while (features) { + GstPluginFeature *feature; + feature = GST_PLUGIN_FEATURE (features->data); + feature = gst_plugin_feature_load (feature); + if (!feature) { + g_warning ("Could not load plugin feature %s", + gst_plugin_feature_get_name (feature)); + } + + if (GST_IS_ELEMENT_FACTORY (feature)) { + const gchar *pad_dir[] = { "unknown","source","sink" }; + const gchar *pad_pres[] = { "always","sometimes","request" }; + GList *pads, *pad; + + $debug_log (" feature: %s", gst_plugin_feature_get_name (feature)); + + factory = GST_ELEMENT_FACTORY (feature); + factories = g_list_prepend (factories, factory); + + if (reinspect) { + /* output element data */ + fputs (" \\n", inspect); + fputs (xmlprint(6, "name", gst_plugin_feature_get_name (feature)),inspect); + fputs (xmlprint(6, "longname", gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_LONGNAME)),inspect); + fputs (xmlprint(6, "class", gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_KLASS)),inspect); + fputs (xmlprint(6, "description", gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_DESCRIPTION)),inspect); + fputs (xmlprint(6, "author", gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_AUTHOR)),inspect); + fputs (" \\n", inspect); + + /* output pad-template data */ + pads = g_list_copy ((GList *) gst_element_factory_get_static_pad_templates (factory)); + pads = g_list_sort (pads, static_pad_template_compare); + for (pad = pads; pad != NULL; pad = pad->next) { + GstStaticPadTemplate *pt = pad->data; + + fputs (" \\n", inspect); + fputs (xmlprint(10, "name", pt->name_template),inspect); + fputs (xmlprint(10, "direction", pad_dir[pt->direction]),inspect); + fputs (xmlprint(10, "presence", pad_pres[pt->presence]),inspect); + fputs (xmlprint(10, "details", pt->static_caps.string),inspect); + fputs (" \\n", inspect); + } + g_list_free (pads); + fputs (" \\n \\n", inspect); + } + } + features = g_list_next (features); + } + + if (reinspect) { + fputs (" \\n", inspect); + fclose (inspect); + } + } + + g_string_free (xmlstr, TRUE); + + $debug_log ("number of element factories: %d", g_list_length (factories)); + + /* allocate the object_types array to hold them */ + object_types = g_new0 (GType, g_list_length (factories)+$ntypes+1); + + l = factories; + i = 0; + + /* fill it */ + while (l) { + factory = GST_ELEMENT_FACTORY (l->data); + type = gst_element_factory_get_element_type (factory); + if (type != 0) { + $debug_log ("adding type for factory %s", gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_LONGNAME)); + object_types[i++] = type; + } else { + g_message ("type info for factory %s not found", + gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_LONGNAME)); + } + l = g_list_next (l); + } + +EOT + +# get_type functions: +for (@types) { +print OUTPUT < uppercase with '_' + * GFileMonitor -> file_monitor + * GIOExtensionPoint -> extension_point + * GtkTreeView -> tree_view + * if 2nd char is upper case too + * search for first lower case and go back one char + * else + * search for next upper case + */ + if (!strncmp (object_name, "Gtk", 3)) + object_arg = object_name + 3; + else if (!strncmp (object_name, "Gnome", 5)) + object_arg = object_name + 5; + else + object_arg = object_name; + + object_arg_lower = g_ascii_strdown (object_arg, -1); + sprintf (pos, "*%s\\n", object_arg_lower); + pos += strlen (pos); + if (!strncmp (object_arg_lower, "widget", 6)) + widget_num = 2; + g_free(object_arg_lower); + + /* Convert signal name to use underscores rather than dashes '-'. */ + strncpy (signal_name, query_info.signal_name, 127); + signal_name[127] = '\\0'; + for (i = 0; signal_name[i]; i++) + { + if (signal_name[i] == '-') + signal_name[i] = '_'; + } + + /* Output the signal parameters. */ + for (param = 0; param < query_info.n_params; param++) + { + type_name = get_type_name (query_info.param_types[param] & ~G_SIGNAL_TYPE_STATIC_SCOPE, &is_pointer); + + /* Most arguments to the callback are called "arg1", "arg2", etc. + GtkWidgets are called "widget", "widget2", ... + GtkCallbacks are called "callback", "callback2", ... */ + if (!strcmp (type_name, "GtkWidget")) + { + arg_name = "widget"; + arg_num = &widget_num; + } + else if (!strcmp (type_name, "GtkCallback") + || !strcmp (type_name, "GtkCCallback")) + { + arg_name = "callback"; + arg_num = &callback_num; + } + else + { + arg_name = "arg"; + arg_num = ¶m_num; + } + sprintf (pos, "%s ", type_name); + pos += strlen (pos); + + if (!arg_num || *arg_num == 0) + sprintf (pos, "%s%s\\n", is_pointer ? "*" : " ", arg_name); + else + sprintf (pos, "%s%s%i\\n", is_pointer ? "*" : " ", arg_name, + *arg_num); + pos += strlen (pos); + + if (arg_num) + { + if (*arg_num == 0) + *arg_num = 2; + else + *arg_num += 1; + } + } + + pos = flags; + /* We use one-character flags for simplicity. */ + if (query_info.signal_flags & G_SIGNAL_RUN_FIRST) + *pos++ = 'f'; + if (query_info.signal_flags & G_SIGNAL_RUN_LAST) + *pos++ = 'l'; + if (query_info.signal_flags & G_SIGNAL_RUN_CLEANUP) + *pos++ = 'c'; + if (query_info.signal_flags & G_SIGNAL_NO_RECURSE) + *pos++ = 'r'; + if (query_info.signal_flags & G_SIGNAL_DETAILED) + *pos++ = 'd'; + if (query_info.signal_flags & G_SIGNAL_ACTION) + *pos++ = 'a'; + if (query_info.signal_flags & G_SIGNAL_NO_HOOKS) + *pos++ = 'h'; + *pos = 0; + + /* Output the return type and function name. */ + ret_type = get_type_name (query_info.return_type & ~G_SIGNAL_TYPE_STATIC_SCOPE, &is_pointer); + + fprintf (fp, + "\\n%s::%s\\n%s%s\\n%s\\n%s\\n\\n", + object_name, query_info.signal_name, ret_type, is_pointer ? "*" : "", flags, buffer); +} + + +/* Returns the type name to use for a signal argument or return value, given + the GtkType from the signal info. It also sets is_pointer to TRUE if the + argument needs a '*' since it is a pointer. */ +static const gchar * +get_type_name (GType type, gboolean * is_pointer) +{ + const gchar *type_name; + + *is_pointer = FALSE; + type_name = g_type_name (type); + + switch (type) { + case G_TYPE_NONE: + case G_TYPE_CHAR: + case G_TYPE_UCHAR: + case G_TYPE_BOOLEAN: + case G_TYPE_INT: + case G_TYPE_UINT: + case G_TYPE_LONG: + case G_TYPE_ULONG: + case G_TYPE_FLOAT: + case G_TYPE_DOUBLE: + case G_TYPE_POINTER: + /* These all have normal C type names so they are OK. */ + return type_name; + + case G_TYPE_STRING: + /* A GtkString is really a gchar*. */ + *is_pointer = TRUE; + return "gchar"; + + case G_TYPE_ENUM: + case G_TYPE_FLAGS: + /* We use a gint for both of these. Hopefully a subtype with a decent + name will be registered and used instead, as GTK+ does itself. */ + return "gint"; + + case G_TYPE_BOXED: + /* The boxed type shouldn't be used itself, only subtypes. Though we + return 'gpointer' just in case. */ + return "gpointer"; + + case G_TYPE_PARAM: + /* A GParam is really a GParamSpec*. */ + *is_pointer = TRUE; + return "GParamSpec"; + +#if GLIB_CHECK_VERSION (2, 25, 9) + case G_TYPE_VARIANT: + *is_pointer = TRUE; + return "GVariant"; +#endif + +default: + break; + } + + /* For all GObject subclasses we can use the class name with a "*", + e.g. 'GtkWidget *'. */ + if (g_type_is_a (type, G_TYPE_OBJECT)) + *is_pointer = TRUE; + + /* Also catch non GObject root types */ + if (G_TYPE_IS_CLASSED (type)) + *is_pointer = TRUE; + + /* All boxed subtypes will be pointers as well. */ + /* Exception: GStrv */ + if (g_type_is_a (type, G_TYPE_BOXED) && + !g_type_is_a (type, G_TYPE_STRV)) + *is_pointer = TRUE; + + /* All pointer subtypes will be pointers as well. */ + if (g_type_is_a (type, G_TYPE_POINTER)) + *is_pointer = TRUE; + + /* But enums are not */ + if (g_type_is_a (type, G_TYPE_ENUM) || + g_type_is_a (type, G_TYPE_FLAGS)) + *is_pointer = FALSE; + + return type_name; +} + + +/* This outputs the hierarchy of all objects which have been initialized, + i.e. by calling their XXX_get_type() initialization function. */ +static void +output_object_hierarchy (void) +{ + FILE *fp; + gint i,j; + GType root, type; + GType root_types[$ntypes] = { G_TYPE_INVALID, }; + + fp = fopen (hierarchy_filename, "w"); + if (fp == NULL) + { + g_warning ("Couldn't open output file: %s : %s", hierarchy_filename, g_strerror(errno)); + return; + } + output_hierarchy (fp, G_TYPE_OBJECT, 0); + output_hierarchy (fp, G_TYPE_INTERFACE, 0); + + for (i=0; object_types[i]; i++) { + root = object_types[i]; + while ((type = g_type_parent (root))) { + root = type; + } + if ((root != G_TYPE_OBJECT) && (root != G_TYPE_INTERFACE)) { + for (j=0; root_types[j]; j++) { + if (root == root_types[j]) { + root = G_TYPE_INVALID; break; + } + } + if(root) { + root_types[j] = root; + output_hierarchy (fp, root, 0); + } + } + } + + fclose (fp); +} + +static int +compare_types (const void *a, const void *b) +{ + const char *na = g_type_name (*((GType *)a)); + const char *nb = g_type_name (*((GType *)b)); + + return g_strcmp0 (na, nb); +} + + +/* This is called recursively to output the hierarchy of a object. */ +static void +output_hierarchy (FILE *fp, + GType type, + guint level) +{ + guint i; + GType *children; + guint n_children; + + if (!type) + return; + + for (i = 0; i < level; i++) + fprintf (fp, " "); + fprintf (fp, "%s\\n", g_type_name (type)); + + children = g_type_children (type, &n_children); + qsort (children, n_children, sizeof (GType), compare_types); + + + for (i=0; i < n_children; i++) + output_hierarchy (fp, children[i], level + 1); + + g_free (children); +} + +static void output_object_interfaces (void) +{ + guint i; + FILE *fp; + + fp = fopen (interfaces_filename, "w"); + if (fp == NULL) + { + g_warning ("Couldn't open output file: %s : %s", interfaces_filename, g_strerror(errno)); + return; + } + output_interfaces (fp, G_TYPE_OBJECT); + + for (i = 0; object_types[i]; i++) + { + if (!g_type_parent (object_types[i]) && + (object_types[i] != G_TYPE_OBJECT) && + G_TYPE_IS_INSTANTIATABLE (object_types[i])) + { + output_interfaces (fp, object_types[i]); + } + } + fclose (fp); +} + +static void +output_interfaces (FILE *fp, + GType type) +{ + guint i; + GType *children, *interfaces; + guint n_children, n_interfaces; + + if (!type) + return; + + interfaces = g_type_interfaces (type, &n_interfaces); + + if (n_interfaces > 0) + { + fprintf (fp, "%s", g_type_name (type)); + for (i=0; i < n_interfaces; i++) + fprintf (fp, " %s", g_type_name (interfaces[i])); + fprintf (fp, "\\n"); + } + g_free (interfaces); + + children = g_type_children (type, &n_children); + + for (i=0; i < n_children; i++) + output_interfaces (fp, children[i]); + + g_free (children); +} + +static void output_interface_prerequisites (void) +{ + FILE *fp; + + fp = fopen (prerequisites_filename, "w"); + if (fp == NULL) + { + g_warning ("Couldn't open output file: %s : %s", prerequisites_filename, g_strerror(errno)); + return; + } + output_prerequisites (fp, G_TYPE_INTERFACE); + fclose (fp); +} + +static void +output_prerequisites (FILE *fp, + GType type) +{ +#if GLIB_CHECK_VERSION(2,1,0) + guint i; + GType *children, *prerequisites; + guint n_children, n_prerequisites; + + if (!type) + return; + + prerequisites = g_type_interface_prerequisites (type, &n_prerequisites); + + if (n_prerequisites > 0) + { + fprintf (fp, "%s", g_type_name (type)); + for (i=0; i < n_prerequisites; i++) + fprintf (fp, " %s", g_type_name (prerequisites[i])); + fprintf (fp, "\\n"); + } + g_free (prerequisites); + + children = g_type_children (type, &n_children); + + for (i=0; i < n_children; i++) + output_prerequisites (fp, children[i]); + + g_free (children); +#endif +} + +static void +output_args (void) +{ + FILE *fp; + gint i; + + fp = fopen (args_filename, "w"); + if (fp == NULL) + { + g_warning ("Couldn't open output file: %s : %s", args_filename, g_strerror(errno)); + return; + } + + for (i = 0; object_types[i]; i++) { + output_object_args (fp, object_types[i]); + } + + fclose (fp); +} + +static gint +compare_param_specs (const void *a, const void *b) +{ + GParamSpec *spec_a = *(GParamSpec **)a; + GParamSpec *spec_b = *(GParamSpec **)b; + + return strcmp (g_param_spec_get_name (spec_a), g_param_spec_get_name (spec_b)); +} + +/* Its common to have unsigned properties restricted + * to the signed range. Therefore we make this look + * a bit nicer by spelling out the max constants. + */ + +/* Don't use "==" with floats, it might trigger a gcc warning. */ +#define GTKDOC_COMPARE_FLOAT(x, y) (x <= y && x >= y) + +static gchar* +describe_double_constant (gdouble value) +{ + gchar *desc; + + if (GTKDOC_COMPARE_FLOAT (value, G_MAXDOUBLE)) + desc = g_strdup ("G_MAXDOUBLE"); + else if (GTKDOC_COMPARE_FLOAT (value, G_MINDOUBLE)) + desc = g_strdup ("G_MINDOUBLE"); + else if (GTKDOC_COMPARE_FLOAT (value, -G_MAXDOUBLE)) + desc = g_strdup ("-G_MAXDOUBLE"); + else if (GTKDOC_COMPARE_FLOAT (value, G_MAXFLOAT)) + desc = g_strdup ("G_MAXFLOAT"); + else if (GTKDOC_COMPARE_FLOAT (value, G_MINFLOAT)) + desc = g_strdup ("G_MINFLOAT"); + else if (GTKDOC_COMPARE_FLOAT (value, -G_MAXFLOAT)) + desc = g_strdup ("-G_MAXFLOAT"); + else{ + /* make sure floats are output with a decimal dot irrespective of + * current locale. Use formatd since we want human-readable numbers + * and do not need the exact same bit representation when deserialising */ + desc = g_malloc0 (G_ASCII_DTOSTR_BUF_SIZE); + g_ascii_formatd (desc, G_ASCII_DTOSTR_BUF_SIZE, "%g", value); + } + + return desc; +} + +static gchar* +describe_signed_constant (gsize size, gint64 value) +{ + gchar *desc = NULL; + + switch (size) { + case 8: + if (value == G_MAXINT64) + desc = g_strdup ("G_MAXINT64"); + else if (value == G_MININT64) + desc = g_strdup ("G_MININT64"); + /* fall through */ + case 4: + if (sizeof (int) == 4) { + if (value == G_MAXINT) + desc = g_strdup ("G_MAXINT"); + else if (value == G_MININT) + desc = g_strdup ("G_MININT"); + else if (value == (gint64)G_MAXUINT) + desc = g_strdup ("G_MAXUINT"); + } + if (value == G_MAXLONG) + desc = g_strdup ("G_MAXLONG"); + else if (value == G_MINLONG) + desc = g_strdup ("G_MINLONG"); + else if (value == (gint64)G_MAXULONG) + desc = g_strdup ("G_MAXULONG"); + /* fall through */ + case 2: + if (sizeof (int) == 2) { + if (value == G_MAXINT) + desc = g_strdup ("G_MAXINT"); + else if (value == G_MININT) + desc = g_strdup ("G_MININT"); + else if (value == (gint64)G_MAXUINT) + desc = g_strdup ("G_MAXUINT"); + } + break; + default: + break; + } + if (!desc) + desc = g_strdup_printf ("%" G_GINT64_FORMAT, value); + + return desc; +} + +static gchar* +describe_unsigned_constant (gsize size, guint64 value) +{ + gchar *desc = NULL; + + switch (size) { + case 8: + if (value == G_MAXINT64) + desc = g_strdup ("G_MAXINT64"); + else if (value == G_MAXUINT64) + desc = g_strdup ("G_MAXUINT64"); + /* fall through */ + case 4: + if (sizeof (int) == 4) { + if (value == (guint64)G_MAXINT) + desc = g_strdup ("G_MAXINT"); + else if (value == G_MAXUINT) + desc = g_strdup ("G_MAXUINT"); + } + if (value == (guint64)G_MAXLONG) + desc = g_strdup ("G_MAXLONG"); + else if (value == G_MAXULONG) + desc = g_strdup ("G_MAXULONG"); + /* fall through */ + case 2: + if (sizeof (int) == 2) { + if (value == (guint64)G_MAXINT) + desc = g_strdup ("G_MAXINT"); + else if (value == G_MAXUINT) + desc = g_strdup ("G_MAXUINT"); + } + break; + default: + break; + } + if (!desc) + desc = g_strdup_printf ("%" G_GUINT64_FORMAT, value); + + return desc; +} + +static gchar* +describe_type (GParamSpec *spec) +{ + gchar *desc; + gchar *lower; + gchar *upper; + + if (G_IS_PARAM_SPEC_CHAR (spec)) + { + GParamSpecChar *pspec = G_PARAM_SPEC_CHAR (spec); + + lower = describe_signed_constant (sizeof(gchar), pspec->minimum); + upper = describe_signed_constant (sizeof(gchar), pspec->maximum); + if (pspec->minimum == G_MININT8 && pspec->maximum == G_MAXINT8) + desc = g_strdup (""); + else if (pspec->minimum == G_MININT8) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXINT8) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_UCHAR (spec)) + { + GParamSpecUChar *pspec = G_PARAM_SPEC_UCHAR (spec); + + lower = describe_unsigned_constant (sizeof(guchar), pspec->minimum); + upper = describe_unsigned_constant (sizeof(guchar), pspec->maximum); + if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT8) + desc = g_strdup (""); + else if (pspec->minimum == 0) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXUINT8) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_INT (spec)) + { + GParamSpecInt *pspec = G_PARAM_SPEC_INT (spec); + + lower = describe_signed_constant (sizeof(gint), pspec->minimum); + upper = describe_signed_constant (sizeof(gint), pspec->maximum); + if (pspec->minimum == G_MININT && pspec->maximum == G_MAXINT) + desc = g_strdup (""); + else if (pspec->minimum == G_MININT) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXINT) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_UINT (spec)) + { + GParamSpecUInt *pspec = G_PARAM_SPEC_UINT (spec); + + lower = describe_unsigned_constant (sizeof(guint), pspec->minimum); + upper = describe_unsigned_constant (sizeof(guint), pspec->maximum); + if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT) + desc = g_strdup (""); + else if (pspec->minimum == 0) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXUINT) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_LONG (spec)) + { + GParamSpecLong *pspec = G_PARAM_SPEC_LONG (spec); + + lower = describe_signed_constant (sizeof(glong), pspec->minimum); + upper = describe_signed_constant (sizeof(glong), pspec->maximum); + if (pspec->minimum == G_MINLONG && pspec->maximum == G_MAXLONG) + desc = g_strdup (""); + else if (pspec->minimum == G_MINLONG) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXLONG) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_ULONG (spec)) + { + GParamSpecULong *pspec = G_PARAM_SPEC_ULONG (spec); + + lower = describe_unsigned_constant (sizeof(gulong), pspec->minimum); + upper = describe_unsigned_constant (sizeof(gulong), pspec->maximum); + if (pspec->minimum == 0 && pspec->maximum == G_MAXULONG) + desc = g_strdup (""); + else if (pspec->minimum == 0) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXULONG) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_INT64 (spec)) + { + GParamSpecInt64 *pspec = G_PARAM_SPEC_INT64 (spec); + + lower = describe_signed_constant (sizeof(gint64), pspec->minimum); + upper = describe_signed_constant (sizeof(gint64), pspec->maximum); + if (pspec->minimum == G_MININT64 && pspec->maximum == G_MAXINT64) + desc = g_strdup (""); + else if (pspec->minimum == G_MININT64) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXINT64) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_UINT64 (spec)) + { + GParamSpecUInt64 *pspec = G_PARAM_SPEC_UINT64 (spec); + + lower = describe_unsigned_constant (sizeof(guint64), pspec->minimum); + upper = describe_unsigned_constant (sizeof(guint64), pspec->maximum); + if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT64) + desc = g_strdup (""); + else if (pspec->minimum == 0) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXUINT64) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_FLOAT (spec)) + { + GParamSpecFloat *pspec = G_PARAM_SPEC_FLOAT (spec); + + lower = describe_double_constant (pspec->minimum); + upper = describe_double_constant (pspec->maximum); + if (GTKDOC_COMPARE_FLOAT (pspec->minimum, -G_MAXFLOAT)) + { + if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXFLOAT)) + desc = g_strdup (""); + else + desc = g_strdup_printf ("<= %s", upper); + } + else if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXFLOAT)) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_DOUBLE (spec)) + { + GParamSpecDouble *pspec = G_PARAM_SPEC_DOUBLE (spec); + + lower = describe_double_constant (pspec->minimum); + upper = describe_double_constant (pspec->maximum); + if (GTKDOC_COMPARE_FLOAT (pspec->minimum, -G_MAXDOUBLE)) + { + if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXDOUBLE)) + desc = g_strdup (""); + else + desc = g_strdup_printf ("<= %s", upper); + } + else if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXDOUBLE)) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } +#if GLIB_CHECK_VERSION (2, 12, 0) + else if (G_IS_PARAM_SPEC_GTYPE (spec)) + { + GParamSpecGType *pspec = G_PARAM_SPEC_GTYPE (spec); + gboolean is_pointer; + + desc = g_strdup (get_type_name (pspec->is_a_type, &is_pointer)); + } +#endif +#if GLIB_CHECK_VERSION (2, 25, 9) + else if (G_IS_PARAM_SPEC_VARIANT (spec)) + { + GParamSpecVariant *pspec = G_PARAM_SPEC_VARIANT (spec); + gchar *variant_type; + + variant_type = g_variant_type_dup_string (pspec->type); + desc = g_strdup_printf ("GVariant<%s>", variant_type); + g_free (variant_type); + } +#endif + else + { + desc = g_strdup (""); + } + + return desc; +} + +static gchar* +describe_default (GParamSpec *spec) +{ + gchar *desc; + + if (G_IS_PARAM_SPEC_CHAR (spec)) + { + GParamSpecChar *pspec = G_PARAM_SPEC_CHAR (spec); + + desc = g_strdup_printf ("%d", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_UCHAR (spec)) + { + GParamSpecUChar *pspec = G_PARAM_SPEC_UCHAR (spec); + + desc = g_strdup_printf ("%u", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_BOOLEAN (spec)) + { + GParamSpecBoolean *pspec = G_PARAM_SPEC_BOOLEAN (spec); + + desc = g_strdup_printf ("%s", pspec->default_value ? "TRUE" : "FALSE"); + } + else if (G_IS_PARAM_SPEC_INT (spec)) + { + GParamSpecInt *pspec = G_PARAM_SPEC_INT (spec); + + desc = g_strdup_printf ("%d", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_UINT (spec)) + { + GParamSpecUInt *pspec = G_PARAM_SPEC_UINT (spec); + + desc = g_strdup_printf ("%u", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_LONG (spec)) + { + GParamSpecLong *pspec = G_PARAM_SPEC_LONG (spec); + + desc = g_strdup_printf ("%ld", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_LONG (spec)) + { + GParamSpecULong *pspec = G_PARAM_SPEC_ULONG (spec); + + desc = g_strdup_printf ("%lu", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_INT64 (spec)) + { + GParamSpecInt64 *pspec = G_PARAM_SPEC_INT64 (spec); + + desc = g_strdup_printf ("%" G_GINT64_FORMAT, pspec->default_value); + } + else if (G_IS_PARAM_SPEC_UINT64 (spec)) + { + GParamSpecUInt64 *pspec = G_PARAM_SPEC_UINT64 (spec); + + desc = g_strdup_printf ("%" G_GUINT64_FORMAT, pspec->default_value); + } + else if (G_IS_PARAM_SPEC_UNICHAR (spec)) + { + GParamSpecUnichar *pspec = G_PARAM_SPEC_UNICHAR (spec); + + if (g_unichar_isprint (pspec->default_value)) + desc = g_strdup_printf ("'%c'", pspec->default_value); + else + desc = g_strdup_printf ("%u", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_ENUM (spec)) + { + GParamSpecEnum *pspec = G_PARAM_SPEC_ENUM (spec); + + GEnumValue *value = g_enum_get_value (pspec->enum_class, pspec->default_value); + if (value) + desc = g_strdup_printf ("%s", value->value_name); + else + desc = g_strdup_printf ("%d", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_FLAGS (spec)) + { + GParamSpecFlags *pspec = G_PARAM_SPEC_FLAGS (spec); + guint default_value; + GString *acc; + + default_value = pspec->default_value; + acc = g_string_new (""); + + while (default_value) + { + GFlagsValue *value = g_flags_get_first_value (pspec->flags_class, default_value); + + if (!value) + break; + + if (acc->len > 0) + g_string_append (acc, "|"); + g_string_append (acc, value->value_name); + + default_value &= ~value->value; + } + + if (default_value == 0) + desc = g_string_free (acc, FALSE); + else + { + desc = g_strdup_printf ("%d", pspec->default_value); + g_string_free (acc, TRUE); + } + } + else if (G_IS_PARAM_SPEC_FLOAT (spec)) + { + GParamSpecFloat *pspec = G_PARAM_SPEC_FLOAT (spec); + + /* make sure floats are output with a decimal dot irrespective of + * current locale. Use formatd since we want human-readable numbers + * and do not need the exact same bit representation when deserialising */ + desc = g_malloc0 (G_ASCII_DTOSTR_BUF_SIZE); + g_ascii_formatd (desc, G_ASCII_DTOSTR_BUF_SIZE, "%g", + pspec->default_value); + } + else if (G_IS_PARAM_SPEC_DOUBLE (spec)) + { + GParamSpecDouble *pspec = G_PARAM_SPEC_DOUBLE (spec); + + /* make sure floats are output with a decimal dot irrespective of + * current locale. Use formatd since we want human-readable numbers + * and do not need the exact same bit representation when deserialising */ + desc = g_malloc0 (G_ASCII_DTOSTR_BUF_SIZE); + g_ascii_formatd (desc, G_ASCII_DTOSTR_BUF_SIZE, "%g", + pspec->default_value); + } + else if (G_IS_PARAM_SPEC_STRING (spec)) + { + GParamSpecString *pspec = G_PARAM_SPEC_STRING (spec); + + if (pspec->default_value) + { + gchar *esc = g_strescape (pspec->default_value, NULL); + + desc = g_strdup_printf ("\\"%s\\"", esc); + + g_free (esc); + } + else + desc = g_strdup_printf ("NULL"); + } + else + { + desc = g_strdup (""); + } + + return desc; +} + + +static void +output_object_args (FILE *fp, GType object_type) +{ + gpointer class; + const gchar *object_class_name; + guint arg; + gchar flags[16], *pos; + GParamSpec **properties; + guint n_properties; + gboolean child_prop; + gboolean style_prop; + gboolean is_pointer; + const gchar *type_name; + gchar *type_desc; + gchar *default_value; + + if (G_TYPE_IS_OBJECT (object_type)) + { + class = g_type_class_peek (object_type); + if (!class) + return; + + properties = g_object_class_list_properties (class, &n_properties); + } +#if GLIB_MAJOR_VERSION > 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 3) + else if (G_TYPE_IS_INTERFACE (object_type)) + { + class = g_type_default_interface_ref (object_type); + + if (!class) + return; + + properties = g_object_interface_list_properties (class, &n_properties); + } +#endif + else + return; + + object_class_name = g_type_name (object_type); + + child_prop = FALSE; + style_prop = FALSE; + + while (TRUE) { + qsort (properties, n_properties, sizeof (GParamSpec *), compare_param_specs); + for (arg = 0; arg < n_properties; arg++) + { + GParamSpec *spec = properties[arg]; + const gchar *nick, *blurb, *dot; + + if (spec->owner_type != object_type) + continue; + + pos = flags; + /* We use one-character flags for simplicity. */ + if (child_prop && !style_prop) + *pos++ = 'c'; + if (style_prop) + *pos++ = 's'; + if (spec->flags & G_PARAM_READABLE) + *pos++ = 'r'; + if (spec->flags & G_PARAM_WRITABLE) + *pos++ = 'w'; + if (spec->flags & G_PARAM_CONSTRUCT) + *pos++ = 'x'; + if (spec->flags & G_PARAM_CONSTRUCT_ONLY) + *pos++ = 'X'; + *pos = 0; + + nick = g_param_spec_get_nick (spec); + blurb = g_param_spec_get_blurb (spec); + + dot = ""; + if (blurb) { + int str_len = strlen (blurb); + if (str_len > 0 && blurb[str_len - 1] != '.') + dot = "."; + } + + type_desc = describe_type (spec); + default_value = describe_default (spec); + type_name = get_type_name (spec->value_type, &is_pointer); + fprintf (fp, "\\n%s::%s\\n%s%s\\n%s\\n%s\\n%s\\n%s%s\\n%s\\n\\n\\n", + object_class_name, g_param_spec_get_name (spec), type_name, is_pointer ? "*" : "", type_desc, flags, nick ? nick : "(null)", blurb ? blurb : "(null)", dot, default_value); + g_free (type_desc); + g_free (default_value); + } + + g_free (properties); + +#ifdef GTK_IS_CONTAINER_CLASS + if (!child_prop && GTK_IS_CONTAINER_CLASS (class)) { + properties = gtk_container_class_list_child_properties (class, &n_properties); + child_prop = TRUE; + continue; + } +#endif + +#ifdef GTK_IS_CELL_AREA_CLASS + if (!child_prop && GTK_IS_CELL_AREA_CLASS (class)) { + properties = gtk_cell_area_class_list_cell_properties (class, &n_properties); + child_prop = TRUE; + continue; + } +#endif + +#ifdef GTK_IS_WIDGET_CLASS +#if GTK_CHECK_VERSION(2,1,0) + if (!style_prop && GTK_IS_WIDGET_CLASS (class)) { + properties = gtk_widget_class_list_style_properties (GTK_WIDGET_CLASS (class), &n_properties); + style_prop = TRUE; + continue; + } +#endif +#endif + + break; + } +} + +static void +output_sections (void) +{ + FILE *fp; + gint i; + + fp = fopen (sections_filename, "w"); + if (fp == NULL) + { + g_warning ("Couldn't open output file: %s : %s", sections_filename, g_strerror(errno)); + return; + } + + for (i = 0; object_types[i]; i++) { } + qsort (object_types, i, sizeof (GType), compare_types); + + for (i = 0; object_types[i]; i++) { + output_object_section (fp, object_types[i]); + } + + fclose (fp); +} + +static gboolean +find_by_type (GstPluginFeature *f, gpointer data) { + return (GST_IS_ELEMENT_FACTORY(f) && + ((GType)data == gst_element_factory_get_element_type (GST_ELEMENT_FACTORY(f)))); +} + +static void +output_object_section (FILE *fp, GType object_type) +{ + /* e.g. GstFakeSink */ + const gchar *tn = g_type_name (object_type); + const gchar *cct = &tn[3]; /* cut 'Gst' */ + gchar *title, *lct, *uct; + gint i, j, l = strlen(cct); + gpointer class; + GParamSpec **properties; + guint n_properties; + const gchar *ptn; + gchar *ptns; + GString *strbuf = g_string_new (NULL); + GList *fl; + GstPluginFeature *f = NULL; + gboolean need_unserscore = TRUE, have_abbrev = FALSE; + + fl = gst_registry_feature_filter (gst_registry_get(), find_by_type, TRUE, + (gpointer)object_type); + if (fl) { + f = fl->data; + g_list_free(fl); + } + if (f) { + title = g_strdup (gst_plugin_feature_get_name(f)); + g_object_unref (f); + } else { + title = g_ascii_strdown(cct, -1); + } + + /* turn CamelCase into '_' separated all lower, resulting string is atmost + * twice as long, special casing for abbevs like GstTCPClientSink */ + lct = g_malloc(2*l); + for (i = 0, j = 0; i < l; i++) { + if (g_ascii_isupper (cct[i])) { + if (need_unserscore) { + if (i > 0) { + lct[j++] = '_'; + } + } else { + have_abbrev = TRUE; + } + lct[j++] = g_ascii_tolower(cct[i]); + need_unserscore = FALSE; + } else { + if (have_abbrev) { + lct[j] = lct[j-1]; + lct[j-1] = '_'; + j++; + have_abbrev = FALSE; + } + lct[j++] = cct[i]; + need_unserscore = TRUE; + } + } + lct[j] = '\\0'; + uct = g_ascii_strup(lct, -1); + + /* scan properties and find local enums */ + class = g_type_class_peek (object_type); + properties = g_object_class_list_properties (class, &n_properties); + qsort (properties, n_properties, sizeof (GParamSpec *), compare_param_specs); + for (i = 0; i < n_properties; i++) { + GParamSpec *spec = properties[i]; + if (!(G_IS_PARAM_SPEC_ENUM (spec) || G_IS_PARAM_SPEC_FLAGS (spec))) { + continue; + } + ptn = g_type_name(spec->value_type); + // does it start with tn? + if (strncmp(tn, ptn, strlen(tn))) { + continue; + } + g_string_append_c(strbuf, '\\n'); + g_string_append(strbuf, ptn); + } + ptns = g_string_free (strbuf, FALSE); + + /* later we can remove the SUBSECTION Standart/Private, since we only need to + * highlight what is public API */ + fprintf (fp, "
\\n" + "element-%s\\n" + "%s\\n" + "Gst%s%s\\n" + "\\n" + "Gst%sClass\\n" + "GST_%s\\n" + "GST_%s_CAST\\n" + "GST_IS_%s\\n" + "GST_%s_CLASS\\n" + "GST_IS_%s_CLASS\\n" + "GST_TYPE_%s\\n" + "\\n" + "gst_%s_get_type\\n" + "
\\n\\n", + title, title, cct, ptns, + cct, uct, uct, uct, uct, uct, uct, lct); + g_free (title); + g_free (lct); + g_free (uct); + g_free (ptns); +} + +EOT + +close OUTPUT; + +# Compile and run our file + +$CC = $ENV{CC} ? $ENV{CC} : "gcc"; +$LD = $ENV{LD} ? $ENV{LD} : $CC; +$CFLAGS = $ENV{CFLAGS} ? "$ENV{CFLAGS}" : ""; +$LDFLAGS = $ENV{LDFLAGS} ? $ENV{LDFLAGS} : ""; + +my $o_file; +if ($CC =~ /libtool/) { + $o_file = "$MODULE-scan.lo" +} else { + $o_file = "$MODULE-scan.o" +} + +my $stdout=""; +if (!defined($VERBOSE) or $VERBOSE eq "0") { + $stdout=">/dev/null"; +} + +# Compiling scanner +$command = "$CC $stdout $CFLAGS -c -o $o_file $MODULE-scan.c"; +system("($command)") == 0 or die "Compilation of scanner failed: $!\n"; + +# Linking scanner +$command = "$LD $stdout -o $MODULE-scan $o_file $LDFLAGS"; +system($command) == 0 or die "Linking of scanner failed: $!\n"; + +# Running scanner $MODULE-scan "; +system("sh -c ./$MODULE-scan") == 0 or die "Scan failed: $!\n"; + +if (!defined($ENV{"GTK_DOC_KEEP_INTERMEDIATE"})) { + unlink "./$MODULE-scan.c", "./$MODULE-scan.o", "./$MODULE-scan.lo", "./$MODULE-scan"; +} + +&UpdateFileIfChanged ($old_hierarchy_filename, $new_hierarchy_filename, 0); +# we will merge these in scangobj-merge.py +#&UpdateFileIfChanged ($old_interfaces_filename, $new_interfaces_filename, 0); +#&UpdateFileIfChanged ($old_prerequisites_filename, $new_prerequisites_filename, 0); +#&UpdateFileIfChanged ($old_signals_filename, $new_signals_filename, 0); +#&UpdateFileIfChanged ($old_args_filename, $new_args_filename, 0); +#&UpdateFileIfChanged ($old_sections_filename, $new_sections_filename, 0); diff -Nru gstreamer-vaapi-0.7.0/common/gst-indent gstreamer-vaapi-1.8.2/common/gst-indent --- gstreamer-vaapi-0.7.0/common/gst-indent 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/gst-indent 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,55 @@ +#!/bin/sh +# +# Check that the code follows a consistant code style +# + +# Check for existence of indent, and error out if not present. +# On some *bsd systems the binary seems to be called gnunindent, +# so check for that first. + +version=`gnuindent --version 2>/dev/null` +if test "x$version" = "x"; then + version=`gindent --version 2>/dev/null` + if test "x$version" = "x"; then + version=`indent --version 2>/dev/null` + if test "x$version" = "x"; then + echo "GStreamer git pre-commit hook:" + echo "Did not find GNU indent, please install it before continuing." + exit 1 + else + INDENT=indent + fi + else + INDENT=gindent + fi +else + INDENT=gnuindent +fi + +case `$INDENT --version` in + GNU*) + ;; + default) + echo "GStreamer git pre-commit hook:" + echo "Did not find GNU indent, please install it before continuing." + echo "(Found $INDENT, but it doesn't seem to be GNU indent)" + exit 1 + ;; +esac + +INDENT_PARAMETERS="--braces-on-if-line \ + --case-brace-indentation0 \ + --case-indentation2 \ + --braces-after-struct-decl-line \ + --line-length80 \ + --no-tabs \ + --cuddle-else \ + --dont-line-up-parentheses \ + --continuation-indentation4 \ + --honour-newlines \ + --tab-size8 \ + --indent-level2 \ + --leave-preprocessor-space" + +$INDENT ${INDENT_PARAMETERS} $@ + diff -Nru gstreamer-vaapi-0.7.0/common/gst.supp gstreamer-vaapi-1.8.2/common/gst.supp --- gstreamer-vaapi-0.7.0/common/gst.supp 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/gst.supp 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,4028 @@ +### this file contains suppressions for valgrind when running +### the gstreamer unit tests +### it might be useful for wider use as well + +### syscall suppressions + +{ + + Memcheck:Param + clone(parent_tidptr) + fun:clone + fun:clone +} + +{ + + Memcheck:Param + clone(child_tidptr) + fun:clone + fun:clone +} + +{ + + Memcheck:Param + clone(tlsinfo) + fun:clone + fun:clone +} + +### glibc suppressions + +{ + + Memcheck:Cond + obj:/lib/ld-2.*.so + fun:dl_open_worker + obj:/lib/ld-2.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.*.so + fun:_dlerror_run + fun:dlopen + fun:g_module_open + fun:gst_plugin_load_file +} + +{ + + Memcheck:Cond + fun:strlen + fun:fillin_rpath + fun:_dl_init_paths + fun:dl_main + fun:_dl_sysdep_start + fun:_dl_start + obj:/lib64/ld-2.*.so + obj:* + obj:* +} + +{ + + Memcheck:Cond + fun:_dl_relocate_object + fun:dl_main + fun:_dl_sysdep_start + fun:_dl_start +} + +{ + + Memcheck:Cond + fun:* + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +# glibc does not deallocate thread-local storage + +{ + + Memcheck:Leak + fun:calloc + fun:_dl_allocate_tls + fun:pthread_create@@* +} + +{ + + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate_tls +} + +# I get an extra stack entry on x86/dapper +{ + + Memcheck:Leak + fun:calloc + obj:/lib/ld-2.3.*.so + fun:_dl_allocate_tls + fun:pthread_create@@* +} + + +{ + + Memcheck:Cond + fun:strstr + fun:__pthread_initialize_minimal + obj:/lib/libpthread-*.so + obj:/lib/libpthread-*.so + fun:call_init + fun:_dl_init + obj:/lib/ld-*.so +} + +# a thread-related free problem in glibc from Edgard +{ + __libc_freeres_rw_acess + Memcheck:Addr4 + obj:* + obj:* + obj:* + obj:* + obj:* + fun:__libc_freeres +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so +} + +# g_module_open-related problems +{ + + Memcheck:Addr2 + fun:memcpy + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open + fun:gst_plugin_load_file + fun:gst_registry_scan_path_level + fun:gst_registry_scan_path_level + fun:gst_registry_scan_path_level + fun:init_post + fun:g_option_context_parse + fun:gst_init_check + fun:gst_init + fun:gst_check_init + fun:main +} + +{ + + Memcheck:Addr4 + fun:memcpy + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open + fun:gst_plugin_load_file + fun:gst_registry_scan_path_level + fun:gst_registry_scan_path_level + fun:gst_registry_scan_path_level + fun:init_post + fun:g_option_context_parse + fun:gst_init_check + fun:gst_init + fun:gst_check_init + fun:main +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:do_sym + fun:_dl_sym + fun:dlsym_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlsym + fun:g_module_symbol + fun:g_module_open + fun:gst_plugin_load_file +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open + fun:gst_plugin_load_file +} +{ + + Memcheck:Cond + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open + fun:gst_plugin_load_file + fun:gst_plugin_load_by_name + fun:gst_plugin_feature_load +} + +{ + + Memcheck:Leak + fun:malloc + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open + fun:gst_plugin_load_file + fun:gst_plugin_load_by_name +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:do_sym + fun:_dl_sym + fun:dlsym_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlsym + fun:g_module_symbol + fun:g_module_open +} + +{ + + Memcheck:Param + futex(uaddr2) + fun:pthread_once + obj:/lib/libc-2.3.*.so + obj:/lib/libc-2.3.*.so + fun:mbsnrtowcs + fun:vfprintf + fun:vsprintf + fun:sprintf + obj:/lib/libc-2.3.*.so + fun:tmpfile + fun:setup_pipe + fun:setup_messaging_with_key + fun:setup_messaging +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + fun:_dl_sym + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlsym + fun:g_module_symbol + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + fun:iconv_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + fun:iconv_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + fun:iconv_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + fun:iconv_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +# suppression for a glibc bug: +# http://valgrind.org/docs/manual/faq.html#faq.exit_errors> +{ + + Memcheck:Free + fun:free + obj:*libc-*.so + fun:__libc_freeres + fun:* + fun:_Exit +} + +# same as above, just so it works for tpm on gutsy/x86-64 +{ + + Memcheck:Free + fun:free + fun:free_mem + fun:__libc_freeres +} + +# valgrind doesn't allow me to specify a suppression for Addr1, Addr2, Addr4 +# as Addr*, so 3 copies for that; and then 2 of each for that pesky memcpy +{ + + Memcheck:Addr1 + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr2 + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} +{ + + Memcheck:Addr4 + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr1 + fun:memcpy + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr2 + fun:memcpy + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} +{ + + Memcheck:Addr4 + fun:memcpy + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/libc-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:_dl_open + obj:/lib/libdl-2.3.*.so + obj:/lib/ld-2.3.*.so +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.*.so + obj:/lib/libc-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:_dl_open + obj:/lib/libdl-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/libdl-2.3.*.so + fun:dlopen + fun:g_module_open + fun:gst_plugin_load_file + fun:gst_plugin_load_by_name + fun:gst_plugin_feature_load +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libc-2.3.6.so + obj:/lib/ld-2.3.6.so + fun:_dl_open + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libc-2.3.6.so + obj:/lib/ld-2.3.6.so + fun:_dl_open + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libc-2.3.6.so + obj:/lib/ld-2.3.6.so + fun:_dl_open + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + fun:dlopen +} + +### glib suppressions +{ + + Memcheck:Cond + fun:g_parse_debug_string + obj:/usr/lib*/libglib-2.0.so.* + fun:g_slice_alloc + fun:g_slice_alloc0 +} + +{ + + Memcheck:Leak + fun:*alloc + ... + fun:g_type_init* + fun:init_pre* +} + +{ + + Memcheck:Leak + fun:*alloc + ... + fun:g_type_register_fundamental +} + +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + fun:type_node_any_new_W +} + +{ + + Memcheck:Leak + fun:realloc + fun:g_realloc + fun:type_node_any_new_W +} + +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:g_type_class_ref +} + +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + fun:type_add_flags_W +} + +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:type_add_flags_W +} + +#pthread memleaks + +{ + Thread creation leak + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate* + fun:_dl_allocate* + fun:__pthread_initialize_minimal +} + +{ + Thread management leak + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate* + fun:_dl_allocate* + fun:__pthread_* +} + +{ + Thread management leak 2 + Memcheck:Leak + fun:memalign + fun:_dl_allocate* + fun:_dl_allocate* + fun:__pthread_* +} + +{ + pthread_create Syscall param write(buf) points to uninitialised byte(s) + Memcheck:Param + write(buf) + fun:pthread_create@@GLIBC_2.2.5 + fun:g_thread_create* + +} + +# nss_parse_* memleak (used by g_option_context_parse) +{ + nss_parse_* memleak + Memcheck:Leak + fun:malloc + fun:nss_parse_service_list + fun:__nss_database_lookup +} + +# liboil suppressions +{ + + Memcheck:Value8 + obj:/usr/lib/liboil-0.3.so.0.1.0 + obj:/usr/lib/liboil-0.3.so.0.1.0 + obj:/usr/lib/liboil-0.3.so.0.1.0 + fun:oil_cpu_fault_check_try + fun:oil_test_check_impl + fun:oil_class_optimize + fun:oil_optimize_all + fun:oil_init +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.3.6.so +} + +{ + + Memcheck:Param + futex(uaddr2) + fun:pthread_once + obj:/lib/libc-2.3.6.so + obj:/lib/libc-2.3.6.so + fun:setlocale + fun:init_pre + fun:g_option_context_parse + fun:gst_init_check + fun:gst_init + fun:gst_check_init + fun:main +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.6.so + obj:/lib/ld-2.3.6.so + fun:_dl_open + obj:/lib/libdl-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/libdl-2.3.6.so + fun:dlopen + fun:g_module_open + fun:gst_plugin_load_file +} +# this exists in a bunch of different variations, hence the short tail/trace +{ + + Memcheck:Addr4 + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so +} +{ + + Memcheck:Addr8 + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so +} + +# More edgy suppressions (Mike) +{ + + Memcheck:Cond + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + fun:dlopen_doit + obj:/lib/ld-2.4.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + fun:dlopen_doit + obj:/lib/ld-2.4.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + fun:do_sym + fun:_dl_sym +} + +# This one's overly general, but there's zero other information in the stack +# trace - just these five lines! +{ + + Memcheck:Cond + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so +} + +{ + + Memcheck:Leak + fun:calloc + obj:/lib/ld-2.4.so + fun:_dl_allocate_tls + fun:pthread_create@@GLIBC_2.1 +} + +# TLS leaks for feisty/x86 +{ + + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate_tls + fun:pthread_create@@GLIBC_2.1 +} + +{ + + Memcheck:Leak + fun:calloc + obj:/usr/lib/libcdio.so.6.0.1 + fun:cdio_open_am_linux + obj:/usr/lib/libcdio.so.6.0.1 + fun:cdio_open_am +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.5.so +} + +{ + + Memcheck:Cond + fun:snd_pcm_direct_shm_create_or_connect + fun:snd_pcm_dsnoop_open + fun:_snd_pcm_dsnoop_open + obj:/*lib/libasound.so.2.0.0 + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:_snd_pcm_plug_open + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:_snd_pcm_asym_open + obj:/*lib/libasound.so.2.0.0 + obj:/*lib/libasound.so.2.0.0 +} + +{ + + Memcheck:Cond + fun:snd*_pcm_hw_param_set_near +} + +{ + + Memcheck:Cond + ... + fun:snd*_pcm_hw_param_set_near +} + +{ + + Memcheck:Cond + obj:/*lib/libasound.so.2.0.0 + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_close + obj:/*lib/libasound.so.2.0.0 +} +{ + + Memcheck:Cond + fun:snd_pcm_direct_shm_create_or_connect + fun:snd_pcm_dmix_open + fun:_snd_pcm_dmix_open + obj:/*lib/libasound.so.2.0.0 + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:_snd_pcm_softvol_open + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:_snd_pcm_plug_open + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:_snd_pcm_asym_open + obj:/*lib/libasound.so.2.0.0 + obj:/*lib/libasound.so.2.0.0 +} +{ + + Memcheck:Leak + fun:malloc + fun:strdup + fun:snd_dlobj_cache_add + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:snd_pcm_dsnoop_open + fun:_snd_pcm_dsnoop_open + obj:/*lib/libasound.so.2.0.0 + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:_snd_pcm_plug_open + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:_snd_pcm_asym_open + obj:/*lib/libasound.so.2.0.0 + obj:/*lib/libasound.so.2.0.0 +} +# Catch about 15 variations on inserting info into an ALSA +# internal cache +{ + + Memcheck:Leak + fun:malloc + ... + fun:snd*_dlobj_cache_add + obj:/*lib*/libasound.so.2.0.0 +} + +{ + + Memcheck:Leak + fun:*alloc + ... + fun:snd_pcm_open_conf +} + +{ + + Memcheck:Leak + fun:*alloc + obj:/*lib*/libasound.so.2.0.0 + ... + fun:snd_config_hook_load +} + +{ + + Memcheck:Leak + fun:*alloc + obj:/*lib*/libasound.so.2.0.0 + ... + fun:snd_config_update_r + fun:snd_config_update +} +{ + + Memcheck:Leak + fun:*alloc + fun:strdup + ... + fun:snd_config_update_r + fun:snd_config_update +} +{ + + Memcheck:Leak + fun:*alloc + fun:_dl_close_worker + ... + fun:snd_config_searcha_hooks +} + +{ + + Memcheck:Leak + fun:malloc + obj:/lib/libc*.so + fun:__nss_database_lookup + obj:* + obj:* + fun:getgrnam_r + fun:getgrnam + fun:snd_pcm_direct_parse_open_conf +} + +{ + + Memcheck:Leak + fun:calloc + fun:_XCBInitDisplayLock + fun:XOpenDisplay +} + +# GConf internal initialisations related to getting the default client. +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc_tcval + obj:/usr/lib/libORBit-2.so.* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:CORBA_ORB_string_to_object + obj:/usr/lib/libgconf-2.so.* + fun:gconf_get_current_lock_holder + fun:gconf_activate_server + obj:/usr/lib/libgconf-2.so.* + obj:/usr/lib/libgconf-2.so.* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc_tcval + obj:* + fun:PortableServer_POA_servant_to_reference + fun:* + fun:* + fun:* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc_tcval + obj:/usr/lib/libORBit-2.so.* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:CORBA_ORB_string_to_object + obj:/usr/lib/libgconf-2.so.* + fun:gconf_get_current_lock_holder + fun:gconf_activate_server + obj:/usr/lib/libgconf-2.so.* + obj:/usr/lib/libgconf-2.so.* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:ORBit_demarshal_value + fun:* + fun:ORBit_small_invoke_stub + fun:ConfigServer_get_default_database + fun:* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:* + fun:IOP_generate_profiles + fun:ORBit_marshal_object + fun:ORBit_marshal_value + fun:* + fun:ORBit_small_invoke_stub + fun:ConfigServer_add_client + fun:* + fun:* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc_by_tc + fun:* + fun:PortableServer_POA_servant_to_reference + fun:* + fun:* + fun:* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc_by_tc + obj:/usr/lib/libORBit-2.so.* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:CORBA_ORB_string_to_object + obj:/usr/lib/libgconf-2.so.* + fun:gconf_get_current_lock_holder + fun:gconf_activate_server + obj:/usr/lib/libgconf-2.so.* + obj:/usr/lib/libgconf-2.so.* + fun:gconf_engine_get_default +} + +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:* + fun:* + fun:gconf_activate_server +} + +# Some libORBit/bonobo initialisation stuff +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:ORBit_alloc_string + fun:CORBA_string_dup + fun:Bonobo_ActivationEnvValue_set + fun:bonobo_activation_init_activation_env + fun:bonobo_activation_orb_init + fun:bonobo_activation_init +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:ORBit_small_alloc* + obj:/usr/lib/libORBit-2.so* + fun:PortableServer_POA_servant_to_reference + obj:/usr/lib/libbonobo-2.so* +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc_tcval + fun:ORBit_small_allocbuf + fun:ORBit_adaptor_setup + obj:/usr/lib/libORBit-2.so* + fun:ORBit_POA_setup_root + fun:ORBit_init_internals + fun:CORBA_ORB_init +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc_tcval + fun:ORBit_adaptor_setup + fun:* + fun:ORBit_POA_setup_root + fun:ORBit_init_internals + fun:CORBA_ORB_init +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:ORBit_small_allocbuf + fun:bonobo_activation_init_activation_env + fun:bonobo_activation_orb_init + fun:bonobo_activation_init +} + +# More GConf stuff from the FC5 buildbot, mostly variations on the +# above stack traces +{ + + Memcheck:Param + writev(vector[...]) + fun:writev + obj:/usr/lib/libORBit-2.so* + fun:link_connection_writev + fun:giop_send_buffer_write + obj:/usr/lib/libORBit-2.so* + fun:ORBit_small_invoke_stub + fun:ORBit_small_invoke_stub_n + fun:ORBit_c_stub_invoke + fun:ConfigServer_ping + fun:gconf_activate_server + obj:/usr/lib/libgconf-2.so* + obj:/usr/lib/libgconf-2.so* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:ORBit_small_alloc* + obj:/usr/lib/libORBit-2.so* + fun:PortableServer_POA_servant_to_reference + obj:/usr/lib/libgconf-2.so* + obj:/usr/lib/libgconf-2.so* + obj:/usr/lib/libgconf-2.so* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:ORBit_small_alloc + obj:/usr/lib/libORBit-2.so* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:CORBA_ORB_string_to_object + obj:/usr/lib/libgconf-2.so* + fun:gconf_get_current_lock_holder + fun:gconf_activate_server + obj:/usr/lib/libgconf-2.so* + obj:/usr/lib/libgconf-2.so* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:ORBit_small_alloc* + obj:/usr/lib/libORBit-2.so* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:CORBA_ORB_string_to_object + obj:/usr/lib/libgconf-2.so* + fun:gconf_get_current_lock_holder + fun:gconf_activate_server + obj:/usr/lib/libgconf-2.so* + obj:/usr/lib/libgconf-2.so* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:ORBit_small_alloc* + obj:/usr/lib/libORBit-2.so* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:ORBit_demarshal_value + obj:/usr/lib/libORBit-2.so* + fun:ORBit_small_invoke_stub + fun:ORBit_small_invoke_stub_n + fun:ORBit_c_stub_invoke + fun:ConfigServer_get_default_database + obj:/usr/lib/libgconf-2.so* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:ORBit_small_alloc* + obj:/usr/lib/libORBit-2.so* + fun:ORBit_OAObject_object_to_objkey + fun:IOP_generate_profiles + fun:ORBit_marshal_object + fun:ORBit_marshal_value + obj:/usr/lib/libORBit-2.so* + fun:ORBit_small_invoke_stub + fun:ORBit_small_invoke_stub_n + fun:ORBit_c_stub_invoke + fun:ConfigServer_add_client + obj:/usr/lib/libgconf-2.so* + obj:/usr/lib/libgconf-2.so* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:malloc + obj:*libc-*.so + fun:__nss_database_lookup + obj:* + obj:* + fun:getpwnam_r + obj:/usr/lib*/libglib-2.0.so.* + fun:g_get_home_dir +} +{ + + Memcheck:Leak + fun:malloc + obj:*libc-*.so + fun:__nss_database_lookup + obj:* + obj:* + fun:getpwnam_r + obj:/usr/lib*/libglib-2.0.so.* + fun:g_get_user_name +} +{ + + Memcheck:Leak + fun:malloc + obj:*libc-*.so + fun:__nss_database_lookup + obj:* + obj:* + fun:getpwnam_r + obj:/usr/lib*/libglib-2.0.so.* + fun:g_get_tmp_dir +} + +{ + + Memcheck:Leak + fun:malloc + obj:*libc-*.so + fun:__nss_database_lookup + obj:* + obj:* + fun:getpwnam_r + obj:/usr/lib*/libglib-2.0.so.0.* + fun:g_get_host_name +} + + +## Some Fontconfig errors. +{ + + Memcheck:Leak + fun:malloc + fun:FcPatternObjectInsertElt + fun:FcPatternObjectAddWithBinding + fun:FcPatternAppend + fun:FcEndElement + obj:/usr/lib/libexpat.so.* + obj:/usr/lib/libexpat.so.* + obj:/usr/lib/libexpat.so.* + obj:/usr/lib/libexpat.so.* + fun:XML_ParseBuffer + fun:FcConfigParseAndLoad + fun:FcConfigParseAndLoad + fun:FcParseInclude + fun:FcEndElement + obj:/usr/lib/libexpat.so.* + obj:/usr/lib/libexpat.so.* + obj:/usr/lib/libexpat.so.* + obj:/usr/lib/libexpat.so.* + fun:XML_ParseBuffer + fun:FcConfigParseAndLoad +} +{ + + Memcheck:Leak + fun:*alloc + ... + fun:FcInitLoadConfig +} + +# Issues with ubuntu Hardy, same crack as for previous ubuntus +{ + + Memcheck:Leak + fun:calloc + obj:* + fun:_dl_allocate_tls + fun:pthread_create@@* + obj:/usr/lib/libgthread* + fun:g_thread_* +} + +# I've made this version generic, so that it covers future modifications +# of library names +{ + + Memcheck:Leak + fun:calloc + obj:* + fun:_dl_allocate_tls + fun:pthread_create@@* + fun:g_thread_* +} + +# series of invalid read of size 4 in g_module_open for ubuntu +# hardy x86/32bit +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open + fun:gst_plugin_load_* +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open + fun:gst_plugin_load_* +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open + fun:gst_plugin_load_* +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open + fun:gst_plugin_load_* +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open + fun:gst_plugin_load* +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libc-2.7.so + fun:_dl_sym + obj:/lib/tls/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + fun:dlsym + fun:g_module_symbol + fun:g_module_open + fun:gst_plugin_load_* +} + +# series of invalid read of size 8 in g_module_open for ubuntu +# hardy x86/64bit +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + fun:dlsym + fun:g_module_symbol + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + fun:__nss_lookup_function + obj:/lib/tls/i686/cmov/libc-2.7.so + fun:__nss_passwd_lookup + fun:getpwnam_r +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + fun:__nss_lookup_function + obj:/lib/tls/i686/cmov/libc-2.7.so + fun:__nss_passwd_lookup + fun:getpwnam_r +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + fun:__nss_lookup_function + obj:/lib/tls/i686/cmov/libnss_compat-2.7.so + fun:_nss_compat_getpwnam_r + fun:getpwnam_r +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + fun:__nss_lookup_function + obj:/lib/tls/i686/cmov/libnss_compat-2.7.so + fun:_nss_compat_getpwnam_r + fun:getpwnam_r +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + fun:__nss_lookup_function + obj:/lib/libc-2.7.so + fun:getpwnam_r +} + +## Leaks in ALSA (variations of leak from snd_config_load1) + +{ + + Memcheck:Leak + fun:calloc + fun:_snd_config_make + fun:_snd_config_make_add + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:calloc + fun:_snd_config_make + fun:_snd_config_make_add + fun:* + fun:* + fun:snd_config_load1 +} +{ + + Memcheck:Leak + fun:calloc + fun:_snd_config_make + fun:_snd_config_make_add + fun:* + fun:* + fun:* + fun:snd_config_load1 +} +{ + + Memcheck:Leak + fun:calloc + fun:_snd_config_make + fun:_snd_config_make_add + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:calloc + fun:_snd_config_make + fun:_snd_config_make_add + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:calloc + fun:_snd_config_make + fun:_snd_config_make_add + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} +{ + + Memcheck:Leak + fun:calloc + fun:_snd_config_make + fun:_snd_config_make_add + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:malloc + fun:snd1_dlobj_cache_add + fun:snd_ctl_open_noupdate +} + +{ + + Memcheck:Leak + fun:malloc + fun:* + fun:snd1_dlobj_cache_add + fun:snd_ctl_open_noupdate +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + + +# The following are leaks of caps that need to be created dynamically +# in the type registration of the plugin (used for pad templates). + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_caps_new_simple + fun:* + fun:g_type_class_ref + fun:gst_element_register +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:* + fun:* + fun:g_type_class_ref + fun:gst_element_register + fun:gst_ogm_parse_plugin_init + fun:plugin_init +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_caps_copy + fun:gst_video_test_src_base_init + fun:g_type_class_ref + fun:gst_element_register +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_caps_copy + fun:gst_video_test_src_getcaps + fun:gst_video_test_src_base_init + fun:g_type_class_ref + fun:gst_element_register +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_ffmpegcsp_codectype_to_caps + fun:gst_ffmpegcolorspace_register + fun:plugin_init +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_caps_copy + fun:gst_ffmpegcolorspace_register + fun:plugin_init +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_caps_new_any + fun:gst_ffmpegdemux_register + fun:plugin_init +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_caps_copy + fun:gst_audio_filter_class_add_pad_templates +} + +{ + + Memcheck:Leak + fun:realloc + fun:g_realloc + fun:g_ptr_array_maybe_expand + fun:g_ptr_array_add + fun:gst_caps_append + fun:gst_audio_filter_class_add_pad_templates +} + +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + fun:g_ptr_array_maybe_expand + fun:g_ptr_array_add + fun:gst_caps_append + fun:gst_audio_filter_class_add_pad_templates +} + +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + fun:g_ptr_array_maybe_expand + fun:g_ptr_array_add + fun:gst_caps_copy + fun:gst_audio_filter_class_add_pad_templates +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:g_ptr_array_sized_new + fun:gst_caps_new_empty + fun:gst_caps_copy + fun:gst_audio_filter_class_add_pad_templates +} +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + fun:g_array_maybe_expand + fun:g_array_sized_new + fun:* + fun:* + fun:* + fun:gst_value_init_and_copy + fun:gst_structure_copy + fun:gst_caps_copy + fun:gst_audio_filter_class_add_pad_templates +} +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + fun:g_array_maybe_expand + fun:g_array_sized_new + fun:* + fun:gst_structure_copy + fun:gst_caps_copy + fun:gst_audio_filter_class_add_pad_templates +} +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:g_array_sized_new + fun:* + fun:gst_structure_copy + fun:gst_caps_copy + fun:gst_audio_filter_class_add_pad_templates +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_riff_create_*_template_caps +} +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + fun:* + fun:* + fun:* + fun:gst_structure_copy + fun:gst_caps_copy + fun:gst_caps_append + fun:gst_riff_create_*_template_caps +} +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:g_array_sized_new + fun:* + fun:gst_structure_copy + fun:gst_caps_copy + fun:gst_caps_append + fun:gst_riff_create_*_template_caps +} + +## Leaks in pango (bilboed: gentoo unstable amd64) + +{ + + Memcheck:Leak + fun:*alloc + ... + fun:pango_layout_get_pixel_extents +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:pango_language_from_string + fun:pango_language_get_default + fun:pango_context_init + fun:g_type_create_instance + fun:g_object_constructor + fun:g_object_newv + fun:g_object_new_valist + fun:g_object_new + fun:pango_font_map_create_context +} + +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:pango_language_from_string +} + + +## Leak of everything allocated by gst-libav plugin init +{ + + Memcheck:Leak + fun:*alloc + ... + fun:gst_ffmpeg_cfg_init +} + +## Leak of GIO module through gnomevfs + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:* + fun:* + fun:g_type_create_instance + fun:* + fun:* + fun:* + fun:* + fun:g_io_module_new + fun:g_io_modules_load_all_in_directory + fun:* + fun:get_default_vfs +} + +## Conditional jump in getaddrinfo (bilboed, gentoo ~amd64, Dec 13 2008) +{ + + Memcheck:Cond + fun:gaih_inet + fun:getaddrinfo +} + +## Dynamic pad templates in mxfmux +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_caps_from_string + fun:mxf_*_init + fun:plugin_init +} + +## We don't know if ffmpeg frees this or not and better pass a copy for safety +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_strdup + fun:gst_ffmpeg_cfg_fill_context + fun:gst_ffmpegenc_setcaps + fun:gst_pad_set_caps +} + +## Leak/overreads with glibc-2.10 + +{ + + Memcheck:Value8 + fun:do_sym + fun:dlsym_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlsym +} +{ + + Memcheck:Cond + fun:do_sym + fun:dlsym_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlsym +} + +{ + + Memcheck:Value8 + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Value8 + fun:_dl_relocate_object + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Value8 + fun:_dl_check_map_versions + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Cond + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Cond + fun:_dl_relocate_object + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Cond + fun:_dl_check_map_versions + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Cond + fun:_dl_map_object* + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Value8 + fun:_dl_map_object* + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Value8 + fun:_dl_check_caller + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Cond + fun:_dl_check_caller + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Value8 + obj:/lib*/libc-2.10.*.so + obj:/lib*/libc-2.10.*.so + fun:_vgnU_freeres +} +{ + + Memcheck:Cond + obj:/lib*/libc-2.10.*.so + obj:/lib*/libc-2.10.*.so + fun:_vgnU_freeres +} +{ + + Memcheck:Free + fun:free + obj:/lib*/libc-2.10.*.so + obj:/lib*/libc-2.10.*.so + fun:_vgnU_freeres +} + +{ + + Memcheck:Value8 + fun:_dl_fini + fun:__run_exit_handlers + fun:exit +} + +{ + + Memcheck:Cond + fun:_dl_fini + fun:__run_exit_handlers + fun:exit +} +{ + + Memcheck:Value8 + fun:_dl_sort_fini + fun:_dl_fini + fun:__run_exit_handlers + fun:exit +} + +{ + + Memcheck:Cond + fun:_dl_sort_fini + fun:_dl_fini + fun:__run_exit_handlers + fun:exit +} + +# glibc-2.10 dl overreads +{ + + Memcheck:Value8 + fun:_dl_fixup + fun:_dl_runtime_resolve +} +{ + + Memcheck:Cond + fun:_dl_fixup + fun:_dl_runtime_resolve +} + +{ + + Memcheck:Value8 + fun:_dl_lookup_symbol_x + fun:_dl_fixup + fun:_dl_runtime_resolve +} +{ + + Memcheck:Cond + fun:_dl_lookup_symbol_x + fun:_dl_fixup + fun:_dl_runtime_resolve +} +{ + + Memcheck:Value8 + fun:call_init + fun:_dl_init +} +{ + + Memcheck:Value8 + fun:_dl_init +} +{ + + Memcheck:Value8 + fun:do_lookup_x + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object + fun:dl_main +} +{ + + Memcheck:Cond + fun:do_lookup_x + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object + fun:dl_main +} +{ + + Memcheck:Value8 + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object + fun:dl_main +} +{ + + Memcheck:Value8 + fun:_dl_relocate_object + fun:dl_main +} +{ + + Memcheck:Value8 + fun:dl_main + fun:_dl_sysdep_start + fun:_dl_start +} +{ + + Memcheck:Cond + fun:dl_main + fun:_dl_sysdep_start + fun:_dl_start +} + +{ + + Memcheck:Cond + fun:* + fun:do_lookup_x + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:* + fun:do_lookup_x + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:_dl_check_map_versions + fun:_dl_check_all_versions + fun:version_check_doit + fun:_dl_receive_error + fun:dl_main +} + +{ + + Memcheck:Cond + fun:_dl_check_map_versions + fun:_dl_check_all_versions + fun:version_check_doit + fun:_dl_receive_error + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:_dl_check_all_versions + fun:version_check_doit + fun:_dl_receive_error + fun:dl_main +} + +{ + + Memcheck:Cond + fun:_dl_check_all_versions + fun:version_check_doit + fun:_dl_receive_error + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:* + fun:_dl_check_map_versions + fun:_dl_check_all_versions + fun:version_check_doit + fun:_dl_receive_error + fun:dl_main +} +{ + + Memcheck:Cond + fun:* + fun:_dl_check_map_versions + fun:_dl_check_all_versions + fun:version_check_doit + fun:_dl_receive_error + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:init_tls + fun:dl_main +} +{ + + Memcheck:Cond + fun:init_tls + fun:dl_main +} + +{ + + Memcheck:Cond + fun:_dl_map_object_deps + fun:dl_main +} +{ + + Memcheck:Value8 + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:_dl_protect_relro + fun:_dl_relocate_object + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:* + fun:do_lookup_x + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:_dl_setup_hash + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Value8 + fun:* + fun:_dl_new_object + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Cond + fun:* + fun:_dl_new_object + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Value8 + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:* + fun:_dl_map_object +} + +{ + + Memcheck:Cond + fun:* + fun:_dl_map_object +} + +{ + + Memcheck:Cond + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Cond + fun:* + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:* + fun:open_path + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Cond + fun:* + fun:open_path + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Cond + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Value8 + fun:* + fun:_dl_new_object + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Value8 + fun:_dl_new_object + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Cond + fun:_dl_new_object + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Value8 + fun:* + fun:_dl_name_match_p + fun:_dl_map_object +} + +{ + + Memcheck:Cond + fun:* + fun:* + fun:_dl_map_object +} + +{ + + Memcheck:Value8 + fun:* + fun:_dl_name_match_p + fun:_dl_check_map_versions + fun:_dl_check_all_versions +} + +{ + + Memcheck:Value8 + fun:* + fun:* + fun:do_lookup_x + fun:_dl_lookup_symbol_x +} + +{ + + Memcheck:Cond + fun:do_lookup_x + fun:_dl_lookup_symbol_x +} + +{ + + Memcheck:Value8 + fun:do_lookup_x + fun:_dl_lookup_symbol_x +} + +{ + + Memcheck:Value8 + fun:* + fun:do_lookup_x + fun:_dl_lookup_symbol_x +} +{ + + Memcheck:Cond + fun:* + fun:do_lookup_x + fun:_dl_lookup_symbol_x +} + +{ + + Memcheck:Value8 + fun:_dl_name_match_p + fun:_dl_map_object + fun:dl_open_worker +} +{ + + Memcheck:Cond + fun:_dl_name_match_p + fun:_dl_map_object + fun:dl_open_worker +} + +{ + + Memcheck:Value8 + fun:* + fun:_dl_name_match_p + fun:_dl_map_object + fun:dl_open_worker +} +{ + + Memcheck:Cond + fun:* + fun:_dl_name_match_p + fun:_dl_map_object + fun:dl_open_worker +} + +{ + + Memcheck:Value8 + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object +} +{ + + Memcheck:Cond + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object +} + +{ + + Memcheck:Value8 + fun:* + fun:* + fun:_dl_check_map_versions +} +{ + + Memcheck:Value8 + fun:* + fun:_dl_check_map_versions +} +{ + + Memcheck:Cond + fun:* + fun:* + fun:_dl_check_map_versions +} +{ + + Memcheck:Cond + fun:* + fun:_dl_check_map_versions +} +{ + + Memcheck:Value8 + fun:openaux +} +{ + + Memcheck:Value8 + fun:_dl_name_match_p + fun:_dl_map_object +} + +{ + + Memcheck:Cond + fun:_dl_close_worker + fun:_dl_close + fun:_dl_catch_error + fun:dlerror_run +} +{ + + Memcheck:Value8 + fun:_dl_close_worker + fun:_dl_close + fun:_dl_catch_error + fun:dlerror_run +} +{ + + Memcheck:Cond + fun:* + fun:_dl_close_worker + fun:_dl_close + fun:_dl_catch_error + fun:dlerror_run +} +{ + + Memcheck:Value8 + fun:* + fun:_dl_close_worker + fun:_dl_close + fun:_dl_catch_error + fun:dlerror_run +} + +{ + + Memcheck:Cond + fun:fillin_rpath + fun:_dl_init_paths + fun:dl_main +} +{ + + Memcheck:Value8 + fun:fillin_rpath + fun:_dl_init_paths + fun:dl_main +} +{ + + Memcheck:Cond + fun:* + fun:fillin_rpath + fun:_dl_init_paths + fun:dl_main +} +{ + + Memcheck:Value8 + fun:* + fun:fillin_rpath + fun:_dl_init_paths + fun:dl_main +} + +{ + + Memcheck:Cond + fun:_dl_map_object + fun:map_doit + fun:_dl_catch_error + fun:do_preload + fun:dl_main +} +{ + + Memcheck:Value8 + fun:_dl_map_object + fun:map_doit + fun:_dl_catch_error + fun:do_preload + fun:dl_main +} +{ + + Memcheck:Param + open(filename) + fun:open + fun:open_verify + fun:_dl_map_object + fun:map_doit + fun:_dl_catch_error + fun:do_preload + fun:dl_main +} + +{ + + Memcheck:Param + stat(file_name) + fun:_xstat + fun:open_path + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_open_worker +} + +{ + + Memcheck:Cond + fun:* + fun:_dl_map_object_deps + fun:dl_main +} +{ + + Memcheck:Value8 + fun:* + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:* + fun:* + fun:_dl_map_object_deps + fun:dl_main +} + +# glibc-2.10 tls issues +{ + + Memcheck:Cond + fun:* + fun:init_tls + fun:dl_main +} +{ + + Memcheck:Value8 + fun:* + fun:init_tls + fun:dl_main +} +{ + + Memcheck:Cond + fun:* + fun:* + fun:init_tls + fun:dl_main +} +{ + + Memcheck:Value8 + fun:* + fun:* + fun:init_tls + fun:dl_main +} + +{ + + Memcheck:Cond + fun:_dl_allocate_tls_init + fun:dl_main +} +{ + + Memcheck:Value8 + fun:_dl_allocate_tls_init + fun:dl_main +} +{ + + Memcheck:Cond + fun:* + fun:_dl_allocate_tls_init + fun:dl_main +} +{ + + Memcheck:Value8 + fun:* + fun:_dl_allocate_tls_init + fun:dl_main +} + +{ + + Memcheck:Cond + fun:__tls* + obj:* + obj:* + fun:_vgnU_freeres +} + +{ + + Memcheck:Param + arch_prctl(arg2) + fun:init_tls +} +# GLib caching tmp/home directories (glibc-2.10 variants) +{ + + Memcheck:Cond + fun:* + fun:dl_open_worker + fun:* + fun:* + fun:* + fun:_dl_catch_error + fun:dlerror_run + fun:* + fun:__nss_lookup_function + fun:__nss_lookup + fun:getpwnam* +} +{ + + Memcheck:Value8 + fun:* + fun:dl_open_worker + fun:* + fun:* + fun:* + fun:_dl_catch_error + fun:dlerror_run + fun:* + fun:__nss_lookup_function + fun:__nss_lookup + fun:getpwnam* +} +{ + + Memcheck:Cond + fun:dl_open_worker + fun:* + fun:* + fun:do_dlopen + fun:* + fun:dlerror_run + fun:* + fun:__nss_lookup_function + fun:__nss_lookup + fun:getpwnam* +} +{ + + Memcheck:Value8 + fun:dl_open_worker + fun:* + fun:* + fun:do_dlopen + fun:* + fun:dlerror_run + fun:* + fun:__nss_lookup_function + fun:__nss_lookup + fun:getpwnam* +} + +{ + + Memcheck:Value8 + fun:_dl_add_to_slotinfo + fun:dl_main +} +{ + + Memcheck:Param + open(filename) + fun:open + fun:open_verify + fun:open_path + fun:_dl_map_object +} + + + +# GModule issues with glibc-2.10 +{ + + Memcheck:Value8 + fun:* + fun:* + fun:dlsym + fun:g_module_symbol +} +{ + + Memcheck:Value8 + fun:g_module_* + fun:gst_plugin* +} +{ + + Memcheck:Value8 + fun:* + fun:g_module_* + fun:gst_plugin* +} + +{ + + Memcheck:Value8 + fun:* + fun:* + fun:dlopen* + fun:g_module_open +} +{ + + Memcheck:Value8 + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:dlsym + fun:g_module_symbol +} + +{ + + Memcheck:Value8 + fun:* + fun:* + fun:* + fun:* + fun:* + fun:dlopen* + fun:g_module_open +} + +# Leak in GSlice +{ + + Memcheck:Value8 + fun:g_parse_debug_string + fun:slice_config_init + fun:g_slice_init_nomessage + fun:_g_slice_thread_init_nomessage + fun:g_thread_init_glib +} + +# 2.10 pthread issues +{ + + Memcheck:Value8 + fun:__pthread_initialize_minimal +} + +# glibc 2.11 conditional +{ + + Memcheck:Cond + fun:_dl_relocate_object + fun:dl_main + fun:_dl_sysdep_start + fun:_dl_start + obj:/lib64/ld-2.11.so +} + +# glibc 2.11 Leak + +{ + + Memcheck:Leak + fun:*alloc + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:_dl_* + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:_dl_* + fun:_dl_* + fun:_dl_* + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:_dl_* + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:_dl_map_object + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:_dl_new_object + fun:_dl_map_object_from_fd + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:_dl_* + fun:_dl_* + fun:_dl_* + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +# glib type leaks +{ + + Memcheck:Leak + fun:*alloc + ... + fun:g_type_register_static +} + +# new registry system +# all of this will only be created once when loading registry. + +{ + + Memcheck:Leak + fun:*alloc + ... + fun:_priv_gst_registry_chunks_load_plugin +} + +# system-wide tags +# these tags are registered once + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:gst_tag_register + fun:_gst_tag_initialize +} + +# system-wide type classes that we keep referenced + +{ + + Memcheck:Leak + fun:*alloc + ... + fun:g_type_class_ref +} + +# leaking cached queries which are only initialized once +{ + + Memcheck:Leak + fun:*alloc + ... + fun:_gst_query_initialize + fun:init_post +} + +# macosx (leopard) library loader leak +{ + + Memcheck:Leak + fun:_Znwm + fun:_ZNSs4_Rep9_S_createEmmRKSaIcE + fun:_ZNSs12_S_constructIPKcEEPcT_S3_RKSaIcESt20forward_iterator_tag + fun:_ZNSsC2EPKcRKSaIcE + fun:_Z41__static_initialization_and_destruction_0ii + fun:_ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkContextE +} + +# GObject type registration +{ + + Memcheck:Leak + fun:*alloc + ... + fun:_g_atomic_array_copy +} + +{ + + Memcheck:Leak + fun:*alloc + fun:getdelim + obj:*libselinux* +} + +{ + + Memcheck:Leak + fun:*alloc + ... + obj:*/sed +} + +{ + + Memcheck:Addr8 + ... + obj:*/sed +} + +# GLib 2.23 interface vtable +{ + + Memcheck:Leak + fun:*alloc + ... + fun:g_type_add_interface_static +} + +{ + + Memcheck:Leak + fun:*alloc + obj:*/dash +} + +# libtool/gentoo fake leak +# it actually runs bash and valgrind complains +{ + + Memcheck:Leak + fun:*alloc + obj:/bin/bash +} + +{ + + Memcheck:Leak + fun:*alloc + ... + fun:_gst_plugin_loader_client_run + fun:main +} + +{ + + Memcheck:Cond + fun:*strcasecmp* + ... + fun:__dcigettext +} + +{ + + Memcheck:Value8 + fun:*strcasecmp* + ... + fun:__dcigettext +} + +{ + + Memcheck:Leak + fun:malloc + ... + fun:gst_poll_new + fun:gst_poll_new_timer + fun:gst_system_clock_init +} + +{ + + Memcheck:Leak + fun:calloc + ... + fun:gobject_init_ctor +} + +{ + + Memcheck:Leak + fun:malloc + ... + fun:g_quark_from*_string +} + +{ + + Memcheck:Param + timer_create(evp) + fun:timer_create@@GLIBC_2.3.3 +} + +{ + closures aren't valgrind friendly (bgo#739850) + Memcheck:Leak + fun:calloc + ... + fun:g_cclosure_new +} + +{ + closures aren't valgrind friendly (bgo#739850) + Memcheck:Leak + fun:malloc + ... + fun:g_closure_add_invalidate_notifier +} + +{ + closures aren't valgrind friendly (bgo#739850) + Memcheck:Leak + fun:calloc + ... + fun:g_closure_new_simple +} + +{ + glib/giomodules2 (from libsoup.supp) + Memcheck:Leak + ... + fun:_g_io_module_get_default +} + +{ + + Memcheck:Addr8 + fun:__GI___strncasecmp_l + fun:____strtod_l_internal + fun:gst_value_deserialize_double +} + +{ + + Memcheck:Addr8 + fun:do_lookup_x +} + +{ + + Memcheck:Leak + fun:malloc + ... + fun:g_quark_init + fun:glib_init_ctor +} diff -Nru gstreamer-vaapi-0.7.0/common/gtk-doc.mak gstreamer-vaapi-1.8.2/common/gtk-doc.mak --- gstreamer-vaapi-0.7.0/common/gtk-doc.mak 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/gtk-doc.mak 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,244 @@ +########################################################################### +# Everything below here is generic and you shouldn't need to change it. +########################################################################### +# thomas: except of course that we did + +if GTK_DOC_USE_LIBTOOL +GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +GTKDOC_RUN = $(LIBTOOL) --mode=execute +else +GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +GTKDOC_RUN = +endif + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) + +# thomas: make docs parallel installable +TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)-@GST_API_VERSION@ + +EXTRA_DIST = \ + $(content_files) \ + $(extra_files) \ + $(HTML_IMAGES) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_MODULE).types \ + $(DOC_OVERRIDES) \ + $(DOC_MODULE)-sections.txt + +DOC_STAMPS = \ + setup-build.stamp \ + scan-build.stamp \ + sgml-build.stamp \ + html-build.stamp \ + sgml.stamp \ + html.stamp + +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals \ + .libs/$(DOC_MODULE)-scan.o + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) doc-registry.xml + +if ENABLE_GTK_DOC +all-local: html-build.stamp + +#### setup #### + +setup-build.stamp: $(content_files) + -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + echo ' DOC Preparing build'; \ + files=`echo $(DOC_MAIN_SGML_FILE) $(DOC_OVERRIDES) $(DOC_MODULE)-sections.txt $(DOC_MODULE).types $(content_files)`; \ + if test "x$$files" != "x" ; then \ + for file in $$files ; do \ + test -f $(abs_srcdir)/$$file && \ + cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \ + done; \ + fi; \ + fi + @touch setup-build.stamp + +#### scan #### + +# in the case of non-srcdir builds, the built gst directory gets added +# to gtk-doc scanning; but only then, to avoid duplicates +scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) + @echo ' DOC Scanning header files' + @_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-scan \ + $(SCAN_OPTIONS) $(EXTRA_HFILES) \ + --module=$(DOC_MODULE) \ + $${_source_dir} \ + --ignore-headers="$(IGNORE_HFILES)" + @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null; then \ + echo " DOC Introspecting gobjects"; \ + scanobj_options=""; \ + gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + scanobj_options="--verbose"; \ + fi; \ + fi; \ + GST_PLUGIN_SYSTEM_PATH_1_0=`cd $(top_builddir) && pwd` \ + GST_PLUGIN_PATH_1_0= \ + GST_REGISTRY_1_0=doc-registry.xml \ + $(GTKDOC_EXTRA_ENVIRONMENT) \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" \ + CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" \ + LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ + gtkdoc-scangobj --type-init-func="gst_init(NULL,NULL)" \ + $$scanobj_options --module=$(DOC_MODULE) ; \ + else \ + for i in $(SCANOBJ_FILES) ; do \ + $(MKDIR_P) $(dirname $$i) ; \ + test -f $$i || touch $$i ; \ + done \ + fi + @touch scan-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp + @true + +#### xml #### + +sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(expand_content_files) + @echo ' DOC Building XML' + @gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) --output-format=xml $(MKDB_OPTIONS) + @cp ../version.entities xml + @touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +#### html #### + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) + @echo ' DOC Building HTML' + @rm -rf html + @mkdir html + @cp -pr xml html + @cp ../version.entities ./ + @mkhtml_options=""; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$(?)" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkhtml_options="$$mkhtml_options --verbose"; \ + fi; \ + fi; \ + @gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ + if test "$(?)" = "0"; then \ + mkhtml_options=--path="$(abs_srcdir)"; \ + fi; \ + cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE)-@GST_API_VERSION@ ../$(DOC_MAIN_SGML_FILE) + @rm -rf html/xml + @rm -f version.entities + @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) $(abs_builddir)/html ) + @echo ' DOC Fixing cross-references' + @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + @touch html-build.stamp + +clean-local-gtkdoc: + @rm -rf xml tmpl html +# clean files copied for nonsrcdir templates build + @if test x"$(srcdir)" != x. ; then \ + rm -rf $(DOC_MODULE).types; \ + fi +else +all-local: +clean-local-gtkdoc: +endif + +clean-local: clean-local-gtkdoc + @rm -f *~ *.bak + @rm -rf .libs + +distclean-local: + @rm -f $(REPORT_FILES) \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + @rm -rf tmpl/*.sgml.bak + @rm -f $(DOC_MODULE).hierarchy + @rm -f *.stamp || true + @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + rm -f $(DOC_MAIN_SGML_FILE) ; \ + rm -f $(DOC_OVERRIDES) ; \ + rm -f $(DOC_MODULE).types ; \ + rm -f $(DOC_MODULE).interfaces ; \ + rm -f $(DOC_MODULE).prerequisites ; \ + rm -f $(DOC_MODULE)-sections.txt ; \ + rm -f $(content_files) ; \ + rm -rf tmpl/*.sgml ; \ + fi + @rm -rf *.o + +maintainer-clean-local: clean + @cd $(srcdir) && rm -rf html \ + xml $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + +# thomas: make docs parallel installable; devhelp requires majorminor too +install-data-local: + (installfiles=`echo $(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css`; \ + if test "$$installfiles" = '$(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css'; \ + then echo '-- Nothing to install' ; \ + else \ + $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \ + for i in $$installfiles; do \ + echo '-- Installing '$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ + done; \ + echo '-- Installing $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2' ; \ + if test -e $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2; then \ + $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2 \ + $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) || true ; \ + fi) +uninstall-local: + if test -d $(DESTDIR)$(TARGET_DIR); then \ + rm -rf $(DESTDIR)$(TARGET_DIR)/*; \ + rmdir -p $(DESTDIR)$(TARGET_DIR) 2>/dev/null || true; \ + else \ + echo '-- Nothing to uninstall' ; \ + fi; + + +# +# Require gtk-doc when making dist +# +if ENABLE_GTK_DOC +dist-check-gtkdoc: +else +dist-check-gtkdoc: + @echo "*** gtk-doc must be installed and enabled in order to make dist" + @false +endif + +dist-hook: dist-check-gtkdoc dist-hook-local + mkdir $(distdir)/html + cp html/* $(distdir)/html + -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ + -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ + cd $(distdir) && rm -f $(DISTCLEANFILES) + -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs + +# avoid spurious build errors when distchecking with -jN +.NOTPARALLEL: diff -Nru gstreamer-vaapi-0.7.0/common/gtk-doc-plugins.mak gstreamer-vaapi-1.8.2/common/gtk-doc-plugins.mak --- gstreamer-vaapi-0.7.0/common/gtk-doc-plugins.mak 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/gtk-doc-plugins.mak 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,371 @@ +# This is an include file specifically tuned for building documentation +# for GStreamer plug-ins + +help: + @echo + @echo "If you are a doc maintainer, run 'make update' to update" + @echo "the documentation files maintained in git" + @echo + @echo Other useful make targets: + @echo + @echo check-inspected-versions: make sure the inspected plugin info + @echo is up to date before a release + @echo + +# update the stuff maintained by doc maintainers +update: scanobj-update + $(MAKE) check-outdated-docs + +if GTK_DOC_USE_LIBTOOL +GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +GTKDOC_RUN = $(LIBTOOL) --mode=execute +else +GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +GTKDOC_RUN = +endif + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) + +# thomas: make docs parallel installable +TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)-@GST_API_VERSION@ + +MAINTAINER_DOC_STAMPS = \ + scanobj-build.stamp + +EXTRA_DIST = \ + $(MAINTAINER_DOC_STAMPS) \ + $(srcdir)/inspect/*.xml \ + $(SCANOBJ_FILES) \ + $(content_files) \ + $(extra_files) \ + $(HTML_IMAGES) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_OVERRIDES) \ + $(DOC_MODULE)-sections.txt + +# we don't add scanobj-build.stamp here since they are built manually by docs +# maintainers and result is commited to git +DOC_STAMPS = \ + scan-build.stamp \ + sgml-build.stamp \ + html-build.stamp \ + scan.stamp \ + sgml.stamp \ + html.stamp + +# files generated/updated by gtkdoc-scangobj +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals \ + $(DOC_MODULE).types + +SCANOBJ_FILES_O = \ + .libs/$(DOC_MODULE)-scan.o + +# files generated/updated by gtkdoc-scan +SCAN_FILES = \ + $(DOC_MODULE)-sections.txt \ + $(DOC_MODULE)-overrides.txt \ + $(DOC_MODULE)-decl.txt \ + $(DOC_MODULE)-decl-list.txt + + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + +CLEANFILES = \ + $(SCANOBJ_FILES_O) \ + $(REPORT_FILES) \ + $(DOC_STAMPS) \ + inspect-registry.xml + +INSPECT_DIR = inspect + +if ENABLE_GTK_DOC +all-local: html-build.stamp + +### inspect GStreamer plug-ins; done by documentation maintainer ### + +# only look at the plugins in this module when building inspect .xml stuff +INSPECT_REGISTRY=$(top_builddir)/docs/plugins/inspect-registry.xml +INSPECT_ENVIRONMENT=\ + LC_ALL=C \ + GST_PLUGIN_SYSTEM_PATH_1_0= \ + GST_PLUGIN_PATH_1_0=$(top_builddir)/gst:$(top_builddir)/sys:$(top_builddir)/ext:$(top_builddir)/plugins:$(top_builddir)/src:$(top_builddir)/gnl \ + GST_REGISTRY_1_0=$(INSPECT_REGISTRY) \ + PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" \ + $(INSPECT_EXTRA_ENVIRONMENT) + +#### scan gobjects; done by documentation maintainer #### +scanobj-update: + -rm scanobj-build.stamp + $(MAKE) scanobj-build.stamp + +# gstdoc-scanobj produces 5 output files (.new) +# scangobj-merge.py merges them into the file which we commit later +# TODO: also merge the hierarchy +scanobj-build.stamp: $(SCANOBJ_DEPS) $(basefiles) + @echo " DOC Introspecting gobjects" + @if test x"$(srcdir)" != x. ; then \ + for f in $(SCANOBJ_FILES) $(SCAN_FILES); \ + do \ + if test -e $(srcdir)/$$f; then cp -u $(srcdir)/$$f . ; fi; \ + done; \ + fi; \ + mkdir -p $(INSPECT_DIR); \ + scanobj_options=""; \ + if test "x$(V)" = "x1"; then \ + scanobj_options="--verbose"; \ + fi; \ + $(INSPECT_ENVIRONMENT) \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" \ + CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS) $(WARNING_CFLAGS)" \ + LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ + $(GST_DOC_SCANOBJ) $$scanobj_options --type-init-func="gst_init(NULL,NULL)" \ + --module=$(DOC_MODULE) --source=$(PACKAGE) --inspect-dir=$(INSPECT_DIR) && \ + echo " DOC Merging introspection data" && \ + $(PYTHON) \ + $(top_srcdir)/common/scangobj-merge.py $(DOC_MODULE) || exit 1; \ + if test x"$(srcdir)" != x. ; then \ + for f in $(SCANOBJ_FILES); \ + do \ + cmp -s ./$$f $(srcdir)/$$f || cp ./$$f $(srcdir)/ ; \ + done; \ + fi; \ + touch scanobj-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(SCANOBJ_FILES_O): scan-build.stamp + @true + +### scan headers; done on every build ### +scan-build.stamp: $(HFILE_GLOB) $(EXTRA_HFILES) $(basefiles) scanobj-build.stamp + @echo ' DOC Scanning header files' + @if test x"$(srcdir)" != x. ; then \ + for f in $(SCANOBJ_FILES) $(SCAN_FILES); \ + do \ + if test -e $(srcdir)/$$f; then cp -u $(srcdir)/$$f . ; fi; \ + done; \ + fi + @_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-scan \ + $(SCAN_OPTIONS) $(EXTRA_HFILES) \ + --module=$(DOC_MODULE) \ + $${_source_dir} \ + --ignore-headers="$(IGNORE_HFILES)"; \ + touch scan-build.stamp + +#### xml #### + +sgml-build.stamp: scan-build.stamp $(CFILE_GLOB) $(top_srcdir)/common/plugins.xsl $(expand_content_files) + @echo ' DOC Building XML' + @-mkdir -p xml + @for a in $(inspect_files); do \ + xsltproc --stringparam module $(MODULE) \ + $(top_srcdir)/common/plugins.xsl $$a > xml/`basename $$a`; done + @for f in $(EXAMPLE_CFILES); do \ + $(PYTHON) $(top_srcdir)/common/c-to-xml.py $$f > xml/element-`basename $$f .c`.xml; done + @gtkdoc-mkdb \ + --module=$(DOC_MODULE) \ + --source-dir=$(DOC_SOURCE_DIR) \ + --expand-content-files="$(expand_content_files)" \ + --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) \ + --output-format=xml \ + --ignore-files="$(IGNORE_HFILES) $(IGNORE_CFILES)" \ + $(MKDB_OPTIONS) + @$(PYTHON) $(top_srcdir)/common/mangle-db.py xml + @cp ../version.entities xml + @touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +#### html #### + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) + @echo ' DOC Building HTML' + @rm -rf html + @mkdir html + @cp $(srcdir)/$(DOC_MAIN_SGML_FILE) html + @for f in $(content_files); do cp $(srcdir)/$$f html; done + @cp -pr xml html + @cp ../version.entities html + @mkhtml_options=""; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$(?)" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkhtml_options="$$mkhtml_options --verbose"; \ + fi; \ + fi; \ + cd html && gtkdoc-mkhtml $$mkhtml_options $(DOC_MODULE)-@GST_API_VERSION@ $(DOC_MAIN_SGML_FILE) + @rm -f html/$(DOC_MAIN_SGML_FILE) + @rm -rf html/xml + @rm -f html/version.entities + @test "x$(HTML_IMAGES)" = "x" || for i in "" $(HTML_IMAGES) ; do \ + if test "$$i" != ""; then cp $(srcdir)/$$i html ; fi; done + @echo ' DOC Fixing cross-references' + @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + @touch html-build.stamp + +clean-local-gtkdoc: + @rm -rf xml tmpl html +# clean files copied for nonsrcdir templates build + @if test x"$(srcdir)" != x. ; then \ + rm -rf $(SCANOBJ_FILES) $(SCAN_FILES) $(REPORT_FILES) \ + $(MAINTAINER_DOC_STAMPS); \ + fi +else +all-local: +clean-local-gtkdoc: +endif + +clean-local: clean-local-gtkdoc + @rm -f *~ *.bak + @rm -rf .libs + +distclean-local: + @rm -f $(REPORT_FILES) \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + @rm -rf tmpl/*.sgml.bak + @rm -f $(DOC_MODULE).hierarchy + @rm -f *.stamp || true + @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + rm -f $(DOC_MODULE)-docs.sgml ; \ + rm -f $(DOC_MODULE).types ; \ + rm -f $(DOC_MODULE).interfaces ; \ + rm -f $(DOC_MODULE)-overrides.txt ; \ + rm -f $(DOC_MODULE).prerequisites ; \ + rm -f $(DOC_MODULE)-sections.txt ; \ + rm -rf tmpl/*.sgml ; \ + rm -rf $(INSPECT_DIR); \ + fi + @rm -rf *.o + +MAINTAINERCLEANFILES = $(MAINTAINER_DOC_STAMPS) + +# thomas: make docs parallel installable; devhelp requires majorminor too +install-data-local: + (installfiles=`echo $(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css`; \ + if test "$$installfiles" = '$(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css'; \ + then echo '-- Nothing to install' ; \ + else \ + $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \ + for i in $$installfiles; do \ + echo '-- Installing '$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ + done; \ + pngfiles=`echo ./html/*.png`; \ + if test "$$pngfiles" != './html/*.png'; then \ + for i in $$pngfiles; do \ + echo '-- Installing '$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ + done; \ + fi; \ + echo '-- Installing $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2' ; \ + if test -e $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2; then \ + $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2 \ + $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) || true ; \ + fi) +uninstall-local: + if test -d $(DESTDIR)$(TARGET_DIR); then \ + rm -rf $(DESTDIR)$(TARGET_DIR)/*; \ + rmdir -p $(DESTDIR)$(TARGET_DIR) 2>/dev/null || true; \ + else \ + echo '-- Nothing to uninstall' ; \ + fi; + +# +# Checks +# +if ENABLE_GTK_DOC +check-hierarchy: $(DOC_MODULE).hierarchy + @if grep ' ' $(DOC_MODULE).hierarchy; then \ + echo "$(DOC_MODULE).hierarchy contains tabs, please fix"; \ + /bin/false; \ + fi + +check: check-hierarchy +endif + +# wildcard is apparently not portable to other makes, hence the use of find +inspect_files = $(shell find $(srcdir)/$(INSPECT_DIR) -name '*.xml') + +check-inspected-versions: + @echo Checking plugin versions of inspected plugin data ...; \ + fail=0 ; \ + for each in $(inspect_files) ; do \ + if (grep -H '' $$each | grep -v '$(VERSION)'); then \ + echo $$each should be fixed to say version $(VERSION) or be removed ; \ + echo "sed -i -e 's//$(VERSION)<\/version>/'" $$each; \ + echo ; \ + fail=1; \ + fi ; \ + done ; \ + exit $$fail + +check-outdated-docs: + $(AM_V_GEN)echo Checking for outdated plugin inspect data ...; \ + fail=0 ; \ + if [ -d $(top_srcdir)/.git/ ]; then \ + files=`find $(srcdir)/inspect/ -name '*xml'`; \ + for f in $$files; do \ + ver=`grep '$(PACKAGE_VERSION)' $$f`; \ + if test "x$$ver" = "x"; then \ + plugin=`echo $$f | sed -e 's/^.*plugin-//' -e 's/.xml//'`; \ + # echo "Checking $$plugin $$f"; \ + pushd "$(top_srcdir)" >/dev/null; \ + pinit=`git grep -A3 GST_PLUGIN_DEFINE -- ext/ gst/ sys/ | grep "\"$$plugin\""`; \ + popd >/dev/null; \ + # echo "[$$pinit]"; \ + if test "x$$pinit" = "x"; then \ + printf " **** outdated docs for plugin %-15s: %s\n" $$plugin $$f; \ + fail=1; \ + fi; \ + fi; \ + done; \ + fi ; \ + exit $$fail + +# +# Require gtk-doc when making dist +# +if ENABLE_GTK_DOC +dist-check-gtkdoc: +else +dist-check-gtkdoc: + @echo "*** gtk-doc must be installed and enabled in order to make dist" + @false +endif + +# FIXME: decide whether we want to dist generated html or not +# also this only works, if the project has been build before +# we could dist html only if its there, but that might lead to missing html in +# tarballs +dist-hook: dist-check-gtkdoc dist-hook-local + mkdir $(distdir)/html + cp html/* $(distdir)/html + -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ + -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ + cd $(distdir) && rm -f $(DISTCLEANFILES) + -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs check-outdated-docs inspect + +# avoid spurious build errors when distchecking with -jN +.NOTPARALLEL: diff -Nru gstreamer-vaapi-0.7.0/common/m4/as-ac-expand.m4 gstreamer-vaapi-1.8.2/common/m4/as-ac-expand.m4 --- gstreamer-vaapi-0.7.0/common/m4/as-ac-expand.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/as-ac-expand.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,43 @@ +dnl as-ac-expand.m4 0.2.0 +dnl autostars m4 macro for expanding directories using configure's prefix +dnl thomas@apestaart.org + +dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR) +dnl example +dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir) +dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local + +AC_DEFUN([AS_AC_EXPAND], +[ + EXP_VAR=[$1] + FROM_VAR=[$2] + + dnl first expand prefix and exec_prefix if necessary + prefix_save=$prefix + exec_prefix_save=$exec_prefix + + dnl if no prefix given, then use /usr/local, the default prefix + if test "x$prefix" = "xNONE"; then + prefix="$ac_default_prefix" + fi + dnl if no exec_prefix given, then use prefix + if test "x$exec_prefix" = "xNONE"; then + exec_prefix=$prefix + fi + + full_var="$FROM_VAR" + dnl loop until it doesn't change anymore + while true; do + new_full_var="`eval echo $full_var`" + if test "x$new_full_var" = "x$full_var"; then break; fi + full_var=$new_full_var + done + + dnl clean up + full_var=$new_full_var + AC_SUBST([$1], "$full_var") + + dnl restore prefix and exec_prefix + prefix=$prefix_save + exec_prefix=$exec_prefix_save +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/as-auto-alt.m4 gstreamer-vaapi-1.8.2/common/m4/as-auto-alt.m4 --- gstreamer-vaapi-0.7.0/common/m4/as-auto-alt.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/as-auto-alt.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,50 @@ +dnl as-auto-alt.m4 0.0.2 +dnl autostars m4 macro for supplying alternate autotools versions to configure +dnl thomas@apestaart.org +dnl +dnl AS_AUTOTOOLS_ALTERNATE() +dnl +dnl supplies --with arguments for autoconf, autoheader, automake, aclocal + +AC_DEFUN([AS_AUTOTOOLS_ALTERNATE], +[ + dnl allow for different autoconf version + AC_ARG_WITH(autoconf, + AC_HELP_STRING([--with-autoconf], + [use a different autoconf for regeneration of Makefiles]), + [ + unset AUTOCONF + AM_MISSING_PROG(AUTOCONF, ${withval}) + AC_MSG_NOTICE([Using $AUTOCONF as autoconf]) + ]) + + dnl allow for different autoheader version + AC_ARG_WITH(autoheader, + AC_HELP_STRING([--with-autoheader], + [use a different autoheader for regeneration of Makefiles]), + [ + unset AUTOHEADER + AM_MISSING_PROG(AUTOHEADER, ${withval}) + AC_MSG_NOTICE([Using $AUTOHEADER as autoheader]) + ]) + + dnl allow for different automake version + AC_ARG_WITH(automake, + AC_HELP_STRING([--with-automake], + [use a different automake for regeneration of Makefiles]), + [ + unset AUTOMAKE + AM_MISSING_PROG(AUTOMAKE, ${withval}) + AC_MSG_NOTICE([Using $AUTOMAKE as automake]) + ]) + + dnl allow for different aclocal version + AC_ARG_WITH(aclocal, + AC_HELP_STRING([--with-aclocal], + [use a different aclocal for regeneration of Makefiles]), + [ + unset ACLOCAL + AM_MISSING_PROG(ACLOCAL, ${withval}) + AC_MSG_NOTICE([Using $ACLOCAL as aclocal]) + ]) +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/as-compiler-flag.m4 gstreamer-vaapi-1.8.2/common/m4/as-compiler-flag.m4 --- gstreamer-vaapi-0.7.0/common/m4/as-compiler-flag.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/as-compiler-flag.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,96 @@ +dnl as-compiler-flag.m4 0.1.0 + +dnl autostars m4 macro for detection of compiler flags + +dnl David Schleef +dnl Tim-Philipp Müller + +dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) +dnl Tries to compile with the given CFLAGS. +dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_COMPILER_FLAG], +[ + AC_MSG_CHECKING([to see if compiler understands $1]) + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $1" + + AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + $2 + true + else + $3 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + +dnl AS_CXX_COMPILER_FLAG(CPPFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) +dnl Tries to compile with the given CPPFLAGS. +dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_CXX_COMPILER_FLAG], +[ + AC_REQUIRE([AC_PROG_CXX]) + + AC_MSG_CHECKING([to see if c++ compiler understands $1]) + + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $1" + + AC_LANG_PUSH(C++) + + AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) + CPPFLAGS="$save_CPPFLAGS" + + if test "X$flag_ok" = Xyes ; then + $2 + true + else + $3 + true + fi + + AC_LANG_POP(C++) + + AC_MSG_RESULT([$flag_ok]) +]) + +dnl AS_OBJC_COMPILER_FLAG(CPPFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) +dnl Tries to compile with the given CPPFLAGS. +dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_OBJC_COMPILER_FLAG], +[ + AC_REQUIRE([AC_PROG_OBJC]) + + AC_MSG_CHECKING([to see if Objective C compiler understands $1]) + + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $1" + + AC_LANG_PUSH([Objective C]) + + AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) + CPPFLAGS="$save_CPPFLAGS" + + if test "X$flag_ok" = Xyes ; then + $2 + true + else + $3 + true + fi + + AC_LANG_POP([Objective C]) + + AC_MSG_RESULT([$flag_ok]) +]) + diff -Nru gstreamer-vaapi-0.7.0/common/m4/as-compiler.m4 gstreamer-vaapi-1.8.2/common/m4/as-compiler.m4 --- gstreamer-vaapi-0.7.0/common/m4/as-compiler.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/as-compiler.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,44 @@ +dnl as-compiler.m4 0.1.0 + +dnl autostars m4 macro for detection of compiler flavor + +dnl Thomas Vander Stichele + +dnl $Id: as-compiler.m4,v 1.4 2004/06/01 09:44:19 thomasvs Exp $ + +dnl AS_COMPILER(COMPILER) +dnl will set variable COMPILER to +dnl - gcc +dnl - forte +dnl - (empty) if no guess could be made + +AC_DEFUN([AS_COMPILER], +[ + as_compiler= + AC_MSG_CHECKING(for compiler flavour) + + dnl is it gcc ? + if test "x$GCC" = "xyes"; then + as_compiler="gcc" + fi + + dnl is it forte ? + AC_TRY_RUN([ +int main +(int argc, char *argv[]) +{ +#ifdef __sun + return 0; +#else + return 1; +#endif +} + ], as_compiler="forte", ,) + + if test "x$as_compiler" = "x"; then + AC_MSG_RESULT([unknown !]) + else + AC_MSG_RESULT($as_compiler) + fi + [$1]=$as_compiler +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/as-docbook.m4 gstreamer-vaapi-1.8.2/common/m4/as-docbook.m4 --- gstreamer-vaapi-0.7.0/common/m4/as-docbook.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/as-docbook.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,78 @@ +dnl AS_DOCBOOK([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl checks if xsltproc can build docbook documentation +dnl (which is possible if the catalog is set up properly +dnl I also tried checking for a specific version and type of docbook +dnl but xsltproc seemed to happily run anyway, so we can't check for that +dnl and version +dnl this macro takes inspiration from +dnl http://www.movement.uklinux.net/docs/docbook-autotools/configure.html +AC_DEFUN([AS_DOCBOOK], +[ + XSLTPROC_FLAGS=--nonet + DOCBOOK_ROOT= + TYPE_LC=xml + TYPE_UC=XML + DOCBOOK_VERSION=4.1.2 + + if test -n "$XML_CATALOG_FILES"; then + oldIFS=$IFS + IFS=' ' + for xml_catalog_file in $XML_CATALOG_FILES; do + if test -f $xml_catalog_file; then + XML_CATALOG=$xml_catalog_file + CAT_ENTRY_START='' + break + fi + done + IFS=$oldIFS + elif test ! -f /etc/xml/catalog; then + for i in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/sgml/docbook/xsl-stylesheets/ /usr/local/share/xsl/docbook ; + do + if test -d "$i"; then + DOCBOOK_ROOT=$i + fi + done + else + XML_CATALOG=/etc/xml/catalog + CAT_ENTRY_START='' + fi + + dnl We need xsltproc to process the test + AC_CHECK_PROG(XSLTPROC,xsltproc,xsltproc,) + XSLTPROC_WORKS=no + if test -n "$XSLTPROC"; then + AC_MSG_CHECKING([whether xsltproc docbook processing works]) + + if test -n "$XML_CATALOG"; then + DB_FILE="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl" + else + DB_FILE="$DOCBOOK_ROOT/xhtml/docbook.xsl" + fi + $XSLTPROC $XSLTPROC_FLAGS $DB_FILE >/dev/null 2>&1 << END + + + + +END + if test "$?" = 0; then + XSLTPROC_WORKS=yes + fi + AC_MSG_RESULT($XSLTPROC_WORKS) + fi + + if test "x$XSLTPROC_WORKS" = "xyes"; then + dnl execute ACTION-IF-FOUND + ifelse([$1], , :, [$1]) + else + dnl execute ACTION-IF-NOT-FOUND + ifelse([$2], , :, [$2]) + fi + + AC_SUBST(XML_CATALOG) + AC_SUBST(XSLTPROC_FLAGS) + AC_SUBST(DOCBOOK_ROOT) + AC_SUBST(CAT_ENTRY_START) + AC_SUBST(CAT_ENTRY_END) +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/as-gcc-inline-assembly.m4 gstreamer-vaapi-1.8.2/common/m4/as-gcc-inline-assembly.m4 --- gstreamer-vaapi-0.7.0/common/m4/as-gcc-inline-assembly.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/as-gcc-inline-assembly.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,52 @@ +dnl as-gcc-inline-assembly.m4 0.1.0 + +dnl autostars m4 macro for detection of gcc inline assembly + +dnl David Schleef + +dnl $Id$ + +dnl AS_COMPILER_FLAG(ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) +dnl Tries to compile with the given CFLAGS. +dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_GCC_INLINE_ASSEMBLY], +[ + AC_MSG_CHECKING([if compiler supports gcc-style inline assembly]) + + AC_TRY_COMPILE([], [ +#ifdef __GNUC_MINOR__ +#if (__GNUC__ * 1000 + __GNUC_MINOR__) < 3004 +#error GCC before 3.4 has critical bugs compiling inline assembly +#endif +#endif +__asm__ (""::) ], [flag_ok=yes], [flag_ok=no]) + + if test "X$flag_ok" = Xyes ; then + $1 + true + else + $2 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + + +AC_DEFUN([AS_GCC_ASM_POWERPC_FPU], +[ + AC_MSG_CHECKING([if compiler supports FPU instructions on PowerPC]) + + AC_TRY_COMPILE([], [__asm__ ("fadd 0,0,0"::) ], [flag_ok=yes], [flag_ok=no]) + + if test "X$flag_ok" = Xyes ; then + $1 + true + else + $2 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + diff -Nru gstreamer-vaapi-0.7.0/common/m4/as-libtool.m4 gstreamer-vaapi-1.8.2/common/m4/as-libtool.m4 --- gstreamer-vaapi-0.7.0/common/m4/as-libtool.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/as-libtool.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,46 @@ +dnl as-libtool.m4 0.1.4 + +dnl autostars m4 macro for libtool versioning + +dnl Thomas Vander Stichele + +dnl $Id: as-libtool.m4,v 1.10 2005/10/15 13:44:23 thomasvs Exp $ + +dnl AS_LIBTOOL(PREFIX, CURRENT, REVISION, AGE, [RELEASE]) + +dnl example +dnl AS_LIBTOOL(GST, 2, 0, 0) + +dnl this macro +dnl - defines [$PREFIX]_CURRENT, REVISION and AGE +dnl - defines [$PREFIX]_LIBVERSION +dnl - defines [$PREFIX]_LT_LDFLAGS to set versioning +dnl - AC_SUBST's them all + +dnl if RELEASE is given, then add a -release option to the LDFLAGS +dnl with the given release version +dnl then use [$PREFIX]_LT_LDFLAGS in the relevant Makefile.am's + +dnl call AM_PROG_LIBTOOL after this call + +AC_DEFUN([AS_LIBTOOL], +[ + [$1]_CURRENT=[$2] + [$1]_REVISION=[$3] + [$1]_AGE=[$4] + [$1]_LIBVERSION=[$2]:[$3]:[$4] + AC_SUBST([$1]_CURRENT) + AC_SUBST([$1]_REVISION) + AC_SUBST([$1]_AGE) + AC_SUBST([$1]_LIBVERSION) + + [$1]_LT_LDFLAGS="$[$1]_LT_LDFLAGS -version-info $[$1]_LIBVERSION" + if test ! -z "[$5]" + then + [$1]_LT_LDFLAGS="$[$1]_LT_LDFLAGS -release [$5]" + fi + AC_SUBST([$1]_LT_LDFLAGS) + + LT_PREREQ([2.2.6]) + LT_INIT([dlopen win32-dll disable-static]) +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/as-libtool-tags.m4 gstreamer-vaapi-1.8.2/common/m4/as-libtool-tags.m4 --- gstreamer-vaapi-0.7.0/common/m4/as-libtool-tags.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/as-libtool-tags.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,83 @@ +dnl as-libtool-tags.m4 0.1.4 + +dnl autostars m4 macro for selecting libtool "tags" (languages) + +dnl Andy Wingo does not claim credit for this macro +dnl backported from libtool 1.6 by Paolo Bonzini +dnl see http://lists.gnu.org/archive/html/libtool/2003-12/msg00007.html + +dnl $Id$ + +dnl AS_LIBTOOL_TAGS([tags...]) + +dnl example +dnl AS_LIBTOOL_TAGS([]) for only C (no fortran, etc) + +dnl When AC_LIBTOOL_TAGS is used, I redefine _LT_AC_TAGCONFIG +dnl to be more similar to the libtool 1.6 implementation, which +dnl uses an m4 loop and m4 case instead of a shell loop. This +dnl way the CXX/GCJ/F77/RC tests are not always expanded. + +dnl AS_LIBTOOL_TAGS +dnl --------------- +dnl tags to enable +AC_DEFUN([AS_LIBTOOL_TAGS], +[m4_define([_LT_TAGS],[$1]) +m4_define([_LT_AC_TAGCONFIG], [ + # redefined LT AC TAGCONFIG + if test -f "$ltmain"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) + fi + fi + + AC_FOREACH([_LT_TAG], _LT_TAGS, + echo THOMAS: tag _LT_TAG + [m4_case(_LT_TAG, + [CXX], [ + if test -n "$CXX" && test "X$CXX" != "Xno"; then + echo "THOMAS: YAY CXX" + AC_LIBTOOL_LANG_CXX_CONFIG + available_tags="$available_tags _LT_TAG" + fi], + [F77], [ + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + available_tags="$available_tags _LT_TAG" + fi], + [GCJ], [ + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + available_tags="$available_tags _LT_TAG" + fi], + [RC], [ + if test -n "$RC" && test "X$RC" != "Xno"; then + AC_LIBTOOL_LANG_RC_CONFIG + available_tags="$available_tags _LT_TAG" + fi], + [m4_errprintn(m4_location[: error: invalid tag name: ]"_LT_TAG") + m4_exit(1)]) + ]) + echo THOMAS: available tags: $available_tags + fi + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + AC_MSG_NOTICE([updated available libtool tags with $available_tags.]) + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + + fi + +])dnl _LT_AC_TAG_CONFIG +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/as-python.m4 gstreamer-vaapi-1.8.2/common/m4/as-python.m4 --- gstreamer-vaapi-0.7.0/common/m4/as-python.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/as-python.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,152 @@ +## ------------------------ +## Python file handling +## From Andrew Dalke +## Updated by James Henstridge +## Updated by Andy Wingo to loop through possible pythons +## ------------------------ + +# AS_PATH_PYTHON([MINIMUM-VERSION]) + +# Adds support for distributing Python modules and packages. To +# install modules, copy them to $(pythondir), using the python_PYTHON +# automake variable. To install a package with the same name as the +# automake package, install to $(pkgpythondir), or use the +# pkgpython_PYTHON automake variable. + +# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as +# locations to install python extension modules (shared libraries). +# Another macro is required to find the appropriate flags to compile +# extension modules. + +# If your package is configured with a different prefix to python, +# users will have to add the install directory to the PYTHONPATH +# environment variable, or create a .pth file (see the python +# documentation for details). + +# If the MINIMUM-VERSION argument is passed, AS_PATH_PYTHON will +# cause an error if the version of python installed on the system +# doesn't meet the requirement. MINIMUM-VERSION should consist of +# numbers and dots only. + +# Updated to loop over all possible python binaries by Andy Wingo +# +# Updated to only warn and unset PYTHON if no good one is found + +AC_DEFUN([AS_PATH_PYTHON], + [ + dnl Find a version of Python. I could check for python versions 1.4 + dnl or earlier, but the default installation locations changed from + dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages + dnl in 1.5, and I don't want to maintain that logic. + + dnl should we do the version check? + PYTHON_CANDIDATES="python python2.2 python2.1 python2.0 python2 \ + python1.6 python1.5" + ifelse([$1],[], + [AC_PATH_PROG(PYTHON, $PYTHON_CANDIDATES)], + [ + AC_MSG_NOTICE(Looking for Python version >= $1) + changequote(<<, >>)dnl + prog=" +import sys, string +minver = '$1' +# split string by '.' and convert to numeric +minver_info = map(string.atoi, string.split(minver, '.')) +# we can now do comparisons on the two lists: +if sys.version_info >= tuple(minver_info): + sys.exit(0) +else: + sys.exit(1)" + changequote([, ])dnl + + python_good=false + for python_candidate in $PYTHON_CANDIDATES; do + unset PYTHON + AC_PATH_PROG(PYTHON, $python_candidate) 1> /dev/null 2> /dev/null + + if test "x$PYTHON" = "x"; then continue; fi + + if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC; then + AC_MSG_CHECKING(["$PYTHON":]) + AC_MSG_RESULT([okay]) + python_good=true + break; + else + dnl clear the cache val + unset ac_cv_path_PYTHON + fi + done + ]) + + if test "$python_good" != "true"; then + AC_MSG_WARN([No suitable version of python found]) + PYTHON= + else + + AC_MSG_CHECKING([local Python configuration]) + + dnl Query Python for its version number. Getting [:3] seems to be + dnl the best way to do this; it's what "site.py" does in the standard + dnl library. Need to change quote character because of [:3] + + AC_SUBST(PYTHON_VERSION) + changequote(<<, >>)dnl + PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[:3]"` + changequote([, ])dnl + + + dnl Use the values of $prefix and $exec_prefix for the corresponding + dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made + dnl distinct variables so they can be overridden if need be. However, + dnl general consensus is that you shouldn't need this ability. + + AC_SUBST(PYTHON_PREFIX) + PYTHON_PREFIX='${prefix}' + + AC_SUBST(PYTHON_EXEC_PREFIX) + PYTHON_EXEC_PREFIX='${exec_prefix}' + + dnl At times (like when building shared libraries) you may want + dnl to know which OS platform Python thinks this is. + + AC_SUBST(PYTHON_PLATFORM) + PYTHON_PLATFORM=`$PYTHON -c "import sys; print sys.platform"` + + + dnl Set up 4 directories: + + dnl pythondir -- where to install python scripts. This is the + dnl site-packages directory, not the python standard library + dnl directory like in previous automake betas. This behaviour + dnl is more consistent with lispdir.m4 for example. + dnl + dnl Also, if the package prefix isn't the same as python's prefix, + dnl then the old $(pythondir) was pretty useless. + + AC_SUBST(pythondir) + pythondir=$PYTHON_PREFIX"/lib/python"$PYTHON_VERSION/site-packages + + dnl pkgpythondir -- $PACKAGE directory under pythondir. Was + dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is + dnl more consistent with the rest of automake. + dnl Maybe this should be put in python.am? + + AC_SUBST(pkgpythondir) + pkgpythondir=\${pythondir}/$PACKAGE + + dnl pyexecdir -- directory for installing python extension modules + dnl (shared libraries) Was PYTHON_SITE_EXEC in previous betas. + + AC_SUBST(pyexecdir) + pyexecdir=$PYTHON_EXEC_PREFIX"/lib/python"$PYTHON_VERSION/site-packages + + dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) + dnl Maybe this should be put in python.am? + + AC_SUBST(pkgpyexecdir) + pkgpyexecdir=\${pyexecdir}/$PACKAGE + + AC_MSG_RESULT([looks good]) + + fi +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/as-version.m4 gstreamer-vaapi-1.8.2/common/m4/as-version.m4 --- gstreamer-vaapi-0.7.0/common/m4/as-version.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/as-version.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,75 @@ +dnl as-version.m4 0.2.0 + +dnl autostars m4 macro for versioning + +dnl Thomas Vander Stichele + +dnl $Id: as-version.m4,v 1.15 2006/04/01 09:40:24 thomasvs Exp $ + +dnl AS_VERSION + +dnl example +dnl AS_VERSION + +dnl this macro +dnl - AC_SUBST's PACKAGE_VERSION_MAJOR, _MINOR, _MICRO +dnl - AC_SUBST's PACKAGE_VERSION_RELEASE, +dnl which can be used for rpm release fields +dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents +dnl maintainer mode from running correctly +dnl +dnl don't forget to put #undef PACKAGE_VERSION_RELEASE in acconfig.h +dnl if you use acconfig.h + +AC_DEFUN([AS_VERSION], +[ + PACKAGE_VERSION_MAJOR=$(echo AC_PACKAGE_VERSION | cut -d'.' -f1) + PACKAGE_VERSION_MINOR=$(echo AC_PACKAGE_VERSION | cut -d'.' -f2) + PACKAGE_VERSION_MICRO=$(echo AC_PACKAGE_VERSION | cut -d'.' -f3) + + AC_SUBST(PACKAGE_VERSION_MAJOR) + AC_SUBST(PACKAGE_VERSION_MINOR) + AC_SUBST(PACKAGE_VERSION_MICRO) +]) + +dnl AS_NANO(ACTION-IF-NANO-NON-NULL, [ACTION-IF-NANO-NULL]) + +dnl requires AC_INIT to be called before +dnl For projects using a fourth or nano number in your versioning to indicate +dnl development or prerelease snapshots, this macro allows the build to be +dnl set up differently accordingly. + +dnl this macro: +dnl - parses AC_PACKAGE_VERSION, set by AC_INIT, and extracts the nano number +dnl - sets the variable PACKAGE_VERSION_NANO +dnl - sets the variable PACKAGE_VERSION_RELEASE, which can be used +dnl for rpm release fields +dnl - executes ACTION-IF-NANO-NON-NULL or ACTION-IF-NANO-NULL + +dnl example: +dnl AS_NANO(RELEASE="yes", RELEASE="no") + +AC_DEFUN([AS_NANO], +[ + AC_MSG_CHECKING(nano version) + + NANO=$(echo AC_PACKAGE_VERSION | cut -d'.' -f4) + + if test x"$NANO" = x || test "x$NANO" = "x0" ; then + AC_MSG_RESULT([0 (release)]) + NANO=0 + PACKAGE_VERSION_RELEASE=1 + ifelse([$1], , :, [$1]) + else + AC_MSG_RESULT($NANO) + PACKAGE_VERSION_RELEASE=0.`date +%Y%m%d.%H%M%S` + if test "x$NANO" != "x1" ; then + ifelse([$1], , :, [$1]) + else + ifelse([$2], , :, [$2]) + fi + fi + PACKAGE_VERSION_NANO=$NANO + AC_SUBST(PACKAGE_VERSION_NANO) + AC_SUBST(PACKAGE_VERSION_RELEASE) +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/ax_create_stdint_h.m4 gstreamer-vaapi-1.8.2/common/m4/ax_create_stdint_h.m4 --- gstreamer-vaapi-0.7.0/common/m4/ax_create_stdint_h.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/ax_create_stdint_h.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,734 @@ +##### http://autoconf-archive.cryp.to/ax_create_stdint_h.html +# +# SYNOPSIS +# +# AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])] +# +# DESCRIPTION +# +# the "ISO C9X: 7.18 Integer types " section requires the +# existence of an include file that defines a set of +# typedefs, especially uint8_t,int32_t,uintptr_t. Many older +# installations will not provide this file, but some will have the +# very same definitions in . In other enviroments we can +# use the inet-types in which would define the typedefs +# int8_t and u_int8_t respectivly. +# +# This macros will create a local "_stdint.h" or the headerfile given +# as an argument. In many cases that file will just "#include +# " or "#include ", while in other environments +# it will provide the set of basic 'stdint's definitions/typedefs: +# +# int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t +# int_least32_t.. int_fast32_t.. intmax_t +# +# which may or may not rely on the definitions of other files, or +# using the AC_CHECK_SIZEOF macro to determine the actual sizeof each +# type. +# +# if your header files require the stdint-types you will want to +# create an installable file mylib-int.h that all your other +# installable header may include. So if you have a library package +# named "mylib", just use +# +# AX_CREATE_STDINT_H(mylib-int.h) +# +# in configure.ac and go to install that very header file in +# Makefile.am along with the other headers (mylib.h) - and the +# mylib-specific headers can simply use "#include " to +# obtain the stdint-types. +# +# Remember, if the system already had a valid , the +# generated file will include it directly. No need for fuzzy +# HAVE_STDINT_H things... (oops, GCC 4.2.x has deliberatly disabled +# its stdint.h for non-c99 compilation and the c99-mode is not the +# default. Therefore this macro will not use the compiler's stdint.h +# - please complain to the GCC developers). +# +# LAST MODIFICATION +# +# 2007-06-27 +# +# COPYLEFT +# +# Copyright (c) 2007 Guido U. Draheim +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. +# +# As a special exception, the respective Autoconf Macro's copyright +# owner gives unlimited permission to copy, distribute and modify the +# configure scripts that are the output of Autoconf when processing +# the Macro. You need not follow the terms of the GNU General Public +# License when using or distributing such scripts, even though +# portions of the text of the Macro appear in them. The GNU General +# Public License (GPL) does govern all other use of the material that +# constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the +# Autoconf Macro released by the Autoconf Macro Archive. When you +# make and distribute a modified version of the Autoconf Macro, you +# may extend this special exception to the GPL to apply to your +# modified version as well. + +AC_DEFUN([AX_CHECK_DATA_MODEL],[ + AC_CHECK_SIZEOF(char) + AC_CHECK_SIZEOF(short) + AC_CHECK_SIZEOF(int) + AC_CHECK_SIZEOF(long) + AC_CHECK_SIZEOF(void*) + ac_cv_char_data_model="" + ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char" + ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short" + ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int" + ac_cv_long_data_model="" + ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int" + ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long" + ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp" + AC_MSG_CHECKING([data model]) + case "$ac_cv_char_data_model/$ac_cv_long_data_model" in + 122/242) ac_cv_data_model="IP16" ; n="standard 16bit machine" ;; + 122/244) ac_cv_data_model="LP32" ; n="standard 32bit machine" ;; + 122/*) ac_cv_data_model="i16" ; n="unusual int16 model" ;; + 124/444) ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;; + 124/488) ac_cv_data_model="LP64" ; n="standard 64bit unixish" ;; + 124/448) ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;; + 124/*) ac_cv_data_model="i32" ; n="unusual int32 model" ;; + 128/888) ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;; + 128/*) ac_cv_data_model="i64" ; n="unusual int64 model" ;; + 222/*2) ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;; + 333/*3) ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;; + 444/*4) ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;; + 666/*6) ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;; + 888/*8) ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;; + 222/*|333/*|444/*|666/*|888/*) : + ac_cv_data_model="iDSP" ; n="unusual dsptype" ;; + *) ac_cv_data_model="none" ; n="very unusual model" ;; + esac + AC_MSG_RESULT([$ac_cv_data_model ($ac_cv_long_data_model, $n)]) +]) + +dnl AX_CHECK_HEADER_STDINT_X([HEADERLIST][,ACTION-IF]) +AC_DEFUN([AX_CHECK_HEADER_STDINT_X],[ +AC_CACHE_CHECK([for stdint uintptr_t], [ac_cv_header_stdint_x],[ + ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h) + AC_MSG_RESULT([(..)]) + for i in m4_ifval([$1],[$1],[stdint.h inttypes.h sys/inttypes.h sys/types.h]) + do + unset ac_cv_type_uintptr_t + unset ac_cv_type_uint64_t + AC_CHECK_TYPE(uintptr_t,[ac_cv_header_stdint_x=$i],continue,[#include <$i>]) + AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) + m4_ifvaln([$2],[$2]) break + done + AC_MSG_CHECKING([for stdint uintptr_t]) + ]) +]) + +AC_DEFUN([AX_CHECK_HEADER_STDINT_O],[ +AC_CACHE_CHECK([for stdint uint32_t], [ac_cv_header_stdint_o],[ + ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h) + AC_MSG_RESULT([(..)]) + for i in m4_ifval([$1],[$1],[inttypes.h sys/inttypes.h sys/types.h stdint.h]) + do + unset ac_cv_type_uint32_t + unset ac_cv_type_uint64_t + AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],continue,[#include <$i>]) + AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) + m4_ifvaln([$2],[$2]) break + break; + done + AC_MSG_CHECKING([for stdint uint32_t]) + ]) +]) + +AC_DEFUN([AX_CHECK_HEADER_STDINT_U],[ +AC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[ + ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h) + AC_MSG_RESULT([(..)]) + for i in m4_ifval([$1],[$1],[sys/types.h inttypes.h sys/inttypes.h]) ; do + unset ac_cv_type_u_int32_t + unset ac_cv_type_u_int64_t + AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],continue,[#include <$i>]) + AC_CHECK_TYPE(u_int64_t,[and64="/u_int64_t"],[and64=""],[#include<$i>]) + m4_ifvaln([$2],[$2]) break + break; + done + AC_MSG_CHECKING([for stdint u_int32_t]) + ]) +]) + +AC_DEFUN([AX_CREATE_STDINT_H], +[# ------ AX CREATE STDINT H ------------------------------------- +AC_MSG_CHECKING([for stdint types]) +ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)` +# try to shortcircuit - if the default include path of the compiler +# can find a "stdint.h" header then we assume that all compilers can. +AC_CACHE_VAL([ac_cv_header_stdint_t],[ +old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS="" +old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="" +old_CFLAGS="$CFLAGS" ; CFLAGS="" +AC_TRY_COMPILE([#include ],[int_least32_t v = 0;], +[ac_cv_stdint_result="(assuming C99 compatible system)" + ac_cv_header_stdint_t="stdint.h"; ], +[ac_cv_header_stdint_t=""]) +if test "$GCC" = "yes" && test ".$ac_cv_header_stdint_t" = "."; then +CFLAGS="-std=c99" +AC_TRY_COMPILE([#include ],[int_least32_t v = 0;], +[AC_MSG_WARN(your GCC compiler has a defunct stdint.h for its default-mode)]) +fi +CXXFLAGS="$old_CXXFLAGS" +CPPFLAGS="$old_CPPFLAGS" +CFLAGS="$old_CFLAGS" ]) + +v="... $ac_cv_header_stdint_h" +if test "$ac_stdint_h" = "stdint.h" ; then + AC_MSG_RESULT([(are you sure you want them in ./stdint.h?)]) +elif test "$ac_stdint_h" = "inttypes.h" ; then + AC_MSG_RESULT([(are you sure you want them in ./inttypes.h?)]) +elif test "_$ac_cv_header_stdint_t" = "_" ; then + AC_MSG_RESULT([(putting them into $ac_stdint_h)$v]) +else + ac_cv_header_stdint="$ac_cv_header_stdint_t" + AC_MSG_RESULT([$ac_cv_header_stdint (shortcircuit)]) +fi + +if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit.. + +dnl .....intro message done, now do a few system checks..... +dnl btw, all old CHECK_TYPE macros do automatically "DEFINE" a type, +dnl therefore we use the autoconf implementation detail CHECK_TYPE_NEW +dnl instead that is triggered with 3 or more arguments (see types.m4) + +inttype_headers=`echo $2 | sed -e 's/,/ /g'` + +ac_cv_stdint_result="(no helpful system typedefs seen)" +AX_CHECK_HEADER_STDINT_X(dnl + stdint.h inttypes.h sys/inttypes.h $inttype_headers, + ac_cv_stdint_result="(seen uintptr_t$and64 in $i)") + +if test "_$ac_cv_header_stdint_x" = "_" ; then +AX_CHECK_HEADER_STDINT_O(dnl, + inttypes.h sys/inttypes.h stdint.h $inttype_headers, + ac_cv_stdint_result="(seen uint32_t$and64 in $i)") +fi + +if test "_$ac_cv_header_stdint_x" = "_" ; then +if test "_$ac_cv_header_stdint_o" = "_" ; then +AX_CHECK_HEADER_STDINT_U(dnl, + sys/types.h inttypes.h sys/inttypes.h $inttype_headers, + ac_cv_stdint_result="(seen u_int32_t$and64 in $i)") +fi fi + +dnl if there was no good C99 header file, do some typedef checks... +if test "_$ac_cv_header_stdint_x" = "_" ; then + AC_MSG_CHECKING([for stdint datatype model]) + AC_MSG_RESULT([(..)]) + AX_CHECK_DATA_MODEL +fi + +if test "_$ac_cv_header_stdint_x" != "_" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_x" +elif test "_$ac_cv_header_stdint_o" != "_" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_o" +elif test "_$ac_cv_header_stdint_u" != "_" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_u" +else + ac_cv_header_stdint="stddef.h" +fi + +AC_MSG_CHECKING([for extra inttypes in chosen header]) +AC_MSG_RESULT([($ac_cv_header_stdint)]) +dnl see if int_least and int_fast types are present in _this_ header. +unset ac_cv_type_int_least32_t +unset ac_cv_type_int_fast32_t +AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>]) +AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>]) +AC_CHECK_TYPE(intmax_t,,,[#include <$ac_cv_header_stdint>]) + +fi # shortcircut to system "stdint.h" +# ------------------ PREPARE VARIABLES ------------------------------ +if test "$GCC" = "yes" ; then +ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` +else +ac_cv_stdint_message="using $CC" +fi + +AC_MSG_RESULT([make use of $ac_cv_header_stdint in $ac_stdint_h dnl +$ac_cv_stdint_result]) + +dnl ----------------------------------------------------------------- +# ----------------- DONE inttypes.h checks START header ------------- +AC_CONFIG_COMMANDS([$ac_stdint_h],[ +AC_MSG_NOTICE(creating $ac_stdint_h : $_ac_stdint_h) +ac_stdint=$tmp/_stdint.h + +echo "#ifndef" $_ac_stdint_h >$ac_stdint +echo "#define" $_ac_stdint_h "1" >>$ac_stdint +echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint +echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint +echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint +if test "_$ac_cv_header_stdint_t" != "_" ; then +echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint +echo "#include " >>$ac_stdint +echo "#endif" >>$ac_stdint +echo "#endif" >>$ac_stdint +else + +cat >>$ac_stdint < +#else +#include + +/* .................... configured part ............................ */ + +STDINT_EOF + +echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint +if test "_$ac_cv_header_stdint_x" != "_" ; then + ac_header="$ac_cv_header_stdint_x" + echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint +else + echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint +fi + +echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint +if test "_$ac_cv_header_stdint_o" != "_" ; then + ac_header="$ac_cv_header_stdint_o" + echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint +else + echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint +fi + +echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint +if test "_$ac_cv_header_stdint_u" != "_" ; then + ac_header="$ac_cv_header_stdint_u" + echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint +else + echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint +fi + +echo "" >>$ac_stdint + +if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then + echo "#include <$ac_header>" >>$ac_stdint + echo "" >>$ac_stdint +fi fi + +echo "/* which 64bit typedef has been found */" >>$ac_stdint +if test "$ac_cv_type_uint64_t" = "yes" ; then +echo "#define _STDINT_HAVE_UINT64_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint +fi +if test "$ac_cv_type_u_int64_t" = "yes" ; then +echo "#define _STDINT_HAVE_U_INT64_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint +fi +echo "" >>$ac_stdint + +echo "/* which type model has been detected */" >>$ac_stdint +if test "_$ac_cv_char_data_model" != "_" ; then +echo "#define _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint +echo "#define _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint +else +echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint +echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint +fi +echo "" >>$ac_stdint + +echo "/* whether int_least types were detected */" >>$ac_stdint +if test "$ac_cv_type_int_least32_t" = "yes"; then +echo "#define _STDINT_HAVE_INT_LEAST32_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint +fi +echo "/* whether int_fast types were detected */" >>$ac_stdint +if test "$ac_cv_type_int_fast32_t" = "yes"; then +echo "#define _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint +fi +echo "/* whether intmax_t type was detected */" >>$ac_stdint +if test "$ac_cv_type_intmax_t" = "yes"; then +echo "#define _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint +fi +echo "" >>$ac_stdint + + cat >>$ac_stdint <= 199901L +#define _HAVE_UINT64_T +#define _HAVE_LONGLONG_UINT64_T +typedef long long int64_t; +typedef unsigned long long uint64_t; + +#elif !defined __STRICT_ANSI__ +#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ +#define _HAVE_UINT64_T +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; + +#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__ +/* note: all ELF-systems seem to have loff-support which needs 64-bit */ +#if !defined _NO_LONGLONG +#define _HAVE_UINT64_T +#define _HAVE_LONGLONG_UINT64_T +typedef long long int64_t; +typedef unsigned long long uint64_t; +#endif + +#elif defined __alpha || (defined __mips && defined _ABIN32) +#if !defined _NO_LONGLONG +typedef long int64_t; +typedef unsigned long uint64_t; +#endif + /* compiler/cpu type to define int64_t */ +#endif +#endif +#endif + +#if defined _STDINT_HAVE_U_INT_TYPES +/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */ +typedef u_int8_t uint8_t; +typedef u_int16_t uint16_t; +typedef u_int32_t uint32_t; + +/* glibc compatibility */ +#ifndef __int8_t_defined +#define __int8_t_defined +#endif +#endif + +#ifdef _STDINT_NEED_INT_MODEL_T +/* we must guess all the basic types. Apart from byte-adressable system, */ +/* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */ +/* (btw, those nibble-addressable systems are way off, or so we assume) */ + +dnl /* have a look at "64bit and data size neutrality" at */ +dnl /* http://unix.org/version2/whatsnew/login_64bit.html */ +dnl /* (the shorthand "ILP" types always have a "P" part) */ + +#if defined _STDINT_BYTE_MODEL +#if _STDINT_LONG_MODEL+0 == 242 +/* 2:4:2 = IP16 = a normal 16-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned long uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef long int32_t; +#endif +#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444 +/* 2:4:4 = LP32 = a 32-bit system derived from a 16-bit */ +/* 4:4:4 = ILP32 = a normal 32-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +#elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488 +/* 4:8:4 = IP32 = a 32-bit system prepared for 64-bit */ +/* 4:8:8 = LP64 = a normal 64-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +/* this system has a "long" of 64bit */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef unsigned long uint64_t; +typedef long int64_t; +#endif +#elif _STDINT_LONG_MODEL+0 == 448 +/* LLP64 a 64-bit system derived from a 32-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +/* assuming the system has a "long long" */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +#define _HAVE_LONGLONG_UINT64_T +typedef unsigned long long uint64_t; +typedef long long int64_t; +#endif +#else +#define _STDINT_NO_INT32_T +#endif +#else +#define _STDINT_NO_INT8_T +#define _STDINT_NO_INT32_T +#endif +#endif + +/* + * quote from SunOS-5.8 sys/inttypes.h: + * Use at your own risk. As of February 1996, the committee is squarely + * behind the fixed sized types; the "least" and "fast" types are still being + * discussed. The probability that the "fast" types may be removed before + * the standard is finalized is high enough that they are not currently + * implemented. + */ + +#if defined _STDINT_NEED_INT_LEAST_T +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +#ifdef _HAVE_UINT64_T +typedef int64_t int_least64_t; +#endif + +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +#ifdef _HAVE_UINT64_T +typedef uint64_t uint_least64_t; +#endif + /* least types */ +#endif + +#if defined _STDINT_NEED_INT_FAST_T +typedef int8_t int_fast8_t; +typedef int int_fast16_t; +typedef int32_t int_fast32_t; +#ifdef _HAVE_UINT64_T +typedef int64_t int_fast64_t; +#endif + +typedef uint8_t uint_fast8_t; +typedef unsigned uint_fast16_t; +typedef uint32_t uint_fast32_t; +#ifdef _HAVE_UINT64_T +typedef uint64_t uint_fast64_t; +#endif + /* fast types */ +#endif + +#ifdef _STDINT_NEED_INTMAX_T +#ifdef _HAVE_UINT64_T +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; +#else +typedef long intmax_t; +typedef unsigned long uintmax_t; +#endif +#endif + +#ifdef _STDINT_NEED_INTPTR_T +#ifndef __intptr_t_defined +#define __intptr_t_defined +/* we encourage using "long" to store pointer values, never use "int" ! */ +#if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484 +typedef unsigned int uintptr_t; +typedef int intptr_t; +#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444 +typedef unsigned long uintptr_t; +typedef long intptr_t; +#elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T +typedef uint64_t uintptr_t; +typedef int64_t intptr_t; +#else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */ +typedef unsigned long uintptr_t; +typedef long intptr_t; +#endif +#endif +#endif + +/* The ISO C99 standard specifies that in C++ implementations these + should only be defined if explicitly requested. */ +#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS +#ifndef UINT32_C + +/* Signed. */ +# define INT8_C(c) c +# define INT16_C(c) c +# define INT32_C(c) c +# ifdef _HAVE_LONGLONG_UINT64_T +# define INT64_C(c) c ## L +# else +# define INT64_C(c) c ## LL +# endif + +/* Unsigned. */ +# define UINT8_C(c) c ## U +# define UINT16_C(c) c ## U +# define UINT32_C(c) c ## U +# ifdef _HAVE_LONGLONG_UINT64_T +# define UINT64_C(c) c ## UL +# else +# define UINT64_C(c) c ## ULL +# endif + +/* Maximal type. */ +# ifdef _HAVE_LONGLONG_UINT64_T +# define INTMAX_C(c) c ## L +# define UINTMAX_C(c) c ## UL +# else +# define INTMAX_C(c) c ## LL +# define UINTMAX_C(c) c ## ULL +# endif + + /* literalnumbers */ +#endif +#endif + +/* These limits are merily those of a two complement byte-oriented system */ + +/* Minimum of signed integral types. */ +# define INT8_MIN (-128) +# define INT16_MIN (-32767-1) +# define INT32_MIN (-2147483647-1) +# define INT64_MIN (-__INT64_C(9223372036854775807)-1) +/* Maximum of signed integral types. */ +# define INT8_MAX (127) +# define INT16_MAX (32767) +# define INT32_MAX (2147483647) +# define INT64_MAX (__INT64_C(9223372036854775807)) + +/* Maximum of unsigned integral types. */ +# define UINT8_MAX (255) +# define UINT16_MAX (65535) +# define UINT32_MAX (4294967295U) +# define UINT64_MAX (__UINT64_C(18446744073709551615)) + +/* Minimum of signed integral types having a minimum size. */ +# define INT_LEAST8_MIN INT8_MIN +# define INT_LEAST16_MIN INT16_MIN +# define INT_LEAST32_MIN INT32_MIN +# define INT_LEAST64_MIN INT64_MIN +/* Maximum of signed integral types having a minimum size. */ +# define INT_LEAST8_MAX INT8_MAX +# define INT_LEAST16_MAX INT16_MAX +# define INT_LEAST32_MAX INT32_MAX +# define INT_LEAST64_MAX INT64_MAX + +/* Maximum of unsigned integral types having a minimum size. */ +# define UINT_LEAST8_MAX UINT8_MAX +# define UINT_LEAST16_MAX UINT16_MAX +# define UINT_LEAST32_MAX UINT32_MAX +# define UINT_LEAST64_MAX UINT64_MAX + + /* shortcircuit*/ +#endif + /* once */ +#endif +#endif +STDINT_EOF +fi + if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then + AC_MSG_NOTICE([$ac_stdint_h is unchanged]) + else + ac_dir=`AS_DIRNAME(["$ac_stdint_h"])` + AS_MKDIR_P(["$ac_dir"]) + rm -f $ac_stdint_h + mv $ac_stdint $ac_stdint_h + fi +],[# variables for create stdint.h replacement +PACKAGE="$PACKAGE" +VERSION="$VERSION" +ac_stdint_h="$ac_stdint_h" +_ac_stdint_h=AS_TR_CPP(_$PACKAGE-$ac_stdint_h) +ac_cv_stdint_message="$ac_cv_stdint_message" +ac_cv_header_stdint_t="$ac_cv_header_stdint_t" +ac_cv_header_stdint_x="$ac_cv_header_stdint_x" +ac_cv_header_stdint_o="$ac_cv_header_stdint_o" +ac_cv_header_stdint_u="$ac_cv_header_stdint_u" +ac_cv_type_uint64_t="$ac_cv_type_uint64_t" +ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t" +ac_cv_char_data_model="$ac_cv_char_data_model" +ac_cv_long_data_model="$ac_cv_long_data_model" +ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t" +ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t" +ac_cv_type_intmax_t="$ac_cv_type_intmax_t" +]) +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/ax_pthread.m4 gstreamer-vaapi-1.8.2/common/m4/ax_pthread.m4 --- gstreamer-vaapi-0.7.0/common/m4/ax_pthread.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/ax_pthread.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,332 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_pthread.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. It +# sets the PTHREAD_LIBS output variable to the threads library and linker +# flags, and the PTHREAD_CFLAGS output variable to any special C compiler +# flags that are needed. (The user can also force certain compiler +# flags/libs to be tested by setting these environment variables.) +# +# Also sets PTHREAD_CC to any special C compiler that is needed for +# multi-threaded programs (defaults to the value of CC otherwise). (This +# is necessary on AIX to use the special cc_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these flags, +# but also link it with them as well. e.g. you should link with +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# +# If you are only building threads programs, you may wish to use these +# variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant +# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name +# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the +# PTHREAD_PRIO_INHERIT symbol is defined when compiling with +# PTHREAD_CFLAGS. +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads library +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +# is not found. If ACTION-IF-FOUND is not specified, the default action +# will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or if +# you have any other suggestions or comments. This macro was based on work +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by +# Alejandro Forero Cuervo to the autoconf macro repository. We are also +# grateful for the helpful feedback of numerous users. +# +# Updated for Autoconf 2.68 by Daniel Richard G. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2011 Daniel Richard G. +# +# 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 3 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, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 21 + +AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) +AC_DEFUN([AX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_LANG_PUSH([C]) +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) + AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes]) + AC_MSG_RESULT([$ax_pthread_ok]) + if test x"$ax_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case ${host_os} in + solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" + ;; + + darwin*) + ax_pthread_flags="-pthread $ax_pthread_flags" + ;; +esac + +# Clang doesn't consider unrecognized options an error unless we specify +# -Werror. We throw in some extra Clang-specific options to ensure that +# this doesn't happen for GCC, which also accepts -Werror. + +AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags]) +save_CFLAGS="$CFLAGS" +ax_pthread_extra_flags="-Werror" +CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument" +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])], + [AC_MSG_RESULT([yes])], + [ax_pthread_extra_flags= + AC_MSG_RESULT([no])]) +CFLAGS="$save_CFLAGS" + +if test x"$ax_pthread_ok" = xno; then +for flag in $ax_pthread_flags; do + + case $flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $flag]) + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) + if test x"$ax_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$flag]) + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include + static void routine(void *a) { a = 0; } + static void *start_routine(void *a) { return a; }], + [pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */])], + [ax_pthread_ok=yes], + []) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + AC_MSG_RESULT([$ax_pthread_ok]) + if test "x$ax_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$ax_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + AC_MSG_CHECKING([for joinable pthread attribute]) + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], + [int attr = $attr; return attr /* ; */])], + [attr_name=$attr; break], + []) + done + AC_MSG_RESULT([$attr_name]) + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name], + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) + fi + + AC_MSG_CHECKING([if more special flags are required for pthreads]) + flag=no + case ${host_os} in + aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; + osf* | hpux*) flag="-D_REENTRANT";; + solaris*) + if test "$GCC" = "yes"; then + flag="-D_REENTRANT" + else + # TODO: What about Clang on Solaris? + flag="-mt -D_REENTRANT" + fi + ;; + esac + AC_MSG_RESULT([$flag]) + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], + [ax_cv_PTHREAD_PRIO_INHERIT], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[int i = PTHREAD_PRIO_INHERIT;]])], + [ax_cv_PTHREAD_PRIO_INHERIT=yes], + [ax_cv_PTHREAD_PRIO_INHERIT=no]) + ]) + AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"], + [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])]) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: compile with *_r variant + if test "x$GCC" != xyes; then + case $host_os in + aix*) + AS_CASE(["x/$CC"], + [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], + [#handle absolute path differently from PATH based program lookup + AS_CASE(["x$CC"], + [x/*], + [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], + [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) + ;; + esac + fi +fi + +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" + +AC_SUBST([PTHREAD_LIBS]) +AC_SUBST([PTHREAD_CFLAGS]) +AC_SUBST([PTHREAD_CC]) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ax_pthread_ok" = xyes; then + ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) + : +else + ax_pthread_ok=no + $2 +fi +AC_LANG_POP +])dnl AX_PTHREAD diff -Nru gstreamer-vaapi-0.7.0/common/m4/check.m4 gstreamer-vaapi-1.8.2/common/m4/check.m4 --- gstreamer-vaapi-0.7.0/common/m4/check.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/check.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,181 @@ +dnl _AM_TRY_CHECK(MINIMUM-VERSION, EXTRA-CFLAGS, EXTRA-LIBS, CHECK-LIB-NAME +dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl Test for check, and define CHECK_CFLAGS and CHECK_LIBS +dnl Done this way because of the brokenness that is +dnl https://launchpad.net/distros/ubuntu/+source/check/+bug/5840 +dnl + +AC_DEFUN([_AM_TRY_CHECK], +[ + min_check_version=$1 + extra_cflags=$2 + extra_libs=$3 + check_lib_name=$4 + + CHECK_CFLAGS="$extra_cflags" + CHECK_LIBS="$extra_libs -l$check_lib_name" + + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + + CFLAGS="$CFLAGS $CHECK_CFLAGS" + LIBS="$CHECK_LIBS $LIBS" + + AC_MSG_CHECKING(for check named $check_lib_name - version >= $min_check_version) + + rm -f conf.check-test + dnl unset no_check, since in our second run it would have been set to yes + dnl before + no_check= + AC_TRY_RUN([ +#include +#include + +#include + +int main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.check-test"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = strdup("$min_check_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_check_version"); + return 1; + } + + if ((CHECK_MAJOR_VERSION != check_major_version) || + (CHECK_MINOR_VERSION != check_minor_version) || + (CHECK_MICRO_VERSION != check_micro_version)) + { + printf("\n*** The check header file (version %d.%d.%d) does not match\n", + CHECK_MAJOR_VERSION, CHECK_MINOR_VERSION, CHECK_MICRO_VERSION); + printf("*** the check library (version %d.%d.%d).\n", + check_major_version, check_minor_version, check_micro_version); + return 1; + } + + if ((check_major_version > major) || + ((check_major_version == major) && (check_minor_version > minor)) || + ((check_major_version == major) && (check_minor_version == minor) && (check_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of check (%d.%d.%d) was found.\n", + check_major_version, check_minor_version, check_micro_version); + printf("*** You need a version of check being at least %d.%d.%d.\n", major, minor, micro); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the check library and header\n"); + printf("*** file is being found. Rerun configure with the --with-check=PATH option\n"); + printf("*** to specify the prefix where the correct version was installed.\n"); + } + + return 1; +} +],, no_check=yes, [echo $ac_n "cross compiling; assumed OK... $ac_c"]) + + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + + if test "x$no_check" = x ; then + AC_MSG_RESULT(yes) + ifelse([$5], , :, [$5]) + else + AC_MSG_RESULT(no) + if test -f conf.check-test ; then + : + else + echo "*** Could not run check test program, checking why..." + CFLAGS="$CFLAGS $CHECK_CFLAGS" + LIBS="$CHECK_LIBS $LIBS" + AC_TRY_LINK([ +#include +#include + +#include +], , [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding check. You'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], + [ echo "*** The test program failed to compile or link. See the file config.log for" + echo "*** the exact error that occured." ]) + + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + + CHECK_CFLAGS="" + CHECK_LIBS="" + + rm -f conf.check-test + ifelse([$6], , AC_MSG_ERROR([check not found]), [$6]) + fi +]) + + +dnl AM_PATH_CHECK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for check, and define CHECK_CFLAGS and CHECK_LIBS +dnl + +AC_DEFUN([AM_PATH_CHECK], +[ + AC_ARG_WITH(check, + [ --with-check=PATH prefix where check is installed [default=auto]]) + + AC_ARG_WITH(checklibname, + AC_HELP_STRING([--with-check-lib-name=NAME], + [name of the PIC check library (default=check)])) + + min_check_version=ifelse([$1], ,0.8.2,$1) + + if test x$with_check = xno; then + AC_MSG_RESULT(disabled) + ifelse([$3], , AC_MSG_ERROR([disabling check is not supported]), [$3]) + else + if test "x$with_check" != x; then + CHECK_EXTRA_CFLAGS="-I$with_check/include" + CHECK_EXTRA_LIBS="-L$with_check/lib" + else + CHECK_EXTRA_CFLAGS="" + CHECK_EXTRA_LIBS="" + fi + + if test x$with_checklibname = x; then + _AM_TRY_CHECK($min_check_version, $CHECK_EXTRA_CFLAGS, $CHECK_EXTRA_LIBS, + check_pic, [have_check=true], [have_check=false]) + if test x$have_check = xtrue; then + ifelse([$2], , :, [$2]) + else + _AM_TRY_CHECK($min_check_version, $CHECK_EXTRA_CFLAGS, $CHECK_EXTRA_LIBS, + check, [have_check=true], [have_check=false]) + if test x$have_check = xtrue; then + ifelse([$2], , :, [$2]) + else + ifelse([$3], , AC_MSG_ERROR([check not found]), [$3]) + fi + fi + else + _AM_TRY_CHECK($min_check_version, $CHECK_EXTRA_CFLAGS, $CHECK_EXTRA_LIBS, + $with_checklibname, [have_check=true], [have_check=false]) + if test x$have_check = xtrue; then + ifelse([$2], , :, [$2]) + else + ifelse([$3], , AC_MSG_ERROR([check not found]), [$3]) + fi + fi + + AC_SUBST(CHECK_CFLAGS) + AC_SUBST(CHECK_LIBS) + rm -f conf.check-test + fi +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/glib-gettext.m4 gstreamer-vaapi-1.8.2/common/m4/glib-gettext.m4 --- gstreamer-vaapi-0.7.0/common/m4/glib-gettext.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/glib-gettext.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,432 @@ +# Copyright (C) 1995-2002 Free Software Foundation, Inc. +# Copyright (C) 2001-2003,2004 Red Hat, Inc. +# +# This file is free software, distributed under the terms of the GNU +# General Public License. As a special exception to the GNU General +# Public License, this file may be distributed as part of a program +# that contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# +# Macro to add for using GNU gettext. +# Ulrich Drepper , 1995, 1996 +# +# Modified to never use included libintl. +# Owen Taylor , 12/15/1998 +# +# Major rework to remove unused code +# Owen Taylor , 12/11/2002 +# +# Added better handling of ALL_LINGUAS from GNU gettext version +# written by Bruno Haible, Owen Taylor 5/30/3002 +# +# Modified to require ngettext +# Matthias Clasen 08/06/2004 +# +# We need this here as well, since someone might use autoconf-2.5x +# to configure GLib then an older version to configure a package +# using AM_GLIB_GNU_GETTEXT +AC_PREREQ(2.53) + +dnl +dnl We go to great lengths to make sure that aclocal won't +dnl try to pull in the installed version of these macros +dnl when running aclocal in the glib directory. +dnl +m4_copy([AC_DEFUN],[glib_DEFUN]) +m4_copy([AC_REQUIRE],[glib_REQUIRE]) +dnl +dnl At the end, if we're not within glib, we'll define the public +dnl definitions in terms of our private definitions. +dnl + +# GLIB_LC_MESSAGES +#-------------------- +glib_DEFUN([GLIB_LC_MESSAGES], + [AC_CHECK_HEADERS([locale.h]) + if test $ac_cv_header_locale_h = yes; then + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include ], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES, 1, + [Define if your file defines LC_MESSAGES.]) + fi + fi]) + +# GLIB_PATH_PROG_WITH_TEST +#---------------------------- +dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +glib_DEFUN([GLIB_PATH_PROG_WITH_TEST], +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + /*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in ifelse([$5], , $PATH, [$5]); do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) + +# GLIB_WITH_NLS +#----------------- +glib_DEFUN([GLIB_WITH_NLS], + dnl NLS is obligatory + [USE_NLS=yes + AC_SUBST(USE_NLS) + + gt_cv_have_gettext=no + + CATOBJEXT=NONE + XGETTEXT=: + INTLLIBS= + + AC_CHECK_HEADER(libintl.h, + [gt_cv_func_dgettext_libintl="no" + libintl_extra_libs="" + + # + # First check in libc + # + AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc, + [AC_TRY_LINK([ +#include +], + [return !ngettext ("","", 1)], + gt_cv_func_ngettext_libc=yes, + gt_cv_func_ngettext_libc=no) + ]) + + if test "$gt_cv_func_ngettext_libc" = "yes" ; then + AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc, + [AC_TRY_LINK([ +#include +], + [return !dgettext ("","")], + gt_cv_func_dgettext_libc=yes, + gt_cv_func_dgettext_libc=no) + ]) + fi + + if test "$gt_cv_func_ngettext_libc" = "yes" ; then + AC_CHECK_FUNCS(bind_textdomain_codeset) + fi + + # + # If we don't have everything we want, check in libintl + # + if test "$gt_cv_func_dgettext_libc" != "yes" \ + || test "$gt_cv_func_ngettext_libc" != "yes" \ + || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then + + AC_CHECK_LIB(intl, bindtextdomain, + [AC_CHECK_LIB(intl, ngettext, + [AC_CHECK_LIB(intl, dgettext, + gt_cv_func_dgettext_libintl=yes)])]) + + if test "$gt_cv_func_dgettext_libintl" != "yes" ; then + AC_MSG_CHECKING([if -liconv is needed to use gettext]) + AC_MSG_RESULT([]) + AC_CHECK_LIB(intl, ngettext, + [AC_CHECK_LIB(intl, dcgettext, + [gt_cv_func_dgettext_libintl=yes + libintl_extra_libs=-liconv], + :,-liconv)], + :,-liconv) + fi + + # + # If we found libintl, then check in it for bind_textdomain_codeset(); + # we'll prefer libc if neither have bind_textdomain_codeset(), + # and both have dgettext and ngettext + # + if test "$gt_cv_func_dgettext_libintl" = "yes" ; then + glib_save_LIBS="$LIBS" + LIBS="$LIBS -lintl $libintl_extra_libs" + unset ac_cv_func_bind_textdomain_codeset + AC_CHECK_FUNCS(bind_textdomain_codeset) + LIBS="$glib_save_LIBS" + + if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then + gt_cv_func_dgettext_libc=no + else + if test "$gt_cv_func_dgettext_libc" = "yes" \ + && test "$gt_cv_func_ngettext_libc" = "yes"; then + gt_cv_func_dgettext_libintl=no + fi + fi + fi + fi + + if test "$gt_cv_func_dgettext_libc" = "yes" \ + || test "$gt_cv_func_dgettext_libintl" = "yes"; then + gt_cv_have_gettext=yes + fi + + if test "$gt_cv_func_dgettext_libintl" = "yes"; then + INTLLIBS="-lintl $libintl_extra_libs" + fi + + if test "$gt_cv_have_gettext" = "yes"; then + AC_DEFINE(HAVE_GETTEXT,1, + [Define if the GNU gettext() function is already present or preinstalled.]) + GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl + if test "$MSGFMT" != "no"; then + glib_save_LIBS="$LIBS" + LIBS="$LIBS $INTLLIBS" + AC_CHECK_FUNCS(dcgettext) + MSGFMT_OPTS= + AC_MSG_CHECKING([if msgfmt accepts -c]) + GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: test 1.0\n" +"PO-Revision-Date: 2007-02-15 12:01+0100\n" +"Last-Translator: test \n" +"Language-Team: C \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) + AC_SUBST(MSGFMT_OPTS) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr], + [CATOBJEXT=.gmo + DATADIRNAME=share], + [case $host in + *-*-solaris*) + dnl On Solaris, if bind_textdomain_codeset is in libc, + dnl GNU format message catalog is always supported, + dnl since both are added to the libc all together. + dnl Hence, we'd like to go with DATADIRNAME=share and + dnl and CATOBJEXT=.gmo in this case. + AC_CHECK_FUNC(bind_textdomain_codeset, + [CATOBJEXT=.gmo + DATADIRNAME=share], + [CATOBJEXT=.mo + DATADIRNAME=lib]) + ;; + *) + CATOBJEXT=.mo + DATADIRNAME=lib + ;; + esac]) + LIBS="$glib_save_LIBS" + INSTOBJEXT=.mo + else + gt_cv_have_gettext=no + fi + fi + ]) + + if test "$gt_cv_have_gettext" = "yes" ; then + AC_DEFINE(ENABLE_NLS, 1, + [always defined to indicate that i18n is enabled]) + fi + + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is not GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + AC_MSG_RESULT( + [found xgettext program is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + fi + + # We need to process the po/ directory. + POSUB=po + + AC_OUTPUT_COMMANDS( + [case "$CONFIG_FILES" in *po/Makefile.in*) + sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile + esac]) + + dnl These rules are solely for the distribution goal. While doing this + dnl we only have to keep exactly one list of the available catalogs + dnl in configure.in. + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + dnl Make all variables we use known to autoconf. + AC_SUBST(CATALOGS) + AC_SUBST(CATOBJEXT) + AC_SUBST(DATADIRNAME) + AC_SUBST(GMOFILES) + AC_SUBST(INSTOBJEXT) + AC_SUBST(INTLLIBS) + AC_SUBST(PO_IN_DATADIR_TRUE) + AC_SUBST(PO_IN_DATADIR_FALSE) + AC_SUBST(POFILES) + AC_SUBST(POSUB) + ]) + +# AM_GLIB_GNU_GETTEXT +# ------------------- +# Do checks necessary for use of gettext. If a suitable implementation +# of gettext is found in either in libintl or in the C library, +# it will set INTLLIBS to the libraries needed for use of gettext +# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable +# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST() +# on various variables needed by the Makefile.in.in installed by +# glib-gettextize. +dnl +glib_DEFUN([GLIB_GNU_GETTEXT], + [AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + + GLIB_LC_MESSAGES + GLIB_WITH_NLS + + if test "$gt_cv_have_gettext" = "yes"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + AC_MSG_CHECKING(for catalogs to be installed) + NEW_LINGUAS= + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + NEW_LINGUAS="$NEW_LINGUAS $presentlang" + fi + done + LINGUAS=$NEW_LINGUAS + AC_MSG_RESULT($LINGUAS) + fi + + dnl Construct list of names of catalog files to be constructed. + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly + dnl find the mkinstalldirs script in another subdir but ($top_srcdir). + dnl Try to locate is. + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + AC_SUBST(MKINSTALLDIRS) + + dnl Generate list of files to be processed by xgettext which will + dnl be included in po/Makefile. + test -d po || mkdir po + if test "x$srcdir" != "x."; then + if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then + posrcprefix="$srcdir/" + else + posrcprefix="../$srcdir/" + fi + else + posrcprefix="../" + fi + rm -f po/POTFILES + sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ + < $srcdir/po/POTFILES.in > po/POTFILES + ]) + +# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE) +# ------------------------------- +# Define VARIABLE to the location where catalog files will +# be installed by po/Makefile. +glib_DEFUN([GLIB_DEFINE_LOCALEDIR], +[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl +glib_save_prefix="$prefix" +glib_save_exec_prefix="$exec_prefix" +glib_save_datarootdir="$datarootdir" +test "x$prefix" = xNONE && prefix=$ac_default_prefix +test "x$exec_prefix" = xNONE && exec_prefix=$prefix +datarootdir=`eval echo "${datarootdir}"` +if test "x$CATOBJEXT" = "x.mo" ; then + localedir=`eval echo "${libdir}/locale"` +else + localedir=`eval echo "${datadir}/locale"` +fi +prefix="$glib_save_prefix" +exec_prefix="$glib_save_exec_prefix" +datarootdir="$glib_save_datarootdir" +AC_DEFINE_UNQUOTED($1, "$localedir", + [Define the location where the catalogs will be installed]) +]) + +dnl +dnl Now the definitions that aclocal will find +dnl +ifdef(glib_configure_in,[],[ +AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)]) +AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)]) +])dnl + +# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL]) +# +# Create a temporary file with TEST-FILE as its contents and pass the +# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with +# 0 and perform ACTION-IF-FAIL for any other exit status. +AC_DEFUN([GLIB_RUN_PROG], +[cat >conftest.foo <<_ACEOF +$2 +_ACEOF +if AC_RUN_LOG([$1 conftest.foo]); then + m4_ifval([$3], [$3], [:]) +m4_ifvaln([$4], [else $4])dnl +echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD +sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD +fi]) + diff -Nru gstreamer-vaapi-0.7.0/common/m4/gst-arch.m4 gstreamer-vaapi-1.8.2/common/m4/gst-arch.m4 --- gstreamer-vaapi-0.7.0/common/m4/gst-arch.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gst-arch.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,147 @@ +dnl AG_GST_ARCH +dnl sets up defines and automake conditionals for host architecture +dnl checks endianness +dnl defines HOST_CPU + +AC_DEFUN([AG_GST_ARCH], +[ + dnl Determine CPU + case "x${target_cpu}" in + xi?86 | xk? | xi?86_64) + case $target_os in + solaris*) + AC_CHECK_DECL([__i386], [I386_ABI="yes"], [I386_ABI="no"]) + AC_CHECK_DECL([__amd64], [AMD64_ABI="yes"], [AMD64_ABI="no"]) + + if test "x$I386_ABI" = "xyes" ; then + HAVE_CPU_I386=yes + AC_DEFINE(HAVE_CPU_I386, 1, [Define if the target CPU is an x86]) + fi + if test "x$AMD64_ABI" = "xyes" ; then + HAVE_CPU_X86_64=yes + AC_DEFINE(HAVE_CPU_X86_64, 1, [Define if the target CPU is a x86_64]) + fi + ;; + *) + HAVE_CPU_I386=yes + AC_DEFINE(HAVE_CPU_I386, 1, [Define if the target CPU is an x86]) + + dnl FIXME could use some better detection + dnl (ie CPUID) + case "x${target_cpu}" in + xi386 | xi486) ;; + *) + AC_DEFINE(HAVE_RDTSC, 1, [Define if RDTSC is available]) ;; + esac + ;; + esac + ;; + xpowerpc) + HAVE_CPU_PPC=yes + AC_DEFINE(HAVE_CPU_PPC, 1, [Define if the target CPU is a PowerPC]) ;; + xpowerpc64) + HAVE_CPU_PPC64=yes + AC_DEFINE(HAVE_CPU_PPC64, 1, [Define if the target CPU is a 64 bit PowerPC]) ;; + xalpha*) + HAVE_CPU_ALPHA=yes + AC_DEFINE(HAVE_CPU_ALPHA, 1, [Define if the target CPU is an Alpha]) ;; + xarc*) + HAVE_CPU_ARC=yes + AC_DEFINE(HAVE_CPU_ARC, 1, [Define if the target CPU is an ARC]) ;; + xarm*) + HAVE_CPU_ARM=yes + AC_DEFINE(HAVE_CPU_ARM, 1, [Define if the target CPU is an ARM]) ;; + xaarch64*) + HAVE_CPU_AARCH64=yes + AC_DEFINE(HAVE_CPU_AARCH64, 1, [Define if the target CPU is AARCH64]) ;; + xsparc*) + HAVE_CPU_SPARC=yes + AC_DEFINE(HAVE_CPU_SPARC, 1, [Define if the target CPU is a SPARC]) ;; + xmips*) + HAVE_CPU_MIPS=yes + AC_DEFINE(HAVE_CPU_MIPS, 1, [Define if the target CPU is a MIPS]) ;; + xhppa*) + HAVE_CPU_HPPA=yes + AC_DEFINE(HAVE_CPU_HPPA, 1, [Define if the target CPU is a HPPA]) ;; + xs390*) + HAVE_CPU_S390=yes + AC_DEFINE(HAVE_CPU_S390, 1, [Define if the target CPU is a S390]) ;; + xia64*) + HAVE_CPU_IA64=yes + AC_DEFINE(HAVE_CPU_IA64, 1, [Define if the target CPU is a IA64]) ;; + xm68k*) + HAVE_CPU_M68K=yes + AC_DEFINE(HAVE_CPU_M68K, 1, [Define if the target CPU is a M68K]) ;; + xx86_64) + HAVE_CPU_X86_64=yes + AC_DEFINE(HAVE_CPU_X86_64, 1, [Define if the target CPU is a x86_64]) ;; + xcris) + HAVE_CPU_CRIS=yes + AC_DEFINE(HAVE_CPU_CRIS, 1, [Define if the target CPU is a CRIS]) ;; + xcrisv32) + HAVE_CPU_CRISV32=yes + AC_DEFINE(HAVE_CPU_CRISV32, 1, [Define if the target CPU is a CRISv32]) ;; + esac + + dnl Determine endianness + AC_C_BIGENDIAN + + AM_CONDITIONAL(HAVE_CPU_I386, test "x$HAVE_CPU_I386" = "xyes") + AM_CONDITIONAL(HAVE_CPU_PPC, test "x$HAVE_CPU_PPC" = "xyes") + AM_CONDITIONAL(HAVE_CPU_PPC64, test "x$HAVE_CPU_PPC64" = "xyes") + AM_CONDITIONAL(HAVE_CPU_ALPHA, test "x$HAVE_CPU_ALPHA" = "xyes") + AM_CONDITIONAL(HAVE_CPU_ARC, test "x$HAVE_CPU_ARC" = "xyes") + AM_CONDITIONAL(HAVE_CPU_ARM, test "x$HAVE_CPU_ARM" = "xyes") + AM_CONDITIONAL(HAVE_CPU_SPARC, test "x$HAVE_CPU_SPARC" = "xyes") + AM_CONDITIONAL(HAVE_CPU_HPPA, test "x$HAVE_CPU_HPPA" = "xyes") + AM_CONDITIONAL(HAVE_CPU_MIPS, test "x$HAVE_CPU_MIPS" = "xyes") + AM_CONDITIONAL(HAVE_CPU_S390, test "x$HAVE_CPU_S390" = "xyes") + AM_CONDITIONAL(HAVE_CPU_IA64, test "x$HAVE_CPU_IA64" = "xyes") + AM_CONDITIONAL(HAVE_CPU_M68K, test "x$HAVE_CPU_M68K" = "xyes") + AM_CONDITIONAL(HAVE_CPU_X86_64, test "x$HAVE_CPU_X86_64" = "xyes") + AM_CONDITIONAL(HAVE_CPU_CRIS, test "x$HAVE_CPU_CRIS" = "xyes") + AM_CONDITIONAL(HAVE_CPU_CRISV32, test "x$HAVE_CPU_CRISV32" = "xyes") + + AC_DEFINE_UNQUOTED(HOST_CPU, "$host_cpu", [the host CPU]) + AC_DEFINE_UNQUOTED(TARGET_CPU, "$target_cpu", [the target CPU]) +]) + +dnl check if unaligned memory access works correctly +AC_DEFUN([AG_GST_UNALIGNED_ACCESS], [ + AC_MSG_CHECKING([if unaligned memory access works correctly]) + if test x"$as_cv_unaligned_access" = x ; then + case $host in + alpha*|arc*|arm*|aarch64*|hp*|mips*|sh*|sparc*|ia64*) + _AS_ECHO_N([(blacklisted) ]) + as_cv_unaligned_access=no + ;; + i?86*|x86_64*|amd64*|powerpc*|m68k*|cris*) + _AS_ECHO_N([(whitelisted) ]) + as_cv_unaligned_access=yes + ;; + esac + else + _AS_ECHO_N([(cached) ]) + fi + if test x"$as_cv_unaligned_access" = x ; then + AC_TRY_RUN([ +int main(int argc, char **argv) +{ + char array[] = "ABCDEFGH"; + unsigned int iarray[2]; + memcpy(iarray,array,8); +#define GET(x) (*(unsigned int *)((char *)iarray + (x))) + if(GET(0) != 0x41424344 && GET(0) != 0x44434241) return 1; + if(GET(1) != 0x42434445 && GET(1) != 0x45444342) return 1; + if(GET(2) != 0x43444546 && GET(2) != 0x46454443) return 1; + if(GET(3) != 0x44454647 && GET(3) != 0x47464544) return 1; + return 0; +} + ], as_cv_unaligned_access="yes", as_cv_unaligned_access="no") + fi + AC_MSG_RESULT($as_cv_unaligned_access) + if test "$as_cv_unaligned_access" = "yes"; then + AC_DEFINE_UNQUOTED(HAVE_UNALIGNED_ACCESS, 1, + [defined if unaligned memory access works correctly]) + fi +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/gst-args.m4 gstreamer-vaapi-1.8.2/common/m4/gst-args.m4 --- gstreamer-vaapi-0.7.0/common/m4/gst-args.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gst-args.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,386 @@ +dnl configure-time options shared among gstreamer modules + +dnl AG_GST_ARG_DEBUG +dnl AG_GST_ARG_PROFILING +dnl AG_GST_ARG_VALGRIND +dnl AG_GST_ARG_GCOV + +dnl AG_GST_ARG_EXAMPLES + +dnl AG_GST_ARG_WITH_PKG_CONFIG_PATH +dnl AG_GST_ARG_WITH_PACKAGE_NAME +dnl AG_GST_ARG_WITH_PACKAGE_ORIGIN + +dnl AG_GST_ARG_WITH_PLUGINS +dnl AG_GST_CHECK_PLUGIN +dnl AG_GST_DISABLE_PLUGIN + +dnl AG_GST_ARG_ENABLE_EXTERNAL +dnl AG_GST_ARG_ENABLE_EXPERIMENTAL +dnl AG_GST_ARG_ENABLE_BROKEN + +dnl AG_GST_ARG_DISABLE_FATAL_WARNINGS +AC_DEFUN([AG_GST_ARG_DEBUG], +[ + dnl debugging stuff + AC_ARG_ENABLE(debug, + AC_HELP_STRING([--disable-debug],[disable addition of -g debugging info]), + [ + case "${enableval}" in + yes) USE_DEBUG=yes ;; + no) USE_DEBUG=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; + esac + ], + [USE_DEBUG=yes]) dnl Default value +]) + +AC_DEFUN([AG_GST_ARG_PROFILING], +[ + AC_ARG_ENABLE(profiling, + AC_HELP_STRING([--enable-profiling], + [adds -pg to compiler commandline, for profiling]), + [ + case "${enableval}" in + yes) USE_PROFILING=yes ;; + no) USE_PROFILING=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;; + esac + ], + [USE_PROFILING=no]) dnl Default value +]) + +AC_DEFUN([AG_GST_ARG_VALGRIND], +[ + dnl valgrind inclusion + AC_ARG_ENABLE(valgrind, + AC_HELP_STRING([--disable-valgrind],[disable run-time valgrind detection]), + [ + case "${enableval}" in + yes) USE_VALGRIND="$USE_DEBUG" ;; + no) USE_VALGRIND=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind) ;; + esac + ], + [USE_VALGRIND="$USE_DEBUG"]) dnl Default value + VALGRIND_REQ="3.0" + if test "x$USE_VALGRIND" = xyes; then + PKG_CHECK_MODULES(VALGRIND, valgrind >= $VALGRIND_REQ, + USE_VALGRIND="yes", + USE_VALGRIND="no") + fi + if test "x$USE_VALGRIND" = xyes; then + AC_DEFINE(HAVE_VALGRIND, 1, [Define if valgrind should be used]) + AC_MSG_NOTICE(Using extra code paths for valgrind) + fi +]) + +AC_DEFUN([AG_GST_ARG_GCOV], +[ + AC_ARG_ENABLE(gcov, + AC_HELP_STRING([--enable-gcov], + [compile with coverage profiling instrumentation (gcc only)]), + enable_gcov=$enableval, + enable_gcov=no) + if test x$enable_gcov = xyes ; then + if test "x$GCC" != "xyes" + then + AC_MSG_ERROR([gcov only works if gcc is used]) + fi + + AS_COMPILER_FLAG(["-fprofile-arcs"], + [GCOV_CFLAGS="$GCOV_CFLAGS -fprofile-arcs"], + true) + AS_COMPILER_FLAG(["-ftest-coverage"], + [GCOV_CFLAGS="$GCOV_CFLAGS -ftest-coverage"], + true) + dnl remove any -O flags - FIXME: is this needed ? + GCOV_CFLAGS=`echo "$GCOV_CFLAGS" | sed -e 's/-O[[0-9]]*//g'` + dnl libtool 1.5.22 and lower strip -fprofile-arcs from the flags + dnl passed to the linker, which is a bug; -fprofile-arcs implicitly + dnl links in -lgcov, so we do it explicitly here for the same effect + GCOV_LIBS=-lgcov + AC_SUBST(GCOV_CFLAGS) + AC_SUBST(GCOV_LIBS) + GCOV=`echo $CC | sed s/gcc/gcov/g` + AC_SUBST(GCOV) + + GST_GCOV_ENABLED=yes + AC_DEFINE_UNQUOTED(GST_GCOV_ENABLED, 1, + [Defined if gcov is enabled to force a rebuild due to config.h changing]) + dnl if gcov is used, we do not want default -O2 CFLAGS + if test "x$GST_GCOV_ENABLED" = "xyes" + then + CFLAGS="$CFLAGS -O0" + AC_SUBST(CFLAGS) + CXXFLAGS="$CXXFLAGS -O0" + AC_SUBST(CXXFLAGS) + FFLAGS="$FFLAGS -O0" + AC_SUBST(FFLAGS) + CCASFLAGS="$CCASFLAGS -O0" + AC_SUBST(CCASFLAGS) + AC_MSG_NOTICE([gcov enabled, setting CFLAGS and friends to $CFLAGS]) + fi + fi + AM_CONDITIONAL(GST_GCOV_ENABLED, test x$enable_gcov = xyes) +]) + +AC_DEFUN([AG_GST_ARG_EXAMPLES], +[ + AC_ARG_ENABLE(examples, + AC_HELP_STRING([--disable-examples], [disable building examples]), + [ + case "${enableval}" in + yes) BUILD_EXAMPLES=yes ;; + no) BUILD_EXAMPLES=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;; + esac + ], + [BUILD_EXAMPLES=yes]) dnl Default value + AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes") +]) + +AC_DEFUN([AG_GST_ARG_WITH_PKG_CONFIG_PATH], +[ + dnl possibly modify pkg-config path + AC_ARG_WITH(pkg-config-path, + AC_HELP_STRING([--with-pkg-config-path], + [colon-separated list of pkg-config(1) dirs]), + [ + export PKG_CONFIG_PATH=${withval} + AC_MSG_NOTICE(Set PKG_CONFIG_PATH to $PKG_CONFIG_PATH) + ]) +]) + + +dnl This macro requires that GST_GIT or GST_CVS is set to yes or no (release) +AC_DEFUN([AG_GST_ARG_WITH_PACKAGE_NAME], +[ + dnl package name in plugins + AC_ARG_WITH(package-name, + AC_HELP_STRING([--with-package-name], + [specify package name to use in plugins]), + [ + case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;; + *) GST_PACKAGE_NAME="${withval}" ;; + esac + ], + [ + P=$1 + if test "x$P" = "x" + then + P=$PACKAGE_NAME + fi + + if test "x$PACKAGE_VERSION_NANO" = "x0" + then + GST_PACKAGE_NAME="$P source release" + else + if test "x$PACKAGE_VERSION_NANO" = "x1" + then + GST_PACKAGE_NAME="$P git" + else + GST_PACKAGE_NAME="$P prerelease" + fi + fi + ] + ) + AC_MSG_NOTICE(Using $GST_PACKAGE_NAME as package name) + AC_DEFINE_UNQUOTED(GST_PACKAGE_NAME, "$GST_PACKAGE_NAME", + [package name in plugins]) + AC_SUBST(GST_PACKAGE_NAME) +]) + +AC_DEFUN([AG_GST_ARG_WITH_PACKAGE_ORIGIN], +[ + dnl package origin URL + AC_ARG_WITH(package-origin, + AC_HELP_STRING([--with-package-origin], + [specify package origin URL to use in plugins]), + [ + case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;; + *) GST_PACKAGE_ORIGIN="${withval}" ;; + esac + ], + [GST_PACKAGE_ORIGIN="[Unknown package origin]"] dnl Default value + ) + AC_MSG_NOTICE(Using $GST_PACKAGE_ORIGIN as package origin) + AC_DEFINE_UNQUOTED(GST_PACKAGE_ORIGIN, "$GST_PACKAGE_ORIGIN", + [package origin]) + AC_SUBST(GST_PACKAGE_ORIGIN) +]) + +dnl sets WITH_PLUGINS to the list of plug-ins given as an argument +dnl also clears GST_PLUGINS_ALL and GST_PLUGINS_SELECTED +AC_DEFUN([AG_GST_ARG_WITH_PLUGINS], +[ + AC_ARG_WITH(plugins, + AC_HELP_STRING([--with-plugins], + [comma-separated list of dependencyless plug-ins to compile]), + [WITH_PLUGINS=$withval], + [WITH_PLUGINS=]) + + GST_PLUGINS_ALL="" + GST_PLUGINS_SELECTED="" + GST_PLUGINS_NONPORTED="" + + AC_SUBST(GST_PLUGINS_ALL) + AC_SUBST(GST_PLUGINS_SELECTED) + AC_SUBST(GST_PLUGINS_NONPORTED) +]) + +dnl AG_GST_CHECK_PLUGIN(PLUGIN-NAME) +dnl +dnl This macro adds the plug-in to GST_PLUGINS_ALL. Then it +dnl checks if WITH_PLUGINS is empty or the plugin is present in WITH_PLUGINS, +dnl and if so adds it to GST_PLUGINS_SELECTED. Then it checks if the plugin +dnl is present in WITHOUT_PLUGINS (ie. was disabled specifically) and if so +dnl removes it from GST_PLUGINS_SELECTED. +dnl +dnl The macro will call AM_CONDITIONAL(USE_PLUGIN_, ...) to allow +dnl control of what is built in Makefile.ams. +AC_DEFUN([AG_GST_CHECK_PLUGIN], +[ + GST_PLUGINS_ALL="$GST_PLUGINS_ALL [$1]" + + define([pname_def],translit([$1], -a-z, _a-z)) + + AC_ARG_ENABLE([$1], + AC_HELP_STRING([--disable-[$1]], [disable dependency-less $1 plugin]), + [ + case "${enableval}" in + yes) [gst_use_]pname_def=yes ;; + no) [gst_use_]pname_def=no ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-$1]) ;; + esac + ], + [[gst_use_]pname_def=yes]) dnl Default value + + if test x$[gst_use_]pname_def = xno; then + AC_MSG_NOTICE(disabling dependency-less plugin $1) + WITHOUT_PLUGINS="$WITHOUT_PLUGINS [$1]" + fi + undefine([pname_def]) + + dnl First check inclusion + if [[ -z "$WITH_PLUGINS" ]] || echo " [$WITH_PLUGINS] " | tr , ' ' | grep -i " [$1] " > /dev/null; then + GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED [$1]" + fi + dnl Then check exclusion + if echo " [$WITHOUT_PLUGINS] " | tr , ' ' | grep -i " [$1] " > /dev/null; then + GST_PLUGINS_SELECTED=`echo " $GST_PLUGINS_SELECTED " | $SED -e 's/ [$1] / /'` + fi + dnl Finally check if the plugin is ported or not + if echo " [$GST_PLUGINS_NONPORTED] " | tr , ' ' | grep -i " [$1] " > /dev/null; then + GST_PLUGINS_SELECTED=`echo " $GST_PLUGINS_SELECTED " | $SED -e 's/ [$1] / /'` + fi + AM_CONDITIONAL([USE_PLUGIN_]translit([$1], a-z, A-Z), echo " $GST_PLUGINS_SELECTED " | grep -i " [$1] " > /dev/null) +]) + +dnl AG_GST_DISABLE_PLUGIN(PLUGIN-NAME) +dnl +dnl This macro disables the plug-in by removing it from +dnl GST_PLUGINS_SELECTED. +AC_DEFUN([AG_GST_DISABLE_PLUGIN], +[ + GST_PLUGINS_SELECTED=`echo " $GST_PLUGINS_SELECTED " | $SED -e 's/ [$1] / /'` + AM_CONDITIONAL([USE_PLUGIN_]translit([$1], a-z, A-Z), false) +]) + +AC_DEFUN([AG_GST_ARG_ENABLE_EXTERNAL], +[ + AG_GST_CHECK_FEATURE(EXTERNAL, [building of plug-ins with external deps],, + HAVE_EXTERNAL=yes, enabled, + [ + AC_MSG_NOTICE(building external plug-ins) + BUILD_EXTERNAL="yes" + ],[ + AC_MSG_WARN(all plug-ins with external dependencies will not be built) + BUILD_EXTERNAL="no" + ]) + # make BUILD_EXTERNAL available to Makefile.am + AM_CONDITIONAL(BUILD_EXTERNAL, test "x$BUILD_EXTERNAL" = "xyes") +]) + +dnl experimental plug-ins; stuff that hasn't had the dust settle yet +dnl read 'builds, but might not work' +AC_DEFUN([AG_GST_ARG_ENABLE_EXPERIMENTAL], +[ + AG_GST_CHECK_FEATURE(EXPERIMENTAL, [building of experimental plug-ins],, + HAVE_EXPERIMENTAL=yes, disabled, + [ + AC_MSG_WARN(building experimental plug-ins) + BUILD_EXPERIMENTAL="yes" + ],[ + AC_MSG_NOTICE(not building experimental plug-ins) + BUILD_EXPERIMENTAL="no" + ]) + # make BUILD_EXPERIMENTAL available to Makefile.am + AM_CONDITIONAL(BUILD_EXPERIMENTAL, test "x$BUILD_EXPERIMENTAL" = "xyes") +]) + +dnl broken plug-ins; stuff that doesn't seem to build at the moment +AC_DEFUN([AG_GST_ARG_ENABLE_BROKEN], +[ + AG_GST_CHECK_FEATURE(BROKEN, [building of broken plug-ins],, + HAVE_BROKEN=yes, disabled, + [ + AC_MSG_WARN([building broken plug-ins -- no bug reports on these, only patches ...]) + ],[ + AC_MSG_NOTICE([not building broken plug-ins]) + ]) +]) + +dnl allow people (or build tools) to override default behaviour +dnl for fatal compiler warnings +dnl Enable fatal warnings by default only for development versions +AC_DEFUN([AG_GST_ARG_DISABLE_FATAL_WARNINGS], +[ + AC_ARG_ENABLE(fatal-warnings, + AC_HELP_STRING([--disable-fatal-warnings], + [Don't turn compiler warnings into fatal errors]), + [ + case "${enableval}" in + yes) FATAL_WARNINGS=yes ;; + no) FATAL_WARNINGS=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-fatal-warnings) ;; + esac + ], + [ + if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then + FATAL_WARNINGS=yes + else + FATAL_WARNINGS=no + fi + ]) +]) + +dnl Enable extra checks by default only for development versions +AC_DEFUN([AG_GST_ARG_ENABLE_EXTRA_CHECKS], +[ + AC_ARG_ENABLE(extra-check, + AC_HELP_STRING([--enable-extra-checks], + [Enable extra runtime checks]), + [ + case "${enableval}" in + yes) EXTRA_CHECKS=yes ;; + no) EXTRA_CHECKS=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-extra-checks) ;; + esac + ], + [ + if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then + EXTRA_CHECKS=yes + else + EXTRA_CHECKS=no + fi + ]) + + if test "x$EXTRA_CHECKS" = "xyes"; then + AC_DEFINE(GST_ENABLE_EXTRA_CHECKS, 1, [Define if extra runtime checks should be enabled]) + fi +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/gst-check.m4 gstreamer-vaapi-1.8.2/common/m4/gst-check.m4 --- gstreamer-vaapi-0.7.0/common/m4/gst-check.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gst-check.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,294 @@ +dnl pkg-config-based checks for GStreamer modules and dependency modules + +dnl generic: +dnl AG_GST_PKG_CHECK_MODULES([PREFIX], [WHICH], [REQUIRED]) +dnl sets HAVE_[$PREFIX], [$PREFIX]_* +dnl AG_GST_CHECK_MODULES([PREFIX], [MODULE], [MINVER], [NAME], [REQUIRED]) +dnl sets HAVE_[$PREFIX], [$PREFIX]_* + +dnl specific: +dnl AG_GST_CHECK_GST([MAJMIN], [MINVER], [REQUIRED]) +dnl also sets/ACSUBSTs GST_TOOLS_DIR and GST_PLUGINS_DIR +dnl AG_GST_CHECK_GST_BASE([MAJMIN], [MINVER], [REQUIRED]) +dnl AG_GST_CHECK_GST_CONTROLLER([MAJMIN], [MINVER], [REQUIRED]) +dnl AG_GST_CHECK_GST_NET([MAJMIN], [MINVER], [REQUIRED]) +dnl AG_GST_CHECK_GST_CHECK([MAJMIN], [MINVER], [REQUIRED]) +dnl AG_GST_CHECK_GST_PLUGINS_BASE([MAJMIN], [MINVER], [REQUIRED]) +dnl also sets/ACSUBSTs GSTPB_PLUGINS_DIR + +AC_DEFUN([AG_GST_PKG_CHECK_MODULES], +[ + which="[$2]" + dnl not required by default, since we use this mostly for plugin deps + required=ifelse([$3], , "no", [$3]) + + PKG_CHECK_MODULES([$1], $which, + [ + HAVE_[$1]="yes" + ], + [ + HAVE_[$1]="no" + if test "x$required" = "xyes"; then + AC_MSG_ERROR($[$1]_PKG_ERRORS) + else + AC_MSG_NOTICE($[$1]_PKG_ERRORS) + fi + ]) + + dnl AC_SUBST of CFLAGS and LIBS was not done before automake 1.7 + dnl It gets done automatically in automake >= 1.7, which we now require +])) + +AC_DEFUN([AG_GST_CHECK_MODULES], +[ + module=[$2] + minver=[$3] + name="[$4]" + required=ifelse([$5], , "yes", [$5]) dnl required by default + + PKG_CHECK_MODULES([$1], $module >= $minver, + [ + HAVE_[$1]="yes" + ], + [ + HAVE_[$1]="no" + AC_MSG_NOTICE($[$1]_PKG_ERRORS) + if test "x$required" = "xyes"; then + AC_MSG_ERROR([no $module >= $minver ($name) found]) + else + AC_MSG_NOTICE([no $module >= $minver ($name) found]) + fi + ]) + + dnl AC_SUBST of CFLAGS and LIBS was not done before automake 1.7 + dnl It gets done automatically in automake >= 1.7, which we now require +])) + +AC_DEFUN([AG_GST_CHECK_GST], +[ + AG_GST_CHECK_MODULES(GST, gstreamer-[$1], [$2], [GStreamer], [$3]) + dnl allow setting before calling this macro to override + if test -z $GST_TOOLS_DIR; then + GST_TOOLS_DIR=`$PKG_CONFIG --variable=toolsdir gstreamer-[$1]` + if test -z $GST_TOOLS_DIR; then + AC_MSG_ERROR( + [no tools dir set in GStreamer pkg-config file, core upgrade needed.]) + fi + fi + AC_MSG_NOTICE([using GStreamer tools in $GST_TOOLS_DIR]) + AC_SUBST(GST_TOOLS_DIR) + + dnl check for where core plug-ins got installed + dnl this is used for unit tests + dnl allow setting before calling this macro to override + if test -z $GST_PLUGINS_DIR; then + GST_PLUGINS_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-[$1]` + if test -z $GST_PLUGINS_DIR; then + AC_MSG_ERROR( + [no pluginsdir set in GStreamer pkg-config file, core upgrade needed.]) + fi + fi + AC_MSG_NOTICE([using GStreamer plug-ins in $GST_PLUGINS_DIR]) + AC_SUBST(GST_PLUGINS_DIR) +]) + +AC_DEFUN([AG_GST_CHECK_GST_BASE], +[ + AG_GST_CHECK_MODULES(GST_BASE, gstreamer-base-[$1], [$2], + [GStreamer Base Libraries], [$3]) +]) + +AC_DEFUN([AG_GST_CHECK_GST_CONTROLLER], +[ + AG_GST_CHECK_MODULES(GST_CONTROLLER, gstreamer-controller-[$1], [$2], + [GStreamer Controller Library], [$3]) +]) + +AC_DEFUN([AG_GST_CHECK_GST_NET], +[ + AG_GST_CHECK_MODULES(GST_NET, gstreamer-net-[$1], [$2], + [GStreamer Network Library], [$3]) +]) + +AC_DEFUN([AG_GST_CHECK_GST_CHECK], +[ + AG_GST_CHECK_MODULES(GST_CHECK, gstreamer-check-[$1], [$2], + [GStreamer Check unittest Library], [$3]) +]) + +dnl =========================================================================== +dnl AG_GST_CHECK_UNINSTALLED_SETUP([ACTION-IF-UNINSTALLED], [ACTION-IF-NOT]) +dnl +dnl ACTION-IF-UNINSTALLED (optional) extra actions to perform if the setup +dnl is an uninstalled setup +dnl ACTION-IF-NOT (optional) extra actions to perform if the setup +dnl is not an uninstalled setup +dnl =========================================================================== +AC_DEFUN([AG_GST_CHECK_UNINSTALLED_SETUP], +[ + AC_MSG_CHECKING([whether this is an uninstalled GStreamer setup]) + AC_CACHE_VAL(gst_cv_is_uninstalled_setup,[ + gst_cv_is_uninstalled_setup=no + if (set -u; : $GST_PLUGIN_SYSTEM_PATH) 2>/dev/null ; then + if test -z "$GST_PLUGIN_SYSTEM_PATH" \ + -a -n "$GST_PLUGIN_SCANNER" \ + -a -n "$GST_PLUGIN_PATH" \ + -a -n "$GST_REGISTRY" \ + -a -n "$DYLD_LIBRARY_PATH" \ + -a -n "$LD_LIBRARY_PATH"; then + gst_cv_is_uninstalled_setup=yes; + fi + fi + ]) + AC_MSG_RESULT($gst_cv_is_uninstalled_setup) + if test "x$gst_cv_is_uninstalled_setup" = "xyes"; then + ifelse([$1], , :, [$1]) + else + ifelse([$2], , :, [$2]) + fi +]) + +dnl =========================================================================== +dnl AG_GST_CHECK_GST_PLUGINS_BASE([GST-API_VERSION], [MIN-VERSION], [REQUIRED]) +dnl +dnl Sets GST_PLUGINS_BASE_CFLAGS and GST_PLUGINS_BASE_LIBS. +dnl +dnl Also sets GSTPB_PLUGINS_DIR (and for consistency also GST_PLUGINS_BASE_DIR) +dnl for use in Makefile.am. This is only really needed/useful in uninstalled +dnl setups, since in an installed setup all plugins will be found in +dnl GST_PLUGINS_DIR anyway. +dnl =========================================================================== +AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_BASE], +[ + AG_GST_CHECK_MODULES(GST_PLUGINS_BASE, gstreamer-plugins-base-[$1], [$2], + [GStreamer Base Plugins], [$3]) + + if test "x$HAVE_GST_PLUGINS_BASE" = "xyes"; then + dnl check for where base plugins got installed + dnl this is used for unit tests + dnl allow setting before calling this macro to override + if test -z $GSTPB_PLUGINS_DIR; then + GSTPB_PLUGINS_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-base-[$1]` + if test -z $GSTPB_PLUGINS_DIR; then + AC_MSG_ERROR( + [no pluginsdir set in GStreamer Base Plugins pkg-config file]) + fi + fi + AC_MSG_NOTICE([using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR]) + GST_PLUGINS_BASE_DIR="$GSTPB_PLUGINS_DIR/gst:$GSTPB_PLUGINS_DIR/sys:$GSTPB_PLUGINS_DIR/ext" + AC_SUBST(GST_PLUGINS_BASE_DIR) + AC_SUBST(GSTPB_PLUGINS_DIR) + fi +]) + +dnl =========================================================================== +dnl AG_GST_CHECK_GST_PLUGINS_GOOD([GST-API_VERSION], [MIN-VERSION]) +dnl +dnl Will set GST_PLUGINS_GOOD_DIR for use in Makefile.am. Note that this will +dnl only be set in an uninstalled setup, since -good ships no .pc file and in +dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway. +dnl =========================================================================== +AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_GOOD], +[ + AG_GST_CHECK_MODULES(GST_PLUGINS_GOOD, gstreamer-plugins-good-[$1], [$2], + [GStreamer Good Plugins], [no]) + + if test "x$HAVE_GST_PLUGINS_GOOD" = "xyes"; then + dnl check for where good plugins got installed + dnl this is used for unit tests + dnl allow setting before calling this macro to override + if test -z $GST_PLUGINS_GOOD_DIR; then + GST_PLUGINS_GOOD_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-good-[$1]` + if test -z $GST_PLUGINS_GOOD_DIR; then + AC_MSG_ERROR([no pluginsdir set in GStreamer Good Plugins pkg-config file]) + fi + fi + AC_MSG_NOTICE([using GStreamer Good Plugins in $GST_PLUGINS_GOOD_DIR]) + GST_PLUGINS_GOOD_DIR="$GST_PLUGINS_GOOD_DIR/gst:$GST_PLUGINS_GOOD_DIR/sys:$GST_PLUGINS_GOOD_DIR/ext" + AC_SUBST(GST_PLUGINS_GOOD_DIR) + fi +]) + +dnl =========================================================================== +dnl AG_GST_CHECK_GST_PLUGINS_UGLY([GST-API_VERSION], [MIN-VERSION]) +dnl +dnl Will set GST_PLUGINS_UGLY_DIR for use in Makefile.am. Note that this will +dnl only be set in an uninstalled setup, since -bad ships no .pc file and in +dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway. +dnl =========================================================================== +AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_UGLY], +[ + AG_GST_CHECK_MODULES(GST_PLUGINS_UGLY, gstreamer-plugins-ugly-[$1], [$2], + [GStreamer Ugly Plugins], [no]) + + if test "x$HAVE_GST_PLUGINS_UGLY" = "xyes"; then + dnl check for where ugly plugins got installed + dnl this is used for unit tests + dnl allow setting before calling this macro to override + if test -z $GST_PLUGINS_UGLY_DIR; then + GST_PLUGINS_UGLY_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-ugly-[$1]` + if test -z $GST_PLUGINS_UGLY_DIR; then + AC_MSG_ERROR([no pluginsdir set in GStreamer Ugly Plugins pkg-config file]) + fi + fi + AC_MSG_NOTICE([using GStreamer Ugly Plugins in $GST_PLUGINS_UGLY_DIR]) + GST_PLUGINS_UGLY_DIR="$GST_PLUGINS_UGLY_DIR/gst:$GST_PLUGINS_UGLY_DIR/sys:$GST_PLUGINS_UGLY_DIR/ext" + AC_SUBST(GST_PLUGINS_UGLY_DIR) + fi +]) + +dnl =========================================================================== +dnl AG_GST_CHECK_GST_PLUGINS_BAD([GST-API_VERSION], [MIN-VERSION]) +dnl +dnl Will set GST_PLUGINS_BAD_DIR for use in Makefile.am. Note that this will +dnl only be set in an uninstalled setup, since -ugly ships no .pc file and in +dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway. +dnl =========================================================================== +AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_BAD], +[ + AG_GST_CHECK_MODULES(GST_PLUGINS_BAD, gstreamer-plugins-bad-[$1], [$2], + [GStreamer Bad Plugins], [no]) + + if test "x$HAVE_GST_PLUGINS_BAD" = "xyes"; then + dnl check for where bad plugins got installed + dnl this is used for unit tests + dnl allow setting before calling this macro to override + if test -z $GST_PLUGINS_BAD_DIR; then + GST_PLUGINS_BAD_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-bad-[$1]` + if test -z $GST_PLUGINS_BAD_DIR; then + AC_MSG_ERROR([no pluginsdir set in GStreamer Bad Plugins pkg-config file]) + fi + fi + AC_MSG_NOTICE([using GStreamer Bad Plugins in $GST_PLUGINS_BAD_DIR]) + GST_PLUGINS_BAD_DIR="$GST_PLUGINS_BAD_DIR/gst:$GST_PLUGINS_BAD_DIR/sys:$GST_PLUGINS_BAD_DIR/ext" + AC_SUBST(GST_PLUGINS_BAD_DIR) + fi +]) + +dnl =========================================================================== +dnl AG_GST_CHECK_GST_PLUGINS_LIBAV([GST-API_VERSION], [MIN-VERSION]) +dnl +dnl Will set GST_PLUGINS_LIBAV_DIR for use in Makefile.am. Note that this will +dnl only be set in an uninstalled setup, since -libav ships no .pc file and in +dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway. +dnl =========================================================================== +AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_LIBAV], +[ + AG_GST_CHECK_MODULES(GST_PLUGINS_LIBAV, gstreamer-plugins-libav-[$1], [$2], + [GStreamer Libav Plugins], [no]) + + if test "x$HAVE_GST_PLUGINS_LIBAV" = "xyes"; then + dnl check for where libav plugins got installed + dnl this is used for unit tests + dnl allow setting before calling this macro to override + if test -z $GST_PLUGINS_LIBAV_DIR; then + GST_PLUGINS_LIBAV_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-libav-[$1]` + if test -z $GST_PLUGINS_LIBAV_DIR; then + AC_MSG_ERROR([no pluginsdir set in GStreamer Libav Plugins pkg-config file]) + fi + fi + GST_PLUGINS_LIBAV_DIR="$GST_PLUGINS_LIBAV_DIR/ext/libav" + AC_MSG_NOTICE([using GStreamer Libav Plugins in $GST_PLUGINS_LIBAV_DIR]) + AC_SUBST(GST_PLUGINS_LIBAV_DIR) + fi +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/gst-debuginfo.m4 gstreamer-vaapi-1.8.2/common/m4/gst-debuginfo.m4 --- gstreamer-vaapi-0.7.0/common/m4/gst-debuginfo.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gst-debuginfo.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,46 @@ +AC_DEFUN([AG_GST_DEBUGINFO], [ +AC_ARG_ENABLE(debug, +AC_HELP_STRING([--disable-debug],[disable addition of -g debugging info]), +[case "${enableval}" in + yes) USE_DEBUG=yes ;; + no) USE_DEBUG=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; +esac], +[USE_DEBUG=yes]) dnl Default value + +AC_ARG_ENABLE(DEBUG, +AC_HELP_STRING([--disable-DEBUG],[disables compilation of debugging messages]), +[case "${enableval}" in + yes) ENABLE_DEBUG=yes ;; + no) ENABLE_DEBUG=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-DEBUG) ;; +esac], +[ENABLE_DEBUG=yes]) dnl Default value +if test x$ENABLE_DEBUG = xyes; then + AC_DEFINE(GST_DEBUG_ENABLED, 1, [Define if DEBUG statements should be compiled in]) +fi + +AC_ARG_ENABLE(INFO, +AC_HELP_STRING([--disable-INFO],[disables compilation of informational messages]), +[case "${enableval}" in + yes) ENABLE_INFO=yes ;; + no) ENABLE_INFO=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-INFO) ;; +esac], +[ENABLE_INFO=yes]) dnl Default value +if test x$ENABLE_INFO = xyes; then + AC_DEFINE(GST_INFO_ENABLED, 1, [Define if INFO statements should be compiled in]) +fi + +AC_ARG_ENABLE(debug-color, +AC_HELP_STRING([--disable-debug-color],[disables color output of DEBUG and INFO output]), +[case "${enableval}" in + yes) ENABLE_DEBUG_COLOR=yes ;; + no) ENABLE_DEBUG_COLOR=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug-color) ;; +esac], +[ENABLE_DEBUG_COLOR=yes]) dnl Default value +if test "x$ENABLE_DEBUG_COLOR" = xyes; then + AC_DEFINE(GST_DEBUG_COLOR, 1, [Define if debugging messages should be colorized]) +fi +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/gst-default.m4 gstreamer-vaapi-1.8.2/common/m4/gst-default.m4 --- gstreamer-vaapi-0.7.0/common/m4/gst-default.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gst-default.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,120 @@ +dnl default elements used for tests and such + +dnl AG_GST_DEFAULT_ELEMENTS + +AC_DEFUN([AG_GST_DEFAULT_ELEMENTS], +[ + dnl decide on default elements + dnl FIXME: describe where exactly this gets used + dnl FIXME: decide if it's a problem that this could point to sinks from + dnl depending plugin modules + dnl FIXME: when can we just use autoaudiosrc and autovideosrc? + DEFAULT_AUDIOSINK="autoaudiosink" + DEFAULT_VIDEOSINK="autovideosink" + DEFAULT_AUDIOSRC="alsasrc" + DEFAULT_VIDEOSRC="v4l2src" + DEFAULT_VISUALIZER="goom" + case "$host" in + *-sun-* | *pc-solaris* ) + DEFAULT_AUDIOSRC="sunaudiosrc" + ;; + *-darwin* ) + DEFAULT_AUDIOSRC="osxaudiosrc" + ;; + esac + + dnl Default audio sink + AC_ARG_WITH(default-audiosink, + AC_HELP_STRING([--with-default-audiosink], [specify default audio sink]), + [ + case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-default-audiosink) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-default-audiosink) ;; + *) DEFAULT_AUDIOSINK="${withval}" ;; + esac + ], + [ + DEFAULT_AUDIOSINK="$DEFAULT_AUDIOSINK" + ] dnl Default value as determined above + ) + AC_MSG_NOTICE(Using $DEFAULT_AUDIOSINK as default audio sink) + AC_SUBST(DEFAULT_AUDIOSINK) + AC_DEFINE_UNQUOTED(DEFAULT_AUDIOSINK, "$DEFAULT_AUDIOSINK", + [Default audio sink]) + + dnl Default audio source + AC_ARG_WITH(default-audiosrc, + AC_HELP_STRING([--with-default-audiosrc], [specify default audio source]), + [ + case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-default-audiosrc) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-default-audiosrc) ;; + *) DEFAULT_AUDIOSRC="${withval}" ;; + esac + ], + [ + DEFAULT_AUDIOSRC="$DEFAULT_AUDIOSRC" + ] dnl Default value as determined above + ) + AC_MSG_NOTICE(Using $DEFAULT_AUDIOSRC as default audio source) + AC_SUBST(DEFAULT_AUDIOSRC) + AC_DEFINE_UNQUOTED(DEFAULT_AUDIOSRC, "$DEFAULT_AUDIOSRC", + [Default audio source]) + + dnl Default video sink + AC_ARG_WITH(default-videosink, + AC_HELP_STRING([--with-default-videosink], [specify default video sink]), + [ + case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-default-videosink) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-default-videosink) ;; + *) DEFAULT_VIDEOSINK="${withval}" ;; + esac + ], + [ + DEFAULT_VIDEOSINK="$DEFAULT_VIDEOSINK" + ] dnl Default value as determined above + ) + AC_MSG_NOTICE(Using $DEFAULT_VIDEOSINK as default video sink) + AC_SUBST(DEFAULT_VIDEOSINK) + AC_DEFINE_UNQUOTED(DEFAULT_VIDEOSINK, "$DEFAULT_VIDEOSINK", + [Default video sink]) + + dnl Default video source + AC_ARG_WITH(default-videosrc, + AC_HELP_STRING([--with-default-videosrc], [specify default video source]), + [ + case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-default-videosrc) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-default-videosrc) ;; + *) DEFAULT_VIDEOSRC="${withval}" ;; + esac + ], + [ + DEFAULT_VIDEOSRC="$DEFAULT_VIDEOSRC" + ] dnl Default value as determined above + ) + AC_MSG_NOTICE(Using $DEFAULT_VIDEOSRC as default video source) + AC_SUBST(DEFAULT_VIDEOSRC) + AC_DEFINE_UNQUOTED(DEFAULT_VIDEOSRC, "$DEFAULT_VIDEOSRC", + [Default video source]) + + dnl Default visualizer + AC_ARG_WITH(default-visualizer, + AC_HELP_STRING([--with-default-visualizer], [specify default visualizer]), + [ + case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-default-visualizer) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-default-visualizer) ;; + *) DEFAULT_VISUALIZER="${withval}" ;; + esac + ], + [ + DEFAULT_VISUALIZER="$DEFAULT_VISUALIZER" + ] dnl Default value as determined above + ) + AC_MSG_NOTICE(Using $DEFAULT_VISUALIZER as default visualizer) + AC_SUBST(DEFAULT_VISUALIZER) + AC_DEFINE_UNQUOTED(DEFAULT_VISUALIZER, "$DEFAULT_VISUALIZER", + [Default visualizer]) +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/gst-doc.m4 gstreamer-vaapi-1.8.2/common/m4/gst-doc.m4 --- gstreamer-vaapi-0.7.0/common/m4/gst-doc.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gst-doc.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,92 @@ +AC_DEFUN([AG_GST_DOCBOOK_CHECK], +[ + dnl choose a location to install docbook docs in + if test "x$PACKAGE_TARNAME" = "x" + then + AC_MSG_ERROR([Internal error - PACKAGE_TARNAME not set]) + fi + docdir="\$(datadir)/doc/$PACKAGE_TARNAME-$GST_API_VERSION" + + dnl enable/disable docbook documentation building + AC_ARG_ENABLE(docbook, + AC_HELP_STRING([--enable-docbook], + [use docbook to build documentation [default=no]]),, + enable_docbook=no) + + have_docbook=no + + if test x$enable_docbook = xyes; then + dnl check if we actually have everything we need + + dnl check for docbook tools + AC_CHECK_PROG(HAVE_DOCBOOK2PS, docbook2ps, yes, no) + AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, yes, no) + AC_CHECK_PROG(HAVE_JADETEX, jadetex, yes, no) + AC_CHECK_PROG(HAVE_PS2PDF, ps2pdf, yes, no) + + dnl check if we can process docbook stuff + AS_DOCBOOK(have_docbook=yes, have_docbook=no) + + dnl check for extra tools + AC_CHECK_PROG(HAVE_DVIPS, dvips, yes, no) + AC_CHECK_PROG(HAVE_XMLLINT, xmllint, yes, no) + + AC_CHECK_PROG(HAVE_PNGTOPNM, pngtopnm, yes, no) + AC_CHECK_PROG(HAVE_PNMTOPS, pnmtops, yes, no) + AC_CHECK_PROG(HAVE_EPSTOPDF, epstopdf, yes, no) + + dnl check if we can generate HTML + if test "x$HAVE_XSLTPROC" = "xyes" && \ + test "x$enable_docbook" = "xyes" && \ + test "x$HAVE_XMLLINT" = "xyes"; then + DOC_HTML=yes + AC_MSG_NOTICE(Will output HTML documentation) + else + DOC_HTML=no + AC_MSG_NOTICE(Will not output HTML documentation) + fi + + dnl check if we can generate PS + if test "x$HAVE_DOCBOOK2PS" = "xyes" && \ + test "x$enable_docbook" = "xyes" && \ + test "x$HAVE_XMLLINT" = "xyes" && \ + test "x$HAVE_JADETEX" = "xyes" && \ + test "x$HAVE_DVIPS" = "xyes" && \ + test "x$HAVE_PNGTOPNM" = "xyes" && \ + test "x$HAVE_PNMTOPS" = "xyes"; then + DOC_PS=yes + AC_MSG_NOTICE(Will output PS documentation) + else + DOC_PS=no + AC_MSG_NOTICE(Will not output PS documentation) + fi + + dnl check if we can generate PDF - using only ps2pdf + if test "x$DOC_PS" = "xyes" && \ + test "x$enable_docbook" = "xyes" && \ + test "x$HAVE_XMLLINT" = "xyes" && \ + test "x$HAVE_PS2PDF" = "xyes"; then + DOC_PDF=yes + AC_MSG_NOTICE(Will output PDF documentation) + else + DOC_PDF=no + AC_MSG_NOTICE(Will not output PDF documentation) + fi + + dnl if we don't have everything, we should disable + if test "x$have_docbook" != "xyes"; then + enable_docbook=no + fi + fi + + dnl if we're going to install documentation, tell us where + if test "x$have_docbook" = "xyes"; then + AC_MSG_NOTICE(Installing documentation in $docdir) + AC_SUBST(docdir) + fi + + AM_CONDITIONAL(ENABLE_DOCBOOK, test x$enable_docbook = xyes) + AM_CONDITIONAL(DOC_HTML, test x$DOC_HTML = xyes) + AM_CONDITIONAL(DOC_PDF, test x$DOC_PDF = xyes) + AM_CONDITIONAL(DOC_PS, test x$DOC_PS = xyes) +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/gst-dowhile.m4 gstreamer-vaapi-1.8.2/common/m4/gst-dowhile.m4 --- gstreamer-vaapi-0.7.0/common/m4/gst-dowhile.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gst-dowhile.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,24 @@ +dnl +dnl Check for working do while(0) macros. This is used by G_STMT_START +dnl and G_STMT_END in glib/gmacros.h. Without having this defined we +dnl get "ambigious if-else" compiler warnings when compling C++ code. +dnl +dnl Copied from GLib's configure.in +dnl +AC_DEFUN([AG_GST_CHECK_DOWHILE_MACROS],[ + +dnl *** check for working do while(0) macros *** +AC_CACHE_CHECK([for working do while(0) macros], _cv_g_support_dowhile_macros, [ + AC_TRY_COMPILE([],[ + #define STMT_START do + #define STMT_END while(0) + #define STMT_TEST STMT_START { i = 0; } STMT_END + int main(void) { int i = 1; STMT_TEST; return i; }], + [_cv_g_support_dowhile_macros=yes], + [_cv_g_support_dowhile_macros=no], + [_cv_g_support_dowhile_macros=yes]) +]) +if test x$_cv_g_support_dowhile_macros = xyes; then + AC_DEFINE(HAVE_DOWHILE_MACROS, 1, [define for working do while(0) macros]) +fi +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/gst-error.m4 gstreamer-vaapi-1.8.2/common/m4/gst-error.m4 --- gstreamer-vaapi-0.7.0/common/m4/gst-error.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gst-error.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,221 @@ +dnl handle various error-related things + +dnl Thomas Vander Stichele +dnl Tim-Philipp Müller + +dnl Last modification: 2008-02-18 + +dnl AG_GST_SET_ERROR_CFLAGS([ADD-WERROR], [MORE_FLAGS]) +dnl AG_GST_SET_ERROR_CXXFLAGS([ADD-WERROR], [MORE_FLAGS]) +dnl AG_GST_SET_LEVEL_DEFAULT([IS-GIT-VERSION]) + + +dnl Sets WARNING_CFLAGS and ERROR_CFLAGS to something the compiler +dnl will accept and AC_SUBST them so they are available in Makefile +dnl +dnl WARNING_CFLAGS will contain flags to make the compiler emit more +dnl warnings. +dnl ERROR_CFLAGS will contain flags to make those warnings fatal, +dnl unless ADD-WERROR is set to "no" +dnl +dnl If MORE_FLAGS is set, tries to add each of the given flags +dnl to WARNING_CFLAGS if the compiler supports them. Each flag is +dnl tested separately. +dnl +dnl These flags can be overridden at make time: +dnl make ERROR_CFLAGS= +AC_DEFUN([AG_GST_SET_ERROR_CFLAGS], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AS_COMPILER_FLAG]) + + WARNING_CFLAGS="" + ERROR_CFLAGS="" + + dnl if we support -Wall, set it unconditionally + AS_COMPILER_FLAG(-Wall, + WARNING_CFLAGS="$WARNING_CFLAGS -Wall") + + dnl Warn if declarations after statements are used (C99 extension) + AS_COMPILER_FLAG(-Wdeclaration-after-statement, + WARNING_CFLAGS="$WARNING_CFLAGS -Wdeclaration-after-statement") + + dnl Warn if variable length arrays are used (C99 extension) + AS_COMPILER_FLAG(-Wvla, + WARNING_CFLAGS="$WARNING_CFLAGS -Wvla") + + dnl Warn for invalid pointer arithmetic + AS_COMPILER_FLAG(-Wpointer-arith, + WARNING_CFLAGS="$WARNING_CFLAGS -Wpointer-arith") + + dnl if asked for, add -Werror if supported + if test "x$1" != "xno" + then + AS_COMPILER_FLAG(-Werror, ERROR_CFLAGS="$ERROR_CFLAGS -Werror") + fi + + if test "x$2" != "x" + then + UNSUPPORTED="" + list="$2" + for each in $list + do + AS_COMPILER_FLAG($each, + WARNING_CFLAGS="$WARNING_CFLAGS $each", + UNSUPPORTED="$UNSUPPORTED $each") + done + if test "X$UNSUPPORTED" != X ; then + AC_MSG_NOTICE([unsupported compiler flags: $UNSUPPORTED]) + fi + fi + + AC_SUBST(WARNING_CFLAGS) + AC_SUBST(ERROR_CFLAGS) + AC_MSG_NOTICE([set WARNING_CFLAGS to $WARNING_CFLAGS]) + AC_MSG_NOTICE([set ERROR_CFLAGS to $ERROR_CFLAGS]) +]) + +dnl Sets WARNING_CXXFLAGS and ERROR_CXXFLAGS to something the compiler +dnl will accept and AC_SUBST them so they are available in Makefile +dnl +dnl WARNING_CXXFLAGS will contain flags to make the compiler emit more +dnl warnings. +dnl ERROR_CXXFLAGS will contain flags to make those warnings fatal, +dnl unless ADD-WERROR is set to "no" +dnl +dnl If MORE_FLAGS is set, tries to add each of the given flags +dnl to WARNING_CFLAGS if the compiler supports them. Each flag is +dnl tested separately. +dnl +dnl These flags can be overridden at make time: +dnl make ERROR_CXXFLAGS= +AC_DEFUN([AG_GST_SET_ERROR_CXXFLAGS], +[ + AC_REQUIRE([AC_PROG_CXX]) + AC_REQUIRE([AS_CXX_COMPILER_FLAG]) + + ERROR_CXXFLAGS="" + WARNING_CXXFLAGS="" + + dnl if we support -Wall, set it unconditionally + AS_CXX_COMPILER_FLAG(-Wall, WARNING_CXXFLAGS="$WARNING_CXXFLAGS -Wall") + + dnl if asked for, add -Werror if supported + if test "x$1" != "xno" + then + AS_CXX_COMPILER_FLAG(-Werror, ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror") + + if test "x$ERROR_CXXFLAGS" != "x" + then + dnl add exceptions + AS_CXX_COMPILER_FLAG([-Wno-non-virtual-dtor], ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Wno-non-virtual-dtor") + + dnl Add -fno-strict-aliasing for GLib versions before 2.19.8 + dnl as before G_LOCK and friends caused strict aliasing compiler + dnl warnings. + PKG_CHECK_EXISTS([glib-2.0 < 2.19.8], [ + AS_CXX_COMPILER_FLAG([-fno-strict-aliasing], + ERROR_CXXFLAGS="$ERROR_CXXFLAGS -fno-strict-aliasing") + ]) + fi + fi + + if test "x$2" != "x" + then + UNSUPPORTED="" + list="$2" + for each in $list + do + AS_CXX_COMPILER_FLAG($each, + WARNING_CXXFLAGS="$WARNING_CXXFLAGS $each", + UNSUPPORTED="$UNSUPPORTED $each") + done + if test "X$UNSUPPORTED" != X ; then + AC_MSG_NOTICE([unsupported compiler flags: $UNSUPPORTED]) + fi + fi + + AC_SUBST(WARNING_CXXFLAGS) + AC_SUBST(ERROR_CXXFLAGS) + AC_MSG_NOTICE([set WARNING_CXXFLAGS to $WARNING_CXXFLAGS]) + AC_MSG_NOTICE([set ERROR_CXXFLAGS to $ERROR_CXXFLAGS]) +]) + +dnl Sets WARNING_OBJCFLAGS and ERROR_OBJCFLAGS to something the compiler +dnl will accept and AC_SUBST them so they are available in Makefile +dnl +dnl WARNING_OBJCFLAGS will contain flags to make the compiler emit more +dnl warnings. +dnl ERROR_OBJCFLAGS will contain flags to make those warnings fatal, +dnl unless ADD-WERROR is set to "no" +dnl +dnl If MORE_FLAGS is set, tries to add each of the given flags +dnl to WARNING_CFLAGS if the compiler supports them. Each flag is +dnl tested separately. +dnl +dnl These flags can be overridden at make time: +dnl make ERROR_OBJCFLAGS= +AC_DEFUN([AG_GST_SET_ERROR_OBJCFLAGS], +[ + AC_REQUIRE([AC_PROG_OBJC]) + AC_REQUIRE([AS_OBJC_COMPILER_FLAG]) + + ERROR_OBJCFLAGS="" + WARNING_OBJCFLAGS="" + + dnl if we support -Wall, set it unconditionally + AS_OBJC_COMPILER_FLAG(-Wall, WARNING_OBJCFLAGS="$WARNING_OBJCFLAGS -Wall") + + dnl if asked for, add -Werror if supported + if test "x$1" != "xno" + then + AS_OBJC_COMPILER_FLAG(-Werror, ERROR_OBJCFLAGS="$ERROR_OBJCFLAGS -Werror") + + if test "x$ERROR_OBJCFLAGS" != "x" + then + dnl Add -fno-strict-aliasing for GLib versions before 2.19.8 + dnl as before G_LOCK and friends caused strict aliasing compiler + dnl warnings. + PKG_CHECK_EXISTS([glib-2.0 < 2.19.8], [ + AS_OBJC_COMPILER_FLAG([-fno-strict-aliasing], + ERROR_OBJCFLAGS="$ERROR_OBJCFLAGS -fno-strict-aliasing") + ]) + fi + fi + + if test "x$2" != "x" + then + UNSUPPORTED="" + list="$2" + for each in $list + do + AS_OBJC_COMPILER_FLAG($each, + WARNING_OBJCFLAGS="$WARNING_OBJCFLAGS $each", + UNSUPPORTED="$UNSUPPORTED $each") + done + if test "X$UNSUPPORTED" != X ; then + AC_MSG_NOTICE([unsupported compiler flags: $UNSUPPORTED]) + fi + fi + + AC_SUBST(WARNING_OBJCFLAGS) + AC_SUBST(ERROR_OBJCFLAGS) + AC_MSG_NOTICE([set WARNING_OBJCFLAGS to $WARNING_OBJCFLAGS]) + AC_MSG_NOTICE([set ERROR_OBJCFLAGS to $ERROR_OBJCFLAGS]) +]) + +dnl Sets the default error level for debugging messages +AC_DEFUN([AG_GST_SET_LEVEL_DEFAULT], +[ + dnl define correct errorlevel for debugging messages. We want to have + dnl GST_ERROR messages printed when running cvs builds + if test "x[$1]" = "xyes"; then + GST_LEVEL_DEFAULT=GST_LEVEL_ERROR + else + GST_LEVEL_DEFAULT=GST_LEVEL_NONE + fi + AC_DEFINE_UNQUOTED(GST_LEVEL_DEFAULT, $GST_LEVEL_DEFAULT, + [Default errorlevel to use]) + dnl AC_SUBST so we can use it for win32/common/config.h + AC_SUBST(GST_LEVEL_DEFAULT) +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/gst-feature.m4 gstreamer-vaapi-1.8.2/common/m4/gst-feature.m4 --- gstreamer-vaapi-0.7.0/common/m4/gst-feature.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gst-feature.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,297 @@ +dnl Perform a check for a feature for GStreamer +dnl Richard Boulton +dnl Thomas Vander Stichele added useful stuff +dnl Last modification: 25/06/2001 +dnl +dnl AG_GST_CHECK_FEATURE(FEATURE-NAME, FEATURE-DESCRIPTION, +dnl DEPENDENT-PLUGINS, TEST-FOR-FEATURE, +dnl DISABLE-BY-DEFAULT, ACTION-IF-USE, ACTION-IF-NOTUSE) +dnl +dnl This macro adds a command line argument to allow the user to enable +dnl or disable a feature, and if the feature is enabled, performs a supplied +dnl test to check if the feature is available. +dnl +dnl The test should define HAVE_ to "yes" or "no" depending +dnl on whether the feature is available. +dnl +dnl The macro will set USE_ to "yes" or "no" depending on +dnl whether the feature is to be used. +dnl Thomas changed this, so that when USE_ was already set +dnl to no, then it stays that way. +dnl +dnl The macro will call AM_CONDITIONAL(USE_, ...) to allow +dnl the feature to control what is built in Makefile.ams. If you want +dnl additional actions resulting from the test, you can add them with the +dnl ACTION-IF-USE and ACTION-IF-NOTUSE parameters. +dnl +dnl FEATURE-NAME is the name of the feature, and should be in +dnl purely upper case characters. +dnl FEATURE-DESCRIPTION is used to describe the feature in help text for +dnl the command line argument. +dnl DEPENDENT-PLUGINS lists any plug-ins which depend on this feature. +dnl TEST-FOR-FEATURE is a test which sets HAVE_ to "yes" +dnl or "no" depending on whether the feature is +dnl available. +dnl DISABLE-BY-DEFAULT if "disabled", the feature is disabled by default, +dnl if any other value, the feature is enabled by default. +dnl ACTION-IF-USE any extra actions to perform if the feature is to be +dnl used. +dnl ACTION-IF-NOTUSE any extra actions to perform if the feature is not to +dnl be used. +dnl +dnl +dnl thomas : +dnl we also added a history. +dnl GST_PLUGINS_YES will contain all plugins to be built +dnl that were checked through AG_GST_CHECK_FEATURE +dnl GST_PLUGINS_NO will contain those that won't be built + +AC_DEFUN([AG_GST_CHECK_FEATURE], +[echo +AC_MSG_NOTICE(*** checking feature: [$2] ***) +if test "x[$3]" != "x" +then + AC_MSG_NOTICE(*** for plug-ins: [$3] ***) +fi +dnl +builtin(define, [gst_endisable], ifelse($5, [disabled], [enable], [disable]))dnl +dnl if it is set to NO, then don't even consider it for building +NOUSE= +if test "x$USE_[$1]" = "xno"; then + NOUSE="yes" +fi +AC_ARG_ENABLE(translit([$1], A-Z, a-z), + [ ]builtin(format, --%-26s gst_endisable %s, gst_endisable-translit([$1], A-Z, a-z), [$2]ifelse([$3],,,: [$3])), + [ case "${enableval}" in + yes) USE_[$1]=yes;; + no) USE_[$1]=no;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-translit([$1], A-Z, a-z)) ;; + esac], + [ USE_$1=]ifelse($5, [disabled], [no], [yes])) dnl DEFAULT + +dnl *** set it back to no if it was preset to no +if test "x$NOUSE" = "xyes"; then + USE_[$1]="no" + AC_MSG_WARN(*** $3 pre-configured not to be built) +fi +NOUSE= + +dnl *** Check if it is ported or not +if echo " [$GST_PLUGINS_NONPORTED] " | tr , ' ' | grep -i " [$1] " > /dev/null; then + USE_[$1]="no" + AC_MSG_WARN(*** $3 not ported) +fi + +dnl *** If it's enabled + +if test x$USE_[$1] = xyes; then + dnl save compile variables before the test + + gst_check_save_LIBS=$LIBS + gst_check_save_LDFLAGS=$LDFLAGS + gst_check_save_CFLAGS=$CFLAGS + gst_check_save_CPPFLAGS=$CPPFLAGS + gst_check_save_CXXFLAGS=$CXXFLAGS + + HAVE_[$1]=no + dnl TEST_FOR_FEATURE + $4 + + LIBS=$gst_check_save_LIBS + LDFLAGS=$gst_check_save_LDFLAGS + CFLAGS=$gst_check_save_CFLAGS + CPPFLAGS=$gst_check_save_CPPFLAGS + CXXFLAGS=$gst_check_save_CXXFLAGS + + dnl If it isn't found, unset USE_[$1] + if test x$HAVE_[$1] = xno; then + USE_[$1]=no + else + ifelse([$3], , :, [AC_MSG_NOTICE(*** These plugins will be built: [$3])]) + fi +fi +dnl *** Warn if it's disabled or not found +if test x$USE_[$1] = xyes; then + ifelse([$6], , :, [$6]) + if test "x$3" != "x"; then + GST_PLUGINS_YES="\t[$3]\n$GST_PLUGINS_YES" + fi + AC_DEFINE(HAVE_[$1], , [Define to enable $2]ifelse($3,,, [ (used by $3)]).) +else + ifelse([$3], , :, [AC_MSG_NOTICE(*** These plugins will not be built: [$3])]) + if test "x$3" != "x"; then + GST_PLUGINS_NO="\t[$3]\n$GST_PLUGINS_NO" + fi + ifelse([$7], , :, [$7]) +fi +dnl *** Define the conditional as appropriate +AM_CONDITIONAL(USE_[$1], test x$USE_[$1] = xyes) +]) + +dnl Use AC_CHECK_LIB and AC_CHECK_HEADER to do both tests at once +dnl sets HAVE_module if we have it +dnl Richard Boulton +dnl Last modification: 26/06/2001 +dnl AG_GST_CHECK_LIBHEADER(FEATURE-NAME, LIB NAME, LIB FUNCTION, EXTRA LD FLAGS, +dnl HEADER NAME, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) +dnl +dnl This check was written for GStreamer: it should be renamed and checked +dnl for portability if you decide to use it elsewhere. +dnl +AC_DEFUN([AG_GST_CHECK_LIBHEADER], +[ + AC_CHECK_LIB([$2], [$3], HAVE_[$1]=yes, HAVE_[$1]=no,[$4]) + if test "x$HAVE_[$1]" = "xyes"; then + AC_CHECK_HEADER([$5], :, HAVE_[$1]=no) + if test "x$HAVE_[$1]" = "xyes"; then + dnl execute what needs to be + ifelse([$6], , :, [$6]) + else + ifelse([$7], , :, [$7]) + fi + else + ifelse([$7], , :, [$7]) + fi + AC_SUBST(HAVE_[$1]) +] +) + +dnl 2004-02-14 Thomas - changed to get set properly and use proper output +dnl 2003-06-27 Benjamin Otte - changed to make this work with gstconfig.h +dnl +dnl Add a subsystem --disable flag and all the necessary symbols and substitions +dnl +dnl AG_GST_CHECK_SUBSYSTEM_DISABLE(SYSNAME, [subsystem name]) +dnl +AC_DEFUN([AG_GST_CHECK_SUBSYSTEM_DISABLE], +[ + dnl this define will replace each literal subsys_def occurrence with + dnl the lowercase hyphen-separated subsystem + dnl e.g. if $1 is GST_DEBUG then subsys_def will be a macro with gst-debug + define([subsys_def],translit([$1], _A-Z, -a-z)) + + AC_ARG_ENABLE(subsys_def, + AC_HELP_STRING(--disable-subsys_def, [disable $2]), + [ + case "${enableval}" in + yes) GST_DISABLE_[$1]=no ;; + no) GST_DISABLE_[$1]=yes ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-subsys_def]) ;; + esac + ], + [GST_DISABLE_[$1]=no]) dnl Default value + + if test x$GST_DISABLE_[$1] = xyes; then + AC_MSG_NOTICE([disabled subsystem [$2]]) + GST_DISABLE_[$1]_DEFINE="#define GST_DISABLE_$1 1" + else + GST_DISABLE_[$1]_DEFINE="/* #undef GST_DISABLE_$1 */" + fi + AC_SUBST(GST_DISABLE_[$1]_DEFINE) + undefine([subsys_def]) +]) + + +dnl Parse gstconfig.h for feature and defines add the symbols and substitions +dnl +dnl AG_GST_PARSE_SUBSYSTEM_DISABLE(GST_CONFIGPATH, FEATURE) +dnl +AC_DEFUN([AG_GST_PARSE_SUBSYSTEM_DISABLE], +[ + grep >/dev/null "#undef GST_DISABLE_$2" $1 + if test $? = 0; then + GST_DISABLE_[$2]=0 + else + GST_DISABLE_[$2]=1 + fi + AC_SUBST(GST_DISABLE_[$2]) +]) + +dnl Parse gstconfig.h and defines add the symbols and substitions +dnl +dnl GST_CONFIGPATH=`$PKG_CONFIG --variable=includedir gstreamer-1.0`"/gst/gstconfig.h" +dnl AG_GST_PARSE_SUBSYSTEM_DISABLES(GST_CONFIGPATH) +dnl +AC_DEFUN([AG_GST_PARSE_SUBSYSTEM_DISABLES], +[ + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,GST_DEBUG) + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,LOADSAVE) + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,PARSE) + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,TRACE) + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,ALLOC_TRACE) + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,REGISTRY) + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,PLUGIN) + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,XML) +]) + +dnl AG_GST_CHECK_GST_DEBUG_DISABLED(ACTION-IF-DISABLED, ACTION-IF-NOT-DISABLED) +dnl +dnl Checks if the GStreamer debugging system is disabled in the core version +dnl we are compiling against (by checking gstconfig.h) +dnl +AC_DEFUN([AG_GST_CHECK_GST_DEBUG_DISABLED], +[ + AC_REQUIRE([AG_GST_CHECK_GST]) + + AC_MSG_CHECKING([whether the GStreamer debugging system is enabled]) + AC_LANG_PUSH([C]) + save_CFLAGS="$CFLAGS" + CFLAGS="$GST_CFLAGS $CFLAGS" + AC_COMPILE_IFELSE([ + AC_LANG_SOURCE([[ + #include + #ifdef GST_DISABLE_GST_DEBUG + #error "debugging disabled, make compiler fail" + #endif]])], [ debug_system_enabled=yes], [debug_system_enabled=no]) + CFLAGS="$save_CFLAGS" + AC_LANG_POP([C]) + + AC_MSG_RESULT([$debug_system_enabled]) + + if test "x$debug_system_enabled" = "xyes" ; then + $2 + true + else + $1 + true + fi +]) + +dnl relies on GST_PLUGINS_ALL, GST_PLUGINS_SELECTED, GST_PLUGINS_YES, +dnl GST_PLUGINS_NO, and BUILD_EXTERNAL +AC_DEFUN([AG_GST_OUTPUT_PLUGINS], [ + +printf "configure: *** Plug-ins without external dependencies that will be built:\n" +( for i in $GST_PLUGINS_SELECTED; do printf '\t'$i'\n'; done ) | sort +printf "\n" + +printf "configure: *** Plug-ins without external dependencies that will NOT be built:\n" +( for i in $GST_PLUGINS_ALL; do + case " $GST_PLUGINS_SELECTED " in + *\ $i\ *) + ;; + *) + printf '\t'$i'\n' + ;; + esac + done ) | sort +printf "\n" + +printf "configure: *** Plug-ins that have NOT been ported:\n" +( for i in $GST_PLUGINS_NONPORTED; do + printf '\t'$i'\n' + done ) | sort +printf "\n" + +if test "x$BUILD_EXTERNAL" = "xno"; then + printf "configure: *** No plug-ins with external dependencies will be built\n" +else + printf "configure: *** Plug-ins with dependencies that will be built:" + printf "$GST_PLUGINS_YES\n" | sort + printf "\n" + printf "configure: *** Plug-ins with dependencies that will NOT be built:" + printf "$GST_PLUGINS_NO\n" | sort + printf "\n" +fi +]) + diff -Nru gstreamer-vaapi-0.7.0/common/m4/gst-function.m4 gstreamer-vaapi-1.8.2/common/m4/gst-function.m4 --- gstreamer-vaapi-0.7.0/common/m4/gst-function.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gst-function.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,63 @@ +dnl +dnl Check for compiler mechanism to show functions in debugging +dnl copied from an Ali patch floating on the internet +dnl +AC_DEFUN([AG_GST_CHECK_FUNCTION],[ + dnl #1: __PRETTY_FUNCTION__ + AC_MSG_CHECKING(whether $CC implements __PRETTY_FUNCTION__) + AC_CACHE_VAL(gst_cv_have_pretty_function,[ + AC_TRY_LINK([#include ], + [printf("%s", __PRETTY_FUNCTION__);], + gst_cv_have_pretty_function=yes, + gst_cv_have_pretty_function=no) + ]) + AC_MSG_RESULT($gst_cv_have_pretty_function) + if test "$gst_cv_have_pretty_function" = yes; then + AC_DEFINE(HAVE_PRETTY_FUNCTION, 1, + [defined if the compiler implements __PRETTY_FUNCTION__]) + fi + +dnl #2: __FUNCTION__ + AC_MSG_CHECKING(whether $CC implements __FUNCTION__) + AC_CACHE_VAL(gst_cv_have_function,[ + AC_TRY_LINK([#include ], + [printf("%s", __FUNCTION__);], + gst_cv_have_function=yes, + gst_cv_have_function=no) + ]) + AC_MSG_RESULT($gst_cv_have_function) + if test "$gst_cv_have_function" = yes; then + AC_DEFINE(HAVE_FUNCTION, 1, + [defined if the compiler implements __FUNCTION__]) + fi + +dnl #3: __func__ + AC_MSG_CHECKING(whether $CC implements __func__) + AC_CACHE_VAL(gst_cv_have_func,[ + AC_TRY_LINK([#include ], + [printf("%s", __func__);], + gst_cv_have_func=yes, + gst_cv_have_func=no) + ]) + AC_MSG_RESULT($gst_cv_have_func) + if test "$gst_cv_have_func" = yes; then + AC_DEFINE(HAVE_FUNC, 1, + [defined if the compiler implements __func__]) + fi + +dnl now define FUNCTION to whatever works, and fallback to "" + if test "$gst_cv_have_pretty_function" = yes; then + function=__PRETTY_FUNCTION__ + else + if test "$gst_cv_have_function" = yes; then + function=__FUNCTION__ + else + if test "$gst_cv_have_func" = yes; then + function=__func__ + else + function=\"\" + fi + fi + fi + AC_DEFINE_UNQUOTED(GST_FUNCTION, $function, [macro to use to show function name]) +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/gst-gettext.m4 gstreamer-vaapi-1.8.2/common/m4/gst-gettext.m4 --- gstreamer-vaapi-0.7.0/common/m4/gst-gettext.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gst-gettext.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,28 @@ +dnl gettext setup + +dnl AG_GST_GETTEXT([gettext-package]) +dnl defines GETTEXT_PACKAGE and LOCALEDIR + +AC_DEFUN([AG_GST_GETTEXT], +[ + if test "$USE_NLS" = "yes"; then + GETTEXT_PACKAGE=[$1] + else + GETTEXT_PACKAGE=[NULL] + fi + AC_SUBST(GETTEXT_PACKAGE) + AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE", + [gettext package name]) + + dnl make sure po/Makevars is kept in sync with GETTEXT_PACKAGE + if test -e "${srcdir}/po/Makevars"; then + if ! grep -e "$1" "${srcdir}/po/Makevars"; then + AC_MSG_ERROR([DOMAIN in po/Makevars does not match GETTEXT_PACKAGE $1]) + fi + fi + + dnl define LOCALEDIR in config.h + AS_AC_EXPAND(LOCALEDIR, $datadir/locale) + AC_DEFINE_UNQUOTED([LOCALEDIR], "$LOCALEDIR", + [gettext locale dir]) +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/gst-glib2.m4 gstreamer-vaapi-1.8.2/common/m4/gst-glib2.m4 --- gstreamer-vaapi-0.7.0/common/m4/gst-glib2.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gst-glib2.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,121 @@ +dnl check for a minimum version of GLib + +dnl AG_GST_GLIB_CHECK([minimum-version-required]) + +AC_DEFUN([AG_GST_GLIB_CHECK], +[ + AC_REQUIRE([AS_NANO]) + + dnl Minimum required version of GLib + GLIB_REQ=[$1] + if test "x$GLIB_REQ" = "x" + then + AC_MSG_ERROR([Please specify a required version for GLib 2.0]) + fi + AC_SUBST(GLIB_REQ) + + dnl Check for glib with everything + AG_GST_PKG_CHECK_MODULES(GLIB, + glib-2.0 >= $GLIB_REQ gobject-2.0 gmodule-no-export-2.0) + + if test "x$HAVE_GLIB" = "xno"; then + AC_MSG_ERROR([This package requires GLib >= $GLIB_REQ to compile.]) + fi + + dnl Add define to tell GLib that threading is always enabled within GStreamer + dnl code (optimisation, bypasses checks if the threading system is enabled + dnl when using threading primitives) + GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_THREADS_MANDATORY" + + dnl Define G_DISABLE_DEPRECATED for development versions + if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then + GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_DEPRECATED" + fi + + AC_ARG_ENABLE(gobject-cast-checks, + AS_HELP_STRING([--enable-gobject-cast-checks[=@<:@no/auto/yes@:>@]], + [Enable GObject cast checks]),[enable_gobject_cast_checks=$enableval], + [enable_gobject_cast_checks=auto]) + + if test "x$enable_gobject_cast_checks" = "xauto"; then + dnl Turn on cast checks only for development versions + if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then + enable_gobject_cast_checks=yes + else + enable_gobject_cast_checks=no + fi + fi + + if test "x$enable_gobject_cast_checks" = "xno"; then + GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_CAST_CHECKS" + fi + + AC_ARG_ENABLE(glib-asserts, + AS_HELP_STRING([--enable-glib-asserts[=@<:@no/yes@:>@]], + [Enable GLib assertion]),[enable_glib_assertions=$enableval], + [enable_glib_assertions=yes]) + + if test "x$enable_glib_assertions" = "xno"; then + GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_ASSERT" + fi + + dnl Find location of glib utils. People may want to or have to override these, + dnl e.g. in a cross-compile situation where PATH is a bit messed up. We need + dnl for these tools to work on the host, so can't just use the one from the + dnl GLib installation that pkg-config picks up, as that might be for a + dnl different target architecture. + dnl + dnl glib-genmarshal: + AC_MSG_CHECKING(for glib-genmarshal) + if test "x$GLIB_GENMARSHAL" != "x"; then + AC_MSG_RESULT([$GLIB_GENMARSHAL (from environment)]) + else + GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` + if $GLIB_GENMARSHAL --version 2>/dev/null >/dev/null; then + AC_MSG_RESULT([$GLIB_GENMARSHAL (from pkg-config path)]) + else + AC_PATH_PROG(GLIB_GENMARSHAL, [glib-genmarshal], [glib-genmarshal]) + AC_MSG_RESULT([$GLIB_GENMARSHAL]) + fi + fi + if ! $GLIB_GENMARSHAL --version 2>/dev/null >/dev/null; then + AC_MSG_WARN([$GLIB_GENMARSHAL does not seem to work!]) + fi + AC_SUBST(GLIB_GENMARSHAL) + + dnl glib-mkenums: + AC_MSG_CHECKING(for glib-mkenums) + if test "x$GLIB_MKENUMS" != "x"; then + AC_MSG_RESULT([$GLIB_MKENUMS (from environment)]) + else + dnl glib-mkenums is written in perl so should always work really + GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` + AC_MSG_RESULT([$GLIB_MKENUMS]) + fi + if ! $GLIB_MKENUMS --version 2>/dev/null >/dev/null; then + AC_MSG_WARN([$GLIB_MKENUMS does not seem to work!]) + fi + AC_SUBST(GLIB_MKENUMS) + + AC_SUBST(GLIB_EXTRA_CFLAGS) + + dnl Now check for GIO + PKG_CHECK_MODULES(GIO, gio-2.0 >= $GLIB_REQ) + if test "x$HAVE_GIO" = "xno"; then + AC_MSG_ERROR([This package requires GIO >= $GLIB_REQ to compile.]) + fi + + GIO_MODULE_DIR="`$PKG_CONFIG --variable=giomoduledir gio-2.0`" + AC_DEFINE_UNQUOTED(GIO_MODULE_DIR, "$GIO_MODULE_DIR", + [The GIO modules directory.]) + GIO_LIBDIR="`$PKG_CONFIG --variable=libdir gio-2.0`" + AC_DEFINE_UNQUOTED(GIO_LIBDIR, "$GIO_LIBDIR", + [The GIO library directory.]) + GIO_PREFIX="`$PKG_CONFIG --variable=prefix gio-2.0`" + AC_DEFINE_UNQUOTED(GIO_PREFIX, "$GIO_PREFIX", + [The GIO install prefix.]) + + AC_SUBST(GIO_CFLAGS) + AC_SUBST(GIO_LIBS) + AC_SUBST(GIO_LDFLAGS) +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/gst-libxml2.m4 gstreamer-vaapi-1.8.2/common/m4/gst-libxml2.m4 --- gstreamer-vaapi-0.7.0/common/m4/gst-libxml2.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gst-libxml2.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,52 @@ +dnl call this macro with the minimum required version as an argument +dnl this macro sets and AC_SUBSTs XML_CFLAGS and XML_LIBS +dnl it also sets LIBXML_PKG, used for the pkg-config file + +AC_DEFUN([AG_GST_LIBXML2_CHECK], +[ + dnl Minimum required version of libxml2 + dnl default to 2.4.9 if not specified + LIBXML2_REQ=ifelse([$1],,2.4.9,[$1]) + AC_SUBST(LIBXML2_REQ) + + dnl check for libxml2 + PKG_CHECK_MODULES(XML, libxml-2.0 >= $LIBXML2_REQ, + HAVE_LIBXML2=yes, [ + AC_MSG_RESULT(no) + HAVE_LIBXML2=no + ]) + if test "x$HAVE_LIBXML2" = "xyes"; then + AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 is available]) + else + AC_MSG_ERROR([ + Need libxml2 and development headers/files to build GStreamer. + + You can do without libxml2 if you pass --disable-loadsave to + configure, but that breaks ABI, so don't do that unless you + are building for an embedded setup and know what you are doing. + ]) + fi + dnl this is for the .pc file + LIBXML_PKG=', libxml-2.0' + AC_SUBST(LIBXML_PKG) + AC_SUBST(XML_LIBS) + AC_SUBST(XML_CFLAGS) + + dnl XML_LIBS might pull in -lz without zlib actually being on the system, so + dnl try linking with these LIBS and CFLAGS + ac_save_CFLAGS=$CFLAGS + ac_save_LIBS=$LIBS + CFLAGS="$CFLAGS $XML_CFLAGS" + LIBS="$LIBS $XML_LIBS" + AC_TRY_LINK([ +#include +#include +],[ +/* function body */ +], + AC_MSG_NOTICE([Test xml2 program linked]), + AC_MSG_ERROR([Could not link libxml2 test program. Check if you have the necessary dependencies.]) + ) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/gst.m4 gstreamer-vaapi-1.8.2/common/m4/gst.m4 --- gstreamer-vaapi-0.7.0/common/m4/gst.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gst.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,36 @@ +dnl AG_GST_INIT +dnl sets up use of GStreamer configure.ac macros +dnl all GStreamer autoconf macros are prefixed +dnl with AG_GST_ for public macros +dnl with _AG_GST_ for private macros +dnl +dnl We call AC_CANONICAL_TARGET and AC_CANONICAL_HOST so that +dnl it is valid before AC_ARG_PROGRAM is called + +AC_DEFUN([AG_GST_INIT], +[ + m4_pattern_forbid(^_?AG_GST_) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use host_ variables + AC_REQUIRE([AC_CANONICAL_TARGET]) dnl we use target_ variables +]) + +dnl AG_GST_PKG_CONFIG_PATH +dnl +dnl sets up a GST_PKG_CONFIG_PATH variable for use in Makefile.am +dnl which contains the path of the in-tree pkgconfig directory first +dnl and then any paths specified in PKG_CONFIG_PATH. +dnl +dnl We do this mostly so we don't have to use unportable shell constructs +dnl such as ${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH} in Makefile.am to handle +dnl the case where the environment variable is not set, but also in order +dnl to avoid a trailing ':' in the PKG_CONFIG_PATH which apparently causes +dnl problems with pkg-config on windows with msys/mingw. +AC_DEFUN([AG_GST_PKG_CONFIG_PATH], +[ + GST_PKG_CONFIG_PATH="\$(top_builddir)/pkgconfig" + if test "x$PKG_CONFIG_PATH" != "x"; then + GST_PKG_CONFIG_PATH="$GST_PKG_CONFIG_PATH:$PKG_CONFIG_PATH" + fi + AC_SUBST([GST_PKG_CONFIG_PATH]) + AC_MSG_NOTICE([Using GST_PKG_CONFIG_PATH = $GST_PKG_CONFIG_PATH]) +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/gst-package-release-datetime.m4 gstreamer-vaapi-1.8.2/common/m4/gst-package-release-datetime.m4 --- gstreamer-vaapi-0.7.0/common/m4/gst-package-release-datetime.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gst-package-release-datetime.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,93 @@ +dnl macros to set GST_PACKAGE_RELEASE_DATETIME + +dnl =========================================================================== +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME +dnl +dnl Usage: +dnl +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME() +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([no]...) +dnl sets the release datetime to the current date +dnl (no = this is not a release, but git or prerelease) +dnl +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([YYYY-MM-DD]) +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([yes], [YYYY-MM-DD]) +dnl sets the release datetime to the specified date (and time, if given) +dnl (yes = this is a release, not git or prerelease) +dnl +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([yes], [DOAP-FILE], [RELEASE-VERSION]) +dnl sets the release date to the release date associated with version +dnl RELEASE-VERSION in the .doap file DOAP-FILE +dnl (yes = this is a release, not git or prerelease) +dnl +dnl We need to treat pre-releases like git because there won't be an entry +dnl in the .doap file for pre-releases yet, and we don't want to use the +dnl date of the last release either. +dnl =========================================================================== +AC_DEFUN([AG_GST_SET_PACKAGE_RELEASE_DATETIME], +[ + dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME() + dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([no]...) + if test "x$1" = "xno" -o "x$1" = "x"; then + GST_PACKAGE_RELEASE_DATETIME=`date -u "+%Y-%m-%dT%H:%MZ"` + elif test "x$1" = "xyes"; then + dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([yes], [YYYY-MM-DD]) + dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([yes], [DOAP-FILE], [RELEASE-VERSION]) +changequote(<<, >>)dnl + if ( echo $2 | grep '^20[1-9][0-9]-[0-1][0-9]-[0-3][0-9]' >/dev/null ) ; then +changequote([, ])dnl + GST_PACKAGE_RELEASE_DATETIME=$2 + else + dnl we assume the .doap file contains the date as YYYY-MM-DD + YYYY_MM_DD=`sh "${srcdir}/common/extract-release-date-from-doap-file" $3 $2`; + if test "x$YYYY_MM_DD" != "x"; then + GST_PACKAGE_RELEASE_DATETIME=$YYYY_MM_DD + else + AC_MSG_ERROR([SET_PACKAGE_RELEASE_DATETIME: could not extract + release date for release version $3 from $2]) + GST_PACKAGE_RELEASE_DATETIME="" + fi + fi + dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([YYYY-MM-DD]) +changequote(<<, >>)dnl + elif ( echo $1 | grep '^20[1-9][0-9]-[0-1][0-9]-[0-3][0-9]' >/dev/null ) ; then +changequote([, ])dnl + GST_PACKAGE_RELEASE_DATETIME=$1 + else + AC_MSG_WARN([SET_PACKAGE_RELEASE_DATETIME: invalid first argument]) + GST_PACKAGE_RELEASE_DATETIME="" + fi + + if test "x$GST_PACKAGE_RELEASE_DATETIME" = "x"; then + AC_MSG_WARN([Invalid package release date time: $GST_PACKAGE_RELEASE_DATETIME]) + else + AC_MSG_NOTICE([Setting GST_PACKAGE_RELEASE_DATETIME to $GST_PACKAGE_RELEASE_DATETIME]) + + AC_DEFINE_UNQUOTED([GST_PACKAGE_RELEASE_DATETIME], + ["$GST_PACKAGE_RELEASE_DATETIME"], + [GStreamer package release date/time for plugins as YYYY-MM-DD]) + fi +]) + +dnl =========================================================================== +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO +dnl +dnl Usage: +dnl +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([NANO-VERSION], [DOAP-FILE], [RELEASE-VERSION]) +dnl if NANO-VERSION is 0, sets the release date to the release date associated +dnl with version RELEASE-VERSION in the .doap file DOAP-FILE, otherwise sets +dnl the release date and time to the current date/time. +dnl +dnl We need to treat pre-releases like git because there won't be an entry +dnl in the .doap file for pre-releases yet, and we don't want to use the +dnl date of the last release either. +dnl =========================================================================== +AC_DEFUN([AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO], +[ + if test "x$1" = "x0"; then + AG_GST_SET_PACKAGE_RELEASE_DATETIME([yes], [ $2 ], [ $3 ]) + else + AG_GST_SET_PACKAGE_RELEASE_DATETIME([no]) + fi +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/gst-parser.m4 gstreamer-vaapi-1.8.2/common/m4/gst-parser.m4 --- gstreamer-vaapi-0.7.0/common/m4/gst-parser.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gst-parser.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,55 @@ +AC_DEFUN([AG_GST_BISON_CHECK], +[ + dnl FIXME: check if AC_PROG_YACC is suitable here + dnl FIXME: make precious + AC_PATH_PROG(BISON_PATH, bison, no) + if test x$BISON_PATH = xno; then + AC_MSG_ERROR(Could not find bison) + fi + + dnl check bison version + dnl we need version >= 2.4 for the '<>' support + dnl in the parser. + dnl First lines observed: 'bison (GNU Bison) 2.3' or 'GNU Bison version 1.28' + bison_min_version=2.4 + bison_version=`$BISON_PATH --version | head -n 1 | sed 's/^[[^0-9]]*//' | sed 's/[[^0-9]]*$//' | cut -d' ' -f1` + AC_MSG_CHECKING([bison version $bison_version >= $bison_min_version]) + + if perl -we "exit (('v$bison_version' ge 'v$bison_min_version') ? 0 : 1)"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([no]) + fi +]) + +AC_DEFUN([AG_GST_FLEX_CHECK], +[ + dnl we require flex for building the parser + AC_PATH_PROG(FLEX_PATH, flex, no) + if test x$FLEX_PATH = xno; then + AC_MSG_ERROR(Could not find flex) + fi + + dnl check flex version + dnl we need version >= 2.5.31 for the reentrancy support + dnl in the parser. + flex_min_version=2.5.31 + flex_version=`$FLEX_PATH --version | head -n 1 | awk '{print $2}'` + AC_MSG_CHECKING([flex version $flex_version >= $flex_min_version]) + if perl -w < \$min_version_major) || + ((\$flex_version_major == \$min_version_major) && + (\$flex_version_minor > \$min_version_minor)) || + ((\$flex_version_major == \$min_version_major) && + (\$flex_version_minor == \$min_version_minor) && + (\$flex_version_micro >= \$min_version_micro))) + ? 0 : 1); +EOF + then + AC_MSG_RESULT(yes) + else + AC_MSG_ERROR([no]) + fi +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/gst-platform.m4 gstreamer-vaapi-1.8.2/common/m4/gst-platform.m4 --- gstreamer-vaapi-0.7.0/common/m4/gst-platform.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gst-platform.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,67 @@ +dnl AG_GST_PLATFORM +dnl Check for platform specific features and define some variables +dnl +dnl GST_EXTRA_MODULE_SUFFIX: contains a platform specific +dnl extra module suffix additional to G_MODULE_SUFFIX +dnl +dnl HAVE_OSX: Defined if compiling for OS X +dnl +dnl GST_HAVE_UNSAFE_FORK: Defined if fork is unsafe (Windows) +dnl +dnl HAVE_WIN32: Defined if compiling on Win32 +dnl + +AC_DEFUN([AG_GST_PLATFORM], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + + case $host_os in + rhapsody*) + AC_DEFINE_UNQUOTED(GST_EXTRA_MODULE_SUFFIX, [".dylib"], [Extra platform specific plugin suffix]) + ;; + darwin*) + AC_DEFINE_UNQUOTED(GST_EXTRA_MODULE_SUFFIX, [".dylib"], [Extra platform specific plugin suffix]) + AC_DEFINE_UNQUOTED(HAVE_OSX, 1, [Defined if compiling for OSX]) + ;; + cygwin*) + AC_DEFINE_UNQUOTED(GST_HAVE_UNSAFE_FORK, 1, [Defined when registry scanning through fork is unsafe]) + ;; + mingw* | msvc* | mks*) + dnl HAVE_WIN32 currently means "disable POSIXisms". + AC_DEFINE_UNQUOTED(HAVE_WIN32, 1, [Defined if compiling for Windows]) + + dnl define __MSVCRT_VERSION__ version if not set already by the + dnl compiler (ie. mostly for mingw). This is needed for things like + dnl __stat64 to be available. If set by the compiler, ensure it's + dnl new enough - we need at least WinXP SP2. + AC_TRY_COMPILE([ ], [ return __MSVCRT_VERSION__; ], [ + AC_TRY_COMPILE([ ], [ + #if __MSVCRT_VERSION__ < 0x0601 + #error "MSVCRT too old" + #endif + ], [ + AC_MSG_NOTICE([MSVCRT version looks ok]) + ], [ + AC_MSG_ERROR([MSVCRT version too old, need at least WinXP SP2]) + ]) + ], [ + AC_MSG_NOTICE([Setting MSVCRT version to 0x0601]) + AC_DEFINE_UNQUOTED(__MSVCRT_VERSION__, 0x0601, [We need at least WinXP SP2 for __stat64]) + ]) + ;; + *) + ;; + esac +]) + +AC_DEFUN([AG_GST_LIBTOOL_PREPARE], +[ + dnl Persuade libtool to also link (-l) a 'pure' (DirectX) static lib, + dnl i.e. as opposed to only import lib with dll counterpart. + dnl Needs to be tweaked before libtool's checks. + case $host_os in + cygwin* | mingw*) + lt_cv_deplibs_check_method=pass_all + ;; + esac +]) \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/common/m4/gst-plugindir.m4 gstreamer-vaapi-1.8.2/common/m4/gst-plugindir.m4 --- gstreamer-vaapi-0.7.0/common/m4/gst-plugindir.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gst-plugindir.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,17 @@ +dnl AG_GST_SET_PLUGINDIR + +dnl AC_DEFINE PLUGINDIR to the full location where plug-ins will be installed +dnl AC_SUBST plugindir, to be used in Makefile.am's + +AC_DEFUN([AG_GST_SET_PLUGINDIR], +[ + dnl define location of plugin directory + AS_AC_EXPAND(PLUGINDIR, ${libdir}/gstreamer-$GST_API_VERSION) + AC_DEFINE_UNQUOTED(PLUGINDIR, "$PLUGINDIR", + [directory where plugins are located]) + AC_MSG_NOTICE([Using $PLUGINDIR as the plugin install location]) + + dnl plugin directory configure-time variable for use in Makefile.am + plugindir="\$(libdir)/gstreamer-$GST_API_VERSION" + AC_SUBST(plugindir) +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/gst-plugin-docs.m4 gstreamer-vaapi-1.8.2/common/m4/gst-plugin-docs.m4 --- gstreamer-vaapi-0.7.0/common/m4/gst-plugin-docs.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gst-plugin-docs.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,25 @@ +dnl AG_GST_PLUGIN_DOCS([MINIMUM-GTK-DOC-VERSION]) +dnl +dnl checks for prerequisites for the common/mangle-tmpl.py script +dnl used when building the plugin documentation + +AC_DEFUN([AG_GST_PLUGIN_DOCS], +[ + AC_BEFORE([GTK_DOC_CHECK],[$0])dnl check for gtk-doc first + AC_REQUIRE([AM_PATH_PYTHON])dnl find python first + + build_plugin_docs=no + AC_MSG_CHECKING([whether to build plugin documentation]) + if test x$enable_gtk_doc = xyes; then + if test x$PYTHON != x; then + build_plugin_docs=yes + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no (python not found)]) + fi + else + AC_MSG_RESULT([no (gtk-doc disabled or not available)]) + fi + + AM_CONDITIONAL(ENABLE_PLUGIN_DOCS, test x$build_plugin_docs = xyes) +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/gst-valgrind.m4 gstreamer-vaapi-1.8.2/common/m4/gst-valgrind.m4 --- gstreamer-vaapi-0.7.0/common/m4/gst-valgrind.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gst-valgrind.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,35 @@ +AC_DEFUN([AG_GST_VALGRIND_CHECK], +[ + dnl valgrind inclusion + AC_ARG_ENABLE(valgrind, + AC_HELP_STRING([--disable-valgrind], [disable run-time valgrind detection]), + [ + case "${enableval}" in + yes) USE_VALGRIND="$USE_DEBUG" ;; + no) USE_VALGRIND=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind) ;; + esac], + [ + USE_VALGRIND="$USE_DEBUG" + ]) dnl Default value + + VALGRIND_REQ="3.0" + if test "x$USE_VALGRIND" = xyes; then + PKG_CHECK_MODULES(VALGRIND, valgrind >= $VALGRIND_REQ, + USE_VALGRIND="yes", + [ + USE_VALGRIND="no" + AC_MSG_RESULT([no]) + ]) + fi + + if test "x$USE_VALGRIND" = xyes; then + AC_DEFINE(HAVE_VALGRIND, 1, [Define if valgrind should be used]) + AC_MSG_NOTICE(Using extra code paths for valgrind) + fi + AC_SUBST(VALGRIND_CFLAGS) + AC_SUBST(VALGRIND_LIBS) + + AC_PATH_PROG(VALGRIND_PATH, valgrind, no) + AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno") +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/gst-x11.m4 gstreamer-vaapi-1.8.2/common/m4/gst-x11.m4 --- gstreamer-vaapi-0.7.0/common/m4/gst-x11.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gst-x11.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,74 @@ +dnl macros for X-related detections +dnl AC_SUBST's HAVE_X, X_CFLAGS, X_LIBS +AC_DEFUN([AG_GST_CHECK_X], +[ + AC_PATH_XTRA + ac_cflags_save="$CFLAGS" + ac_cppflags_save="$CPPFLAGS" + CFLAGS="$CFLAGS $X_CFLAGS" + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + dnl now try to find the HEADER + HAVE_X="no" + AC_CHECK_HEADER([X11/Xlib.h], [ + dnl and then the library with the most uniquitous function + AC_CHECK_LIB(X11, [XSync], [HAVE_X="yes"], [], [$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS]) + ], [], [AC_INCLUDES_DEFAULT]) + + if test "x$HAVE_X" = "xno" + then + AC_MSG_NOTICE([cannot find X11 development files]) + else + dnl this is much more than we want + X_LIBS="$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS" + dnl AC_PATH_XTRA only defines the path needed to find the X libs, + dnl it does not add the libs; therefore we add them here + X_LIBS="$X_LIBS -lX11" + AC_SUBST(X_CFLAGS) + AC_SUBST(X_LIBS) + fi + AC_SUBST(HAVE_X) + + CFLAGS="$ac_cflags_save" + CPPFLAGS="$ac_cppflags_save" +]) + +dnl *** XVideo *** +dnl Look for the PIC library first, Debian requires it. +dnl Check debian-devel archives for gory details. +dnl 20020110: +dnl At the moment XFree86 doesn't distribute shared libXv due +dnl to unstable API. On many platforms you CAN NOT link a shared +dnl lib to a static non-PIC lib. This is what the xvideo GStreamer +dnl plug-in wants to do. So Debian distributes a PIC compiled +dnl version of the static lib for plug-ins to link to when it is +dnl inappropriate to link the main application to libXv directly. +dnl FIXME: add check if this platform can support linking to a +dnl non-PIC libXv, if not then don not use Xv. +dnl FIXME: perhaps warn user if they have a shared libXv since +dnl this is an error until XFree86 starts shipping one +AC_DEFUN([AG_GST_CHECK_XV], +[ + if test x$HAVE_X = xyes; then + AC_CHECK_LIB(Xv_pic, XvQueryExtension, + HAVE_XVIDEO="yes", HAVE_XVIDEO="no", + $X_LIBS -lXext) + + if test x$HAVE_XVIDEO = xyes; then + XVIDEO_LIBS="-lXv_pic -lXext" + AC_SUBST(XVIDEO_LIBS) + else + dnl try again using something else if we didn't find it first + if test x$HAVE_XVIDEO = xno; then + AC_CHECK_LIB(Xv, XvQueryExtension, + HAVE_XVIDEO="yes", HAVE_XVIDEO="no", + $X_LIBS -lXext) + + if test x$HAVE_XVIDEO = xyes; then + XVIDEO_LIBS="-lXv -lXext" + AC_SUBST(XVIDEO_LIBS) + fi + fi + fi + fi +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/gtk-doc.m4 gstreamer-vaapi-1.8.2/common/m4/gtk-doc.m4 --- gstreamer-vaapi-0.7.0/common/m4/gtk-doc.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/gtk-doc.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,70 @@ +dnl -*- mode: autoconf -*- + +# serial 1 + +dnl Usage: +dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) +AC_DEFUN([GTK_DOC_CHECK], +[ + AC_REQUIRE([PKG_PROG_PKG_CONFIG]) + AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first + AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first + + dnl check for tools we added during development + AC_PATH_PROG([GTKDOC_CHECK],[gtkdoc-check]) + AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) + AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) + + dnl for overriding the documentation installation directory + AC_ARG_WITH([html-dir], + AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, + [with_html_dir='${datadir}/gtk-doc/html']) + HTML_DIR="$with_html_dir" + AC_SUBST([HTML_DIR]) + + dnl enable/disable documentation building + AC_ARG_ENABLE([gtk-doc], + AS_HELP_STRING([--enable-gtk-doc], + [use gtk-doc to build documentation [[default=no]]]),, + [enable_gtk_doc=no]) + + if test x$enable_gtk_doc = xyes; then + ifelse([$1],[], + [PKG_CHECK_EXISTS([gtk-doc],, + AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))], + [PKG_CHECK_EXISTS([gtk-doc >= $1],, + AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))]) + dnl don't check for glib if we build glib + if test "x$PACKAGE_NAME" != "xglib"; then + dnl don't fail if someone does not have glib + PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,) + fi + dnl don't rely on sed being pulled in implicitly. Fixes Solaris build. + if test -z "$SED"; then + AC_PROG_SED + fi + fi + + AC_MSG_CHECKING([whether to build gtk-doc documentation]) + AC_MSG_RESULT($enable_gtk_doc) + + dnl enable/disable output formats + AC_ARG_ENABLE([gtk-doc-html], + AS_HELP_STRING([--enable-gtk-doc-html], + [build documentation in html format [[default=yes]]]),, + [enable_gtk_doc_html=yes]) + AC_ARG_ENABLE([gtk-doc-pdf], + AS_HELP_STRING([--enable-gtk-doc-pdf], + [build documentation in pdf format [[default=no]]]),, + [enable_gtk_doc_pdf=no]) + + if test -z "$GTKDOC_MKPDF"; then + enable_gtk_doc_pdf=no + fi + + + AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) + AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) + AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) + AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/introspection.m4 gstreamer-vaapi-1.8.2/common/m4/introspection.m4 --- gstreamer-vaapi-0.7.0/common/m4/introspection.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/introspection.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,96 @@ +dnl -*- mode: autoconf -*- +dnl Copyright 2009 Johan Dahlin +dnl +dnl This file is free software; the author(s) gives unlimited +dnl permission to copy and/or distribute it, with or without +dnl modifications, as long as this notice is preserved. +dnl + +# serial 1 + +m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL], +[ + AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first + AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first + AC_BEFORE([LT_INIT],[$0])dnl setup libtool first + + dnl enable/disable introspection + m4_if([$2], [require], + [dnl + enable_introspection=yes + ],[dnl + AC_ARG_ENABLE(introspection, + AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]], + [Enable introspection for this build]),, + [enable_introspection=auto]) + ])dnl + + AC_MSG_CHECKING([for gobject-introspection]) + + dnl presence/version checking + AS_CASE([$enable_introspection], + [no], [dnl + found_introspection="no (disabled, use --enable-introspection to enable)" + ],dnl + [yes],[dnl + PKG_CHECK_EXISTS([gobject-introspection-1.0],, + AC_MSG_ERROR([gobject-introspection-1.0 is not installed])) + PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], + found_introspection=yes, + AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME])) + ],dnl + [auto],[dnl + PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no) + ],dnl + [dnl + AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@]) + ])dnl + + AC_MSG_RESULT([$found_introspection]) + + INTROSPECTION_SCANNER= + INTROSPECTION_COMPILER= + INTROSPECTION_GENERATE= + INTROSPECTION_GIRDIR= + INTROSPECTION_TYPELIBDIR= + if test "x$found_introspection" = "xyes"; then + INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` + INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` + INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` + INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0` + INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)" + INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0` + INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0` + INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection + INTROSPECTION_INIT="extern void gst_init(gint*,gchar**); gst_init(NULL,NULL);" + fi + AC_SUBST(INTROSPECTION_SCANNER) + AC_SUBST(INTROSPECTION_COMPILER) + AC_SUBST(INTROSPECTION_GENERATE) + AC_SUBST(INTROSPECTION_GIRDIR) + AC_SUBST(INTROSPECTION_TYPELIBDIR) + AC_SUBST(INTROSPECTION_CFLAGS) + AC_SUBST(INTROSPECTION_LIBS) + AC_SUBST(INTROSPECTION_MAKEFILE) + AC_SUBST(INTROSPECTION_INIT) + + AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes") +]) + + +dnl Usage: +dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version]) + +AC_DEFUN([GOBJECT_INTROSPECTION_CHECK], +[ + _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1]) +]) + +dnl Usage: +dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version]) + + +AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE], +[ + _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require]) +]) diff -Nru gstreamer-vaapi-0.7.0/common/m4/Makefile.am gstreamer-vaapi-1.8.2/common/m4/Makefile.am --- gstreamer-vaapi-0.7.0/common/m4/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/Makefile.am 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,41 @@ +EXTRA_DIST = \ + README \ + as-ac-expand.m4 \ + as-auto-alt.m4 \ + as-compiler-flag.m4 \ + as-compiler.m4 \ + as-docbook.m4 \ + as-gcc-inline-assembly.m4 \ + as-libtool.m4 \ + as-libtool-tags.m4 \ + as-python.m4 \ + as-version.m4 \ + ax_create_stdint_h.m4 \ + ax_pthread.m4 \ + glib-gettext.m4 \ + gst-arch.m4 \ + gst-args.m4 \ + gst-check.m4 \ + gst-debuginfo.m4 \ + gst-default.m4 \ + gst-doc.m4 \ + gst-dowhile.m4 \ + gst-error.m4 \ + gst-feature.m4 \ + gst-function.m4 \ + gst-gettext.m4 \ + gst-glib2.m4 \ + gst-libxml2.m4 \ + gst-parser.m4 \ + gst-package-release-datetime.m4 \ + gst-platform.m4 \ + gst-plugindir.m4 \ + gst-plugin-docs.m4 \ + gst-valgrind.m4 \ + gst-x11.m4 \ + gst.m4 \ + gtk-doc.m4 \ + introspection.m4 \ + pkg.m4 \ + check.m4 \ + orc.m4 diff -Nru gstreamer-vaapi-0.7.0/common/m4/Makefile.in gstreamer-vaapi-1.8.2/common/m4/Makefile.in --- gstreamer-vaapi-0.7.0/common/m4/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/Makefile.in 2016-06-09 07:27:12.000000000 +0000 @@ -0,0 +1,600 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = common/m4 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-arch.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-platform.m4 \ + $(top_srcdir)/common/m4/gst-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in README +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ +DLLTOOL = @DLLTOOL@ +DLOPEN_LIBS = @DLOPEN_LIBS@ +DRM_CFLAGS = @DRM_CFLAGS@ +DRM_LIBS = @DRM_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGL_CFLAGS = @EGL_CFLAGS@ +EGL_LIBS = @EGL_LIBS@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GIT = @GIT@ +GLES2_CFLAGS = @GLES2_CFLAGS@ +GLES2_LIBS = @GLES2_LIBS@ +GLES3_CFLAGS = @GLES3_CFLAGS@ +GLES3_LIBS = @GLES3_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ +GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ +GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ +GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ +GST_API_VERSION = @GST_API_VERSION@ +GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ +GST_BASE_LIBS = @GST_BASE_LIBS@ +GST_CFLAGS = @GST_CFLAGS@ +GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ +GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ +GST_CURRENT = @GST_CURRENT@ +GST_GL_CFLAGS = @GST_GL_CFLAGS@ +GST_GL_LIBS = @GST_GL_LIBS@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ +GST_LIBS = @GST_LIBS@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PBUTILS_CFLAGS = @GST_PBUTILS_CFLAGS@ +GST_PBUTILS_LIBS = @GST_PBUTILS_LIBS@ +GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ +GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ +GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ +GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ +GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVA_CFLAGS = @LIBVA_CFLAGS@ +LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ +LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ +LIBVA_LIBS = @LIBVA_LIBS@ +LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ +LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ +LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ +LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ +WAYLAND_LIBS = @WAYLAND_LIBS@ +X11_CFLAGS = @X11_CFLAGS@ +X11_LIBS = @X11_LIBS@ +XRANDR_CFLAGS = @XRANDR_CFLAGS@ +XRANDR_LIBS = @XRANDR_LIBS@ +XRENDER_CFLAGS = @XRENDER_CFLAGS@ +XRENDER_LIBS = @XRENDER_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = \ + README \ + as-ac-expand.m4 \ + as-auto-alt.m4 \ + as-compiler-flag.m4 \ + as-compiler.m4 \ + as-docbook.m4 \ + as-gcc-inline-assembly.m4 \ + as-libtool.m4 \ + as-libtool-tags.m4 \ + as-python.m4 \ + as-version.m4 \ + ax_create_stdint_h.m4 \ + ax_pthread.m4 \ + glib-gettext.m4 \ + gst-arch.m4 \ + gst-args.m4 \ + gst-check.m4 \ + gst-debuginfo.m4 \ + gst-default.m4 \ + gst-doc.m4 \ + gst-dowhile.m4 \ + gst-error.m4 \ + gst-feature.m4 \ + gst-function.m4 \ + gst-gettext.m4 \ + gst-glib2.m4 \ + gst-libxml2.m4 \ + gst-parser.m4 \ + gst-package-release-datetime.m4 \ + gst-platform.m4 \ + gst-plugindir.m4 \ + gst-plugin-docs.m4 \ + gst-valgrind.m4 \ + gst-x11.m4 \ + gst.m4 \ + gtk-doc.m4 \ + introspection.m4 \ + pkg.m4 \ + check.m4 \ + orc.m4 + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/m4/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu common/m4/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru gstreamer-vaapi-0.7.0/common/m4/orc.m4 gstreamer-vaapi-1.8.2/common/m4/orc.m4 --- gstreamer-vaapi-0.7.0/common/m4/orc.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/orc.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,70 @@ +dnl pkg-config-based checks for Orc + +dnl specific: +dnl ORC_CHECK([REQUIRED_VERSION]) + +AC_DEFUN([ORC_CHECK], +[ + ORC_REQ=ifelse([$1], , "0.4.6", [$1]) + + AC_ARG_ENABLE(orc, + AC_HELP_STRING([--enable-orc],[use Orc if installed]), + [case "${enableval}" in + auto) enable_orc=auto ;; + yes) enable_orc=yes ;; + no) enable_orc=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-orc) ;; + esac + ], + [enable_orc=auto]) dnl Default value + + if test "x$enable_orc" != "xno" ; then + PKG_CHECK_MODULES(ORC, orc-0.4 >= $ORC_REQ, [ + AC_DEFINE(HAVE_ORC, 1, [Use Orc]) + HAVE_ORC=yes + if test "x$ORCC" = "x" ; then + AC_MSG_CHECKING(for usable orcc) + ORCC=`$PKG_CONFIG --variable=orcc orc-0.4` + dnl check whether the orcc found by pkg-config can be run from the build environment + dnl if this is not the case (e.g. when cross-compiling) fall back to orcc from PATH + AS_IF([$ORCC --version 1> /dev/null 2> /dev/null], [], [ORCC=`which orcc`]) + AC_MSG_RESULT($ORCC) + fi + AC_SUBST(ORCC) + ORCC_FLAGS="--compat $ORC_REQ" + AC_SUBST(ORCC_FLAGS) + AS_IF([test "x$ORCC" = "x"], [HAVE_ORCC=no], [HAVE_ORCC=yes]) + ], [ + if test "x$enable_orc" = "xyes" ; then + AC_MSG_ERROR([--enable-orc specified, but Orc >= $ORC_REQ not found]) + fi + AC_DEFINE(DISABLE_ORC, 1, [Disable Orc]) + HAVE_ORC=no + HAVE_ORCC=no + ]) + else + AC_DEFINE(DISABLE_ORC, 1, [Disable Orc]) + HAVE_ORC=no + HAVE_ORCC=no + fi + AM_CONDITIONAL(HAVE_ORC, [test "x$HAVE_ORC" = "xyes"]) + AM_CONDITIONAL(HAVE_ORCC, [test "x$HAVE_ORCC" = "xyes"]) + +])) + +AC_DEFUN([ORC_OUTPUT], +[ + if test "$HAVE_ORC" = yes ; then + printf "configure: *** Orc acceleration enabled.\n" + else + if test "x$enable_orc" = "xno" ; then + printf "configure: *** Orc acceleration disabled by --disable-orc. Slower code paths\n" + printf " will be used.\n" + else + printf "configure: *** Orc acceleration disabled. Requires Orc >= $ORC_REQ, which was\n" + printf " not found. Slower code paths will be used.\n" + fi + fi + printf "\n" +]) + diff -Nru gstreamer-vaapi-0.7.0/common/m4/pkg.m4 gstreamer-vaapi-1.8.2/common/m4/pkg.m4 --- gstreamer-vaapi-0.7.0/common/m4/pkg.m4 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/pkg.m4 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,157 @@ +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# 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. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$PKG_CONFIG"; then + if test -n "$$1"; then + pkg_cv_[]$1="$$1" + else + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + fi +else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [AC_MSG_RESULT([no]) + $4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES diff -Nru gstreamer-vaapi-0.7.0/common/m4/README gstreamer-vaapi-1.8.2/common/m4/README --- gstreamer-vaapi-0.7.0/common/m4/README 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/m4/README 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,3 @@ +All aclocal .m4 files we need are put here and cat'd to acinclude.m4 in +the source root. Official ones (taken from the relevant devel packages) +are named as-is, unofficial ones (or changed ones) get a gst-prefix. diff -Nru gstreamer-vaapi-0.7.0/common/Makefile.am gstreamer-vaapi-1.8.2/common/Makefile.am --- gstreamer-vaapi-0.7.0/common/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/Makefile.am 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,22 @@ +SUBDIRS = m4 + +EXTRA_DIST = \ + ChangeLog \ + gettext.patch \ + glib-gen.mak gtk-doc.mak upload-doc.mak \ + cruft.mak release.mak win32.mak po.mak \ + parallel-subdirs.mak \ + gst-autogen.sh \ + check-exports \ + c-to-xml.py mangle-db.py scangobj-merge.py \ + gtk-doc-plugins.mak \ + plugins.xsl gstdoc-scangobj \ + gst.supp check.mak \ + coverage/lcov.mak \ + coverage/coverage-report.pl \ + coverage/coverage-report.xsl \ + coverage/coverage-report-entry.pl \ + download-translations \ + extract-release-date-from-doap-file \ + gst-indent \ + orc.mak diff -Nru gstreamer-vaapi-0.7.0/common/Makefile.in gstreamer-vaapi-1.8.2/common/Makefile.in --- gstreamer-vaapi-0.7.0/common/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/Makefile.in 2016-06-09 07:27:12.000000000 +0000 @@ -0,0 +1,760 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = common +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-arch.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-platform.m4 \ + $(top_srcdir)/common/m4/gst-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in ChangeLog README +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ +DLLTOOL = @DLLTOOL@ +DLOPEN_LIBS = @DLOPEN_LIBS@ +DRM_CFLAGS = @DRM_CFLAGS@ +DRM_LIBS = @DRM_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGL_CFLAGS = @EGL_CFLAGS@ +EGL_LIBS = @EGL_LIBS@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GIT = @GIT@ +GLES2_CFLAGS = @GLES2_CFLAGS@ +GLES2_LIBS = @GLES2_LIBS@ +GLES3_CFLAGS = @GLES3_CFLAGS@ +GLES3_LIBS = @GLES3_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ +GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ +GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ +GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ +GST_API_VERSION = @GST_API_VERSION@ +GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ +GST_BASE_LIBS = @GST_BASE_LIBS@ +GST_CFLAGS = @GST_CFLAGS@ +GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ +GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ +GST_CURRENT = @GST_CURRENT@ +GST_GL_CFLAGS = @GST_GL_CFLAGS@ +GST_GL_LIBS = @GST_GL_LIBS@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ +GST_LIBS = @GST_LIBS@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PBUTILS_CFLAGS = @GST_PBUTILS_CFLAGS@ +GST_PBUTILS_LIBS = @GST_PBUTILS_LIBS@ +GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ +GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ +GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ +GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ +GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVA_CFLAGS = @LIBVA_CFLAGS@ +LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ +LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ +LIBVA_LIBS = @LIBVA_LIBS@ +LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ +LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ +LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ +LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ +WAYLAND_LIBS = @WAYLAND_LIBS@ +X11_CFLAGS = @X11_CFLAGS@ +X11_LIBS = @X11_LIBS@ +XRANDR_CFLAGS = @XRANDR_CFLAGS@ +XRANDR_LIBS = @XRANDR_LIBS@ +XRENDER_CFLAGS = @XRENDER_CFLAGS@ +XRENDER_LIBS = @XRENDER_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = m4 +EXTRA_DIST = \ + ChangeLog \ + gettext.patch \ + glib-gen.mak gtk-doc.mak upload-doc.mak \ + cruft.mak release.mak win32.mak po.mak \ + parallel-subdirs.mak \ + gst-autogen.sh \ + check-exports \ + c-to-xml.py mangle-db.py scangobj-merge.py \ + gtk-doc-plugins.mak \ + plugins.xsl gstdoc-scangobj \ + gst.supp check.mak \ + coverage/lcov.mak \ + coverage/coverage-report.pl \ + coverage/coverage-report.xsl \ + coverage/coverage-report-entry.pl \ + download-translations \ + extract-release-date-from-doap-file \ + gst-indent \ + orc.mak + +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu common/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-libtool cscopelist-am ctags \ + ctags-am distclean distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru gstreamer-vaapi-0.7.0/common/mangle-db.py gstreamer-vaapi-1.8.2/common/mangle-db.py --- gstreamer-vaapi-0.7.0/common/mangle-db.py 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/mangle-db.py 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,71 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +""" +Insert includes for the element-*-details.xml files into the related docbook +files. +""" + +from __future__ import print_function, unicode_literals + +import codecs +import glob +import os +import sys + +import xml.dom.minidom + +def patch(related, details): + try: + doc = xml.dom.minidom.parse(related) + except IOError: + return + + # find the insertion point + elem = None + for e in doc.childNodes: + if e.nodeType == e.ELEMENT_NODE and e.localName == 'refentry': + elem = e + break + if elem == None: + return + + elem2 = None + for e in elem.childNodes: + if e.nodeType == e.ELEMENT_NODE and e.localName == 'refsect1': + id = e.getAttributeNode('id') + role = e.getAttributeNode('role') + if id and id.nodeValue.endswith('.description') and role and role.nodeValue == 'desc': + elem2 = e + break + if elem2 == None: + return + + # insert include + include = doc.createElement('include') + include.setAttribute('xmlns', 'http://www.w3.org/2003/XInclude') + include.setAttribute('href', details) + fallback = doc.createElement('fallback') + fallback.setAttribute('xmlns', 'http://www.w3.org/2003/XInclude') + include.appendChild(fallback) + elem2.appendChild(include) + + # store patched file + result = codecs.open(related, mode="w", encoding="utf-8") + #result = open(related, "wb") + doc.writexml(result) + result.close() + +def main(): + if not len(sys.argv) == 2: + sys.stderr.write('Please specify the xml/ dir') + sys.exit(1) + + xmldir = sys.argv[1] + + # parse all *-details.xml files and patch includes into the corresponding + # xml files + for details in glob.glob("%s/element-*-details.xml" % xmldir): + patch (details.replace("-details", ""), os.path.basename(details)) + +main() diff -Nru gstreamer-vaapi-0.7.0/common/orc.mak gstreamer-vaapi-1.8.2/common/orc.mak --- gstreamer-vaapi-0.7.0/common/orc.mak 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/orc.mak 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,76 @@ +# +# This is a makefile.am fragment to build Orc code. +# +# Define ORC_SOURCE and then include this file, such as: +# +# ORC_SOURCE=gstadderorc +# include $(top_srcdir)/common/orc.mak +# +# This fragment will create tmp-orc.c and gstadderorc.h from +# gstadderorc.orc. +# +# When 'make dist' is run at the top level, or 'make orc-update' +# in a directory including this fragment, the generated source +# files will be copied to $(ORC_SOURCE)-dist.[ch]. These files +# should be checked in to git, since they are used if Orc is +# disabled. +# +# Note that this file defines BUILT_SOURCES, so any later usage +# of BUILT_SOURCES in the Makefile.am that includes this file +# must use '+='. +# + + +EXTRA_DIST = $(ORC_SOURCE).orc + +ORC_NODIST_SOURCES = tmp-orc.c $(ORC_SOURCE).h +BUILT_SOURCES = tmp-orc.c $(ORC_SOURCE).h + + +orc-update: tmp-orc.c $(ORC_SOURCE).h + $(top_srcdir)/common/gst-indent tmp-orc.c + cp tmp-orc.c $(srcdir)/$(ORC_SOURCE)-dist.c + cp $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE)-dist.h + +orcc_v_gen = $(orcc_v_gen_$(V)) +orcc_v_gen_ = $(orcc_v_gen_$(AM_DEFAULT_VERBOSITY)) +orcc_v_gen_0 = @echo " ORCC $@"; + +cp_v_gen = $(cp_v_gen_$(V)) +cp_v_gen_ = $(cp_v_gen_$(AM_DEFAULT_VERBOSITY)) +cp_v_gen_0 = @echo " CP $@"; + +if HAVE_ORCC +tmp-orc.c: $(srcdir)/$(ORC_SOURCE).orc + $(orcc_v_gen)$(ORCC) $(ORCC_FLAGS) --implementation --include glib.h -o tmp-orc.c $(srcdir)/$(ORC_SOURCE).orc + +$(ORC_SOURCE).h: $(srcdir)/$(ORC_SOURCE).orc + $(orcc_v_gen)$(ORCC) $(ORCC_FLAGS) --header --include glib.h -o $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE).orc +else +tmp-orc.c: $(srcdir)/$(ORC_SOURCE).orc $(srcdir)/$(ORC_SOURCE)-dist.c + $(cp_v_gen)cp $(srcdir)/$(ORC_SOURCE)-dist.c tmp-orc.c + +$(ORC_SOURCE).h: $(srcdir)/$(ORC_SOURCE).orc $(srcdir)/$(ORC_SOURCE)-dist.c + $(cp_v_gen)cp $(srcdir)/$(ORC_SOURCE)-dist.h $(ORC_SOURCE).h +endif + +clean-local: clean-orc +.PHONY: clean-orc +clean-orc: + rm -f tmp-orc.c $(ORC_SOURCE).h + +dist-hook: dist-hook-orc +.PHONY: dist-hook-orc + +# we try and copy updated orc -dist files below, but don't fail if it +# doesn't work as the srcdir might not be writable +dist-hook-orc: tmp-orc.c $(ORC_SOURCE).h + $(top_srcdir)/common/gst-indent tmp-orc.c + rm -f tmp-orc.c~ + cmp -s tmp-orc.c $(srcdir)/$(ORC_SOURCE)-dist.c || \ + cp tmp-orc.c $(srcdir)/$(ORC_SOURCE)-dist.c || true + cmp -s $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE)-dist.h || \ + cp $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE)-dist.h || true + cp -p tmp-orc.c $(distdir)/$(ORC_SOURCE)-dist.c + cp -p $(ORC_SOURCE).h $(distdir)/$(ORC_SOURCE)-dist.h + diff -Nru gstreamer-vaapi-0.7.0/common/parallel-subdirs.mak gstreamer-vaapi-1.8.2/common/parallel-subdirs.mak --- gstreamer-vaapi-0.7.0/common/parallel-subdirs.mak 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/parallel-subdirs.mak 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,13 @@ +# include this at the end of $MODULE/ext/Makefile.am to force make to +# build subdirectories in parallel when make -jN is used. We will end up +# descending into all subdirectories a second time, but only after the first +# (parallel) run has finished, so it should go right through the second time. + +.PHONY: independent-subdirs $(SUBDIRS) + +independent-subdirs: $(SUBDIRS) + +$(SUBDIRS): + $(MAKE) -C $@ + +all-recursive: independent-subdirs diff -Nru gstreamer-vaapi-0.7.0/common/plugins.xsl gstreamer-vaapi-1.8.2/common/plugins.xsl --- gstreamer-vaapi-0.7.0/common/plugins.xsl 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/plugins.xsl 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,209 @@ + + + + + + + + + + + + -plugins- + + + + + + + + + + + + + + Element Information + + + + + plugin + + + + plugin- + + + + + + + + author + + + + + + + class + + + + + + + + + + Element Pads + + + + + name + + + + + + + direction + + + + + + + presence + + + + + + + + + details + + + + + + + + + + + + + + + + + + + + + -plugins-plugin- + + + + + + 3 + FIXME Library + + + + + + + + + + plugin- + + + + + + + Plugin Information + + + + filename + + + + + + + version + + + + + + + run-time license + + + + + + + package + + + + + + + origin + + + + + + + + + + + + + + + + + + + + + + + Elements + + + + + + + + + + + + + + diff -Nru gstreamer-vaapi-0.7.0/common/po.mak gstreamer-vaapi-1.8.2/common/po.mak --- gstreamer-vaapi-0.7.0/common/po.mak 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/po.mak 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,4 @@ +# rule to download the latest .po files +download-po: $(top_srcdir)/common/download-translations + $(top_srcdir)/common/download-translations $(PACKAGE) + diff -Nru gstreamer-vaapi-0.7.0/common/README gstreamer-vaapi-1.8.2/common/README --- gstreamer-vaapi-0.7.0/common/README 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/README 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,255 @@ +GStreamer @SERIES_VERSION@ + +WHAT IT IS +---------- + +This is GStreamer, a framework for streaming media. + +WHERE TO START +-------------- + +We have a website at +http://gstreamer.freedesktop.org/ + +You should start by going through our FAQ at +http://gstreamer.freedesktop.org/data/doc/gstreamer/head/faq/html/ + +There is more documentation; go to +http://gstreamer.freedesktop.org/documentation + +You can subscribe to our mailing lists; see the website for details. + +We track bugs in GNOME's bugzilla; see the website for details. + +You can join us on IRC - #gstreamer on irc.freenode.org + +GStreamer 1.0 series +-------------------- + +Starring + + GSTREAMER + +The core around which all other modules revolve. Base functionality and +libraries, some essential elements, documentation, and testing. + + BASE + +A well-groomed and well-maintained collection of GStreamer plug-ins and +elements, spanning the range of possible types of elements one would want +to write for GStreamer. + +And introducing, for the first time ever, on the development screen ... + + THE GOOD + + --- "Such ingratitude. After all the times I've saved your life." + +A collection of plug-ins you'd want to have right next to you on the +battlefield. Shooting sharp and making no mistakes, these plug-ins have it +all: good looks, good code, and good licensing. Documented and dressed up +in tests. If you're looking for a role model to base your own plug-in on, +here it is. + +If you find a plot hole or a badly lip-synced line of code in them, +let us know - it is a matter of honour for us to ensure Blondie doesn't look +like he's been walking 100 miles through the desert without water. + + THE UGLY + + --- "When you have to shoot, shoot. Don't talk." + +There are times when the world needs a color between black and white. +Quality code to match the good's, but two-timing, backstabbing and ready to +sell your freedom down the river. These plug-ins might have a patent noose +around their neck, or a lock-up license, or any other problem that makes you +think twice about shipping them. + +We don't call them ugly because we like them less. Does a mother love her +son less because he's not as pretty as the other ones ? No - she commends +him on his great personality. These plug-ins are the life of the party. +And we'll still step in and set them straight if you report any unacceptable +behaviour - because there are two kinds of people in the world, my friend: +those with a rope around their neck and the people who do the cutting. + + THE BAD + + --- "That an accusation?" + +No perfectly groomed moustache or any amount of fine clothing is going to +cover up the truth - these plug-ins are Bad with a capital B. +They look fine on the outside, and might even appear to get the job done, but +at the end of the day they're a black sheep. Without a golden-haired angel +to watch over them, they'll probably land in an unmarked grave at the final +showdown. + +Don't bug us about their quality - exercise your Free Software rights, +patch up the offender and send us the patch on the fastest steed you can +steal from the Confederates. Because you see, in this world, there's two +kinds of people, my friend: those with loaded guns and those who dig. +You dig. + +The Lowdown +----------- + + --- "I've never seen so many plug-ins wasted so badly." + +GStreamer Plug-ins has grown so big that it's hard to separate the wheat from +the chaff. Also, distributors have brought up issues about the legal status +of some of the plug-ins we ship. To remedy this, we've divided the previous +set of available plug-ins into four modules: + +- gst-plugins-base: a small and fixed set of plug-ins, covering a wide range + of possible types of elements; these are continuously kept up-to-date + with any core changes during the development series. + + - We believe distributors can safely ship these plug-ins. + - People writing elements should base their code on these elements. + - These elements come with examples, documentation, and regression tests. + +- gst-plugins-good: a set of plug-ins that we consider to have good quality + code, correct functionality, our preferred license (LGPL for the plug-in + code, LGPL or LGPL-compatible for the supporting library). + + - We believe distributors can safely ship these plug-ins. + - People writing elements should base their code on these elements. + +- gst-plugins-ugly: a set of plug-ins that have good quality and correct + functionality, but distributing them might pose problems. The license + on either the plug-ins or the supporting libraries might not be how we'd + like. The code might be widely known to present patent problems. + + - Distributors should check if they want/can ship these plug-ins. + - People writing elements should base their code on these elements. + +- gst-plugins-bad: a set of plug-ins that aren't up to par compared to the + rest. They might be close to being good quality, but they're missing + something - be it a good code review, some documentation, a set of tests, + a real live maintainer, or some actual wide use. + If the blanks are filled in they might be upgraded to become part of + either gst-plugins-good or gst-plugins-ugly, depending on the other factors. + + - If the plug-ins break, you can't complain - instead, you can fix the + problem and send us a patch, or bribe someone into fixing them for you. + - New contributors can start here for things to work on. + +PLATFORMS +--------- + +- Linux is of course fully supported +- FreeBSD is reported to work; other BSDs should work too +- Solaris is reported to work; a specific sunaudiosink plugin has been written +- MacOSX works, binary 1.x packages can be built using the cerbero build tool +- Windows works; binary 1.x packages can be built using the cerbero build tool + - MSys/MinGW builds + - Microsoft Visual Studio builds are not yet available or supported +- Android works, binary 1.x packages can be built using the cerbero build tool +- iOS works + +INSTALLING FROM PACKAGES +------------------------ + +You should always prefer installing from packages first. GStreamer is +well-maintained for a number of distributions, including Fedora, Debian, +Ubuntu, Mandrake, Gentoo, ... + +Only in cases where you: +- want to hack on GStreamer +- want to verify that a bug has been fixed +- do not have a sane distribution +should you choose to build from source tarballs or git. + +Find more information about the various packages at +http://gstreamer.freedesktop.org/download/ + +COMPILING FROM SOURCE TARBALLS +------------------------------ + +- again, make sure that you really need to install from source ! + If GStreamer is one of your first projects ever that you build from source, + consider taking on an easier project. + +- check output of ./configure --help to see if any options apply to you +- run + ./configure + make + + to build GStreamer. +- if you want to install it (not required, but what you usually want to do), run + make install + +- try out a simple test: + gst-launch -v fakesrc num_buffers=5 ! fakesink + (If you didn't install GStreamer, prefix gst-launch with tools/) + + If it outputs a bunch of messages from fakesrc and fakesink, everything is + ok. + + If it did not work, keep in mind that you might need to adjust the + PATH and/or LD_LIBRARY_PATH environment variables to make the system + find GStreamer in the prefix where you installed (by default that is /usr/local). + +- After this, you're ready to install gst-plugins, which will provide the + functionality you're probably looking for by now, so go on and read + that README. + +COMPILING FROM GIT +------------------ + +When building from git sources, you will need to run autogen.sh to generate +the build system files. + +You will need a set of additional tools typical for building from git, +including: +- autoconf +- automake +- libtool + +autogen.sh will check for recent enough versions and complain if you don't have +them. You can also specify specific versions of automake and autoconf with +--with-automake and --with-autoconf + +Check autogen.sh options by running autogen.sh --help + +autogen.sh can pass on arguments to configure + +When you have done this once, you can use autoregen.sh to re-autogen with +the last passed options as a handy shortcut. Use it. + +After the autogen.sh stage, you can follow the directions listed in +"COMPILING FROM SOURCE" + +You can also run your whole git stack uninstalled in your home directory, +so that you can quickly test changes without affecting your system setup or +interfering with GStreamer installed from packages. Many GStreamer developers +use an uninstalled setup for their work. + +There is a 'create-uninstalled-setup.sh' script in + + http://cgit.freedesktop.org/gstreamer/gstreamer/tree/scripts/ + +to easily create an uninstalled setup from scratch. + + +PLUG-IN DEPENDENCIES AND LICENSES +--------------------------------- + +GStreamer is developed under the terms of the LGPL (see LICENSE file for +details). Some of our plug-ins however rely on libraries which are available +under other licenses. This means that if you are distributing an application +which has a non-GPL compatible license (for instance a closed-source +application) with GStreamer, you have to make sure not to distribute GPL-linked +plug-ins. + +When using GPL-linked plug-ins, GStreamer is for all practical reasons +under the GPL itself. + +HISTORY +------- + +The fundamental design comes from the video pipeline at Oregon Graduate +Institute, as well as some ideas from DirectMedia. It's based on plug-ins that +will provide the various codec and other functionality. The interface +hopefully is generic enough for various companies (ahem, Apple) to release +binary codecs for Linux, until such time as they get a clue and release the +source. diff -Nru gstreamer-vaapi-0.7.0/common/release.mak gstreamer-vaapi-1.8.2/common/release.mak --- gstreamer-vaapi-0.7.0/common/release.mak 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/release.mak 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,37 @@ +# include this snippet to add a common release: target by using +# include $(top_srcdir)/common/release.mak + +release: dist + @$(MAKE) $(PACKAGE)-$(VERSION).tar.xz.sha256sum + @echo + @echo "=================================================================================================" + @echo "http://gstreamer.freedesktop.org/src/$(PACKAGE)/$(PACKAGE)-$(VERSION).tar.xz" + @cat $(PACKAGE)-$(VERSION).tar.xz.sha256sum + @echo "=================================================================================================" + @if [ -d ~/releases/ ]; then \ + cp -v $(PACKAGE)-$(VERSION).tar.xz ~/releases/; \ + fi + @if [ -d ../www/data/src ]; then \ + mv -v $(PACKAGE)-$(VERSION).tar.xz ../www/data/src/$(PACKAGE)/ ; \ + mv -v $(PACKAGE)-$(VERSION).tar.xz.sha256sum ../www/data/src/$(PACKAGE)/ ; \ + elif [ -d ../../www/data/src ]; then \ + mv -v $(PACKAGE)-$(VERSION).tar.xz ../../www/data/src/$(PACKAGE)/ ; \ + mv -v $(PACKAGE)-$(VERSION).tar.xz.sha256sum ../../www/data/src/$(PACKAGE)/ ; \ + fi + @echo "=================================================================================================" + +# generate sha256 sum files +%.sha256sum: % + @sha256sum $< > $@ + +# check that no marshal or enumtypes files are included +# this in turn ensures that distcheck fails for missing .list files which is currently +# shadowed when the corresponding .c and .h files are included. +distcheck-hook: + @test "x" = "x`find $(distdir) -name \*-enumtypes.[ch] | grep -v win32`" && \ + test "x" = "x`find $(distdir) -name \*-marshal.[ch]`" || \ + ( echo "*** Leftover enumtypes or marshal files in the tarball." && \ + echo "*** Make sure the following files are not disted:" && \ + find $(distdir) -name \*-enumtypes.[ch] | grep -v win32 && \ + find $(distdir) -name \*-marshal.[ch] && \ + false ) diff -Nru gstreamer-vaapi-0.7.0/common/scangobj-merge.py gstreamer-vaapi-1.8.2/common/scangobj-merge.py --- gstreamer-vaapi-0.7.0/common/scangobj-merge.py 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/scangobj-merge.py 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,314 @@ +#!/usr/bin/python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +""" +parse, merge and write gstdoc-scanobj files +""" + +from __future__ import print_function, unicode_literals + +import codecs +import os +import sys + +def debug(*args): + pass + +# OrderedDict class based on +# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/107747 +# Licensed under the Python License +class OrderedDict(dict): + def __init__(self): + self._keys = [] + dict.__init__(self) + + def __delitem__(self, key): + dict.__delitem__(self, key) + self._keys.remove(key) + + def __setitem__(self, key, item): + dict.__setitem__(self, key, item) + if key not in self._keys: self._keys.append(key) + + def clear(self): + dict.clear(self) + self._keys = [] + + def copy(self): + dict = dict.copy(self) + dict._keys = self._keys[:] + return dict + + def items(self): + return zip(self._keys, self.values()) + + def keys(self): + return self._keys + + def popitem(self): + try: + key = self._keys[-1] + except IndexError: + raise KeyError('dictionary is empty') + + val = self[key] + del self[key] + + return (key, val) + + def setdefault(self, key, failobj = None): + dict.setdefault(self, key, failobj) + if key not in self._keys: self._keys.append(key) + + def update(self, dict): + dict.update(self, dict) + for key in dict.keys(): + if key not in self._keys: self._keys.append(key) + + def values(self): + return map(self.get, self._keys) + +class Object: + def __init__(self, name): + self._signals = OrderedDict() + self._args = OrderedDict() + self.name = name + + def __repr__(self): + return "" % self.name + + def add_signal(self, signal, overwrite=True): + if not overwrite and signal.name in self._signals: + raise IndexError("signal %s already in %r" % (signal.name, self)) + self._signals[signal.name] = signal + + def add_arg(self, arg, overwrite=True): + if not overwrite and arg.name in self._args: + raise IndexError("arg %s already in %r" % (arg.name, self)) + self._args[arg.name] = arg + +class Docable: + def __init__(self, **kwargs): + for key in self.attrs: + setattr(self, key, kwargs[key]) + self.dict = kwargs + + def __repr__(self): + return "<%r %s>" % (str(self.__class__), self.name) + +class Signal(Docable): + attrs = ['name', 'returns', 'args'] + +class Arg(Docable): + attrs = ['name', 'type', 'range', 'flags', 'nick', 'blurb', 'default'] + +class GDoc: + def load_file(self, filename): + try: + lines = codecs.open(filename, encoding='utf-8').readlines() + self.load_data("".join(lines)) + except IOError: + print ("WARNING - could not read from %s" % filename) + except UnicodeDecodeError as e: + print ("WARNING - could not parse %s: %s" % (filename, e)) + + def save_file(self, filename, backup=False): + """ + Save the information to the given file if the file content changed. + """ + olddata = None + try: + lines = codecs.open(filename, encoding='utf-8').readlines() + olddata = "".join(lines) + except IOError: + print ("WARNING - could not read from %s" % filename) + newdata = self.get_data() + if olddata and olddata == newdata: + return + + if olddata: + if backup: + os.rename(filename, filename + '.bak') + + handle = codecs.open(filename, "w", encoding='utf-8') + handle.write(newdata) + handle.close() + +class Signals(GDoc): + def __init__(self): + self._objects = OrderedDict() + + def load_data(self, data): + """ + Load the .signals lines, creating our list of objects and signals. + """ + import re + smatcher = re.compile( + '(?s)' # make . match \n + '\n(.*?)\n' + ) + nmatcher = re.compile( + '' + '(?P\S*)' # store object + '::' + '(?P\S*)' # store signal + '' + ) + rmatcher = re.compile( + '(?s)' # make . match \n + '(?P\S*)\n' # store returns + '(?P.*)' # store args + ) + for block in smatcher.findall(data): + nmatch = nmatcher.search(block) + if nmatch: + o = nmatch.group('object') + debug("Found object", o) + debug("Found signal", nmatch.group('signal')) + if o not in self._objects: + object = Object(o) + self._objects[o] = object + + rmatch = rmatcher.search(block) + if rmatch: + dict = rmatch.groupdict().copy() + dict['name'] = nmatch.group('signal') + signal = Signal(**dict) + self._objects[o].add_signal(signal) + + def get_data(self): + lines = [] + for o in self._objects.values(): + for s in o._signals.values(): + block = """ +%(object)s::%(name)s +%(returns)s +%(args)s +""" + d = s.dict.copy() + d['object'] = o.name + lines.append(block % d) + + return "\n".join(lines) + '\n' + +class Args(GDoc): + def __init__(self): + self._objects = OrderedDict() + + def load_data(self, data): + """ + Load the .args lines, creating our list of objects and args. + """ + import re + amatcher = re.compile( + '(?s)' # make . match \n + '\n(.*?)\n' + ) + nmatcher = re.compile( + '' + '(?P\S*)' # store object + '::' + '(?P\S*)' # store arg + '' + ) + rmatcher = re.compile( + '(?s)' # make . match \n + '(?P\S*)\n' # store type + '(?P.*?)\n' # store range + '(?P\S*)\n' # store flags + '(?P.*?)\n' # store nick + '(?P.*?)\n' # store blurb + '(?P.*?)\n' # store default + ) + for block in amatcher.findall(data): + nmatch = nmatcher.search(block) + if nmatch: + o = nmatch.group('object') + debug("Found object", o) + debug("Found arg", nmatch.group('arg')) + if o not in self._objects: + object = Object(o) + self._objects[o] = object + + rmatch = rmatcher.search(block) + if rmatch: + dict = rmatch.groupdict().copy() + dict['name'] = nmatch.group('arg') + arg = Arg(**dict) + self._objects[o].add_arg(arg) + else: + print ("ERROR: could not match arg from block %s" % block) + + def get_data(self): + lines = [] + for o in self._objects.values(): + for a in o._args.values(): + block = """ +%(object)s::%(name)s +%(type)s +%(range)s +%(flags)s +%(nick)s +%(blurb)s +%(default)s + +""" + d = a.dict.copy() + d['object'] = o.name + lines.append(block % d) + + return "\n".join(lines) + '\n' + +class SingleLine(GDoc): + def __init__(self): + self._objects = [] + + def load_data(self, data): + """ + Load the .interfaces/.prerequisites lines, merge duplicates + """ + # split data on '\n' + lines = data.splitlines(); + # merge them into self._objects + for line in lines: + if line not in self._objects: + self._objects.append(line) + + def get_data(self): + lines = sorted(self._objects) + return "\n".join(lines) + '\n' + +def main(argv): + modulename = None + try: + modulename = argv[1] + except IndexError: + sys.stderr.write('Please provide a documentation module name\n') + sys.exit(1) + + signals = Signals() + signals.load_file(modulename + '.signals') + signals.load_file(modulename + '.signals.new') + signals.save_file(modulename + '.signals', backup=True) + os.unlink(modulename + '.signals.new') + + args = Args() + args.load_file(modulename + '.args') + args.load_file(modulename + '.args.new') + args.save_file(modulename + '.args', backup=True) + os.unlink(modulename + '.args.new') + + ifaces = SingleLine() + ifaces.load_file(modulename + '.interfaces') + ifaces.load_file(modulename + '.interfaces.new') + ifaces.save_file(modulename + '.interfaces', backup=True) + os.unlink(modulename + '.interfaces.new') + + prereq = SingleLine() + prereq.load_file(modulename + '.prerequisites') + prereq.load_file(modulename + '.prerequisites.new') + prereq.save_file(modulename + '.prerequisites', backup=True) + os.unlink(modulename + '.prerequisites.new') + +main(sys.argv) diff -Nru gstreamer-vaapi-0.7.0/common/upload-doc.mak gstreamer-vaapi-1.8.2/common/upload-doc.mak --- gstreamer-vaapi-0.7.0/common/upload-doc.mak 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/upload-doc.mak 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,64 @@ +# this snippet is to be included by both our docbook manuals +# and gtk-doc API references + +# it adds an upload target to each of these dir's Makefiles + +# each Makefile.am should define the following variables: +# - DOC: the base name of the documentation +# (faq, manual, pwg, gstreamer, gstreamer-libs) +# - FORMATS: the formats in which DOC is output +# (html ps pdf) + +# if you want to use it, make sure your $HOME/.ssh/config file contains the +# correct User entry for the Host entry for the DOC_SERVER + +# these variables define the location of the online docs +DOC_SERVER = gstreamer.freedesktop.org +DOC_BASE = /srv/gstreamer.freedesktop.org/www/data/doc +DOC_URL = $(DOC_SERVER):$(DOC_BASE) + +upload: $(FORMATS) + @if echo $(FORMATS) | grep html > /dev/null; then \ + echo "Preparing docs for upload (rebasing cross-references) ..." ; \ + if test x$(builddir) != x$(srcdir); then \ + echo "make upload can only be used if srcdir == builddir"; \ + exit 1; \ + fi; \ + # gtkdoc-rebase sometimes gets confused, so reset everything to \ + # local links before rebasing to online links \ + gtkdoc-rebase --html-dir=$(builddir)/html 2>/dev/null 2>/dev/null ; \ + rebase=`gtkdoc-rebase --verbose --online --html-dir=$(builddir)/html` ; \ + echo "$$rebase" | grep -e "On-*line"; \ + for req in glib gobject gstreamer gstreamer-libs gst-plugins-base-libs; do \ + if ! ( echo "$$rebase" | grep -i -e "On-*line.*/$$req/" ); then \ + echo "===============================================================================" ; \ + echo " Could not determine online location for $$req docs. Cross-referencing will be " ; \ + echo " broken, so not uploading. Make sure the library's gtk-doc documentation is " ; \ + echo " installed somewhere in /usr/share/gtk-doc. " ; \ + echo "===============================================================================" ; \ + exit 1; \ + fi; \ + done; \ + export SRC="$$SRC html"; \ + fi; \ + if echo $(FORMATS) | grep ps > /dev/null; then export SRC="$$SRC $(DOC).ps"; fi; \ + if echo $(FORMATS) | grep pdf > /dev/null; then export SRC="$$SRC $(DOC).pdf"; fi; \ + \ + # upload releases to both X.Y/ and head/ subdirectories \ + export DIR=$(DOC_BASE)/gstreamer/$(PACKAGE_VERSION_MAJOR).$(PACKAGE_VERSION_MINOR)/$(DOC); \ + echo Uploading $$SRC to $(DOC_SERVER):$$DIR; \ + ssh $(DOC_SERVER) mkdir -p $$DIR; \ + rsync -rv -e ssh --delete $$SRC $(DOC_SERVER):$$DIR; \ + ssh $(DOC_SERVER) chmod -R g+w $$DIR; \ + \ + export DIR=$(DOC_BASE)/gstreamer/head/$(DOC); \ + echo Uploading $$SRC to $(DOC_SERVER):$$DIR; \ + ssh $(DOC_SERVER) mkdir -p $$DIR; \ + rsync -rv -e ssh --delete $$SRC $(DOC_SERVER):$$DIR; \ + ssh $(DOC_SERVER) chmod -R g+w $$DIR; \ + \ + if echo $(FORMATS) | grep html > /dev/null; then \ + echo "Un-preparing docs for upload (rebasing cross-references) ..." ; \ + gtkdoc-rebase --html-dir=$(builddir)/html ; \ + fi; \ + echo Done diff -Nru gstreamer-vaapi-0.7.0/common/win32.mak gstreamer-vaapi-1.8.2/common/win32.mak --- gstreamer-vaapi-0.7.0/common/win32.mak 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/common/win32.mak 2016-03-24 11:56:27.000000000 +0000 @@ -0,0 +1,81 @@ +# various tests to make sure we dist the win32 stuff (for MSVC builds) right + +# the MANIFEST contains all win32 related files that should be disted +win32 = $(shell cat $(top_srcdir)/win32/MANIFEST) + +# wildcard is apparently not portable to other makes, hence the use of find +# these are library .def files with the symbols to export +win32defs = $(shell find $(top_srcdir)/win32/common -name '*.def') + +# wildcard is apparently not portable to other makes, hence the use of find +# these are files that need to be disted with CRLF line endings: +win32crlf = $(shell find $(top_srcdir)/win32 -name '*.dsw' -o -name '*.dsp') + +win32-debug: + @echo; \ + echo win32 = $(win32); \ + echo; \ + echo win32defs = $(win32defs); \ + echo; \ + echo win32crlf = $(win32crlf); \ + echo + +win32-check-crlf: + @echo Checking win32 files for CR LF line endings ...; \ + fail=0 ; \ + for each in $(win32crlf) ; do \ + result=`perl -e 'print grep(/\r\n/,<>)' "$$each" | wc -l`; \ + if test "$$result" = 0 ; then \ + echo $$each must be fixed to have CRLF line endings ; \ + fail=1; \ + fi ; \ + done ; \ + exit $$fail + +# make sure all symbols we export on linux are defined in the win32 .def too +# (don't care about other unixes for now, it's enough if it works on one of +# the linux build bots; we assume .so ) +check-exports: + @fail=0 ; \ + for l in $(win32defs); do \ + libbase=`basename "$$l" ".def"`; \ + libso=`find "$(top_builddir)" -name "$$libbase-@GST_API_VERSION@.so" | grep -v /_build/ | head -n1`; \ + libdef="$(top_srcdir)/win32/common/$$libbase.def"; \ + if test "x$$libso" != "x"; then \ + echo Checking symbols in $$libso; \ + if ! ($(top_srcdir)/common/check-exports $$libdef $$libso) ; then \ + echo "$$libdef"; \ + if test "$$libbase" != "libgstgl"; then \ + fail=1; \ + fi; \ + fi; \ + fi; \ + done ; \ + if test $$fail != 0; then \ + echo '-----------------------------------------------------------'; \ + echo 'Run this to update the .def files:'; \ + echo 'make update-exports'; \ + echo '-----------------------------------------------------------'; \ + fi; \ + exit $$fail + +update-exports: + make check-exports 2>&1 | patch -p1 + git add win32/common/libgst*.def + git diff --cached -- win32/common/ + echo '^^^--- updated and staged changes above' + +# complain about nonportable printf format strings (%lld, %llu, %zu etc.) +check-nonportable-print-format: + @fail=0 ; \ + loc=`find "$(top_srcdir)" -name '*.c' | xargs grep -n -e '%[0-9]*ll[udx]' -e '%[0-9]*z[udx]'`; \ + if test "x$$loc" != "x"; then \ + echo "Please fix the following print format strings:" ; \ + find "$(top_srcdir)" -name '*.c' | xargs grep -n -e '%[0-9]*ll[udx]' -e '%[0-9]*z[udx]'; \ + fail=1; \ + fi; \ + exit $$fail + +dist-hook: check-exports win32-check-crlf + + diff -Nru gstreamer-vaapi-0.7.0/config.h.in gstreamer-vaapi-1.8.2/config.h.in --- gstreamer-vaapi-0.7.0/config.h.in 2015-12-07 10:54:23.000000000 +0000 +++ gstreamer-vaapi-1.8.2/config.h.in 2016-06-09 07:27:12.000000000 +0000 @@ -1,14 +1,83 @@ /* config.h.in. Generated from configure.ac by autoheader. */ +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + +/* The GIO library directory. */ +#undef GIO_LIBDIR + +/* The GIO modules directory. */ +#undef GIO_MODULE_DIR + +/* The GIO install prefix. */ +#undef GIO_PREFIX + +/* GStreamer API Version */ +#undef GST_API_VERSION + /* Defined to the string representation of GStreamer version */ #undef GST_API_VERSION_S -/* Defined to the string representation of GStreamer API version */ -#undef GST_PKG_VERSION_S +/* Define if extra runtime checks should be enabled */ +#undef GST_ENABLE_EXTRA_CHECKS + +/* Default errorlevel to use */ +#undef GST_LEVEL_DEFAULT + +/* GStreamer package release date/time for plugins as YYYY-MM-DD */ +#undef GST_PACKAGE_RELEASE_DATETIME /* Defined to the string representation of gstreamer-vaapi major version */ #undef GST_VAAPI_MAJOR_VERSION_S +/* Define if the target CPU is AARCH64 */ +#undef HAVE_CPU_AARCH64 + +/* Define if the target CPU is an Alpha */ +#undef HAVE_CPU_ALPHA + +/* Define if the target CPU is an ARC */ +#undef HAVE_CPU_ARC + +/* Define if the target CPU is an ARM */ +#undef HAVE_CPU_ARM + +/* Define if the target CPU is a CRIS */ +#undef HAVE_CPU_CRIS + +/* Define if the target CPU is a CRISv32 */ +#undef HAVE_CPU_CRISV32 + +/* Define if the target CPU is a HPPA */ +#undef HAVE_CPU_HPPA + +/* Define if the target CPU is an x86 */ +#undef HAVE_CPU_I386 + +/* Define if the target CPU is a IA64 */ +#undef HAVE_CPU_IA64 + +/* Define if the target CPU is a M68K */ +#undef HAVE_CPU_M68K + +/* Define if the target CPU is a MIPS */ +#undef HAVE_CPU_MIPS + +/* Define if the target CPU is a PowerPC */ +#undef HAVE_CPU_PPC + +/* Define if the target CPU is a 64 bit PowerPC */ +#undef HAVE_CPU_PPC64 + +/* Define if the target CPU is a S390 */ +#undef HAVE_CPU_S390 + +/* Define if the target CPU is a SPARC */ +#undef HAVE_CPU_SPARC + +/* Define if the target CPU is a x86_64 */ +#undef HAVE_CPU_X86_64 + /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H @@ -45,12 +114,21 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have the `EGL' library (-lEGL). */ +#undef HAVE_LIBEGL + +/* Define to 1 if you have the `GL' library (-lGL). */ +#undef HAVE_LIBGL + /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H +/* Define if RDTSC is available */ +#undef HAVE_RDTSC + /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H @@ -132,8 +210,13 @@ /* Defined to 1 if the XRender extension exists. */ #undef HAVE_XRENDER -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ +/* the host CPU */ +#undef HOST_CPU + +/* library dir */ +#undef LIBDIR + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ @@ -157,9 +240,15 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION +/* directory where plugins are located */ +#undef PLUGINDIR + /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* the target CPU */ +#undef TARGET_CPU + /* Defined to 1 if DRM is enabled */ #undef USE_DRM @@ -210,3 +299,15 @@ /* Version number of package */ #undef VERSION + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif diff -Nru gstreamer-vaapi-0.7.0/configure gstreamer-vaapi-1.8.2/configure --- gstreamer-vaapi-0.7.0/configure 2015-12-07 10:54:23.000000000 +0000 +++ gstreamer-vaapi-1.8.2/configure 2016-06-09 07:27:11.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for gst_vaapi 0.7.0. +# Generated by GNU Autoconf 2.69 for GStreamer VA-API Plug-ins 1.8.2. # -# Report bugs to . +# Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -275,11 +275,11 @@ $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: gwenole.beauchesne@intel.com, -$0: sreerenj.balachandran@intel.com about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." +$0: http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer +$0: about your system, including any error possibly output +$0: before this message. Then install a modern shell, or +$0: manually run the script under such a shell if you do +$0: have one." fi exit 1 fi @@ -567,66 +567,6 @@ SHELL=${CONFIG_SHELL-/bin/sh} -as_awk_strverscmp=' - # Use only awk features that work with 7th edition Unix awk (1978). - # My, what an old awk you have, Mr. Solaris! - END { - while (length(v1) && length(v2)) { - # Set d1 to be the next thing to compare from v1, and likewise for d2. - # Normally this is a single character, but if v1 and v2 contain digits, - # compare them as integers and fractions as strverscmp does. - if (v1 ~ /^[0-9]/ && v2 ~ /^[0-9]/) { - # Split v1 and v2 into their leading digit string components d1 and d2, - # and advance v1 and v2 past the leading digit strings. - for (len1 = 1; substr(v1, len1 + 1) ~ /^[0-9]/; len1++) continue - for (len2 = 1; substr(v2, len2 + 1) ~ /^[0-9]/; len2++) continue - d1 = substr(v1, 1, len1); v1 = substr(v1, len1 + 1) - d2 = substr(v2, 1, len2); v2 = substr(v2, len2 + 1) - if (d1 ~ /^0/) { - if (d2 ~ /^0/) { - # Compare two fractions. - while (d1 ~ /^0/ && d2 ~ /^0/) { - d1 = substr(d1, 2); len1-- - d2 = substr(d2, 2); len2-- - } - if (len1 != len2 && ! (len1 && len2 && substr(d1, 1, 1) == substr(d2, 1, 1))) { - # The two components differ in length, and the common prefix - # contains only leading zeros. Consider the longer to be less. - d1 = -len1 - d2 = -len2 - } else { - # Otherwise, compare as strings. - d1 = "x" d1 - d2 = "x" d2 - } - } else { - # A fraction is less than an integer. - exit 1 - } - } else { - if (d2 ~ /^0/) { - # An integer is greater than a fraction. - exit 2 - } else { - # Compare two integers. - d1 += 0 - d2 += 0 - } - } - } else { - # The normal case, without worrying about digits. - d1 = substr(v1, 1, 1); v1 = substr(v1, 2) - d2 = substr(v2, 1, 1); v2 = substr(v2, 2) - } - if (d1 < d2) exit 1 - if (d1 > d2) exit 2 - } - # Beware Solaris /usr/xgp4/bin/awk (at least through Solaris 10), - # which mishandles some comparisons of empty strings to integers. - if (length(v2)) exit 1 - if (length(v1)) exit 2 - } -' test -n "$DJDIR" || exec 7<&0 &1 @@ -649,11 +589,11 @@ MAKEFLAGS= # Identity of this package. -PACKAGE_NAME='gst_vaapi' +PACKAGE_NAME='GStreamer VA-API Plug-ins' PACKAGE_TARNAME='gstreamer-vaapi' -PACKAGE_VERSION='0.7.0' -PACKAGE_STRING='gst_vaapi 0.7.0' -PACKAGE_BUGREPORT='gwenole.beauchesne@intel.com, sreerenj.balachandran@intel.com' +PACKAGE_VERSION='1.8.2' +PACKAGE_STRING='GStreamer VA-API Plug-ins 1.8.2' +PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer' PACKAGE_URL='' ac_unique_file="Makefile.am" @@ -697,7 +637,6 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS -pkgconfigdir USE_WAYLAND_FALSE USE_WAYLAND_TRUE USE_EGL_FALSE @@ -726,19 +665,25 @@ USE_JPEG_ENCODER_TRUE USE_ENCODERS_FALSE USE_ENCODERS_TRUE +GST_PLUGIN_LDFLAGS +GST_LIB_LDFLAGS +GST_ALL_LDFLAGS +GST_OPTION_CFLAGS +DEPRECATED_CFLAGS +PROFILE_CFLAGS +GST_LEVEL_DEFAULT +ERROR_CFLAGS +WARNING_CFLAGS LIBVA_WAYLAND_LIBS LIBVA_WAYLAND_CFLAGS -LIBVA_X11_PKGNAME LIBVA_X11_LIBS LIBVA_X11_CFLAGS LIBVA_DRM_LIBS LIBVA_DRM_CFLAGS -LIBVA_PKGNAME LIBVA_LIBS LIBVA_CFLAGS WAYLAND_LIBS WAYLAND_CFLAGS -GMODULE_VERSION_REQUIRED GMODULE_LIBS GMODULE_CFLAGS EGL_LIBS @@ -755,69 +700,54 @@ XRANDR_CFLAGS X11_LIBS X11_CFLAGS -UDEV_LIBS -UDEV_CFLAGS DRM_LIBS DRM_CFLAGS -plugindir -GST_PLUGIN_PATH_1_0 -GST_PLUGIN_LDFLAGS -GST_ALL_LDFLAGS -GST_VAAPI_LT_LDFLAGS -GST_VAAPI_LT_VERSION -GST_VAAPI_MAJOR_VERSION USE_GST_GL_HELPERS_FALSE USE_GST_GL_HELPERS_TRUE GST_GL_LIBS GST_GL_CFLAGS -USE_LOCAL_VIDEO_PARSERS_FALSE -USE_LOCAL_VIDEO_PARSERS_TRUE -USE_LOCAL_CODEC_PARSERS_H265_FALSE -USE_LOCAL_CODEC_PARSERS_H265_TRUE -USE_LOCAL_CODEC_PARSERS_VP9_FALSE -USE_LOCAL_CODEC_PARSERS_VP9_TRUE -USE_BUILTIN_LIBVPX_FALSE -USE_BUILTIN_LIBVPX_TRUE -USE_LOCAL_CODEC_PARSERS_VP8_FALSE -USE_LOCAL_CODEC_PARSERS_VP8_TRUE -USE_LOCAL_CODEC_PARSERS_JPEG_FALSE -USE_LOCAL_CODEC_PARSERS_JPEG_TRUE -USE_LOCAL_CODEC_PARSERS_H264_FALSE -USE_LOCAL_CODEC_PARSERS_H264_TRUE -USE_LOCAL_CODEC_PARSERS_MPEG2_FALSE -USE_LOCAL_CODEC_PARSERS_MPEG2_TRUE GST_CODEC_PARSERS_LIBS GST_CODEC_PARSERS_CFLAGS -GST_BASEVIDEO_LIBS -GST_BASEVIDEO_CFLAGS +GST_PBUTILS_LIBS +GST_PBUTILS_CFLAGS GST_VIDEO_LIBS GST_VIDEO_CFLAGS GST_ALLOCATORS_LIBS GST_ALLOCATORS_CFLAGS -GST_INTERFACES_LIBS -GST_INTERFACES_CFLAGS +GSTPB_PLUGINS_DIR +GST_PLUGINS_BASE_DIR GST_PLUGINS_BASE_LIBS GST_PLUGINS_BASE_CFLAGS GST_BASE_LIBS GST_BASE_CFLAGS +GST_PLUGINS_DIR +GST_TOOLS_DIR GST_LIBS GST_CFLAGS -GST_PKG_VERSION -USE_GST_API_1_4p_FALSE -USE_GST_API_1_4p_TRUE -USE_GST_API_1_2p_FALSE -USE_GST_API_1_2p_TRUE -GST_PLUGINS_BAD_VERSION_REQUIRED -GST_PLUGINS_BASE_VERSION_REQUIRED -GST_VERSION_REQUIRED -GST_API_VERSION -DLOPEN_LIBS -GLIB_VERSION_REQUIRED +GIO_LDFLAGS +GIO_LIBS +GIO_CFLAGS +GLIB_EXTRA_CFLAGS +GLIB_MKENUMS +GLIB_GENMARSHAL GLIB_LIBS GLIB_CFLAGS -GTKDOC_VERSION -GTK_DOC_USE_REBASE_FALSE -GTK_DOC_USE_REBASE_TRUE +GLIB_REQ +plugindir +PLUGINDIR +LIBDIR +DLOPEN_LIBS +ENABLE_PLUGIN_DOCS_FALSE +ENABLE_PLUGIN_DOCS_TRUE +pkgpyexecdir +pyexecdir +pkgpythondir +pythondir +PYTHON_PLATFORM +PYTHON_EXEC_PREFIX +PYTHON_PREFIX +PYTHON_VERSION +PYTHON GTK_DOC_USE_LIBTOOL_FALSE GTK_DOC_USE_LIBTOOL_TRUE GTK_DOC_BUILD_PDF_FALSE @@ -826,21 +756,49 @@ GTK_DOC_BUILD_HTML_TRUE ENABLE_GTK_DOC_FALSE ENABLE_GTK_DOC_TRUE -HAVE_GTK_DOC_FALSE -HAVE_GTK_DOC_TRUE GTKDOC_DEPS_LIBS GTKDOC_DEPS_CFLAGS HTML_DIR GTKDOC_MKPDF GTKDOC_REBASE -GTKDOC_CHECK_PATH GTKDOC_CHECK -PKG_CONFIG_LIBDIR -PKG_CONFIG_PATH PKG_CONFIG -PATCH -YASM +HAVE_GIT_FALSE +HAVE_GIT_TRUE +GIT +HAVE_CPU_CRISV32_FALSE +HAVE_CPU_CRISV32_TRUE +HAVE_CPU_CRIS_FALSE +HAVE_CPU_CRIS_TRUE +HAVE_CPU_X86_64_FALSE +HAVE_CPU_X86_64_TRUE +HAVE_CPU_M68K_FALSE +HAVE_CPU_M68K_TRUE +HAVE_CPU_IA64_FALSE +HAVE_CPU_IA64_TRUE +HAVE_CPU_S390_FALSE +HAVE_CPU_S390_TRUE +HAVE_CPU_MIPS_FALSE +HAVE_CPU_MIPS_TRUE +HAVE_CPU_HPPA_FALSE +HAVE_CPU_HPPA_TRUE +HAVE_CPU_SPARC_FALSE +HAVE_CPU_SPARC_TRUE +HAVE_CPU_ARM_FALSE +HAVE_CPU_ARM_TRUE +HAVE_CPU_ARC_FALSE +HAVE_CPU_ARC_TRUE +HAVE_CPU_ALPHA_FALSE +HAVE_CPU_ALPHA_TRUE +HAVE_CPU_PPC64_FALSE +HAVE_CPU_PPC64_TRUE +HAVE_CPU_PPC_FALSE +HAVE_CPU_PPC_TRUE +HAVE_CPU_I386_FALSE +HAVE_CPU_I386_TRUE +ACLOCAL_AMFLAGS CPP +LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO @@ -850,8 +808,6 @@ RANLIB ac_ct_AR AR -DLLTOOL -OBJDUMP LN_S NM ac_ct_DUMPBIN @@ -861,10 +817,6 @@ EGREP GREP SED -LIBTOOL -HAVE_GIT_FALSE -HAVE_GIT_TRUE -GIT am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE @@ -882,9 +834,24 @@ LDFLAGS CFLAGS CC -WAYLAND_API_VERSION -LIBVA_PACKAGE_VERSION -TODAY +LIBTOOL +OBJDUMP +DLLTOOL +AS +GST_LT_LDFLAGS +GST_LIBVERSION +GST_AGE +GST_REVISION +GST_CURRENT +GST_API_VERSION +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +PACKAGE_VERSION_RELEASE +PACKAGE_VERSION_NANO +PACKAGE_VERSION_MICRO +PACKAGE_VERSION_MINOR +PACKAGE_VERSION_MAJOR AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V @@ -943,6 +910,7 @@ docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -966,17 +934,24 @@ ac_user_opts=' enable_option_checking enable_silent_rules -enable_dependency_tracking -enable_shared +enable_maintainer_mode enable_static +enable_shared with_pic enable_fast_install +with_aix_soname +enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock -enable_builtin_videoparsers -enable_builtin_codecparsers -enable_builtin_libvpx +with_autoconf +with_autoheader +with_automake +with_aclocal +enable_fatal_warnings +enable_extra_check +enable_debug +with_pkg_config_path enable_encoders enable_drm enable_x11 @@ -988,6 +963,8 @@ enable_gtk_doc enable_gtk_doc_html enable_gtk_doc_pdf +enable_gobject_cast_checks +enable_glib_asserts ' ac_precious_vars='build_alias host_alias @@ -997,40 +974,34 @@ LDFLAGS LIBS CPPFLAGS -GIT +LT_SYS_LIBRARY_PATH CPP -YASM -PATCH PKG_CONFIG -PKG_CONFIG_PATH -PKG_CONFIG_LIBDIR GTKDOC_DEPS_CFLAGS GTKDOC_DEPS_LIBS +PYTHON GLIB_CFLAGS GLIB_LIBS +GIO_CFLAGS +GIO_LIBS GST_CFLAGS GST_LIBS GST_BASE_CFLAGS GST_BASE_LIBS GST_PLUGINS_BASE_CFLAGS GST_PLUGINS_BASE_LIBS -GST_INTERFACES_CFLAGS -GST_INTERFACES_LIBS GST_ALLOCATORS_CFLAGS GST_ALLOCATORS_LIBS GST_VIDEO_CFLAGS GST_VIDEO_LIBS -GST_BASEVIDEO_CFLAGS -GST_BASEVIDEO_LIBS +GST_PBUTILS_CFLAGS +GST_PBUTILS_LIBS GST_CODEC_PARSERS_CFLAGS GST_CODEC_PARSERS_LIBS GST_GL_CFLAGS GST_GL_LIBS -GST_PLUGIN_PATH_1_0 DRM_CFLAGS DRM_LIBS -UDEV_CFLAGS -UDEV_LIBS X11_CFLAGS X11_LIBS XRANDR_CFLAGS @@ -1095,6 +1066,7 @@ sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1347,6 +1319,15 @@ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1484,7 +1465,7 @@ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1597,7 +1578,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures gst_vaapi 0.7.0 to adapt to many kinds of systems. +\`configure' configures GStreamer VA-API Plug-ins 1.8.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1637,6 +1618,7 @@ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1668,7 +1650,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of gst_vaapi 0.7.0:";; + short | recursive ) echo "Configuration of GStreamer VA-API Plug-ins 1.8.2:";; esac cat <<\_ACEOF @@ -1678,20 +1660,22 @@ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") + --disable-maintainer-mode + disable make rules and dependencies not useful (and + sometimes confusing) to the casual installer + --enable-static[=PKGS] build static libraries [default=no] + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build - --enable-shared[=PKGS] build shared libraries [default=yes] - --enable-static[=PKGS] build static libraries [default=yes] - --enable-fast-install[=PKGS] - optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) - --enable-builtin-videoparsers - enable built-in videoparsers [default=yes] - --enable-builtin-codecparsers - enable built-in codecparsers [default=yes] - --enable-builtin-libvpx enable built-in libvpx [default=yes] + --disable-fatal-warnings + Don't turn compiler warnings into fatal errors + --enable-extra-checks Enable extra runtime checks + --disable-debug disable addition of -g debugging info --enable-encoders enable video encoders [default=yes] --enable-drm enable DRM backend [default=yes] --enable-x11 enable X11 output [default=yes] @@ -1701,15 +1685,31 @@ --enable-gtk-doc use gtk-doc to build documentation [[default=no]] --enable-gtk-doc-html build documentation in html format [[default=yes]] --enable-gtk-doc-pdf build documentation in pdf format [[default=no]] + --enable-gobject-cast-checks=[no/auto/yes] + Enable GObject cast checks + --enable-glib-asserts=[no/yes] + Enable GLib assertion Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] + --with-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot=DIR Search for dependent libraries within DIR - (or the compiler's sysroot if not specified). + --with-sysroot[=DIR] Search for dependent libraries within DIR (or the + compiler's sysroot if not specified). + --with-autoconf use a different autoconf for regeneration of + Makefiles + --with-autoheader use a different autoheader for regeneration of + Makefiles + --with-automake use a different automake for regeneration of + Makefiles + --with-aclocal use a different aclocal for regeneration of + Makefiles + --with-pkg-config-path colon-separated list of pkg-config(1) dirs --with-glapi=APIs build with the specified OpenGL APIs [default=any] --with-html-dir=PATH path to installed docs @@ -1722,21 +1722,19 @@ LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory - GIT Path to git program, if any + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. CPP C preprocessor - YASM Path to yasm program, if any - PATCH Path to patch program, if any PKG_CONFIG path to pkg-config utility - PKG_CONFIG_PATH - directories to add to pkg-config's search path - PKG_CONFIG_LIBDIR - path overriding pkg-config's built-in search path GTKDOC_DEPS_CFLAGS C compiler flags for GTKDOC_DEPS, overriding pkg-config GTKDOC_DEPS_LIBS linker flags for GTKDOC_DEPS, overriding pkg-config + PYTHON the Python interpreter GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config GLIB_LIBS linker flags for GLIB, overriding pkg-config + GIO_CFLAGS C compiler flags for GIO, overriding pkg-config + GIO_LIBS linker flags for GIO, overriding pkg-config GST_CFLAGS C compiler flags for GST, overriding pkg-config GST_LIBS linker flags for GST, overriding pkg-config GST_BASE_CFLAGS @@ -1747,10 +1745,6 @@ C compiler flags for GST_PLUGINS_BASE, overriding pkg-config GST_PLUGINS_BASE_LIBS linker flags for GST_PLUGINS_BASE, overriding pkg-config - GST_INTERFACES_CFLAGS - C compiler flags for GST_INTERFACES, overriding pkg-config - GST_INTERFACES_LIBS - linker flags for GST_INTERFACES, overriding pkg-config GST_ALLOCATORS_CFLAGS C compiler flags for GST_ALLOCATORS, overriding pkg-config GST_ALLOCATORS_LIBS @@ -1759,10 +1753,10 @@ C compiler flags for GST_VIDEO, overriding pkg-config GST_VIDEO_LIBS linker flags for GST_VIDEO, overriding pkg-config - GST_BASEVIDEO_CFLAGS - C compiler flags for GST_BASEVIDEO, overriding pkg-config - GST_BASEVIDEO_LIBS - linker flags for GST_BASEVIDEO, overriding pkg-config + GST_PBUTILS_CFLAGS + C compiler flags for GST_PBUTILS, overriding pkg-config + GST_PBUTILS_LIBS + linker flags for GST_PBUTILS, overriding pkg-config GST_CODEC_PARSERS_CFLAGS C compiler flags for GST_CODEC_PARSERS, overriding pkg-config GST_CODEC_PARSERS_LIBS @@ -1770,13 +1764,8 @@ GST_GL_CFLAGS C compiler flags for GST_GL, overriding pkg-config GST_GL_LIBS linker flags for GST_GL, overriding pkg-config - GST_PLUGIN_PATH_1_0 - installation path for gstreamer-vaapi plugin elements for - GStreamer 1.0 DRM_CFLAGS C compiler flags for DRM, overriding pkg-config DRM_LIBS linker flags for DRM, overriding pkg-config - UDEV_CFLAGS C compiler flags for UDEV, overriding pkg-config - UDEV_LIBS linker flags for UDEV, overriding pkg-config X11_CFLAGS C compiler flags for X11, overriding pkg-config X11_LIBS linker flags for X11, overriding pkg-config XRANDR_CFLAGS @@ -1823,7 +1812,7 @@ Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to . +Report bugs to . _ACEOF ac_status=$? fi @@ -1886,7 +1875,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -gst_vaapi configure 0.7.0 +GStreamer VA-API Plug-ins configure 1.8.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2161,6 +2150,52 @@ } # ac_fn_c_check_func +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. +ac_fn_c_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_decl + # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using @@ -2231,9 +2266,9 @@ $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## sssssssssssssssssssssssssssssssssssssssssss ## -## Report this to gwenole.beauchesne@intel.com ## -## sssssssssssssssssssssssssssssssssssssssssss ##" +( $as_echo "## ------------------------------------------------------------------------ ## +## Report this to http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer ## +## ------------------------------------------------------------------------ ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac @@ -2255,7 +2290,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by gst_vaapi $as_me 0.7.0, which was +It was created by GStreamer VA-API Plug-ins $as_me 1.8.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2749,6 +2784,9 @@ NONENONEs,x,x, && program_prefix=${target_alias}- + + + am__api_version='1.15' # Find a good install program. We prefer a C program (faster), @@ -3235,7 +3273,7 @@ # Define the identity of the package. PACKAGE='gstreamer-vaapi' - VERSION='0.7.0' + VERSION='1.8.2' cat >>confdefs.h <<_ACEOF @@ -3445,13 +3483,65 @@ fi -TODAY="`LC_ALL=C date +'%a, %d %b %Y %X %z'`" + + PACKAGE_VERSION_MAJOR=$(echo 1.8.2 | cut -d'.' -f1) + PACKAGE_VERSION_MINOR=$(echo 1.8.2 | cut -d'.' -f2) + PACKAGE_VERSION_MICRO=$(echo 1.8.2 | cut -d'.' -f3) + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking nano version" >&5 +$as_echo_n "checking nano version... " >&6; } + + NANO=$(echo 1.8.2 | cut -d'.' -f4) + + if test x"$NANO" = x || test "x$NANO" = "x0" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: 0 (release)" >&5 +$as_echo "0 (release)" >&6; } + NANO=0 + PACKAGE_VERSION_RELEASE=1 + GST_GIT="no" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NANO" >&5 +$as_echo "$NANO" >&6; } + PACKAGE_VERSION_RELEASE=0.`date +%Y%m%d.%H%M%S` + if test "x$NANO" != "x1" ; then + GST_GIT="no" + else + GST_GIT="yes" + fi + fi + PACKAGE_VERSION_NANO=$NANO + + + -LIBVA_PACKAGE_VERSION=1.0.3 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=yes +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE -WAYLAND_API_VERSION=1.0.2 # Check whether --enable-silent-rules was given. @@ -3494,206 +3584,187 @@ AM_BACKSLASH='\' -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +GST_API_VERSION=1.0 -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +cat >>confdefs.h <<_ACEOF +#define GST_API_VERSION "$GST_API_VERSION" +_ACEOF -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; + case $host_os in + cygwin* | mingw*) + lt_cv_deplibs_check_method=pass_all + ;; + esac + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +macro_version='2.4.6' +macro_revision='2.4.6' - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi + + + + + + + + + + + +ltmain=$ac_aux_dir/ltmain.sh + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case $ECHO in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + AMDEP_TRUE='#' + AMDEP_FALSE= fi -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : @@ -3709,7 +3780,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -3729,15 +3800,11 @@ fi - test -n "$CC" && break - done fi -if test -z "$CC"; then +if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : @@ -3753,7 +3820,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" + ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -3772,10 +3839,6 @@ $as_echo "no" >&6; } fi - - test -n "$ac_ct_CC" && break -done - if test "x$ac_ct_CC" = x; then CC="" else @@ -3787,39 +3850,239 @@ esac CC=$ac_ct_CC fi +else + CC="$ac_cv_prog_CC" fi -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4341,96 +4604,33 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -DEPDIR="${am__leading_dot}deps" -ac_config_commands="$ac_config_commands depfiles" +depcc="$CC" am_compiler_list= - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then @@ -4533,153 +4733,6 @@ fi - - - -# Extract the first word of "git", so it can be a program name with args. -set dummy git; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $GIT in - [\\/]* | ?:[\\/]*) - ac_cv_path_GIT="$GIT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GIT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -GIT=$ac_cv_path_GIT -if test -n "$GIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GIT" >&5 -$as_echo "$GIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test -n "$GIT"; then - HAVE_GIT_TRUE= - HAVE_GIT_FALSE='#' -else - HAVE_GIT_TRUE='#' - HAVE_GIT_FALSE= -fi - - - -case `pwd` in - *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; -esac - - - -macro_version='2.4.2' -macro_revision='1.3337' - - - - - - - - - - - - - -ltmain="$ac_aux_dir/ltmain.sh" - -# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "" -} - -case "$ECHO" in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; -esac - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : @@ -4981,19 +5034,19 @@ # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld -if test "$GCC" = yes; then +if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw + # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; @@ -5007,7 +5060,7 @@ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done - test -z "$LD" && LD="$ac_prog" + test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. @@ -5018,7 +5071,7 @@ with_gnu_ld=unknown ;; esac -elif test "$with_gnu_ld" = yes; then +elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else @@ -5029,32 +5082,32 @@ $as_echo_n "(cached) " >&6 else if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" + lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } @@ -5097,33 +5150,38 @@ else if test -n "$NM"; then # Let the user override the test. - lt_cv_path_NM="$NM" + lt_cv_path_NM=$NM else - lt_nm_to_check="${ac_tool_prefix}nm" + lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" - break + break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" - break + break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but @@ -5134,15 +5192,15 @@ esac fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : @@ -5248,9 +5306,9 @@ fi fi - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) - DUMPBIN="$DUMPBIN -symbols" + DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: @@ -5258,8 +5316,8 @@ esac fi - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" + if test : != "$DUMPBIN"; then + NM=$DUMPBIN fi fi test -z "$NM" && NM=nm @@ -5310,7 +5368,7 @@ $as_echo_n "(cached) " >&6 else i=0 - teststring="ABCD" + teststring=ABCD case $build_os in msdosdjgpp*) @@ -5350,7 +5408,7 @@ lt_cv_sys_max_cmd_len=8192; ;; - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -5401,22 +5459,22 @@ *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do + for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough + test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring @@ -5434,7 +5492,7 @@ fi -if test -n $lt_cv_sys_max_cmd_len ; then +if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else @@ -5452,30 +5510,6 @@ : ${MV="mv -f"} : ${RM="rm -f"} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 -$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 -$as_echo "$xsi_shell" >&6; } - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 -$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } -lt_shell_append=no -( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 -$as_echo "$lt_shell_append" >&6; } - - if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else @@ -5598,13 +5632,13 @@ reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then + if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + if test yes = "$GCC"; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi @@ -5718,9 +5752,6 @@ - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : @@ -5732,13 +5763,13 @@ # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. +# 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) @@ -5765,8 +5796,7 @@ # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else @@ -5862,8 +5892,8 @@ lt_cv_deplibs_check_method=pass_all ;; -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' @@ -5916,6 +5946,9 @@ tpf*) lt_cv_deplibs_check_method=pass_all ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; esac fi @@ -6061,9 +6094,6 @@ - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : @@ -6073,8 +6103,8 @@ case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib @@ -6086,7 +6116,7 @@ ;; *) # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" + lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac @@ -6241,7 +6271,7 @@ ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - if test "$ac_status" -eq 0; then + if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 @@ -6249,7 +6279,7 @@ ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - if test "$ac_status" -ne 0; then + if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi @@ -6262,7 +6292,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } -if test "x$lt_cv_ar_at_file" = xno; then +if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file @@ -6479,7 +6509,7 @@ if test -n "$RANLIB"; then case $host_os in - openbsd*) + bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) @@ -6569,7 +6599,7 @@ symcode='[ABCDGISTW]' ;; hpux*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; @@ -6602,14 +6632,44 @@ symcode='[ABCDGIRSTW]' ;; esac +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -6627,21 +6687,24 @@ # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" @@ -6689,11 +6752,11 @@ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST -#elif defined(__osf__) +#elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else @@ -6719,7 +6782,7 @@ { { "@PROGRAM@", (void *) 0 }, _LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; @@ -6739,13 +6802,13 @@ mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" + LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext}; then + test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS @@ -6766,7 +6829,7 @@ rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then + if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= @@ -6819,6 +6882,16 @@ + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } @@ -6831,9 +6904,9 @@ lt_sysroot= -case ${with_sysroot} in #( +case $with_sysroot in #( yes) - if test "$GCC" = yes; then + if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( @@ -6843,8 +6916,8 @@ no|'') ;; #( *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 -$as_echo "${with_sysroot}" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +$as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac @@ -6856,18 +6929,99 @@ -# Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : - enableval=$enable_libtool_lock; +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +$as_echo_n "checking for a working dd... " >&6; } +if ${ac_cv_path_lt_DD+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +if test -z "$lt_DD"; then + ac_path_lt_DD_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in dd; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_lt_DD" || continue +if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi + $ac_path_lt_DD_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_lt_DD"; then + : + fi +else + ac_cv_path_lt_DD=$lt_DD fi -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes +rm -f conftest.i conftest2.i conftest.out +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +$as_echo "$ac_cv_path_lt_DD" >&6; } -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +$as_echo_n "checking how to truncate binary pipes... " >&6; } +if ${lt_cv_truncate_bin+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +$as_echo "$lt_cv_truncate_bin" >&6; } + + + + + + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test no = "$enable_libtool_lock" || enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 @@ -6876,24 +7030,25 @@ test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) - HPUX_IA64_MODE="32" + HPUX_IA64_MODE=32 ;; *ELF-64*) - HPUX_IA64_MODE="64" + HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - if test "$lt_cv_prog_gnu_ld" = yes; then + if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" @@ -6922,9 +7077,50 @@ rm -rf conftest* ;; +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 @@ -6947,10 +7143,10 @@ ;; esac ;; - powerpc64le-*) + powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; - powerpc64-*) + powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -6969,10 +7165,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - powerpcle-*) + powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; - powerpc-*) + powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -6990,7 +7186,7 @@ *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" + SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } @@ -7030,13 +7226,14 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } - if test x"$lt_cv_cc_needs_belf" != x"yes"; then + if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" + CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 @@ -7048,7 +7245,7 @@ case $lt_cv_prog_gnu_ld in yes*) case $host in - i?86-*-solaris*) + i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) @@ -7057,7 +7254,7 @@ esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD="${LD-ld}_sol2" + LD=${LD-ld}_sol2 fi ;; *) @@ -7073,7 +7270,7 @@ ;; esac -need_locks="$enable_libtool_lock" +need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. @@ -7184,7 +7381,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test "x$lt_cv_path_mainfest_tool" != xyes; then +if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi @@ -7687,7 +7884,7 @@ $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then + if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the @@ -7705,7 +7902,7 @@ cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. - elif test -f libconftest.dylib && test $_lt_result -eq 0; then + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 @@ -7744,7 +7941,7 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 @@ -7773,7 +7970,7 @@ _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 - elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 @@ -7786,32 +7983,32 @@ $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[012][,.]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then + if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -7819,6 +8016,41 @@ ;; esac +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -8100,41 +8332,20 @@ done + GST_CURRENT=802 + GST_REVISION=0 + GST_AGE=802 + GST_LIBVERSION=802:0:802 -# Set options - - - - enable_dlopen=no - - - enable_win32_dll=no - # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_shared=yes -fi + GST_LT_LDFLAGS="$GST_LT_LDFLAGS -version-info $GST_LIBVERSION" + if test ! -z "" + then + GST_LT_LDFLAGS="$GST_LT_LDFLAGS -release " + fi @@ -8142,143 +8353,330 @@ +# Set options +enable_dlopen=yes +enable_win32_dll=yes +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } else - enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - - - - - - - -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : - withval=$with_pic; lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for lt_pkg in $withval; do - IFS="$lt_save_ifs" - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } else - pic_mode=default + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - -test -z "$pic_mode" && pic_mode=default - - - - - - - - # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then : - enableval=$enable_fast_install; p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi else - enable_fast_install=yes + AS="$ac_cv_prog_AS" fi + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - - - - - - - - - - - - - - - - +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + ;; +esac +test -z "$AS" && AS=as +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$LN_S" && LN_S="ln -s" +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_static=no +fi @@ -8290,111 +8688,302 @@ -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS=$lt_save_ifs + ;; + esac else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null + enable_shared=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac -# Global variables: -ofile=libtool -can_build_shared=yes -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + pic_mode=default +fi -with_gnu_ld="$lt_cv_prog_gnu_ld" -old_CC="$CC" -old_CFLAGS="$CFLAGS" -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MAGIC_CMD in + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[5-9]*,yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +$as_echo_n "checking which variant of shared library versioning to provide... " >&6; } + +# Check whether --with-aix-soname was given. +if test "${with_aix_soname+set}" = set; then : + withval=$with_aix_soname; case $withval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname +else + if ${lt_cv_with_aix_soname+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_with_aix_soname=aix +fi + + with_aix_soname=$lt_cv_with_aix_soname +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +$as_echo "$with_aix_soname" >&6; } + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS=$ltmain + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld=$lt_cv_prog_gnu_ld + +old_CC=$CC +old_CFLAGS=$CFLAGS + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +func_cc_basename $compiler +cc_basename=$func_cc_basename_result + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in [\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -f "$ac_dir/${ac_tool_prefix}file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : @@ -8417,13 +9006,13 @@ break fi done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } @@ -8445,22 +9034,22 @@ else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -f "$ac_dir/file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : @@ -8483,13 +9072,13 @@ break fi done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } @@ -8510,7 +9099,7 @@ # Use C for the default configuration in the libtool script -lt_save_CC="$CC" +lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -8572,7 +9161,7 @@ lt_prog_compiler_no_builtin_flag= -if test "$GCC" = yes; then +if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; @@ -8588,7 +9177,7 @@ lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" + lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -8618,7 +9207,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then +if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : @@ -8636,17 +9225,18 @@ lt_prog_compiler_static= - if test "$GCC" = yes; then + if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi + lt_prog_compiler_pic='-fPIC' ;; amigaos*) @@ -8657,8 +9247,8 @@ ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac @@ -8674,6 +9264,11 @@ # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac ;; darwin* | rhapsody*) @@ -8744,7 +9339,7 @@ case $host_os in aix*) lt_prog_compiler_wl='-Wl,' - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else @@ -8752,10 +9347,29 @@ fi ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac ;; hpux9* | hpux10* | hpux11*) @@ -8771,7 +9385,7 @@ ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='${wl}-a ${wl}archive' + lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) @@ -8782,7 +9396,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. + # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' @@ -8807,6 +9421,12 @@ lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) @@ -8904,7 +9524,7 @@ ;; sysv4*MP*) - if test -d /usr/nec ;then + if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi @@ -8933,7 +9553,7 @@ fi case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: + # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; @@ -8965,7 +9585,7 @@ lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -8995,7 +9615,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } -if test x"$lt_cv_prog_compiler_pic_works" = xyes; then +if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; @@ -9027,7 +9647,7 @@ $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then @@ -9046,13 +9666,13 @@ fi fi $RM -r conftest* - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } -if test x"$lt_cv_prog_compiler_static_works" = xyes; then +if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= @@ -9172,8 +9792,8 @@ -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } @@ -9185,9 +9805,9 @@ ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + if test no = "$hard_links"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else @@ -9230,9 +9850,9 @@ # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if @@ -9247,7 +9867,7 @@ # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. - if test "$GCC" != yes; then + if test yes != "$GCC"; then with_gnu_ld=no fi ;; @@ -9255,7 +9875,7 @@ # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; - openbsd*) + openbsd* | bitrig*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) @@ -9268,7 +9888,7 @@ # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility @@ -9290,24 +9910,24 @@ esac fi - if test "$lt_use_gnu_ld_interface" = yes; then + if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' + wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no - case `$LD -v 2>&1` in + case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -9320,7 +9940,7 @@ case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then + if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 @@ -9339,7 +9959,7 @@ case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) @@ -9355,7 +9975,7 @@ allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi @@ -9365,7 +9985,7 @@ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='${wl}--export-all-symbols' + export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes @@ -9373,61 +9993,89 @@ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no - if test "$host_os" = linux-dietlibc; then + if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no + && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -9438,42 +10086,47 @@ lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then + if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in + tcc*) + export_dynamic_flag_spec='-rdynamic' + ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then + if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -9487,8 +10140,8 @@ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -9506,8 +10159,8 @@ _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -9519,7 +10172,7 @@ ld_shlibs=no cat <<_LT_EOF 1>&2 -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify @@ -9534,9 +10187,9 @@ # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -9553,15 +10206,15 @@ *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac - if test "$ld_shlibs" = no; then + if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= @@ -9577,7 +10230,7 @@ # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported @@ -9585,34 +10238,57 @@ ;; aix[4-9]*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag="" + no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi ;; esac @@ -9631,13 +10307,21 @@ hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes - file_list_spec='${wl}-f,' + file_list_spec='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct=no + hardcode_direct_absolute=no + ;; + esac - if test "$GCC" = yes; then + if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` + collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -9656,36 +10340,42 @@ ;; esac shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' fi - link_all_deplibs=no + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' else # not using gcc - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' else - shared_flag='${wl}-bM:SRE' + shared_flag='$wl-bM:SRE' fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' fi fi - export_dynamic_flag_spec='${wl}-bexpall' + export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then + if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : @@ -9720,7 +10410,7 @@ rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" + lt_cv_aix_libpath_=/usr/lib:/lib fi fi @@ -9728,17 +10418,17 @@ aix_libpath=$lt_cv_aix_libpath_ fi - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then + if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : @@ -9773,7 +10463,7 @@ rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" + lt_cv_aix_libpath_=/usr/lib:/lib fi fi @@ -9781,21 +10471,33 @@ aix_libpath=$lt_cv_aix_libpath_ fi - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then + no_undefined_flag=' $wl-bernotok' + allow_undefined_flag=' $wl-berok' + if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; @@ -9804,7 +10506,7 @@ case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) @@ -9834,16 +10536,17 @@ # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes @@ -9852,18 +10555,18 @@ # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' ;; *) # Assume MSVC wrapper @@ -9872,7 +10575,7 @@ # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. @@ -9891,24 +10594,24 @@ hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes - allow_undefined_flag="$_lt_dar_allow_undefined" + allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; + ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac - if test "$_lt_dar_can_shared" = "yes"; then + if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no @@ -9950,33 +10653,33 @@ ;; hpux9*) - if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + if test yes = "$GCC"; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' + export_dynamic_flag_spec='$wl-E' ;; hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test yes,no = "$GCC,$with_gnu_ld"; then + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' + export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes @@ -9984,25 +10687,25 @@ ;; hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then + if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) @@ -10014,7 +10717,7 @@ $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then @@ -10033,14 +10736,14 @@ fi fi $RM -r conftest* - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } -if test x"$lt_cv_prog_compiler__b" = xyes; then - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +if test yes = "$lt_cv_prog_compiler__b"; then + archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi @@ -10048,8 +10751,8 @@ ;; esac fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in @@ -10060,7 +10763,7 @@ *) hardcode_direct=yes hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' + export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. @@ -10071,8 +10774,8 @@ ;; irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if test yes = "$GCC"; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. @@ -10082,8 +10785,8 @@ if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } @@ -10095,24 +10798,35 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test "$lt_cv_irix_exported_symbol" = yes; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + if test yes = "$lt_cv_irix_exported_symbol"; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi + link_all_deplibs=no else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + ld_shlibs=yes + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out @@ -10127,7 +10841,7 @@ newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; @@ -10135,27 +10849,19 @@ *nto* | *qnx*) ;; - openbsd*) + openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no @@ -10166,33 +10872,53 @@ hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes ;; osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' @@ -10203,24 +10929,24 @@ solaris*) no_undefined_flag=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + wlarc='$wl' + archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) - wlarc='${wl}' - archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + wlarc='$wl' + archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi @@ -10230,11 +10956,11 @@ solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', + # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + if test yes = "$GCC"; then + whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi @@ -10244,10 +10970,10 @@ ;; sunos4*) - if test "x$host_vendor" = xsequent; then + if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi @@ -10296,43 +11022,43 @@ ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='${wl}-z,text' + no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not + # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - no_undefined_flag='${wl}-z,text' - allow_undefined_flag='${wl}-z,nodefs' + no_undefined_flag='$wl-z,text' + allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes - export_dynamic_flag_spec='${wl}-Bexport' + export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; @@ -10347,10 +11073,10 @@ ;; esac - if test x$host_vendor = xsni; then + if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='${wl}-Blargedynsym' + export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi @@ -10358,7 +11084,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no +test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld @@ -10384,7 +11110,7 @@ # Assume -lc should be added archive_cmds_need_lc=yes - if test "$enable_shared" = yes && test "$GCC" = yes; then + if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. @@ -10599,14 +11325,14 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } -if test "$GCC" = yes; then +if test yes = "$GCC"; then case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; + mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in @@ -10622,28 +11348,35 @@ ;; esac # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. + # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; + lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } @@ -10657,7 +11390,7 @@ # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([A-Za-z]:\),\1,g'` ;; + $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else @@ -10666,7 +11399,7 @@ library_names_spec= libname_spec='lib$name' soname_spec= -shrext_cmds=".so" +shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= @@ -10683,14 +11416,16 @@ # flags to be left without arguments need_version=unknown + + case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' + soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) @@ -10698,41 +11433,91 @@ need_lib_prefix=no need_version=no hardcode_into_libs=yes - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac shlibpath_var=LIBPATH fi ;; @@ -10742,18 +11527,18 @@ powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) - library_names_spec='${libname}${shared_ext}' + library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; @@ -10761,8 +11546,8 @@ bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" @@ -10774,7 +11559,7 @@ cygwin* | mingw* | pw32* | cegcc*) version_type=windows - shrext_cmds=".dll" + shrext_cmds=.dll need_version=no need_lib_prefix=no @@ -10783,8 +11568,8 @@ # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ @@ -10800,17 +11585,17 @@ case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' @@ -10819,8 +11604,8 @@ *,cl*) # Native MSVC libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' case $build_os in mingw*) @@ -10847,7 +11632,7 @@ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) - sys_lib_search_path_spec="$LIB" + sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` @@ -10860,8 +11645,8 @@ esac # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' @@ -10874,7 +11659,7 @@ *) # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac @@ -10887,8 +11672,8 @@ version_type=darwin need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' @@ -10901,8 +11686,8 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -10920,12 +11705,13 @@ version_type=freebsd-$objformat case $version_type in freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac @@ -10955,10 +11741,10 @@ need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes + shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -10976,14 +11762,15 @@ dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' @@ -10991,8 +11778,8 @@ dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; @@ -11001,8 +11788,8 @@ dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... @@ -11015,8 +11802,8 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -11027,7 +11814,7 @@ case $host_os in nonstopux*) version_type=nonstopux ;; *) - if test "$lt_cv_prog_gnu_ld" = yes; then + if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix @@ -11035,8 +11822,8 @@ esac need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= @@ -11055,8 +11842,8 @@ esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; @@ -11065,13 +11852,33 @@ dynamic_linker=no ;; +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec='-L$libdir' + ;; + # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -11115,7 +11922,12 @@ # before this can be enabled. hardcode_into_libs=yes - # Append ld.so.conf contents to the search path + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" @@ -11147,12 +11959,12 @@ need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH @@ -11162,7 +11974,7 @@ newsos6) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; @@ -11171,58 +11983,68 @@ version_type=qnx need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; -openbsd*) +openbsd* | bitrig*) version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" + sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no else - shlibpath_overrides_runpath=yes + need_version=yes fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' - shrext_cmds=".dll" + version_type=windows + shrext_cmds=.dll + need_version=no need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) @@ -11233,8 +12055,8 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes @@ -11244,11 +12066,11 @@ sunos4*) version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes @@ -11256,8 +12078,8 @@ sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) @@ -11278,24 +12100,24 @@ ;; sysv4*MP*) - if test -d /usr/nec ;then + if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf + version_type=sco need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' @@ -11313,7 +12135,7 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes @@ -11321,8 +12143,8 @@ uts4*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -11332,20 +12154,35 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no +test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then +if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + @@ -11442,15 +12279,15 @@ hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || - test "X$hardcode_automatic" = "Xyes" ; then + test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. - if test "$hardcode_direct" != no && + if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && + test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else @@ -11465,12 +12302,12 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } -if test "$hardcode_action" = relink || - test "$inherit_rpath" = yes; then +if test relink = "$hardcode_action" || + test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi @@ -11480,7 +12317,7 @@ - if test "x$enable_dlopen" != xyes; then + if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown @@ -11490,23 +12327,23 @@ case $host_os in beos*) - lt_cv_dlopen="load_add_on" + lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) - lt_cv_dlopen="dlopen" + lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) - # if libdl is installed we need to link against it + # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : @@ -11544,10 +12381,10 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else - lt_cv_dlopen="dyld" + lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes @@ -11555,10 +12392,18 @@ ;; + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" + lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } @@ -11597,11 +12442,11 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" + lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" + lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } @@ -11640,7 +12485,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } @@ -11679,7 +12524,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } @@ -11718,7 +12563,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" + lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi @@ -11739,21 +12584,21 @@ ;; esac - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else + if test no = "$lt_cv_dlopen"; then enable_dlopen=no + else + enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - save_LIBS="$LIBS" + save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 @@ -11761,7 +12606,7 @@ if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then : + if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -11808,9 +12653,9 @@ # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated +/* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif @@ -11840,7 +12685,7 @@ (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in @@ -11860,14 +12705,14 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } - if test "x$lt_cv_dlopen_self" = xyes; then + if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then : + if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -11914,9 +12759,9 @@ # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated +/* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif @@ -11946,7 +12791,7 @@ (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in @@ -11967,9 +12812,9 @@ $as_echo "$lt_cv_dlopen_self_static" >&6; } fi - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS ;; esac @@ -12013,7 +12858,7 @@ # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) - if test -n "$STRIP" ; then + if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -12041,7 +12886,7 @@ - # Report which library types will actually be built + # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 @@ -12049,13 +12894,13 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } - test "$can_build_shared" = "no" && enable_shared=no + test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test "$enable_shared" = yes && enable_static=no + test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' @@ -12063,8 +12908,12 @@ ;; aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -12074,7 +12923,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes + test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } @@ -12088,7 +12937,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -CC="$lt_save_CC" +CC=$lt_save_CC @@ -12113,30 +12962,241 @@ -# Check whether --enable-builtin_videoparsers was given. -if test "${enable_builtin_videoparsers+set}" = set; then : - enableval=$enable_builtin_videoparsers; + +GLIB_REQ=2.32 +GST_REQ=1.8.0 +GST_PBREQ=1.8.0 +GST_PBADREQ=1.8.0 +WAYLAND_REQ=1.0.2 +GTKDOC_REQ=1.12 + +VAAPI_REQ=0.30.4 +VAAPI_ENC_REQ=0.34.0 +VAAPI_DRM_REQ=0.33.0 +VAAPI_X11_REQ=0.31.0 +VAAPI_WLD_REQ=0.33.0 + + + + +# Check whether --with-autoconf was given. +if test "${with_autoconf+set}" = set; then : + withval=$with_autoconf; + unset AUTOCONF + +AUTOCONF=${AUTOCONF-"${am_missing_run}${withval}"} + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $AUTOCONF as autoconf" >&5 +$as_echo "$as_me: Using $AUTOCONF as autoconf" >&6;} + +fi + + + +# Check whether --with-autoheader was given. +if test "${with_autoheader+set}" = set; then : + withval=$with_autoheader; + unset AUTOHEADER + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}${withval}"} + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $AUTOHEADER as autoheader" >&5 +$as_echo "$as_me: Using $AUTOHEADER as autoheader" >&6;} + +fi + + + +# Check whether --with-automake was given. +if test "${with_automake+set}" = set; then : + withval=$with_automake; + unset AUTOMAKE + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}${withval}"} + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $AUTOMAKE as automake" >&5 +$as_echo "$as_me: Using $AUTOMAKE as automake" >&6;} + +fi + + + +# Check whether --with-aclocal was given. +if test "${with_aclocal+set}" = set; then : + withval=$with_aclocal; + unset ACLOCAL + +ACLOCAL=${ACLOCAL-"${am_missing_run}${withval}"} + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $ACLOCAL as aclocal" >&5 +$as_echo "$as_me: Using $ACLOCAL as aclocal" >&6;} + +fi + + + +ACLOCAL_AMFLAGS="-I m4 -I common/m4" + + + + + # Check whether --enable-fatal-warnings was given. +if test "${enable_fatal_warnings+set}" = set; then : + enableval=$enable_fatal_warnings; + case "${enableval}" in + yes) FATAL_WARNINGS=yes ;; + no) FATAL_WARNINGS=no ;; + *) as_fn_error $? "bad value ${enableval} for --disable-fatal-warnings" "$LINENO" 5 ;; + esac + else - enable_builtin_videoparsers="yes" + + if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then + FATAL_WARNINGS=yes + else + FATAL_WARNINGS=no + fi + fi -# Check whether --enable-builtin_codecparsers was given. -if test "${enable_builtin_codecparsers+set}" = set; then : - enableval=$enable_builtin_codecparsers; + + # Check whether --enable-extra-check was given. +if test "${enable_extra_check+set}" = set; then : + enableval=$enable_extra_check; + case "${enableval}" in + yes) EXTRA_CHECKS=yes ;; + no) EXTRA_CHECKS=no ;; + *) as_fn_error $? "bad value ${enableval} for --enable-extra-checks" "$LINENO" 5 ;; + esac + else - enable_builtin_codecparsers="yes" + + if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then + EXTRA_CHECKS=yes + else + EXTRA_CHECKS=no + fi + fi -# Check whether --enable-builtin_libvpx was given. -if test "${enable_builtin_libvpx+set}" = set; then : - enableval=$enable_builtin_libvpx; + if test "x$EXTRA_CHECKS" = "xyes"; then + +$as_echo "#define GST_ENABLE_EXTRA_CHECKS 1" >>confdefs.h + + fi + + + # Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; + case "${enableval}" in + yes) USE_DEBUG=yes ;; + no) USE_DEBUG=no ;; + *) as_fn_error $? "bad value ${enableval} for --enable-debug" "$LINENO" 5 ;; + esac + else - enable_builtin_libvpx="yes" + USE_DEBUG=yes +fi + + + + +# Check whether --with-pkg-config-path was given. +if test "${with_pkg_config_path+set}" = set; then : + withval=$with_pkg_config_path; + export PKG_CONFIG_PATH=${withval} + { $as_echo "$as_me:${as_lineno-$LINENO}: Set PKG_CONFIG_PATH to $PKG_CONFIG_PATH" >&5 +$as_echo "$as_me: Set PKG_CONFIG_PATH to $PKG_CONFIG_PATH" >&6;} + fi + + + if test "x$PACKAGE_VERSION_NANO" = "x0"; then + + if test "xyes" = "xno" -o "xyes" = "x"; then + GST_PACKAGE_RELEASE_DATETIME=`date -u "+%Y-%m-%dT%H:%MZ"` + elif test "xyes" = "xyes"; then + if ( echo "${srcdir}/gstreamer-vaapi.doap" | grep '^20[1-9][0-9]-[0-1][0-9]-[0-3][0-9]' >/dev/null ) ; then + GST_PACKAGE_RELEASE_DATETIME= "${srcdir}/gstreamer-vaapi.doap" + else + YYYY_MM_DD=`sh "${srcdir}/common/extract-release-date-from-doap-file" $PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO "${srcdir}/gstreamer-vaapi.doap" `; + if test "x$YYYY_MM_DD" != "x"; then + GST_PACKAGE_RELEASE_DATETIME=$YYYY_MM_DD + else + as_fn_error $? "SET_PACKAGE_RELEASE_DATETIME: could not extract + release date for release version $PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO from \"${srcdir}/gstreamer-vaapi.doap\" " "$LINENO" 5 + GST_PACKAGE_RELEASE_DATETIME="" + fi + fi + elif ( echo yes | grep '^20[1-9][0-9]-[0-1][0-9]-[0-3][0-9]' >/dev/null ) ; then + GST_PACKAGE_RELEASE_DATETIME=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SET_PACKAGE_RELEASE_DATETIME: invalid first argument" >&5 +$as_echo "$as_me: WARNING: SET_PACKAGE_RELEASE_DATETIME: invalid first argument" >&2;} + GST_PACKAGE_RELEASE_DATETIME="" + fi + + if test "x$GST_PACKAGE_RELEASE_DATETIME" = "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Invalid package release date time: $GST_PACKAGE_RELEASE_DATETIME" >&5 +$as_echo "$as_me: WARNING: Invalid package release date time: $GST_PACKAGE_RELEASE_DATETIME" >&2;} + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Setting GST_PACKAGE_RELEASE_DATETIME to $GST_PACKAGE_RELEASE_DATETIME" >&5 +$as_echo "$as_me: Setting GST_PACKAGE_RELEASE_DATETIME to $GST_PACKAGE_RELEASE_DATETIME" >&6;} + + +cat >>confdefs.h <<_ACEOF +#define GST_PACKAGE_RELEASE_DATETIME "$GST_PACKAGE_RELEASE_DATETIME" +_ACEOF + + fi + + else + + if test "xno" = "xno" -o "xno" = "x"; then + GST_PACKAGE_RELEASE_DATETIME=`date -u "+%Y-%m-%dT%H:%MZ"` + elif test "xno" = "xyes"; then + if ( echo | grep '^20[1-9][0-9]-[0-1][0-9]-[0-3][0-9]' >/dev/null ) ; then + GST_PACKAGE_RELEASE_DATETIME= + else + YYYY_MM_DD=`sh "${srcdir}/common/extract-release-date-from-doap-file" `; + if test "x$YYYY_MM_DD" != "x"; then + GST_PACKAGE_RELEASE_DATETIME=$YYYY_MM_DD + else + as_fn_error $? "SET_PACKAGE_RELEASE_DATETIME: could not extract + release date for release version from " "$LINENO" 5 + GST_PACKAGE_RELEASE_DATETIME="" + fi + fi + elif ( echo no | grep '^20[1-9][0-9]-[0-1][0-9]-[0-3][0-9]' >/dev/null ) ; then + GST_PACKAGE_RELEASE_DATETIME=no + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SET_PACKAGE_RELEASE_DATETIME: invalid first argument" >&5 +$as_echo "$as_me: WARNING: SET_PACKAGE_RELEASE_DATETIME: invalid first argument" >&2;} + GST_PACKAGE_RELEASE_DATETIME="" + fi + + if test "x$GST_PACKAGE_RELEASE_DATETIME" = "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Invalid package release date time: $GST_PACKAGE_RELEASE_DATETIME" >&5 +$as_echo "$as_me: WARNING: Invalid package release date time: $GST_PACKAGE_RELEASE_DATETIME" >&2;} + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Setting GST_PACKAGE_RELEASE_DATETIME to $GST_PACKAGE_RELEASE_DATETIME" >&5 +$as_echo "$as_me: Setting GST_PACKAGE_RELEASE_DATETIME to $GST_PACKAGE_RELEASE_DATETIME" >&6;} + + +cat >>confdefs.h <<_ACEOF +#define GST_PACKAGE_RELEASE_DATETIME "$GST_PACKAGE_RELEASE_DATETIME" +_ACEOF + + fi + + fi + + # Check whether --enable-encoders was given. if test "${enable_encoders+set}" = set; then : enableval=$enable_encoders; @@ -12196,61 +13256,1522 @@ -# Extract the first word of "yasm", so it can be a program name with args. -set dummy yasm; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_YASM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $YASM in - [\\/]* | ?:[\\/]*) - ac_cv_path_YASM="$YASM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_YASM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - ;; -esac + case "x${target_cpu}" in + xi?86 | xk? | xi?86_64) + case $target_os in + solaris*) + ac_fn_c_check_decl "$LINENO" "__i386" "ac_cv_have_decl___i386" "$ac_includes_default" +if test "x$ac_cv_have_decl___i386" = xyes; then : + I386_ABI="yes" +else + I386_ABI="no" fi -YASM=$ac_cv_path_YASM -if test -n "$YASM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YASM" >&5 -$as_echo "$YASM" >&6; } + + ac_fn_c_check_decl "$LINENO" "__amd64" "ac_cv_have_decl___amd64" "$ac_includes_default" +if test "x$ac_cv_have_decl___amd64" = xyes; then : + AMD64_ABI="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + AMD64_ABI="no" fi -if test -z "$YASM" -a "$enable_builtin_libvpx" = "yes"; then - as_fn_error $? "yasm is needed to build libvpx sources" "$LINENO" 5 -fi + if test "x$I386_ABI" = "xyes" ; then + HAVE_CPU_I386=yes +$as_echo "#define HAVE_CPU_I386 1" >>confdefs.h -# Extract the first word of "patch", so it can be a program name with args. -set dummy patch; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PATCH+:} false; then : + fi + if test "x$AMD64_ABI" = "xyes" ; then + HAVE_CPU_X86_64=yes + +$as_echo "#define HAVE_CPU_X86_64 1" >>confdefs.h + + fi + ;; + *) + HAVE_CPU_I386=yes + +$as_echo "#define HAVE_CPU_I386 1" >>confdefs.h + + + case "x${target_cpu}" in + xi386 | xi486) ;; + *) + +$as_echo "#define HAVE_RDTSC 1" >>confdefs.h + ;; + esac + ;; + esac + ;; + xpowerpc) + HAVE_CPU_PPC=yes + +$as_echo "#define HAVE_CPU_PPC 1" >>confdefs.h + ;; + xpowerpc64) + HAVE_CPU_PPC64=yes + +$as_echo "#define HAVE_CPU_PPC64 1" >>confdefs.h + ;; + xalpha*) + HAVE_CPU_ALPHA=yes + +$as_echo "#define HAVE_CPU_ALPHA 1" >>confdefs.h + ;; + xarc*) + HAVE_CPU_ARC=yes + +$as_echo "#define HAVE_CPU_ARC 1" >>confdefs.h + ;; + xarm*) + HAVE_CPU_ARM=yes + +$as_echo "#define HAVE_CPU_ARM 1" >>confdefs.h + ;; + xaarch64*) + HAVE_CPU_AARCH64=yes + +$as_echo "#define HAVE_CPU_AARCH64 1" >>confdefs.h + ;; + xsparc*) + HAVE_CPU_SPARC=yes + +$as_echo "#define HAVE_CPU_SPARC 1" >>confdefs.h + ;; + xmips*) + HAVE_CPU_MIPS=yes + +$as_echo "#define HAVE_CPU_MIPS 1" >>confdefs.h + ;; + xhppa*) + HAVE_CPU_HPPA=yes + +$as_echo "#define HAVE_CPU_HPPA 1" >>confdefs.h + ;; + xs390*) + HAVE_CPU_S390=yes + +$as_echo "#define HAVE_CPU_S390 1" >>confdefs.h + ;; + xia64*) + HAVE_CPU_IA64=yes + +$as_echo "#define HAVE_CPU_IA64 1" >>confdefs.h + ;; + xm68k*) + HAVE_CPU_M68K=yes + +$as_echo "#define HAVE_CPU_M68K 1" >>confdefs.h + ;; + xx86_64) + HAVE_CPU_X86_64=yes + +$as_echo "#define HAVE_CPU_X86_64 1" >>confdefs.h + ;; + xcris) + HAVE_CPU_CRIS=yes + +$as_echo "#define HAVE_CPU_CRIS 1" >>confdefs.h + ;; + xcrisv32) + HAVE_CPU_CRISV32=yes + +$as_echo "#define HAVE_CPU_CRISV32 1" >>confdefs.h + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else - case $PATCH in + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + + if test "x$HAVE_CPU_I386" = "xyes"; then + HAVE_CPU_I386_TRUE= + HAVE_CPU_I386_FALSE='#' +else + HAVE_CPU_I386_TRUE='#' + HAVE_CPU_I386_FALSE= +fi + + if test "x$HAVE_CPU_PPC" = "xyes"; then + HAVE_CPU_PPC_TRUE= + HAVE_CPU_PPC_FALSE='#' +else + HAVE_CPU_PPC_TRUE='#' + HAVE_CPU_PPC_FALSE= +fi + + if test "x$HAVE_CPU_PPC64" = "xyes"; then + HAVE_CPU_PPC64_TRUE= + HAVE_CPU_PPC64_FALSE='#' +else + HAVE_CPU_PPC64_TRUE='#' + HAVE_CPU_PPC64_FALSE= +fi + + if test "x$HAVE_CPU_ALPHA" = "xyes"; then + HAVE_CPU_ALPHA_TRUE= + HAVE_CPU_ALPHA_FALSE='#' +else + HAVE_CPU_ALPHA_TRUE='#' + HAVE_CPU_ALPHA_FALSE= +fi + + if test "x$HAVE_CPU_ARC" = "xyes"; then + HAVE_CPU_ARC_TRUE= + HAVE_CPU_ARC_FALSE='#' +else + HAVE_CPU_ARC_TRUE='#' + HAVE_CPU_ARC_FALSE= +fi + + if test "x$HAVE_CPU_ARM" = "xyes"; then + HAVE_CPU_ARM_TRUE= + HAVE_CPU_ARM_FALSE='#' +else + HAVE_CPU_ARM_TRUE='#' + HAVE_CPU_ARM_FALSE= +fi + + if test "x$HAVE_CPU_SPARC" = "xyes"; then + HAVE_CPU_SPARC_TRUE= + HAVE_CPU_SPARC_FALSE='#' +else + HAVE_CPU_SPARC_TRUE='#' + HAVE_CPU_SPARC_FALSE= +fi + + if test "x$HAVE_CPU_HPPA" = "xyes"; then + HAVE_CPU_HPPA_TRUE= + HAVE_CPU_HPPA_FALSE='#' +else + HAVE_CPU_HPPA_TRUE='#' + HAVE_CPU_HPPA_FALSE= +fi + + if test "x$HAVE_CPU_MIPS" = "xyes"; then + HAVE_CPU_MIPS_TRUE= + HAVE_CPU_MIPS_FALSE='#' +else + HAVE_CPU_MIPS_TRUE='#' + HAVE_CPU_MIPS_FALSE= +fi + + if test "x$HAVE_CPU_S390" = "xyes"; then + HAVE_CPU_S390_TRUE= + HAVE_CPU_S390_FALSE='#' +else + HAVE_CPU_S390_TRUE='#' + HAVE_CPU_S390_FALSE= +fi + + if test "x$HAVE_CPU_IA64" = "xyes"; then + HAVE_CPU_IA64_TRUE= + HAVE_CPU_IA64_FALSE='#' +else + HAVE_CPU_IA64_TRUE='#' + HAVE_CPU_IA64_FALSE= +fi + + if test "x$HAVE_CPU_M68K" = "xyes"; then + HAVE_CPU_M68K_TRUE= + HAVE_CPU_M68K_FALSE='#' +else + HAVE_CPU_M68K_TRUE='#' + HAVE_CPU_M68K_FALSE= +fi + + if test "x$HAVE_CPU_X86_64" = "xyes"; then + HAVE_CPU_X86_64_TRUE= + HAVE_CPU_X86_64_FALSE='#' +else + HAVE_CPU_X86_64_TRUE='#' + HAVE_CPU_X86_64_FALSE= +fi + + if test "x$HAVE_CPU_CRIS" = "xyes"; then + HAVE_CPU_CRIS_TRUE= + HAVE_CPU_CRIS_FALSE='#' +else + HAVE_CPU_CRIS_TRUE='#' + HAVE_CPU_CRIS_FALSE= +fi + + if test "x$HAVE_CPU_CRISV32" = "xyes"; then + HAVE_CPU_CRISV32_TRUE= + HAVE_CPU_CRISV32_FALSE='#' +else + HAVE_CPU_CRISV32_TRUE='#' + HAVE_CPU_CRISV32_FALSE= +fi + + + +cat >>confdefs.h <<_ACEOF +#define HOST_CPU "$host_cpu" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define TARGET_CPU "$target_cpu" +_ACEOF + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + case $ac_cv_prog_cc_stdc in #( + no) : + ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 +$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } +if ${ac_cv_prog_cc_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +#include + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +#define debug(...) fprintf (stderr, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + your preprocessor is broken; +#endif +#if BIG_OK +#else + your preprocessor is broken; +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\0'; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static void +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str; + int number; + float fnumber; + + while (*format) + { + switch (*format++) + { + case 's': // string + str = va_arg (args_copy, const char *); + break; + case 'd': // int + number = va_arg (args_copy, int); + break; + case 'f': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); +} + +int +main () +{ + + // Check bool. + _Bool success = false; + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + test_varargs ("s, d' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' + || dynamic_array[ni.number - 1] != 543); + + ; + return 0; +} +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c99" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c99" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c99" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 +else + ac_cv_prog_cc_stdc=no +fi + +fi + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5 +$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; } + if ${ac_cv_prog_cc_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +fi + + case $ac_cv_prog_cc_stdc in #( + no) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; #( + '') : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5 +$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;; +esac + + + + +# Extract the first word of "git", so it can be a program name with args. +set dummy git; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GIT in [\\/]* | ?:[\\/]*) - ac_cv_path_PATCH="$PATCH" # Let the user override the test with a path. + ac_cv_path_GIT="$GIT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12260,7 +14781,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PATCH="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_GIT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -12271,75 +14792,25 @@ ;; esac fi -PATCH=$ac_cv_path_PATCH -if test -n "$PATCH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATCH" >&5 -$as_echo "$PATCH" >&6; } +GIT=$ac_cv_path_GIT +if test -n "$GIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GIT" >&5 +$as_echo "$GIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -if test -z "$PATCH" -a "$enable_builtin_videoparsers" = "yes"; then - as_fn_error $? "patch is needed to apply patches for built videoparsers -sources" "$LINENO" 5 -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tan in -lm" >&5 -$as_echo_n "checking for tan in -lm... " >&6; } -if ${ac_cv_lib_m_tan+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char tan (); -int -main () -{ -return tan (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_tan=yes + if test -n "$GIT"; then + HAVE_GIT_TRUE= + HAVE_GIT_FALSE='#' else - ac_cv_lib_m_tan=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_tan" >&5 -$as_echo "$ac_cv_lib_m_tan" >&6; } -if test "x$ac_cv_lib_m_tan" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBM 1 -_ACEOF - - LIBS="-lm $LIBS" - + HAVE_GIT_TRUE='#' + HAVE_GIT_FALSE= fi -GTKDOC_VERSION=1.9 -# gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line - - - - - - if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then @@ -12454,82 +14925,21 @@ $as_echo "no" >&6; } PKG_CONFIG="" fi -fi - - - gtk_doc_requires="gtk-doc >= $GTKDOC_VERSION" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gtk-doc" >&5 -$as_echo_n "checking for gtk-doc... " >&6; } - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$gtk_doc_requires\""; } >&5 - ($PKG_CONFIG --exists --print-errors "$gtk_doc_requires") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - have_gtk_doc=yes -else - have_gtk_doc=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gtk_doc" >&5 -$as_echo "$have_gtk_doc" >&6; } - - if test "$have_gtk_doc" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: - You will not be able to create source packages with 'make dist' - because $gtk_doc_requires is not found." >&5 -$as_echo "$as_me: WARNING: - You will not be able to create source packages with 'make dist' - because $gtk_doc_requires is not found." >&2;} - fi - - # Extract the first word of "gtkdoc-check", so it can be a program name with args. -set dummy gtkdoc-check; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_GTKDOC_CHECK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$GTKDOC_CHECK"; then - ac_cv_prog_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_GTKDOC_CHECK="gtkdoc-check.test" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -GTKDOC_CHECK=$ac_cv_prog_GTKDOC_CHECK -if test -n "$GTKDOC_CHECK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5 -$as_echo "$GTKDOC_CHECK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - # Extract the first word of "gtkdoc-check", so it can be a program name with args. + # Extract the first word of "gtkdoc-check", so it can be a program name with args. set dummy gtkdoc-check; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GTKDOC_CHECK_PATH+:} false; then : +if ${ac_cv_path_GTKDOC_CHECK+:} false; then : $as_echo_n "(cached) " >&6 else - case $GTKDOC_CHECK_PATH in + case $GTKDOC_CHECK in [\\/]* | ?:[\\/]*) - ac_cv_path_GTKDOC_CHECK_PATH="$GTKDOC_CHECK_PATH" # Let the user override the test with a path. + ac_cv_path_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12539,7 +14949,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GTKDOC_CHECK_PATH="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_GTKDOC_CHECK="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -12550,10 +14960,10 @@ ;; esac fi -GTKDOC_CHECK_PATH=$ac_cv_path_GTKDOC_CHECK_PATH -if test -n "$GTKDOC_CHECK_PATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK_PATH" >&5 -$as_echo "$GTKDOC_CHECK_PATH" >&6; } +GTKDOC_CHECK=$ac_cv_path_GTKDOC_CHECK +if test -n "$GTKDOC_CHECK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5 +$as_echo "$GTKDOC_CHECK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -12652,106 +15062,201 @@ if test "${with_html_dir+set}" = set; then : withval=$with_html_dir; else - with_html_dir='${datadir}/gtk-doc/html' + with_html_dir='${datadir}/gtk-doc/html' +fi + + HTML_DIR="$with_html_dir" + + + # Check whether --enable-gtk-doc was given. +if test "${enable_gtk_doc+set}" = set; then : + enableval=$enable_gtk_doc; +else + enable_gtk_doc=no +fi + + + if test x$enable_gtk_doc = xyes; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-doc >= \$GTKDOC_REQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gtk-doc >= $GTKDOC_REQ") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + : +else + as_fn_error $? "You need to have gtk-doc >= $GTKDOC_REQ installed to build $PACKAGE_NAME" "$LINENO" 5 +fi + if test "x$PACKAGE_NAME" != "xglib"; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKDOC_DEPS" >&5 +$as_echo_n "checking for GTKDOC_DEPS... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$GTKDOC_DEPS_CFLAGS"; then + pkg_cv_GTKDOC_DEPS_CFLAGS="$GTKDOC_DEPS_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTKDOC_DEPS_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$GTKDOC_DEPS_LIBS"; then + pkg_cv_GTKDOC_DEPS_LIBS="$GTKDOC_DEPS_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTKDOC_DEPS_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0"` + else + GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0"` + fi + # Put the nasty error message in config.log where it belongs + echo "$GTKDOC_DEPS_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0) were not met: + +$GTKDOC_DEPS_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables GTKDOC_DEPS_CFLAGS +and GTKDOC_DEPS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 +elif test $pkg_failed = untried; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables GTKDOC_DEPS_CFLAGS +and GTKDOC_DEPS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } +else + GTKDOC_DEPS_CFLAGS=$pkg_cv_GTKDOC_DEPS_CFLAGS + GTKDOC_DEPS_LIBS=$pkg_cv_GTKDOC_DEPS_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + : +fi + fi + if test -z "$SED"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED fi - HTML_DIR="$with_html_dir" - - - # Check whether --enable-gtk-doc was given. -if test "${enable_gtk_doc+set}" = set; then : - enableval=$enable_gtk_doc; -else - enable_gtk_doc=no fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + fi + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5 $as_echo_n "checking whether to build gtk-doc documentation... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5 $as_echo "$enable_gtk_doc" >&6; } - if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then - as_fn_error $? " - You must have $gtk_doc_requires installed to build documentation for - $PACKAGE_NAME. Please install gtk-doc or disable building the - documentation by adding '--disable-gtk-doc' to '$0'." "$LINENO" 5 - fi - - if test "x$PACKAGE_NAME" != "xglib"; then - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKDOC_DEPS" >&5 -$as_echo_n "checking for GTKDOC_DEPS... " >&6; } - -if test -n "$GTKDOC_DEPS_CFLAGS"; then - pkg_cv_GTKDOC_DEPS_CFLAGS="$GTKDOC_DEPS_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GTKDOC_DEPS_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$GTKDOC_DEPS_LIBS"; then - pkg_cv_GTKDOC_DEPS_LIBS="$GTKDOC_DEPS_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GTKDOC_DEPS_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` - else - GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$GTKDOC_DEPS_PKG_ERRORS" >&5 - - : -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - : -else - GTKDOC_DEPS_CFLAGS=$pkg_cv_GTKDOC_DEPS_CFLAGS - GTKDOC_DEPS_LIBS=$pkg_cv_GTKDOC_DEPS_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -fi - fi - # Check whether --enable-gtk-doc-html was given. if test "${enable_gtk_doc_html+set}" = set; then : enableval=$enable_gtk_doc_html; @@ -12771,18 +15276,6 @@ enable_gtk_doc_pdf=no fi - if test -z "$AM_DEFAULT_VERBOSITY"; then - AM_DEFAULT_VERBOSITY=1 - fi - - - if test x$have_gtk_doc = xyes; then - HAVE_GTK_DOC_TRUE= - HAVE_GTK_DOC_FALSE='#' -else - HAVE_GTK_DOC_TRUE='#' - HAVE_GTK_DOC_FALSE= -fi if test x$enable_gtk_doc = xyes; then ENABLE_GTK_DOC_TRUE= @@ -12816,107 +15309,285 @@ GTK_DOC_USE_LIBTOOL_FALSE= fi - if test -n "$GTKDOC_REBASE"; then - GTK_DOC_USE_REBASE_TRUE= - GTK_DOC_USE_REBASE_FALSE='#' + + + + + + + + # Find any Python interpreter. + if test -z "$PYTHON"; then + for ac_prog in python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PYTHON+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PYTHON in + [\\/]* | ?:[\\/]*) + ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PYTHON=$ac_cv_path_PYTHON +if test -n "$PYTHON"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +$as_echo "$PYTHON" >&6; } else - GTK_DOC_USE_REBASE_TRUE='#' - GTK_DOC_USE_REBASE_FALSE= + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$PYTHON" && break +done +test -n "$PYTHON" || PYTHON=":" + fi + am_display_PYTHON=python -GLIB_VERSION_REQUIRED=2.32 -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 -$as_echo_n "checking for GLIB... " >&6; } + if test "$PYTHON" = :; then + as_fn_error $? "no suitable Python interpreter found" "$LINENO" 5 + else -if test -n "$GLIB_CFLAGS"; then - pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= \$GLIB_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "glib-2.0 >= $GLIB_VERSION_REQUIRED") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= $GLIB_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 +$as_echo_n "checking for $am_display_PYTHON version... " >&6; } +if ${am_cv_python_version+:} false; then : + $as_echo_n "(cached) " >&6 else - pkg_failed=yes -fi - else - pkg_failed=untried + am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"` fi -if test -n "$GLIB_LIBS"; then - pkg_cv_GLIB_LIBS="$GLIB_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= \$GLIB_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "glib-2.0 >= $GLIB_VERSION_REQUIRED") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= $GLIB_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 +$as_echo "$am_cv_python_version" >&6; } + PYTHON_VERSION=$am_cv_python_version + + + + PYTHON_PREFIX='${prefix}' + + PYTHON_EXEC_PREFIX='${exec_prefix}' + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 +$as_echo_n "checking for $am_display_PYTHON platform... " >&6; } +if ${am_cv_python_platform+:} false; then : + $as_echo_n "(cached) " >&6 else - pkg_failed=yes + am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` fi - else - pkg_failed=untried +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 +$as_echo "$am_cv_python_platform" >&6; } + PYTHON_PLATFORM=$am_cv_python_platform + + + # Just factor out some code duplication. + am_python_setup_sysconfig="\ +import sys +# Prefer sysconfig over distutils.sysconfig, for better compatibility +# with python 3.x. See automake bug#10227. +try: + import sysconfig +except ImportError: + can_use_sysconfig = 0 +else: + can_use_sysconfig = 1 +# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs: +# +try: + from platform import python_implementation + if python_implementation() == 'CPython' and sys.version[:3] == '2.7': + can_use_sysconfig = 0 +except ImportError: + pass" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 +$as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } +if ${am_cv_python_pythondir+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$prefix" = xNONE + then + am_py_prefix=$ac_default_prefix + else + am_py_prefix=$prefix + fi + am_cv_python_pythondir=`$PYTHON -c " +$am_python_setup_sysconfig +if can_use_sysconfig: + sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) +else: + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') +sys.stdout.write(sitedir)"` + case $am_cv_python_pythondir in + $am_py_prefix*) + am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` + am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` + ;; + *) + case $am_py_prefix in + /usr|/System*) ;; + *) + am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages + ;; + esac + ;; + esac + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 +$as_echo "$am_cv_python_pythondir" >&6; } + pythondir=$am_cv_python_pythondir -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + pkgpythondir=\${pythondir}/$PACKAGE -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 +$as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } +if ${am_cv_python_pyexecdir+:} false; then : + $as_echo_n "(cached) " >&6 else - _pkg_short_errors_supported=no + if test "x$exec_prefix" = xNONE + then + am_py_exec_prefix=$am_py_prefix + else + am_py_exec_prefix=$exec_prefix + fi + am_cv_python_pyexecdir=`$PYTHON -c " +$am_python_setup_sysconfig +if can_use_sysconfig: + sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'}) +else: + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') +sys.stdout.write(sitedir)"` + case $am_cv_python_pyexecdir in + $am_py_exec_prefix*) + am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` + am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` + ;; + *) + case $am_py_exec_prefix in + /usr|/System*) ;; + *) + am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages + ;; + esac + ;; + esac + fi - if test $_pkg_short_errors_supported = yes; then - GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= $GLIB_VERSION_REQUIRED" 2>&1` - else - GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= $GLIB_VERSION_REQUIRED" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$GLIB_PKG_ERRORS" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 +$as_echo "$am_cv_python_pyexecdir" >&6; } + pyexecdir=$am_cv_python_pyexecdir - as_fn_error $? "Package requirements (glib-2.0 >= $GLIB_VERSION_REQUIRED) were not met: -$GLIB_PKG_ERRORS -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. + pkgpyexecdir=\${pyexecdir}/$PACKAGE -Alternatively, you may set the environment variables GLIB_CFLAGS -and GLIB_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. -Alternatively, you may set the environment variables GLIB_CFLAGS -and GLIB_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS - GLIB_LIBS=$pkg_cv_GLIB_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + fi + + + + + build_plugin_docs=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build plugin documentation" >&5 +$as_echo_n "checking whether to build plugin documentation... " >&6; } + if test x$enable_gtk_doc = xyes; then + if test x$PYTHON != x; then + build_plugin_docs=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (python not found)" >&5 +$as_echo "no (python not found)" >&6; } + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (gtk-doc disabled or not available)" >&5 +$as_echo "no (gtk-doc disabled or not available)" >&6; } + fi + + if test x$build_plugin_docs = xyes; then + ENABLE_PLUGIN_DOCS_TRUE= + ENABLE_PLUGIN_DOCS_FALSE='#' +else + ENABLE_PLUGIN_DOCS_TRUE='#' + ENABLE_PLUGIN_DOCS_FALSE= +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tan in -lm" >&5 +$as_echo_n "checking for tan in -lm... " >&6; } +if ${ac_cv_lib_m_tan+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char tan (); +int +main () +{ +return tan (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_tan=yes +else + ac_cv_lib_m_tan=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_tan" >&5 +$as_echo "$ac_cv_lib_m_tan" >&6; } +if test "x$ac_cv_lib_m_tan" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBM 1 +_ACEOF + + LIBS="-lm $LIBS" fi @@ -12926,7 +15597,7 @@ else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 @@ -12966,164 +15637,151 @@ DLOPEN_LIBS="-ldl" fi -fi +fi + + + + + EXP_VAR=LIBDIR + FROM_VAR=$libdir + + prefix_save=$prefix + exec_prefix_save=$exec_prefix + + if test "x$prefix" = "xNONE"; then + prefix="$ac_default_prefix" + fi + if test "x$exec_prefix" = "xNONE"; then + exec_prefix=$prefix + fi + + full_var="$FROM_VAR" + while true; do + new_full_var="`eval echo $full_var`" + if test "x$new_full_var" = "x$full_var"; then break; fi + full_var=$new_full_var + done + full_var=$new_full_var + LIBDIR="$full_var" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GStreamer API version" >&5 -$as_echo_n "checking for GStreamer API version... " >&6; } -if $PKG_CONFIG --exists "gstreamer-1.0"; then - gst_version=`$PKG_CONFIG --modversion "gstreamer-1.0"` - gst_major_version=`echo "$gst_version" | cut -d'.' -f1` - gst_minor_version=`echo "$gst_version" | cut -d'.' -f2` - GST_API_VERSION="${gst_major_version}.${gst_minor_version}" - GST_PKG_VERSION="1.0" -fi -if test -z "$GST_PKG_VERSION"; then - as_fn_error $? "gstreamer-1.0 was not found" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GST_API_VERSION" >&5 -$as_echo "$GST_API_VERSION" >&6; } + prefix=$prefix_save + exec_prefix=$exec_prefix_save cat >>confdefs.h <<_ACEOF -#define GST_API_VERSION_S "$GST_API_VERSION" +#define LIBDIR "$LIBDIR" _ACEOF -case $GST_API_VERSION in -1.2) - GST_VERSION_REQUIRED=1.1.90 - GST_PLUGINS_BASE_VERSION_REQUIRED=1.1.0 - GST_PLUGINS_BAD_VERSION_REQUIRED=1.1.0 - ;; -1.4) - GST_VERSION_REQUIRED=1.2.90 - GST_PLUGINS_BASE_VERSION_REQUIRED=1.3.0 - GST_PLUGINS_BAD_VERSION_REQUIRED=1.3.0 - ;; -1.[5-6]) - GST_VERSION_REQUIRED=1.5.0 - GST_PLUGINS_BASE_VERSION_REQUIRED=1.5.0 - GST_PLUGINS_BAD_VERSION_REQUIRED=1.5.0 - ;; -1.[7-8]) - GST_VERSION_REQUIRED=1.7.0 - GST_PLUGINS_BASE_VERSION_REQUIRED=1.7.0 - GST_PLUGINS_BAD_VERSION_REQUIRED=1.7.0 - ;; -*) - as_fn_error $? "unsupported GStreamer API version $GST_API_VERSION" "$LINENO" 5 - ;; -esac + EXP_VAR=PLUGINDIR + FROM_VAR=${libdir}/gstreamer-$GST_API_VERSION + prefix_save=$prefix + exec_prefix_save=$exec_prefix + if test "x$prefix" = "xNONE"; then + prefix="$ac_default_prefix" + fi + if test "x$exec_prefix" = "xNONE"; then + exec_prefix=$prefix + fi -USE_GST_API_1_2p="no" -USE_GST_API_1_4p="no" -as_arg_v1=$GST_API_VERSION -as_arg_v2=1.2 -awk "$as_awk_strverscmp" v1="$as_arg_v1" v2="$as_arg_v2" /dev/null -case $? in #( - 1) : - ;; #( - 0) : - USE_GST_API_1_2p="yes" ;; #( - 2) : - USE_GST_API_1_2p="yes" ;; #( - *) : - ;; -esac -as_arg_v1=$GST_API_VERSION -as_arg_v2=1.4 -awk "$as_awk_strverscmp" v1="$as_arg_v1" v2="$as_arg_v2" /dev/null -case $? in #( - 1) : - ;; #( - 0) : - USE_GST_API_1_4p="yes" ;; #( - 2) : - USE_GST_API_1_4p="yes" ;; #( - *) : - ;; -esac - if test "$USE_GST_API_1_2p" = "yes"; then - USE_GST_API_1_2p_TRUE= - USE_GST_API_1_2p_FALSE='#' -else - USE_GST_API_1_2p_TRUE='#' - USE_GST_API_1_2p_FALSE= -fi - - if test "$USE_GST_API_1_4p" = "yes"; then - USE_GST_API_1_4p_TRUE= - USE_GST_API_1_4p_FALSE='#' -else - USE_GST_API_1_4p_TRUE='#' - USE_GST_API_1_4p_FALSE= -fi + full_var="$FROM_VAR" + while true; do + new_full_var="`eval echo $full_var`" + if test "x$new_full_var" = "x$full_var"; then break; fi + full_var=$new_full_var + done + full_var=$new_full_var + PLUGINDIR="$full_var" + prefix=$prefix_save + exec_prefix=$exec_prefix_save cat >>confdefs.h <<_ACEOF -#define GST_PKG_VERSION_S "$GST_PKG_VERSION" +#define PLUGINDIR "$PLUGINDIR" _ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $PLUGINDIR as the plugin install location" >&5 +$as_echo "$as_me: Using $PLUGINDIR as the plugin install location" >&6;} + + plugindir="\$(libdir)/gstreamer-$GST_API_VERSION" + + -if test "$GST_API_VERSION" = "1.2"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: support for GStreamer 1.2 is obsolete, and will be removed" >&5 -$as_echo "$as_me: WARNING: support for GStreamer 1.2 is obsolete, and will be removed" >&2;} -fi + + + + + + + + + + + GLIB_REQ=$GLIB_REQ + if test "x$GLIB_REQ" = "x" + then + as_fn_error $? "Please specify a required version for GLib 2.0" "$LINENO" 5 + fi + + + + which="glib-2.0 >= $GLIB_REQ gobject-2.0 gmodule-no-export-2.0" + required="no" pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST" >&5 -$as_echo_n "checking for GST... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 +$as_echo_n "checking for GLIB... " >&6; } -if test -n "$GST_CFLAGS"; then - pkg_cv_GST_CFLAGS="$GST_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-\$GST_PKG_VERSION >= \$GST_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gstreamer-$GST_PKG_VERSION >= $GST_VERSION_REQUIRED") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$GLIB_CFLAGS"; then + pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$which\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$which") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GST_CFLAGS=`$PKG_CONFIG --cflags "gstreamer-$GST_PKG_VERSION >= $GST_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "$which" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$GST_LIBS"; then - pkg_cv_GST_LIBS="$GST_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-\$GST_PKG_VERSION >= \$GST_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gstreamer-$GST_PKG_VERSION >= $GST_VERSION_REQUIRED") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$GLIB_LIBS"; then + pkg_cv_GLIB_LIBS="$GLIB_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$which\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$which") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GST_LIBS=`$PKG_CONFIG --libs "gstreamer-$GST_PKG_VERSION >= $GST_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "$which" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -13131,182 +15789,213 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GST_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gstreamer-$GST_PKG_VERSION >= $GST_VERSION_REQUIRED" 2>&1` + GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$which"` else - GST_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gstreamer-$GST_PKG_VERSION >= $GST_VERSION_REQUIRED" 2>&1` + GLIB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$which"` fi # Put the nasty error message in config.log where it belongs - echo "$GST_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (gstreamer-$GST_PKG_VERSION >= $GST_VERSION_REQUIRED) were not met: + echo "$GLIB_PKG_ERRORS" >&5 -$GST_PKG_ERRORS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. + HAVE_GLIB="no" + if test "x$required" = "xyes"; then + as_fn_error $? "$GLIB_PKG_ERRORS" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: $GLIB_PKG_ERRORS" >&5 +$as_echo "$as_me: $GLIB_PKG_ERRORS" >&6;} + fi -Alternatively, you may set the environment variables GST_CFLAGS -and GST_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. -Alternatively, you may set the environment variables GST_CFLAGS -and GST_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. + HAVE_GLIB="no" + if test "x$required" = "xyes"; then + as_fn_error $? "$GLIB_PKG_ERRORS" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: $GLIB_PKG_ERRORS" >&5 +$as_echo "$as_me: $GLIB_PKG_ERRORS" >&6;} + fi -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } else - GST_CFLAGS=$pkg_cv_GST_CFLAGS - GST_LIBS=$pkg_cv_GST_LIBS + GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS + GLIB_LIBS=$pkg_cv_GLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } + HAVE_GLIB="yes" + fi -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST_BASE" >&5 -$as_echo_n "checking for GST_BASE... " >&6; } -if test -n "$GST_BASE_CFLAGS"; then - pkg_cv_GST_BASE_CFLAGS="$GST_BASE_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-base-\$GST_PKG_VERSION >= \$GST_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gstreamer-base-$GST_PKG_VERSION >= $GST_VERSION_REQUIRED") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GST_BASE_CFLAGS=`$PKG_CONFIG --cflags "gstreamer-base-$GST_PKG_VERSION >= $GST_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + + if test "x$HAVE_GLIB" = "xno"; then + as_fn_error $? "This package requires GLib >= $GLIB_REQ to compile." "$LINENO" 5 + fi + + GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_THREADS_MANDATORY" + + if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then + GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_DEPRECATED" + fi + + # Check whether --enable-gobject-cast-checks was given. +if test "${enable_gobject_cast_checks+set}" = set; then : + enableval=$enable_gobject_cast_checks; enable_gobject_cast_checks=$enableval else - pkg_failed=yes -fi - else - pkg_failed=untried + enable_gobject_cast_checks=auto fi -if test -n "$GST_BASE_LIBS"; then - pkg_cv_GST_BASE_LIBS="$GST_BASE_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-base-\$GST_PKG_VERSION >= \$GST_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gstreamer-base-$GST_PKG_VERSION >= $GST_VERSION_REQUIRED") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GST_BASE_LIBS=`$PKG_CONFIG --libs "gstreamer-base-$GST_PKG_VERSION >= $GST_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + + + if test "x$enable_gobject_cast_checks" = "xauto"; then + if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then + enable_gobject_cast_checks=yes + else + enable_gobject_cast_checks=no + fi + fi + + if test "x$enable_gobject_cast_checks" = "xno"; then + GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_CAST_CHECKS" + fi + + # Check whether --enable-glib-asserts was given. +if test "${enable_glib_asserts+set}" = set; then : + enableval=$enable_glib_asserts; enable_glib_assertions=$enableval else - pkg_failed=yes -fi - else - pkg_failed=untried + enable_glib_assertions=yes fi + if test "x$enable_glib_assertions" = "xno"; then + GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_ASSERT" + fi -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glib-genmarshal" >&5 +$as_echo_n "checking for glib-genmarshal... " >&6; } + if test "x$GLIB_GENMARSHAL" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_GENMARSHAL (from environment)" >&5 +$as_echo "$GLIB_GENMARSHAL (from environment)" >&6; } + else + GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` + if $GLIB_GENMARSHAL --version 2>/dev/null >/dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_GENMARSHAL (from pkg-config path)" >&5 +$as_echo "$GLIB_GENMARSHAL (from pkg-config path)" >&6; } + else + # Extract the first word of "glib-genmarshal", so it can be a program name with args. +set dummy glib-genmarshal; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GLIB_GENMARSHAL+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GLIB_GENMARSHAL in + [\\/]* | ?:[\\/]*) + ac_cv_path_GLIB_GENMARSHAL="$GLIB_GENMARSHAL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GLIB_GENMARSHAL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes + test -z "$ac_cv_path_GLIB_GENMARSHAL" && ac_cv_path_GLIB_GENMARSHAL="glib-genmarshal" + ;; +esac +fi +GLIB_GENMARSHAL=$ac_cv_path_GLIB_GENMARSHAL +if test -n "$GLIB_GENMARSHAL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_GENMARSHAL" >&5 +$as_echo "$GLIB_GENMARSHAL" >&6; } else - _pkg_short_errors_supported=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - if test $_pkg_short_errors_supported = yes; then - GST_BASE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gstreamer-base-$GST_PKG_VERSION >= $GST_VERSION_REQUIRED" 2>&1` - else - GST_BASE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gstreamer-base-$GST_PKG_VERSION >= $GST_VERSION_REQUIRED" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$GST_BASE_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (gstreamer-base-$GST_PKG_VERSION >= $GST_VERSION_REQUIRED) were not met: -$GST_BASE_PKG_ERRORS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_GENMARSHAL" >&5 +$as_echo "$GLIB_GENMARSHAL" >&6; } + fi + fi + if ! $GLIB_GENMARSHAL --version 2>/dev/null >/dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $GLIB_GENMARSHAL does not seem to work!" >&5 +$as_echo "$as_me: WARNING: $GLIB_GENMARSHAL does not seem to work!" >&2;} + fi -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. -Alternatively, you may set the environment variables GST_BASE_CFLAGS -and GST_BASE_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glib-mkenums" >&5 +$as_echo_n "checking for glib-mkenums... " >&6; } + if test "x$GLIB_MKENUMS" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_MKENUMS (from environment)" >&5 +$as_echo "$GLIB_MKENUMS (from environment)" >&6; } + else + GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_MKENUMS" >&5 +$as_echo "$GLIB_MKENUMS" >&6; } + fi + if ! $GLIB_MKENUMS --version 2>/dev/null >/dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $GLIB_MKENUMS does not seem to work!" >&5 +$as_echo "$as_me: WARNING: $GLIB_MKENUMS does not seem to work!" >&2;} + fi -Alternatively, you may set the environment variables GST_BASE_CFLAGS -and GST_BASE_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - GST_BASE_CFLAGS=$pkg_cv_GST_BASE_CFLAGS - GST_BASE_LIBS=$pkg_cv_GST_BASE_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST_PLUGINS_BASE" >&5 -$as_echo_n "checking for GST_PLUGINS_BASE... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GIO" >&5 +$as_echo_n "checking for GIO... " >&6; } -if test -n "$GST_PLUGINS_BASE_CFLAGS"; then - pkg_cv_GST_PLUGINS_BASE_CFLAGS="$GST_PLUGINS_BASE_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-plugins-base-\$GST_PKG_VERSION >= \$GST_PLUGINS_BASE_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gstreamer-plugins-base-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$GIO_CFLAGS"; then + pkg_cv_GIO_CFLAGS="$GIO_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-2.0 >= \$GLIB_REQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gio-2.0 >= $GLIB_REQ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GST_PLUGINS_BASE_CFLAGS=`$PKG_CONFIG --cflags "gstreamer-plugins-base-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_GIO_CFLAGS=`$PKG_CONFIG --cflags "gio-2.0 >= $GLIB_REQ" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$GST_PLUGINS_BASE_LIBS"; then - pkg_cv_GST_PLUGINS_BASE_LIBS="$GST_PLUGINS_BASE_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-plugins-base-\$GST_PKG_VERSION >= \$GST_PLUGINS_BASE_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gstreamer-plugins-base-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$GIO_LIBS"; then + pkg_cv_GIO_LIBS="$GIO_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-2.0 >= \$GLIB_REQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gio-2.0 >= $GLIB_REQ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GST_PLUGINS_BASE_LIBS=`$PKG_CONFIG --libs "gstreamer-plugins-base-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_GIO_LIBS=`$PKG_CONFIG --libs "gio-2.0 >= $GLIB_REQ" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -13314,91 +16003,123 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GST_PLUGINS_BASE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gstreamer-plugins-base-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED" 2>&1` + GIO_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "gio-2.0 >= $GLIB_REQ"` else - GST_PLUGINS_BASE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gstreamer-plugins-base-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED" 2>&1` + GIO_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gio-2.0 >= $GLIB_REQ"` fi # Put the nasty error message in config.log where it belongs - echo "$GST_PLUGINS_BASE_PKG_ERRORS" >&5 + echo "$GIO_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (gstreamer-plugins-base-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED) were not met: + as_fn_error $? "Package requirements (gio-2.0 >= $GLIB_REQ) were not met: -$GST_PLUGINS_BASE_PKG_ERRORS +$GIO_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. -Alternatively, you may set the environment variables GST_PLUGINS_BASE_CFLAGS -and GST_PLUGINS_BASE_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 +Alternatively, you may set the environment variables GIO_CFLAGS +and GIO_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. -Alternatively, you may set the environment variables GST_PLUGINS_BASE_CFLAGS -and GST_PLUGINS_BASE_LIBS to avoid the need to call pkg-config. +Alternatively, you may set the environment variables GIO_CFLAGS +and GIO_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else - GST_PLUGINS_BASE_CFLAGS=$pkg_cv_GST_PLUGINS_BASE_CFLAGS - GST_PLUGINS_BASE_LIBS=$pkg_cv_GST_PLUGINS_BASE_LIBS + GIO_CFLAGS=$pkg_cv_GIO_CFLAGS + GIO_LIBS=$pkg_cv_GIO_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - + : fi -if test "$GST_API_VERSION" = "0.10"; then + if test "x$HAVE_GIO" = "xno"; then + as_fn_error $? "This package requires GIO >= $GLIB_REQ to compile." "$LINENO" 5 + fi + + GIO_MODULE_DIR="`$PKG_CONFIG --variable=giomoduledir gio-2.0`" + +cat >>confdefs.h <<_ACEOF +#define GIO_MODULE_DIR "$GIO_MODULE_DIR" +_ACEOF + + GIO_LIBDIR="`$PKG_CONFIG --variable=libdir gio-2.0`" + +cat >>confdefs.h <<_ACEOF +#define GIO_LIBDIR "$GIO_LIBDIR" +_ACEOF + + GIO_PREFIX="`$PKG_CONFIG --variable=prefix gio-2.0`" + +cat >>confdefs.h <<_ACEOF +#define GIO_PREFIX "$GIO_PREFIX" +_ACEOF + + + + + + + + + + module=gstreamer-$GST_API_VERSION + minver=$GST_REQ + name="GStreamer" + required=yes pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST_INTERFACES" >&5 -$as_echo_n "checking for GST_INTERFACES... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST" >&5 +$as_echo_n "checking for GST... " >&6; } -if test -n "$GST_INTERFACES_CFLAGS"; then - pkg_cv_GST_INTERFACES_CFLAGS="$GST_INTERFACES_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-interfaces-\$GST_PKG_VERSION >= \$GST_PLUGINS_BASE_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gstreamer-interfaces-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$GST_CFLAGS"; then + pkg_cv_GST_CFLAGS="$GST_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GST_INTERFACES_CFLAGS=`$PKG_CONFIG --cflags "gstreamer-interfaces-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_GST_CFLAGS=`$PKG_CONFIG --cflags "$module >= $minver" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$GST_INTERFACES_LIBS"; then - pkg_cv_GST_INTERFACES_LIBS="$GST_INTERFACES_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-interfaces-\$GST_PKG_VERSION >= \$GST_PLUGINS_BASE_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gstreamer-interfaces-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$GST_LIBS"; then + pkg_cv_GST_LIBS="$GST_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GST_INTERFACES_LIBS=`$PKG_CONFIG --libs "gstreamer-interfaces-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_GST_LIBS=`$PKG_CONFIG --libs "$module >= $minver" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -13406,92 +16127,135 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GST_INTERFACES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gstreamer-interfaces-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED" 2>&1` + GST_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$module >= $minver"` else - GST_INTERFACES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gstreamer-interfaces-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED" 2>&1` + GST_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$module >= $minver"` fi # Put the nasty error message in config.log where it belongs - echo "$GST_INTERFACES_PKG_ERRORS" >&5 + echo "$GST_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + + HAVE_GST="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi + +elif test $pkg_failed = untried; then + + HAVE_GST="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi + +else + GST_CFLAGS=$pkg_cv_GST_CFLAGS + GST_LIBS=$pkg_cv_GST_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + HAVE_GST="yes" + +fi + + + if test -z $GST_TOOLS_DIR; then + GST_TOOLS_DIR=`$PKG_CONFIG --variable=toolsdir gstreamer-$GST_API_VERSION` + if test -z $GST_TOOLS_DIR; then + as_fn_error $? "no tools dir set in GStreamer pkg-config file, core upgrade needed." "$LINENO" 5 + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: using GStreamer tools in $GST_TOOLS_DIR" >&5 +$as_echo "$as_me: using GStreamer tools in $GST_TOOLS_DIR" >&6;} + + + if test -z $GST_PLUGINS_DIR; then + GST_PLUGINS_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-$GST_API_VERSION` + if test -z $GST_PLUGINS_DIR; then + as_fn_error $? "no pluginsdir set in GStreamer pkg-config file, core upgrade needed." "$LINENO" 5 + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: using GStreamer plug-ins in $GST_PLUGINS_DIR" >&5 +$as_echo "$as_me: using GStreamer plug-ins in $GST_PLUGINS_DIR" >&6;} - as_fn_error $? "Package requirements (gstreamer-interfaces-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED) were not met: -$GST_INTERFACES_PKG_ERRORS -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GStreamer API version" >&5 +$as_echo_n "checking for GStreamer API version... " >&6; } +gst_api_version=`$PKG_CONFIG --modversion "gstreamer-$GST_API_VERSION"` +gst_major_version=`echo "$gst_api_version" | cut -d'.' -f1` +gst_minor_version=`echo "$gst_api_version" | cut -d'.' -f2` +GST_VERSION="${gst_major_version}.${gst_minor_version}" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GST_VERSION" >&5 +$as_echo "$GST_VERSION" >&6; } -Alternatively, you may set the environment variables GST_INTERFACES_CFLAGS -and GST_INTERFACES_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. +cat >>confdefs.h <<_ACEOF +#define GST_API_VERSION_S "$GST_VERSION" +_ACEOF -Alternatively, you may set the environment variables GST_INTERFACES_CFLAGS -and GST_INTERFACES_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - GST_INTERFACES_CFLAGS=$pkg_cv_GST_INTERFACES_CFLAGS - GST_INTERFACES_LIBS=$pkg_cv_GST_INTERFACES_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -fi + module=gstreamer-base-$GST_API_VERSION + minver=$GST_REQ + name="GStreamer Base Libraries" + required=yes pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST_ALLOCATORS" >&5 -$as_echo_n "checking for GST_ALLOCATORS... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST_BASE" >&5 +$as_echo_n "checking for GST_BASE... " >&6; } -if test -n "$GST_ALLOCATORS_CFLAGS"; then - pkg_cv_GST_ALLOCATORS_CFLAGS="$GST_ALLOCATORS_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-allocators-\$GST_PKG_VERSION >= \$GST_PLUGINS_BASE_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gstreamer-allocators-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$GST_BASE_CFLAGS"; then + pkg_cv_GST_BASE_CFLAGS="$GST_BASE_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GST_ALLOCATORS_CFLAGS=`$PKG_CONFIG --cflags "gstreamer-allocators-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_GST_BASE_CFLAGS=`$PKG_CONFIG --cflags "$module >= $minver" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$GST_ALLOCATORS_LIBS"; then - pkg_cv_GST_ALLOCATORS_LIBS="$GST_ALLOCATORS_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-allocators-\$GST_PKG_VERSION >= \$GST_PLUGINS_BASE_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gstreamer-allocators-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$GST_BASE_LIBS"; then + pkg_cv_GST_BASE_LIBS="$GST_BASE_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GST_ALLOCATORS_LIBS=`$PKG_CONFIG --libs "gstreamer-allocators-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_GST_BASE_LIBS=`$PKG_CONFIG --libs "$module >= $minver" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -13499,91 +16263,101 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GST_ALLOCATORS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gstreamer-allocators-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED" 2>&1` + GST_BASE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$module >= $minver"` else - GST_ALLOCATORS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gstreamer-allocators-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED" 2>&1` + GST_BASE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$module >= $minver"` fi # Put the nasty error message in config.log where it belongs - echo "$GST_ALLOCATORS_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (gstreamer-allocators-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED) were not met: + echo "$GST_BASE_PKG_ERRORS" >&5 -$GST_ALLOCATORS_PKG_ERRORS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. + HAVE_GST_BASE="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_BASE_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_BASE_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi -Alternatively, you may set the environment variables GST_ALLOCATORS_CFLAGS -and GST_ALLOCATORS_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. -Alternatively, you may set the environment variables GST_ALLOCATORS_CFLAGS -and GST_ALLOCATORS_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. + HAVE_GST_BASE="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_BASE_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_BASE_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } else - GST_ALLOCATORS_CFLAGS=$pkg_cv_GST_ALLOCATORS_CFLAGS - GST_ALLOCATORS_LIBS=$pkg_cv_GST_ALLOCATORS_LIBS + GST_BASE_CFLAGS=$pkg_cv_GST_BASE_CFLAGS + GST_BASE_LIBS=$pkg_cv_GST_BASE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } + HAVE_GST_BASE="yes" + fi + + + + module=gstreamer-plugins-base-$GST_API_VERSION + minver=$GST_PBREQ + name="GStreamer Base Plugins" + required=yes + pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST_VIDEO" >&5 -$as_echo_n "checking for GST_VIDEO... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST_PLUGINS_BASE" >&5 +$as_echo_n "checking for GST_PLUGINS_BASE... " >&6; } -if test -n "$GST_VIDEO_CFLAGS"; then - pkg_cv_GST_VIDEO_CFLAGS="$GST_VIDEO_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-video-\$GST_PKG_VERSION >= \$GST_PLUGINS_BASE_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gstreamer-video-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$GST_PLUGINS_BASE_CFLAGS"; then + pkg_cv_GST_PLUGINS_BASE_CFLAGS="$GST_PLUGINS_BASE_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GST_VIDEO_CFLAGS=`$PKG_CONFIG --cflags "gstreamer-video-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_GST_PLUGINS_BASE_CFLAGS=`$PKG_CONFIG --cflags "$module >= $minver" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$GST_VIDEO_LIBS"; then - pkg_cv_GST_VIDEO_LIBS="$GST_VIDEO_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-video-\$GST_PKG_VERSION >= \$GST_PLUGINS_BASE_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gstreamer-video-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$GST_PLUGINS_BASE_LIBS"; then + pkg_cv_GST_PLUGINS_BASE_LIBS="$GST_PLUGINS_BASE_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GST_VIDEO_LIBS=`$PKG_CONFIG --libs "gstreamer-video-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_GST_PLUGINS_BASE_LIBS=`$PKG_CONFIG --libs "$module >= $minver" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -13591,92 +16365,115 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GST_VIDEO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gstreamer-video-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED" 2>&1` + GST_PLUGINS_BASE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$module >= $minver"` else - GST_VIDEO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gstreamer-video-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED" 2>&1` + GST_PLUGINS_BASE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$module >= $minver"` fi # Put the nasty error message in config.log where it belongs - echo "$GST_VIDEO_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (gstreamer-video-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED) were not met: + echo "$GST_PLUGINS_BASE_PKG_ERRORS" >&5 -$GST_VIDEO_PKG_ERRORS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. + HAVE_GST_PLUGINS_BASE="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_PLUGINS_BASE_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_PLUGINS_BASE_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi -Alternatively, you may set the environment variables GST_VIDEO_CFLAGS -and GST_VIDEO_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. -Alternatively, you may set the environment variables GST_VIDEO_CFLAGS -and GST_VIDEO_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. + HAVE_GST_PLUGINS_BASE="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_PLUGINS_BASE_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_PLUGINS_BASE_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } else - GST_VIDEO_CFLAGS=$pkg_cv_GST_VIDEO_CFLAGS - GST_VIDEO_LIBS=$pkg_cv_GST_VIDEO_LIBS + GST_PLUGINS_BASE_CFLAGS=$pkg_cv_GST_PLUGINS_BASE_CFLAGS + GST_PLUGINS_BASE_LIBS=$pkg_cv_GST_PLUGINS_BASE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } + HAVE_GST_PLUGINS_BASE="yes" + fi -if test "$USE_GST_API_1_2p" != "yes" && test "$USE_GST_API_1_4p" != "yes"; then + + + if test "x$HAVE_GST_PLUGINS_BASE" = "xyes"; then + if test -z $GSTPB_PLUGINS_DIR; then + GSTPB_PLUGINS_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-base-$GST_API_VERSION` + if test -z $GSTPB_PLUGINS_DIR; then + as_fn_error $? "no pluginsdir set in GStreamer Base Plugins pkg-config file" "$LINENO" 5 + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR" >&5 +$as_echo "$as_me: using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR" >&6;} + GST_PLUGINS_BASE_DIR="$GSTPB_PLUGINS_DIR/gst:$GSTPB_PLUGINS_DIR/sys:$GSTPB_PLUGINS_DIR/ext" + + + fi + + + + module=gstreamer-allocators-$GST_API_VERSION + minver=$GST_PBREQ + name="yes" + required="yes" pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST_BASEVIDEO" >&5 -$as_echo_n "checking for GST_BASEVIDEO... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST_ALLOCATORS" >&5 +$as_echo_n "checking for GST_ALLOCATORS... " >&6; } -if test -n "$GST_BASEVIDEO_CFLAGS"; then - pkg_cv_GST_BASEVIDEO_CFLAGS="$GST_BASEVIDEO_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-basevideo-\$GST_PKG_VERSION >= \$GST_PLUGINS_BAD_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gstreamer-basevideo-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$GST_ALLOCATORS_CFLAGS"; then + pkg_cv_GST_ALLOCATORS_CFLAGS="$GST_ALLOCATORS_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GST_BASEVIDEO_CFLAGS=`$PKG_CONFIG --cflags "gstreamer-basevideo-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_GST_ALLOCATORS_CFLAGS=`$PKG_CONFIG --cflags "$module >= $minver" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$GST_BASEVIDEO_LIBS"; then - pkg_cv_GST_BASEVIDEO_LIBS="$GST_BASEVIDEO_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-basevideo-\$GST_PKG_VERSION >= \$GST_PLUGINS_BAD_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gstreamer-basevideo-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$GST_ALLOCATORS_LIBS"; then + pkg_cv_GST_ALLOCATORS_LIBS="$GST_ALLOCATORS_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GST_BASEVIDEO_LIBS=`$PKG_CONFIG --libs "gstreamer-basevideo-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_GST_ALLOCATORS_LIBS=`$PKG_CONFIG --libs "$module >= $minver" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -13684,100 +16481,100 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GST_BASEVIDEO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gstreamer-basevideo-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED" 2>&1` + GST_ALLOCATORS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$module >= $minver"` else - GST_BASEVIDEO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gstreamer-basevideo-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED" 2>&1` + GST_ALLOCATORS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$module >= $minver"` fi # Put the nasty error message in config.log where it belongs - echo "$GST_BASEVIDEO_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (gstreamer-basevideo-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED) were not met: + echo "$GST_ALLOCATORS_PKG_ERRORS" >&5 -$GST_BASEVIDEO_PKG_ERRORS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. + HAVE_GST_ALLOCATORS="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_ALLOCATORS_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_ALLOCATORS_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi -Alternatively, you may set the environment variables GST_BASEVIDEO_CFLAGS -and GST_BASEVIDEO_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. -Alternatively, you may set the environment variables GST_BASEVIDEO_CFLAGS -and GST_BASEVIDEO_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. + HAVE_GST_ALLOCATORS="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_ALLOCATORS_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_ALLOCATORS_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } else - GST_BASEVIDEO_CFLAGS=$pkg_cv_GST_BASEVIDEO_CFLAGS - GST_BASEVIDEO_LIBS=$pkg_cv_GST_BASEVIDEO_LIBS + GST_ALLOCATORS_CFLAGS=$pkg_cv_GST_ALLOCATORS_CFLAGS + GST_ALLOCATORS_LIBS=$pkg_cv_GST_ALLOCATORS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } -fi + HAVE_GST_ALLOCATORS="yes" + fi -if test "$enable_builtin_codecparsers" = "yes"; then - ac_cv_have_gst_mpeg2_parser="no" - ac_cv_have_gst_h264_parser="no" - ac_cv_have_gst_jpeg_parser="no" - ac_cv_have_gst_vp8_parser="no" - ac_cv_have_gst_h265_parser="no" - ac_cv_have_gst_vp9_parser="no" -else + + + + module=gstreamer-video-$GST_API_VERSION + minver=$GST_PBREQ + name="yes" + required="yes" pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST_CODEC_PARSERS" >&5 -$as_echo_n "checking for GST_CODEC_PARSERS... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST_VIDEO" >&5 +$as_echo_n "checking for GST_VIDEO... " >&6; } -if test -n "$GST_CODEC_PARSERS_CFLAGS"; then - pkg_cv_GST_CODEC_PARSERS_CFLAGS="$GST_CODEC_PARSERS_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-codecparsers-\$GST_PKG_VERSION >= \$GST_PLUGINS_BAD_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gstreamer-codecparsers-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$GST_VIDEO_CFLAGS"; then + pkg_cv_GST_VIDEO_CFLAGS="$GST_VIDEO_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GST_CODEC_PARSERS_CFLAGS=`$PKG_CONFIG --cflags "gstreamer-codecparsers-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_GST_VIDEO_CFLAGS=`$PKG_CONFIG --cflags "$module >= $minver" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$GST_CODEC_PARSERS_LIBS"; then - pkg_cv_GST_CODEC_PARSERS_LIBS="$GST_CODEC_PARSERS_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-codecparsers-\$GST_PKG_VERSION >= \$GST_PLUGINS_BAD_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gstreamer-codecparsers-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$GST_VIDEO_LIBS"; then + pkg_cv_GST_VIDEO_LIBS="$GST_VIDEO_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GST_CODEC_PARSERS_LIBS=`$PKG_CONFIG --libs "gstreamer-codecparsers-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_GST_VIDEO_LIBS=`$PKG_CONFIG --libs "$module >= $minver" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -13785,397 +16582,300 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GST_CODEC_PARSERS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gstreamer-codecparsers-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED" 2>&1` + GST_VIDEO_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$module >= $minver"` else - GST_CODEC_PARSERS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gstreamer-codecparsers-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED" 2>&1` + GST_VIDEO_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$module >= $minver"` fi # Put the nasty error message in config.log where it belongs - echo "$GST_CODEC_PARSERS_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (gstreamer-codecparsers-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED) were not met: + echo "$GST_VIDEO_PKG_ERRORS" >&5 -$GST_CODEC_PARSERS_PKG_ERRORS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. + HAVE_GST_VIDEO="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_VIDEO_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_VIDEO_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi -Alternatively, you may set the environment variables GST_CODEC_PARSERS_CFLAGS -and GST_CODEC_PARSERS_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. -Alternatively, you may set the environment variables GST_CODEC_PARSERS_CFLAGS -and GST_CODEC_PARSERS_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. + HAVE_GST_VIDEO="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_VIDEO_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_VIDEO_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } else - GST_CODEC_PARSERS_CFLAGS=$pkg_cv_GST_CODEC_PARSERS_CFLAGS - GST_CODEC_PARSERS_LIBS=$pkg_cv_GST_CODEC_PARSERS_LIBS + GST_VIDEO_CFLAGS=$pkg_cv_GST_VIDEO_CFLAGS + GST_VIDEO_LIBS=$pkg_cv_GST_VIDEO_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } -fi + HAVE_GST_VIDEO="yes" + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPEG-2 parser" >&5 -$as_echo_n "checking for MPEG-2 parser... " >&6; } -if ${ac_cv_have_gst_mpeg2_parser+:} false; then : - $as_echo_n "(cached) " >&6 -else - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -GstMpegVideoSequenceHdr seq_hdr; - GstMpegVideoSequenceExt seq_ext; - GstMpegVideoSequenceDisplayExt seq_dpy; - GstMpegVideoSliceHdr slice_hdr; - GstMpegVideoPacket packet; - gst_mpeg_video_packet_parse_slice_header(&packet, &slice_hdr, - &seq_hdr, NULL); - gst_mpeg_video_finalise_mpeg2_sequence_header(&seq_hdr, - &seq_ext, &seq_dpy); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_have_gst_mpeg2_parser="yes" -else - ac_cv_have_gst_mpeg2_parser="no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" + module=gstreamer-pbutils-$GST_API_VERSION + minver=$GST_PBREQ + name="yes" + required="yes" + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST_PBUTILS" >&5 +$as_echo_n "checking for GST_PBUTILS... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$GST_PBUTILS_CFLAGS"; then + pkg_cv_GST_PBUTILS_CFLAGS="$GST_PBUTILS_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GST_PBUTILS_CFLAGS=`$PKG_CONFIG --cflags "$module >= $minver" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_gst_mpeg2_parser" >&5 -$as_echo "$ac_cv_have_gst_mpeg2_parser" >&6; } - if test "$ac_cv_have_gst_mpeg2_parser" != "yes"; then - USE_LOCAL_CODEC_PARSERS_MPEG2_TRUE= - USE_LOCAL_CODEC_PARSERS_MPEG2_FALSE='#' +if test -n "$PKG_CONFIG"; then + if test -n "$GST_PBUTILS_LIBS"; then + pkg_cv_GST_PBUTILS_LIBS="$GST_PBUTILS_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GST_PBUTILS_LIBS=`$PKG_CONFIG --libs "$module >= $minver" 2>/dev/null` else - USE_LOCAL_CODEC_PARSERS_MPEG2_TRUE='#' - USE_LOCAL_CODEC_PARSERS_MPEG2_FALSE= + pkg_failed=yes fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for H.264 parser" >&5 -$as_echo_n "checking for H.264 parser... " >&6; } -if ${ac_cv_have_gst_h264_parser+:} false; then : - $as_echo_n "(cached) " >&6 + fi else + pkg_failed=untried +fi - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -GstH264SliceHdr slice_hdr; - GstH264VUIParams vui_params; - GstH264Profile profile = GST_H264_PROFILE_HIGH; - slice_hdr.n_emulation_prevention_bytes = 0; - vui_params.par_n = 0; - vui_params.par_d = 0; - GstH264SPS sps; - sps.extension.mvc.num_views_minus1 = 1; - GstH264NalUnit nalu; - nalu.extension_type = GST_H264_NAL_EXTENSION_MVC; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_have_gst_h264_parser="yes" -else - ac_cv_have_gst_h264_parser="no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_gst_h264_parser" >&5 -$as_echo "$ac_cv_have_gst_h264_parser" >&6; } - if test "$ac_cv_have_gst_h264_parser" != "yes"; then - USE_LOCAL_CODEC_PARSERS_H264_TRUE= - USE_LOCAL_CODEC_PARSERS_H264_FALSE='#' +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes else - USE_LOCAL_CODEC_PARSERS_H264_TRUE='#' - USE_LOCAL_CODEC_PARSERS_H264_FALSE= + _pkg_short_errors_supported=no fi + if test $_pkg_short_errors_supported = yes; then + GST_PBUTILS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$module >= $minver"` + else + GST_PBUTILS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$module >= $minver"` + fi + # Put the nasty error message in config.log where it belongs + echo "$GST_PBUTILS_PKG_ERRORS" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for JPEG parser" >&5 -$as_echo_n "checking for JPEG parser... " >&6; } -if ${ac_cv_have_gst_jpeg_parser+:} false; then : - $as_echo_n "(cached) " >&6 -else + HAVE_GST_PBUTILS="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_PBUTILS_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_PBUTILS_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -GstJpegImage jpeg_image; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_have_gst_jpeg_parser="yes" -else - ac_cv_have_gst_jpeg_parser="no" +elif test $pkg_failed = untried; then -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" + HAVE_GST_PBUTILS="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_PBUTILS_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_PBUTILS_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_gst_jpeg_parser" >&5 -$as_echo "$ac_cv_have_gst_jpeg_parser" >&6; } - if test "$ac_cv_have_gst_jpeg_parser" != "yes"; then - USE_LOCAL_CODEC_PARSERS_JPEG_TRUE= - USE_LOCAL_CODEC_PARSERS_JPEG_FALSE='#' else - USE_LOCAL_CODEC_PARSERS_JPEG_TRUE='#' - USE_LOCAL_CODEC_PARSERS_JPEG_FALSE= -fi + GST_PBUTILS_CFLAGS=$pkg_cv_GST_PBUTILS_CFLAGS + GST_PBUTILS_LIBS=$pkg_cv_GST_PBUTILS_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + HAVE_GST_PBUTILS="yes" -if test "$enable_builtin_libvpx" = "yes"; then - ac_cv_have_gst_vp8_parser="no" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for VP8 parser" >&5 -$as_echo_n "checking for VP8 parser... " >&6; } -if ${ac_cv_have_gst_vp8_parser+:} false; then : - $as_echo_n "(cached) " >&6 -else - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -GstVp8FrameHdr frame_hdr; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_have_gst_vp8_parser="yes" -else - ac_cv_have_gst_vp8_parser="no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" + + which="gstreamer-codecparsers-$GST_API_VERSION >= 1.8.0 gstreamer-codecparsers-$GST_API_VERSION <= 1.8.99" + required=yes + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST_CODEC_PARSERS" >&5 +$as_echo_n "checking for GST_CODEC_PARSERS... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$GST_CODEC_PARSERS_CFLAGS"; then + pkg_cv_GST_CODEC_PARSERS_CFLAGS="$GST_CODEC_PARSERS_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$which\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$which") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GST_CODEC_PARSERS_CFLAGS=`$PKG_CONFIG --cflags "$which" 2>/dev/null` +else + pkg_failed=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_gst_vp8_parser" >&5 -$as_echo "$ac_cv_have_gst_vp8_parser" >&6; } - if test "$ac_cv_have_gst_vp8_parser" != "yes"; then - USE_LOCAL_CODEC_PARSERS_VP8_TRUE= - USE_LOCAL_CODEC_PARSERS_VP8_FALSE='#' + fi else - USE_LOCAL_CODEC_PARSERS_VP8_TRUE='#' - USE_LOCAL_CODEC_PARSERS_VP8_FALSE= + pkg_failed=untried fi - - if test "$enable_builtin_libvpx" = "yes"; then - USE_BUILTIN_LIBVPX_TRUE= - USE_BUILTIN_LIBVPX_FALSE='#' +if test -n "$PKG_CONFIG"; then + if test -n "$GST_CODEC_PARSERS_LIBS"; then + pkg_cv_GST_CODEC_PARSERS_LIBS="$GST_CODEC_PARSERS_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$which\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$which") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GST_CODEC_PARSERS_LIBS=`$PKG_CONFIG --libs "$which" 2>/dev/null` else - USE_BUILTIN_LIBVPX_TRUE='#' - USE_BUILTIN_LIBVPX_FALSE= + pkg_failed=yes fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for VP9 parser" >&5 -$as_echo_n "checking for VP9 parser... " >&6; } -if ${ac_cv_have_gst_vp9_parser+:} false; then : - $as_echo_n "(cached) " >&6 + fi else + pkg_failed=untried +fi - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -GstVp9FrameHdr frame_hdr; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_have_gst_vp9_parser="yes" -else - ac_cv_have_gst_vp9_parser="no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_gst_vp9_parser" >&5 -$as_echo "$ac_cv_have_gst_vp9_parser" >&6; } - if test "$ac_cv_have_gst_vp9_parser" != "yes"; then - USE_LOCAL_CODEC_PARSERS_VP9_TRUE= - USE_LOCAL_CODEC_PARSERS_VP9_FALSE='#' +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes else - USE_LOCAL_CODEC_PARSERS_VP9_TRUE='#' - USE_LOCAL_CODEC_PARSERS_VP9_FALSE= + _pkg_short_errors_supported=no fi + if test $_pkg_short_errors_supported = yes; then + GST_CODEC_PARSERS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$which"` + else + GST_CODEC_PARSERS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$which"` + fi + # Put the nasty error message in config.log where it belongs + echo "$GST_CODEC_PARSERS_PKG_ERRORS" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for H.265 parser" >&5 -$as_echo_n "checking for H.265 parser... " >&6; } -if ${ac_cv_have_gst_h265_parser+:} false; then : - $as_echo_n "(cached) " >&6 -else + HAVE_GST_CODEC_PARSERS="no" + if test "x$required" = "xyes"; then + as_fn_error $? "$GST_CODEC_PARSERS_PKG_ERRORS" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_CODEC_PARSERS_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_CODEC_PARSERS_PKG_ERRORS" >&6;} + fi - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -GstH265SliceHdr slice_hdr; - GstH265VUIParams vui_params; - GstH265Profile profile = GST_H265_PROFILE_MAIN_STILL_PICTURE; - slice_hdr.n_emulation_prevention_bytes = 0; - vui_params.par_n = 0; - vui_params.par_d = 0; - GstH265SPS sps; - sps.crop_rect_x = 0; - sps.crop_rect_width = 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_have_gst_h265_parser="yes" -else - ac_cv_have_gst_h265_parser="no" +elif test $pkg_failed = untried; then -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" + HAVE_GST_CODEC_PARSERS="no" + if test "x$required" = "xyes"; then + as_fn_error $? "$GST_CODEC_PARSERS_PKG_ERRORS" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_CODEC_PARSERS_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_CODEC_PARSERS_PKG_ERRORS" >&6;} + fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_gst_h265_parser" >&5 -$as_echo "$ac_cv_have_gst_h265_parser" >&6; } - if test "$ac_cv_have_gst_h265_parser" != "yes"; then - USE_LOCAL_CODEC_PARSERS_H265_TRUE= - USE_LOCAL_CODEC_PARSERS_H265_FALSE='#' else - USE_LOCAL_CODEC_PARSERS_H265_TRUE='#' - USE_LOCAL_CODEC_PARSERS_H265_FALSE= + GST_CODEC_PARSERS_CFLAGS=$pkg_cv_GST_CODEC_PARSERS_CFLAGS + GST_CODEC_PARSERS_LIBS=$pkg_cv_GST_CODEC_PARSERS_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + HAVE_GST_CODEC_PARSERS="yes" + fi - if test "$enable_builtin_videoparsers" = "yes"; then - USE_LOCAL_VIDEO_PARSERS_TRUE= - USE_LOCAL_VIDEO_PARSERS_FALSE='#' + +if test "x$enable_glx" = "xyes" -o "x$enable_egl" = "xyes"; then : + enable_opengl="yes" else - USE_LOCAL_VIDEO_PARSERS_TRUE='#' - USE_LOCAL_VIDEO_PARSERS_FALSE= + enable_opengl="no" fi - HAVE_GSTGL=0 -if test "$enable_glx" = "yes" -o "$enable_egl" = "yes"; then +if test "x$enable_opengl" = "xyes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST_GL" >&5 $as_echo_n "checking for GST_GL... " >&6; } -if test -n "$GST_GL_CFLAGS"; then - pkg_cv_GST_GL_CFLAGS="$GST_GL_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-gl-\$GST_PKG_VERSION >= \$GST_PLUGINS_BAD_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gstreamer-gl-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$GST_GL_CFLAGS"; then + pkg_cv_GST_GL_CFLAGS="$GST_GL_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-gl-\$GST_API_VERSION >= \$GST_PBADREQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gstreamer-gl-$GST_API_VERSION >= $GST_PBADREQ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GST_GL_CFLAGS=`$PKG_CONFIG --cflags "gstreamer-gl-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_GST_GL_CFLAGS=`$PKG_CONFIG --cflags "gstreamer-gl-$GST_API_VERSION >= $GST_PBADREQ" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$GST_GL_LIBS"; then - pkg_cv_GST_GL_LIBS="$GST_GL_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-gl-\$GST_PKG_VERSION >= \$GST_PLUGINS_BAD_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gstreamer-gl-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$GST_GL_LIBS"; then + pkg_cv_GST_GL_LIBS="$GST_GL_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-gl-\$GST_API_VERSION >= \$GST_PBADREQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gstreamer-gl-$GST_API_VERSION >= $GST_PBADREQ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GST_GL_LIBS=`$PKG_CONFIG --libs "gstreamer-gl-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_GST_GL_LIBS=`$PKG_CONFIG --libs "gstreamer-gl-$GST_API_VERSION >= $GST_PBADREQ" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -14183,76 +16883,102 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GST_GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gstreamer-gl-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED" 2>&1` + GST_GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "gstreamer-gl-$GST_API_VERSION >= $GST_PBADREQ"` else - GST_GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gstreamer-gl-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED" 2>&1` + GST_GL_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gstreamer-gl-$GST_API_VERSION >= $GST_PBADREQ"` fi # Put the nasty error message in config.log where it belongs echo "$GST_GL_PKG_ERRORS" >&5 - HAVE_GSTGL=0 + as_fn_error $? "Package requirements (gstreamer-gl-$GST_API_VERSION >= $GST_PBADREQ) were not met: + +$GST_GL_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables GST_GL_CFLAGS +and GST_GL_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - HAVE_GSTGL=0 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables GST_GL_CFLAGS +and GST_GL_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } else GST_GL_CFLAGS=$pkg_cv_GST_GL_CFLAGS GST_GL_LIBS=$pkg_cv_GST_GL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - HAVE_GSTGL=1 -fi -fi -if test $HAVE_GSTGL -eq 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GStreamer OpenGL helper libraries" >&5 + HAVE_GSTGL=1 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GStreamer OpenGL helper libraries" >&5 $as_echo_n "checking for GStreamer OpenGL helper libraries... " >&6; } if ${ac_cv_have_gst_gl_helpers+:} false; then : $as_echo_n "(cached) " >&6 else - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GST_GL_CFLAGS $GST_VIDEO_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$saved_LIBS" - for ac_header in gst/gl/gl.h + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $GST_GL_CFLAGS $GST_VIDEO_CFLAGS" + saved_LIBS="$LIBS" + LIBS="$saved_LIBS" + for ac_header in gst/gl/gl.h do : ac_fn_c_check_header_mongrel "$LINENO" "gst/gl/gl.h" "ac_cv_header_gst_gl_gl_h" "$ac_includes_default" if test "x$ac_cv_header_gst_gl_gl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GST_GL_GL_H 1 _ACEOF - : + else HAVE_GSTGL=0 fi done - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + + #include + int main () { + GstGLContext gl_context; + ; return 0; } + _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_have_gst_gl_helpers="yes" else - ac_cv_have_gst_gl_helpers="no" HAVE_GSTGL=0 - + ac_cv_have_gst_gl_helpers="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" + CPPFLAGS="$saved_CPPFLAGS" + LIBS="$saved_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_gst_gl_helpers" >&5 $as_echo "$ac_cv_have_gst_gl_helpers" >&6; } + +fi +fi +if test "x$ac_cv_have_gst_gl_helpers" = "xno"; then : + HAVE_GSTGL=0 fi if test $HAVE_GSTGL -eq 1; then USE_GST_GL_HELPERS_TRUE= @@ -14263,182 +16989,65 @@ fi - cat >>confdefs.h <<_ACEOF #define USE_GST_GL_HELPERS $HAVE_GSTGL _ACEOF -if test "$enable_egl" = "yes" -a $HAVE_GSTGL -ne 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GStreamer/GL helper libraries not found, disabling EGL support" >&5 +if test "x$enable_egl" = "xyes" -a $HAVE_GSTGL -ne 1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GStreamer/GL helper libraries not found, disabling EGL support" >&5 $as_echo "$as_me: WARNING: GStreamer/GL helper libraries not found, disabling EGL support" >&2;} - enable_egl="no" -fi - -case $GST_API_VERSION in -1.2) lt_bias=4;; -1.4) lt_bias=5;; -1.[5-6]) lt_bias=6;; -1.[7-8]) lt_bias=7;; -esac -GST_VAAPI_MAJOR_VERSION=`expr 7 - "$lt_bias"` - - - -cat >>confdefs.h <<_ACEOF -#define GST_VAAPI_MAJOR_VERSION_S "$GST_VAAPI_MAJOR_VERSION" -_ACEOF - - -GST_VAAPI_LT_CURRENT="$GST_VAAPI_MAJOR_VERSION" -GST_VAAPI_LT_REV=0 -GST_VAAPI_LT_AGE=0 -GST_VAAPI_LT_VERSION="$GST_VAAPI_LT_CURRENT:$GST_VAAPI_LT_REV:$GST_VAAPI_LT_AGE" -GST_VAAPI_LT_LDFLAGS="-version-info $GST_VAAPI_LT_VERSION" - - - -GST_ALL_LDFLAGS="-no-undefined" - - -GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^(_*gst_plugin_desc|gst_.*_get_type)\$\$' $GST_ALL_LDFLAGS" - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GStreamer plugins directory" >&5 -$as_echo_n "checking for GStreamer plugins directory... " >&6; } -if test -d "$GST_PLUGIN_PATH_1_0"; then - GST_PLUGINS_DIR="$GST_PLUGIN_PATH_1_0" -else - GST_PLUGINS_DIR=`$PKG_CONFIG gstreamer-$GST_PKG_VERSION --variable pluginsdir` - if test -z "$GST_PLUGINS_DIR"; then - GST_PLUGINS_DIR="\$(libdir)/gstreamer-$GST_PKG_VERSION" - fi + enable_egl="no" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GST_PLUGINS_DIR" >&5 -$as_echo "$GST_PLUGINS_DIR" >&6; } -plugindir="$GST_PLUGINS_DIR" - USE_DRM=0 -if test "$enable_drm" = "yes"; then +if test "x$enable_drm" = "xyes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DRM" >&5 $as_echo_n "checking for DRM... " >&6; } -if test -n "$DRM_CFLAGS"; then - pkg_cv_DRM_CFLAGS="$DRM_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libdrm") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_DRM_CFLAGS=`$PKG_CONFIG --cflags "libdrm" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$DRM_LIBS"; then - pkg_cv_DRM_LIBS="$DRM_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libdrm") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_DRM_LIBS=`$PKG_CONFIG --libs "libdrm" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - DRM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libdrm" 2>&1` - else - DRM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libdrm" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$DRM_PKG_ERRORS" >&5 - - USE_DRM=0 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - USE_DRM=0 -else - DRM_CFLAGS=$pkg_cv_DRM_CFLAGS - DRM_LIBS=$pkg_cv_DRM_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - USE_DRM=1 -fi - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for UDEV" >&5 -$as_echo_n "checking for UDEV... " >&6; } - -if test -n "$UDEV_CFLAGS"; then - pkg_cv_UDEV_CFLAGS="$UDEV_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libudev") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$DRM_CFLAGS"; then + pkg_cv_DRM_CFLAGS="$DRM_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm libudev\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libdrm libudev") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_UDEV_CFLAGS=`$PKG_CONFIG --cflags "libudev" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_DRM_CFLAGS=`$PKG_CONFIG --cflags "libdrm libudev" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$UDEV_LIBS"; then - pkg_cv_UDEV_LIBS="$UDEV_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libudev") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$DRM_LIBS"; then + pkg_cv_DRM_LIBS="$DRM_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm libudev\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libdrm libudev") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_UDEV_LIBS=`$PKG_CONFIG --libs "libudev" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_DRM_LIBS=`$PKG_CONFIG --libs "libdrm libudev" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -14446,94 +17055,112 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - UDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libudev" 2>&1` + DRM_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libdrm libudev"` else - UDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libudev" 2>&1` + DRM_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libdrm libudev"` fi # Put the nasty error message in config.log where it belongs - echo "$UDEV_PKG_ERRORS" >&5 + echo "$DRM_PKG_ERRORS" >&5 - USE_DRM=0 + as_fn_error $? "Package requirements (libdrm libudev) were not met: + +$DRM_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables DRM_CFLAGS +and DRM_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - USE_DRM=0 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables DRM_CFLAGS +and DRM_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } else - UDEV_CFLAGS=$pkg_cv_UDEV_CFLAGS - UDEV_LIBS=$pkg_cv_UDEV_LIBS + DRM_CFLAGS=$pkg_cv_DRM_CFLAGS + DRM_LIBS=$pkg_cv_DRM_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - : -fi - if test $USE_DRM -eq 1; then - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $DRM_CFLAGS" - for ac_header in drm_fourcc.h + USE_DRM=1 + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $DRM_CFLAGS" + for ac_header in drm_fourcc.h do : ac_fn_c_check_header_mongrel "$LINENO" "drm_fourcc.h" "ac_cv_header_drm_fourcc_h" "$ac_includes_default" if test "x$ac_cv_header_drm_fourcc_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DRM_FOURCC_H 1 _ACEOF - : + else USE_DRM=0 fi done - CPPFLAGS="$saved_CPPFLAGS" - fi + CPPFLAGS="$saved_CPPFLAGS" + +fi fi USE_X11=0 -if test "$enable_x11" = "yes"; then +if test "x$enable_x11" = "xyes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11" >&5 $as_echo_n "checking for X11... " >&6; } -if test -n "$X11_CFLAGS"; then - pkg_cv_X11_CFLAGS="$X11_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ +if test -n "$PKG_CONFIG"; then + if test -n "$X11_CFLAGS"; then + pkg_cv_X11_CFLAGS="$X11_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_X11_CFLAGS=`$PKG_CONFIG --cflags "x11" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$X11_LIBS"; then - pkg_cv_X11_LIBS="$X11_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ +if test -n "$PKG_CONFIG"; then + if test -n "$X11_LIBS"; then + pkg_cv_X11_LIBS="$X11_LIBS" + else + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_X11_LIBS=`$PKG_CONFIG --libs "x11" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -14541,29 +17168,47 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - X11_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11" 2>&1` + X11_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "x11"` else - X11_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11" 2>&1` + X11_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "x11"` fi # Put the nasty error message in config.log where it belongs echo "$X11_PKG_ERRORS" >&5 - USE_X11=0 + as_fn_error $? "Package requirements (x11) were not met: + +$X11_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables X11_CFLAGS +and X11_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - USE_X11=0 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables X11_CFLAGS +and X11_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } else X11_CFLAGS=$pkg_cv_X11_CFLAGS X11_LIBS=$pkg_cv_X11_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - USE_X11=1 -fi - if test $USE_X11 -eq 1; then - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $X11_CFLAGS" - for ac_header in X11/Xlib.h X11/Xutil.h X11/Xatom.h + + USE_X11=1 + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $X11_CFLAGS" + for ac_header in X11/Xlib.h X11/Xutil.h X11/Xatom.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -14571,90 +17216,83 @@ cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - : + else USE_X11=0 fi done - CPPFLAGS="$saved_CPPFLAGS" - fi + CPPFLAGS="$saved_CPPFLAGS" + +fi fi HAVE_XKBLIB=0 +HAVE_XRANDR=0 +HAVE_XRENDER=0 if test $USE_X11 -eq 1; then - for ac_header in X11/XKBlib.h + HAVE_XKBLIB=1 + for ac_header in X11/XKBlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "X11/XKBlib.h" "ac_cv_header_X11_XKBlib_h" "$ac_includes_default" if test "x$ac_cv_header_X11_XKBlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_X11_XKBLIB_H 1 _ACEOF - HAVE_XKBLIB=1 + else - : + HAVE_XKBLIB=0 fi done -fi -if test $HAVE_XKBLIB -eq 1; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_XKBLIB 1 -_ACEOF - -fi -HAVE_XRANDR=0 -if test $USE_X11 -eq 1; then - HAVE_XRANDR=1 pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRANDR" >&5 $as_echo_n "checking for XRANDR... " >&6; } -if test -n "$XRANDR_CFLAGS"; then - pkg_cv_XRANDR_CFLAGS="$XRANDR_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ +if test -n "$PKG_CONFIG"; then + if test -n "$XRANDR_CFLAGS"; then + pkg_cv_XRANDR_CFLAGS="$XRANDR_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xrandr\""; } >&5 ($PKG_CONFIG --exists --print-errors "xrandr") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XRANDR_CFLAGS=`$PKG_CONFIG --cflags "xrandr" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$XRANDR_LIBS"; then - pkg_cv_XRANDR_LIBS="$XRANDR_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ +if test -n "$PKG_CONFIG"; then + if test -n "$XRANDR_LIBS"; then + pkg_cv_XRANDR_LIBS="$XRANDR_LIBS" + else + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xrandr\""; } >&5 ($PKG_CONFIG --exists --print-errors "xrandr") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XRANDR_LIBS=`$PKG_CONFIG --libs "xrandr" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -14662,101 +17300,109 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - XRANDR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xrandr" 2>&1` + XRANDR_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xrandr"` else - XRANDR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xrandr" 2>&1` + XRANDR_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xrandr"` fi # Put the nasty error message in config.log where it belongs echo "$XRANDR_PKG_ERRORS" >&5 - HAVE_XRANDR=0 + as_fn_error $? "Package requirements (xrandr) were not met: + +$XRANDR_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables XRANDR_CFLAGS +and XRANDR_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - HAVE_XRANDR=0 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables XRANDR_CFLAGS +and XRANDR_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } else XRANDR_CFLAGS=$pkg_cv_XRANDR_CFLAGS XRANDR_LIBS=$pkg_cv_XRANDR_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - : -fi - if test $HAVE_XRANDR -eq 1; then - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $XRANDR_CFLAGS" - for ac_header in X11/extensions/Xrandr.h + + HAVE_XRANDR=1 + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $XRANDR_CFLAGS" + for ac_header in X11/extensions/Xrandr.h do : ac_fn_c_check_header_mongrel "$LINENO" "X11/extensions/Xrandr.h" "ac_cv_header_X11_extensions_Xrandr_h" "$ac_includes_default" if test "x$ac_cv_header_X11_extensions_Xrandr_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_X11_EXTENSIONS_XRANDR_H 1 _ACEOF - : + else HAVE_XRANDR=0 fi done - CPPFLAGS="$saved_CPPFLAGS" - fi -fi -if test $HAVE_XRANDR -eq 1; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_XRANDR 1 -_ACEOF + CPPFLAGS="$saved_CPPFLAGS" fi -HAVE_XRENDER=0 -if test $USE_X11 -eq 1; then - HAVE_XRENDER=1 pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRENDER" >&5 $as_echo_n "checking for XRENDER... " >&6; } -if test -n "$XRENDER_CFLAGS"; then - pkg_cv_XRENDER_CFLAGS="$XRENDER_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ +if test -n "$PKG_CONFIG"; then + if test -n "$XRENDER_CFLAGS"; then + pkg_cv_XRENDER_CFLAGS="$XRENDER_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xrender\""; } >&5 ($PKG_CONFIG --exists --print-errors "xrender") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XRENDER_CFLAGS=`$PKG_CONFIG --cflags "xrender" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$XRENDER_LIBS"; then - pkg_cv_XRENDER_LIBS="$XRENDER_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ +if test -n "$PKG_CONFIG"; then + if test -n "$XRENDER_LIBS"; then + pkg_cv_XRENDER_LIBS="$XRENDER_LIBS" + else + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xrender\""; } >&5 ($PKG_CONFIG --exists --print-errors "xrender") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XRENDER_LIBS=`$PKG_CONFIG --libs "xrender" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -14764,112 +17410,135 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - XRENDER_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xrender" 2>&1` + XRENDER_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xrender"` else - XRENDER_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xrender" 2>&1` + XRENDER_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xrender"` fi # Put the nasty error message in config.log where it belongs echo "$XRENDER_PKG_ERRORS" >&5 - HAVE_XRENDER=0 + as_fn_error $? "Package requirements (xrender) were not met: + +$XRENDER_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables XRENDER_CFLAGS +and XRENDER_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - HAVE_XRENDER=0 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables XRENDER_CFLAGS +and XRENDER_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } else XRENDER_CFLAGS=$pkg_cv_XRENDER_CFLAGS XRENDER_LIBS=$pkg_cv_XRENDER_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - : -fi - if test $HAVE_XRENDER -eq 1; then - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $XRENDER_CFLAGS" - for ac_header in X11/extensions/Xrender.h + + HAVE_XRENDER=1 + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $XRENDER_CFLAGS" + for ac_header in X11/extensions/Xrender.h do : ac_fn_c_check_header_mongrel "$LINENO" "X11/extensions/Xrender.h" "ac_cv_header_X11_extensions_Xrender_h" "$ac_includes_default" if test "x$ac_cv_header_X11_extensions_Xrender_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_X11_EXTENSIONS_XRENDER_H 1 _ACEOF - : + else HAVE_XRENDER=0 fi done - CPPFLAGS="$saved_CPPFLAGS" - fi + CPPFLAGS="$saved_CPPFLAGS" + fi -if test $HAVE_XRENDER -eq 1; then +fi + cat >>confdefs.h <<_ACEOF -#define HAVE_XRENDER 1 +#define HAVE_XKBLIB $HAVE_XKBLIB +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAVE_XRANDR $HAVE_XRANDR +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAVE_XRENDER $HAVE_XRENDER _ACEOF -fi -enable_opengl="no" -if test "$enable_glx" = "yes"; then - enable_opengl="yes" -fi -if test "$enable_egl" = "yes"; then - enable_opengl="yes" -fi GLES_VERSION_MASK=0 HAVE_GL=0 -if test "$enable_opengl" = "yes"; then -case ",$GLAPI," in -(*,any,*|*,gl,*) - HAVE_GL=1 +HAVE_GLESv2=0 +HAVE_GLESv3=0 +if test "x$enable_opengl" = "xyes"; then + case ",$GLAPI," in + (*,any,*|*,gl,*) + HAVE_GL=1 pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5 $as_echo_n "checking for GL... " >&6; } -if test -n "$GL_CFLAGS"; then - pkg_cv_GL_CFLAGS="$GL_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ +if test -n "$PKG_CONFIG"; then + if test -n "$GL_CFLAGS"; then + pkg_cv_GL_CFLAGS="$GL_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gl\""; } >&5 ($PKG_CONFIG --exists --print-errors "gl") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GL_CFLAGS=`$PKG_CONFIG --cflags "gl" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$GL_LIBS"; then - pkg_cv_GL_LIBS="$GL_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ +if test -n "$PKG_CONFIG"; then + if test -n "$GL_LIBS"; then + pkg_cv_GL_LIBS="$GL_LIBS" + else + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gl\""; } >&5 ($PKG_CONFIG --exists --print-errors "gl") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "gl" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -14877,28 +17546,27 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gl" 2>&1` + GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "gl"` else - GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gl" 2>&1` + GL_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gl"` fi # Put the nasty error message in config.log where it belongs echo "$GL_PKG_ERRORS" >&5 - HAVE_GL=0 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } + HAVE_GL=0 +elif test $pkg_failed = untried; then HAVE_GL=0 else GL_CFLAGS=$pkg_cv_GL_CFLAGS GL_LIBS=$pkg_cv_GL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - : -fi - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GL_CFLAGS" - for ac_header in GL/gl.h GL/glext.h + + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $GL_CFLAGS" + for ac_header in GL/gl.h GL/glext.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " @@ -14911,69 +17579,68 @@ cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - : + else HAVE_GL=0 fi done - CPPFLAGS="$saved_CPPFLAGS" - ;; -esac + CPPFLAGS="$saved_CPPFLAGS" + fi -GLES_VERSION_MASK=`expr $GLES_VERSION_MASK "+" $HAVE_GL "*" 1` + GLES_VERSION_MASK=`expr $GLES_VERSION_MASK "+" $HAVE_GL "*" 1` + ;; + esac -HAVE_GLESv2=0 -if test "$enable_opengl" = "yes"; then -case ",$GLAPI," in -(*,any,*|*,gles2,*) - HAVE_GLESv2=1 + case ",$GLAPI," in + (*,any,*|*,gles2,*) + HAVE_GLESv2=1 pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLES2" >&5 $as_echo_n "checking for GLES2... " >&6; } -if test -n "$GLES2_CFLAGS"; then - pkg_cv_GLES2_CFLAGS="$GLES2_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ +if test -n "$PKG_CONFIG"; then + if test -n "$GLES2_CFLAGS"; then + pkg_cv_GLES2_CFLAGS="$GLES2_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glesv2\""; } >&5 ($PKG_CONFIG --exists --print-errors "glesv2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLES2_CFLAGS=`$PKG_CONFIG --cflags "glesv2" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$GLES2_LIBS"; then - pkg_cv_GLES2_LIBS="$GLES2_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ +if test -n "$PKG_CONFIG"; then + if test -n "$GLES2_LIBS"; then + pkg_cv_GLES2_LIBS="$GLES2_LIBS" + else + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glesv2\""; } >&5 ($PKG_CONFIG --exists --print-errors "glesv2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLES2_LIBS=`$PKG_CONFIG --libs "glesv2" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -14981,28 +17648,27 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GLES2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glesv2" 2>&1` + GLES2_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "glesv2"` else - GLES2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glesv2" 2>&1` + GLES2_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "glesv2"` fi # Put the nasty error message in config.log where it belongs echo "$GLES2_PKG_ERRORS" >&5 - HAVE_GLESv2=0 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } + HAVE_GLESv2=0 +elif test $pkg_failed = untried; then HAVE_GLESv2=0 else GLES2_CFLAGS=$pkg_cv_GLES2_CFLAGS GLES2_LIBS=$pkg_cv_GLES2_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - : -fi - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GLES2_CFLAGS" - for ac_header in GLES2/gl2.h GLES2/gl2ext.h + + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $GLES2_CFLAGS" + for ac_header in GLES2/gl2.h GLES2/gl2ext.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " @@ -15015,69 +17681,68 @@ cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - : + else HAVE_GLESv2=0 fi done - CPPFLAGS="$saved_CPPFLAGS" - ;; -esac + CPPFLAGS="$saved_CPPFLAGS" + fi -GLES_VERSION_MASK=`expr $GLES_VERSION_MASK "+" $HAVE_GLESv2 "*" 4` + GLES_VERSION_MASK=`expr $GLES_VERSION_MASK "+" $HAVE_GLESv2 "*" 4` + ;; + esac -HAVE_GLESv3=0 -if test "$enable_opengl" = "yes"; then -case ",$GLAPI," in -(*,any,*|*,gles3,*) - HAVE_GLESv3=1 + case ",$GLAPI," in + (*,any,*|*,gles3,*) + HAVE_GLESv3=1 pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLES3" >&5 $as_echo_n "checking for GLES3... " >&6; } -if test -n "$GLES3_CFLAGS"; then - pkg_cv_GLES3_CFLAGS="$GLES3_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ +if test -n "$PKG_CONFIG"; then + if test -n "$GLES3_CFLAGS"; then + pkg_cv_GLES3_CFLAGS="$GLES3_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glesv2\""; } >&5 ($PKG_CONFIG --exists --print-errors "glesv2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLES3_CFLAGS=`$PKG_CONFIG --cflags "glesv2" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$GLES3_LIBS"; then - pkg_cv_GLES3_LIBS="$GLES3_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ +if test -n "$PKG_CONFIG"; then + if test -n "$GLES3_LIBS"; then + pkg_cv_GLES3_LIBS="$GLES3_LIBS" + else + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glesv2\""; } >&5 ($PKG_CONFIG --exists --print-errors "glesv2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLES3_LIBS=`$PKG_CONFIG --libs "glesv2" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -15085,28 +17750,27 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GLES3_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glesv2" 2>&1` + GLES3_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "glesv2"` else - GLES3_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glesv2" 2>&1` + GLES3_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "glesv2"` fi # Put the nasty error message in config.log where it belongs echo "$GLES3_PKG_ERRORS" >&5 - HAVE_GLESv3=0 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } + HAVE_GLESv3=0 +elif test $pkg_failed = untried; then HAVE_GLESv3=0 else GLES3_CFLAGS=$pkg_cv_GLES3_CFLAGS GLES3_LIBS=$pkg_cv_GLES3_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - : -fi - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GLES3_CFLAGS" - for ac_header in GLES3/gl3.h GLES3/gl3ext.h GLES2/gl2ext.h + + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $GLES3_CFLAGS" + for ac_header in GLES3/gl3.h GLES3/gl3ext.h GLES2/gl2ext.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " @@ -15119,27 +17783,30 @@ cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - : + else HAVE_GLESv3=0 fi done - CPPFLAGS="$saved_CPPFLAGS" + CPPFLAGS="$saved_CPPFLAGS" + +fi + GLES_VERSION_MASK=`expr $GLES_VERSION_MASK "+" $HAVE_GLESv3 "*" 8` ;; -esac + esac fi -GLES_VERSION_MASK=`expr $GLES_VERSION_MASK "+" $HAVE_GLESv3 "*" 8` USE_GLX=0 -if test "$enable_glx" = "yes" -a $HAVE_GL -eq 1 -a $USE_X11 -eq 1; then - USE_GLX=1 - saved_CPPFLAGS="$CPPFLAGS" - saved_LIBS="$LIBS" - CPPFLAGS="$CPPFLAGS $GL_CFLAGS" - LIBS="$LIBS $GL_LIBS" - for ac_header in GL/glx.h +if test "x$enable_glx" = "xyes" -a $HAVE_GL -eq 1 -a $USE_X11 -eq 1; then + USE_GLX=1 + + saved_CPPFLAGS="$CPPFLAGS" + saved_LIBS="$LIBS" + CPPFLAGS="$CPPFLAGS $GL_CFLAGS" + LIBS="$LIBS $GL_LIBS" + for ac_header in GL/glx.h do : ac_fn_c_check_header_compile "$LINENO" "GL/glx.h" "ac_cv_header_GL_glx_h" " #ifdef HAVE_GL_GL_H @@ -15151,14 +17818,14 @@ cat >>confdefs.h <<_ACEOF #define HAVE_GL_GLX_H 1 _ACEOF - : + else USE_GLX=0 fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glXCreateContext in -lGL" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glXCreateContext in -lGL" >&5 $as_echo_n "checking for glXCreateContext in -lGL... " >&6; } if ${ac_cv_lib_GL_glXCreateContext+:} false; then : $as_echo_n "(cached) " >&6 @@ -15195,63 +17862,67 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_glXCreateContext" >&5 $as_echo "$ac_cv_lib_GL_glXCreateContext" >&6; } if test "x$ac_cv_lib_GL_glXCreateContext" = xyes; then : - : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBGL 1 +_ACEOF + + LIBS="-lGL $LIBS" + else USE_GLX=0 fi - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" + CPPFLAGS="$saved_CPPFLAGS" + LIBS="$saved_LIBS" fi USE_EGL=0 -if test "$enable_egl" = "yes" -a $GLES_VERSION_MASK -ne 0; then - USE_EGL=1 +if test "x$enable_egl" = "xyes" -a $GLES_VERSION_MASK -ne 0; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EGL" >&5 $as_echo_n "checking for EGL... " >&6; } -if test -n "$EGL_CFLAGS"; then - pkg_cv_EGL_CFLAGS="$EGL_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ +if test -n "$PKG_CONFIG"; then + if test -n "$EGL_CFLAGS"; then + pkg_cv_EGL_CFLAGS="$EGL_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"egl\""; } >&5 ($PKG_CONFIG --exists --print-errors "egl") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_EGL_CFLAGS=`$PKG_CONFIG --cflags "egl" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$EGL_LIBS"; then - pkg_cv_EGL_LIBS="$EGL_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ +if test -n "$PKG_CONFIG"; then + if test -n "$EGL_LIBS"; then + pkg_cv_EGL_LIBS="$EGL_LIBS" + else + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"egl\""; } >&5 ($PKG_CONFIG --exists --print-errors "egl") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_EGL_LIBS=`$PKG_CONFIG --libs "egl" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -15259,42 +17930,62 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - EGL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "egl" 2>&1` + EGL_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "egl"` else - EGL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "egl" 2>&1` + EGL_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "egl"` fi # Put the nasty error message in config.log where it belongs echo "$EGL_PKG_ERRORS" >&5 - USE_EGL=0 + as_fn_error $? "Package requirements (egl) were not met: + +$EGL_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables EGL_CFLAGS +and EGL_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - USE_EGL=0 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables EGL_CFLAGS +and EGL_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } else EGL_CFLAGS=$pkg_cv_EGL_CFLAGS EGL_LIBS=$pkg_cv_EGL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - : -fi - saved_CPPFLAGS="$CPPFLAGS" - saved_LIBS="$LIBS" - for ac_header in EGL/egl.h + + USE_EGL=1 + + saved_CPPFLAGS="$CPPFLAGS" + saved_LIBS="$LIBS" + for ac_header in EGL/egl.h do : ac_fn_c_check_header_mongrel "$LINENO" "EGL/egl.h" "ac_cv_header_EGL_egl_h" "$ac_includes_default" if test "x$ac_cv_header_EGL_egl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_EGL_EGL_H 1 _ACEOF - : + else USE_EGL=0 fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for eglGetDisplay in -lEGL" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for eglGetDisplay in -lEGL" >&5 $as_echo_n "checking for eglGetDisplay in -lEGL... " >&6; } if ${ac_cv_lib_EGL_eglGetDisplay+:} false; then : $as_echo_n "(cached) " >&6 @@ -15331,60 +18022,64 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_EGL_eglGetDisplay" >&5 $as_echo "$ac_cv_lib_EGL_eglGetDisplay" >&6; } if test "x$ac_cv_lib_EGL_eglGetDisplay" = xyes; then : - : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBEGL 1 +_ACEOF + + LIBS="-lEGL $LIBS" + else USE_EGL=0 fi - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" + CPPFLAGS="$saved_CPPFLAGS" + LIBS="$saved_LIBS" - GMODULE_VERSION_REQUIRED=2.32 pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GMODULE" >&5 $as_echo_n "checking for GMODULE... " >&6; } -if test -n "$GMODULE_CFLAGS"; then - pkg_cv_GMODULE_CFLAGS="$GMODULE_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmodule-2.0 >= \$GMODULE_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gmodule-2.0 >= $GMODULE_VERSION_REQUIRED") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$GMODULE_CFLAGS"; then + pkg_cv_GMODULE_CFLAGS="$GMODULE_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmodule-2.0 >= \$GLIB_REQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gmodule-2.0 >= $GLIB_REQ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GMODULE_CFLAGS=`$PKG_CONFIG --cflags "gmodule-2.0 >= $GMODULE_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_GMODULE_CFLAGS=`$PKG_CONFIG --cflags "gmodule-2.0 >= $GLIB_REQ" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$GMODULE_LIBS"; then - pkg_cv_GMODULE_LIBS="$GMODULE_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmodule-2.0 >= \$GMODULE_VERSION_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gmodule-2.0 >= $GMODULE_VERSION_REQUIRED") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$GMODULE_LIBS"; then + pkg_cv_GMODULE_LIBS="$GMODULE_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmodule-2.0 >= \$GLIB_REQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gmodule-2.0 >= $GLIB_REQ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GMODULE_LIBS=`$PKG_CONFIG --libs "gmodule-2.0 >= $GMODULE_VERSION_REQUIRED" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_GMODULE_LIBS=`$PKG_CONFIG --libs "gmodule-2.0 >= $GLIB_REQ" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -15392,14 +18087,14 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GMODULE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gmodule-2.0 >= $GMODULE_VERSION_REQUIRED" 2>&1` + GMODULE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "gmodule-2.0 >= $GLIB_REQ"` else - GMODULE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gmodule-2.0 >= $GMODULE_VERSION_REQUIRED" 2>&1` + GMODULE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gmodule-2.0 >= $GLIB_REQ"` fi # Put the nasty error message in config.log where it belongs echo "$GMODULE_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (gmodule-2.0 >= $GMODULE_VERSION_REQUIRED) were not met: + as_fn_error $? "Package requirements (gmodule-2.0 >= $GLIB_REQ) were not met: $GMODULE_PKG_ERRORS @@ -15408,10 +18103,9 @@ Alternatively, you may set the environment variables GMODULE_CFLAGS and GMODULE_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 +See the pkg-config man page for more details. +" "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it @@ -15429,58 +18123,59 @@ GMODULE_LIBS=$pkg_cv_GMODULE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - + : fi fi +fi USE_WAYLAND=0 -if test "$enable_wayland" = "yes"; then +if test "x$enable_wayland" = "xyes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WAYLAND" >&5 $as_echo_n "checking for WAYLAND... " >&6; } -if test -n "$WAYLAND_CFLAGS"; then - pkg_cv_WAYLAND_CFLAGS="$WAYLAND_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client >= 1.0.2\""; } >&5 - ($PKG_CONFIG --exists --print-errors "wayland-client >= 1.0.2") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$WAYLAND_CFLAGS"; then + pkg_cv_WAYLAND_CFLAGS="$WAYLAND_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client >= \$WAYLAND_REQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "wayland-client >= $WAYLAND_REQ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_WAYLAND_CFLAGS=`$PKG_CONFIG --cflags "wayland-client >= 1.0.2" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_WAYLAND_CFLAGS=`$PKG_CONFIG --cflags "wayland-client >= $WAYLAND_REQ" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$WAYLAND_LIBS"; then - pkg_cv_WAYLAND_LIBS="$WAYLAND_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client >= 1.0.2\""; } >&5 - ($PKG_CONFIG --exists --print-errors "wayland-client >= 1.0.2") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$WAYLAND_LIBS"; then + pkg_cv_WAYLAND_LIBS="$WAYLAND_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client >= \$WAYLAND_REQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "wayland-client >= $WAYLAND_REQ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_WAYLAND_LIBS=`$PKG_CONFIG --libs "wayland-client >= 1.0.2" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_WAYLAND_LIBS=`$PKG_CONFIG --libs "wayland-client >= $WAYLAND_REQ" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -15488,94 +18183,111 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - WAYLAND_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "wayland-client >= 1.0.2" 2>&1` + WAYLAND_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "wayland-client >= $WAYLAND_REQ"` else - WAYLAND_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "wayland-client >= 1.0.2" 2>&1` + WAYLAND_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "wayland-client >= $WAYLAND_REQ"` fi # Put the nasty error message in config.log where it belongs echo "$WAYLAND_PKG_ERRORS" >&5 - USE_WAYLAND=0 + as_fn_error $? "Package requirements (wayland-client >= $WAYLAND_REQ) were not met: + +$WAYLAND_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables WAYLAND_CFLAGS +and WAYLAND_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - USE_WAYLAND=0 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables WAYLAND_CFLAGS +and WAYLAND_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } else WAYLAND_CFLAGS=$pkg_cv_WAYLAND_CFLAGS WAYLAND_LIBS=$pkg_cv_WAYLAND_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - USE_WAYLAND=1 -fi - if test $USE_WAYLAND -eq 1; then - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $WAYLAND_CFLAGS" - for ac_header in wayland-client.h + USE_WAYLAND=1 + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $WAYLAND_CFLAGS" + for ac_header in wayland-client.h do : ac_fn_c_check_header_mongrel "$LINENO" "wayland-client.h" "ac_cv_header_wayland_client_h" "$ac_includes_default" if test "x$ac_cv_header_wayland_client_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_WAYLAND_CLIENT_H 1 _ACEOF - : + else USE_WAYLAND=0 fi done - CPPFLAGS="$saved_CPPFLAGS" - fi + CPPFLAGS="$saved_CPPFLAGS" + +fi fi -LIBVA_PKGNAME="libva" pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBVA" >&5 $as_echo_n "checking for LIBVA... " >&6; } -if test -n "$LIBVA_CFLAGS"; then - pkg_cv_LIBVA_CFLAGS="$LIBVA_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBVA_PKGNAME >= 0.30.4\""; } >&5 - ($PKG_CONFIG --exists --print-errors "$LIBVA_PKGNAME >= 0.30.4") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$LIBVA_CFLAGS"; then + pkg_cv_LIBVA_CFLAGS="$LIBVA_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libva >= \$VAAPI_REQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libva >= $VAAPI_REQ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_LIBVA_CFLAGS=`$PKG_CONFIG --cflags "$LIBVA_PKGNAME >= 0.30.4" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_LIBVA_CFLAGS=`$PKG_CONFIG --cflags "libva >= $VAAPI_REQ" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$LIBVA_LIBS"; then - pkg_cv_LIBVA_LIBS="$LIBVA_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBVA_PKGNAME >= 0.30.4\""; } >&5 - ($PKG_CONFIG --exists --print-errors "$LIBVA_PKGNAME >= 0.30.4") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$LIBVA_LIBS"; then + pkg_cv_LIBVA_LIBS="$LIBVA_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libva >= \$VAAPI_REQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libva >= $VAAPI_REQ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_LIBVA_LIBS=`$PKG_CONFIG --libs "$LIBVA_PKGNAME >= 0.30.4" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_LIBVA_LIBS=`$PKG_CONFIG --libs "libva >= $VAAPI_REQ" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -15583,14 +18295,14 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - LIBVA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$LIBVA_PKGNAME >= 0.30.4" 2>&1` + LIBVA_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libva >= $VAAPI_REQ"` else - LIBVA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$LIBVA_PKGNAME >= 0.30.4" 2>&1` + LIBVA_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libva >= $VAAPI_REQ"` fi # Put the nasty error message in config.log where it belongs echo "$LIBVA_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements ($LIBVA_PKGNAME >= 0.30.4) were not met: + as_fn_error $? "Package requirements (libva >= $VAAPI_REQ) were not met: $LIBVA_PKG_ERRORS @@ -15599,10 +18311,9 @@ Alternatively, you may set the environment variables LIBVA_CFLAGS and LIBVA_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 +See the pkg-config man page for more details. +" "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it @@ -15620,63 +18331,56 @@ LIBVA_LIBS=$pkg_cv_LIBVA_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - + : fi +VA_VERSION_STR=`$PKG_CONFIG --modversion libva` - -VA_VERSION=`$PKG_CONFIG --modversion libva` -VA_MAJOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f1` -VA_MINOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f2` -VA_MICRO_VERSION=`echo "$VA_VERSION" | cut -d'.' -f3` -VA_VERSION_STR="$VA_VERSION" - -HAVE_VA_DRM=0 if test $USE_DRM -eq 1; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBVA_DRM" >&5 $as_echo_n "checking for LIBVA_DRM... " >&6; } -if test -n "$LIBVA_DRM_CFLAGS"; then - pkg_cv_LIBVA_DRM_CFLAGS="$LIBVA_DRM_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libva-drm >= 0.33.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libva-drm >= 0.33.0") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$LIBVA_DRM_CFLAGS"; then + pkg_cv_LIBVA_DRM_CFLAGS="$LIBVA_DRM_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libva-drm >= \$VAAPI_DRM_REQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libva-drm >= $VAAPI_DRM_REQ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_LIBVA_DRM_CFLAGS=`$PKG_CONFIG --cflags "libva-drm >= 0.33.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_LIBVA_DRM_CFLAGS=`$PKG_CONFIG --cflags "libva-drm >= $VAAPI_DRM_REQ" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$LIBVA_DRM_LIBS"; then - pkg_cv_LIBVA_DRM_LIBS="$LIBVA_DRM_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libva-drm >= 0.33.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libva-drm >= 0.33.0") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$LIBVA_DRM_LIBS"; then + pkg_cv_LIBVA_DRM_LIBS="$LIBVA_DRM_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libva-drm >= \$VAAPI_DRM_REQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libva-drm >= $VAAPI_DRM_REQ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_LIBVA_DRM_LIBS=`$PKG_CONFIG --libs "libva-drm >= 0.33.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_LIBVA_DRM_LIBS=`$PKG_CONFIG --libs "libva-drm >= $VAAPI_DRM_REQ" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -15684,133 +18388,270 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - LIBVA_DRM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libva-drm >= 0.33.0" 2>&1` + LIBVA_DRM_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libva-drm >= $VAAPI_DRM_REQ"` else - LIBVA_DRM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libva-drm >= 0.33.0" 2>&1` + LIBVA_DRM_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libva-drm >= $VAAPI_DRM_REQ"` fi # Put the nasty error message in config.log where it belongs echo "$LIBVA_DRM_PKG_ERRORS" >&5 - USE_DRM=0 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } + USE_DRM=0 +elif test $pkg_failed = untried; then USE_DRM=0 else LIBVA_DRM_CFLAGS=$pkg_cv_LIBVA_DRM_CFLAGS LIBVA_DRM_LIBS=$pkg_cv_LIBVA_DRM_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - HAVE_VA_DRM=1 -fi - if test $HAVE_VA_DRM -eq 1; then - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$LIBVA_DRM_CFLAGS" - for ac_header in va/va_drm.h + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$LIBVA_DRM_CFLAGS" + for ac_header in va/va_drm.h do : ac_fn_c_check_header_mongrel "$LINENO" "va/va_drm.h" "ac_cv_header_va_va_drm_h" "$ac_includes_default" if test "x$ac_cv_header_va_va_drm_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VA_VA_DRM_H 1 _ACEOF - : + else - HAVE_VA_DRM=0 USE_DRM=0 + USE_DRM=0 fi done - CPPFLAGS="$saved_CPPFLAGS" - fi + CPPFLAGS="$saved_CPPFLAGS" + +fi fi -HAVE_VA_X11=0 -LIBVA_X11_PKGNAME="libva-x11" if test $USE_X11 -eq 1; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBVA_X11" >&5 $as_echo_n "checking for LIBVA_X11... " >&6; } -if test -n "$LIBVA_X11_CFLAGS"; then - pkg_cv_LIBVA_X11_CFLAGS="$LIBVA_X11_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBVA_X11_PKGNAME >= 0.31.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "$LIBVA_X11_PKGNAME >= 0.31.0") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$LIBVA_X11_CFLAGS"; then + pkg_cv_LIBVA_X11_CFLAGS="$LIBVA_X11_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libva-x11 >= \$VAAPI_X11_REQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libva-x11 >= $VAAPI_X11_REQ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_LIBVA_X11_CFLAGS=`$PKG_CONFIG --cflags "$LIBVA_X11_PKGNAME >= 0.31.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_LIBVA_X11_CFLAGS=`$PKG_CONFIG --cflags "libva-x11 >= $VAAPI_X11_REQ" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$LIBVA_X11_LIBS"; then - pkg_cv_LIBVA_X11_LIBS="$LIBVA_X11_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBVA_X11_PKGNAME >= 0.31.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "$LIBVA_X11_PKGNAME >= 0.31.0") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$LIBVA_X11_LIBS"; then + pkg_cv_LIBVA_X11_LIBS="$LIBVA_X11_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libva-x11 >= \$VAAPI_X11_REQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libva-x11 >= $VAAPI_X11_REQ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_LIBVA_X11_LIBS=`$PKG_CONFIG --libs "$LIBVA_X11_PKGNAME >= 0.31.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_LIBVA_X11_LIBS=`$PKG_CONFIG --libs "libva-x11 >= $VAAPI_X11_REQ" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBVA_X11_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libva-x11 >= $VAAPI_X11_REQ"` + else + LIBVA_X11_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libva-x11 >= $VAAPI_X11_REQ"` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBVA_X11_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + USE_X11=0 +elif test $pkg_failed = untried; then + USE_X11=0 +else + LIBVA_X11_CFLAGS=$pkg_cv_LIBVA_X11_CFLAGS + LIBVA_X11_LIBS=$pkg_cv_LIBVA_X11_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + : +fi +fi + +saved_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" +for ac_header in va/va_dec_jpeg.h +do : + ac_fn_c_check_header_compile "$LINENO" "va/va_dec_jpeg.h" "ac_cv_header_va_va_dec_jpeg_h" " +#include + +" +if test "x$ac_cv_header_va_va_dec_jpeg_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VA_VA_DEC_JPEG_H 1 +_ACEOF + +fi + +done + +CPPFLAGS="$saved_CPPFLAGS" + +USE_JPEG_DECODER=0 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for JPEG decoding API" >&5 +$as_echo_n "checking for JPEG decoding API... " >&6; } +if ${ac_cv_have_jpeg_decoding_api+:} false; then : + $as_echo_n "(cached) " >&6 +else + + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" + saved_LIBS="$LIBS" + LIBS="$LIBS $LIBVA_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#include +#ifdef HAVE_VA_VA_DEC_JPEG_H +# include +#endif + +int +main () +{ + +VAPictureParameterBufferJPEGBaseline pic_param; +VASliceParameterBufferJPEGBaseline slice_param; +VAHuffmanTableBufferJPEGBaseline huffman_table; +VAIQMatrixBufferJPEGBaseline iq_matrix; + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_have_jpeg_decoding_api="yes" +else + ac_cv_have_jpeg_decoding_api="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CPPFLAGS="$saved_CPPFLAGS" + LIBS="$saved_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_jpeg_decoding_api" >&5 +$as_echo "$ac_cv_have_jpeg_decoding_api" >&6; } +if test "x$ac_cv_have_jpeg_decoding_api" = "xyes"; then : + USE_JPEG_DECODER=1 +fi + +saved_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" +for ac_header in va/va_dec_vp8.h +do : + ac_fn_c_check_header_compile "$LINENO" "va/va_dec_vp8.h" "ac_cv_header_va_va_dec_vp8_h" " +#include + +" +if test "x$ac_cv_header_va_va_dec_vp8_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VA_VA_DEC_VP8_H 1 +_ACEOF + fi +done + +CPPFLAGS="$saved_CPPFLAGS" + +USE_VP8_DECODER=0 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for VP8 decoding API" >&5 +$as_echo_n "checking for VP8 decoding API... " >&6; } +if ${ac_cv_have_vp8_decoding_api+:} false; then : + $as_echo_n "(cached) " >&6 +else + + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" + saved_LIBS="$LIBS" + LIBS="$LIBS $LIBVA_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +#include +#ifdef HAVE_VA_VA_DEC_VP8_H +# include +#endif -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes +int +main () +{ + +VAPictureParameterBufferVP8 pic_param; +VASliceParameterBufferVP8 slice_param; +VAProbabilityDataBufferVP8 prob_data; +VAIQMatrixBufferVP8 iq_matrix; +slice_param.slice_data_offset = 0; +slice_param.slice_data_flag = 0; + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_have_vp8_decoding_api="yes" else - _pkg_short_errors_supported=no + ac_cv_have_vp8_decoding_api="no" fi - if test $_pkg_short_errors_supported = yes; then - LIBVA_X11_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$LIBVA_X11_PKGNAME >= 0.31.0" 2>&1` - else - LIBVA_X11_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$LIBVA_X11_PKGNAME >= 0.31.0" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$LIBVA_X11_PKG_ERRORS" >&5 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CPPFLAGS="$saved_CPPFLAGS" + LIBS="$saved_LIBS" - USE_X11=0 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - USE_X11=0 -else - LIBVA_X11_CFLAGS=$pkg_cv_LIBVA_X11_CFLAGS - LIBVA_X11_LIBS=$pkg_cv_LIBVA_X11_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - HAVE_VA_X11=1 fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_vp8_decoding_api" >&5 +$as_echo "$ac_cv_have_vp8_decoding_api" >&6; } +if test "x$ac_cv_have_vp8_decoding_api" = "xyes"; then : + USE_VP8_DECODER=1 fi - saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" -for ac_header in va/va_dec_jpeg.h +for ac_header in va/va_dec_vp9.h do : - ac_fn_c_check_header_compile "$LINENO" "va/va_dec_jpeg.h" "ac_cv_header_va_va_dec_jpeg_h" "#include + ac_fn_c_check_header_compile "$LINENO" "va/va_dec_vp9.h" "ac_cv_header_va_va_dec_vp9_h" " +#include + " -if test "x$ac_cv_header_va_va_dec_jpeg_h" = xyes; then : +if test "x$ac_cv_header_va_va_dec_vp9_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_VA_VA_DEC_JPEG_H 1 +#define HAVE_VA_VA_DEC_VP9_H 1 _ACEOF fi @@ -15819,10 +18660,10 @@ CPPFLAGS="$saved_CPPFLAGS" -USE_JPEG_DECODER=0 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for JPEG decoding API" >&5 -$as_echo_n "checking for JPEG decoding API... " >&6; } -if ${ac_cv_have_jpeg_decoding_api+:} false; then : +USE_VP9_DECODER=0 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for VP9 decoding API" >&5 +$as_echo_n "checking for VP9 decoding API... " >&6; } +if ${ac_cv_have_vp9_decoding_api+:} false; then : $as_echo_n "(cached) " >&6 else @@ -15832,45 +18673,55 @@ LIBS="$LIBS $LIBVA_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + + #include - #ifdef HAVE_VA_VA_DEC_JPEG_H - #include - #endif +#ifdef HAVE_VA_VA_DEC_VP9_H +# include +#endif int main () { -VAPictureParameterBufferJPEGBaseline pic_param; - VASliceParameterBufferJPEGBaseline slice_param; - VAHuffmanTableBufferJPEGBaseline huffman_table; - VAIQMatrixBufferJPEGBaseline iq_matrix; + +VADecPictureParameterBufferVP9 pic_param; +VASliceParameterBufferVP9 slice_param; +VASegmentParameterVP9 seg_param; +slice_param.slice_data_offset = 0; +slice_param.slice_data_flag = 0; + ; return 0; } + _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_have_jpeg_decoding_api="yes" USE_JPEG_DECODER=1 + ac_cv_have_vp9_decoding_api="yes" else - ac_cv_have_jpeg_decoding_api="no" - + ac_cv_have_vp9_decoding_api="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_jpeg_decoding_api" >&5 -$as_echo "$ac_cv_have_jpeg_decoding_api" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_vp9_decoding_api" >&5 +$as_echo "$ac_cv_have_vp9_decoding_api" >&6; } +if test "x$ac_cv_have_vp9_decoding_api" = "xyes"; then : + USE_VP9_DECODER=1 +fi saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" -for ac_header in va/va_dec_vp8.h +for ac_header in va/va_dec_hevc.h do : - ac_fn_c_check_header_compile "$LINENO" "va/va_dec_vp8.h" "ac_cv_header_va_va_dec_vp8_h" "#include + ac_fn_c_check_header_compile "$LINENO" "va/va_dec_hevc.h" "ac_cv_header_va_va_dec_hevc_h" " +#include + " -if test "x$ac_cv_header_va_va_dec_vp8_h" = xyes; then : +if test "x$ac_cv_header_va_va_dec_hevc_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_VA_VA_DEC_VP8_H 1 +#define HAVE_VA_VA_DEC_HEVC_H 1 _ACEOF fi @@ -15879,10 +18730,10 @@ CPPFLAGS="$saved_CPPFLAGS" -USE_VP8_DECODER=0 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for VP8 decoding API" >&5 -$as_echo_n "checking for VP8 decoding API... " >&6; } -if ${ac_cv_have_vp8_decoding_api+:} false; then : +USE_HEVC_DECODER=0 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for HEVC decoding API" >&5 +$as_echo_n "checking for HEVC decoding API... " >&6; } +if ${ac_cv_have_hevc_decoding_api+:} false; then : $as_echo_n "(cached) " >&6 else @@ -15892,252 +18743,451 @@ LIBS="$LIBS $LIBVA_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + + #include - #ifdef HAVE_VA_VA_DEC_VP8_H - #include - #endif +#ifdef HAVE_VA_VA_DEC_HEVC_H +# include +#endif int main () { -VAPictureParameterBufferVP8 pic_param; - VASliceParameterBufferVP8 slice_param; - VAProbabilityDataBufferVP8 prob_data; - VAIQMatrixBufferVP8 iq_matrix; - slice_param.slice_data_offset = 0; - slice_param.slice_data_flag = 0; + +VAPictureParameterBufferHEVC pic_param; +VASliceParameterBufferHEVC slice_param; +VAIQMatrixBufferHEVC iq_matrix; +slice_param.slice_data_offset = 0; +slice_param.slice_data_flag = 0; + ; return 0; } + _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_have_vp8_decoding_api="yes" USE_VP8_DECODER=1 + ac_cv_have_hevc_decoding_api="yes" else - ac_cv_have_vp8_decoding_api="no" + ac_cv_have_hevc_decoding_api="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CPPFLAGS="$saved_CPPFLAGS" + LIBS="$saved_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_hevc_decoding_api" >&5 +$as_echo "$ac_cv_have_hevc_decoding_api" >&6; } +if test "x$ac_cv_have_hevc_decoding_api" = "xyes"; then : + USE_HEVC_DECODER=1 +fi + +USE_VA_VPP=0 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for video post-postprocessing API" >&5 +$as_echo_n "checking for video post-postprocessing API... " >&6; } +if ${ac_cv_have_va_vpp_api+:} false; then : + $as_echo_n "(cached) " >&6 +else + + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" + saved_LIBS="$LIBS" + LIBS="$LIBS $LIBVA_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#include +#include + +int +main () +{ +VADisplay va_dpy; +VAContextID vpp_ctx; +VAProcFilterType filters[VAProcFilterCount]; +unsigned int num_filters = VAProcFilterCount; +vaQueryVideoProcFilters(va_dpy, vpp_ctx, filters, &num_filters); + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_have_va_vpp_api="yes" +else + ac_cv_have_va_vpp_api="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_vp8_decoding_api" >&5 -$as_echo "$ac_cv_have_vp8_decoding_api" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_va_vpp_api" >&5 +$as_echo "$ac_cv_have_va_vpp_api" >&6; } +if test "x$ac_cv_have_va_vpp_api" = "xyes"; then : + USE_VA_VPP=1 +fi -saved_CPPFLAGS="$CPPFLAGS" -CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" -for ac_header in va/va_dec_vp9.h +USE_ENCODERS=0 +if test "x$enable_encoders" = "xyes"; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBVA" >&5 +$as_echo_n "checking for LIBVA... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$LIBVA_CFLAGS"; then + pkg_cv_LIBVA_CFLAGS="$LIBVA_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libva >= \$VAAPI_ENC_REQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libva >= $VAAPI_ENC_REQ") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBVA_CFLAGS=`$PKG_CONFIG --cflags "libva >= $VAAPI_ENC_REQ" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$LIBVA_LIBS"; then + pkg_cv_LIBVA_LIBS="$LIBVA_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libva >= \$VAAPI_ENC_REQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libva >= $VAAPI_ENC_REQ") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBVA_LIBS=`$PKG_CONFIG --libs "libva >= $VAAPI_ENC_REQ" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBVA_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libva >= $VAAPI_ENC_REQ"` + else + LIBVA_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libva >= $VAAPI_ENC_REQ"` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBVA_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (libva >= $VAAPI_ENC_REQ) were not met: + +$LIBVA_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables LIBVA_CFLAGS +and LIBVA_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 +elif test $pkg_failed = untried; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables LIBVA_CFLAGS +and LIBVA_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } +else + LIBVA_CFLAGS=$pkg_cv_LIBVA_CFLAGS + LIBVA_LIBS=$pkg_cv_LIBVA_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + USE_ENCODERS=1 + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$LIBVA_CFLAGS" + for ac_header in va/va_enc_mpeg2.h va/va_enc_h264.h do : - ac_fn_c_check_header_compile "$LINENO" "va/va_dec_vp9.h" "ac_cv_header_va_va_dec_vp9_h" "#include + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " +#include + " -if test "x$ac_cv_header_va_va_dec_vp9_h" = xyes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define HAVE_VA_VA_DEC_VP9_H 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF +else + USE_ENCODERS=0 fi done -CPPFLAGS="$saved_CPPFLAGS" + CPPFLAGS="$saved_CPPFLAGS" -USE_VP9_DECODER=0 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for VP9 decoding API" >&5 -$as_echo_n "checking for VP9 decoding API... " >&6; } -if ${ac_cv_have_vp9_decoding_api+:} false; then : +fi +fi + +USE_JPEG_ENCODER=0 +USE_VP8_ENCODER=0 +USE_H265_ENCODER=0 +if test $USE_ENCODERS -eq 1; then + for ac_header in va/va_enc_jpeg.h +do : + ac_fn_c_check_header_compile "$LINENO" "va/va_enc_jpeg.h" "ac_cv_header_va_va_enc_jpeg_h" " +#include + +" +if test "x$ac_cv_header_va_va_enc_jpeg_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VA_VA_ENC_JPEG_H 1 +_ACEOF + +fi + +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JPEG encoding API" >&5 +$as_echo_n "checking for JPEG encoding API... " >&6; } +if ${ac_cv_have_jpeg_encoding_api+:} false; then : $as_echo_n "(cached) " >&6 else - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$LIBS $LIBVA_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" + saved_LIBS="$LIBS" + LIBS="$LIBS $LIBVA_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + + #include - #ifdef HAVE_VA_VA_DEC_VP9_H - #include - #endif +#ifdef HAVE_VA_VA_ENC_JPEG_H +# include +#endif int main () { -VADecPictureParameterBufferVP9 pic_param; - VASliceParameterBufferVP9 slice_param; - VASegmentParameterVP9 seg_param; - slice_param.slice_data_offset = 0; - slice_param.slice_data_flag = 0; + +VAEncPictureParameterBufferJPEG pic_param; +VAEncSliceParameterBufferJPEG slice_param; +VAQMatrixBufferJPEG q_matrix; + ; return 0; } + _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_have_vp9_decoding_api="yes" USE_VP9_DECODER=1 + ac_cv_have_jpeg_encoding_api="yes" else - ac_cv_have_vp9_decoding_api="no" - + ac_cv_have_jpeg_encoding_api="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" + CPPFLAGS="$saved_CPPFLAGS" + LIBS="$saved_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_vp9_decoding_api" >&5 -$as_echo "$ac_cv_have_vp9_decoding_api" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_jpeg_encoding_api" >&5 +$as_echo "$ac_cv_have_jpeg_encoding_api" >&6; } + if test "x$ac_cv_have_jpeg_encoding_api" = "xyes"; then : + USE_JPEG_ENCODER=1 +fi -saved_CPPFLAGS="$CPPFLAGS" -CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" -for ac_header in va/va_dec_hevc.h + for ac_header in va/va_enc_vp8.h do : - ac_fn_c_check_header_compile "$LINENO" "va/va_dec_hevc.h" "ac_cv_header_va_va_dec_hevc_h" "#include + ac_fn_c_check_header_compile "$LINENO" "va/va_enc_vp8.h" "ac_cv_header_va_va_enc_vp8_h" " +#include + " -if test "x$ac_cv_header_va_va_dec_hevc_h" = xyes; then : +if test "x$ac_cv_header_va_va_enc_vp8_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_VA_VA_DEC_HEVC_H 1 +#define HAVE_VA_VA_ENC_VP8_H 1 _ACEOF fi done -CPPFLAGS="$saved_CPPFLAGS" - -USE_HEVC_DECODER=0 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for HEVC decoding API" >&5 -$as_echo_n "checking for HEVC decoding API... " >&6; } -if ${ac_cv_have_hevc_decoding_api+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for VP8 encoding API" >&5 +$as_echo_n "checking for VP8 encoding API... " >&6; } +if ${ac_cv_have_vp8_encoding_api+:} false; then : $as_echo_n "(cached) " >&6 else - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$LIBS $LIBVA_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" + saved_LIBS="$LIBS" + LIBS="$LIBS $LIBVA_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + + #include - #ifdef HAVE_VA_VA_DEC_HEVC_H - #include - #endif +#ifdef HAVE_VA_VA_ENC_VP8_H +# include +#endif int main () { -VAPictureParameterBufferHEVC pic_param; - VASliceParameterBufferHEVC slice_param; - VAIQMatrixBufferHEVC iq_matrix; - slice_param.slice_data_offset = 0; - slice_param.slice_data_flag = 0; + +VAEncSequenceParameterBufferVP8 seq_param; +VAEncPictureParameterBufferVP8 pic_param; +VAQMatrixBufferVP8 q_matrix; + ; return 0; } + _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_have_hevc_decoding_api="yes" USE_HEVC_DECODER=1 + ac_cv_have_vp8_encoding_api="yes" else - ac_cv_have_hevc_decoding_api="no" - + ac_cv_have_vp8_encoding_api="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" + CPPFLAGS="$saved_CPPFLAGS" + LIBS="$saved_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_hevc_decoding_api" >&5 -$as_echo "$ac_cv_have_hevc_decoding_api" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_vp8_encoding_api" >&5 +$as_echo "$ac_cv_have_vp8_encoding_api" >&6; } + if test "x$ac_cv_have_vp8_encoding_api" = "xyes"; then : + USE_VP8_ENCODER=1 +fi -USE_VA_VPP=0 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for video post-postprocessing API" >&5 -$as_echo_n "checking for video post-postprocessing API... " >&6; } -if ${ac_cv_have_va_vpp_api+:} false; then : + for ac_header in va/va_enc_hevc.h +do : + ac_fn_c_check_header_compile "$LINENO" "va/va_enc_hevc.h" "ac_cv_header_va_va_enc_hevc_h" " +#include + +" +if test "x$ac_cv_header_va_va_enc_hevc_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VA_VA_ENC_HEVC_H 1 +_ACEOF + +fi + +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HEVC encoding API" >&5 +$as_echo_n "checking for HEVC encoding API... " >&6; } +if ${ac_cv_have_hevc_encoding_api+:} false; then : $as_echo_n "(cached) " >&6 else - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$LIBS $LIBVA_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" + saved_LIBS="$LIBS" + LIBS="$LIBS $LIBVA_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + + #include - #include +#ifdef HAVE_VA_VA_ENC_HEVC_H +# include +#endif + int main () { -VADisplay va_dpy; - VAContextID vpp_ctx; - VAProcFilterType filters[VAProcFilterCount]; - unsigned int num_filters = VAProcFilterCount; - vaQueryVideoProcFilters(va_dpy, vpp_ctx, filters, &num_filters); + +VAEncSequenceParameterBufferHEVC seq_param; +VAEncPictureParameterBufferHEVC pic_param; +VAEncSliceParameterBufferHEVC buf_param; +VAQMatrixBufferHEVC q_matrix; ; return 0; } + _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_have_va_vpp_api="yes" USE_VA_VPP=1 + ac_cv_have_hevc_encoding_api="yes" else - ac_cv_have_va_vpp_api="no" - + ac_cv_have_hevc_encoding_api="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" + CPPFLAGS="$saved_CPPFLAGS" + LIBS="$saved_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_va_vpp_api" >&5 -$as_echo "$ac_cv_have_va_vpp_api" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_hevc_encoding_api" >&5 +$as_echo "$ac_cv_have_hevc_encoding_api" >&6; } + if test "x$ac_cv_have_hevc_encoding_api" = "xyes"; then : + USE_H265_ENCODER=1 +fi +fi -USE_ENCODERS=0 -USE_JPEG_ENCODER=0 -USE_VP8_ENCODER=0 -USE_H265_ENCODER=0 -if test "$enable_encoders" = "yes"; then +if test $USE_WAYLAND -eq 1; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBVA" >&5 -$as_echo_n "checking for LIBVA... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBVA_WAYLAND" >&5 +$as_echo_n "checking for LIBVA_WAYLAND... " >&6; } -if test -n "$LIBVA_CFLAGS"; then - pkg_cv_LIBVA_CFLAGS="$LIBVA_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libva >= 0.34.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libva >= 0.34.0") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$LIBVA_WAYLAND_CFLAGS"; then + pkg_cv_LIBVA_WAYLAND_CFLAGS="$LIBVA_WAYLAND_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libva-wayland >= \$VAAPI_WLD_REQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libva-wayland >= $VAAPI_WLD_REQ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_LIBVA_CFLAGS=`$PKG_CONFIG --cflags "libva >= 0.34.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_LIBVA_WAYLAND_CFLAGS=`$PKG_CONFIG --cflags "libva-wayland >= $VAAPI_WLD_REQ" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$LIBVA_LIBS"; then - pkg_cv_LIBVA_LIBS="$LIBVA_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libva >= 0.34.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libva >= 0.34.0") 2>&5 +if test -n "$PKG_CONFIG"; then + if test -n "$LIBVA_WAYLAND_LIBS"; then + pkg_cv_LIBVA_WAYLAND_LIBS="$LIBVA_WAYLAND_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libva-wayland >= \$VAAPI_WLD_REQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libva-wayland >= $VAAPI_WLD_REQ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_LIBVA_LIBS=`$PKG_CONFIG --libs "libva >= 0.34.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_LIBVA_WAYLAND_LIBS=`$PKG_CONFIG --libs "libva-wayland >= $VAAPI_WLD_REQ" 2>/dev/null` else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -16145,298 +19195,415 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - LIBVA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libva >= 0.34.0" 2>&1` + LIBVA_WAYLAND_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libva-wayland >= $VAAPI_WLD_REQ"` else - LIBVA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libva >= 0.34.0" 2>&1` + LIBVA_WAYLAND_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libva-wayland >= $VAAPI_WLD_REQ"` fi # Put the nasty error message in config.log where it belongs - echo "$LIBVA_PKG_ERRORS" >&5 + echo "$LIBVA_WAYLAND_PKG_ERRORS" >&5 - HAVE_VA_ENC=0 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - HAVE_VA_ENC=0 + USE_WAYLAND=0 +elif test $pkg_failed = untried; then + USE_WAYLAND=0 else - LIBVA_CFLAGS=$pkg_cv_LIBVA_CFLAGS - LIBVA_LIBS=$pkg_cv_LIBVA_LIBS + LIBVA_WAYLAND_CFLAGS=$pkg_cv_LIBVA_WAYLAND_CFLAGS + LIBVA_WAYLAND_LIBS=$pkg_cv_LIBVA_WAYLAND_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - HAVE_VA_ENC=1 + : +fi +fi + + +# set by AG_GST_PARSE_SUBSYSTEM_DISABLES above + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the GStreamer debugging system is enabled" >&5 +$as_echo_n "checking whether the GStreamer debugging system is enabled... " >&6; } + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + save_CFLAGS="$CFLAGS" + CFLAGS="$GST_CFLAGS $CFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + #ifdef GST_DISABLE_GST_DEBUG + #error "debugging disabled, make compiler fail" + #endif +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + debug_system_enabled=yes +else + debug_system_enabled=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $debug_system_enabled" >&5 +$as_echo "$debug_system_enabled" >&6; } + + if test "x$debug_system_enabled" = "xyes" ; then + NO_WARNINGS="" + true + else + NO_WARNINGS="-Wno-unused" + true + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands " >&5 +$as_echo_n "checking to see if compiler understands ... " >&6; } + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS " + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + flag_ok=yes +else + flag_ok=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + + true + else + + true + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 +$as_echo "$flag_ok" >&6; } + + + + + + WARNING_CFLAGS="" + ERROR_CFLAGS="" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Wall" >&5 +$as_echo_n "checking to see if compiler understands -Wall... " >&6; } + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wall" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + flag_ok=yes +else + flag_ok=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + WARNING_CFLAGS="$WARNING_CFLAGS -Wall" + true + else + + true + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 +$as_echo "$flag_ok" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Wdeclaration-after-statement" >&5 +$as_echo_n "checking to see if compiler understands -Wdeclaration-after-statement... " >&6; } + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wdeclaration-after-statement" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + flag_ok=yes +else + flag_ok=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + WARNING_CFLAGS="$WARNING_CFLAGS -Wdeclaration-after-statement" + true + else + + true + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 +$as_echo "$flag_ok" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Wvla" >&5 +$as_echo_n "checking to see if compiler understands -Wvla... " >&6; } + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wvla" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - if test $HAVE_VA_ENC -eq 1; then - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$LIBVA_CFLAGS" - for ac_header in va/va_enc_mpeg2.h va/va_enc_h264.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#include +int +main () +{ -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + ; + return 0; +} _ACEOF - USE_ENCODERS=1 +if ac_fn_c_try_compile "$LINENO"; then : + flag_ok=yes else - HAVE_VA_ENC=0 USE_ENCODERS=0 + flag_ok=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" -done + if test "X$flag_ok" = Xyes ; then + WARNING_CFLAGS="$WARNING_CFLAGS -Wvla" + true + else + true + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 +$as_echo "$flag_ok" >&6; } - for ac_header in va/va_enc_jpeg.h -do : - ac_fn_c_check_header_compile "$LINENO" "va/va_enc_jpeg.h" "ac_cv_header_va_va_enc_jpeg_h" "#include -" -if test "x$ac_cv_header_va_va_enc_jpeg_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_VA_VA_ENC_JPEG_H 1 -_ACEOF - USE_JPEG_ENCODER=1 -fi -done + { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Wpointer-arith" >&5 +$as_echo_n "checking to see if compiler understands -Wpointer-arith... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JPEG encoding API" >&5 -$as_echo_n "checking for JPEG encoding API... " >&6; } -if ${ac_cv_have_jpeg_encoding_api+:} false; then : - $as_echo_n "(cached) " >&6 -else + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wpointer-arith" - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$LIBS $LIBVA_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - #ifdef HAVE_VA_VA_ENC_JPEG_H - #include - #endif int main () { -VAEncPictureParameterBufferJPEG pic_param; - VAEncSliceParameterBufferJPEG slice_param; - VAQMatrixBufferJPEG q_matrix; + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_have_jpeg_encoding_api="yes" USE_JPEG_ENCODER=1 + flag_ok=yes else - ac_cv_have_jpeg_encoding_api="no" - + flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" + CFLAGS="$save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_jpeg_encoding_api" >&5 -$as_echo "$ac_cv_have_jpeg_encoding_api" >&6; } + if test "X$flag_ok" = Xyes ; then + WARNING_CFLAGS="$WARNING_CFLAGS -Wpointer-arith" + true + else - for ac_header in va/va_enc_vp8.h -do : - ac_fn_c_check_header_compile "$LINENO" "va/va_enc_vp8.h" "ac_cv_header_va_va_enc_vp8_h" "#include + true + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 +$as_echo "$flag_ok" >&6; } -" -if test "x$ac_cv_header_va_va_enc_vp8_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_VA_VA_ENC_VP8_H 1 -_ACEOF - USE_VP8_ENCODER=1 -fi -done + if test "x$FATAL_WARNINGS" != "xno" + then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for VP8 encoding API" >&5 -$as_echo_n "checking for VP8 encoding API... " >&6; } -if ${ac_cv_have_vp8_encoding_api+:} false; then : - $as_echo_n "(cached) " >&6 -else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Werror" >&5 +$as_echo_n "checking to see if compiler understands -Werror... " >&6; } - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$LIBS $LIBVA_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - #ifdef HAVE_VA_VA_ENC_VP8_H - #include - #endif int main () { -VAEncSequenceParameterBufferVP8 seq_param; - VAEncPictureParameterBufferVP8 pic_param; - VAQMatrixBufferVP8 q_matrix; + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_have_vp8_encoding_api="yes" USE_VP8_ENCODER=1 + flag_ok=yes else - ac_cv_have_vp8_encoding_api="no" USE_VP8_ENCODER=0 - + flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" + CFLAGS="$save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_vp8_encoding_api" >&5 -$as_echo "$ac_cv_have_vp8_encoding_api" >&6; } - CPPFLAGS="$saved_CPPFLAGS" + if test "X$flag_ok" = Xyes ; then + ERROR_CFLAGS="$ERROR_CFLAGS -Werror" + true + else - for ac_header in va/va_enc_hevc.h -do : - ac_fn_c_check_header_compile "$LINENO" "va/va_enc_hevc.h" "ac_cv_header_va_va_enc_hevc_h" "#include + true + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 +$as_echo "$flag_ok" >&6; } -" -if test "x$ac_cv_header_va_va_enc_hevc_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_VA_VA_ENC_HEVC_H 1 -_ACEOF - USE_H265_ENCODER=1 -fi + fi -done + if test "x-Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wformat-security -Wold-style-definition -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar -Wnested-externs $NO_WARNINGS" != "x" + then + UNSUPPORTED="" + list="-Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wformat-security -Wold-style-definition -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar -Wnested-externs $NO_WARNINGS" + for each in $list + do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HEVC encoding API" >&5 -$as_echo_n "checking for HEVC encoding API... " >&6; } -if ${ac_cv_have_hevc_encoding_api+:} false; then : - $as_echo_n "(cached) " >&6 -else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands $each" >&5 +$as_echo_n "checking to see if compiler understands $each... " >&6; } + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $each" - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$LIBS $LIBVA_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - #ifdef HAVE_VA_VA_ENC_HEVC_H - #include - #endif int main () { -VAEncSequenceParameterBufferHEVC seq_param; - VAEncPictureParameterBufferHEVC pic_param; - VAEncSliceParameterBufferHEVC; - VAQMatrixBufferHEVC q_matrix; + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_have_hevc_encoding_api="yes" USE_H265_ENCODER=1 + flag_ok=yes else - ac_cv_have_hevc_encoding_api="no" USE_H265_ENCODER=0 - + flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" + CFLAGS="$save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_hevc_encoding_api" >&5 -$as_echo "$ac_cv_have_hevc_encoding_api" >&6; } - CPPFLAGS="$saved_CPPFLAGS" + if test "X$flag_ok" = Xyes ; then + WARNING_CFLAGS="$WARNING_CFLAGS $each" + true + else + UNSUPPORTED="$UNSUPPORTED $each" + true + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 +$as_echo "$flag_ok" >&6; } + + done + if test "X$UNSUPPORTED" != X ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: unsupported compiler flags: $UNSUPPORTED" >&5 +$as_echo "$as_me: unsupported compiler flags: $UNSUPPORTED" >&6;} fi -fi + fi -if test "$enable_wayland" = "yes"; then -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBVA_WAYLAND" >&5 -$as_echo_n "checking for LIBVA_WAYLAND... " >&6; } -if test -n "$LIBVA_WAYLAND_CFLAGS"; then - pkg_cv_LIBVA_WAYLAND_CFLAGS="$LIBVA_WAYLAND_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libva-wayland >= 0.33.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libva-wayland >= 0.33.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBVA_WAYLAND_CFLAGS=`$PKG_CONFIG --cflags "libva-wayland >= 0.33.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$LIBVA_WAYLAND_LIBS"; then - pkg_cv_LIBVA_WAYLAND_LIBS="$LIBVA_WAYLAND_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libva-wayland >= 0.33.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libva-wayland >= 0.33.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBVA_WAYLAND_LIBS=`$PKG_CONFIG --libs "libva-wayland >= 0.33.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi + { $as_echo "$as_me:${as_lineno-$LINENO}: set WARNING_CFLAGS to $WARNING_CFLAGS" >&5 +$as_echo "$as_me: set WARNING_CFLAGS to $WARNING_CFLAGS" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: set ERROR_CFLAGS to $ERROR_CFLAGS" >&5 +$as_echo "$as_me: set ERROR_CFLAGS to $ERROR_CFLAGS" >&6;} -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + if test "x$GST_GIT" = "xyes"; then + GST_LEVEL_DEFAULT=GST_LEVEL_ERROR + else + GST_LEVEL_DEFAULT=GST_LEVEL_NONE + fi -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no +cat >>confdefs.h <<_ACEOF +#define GST_LEVEL_DEFAULT $GST_LEVEL_DEFAULT +_ACEOF + + + + + +if test "x$USE_DEBUG" = xyes; then + PROFILE_CFLAGS="-g" fi - if test $_pkg_short_errors_supported = yes; then - LIBVA_WAYLAND_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libva-wayland >= 0.33.0" 2>&1` - else - LIBVA_WAYLAND_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libva-wayland >= 0.33.0" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$LIBVA_WAYLAND_PKG_ERRORS" >&5 - USE_WAYLAND=0 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - USE_WAYLAND=0 + +if test "x$GST_GIT" = "xyes"; then + DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED" else - LIBVA_WAYLAND_CFLAGS=$pkg_cv_LIBVA_WAYLAND_CFLAGS - LIBVA_WAYLAND_LIBS=$pkg_cv_LIBVA_WAYLAND_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - : + DEPRECATED_CFLAGS="" fi + + +GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(DEPRECATED_CFLAGS)" + + +GST_CFLAGS="$GST_CFLAGS -DGST_USE_UNSTABLE_API" +GST_CFLAGS="$GST_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CFLAGS)" + + +GST_ALL_LDFLAGS="-no-undefined" +if test "x${enable_Bsymbolic}" = "xyes"; then + GST_ALL_LDFLAGS="$GST_ALL_LDFLAGS -Wl,-Bsymbolic-functions" fi +GST_LIB_LDFLAGS="-export-symbols-regex ^_?\(gst_\|Gst\|GST_\).*" + + +GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^_*gst_plugin_.*' $GST_ALL_LDFLAGS" + + + case ":$USE_X11:$USE_GLX:$USE_EGL:$USE_WAYLAND:$USE_DRM:" in -*:1:*) - ;; -*) - as_fn_error $? "No renderer is enabled" "$LINENO" 5 - ;; +*:1:*) ;; +*) as_fn_error $? "No renderer is enabled" "$LINENO" 5 ;; esac @@ -16641,10 +19808,13 @@ fi -pkgconfigdir=${libdir}/pkgconfig +cat >>confdefs.h <<_ACEOF +#define GST_VAAPI_MAJOR_VERSION_S "0" +_ACEOF -ac_config_files="$ac_config_files Makefile debian.upstream/Makefile debian.upstream/changelog debian.upstream/control debian.upstream/gstreamer$GST_API_VERSION-vaapi-doc.install:debian.upstream/gstreamer-vaapi-doc.install.in debian.upstream/gstreamer$GST_API_VERSION-vaapi.install:debian.upstream/gstreamer-vaapi.install.in debian.upstream/libgstvaapi$GST_PKG_VERSION-dev.install:debian.upstream/libgstvaapi-dev.install.in debian.upstream/libgstvaapi$GST_VAAPI_MAJOR_VERSION.install:debian.upstream/libgstvaapi.install.in debian.upstream/libgstvaapi-drm-$GST_VAAPI_MAJOR_VERSION.install:debian.upstream/libgstvaapi-drm.install.in debian.upstream/libgstvaapi-glx-$GST_VAAPI_MAJOR_VERSION.install:debian.upstream/libgstvaapi-glx.install.in debian.upstream/libgstvaapi-wayland-$GST_VAAPI_MAJOR_VERSION.install:debian.upstream/libgstvaapi-wayland.install.in debian.upstream/libgstvaapi-x11-$GST_VAAPI_MAJOR_VERSION.install:debian.upstream/libgstvaapi-x11.install.in docs/Makefile docs/reference/Makefile docs/reference/libs/Makefile docs/reference/libs/libs-docs.xml docs/reference/plugins/Makefile docs/reference/plugins/plugins-docs.xml ext/Makefile ext/libvpx/Makefile gst-libs/Makefile gst-libs/gst/Makefile gst-libs/gst/base/Makefile gst-libs/gst/codecparsers/Makefile gst-libs/gst/vaapi/Makefile gst/Makefile gst/vaapi/Makefile patches/Makefile patches/videoparsers/Makefile pkgconfig/Makefile pkgconfig/gstreamer-vaapi-$GST_PKG_VERSION.pc:pkgconfig/gstreamer-vaapi.pc.in pkgconfig/gstreamer-vaapi-drm-$GST_PKG_VERSION.pc:pkgconfig/gstreamer-vaapi-drm.pc.in pkgconfig/gstreamer-vaapi-glx-$GST_PKG_VERSION.pc:pkgconfig/gstreamer-vaapi-glx.pc.in pkgconfig/gstreamer-vaapi-wayland-$GST_PKG_VERSION.pc:pkgconfig/gstreamer-vaapi-wayland.pc.in pkgconfig/gstreamer-vaapi-x11-$GST_PKG_VERSION.pc:pkgconfig/gstreamer-vaapi-x11.pc.in tests/Makefile" + +ac_config_files="$ac_config_files Makefile common/Makefile common/m4/Makefile m4/Makefile docs/Makefile docs/version.entities docs/plugins/Makefile docs/plugins/gstreamer-vaapi-plugins-docs.xml gst-libs/Makefile gst-libs/gst/Makefile gst-libs/gst/base/Makefile gst-libs/gst/vaapi/Makefile gst/Makefile gst/vaapi/Makefile tests/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -16771,6 +19941,10 @@ am__EXEEXT_FALSE= fi +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -16779,72 +19953,93 @@ as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${HAVE_GIT_TRUE}" && test -z "${HAVE_GIT_FALSE}"; then - as_fn_error $? "conditional \"HAVE_GIT\" was never defined. + +if test -z "${HAVE_CPU_I386_TRUE}" && test -z "${HAVE_CPU_I386_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CPU_I386\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${HAVE_GTK_DOC_TRUE}" && test -z "${HAVE_GTK_DOC_FALSE}"; then - as_fn_error $? "conditional \"HAVE_GTK_DOC\" was never defined. +if test -z "${HAVE_CPU_PPC_TRUE}" && test -z "${HAVE_CPU_PPC_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CPU_PPC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_GTK_DOC\" was never defined. +if test -z "${HAVE_CPU_PPC64_TRUE}" && test -z "${HAVE_CPU_PPC64_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CPU_PPC64\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${GTK_DOC_BUILD_HTML_TRUE}" && test -z "${GTK_DOC_BUILD_HTML_FALSE}"; then - as_fn_error $? "conditional \"GTK_DOC_BUILD_HTML\" was never defined. +if test -z "${HAVE_CPU_ALPHA_TRUE}" && test -z "${HAVE_CPU_ALPHA_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CPU_ALPHA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${GTK_DOC_BUILD_PDF_TRUE}" && test -z "${GTK_DOC_BUILD_PDF_FALSE}"; then - as_fn_error $? "conditional \"GTK_DOC_BUILD_PDF\" was never defined. +if test -z "${HAVE_CPU_ARC_TRUE}" && test -z "${HAVE_CPU_ARC_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CPU_ARC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then - as_fn_error $? "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. +if test -z "${HAVE_CPU_ARM_TRUE}" && test -z "${HAVE_CPU_ARM_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CPU_ARM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CPU_SPARC_TRUE}" && test -z "${HAVE_CPU_SPARC_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CPU_SPARC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CPU_HPPA_TRUE}" && test -z "${HAVE_CPU_HPPA_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CPU_HPPA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${GTK_DOC_USE_REBASE_TRUE}" && test -z "${GTK_DOC_USE_REBASE_FALSE}"; then - as_fn_error $? "conditional \"GTK_DOC_USE_REBASE\" was never defined. +if test -z "${HAVE_CPU_MIPS_TRUE}" && test -z "${HAVE_CPU_MIPS_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CPU_MIPS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${USE_GST_API_1_2p_TRUE}" && test -z "${USE_GST_API_1_2p_FALSE}"; then - as_fn_error $? "conditional \"USE_GST_API_1_2p\" was never defined. +if test -z "${HAVE_CPU_S390_TRUE}" && test -z "${HAVE_CPU_S390_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CPU_S390\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${USE_GST_API_1_4p_TRUE}" && test -z "${USE_GST_API_1_4p_FALSE}"; then - as_fn_error $? "conditional \"USE_GST_API_1_4p\" was never defined. +if test -z "${HAVE_CPU_IA64_TRUE}" && test -z "${HAVE_CPU_IA64_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CPU_IA64\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${USE_LOCAL_CODEC_PARSERS_MPEG2_TRUE}" && test -z "${USE_LOCAL_CODEC_PARSERS_MPEG2_FALSE}"; then - as_fn_error $? "conditional \"USE_LOCAL_CODEC_PARSERS_MPEG2\" was never defined. +if test -z "${HAVE_CPU_M68K_TRUE}" && test -z "${HAVE_CPU_M68K_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CPU_M68K\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${USE_LOCAL_CODEC_PARSERS_H264_TRUE}" && test -z "${USE_LOCAL_CODEC_PARSERS_H264_FALSE}"; then - as_fn_error $? "conditional \"USE_LOCAL_CODEC_PARSERS_H264\" was never defined. +if test -z "${HAVE_CPU_X86_64_TRUE}" && test -z "${HAVE_CPU_X86_64_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CPU_X86_64\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${USE_LOCAL_CODEC_PARSERS_JPEG_TRUE}" && test -z "${USE_LOCAL_CODEC_PARSERS_JPEG_FALSE}"; then - as_fn_error $? "conditional \"USE_LOCAL_CODEC_PARSERS_JPEG\" was never defined. +if test -z "${HAVE_CPU_CRIS_TRUE}" && test -z "${HAVE_CPU_CRIS_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CPU_CRIS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${USE_LOCAL_CODEC_PARSERS_VP8_TRUE}" && test -z "${USE_LOCAL_CODEC_PARSERS_VP8_FALSE}"; then - as_fn_error $? "conditional \"USE_LOCAL_CODEC_PARSERS_VP8\" was never defined. +if test -z "${HAVE_CPU_CRISV32_TRUE}" && test -z "${HAVE_CPU_CRISV32_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CPU_CRISV32\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${USE_BUILTIN_LIBVPX_TRUE}" && test -z "${USE_BUILTIN_LIBVPX_FALSE}"; then - as_fn_error $? "conditional \"USE_BUILTIN_LIBVPX\" was never defined. +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_GIT_TRUE}" && test -z "${HAVE_GIT_FALSE}"; then + as_fn_error $? "conditional \"HAVE_GIT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_GTK_DOC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_BUILD_HTML_TRUE}" && test -z "${GTK_DOC_BUILD_HTML_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_BUILD_HTML\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${USE_LOCAL_CODEC_PARSERS_VP9_TRUE}" && test -z "${USE_LOCAL_CODEC_PARSERS_VP9_FALSE}"; then - as_fn_error $? "conditional \"USE_LOCAL_CODEC_PARSERS_VP9\" was never defined. +if test -z "${GTK_DOC_BUILD_PDF_TRUE}" && test -z "${GTK_DOC_BUILD_PDF_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_BUILD_PDF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${USE_LOCAL_CODEC_PARSERS_H265_TRUE}" && test -z "${USE_LOCAL_CODEC_PARSERS_H265_FALSE}"; then - as_fn_error $? "conditional \"USE_LOCAL_CODEC_PARSERS_H265\" was never defined. +if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${USE_LOCAL_VIDEO_PARSERS_TRUE}" && test -z "${USE_LOCAL_VIDEO_PARSERS_FALSE}"; then - as_fn_error $? "conditional \"USE_LOCAL_VIDEO_PARSERS\" was never defined. +if test -z "${ENABLE_PLUGIN_DOCS_TRUE}" && test -z "${ENABLE_PLUGIN_DOCS_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_PLUGIN_DOCS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_GST_GL_HELPERS_TRUE}" && test -z "${USE_GST_GL_HELPERS_FALSE}"; then @@ -17304,7 +20499,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by gst_vaapi $as_me 0.7.0, which was +This file was extended by GStreamer VA-API Plug-ins $as_me 1.8.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -17364,13 +20559,13 @@ Configuration commands: $config_commands -Report bugs to ." +Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -gst_vaapi config.status 0.7.0 +GStreamer VA-API Plug-ins config.status 1.8.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -17501,10 +20696,14 @@ delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' -enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' @@ -17532,12 +20731,10 @@ lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' -DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' @@ -17554,10 +20751,13 @@ GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' @@ -17622,7 +20822,8 @@ finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' @@ -17643,7 +20844,10 @@ } # Quote evaled strings. -for var in SHELL \ +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ ECHO \ PATH_SEPARATOR \ SED \ @@ -17656,12 +20860,10 @@ lt_SP2NL \ lt_NL2SP \ reload_flag \ -OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ -DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ @@ -17673,9 +20875,12 @@ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_cv_nm_interface \ nm_file_list_spec \ +lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ @@ -17710,7 +20915,7 @@ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -17737,10 +20942,11 @@ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ -sys_lib_dlsearch_path_spec; do +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -17749,19 +20955,16 @@ done ac_aux_dir='$ac_aux_dir' -xsi_shell='$xsi_shell' -lt_shell_append='$lt_shell_append' -# See if we are running on zsh, and set the options which allow our +# See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then +if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' @@ -17780,40 +20983,19 @@ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "debian.upstream/Makefile") CONFIG_FILES="$CONFIG_FILES debian.upstream/Makefile" ;; - "debian.upstream/changelog") CONFIG_FILES="$CONFIG_FILES debian.upstream/changelog" ;; - "debian.upstream/control") CONFIG_FILES="$CONFIG_FILES debian.upstream/control" ;; - "debian.upstream/gstreamer$GST_API_VERSION-vaapi-doc.install") CONFIG_FILES="$CONFIG_FILES debian.upstream/gstreamer$GST_API_VERSION-vaapi-doc.install:debian.upstream/gstreamer-vaapi-doc.install.in" ;; - "debian.upstream/gstreamer$GST_API_VERSION-vaapi.install") CONFIG_FILES="$CONFIG_FILES debian.upstream/gstreamer$GST_API_VERSION-vaapi.install:debian.upstream/gstreamer-vaapi.install.in" ;; - "debian.upstream/libgstvaapi$GST_PKG_VERSION-dev.install") CONFIG_FILES="$CONFIG_FILES debian.upstream/libgstvaapi$GST_PKG_VERSION-dev.install:debian.upstream/libgstvaapi-dev.install.in" ;; - "debian.upstream/libgstvaapi$GST_VAAPI_MAJOR_VERSION.install") CONFIG_FILES="$CONFIG_FILES debian.upstream/libgstvaapi$GST_VAAPI_MAJOR_VERSION.install:debian.upstream/libgstvaapi.install.in" ;; - "debian.upstream/libgstvaapi-drm-$GST_VAAPI_MAJOR_VERSION.install") CONFIG_FILES="$CONFIG_FILES debian.upstream/libgstvaapi-drm-$GST_VAAPI_MAJOR_VERSION.install:debian.upstream/libgstvaapi-drm.install.in" ;; - "debian.upstream/libgstvaapi-glx-$GST_VAAPI_MAJOR_VERSION.install") CONFIG_FILES="$CONFIG_FILES debian.upstream/libgstvaapi-glx-$GST_VAAPI_MAJOR_VERSION.install:debian.upstream/libgstvaapi-glx.install.in" ;; - "debian.upstream/libgstvaapi-wayland-$GST_VAAPI_MAJOR_VERSION.install") CONFIG_FILES="$CONFIG_FILES debian.upstream/libgstvaapi-wayland-$GST_VAAPI_MAJOR_VERSION.install:debian.upstream/libgstvaapi-wayland.install.in" ;; - "debian.upstream/libgstvaapi-x11-$GST_VAAPI_MAJOR_VERSION.install") CONFIG_FILES="$CONFIG_FILES debian.upstream/libgstvaapi-x11-$GST_VAAPI_MAJOR_VERSION.install:debian.upstream/libgstvaapi-x11.install.in" ;; + "common/Makefile") CONFIG_FILES="$CONFIG_FILES common/Makefile" ;; + "common/m4/Makefile") CONFIG_FILES="$CONFIG_FILES common/m4/Makefile" ;; + "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; - "docs/reference/Makefile") CONFIG_FILES="$CONFIG_FILES docs/reference/Makefile" ;; - "docs/reference/libs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/reference/libs/Makefile" ;; - "docs/reference/libs/libs-docs.xml") CONFIG_FILES="$CONFIG_FILES docs/reference/libs/libs-docs.xml" ;; - "docs/reference/plugins/Makefile") CONFIG_FILES="$CONFIG_FILES docs/reference/plugins/Makefile" ;; - "docs/reference/plugins/plugins-docs.xml") CONFIG_FILES="$CONFIG_FILES docs/reference/plugins/plugins-docs.xml" ;; - "ext/Makefile") CONFIG_FILES="$CONFIG_FILES ext/Makefile" ;; - "ext/libvpx/Makefile") CONFIG_FILES="$CONFIG_FILES ext/libvpx/Makefile" ;; + "docs/version.entities") CONFIG_FILES="$CONFIG_FILES docs/version.entities" ;; + "docs/plugins/Makefile") CONFIG_FILES="$CONFIG_FILES docs/plugins/Makefile" ;; + "docs/plugins/gstreamer-vaapi-plugins-docs.xml") CONFIG_FILES="$CONFIG_FILES docs/plugins/gstreamer-vaapi-plugins-docs.xml" ;; "gst-libs/Makefile") CONFIG_FILES="$CONFIG_FILES gst-libs/Makefile" ;; "gst-libs/gst/Makefile") CONFIG_FILES="$CONFIG_FILES gst-libs/gst/Makefile" ;; "gst-libs/gst/base/Makefile") CONFIG_FILES="$CONFIG_FILES gst-libs/gst/base/Makefile" ;; - "gst-libs/gst/codecparsers/Makefile") CONFIG_FILES="$CONFIG_FILES gst-libs/gst/codecparsers/Makefile" ;; "gst-libs/gst/vaapi/Makefile") CONFIG_FILES="$CONFIG_FILES gst-libs/gst/vaapi/Makefile" ;; "gst/Makefile") CONFIG_FILES="$CONFIG_FILES gst/Makefile" ;; "gst/vaapi/Makefile") CONFIG_FILES="$CONFIG_FILES gst/vaapi/Makefile" ;; - "patches/Makefile") CONFIG_FILES="$CONFIG_FILES patches/Makefile" ;; - "patches/videoparsers/Makefile") CONFIG_FILES="$CONFIG_FILES patches/videoparsers/Makefile" ;; - "pkgconfig/Makefile") CONFIG_FILES="$CONFIG_FILES pkgconfig/Makefile" ;; - "pkgconfig/gstreamer-vaapi-$GST_PKG_VERSION.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/gstreamer-vaapi-$GST_PKG_VERSION.pc:pkgconfig/gstreamer-vaapi.pc.in" ;; - "pkgconfig/gstreamer-vaapi-drm-$GST_PKG_VERSION.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/gstreamer-vaapi-drm-$GST_PKG_VERSION.pc:pkgconfig/gstreamer-vaapi-drm.pc.in" ;; - "pkgconfig/gstreamer-vaapi-glx-$GST_PKG_VERSION.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/gstreamer-vaapi-glx-$GST_PKG_VERSION.pc:pkgconfig/gstreamer-vaapi-glx.pc.in" ;; - "pkgconfig/gstreamer-vaapi-wayland-$GST_PKG_VERSION.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/gstreamer-vaapi-wayland-$GST_PKG_VERSION.pc:pkgconfig/gstreamer-vaapi-wayland.pc.in" ;; - "pkgconfig/gstreamer-vaapi-x11-$GST_PKG_VERSION.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/gstreamer-vaapi-x11-$GST_PKG_VERSION.pc:pkgconfig/gstreamer-vaapi-x11.pc.in" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; @@ -18505,55 +21687,53 @@ ;; "libtool":C) - # See if we are running on zsh, and set the options which allow our + # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then + if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi - cfgfile="${ofile}T" + cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool 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 of the License, or +# (at your option) any later version. # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool 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. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. # -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of +# GNU Libtool is distributed in the hope that 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 GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . # The names of the tagged configurations supported by this script. -available_tags="" +available_tags='' + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG @@ -18561,18 +21741,30 @@ macro_version=$macro_version macro_revision=$macro_revision -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared +# Assembler program. +AS=$lt_AS + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Object dumper program. +OBJDUMP=$lt_OBJDUMP # Whether or not to build static libraries. build_old_libs=$enable_static +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install +# Shared archive member basename,for filename based shared library versioning on AIX. +shared_archive_member_spec=$shared_archive_member_spec + # Shell to use when invoking shell scripts. SHELL=$lt_SHELL @@ -18637,9 +21829,6 @@ # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd -# An object symbol dumper. -OBJDUMP=$lt_OBJDUMP - # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -18652,9 +21841,6 @@ # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob -# DLL creation program. -DLLTOOL=$lt_DLLTOOL - # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd @@ -18690,18 +21876,27 @@ # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl +# Transform the output of nm into a list of symbols to manually relocate. +global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import + # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix +# The name lister interface. +nm_interface=$lt_lt_cv_nm_interface + # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec -# The root where to search for dependent libraries,and in which our libraries should be installed. +# The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot +# Command to truncate a binary pipe. +lt_truncate_bin=$lt_lt_cv_truncate_bin + # The name of the directory that contains temporary libtool files. objdir=$objdir @@ -18792,8 +21987,11 @@ # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen @@ -18886,13 +22084,13 @@ # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute @@ -18944,13 +22142,72 @@ _LT_EOF + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then +if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -18959,7 +22216,7 @@ esac -ltmain="$ac_aux_dir/ltmain.sh" +ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if @@ -18969,165 +22226,6 @@ sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) - if test x"$xsi_shell" = xyes; then - sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ -func_dirname ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_basename ()$/,/^} # func_basename /c\ -func_basename ()\ -{\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ -func_dirname_and_basename ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ -func_stripname ()\ -{\ -\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ -\ # positional parameters, so assign one to ordinary parameter first.\ -\ func_stripname_result=${3}\ -\ func_stripname_result=${func_stripname_result#"${1}"}\ -\ func_stripname_result=${func_stripname_result%"${2}"}\ -} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ -func_split_long_opt ()\ -{\ -\ func_split_long_opt_name=${1%%=*}\ -\ func_split_long_opt_arg=${1#*=}\ -} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ -func_split_short_opt ()\ -{\ -\ func_split_short_opt_arg=${1#??}\ -\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ -} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ -func_lo2o ()\ -{\ -\ case ${1} in\ -\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ -\ *) func_lo2o_result=${1} ;;\ -\ esac\ -} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_xform ()$/,/^} # func_xform /c\ -func_xform ()\ -{\ - func_xform_result=${1%.*}.lo\ -} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_arith ()$/,/^} # func_arith /c\ -func_arith ()\ -{\ - func_arith_result=$(( $* ))\ -} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_len ()$/,/^} # func_len /c\ -func_len ()\ -{\ - func_len_result=${#1}\ -} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - -fi - -if test x"$lt_shell_append" = xyes; then - sed -e '/^func_append ()$/,/^} # func_append /c\ -func_append ()\ -{\ - eval "${1}+=\\${2}"\ -} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ -func_append_quoted ()\ -{\ -\ func_quote_for_eval "${2}"\ -\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ -} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 -$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} -fi - - mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" @@ -19173,7 +22271,7 @@ yesno() { - test $1 -eq 1 && echo yes || echo no + test $1 -eq 1 && echo yes || echo no } VIDEO_OUTPUTS="" @@ -19197,7 +22295,7 @@ echo $PACKAGE configuration summary: echo echo Installation Prefix .............. : ${prefix} -echo GStreamer API version ............ : $GST_API_VERSION +echo GStreamer API version ............ : $GST_VERSION echo VA-API version ................... : $VA_VERSION_STR echo Video encoding ................... : $(yesno $USE_ENCODERS) echo Video outputs .................... : $VIDEO_OUTPUTS diff -Nru gstreamer-vaapi-0.7.0/configure.ac gstreamer-vaapi-1.8.2/configure.ac --- gstreamer-vaapi-0.7.0/configure.ac 2015-12-07 10:52:01.000000000 +0000 +++ gstreamer-vaapi-1.8.2/configure.ac 2016-06-09 07:10:03.000000000 +0000 @@ -1,46 +1,32 @@ # gstreamer-vaapi package version number -m4_define([gst_vaapi_major_version], [0]) -m4_define([gst_vaapi_minor_version], [7]) -m4_define([gst_vaapi_micro_version], [0]) -m4_define([gst_vaapi_pre_version], [0]) +m4_define([gst_vaapi_major_version], [1]) +m4_define([gst_vaapi_minor_version], [8]) +m4_define([gst_vaapi_micro_version], [2]) +m4_define([gst_vaapi_nano_version], [0]) m4_define([gst_vaapi_version], [gst_vaapi_major_version.gst_vaapi_minor_version.gst_vaapi_micro_version]) -m4_if(gst_vaapi_pre_version, [0], [], [ -m4_append([gst_vaapi_version], gst_vaapi_pre_version, [.pre]) -]) +m4_if(gst_vaapi_nano_version, [0], [], + [m4_append([gst_vaapi_version], gst_vaapi_nano_version, [.])]) # Configure defaults m4_define([default_glapi], [any]) +dnl - library source changed -> increment REVISION +dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0 +dnl - interfaces added -> increment AGE +dnl - interfaces removed -> AGE = 0 # gstreamer-vaapi library (libtool) version number -m4_define([gst_vaapi_lt_current], [7]) -m4_define([gst2_vaapi_lt_current_bias], [4]) -m4_define([gst4_vaapi_lt_current_bias], [5]) -m4_define([gst6_vaapi_lt_current_bias], [6]) -m4_define([gst8_vaapi_lt_current_bias], [7]) +m4_define([gst_vaapi_lt_current], [802]) m4_define([gst_vaapi_lt_revision], [0]) -m4_define([gst_vaapi_lt_age], [0]) +m4_define([gst_vaapi_lt_age], [802]) # glib version number m4_define([glib_version], [2.32]) -# gmodule version number -m4_define([gmodule_version], [2.32]) - # gstreamer version number -m4_define([gst_api_version], [autodetect]) -m4_define([gst12_version], [1.1.90]) -m4_define([gst12_plugins_base_version], [1.1.0]) -m4_define([gst12_plugins_bad_version], [1.1.0]) -m4_define([gst14_version], [1.2.90]) -m4_define([gst14_plugins_base_version], [1.3.0]) -m4_define([gst14_plugins_bad_version], [1.3.0]) -m4_define([gst16_version], [1.5.0]) -m4_define([gst16_plugins_base_version], [1.5.0]) -m4_define([gst16_plugins_bad_version], [1.5.0]) -m4_define([gst18_version], [1.7.0]) -m4_define([gst18_plugins_base_version], [1.7.0]) -m4_define([gst18_plugins_bad_version], [1.7.0]) +m4_define([gst_version], [1.8.0]) +m4_define([gst_plugins_base_version], [1.8.0]) +m4_define([gst_plugins_bad_version], [1.8.0]) # Wayland minimum version number m4_define([wayland_api_version], [1.0.2]) @@ -52,491 +38,259 @@ m4_define([va_api_x11_version], [0.31.0]) m4_define([va_api_wld_version], [0.33.0]) -# libva package version number -m4_define([libva_enc_package_version], [1.2.0]) -m4_define([libva_drm_package_version], [1.1.0]) -m4_define([libva_x11_package_version], [1.0.3]) -m4_define([libva_wld_package_version], [1.1.0]) - # gtk-doc version number # XXX: introspection annotations require gtk-doc >= 1.12 -m4_define([gtkdoc_version], [1.9]) +m4_define([gtkdoc_version], [1.12]) -AC_PREREQ([2.66]) -AC_INIT([gst_vaapi], [gst_vaapi_version], - [gwenole.beauchesne@intel.com, sreerenj.balachandran@intel.com], - [gstreamer-vaapi]) +AC_PREREQ([2.69]) +AC_INIT([GStreamer VA-API Plug-ins], [gst_vaapi_version], + [http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer], + [gstreamer-vaapi]) +dnl define the output header for config AC_CONFIG_HEADERS([config.h]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([build-aux]) -AC_CANONICAL_TARGET +AG_GST_INIT -AM_INIT_AUTOMAKE([1.11 tar-ustar no-dist-gzip dist-bzip2]) +dnl initialize automake +AM_INIT_AUTOMAKE([-Wno-portability 1.14 no-dist-gzip dist-xz tar-ustar subdir-objects]) -TODAY="`LC_ALL=C date +'%a, %d %b %Y %X %z'`" -AC_SUBST(TODAY) +dnl define PACKAGE_VERSION_* variables +AS_VERSION -LIBVA_PACKAGE_VERSION=libva_x11_package_version -AC_SUBST(LIBVA_PACKAGE_VERSION) +dnl check if this is a release version +AS_NANO(GST_GIT="no", GST_GIT="yes") -WAYLAND_API_VERSION=wayland_api_version -AC_SUBST(WAYLAND_API_VERSION) +dnl AM_MAINTAINER_MODE only provides the option to configure to enable it +AM_MAINTAINER_MODE([enable]) -dnl Use pretty build output with automake >= 1.11 -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [ - AM_DEFAULT_VERBOSITY=1 - AC_SUBST(AM_DEFAULT_VERBOSITY) -]) +dnl use pretty build output by default +AM_SILENT_RULES([yes]) -dnl Check for tools -AC_PROG_CC -AM_PROG_CC_C_O +dnl our libraries and install dirs use GST_API_VERSION in the filename +dnl to allow side-by-side installation of different API versions +GST_API_VERSION=1.0 +AC_SUBST([GST_API_VERSION]) +AC_DEFINE_UNQUOTED([GST_API_VERSION], ["$GST_API_VERSION"], + [GStreamer API Version]) -AC_ARG_VAR([GIT], [Path to git program, if any]) -AC_PATH_PROG([GIT], [git]) -AM_CONDITIONAL([HAVE_GIT], [test -n "$GIT"]) +AG_GST_LIBTOOL_PREPARE + +dnl CURRENT, REVISION, AGE +dnl sets GST_LT_LDFLAGS +AS_LIBTOOL(GST, gst_vaapi_lt_current, gst_vaapi_lt_revision, gst_vaapi_lt_age) + +dnl *** required versions of GStreamer stuff *** +GLIB_REQ=glib_version +GST_REQ=gst_version +GST_PBREQ=gst_plugins_base_version +GST_PBADREQ=gst_plugins_bad_version +WAYLAND_REQ=wayland_api_version +GTKDOC_REQ=gtkdoc_version + +dnl *** required versions of VA-API stuff *** +VAAPI_REQ=va_api_version +VAAPI_ENC_REQ=va_api_enc_version +VAAPI_DRM_REQ=va_api_drm_version +VAAPI_X11_REQ=va_api_x11_version +VAAPI_WLD_REQ=va_api_wld_version + +dnl *** autotools stuff **** + +dnl allow for different autotools +AS_AUTOTOOLS_ALTERNATE -dnl Initialize libtool -LT_PREREQ([2.2]) -LT_INIT - -AC_ARG_ENABLE(builtin_videoparsers, - AS_HELP_STRING([--enable-builtin-videoparsers], - [enable built-in videoparsers @<:@default=yes@:>@]), - [], [enable_builtin_videoparsers="yes"]) - -AC_ARG_ENABLE(builtin_codecparsers, - AS_HELP_STRING([--enable-builtin-codecparsers], - [enable built-in codecparsers @<:@default=yes@:>@]), - [], [enable_builtin_codecparsers="yes"]) - -AC_ARG_ENABLE(builtin_libvpx, - AS_HELP_STRING([--enable-builtin-libvpx], - [enable built-in libvpx @<:@default=yes@:>@]), - [], [enable_builtin_libvpx="yes"]) +dnl Add parameters for aclocal +AC_SUBST([ACLOCAL_AMFLAGS], ["-I m4 -I common/m4"]) + +dnl *** check for arguments to configure *** + +AG_GST_ARG_DISABLE_FATAL_WARNINGS +AG_GST_ARG_ENABLE_EXTRA_CHECKS +AG_GST_ARG_DEBUG + +AG_GST_ARG_WITH_PKG_CONFIG_PATH + +AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO], + ["${srcdir}/gstreamer-vaapi.doap"], + [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO]) AC_ARG_ENABLE([encoders], - AS_HELP_STRING([--enable-encoders], - [enable video encoders @<:@default=yes@:>@]), - [], [enable_encoders="yes"]) - -AC_ARG_ENABLE(drm, - AS_HELP_STRING([--enable-drm], - [enable DRM backend @<:@default=yes@:>@]), - [], [enable_drm="yes"]) - -AC_ARG_ENABLE(x11, - AS_HELP_STRING([--enable-x11], - [enable X11 output @<:@default=yes@:>@]), - [], [enable_x11="yes"]) - -AC_ARG_ENABLE(glx, - AS_HELP_STRING([--enable-glx], - [enable OpenGL/X11 output @<:@default=yes@:>@]), - [], [enable_glx="yes"]) - -AC_ARG_ENABLE(wayland, - AC_HELP_STRING([--enable-wayland], - [enable Wayland output @<:@default=yes@:>@]), - [], [enable_wayland="yes"]) + AS_HELP_STRING([--enable-encoders], + [enable video encoders @<:@default=yes@:>@]), + [], [enable_encoders="yes"]) + +AC_ARG_ENABLE([drm], + AS_HELP_STRING([--enable-drm], + [enable DRM backend @<:@default=yes@:>@]), + [], [enable_drm="yes"]) + +AC_ARG_ENABLE([x11], + AS_HELP_STRING([--enable-x11], + [enable X11 output @<:@default=yes@:>@]), + [], [enable_x11="yes"]) + +AC_ARG_ENABLE([glx], + AS_HELP_STRING([--enable-glx], + [enable OpenGL/X11 output @<:@default=yes@:>@]), + [], [enable_glx="yes"]) + +AC_ARG_ENABLE([wayland], + AC_HELP_STRING([--enable-wayland], + [enable Wayland output @<:@default=yes@:>@]), + [], [enable_wayland="yes"]) AC_ARG_ENABLE([egl], - AS_HELP_STRING([--enable-egl], - [enable EGL output @<:@default=yes@:>@]), - [], [enable_egl="yes"]) + AS_HELP_STRING([--enable-egl], + [enable EGL output @<:@default=yes@:>@]), + [], [enable_egl="yes"]) AC_ARG_WITH([glapi], - AS_HELP_STRING([--with-glapi=APIs], - [build with the specified OpenGL APIs @<:@default=default_glapi@:>@]), - [GLAPI="$with_glapi"], [GLAPI=default_glapi]) + AS_HELP_STRING([--with-glapi=APIs], + [build with the specified OpenGL APIs @<:@default=default_glapi@:>@]), + [GLAPI="$with_glapi"], [GLAPI=default_glapi]) +dnl *** checks for platform *** -dnl Check fr YASM -AC_ARG_VAR([YASM], [Path to yasm program, if any]) -AC_PATH_PROG([YASM], [yasm]) -if test -z "$YASM" -a "$enable_builtin_libvpx" = "yes"; then - AC_MSG_ERROR([yasm is needed to build libvpx sources]) -fi +dnl * hardware/architecture * -dnl Check for PATCH -AC_ARG_VAR([PATCH], [Path to patch program, if any]) -AC_PATH_PROG([PATCH], [patch]) -if test -z "$PATCH" -a "$enable_builtin_videoparsers" = "yes"; then - AC_MSG_ERROR([patch is needed to apply patches for built videoparsers -sources]) -fi +dnl check CPU type +AG_GST_ARCH + +dnl *** checks for programs *** -dnl Check for basic libraries -AC_CHECK_LIB(m, tan) +dnl find a compiler +AC_PROG_CC +AC_PROG_CC_STDC + +dnl check if the compiler supports '-c' and '-o' options +AM_PROG_CC_C_O + +dnl check for git command for version generation in libgstvaapi +AC_PATH_PROG([GIT], [git]) +AM_CONDITIONAL([HAVE_GIT], [test -n "$GIT"]) -dnl Check for Gtk doc -GTKDOC_VERSION=gtkdoc_version -# gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line -m4_ifdef([GTK_DOC_CHECK], [ -GTK_DOC_CHECK([$GTKDOC_VERSION], [--flavour no-tmpl])], [ -AM_CONDITIONAL([ENABLE_GTK_DOC], [false])]) -AC_SUBST(GTKDOC_VERSION) - -dnl Check for GLib -GLIB_VERSION_REQUIRED=glib_version -PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $GLIB_VERSION_REQUIRED]) -AC_SUBST(GLIB_VERSION_REQUIRED) +dnl check for documentation tools +GTK_DOC_CHECK([$GTKDOC_REQ]) +AG_GST_PLUGIN_DOCS([$GTKDOC_REQ]) + +dnl *** checks for libraries *** +dnl check for libm, for sin() etc. +AC_CHECK_LIB([m], [tan]) dnl Check to see if dlopen is in default libraries (like Solaris, which dnl has it in libc), or if libdl is needed to get it. AC_CHECK_FUNC([dlopen], [], [ - AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])]) + AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])]) AC_SUBST([DLOPEN_LIBS]) -dnl --------------------------------------------------------------------------- -dnl -- GStreamer -- -dnl --------------------------------------------------------------------------- -AC_MSG_CHECKING([for GStreamer API version]) -if $PKG_CONFIG --exists "gstreamer-1.0"; then - gst_version=`$PKG_CONFIG --modversion "gstreamer-1.0"` - gst_major_version=`echo "$gst_version" | cut -d'.' -f1` - gst_minor_version=`echo "$gst_version" | cut -d'.' -f2` - GST_API_VERSION="${gst_major_version}.${gst_minor_version}" - GST_PKG_VERSION="1.0" -fi -if test -z "$GST_PKG_VERSION"; then - AC_MSG_ERROR([gstreamer-1.0 was not found]) -fi -AC_MSG_RESULT([$GST_API_VERSION]) - -AC_DEFINE_UNQUOTED([GST_API_VERSION_S], ["$GST_API_VERSION"], - [Defined to the string representation of GStreamer version]) - -dnl Versions for GStreamer and plugins-base -case $GST_API_VERSION in -1.2) - GST_VERSION_REQUIRED=gst12_version - GST_PLUGINS_BASE_VERSION_REQUIRED=gst12_plugins_base_version - GST_PLUGINS_BAD_VERSION_REQUIRED=gst12_plugins_bad_version - ;; -1.4) - GST_VERSION_REQUIRED=gst14_version - GST_PLUGINS_BASE_VERSION_REQUIRED=gst14_plugins_base_version - GST_PLUGINS_BAD_VERSION_REQUIRED=gst14_plugins_bad_version - ;; -1.[[5-6]]) - GST_VERSION_REQUIRED=gst16_version - GST_PLUGINS_BASE_VERSION_REQUIRED=gst16_plugins_base_version - GST_PLUGINS_BAD_VERSION_REQUIRED=gst16_plugins_bad_version - ;; -1.[[7-8]]) - GST_VERSION_REQUIRED=gst18_version - GST_PLUGINS_BASE_VERSION_REQUIRED=gst18_plugins_base_version - GST_PLUGINS_BAD_VERSION_REQUIRED=gst18_plugins_bad_version - ;; -*) - AC_MSG_ERROR([unsupported GStreamer API version $GST_API_VERSION]) - ;; -esac -AC_SUBST(GST_API_VERSION) -AC_SUBST(GST_VERSION_REQUIRED) -AC_SUBST(GST_PLUGINS_BASE_VERSION_REQUIRED) -AC_SUBST(GST_PLUGINS_BAD_VERSION_REQUIRED) - -USE_GST_API_1_2p="no" -USE_GST_API_1_4p="no" -AS_VERSION_COMPARE([$GST_API_VERSION], [1.2], - [], [USE_GST_API_1_2p="yes"], [USE_GST_API_1_2p="yes"]) -AS_VERSION_COMPARE([$GST_API_VERSION], [1.4], - [], [USE_GST_API_1_4p="yes"], [USE_GST_API_1_4p="yes"]) -AM_CONDITIONAL([USE_GST_API_1_2p], [test "$USE_GST_API_1_2p" = "yes"]) -AM_CONDITIONAL([USE_GST_API_1_4p], [test "$USE_GST_API_1_4p" = "yes"]) +dnl define LIBDIR so we can inform people where we live +AS_AC_EXPAND([LIBDIR], [$libdir]) +AC_DEFINE_UNQUOTED([LIBDIR], ["$LIBDIR"], [library dir]) -AC_SUBST([GST_PKG_VERSION]) +dnl set location of plugin directory +AG_GST_SET_PLUGINDIR -AC_DEFINE_UNQUOTED([GST_PKG_VERSION_S], ["$GST_PKG_VERSION"], - [Defined to the string representation of GStreamer API version]) +dnl *** checks for header files *** -if test "$GST_API_VERSION" = "1.2"; then - AC_MSG_WARN([support for GStreamer 1.2 is obsolete, and will be removed]) -fi +dnl *** checks for types/defines *** -dnl GStreamer Core -PKG_CHECK_MODULES([GST], - [gstreamer-$GST_PKG_VERSION >= $GST_VERSION_REQUIRED]) -PKG_CHECK_MODULES([GST_BASE], - [gstreamer-base-$GST_PKG_VERSION >= $GST_VERSION_REQUIRED]) - -dnl GStreamer -base plugins -PKG_CHECK_MODULES([GST_PLUGINS_BASE], - [gstreamer-plugins-base-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED]) -if test "$GST_API_VERSION" = "0.10"; then -PKG_CHECK_MODULES([GST_INTERFACES], - [gstreamer-interfaces-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED]) -fi +dnl *** checks for structures *** -dnl ... gst_dmabuf_memory_get_fd (gstreamer-allocators) -PKG_CHECK_MODULES([GST_ALLOCATORS], - [gstreamer-allocators-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED]) - -dnl ... GstVideoOverlayComposition (gstreamer-video) -PKG_CHECK_MODULES([GST_VIDEO], - [gstreamer-video-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED]) - -dnl GStreamer -bad plugins (deprecated in GStreamer v1.2) -if test "$USE_GST_API_1_2p" != "yes" && test "$USE_GST_API_1_4p" != "yes"; then -PKG_CHECK_MODULES([GST_BASEVIDEO], - [gstreamer-basevideo-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED]) -fi +dnl *** checks for compiler characteristics *** -dnl ... bitstream parsers -if test "$enable_builtin_codecparsers" = "yes"; then - ac_cv_have_gst_mpeg2_parser="no" - ac_cv_have_gst_h264_parser="no" - ac_cv_have_gst_jpeg_parser="no" - ac_cv_have_gst_vp8_parser="no" - ac_cv_have_gst_h265_parser="no" - ac_cv_have_gst_vp9_parser="no" -else -PKG_CHECK_MODULES([GST_CODEC_PARSERS], - [gstreamer-codecparsers-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED]) -fi +dnl *** checks for library functions *** -dnl ... MPEG-2 parser, with the required extensions -AC_CACHE_CHECK([for MPEG-2 parser], - ac_cv_have_gst_mpeg2_parser, [ - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS" - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[GstMpegVideoSequenceHdr seq_hdr; - GstMpegVideoSequenceExt seq_ext; - GstMpegVideoSequenceDisplayExt seq_dpy; - GstMpegVideoSliceHdr slice_hdr; - GstMpegVideoPacket packet; - gst_mpeg_video_packet_parse_slice_header(&packet, &slice_hdr, - &seq_hdr, NULL); - gst_mpeg_video_finalise_mpeg2_sequence_header(&seq_hdr, - &seq_ext, &seq_dpy);]])], - [ac_cv_have_gst_mpeg2_parser="yes"], - [ac_cv_have_gst_mpeg2_parser="no"] - ) - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" -]) -AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_MPEG2], - [test "$ac_cv_have_gst_mpeg2_parser" != "yes"]) +dnl *** checks for headers *** -dnl ... H.264 parser, with the required extensions -AC_CACHE_CHECK([for H.264 parser], - ac_cv_have_gst_h264_parser, [ - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS" - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[GstH264SliceHdr slice_hdr; - GstH264VUIParams vui_params; - GstH264Profile profile = GST_H264_PROFILE_HIGH; - slice_hdr.n_emulation_prevention_bytes = 0; - vui_params.par_n = 0; - vui_params.par_d = 0; - GstH264SPS sps; - sps.extension.mvc.num_views_minus1 = 1; - GstH264NalUnit nalu; - nalu.extension_type = GST_H264_NAL_EXTENSION_MVC;]])], - [ac_cv_have_gst_h264_parser="yes"], - [ac_cv_have_gst_h264_parser="no"] - ) - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" -]) -AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_H264], - [test "$ac_cv_have_gst_h264_parser" != "yes"]) +dnl *** checks for dependency libraries *** -dnl ... JPEG parser, not upstream yet -AC_CACHE_CHECK([for JPEG parser], - ac_cv_have_gst_jpeg_parser, [ - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS" - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[GstJpegImage jpeg_image;]])], - [ac_cv_have_gst_jpeg_parser="yes"], - [ac_cv_have_gst_jpeg_parser="no"] - ) - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" -]) -AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_JPEG], - [test "$ac_cv_have_gst_jpeg_parser" != "yes"]) +dnl --------------------------------------------------------------------------- +dnl -- GStreamer -- +dnl --------------------------------------------------------------------------- +dnl GLib is required +AG_GST_GLIB_CHECK([$GLIB_REQ]) -dnl ... VP8 parser, not upstream yet -if test "$enable_builtin_libvpx" = "yes"; then - ac_cv_have_gst_vp8_parser="no" -fi -AC_CACHE_CHECK([for VP8 parser], - ac_cv_have_gst_vp8_parser, [ - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS" - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[GstVp8FrameHdr frame_hdr;]])], - [ac_cv_have_gst_vp8_parser="yes"], - [ac_cv_have_gst_vp8_parser="no"] - ) - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" -]) -AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_VP8], - [test "$ac_cv_have_gst_vp8_parser" != "yes"]) -AM_CONDITIONAL([USE_BUILTIN_LIBVPX], [test "$enable_builtin_libvpx" = "yes"]) - -dnl ... VP9 parser, with required extensions -AC_CACHE_CHECK([for VP9 parser], - ac_cv_have_gst_vp9_parser, [ - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS" - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[GstVp9FrameHdr frame_hdr;]])], - [ac_cv_have_gst_vp9_parser="yes"], - [ac_cv_have_gst_vp9_parser="no"] - ) - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" -]) -AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_VP9], - [test "$ac_cv_have_gst_vp9_parser" != "yes"]) +dnl checks for gstreamer +dnl uninstalled is selected preferentially -- see pkg-config(1) +AG_GST_CHECK_GST([$GST_API_VERSION], [$GST_REQ], [yes]) -dnl ... H.265 parser, with the required extensions -AC_CACHE_CHECK([for H.265 parser], - ac_cv_have_gst_h265_parser, [ - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS" - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[GstH265SliceHdr slice_hdr; - GstH265VUIParams vui_params; - GstH265Profile profile = GST_H265_PROFILE_MAIN_STILL_PICTURE; - slice_hdr.n_emulation_prevention_bytes = 0; - vui_params.par_n = 0; - vui_params.par_d = 0; - GstH265SPS sps; - sps.crop_rect_x = 0; - sps.crop_rect_width = 0;]])], - [ac_cv_have_gst_h265_parser="yes"], - [ac_cv_have_gst_h265_parser="no"] - ) - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" -]) -AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_H265], - [test "$ac_cv_have_gst_h265_parser" != "yes"]) +dnl back compatibility +AC_MSG_CHECKING([for GStreamer API version]) +gst_api_version=`$PKG_CONFIG --modversion "gstreamer-$GST_API_VERSION"` +gst_major_version=`echo "$gst_api_version" | cut -d'.' -f1` +gst_minor_version=`echo "$gst_api_version" | cut -d'.' -f2` +GST_VERSION="${gst_major_version}.${gst_minor_version}" +AC_MSG_RESULT([$GST_VERSION]) +AC_DEFINE_UNQUOTED([GST_API_VERSION_S], ["$GST_VERSION"], + [Defined to the string representation of GStreamer version]) + +AG_GST_CHECK_GST_BASE([$GST_API_VERSION], [$GST_REQ], [yes]) +AG_GST_CHECK_GST_PLUGINS_BASE([$GST_API_VERSION], [$GST_PBREQ], [yes]) + +dnl gst_dmabuf_memory_get_fd (gstreamer-allocators) +AG_GST_CHECK_MODULES([GST_ALLOCATORS], + [gstreamer-allocators-$GST_API_VERSION], [$GST_PBREQ], [yes]) + +dnl GstVideoOverlayComposition (gstreamer-video) +AG_GST_CHECK_MODULES([GST_VIDEO], + [gstreamer-video-$GST_API_VERSION], [$GST_PBREQ], [yes]) + +dnl ... GStreamer base utils (gstreamer-pbutils) +AG_GST_CHECK_MODULES([GST_PBUTILS], + [gstreamer-pbutils-$GST_API_VERSION], [$GST_PBREQ], [yes]) + +dnl bitstream parsers (gstreamer-codecparsers) +AG_GST_PKG_CHECK_MODULES([GST_CODEC_PARSERS], + [gstreamer-codecparsers-$GST_API_VERSION >= 1.8.0 gstreamer-codecparsers-$GST_API_VERSION <= 1.8.99], [yes]) -dnl ... video parsers -AM_CONDITIONAL([USE_LOCAL_VIDEO_PARSERS], - [test "$enable_builtin_videoparsers" = "yes"]) +AS_IF([test "x$enable_glx" = "xyes" -o "x$enable_egl" = "xyes"], + [enable_opengl="yes"], [enable_opengl="no"]) dnl ... opengl helper libraries HAVE_GSTGL=0 -if test "$enable_glx" = "yes" -o "$enable_egl" = "yes"; then - PKG_CHECK_MODULES([GST_GL], - [gstreamer-gl-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED], - [HAVE_GSTGL=1], [HAVE_GSTGL=0]) -fi - -if test $HAVE_GSTGL -eq 1; then - AC_CACHE_CHECK([for GStreamer OpenGL helper libraries], - [ac_cv_have_gst_gl_helpers], [ - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GST_GL_CFLAGS $GST_VIDEO_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$saved_LIBS" - AC_CHECK_HEADERS([gst/gl/gl.h], [:], [HAVE_GSTGL=0]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[GstGLContext gl_context;]])], +if test "x$enable_opengl" = "xyes"; then + PKG_CHECK_MODULES([GST_GL], + [gstreamer-gl-$GST_API_VERSION >= $GST_PBADREQ], + [ + HAVE_GSTGL=1 + AC_CACHE_CHECK([for GStreamer OpenGL helper libraries], + [ac_cv_have_gst_gl_helpers], + [ + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $GST_GL_CFLAGS $GST_VIDEO_CFLAGS" + saved_LIBS="$LIBS" + LIBS="$saved_LIBS" + AC_CHECK_HEADERS([gst/gl/gl.h], [], [HAVE_GSTGL=0]) + AC_COMPILE_IFELSE( + [ + AC_LANG_PROGRAM( + [[ +#include + ]], + [[ +GstGLContext gl_context; + ]]) + ], [ac_cv_have_gst_gl_helpers="yes"], - [ac_cv_have_gst_gl_helpers="no" HAVE_GSTGL=0] - ) - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" - ]) + [ac_cv_have_gst_gl_helpers="no"]) + CPPFLAGS="$saved_CPPFLAGS" + LIBS="$saved_LIBS" + ]) + ], []) fi +AS_IF([test "x$ac_cv_have_gst_gl_helpers" = "xno"], [HAVE_GSTGL=0]) AM_CONDITIONAL([USE_GST_GL_HELPERS], [test $HAVE_GSTGL -eq 1]) - AC_DEFINE_UNQUOTED([USE_GST_GL_HELPERS], [$HAVE_GSTGL], - [Defined to 1 if GStreamer OpenGL helper libraries are available]) - -if test "$enable_egl" = "yes" -a $HAVE_GSTGL -ne 1; then - AC_MSG_WARN([GStreamer/GL helper libraries not found, disabling EGL support]) - enable_egl="no" -fi - -case $GST_API_VERSION in -1.2) lt_bias=gst2_vaapi_lt_current_bias;; -1.4) lt_bias=gst4_vaapi_lt_current_bias;; -1.[[5-6]]) lt_bias=gst6_vaapi_lt_current_bias;; -1.[[7-8]]) lt_bias=gst8_vaapi_lt_current_bias;; -esac -GST_VAAPI_MAJOR_VERSION=`expr gst_vaapi_lt_current - "$lt_bias"` -AC_SUBST(GST_VAAPI_MAJOR_VERSION) - -AC_DEFINE_UNQUOTED([GST_VAAPI_MAJOR_VERSION_S], ["$GST_VAAPI_MAJOR_VERSION"], - [Defined to the string representation of gstreamer-vaapi major version]) - -dnl GST_VAAPI_LT_LDFLAGS: -GST_VAAPI_LT_CURRENT="$GST_VAAPI_MAJOR_VERSION" -GST_VAAPI_LT_REV=gst_vaapi_lt_revision -GST_VAAPI_LT_AGE=gst_vaapi_lt_age -GST_VAAPI_LT_VERSION="$GST_VAAPI_LT_CURRENT:$GST_VAAPI_LT_REV:$GST_VAAPI_LT_AGE" -GST_VAAPI_LT_LDFLAGS="-version-info $GST_VAAPI_LT_VERSION" -AC_SUBST(GST_VAAPI_LT_VERSION) -AC_SUBST(GST_VAAPI_LT_LDFLAGS) - -dnl GST_ALL_LDFLAGS: -dnl LDFLAGS really should only contain flags, not libs - they get added before -dnl whatevertarget_LIBS and -L flags here affect the rest of the linking -GST_ALL_LDFLAGS="-no-undefined" -AC_SUBST(GST_ALL_LDFLAGS) - -dnl GST_PLUGIN_LDFLAGS: -dnl this really should only contain flags, not libs - they get added before -dnl whatevertarget_LIBS and -L flags here affect the rest of the linking -GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^([_]*gst_plugin_desc|gst_.*_get_type)\$\$' $GST_ALL_LDFLAGS" -AC_SUBST(GST_PLUGIN_LDFLAGS) + [Defined to 1 if GStreamer OpenGL helper libraries are available]) -dnl Check for the GStreamer plugins directory -AC_ARG_VAR([GST_PLUGIN_PATH_1_0], [installation path for gstreamer-vaapi plugin elements for GStreamer 1.0]) -AC_MSG_CHECKING([for GStreamer plugins directory]) -if test -d "$GST_PLUGIN_PATH_1_0"; then - GST_PLUGINS_DIR="$GST_PLUGIN_PATH_1_0" -else - GST_PLUGINS_DIR=`$PKG_CONFIG gstreamer-$GST_PKG_VERSION --variable pluginsdir` - if test -z "$GST_PLUGINS_DIR"; then - GST_PLUGINS_DIR="\$(libdir)/gstreamer-$GST_PKG_VERSION" - fi +if test "x$enable_egl" = "xyes" -a $HAVE_GSTGL -ne 1; then + AC_MSG_WARN([GStreamer/GL helper libraries not found, disabling EGL support]) + enable_egl="no" fi -AC_MSG_RESULT([$GST_PLUGINS_DIR]) -plugindir="$GST_PLUGINS_DIR" -AC_SUBST(plugindir) dnl --------------------------------------------------------------------------- dnl -- Renderers -- @@ -544,193 +298,185 @@ dnl Check for DRM/libudev USE_DRM=0 -if test "$enable_drm" = "yes"; then - PKG_CHECK_MODULES(DRM, [libdrm], [USE_DRM=1], [USE_DRM=0]) - PKG_CHECK_MODULES(UDEV, [libudev], [:], [USE_DRM=0]) - - if test $USE_DRM -eq 1; then - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $DRM_CFLAGS" - AC_CHECK_HEADERS([drm_fourcc.h], [:], [USE_DRM=0]) - CPPFLAGS="$saved_CPPFLAGS" - fi +if test "x$enable_drm" = "xyes"; then + PKG_CHECK_MODULES([DRM], [libdrm libudev], + [ + USE_DRM=1 + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $DRM_CFLAGS" + AC_CHECK_HEADERS([drm_fourcc.h], [], [USE_DRM=0]) + CPPFLAGS="$saved_CPPFLAGS" + ], []) fi dnl Check for X11 USE_X11=0 -if test "$enable_x11" = "yes"; then - PKG_CHECK_MODULES(X11, [x11], [USE_X11=1], [USE_X11=0]) - if test $USE_X11 -eq 1; then - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $X11_CFLAGS" - AC_CHECK_HEADERS([X11/Xlib.h X11/Xutil.h X11/Xatom.h], [:], [USE_X11=0]) - CPPFLAGS="$saved_CPPFLAGS" - fi +if test "x$enable_x11" = "xyes"; then + PKG_CHECK_MODULES([X11], [x11], + [ + USE_X11=1 + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $X11_CFLAGS" + AC_CHECK_HEADERS([X11/Xlib.h X11/Xutil.h X11/Xatom.h], [], [USE_X11=0]) + CPPFLAGS="$saved_CPPFLAGS" + ], []) fi -dnl Check for XKB library HAVE_XKBLIB=0 -if test $USE_X11 -eq 1; then - AC_CHECK_HEADERS([X11/XKBlib.h], [HAVE_XKBLIB=1], [:]) -fi -if test $HAVE_XKBLIB -eq 1; then - AC_DEFINE_UNQUOTED([HAVE_XKBLIB], 1, - [Defined to 1 if the XKB extension exists.]) -fi - -dnl Check for XRandR HAVE_XRANDR=0 -if test $USE_X11 -eq 1; then - HAVE_XRANDR=1 - PKG_CHECK_MODULES([XRANDR], [xrandr], [:], [HAVE_XRANDR=0]) - if test $HAVE_XRANDR -eq 1; then - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $XRANDR_CFLAGS" - AC_CHECK_HEADERS([X11/extensions/Xrandr.h], [:], [HAVE_XRANDR=0]) - CPPFLAGS="$saved_CPPFLAGS" - fi -fi -if test $HAVE_XRANDR -eq 1; then - AC_DEFINE_UNQUOTED(HAVE_XRANDR, 1, - [Defined to 1 if the XRandR extension exists.]) -fi - -dnl Check for XRender HAVE_XRENDER=0 if test $USE_X11 -eq 1; then - HAVE_XRENDER=1 - PKG_CHECK_MODULES([XRENDER], [xrender], [:], [HAVE_XRENDER=0]) - if test $HAVE_XRENDER -eq 1; then - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $XRENDER_CFLAGS" - AC_CHECK_HEADERS([X11/extensions/Xrender.h], [:], [HAVE_XRENDER=0]) - CPPFLAGS="$saved_CPPFLAGS" - fi -fi -if test $HAVE_XRENDER -eq 1; then - AC_DEFINE_UNQUOTED([HAVE_XRENDER], [1], - [Defined to 1 if the XRender extension exists.]) -fi + dnl Check for XKB library + HAVE_XKBLIB=1 + AC_CHECK_HEADERS([X11/XKBlib.h], [], [HAVE_XKBLIB=0]) + + dnl Check for XRandR + PKG_CHECK_MODULES([XRANDR], [xrandr], + [ + HAVE_XRANDR=1 + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $XRANDR_CFLAGS" + AC_CHECK_HEADERS([X11/extensions/Xrandr.h], [], [HAVE_XRANDR=0]) + CPPFLAGS="$saved_CPPFLAGS" + ], []) + + dnl Check for XRender + PKG_CHECK_MODULES([XRENDER], [xrender], + [ + HAVE_XRENDER=1 + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $XRENDER_CFLAGS" + AC_CHECK_HEADERS([X11/extensions/Xrender.h], [], [HAVE_XRENDER=0]) + CPPFLAGS="$saved_CPPFLAGS" + ], []) +fi + +AC_DEFINE_UNQUOTED([HAVE_XKBLIB], [$HAVE_XKBLIB], + [Defined to 1 if the XKB extension exists.]) +AC_DEFINE_UNQUOTED([HAVE_XRANDR], [$HAVE_XRANDR], + [Defined to 1 if the XRandR extension exists.]) +AC_DEFINE_UNQUOTED([HAVE_XRENDER], [$HAVE_XRENDER], + [Defined to 1 if the XRender extension exists.]) dnl OpenGL -enable_opengl="no" -if test "$enable_glx" = "yes"; then - enable_opengl="yes" -fi -if test "$enable_egl" = "yes"; then - enable_opengl="yes" -fi GLES_VERSION_MASK=0 HAVE_GL=0 -if test "$enable_opengl" = "yes"; then -case ",$GLAPI," in -(*,any,*|*,gl,*) - HAVE_GL=1 - PKG_CHECK_MODULES([GL], [gl], [:], [HAVE_GL=0]) - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GL_CFLAGS" - AC_CHECK_HEADERS([GL/gl.h GL/glext.h], [:], [HAVE_GL=0], [ +HAVE_GLESv2=0 +HAVE_GLESv3=0 +if test "x$enable_opengl" = "xyes"; then + dnl OpenGL + case ",$GLAPI," in + (*,any,*|*,gl,*) + HAVE_GL=1 + PKG_CHECK_MODULES([GL], [gl], + [ + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $GL_CFLAGS" + AC_CHECK_HEADERS([GL/gl.h GL/glext.h], [], [HAVE_GL=0], + [ #ifdef HAVE_GL_GL_H # include #endif - ]) - CPPFLAGS="$saved_CPPFLAGS" + ]) + CPPFLAGS="$saved_CPPFLAGS" + ], [HAVE_GL=0]) + GLES_VERSION_MASK=`expr $GLES_VERSION_MASK "+" $HAVE_GL "*" 1` ;; -esac -fi -GLES_VERSION_MASK=`expr $GLES_VERSION_MASK "+" $HAVE_GL "*" 1` + esac -dnl OpenGL|ESv2 -HAVE_GLESv2=0 -if test "$enable_opengl" = "yes"; then -case ",$GLAPI," in -(*,any,*|*,gles2,*) - HAVE_GLESv2=1 - PKG_CHECK_MODULES([GLES2], [glesv2], [:], [HAVE_GLESv2=0]) - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GLES2_CFLAGS" - AC_CHECK_HEADERS([GLES2/gl2.h GLES2/gl2ext.h], [:], - [HAVE_GLESv2=0], [ + dnl OpenGL|ESv2 + case ",$GLAPI," in + (*,any,*|*,gles2,*) + HAVE_GLESv2=1 + PKG_CHECK_MODULES([GLES2], [glesv2], + [ + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $GLES2_CFLAGS" + AC_CHECK_HEADERS([GLES2/gl2.h GLES2/gl2ext.h], [], [HAVE_GLESv2=0], + [ #ifdef HAVE_GLES2_GL2_H # include #endif - ]) - CPPFLAGS="$saved_CPPFLAGS" + ]) + CPPFLAGS="$saved_CPPFLAGS" + ], [HAVE_GLESv2=0]) + GLES_VERSION_MASK=`expr $GLES_VERSION_MASK "+" $HAVE_GLESv2 "*" 4` ;; -esac -fi -GLES_VERSION_MASK=`expr $GLES_VERSION_MASK "+" $HAVE_GLESv2 "*" 4` + esac -dnl OpenGL|ESv3 -HAVE_GLESv3=0 -if test "$enable_opengl" = "yes"; then -case ",$GLAPI," in -(*,any,*|*,gles3,*) - HAVE_GLESv3=1 - PKG_CHECK_MODULES([GLES3], [glesv2], [:], [HAVE_GLESv3=0]) - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GLES3_CFLAGS" - AC_CHECK_HEADERS([GLES3/gl3.h GLES3/gl3ext.h GLES2/gl2ext.h], [:], - [HAVE_GLESv3=0], [ + dnl OpenGL|ESv3 + case ",$GLAPI," in + (*,any,*|*,gles3,*) + HAVE_GLESv3=1 + PKG_CHECK_MODULES([GLES3], [glesv2], + [ + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $GLES3_CFLAGS" + AC_CHECK_HEADERS([GLES3/gl3.h GLES3/gl3ext.h GLES2/gl2ext.h], [], + [HAVE_GLESv3=0], + [ #ifdef HAVE_GLES3_GL3_H # include #endif - ]) - CPPFLAGS="$saved_CPPFLAGS" + ]) + CPPFLAGS="$saved_CPPFLAGS" + ], [HAVE_GLESv3=0]) + GLES_VERSION_MASK=`expr $GLES_VERSION_MASK "+" $HAVE_GLESv3 "*" 8` ;; -esac + esac fi -GLES_VERSION_MASK=`expr $GLES_VERSION_MASK "+" $HAVE_GLESv3 "*" 8` dnl ... GLX USE_GLX=0 -if test "$enable_glx" = "yes" -a $HAVE_GL -eq 1 -a $USE_X11 -eq 1; then - USE_GLX=1 - saved_CPPFLAGS="$CPPFLAGS" - saved_LIBS="$LIBS" - CPPFLAGS="$CPPFLAGS $GL_CFLAGS" - LIBS="$LIBS $GL_LIBS" - AC_CHECK_HEADERS([GL/glx.h], [:], [USE_GLX=0], [ +if test "x$enable_glx" = "xyes" -a $HAVE_GL -eq 1 -a $USE_X11 -eq 1; then + USE_GLX=1 + + saved_CPPFLAGS="$CPPFLAGS" + saved_LIBS="$LIBS" + CPPFLAGS="$CPPFLAGS $GL_CFLAGS" + LIBS="$LIBS $GL_LIBS" + AC_CHECK_HEADERS([GL/glx.h], [], [USE_GLX=0], + [ #ifdef HAVE_GL_GL_H # include #endif ]) - AC_CHECK_LIB([GL], [glXCreateContext], [:], [USE_GLX=0]) - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" + AC_CHECK_LIB([GL], [glXCreateContext], [], [USE_GLX=0]) + CPPFLAGS="$saved_CPPFLAGS" + LIBS="$saved_LIBS" fi dnl ... EGL USE_EGL=0 -if test "$enable_egl" = "yes" -a $GLES_VERSION_MASK -ne 0; then - USE_EGL=1 - PKG_CHECK_MODULES([EGL], [egl], [:], [USE_EGL=0]) - saved_CPPFLAGS="$CPPFLAGS" - saved_LIBS="$LIBS" - AC_CHECK_HEADERS([EGL/egl.h], [:], [USE_EGL=0]) - AC_CHECK_LIB([EGL], [eglGetDisplay], [:], [USE_EGL=0]) - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" - - dnl Check for GMODULE - GMODULE_VERSION_REQUIRED=gmodule_version - PKG_CHECK_MODULES([GMODULE], [gmodule-2.0 >= $GMODULE_VERSION_REQUIRED]) - AC_SUBST(GMODULE_VERSION_REQUIRED) +if test "x$enable_egl" = "xyes" -a $GLES_VERSION_MASK -ne 0; then + PKG_CHECK_MODULES([EGL], [egl], + [ + USE_EGL=1 + + saved_CPPFLAGS="$CPPFLAGS" + saved_LIBS="$LIBS" + AC_CHECK_HEADERS([EGL/egl.h], [], [USE_EGL=0]) + AC_CHECK_LIB([EGL], [eglGetDisplay], [], [USE_EGL=0]) + CPPFLAGS="$saved_CPPFLAGS" + LIBS="$saved_LIBS" + + dnl Check for GMODULE + PKG_CHECK_MODULES([GMODULE], [gmodule-2.0 >= $GLIB_REQ]) + ], []) fi dnl Check for Wayland USE_WAYLAND=0 -if test "$enable_wayland" = "yes"; then - PKG_CHECK_MODULES(WAYLAND, [wayland-client >= wayland_api_version], - [USE_WAYLAND=1], [USE_WAYLAND=0]) - - if test $USE_WAYLAND -eq 1; then - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $WAYLAND_CFLAGS" - AC_CHECK_HEADERS([wayland-client.h], [:], [USE_WAYLAND=0]) - CPPFLAGS="$saved_CPPFLAGS" - fi +if test "x$enable_wayland" = "xyes"; then + PKG_CHECK_MODULES([WAYLAND], [wayland-client >= $WAYLAND_REQ], + [ + USE_WAYLAND=1 + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $WAYLAND_CFLAGS" + AC_CHECK_HEADERS([wayland-client.h], [], [USE_WAYLAND=0]) + CPPFLAGS="$saved_CPPFLAGS" + ], []) fi dnl --------------------------------------------------------------------------- @@ -738,438 +484,517 @@ dnl --------------------------------------------------------------------------- dnl Core API -LIBVA_PKGNAME="libva" -PKG_CHECK_MODULES(LIBVA, [$LIBVA_PKGNAME >= va_api_version]) -AC_SUBST(LIBVA_PKGNAME) - -VA_VERSION=`$PKG_CONFIG --modversion libva` -VA_MAJOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f1` -VA_MINOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f2` -VA_MICRO_VERSION=`echo "$VA_VERSION" | cut -d'.' -f3` -VA_VERSION_STR="$VA_VERSION" +PKG_CHECK_MODULES([LIBVA], [libva >= $VAAPI_REQ]) +VA_VERSION_STR=`$PKG_CONFIG --modversion libva` dnl VA/DRM API -HAVE_VA_DRM=0 if test $USE_DRM -eq 1; then - PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm >= va_api_drm_version], - [HAVE_VA_DRM=1], [USE_DRM=0]) - - if test $HAVE_VA_DRM -eq 1; then - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$LIBVA_DRM_CFLAGS" - AC_CHECK_HEADERS([va/va_drm.h], [:], [HAVE_VA_DRM=0 USE_DRM=0]) - CPPFLAGS="$saved_CPPFLAGS" - fi + PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm >= $VAAPI_DRM_REQ], + [ + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$LIBVA_DRM_CFLAGS" + AC_CHECK_HEADERS([va/va_drm.h], [], [USE_DRM=0]) + CPPFLAGS="$saved_CPPFLAGS" + ], [USE_DRM=0]) fi dnl VA/X11 API -HAVE_VA_X11=0 -LIBVA_X11_PKGNAME="libva-x11" if test $USE_X11 -eq 1; then - PKG_CHECK_MODULES(LIBVA_X11, [$LIBVA_X11_PKGNAME >= va_api_x11_version], - [HAVE_VA_X11=1], [USE_X11=0]) + PKG_CHECK_MODULES(LIBVA_X11, [libva-x11 >= $VAAPI_X11_REQ], + [], [USE_X11=0]) fi -AC_SUBST(LIBVA_X11_PKGNAME) dnl Check for va_dec_jpeg.h header saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" -AC_CHECK_HEADERS([va/va_dec_jpeg.h], [], [], [#include ]) +AC_CHECK_HEADERS([va/va_dec_jpeg.h], [], [], + [ +#include + ]) CPPFLAGS="$saved_CPPFLAGS" dnl Check for JPEG decoding API (0.32.1+) USE_JPEG_DECODER=0 AC_CACHE_CHECK([for JPEG decoding API], - ac_cv_have_jpeg_decoding_api, [ + [ac_cv_have_jpeg_decoding_api], + [ saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" saved_LIBS="$LIBS" LIBS="$LIBS $LIBVA_LIBS" AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include - #ifdef HAVE_VA_VA_DEC_JPEG_H - #include - #endif - ]], - [[VAPictureParameterBufferJPEGBaseline pic_param; - VASliceParameterBufferJPEGBaseline slice_param; - VAHuffmanTableBufferJPEGBaseline huffman_table; - VAIQMatrixBufferJPEGBaseline iq_matrix;]])], - [ac_cv_have_jpeg_decoding_api="yes" USE_JPEG_DECODER=1], - [ac_cv_have_jpeg_decoding_api="no"] - ) + [ + AC_LANG_PROGRAM( + [[ +#include +#ifdef HAVE_VA_VA_DEC_JPEG_H +# include +#endif + ]], + [[ +VAPictureParameterBufferJPEGBaseline pic_param; +VASliceParameterBufferJPEGBaseline slice_param; +VAHuffmanTableBufferJPEGBaseline huffman_table; +VAIQMatrixBufferJPEGBaseline iq_matrix; + ]]) + ], + [ac_cv_have_jpeg_decoding_api="yes"], + [ac_cv_have_jpeg_decoding_api="no"]) CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" -]) + ]) +AS_IF([test "x$ac_cv_have_jpeg_decoding_api" = "xyes"], [USE_JPEG_DECODER=1]) dnl Check for va_dec_vp8.h header saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" -AC_CHECK_HEADERS([va/va_dec_vp8.h], [], [], [#include ]) +AC_CHECK_HEADERS([va/va_dec_vp8.h], [], [], + [ +#include + ]) CPPFLAGS="$saved_CPPFLAGS" dnl Check for VP8 decoding API (0.34+) USE_VP8_DECODER=0 AC_CACHE_CHECK([for VP8 decoding API], - ac_cv_have_vp8_decoding_api, [ + [ac_cv_have_vp8_decoding_api], + [ saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" saved_LIBS="$LIBS" LIBS="$LIBS $LIBVA_LIBS" AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include - #ifdef HAVE_VA_VA_DEC_VP8_H - #include - #endif - ]], - [[VAPictureParameterBufferVP8 pic_param; - VASliceParameterBufferVP8 slice_param; - VAProbabilityDataBufferVP8 prob_data; - VAIQMatrixBufferVP8 iq_matrix; - slice_param.slice_data_offset = 0; - slice_param.slice_data_flag = 0;]])], - [ac_cv_have_vp8_decoding_api="yes" USE_VP8_DECODER=1], - [ac_cv_have_vp8_decoding_api="no"] - ) + [ + AC_LANG_PROGRAM( + [[ +#include +#ifdef HAVE_VA_VA_DEC_VP8_H +# include +#endif + ]], + [[ +VAPictureParameterBufferVP8 pic_param; +VASliceParameterBufferVP8 slice_param; +VAProbabilityDataBufferVP8 prob_data; +VAIQMatrixBufferVP8 iq_matrix; +slice_param.slice_data_offset = 0; +slice_param.slice_data_flag = 0; + ]]) + ], + [ac_cv_have_vp8_decoding_api="yes"], + [ac_cv_have_vp8_decoding_api="no"]) CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" -]) + ]) +AS_IF([test "x$ac_cv_have_vp8_decoding_api" = "xyes"], [USE_VP8_DECODER=1]) dnl Check for va_dec_vp9.h header saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" -AC_CHECK_HEADERS([va/va_dec_vp9.h], [], [], [#include ]) +AC_CHECK_HEADERS([va/va_dec_vp9.h], [], [], + [ +#include + ]) CPPFLAGS="$saved_CPPFLAGS" dnl Check for VP9 decoding API (0.37+) USE_VP9_DECODER=0 AC_CACHE_CHECK([for VP9 decoding API], - ac_cv_have_vp9_decoding_api, [ + [ac_cv_have_vp9_decoding_api], + [ saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" saved_LIBS="$LIBS" LIBS="$LIBS $LIBVA_LIBS" AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include - #ifdef HAVE_VA_VA_DEC_VP9_H - #include - #endif - ]], - [[VADecPictureParameterBufferVP9 pic_param; - VASliceParameterBufferVP9 slice_param; - VASegmentParameterVP9 seg_param; - slice_param.slice_data_offset = 0; - slice_param.slice_data_flag = 0;]])], - [ac_cv_have_vp9_decoding_api="yes" USE_VP9_DECODER=1], - [ac_cv_have_vp9_decoding_api="no"] - ) + [ + AC_LANG_PROGRAM( + [[ +#include +#ifdef HAVE_VA_VA_DEC_VP9_H +# include +#endif + ]], + [[ +VADecPictureParameterBufferVP9 pic_param; +VASliceParameterBufferVP9 slice_param; +VASegmentParameterVP9 seg_param; +slice_param.slice_data_offset = 0; +slice_param.slice_data_flag = 0; + ]]) + ], + [ac_cv_have_vp9_decoding_api="yes"], + [ac_cv_have_vp9_decoding_api="no"]) CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" -]) + ]) +AS_IF([test "x$ac_cv_have_vp9_decoding_api" = "xyes"], [USE_VP9_DECODER=1]) dnl Check for va_dec_hevc.h header saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" -AC_CHECK_HEADERS([va/va_dec_hevc.h], [], [], [#include ]) +AC_CHECK_HEADERS([va/va_dec_hevc.h], [], [], + [ +#include + ]) CPPFLAGS="$saved_CPPFLAGS" dnl Check for HEVC decoding API (0.38+) USE_HEVC_DECODER=0 AC_CACHE_CHECK([for HEVC decoding API], - ac_cv_have_hevc_decoding_api, [ + [ac_cv_have_hevc_decoding_api], + [ saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" saved_LIBS="$LIBS" LIBS="$LIBS $LIBVA_LIBS" AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include - #ifdef HAVE_VA_VA_DEC_HEVC_H - #include - #endif - ]], - [[VAPictureParameterBufferHEVC pic_param; - VASliceParameterBufferHEVC slice_param; - VAIQMatrixBufferHEVC iq_matrix; - slice_param.slice_data_offset = 0; - slice_param.slice_data_flag = 0;]])], - [ac_cv_have_hevc_decoding_api="yes" USE_HEVC_DECODER=1], - [ac_cv_have_hevc_decoding_api="no"] - ) + [ + AC_LANG_PROGRAM( + [[ +#include +#ifdef HAVE_VA_VA_DEC_HEVC_H +# include +#endif + ]], + [[ +VAPictureParameterBufferHEVC pic_param; +VASliceParameterBufferHEVC slice_param; +VAIQMatrixBufferHEVC iq_matrix; +slice_param.slice_data_offset = 0; +slice_param.slice_data_flag = 0; + ]]) + ], + [ac_cv_have_hevc_decoding_api="yes"], + [ac_cv_have_hevc_decoding_api="no"]) CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" -]) + ]) +AS_IF([test "x$ac_cv_have_hevc_decoding_api" = "xyes"], [USE_HEVC_DECODER=1]) dnl Check for vpp (video post-processing) support USE_VA_VPP=0 AC_CACHE_CHECK([for video post-postprocessing API], - ac_cv_have_va_vpp_api, [ + [ac_cv_have_va_vpp_api], + [ saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" saved_LIBS="$LIBS" LIBS="$LIBS $LIBVA_LIBS" AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include - #include ]], - [[VADisplay va_dpy; - VAContextID vpp_ctx; - VAProcFilterType filters[VAProcFilterCount]; - unsigned int num_filters = VAProcFilterCount; - vaQueryVideoProcFilters(va_dpy, vpp_ctx, filters, &num_filters); - ]])], - [ac_cv_have_va_vpp_api="yes" USE_VA_VPP=1], - [ac_cv_have_va_vpp_api="no"] - ) + [ + AC_LANG_PROGRAM( + [[ +#include +#include + ]], + [[ +VADisplay va_dpy; +VAContextID vpp_ctx; +VAProcFilterType filters[VAProcFilterCount]; +unsigned int num_filters = VAProcFilterCount; +vaQueryVideoProcFilters(va_dpy, vpp_ctx, filters, &num_filters); + ]]) + ], + [ac_cv_have_va_vpp_api="yes"], + [ac_cv_have_va_vpp_api="no"]) CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" -]) + ]) +AS_IF([test "x$ac_cv_have_va_vpp_api" = "xyes"], [USE_VA_VPP=1]) dnl Check for encoding support USE_ENCODERS=0 +if test "x$enable_encoders" = "xyes"; then + PKG_CHECK_MODULES([LIBVA], [libva >= $VAAPI_ENC_REQ], + [ + USE_ENCODERS=1 + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$LIBVA_CFLAGS" + AC_CHECK_HEADERS([va/va_enc_mpeg2.h va/va_enc_h264.h], [], + [USE_ENCODERS=0], + [ +#include + ]) + CPPFLAGS="$saved_CPPFLAGS" + ], []) +fi + USE_JPEG_ENCODER=0 USE_VP8_ENCODER=0 USE_H265_ENCODER=0 -if test "$enable_encoders" = "yes"; then - PKG_CHECK_MODULES([LIBVA], [libva >= va_api_enc_version], - [HAVE_VA_ENC=1], [HAVE_VA_ENC=0]) - - if test $HAVE_VA_ENC -eq 1; then - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$LIBVA_CFLAGS" - AC_CHECK_HEADERS([va/va_enc_mpeg2.h va/va_enc_h264.h], - [USE_ENCODERS=1], [HAVE_VA_ENC=0 USE_ENCODERS=0], - [#include - ]) - - dnl Check for JPEG Encoding API (0.37.0+) - AC_CHECK_HEADERS([va/va_enc_jpeg.h], - [USE_JPEG_ENCODER=1], [], - [#include - ]) - AC_CACHE_CHECK([for JPEG encoding API], - ac_cv_have_jpeg_encoding_api, [ - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$LIBS $LIBVA_LIBS" - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include - #ifdef HAVE_VA_VA_ENC_JPEG_H - #include - #endif - ]], - [[VAEncPictureParameterBufferJPEG pic_param; - VAEncSliceParameterBufferJPEG slice_param; - VAQMatrixBufferJPEG q_matrix;]])], - [ac_cv_have_jpeg_encoding_api="yes" USE_JPEG_ENCODER=1], - [ac_cv_have_jpeg_encoding_api="no"] - ) - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" - ]) +if test $USE_ENCODERS -eq 1; then + dnl Check for JPEG Encoding API (0.37.0+) + AC_CHECK_HEADERS([va/va_enc_jpeg.h], [], [], + [ +#include + ]) + AC_CACHE_CHECK([for JPEG encoding API], + [ac_cv_have_jpeg_encoding_api], + [ + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" + saved_LIBS="$LIBS" + LIBS="$LIBS $LIBVA_LIBS" + AC_COMPILE_IFELSE( + [ + AC_LANG_PROGRAM( + [[ +#include +#ifdef HAVE_VA_VA_ENC_JPEG_H +# include +#endif + ]], + [[ +VAEncPictureParameterBufferJPEG pic_param; +VAEncSliceParameterBufferJPEG slice_param; +VAQMatrixBufferJPEG q_matrix; + ]]) + ], + [ac_cv_have_jpeg_encoding_api="yes"], + [ac_cv_have_jpeg_encoding_api="no"]) + CPPFLAGS="$saved_CPPFLAGS" + LIBS="$saved_LIBS" + ]) + AS_IF([test "x$ac_cv_have_jpeg_encoding_api" = "xyes"], [USE_JPEG_ENCODER=1]) - dnl Check for VP8 Encoding API - AC_CHECK_HEADERS([va/va_enc_vp8.h], - [USE_VP8_ENCODER=1], [], - [#include - ]) - AC_CACHE_CHECK([for VP8 encoding API], - ac_cv_have_vp8_encoding_api, [ - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$LIBS $LIBVA_LIBS" - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include - #ifdef HAVE_VA_VA_ENC_VP8_H - #include - #endif - ]], - [[VAEncSequenceParameterBufferVP8 seq_param; - VAEncPictureParameterBufferVP8 pic_param; - VAQMatrixBufferVP8 q_matrix;]])], - [ac_cv_have_vp8_encoding_api="yes" USE_VP8_ENCODER=1], - [ac_cv_have_vp8_encoding_api="no" USE_VP8_ENCODER=0] - ) - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" - ]) - CPPFLAGS="$saved_CPPFLAGS" + dnl Check for VP8 Encoding API + AC_CHECK_HEADERS([va/va_enc_vp8.h], [], [], + [ +#include + ]) + AC_CACHE_CHECK([for VP8 encoding API], + [ac_cv_have_vp8_encoding_api], + [ + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" + saved_LIBS="$LIBS" + LIBS="$LIBS $LIBVA_LIBS" + AC_COMPILE_IFELSE( + [ + AC_LANG_PROGRAM( + [[ +#include +#ifdef HAVE_VA_VA_ENC_VP8_H +# include +#endif + ]], + [[ +VAEncSequenceParameterBufferVP8 seq_param; +VAEncPictureParameterBufferVP8 pic_param; +VAQMatrixBufferVP8 q_matrix; + ]]) + ], + [ac_cv_have_vp8_encoding_api="yes"], + [ac_cv_have_vp8_encoding_api="no"]) + CPPFLAGS="$saved_CPPFLAGS" + LIBS="$saved_LIBS" + ]) + AS_IF([test "x$ac_cv_have_vp8_encoding_api" = "xyes"], [USE_VP8_ENCODER=1]) - dnl Check for H265/HEVC Encoding API - AC_CHECK_HEADERS([va/va_enc_hevc.h], - [USE_H265_ENCODER=1], [], - [#include - ]) - AC_CACHE_CHECK([for HEVC encoding API], - ac_cv_have_hevc_encoding_api, [ - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" - saved_LIBS="$LIBS" - LIBS="$LIBS $LIBVA_LIBS" - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include - #ifdef HAVE_VA_VA_ENC_HEVC_H - #include - #endif - ]], - [[VAEncSequenceParameterBufferHEVC seq_param; - VAEncPictureParameterBufferHEVC pic_param; - VAEncSliceParameterBufferHEVC; - VAQMatrixBufferHEVC q_matrix;]])], - [ac_cv_have_hevc_encoding_api="yes" USE_H265_ENCODER=1], - [ac_cv_have_hevc_encoding_api="no" USE_H265_ENCODER=0] - ) - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" - ]) - CPPFLAGS="$saved_CPPFLAGS" - fi + dnl Check for H265/HEVC Encoding API + AC_CHECK_HEADERS([va/va_enc_hevc.h], [], [], + [ +#include + ]) + AC_CACHE_CHECK([for HEVC encoding API], + [ac_cv_have_hevc_encoding_api], + [ + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS" + saved_LIBS="$LIBS" + LIBS="$LIBS $LIBVA_LIBS" + AC_COMPILE_IFELSE( + [ + AC_LANG_PROGRAM( + [[ +#include +#ifdef HAVE_VA_VA_ENC_HEVC_H +# include +#endif + ]], + [[ +VAEncSequenceParameterBufferHEVC seq_param; +VAEncPictureParameterBufferHEVC pic_param; +VAEncSliceParameterBufferHEVC buf_param; +VAQMatrixBufferHEVC q_matrix; + ]]) + ], + [ac_cv_have_hevc_encoding_api="yes"], + [ac_cv_have_hevc_encoding_api="no"]) + CPPFLAGS="$saved_CPPFLAGS" + LIBS="$saved_LIBS" + ]) + AS_IF([test "x$ac_cv_have_hevc_encoding_api" = "xyes"], [USE_H265_ENCODER=1]) fi dnl VA/Wayland API -if test "$enable_wayland" = "yes"; then - PKG_CHECK_MODULES([LIBVA_WAYLAND], [libva-wayland >= va_api_wld_version], - [:], [USE_WAYLAND=0]) +if test $USE_WAYLAND -eq 1; then + PKG_CHECK_MODULES([LIBVA_WAYLAND], [libva-wayland >= $VAAPI_WLD_REQ], + [], [USE_WAYLAND=0]) +fi + +dnl *** finalize CFLAGS, LDFLAGS, LIBS + +# set by AG_GST_PARSE_SUBSYSTEM_DISABLES above +dnl make sure it doesn't complain about unused variables if debugging is disabled +AG_GST_CHECK_GST_DEBUG_DISABLED([NO_WARNINGS="-Wno-unused"], [NO_WARNINGS=""]) + +dnl define an ERROR_CFLAGS Makefile variable +dnl FIXME Add -Wredundant-decls again if considered useful and warnings are fixed +AG_GST_SET_ERROR_CFLAGS([$FATAL_WARNINGS], [-Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wformat-security -Wold-style-definition -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar -Wnested-externs $NO_WARNINGS]) + +dnl define correct level for debugging messages +AG_GST_SET_LEVEL_DEFAULT([$GST_GIT]) + +dnl Overview: +dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ... +dnl GST_*: flags shared by built objects to link against GStreamer +dnl GST_ALL_LDFLAGS: linker flags shared by all +dnl GST_LIB_LDFLAGS: additional linker flags for all libaries +dnl GST_LT_LDFLAGS: library versioning of our libraries +dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins + +dnl GST_OPTION_CFLAGS +if test "x$USE_DEBUG" = xyes; then + PROFILE_CFLAGS="-g" +fi +AC_SUBST([PROFILE_CFLAGS]) + +if test "x$GST_GIT" = "xyes"; then + DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED" +else + DEPRECATED_CFLAGS="" fi +AC_SUBST([DEPRECATED_CFLAGS]) + +dnl every flag in GST_OPTION_CFLAGS and GST_OPTION_CXXFLAGS can be overridden +dnl at make time with e.g. make ERROR_CFLAGS="" +GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(DEPRECATED_CFLAGS)" +AC_SUBST([GST_OPTION_CFLAGS]) + +dnl FIXME: do we want to rename to GST_ALL_* ? +dnl prefer internal headers to already installed ones +dnl also add builddir include for enumtypes and marshal +dnl add GST_OPTION_CFLAGS, but overridable +GST_CFLAGS="$GST_CFLAGS -DGST_USE_UNSTABLE_API" +GST_CFLAGS="$GST_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CFLAGS)" +AC_SUBST([GST_CFLAGS]) + +dnl LDFLAGS really should only contain flags, not libs - they get added before +dnl whatevertarget_LIBS and -L flags here affect the rest of the linking +GST_ALL_LDFLAGS="-no-undefined" +if test "x${enable_Bsymbolic}" = "xyes"; then + GST_ALL_LDFLAGS="$GST_ALL_LDFLAGS -Wl,-Bsymbolic-functions" +fi +AC_SUBST([GST_ALL_LDFLAGS]) + +dnl GST_LIB_LDFLAGS +dnl linker flags shared by all libraries +dnl LDFLAGS modifier defining exported symbols from built libraries +dnl (export _gst_foo but not __gst_foo) +GST_LIB_LDFLAGS="-export-symbols-regex ^_?\(gst_\|Gst\|GST_\).*" +AC_SUBST([GST_LIB_LDFLAGS]) + +dnl this really should only contain flags, not libs - they get added before +dnl whatevertarget_LIBS and -L flags here affect the rest of the linking +GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_.*' $GST_ALL_LDFLAGS" +AC_SUBST([GST_PLUGIN_LDFLAGS]) dnl --------------------------------------------------------------------------- dnl -- Generate files and summary -- dnl --------------------------------------------------------------------------- case ":$USE_X11:$USE_GLX:$USE_EGL:$USE_WAYLAND:$USE_DRM:" in -*:1:*) - ;; -*) - AC_MSG_ERROR([No renderer is enabled]) - ;; +*:1:*) ;; +*) AC_MSG_ERROR([No renderer is enabled]) ;; esac -AC_DEFINE_UNQUOTED([USE_ENCODERS], $USE_ENCODERS, - [Defined to 1 if video encoders are used]) +AC_DEFINE_UNQUOTED([USE_ENCODERS], [$USE_ENCODERS], + [Defined to 1 if video encoders are used]) AM_CONDITIONAL([USE_ENCODERS], [test $USE_ENCODERS -eq 1]) -AC_DEFINE_UNQUOTED(USE_JPEG_ENCODER, $USE_JPEG_ENCODER, - [Defined to 1 if JPEG encoder is used]) -AM_CONDITIONAL(USE_JPEG_ENCODER, test $USE_JPEG_ENCODER -eq 1) - -AC_DEFINE_UNQUOTED(USE_VP8_ENCODER, $USE_VP8_ENCODER, - [Defined to 1 if VP8 encoder is used]) -AM_CONDITIONAL(USE_VP8_ENCODER, test $USE_VP8_ENCODER -eq 1) - -AC_DEFINE_UNQUOTED(USE_H265_ENCODER, $USE_H265_ENCODER, - [Defined to 1 if H265 encoder is used]) -AM_CONDITIONAL(USE_H265_ENCODER, test $USE_H265_ENCODER -eq 1) - -AC_DEFINE_UNQUOTED(USE_VA_VPP, $USE_VA_VPP, - [Defined to 1 if video post-processing is used]) -AM_CONDITIONAL(USE_VA_VPP, test $USE_VA_VPP -eq 1) - -AC_DEFINE_UNQUOTED(USE_JPEG_DECODER, $USE_JPEG_DECODER, - [Defined to 1 if JPEG decoder is used]) -AM_CONDITIONAL(USE_JPEG_DECODER, test $USE_JPEG_DECODER -eq 1) - -AC_DEFINE_UNQUOTED(USE_VP8_DECODER, $USE_VP8_DECODER, - [Defined to 1 if VP8 decoder is used]) -AM_CONDITIONAL(USE_VP8_DECODER, test $USE_VP8_DECODER -eq 1) - -AC_DEFINE_UNQUOTED(USE_VP9_DECODER, $USE_VP9_DECODER, - [Defined to 1 if VP9 decoder is used]) -AM_CONDITIONAL(USE_VP9_DECODER, test $USE_VP9_DECODER -eq 1) - -AC_DEFINE_UNQUOTED(USE_HEVC_DECODER, $USE_HEVC_DECODER, - [Defined to 1 if HEVC decoder is used]) -AM_CONDITIONAL(USE_HEVC_DECODER, test $USE_HEVC_DECODER -eq 1) - -AC_DEFINE_UNQUOTED(USE_DRM, $USE_DRM, - [Defined to 1 if DRM is enabled]) -AM_CONDITIONAL(USE_DRM, test $USE_DRM -eq 1) - -AC_DEFINE_UNQUOTED(USE_X11, $USE_X11, - [Defined to 1 if X11 is enabled]) -AM_CONDITIONAL(USE_X11, test $USE_X11 -eq 1) - -AC_DEFINE_UNQUOTED(USE_GLX, $USE_GLX, - [Defined to 1 if GLX is enabled]) -AM_CONDITIONAL(USE_GLX, test $USE_GLX -eq 1) +AC_DEFINE_UNQUOTED([USE_JPEG_ENCODER], [$USE_JPEG_ENCODER], + [Defined to 1 if JPEG encoder is used]) +AM_CONDITIONAL([USE_JPEG_ENCODER], [test $USE_JPEG_ENCODER -eq 1]) + +AC_DEFINE_UNQUOTED([USE_VP8_ENCODER], [$USE_VP8_ENCODER], + [Defined to 1 if VP8 encoder is used]) +AM_CONDITIONAL([USE_VP8_ENCODER], [test $USE_VP8_ENCODER -eq 1]) + +AC_DEFINE_UNQUOTED([USE_H265_ENCODER], [$USE_H265_ENCODER], + [Defined to 1 if H265 encoder is used]) +AM_CONDITIONAL([USE_H265_ENCODER], [test $USE_H265_ENCODER -eq 1]) + +AC_DEFINE_UNQUOTED([USE_VA_VPP], [$USE_VA_VPP], + [Defined to 1 if video post-processing is used]) +AM_CONDITIONAL([USE_VA_VPP], [test $USE_VA_VPP -eq 1]) + +AC_DEFINE_UNQUOTED([USE_JPEG_DECODER], [$USE_JPEG_DECODER], + [Defined to 1 if JPEG decoder is used]) +AM_CONDITIONAL([USE_JPEG_DECODER], [test $USE_JPEG_DECODER -eq 1]) + +AC_DEFINE_UNQUOTED([USE_VP8_DECODER], [$USE_VP8_DECODER], + [Defined to 1 if VP8 decoder is used]) +AM_CONDITIONAL([USE_VP8_DECODER], [test $USE_VP8_DECODER -eq 1]) + +AC_DEFINE_UNQUOTED([USE_VP9_DECODER], [$USE_VP9_DECODER], + [Defined to 1 if VP9 decoder is used]) +AM_CONDITIONAL([USE_VP9_DECODER], [test $USE_VP9_DECODER -eq 1]) + +AC_DEFINE_UNQUOTED([USE_HEVC_DECODER], [$USE_HEVC_DECODER], + [Defined to 1 if HEVC decoder is used]) +AM_CONDITIONAL([USE_HEVC_DECODER], [test $USE_HEVC_DECODER -eq 1]) + +AC_DEFINE_UNQUOTED([USE_DRM], [$USE_DRM], + [Defined to 1 if DRM is enabled]) +AM_CONDITIONAL([USE_DRM], [test $USE_DRM -eq 1]) + +AC_DEFINE_UNQUOTED([USE_X11], [$USE_X11], + [Defined to 1 if X11 is enabled]) +AM_CONDITIONAL([USE_X11], [test $USE_X11 -eq 1]) + +AC_DEFINE_UNQUOTED([USE_GLX], [$USE_GLX], + [Defined to 1 if GLX is enabled]) +AM_CONDITIONAL([USE_GLX], [test $USE_GLX -eq 1]) AC_DEFINE_UNQUOTED([USE_EGL], [$USE_EGL], - [Defined to 1 if EGL is enabled]) + [Defined to 1 if EGL is enabled]) AM_CONDITIONAL([USE_EGL], [test $USE_EGL -eq 1]) AC_DEFINE_UNQUOTED([USE_GLES_VERSION_MASK], [$GLES_VERSION_MASK], - [Defined to the set of enabled OpenGL ES APIs]) - -AC_DEFINE_UNQUOTED(USE_WAYLAND, $USE_WAYLAND, - [Defined to 1 if WAYLAND is enabled]) -AM_CONDITIONAL(USE_WAYLAND, test $USE_WAYLAND -eq 1) + [Defined to the set of enabled OpenGL ES APIs]) -pkgconfigdir=${libdir}/pkgconfig -AC_SUBST(pkgconfigdir) +AC_DEFINE_UNQUOTED([USE_WAYLAND], [$USE_WAYLAND], + [Defined to 1 if WAYLAND is enabled]) +AM_CONDITIONAL([USE_WAYLAND], [test $USE_WAYLAND -eq 1]) + +dnl @TODO hack for egl's dynamic module loading. remove it! +AC_DEFINE_UNQUOTED([GST_VAAPI_MAJOR_VERSION_S], ["0"], + [Defined to the string representation of gstreamer-vaapi major version]) AC_CONFIG_FILES([ Makefile - debian.upstream/Makefile - debian.upstream/changelog - debian.upstream/control - debian.upstream/gstreamer$GST_API_VERSION-vaapi-doc.install:\ -debian.upstream/gstreamer-vaapi-doc.install.in - debian.upstream/gstreamer$GST_API_VERSION-vaapi.install:\ -debian.upstream/gstreamer-vaapi.install.in - debian.upstream/libgstvaapi$GST_PKG_VERSION-dev.install:\ -debian.upstream/libgstvaapi-dev.install.in - debian.upstream/libgstvaapi$GST_VAAPI_MAJOR_VERSION.install:\ -debian.upstream/libgstvaapi.install.in - debian.upstream/libgstvaapi-drm-$GST_VAAPI_MAJOR_VERSION.install:\ -debian.upstream/libgstvaapi-drm.install.in - debian.upstream/libgstvaapi-glx-$GST_VAAPI_MAJOR_VERSION.install:\ -debian.upstream/libgstvaapi-glx.install.in - debian.upstream/libgstvaapi-wayland-$GST_VAAPI_MAJOR_VERSION.install:\ -debian.upstream/libgstvaapi-wayland.install.in - debian.upstream/libgstvaapi-x11-$GST_VAAPI_MAJOR_VERSION.install:\ -debian.upstream/libgstvaapi-x11.install.in + common/Makefile + common/m4/Makefile + m4/Makefile docs/Makefile - docs/reference/Makefile - docs/reference/libs/Makefile - docs/reference/libs/libs-docs.xml - docs/reference/plugins/Makefile - docs/reference/plugins/plugins-docs.xml - ext/Makefile - ext/libvpx/Makefile + docs/version.entities + docs/plugins/Makefile + docs/plugins/gstreamer-vaapi-plugins-docs.xml gst-libs/Makefile gst-libs/gst/Makefile gst-libs/gst/base/Makefile - gst-libs/gst/codecparsers/Makefile gst-libs/gst/vaapi/Makefile gst/Makefile gst/vaapi/Makefile - patches/Makefile - patches/videoparsers/Makefile - pkgconfig/Makefile - pkgconfig/gstreamer-vaapi-$GST_PKG_VERSION.pc:\ -pkgconfig/gstreamer-vaapi.pc.in - pkgconfig/gstreamer-vaapi-drm-$GST_PKG_VERSION.pc:\ -pkgconfig/gstreamer-vaapi-drm.pc.in - pkgconfig/gstreamer-vaapi-glx-$GST_PKG_VERSION.pc:\ -pkgconfig/gstreamer-vaapi-glx.pc.in - pkgconfig/gstreamer-vaapi-wayland-$GST_PKG_VERSION.pc:\ -pkgconfig/gstreamer-vaapi-wayland.pc.in - pkgconfig/gstreamer-vaapi-x11-$GST_PKG_VERSION.pc:\ -pkgconfig/gstreamer-vaapi-x11.pc.in tests/Makefile ]) AC_OUTPUT dnl Print summary yesno() { - test $1 -eq 1 && echo yes || echo no + test $1 -eq 1 && echo yes || echo no } VIDEO_OUTPUTS="" @@ -1183,7 +1008,7 @@ echo $PACKAGE configuration summary: echo echo Installation Prefix .............. : ${prefix} -echo GStreamer API version ............ : $GST_API_VERSION +echo GStreamer API version ............ : $GST_VERSION echo VA-API version ................... : $VA_VERSION_STR echo Video encoding ................... : $(yesno $USE_ENCODERS) echo Video outputs .................... : $VIDEO_OUTPUTS diff -Nru gstreamer-vaapi-0.7.0/debian/changelog gstreamer-vaapi-1.8.2/debian/changelog --- gstreamer-vaapi-0.7.0/debian/changelog 2016-01-12 13:46:40.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian/changelog 2016-08-31 20:04:07.000000000 +0000 @@ -1,8 +1,32 @@ -gstreamer-vaapi (0.7.0-1~ppa14.04+1) trusty; urgency=medium +gstreamer-vaapi (1.8.2-1~ppa14.04+1) trusty; urgency=medium - * Merge from Debian Unstable. + * Merge new upstream release from Debian Unstable. - -- Nicolas Derive Tue, 12 Jan 2016 14:45:46 +0100 + -- Nicolas Derive Wed, 31 Aug 2016 22:03:15 +0200 + +gstreamer-vaapi (1.8.2-1) unstable; urgency=medium + + * New upstream release. + + -- Vincent Cheng Thu, 09 Jun 2016 21:20:17 -0700 + +gstreamer-vaapi (1.8.1-1) unstable; urgency=medium + + * New upstream release. + * control: Bump policy to 3.9.8, no changes. + + -- Vincent Cheng Mon, 25 Apr 2016 19:58:54 -0700 + +gstreamer-vaapi (1.8.0-1) unstable; urgency=medium + + * New upstream release. + * watch: Update the url. + * control: Bump libgstreamer build-deps. + * control: Add libgles2-mesa-dev to build-deps. + * Remove library and -dev packages as upstream doesn't build them anymore. + * control: Bump policy to 3.9.7, no changes. + + -- Timo Aaltonen Thu, 07 Apr 2016 12:47:58 +0300 gstreamer-vaapi (0.7.0-1) unstable; urgency=medium diff -Nru gstreamer-vaapi-0.7.0/debian/control gstreamer-vaapi-1.8.2/debian/control --- gstreamer-vaapi-0.7.0/debian/control 2015-10-01 10:46:48.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian/control 2016-06-10 04:19:15.000000000 +0000 @@ -12,10 +12,11 @@ libdrm-dev, libegl1-mesa-dev, libgl1-mesa-dev, + libgles2-mesa-dev, libglib2.0-dev, - libgstreamer-plugins-bad1.0-dev (>= 1.3.0), - libgstreamer-plugins-base1.0-dev (>= 1.3.0), - libgstreamer1.0-dev (>= 1.2.90), + libgstreamer-plugins-bad1.0-dev (>= 1.7.91), + libgstreamer-plugins-base1.0-dev (>= 1.7.91), + libgstreamer1.0-dev (>= 1.7.91), libudev-dev, libva-dev (>= 1.0.9), libwayland-dev, @@ -23,10 +24,10 @@ libxrandr-dev, mesa-common-dev, yasm -Standards-Version: 3.9.6 +Standards-Version: 3.9.8 Homepage: https://github.com/01org/gstreamer-vaapi/ -Vcs-Git: git://anonscm.debian.org/pkg-gstreamer/gstreamer-vaapi.git -Vcs-Browser: http://anonscm.debian.org/cgit/pkg-gstreamer/gstreamer-vaapi.git +Vcs-Git: https://anonscm.debian.org/git/pkg-gstreamer/gstreamer-vaapi.git +Vcs-Browser: https://anonscm.debian.org/cgit/pkg-gstreamer/gstreamer-vaapi.git Package: gstreamer1.0-vaapi Architecture: any @@ -47,39 +48,9 @@ Architecture: all Section: doc Depends: ${misc:Depends} -Recommends: libgstreamer-vaapi1.0-dev (= ${source:Version}) Description: GStreamer VA-API documentation and manuals Gstreamer-vaapi is a collection of GStreamer plugins and helper libraries that allow hardware accelerated video decoding, encoding and processing through VA-API. . This package contains documentation for libraries and elements. - -Package: libgstreamer-vaapi1.0-0 -Architecture: any -Multi-Arch: same -Pre-Depends: ${misc:Pre-Depends} -Depends: ${misc:Depends}, ${shlibs:Depends} -Description: GStreamer libraries from the "vaapi" set - Gstreamer-vaapi is a collection of GStreamer plugins and helper libraries that - allow hardware accelerated video decoding, encoding and processing through - VA-API. - . - This package contains libraries for the "vaapi" set. - -Package: libgstreamer-vaapi1.0-dev -Architecture: any -Section: libdevel -Depends: - libgstreamer-plugins-base1.0-dev, - libgstreamer-vaapi1.0-0 (= ${binary:Version}), - libva-dev, - ${misc:Depends}, - ${shlibs:Depends} -Description: GStreamer development files for libraries from the "vaapi" set - Gstreamer-vaapi is a collection of GStreamer plugins and helper libraries that - allow hardware accelerated video decoding, encoding and processing through - VA-API. - . - This package contains development files for GStreamer libraries for - the "vaapi" set. diff -Nru gstreamer-vaapi-0.7.0/debian/copyright gstreamer-vaapi-1.8.2/debian/copyright --- gstreamer-vaapi-0.7.0/debian/copyright 2015-10-01 07:33:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian/copyright 2016-06-10 04:25:44.000000000 +0000 @@ -8,23 +8,6 @@ 2011, Collabora Ltd License: LGPL-2.1+ -Files: ext/codecparsers/gst-libs/gst/codecparsers/* -Copyright: 2011 Intel Corporation - 2011 Collabora Ltd. - 2011 Thibault Saunier - 2010 Mark Nauwelaerts - 2010 Collabora Multimedia - 2010 Nokia Corporation - 2005 Michal Benes - 2008 Wim Taymans - 2009 Carl-Anton Ingmarsson - 2007 Jan Schmidt -License: LGPL-2+ - -Files: ext/libvpx/* -Copyright: 2010 The WebM Project authors -License: BSD-3-clause - Files: debian/* Copyright: 2012 Timo Aaltonen 2014 Vincent Cheng @@ -47,24 +30,6 @@ On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". -License: LGPL-2+ - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - version 2, as published by the Free Software Foundation. - . - 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 - . - On Debian GNU/Linux systems, the complete text of the GNU Lesser General - Public License can be found in `/usr/share/common-licenses/LGPL-2'. - License: LGPL-2.1+ This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License @@ -83,33 +48,3 @@ . On Debian GNU/Linux systems, the complete text of the GNU Lesser General Public License can be found in `/usr/share/common-licenses/LGPL-2.1'. - -License: BSD-3-clause - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - . - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - . - * 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. - . - * Neither the name of Google, nor the WebM Project, nor the names - of its contributors may be used to endorse or promote products - derived from this software without specific prior written - permission. - . - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "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 THE COPYRIGHT - HOLDER 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. diff -Nru gstreamer-vaapi-0.7.0/debian/libgstreamer-vaapi1.0-0.install gstreamer-vaapi-1.8.2/debian/libgstreamer-vaapi1.0-0.install --- gstreamer-vaapi-0.7.0/debian/libgstreamer-vaapi1.0-0.install 2015-10-01 07:30:32.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian/libgstreamer-vaapi1.0-0.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/lib/*/*.so.* diff -Nru gstreamer-vaapi-0.7.0/debian/libgstreamer-vaapi1.0-0.lintian-overrides gstreamer-vaapi-1.8.2/debian/libgstreamer-vaapi1.0-0.lintian-overrides --- gstreamer-vaapi-0.7.0/debian/libgstreamer-vaapi1.0-0.lintian-overrides 2015-10-01 07:30:32.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian/libgstreamer-vaapi1.0-0.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -# Policy 8.1: -# "If you have several shared libraries built from the same source tree, you -# may lump them all together into a single shared library package provided -# that all of their SONAMEs will always change together." -libgstreamer-vaapi1.0-0: package-name-doesnt-match-sonames diff -Nru gstreamer-vaapi-0.7.0/debian/libgstreamer-vaapi1.0-dev.install gstreamer-vaapi-1.8.2/debian/libgstreamer-vaapi1.0-dev.install --- gstreamer-vaapi-0.7.0/debian/libgstreamer-vaapi1.0-dev.install 2015-10-01 07:30:32.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian/libgstreamer-vaapi1.0-dev.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -usr/include/gstreamer-1.0/gst/vaapi/ -usr/lib/*/libgst*.so -usr/lib/*/pkgconfig/gstreamer-vaapi*.pc diff -Nru gstreamer-vaapi-0.7.0/debian/rules gstreamer-vaapi-1.8.2/debian/rules --- gstreamer-vaapi-0.7.0/debian/rules 2015-12-24 07:10:40.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian/rules 2016-06-10 04:26:22.000000000 +0000 @@ -30,7 +30,7 @@ # dh_autoreconf override_dh_auto_configure: - dh_auto_configure -- --disable-silent-rules --disable-builtin-libvpx \ + dh_auto_configure -- --disable-silent-rules \ --enable-gtk-doc --with-html-dir=\$${prefix}/share/doc/$(gst_pkgname) override_dh_install: @@ -44,12 +44,5 @@ override_dh_installchangelogs: dh_installchangelogs NEWS -override_dh_makeshlibs: - dh_makeshlibs -V "libgstreamer-vaapi$(gst_deb_abi) (>= $(gst_version))" -- -plibgstreamer-vaapi$(gst_deb_abi) - -override_dh_shlibdeps: - LD_LIBRARY_PATH=debian/libgstreamer-vaapi$(gst_deb_abi)/usr/lib/$(DEB_HOST_MULTIARCH)/:/usr/lib/$(DEB_HOST_MULTIARCH)/:$(LD_LIBRARY_PATH) \ - dh_shlibdeps - %: dh $@ --with autoreconf --builddirectory=build/ diff -Nru gstreamer-vaapi-0.7.0/debian/watch gstreamer-vaapi-1.8.2/debian/watch --- gstreamer-vaapi-0.7.0/debian/watch 2015-10-01 07:30:32.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian/watch 2016-06-10 04:19:15.000000000 +0000 @@ -1,2 +1,2 @@ version=3 -http://www.freedesktop.org/software/vaapi/releases/gstreamer-vaapi/ gstreamer-vaapi-(.*)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))) +https://gstreamer.freedesktop.org/src/gstreamer-vaapi/ gstreamer-vaapi-(.*)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))) diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/changelog gstreamer-vaapi-1.8.2/debian.upstream/changelog --- gstreamer-vaapi-0.7.0/debian.upstream/changelog 2015-12-07 10:54:28.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/changelog 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -gstreamer1.6-vaapi (0.7.0-1) unstable; urgency=low - - * Autogenerated package, see NEWS file for ChangeLog. - - -- Gwenole Beauchesne Mon, 07 Dec 2015 12:54:25 +0200 diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/changelog.in gstreamer-vaapi-1.8.2/debian.upstream/changelog.in --- gstreamer-vaapi-0.7.0/debian.upstream/changelog.in 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/changelog.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -gstreamer@GST_API_VERSION@-vaapi (@PACKAGE_VERSION@-1) unstable; urgency=low - - * Autogenerated package, see NEWS file for ChangeLog. - - -- Gwenole Beauchesne @TODAY@ diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/compat gstreamer-vaapi-1.8.2/debian.upstream/compat --- gstreamer-vaapi-0.7.0/debian.upstream/compat 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -5 diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/control gstreamer-vaapi-1.8.2/debian.upstream/control --- gstreamer-vaapi-0.7.0/debian.upstream/control 2015-12-07 10:54:28.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/control 1970-01-01 00:00:00.000000000 +0000 @@ -1,107 +0,0 @@ -Source: gstreamer1.6-vaapi -Section: libs -Priority: optional -Maintainer: Gwenole Beauchesne -Build-Depends: debhelper (>= 5), - cdbs, - libglib2.0-dev (>= 2.32), - libgstreamer1.0-dev (>= 1.5.0), - libgstreamer-plugins-base1.0-dev (>= 1.5.0), - libgstreamer-plugins-bad1.0-dev (>= 1.5.0), - libdrm-dev, libudev-dev, - libx11-dev, libxrandr-dev, - libgl-dev, - libwayland-dev (>= 1.0.2), - libva-dev (>= 1.0.3), - yasm -Build-Depends-Indep: gtk-doc-tools (>= 1.9) -Standards-Version: 3.7.2 - -Package: gstreamer1.6-vaapi -Section: libs -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Suggests: gstreamer1.6-vaapi-doc -Description: VA-API plugins for GStreamer - This package contains GStreamer plugins for VA-API support: - - `vaapidecode': decode bitstreams using VA-API - - `vaapiencode_mpeg2': encode bitstreams using VA-API (MPEG-2 codec) - - `vaapiencode_h264': encode bitstreams using VA-API (H.264 codec) - - `vaapipostproc': postprocess VA surfaces, e.g. for deinterlacing - - `vaapisink': a VA-API based video sink - -Package: gstreamer1.6-vaapi-doc -Architecture: all -Section: doc -Recommends: libgstvaapi1.6-dev (= ${source:Version}) -Description: GStreamer VA-API documentation and manuals - This packages contains documentation for libraries and elements. - -Package: gstreamer1.6-vaapi-dbg -Section: libdevel -Architecture: any -Depends: gstreamer1.6-vaapi (= ${Source-Version}) -Description: VA-API plugins for GStreamer - VA-API support plugins for GStreamer. - . - This package contains the debug files. - -Package: libgstvaapi1 -Section: libs -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: GStreamer libraries from the "vaapi" set - VA-API support libraries for GStreamer. - . - This package contains common libraries for the "vaapi" set. - -Package: libgstvaapi-drm-1 -Section: libs -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: GStreamer libraries from the "vaapi" set - VA-API support libraries for GStreamer. - . - This package contains headless libraries for the "vaapi" set. - -Package: libgstvaapi-x11-1 -Section: libs -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: GStreamer libraries from the "vaapi" set - VA-API support libraries for GStreamer. - . - This package contains x11 libraries for the "vaapi" set. - -Package: libgstvaapi-glx-1 -Section: libs -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: GStreamer libraries from the "vaapi" set - VA-API support libraries for GStreamer. - . - This package contains glx libraries for the "vaapi" set. - -Package: libgstvaapi-wayland-1 -Section: libs -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: GStreamer libraries from the "vaapi" set - VA-API support libraries for GStreamer. - . - This package contains Wayland libraries for the "vaapi" set. - -Package: libgstvaapi1.0-dev -Architecture: any -Section: libdevel -Depends: ${shlibs:Depends}, ${misc:Depends}, - libgstvaapi-drm-1 (= ${Source-Version}), - libgstvaapi-x11-1 (= ${Source-Version}), - libgstvaapi-glx-1 (= ${Source-Version}), - libgstvaapi-wayland-1 (= ${Source-Version}), - libgstvaapi1 (= ${Source-Version}) -Description: GStreamer development files for libraries from the "vaapi" set - GStreamer/VA-API development files. - . - This package contains development files for GStreamer libraries for - the "vaapi" set. diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/control.in gstreamer-vaapi-1.8.2/debian.upstream/control.in --- gstreamer-vaapi-0.7.0/debian.upstream/control.in 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/control.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,107 +0,0 @@ -Source: gstreamer@GST_API_VERSION@-vaapi -Section: libs -Priority: optional -Maintainer: Gwenole Beauchesne -Build-Depends: debhelper (>= 5), - cdbs, - libglib2.0-dev (>= @GLIB_VERSION_REQUIRED@), - libgstreamer@GST_PKG_VERSION@-dev (>= @GST_VERSION_REQUIRED@), - libgstreamer-plugins-base@GST_PKG_VERSION@-dev (>= @GST_PLUGINS_BASE_VERSION_REQUIRED@), - libgstreamer-plugins-bad@GST_PKG_VERSION@-dev (>= @GST_PLUGINS_BAD_VERSION_REQUIRED@), -@USE_DRM_TRUE@ libdrm-dev, libudev-dev, -@USE_X11_TRUE@ libx11-dev, libxrandr-dev, -@USE_GLX_TRUE@ libgl-dev, -@USE_WAYLAND_TRUE@ libwayland-dev (>= @WAYLAND_API_VERSION@), - libva-dev (>= @LIBVA_PACKAGE_VERSION@), - yasm -Build-Depends-Indep: gtk-doc-tools (>= @GTKDOC_VERSION@) -Standards-Version: 3.7.2 - -Package: gstreamer@GST_API_VERSION@-vaapi -Section: libs -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Suggests: gstreamer@GST_API_VERSION@-vaapi-doc -Description: VA-API plugins for GStreamer - This package contains GStreamer plugins for VA-API support: - - `vaapidecode': decode bitstreams using VA-API -@USE_ENCODERS_TRUE@ - `vaapiencode_mpeg2': encode bitstreams using VA-API (MPEG-2 codec) -@USE_ENCODERS_TRUE@ - `vaapiencode_h264': encode bitstreams using VA-API (H.264 codec) - - `vaapipostproc': postprocess VA surfaces, e.g. for deinterlacing - - `vaapisink': a VA-API based video sink - -Package: gstreamer@GST_API_VERSION@-vaapi-doc -Architecture: all -Section: doc -Recommends: libgstvaapi@GST_API_VERSION@-dev (= ${source:Version}) -Description: GStreamer VA-API documentation and manuals - This packages contains documentation for libraries and elements. - -Package: gstreamer@GST_API_VERSION@-vaapi-dbg -Section: libdevel -Architecture: any -Depends: gstreamer@GST_API_VERSION@-vaapi (= ${Source-Version}) -Description: VA-API plugins for GStreamer - VA-API support plugins for GStreamer. - . - This package contains the debug files. - -Package: libgstvaapi@GST_VAAPI_MAJOR_VERSION@ -Section: libs -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: GStreamer libraries from the "vaapi" set - VA-API support libraries for GStreamer. - . - This package contains common libraries for the "vaapi" set. - -@USE_DRM_TRUE@Package: libgstvaapi-drm-@GST_VAAPI_MAJOR_VERSION@ -@USE_DRM_TRUE@Section: libs -@USE_DRM_TRUE@Architecture: any -@USE_DRM_TRUE@Depends: ${shlibs:Depends}, ${misc:Depends} -@USE_DRM_TRUE@Description: GStreamer libraries from the "vaapi" set -@USE_DRM_TRUE@ VA-API support libraries for GStreamer. -@USE_DRM_TRUE@ . -@USE_DRM_TRUE@ This package contains headless libraries for the "vaapi" set. - -@USE_X11_TRUE@Package: libgstvaapi-x11-@GST_VAAPI_MAJOR_VERSION@ -@USE_X11_TRUE@Section: libs -@USE_X11_TRUE@Architecture: any -@USE_X11_TRUE@Depends: ${shlibs:Depends}, ${misc:Depends} -@USE_X11_TRUE@Description: GStreamer libraries from the "vaapi" set -@USE_X11_TRUE@ VA-API support libraries for GStreamer. -@USE_X11_TRUE@ . -@USE_X11_TRUE@ This package contains x11 libraries for the "vaapi" set. - -@USE_GLX_TRUE@Package: libgstvaapi-glx-@GST_VAAPI_MAJOR_VERSION@ -@USE_GLX_TRUE@Section: libs -@USE_GLX_TRUE@Architecture: any -@USE_GLX_TRUE@Depends: ${shlibs:Depends}, ${misc:Depends} -@USE_GLX_TRUE@Description: GStreamer libraries from the "vaapi" set -@USE_GLX_TRUE@ VA-API support libraries for GStreamer. -@USE_GLX_TRUE@ . -@USE_GLX_TRUE@ This package contains glx libraries for the "vaapi" set. - -@USE_WAYLAND_TRUE@Package: libgstvaapi-wayland-@GST_VAAPI_MAJOR_VERSION@ -@USE_WAYLAND_TRUE@Section: libs -@USE_WAYLAND_TRUE@Architecture: any -@USE_WAYLAND_TRUE@Depends: ${shlibs:Depends}, ${misc:Depends} -@USE_WAYLAND_TRUE@Description: GStreamer libraries from the "vaapi" set -@USE_WAYLAND_TRUE@ VA-API support libraries for GStreamer. -@USE_WAYLAND_TRUE@ . -@USE_WAYLAND_TRUE@ This package contains Wayland libraries for the "vaapi" set. - -Package: libgstvaapi@GST_PKG_VERSION@-dev -Architecture: any -Section: libdevel -Depends: ${shlibs:Depends}, ${misc:Depends}, -@USE_DRM_TRUE@ libgstvaapi-drm-@GST_VAAPI_MAJOR_VERSION@ (= ${Source-Version}), -@USE_X11_TRUE@ libgstvaapi-x11-@GST_VAAPI_MAJOR_VERSION@ (= ${Source-Version}), -@USE_GLX_TRUE@ libgstvaapi-glx-@GST_VAAPI_MAJOR_VERSION@ (= ${Source-Version}), -@USE_WAYLAND_TRUE@ libgstvaapi-wayland-@GST_VAAPI_MAJOR_VERSION@ (= ${Source-Version}), - libgstvaapi@GST_VAAPI_MAJOR_VERSION@ (= ${Source-Version}) -Description: GStreamer development files for libraries from the "vaapi" set - GStreamer/VA-API development files. - . - This package contains development files for GStreamer libraries for - the "vaapi" set. diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/copyright gstreamer-vaapi-1.8.2/debian.upstream/copyright --- gstreamer-vaapi-0.7.0/debian.upstream/copyright 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/copyright 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -This package is maintained by: -Gwenole Beauchesne - -Copyright: - - gstreamer-vaapi helper libraries - and plugins elements: LGPL (v2.1 or later) - -License: - - Copyright (C) 2010-2011, Splitted-Desktop Systems. - Copyright (C) 2011-2014, Intel Corporation. - Copyright (C) 2011, Collabora Ltd. - - gstreamer-vaapi helper libraries and plugins elements are available under - the terms of the GNU Lesser General Public License v2.1+. - - 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 - -On Debian GNU/Linux systems, the complete text of the GNU Lesser General -Public License can be found in `/usr/share/common-licenses/LGPL-2.1'. - diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/gstreamer1.6-vaapi-doc.install gstreamer-vaapi-1.8.2/debian.upstream/gstreamer1.6-vaapi-doc.install --- gstreamer-vaapi-0.7.0/debian.upstream/gstreamer1.6-vaapi-doc.install 2015-12-07 10:54:28.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/gstreamer1.6-vaapi-doc.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp/usr/share/doc/gstreamer1.6-vaapi diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/gstreamer1.6-vaapi.install gstreamer-vaapi-1.8.2/debian.upstream/gstreamer1.6-vaapi.install --- gstreamer-vaapi-0.7.0/debian.upstream/gstreamer1.6-vaapi.install 2015-12-07 10:54:28.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/gstreamer1.6-vaapi.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp/home/sreerenj/opt/gstreamer/1.6/lib/gstreamer-1.0/libgstvaapi*.so diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/gstreamer-vaapi-doc.install.in gstreamer-vaapi-1.8.2/debian.upstream/gstreamer-vaapi-doc.install.in --- gstreamer-vaapi-0.7.0/debian.upstream/gstreamer-vaapi-doc.install.in 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/gstreamer-vaapi-doc.install.in 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp/usr/share/doc/gstreamer@GST_API_VERSION@-vaapi diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/gstreamer-vaapi.install.in gstreamer-vaapi-1.8.2/debian.upstream/gstreamer-vaapi.install.in --- gstreamer-vaapi-0.7.0/debian.upstream/gstreamer-vaapi.install.in 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/gstreamer-vaapi.install.in 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp@plugindir@/libgstvaapi*.so diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi1.0-dev.install gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi1.0-dev.install --- gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi1.0-dev.install 2015-12-07 10:54:28.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi1.0-dev.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -debian/tmp/usr/lib/libgstvaapi*.so -debian/tmp/usr/lib/pkgconfig/gstreamer-vaapi*.pc -debian/tmp/usr/include/gstreamer-1.0/gst/vaapi/*.h diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi1.install gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi1.install --- gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi1.install 2015-12-07 10:54:28.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi1.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -debian/tmp/usr/lib/libgstcodecparsers_vpx.so.* -debian/tmp/usr/lib/libgstvaapi-1.6.so.* diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi-dev.install.in gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi-dev.install.in --- gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi-dev.install.in 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi-dev.install.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -debian/tmp/usr/lib/libgstvaapi*.so -debian/tmp/usr/lib/pkgconfig/gstreamer-vaapi*.pc -debian/tmp/usr/include/gstreamer-@GST_PKG_VERSION@/gst/vaapi/*.h diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi-drm-1.install gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi-drm-1.install --- gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi-drm-1.install 2015-12-07 10:54:28.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi-drm-1.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp/usr/lib/libgstvaapi-drm-1.6.so.* diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi-drm.install.in gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi-drm.install.in --- gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi-drm.install.in 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi-drm.install.in 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp/usr/lib/libgstvaapi-drm-@GST_API_VERSION@.so.* diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi-glx-1.install gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi-glx-1.install --- gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi-glx-1.install 2015-12-07 10:54:28.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi-glx-1.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp/usr/lib/libgstvaapi-glx-1.6.so.* diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi-glx.install.in gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi-glx.install.in --- gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi-glx.install.in 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi-glx.install.in 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp/usr/lib/libgstvaapi-glx-@GST_API_VERSION@.so.* diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi.install.in gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi.install.in --- gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi.install.in 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi.install.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -debian/tmp/usr/lib/libgstcodecparsers_vpx.so.* -debian/tmp/usr/lib/libgstvaapi-@GST_API_VERSION@.so.* diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi-wayland-1.install gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi-wayland-1.install --- gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi-wayland-1.install 2015-12-07 10:54:28.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi-wayland-1.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp/usr/lib/libgstvaapi-wayland-1.6.so.* diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi-wayland.install.in gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi-wayland.install.in --- gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi-wayland.install.in 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi-wayland.install.in 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp/usr/lib/libgstvaapi-wayland-@GST_API_VERSION@.so.* diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi-x11-1.install gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi-x11-1.install --- gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi-x11-1.install 2015-12-07 10:54:28.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi-x11-1.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp/usr/lib/libgstvaapi-x11-1.6.so.* diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi-x11.install.in gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi-x11.install.in --- gstreamer-vaapi-0.7.0/debian.upstream/libgstvaapi-x11.install.in 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/libgstvaapi-x11.install.in 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp/usr/lib/libgstvaapi-x11-@GST_API_VERSION@.so.* diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/Makefile.am gstreamer-vaapi-1.8.2/debian.upstream/Makefile.am --- gstreamer-vaapi-0.7.0/debian.upstream/Makefile.am 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -DOCS = \ - AUTHORS \ - COPYING.LIB \ - NEWS \ - README \ - $(NULL) - -DEBIANFILES = \ - changelog.in \ - compat \ - control.in \ - copyright \ - gstreamer-vaapi-doc.install.in \ - gstreamer-vaapi.install.in \ - libgstvaapi-dev.install.in \ - libgstvaapi-drm.install.in \ - libgstvaapi-glx.install.in \ - libgstvaapi-wayland.install.in \ - libgstvaapi-x11.install.in \ - libgstvaapi.install.in \ - rules \ - $(NULL) - -DEBIANGENFILES = \ - changelog \ - control \ - gstreamer$(GST_API_VERSION)-vaapi-doc.install \ - gstreamer$(GST_API_VERSION)-vaapi.install \ - libgstvaapi$(GST_PKG_VERSION)-dev.install \ - libgstvaapi$(GST_VAAPI_MAJOR_VERSION).install \ - libgstvaapi-drm-$(GST_VAAPI_MAJOR_VERSION).install \ - libgstvaapi-glx-$(GST_VAAPI_MAJOR_VERSION).install \ - libgstvaapi-wayland-$(GST_VAAPI_MAJOR_VERSION).install \ - libgstvaapi-x11-$(GST_VAAPI_MAJOR_VERSION).install \ - $(NULL) - -EXTRA_DIST = $(DEBIANFILES) - -dist_noinst_DATA = $(DEBIANGENFILES) -DISTCLEANFILES = $(DEBIANGENFILES) - --include $(top_srcdir)/git.mk diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/Makefile.in gstreamer-vaapi-1.8.2/debian.upstream/Makefile.in --- gstreamer-vaapi-0.7.0/debian.upstream/Makefile.in 2015-12-07 10:54:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,580 +0,0 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2014 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -subdir = debian.upstream -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(dist_noinst_DATA) \ - $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = changelog control -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -DATA = $(dist_noinst_DATA) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/changelog.in \ - $(srcdir)/control.in $(srcdir)/gstreamer-vaapi-doc.install.in \ - $(srcdir)/gstreamer-vaapi.install.in \ - $(srcdir)/libgstvaapi-dev.install.in \ - $(srcdir)/libgstvaapi-drm.install.in \ - $(srcdir)/libgstvaapi-glx.install.in \ - $(srcdir)/libgstvaapi-wayland.install.in \ - $(srcdir)/libgstvaapi-x11.install.in \ - $(srcdir)/libgstvaapi.install.in -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DLOPEN_LIBS = @DLOPEN_LIBS@ -DRM_CFLAGS = @DRM_CFLAGS@ -DRM_LIBS = @DRM_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGL_CFLAGS = @EGL_CFLAGS@ -EGL_LIBS = @EGL_LIBS@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GIT = @GIT@ -GLES2_CFLAGS = @GLES2_CFLAGS@ -GLES2_LIBS = @GLES2_LIBS@ -GLES3_CFLAGS = @GLES3_CFLAGS@ -GLES3_LIBS = @GLES3_LIBS@ -GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_LIBS = @GLIB_LIBS@ -GLIB_VERSION_REQUIRED = @GLIB_VERSION_REQUIRED@ -GL_CFLAGS = @GL_CFLAGS@ -GL_LIBS = @GL_LIBS@ -GMODULE_CFLAGS = @GMODULE_CFLAGS@ -GMODULE_LIBS = @GMODULE_LIBS@ -GMODULE_VERSION_REQUIRED = @GMODULE_VERSION_REQUIRED@ -GREP = @GREP@ -GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ -GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ -GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ -GST_API_VERSION = @GST_API_VERSION@ -GST_BASEVIDEO_CFLAGS = @GST_BASEVIDEO_CFLAGS@ -GST_BASEVIDEO_LIBS = @GST_BASEVIDEO_LIBS@ -GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ -GST_BASE_LIBS = @GST_BASE_LIBS@ -GST_CFLAGS = @GST_CFLAGS@ -GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ -GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ -GST_GL_CFLAGS = @GST_GL_CFLAGS@ -GST_GL_LIBS = @GST_GL_LIBS@ -GST_INTERFACES_CFLAGS = @GST_INTERFACES_CFLAGS@ -GST_INTERFACES_LIBS = @GST_INTERFACES_LIBS@ -GST_LIBS = @GST_LIBS@ -GST_PKG_VERSION = @GST_PKG_VERSION@ -GST_PLUGINS_BAD_VERSION_REQUIRED = @GST_PLUGINS_BAD_VERSION_REQUIRED@ -GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ -GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ -GST_PLUGINS_BASE_VERSION_REQUIRED = @GST_PLUGINS_BASE_VERSION_REQUIRED@ -GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ -GST_PLUGIN_PATH_1_0 = @GST_PLUGIN_PATH_1_0@ -GST_VAAPI_LT_LDFLAGS = @GST_VAAPI_LT_LDFLAGS@ -GST_VAAPI_LT_VERSION = @GST_VAAPI_LT_VERSION@ -GST_VAAPI_MAJOR_VERSION = @GST_VAAPI_MAJOR_VERSION@ -GST_VERSION_REQUIRED = @GST_VERSION_REQUIRED@ -GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ -GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ -GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ -GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ -GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ -GTKDOC_MKPDF = @GTKDOC_MKPDF@ -GTKDOC_REBASE = @GTKDOC_REBASE@ -GTKDOC_VERSION = @GTKDOC_VERSION@ -HTML_DIR = @HTML_DIR@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBVA_CFLAGS = @LIBVA_CFLAGS@ -LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ -LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ -LIBVA_LIBS = @LIBVA_LIBS@ -LIBVA_PACKAGE_VERSION = @LIBVA_PACKAGE_VERSION@ -LIBVA_PKGNAME = @LIBVA_PKGNAME@ -LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ -LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ -LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ -LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ -LIBVA_X11_PKGNAME = @LIBVA_X11_PKGNAME@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATCH = @PATCH@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TODAY = @TODAY@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ -VERSION = @VERSION@ -WAYLAND_API_VERSION = @WAYLAND_API_VERSION@ -WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ -WAYLAND_LIBS = @WAYLAND_LIBS@ -X11_CFLAGS = @X11_CFLAGS@ -X11_LIBS = @X11_LIBS@ -XRANDR_CFLAGS = @XRANDR_CFLAGS@ -XRANDR_LIBS = @XRANDR_LIBS@ -XRENDER_CFLAGS = @XRENDER_CFLAGS@ -XRENDER_LIBS = @XRENDER_LIBS@ -YASM = @YASM@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ -plugindir = @plugindir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -DOCS = \ - AUTHORS \ - COPYING.LIB \ - NEWS \ - README \ - $(NULL) - -DEBIANFILES = \ - changelog.in \ - compat \ - control.in \ - copyright \ - gstreamer-vaapi-doc.install.in \ - gstreamer-vaapi.install.in \ - libgstvaapi-dev.install.in \ - libgstvaapi-drm.install.in \ - libgstvaapi-glx.install.in \ - libgstvaapi-wayland.install.in \ - libgstvaapi-x11.install.in \ - libgstvaapi.install.in \ - rules \ - $(NULL) - -DEBIANGENFILES = \ - changelog \ - control \ - gstreamer$(GST_API_VERSION)-vaapi-doc.install \ - gstreamer$(GST_API_VERSION)-vaapi.install \ - libgstvaapi$(GST_PKG_VERSION)-dev.install \ - libgstvaapi$(GST_VAAPI_MAJOR_VERSION).install \ - libgstvaapi-drm-$(GST_VAAPI_MAJOR_VERSION).install \ - libgstvaapi-glx-$(GST_VAAPI_MAJOR_VERSION).install \ - libgstvaapi-wayland-$(GST_VAAPI_MAJOR_VERSION).install \ - libgstvaapi-x11-$(GST_VAAPI_MAJOR_VERSION).install \ - $(NULL) - -EXTRA_DIST = $(DEBIANFILES) -dist_noinst_DATA = $(DEBIANGENFILES) -DISTCLEANFILES = $(DEBIANGENFILES) -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu debian.upstream/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu debian.upstream/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -changelog: $(top_builddir)/config.status $(srcdir)/changelog.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -control: $(top_builddir)/config.status $(srcdir)/control.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -tags TAGS: - -ctags CTAGS: - -cscope cscopelist: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(DATA) -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: install-am install-strip - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - cscopelist-am ctags-am distclean distclean-generic \ - distclean-libtool distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags-am uninstall uninstall-am - -.PRECIOUS: Makefile - - --include $(top_srcdir)/git.mk - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru gstreamer-vaapi-0.7.0/debian.upstream/rules gstreamer-vaapi-1.8.2/debian.upstream/rules --- gstreamer-vaapi-0.7.0/debian.upstream/rules 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/debian.upstream/rules 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -#!/usr/bin/make -f - -include /usr/share/cdbs/1/rules/debhelper.mk -include /usr/share/cdbs/1/class/autotools.mk -include /usr/share/cdbs/1/rules/simple-patchsys.mk -include /usr/share/cdbs/1/rules/utils.mk - -# Allow HTML documentation build -indep_conf_flags = \ - --with-html-dir=\$${prefix}/share/doc/$(DEB_SOURCE_PACKAGE) - -# only build the docs if gtk-doc-tools is installed, i.e. binary-indep is -# called -ifeq ($(shell test "`dpkg -l gtk-doc-tools | grep ^ii`" && echo binary-indep),binary-indep) -indep_conf_flags += --enable-gtk-doc -endif - -DEB_CONFIGURE_EXTRA_FLAGS += $(indep_conf_flags) diff -Nru gstreamer-vaapi-0.7.0/docs/Makefile.am gstreamer-vaapi-1.8.2/docs/Makefile.am --- gstreamer-vaapi-0.7.0/docs/Makefile.am 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/Makefile.am 2016-03-24 11:36:59.000000000 +0000 @@ -1,9 +1,19 @@ -SUBDIRS = - if ENABLE_GTK_DOC -SUBDIRS += reference +if ENABLE_PLUGIN_DOCS +PLUGIN_DOCS_DIRS = plugins +else +PLUGIN_DOCS_DIRS = +endif +else +PLUGIN_DOCS_DIRS = plugins endif -DIST_SUBDIRS = reference +SUBDIRS = $(PLUGIN_DOCS_DIRS) +DIST_SUBDIRS = plugins + +EXTRA_DIST = version.entities.in + +upload: + @if test "x$(SUBDIRS)" != x; then for a in $(SUBDIRS); do cd $$a; make upload; cd ..; done; fi -include $(top_srcdir)/git.mk diff -Nru gstreamer-vaapi-0.7.0/docs/Makefile.in gstreamer-vaapi-1.8.2/docs/Makefile.in --- gstreamer-vaapi-0.7.0/docs/Makefile.in 2015-12-07 10:54:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/Makefile.in 2016-06-09 07:27:12.000000000 +0000 @@ -88,19 +88,35 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -@ENABLE_GTK_DOC_TRUE@am__append_1 = reference subdir = docs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-arch.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-platform.m4 \ + $(top_srcdir)/common/m4/gst-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = version.entities CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -156,7 +172,7 @@ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags -am__DIST_COMMON = $(srcdir)/Makefile.in +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/version.entities.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -184,9 +200,11 @@ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ +AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -199,6 +217,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DRM_CFLAGS = @DRM_CFLAGS@ @@ -211,58 +230,64 @@ EGL_CFLAGS = @EGL_CFLAGS@ EGL_LIBS = @EGL_LIBS@ EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ GIT = @GIT@ GLES2_CFLAGS = @GLES2_CFLAGS@ GLES2_LIBS = @GLES2_LIBS@ GLES3_CFLAGS = @GLES3_CFLAGS@ GLES3_LIBS = @GLES3_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ -GLIB_VERSION_REQUIRED = @GLIB_VERSION_REQUIRED@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ -GMODULE_VERSION_REQUIRED = @GMODULE_VERSION_REQUIRED@ GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ GST_API_VERSION = @GST_API_VERSION@ -GST_BASEVIDEO_CFLAGS = @GST_BASEVIDEO_CFLAGS@ -GST_BASEVIDEO_LIBS = @GST_BASEVIDEO_LIBS@ GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ GST_BASE_LIBS = @GST_BASE_LIBS@ GST_CFLAGS = @GST_CFLAGS@ GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ +GST_CURRENT = @GST_CURRENT@ GST_GL_CFLAGS = @GST_GL_CFLAGS@ GST_GL_LIBS = @GST_GL_LIBS@ -GST_INTERFACES_CFLAGS = @GST_INTERFACES_CFLAGS@ -GST_INTERFACES_LIBS = @GST_INTERFACES_LIBS@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ GST_LIBS = @GST_LIBS@ -GST_PKG_VERSION = @GST_PKG_VERSION@ -GST_PLUGINS_BAD_VERSION_REQUIRED = @GST_PLUGINS_BAD_VERSION_REQUIRED@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PBUTILS_CFLAGS = @GST_PBUTILS_CFLAGS@ +GST_PBUTILS_LIBS = @GST_PBUTILS_LIBS@ GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ -GST_PLUGINS_BASE_VERSION_REQUIRED = @GST_PLUGINS_BASE_VERSION_REQUIRED@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ -GST_PLUGIN_PATH_1_0 = @GST_PLUGIN_PATH_1_0@ -GST_VAAPI_LT_LDFLAGS = @GST_VAAPI_LT_LDFLAGS@ -GST_VAAPI_LT_VERSION = @GST_VAAPI_LT_VERSION@ -GST_VAAPI_MAJOR_VERSION = @GST_VAAPI_MAJOR_VERSION@ -GST_VERSION_REQUIRED = @GST_VERSION_REQUIRED@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ -GTKDOC_VERSION = @GTKDOC_VERSION@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -271,6 +296,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -278,16 +304,15 @@ LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ LIBVA_LIBS = @LIBVA_LIBS@ -LIBVA_PACKAGE_VERSION = @LIBVA_PACKAGE_VERSION@ -LIBVA_PKGNAME = @LIBVA_PKGNAME@ LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ -LIBVA_X11_PKGNAME = @LIBVA_X11_PKGNAME@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -304,21 +329,27 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ -PATCH = @PATCH@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ -TODAY = @TODAY@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ VERSION = @VERSION@ -WAYLAND_API_VERSION = @WAYLAND_API_VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ WAYLAND_LIBS = @WAYLAND_LIBS@ X11_CFLAGS = @X11_CFLAGS@ @@ -327,7 +358,6 @@ XRANDR_LIBS = @XRANDR_LIBS@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ -YASM = @YASM@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -369,11 +399,15 @@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ plugindir = @plugindir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -386,12 +420,16 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = $(am__append_1) -DIST_SUBDIRS = reference +@ENABLE_GTK_DOC_FALSE@PLUGIN_DOCS_DIRS = plugins +@ENABLE_GTK_DOC_TRUE@@ENABLE_PLUGIN_DOCS_FALSE@PLUGIN_DOCS_DIRS = +@ENABLE_GTK_DOC_TRUE@@ENABLE_PLUGIN_DOCS_TRUE@PLUGIN_DOCS_DIRS = plugins +SUBDIRS = $(PLUGIN_DOCS_DIRS) +DIST_SUBDIRS = plugins +EXTRA_DIST = version.entities.in all: all-recursive .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -415,11 +453,13 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +version.entities: $(top_builddir)/config.status $(srcdir)/version.entities.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo @@ -700,6 +740,9 @@ .PRECIOUS: Makefile +upload: + @if test "x$(SUBDIRS)" != x; then for a in $(SUBDIRS); do cd $$a; make upload; cd ..; done; fi + -include $(top_srcdir)/git.mk # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/gstreamer-vaapi-plugins.args gstreamer-vaapi-1.8.2/docs/plugins/gstreamer-vaapi-plugins.args --- gstreamer-vaapi-0.7.0/docs/plugins/gstreamer-vaapi-plugins.args 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/gstreamer-vaapi-plugins.args 2016-03-24 11:57:06.000000000 +0000 @@ -0,0 +1,690 @@ + +GstVaapiEncodeVP8::bitrate +guint +<= 102400 +rw +Bitrate (kbps) +The desired bitrate expressed in kbps (0: auto-calculate). +0 + + + +GstVaapiEncodeVP8::keyframe-period +guint +[1,300] +rw +Keyframe Period +Maximal distance between two keyframes (0: auto-calculate). +30 + + + +GstVaapiEncodeVP8::loop-filter-level +guint +<= 63 +rw +Loop Filter Level +Controls the deblocking filter strength. +0 + + + +GstVaapiEncodeVP8::rate-control +GstVaapiRateControlVP8 + +rw +Rate Control +Rate control mode. +Constant QP + + + +GstVaapiEncodeVP8::sharpness-level +guint +<= 7 +rw +Sharpness Level +Controls the deblocking filter sensitivity. +0 + + + +GstVaapiEncodeVP8::tune +GstVaapiEncoderTuneVP8 + +rw +Encoder Tuning +Encoder tuning option. +None + + + +GstVaapiEncodeVP8::yac-qi +guint +<= 127 +rw +Luma AC Quant Table index +Quantization Table index for Luma AC Coefficients, (in default case, yac_qi=4 for key frames and yac_qi=40 for P frames). +40 + + + +GstVaapiSink::brightness +gfloat +[-1,1] +rwx +brightness +The display brightness value. +0 + + + +GstVaapiSink::contrast +gfloat +[0,2] +rwx +contrast +The display contrast value. +1 + + + +GstVaapiSink::display +GstVaapiDisplayType + +rw +display type +display type to use. +Auto detection + + + +GstVaapiSink::display-name +gchar* + +rw +display name +display name to use. +NULL + + + +GstVaapiSink::force-aspect-ratio +gboolean + +rw +Force aspect ratio +When enabled, scaling will respect original aspect ratio. +TRUE + + + +GstVaapiSink::fullscreen +gboolean + +rw +Fullscreen +Requests window in fullscreen state. +FALSE + + + +GstVaapiSink::hue +gfloat +[-180,180] +rwx +hue +The display hue value. +0 + + + +GstVaapiSink::rotation +GstVaapiRotation + +rw +rotation +The display rotation mode. +Unrotated mode + + + +GstVaapiSink::saturation +gfloat +[0,2] +rwx +saturation +The display saturation value. +1 + + + +GstVaapiSink::signal-handoffs +gboolean + +rw +Signal handoffs +Send a signal after rendering the buffer. +FALSE + + + +GstVaapiSink::view-id +gint +>= G_MAXULONG +rw +View ID +ID of the view component of interest to display. +-1 + + + +GstVaapiPostproc::brightness +gfloat +[-1,1] +rw +Brightness +The color brightness value. +0 + + + +GstVaapiPostproc::contrast +gfloat +[0,2] +rw +Contrast +The color contrast value. +1 + + + +GstVaapiPostproc::deinterlace-method +GstVaapiDeinterlaceMethod + +rw +Deinterlace method +Deinterlace method to use. +Bob deinterlacing + + + +GstVaapiPostproc::deinterlace-mode +GstVaapiDeinterlaceMode + +rw +Deinterlace mode +Deinterlace mode to use. +Auto detection + + + +GstVaapiPostproc::denoise +gfloat +[0,1] +rw +Denoising Level +The level of denoising to apply. +0 + + + +GstVaapiPostproc::force-aspect-ratio +gboolean + +rw +Force aspect ratio +When enabled, scaling will respect original aspect ratio. +TRUE + + + +GstVaapiPostproc::format +GstVideoFormat + +rw +Format +The forced output pixel format. +GST_VIDEO_FORMAT_UNKNOWN + + + +GstVaapiPostproc::height +guint +<= G_MAXINT +rw +Height +Forced output height. +0 + + + +GstVaapiPostproc::hue +gfloat +[-180,180] +rw +Hue +The color hue value. +0 + + + +GstVaapiPostproc::saturation +gfloat +[0,2] +rw +Saturation +The color saturation value. +1 + + + +GstVaapiPostproc::scale-method +GstVaapiScaleMethod + +rw +Scaling Method +Scaling method to use. +Default scaling mode + + + +GstVaapiPostproc::sharpen +gfloat +[-1,1] +rw +Sharpening Level +The level of sharpening/blurring to apply. +0 + + + +GstVaapiPostproc::skin-tone-enhancement +gboolean + +rw +Skin tone enhancement +Apply the skin tone enhancement algorithm. +FALSE + + + +GstVaapiPostproc::width +guint +<= G_MAXINT +rw +Width +Forced output width. +0 + + + +GstVaapiEncodeMpeg2::bitrate +guint +<= 102400 +rw +Bitrate (kbps) +The desired bitrate expressed in kbps (0: auto-calculate). +0 + + + +GstVaapiEncodeMpeg2::keyframe-period +guint +[1,300] +rw +Keyframe Period +Maximal distance between two keyframes (0: auto-calculate). +30 + + + +GstVaapiEncodeMpeg2::max-bframes +guint +<= 16 +rw +Max B-Frames +Number of B-frames between I and P. +0 + + + +GstVaapiEncodeMpeg2::quantizer +guint +[2,62] +rw +Constant Quantizer +Constant quantizer (if rate-control mode is CQP). +8 + + + +GstVaapiEncodeMpeg2::rate-control +GstVaapiRateControlMPEG2 + +rw +Rate Control +Rate control mode. +Constant QP + + + +GstVaapiEncodeMpeg2::tune +GstVaapiEncoderTuneMPEG2 + +rw +Encoder Tuning +Encoder tuning option. +None + + + +GstVaapiEncodeJpeg::bitrate +guint +<= 102400 +rw +Bitrate (kbps) +The desired bitrate expressed in kbps (0: auto-calculate). +0 + + + +GstVaapiEncodeJpeg::keyframe-period +guint +[1,300] +rw +Keyframe Period +Maximal distance between two keyframes (0: auto-calculate). +30 + + + +GstVaapiEncodeJpeg::quality +guint +<= 100 +rw +Quality factor +Quality factor. +50 + + + +GstVaapiEncodeJpeg::rate-control +GstVaapiRateControlJPEG + +rw +Rate Control +Rate control mode. +None + + + +GstVaapiEncodeJpeg::tune +GstVaapiEncoderTuneJPEG + +rw +Encoder Tuning +Encoder tuning option. +None + + + +GstVaapiEncodeH265::bitrate +guint +<= 102400 +rw +Bitrate (kbps) +The desired bitrate expressed in kbps (0: auto-calculate). +0 + + + +GstVaapiEncodeH265::init-qp +guint +[1,51] +rw +Initial QP +Initial quantizer value. +26 + + + +GstVaapiEncodeH265::keyframe-period +guint +[1,300] +rw +Keyframe Period +Maximal distance between two keyframes (0: auto-calculate). +30 + + + +GstVaapiEncodeH265::max-bframes +guint +<= 10 +rw +Max B-Frames +Number of B-frames between I and P. +0 + + + +GstVaapiEncodeH265::min-qp +guint +[1,51] +rw +Minimum QP +Minimum quantizer value. +1 + + + +GstVaapiEncodeH265::num-slices +guint +[1,200] +rw +Number of Slices +Number of slices per frame. +1 + + + +GstVaapiEncodeH265::rate-control +GstVaapiRateControlH265 + +rw +Rate Control +Rate control mode. +Constant QP + + + +GstVaapiEncodeH265::tune +GstVaapiEncoderTuneH265 + +rw +Encoder Tuning +Encoder tuning option. +None + + + +GstVaapiEncodeH264::bitrate +guint +<= 102400 +rw +Bitrate (kbps) +The desired bitrate expressed in kbps (0: auto-calculate). +0 + + + +GstVaapiEncodeH264::cabac +gboolean + +rw +Enable CABAC +Enable CABAC entropy coding mode. +FALSE + + + +GstVaapiEncodeH264::cpb-length +guint +[1,10000] +rw +CPB Length +Length of the CPB buffer in milliseconds. +1500 + + + +GstVaapiEncodeH264::dct8x8 +gboolean + +rw +Enable 8x8 DCT +Enable adaptive use of 8x8 transforms in I-frames. +FALSE + + + +GstVaapiEncodeH264::init-qp +guint +[1,51] +rw +Initial QP +Initial quantizer value. +26 + + + +GstVaapiEncodeH264::keyframe-period +guint +[1,300] +rw +Keyframe Period +Maximal distance between two keyframes (0: auto-calculate). +30 + + + +GstVaapiEncodeH264::max-bframes +guint +<= 10 +rw +Max B-Frames +Number of B-frames between I and P. +0 + + + +GstVaapiEncodeH264::min-qp +guint +[1,51] +rw +Minimum QP +Minimum quantizer value. +1 + + + +GstVaapiEncodeH264::num-slices +guint +[1,200] +rw +Number of Slices +Number of slices per frame. +1 + + + +GstVaapiEncodeH264::num-views +guint +[1,10] +rw +Number of Views +Number of Views for MVC encoding. +1 + + + +GstVaapiEncodeH264::rate-control +GstVaapiRateControlH264 + +rw +Rate Control +Rate control mode. +Constant QP + + + +GstVaapiEncodeH264::tune +GstVaapiEncoderTuneH264 + +rw +Encoder Tuning +Encoder tuning option. +None + + + +GstVaapiEncodeH264::view-ids +GValueArray* + +rw +View IDs +Set of View Ids used for MVC encoding. + + + + +GstVaapiDecodeBin::deinterlace-method +GstVaapiDeinterlaceMethod + +rw +Deinterlace method +Deinterlace method to use. +Bob deinterlacing + + + +GstVaapiDecodeBin::disable-vpp +gboolean + +rw +Disable VPP +Disable Video Post Processing (No support for run time disabling). +FALSE + + + +GstVaapiDecodeBin::max-size-buffers +guint + +rw +Max. size (buffers) +Max. number of buffers in the queue (0=disable). +0 + + + +GstVaapiDecodeBin::max-size-bytes +guint + +rw +Max. size (kB) +Max. amount of data in the queue (bytes, 0=disable). +0 + + + +GstVaapiDecodeBin::max-size-time +guint64 + +rw +Max. size (ns) +Max. amount of data in the queue (in ns, 0=disable). +0 + + diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/gstreamer-vaapi-plugins-docs.xml gstreamer-vaapi-1.8.2/docs/plugins/gstreamer-vaapi-plugins-docs.xml --- gstreamer-vaapi-0.7.0/docs/plugins/gstreamer-vaapi-plugins-docs.xml 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/gstreamer-vaapi-plugins-docs.xml 2016-06-09 07:27:15.000000000 +0000 @@ -0,0 +1,41 @@ + + +]> + + + GStreamer VA-API Plugins 1.0 Plugins Reference Manual + + + + gstreamer-vaapi Elements + + + + + + + + + + + + + gstreamer-vaapi Plugins + + + + + Object Hierarchy + + + + + API Index + + + + + diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/gstreamer-vaapi-plugins-docs.xml.in gstreamer-vaapi-1.8.2/docs/plugins/gstreamer-vaapi-plugins-docs.xml.in --- gstreamer-vaapi-0.7.0/docs/plugins/gstreamer-vaapi-plugins-docs.xml.in 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/gstreamer-vaapi-plugins-docs.xml.in 2016-03-24 11:36:59.000000000 +0000 @@ -0,0 +1,41 @@ + + +]> + + + GStreamer VA-API Plugins @GST_API_VERSION@ Plugins Reference Manual + + + + gstreamer-vaapi Elements + + + + + + + + + + + + + gstreamer-vaapi Plugins + + + + + Object Hierarchy + + + + + API Index + + + + + diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/gstreamer-vaapi-plugins.hierarchy gstreamer-vaapi-1.8.2/docs/plugins/gstreamer-vaapi-plugins.hierarchy --- gstreamer-vaapi-0.7.0/docs/plugins/gstreamer-vaapi-plugins.hierarchy 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/gstreamer-vaapi-plugins.hierarchy 2016-06-09 07:27:25.000000000 +0000 @@ -0,0 +1,48 @@ +GObject + GInitiallyUnowned + GstObject + GstAllocator + GstAllocatorSysmem + GstBus + GstClock + GstControlBinding + GstControlSource + GstElement + GstBaseSink + GstVideoSink + GstVaapiSink + GstBaseTransform + GstVaapiPostproc + GstBin + GstPipeline + GstVaapiDecodeBin + GstVideoDecoder + GstVaapiDecode + GstVaapiDecode_jpeg + GstVideoEncoder + GstVaapiEncode + GstVaapiEncodeH264 + GstVaapiEncodeH265 + GstVaapiEncodeJpeg + GstVaapiEncodeMpeg2 + GstVaapiEncodeVP8 + GstPad + GstPadTemplate + GstPlugin + GstPluginFeature + GstDeviceProviderFactory + GstElementFactory + GstTracerFactory + GstTypeFindFactory + GstRegistry + GstTask + GstTaskPool + GstColorBalanceChannel +GInterface + GTypePlugin + GstChildProxy + GstColorBalance + GstNavigation + GstPreset + GstURIHandler + GstVideoOverlay diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/gstreamer-vaapi-plugins.interfaces gstreamer-vaapi-1.8.2/docs/plugins/gstreamer-vaapi-plugins.interfaces --- gstreamer-vaapi-0.7.0/docs/plugins/gstreamer-vaapi-plugins.interfaces 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/gstreamer-vaapi-plugins.interfaces 2016-03-24 11:57:06.000000000 +0000 @@ -0,0 +1,12 @@ +GstBin GstChildProxy +GstPipeline GstChildProxy +GstVaapiDecodeBin GstChildProxy +GstVaapiEncode GstPreset +GstVaapiEncodeH264 GstPreset +GstVaapiEncodeH265 GstPreset +GstVaapiEncodeJpeg GstPreset +GstVaapiEncodeMpeg2 GstPreset +GstVaapiEncodeVP8 GstPreset +GstVaapiPostproc GstColorBalance +GstVaapiSink GstVideoOverlay GstColorBalance GstNavigation +GstVideoEncoder GstPreset diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/gstreamer-vaapi-plugins.prerequisites gstreamer-vaapi-1.8.2/docs/plugins/gstreamer-vaapi-plugins.prerequisites --- gstreamer-vaapi-0.7.0/docs/plugins/gstreamer-vaapi-plugins.prerequisites 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/gstreamer-vaapi-plugins.prerequisites 2016-03-24 11:57:06.000000000 +0000 @@ -0,0 +1 @@ +GstChildProxy GObject diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/gstreamer-vaapi-plugins-sections.txt gstreamer-vaapi-1.8.2/docs/plugins/gstreamer-vaapi-plugins-sections.txt --- gstreamer-vaapi-0.7.0/docs/plugins/gstreamer-vaapi-plugins-sections.txt 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/gstreamer-vaapi-plugins-sections.txt 2016-06-09 08:37:50.000000000 +0000 @@ -0,0 +1,135 @@ +
+element-vaapidecode +vaapidecode + +GST_IS_VAAPIDECODE +GST_IS_VAAPIDECODE_CLASS +GST_TYPE_VAAPIDECODE +GST_VAAPIDECODE +GST_VAAPIDECODE_CLASS +GST_VAAPIDECODE_GET_CLASS +GstVaapiDecode +GstVaapiDecodeClass +gst_vaapidecode_get_type +
+ +
+element-vaapidecodebin +vaapidecodebin + +GST_IS_AUTO_DETECT +GST_IS_AUTO_DETECT_CLASS +GST_TYPE_VAAPI_DECODE_BIN +GST_VAAPI_DECODE_BIN +GST_VAAPI_DECODE_BIN_CLASS +GST_VAAPI_DECODE_BIN_GET_CLASS +GstVaapiDecodeBin +GstVaapiDecodeBinClass +gst_vaapi_decode_bin_get_type +
+ +
+element-vaapipostproc +vaapipostproc +GstVaapiDeinterlaceMode + +GST_IS_VAAPIPOSTPROC +GST_IS_VAAPIPOSTPROC_CLASS +GST_TYPE_VAAPIPOSTPROC +GST_VAAPIPOSTPROC +GST_VAAPIPOSTPROC_CLASS +GST_VAAPIPOSTPROC_GET_CLASS +GstVaapiPostproc +GstVaapiPostprocClass +gst_vaapipostproc_get_type +
+ +
+element-vaapisink +vaapisink + +GST_IS_VAAPISINK +GST_IS_VAAPISINK_CLASS +GST_TYPE_VAAPISINK +GST_VAAPISINK +GST_VAAPISINK_CLASS +GST_VAAPISINK_GET_CLASS +GstVaapiSink +GstVaapiSinkClass +gst_vaapisink_get_type +
+ +
+element-vaapih264enc +vaapih264enc + +GST_IS_VAAPIENCODE_H264 +GST_IS_VAAPIENCODE_H264_CLASS +GST_TYPE_VAAPIENCODE_H264 +GST_VAAPIENCODE_H264 +GST_VAAPIENCODE_H264_CLASS +GST_VAAPIENCODE_H264_GET_CLASS +GstVaapiEncodeH264 +GstVaapiEncodeH264Class +gst_vaapiencode_h264_get_type +
+ +
+element-vaapih265enc +vaapih265enc + +GST_IS_VAAPIENCODE_H265 +GST_IS_VAAPIENCODE_H265_CLASS +GST_TYPE_VAAPIENCODE_H265 +GST_VAAPIENCODE_H265 +GST_VAAPIENCODE_H265_CLASS +GST_VAAPIENCODE_H265_GET_CLASS +GstVaapiEncodeH265 +GstVaapiEncodeH265Class +gst_vaapiencode_h265_get_type +
+ +
+element-vaapijpegenc +vaapijpegenc + +GST_IS_VAAPIENCODE_JPEG +GST_IS_VAAPIENCODE_JPEG_CLASS +GST_TYPE_VAAPIENCODE_JPEG +GST_VAAPIENCODE_JPEG +GST_VAAPIENCODE_JPEG_CLASS +GST_VAAPIENCODE_JPEG_GET_CLASS +GstVaapiEncodeJpeg +GstVaapiEncodeJpegClass +gst_vaapiencode_jpeg_get_type +
+ +
+element-vaapimpeg2enc +vaapimpeg2enc + +GST_IS_VAAPIENCODE_MPEG2 +GST_IS_VAAPIENCODE_MPEG2_CLASS +GST_TYPE_VAAPIENCODE_MPEG2 +GST_VAAPIENCODE_MPEG2 +GST_VAAPIENCODE_MPEG2_CLASS +GST_VAAPIENCODE_MPEG2_GET_CLASS +GstVaapiEncodeMpeg2 +GstVaapiEncodeMpeg2Class +gst_vaapiencode_mpeg2_get_type +
+ +
+element-vaapivp8enc +vaapivp8enc + +GST_IS_VAAPIENCODE_VP8 +GST_IS_VAAPIENCODE_VP8_CLASS +GST_TYPE_VAAPIENCODE_VP8 +GST_VAAPIENCODE_VP8 +GST_VAAPIENCODE_VP8_CLASS +GST_VAAPIENCODE_VP8_GET_CLASS +GstVaapiEncodeVP8 +GstVaapiEncodeVP8Class +gst_vaapiencode_vp8_get_type +
diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/gstreamer-vaapi-plugins.signals gstreamer-vaapi-1.8.2/docs/plugins/gstreamer-vaapi-plugins.signals --- gstreamer-vaapi-0.7.0/docs/plugins/gstreamer-vaapi-plugins.signals 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/gstreamer-vaapi-plugins.signals 2016-03-24 11:57:06.000000000 +0000 @@ -0,0 +1,8 @@ + +GstVaapiSink::handoff +void +l +GstVaapiSink *gstvaapisink +GstBuffer *arg1 + + diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/html/api-index-full.html gstreamer-vaapi-1.8.2/docs/plugins/html/api-index-full.html --- gstreamer-vaapi-0.7.0/docs/plugins/html/api-index-full.html 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/html/api-index-full.html 2016-06-09 08:37:50.000000000 +0000 @@ -0,0 +1,316 @@ + + + + +API Index: GStreamer VA-API Plugins 1.0 Plugins Reference Manual + + + + + + + + + + + + + + + +
+

+API Index

+

+
+GstVaapiEncodeH264:cabac, object property in vaapih264enc +
+
+

G

+
+GstVaapiDecodeBin:deinterlace-method, object property in vaapidecodebin +
+
+
+GstVaapiDecodeBin:disable-vpp, object property in vaapidecodebin +
+
+
+GstVaapiDecodeBin:max-size-buffers, object property in vaapidecodebin +
+
+
+GstVaapiDecodeBin:max-size-bytes, object property in vaapidecodebin +
+
+
+GstVaapiDecodeBin:max-size-time, object property in vaapidecodebin +
+
+
+GstVaapiDeinterlaceMode, enum in vaapipostproc +
+
+
+GstVaapiEncodeH264:bitrate, object property in vaapih264enc +
+
+
+GstVaapiEncodeH264:cpb-length, object property in vaapih264enc +
+
+
+GstVaapiEncodeH264:dct8x8, object property in vaapih264enc +
+
+
+GstVaapiEncodeH264:init-qp, object property in vaapih264enc +
+
+
+GstVaapiEncodeH264:keyframe-period, object property in vaapih264enc +
+
+
+GstVaapiEncodeH264:max-bframes, object property in vaapih264enc +
+
+
+GstVaapiEncodeH264:min-qp, object property in vaapih264enc +
+
+
+GstVaapiEncodeH264:num-slices, object property in vaapih264enc +
+
+
+GstVaapiEncodeH264:num-views, object property in vaapih264enc +
+
+
+GstVaapiEncodeH264:rate-control, object property in vaapih264enc +
+
+
+GstVaapiEncodeH264:tune, object property in vaapih264enc +
+
+
+GstVaapiEncodeH264:view-ids, object property in vaapih264enc +
+
+
+GstVaapiEncodeH265:bitrate, object property in vaapih265enc +
+
+
+GstVaapiEncodeH265:init-qp, object property in vaapih265enc +
+
+
+GstVaapiEncodeH265:keyframe-period, object property in vaapih265enc +
+
+
+GstVaapiEncodeH265:max-bframes, object property in vaapih265enc +
+
+
+GstVaapiEncodeH265:min-qp, object property in vaapih265enc +
+
+
+GstVaapiEncodeH265:num-slices, object property in vaapih265enc +
+
+
+GstVaapiEncodeH265:rate-control, object property in vaapih265enc +
+
+
+GstVaapiEncodeH265:tune, object property in vaapih265enc +
+
+
+GstVaapiEncodeJpeg:bitrate, object property in vaapijpegenc +
+
+
+GstVaapiEncodeJpeg:keyframe-period, object property in vaapijpegenc +
+
+
+GstVaapiEncodeJpeg:quality, object property in vaapijpegenc +
+
+
+GstVaapiEncodeJpeg:rate-control, object property in vaapijpegenc +
+
+
+GstVaapiEncodeJpeg:tune, object property in vaapijpegenc +
+
+
+GstVaapiEncodeMpeg2:bitrate, object property in vaapimpeg2enc +
+
+
+GstVaapiEncodeMpeg2:keyframe-period, object property in vaapimpeg2enc +
+
+
+GstVaapiEncodeMpeg2:max-bframes, object property in vaapimpeg2enc +
+
+
+GstVaapiEncodeMpeg2:quantizer, object property in vaapimpeg2enc +
+
+
+GstVaapiEncodeMpeg2:rate-control, object property in vaapimpeg2enc +
+
+
+GstVaapiEncodeMpeg2:tune, object property in vaapimpeg2enc +
+
+
+GstVaapiEncodeVP8:bitrate, object property in vaapivp8enc +
+
+
+GstVaapiEncodeVP8:keyframe-period, object property in vaapivp8enc +
+
+
+GstVaapiEncodeVP8:loop-filter-level, object property in vaapivp8enc +
+
+
+GstVaapiEncodeVP8:rate-control, object property in vaapivp8enc +
+
+
+GstVaapiEncodeVP8:sharpness-level, object property in vaapivp8enc +
+
+
+GstVaapiEncodeVP8:tune, object property in vaapivp8enc +
+
+
+GstVaapiEncodeVP8:yac-qi, object property in vaapivp8enc +
+
+
+GstVaapiPostproc:brightness, object property in vaapipostproc +
+
+
+GstVaapiPostproc:contrast, object property in vaapipostproc +
+
+
+GstVaapiPostproc:deinterlace-method, object property in vaapipostproc +
+
+
+GstVaapiPostproc:deinterlace-mode, object property in vaapipostproc +
+
+
+GstVaapiPostproc:denoise, object property in vaapipostproc +
+
+
+GstVaapiPostproc:force-aspect-ratio, object property in vaapipostproc +
+
+
+GstVaapiPostproc:format, object property in vaapipostproc +
+
+
+GstVaapiPostproc:height, object property in vaapipostproc +
+
+
+GstVaapiPostproc:hue, object property in vaapipostproc +
+
+
+GstVaapiPostproc:saturation, object property in vaapipostproc +
+
+
+GstVaapiPostproc:scale-method, object property in vaapipostproc +
+
+
+GstVaapiPostproc:sharpen, object property in vaapipostproc +
+
+
+GstVaapiPostproc:skin-tone-enhancement, object property in vaapipostproc +
+
+
+GstVaapiPostproc:width, object property in vaapipostproc +
+
+
+GstVaapiSink::handoff, object signal in vaapisink +
+
+
+GstVaapiSink:brightness, object property in vaapisink +
+
+
+GstVaapiSink:contrast, object property in vaapisink +
+
+
+GstVaapiSink:display, object property in vaapisink +
+
+
+GstVaapiSink:display-name, object property in vaapisink +
+
+
+GstVaapiSink:force-aspect-ratio, object property in vaapisink +
+
+
+GstVaapiSink:fullscreen, object property in vaapisink +
+
+
+GstVaapiSink:hue, object property in vaapisink +
+
+
+GstVaapiSink:rotation, object property in vaapisink +
+
+
+GstVaapiSink:saturation, object property in vaapisink +
+
+
+GstVaapiSink:signal-handoffs, object property in vaapisink +
+
+
+GstVaapiSink:view-id, object property in vaapisink +
+
+
+ + + \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/html/ch01.html gstreamer-vaapi-1.8.2/docs/plugins/html/ch01.html --- gstreamer-vaapi-0.7.0/docs/plugins/html/ch01.html 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/html/ch01.html 2016-06-09 08:37:50.000000000 +0000 @@ -0,0 +1,59 @@ + + + + +gstreamer-vaapi Elements: GStreamer VA-API Plugins 1.0 Plugins Reference Manual + + + + + + + + + + + + + + + + +
+

+gstreamer-vaapi Elements

+
+
+vaapidecode — A VA-API based video decoder +
+
+vaapidecodebin — A VA-API based video decoder with a +post-processor +
+
+vaapipostproc — A VA-API base video postprocessing filter +
+
+vaapisink — A VA-API based video sink +
+
+vaapih264enc — A VA-API based H.264 video encoder +
+
+vaapih265enc — A VA-API based HEVC video encoder +
+
+vaapijpegenc — A VA-API based JPEG image encoder +
+
+vaapimpeg2enc — A VA-API based MPEG2 video encoder +
+
+vaapivp8enc — A VA-API based VP8 video encoder +
+
+
+ + + \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/html/ch02.html gstreamer-vaapi-1.8.2/docs/plugins/html/ch02.html --- gstreamer-vaapi-0.7.0/docs/plugins/html/ch02.html 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/html/ch02.html 2016-06-09 08:37:50.000000000 +0000 @@ -0,0 +1,32 @@ + + + + +gstreamer-vaapi Plugins: GStreamer VA-API Plugins 1.0 Plugins Reference Manual + + + + + + + + + + + + + + + + +
+

+gstreamer-vaapi Plugins

+
+vaapi — VA-API based elements +
+
+ + + \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-1.0.devhelp2 gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-1.0.devhelp2 --- gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-1.0.devhelp2 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-1.0.devhelp2 2016-06-09 08:37:50.000000000 +0000 @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-plugin-vaapi.html gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-plugin-vaapi.html --- gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-plugin-vaapi.html 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-plugin-vaapi.html 2016-06-09 08:37:50.000000000 +0000 @@ -0,0 +1,117 @@ + + + + +vaapi: GStreamer VA-API Plugins 1.0 Plugins Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

vaapi

+

vaapi — VA-API based elements

+
+
+

Plugin Information

+
++++ + + + + + + + + + + + + + + + + + + + + + + +

filename

libgstvaapi.so

version

1.8.2

run-time license

LGPL

package

gstreamer-vaapi

origin

http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer
+
+
+

Elements

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

vaapidecode

A VA-API based video decoder

vaapidecodebin

A VA-API based bin with a decoder and a postprocessor

vaapih264enc

A VA-API based H.264 video encoder

vaapih265enc

A VA-API based H.265 video encoder

vaapijpegdec

A VA-API based video decoder

vaapijpegenc

A VA-API based JPEG video encoder

vaapimpeg2enc

A VA-API based MPEG-2 video encoder

vaapipostproc

A VA-API video postprocessing filter

vaapisink

A VA-API based videosink

vaapivp8enc

A VA-API based VP8 video encoder
+
+
+ + + \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-vaapidecodebin.html gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-vaapidecodebin.html --- gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-vaapidecodebin.html 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-vaapidecodebin.html 2016-06-09 08:37:50.000000000 +0000 @@ -0,0 +1,279 @@ + + + + +vaapidecodebin: GStreamer VA-API Plugins 1.0 Plugins Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

vaapidecodebin

+

vaapidecodebin — A VA-API based video decoder with a +post-processor

+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
GstVaapiDeinterlaceMethoddeinterlace-methodRead / Write
gbooleandisable-vppRead / Write
guintmax-size-buffersRead / Write
guintmax-size-bytesRead / Write
guint64max-size-timeRead / Write
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GInitiallyUnowned
+        ╰── GstObject
+            ╰── GstElement
+                ╰── GstBin
+                    ╰── GstVaapiDecodeBin
+
+
+
+

Description

+

vaapidecodebin is similar GstVaapiDecode, but it is composed by +the vaapidecode, a GstQueue, and the GstVaapiPostproc, if it is +available and functional in the setup.

+

It offers the functionality of GstVaapiDecode and the many options +of GstVaapiPostproc.

+
+

Example launch line

+
+ + + + + + + +
1
gst-launch-1.0 filesrc location=~/big_buck_bunny.mov ! qtdemux ! h264parse ! vaapidecodebin ! vaapisink
+
+ +
+
+

Synopsis

+
+

Element Information

+
++++ + + + + + + + + + + + + + + +

plugin

+ vaapi +

author

Sreerenj Balachandran <sreerenj.balachandran@intel.com>, Victor Jaquez <victorx.jaquez@intel.com>

class

Codec/Decoder/Video
+
+
+
+

Element Pads

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

name

sink

direction

sink

presence

always

details

video/mpeg, mpegversion=(int)2, systemstream=(boolean)false

video/mpeg, mpegversion=(int)4

video/x-divx

video/x-xvid

video/x-h263

video/x-h264

video/x-h265

video/x-wmv

video/x-vp8
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +

name

src

direction

source

presence

always

details

video/x-raw(memory:VASurface), format=(string){ ENCODED, I420, YV12, NV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive

video/x-raw(meta:GstVideoGLTextureUploadMeta), format=(string){ RGBA, BGRA }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive

video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive
+
+
+
+
+

Functions

+

+
+
+

Types and Values

+
+
+

Property Details

+
+

The “deinterlace-method” property

+
  “deinterlace-method”       GstVaapiDeinterlaceMethod
+

Deinterlace method to use.

+

Flags: Read / Write

+

Default value: Bob deinterlacing

+
+
+
+

The “disable-vpp” property

+
  “disable-vpp”              gboolean
+

Disable Video Post Processing (No support for run time disabling).

+

Flags: Read / Write

+

Default value: FALSE

+
+
+
+

The “max-size-buffers” property

+
  “max-size-buffers”         guint
+

Max. number of buffers in the queue (0=disable).

+

Flags: Read / Write

+

Default value: 0

+
+
+
+

The “max-size-bytes” property

+
  “max-size-bytes”           guint
+

Max. amount of data in the queue (bytes, 0=disable).

+

Flags: Read / Write

+

Default value: 0

+
+
+
+

The “max-size-time” property

+
  “max-size-time”            guint64
+

Max. amount of data in the queue (in ns, 0=disable).

+

Flags: Read / Write

+

Default value: 0

+
+
+
+ + + \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-vaapidecode.html gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-vaapidecode.html --- gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-vaapidecode.html 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-vaapidecode.html 2016-06-09 08:37:50.000000000 +0000 @@ -0,0 +1,206 @@ + + + + +vaapidecode: GStreamer VA-API Plugins 1.0 Plugins Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

vaapidecode

+

vaapidecode — A VA-API based video decoder

+
+
+

Object Hierarchy

+
    GObject
+    ╰── GInitiallyUnowned
+        ╰── GstObject
+            ╰── GstElement
+                ╰── GstVideoDecoder
+                    ╰── GstVaapiDecode
+
+
+
+

Description

+

vaapidecode decodes from raw bitstreams to surfaces suitable for +the vaapisink or vaapipostproc elements using the installed VA-API +back-end.

+

In the case of OpenGL based elements, the buffers have the +GstVideoGLTextureUploadMeta meta, which efficiently copies the +content of the VA-API surface into a GL texture.

+

Also it can deliver normal video buffers that can be rendered or +processed by other elements, but the performance would be rather +bad.

+
+

Example launch line

+
+ + + + + + + +
1
gst-launch-1.0 filesrc location=~/big_buck_bunny.mov ! qtdemux ! h264parse ! vaapidecode ! vaapisink
+
+ +
+
+

Synopsis

+
+

Element Information

+
++++ + + + + + + + + + + + + + + +

plugin

+ vaapi +

author

Gwenole Beauchesne <gwenole.beauchesne@intel.com>, Halley Zhao <halley.zhao@intel.com>, Sreerenj Balachandran <sreerenj.balachandran@intel.com>, Wind Yuan <feng.yuan@intel.com>

class

Codec/Decoder/Video
+
+
+
+

Element Pads

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

name

sink

direction

sink

presence

always

details

video/mpeg, mpegversion=(int)2, systemstream=(boolean)false

video/mpeg, mpegversion=(int)4

video/x-divx

video/x-xvid

video/x-h263

video/x-h264

video/x-h265

video/x-wmv

video/x-vp8

video/x-vp9
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +

name

src

direction

source

presence

always

details

video/x-raw(memory:VASurface), format=(string){ ENCODED, I420, YV12, NV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]

video/x-raw(meta:GstVideoGLTextureUploadMeta), format=(string){ RGBA, BGRA }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]

video/x-raw, format=(string){ I420, YV12, NV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
+
+
+
+
+

Functions

+

+
+
+

Types and Values

+
+
+ + + \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-vaapih264enc.html gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-vaapih264enc.html --- gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-vaapih264enc.html 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-vaapih264enc.html 2016-06-09 08:37:50.000000000 +0000 @@ -0,0 +1,351 @@ + + + + +vaapih264enc: GStreamer VA-API Plugins 1.0 Plugins Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

vaapih264enc

+

vaapih264enc — A VA-API based H.264 video encoder

+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
guintbitrateRead / Write
gbooleancabacRead / Write
guintcpb-lengthRead / Write
gbooleandct8x8Read / Write
guintinit-qpRead / Write
guintkeyframe-periodRead / Write
guintmax-bframesRead / Write
guintmin-qpRead / Write
guintnum-slicesRead / Write
guintnum-viewsRead / Write
GstVaapiRateControlH264rate-controlRead / Write
GstVaapiEncoderTuneH264tuneRead / Write
+GValueArray *view-idsRead / Write
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GInitiallyUnowned
+        ╰── GstObject
+            ╰── GstElement
+                ╰── GstVideoEncoder
+                    ╰── GstVaapiEncode
+                        ╰── GstVaapiEncodeH264
+
+
+
+

Description

+

Encodes raw video streams into H.264 bitstreams.

+
+

Example launch line

+
+ + + + + + + +
1
gst-launch-1.0 -ev videotestsrc num-buffers=60 ! timeoverlay ! vaapih264enc ! mp4mux ! filesink location=test.mp4
+
+ +
+
+

Synopsis

+
+

Element Information

+
++++ + + + + + + + + + + + + + + +

plugin

+ vaapi +

author

Wind Yuan <feng.yuan@intel.com>

class

Codec/Encoder/Video
+
+
+
+

Element Pads

+
++++ + + + + + + + + + + + + + + + + + + + + + + +

name

sink

direction

sink

presence

always

details

video/x-raw(memory:VASurface), format=(string){ ENCODED, NV12, I420, YV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive

video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive
+
++++ + + + + + + + + + + + + + + + + + + +

name

src

direction

source

presence

always

details

video/x-h264, stream-format=(string){ avc, byte-stream }, alignment=(string)au, profile=(string){ constrained-baseline, baseline, main, high, multiview-high, stereo-high }
+
+
+
+
+

Functions

+

+
+
+

Types and Values

+
+
+

Property Details

+
+

The “bitrate” property

+
  “bitrate”                  guint
+

The desired bitrate expressed in kbps (0: auto-calculate).

+

Flags: Read / Write

+

Allowed values: <= 102400

+

Default value: 0

+
+
+
+

The “cabac” property

+
  “cabac”                    gboolean
+

Enable CABAC entropy coding mode.

+

Flags: Read / Write

+

Default value: FALSE

+
+
+
+

The “cpb-length” property

+
  “cpb-length”               guint
+

Length of the CPB buffer in milliseconds.

+

Flags: Read / Write

+

Allowed values: [1,10000]

+

Default value: 1500

+
+
+
+

The “dct8x8” property

+
  “dct8x8”                   gboolean
+

Enable adaptive use of 8x8 transforms in I-frames.

+

Flags: Read / Write

+

Default value: FALSE

+
+
+
+

The “init-qp” property

+
  “init-qp”                  guint
+

Initial quantizer value.

+

Flags: Read / Write

+

Allowed values: [1,51]

+

Default value: 26

+
+
+
+

The “keyframe-period” property

+
  “keyframe-period”          guint
+

Maximal distance between two keyframes (0: auto-calculate).

+

Flags: Read / Write

+

Allowed values: [1,300]

+

Default value: 30

+
+
+
+

The “max-bframes” property

+
  “max-bframes”              guint
+

Number of B-frames between I and P.

+

Flags: Read / Write

+

Allowed values: <= 10

+

Default value: 0

+
+
+
+

The “min-qp” property

+
  “min-qp”                   guint
+

Minimum quantizer value.

+

Flags: Read / Write

+

Allowed values: [1,51]

+

Default value: 1

+
+
+
+

The “num-slices” property

+
  “num-slices”               guint
+

Number of slices per frame.

+

Flags: Read / Write

+

Allowed values: [1,200]

+

Default value: 1

+
+
+
+

The “num-views” property

+
  “num-views”                guint
+

Number of Views for MVC encoding.

+

Flags: Read / Write

+

Allowed values: [1,10]

+

Default value: 1

+
+
+
+

The “rate-control” property

+
  “rate-control”             GstVaapiRateControlH264
+

Rate control mode.

+

Flags: Read / Write

+

Default value: Constant QP

+
+
+
+

The “tune” property

+
  “tune”                     GstVaapiEncoderTuneH264
+

Encoder tuning option.

+

Flags: Read / Write

+

Default value: None

+
+
+
+

The “view-ids” property

+
  “view-ids”                 GValueArray *
+

Set of View Ids used for MVC encoding.

+

Flags: Read / Write

+
+
+
+ + + \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-vaapih265enc.html gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-vaapih265enc.html --- gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-vaapih265enc.html 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-vaapih265enc.html 2016-06-09 08:37:50.000000000 +0000 @@ -0,0 +1,284 @@ + + + + +vaapih265enc: GStreamer VA-API Plugins 1.0 Plugins Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

vaapih265enc

+

vaapih265enc — A VA-API based HEVC video encoder

+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
guintbitrateRead / Write
guintinit-qpRead / Write
guintkeyframe-periodRead / Write
guintmax-bframesRead / Write
guintmin-qpRead / Write
guintnum-slicesRead / Write
GstVaapiRateControlH265rate-controlRead / Write
GstVaapiEncoderTuneH265tuneRead / Write
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GInitiallyUnowned
+        ╰── GstObject
+            ╰── GstElement
+                ╰── GstVideoEncoder
+                    ╰── GstVaapiEncode
+                        ╰── GstVaapiEncodeH265
+
+
+
+

Description

+

Encodes raw video streams into HEVC bitstreams.

+
+

Example launch line

+
+ + + + + + + +
1
gst-launch-1.0 -ev videotestsrc num-buffers=60 ! timeoverlay ! vaapih265enc ! matroskamux ! filesink location=test.mkv
+
+ +
+
+

Synopsis

+
+

Element Information

+
++++ + + + + + + + + + + + + + + +

plugin

+ vaapi +

author

Sreerenj Balachandran <sreerenj.balachandran@intel.com>

class

Codec/Encoder/Video
+
+
+
+

Element Pads

+
++++ + + + + + + + + + + + + + + + + + + + + + + +

name

sink

direction

sink

presence

always

details

video/x-raw(memory:VASurface), format=(string){ ENCODED, NV12, I420, YV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive

video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive
+
++++ + + + + + + + + + + + + + + + + + + +

name

src

direction

source

presence

always

details

video/x-h265, stream-format=(string){ hvc1, byte-stream }, alignment=(string)au, profile=(string){ main }
+
+
+
+
+

Functions

+

+
+
+

Types and Values

+
+
+

Property Details

+
+

The “bitrate” property

+
  “bitrate”                  guint
+

The desired bitrate expressed in kbps (0: auto-calculate).

+

Flags: Read / Write

+

Allowed values: <= 102400

+

Default value: 0

+
+
+
+

The “init-qp” property

+
  “init-qp”                  guint
+

Initial quantizer value.

+

Flags: Read / Write

+

Allowed values: [1,51]

+

Default value: 26

+
+
+
+

The “keyframe-period” property

+
  “keyframe-period”          guint
+

Maximal distance between two keyframes (0: auto-calculate).

+

Flags: Read / Write

+

Allowed values: [1,300]

+

Default value: 30

+
+
+
+

The “max-bframes” property

+
  “max-bframes”              guint
+

Number of B-frames between I and P.

+

Flags: Read / Write

+

Allowed values: <= 10

+

Default value: 0

+
+
+
+

The “min-qp” property

+
  “min-qp”                   guint
+

Minimum quantizer value.

+

Flags: Read / Write

+

Allowed values: [1,51]

+

Default value: 1

+
+
+
+

The “num-slices” property

+
  “num-slices”               guint
+

Number of slices per frame.

+

Flags: Read / Write

+

Allowed values: [1,200]

+

Default value: 1

+
+
+
+

The “rate-control” property

+
  “rate-control”             GstVaapiRateControlH265
+

Rate control mode.

+

Flags: Read / Write

+

Default value: Constant QP

+
+
+
+

The “tune” property

+
  “tune”                     GstVaapiEncoderTuneH265
+

Encoder tuning option.

+

Flags: Read / Write

+

Default value: None

+
+
+
+ + + \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-vaapijpegenc.html gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-vaapijpegenc.html --- gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-vaapijpegenc.html 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-vaapijpegenc.html 2016-06-09 08:37:50.000000000 +0000 @@ -0,0 +1,242 @@ + + + + +vaapijpegenc: GStreamer VA-API Plugins 1.0 Plugins Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

vaapijpegenc

+

vaapijpegenc — A VA-API based JPEG image encoder

+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
guintbitrateRead / Write
guintkeyframe-periodRead / Write
guintqualityRead / Write
GstVaapiRateControlJPEGrate-controlRead / Write
GstVaapiEncoderTuneJPEGtuneRead / Write
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GInitiallyUnowned
+        ╰── GstObject
+            ╰── GstElement
+                ╰── GstVideoEncoder
+                    ╰── GstVaapiEncode
+                        ╰── GstVaapiEncodeJpeg
+
+
+
+

Description

+

Encodes raw images into JPEG images.

+
+

Example launch line

+
+ + + + + + + +
1
gst-launch-1.0 -ev videotestsrc num-buffers=1 ! timeoverlay ! vaapijpegenc ! filesink location=test.jpg
+
+ +
+
+

Synopsis

+
+

Element Information

+
++++ + + + + + + + + + + + + + + +

plugin

+ vaapi +

author

Sreerenj Balachandran <sreerenj.balachandran@intel.com>

class

Codec/Encoder/Image
+
+
+
+

Element Pads

+
++++ + + + + + + + + + + + + + + + + + + + + + + +

name

sink

direction

sink

presence

always

details

video/x-raw(memory:VASurface), format=(string){ ENCODED, NV12, I420, YV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive

video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive
+
++++ + + + + + + + + + + + + + + + + + + +

name

src

direction

source

presence

always

details

image/jpeg
+
+
+
+
+

Functions

+

+
+
+

Types and Values

+
+
+

Property Details

+
+

The “bitrate” property

+
  “bitrate”                  guint
+

The desired bitrate expressed in kbps (0: auto-calculate).

+

Flags: Read / Write

+

Allowed values: <= 102400

+

Default value: 0

+
+
+
+

The “keyframe-period” property

+
  “keyframe-period”          guint
+

Maximal distance between two keyframes (0: auto-calculate).

+

Flags: Read / Write

+

Allowed values: [1,300]

+

Default value: 30

+
+
+
+

The “quality” property

+
  “quality”                  guint
+

Quality factor.

+

Flags: Read / Write

+

Allowed values: <= 100

+

Default value: 50

+
+
+
+

The “rate-control” property

+
  “rate-control”             GstVaapiRateControlJPEG
+

Rate control mode.

+

Flags: Read / Write

+

Default value: None

+
+
+
+

The “tune” property

+
  “tune”                     GstVaapiEncoderTuneJPEG
+

Encoder tuning option.

+

Flags: Read / Write

+

Default value: None

+
+
+
+ + + \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-vaapimpeg2enc.html gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-vaapimpeg2enc.html --- gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-vaapimpeg2enc.html 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-vaapimpeg2enc.html 2016-06-09 08:37:50.000000000 +0000 @@ -0,0 +1,256 @@ + + + + +vaapimpeg2enc: GStreamer VA-API Plugins 1.0 Plugins Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

vaapimpeg2enc

+

vaapimpeg2enc — A VA-API based MPEG2 video encoder

+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
guintbitrateRead / Write
guintkeyframe-periodRead / Write
guintmax-bframesRead / Write
guintquantizerRead / Write
GstVaapiRateControlMPEG2rate-controlRead / Write
GstVaapiEncoderTuneMPEG2tuneRead / Write
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GInitiallyUnowned
+        ╰── GstObject
+            ╰── GstElement
+                ╰── GstVideoEncoder
+                    ╰── GstVaapiEncode
+                        ╰── GstVaapiEncodeMpeg2
+
+
+
+

Description

+

Encodes raw video streams into MPEG2 bitstreams.

+
+

Example launch line

+
+ + + + + + + +
1
gst-launch-1.0 -ev videotestsrc num-buffers=60 ! timeoverlay ! vaapimpeg2enc ! matroskamux ! filesink location=test.mkv
+
+ +
+
+

Synopsis

+
+

Element Information

+
++++ + + + + + + + + + + + + + + +

plugin

+ vaapi +

author

Guangxin Xu <guangxin.xu@intel.com>

class

Codec/Encoder/Video
+
+
+
+

Element Pads

+
++++ + + + + + + + + + + + + + + + + + + + + + + +

name

sink

direction

sink

presence

always

details

video/x-raw(memory:VASurface), format=(string){ ENCODED, NV12, I420, YV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive

video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive
+
++++ + + + + + + + + + + + + + + + + + + +

name

src

direction

source

presence

always

details

video/mpeg, mpegversion=(int)2, systemstream=(boolean)false
+
+
+
+
+

Functions

+

+
+
+

Types and Values

+
+
+

Property Details

+
+

The “bitrate” property

+
  “bitrate”                  guint
+

The desired bitrate expressed in kbps (0: auto-calculate).

+

Flags: Read / Write

+

Allowed values: <= 102400

+

Default value: 0

+
+
+
+

The “keyframe-period” property

+
  “keyframe-period”          guint
+

Maximal distance between two keyframes (0: auto-calculate).

+

Flags: Read / Write

+

Allowed values: [1,300]

+

Default value: 30

+
+
+
+

The “max-bframes” property

+
  “max-bframes”              guint
+

Number of B-frames between I and P.

+

Flags: Read / Write

+

Allowed values: <= 16

+

Default value: 0

+
+
+
+

The “quantizer” property

+
  “quantizer”                guint
+

Constant quantizer (if rate-control mode is CQP).

+

Flags: Read / Write

+

Allowed values: [2,62]

+

Default value: 8

+
+
+
+

The “rate-control” property

+
  “rate-control”             GstVaapiRateControlMPEG2
+

Rate control mode.

+

Flags: Read / Write

+

Default value: Constant QP

+
+
+
+

The “tune” property

+
  “tune”                     GstVaapiEncoderTuneMPEG2
+

Encoder tuning option.

+

Flags: Read / Write

+

Default value: None

+
+
+
+ + + \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-vaapipostproc.html gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-vaapipostproc.html --- gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-vaapipostproc.html 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-vaapipostproc.html 2016-06-09 08:37:50.000000000 +0000 @@ -0,0 +1,438 @@ + + + + +vaapipostproc: GStreamer VA-API Plugins 1.0 Plugins Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

vaapipostproc

+

vaapipostproc — A VA-API base video postprocessing filter

+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
gfloatbrightnessRead / Write
gfloatcontrastRead / Write
GstVaapiDeinterlaceMethoddeinterlace-methodRead / Write
GstVaapiDeinterlaceModedeinterlace-modeRead / Write
gfloatdenoiseRead / Write
gbooleanforce-aspect-ratioRead / Write
GstVideoFormatformatRead / Write
guintheightRead / Write
gfloathueRead / Write
gfloatsaturationRead / Write
GstVaapiScaleMethodscale-methodRead / Write
gfloatsharpenRead / Write
gbooleanskin-tone-enhancementRead / Write
guintwidthRead / Write
+
+
+

Types and Values

+
++++ + + + + +
enumGstVaapiDeinterlaceMode
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GInitiallyUnowned
+        ╰── GstObject
+            ╰── GstElement
+                ╰── GstBaseTransform
+                    ╰── GstVaapiPostproc
+
+
+
+

Description

+

vaapipostproc consists in various postprocessing algorithms to be +applied to VA surfaces.

+
+

Example launch line

+
+ + + + + + + +
1
gst-launch-1.0 videotestsrc ! vaapipostproc ! video/x-raw width=1920, height=1080 ! vaapisink
+
+ +
+
+

Synopsis

+
+

Element Information

+
++++ + + + + + + + + + + + + + + +

plugin

+ vaapi +

author

Gwenole Beauchesne <gwenole.beauchesne@intel.com>

class

Filter/Converter/Video;Filter/Converter/Video/Scaler;Filter/Effect/Video;Filter/Effect/Video/Deinterlace
+
+
+
+

Element Pads

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +

name

sink

direction

sink

presence

always

details

video/x-raw(memory:VASurface), format=(string){ ENCODED, I420, YV12, NV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string){ progressive, interleaved, mixed }

video/x-raw(meta:GstVideoGLTextureUploadMeta), format=(string){ RGBA, BGRA }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]

video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string){ progressive, interleaved, mixed }
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +

name

src

direction

source

presence

always

details

video/x-raw(memory:VASurface), format=(string){ ENCODED, I420, YV12, NV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive

video/x-raw(meta:GstVideoGLTextureUploadMeta), format=(string){ RGBA, BGRA }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]

video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive
+
+
+
+
+

Functions

+

+
+
+

Types and Values

+
+

enum GstVaapiDeinterlaceMode

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

GST_VAAPI_DEINTERLACE_MODE_AUTO

+

Auto detect needs for deinterlacing.

+
 

GST_VAAPI_DEINTERLACE_MODE_INTERLACED

+

Force deinterlacing.

+
 

GST_VAAPI_DEINTERLACE_MODE_DISABLED

+

Never perform deinterlacing.

+
 
+
+
+
+
+

Property Details

+
+

The “brightness” property

+
  “brightness”               gfloat
+

The color brightness, expressed as a float value. Range is -1.0 +to 1.0. Default value is 0.0 and represents no modification.

+

Flags: Read / Write

+

Allowed values: [-1,1]

+

Default value: 0

+
+
+
+

The “contrast” property

+
  “contrast”                 gfloat
+

The color contrast, expressed as a float value. Range is 0.0 to +2.0. Default value is 1.0 and represents no modification.

+

Flags: Read / Write

+

Allowed values: [0,2]

+

Default value: 1

+
+
+
+

The “deinterlace-method” property

+
  “deinterlace-method”       GstVaapiDeinterlaceMethod
+

This selects the deinterlacing method to apply.

+

Flags: Read / Write

+

Default value: Bob deinterlacing

+
+
+
+

The “deinterlace-mode” property

+
  “deinterlace-mode”         GstVaapiDeinterlaceMode
+

This selects whether the deinterlacing should always be applied +or if they should only be applied on content that has the +"interlaced" flag on the caps.

+

Flags: Read / Write

+

Default value: Auto detection

+
+
+
+

The “denoise” property

+
  “denoise”                  gfloat
+

The level of noise reduction to apply.

+

Flags: Read / Write

+

Allowed values: [0,1]

+

Default value: 0

+
+
+
+

The “force-aspect-ratio” property

+
  “force-aspect-ratio”       gboolean
+

When enabled, scaling respects video aspect ratio; when disabled, +the video is distorted to fit the width and height properties.

+

Flags: Read / Write

+

Default value: TRUE

+
+
+
+

The “format” property

+
  “format”                   GstVideoFormat
+

The forced output pixel format, expressed as a GstVideoFormat.

+

Flags: Read / Write

+

Default value: GST_VIDEO_FORMAT_UNKNOWN

+
+
+
+

The “height” property

+
  “height”                   guint
+

The forced output height in pixels. If set to zero, the height is +calculated from the width if aspect ration is preserved, or +inherited from the sink caps height

+

Flags: Read / Write

+

Allowed values: <= G_MAXINT

+

Default value: 0

+
+
+
+

The “hue” property

+
  “hue”                      gfloat
+

The color hue, expressed as a float value. Range is -180.0 to +180.0. Default value is 0.0 and represents no modification.

+

Flags: Read / Write

+

Allowed values: [-180,180]

+

Default value: 0

+
+
+
+

The “saturation” property

+
  “saturation”               gfloat
+

The color saturation, expressed as a float value. Range is 0.0 to +2.0. Default value is 1.0 and represents no modification.

+

Flags: Read / Write

+

Allowed values: [0,2]

+

Default value: 1

+
+
+
+

The “scale-method” property

+
  “scale-method”             GstVaapiScaleMethod
+

The scaling method to use, expressed as an enum value. See +GstVaapiScaleMethod.

+

Flags: Read / Write

+

Default value: Default scaling mode

+
+
+
+

The “sharpen” property

+
  “sharpen”                  gfloat
+

The level of sharpening to apply for positive values, or the +level of blurring for negative values.

+

Flags: Read / Write

+

Allowed values: [-1,1]

+

Default value: 0

+
+
+
+

The “skin-tone-enhancement” property

+
  “skin-tone-enhancement”    gboolean
+

Apply the skin tone enhancement algorithm.

+

Flags: Read / Write

+

Default value: FALSE

+
+
+
+

The “width” property

+
  “width”                    guint
+

The forced output width in pixels. If set to zero, the width is +calculated from the height if aspect ration is preserved, or +inherited from the sink caps width

+

Flags: Read / Write

+

Allowed values: <= G_MAXINT

+

Default value: 0

+
+
+
+ + + \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-vaapisink.html gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-vaapisink.html --- gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-vaapisink.html 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-vaapisink.html 2016-06-09 08:37:50.000000000 +0000 @@ -0,0 +1,372 @@ + + + + +vaapisink: GStreamer VA-API Plugins 1.0 Plugins Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

vaapisink

+

vaapisink — A VA-API based video sink

+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
gfloatbrightnessRead / Write / Construct
gfloatcontrastRead / Write / Construct
GstVaapiDisplayTypedisplayRead / Write
+gchar *display-nameRead / Write
gbooleanforce-aspect-ratioRead / Write
gbooleanfullscreenRead / Write
gfloathueRead / Write / Construct
GstVaapiRotationrotationRead / Write
gfloatsaturationRead / Write / Construct
gbooleansignal-handoffsRead / Write
gintview-idRead / Write
+
+
+

Signals

+
+++++ + + + + + +
voidhandoffRun Last
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GInitiallyUnowned
+        ╰── GstObject
+            ╰── GstElement
+                ╰── GstBaseSink
+                    ╰── GstVideoSink
+                        ╰── GstVaapiSink
+
+
+
+

Description

+

vaapisink renders video frames to a drawable (X Window) on a local +display using the Video Acceleration (VA) API. The element will +create its own internal window and render into it.

+
+

Example launch line

+
+ + + + + + + +
1
gst-launch-1.0 videotestsrc ! vaapisink
+
+ +
+
+

Synopsis

+
+

Element Information

+
++++ + + + + + + + + + + + + + + +

plugin

+ vaapi +

author

Gwenole Beauchesne <gwenole.beauchesne@intel.com>

class

Sink/Video
+
+
+
+

Element Pads

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

name

sink

direction

sink

presence

always

details

video/x-raw(memory:VASurface), format=(string){ ENCODED, NV12, I420, YV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]

video/x-raw(memory:VASurface, meta:GstVideoOverlayComposition), format=(string){ ENCODED, NV12, I420, YV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]

video/x-raw(meta:GstVideoOverlayComposition), format=(string){ I420, YV12, YUY2, UYVY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]

video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
+
+
+
+
+

Functions

+

+
+
+

Types and Values

+
+
+

Property Details

+
+

The “brightness” property

+
  “brightness”               gfloat
+

The VA display brightness, expressed as a float value. Range is +-1.0 to 1.0. Default value is 0.0 and represents no modification.

+

Flags: Read / Write / Construct

+

Allowed values: [-1,1]

+

Default value: 0

+
+
+
+

The “contrast” property

+
  “contrast”                 gfloat
+

The VA display contrast, expressed as a float value. Range is 0.0 +to 2.0. Default value is 1.0 and represents no modification.

+

Flags: Read / Write / Construct

+

Allowed values: [0,2]

+

Default value: 1

+
+
+
+

The “display” property

+
  “display”                  GstVaapiDisplayType
+

The type of display to use.

+

Flags: Read / Write

+

Default value: Auto detection

+
+
+
+

The “display-name” property

+
  “display-name”             gchar *
+

The native display name.

+

Flags: Read / Write

+

Default value: NULL

+
+
+
+

The “force-aspect-ratio” property

+
  “force-aspect-ratio”       gboolean
+

When enabled, scaling respects video aspect ratio; when disabled, +the video is distorted to fit the window.

+

Flags: Read / Write

+

Default value: TRUE

+
+
+
+

The “fullscreen” property

+
  “fullscreen”               gboolean
+

Selects whether fullscreen mode is enabled or not.

+

Flags: Read / Write

+

Default value: FALSE

+
+
+
+

The “hue” property

+
  “hue”                      gfloat
+

The VA display hue, expressed as a float value. Range is -180.0 +to 180.0. Default value is 0.0 and represents no modification.

+

Flags: Read / Write / Construct

+

Allowed values: [-180,180]

+

Default value: 0

+
+
+
+

The “rotation” property

+
  “rotation”                 GstVaapiRotation
+

The VA display rotation mode, expressed as a GstVaapiRotation.

+

Flags: Read / Write

+

Default value: Unrotated mode

+
+
+
+

The “saturation” property

+
  “saturation”               gfloat
+

The VA display saturation, expressed as a float value. Range is +0.0 to 2.0. Default value is 1.0 and represents no modification.

+

Flags: Read / Write / Construct

+

Allowed values: [0,2]

+

Default value: 1

+
+
+
+

The “signal-handoffs” property

+
  “signal-handoffs”          gboolean
+

Send a signal after rendering the buffer.

+

Flags: Read / Write

+

Default value: FALSE

+
+
+
+

The “view-id” property

+
  “view-id”                  gint
+

When not set to -1, the displayed frame will always be the one +that matches the view-id of the very first displayed frame. Any +other number will indicate the desire to display the supplied +view-id only.

+

Flags: Read / Write

+

Allowed values: >= G_MAXULONG

+

Default value: -1

+
+
+
+

Signal Details

+
+

The “handoff” signal

+
void
+user_function (GstVaapiSink *object,
+               GstBuffer    *buffer,
+               gpointer      user_data)
+

This signal gets emitted after rendering the frame.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

object

the GstVaapiSink instance

 

buffer

the buffer that was rendered

 

user_data

user data set when the signal handler was connected.

 
+
+

Flags: Run Last

+
+
+
+ + + \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-vaapivp8enc.html gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-vaapivp8enc.html --- gstreamer-vaapi-0.7.0/docs/plugins/html/gstreamer-vaapi-plugins-vaapivp8enc.html 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/html/gstreamer-vaapi-plugins-vaapivp8enc.html 2016-06-09 08:37:50.000000000 +0000 @@ -0,0 +1,270 @@ + + + + +vaapivp8enc: GStreamer VA-API Plugins 1.0 Plugins Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

vaapivp8enc

+

vaapivp8enc — A VA-API based VP8 video encoder

+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
guintbitrateRead / Write
guintkeyframe-periodRead / Write
guintloop-filter-levelRead / Write
GstVaapiRateControlVP8rate-controlRead / Write
guintsharpness-levelRead / Write
GstVaapiEncoderTuneVP8tuneRead / Write
guintyac-qiRead / Write
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GInitiallyUnowned
+        ╰── GstObject
+            ╰── GstElement
+                ╰── GstVideoEncoder
+                    ╰── GstVaapiEncode
+                        ╰── GstVaapiEncodeVP8
+
+
+
+

Description

+

Encodes raw video streams into VP8 bitstreams.

+
+

Example launch line

+
+ + + + + + + +
1
gst-launch-1.0 -ev videotestsrc num-buffers=60 ! timeoverlay ! vaapivp8enc ! matroskamux ! filesink location=test.mkv
+
+ +
+
+

Synopsis

+
+

Element Information

+
++++ + + + + + + + + + + + + + + +

plugin

+ vaapi +

author

Sreerenj Balachandran <sreerenj.balachandran@intel.com>

class

Codec/Encoder/Video
+
+
+
+

Element Pads

+
++++ + + + + + + + + + + + + + + + + + + + + + + +

name

sink

direction

sink

presence

always

details

video/x-raw(memory:VASurface), format=(string){ ENCODED, NV12, I420, YV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive

video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive
+
++++ + + + + + + + + + + + + + + + + + + +

name

src

direction

source

presence

always

details

video/x-vp8
+
+
+
+
+

Functions

+

+
+
+

Types and Values

+
+
+

Property Details

+
+

The “bitrate” property

+
  “bitrate”                  guint
+

The desired bitrate expressed in kbps (0: auto-calculate).

+

Flags: Read / Write

+

Allowed values: <= 102400

+

Default value: 0

+
+
+
+

The “keyframe-period” property

+
  “keyframe-period”          guint
+

Maximal distance between two keyframes (0: auto-calculate).

+

Flags: Read / Write

+

Allowed values: [1,300]

+

Default value: 30

+
+
+
+

The “loop-filter-level” property

+
  “loop-filter-level”        guint
+

Controls the deblocking filter strength.

+

Flags: Read / Write

+

Allowed values: <= 63

+

Default value: 0

+
+
+
+

The “rate-control” property

+
  “rate-control”             GstVaapiRateControlVP8
+

Rate control mode.

+

Flags: Read / Write

+

Default value: Constant QP

+
+
+
+

The “sharpness-level” property

+
  “sharpness-level”          guint
+

Controls the deblocking filter sensitivity.

+

Flags: Read / Write

+

Allowed values: <= 7

+

Default value: 0

+
+
+
+

The “tune” property

+
  “tune”                     GstVaapiEncoderTuneVP8
+

Encoder tuning option.

+

Flags: Read / Write

+

Default value: None

+
+
+
+

The “yac-qi” property

+
  “yac-qi”                   guint
+

Quantization Table index for Luma AC Coefficients, (in default case, yac_qi=4 for key frames and yac_qi=40 for P frames).

+

Flags: Read / Write

+

Allowed values: <= 127

+

Default value: 40

+
+
+
+ + + \ No newline at end of file Binary files /tmp/tmpUUqCms/Qg4lAwNSh6/gstreamer-vaapi-0.7.0/docs/plugins/html/home.png and /tmp/tmpUUqCms/c79LJCUvkE/gstreamer-vaapi-1.8.2/docs/plugins/html/home.png differ diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/html/index.html gstreamer-vaapi-1.8.2/docs/plugins/html/index.html --- gstreamer-vaapi-0.7.0/docs/plugins/html/index.html 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/html/index.html 2016-06-09 08:37:50.000000000 +0000 @@ -0,0 +1,61 @@ + + + + +GStreamer VA-API Plugins 1.0 Plugins Reference Manual: GStreamer VA-API Plugins 1.0 Plugins Reference Manual + + + + + + + +
+
+
+
+
+
+
gstreamer-vaapi Elements
+
+
+vaapidecode — A VA-API based video decoder +
+
+vaapidecodebin — A VA-API based video decoder with a +post-processor +
+
+vaapipostproc — A VA-API base video postprocessing filter +
+
+vaapisink — A VA-API based video sink +
+
+vaapih264enc — A VA-API based H.264 video encoder +
+
+vaapih265enc — A VA-API based HEVC video encoder +
+
+vaapijpegenc — A VA-API based JPEG image encoder +
+
+vaapimpeg2enc — A VA-API based MPEG2 video encoder +
+
+vaapivp8enc — A VA-API based VP8 video encoder +
+
+
gstreamer-vaapi Plugins
+
+vaapi — VA-API based elements +
+
Object Hierarchy
+
API Index
+
+
+ + + \ No newline at end of file Binary files /tmp/tmpUUqCms/Qg4lAwNSh6/gstreamer-vaapi-0.7.0/docs/plugins/html/left-insensitive.png and /tmp/tmpUUqCms/c79LJCUvkE/gstreamer-vaapi-1.8.2/docs/plugins/html/left-insensitive.png differ Binary files /tmp/tmpUUqCms/Qg4lAwNSh6/gstreamer-vaapi-0.7.0/docs/plugins/html/left.png and /tmp/tmpUUqCms/c79LJCUvkE/gstreamer-vaapi-1.8.2/docs/plugins/html/left.png differ diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/html/object-tree.html gstreamer-vaapi-1.8.2/docs/plugins/html/object-tree.html --- gstreamer-vaapi-0.7.0/docs/plugins/html/object-tree.html 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/html/object-tree.html 2016-06-09 08:37:50.000000000 +0000 @@ -0,0 +1,51 @@ + + + + +Object Hierarchy: GStreamer VA-API Plugins 1.0 Plugins Reference Manual + + + + + + + + + + + + + + + + +
+

+Object Hierarchy

+
+    GObject
+    ╰── GInitiallyUnowned
+        ╰── GstObject
+            ╰── GstElement
+                ├── GstBaseSink
+                   ╰── GstVideoSink
+                       ╰── GstVaapiSink
+                ├── GstBaseTransform
+                   ╰── GstVaapiPostproc
+                ├── GstBin
+                   ╰── GstVaapiDecodeBin
+                ├── GstVideoDecoder
+                   ╰── GstVaapiDecode
+                ╰── GstVideoEncoder
+                    ╰── GstVaapiEncode
+                        ├── GstVaapiEncodeH264
+                        ├── GstVaapiEncodeH265
+                        ├── GstVaapiEncodeJpeg
+                        ├── GstVaapiEncodeMpeg2
+                        ╰── GstVaapiEncodeVP8
+
+
+ + + \ No newline at end of file Binary files /tmp/tmpUUqCms/Qg4lAwNSh6/gstreamer-vaapi-0.7.0/docs/plugins/html/right-insensitive.png and /tmp/tmpUUqCms/c79LJCUvkE/gstreamer-vaapi-1.8.2/docs/plugins/html/right-insensitive.png differ Binary files /tmp/tmpUUqCms/Qg4lAwNSh6/gstreamer-vaapi-0.7.0/docs/plugins/html/right.png and /tmp/tmpUUqCms/c79LJCUvkE/gstreamer-vaapi-1.8.2/docs/plugins/html/right.png differ diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/html/style.css gstreamer-vaapi-1.8.2/docs/plugins/html/style.css --- gstreamer-vaapi-0.7.0/docs/plugins/html/style.css 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/html/style.css 2016-06-09 08:37:50.000000000 +0000 @@ -0,0 +1,479 @@ +body +{ + font-family: cantarell, sans-serif; +} +.synopsis, .classsynopsis +{ + /* tango:aluminium 1/2 */ + background: #eeeeec; + background: rgba(238, 238, 236, 0.5); + border: solid 1px rgb(238, 238, 236); + padding: 0.5em; +} +.programlisting +{ + /* tango:sky blue 0/1 */ + /* fallback for no rgba support */ + background: #e6f3ff; + border: solid 1px #729fcf; + background: rgba(114, 159, 207, 0.1); + border: solid 1px rgba(114, 159, 207, 0.2); + padding: 0.5em; +} +.variablelist +{ + padding: 4px; + margin-left: 3em; +} +.variablelist td:first-child +{ + vertical-align: top; +} + +div.gallery-float +{ + float: left; + padding: 10px; +} +div.gallery-float img +{ + border-style: none; +} +div.gallery-spacer +{ + clear: both; +} + +a, a:visited +{ + text-decoration: none; + /* tango:sky blue 2 */ + color: #3465a4; +} +a:hover +{ + text-decoration: underline; + /* tango:sky blue 1 */ + color: #729fcf; +} + +div.informaltable table +{ + border-collapse: separate; + border-spacing: 1em 0.3em; + border: none; +} + +div.informaltable table td, div.informaltable table th +{ + vertical-align: top; +} + +.function_type, +.variable_type, +.property_type, +.signal_type, +.parameter_name, +.struct_member_name, +.union_member_name, +.define_keyword, +.datatype_keyword, +.typedef_keyword +{ + text-align: right; +} + +/* dim non-primary columns */ +.c_punctuation, +.function_type, +.variable_type, +.property_type, +.signal_type, +.define_keyword, +.datatype_keyword, +.typedef_keyword, +.property_flags, +.signal_flags, +.parameter_annotations, +.enum_member_annotations, +.struct_member_annotations, +.union_member_annotations +{ + color: #888a85; +} + +.function_type a, +.function_type a:visited, +.function_type a:hover, +.property_type a, +.property_type a:visited, +.property_type a:hover, +.signal_type a, +.signal_type a:visited, +.signal_type a:hover, +.signal_flags a, +.signal_flags a:visited, +.signal_flags a:hover +{ + color: #729fcf; +} + +td p +{ + margin: 0.25em; +} + +div.table table +{ + border-collapse: collapse; + border-spacing: 0px; + /* tango:aluminium 3 */ + border: solid 1px #babdb6; +} + +div.table table td, div.table table th +{ + /* tango:aluminium 3 */ + border: solid 1px #babdb6; + padding: 3px; + vertical-align: top; +} + +div.table table th +{ + /* tango:aluminium 2 */ + background-color: #d3d7cf; +} + +h4 +{ + color: #555753; + margin-top: 1em; + margin-bottom: 1em; +} + +hr +{ + /* tango:aluminium 1 */ + color: #d3d7cf; + background: #d3d7cf; + border: none 0px; + height: 1px; + clear: both; + margin: 2.0em 0em 2.0em 0em; +} + +dl.toc dt +{ + padding-bottom: 0.25em; +} + +dl.toc > dt +{ + padding-top: 0.25em; + padding-bottom: 0.25em; + font-weight: bold; +} + +dl.toc > dl +{ + padding-bottom: 0.5em; +} + +.parameter +{ + font-style: normal; +} + +.footer +{ + padding-top: 3.5em; + /* tango:aluminium 3 */ + color: #babdb6; + text-align: center; + font-size: 80%; +} + +.informalfigure, +.figure +{ + margin: 1em; +} + +.informalexample, +.example +{ + margin-top: 1em; + margin-bottom: 1em; +} + +.warning +{ + /* tango:orange 0/1 */ + background: #ffeed9; + background: rgba(252, 175, 62, 0.1); + border-color: #ffb04f; + border-color: rgba(252, 175, 62, 0.2); +} +.note +{ + /* tango:chameleon 0/0.5 */ + background: #d8ffb2; + background: rgba(138, 226, 52, 0.1); + border-color: #abf562; + border-color: rgba(138, 226, 52, 0.2); +} +div.blockquote +{ + border-color: #eeeeec; +} +.note, .warning, div.blockquote +{ + padding: 0.5em; + border-width: 1px; + border-style: solid; + margin: 2em; +} +.note p, .warning p +{ + margin: 0; +} + +div.warning h3.title, +div.note h3.title +{ + display: none; +} + +p + div.section +{ + margin-top: 1em; +} + +div.refnamediv, +div.refsynopsisdiv, +div.refsect1, +div.refsect2, +div.toc, +div.section +{ + margin-bottom: 1em; +} + +/* blob links */ +h2 .extralinks, h3 .extralinks +{ + float: right; + /* tango:aluminium 3 */ + color: #babdb6; + font-size: 80%; + font-weight: normal; +} + +.lineart +{ + color: #d3d7cf; + font-weight: normal; +} + +.annotation +{ + /* tango:aluminium 5 */ + color: #555753; + font-weight: normal; +} + +.structfield +{ + font-style: normal; + font-weight: normal; +} + +acronym,abbr +{ + border-bottom: 1px dotted gray; +} + +/* code listings */ + +.listing_code .programlisting .normal, +.listing_code .programlisting .normal a, +.listing_code .programlisting .number, +.listing_code .programlisting .cbracket, +.listing_code .programlisting .symbol { color: #555753; } +.listing_code .programlisting .comment, +.listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ +.listing_code .programlisting .function, +.listing_code .programlisting .function a, +.listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ +.listing_code .programlisting .string { color: #ad7fa8; } /* tango: plum */ +.listing_code .programlisting .keyword, +.listing_code .programlisting .usertype, +.listing_code .programlisting .type, +.listing_code .programlisting .type a { color: #4e9a06; } /* tango: chameleon 3 */ + +.listing_frame { + /* tango:sky blue 1 */ + border: solid 1px #729fcf; + border: solid 1px rgba(114, 159, 207, 0.2); + padding: 0px; +} + +.listing_lines, .listing_code { + margin-top: 0px; + margin-bottom: 0px; + padding: 0.5em; +} +.listing_lines { + /* tango:sky blue 0.5 */ + background: #a6c5e3; + background: rgba(114, 159, 207, 0.2); + /* tango:aluminium 6 */ + color: #2e3436; +} +.listing_code { + /* tango:sky blue 0 */ + background: #e6f3ff; + background: rgba(114, 159, 207, 0.1); +} +.listing_code .programlisting { + /* override from previous */ + border: none 0px; + padding: 0px; + background: none; +} +.listing_lines pre, .listing_code pre { + margin: 0px; +} + +@media screen { + /* these have a as a first child, but since there are no parent selectors + * we can't use that. */ + a.footnote + { + position: relative; + top: 0em ! important; + } + /* this is needed so that the local anchors are displayed below the naviagtion */ + div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] + { + display: inline-block; + position: relative; + top:-5em; + } + /* this seems to be a bug in the xsl style sheets when generating indexes */ + div.index div.index + { + top: 0em; + } + /* make space for the fixed navigation bar and add space at the bottom so that + * link targets appear somewhat close to top + */ + body + { + padding-top: 2.5em; + padding-bottom: 500px; + max-width: 60em; + } + p + { + max-width: 60em; + } + /* style and size the navigation bar */ + table.navigation#top + { + position: fixed; + background: #e2e2e2; + border-bottom: solid 1px #babdb6; + border-spacing: 5px; + margin-top: 0; + margin-bottom: 0; + top: 0; + left: 0; + z-index: 10; + } + table.navigation#top td + { + padding-left: 6px; + padding-right: 6px; + } + .navigation a, .navigation a:visited + { + /* tango:sky blue 3 */ + color: #204a87; + } + .navigation a:hover + { + /* tango:sky blue 2 */ + color: #3465a4; + } + td.shortcuts + { + /* tango:sky blue 2 */ + color: #3465a4; + font-size: 80%; + white-space: nowrap; + } + td.shortcuts .dim + { + color: #babdb6; + } + .navigation .title + { + font-size: 80%; + max-width: none; + margin: 0px; + font-weight: normal; + } +} +@media screen and (min-width: 60em) { + /* screen larger than 60em */ + body { margin: auto; } +} +@media screen and (max-width: 60em) { + /* screen less than 60em */ + #nav_hierarchy { display: none; } + #nav_interfaces { display: none; } + #nav_prerequisites { display: none; } + #nav_derived_interfaces { display: none; } + #nav_implementations { display: none; } + #nav_child_properties { display: none; } + #nav_style_properties { display: none; } + #nav_index { display: none; } + #nav_glossary { display: none; } + .gallery_image { display: none; } + .property_flags { display: none; } + .signal_flags { display: none; } + .parameter_annotations { display: none; } + .enum_member_annotations { display: none; } + .struct_member_annotations { display: none; } + .union_member_annotations { display: none; } + /* now that a column is hidden, optimize space */ + col.parameters_name { width: auto; } + col.parameters_description { width: auto; } + col.struct_members_name { width: auto; } + col.struct_members_description { width: auto; } + col.enum_members_name { width: auto; } + col.enum_members_description { width: auto; } + col.union_members_name { width: auto; } + col.union_members_description { width: auto; } + .listing_lines { display: none; } +} +@media print { + table.navigation { + visibility: collapse; + display: none; + } + div.titlepage table.navigation { + visibility: visible; + display: table; + background: #e2e2e2; + border: solid 1px #babdb6; + margin-top: 0; + margin-bottom: 0; + top: 0; + left: 0; + height: 3em; + } +} + Binary files /tmp/tmpUUqCms/Qg4lAwNSh6/gstreamer-vaapi-0.7.0/docs/plugins/html/up-insensitive.png and /tmp/tmpUUqCms/c79LJCUvkE/gstreamer-vaapi-1.8.2/docs/plugins/html/up-insensitive.png differ Binary files /tmp/tmpUUqCms/Qg4lAwNSh6/gstreamer-vaapi-0.7.0/docs/plugins/html/up.png and /tmp/tmpUUqCms/c79LJCUvkE/gstreamer-vaapi-1.8.2/docs/plugins/html/up.png differ diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/inspect/plugin-vaapi.xml gstreamer-vaapi-1.8.2/docs/plugins/inspect/plugin-vaapi.xml --- gstreamer-vaapi-0.7.0/docs/plugins/inspect/plugin-vaapi.xml 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/inspect/plugin-vaapi.xml 2016-06-09 08:37:08.000000000 +0000 @@ -0,0 +1,217 @@ + + vaapi + VA-API based elements + ../../gst/vaapi/.libs/libgstvaapi.so + libgstvaapi.so + 1.8.2 + LGPL + gstreamer-vaapi + gstreamer-vaapi + http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer + + + vaapidecode + VA-API decoder + Codec/Decoder/Video + A VA-API based video decoder + Gwenole Beauchesne <gwenole.beauchesne@intel.com>, Halley Zhao <halley.zhao@intel.com>, Sreerenj Balachandran <sreerenj.balachandran@intel.com>, Wind Yuan <feng.yuan@intel.com> + + + sink + sink + always +
video/mpeg, mpegversion=(int)2, systemstream=(boolean)false; video/mpeg, mpegversion=(int)4; video/x-divx; video/x-xvid; video/x-h263; video/x-h264; video/x-h265; video/x-wmv; video/x-vp8; video/x-vp9
+
+ + src + source + always +
video/x-raw(memory:VASurface), format=(string){ ENCODED, I420, YV12, NV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw(meta:GstVideoGLTextureUploadMeta), format=(string){ RGBA, BGRA }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw, format=(string){ I420, YV12, NV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
+
+
+
+ + vaapidecodebin + VA-API Decode Bin + Codec/Decoder/Video + A VA-API based bin with a decoder and a postprocessor + Sreerenj Balachandran <sreerenj.balachandran@intel.com>, Victor Jaquez <victorx.jaquez@intel.com> + + + sink + sink + always +
video/mpeg, mpegversion=(int)2, systemstream=(boolean)false; video/mpeg, mpegversion=(int)4; video/x-divx; video/x-xvid; video/x-h263; video/x-h264; video/x-h265; video/x-wmv; video/x-vp8
+
+ + src + source + always +
video/x-raw(memory:VASurface), format=(string){ ENCODED, I420, YV12, NV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive; video/x-raw(meta:GstVideoGLTextureUploadMeta), format=(string){ RGBA, BGRA }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive; video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive
+
+
+
+ + vaapih264enc + VA-API H.264 encoder + Codec/Encoder/Video + A VA-API based H.264 video encoder + Wind Yuan <feng.yuan@intel.com> + + + sink + sink + always +
video/x-raw(memory:VASurface), format=(string){ ENCODED, NV12, I420, YV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive; video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive
+
+ + src + source + always +
video/x-h264, stream-format=(string){ avc, byte-stream }, alignment=(string)au, profile=(string){ constrained-baseline, baseline, main, high, multiview-high, stereo-high }
+
+
+
+ + vaapih265enc + VA-API H.265 encoder + Codec/Encoder/Video + A VA-API based H.265 video encoder + Sreerenj Balachandran <sreerenj.balachandran@intel.com> + + + sink + sink + always +
video/x-raw(memory:VASurface), format=(string){ ENCODED, NV12, I420, YV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive; video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive
+
+ + src + source + always +
video/x-h265, stream-format=(string){ hvc1, byte-stream }, alignment=(string)au, profile=(string){ main }
+
+
+
+ + vaapijpegdec + VA-API JPEG decoder + Codec/Decoder/Video + A VA-API based video decoder + Gwenole Beauchesne <gwenole.beauchesne@intel.com>, Halley Zhao <halley.zhao@intel.com>, Sreerenj Balachandran <sreerenj.balachandran@intel.com>, Wind Yuan <feng.yuan@intel.com> + + + sink + sink + always +
image/jpeg
+
+ + src + source + always +
video/x-raw(memory:VASurface), format=(string){ ENCODED, I420, YV12, NV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw(meta:GstVideoGLTextureUploadMeta), format=(string){ RGBA, BGRA }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw, format=(string){ I420, YV12, NV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
+
+
+
+ + vaapijpegenc + VA-API JPEG encoder + Codec/Encoder/Image + A VA-API based JPEG video encoder + Sreerenj Balachandran <sreerenj.balachandran@intel.com> + + + sink + sink + always +
video/x-raw(memory:VASurface), format=(string){ ENCODED, NV12, I420, YV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive; video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive
+
+ + src + source + always +
image/jpeg
+
+
+
+ + vaapimpeg2enc + VA-API MPEG-2 encoder + Codec/Encoder/Video + A VA-API based MPEG-2 video encoder + Guangxin Xu <guangxin.xu@intel.com> + + + sink + sink + always +
video/x-raw(memory:VASurface), format=(string){ ENCODED, NV12, I420, YV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive; video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive
+
+ + src + source + always +
video/mpeg, mpegversion=(int)2, systemstream=(boolean)false
+
+
+
+ + vaapipostproc + VA-API video postprocessing + Filter/Converter/Video;Filter/Converter/Video/Scaler;Filter/Effect/Video;Filter/Effect/Video/Deinterlace + A VA-API video postprocessing filter + Gwenole Beauchesne <gwenole.beauchesne@intel.com> + + + sink + sink + always +
video/x-raw(memory:VASurface), format=(string){ ENCODED, I420, YV12, NV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string){ progressive, interleaved, mixed }; video/x-raw(meta:GstVideoGLTextureUploadMeta), format=(string){ RGBA, BGRA }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string){ progressive, interleaved, mixed }
+
+ + src + source + always +
video/x-raw(memory:VASurface), format=(string){ ENCODED, I420, YV12, NV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive; video/x-raw(meta:GstVideoGLTextureUploadMeta), format=(string){ RGBA, BGRA }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive
+
+
+
+ + vaapisink + VA-API sink + Sink/Video + A VA-API based videosink + Gwenole Beauchesne <gwenole.beauchesne@intel.com> + + + sink + sink + always +
video/x-raw(memory:VASurface), format=(string){ ENCODED, NV12, I420, YV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw(memory:VASurface, meta:GstVideoOverlayComposition), format=(string){ ENCODED, NV12, I420, YV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw(meta:GstVideoOverlayComposition), format=(string){ I420, YV12, YUY2, UYVY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
+
+
+
+ + vaapivp8enc + VA-API VP8 encoder + Codec/Encoder/Video + A VA-API based VP8 video encoder + Sreerenj Balachandran <sreerenj.balachandran@intel.com> + + + sink + sink + always +
video/x-raw(memory:VASurface), format=(string){ ENCODED, NV12, I420, YV12 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive; video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive
+
+ + src + source + always +
video/x-vp8
+
+
+
+
+
\ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/Makefile.am gstreamer-vaapi-1.8.2/docs/plugins/Makefile.am --- gstreamer-vaapi-0.7.0/docs/plugins/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/Makefile.am 2016-03-24 11:36:59.000000000 +0000 @@ -0,0 +1,92 @@ +GST_DOC_SCANOBJ = $(top_srcdir)/common/gstdoc-scangobj + +## Process this file with automake to produce Makefile.in + +# The name of the module, e.g. 'glib'. +MODULE=gstreamer-vaapi +DOC_MODULE=$(MODULE)-plugins + +# for upload-doc.mak +DOC=$(MODULE)-plugins +FORMATS=html +html: html-build.stamp +include $(top_srcdir)/common/upload-doc.mak + +# The top-level SGML file. You can change this if you want to. +DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.xml + +# The directory containing the source code. Relative to $(srcdir). +# gtk-doc will search all .c & .h files beneath here for inline comments +# documenting the functions and macros. +DOC_SOURCE_DIR = $(top_srcdir)/gst + +# Extra options to supply to gtkdoc-scan. +SCAN_OPTIONS = --deprecated-guards="GST_VAAPI_DISABLE_DEPRECATED" + +# Extra options to supply to gtkdoc-mkdb. +MKDB_OPTIONS = --sgml-mode --source-suffixes=c,h,cc,m + +# Extra options to supply to gtkdoc-fixref. +FIXXREF_OPTIONS=--extra-dir=$(GLIB_PREFIX)/share/gtk-doc/html \ + --extra-dir=$(GST_PREFIX)/share/gtk-doc/html \ + --extra-dir=$(GSTPB_PREFIX)/share/gtk-doc/html + +# Used for dependencies. The docs will be rebuilt if any of these change. +# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h +# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c +HFILE_GLOB = $(top_srcdir)/gst/*/*.h +CFILE_GLOB = $(top_srcdir)/gst/*/*.c + +# Header files to ignore when scanning. +IGNORE_HFILES = +EXTRA_HFILES = + +# we add all .h files of elements that have signals/args we want +# sadly this also pulls in the private methods - maybe we should +# move those around in the source ? +# +# also, we should add some stuff here conditionally based on whether +# or not the plugin will actually build +# but I'm not sure about that - it might be this Just Works given that +# the registry won't have the element +# -> it just works (TM) (ensonic) + +# FIXME: not ported yet +# $(top_srcdir)/ext/gnomevfs/gstgnomevfssink.c + +# example code that needs to be converted to xml and placed in xml/ +EXAMPLE_CFILES = + +# Images to copy into HTML directory. +HTML_IMAGES = + +# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). +content_files = + +# Other files to distribute. +extra_files = + +# CFLAGS and LDFLAGS for compiling scan program. Only needed if your app/lib +# contains GtkObjects/GObjects and you want to document signals and properties. +GTKDOC_CFLAGS = -DGST_USE_UNSTABLE_API $(GST_PLUGINS_BAD_CFLAGS) $(GST_BASE_CFLAGS) -I$(top_builddir) -I$(top_builddir)/gst-libs/ +GTKDOC_LIBS = $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi.la $(top_builddir)/gst/vaapi/libgstvaapi.la $(GST_BASE_LIBS) + +# If you need to override some of the declarations, place them in this file +# and uncomment this line. +#DOC_OVERRIDES = $(DOC_MODULE)-overrides.txt +DOC_OVERRIDES = + +# This includes the standard gtk-doc make rules, copied by gtkdocize. +include $(top_srcdir)/common/gtk-doc-plugins.mak + +SUBDIRS = + +# Extra clean files so that maintainer-clean removes *everything* +MAINTAINERCLEANFILES = \ + gstreamer-vaapi-plugins.* \ + *.stamp inspect \ + gstreamer-vaapi-plugins-overrides.txt \ + gstreamer-vaapi-plugins-sections.new \ + $(NULL) + +-include $(top_srcdir)/git.mk diff -Nru gstreamer-vaapi-0.7.0/docs/plugins/Makefile.in gstreamer-vaapi-1.8.2/docs/plugins/Makefile.in --- gstreamer-vaapi-0.7.0/docs/plugins/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/plugins/Makefile.in 2016-06-09 07:27:12.000000000 +0000 @@ -0,0 +1,1264 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# this snippet is to be included by both our docbook manuals +# and gtk-doc API references + +# it adds an upload target to each of these dir's Makefiles + +# each Makefile.am should define the following variables: +# - DOC: the base name of the documentation +# (faq, manual, pwg, gstreamer, gstreamer-libs) +# - FORMATS: the formats in which DOC is output +# (html ps pdf) + +# if you want to use it, make sure your $HOME/.ssh/config file contains the +# correct User entry for the Host entry for the DOC_SERVER + +# This is an include file specifically tuned for building documentation +# for GStreamer plug-ins +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = docs/plugins +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-arch.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-platform.m4 \ + $(top_srcdir)/common/m4/gst-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = gstreamer-vaapi-plugins-docs.xml +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(srcdir)/gstreamer-vaapi-plugins-docs.xml.in \ + $(top_srcdir)/common/gtk-doc-plugins.mak \ + $(top_srcdir)/common/upload-doc.mak +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ +DLLTOOL = @DLLTOOL@ +DLOPEN_LIBS = @DLOPEN_LIBS@ +DRM_CFLAGS = @DRM_CFLAGS@ +DRM_LIBS = @DRM_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGL_CFLAGS = @EGL_CFLAGS@ +EGL_LIBS = @EGL_LIBS@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GIT = @GIT@ +GLES2_CFLAGS = @GLES2_CFLAGS@ +GLES2_LIBS = @GLES2_LIBS@ +GLES3_CFLAGS = @GLES3_CFLAGS@ +GLES3_LIBS = @GLES3_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ +GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ +GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ +GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ +GST_API_VERSION = @GST_API_VERSION@ +GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ +GST_BASE_LIBS = @GST_BASE_LIBS@ +GST_CFLAGS = @GST_CFLAGS@ +GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ +GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ +GST_CURRENT = @GST_CURRENT@ +GST_GL_CFLAGS = @GST_GL_CFLAGS@ +GST_GL_LIBS = @GST_GL_LIBS@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ +GST_LIBS = @GST_LIBS@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PBUTILS_CFLAGS = @GST_PBUTILS_CFLAGS@ +GST_PBUTILS_LIBS = @GST_PBUTILS_LIBS@ +GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ +GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ +GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ +GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ +GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVA_CFLAGS = @LIBVA_CFLAGS@ +LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ +LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ +LIBVA_LIBS = @LIBVA_LIBS@ +LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ +LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ +LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ +LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ +WAYLAND_LIBS = @WAYLAND_LIBS@ +X11_CFLAGS = @X11_CFLAGS@ +X11_LIBS = @X11_LIBS@ +XRANDR_CFLAGS = @XRANDR_CFLAGS@ +XRANDR_LIBS = @XRANDR_LIBS@ +XRENDER_CFLAGS = @XRENDER_CFLAGS@ +XRENDER_LIBS = @XRENDER_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +GST_DOC_SCANOBJ = $(top_srcdir)/common/gstdoc-scangobj + +# The name of the module, e.g. 'glib'. +MODULE = gstreamer-vaapi +DOC_MODULE = $(MODULE)-plugins + +# for upload-doc.mak +DOC = $(MODULE)-plugins +FORMATS = html + +# these variables define the location of the online docs +DOC_SERVER = gstreamer.freedesktop.org +DOC_BASE = /srv/gstreamer.freedesktop.org/www/data/doc +DOC_URL = $(DOC_SERVER):$(DOC_BASE) + +# The top-level SGML file. You can change this if you want to. +DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.xml + +# The directory containing the source code. Relative to $(srcdir). +# gtk-doc will search all .c & .h files beneath here for inline comments +# documenting the functions and macros. +DOC_SOURCE_DIR = $(top_srcdir)/gst + +# Extra options to supply to gtkdoc-scan. +SCAN_OPTIONS = --deprecated-guards="GST_VAAPI_DISABLE_DEPRECATED" + +# Extra options to supply to gtkdoc-mkdb. +MKDB_OPTIONS = --sgml-mode --source-suffixes=c,h,cc,m + +# Extra options to supply to gtkdoc-fixref. +FIXXREF_OPTIONS = --extra-dir=$(GLIB_PREFIX)/share/gtk-doc/html \ + --extra-dir=$(GST_PREFIX)/share/gtk-doc/html \ + --extra-dir=$(GSTPB_PREFIX)/share/gtk-doc/html + + +# Used for dependencies. The docs will be rebuilt if any of these change. +# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h +# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c +HFILE_GLOB = $(top_srcdir)/gst/*/*.h +CFILE_GLOB = $(top_srcdir)/gst/*/*.c + +# Header files to ignore when scanning. +IGNORE_HFILES = +EXTRA_HFILES = + +# we add all .h files of elements that have signals/args we want +# sadly this also pulls in the private methods - maybe we should +# move those around in the source ? +# +# also, we should add some stuff here conditionally based on whether +# or not the plugin will actually build +# but I'm not sure about that - it might be this Just Works given that +# the registry won't have the element +# -> it just works (TM) (ensonic) + +# FIXME: not ported yet +# $(top_srcdir)/ext/gnomevfs/gstgnomevfssink.c + +# example code that needs to be converted to xml and placed in xml/ +EXAMPLE_CFILES = + +# Images to copy into HTML directory. +HTML_IMAGES = + +# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). +content_files = + +# Other files to distribute. +extra_files = + +# CFLAGS and LDFLAGS for compiling scan program. Only needed if your app/lib +# contains GtkObjects/GObjects and you want to document signals and properties. +GTKDOC_CFLAGS = -DGST_USE_UNSTABLE_API $(GST_PLUGINS_BAD_CFLAGS) $(GST_BASE_CFLAGS) -I$(top_builddir) -I$(top_builddir)/gst-libs/ +GTKDOC_LIBS = $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi.la $(top_builddir)/gst/vaapi/libgstvaapi.la $(GST_BASE_LIBS) + +# If you need to override some of the declarations, place them in this file +# and uncomment this line. +#DOC_OVERRIDES = $(DOC_MODULE)-overrides.txt +DOC_OVERRIDES = +@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = +@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) + +# thomas: make docs parallel installable +TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE)-@GST_API_VERSION@ +MAINTAINER_DOC_STAMPS = \ + scanobj-build.stamp + +EXTRA_DIST = \ + $(MAINTAINER_DOC_STAMPS) \ + $(srcdir)/inspect/*.xml \ + $(SCANOBJ_FILES) \ + $(content_files) \ + $(extra_files) \ + $(HTML_IMAGES) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_OVERRIDES) \ + $(DOC_MODULE)-sections.txt + + +# we don't add scanobj-build.stamp here since they are built manually by docs +# maintainers and result is commited to git +DOC_STAMPS = \ + scan-build.stamp \ + sgml-build.stamp \ + html-build.stamp \ + scan.stamp \ + sgml.stamp \ + html.stamp + + +# files generated/updated by gtkdoc-scangobj +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals \ + $(DOC_MODULE).types + +SCANOBJ_FILES_O = \ + .libs/$(DOC_MODULE)-scan.o + + +# files generated/updated by gtkdoc-scan +SCAN_FILES = \ + $(DOC_MODULE)-sections.txt \ + $(DOC_MODULE)-overrides.txt \ + $(DOC_MODULE)-decl.txt \ + $(DOC_MODULE)-decl-list.txt + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + +CLEANFILES = \ + $(SCANOBJ_FILES_O) \ + $(REPORT_FILES) \ + $(DOC_STAMPS) \ + inspect-registry.xml + +INSPECT_DIR = inspect + +### inspect GStreamer plug-ins; done by documentation maintainer ### + +# only look at the plugins in this module when building inspect .xml stuff +@ENABLE_GTK_DOC_TRUE@INSPECT_REGISTRY = $(top_builddir)/docs/plugins/inspect-registry.xml +@ENABLE_GTK_DOC_TRUE@INSPECT_ENVIRONMENT = \ +@ENABLE_GTK_DOC_TRUE@ LC_ALL=C \ +@ENABLE_GTK_DOC_TRUE@ GST_PLUGIN_SYSTEM_PATH_1_0= \ +@ENABLE_GTK_DOC_TRUE@ GST_PLUGIN_PATH_1_0=$(top_builddir)/gst:$(top_builddir)/sys:$(top_builddir)/ext:$(top_builddir)/plugins:$(top_builddir)/src:$(top_builddir)/gnl \ +@ENABLE_GTK_DOC_TRUE@ GST_REGISTRY_1_0=$(INSPECT_REGISTRY) \ +@ENABLE_GTK_DOC_TRUE@ PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" \ +@ENABLE_GTK_DOC_TRUE@ $(INSPECT_EXTRA_ENVIRONMENT) + + +# Extra clean files so that maintainer-clean removes *everything* +MAINTAINERCLEANFILES = \ + gstreamer-vaapi-plugins.* \ + *.stamp inspect \ + gstreamer-vaapi-plugins-overrides.txt \ + gstreamer-vaapi-plugins-sections.new \ + $(NULL) + + +# wildcard is apparently not portable to other makes, hence the use of find +inspect_files = $(shell find $(srcdir)/$(INSPECT_DIR) -name '*.xml') + +# This includes the standard gtk-doc make rules, copied by gtkdocize. +SUBDIRS = +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/common/upload-doc.mak $(top_srcdir)/common/gtk-doc-plugins.mak $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/plugins/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu docs/plugins/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; +$(top_srcdir)/common/upload-doc.mak $(top_srcdir)/common/gtk-doc-plugins.mak $(am__empty): + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +gstreamer-vaapi-plugins-docs.xml: $(top_builddir)/config.status $(srcdir)/gstreamer-vaapi-plugins-docs.xml.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook +check-am: all-am +check: check-recursive +all-am: Makefile all-local +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-recursive + +clean-am: clean-generic clean-libtool clean-local mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-local \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-data-local + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-local + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \ + check check-am clean clean-generic clean-libtool clean-local \ + cscopelist-am ctags ctags-am dist-hook distclean \ + distclean-generic distclean-libtool distclean-local \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-data-local install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-local + +.PRECIOUS: Makefile + +html: html-build.stamp + +upload: $(FORMATS) + @if echo $(FORMATS) | grep html > /dev/null; then \ + echo "Preparing docs for upload (rebasing cross-references) ..." ; \ + if test x$(builddir) != x$(srcdir); then \ + echo "make upload can only be used if srcdir == builddir"; \ + exit 1; \ + fi; \ + # gtkdoc-rebase sometimes gets confused, so reset everything to \ + # local links before rebasing to online links \ + gtkdoc-rebase --html-dir=$(builddir)/html 2>/dev/null 2>/dev/null ; \ + rebase=`gtkdoc-rebase --verbose --online --html-dir=$(builddir)/html` ; \ + echo "$$rebase" | grep -e "On-*line"; \ + for req in glib gobject gstreamer gstreamer-libs gst-plugins-base-libs; do \ + if ! ( echo "$$rebase" | grep -i -e "On-*line.*/$$req/" ); then \ + echo "===============================================================================" ; \ + echo " Could not determine online location for $$req docs. Cross-referencing will be " ; \ + echo " broken, so not uploading. Make sure the library's gtk-doc documentation is " ; \ + echo " installed somewhere in /usr/share/gtk-doc. " ; \ + echo "===============================================================================" ; \ + exit 1; \ + fi; \ + done; \ + export SRC="$$SRC html"; \ + fi; \ + if echo $(FORMATS) | grep ps > /dev/null; then export SRC="$$SRC $(DOC).ps"; fi; \ + if echo $(FORMATS) | grep pdf > /dev/null; then export SRC="$$SRC $(DOC).pdf"; fi; \ + \ + # upload releases to both X.Y/ and head/ subdirectories \ + export DIR=$(DOC_BASE)/gstreamer/$(PACKAGE_VERSION_MAJOR).$(PACKAGE_VERSION_MINOR)/$(DOC); \ + echo Uploading $$SRC to $(DOC_SERVER):$$DIR; \ + ssh $(DOC_SERVER) mkdir -p $$DIR; \ + rsync -rv -e ssh --delete $$SRC $(DOC_SERVER):$$DIR; \ + ssh $(DOC_SERVER) chmod -R g+w $$DIR; \ + \ + export DIR=$(DOC_BASE)/gstreamer/head/$(DOC); \ + echo Uploading $$SRC to $(DOC_SERVER):$$DIR; \ + ssh $(DOC_SERVER) mkdir -p $$DIR; \ + rsync -rv -e ssh --delete $$SRC $(DOC_SERVER):$$DIR; \ + ssh $(DOC_SERVER) chmod -R g+w $$DIR; \ + \ + if echo $(FORMATS) | grep html > /dev/null; then \ + echo "Un-preparing docs for upload (rebasing cross-references) ..." ; \ + gtkdoc-rebase --html-dir=$(builddir)/html ; \ + fi; \ + echo Done + +help: + @echo + @echo "If you are a doc maintainer, run 'make update' to update" + @echo "the documentation files maintained in git" + @echo + @echo Other useful make targets: + @echo + @echo check-inspected-versions: make sure the inspected plugin info + @echo is up to date before a release + @echo + +# update the stuff maintained by doc maintainers +update: scanobj-update + $(MAKE) check-outdated-docs + +@ENABLE_GTK_DOC_TRUE@all-local: html-build.stamp + +#### scan gobjects; done by documentation maintainer #### +@ENABLE_GTK_DOC_TRUE@scanobj-update: +@ENABLE_GTK_DOC_TRUE@ -rm scanobj-build.stamp +@ENABLE_GTK_DOC_TRUE@ $(MAKE) scanobj-build.stamp + +# gstdoc-scanobj produces 5 output files (.new) +# scangobj-merge.py merges them into the file which we commit later +# TODO: also merge the hierarchy +@ENABLE_GTK_DOC_TRUE@scanobj-build.stamp: $(SCANOBJ_DEPS) $(basefiles) +@ENABLE_GTK_DOC_TRUE@ @echo " DOC Introspecting gobjects" +@ENABLE_GTK_DOC_TRUE@ @if test x"$(srcdir)" != x. ; then \ +@ENABLE_GTK_DOC_TRUE@ for f in $(SCANOBJ_FILES) $(SCAN_FILES); \ +@ENABLE_GTK_DOC_TRUE@ do \ +@ENABLE_GTK_DOC_TRUE@ if test -e $(srcdir)/$$f; then cp -u $(srcdir)/$$f . ; fi; \ +@ENABLE_GTK_DOC_TRUE@ done; \ +@ENABLE_GTK_DOC_TRUE@ fi; \ +@ENABLE_GTK_DOC_TRUE@ mkdir -p $(INSPECT_DIR); \ +@ENABLE_GTK_DOC_TRUE@ scanobj_options=""; \ +@ENABLE_GTK_DOC_TRUE@ if test "x$(V)" = "x1"; then \ +@ENABLE_GTK_DOC_TRUE@ scanobj_options="--verbose"; \ +@ENABLE_GTK_DOC_TRUE@ fi; \ +@ENABLE_GTK_DOC_TRUE@ $(INSPECT_ENVIRONMENT) \ +@ENABLE_GTK_DOC_TRUE@ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" \ +@ENABLE_GTK_DOC_TRUE@ CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS) $(WARNING_CFLAGS)" \ +@ENABLE_GTK_DOC_TRUE@ LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ +@ENABLE_GTK_DOC_TRUE@ $(GST_DOC_SCANOBJ) $$scanobj_options --type-init-func="gst_init(NULL,NULL)" \ +@ENABLE_GTK_DOC_TRUE@ --module=$(DOC_MODULE) --source=$(PACKAGE) --inspect-dir=$(INSPECT_DIR) && \ +@ENABLE_GTK_DOC_TRUE@ echo " DOC Merging introspection data" && \ +@ENABLE_GTK_DOC_TRUE@ $(PYTHON) \ +@ENABLE_GTK_DOC_TRUE@ $(top_srcdir)/common/scangobj-merge.py $(DOC_MODULE) || exit 1; \ +@ENABLE_GTK_DOC_TRUE@ if test x"$(srcdir)" != x. ; then \ +@ENABLE_GTK_DOC_TRUE@ for f in $(SCANOBJ_FILES); \ +@ENABLE_GTK_DOC_TRUE@ do \ +@ENABLE_GTK_DOC_TRUE@ cmp -s ./$$f $(srcdir)/$$f || cp ./$$f $(srcdir)/ ; \ +@ENABLE_GTK_DOC_TRUE@ done; \ +@ENABLE_GTK_DOC_TRUE@ fi; \ +@ENABLE_GTK_DOC_TRUE@ touch scanobj-build.stamp + +@ENABLE_GTK_DOC_TRUE@$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(SCANOBJ_FILES_O): scan-build.stamp +@ENABLE_GTK_DOC_TRUE@ @true + +### scan headers; done on every build ### +@ENABLE_GTK_DOC_TRUE@scan-build.stamp: $(HFILE_GLOB) $(EXTRA_HFILES) $(basefiles) scanobj-build.stamp +@ENABLE_GTK_DOC_TRUE@ @echo ' DOC Scanning header files' +@ENABLE_GTK_DOC_TRUE@ @if test x"$(srcdir)" != x. ; then \ +@ENABLE_GTK_DOC_TRUE@ for f in $(SCANOBJ_FILES) $(SCAN_FILES); \ +@ENABLE_GTK_DOC_TRUE@ do \ +@ENABLE_GTK_DOC_TRUE@ if test -e $(srcdir)/$$f; then cp -u $(srcdir)/$$f . ; fi; \ +@ENABLE_GTK_DOC_TRUE@ done; \ +@ENABLE_GTK_DOC_TRUE@ fi +@ENABLE_GTK_DOC_TRUE@ @_source_dir='' ; \ +@ENABLE_GTK_DOC_TRUE@ for i in $(DOC_SOURCE_DIR) ; do \ +@ENABLE_GTK_DOC_TRUE@ _source_dir="$${_source_dir} --source-dir=$$i" ; \ +@ENABLE_GTK_DOC_TRUE@ done ; \ +@ENABLE_GTK_DOC_TRUE@ gtkdoc-scan \ +@ENABLE_GTK_DOC_TRUE@ $(SCAN_OPTIONS) $(EXTRA_HFILES) \ +@ENABLE_GTK_DOC_TRUE@ --module=$(DOC_MODULE) \ +@ENABLE_GTK_DOC_TRUE@ $${_source_dir} \ +@ENABLE_GTK_DOC_TRUE@ --ignore-headers="$(IGNORE_HFILES)"; \ +@ENABLE_GTK_DOC_TRUE@ touch scan-build.stamp + +#### xml #### + +@ENABLE_GTK_DOC_TRUE@sgml-build.stamp: scan-build.stamp $(CFILE_GLOB) $(top_srcdir)/common/plugins.xsl $(expand_content_files) +@ENABLE_GTK_DOC_TRUE@ @echo ' DOC Building XML' +@ENABLE_GTK_DOC_TRUE@ @-mkdir -p xml +@ENABLE_GTK_DOC_TRUE@ @for a in $(inspect_files); do \ +@ENABLE_GTK_DOC_TRUE@ xsltproc --stringparam module $(MODULE) \ +@ENABLE_GTK_DOC_TRUE@ $(top_srcdir)/common/plugins.xsl $$a > xml/`basename $$a`; done +@ENABLE_GTK_DOC_TRUE@ @for f in $(EXAMPLE_CFILES); do \ +@ENABLE_GTK_DOC_TRUE@ $(PYTHON) $(top_srcdir)/common/c-to-xml.py $$f > xml/element-`basename $$f .c`.xml; done +@ENABLE_GTK_DOC_TRUE@ @gtkdoc-mkdb \ +@ENABLE_GTK_DOC_TRUE@ --module=$(DOC_MODULE) \ +@ENABLE_GTK_DOC_TRUE@ --source-dir=$(DOC_SOURCE_DIR) \ +@ENABLE_GTK_DOC_TRUE@ --expand-content-files="$(expand_content_files)" \ +@ENABLE_GTK_DOC_TRUE@ --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) \ +@ENABLE_GTK_DOC_TRUE@ --output-format=xml \ +@ENABLE_GTK_DOC_TRUE@ --ignore-files="$(IGNORE_HFILES) $(IGNORE_CFILES)" \ +@ENABLE_GTK_DOC_TRUE@ $(MKDB_OPTIONS) +@ENABLE_GTK_DOC_TRUE@ @$(PYTHON) $(top_srcdir)/common/mangle-db.py xml +@ENABLE_GTK_DOC_TRUE@ @cp ../version.entities xml +@ENABLE_GTK_DOC_TRUE@ @touch sgml-build.stamp + +@ENABLE_GTK_DOC_TRUE@sgml.stamp: sgml-build.stamp +@ENABLE_GTK_DOC_TRUE@ @true + +#### html #### + +@ENABLE_GTK_DOC_TRUE@html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) +@ENABLE_GTK_DOC_TRUE@ @echo ' DOC Building HTML' +@ENABLE_GTK_DOC_TRUE@ @rm -rf html +@ENABLE_GTK_DOC_TRUE@ @mkdir html +@ENABLE_GTK_DOC_TRUE@ @cp $(srcdir)/$(DOC_MAIN_SGML_FILE) html +@ENABLE_GTK_DOC_TRUE@ @for f in $(content_files); do cp $(srcdir)/$$f html; done +@ENABLE_GTK_DOC_TRUE@ @cp -pr xml html +@ENABLE_GTK_DOC_TRUE@ @cp ../version.entities html +@ENABLE_GTK_DOC_TRUE@ @mkhtml_options=""; \ +@ENABLE_GTK_DOC_TRUE@ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ +@ENABLE_GTK_DOC_TRUE@ if test "$(?)" = "0"; then \ +@ENABLE_GTK_DOC_TRUE@ if test "x$(V)" = "x1"; then \ +@ENABLE_GTK_DOC_TRUE@ mkhtml_options="$$mkhtml_options --verbose"; \ +@ENABLE_GTK_DOC_TRUE@ fi; \ +@ENABLE_GTK_DOC_TRUE@ fi; \ +@ENABLE_GTK_DOC_TRUE@ cd html && gtkdoc-mkhtml $$mkhtml_options $(DOC_MODULE)-@GST_API_VERSION@ $(DOC_MAIN_SGML_FILE) +@ENABLE_GTK_DOC_TRUE@ @rm -f html/$(DOC_MAIN_SGML_FILE) +@ENABLE_GTK_DOC_TRUE@ @rm -rf html/xml +@ENABLE_GTK_DOC_TRUE@ @rm -f html/version.entities +@ENABLE_GTK_DOC_TRUE@ @test "x$(HTML_IMAGES)" = "x" || for i in "" $(HTML_IMAGES) ; do \ +@ENABLE_GTK_DOC_TRUE@ if test "$$i" != ""; then cp $(srcdir)/$$i html ; fi; done +@ENABLE_GTK_DOC_TRUE@ @echo ' DOC Fixing cross-references' +@ENABLE_GTK_DOC_TRUE@ @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) +@ENABLE_GTK_DOC_TRUE@ @touch html-build.stamp + +@ENABLE_GTK_DOC_TRUE@clean-local-gtkdoc: +@ENABLE_GTK_DOC_TRUE@ @rm -rf xml tmpl html +# clean files copied for nonsrcdir templates build +@ENABLE_GTK_DOC_TRUE@ @if test x"$(srcdir)" != x. ; then \ +@ENABLE_GTK_DOC_TRUE@ rm -rf $(SCANOBJ_FILES) $(SCAN_FILES) $(REPORT_FILES) \ +@ENABLE_GTK_DOC_TRUE@ $(MAINTAINER_DOC_STAMPS); \ +@ENABLE_GTK_DOC_TRUE@ fi +@ENABLE_GTK_DOC_FALSE@all-local: +@ENABLE_GTK_DOC_FALSE@clean-local-gtkdoc: + +clean-local: clean-local-gtkdoc + @rm -f *~ *.bak + @rm -rf .libs + +distclean-local: + @rm -f $(REPORT_FILES) \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + @rm -rf tmpl/*.sgml.bak + @rm -f $(DOC_MODULE).hierarchy + @rm -f *.stamp || true + @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + rm -f $(DOC_MODULE)-docs.sgml ; \ + rm -f $(DOC_MODULE).types ; \ + rm -f $(DOC_MODULE).interfaces ; \ + rm -f $(DOC_MODULE)-overrides.txt ; \ + rm -f $(DOC_MODULE).prerequisites ; \ + rm -f $(DOC_MODULE)-sections.txt ; \ + rm -rf tmpl/*.sgml ; \ + rm -rf $(INSPECT_DIR); \ + fi + @rm -rf *.o + +# thomas: make docs parallel installable; devhelp requires majorminor too +install-data-local: + (installfiles=`echo $(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css`; \ + if test "$$installfiles" = '$(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css'; \ + then echo '-- Nothing to install' ; \ + else \ + $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \ + for i in $$installfiles; do \ + echo '-- Installing '$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ + done; \ + pngfiles=`echo ./html/*.png`; \ + if test "$$pngfiles" != './html/*.png'; then \ + for i in $$pngfiles; do \ + echo '-- Installing '$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ + done; \ + fi; \ + echo '-- Installing $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2' ; \ + if test -e $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2; then \ + $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2 \ + $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) || true ; \ + fi) +uninstall-local: + if test -d $(DESTDIR)$(TARGET_DIR); then \ + rm -rf $(DESTDIR)$(TARGET_DIR)/*; \ + rmdir -p $(DESTDIR)$(TARGET_DIR) 2>/dev/null || true; \ + else \ + echo '-- Nothing to uninstall' ; \ + fi; + +# +# Checks +# +@ENABLE_GTK_DOC_TRUE@check-hierarchy: $(DOC_MODULE).hierarchy +@ENABLE_GTK_DOC_TRUE@ @if grep ' ' $(DOC_MODULE).hierarchy; then \ +@ENABLE_GTK_DOC_TRUE@ echo "$(DOC_MODULE).hierarchy contains tabs, please fix"; \ +@ENABLE_GTK_DOC_TRUE@ /bin/false; \ +@ENABLE_GTK_DOC_TRUE@ fi + +@ENABLE_GTK_DOC_TRUE@check: check-hierarchy + +check-inspected-versions: + @echo Checking plugin versions of inspected plugin data ...; \ + fail=0 ; \ + for each in $(inspect_files) ; do \ + if (grep -H '' $$each | grep -v '$(VERSION)'); then \ + echo $$each should be fixed to say version $(VERSION) or be removed ; \ + echo "sed -i -e 's//$(VERSION)<\/version>/'" $$each; \ + echo ; \ + fail=1; \ + fi ; \ + done ; \ + exit $$fail + +check-outdated-docs: + $(AM_V_GEN)echo Checking for outdated plugin inspect data ...; \ + fail=0 ; \ + if [ -d $(top_srcdir)/.git/ ]; then \ + files=`find $(srcdir)/inspect/ -name '*xml'`; \ + for f in $$files; do \ + ver=`grep '$(PACKAGE_VERSION)' $$f`; \ + if test "x$$ver" = "x"; then \ + plugin=`echo $$f | sed -e 's/^.*plugin-//' -e 's/.xml//'`; \ + # echo "Checking $$plugin $$f"; \ + pushd "$(top_srcdir)" >/dev/null; \ + pinit=`git grep -A3 GST_PLUGIN_DEFINE -- ext/ gst/ sys/ | grep "\"$$plugin\""`; \ + popd >/dev/null; \ + # echo "[$$pinit]"; \ + if test "x$$pinit" = "x"; then \ + printf " **** outdated docs for plugin %-15s: %s\n" $$plugin $$f; \ + fail=1; \ + fi; \ + fi; \ + done; \ + fi ; \ + exit $$fail + +# +# Require gtk-doc when making dist +# +@ENABLE_GTK_DOC_TRUE@dist-check-gtkdoc: +@ENABLE_GTK_DOC_FALSE@dist-check-gtkdoc: +@ENABLE_GTK_DOC_FALSE@ @echo "*** gtk-doc must be installed and enabled in order to make dist" +@ENABLE_GTK_DOC_FALSE@ @false + +# FIXME: decide whether we want to dist generated html or not +# also this only works, if the project has been build before +# we could dist html only if its there, but that might lead to missing html in +# tarballs +dist-hook: dist-check-gtkdoc dist-hook-local + mkdir $(distdir)/html + cp html/* $(distdir)/html + -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ + -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ + cd $(distdir) && rm -f $(DISTCLEANFILES) + -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs check-outdated-docs inspect + +# avoid spurious build errors when distchecking with -jN +.NOTPARALLEL: + +-include $(top_srcdir)/git.mk + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/annotation-glossary.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/annotation-glossary.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/annotation-glossary.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/annotation-glossary.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - - - -Annotation Glossary: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - -
-

-Annotation Glossary

-

C

-
closure
-

This parameter is a 'user_data', for callbacks; many bindings can pass NULL here.

-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/api-index-full.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/api-index-full.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/api-index-full.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/api-index-full.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,1246 +0,0 @@ - - - - -API Index: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-

-API Index

-

G

-
-GstVaapiChromaType, enum in gstvaapisurface -
-
-
-GstVaapiCodec, enum in GstVaapiProfile -
-
-
-GstVaapiConfigInfoEncoder, struct in GstVaapiContext -
-
-
-GstVaapiContext, struct in GstVaapiContext -
-
-
-GstVaapiContextInfo, struct in GstVaapiContext -
-
-
-GstVaapiContextUsage, enum in GstVaapiContext -
-
-
-GstVaapiDecoder, struct in GstVaapiDecoder -
-
-
-GstVaapiDecoderH264, struct in GstVaapiDecoderH264 -
-
-
-GstVaapiDecoderH265, struct in GstVaapiDecoderH265 -
-
-
-GstVaapiDecoderJpeg, struct in GstVaapiDecoderJpeg -
-
-
-GstVaapiDecoderMpeg2, struct in GstVaapiDecoderMpeg2 -
-
-
-GstVaapiDecoderMpeg4, struct in GstVaapiDecoderMpeg4 -
-
-
-GstVaapiDecoderStatus, enum in gstvaapidecoder -
-
-
-GstVaapiDecoderUnit, struct in GstVaapiDecoderUnit -
-
-
-GstVaapiDecoderUnitFlags, enum in GstVaapiDecoderUnit -
-
-
-GstVaapiDecoderVC1, struct in GstVaapiDecoderVC1 -
-
-
-GstVaapiDecoderVp8, struct in GstVaapiDecoderVp8 -
-
-
-GstVaapiDisplay, struct in GstVaapiDisplay -
-
-
-GstVaapiDisplayEGL, struct in GstVaapiDisplayEGL -
-
-
-GstVaapiDisplayGLX, struct in GstVaapiDisplayGLX -
-
-
-GstVaapiDisplayInfo, struct in GstVaapiDisplay -
-
-
-GstVaapiDisplayType, enum in GstVaapiDisplay -
-
-
-GstVaapiDisplayX11, struct in GstVaapiDisplayX11 -
-
-
-GstVaapiEntrypoint, enum in GstVaapiProfile -
-
-
-GstVaapiEnumSubset, struct in GstVaapiValue -
-
-
-GstVaapiFilter, struct in GstVaapiFilter -
-
-
-GstVaapiFilterOp, enum in GstVaapiFilter -
-
-
-GstVaapiID, typedef in Basic data structures -
-
-
-GstVaapiImage, struct in GstVaapiImage -
-
-
-GstVaapiImagePool, struct in GstVaapiImagePool -
-
-
-GstVaapiObject, struct in GstVaapiObject -
-
-
-GstVaapiPixmap, struct in GstVaapiPixmap -
-
-
-GstVaapiPixmapX11, struct in GstVaapiPixmapX11 -
-
-
-GstVaapiPoint, struct in Basic data structures -
-
-
-GstVaapiProfile, enum in GstVaapiProfile -
-
-
-GstVaapiRectangle, struct in Basic data structures -
-
-
-GstVaapiStreamAlignH265, enum in GstVaapiDecoderH265 -
-
-
-GstVaapiSubpicture, struct in GstVaapiSubpicture -
-
-
-GstVaapiSurface, struct in GstVaapiSurface -
-
-
-GstVaapiSurfacePool, struct in GstVaapiSurfacePool -
-
-
-GstVaapiSurfaceRenderFlags, enum in gstvaapisurface -
-
-
-GstVaapiSurfaceStatus, enum in gstvaapisurface -
-
-
-GstVaapiTexture, struct in GstVaapiTexture -
-
-
-GstVaapiVideoPool, struct in GstVaapiVideoPool -
-
-
-GstVaapiWindow, struct in GstVaapiWindow -
-
-
-GstVaapiWindowGLX, struct in GstVaapiWindowGLX -
-
-
-GstVaapiWindowX11, struct in GstVaapiWindowX11 -
-
-
-gst_vaapi_context_get_id, function in GstVaapiContext -
-
-
-gst_vaapi_context_get_surface_count, function in GstVaapiContext -
-
-
-gst_vaapi_context_get_surface_proxy, function in GstVaapiContext -
-
-
-gst_vaapi_context_new, function in GstVaapiContext -
-
-
-gst_vaapi_context_reset, function in GstVaapiContext -
-
-
-gst_vaapi_decoder_decode, function in GstVaapiDecoder -
-
-
-gst_vaapi_decoder_get_caps, function in GstVaapiDecoder -
-
-
-gst_vaapi_decoder_get_codec, function in GstVaapiDecoder -
-
-
-gst_vaapi_decoder_get_codec_state, function in GstVaapiDecoder -
-
-
-gst_vaapi_decoder_get_frame, function in GstVaapiDecoder -
-
-
-gst_vaapi_decoder_get_frame_with_timeout, function in GstVaapiDecoder -
-
-
-gst_vaapi_decoder_get_surface, function in GstVaapiDecoder -
-
-
-gst_vaapi_decoder_h264_new, function in GstVaapiDecoderH264 -
-
-
-gst_vaapi_decoder_h265_new, function in GstVaapiDecoderH265 -
-
-
-gst_vaapi_decoder_h265_set_alignment, function in GstVaapiDecoderH265 -
-
-
-gst_vaapi_decoder_jpeg_new, function in GstVaapiDecoderJpeg -
-
-
-gst_vaapi_decoder_mpeg2_new, function in GstVaapiDecoderMpeg2 -
-
-
-gst_vaapi_decoder_mpeg4_new, function in GstVaapiDecoderMpeg4 -
-
-
-gst_vaapi_decoder_parse, function in GstVaapiDecoder -
-
-
-gst_vaapi_decoder_put_buffer, function in GstVaapiDecoder -
-
-
-gst_vaapi_decoder_unit_clear, function in GstVaapiDecoderUnit -
-
-
-gst_vaapi_decoder_unit_init, function in GstVaapiDecoderUnit -
-
-
-gst_vaapi_decoder_unit_new, function in GstVaapiDecoderUnit -
-
-
-gst_vaapi_decoder_unit_set_parsed_info, function in GstVaapiDecoderUnit -
-
-
-gst_vaapi_decoder_vc1_new, function in GstVaapiDecoderVC1 -
-
-
-gst_vaapi_decoder_vp8_new, function in GstVaapiDecoderVp8 -
-
-
-gst_vaapi_display_drm_get_device, function in GstVaapiDisplayDRM -
-
-
-gst_vaapi_display_drm_get_device_path, function in GstVaapiDisplayDRM -
-
-
-gst_vaapi_display_drm_new, function in GstVaapiDisplayDRM -
-
-
-gst_vaapi_display_drm_new_with_device, function in GstVaapiDisplayDRM -
-
-
-gst_vaapi_display_egl_get_gl_context, function in GstVaapiDisplayEGL -
-
-
-gst_vaapi_display_egl_get_gl_display, function in GstVaapiDisplayEGL -
-
-
-gst_vaapi_display_egl_new, function in GstVaapiDisplayEGL -
-
-
-gst_vaapi_display_egl_new_with_native_display, function in GstVaapiDisplayEGL -
-
-
-gst_vaapi_display_egl_set_gl_context, function in GstVaapiDisplayEGL -
-
-
-gst_vaapi_display_flush, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_get_class_type, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_get_decode_profiles, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_get_display, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_get_display_name, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_get_display_type, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_get_encode_profiles, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_get_height, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_get_image_formats, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_get_pixel_aspect_ratio, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_get_property, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_get_render_mode, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_get_rotation, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_get_size, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_get_subpicture_formats, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_get_vendor_string, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_get_width, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_glx_new, function in GstVaapiDisplayGLX -
-
-
-gst_vaapi_display_glx_new_with_display, function in GstVaapiDisplayGLX -
-
-
-gst_vaapi_display_has_decoder, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_has_encoder, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_has_image_format, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_has_opengl, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_has_property, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_has_subpicture_format, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_has_video_processing, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_lock, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_new_with_display, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_ref, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_replace, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_set_property, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_set_render_mode, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_set_rotation, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_sync, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_unlock, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_unref, function in GstVaapiDisplay -
-
-
-gst_vaapi_display_wayland_get_display, function in GstVaapiDisplayWayland -
-
-
-gst_vaapi_display_wayland_new, function in GstVaapiDisplayWayland -
-
-
-gst_vaapi_display_wayland_new_with_display, function in GstVaapiDisplayWayland -
-
-
-gst_vaapi_display_x11_get_display, function in GstVaapiDisplayX11 -
-
-
-gst_vaapi_display_x11_get_screen, function in GstVaapiDisplayX11 -
-
-
-gst_vaapi_display_x11_new, function in GstVaapiDisplayX11 -
-
-
-gst_vaapi_display_x11_new_with_display, function in GstVaapiDisplayX11 -
-
-
-gst_vaapi_entrypoint, function in GstVaapiProfile -
-
-
-gst_vaapi_entrypoint_get_va_entrypoint, function in GstVaapiProfile -
-
-
-gst_vaapi_filter_get_formats, function in GstVaapiFilter -
-
-
-gst_vaapi_filter_get_operations, function in GstVaapiFilter -
-
-
-gst_vaapi_filter_has_operation, function in GstVaapiFilter -
-
-
-gst_vaapi_filter_new, function in GstVaapiFilter -
-
-
-gst_vaapi_filter_ref, function in GstVaapiFilter -
-
-
-gst_vaapi_filter_replace, function in GstVaapiFilter -
-
-
-gst_vaapi_filter_set_brightness, function in GstVaapiFilter -
-
-
-gst_vaapi_filter_set_cropping_rectangle, function in GstVaapiFilter -
-
-
-gst_vaapi_filter_set_deinterlacing, function in GstVaapiFilter -
-
-
-gst_vaapi_filter_set_deinterlacing_references, function in GstVaapiFilter -
-
-
-gst_vaapi_filter_set_denoising_level, function in GstVaapiFilter -
-
-
-gst_vaapi_filter_set_format, function in GstVaapiFilter -
-
-
-gst_vaapi_filter_set_hue, function in GstVaapiFilter -
-
-
-gst_vaapi_filter_set_operation, function in GstVaapiFilter -
-
-
-gst_vaapi_filter_set_saturation, function in GstVaapiFilter -
-
-
-gst_vaapi_filter_set_sharpening_level, function in GstVaapiFilter -
-
-
-gst_vaapi_filter_set_target_rectangle, function in GstVaapiFilter -
-
-
-gst_vaapi_filter_unref, function in GstVaapiFilter -
-
-
-gst_vaapi_filter_use_operation, function in GstVaapiFilter -
-
-
-GST_VAAPI_ID_ARGS, macro in Basic data structures -
-
-
-GST_VAAPI_ID_FORMAT, macro in Basic data structures -
-
-
-gst_vaapi_image_copy, function in GstVaapiImage -
-
-
-GST_VAAPI_IMAGE_FORMAT, macro in gstvaapiimage -
-
-
-gst_vaapi_image_get_buffer, function in GstVaapiImage -
-
-
-gst_vaapi_image_get_data_size, function in GstVaapiImage -
-
-
-gst_vaapi_image_get_format, function in GstVaapiImage -
-
-
-gst_vaapi_image_get_height, function in GstVaapiImage -
-
-
-gst_vaapi_image_get_id, function in GstVaapiImage -
-
-
-gst_vaapi_image_get_image, function in GstVaapiImage -
-
-
-gst_vaapi_image_get_pitch, function in GstVaapiImage -
-
-
-gst_vaapi_image_get_plane, function in GstVaapiImage -
-
-
-gst_vaapi_image_get_plane_count, function in GstVaapiImage -
-
-
-gst_vaapi_image_get_size, function in GstVaapiImage -
-
-
-gst_vaapi_image_get_width, function in GstVaapiImage -
-
-
-GST_VAAPI_IMAGE_HEIGHT, macro in gstvaapiimage -
-
-
-gst_vaapi_image_is_linear, function in GstVaapiImage -
-
-
-gst_vaapi_image_is_mapped, function in GstVaapiImage -
-
-
-gst_vaapi_image_map, function in GstVaapiImage -
-
-
-gst_vaapi_image_new, function in GstVaapiImage -
-
-
-gst_vaapi_image_new_with_image, function in GstVaapiImage -
-
-
-gst_vaapi_image_pool_new, function in GstVaapiImagePool -
-
-
-gst_vaapi_image_unmap, function in GstVaapiImage -
-
-
-gst_vaapi_image_update_from_buffer, function in GstVaapiImage -
-
-
-GST_VAAPI_IMAGE_WIDTH, macro in gstvaapiimage -
-
-
-gst_vaapi_object_get_display, function in GstVaapiObject -
-
-
-gst_vaapi_object_get_id, function in GstVaapiObject -
-
-
-gst_vaapi_object_lock_display, function in GstVaapiObject -
-
-
-gst_vaapi_object_unlock_display, function in GstVaapiObject -
-
-
-gst_vaapi_parser_frame_append_unit, function in GstVaapiParserFrame -
-
-
-gst_vaapi_parser_frame_free, function in GstVaapiParserFrame -
-
-
-gst_vaapi_parser_frame_new, function in GstVaapiParserFrame -
-
-
-gst_vaapi_parser_frame_ref, macro in GstVaapiParserFrame -
-
-
-gst_vaapi_parser_frame_replace, macro in GstVaapiParserFrame -
-
-
-gst_vaapi_parser_frame_unref, macro in GstVaapiParserFrame -
-
-
-gst_vaapi_pixmap_get_format, function in GstVaapiPixmap -
-
-
-gst_vaapi_pixmap_get_height, function in GstVaapiPixmap -
-
-
-gst_vaapi_pixmap_get_size, function in GstVaapiPixmap -
-
-
-gst_vaapi_pixmap_get_width, function in GstVaapiPixmap -
-
-
-gst_vaapi_pixmap_put_surface, function in GstVaapiPixmap -
-
-
-gst_vaapi_pixmap_ref, function in GstVaapiPixmap -
-
-
-gst_vaapi_pixmap_replace, function in GstVaapiPixmap -
-
-
-gst_vaapi_pixmap_unref, function in GstVaapiPixmap -
-
-
-gst_vaapi_pixmap_x11_get_xid, function in GstVaapiPixmapX11 -
-
-
-gst_vaapi_pixmap_x11_is_foreign_xid, function in GstVaapiPixmapX11 -
-
-
-gst_vaapi_pixmap_x11_new, function in GstVaapiPixmapX11 -
-
-
-gst_vaapi_pixmap_x11_new_with_xid, function in GstVaapiPixmapX11 -
-
-
-GST_VAAPI_PIXMAP_XPIXMAP, macro in GstVaapiPixmapX11 -
-
-
-GST_VAAPI_POPCOUNT32, macro in GstVaapiValue -
-
-
-gst_vaapi_profile, function in GstVaapiProfile -
-
-
-gst_vaapi_profile_from_caps, function in GstVaapiProfile -
-
-
-gst_vaapi_profile_get_caps, function in GstVaapiProfile -
-
-
-gst_vaapi_profile_get_codec, function in GstVaapiProfile -
-
-
-gst_vaapi_profile_get_va_profile, function in GstVaapiProfile -
-
-
-gst_vaapi_subpicture_get_flags, function in GstVaapiSubpicture -
-
-
-gst_vaapi_subpicture_get_global_alpha, function in GstVaapiSubpicture -
-
-
-gst_vaapi_subpicture_get_id, function in GstVaapiSubpicture -
-
-
-gst_vaapi_subpicture_get_image, function in GstVaapiSubpicture -
-
-
-gst_vaapi_subpicture_new, function in GstVaapiSubpicture -
-
-
-gst_vaapi_subpicture_new_from_overlay_rectangle, function in GstVaapiSubpicture -
-
-
-gst_vaapi_subpicture_set_global_alpha, function in GstVaapiSubpicture -
-
-
-gst_vaapi_subpicture_set_image, function in GstVaapiSubpicture -
-
-
-gst_vaapi_surface_associate_subpicture, function in GstVaapiSurface -
-
-
-gst_vaapi_surface_deassociate_subpicture, function in GstVaapiSurface -
-
-
-gst_vaapi_surface_derive_image, function in GstVaapiSurface -
-
-
-gst_vaapi_surface_get_chroma_type, function in GstVaapiSurface -
-
-
-gst_vaapi_surface_get_format, function in GstVaapiSurface -
-
-
-gst_vaapi_surface_get_height, function in GstVaapiSurface -
-
-
-gst_vaapi_surface_get_id, function in GstVaapiSurface -
-
-
-gst_vaapi_surface_get_image, function in GstVaapiSurface -
-
-
-gst_vaapi_surface_get_size, function in GstVaapiSurface -
-
-
-gst_vaapi_surface_get_width, function in GstVaapiSurface -
-
-
-gst_vaapi_surface_new, function in GstVaapiSurface -
-
-
-gst_vaapi_surface_new_with_format, function in GstVaapiSurface -
-
-
-gst_vaapi_surface_pool_new, function in GstVaapiSurfacePool -
-
-
-gst_vaapi_surface_proxy_copy, function in GstVaapiSurfaceProxy -
-
-
-gst_vaapi_surface_proxy_get_duration, function in GstVaapiSurfaceProxy -
-
-
-gst_vaapi_surface_proxy_get_flags, function in GstVaapiSurfaceProxy -
-
-
-gst_vaapi_surface_proxy_get_surface, function in GstVaapiSurfaceProxy -
-
-
-gst_vaapi_surface_proxy_get_surface_id, function in GstVaapiSurfaceProxy -
-
-
-gst_vaapi_surface_proxy_get_timestamp, function in GstVaapiSurfaceProxy -
-
-
-gst_vaapi_surface_proxy_new_from_pool, function in GstVaapiSurfaceProxy -
-
-
-gst_vaapi_surface_proxy_ref, function in GstVaapiSurfaceProxy -
-
-
-gst_vaapi_surface_proxy_replace, function in GstVaapiSurfaceProxy -
-
-
-gst_vaapi_surface_proxy_set_destroy_notify, function in GstVaapiSurfaceProxy -
-
-
-gst_vaapi_surface_proxy_unref, function in GstVaapiSurfaceProxy -
-
-
-gst_vaapi_surface_put_image, function in GstVaapiSurface -
-
-
-gst_vaapi_surface_query_status, function in GstVaapiSurface -
-
-
-gst_vaapi_surface_sync, function in GstVaapiSurface -
-
-
-gst_vaapi_texture_egl_new, function in GstVaapiTextureEGL -
-
-
-gst_vaapi_texture_egl_new_wrapped, function in GstVaapiTextureEGL -
-
-
-gst_vaapi_texture_get_format, function in GstVaapiTexture -
-
-
-gst_vaapi_texture_get_height, function in GstVaapiTexture -
-
-
-gst_vaapi_texture_get_id, function in GstVaapiTexture -
-
-
-gst_vaapi_texture_get_orientation_flags, function in GstVaapiTexture -
-
-
-gst_vaapi_texture_get_size, function in GstVaapiTexture -
-
-
-gst_vaapi_texture_get_target, function in GstVaapiTexture -
-
-
-gst_vaapi_texture_get_width, function in GstVaapiTexture -
-
-
-gst_vaapi_texture_glx_new, function in GstVaapiTextureGLX -
-
-
-gst_vaapi_texture_glx_new_wrapped, function in GstVaapiTextureGLX -
-
-
-gst_vaapi_texture_new, function in GstVaapiTexture -
-
-
-gst_vaapi_texture_new_wrapped, function in GstVaapiTexture -
-
-
-gst_vaapi_texture_put_surface, function in GstVaapiTexture -
-
-
-gst_vaapi_texture_ref, function in GstVaapiTexture -
-
-
-gst_vaapi_texture_replace, function in GstVaapiTexture -
-
-
-gst_vaapi_texture_set_orientation_flags, function in GstVaapiTexture -
-
-
-gst_vaapi_texture_unref, function in GstVaapiTexture -
-
-
-GST_VAAPI_TYPE_POINT, macro in GstVaapiValue -
-
-
-GST_VAAPI_TYPE_RATE_CONTROL, macro in GstVaapiValue -
-
-
-GST_VAAPI_TYPE_RECTANGLE, macro in GstVaapiValue -
-
-
-GST_VAAPI_TYPE_RENDER_MODE, macro in GstVaapiValue -
-
-
-GST_VAAPI_TYPE_ROTATION, macro in GstVaapiValue -
-
-
-gst_vaapi_video_format_from_va_format, function in GstVideoFormat -
-
-
-gst_vaapi_video_format_from_va_fourcc, function in GstVideoFormat -
-
-
-gst_vaapi_video_format_get_chroma_type, function in GstVideoFormat -
-
-
-gst_vaapi_video_format_get_score, function in GstVideoFormat -
-
-
-gst_vaapi_video_format_is_rgb, function in GstVideoFormat -
-
-
-gst_vaapi_video_format_is_yuv, function in GstVideoFormat -
-
-
-gst_vaapi_video_format_to_string, function in GstVideoFormat -
-
-
-gst_vaapi_video_format_to_va_format, function in GstVideoFormat -
-
-
-gst_vaapi_video_pool_add_object, function in GstVaapiVideoPool -
-
-
-gst_vaapi_video_pool_add_objects, function in GstVaapiVideoPool -
-
-
-gst_vaapi_video_pool_get_capacity, function in GstVaapiVideoPool -
-
-
-gst_vaapi_video_pool_get_display, function in GstVaapiVideoPool -
-
-
-gst_vaapi_video_pool_get_object, function in GstVaapiVideoPool -
-
-
-gst_vaapi_video_pool_get_object_type, function in GstVaapiVideoPool -
-
-
-gst_vaapi_video_pool_get_size, function in GstVaapiVideoPool -
-
-
-gst_vaapi_video_pool_put_object, function in GstVaapiVideoPool -
-
-
-gst_vaapi_video_pool_reserve, function in GstVaapiVideoPool -
-
-
-gst_vaapi_video_pool_set_capacity, function in GstVaapiVideoPool -
-
-
-gst_vaapi_window_drm_new, function in GstVaapiWindowDRM -
-
-
-gst_vaapi_window_egl_new, function in GstVaapiWindowEGL -
-
-
-gst_vaapi_window_get_display, function in GstVaapiWindow -
-
-
-gst_vaapi_window_get_fullscreen, function in GstVaapiWindow -
-
-
-gst_vaapi_window_get_height, function in GstVaapiWindow -
-
-
-gst_vaapi_window_get_size, function in GstVaapiWindow -
-
-
-gst_vaapi_window_get_width, function in GstVaapiWindow -
-
-
-gst_vaapi_window_glx_get_context, function in GstVaapiWindowGLX -
-
-
-gst_vaapi_window_glx_make_current, function in GstVaapiWindowGLX -
-
-
-gst_vaapi_window_glx_new, function in GstVaapiWindowGLX -
-
-
-gst_vaapi_window_glx_new_with_xid, function in GstVaapiWindowGLX -
-
-
-gst_vaapi_window_glx_put_texture, function in GstVaapiWindowGLX -
-
-
-gst_vaapi_window_glx_set_context, function in GstVaapiWindowGLX -
-
-
-gst_vaapi_window_glx_swap_buffers, function in GstVaapiWindowGLX -
-
-
-gst_vaapi_window_hide, function in GstVaapiWindow -
-
-
-gst_vaapi_window_put_pixmap, function in GstVaapiWindow -
-
-
-gst_vaapi_window_put_surface, function in GstVaapiWindow -
-
-
-gst_vaapi_window_set_fullscreen, function in GstVaapiWindow -
-
-
-gst_vaapi_window_set_height, function in GstVaapiWindow -
-
-
-gst_vaapi_window_set_size, function in GstVaapiWindow -
-
-
-gst_vaapi_window_set_width, function in GstVaapiWindow -
-
-
-gst_vaapi_window_show, function in GstVaapiWindow -
-
-
-gst_vaapi_window_wayland_new, function in GstVaapiWindowWayland -
-
-
-gst_vaapi_window_x11_get_xid, function in GstVaapiWindowX11 -
-
-
-gst_vaapi_window_x11_is_foreign_xid, function in GstVaapiWindowX11 -
-
-
-gst_vaapi_window_x11_new, function in GstVaapiWindowX11 -
-
-
-gst_vaapi_window_x11_new_with_xid, function in GstVaapiWindowX11 -
-
-
-GST_VAAPI_WINDOW_XWINDOW, macro in GstVaapiWindowX11 -
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/ch01.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/ch01.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/ch01.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/ch01.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,154 +0,0 @@ - - - - -gst-plugins-vaapi Library: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-

-gst-plugins-vaapi Library

-
-
-GstVideoFormat — Video format helpers for VA-API -
-
-Basic data structures -
-
-GstVaapiDisplay — VA display abstraction -
-
-GstVaapiDisplayX11 — VA/X11 display abstraction -
-
-GstVaapiDisplayGLX — VA/GLX display abstraction -
-
-GstVaapiDisplayEGL -
-
-GstVaapiDisplayDRM — VA/DRM display abstraction -
-
-GstVaapiDisplayWayland — VA/Wayland display abstraction -
-
-GstVaapiWindow — VA window abstraction -
-
-GstVaapiWindowX11 — VA/X11 window abstraction -
-
-GstVaapiWindowGLX — VA/GLX window abstraction -
-
-GstVaapiWindowEGL — VA/EGL window abstraction -
-
-GstVaapiWindowDRM — VA/DRM dummy window abstraction -
-
-GstVaapiWindowWayland — VA/Wayland window abstraction -
-
-GstVaapiPixmap — Pixmap abstraction -
-
-GstVaapiPixmapX11 — X11 pixmap abstraction -
-
-GstVaapiObject — Base VA object -
-
-GstVaapiSurface — VA surface abstraction -
-
-GstVaapiImage — VA image abstraction -
-
-GstVaapiSubpicture — VA subpicture abstraction -
-
-GstVaapiTexture — VA/GLX texture abstraction -
-
-GstVaapiTextureEGL — VA/EGL texture abstraction -
-
-GstVaapiTextureGLX — VA/GLX texture abstraction -
-
-GstVaapiProfile — VA profile abstraction -
-
-GstVaapiVideoPool — Video object pool abstraction -
-
-GstVaapiSurfacePool — VA surface pool -
-
-GstVaapiImagePool — VA image pool -
-
-GstVaapiDecoder — VA decoder abstraction -
-
-GstVaapiDecoderJpeg — JPEG decoder -
-
-GstVaapiDecoderMpeg2 — MPEG-2 decoder -
-
-GstVaapiDecoderMpeg4 — MPEG-4 decoder, include h263/divx/xvid support -
-
-GstVaapiDecoderH264 — H.264 decoder -
-
-GstVaapiDecoderVC1 — VC-1 decoder -
-
-GstVaapiDecoderVp8 — VP8 decoder -
-
-GstVaapiDecoderH265 — H.265 decoder -
-
-GstVaapiDecoderUnit — Decoder unit -
-
-GstVaapiSurfaceProxy — VA surface proxy -
-
-GstVaapiFilter -
-
-GstVaapiValue — GValue implementations specific to VA-API -
-
-GstVaapiParserFrame — VA decoder frame -
-
-GstVaapiContext — VA context abstraction -
-
-
- - - \ No newline at end of file Binary files /tmp/tmpUUqCms/Qg4lAwNSh6/gstreamer-vaapi-0.7.0/docs/reference/libs/html/home.png and /tmp/tmpUUqCms/c79LJCUvkE/gstreamer-vaapi-1.8.2/docs/reference/libs/html/home.png differ diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/index.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/index.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/index.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/index.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,157 +0,0 @@ - - - - -GStreamer VA-API Plugins 1.6 Library Reference Manual: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - -
-
-
-
-
-
-
gst-plugins-vaapi Library
-
-
-GstVideoFormat — Video format helpers for VA-API -
-
-Basic data structures -
-
-GstVaapiDisplay — VA display abstraction -
-
-GstVaapiDisplayX11 — VA/X11 display abstraction -
-
-GstVaapiDisplayGLX — VA/GLX display abstraction -
-
-GstVaapiDisplayEGL -
-
-GstVaapiDisplayDRM — VA/DRM display abstraction -
-
-GstVaapiDisplayWayland — VA/Wayland display abstraction -
-
-GstVaapiWindow — VA window abstraction -
-
-GstVaapiWindowX11 — VA/X11 window abstraction -
-
-GstVaapiWindowGLX — VA/GLX window abstraction -
-
-GstVaapiWindowEGL — VA/EGL window abstraction -
-
-GstVaapiWindowDRM — VA/DRM dummy window abstraction -
-
-GstVaapiWindowWayland — VA/Wayland window abstraction -
-
-GstVaapiPixmap — Pixmap abstraction -
-
-GstVaapiPixmapX11 — X11 pixmap abstraction -
-
-GstVaapiObject — Base VA object -
-
-GstVaapiSurface — VA surface abstraction -
-
-GstVaapiImage — VA image abstraction -
-
-GstVaapiSubpicture — VA subpicture abstraction -
-
-GstVaapiTexture — VA/GLX texture abstraction -
-
-GstVaapiTextureEGL — VA/EGL texture abstraction -
-
-GstVaapiTextureGLX — VA/GLX texture abstraction -
-
-GstVaapiProfile — VA profile abstraction -
-
-GstVaapiVideoPool — Video object pool abstraction -
-
-GstVaapiSurfacePool — VA surface pool -
-
-GstVaapiImagePool — VA image pool -
-
-GstVaapiDecoder — VA decoder abstraction -
-
-GstVaapiDecoderJpeg — JPEG decoder -
-
-GstVaapiDecoderMpeg2 — MPEG-2 decoder -
-
-GstVaapiDecoderMpeg4 — MPEG-4 decoder, include h263/divx/xvid support -
-
-GstVaapiDecoderH264 — H.264 decoder -
-
-GstVaapiDecoderVC1 — VC-1 decoder -
-
-GstVaapiDecoderVp8 — VP8 decoder -
-
-GstVaapiDecoderH265 — H.265 decoder -
-
-GstVaapiDecoderUnit — Decoder unit -
-
-GstVaapiSurfaceProxy — VA surface proxy -
-
-GstVaapiFilter -
-
-GstVaapiValue — GValue implementations specific to VA-API -
-
-GstVaapiParserFrame — VA decoder frame -
-
-GstVaapiContext — VA context abstraction -
-
-
Object Hierarchy
-
API Index
-
Annotation Glossary
-
-

- To ease the creation of plugins, a Gstreamer-oriented library was created, - which wraps VA-API. -

-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/index.sgml gstreamer-vaapi-1.8.2/docs/reference/libs/html/index.sgml --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/index.sgml 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/index.sgml 1970-01-01 00:00:00.000000000 +0000 @@ -1,652 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Binary files /tmp/tmpUUqCms/Qg4lAwNSh6/gstreamer-vaapi-0.7.0/docs/reference/libs/html/left-insensitive.png and /tmp/tmpUUqCms/c79LJCUvkE/gstreamer-vaapi-1.8.2/docs/reference/libs/html/left-insensitive.png differ Binary files /tmp/tmpUUqCms/Qg4lAwNSh6/gstreamer-vaapi-0.7.0/docs/reference/libs/html/left.png and /tmp/tmpUUqCms/c79LJCUvkE/gstreamer-vaapi-1.8.2/docs/reference/libs/html/left.png differ diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-Basic-data-structures.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-Basic-data-structures.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-Basic-data-structures.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-Basic-data-structures.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,205 +0,0 @@ - - - - -Basic data structures: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

Basic data structures

-

Basic data structures

-
-
-

Functions

-
---- - - - - -
#define -GST_VAAPI_ID_ARGS() -
-
-
-

Types and Values

-
---- - - - - - - - - - - - - - - - - - - -
typedefGstVaapiID
#defineGST_VAAPI_ID_FORMAT
structGstVaapiPoint
structGstVaapiRectangle
-
-
-

Description

-
-
-

Functions

-
-

GST_VAAPI_ID_ARGS()

-
#define GST_VAAPI_ID_ARGS(id) GSIZE_TO_POINTER(id)
-
-

Can be used together with GST_VAAPI_ID_FORMAT to properly output -an integer value in a printf()-style text message.

-
-

Parameters

-
----- - - - - - -

id

a GstVaapiID

 
-
-
-
-
-

Types and Values

-
-

GstVaapiID

-
typedef gsize GstVaapiID;
-
-

An integer large enough to hold a generic VA id or a pointer -wherever necessary.

-
-
-
-

GST_VAAPI_ID_FORMAT

-
#define GST_VAAPI_ID_FORMAT "p"
-
-

Can be used together with GST_VAAPI_ID_ARGS to properly output an -integer value in a printf()-style text message.

-
-printf("id: %" GST_VAAPI_ID_FORMAT "\n", GST_VAAPI_ID_ARGS(id));
-
-
-
-
-

struct GstVaapiPoint

-
struct GstVaapiPoint {
-    guint32 x;
-    guint32 y;
-};
-
-

A location within a surface.

-
-

Members

-
----- - - - - - - - - - - - - -

guint32 x;

X coordinate

 

guint32 y;

Y coordinate

 
-
-
-
-
-

struct GstVaapiRectangle

-
struct GstVaapiRectangle {
-    guint32 x;
-    guint32 y;
-    guint32 width;
-    guint32 height;
-};
-
-

A rectangle region within a surface.

-
-

Members

-
----- - - - - - - - - - - - - - - - - - - - - - - -

guint32 x;

X coordinate

 

guint32 y;

Y coordinate

 

guint32 width;

region width

 

guint32 height;

region height

 
-
-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs.devhelp2 gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs.devhelp2 --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs.devhelp2 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs.devhelp2 1970-01-01 00:00:00.000000000 +0000 @@ -1,468 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiContext.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiContext.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiContext.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiContext.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,375 +0,0 @@ - - - - -GstVaapiContext: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiContext

-

GstVaapiContext — VA context abstraction

-
-
-

Functions

-
---- - - - - - - - - - - - - - - - - - - - - - - -
-GstVaapiContext * - -gst_vaapi_context_new () -
-gboolean - -gst_vaapi_context_reset () -
-GstVaapiID - -gst_vaapi_context_get_id () -
-GstVaapiSurfaceProxy * - -gst_vaapi_context_get_surface_proxy () -
-guint - -gst_vaapi_context_get_surface_count () -
-
-
-

Types and Values

-
---- - - - - - - - - - - - - - - - - - - -
structGstVaapiConfigInfoEncoder
structGstVaapiContextInfo
structGstVaapiContext
enumGstVaapiContextUsage
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_context_new ()

-
GstVaapiContext *
-gst_vaapi_context_new (GstVaapiDisplay *display,
-                       const GstVaapiContextInfo *cip);
-

Creates a new GstVaapiContext with the configuration specified by -cip -, thus including profile, entry-point, encoded size and maximum -number of reference frames reported by the bitstream.

-
-

Parameters

-
----- - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

cip

a pointer to the GstVaapiContextInfo

 
-
-
-

Returns

-

the newly allocated GstVaapiContext object

-
-
-
-
-

gst_vaapi_context_reset ()

-
gboolean
-gst_vaapi_context_reset (GstVaapiContext *context,
-                         const GstVaapiContextInfo *new_cip);
-

Resets context - to the configuration specified by new_cip -, thus -including profile, entry-point, encoded size and maximum number of -reference frames reported by the bitstream.

-
-

Parameters

-
----- - - - - - - - - - - - - -

context

a GstVaapiContext

 

new_cip

a pointer to the new GstVaapiContextInfo details

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

gst_vaapi_context_get_id ()

-
GstVaapiID
-gst_vaapi_context_get_id (GstVaapiContext *context);
-

Returns the underlying VAContextID of the context -.

-
-

Parameters

-
----- - - - - - -

context

a GstVaapiContext

 
-
-
-

Returns

-

the underlying VA context id

-
-
-
-
-

gst_vaapi_context_get_surface_proxy ()

-
GstVaapiSurfaceProxy *
-gst_vaapi_context_get_surface_proxy (GstVaapiContext *context);
-

Acquires a free surface, wrapped into a GstVaapiSurfaceProxy. The -returned surface will be automatically released when the proxy is -destroyed. So, it is enough to call gst_vaapi_surface_proxy_unref() -after usage.

-

This function returns NULL if there is no free surface available -in the pool. The surfaces are pre-allocated during context creation -though.

-
-

Parameters

-
----- - - - - - -

context

a GstVaapiContext

 
-
-
-

Returns

-

a free surface, or NULL if none is available

-
-
-
-
-

gst_vaapi_context_get_surface_count ()

-
guint
-gst_vaapi_context_get_surface_count (GstVaapiContext *context);
-

Retrieves the number of free surfaces left in the pool.

-
-

Parameters

-
----- - - - - - -

context

a GstVaapiContext

 
-
-
-

Returns

-

the number of free surfaces available in the pool

-
-
-
-
-

Types and Values

-
-

struct GstVaapiConfigInfoEncoder

-
struct GstVaapiConfigInfoEncoder {
-  GstVaapiRateControl rc_mode;
-  guint packed_headers;
-};
-
-

Extra configuration for encoding.

-
-

Members

-
----- - - - - - - - - - - - - -

GstVaapiRateControl rc_mode;

rate-control mode (GstVaapiRateControl).

 

guint packed_headers;

notify encoder that packed headers are submitted (mask).

 
-
-
-
-
-

struct GstVaapiContextInfo

-
struct GstVaapiContextInfo {
-  GstVaapiContextUsage usage;
-  GstVaapiProfile profile;
-  GstVaapiEntrypoint entrypoint;
-  GstVaapiChromaType chroma_type;
-  guint width;
-  guint height;
-  guint ref_frames;
-  union _GstVaapiConfigInfo {
-    GstVaapiConfigInfoEncoder encoder;
-  } config;
-};
-
-

Structure holding VA context info like encoded size, decoder -profile and entry-point to use, and maximum number of reference -frames reported by the bitstream.

-
-
-
-

struct GstVaapiContext

-
struct GstVaapiContext {
-};
-
-

A VA context wrapper.

-
-
-
-

enum GstVaapiContextUsage

-

The set of supported VA context usages.

-
-

Members

-
----- - - - - - - - - - - - - - - - - - -

GST_VAAPI_CONTEXT_USAGE_DECODE

  

GST_VAAPI_CONTEXT_USAGE_ENCODE

  

GST_VAAPI_CONTEXT_USAGE_VPP

  
-
-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDecoderH264.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDecoderH264.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDecoderH264.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDecoderH264.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ - - - - -GstVaapiDecoderH264: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiDecoderH264

-

GstVaapiDecoderH264 — H.264 decoder

-
-
-

Functions

-
---- - - - - -
-GstVaapiDecoder * - -gst_vaapi_decoder_h264_new () -
-
-
-

Types and Values

-
---- - - - - -
 GstVaapiDecoderH264
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_decoder_h264_new ()

-
GstVaapiDecoder *
-gst_vaapi_decoder_h264_new (GstVaapiDisplay *display,
-                            GstCaps *caps);
-

Creates a new GstVaapiDecoder for MPEG-2 decoding. The caps - can -hold extra information like codec-data and pictured coded size.

-
-

Parameters

-
----- - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

caps

a GstCaps holding codec information

 
-
-
-

Returns

-

the newly allocated GstVaapiDecoder object

-
-
-
-
-

Types and Values

-
-

GstVaapiDecoderH264

-
typedef struct _GstVaapiDecoderH264 GstVaapiDecoderH264;
-

A decoder based on H264.

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDecoderH265.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDecoderH265.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDecoderH265.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDecoderH265.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,205 +0,0 @@ - - - - -GstVaapiDecoderH265: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiDecoderH265

-

GstVaapiDecoderH265 — H.265 decoder

-
-
-

Functions

-
---- - - - - - - - - - - -
-GstVaapiDecoder * - -gst_vaapi_decoder_h265_new () -
-void - -gst_vaapi_decoder_h265_set_alignment () -
-
-
-

Types and Values

-
---- - - - - - - - - - - -
 GstVaapiDecoderH265
enumGstVaapiStreamAlignH265
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_decoder_h265_new ()

-
GstVaapiDecoder *
-gst_vaapi_decoder_h265_new (GstVaapiDisplay *display,
-                            GstCaps *caps);
-

Creates a new GstVaapiDecoder for MPEG-2 decoding. The caps - can -hold extra information like codec-data and pictured coded size.

-
-

Parameters

-
----- - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

caps

a GstCaps holding codec information

 
-
-
-

Returns

-

the newly allocated GstVaapiDecoder object

-
-
-
-
-

gst_vaapi_decoder_h265_set_alignment ()

-
void
-gst_vaapi_decoder_h265_set_alignment (GstVaapiDecoderH265 *decoder,
-                                      GstVaapiStreamAlignH265 alignment);
-

Specifies how stream buffers are aligned / fed, i.e. the boundaries -of each buffer that is supplied to the decoder. This could be no -specific alignment, NAL unit boundaries, or access unit boundaries.

-
-

Parameters

-
----- - - - - - - - - - - - - -

decoder

a GstVaapiDecoderH265

 

alignment

the GstVaapiStreamAlignH265

 
-
-
-
-
-

Types and Values

-
-

GstVaapiDecoderH265

-
typedef struct _GstVaapiDecoderH265 GstVaapiDecoderH265;
-

A decoder based on H265.

-
-
-
-

enum GstVaapiStreamAlignH265

-

Set of possible buffer alignments for H.265 streams.

-
-

Members

-
----- - - - - - - - - - - - - - - - - - -

GST_VAAPI_STREAM_ALIGN_H265_NONE

-

Generic H.265 stream buffers

-
 

GST_VAAPI_STREAM_ALIGN_H265_NALU

-

H.265 stream buffers aligned NAL - unit boundaries

-
 

GST_VAAPI_STREAM_ALIGN_H265_AU

-

H.265 stream buffers aligned on - access unit boundaries

-
 
-
-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-gstvaapidecoder.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-gstvaapidecoder.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-gstvaapidecoder.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-gstvaapidecoder.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,541 +0,0 @@ - - - - -GstVaapiDecoder: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiDecoder

-

GstVaapiDecoder — VA decoder abstraction

-
- -
-

Types and Values

-
---- - - - - - - - - - - -
enumGstVaapiDecoderStatus
 GstVaapiDecoder
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_decoder_get_caps ()

-
GstCaps *
-gst_vaapi_decoder_get_caps (GstVaapiDecoder *decoder);
-

Retrieves the decoder - caps. The decoder owns the returned caps, so -use gst_caps_ref() whenever necessary.

-
-

Parameters

-
----- - - - - - -

decoder

a GstVaapiDecoder

 
-
-
-

Returns

-

the decoder -caps

-
-
-
-
-

gst_vaapi_decoder_get_codec ()

-
GstVaapiCodec
-gst_vaapi_decoder_get_codec (GstVaapiDecoder *decoder);
-

Retrieves the decoder - codec type.

-
-

Parameters

-
----- - - - - - -

decoder

a GstVaapiDecoder

 
-
-
-

Returns

-

the GstVaapiCodec type for decoder -

-
-
-
-
-

gst_vaapi_decoder_get_codec_state ()

-
GstVideoCodecState *
-gst_vaapi_decoder_get_codec_state (GstVaapiDecoder *decoder);
-

Retrieves the decoder - codec state. The decoder owns the returned -GstVideoCodecState structure, so use gst_video_codec_state_ref() -whenever necessary.

-
-

Parameters

-
----- - - - - - -

decoder

a GstVaapiDecoder

 
-
-
-

Returns

-

the GstVideoCodecState object for decoder -

-
-
-
-
-

gst_vaapi_decoder_put_buffer ()

-
gboolean
-gst_vaapi_decoder_put_buffer (GstVaapiDecoder *decoder,
-                              GstBuffer *buf);
-

Queues a GstBuffer to the HW decoder. The decoder holds a -reference to buf -.

-

Caller can notify an End-Of-Stream with buf - set to NULL. However, -if an empty buffer is passed, i.e. a buffer with NULL data pointer -or size equals to zero, then the function ignores this buffer and -returns TRUE.

-
-

Parameters

-
----- - - - - - - - - - - - - -

decoder

a GstVaapiDecoder

 

buf

a GstBuffer

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

gst_vaapi_decoder_get_surface ()

-
GstVaapiDecoderStatus
-gst_vaapi_decoder_get_surface (GstVaapiDecoder *decoder,
-                               GstVaapiSurfaceProxy **out_proxy_ptr);
-

Flushes encoded buffers to the decoder and returns a decoded -surface, if any.

-

On successful return, *out_proxy_ptr - contains the decoded surface -as a GstVaapiSurfaceProxy. The caller owns this object, so -gst_vaapi_surface_proxy_unref() shall be called after usage.

-
-

Parameters

-
----- - - - - - - - - - - - - -

decoder

a GstVaapiDecoder

 

out_proxy_ptr

the next decoded surface as a GstVaapiSurfaceProxy

 
-
-
-

Returns

-

a GstVaapiDecoderStatus

-
-
-
-
-

gst_vaapi_decoder_get_frame ()

-
GstVaapiDecoderStatus
-gst_vaapi_decoder_get_frame (GstVaapiDecoder *decoder,
-                             GstVideoCodecFrame **out_frame_ptr);
-

On successful return, *out_frame_ptr - contains the next decoded -frame available as a GstVideoCodecFrame. The caller owns this -object, so gst_video_codec_frame_unref() shall be called after -usage. Otherwise, GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA - is -returned if no decoded frame is available.

-

The actual surface is available as a GstVaapiSurfaceProxy attached -to the user-data anchor of the output frame. Ownership of the proxy -is transferred to the frame.

-

This is equivalent to gst_vaapi_decoder_get_frame_with_timeout() -with a timeout value of zero.

-
-

Parameters

-
----- - - - - - - - - - - - - -

decoder

a GstVaapiDecoder

 

out_frame_ptr

the next decoded frame as a GstVideoCodecFrame

 
-
-
-

Returns

-

a GstVaapiDecoderStatus

-
-
-
-
-

gst_vaapi_decoder_get_frame_with_timeout ()

-
GstVaapiDecoderStatus
-gst_vaapi_decoder_get_frame_with_timeout
-                               (GstVaapiDecoder *decoder,
-                                GstVideoCodecFrame **out_frame_ptr,
-                                guint64 timeout);
-

On successful return, *out_frame_ptr - contains the next decoded -frame available as a GstVideoCodecFrame. The caller owns this -object, so gst_video_codec_frame_unref() shall be called after -usage. Otherwise, GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA - is -returned if no decoded frame is available.

-

The actual surface is available as a GstVaapiSurfaceProxy attached -to the user-data anchor of the output frame. Ownership of the proxy -is transferred to the frame.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

decoder

a GstVaapiDecoder

 

out_frame_ptr

the next decoded frame as a GstVideoCodecFrame

 

timeout

the number of microseconds to wait for the frame, at most

 
-
-
-

Returns

-

a GstVaapiDecoderStatus

-
-
-
-
-

gst_vaapi_decoder_parse ()

-
GstVaapiDecoderStatus
-gst_vaapi_decoder_parse (GstVaapiDecoder *decoder,
-                         GstVideoCodecFrame *frame,
-                         GstAdapter *adapter,
-                         gboolean at_eos,
-                         guint *got_unit_size_ptr,
-                         gboolean *got_frame_ptr);
-
-
-
-

gst_vaapi_decoder_decode ()

-
GstVaapiDecoderStatus
-gst_vaapi_decoder_decode (GstVaapiDecoder *decoder,
-                          GstVideoCodecFrame *frame);
-
-
-
-

Types and Values

-
-

enum GstVaapiDecoderStatus

-

Decoder status for gst_vaapi_decoder_get_surface().

-
-

Members

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

GST_VAAPI_DECODER_STATUS_SUCCESS

-

Success.

-
 

GST_VAAPI_DECODER_STATUS_END_OF_STREAM

-

End-Of-Stream.

-
 

GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED

-

No memory left.

-
 

GST_VAAPI_DECODER_STATUS_ERROR_INIT_FAILED

-

Decoder initialization failure.

-
 

GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC

-

Unsupported codec.

-
 

GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA

-

Not enough input data to decode.

-
 

GST_VAAPI_DECODER_STATUS_ERROR_NO_SURFACE

-

No surface left to hold the decoded picture.

-
 

GST_VAAPI_DECODER_STATUS_ERROR_INVALID_SURFACE

-

Invalid surface.

-
 

GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER

-

Invalid or unsupported bitstream data.

-
 

GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE

-

Unsupported codec profile.

-
 

GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT

-

Unsupported chroma format.

-
 

GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER

-

Unsupported parameter.

-
 

GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN

-

Unknown error.

-
 
-
-
-
-
-

GstVaapiDecoder

-
typedef struct _GstVaapiDecoder GstVaapiDecoder;
-

A VA decoder base instance.

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDecoderJpeg.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDecoderJpeg.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDecoderJpeg.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDecoderJpeg.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ - - - - -GstVaapiDecoderJpeg: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiDecoderJpeg

-

GstVaapiDecoderJpeg — JPEG decoder

-
-
-

Functions

-
---- - - - - -
-GstVaapiDecoder * - -gst_vaapi_decoder_jpeg_new () -
-
-
-

Types and Values

-
---- - - - - -
 GstVaapiDecoderJpeg
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_decoder_jpeg_new ()

-
GstVaapiDecoder *
-gst_vaapi_decoder_jpeg_new (GstVaapiDisplay *display,
-                            GstCaps *caps);
-

Creates a new GstVaapiDecoder for JPEG decoding. The caps - can -hold extra information like codec-data and pictured coded size.

-
-

Parameters

-
----- - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

caps

a GstCaps holding codec information

 
-
-
-

Returns

-

the newly allocated GstVaapiDecoder object

-
-
-
-
-

Types and Values

-
-

GstVaapiDecoderJpeg

-
typedef struct _GstVaapiDecoderJpeg GstVaapiDecoderJpeg;
-

A decoder based on Jpeg.

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDecoderMpeg2.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDecoderMpeg2.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDecoderMpeg2.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDecoderMpeg2.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ - - - - -GstVaapiDecoderMpeg2: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiDecoderMpeg2

-

GstVaapiDecoderMpeg2 — MPEG-2 decoder

-
-
-

Functions

-
---- - - - - -
-GstVaapiDecoder * - -gst_vaapi_decoder_mpeg2_new () -
-
-
-

Types and Values

-
---- - - - - -
 GstVaapiDecoderMpeg2
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_decoder_mpeg2_new ()

-
GstVaapiDecoder *
-gst_vaapi_decoder_mpeg2_new (GstVaapiDisplay *display,
-                             GstCaps *caps);
-

Creates a new GstVaapiDecoder for MPEG-2 decoding. The caps - can -hold extra information like codec-data and pictured coded size.

-
-

Parameters

-
----- - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

caps

a GstCaps holding codec information

 
-
-
-

Returns

-

the newly allocated GstVaapiDecoder object

-
-
-
-
-

Types and Values

-
-

GstVaapiDecoderMpeg2

-
typedef struct _GstVaapiDecoderMpeg2 GstVaapiDecoderMpeg2;
-

A decoder based on Mpeg2.

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDecoderMpeg4.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDecoderMpeg4.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDecoderMpeg4.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDecoderMpeg4.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ - - - - -GstVaapiDecoderMpeg4: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiDecoderMpeg4

-

GstVaapiDecoderMpeg4 — MPEG-4 decoder, include h263/divx/xvid support

-
-
-

Functions

-
---- - - - - -
-GstVaapiDecoder * - -gst_vaapi_decoder_mpeg4_new () -
-
-
-

Types and Values

-
---- - - - - -
 GstVaapiDecoderMpeg4
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_decoder_mpeg4_new ()

-
GstVaapiDecoder *
-gst_vaapi_decoder_mpeg4_new (GstVaapiDisplay *display,
-                             GstCaps *caps);
-

Creates a new GstVaapiDecoder for MPEG-2 decoding. The caps - can -hold extra information like codec-data and pictured coded size.

-
-

Parameters

-
----- - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

caps

a GstCaps holding codec information

 
-
-
-

Returns

-

the newly allocated GstVaapiDecoder object

-
-
-
-
-

Types and Values

-
-

GstVaapiDecoderMpeg4

-
typedef struct _GstVaapiDecoderMpeg4 GstVaapiDecoderMpeg4;
-

A decoder based on Mpeg4.

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDecoderUnit.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDecoderUnit.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDecoderUnit.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDecoderUnit.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,319 +0,0 @@ - - - - -GstVaapiDecoderUnit: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiDecoderUnit

-

GstVaapiDecoderUnit — Decoder unit

-
-
-

Functions

-
---- - - - - - - - - - - - - - - - - - - -
-void - -gst_vaapi_decoder_unit_init () -
-void - -gst_vaapi_decoder_unit_clear () -
-GstVaapiDecoderUnit * - -gst_vaapi_decoder_unit_new () -
-void - -gst_vaapi_decoder_unit_set_parsed_info () -
-
-
-

Types and Values

-
---- - - - - - - - - - - -
enumGstVaapiDecoderUnitFlags
structGstVaapiDecoderUnit
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_decoder_unit_init ()

-
void
-gst_vaapi_decoder_unit_init (GstVaapiDecoderUnit *unit);
-

Initializes internal resources bound to the supplied decoder unit -.

-

note - This is an internal function used to implement lightweight -sub-classes.

-
-

Parameters

-
----- - - - - - -

unit

a GstVaapiDecoderUnit

 
-
-
-
-
-

gst_vaapi_decoder_unit_clear ()

-
void
-gst_vaapi_decoder_unit_clear (GstVaapiDecoderUnit *unit);
-

Deallocates any internal resources bound to the supplied decoder -unit -.

-

note - This is an internal function used to implement lightweight -sub-classes.

-
-

Parameters

-
----- - - - - - -

unit

a GstVaapiDecoderUnit

 
-
-
-
-
-

gst_vaapi_decoder_unit_new ()

-
GstVaapiDecoderUnit *
-gst_vaapi_decoder_unit_new (void);
-
-
-
-

gst_vaapi_decoder_unit_set_parsed_info ()

-
void
-gst_vaapi_decoder_unit_set_parsed_info
-                               (GstVaapiDecoderUnit *unit,
-                                gpointer parsed_info,
-                                GDestroyNotify destroy_notify);
-

Sets parsed_info - on the object and the GDestroyNotify that will be -called when the data is freed.

-

If some parsed_info - was previously set, then the former destroy_notify - -function will be called before the parsed_info - is replaced.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

unit

a GstVaapiDecoderUnit

 

parsed_info

parser info

 

destroy_notify

a GDestroyNotify.

[closure parsed_info]
-
-
-
-
-

Types and Values

-
-

enum GstVaapiDecoderUnitFlags

-

Flags for GstVaapiDecoderUnit.

-
-

Members

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START

-

marks the start of a frame.

-
 

GST_VAAPI_DECODER_UNIT_FLAG_FRAME_END

-

marks the end of a frame.

-
 

GST_VAAPI_DECODER_UNIT_FLAG_STREAM_END

-

marks the end of a stream.

-
 

GST_VAAPI_DECODER_UNIT_FLAG_SLICE

-

the unit contains slice data.

-
 

GST_VAAPI_DECODER_UNIT_FLAG_SKIP

-

marks the unit as unused/skipped.

-
 

GST_VAAPI_DECODER_UNIT_FLAG_LAST

  
-
-
-
-
-

struct GstVaapiDecoderUnit

-
struct GstVaapiDecoderUnit {
-    guint               flags;
-    guint               size;
-    guint               offset;
-    gpointer            parsed_info;
-    GDestroyNotify      parsed_info_destroy_notify;
-};
-
-

A chunk of bitstream data that was parsed.

-
-

Members

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

guint flags;

  

guint size;

size in bytes of this bitstream unit

 

guint offset;

relative offset in bytes to bitstream unit within the -associated GstVideoCodecFrame input_buffer

 

gpointer parsed_info;

parser-specific data (this is codec specific)

 

GDestroyNotify parsed_info_destroy_notify;

function used to release parsed_info -data

 
-
-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDecoderVC1.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDecoderVC1.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDecoderVC1.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDecoderVC1.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ - - - - -GstVaapiDecoderVC1: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiDecoderVC1

-

GstVaapiDecoderVC1 — VC-1 decoder

-
-
-

Functions

-
---- - - - - -
-GstVaapiDecoder * - -gst_vaapi_decoder_vc1_new () -
-
-
-

Types and Values

-
---- - - - - -
 GstVaapiDecoderVC1
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_decoder_vc1_new ()

-
GstVaapiDecoder *
-gst_vaapi_decoder_vc1_new (GstVaapiDisplay *display,
-                           GstCaps *caps);
-

Creates a new GstVaapiDecoder for VC-1 decoding. The caps - can -hold extra information like codec-data and pictured coded size.

-
-

Parameters

-
----- - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

caps

a GstCaps holding codec information

 
-
-
-

Returns

-

the newly allocated GstVaapiDecoder object

-
-
-
-
-

Types and Values

-
-

GstVaapiDecoderVC1

-
typedef struct _GstVaapiDecoderVC1 GstVaapiDecoderVC1;
-

A decoder based on VC1.

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDecoderVp8.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDecoderVp8.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDecoderVp8.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDecoderVp8.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ - - - - -GstVaapiDecoderVp8: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiDecoderVp8

-

GstVaapiDecoderVp8 — VP8 decoder

-
-
-

Functions

-
---- - - - - -
-GstVaapiDecoder * - -gst_vaapi_decoder_vp8_new () -
-
-
-

Types and Values

-
---- - - - - -
 GstVaapiDecoderVp8
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_decoder_vp8_new ()

-
GstVaapiDecoder *
-gst_vaapi_decoder_vp8_new (GstVaapiDisplay *display,
-                           GstCaps *caps);
-

Creates a new GstVaapiDecoder for VP8 decoding. The caps - can -hold extra information like codec-data and pictured coded size.

-
-

Parameters

-
----- - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

caps

a GstCaps holding codec information

 
-
-
-

Returns

-

the newly allocated GstVaapiDecoder object

-
-
-
-
-

Types and Values

-
-

GstVaapiDecoderVp8

-
typedef struct _GstVaapiDecoderVp8 GstVaapiDecoderVp8;
-

A decoder based on Vp8.

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDisplayDRM.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDisplayDRM.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDisplayDRM.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDisplayDRM.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,211 +0,0 @@ - - - - -GstVaapiDisplayDRM: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiDisplayDRM

-

GstVaapiDisplayDRM — VA/DRM display abstraction

-
-
-

Functions

- -
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_display_drm_new ()

-
GstVaapiDisplay *
-gst_vaapi_display_drm_new (const gchar *device_path);
-

Opens an DRM file descriptor using device_path - and returns a newly -allocated GstVaapiDisplay object. The DRM display will be cloed -when the reference count of the object reaches zero.

-

If device_path - is NULL, the DRM device path will be automatically -determined as the first positive match in the list of available DRM -devices.

-
-

Parameters

-
----- - - - - - -

device_path

the DRM device path

 
-
-
-

Returns

-

a newly allocated GstVaapiDisplay object

-
-
-
-
-

gst_vaapi_display_drm_new_with_device ()

-
GstVaapiDisplay *
-gst_vaapi_display_drm_new_with_device (gint device);
-

Creates a GstVaapiDisplay based on the open DRM device -. The -caller still owns the device file descriptor and must call close() -when all GstVaapiDisplay references are released. Doing so too -early can yield undefined behaviour.

-
-

Parameters

-
----- - - - - - -

device

an open DRM device (file descriptor)

 
-
-
-

Returns

-

a newly allocated GstVaapiDisplay object

-
-
-
-
-

gst_vaapi_display_drm_get_device ()

-
gint
-gst_vaapi_display_drm_get_device (GstVaapiDisplayDRM *display);
-

Returns the underlying DRM device file descriptor that was created -by gst_vaapi_display_drm_new() or that was bound from -gst_vaapi_display_drm_new_with_device().

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplayDRM

 
-
-
-

Returns

-

the DRM file descriptor attached to display -

-
-
-
-
-

gst_vaapi_display_drm_get_device_path ()

-
const gchar *
-gst_vaapi_display_drm_get_device_path (GstVaapiDisplayDRM *display);
-

Returns the underlying DRM device path name was created by -gst_vaapi_display_drm_new() or that was bound from -gst_vaapi_display_drm_new_with_device().

-

Note: the GstVaapiDisplayDRM object owns the resulting string, so -it shall not be deallocated.

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplayDRM

 
-
-
-

Returns

-

the DRM device path name attached to display -

-
-
-
-
-

Types and Values

-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDisplayEGL.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDisplayEGL.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDisplayEGL.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDisplayEGL.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,225 +0,0 @@ - - - - -GstVaapiDisplayEGL: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiDisplayEGL

-

GstVaapiDisplayEGL

-
-
-

Functions

- -
-
-

Types and Values

-
---- - - - - -
 GstVaapiDisplayEGL
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_display_egl_new ()

-
GstVaapiDisplay *
-gst_vaapi_display_egl_new (GstVaapiDisplay *display,
-                           guint gles_version);
-

Creates a new GstVaapiDisplay object suitable in EGL context. If -the native display - is NULL, then any type of display is picked, -i.e. one that can be successfully opened. The gles_version - will -further ensure the OpenGL ES API to use, or zero to indicate -"desktop" OpenGL.

-
-

Parameters

-
----- - - - - - - - - - - - - -

display

a GstVaapiDisplay, or NULL to pick any one

 

gles_version

the OpenGL ES version API to use

 
-
-
-

Returns

-

a newly allocated GstVaapiDisplay object

-
-
-
-
-

gst_vaapi_display_egl_new_with_native_display ()

-
GstVaapiDisplay *
-gst_vaapi_display_egl_new_with_native_display
-                               (gpointer native_display,
-                                GstVaapiDisplayType display_type,
-                                guint gles_version);
-

Creates a GstVaapiDisplay based on the native display supplied in -as native_display -. The caller still owns the display and must call -native display close function when all GstVaapiDisplay references -are released. Doing so too early can yield undefined behaviour.

-

The gles_version - will further ensure the OpenGL ES API to use, or -zero to indicate "desktop" OpenGL.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

native_display

an EGLDisplay object

 

display_type

the display type of native_display -

 

gles_version

the OpenGL ES version API to use

 
-
-
-

Returns

-

a newly allocated GstVaapiDisplay object

-
-
-
-
-

gst_vaapi_display_egl_get_gl_display ()

-
EGLDisplay
-gst_vaapi_display_egl_get_gl_display (GstVaapiDisplayEGL *display);
-
-
-
-

gst_vaapi_display_egl_set_gl_context ()

-
gboolean
-gst_vaapi_display_egl_set_gl_context (GstVaapiDisplayEGL *display,
-                                      EGLContext gl_context);
-
-
-
-

gst_vaapi_display_egl_get_gl_context ()

-
EGLContext
-gst_vaapi_display_egl_get_gl_context (GstVaapiDisplayEGL *display);
-
-
-
-

Types and Values

-
-

GstVaapiDisplayEGL

-
typedef struct {
-} GstVaapiDisplayEGL;
-
-

VA/EGL display wrapper.

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDisplayGLX.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDisplayGLX.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDisplayGLX.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDisplayGLX.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,151 +0,0 @@ - - - - -GstVaapiDisplayGLX: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiDisplayGLX

-

GstVaapiDisplayGLX — VA/GLX display abstraction

-
-
-

Functions

- -
-
-

Types and Values

-
---- - - - - -
 GstVaapiDisplayGLX
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_display_glx_new ()

-
GstVaapiDisplay *
-gst_vaapi_display_glx_new (const gchar *display_name);
-

Opens an X11 Display using display_name - and returns a newly -allocated GstVaapiDisplay object. The X11 display will be cloed -when the reference count of the object reaches zero.

-
-

Parameters

-
----- - - - - - -

display_name

the X11 display name

 
-
-
-

Returns

-

a newly allocated GstVaapiDisplay object

-
-
-
-
-

gst_vaapi_display_glx_new_with_display ()

-
GstVaapiDisplay *
-gst_vaapi_display_glx_new_with_display
-                               (Display *x11_display);
-

Creates a GstVaapiDisplay based on the X11 x11_display - -display. The caller still owns the display and must call -XCloseDisplay() when all GstVaapiDisplay references are -released. Doing so too early can yield undefined behaviour.

-
-

Parameters

-
----- - - - - - -

x11_display

an X11 Display

 
-
-
-

Returns

-

a newly allocated GstVaapiDisplay object

-
-
-
-
-

Types and Values

-
-

GstVaapiDisplayGLX

-
typedef struct _GstVaapiDisplayGLX GstVaapiDisplayGLX;
-

VA/GLX display wrapper.

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDisplay.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDisplay.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDisplay.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDisplay.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,1463 +0,0 @@ - - - - -GstVaapiDisplay: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiDisplay

-

GstVaapiDisplay — VA display abstraction

-
-
-

Functions

-
---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-GstVaapiDisplay * - -gst_vaapi_display_new_with_display () -
-GstVaapiDisplay * - -gst_vaapi_display_ref () -
-void - -gst_vaapi_display_unref () -
-void - -gst_vaapi_display_replace () -
-void - -gst_vaapi_display_lock () -
-void - -gst_vaapi_display_unlock () -
-void - -gst_vaapi_display_sync () -
-void - -gst_vaapi_display_flush () -
-GstVaapiDisplayType - -gst_vaapi_display_get_class_type () -
-GstVaapiDisplayType - -gst_vaapi_display_get_display_type () -
const gchar * - -gst_vaapi_display_get_display_name () -
-VADisplay - -gst_vaapi_display_get_display () -
-guint - -gst_vaapi_display_get_width () -
-guint - -gst_vaapi_display_get_height () -
-void - -gst_vaapi_display_get_size () -
-void - -gst_vaapi_display_get_pixel_aspect_ratio () -
-gboolean - -gst_vaapi_display_has_video_processing () -
-GArray * - -gst_vaapi_display_get_decode_profiles () -
-gboolean - -gst_vaapi_display_has_decoder () -
-GArray * - -gst_vaapi_display_get_encode_profiles () -
-gboolean - -gst_vaapi_display_has_encoder () -
-GArray * - -gst_vaapi_display_get_image_formats () -
-gboolean - -gst_vaapi_display_has_image_format () -
-GArray * - -gst_vaapi_display_get_subpicture_formats () -
-gboolean - -gst_vaapi_display_has_subpicture_format () -
-gboolean - -gst_vaapi_display_has_property () -
-gboolean - -gst_vaapi_display_get_property () -
-gboolean - -gst_vaapi_display_set_property () -
-gboolean - -gst_vaapi_display_get_render_mode () -
-gboolean - -gst_vaapi_display_set_render_mode () -
-GstVaapiRotation - -gst_vaapi_display_get_rotation () -
-gboolean - -gst_vaapi_display_set_rotation () -
const gchar * - -gst_vaapi_display_get_vendor_string () -
-gboolean - -gst_vaapi_display_has_opengl () -
-
-
-

Types and Values

-
---- - - - - - - - - - - - - - - -
enumGstVaapiDisplayType
 GstVaapiDisplay
structGstVaapiDisplayInfo
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_display_new_with_display ()

-
GstVaapiDisplay *
-gst_vaapi_display_new_with_display (VADisplay va_display);
-

Creates a new GstVaapiDisplay, using va_display - as the VA -display.

-
-

Parameters

-
----- - - - - - -

va_display

a VADisplay

 
-
-
-

Returns

-

the newly created GstVaapiDisplay object

-
-
-
-
-

gst_vaapi_display_ref ()

-
GstVaapiDisplay *
-gst_vaapi_display_ref (GstVaapiDisplay *display);
-

Atomically increases the reference count of the given display - by one.

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplay

 
-
-
-

Returns

-

The same display -argument

-
-
-
-
-

gst_vaapi_display_unref ()

-
void
-gst_vaapi_display_unref (GstVaapiDisplay *display);
-

Atomically decreases the reference count of the display - by one. If -the reference count reaches zero, the display will be free'd.

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplay

 
-
-
-
-
-

gst_vaapi_display_replace ()

-
void
-gst_vaapi_display_replace (GstVaapiDisplay **old_display_ptr,
-                           GstVaapiDisplay *new_display);
-

Atomically replaces the display display held in old_display_ptr - -with new_display -. This means that old_display_ptr - shall reference -a valid display. However, new_display - can be NULL.

-
-

Parameters

-
----- - - - - - - - - - - - - -

old_display_ptr

a pointer to a GstVaapiDisplay

 

new_display

a GstVaapiDisplay

 
-
-
-
-
-

gst_vaapi_display_lock ()

-
void
-gst_vaapi_display_lock (GstVaapiDisplay *display);
-

Locks display -. If display - is already locked by another thread, -the current thread will block until display - is unlocked by the -other thread.

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplay

 
-
-
-
-
-

gst_vaapi_display_unlock ()

-
void
-gst_vaapi_display_unlock (GstVaapiDisplay *display);
-

Unlocks display -. If another thread is blocked in a -gst_vaapi_display_lock() call for display -, it will be woken and -can lock display - itself.

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplay

 
-
-
-
-
-

gst_vaapi_display_sync ()

-
void
-gst_vaapi_display_sync (GstVaapiDisplay *display);
-

Flushes any requests queued for the windowing system and waits until -all requests have been handled. This is often used for making sure -that the display is synchronized with the current state of the program.

-

This is most useful for X11. On windowing systems where requests are -handled synchronously, this function will do nothing.

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplay

 
-
-
-
-
-

gst_vaapi_display_flush ()

-
void
-gst_vaapi_display_flush (GstVaapiDisplay *display);
-

Flushes any requests queued for the windowing system.

-

This is most useful for X11. On windowing systems where requests -are handled synchronously, this function will do nothing.

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplay

 
-
-
-
-
-

gst_vaapi_display_get_class_type ()

-
GstVaapiDisplayType
-gst_vaapi_display_get_class_type (GstVaapiDisplay *display);
-

Returns the GstVaapiDisplayType of display -. This is the type of -the object, thus the associated class, not the type of the VA -display.

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplay

 
-
-
-

Returns

-

the GstVaapiDisplayType

-
-
-
-
-

gst_vaapi_display_get_display_type ()

-
GstVaapiDisplayType
-gst_vaapi_display_get_display_type (GstVaapiDisplay *display);
-

Returns the display - name.

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplay

 
-
-
-

Returns

-

the display name

-
-
-
-
-

gst_vaapi_display_get_display_name ()

-
const gchar *
-gst_vaapi_display_get_display_name (GstVaapiDisplay *display);
-
-
-
-

gst_vaapi_display_get_display ()

-
VADisplay
-gst_vaapi_display_get_display (GstVaapiDisplay *display);
-

Returns the VADisplay bound to display -.

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplay

 
-
-
-

Returns

-

the VADisplay

-
-
-
-
-

gst_vaapi_display_get_width ()

-
guint
-gst_vaapi_display_get_width (GstVaapiDisplay *display);
-

Retrieves the width of a GstVaapiDisplay.

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplay

 
-
-
-

Returns

-

the width of the display -, in pixels

-
-
-
-
-

gst_vaapi_display_get_height ()

-
guint
-gst_vaapi_display_get_height (GstVaapiDisplay *display);
-

Retrieves the height of a GstVaapiDisplay

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplay

 
-
-
-

Returns

-

the height of the display -, in pixels

-
-
-
-
-

gst_vaapi_display_get_size ()

-
void
-gst_vaapi_display_get_size (GstVaapiDisplay *display,
-                            guint *pwidth,
-                            guint *pheight);
-

Retrieves the dimensions of a GstVaapiDisplay.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

pwidth

return location for the width, or NULL

 

pheight

return location for the height, or NULL

 
-
-
-
-
-

gst_vaapi_display_get_pixel_aspect_ratio ()

-
void
-gst_vaapi_display_get_pixel_aspect_ratio
-                               (GstVaapiDisplay *display,
-                                guint *par_n,
-                                guint *par_d);
-

Retrieves the pixel aspect ratio of a GstVaapiDisplay.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

par_n

return location for the numerator of pixel aspect ratio, or NULL

 

par_d

return location for the denominator of pixel aspect ratio, or NULL

 
-
-
-
-
-

gst_vaapi_display_has_video_processing ()

-
gboolean
-gst_vaapi_display_has_video_processing
-                               (GstVaapiDisplay *display);
-

Checks whether the underlying VA driver implementation supports -video processing (VPP) acceleration.

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplay

 
-
-
-

Returns

-

TRUE if some VPP features are available

-
-
-
-
-

gst_vaapi_display_get_decode_profiles ()

-
GArray *
-gst_vaapi_display_get_decode_profiles (GstVaapiDisplay *display);
-

Gets the supported profiles for decoding. The caller owns an extra -reference to the resulting array of GstVaapiProfile elements, so -it shall be released with g_array_unref() after usage.

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplay

 
-
-
-

Returns

-

a newly allocated GArray, or NULL or error or if -decoding is not supported at all

-
-
-
-
-

gst_vaapi_display_has_decoder ()

-
gboolean
-gst_vaapi_display_has_decoder (GstVaapiDisplay *display,
-                               GstVaapiProfile profile,
-                               GstVaapiEntrypoint entrypoint);
-

Returns whether VA display - supports profile - for decoding at the -specified entrypoint -.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

profile

a VAProfile

 

entrypoint

a GstVaaiEntrypoint

 
-
-
-

Returns

-

TRUE if VA display -supports profile -for decoding.

-
-
-
-
-

gst_vaapi_display_get_encode_profiles ()

-
GArray *
-gst_vaapi_display_get_encode_profiles (GstVaapiDisplay *display);
-

Gets the supported profiles for encoding. The caller owns an extra -reference to the resulting array of GstVaapiProfile elements, so -it shall be released with g_array_unref() after usage.

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplay

 
-
-
-

Returns

-

a newly allocated GArray, or NULL or error or if -encoding is not supported at all

-
-
-
-
-

gst_vaapi_display_has_encoder ()

-
gboolean
-gst_vaapi_display_has_encoder (GstVaapiDisplay *display,
-                               GstVaapiProfile profile,
-                               GstVaapiEntrypoint entrypoint);
-

Returns whether VA display - supports profile - for encoding at the -specified entrypoint -.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

profile

a VAProfile

 

entrypoint

a GstVaapiEntrypoint

 
-
-
-

Returns

-

TRUE if VA display -supports profile -for encoding.

-
-
-
-
-

gst_vaapi_display_get_image_formats ()

-
GArray *
-gst_vaapi_display_get_image_formats (GstVaapiDisplay *display);
-

Gets the supported image formats for gst_vaapi_surface_get_image() -or gst_vaapi_surface_put_image().

-

Note that this method does not necessarily map image formats -returned by vaQueryImageFormats(). The set of capabilities can be -stripped down, if gstreamer-vaapi does not support the format, or -expanded to cover compatible formats not exposed by the underlying -driver. e.g. I420 can be supported even if the driver only exposes -YV12.

-

Note: the caller owns an extra reference to the resulting array of -GstVideoFormat elements, so it shall be released with -g_array_unref() after usage.

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplay

 
-
-
-

Returns

-

a newly allocated GArray, or NULL on error or if -the set is empty

-
-
-
-
-

gst_vaapi_display_has_image_format ()

-
gboolean
-gst_vaapi_display_has_image_format (GstVaapiDisplay *display,
-                                    GstVideoFormat format);
-

Returns whether VA display - supports format - image format.

-
-

Parameters

-
----- - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

format

a GstVideoFormat

 
-
-
-

Returns

-

TRUE if VA display -supports format -image format

-
-
-
-
-

gst_vaapi_display_get_subpicture_formats ()

-
GArray *
-gst_vaapi_display_get_subpicture_formats
-                               (GstVaapiDisplay *display);
-

Gets the supported subpicture formats.

-

Note that this method does not necessarily map subpicture formats -returned by vaQuerySubpictureFormats(). The set of capabilities can -be stripped down if gstreamer-vaapi does not support the -format. e.g. this is the case for paletted formats like IA44.

-

Note: the caller owns an extra reference to the resulting array of -GstVideoFormat elements, so it shall be released with -g_array_unref() after usage.

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplay

 
-
-
-

Returns

-

a newly allocated GArray, or NULL on error of if -the set is empty

-
-
-
-
-

gst_vaapi_display_has_subpicture_format ()

-
gboolean
-gst_vaapi_display_has_subpicture_format
-                               (GstVaapiDisplay *display,
-                                GstVideoFormat format,
-                                guint *flags_ptr);
-

Returns whether VA display - supports format - subpicture format with -the supplied flags -.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

format

a GstVideoFormat

 

flags_ptr

pointer to GstVaapiSubpictureFlags, or zero

 
-
-
-

Returns

-

TRUE if VA display -supports format -subpicture format

-
-
-
-
-

gst_vaapi_display_has_property ()

-
gboolean
-gst_vaapi_display_has_property (GstVaapiDisplay *display,
-                                const gchar *name);
-

Returns whether VA display - supports the requested property. The -check is performed against the property name -. So, the client -application may perform this check only once and cache this -information.

-
-

Parameters

-
----- - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

name

the property name to check

 
-
-
-

Returns

-

TRUE if VA display -supports property name -

-
-
-
-
-

gst_vaapi_display_get_property ()

-
gboolean
-gst_vaapi_display_get_property (GstVaapiDisplay *display,
-                                const gchar *name,
-                                GValue *out_value);
-
-
-
-

gst_vaapi_display_set_property ()

-
gboolean
-gst_vaapi_display_set_property (GstVaapiDisplay *display,
-                                const gchar *name,
-                                const GValue *value);
-
-
-
-

gst_vaapi_display_get_render_mode ()

-
gboolean
-gst_vaapi_display_get_render_mode (GstVaapiDisplay *display,
-                                   GstVaapiRenderMode *pmode);
-

Returns the current VA display - rendering mode.

-
-

Parameters

-
----- - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

pmode

return location for the VA display -rendering mode

 
-
-
-

Returns

-

TRUE if VA display -rendering mode could be determined

-
-
-
-
-

gst_vaapi_display_set_render_mode ()

-
gboolean
-gst_vaapi_display_set_render_mode (GstVaapiDisplay *display,
-                                   GstVaapiRenderMode mode);
-

Sets the VA display - rendering mode to the supplied mode -. This -function returns FALSE if the rendering mode could not be set, -e.g. run-time switching rendering mode is not supported.

-
-

Parameters

-
----- - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

mode

the GstVaapiRenderMode to set

 
-
-
-

Returns

-

TRUE if VA display -rendering mode -could be changed -to the requested value

-
-
-
-
-

gst_vaapi_display_get_rotation ()

-
GstVaapiRotation
-gst_vaapi_display_get_rotation (GstVaapiDisplay *display);
-

Returns the current VA display - rotation angle. If the VA driver -does not support "rotation" display attribute, then the display is -assumed to be un-rotated.

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplay

 
-
-
-

Returns

-

the current GstVaapiRotation value

-
-
-
-
-

gst_vaapi_display_set_rotation ()

-
gboolean
-gst_vaapi_display_set_rotation (GstVaapiDisplay *display,
-                                GstVaapiRotation rotation);
-

Sets the VA display - rotation angle to the supplied rotation - -value. This function returns FALSE if the rotation angle could not -be set, e.g. the VA driver does not allow to change the display -rotation angle.

-
-

Parameters

-
----- - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

rotation

the GstVaapiRotation value to set

 
-
-
-

Returns

-

TRUE if VA display -rotation angle could be changed -to the requested value

-
-
-
-
-

gst_vaapi_display_get_vendor_string ()

-
const gchar *
-gst_vaapi_display_get_vendor_string (GstVaapiDisplay *display);
-

Returns the VA driver vendor string attached to the supplied VA display -. -The display - owns the vendor string, do *not* de-allocate it.

-

This function is thread safe.

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplay

 
-
-
-

Returns

-

the current GstVaapiRotation value

-
-
-
-
-

gst_vaapi_display_has_opengl ()

-
gboolean
-gst_vaapi_display_has_opengl (GstVaapiDisplay *display);
-

Returns wether the display - that was created does support OpenGL -context to be attached.

-

This function is thread safe.

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplay

 
-
-
-

Returns

-

TRUE if the display -supports OpenGL context, FALSE -otherwise

-
-
-
-
-

Types and Values

-
-

enum GstVaapiDisplayType

-
-

Members

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

GST_VAAPI_DISPLAY_TYPE_ANY

-

Automatic detection of the display type.

-
 

GST_VAAPI_DISPLAY_TYPE_X11

-

VA/X11 display.

-
 

GST_VAAPI_DISPLAY_TYPE_GLX

-

VA/GLX display.

-
 

GST_VAAPI_DISPLAY_TYPE_WAYLAND

-

VA/Wayland display.

-
 

GST_VAAPI_DISPLAY_TYPE_DRM

-

VA/DRM display.

-
 

GST_VAAPI_DISPLAY_TYPE_EGL

-

VA/EGL display.

-
 
-
-
-
-
-

GstVaapiDisplay

-
typedef struct _GstVaapiDisplay GstVaapiDisplay;
-

Base class for VA displays.

-
-
-
-

struct GstVaapiDisplayInfo

-
struct GstVaapiDisplayInfo {
-  GstVaapiDisplay *display;
-  GstVaapiDisplayType display_type;
-  gchar *display_name;
-  VADisplay va_display;
-  gpointer native_display;
-};
-
-

Generic class to retrieve VA display info

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDisplayWayland.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDisplayWayland.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDisplayWayland.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDisplayWayland.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,169 +0,0 @@ - - - - -GstVaapiDisplayWayland: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiDisplayWayland

-

GstVaapiDisplayWayland — VA/Wayland display abstraction

-
-
-

Functions

-
---- - - - - - - - - - - - - - - -
-GstVaapiDisplay * - -gst_vaapi_display_wayland_new () -
-GstVaapiDisplay * - -gst_vaapi_display_wayland_new_with_display () -
struct wl_display * - -gst_vaapi_display_wayland_get_display () -
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_display_wayland_new ()

-
GstVaapiDisplay *
-gst_vaapi_display_wayland_new (const gchar *display_name);
-

Opens an Wayland wl_display using display_name - and returns a -newly allocated GstVaapiDisplay object. The Wayland display will -be cloed when the reference count of the object reaches zero.

-
-

Parameters

-
----- - - - - - -

display_name

the Wayland display name

 
-
-
-

Returns

-

a newly allocated GstVaapiDisplay object

-
-
-
-
-

gst_vaapi_display_wayland_new_with_display ()

-
GstVaapiDisplay *
-gst_vaapi_display_wayland_new_with_display
-                               (struct wl_display *wl_display);
-

Creates a GstVaapiDisplay based on the Wayland wl_display - -display. The caller still owns the display and must call -wl_display_disconnect() when all GstVaapiDisplay references are -released. Doing so too early can yield undefined behaviour.

-
-

Parameters

-
----- - - - - - -

wl_display

an Wayland wl_display

 
-
-
-

Returns

-

a newly allocated GstVaapiDisplay object

-
-
-
-
-

gst_vaapi_display_wayland_get_display ()

-
struct wl_display *
-gst_vaapi_display_wayland_get_display (GstVaapiDisplayWayland *display);
-

Returns the underlying Wayland wl_display that was created by -gst_vaapi_display_wayland_new() or that was bound from -gst_vaapi_display_wayland_new_with_display().

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplayWayland

 
-
-
-

Returns

-

the Wayland wl_display attached to display -

-
-
-
-
-

Types and Values

-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDisplayX11.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDisplayX11.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiDisplayX11.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiDisplayX11.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,225 +0,0 @@ - - - - -GstVaapiDisplayX11: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiDisplayX11

-

GstVaapiDisplayX11 — VA/X11 display abstraction

-
-
-

Functions

-
---- - - - - - - - - - - - - - - - - - - -
-GstVaapiDisplay * - -gst_vaapi_display_x11_new () -
-GstVaapiDisplay * - -gst_vaapi_display_x11_new_with_display () -
-Display * - -gst_vaapi_display_x11_get_display () -
-int - -gst_vaapi_display_x11_get_screen () -
-
-
-

Types and Values

-
---- - - - - -
 GstVaapiDisplayX11
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_display_x11_new ()

-
GstVaapiDisplay *
-gst_vaapi_display_x11_new (const gchar *display_name);
-

Opens an X11 Display using display_name - and returns a newly -allocated GstVaapiDisplay object. The X11 display will be cloed -when the reference count of the object reaches zero.

-
-

Parameters

-
----- - - - - - -

display_name

the X11 display name

 
-
-
-

Returns

-

a newly allocated GstVaapiDisplay object

-
-
-
-
-

gst_vaapi_display_x11_new_with_display ()

-
GstVaapiDisplay *
-gst_vaapi_display_x11_new_with_display
-                               (Display *x11_display);
-

Creates a GstVaapiDisplay based on the X11 x11_display - -display. The caller still owns the display and must call -XCloseDisplay() when all GstVaapiDisplay references are -released. Doing so too early can yield undefined behaviour.

-
-

Parameters

-
----- - - - - - -

x11_display

an X11 Display

 
-
-
-

Returns

-

a newly allocated GstVaapiDisplay object

-
-
-
-
-

gst_vaapi_display_x11_get_display ()

-
Display *
-gst_vaapi_display_x11_get_display (GstVaapiDisplayX11 *display);
-

Returns the underlying X11 Display that was created by -gst_vaapi_display_x11_new() or that was bound from -gst_vaapi_display_x11_new_with_display().

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplayX11

 
-
-
-

Returns

-

the X11 Display attached to display -

-
-
-
-
-

gst_vaapi_display_x11_get_screen ()

-
int
-gst_vaapi_display_x11_get_screen (GstVaapiDisplayX11 *display);
-

Returns the default X11 screen that was created by -gst_vaapi_display_x11_new() or that was bound from -gst_vaapi_display_x11_new_with_display().

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplayX11

 
-
-
-

Returns

-

the X11 Display attached to display -

-
-
-
-
-

Types and Values

-
-

GstVaapiDisplayX11

-
typedef struct _GstVaapiDisplayX11 GstVaapiDisplayX11;
-

VA/X11 display wrapper.

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiFilter.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiFilter.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiFilter.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiFilter.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,1016 +0,0 @@ - - - - -GstVaapiFilter: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiFilter

-

GstVaapiFilter

-
- -
-

Types and Values

-
---- - - - - - - - - - - -
 GstVaapiFilter
enumGstVaapiFilterOp
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_filter_new ()

-
GstVaapiFilter *
-gst_vaapi_filter_new (GstVaapiDisplay *display);
-

Creates a new GstVaapiFilter set up to operate in "identity" -mode. This means that no other operation than scaling is performed.

-
-

Parameters

-
----- - - - - - -

display

a GstVaapiDisplay

 
-
-
-

Returns

-

the newly created GstVaapiFilter object

-
-
-
-
-

gst_vaapi_filter_ref ()

-
GstVaapiFilter *
-gst_vaapi_filter_ref (GstVaapiFilter *filter);
-

Atomically increases the reference count of the given filter - by one.

-
-

Parameters

-
----- - - - - - -

filter

a GstVaapiFilter

 
-
-
-

Returns

-

The same filter -argument

-
-
-
-
-

gst_vaapi_filter_unref ()

-
void
-gst_vaapi_filter_unref (GstVaapiFilter *filter);
-

Atomically decreases the reference count of the filter - by one. If -the reference count reaches zero, the filter will be free'd.

-
-

Parameters

-
----- - - - - - -

filter

a GstVaapiFilter

 
-
-
-
-
-

gst_vaapi_filter_replace ()

-
void
-gst_vaapi_filter_replace (GstVaapiFilter **old_filter_ptr,
-                          GstVaapiFilter *new_filter);
-

Atomically replaces the filter held in old_filter_ptr - with -new_filter -. This means that old_filter_ptr - shall reference a -valid filter. However, new_filter - can be NULL.

-
-

Parameters

-
----- - - - - - - - - - - - - -

old_filter_ptr

a pointer to a GstVaapiFilter

 

new_filter

a GstVaapiFilter

 
-
-
-
-
-

gst_vaapi_filter_get_operations ()

-
GPtrArray *
-gst_vaapi_filter_get_operations (GstVaapiFilter *filter);
-

Determines the set of supported operations for video processing. -The caller owns an extra reference to the resulting array of -GstVaapiFilterOpInfo elements, so it shall be released with -g_ptr_array_unref() after usage.

-

If filter - is NULL, then this function returns the video -processing operations supported by this library.

-
-

Parameters

-
----- - - - - - -

filter

a GstVaapiFilter, or NULL

 
-
-
-

Returns

-

the set of supported operations, or NULL if an error -occurred.

-
-
-
-
-

gst_vaapi_filter_get_formats ()

-
GArray *
-gst_vaapi_filter_get_formats (GstVaapiFilter *filter);
-

Determines the set of supported source or target formats for video -processing. The caller owns an extra reference to the resulting -array of GstVideoFormat elements, so it shall be released with -g_array_unref() after usage.

-
-

Parameters

-
----- - - - - - -

filter

a GstVaapiFilter

 
-
-
-

Returns

-

the set of supported target formats for video processing.

-
-
-
-
-

gst_vaapi_filter_has_operation ()

-
gboolean
-gst_vaapi_filter_has_operation (GstVaapiFilter *filter,
-                                GstVaapiFilterOp op);
-

Determines whether the underlying VA driver advertises support for -the supplied operation op -.

-
-

Parameters

-
----- - - - - - - - - - - - - -

filter

a GstVaapiFilter

 

op

a GstVaapiFilterOp

 
-
-
-

Returns

-

TRUE if the specified operation may be supported by -the underlying hardware, FALSE otherwise

-
-
-
-
-

gst_vaapi_filter_use_operation ()

-
gboolean
-gst_vaapi_filter_use_operation (GstVaapiFilter *filter,
-                                GstVaapiFilterOp op);
-

Determines whether the supplied operation op - was already enabled -through a prior call to gst_vaapi_filter_set_operation() or any -other operation-specific function.

-

Note: should an operation be set to its default value, this means -that it is actually not enabled.

-
-

Parameters

-
----- - - - - - - - - - - - - -

filter

a GstVaapiFilter

 

op

a GstVaapiFilterOp

 
-
-
-

Returns

-

TRUE if the specified operation was already enabled, -FALSE otherwise

-
-
-
-
-

gst_vaapi_filter_set_operation ()

-
gboolean
-gst_vaapi_filter_set_operation (GstVaapiFilter *filter,
-                                GstVaapiFilterOp op,
-                                const GValue *value);
-

Enable the specified operation op - to be performed during video -processing, i.e. in gst_vaapi_filter_process(). The value - argument -specifies the operation settings. e.g. deinterlacing method for -deinterlacing, denoising level for noise reduction, etc.

-

If value - is NULL, then this function resets the operation -settings to their default values.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

filter

a GstVaapiFilter

 

op

a GstVaapiFilterOp

 

value

the op -settings

 
-
-
-

Returns

-

TRUE if the specified operation may be supported, -FALSE otherwise

-
-
-
-
-

gst_vaapi_filter_set_format ()

-
gboolean
-gst_vaapi_filter_set_format (GstVaapiFilter *filter,
-                             GstVideoFormat format);
-

Sets the desired pixel format of the resulting video processing -operations.

-

If format - is GST_VIDEO_FORMAT_UNKNOWN, the filter will assume iso -format conversion, i.e. no color conversion at all and the target -surface format shall match the source surface format.

-

If format - is GST_VIDEO_FORMAT_ENCODED, the filter will use the pixel -format of the target surface passed to gst_vaapi_filter_process().

-
-

Parameters

-
----- - - - - - - - - - - - - -

filter

a GstVaapiFilter

 

format

the target surface format

 
-
-
-

Returns

-

TRUE if the color conversion to the specified format -may be supported, FALSE otherwise.

-
-
-
-
-

gst_vaapi_filter_set_cropping_rectangle ()

-
gboolean
-gst_vaapi_filter_set_cropping_rectangle
-                               (GstVaapiFilter *filter,
-                                const GstVaapiRectangle *rect);
-

Sets the source surface cropping rectangle to use during the video -processing. If rect - is NULL, the whole source surface will be used.

-
-

Parameters

-
----- - - - - - - - - - - - - -

filter

a GstVaapiFilter

 

rect

the cropping region

 
-
-
-

Returns

-

TRUE if the operation is supported, FALSE otherwise.

-
-
-
-
-

gst_vaapi_filter_set_target_rectangle ()

-
gboolean
-gst_vaapi_filter_set_target_rectangle (GstVaapiFilter *filter,
-                                       const GstVaapiRectangle *rect);
-

Sets the region within the target surface where the source surface -would be rendered. i.e. where the hardware accelerator would emit -the outcome of video processing. If rect - is NULL, the whole -source surface will be used.

-
-

Parameters

-
----- - - - - - - - - - - - - -

filter

a GstVaapiFilter

 

rect

the target render region

 
-
-
-

Returns

-

TRUE if the operation is supported, FALSE otherwise.

-
-
-
-
-

gst_vaapi_filter_set_denoising_level ()

-
gboolean
-gst_vaapi_filter_set_denoising_level (GstVaapiFilter *filter,
-                                      gfloat level);
-

Sets the noise reduction level to apply. If level - is 0.0f, this -corresponds to disabling the noise reduction algorithm.

-
-

Parameters

-
----- - - - - - - - - - - - - -

filter

a GstVaapiFilter

 

level

the level of noise reduction to apply

 
-
-
-

Returns

-

TRUE if the operation is supported, FALSE otherwise.

-
-
-
-
-

gst_vaapi_filter_set_sharpening_level ()

-
gboolean
-gst_vaapi_filter_set_sharpening_level (GstVaapiFilter *filter,
-                                       gfloat level);
-

Enables noise reduction with the specified factor.

-
-

Parameters

-
----- - - - - - - - - - - - - -

filter

a GstVaapiFilter

 

level

the sharpening factor

 
-
-
-

Returns

-

TRUE if the operation is supported, FALSE otherwise.

-
-
-
-
-

gst_vaapi_filter_set_hue ()

-
gboolean
-gst_vaapi_filter_set_hue (GstVaapiFilter *filter,
-                          gfloat value);
-

Enables color hue adjustment to the specified value.

-
-

Parameters

-
----- - - - - - - - - - - - - -

filter

a GstVaapiFilter

 

value

the color hue value

 
-
-
-

Returns

-

TRUE if the operation is supported, FALSE otherwise.

-
-
-
-
-

gst_vaapi_filter_set_brightness ()

-
gboolean
-gst_vaapi_filter_set_brightness (GstVaapiFilter *filter,
-                                 gfloat value);
-

Enables color brightness adjustment to the specified value.

-
-

Parameters

-
----- - - - - - - - - - - - - -

filter

a GstVaapiFilter

 

value

the color brightness value

 
-
-
-

Returns

-

TRUE if the operation is supported, FALSE otherwise.

-
-
-
-
-

gst_vaapi_filter_set_saturation ()

-
gboolean
-gst_vaapi_filter_set_saturation (GstVaapiFilter *filter,
-                                 gfloat value);
-

Enables color saturation adjustment to the specified value.

-
-

Parameters

-
----- - - - - - - - - - - - - -

filter

a GstVaapiFilter

 

value

the color saturation value

 
-
-
-

Returns

-

TRUE if the operation is supported, FALSE otherwise.

-
-
-
-
-

gst_vaapi_filter_set_deinterlacing ()

-
gboolean
-gst_vaapi_filter_set_deinterlacing (GstVaapiFilter *filter,
-                                    GstVaapiDeinterlaceMethod method,
-                                    guint flags);
-

Applies deinterlacing to the video processing pipeline. If method - -is not GST_VAAPI_DEINTERLACE_METHOD_NONE -, then flags - could -represent the initial picture structure of the source frame.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

filter

a GstVaapiFilter

 

method

the deinterlacing algorithm (see GstVaapiDeinterlaceMethod)

 

flags

the additional flags

 
-
-
-

Returns

-

TRUE if the operation is supported, FALSE otherwise.

-
-
-
-
-

gst_vaapi_filter_set_deinterlacing_references ()

-
gboolean
-gst_vaapi_filter_set_deinterlacing_references
-                               (GstVaapiFilter *filter,
-                                GstVaapiSurface **forward_references,
-                                guint num_forward_references,
-                                GstVaapiSurface **backward_references,
-                                guint num_backward_references);
-

Specifies the list of surfaces used for forward or backward reference in -advanced deinterlacing mode. The caller is responsible for maintaining -the associated surfaces live until gst_vaapi_filter_process() completes. -e.g. by holding an extra reference to the associated GstVaapiSurfaceProxy.

-

Temporal ordering is maintained as follows: the shorter index in -either array is, the closest the matching surface is relatively to -the current source surface to process. e.g. surface in -forward_references - array index 0 represents the immediately -preceding surface in display order, surface at index 1 is the one -preceding surface at index 0, etc.

-

The video processing filter will only use the recommended number of -surfaces for backward and forward references.

-

Note: the supplied lists of reference surfaces are not sticky. This -means that they are only valid for the next gst_vaapi_filter_process() -call, and thus needs to be submitted again for subsequent calls.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

filter

a GstVaapiFilter

 

forward_references

the set of GstVaapiSurface objects used as -forward references

 

num_forward_references

the number of elements in the -forward_references -array

 

backward_references

the set of GstVaapiSurface objects used as -backward references

 

num_backward_references

the number of elements in the -backward_references -array

 
-
-
-

Returns

-

TRUE if the operation is supported, FALSE otherwise.

-
-
-
-
-

Types and Values

-
-

GstVaapiFilter

-
typedef struct _GstVaapiFilter GstVaapiFilter;
-
-
-
-

enum GstVaapiFilterOp

-
-

Members

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

GST_VAAPI_FILTER_OP_FORMAT

  

GST_VAAPI_FILTER_OP_CROP

  

GST_VAAPI_FILTER_OP_DENOISE

  

GST_VAAPI_FILTER_OP_SHARPEN

  

GST_VAAPI_FILTER_OP_HUE

  

GST_VAAPI_FILTER_OP_SATURATION

  

GST_VAAPI_FILTER_OP_BRIGHTNESS

  

GST_VAAPI_FILTER_OP_CONTRAST

  

GST_VAAPI_FILTER_OP_DEINTERLACING

  

GST_VAAPI_FILTER_OP_SCALING

  

GST_VAAPI_FILTER_OP_SKINTONE

  
-
-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-gstvaapiimage.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-gstvaapiimage.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-gstvaapiimage.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-gstvaapiimage.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,945 +0,0 @@ - - - - -GstVaapiImage: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiImage

-

GstVaapiImage — VA image abstraction

-
-
-

Functions

-
---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#define -GST_VAAPI_IMAGE_FORMAT() -
#define -GST_VAAPI_IMAGE_WIDTH() -
#define -GST_VAAPI_IMAGE_HEIGHT() -
-GstVaapiImage * - -gst_vaapi_image_new () -
-GstVaapiImage * - -gst_vaapi_image_new_with_image () -
-GstVaapiID - -gst_vaapi_image_get_id () -
-gboolean - -gst_vaapi_image_get_image () -
-GstVideoFormat - -gst_vaapi_image_get_format () -
-guint - -gst_vaapi_image_get_width () -
-guint - -gst_vaapi_image_get_height () -
-void - -gst_vaapi_image_get_size () -
-gboolean - -gst_vaapi_image_is_linear () -
-gboolean - -gst_vaapi_image_is_mapped () -
-gboolean - -gst_vaapi_image_map () -
-gboolean - -gst_vaapi_image_unmap () -
-guint - -gst_vaapi_image_get_plane_count () -
-guchar * - -gst_vaapi_image_get_plane () -
-guint - -gst_vaapi_image_get_pitch () -
-guint - -gst_vaapi_image_get_data_size () -
-gboolean - -gst_vaapi_image_get_buffer () -
-gboolean - -gst_vaapi_image_update_from_buffer () -
-gboolean - -gst_vaapi_image_copy () -
-
-
-

Types and Values

-
---- - - - - -
 GstVaapiImage
-
-
-

Description

-
-
-

Functions

-
-

GST_VAAPI_IMAGE_FORMAT()

-
#define             GST_VAAPI_IMAGE_FORMAT(image)
-

Macro that evaluates to the GstVideoFormat of image -.

-
-

Parameters

-
----- - - - - - -

image

a GstVaapiImage

 
-
-
-
-
-

GST_VAAPI_IMAGE_WIDTH()

-
#define             GST_VAAPI_IMAGE_WIDTH(image)
-

Macro that evaluates to the width of image -.

-
-

Parameters

-
----- - - - - - -

image

a GstVaapiImage

 
-
-
-
-
-

GST_VAAPI_IMAGE_HEIGHT()

-
#define             GST_VAAPI_IMAGE_HEIGHT(image)
-

Macro that evaluates to the height of image -.

-
-

Parameters

-
----- - - - - - -

image

a GstVaapiImage

 
-
-
-
-
-

gst_vaapi_image_new ()

-
GstVaapiImage *
-gst_vaapi_image_new (GstVaapiDisplay *display,
-                     GstVideoFormat format,
-                     guint width,
-                     guint height);
-

Creates a new GstVaapiImage with the specified format and -dimensions.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

format

a GstVideoFormat

 

width

the requested image width

 

height

the requested image height

 
-
-
-

Returns

-

the newly allocated GstVaapiImage object

-
-
-
-
-

gst_vaapi_image_new_with_image ()

-
GstVaapiImage *
-gst_vaapi_image_new_with_image (GstVaapiDisplay *display,
-                                VAImage *va_image);
-

Creates a new GstVaapiImage from a foreign VA image. The image -format and dimensions will be extracted from va_image -. This -function is mainly used by gst_vaapi_surface_derive_image() to bind -a VA image to a GstVaapiImage object.

-
-

Parameters

-
----- - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

va_image

a VA image

 
-
-
-

Returns

-

the newly allocated GstVaapiImage object

-
-
-
-
-

gst_vaapi_image_get_id ()

-
GstVaapiID
-gst_vaapi_image_get_id (GstVaapiImage *image);
-

Returns the underlying VAImageID of the image -.

-
-

Parameters

-
----- - - - - - -

image

a GstVaapiImage

 
-
-
-

Returns

-

the underlying VA image id

-
-
-
-
-

gst_vaapi_image_get_image ()

-
gboolean
-gst_vaapi_image_get_image (GstVaapiImage *image,
-                           VAImage *va_image);
-

Fills va_image - with the VA image used internally.

-
-

Parameters

-
----- - - - - - - - - - - - - -

image

a GstVaapiImage

 

va_image

a VA image

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

gst_vaapi_image_get_format ()

-
GstVideoFormat
-gst_vaapi_image_get_format (GstVaapiImage *image);
-

Returns the GstVideoFormat the image - was created with.

-
-

Parameters

-
----- - - - - - -

image

a GstVaapiImage

 
-
-
-

Returns

-

the GstVideoFormat

-
-
-
-
-

gst_vaapi_image_get_width ()

-
guint
-gst_vaapi_image_get_width (GstVaapiImage *image);
-

Returns the image - width.

-
-

Parameters

-
----- - - - - - -

image

a GstVaapiImage

 
-
-
-

Returns

-

the image width, in pixels

-
-
-
-
-

gst_vaapi_image_get_height ()

-
guint
-gst_vaapi_image_get_height (GstVaapiImage *image);
-

Returns the image - height.

-
-

Parameters

-
----- - - - - - -

image

a GstVaapiImage

 
-
-
-

Returns

-

the image height, in pixels.

-
-
-
-
-

gst_vaapi_image_get_size ()

-
void
-gst_vaapi_image_get_size (GstVaapiImage *image,
-                          guint *pwidth,
-                          guint *pheight);
-

Retrieves the dimensions of a GstVaapiImage.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

image

a GstVaapiImage

 

pwidth

return location for the width, or NULL

 

pheight

return location for the height, or NULL

 
-
-
-
-
-

gst_vaapi_image_is_linear ()

-
gboolean
-gst_vaapi_image_is_linear (GstVaapiImage *image);
-

Checks whether the image - has data planes allocated from a single -buffer and offsets into that buffer are in increasing order with -the number of planes.

-
-

Parameters

-
----- - - - - - -

image

a GstVaapiImage

 
-
-
-

Returns

-

TRUE if image data planes are allocated from a single buffer

-
-
-
-
-

gst_vaapi_image_is_mapped ()

-
gboolean
-gst_vaapi_image_is_mapped (GstVaapiImage *image);
-

Checks whether the image - is currently mapped or not.

-
-

Parameters

-
----- - - - - - -

image

a GstVaapiImage

 
-
-
-

Returns

-

TRUE if the image -is mapped

-
-
-
-
-

gst_vaapi_image_map ()

-
gboolean
-gst_vaapi_image_map (GstVaapiImage *image);
-

Maps the image data buffer. The actual pixels are returned by the -gst_vaapi_image_get_plane() function.

-
-

Parameters

-
----- - - - - - -

image

a GstVaapiImage

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

gst_vaapi_image_unmap ()

-
gboolean
-gst_vaapi_image_unmap (GstVaapiImage *image);
-

Unmaps the image data buffer. Pointers to pixels returned by -gst_vaapi_image_get_plane() are then no longer valid.

-
-

Parameters

-
----- - - - - - -

image

a GstVaapiImage

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

gst_vaapi_image_get_plane_count ()

-
guint
-gst_vaapi_image_get_plane_count (GstVaapiImage *image);
-

Retrieves the number of planes available in the image -. The image - -must be mapped for this function to work properly.

-
-

Parameters

-
----- - - - - - -

image

a GstVaapiImage

 
-
-
-

Returns

-

the number of planes available in the image -

-
-
-
-
-

gst_vaapi_image_get_plane ()

-
guchar *
-gst_vaapi_image_get_plane (GstVaapiImage *image,
-                           guint plane);
-

Retrieves the pixels data to the specified plane -. The image - must -be mapped for this function to work properly.

-
-

Parameters

-
----- - - - - - - - - - - - - -

image

a GstVaapiImage

 

plane

the requested plane number

 
-
-
-

Returns

-

the pixels data of the specified plane -

-
-
-
-
-

gst_vaapi_image_get_pitch ()

-
guint
-gst_vaapi_image_get_pitch (GstVaapiImage *image,
-                           guint plane);
-

Retrieves the line size (stride) of the specified plane -. The -image - must be mapped for this function to work properly.

-
-

Parameters

-
----- - - - - - - - - - - - - -

image

a GstVaapiImage

 

plane

the requested plane number

 
-
-
-

Returns

-

the line size (stride) of the specified plane

-
-
-
-
-

gst_vaapi_image_get_data_size ()

-
guint
-gst_vaapi_image_get_data_size (GstVaapiImage *image);
-

Retrieves the underlying image data size. This function could be -used to determine whether the image has a compatible layout with -another image structure.

-
-

Parameters

-
----- - - - - - -

image

a GstVaapiImage

 
-
-
-

Returns

-

the whole image data size of the image -

-
-
-
-
-

gst_vaapi_image_get_buffer ()

-
gboolean
-gst_vaapi_image_get_buffer (GstVaapiImage *image,
-                            GstBuffer *buffer,
-                            GstVaapiRectangle *rect);
-

Transfers pixels data contained in the image - into the GstBuffer. -Both image structures shall have the same format.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

image

a GstVaapiImage

 

buffer

a GstBuffer

 

rect

a GstVaapiRectangle expressing a region, or NULL for the -whole image

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

gst_vaapi_image_update_from_buffer ()

-
gboolean
-gst_vaapi_image_update_from_buffer (GstVaapiImage *image,
-                                    GstBuffer *buffer,
-                                    GstVaapiRectangle *rect);
-

Transfers pixels data contained in the GstBuffer into the -image -. Both image structures shall have the same format.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

image

a GstVaapiImage

 

buffer

a GstBuffer

 

rect

a GstVaapiRectangle expressing a region, or NULL for the -whole image

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

gst_vaapi_image_copy ()

-
gboolean
-gst_vaapi_image_copy (GstVaapiImage *dst_image,
-                      GstVaapiImage *src_image);
-

Copies pixels data from src_image - to dst_image -. Both images shall -have the same format and size.

-
-

Parameters

-
----- - - - - - - - - - - - - -

dst_image

the target GstVaapiImage

 

src_image

the source GstVaapiImage

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

Types and Values

-
-

GstVaapiImage

-
typedef struct {
-} GstVaapiImage;
-
-

A VA image wrapper

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiImagePool.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiImagePool.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiImagePool.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiImagePool.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ - - - - -GstVaapiImagePool: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiImagePool

-

GstVaapiImagePool — VA image pool

-
-
-

Functions

-
---- - - - - -
-GstVaapiVideoPool * - -gst_vaapi_image_pool_new () -
-
-
-

Types and Values

-
---- - - - - -
 GstVaapiImagePool
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_image_pool_new ()

-
GstVaapiVideoPool *
-gst_vaapi_image_pool_new (GstVaapiDisplay *display,
-                          const GstVideoInfo *vip);
-

Creates a new GstVaapiVideoPool of GstVaapiImage with the -specified format and dimensions in vip -.

-
-

Parameters

-
----- - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

vip

the GstVideoInfo

 
-
-
-

Returns

-

the newly allocated GstVaapiVideoPool

-
-
-
-
-

Types and Values

-
-

GstVaapiImagePool

-
typedef struct _GstVaapiImagePool GstVaapiImagePool;
-

A pool of lazily allocated GstVaapiImage objects.

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiObject.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiObject.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiObject.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiObject.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,212 +0,0 @@ - - - - -GstVaapiObject: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiObject

-

GstVaapiObject — Base VA object

-
-
-

Functions

-
---- - - - - - - - - - - - - - - - - - - -
-GstVaapiDisplay * - -gst_vaapi_object_get_display () -
-void - -gst_vaapi_object_lock_display () -
-void - -gst_vaapi_object_unlock_display () -
-GstVaapiID - -gst_vaapi_object_get_id () -
-
-
-

Types and Values

-
---- - - - - -
 GstVaapiObject
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_object_get_display ()

-
GstVaapiDisplay *
-gst_vaapi_object_get_display (GstVaapiObject *object);
-

Returns the GstVaapiDisplay this object - is bound to.

-
-

Parameters

-
----- - - - - - -

object

a GstVaapiObject

 
-
-
-

Returns

-

the parent GstVaapiDisplay object

-
-
-
-
-

gst_vaapi_object_lock_display ()

-
void
-gst_vaapi_object_lock_display (GstVaapiObject *object);
-

Locks object - parent display. If display is already locked by -another thread, the current thread will block until display is -unlocked by the other thread.

-
-

Parameters

-
----- - - - - - -

object

a GstVaapiObject

 
-
-
-
-
-

gst_vaapi_object_unlock_display ()

-
void
-gst_vaapi_object_unlock_display (GstVaapiObject *object);
-

Unlocks object - parent display. If another thread is blocked in a -gst_vaapi_object_lock_display() call, it will be woken and can lock -display itself.

-
-

Parameters

-
----- - - - - - -

object

a GstVaapiObject

 
-
-
-
-
-

gst_vaapi_object_get_id ()

-
GstVaapiID
-gst_vaapi_object_get_id (GstVaapiObject *object);
-

Returns the GstVaapiID contained in the object -.

-
-

Parameters

-
----- - - - - - -

object

a GstVaapiObject

 
-
-
-

Returns

-

the GstVaapiID of the object -

-
-
-
-
-

Types and Values

-
-

GstVaapiObject

-
typedef struct _GstVaapiObject GstVaapiObject;
-

VA object base.

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiParserFrame.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiParserFrame.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiParserFrame.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiParserFrame.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,206 +0,0 @@ - - - - -GstVaapiParserFrame: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiParserFrame

-

GstVaapiParserFrame — VA decoder frame

-
-
-

Functions

-
---- - - - - - - - - - - - - - - - - - - - - - - - - - - -
-GstVaapiParserFrame * - -gst_vaapi_parser_frame_new () -
-void - -gst_vaapi_parser_frame_free () -
-void - -gst_vaapi_parser_frame_append_unit () -
#define -gst_vaapi_parser_frame_ref() -
#define -gst_vaapi_parser_frame_unref() -
#define -gst_vaapi_parser_frame_replace() -
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_parser_frame_new ()

-
GstVaapiParserFrame *
-gst_vaapi_parser_frame_new (guint width,
-                            guint height);
-

Creates a new GstVaapiParserFrame object.

-
-

Parameters

-
----- - - - - - - - - - - - - -

width

frame width in pixels

 

height

frame height in pixels

 
-
-
-

Returns

-

The newly allocated GstVaapiParserFrame

-
-
-
-
-

gst_vaapi_parser_frame_free ()

-
void
-gst_vaapi_parser_frame_free (GstVaapiParserFrame *frame);
-

Deallocates any internal resources bound to the supplied decoder -frame -.

-

note - This is an internal function used to implement lightweight -sub-classes.

-
-

Parameters

-
----- - - - - - -

frame

a GstVaapiParserFrame

 
-
-
-
-
-

gst_vaapi_parser_frame_append_unit ()

-
void
-gst_vaapi_parser_frame_append_unit (GstVaapiParserFrame *frame,
-                                    GstVaapiDecoderUnit *unit);
-

Appends unit to the frame -.

-
-

Parameters

-
----- - - - - - - - - - - - - -

frame

a GstVaapiParserFrame

 

unit

a GstVaapiDecoderUnit

 
-
-
-
-
-

gst_vaapi_parser_frame_ref()

-
#define             gst_vaapi_parser_frame_ref(frame)
-
-
-
-

gst_vaapi_parser_frame_unref()

-
#define             gst_vaapi_parser_frame_unref(frame)
-
-
-
-

gst_vaapi_parser_frame_replace()

-
#define             gst_vaapi_parser_frame_replace(old_frame_p, new_frame)
-
-
-
-

Types and Values

-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiPixmap.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiPixmap.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiPixmap.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiPixmap.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,401 +0,0 @@ - - - - -GstVaapiPixmap: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiPixmap

-

GstVaapiPixmap — Pixmap abstraction

-
-
-

Functions

-
---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-GstVaapiPixmap * - -gst_vaapi_pixmap_ref () -
-void - -gst_vaapi_pixmap_unref () -
-void - -gst_vaapi_pixmap_replace () -
-GstVideoFormat - -gst_vaapi_pixmap_get_format () -
-guint - -gst_vaapi_pixmap_get_width () -
-guint - -gst_vaapi_pixmap_get_height () -
-void - -gst_vaapi_pixmap_get_size () -
-gboolean - -gst_vaapi_pixmap_put_surface () -
-
-
-

Types and Values

-
---- - - - - -
 GstVaapiPixmap
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_pixmap_ref ()

-
GstVaapiPixmap *
-gst_vaapi_pixmap_ref (GstVaapiPixmap *pixmap);
-

Atomically increases the reference count of the given pixmap - by one.

-
-

Parameters

-
----- - - - - - -

pixmap

a GstVaapiPixmap

 
-
-
-

Returns

-

The same pixmap -argument

-
-
-
-
-

gst_vaapi_pixmap_unref ()

-
void
-gst_vaapi_pixmap_unref (GstVaapiPixmap *pixmap);
-

Atomically decreases the reference count of the pixmap - by one. If -the reference count reaches zero, the pixmap will be free'd.

-
-

Parameters

-
----- - - - - - -

pixmap

a GstVaapiPixmap

 
-
-
-
-
-

gst_vaapi_pixmap_replace ()

-
void
-gst_vaapi_pixmap_replace (GstVaapiPixmap **old_pixmap_ptr,
-                          GstVaapiPixmap *new_pixmap);
-

Atomically replaces the pixmap pixmap held in old_pixmap_ptr - with -new_pixmap -. This means that old_pixmap_ptr - shall reference a -valid pixmap. However, new_pixmap - can be NULL.

-
-

Parameters

-
----- - - - - - - - - - - - - -

old_pixmap_ptr

a pointer to a GstVaapiPixmap

 

new_pixmap

a GstVaapiPixmap

 
-
-
-
-
-

gst_vaapi_pixmap_get_format ()

-
GstVideoFormat
-gst_vaapi_pixmap_get_format (GstVaapiPixmap *pixmap);
-

Retrieves the format of a GstVaapiPixmap.

-
-

Parameters

-
----- - - - - - -

pixmap

a GstVaapiPixmap

 
-
-
-

Returns

-

the format of the pixmap -

-
-
-
-
-

gst_vaapi_pixmap_get_width ()

-
guint
-gst_vaapi_pixmap_get_width (GstVaapiPixmap *pixmap);
-

Retrieves the width of a GstVaapiPixmap.

-
-

Parameters

-
----- - - - - - -

pixmap

a GstVaapiPixmap

 
-
-
-

Returns

-

the width of the pixmap -, in pixels

-
-
-
-
-

gst_vaapi_pixmap_get_height ()

-
guint
-gst_vaapi_pixmap_get_height (GstVaapiPixmap *pixmap);
-

Retrieves the height of a GstVaapiPixmap

-
-

Parameters

-
----- - - - - - -

pixmap

a GstVaapiPixmap

 
-
-
-

Returns

-

the height of the pixmap -, in pixels

-
-
-
-
-

gst_vaapi_pixmap_get_size ()

-
void
-gst_vaapi_pixmap_get_size (GstVaapiPixmap *pixmap,
-                           guint *width,
-                           guint *height);
-

Retrieves the dimensions of a GstVaapiPixmap.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

pixmap

a GstVaapiPixmap

 

width

return location for the width, or NULL

 

height

return location for the height, or NULL

 
-
-
-
-
-

gst_vaapi_pixmap_put_surface ()

-
gboolean
-gst_vaapi_pixmap_put_surface (GstVaapiPixmap *pixmap,
-                              GstVaapiSurface *surface,
-                              const GstVaapiRectangle *crop_rect,
-                              guint flags);
-

Renders the whole surface -, or a cropped region defined with -crop_rect -, into the pixmap -, while scaling to fit the target -pixmap. The flags - specify how de-interlacing (if needed), color -space conversion, scaling and other postprocessing transformations -are performed.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - - - - - - -

pixmap

a GstVaapiPixmap

 

surface

a GstVaapiSurface

 

crop_rect

the video cropping rectangle, or NULL if the entire -surface is to be used.

 

flags

postprocessing flags. See GstVaapiSurfaceRenderFlags

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

Types and Values

-
-

GstVaapiPixmap

-
typedef struct {
-} GstVaapiPixmap;
-
-

Base class for system-dependent pixmaps.

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiPixmapX11.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiPixmapX11.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiPixmapX11.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiPixmapX11.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,281 +0,0 @@ - - - - -GstVaapiPixmapX11: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiPixmapX11

-

GstVaapiPixmapX11 — X11 pixmap abstraction

-
-
-

Functions

-
---- - - - - - - - - - - - - - - - - - - - - - - -
#define -GST_VAAPI_PIXMAP_XPIXMAP() -
-GstVaapiPixmap * - -gst_vaapi_pixmap_x11_new () -
-GstVaapiPixmap * - -gst_vaapi_pixmap_x11_new_with_xid () -
-Pixmap - -gst_vaapi_pixmap_x11_get_xid () -
-gboolean - -gst_vaapi_pixmap_x11_is_foreign_xid () -
-
-
-

Types and Values

-
---- - - - - -
 GstVaapiPixmapX11
-
-
-

Description

-
-
-

Functions

-
-

GST_VAAPI_PIXMAP_XPIXMAP()

-
#define             GST_VAAPI_PIXMAP_XPIXMAP(pixmap)
-

Macro that evaluates to the underlying X11 Pixmap of pixmap -

-
-

Parameters

-
----- - - - - - -

pixmap

a GstVaapiPixmap

 
-
-
-
-
-

gst_vaapi_pixmap_x11_new ()

-
GstVaapiPixmap *
-gst_vaapi_pixmap_x11_new (GstVaapiDisplay *display,
-                          GstVideoFormat format,
-                          guint width,
-                          guint height);
-

Creates a pixmap with the specified format -, width - and -height -. The pixmap will be attached to the display -.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

format

the requested pixmap format

 

width

the requested pixmap width, in pixels

 

height

the requested windo height, in pixels

 
-
-
-

Returns

-

the newly allocated GstVaapiPixmap object

-
-
-
-
-

gst_vaapi_pixmap_x11_new_with_xid ()

-
GstVaapiPixmap *
-gst_vaapi_pixmap_x11_new_with_xid (GstVaapiDisplay *display,
-                                   Pixmap xid);
-

Creates a GstVaapiPixmap using the X11 Pixmap xid -. The caller -still owns the pixmap and must call XFreePixmap() when all -GstVaapiPixmap references are released. Doing so too early can -yield undefined behaviour.

-
-

Parameters

-
----- - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

xid

an X11 Pixmap id

 
-
-
-

Returns

-

the newly allocated GstVaapiPixmap object

-
-
-
-
-

gst_vaapi_pixmap_x11_get_xid ()

-
Pixmap
-gst_vaapi_pixmap_x11_get_xid (GstVaapiPixmapX11 *pixmap);
-

Returns the underlying X11 Pixmap that was created by -gst_vaapi_pixmap_x11_new() or that was bound with -gst_vaapi_pixmap_x11_new_with_xid().

-
-

Parameters

-
----- - - - - - -

pixmap

a GstVaapiPixmapX11

 
-
-
-

Returns

-

the underlying X11 Pixmap bound to pixmap -.

-
-
-
-
-

gst_vaapi_pixmap_x11_is_foreign_xid ()

-
gboolean
-gst_vaapi_pixmap_x11_is_foreign_xid (GstVaapiPixmapX11 *pixmap);
-

Checks whether the pixmap - XID was created by gst_vaapi_pixmap_x11_new() -or was bound with gst_vaapi_pixmap_x11_new_with_xid().

-
-

Parameters

-
----- - - - - - -

pixmap

a GstVaapiPixmapX11

 
-
-
-

Returns

-

TRUE if the underlying X pixmap is owned by the -caller (foreign pixmap)

-
-
-
-
-

Types and Values

-
-

GstVaapiPixmapX11

-
typedef struct _GstVaapiPixmapX11 GstVaapiPixmapX11;
-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiProfile.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiProfile.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiProfile.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiProfile.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,708 +0,0 @@ - - - - -GstVaapiProfile: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiProfile

-

GstVaapiProfile — VA profile abstraction

-
-
-

Functions

-
---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-GstVaapiProfile - -gst_vaapi_profile () -
-GstVaapiProfile - -gst_vaapi_profile_from_caps () -
-VAProfile - -gst_vaapi_profile_get_va_profile () -
-GstCaps * - -gst_vaapi_profile_get_caps () -
-GstVaapiCodec - -gst_vaapi_profile_get_codec () -
-GstVaapiEntrypoint - -gst_vaapi_entrypoint () -
-VAEntrypoint - -gst_vaapi_entrypoint_get_va_entrypoint () -
-
-
-

Types and Values

-
---- - - - - - - - - - - - - - - -
enumGstVaapiCodec
enumGstVaapiProfile
enumGstVaapiEntrypoint
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_profile ()

-
GstVaapiProfile
-gst_vaapi_profile (VAProfile profile);
-

Converts a VA profile into the corresponding GstVaapiProfile. If -the profile cannot be represented by GstVaapiProfile, then zero is -returned.

-
-

Parameters

-
----- - - - - - -

profile

a VAProfile

 
-
-
-

Returns

-

the GstVaapiProfile describing the profile -

-
-
-
-
-

gst_vaapi_profile_from_caps ()

-
GstVaapiProfile
-gst_vaapi_profile_from_caps (const GstCaps *caps);
-

Converts caps - into the corresponding GstVaapiProfile. If the -profile cannot be represented by GstVaapiProfile, then zero is -returned.

-
-

Parameters

-
----- - - - - - -

caps

a GstCaps

 
-
-
-

Returns

-

the GstVaapiProfile describing the caps -

-
-
-
-
-

gst_vaapi_profile_get_va_profile ()

-
VAProfile
-gst_vaapi_profile_get_va_profile (GstVaapiProfile profile);
-

Converts a GstVaapiProfile into the corresponding VA profile. If -no matching VA profile was found, -1 is returned and this error -must be reported to be fixed.

-
-

Parameters

-
----- - - - - - -

profile

a GstVaapiProfile

 
-
-
-

Returns

-

the VA profile, or -1 if none was found

-
-
-
-
-

gst_vaapi_profile_get_caps ()

-
GstCaps *
-gst_vaapi_profile_get_caps (GstVaapiProfile profile);
-

Converts a GstVaapiProfile into the corresponding GstCaps. If no -matching caps were found, NULL is returned.

-
-

Parameters

-
----- - - - - - -

profile

a GstVaapiProfile

 
-
-
-

Returns

-

the newly allocated GstCaps, or NULL if none was found

-
-
-
-
-

gst_vaapi_profile_get_codec ()

-
GstVaapiCodec
-gst_vaapi_profile_get_codec (GstVaapiProfile profile);
-

Extracts the GstVaapiCodec from profile -.

-
-

Parameters

-
----- - - - - - -

profile

a GstVaapiProfile

 
-
-
-

Returns

-

the GstVaapiCodec from profile -

-
-
-
-
-

gst_vaapi_entrypoint ()

-
GstVaapiEntrypoint
-gst_vaapi_entrypoint (VAEntrypoint entrypoint);
-

Converts a VA entry-point into the corresponding GstVaapiEntrypoint. -If the entry-point cannot be represented by GstVaapiEntrypoint, -then zero is returned.

-
-

Parameters

-
----- - - - - - -

entrypoint

a VAEntrypoint

 
-
-
-

Returns

-

the GstVaapiEntrypoint describing the entrypoint -

-
-
-
-
-

gst_vaapi_entrypoint_get_va_entrypoint ()

-
VAEntrypoint
-gst_vaapi_entrypoint_get_va_entrypoint
-                               (GstVaapiEntrypoint entrypoint);
-

Converts a GstVaapiEntrypoint into the corresponding VA -entry-point. If no matching VA entry-point was found, -1 is -returned and this error must be reported to be fixed.

-
-

Parameters

-
----- - - - - - -

entrypoint

a GstVaapiEntrypoint

 
-
-
-

Returns

-

the VA entry-point, or -1 if none was found

-
-
-
-
-

Types and Values

-
-

enum GstVaapiCodec

-

The set of all codecs for GstVaapiCodec.

-
-

Members

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

GST_VAAPI_CODEC_MPEG1

-

MPEG-1 (ISO/IEC 11172)

-
 

GST_VAAPI_CODEC_MPEG2

-

MPEG-2 (ISO/IEC 13818-2)

-
 

GST_VAAPI_CODEC_MPEG4

-

MPEG-4 Part 2 (ISO/IEC 14496-2)

-
 

GST_VAAPI_CODEC_H263

-

H.263

-
 

GST_VAAPI_CODEC_H264

-

H.264 aka MPEG-4 Part 10 (ISO/IEC 14496-10)

-
 

GST_VAAPI_CODEC_WMV3

-

Windows Media Video 9. VC-1 Simple or Main profile (SMPTE 421M)

-
 

GST_VAAPI_CODEC_VC1

-

VC-1 Advanced profile (SMPTE 421M)

-
 

GST_VAAPI_CODEC_JPEG

-

JPEG (ITU-T 81)

-
 

GST_VAAPI_CODEC_VP8

  

GST_VAAPI_CODEC_H265

-

H.265 aka MPEG-H Part 2 (ITU-T H.265)

-
 

GST_VAAPI_CODEC_VP9

-

VP9 (libvpx)

-
 
-
-
-
-
-

enum GstVaapiProfile

-

The set of all profiles for GstVaapiProfile.

-
-

Members

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

GST_VAAPI_PROFILE_UNKNOWN

-

Unknown profile, used for initializers

-
 

GST_VAAPI_PROFILE_MPEG1

-

MPEG-1

-
 

GST_VAAPI_PROFILE_MPEG2_SIMPLE

-

MPEG-2 simple profile

-
 

GST_VAAPI_PROFILE_MPEG2_MAIN

-

MPEG-2 main profile

-
 

GST_VAAPI_PROFILE_MPEG2_HIGH

-

MPEG-2 high profile

-
 

GST_VAAPI_PROFILE_MPEG4_SIMPLE

-

MPEG-4 Part-2 simple profile

-
 

GST_VAAPI_PROFILE_MPEG4_ADVANCED_SIMPLE

-

MPEG-4 Part-2 advanced simple profile

-
 

GST_VAAPI_PROFILE_MPEG4_MAIN

-

MPEG-4 Part-2 main profile

-
 

GST_VAAPI_PROFILE_H263_BASELINE

-

H.263 baseline profile

-
 

GST_VAAPI_PROFILE_H264_BASELINE

-

H.264 (MPEG-4 Part-10) baseline profile [A.2.1]

-
 

GST_VAAPI_PROFILE_H264_CONSTRAINED_BASELINE

-

H.264 (MPEG-4 Part-10) constrained baseline profile [A.2.1.1]

-
 

GST_VAAPI_PROFILE_H264_MAIN

-

H.264 (MPEG-4 Part-10) main profile [A.2.2]

-
 

GST_VAAPI_PROFILE_H264_EXTENDED

-

H.264 (MPEG-4 Part 10) extended profile [A.2.3]

-
 

GST_VAAPI_PROFILE_H264_HIGH

-

H.264 (MPEG-4 Part-10) high profile [A.2.4]

-
 

GST_VAAPI_PROFILE_H264_HIGH10

-

H.264 (MPEG-4 Part-10) high 10 profile [A.2.5], or high 10 intra - profile [A.2.8], depending on constraint_set3_flag

-
 

GST_VAAPI_PROFILE_H264_HIGH_422

-

H.264 (MPEG-4 Part-10) high 4:2:2 profile [A.2.6], or high 4:2:2 - intra profile [A.2.9], depending on constraint_set3_flag

-
 

GST_VAAPI_PROFILE_H264_HIGH_444

-

H.264 (MPEG-4 Part-10) high 4:4:4 predictive profile [A.2.7], or - high 4:4:4 intra profile [A.2.10], depending on constraint_set3_flag

-
 

GST_VAAPI_PROFILE_H264_SCALABLE_BASELINE

-

H.264 (MPEG-4 Part-10) scalable baseline profile [G.10.1.1]

-
 

GST_VAAPI_PROFILE_H264_SCALABLE_HIGH

-

H.264 (MPEG-4 Part-10) scalable high profile [G.10.1.2], or scalable - high intra profile [G.10.1.3], depending on constraint_set3_flag

-
 

GST_VAAPI_PROFILE_H264_MULTIVIEW_HIGH

-

H.264 (MPEG-4 Part-10) multiview high profile [H.10.1.1]

-
 

GST_VAAPI_PROFILE_H264_STEREO_HIGH

-

H.264 (MPEG-4 Part-10) stereo high profile [H.10.1.2]

-
 

GST_VAAPI_PROFILE_VC1_SIMPLE

-

VC-1 simple profile

-
 

GST_VAAPI_PROFILE_VC1_MAIN

-

VC-1 main profile

-
 

GST_VAAPI_PROFILE_VC1_ADVANCED

-

VC-1 advanced profile

-
 

GST_VAAPI_PROFILE_JPEG_BASELINE

-

JPEG baseline profile

-
 

GST_VAAPI_PROFILE_VP8

  

GST_VAAPI_PROFILE_H265_MAIN

-

H.265 main profile [A.3.2]

-
 

GST_VAAPI_PROFILE_H265_MAIN10

-

H.265 main 10 profile [A.3.3]

-
 

GST_VAAPI_PROFILE_H265_MAIN_STILL_PICTURE

-

H.265 main still picture profile [A.3.4]

-
 

GST_VAAPI_PROFILE_VP9

-

VP9 prfile 0

-
 
-
-
-
-
-

enum GstVaapiEntrypoint

-

The set of all entrypoints for GstVaapiEntrypoint

-
-

Members

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

GST_VAAPI_ENTRYPOINT_VLD

-

Variable Length Decoding

-
 

GST_VAAPI_ENTRYPOINT_IDCT

-

Inverse Decrete Cosine Transform

-
 

GST_VAAPI_ENTRYPOINT_MOCO

-

Motion Compensation

-
 

GST_VAAPI_ENTRYPOINT_SLICE_ENCODE

-

Encode Slice

-
 

GST_VAAPI_ENTRYPOINT_PICTURE_ENCODE

-

Encode Picture

-
 
-
-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiSubpicture.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiSubpicture.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiSubpicture.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiSubpicture.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,400 +0,0 @@ - - - - -GstVaapiSubpicture: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiSubpicture

-

GstVaapiSubpicture — VA subpicture abstraction

-
- -
-

Types and Values

-
---- - - - - -
 GstVaapiSubpicture
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_subpicture_new ()

-
GstVaapiSubpicture *
-gst_vaapi_subpicture_new (GstVaapiImage *image,
-                          guint flags);
-

Creates a new GstVaapiSubpicture with image - as source pixels. The -newly created object holds a reference on image -.

-
-

Parameters

-
----- - - - - - - - - - - - - -

image

a GstVaapiImage

 

flags

GstVaapiSubpictureFlags, or zero

 
-
-
-

Returns

-

the newly allocated GstVaapiSubpicture object

-
-
-
-
-

gst_vaapi_subpicture_new_from_overlay_rectangle ()

-
GstVaapiSubpicture *
-gst_vaapi_subpicture_new_from_overlay_rectangle
-                               (GstVaapiDisplay *display,
-                                GstVideoOverlayRectangle *rect);
-

Helper function that creates a new GstVaapiSubpicture from a -GstVideoOverlayRectangle. A new GstVaapiImage is also created -along the way and attached to the resulting subpicture. The -subpicture holds a unique reference to the underlying image.

-
-

Parameters

-
----- - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

rect

a GstVideoOverlayRectangle

 
-
-
-

Returns

-

the newly allocated GstVaapiSubpicture object

-
-
-
-
-

gst_vaapi_subpicture_get_id ()

-
GstVaapiID
-gst_vaapi_subpicture_get_id (GstVaapiSubpicture *subpicture);
-

Returns the underlying VASubpictureID of the subpicture -.

-
-

Parameters

-
----- - - - - - -

subpicture

a GstVaapiSubpicture

 
-
-
-

Returns

-

the underlying VA subpicture id

-
-
-
-
-

gst_vaapi_subpicture_get_flags ()

-
guint
-gst_vaapi_subpicture_get_flags (GstVaapiSubpicture *subpicture);
-

Returns the subpicture - flags.

-
-

Parameters

-
----- - - - - - -

subpicture

a GstVaapiSubpicture

 
-
-
-

Returns

-

the subpicture -flags

-
-
-
-
-

gst_vaapi_subpicture_get_global_alpha ()

-
gfloat
-gst_vaapi_subpicture_get_global_alpha (GstVaapiSubpicture *subpicture);
-

Returns the value of global_alpha, set for this subpicture -.

-
-

Parameters

-
----- - - - - - -

subpicture

a GstVaapiSubpicture

 
-
-
-

Returns

-

the global_alpha value of this subpicture -

-
-
-
-
-

gst_vaapi_subpicture_set_global_alpha ()

-
gboolean
-gst_vaapi_subpicture_set_global_alpha (GstVaapiSubpicture *subpicture,
-                                       gfloat global_alpha);
-

Sets the global_alpha value of subpicture -. This function calls -vaSetSubpictureGlobalAlpha() if the format of subpicture -, i.e. -the current VA driver supports it.

-
-

Parameters

-
----- - - - - - - - - - - - - -

subpicture

a GstVaapiSubpicture

 

global_alpha

value for global-alpha (range: 0.0 to 1.0, inclusive)

 
-
-
-

Returns

-

TRUE if global_alpha could be set, FALSE otherwise

-
-
-
-
-

gst_vaapi_subpicture_get_image ()

-
GstVaapiImage *
-gst_vaapi_subpicture_get_image (GstVaapiSubpicture *subpicture);
-

Returns the GstVaapiImage this subpicture - is bound to.

-
-

Parameters

-
----- - - - - - -

subpicture

a GstVaapiSubpicture

 
-
-
-

Returns

-

the GstVaapiImage this subpicture -is bound to

-
-
-
-
-

gst_vaapi_subpicture_set_image ()

-
gboolean
-gst_vaapi_subpicture_set_image (GstVaapiSubpicture *subpicture,
-                                GstVaapiImage *image);
-

Binds a new GstVaapiImage to the subpicture -. The reference to the -previous image is released and a new one is acquired on image -.

-
-

Parameters

-
----- - - - - - - - - - - - - -

subpicture

a GstVaapiSubpicture

 

image

a GstVaapiImage

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

Types and Values

-
-

GstVaapiSubpicture

-
typedef struct _GstVaapiSubpicture GstVaapiSubpicture;
-

A VA subpicture wrapper

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-gstvaapisurface.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-gstvaapisurface.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-gstvaapisurface.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-gstvaapisurface.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,968 +0,0 @@ - - - - -GstVaapiSurface: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiSurface

-

GstVaapiSurface — VA surface abstraction

-
- -
-

Types and Values

-
---- - - - - - - - - - - - - - - - - - - -
enumGstVaapiChromaType
enumGstVaapiSurfaceStatus
enumGstVaapiSurfaceRenderFlags
 GstVaapiSurface
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_surface_new ()

-
GstVaapiSurface *
-gst_vaapi_surface_new (GstVaapiDisplay *display,
-                       GstVaapiChromaType chroma_type,
-                       guint width,
-                       guint height);
-

Creates a new GstVaapiSurface with the specified chroma format and -dimensions.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

chroma_type

the surface chroma format

 

width

the requested surface width

 

height

the requested surface height

 
-
-
-

Returns

-

the newly allocated GstVaapiSurface object

-
-
-
-
-

gst_vaapi_surface_new_with_format ()

-
GstVaapiSurface *
-gst_vaapi_surface_new_with_format (GstVaapiDisplay *display,
-                                   GstVideoFormat format,
-                                   guint width,
-                                   guint height);
-

Creates a new GstVaapiSurface with the specified pixel format and -dimensions.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

format

the surface format

 

width

the requested surface width

 

height

the requested surface height

 
-
-
-

Returns

-

the newly allocated GstVaapiSurface object, or NULL -if creation of VA surface with explicit pixel format is not -supported or failed.

-
-
-
-
-

gst_vaapi_surface_get_id ()

-
GstVaapiID
-gst_vaapi_surface_get_id (GstVaapiSurface *surface);
-

Returns the underlying VASurfaceID of the surface -.

-
-

Parameters

-
----- - - - - - -

surface

a GstVaapiSurface

 
-
-
-

Returns

-

the underlying VA surface id

-
-
-
-
-

gst_vaapi_surface_get_chroma_type ()

-
GstVaapiChromaType
-gst_vaapi_surface_get_chroma_type (GstVaapiSurface *surface);
-

Returns the GstVaapiChromaType the surface - was created with.

-
-

Parameters

-
----- - - - - - -

surface

a GstVaapiSurface

 
-
-
-

Returns

-

the GstVaapiChromaType

-
-
-
-
-

gst_vaapi_surface_get_format ()

-
GstVideoFormat
-gst_vaapi_surface_get_format (GstVaapiSurface *surface);
-

Returns the GstVideoFormat the surface - was created with.

-
-

Parameters

-
----- - - - - - -

surface

a GstVaapiSurface

 
-
-
-

Returns

-

the GstVideoFormat, or GST_VIDEO_FORMAT_ENCODED if -the surface was not created with an explicit video format, or if -the underlying video format could not be determined

-
-
-
-
-

gst_vaapi_surface_get_width ()

-
guint
-gst_vaapi_surface_get_width (GstVaapiSurface *surface);
-

Returns the surface - width.

-
-

Parameters

-
----- - - - - - -

surface

a GstVaapiSurface

 
-
-
-

Returns

-

the surface width, in pixels

-
-
-
-
-

gst_vaapi_surface_get_height ()

-
guint
-gst_vaapi_surface_get_height (GstVaapiSurface *surface);
-

Returns the surface - height.

-
-

Parameters

-
----- - - - - - -

surface

a GstVaapiSurface

 
-
-
-

Returns

-

the surface height, in pixels.

-
-
-
-
-

gst_vaapi_surface_get_size ()

-
void
-gst_vaapi_surface_get_size (GstVaapiSurface *surface,
-                            guint *width_ptr,
-                            guint *height_ptr);
-

Retrieves the dimensions of a GstVaapiSurface.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

surface

a GstVaapiSurface

 

width_ptr

return location for the width, or NULL

 

height_ptr

return location for the height, or NULL

 
-
-
-
-
-

gst_vaapi_surface_derive_image ()

-
GstVaapiImage *
-gst_vaapi_surface_derive_image (GstVaapiSurface *surface);
-

Derives a GstVaapiImage from the surface -. This image buffer can -then be mapped/unmapped for direct CPU access. This operation is -only possible if the underlying implementation supports direct -rendering capabilities and internal surface formats that can be -represented with a GstVaapiImage.

-

When the operation is not possible, the function returns NULL and -the user should then fallback to using gst_vaapi_surface_get_image() -or gst_vaapi_surface_put_image() to accomplish the same task in an -indirect manner (additional copy).

-

An image created with gst_vaapi_surface_derive_image() should be -unreferenced when it's no longer needed. The image and image buffer -data structures will be destroyed. However, the surface contents -will remain unchanged until destroyed through the last call to -gst_vaapi_object_unref().

-
-

Parameters

-
----- - - - - - -

surface

a GstVaapiSurface

 
-
-
-

Returns

-

the newly allocated GstVaapiImage object, or NULL -on failure

-
-
-
-
-

gst_vaapi_surface_get_image ()

-
gboolean
-gst_vaapi_surface_get_image (GstVaapiSurface *surface,
-                             GstVaapiImage *image);
-

Retrieves surface data into a GstVaapiImage. The image - must have -a format supported by the surface -.

-
-

Parameters

-
----- - - - - - - - - - - - - -

surface

a GstVaapiSurface

 

image

a GstVaapiImage

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

gst_vaapi_surface_put_image ()

-
gboolean
-gst_vaapi_surface_put_image (GstVaapiSurface *surface,
-                             GstVaapiImage *image);
-

Copies data from a GstVaapiImage into a surface -. The image - must -have a format supported by the surface -.

-
-

Parameters

-
----- - - - - - - - - - - - - -

surface

a GstVaapiSurface

 

image

a GstVaapiImage

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

gst_vaapi_surface_associate_subpicture ()

-
gboolean
-gst_vaapi_surface_associate_subpicture
-                               (GstVaapiSurface *surface,
-                                GstVaapiSubpicture *subpicture,
-                                const GstVaapiRectangle *src_rect,
-                                const GstVaapiRectangle *dst_rect);
-

Associates the subpicture - with the surface -. The src_rect - -coordinates and size are relative to the source image bound to -subpicture -. The dst_rect - coordinates and size are relative to the -target surface -. Note that the surface - holds an additional -reference to the subpicture -.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - - - - - - -

surface

a GstVaapiSurface

 

subpicture

a GstVaapiSubpicture

 

src_rect

the sub-rectangle of the source subpicture -image to extract and process. If NULL, the entire image will be used.

 

dst_rect

the sub-rectangle of the destination -surface into which the image is rendered. If NULL, the entire -surface will be used.

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

gst_vaapi_surface_deassociate_subpicture ()

-
gboolean
-gst_vaapi_surface_deassociate_subpicture
-                               (GstVaapiSurface *surface,
-                                GstVaapiSubpicture *subpicture);
-

Deassociates subpicture - from surface -. Other associations are kept.

-
-

Parameters

-
----- - - - - - - - - - - - - -

surface

a GstVaapiSurface

 

subpicture

a GstVaapiSubpicture

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

gst_vaapi_surface_sync ()

-
gboolean
-gst_vaapi_surface_sync (GstVaapiSurface *surface);
-

Blocks until all pending operations on the surface - have been -completed.

-
-

Parameters

-
----- - - - - - -

surface

a GstVaapiSurface

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

gst_vaapi_surface_query_status ()

-
gboolean
-gst_vaapi_surface_query_status (GstVaapiSurface *surface,
-                                GstVaapiSurfaceStatus *pstatus);
-

Finds out any pending operations on the surface -. The -GstVaapiSurfaceStatus flags are returned into pstatus -.

-
-

Parameters

-
----- - - - - - - - - - - - - -

surface

a GstVaapiSurface

 

pstatus

return location for the GstVaapiSurfaceStatus

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

Types and Values

-
-

enum GstVaapiChromaType

-

The set of all chroma types for GstVaapiSurface.

-
-

Members

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

GST_VAAPI_CHROMA_TYPE_YUV420

-

YUV 4:2:0 chroma format

-
 

GST_VAAPI_CHROMA_TYPE_YUV422

-

YUV 4:2:2 chroma format

-
 

GST_VAAPI_CHROMA_TYPE_YUV444

-

YUV 4:4:4 chroma format

-
 

GST_VAAPI_CHROMA_TYPE_YUV411

-

YUV 4:1:1 chroma format

-
 

GST_VAAPI_CHROMA_TYPE_YUV410

-

YUV 4:1:0 chroma format

-
 

GST_VAAPI_CHROMA_TYPE_YUV400

-

YUV 4:0:0 chroma format (grayscale)

-
 

GST_VAAPI_CHROMA_TYPE_RGB32

-

32-bit RGB chroma format

-
 

GST_VAAPI_CHROMA_TYPE_RGB16

-

16-bit RGB chroma format

-
 
-
-
-
-
-

enum GstVaapiSurfaceStatus

-

The set of all surface status for GstVaapiSurface.

-
-

Members

-
----- - - - - - - - - - - - - - - - - - - - - - - -

GST_VAAPI_SURFACE_STATUS_IDLE

-

the surface is not being rendered or displayed

-
 

GST_VAAPI_SURFACE_STATUS_RENDERING

-

the surface is used for rendering (decoding to the surface in progress)

-
 

GST_VAAPI_SURFACE_STATUS_DISPLAYING

-

the surface is being displayed to screen

-
 

GST_VAAPI_SURFACE_STATUS_SKIPPED

-

indicates a skipped frame during encode

-
 
-
-
-
-
-

enum GstVaapiSurfaceRenderFlags

-

The set of all render flags for gst_vaapi_window_put_surface().

-
-

Members

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD

-

selects the top field of the surface

-
 

GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD

-

selects the bottom field of the surface

-
 

GST_VAAPI_PICTURE_STRUCTURE_FRAME

-

selects the entire surface

-
 

GST_VAAPI_PICTURE_STRUCTURE_MASK

  

GST_VAAPI_COLOR_STANDARD_ITUR_BT_601

-

uses ITU-R BT.601 standard for color space conversion

-
 

GST_VAAPI_COLOR_STANDARD_ITUR_BT_709

-

uses ITU-R BT.709 standard for color space conversion

-
 

GST_VAAPI_COLOR_STANDARD_ITUR_BT_470M

-

uses ITU-R BT.470-2 System M standard for color space conversion

-
 

GST_VAAPI_COLOR_STANDARD_ITUR_BT_470BG

-

uses ITU-R BT.470-2 System B, G standard for color space conversion

-
 

GST_VAAPI_COLOR_STANDARD_SMPTE_170M

-

uses SMPTE-170M standard for color space conversion

-
 

GST_VAAPI_COLOR_STANDARD_SMPTE_240M

-

uses SMPTE-240M standard for color space conversion

-
 

GST_VAAPI_COLOR_STANDARD_MASK

  
-
-
-
-
-

GstVaapiSurface

-
typedef struct {
-} GstVaapiSurface;
-
-

A VA surface wrapper.

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiSurfacePool.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiSurfacePool.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiSurfacePool.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiSurfacePool.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,131 +0,0 @@ - - - - -GstVaapiSurfacePool: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiSurfacePool

-

GstVaapiSurfacePool — VA surface pool

-
-
-

Functions

-
---- - - - - -
-GstVaapiVideoPool * - -gst_vaapi_surface_pool_new () -
-
-
-

Types and Values

-
---- - - - - -
 GstVaapiSurfacePool
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_surface_pool_new ()

-
GstVaapiVideoPool *
-gst_vaapi_surface_pool_new (GstVaapiDisplay *display,
-                            GstVideoFormat format,
-                            guint width,
-                            guint height);
-

Creates a new GstVaapiVideoPool of GstVaapiSurface with the specified -format and dimensions. If format - is GST_VIDEO_FORMAT_ENCODED, then -surfaces with best "native" format would be created. Typically, this is -NV12 format, but this is implementation (driver) defined.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

format

a GstVideoFormat

 

width

the desired width, in pixels

 

height

the desired height, in pixels

 
-
-
-

Returns

-

the newly allocated GstVaapiVideoPool

-
-
-
-
-

Types and Values

-
-

GstVaapiSurfacePool

-
typedef struct _GstVaapiSurfacePool GstVaapiSurfacePool;
-

A pool of lazily allocated GstVaapiSurface objects.

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiSurfaceProxy.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiSurfaceProxy.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiSurfaceProxy.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiSurfaceProxy.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,477 +0,0 @@ - - - - -GstVaapiSurfaceProxy: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiSurfaceProxy

-

GstVaapiSurfaceProxy — VA surface proxy

-
-
-

Functions

-
---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-GstClockTime - -gst_vaapi_surface_proxy_get_duration () -
-guint - -gst_vaapi_surface_proxy_get_flags () -
-GstVaapiSurface * - -gst_vaapi_surface_proxy_get_surface () -
-GstVaapiID - -gst_vaapi_surface_proxy_get_surface_id () -
-GstClockTime - -gst_vaapi_surface_proxy_get_timestamp () -
-GstVaapiSurfaceProxy * - -gst_vaapi_surface_proxy_new_from_pool () -
-GstVaapiSurfaceProxy * - -gst_vaapi_surface_proxy_copy () -
-GstVaapiSurfaceProxy * - -gst_vaapi_surface_proxy_ref () -
-void - -gst_vaapi_surface_proxy_replace () -
-void - -gst_vaapi_surface_proxy_set_destroy_notify () -
-void - -gst_vaapi_surface_proxy_unref () -
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_surface_proxy_get_duration ()

-
GstClockTime
-gst_vaapi_surface_proxy_get_duration (GstVaapiSurfaceProxy *proxy);
-

Returns the presentation duration for this surface proxy -.

-
-

Parameters

-
----- - - - - - -

proxy

a GstVaapiSurfaceProxy

 
-
-
-

Returns

-

the presentation duration

-
-
-
-
-

gst_vaapi_surface_proxy_get_flags ()

-
guint
-gst_vaapi_surface_proxy_get_flags (GstVaapiSurfaceProxy *proxy);
-

Returns the GstVaapiSurfaceProxyFlags associated with this surface -proxy -.

-
-

Parameters

-
----- - - - - - -

proxy

a GstVaapiSurfaceProxy

 
-
-
-

Returns

-

the set of GstVaapiSurfaceProxyFlags

-
-
-
-
-

gst_vaapi_surface_proxy_get_surface ()

-
GstVaapiSurface *
-gst_vaapi_surface_proxy_get_surface (GstVaapiSurfaceProxy *proxy);
-

Returns the GstVaapiSurface stored in the proxy -.

-
-

Parameters

-
----- - - - - - -

proxy

a GstVaapiSurfaceProxy

 
-
-
-

Returns

-

the GstVaapiSurface

-
-
-
-
-

gst_vaapi_surface_proxy_get_surface_id ()

-
GstVaapiID
-gst_vaapi_surface_proxy_get_surface_id
-                               (GstVaapiSurfaceProxy *proxy);
-

Returns the VA surface ID stored in the proxy -.

-
-

Parameters

-
----- - - - - - -

proxy

a GstVaapiSurfaceProxy

 
-
-
-

Returns

-

the GstVaapiID

-
-
-
-
-

gst_vaapi_surface_proxy_get_timestamp ()

-
GstClockTime
-gst_vaapi_surface_proxy_get_timestamp (GstVaapiSurfaceProxy *proxy);
-

Returns the presentation timestamp for this surface proxy -.

-
-

Parameters

-
----- - - - - - -

proxy

a GstVaapiSurfaceProxy

 
-
-
-

Returns

-

the presentation timestamp

-
-
-
-
-

gst_vaapi_surface_proxy_new_from_pool ()

-
GstVaapiSurfaceProxy *
-gst_vaapi_surface_proxy_new_from_pool (GstVaapiSurfacePool *pool);
-

Allocates a new surface from the supplied surface pool - and creates -the wrapped surface proxy object from it. When the last reference -to the proxy object is released, then the underlying VA surface is -pushed back to its parent pool.

-
-

Parameters

-
----- - - - - - -

pool

a GstVaapiSurfacePool

 
-
-
-

Returns

-

The same newly allocated proxy -object, or NULL on error

-
-
-
-
-

gst_vaapi_surface_proxy_copy ()

-
GstVaapiSurfaceProxy *
-gst_vaapi_surface_proxy_copy (GstVaapiSurfaceProxy *proxy);
-

Creates are new VA surface proxy object from the supplied parent -proxy - object with the same initial information, e.g. timestamp, -duration.

-

Note: the destroy notify function is not copied into the new -surface proxy object.

-
-

Parameters

-
----- - - - - - -

proxy

the parent GstVaapiSurfaceProxy

 
-
-
-

Returns

-

The same newly allocated proxy -object, or NULL on error

-
-
-
-
-

gst_vaapi_surface_proxy_ref ()

-
GstVaapiSurfaceProxy *
-gst_vaapi_surface_proxy_ref (GstVaapiSurfaceProxy *proxy);
-

Atomically increases the reference count of the given proxy - by one.

-
-

Parameters

-
----- - - - - - -

proxy

a GstVaapiSurfaceProxy

 
-
-
-

Returns

-

The same proxy -argument

-
-
-
-
-

gst_vaapi_surface_proxy_replace ()

-
void
-gst_vaapi_surface_proxy_replace (GstVaapiSurfaceProxy **old_proxy_ptr,
-                                 GstVaapiSurfaceProxy *new_proxy);
-

Atomically replaces the proxy object held in old_proxy_ptr - with -new_proxy -. This means that old_proxy_ptr - shall reference a valid -object. However, new_proxy - can be NULL.

-
-

Parameters

-
----- - - - - - - - - - - - - -

old_proxy_ptr

a pointer to a GstVaapiSurfaceProxy

 

new_proxy

a GstVaapiSurfaceProxy

 
-
-
-
-
-

gst_vaapi_surface_proxy_set_destroy_notify ()

-
void
-gst_vaapi_surface_proxy_set_destroy_notify
-                               (GstVaapiSurfaceProxy *proxy,
-                                GDestroyNotify destroy_func,
-                                gpointer user_data);
-

Sets destroy_func - as the function to call when the surface proxy - -was released. At this point, the proxy object is considered -released, i.e. the underlying data storage is no longer valid and -the callback function shall not expect anything from that.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

proxy

a GstVaapiSurfaceProxy -

 

destroy_func

a GDestroyNotify function

 

user_data

some extra data to pass to the destroy_func -function

 
-
-
-
-
-

gst_vaapi_surface_proxy_unref ()

-
void
-gst_vaapi_surface_proxy_unref (GstVaapiSurfaceProxy *proxy);
-

Atomically decreases the reference count of the proxy - by one. If -the reference count reaches zero, the object will be free'd.

-
-

Parameters

-
----- - - - - - -

proxy

a GstVaapiSurfaceProxy

 
-
-
-
-
-

Types and Values

-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiTextureEGL.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiTextureEGL.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiTextureEGL.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiTextureEGL.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,201 +0,0 @@ - - - - -GstVaapiTextureEGL: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiTextureEGL

-

GstVaapiTextureEGL — VA/EGL texture abstraction

-
-
-

Functions

- -
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_texture_egl_new ()

-
GstVaapiTexture *
-gst_vaapi_texture_egl_new (GstVaapiDisplay *display,
-                           guint target,
-                           guint format,
-                           guint width,
-                           guint height);
-

Creates a texture with the specified dimensions, target - and -format -. Note that only GL_TEXTURE_2D target - and GL_RGBA or -GL_BGRA formats are supported at this time.

-

The application shall maintain the live EGL context itself. That -is, gst_vaapi_window_egl_make_current() must be called beforehand, -or any other function like eglMakeCurrent() if the context is -managed outside of this library.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

target

the target to which the texture is bound

 

format

the format of the pixel data

 

width

the requested width, in pixels

 

height

the requested height, in pixels

 
-
-
-

Returns

-

the newly created GstVaapiTexture object

-
-
-
-
-

gst_vaapi_texture_egl_new_wrapped ()

-
GstVaapiTexture *
-gst_vaapi_texture_egl_new_wrapped (GstVaapiDisplay *display,
-                                   guint id,
-                                   guint target,
-                                   guint format,
-                                   guint width,
-                                   guint height);
-

Creates a texture from an existing GL texture, with the specified -target - and format -. Note that only GL_TEXTURE_2D target - and -GL_RGBA or GL_BGRA formats are supported at this time.

-

The application shall maintain the live EGL context itself. That -is, gst_vaapi_window_egl_make_current() must be called beforehand, -or any other function like eglMakeCurrent() if the context is -managed outside of this library.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

texture_id

the foreign GL texture name to use

 

target

the target to which the texture is bound

 

format

the format of the pixel data

 

width

the texture width, in pixels

 

height

the texture height, in pixels

 
-
-
-

Returns

-

the newly created GstVaapiTexture object

-
-
-
-
-

Types and Values

-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiTextureGLX.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiTextureGLX.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiTextureGLX.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiTextureGLX.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,191 +0,0 @@ - - - - -GstVaapiTextureGLX: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiTextureGLX

-

GstVaapiTextureGLX — VA/GLX texture abstraction

-
-
-

Functions

- -
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_texture_glx_new ()

-
GstVaapiTexture *
-gst_vaapi_texture_glx_new (GstVaapiDisplay *display,
-                           guint target,
-                           guint format,
-                           guint width,
-                           guint height);
-

Creates a texture with the specified dimensions, target - and -format -. Note that only GL_TEXTURE_2D target - and GL_RGBA or -GL_BGRA formats are supported at this time.

-

The application shall maintain the live GL context itself. That is, -gst_vaapi_window_glx_make_current() must be called beforehand, or -any other function like glXMakeCurrent() if the context is managed -outside of this library.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

target

the target to which the texture is bound

 

format

the format of the pixel data

 

width

the requested width, in pixels

 

height

the requested height, in pixels

 
-
-
-

Returns

-

the newly created GstVaapiTexture object

-
-
-
-
-

gst_vaapi_texture_glx_new_wrapped ()

-
GstVaapiTexture *
-gst_vaapi_texture_glx_new_wrapped (GstVaapiDisplay *display,
-                                   guint id,
-                                   guint target,
-                                   guint format);
-

Creates a texture from an existing GL texture, with the specified -target - and format -. Note that only GL_TEXTURE_2D target - and -GL_RGBA or GL_BGRA formats are supported at this time. The -dimensions will be retrieved from the texture_id -.

-

The application shall maintain the live GL context itself. That is, -gst_vaapi_window_glx_make_current() must be called beforehand, or -any other function like glXMakeCurrent() if the context is managed -outside of this library.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

texture_id

the foreign GL texture name to use

 

target

the target to which the texture is bound

 

format

the format of the pixel data

 
-
-
-

Returns

-

the newly created GstVaapiTexture object

-
-
-
-
-

Types and Values

-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiTexture.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiTexture.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiTexture.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiTexture.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,685 +0,0 @@ - - - - -GstVaapiTexture: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiTexture

-

GstVaapiTexture — VA/GLX texture abstraction

-
-
-

Functions

-
---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-GstVaapiTexture * - -gst_vaapi_texture_new () -
-GstVaapiTexture * - -gst_vaapi_texture_new_wrapped () -
-GstVaapiTexture * - -gst_vaapi_texture_ref () -
-void - -gst_vaapi_texture_unref () -
-void - -gst_vaapi_texture_replace () -
-guint - -gst_vaapi_texture_get_id () -
-guint - -gst_vaapi_texture_get_target () -
-guint - -gst_vaapi_texture_get_format () -
-guint - -gst_vaapi_texture_get_width () -
-guint - -gst_vaapi_texture_get_height () -
-void - -gst_vaapi_texture_get_size () -
-guint - -gst_vaapi_texture_get_orientation_flags () -
-void - -gst_vaapi_texture_set_orientation_flags () -
-gboolean - -gst_vaapi_texture_put_surface () -
-
-
-

Types and Values

-
---- - - - - -
 GstVaapiTexture
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_texture_new ()

-
GstVaapiTexture *
-gst_vaapi_texture_new (GstVaapiDisplay *display,
-                       guint target,
-                       guint format,
-                       guint width,
-                       guint height);
-

Creates a texture with the specified dimensions, target - and -format -. Note that only GL_TEXTURE_2D target - and GL_RGBA or -GL_BGRA formats are supported at this time.

-

The application shall maintain the live GL context itself.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

target

the target to which the texture is bound

 

format

the format of the pixel data

 

width

the requested width, in pixels

 

height

the requested height, in pixels

 
-
-
-

Returns

-

the newly created GstVaapiTexture object

-
-
-
-
-

gst_vaapi_texture_new_wrapped ()

-
GstVaapiTexture *
-gst_vaapi_texture_new_wrapped (GstVaapiDisplay *display,
-                               guint id,
-                               guint target,
-                               guint format,
-                               guint width,
-                               guint height);
-

Creates a texture with the specified dimensions, target - and -format -. Note that only GL_TEXTURE_2D target - and GL_RGBA or -GL_BGRA formats are supported at this time.

-

The size arguments width - and height - are only a suggestion. Should -this be 0x0, then the actual size of the allocated texture storage -would be either inherited from the original texture storage, if any -and/or if possible, or derived from the VA surface in subsequent -gst_vaapi_texture_put_surface() calls.

-

The application shall maintain the live GL context itself.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

texture_id

the foreign GL texture name to use

 

target

the target to which the texture is bound

 

format

the format of the pixel data

 

width

the suggested width, in pixels

 

height

the suggested height, in pixels

 
-
-
-

Returns

-

the newly created GstVaapiTexture object

-
-
-
-
-

gst_vaapi_texture_ref ()

-
GstVaapiTexture *
-gst_vaapi_texture_ref (GstVaapiTexture *texture);
-

Atomically increases the reference count of the given texture - by one.

-
-

Parameters

-
----- - - - - - -

texture

a GstVaapiTexture

 
-
-
-

Returns

-

The same texture -argument

-
-
-
-
-

gst_vaapi_texture_unref ()

-
void
-gst_vaapi_texture_unref (GstVaapiTexture *texture);
-

Atomically decreases the reference count of the texture - by one. If -the reference count reaches zero, the texture will be free'd.

-
-

Parameters

-
----- - - - - - -

texture

a GstVaapiTexture

 
-
-
-
-
-

gst_vaapi_texture_replace ()

-
void
-gst_vaapi_texture_replace (GstVaapiTexture **old_texture_ptr,
-                           GstVaapiTexture *new_texture);
-

Atomically replaces the texture texture held in old_texture_ptr - -with new_texture -. This means that old_texture_ptr - shall reference -a valid texture. However, new_texture - can be NULL.

-
-

Parameters

-
----- - - - - - - - - - - - - -

old_texture_ptr

a pointer to a GstVaapiTexture

 

new_texture

a GstVaapiTexture

 
-
-
-
-
-

gst_vaapi_texture_get_id ()

-
guint
-gst_vaapi_texture_get_id (GstVaapiTexture *texture);
-

Returns the underlying texture id of the texture -.

-
-

Parameters

-
----- - - - - - -

texture

a GstVaapiTexture

 
-
-
-

Returns

-

the underlying texture id of the texture -

-
-
-
-
-

gst_vaapi_texture_get_target ()

-
guint
-gst_vaapi_texture_get_target (GstVaapiTexture *texture);
-

Returns the texture - target type

-
-

Parameters

-
----- - - - - - -

texture

a GstVaapiTexture

 
-
-
-

Returns

-

the texture target

-
-
-
-
-

gst_vaapi_texture_get_format ()

-
guint
-gst_vaapi_texture_get_format (GstVaapiTexture *texture);
-

Returns the texture - format

-
-

Parameters

-
----- - - - - - -

texture

a GstVaapiTexture

 
-
-
-

Returns

-

the texture format

-
-
-
-
-

gst_vaapi_texture_get_width ()

-
guint
-gst_vaapi_texture_get_width (GstVaapiTexture *texture);
-

Returns the texture - width.

-
-

Parameters

-
----- - - - - - -

texture

a GstVaapiTexture

 
-
-
-

Returns

-

the texture width, in pixels

-
-
-
-
-

gst_vaapi_texture_get_height ()

-
guint
-gst_vaapi_texture_get_height (GstVaapiTexture *texture);
-

Returns the texture - height.

-
-

Parameters

-
----- - - - - - -

texture

a GstVaapiTexture

 
-
-
-

Returns

-

the texture height, in pixels.

-
-
-
-
-

gst_vaapi_texture_get_size ()

-
void
-gst_vaapi_texture_get_size (GstVaapiTexture *texture,
-                            guint *width_ptr,
-                            guint *height_ptr);
-

Retrieves the dimensions of a GstVaapiTexture.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

texture

a GstVaapiTexture

 

width_ptr

return location for the width, or NULL

 

height_ptr

return location for the height, or NULL

 
-
-
-
-
-

gst_vaapi_texture_get_orientation_flags ()

-
guint
-gst_vaapi_texture_get_orientation_flags
-                               (GstVaapiTexture *texture);
-

Retrieves the texture memory layout flags, i.e. orientation.

-
-

Parameters

-
----- - - - - - -

texture

a GstVaapiTexture

 
-
-
-

Returns

-

the GstVaapiTextureOrientationFlags.

-
-
-
-
-

gst_vaapi_texture_set_orientation_flags ()

-
void
-gst_vaapi_texture_set_orientation_flags
-                               (GstVaapiTexture *texture,
-                                guint flags);
-

Reset the texture orientation flags to the supplied set of -flags -. This completely replaces the previously installed -flags. So, should they still be needed, then they shall be -retrieved first with gst_vaapi_texture_get_orientation_flags().

-
-

Parameters

-
----- - - - - - - - - - - - - -

texture

a GstVaapiTexture

 

flags

a bitmask of GstVaapiTextureOrientationFlags

 
-
-
-
-
-

gst_vaapi_texture_put_surface ()

-
gboolean
-gst_vaapi_texture_put_surface (GstVaapiTexture *texture,
-                               GstVaapiSurface *surface,
-                               const GstVaapiRectangle *crop_rect,
-                               guint flags);
-

Renders the surface - into the àtexture. The flags - specify how -de-interlacing (if needed), color space conversion, scaling and -other postprocessing transformations are performed.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

texture

a GstVaapiTexture

 

surface

a GstVaapiSurface

 

flags

postprocessing flags. See GstVaapiTextureRenderFlags

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

Types and Values

-
-

GstVaapiTexture

-
typedef struct {
-} GstVaapiTexture;
-
-

Base class for API-dependent textures.

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiValue.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiValue.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiValue.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiValue.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,240 +0,0 @@ - - - - -GstVaapiValue: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiValue

-

GstVaapiValue — GValue implementations specific to VA-API

-
-
-

Functions

-
---- - - - - -
#define -GST_VAAPI_POPCOUNT32() -
-
-
-

Types and Values

-
---- - - - - - - - - - - - - - - - - - - - - - - - - - - -
 GstVaapiEnumSubset
#defineGST_VAAPI_TYPE_POINT
#defineGST_VAAPI_TYPE_RECTANGLE
#defineGST_VAAPI_TYPE_RENDER_MODE
#defineGST_VAAPI_TYPE_ROTATION
#defineGST_VAAPI_TYPE_RATE_CONTROL
-
-
-

Description

-
-
-

Functions

-
-

GST_VAAPI_POPCOUNT32()

-
#define             GST_VAAPI_POPCOUNT32(x)
-

Computes the number of bits set in the supplied 32-bit value x -.

-
-

Parameters

-
----- - - - - - -

x

the value from which to compute population count

 
-
-
-

Returns

-

the number of bits set in x -

-
-
-
-
-

Types and Values

-
-

GstVaapiEnumSubset

-
typedef struct {
-    GType parent_type;
-    GType type;
-    GTypeInfo type_info;
-    const gchar *type_name;
-    GEnumValue *values;
-    guint num_values;
-} GstVaapiEnumSubset;
-
-

Structure that holds the required information to build a GEnum -subset from the supplied parent_type -, i.e. a subset of its values.

-
-

Members

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

GType parent_type;

parent enum type

 

GType type;

registered GType

 

GTypeInfo type_info;

GTypeInfo used to build the type -

 

const gchar *type_name;

  

GEnumValue *values;

pointer to a static array of GEnumValue elements

 

guint num_values;

number of elements in the values -array, including the -terminator

 
-
-
-
-
-

GST_VAAPI_TYPE_POINT

-
#define GST_VAAPI_TYPE_POINT gst_vaapi_point_get_type()
-
-

A GstVaapiPoint type that represents a 2D point coordinates.

-
-

Returns

-

the GType of GstVaapiPoint

-
-
-
-
-

GST_VAAPI_TYPE_RECTANGLE

-
#define GST_VAAPI_TYPE_RECTANGLE gst_vaapi_rectangle_get_type()
-
-

A GstVaapiRectangle type that represents a 2D rectangle position -and size.

-
-

Returns

-

the GType of GstVaapiRectangle

-
-
-
-
-

GST_VAAPI_TYPE_RENDER_MODE

-
#define GST_VAAPI_TYPE_RENDER_MODE gst_vaapi_render_mode_get_type()
-
-

A GstVaapiRenderMode type that represents the VA display backend -rendering mode: overlay (2D engine) or textured-blit (3D engine).

-
-

Returns

-

the GType of GstVaapiRenderMode

-
-
-
-
-

GST_VAAPI_TYPE_ROTATION

-
#define GST_VAAPI_TYPE_ROTATION gst_vaapi_rotation_get_type()
-
-

A type that represents the VA display rotation.

-
-

Returns

-

the GType of GstVaapiRotation

-
-
-
-
-

GST_VAAPI_TYPE_RATE_CONTROL

-
#define GST_VAAPI_TYPE_RATE_CONTROL gst_vaapi_rate_control_get_type()
-
-

A type that represents the VA rate control.

-
-

Returns

-

the GType of GstVaapiRateControl

-
-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiVideoPool.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiVideoPool.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiVideoPool.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiVideoPool.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,480 +0,0 @@ - - - - -GstVaapiVideoPool: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiVideoPool

-

GstVaapiVideoPool — Video object pool abstraction

-
-
-

Functions

-
---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-GstVaapiDisplay * - -gst_vaapi_video_pool_get_display () -
-GstVaapiVideoPoolObjectType - -gst_vaapi_video_pool_get_object_type () -
-gpointer - -gst_vaapi_video_pool_get_object () -
-void - -gst_vaapi_video_pool_put_object () -
-gboolean - -gst_vaapi_video_pool_add_object () -
-gboolean - -gst_vaapi_video_pool_add_objects () -
-guint - -gst_vaapi_video_pool_get_capacity () -
-void - -gst_vaapi_video_pool_set_capacity () -
-guint - -gst_vaapi_video_pool_get_size () -
-gboolean - -gst_vaapi_video_pool_reserve () -
-
-
-

Types and Values

-
---- - - - - -
 GstVaapiVideoPool
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_video_pool_get_display ()

-
GstVaapiDisplay *
-gst_vaapi_video_pool_get_display (GstVaapiVideoPool *pool);
-

Retrieves the GstVaapiDisplay the pool - is bound to. The pool - -owns the returned object and it shall not be unref'ed.

-
-

Parameters

-
----- - - - - - -

pool

a GstVaapiVideoPool

 
-
-
-

Returns

-

the GstVaapiDisplay the pool -is bound to

-
-
-
-
-

gst_vaapi_video_pool_get_object_type ()

-
GstVaapiVideoPoolObjectType
-gst_vaapi_video_pool_get_object_type (GstVaapiVideoPool *pool);
-

Retrieves the type of objects the video pool - supports.

-
-

Parameters

-
----- - - - - - -

pool

a GstVaapiVideoPool

 
-
-
-

Returns

-

the GstVaapiVideoPoolObjectType of the underlying pool -objects

-
-
-
-
-

gst_vaapi_video_pool_get_object ()

-
gpointer
-gst_vaapi_video_pool_get_object (GstVaapiVideoPool *pool);
-

Retrieves a new object from the pool -, or allocates a new one if -none was found. The pool - holds a reference on the returned object -and thus shall be released through gst_vaapi_video_pool_put_object() -when it's no longer needed.

-
-

Parameters

-
----- - - - - - -

pool

a GstVaapiVideoPool

 
-
-
-

Returns

-

a possibly newly allocated object, or NULL on error

-
-
-
-
-

gst_vaapi_video_pool_put_object ()

-
void
-gst_vaapi_video_pool_put_object (GstVaapiVideoPool *pool,
-                                 gpointer object);
-

Pushes the object - back into the pool. The object - shall be -obtained from the pool - through gst_vaapi_video_pool_get_object(). -Calling this function with an arbitrary object yields undefined -behaviour.

-
-

Parameters

-
----- - - - - - - - - - - - - -

pool

a GstVaapiVideoPool

 

object

the object to add back to the pool

 
-
-
-
-
-

gst_vaapi_video_pool_add_object ()

-
gboolean
-gst_vaapi_video_pool_add_object (GstVaapiVideoPool *pool,
-                                 gpointer object);
-

Adds the object - to the pool. The pool then holds a reference on -the object -. This operation does not change the capacity of the -pool.

-
-

Parameters

-
----- - - - - - - - - - - - - -

pool

a GstVaapiVideoPool

 

object

the object to add to the pool

 
-
-
-

Returns

-

TRUE on success.

-
-
-
-
-

gst_vaapi_video_pool_add_objects ()

-
gboolean
-gst_vaapi_video_pool_add_objects (GstVaapiVideoPool *pool,
-                                  GPtrArray *objects);
-

Adds the objects - to the pool. The pool then holds a reference on -the objects -. This operation does not change the capacity of the -pool and is just a wrapper around gst_vaapi_video_pool_add_object().

-
-

Parameters

-
----- - - - - - - - - - - - - -

pool

a GstVaapiVideoPool

 

objects

a GPtrArray of objects

 
-
-
-

Returns

-

TRUE on success.

-
-
-
-
-

gst_vaapi_video_pool_get_capacity ()

-
guint
-gst_vaapi_video_pool_get_capacity (GstVaapiVideoPool *pool);
-

Returns the maximum number of objects in the pool. i.e. the maximum -number of objects that can be returned by gst_vaapi_video_pool_get_object().

-
-

Parameters

-
----- - - - - - -

pool

a GstVaapiVideoPool

 
-
-
-

Returns

-

the capacity of the pool

-
-
-
-
-

gst_vaapi_video_pool_set_capacity ()

-
void
-gst_vaapi_video_pool_set_capacity (GstVaapiVideoPool *pool,
-                                   guint capacity);
-

Sets the maximum number of objects that can be allocated in the pool.

-
-

Parameters

-
----- - - - - - - - - - - - - -

pool

a GstVaapiVideoPool

 

capacity

the maximal capacity of the pool

 
-
-
-
-
-

gst_vaapi_video_pool_get_size ()

-
guint
-gst_vaapi_video_pool_get_size (GstVaapiVideoPool *pool);
-

Returns the number of free objects available in the pool.

-
-

Parameters

-
----- - - - - - -

pool

a GstVaapiVideoPool

 
-
-
-

Returns

-

number of free objects in the pool

-
-
-
-
-

gst_vaapi_video_pool_reserve ()

-
gboolean
-gst_vaapi_video_pool_reserve (GstVaapiVideoPool *pool,
-                              guint n);
-

Pre-allocates up to n - objects in the pool. If n - is less than or -equal to the number of free and used objects in the pool, this call -has no effect. Otherwise, it is a request for allocation of -additional objects.

-
-

Parameters

-
----- - - - - - - - - - - - - -

pool

a GstVaapiVideoPool

 

n

the number of objects to pre-allocate

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

Types and Values

-
-

GstVaapiVideoPool

-
typedef struct {
-} GstVaapiVideoPool;
-
-

A pool of lazily allocated video objects. e.g. surfaces, images.

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiWindowDRM.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiWindowDRM.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiWindowDRM.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiWindowDRM.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ - - - - -GstVaapiWindowDRM: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiWindowDRM

-

GstVaapiWindowDRM — VA/DRM dummy window abstraction

-
-
-

Functions

-
---- - - - - -
-GstVaapiWindow * - -gst_vaapi_window_drm_new () -
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_window_drm_new ()

-
GstVaapiWindow *
-gst_vaapi_window_drm_new (GstVaapiDisplay *display,
-                          guint width,
-                          guint height);
-

Creates a dummy window. The window will be attached to the display -. -All rendering functions will return success since VA/DRM is a -renderless API.

-

Note: this dummy window object is only necessary to fulfill cases -where the client application wants to automatically determine the -best display to use for the current system. As such, it provides -utility functions with the same API (function arguments) to help -implement uniform function tables.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

width

the requested window width, in pixels (unused)

 

height

the requested windo height, in pixels (unused)

 
-
-
-

Returns

-

the newly allocated GstVaapiWindow object

-
-
-
-
-

Types and Values

-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiWindowEGL.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiWindowEGL.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiWindowEGL.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiWindowEGL.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,108 +0,0 @@ - - - - -GstVaapiWindowEGL: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiWindowEGL

-

GstVaapiWindowEGL — VA/EGL window abstraction

-
-
-

Functions

-
---- - - - - -
-GstVaapiWindow * - -gst_vaapi_window_egl_new () -
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_window_egl_new ()

-
GstVaapiWindow *
-gst_vaapi_window_egl_new (GstVaapiDisplay *display,
-                          guint width,
-                          guint height);
-

Creates a window with the specified width - and height -. The window -will be attached to the display - and remains invisible to the user -until gst_vaapi_window_show() is called.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

width

the requested window width, in pixels

 

height

the requested windo height, in pixels

 
-
-
-

Returns

-

the newly allocated GstVaapiWindow object

-
-
-
-
-

Types and Values

-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiWindowGLX.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiWindowGLX.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiWindowGLX.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiWindowGLX.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,394 +0,0 @@ - - - - -GstVaapiWindowGLX: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiWindowGLX

-

GstVaapiWindowGLX — VA/GLX window abstraction

-
-
-

Functions

- -
-
-

Types and Values

-
---- - - - - -
 GstVaapiWindowGLX
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_window_glx_new ()

-
GstVaapiWindow *
-gst_vaapi_window_glx_new (GstVaapiDisplay *display,
-                          guint width,
-                          guint height);
-

Creates a window with the specified width - and height -. The window -will be attached to the display - and remains invisible to the user -until gst_vaapi_window_show() is called.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

width

the requested window width, in pixels

 

height

the requested windo height, in pixels

 
-
-
-

Returns

-

the newly allocated GstVaapiWindow object

-
-
-
-
-

gst_vaapi_window_glx_new_with_xid ()

-
GstVaapiWindow *
-gst_vaapi_window_glx_new_with_xid (GstVaapiDisplay *display,
-                                   Window xid);
-

Creates a GstVaapiWindow using the X11 Window xid -. The caller -still owns the window and must call XDestroyWindow() when all -GstVaapiWindow references are released. Doing so too early can -yield undefined behaviour.

-
-

Parameters

-
----- - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

xid

an X11 Window id

 
-
-
-

Returns

-

the newly allocated GstVaapiWindow object

-
-
-
-
-

gst_vaapi_window_glx_get_context ()

-
GLXContext
-gst_vaapi_window_glx_get_context (GstVaapiWindowGLX *window);
-

Returns the GLXContext bound to the window -.

-
-

Parameters

-
----- - - - - - -

window

a GstVaapiWindowGLX

 
-
-
-

Returns

-

the GLXContext bound to the window -

-
-
-
-
-

gst_vaapi_window_glx_set_context ()

-
gboolean
-gst_vaapi_window_glx_set_context (GstVaapiWindowGLX *window,
-                                  GLXContext ctx);
-

Binds GLX context ctx - to window -. If ctx - is non NULL, the caller -is responsible to making sure it has compatible visual with that of -the underlying X window. If ctx - is NULL, a new context is created -and the window - owns it.

-
-

Parameters

-
----- - - - - - - - - - - - - -

window

a GstVaapiWindowGLX

 

ctx

a GLX context

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

gst_vaapi_window_glx_make_current ()

-
gboolean
-gst_vaapi_window_glx_make_current (GstVaapiWindowGLX *window);
-

Makes the window - GLX context the current GLX rendering context of -the calling thread, replacing the previously current context if -there was one.

-
-

Parameters

-
----- - - - - - -

window

a GstVaapiWindowGLX

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

gst_vaapi_window_glx_swap_buffers ()

-
void
-gst_vaapi_window_glx_swap_buffers (GstVaapiWindowGLX *window);
-

Promotes the contents of the back buffer of window - to become the -contents of the front buffer of window -. This simply is wrapper -around glXSwapBuffers().

-
-

Parameters

-
----- - - - - - -

window

a GstVaapiWindowGLX

 
-
-
-
-
-

gst_vaapi_window_glx_put_texture ()

-
gboolean
-gst_vaapi_window_glx_put_texture (GstVaapiWindowGLX *window,
-                                  GstVaapiTexture *texture,
-                                  const GstVaapiRectangle *src_rect,
-                                  const GstVaapiRectangle *dst_rect);
-

Renders the texture - region specified by src_rect - into the window - -region specified by dst_rect -.

-

NOTE: only GL_TEXTURE_2D textures are supported at this time.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - - - - - - -

window

a GstVaapiWindowGLX

 

texture

a GstVaapiTexture

 

src_rect

the sub-rectangle of the source texture to -extract and process. If NULL, the entire texture will be used.

 

dst_rect

the sub-rectangle of the destination -window into which the texture is rendered. If NULL, the entire -window will be used.

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

Types and Values

-
-

GstVaapiWindowGLX

-
typedef struct _GstVaapiWindowGLX GstVaapiWindowGLX;
-

An X11 Window suitable for GLX rendering.

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiWindow.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiWindow.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiWindow.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiWindow.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,622 +0,0 @@ - - - - -GstVaapiWindow: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiWindow

-

GstVaapiWindow — VA window abstraction

-
-
-

Functions

-
---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-GstVaapiDisplay * - -gst_vaapi_window_get_display () -
-void - -gst_vaapi_window_show () -
-void - -gst_vaapi_window_hide () -
-gboolean - -gst_vaapi_window_get_fullscreen () -
-void - -gst_vaapi_window_set_fullscreen () -
-guint - -gst_vaapi_window_get_width () -
-guint - -gst_vaapi_window_get_height () -
-void - -gst_vaapi_window_get_size () -
-void - -gst_vaapi_window_set_width () -
-void - -gst_vaapi_window_set_height () -
-void - -gst_vaapi_window_set_size () -
-gboolean - -gst_vaapi_window_put_pixmap () -
-gboolean - -gst_vaapi_window_put_surface () -
-
-
-

Types and Values

-
---- - - - - -
 GstVaapiWindow
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_window_get_display ()

-
GstVaapiDisplay *
-gst_vaapi_window_get_display (GstVaapiWindow *window);
-

Returns the GstVaapiDisplay this window - is bound to.

-
-

Parameters

-
----- - - - - - -

window

a GstVaapiWindow

 
-
-
-

Returns

-

the parent GstVaapiDisplay object

-
-
-
-
-

gst_vaapi_window_show ()

-
void
-gst_vaapi_window_show (GstVaapiWindow *window);
-

Flags a window to be displayed. Any window that is not shown will -not appear on the screen.

-
-

Parameters

-
----- - - - - - -

window

a GstVaapiWindow

 
-
-
-
-
-

gst_vaapi_window_hide ()

-
void
-gst_vaapi_window_hide (GstVaapiWindow *window);
-

Reverses the effects of gst_vaapi_window_show(), causing the window -to be hidden (invisible to the user).

-
-

Parameters

-
----- - - - - - -

window

a GstVaapiWindow

 
-
-
-
-
-

gst_vaapi_window_get_fullscreen ()

-
gboolean
-gst_vaapi_window_get_fullscreen (GstVaapiWindow *window);
-

Retrieves whether the window - is fullscreen or not

-
-

Parameters

-
----- - - - - - -

window

a GstVaapiWindow

 
-
-
-

Returns

-

TRUE if the window is fullscreen

-
-
-
-
-

gst_vaapi_window_set_fullscreen ()

-
void
-gst_vaapi_window_set_fullscreen (GstVaapiWindow *window,
-                                 gboolean fullscreen);
-

Requests to place the window - in fullscreen or unfullscreen states.

-
-

Parameters

-
----- - - - - - - - - - - - - -

window

a GstVaapiWindow

 

fullscreen

TRUE to request window to get fullscreen

 
-
-
-
-
-

gst_vaapi_window_get_width ()

-
guint
-gst_vaapi_window_get_width (GstVaapiWindow *window);
-

Retrieves the width of a GstVaapiWindow.

-
-

Parameters

-
----- - - - - - -

window

a GstVaapiWindow

 
-
-
-

Returns

-

the width of the window -, in pixels

-
-
-
-
-

gst_vaapi_window_get_height ()

-
guint
-gst_vaapi_window_get_height (GstVaapiWindow *window);
-

Retrieves the height of a GstVaapiWindow

-
-

Parameters

-
----- - - - - - -

window

a GstVaapiWindow

 
-
-
-

Returns

-

the height of the window -, in pixels

-
-
-
-
-

gst_vaapi_window_get_size ()

-
void
-gst_vaapi_window_get_size (GstVaapiWindow *window,
-                           guint *width_ptr,
-                           guint *height_ptr);
-

Retrieves the dimensions of a GstVaapiWindow.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

window

a GstVaapiWindow

 

width_ptr

return location for the width, or NULL

 

height_ptr

return location for the height, or NULL

 
-
-
-
-
-

gst_vaapi_window_set_width ()

-
void
-gst_vaapi_window_set_width (GstVaapiWindow *window,
-                            guint width);
-

Resizes the window - to match the specified width -.

-
-

Parameters

-
----- - - - - - - - - - - - - -

window

a GstVaapiWindow

 

width

requested new width for the window, in pixels

 
-
-
-
-
-

gst_vaapi_window_set_height ()

-
void
-gst_vaapi_window_set_height (GstVaapiWindow *window,
-                             guint height);
-

Resizes the window - to match the specified height -.

-
-

Parameters

-
----- - - - - - - - - - - - - -

window

a GstVaapiWindow

 

height

requested new height for the window, in pixels

 
-
-
-
-
-

gst_vaapi_window_set_size ()

-
void
-gst_vaapi_window_set_size (GstVaapiWindow *window,
-                           guint width,
-                           guint height);
-

Resizes the window - to match the specified width - and height -.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

window

a GstVaapiWindow

 

width

requested new width for the window, in pixels

 

height

requested new height for the window, in pixels

 
-
-
-
-
-

gst_vaapi_window_put_pixmap ()

-
gboolean
-gst_vaapi_window_put_pixmap (GstVaapiWindow *window,
-                             GstVaapiPixmap *pixmap,
-                             const GstVaapiRectangle *src_rect,
-                             const GstVaapiRectangle *dst_rect);
-

Renders the pixmap - region specified by src_rect - into the window - -region specified by dst_rect -.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - - - - - - -

window

a GstVaapiWindow

 

pixmap

a GstVaapiPixmap

 

src_rect

the sub-rectangle of the source pixmap to -extract and process. If NULL, the entire pixmap will be used.

 

dst_rect

the sub-rectangle of the destination -window into which the pixmap is rendered. If NULL, the entire -window will be used.

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

gst_vaapi_window_put_surface ()

-
gboolean
-gst_vaapi_window_put_surface (GstVaapiWindow *window,
-                              GstVaapiSurface *surface,
-                              const GstVaapiRectangle *src_rect,
-                              const GstVaapiRectangle *dst_rect,
-                              guint flags);
-

Renders the surface - region specified by src_rect - into the window - -region specified by dst_rect -. The flags - specify how de-interlacing -(if needed), color space conversion, scaling and other postprocessing -transformations are performed.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

window

a GstVaapiWindow

 

surface

a GstVaapiSurface

 

src_rect

the sub-rectangle of the source surface to -extract and process. If NULL, the entire surface will be used.

 

dst_rect

the sub-rectangle of the destination -window into which the surface is rendered. If NULL, the entire -window will be used.

 

flags

postprocessing flags. See GstVaapiSurfaceRenderFlags

 
-
-
-

Returns

-

TRUE on success

-
-
-
-
-

Types and Values

-
-

GstVaapiWindow

-
typedef struct {
-} GstVaapiWindow;
-
-

Base class for system-dependent windows.

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiWindowWayland.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiWindowWayland.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiWindowWayland.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiWindowWayland.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,108 +0,0 @@ - - - - -GstVaapiWindowWayland: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiWindowWayland

-

GstVaapiWindowWayland — VA/Wayland window abstraction

-
-
-

Functions

-
---- - - - - -
-GstVaapiWindow * - -gst_vaapi_window_wayland_new () -
-
-
-

Description

-
-
-

Functions

-
-

gst_vaapi_window_wayland_new ()

-
GstVaapiWindow *
-gst_vaapi_window_wayland_new (GstVaapiDisplay *display,
-                              guint width,
-                              guint height);
-

Creates a window with the specified width - and height -. The window -will be attached to the display - and remains invisible to the user -until gst_vaapi_window_show() is called.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

width

the requested window width, in pixels

 

height

the requested windo height, in pixels

 
-
-
-

Returns

-

the newly allocated GstVaapiWindow object

-
-
-
-
-

Types and Values

-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiWindowX11.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiWindowX11.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVaapiWindowX11.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVaapiWindowX11.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,277 +0,0 @@ - - - - -GstVaapiWindowX11: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiWindowX11

-

GstVaapiWindowX11 — VA/X11 window abstraction

-
-
-

Functions

-
---- - - - - - - - - - - - - - - - - - - - - - - -
#define -GST_VAAPI_WINDOW_XWINDOW() -
-GstVaapiWindow * - -gst_vaapi_window_x11_new () -
-GstVaapiWindow * - -gst_vaapi_window_x11_new_with_xid () -
-Window - -gst_vaapi_window_x11_get_xid () -
-gboolean - -gst_vaapi_window_x11_is_foreign_xid () -
-
-
-

Types and Values

-
---- - - - - -
 GstVaapiWindowX11
-
-
-

Description

-
-
-

Functions

-
-

GST_VAAPI_WINDOW_XWINDOW()

-
#define             GST_VAAPI_WINDOW_XWINDOW(window)
-

Macro that evaluates to the underlying X11 Window of window -

-
-

Parameters

-
----- - - - - - -

window

a GstVaapiWindow

 
-
-
-
-
-

gst_vaapi_window_x11_new ()

-
GstVaapiWindow *
-gst_vaapi_window_x11_new (GstVaapiDisplay *display,
-                          guint width,
-                          guint height);
-

Creates a window with the specified width - and height -. The window -will be attached to the display - and remains invisible to the user -until gst_vaapi_window_show() is called.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

width

the requested window width, in pixels

 

height

the requested windo height, in pixels

 
-
-
-

Returns

-

the newly allocated GstVaapiWindow object

-
-
-
-
-

gst_vaapi_window_x11_new_with_xid ()

-
GstVaapiWindow *
-gst_vaapi_window_x11_new_with_xid (GstVaapiDisplay *display,
-                                   Window xid);
-

Creates a GstVaapiWindow using the X11 Window xid -. The caller -still owns the window and must call XDestroyWindow() when all -GstVaapiWindow references are released. Doing so too early can -yield undefined behaviour.

-
-

Parameters

-
----- - - - - - - - - - - - - -

display

a GstVaapiDisplay

 

xid

an X11 Window id

 
-
-
-

Returns

-

the newly allocated GstVaapiWindow object

-
-
-
-
-

gst_vaapi_window_x11_get_xid ()

-
Window
-gst_vaapi_window_x11_get_xid (GstVaapiWindowX11 *window);
-

Returns the underlying X11 Window that was created by -gst_vaapi_window_x11_new() or that was bound with -gst_vaapi_window_x11_new_with_xid().

-
-

Parameters

-
----- - - - - - -

window

a GstVaapiWindowX11

 
-
-
-

Returns

-

the underlying X11 Window bound to window -.

-
-
-
-
-

gst_vaapi_window_x11_is_foreign_xid ()

-
gboolean
-gst_vaapi_window_x11_is_foreign_xid (GstVaapiWindowX11 *window);
-

Checks whether the window - XID was created by gst_vaapi_window_x11_new() or bound with gst_vaapi_window_x11_new_with_xid().

-
-

Parameters

-
----- - - - - - -

window

a GstVaapiWindowX11

 
-
-
-

Returns

-

TRUE if the underlying X window is owned by the -caller (foreign window)

-
-
-
-
-

Types and Values

-
-

GstVaapiWindowX11

-
typedef struct {
-} GstVaapiWindowX11;
-
-

An X11 Window wrapper.

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVideoFormat.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVideoFormat.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/libs-GstVideoFormat.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/libs-GstVideoFormat.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,345 +0,0 @@ - - - - -GstVideoFormat: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVideoFormat

-

GstVideoFormat — Video format helpers for VA-API

-
- -
-

Description

-
-
-

Functions

-
-

gst_vaapi_video_format_to_string ()

-
const gchar *
-gst_vaapi_video_format_to_string (GstVideoFormat format);
-

Returns the string representation of the format - argument.

-
-

Parameters

-
----- - - - - - -

format

a GstVideoFormat

 
-
-
-

Returns

-

string representation of format -, or NULL if unknown -or unsupported.

-
-
-
-
-

gst_vaapi_video_format_from_va_fourcc ()

-
GstVideoFormat
-gst_vaapi_video_format_from_va_fourcc (guint32 fourcc);
-

Converts a VA fourcc into the corresponding GstVideoFormat. If no -matching fourcc was found, then zero is returned.

-
-

Parameters

-
----- - - - - - -

fourcc

a FOURCC value

 
-
-
-

Returns

-

the GstVideoFormat corresponding to the VA fourcc -

-
-
-
-
-

gst_vaapi_video_format_from_va_format ()

-
GstVideoFormat
-gst_vaapi_video_format_from_va_format (const VAImageFormat *va_format);
-

Converts a VA image format into the corresponding GstVideoFormat. -If the image format cannot be represented by GstVideoFormat, -then zero is returned.

-
-

Parameters

-
----- - - - - - -

va_format

a VAImageFormat

 
-
-
-

Returns

-

the GstVideoFormat describing the va_format -

-
-
-
-
-

gst_vaapi_video_format_get_chroma_type ()

-
guint
-gst_vaapi_video_format_get_chroma_type
-                               (GstVideoFormat format);
-

Converts a GstVideoFormat into the corresponding GstVaapiChromaType -format.

-
-

Parameters

-
----- - - - - - -

format

a GstVideoFormat

 
-
-
-

Returns

-

the GstVaapiChromaType format, or zero if no match -was found.

-
-
-
-
-

gst_vaapi_video_format_get_score ()

-
guint
-gst_vaapi_video_format_get_score (GstVideoFormat format);
-

Determines how "native" is this format -. The lower is the returned -score, the best format this is for the underlying hardware.

-
-

Parameters

-
----- - - - - - -

format

a GstVideoFormat

 
-
-
-

Returns

-

the format -score, or G_MAXUINT if none was found

-
-
-
-
-

gst_vaapi_video_format_is_rgb ()

-
gboolean
-gst_vaapi_video_format_is_rgb (GstVideoFormat format);
-

Checks whether the format is an RGB format.

-
-

Parameters

-
----- - - - - - -

format

a GstVideoFormat

 
-
-
-

Returns

-

TRUE if format -is RGB format

-
-
-
-
-

gst_vaapi_video_format_is_yuv ()

-
gboolean
-gst_vaapi_video_format_is_yuv (GstVideoFormat format);
-

Checks whether the format is an YUV format.

-
-

Parameters

-
----- - - - - - -

format

a GstVideoFormat

 
-
-
-

Returns

-

TRUE if format -is YUV format

-
-
-
-
-

gst_vaapi_video_format_to_va_format ()

-
const VAImageFormat *
-gst_vaapi_video_format_to_va_format (GstVideoFormat format);
-

Converts a GstVideoFormat into the corresponding VA image -format. If no matching VA image format was found, NULL is returned -and this error must be reported to be fixed.

-
-

Parameters

-
----- - - - - - -

format

a GstVideoFormat

 
-
-
-

Returns

-

the VA image format, or NULL if none was found

-
-
-
-
-

Types and Values

-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/object-tree.html gstreamer-vaapi-1.8.2/docs/reference/libs/html/object-tree.html --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/object-tree.html 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/object-tree.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ - - - - -Object Hierarchy: GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - - - - - - - - - - - - - -
-

-Object Hierarchy

-
-
-
-
- - - \ No newline at end of file Binary files /tmp/tmpUUqCms/Qg4lAwNSh6/gstreamer-vaapi-0.7.0/docs/reference/libs/html/right-insensitive.png and /tmp/tmpUUqCms/c79LJCUvkE/gstreamer-vaapi-1.8.2/docs/reference/libs/html/right-insensitive.png differ Binary files /tmp/tmpUUqCms/Qg4lAwNSh6/gstreamer-vaapi-0.7.0/docs/reference/libs/html/right.png and /tmp/tmpUUqCms/c79LJCUvkE/gstreamer-vaapi-1.8.2/docs/reference/libs/html/right.png differ diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/html/style.css gstreamer-vaapi-1.8.2/docs/reference/libs/html/style.css --- gstreamer-vaapi-0.7.0/docs/reference/libs/html/style.css 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/html/style.css 1970-01-01 00:00:00.000000000 +0000 @@ -1,479 +0,0 @@ -body -{ - font-family: cantarell, sans-serif; -} -.synopsis, .classsynopsis -{ - /* tango:aluminium 1/2 */ - background: #eeeeec; - background: rgba(238, 238, 236, 0.5); - border: solid 1px rgb(238, 238, 236); - padding: 0.5em; -} -.programlisting -{ - /* tango:sky blue 0/1 */ - /* fallback for no rgba support */ - background: #e6f3ff; - border: solid 1px #729fcf; - background: rgba(114, 159, 207, 0.1); - border: solid 1px rgba(114, 159, 207, 0.2); - padding: 0.5em; -} -.variablelist -{ - padding: 4px; - margin-left: 3em; -} -.variablelist td:first-child -{ - vertical-align: top; -} - -div.gallery-float -{ - float: left; - padding: 10px; -} -div.gallery-float img -{ - border-style: none; -} -div.gallery-spacer -{ - clear: both; -} - -a, a:visited -{ - text-decoration: none; - /* tango:sky blue 2 */ - color: #3465a4; -} -a:hover -{ - text-decoration: underline; - /* tango:sky blue 1 */ - color: #729fcf; -} - -div.informaltable table -{ - border-collapse: separate; - border-spacing: 1em 0.3em; - border: none; -} - -div.informaltable table td, div.informaltable table th -{ - vertical-align: top; -} - -.function_type, -.variable_type, -.property_type, -.signal_type, -.parameter_name, -.struct_member_name, -.union_member_name, -.define_keyword, -.datatype_keyword, -.typedef_keyword -{ - text-align: right; -} - -/* dim non-primary columns */ -.c_punctuation, -.function_type, -.variable_type, -.property_type, -.signal_type, -.define_keyword, -.datatype_keyword, -.typedef_keyword, -.property_flags, -.signal_flags, -.parameter_annotations, -.enum_member_annotations, -.struct_member_annotations, -.union_member_annotations -{ - color: #888a85; -} - -.function_type a, -.function_type a:visited, -.function_type a:hover, -.property_type a, -.property_type a:visited, -.property_type a:hover, -.signal_type a, -.signal_type a:visited, -.signal_type a:hover, -.signal_flags a, -.signal_flags a:visited, -.signal_flags a:hover -{ - color: #729fcf; -} - -td p -{ - margin: 0.25em; -} - -div.table table -{ - border-collapse: collapse; - border-spacing: 0px; - /* tango:aluminium 3 */ - border: solid 1px #babdb6; -} - -div.table table td, div.table table th -{ - /* tango:aluminium 3 */ - border: solid 1px #babdb6; - padding: 3px; - vertical-align: top; -} - -div.table table th -{ - /* tango:aluminium 2 */ - background-color: #d3d7cf; -} - -h4 -{ - color: #555753; - margin-top: 1em; - margin-bottom: 1em; -} - -hr -{ - /* tango:aluminium 1 */ - color: #d3d7cf; - background: #d3d7cf; - border: none 0px; - height: 1px; - clear: both; - margin: 2.0em 0em 2.0em 0em; -} - -dl.toc dt -{ - padding-bottom: 0.25em; -} - -dl.toc > dt -{ - padding-top: 0.25em; - padding-bottom: 0.25em; - font-weight: bold; -} - -dl.toc > dl -{ - padding-bottom: 0.5em; -} - -.parameter -{ - font-style: normal; -} - -.footer -{ - padding-top: 3.5em; - /* tango:aluminium 3 */ - color: #babdb6; - text-align: center; - font-size: 80%; -} - -.informalfigure, -.figure -{ - margin: 1em; -} - -.informalexample, -.example -{ - margin-top: 1em; - margin-bottom: 1em; -} - -.warning -{ - /* tango:orange 0/1 */ - background: #ffeed9; - background: rgba(252, 175, 62, 0.1); - border-color: #ffb04f; - border-color: rgba(252, 175, 62, 0.2); -} -.note -{ - /* tango:chameleon 0/0.5 */ - background: #d8ffb2; - background: rgba(138, 226, 52, 0.1); - border-color: #abf562; - border-color: rgba(138, 226, 52, 0.2); -} -div.blockquote -{ - border-color: #eeeeec; -} -.note, .warning, div.blockquote -{ - padding: 0.5em; - border-width: 1px; - border-style: solid; - margin: 2em; -} -.note p, .warning p -{ - margin: 0; -} - -div.warning h3.title, -div.note h3.title -{ - display: none; -} - -p + div.section -{ - margin-top: 1em; -} - -div.refnamediv, -div.refsynopsisdiv, -div.refsect1, -div.refsect2, -div.toc, -div.section -{ - margin-bottom: 1em; -} - -/* blob links */ -h2 .extralinks, h3 .extralinks -{ - float: right; - /* tango:aluminium 3 */ - color: #babdb6; - font-size: 80%; - font-weight: normal; -} - -.lineart -{ - color: #d3d7cf; - font-weight: normal; -} - -.annotation -{ - /* tango:aluminium 5 */ - color: #555753; - font-weight: normal; -} - -.structfield -{ - font-style: normal; - font-weight: normal; -} - -acronym,abbr -{ - border-bottom: 1px dotted gray; -} - -/* code listings */ - -.listing_code .programlisting .normal, -.listing_code .programlisting .normal a, -.listing_code .programlisting .number, -.listing_code .programlisting .cbracket, -.listing_code .programlisting .symbol { color: #555753; } -.listing_code .programlisting .comment, -.listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ -.listing_code .programlisting .function, -.listing_code .programlisting .function a, -.listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ -.listing_code .programlisting .string { color: #ad7fa8; } /* tango: plum */ -.listing_code .programlisting .keyword, -.listing_code .programlisting .usertype, -.listing_code .programlisting .type, -.listing_code .programlisting .type a { color: #4e9a06; } /* tango: chameleon 3 */ - -.listing_frame { - /* tango:sky blue 1 */ - border: solid 1px #729fcf; - border: solid 1px rgba(114, 159, 207, 0.2); - padding: 0px; -} - -.listing_lines, .listing_code { - margin-top: 0px; - margin-bottom: 0px; - padding: 0.5em; -} -.listing_lines { - /* tango:sky blue 0.5 */ - background: #a6c5e3; - background: rgba(114, 159, 207, 0.2); - /* tango:aluminium 6 */ - color: #2e3436; -} -.listing_code { - /* tango:sky blue 0 */ - background: #e6f3ff; - background: rgba(114, 159, 207, 0.1); -} -.listing_code .programlisting { - /* override from previous */ - border: none 0px; - padding: 0px; - background: none; -} -.listing_lines pre, .listing_code pre { - margin: 0px; -} - -@media screen { - /* these have a as a first child, but since there are no parent selectors - * we can't use that. */ - a.footnote - { - position: relative; - top: 0em ! important; - } - /* this is needed so that the local anchors are displayed below the naviagtion */ - div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] - { - display: inline-block; - position: relative; - top:-5em; - } - /* this seems to be a bug in the xsl style sheets when generating indexes */ - div.index div.index - { - top: 0em; - } - /* make space for the fixed navigation bar and add space at the bottom so that - * link targets appear somewhat close to top - */ - body - { - padding-top: 2.5em; - padding-bottom: 500px; - max-width: 60em; - } - p - { - max-width: 60em; - } - /* style and size the navigation bar */ - table.navigation#top - { - position: fixed; - background: #e2e2e2; - border-bottom: solid 1px #babdb6; - border-spacing: 5px; - margin-top: 0; - margin-bottom: 0; - top: 0; - left: 0; - z-index: 10; - } - table.navigation#top td - { - padding-left: 6px; - padding-right: 6px; - } - .navigation a, .navigation a:visited - { - /* tango:sky blue 3 */ - color: #204a87; - } - .navigation a:hover - { - /* tango:sky blue 2 */ - color: #3465a4; - } - td.shortcuts - { - /* tango:sky blue 2 */ - color: #3465a4; - font-size: 80%; - white-space: nowrap; - } - td.shortcuts .dim - { - color: #babdb6; - } - .navigation .title - { - font-size: 80%; - max-width: none; - margin: 0px; - font-weight: normal; - } -} -@media screen and (min-width: 60em) { - /* screen larger than 60em */ - body { margin: auto; } -} -@media screen and (max-width: 60em) { - /* screen less than 60em */ - #nav_hierarchy { display: none; } - #nav_interfaces { display: none; } - #nav_prerequisites { display: none; } - #nav_derived_interfaces { display: none; } - #nav_implementations { display: none; } - #nav_child_properties { display: none; } - #nav_style_properties { display: none; } - #nav_index { display: none; } - #nav_glossary { display: none; } - .gallery_image { display: none; } - .property_flags { display: none; } - .signal_flags { display: none; } - .parameter_annotations { display: none; } - .enum_member_annotations { display: none; } - .struct_member_annotations { display: none; } - .union_member_annotations { display: none; } - /* now that a column is hidden, optimize space */ - col.parameters_name { width: auto; } - col.parameters_description { width: auto; } - col.struct_members_name { width: auto; } - col.struct_members_description { width: auto; } - col.enum_members_name { width: auto; } - col.enum_members_description { width: auto; } - col.union_members_name { width: auto; } - col.union_members_description { width: auto; } - .listing_lines { display: none; } -} -@media print { - table.navigation { - visibility: collapse; - display: none; - } - div.titlepage table.navigation { - visibility: visible; - display: table; - background: #e2e2e2; - border: solid 1px #babdb6; - margin-top: 0; - margin-bottom: 0; - top: 0; - left: 0; - height: 3em; - } -} - Binary files /tmp/tmpUUqCms/Qg4lAwNSh6/gstreamer-vaapi-0.7.0/docs/reference/libs/html/up-insensitive.png and /tmp/tmpUUqCms/c79LJCUvkE/gstreamer-vaapi-1.8.2/docs/reference/libs/html/up-insensitive.png differ Binary files /tmp/tmpUUqCms/Qg4lAwNSh6/gstreamer-vaapi-0.7.0/docs/reference/libs/html/up.png and /tmp/tmpUUqCms/c79LJCUvkE/gstreamer-vaapi-1.8.2/docs/reference/libs/html/up.png differ diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/libs-docs.xml gstreamer-vaapi-1.8.2/docs/reference/libs/libs-docs.xml --- gstreamer-vaapi-0.7.0/docs/reference/libs/libs-docs.xml 2015-12-07 10:54:28.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/libs-docs.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ - - - - - GStreamer VA-API Plugins 1.6 Library Reference Manual - - - - To ease the creation of plugins, a Gstreamer-oriented library was created, - which wraps VA-API. - - - - gst-plugins-vaapi Library - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Object Hierarchy - - - - - API Index - - - - - diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/libs-docs.xml.in gstreamer-vaapi-1.8.2/docs/reference/libs/libs-docs.xml.in --- gstreamer-vaapi-0.7.0/docs/reference/libs/libs-docs.xml.in 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/libs-docs.xml.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ - - - - - GStreamer VA-API Plugins @GST_API_VERSION@ Library Reference Manual - - - - To ease the creation of plugins, a Gstreamer-oriented library was created, - which wraps VA-API. - - - - gst-plugins-vaapi Library - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Object Hierarchy - - - - - API Index - - - - - diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/libs-sections.txt gstreamer-vaapi-1.8.2/docs/reference/libs/libs-sections.txt --- gstreamer-vaapi-0.7.0/docs/reference/libs/libs-sections.txt 2015-12-07 11:01:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/libs-sections.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,579 +0,0 @@ -
-videoformat -GstVideoFormat -gst_vaapi_video_format_to_string -gst_vaapi_video_format_from_va_fourcc -gst_vaapi_video_format_from_va_format -gst_vaapi_video_format_get_chroma_type -gst_vaapi_video_format_get_score -gst_vaapi_video_format_is_rgb -gst_vaapi_video_format_is_yuv -gst_vaapi_video_format_to_va_format -
- -
-gstvaapisurfacepool -GstVaapiSurfacePool -GstVaapiSurfacePool -gst_vaapi_surface_pool_new - -GST_VAAPI_SURFACE_POOL -
- -
-gstvaapivideopool -GstVaapiVideoPool -GstVaapiVideoPool -gst_vaapi_video_pool_get_display -gst_vaapi_video_pool_get_object_type -gst_vaapi_video_pool_get_object -gst_vaapi_video_pool_put_object -gst_vaapi_video_pool_add_object -gst_vaapi_video_pool_add_objects -gst_vaapi_video_pool_get_capacity -gst_vaapi_video_pool_set_capacity -gst_vaapi_video_pool_get_size -gst_vaapi_video_pool_reserve - -GST_VAAPI_VIDEO_POOL -
- -
-gstvaapidisplay_x11 -GstVaapiDisplayX11 -GstVaapiDisplayX11 -gst_vaapi_display_x11_new -gst_vaapi_display_x11_new_with_display -gst_vaapi_display_x11_get_display -gst_vaapi_display_x11_get_screen - -GST_VAAPI_DISPLAY_X11 -
- -
-gstvaapidisplay_drm -GstVaapiDisplayDRM -gst_vaapi_display_drm_new -gst_vaapi_display_drm_new_with_device -gst_vaapi_display_drm_get_device -gst_vaapi_display_drm_get_device_path -
- -
-gstvaapidisplay_wayland -GstVaapiDisplayWayland -gst_vaapi_display_wayland_new -gst_vaapi_display_wayland_new_with_display -gst_vaapi_display_wayland_get_display -
- -
-gstvaapidisplay_egl -GstVaapiDisplayEGL -GstVaapiDisplayEGL -gst_vaapi_display_egl_new -gst_vaapi_display_egl_new_with_native_display -gst_vaapi_display_egl_get_gl_display -gst_vaapi_display_egl_set_gl_context -gst_vaapi_display_egl_get_gl_context - -GST_VAAPI_DISPLAY_EGL -
- -
-gstvaapiwindow_x11 -GstVaapiWindowX11 -GstVaapiWindowX11 -GST_VAAPI_WINDOW_XWINDOW -gst_vaapi_window_x11_new -gst_vaapi_window_x11_new_with_xid -gst_vaapi_window_x11_get_xid -gst_vaapi_window_x11_is_foreign_xid - -GST_VAAPI_WINDOW_X11 -
- -
-gstvaapiwindow_wayland -GstVaapiWindowWayland -gst_vaapi_window_wayland_new -
- -
-gstvaapiwindow_drm -GstVaapiWindowDRM -gst_vaapi_window_drm_new -
- -
-gstvaapiwindow_glx -GstVaapiWindowGLX -gst_vaapi_window_glx_new -gst_vaapi_window_glx_new_with_xid -gst_vaapi_window_glx_get_context -gst_vaapi_window_glx_set_context -gst_vaapi_window_glx_make_current -gst_vaapi_window_glx_swap_buffers -gst_vaapi_window_glx_put_texture -
- -
-gstvaapiwindow_egl -GstVaapiWindowEGL -gst_vaapi_window_egl_new -
- -
-gstvaapipixmap_x11 -GstVaapiPixmapX11 -GstVaapiPixmapX11 -GST_VAAPI_PIXMAP_XPIXMAP -gst_vaapi_pixmap_x11_new -gst_vaapi_pixmap_x11_new_with_xid -gst_vaapi_pixmap_x11_get_xid -gst_vaapi_pixmap_x11_is_foreign_xid - -GST_VAAPI_WINDOW_X11 -
- -
-gstvaapidisplay_glx -GstVaapiDisplayGLX -GstVaapiDisplayGLX -gst_vaapi_display_glx_new -gst_vaapi_display_glx_new_with_display - -GST_VAAPI_DISPLAY_GLX -
- -
-gstvaapiwindow_glx -GstVaapiWindowGLX -GstVaapiWindowGLX -gst_vaapi_window_glx_new -gst_vaapi_window_glx_new_with_xid -gst_vaapi_window_glx_get_context -gst_vaapi_window_glx_set_context -gst_vaapi_window_glx_make_current -gst_vaapi_window_glx_swap_buffers -gst_vaapi_window_glx_put_texture - -GST_VAAPI_WINDOW_GLX -
- -
-gstvaapidisplay -GstVaapiDisplay -GstVaapiDisplayType -GstVaapiDisplay -GstVaapiDisplayInfo -gst_vaapi_display_new_with_display -gst_vaapi_display_ref -gst_vaapi_display_unref -gst_vaapi_display_replace -gst_vaapi_display_lock -gst_vaapi_display_unlock -gst_vaapi_display_sync -gst_vaapi_display_flush -gst_vaapi_display_get_class_type -gst_vaapi_display_get_display_type -gst_vaapi_display_get_display_name -gst_vaapi_display_get_display -gst_vaapi_display_get_width -gst_vaapi_display_get_height -gst_vaapi_display_get_size -gst_vaapi_display_get_pixel_aspect_ratio -gst_vaapi_display_has_video_processing -gst_vaapi_display_get_decode_profiles -gst_vaapi_display_has_decoder -gst_vaapi_display_get_encode_profiles -gst_vaapi_display_has_encoder -gst_vaapi_display_get_image_formats -gst_vaapi_display_has_image_format -gst_vaapi_display_get_subpicture_formats -gst_vaapi_display_has_subpicture_format -gst_vaapi_display_has_property -gst_vaapi_display_get_property -gst_vaapi_display_set_property -gst_vaapi_display_get_render_mode -gst_vaapi_display_set_render_mode -gst_vaapi_display_get_rotation -gst_vaapi_display_set_rotation -gst_vaapi_display_get_vendor_string -gst_vaapi_display_has_opengl - -GST_VAAPI_DISPLAY -GST_VAAPI_DISPLAY_GET_CLASS_TYPE -GST_VAAPI_DISPLAY_VADISPLAY_TYPE -GST_VAAPI_DISPLAY_VADISPLAY -GST_VAAPI_DISPLAY_LOCK -GST_VAAPI_DISPLAY_UNLOCK -GST_VAAPI_DISPLAY_PROP_RENDER_MODE -GST_VAAPI_DISPLAY_PROP_ROTATION -GST_VAAPI_DISPLAY_PROP_HUE -GST_VAAPI_DISPLAY_PROP_SATURATION -GST_VAAPI_DISPLAY_PROP_BRIGHTNESS -GST_VAAPI_DISPLAY_PROP_CONTRAST -
- -
-gstvaapiimagepool -GstVaapiImagePool -GstVaapiImagePool -gst_vaapi_image_pool_new - -GST_VAAPI_IMAGE_POOL -
- -
-gstvaapitypes -Basic data structures -GstVaapiID -GST_VAAPI_ID_FORMAT -GST_VAAPI_ID_ARGS -GstVaapiPoint -GstVaapiRectangle -
- -
-gstvaapipixmap -GstVaapiPixmap -GstVaapiPixmap -gst_vaapi_pixmap_ref -gst_vaapi_pixmap_unref -gst_vaapi_pixmap_replace -gst_vaapi_pixmap_get_format -gst_vaapi_pixmap_get_width -gst_vaapi_pixmap_get_height -gst_vaapi_pixmap_get_size -gst_vaapi_pixmap_put_surface - -GST_VAAPI_PIXMAP -
- -
-gstvaapiwindow -GstVaapiWindow -GstVaapiWindow -gst_vaapi_window_get_display -gst_vaapi_window_show -gst_vaapi_window_hide -gst_vaapi_window_get_fullscreen -gst_vaapi_window_set_fullscreen -gst_vaapi_window_get_width -gst_vaapi_window_get_height -gst_vaapi_window_get_size -gst_vaapi_window_set_width -gst_vaapi_window_set_height -gst_vaapi_window_set_size -gst_vaapi_window_put_pixmap -gst_vaapi_window_put_surface - -GST_VAAPI_WINDOW -
- -
-gstvaapiobject -GstVaapiObject -GstVaapiObject -gst_vaapi_object_get_display -gst_vaapi_object_lock_display -gst_vaapi_object_unlock_display -gst_vaapi_object_get_id - -GST_VAAPI_OBJECT -
- -
-gstvaapiimage -GST_VAAPI_IMAGE_FORMAT -GST_VAAPI_IMAGE_WIDTH -GST_VAAPI_IMAGE_HEIGHT -GstVaapiImage -GstVaapiImage -gst_vaapi_image_new -gst_vaapi_image_new_with_image -gst_vaapi_image_get_id -gst_vaapi_image_get_image -gst_vaapi_image_get_format -gst_vaapi_image_get_width -gst_vaapi_image_get_height -gst_vaapi_image_get_size -gst_vaapi_image_is_linear -gst_vaapi_image_is_mapped -gst_vaapi_image_map -gst_vaapi_image_unmap -gst_vaapi_image_get_plane_count -gst_vaapi_image_get_plane -gst_vaapi_image_get_pitch -gst_vaapi_image_get_data_size -gst_vaapi_image_get_buffer -gst_vaapi_image_update_from_buffer -gst_vaapi_image_copy - -GST_VAAPI_IMAGE -
- -
-gstvaapisurface -GstVaapiChromaType -GstVaapiSurfaceStatus -GstVaapiSurfaceRenderFlags -GstVaapiSurface -GstVaapiSurface -gst_vaapi_surface_new -gst_vaapi_surface_new_with_format -gst_vaapi_surface_get_id -gst_vaapi_surface_get_chroma_type -gst_vaapi_surface_get_format -gst_vaapi_surface_get_width -gst_vaapi_surface_get_height -gst_vaapi_surface_get_size -gst_vaapi_surface_derive_image -gst_vaapi_surface_get_image -gst_vaapi_surface_put_image -gst_vaapi_surface_associate_subpicture -gst_vaapi_surface_deassociate_subpicture -gst_vaapi_surface_sync -gst_vaapi_surface_query_status - -GST_VAAPI_SURFACE -
- -
-gstvaapisubpicture -GstVaapiSubpicture -GstVaapiSubpicture -gst_vaapi_subpicture_new -gst_vaapi_subpicture_new_from_overlay_rectangle -gst_vaapi_subpicture_get_id -gst_vaapi_subpicture_get_flags -gst_vaapi_subpicture_get_global_alpha -gst_vaapi_subpicture_set_global_alpha -gst_vaapi_subpicture_get_image -gst_vaapi_subpicture_set_image - -GST_VAAPI_SUBPICTURE -
- -
-gstvaapiprofile -GstVaapiProfile -GstVaapiCodec -GstVaapiProfile -GstVaapiEntrypoint -gst_vaapi_profile -gst_vaapi_profile_from_caps -gst_vaapi_profile_get_va_profile -gst_vaapi_profile_get_caps -gst_vaapi_profile_get_codec -gst_vaapi_entrypoint -gst_vaapi_entrypoint_get_va_entrypoint -
- -
-gstvaapitexture -GstVaapiTexture -GstVaapiTexture -gst_vaapi_texture_new -gst_vaapi_texture_new_wrapped -gst_vaapi_texture_ref -gst_vaapi_texture_unref -gst_vaapi_texture_replace -gst_vaapi_texture_get_id -gst_vaapi_texture_get_target -gst_vaapi_texture_get_format -gst_vaapi_texture_get_width -gst_vaapi_texture_get_height -gst_vaapi_texture_get_size -gst_vaapi_texture_get_orientation_flags -gst_vaapi_texture_set_orientation_flags -gst_vaapi_texture_put_surface -
- -
-gstvaapitexture_egl -GstVaapiTextureEGL -gst_vaapi_texture_egl_new -gst_vaapi_texture_egl_new_wrapped -
- -
-gstvaapitexture_glx -GstVaapiTextureGLX -gst_vaapi_texture_glx_new -gst_vaapi_texture_glx_new_wrapped -
- -
-gstvaapidecoder -GstVaapiDecoderStatus -GstVaapiDecoder -GstVaapiDecoder -gst_vaapi_decoder_get_caps -gst_vaapi_decoder_get_codec -gst_vaapi_decoder_get_codec_state -gst_vaapi_decoder_put_buffer -gst_vaapi_decoder_get_surface -gst_vaapi_decoder_get_frame -gst_vaapi_decoder_get_frame_with_timeout -gst_vaapi_decoder_parse -gst_vaapi_decoder_decode - -GST_VAAPI_DECODER -
- -
-gstvaapidecoder_jpeg -GstVaapiDecoderJpeg -GstVaapiDecoderJpeg -gst_vaapi_decoder_jpeg_new -
- -
-gstvaapidecoder_mpeg2 -GstVaapiDecoderMpeg2 -GstVaapiDecoderMpeg2 -gst_vaapi_decoder_mpeg2_new -
- -
-gstvaapidecoder_mpeg4 -GstVaapiDecoderMpeg4 -GstVaapiDecoderMpeg4 -gst_vaapi_decoder_mpeg4_new -
- -
-gstvaapidecoder_h264 -GstVaapiDecoderH264 -GstVaapiDecoderH264 -gst_vaapi_decoder_h264_new -
- -
-gstvaapidecoder_vc1 -GstVaapiDecoderVC1 -GstVaapiDecoderVC1 -gst_vaapi_decoder_vc1_new -
- -
-gstvaapidecoder_vp8 -GstVaapiDecoderVp8 -GstVaapiDecoderVp8 -gst_vaapi_decoder_vp8_new -
- -
-gstvaapidecoder_h265 -GstVaapiDecoderH265 -GstVaapiDecoderH265 -GstVaapiStreamAlignH265 -gst_vaapi_decoder_h265_new -gst_vaapi_decoder_h265_set_alignment -
- -
-gstvaapisurfaceproxy -GstVaapiSurfaceProxy -gst_vaapi_surface_proxy_get_duration -gst_vaapi_surface_proxy_get_flags -gst_vaapi_surface_proxy_get_surface -gst_vaapi_surface_proxy_get_surface_id -gst_vaapi_surface_proxy_get_timestamp -gst_vaapi_surface_proxy_new_from_pool -gst_vaapi_surface_proxy_copy -gst_vaapi_surface_proxy_ref -gst_vaapi_surface_proxy_replace -gst_vaapi_surface_proxy_set_destroy_notify -gst_vaapi_surface_proxy_unref - -GST_VAAPI_SURFACE_PROXY_SURFACE -
- -
-gstvaapifilter -GstVaapiFilter -GstVaapiFilter -GstVaapiFilterOp -gst_vaapi_filter_new -gst_vaapi_filter_ref -gst_vaapi_filter_unref -gst_vaapi_filter_replace -gst_vaapi_filter_get_operations -gst_vaapi_filter_get_formats -gst_vaapi_filter_has_operation -gst_vaapi_filter_use_operation -gst_vaapi_filter_set_operation -gst_vaapi_filter_set_format -gst_vaapi_filter_set_cropping_rectangle -gst_vaapi_filter_set_target_rectangle -gst_vaapi_filter_set_denoising_level -gst_vaapi_filter_set_sharpening_level -gst_vaapi_filter_set_hue -gst_vaapi_filter_set_brightness -gst_vaapi_filter_set_saturation -gst_vaapi_filter_set_deinterlacing -gst_vaapi_filter_set_deinterlacing_references - -GST_VAAPI_FILTER -
- -
-gstvaapiparser_frame -GstVaapiParserFrame -gst_vaapi_parser_frame_new -gst_vaapi_parser_frame_free -gst_vaapi_parser_frame_append_unit -gst_vaapi_parser_frame_ref -gst_vaapi_parser_frame_unref -gst_vaapi_parser_frame_replace -
- -
-gstvaapicontext -GstVaapiContext -GstVaapiConfigInfoEncoder -GstVaapiContextInfo -GstVaapiContext -GstVaapiContextUsage -gst_vaapi_context_new -gst_vaapi_context_reset -gst_vaapi_context_get_id -gst_vaapi_context_get_surface_proxy -gst_vaapi_context_get_surface_count -
- -
-gstvaapidecoder_unit -GstVaapiDecoderUnit -GstVaapiDecoderUnitFlags -GstVaapiDecoderUnit -gst_vaapi_decoder_unit_init -gst_vaapi_decoder_unit_clear -gst_vaapi_decoder_unit_new -gst_vaapi_decoder_unit_set_parsed_info - -GST_VAAPI_DECODER_UNIT_FLAGS -GST_VAAPI_DECODER_UNIT_FLAG_IS_SET -GST_VAAPI_DECODER_UNIT_FLAG_SET -GST_VAAPI_DECODER_UNIT_FLAG_UNSET -GST_VAAPI_DECODER_UNIT_IS_FRAME_START -GST_VAAPI_DECODER_UNIT_IS_FRAME_END -GST_VAAPI_DECODER_UNIT_IS_STREAM_END -GST_VAAPI_DECODER_UNIT_IS_SLICE -GST_VAAPI_DECODER_UNIT_IS_SKIPPED -
- -
-gstvaapivalue -GstVaapiValue -GstVaapiEnumSubset -GST_VAAPI_TYPE_POINT -GST_VAAPI_TYPE_RECTANGLE -GST_VAAPI_TYPE_RENDER_MODE -GST_VAAPI_TYPE_ROTATION -GST_VAAPI_TYPE_RATE_CONTROL -GST_VAAPI_POPCOUNT32 -
diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/Makefile.am gstreamer-vaapi-1.8.2/docs/reference/libs/Makefile.am --- gstreamer-vaapi-0.7.0/docs/reference/libs/Makefile.am 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,126 +0,0 @@ -## Process this file with automake to produce Makefile.in - -# We require automake 1.6 at least. -AUTOMAKE_OPTIONS = 1.6 - -# This is a blank Makefile.am for using gtk-doc. -# Copy this to your project's API docs directory and modify the variables to -# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples -# of using the various options. - -# The name of the module, e.g. 'glib'. -DOC_MODULE = libs - -# The top-level SGML file. You can change this if you want to. -DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.xml - -# The directory containing the source code. Relative to $(srcdir). -# gtk-doc will search all .c & .h files beneath here for inline comments -# documenting the functions and macros. -# e.g. DOC_SOURCE_DIR=../../../gtk -DOC_SOURCE_DIR = $(top_srcdir)/gst-libs/gst/vaapi - -# Extra options to pass to gtkdoc-scangobj. Not normally needed. -SCANGOBJ_OPTIONS = --type-init-func="g_type_init()" - -# List files used by scanobj -SCANOBJ_TYPES = - -# Extra options to supply to gtkdoc-scan. -# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" -SCAN_OPTIONS = --deprecated-guards="GST_VAAPI_DISABLE_DEPRECATED" - -# Extra options to supply to gtkdoc-mkdb. -# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml -MKDB_OPTIONS = --sgml-mode --output-format=xml --name-space=$(DOC_MODULE) - -# Extra options to supply to gtkdoc-mktmpl -# e.g. MKTMPL_OPTIONS=--only-section-tmpl -MKTMPL_OPTIONS = - -# Extra options to supply to gtkdoc-fixref. Not normally needed. -# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html -FIXXREF_OPTIONS = \ - --extra-dir=$(GLIB_PREFIX)/share/gtk-doc/html/glib \ - --extra-dir=$(GLIB_PREFIX)/share/gtk-doc/html/gobject \ - --extra-dir=$(CAIRO_PREFIX)/share/gtk-doc/html/cairo \ - --extra-dir=$(PANGO_PREFIX)/share/gtk-doc/html/pango - -# Used for dependencies. The docs will be rebuilt if any of these change. -# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h -# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c -HFILE_GLOB = $(top_srcdir)/gst-libs/gst/vaapi/*.h -CFILE_GLOB = $(top_srcdir)/gst-libs/gst/vaapi/*.c - -# Header files to ignore when scanning. -# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h -IGNORE_HFILES = \ - gstvaapi_priv.h \ - gstvaapicompat.h \ - gstvaapidebug.h \ - gstvaapidecoder_priv.h \ - gstvaapidisplay_priv.h \ - gstvaapidisplay_glx_priv.h \ - gstvaapidisplay_x11_priv.h \ - gstvaapiobject_priv.h \ - gstvaapiutils.h \ - gstvaapiutils_glx.h \ - gstvaapiutils_gst.h \ - gstvaapiutils_x11.h \ - $(NULL) - -EXTRA_HFILES = \ - $(NULL) - -# Images to copy into HTML directory. -# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png -HTML_IMAGES = \ - $(NULL) - -# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). -# e.g. content_files=running.sgml building.sgml changes-2.0.sgml -content_files = \ - $(NULL) - -# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded -# These files must be listed here *and* in content_files -# e.g. expand_content_files=running.sgml -expand_content_files = \ - $(NULL) - -# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. -# Only needed if you are using gtkdoc-scangobj to dynamically query widget -# signals and properties. -# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) -# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) - -INCLUDES = \ - $(GLIB_CFLAGS) \ - $(GST_CFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/gst-libs \ - -I$(top_srcdir)/gst-libs/gst/vaapi - -GTKDOC_LIBS = \ - $(GLIB_LIBS) \ - $(GST_LIBS) \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-$(GST_API_VERSION).la - -GTKDOC_LIBS += \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11-$(GST_API_VERSION).la - -if USE_GLX -GTKDOC_LIBS += \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-glx-$(GST_API_VERSION).la -endif - -# This includes the standard gtk-doc make rules, copied by gtkdocize. -include $(top_srcdir)/gtk-doc.make - -# Other files to distribute -# e.g. EXTRA_DIST += version.xml.in -EXTRA_DIST += \ - libs-docs.xml.in \ - $(NULL) - --include $(top_srcdir)/git.mk diff -Nru gstreamer-vaapi-0.7.0/docs/reference/libs/Makefile.in gstreamer-vaapi-1.8.2/docs/reference/libs/Makefile.in --- gstreamer-vaapi-0.7.0/docs/reference/libs/Makefile.in 2015-12-07 10:54:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/libs/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,920 +0,0 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2014 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# -*- mode: makefile -*- - -#################################### -# Everything below here is generic # -#################################### -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -@USE_GLX_TRUE@am__append_1 = \ -@USE_GLX_TRUE@ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-glx-$(GST_API_VERSION).la - -subdir = docs/reference/libs -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = libs-docs.xml -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/libs-docs.xml.in \ - $(top_srcdir)/gtk-doc.make -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DLOPEN_LIBS = @DLOPEN_LIBS@ -DRM_CFLAGS = @DRM_CFLAGS@ -DRM_LIBS = @DRM_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGL_CFLAGS = @EGL_CFLAGS@ -EGL_LIBS = @EGL_LIBS@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GIT = @GIT@ -GLES2_CFLAGS = @GLES2_CFLAGS@ -GLES2_LIBS = @GLES2_LIBS@ -GLES3_CFLAGS = @GLES3_CFLAGS@ -GLES3_LIBS = @GLES3_LIBS@ -GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_LIBS = @GLIB_LIBS@ -GLIB_VERSION_REQUIRED = @GLIB_VERSION_REQUIRED@ -GL_CFLAGS = @GL_CFLAGS@ -GL_LIBS = @GL_LIBS@ -GMODULE_CFLAGS = @GMODULE_CFLAGS@ -GMODULE_LIBS = @GMODULE_LIBS@ -GMODULE_VERSION_REQUIRED = @GMODULE_VERSION_REQUIRED@ -GREP = @GREP@ -GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ -GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ -GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ -GST_API_VERSION = @GST_API_VERSION@ -GST_BASEVIDEO_CFLAGS = @GST_BASEVIDEO_CFLAGS@ -GST_BASEVIDEO_LIBS = @GST_BASEVIDEO_LIBS@ -GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ -GST_BASE_LIBS = @GST_BASE_LIBS@ -GST_CFLAGS = @GST_CFLAGS@ -GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ -GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ -GST_GL_CFLAGS = @GST_GL_CFLAGS@ -GST_GL_LIBS = @GST_GL_LIBS@ -GST_INTERFACES_CFLAGS = @GST_INTERFACES_CFLAGS@ -GST_INTERFACES_LIBS = @GST_INTERFACES_LIBS@ -GST_LIBS = @GST_LIBS@ -GST_PKG_VERSION = @GST_PKG_VERSION@ -GST_PLUGINS_BAD_VERSION_REQUIRED = @GST_PLUGINS_BAD_VERSION_REQUIRED@ -GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ -GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ -GST_PLUGINS_BASE_VERSION_REQUIRED = @GST_PLUGINS_BASE_VERSION_REQUIRED@ -GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ -GST_PLUGIN_PATH_1_0 = @GST_PLUGIN_PATH_1_0@ -GST_VAAPI_LT_LDFLAGS = @GST_VAAPI_LT_LDFLAGS@ -GST_VAAPI_LT_VERSION = @GST_VAAPI_LT_VERSION@ -GST_VAAPI_MAJOR_VERSION = @GST_VAAPI_MAJOR_VERSION@ -GST_VERSION_REQUIRED = @GST_VERSION_REQUIRED@ -GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ -GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ -GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ -GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ -GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ -GTKDOC_MKPDF = @GTKDOC_MKPDF@ -GTKDOC_REBASE = @GTKDOC_REBASE@ -GTKDOC_VERSION = @GTKDOC_VERSION@ -HTML_DIR = @HTML_DIR@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBVA_CFLAGS = @LIBVA_CFLAGS@ -LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ -LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ -LIBVA_LIBS = @LIBVA_LIBS@ -LIBVA_PACKAGE_VERSION = @LIBVA_PACKAGE_VERSION@ -LIBVA_PKGNAME = @LIBVA_PKGNAME@ -LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ -LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ -LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ -LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ -LIBVA_X11_PKGNAME = @LIBVA_X11_PKGNAME@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATCH = @PATCH@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TODAY = @TODAY@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ -VERSION = @VERSION@ -WAYLAND_API_VERSION = @WAYLAND_API_VERSION@ -WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ -WAYLAND_LIBS = @WAYLAND_LIBS@ -X11_CFLAGS = @X11_CFLAGS@ -X11_LIBS = @X11_LIBS@ -XRANDR_CFLAGS = @XRANDR_CFLAGS@ -XRANDR_LIBS = @XRANDR_LIBS@ -XRENDER_CFLAGS = @XRENDER_CFLAGS@ -XRENDER_LIBS = @XRENDER_LIBS@ -YASM = @YASM@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ -plugindir = @plugindir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ - -# We require automake 1.6 at least. -AUTOMAKE_OPTIONS = 1.6 - -# This is a blank Makefile.am for using gtk-doc. -# Copy this to your project's API docs directory and modify the variables to -# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples -# of using the various options. - -# The name of the module, e.g. 'glib'. -DOC_MODULE = libs - -# The top-level SGML file. You can change this if you want to. -DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.xml - -# The directory containing the source code. Relative to $(srcdir). -# gtk-doc will search all .c & .h files beneath here for inline comments -# documenting the functions and macros. -# e.g. DOC_SOURCE_DIR=../../../gtk -DOC_SOURCE_DIR = $(top_srcdir)/gst-libs/gst/vaapi - -# Extra options to pass to gtkdoc-scangobj. Not normally needed. -SCANGOBJ_OPTIONS = --type-init-func="g_type_init()" - -# List files used by scanobj -SCANOBJ_TYPES = - -# Extra options to supply to gtkdoc-scan. -# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" -SCAN_OPTIONS = --deprecated-guards="GST_VAAPI_DISABLE_DEPRECATED" - -# Extra options to supply to gtkdoc-mkdb. -# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml -MKDB_OPTIONS = --sgml-mode --output-format=xml --name-space=$(DOC_MODULE) - -# Extra options to supply to gtkdoc-mktmpl -# e.g. MKTMPL_OPTIONS=--only-section-tmpl -MKTMPL_OPTIONS = - -# Extra options to supply to gtkdoc-fixref. Not normally needed. -# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html -FIXXREF_OPTIONS = \ - --extra-dir=$(GLIB_PREFIX)/share/gtk-doc/html/glib \ - --extra-dir=$(GLIB_PREFIX)/share/gtk-doc/html/gobject \ - --extra-dir=$(CAIRO_PREFIX)/share/gtk-doc/html/cairo \ - --extra-dir=$(PANGO_PREFIX)/share/gtk-doc/html/pango - - -# Used for dependencies. The docs will be rebuilt if any of these change. -# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h -# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c -HFILE_GLOB = $(top_srcdir)/gst-libs/gst/vaapi/*.h -CFILE_GLOB = $(top_srcdir)/gst-libs/gst/vaapi/*.c - -# Header files to ignore when scanning. -# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h -IGNORE_HFILES = \ - gstvaapi_priv.h \ - gstvaapicompat.h \ - gstvaapidebug.h \ - gstvaapidecoder_priv.h \ - gstvaapidisplay_priv.h \ - gstvaapidisplay_glx_priv.h \ - gstvaapidisplay_x11_priv.h \ - gstvaapiobject_priv.h \ - gstvaapiutils.h \ - gstvaapiutils_glx.h \ - gstvaapiutils_gst.h \ - gstvaapiutils_x11.h \ - $(NULL) - -EXTRA_HFILES = \ - $(NULL) - - -# Images to copy into HTML directory. -# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png -HTML_IMAGES = \ - $(NULL) - - -# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). -# e.g. content_files=running.sgml building.sgml changes-2.0.sgml -content_files = \ - $(NULL) - - -# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded -# These files must be listed here *and* in content_files -# e.g. expand_content_files=running.sgml -expand_content_files = \ - $(NULL) - - -# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. -# Only needed if you are using gtkdoc-scangobj to dynamically query widget -# signals and properties. -# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) -# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) -INCLUDES = \ - $(GLIB_CFLAGS) \ - $(GST_CFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/gst-libs \ - -I$(top_srcdir)/gst-libs/gst/vaapi - -GTKDOC_LIBS = $(GLIB_LIBS) $(GST_LIBS) \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-$(GST_API_VERSION).la \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11-$(GST_API_VERSION).la \ - $(am__append_1) -@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = -@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute - -# We set GPATH here; this gives us semantics for GNU make -# which are more like other make's VPATH, when it comes to -# whether a source that is a target of one rule is then -# searched for in VPATH/GPATH. -# -GPATH = $(srcdir) -TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) -SETUP_FILES = \ - $(content_files) \ - $(expand_content_files) \ - $(DOC_MAIN_SGML_FILE) \ - $(DOC_MODULE)-sections.txt \ - $(DOC_MODULE)-overrides.txt - - -# This includes the standard gtk-doc make rules, copied by gtkdocize. - -# Other files to distribute -# e.g. EXTRA_DIST += version.xml.in -EXTRA_DIST = $(HTML_IMAGES) $(SETUP_FILES) libs-docs.xml.in $(NULL) -DOC_STAMPS = setup-build.stamp scan-build.stamp sgml-build.stamp \ - html-build.stamp pdf-build.stamp \ - sgml.stamp html.stamp pdf.stamp - -SCANOBJ_FILES = \ - $(DOC_MODULE).args \ - $(DOC_MODULE).hierarchy \ - $(DOC_MODULE).interfaces \ - $(DOC_MODULE).prerequisites \ - $(DOC_MODULE).signals - -REPORT_FILES = \ - $(DOC_MODULE)-undocumented.txt \ - $(DOC_MODULE)-undeclared.txt \ - $(DOC_MODULE)-unused.txt - -CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test -@GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = -@GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp -@GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = -@GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp - -#### setup #### -GTK_DOC_V_SETUP = $(GTK_DOC_V_SETUP_$(V)) -GTK_DOC_V_SETUP_ = $(GTK_DOC_V_SETUP_$(AM_DEFAULT_VERBOSITY)) -GTK_DOC_V_SETUP_0 = @echo " DOC Preparing build"; - -#### scan #### -GTK_DOC_V_SCAN = $(GTK_DOC_V_SCAN_$(V)) -GTK_DOC_V_SCAN_ = $(GTK_DOC_V_SCAN_$(AM_DEFAULT_VERBOSITY)) -GTK_DOC_V_SCAN_0 = @echo " DOC Scanning header files"; -GTK_DOC_V_INTROSPECT = $(GTK_DOC_V_INTROSPECT_$(V)) -GTK_DOC_V_INTROSPECT_ = $(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY)) -GTK_DOC_V_INTROSPECT_0 = @echo " DOC Introspecting gobjects"; - -#### xml #### -GTK_DOC_V_XML = $(GTK_DOC_V_XML_$(V)) -GTK_DOC_V_XML_ = $(GTK_DOC_V_XML_$(AM_DEFAULT_VERBOSITY)) -GTK_DOC_V_XML_0 = @echo " DOC Building XML"; - -#### html #### -GTK_DOC_V_HTML = $(GTK_DOC_V_HTML_$(V)) -GTK_DOC_V_HTML_ = $(GTK_DOC_V_HTML_$(AM_DEFAULT_VERBOSITY)) -GTK_DOC_V_HTML_0 = @echo " DOC Building HTML"; -GTK_DOC_V_XREF = $(GTK_DOC_V_XREF_$(V)) -GTK_DOC_V_XREF_ = $(GTK_DOC_V_XREF_$(AM_DEFAULT_VERBOSITY)) -GTK_DOC_V_XREF_0 = @echo " DOC Fixing cross-references"; - -#### pdf #### -GTK_DOC_V_PDF = $(GTK_DOC_V_PDF_$(V)) -GTK_DOC_V_PDF_ = $(GTK_DOC_V_PDF_$(AM_DEFAULT_VERBOSITY)) -GTK_DOC_V_PDF_0 = @echo " DOC Building PDF"; -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/gtk-doc.make $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/reference/libs/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu docs/reference/libs/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; -$(top_srcdir)/gtk-doc.make $(am__empty): - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -libs-docs.xml: $(top_builddir)/config.status $(srcdir)/libs-docs.xml.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -tags TAGS: - -ctags CTAGS: - -cscope cscopelist: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" distdir="$(distdir)" \ - dist-hook -check-am: all-am -check: check-am -@ENABLE_GTK_DOC_FALSE@all-local: -all-am: Makefile all-local -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-local mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-local - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-data-local - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic \ - maintainer-clean-local - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-local - -.MAKE: install-am install-strip - -.PHONY: all all-am all-local check check-am clean clean-generic \ - clean-libtool clean-local cscopelist-am ctags-am dist-hook \ - distclean distclean-generic distclean-libtool distclean-local \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-data install-data-am install-data-local \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - maintainer-clean-local mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ - uninstall-am uninstall-local - -.PRECIOUS: Makefile - - -gtkdoc-check.test: Makefile - $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ - echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ - chmod +x $@ - -all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) -.PHONY: all-gtk-doc - -@ENABLE_GTK_DOC_TRUE@all-local: all-gtk-doc - -docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) - -$(REPORT_FILES): sgml-build.stamp - -setup-build.stamp: - -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ - files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ - if test "x$$files" != "x" ; then \ - for file in $$files ; do \ - destdir=`dirname $(abs_builddir)/$$file`; \ - test -d "$$destdir" || mkdir -p "$$destdir"; \ - test -f $(abs_srcdir)/$$file && \ - cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ - done; \ - fi; \ - fi - $(AM_V_at)touch setup-build.stamp - -scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) - $(GTK_DOC_V_SCAN)_source_dir='' ; \ - for i in $(DOC_SOURCE_DIR) ; do \ - _source_dir="$${_source_dir} --source-dir=$$i" ; \ - done ; \ - gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) - $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ - scanobj_options=""; \ - gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ - if test "$$?" = "0"; then \ - if test "x$(V)" = "x1"; then \ - scanobj_options="--verbose"; \ - fi; \ - fi; \ - CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ - gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ - else \ - for i in $(SCANOBJ_FILES) ; do \ - test -f $$i || touch $$i ; \ - done \ - fi - $(AM_V_at)touch scan-build.stamp - -$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp - @true - -sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) - $(GTK_DOC_V_XML)_source_dir='' ; \ - for i in $(DOC_SOURCE_DIR) ; do \ - _source_dir="$${_source_dir} --source-dir=$$i" ; \ - done ; \ - gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) - $(AM_V_at)touch sgml-build.stamp - -sgml.stamp: sgml-build.stamp - @true - -html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) - $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ - mkhtml_options=""; \ - gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ - if test "$$?" = "0"; then \ - if test "x$(V)" = "x1"; then \ - mkhtml_options="$$mkhtml_options --verbose"; \ - fi; \ - fi; \ - gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ - if test "$$?" = "0"; then \ - mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ - fi; \ - cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) - -@test "x$(HTML_IMAGES)" = "x" || \ - for file in $(HTML_IMAGES) ; do \ - if test -f $(abs_srcdir)/$$file ; then \ - cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ - fi; \ - if test -f $(abs_builddir)/$$file ; then \ - cp $(abs_builddir)/$$file $(abs_builddir)/html; \ - fi; \ - done; - $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) - $(AM_V_at)touch html-build.stamp - -pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) - $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ - mkpdf_options=""; \ - gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ - if test "$$?" = "0"; then \ - if test "x$(V)" = "x1"; then \ - mkpdf_options="$$mkpdf_options --verbose"; \ - fi; \ - fi; \ - if test "x$(HTML_IMAGES)" != "x"; then \ - for img in $(HTML_IMAGES); do \ - part=`dirname $$img`; \ - echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ - if test $$? != 0; then \ - mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ - fi; \ - done; \ - fi; \ - gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) - $(AM_V_at)touch pdf-build.stamp - -############## - -clean-local: - @rm -f *~ *.bak - @rm -rf .libs - @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \ - rm -f $(DOC_MODULE).types; \ - fi - @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-sections" ; then \ - rm -f $(DOC_MODULE)-sections.txt; \ - fi - -distclean-local: - @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ - $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt - @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ - rm -f $(SETUP_FILES) $(DOC_MODULE).types; \ - fi - -maintainer-clean-local: - @rm -rf xml html - -install-data-local: - @installfiles=`echo $(builddir)/html/*`; \ - if test "$$installfiles" = '$(builddir)/html/*'; \ - then echo 1>&2 'Nothing to install' ; \ - else \ - if test -n "$(DOC_MODULE_VERSION)"; then \ - installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ - else \ - installdir="$(DESTDIR)$(TARGET_DIR)"; \ - fi; \ - $(mkinstalldirs) $${installdir} ; \ - for i in $$installfiles; do \ - echo ' $(INSTALL_DATA) '$$i ; \ - $(INSTALL_DATA) $$i $${installdir}; \ - done; \ - if test -n "$(DOC_MODULE_VERSION)"; then \ - mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ - $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ - fi; \ - $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ - fi - -uninstall-local: - @if test -n "$(DOC_MODULE_VERSION)"; then \ - installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ - else \ - installdir="$(DESTDIR)$(TARGET_DIR)"; \ - fi; \ - rm -rf $${installdir} - -# -# Require gtk-doc when making dist -# -@HAVE_GTK_DOC_TRUE@dist-check-gtkdoc: docs -@HAVE_GTK_DOC_FALSE@dist-check-gtkdoc: -@HAVE_GTK_DOC_FALSE@ @echo "*** gtk-doc is needed to run 'make dist'. ***" -@HAVE_GTK_DOC_FALSE@ @echo "*** gtk-doc was not found when 'configure' ran. ***" -@HAVE_GTK_DOC_FALSE@ @echo "*** please install gtk-doc and rerun 'configure'. ***" -@HAVE_GTK_DOC_FALSE@ @false - -dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local - @mkdir $(distdir)/html - @cp ./html/* $(distdir)/html - @-cp ./$(DOC_MODULE).pdf $(distdir)/ - @-cp ./$(DOC_MODULE).types $(distdir)/ - @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ - @cd $(distdir) && rm -f $(DISTCLEANFILES) - @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html - -.PHONY : dist-hook-local docs - --include $(top_srcdir)/git.mk - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru gstreamer-vaapi-0.7.0/docs/reference/Makefile.am gstreamer-vaapi-1.8.2/docs/reference/Makefile.am --- gstreamer-vaapi-0.7.0/docs/reference/Makefile.am 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -SUBDIRS = libs plugins - --include $(top_srcdir)/git.mk diff -Nru gstreamer-vaapi-0.7.0/docs/reference/Makefile.in gstreamer-vaapi-1.8.2/docs/reference/Makefile.in --- gstreamer-vaapi-0.7.0/docs/reference/Makefile.in 2015-12-07 10:54:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,706 +0,0 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2014 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -subdir = docs/reference -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -am__recursive_targets = \ - $(RECURSIVE_TARGETS) \ - $(RECURSIVE_CLEAN_TARGETS) \ - $(am__extra_recursive_targets) -AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -am__DIST_COMMON = $(srcdir)/Makefile.in -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DLOPEN_LIBS = @DLOPEN_LIBS@ -DRM_CFLAGS = @DRM_CFLAGS@ -DRM_LIBS = @DRM_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGL_CFLAGS = @EGL_CFLAGS@ -EGL_LIBS = @EGL_LIBS@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GIT = @GIT@ -GLES2_CFLAGS = @GLES2_CFLAGS@ -GLES2_LIBS = @GLES2_LIBS@ -GLES3_CFLAGS = @GLES3_CFLAGS@ -GLES3_LIBS = @GLES3_LIBS@ -GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_LIBS = @GLIB_LIBS@ -GLIB_VERSION_REQUIRED = @GLIB_VERSION_REQUIRED@ -GL_CFLAGS = @GL_CFLAGS@ -GL_LIBS = @GL_LIBS@ -GMODULE_CFLAGS = @GMODULE_CFLAGS@ -GMODULE_LIBS = @GMODULE_LIBS@ -GMODULE_VERSION_REQUIRED = @GMODULE_VERSION_REQUIRED@ -GREP = @GREP@ -GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ -GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ -GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ -GST_API_VERSION = @GST_API_VERSION@ -GST_BASEVIDEO_CFLAGS = @GST_BASEVIDEO_CFLAGS@ -GST_BASEVIDEO_LIBS = @GST_BASEVIDEO_LIBS@ -GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ -GST_BASE_LIBS = @GST_BASE_LIBS@ -GST_CFLAGS = @GST_CFLAGS@ -GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ -GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ -GST_GL_CFLAGS = @GST_GL_CFLAGS@ -GST_GL_LIBS = @GST_GL_LIBS@ -GST_INTERFACES_CFLAGS = @GST_INTERFACES_CFLAGS@ -GST_INTERFACES_LIBS = @GST_INTERFACES_LIBS@ -GST_LIBS = @GST_LIBS@ -GST_PKG_VERSION = @GST_PKG_VERSION@ -GST_PLUGINS_BAD_VERSION_REQUIRED = @GST_PLUGINS_BAD_VERSION_REQUIRED@ -GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ -GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ -GST_PLUGINS_BASE_VERSION_REQUIRED = @GST_PLUGINS_BASE_VERSION_REQUIRED@ -GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ -GST_PLUGIN_PATH_1_0 = @GST_PLUGIN_PATH_1_0@ -GST_VAAPI_LT_LDFLAGS = @GST_VAAPI_LT_LDFLAGS@ -GST_VAAPI_LT_VERSION = @GST_VAAPI_LT_VERSION@ -GST_VAAPI_MAJOR_VERSION = @GST_VAAPI_MAJOR_VERSION@ -GST_VERSION_REQUIRED = @GST_VERSION_REQUIRED@ -GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ -GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ -GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ -GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ -GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ -GTKDOC_MKPDF = @GTKDOC_MKPDF@ -GTKDOC_REBASE = @GTKDOC_REBASE@ -GTKDOC_VERSION = @GTKDOC_VERSION@ -HTML_DIR = @HTML_DIR@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBVA_CFLAGS = @LIBVA_CFLAGS@ -LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ -LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ -LIBVA_LIBS = @LIBVA_LIBS@ -LIBVA_PACKAGE_VERSION = @LIBVA_PACKAGE_VERSION@ -LIBVA_PKGNAME = @LIBVA_PKGNAME@ -LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ -LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ -LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ -LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ -LIBVA_X11_PKGNAME = @LIBVA_X11_PKGNAME@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATCH = @PATCH@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TODAY = @TODAY@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ -VERSION = @VERSION@ -WAYLAND_API_VERSION = @WAYLAND_API_VERSION@ -WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ -WAYLAND_LIBS = @WAYLAND_LIBS@ -X11_CFLAGS = @X11_CFLAGS@ -X11_LIBS = @X11_LIBS@ -XRANDR_CFLAGS = @XRANDR_CFLAGS@ -XRANDR_LIBS = @XRANDR_LIBS@ -XRENDER_CFLAGS = @XRENDER_CFLAGS@ -XRENDER_LIBS = @XRENDER_LIBS@ -YASM = @YASM@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ -plugindir = @plugindir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -SUBDIRS = libs plugins -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/reference/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu docs/reference/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(am__recursive_targets): - @fail=; \ - if $(am__make_keepgoing); then \ - failcom='fail=yes'; \ - else \ - failcom='exit 1'; \ - fi; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-recursive -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-recursive - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-recursive - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: - -.MAKE: $(am__recursive_targets) install-am install-strip - -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ - check-am clean clean-generic clean-libtool cscopelist-am ctags \ - ctags-am distclean distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-am uninstall uninstall-am - -.PRECIOUS: Makefile - - --include $(top_srcdir)/git.mk - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru gstreamer-vaapi-0.7.0/docs/reference/plugins/html/api-index-full.html gstreamer-vaapi-1.8.2/docs/reference/plugins/html/api-index-full.html --- gstreamer-vaapi-0.7.0/docs/reference/plugins/html/api-index-full.html 2015-12-07 11:01:26.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/plugins/html/api-index-full.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,145 +0,0 @@ - - - - -API Index: GStreamer VA-API Plugins 1.6 Plugins Reference Manual - - - - - - - - - - - - - - - -
-

-API Index

-

G

-
-GstVaapiDecode, struct in GstVaapiDecode -
-
-
-GstVaapiPostproc, struct in GstVaapiPostproc -
-
-
-GstVaapiPostproc:brightness, object property in GstVaapiPostproc -
-
-
-GstVaapiPostproc:contrast, object property in GstVaapiPostproc -
-
-
-GstVaapiPostproc:deinterlace-method, object property in GstVaapiPostproc -
-
-
-GstVaapiPostproc:deinterlace-mode, object property in GstVaapiPostproc -
-
-
-GstVaapiPostproc:denoise, object property in GstVaapiPostproc -
-
-
-GstVaapiPostproc:force-aspect-ratio, object property in GstVaapiPostproc -
-
-
-GstVaapiPostproc:format, object property in GstVaapiPostproc -
-
-
-GstVaapiPostproc:height, object property in GstVaapiPostproc -
-
-
-GstVaapiPostproc:hue, object property in GstVaapiPostproc -
-
-
-GstVaapiPostproc:saturation, object property in GstVaapiPostproc -
-
-
-GstVaapiPostproc:scale-method, object property in GstVaapiPostproc -
-
-
-GstVaapiPostproc:sharpen, object property in GstVaapiPostproc -
-
-
-GstVaapiPostproc:skin-tone-enhancement, object property in GstVaapiPostproc -
-
-
-GstVaapiPostproc:width, object property in GstVaapiPostproc -
-
-
-GstVaapiSink, struct in GstVaapiSink -
-
-
-GstVaapiSink::handoff, object signal in GstVaapiSink -
-
-
-GstVaapiSink:brightness, object property in GstVaapiSink -
-
-
-GstVaapiSink:contrast, object property in GstVaapiSink -
-
-
-GstVaapiSink:display, object property in GstVaapiSink -
-
-
-GstVaapiSink:display-name, object property in GstVaapiSink -
-
-
-GstVaapiSink:force-aspect-ratio, object property in GstVaapiSink -
-
-
-GstVaapiSink:fullscreen, object property in GstVaapiSink -
-
-
-GstVaapiSink:hue, object property in GstVaapiSink -
-
-
-GstVaapiSink:rotation, object property in GstVaapiSink -
-
-
-GstVaapiSink:saturation, object property in GstVaapiSink -
-
-
-GstVaapiSink:signal-handoffs, object property in GstVaapiSink -
-
-
-GstVaapiSink:view-id, object property in GstVaapiSink -
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/plugins/html/ch01.html gstreamer-vaapi-1.8.2/docs/reference/plugins/html/ch01.html --- gstreamer-vaapi-0.7.0/docs/reference/plugins/html/ch01.html 2015-12-07 11:01:26.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/plugins/html/ch01.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ - - - - -gst-plugins-vaapi Plugins: GStreamer VA-API Plugins 1.6 Plugins Reference Manual - - - - - - - - - - - - - - - - -
-

-gst-plugins-vaapi Plugins

-
-
-GstVaapiDecode — A VA-API based video decoder -
-
-GstVaapiPostproc — A video postprocessing filter -
-
-GstVaapiSink — A VA-API based videosink -
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/plugins/html/GstVaapiDecode.html gstreamer-vaapi-1.8.2/docs/reference/plugins/html/GstVaapiDecode.html --- gstreamer-vaapi-0.7.0/docs/reference/plugins/html/GstVaapiDecode.html 2015-12-07 11:01:26.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/plugins/html/GstVaapiDecode.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ - - - - -GstVaapiDecode: GStreamer VA-API Plugins 1.6 Plugins Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiDecode

-

GstVaapiDecode — A VA-API based video decoder

-
-
-

Types and Values

-
---- - - - - -
structGstVaapiDecode
-
-
-

Object Hierarchy

-
    GObject
-    ╰── GInitiallyUnowned
-        ╰── GstObject
-            ╰── GstElement
-                ╰── GstVideoDecoder
-                    ╰── GstVaapiDecode
-
-
-
-

Description

-

vaapidecode decodes from raw bitstreams to surfaces suitable for -the vaapisink element.

-
-
-

Functions

-

-
-
-

Types and Values

-
-

struct GstVaapiDecode

-
struct GstVaapiDecode;
-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/plugins/html/GstVaapiPostproc.html gstreamer-vaapi-1.8.2/docs/reference/plugins/html/GstVaapiPostproc.html --- gstreamer-vaapi-0.7.0/docs/reference/plugins/html/GstVaapiPostproc.html 2015-12-07 11:01:26.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/plugins/html/GstVaapiPostproc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,304 +0,0 @@ - - - - -GstVaapiPostproc: GStreamer VA-API Plugins 1.6 Plugins Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiPostproc

-

GstVaapiPostproc — A video postprocessing filter

-
-
-

Properties

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
gfloatbrightnessRead / Write
gfloatcontrastRead / Write
GstVaapiDeinterlaceMethoddeinterlace-methodRead / Write
GstVaapiDeinterlaceModedeinterlace-modeRead / Write
gfloatdenoiseRead / Write
gbooleanforce-aspect-ratioRead / Write
GstVideoFormatformatRead / Write
guintheightRead / Write
gfloathueRead / Write
gfloatsaturationRead / Write
GstVaapiScaleMethodscale-methodRead / Write
gfloatsharpenRead / Write
gbooleanskin-tone-enhancementRead / Write
guintwidthRead / Write
-
-
-

Types and Values

-
---- - - - - -
structGstVaapiPostproc
-
-
-

Object Hierarchy

-
    GObject
-    ╰── GInitiallyUnowned
-        ╰── GstObject
-            ╰── GstElement
-                ╰── GstBaseTransform
-                    ╰── GstVaapiPostproc
-
-
-
-

Implemented Interfaces

-

-GstVaapiPostproc implements - GstColorBalance.

-
-
-

Description

-

vaapipostproc consists in various postprocessing algorithms to be -applied to VA surfaces. So far, only basic bob deinterlacing is -implemented.

-
-
-

Functions

-

-
-
-

Types and Values

-
-

struct GstVaapiPostproc

-
struct GstVaapiPostproc;
-
-
-
-

Property Details

-
-

The “brightness” property

-
  “brightness”               gfloat
-

The color brightness, expressed as a float value. Range is -1.0 -to 1.0. Default value is 0.0 and represents no modification.

-

Flags: Read / Write

-

Allowed values: [-1,1]

-

Default value: 0

-
-
-
-

The “contrast” property

-
  “contrast”                 gfloat
-

The color contrast, expressed as a float value. Range is 0.0 to -2.0. Default value is 1.0 and represents no modification.

-

Flags: Read / Write

-

Allowed values: [0,2]

-

Default value: 1

-
-
-
-

The “deinterlace-method” property

-
  “deinterlace-method”       GstVaapiDeinterlaceMethod
-

This selects the deinterlacing method to apply.

-

Flags: Read / Write

-

Default value: Bob deinterlacing

-
-
-
-

The “deinterlace-mode” property

-
  “deinterlace-mode”         GstVaapiDeinterlaceMode
-

This selects whether the deinterlacing should always be applied -or if they should only be applied on content that has the -"interlaced" flag on the caps.

-

Flags: Read / Write

-

Default value: Auto detection

-
-
-
-

The “denoise” property

-
  “denoise”                  gfloat
-

The level of noise reduction to apply.

-

Flags: Read / Write

-

Allowed values: [0,1]

-

Default value: 0

-
-
-
-

The “force-aspect-ratio” property

-
  “force-aspect-ratio”       gboolean
-

When enabled, scaling respects video aspect ratio; when disabled, -the video is distorted to fit the width and height properties.

-

Flags: Read / Write

-

Default value: TRUE

-
-
-
-

The “format” property

-
  “format”                   GstVideoFormat
-

The forced output pixel format, expressed as a GstVideoFormat.

-

Flags: Read / Write

-

Default value: GST_VIDEO_FORMAT_UNKNOWN

-
-
-
-

The “height” property

-
  “height”                   guint
-

The forced output height in pixels. If set to zero, the height is -calculated from the width if aspect ration is preserved, or -inherited from the sink caps height

-

Flags: Read / Write

-

Allowed values: <= G_MAXINT

-

Default value: 0

-
-
-
-

The “hue” property

-
  “hue”                      gfloat
-

The color hue, expressed as a float value. Range is -180.0 to -180.0. Default value is 0.0 and represents no modification.

-

Flags: Read / Write

-

Allowed values: [-180,180]

-

Default value: 0

-
-
-
-

The “saturation” property

-
  “saturation”               gfloat
-

The color saturation, expressed as a float value. Range is 0.0 to -2.0. Default value is 1.0 and represents no modification.

-

Flags: Read / Write

-

Allowed values: [0,2]

-

Default value: 1

-
-
-
-

The “scale-method” property

-
  “scale-method”             GstVaapiScaleMethod
-

The scaling method to use, expressed as an enum value. See -GstVaapiScaleMethod.

-

Flags: Read / Write

-

Default value: Default scaling mode

-
-
-
-

The “sharpen” property

-
  “sharpen”                  gfloat
-

The level of sharpening to apply for positive values, or the -level of blurring for negative values.

-

Flags: Read / Write

-

Allowed values: [-1,1]

-

Default value: 0

-
-
-
-

The “skin-tone-enhancement” property

-
  “skin-tone-enhancement”    gboolean
-

Apply the skin tone enhancement algorithm.

-

Flags: Read / Write

-

Default value: FALSE

-
-
-
-

The “width” property

-
  “width”                    guint
-

The forced output width in pixels. If set to zero, the width is -calculated from the height if aspect ration is preserved, or -inherited from the sink caps width

-

Flags: Read / Write

-

Allowed values: <= G_MAXINT

-

Default value: 0

-
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/plugins/html/GstVaapiSink.html gstreamer-vaapi-1.8.2/docs/reference/plugins/html/GstVaapiSink.html --- gstreamer-vaapi-0.7.0/docs/reference/plugins/html/GstVaapiSink.html 2015-12-07 11:01:26.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/plugins/html/GstVaapiSink.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,314 +0,0 @@ - - - - -GstVaapiSink: GStreamer VA-API Plugins 1.6 Plugins Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

GstVaapiSink

-

GstVaapiSink — A VA-API based videosink

-
-
-

Properties

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
gfloatbrightnessRead / Write / Construct
gfloatcontrastRead / Write / Construct
GstVaapiDisplayTypedisplayRead / Write
-gchar *display-nameRead / Write
gbooleanforce-aspect-ratioRead / Write
gbooleanfullscreenRead / Write
gfloathueRead / Write / Construct
GstVaapiRotationrotationRead / Write
gfloatsaturationRead / Write / Construct
gbooleansignal-handoffsRead / Write
gintview-idRead / Write
-
-
-

Signals

-
----- - - - - - -
voidhandoffRun Last
-
-
-

Types and Values

-
---- - - - - -
structGstVaapiSink
-
-
-

Object Hierarchy

-
    GObject
-    ╰── GInitiallyUnowned
-        ╰── GstObject
-            ╰── GstElement
-                ╰── GstBaseSink
-                    ╰── GstVideoSink
-                        ╰── GstVaapiSink
-
-
-
-

Implemented Interfaces

-

-GstVaapiSink implements - GstVideoOverlay, GstColorBalance and GstNavigation.

-
-
-

Description

-

vaapisink renders video frames to a drawable (X Window) on a local -display using the Video Acceleration (VA) API. The element will -create its own internal window and render into it.

-
-
-

Functions

-

-
-
-

Types and Values

-
-

struct GstVaapiSink

-
struct GstVaapiSink;
-
-
-
-

Property Details

-
-

The “brightness” property

-
  “brightness”               gfloat
-

The VA display brightness, expressed as a float value. Range is --1.0 to 1.0. Default value is 0.0 and represents no modification.

-

Flags: Read / Write / Construct

-

Allowed values: [-1,1]

-

Default value: 0

-
-
-
-

The “contrast” property

-
  “contrast”                 gfloat
-

The VA display contrast, expressed as a float value. Range is 0.0 -to 2.0. Default value is 1.0 and represents no modification.

-

Flags: Read / Write / Construct

-

Allowed values: [0,2]

-

Default value: 1

-
-
-
-

The “display” property

-
  “display”                  GstVaapiDisplayType
-

The type of display to use.

-

Flags: Read / Write

-

Default value: Auto detection

-
-
-
-

The “display-name” property

-
  “display-name”             gchar *
-

The native display name.

-

Flags: Read / Write

-

Default value: NULL

-
-
-
-

The “force-aspect-ratio” property

-
  “force-aspect-ratio”       gboolean
-

When enabled, scaling respects video aspect ratio; when disabled, -the video is distorted to fit the window.

-

Flags: Read / Write

-

Default value: TRUE

-
-
-
-

The “fullscreen” property

-
  “fullscreen”               gboolean
-

Selects whether fullscreen mode is enabled or not.

-

Flags: Read / Write

-

Default value: FALSE

-
-
-
-

The “hue” property

-
  “hue”                      gfloat
-

The VA display hue, expressed as a float value. Range is -180.0 -to 180.0. Default value is 0.0 and represents no modification.

-

Flags: Read / Write / Construct

-

Allowed values: [-180,180]

-

Default value: 0

-
-
-
-

The “rotation” property

-
  “rotation”                 GstVaapiRotation
-

The VA display rotation mode, expressed as a GstVaapiRotation.

-

Flags: Read / Write

-

Default value: Unrotated mode

-
-
-
-

The “saturation” property

-
  “saturation”               gfloat
-

The VA display saturation, expressed as a float value. Range is -0.0 to 2.0. Default value is 1.0 and represents no modification.

-

Flags: Read / Write / Construct

-

Allowed values: [0,2]

-

Default value: 1

-
-
-
-

The “signal-handoffs” property

-
  “signal-handoffs”          gboolean
-

Send a signal after rendering the buffer.

-

Flags: Read / Write

-

Default value: FALSE

-
-
-
-

The “view-id” property

-
  “view-id”                  gint
-

When not set to -1, the displayed frame will always be the one -that matches the view-id of the very first displayed frame. Any -other number will indicate the desire to display the supplied -view-id only.

-

Flags: Read / Write

-

Allowed values: >= -1

-

Default value: -1

-
-
-
-

Signal Details

-
-

The “handoff” signal

-
void
-user_function (GstVaapiSink *object,
-               GstBuffer    *buffer,
-               gpointer      user_data)
-

This signal gets emitted after rendering the frame.

-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

object

the GstVaapiSink instance

 

buffer

the buffer that was rendered

 

user_data

user data set when the signal handler was connected.

 
-
-

Flags: Run Last

-
-
-
- - - \ No newline at end of file Binary files /tmp/tmpUUqCms/Qg4lAwNSh6/gstreamer-vaapi-0.7.0/docs/reference/plugins/html/home.png and /tmp/tmpUUqCms/c79LJCUvkE/gstreamer-vaapi-1.8.2/docs/reference/plugins/html/home.png differ diff -Nru gstreamer-vaapi-0.7.0/docs/reference/plugins/html/index.html gstreamer-vaapi-1.8.2/docs/reference/plugins/html/index.html --- gstreamer-vaapi-0.7.0/docs/reference/plugins/html/index.html 2015-12-07 11:01:26.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/plugins/html/index.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ - - - - -GStreamer VA-API Plugins 1.6 Plugins Reference Manual: GStreamer VA-API Plugins 1.6 Plugins Reference Manual - - - - - - - -
-
-
-
-
-
-
gst-plugins-vaapi Plugins
-
-
-GstVaapiDecode — A VA-API based video decoder -
-
-GstVaapiPostproc — A video postprocessing filter -
-
-GstVaapiSink — A VA-API based videosink -
-
-
Object Hierarchy
-
API Index
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/plugins/html/index.sgml gstreamer-vaapi-1.8.2/docs/reference/plugins/html/index.sgml --- gstreamer-vaapi-0.7.0/docs/reference/plugins/html/index.sgml 2015-12-07 11:01:26.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/plugins/html/index.sgml 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Binary files /tmp/tmpUUqCms/Qg4lAwNSh6/gstreamer-vaapi-0.7.0/docs/reference/plugins/html/left-insensitive.png and /tmp/tmpUUqCms/c79LJCUvkE/gstreamer-vaapi-1.8.2/docs/reference/plugins/html/left-insensitive.png differ Binary files /tmp/tmpUUqCms/Qg4lAwNSh6/gstreamer-vaapi-0.7.0/docs/reference/plugins/html/left.png and /tmp/tmpUUqCms/c79LJCUvkE/gstreamer-vaapi-1.8.2/docs/reference/plugins/html/left.png differ diff -Nru gstreamer-vaapi-0.7.0/docs/reference/plugins/html/object-tree.html gstreamer-vaapi-1.8.2/docs/reference/plugins/html/object-tree.html --- gstreamer-vaapi-0.7.0/docs/reference/plugins/html/object-tree.html 2015-12-07 11:01:26.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/plugins/html/object-tree.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ - - - - -Object Hierarchy: GStreamer VA-API Plugins 1.6 Plugins Reference Manual - - - - - - - - - - - - - - - - -
-

-Object Hierarchy

-
-    GObject
-    ╰── GInitiallyUnowned
-        ╰── GstObject
-            ╰── GstElement
-                ├── GstVideoDecoder
-                   ╰── GstVaapiDecode
-                ├── GstBaseTransform
-                   ╰── GstVaapiPostproc
-                ╰── GstBaseSink
-                    ╰── GstVideoSink
-                        ╰── GstVaapiSink
-
-
- - - \ No newline at end of file diff -Nru gstreamer-vaapi-0.7.0/docs/reference/plugins/html/plugins.devhelp2 gstreamer-vaapi-1.8.2/docs/reference/plugins/html/plugins.devhelp2 --- gstreamer-vaapi-0.7.0/docs/reference/plugins/html/plugins.devhelp2 2015-12-07 11:01:26.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/plugins/html/plugins.devhelp2 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Binary files /tmp/tmpUUqCms/Qg4lAwNSh6/gstreamer-vaapi-0.7.0/docs/reference/plugins/html/right-insensitive.png and /tmp/tmpUUqCms/c79LJCUvkE/gstreamer-vaapi-1.8.2/docs/reference/plugins/html/right-insensitive.png differ Binary files /tmp/tmpUUqCms/Qg4lAwNSh6/gstreamer-vaapi-0.7.0/docs/reference/plugins/html/right.png and /tmp/tmpUUqCms/c79LJCUvkE/gstreamer-vaapi-1.8.2/docs/reference/plugins/html/right.png differ diff -Nru gstreamer-vaapi-0.7.0/docs/reference/plugins/html/style.css gstreamer-vaapi-1.8.2/docs/reference/plugins/html/style.css --- gstreamer-vaapi-0.7.0/docs/reference/plugins/html/style.css 2015-12-07 11:01:26.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/plugins/html/style.css 1970-01-01 00:00:00.000000000 +0000 @@ -1,479 +0,0 @@ -body -{ - font-family: cantarell, sans-serif; -} -.synopsis, .classsynopsis -{ - /* tango:aluminium 1/2 */ - background: #eeeeec; - background: rgba(238, 238, 236, 0.5); - border: solid 1px rgb(238, 238, 236); - padding: 0.5em; -} -.programlisting -{ - /* tango:sky blue 0/1 */ - /* fallback for no rgba support */ - background: #e6f3ff; - border: solid 1px #729fcf; - background: rgba(114, 159, 207, 0.1); - border: solid 1px rgba(114, 159, 207, 0.2); - padding: 0.5em; -} -.variablelist -{ - padding: 4px; - margin-left: 3em; -} -.variablelist td:first-child -{ - vertical-align: top; -} - -div.gallery-float -{ - float: left; - padding: 10px; -} -div.gallery-float img -{ - border-style: none; -} -div.gallery-spacer -{ - clear: both; -} - -a, a:visited -{ - text-decoration: none; - /* tango:sky blue 2 */ - color: #3465a4; -} -a:hover -{ - text-decoration: underline; - /* tango:sky blue 1 */ - color: #729fcf; -} - -div.informaltable table -{ - border-collapse: separate; - border-spacing: 1em 0.3em; - border: none; -} - -div.informaltable table td, div.informaltable table th -{ - vertical-align: top; -} - -.function_type, -.variable_type, -.property_type, -.signal_type, -.parameter_name, -.struct_member_name, -.union_member_name, -.define_keyword, -.datatype_keyword, -.typedef_keyword -{ - text-align: right; -} - -/* dim non-primary columns */ -.c_punctuation, -.function_type, -.variable_type, -.property_type, -.signal_type, -.define_keyword, -.datatype_keyword, -.typedef_keyword, -.property_flags, -.signal_flags, -.parameter_annotations, -.enum_member_annotations, -.struct_member_annotations, -.union_member_annotations -{ - color: #888a85; -} - -.function_type a, -.function_type a:visited, -.function_type a:hover, -.property_type a, -.property_type a:visited, -.property_type a:hover, -.signal_type a, -.signal_type a:visited, -.signal_type a:hover, -.signal_flags a, -.signal_flags a:visited, -.signal_flags a:hover -{ - color: #729fcf; -} - -td p -{ - margin: 0.25em; -} - -div.table table -{ - border-collapse: collapse; - border-spacing: 0px; - /* tango:aluminium 3 */ - border: solid 1px #babdb6; -} - -div.table table td, div.table table th -{ - /* tango:aluminium 3 */ - border: solid 1px #babdb6; - padding: 3px; - vertical-align: top; -} - -div.table table th -{ - /* tango:aluminium 2 */ - background-color: #d3d7cf; -} - -h4 -{ - color: #555753; - margin-top: 1em; - margin-bottom: 1em; -} - -hr -{ - /* tango:aluminium 1 */ - color: #d3d7cf; - background: #d3d7cf; - border: none 0px; - height: 1px; - clear: both; - margin: 2.0em 0em 2.0em 0em; -} - -dl.toc dt -{ - padding-bottom: 0.25em; -} - -dl.toc > dt -{ - padding-top: 0.25em; - padding-bottom: 0.25em; - font-weight: bold; -} - -dl.toc > dl -{ - padding-bottom: 0.5em; -} - -.parameter -{ - font-style: normal; -} - -.footer -{ - padding-top: 3.5em; - /* tango:aluminium 3 */ - color: #babdb6; - text-align: center; - font-size: 80%; -} - -.informalfigure, -.figure -{ - margin: 1em; -} - -.informalexample, -.example -{ - margin-top: 1em; - margin-bottom: 1em; -} - -.warning -{ - /* tango:orange 0/1 */ - background: #ffeed9; - background: rgba(252, 175, 62, 0.1); - border-color: #ffb04f; - border-color: rgba(252, 175, 62, 0.2); -} -.note -{ - /* tango:chameleon 0/0.5 */ - background: #d8ffb2; - background: rgba(138, 226, 52, 0.1); - border-color: #abf562; - border-color: rgba(138, 226, 52, 0.2); -} -div.blockquote -{ - border-color: #eeeeec; -} -.note, .warning, div.blockquote -{ - padding: 0.5em; - border-width: 1px; - border-style: solid; - margin: 2em; -} -.note p, .warning p -{ - margin: 0; -} - -div.warning h3.title, -div.note h3.title -{ - display: none; -} - -p + div.section -{ - margin-top: 1em; -} - -div.refnamediv, -div.refsynopsisdiv, -div.refsect1, -div.refsect2, -div.toc, -div.section -{ - margin-bottom: 1em; -} - -/* blob links */ -h2 .extralinks, h3 .extralinks -{ - float: right; - /* tango:aluminium 3 */ - color: #babdb6; - font-size: 80%; - font-weight: normal; -} - -.lineart -{ - color: #d3d7cf; - font-weight: normal; -} - -.annotation -{ - /* tango:aluminium 5 */ - color: #555753; - font-weight: normal; -} - -.structfield -{ - font-style: normal; - font-weight: normal; -} - -acronym,abbr -{ - border-bottom: 1px dotted gray; -} - -/* code listings */ - -.listing_code .programlisting .normal, -.listing_code .programlisting .normal a, -.listing_code .programlisting .number, -.listing_code .programlisting .cbracket, -.listing_code .programlisting .symbol { color: #555753; } -.listing_code .programlisting .comment, -.listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ -.listing_code .programlisting .function, -.listing_code .programlisting .function a, -.listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ -.listing_code .programlisting .string { color: #ad7fa8; } /* tango: plum */ -.listing_code .programlisting .keyword, -.listing_code .programlisting .usertype, -.listing_code .programlisting .type, -.listing_code .programlisting .type a { color: #4e9a06; } /* tango: chameleon 3 */ - -.listing_frame { - /* tango:sky blue 1 */ - border: solid 1px #729fcf; - border: solid 1px rgba(114, 159, 207, 0.2); - padding: 0px; -} - -.listing_lines, .listing_code { - margin-top: 0px; - margin-bottom: 0px; - padding: 0.5em; -} -.listing_lines { - /* tango:sky blue 0.5 */ - background: #a6c5e3; - background: rgba(114, 159, 207, 0.2); - /* tango:aluminium 6 */ - color: #2e3436; -} -.listing_code { - /* tango:sky blue 0 */ - background: #e6f3ff; - background: rgba(114, 159, 207, 0.1); -} -.listing_code .programlisting { - /* override from previous */ - border: none 0px; - padding: 0px; - background: none; -} -.listing_lines pre, .listing_code pre { - margin: 0px; -} - -@media screen { - /* these have a as a first child, but since there are no parent selectors - * we can't use that. */ - a.footnote - { - position: relative; - top: 0em ! important; - } - /* this is needed so that the local anchors are displayed below the naviagtion */ - div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] - { - display: inline-block; - position: relative; - top:-5em; - } - /* this seems to be a bug in the xsl style sheets when generating indexes */ - div.index div.index - { - top: 0em; - } - /* make space for the fixed navigation bar and add space at the bottom so that - * link targets appear somewhat close to top - */ - body - { - padding-top: 2.5em; - padding-bottom: 500px; - max-width: 60em; - } - p - { - max-width: 60em; - } - /* style and size the navigation bar */ - table.navigation#top - { - position: fixed; - background: #e2e2e2; - border-bottom: solid 1px #babdb6; - border-spacing: 5px; - margin-top: 0; - margin-bottom: 0; - top: 0; - left: 0; - z-index: 10; - } - table.navigation#top td - { - padding-left: 6px; - padding-right: 6px; - } - .navigation a, .navigation a:visited - { - /* tango:sky blue 3 */ - color: #204a87; - } - .navigation a:hover - { - /* tango:sky blue 2 */ - color: #3465a4; - } - td.shortcuts - { - /* tango:sky blue 2 */ - color: #3465a4; - font-size: 80%; - white-space: nowrap; - } - td.shortcuts .dim - { - color: #babdb6; - } - .navigation .title - { - font-size: 80%; - max-width: none; - margin: 0px; - font-weight: normal; - } -} -@media screen and (min-width: 60em) { - /* screen larger than 60em */ - body { margin: auto; } -} -@media screen and (max-width: 60em) { - /* screen less than 60em */ - #nav_hierarchy { display: none; } - #nav_interfaces { display: none; } - #nav_prerequisites { display: none; } - #nav_derived_interfaces { display: none; } - #nav_implementations { display: none; } - #nav_child_properties { display: none; } - #nav_style_properties { display: none; } - #nav_index { display: none; } - #nav_glossary { display: none; } - .gallery_image { display: none; } - .property_flags { display: none; } - .signal_flags { display: none; } - .parameter_annotations { display: none; } - .enum_member_annotations { display: none; } - .struct_member_annotations { display: none; } - .union_member_annotations { display: none; } - /* now that a column is hidden, optimize space */ - col.parameters_name { width: auto; } - col.parameters_description { width: auto; } - col.struct_members_name { width: auto; } - col.struct_members_description { width: auto; } - col.enum_members_name { width: auto; } - col.enum_members_description { width: auto; } - col.union_members_name { width: auto; } - col.union_members_description { width: auto; } - .listing_lines { display: none; } -} -@media print { - table.navigation { - visibility: collapse; - display: none; - } - div.titlepage table.navigation { - visibility: visible; - display: table; - background: #e2e2e2; - border: solid 1px #babdb6; - margin-top: 0; - margin-bottom: 0; - top: 0; - left: 0; - height: 3em; - } -} - Binary files /tmp/tmpUUqCms/Qg4lAwNSh6/gstreamer-vaapi-0.7.0/docs/reference/plugins/html/up-insensitive.png and /tmp/tmpUUqCms/c79LJCUvkE/gstreamer-vaapi-1.8.2/docs/reference/plugins/html/up-insensitive.png differ Binary files /tmp/tmpUUqCms/Qg4lAwNSh6/gstreamer-vaapi-0.7.0/docs/reference/plugins/html/up.png and /tmp/tmpUUqCms/c79LJCUvkE/gstreamer-vaapi-1.8.2/docs/reference/plugins/html/up.png differ diff -Nru gstreamer-vaapi-0.7.0/docs/reference/plugins/Makefile.am gstreamer-vaapi-1.8.2/docs/reference/plugins/Makefile.am --- gstreamer-vaapi-0.7.0/docs/reference/plugins/Makefile.am 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/plugins/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,116 +0,0 @@ -## Process this file with automake to produce Makefile.in - -# We require automake 1.6 at least. -AUTOMAKE_OPTIONS = 1.6 - -# This is a blank Makefile.am for using gtk-doc. -# Copy this to your project's API docs directory and modify the variables to -# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples -# of using the various options. - -# The name of the module, e.g. 'glib'. -DOC_MODULE = plugins - -# The top-level SGML file. You can change this if you want to. -DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.xml - -# The directory containing the source code. Relative to $(srcdir). -# gtk-doc will search all .c & .h files beneath here for inline comments -# documenting the functions and macros. -# e.g. DOC_SOURCE_DIR=../../../gtk -DOC_SOURCE_DIR = $(top_srcdir)/gst - -# Extra options to pass to gtkdoc-scangobj. Not normally needed. -SCANGOBJ_OPTIONS = --type-init-func="gst_init(NULL, NULL)" - -# Extra options to supply to gtkdoc-scan. -# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" -SCAN_OPTIONS = --deprecated-guards="GST_VAAPI_DISABLE_DEPRECATED" - -# Extra options to supply to gtkdoc-mkdb. -# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml -MKDB_OPTIONS = --sgml-mode --output-format=xml --name-space=$(DOC_MODULE) - -# Extra options to supply to gtkdoc-mktmpl -# e.g. MKTMPL_OPTIONS=--only-section-tmpl -MKTMPL_OPTIONS = - -# Extra options to supply to gtkdoc-fixref. Not normally needed. -# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html -FIXXREF_OPTIONS = \ - --extra-dir=$(GLIB_PREFIX)/share/gtk-doc/html/glib \ - --extra-dir=$(GLIB_PREFIX)/share/gtk-doc/html/gobject \ - --extra-dir=$(CAIRO_PREFIX)/share/gtk-doc/html/cairo \ - --extra-dir=$(PANGO_PREFIX)/share/gtk-doc/html/pango - -# Used for dependencies. The docs will be rebuilt if any of these change. -# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h -# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c -HFILE_GLOB = $(top_srcdir)/gst/*/*.h -CFILE_GLOB = $(top_srcdir)/gst/*/*.c - -# Header files to ignore when scanning. -# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h -IGNORE_HFILES = \ - $(NULL) - -EXTRA_HFILES = \ - $(NULL) - -# Images to copy into HTML directory. -# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png -HTML_IMAGES = \ - $(NULL) - -# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). -# e.g. content_files=running.sgml building.sgml changes-2.0.sgml -content_files = \ - $(NULL) - -# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded -# These files must be listed here *and* in content_files -# e.g. expand_content_files=running.sgml -expand_content_files = \ - $(NULL) - -# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. -# Only needed if you are using gtkdoc-scangobj to dynamically query widget -# signals and properties. -# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) -# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) - -INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_srcdir)/gst-libs \ - -I$(top_srcdir)/gst-libs/gst/vaapi \ - $(GLIB_CFLAGS) \ - $(GST_CFLAGS) \ - $(NULL) - -gtkdoc_vaapi_libs = \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-$(GST_API_VERSION).la \ - $(NULL) - -if USE_X11 -gtkdoc_vaapi_libs += \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11-$(GST_API_VERSION).la \ - $(NULL) -endif - -GTKDOC_LIBS = \ - $(gtkdoc_vaapi_libs) \ - $(top_builddir)/gst/vaapi/libgstvaapi.la \ - $(GLIB_LIBS) \ - $(GST_LIBS) \ - $(NULL) - -# This includes the standard gtk-doc make rules, copied by gtkdocize. -include $(top_srcdir)/gtk-doc.make - -# Other files to distribute -# e.g. EXTRA_DIST += version.xml.in -EXTRA_DIST += \ - $(DOC_MODULE)-docs.xml.in \ - $(NULL) - --include $(top_srcdir)/git.mk diff -Nru gstreamer-vaapi-0.7.0/docs/reference/plugins/Makefile.in gstreamer-vaapi-1.8.2/docs/reference/plugins/Makefile.in --- gstreamer-vaapi-0.7.0/docs/reference/plugins/Makefile.in 2015-12-07 10:54:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/plugins/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,913 +0,0 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2014 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# -*- mode: makefile -*- - -#################################### -# Everything below here is generic # -#################################### -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -@USE_X11_TRUE@am__append_1 = \ -@USE_X11_TRUE@ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11-$(GST_API_VERSION).la \ -@USE_X11_TRUE@ $(NULL) - -subdir = docs/reference/plugins -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = plugins-docs.xml -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/plugins-docs.xml.in \ - $(top_srcdir)/gtk-doc.make -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DLOPEN_LIBS = @DLOPEN_LIBS@ -DRM_CFLAGS = @DRM_CFLAGS@ -DRM_LIBS = @DRM_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGL_CFLAGS = @EGL_CFLAGS@ -EGL_LIBS = @EGL_LIBS@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GIT = @GIT@ -GLES2_CFLAGS = @GLES2_CFLAGS@ -GLES2_LIBS = @GLES2_LIBS@ -GLES3_CFLAGS = @GLES3_CFLAGS@ -GLES3_LIBS = @GLES3_LIBS@ -GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_LIBS = @GLIB_LIBS@ -GLIB_VERSION_REQUIRED = @GLIB_VERSION_REQUIRED@ -GL_CFLAGS = @GL_CFLAGS@ -GL_LIBS = @GL_LIBS@ -GMODULE_CFLAGS = @GMODULE_CFLAGS@ -GMODULE_LIBS = @GMODULE_LIBS@ -GMODULE_VERSION_REQUIRED = @GMODULE_VERSION_REQUIRED@ -GREP = @GREP@ -GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ -GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ -GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ -GST_API_VERSION = @GST_API_VERSION@ -GST_BASEVIDEO_CFLAGS = @GST_BASEVIDEO_CFLAGS@ -GST_BASEVIDEO_LIBS = @GST_BASEVIDEO_LIBS@ -GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ -GST_BASE_LIBS = @GST_BASE_LIBS@ -GST_CFLAGS = @GST_CFLAGS@ -GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ -GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ -GST_GL_CFLAGS = @GST_GL_CFLAGS@ -GST_GL_LIBS = @GST_GL_LIBS@ -GST_INTERFACES_CFLAGS = @GST_INTERFACES_CFLAGS@ -GST_INTERFACES_LIBS = @GST_INTERFACES_LIBS@ -GST_LIBS = @GST_LIBS@ -GST_PKG_VERSION = @GST_PKG_VERSION@ -GST_PLUGINS_BAD_VERSION_REQUIRED = @GST_PLUGINS_BAD_VERSION_REQUIRED@ -GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ -GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ -GST_PLUGINS_BASE_VERSION_REQUIRED = @GST_PLUGINS_BASE_VERSION_REQUIRED@ -GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ -GST_PLUGIN_PATH_1_0 = @GST_PLUGIN_PATH_1_0@ -GST_VAAPI_LT_LDFLAGS = @GST_VAAPI_LT_LDFLAGS@ -GST_VAAPI_LT_VERSION = @GST_VAAPI_LT_VERSION@ -GST_VAAPI_MAJOR_VERSION = @GST_VAAPI_MAJOR_VERSION@ -GST_VERSION_REQUIRED = @GST_VERSION_REQUIRED@ -GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ -GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ -GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ -GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ -GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ -GTKDOC_MKPDF = @GTKDOC_MKPDF@ -GTKDOC_REBASE = @GTKDOC_REBASE@ -GTKDOC_VERSION = @GTKDOC_VERSION@ -HTML_DIR = @HTML_DIR@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBVA_CFLAGS = @LIBVA_CFLAGS@ -LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ -LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ -LIBVA_LIBS = @LIBVA_LIBS@ -LIBVA_PACKAGE_VERSION = @LIBVA_PACKAGE_VERSION@ -LIBVA_PKGNAME = @LIBVA_PKGNAME@ -LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ -LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ -LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ -LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ -LIBVA_X11_PKGNAME = @LIBVA_X11_PKGNAME@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATCH = @PATCH@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TODAY = @TODAY@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ -VERSION = @VERSION@ -WAYLAND_API_VERSION = @WAYLAND_API_VERSION@ -WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ -WAYLAND_LIBS = @WAYLAND_LIBS@ -X11_CFLAGS = @X11_CFLAGS@ -X11_LIBS = @X11_LIBS@ -XRANDR_CFLAGS = @XRANDR_CFLAGS@ -XRANDR_LIBS = @XRANDR_LIBS@ -XRENDER_CFLAGS = @XRENDER_CFLAGS@ -XRENDER_LIBS = @XRENDER_LIBS@ -YASM = @YASM@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ -plugindir = @plugindir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ - -# We require automake 1.6 at least. -AUTOMAKE_OPTIONS = 1.6 - -# This is a blank Makefile.am for using gtk-doc. -# Copy this to your project's API docs directory and modify the variables to -# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples -# of using the various options. - -# The name of the module, e.g. 'glib'. -DOC_MODULE = plugins - -# The top-level SGML file. You can change this if you want to. -DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.xml - -# The directory containing the source code. Relative to $(srcdir). -# gtk-doc will search all .c & .h files beneath here for inline comments -# documenting the functions and macros. -# e.g. DOC_SOURCE_DIR=../../../gtk -DOC_SOURCE_DIR = $(top_srcdir)/gst - -# Extra options to pass to gtkdoc-scangobj. Not normally needed. -SCANGOBJ_OPTIONS = --type-init-func="gst_init(NULL, NULL)" - -# Extra options to supply to gtkdoc-scan. -# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" -SCAN_OPTIONS = --deprecated-guards="GST_VAAPI_DISABLE_DEPRECATED" - -# Extra options to supply to gtkdoc-mkdb. -# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml -MKDB_OPTIONS = --sgml-mode --output-format=xml --name-space=$(DOC_MODULE) - -# Extra options to supply to gtkdoc-mktmpl -# e.g. MKTMPL_OPTIONS=--only-section-tmpl -MKTMPL_OPTIONS = - -# Extra options to supply to gtkdoc-fixref. Not normally needed. -# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html -FIXXREF_OPTIONS = \ - --extra-dir=$(GLIB_PREFIX)/share/gtk-doc/html/glib \ - --extra-dir=$(GLIB_PREFIX)/share/gtk-doc/html/gobject \ - --extra-dir=$(CAIRO_PREFIX)/share/gtk-doc/html/cairo \ - --extra-dir=$(PANGO_PREFIX)/share/gtk-doc/html/pango - - -# Used for dependencies. The docs will be rebuilt if any of these change. -# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h -# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c -HFILE_GLOB = $(top_srcdir)/gst/*/*.h -CFILE_GLOB = $(top_srcdir)/gst/*/*.c - -# Header files to ignore when scanning. -# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h -IGNORE_HFILES = \ - $(NULL) - -EXTRA_HFILES = \ - $(NULL) - - -# Images to copy into HTML directory. -# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png -HTML_IMAGES = \ - $(NULL) - - -# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). -# e.g. content_files=running.sgml building.sgml changes-2.0.sgml -content_files = \ - $(NULL) - - -# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded -# These files must be listed here *and* in content_files -# e.g. expand_content_files=running.sgml -expand_content_files = \ - $(NULL) - - -# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. -# Only needed if you are using gtkdoc-scangobj to dynamically query widget -# signals and properties. -# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) -# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) -INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_srcdir)/gst-libs \ - -I$(top_srcdir)/gst-libs/gst/vaapi \ - $(GLIB_CFLAGS) \ - $(GST_CFLAGS) \ - $(NULL) - -gtkdoc_vaapi_libs = $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-$(GST_API_VERSION).la \ - $(NULL) $(am__append_1) -GTKDOC_LIBS = \ - $(gtkdoc_vaapi_libs) \ - $(top_builddir)/gst/vaapi/libgstvaapi.la \ - $(GLIB_LIBS) \ - $(GST_LIBS) \ - $(NULL) - -@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = -@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute - -# We set GPATH here; this gives us semantics for GNU make -# which are more like other make's VPATH, when it comes to -# whether a source that is a target of one rule is then -# searched for in VPATH/GPATH. -# -GPATH = $(srcdir) -TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) -SETUP_FILES = \ - $(content_files) \ - $(expand_content_files) \ - $(DOC_MAIN_SGML_FILE) \ - $(DOC_MODULE)-sections.txt \ - $(DOC_MODULE)-overrides.txt - - -# This includes the standard gtk-doc make rules, copied by gtkdocize. - -# Other files to distribute -# e.g. EXTRA_DIST += version.xml.in -EXTRA_DIST = $(HTML_IMAGES) $(SETUP_FILES) $(DOC_MODULE)-docs.xml.in \ - $(NULL) -DOC_STAMPS = setup-build.stamp scan-build.stamp sgml-build.stamp \ - html-build.stamp pdf-build.stamp \ - sgml.stamp html.stamp pdf.stamp - -SCANOBJ_FILES = \ - $(DOC_MODULE).args \ - $(DOC_MODULE).hierarchy \ - $(DOC_MODULE).interfaces \ - $(DOC_MODULE).prerequisites \ - $(DOC_MODULE).signals - -REPORT_FILES = \ - $(DOC_MODULE)-undocumented.txt \ - $(DOC_MODULE)-undeclared.txt \ - $(DOC_MODULE)-unused.txt - -CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test -@GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = -@GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp -@GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = -@GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp - -#### setup #### -GTK_DOC_V_SETUP = $(GTK_DOC_V_SETUP_$(V)) -GTK_DOC_V_SETUP_ = $(GTK_DOC_V_SETUP_$(AM_DEFAULT_VERBOSITY)) -GTK_DOC_V_SETUP_0 = @echo " DOC Preparing build"; - -#### scan #### -GTK_DOC_V_SCAN = $(GTK_DOC_V_SCAN_$(V)) -GTK_DOC_V_SCAN_ = $(GTK_DOC_V_SCAN_$(AM_DEFAULT_VERBOSITY)) -GTK_DOC_V_SCAN_0 = @echo " DOC Scanning header files"; -GTK_DOC_V_INTROSPECT = $(GTK_DOC_V_INTROSPECT_$(V)) -GTK_DOC_V_INTROSPECT_ = $(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY)) -GTK_DOC_V_INTROSPECT_0 = @echo " DOC Introspecting gobjects"; - -#### xml #### -GTK_DOC_V_XML = $(GTK_DOC_V_XML_$(V)) -GTK_DOC_V_XML_ = $(GTK_DOC_V_XML_$(AM_DEFAULT_VERBOSITY)) -GTK_DOC_V_XML_0 = @echo " DOC Building XML"; - -#### html #### -GTK_DOC_V_HTML = $(GTK_DOC_V_HTML_$(V)) -GTK_DOC_V_HTML_ = $(GTK_DOC_V_HTML_$(AM_DEFAULT_VERBOSITY)) -GTK_DOC_V_HTML_0 = @echo " DOC Building HTML"; -GTK_DOC_V_XREF = $(GTK_DOC_V_XREF_$(V)) -GTK_DOC_V_XREF_ = $(GTK_DOC_V_XREF_$(AM_DEFAULT_VERBOSITY)) -GTK_DOC_V_XREF_0 = @echo " DOC Fixing cross-references"; - -#### pdf #### -GTK_DOC_V_PDF = $(GTK_DOC_V_PDF_$(V)) -GTK_DOC_V_PDF_ = $(GTK_DOC_V_PDF_$(AM_DEFAULT_VERBOSITY)) -GTK_DOC_V_PDF_0 = @echo " DOC Building PDF"; -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/gtk-doc.make $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/reference/plugins/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu docs/reference/plugins/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; -$(top_srcdir)/gtk-doc.make $(am__empty): - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -plugins-docs.xml: $(top_builddir)/config.status $(srcdir)/plugins-docs.xml.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -tags TAGS: - -ctags CTAGS: - -cscope cscopelist: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" distdir="$(distdir)" \ - dist-hook -check-am: all-am -check: check-am -@ENABLE_GTK_DOC_FALSE@all-local: -all-am: Makefile all-local -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-local mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-local - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-data-local - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic \ - maintainer-clean-local - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-local - -.MAKE: install-am install-strip - -.PHONY: all all-am all-local check check-am clean clean-generic \ - clean-libtool clean-local cscopelist-am ctags-am dist-hook \ - distclean distclean-generic distclean-libtool distclean-local \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-data install-data-am install-data-local \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - maintainer-clean-local mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ - uninstall-am uninstall-local - -.PRECIOUS: Makefile - - -gtkdoc-check.test: Makefile - $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ - echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ - chmod +x $@ - -all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) -.PHONY: all-gtk-doc - -@ENABLE_GTK_DOC_TRUE@all-local: all-gtk-doc - -docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) - -$(REPORT_FILES): sgml-build.stamp - -setup-build.stamp: - -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ - files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ - if test "x$$files" != "x" ; then \ - for file in $$files ; do \ - destdir=`dirname $(abs_builddir)/$$file`; \ - test -d "$$destdir" || mkdir -p "$$destdir"; \ - test -f $(abs_srcdir)/$$file && \ - cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ - done; \ - fi; \ - fi - $(AM_V_at)touch setup-build.stamp - -scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) - $(GTK_DOC_V_SCAN)_source_dir='' ; \ - for i in $(DOC_SOURCE_DIR) ; do \ - _source_dir="$${_source_dir} --source-dir=$$i" ; \ - done ; \ - gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) - $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ - scanobj_options=""; \ - gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ - if test "$$?" = "0"; then \ - if test "x$(V)" = "x1"; then \ - scanobj_options="--verbose"; \ - fi; \ - fi; \ - CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ - gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ - else \ - for i in $(SCANOBJ_FILES) ; do \ - test -f $$i || touch $$i ; \ - done \ - fi - $(AM_V_at)touch scan-build.stamp - -$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp - @true - -sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) - $(GTK_DOC_V_XML)_source_dir='' ; \ - for i in $(DOC_SOURCE_DIR) ; do \ - _source_dir="$${_source_dir} --source-dir=$$i" ; \ - done ; \ - gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) - $(AM_V_at)touch sgml-build.stamp - -sgml.stamp: sgml-build.stamp - @true - -html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) - $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ - mkhtml_options=""; \ - gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ - if test "$$?" = "0"; then \ - if test "x$(V)" = "x1"; then \ - mkhtml_options="$$mkhtml_options --verbose"; \ - fi; \ - fi; \ - gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ - if test "$$?" = "0"; then \ - mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ - fi; \ - cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) - -@test "x$(HTML_IMAGES)" = "x" || \ - for file in $(HTML_IMAGES) ; do \ - if test -f $(abs_srcdir)/$$file ; then \ - cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ - fi; \ - if test -f $(abs_builddir)/$$file ; then \ - cp $(abs_builddir)/$$file $(abs_builddir)/html; \ - fi; \ - done; - $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) - $(AM_V_at)touch html-build.stamp - -pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) - $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ - mkpdf_options=""; \ - gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ - if test "$$?" = "0"; then \ - if test "x$(V)" = "x1"; then \ - mkpdf_options="$$mkpdf_options --verbose"; \ - fi; \ - fi; \ - if test "x$(HTML_IMAGES)" != "x"; then \ - for img in $(HTML_IMAGES); do \ - part=`dirname $$img`; \ - echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ - if test $$? != 0; then \ - mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ - fi; \ - done; \ - fi; \ - gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) - $(AM_V_at)touch pdf-build.stamp - -############## - -clean-local: - @rm -f *~ *.bak - @rm -rf .libs - @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \ - rm -f $(DOC_MODULE).types; \ - fi - @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-sections" ; then \ - rm -f $(DOC_MODULE)-sections.txt; \ - fi - -distclean-local: - @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ - $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt - @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ - rm -f $(SETUP_FILES) $(DOC_MODULE).types; \ - fi - -maintainer-clean-local: - @rm -rf xml html - -install-data-local: - @installfiles=`echo $(builddir)/html/*`; \ - if test "$$installfiles" = '$(builddir)/html/*'; \ - then echo 1>&2 'Nothing to install' ; \ - else \ - if test -n "$(DOC_MODULE_VERSION)"; then \ - installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ - else \ - installdir="$(DESTDIR)$(TARGET_DIR)"; \ - fi; \ - $(mkinstalldirs) $${installdir} ; \ - for i in $$installfiles; do \ - echo ' $(INSTALL_DATA) '$$i ; \ - $(INSTALL_DATA) $$i $${installdir}; \ - done; \ - if test -n "$(DOC_MODULE_VERSION)"; then \ - mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ - $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ - fi; \ - $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ - fi - -uninstall-local: - @if test -n "$(DOC_MODULE_VERSION)"; then \ - installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ - else \ - installdir="$(DESTDIR)$(TARGET_DIR)"; \ - fi; \ - rm -rf $${installdir} - -# -# Require gtk-doc when making dist -# -@HAVE_GTK_DOC_TRUE@dist-check-gtkdoc: docs -@HAVE_GTK_DOC_FALSE@dist-check-gtkdoc: -@HAVE_GTK_DOC_FALSE@ @echo "*** gtk-doc is needed to run 'make dist'. ***" -@HAVE_GTK_DOC_FALSE@ @echo "*** gtk-doc was not found when 'configure' ran. ***" -@HAVE_GTK_DOC_FALSE@ @echo "*** please install gtk-doc and rerun 'configure'. ***" -@HAVE_GTK_DOC_FALSE@ @false - -dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local - @mkdir $(distdir)/html - @cp ./html/* $(distdir)/html - @-cp ./$(DOC_MODULE).pdf $(distdir)/ - @-cp ./$(DOC_MODULE).types $(distdir)/ - @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ - @cd $(distdir) && rm -f $(DISTCLEANFILES) - @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html - -.PHONY : dist-hook-local docs - --include $(top_srcdir)/git.mk - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru gstreamer-vaapi-0.7.0/docs/reference/plugins/plugins-docs.xml gstreamer-vaapi-1.8.2/docs/reference/plugins/plugins-docs.xml --- gstreamer-vaapi-0.7.0/docs/reference/plugins/plugins-docs.xml 2015-12-07 10:54:28.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/plugins/plugins-docs.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ - - -]> - - - GStreamer VA-API Plugins 1.6 Plugins Reference Manual - - - - gst-plugins-vaapi Plugins - - - - - - - Object Hierarchy - - - - - API Index - - - - - diff -Nru gstreamer-vaapi-0.7.0/docs/reference/plugins/plugins-docs.xml.in gstreamer-vaapi-1.8.2/docs/reference/plugins/plugins-docs.xml.in --- gstreamer-vaapi-0.7.0/docs/reference/plugins/plugins-docs.xml.in 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/plugins/plugins-docs.xml.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ - - -]> - - - GStreamer VA-API Plugins @GST_API_VERSION@ Plugins Reference Manual - - - - gst-plugins-vaapi Plugins - - - - - - - Object Hierarchy - - - - - API Index - - - - - diff -Nru gstreamer-vaapi-0.7.0/docs/reference/plugins/plugins-sections.txt gstreamer-vaapi-1.8.2/docs/reference/plugins/plugins-sections.txt --- gstreamer-vaapi-0.7.0/docs/reference/plugins/plugins-sections.txt 2015-12-07 11:01:26.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/plugins/plugins-sections.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -
-gstvaapisink -GstVaapiSink -GstVaapiSink - -GST_VAAPISINK -GST_IS_VAAPISINK -GST_TYPE_VAAPISINK -gst_vaapisink_get_type -GST_VAAPISINK_CLASS -GST_IS_VAAPISINK_CLASS -GST_VAAPISINK_GET_CLASS -
- -
-gstvaapidecode -GstVaapiDecode -GstVaapiDecode - -GST_VAAPIDECODE -GST_IS_VAAPIDECODE -GST_TYPE_VAAPIDECODE -gst_vaapidecode_get_type -GST_VAAPIDECODE_CLASS -GST_IS_VAAPIDECODE_CLASS -GST_VAAPIDECODE_GET_CLASS -
- -
-gstvaapipostproc -GstVaapiPostproc -GstVaapiPostproc - -GST_VAAPIPOSTPROC -GST_IS_VAAPIPOSTPROC -GST_TYPE_VAAPIPOSTPROC -gst_vaapipostproc_get_type -GST_VAAPIPOSTPROC_CLASS -GST_IS_VAAPIPOSTPROC_CLASS -GST_VAAPIPOSTPROC_GET_CLASS -
diff -Nru gstreamer-vaapi-0.7.0/docs/reference/plugins/plugins.types gstreamer-vaapi-1.8.2/docs/reference/plugins/plugins.types --- gstreamer-vaapi-0.7.0/docs/reference/plugins/plugins.types 2015-12-07 11:01:26.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/reference/plugins/plugins.types 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -#include - -#include -#include -#include - -gst_vaapidecode_get_type -gst_vaapipostproc_get_type -gst_vaapisink_get_type diff -Nru gstreamer-vaapi-0.7.0/docs/version.entities.in gstreamer-vaapi-1.8.2/docs/version.entities.in --- gstreamer-vaapi-0.7.0/docs/version.entities.in 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/docs/version.entities.in 2016-03-24 11:36:59.000000000 +0000 @@ -0,0 +1,2 @@ + + diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst/videoparsers/gsth264parse.c gstreamer-vaapi-1.8.2/ext/codecparsers/gst/videoparsers/gsth264parse.c --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst/videoparsers/gsth264parse.c 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst/videoparsers/gsth264parse.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2803 +0,0 @@ -/* GStreamer H.264 Parser - * Copyright (C) <2010> Collabora ltd - * Copyright (C) <2010> Nokia Corporation - * Copyright (C) <2011> Intel Corporation - * - * Copyright (C) <2010> Mark Nauwelaerts - * Copyright (C) <2011> Thibault Saunier - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include -#include -#include "gsth264parse.h" - -#include - -GST_DEBUG_CATEGORY (h264_parse_debug); -#define GST_CAT_DEFAULT h264_parse_debug - -#define DEFAULT_CONFIG_INTERVAL (0) - -enum -{ - PROP_0, - PROP_CONFIG_INTERVAL -}; - -enum -{ - GST_H264_PARSE_FORMAT_NONE, - GST_H264_PARSE_FORMAT_AVC, - GST_H264_PARSE_FORMAT_BYTE, - GST_H264_PARSE_FORMAT_AVC3 -}; - -enum -{ - GST_H264_PARSE_ALIGN_NONE = 0, - GST_H264_PARSE_ALIGN_NAL, - GST_H264_PARSE_ALIGN_AU -}; - -enum -{ - GST_H264_PARSE_STATE_GOT_SPS = 1 << 0, - GST_H264_PARSE_STATE_GOT_PPS = 1 << 1, - GST_H264_PARSE_STATE_GOT_SLICE = 1 << 2, - - GST_H264_PARSE_STATE_VALID_PICTURE_HEADERS = (GST_H264_PARSE_STATE_GOT_SPS | - GST_H264_PARSE_STATE_GOT_PPS), - GST_H264_PARSE_STATE_VALID_PICTURE = - (GST_H264_PARSE_STATE_VALID_PICTURE_HEADERS | - GST_H264_PARSE_STATE_GOT_SLICE) -}; - -#define GST_H264_PARSE_STATE_VALID(parse, expected_state) \ - (((parse)->state & (expected_state)) == (expected_state)) - -static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", - GST_PAD_SINK, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ("video/x-h264")); - -static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", - GST_PAD_SRC, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ("video/x-h264, parsed = (boolean) true, " - "stream-format=(string) { avc, avc3, byte-stream }, " - "alignment=(string) { au, nal }")); - -#define parent_class gst_h264_parse_parent_class -G_DEFINE_TYPE (GstH264Parse, gst_h264_parse, GST_TYPE_BASE_PARSE); - -static void gst_h264_parse_finalize (GObject * object); - -static gboolean gst_h264_parse_start (GstBaseParse * parse); -static gboolean gst_h264_parse_stop (GstBaseParse * parse); -static GstFlowReturn gst_h264_parse_handle_frame (GstBaseParse * parse, - GstBaseParseFrame * frame, gint * skipsize); -static GstFlowReturn gst_h264_parse_parse_frame (GstBaseParse * parse, - GstBaseParseFrame * frame); -static GstFlowReturn gst_h264_parse_pre_push_frame (GstBaseParse * parse, - GstBaseParseFrame * frame); - -static void gst_h264_parse_set_property (GObject * object, guint prop_id, - const GValue * value, GParamSpec * pspec); -static void gst_h264_parse_get_property (GObject * object, guint prop_id, - GValue * value, GParamSpec * pspec); - -static gboolean gst_h264_parse_set_caps (GstBaseParse * parse, GstCaps * caps); -static GstCaps *gst_h264_parse_get_caps (GstBaseParse * parse, - GstCaps * filter); -static gboolean gst_h264_parse_event (GstBaseParse * parse, GstEvent * event); -static gboolean gst_h264_parse_src_event (GstBaseParse * parse, - GstEvent * event); -static void gst_h264_parse_update_src_caps (GstH264Parse * h264parse, - GstCaps * caps); - -static void -gst_h264_parse_class_init (GstH264ParseClass * klass) -{ - GObjectClass *gobject_class = (GObjectClass *) klass; - GstBaseParseClass *parse_class = GST_BASE_PARSE_CLASS (klass); - GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); - - GST_DEBUG_CATEGORY_INIT (h264_parse_debug, "h264parse", 0, "h264 parser"); - - gobject_class->finalize = gst_h264_parse_finalize; - gobject_class->set_property = gst_h264_parse_set_property; - gobject_class->get_property = gst_h264_parse_get_property; - - g_object_class_install_property (gobject_class, PROP_CONFIG_INTERVAL, - g_param_spec_uint ("config-interval", - "SPS PPS Send Interval", - "Send SPS and PPS Insertion Interval in seconds (sprop parameter sets " - "will be multiplexed in the data stream when detected.) (0 = disabled)", - 0, 3600, DEFAULT_CONFIG_INTERVAL, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); - - /* Override BaseParse vfuncs */ - parse_class->start = GST_DEBUG_FUNCPTR (gst_h264_parse_start); - parse_class->stop = GST_DEBUG_FUNCPTR (gst_h264_parse_stop); - parse_class->handle_frame = GST_DEBUG_FUNCPTR (gst_h264_parse_handle_frame); - parse_class->pre_push_frame = - GST_DEBUG_FUNCPTR (gst_h264_parse_pre_push_frame); - parse_class->set_sink_caps = GST_DEBUG_FUNCPTR (gst_h264_parse_set_caps); - parse_class->get_sink_caps = GST_DEBUG_FUNCPTR (gst_h264_parse_get_caps); - parse_class->sink_event = GST_DEBUG_FUNCPTR (gst_h264_parse_event); - parse_class->src_event = GST_DEBUG_FUNCPTR (gst_h264_parse_src_event); - - gst_element_class_add_pad_template (gstelement_class, - gst_static_pad_template_get (&srctemplate)); - gst_element_class_add_pad_template (gstelement_class, - gst_static_pad_template_get (&sinktemplate)); - - gst_element_class_set_static_metadata (gstelement_class, "H.264 parser", - "Codec/Parser/Converter/Video", - "Parses H.264 streams", - "Mark Nauwelaerts "); -} - -static void -gst_h264_parse_init (GstH264Parse * h264parse) -{ - h264parse->frame_out = gst_adapter_new (); - gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (h264parse), FALSE); - GST_PAD_SET_ACCEPT_INTERSECT (GST_BASE_PARSE_SINK_PAD (h264parse)); - GST_PAD_SET_ACCEPT_TEMPLATE (GST_BASE_PARSE_SINK_PAD (h264parse)); -} - - -static void -gst_h264_parse_finalize (GObject * object) -{ - GstH264Parse *h264parse = GST_H264_PARSE (object); - - g_object_unref (h264parse->frame_out); - - G_OBJECT_CLASS (parent_class)->finalize (object); -} - -static void -gst_h264_parse_reset_frame (GstH264Parse * h264parse) -{ - GST_DEBUG_OBJECT (h264parse, "reset frame"); - - /* done parsing; reset state */ - h264parse->current_off = -1; - - h264parse->picture_start = FALSE; - h264parse->update_caps = FALSE; - h264parse->idr_pos = -1; - h264parse->sei_pos = -1; - h264parse->keyframe = FALSE; - h264parse->header = FALSE; - h264parse->frame_start = FALSE; - gst_adapter_clear (h264parse->frame_out); -} - -static void -gst_h264_parse_reset_stream_info (GstH264Parse * h264parse) -{ - gint i; - - h264parse->width = 0; - h264parse->height = 0; - h264parse->fps_num = 0; - h264parse->fps_den = 0; - h264parse->upstream_par_n = -1; - h264parse->upstream_par_d = -1; - h264parse->parsed_par_n = 0; - h264parse->parsed_par_d = 0; - h264parse->have_pps = FALSE; - h264parse->have_sps = FALSE; - - h264parse->multiview_mode = GST_VIDEO_MULTIVIEW_MODE_NONE; - h264parse->multiview_flags = GST_VIDEO_MULTIVIEW_FLAGS_NONE; - h264parse->first_in_bundle = TRUE; - - h264parse->align = GST_H264_PARSE_ALIGN_NONE; - h264parse->format = GST_H264_PARSE_FORMAT_NONE; - - h264parse->transform = FALSE; - h264parse->nal_length_size = 4; - h264parse->packetized = FALSE; - h264parse->push_codec = FALSE; - - gst_buffer_replace (&h264parse->codec_data, NULL); - gst_buffer_replace (&h264parse->codec_data_in, NULL); - - gst_h264_parse_reset_frame (h264parse); - - for (i = 0; i < GST_H264_MAX_SPS_COUNT; i++) - gst_buffer_replace (&h264parse->sps_nals[i], NULL); - for (i = 0; i < GST_H264_MAX_PPS_COUNT; i++) - gst_buffer_replace (&h264parse->pps_nals[i], NULL); -} - -static void -gst_h264_parse_reset (GstH264Parse * h264parse) -{ - h264parse->last_report = GST_CLOCK_TIME_NONE; - - h264parse->dts = GST_CLOCK_TIME_NONE; - h264parse->ts_trn_nb = GST_CLOCK_TIME_NONE; - h264parse->do_ts = TRUE; - - h264parse->sent_codec_tag = FALSE; - - h264parse->pending_key_unit_ts = GST_CLOCK_TIME_NONE; - gst_event_replace (&h264parse->force_key_unit_event, NULL); - - h264parse->discont = FALSE; - - gst_h264_parse_reset_stream_info (h264parse); -} - -static gboolean -gst_h264_parse_start (GstBaseParse * parse) -{ - GstH264Parse *h264parse = GST_H264_PARSE (parse); - - GST_DEBUG_OBJECT (parse, "start"); - gst_h264_parse_reset (h264parse); - - h264parse->nalparser = gst_h264_nal_parser_new (); - - h264parse->dts = GST_CLOCK_TIME_NONE; - h264parse->ts_trn_nb = GST_CLOCK_TIME_NONE; - h264parse->sei_pic_struct_pres_flag = FALSE; - h264parse->sei_pic_struct = 0; - h264parse->field_pic_flag = 0; - - gst_base_parse_set_min_frame_size (parse, 6); - - return TRUE; -} - -static gboolean -gst_h264_parse_stop (GstBaseParse * parse) -{ - GstH264Parse *h264parse = GST_H264_PARSE (parse); - - GST_DEBUG_OBJECT (parse, "stop"); - gst_h264_parse_reset (h264parse); - - gst_h264_nal_parser_free (h264parse->nalparser); - - return TRUE; -} - -static const gchar * -gst_h264_parse_get_string (GstH264Parse * parse, gboolean format, gint code) -{ - if (format) { - switch (code) { - case GST_H264_PARSE_FORMAT_AVC: - return "avc"; - case GST_H264_PARSE_FORMAT_BYTE: - return "byte-stream"; - case GST_H264_PARSE_FORMAT_AVC3: - return "avc3"; - default: - return "none"; - } - } else { - switch (code) { - case GST_H264_PARSE_ALIGN_NAL: - return "nal"; - case GST_H264_PARSE_ALIGN_AU: - return "au"; - default: - return "none"; - } - } -} - -static void -gst_h264_parse_format_from_caps (GstCaps * caps, guint * format, guint * align) -{ - if (format) - *format = GST_H264_PARSE_FORMAT_NONE; - - if (align) - *align = GST_H264_PARSE_ALIGN_NONE; - - g_return_if_fail (gst_caps_is_fixed (caps)); - - GST_DEBUG ("parsing caps: %" GST_PTR_FORMAT, caps); - - if (caps && gst_caps_get_size (caps) > 0) { - GstStructure *s = gst_caps_get_structure (caps, 0); - const gchar *str = NULL; - - if (format) { - if ((str = gst_structure_get_string (s, "stream-format"))) { - if (strcmp (str, "avc") == 0) - *format = GST_H264_PARSE_FORMAT_AVC; - else if (strcmp (str, "byte-stream") == 0) - *format = GST_H264_PARSE_FORMAT_BYTE; - else if (strcmp (str, "avc3") == 0) - *format = GST_H264_PARSE_FORMAT_AVC3; - } - } - - if (align) { - if ((str = gst_structure_get_string (s, "alignment"))) { - if (strcmp (str, "au") == 0) - *align = GST_H264_PARSE_ALIGN_AU; - else if (strcmp (str, "nal") == 0) - *align = GST_H264_PARSE_ALIGN_NAL; - } - } - } -} - -/* check downstream caps to configure format and alignment */ -static void -gst_h264_parse_negotiate (GstH264Parse * h264parse, gint in_format, - GstCaps * in_caps) -{ - GstCaps *caps; - guint format = h264parse->format; - guint align = h264parse->align; - - g_return_if_fail ((in_caps == NULL) || gst_caps_is_fixed (in_caps)); - - caps = gst_pad_get_allowed_caps (GST_BASE_PARSE_SRC_PAD (h264parse)); - GST_DEBUG_OBJECT (h264parse, "allowed caps: %" GST_PTR_FORMAT, caps); - - /* concentrate on leading structure, since decodebin parser - * capsfilter always includes parser template caps */ - if (caps) { - caps = gst_caps_truncate (caps); - GST_DEBUG_OBJECT (h264parse, "negotiating with caps: %" GST_PTR_FORMAT, - caps); - } - - h264parse->can_passthrough = FALSE; - - if (in_caps && caps) { - if (gst_caps_can_intersect (in_caps, caps)) { - GST_DEBUG_OBJECT (h264parse, "downstream accepts upstream caps"); - gst_h264_parse_format_from_caps (in_caps, &format, &align); - gst_caps_unref (caps); - caps = NULL; - h264parse->can_passthrough = TRUE; - } - } - - /* FIXME We could fail the negotiation immediatly if caps are empty */ - if (caps && !gst_caps_is_empty (caps)) { - /* fixate to avoid ambiguity with lists when parsing */ - caps = gst_caps_fixate (caps); - gst_h264_parse_format_from_caps (caps, &format, &align); - gst_caps_unref (caps); - } - - /* default */ - if (!format) - format = GST_H264_PARSE_FORMAT_BYTE; - if (!align) - align = GST_H264_PARSE_ALIGN_AU; - - GST_DEBUG_OBJECT (h264parse, "selected format %s, alignment %s", - gst_h264_parse_get_string (h264parse, TRUE, format), - gst_h264_parse_get_string (h264parse, FALSE, align)); - - h264parse->format = format; - h264parse->align = align; - - h264parse->transform = in_format != h264parse->format || - align == GST_H264_PARSE_ALIGN_AU; -} - -static GstBuffer * -gst_h264_parse_wrap_nal (GstH264Parse * h264parse, guint format, guint8 * data, - guint size) -{ - GstBuffer *buf; - guint nl = h264parse->nal_length_size; - guint32 tmp; - - GST_DEBUG_OBJECT (h264parse, "nal length %d", size); - - buf = gst_buffer_new_allocate (NULL, 4 + size, NULL); - if (format == GST_H264_PARSE_FORMAT_AVC - || format == GST_H264_PARSE_FORMAT_AVC3) { - tmp = GUINT32_TO_BE (size << (32 - 8 * nl)); - } else { - /* HACK: nl should always be 4 here, otherwise this won't work. - * There are legit cases where nl in avc stream is 2, but byte-stream - * SC is still always 4 bytes. */ - nl = 4; - tmp = GUINT32_TO_BE (1); - } - - gst_buffer_fill (buf, 0, &tmp, sizeof (guint32)); - gst_buffer_fill (buf, nl, data, size); - gst_buffer_set_size (buf, size + nl); - - return buf; -} - -static void -gst_h264_parser_store_nal (GstH264Parse * h264parse, guint id, - GstH264NalUnitType naltype, GstH264NalUnit * nalu) -{ - GstBuffer *buf, **store; - guint size = nalu->size, store_size; - - if (naltype == GST_H264_NAL_SPS || naltype == GST_H264_NAL_SUBSET_SPS) { - store_size = GST_H264_MAX_SPS_COUNT; - store = h264parse->sps_nals; - GST_DEBUG_OBJECT (h264parse, "storing sps %u", id); - } else if (naltype == GST_H264_NAL_PPS) { - store_size = GST_H264_MAX_PPS_COUNT; - store = h264parse->pps_nals; - GST_DEBUG_OBJECT (h264parse, "storing pps %u", id); - } else - return; - - if (id >= store_size) { - GST_DEBUG_OBJECT (h264parse, "unable to store nal, id out-of-range %d", id); - return; - } - - buf = gst_buffer_new_allocate (NULL, size, NULL); - gst_buffer_fill (buf, 0, nalu->data + nalu->offset, size); - - /* Indicate that buffer contain a header needed for decoding */ - if (naltype == GST_H264_NAL_SPS || naltype == GST_H264_NAL_PPS) - GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_HEADER); - - if (store[id]) - gst_buffer_unref (store[id]); - - store[id] = buf; -} - -#ifndef GST_DISABLE_GST_DEBUG -static const gchar *nal_names[] = { - "Unknown", - "Slice", - "Slice DPA", - "Slice DPB", - "Slice DPC", - "Slice IDR", - "SEI", - "SPS", - "PPS", - "AU delimiter", - "Sequence End", - "Stream End", - "Filler Data", - "SPS extension", - "Prefix", - "SPS Subset", - "Depth Parameter Set", - "Reserved", "Reserved", - "Slice Aux Unpartitioned", - "Slice Extension", - "Slice Depth/3D-AVC Extension" -}; - -static const gchar * -_nal_name (GstH264NalUnitType nal_type) -{ - if (nal_type <= GST_H264_NAL_SLICE_DEPTH) - return nal_names[nal_type]; - return "Invalid"; -} -#endif - -static void -gst_h264_parse_process_sei (GstH264Parse * h264parse, GstH264NalUnit * nalu) -{ - GstH264SEIMessage sei; - GstH264NalParser *nalparser = h264parse->nalparser; - GstH264ParserResult pres; - GArray *messages; - guint i; - - pres = gst_h264_parser_parse_sei (nalparser, nalu, &messages); - if (pres != GST_H264_PARSER_OK) - GST_WARNING_OBJECT (h264parse, "failed to parse one or more SEI message"); - - /* Even if pres != GST_H264_PARSER_OK, some message could have been parsed and - * stored in messages. - */ - for (i = 0; i < messages->len; i++) { - sei = g_array_index (messages, GstH264SEIMessage, i); - switch (sei.payloadType) { - case GST_H264_SEI_PIC_TIMING: - h264parse->sei_pic_struct_pres_flag = - sei.payload.pic_timing.pic_struct_present_flag; - h264parse->sei_cpb_removal_delay = - sei.payload.pic_timing.cpb_removal_delay; - if (h264parse->sei_pic_struct_pres_flag) - h264parse->sei_pic_struct = sei.payload.pic_timing.pic_struct; - GST_LOG_OBJECT (h264parse, "pic timing updated"); - break; - case GST_H264_SEI_BUF_PERIOD: - if (h264parse->ts_trn_nb == GST_CLOCK_TIME_NONE || - h264parse->dts == GST_CLOCK_TIME_NONE) - h264parse->ts_trn_nb = 0; - else - h264parse->ts_trn_nb = h264parse->dts; - - GST_LOG_OBJECT (h264parse, - "new buffering period; ts_trn_nb updated: %" GST_TIME_FORMAT, - GST_TIME_ARGS (h264parse->ts_trn_nb)); - break; - - /* Additional messages that are not innerly useful to the - * element but for debugging purposes */ - case GST_H264_SEI_RECOVERY_POINT: - GST_LOG_OBJECT (h264parse, "recovery point found: %u %u %u %u", - sei.payload.recovery_point.recovery_frame_cnt, - sei.payload.recovery_point.exact_match_flag, - sei.payload.recovery_point.broken_link_flag, - sei.payload.recovery_point.changing_slice_group_idc); - break; - - /* Additional messages that are not innerly useful to the - * element but for debugging purposes */ - case GST_H264_SEI_STEREO_VIDEO_INFO:{ - GstVideoMultiviewMode mview_mode = GST_VIDEO_MULTIVIEW_MODE_NONE; - GstVideoMultiviewFlags mview_flags = GST_VIDEO_MULTIVIEW_FLAGS_NONE; - - GST_LOG_OBJECT (h264parse, "Stereo video information %u %u %u %u %u %u", - sei.payload.stereo_video_info.field_views_flag, - sei.payload.stereo_video_info.top_field_is_left_view_flag, - sei.payload.stereo_video_info.current_frame_is_left_view_flag, - sei.payload.stereo_video_info.next_frame_is_second_view_flag, - sei.payload.stereo_video_info.left_view_self_contained_flag, - sei.payload.stereo_video_info.right_view_self_contained_flag); - - if (sei.payload.stereo_video_info.field_views_flag) { - mview_mode = GST_VIDEO_MULTIVIEW_MODE_ROW_INTERLEAVED; - if (!sei.payload.stereo_video_info.top_field_is_left_view_flag) - mview_mode |= GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_VIEW_FIRST; - } else { - mview_mode = GST_VIDEO_MULTIVIEW_MODE_FRAME_BY_FRAME; - if (sei.payload.stereo_video_info.next_frame_is_second_view_flag) { - /* Mark current frame as first in bundle */ - h264parse->first_in_bundle = TRUE; - if (!sei.payload.stereo_video_info.current_frame_is_left_view_flag) - mview_flags |= GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_VIEW_FIRST; - } - } - if (mview_mode != h264parse->multiview_mode || - mview_flags != h264parse->multiview_flags) { - h264parse->multiview_mode = mview_mode; - h264parse->multiview_flags = mview_flags; - /* output caps need to be changed */ - gst_h264_parse_update_src_caps (h264parse, NULL); - } - break; - } - case GST_H264_SEI_FRAME_PACKING:{ - GstVideoMultiviewMode mview_mode = GST_VIDEO_MULTIVIEW_MODE_NONE; - GstVideoMultiviewFlags mview_flags = GST_VIDEO_MULTIVIEW_FLAGS_NONE; - - GST_LOG_OBJECT (h264parse, - "frame packing arrangement message: id %u cancelled %u " - "type %u quincunx %u content_interpretation %d flip %u " - "right_first %u field_views %u is_frame0 %u", - sei.payload.frame_packing.frame_packing_id, - sei.payload.frame_packing.frame_packing_cancel_flag, - sei.payload.frame_packing.frame_packing_type, - sei.payload.frame_packing.quincunx_sampling_flag, - sei.payload.frame_packing.content_interpretation_type, - sei.payload.frame_packing.spatial_flipping_flag, - sei.payload.frame_packing.frame0_flipped_flag, - sei.payload.frame_packing.field_views_flag, - sei.payload.frame_packing.current_frame_is_frame0_flag); - - /* Only IDs from 0->255 and 512->2^31-1 are valid. Ignore others */ - if ((sei.payload.frame_packing.frame_packing_id >= 256 && - sei.payload.frame_packing.frame_packing_id < 512) || - (sei.payload.frame_packing.frame_packing_id >= (1U << 31))) - break; /* ignore */ - - if (!sei.payload.frame_packing.frame_packing_cancel_flag) { - /* Cancel flag sets things back to no-info */ - - if (sei.payload.frame_packing.content_interpretation_type == 2) - mview_flags |= GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_VIEW_FIRST; - - switch (sei.payload.frame_packing.frame_packing_type) { - case 0: - mview_mode = GST_VIDEO_MULTIVIEW_MODE_CHECKERBOARD; - break; - case 1: - mview_mode = GST_VIDEO_MULTIVIEW_MODE_COLUMN_INTERLEAVED; - break; - case 2: - mview_mode = GST_VIDEO_MULTIVIEW_MODE_ROW_INTERLEAVED; - break; - case 3: - if (sei.payload.frame_packing.quincunx_sampling_flag) - mview_mode = GST_VIDEO_MULTIVIEW_MODE_SIDE_BY_SIDE_QUINCUNX; - else - mview_mode = GST_VIDEO_MULTIVIEW_MODE_SIDE_BY_SIDE; - if (sei.payload.frame_packing.spatial_flipping_flag) { - /* One of the views is flopped. */ - if (sei.payload.frame_packing.frame0_flipped_flag != - ! !(mview_flags & - GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_VIEW_FIRST)) - /* the left view is flopped */ - mview_flags |= GST_VIDEO_MULTIVIEW_FLAGS_LEFT_FLOPPED; - else - mview_flags |= GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_FLOPPED; - } - break; - case 4: - mview_mode = GST_VIDEO_MULTIVIEW_MODE_TOP_BOTTOM; - if (sei.payload.frame_packing.spatial_flipping_flag) { - /* One of the views is flipped, */ - if (sei.payload.frame_packing.frame0_flipped_flag != - ! !(mview_flags & - GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_VIEW_FIRST)) - /* the left view is flipped */ - mview_flags |= GST_VIDEO_MULTIVIEW_FLAGS_LEFT_FLIPPED; - else - mview_flags |= GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_FLIPPED; - } - break; - case 5: - if (sei.payload.frame_packing.content_interpretation_type == 0) - mview_mode = GST_VIDEO_MULTIVIEW_MODE_MULTIVIEW_FRAME_BY_FRAME; - else - mview_mode = GST_VIDEO_MULTIVIEW_MODE_FRAME_BY_FRAME; - break; - default: - GST_DEBUG_OBJECT (h264parse, "Invalid frame packing type %u", - sei.payload.frame_packing.frame_packing_type); - break; - } - } - - if (mview_mode != h264parse->multiview_mode || - mview_flags != h264parse->multiview_flags) { - h264parse->multiview_mode = mview_mode; - h264parse->multiview_flags = mview_flags; - /* output caps need to be changed */ - gst_h264_parse_update_src_caps (h264parse, NULL); - } - break; - } - } - } - g_array_free (messages, TRUE); -} - -/* caller guarantees 2 bytes of nal payload */ -static gboolean -gst_h264_parse_process_nal (GstH264Parse * h264parse, GstH264NalUnit * nalu) -{ - guint nal_type; - GstH264PPS pps = { 0, }; - GstH264SPS sps = { 0, }; - GstH264NalParser *nalparser = h264parse->nalparser; - GstH264ParserResult pres; - - /* nothing to do for broken input */ - if (G_UNLIKELY (nalu->size < 2)) { - GST_DEBUG_OBJECT (h264parse, "not processing nal size %u", nalu->size); - return TRUE; - } - - /* we have a peek as well */ - nal_type = nalu->type; - - GST_DEBUG_OBJECT (h264parse, "processing nal of type %u %s, size %u", - nal_type, _nal_name (nal_type), nalu->size); - - switch (nal_type) { - case GST_H264_NAL_SUBSET_SPS: - if (!GST_H264_PARSE_STATE_VALID (h264parse, GST_H264_PARSE_STATE_GOT_SPS)) - return FALSE; - pres = gst_h264_parser_parse_subset_sps (nalparser, nalu, &sps, TRUE); - goto process_sps; - - case GST_H264_NAL_SPS: - /* reset state, everything else is obsolete */ - h264parse->state = 0; - pres = gst_h264_parser_parse_sps (nalparser, nalu, &sps, TRUE); - - process_sps: - /* arranged for a fallback sps.id, so use that one and only warn */ - if (pres != GST_H264_PARSER_OK) { - GST_WARNING_OBJECT (h264parse, "failed to parse SPS:"); - return FALSE; - } - - GST_DEBUG_OBJECT (h264parse, "triggering src caps check"); - h264parse->update_caps = TRUE; - h264parse->have_sps = TRUE; - if (h264parse->push_codec && h264parse->have_pps) { - /* SPS and PPS found in stream before the first pre_push_frame, no need - * to forcibly push at start */ - GST_INFO_OBJECT (h264parse, "have SPS/PPS in stream"); - h264parse->push_codec = FALSE; - h264parse->have_sps = FALSE; - h264parse->have_pps = FALSE; - } - - gst_h264_parser_store_nal (h264parse, sps.id, nal_type, nalu); - gst_h264_sps_clear (&sps); - h264parse->state |= GST_H264_PARSE_STATE_GOT_SPS; - h264parse->header |= TRUE; - break; - case GST_H264_NAL_PPS: - /* expected state: got-sps */ - h264parse->state &= GST_H264_PARSE_STATE_GOT_SPS; - if (!GST_H264_PARSE_STATE_VALID (h264parse, GST_H264_PARSE_STATE_GOT_SPS)) - return FALSE; - - pres = gst_h264_parser_parse_pps (nalparser, nalu, &pps); - /* arranged for a fallback pps.id, so use that one and only warn */ - if (pres != GST_H264_PARSER_OK) { - GST_WARNING_OBJECT (h264parse, "failed to parse PPS:"); - if (pres != GST_H264_PARSER_BROKEN_LINK) - return FALSE; - } - - /* parameters might have changed, force caps check */ - if (!h264parse->have_pps) { - GST_DEBUG_OBJECT (h264parse, "triggering src caps check"); - h264parse->update_caps = TRUE; - } - h264parse->have_pps = TRUE; - if (h264parse->push_codec && h264parse->have_sps) { - /* SPS and PPS found in stream before the first pre_push_frame, no need - * to forcibly push at start */ - GST_INFO_OBJECT (h264parse, "have SPS/PPS in stream"); - h264parse->push_codec = FALSE; - h264parse->have_sps = FALSE; - h264parse->have_pps = FALSE; - } - - gst_h264_parser_store_nal (h264parse, pps.id, nal_type, nalu); - gst_h264_pps_clear (&pps); - h264parse->state |= GST_H264_PARSE_STATE_GOT_PPS; - h264parse->header |= TRUE; - break; - case GST_H264_NAL_SEI: - /* expected state: got-sps */ - if (!GST_H264_PARSE_STATE_VALID (h264parse, GST_H264_PARSE_STATE_GOT_SPS)) - return FALSE; - - h264parse->header |= TRUE; - gst_h264_parse_process_sei (h264parse, nalu); - /* mark SEI pos */ - if (h264parse->sei_pos == -1) { - if (h264parse->transform) - h264parse->sei_pos = gst_adapter_available (h264parse->frame_out); - else - h264parse->sei_pos = nalu->sc_offset; - GST_DEBUG_OBJECT (h264parse, "marking SEI in frame at offset %d", - h264parse->sei_pos); - } - break; - - case GST_H264_NAL_SLICE: - case GST_H264_NAL_SLICE_DPA: - case GST_H264_NAL_SLICE_DPB: - case GST_H264_NAL_SLICE_DPC: - case GST_H264_NAL_SLICE_IDR: - case GST_H264_NAL_SLICE_EXT: - /* expected state: got-sps|got-pps (valid picture headers) */ - h264parse->state &= GST_H264_PARSE_STATE_VALID_PICTURE_HEADERS; - if (!GST_H264_PARSE_STATE_VALID (h264parse, - GST_H264_PARSE_STATE_VALID_PICTURE_HEADERS)) - return FALSE; - - /* don't need to parse the whole slice (header) here */ - if (*(nalu->data + nalu->offset + nalu->header_bytes) & 0x80) { - /* means first_mb_in_slice == 0 */ - /* real frame data */ - GST_DEBUG_OBJECT (h264parse, "first_mb_in_slice = 0"); - h264parse->frame_start = TRUE; - } - GST_DEBUG_OBJECT (h264parse, "frame start: %i", h264parse->frame_start); - if (nal_type == GST_H264_NAL_SLICE_EXT && !GST_H264_IS_MVC_NALU (nalu)) - break; - { - GstH264SliceHdr slice; - - pres = gst_h264_parser_parse_slice_hdr (nalparser, nalu, &slice, - FALSE, FALSE); - GST_DEBUG_OBJECT (h264parse, - "parse result %d, first MB: %u, slice type: %u", - pres, slice.first_mb_in_slice, slice.type); - if (pres == GST_H264_PARSER_OK) { - if (GST_H264_IS_I_SLICE (&slice) || GST_H264_IS_SI_SLICE (&slice)) - h264parse->keyframe |= TRUE; - - h264parse->state |= GST_H264_PARSE_STATE_GOT_SLICE; - h264parse->field_pic_flag = slice.field_pic_flag; - } - } - if (G_LIKELY (nal_type != GST_H264_NAL_SLICE_IDR && - !h264parse->push_codec)) - break; - /* if we need to sneak codec NALs into the stream, - * this is a good place, so fake it as IDR - * (which should be at start anyway) */ - /* mark where config needs to go if interval expired */ - /* mind replacement buffer if applicable */ - if (h264parse->idr_pos == -1) { - if (h264parse->transform) - h264parse->idr_pos = gst_adapter_available (h264parse->frame_out); - else - h264parse->idr_pos = nalu->sc_offset; - GST_DEBUG_OBJECT (h264parse, "marking IDR in frame at offset %d", - h264parse->idr_pos); - } - /* if SEI preceeds (faked) IDR, then we have to insert config there */ - if (h264parse->sei_pos >= 0 && h264parse->idr_pos > h264parse->sei_pos) { - h264parse->idr_pos = h264parse->sei_pos; - GST_DEBUG_OBJECT (h264parse, "moved IDR mark to SEI position %d", - h264parse->idr_pos); - } - break; - case GST_H264_NAL_AU_DELIMITER: - /* Just accumulate AU Delimiter, whether it's before SPS or not */ - pres = gst_h264_parser_parse_nal (nalparser, nalu); - if (pres != GST_H264_PARSER_OK) - return FALSE; - break; - default: - /* drop anything before the initial SPS */ - if (!GST_H264_PARSE_STATE_VALID (h264parse, GST_H264_PARSE_STATE_GOT_SPS)) - return FALSE; - - pres = gst_h264_parser_parse_nal (nalparser, nalu); - if (pres != GST_H264_PARSER_OK) - return FALSE; - break; - } - - /* if AVC output needed, collect properly prefixed nal in adapter, - * and use that to replace outgoing buffer data later on */ - if (h264parse->transform) { - GstBuffer *buf; - - GST_LOG_OBJECT (h264parse, "collecting NAL in AVC frame"); - buf = gst_h264_parse_wrap_nal (h264parse, h264parse->format, - nalu->data + nalu->offset, nalu->size); - gst_adapter_push (h264parse->frame_out, buf); - } - return TRUE; -} - -/* caller guarantees at least 2 bytes of nal payload for each nal - * returns TRUE if next_nal indicates that nal terminates an AU */ -static inline gboolean -gst_h264_parse_collect_nal (GstH264Parse * h264parse, const guint8 * data, - guint size, GstH264NalUnit * nalu) -{ - gboolean complete; - GstH264ParserResult parse_res; - GstH264NalUnitType nal_type = nalu->type; - GstH264NalUnit nnalu; - - GST_DEBUG_OBJECT (h264parse, "parsing collected nal"); - parse_res = gst_h264_parser_identify_nalu_unchecked (h264parse->nalparser, - data, nalu->offset + nalu->size, size, &nnalu); - - if (parse_res != GST_H264_PARSER_OK) - return FALSE; - - /* determine if AU complete */ - GST_LOG_OBJECT (h264parse, "nal type: %d %s", nal_type, _nal_name (nal_type)); - /* coded slice NAL starts a picture, - * i.e. other types become aggregated in front of it */ - h264parse->picture_start |= (nal_type == GST_H264_NAL_SLICE || - nal_type == GST_H264_NAL_SLICE_DPA || nal_type == GST_H264_NAL_SLICE_IDR); - - /* consider a coded slices (IDR or not) to start a picture, - * (so ending the previous one) if first_mb_in_slice == 0 - * (non-0 is part of previous one) */ - /* NOTE this is not entirely according to Access Unit specs in 7.4.1.2.4, - * but in practice it works in sane cases, needs not much parsing, - * and also works with broken frame_num in NAL - * (where spec-wise would fail) */ - nal_type = nnalu.type; - complete = h264parse->picture_start && ((nal_type >= GST_H264_NAL_SEI && - nal_type <= GST_H264_NAL_AU_DELIMITER) || - (nal_type >= 14 && nal_type <= 18)); - - GST_LOG_OBJECT (h264parse, "next nal type: %d %s", nal_type, - _nal_name (nal_type)); - complete |= h264parse->picture_start && (nal_type == GST_H264_NAL_SLICE - || nal_type == GST_H264_NAL_SLICE_DPA - || nal_type == GST_H264_NAL_SLICE_IDR) && - /* first_mb_in_slice == 0 considered start of frame */ - (nnalu.data[nnalu.offset + nnalu.header_bytes] & 0x80); - - GST_LOG_OBJECT (h264parse, "au complete: %d", complete); - - return complete; -} - - -static GstFlowReturn -gst_h264_parse_handle_frame_packetized (GstBaseParse * parse, - GstBaseParseFrame * frame) -{ - GstH264Parse *h264parse = GST_H264_PARSE (parse); - GstBuffer *buffer = frame->buffer; - GstFlowReturn ret = GST_FLOW_OK; - GstH264ParserResult parse_res; - GstH264NalUnit nalu; - const guint nl = h264parse->nal_length_size; - GstMapInfo map; - gint left; - - if (nl < 1 || nl > 4) { - GST_DEBUG_OBJECT (h264parse, "insufficient data to split input"); - return GST_FLOW_NOT_NEGOTIATED; - } - - /* need to save buffer from invalidation upon _finish_frame */ - if (h264parse->split_packetized) - buffer = gst_buffer_copy (frame->buffer); - - gst_buffer_map (buffer, &map, GST_MAP_READ); - - left = map.size; - - GST_LOG_OBJECT (h264parse, - "processing packet buffer of size %" G_GSIZE_FORMAT, map.size); - - parse_res = gst_h264_parser_identify_nalu_avc (h264parse->nalparser, - map.data, 0, map.size, nl, &nalu); - - while (parse_res == GST_H264_PARSER_OK) { - GST_DEBUG_OBJECT (h264parse, "AVC nal offset %d", nalu.offset + nalu.size); - - /* either way, have a look at it */ - gst_h264_parse_process_nal (h264parse, &nalu); - - /* dispatch per NALU if needed */ - if (h264parse->split_packetized) { - GstBaseParseFrame tmp_frame; - - gst_base_parse_frame_init (&tmp_frame); - tmp_frame.flags |= frame->flags; - tmp_frame.offset = frame->offset; - tmp_frame.overhead = frame->overhead; - tmp_frame.buffer = gst_buffer_copy_region (buffer, GST_BUFFER_COPY_ALL, - nalu.offset, nalu.size); - - /* note we don't need to come up with a sub-buffer, since - * subsequent code only considers input buffer's metadata. - * Real data is either taken from input by baseclass or - * a replacement output buffer is provided anyway. */ - gst_h264_parse_parse_frame (parse, &tmp_frame); - ret = gst_base_parse_finish_frame (parse, &tmp_frame, nl + nalu.size); - left -= nl + nalu.size; - } - - parse_res = gst_h264_parser_identify_nalu_avc (h264parse->nalparser, - map.data, nalu.offset + nalu.size, map.size, nl, &nalu); - } - - gst_buffer_unmap (buffer, &map); - - if (!h264parse->split_packetized) { - gst_h264_parse_parse_frame (parse, frame); - ret = gst_base_parse_finish_frame (parse, frame, map.size); - } else { - gst_buffer_unref (buffer); - if (G_UNLIKELY (left)) { - /* should not be happening for nice AVC */ - GST_WARNING_OBJECT (parse, "skipping leftover AVC data %d", left); - frame->flags |= GST_BASE_PARSE_FRAME_FLAG_DROP; - ret = gst_base_parse_finish_frame (parse, frame, map.size); - } - } - - if (parse_res == GST_H264_PARSER_NO_NAL_END || - parse_res == GST_H264_PARSER_BROKEN_DATA) { - - if (h264parse->split_packetized) { - GST_ELEMENT_ERROR (h264parse, STREAM, FAILED, (NULL), - ("invalid AVC input data")); - - return GST_FLOW_ERROR; - } else { - /* do not meddle to much in this case */ - GST_DEBUG_OBJECT (h264parse, "parsing packet failed"); - } - } - - return ret; -} - -static GstFlowReturn -gst_h264_parse_handle_frame (GstBaseParse * parse, - GstBaseParseFrame * frame, gint * skipsize) -{ - GstH264Parse *h264parse = GST_H264_PARSE (parse); - GstBuffer *buffer = frame->buffer; - GstMapInfo map; - guint8 *data; - gsize size; - gint current_off = 0; - gboolean drain, nonext; - GstH264NalParser *nalparser = h264parse->nalparser; - GstH264NalUnit nalu; - GstH264ParserResult pres; - gint framesize; - - if (G_UNLIKELY (GST_BUFFER_FLAG_IS_SET (frame->buffer, - GST_BUFFER_FLAG_DISCONT))) { - h264parse->discont = TRUE; - } - - /* delegate in packetized case, no skipping should be needed */ - if (h264parse->packetized) - return gst_h264_parse_handle_frame_packetized (parse, frame); - - gst_buffer_map (buffer, &map, GST_MAP_READ); - data = map.data; - size = map.size; - - /* expect at least 3 bytes startcode == sc, and 2 bytes NALU payload */ - if (G_UNLIKELY (size < 5)) { - gst_buffer_unmap (buffer, &map); - *skipsize = 1; - return GST_FLOW_OK; - } - - /* need to configure aggregation */ - if (G_UNLIKELY (h264parse->format == GST_H264_PARSE_FORMAT_NONE)) - gst_h264_parse_negotiate (h264parse, GST_H264_PARSE_FORMAT_BYTE, NULL); - - /* avoid stale cached parsing state */ - if (frame->flags & GST_BASE_PARSE_FRAME_FLAG_NEW_FRAME) { - GST_LOG_OBJECT (h264parse, "parsing new frame"); - gst_h264_parse_reset_frame (h264parse); - } else { - GST_LOG_OBJECT (h264parse, "resuming frame parsing"); - } - - drain = GST_BASE_PARSE_DRAINING (parse); - nonext = FALSE; - - current_off = h264parse->current_off; - if (current_off < 0) - current_off = 0; - g_assert (current_off < size); - GST_DEBUG_OBJECT (h264parse, "last parse position %d", current_off); - - /* check for initial skip */ - if (h264parse->current_off == -1) { - pres = - gst_h264_parser_identify_nalu_unchecked (nalparser, data, current_off, - size, &nalu); - switch (pres) { - case GST_H264_PARSER_OK: - if (nalu.sc_offset > 0) { - *skipsize = nalu.sc_offset; - goto skip; - } - break; - case GST_H264_PARSER_NO_NAL: - *skipsize = size - 3; - goto skip; - break; - default: - g_assert_not_reached (); - break; - } - } - - while (TRUE) { - pres = - gst_h264_parser_identify_nalu (nalparser, data, current_off, size, - &nalu); - - switch (pres) { - case GST_H264_PARSER_OK: - GST_DEBUG_OBJECT (h264parse, "complete nal (offset, size): (%u, %u) ", - nalu.offset, nalu.size); - break; - case GST_H264_PARSER_NO_NAL_END: - GST_DEBUG_OBJECT (h264parse, "not a complete nal found at offset %u", - nalu.offset); - /* if draining, accept it as complete nal */ - if (drain) { - nonext = TRUE; - nalu.size = size - nalu.offset; - GST_DEBUG_OBJECT (h264parse, "draining, accepting with size %u", - nalu.size); - /* if it's not too short at least */ - if (nalu.size < 2) - goto broken; - break; - } - /* otherwise need more */ - goto more; - case GST_H264_PARSER_BROKEN_LINK: - GST_ELEMENT_ERROR (h264parse, STREAM, FORMAT, - ("Error parsing H.264 stream"), - ("The link to structure needed for the parsing couldn't be found")); - goto invalid_stream; - case GST_H264_PARSER_ERROR: - /* should not really occur either */ - GST_ELEMENT_ERROR (h264parse, STREAM, FORMAT, - ("Error parsing H.264 stream"), ("Invalid H.264 stream")); - goto invalid_stream; - case GST_H264_PARSER_NO_NAL: - GST_ELEMENT_ERROR (h264parse, STREAM, FORMAT, - ("Error parsing H.264 stream"), ("No H.264 NAL unit found")); - goto invalid_stream; - case GST_H264_PARSER_BROKEN_DATA: - GST_WARNING_OBJECT (h264parse, "input stream is corrupt; " - "it contains a NAL unit of length %u", nalu.size); - broken: - /* broken nal at start -> arrange to skip it, - * otherwise have it terminate current au - * (and so it will be skipped on next frame round) */ - if (current_off == 0) { - GST_DEBUG_OBJECT (h264parse, "skipping broken nal"); - *skipsize = nalu.offset; - goto skip; - } else { - GST_DEBUG_OBJECT (h264parse, "terminating au"); - nalu.size = 0; - nalu.offset = nalu.sc_offset; - goto end; - } - break; - default: - g_assert_not_reached (); - break; - } - - GST_DEBUG_OBJECT (h264parse, "%p complete nal found. Off: %u, Size: %u", - data, nalu.offset, nalu.size); - - /* simulate no next nal if none needed */ - nonext = nonext || (h264parse->align == GST_H264_PARSE_ALIGN_NAL); - - if (!nonext) { - if (nalu.offset + nalu.size + 4 + 2 > size) { - GST_DEBUG_OBJECT (h264parse, "not enough data for next NALU"); - if (drain) { - GST_DEBUG_OBJECT (h264parse, "but draining anyway"); - nonext = TRUE; - } else { - goto more; - } - } - } - - if (!gst_h264_parse_process_nal (h264parse, &nalu)) { - GST_WARNING_OBJECT (h264parse, - "broken/invalid nal Type: %d %s, Size: %u will be dropped", - nalu.type, _nal_name (nalu.type), nalu.size); - *skipsize = nalu.size; - goto skip; - } - - if (nonext) - break; - - /* if no next nal, we know it's complete here */ - if (gst_h264_parse_collect_nal (h264parse, data, size, &nalu)) - break; - - GST_DEBUG_OBJECT (h264parse, "Looking for more"); - current_off = nalu.offset + nalu.size; - } - -end: - framesize = nalu.offset + nalu.size; - - gst_buffer_unmap (buffer, &map); - - gst_h264_parse_parse_frame (parse, frame); - - return gst_base_parse_finish_frame (parse, frame, framesize); - -more: - *skipsize = 0; - - /* Restart parsing from here next time */ - if (current_off > 0) - h264parse->current_off = current_off; - - /* Fall-through. */ -out: - gst_buffer_unmap (buffer, &map); - return GST_FLOW_OK; - -skip: - GST_DEBUG_OBJECT (h264parse, "skipping %d", *skipsize); - /* If we are collecting access units, we need to preserve the initial - * config headers (SPS, PPS et al.) and only reset the frame if another - * slice NAL was received. This means that broken pictures are discarded */ - if (h264parse->align != GST_H264_PARSE_ALIGN_AU || - !(h264parse->state & GST_H264_PARSE_STATE_VALID_PICTURE_HEADERS) || - (h264parse->state & GST_H264_PARSE_STATE_GOT_SLICE)) - gst_h264_parse_reset_frame (h264parse); - goto out; - -invalid_stream: - gst_buffer_unmap (buffer, &map); - return GST_FLOW_ERROR; -} - -/* byte together avc codec data based on collected pps and sps so far */ -static GstBuffer * -gst_h264_parse_make_codec_data (GstH264Parse * h264parse) -{ - GstBuffer *buf, *nal; - gint i, sps_size = 0, pps_size = 0, num_sps = 0, num_pps = 0; - guint8 profile_idc = 0, profile_comp = 0, level_idc = 0; - gboolean found = FALSE; - GstMapInfo map; - guint8 *data; - gint nl; - - /* only nal payload in stored nals */ - - for (i = 0; i < GST_H264_MAX_SPS_COUNT; i++) { - if ((nal = h264parse->sps_nals[i])) { - gsize size = gst_buffer_get_size (nal); - num_sps++; - /* size bytes also count */ - sps_size += size + 2; - if (size >= 4) { - guint8 tmp[3]; - found = TRUE; - gst_buffer_extract (nal, 1, tmp, 3); - profile_idc = tmp[0]; - profile_comp = tmp[1]; - level_idc = tmp[2]; - } - } - } - for (i = 0; i < GST_H264_MAX_PPS_COUNT; i++) { - if ((nal = h264parse->pps_nals[i])) { - num_pps++; - /* size bytes also count */ - pps_size += gst_buffer_get_size (nal) + 2; - } - } - - /* AVC3 has SPS/PPS inside the stream, not in the codec_data */ - if (h264parse->format == GST_H264_PARSE_FORMAT_AVC3) { - num_sps = sps_size = 0; - num_pps = pps_size = 0; - } - - GST_DEBUG_OBJECT (h264parse, - "constructing codec_data: num_sps=%d, num_pps=%d", num_sps, num_pps); - - if (!found || (0 == num_pps - && GST_H264_PARSE_FORMAT_AVC3 != h264parse->format)) - return NULL; - - buf = gst_buffer_new_allocate (NULL, 5 + 1 + sps_size + 1 + pps_size, NULL); - gst_buffer_map (buf, &map, GST_MAP_WRITE); - data = map.data; - nl = h264parse->nal_length_size; - - data[0] = 1; /* AVC Decoder Configuration Record ver. 1 */ - data[1] = profile_idc; /* profile_idc */ - data[2] = profile_comp; /* profile_compability */ - data[3] = level_idc; /* level_idc */ - data[4] = 0xfc | (nl - 1); /* nal_length_size_minus1 */ - data[5] = 0xe0 | num_sps; /* number of SPSs */ - - data += 6; - if (h264parse->format != GST_H264_PARSE_FORMAT_AVC3) { - for (i = 0; i < GST_H264_MAX_SPS_COUNT; i++) { - if ((nal = h264parse->sps_nals[i])) { - gsize nal_size = gst_buffer_get_size (nal); - GST_WRITE_UINT16_BE (data, nal_size); - gst_buffer_extract (nal, 0, data + 2, nal_size); - data += 2 + nal_size; - } - } - } - - data[0] = num_pps; - data++; - if (h264parse->format != GST_H264_PARSE_FORMAT_AVC3) { - for (i = 0; i < GST_H264_MAX_PPS_COUNT; i++) { - if ((nal = h264parse->pps_nals[i])) { - gsize nal_size = gst_buffer_get_size (nal); - GST_WRITE_UINT16_BE (data, nal_size); - gst_buffer_extract (nal, 0, data + 2, nal_size); - data += 2 + nal_size; - } - } - } - - gst_buffer_unmap (buf, &map); - - return buf; -} - -static void -gst_h264_parse_get_par (GstH264Parse * h264parse, gint * num, gint * den) -{ - if (h264parse->upstream_par_n != -1 && h264parse->upstream_par_d != -1) { - *num = h264parse->upstream_par_n; - *den = h264parse->upstream_par_d; - } else { - *num = h264parse->parsed_par_n; - *den = h264parse->parsed_par_d; - } -} - -static GstCaps * -get_compatible_profile_caps (GstH264SPS * sps) -{ - GstCaps *caps = NULL; - const gchar **profiles = NULL; - gint i; - GValue compat_profiles = G_VALUE_INIT; - g_value_init (&compat_profiles, GST_TYPE_LIST); - - switch (sps->profile_idc) { - case GST_H264_PROFILE_EXTENDED: - if (sps->constraint_set0_flag) { /* A.2.1 */ - if (sps->constraint_set1_flag) { - static const gchar *profile_array[] = - { "constrained-baseline", "baseline", "main", "high", - "high-10", "high-4:2:2", "high-4:4:4", NULL - }; - profiles = profile_array; - } else { - static const gchar *profile_array[] = { "baseline", NULL }; - profiles = profile_array; - } - } else if (sps->constraint_set1_flag) { /* A.2.2 */ - static const gchar *profile_array[] = - { "main", "high", "high-10", "high-4:2:2", "high-4:4:4", NULL }; - profiles = profile_array; - } - break; - case GST_H264_PROFILE_BASELINE: - if (sps->constraint_set1_flag) { /* A.2.1 */ - static const gchar *profile_array[] = - { "constrained-baseline", "main", "high", "high-10", "high-4:2:2", - "high-4:4:4", NULL - }; - profiles = profile_array; - } else { - static const gchar *profile_array[] = { "extended", NULL }; - profiles = profile_array; - } - break; - case GST_H264_PROFILE_MAIN: - { - static const gchar *profile_array[] = - { "high", "high-10", "high-4:2:2", "high-4:4:4", NULL }; - profiles = profile_array; - } - break; - case GST_H264_PROFILE_HIGH: - if (sps->constraint_set1_flag) { - static const gchar *profile_array[] = - { "main", "high-10", "high-4:2:2", "high-4:4:4", NULL }; - profiles = profile_array; - } else { - static const gchar *profile_array[] = - { "high-10", "high-4:2:2", "high-4:4:4", NULL }; - profiles = profile_array; - } - break; - case GST_H264_PROFILE_HIGH10: - if (sps->constraint_set1_flag) { - static const gchar *profile_array[] = - { "main", "high", "high-4:2:2", "high-4:4:4", NULL }; - profiles = profile_array; - } else { - if (sps->constraint_set3_flag) { /* A.2.8 */ - static const gchar *profile_array[] = - { "high-10", "high-4:2:2", "high-4:4:4", "high-4:2:2-intra", - "high-4:4:4-intra", NULL - }; - profiles = profile_array; - } else { - static const gchar *profile_array[] = - { "high-4:2:2", "high-4:4:4", NULL }; - profiles = profile_array; - } - } - break; - case GST_H264_PROFILE_HIGH_422: - if (sps->constraint_set1_flag) { - static const gchar *profile_array[] = - { "main", "high", "high-10", "high-4:4:4", NULL }; - profiles = profile_array; - } else { - if (sps->constraint_set3_flag) { /* A.2.9 */ - static const gchar *profile_array[] = - { "high-4:2:2", "high-4:4:4", "high-4:4:4-intra", NULL }; - profiles = profile_array; - } else { - static const gchar *profile_array[] = { "high-4:4:4", NULL }; - profiles = profile_array; - } - } - break; - case GST_H264_PROFILE_HIGH_444: - if (sps->constraint_set1_flag) { - static const gchar *profile_array[] = - { "main", "high", "high-10", "high-4:2:2", NULL }; - profiles = profile_array; - } else if (sps->constraint_set3_flag) { /* A.2.10 */ - static const gchar *profile_array[] = { "high-4:4:4", NULL }; - profiles = profile_array; - } - break; - case GST_H264_PROFILE_MULTIVIEW_HIGH: - if (sps->extension_type == GST_H264_NAL_EXTENSION_MVC - && sps->extension.mvc.num_views_minus1 == 1) { - static const gchar *profile_array[] = - { "stereo-high", "multiview-high", NULL }; - profiles = profile_array; - } else { - static const gchar *profile_array[] = { "multiview-high", NULL }; - profiles = profile_array; - } - break; - default: - break; - } - - if (profiles) { - GValue value = G_VALUE_INIT; - caps = gst_caps_new_empty_simple ("video/x-h264"); - for (i = 0; profiles[i]; i++) { - g_value_init (&value, G_TYPE_STRING); - g_value_set_string (&value, profiles[i]); - gst_value_list_append_value (&compat_profiles, &value); - g_value_unset (&value); - } - gst_caps_set_value (caps, "profile", &compat_profiles); - g_value_unset (&compat_profiles); - } - - return caps; -} - -/* if downstream didn't support the exact profile indicated in sps header, - * check for the compatible profiles also */ -static void -ensure_caps_profile (GstH264Parse * h264parse, GstCaps * caps, GstH264SPS * sps) -{ - GstCaps *filter_caps, *peer_caps, *compat_caps; - - filter_caps = gst_caps_new_empty_simple ("video/x-h264"); - peer_caps = - gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (h264parse), filter_caps); - - if (peer_caps && !gst_caps_can_intersect (caps, peer_caps)) { - GstStructure *structure; - - compat_caps = get_compatible_profile_caps (sps); - if (compat_caps != NULL) { - GstCaps *res_caps = NULL; - - res_caps = gst_caps_intersect (peer_caps, compat_caps); - - if (res_caps && !gst_caps_is_empty (res_caps)) { - const gchar *profile_str = NULL; - - res_caps = gst_caps_fixate (res_caps); - structure = gst_caps_get_structure (res_caps, 0); - profile_str = gst_structure_get_string (structure, "profile"); - if (profile_str) { - gst_caps_set_simple (caps, "profile", G_TYPE_STRING, profile_str, - NULL); - GST_DEBUG_OBJECT (h264parse, - "Setting compatible profile %s to the caps", profile_str); - } - } - if (res_caps) - gst_caps_unref (res_caps); - gst_caps_unref (compat_caps); - } - } - if (peer_caps) - gst_caps_unref (peer_caps); - gst_caps_unref (filter_caps); -} - -static const gchar * -digit_to_string (guint digit) -{ - static const char itoa[][2] = { - "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" - }; - - if (G_LIKELY (digit < 10)) - return itoa[digit]; - else - return NULL; -} - -static const gchar * -get_profile_string (GstH264SPS * sps) -{ - const gchar *profile = NULL; - - switch (sps->profile_idc) { - case 66: - if (sps->constraint_set1_flag) - profile = "constrained-baseline"; - else - profile = "baseline"; - break; - case 77: - profile = "main"; - break; - case 88: - profile = "extended"; - break; - case 100: - profile = "high"; - break; - case 110: - if (sps->constraint_set3_flag) - profile = "high-10-intra"; - else - profile = "high-10"; - break; - case 122: - if (sps->constraint_set3_flag) - profile = "high-4:2:2-intra"; - else - profile = "high-4:2:2"; - break; - case 244: - if (sps->constraint_set3_flag) - profile = "high-4:4:4-intra"; - else - profile = "high-4:4:4"; - break; - case 44: - profile = "cavlc-4:4:4-intra"; - break; - case 118: - profile = "multiview-high"; - break; - case 128: - profile = "stereo-high"; - break; - case 83: - if (sps->constraint_set5_flag) - profile = "scalable-constrained-baseline"; - else - profile = "scalable-baseline"; - break; - case 86: - profile = "scalable-high"; - break; - default: - return NULL; - } - - return profile; -} - -static const gchar * -get_level_string (GstH264SPS * sps) -{ - if ((sps->level_idc == 11 && sps->constraint_set3_flag) - || sps->level_idc == 9) - return "1b"; - else if (sps->level_idc % 10 == 0) - return digit_to_string (sps->level_idc / 10); - else { - switch (sps->level_idc) { - case 11: - return "1.1"; - case 12: - return "1.2"; - case 13: - return "1.3"; - case 21: - return "2.1"; - case 22: - return "2.2"; - case 31: - return "3.1"; - case 32: - return "3.2"; - case 41: - return "4.1"; - case 42: - return "4.2"; - case 51: - return "5.1"; - case 52: - return "5.2"; - default: - return NULL; - } - } -} - -static void -gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps) -{ - GstH264SPS *sps; - GstCaps *sink_caps, *src_caps; - gboolean modified = FALSE; - GstBuffer *buf = NULL; - GstStructure *s = NULL; - - if (G_UNLIKELY (!gst_pad_has_current_caps (GST_BASE_PARSE_SRC_PAD - (h264parse)))) - modified = TRUE; - else if (G_UNLIKELY (!h264parse->update_caps)) - return; - - /* if this is being called from the first _setcaps call, caps on the sinkpad - * aren't set yet and so they need to be passed as an argument */ - if (caps) - sink_caps = gst_caps_ref (caps); - else - sink_caps = gst_pad_get_current_caps (GST_BASE_PARSE_SINK_PAD (h264parse)); - - /* carry over input caps as much as possible; override with our own stuff */ - if (!sink_caps) - sink_caps = gst_caps_new_empty_simple ("video/x-h264"); - else - s = gst_caps_get_structure (sink_caps, 0); - - sps = h264parse->nalparser->last_sps; - GST_DEBUG_OBJECT (h264parse, "sps: %p", sps); - - /* only codec-data for nice-and-clean au aligned packetized avc format */ - if ((h264parse->format == GST_H264_PARSE_FORMAT_AVC - || h264parse->format == GST_H264_PARSE_FORMAT_AVC3) - && h264parse->align == GST_H264_PARSE_ALIGN_AU) { - buf = gst_h264_parse_make_codec_data (h264parse); - if (buf && h264parse->codec_data) { - GstMapInfo map; - - gst_buffer_map (buf, &map, GST_MAP_READ); - if (map.size != gst_buffer_get_size (h264parse->codec_data) || - gst_buffer_memcmp (h264parse->codec_data, 0, map.data, map.size)) - modified = TRUE; - - gst_buffer_unmap (buf, &map); - } else { - if (!buf && h264parse->codec_data_in) - buf = gst_buffer_ref (h264parse->codec_data_in); - modified = TRUE; - } - } - - caps = NULL; - if (G_UNLIKELY (!sps)) { - caps = gst_caps_copy (sink_caps); - } else { - gint crop_width, crop_height; - gint fps_num, fps_den; - gint par_n, par_d; - - if (sps->frame_cropping_flag) { - crop_width = sps->crop_rect_width; - crop_height = sps->crop_rect_height; - } else { - crop_width = sps->width; - crop_height = sps->height; - } - - if (G_UNLIKELY (h264parse->width != crop_width || - h264parse->height != crop_height)) { - GST_INFO_OBJECT (h264parse, "resolution changed %dx%d", - crop_width, crop_height); - h264parse->width = crop_width; - h264parse->height = crop_height; - modified = TRUE; - } - - /* 0/1 is set as the default in the codec parser, we will set - * it in case we have no info */ - gst_h264_video_calculate_framerate (sps, h264parse->field_pic_flag, - h264parse->sei_pic_struct, &fps_num, &fps_den); - if (G_UNLIKELY (h264parse->fps_num != fps_num - || h264parse->fps_den != fps_den)) { - GST_DEBUG_OBJECT (h264parse, "framerate changed %d/%d", fps_num, fps_den); - h264parse->fps_num = fps_num; - h264parse->fps_den = fps_den; - modified = TRUE; - } - - if (sps->vui_parameters.aspect_ratio_info_present_flag) { - if (G_UNLIKELY ((h264parse->parsed_par_n != sps->vui_parameters.par_n) - || (h264parse->parsed_par_d != sps->vui_parameters.par_d))) { - h264parse->parsed_par_n = sps->vui_parameters.par_n; - h264parse->parsed_par_d = sps->vui_parameters.par_d; - GST_INFO_OBJECT (h264parse, "pixel aspect ratio has been changed %d/%d", - h264parse->parsed_par_n, h264parse->parsed_par_d); - } - } - - if (G_UNLIKELY (modified || h264parse->update_caps)) { - gint width, height; - GstClockTime latency; - - const gchar *caps_mview_mode = NULL; - GstVideoMultiviewMode mview_mode = h264parse->multiview_mode; - GstVideoMultiviewFlags mview_flags = h264parse->multiview_flags; - - fps_num = h264parse->fps_num; - fps_den = h264parse->fps_den; - - caps = gst_caps_copy (sink_caps); - - /* sps should give this but upstream overrides */ - if (s && gst_structure_has_field (s, "width")) - gst_structure_get_int (s, "width", &width); - else - width = h264parse->width; - - if (s && gst_structure_has_field (s, "height")) - gst_structure_get_int (s, "height", &height); - else - height = h264parse->height; - - if (s == NULL || - !gst_structure_get_fraction (s, "pixel-aspect-ratio", &par_n, - &par_d)) { - gst_h264_parse_get_par (h264parse, &par_n, &par_d); - if (par_n != 0 && par_d != 0) { - GST_INFO_OBJECT (h264parse, "PAR %d/%d", par_n, par_d); - gst_caps_set_simple (caps, "pixel-aspect-ratio", GST_TYPE_FRACTION, - par_n, par_d, NULL); - } else { - /* Assume par_n/par_d of 1/1 for calcs below, but don't set into caps */ - par_n = par_d = 1; - } - } - - /* Pass through or set output stereo/multiview config */ - if (s && gst_structure_has_field (s, "multiview-mode")) { - caps_mview_mode = gst_structure_get_string (s, "multiview-mode"); - mview_mode = - gst_video_multiview_mode_from_caps_string (caps_mview_mode); - gst_structure_get_flagset (s, "multiview-flags", &mview_flags, NULL); - } else if (mview_mode != GST_VIDEO_MULTIVIEW_MODE_NONE) { - if (gst_video_multiview_guess_half_aspect (mview_mode, - width, height, par_n, par_d)) { - mview_flags |= GST_VIDEO_MULTIVIEW_FLAGS_HALF_ASPECT; - } - - caps_mview_mode = gst_video_multiview_mode_to_caps_string (mview_mode); - gst_caps_set_simple (caps, "multiview-mode", G_TYPE_STRING, - caps_mview_mode, "multiview-flags", - GST_TYPE_VIDEO_MULTIVIEW_FLAGSET, mview_flags, - GST_FLAG_SET_MASK_EXACT, NULL); - } - - gst_caps_set_simple (caps, "width", G_TYPE_INT, width, - "height", G_TYPE_INT, height, NULL); - - /* upstream overrides */ - if (s && gst_structure_has_field (s, "framerate")) - gst_structure_get_fraction (s, "framerate", &fps_num, &fps_den); - - /* but not necessarily or reliably this */ - if (fps_den > 0) { - gst_caps_set_simple (caps, "framerate", - GST_TYPE_FRACTION, fps_num, fps_den, NULL); - gst_base_parse_set_frame_rate (GST_BASE_PARSE (h264parse), - fps_num, fps_den, 0, 0); - if (fps_num > 0) { - latency = gst_util_uint64_scale (GST_SECOND, fps_den, fps_num); - gst_base_parse_set_latency (GST_BASE_PARSE (h264parse), latency, - latency); - } - } - } - } - - if (caps) { - gst_caps_set_simple (caps, "parsed", G_TYPE_BOOLEAN, TRUE, - "stream-format", G_TYPE_STRING, - gst_h264_parse_get_string (h264parse, TRUE, h264parse->format), - "alignment", G_TYPE_STRING, - gst_h264_parse_get_string (h264parse, FALSE, h264parse->align), NULL); - - /* set profile and level in caps */ - if (sps) { - const gchar *profile, *level; - - profile = get_profile_string (sps); - if (profile != NULL) - gst_caps_set_simple (caps, "profile", G_TYPE_STRING, profile, NULL); - - level = get_level_string (sps); - if (level != NULL) - gst_caps_set_simple (caps, "level", G_TYPE_STRING, level, NULL); - - /* relax the profile constraint to find a suitable decoder */ - ensure_caps_profile (h264parse, caps, sps); - } - - src_caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (h264parse)); - - if (src_caps - && gst_structure_has_field (gst_caps_get_structure (src_caps, 0), - "codec_data")) { - /* use codec data from old caps for comparison; we don't want to resend caps - if everything is same except codec data; */ - gst_caps_set_value (caps, "codec_data", - gst_structure_get_value (gst_caps_get_structure (src_caps, 0), - "codec_data")); - } - - if (!(src_caps && gst_caps_is_strictly_equal (src_caps, caps))) { - /* update codec data to new value */ - if (buf) { - gst_caps_set_simple (caps, "codec_data", GST_TYPE_BUFFER, buf, NULL); - gst_buffer_replace (&h264parse->codec_data, buf); - gst_buffer_unref (buf); - buf = NULL; - } else { - GstStructure *s; - /* remove any left-over codec-data hanging around */ - s = gst_caps_get_structure (caps, 0); - gst_structure_remove_field (s, "codec_data"); - gst_buffer_replace (&h264parse->codec_data, NULL); - } - - gst_pad_set_caps (GST_BASE_PARSE_SRC_PAD (h264parse), caps); - } - - if (src_caps) - gst_caps_unref (src_caps); - gst_caps_unref (caps); - } - - gst_caps_unref (sink_caps); - if (buf) - gst_buffer_unref (buf); -} - -static void -gst_h264_parse_get_timestamp (GstH264Parse * h264parse, - GstClockTime * out_ts, GstClockTime * out_dur, gboolean frame) -{ - GstH264SPS *sps = h264parse->nalparser->last_sps; - GstClockTime upstream; - gint duration = 1; - - g_return_if_fail (out_dur != NULL); - g_return_if_fail (out_ts != NULL); - - upstream = *out_ts; - - if (!frame) { - GST_LOG_OBJECT (h264parse, "no frame data -> 0 duration"); - *out_dur = 0; - goto exit; - } else { - *out_ts = upstream; - } - - if (!sps) { - GST_DEBUG_OBJECT (h264parse, "referred SPS invalid"); - goto exit; - } else if (!sps->vui_parameters_present_flag) { - GST_DEBUG_OBJECT (h264parse, - "unable to compute timestamp: VUI not present"); - goto exit; - } else if (!sps->vui_parameters.timing_info_present_flag) { - GST_DEBUG_OBJECT (h264parse, - "unable to compute timestamp: timing info not present"); - goto exit; - } else if (sps->vui_parameters.time_scale == 0) { - GST_DEBUG_OBJECT (h264parse, - "unable to compute timestamp: time_scale = 0 " - "(this is forbidden in spec; bitstream probably contains error)"); - goto exit; - } - - if (h264parse->sei_pic_struct_pres_flag && - h264parse->sei_pic_struct != (guint8) - 1) { - /* Note that when h264parse->sei_pic_struct == -1 (unspecified), there - * are ways to infer its value. This is related to computing the - * TopFieldOrderCnt and BottomFieldOrderCnt, which looks - * complicated and thus not implemented for the time being. Yet - * the value we have here is correct for many applications - */ - switch (h264parse->sei_pic_struct) { - case GST_H264_SEI_PIC_STRUCT_TOP_FIELD: - case GST_H264_SEI_PIC_STRUCT_BOTTOM_FIELD: - duration = 1; - break; - case GST_H264_SEI_PIC_STRUCT_FRAME: - case GST_H264_SEI_PIC_STRUCT_TOP_BOTTOM: - case GST_H264_SEI_PIC_STRUCT_BOTTOM_TOP: - duration = 2; - break; - case GST_H264_SEI_PIC_STRUCT_TOP_BOTTOM_TOP: - case GST_H264_SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM: - duration = 3; - break; - case GST_H264_SEI_PIC_STRUCT_FRAME_DOUBLING: - duration = 4; - break; - case GST_H264_SEI_PIC_STRUCT_FRAME_TRIPLING: - duration = 6; - break; - default: - GST_DEBUG_OBJECT (h264parse, - "h264parse->sei_pic_struct of unknown value %d. Not parsed", - h264parse->sei_pic_struct); - break; - } - } else { - duration = h264parse->field_pic_flag ? 1 : 2; - } - - GST_LOG_OBJECT (h264parse, "frame tick duration %d", duration); - - /* - * h264parse.264 C.1.2 Timing of coded picture removal (equivalent to DTS): - * Tr,n(0) = initial_cpb_removal_delay[ SchedSelIdx ] / 90000 - * Tr,n(n) = Tr,n(nb) + Tc * cpb_removal_delay(n) - * where - * Tc = num_units_in_tick / time_scale - */ - - if (h264parse->ts_trn_nb != GST_CLOCK_TIME_NONE) { - GST_LOG_OBJECT (h264parse, "buffering based ts"); - /* buffering period is present */ - if (upstream != GST_CLOCK_TIME_NONE) { - /* If upstream timestamp is valid, we respect it and adjust current - * reference point */ - h264parse->ts_trn_nb = upstream - - (GstClockTime) gst_util_uint64_scale_int - (h264parse->sei_cpb_removal_delay * GST_SECOND, - sps->vui_parameters.num_units_in_tick, - sps->vui_parameters.time_scale); - } else { - /* If no upstream timestamp is given, we write in new timestamp */ - upstream = h264parse->dts = h264parse->ts_trn_nb + - (GstClockTime) gst_util_uint64_scale_int - (h264parse->sei_cpb_removal_delay * GST_SECOND, - sps->vui_parameters.num_units_in_tick, - sps->vui_parameters.time_scale); - } - } else { - GstClockTime dur; - - GST_LOG_OBJECT (h264parse, "duration based ts"); - /* naive method: no removal delay specified - * track upstream timestamp and provide best guess frame duration */ - dur = gst_util_uint64_scale_int (duration * GST_SECOND, - sps->vui_parameters.num_units_in_tick, sps->vui_parameters.time_scale); - /* sanity check */ - if (dur < GST_MSECOND) { - GST_DEBUG_OBJECT (h264parse, "discarding dur %" GST_TIME_FORMAT, - GST_TIME_ARGS (dur)); - } else { - *out_dur = dur; - } - } - -exit: - if (GST_CLOCK_TIME_IS_VALID (upstream)) - *out_ts = h264parse->dts = upstream; - - if (GST_CLOCK_TIME_IS_VALID (*out_dur) && - GST_CLOCK_TIME_IS_VALID (h264parse->dts)) - h264parse->dts += *out_dur; -} - -static GstFlowReturn -gst_h264_parse_parse_frame (GstBaseParse * parse, GstBaseParseFrame * frame) -{ - GstH264Parse *h264parse; - GstBuffer *buffer; - guint av; - - h264parse = GST_H264_PARSE (parse); - buffer = frame->buffer; - - gst_h264_parse_update_src_caps (h264parse, NULL); - - /* don't mess with timestamps if provided by upstream, - * particularly since our ts not that good they handle seeking etc */ - if (h264parse->do_ts) - gst_h264_parse_get_timestamp (h264parse, - &GST_BUFFER_TIMESTAMP (buffer), &GST_BUFFER_DURATION (buffer), - h264parse->frame_start); - - if (h264parse->keyframe) - GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_DELTA_UNIT); - else - GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DELTA_UNIT); - - if (h264parse->header) - GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_HEADER); - else - GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_HEADER); - - if (h264parse->discont) { - GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DISCONT); - h264parse->discont = FALSE; - } - - /* replace with transformed AVC output if applicable */ - av = gst_adapter_available (h264parse->frame_out); - if (av) { - GstBuffer *buf; - - buf = gst_adapter_take_buffer (h264parse->frame_out, av); - gst_buffer_copy_into (buf, buffer, GST_BUFFER_COPY_METADATA, 0, -1); - gst_buffer_replace (&frame->out_buffer, buf); - gst_buffer_unref (buf); - } - - return GST_FLOW_OK; -} - -/* sends a codec NAL downstream, decorating and transforming as needed. - * No ownership is taken of @nal */ -static GstFlowReturn -gst_h264_parse_push_codec_buffer (GstH264Parse * h264parse, - GstBuffer * nal, GstClockTime ts) -{ - GstMapInfo map; - - gst_buffer_map (nal, &map, GST_MAP_READ); - nal = gst_h264_parse_wrap_nal (h264parse, h264parse->format, - map.data, map.size); - gst_buffer_unmap (nal, &map); - - GST_BUFFER_TIMESTAMP (nal) = ts; - GST_BUFFER_DURATION (nal) = 0; - - return gst_pad_push (GST_BASE_PARSE_SRC_PAD (h264parse), nal); -} - -static GstEvent * -check_pending_key_unit_event (GstEvent * pending_event, - GstSegment * segment, GstClockTime timestamp, guint flags, - GstClockTime pending_key_unit_ts) -{ - GstClockTime running_time, stream_time; - gboolean all_headers; - guint count; - GstEvent *event = NULL; - - g_return_val_if_fail (segment != NULL, NULL); - - if (pending_event == NULL) - goto out; - - if (GST_CLOCK_TIME_IS_VALID (pending_key_unit_ts) && - timestamp == GST_CLOCK_TIME_NONE) - goto out; - - running_time = gst_segment_to_running_time (segment, - GST_FORMAT_TIME, timestamp); - - GST_INFO ("now %" GST_TIME_FORMAT " wanted %" GST_TIME_FORMAT, - GST_TIME_ARGS (running_time), GST_TIME_ARGS (pending_key_unit_ts)); - if (GST_CLOCK_TIME_IS_VALID (pending_key_unit_ts) && - running_time < pending_key_unit_ts) - goto out; - - if (flags & GST_BUFFER_FLAG_DELTA_UNIT) { - GST_DEBUG ("pending force key unit, waiting for keyframe"); - goto out; - } - - stream_time = gst_segment_to_stream_time (segment, - GST_FORMAT_TIME, timestamp); - - gst_video_event_parse_upstream_force_key_unit (pending_event, - NULL, &all_headers, &count); - - event = - gst_video_event_new_downstream_force_key_unit (timestamp, stream_time, - running_time, all_headers, count); - gst_event_set_seqnum (event, gst_event_get_seqnum (pending_event)); - -out: - return event; -} - -static void -gst_h264_parse_prepare_key_unit (GstH264Parse * parse, GstEvent * event) -{ - GstClockTime running_time; - guint count; -#ifndef GST_DISABLE_GST_DEBUG - gboolean have_sps, have_pps; - gint i; -#endif - - parse->pending_key_unit_ts = GST_CLOCK_TIME_NONE; - gst_event_replace (&parse->force_key_unit_event, NULL); - - gst_video_event_parse_downstream_force_key_unit (event, - NULL, NULL, &running_time, NULL, &count); - - GST_INFO_OBJECT (parse, "pushing downstream force-key-unit event %d " - "%" GST_TIME_FORMAT " count %d", gst_event_get_seqnum (event), - GST_TIME_ARGS (running_time), count); - gst_pad_push_event (GST_BASE_PARSE_SRC_PAD (parse), event); - -#ifndef GST_DISABLE_GST_DEBUG - have_sps = have_pps = FALSE; - for (i = 0; i < GST_H264_MAX_SPS_COUNT; i++) { - if (parse->sps_nals[i] != NULL) { - have_sps = TRUE; - break; - } - } - for (i = 0; i < GST_H264_MAX_PPS_COUNT; i++) { - if (parse->pps_nals[i] != NULL) { - have_pps = TRUE; - break; - } - } - - GST_INFO_OBJECT (parse, "preparing key unit, have sps %d have pps %d", - have_sps, have_pps); -#endif - - /* set push_codec to TRUE so that pre_push_frame sends SPS/PPS again */ - parse->push_codec = TRUE; -} - -static GstFlowReturn -gst_h264_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) -{ - GstH264Parse *h264parse; - GstBuffer *buffer; - GstEvent *event; - - h264parse = GST_H264_PARSE (parse); - - if (!h264parse->sent_codec_tag) { - GstTagList *taglist; - GstCaps *caps; - - taglist = gst_tag_list_new_empty (); - - /* codec tag */ - caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (parse)); - if (caps == NULL) { - if (GST_PAD_IS_FLUSHING (GST_BASE_PARSE_SRC_PAD (h264parse))) { - GST_INFO_OBJECT (h264parse, "Src pad is flushing"); - return GST_FLOW_FLUSHING; - } else { - GST_INFO_OBJECT (h264parse, "Src pad is not negotiated!"); - return GST_FLOW_NOT_NEGOTIATED; - } - } - gst_pb_utils_add_codec_description_to_tag_list (taglist, - GST_TAG_VIDEO_CODEC, caps); - gst_caps_unref (caps); - - gst_base_parse_merge_tags (parse, taglist, GST_TAG_MERGE_REPLACE); - gst_tag_list_unref (taglist); - - /* also signals the end of first-frame processing */ - h264parse->sent_codec_tag = TRUE; - } - - buffer = frame->buffer; - - if ((event = check_pending_key_unit_event (h264parse->force_key_unit_event, - &parse->segment, GST_BUFFER_TIMESTAMP (buffer), - GST_BUFFER_FLAGS (buffer), h264parse->pending_key_unit_ts))) { - gst_h264_parse_prepare_key_unit (h264parse, event); - } - - /* periodic SPS/PPS sending */ - if (h264parse->interval > 0 || h264parse->push_codec) { - GstClockTime timestamp = GST_BUFFER_TIMESTAMP (buffer); - guint64 diff; - gboolean initial_frame = FALSE; - - /* init */ - if (!GST_CLOCK_TIME_IS_VALID (h264parse->last_report)) { - h264parse->last_report = timestamp; - initial_frame = TRUE; - } - - if (h264parse->idr_pos >= 0) { - GST_LOG_OBJECT (h264parse, "IDR nal at offset %d", h264parse->idr_pos); - - if (timestamp > h264parse->last_report) - diff = timestamp - h264parse->last_report; - else - diff = 0; - - GST_LOG_OBJECT (h264parse, - "now %" GST_TIME_FORMAT ", last SPS/PPS %" GST_TIME_FORMAT, - GST_TIME_ARGS (timestamp), GST_TIME_ARGS (h264parse->last_report)); - - GST_DEBUG_OBJECT (h264parse, - "interval since last SPS/PPS %" GST_TIME_FORMAT, - GST_TIME_ARGS (diff)); - - if (GST_TIME_AS_SECONDS (diff) >= h264parse->interval || - initial_frame || h264parse->push_codec) { - GstBuffer *codec_nal; - gint i; - GstClockTime new_ts; - - /* avoid overwriting a perfectly fine timestamp */ - new_ts = GST_CLOCK_TIME_IS_VALID (timestamp) ? timestamp : - h264parse->last_report; - - if (h264parse->align == GST_H264_PARSE_ALIGN_NAL) { - /* send separate config NAL buffers */ - GST_DEBUG_OBJECT (h264parse, "- sending SPS/PPS"); - for (i = 0; i < GST_H264_MAX_SPS_COUNT; i++) { - if ((codec_nal = h264parse->sps_nals[i])) { - GST_DEBUG_OBJECT (h264parse, "sending SPS nal"); - gst_h264_parse_push_codec_buffer (h264parse, codec_nal, - timestamp); - h264parse->last_report = new_ts; - } - } - for (i = 0; i < GST_H264_MAX_PPS_COUNT; i++) { - if ((codec_nal = h264parse->pps_nals[i])) { - GST_DEBUG_OBJECT (h264parse, "sending PPS nal"); - gst_h264_parse_push_codec_buffer (h264parse, codec_nal, - timestamp); - h264parse->last_report = new_ts; - } - } - } else { - /* insert config NALs into AU */ - GstByteWriter bw; - GstBuffer *new_buf; - const gboolean bs = h264parse->format == GST_H264_PARSE_FORMAT_BYTE; - const gint nls = 4 - h264parse->nal_length_size; - gboolean ok; - - gst_byte_writer_init_with_size (&bw, gst_buffer_get_size (buffer), - FALSE); - ok = gst_byte_writer_put_buffer (&bw, buffer, 0, h264parse->idr_pos); - GST_DEBUG_OBJECT (h264parse, "- inserting SPS/PPS"); - for (i = 0; i < GST_H264_MAX_SPS_COUNT; i++) { - if ((codec_nal = h264parse->sps_nals[i])) { - gsize nal_size = gst_buffer_get_size (codec_nal); - GST_DEBUG_OBJECT (h264parse, "inserting SPS nal"); - if (bs) { - ok &= gst_byte_writer_put_uint32_be (&bw, 1); - } else { - ok &= gst_byte_writer_put_uint32_be (&bw, - (nal_size << (nls * 8))); - ok &= gst_byte_writer_set_pos (&bw, - gst_byte_writer_get_pos (&bw) - nls); - } - - ok &= gst_byte_writer_put_buffer (&bw, codec_nal, 0, nal_size); - h264parse->last_report = new_ts; - } - } - for (i = 0; i < GST_H264_MAX_PPS_COUNT; i++) { - if ((codec_nal = h264parse->pps_nals[i])) { - gsize nal_size = gst_buffer_get_size (codec_nal); - GST_DEBUG_OBJECT (h264parse, "inserting PPS nal"); - if (bs) { - ok &= gst_byte_writer_put_uint32_be (&bw, 1); - } else { - ok &= gst_byte_writer_put_uint32_be (&bw, - (nal_size << (nls * 8))); - ok &= gst_byte_writer_set_pos (&bw, - gst_byte_writer_get_pos (&bw) - nls); - } - ok &= gst_byte_writer_put_buffer (&bw, codec_nal, 0, nal_size); - h264parse->last_report = new_ts; - } - } - ok &= - gst_byte_writer_put_buffer (&bw, buffer, h264parse->idr_pos, -1); - /* collect result and push */ - new_buf = gst_byte_writer_reset_and_get_buffer (&bw); - gst_buffer_copy_into (new_buf, buffer, GST_BUFFER_COPY_METADATA, 0, - -1); - /* should already be keyframe/IDR, but it may not have been, - * so mark it as such to avoid being discarded by picky decoder */ - GST_BUFFER_FLAG_UNSET (new_buf, GST_BUFFER_FLAG_DELTA_UNIT); - gst_buffer_replace (&frame->out_buffer, new_buf); - gst_buffer_unref (new_buf); - /* some result checking seems to make some compilers happy */ - if (G_UNLIKELY (!ok)) { - GST_ERROR_OBJECT (h264parse, "failed to insert SPS/PPS"); - } - } - } - /* we pushed whatever we had */ - h264parse->push_codec = FALSE; - h264parse->have_sps = FALSE; - h264parse->have_pps = FALSE; - h264parse->state &= GST_H264_PARSE_STATE_VALID_PICTURE_HEADERS; - } - } - - /* If SPS/PPS and a keyframe have been parsed, and we're not converting, - * we might switch to passthrough mode now on the basis that we've seen - * the SEI packets and know optional caps params (such as multiview). - * This is an efficiency optimisation that relies on stream properties - * remaining uniform in practice. */ - if (h264parse->can_passthrough) { - if (h264parse->keyframe && h264parse->have_sps && h264parse->have_pps) { - GST_LOG_OBJECT (parse, "Switching to passthrough mode"); - gst_base_parse_set_passthrough (parse, TRUE); - } - } - - gst_h264_parse_reset_frame (h264parse); - - return GST_FLOW_OK; -} - -static gboolean -gst_h264_parse_set_caps (GstBaseParse * parse, GstCaps * caps) -{ - GstH264Parse *h264parse; - GstStructure *str; - const GValue *codec_data_value; - GstBuffer *codec_data = NULL; - gsize size; - guint format, align, off; - GstH264NalUnit nalu; - GstH264ParserResult parseres; - GstCaps *old_caps; - - h264parse = GST_H264_PARSE (parse); - - /* reset */ - h264parse->push_codec = FALSE; - - old_caps = gst_pad_get_current_caps (GST_BASE_PARSE_SINK_PAD (parse)); - if (old_caps) { - if (!gst_caps_is_equal (old_caps, caps)) - gst_h264_parse_reset_stream_info (h264parse); - gst_caps_unref (old_caps); - } - - str = gst_caps_get_structure (caps, 0); - - /* accept upstream info if provided */ - gst_structure_get_int (str, "width", &h264parse->width); - gst_structure_get_int (str, "height", &h264parse->height); - gst_structure_get_fraction (str, "framerate", &h264parse->fps_num, - &h264parse->fps_den); - gst_structure_get_fraction (str, "pixel-aspect-ratio", - &h264parse->upstream_par_n, &h264parse->upstream_par_d); - - /* get upstream format and align from caps */ - gst_h264_parse_format_from_caps (caps, &format, &align); - - codec_data_value = gst_structure_get_value (str, "codec_data"); - - /* fix up caps without stream-format for max. backwards compatibility */ - if (format == GST_H264_PARSE_FORMAT_NONE) { - /* codec_data implies avc */ - if (codec_data_value != NULL) { - GST_ERROR ("video/x-h264 caps with codec_data but no stream-format=avc"); - format = GST_H264_PARSE_FORMAT_AVC; - } else { - /* otherwise assume bytestream input */ - GST_ERROR ("video/x-h264 caps without codec_data or stream-format"); - format = GST_H264_PARSE_FORMAT_BYTE; - } - } - - /* avc caps sanity checks */ - if (format == GST_H264_PARSE_FORMAT_AVC) { - /* AVC requires codec_data, AVC3 might have one and/or SPS/PPS inline */ - if (codec_data_value == NULL) - goto avc_caps_codec_data_missing; - - /* AVC implies alignment=au, everything else is not allowed */ - if (align == GST_H264_PARSE_ALIGN_NONE) - align = GST_H264_PARSE_ALIGN_AU; - else if (align != GST_H264_PARSE_ALIGN_AU) - goto avc_caps_wrong_alignment; - } - - /* bytestream caps sanity checks */ - if (format == GST_H264_PARSE_FORMAT_BYTE) { - /* should have SPS/PSS in-band (and/or oob in streamheader field) */ - if (codec_data_value != NULL) - goto bytestream_caps_with_codec_data; - } - - /* packetized video has codec_data (required for AVC, optional for AVC3) */ - if (codec_data_value != NULL) { - GstMapInfo map; - guint8 *data; - guint num_sps, num_pps; -#ifndef GST_DISABLE_GST_DEBUG - guint profile; -#endif - gint i; - - GST_DEBUG_OBJECT (h264parse, "have packetized h264"); - /* make note for optional split processing */ - h264parse->packetized = TRUE; - - /* codec_data field should hold a buffer */ - if (!GST_VALUE_HOLDS_BUFFER (codec_data_value)) - goto avc_caps_codec_data_wrong_type; - - codec_data = gst_value_get_buffer (codec_data_value); - if (!codec_data) - goto avc_caps_codec_data_missing; - gst_buffer_map (codec_data, &map, GST_MAP_READ); - data = map.data; - size = map.size; - - /* parse the avcC data */ - if (size < 7) { /* when numSPS==0 and numPPS==0, length is 7 bytes */ - gst_buffer_unmap (codec_data, &map); - goto avcc_too_small; - } - /* parse the version, this must be 1 */ - if (data[0] != 1) { - gst_buffer_unmap (codec_data, &map); - goto wrong_version; - } -#ifndef GST_DISABLE_GST_DEBUG - /* AVCProfileIndication */ - /* profile_compat */ - /* AVCLevelIndication */ - profile = (data[1] << 16) | (data[2] << 8) | data[3]; - GST_DEBUG_OBJECT (h264parse, "profile %06x", profile); -#endif - - /* 6 bits reserved | 2 bits lengthSizeMinusOne */ - /* this is the number of bytes in front of the NAL units to mark their - * length */ - h264parse->nal_length_size = (data[4] & 0x03) + 1; - GST_DEBUG_OBJECT (h264parse, "nal length size %u", - h264parse->nal_length_size); - - num_sps = data[5] & 0x1f; - off = 6; - for (i = 0; i < num_sps; i++) { - parseres = gst_h264_parser_identify_nalu_avc (h264parse->nalparser, - data, off, size, 2, &nalu); - if (parseres != GST_H264_PARSER_OK) { - gst_buffer_unmap (codec_data, &map); - goto avcc_too_small; - } - - gst_h264_parse_process_nal (h264parse, &nalu); - off = nalu.offset + nalu.size; - } - - num_pps = data[off]; - off++; - - for (i = 0; i < num_pps; i++) { - parseres = gst_h264_parser_identify_nalu_avc (h264parse->nalparser, - data, off, size, 2, &nalu); - if (parseres != GST_H264_PARSER_OK) { - gst_buffer_unmap (codec_data, &map); - goto avcc_too_small; - } - - gst_h264_parse_process_nal (h264parse, &nalu); - off = nalu.offset + nalu.size; - } - - gst_buffer_unmap (codec_data, &map); - - gst_buffer_replace (&h264parse->codec_data_in, codec_data); - } else if (format == GST_H264_PARSE_FORMAT_BYTE) { - GST_DEBUG_OBJECT (h264parse, "have bytestream h264"); - /* nothing to pre-process */ - h264parse->packetized = FALSE; - /* we have 4 sync bytes */ - h264parse->nal_length_size = 4; - } else { - /* probably AVC3 without codec_data field, anything to do here? */ - } - - { - GstCaps *in_caps; - - /* prefer input type determined above */ - in_caps = gst_caps_new_simple ("video/x-h264", - "parsed", G_TYPE_BOOLEAN, TRUE, - "stream-format", G_TYPE_STRING, - gst_h264_parse_get_string (h264parse, TRUE, format), - "alignment", G_TYPE_STRING, - gst_h264_parse_get_string (h264parse, FALSE, align), NULL); - /* negotiate with downstream, sets ->format and ->align */ - gst_h264_parse_negotiate (h264parse, format, in_caps); - gst_caps_unref (in_caps); - } - - if (format == h264parse->format && align == h264parse->align) { - /* we did parse codec-data and might supplement src caps */ - gst_h264_parse_update_src_caps (h264parse, caps); - } else if (format == GST_H264_PARSE_FORMAT_AVC - || format == GST_H264_PARSE_FORMAT_AVC3) { - /* if input != output, and input is avc, must split before anything else */ - /* arrange to insert codec-data in-stream if needed. - * src caps are only arranged for later on */ - h264parse->push_codec = TRUE; - h264parse->have_sps = FALSE; - h264parse->have_pps = FALSE; - if (h264parse->align == GST_H264_PARSE_ALIGN_NAL) - h264parse->split_packetized = TRUE; - h264parse->packetized = TRUE; - } - - return TRUE; - - /* ERRORS */ -avc_caps_codec_data_wrong_type: - { - GST_WARNING_OBJECT (parse, "H.264 AVC caps, codec_data field not a buffer"); - goto refuse_caps; - } -avc_caps_codec_data_missing: - { - GST_WARNING_OBJECT (parse, "H.264 AVC caps, but no codec_data"); - goto refuse_caps; - } -avc_caps_wrong_alignment: - { - GST_WARNING_OBJECT (parse, "H.264 AVC caps with NAL alignment, must be AU"); - goto refuse_caps; - } -bytestream_caps_with_codec_data: - { - GST_WARNING_OBJECT (parse, "H.264 bytestream caps with codec_data is not " - "expected, send SPS/PPS in-band with data or in streamheader field"); - goto refuse_caps; - } -avcc_too_small: - { - GST_DEBUG_OBJECT (h264parse, "avcC size %" G_GSIZE_FORMAT " < 8", size); - goto refuse_caps; - } -wrong_version: - { - GST_DEBUG_OBJECT (h264parse, "wrong avcC version"); - goto refuse_caps; - } -refuse_caps: - { - GST_WARNING_OBJECT (h264parse, "refused caps %" GST_PTR_FORMAT, caps); - return FALSE; - } -} - -static void -remove_fields (GstCaps * caps) -{ - guint i, n; - - n = gst_caps_get_size (caps); - for (i = 0; i < n; i++) { - GstStructure *s = gst_caps_get_structure (caps, i); - - gst_structure_remove_field (s, "alignment"); - gst_structure_remove_field (s, "stream-format"); - gst_structure_remove_field (s, "parsed"); - } -} - -static GstCaps * -gst_h264_parse_get_caps (GstBaseParse * parse, GstCaps * filter) -{ - GstCaps *peercaps, *templ; - GstCaps *res; - - templ = gst_pad_get_pad_template_caps (GST_BASE_PARSE_SINK_PAD (parse)); - if (filter) { - GstCaps *fcopy = gst_caps_copy (filter); - /* Remove the fields we convert */ - remove_fields (fcopy); - peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), fcopy); - gst_caps_unref (fcopy); - } else - peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), NULL); - - if (peercaps) { - peercaps = gst_caps_make_writable (peercaps); - remove_fields (peercaps); - - res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST); - gst_caps_unref (peercaps); - gst_caps_unref (templ); - } else { - res = templ; - } - - if (filter) { - GstCaps *tmp = gst_caps_intersect_full (res, filter, - GST_CAPS_INTERSECT_FIRST); - gst_caps_unref (res); - res = tmp; - } - - return res; -} - -static gboolean -gst_h264_parse_event (GstBaseParse * parse, GstEvent * event) -{ - gboolean res; - GstH264Parse *h264parse = GST_H264_PARSE (parse); - - switch (GST_EVENT_TYPE (event)) { - case GST_EVENT_CUSTOM_DOWNSTREAM: - { - GstClockTime timestamp, stream_time, running_time; - gboolean all_headers; - guint count; - - if (gst_video_event_is_force_key_unit (event)) { - gst_video_event_parse_downstream_force_key_unit (event, - ×tamp, &stream_time, &running_time, &all_headers, &count); - - GST_INFO_OBJECT (h264parse, - "received downstream force key unit event, " - "seqnum %d running_time %" GST_TIME_FORMAT - " all_headers %d count %d", gst_event_get_seqnum (event), - GST_TIME_ARGS (running_time), all_headers, count); - if (h264parse->force_key_unit_event) { - GST_INFO_OBJECT (h264parse, "ignoring force key unit event " - "as one is already queued"); - } else { - h264parse->pending_key_unit_ts = running_time; - gst_event_replace (&h264parse->force_key_unit_event, event); - } - gst_event_unref (event); - res = TRUE; - } else { - res = GST_BASE_PARSE_CLASS (parent_class)->sink_event (parse, event); - break; - } - break; - } - case GST_EVENT_FLUSH_STOP: - h264parse->dts = GST_CLOCK_TIME_NONE; - h264parse->ts_trn_nb = GST_CLOCK_TIME_NONE; - - res = GST_BASE_PARSE_CLASS (parent_class)->sink_event (parse, event); - break; - case GST_EVENT_SEGMENT: - { - const GstSegment *segment; - - gst_event_parse_segment (event, &segment); - /* don't try to mess with more subtle cases (e.g. seek) */ - if (segment->format == GST_FORMAT_TIME && - (segment->start != 0 || segment->rate != 1.0 - || segment->applied_rate != 1.0)) - h264parse->do_ts = FALSE; - - h264parse->last_report = GST_CLOCK_TIME_NONE; - - res = GST_BASE_PARSE_CLASS (parent_class)->sink_event (parse, event); - break; - } - default: - res = GST_BASE_PARSE_CLASS (parent_class)->sink_event (parse, event); - break; - } - return res; -} - -static gboolean -gst_h264_parse_src_event (GstBaseParse * parse, GstEvent * event) -{ - gboolean res; - GstH264Parse *h264parse = GST_H264_PARSE (parse); - - switch (GST_EVENT_TYPE (event)) { - case GST_EVENT_CUSTOM_UPSTREAM: - { - GstClockTime running_time; - gboolean all_headers; - guint count; - - if (gst_video_event_is_force_key_unit (event)) { - gst_video_event_parse_upstream_force_key_unit (event, - &running_time, &all_headers, &count); - - GST_INFO_OBJECT (h264parse, "received upstream force-key-unit event, " - "seqnum %d running_time %" GST_TIME_FORMAT - " all_headers %d count %d", gst_event_get_seqnum (event), - GST_TIME_ARGS (running_time), all_headers, count); - - if (all_headers) { - h264parse->pending_key_unit_ts = running_time; - gst_event_replace (&h264parse->force_key_unit_event, event); - } - } - res = GST_BASE_PARSE_CLASS (parent_class)->src_event (parse, event); - break; - } - default: - res = GST_BASE_PARSE_CLASS (parent_class)->src_event (parse, event); - break; - } - - return res; -} - -static void -gst_h264_parse_set_property (GObject * object, guint prop_id, - const GValue * value, GParamSpec * pspec) -{ - GstH264Parse *parse; - - parse = GST_H264_PARSE (object); - - switch (prop_id) { - case PROP_CONFIG_INTERVAL: - parse->interval = g_value_get_uint (value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -gst_h264_parse_get_property (GObject * object, guint prop_id, - GValue * value, GParamSpec * pspec) -{ - GstH264Parse *parse; - - parse = GST_H264_PARSE (object); - - switch (prop_id) { - case PROP_CONFIG_INTERVAL: - g_value_set_uint (value, parse->interval); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst/videoparsers/gsth264parse.h gstreamer-vaapi-1.8.2/ext/codecparsers/gst/videoparsers/gsth264parse.h --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst/videoparsers/gsth264parse.h 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst/videoparsers/gsth264parse.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,138 +0,0 @@ -/* GStreamer H.264 Parser - * Copyright (C) <2010> Collabora ltd - * Copyright (C) <2010> Nokia Corporation - * Copyright (C) <2011> Intel Corporation - * - * Copyright (C) <2010> Mark Nauwelaerts - * Copyright (C) <2011> Thibault Saunier - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef __GST_H264_PARSE_H__ -#define __GST_H264_PARSE_H__ - -#include -#include -#include -#include - -G_BEGIN_DECLS - -typedef struct _H264Params H264Params; - -#define GST_TYPE_H264_PARSE \ - (gst_h264_parse_get_type()) -#define GST_H264_PARSE(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_H264_PARSE,GstH264Parse)) -#define GST_H264_PARSE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_H264_PARSE,GstH264ParseClass)) -#define GST_IS_H264_PARSE(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_H264_PARSE)) -#define GST_IS_H264_PARSE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_H264_PARSE)) - -GType gst_h264_parse_get_type (void); - -typedef struct _GstH264Parse GstH264Parse; -typedef struct _GstH264ParseClass GstH264ParseClass; - -struct _GstH264Parse -{ - GstBaseParse baseparse; - - /* stream */ - gint width, height; - gint fps_num, fps_den; - gint upstream_par_n, upstream_par_d; - gint parsed_par_n, parsed_par_d; - /* current codec_data in output caps, if any */ - GstBuffer *codec_data; - /* input codec_data, if any */ - GstBuffer *codec_data_in; - guint nal_length_size; - gboolean packetized; - gboolean split_packetized; - gboolean transform; - - /* state */ - GstH264NalParser *nalparser; - guint state; - guint align; - guint format; - gint current_off; - /* True if input format and alignment match negotiated output */ - gboolean can_passthrough; - - GstClockTime last_report; - gboolean push_codec; - /* The following variables have a meaning in context of "have - * SPS/PPS to push downstream", e.g. to update caps */ - gboolean have_sps; - gboolean have_pps; - - gboolean sent_codec_tag; - - /* collected SPS and PPS NALUs */ - GstBuffer *sps_nals[GST_H264_MAX_SPS_COUNT]; - GstBuffer *pps_nals[GST_H264_MAX_PPS_COUNT]; - - /* Infos we need to keep track of */ - guint32 sei_cpb_removal_delay; - guint8 sei_pic_struct; - guint8 sei_pic_struct_pres_flag; - guint field_pic_flag; - - /* cached timestamps */ - /* (trying to) track upstream dts and interpolate */ - GstClockTime dts; - /* dts at start of last buffering period */ - GstClockTime ts_trn_nb; - gboolean do_ts; - - gboolean discont; - - /* frame parsing */ - /*guint last_nal_pos;*/ - /*guint next_sc_pos;*/ - gint idr_pos, sei_pos; - gboolean update_caps; - GstAdapter *frame_out; - gboolean keyframe; - gboolean header; - gboolean frame_start; - /* AU state */ - gboolean picture_start; - - /* props */ - guint interval; - - GstClockTime pending_key_unit_ts; - GstEvent *force_key_unit_event; - - /* Stereo / multiview info */ - GstVideoMultiviewMode multiview_mode; - GstVideoMultiviewFlags multiview_flags; - gboolean first_in_bundle; -}; - -struct _GstH264ParseClass -{ - GstBaseParseClass parent_class; -}; - -G_END_DECLS -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst/videoparsers/gsth265parse.c gstreamer-vaapi-1.8.2/ext/codecparsers/gst/videoparsers/gsth265parse.c --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst/videoparsers/gsth265parse.c 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst/videoparsers/gsth265parse.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2276 +0,0 @@ -/* GStreamer H.265 Parser - * Copyright (C) 2013 Intel Corporation - * Contact:Sreerenj Balachandran - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include -#include -#include "gsth265parse.h" - -#include - -GST_DEBUG_CATEGORY (h265_parse_debug); -#define GST_CAT_DEFAULT h265_parse_debug - -#define DEFAULT_CONFIG_INTERVAL (0) - -enum -{ - PROP_0, - PROP_CONFIG_INTERVAL -}; - -enum -{ - GST_H265_PARSE_FORMAT_NONE, - GST_H265_PARSE_FORMAT_HVC1, - GST_H265_PARSE_FORMAT_HEV1, - GST_H265_PARSE_FORMAT_BYTE -}; - -enum -{ - GST_H265_PARSE_ALIGN_NONE = 0, - GST_H265_PARSE_ALIGN_NAL, - GST_H265_PARSE_ALIGN_AU -}; - -static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", - GST_PAD_SINK, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ("video/x-h265")); - -static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", - GST_PAD_SRC, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ("video/x-h265, parsed = (boolean) true, " - "stream-format=(string) { hvc1, hev1, byte-stream }, " - "alignment=(string) { au, nal }")); - -#define parent_class gst_h265_parse_parent_class -G_DEFINE_TYPE (GstH265Parse, gst_h265_parse, GST_TYPE_BASE_PARSE); - -static void gst_h265_parse_finalize (GObject * object); - -static gboolean gst_h265_parse_start (GstBaseParse * parse); -static gboolean gst_h265_parse_stop (GstBaseParse * parse); -static GstFlowReturn gst_h265_parse_handle_frame (GstBaseParse * parse, - GstBaseParseFrame * frame, gint * skipsize); -static GstFlowReturn gst_h265_parse_parse_frame (GstBaseParse * parse, - GstBaseParseFrame * frame); -static GstFlowReturn gst_h265_parse_pre_push_frame (GstBaseParse * parse, - GstBaseParseFrame * frame); - -static void gst_h265_parse_set_property (GObject * object, guint prop_id, - const GValue * value, GParamSpec * pspec); -static void gst_h265_parse_get_property (GObject * object, guint prop_id, - GValue * value, GParamSpec * pspec); - -static gboolean gst_h265_parse_set_caps (GstBaseParse * parse, GstCaps * caps); -static GstCaps *gst_h265_parse_get_caps (GstBaseParse * parse, - GstCaps * filter); -static gboolean gst_h265_parse_event (GstBaseParse * parse, GstEvent * event); -static gboolean gst_h265_parse_src_event (GstBaseParse * parse, - GstEvent * event); - -static void -gst_h265_parse_class_init (GstH265ParseClass * klass) -{ - GObjectClass *gobject_class = (GObjectClass *) klass; - GstBaseParseClass *parse_class = GST_BASE_PARSE_CLASS (klass); - GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); - - GST_DEBUG_CATEGORY_INIT (h265_parse_debug, "h265parse", 0, "h265 parser"); - - gobject_class->finalize = gst_h265_parse_finalize; - gobject_class->set_property = gst_h265_parse_set_property; - gobject_class->get_property = gst_h265_parse_get_property; - - g_object_class_install_property (gobject_class, PROP_CONFIG_INTERVAL, - g_param_spec_uint ("config-interval", - "VPS SPS PPS Send Interval", - "Send VPS, SPS and PPS Insertion Interval in seconds (sprop parameter sets " - "will be multiplexed in the data stream when detected.) (0 = disabled)", - 0, 3600, DEFAULT_CONFIG_INTERVAL, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); - /* Override BaseParse vfuncs */ - parse_class->start = GST_DEBUG_FUNCPTR (gst_h265_parse_start); - parse_class->stop = GST_DEBUG_FUNCPTR (gst_h265_parse_stop); - parse_class->handle_frame = GST_DEBUG_FUNCPTR (gst_h265_parse_handle_frame); - parse_class->pre_push_frame = - GST_DEBUG_FUNCPTR (gst_h265_parse_pre_push_frame); - parse_class->set_sink_caps = GST_DEBUG_FUNCPTR (gst_h265_parse_set_caps); - parse_class->get_sink_caps = GST_DEBUG_FUNCPTR (gst_h265_parse_get_caps); - parse_class->sink_event = GST_DEBUG_FUNCPTR (gst_h265_parse_event); - parse_class->src_event = GST_DEBUG_FUNCPTR (gst_h265_parse_src_event); - - gst_element_class_add_pad_template (gstelement_class, - gst_static_pad_template_get (&srctemplate)); - gst_element_class_add_pad_template (gstelement_class, - gst_static_pad_template_get (&sinktemplate)); - - gst_element_class_set_static_metadata (gstelement_class, "H.265 parser", - "Codec/Parser/Converter/Video", - "Parses H.265 streams", - "Sreerenj Balachandran "); -} - -static void -gst_h265_parse_init (GstH265Parse * h265parse) -{ - h265parse->frame_out = gst_adapter_new (); - gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (h265parse), FALSE); - GST_PAD_SET_ACCEPT_INTERSECT (GST_BASE_PARSE_SINK_PAD (h265parse)); - GST_PAD_SET_ACCEPT_TEMPLATE (GST_BASE_PARSE_SINK_PAD (h265parse)); -} - - -static void -gst_h265_parse_finalize (GObject * object) -{ - GstH265Parse *h265parse = GST_H265_PARSE (object); - - g_object_unref (h265parse->frame_out); - - G_OBJECT_CLASS (parent_class)->finalize (object); -} - -static void -gst_h265_parse_reset_frame (GstH265Parse * h265parse) -{ - GST_DEBUG_OBJECT (h265parse, "reset frame"); - - /* done parsing; reset state */ - h265parse->current_off = -1; - - h265parse->picture_start = FALSE; - h265parse->update_caps = FALSE; - h265parse->idr_pos = -1; - h265parse->sei_pos = -1; - h265parse->keyframe = FALSE; - h265parse->header = FALSE; - gst_adapter_clear (h265parse->frame_out); -} - -static void -gst_h265_parse_reset (GstH265Parse * h265parse) -{ - h265parse->width = 0; - h265parse->height = 0; - h265parse->fps_num = 0; - h265parse->fps_den = 0; - h265parse->upstream_par_n = -1; - h265parse->upstream_par_d = -1; - h265parse->parsed_par_n = 0; - h265parse->parsed_par_n = 0; - gst_buffer_replace (&h265parse->codec_data, NULL); - gst_buffer_replace (&h265parse->codec_data_in, NULL); - h265parse->nal_length_size = 4; - h265parse->packetized = FALSE; - h265parse->transform = FALSE; - - h265parse->align = GST_H265_PARSE_ALIGN_NONE; - h265parse->format = GST_H265_PARSE_FORMAT_NONE; - - h265parse->last_report = GST_CLOCK_TIME_NONE; - h265parse->push_codec = FALSE; - h265parse->have_pps = FALSE; - h265parse->have_sps = FALSE; - h265parse->have_vps = FALSE; - - h265parse->sent_codec_tag = FALSE; - - h265parse->pending_key_unit_ts = GST_CLOCK_TIME_NONE; - h265parse->force_key_unit_event = NULL; - - gst_h265_parse_reset_frame (h265parse); -} - -static gboolean -gst_h265_parse_start (GstBaseParse * parse) -{ - GstH265Parse *h265parse = GST_H265_PARSE (parse); - - GST_DEBUG_OBJECT (parse, "start"); - gst_h265_parse_reset (h265parse); - - h265parse->nalparser = gst_h265_parser_new (); - - gst_base_parse_set_min_frame_size (parse, 7); - - return TRUE; -} - -static gboolean -gst_h265_parse_stop (GstBaseParse * parse) -{ - guint i; - GstH265Parse *h265parse = GST_H265_PARSE (parse); - - GST_DEBUG_OBJECT (parse, "stop"); - gst_h265_parse_reset (h265parse); - - for (i = 0; i < GST_H265_MAX_VPS_COUNT; i++) - gst_buffer_replace (&h265parse->vps_nals[i], NULL); - for (i = 0; i < GST_H265_MAX_SPS_COUNT; i++) - gst_buffer_replace (&h265parse->sps_nals[i], NULL); - for (i = 0; i < GST_H265_MAX_PPS_COUNT; i++) - gst_buffer_replace (&h265parse->pps_nals[i], NULL); - - gst_h265_parser_free (h265parse->nalparser); - - return TRUE; -} - -static const gchar * -gst_h265_parse_get_string (GstH265Parse * parse, gboolean format, gint code) -{ - if (format) { - switch (code) { - case GST_H265_PARSE_FORMAT_HVC1: - return "hvc1"; - case GST_H265_PARSE_FORMAT_HEV1: - return "hev1"; - case GST_H265_PARSE_FORMAT_BYTE: - return "byte-stream"; - default: - return "none"; - } - } else { - switch (code) { - case GST_H265_PARSE_ALIGN_NAL: - return "nal"; - case GST_H265_PARSE_ALIGN_AU: - return "au"; - default: - return "none"; - } - } -} - -static void -gst_h265_parse_format_from_caps (GstCaps * caps, guint * format, guint * align) -{ - g_return_if_fail (gst_caps_is_fixed (caps)); - - GST_DEBUG ("parsing caps: %" GST_PTR_FORMAT, caps); - - if (format) - *format = GST_H265_PARSE_FORMAT_NONE; - - if (align) - *align = GST_H265_PARSE_ALIGN_NONE; - - if (caps && gst_caps_get_size (caps) > 0) { - GstStructure *s = gst_caps_get_structure (caps, 0); - const gchar *str = NULL; - - if (format) { - if ((str = gst_structure_get_string (s, "stream-format"))) { - if (strcmp (str, "hvc1") == 0) - *format = GST_H265_PARSE_FORMAT_HVC1; - else if (strcmp (str, "hev1") == 0) - *format = GST_H265_PARSE_FORMAT_HEV1; - else if (strcmp (str, "byte-stream") == 0) - *format = GST_H265_PARSE_FORMAT_BYTE; - } - } - - if (align) { - if ((str = gst_structure_get_string (s, "alignment"))) { - if (strcmp (str, "au") == 0) - *align = GST_H265_PARSE_ALIGN_AU; - else if (strcmp (str, "nal") == 0) - *align = GST_H265_PARSE_ALIGN_NAL; - } - } - } -} - -/* check downstream caps to configure format and alignment */ -static void -gst_h265_parse_negotiate (GstH265Parse * h265parse, gint in_format, - GstCaps * in_caps) -{ - GstCaps *caps; - guint format = GST_H265_PARSE_FORMAT_NONE; - guint align = GST_H265_PARSE_ALIGN_NONE; - - g_return_if_fail ((in_caps == NULL) || gst_caps_is_fixed (in_caps)); - - caps = gst_pad_get_allowed_caps (GST_BASE_PARSE_SRC_PAD (h265parse)); - GST_DEBUG_OBJECT (h265parse, "allowed caps: %" GST_PTR_FORMAT, caps); - - /* concentrate on leading structure, since decodebin parser - * capsfilter always includes parser template caps */ - if (caps) { - caps = gst_caps_truncate (caps); - GST_DEBUG_OBJECT (h265parse, "negotiating with caps: %" GST_PTR_FORMAT, - caps); - } - - if (in_caps && caps) { - if (gst_caps_can_intersect (in_caps, caps)) { - GST_DEBUG_OBJECT (h265parse, "downstream accepts upstream caps"); - gst_h265_parse_format_from_caps (in_caps, &format, &align); - gst_caps_unref (caps); - caps = NULL; - } - } - - /* FIXME We could fail the negotiation immediatly if caps are empty */ - if (caps && !gst_caps_is_empty (caps)) { - /* fixate to avoid ambiguity with lists when parsing */ - caps = gst_caps_fixate (caps); - gst_h265_parse_format_from_caps (caps, &format, &align); - gst_caps_unref (caps); - } - - /* default */ - if (!format) - format = GST_H265_PARSE_FORMAT_BYTE; - if (!align) - align = GST_H265_PARSE_ALIGN_AU; - - GST_DEBUG_OBJECT (h265parse, "selected format %s, alignment %s", - gst_h265_parse_get_string (h265parse, TRUE, format), - gst_h265_parse_get_string (h265parse, FALSE, align)); - - h265parse->format = format; - h265parse->align = align; - - h265parse->transform = (in_format != h265parse->format); -} - -static GstBuffer * -gst_h265_parse_wrap_nal (GstH265Parse * h265parse, guint format, guint8 * data, - guint size) -{ - GstBuffer *buf; - guint nl = h265parse->nal_length_size; - guint32 tmp; - - GST_DEBUG_OBJECT (h265parse, "nal length %d", size); - - buf = gst_buffer_new_allocate (NULL, 4 + size, NULL); - if (format == GST_H265_PARSE_FORMAT_HVC1 - || format == GST_H265_PARSE_FORMAT_HEV1) { - tmp = GUINT32_TO_BE (size << (32 - 8 * nl)); - } else { - /* HACK: nl should always be 4 here, otherwise this won't work. - * There are legit cases where nl in hevc stream is 2, but byte-stream - * SC is still always 4 bytes. */ - nl = 4; - tmp = GUINT32_TO_BE (1); - } - - gst_buffer_fill (buf, 0, &tmp, sizeof (guint32)); - gst_buffer_fill (buf, nl, data, size); - gst_buffer_set_size (buf, size + nl); - - return buf; -} - -static void -gst_h265_parser_store_nal (GstH265Parse * h265parse, guint id, - GstH265NalUnitType naltype, GstH265NalUnit * nalu) -{ - GstBuffer *buf, **store; - guint size = nalu->size, store_size; - - if (naltype == GST_H265_NAL_VPS) { - store_size = GST_H265_MAX_VPS_COUNT; - store = h265parse->vps_nals; - GST_DEBUG_OBJECT (h265parse, "storing vps %u", id); - } else if (naltype == GST_H265_NAL_SPS) { - store_size = GST_H265_MAX_SPS_COUNT; - store = h265parse->sps_nals; - GST_DEBUG_OBJECT (h265parse, "storing sps %u", id); - } else if (naltype == GST_H265_NAL_PPS) { - store_size = GST_H265_MAX_PPS_COUNT; - store = h265parse->pps_nals; - GST_DEBUG_OBJECT (h265parse, "storing pps %u", id); - } else - return; - - if (id >= store_size) { - GST_DEBUG_OBJECT (h265parse, "unable to store nal, id out-of-range %d", id); - return; - } - - buf = gst_buffer_new_allocate (NULL, size, NULL); - gst_buffer_fill (buf, 0, nalu->data + nalu->offset, size); - - /* Indicate that buffer contain a header needed for decoding */ - if (naltype >= GST_H265_NAL_VPS && naltype <= GST_H265_NAL_PPS) - GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_HEADER); - - if (store[id]) - gst_buffer_unref (store[id]); - - store[id] = buf; -} - -#ifndef GST_DISABLE_GST_DEBUG -static const gchar *nal_names[] = { - "Slice_TRAIL_N", - "Slice_TRAIL_R", - "Slice_TSA_N", - "Slice_TSA_R", - "Slice_STSA_N", - "Slice_STSA_R", - "Slice_RADL_N", - "Slice_RADL_R", - "SLICE_RASL_N", - "SLICE_RASL_R", - "Invalid (10)", - "Invalid (11)", - "Invalid (12)", - "Invalid (13)", - "Invalid (14)", - "Invalid (15)", - "SLICE_BLA_W_LP", - "SLICE_BLA_W_RADL", - "SLICE_BLA_N_LP", - "SLICE_IDR_W_RADL", - "SLICE_IDR_N_LP", - "SLICE_CRA_NUT", - "Invalid (22)", - "Invalid (23)", - "Invalid (24)", - "Invalid (25)", - "Invalid (26)", - "Invalid (27)", - "Invalid (28)", - "Invalid (29)", - "Invalid (30)", - "Invalid (31)", - "VPS", - "SPS", - "PPS", - "AUD", - "EOS", - "EOB", - "FD", - "PREFIX_SEI", - "SUFFIX_SEI" -}; - -static const gchar * -_nal_name (GstH265NalUnitType nal_type) -{ - if (nal_type <= GST_H265_NAL_SUFFIX_SEI) - return nal_names[nal_type]; - return "Invalid"; -} -#endif - -/* caller guarantees 2 bytes of nal payload */ -static void -gst_h265_parse_process_nal (GstH265Parse * h265parse, GstH265NalUnit * nalu) -{ - GstH265PPS pps = { 0, }; - GstH265SPS sps = { 0, }; - GstH265VPS vps = { 0, }; - gboolean is_irap; - guint nal_type; - GstH265Parser *nalparser = h265parse->nalparser; - GstH265ParserResult pres = GST_H265_PARSER_ERROR; - - /* nothing to do for broken input */ - if (G_UNLIKELY (nalu->size < 2)) { - GST_DEBUG_OBJECT (h265parse, "not processing nal size %u", nalu->size); - return; - } - - /* we have a peek as well */ - nal_type = nalu->type; - - GST_DEBUG_OBJECT (h265parse, "processing nal of type %u %s, size %u", - nal_type, _nal_name (nal_type), nalu->size); - switch (nal_type) { - case GST_H265_NAL_VPS: - /* It is not mandatory to have VPS in the stream. But it might - * be needed for other extensions like svc */ - pres = gst_h265_parser_parse_vps (nalparser, nalu, &vps); - if (pres != GST_H265_PARSER_OK) - GST_WARNING_OBJECT (h265parse, "failed to parse VPS"); - - GST_DEBUG_OBJECT (h265parse, "triggering src caps check"); - h265parse->update_caps = TRUE; - h265parse->have_vps = TRUE; - if (h265parse->push_codec && h265parse->have_pps) { - /* VPS/SPS/PPS found in stream before the first pre_push_frame, no need - * to forcibly push at start */ - GST_INFO_OBJECT (h265parse, "have VPS/SPS/PPS in stream"); - h265parse->push_codec = FALSE; - h265parse->have_vps = FALSE; - h265parse->have_sps = FALSE; - h265parse->have_pps = FALSE; - } - - gst_h265_parser_store_nal (h265parse, vps.id, nal_type, nalu); - h265parse->header |= TRUE; - break; - case GST_H265_NAL_SPS: - pres = gst_h265_parser_parse_sps (nalparser, nalu, &sps, TRUE); - - - /* arranged for a fallback sps.id, so use that one and only warn */ - if (pres != GST_H265_PARSER_OK) - GST_WARNING_OBJECT (h265parse, "failed to parse SPS:"); - - GST_DEBUG_OBJECT (h265parse, "triggering src caps check"); - h265parse->update_caps = TRUE; - h265parse->have_sps = TRUE; - if (h265parse->push_codec && h265parse->have_pps) { - /* SPS and PPS found in stream before the first pre_push_frame, no need - * to forcibly push at start */ - GST_INFO_OBJECT (h265parse, "have SPS/PPS in stream"); - h265parse->push_codec = FALSE; - h265parse->have_sps = FALSE; - h265parse->have_pps = FALSE; - } - - gst_h265_parser_store_nal (h265parse, sps.id, nal_type, nalu); - h265parse->header |= TRUE; - break; - case GST_H265_NAL_PPS: - pres = gst_h265_parser_parse_pps (nalparser, nalu, &pps); - - - /* arranged for a fallback pps.id, so use that one and only warn */ - if (pres != GST_H265_PARSER_OK) - GST_WARNING_OBJECT (h265parse, "failed to parse PPS:"); - - /* parameters might have changed, force caps check */ - if (!h265parse->have_pps) { - GST_DEBUG_OBJECT (h265parse, "triggering src caps check"); - h265parse->update_caps = TRUE; - } - h265parse->have_pps = TRUE; - if (h265parse->push_codec && h265parse->have_sps) { - /* SPS and PPS found in stream before the first pre_push_frame, no need - * to forcibly push at start */ - GST_INFO_OBJECT (h265parse, "have SPS/PPS in stream"); - h265parse->push_codec = FALSE; - h265parse->have_sps = FALSE; - h265parse->have_pps = FALSE; - } - - gst_h265_parser_store_nal (h265parse, pps.id, nal_type, nalu); - h265parse->header |= TRUE; - break; - case GST_H265_NAL_PREFIX_SEI: - case GST_H265_NAL_SUFFIX_SEI: - /*Fixme: parse sei messages */ - /* mark SEI pos */ - if (h265parse->sei_pos == -1) { - if (h265parse->transform) - h265parse->sei_pos = gst_adapter_available (h265parse->frame_out); - else - h265parse->sei_pos = nalu->sc_offset; - GST_DEBUG_OBJECT (h265parse, "marking SEI in frame at offset %d", - h265parse->sei_pos); - } - break; - - case GST_H265_NAL_SLICE_TRAIL_N: - case GST_H265_NAL_SLICE_TRAIL_R: - case GST_H265_NAL_SLICE_TSA_N: - case GST_H265_NAL_SLICE_TSA_R: - case GST_H265_NAL_SLICE_STSA_N: - case GST_H265_NAL_SLICE_STSA_R: - case GST_H265_NAL_SLICE_RADL_N: - case GST_H265_NAL_SLICE_RADL_R: - case GST_H265_NAL_SLICE_RASL_N: - case GST_H265_NAL_SLICE_RASL_R: - case GST_H265_NAL_SLICE_BLA_W_LP: - case GST_H265_NAL_SLICE_BLA_W_RADL: - case GST_H265_NAL_SLICE_BLA_N_LP: - case GST_H265_NAL_SLICE_IDR_W_RADL: - case GST_H265_NAL_SLICE_IDR_N_LP: - case GST_H265_NAL_SLICE_CRA_NUT: - { - GstH265SliceHdr slice; - - pres = gst_h265_parser_parse_slice_hdr (nalparser, nalu, &slice); - - if (pres == GST_H265_PARSER_OK) { - if (GST_H265_IS_I_SLICE (&slice)) - h265parse->keyframe |= TRUE; - } - if (slice.first_slice_segment_in_pic_flag == 1) - GST_DEBUG_OBJECT (h265parse, - "frame start, first_slice_segment_in_pic_flag = 1"); - - GST_DEBUG_OBJECT (h265parse, - "parse result %d, first slice_segment: %u, slice type: %u", - pres, slice.first_slice_segment_in_pic_flag, slice.type); - - gst_h265_slice_hdr_free (&slice); - } - - is_irap = ((nal_type >= GST_H265_NAL_SLICE_BLA_W_LP) - && (nal_type <= GST_H265_NAL_SLICE_CRA_NUT)) ? TRUE : FALSE; - if (G_LIKELY (!is_irap && !h265parse->push_codec)) - break; - - /* if we need to sneak codec NALs into the stream, - * this is a good place, so fake it as IDR - * (which should be at start anyway) */ - /* mark where config needs to go if interval expired */ - /* mind replacement buffer if applicable */ - if (h265parse->idr_pos == -1) { - if (h265parse->transform) - h265parse->idr_pos = gst_adapter_available (h265parse->frame_out); - else - h265parse->idr_pos = nalu->sc_offset; - GST_DEBUG_OBJECT (h265parse, "marking IDR in frame at offset %d", - h265parse->idr_pos); - } - /* if SEI preceeds (faked) IDR, then we have to insert config there */ - if (h265parse->sei_pos >= 0 && h265parse->idr_pos > h265parse->sei_pos) { - h265parse->idr_pos = h265parse->sei_pos; - GST_DEBUG_OBJECT (h265parse, "moved IDR mark to SEI position %d", - h265parse->idr_pos); - } - break; - default: - gst_h265_parser_parse_nal (nalparser, nalu); - } - - /* if HEVC output needed, collect properly prefixed nal in adapter, - * and use that to replace outgoing buffer data later on */ - if (h265parse->transform) { - GstBuffer *buf; - - GST_LOG_OBJECT (h265parse, "collecting NAL in HEVC frame"); - buf = gst_h265_parse_wrap_nal (h265parse, h265parse->format, - nalu->data + nalu->offset, nalu->size); - gst_adapter_push (h265parse->frame_out, buf); - } -} - -/* caller guarantees at least 3 bytes of nal payload for each nal - * returns TRUE if next_nal indicates that nal terminates an AU */ -static inline gboolean -gst_h265_parse_collect_nal (GstH265Parse * h265parse, const guint8 * data, - guint size, GstH265NalUnit * nalu) -{ - gboolean complete; - GstH265ParserResult parse_res; - GstH265NalUnitType nal_type = nalu->type; - GstH265NalUnit nnalu; - - GST_DEBUG_OBJECT (h265parse, "parsing collected nal"); - parse_res = gst_h265_parser_identify_nalu (h265parse->nalparser, data, - nalu->offset + nalu->size, size, &nnalu); - - if (parse_res == GST_H265_PARSER_ERROR) - return FALSE; - - /* determine if AU complete */ - GST_LOG_OBJECT (h265parse, "nal type: %d %s", nal_type, _nal_name (nal_type)); - /* coded slice NAL starts a picture, - * i.e. other types become aggregated in front of it */ - h265parse->picture_start |= ((nal_type >= GST_H265_NAL_SLICE_TRAIL_N - && nal_type <= GST_H265_NAL_SLICE_RASL_R) - || (nal_type >= GST_H265_NAL_SLICE_BLA_W_LP - && nal_type <= RESERVED_IRAP_NAL_TYPE_MAX)); - - /* consider a coded slices (IRAP or not) to start a picture, - * (so ending the previous one) if first_slice_segment_in_pic_flag == 1*/ - nal_type = nnalu.type; - complete = h265parse->picture_start && ((nal_type >= GST_H265_NAL_VPS - && nal_type <= GST_H265_NAL_AUD) - || nal_type == GST_H265_NAL_PREFIX_SEI || (nal_type >= 41 - && nal_type <= 44) || (nal_type >= 48 && nal_type <= 55)); - - GST_LOG_OBJECT (h265parse, "next nal type: %d %s", nal_type, - _nal_name (nal_type)); - - /* Any VCL Nal unit with first_slice_segment_in_pic_flag == 1 considered start of frame */ - complete |= h265parse->picture_start - && (((nal_type >= GST_H265_NAL_SLICE_TRAIL_N - && nal_type <= GST_H265_NAL_SLICE_RASL_R) - || (nal_type >= GST_H265_NAL_SLICE_BLA_W_LP - && nal_type <= RESERVED_IRAP_NAL_TYPE_MAX)) - && (nnalu.data[nnalu.offset + 2] & 0x80)); - - GST_LOG_OBJECT (h265parse, "au complete: %d", complete); - return complete; -} - -static GstFlowReturn -gst_h265_parse_handle_frame_packetized (GstBaseParse * parse, - GstBaseParseFrame * frame) -{ - GstH265Parse *h265parse = GST_H265_PARSE (parse); - GstBuffer *buffer = frame->buffer; - GstFlowReturn ret = GST_FLOW_OK; - GstH265ParserResult parse_res; - GstH265NalUnit nalu; - const guint nl = h265parse->nal_length_size; - GstMapInfo map; - gint left; - - if (nl < 1 || nl > 4) { - GST_DEBUG_OBJECT (h265parse, "insufficient data to split input"); - return GST_FLOW_NOT_NEGOTIATED; - } - - /* need to save buffer from invalidation upon _finish_frame */ - if (h265parse->split_packetized) - buffer = gst_buffer_copy (frame->buffer); - - gst_buffer_map (buffer, &map, GST_MAP_READ); - - left = map.size; - - GST_LOG_OBJECT (h265parse, - "processing packet buffer of size %" G_GSIZE_FORMAT, map.size); - - parse_res = gst_h265_parser_identify_nalu_hevc (h265parse->nalparser, - map.data, 0, map.size, nl, &nalu); - - while (parse_res == GST_H265_PARSER_OK) { - GST_DEBUG_OBJECT (h265parse, "HEVC nal offset %d", nalu.offset + nalu.size); - - /* either way, have a look at it */ - gst_h265_parse_process_nal (h265parse, &nalu); - - /* dispatch per NALU if needed */ - if (h265parse->split_packetized) { - /* note we don't need to come up with a sub-buffer, since - * subsequent code only considers input buffer's metadata. - * Real data is either taken from input by baseclass or - * a replacement output buffer is provided anyway. */ - gst_h265_parse_parse_frame (parse, frame); - ret = gst_base_parse_finish_frame (parse, frame, nl + nalu.size); - left -= nl + nalu.size; - } - - parse_res = gst_h265_parser_identify_nalu_hevc (h265parse->nalparser, - map.data, nalu.offset + nalu.size, map.size, nl, &nalu); - } - - gst_buffer_unmap (buffer, &map); - - if (!h265parse->split_packetized) { - gst_h265_parse_parse_frame (parse, frame); - ret = gst_base_parse_finish_frame (parse, frame, map.size); - } else { - gst_buffer_unref (buffer); - if (G_UNLIKELY (left)) { - /* should not be happening for nice HEVC */ - GST_WARNING_OBJECT (parse, "skipping leftover HEVC data %d", left); - frame->flags |= GST_BASE_PARSE_FRAME_FLAG_DROP; - ret = gst_base_parse_finish_frame (parse, frame, map.size); - } - } - - if (parse_res == GST_H265_PARSER_NO_NAL_END || - parse_res == GST_H265_PARSER_BROKEN_DATA) { - - if (h265parse->split_packetized) { - GST_ELEMENT_ERROR (h265parse, STREAM, FAILED, (NULL), - ("invalid HEVC input data")); - gst_buffer_unref (buffer); - - return GST_FLOW_ERROR; - } else { - /* do not meddle to much in this case */ - GST_DEBUG_OBJECT (h265parse, "parsing packet failed"); - } - } - - return ret; -} - -static GstFlowReturn -gst_h265_parse_handle_frame (GstBaseParse * parse, - GstBaseParseFrame * frame, gint * skipsize) -{ - GstH265Parse *h265parse = GST_H265_PARSE (parse); - GstBuffer *buffer = frame->buffer; - GstMapInfo map; - guint8 *data; - gsize size; - gint current_off = 0; - gboolean drain, nonext; - GstH265Parser *nalparser = h265parse->nalparser; - GstH265NalUnit nalu; - GstH265ParserResult pres; - gint framesize; - - /* delegate in packetized case, no skipping should be needed */ - if (h265parse->packetized) - return gst_h265_parse_handle_frame_packetized (parse, frame); - - gst_buffer_map (buffer, &map, GST_MAP_READ); - data = map.data; - size = map.size; - - /* expect at least 3 bytes startcode == sc, and 3 bytes NALU payload */ - if (G_UNLIKELY (size < 6)) { - gst_buffer_unmap (buffer, &map); - *skipsize = 1; - return GST_FLOW_OK; - } - - /* need to configure aggregation */ - if (G_UNLIKELY (h265parse->format == GST_H265_PARSE_FORMAT_NONE)) - gst_h265_parse_negotiate (h265parse, GST_H265_PARSE_FORMAT_BYTE, NULL); - - /* avoid stale cached parsing state */ - if (frame->flags & GST_BASE_PARSE_FRAME_FLAG_NEW_FRAME) { - GST_LOG_OBJECT (h265parse, "parsing new frame"); - gst_h265_parse_reset_frame (h265parse); - } else { - GST_LOG_OBJECT (h265parse, "resuming frame parsing"); - } - - drain = GST_BASE_PARSE_DRAINING (parse); - nonext = FALSE; - - current_off = h265parse->current_off; - if (current_off < 0) - current_off = 0; - g_assert (current_off < size); - GST_DEBUG_OBJECT (h265parse, "last parse position %d", current_off); - - /* check for initial skip */ - if (h265parse->current_off == -1) { - pres = - gst_h265_parser_identify_nalu_unchecked (nalparser, data, current_off, - size, &nalu); - switch (pres) { - case GST_H265_PARSER_OK: - if (nalu.sc_offset > 0) { - *skipsize = nalu.sc_offset; - goto skip; - } - break; - case GST_H265_PARSER_NO_NAL: - *skipsize = size - 3; - goto skip; - default: - g_assert_not_reached (); - break; - } - } - - while (TRUE) { - pres = - gst_h265_parser_identify_nalu (nalparser, data, current_off, size, - &nalu); - - switch (pres) { - case GST_H265_PARSER_OK: - GST_DEBUG_OBJECT (h265parse, "complete nal (offset, size): (%u, %u) ", - nalu.offset, nalu.size); - break; - case GST_H265_PARSER_NO_NAL_END: - GST_DEBUG_OBJECT (h265parse, "not a complete nal found at offset %u", - nalu.offset); - /* if draining, accept it as complete nal */ - if (drain) { - nonext = TRUE; - nalu.size = size - nalu.offset; - GST_DEBUG_OBJECT (h265parse, "draining, accepting with size %u", - nalu.size); - /* if it's not too short at least */ - if (nalu.size < 3) - goto broken; - break; - } - /* otherwise need more */ - goto more; - case GST_H265_PARSER_BROKEN_LINK: - GST_ELEMENT_ERROR (h265parse, STREAM, FORMAT, - ("Error parsing H.265 stream"), - ("The link to structure needed for the parsing couldn't be found")); - goto invalid_stream; - case GST_H265_PARSER_ERROR: - /* should not really occur either */ - GST_ELEMENT_ERROR (h265parse, STREAM, FORMAT, - ("Error parsing H.265 stream"), ("Invalid H.265 stream")); - goto invalid_stream; - case GST_H265_PARSER_NO_NAL: - GST_ELEMENT_ERROR (h265parse, STREAM, FORMAT, - ("Error parsing H.265 stream"), ("No H.265 NAL unit found")); - goto invalid_stream; - case GST_H265_PARSER_BROKEN_DATA: - GST_WARNING_OBJECT (h265parse, "input stream is corrupt; " - "it contains a NAL unit of length %u", nalu.size); - broken: - /* broken nal at start -> arrange to skip it, - * otherwise have it terminate current au - * (and so it will be skipped on next frame round) */ - if (current_off == 0) { - GST_DEBUG_OBJECT (h265parse, "skipping broken nal"); - *skipsize = nalu.offset; - goto skip; - } else { - GST_DEBUG_OBJECT (h265parse, "terminating au"); - nalu.size = 0; - nalu.offset = nalu.sc_offset; - goto end; - } - default: - g_assert_not_reached (); - break; - } - - GST_DEBUG_OBJECT (h265parse, "%p complete nal found. Off: %u, Size: %u", - data, nalu.offset, nalu.size); - - /* simulate no next nal if none needed */ - nonext = nonext || (h265parse->align == GST_H265_PARSE_ALIGN_NAL); - - if (!nonext) { - if (nalu.offset + nalu.size + 5 + 2 > size) { - GST_DEBUG_OBJECT (h265parse, "not enough data for next NALU"); - if (drain) { - GST_DEBUG_OBJECT (h265parse, "but draining anyway"); - nonext = TRUE; - } else { - goto more; - } - } - } - - if (nalu.type == GST_H265_NAL_VPS || - nalu.type == GST_H265_NAL_SPS || - nalu.type == GST_H265_NAL_PPS || - (h265parse->have_sps && h265parse->have_pps)) { - gst_h265_parse_process_nal (h265parse, &nalu); - } else { - GST_WARNING_OBJECT (h265parse, - "no SPS/PPS yet, nal Type: %d %s, Size: %u will be dropped", - nalu.type, _nal_name (nalu.type), nalu.size); - *skipsize = nalu.size; - goto skip; - } - - if (nonext) - break; - - /* if no next nal, we know it's complete here */ - if (gst_h265_parse_collect_nal (h265parse, data, size, &nalu)) - break; - - GST_DEBUG_OBJECT (h265parse, "Looking for more"); - current_off = nalu.offset + nalu.size; - } - -end: - framesize = nalu.offset + nalu.size; - - gst_buffer_unmap (buffer, &map); - - gst_h265_parse_parse_frame (parse, frame); - - return gst_base_parse_finish_frame (parse, frame, framesize); - -more: - *skipsize = 0; - - /* Restart parsing from here next time */ - if (current_off > 0) - h265parse->current_off = current_off; - - /* Fall-through. */ -out: - gst_buffer_unmap (buffer, &map); - return GST_FLOW_OK; - -skip: - GST_DEBUG_OBJECT (h265parse, "skipping %d", *skipsize); - gst_h265_parse_reset_frame (h265parse); - goto out; - -invalid_stream: - gst_buffer_unmap (buffer, &map); - return GST_FLOW_ERROR; -} - -/* byte together hevc codec data based on collected pps and sps so far */ -static GstBuffer * -gst_h265_parse_make_codec_data (GstH265Parse * h265parse) -{ - GstBuffer *buf, *nal; - gint i, j, k = 0; - guint vps_size = 0, sps_size = 0, pps_size = 0; - guint num_vps = 0, num_sps = 0, num_pps = 0; - gboolean found = FALSE; - GstMapInfo map; - guint8 *data; - gint nl; - guint8 num_arrays = 0; - GstH265SPS *sps = NULL; - guint16 min_spatial_segmentation_idc = 0; - GstH265ProfileTierLevel *pft; - - /* only nal payload in stored nals */ - /* Fixme: Current implementation is not embedding SEI in codec_data */ - for (i = 0; i < GST_H265_MAX_VPS_COUNT; i++) { - if ((nal = h265parse->vps_nals[i])) { - num_vps++; - /* size bytes also count */ - vps_size += gst_buffer_get_size (nal) + 2; - } - } - if (num_vps > 0) - num_arrays++; - - for (i = 0; i < GST_H265_MAX_SPS_COUNT; i++) { - if ((nal = h265parse->sps_nals[i])) { - num_sps++; - /* size bytes also count */ - sps_size += gst_buffer_get_size (nal) + 2; - found = TRUE; - } - } - if (num_sps > 0) - num_arrays++; - - for (i = 0; i < GST_H265_MAX_PPS_COUNT; i++) { - if ((nal = h265parse->pps_nals[i])) { - num_pps++; - /* size bytes also count */ - pps_size += gst_buffer_get_size (nal) + 2; - } - } - if (num_pps > 0) - num_arrays++; - - GST_DEBUG_OBJECT (h265parse, - "constructing codec_data: num_vps =%d num_sps=%d, num_pps=%d", num_vps, - num_sps, num_pps); - - if (!found) - return NULL; - - buf = - gst_buffer_new_allocate (NULL, - 23 + num_arrays + (3 * num_arrays) + vps_size + sps_size + pps_size, - NULL); - gst_buffer_map (buf, &map, GST_MAP_WRITE); - data = map.data; - memset (data, 0, map.size); - nl = h265parse->nal_length_size; - - sps = h265parse->nalparser->last_sps; - if (!sps) - return NULL; - pft = &sps->profile_tier_level; - if (sps->vui_parameters_present_flag) - min_spatial_segmentation_idc = sps->vui_params.min_spatial_segmentation_idc; - - /* HEVCDecoderConfigurationVersion = 1 - * profile_space | tier_flat | profile_idc | - * profile_compatibility_flags | constraint_indicator_flags | - * level_idc */ - data[0] = 1; - data[1] = - (pft->profile_space << 5) | (pft->tier_flag << 5) | pft->profile_idc; - for (i = 2; i < 6; i++) { - for (j = 7; j >= 0; j--) { - data[i] |= (pft->profile_compatibility_flag[k] << j); - k++; - } - } - data[6] |= - (pft->progressive_source_flag << 7) | (pft->interlaced_source_flag << 6) | - (pft->non_packed_constraint_flag << 5) | (pft-> - frame_only_constraint_flag << 4); - data[12] = pft->level_idc; - /* min_spatial_segmentation_idc */ - GST_WRITE_UINT16_BE (data + 13, min_spatial_segmentation_idc); - data[13] |= 0xf0; - data[15] = 0xfc; /* keeping parrallelismType as zero (unknown) */ - data[16] = 0xfc | sps->chroma_format_idc; - data[17] = 0xf8 | sps->bit_depth_luma_minus8; - data[18] = 0xf8 | sps->bit_depth_chroma_minus8; - data[19] = 0x00; /* keep avgFrameRate as unspecified */ - data[20] = 0x00; /* keep avgFrameRate as unspecified */ - /* constFrameRate(2 bits): 0, stream may or may not be of constant framerate - * numTemporalLayers (3 bits): number of temporal layers, value from SPS - * TemporalIdNested (1 bit): sps_temporal_id_nesting_flag from SPS - * lengthSizeMinusOne (2 bits): plus 1 indicates the length of the NALUnitLength */ - data[21] = - 0x00 | ((sps->max_sub_layers_minus1 + - 1) << 3) | (sps->temporal_id_nesting_flag << 2) | (nl - 1); - GST_WRITE_UINT8 (data + 22, num_arrays); /* numOfArrays */ - - data += 23; - - /* VPS */ - if (num_vps > 0) { - /* array_completeness | reserved_zero bit | nal_unit_type */ - data[0] = 0x00 | 0x20; - data++; - - GST_WRITE_UINT16_BE (data, num_vps); - data += 2; - - for (i = 0; i < num_vps; i++) { - if ((nal = h265parse->vps_nals[i])) { - gsize nal_size = gst_buffer_get_size (nal); - GST_WRITE_UINT16_BE (data, nal_size); - gst_buffer_extract (nal, 0, data + 2, nal_size); - data += 2 + nal_size; - } - } - } - - /* SPS */ - if (num_sps > 0) { - /* array_completeness | reserved_zero bit | nal_unit_type */ - data[0] = 0x00 | 0x21; - data++; - - GST_WRITE_UINT16_BE (data, num_sps); - data += 2; - - for (i = 0; i < num_sps; i++) { - if ((nal = h265parse->sps_nals[i])) { - gsize nal_size = gst_buffer_get_size (nal); - GST_WRITE_UINT16_BE (data, nal_size); - gst_buffer_extract (nal, 0, data + 2, nal_size); - data += 2 + nal_size; - } - } - } - - /* PPS */ - if (num_pps > 0) { - /* array_completeness | reserved_zero bit | nal_unit_type */ - data[0] = 0x00 | 0x22; - data++; - - GST_WRITE_UINT16_BE (data, num_pps); - data += 2; - - for (i = 0; i < num_pps; i++) { - if ((nal = h265parse->pps_nals[i])) { - gsize nal_size = gst_buffer_get_size (nal); - GST_WRITE_UINT16_BE (data, nal_size); - gst_buffer_extract (nal, 0, data + 2, nal_size); - data += 2 + nal_size; - } - } - } - gst_buffer_unmap (buf, &map); - - return buf; -} - -static void -gst_h265_parse_get_par (GstH265Parse * h265parse, gint * num, gint * den) -{ - if (h265parse->upstream_par_n != -1 && h265parse->upstream_par_d != -1) { - *num = h265parse->upstream_par_n; - *den = h265parse->upstream_par_d; - } else { - *num = h265parse->parsed_par_n; - *den = h265parse->parsed_par_d; - } -} - -static const gchar * -digit_to_string (guint digit) -{ - static const char itoa[][2] = { - "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" - }; - - if (G_LIKELY (digit < 10)) - return itoa[digit]; - else - return NULL; -} - -static const gchar * -get_profile_string (guint8 profile_idc) -{ - const gchar *profile = NULL; - - if (profile_idc == 1) - profile = "main"; - else if (profile_idc == 2) - profile = "main-10"; - else if (profile_idc == 3) - profile = "main-still-picture"; - - return profile; -} - -static const gchar * -get_tier_string (guint8 tier_flag) -{ - const gchar *tier = NULL; - - if (tier_flag) - tier = "high"; - else - tier = "main"; - - return tier; -} - -static const gchar * -get_level_string (guint8 level_idc) -{ - if (level_idc % 30 == 0) - return digit_to_string (level_idc / 30); - else { - switch (level_idc) { - case 63: - return "2.1"; - break; - case 93: - return "3.1"; - break; - case 123: - return "4.1"; - break; - case 153: - return "5.1"; - break; - case 156: - return "5.2"; - break; - case 183: - return "6.1"; - break; - case 186: - return "6.2"; - break; - default: - return NULL; - } - } -} - -static GstCaps * -get_compatible_profile_caps (GstH265SPS * sps) -{ - GstCaps *caps = NULL; - const gchar **profiles = NULL; - gint i; - GValue compat_profiles = G_VALUE_INIT; - g_value_init (&compat_profiles, GST_TYPE_LIST); - - switch (sps->profile_tier_level.profile_idc) { - case GST_H265_PROFILE_MAIN_10: - if (sps->profile_tier_level.profile_compatibility_flag[1]) { - if (sps->profile_tier_level.profile_compatibility_flag[3]) { - static const gchar *profile_array[] = - { "main", "main-still-picture", NULL }; - profiles = profile_array; - } else { - static const gchar *profile_array[] = { "main", NULL }; - profiles = profile_array; - } - } - break; - case GST_H265_PROFILE_MAIN: - if (sps->profile_tier_level.profile_compatibility_flag[3]) { - static const gchar *profile_array[] = - { "main-still-picture", "main-10", NULL - }; - profiles = profile_array; - } else { - static const gchar *profile_array[] = { "main-10", NULL }; - profiles = profile_array; - } - break; - case GST_H265_PROFILE_MAIN_STILL_PICTURE: - { - static const gchar *profile_array[] = { "main", "main-10", NULL - }; - profiles = profile_array; - } - break; - default: - break; - } - - if (profiles) { - GValue value = G_VALUE_INIT; - caps = gst_caps_new_empty_simple ("video/x-h265"); - for (i = 0; profiles[i]; i++) { - g_value_init (&value, G_TYPE_STRING); - g_value_set_string (&value, profiles[i]); - gst_value_list_append_value (&compat_profiles, &value); - g_value_unset (&value); - } - gst_caps_set_value (caps, "profile", &compat_profiles); - g_value_unset (&compat_profiles); - } - - return caps; -} - -/* if downstream didn't support the exact profile indicated in sps header, - * check for the compatible profiles also */ -static void -ensure_caps_profile (GstH265Parse * h265parse, GstCaps * caps, GstH265SPS * sps) -{ - GstCaps *filter_caps, *peer_caps, *compat_caps; - - filter_caps = gst_caps_new_empty_simple ("video/x-h265"); - peer_caps = - gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (h265parse), filter_caps); - - if (peer_caps && !gst_caps_can_intersect (caps, peer_caps)) { - GstStructure *structure; - - compat_caps = get_compatible_profile_caps (sps); - if (compat_caps != NULL) { - GstCaps *res_caps = NULL; - - res_caps = gst_caps_intersect (peer_caps, compat_caps); - - if (res_caps && !gst_caps_is_empty (res_caps)) { - const gchar *profile_str = NULL; - - res_caps = gst_caps_fixate (res_caps); - structure = gst_caps_get_structure (res_caps, 0); - profile_str = gst_structure_get_string (structure, "profile"); - if (profile_str) { - gst_caps_set_simple (caps, "profile", G_TYPE_STRING, profile_str, - NULL); - GST_DEBUG_OBJECT (h265parse, - "Setting compatible profile %s to the caps", profile_str); - } - } - if (res_caps) - gst_caps_unref (res_caps); - gst_caps_unref (compat_caps); - } - } - if (peer_caps) - gst_caps_unref (peer_caps); - gst_caps_unref (filter_caps); -} - -static void -gst_h265_parse_update_src_caps (GstH265Parse * h265parse, GstCaps * caps) -{ - GstH265SPS *sps; - GstCaps *sink_caps, *src_caps; - gboolean modified = FALSE; - GstBuffer *buf = NULL; - GstStructure *s = NULL; - - if (G_UNLIKELY (!gst_pad_has_current_caps (GST_BASE_PARSE_SRC_PAD - (h265parse)))) - modified = TRUE; - else if (G_UNLIKELY (!h265parse->update_caps)) - return; - - /* if this is being called from the first _setcaps call, caps on the sinkpad - * aren't set yet and so they need to be passed as an argument */ - if (caps) - sink_caps = gst_caps_ref (caps); - else - sink_caps = gst_pad_get_current_caps (GST_BASE_PARSE_SINK_PAD (h265parse)); - - /* carry over input caps as much as possible; override with our own stuff */ - if (!sink_caps) - sink_caps = gst_caps_new_empty_simple ("video/x-h265"); - else - s = gst_caps_get_structure (sink_caps, 0); - - sps = h265parse->nalparser->last_sps; - GST_DEBUG_OBJECT (h265parse, "sps: %p", sps); - - /* only codec-data for nice-and-clean au aligned packetized hevc format */ - if ((h265parse->format == GST_H265_PARSE_FORMAT_HVC1 - || h265parse->format == GST_H265_PARSE_FORMAT_HEV1) - && h265parse->align == GST_H265_PARSE_ALIGN_AU) { - buf = gst_h265_parse_make_codec_data (h265parse); - if (buf && h265parse->codec_data) { - GstMapInfo map; - - gst_buffer_map (buf, &map, GST_MAP_READ); - if (map.size != gst_buffer_get_size (h265parse->codec_data) || - gst_buffer_memcmp (h265parse->codec_data, 0, map.data, map.size)) - modified = TRUE; - - gst_buffer_unmap (buf, &map); - } else { - if (!buf && h265parse->codec_data_in) - buf = gst_buffer_ref (h265parse->codec_data_in); - modified = TRUE; - } - } - - caps = NULL; - if (G_UNLIKELY (!sps)) { - caps = gst_caps_copy (sink_caps); - } else { - gint crop_width, crop_height; - - if (sps->conformance_window_flag) { - crop_width = sps->crop_rect_width; - crop_height = sps->crop_rect_height; - } else { - crop_width = sps->width; - crop_height = sps->height; - } - - if (G_UNLIKELY (h265parse->width != crop_width || - h265parse->height != crop_height)) { - GST_INFO_OBJECT (h265parse, "resolution changed %dx%d", - crop_width, crop_height); - h265parse->width = crop_width; - h265parse->height = crop_height; - modified = TRUE; - } - - /* 0/1 is set as the default in the codec parser */ - if (sps->vui_params.timing_info_present_flag && - !(sps->fps_num == 0 && sps->fps_den == 1)) { - if (G_UNLIKELY (h265parse->fps_num != sps->fps_num - || h265parse->fps_den != sps->fps_den)) { - GST_INFO_OBJECT (h265parse, "framerate changed %d/%d", - sps->fps_num, sps->fps_den); - h265parse->fps_num = sps->fps_num; - h265parse->fps_den = sps->fps_den; - modified = TRUE; - } - } - - if (sps->vui_params.aspect_ratio_info_present_flag) { - if (G_UNLIKELY ((h265parse->parsed_par_n != sps->vui_params.par_n) - && (h265parse->parsed_par_d != sps->vui_params.par_d))) { - h265parse->parsed_par_n = sps->vui_params.par_n; - h265parse->parsed_par_d = sps->vui_params.par_d; - GST_INFO_OBJECT (h265parse, "pixel aspect ratio has been changed %d/%d", - h265parse->parsed_par_n, h265parse->parsed_par_d); - modified = TRUE; - } - - } - - if (G_UNLIKELY (modified || h265parse->update_caps)) { - gint fps_num = h265parse->fps_num; - gint fps_den = h265parse->fps_den; - gint width, height; - GstClockTime latency; - - caps = gst_caps_copy (sink_caps); - - /* sps should give this but upstream overrides */ - if (s && gst_structure_has_field (s, "width")) - gst_structure_get_int (s, "width", &width); - else - width = h265parse->width; - - if (s && gst_structure_has_field (s, "height")) - gst_structure_get_int (s, "height", &height); - else - height = h265parse->height; - - gst_caps_set_simple (caps, "width", G_TYPE_INT, width, - "height", G_TYPE_INT, height, NULL); - - /* upstream overrides */ - if (s && gst_structure_has_field (s, "framerate")) - gst_structure_get_fraction (s, "framerate", &fps_num, &fps_den); - - /* but not necessarily or reliably this */ - if (fps_num > 0 && fps_den > 0) { - GST_INFO_OBJECT (h265parse, "setting framerate in caps"); - gst_caps_set_simple (caps, "framerate", - GST_TYPE_FRACTION, fps_num, fps_den, NULL); - gst_base_parse_set_frame_rate (GST_BASE_PARSE (h265parse), - fps_num, fps_den, 0, 0); - latency = gst_util_uint64_scale (GST_SECOND, fps_den, fps_num); - gst_base_parse_set_latency (GST_BASE_PARSE (h265parse), latency, - latency); - } - } - } - - if (caps) { - gint par_n, par_d; - - gst_caps_set_simple (caps, "parsed", G_TYPE_BOOLEAN, TRUE, - "stream-format", G_TYPE_STRING, - gst_h265_parse_get_string (h265parse, TRUE, h265parse->format), - "alignment", G_TYPE_STRING, - gst_h265_parse_get_string (h265parse, FALSE, h265parse->align), NULL); - - gst_h265_parse_get_par (h265parse, &par_n, &par_d); - if (par_n != 0 && par_d != 0 && - (!s || !gst_structure_has_field (s, "pixel-aspect-ratio"))) { - GST_INFO_OBJECT (h265parse, "PAR %d/%d", par_n, par_d); - gst_caps_set_simple (caps, "pixel-aspect-ratio", GST_TYPE_FRACTION, - par_n, par_d, NULL); - } - - /* set profile and level in caps */ - if (sps) { - const gchar *profile, *tier, *level; - - profile = get_profile_string (sps->profile_tier_level.profile_idc); - if (profile != NULL) - gst_caps_set_simple (caps, "profile", G_TYPE_STRING, profile, NULL); - - tier = get_tier_string (sps->profile_tier_level.tier_flag); - if (tier != NULL) - gst_caps_set_simple (caps, "tier", G_TYPE_STRING, tier, NULL); - - level = get_level_string (sps->profile_tier_level.level_idc); - if (level != NULL) - gst_caps_set_simple (caps, "level", G_TYPE_STRING, level, NULL); - - /* relax the profile constraint to find a suitable decoder */ - ensure_caps_profile (h265parse, caps, sps); - } - - src_caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (h265parse)); - - if (src_caps - && gst_structure_has_field (gst_caps_get_structure (src_caps, 0), - "codec_data")) { - /* use codec data from old caps for comparison; we don't want to resend caps - if everything is same except codec data; */ - gst_caps_set_value (caps, "codec_data", - gst_structure_get_value (gst_caps_get_structure (src_caps, 0), - "codec_data")); - } - if (!(src_caps && gst_caps_is_strictly_equal (src_caps, caps))) { - /* update codec data to new value */ - if (buf) { - gst_caps_set_simple (caps, "codec_data", GST_TYPE_BUFFER, buf, NULL); - gst_buffer_replace (&h265parse->codec_data, buf); - gst_buffer_unref (buf); - buf = NULL; - } else { - GstStructure *s; - /* remove any left-over codec-data hanging around */ - s = gst_caps_get_structure (caps, 0); - gst_structure_remove_field (s, "codec_data"); - gst_buffer_replace (&h265parse->codec_data, NULL); - } - - gst_pad_set_caps (GST_BASE_PARSE_SRC_PAD (h265parse), caps); - } - - if (src_caps) - gst_caps_unref (src_caps); - gst_caps_unref (caps); - } - - gst_caps_unref (sink_caps); - if (buf) - gst_buffer_unref (buf); - -} - -static GstFlowReturn -gst_h265_parse_parse_frame (GstBaseParse * parse, GstBaseParseFrame * frame) -{ - GstH265Parse *h265parse; - GstBuffer *buffer; - guint av; - - h265parse = GST_H265_PARSE (parse); - buffer = frame->buffer; - - gst_h265_parse_update_src_caps (h265parse, NULL); - - /* Fixme: Implement timestamp interpolation based on SEI Messagses */ - GST_FIXME_OBJECT (h265parse, - "Implement timestamp/duration interpolation based on SEI message"); - - if (h265parse->keyframe) - GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_DELTA_UNIT); - else - GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DELTA_UNIT); - - if (h265parse->header) - GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_HEADER); - else - GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_HEADER); - - /* replace with transformed HEVC output if applicable */ - av = gst_adapter_available (h265parse->frame_out); - if (av) { - GstBuffer *buf; - - buf = gst_adapter_take_buffer (h265parse->frame_out, av); - gst_buffer_copy_into (buf, buffer, GST_BUFFER_COPY_METADATA, 0, -1); - gst_buffer_replace (&frame->out_buffer, buf); - gst_buffer_unref (buf); - } - - return GST_FLOW_OK; -} - -/* sends a codec NAL downstream, decorating and transforming as needed. - * No ownership is taken of @nal */ -static GstFlowReturn -gst_h265_parse_push_codec_buffer (GstH265Parse * h265parse, GstBuffer * nal, - GstClockTime ts) -{ - GstMapInfo map; - - gst_buffer_map (nal, &map, GST_MAP_READ); - nal = gst_h265_parse_wrap_nal (h265parse, h265parse->format, - map.data, map.size); - gst_buffer_unmap (nal, &map); - - GST_BUFFER_TIMESTAMP (nal) = ts; - GST_BUFFER_DURATION (nal) = 0; - - return gst_pad_push (GST_BASE_PARSE_SRC_PAD (h265parse), nal); -} - -static GstEvent * -check_pending_key_unit_event (GstEvent * pending_event, GstSegment * segment, - GstClockTime timestamp, guint flags, GstClockTime pending_key_unit_ts) -{ - GstClockTime running_time, stream_time; - gboolean all_headers; - guint count; - GstEvent *event = NULL; - - g_return_val_if_fail (segment != NULL, NULL); - - if (pending_event == NULL) - goto out; - - if (GST_CLOCK_TIME_IS_VALID (pending_key_unit_ts) && - timestamp == GST_CLOCK_TIME_NONE) - goto out; - - running_time = gst_segment_to_running_time (segment, - GST_FORMAT_TIME, timestamp); - - GST_INFO ("now %" GST_TIME_FORMAT " wanted %" GST_TIME_FORMAT, - GST_TIME_ARGS (running_time), GST_TIME_ARGS (pending_key_unit_ts)); - if (GST_CLOCK_TIME_IS_VALID (pending_key_unit_ts) && - running_time < pending_key_unit_ts) - goto out; - - if (flags & GST_BUFFER_FLAG_DELTA_UNIT) { - GST_DEBUG ("pending force key unit, waiting for keyframe"); - goto out; - } - - stream_time = gst_segment_to_stream_time (segment, - GST_FORMAT_TIME, timestamp); - - gst_video_event_parse_upstream_force_key_unit (pending_event, - NULL, &all_headers, &count); - - event = - gst_video_event_new_downstream_force_key_unit (timestamp, stream_time, - running_time, all_headers, count); - gst_event_set_seqnum (event, gst_event_get_seqnum (pending_event)); - -out: - return event; -} - -static void -gst_h265_parse_prepare_key_unit (GstH265Parse * parse, GstEvent * event) -{ - GstClockTime running_time; - guint count; -#ifndef GST_DISABLE_GST_DEBUG - gboolean have_vps, have_sps, have_pps; - gint i; -#endif - - parse->pending_key_unit_ts = GST_CLOCK_TIME_NONE; - gst_event_replace (&parse->force_key_unit_event, NULL); - - gst_video_event_parse_downstream_force_key_unit (event, - NULL, NULL, &running_time, NULL, &count); - - GST_INFO_OBJECT (parse, "pushing downstream force-key-unit event %d " - "%" GST_TIME_FORMAT " count %d", gst_event_get_seqnum (event), - GST_TIME_ARGS (running_time), count); - gst_pad_push_event (GST_BASE_PARSE_SRC_PAD (parse), event); - -#ifndef GST_DISABLE_GST_DEBUG - have_vps = have_sps = have_pps = FALSE; - for (i = 0; i < GST_H265_MAX_VPS_COUNT; i++) { - if (parse->vps_nals[i] != NULL) { - have_vps = TRUE; - break; - } - } - for (i = 0; i < GST_H265_MAX_SPS_COUNT; i++) { - if (parse->sps_nals[i] != NULL) { - have_sps = TRUE; - break; - } - } - for (i = 0; i < GST_H265_MAX_PPS_COUNT; i++) { - if (parse->pps_nals[i] != NULL) { - have_pps = TRUE; - break; - } - } - - GST_INFO_OBJECT (parse, - "preparing key unit, have vps %d have sps %d have pps %d", have_vps, - have_sps, have_pps); -#endif - - /* set push_codec to TRUE so that pre_push_frame sends VPS/SPS/PPS again */ - parse->push_codec = TRUE; -} - -static GstFlowReturn -gst_h265_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) -{ - GstH265Parse *h265parse; - GstBuffer *buffer; - GstEvent *event; - - h265parse = GST_H265_PARSE (parse); - - if (!h265parse->sent_codec_tag) { - GstTagList *taglist; - GstCaps *caps; - - taglist = gst_tag_list_new_empty (); - - /* codec tag */ - caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (parse)); - gst_pb_utils_add_codec_description_to_tag_list (taglist, - GST_TAG_VIDEO_CODEC, caps); - gst_caps_unref (caps); - - gst_base_parse_merge_tags (parse, taglist, GST_TAG_MERGE_REPLACE); - gst_tag_list_unref (taglist); - - /* also signals the end of first-frame processing */ - h265parse->sent_codec_tag = TRUE; - } - - buffer = frame->buffer; - - if ((event = check_pending_key_unit_event (h265parse->force_key_unit_event, - &parse->segment, GST_BUFFER_TIMESTAMP (buffer), - GST_BUFFER_FLAGS (buffer), h265parse->pending_key_unit_ts))) { - gst_h265_parse_prepare_key_unit (h265parse, event); - } - - /* periodic VPS/SPS/PPS sending */ - if (h265parse->interval > 0 || h265parse->push_codec) { - GstClockTime timestamp = GST_BUFFER_TIMESTAMP (buffer); - guint64 diff; - - /* init */ - if (!GST_CLOCK_TIME_IS_VALID (h265parse->last_report)) { - h265parse->last_report = timestamp; - } - - if (h265parse->idr_pos >= 0) { - GST_LOG_OBJECT (h265parse, "IDR nal at offset %d", h265parse->idr_pos); - - if (timestamp > h265parse->last_report) - diff = timestamp - h265parse->last_report; - else - diff = 0; - - GST_LOG_OBJECT (h265parse, - "now %" GST_TIME_FORMAT ", last VPS/SPS/PPS %" GST_TIME_FORMAT, - GST_TIME_ARGS (timestamp), GST_TIME_ARGS (h265parse->last_report)); - - GST_DEBUG_OBJECT (h265parse, - "interval since last VPS/SPS/PPS %" GST_TIME_FORMAT, - GST_TIME_ARGS (diff)); - - if (GST_TIME_AS_SECONDS (diff) >= h265parse->interval || - h265parse->push_codec) { - GstBuffer *codec_nal; - gint i; - GstClockTime new_ts; - - /* avoid overwriting a perfectly fine timestamp */ - new_ts = GST_CLOCK_TIME_IS_VALID (timestamp) ? timestamp : - h265parse->last_report; - - if (h265parse->align == GST_H265_PARSE_ALIGN_NAL) { - /* send separate config NAL buffers */ - GST_DEBUG_OBJECT (h265parse, "- sending VPS/SPS/PPS"); - for (i = 0; i < GST_H265_MAX_VPS_COUNT; i++) { - if ((codec_nal = h265parse->vps_nals[i])) { - GST_DEBUG_OBJECT (h265parse, "sending VPS nal"); - gst_h265_parse_push_codec_buffer (h265parse, codec_nal, - timestamp); - h265parse->last_report = new_ts; - } - } - for (i = 0; i < GST_H265_MAX_SPS_COUNT; i++) { - if ((codec_nal = h265parse->sps_nals[i])) { - GST_DEBUG_OBJECT (h265parse, "sending SPS nal"); - gst_h265_parse_push_codec_buffer (h265parse, codec_nal, - timestamp); - h265parse->last_report = new_ts; - } - } - for (i = 0; i < GST_H265_MAX_PPS_COUNT; i++) { - if ((codec_nal = h265parse->pps_nals[i])) { - GST_DEBUG_OBJECT (h265parse, "sending PPS nal"); - gst_h265_parse_push_codec_buffer (h265parse, codec_nal, - timestamp); - h265parse->last_report = new_ts; - } - } - } else { - /* insert config NALs into AU */ - GstByteWriter bw; - GstBuffer *new_buf; - const gboolean bs = h265parse->format == GST_H265_PARSE_FORMAT_BYTE; - const gint nls = 4 - h265parse->nal_length_size; - gboolean ok; - - gst_byte_writer_init_with_size (&bw, gst_buffer_get_size (buffer), - FALSE); - ok = gst_byte_writer_put_buffer (&bw, buffer, 0, h265parse->idr_pos); - GST_DEBUG_OBJECT (h265parse, "- inserting VPS/SPS/PPS"); - for (i = 0; i < GST_H265_MAX_VPS_COUNT; i++) { - if ((codec_nal = h265parse->vps_nals[i])) { - gsize nal_size = gst_buffer_get_size (codec_nal); - GST_DEBUG_OBJECT (h265parse, "inserting VPS nal"); - if (bs) { - ok &= gst_byte_writer_put_uint32_be (&bw, 1); - } else { - ok &= gst_byte_writer_put_uint32_be (&bw, - (nal_size << (nls * 8))); - ok &= gst_byte_writer_set_pos (&bw, - gst_byte_writer_get_pos (&bw) - nls); - } - - ok &= gst_byte_writer_put_buffer (&bw, codec_nal, 0, nal_size); - h265parse->last_report = new_ts; - } - } - for (i = 0; i < GST_H265_MAX_SPS_COUNT; i++) { - if ((codec_nal = h265parse->sps_nals[i])) { - gsize nal_size = gst_buffer_get_size (codec_nal); - GST_DEBUG_OBJECT (h265parse, "inserting SPS nal"); - if (bs) { - ok &= gst_byte_writer_put_uint32_be (&bw, 1); - } else { - ok &= gst_byte_writer_put_uint32_be (&bw, - (nal_size << (nls * 8))); - ok &= gst_byte_writer_set_pos (&bw, - gst_byte_writer_get_pos (&bw) - nls); - } - - ok &= gst_byte_writer_put_buffer (&bw, codec_nal, 0, nal_size); - h265parse->last_report = new_ts; - } - } - for (i = 0; i < GST_H265_MAX_PPS_COUNT; i++) { - if ((codec_nal = h265parse->pps_nals[i])) { - gsize nal_size = gst_buffer_get_size (codec_nal); - GST_DEBUG_OBJECT (h265parse, "inserting PPS nal"); - if (bs) { - ok &= gst_byte_writer_put_uint32_be (&bw, 1); - } else { - ok &= gst_byte_writer_put_uint32_be (&bw, - (nal_size << (nls * 8))); - ok &= gst_byte_writer_set_pos (&bw, - gst_byte_writer_get_pos (&bw) - nls); - } - ok &= gst_byte_writer_put_buffer (&bw, codec_nal, 0, nal_size); - h265parse->last_report = new_ts; - } - } - ok &= - gst_byte_writer_put_buffer (&bw, buffer, h265parse->idr_pos, -1); - /* collect result and push */ - new_buf = gst_byte_writer_reset_and_get_buffer (&bw); - gst_buffer_copy_into (new_buf, buffer, GST_BUFFER_COPY_METADATA, 0, - -1); - /* should already be keyframe/IDR, but it may not have been, - * so mark it as such to avoid being discarded by picky decoder */ - GST_BUFFER_FLAG_UNSET (new_buf, GST_BUFFER_FLAG_DELTA_UNIT); - gst_buffer_replace (&frame->out_buffer, new_buf); - gst_buffer_unref (new_buf); - /* some result checking seems to make some compilers happy */ - if (G_UNLIKELY (!ok)) { - GST_ERROR_OBJECT (h265parse, "failed to insert SPS/PPS"); - } - } - } - /* we pushed whatever we had */ - h265parse->push_codec = FALSE; - h265parse->have_vps = FALSE; - h265parse->have_sps = FALSE; - h265parse->have_pps = FALSE; - } - } - - gst_h265_parse_reset_frame (h265parse); - - return GST_FLOW_OK; -} - -static gboolean -gst_h265_parse_set_caps (GstBaseParse * parse, GstCaps * caps) -{ - GstH265Parse *h265parse; - GstStructure *str; - const GValue *value; - GstBuffer *codec_data = NULL; - gsize off, size; - guint format, align; - guint num_nals, i, j; - GstH265NalUnit nalu; - GstH265ParserResult parseres; - - h265parse = GST_H265_PARSE (parse); - - /* reset */ - h265parse->push_codec = FALSE; - - str = gst_caps_get_structure (caps, 0); - - /* accept upstream info if provided */ - gst_structure_get_int (str, "width", &h265parse->width); - gst_structure_get_int (str, "height", &h265parse->height); - gst_structure_get_fraction (str, "framerate", &h265parse->fps_num, - &h265parse->fps_den); - gst_structure_get_fraction (str, "pixel-aspect-ratio", - &h265parse->upstream_par_n, &h265parse->upstream_par_d); - - /* get upstream format and align from caps */ - gst_h265_parse_format_from_caps (caps, &format, &align); - - /* packetized video has a codec_data */ - if (format != GST_H265_PARSE_FORMAT_BYTE && - (value = gst_structure_get_value (str, "codec_data"))) { - GstMapInfo map; - guint8 *data; - - GST_DEBUG_OBJECT (h265parse, "have packetized h265"); - /* make note for optional split processing */ - h265parse->packetized = TRUE; - - codec_data = gst_value_get_buffer (value); - if (!codec_data) - goto wrong_type; - gst_buffer_map (codec_data, &map, GST_MAP_READ); - data = map.data; - size = map.size; - - /* parse the hvcC data */ - if (size < 23) { - gst_buffer_unmap (codec_data, &map); - goto hvcc_too_small; - } - /* parse the version, this must be one but - * is zero until the spec is finalized */ - if (data[0] != 0 && data[0] != 1) { - gst_buffer_unmap (codec_data, &map); - goto wrong_version; - } - - h265parse->nal_length_size = (data[21] & 0x03) + 1; - GST_DEBUG_OBJECT (h265parse, "nal length size %u", - h265parse->nal_length_size); - - off = 23; - for (i = 0; i < data[22]; i++) { - num_nals = GST_READ_UINT16_BE (data + off + 1); - for (j = 0; j < num_nals; j++) { - parseres = gst_h265_parser_identify_nalu_hevc (h265parse->nalparser, - data, off + 3, size, 2, &nalu); - - if (parseres != GST_H265_PARSER_OK) { - gst_buffer_unmap (codec_data, &map); - goto hvcc_too_small; - } - - gst_h265_parse_process_nal (h265parse, &nalu); - off = nalu.offset + nalu.size; - } - } - - } else { - GST_DEBUG_OBJECT (h265parse, "have bytestream h265"); - /* nothing to pre-process */ - h265parse->packetized = FALSE; - /* we have 4 sync bytes */ - h265parse->nal_length_size = 4; - - if (format == GST_H265_PARSE_FORMAT_NONE) { - format = GST_H265_PARSE_FORMAT_BYTE; - align = GST_H265_PARSE_ALIGN_AU; - } - } - - { - GstCaps *in_caps; - - /* prefer input type determined above */ - in_caps = gst_caps_new_simple ("video/x-h265", - "parsed", G_TYPE_BOOLEAN, TRUE, - "stream-format", G_TYPE_STRING, - gst_h265_parse_get_string (h265parse, TRUE, format), - "alignment", G_TYPE_STRING, - gst_h265_parse_get_string (h265parse, FALSE, align), NULL); - /* negotiate with downstream, sets ->format and ->align */ - gst_h265_parse_negotiate (h265parse, format, in_caps); - gst_caps_unref (in_caps); - } - - if (format == h265parse->format && align == h265parse->align) { - /* do not set CAPS and passthrough mode if SPS/PPS have not been parsed */ - if (h265parse->have_sps && h265parse->have_pps) { - gst_base_parse_set_passthrough (parse, TRUE); - - /* we did parse codec-data and might supplement src caps */ - gst_h265_parse_update_src_caps (h265parse, caps); - } - } else if (format == GST_H265_PARSE_FORMAT_HVC1 - || format == GST_H265_PARSE_FORMAT_HEV1) { - /* if input != output, and input is hevc, must split before anything else */ - /* arrange to insert codec-data in-stream if needed. - * src caps are only arranged for later on */ - h265parse->push_codec = TRUE; - h265parse->have_vps = FALSE; - h265parse->have_sps = FALSE; - h265parse->have_pps = FALSE; - if (h265parse->align == GST_H265_PARSE_ALIGN_NAL) - h265parse->split_packetized = TRUE; - h265parse->packetized = TRUE; - } - - return TRUE; - - /* ERRORS */ -hvcc_too_small: - { - GST_DEBUG_OBJECT (h265parse, "hvcC size %" G_GSIZE_FORMAT " < 23", size); - goto refuse_caps; - } -wrong_version: - { - GST_DEBUG_OBJECT (h265parse, "wrong hvcC version"); - goto refuse_caps; - } -wrong_type: - { - GST_DEBUG_OBJECT (h265parse, "wrong codec-data type"); - goto refuse_caps; - } -refuse_caps: - { - GST_WARNING_OBJECT (h265parse, "refused caps %" GST_PTR_FORMAT, caps); - return FALSE; - } -} - -static void -remove_fields (GstCaps * caps) -{ - guint i, n; - - n = gst_caps_get_size (caps); - for (i = 0; i < n; i++) { - GstStructure *s = gst_caps_get_structure (caps, i); - - gst_structure_remove_field (s, "alignment"); - gst_structure_remove_field (s, "stream-format"); - gst_structure_remove_field (s, "parsed"); - } -} - -static GstCaps * -gst_h265_parse_get_caps (GstBaseParse * parse, GstCaps * filter) -{ - GstCaps *peercaps, *templ; - GstCaps *res; - - templ = gst_pad_get_pad_template_caps (GST_BASE_PARSE_SINK_PAD (parse)); - if (filter) { - GstCaps *fcopy = gst_caps_copy (filter); - /* Remove the fields we convert */ - remove_fields (fcopy); - peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), fcopy); - gst_caps_unref (fcopy); - } else - peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), NULL); - - if (peercaps) { - peercaps = gst_caps_make_writable (peercaps); - remove_fields (peercaps); - - res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST); - gst_caps_unref (peercaps); - gst_caps_unref (templ); - } else { - res = templ; - } - - if (filter) { - GstCaps *tmp = gst_caps_intersect_full (res, filter, - GST_CAPS_INTERSECT_FIRST); - gst_caps_unref (res); - res = tmp; - } - - return res; -} - -static gboolean -gst_h265_parse_event (GstBaseParse * parse, GstEvent * event) -{ - gboolean res; - GstH265Parse *h265parse = GST_H265_PARSE (parse); - - switch (GST_EVENT_TYPE (event)) { - case GST_EVENT_CUSTOM_DOWNSTREAM: - { - GstClockTime timestamp, stream_time, running_time; - gboolean all_headers; - guint count; - - if (gst_video_event_is_force_key_unit (event)) { - gst_video_event_parse_downstream_force_key_unit (event, - ×tamp, &stream_time, &running_time, &all_headers, &count); - - GST_INFO_OBJECT (h265parse, "received downstream force key unit event, " - "seqnum %d running_time %" GST_TIME_FORMAT - " all_headers %d count %d", gst_event_get_seqnum (event), - GST_TIME_ARGS (running_time), all_headers, count); - if (h265parse->force_key_unit_event) { - GST_INFO_OBJECT (h265parse, "ignoring force key unit event " - "as one is already queued"); - } else { - h265parse->pending_key_unit_ts = running_time; - gst_event_replace (&h265parse->force_key_unit_event, event); - } - gst_event_unref (event); - res = TRUE; - } else { - res = GST_BASE_PARSE_CLASS (parent_class)->sink_event (parse, event); - break; - } - break; - } - case GST_EVENT_FLUSH_STOP: - - res = GST_BASE_PARSE_CLASS (parent_class)->sink_event (parse, event); - break; - case GST_EVENT_SEGMENT: - { - res = GST_BASE_PARSE_CLASS (parent_class)->sink_event (parse, event); - break; - } - default: - res = GST_BASE_PARSE_CLASS (parent_class)->sink_event (parse, event); - break; - } - return res; -} - -static gboolean -gst_h265_parse_src_event (GstBaseParse * parse, GstEvent * event) -{ - gboolean res; - GstH265Parse *h265parse = GST_H265_PARSE (parse); - - switch (GST_EVENT_TYPE (event)) { - case GST_EVENT_CUSTOM_UPSTREAM: - { - GstClockTime running_time; - gboolean all_headers; - guint count; - - if (gst_video_event_is_force_key_unit (event)) { - gst_video_event_parse_upstream_force_key_unit (event, - &running_time, &all_headers, &count); - - GST_INFO_OBJECT (h265parse, "received upstream force-key-unit event, " - "seqnum %d running_time %" GST_TIME_FORMAT - " all_headers %d count %d", gst_event_get_seqnum (event), - GST_TIME_ARGS (running_time), all_headers, count); - - if (all_headers) { - h265parse->pending_key_unit_ts = running_time; - gst_event_replace (&h265parse->force_key_unit_event, event); - } - } - res = GST_BASE_PARSE_CLASS (parent_class)->src_event (parse, event); - break; - } - default: - res = GST_BASE_PARSE_CLASS (parent_class)->src_event (parse, event); - break; - } - - return res; -} - -static void -gst_h265_parse_set_property (GObject * object, guint prop_id, - const GValue * value, GParamSpec * pspec) -{ - GstH265Parse *parse; - parse = GST_H265_PARSE (object); - - switch (prop_id) { - case PROP_CONFIG_INTERVAL: - parse->interval = g_value_get_uint (value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -gst_h265_parse_get_property (GObject * object, guint prop_id, GValue * value, - GParamSpec * pspec) -{ - GstH265Parse *parse; - parse = GST_H265_PARSE (object); - - switch (prop_id) { - case PROP_CONFIG_INTERVAL: - g_value_set_uint (value, parse->interval); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst/videoparsers/gsth265parse.h gstreamer-vaapi-1.8.2/ext/codecparsers/gst/videoparsers/gsth265parse.h --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst/videoparsers/gsth265parse.h 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst/videoparsers/gsth265parse.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,105 +0,0 @@ -/* GStreamer H.265 Parser - * Copyright (C) 2013 Intel Corporation - * Contact: Sreerenj Balachandran - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef __GST_H265_PARSE_H__ -#define __GST_H265_PARSE_H__ - -#include -#include -#include - -G_BEGIN_DECLS - -#define GST_TYPE_H265_PARSE \ - (gst_h265_parse_get_type()) -#define GST_H265_PARSE(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_H265_PARSE,GstH265Parse)) -#define GST_H265_PARSE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_H265_PARSE,GstH265ParseClass)) -#define GST_IS_H265_PARSE(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_H265_PARSE)) -#define GST_IS_H265_PARSE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_H265_PARSE)) - -GType gst_h265_parse_get_type (void); - -typedef struct _GstH265Parse GstH265Parse; -typedef struct _GstH265ParseClass GstH265ParseClass; - -struct _GstH265Parse -{ - GstBaseParse baseparse; - - /* stream */ - gint width, height; - gint fps_num, fps_den; - gint upstream_par_n, upstream_par_d; - gint parsed_par_n, parsed_par_d; - /* current codec_data in output caps, if any */ - GstBuffer *codec_data; - /* input codec_data, if any */ - GstBuffer *codec_data_in; - guint nal_length_size; - gboolean packetized; - gboolean split_packetized; - gboolean transform; - - /* state */ - GstH265Parser *nalparser; - guint align; - guint format; - gint current_off; - - GstClockTime last_report; - gboolean push_codec; - gboolean have_vps; - gboolean have_sps; - gboolean have_pps; - - /* collected SPS and PPS NALUs */ - GstBuffer *vps_nals[GST_H265_MAX_VPS_COUNT]; - GstBuffer *sps_nals[GST_H265_MAX_SPS_COUNT]; - GstBuffer *pps_nals[GST_H265_MAX_PPS_COUNT]; - - /* frame parsing */ - gint idr_pos, sei_pos; - gboolean update_caps; - GstAdapter *frame_out; - gboolean keyframe; - gboolean header; - /* AU state */ - gboolean picture_start; - - /* props */ - guint interval; - - gboolean sent_codec_tag; - - GstClockTime pending_key_unit_ts; - GstEvent *force_key_unit_event; -}; - -struct _GstH265ParseClass -{ - GstBaseParseClass parent_class; -}; - -G_END_DECLS -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/dboolhuff.c gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/dboolhuff.c --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/dboolhuff.c 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/dboolhuff.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "dboolhuff.h" - -int -vp8dx_start_decode (BOOL_DECODER * br, - const unsigned char *source, - unsigned int source_sz, vp8_decrypt_cb * decrypt_cb, void *decrypt_state) -{ - br->user_buffer_end = source + source_sz; - br->user_buffer = source; - br->value = 0; - br->count = -8; - br->range = 255; - br->decrypt_cb = decrypt_cb; - br->decrypt_state = decrypt_state; - - if (source_sz && !source) - return 1; - - /* Populate the buffer */ - vp8dx_bool_decoder_fill (br); - - return 0; -} - -void -vp8dx_bool_decoder_fill (BOOL_DECODER * br) -{ - const unsigned char *bufptr = br->user_buffer; - VP8_BD_VALUE value = br->value; - int count = br->count; - int shift = VP8_BD_VALUE_SIZE - 8 - (count + 8); - size_t bytes_left = br->user_buffer_end - bufptr; - size_t bits_left = bytes_left * CHAR_BIT; - int x = (int) (shift + CHAR_BIT - bits_left); - int loop_end = 0; - unsigned char decrypted[sizeof (VP8_BD_VALUE) + 1]; - - if (br->decrypt_cb) { - size_t n = - bytes_left > sizeof (decrypted) ? sizeof (decrypted) : bytes_left; - br->decrypt_cb (br->decrypt_state, bufptr, decrypted, (int) n); - bufptr = decrypted; - } - - if (x >= 0) { - count += VP8_LOTS_OF_BITS; - loop_end = x; - } - - if (x < 0 || bits_left) { - while (shift >= loop_end) { - count += CHAR_BIT; - value |= (VP8_BD_VALUE) * bufptr << shift; - ++bufptr; - ++br->user_buffer; - shift -= CHAR_BIT; - } - } - - br->value = value; - br->count = count; -} diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/dboolhuff.h gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/dboolhuff.h --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/dboolhuff.h 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/dboolhuff.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef DBOOLHUFF_H_ -#define DBOOLHUFF_H_ - -#include -#include -#include - -typedef size_t VP8_BD_VALUE; - -#define VP8_BD_VALUE_SIZE ((int)sizeof(VP8_BD_VALUE)*CHAR_BIT) - -/*This is meant to be a large, positive constant that can still be efficiently - loaded as an immediate (on platforms like ARM, for example). - Even relatively modest values like 100 would work fine.*/ -#define VP8_LOTS_OF_BITS (0x40000000) - -/*Decrypt n bytes of data from input -> output, using the decrypt_state - passed in VP8D_SET_DECRYPTOR. -*/ -typedef void (vp8_decrypt_cb)(void *decrypt_state, const unsigned char *input, - unsigned char *output, int count); - -typedef struct -{ - const unsigned char *user_buffer_end; - const unsigned char *user_buffer; - VP8_BD_VALUE value; - int count; - unsigned int range; - vp8_decrypt_cb *decrypt_cb; - void *decrypt_state; -} BOOL_DECODER; - -extern const unsigned char vp8_norm[256]; - -int vp8dx_start_decode(BOOL_DECODER *br, - const unsigned char *source, - unsigned int source_sz, - vp8_decrypt_cb *decrypt_cb, - void *decrypt_state); - -void vp8dx_bool_decoder_fill(BOOL_DECODER *br); - - -static inline int vp8dx_decode_bool(BOOL_DECODER *br, int probability) { - unsigned int bit = 0; - VP8_BD_VALUE value; - unsigned int split; - VP8_BD_VALUE bigsplit; - int count; - unsigned int range; - - split = 1 + (((br->range - 1) * probability) >> 8); - - if(br->count < 0) - vp8dx_bool_decoder_fill(br); - - value = br->value; - count = br->count; - - bigsplit = (VP8_BD_VALUE)split << (VP8_BD_VALUE_SIZE - 8); - - range = split; - - if (value >= bigsplit) - { - range = br->range - split; - value = value - bigsplit; - bit = 1; - } - - { - register unsigned int shift = vp8_norm[range]; - range <<= shift; - value <<= shift; - count -= shift; - } - br->value = value; - br->count = count; - br->range = range; - - return bit; -} - -static inline int vp8_decode_value(BOOL_DECODER *br, int bits) -{ - int z = 0; - int bit; - - for (bit = bits - 1; bit >= 0; bit--) - { - z |= (vp8dx_decode_bool(br, 0x80) << bit); - } - - return z; -} - -static inline int vp8dx_bool_error(BOOL_DECODER *br) -{ - /* Check if we have reached the end of the buffer. - * - * Variable 'count' stores the number of bits in the 'value' buffer, minus - * 8. The top byte is part of the algorithm, and the remainder is buffered - * to be shifted into it. So if count == 8, the top 16 bits of 'value' are - * occupied, 8 for the algorithm and 8 in the buffer. - * - * When reading a byte from the user's buffer, count is filled with 8 and - * one byte is filled into the value buffer. When we reach the end of the - * data, count is additionally filled with VP8_LOTS_OF_BITS. So when - * count == VP8_LOTS_OF_BITS - 1, the user's data has been exhausted. - */ - if ((br->count > VP8_BD_VALUE_SIZE) && (br->count < VP8_LOTS_OF_BITS)) - { - /* We have tried to decode bits after the end of - * stream was encountered. - */ - return 1; - } - - /* No error. */ - return 0; -} - -#endif // DBOOLHUFF_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gsth264parser.c gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gsth264parser.c --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gsth264parser.c 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gsth264parser.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2508 +0,0 @@ -/* Gstreamer - * Copyright (C) <2011> Intel Corporation - * Copyright (C) <2011> Collabora Ltd. - * Copyright (C) <2011> Thibault Saunier - * - * Some bits C-c,C-v'ed and s/4/3 from h264parse and videoparsers/h264parse.c: - * Copyright (C) <2010> Mark Nauwelaerts - * Copyright (C) <2010> Collabora Multimedia - * Copyright (C) <2010> Nokia Corporation - * - * (C) 2005 Michal Benes - * (C) 2008 Wim Taymans - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -/** - * SECTION:gsth264parser - * @short_description: Convenience library for h264 video - * bitstream parsing. - * - * It offers you bitstream parsing in AVC mode or not. To identify Nals in a bitstream and - * parse its headers, you should call: - * - * - * #gst_h264_parser_identify_nalu to identify the following nalu in not AVC bitstreams - * - * - * #gst_h264_parser_identify_nalu_avc to identify the nalu in AVC bitstreams - * - * - * - * Then, depending on the #GstH264NalUnitType of the newly parsed #GstH264NalUnit, you should - * call the differents functions to parse the structure: - * - * - * From #GST_H264_NAL_SLICE to #GST_H264_NAL_SLICE_IDR: #gst_h264_parser_parse_slice_hdr - * - * - * #GST_H264_NAL_SEI: #gst_h264_parser_parse_sei - * - * - * #GST_H264_NAL_SPS: #gst_h264_parser_parse_sps - * - * - * #GST_H264_NAL_PPS: #gst_h264_parser_parse_pps - * - * - * Any other: #gst_h264_parser_parse_nal - * - * - * - * Note: You should always call gst_h264_parser_parse_nal if you don't actually need - * #GstH264NalUnitType to be parsed for your personnal use, in order to guarantee that the - * #GstH264NalParser is always up to date. - * - * For more details about the structures, look at the ITU-T H.264 and ISO/IEC 14496-10 – MPEG-4 - * Part 10 specifications, you can download them from: - * - * - * - * ITU-T H.264: http://www.itu.int/rec/T-REC-H.264 - * - * - * ISO/IEC 14496-10: http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=56538 - * - * - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "nalutils.h" -#include "gsth264parser.h" - -#include -#include -#include - -GST_DEBUG_CATEGORY (h264_parser_debug); -#define GST_CAT_DEFAULT h264_parser_debug - -static gboolean initialized = FALSE; -#define INITIALIZE_DEBUG_CATEGORY \ - if (!initialized) { \ - GST_DEBUG_CATEGORY_INIT (h264_parser_debug, "codecparsers_h264", 0, \ - "h264 parser library"); \ - initialized = TRUE; \ - } - -/**** Default scaling_lists according to Table 7-2 *****/ -static const guint8 default_4x4_intra[16] = { - 6, 13, 13, 20, 20, 20, 28, 28, 28, 28, 32, 32, - 32, 37, 37, 42 -}; - -static const guint8 default_4x4_inter[16] = { - 10, 14, 14, 20, 20, 20, 24, 24, 24, 24, 27, 27, - 27, 30, 30, 34 -}; - -static const guint8 default_8x8_intra[64] = { - 6, 10, 10, 13, 11, 13, 16, 16, 16, 16, 18, 18, - 18, 18, 18, 23, 23, 23, 23, 23, 23, 25, 25, 25, 25, 25, 25, 25, 27, 27, 27, - 27, 27, 27, 27, 27, 29, 29, 29, 29, 29, 29, 29, 31, 31, 31, 31, 31, 31, 33, - 33, 33, 33, 33, 36, 36, 36, 36, 38, 38, 38, 40, 40, 42 -}; - -static const guint8 default_8x8_inter[64] = { - 9, 13, 13, 15, 13, 15, 17, 17, 17, 17, 19, 19, - 19, 19, 19, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 24, 24, 24, - 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 27, 27, 27, 27, 27, 27, 28, - 28, 28, 28, 28, 30, 30, 30, 30, 32, 32, 32, 33, 33, 35 -}; - -static const guint8 zigzag_8x8[64] = { - 0, 1, 8, 16, 9, 2, 3, 10, - 17, 24, 32, 25, 18, 11, 4, 5, - 12, 19, 26, 33, 40, 48, 41, 34, - 27, 20, 13, 6, 7, 14, 21, 28, - 35, 42, 49, 56, 57, 50, 43, 36, - 29, 22, 15, 23, 30, 37, 44, 51, - 58, 59, 52, 45, 38, 31, 39, 46, - 53, 60, 61, 54, 47, 55, 62, 63 -}; - -static const guint8 zigzag_4x4[16] = { - 0, 1, 4, 8, - 5, 2, 3, 6, - 9, 12, 13, 10, - 7, 11, 14, 15, -}; - -typedef struct -{ - guint par_n, par_d; -} PAR; - -/* Table E-1 - Meaning of sample aspect ratio indicator (1..16) */ -static const PAR aspect_ratios[17] = { - {0, 0}, - {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} -}; - -/***** Utils ****/ -#define EXTENDED_SAR 255 - -static GstH264SPS * -gst_h264_parser_get_sps (GstH264NalParser * nalparser, guint8 sps_id) -{ - GstH264SPS *sps; - - sps = &nalparser->sps[sps_id]; - - if (sps->valid) - return sps; - - return NULL; -} - -static GstH264PPS * -gst_h264_parser_get_pps (GstH264NalParser * nalparser, guint8 pps_id) -{ - GstH264PPS *pps; - - pps = &nalparser->pps[pps_id]; - - if (pps->valid) - return pps; - - return NULL; -} - -static gboolean -gst_h264_parse_nalu_header (GstH264NalUnit * nalu) -{ - guint8 *data = nalu->data + nalu->offset; - guint8 svc_extension_flag; - GstBitReader br; - - if (nalu->size < 1) - return FALSE; - - nalu->type = (data[0] & 0x1f); - nalu->ref_idc = (data[0] & 0x60) >> 5; - nalu->idr_pic_flag = (nalu->type == 5 ? 1 : 0); - nalu->header_bytes = 1; - - nalu->extension_type = GST_H264_NAL_EXTENSION_NONE; - - switch (nalu->type) { - case GST_H264_NAL_PREFIX_UNIT: - case GST_H264_NAL_SLICE_EXT: - if (nalu->size < 4) - return FALSE; - gst_bit_reader_init (&br, nalu->data + nalu->offset + nalu->header_bytes, - nalu->size - nalu->header_bytes); - - svc_extension_flag = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - if (svc_extension_flag) { /* SVC */ - - nalu->extension_type = GST_H264_NAL_EXTENSION_SVC; - - } else { /* MVC */ - GstH264NalUnitExtensionMVC *const mvc = &nalu->extension.mvc; - - nalu->extension_type = GST_H264_NAL_EXTENSION_MVC; - mvc->non_idr_flag = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - mvc->priority_id = gst_bit_reader_get_bits_uint8_unchecked (&br, 6); - mvc->view_id = gst_bit_reader_get_bits_uint16_unchecked (&br, 10); - mvc->temporal_id = gst_bit_reader_get_bits_uint8_unchecked (&br, 3); - mvc->anchor_pic_flag = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - mvc->inter_view_flag = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - - /* Update IdrPicFlag (H.7.4.1.1) */ - nalu->idr_pic_flag = !mvc->non_idr_flag; - } - nalu->header_bytes += 3; - break; - default: - break; - } - - GST_DEBUG ("Nal type %u, ref_idc %u", nalu->type, nalu->ref_idc); - return TRUE; -} - -/* - * gst_h264_pps_copy: - * @dst_pps: The destination #GstH264PPS to copy into - * @src_pps: The source #GstH264PPS to copy from - * - * Copies @src_pps into @dst_pps. - * - * Returns: %TRUE if everything went fine, %FALSE otherwise - */ -static gboolean -gst_h264_pps_copy (GstH264PPS * dst_pps, const GstH264PPS * src_pps) -{ - g_return_val_if_fail (dst_pps != NULL, FALSE); - g_return_val_if_fail (src_pps != NULL, FALSE); - - gst_h264_pps_clear (dst_pps); - - *dst_pps = *src_pps; - - if (src_pps->slice_group_id) - dst_pps->slice_group_id = g_memdup (src_pps->slice_group_id, - src_pps->pic_size_in_map_units_minus1 + 1); - - return TRUE; -} - -/* Copy MVC-specific data for subset SPS header */ -static gboolean -gst_h264_sps_mvc_copy (GstH264SPS * dst_sps, const GstH264SPS * src_sps) -{ - GstH264SPSExtMVC *const dst_mvc = &dst_sps->extension.mvc; - const GstH264SPSExtMVC *const src_mvc = &src_sps->extension.mvc; - guint i, j, k; - - g_assert (dst_sps->extension_type == GST_H264_NAL_EXTENSION_MVC); - - dst_mvc->num_views_minus1 = src_mvc->num_views_minus1; - dst_mvc->view = g_new0 (GstH264SPSExtMVCView, dst_mvc->num_views_minus1 + 1); - if (!dst_mvc->view) - return FALSE; - - dst_mvc->view[0].view_id = src_mvc->view[0].view_id; - - for (i = 1; i <= dst_mvc->num_views_minus1; i++) { - GstH264SPSExtMVCView *const dst_view = &dst_mvc->view[i]; - const GstH264SPSExtMVCView *const src_view = &src_mvc->view[i]; - - dst_view->view_id = src_view->view_id; - - dst_view->num_anchor_refs_l0 = src_view->num_anchor_refs_l0; - for (j = 0; j < dst_view->num_anchor_refs_l0; j++) - dst_view->anchor_ref_l0[j] = src_view->anchor_ref_l0[j]; - - dst_view->num_anchor_refs_l1 = src_view->num_anchor_refs_l1; - for (j = 0; j < dst_view->num_anchor_refs_l1; j++) - dst_view->anchor_ref_l1[j] = src_view->anchor_ref_l1[j]; - - dst_view->num_non_anchor_refs_l0 = src_view->num_non_anchor_refs_l0; - for (j = 0; j < dst_view->num_non_anchor_refs_l0; j++) - dst_view->non_anchor_ref_l0[j] = src_view->non_anchor_ref_l0[j]; - - dst_view->num_non_anchor_refs_l1 = src_view->num_non_anchor_refs_l1; - for (j = 0; j < dst_view->num_non_anchor_refs_l1; j++) - dst_view->non_anchor_ref_l1[j] = src_view->non_anchor_ref_l1[j]; - } - - dst_mvc->num_level_values_signalled_minus1 = - src_mvc->num_level_values_signalled_minus1; - dst_mvc->level_value = g_new0 (GstH264SPSExtMVCLevelValue, - dst_mvc->num_level_values_signalled_minus1 + 1); - if (!dst_mvc->level_value) - return FALSE; - - for (i = 0; i <= dst_mvc->num_level_values_signalled_minus1; i++) { - GstH264SPSExtMVCLevelValue *const dst_value = &dst_mvc->level_value[i]; - const GstH264SPSExtMVCLevelValue *const src_value = - &src_mvc->level_value[i]; - - dst_value->level_idc = src_value->level_idc; - - dst_value->num_applicable_ops_minus1 = src_value->num_applicable_ops_minus1; - dst_value->applicable_op = g_new0 (GstH264SPSExtMVCLevelValueOp, - dst_value->num_applicable_ops_minus1 + 1); - if (!dst_value->applicable_op) - return FALSE; - - for (j = 0; j <= dst_value->num_applicable_ops_minus1; j++) { - GstH264SPSExtMVCLevelValueOp *const dst_op = &dst_value->applicable_op[j]; - const GstH264SPSExtMVCLevelValueOp *const src_op = - &src_value->applicable_op[j]; - - dst_op->temporal_id = src_op->temporal_id; - dst_op->num_target_views_minus1 = src_op->num_target_views_minus1; - dst_op->target_view_id = - g_new (guint16, dst_op->num_target_views_minus1 + 1); - if (!dst_op->target_view_id) - return FALSE; - - for (k = 0; k <= dst_op->num_target_views_minus1; k++) - dst_op->target_view_id[k] = src_op->target_view_id[k]; - dst_op->num_views_minus1 = src_op->num_views_minus1; - } - } - return TRUE; -} - -/* - * gst_h264_sps_copy: - * @dst_sps: The destination #GstH264SPS to copy into - * @src_sps: The source #GstH264SPS to copy from - * - * Copies @src_sps into @dst_sps. - * - * Returns: %TRUE if everything went fine, %FALSE otherwise - */ -static gboolean -gst_h264_sps_copy (GstH264SPS * dst_sps, const GstH264SPS * src_sps) -{ - g_return_val_if_fail (dst_sps != NULL, FALSE); - g_return_val_if_fail (src_sps != NULL, FALSE); - - gst_h264_sps_clear (dst_sps); - - *dst_sps = *src_sps; - - switch (dst_sps->extension_type) { - case GST_H264_NAL_EXTENSION_MVC: - if (!gst_h264_sps_mvc_copy (dst_sps, src_sps)) - return FALSE; - break; - } - return TRUE; -} - -/****** Parsing functions *****/ - -static gboolean -gst_h264_parse_hrd_parameters (GstH264HRDParams * hrd, NalReader * nr) -{ - guint sched_sel_idx; - - GST_DEBUG ("parsing \"HRD Parameters\""); - - READ_UE_MAX (nr, hrd->cpb_cnt_minus1, 31); - READ_UINT8 (nr, hrd->bit_rate_scale, 4); - READ_UINT8 (nr, hrd->cpb_size_scale, 4); - - for (sched_sel_idx = 0; sched_sel_idx <= hrd->cpb_cnt_minus1; sched_sel_idx++) { - READ_UE (nr, hrd->bit_rate_value_minus1[sched_sel_idx]); - READ_UE (nr, hrd->cpb_size_value_minus1[sched_sel_idx]); - READ_UINT8 (nr, hrd->cbr_flag[sched_sel_idx], 1); - } - - READ_UINT8 (nr, hrd->initial_cpb_removal_delay_length_minus1, 5); - READ_UINT8 (nr, hrd->cpb_removal_delay_length_minus1, 5); - READ_UINT8 (nr, hrd->dpb_output_delay_length_minus1, 5); - READ_UINT8 (nr, hrd->time_offset_length, 5); - - return TRUE; - -error: - GST_WARNING ("error parsing \"HRD Parameters\""); - return FALSE; -} - -static gboolean -gst_h264_parse_vui_parameters (GstH264SPS * sps, NalReader * nr) -{ - GstH264VUIParams *vui = &sps->vui_parameters; - - GST_DEBUG ("parsing \"VUI Parameters\""); - - /* set default values for fields that might not be present in the bitstream - and have valid defaults */ - vui->video_format = 5; - vui->colour_primaries = 2; - vui->transfer_characteristics = 2; - vui->matrix_coefficients = 2; - - READ_UINT8 (nr, vui->aspect_ratio_info_present_flag, 1); - if (vui->aspect_ratio_info_present_flag) { - READ_UINT8 (nr, vui->aspect_ratio_idc, 8); - if (vui->aspect_ratio_idc == EXTENDED_SAR) { - READ_UINT16 (nr, vui->sar_width, 16); - READ_UINT16 (nr, vui->sar_height, 16); - vui->par_n = vui->sar_width; - vui->par_d = vui->sar_height; - } else if (vui->aspect_ratio_idc <= 16) { - vui->par_n = aspect_ratios[vui->aspect_ratio_idc].par_n; - vui->par_d = aspect_ratios[vui->aspect_ratio_idc].par_d; - } - } - - READ_UINT8 (nr, vui->overscan_info_present_flag, 1); - if (vui->overscan_info_present_flag) - READ_UINT8 (nr, vui->overscan_appropriate_flag, 1); - - READ_UINT8 (nr, vui->video_signal_type_present_flag, 1); - if (vui->video_signal_type_present_flag) { - - READ_UINT8 (nr, vui->video_format, 3); - READ_UINT8 (nr, vui->video_full_range_flag, 1); - READ_UINT8 (nr, vui->colour_description_present_flag, 1); - if (vui->colour_description_present_flag) { - READ_UINT8 (nr, vui->colour_primaries, 8); - READ_UINT8 (nr, vui->transfer_characteristics, 8); - READ_UINT8 (nr, vui->matrix_coefficients, 8); - } - } - - READ_UINT8 (nr, vui->chroma_loc_info_present_flag, 1); - if (vui->chroma_loc_info_present_flag) { - READ_UE_MAX (nr, vui->chroma_sample_loc_type_top_field, 5); - READ_UE_MAX (nr, vui->chroma_sample_loc_type_bottom_field, 5); - } - - READ_UINT8 (nr, vui->timing_info_present_flag, 1); - if (vui->timing_info_present_flag) { - READ_UINT32 (nr, vui->num_units_in_tick, 32); - if (vui->num_units_in_tick == 0) - GST_WARNING ("num_units_in_tick = 0 detected in stream " - "(incompliant to H.264 E.2.1)."); - - READ_UINT32 (nr, vui->time_scale, 32); - if (vui->time_scale == 0) - GST_WARNING ("time_scale = 0 detected in stream " - "(incompliant to H.264 E.2.1)."); - - READ_UINT8 (nr, vui->fixed_frame_rate_flag, 1); - } - - READ_UINT8 (nr, vui->nal_hrd_parameters_present_flag, 1); - if (vui->nal_hrd_parameters_present_flag) { - if (!gst_h264_parse_hrd_parameters (&vui->nal_hrd_parameters, nr)) - goto error; - } - - READ_UINT8 (nr, vui->vcl_hrd_parameters_present_flag, 1); - if (vui->vcl_hrd_parameters_present_flag) { - if (!gst_h264_parse_hrd_parameters (&vui->vcl_hrd_parameters, nr)) - goto error; - } - - if (vui->nal_hrd_parameters_present_flag || - vui->vcl_hrd_parameters_present_flag) - READ_UINT8 (nr, vui->low_delay_hrd_flag, 1); - - READ_UINT8 (nr, vui->pic_struct_present_flag, 1); - READ_UINT8 (nr, vui->bitstream_restriction_flag, 1); - if (vui->bitstream_restriction_flag) { - READ_UINT8 (nr, vui->motion_vectors_over_pic_boundaries_flag, 1); - READ_UE (nr, vui->max_bytes_per_pic_denom); - READ_UE_MAX (nr, vui->max_bits_per_mb_denom, 16); - READ_UE_MAX (nr, vui->log2_max_mv_length_horizontal, 16); - READ_UE_MAX (nr, vui->log2_max_mv_length_vertical, 16); - READ_UE (nr, vui->num_reorder_frames); - READ_UE (nr, vui->max_dec_frame_buffering); - } - - return TRUE; - -error: - GST_WARNING ("error parsing \"VUI Parameters\""); - return FALSE; -} - -static gboolean -gst_h264_parser_parse_scaling_list (NalReader * nr, - guint8 scaling_lists_4x4[6][16], guint8 scaling_lists_8x8[6][64], - const guint8 fallback_4x4_inter[16], const guint8 fallback_4x4_intra[16], - const guint8 fallback_8x8_inter[64], const guint8 fallback_8x8_intra[64], - guint8 n_lists) -{ - guint i; - - static const guint8 *default_lists[12] = { - default_4x4_intra, default_4x4_intra, default_4x4_intra, - default_4x4_inter, default_4x4_inter, default_4x4_inter, - default_8x8_intra, default_8x8_inter, - default_8x8_intra, default_8x8_inter, - default_8x8_intra, default_8x8_inter - }; - - GST_DEBUG ("parsing scaling lists"); - - for (i = 0; i < 12; i++) { - gboolean use_default = FALSE; - - if (i < n_lists) { - guint8 scaling_list_present_flag; - - READ_UINT8 (nr, scaling_list_present_flag, 1); - if (scaling_list_present_flag) { - guint8 *scaling_list; - guint size; - guint j; - guint8 last_scale, next_scale; - - if (i < 6) { - scaling_list = scaling_lists_4x4[i]; - size = 16; - } else { - scaling_list = scaling_lists_8x8[i - 6]; - size = 64; - } - - last_scale = 8; - next_scale = 8; - for (j = 0; j < size; j++) { - if (next_scale != 0) { - gint32 delta_scale; - - READ_SE (nr, delta_scale); - next_scale = (last_scale + delta_scale) & 0xff; - } - if (j == 0 && next_scale == 0) { - /* Use default scaling lists (7.4.2.1.1.1) */ - memcpy (scaling_list, default_lists[i], size); - break; - } - last_scale = scaling_list[j] = - (next_scale == 0) ? last_scale : next_scale; - } - } else - use_default = TRUE; - } else - use_default = TRUE; - - if (use_default) { - switch (i) { - case 0: - memcpy (scaling_lists_4x4[0], fallback_4x4_intra, 16); - break; - case 1: - memcpy (scaling_lists_4x4[1], scaling_lists_4x4[0], 16); - break; - case 2: - memcpy (scaling_lists_4x4[2], scaling_lists_4x4[1], 16); - break; - case 3: - memcpy (scaling_lists_4x4[3], fallback_4x4_inter, 16); - break; - case 4: - memcpy (scaling_lists_4x4[4], scaling_lists_4x4[3], 16); - break; - case 5: - memcpy (scaling_lists_4x4[5], scaling_lists_4x4[4], 16); - break; - case 6: - memcpy (scaling_lists_8x8[0], fallback_8x8_intra, 64); - break; - case 7: - memcpy (scaling_lists_8x8[1], fallback_8x8_inter, 64); - break; - case 8: - memcpy (scaling_lists_8x8[2], scaling_lists_8x8[0], 64); - break; - case 9: - memcpy (scaling_lists_8x8[3], scaling_lists_8x8[1], 64); - break; - case 10: - memcpy (scaling_lists_8x8[4], scaling_lists_8x8[2], 64); - break; - case 11: - memcpy (scaling_lists_8x8[5], scaling_lists_8x8[3], 64); - break; - - default: - break; - } - } - } - - return TRUE; - -error: - GST_WARNING ("error parsing scaling lists"); - return FALSE; -} - -static gboolean -slice_parse_ref_pic_list_modification_1 (GstH264SliceHdr * slice, - NalReader * nr, guint list, gboolean is_mvc) -{ - GstH264RefPicListModification *entries; - guint8 *ref_pic_list_modification_flag, *n_ref_pic_list_modification; - guint32 modification_of_pic_nums_idc; - gsize max_entries; - guint i = 0; - - if (list == 0) { - entries = slice->ref_pic_list_modification_l0; - max_entries = G_N_ELEMENTS (slice->ref_pic_list_modification_l0); - ref_pic_list_modification_flag = &slice->ref_pic_list_modification_flag_l0; - n_ref_pic_list_modification = &slice->n_ref_pic_list_modification_l0; - } else { - entries = slice->ref_pic_list_modification_l1; - max_entries = G_N_ELEMENTS (slice->ref_pic_list_modification_l1); - ref_pic_list_modification_flag = &slice->ref_pic_list_modification_flag_l1; - n_ref_pic_list_modification = &slice->n_ref_pic_list_modification_l1; - } - - READ_UINT8 (nr, *ref_pic_list_modification_flag, 1); - if (*ref_pic_list_modification_flag) { - while (1) { - READ_UE (nr, modification_of_pic_nums_idc); - if (modification_of_pic_nums_idc == 0 || - modification_of_pic_nums_idc == 1) { - READ_UE_MAX (nr, entries[i].value.abs_diff_pic_num_minus1, - slice->max_pic_num - 1); - } else if (modification_of_pic_nums_idc == 2) { - READ_UE (nr, entries[i].value.long_term_pic_num); - } else if (is_mvc && (modification_of_pic_nums_idc == 4 || - modification_of_pic_nums_idc == 5)) { - READ_UE (nr, entries[i].value.abs_diff_view_idx_minus1); - } - entries[i++].modification_of_pic_nums_idc = modification_of_pic_nums_idc; - if (modification_of_pic_nums_idc == 3) - break; - if (i >= max_entries) - goto error; - } - } - *n_ref_pic_list_modification = i; - return TRUE; - -error: - GST_WARNING ("error parsing \"Reference picture list %u modification\"", - list); - return FALSE; -} - -static gboolean -slice_parse_ref_pic_list_modification (GstH264SliceHdr * slice, NalReader * nr, - gboolean is_mvc) -{ - if (!GST_H264_IS_I_SLICE (slice) && !GST_H264_IS_SI_SLICE (slice)) { - if (!slice_parse_ref_pic_list_modification_1 (slice, nr, 0, is_mvc)) - return FALSE; - } - - if (GST_H264_IS_B_SLICE (slice)) { - if (!slice_parse_ref_pic_list_modification_1 (slice, nr, 1, is_mvc)) - return FALSE; - } - return TRUE; -} - -static gboolean -gst_h264_slice_parse_dec_ref_pic_marking (GstH264SliceHdr * slice, - GstH264NalUnit * nalu, NalReader * nr) -{ - GstH264DecRefPicMarking *dec_ref_pic_m; - - GST_DEBUG ("parsing \"Decoded reference picture marking\""); - - dec_ref_pic_m = &slice->dec_ref_pic_marking; - - if (nalu->idr_pic_flag) { - READ_UINT8 (nr, dec_ref_pic_m->no_output_of_prior_pics_flag, 1); - READ_UINT8 (nr, dec_ref_pic_m->long_term_reference_flag, 1); - } else { - READ_UINT8 (nr, dec_ref_pic_m->adaptive_ref_pic_marking_mode_flag, 1); - if (dec_ref_pic_m->adaptive_ref_pic_marking_mode_flag) { - guint32 mem_mgmt_ctrl_op; - GstH264RefPicMarking *refpicmarking; - - dec_ref_pic_m->n_ref_pic_marking = 0; - while (1) { - refpicmarking = - &dec_ref_pic_m->ref_pic_marking[dec_ref_pic_m->n_ref_pic_marking]; - - READ_UE (nr, mem_mgmt_ctrl_op); - if (mem_mgmt_ctrl_op == 0) - break; - - refpicmarking->memory_management_control_operation = mem_mgmt_ctrl_op; - - if (mem_mgmt_ctrl_op == 1 || mem_mgmt_ctrl_op == 3) - READ_UE (nr, refpicmarking->difference_of_pic_nums_minus1); - - if (mem_mgmt_ctrl_op == 2) - READ_UE (nr, refpicmarking->long_term_pic_num); - - if (mem_mgmt_ctrl_op == 3 || mem_mgmt_ctrl_op == 6) - READ_UE (nr, refpicmarking->long_term_frame_idx); - - if (mem_mgmt_ctrl_op == 4) - READ_UE (nr, refpicmarking->max_long_term_frame_idx_plus1); - - dec_ref_pic_m->n_ref_pic_marking++; - } - } - } - - return TRUE; - -error: - GST_WARNING ("error parsing \"Decoded reference picture marking\""); - return FALSE; -} - -static gboolean -gst_h264_slice_parse_pred_weight_table (GstH264SliceHdr * slice, - NalReader * nr, guint8 chroma_array_type) -{ - GstH264PredWeightTable *p; - gint16 default_luma_weight, default_chroma_weight; - gint i; - - GST_DEBUG ("parsing \"Prediction weight table\""); - - p = &slice->pred_weight_table; - - READ_UE_MAX (nr, p->luma_log2_weight_denom, 7); - /* set default values */ - default_luma_weight = 1 << p->luma_log2_weight_denom; - for (i = 0; i < G_N_ELEMENTS (p->luma_weight_l0); i++) - p->luma_weight_l0[i] = default_luma_weight; - if (GST_H264_IS_B_SLICE (slice)) { - for (i = 0; i < G_N_ELEMENTS (p->luma_weight_l1); i++) - p->luma_weight_l1[i] = default_luma_weight; - } - - if (chroma_array_type != 0) { - READ_UE_MAX (nr, p->chroma_log2_weight_denom, 7); - /* set default values */ - default_chroma_weight = 1 << p->chroma_log2_weight_denom; - for (i = 0; i < G_N_ELEMENTS (p->chroma_weight_l0); i++) { - p->chroma_weight_l0[i][0] = default_chroma_weight; - p->chroma_weight_l0[i][1] = default_chroma_weight; - } - if (GST_H264_IS_B_SLICE (slice)) { - for (i = 0; i < G_N_ELEMENTS (p->chroma_weight_l1); i++) { - p->chroma_weight_l1[i][0] = default_chroma_weight; - p->chroma_weight_l1[i][1] = default_chroma_weight; - } - } - } - - for (i = 0; i <= slice->num_ref_idx_l0_active_minus1; i++) { - guint8 luma_weight_l0_flag; - - READ_UINT8 (nr, luma_weight_l0_flag, 1); - if (luma_weight_l0_flag) { - READ_SE_ALLOWED (nr, p->luma_weight_l0[i], -128, 127); - READ_SE_ALLOWED (nr, p->luma_offset_l0[i], -128, 127); - } - if (chroma_array_type != 0) { - guint8 chroma_weight_l0_flag; - gint j; - - READ_UINT8 (nr, chroma_weight_l0_flag, 1); - if (chroma_weight_l0_flag) { - for (j = 0; j < 2; j++) { - READ_SE_ALLOWED (nr, p->chroma_weight_l0[i][j], -128, 127); - READ_SE_ALLOWED (nr, p->chroma_offset_l0[i][j], -128, 127); - } - } - } - } - - if (GST_H264_IS_B_SLICE (slice)) { - for (i = 0; i <= slice->num_ref_idx_l1_active_minus1; i++) { - guint8 luma_weight_l1_flag; - - READ_UINT8 (nr, luma_weight_l1_flag, 1); - if (luma_weight_l1_flag) { - READ_SE_ALLOWED (nr, p->luma_weight_l1[i], -128, 127); - READ_SE_ALLOWED (nr, p->luma_offset_l1[i], -128, 127); - } - if (chroma_array_type != 0) { - guint8 chroma_weight_l1_flag; - gint j; - - READ_UINT8 (nr, chroma_weight_l1_flag, 1); - if (chroma_weight_l1_flag) { - for (j = 0; j < 2; j++) { - READ_SE_ALLOWED (nr, p->chroma_weight_l1[i][j], -128, 127); - READ_SE_ALLOWED (nr, p->chroma_offset_l1[i][j], -128, 127); - } - } - } - } - } - - return TRUE; - -error: - GST_WARNING ("error parsing \"Prediction weight table\""); - return FALSE; -} - -static GstH264ParserResult -gst_h264_parser_parse_buffering_period (GstH264NalParser * nalparser, - GstH264BufferingPeriod * per, NalReader * nr) -{ - GstH264SPS *sps; - guint8 sps_id; - - GST_DEBUG ("parsing \"Buffering period\""); - - READ_UE_MAX (nr, sps_id, GST_H264_MAX_SPS_COUNT - 1); - sps = gst_h264_parser_get_sps (nalparser, sps_id); - if (!sps) { - GST_WARNING ("couldn't find associated sequence parameter set with id: %d", - sps_id); - return GST_H264_PARSER_BROKEN_LINK; - } - per->sps = sps; - - if (sps->vui_parameters_present_flag) { - GstH264VUIParams *vui = &sps->vui_parameters; - - if (vui->nal_hrd_parameters_present_flag) { - GstH264HRDParams *hrd = &vui->nal_hrd_parameters; - const guint8 nbits = hrd->initial_cpb_removal_delay_length_minus1 + 1; - guint8 sched_sel_idx; - - for (sched_sel_idx = 0; sched_sel_idx <= hrd->cpb_cnt_minus1; - sched_sel_idx++) { - READ_UINT32 (nr, per->nal_initial_cpb_removal_delay[sched_sel_idx], - nbits); - READ_UINT32 (nr, - per->nal_initial_cpb_removal_delay_offset[sched_sel_idx], nbits); - } - } - - if (vui->vcl_hrd_parameters_present_flag) { - GstH264HRDParams *hrd = &vui->vcl_hrd_parameters; - const guint8 nbits = hrd->initial_cpb_removal_delay_length_minus1 + 1; - guint8 sched_sel_idx; - - for (sched_sel_idx = 0; sched_sel_idx <= hrd->cpb_cnt_minus1; - sched_sel_idx++) { - READ_UINT32 (nr, per->vcl_initial_cpb_removal_delay[sched_sel_idx], - nbits); - READ_UINT32 (nr, - per->vcl_initial_cpb_removal_delay_offset[sched_sel_idx], nbits); - } - } - } - - return GST_H264_PARSER_OK; - -error: - GST_WARNING ("error parsing \"Buffering period\""); - return GST_H264_PARSER_ERROR; -} - -static gboolean -gst_h264_parse_clock_timestamp (GstH264ClockTimestamp * tim, - GstH264VUIParams * vui, NalReader * nr) -{ - guint8 full_timestamp_flag; - guint8 time_offset_length; - - GST_DEBUG ("parsing \"Clock timestamp\""); - - /* defalt values */ - tim->time_offset = 0; - - READ_UINT8 (nr, tim->ct_type, 2); - READ_UINT8 (nr, tim->nuit_field_based_flag, 1); - READ_UINT8 (nr, tim->counting_type, 5); - READ_UINT8 (nr, full_timestamp_flag, 1); - READ_UINT8 (nr, tim->discontinuity_flag, 1); - READ_UINT8 (nr, tim->cnt_dropped_flag, 1); - READ_UINT8 (nr, tim->n_frames, 8); - - if (full_timestamp_flag) { - tim->seconds_flag = TRUE; - READ_UINT8 (nr, tim->seconds_value, 6); - - tim->minutes_flag = TRUE; - READ_UINT8 (nr, tim->minutes_value, 6); - - tim->hours_flag = TRUE; - READ_UINT8 (nr, tim->hours_value, 5); - } else { - READ_UINT8 (nr, tim->seconds_flag, 1); - if (tim->seconds_flag) { - READ_UINT8 (nr, tim->seconds_value, 6); - READ_UINT8 (nr, tim->minutes_flag, 1); - if (tim->minutes_flag) { - READ_UINT8 (nr, tim->minutes_value, 6); - READ_UINT8 (nr, tim->hours_flag, 1); - if (tim->hours_flag) - READ_UINT8 (nr, tim->hours_value, 5); - } - } - } - - time_offset_length = 0; - if (vui->nal_hrd_parameters_present_flag) - time_offset_length = vui->nal_hrd_parameters.time_offset_length; - else if (vui->vcl_hrd_parameters_present_flag) - time_offset_length = vui->vcl_hrd_parameters.time_offset_length; - - if (time_offset_length > 0) - READ_UINT32 (nr, tim->time_offset, time_offset_length); - - return TRUE; - -error: - GST_WARNING ("error parsing \"Clock timestamp\""); - return FALSE; -} - -static GstH264ParserResult -gst_h264_parser_parse_pic_timing (GstH264NalParser * nalparser, - GstH264PicTiming * tim, NalReader * nr) -{ - GST_DEBUG ("parsing \"Picture timing\""); - if (!nalparser->last_sps || !nalparser->last_sps->valid) { - GST_WARNING ("didn't get the associated sequence paramater set for the " - "current access unit"); - goto error; - } - - if (nalparser->last_sps->vui_parameters_present_flag) { - GstH264VUIParams *vui = &nalparser->last_sps->vui_parameters; - - if (vui->nal_hrd_parameters_present_flag) { - READ_UINT32 (nr, tim->cpb_removal_delay, - vui->nal_hrd_parameters.cpb_removal_delay_length_minus1 + 1); - READ_UINT32 (nr, tim->dpb_output_delay, - vui->nal_hrd_parameters.dpb_output_delay_length_minus1 + 1); - } else if (vui->vcl_hrd_parameters_present_flag) { - READ_UINT32 (nr, tim->cpb_removal_delay, - vui->vcl_hrd_parameters.cpb_removal_delay_length_minus1 + 1); - READ_UINT32 (nr, tim->dpb_output_delay, - vui->vcl_hrd_parameters.dpb_output_delay_length_minus1 + 1); - } - - if (vui->pic_struct_present_flag) { - const guint8 num_clock_ts_table[9] = { - 1, 1, 1, 2, 2, 3, 3, 2, 3 - }; - guint8 num_clock_num_ts; - guint i; - - tim->pic_struct_present_flag = TRUE; - READ_UINT8 (nr, tim->pic_struct, 4); - CHECK_ALLOWED ((gint8) tim->pic_struct, 0, 8); - - num_clock_num_ts = num_clock_ts_table[tim->pic_struct]; - for (i = 0; i < num_clock_num_ts; i++) { - READ_UINT8 (nr, tim->clock_timestamp_flag[i], 1); - if (tim->clock_timestamp_flag[i]) { - if (!gst_h264_parse_clock_timestamp (&tim->clock_timestamp[i], vui, - nr)) - goto error; - } - } - } - } - - return GST_H264_PARSER_OK; - -error: - GST_WARNING ("error parsing \"Picture timing\""); - return GST_H264_PARSER_ERROR; -} - -static GstH264ParserResult -gst_h264_parser_parse_recovery_point (GstH264NalParser * nalparser, - GstH264RecoveryPoint * rp, NalReader * nr) -{ - GstH264SPS *const sps = nalparser->last_sps; - - GST_DEBUG ("parsing \"Recovery point\""); - if (!sps || !sps->valid) { - GST_WARNING ("didn't get the associated sequence paramater set for the " - "current access unit"); - goto error; - } - - READ_UE_MAX (nr, rp->recovery_frame_cnt, sps->max_frame_num - 1); - READ_UINT8 (nr, rp->exact_match_flag, 1); - READ_UINT8 (nr, rp->broken_link_flag, 1); - READ_UINT8 (nr, rp->changing_slice_group_idc, 2); - - return GST_H264_PARSER_OK; - -error: - GST_WARNING ("error parsing \"Recovery point\""); - return GST_H264_PARSER_ERROR; -} - -/* Parse SEI stereo_video_info() message */ -static GstH264ParserResult -gst_h264_parser_parse_stereo_video_info (GstH264NalParser * nalparser, - GstH264StereoVideoInfo * info, NalReader * nr) -{ - GST_DEBUG ("parsing \"Stereo Video info\""); - - READ_UINT8 (nr, info->field_views_flag, 1); - if (info->field_views_flag) { - READ_UINT8 (nr, info->top_field_is_left_view_flag, 1); - } else { - READ_UINT8 (nr, info->current_frame_is_left_view_flag, 1); - READ_UINT8 (nr, info->next_frame_is_second_view_flag, 1); - } - READ_UINT8 (nr, info->left_view_self_contained_flag, 1); - READ_UINT8 (nr, info->right_view_self_contained_flag, 1); - - return GST_H264_PARSER_OK; - -error: - GST_WARNING ("error parsing \"Stereo Video info\""); - return GST_H264_PARSER_ERROR; -} - -/* Parse SEI frame_packing_arrangement() message */ -static GstH264ParserResult -gst_h264_parser_parse_frame_packing (GstH264NalParser * nalparser, - GstH264FramePacking * frame_packing, NalReader * nr, guint payload_size) -{ - guint8 frame_packing_extension_flag; - guint start_pos; - - GST_DEBUG ("parsing \"Frame Packing Arrangement\""); - - start_pos = nal_reader_get_pos (nr); - READ_UE (nr, frame_packing->frame_packing_id); - READ_UINT8 (nr, frame_packing->frame_packing_cancel_flag, 1); - - if (!frame_packing->frame_packing_cancel_flag) { - READ_UINT8 (nr, frame_packing->frame_packing_type, 7); - READ_UINT8 (nr, frame_packing->quincunx_sampling_flag, 1); - READ_UINT8 (nr, frame_packing->content_interpretation_type, 6); - READ_UINT8 (nr, frame_packing->spatial_flipping_flag, 1); - READ_UINT8 (nr, frame_packing->frame0_flipped_flag, 1); - READ_UINT8 (nr, frame_packing->field_views_flag, 1); - READ_UINT8 (nr, frame_packing->current_frame_is_frame0_flag, 1); - READ_UINT8 (nr, frame_packing->frame0_self_contained_flag, 1); - READ_UINT8 (nr, frame_packing->frame1_self_contained_flag, 1); - - if (!frame_packing->quincunx_sampling_flag && - frame_packing->frame_packing_type != - GST_H264_FRAME_PACKING_TEMPORAL_INTERLEAVING) { - READ_UINT8 (nr, frame_packing->frame0_grid_position_x, 4); - READ_UINT8 (nr, frame_packing->frame0_grid_position_y, 4); - READ_UINT8 (nr, frame_packing->frame1_grid_position_x, 4); - READ_UINT8 (nr, frame_packing->frame1_grid_position_y, 4); - } - - /* Skip frame_packing_arrangement_reserved_byte */ - if (!nal_reader_skip (nr, 8)) - goto error; - - READ_UE_MAX (nr, frame_packing->frame_packing_repetition_period, 16384); - } - - READ_UINT8 (nr, frame_packing_extension_flag, 1); - - /* All data that follows within a frame packing arrangement SEI message - after the value 1 for frame_packing_arrangement_extension_flag shall - be ignored (D.2.25) */ - if (frame_packing_extension_flag) { - nal_reader_skip_long (nr, - payload_size - (nal_reader_get_pos (nr) - start_pos)); - } - - return GST_H264_PARSER_OK; - -error: - GST_WARNING ("error parsing \"Frame Packing Arrangement\""); - return GST_H264_PARSER_ERROR; -} - -static GstH264ParserResult -gst_h264_parser_parse_sei_message (GstH264NalParser * nalparser, - NalReader * nr, GstH264SEIMessage * sei) -{ - guint32 payloadSize; - guint8 payload_type_byte, payload_size_byte; - guint remaining, payload_size; - GstH264ParserResult res; - - GST_DEBUG ("parsing \"Sei message\""); - - memset (sei, 0, sizeof (*sei)); - - do { - READ_UINT8 (nr, payload_type_byte, 8); - sei->payloadType += payload_type_byte; - } while (payload_type_byte == 0xff); - - payloadSize = 0; - do { - READ_UINT8 (nr, payload_size_byte, 8); - payloadSize += payload_size_byte; - } - while (payload_size_byte == 0xff); - - remaining = nal_reader_get_remaining (nr); - payload_size = payloadSize * 8 < remaining ? payloadSize * 8 : remaining; - - GST_DEBUG ("SEI message received: payloadType %u, payloadSize = %u bits", - sei->payloadType, payload_size); - - switch (sei->payloadType) { - case GST_H264_SEI_BUF_PERIOD: - /* size not set; might depend on emulation_prevention_three_byte */ - res = gst_h264_parser_parse_buffering_period (nalparser, - &sei->payload.buffering_period, nr); - break; - case GST_H264_SEI_PIC_TIMING: - /* size not set; might depend on emulation_prevention_three_byte */ - res = gst_h264_parser_parse_pic_timing (nalparser, - &sei->payload.pic_timing, nr); - break; - case GST_H264_SEI_RECOVERY_POINT: - res = gst_h264_parser_parse_recovery_point (nalparser, - &sei->payload.recovery_point, nr); - break; - case GST_H264_SEI_STEREO_VIDEO_INFO: - res = gst_h264_parser_parse_stereo_video_info (nalparser, - &sei->payload.stereo_video_info, nr); - break; - case GST_H264_SEI_FRAME_PACKING: - res = gst_h264_parser_parse_frame_packing (nalparser, - &sei->payload.frame_packing, nr, payload_size); - break; - default: - /* Just consume payloadSize bytes, which does not account for - emulation prevention bytes */ - if (!nal_reader_skip_long (nr, payload_size)) - goto error; - res = GST_H264_PARSER_OK; - break; - } - - /* When SEI message doesn't end at byte boundary, - * check remaining bits fit the specification. - */ - if (!nal_reader_is_byte_aligned (nr)) { - guint8 bit_equal_to_one; - READ_UINT8 (nr, bit_equal_to_one, 1); - if (!bit_equal_to_one) - GST_WARNING ("Bit non equal to one."); - - while (!nal_reader_is_byte_aligned (nr)) { - guint8 bit_equal_to_zero; - READ_UINT8 (nr, bit_equal_to_zero, 1); - if (bit_equal_to_zero) - GST_WARNING ("Bit non equal to zero."); - } - } - - return res; - -error: - GST_WARNING ("error parsing \"Sei message\""); - return GST_H264_PARSER_ERROR; -} - -/******** API *************/ - -/** - * gst_h264_nal_parser_new: - * - * Creates a new #GstH264NalParser. It should be freed with - * gst_h264_nal_parser_free after use. - * - * Returns: a new #GstH264NalParser - */ -GstH264NalParser * -gst_h264_nal_parser_new (void) -{ - GstH264NalParser *nalparser; - - nalparser = g_slice_new0 (GstH264NalParser); - INITIALIZE_DEBUG_CATEGORY; - - return nalparser; -} - -/** - * gst_h264_nal_parser_free: - * @nalparser: the #GstH264NalParser to free - * - * Frees @nalparser and sets it to %NULL - */ -void -gst_h264_nal_parser_free (GstH264NalParser * nalparser) -{ - guint i; - - for (i = 0; i < GST_H264_MAX_SPS_COUNT; i++) - gst_h264_sps_clear (&nalparser->sps[i]); - for (i = 0; i < GST_H264_MAX_PPS_COUNT; i++) - gst_h264_pps_clear (&nalparser->pps[i]); - g_slice_free (GstH264NalParser, nalparser); - - nalparser = NULL; -} - -/** - * gst_h264_parser_identify_nalu_unchecked: - * @nalparser: a #GstH264NalParser - * @data: The data to parse - * @offset: the offset from which to parse @data - * @size: the size of @data - * @nalu: The #GstH264NalUnit where to store parsed nal headers - * - * Parses @data and fills @nalu from the next nalu data from @data. - * - * This differs from @gst_h264_parser_identify_nalu in that it doesn't - * check whether the packet is complete or not. - * - * Note: Only use this function if you already know the provided @data - * is a complete NALU, else use @gst_h264_parser_identify_nalu. - * - * Returns: a #GstH264ParserResult - */ -GstH264ParserResult -gst_h264_parser_identify_nalu_unchecked (GstH264NalParser * nalparser, - const guint8 * data, guint offset, gsize size, GstH264NalUnit * nalu) -{ - gint off1; - - memset (nalu, 0, sizeof (*nalu)); - - if (size < offset + 4) { - GST_DEBUG ("Can't parse, buffer has too small size %" G_GSIZE_FORMAT - ", offset %u", size, offset); - return GST_H264_PARSER_ERROR; - } - - off1 = scan_for_start_codes (data + offset, size - offset); - - if (off1 < 0) { - GST_DEBUG ("No start code prefix in this buffer"); - return GST_H264_PARSER_NO_NAL; - } - - if (offset + off1 == size - 1) { - GST_DEBUG ("Missing data to identify nal unit"); - - return GST_H264_PARSER_ERROR; - } - - nalu->sc_offset = offset + off1; - - - nalu->offset = offset + off1 + 3; - nalu->data = (guint8 *) data; - nalu->size = size - nalu->offset; - - if (!gst_h264_parse_nalu_header (nalu)) { - GST_WARNING ("error parsing \"NAL unit header\""); - nalu->size = 0; - return GST_H264_PARSER_BROKEN_DATA; - } - - nalu->valid = TRUE; - - /* sc might have 2 or 3 0-bytes */ - if (nalu->sc_offset > 0 && data[nalu->sc_offset - 1] == 00 - && (nalu->type == GST_H264_NAL_SPS || nalu->type == GST_H264_NAL_PPS - || nalu->type == GST_H264_NAL_AU_DELIMITER)) - nalu->sc_offset--; - - if (nalu->type == GST_H264_NAL_SEQ_END || - nalu->type == GST_H264_NAL_STREAM_END) { - GST_DEBUG ("end-of-seq or end-of-stream nal found"); - nalu->size = 1; - return GST_H264_PARSER_OK; - } - - return GST_H264_PARSER_OK; -} - -/** - * gst_h264_parser_identify_nalu: - * @nalparser: a #GstH264NalParser - * @data: The data to parse - * @offset: the offset from which to parse @data - * @size: the size of @data - * @nalu: The #GstH264NalUnit where to store parsed nal headers - * - * Parses @data and fills @nalu from the next nalu data from @data - * - * Returns: a #GstH264ParserResult - */ -GstH264ParserResult -gst_h264_parser_identify_nalu (GstH264NalParser * nalparser, - const guint8 * data, guint offset, gsize size, GstH264NalUnit * nalu) -{ - GstH264ParserResult res; - gint off2; - - res = - gst_h264_parser_identify_nalu_unchecked (nalparser, data, offset, size, - nalu); - - if (res != GST_H264_PARSER_OK || nalu->size == 1) - goto beach; - - off2 = scan_for_start_codes (data + nalu->offset, size - nalu->offset); - if (off2 < 0) { - GST_DEBUG ("Nal start %d, No end found", nalu->offset); - - return GST_H264_PARSER_NO_NAL_END; - } - - /* Mini performance improvement: - * We could have a way to store how many 0s were skipped to avoid - * parsing them again on the next NAL */ - while (off2 > 0 && data[nalu->offset + off2 - 1] == 00) - off2--; - - nalu->size = off2; - if (nalu->size < 2) - return GST_H264_PARSER_BROKEN_DATA; - - GST_DEBUG ("Complete nal found. Off: %d, Size: %d", nalu->offset, nalu->size); - -beach: - return res; -} - - -/** - * gst_h264_parser_identify_nalu_avc: - * @nalparser: a #GstH264NalParser - * @data: The data to parse, must be the beging of the Nal unit - * @offset: the offset from which to parse @data - * @size: the size of @data - * @nal_length_size: the size in bytes of the AVC nal length prefix. - * @nalu: The #GstH264NalUnit where to store parsed nal headers - * - * Parses @data and sets @nalu. - * - * Returns: a #GstH264ParserResult - */ -GstH264ParserResult -gst_h264_parser_identify_nalu_avc (GstH264NalParser * nalparser, - const guint8 * data, guint offset, gsize size, guint8 nal_length_size, - GstH264NalUnit * nalu) -{ - GstBitReader br; - - memset (nalu, 0, sizeof (*nalu)); - - if (size < offset + nal_length_size) { - GST_DEBUG ("Can't parse, buffer has too small size %" G_GSIZE_FORMAT - ", offset %u", size, offset); - return GST_H264_PARSER_ERROR; - } - - size = size - offset; - gst_bit_reader_init (&br, data + offset, size); - - nalu->size = gst_bit_reader_get_bits_uint32_unchecked (&br, - nal_length_size * 8); - nalu->sc_offset = offset; - nalu->offset = offset + nal_length_size; - - if (size < nalu->size + nal_length_size) { - nalu->size = 0; - - return GST_H264_PARSER_NO_NAL_END; - } - - nalu->data = (guint8 *) data; - - if (!gst_h264_parse_nalu_header (nalu)) { - GST_WARNING ("error parsing \"NAL unit header\""); - nalu->size = 0; - return GST_H264_PARSER_BROKEN_DATA; - } - - nalu->valid = TRUE; - - return GST_H264_PARSER_OK; -} - -/** - * gst_h264_parser_parse_nal: - * @nalparser: a #GstH264NalParser - * @nalu: The #GstH264NalUnit to parse - * - * This function should be called in the case one doesn't need to - * parse a specific structure. It is necessary to do so to make - * sure @nalparser is up to date. - * - * Returns: a #GstH264ParserResult - */ -GstH264ParserResult -gst_h264_parser_parse_nal (GstH264NalParser * nalparser, GstH264NalUnit * nalu) -{ - GstH264SPS sps; - GstH264PPS pps; - - switch (nalu->type) { - case GST_H264_NAL_SPS: - return gst_h264_parser_parse_sps (nalparser, nalu, &sps, FALSE); - break; - case GST_H264_NAL_PPS: - return gst_h264_parser_parse_pps (nalparser, nalu, &pps); - } - - return GST_H264_PARSER_OK; -} - -/** - * gst_h264_parser_parse_sps: - * @nalparser: a #GstH264NalParser - * @nalu: The #GST_H264_NAL_SPS #GstH264NalUnit to parse - * @sps: The #GstH264SPS to fill. - * @parse_vui_params: Whether to parse the vui_params or not - * - * Parses @data, and fills the @sps structure. - * - * Returns: a #GstH264ParserResult - */ -GstH264ParserResult -gst_h264_parser_parse_sps (GstH264NalParser * nalparser, GstH264NalUnit * nalu, - GstH264SPS * sps, gboolean parse_vui_params) -{ - GstH264ParserResult res = gst_h264_parse_sps (nalu, sps, parse_vui_params); - - if (res == GST_H264_PARSER_OK) { - GST_DEBUG ("adding sequence parameter set with id: %d to array", sps->id); - - if (!gst_h264_sps_copy (&nalparser->sps[sps->id], sps)) - return GST_H264_PARSER_ERROR; - nalparser->last_sps = &nalparser->sps[sps->id]; - } - return res; -} - -/* Parse seq_parameter_set_data() */ -static gboolean -gst_h264_parse_sps_data (NalReader * nr, GstH264SPS * sps, - gboolean parse_vui_params) -{ - gint width, height; - guint subwc[] = { 1, 2, 2, 1 }; - guint subhc[] = { 1, 2, 1, 1 }; - GstH264VUIParams *vui = NULL; - - memset (sps, 0, sizeof (*sps)); - - /* set default values for fields that might not be present in the bitstream - and have valid defaults */ - sps->extension_type = GST_H264_NAL_EXTENSION_NONE; - sps->chroma_format_idc = 1; - memset (sps->scaling_lists_4x4, 16, 96); - memset (sps->scaling_lists_8x8, 16, 384); - - READ_UINT8 (nr, sps->profile_idc, 8); - READ_UINT8 (nr, sps->constraint_set0_flag, 1); - READ_UINT8 (nr, sps->constraint_set1_flag, 1); - READ_UINT8 (nr, sps->constraint_set2_flag, 1); - READ_UINT8 (nr, sps->constraint_set3_flag, 1); - READ_UINT8 (nr, sps->constraint_set4_flag, 1); - READ_UINT8 (nr, sps->constraint_set5_flag, 1); - - /* skip reserved_zero_2bits */ - if (!nal_reader_skip (nr, 2)) - goto error; - - READ_UINT8 (nr, sps->level_idc, 8); - - READ_UE_MAX (nr, sps->id, GST_H264_MAX_SPS_COUNT - 1); - - if (sps->profile_idc == 100 || sps->profile_idc == 110 || - sps->profile_idc == 122 || sps->profile_idc == 244 || - sps->profile_idc == 44 || sps->profile_idc == 83 || - sps->profile_idc == 86 || sps->profile_idc == 118 || - sps->profile_idc == 128) { - READ_UE_MAX (nr, sps->chroma_format_idc, 3); - if (sps->chroma_format_idc == 3) - READ_UINT8 (nr, sps->separate_colour_plane_flag, 1); - - READ_UE_MAX (nr, sps->bit_depth_luma_minus8, 6); - READ_UE_MAX (nr, sps->bit_depth_chroma_minus8, 6); - READ_UINT8 (nr, sps->qpprime_y_zero_transform_bypass_flag, 1); - - READ_UINT8 (nr, sps->scaling_matrix_present_flag, 1); - if (sps->scaling_matrix_present_flag) { - guint8 n_lists; - - n_lists = (sps->chroma_format_idc != 3) ? 8 : 12; - if (!gst_h264_parser_parse_scaling_list (nr, - sps->scaling_lists_4x4, sps->scaling_lists_8x8, - default_4x4_inter, default_4x4_intra, - default_8x8_inter, default_8x8_intra, n_lists)) - goto error; - } - } - - READ_UE_MAX (nr, sps->log2_max_frame_num_minus4, 12); - - sps->max_frame_num = 1 << (sps->log2_max_frame_num_minus4 + 4); - - READ_UE_MAX (nr, sps->pic_order_cnt_type, 2); - if (sps->pic_order_cnt_type == 0) { - READ_UE_MAX (nr, sps->log2_max_pic_order_cnt_lsb_minus4, 12); - } else if (sps->pic_order_cnt_type == 1) { - guint i; - - READ_UINT8 (nr, sps->delta_pic_order_always_zero_flag, 1); - READ_SE (nr, sps->offset_for_non_ref_pic); - READ_SE (nr, sps->offset_for_top_to_bottom_field); - READ_UE_MAX (nr, sps->num_ref_frames_in_pic_order_cnt_cycle, 255); - - for (i = 0; i < sps->num_ref_frames_in_pic_order_cnt_cycle; i++) - READ_SE (nr, sps->offset_for_ref_frame[i]); - } - - READ_UE (nr, sps->num_ref_frames); - READ_UINT8 (nr, sps->gaps_in_frame_num_value_allowed_flag, 1); - READ_UE (nr, sps->pic_width_in_mbs_minus1); - READ_UE (nr, sps->pic_height_in_map_units_minus1); - READ_UINT8 (nr, sps->frame_mbs_only_flag, 1); - - if (!sps->frame_mbs_only_flag) - READ_UINT8 (nr, sps->mb_adaptive_frame_field_flag, 1); - - READ_UINT8 (nr, sps->direct_8x8_inference_flag, 1); - READ_UINT8 (nr, sps->frame_cropping_flag, 1); - if (sps->frame_cropping_flag) { - READ_UE (nr, sps->frame_crop_left_offset); - READ_UE (nr, sps->frame_crop_right_offset); - READ_UE (nr, sps->frame_crop_top_offset); - READ_UE (nr, sps->frame_crop_bottom_offset); - } - - READ_UINT8 (nr, sps->vui_parameters_present_flag, 1); - if (sps->vui_parameters_present_flag && parse_vui_params) { - if (!gst_h264_parse_vui_parameters (sps, nr)) - goto error; - vui = &sps->vui_parameters; - } - - /* calculate ChromaArrayType */ - if (!sps->separate_colour_plane_flag) - sps->chroma_array_type = sps->chroma_format_idc; - - /* Calculate width and height */ - width = (sps->pic_width_in_mbs_minus1 + 1); - width *= 16; - height = (sps->pic_height_in_map_units_minus1 + 1); - height *= 16 * (2 - sps->frame_mbs_only_flag); - GST_LOG ("initial width=%d, height=%d", width, height); - if (width < 0 || height < 0) { - GST_WARNING ("invalid width/height in SPS"); - goto error; - } - - sps->width = width; - sps->height = height; - - if (sps->frame_cropping_flag) { - const guint crop_unit_x = subwc[sps->chroma_format_idc]; - const guint crop_unit_y = - subhc[sps->chroma_format_idc] * (2 - sps->frame_mbs_only_flag); - - width -= (sps->frame_crop_left_offset + sps->frame_crop_right_offset) - * crop_unit_x; - height -= (sps->frame_crop_top_offset + sps->frame_crop_bottom_offset) - * crop_unit_y; - - sps->crop_rect_width = width; - sps->crop_rect_height = height; - sps->crop_rect_x = sps->frame_crop_left_offset * crop_unit_x; - sps->crop_rect_y = sps->frame_crop_top_offset * crop_unit_y; - - GST_LOG ("crop_rectangle x=%u y=%u width=%u, height=%u", sps->crop_rect_x, - sps->crop_rect_y, width, height); - } - sps->fps_num = 0; - sps->fps_den = 1; - - if (vui && vui->timing_info_present_flag) { - /* derive framerate */ - /* FIXME verify / also handle other cases */ - GST_LOG ("Framerate: %u %u %u %u", parse_vui_params, - vui->fixed_frame_rate_flag, sps->frame_mbs_only_flag, - vui->pic_struct_present_flag); - - if (parse_vui_params && vui->fixed_frame_rate_flag) { - sps->fps_num = vui->time_scale; - sps->fps_den = vui->num_units_in_tick; - /* picture is a frame = 2 fields */ - sps->fps_den *= 2; - GST_LOG ("framerate %d/%d", sps->fps_num, sps->fps_den); - } - } else { - GST_LOG ("No VUI, unknown framerate"); - } - return TRUE; - -error: - return FALSE; -} - -/* Parse subset_seq_parameter_set() data for MVC */ -static gboolean -gst_h264_parse_sps_mvc_data (NalReader * nr, GstH264SPS * sps, - gboolean parse_vui_params) -{ - GstH264SPSExtMVC *const mvc = &sps->extension.mvc; - guint8 bit_equal_to_one; - guint i, j, k; - - READ_UINT8 (nr, bit_equal_to_one, 1); - if (!bit_equal_to_one) - return FALSE; - - sps->extension_type = GST_H264_NAL_EXTENSION_MVC; - - READ_UE_MAX (nr, mvc->num_views_minus1, GST_H264_MAX_VIEW_COUNT - 1); - - mvc->view = g_new0 (GstH264SPSExtMVCView, mvc->num_views_minus1 + 1); - if (!mvc->view) - goto error_allocation_failed; - - for (i = 0; i <= mvc->num_views_minus1; i++) - READ_UE_MAX (nr, mvc->view[i].view_id, GST_H264_MAX_VIEW_ID); - - for (i = 1; i <= mvc->num_views_minus1; i++) { - /* for RefPicList0 */ - READ_UE_MAX (nr, mvc->view[i].num_anchor_refs_l0, 15); - for (j = 0; j < mvc->view[i].num_anchor_refs_l0; j++) { - READ_UE_MAX (nr, mvc->view[i].anchor_ref_l0[j], GST_H264_MAX_VIEW_ID); - } - - /* for RefPicList1 */ - READ_UE_MAX (nr, mvc->view[i].num_anchor_refs_l1, 15); - for (j = 0; j < mvc->view[i].num_anchor_refs_l1; j++) { - READ_UE_MAX (nr, mvc->view[i].anchor_ref_l1[j], GST_H264_MAX_VIEW_ID); - } - } - - for (i = 1; i <= mvc->num_views_minus1; i++) { - /* for RefPicList0 */ - READ_UE_MAX (nr, mvc->view[i].num_non_anchor_refs_l0, 15); - for (j = 0; j < mvc->view[i].num_non_anchor_refs_l0; j++) { - READ_UE_MAX (nr, mvc->view[i].non_anchor_ref_l0[j], GST_H264_MAX_VIEW_ID); - } - - /* for RefPicList1 */ - READ_UE_MAX (nr, mvc->view[i].num_non_anchor_refs_l1, 15); - for (j = 0; j < mvc->view[i].num_non_anchor_refs_l1; j++) { - READ_UE_MAX (nr, mvc->view[i].non_anchor_ref_l1[j], GST_H264_MAX_VIEW_ID); - } - } - - READ_UE_MAX (nr, mvc->num_level_values_signalled_minus1, 63); - - mvc->level_value = - g_new0 (GstH264SPSExtMVCLevelValue, - mvc->num_level_values_signalled_minus1 + 1); - if (!mvc->level_value) - goto error_allocation_failed; - - for (i = 0; i <= mvc->num_level_values_signalled_minus1; i++) { - GstH264SPSExtMVCLevelValue *const level_value = &mvc->level_value[i]; - - READ_UINT8 (nr, level_value->level_idc, 8); - - READ_UE_MAX (nr, level_value->num_applicable_ops_minus1, 1023); - level_value->applicable_op = - g_new0 (GstH264SPSExtMVCLevelValueOp, - level_value->num_applicable_ops_minus1 + 1); - if (!level_value->applicable_op) - goto error_allocation_failed; - - for (j = 0; j <= level_value->num_applicable_ops_minus1; j++) { - GstH264SPSExtMVCLevelValueOp *const op = &level_value->applicable_op[j]; - - READ_UINT8 (nr, op->temporal_id, 3); - - READ_UE_MAX (nr, op->num_target_views_minus1, 1023); - op->target_view_id = g_new (guint16, op->num_target_views_minus1 + 1); - if (!op->target_view_id) - goto error_allocation_failed; - - for (k = 0; k <= op->num_target_views_minus1; k++) - READ_UE_MAX (nr, op->target_view_id[k], GST_H264_MAX_VIEW_ID); - READ_UE_MAX (nr, op->num_views_minus1, 1023); - } - } - return TRUE; - -error_allocation_failed: - GST_WARNING ("failed to allocate memory"); - gst_h264_sps_clear (sps); - return FALSE; - -error: - gst_h264_sps_clear (sps); - return FALSE; -} - -/** - * gst_h264_parse_sps: - * @nalu: The #GST_H264_NAL_SPS #GstH264NalUnit to parse - * @sps: The #GstH264SPS to fill. - * @parse_vui_params: Whether to parse the vui_params or not - * - * Parses @data, and fills the @sps structure. - * - * Returns: a #GstH264ParserResult - */ -GstH264ParserResult -gst_h264_parse_sps (GstH264NalUnit * nalu, GstH264SPS * sps, - gboolean parse_vui_params) -{ - NalReader nr; - - INITIALIZE_DEBUG_CATEGORY; - GST_DEBUG ("parsing SPS"); - - nal_reader_init (&nr, nalu->data + nalu->offset + nalu->header_bytes, - nalu->size - nalu->header_bytes); - - if (!gst_h264_parse_sps_data (&nr, sps, parse_vui_params)) - goto error; - - sps->valid = TRUE; - - return GST_H264_PARSER_OK; - -error: - GST_WARNING ("error parsing \"Sequence parameter set\""); - sps->valid = FALSE; - return GST_H264_PARSER_ERROR; -} - -/** - * gst_h264_parser_parse_subset_sps: - * @nalparser: a #GstH264NalParser - * @nalu: The #GST_H264_NAL_SUBSET_SPS #GstH264NalUnit to parse - * @sps: The #GstH264SPS to fill. - * @parse_vui_params: Whether to parse the vui_params or not - * - * Parses @data, and fills in the @sps structure. - * - * This function fully parses @data and allocates all the necessary - * data structures needed for MVC extensions. The resulting @sps - * structure shall be deallocated with gst_h264_sps_clear() when it is - * no longer needed. - * - * Note: if the caller doesn't need any of the MVC-specific data, then - * gst_h264_parser_parse_sps() is more efficient because those extra - * syntax elements are not parsed and no extra memory is allocated. - * - * Returns: a #GstH264ParserResult - * - * Since: 1.6 - */ -GstH264ParserResult -gst_h264_parser_parse_subset_sps (GstH264NalParser * nalparser, - GstH264NalUnit * nalu, GstH264SPS * sps, gboolean parse_vui_params) -{ - GstH264ParserResult res; - - res = gst_h264_parse_subset_sps (nalu, sps, parse_vui_params); - if (res == GST_H264_PARSER_OK) { - GST_DEBUG ("adding sequence parameter set with id: %d to array", sps->id); - - if (!gst_h264_sps_copy (&nalparser->sps[sps->id], sps)) { - gst_h264_sps_clear (sps); - return GST_H264_PARSER_ERROR; - } - nalparser->last_sps = &nalparser->sps[sps->id]; - } - return res; -} - -/** - * gst_h264_parse_subset_sps: - * @nalu: The #GST_H264_NAL_SUBSET_SPS #GstH264NalUnit to parse - * @sps: The #GstH264SPS to fill. - * @parse_vui_params: Whether to parse the vui_params or not - * - * Parses @data, and fills in the @sps structure. - * - * This function fully parses @data and allocates all the necessary - * data structures needed for MVC extensions. The resulting @sps - * structure shall be deallocated with gst_h264_sps_clear() when it is - * no longer needed. - * - * Note: if the caller doesn't need any of the MVC-specific data, then - * gst_h264_parser_parse_sps() is more efficient because those extra - * syntax elements are not parsed and no extra memory is allocated. - * - * Returns: a #GstH264ParserResult - * - * Since: 1.6 - */ -GstH264ParserResult -gst_h264_parse_subset_sps (GstH264NalUnit * nalu, GstH264SPS * sps, - gboolean parse_vui_params) -{ - NalReader nr; - - INITIALIZE_DEBUG_CATEGORY; - GST_DEBUG ("parsing Subset SPS"); - - nal_reader_init (&nr, nalu->data + nalu->offset + nalu->header_bytes, - nalu->size - nalu->header_bytes); - - if (!gst_h264_parse_sps_data (&nr, sps, TRUE)) - goto error; - - if (sps->profile_idc == GST_H264_PROFILE_MULTIVIEW_HIGH || - sps->profile_idc == GST_H264_PROFILE_STEREO_HIGH) { - if (!gst_h264_parse_sps_mvc_data (&nr, sps, parse_vui_params)) - goto error; - } - - sps->valid = TRUE; - return GST_H264_PARSER_OK; - -error: - GST_WARNING ("error parsing \"Subset sequence parameter set\""); - gst_h264_sps_clear (sps); - sps->valid = FALSE; - return GST_H264_PARSER_ERROR; -} - -/** - * gst_h264_parse_pps: - * @nalparser: a #GstH264NalParser - * @nalu: The #GST_H264_NAL_PPS #GstH264NalUnit to parse - * @pps: The #GstH264PPS to fill. - * - * Parses @data, and fills the @pps structure. - * - * The resulting @pps data structure shall be deallocated with the - * gst_h264_pps_clear() function when it is no longer needed, or prior - * to parsing a new PPS NAL unit. - * - * Returns: a #GstH264ParserResult - */ -GstH264ParserResult -gst_h264_parse_pps (GstH264NalParser * nalparser, GstH264NalUnit * nalu, - GstH264PPS * pps) -{ - NalReader nr; - GstH264SPS *sps; - gint sps_id; - guint8 pic_scaling_matrix_present_flag; - gint qp_bd_offset; - - INITIALIZE_DEBUG_CATEGORY; - GST_DEBUG ("parsing PPS"); - - nal_reader_init (&nr, nalu->data + nalu->offset + nalu->header_bytes, - nalu->size - nalu->header_bytes); - - memset (pps, 0, sizeof (*pps)); - - READ_UE_MAX (&nr, pps->id, GST_H264_MAX_PPS_COUNT - 1); - READ_UE_MAX (&nr, sps_id, GST_H264_MAX_SPS_COUNT - 1); - - sps = gst_h264_parser_get_sps (nalparser, sps_id); - if (!sps) { - GST_WARNING ("couldn't find associated sequence parameter set with id: %d", - sps_id); - return GST_H264_PARSER_BROKEN_LINK; - } - pps->sequence = sps; - qp_bd_offset = 6 * (sps->bit_depth_luma_minus8 + - sps->separate_colour_plane_flag); - - /* set default values for fields that might not be present in the bitstream - and have valid defaults */ - memcpy (&pps->scaling_lists_4x4, &sps->scaling_lists_4x4, 96); - memcpy (&pps->scaling_lists_8x8, &sps->scaling_lists_8x8, 384); - - READ_UINT8 (&nr, pps->entropy_coding_mode_flag, 1); - READ_UINT8 (&nr, pps->pic_order_present_flag, 1); - READ_UE_MAX (&nr, pps->num_slice_groups_minus1, 7); - if (pps->num_slice_groups_minus1 > 0) { - READ_UE_MAX (&nr, pps->slice_group_map_type, 6); - - if (pps->slice_group_map_type == 0) { - gint i; - - for (i = 0; i <= pps->num_slice_groups_minus1; i++) - READ_UE (&nr, pps->run_length_minus1[i]); - } else if (pps->slice_group_map_type == 2) { - gint i; - - for (i = 0; i < pps->num_slice_groups_minus1; i++) { - READ_UE (&nr, pps->top_left[i]); - READ_UE (&nr, pps->bottom_right[i]); - } - } else if (pps->slice_group_map_type >= 3 && pps->slice_group_map_type <= 5) { - READ_UINT8 (&nr, pps->slice_group_change_direction_flag, 1); - READ_UE (&nr, pps->slice_group_change_rate_minus1); - } else if (pps->slice_group_map_type == 6) { - gint bits; - gint i; - - READ_UE (&nr, pps->pic_size_in_map_units_minus1); - bits = g_bit_storage (pps->num_slice_groups_minus1); - - pps->slice_group_id = - g_new (guint8, pps->pic_size_in_map_units_minus1 + 1); - for (i = 0; i <= pps->pic_size_in_map_units_minus1; i++) - READ_UINT8 (&nr, pps->slice_group_id[i], bits); - } - } - - READ_UE_MAX (&nr, pps->num_ref_idx_l0_active_minus1, 31); - READ_UE_MAX (&nr, pps->num_ref_idx_l1_active_minus1, 31); - READ_UINT8 (&nr, pps->weighted_pred_flag, 1); - READ_UINT8 (&nr, pps->weighted_bipred_idc, 2); - READ_SE_ALLOWED (&nr, pps->pic_init_qp_minus26, -(26 + qp_bd_offset), 25); - READ_SE_ALLOWED (&nr, pps->pic_init_qs_minus26, -26, 25); - READ_SE_ALLOWED (&nr, pps->chroma_qp_index_offset, -12, 12); - pps->second_chroma_qp_index_offset = pps->chroma_qp_index_offset; - READ_UINT8 (&nr, pps->deblocking_filter_control_present_flag, 1); - READ_UINT8 (&nr, pps->constrained_intra_pred_flag, 1); - READ_UINT8 (&nr, pps->redundant_pic_cnt_present_flag, 1); - - if (!nal_reader_has_more_data (&nr)) - goto done; - - READ_UINT8 (&nr, pps->transform_8x8_mode_flag, 1); - - READ_UINT8 (&nr, pic_scaling_matrix_present_flag, 1); - if (pic_scaling_matrix_present_flag) { - guint8 n_lists; - - n_lists = 6 + ((sps->chroma_format_idc != 3) ? 2 : 6) * - pps->transform_8x8_mode_flag; - - if (sps->scaling_matrix_present_flag) { - if (!gst_h264_parser_parse_scaling_list (&nr, - pps->scaling_lists_4x4, pps->scaling_lists_8x8, - sps->scaling_lists_4x4[3], sps->scaling_lists_4x4[0], - sps->scaling_lists_8x8[3], sps->scaling_lists_8x8[0], n_lists)) - goto error; - } else { - if (!gst_h264_parser_parse_scaling_list (&nr, - pps->scaling_lists_4x4, pps->scaling_lists_8x8, - default_4x4_inter, default_4x4_intra, - default_8x8_inter, default_8x8_intra, n_lists)) - goto error; - } - } - - READ_SE_ALLOWED (&nr, pps->second_chroma_qp_index_offset, -12, 12); - -done: - pps->valid = TRUE; - return GST_H264_PARSER_OK; - -error: - GST_WARNING ("error parsing \"Picture parameter set\""); - pps->valid = FALSE; - gst_h264_pps_clear (pps); - return GST_H264_PARSER_ERROR; -} - -/** - * gst_h264_parser_parse_pps: - * @nalparser: a #GstH264NalParser - * @nalu: The #GST_H264_NAL_PPS #GstH264NalUnit to parse - * @pps: The #GstH264PPS to fill. - * - * Parses @data, and fills the @pps structure. - * - * The resulting @pps data structure shall be deallocated with the - * gst_h264_pps_clear() function when it is no longer needed, or prior - * to parsing a new PPS NAL unit. - * - * Returns: a #GstH264ParserResult - */ -GstH264ParserResult -gst_h264_parser_parse_pps (GstH264NalParser * nalparser, - GstH264NalUnit * nalu, GstH264PPS * pps) -{ - GstH264ParserResult res = gst_h264_parse_pps (nalparser, nalu, pps); - - if (res == GST_H264_PARSER_OK) { - GST_DEBUG ("adding picture parameter set with id: %d to array", pps->id); - - if (!gst_h264_pps_copy (&nalparser->pps[pps->id], pps)) - return GST_H264_PARSER_ERROR; - nalparser->last_pps = &nalparser->pps[pps->id]; - } - - return res; -} - -/** - * gst_h264_pps_clear: - * @pps: The #GstH264PPS to free - * - * Clears all @pps internal resources. - * - * Since: 1.4 - */ -void -gst_h264_pps_clear (GstH264PPS * pps) -{ - g_return_if_fail (pps != NULL); - - g_free (pps->slice_group_id); - pps->slice_group_id = NULL; -} - -/** - * gst_h264_parser_parse_slice_hdr: - * @nalparser: a #GstH264NalParser - * @nalu: The #GST_H264_NAL_SLICE #GstH264NalUnit to parse - * @slice: The #GstH264SliceHdr to fill. - * @parse_pred_weight_table: Whether to parse the pred_weight_table or not - * @parse_dec_ref_pic_marking: Whether to parse the dec_ref_pic_marking or not - * - * Parses @data, and fills the @slice structure. - * - * Returns: a #GstH264ParserResult - */ -GstH264ParserResult -gst_h264_parser_parse_slice_hdr (GstH264NalParser * nalparser, - GstH264NalUnit * nalu, GstH264SliceHdr * slice, - gboolean parse_pred_weight_table, gboolean parse_dec_ref_pic_marking) -{ - NalReader nr; - gint pps_id; - GstH264PPS *pps; - GstH264SPS *sps; - - memset (slice, 0, sizeof (*slice)); - - if (!nalu->size) { - GST_DEBUG ("Invalid Nal Unit"); - return GST_H264_PARSER_ERROR; - } - - nal_reader_init (&nr, nalu->data + nalu->offset + nalu->header_bytes, - nalu->size - nalu->header_bytes); - - READ_UE (&nr, slice->first_mb_in_slice); - READ_UE (&nr, slice->type); - - GST_DEBUG ("parsing \"Slice header\", slice type %u", slice->type); - - READ_UE_MAX (&nr, pps_id, GST_H264_MAX_PPS_COUNT - 1); - pps = gst_h264_parser_get_pps (nalparser, pps_id); - - if (!pps) { - GST_WARNING ("couldn't find associated picture parameter set with id: %d", - pps_id); - - return GST_H264_PARSER_BROKEN_LINK; - } - - slice->pps = pps; - sps = pps->sequence; - if (!sps) { - GST_WARNING ("couldn't find associated sequence parameter set with id: %d", - pps->id); - return GST_H264_PARSER_BROKEN_LINK; - } - - /* Check we can actually parse this slice (AVC, MVC headers only) */ - if (sps->extension_type && sps->extension_type != GST_H264_NAL_EXTENSION_MVC) { - GST_WARNING ("failed to parse unsupported slice header"); - return GST_H264_PARSER_BROKEN_DATA; - } - - /* set default values for fields that might not be present in the bitstream - and have valid defaults */ - slice->num_ref_idx_l0_active_minus1 = pps->num_ref_idx_l0_active_minus1; - slice->num_ref_idx_l1_active_minus1 = pps->num_ref_idx_l1_active_minus1; - - if (sps->separate_colour_plane_flag) - READ_UINT8 (&nr, slice->colour_plane_id, 2); - - READ_UINT16 (&nr, slice->frame_num, sps->log2_max_frame_num_minus4 + 4); - - if (!sps->frame_mbs_only_flag) { - READ_UINT8 (&nr, slice->field_pic_flag, 1); - if (slice->field_pic_flag) - READ_UINT8 (&nr, slice->bottom_field_flag, 1); - } - - /* calculate MaxPicNum */ - if (slice->field_pic_flag) - slice->max_pic_num = 2 * sps->max_frame_num; - else - slice->max_pic_num = sps->max_frame_num; - - if (nalu->idr_pic_flag) - READ_UE_MAX (&nr, slice->idr_pic_id, G_MAXUINT16); - - if (sps->pic_order_cnt_type == 0) { - READ_UINT16 (&nr, slice->pic_order_cnt_lsb, - sps->log2_max_pic_order_cnt_lsb_minus4 + 4); - - if (pps->pic_order_present_flag && !slice->field_pic_flag) - READ_SE (&nr, slice->delta_pic_order_cnt_bottom); - } - - if (sps->pic_order_cnt_type == 1 && !sps->delta_pic_order_always_zero_flag) { - READ_SE (&nr, slice->delta_pic_order_cnt[0]); - if (pps->pic_order_present_flag && !slice->field_pic_flag) - READ_SE (&nr, slice->delta_pic_order_cnt[1]); - } - - if (pps->redundant_pic_cnt_present_flag) - READ_UE_MAX (&nr, slice->redundant_pic_cnt, G_MAXINT8); - - if (GST_H264_IS_B_SLICE (slice)) - READ_UINT8 (&nr, slice->direct_spatial_mv_pred_flag, 1); - - if (GST_H264_IS_P_SLICE (slice) || GST_H264_IS_SP_SLICE (slice) || - GST_H264_IS_B_SLICE (slice)) { - guint8 num_ref_idx_active_override_flag; - - READ_UINT8 (&nr, num_ref_idx_active_override_flag, 1); - if (num_ref_idx_active_override_flag) { - READ_UE_MAX (&nr, slice->num_ref_idx_l0_active_minus1, 31); - - if (GST_H264_IS_B_SLICE (slice)) - READ_UE_MAX (&nr, slice->num_ref_idx_l1_active_minus1, 31); - } - } - - if (!slice_parse_ref_pic_list_modification (slice, &nr, - GST_H264_IS_MVC_NALU (nalu))) - goto error; - - if ((pps->weighted_pred_flag && (GST_H264_IS_P_SLICE (slice) - || GST_H264_IS_SP_SLICE (slice))) - || (pps->weighted_bipred_idc == 1 && GST_H264_IS_B_SLICE (slice))) { - if (!gst_h264_slice_parse_pred_weight_table (slice, &nr, - sps->chroma_array_type)) - goto error; - } - - if (nalu->ref_idc != 0) { - if (!gst_h264_slice_parse_dec_ref_pic_marking (slice, nalu, &nr)) - goto error; - } - - if (pps->entropy_coding_mode_flag && !GST_H264_IS_I_SLICE (slice) && - !GST_H264_IS_SI_SLICE (slice)) - READ_UE_MAX (&nr, slice->cabac_init_idc, 2); - - READ_SE_ALLOWED (&nr, slice->slice_qp_delta, -87, 77); - - if (GST_H264_IS_SP_SLICE (slice) || GST_H264_IS_SI_SLICE (slice)) { - guint8 sp_for_switch_flag; - - if (GST_H264_IS_SP_SLICE (slice)) - READ_UINT8 (&nr, sp_for_switch_flag, 1); - READ_SE_ALLOWED (&nr, slice->slice_qs_delta, -51, 51); - } - - if (pps->deblocking_filter_control_present_flag) { - READ_UE_MAX (&nr, slice->disable_deblocking_filter_idc, 2); - if (slice->disable_deblocking_filter_idc != 1) { - READ_SE_ALLOWED (&nr, slice->slice_alpha_c0_offset_div2, -6, 6); - READ_SE_ALLOWED (&nr, slice->slice_beta_offset_div2, -6, 6); - } - } - - if (pps->num_slice_groups_minus1 > 0 && - pps->slice_group_map_type >= 3 && pps->slice_group_map_type <= 5) { - /* Ceil(Log2(PicSizeInMapUnits / SliceGroupChangeRate + 1)) [7-33] */ - guint32 PicWidthInMbs = sps->pic_width_in_mbs_minus1 + 1; - guint32 PicHeightInMapUnits = sps->pic_height_in_map_units_minus1 + 1; - guint32 PicSizeInMapUnits = PicWidthInMbs * PicHeightInMapUnits; - guint32 SliceGroupChangeRate = pps->slice_group_change_rate_minus1 + 1; - const guint n = ceil_log2 (PicSizeInMapUnits / SliceGroupChangeRate + 1); - READ_UINT16 (&nr, slice->slice_group_change_cycle, n); - } - - slice->header_size = nal_reader_get_pos (&nr); - slice->n_emulation_prevention_bytes = nal_reader_get_epb_count (&nr); - - return GST_H264_PARSER_OK; - -error: - GST_WARNING ("error parsing \"Slice header\""); - return GST_H264_PARSER_ERROR; -} - -/* Free MVC-specific data from subset SPS header */ -static void -gst_h264_sps_mvc_clear (GstH264SPS * sps) -{ - GstH264SPSExtMVC *const mvc = &sps->extension.mvc; - guint i, j; - - g_assert (sps->extension_type == GST_H264_NAL_EXTENSION_MVC); - - g_free (mvc->view); - mvc->view = NULL; - - for (i = 0; i <= mvc->num_level_values_signalled_minus1; i++) { - GstH264SPSExtMVCLevelValue *const level_value = &mvc->level_value[i]; - - for (j = 0; j <= level_value->num_applicable_ops_minus1; j++) { - g_free (level_value->applicable_op[j].target_view_id); - level_value->applicable_op[j].target_view_id = NULL; - } - g_free (level_value->applicable_op); - level_value->applicable_op = NULL; - } - g_free (mvc->level_value); - mvc->level_value = NULL; - - /* All meaningful MVC info are now gone, just pretend to be a - * standard AVC struct now */ - sps->extension_type = GST_H264_NAL_EXTENSION_NONE; -} - -/** - * gst_h264_sps_clear: - * @sps: The #GstH264SPS to free - * - * Clears all @sps internal resources. - * - * Since: 1.6 - */ -void -gst_h264_sps_clear (GstH264SPS * sps) -{ - g_return_if_fail (sps != NULL); - - switch (sps->extension_type) { - case GST_H264_NAL_EXTENSION_MVC: - gst_h264_sps_mvc_clear (sps); - break; - } -} - -/** - * gst_h264_parser_parse_sei: - * @nalparser: a #GstH264NalParser - * @nalu: The #GST_H264_NAL_SEI #GstH264NalUnit to parse - * @messages: The GArray of #GstH264SEIMessage to fill. The caller must free it when done. - * - * Parses @data, create and fills the @messages array. - * - * Returns: a #GstH264ParserResult - */ -GstH264ParserResult -gst_h264_parser_parse_sei (GstH264NalParser * nalparser, GstH264NalUnit * nalu, - GArray ** messages) -{ - NalReader nr; - GstH264SEIMessage sei; - GstH264ParserResult res; - - GST_DEBUG ("parsing SEI nal"); - nal_reader_init (&nr, nalu->data + nalu->offset + nalu->header_bytes, - nalu->size - nalu->header_bytes); - *messages = g_array_new (FALSE, FALSE, sizeof (GstH264SEIMessage)); - - do { - res = gst_h264_parser_parse_sei_message (nalparser, &nr, &sei); - if (res == GST_H264_PARSER_OK) - g_array_append_val (*messages, sei); - else - break; - } while (nal_reader_has_more_data (&nr)); - - return res; -} - -/** - * gst_h264_quant_matrix_8x8_get_zigzag_from_raster: - * @out_quant: (out): The resulting quantization matrix - * @quant: The source quantization matrix - * - * Converts quantization matrix @quant from raster scan order to - * zigzag scan order and store the resulting factors into @out_quant. - * - * Note: it is an error to pass the same table in both @quant and - * @out_quant arguments. - * - * Since: 1.4 - */ -void -gst_h264_quant_matrix_8x8_get_zigzag_from_raster (guint8 out_quant[64], - const guint8 quant[64]) -{ - guint i; - - g_return_if_fail (out_quant != quant); - - for (i = 0; i < 64; i++) - out_quant[i] = quant[zigzag_8x8[i]]; -} - -/** - * gst_h264_quant_matrix_8x8_get_raster_from_zigzag: - * @out_quant: (out): The resulting quantization matrix - * @quant: The source quantization matrix - * - * Converts quantization matrix @quant from zigzag scan order to - * raster scan order and store the resulting factors into @out_quant. - * - * Note: it is an error to pass the same table in both @quant and - * @out_quant arguments. - * - * Since: 1.4 - */ -void -gst_h264_quant_matrix_8x8_get_raster_from_zigzag (guint8 out_quant[64], - const guint8 quant[64]) -{ - guint i; - - g_return_if_fail (out_quant != quant); - - for (i = 0; i < 64; i++) - out_quant[zigzag_8x8[i]] = quant[i]; -} - -/** - * gst_h264_quant_matrix_4x4_get_zigzag_from_raster: - * @out_quant: (out): The resulting quantization matrix - * @quant: The source quantization matrix - * - * Converts quantization matrix @quant from raster scan order to - * zigzag scan order and store the resulting factors into @out_quant. - * - * Note: it is an error to pass the same table in both @quant and - * @out_quant arguments. - * - * Since: 1.4 - */ -void -gst_h264_quant_matrix_4x4_get_zigzag_from_raster (guint8 out_quant[16], - const guint8 quant[16]) -{ - guint i; - - g_return_if_fail (out_quant != quant); - - for (i = 0; i < 16; i++) - out_quant[i] = quant[zigzag_4x4[i]]; -} - -/** - * gst_h264_quant_matrix_4x4_get_raster_from_zigzag: - * @out_quant: (out): The resulting quantization matrix - * @quant: The source quantization matrix - * - * Converts quantization matrix @quant from zigzag scan order to - * raster scan order and store the resulting factors into @out_quant. - * - * Note: it is an error to pass the same table in both @quant and - * @out_quant arguments. - * - * Since: 1.4 - */ -void -gst_h264_quant_matrix_4x4_get_raster_from_zigzag (guint8 out_quant[16], - const guint8 quant[16]) -{ - guint i; - - g_return_if_fail (out_quant != quant); - - for (i = 0; i < 16; i++) - out_quant[zigzag_4x4[i]] = quant[i]; -} - -/** - * gst_h264_video_calculate_framerate: - * @sps: Current Sequence Parameter Set - * @field_pic_flag: Current @field_pic_flag, obtained from latest slice header - * @pic_struct: @pic_struct value if available, 0 otherwise - * @fps_num: (out): The resulting fps numerator - * @fps_den: (out): The resulting fps denominator - * - * Calculate framerate of a video sequence using @sps VUI information, - * @field_pic_flag from a slice header and @pic_struct from #GstH264PicTiming SEI - * message. - * - * If framerate is variable or can't be determined, @fps_num will be set to 0 - * and @fps_den to 1. - */ -void -gst_h264_video_calculate_framerate (const GstH264SPS * sps, - guint field_pic_flag, guint pic_struct, gint * fps_num, gint * fps_den) -{ - gint num = 0; - gint den = 1; - - /* To calculate framerate, we use this formula: - * time_scale 1 1 - * fps = ----------------- x --------------- x ------------------------ - * num_units_in_tick DeltaTfiDivisor (field_pic_flag ? 2 : 1) - * - * See H264 specification E2.1 for more details. - */ - - if (sps) { - if (sps->vui_parameters_present_flag) { - const GstH264VUIParams *vui = &sps->vui_parameters; - if (vui->timing_info_present_flag && vui->fixed_frame_rate_flag) { - int delta_tfi_divisor = 1; - num = vui->time_scale; - den = vui->num_units_in_tick; - - if (vui->pic_struct_present_flag) { - switch (pic_struct) { - case 1: - case 2: - delta_tfi_divisor = 1; - break; - case 0: - case 3: - case 4: - delta_tfi_divisor = 2; - break; - case 5: - case 6: - delta_tfi_divisor = 3; - break; - case 7: - delta_tfi_divisor = 4; - break; - case 8: - delta_tfi_divisor = 6; - break; - } - } else { - delta_tfi_divisor = field_pic_flag ? 1 : 2; - } - den *= delta_tfi_divisor; - - /* Picture is two fields ? */ - den *= (field_pic_flag ? 2 : 1); - } - } - } - - *fps_num = num; - *fps_den = den; -} diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gsth264parser.h gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gsth264parser.h --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gsth264parser.h 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gsth264parser.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,1082 +0,0 @@ -/* Gstreamer - * Copyright (C) <2011> Intel Corporation - * Copyright (C) <2011> Collabora Ltd. - * Copyright (C) <2011> Thibault Saunier - * - * Some bits C-c,C-v'ed and s/4/3 from h264parse and videoparsers/h264parse.c: - * Copyright (C) <2010> Mark Nauwelaerts - * Copyright (C) <2010> Collabora Multimedia - * Copyright (C) <2010> Nokia Corporation - * - * (C) 2005 Michal Benes - * (C) 2008 Wim Taymans - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef __GST_H264_PARSER_H__ -#define __GST_H264_PARSER_H__ - -#ifndef GST_USE_UNSTABLE_API -#warning "The H.264 parsing library is unstable API and may change in future." -#warning "You can define GST_USE_UNSTABLE_API to avoid this warning." -#endif - -#include - -G_BEGIN_DECLS - -#define GST_H264_MAX_SPS_COUNT 32 -#define GST_H264_MAX_PPS_COUNT 256 -#define GST_H264_MAX_VIEW_COUNT 1024 -#define GST_H264_MAX_VIEW_ID (GST_H264_MAX_VIEW_COUNT - 1) - -#define GST_H264_IS_P_SLICE(slice) (((slice)->type % 5) == GST_H264_P_SLICE) -#define GST_H264_IS_B_SLICE(slice) (((slice)->type % 5) == GST_H264_B_SLICE) -#define GST_H264_IS_I_SLICE(slice) (((slice)->type % 5) == GST_H264_I_SLICE) -#define GST_H264_IS_SP_SLICE(slice) (((slice)->type % 5) == GST_H264_SP_SLICE) -#define GST_H264_IS_SI_SLICE(slice) (((slice)->type % 5) == GST_H264_SI_SLICE) - -/** - * GST_H264_IS_SVC_NALU: - * @nalu: a #GstH264NalUnit - * - * Check if @nalu is a scalable extension NAL unit. - * - * Since: 1.6 - */ -#define GST_H264_IS_SVC_NALU(nalu) \ - ((nalu)->extension_type == GST_H264_NAL_EXTENSION_SVC) - -/** - * GST_H264_IS_MVC_NALU: - * @nalu: a #GstH264NalUnit - * - * Check if @nalu is a multiview extension NAL unit. - * - * Since: 1.6 - */ -#define GST_H264_IS_MVC_NALU(nalu) \ - ((nalu)->extension_type == GST_H264_NAL_EXTENSION_MVC) - -/** - * GstH264Profile: - * @GST_H264_PROFILE_BASELINE: Baseline profile (A.2.1) - * @GST_H264_PROFILE_MAIN: Main profile (A.2.2) - * @GST_H264_PROFILE_EXTENDED: Extended profile (A.2.3) - * @GST_H264_PROFILE_HIGH: High profile (A.2.4) - * @GST_H264_PROFILE_HIGH10: High 10 profile (A.2.5) or High 10 Intra - * profile (A.2.8), depending on constraint_set3_flag - * @GST_H264_PROFILE_HIGH_422: High 4:2:2 profile (A.2.6) or High - * 4:2:2 Intra profile (A.2.9), depending on constraint_set3_flag - * @GST_H264_PROFILE_HIGH_444: High 4:4:4 Predictive profile (A.2.7) - * or High 4:4:4 Intra profile (A.2.10), depending on the value of - * constraint_set3_flag - * @GST_H264_PROFILE_MULTIVIEW_HIGH: Multiview High profile (H.10.1.1) - * @GST_H264_PROFILE_STEREO_HIGH: Stereo High profile (H.10.1.2) - * @GST_H264_PROFILE_SCALABLE_BASELINE: Scalable Baseline profile (G.10.1.1) - * @GST_H264_PROFILE_SCALABLE_HIGH: Scalable High profile (G.10.1.2) - * or Scalable High Intra profile (G.10.1.3), depending on the value - * of constraint_set3_flag - * - * H.264 Profiles. - * - * Since: 1.2 - */ -typedef enum { - GST_H264_PROFILE_BASELINE = 66, - GST_H264_PROFILE_MAIN = 77, - GST_H264_PROFILE_EXTENDED = 88, - GST_H264_PROFILE_HIGH = 100, - GST_H264_PROFILE_HIGH10 = 110, - GST_H264_PROFILE_HIGH_422 = 122, - GST_H264_PROFILE_HIGH_444 = 244, - GST_H264_PROFILE_MULTIVIEW_HIGH = 118, - GST_H264_PROFILE_STEREO_HIGH = 128, - GST_H264_PROFILE_SCALABLE_BASELINE = 83, - GST_H264_PROFILE_SCALABLE_HIGH = 86 -} GstH264Profile; - -/** - * GstH264NalUnitType: - * @GST_H264_NAL_UNKNOWN: Unknown nal type - * @GST_H264_NAL_SLICE: Slice nal - * @GST_H264_NAL_SLICE_DPA: DPA slice nal - * @GST_H264_NAL_SLICE_DPB: DPB slice nal - * @GST_H264_NAL_SLICE_DPC: DPC slice nal - * @GST_H264_NAL_SLICE_IDR: DPR slice nal - * @GST_H264_NAL_SEI: Supplemental enhancement information (SEI) nal unit - * @GST_H264_NAL_SPS: Sequence parameter set (SPS) nal unit - * @GST_H264_NAL_PPS: Picture parameter set (PPS) nal unit - * @GST_H264_NAL_AU_DELIMITER: Access unit (AU) delimiter nal unit - * @GST_H264_NAL_SEQ_END: End of sequence nal unit - * @GST_H264_NAL_STREAM_END: End of stream nal unit - * @GST_H264_NAL_FILLER_DATA: Filler data nal lunit - * @GST_H264_NAL_SPS_EXT: Sequence parameter set (SPS) extension NAL unit - * @GST_H264_NAL_PREFIX_UNIT: Prefix NAL unit - * @GST_H264_NAL_SUBSET_SPS: Subset sequence parameter set (SSPS) NAL unit - * @GST_H264_NAL_DEPTH_SPS: Depth parameter set (DPS) NAL unit - * @GST_H264_NAL_SLICE_AUX: Auxiliary coded picture without partitioning NAL unit - * @GST_H264_NAL_SLICE_EXT: Coded slice extension NAL unit - * @GST_H264_NAL_SLICE_DEPTH: Coded slice extension for depth or 3D-AVC texture view - * - * Indicates the type of H264 Nal Units - */ -typedef enum -{ - GST_H264_NAL_UNKNOWN = 0, - GST_H264_NAL_SLICE = 1, - GST_H264_NAL_SLICE_DPA = 2, - GST_H264_NAL_SLICE_DPB = 3, - GST_H264_NAL_SLICE_DPC = 4, - GST_H264_NAL_SLICE_IDR = 5, - GST_H264_NAL_SEI = 6, - GST_H264_NAL_SPS = 7, - GST_H264_NAL_PPS = 8, - GST_H264_NAL_AU_DELIMITER = 9, - GST_H264_NAL_SEQ_END = 10, - GST_H264_NAL_STREAM_END = 11, - GST_H264_NAL_FILLER_DATA = 12, - GST_H264_NAL_SPS_EXT = 13, - GST_H264_NAL_PREFIX_UNIT = 14, - GST_H264_NAL_SUBSET_SPS = 15, - GST_H264_NAL_DEPTH_SPS = 16, - GST_H264_NAL_SLICE_AUX = 19, - GST_H264_NAL_SLICE_EXT = 20, - GST_H264_NAL_SLICE_DEPTH = 21 -} GstH264NalUnitType; - -/** - * GstH264NalUnitExtensionType: - * @GST_H264_NAL_EXTENSION_NONE: No NAL unit header extension is available - * @GST_H264_NAL_EXTENSION_SVC: NAL unit header extension for SVC (Annex G) - * @GST_H264_NAL_EXTENSION_MVC: NAL unit header extension for MVC (Annex H) - * - * Indicates the type of H.264 NAL unit extension. - * - * Since: 1.6 - */ -typedef enum -{ - GST_H264_NAL_EXTENSION_NONE = 0, - GST_H264_NAL_EXTENSION_SVC, - GST_H264_NAL_EXTENSION_MVC, -} GstH264NalUnitExtensionType; - -/** - * GstH264ParserResult: - * @GST_H264_PARSER_OK: The parsing succeded - * @GST_H264_PARSER_BROKEN_DATA: The data to parse is broken - * @GST_H264_PARSER_BROKEN_LINK: The link to structure needed for the parsing couldn't be found - * @GST_H264_PARSER_ERROR: An error occured when parsing - * @GST_H264_PARSER_NO_NAL: No nal found during the parsing - * @GST_H264_PARSER_NO_NAL_END: Start of the nal found, but not the end. - * - * The result of parsing H264 data. - */ -typedef enum -{ - GST_H264_PARSER_OK, - GST_H264_PARSER_BROKEN_DATA, - GST_H264_PARSER_BROKEN_LINK, - GST_H264_PARSER_ERROR, - GST_H264_PARSER_NO_NAL, - GST_H264_PARSER_NO_NAL_END -} GstH264ParserResult; - -/** - * GstH264FramePackingType: - * @GST_H264_FRAME_PACKING_NONE: A complete 2D frame without any frame packing - * @GST_H264_FRAME_PACKING_CHECKERBOARD_INTERLEAVING: Checkerboard - * based interleaving - * @GST_H264_FRAME_PACKING_COLUMN_INTERLEAVING: Column based interleaving - * @GST_H264_FRAME_PACKING_ROW_INTERLEAVING: Row based interleaving - * @GST_H264_FRAME_PACKING_SIDE_BY_SIDE: Side-by-side packing - * @GST_H264_FRMAE_PACKING_TOP_BOTTOM: Top-Bottom packing - * @GST_H264_FRAME_PACKING_TEMPORAL_INTERLEAVING: Temporal interleaving - * - * Frame packing arrangement types. - * - * Since: 1.6 - */ -typedef enum -{ - GST_H264_FRAME_PACKING_NONE = 6, - GST_H264_FRAME_PACKING_CHECKERBOARD_INTERLEAVING = 0, - GST_H264_FRAME_PACKING_COLUMN_INTERLEAVING = 1, - GST_H264_FRAME_PACKING_ROW_INTERLEAVING = 2, - GST_H264_FRAME_PACKING_SIDE_BY_SIDE = 3, - GST_H264_FRMAE_PACKING_TOP_BOTTOM = 4, - GST_H264_FRAME_PACKING_TEMPORAL_INTERLEAVING = 5 -} GstH264FramePackingType; - -/** - * GstH264SEIPayloadType: - * @GST_H264_SEI_BUF_PERIOD: Buffering Period SEI Message - * @GST_H264_SEI_PIC_TIMING: Picture Timing SEI Message - * @GST_H264_SEI_RECOVERY_POINT: Recovery Point SEI Message (D.2.7) - * @GST_H264_SEI_STEREO_VIDEO_INFO: stereo video info SEI message (Since: 1.6) - * @GST_H264_SEI_FRAME_PACKING: Frame Packing Arrangement (FPA) message that - * contains the 3D arrangement for stereoscopic 3D video (Since: 1.6) - * ... - * - * The type of SEI message. - */ -typedef enum -{ - GST_H264_SEI_BUF_PERIOD = 0, - GST_H264_SEI_PIC_TIMING = 1, - GST_H264_SEI_RECOVERY_POINT = 6, - GST_H264_SEI_STEREO_VIDEO_INFO = 21, - GST_H264_SEI_FRAME_PACKING = 45 - /* and more... */ -} GstH264SEIPayloadType; - -/** - * GstH264SEIPicStructType: - * @GST_H264_SEI_PIC_STRUCT_FRAME: Picture is a frame - * @GST_H264_SEI_PIC_STRUCT_TOP_FIELD: Top field of frame - * @GST_H264_SEI_PIC_STRUCT_BOTTOM_FIELD: Botom field of frame - * @GST_H264_SEI_PIC_STRUCT_TOP_BOTTOM: Top bottom field of frame - * @GST_H264_SEI_PIC_STRUCT_BOTTOM_TOP: bottom top field of frame - * @GST_H264_SEI_PIC_STRUCT_TOP_BOTTOM_TOP: top bottom top field of frame - * @GST_H264_SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM: bottom top bottom field of frame - * @GST_H264_SEI_PIC_STRUCT_FRAME_DOUBLING: indicates that the frame should - * be displayed two times consecutively - * @GST_H264_SEI_PIC_STRUCT_FRAME_TRIPLING: indicates that the frame should be - * displayed three times consecutively - * - * SEI pic_struct type - */ -typedef enum -{ - GST_H264_SEI_PIC_STRUCT_FRAME = 0, - GST_H264_SEI_PIC_STRUCT_TOP_FIELD = 1, - GST_H264_SEI_PIC_STRUCT_BOTTOM_FIELD = 2, - GST_H264_SEI_PIC_STRUCT_TOP_BOTTOM = 3, - GST_H264_SEI_PIC_STRUCT_BOTTOM_TOP = 4, - GST_H264_SEI_PIC_STRUCT_TOP_BOTTOM_TOP = 5, - GST_H264_SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM = 6, - GST_H264_SEI_PIC_STRUCT_FRAME_DOUBLING = 7, - GST_H264_SEI_PIC_STRUCT_FRAME_TRIPLING = 8 -} GstH264SEIPicStructType; - -/** - * GstH264SliceType: - * - * Type of Picture slice - */ - -typedef enum -{ - GST_H264_P_SLICE = 0, - GST_H264_B_SLICE = 1, - GST_H264_I_SLICE = 2, - GST_H264_SP_SLICE = 3, - GST_H264_SI_SLICE = 4, - GST_H264_S_P_SLICE = 5, - GST_H264_S_B_SLICE = 6, - GST_H264_S_I_SLICE = 7, - GST_H264_S_SP_SLICE = 8, - GST_H264_S_SI_SLICE = 9 -} GstH264SliceType; - -typedef struct _GstH264NalParser GstH264NalParser; - -typedef struct _GstH264NalUnit GstH264NalUnit; -typedef struct _GstH264NalUnitExtensionMVC GstH264NalUnitExtensionMVC; - -typedef struct _GstH264SPSExtMVCView GstH264SPSExtMVCView; -typedef struct _GstH264SPSExtMVCLevelValue GstH264SPSExtMVCLevelValue; -typedef struct _GstH264SPSExtMVCLevelValueOp GstH264SPSExtMVCLevelValueOp; -typedef struct _GstH264SPSExtMVC GstH264SPSExtMVC; - -typedef struct _GstH264SPS GstH264SPS; -typedef struct _GstH264PPS GstH264PPS; -typedef struct _GstH264HRDParams GstH264HRDParams; -typedef struct _GstH264VUIParams GstH264VUIParams; - -typedef struct _GstH264RefPicListModification GstH264RefPicListModification; -typedef struct _GstH264DecRefPicMarking GstH264DecRefPicMarking; -typedef struct _GstH264RefPicMarking GstH264RefPicMarking; -typedef struct _GstH264PredWeightTable GstH264PredWeightTable; -typedef struct _GstH264SliceHdr GstH264SliceHdr; - -typedef struct _GstH264ClockTimestamp GstH264ClockTimestamp; -typedef struct _GstH264PicTiming GstH264PicTiming; -typedef struct _GstH264BufferingPeriod GstH264BufferingPeriod; -typedef struct _GstH264RecoveryPoint GstH264RecoveryPoint; -typedef struct _GstH264StereoVideoInfo GstH264StereoVideoInfo; -typedef struct _GstH264FramePacking GstH264FramePacking; -typedef struct _GstH264SEIMessage GstH264SEIMessage; - -/** - * GstH264NalUnitExtensionMVC: - * @non_idr_flag: If equal to 0, it specifies that the current access - * unit is an IDR access unit - * @priority_id: The priority identifier for the NAL unit - * @view_id: The view identifier for the NAL unit - * @temporal_id: The temporal identifier for the NAL unit - * @anchor_pic_flag: If equal to 1, it specifies that the current - * access unit is an anchor access unit - * @inter_view_flag: If equal to 0, it specifies that the current view - * component is not used for inter-view prediction by any other view - * component in the current access unit - * - * Since: 1.6 - */ -struct _GstH264NalUnitExtensionMVC -{ - guint8 non_idr_flag; - guint8 priority_id; - guint16 view_id; - guint8 temporal_id; - guint8 anchor_pic_flag; - guint8 inter_view_flag; -}; - -/** - * GstH264NalUnit: - * @ref_idc: not equal to 0 specifies that the content of the NAL unit - * contains a sequence parameter set, a sequence parameter set - * extension, a subset sequence parameter set, a picture parameter - * set, a slice of a reference picture, a slice data partition of a - * reference picture, or a prefix NAL unit preceding a slice of a - * reference picture. - * @type: A #GstH264NalUnitType - * @idr_pic_flag: calculated idr_pic_flag - * @size: The size of the nal unit starting from @offset, thus - * including the header bytes. e.g. @type (nal_unit_type) - * @offset: The offset of the actual start of the nal unit, thus - * including the header bytes - * @sc_offset: The offset of the start code of the nal unit - * @valid: If the nal unit is valid, which means it has - * already been parsed - * @data: The data from which the Nalu has been parsed - * @header_bytes: The size of the NALU header in bytes (Since 1.6) - * @extension_type: the extension type (Since 1.6) - * - * Structure defining the Nal unit headers - */ -struct _GstH264NalUnit -{ - guint16 ref_idc; - guint16 type; - - /* calculated values */ - guint8 idr_pic_flag; - guint size; - guint offset; - guint sc_offset; - gboolean valid; - - guint8 *data; - - guint8 header_bytes; - guint8 extension_type; - union { - GstH264NalUnitExtensionMVC mvc; - } extension; -}; - -/** - * GstH264HRDParams: - * @cpb_cnt_minus1: plus 1 specifies the number of alternative - * CPB specifications in the bitstream - * @bit_rate_scale: specifies the maximum input bit rate of the - * SchedSelIdx-th CPB - * @cpb_size_scale: specifies the CPB size of the SchedSelIdx-th CPB - * @guint32 bit_rate_value_minus1: specifies the maximum input bit rate for the - * SchedSelIdx-th CPB - * @cpb_size_value_minus1: is used together with cpb_size_scale to specify the - * SchedSelIdx-th CPB size - * @cbr_flag: Specifies if running in itermediate bitrate mode or constant - * @initial_cpb_removal_delay_length_minus1: specifies the length in bits of - * the cpb_removal_delay syntax element - * @cpb_removal_delay_length_minus1: specifies the length in bits of the - * dpb_output_delay syntax element - * @dpb_output_delay_length_minus1: >0 specifies the length in bits of the time_offset syntax element. - * =0 specifies that the time_offset syntax element is not present - * @time_offset_length: Length of the time offset - * - * Defines the HRD parameters - */ -struct _GstH264HRDParams -{ - guint8 cpb_cnt_minus1; - guint8 bit_rate_scale; - guint8 cpb_size_scale; - - guint32 bit_rate_value_minus1[32]; - guint32 cpb_size_value_minus1[32]; - guint8 cbr_flag[32]; - - guint8 initial_cpb_removal_delay_length_minus1; - guint8 cpb_removal_delay_length_minus1; - guint8 dpb_output_delay_length_minus1; - guint8 time_offset_length; -}; - -/** - * GstH264VUIParams: - * @aspect_ratio_info_present_flag: %TRUE specifies that aspect_ratio_idc is present. - * %FALSE specifies that aspect_ratio_idc is not present - * @aspect_ratio_idc specifies the value of the sample aspect ratio of the luma samples - * @sar_width indicates the horizontal size of the sample aspect ratio - * @sar_height indicates the vertical size of the sample aspect ratio - * @overscan_info_present_flag: %TRUE overscan_appropriate_flag is present %FALSE otherwize - * @overscan_appropriate_flag: %TRUE indicates that the cropped decoded pictures - * output are suitable for display using overscan. %FALSE the cropped decoded pictures - * output contain visually important information - * @video_signal_type_present_flag: %TRUE specifies that video_format, video_full_range_flag and - * colour_description_present_flag are present. - * @video_format: indicates the representation of the picture - * @video_full_range_flag: indicates the black level and range of the luma and chroma signals - * @colour_description_present_flag: %TRUE specifies that colour_primaries, - * transfer_characteristics and matrix_coefficients are present - * @colour_primaries: indicates the chromaticity coordinates of the source primaries - * @transfer_characteristics: indicates the opto-electronic transfer characteristic - * @matrix_coefficients: describes the matrix coefficients used in deriving luma and chroma signals - * @chroma_loc_info_present_flag: %TRUE specifies that chroma_sample_loc_type_top_field and - * chroma_sample_loc_type_bottom_field are present, %FALSE otherwize - * @chroma_sample_loc_type_top_field: specify the location of chroma for top field - * @chroma_sample_loc_type_bottom_field specify the location of chroma for bottom field - * @timing_info_present_flag: %TRUE specifies that num_units_in_tick, - * time_scale and fixed_frame_rate_flag are present in the bitstream - * @num_units_in_tick: is the number of time units of a clock operating at the frequency time_scale Hz - * time_scale: is the number of time units that pass in one second - * @fixed_frame_rate_flag: %TRUE indicates that the temporal distance between the HRD output times - * of any two consecutive pictures in output order is constrained as specified in the spec, %FALSE - * otherwize. - * @nal_hrd_parameters_present_flag: %TRUE if nal hrd parameters present in the bitstream - * @vcl_hrd_parameters_present_flag: %TRUE if nal vlc hrd parameters present in the bitstream - * @low_delay_hrd_flag: specifies the HRD operational mode - * @pic_struct_present_flag: %TRUE specifies that picture timing SEI messages are present or not - * @bitstream_restriction_flag: %TRUE specifies that the following coded video sequence bitstream restriction - * parameters are present - * @motion_vectors_over_pic_boundaries_flag: %FALSE indicates that no sample outside the - * picture boundaries and no sample at a fractional sample position, %TRUE indicates that one or more - * samples outside picture boundaries may be used in inter prediction - * @max_bytes_per_pic_denom: indicates a number of bytes not exceeded by the sum of the sizes of - * the VCL NAL units associated with any coded picture in the coded video sequence. - * @max_bits_per_mb_denom: indicates the maximum number of coded bits of macroblock_layer - * @log2_max_mv_length_horizontal: indicate the maximum absolute value of a decoded horizontal - * motion vector component - * @log2_max_mv_length_vertical: indicate the maximum absolute value of a decoded vertical - * motion vector component - * @num_reorder_frames: indicates the maximum number of frames, complementary field pairs, - * or non-paired fields that precede any frame, - * @max_dec_frame_buffering: specifies the required size of the HRD decoded picture buffer in - * units of frame buffers. - * - * The structure representing the VUI parameters. - */ -struct _GstH264VUIParams -{ - guint8 aspect_ratio_info_present_flag; - guint8 aspect_ratio_idc; - /* if aspect_ratio_idc == 255 */ - guint16 sar_width; - guint16 sar_height; - - guint8 overscan_info_present_flag; - /* if overscan_info_present_flag */ - guint8 overscan_appropriate_flag; - - guint8 video_signal_type_present_flag; - guint8 video_format; - guint8 video_full_range_flag; - guint8 colour_description_present_flag; - guint8 colour_primaries; - guint8 transfer_characteristics; - guint8 matrix_coefficients; - - guint8 chroma_loc_info_present_flag; - guint8 chroma_sample_loc_type_top_field; - guint8 chroma_sample_loc_type_bottom_field; - - guint8 timing_info_present_flag; - /* if timing_info_present_flag */ - guint32 num_units_in_tick; - guint32 time_scale; - guint8 fixed_frame_rate_flag; - - guint8 nal_hrd_parameters_present_flag; - /* if nal_hrd_parameters_present_flag */ - GstH264HRDParams nal_hrd_parameters; - - guint8 vcl_hrd_parameters_present_flag; - /* if vcl_hrd_parameters_present_flag */ - GstH264HRDParams vcl_hrd_parameters; - - guint8 low_delay_hrd_flag; - guint8 pic_struct_present_flag; - - guint8 bitstream_restriction_flag; - /* if bitstream_restriction_flag */ - guint8 motion_vectors_over_pic_boundaries_flag; - guint32 max_bytes_per_pic_denom; - guint32 max_bits_per_mb_denom; - guint32 log2_max_mv_length_horizontal; - guint32 log2_max_mv_length_vertical; - guint32 num_reorder_frames; - guint32 max_dec_frame_buffering; - - /* calculated values */ - guint par_n; - guint par_d; -}; - -/** - * GstH264SPSExtMVCView: - * @num_anchor_refs_l0: specifies the number of view components for - * inter-view prediction in the initialized RefPicList0 in decoding - * anchor view components. - * @anchor_ref_l0: specifies the view_id for inter-view prediction in - * the initialized RefPicList0 in decoding anchor view components. - * @num_anchor_refs_l1: specifies the number of view components for - * inter-view prediction in the initialized RefPicList1 in decoding - * anchor view components. - * @anchor_ref_l1: specifies the view_id for inter-view prediction in - * the initialized RefPicList1 in decoding anchor view components. - * @num_non_anchor_refs_l0: specifies the number of view components - * for inter-view prediction in the initialized RefPicList0 in - * decoding non-anchor view components. - * @non_anchor_ref_l0: specifies the view_id for inter-view prediction - * in the initialized RefPicList0 in decoding non-anchor view - * components. - * @num_non_anchor_refs_l1: specifies the number of view components - * for inter-view prediction in the initialized RefPicList1 in - * decoding non-anchor view components. - * @non_anchor_ref_l1: specifies the view_id for inter-view prediction - * in the initialized RefPicList1 in decoding non-anchor view - * components. - * - * Represents inter-view dependency relationships for the coded video - * sequence. - * - * Since: 1.6 - */ -struct _GstH264SPSExtMVCView -{ - guint16 view_id; - guint8 num_anchor_refs_l0; - guint16 anchor_ref_l0[15]; - guint8 num_anchor_refs_l1; - guint16 anchor_ref_l1[15]; - guint8 num_non_anchor_refs_l0; - guint16 non_anchor_ref_l0[15]; - guint8 num_non_anchor_refs_l1; - guint16 non_anchor_ref_l1[15]; -}; - -/** - * GstH264SPSExtMVCLevelValueOp: - * - * Represents an operation point for the coded video sequence. - * - * Since: 1.6 - */ -struct _GstH264SPSExtMVCLevelValueOp -{ - guint8 temporal_id; - guint16 num_target_views_minus1; - guint16 *target_view_id; - guint16 num_views_minus1; -}; - -/** - * GstH264SPSExtMVCLevelValue: - * @level_idc: specifies the level value signalled for the coded video - * sequence - * @num_applicable_ops_minus1: plus 1 specifies the number of - * operation points to which the level indicated by level_idc applies - * @applicable_op: specifies the applicable operation point - * - * Represents level values for a subset of the operation points for - * the coded video sequence. - * - * Since: 1.6 - */ -struct _GstH264SPSExtMVCLevelValue -{ - guint8 level_idc; - guint16 num_applicable_ops_minus1; - GstH264SPSExtMVCLevelValueOp *applicable_op; -}; - -/** - * GstH264SPSExtMVC: - * @num_views_minus1: plus 1 specifies the maximum number of coded - * views in the coded video sequence - * @view: array of #GstH264SPSExtMVCView - * @num_level_values_signalled_minus1: plus 1 specifies the number of - * level values signalled for the coded video sequence. - * @level_value: array of #GstH264SPSExtMVCLevelValue - * - * Represents the parsed seq_parameter_set_mvc_extension(). - * - * Since: 1.6 - */ -struct _GstH264SPSExtMVC -{ - guint16 num_views_minus1; - GstH264SPSExtMVCView *view; - guint8 num_level_values_signalled_minus1; - GstH264SPSExtMVCLevelValue *level_value; -}; - -/** - * GstH264SPS: - * @id: The ID of the sequence parameter set - * @profile_idc: indicate the profile to which the coded video sequence conforms - * - * H264 Sequence Parameter Set (SPS) - */ -struct _GstH264SPS -{ - gint id; - - guint8 profile_idc; - guint8 constraint_set0_flag; - guint8 constraint_set1_flag; - guint8 constraint_set2_flag; - guint8 constraint_set3_flag; - guint8 constraint_set4_flag; - guint8 constraint_set5_flag; - guint8 level_idc; - - guint8 chroma_format_idc; - guint8 separate_colour_plane_flag; - guint8 bit_depth_luma_minus8; - guint8 bit_depth_chroma_minus8; - guint8 qpprime_y_zero_transform_bypass_flag; - - guint8 scaling_matrix_present_flag; - guint8 scaling_lists_4x4[6][16]; - guint8 scaling_lists_8x8[6][64]; - - guint8 log2_max_frame_num_minus4; - guint8 pic_order_cnt_type; - - /* if pic_order_cnt_type == 0 */ - guint8 log2_max_pic_order_cnt_lsb_minus4; - - /* else if pic_order_cnt_type == 1 */ - guint8 delta_pic_order_always_zero_flag; - gint32 offset_for_non_ref_pic; - gint32 offset_for_top_to_bottom_field; - guint8 num_ref_frames_in_pic_order_cnt_cycle; - gint32 offset_for_ref_frame[255]; - - guint32 num_ref_frames; - guint8 gaps_in_frame_num_value_allowed_flag; - guint32 pic_width_in_mbs_minus1; - guint32 pic_height_in_map_units_minus1; - guint8 frame_mbs_only_flag; - - guint8 mb_adaptive_frame_field_flag; - - guint8 direct_8x8_inference_flag; - - guint8 frame_cropping_flag; - - /* if frame_cropping_flag */ - guint32 frame_crop_left_offset; - guint32 frame_crop_right_offset; - guint32 frame_crop_top_offset; - guint32 frame_crop_bottom_offset; - - guint8 vui_parameters_present_flag; - /* if vui_parameters_present_flag */ - GstH264VUIParams vui_parameters; - - /* calculated values */ - guint8 chroma_array_type; - guint32 max_frame_num; - gint width, height; - gint crop_rect_width, crop_rect_height; - gint crop_rect_x, crop_rect_y; - gint fps_num, fps_den; - gboolean valid; - - /* Subset SPS extensions */ - guint8 extension_type; - union { - GstH264SPSExtMVC mvc; - } extension; -}; - -/** - * GstH264PPS: - * - * H264 Picture Parameter Set - */ -struct _GstH264PPS -{ - gint id; - - GstH264SPS *sequence; - - guint8 entropy_coding_mode_flag; - guint8 pic_order_present_flag; - - guint32 num_slice_groups_minus1; - - /* if num_slice_groups_minus1 > 0 */ - guint8 slice_group_map_type; - /* and if slice_group_map_type == 0 */ - guint32 run_length_minus1[8]; - /* or if slice_group_map_type == 2 */ - guint32 top_left[8]; - guint32 bottom_right[8]; - /* or if slice_group_map_type == (3, 4, 5) */ - guint8 slice_group_change_direction_flag; - guint32 slice_group_change_rate_minus1; - /* or if slice_group_map_type == 6 */ - guint32 pic_size_in_map_units_minus1; - guint8 *slice_group_id; - - guint8 num_ref_idx_l0_active_minus1; - guint8 num_ref_idx_l1_active_minus1; - guint8 weighted_pred_flag; - guint8 weighted_bipred_idc; - gint8 pic_init_qp_minus26; - gint8 pic_init_qs_minus26; - gint8 chroma_qp_index_offset; - guint8 deblocking_filter_control_present_flag; - guint8 constrained_intra_pred_flag; - guint8 redundant_pic_cnt_present_flag; - - guint8 transform_8x8_mode_flag; - - guint8 scaling_lists_4x4[6][16]; - guint8 scaling_lists_8x8[6][64]; - - guint8 second_chroma_qp_index_offset; - - gboolean valid; -}; - -struct _GstH264RefPicListModification -{ - guint8 modification_of_pic_nums_idc; - union - { - /* if modification_of_pic_nums_idc == 0 || 1 */ - guint32 abs_diff_pic_num_minus1; - /* if modification_of_pic_nums_idc == 2 */ - guint32 long_term_pic_num; - /* if modification_of_pic_nums_idc == 4 || 5 */ - guint32 abs_diff_view_idx_minus1; - } value; -}; - -struct _GstH264PredWeightTable -{ - guint8 luma_log2_weight_denom; - guint8 chroma_log2_weight_denom; - - gint16 luma_weight_l0[32]; - gint8 luma_offset_l0[32]; - - /* if seq->ChromaArrayType != 0 */ - gint16 chroma_weight_l0[32][2]; - gint8 chroma_offset_l0[32][2]; - - /* if slice->slice_type % 5 == 1 */ - gint16 luma_weight_l1[32]; - gint8 luma_offset_l1[32]; - - /* and if seq->ChromaArrayType != 0 */ - gint16 chroma_weight_l1[32][2]; - gint8 chroma_offset_l1[32][2]; -}; - -struct _GstH264RefPicMarking -{ - guint8 memory_management_control_operation; - - guint32 difference_of_pic_nums_minus1; - guint32 long_term_pic_num; - guint32 long_term_frame_idx; - guint32 max_long_term_frame_idx_plus1; -}; - -struct _GstH264DecRefPicMarking -{ - /* if slice->nal_unit.IdrPicFlag */ - guint8 no_output_of_prior_pics_flag; - guint8 long_term_reference_flag; - - guint8 adaptive_ref_pic_marking_mode_flag; - GstH264RefPicMarking ref_pic_marking[10]; - guint8 n_ref_pic_marking; -}; - - -struct _GstH264SliceHdr -{ - guint32 first_mb_in_slice; - guint32 type; - GstH264PPS *pps; - - /* if seq->separate_colour_plane_flag */ - guint8 colour_plane_id; - - guint16 frame_num; - - guint8 field_pic_flag; - guint8 bottom_field_flag; - - /* if nal_unit.type == 5 */ - guint16 idr_pic_id; - - /* if seq->pic_order_cnt_type == 0 */ - guint16 pic_order_cnt_lsb; - /* if seq->pic_order_present_flag && !field_pic_flag */ - gint32 delta_pic_order_cnt_bottom; - - gint32 delta_pic_order_cnt[2]; - guint8 redundant_pic_cnt; - - /* if slice_type == B_SLICE */ - guint8 direct_spatial_mv_pred_flag; - - guint8 num_ref_idx_l0_active_minus1; - guint8 num_ref_idx_l1_active_minus1; - - guint8 ref_pic_list_modification_flag_l0; - guint8 n_ref_pic_list_modification_l0; - GstH264RefPicListModification ref_pic_list_modification_l0[32]; - guint8 ref_pic_list_modification_flag_l1; - guint8 n_ref_pic_list_modification_l1; - GstH264RefPicListModification ref_pic_list_modification_l1[32]; - - GstH264PredWeightTable pred_weight_table; - /* if nal_unit.ref_idc != 0 */ - GstH264DecRefPicMarking dec_ref_pic_marking; - - guint8 cabac_init_idc; - gint8 slice_qp_delta; - gint8 slice_qs_delta; - - guint8 disable_deblocking_filter_idc; - gint8 slice_alpha_c0_offset_div2; - gint8 slice_beta_offset_div2; - - guint16 slice_group_change_cycle; - - /* calculated values */ - guint32 max_pic_num; - gboolean valid; - - /* Size of the slice_header() in bits */ - guint header_size; - - /* Number of emulation prevention bytes (EPB) in this slice_header() */ - guint n_emulation_prevention_bytes; -}; - - -struct _GstH264ClockTimestamp -{ - guint8 ct_type; - guint8 nuit_field_based_flag; - guint8 counting_type; - guint8 discontinuity_flag; - guint8 cnt_dropped_flag; - guint8 n_frames; - - guint8 seconds_flag; - guint8 seconds_value; - - guint8 minutes_flag; - guint8 minutes_value; - - guint8 hours_flag; - guint8 hours_value; - - guint32 time_offset; -}; - -/** - * GstH264FramePacking: - * - * Since: 1.6 - */ -struct _GstH264FramePacking -{ - guint32 frame_packing_id; - guint8 frame_packing_cancel_flag; - guint8 frame_packing_type; /* GstH264FramePackingType */ - guint8 quincunx_sampling_flag; - guint8 content_interpretation_type; - guint8 spatial_flipping_flag; - guint8 frame0_flipped_flag; - guint8 field_views_flag; - guint8 current_frame_is_frame0_flag; - guint8 frame0_self_contained_flag; - guint8 frame1_self_contained_flag; - guint8 frame0_grid_position_x; - guint8 frame0_grid_position_y; - guint8 frame1_grid_position_x; - guint8 frame1_grid_position_y; - guint16 frame_packing_repetition_period; -}; - -/** - * GstH264StereoVideoInfo: - * - * Since: 1.6 - */ -struct _GstH264StereoVideoInfo -{ - guint8 field_views_flag; - guint8 top_field_is_left_view_flag; - guint8 current_frame_is_left_view_flag; - guint8 next_frame_is_second_view_flag; - guint8 left_view_self_contained_flag; - guint8 right_view_self_contained_flag; -}; - -struct _GstH264PicTiming -{ - guint32 cpb_removal_delay; - guint32 dpb_output_delay; - - guint8 pic_struct_present_flag; - /* if pic_struct_present_flag */ - guint8 pic_struct; - - guint8 clock_timestamp_flag[3]; - GstH264ClockTimestamp clock_timestamp[3]; -}; - -struct _GstH264BufferingPeriod -{ - GstH264SPS *sps; - - /* seq->vui_parameters->nal_hrd_parameters_present_flag */ - guint32 nal_initial_cpb_removal_delay[32]; - guint32 nal_initial_cpb_removal_delay_offset[32]; - - /* seq->vui_parameters->vcl_hrd_parameters_present_flag */ - guint32 vcl_initial_cpb_removal_delay[32]; - guint32 vcl_initial_cpb_removal_delay_offset[32]; -}; - -struct _GstH264RecoveryPoint -{ - guint32 recovery_frame_cnt; - guint8 exact_match_flag; - guint8 broken_link_flag; - guint8 changing_slice_group_idc; -}; - -struct _GstH264SEIMessage -{ - GstH264SEIPayloadType payloadType; - - union { - GstH264BufferingPeriod buffering_period; - GstH264PicTiming pic_timing; - GstH264RecoveryPoint recovery_point; - GstH264StereoVideoInfo stereo_video_info; - GstH264FramePacking frame_packing; - /* ... could implement more */ - } payload; -}; - -/** - * GstH264NalParser: - * - * H264 NAL Parser (opaque structure). - */ -struct _GstH264NalParser -{ - /*< private >*/ - GstH264SPS sps[GST_H264_MAX_SPS_COUNT]; - GstH264PPS pps[GST_H264_MAX_PPS_COUNT]; - GstH264SPS *last_sps; - GstH264PPS *last_pps; -}; - -GstH264NalParser *gst_h264_nal_parser_new (void); - -GstH264ParserResult gst_h264_parser_identify_nalu (GstH264NalParser *nalparser, - const guint8 *data, guint offset, - gsize size, GstH264NalUnit *nalu); - -GstH264ParserResult gst_h264_parser_identify_nalu_unchecked (GstH264NalParser *nalparser, - const guint8 *data, guint offset, - gsize size, GstH264NalUnit *nalu); - -GstH264ParserResult gst_h264_parser_identify_nalu_avc (GstH264NalParser *nalparser, const guint8 *data, - guint offset, gsize size, guint8 nal_length_size, - GstH264NalUnit *nalu); - -GstH264ParserResult gst_h264_parser_parse_nal (GstH264NalParser *nalparser, - GstH264NalUnit *nalu); - -GstH264ParserResult gst_h264_parser_parse_slice_hdr (GstH264NalParser *nalparser, GstH264NalUnit *nalu, - GstH264SliceHdr *slice, gboolean parse_pred_weight_table, - gboolean parse_dec_ref_pic_marking); - -GstH264ParserResult gst_h264_parser_parse_subset_sps (GstH264NalParser *nalparser, GstH264NalUnit *nalu, - GstH264SPS *sps, gboolean parse_vui_params); - -GstH264ParserResult gst_h264_parser_parse_sps (GstH264NalParser *nalparser, GstH264NalUnit *nalu, - GstH264SPS *sps, gboolean parse_vui_params); - -GstH264ParserResult gst_h264_parser_parse_pps (GstH264NalParser *nalparser, - GstH264NalUnit *nalu, GstH264PPS *pps); - -GstH264ParserResult gst_h264_parser_parse_sei (GstH264NalParser *nalparser, - GstH264NalUnit *nalu, GArray ** messages); - -void gst_h264_nal_parser_free (GstH264NalParser *nalparser); - -GstH264ParserResult gst_h264_parse_subset_sps (GstH264NalUnit *nalu, - GstH264SPS *sps, gboolean parse_vui_params); - -GstH264ParserResult gst_h264_parse_sps (GstH264NalUnit *nalu, - GstH264SPS *sps, gboolean parse_vui_params); - -GstH264ParserResult gst_h264_parse_pps (GstH264NalParser *nalparser, - GstH264NalUnit *nalu, GstH264PPS *pps); - -void gst_h264_sps_clear (GstH264SPS *sps); -void gst_h264_pps_clear (GstH264PPS *pps); - -void gst_h264_quant_matrix_8x8_get_zigzag_from_raster (guint8 out_quant[64], - const guint8 quant[64]); - -void gst_h264_quant_matrix_8x8_get_raster_from_zigzag (guint8 out_quant[64], - const guint8 quant[64]); - -void gst_h264_quant_matrix_4x4_get_zigzag_from_raster (guint8 out_quant[16], - const guint8 quant[16]); - -void gst_h264_quant_matrix_4x4_get_raster_from_zigzag (guint8 out_quant[16], - const guint8 quant[16]); - -void gst_h264_video_calculate_framerate (const GstH264SPS * sps, guint field_pic_flag, - guint pic_struct, gint * fps_num, gint * fps_den); - -G_END_DECLS - -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gsth265parser.c gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gsth265parser.c --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gsth265parser.c 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gsth265parser.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2645 +0,0 @@ -/* Gstreamer H.265 bitstream parser - * Copyright (C) 2012 Intel Corporation - * Copyright (C) 2013 Sreerenj Balachandran - * - * Contact: Sreerenj Balachandran - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -/** - * SECTION:gsth265parser - * @short_description: Convenience library for h265 video bitstream parsing. - * - * It offers you bitstream parsing in HEVC mode and non-HEVC mode. To identify - * Nals in a bitstream and parse its headers, you should call: - * - * - * gst_h265_parser_identify_nalu() to identify the following nalu in - * non-HEVC bitstreams - * - * - * gst_h265_parser_identify_nalu_hevc() to identify the nalu in - * HEVC bitstreams - * - * - * - * Then, depending on the #GstH265NalUnitType of the newly parsed #GstH265NalUnit, - * you should call the differents functions to parse the structure: - * - * - * From #GST_H265_NAL_SLICE_TRAIL_N to #GST_H265_NAL_SLICE_CRA_NUT: gst_h265_parser_parse_slice_hdr() - * - * - * #GST_H265_NAL_SEI: gst_h265_parser_parse_sei() - * - * - * #GST_H265_NAL_VPS: gst_h265_parser_parse_vps() - * - * - * #GST_H265_NAL_SPS: gst_h265_parser_parse_sps() - * - * - * #GST_H265_NAL_PPS: #gst_h265_parser_parse_pps() - * - * - * Any other: gst_h265_parser_parse_nal() - * - * - * - * Note: You should always call gst_h265_parser_parse_nal() if you don't - * actually need #GstH265NalUnitType to be parsed for your personal use, in - * order to guarantee that the #GstH265Parser is always up to date. - * - * For more details about the structures, look at the ITU-T H.265 - * specifications, you can download them from: - * - * - * - * ITU-T H.265: http://www.itu.int/rec/T-REC-H.265 - * - * - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "nalutils.h" -#include "gsth265parser.h" - -#include -#include -#include -#include - -GST_DEBUG_CATEGORY (h265_parser_debug); -#define GST_CAT_DEFAULT h265_parser_debug - -static gboolean initialized = FALSE; -#define INITIALIZE_DEBUG_CATEGORY \ - if (!initialized) { \ - GST_DEBUG_CATEGORY_INIT (h265_parser_debug, "codecparsers_h265", 0, \ - "h265 parser library"); \ - initialized = TRUE; \ - } - -/**** Default scaling_lists according to Table 7-5 and 7-6 *****/ - -/* Table 7-5 */ -static const guint8 default_scaling_list0[16] = { - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16 -}; - -/* Combined the values in Table 7-6 to make the calculation easier - * Default scaling list of 8x8 and 16x16 matrices for matrixId = 0, 1 and 2 - * Default scaling list of 32x32 matrix for matrixId = 0 - */ -static const guint8 default_scaling_list1[64] = { - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 16, - 17, 16, 17, 18, 17, 18, 18, 17, 18, 21, 19, 20, - 21, 20, 19, 21, 24, 22, 22, 24, 24, 22, 22, 24, - 25, 25, 27, 30, 27, 25, 25, 29, 31, 35, 35, 31, - 29, 36, 41, 44, 41, 36, 47, 54, 54, 47, 65, 70, - 65, 88, 88, 115 -}; - -/* Combined the values in Table 7-6 to make the calculation easier - * Default scaling list of 8x8 and 16x16 matrices for matrixId = 3, 4 and 5 - * Default scaling list of 32x32 matrix for matrixId = 1 - */ -static const guint8 default_scaling_list2[64] = { - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, - 17, 17, 17, 18, 18, 18, 18, 18, 18, 20, 20, 20, - 20, 20, 20, 20, 24, 24, 24, 24, 24, 24, 24, 24, - 25, 25, 25, 25, 25, 25, 25, 28, 28, 28, 28, 28, - 28, 33, 33, 33, 33, 33, 41, 41, 41, 41, 54, 54, - 54, 71, 71, 91 -}; - -static const guint8 zigzag_4x4[16] = { - 0, 1, 4, 8, - 5, 2, 3, 6, - 9, 12, 13, 10, - 7, 11, 14, 15, -}; - -static const guint8 zigzag_8x8[64] = { - 0, 1, 8, 16, 9, 2, 3, 10, - 17, 24, 32, 25, 18, 11, 4, 5, - 12, 19, 26, 33, 40, 48, 41, 34, - 27, 20, 13, 6, 7, 14, 21, 28, - 35, 42, 49, 56, 57, 50, 43, 36, - 29, 22, 15, 23, 30, 37, 44, 51, - 58, 59, 52, 45, 38, 31, 39, 46, - 53, 60, 61, 54, 47, 55, 62, 63 -}; - -static const guint8 uprightdiagonal_4x4[16] = { - 0, 4, 1, 8, - 5, 2, 12, 9, - 6, 3, 13, 10, - 7, 14, 11, 15 -}; - -static const guint8 uprightdiagonal_8x8[64] = { - 0, 8, 1, 16, 9, 2, 24, 17, - 10, 3, 32, 25, 18, 11, 4, 40, - 33, 26, 19, 12, 5, 48, 41, 34, - 27, 20, 13, 6, 56, 49, 42, 35, - 28, 21, 14, 7, 57, 50, 43, 36, - 29, 22, 15, 58, 51, 44, 37, 30, - 23, 59, 52, 45, 38, 31, 60, 53, - 46, 39, 61, 54, 47, 62, 55, 63 -}; - -typedef struct -{ - guint par_n, par_d; -} PAR; - -/* Table E-1 - Meaning of sample aspect ratio indicator (1..16) */ -static const PAR aspect_ratios[17] = { - {0, 0}, - {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} -}; - -/***** Utils ****/ -#define EXTENDED_SAR 255 - -static GstH265VPS * -gst_h265_parser_get_vps (GstH265Parser * parser, guint8 vps_id) -{ - GstH265VPS *vps; - - vps = &parser->vps[vps_id]; - - if (vps->valid) - return vps; - - return NULL; -} - -static GstH265SPS * -gst_h265_parser_get_sps (GstH265Parser * parser, guint8 sps_id) -{ - GstH265SPS *sps; - - sps = &parser->sps[sps_id]; - - if (sps->valid) - return sps; - - return NULL; -} - -static GstH265PPS * -gst_h265_parser_get_pps (GstH265Parser * parser, guint8 pps_id) -{ - GstH265PPS *pps; - - pps = &parser->pps[pps_id]; - - if (pps->valid) - return pps; - - return NULL; -} - -static gboolean -gst_h265_parse_nalu_header (GstH265NalUnit * nalu) -{ - guint8 *data = nalu->data + nalu->offset; - GstBitReader br; - - if (nalu->size < 2) - return FALSE; - - gst_bit_reader_init (&br, data, nalu->size - nalu->offset); - - /* skip the forbidden_zero_bit */ - gst_bit_reader_skip_unchecked (&br, 1); - - nalu->type = gst_bit_reader_get_bits_uint8_unchecked (&br, 6); - nalu->layer_id = gst_bit_reader_get_bits_uint8_unchecked (&br, 6); - nalu->temporal_id_plus1 = gst_bit_reader_get_bits_uint8_unchecked (&br, 3); - nalu->header_bytes = 2; - - return TRUE; -} - -/****** Parsing functions *****/ - -static gboolean -gst_h265_parse_profile_tier_level (GstH265ProfileTierLevel * ptl, - NalReader * nr, guint8 maxNumSubLayersMinus1) -{ - guint i, j; - GST_DEBUG ("parsing \"ProfileTierLevel parameters\""); - - READ_UINT8 (nr, ptl->profile_space, 2); - READ_UINT8 (nr, ptl->tier_flag, 1); - READ_UINT8 (nr, ptl->profile_idc, 5); - - for (j = 0; j < 32; j++) - READ_UINT8 (nr, ptl->profile_compatibility_flag[j], 1); - - READ_UINT8 (nr, ptl->progressive_source_flag, 1); - READ_UINT8 (nr, ptl->interlaced_source_flag, 1); - READ_UINT8 (nr, ptl->non_packed_constraint_flag, 1); - READ_UINT8 (nr, ptl->frame_only_constraint_flag, 1); - - /* skip the reserved zero bits */ - if (!nal_reader_skip (nr, 44)) - goto error; - - READ_UINT8 (nr, ptl->level_idc, 8); - for (j = 0; j < maxNumSubLayersMinus1; j++) { - READ_UINT8 (nr, ptl->sub_layer_profile_present_flag[j], 1); - READ_UINT8 (nr, ptl->sub_layer_level_present_flag[j], 1); - } - - if (maxNumSubLayersMinus1 > 0) { - for (i = maxNumSubLayersMinus1; i < 8; i++) - if (!nal_reader_skip (nr, 2)) - goto error; - } - - for (i = 0; i < maxNumSubLayersMinus1; i++) { - if (ptl->sub_layer_profile_present_flag[i]) { - READ_UINT8 (nr, ptl->sub_layer_profile_space[i], 2); - READ_UINT8 (nr, ptl->sub_layer_tier_flag[i], 1); - READ_UINT8 (nr, ptl->sub_layer_profile_idc[i], 5); - - for (j = 0; j < 32; j++) - READ_UINT8 (nr, ptl->sub_layer_profile_compatibility_flag[i][j], 1); - - READ_UINT8 (nr, ptl->sub_layer_progressive_source_flag[i], 1); - READ_UINT8 (nr, ptl->sub_layer_interlaced_source_flag[i], 1); - READ_UINT8 (nr, ptl->sub_layer_non_packed_constraint_flag[i], 1); - READ_UINT8 (nr, ptl->sub_layer_frame_only_constraint_flag[i], 1); - - if (!nal_reader_skip (nr, 44)) - goto error; - } - - if (ptl->sub_layer_level_present_flag[i]) - READ_UINT8 (nr, ptl->sub_layer_level_idc[i], 8); - } - - return TRUE; - -error: - GST_WARNING ("error parsing \"ProfileTierLevel Parameters\""); - return FALSE; -} - -static gboolean -gst_h265_parse_sub_layer_hrd_parameters (GstH265SubLayerHRDParams * sub_hrd, - NalReader * nr, guint8 CpbCnt, guint8 sub_pic_hrd_params_present_flag) -{ - guint i; - - GST_DEBUG ("parsing \"SubLayer HRD Parameters\""); - - for (i = 0; i <= CpbCnt; i++) { - READ_UE_MAX (nr, sub_hrd->bit_rate_value_minus1[i], G_MAXUINT32 - 1); - READ_UE_MAX (nr, sub_hrd->cpb_size_value_minus1[i], G_MAXUINT32 - 1); - - if (sub_pic_hrd_params_present_flag) { - READ_UE_MAX (nr, sub_hrd->cpb_size_du_value_minus1[i], G_MAXUINT32 - 1); - READ_UE_MAX (nr, sub_hrd->bit_rate_du_value_minus1[i], G_MAXUINT32 - 1); - } - - READ_UINT8 (nr, sub_hrd->cbr_flag[i], 1); - } - - return TRUE; - -error: - GST_WARNING ("error parsing \"SubLayerHRD Parameters \""); - return FALSE; -} - -static gboolean -gst_h265_parse_hrd_parameters (GstH265HRDParams * hrd, NalReader * nr, - guint8 commonInfPresentFlag, guint8 maxNumSubLayersMinus1) -{ - guint i; - - GST_DEBUG ("parsing \"HRD Parameters\""); - - /* set default values for fields that might not be present in the bitstream - and have valid defaults */ - hrd->initial_cpb_removal_delay_length_minus1 = 23; - hrd->au_cpb_removal_delay_length_minus1 = 23; - hrd->dpb_output_delay_length_minus1 = 23; - - if (commonInfPresentFlag) { - READ_UINT8 (nr, hrd->nal_hrd_parameters_present_flag, 1); - READ_UINT8 (nr, hrd->vcl_hrd_parameters_present_flag, 1); - - if (hrd->nal_hrd_parameters_present_flag - || hrd->vcl_hrd_parameters_present_flag) { - - READ_UINT8 (nr, hrd->sub_pic_hrd_params_present_flag, 1); - - if (hrd->sub_pic_hrd_params_present_flag) { - READ_UINT8 (nr, hrd->tick_divisor_minus2, 8); - READ_UINT8 (nr, hrd->du_cpb_removal_delay_increment_length_minus1, 5); - READ_UINT8 (nr, hrd->sub_pic_cpb_params_in_pic_timing_sei_flag, 1); - READ_UINT8 (nr, hrd->dpb_output_delay_du_length_minus1, 5); - } - - READ_UINT8 (nr, hrd->bit_rate_scale, 4); - READ_UINT8 (nr, hrd->cpb_size_scale, 4); - - if (hrd->sub_pic_hrd_params_present_flag) - READ_UINT8 (nr, hrd->cpb_size_du_scale, 4); - - READ_UINT8 (nr, hrd->initial_cpb_removal_delay_length_minus1, 5); - READ_UINT8 (nr, hrd->au_cpb_removal_delay_length_minus1, 5); - READ_UINT8 (nr, hrd->dpb_output_delay_length_minus1, 5); - } - } - - for (i = 0; i <= maxNumSubLayersMinus1; i++) { - READ_UINT8 (nr, hrd->fixed_pic_rate_general_flag[i], 1); - - if (!hrd->fixed_pic_rate_general_flag[i]) { - READ_UINT8 (nr, hrd->fixed_pic_rate_within_cvs_flag[i], 1); - } else - hrd->fixed_pic_rate_within_cvs_flag[i] = 1; - - if (hrd->fixed_pic_rate_within_cvs_flag[i]) { - READ_UE_MAX (nr, hrd->elemental_duration_in_tc_minus1[i], 2047); - } else - READ_UINT8 (nr, hrd->low_delay_hrd_flag[i], 1); - - if (!hrd->low_delay_hrd_flag[i]) - READ_UE_MAX (nr, hrd->cpb_cnt_minus1[i], 31); - - if (hrd->nal_hrd_parameters_present_flag) - if (!gst_h265_parse_sub_layer_hrd_parameters (&hrd->sublayer_hrd_params - [i], nr, hrd->cpb_cnt_minus1[i], - hrd->sub_pic_hrd_params_present_flag)) - goto error; - - if (hrd->vcl_hrd_parameters_present_flag) - if (!gst_h265_parse_sub_layer_hrd_parameters (&hrd->sublayer_hrd_params - [i], nr, hrd->cpb_cnt_minus1[i], - hrd->sub_pic_hrd_params_present_flag)) - goto error; - } - - return TRUE; - -error: - GST_WARNING ("error parsing \"HRD Parameters\""); - return FALSE; -} - -static gboolean -gst_h265_parse_vui_parameters (GstH265SPS * sps, NalReader * nr) -{ - GstH265VUIParams *vui = &sps->vui_params; - - GST_DEBUG ("parsing \"VUI Parameters\""); - - /* set default values for fields that might not be present in the bitstream - and have valid defaults */ - vui->video_format = 5; - vui->colour_primaries = 2; - vui->transfer_characteristics = 2; - vui->matrix_coefficients = 2; - vui->motion_vectors_over_pic_boundaries_flag = 1; - vui->max_bytes_per_pic_denom = 2; - vui->max_bits_per_min_cu_denom = 1; - vui->log2_max_mv_length_horizontal = 15; - vui->log2_max_mv_length_vertical = 15; - - if (sps && sps->profile_tier_level.progressive_source_flag - && sps->profile_tier_level.interlaced_source_flag) - vui->frame_field_info_present_flag = 1; - - READ_UINT8 (nr, vui->aspect_ratio_info_present_flag, 1); - if (vui->aspect_ratio_info_present_flag) { - READ_UINT8 (nr, vui->aspect_ratio_idc, 8); - if (vui->aspect_ratio_idc == EXTENDED_SAR) { - READ_UINT16 (nr, vui->sar_width, 16); - READ_UINT16 (nr, vui->sar_height, 16); - vui->par_n = vui->sar_width; - vui->par_d = vui->sar_height; - } else if (vui->aspect_ratio_idc <= 16) { - vui->par_n = aspect_ratios[vui->aspect_ratio_idc].par_n; - vui->par_d = aspect_ratios[vui->aspect_ratio_idc].par_d; - } - } - - READ_UINT8 (nr, vui->overscan_info_present_flag, 1); - if (vui->overscan_info_present_flag) - READ_UINT8 (nr, vui->overscan_appropriate_flag, 1); - - READ_UINT8 (nr, vui->video_signal_type_present_flag, 1); - if (vui->video_signal_type_present_flag) { - - READ_UINT8 (nr, vui->video_format, 3); - READ_UINT8 (nr, vui->video_full_range_flag, 1); - READ_UINT8 (nr, vui->colour_description_present_flag, 1); - if (vui->colour_description_present_flag) { - READ_UINT8 (nr, vui->colour_primaries, 8); - READ_UINT8 (nr, vui->transfer_characteristics, 8); - READ_UINT8 (nr, vui->matrix_coefficients, 8); - } - } - - READ_UINT8 (nr, vui->chroma_loc_info_present_flag, 1); - if (vui->chroma_loc_info_present_flag) { - READ_UE_MAX (nr, vui->chroma_sample_loc_type_top_field, 5); - READ_UE_MAX (nr, vui->chroma_sample_loc_type_bottom_field, 5); - } - - READ_UINT8 (nr, vui->neutral_chroma_indication_flag, 1); - READ_UINT8 (nr, vui->field_seq_flag, 1); - READ_UINT8 (nr, vui->frame_field_info_present_flag, 1); - - READ_UINT8 (nr, vui->default_display_window_flag, 1); - if (vui->default_display_window_flag) { - READ_UE (nr, vui->def_disp_win_left_offset); - READ_UE (nr, vui->def_disp_win_right_offset); - READ_UE (nr, vui->def_disp_win_top_offset); - READ_UE (nr, vui->def_disp_win_bottom_offset); - } - - READ_UINT8 (nr, vui->timing_info_present_flag, 1); - if (vui->timing_info_present_flag) { - READ_UINT32 (nr, vui->num_units_in_tick, 32); - if (vui->num_units_in_tick == 0) - GST_WARNING ("num_units_in_tick = 0 detected in stream " - "(incompliant to H.265 E.2.1)."); - - READ_UINT32 (nr, vui->time_scale, 32); - if (vui->time_scale == 0) - GST_WARNING ("time_scale = 0 detected in stream " - "(incompliant to H.265 E.2.1)."); - - READ_UINT8 (nr, vui->poc_proportional_to_timing_flag, 1); - if (vui->poc_proportional_to_timing_flag) - READ_UE_MAX (nr, vui->num_ticks_poc_diff_one_minus1, G_MAXUINT32 - 1); - - READ_UINT8 (nr, vui->hrd_parameters_present_flag, 1); - if (vui->hrd_parameters_present_flag) - if (!gst_h265_parse_hrd_parameters (&vui->hrd_params, nr, 1, - sps->max_sub_layers_minus1)) - goto error; - } - - READ_UINT8 (nr, vui->bitstream_restriction_flag, 1); - if (vui->bitstream_restriction_flag) { - READ_UINT8 (nr, vui->tiles_fixed_structure_flag, 1); - READ_UINT8 (nr, vui->motion_vectors_over_pic_boundaries_flag, 1); - READ_UINT8 (nr, vui->restricted_ref_pic_lists_flag, 1); - READ_UE_MAX (nr, vui->min_spatial_segmentation_idc, 4096); - READ_UE_MAX (nr, vui->max_bytes_per_pic_denom, 16); - READ_UE_MAX (nr, vui->max_bits_per_min_cu_denom, 16); - READ_UE_MAX (nr, vui->log2_max_mv_length_horizontal, 16); - READ_UE_MAX (nr, vui->log2_max_mv_length_vertical, 15); - } - - return TRUE; - -error: - GST_WARNING ("error parsing \"VUI Parameters\""); - return FALSE; -} - -static gboolean -get_scaling_list_params (GstH265ScalingList * dest_scaling_list, - guint8 sizeId, guint8 matrixId, guint8 ** sl, guint8 * size, - gint16 ** scaling_list_dc_coef_minus8) -{ - switch (sizeId) { - case GST_H265_QUANT_MATIX_4X4: - *sl = dest_scaling_list->scaling_lists_4x4[matrixId]; - if (size) - *size = 16; - break; - case GST_H265_QUANT_MATIX_8X8: - *sl = dest_scaling_list->scaling_lists_8x8[matrixId]; - if (size) - *size = 64; - break; - case GST_H265_QUANT_MATIX_16X16: - *sl = dest_scaling_list->scaling_lists_16x16[matrixId]; - if (size) - *size = 64; - if (scaling_list_dc_coef_minus8) - *scaling_list_dc_coef_minus8 = - dest_scaling_list->scaling_list_dc_coef_minus8_16x16; - break; - case GST_H265_QUANT_MATIX_32X32: - *sl = dest_scaling_list->scaling_lists_32x32[matrixId]; - if (size) - *size = 64; - if (scaling_list_dc_coef_minus8) - *scaling_list_dc_coef_minus8 = - dest_scaling_list->scaling_list_dc_coef_minus8_32x32; - break; - default: - return FALSE; - } - return TRUE; -} - -static gboolean -get_default_scaling_lists (guint8 ** sl, guint8 sizeId, guint8 matrixId) -{ - switch (sizeId) { - case GST_H265_QUANT_MATIX_4X4: - memcpy (*sl, default_scaling_list0, 16); - break; - - case GST_H265_QUANT_MATIX_8X8: - case GST_H265_QUANT_MATIX_16X16: - if (matrixId <= 2) - memcpy (*sl, default_scaling_list1, 64); - else - memcpy (*sl, default_scaling_list2, 64); - break; - - case GST_H265_QUANT_MATIX_32X32: - if (matrixId == 0) - memcpy (*sl, default_scaling_list1, 64); - else - memcpy (*sl, default_scaling_list2, 64); - break; - - default: - return FALSE; - break; - } - return TRUE; -} - -static gboolean -gst_h265_parser_parse_scaling_lists (NalReader * nr, - GstH265ScalingList * dest_scaling_list, gboolean use_default) -{ - guint8 sizeId; - guint8 matrixId; - guint8 scaling_list_pred_mode_flag = 0; - guint8 scaling_list_pred_matrix_id_delta = 0; - guint8 size, i; - - GST_DEBUG ("parsing scaling lists"); - - for (sizeId = 0; sizeId < 4; sizeId++) { - for (matrixId = 0; matrixId < ((sizeId == 3) ? 2 : 6); matrixId++) { - gint16 *scaling_list_dc_coef_minus8 = NULL; - guint8 *sl; - - if (!get_scaling_list_params (dest_scaling_list, sizeId, matrixId, &sl, - &size, &scaling_list_dc_coef_minus8)) - goto error; - - /* use_default_scaling_matrices forcefully which means, - * sps_scaling_list_enabled_flag=TRUE, - * sps_scaling_list_data_present_flag=FALSE, - * pps_scaling_list_data_present_falg=FALSE */ - if (use_default) { - if (!get_default_scaling_lists (&sl, sizeId, matrixId)) - goto error; - - /* Inferring the value of scaling_list_dc_coef_minus8 */ - if (sizeId > 1) - scaling_list_dc_coef_minus8[matrixId] = 8; - - } else { - READ_UINT8 (nr, scaling_list_pred_mode_flag, 1); - - if (!scaling_list_pred_mode_flag) { - guint8 refMatrixId; - - READ_UE_MAX (nr, scaling_list_pred_matrix_id_delta, matrixId); - - if (!scaling_list_pred_matrix_id_delta) { - if (!get_default_scaling_lists (&sl, sizeId, matrixId)) - goto error; - - /* Inferring the value of scaling_list_dc_coef_minus8 */ - if (sizeId > 1) - scaling_list_dc_coef_minus8[matrixId] = 8; - - } else { - guint8 *temp_sl; - - refMatrixId = matrixId - scaling_list_pred_matrix_id_delta; /* 7-30 */ - - if (!get_scaling_list_params (dest_scaling_list, sizeId, - refMatrixId, &temp_sl, NULL, NULL)) - goto error; - - for (i = 0; i < size; i++) - sl[i] = temp_sl[i]; /* 7-31 */ - - - /* Inferring the value of scaling_list_dc_coef_minus8 */ - if (sizeId > 1) - scaling_list_dc_coef_minus8[matrixId] = - scaling_list_dc_coef_minus8[refMatrixId]; - } - } else { - guint8 nextCoef = 8; - gint8 scaling_list_delta_coef; - - if (sizeId > 1) { - READ_SE_ALLOWED (nr, scaling_list_dc_coef_minus8[matrixId], -7, - 247); - nextCoef = scaling_list_dc_coef_minus8[matrixId] + 8; - } - - for (i = 0; i < size; i++) { - READ_SE_ALLOWED (nr, scaling_list_delta_coef, -128, 127); - nextCoef = (nextCoef + scaling_list_delta_coef) & 0xff; - sl[i] = nextCoef; - } - } - } - } - } - - return TRUE; - -error: - GST_WARNING ("error parsing scaling lists"); - return FALSE; -} - -static gboolean -gst_h265_parser_parse_short_term_ref_pic_sets (GstH265ShortTermRefPicSet * - stRPS, NalReader * nr, guint8 stRpsIdx, GstH265SPS * sps) -{ - guint8 num_short_term_ref_pic_sets; - guint8 RefRpsIdx = 0; - gint16 deltaRps = 0; - guint8 use_delta_flag[16] = { 0 }; - guint8 used_by_curr_pic_flag[16] = { 0 }; - guint32 delta_poc_s0_minus1[16] = { 0 }; - guint32 delta_poc_s1_minus1[16] = { 0 }; - gint j, i = 0; - gint dPoc; - - GST_DEBUG ("parsing \"ShortTermRefPicSetParameters\""); - - /* set default values for fields that might not be present in the bitstream - and have valid defaults */ - for (j = 0; j < 16; j++) - use_delta_flag[j] = 1; - - num_short_term_ref_pic_sets = sps->num_short_term_ref_pic_sets; - - if (stRpsIdx != 0) - READ_UINT8 (nr, stRPS->inter_ref_pic_set_prediction_flag, 1); - - if (stRPS->inter_ref_pic_set_prediction_flag) { - GstH265ShortTermRefPicSet *RefRPS; - - if (stRpsIdx == num_short_term_ref_pic_sets) - READ_UE_MAX (nr, stRPS->delta_idx_minus1, stRpsIdx - 1); - - READ_UINT8 (nr, stRPS->delta_rps_sign, 1); - READ_UE_MAX (nr, stRPS->abs_delta_rps_minus1, 32767); - - RefRpsIdx = stRpsIdx - stRPS->delta_idx_minus1 - 1; /* 7-45 */ - deltaRps = (1 - 2 * stRPS->delta_rps_sign) * (stRPS->abs_delta_rps_minus1 + 1); /* 7-46 */ - - RefRPS = &sps->short_term_ref_pic_set[RefRpsIdx]; - - for (j = 0; j <= RefRPS->NumDeltaPocs; j++) { - READ_UINT8 (nr, used_by_curr_pic_flag[j], 1); - if (!used_by_curr_pic_flag[j]) - READ_UINT8 (nr, use_delta_flag[j], 1); - } - - /* 7-47: calcuate NumNegativePics, DeltaPocS0 and UsedByCurrPicS0 */ - i = 0; - for (j = (RefRPS->NumPositivePics - 1); j >= 0; j--) { - dPoc = RefRPS->DeltaPocS1[j] + deltaRps; - if (dPoc < 0 && use_delta_flag[RefRPS->NumNegativePics + j]) { - stRPS->DeltaPocS0[i] = dPoc; - stRPS->UsedByCurrPicS0[i++] = - used_by_curr_pic_flag[RefRPS->NumNegativePics + j]; - } - } - if (deltaRps < 0 && use_delta_flag[RefRPS->NumDeltaPocs]) { - stRPS->DeltaPocS0[i] = deltaRps; - stRPS->UsedByCurrPicS0[i++] = used_by_curr_pic_flag[RefRPS->NumDeltaPocs]; - } - for (j = 0; j < RefRPS->NumNegativePics; j++) { - dPoc = RefRPS->DeltaPocS0[j] + deltaRps; - if (dPoc < 0 && use_delta_flag[j]) { - stRPS->DeltaPocS0[i] = dPoc; - stRPS->UsedByCurrPicS0[i++] = used_by_curr_pic_flag[j]; - } - } - stRPS->NumNegativePics = i; - - /* 7-48: calcuate NumPositivePics, DeltaPocS1 and UsedByCurrPicS1 */ - i = 0; - for (j = (RefRPS->NumNegativePics - 1); j >= 0; j--) { - dPoc = RefRPS->DeltaPocS0[j] + deltaRps; - if (dPoc > 0 && use_delta_flag[j]) { - stRPS->DeltaPocS1[i] = dPoc; - stRPS->UsedByCurrPicS1[i++] = used_by_curr_pic_flag[j]; - } - } - if (deltaRps > 0 && use_delta_flag[RefRPS->NumDeltaPocs]) { - stRPS->DeltaPocS1[i] = deltaRps; - stRPS->UsedByCurrPicS1[i++] = used_by_curr_pic_flag[RefRPS->NumDeltaPocs]; - } - for (j = 0; j < RefRPS->NumPositivePics; j++) { - dPoc = RefRPS->DeltaPocS1[j] + deltaRps; - if (dPoc > 0 && use_delta_flag[RefRPS->NumNegativePics + j]) { - stRPS->DeltaPocS1[i] = dPoc; - stRPS->UsedByCurrPicS1[i++] = - used_by_curr_pic_flag[RefRPS->NumNegativePics + j]; - } - } - stRPS->NumPositivePics = i; - - } else { - /* 7-49 */ - READ_UE_MAX (nr, stRPS->NumNegativePics, - sps->max_dec_pic_buffering_minus1[sps->max_sub_layers_minus1]); - - /* 7-50 */ - READ_UE_MAX (nr, stRPS->NumPositivePics, - (sps->max_dec_pic_buffering_minus1[sps->max_sub_layers_minus1] - - stRPS->NumNegativePics)); - - for (i = 0; i < stRPS->NumNegativePics; i++) { - READ_UE_MAX (nr, delta_poc_s0_minus1[i], 32767); - /* 7-51 */ - READ_UINT8 (nr, stRPS->UsedByCurrPicS0[i], 1); - - if (i == 0) { - /* 7-53 */ - stRPS->DeltaPocS0[i] = -(delta_poc_s0_minus1[i] + 1); - } else { - /* 7-55 */ - stRPS->DeltaPocS0[i] = - stRPS->DeltaPocS0[i - 1] - (delta_poc_s0_minus1[i] + 1); - } - } - - for (j = 0; j < stRPS->NumPositivePics; j++) { - READ_UE_MAX (nr, delta_poc_s1_minus1[j], 32767); - - /* 7-52 */ - READ_UINT8 (nr, stRPS->UsedByCurrPicS1[j], 1); - - if (j == 0) { - /* 7-54 */ - stRPS->DeltaPocS1[j] = delta_poc_s1_minus1[j] + 1; - } else { - /* 7-56 */ - stRPS->DeltaPocS1[j] = - stRPS->DeltaPocS1[j - 1] + (delta_poc_s1_minus1[j] + 1); - } - } - - } - - /* 7-57 */ - stRPS->NumDeltaPocs = stRPS->NumPositivePics + stRPS->NumNegativePics; - - return TRUE; - -error: - GST_WARNING ("error parsing \"ShortTermRefPicSet Parameters\""); - return FALSE; -} - -static gboolean -gst_h265_slice_parse_ref_pic_list_modification (GstH265SliceHdr * slice, - NalReader * nr, gint NumPocTotalCurr) -{ - guint i; - GstH265RefPicListModification *rpl_mod = &slice->ref_pic_list_modification; - const guint n = ceil_log2 (NumPocTotalCurr); - - READ_UINT8 (nr, rpl_mod->ref_pic_list_modification_flag_l0, 1); - - if (rpl_mod->ref_pic_list_modification_flag_l0) { - for (i = 0; i <= slice->num_ref_idx_l0_active_minus1; i++) { - READ_UINT32 (nr, rpl_mod->list_entry_l0[i], n); - CHECK_ALLOWED_MAX (rpl_mod->list_entry_l0[i], (NumPocTotalCurr - 1)); - } - } - if (GST_H265_IS_B_SLICE (slice)) { - READ_UINT8 (nr, rpl_mod->ref_pic_list_modification_flag_l1, 1); - if (rpl_mod->ref_pic_list_modification_flag_l1) - for (i = 0; i <= slice->num_ref_idx_l1_active_minus1; i++) { - READ_UINT32 (nr, rpl_mod->list_entry_l1[i], n); - CHECK_ALLOWED_MAX (rpl_mod->list_entry_l1[i], (NumPocTotalCurr - 1)); - } - } - - return TRUE; - -error: - GST_WARNING ("error parsing \"Prediction weight table\""); - return FALSE; -} - -static gboolean -gst_h265_slice_parse_pred_weight_table (GstH265SliceHdr * slice, NalReader * nr) -{ - GstH265PredWeightTable *p; - gint i, j; - GstH265PPS *pps = slice->pps; - GstH265SPS *sps = pps->sps; - - GST_DEBUG ("parsing \"Prediction weight table\""); - - p = &slice->pred_weight_table; - - READ_UE_MAX (nr, p->luma_log2_weight_denom, 7); - - if (sps->chroma_format_idc != 0) { - READ_SE_ALLOWED (nr, p->delta_chroma_log2_weight_denom, - (0 - p->luma_log2_weight_denom), (7 - p->luma_log2_weight_denom)); - } - - for (i = 0; i <= slice->num_ref_idx_l0_active_minus1; i++) - READ_UINT8 (nr, p->luma_weight_l0_flag[i], 1); - - if (sps->chroma_format_idc != 0) - for (i = 0; i <= slice->num_ref_idx_l0_active_minus1; i++) - READ_UINT8 (nr, p->chroma_weight_l0_flag[i], 1); - - for (i = 0; i <= slice->num_ref_idx_l0_active_minus1; i++) { - if (p->luma_weight_l0_flag[i]) { - READ_SE_ALLOWED (nr, p->delta_luma_weight_l0[i], -128, 127); - READ_SE_ALLOWED (nr, p->luma_offset_l0[i], -128, 127); - } - if (p->chroma_weight_l0_flag[i]) - for (j = 0; j < 2; j++) { - READ_SE_ALLOWED (nr, p->delta_chroma_weight_l0[i][j], -128, 127); - READ_SE_ALLOWED (nr, p->delta_chroma_offset_l0[i][j], -512, 511); - } - } - - if (GST_H265_IS_B_SLICE (slice)) { - for (i = 0; i <= slice->num_ref_idx_l1_active_minus1; i++) - READ_UINT8 (nr, p->luma_weight_l1_flag[i], 1); - if (sps->chroma_format_idc != 0) - for (i = 0; i <= slice->num_ref_idx_l1_active_minus1; i++) - READ_UINT8 (nr, p->chroma_weight_l1_flag[i], 1); - - for (i = 0; i <= slice->num_ref_idx_l1_active_minus1; i++) { - if (p->luma_weight_l1_flag[i]) { - READ_SE_ALLOWED (nr, p->delta_luma_weight_l1[i], -128, 127); - READ_SE_ALLOWED (nr, p->luma_offset_l1[i], -128, 127); - } - if (p->chroma_weight_l1_flag[i]) - for (j = 0; j < 2; j++) { - READ_SE_ALLOWED (nr, p->delta_chroma_weight_l1[i][j], -128, 127); - READ_SE_ALLOWED (nr, p->delta_chroma_offset_l1[i][j], -512, 511); - } - } - } - - return TRUE; - -error: - GST_WARNING ("error parsing \"Prediction weight table\""); - return FALSE; -} - -static GstH265ParserResult -gst_h265_parser_parse_buffering_period (GstH265Parser * parser, - GstH265BufferingPeriod * per, NalReader * nr) -{ - GstH265SPS *sps; - guint8 sps_id; - guint i; - guint n; - - GST_DEBUG ("parsing \"Buffering period\""); - - READ_UE_MAX (nr, sps_id, GST_H265_MAX_SPS_COUNT - 1); - sps = gst_h265_parser_get_sps (parser, sps_id); - if (!sps) { - GST_WARNING ("couldn't find associated sequence parameter set with id: %d", - sps_id); - return GST_H265_PARSER_BROKEN_LINK; - } - per->sps = sps; - - if (sps->vui_parameters_present_flag) { - GstH265VUIParams *vui = &sps->vui_params; - GstH265HRDParams *hrd = &vui->hrd_params; - - if (!hrd->sub_pic_hrd_params_present_flag) - READ_UINT8 (nr, per->irap_cpb_params_present_flag, 1); - - if (per->irap_cpb_params_present_flag) { - READ_UINT8 (nr, per->cpb_delay_offset, - (hrd->au_cpb_removal_delay_length_minus1 + 1)); - READ_UINT8 (nr, per->dpb_delay_offset, - (hrd->dpb_output_delay_length_minus1 + 1)); - } - - n = hrd->initial_cpb_removal_delay_length_minus1 + 1; - - READ_UINT8 (nr, per->concatenation_flag, 1); - READ_UINT8 (nr, per->au_cpb_removal_delay_delta_minus1, - (hrd->au_cpb_removal_delay_length_minus1 + 1)); - - if (hrd->nal_hrd_parameters_present_flag) { - for (i = 0; i <= hrd->cpb_cnt_minus1[i]; i++) { - READ_UINT8 (nr, per->nal_initial_cpb_removal_delay[i], n); - READ_UINT8 (nr, per->nal_initial_cpb_removal_offset[i], n); - if (hrd->sub_pic_hrd_params_present_flag - || per->irap_cpb_params_present_flag) { - READ_UINT8 (nr, per->nal_initial_alt_cpb_removal_delay[i], n); - READ_UINT8 (nr, per->nal_initial_alt_cpb_removal_offset[i], n); - } - } - } - - if (hrd->vcl_hrd_parameters_present_flag) { - for (i = 0; i <= hrd->cpb_cnt_minus1[i]; i++) { - READ_UINT8 (nr, per->vcl_initial_cpb_removal_delay[i], n); - READ_UINT8 (nr, per->vcl_initial_cpb_removal_offset[i], n); - if (hrd->sub_pic_hrd_params_present_flag - || per->irap_cpb_params_present_flag) { - READ_UINT8 (nr, per->vcl_initial_alt_cpb_removal_delay[i], n); - READ_UINT8 (nr, per->vcl_initial_alt_cpb_removal_offset[i], n); - } - } - } - - } - return GST_H265_PARSER_OK; - -error: - GST_WARNING ("error parsing \"Buffering period\""); - return GST_H265_PARSER_ERROR; -} - -static GstH265ParserResult -gst_h265_parser_parse_pic_timing (GstH265Parser * parser, - GstH265PicTiming * tim, NalReader * nr) -{ - GstH265ProfileTierLevel *profile_tier_level; - guint i; - - GST_DEBUG ("parsing \"Picture timing\""); - if (!parser->last_sps || !parser->last_sps->valid) { - GST_WARNING ("didn't get the associated sequence paramater set for the " - "current access unit"); - goto error; - } - - profile_tier_level = &parser->last_sps->profile_tier_level; - - /* set default values */ - if (!profile_tier_level->progressive_source_flag - && profile_tier_level->interlaced_source_flag) - tim->source_scan_type = 0; - else if (profile_tier_level->progressive_source_flag - && !profile_tier_level->interlaced_source_flag) - tim->source_scan_type = 1; - else - tim->source_scan_type = 2; - - if (parser->last_sps->vui_parameters_present_flag) { - GstH265VUIParams *vui = &parser->last_sps->vui_params; - - if (vui->frame_field_info_present_flag) { - READ_UINT8 (nr, tim->pic_struct, 4); - READ_UINT8 (nr, tim->source_scan_type, 2); - READ_UINT8 (nr, tim->duplicate_flag, 1); - } else { - /* set default values */ - tim->pic_struct = 0; - } - - if (vui->hrd_parameters_present_flag) { - GstH265HRDParams *hrd = &vui->hrd_params; - - READ_UINT8 (nr, tim->au_cpb_removal_delay_minus1, - (hrd->au_cpb_removal_delay_length_minus1 + 1)); - READ_UINT8 (nr, tim->pic_dpb_output_delay, - (hrd->dpb_output_delay_length_minus1 + 1)); - - if (hrd->sub_pic_hrd_params_present_flag) - READ_UINT8 (nr, tim->pic_dpb_output_du_delay, - (hrd->dpb_output_delay_du_length_minus1 + 1)); - - if (hrd->sub_pic_hrd_params_present_flag - && hrd->sub_pic_cpb_params_in_pic_timing_sei_flag) { - READ_UE (nr, tim->num_decoding_units_minus1); - - READ_UINT8 (nr, tim->du_common_cpb_removal_delay_flag, 1); - if (tim->du_common_cpb_removal_delay_flag) - READ_UINT8 (nr, tim->du_common_cpb_removal_delay_increment_minus1, - (hrd->du_cpb_removal_delay_increment_length_minus1 + 1)); - - tim->num_nalus_in_du_minus1 = - g_new0 (guint32, (tim->num_decoding_units_minus1 + 1)); - tim->du_cpb_removal_delay_increment_minus1 = - g_new0 (guint8, (tim->num_decoding_units_minus1 + 1)); - - for (i = 0; i <= (tim->num_decoding_units_minus1 + 1); i++) { - READ_UE (nr, tim->num_nalus_in_du_minus1[i]); - - if (!tim->du_common_cpb_removal_delay_flag - && (i < tim->num_decoding_units_minus1)) - READ_UINT8 (nr, tim->du_cpb_removal_delay_increment_minus1[i], - (hrd->du_cpb_removal_delay_increment_length_minus1 + 1)); - } - } - } - } - return GST_H265_PARSER_OK; - -error: - GST_WARNING ("error parsing \"Picture timing\""); - return GST_H265_PARSER_ERROR; -} - -/******** API *************/ - -/** - * gst_h265_parser_new: - * - * Creates a new #GstH265Parser. It should be freed with - * gst_h265_parser_free after use. - * - * Returns: a new #GstH265Parser - */ -GstH265Parser * -gst_h265_parser_new (void) -{ - GstH265Parser *parser; - - parser = g_slice_new0 (GstH265Parser); - INITIALIZE_DEBUG_CATEGORY; - - return parser; -} - -/** - * gst_h265_parser_free: - * @parser: the #GstH265Parser to free - * - * Frees @parser and sets it to %NULL - */ -void -gst_h265_parser_free (GstH265Parser * parser) -{ - g_slice_free (GstH265Parser, parser); - parser = NULL; -} - -/** - * gst_h265_parser_identify_nalu_unchecked: - * @parser: a #GstH265Parser - * @data: The data to parse - * @offset: the offset from which to parse @data - * @size: the size of @data - * @nalu: The #GstH265NalUnit where to store parsed nal headers - * - * Parses @data and fills @nalu from the next nalu data from @data. - * - * This differs from @gst_h265_parser_identify_nalu in that it doesn't - * check whether the packet is complete or not. - * - * Note: Only use this function if you already know the provided @data - * is a complete NALU, else use @gst_h265_parser_identify_nalu. - * - * Returns: a #GstH265ParserResult - */ -GstH265ParserResult -gst_h265_parser_identify_nalu_unchecked (GstH265Parser * parser, - const guint8 * data, guint offset, gsize size, GstH265NalUnit * nalu) -{ - gint off1; - - memset (nalu, 0, sizeof (*nalu)); - - if (size < offset + 4) { - GST_DEBUG ("Can't parse, buffer has too small size %" G_GSIZE_FORMAT - ", offset %u", size, offset); - return GST_H265_PARSER_ERROR; - } - - off1 = scan_for_start_codes (data + offset, size - offset); - - if (off1 < 0) { - GST_DEBUG ("No start code prefix in this buffer"); - return GST_H265_PARSER_NO_NAL; - } - - if (offset + off1 == size - 1) { - GST_DEBUG ("Missing data to identify nal unit"); - - return GST_H265_PARSER_ERROR; - } - - nalu->sc_offset = offset + off1; - - /* sc might have 2 or 3 0-bytes */ - if (nalu->sc_offset > 0 && data[nalu->sc_offset - 1] == 00) - nalu->sc_offset--; - - nalu->offset = offset + off1 + 3; - nalu->data = (guint8 *) data; - nalu->size = size - nalu->offset; - - if (!gst_h265_parse_nalu_header (nalu)) { - GST_WARNING ("error parsing \"NAL unit header\""); - nalu->size = 0; - return GST_H265_PARSER_BROKEN_DATA; - } - - nalu->valid = TRUE; - - if (nalu->type == GST_H265_NAL_EOS || nalu->type == GST_H265_NAL_EOB) { - GST_DEBUG ("end-of-seq or end-of-stream nal found"); - nalu->size = 2; - return GST_H265_PARSER_OK; - } - - return GST_H265_PARSER_OK; -} - -/** - * gst_h265_parser_identify_nalu: - * @parser: a #GstH265Parser - * @data: The data to parse - * @offset: the offset from which to parse @data - * @size: the size of @data - * @nalu: The #GstH265NalUnit where to store parsed nal headers - * - * Parses @data and fills @nalu from the next nalu data from @data - * - * Returns: a #GstH265ParserResult - */ -GstH265ParserResult -gst_h265_parser_identify_nalu (GstH265Parser * parser, - const guint8 * data, guint offset, gsize size, GstH265NalUnit * nalu) -{ - GstH265ParserResult res; - gint off2; - - res = - gst_h265_parser_identify_nalu_unchecked (parser, data, offset, size, - nalu); - - if (res != GST_H265_PARSER_OK || nalu->size == 2) - goto beach; - - off2 = scan_for_start_codes (data + nalu->offset, size - nalu->offset); - if (off2 < 0) { - GST_DEBUG ("Nal start %d, No end found", nalu->offset); - - return GST_H265_PARSER_NO_NAL_END; - } - - /* Mini performance improvement: - * We could have a way to store how many 0s were skipped to avoid - * parsing them again on the next NAL */ - while (off2 > 0 && data[nalu->offset + off2 - 1] == 00) - off2--; - - nalu->size = off2; - if (nalu->size < 3) - return GST_H265_PARSER_BROKEN_DATA; - - GST_DEBUG ("Complete nal found. Off: %d, Size: %d", nalu->offset, nalu->size); - -beach: - return res; -} - -/** - * gst_h265_parser_identify_nalu_hevc: - * @parser: a #GstH265Parser - * @data: The data to parse, must be the beging of the Nal unit - * @offset: the offset from which to parse @data - * @size: the size of @data - * @nal_length_size: the size in bytes of the HEVC nal length prefix. - * @nalu: The #GstH265NalUnit where to store parsed nal headers - * - * Parses @data and sets @nalu. - * - * Returns: a #GstH265ParserResult - */ -GstH265ParserResult -gst_h265_parser_identify_nalu_hevc (GstH265Parser * parser, - const guint8 * data, guint offset, gsize size, guint8 nal_length_size, - GstH265NalUnit * nalu) -{ - GstBitReader br; - - memset (nalu, 0, sizeof (*nalu)); - - if (size < offset + nal_length_size) { - GST_DEBUG ("Can't parse, buffer has too small size %" G_GSIZE_FORMAT - ", offset %u", size, offset); - return GST_H265_PARSER_ERROR; - } - - size = size - offset; - gst_bit_reader_init (&br, data + offset, size); - - nalu->size = gst_bit_reader_get_bits_uint32_unchecked (&br, - nal_length_size * 8); - nalu->sc_offset = offset; - nalu->offset = offset + nal_length_size; - - if (size < nalu->size + nal_length_size) { - nalu->size = 0; - - return GST_H265_PARSER_NO_NAL_END; - } - - nalu->data = (guint8 *) data; - - if (!gst_h265_parse_nalu_header (nalu)) { - GST_WARNING ("error parsing \"NAL unit header\""); - nalu->size = 0; - return GST_H265_PARSER_BROKEN_DATA; - } - - if (nalu->size < 2) - return GST_H265_PARSER_BROKEN_DATA; - - nalu->valid = TRUE; - - return GST_H265_PARSER_OK; -} - -/** - * gst_h265_parser_parse_nal: - * @parser: a #GstH265Parser - * @nalu: The #GstH265NalUnit to parse - * - * This function should be called in the case one doesn't need to - * parse a specific structure. It is necessary to do so to make - * sure @parser is up to date. - * - * Returns: a #GstH265ParserResult - */ -GstH265ParserResult -gst_h265_parser_parse_nal (GstH265Parser * parser, GstH265NalUnit * nalu) -{ - GstH265VPS vps; - GstH265SPS sps; - GstH265PPS pps; - - switch (nalu->type) { - case GST_H265_NAL_VPS: - return gst_h265_parser_parse_vps (parser, nalu, &vps); - break; - case GST_H265_NAL_SPS: - return gst_h265_parser_parse_sps (parser, nalu, &sps, FALSE); - break; - case GST_H265_NAL_PPS: - return gst_h265_parser_parse_pps (parser, nalu, &pps); - } - - return GST_H265_PARSER_OK; -} - -/** - * gst_h265_parser_parse_vps: - * @parser: a #GstH265Parser - * @nalu: The #GST_H265_NAL_VPS #GstH265NalUnit to parse - * @vps: The #GstH265VPS to fill. - * - * Parses @data, and fills the @vps structure. - * - * Returns: a #GstH265ParserResult - */ -GstH265ParserResult -gst_h265_parser_parse_vps (GstH265Parser * parser, GstH265NalUnit * nalu, - GstH265VPS * vps) -{ - GstH265ParserResult res = gst_h265_parse_vps (nalu, vps); - - if (res == GST_H265_PARSER_OK) { - GST_DEBUG ("adding video parameter set with id: %d to array", vps->id); - - parser->vps[vps->id] = *vps; - parser->last_vps = &parser->vps[vps->id]; - } - - return res; -} - -/** - * gst_h265_parse_vps: - * @nalu: The #GST_H265_NAL_VPS #GstH265NalUnit to parse - * @sps: The #GstH265VPS to fill. - * - * Parses @data, and fills the @vps structure. - * - * Returns: a #GstH265ParserResult - */ -GstH265ParserResult -gst_h265_parse_vps (GstH265NalUnit * nalu, GstH265VPS * vps) -{ - NalReader nr; - guint i, j; - - INITIALIZE_DEBUG_CATEGORY; - GST_DEBUG ("parsing VPS"); - - nal_reader_init (&nr, nalu->data + nalu->offset + nalu->header_bytes, - nalu->size - nalu->header_bytes); - - memset (vps, 0, sizeof (*vps)); - - vps->cprms_present_flag = 1; - - READ_UINT8 (&nr, vps->id, 4); - - /* skip reserved_three_2bits */ - if (!nal_reader_skip (&nr, 2)) - goto error; - - READ_UINT8 (&nr, vps->max_layers_minus1, 6); - READ_UINT8 (&nr, vps->max_sub_layers_minus1, 3); - READ_UINT8 (&nr, vps->temporal_id_nesting_flag, 1); - - /* skip reserved_0xffff_16bits */ - if (!nal_reader_skip (&nr, 16)) - goto error; - - if (!gst_h265_parse_profile_tier_level (&vps->profile_tier_level, &nr, - vps->max_sub_layers_minus1)) - goto error; - - READ_UINT8 (&nr, vps->sub_layer_ordering_info_present_flag, 1); - - for (i = - (vps->sub_layer_ordering_info_present_flag ? 0 : - vps->max_sub_layers_minus1); i <= vps->max_sub_layers_minus1; i++) { - READ_UE_MAX (&nr, vps->max_dec_pic_buffering_minus1[i], G_MAXUINT32 - 1); - READ_UE_MAX (&nr, vps->max_num_reorder_pics[i], - vps->max_dec_pic_buffering_minus1[i]); - READ_UE_MAX (&nr, vps->max_latency_increase_plus1[i], G_MAXUINT32 - 1); - } - /* setting default values if vps->sub_layer_ordering_info_present_flag is zero */ - if (!vps->sub_layer_ordering_info_present_flag && vps->max_sub_layers_minus1) { - for (i = 0; i <= (vps->max_sub_layers_minus1 - 1); i++) { - vps->max_dec_pic_buffering_minus1[i] = - vps->max_dec_pic_buffering_minus1[vps->max_sub_layers_minus1]; - vps->max_num_reorder_pics[i] = - vps->max_num_reorder_pics[vps->max_sub_layers_minus1]; - vps->max_latency_increase_plus1[i] = - vps->max_latency_increase_plus1[vps->max_sub_layers_minus1]; - } - } - - READ_UINT8 (&nr, vps->max_layer_id, 6); - CHECK_ALLOWED_MAX (vps->max_layer_id, 0); - - READ_UE_MAX (&nr, vps->num_layer_sets_minus1, 1023); - CHECK_ALLOWED_MAX (vps->num_layer_sets_minus1, 0); - - for (i = 1; i <= vps->num_layer_sets_minus1; i++) - for (j = 0; j <= vps->max_layer_id; j++) - nal_reader_skip (&nr, 1); - - READ_UINT8 (&nr, vps->timing_info_present_flag, 1); - - if (vps->timing_info_present_flag) { - READ_UINT32 (&nr, vps->num_units_in_tick, 32); - READ_UINT32 (&nr, vps->time_scale, 32); - READ_UINT8 (&nr, vps->poc_proportional_to_timing_flag, 1); - - if (vps->poc_proportional_to_timing_flag) - READ_UE_MAX (&nr, vps->num_ticks_poc_diff_one_minus1, G_MAXUINT32 - 1); - - READ_UE_MAX (&nr, vps->num_hrd_parameters, 1024); - CHECK_ALLOWED_MAX (vps->num_hrd_parameters, 1); - - if (vps->num_hrd_parameters) { - READ_UE_MAX (&nr, vps->hrd_layer_set_idx, 1023); - CHECK_ALLOWED_MAX (vps->hrd_layer_set_idx, 0); - - if (!gst_h265_parse_hrd_parameters (&vps->hrd_params, &nr, - vps->cprms_present_flag, vps->max_sub_layers_minus1)) - goto error; - } - } - READ_UINT8 (&nr, vps->vps_extension, 1); - vps->valid = TRUE; - - return GST_H265_PARSER_OK; - -error: - GST_WARNING ("error parsing \"Video parameter set\""); - vps->valid = FALSE; - return GST_H265_PARSER_ERROR; -} - -/** - * gst_h265_parser_parse_sps: - * @parser: a #GstH265Parser - * @nalu: The #GST_H265_NAL_SPS #GstH265NalUnit to parse - * @sps: The #GstH265SPS to fill. - * @parse_vui_params: Whether to parse the vui_params or not - * - * Parses @data, and fills the @sps structure. - * - * Returns: a #GstH265ParserResult - */ -GstH265ParserResult -gst_h265_parser_parse_sps (GstH265Parser * parser, GstH265NalUnit * nalu, - GstH265SPS * sps, gboolean parse_vui_params) -{ - GstH265ParserResult res = - gst_h265_parse_sps (parser, nalu, sps, parse_vui_params); - - if (res == GST_H265_PARSER_OK) { - GST_DEBUG ("adding sequence parameter set with id: %d to array", sps->id); - - parser->sps[sps->id] = *sps; - parser->last_sps = &parser->sps[sps->id]; - } - - return res; -} - -/** - * gst_h265_parse_sps: - * parser: The #GstH265Parser - * @nalu: The #GST_H265_NAL_SPS #GstH265NalUnit to parse - * @sps: The #GstH265SPS to fill. - * @parse_vui_params: Whether to parse the vui_params or not - * - * Parses @data, and fills the @sps structure. - * - * Returns: a #GstH265ParserResult - */ -GstH265ParserResult -gst_h265_parse_sps (GstH265Parser * parser, GstH265NalUnit * nalu, - GstH265SPS * sps, gboolean parse_vui_params) -{ - NalReader nr; - GstH265VPS *vps; - guint8 vps_id; - guint i; - guint subwc[] = { 1, 2, 2, 1, 1 }; - guint subhc[] = { 1, 2, 1, 1, 1 }; - GstH265VUIParams *vui = NULL; - - INITIALIZE_DEBUG_CATEGORY; - GST_DEBUG ("parsing SPS"); - - nal_reader_init (&nr, nalu->data + nalu->offset + nalu->header_bytes, - nalu->size - nalu->header_bytes); - - memset (sps, 0, sizeof (*sps)); - - READ_UINT8 (&nr, vps_id, 4); - vps = gst_h265_parser_get_vps (parser, vps_id); - if (!vps) { - GST_DEBUG ("couldn't find associated video parameter set with id: %d", - vps_id); - } - sps->vps = vps; - - READ_UINT8 (&nr, sps->max_sub_layers_minus1, 3); - READ_UINT8 (&nr, sps->temporal_id_nesting_flag, 1); - - if (!gst_h265_parse_profile_tier_level (&sps->profile_tier_level, &nr, - sps->max_sub_layers_minus1)) - goto error; - - READ_UE_MAX (&nr, sps->id, GST_H265_MAX_SPS_COUNT - 1); - - READ_UE_MAX (&nr, sps->chroma_format_idc, 3); - if (sps->chroma_format_idc == 3) - READ_UINT8 (&nr, sps->separate_colour_plane_flag, 1); - - READ_UE_ALLOWED (&nr, sps->pic_width_in_luma_samples, 1, 16888); - READ_UE_ALLOWED (&nr, sps->pic_height_in_luma_samples, 1, 16888); - - READ_UINT8 (&nr, sps->conformance_window_flag, 1); - if (sps->conformance_window_flag) { - READ_UE (&nr, sps->conf_win_left_offset); - READ_UE (&nr, sps->conf_win_right_offset); - READ_UE (&nr, sps->conf_win_top_offset); - READ_UE (&nr, sps->conf_win_bottom_offset); - } - - READ_UE_MAX (&nr, sps->bit_depth_luma_minus8, 6); - READ_UE_MAX (&nr, sps->bit_depth_chroma_minus8, 6); - READ_UE_MAX (&nr, sps->log2_max_pic_order_cnt_lsb_minus4, 12); - - READ_UINT8 (&nr, sps->sub_layer_ordering_info_present_flag, 1); - for (i = - (sps->sub_layer_ordering_info_present_flag ? 0 : - sps->max_sub_layers_minus1); i <= sps->max_sub_layers_minus1; i++) { - READ_UE_MAX (&nr, sps->max_dec_pic_buffering_minus1[i], 16); - READ_UE_MAX (&nr, sps->max_num_reorder_pics[i], - sps->max_dec_pic_buffering_minus1[i]); - READ_UE_MAX (&nr, sps->max_latency_increase_plus1[i], G_MAXUINT32 - 1); - } - /* setting default values if sps->sub_layer_ordering_info_present_flag is zero */ - if (!sps->sub_layer_ordering_info_present_flag && sps->max_sub_layers_minus1) { - for (i = 0; i <= (sps->max_sub_layers_minus1 - 1); i++) { - sps->max_dec_pic_buffering_minus1[i] = - sps->max_dec_pic_buffering_minus1[sps->max_sub_layers_minus1]; - sps->max_num_reorder_pics[i] = - sps->max_num_reorder_pics[sps->max_sub_layers_minus1]; - sps->max_latency_increase_plus1[i] = - sps->max_latency_increase_plus1[sps->max_sub_layers_minus1]; - } - } - - /* The limits are calculted based on the profile_tier_level constraint - * in Annex-A: CtbLog2SizeY = 4 to 6 */ - READ_UE_MAX (&nr, sps->log2_min_luma_coding_block_size_minus3, 3); - READ_UE_MAX (&nr, sps->log2_diff_max_min_luma_coding_block_size, 6); - READ_UE_MAX (&nr, sps->log2_min_transform_block_size_minus2, 3); - READ_UE_MAX (&nr, sps->log2_diff_max_min_transform_block_size, 3); - READ_UE_MAX (&nr, sps->max_transform_hierarchy_depth_inter, 4); - READ_UE_MAX (&nr, sps->max_transform_hierarchy_depth_intra, 4); - - READ_UINT8 (&nr, sps->scaling_list_enabled_flag, 1); - if (sps->scaling_list_enabled_flag) { - READ_UINT8 (&nr, sps->scaling_list_data_present_flag, 1); - - if (sps->scaling_list_data_present_flag) - if (!gst_h265_parser_parse_scaling_lists (&nr, &sps->scaling_list, FALSE)) - goto error; - } - - READ_UINT8 (&nr, sps->amp_enabled_flag, 1); - READ_UINT8 (&nr, sps->sample_adaptive_offset_enabled_flag, 1); - READ_UINT8 (&nr, sps->pcm_enabled_flag, 1); - - if (sps->pcm_enabled_flag) { - READ_UINT8 (&nr, sps->pcm_sample_bit_depth_luma_minus1, 4); - READ_UINT8 (&nr, sps->pcm_sample_bit_depth_chroma_minus1, 4); - READ_UE_MAX (&nr, sps->log2_min_pcm_luma_coding_block_size_minus3, 2); - READ_UE_MAX (&nr, sps->log2_diff_max_min_pcm_luma_coding_block_size, 2); - READ_UINT8 (&nr, sps->pcm_loop_filter_disabled_flag, 1); - } - - READ_UE_MAX (&nr, sps->num_short_term_ref_pic_sets, 64); - for (i = 0; i < sps->num_short_term_ref_pic_sets; i++) - if (!gst_h265_parser_parse_short_term_ref_pic_sets - (&sps->short_term_ref_pic_set[i], &nr, i, sps)) - goto error; - - READ_UINT8 (&nr, sps->long_term_ref_pics_present_flag, 1); - if (sps->long_term_ref_pics_present_flag) { - READ_UE_MAX (&nr, sps->num_long_term_ref_pics_sps, 32); - for (i = 0; i < sps->num_long_term_ref_pics_sps; i++) { - READ_UINT16 (&nr, sps->lt_ref_pic_poc_lsb_sps[i], - sps->log2_max_pic_order_cnt_lsb_minus4 + 4); - READ_UINT8 (&nr, sps->used_by_curr_pic_lt_sps_flag[i], 1); - } - } - - READ_UINT8 (&nr, sps->temporal_mvp_enabled_flag, 1); - READ_UINT8 (&nr, sps->strong_intra_smoothing_enabled_flag, 1); - READ_UINT8 (&nr, sps->vui_parameters_present_flag, 1); - - if (sps->vui_parameters_present_flag && parse_vui_params) { - if (!gst_h265_parse_vui_parameters (sps, &nr)) - goto error; - vui = &sps->vui_params; - } - - READ_UINT8 (&nr, sps->sps_extension_flag, 1); - - /* calculate ChromaArrayType */ - if (!sps->separate_colour_plane_flag) - sps->chroma_array_type = sps->chroma_format_idc; - - /* Calculate width and height */ - sps->width = sps->pic_width_in_luma_samples; - sps->height = sps->pic_height_in_luma_samples; - if (sps->width < 0 || sps->height < 0) { - GST_WARNING ("invalid width/height in SPS"); - goto error; - } - - if (sps->conformance_window_flag) { - const guint crop_unit_x = subwc[sps->chroma_format_idc]; - const guint crop_unit_y = subhc[sps->chroma_format_idc]; - - sps->crop_rect_width = sps->width - - (sps->conf_win_left_offset + sps->conf_win_right_offset) * crop_unit_x; - sps->crop_rect_height = sps->height - - (sps->conf_win_top_offset + sps->conf_win_bottom_offset) * crop_unit_y; - sps->crop_rect_x = sps->conf_win_left_offset * crop_unit_x; - sps->crop_rect_y = sps->conf_win_top_offset * crop_unit_y; - - GST_LOG ("crop_rectangle x=%u y=%u width=%u, height=%u", sps->crop_rect_x, - sps->crop_rect_y, sps->crop_rect_width, sps->crop_rect_height); - } - - sps->fps_num = 0; - sps->fps_den = 1; - - if (vui && vui->timing_info_present_flag) { - /* derive framerate for progressive stream if the pic_struct - * syntax element is not present in picture timing SEI messages */ - /* Fixme: handle other cases also */ - if (parse_vui_params && vui->timing_info_present_flag - && !vui->field_seq_flag && !vui->frame_field_info_present_flag) { - sps->fps_num = vui->time_scale; - sps->fps_den = vui->num_units_in_tick; - GST_LOG ("framerate %d/%d", sps->fps_num, sps->fps_den); - } - } else { - GST_LOG ("No VUI, unknown framerate"); - } - - sps->valid = TRUE; - - return GST_H265_PARSER_OK; - -error: - GST_WARNING ("error parsing \"Sequence parameter set\""); - sps->valid = FALSE; - return GST_H265_PARSER_ERROR; -} - -/** - * gst_h265_parse_pps: - * @parser: a #GstH265Parser - * @nalu: The #GST_H265_NAL_PPS #GstH265NalUnit to parse - * @pps: The #GstH265PPS to fill. - * - * Parses @data, and fills the @pps structure. - * - * Returns: a #GstH265ParserResult - */ -GstH265ParserResult -gst_h265_parse_pps (GstH265Parser * parser, GstH265NalUnit * nalu, - GstH265PPS * pps) -{ - NalReader nr; - GstH265SPS *sps; - gint sps_id; - gint qp_bd_offset; - guint32 CtbSizeY, MinCbLog2SizeY, CtbLog2SizeY; - guint8 i; - - INITIALIZE_DEBUG_CATEGORY; - GST_DEBUG ("parsing PPS"); - - nal_reader_init (&nr, nalu->data + nalu->offset + nalu->header_bytes, - nalu->size - nalu->header_bytes); - - memset (pps, 0, sizeof (*pps)); - - READ_UE_MAX (&nr, pps->id, GST_H265_MAX_PPS_COUNT - 1); - READ_UE_MAX (&nr, sps_id, GST_H265_MAX_SPS_COUNT - 1); - - sps = gst_h265_parser_get_sps (parser, sps_id); - if (!sps) { - GST_WARNING ("couldn't find associated sequence parameter set with id: %d", - sps_id); - return GST_H265_PARSER_BROKEN_LINK; - } - pps->sps = sps; - qp_bd_offset = 6 * sps->bit_depth_luma_minus8; - - MinCbLog2SizeY = sps->log2_min_luma_coding_block_size_minus3 + 3; - CtbLog2SizeY = MinCbLog2SizeY + sps->log2_diff_max_min_luma_coding_block_size; - CtbSizeY = 1 << CtbLog2SizeY; - pps->PicHeightInCtbsY = - ceil ((gdouble) sps->pic_height_in_luma_samples / (gdouble) CtbSizeY); - pps->PicWidthInCtbsY = - ceil ((gdouble) sps->pic_width_in_luma_samples / (gdouble) CtbSizeY); - - /* set default values for fields that might not be present in the bitstream - and have valid defaults */ - pps->uniform_spacing_flag = 1; - pps->loop_filter_across_tiles_enabled_flag = 1; - - READ_UINT8 (&nr, pps->dependent_slice_segments_enabled_flag, 1); - READ_UINT8 (&nr, pps->output_flag_present_flag, 1); - READ_UINT8 (&nr, pps->num_extra_slice_header_bits, 3); - READ_UINT8 (&nr, pps->sign_data_hiding_enabled_flag, 1); - READ_UINT8 (&nr, pps->cabac_init_present_flag, 1); - - READ_UE_MAX (&nr, pps->num_ref_idx_l0_default_active_minus1, 14); - READ_UE_MAX (&nr, pps->num_ref_idx_l1_default_active_minus1, 14); - READ_SE_ALLOWED (&nr, pps->init_qp_minus26, -(26 + qp_bd_offset), 25); - - READ_UINT8 (&nr, pps->constrained_intra_pred_flag, 1); - READ_UINT8 (&nr, pps->transform_skip_enabled_flag, 1); - - READ_UINT8 (&nr, pps->cu_qp_delta_enabled_flag, 1); - if (pps->cu_qp_delta_enabled_flag) - READ_UE_MAX (&nr, pps->diff_cu_qp_delta_depth, - sps->log2_diff_max_min_luma_coding_block_size); - - READ_SE_ALLOWED (&nr, pps->cb_qp_offset, -12, 12); - READ_SE_ALLOWED (&nr, pps->cr_qp_offset, -12, 12); - - READ_UINT8 (&nr, pps->slice_chroma_qp_offsets_present_flag, 1); - READ_UINT8 (&nr, pps->weighted_pred_flag, 1); - READ_UINT8 (&nr, pps->weighted_bipred_flag, 1); - READ_UINT8 (&nr, pps->transquant_bypass_enabled_flag, 1); - READ_UINT8 (&nr, pps->tiles_enabled_flag, 1); - READ_UINT8 (&nr, pps->entropy_coding_sync_enabled_flag, 1); - - if (pps->tiles_enabled_flag) { - READ_UE_ALLOWED (&nr, pps->num_tile_columns_minus1, 0, 19); - READ_UE_ALLOWED (&nr, pps->num_tile_rows_minus1, 0, 21); - - READ_UINT8 (&nr, pps->uniform_spacing_flag, 1); - /* 6.5.1, 6-4, 6-5, 7.4.3.3.1 */ - if (pps->uniform_spacing_flag) { - guint8 num_col = pps->num_tile_columns_minus1 + 1; - guint8 num_row = pps->num_tile_rows_minus1 + 1; - for (i = 0; i < num_col; i++) { - pps->column_width_minus1[i] = - ((i + 1) * pps->PicWidthInCtbsY / num_col - - i * pps->PicWidthInCtbsY / num_col) - 1; - } - for (i = 0; i < num_row; i++) { - pps->row_height_minus1[i] = - ((i + 1) * pps->PicHeightInCtbsY / num_row - - i * pps->PicHeightInCtbsY / num_row) - 1; - } - } else { - pps->column_width_minus1[pps->num_tile_columns_minus1] = - pps->PicWidthInCtbsY - 1; - for (i = 0; i < pps->num_tile_columns_minus1; i++) { - READ_UE (&nr, pps->column_width_minus1[i]); - pps->column_width_minus1[pps->num_tile_columns_minus1] -= - (pps->column_width_minus1[i] + 1); - } - - pps->row_height_minus1[pps->num_tile_rows_minus1] = - pps->PicHeightInCtbsY - 1; - for (i = 0; i < pps->num_tile_rows_minus1; i++) { - READ_UE (&nr, pps->row_height_minus1[i]); - pps->row_height_minus1[pps->num_tile_rows_minus1] -= - (pps->row_height_minus1[i] + 1); - } - } - READ_UINT8 (&nr, pps->loop_filter_across_tiles_enabled_flag, 1); - } - - READ_UINT8 (&nr, pps->loop_filter_across_slices_enabled_flag, 1); - - READ_UINT8 (&nr, pps->deblocking_filter_control_present_flag, 1); - if (pps->deblocking_filter_control_present_flag) { - READ_UINT8 (&nr, pps->deblocking_filter_override_enabled_flag, 1); - - READ_UINT8 (&nr, pps->deblocking_filter_disabled_flag, 1); - if (!pps->deblocking_filter_disabled_flag) { - READ_SE_ALLOWED (&nr, pps->beta_offset_div2, -6, 6); - READ_SE_ALLOWED (&nr, pps->tc_offset_div2, -6, +6); - } - } - - READ_UINT8 (&nr, pps->scaling_list_data_present_flag, 1); - if (pps->scaling_list_data_present_flag) - if (!gst_h265_parser_parse_scaling_lists (&nr, &pps->scaling_list, FALSE)) - goto error; - if (sps->scaling_list_enabled_flag && !sps->scaling_list_data_present_flag - && !pps->scaling_list_data_present_flag) - if (!gst_h265_parser_parse_scaling_lists (&nr, &pps->scaling_list, TRUE)) - goto error; - - READ_UINT8 (&nr, pps->lists_modification_present_flag, 1); - READ_UE_MAX (&nr, pps->log2_parallel_merge_level_minus2, 4); - READ_UINT8 (&nr, pps->slice_segment_header_extension_present_flag, 1); - READ_UINT8 (&nr, pps->pps_extension_flag, 1); - - pps->valid = TRUE; - return GST_H265_PARSER_OK; - -error: - GST_WARNING ("error parsing \"Picture parameter set\""); - pps->valid = FALSE; - return GST_H265_PARSER_ERROR; -} - -/** - * gst_h265_parser_parse_pps: - * @parser: a #GstH265Parser - * @nalu: The #GST_H265_NAL_PPS #GstH265NalUnit to parse - * @pps: The #GstH265PPS to fill. - * - * Parses @data, and fills the @pps structure. - * - * Returns: a #GstH265ParserResult - */ -GstH265ParserResult -gst_h265_parser_parse_pps (GstH265Parser * parser, - GstH265NalUnit * nalu, GstH265PPS * pps) -{ - GstH265ParserResult res = gst_h265_parse_pps (parser, nalu, pps); - if (res == GST_H265_PARSER_OK) { - GST_DEBUG ("adding picture parameter set with id: %d to array", pps->id); - - parser->pps[pps->id] = *pps; - parser->last_pps = &parser->pps[pps->id]; - } - - return res; -} - -/** - * gst_h265_parser_parse_slice_hdr: - * @parser: a #GstH265Parser - * @nalu: The #GST_H265_NAL_SLICE #GstH265NalUnit to parse - * @slice: The #GstH265SliceHdr to fill. - * - * Parses @data, and fills the @slice structure. - * The resulting @slice_hdr structure shall be deallocated with - * gst_h265_slice_hdr_free() when it is no longer needed - * - * Returns: a #GstH265ParserResult - */ -GstH265ParserResult -gst_h265_parser_parse_slice_hdr (GstH265Parser * parser, - GstH265NalUnit * nalu, GstH265SliceHdr * slice) -{ - NalReader nr; - gint pps_id; - GstH265PPS *pps; - GstH265SPS *sps; - guint i; - GstH265ShortTermRefPicSet *stRPS = NULL; - guint32 UsedByCurrPicLt[16]; - guint32 PicSizeInCtbsY; - gint NumPocTotalCurr = 0; - - memset (slice, 0, sizeof (*slice)); - - if (!nalu->size) { - GST_DEBUG ("Invalid Nal Unit"); - return GST_H265_PARSER_ERROR; - } - - nal_reader_init (&nr, nalu->data + nalu->offset + nalu->header_bytes, - nalu->size - nalu->header_bytes); - - GST_DEBUG ("parsing \"Slice header\", slice type"); - - READ_UINT8 (&nr, slice->first_slice_segment_in_pic_flag, 1); - - if (nalu->type >= GST_H265_NAL_SLICE_BLA_W_LP - && nalu->type <= RESERVED_IRAP_NAL_TYPE_MAX) - READ_UINT8 (&nr, slice->no_output_of_prior_pics_flag, 1); - - READ_UE_MAX (&nr, pps_id, GST_H265_MAX_PPS_COUNT - 1); - pps = gst_h265_parser_get_pps (parser, pps_id); - if (!pps) { - GST_WARNING - ("couldn't find associated picture parameter set with id: %d", pps_id); - return GST_H265_PARSER_BROKEN_LINK; - } - - slice->pps = pps; - sps = pps->sps; - if (!sps) { - GST_WARNING - ("couldn't find associated sequence parameter set with id: %d", - pps->id); - return GST_H265_PARSER_BROKEN_LINK; - } - - PicSizeInCtbsY = pps->PicWidthInCtbsY * pps->PicHeightInCtbsY; - /* set default values for fields that might not be present in the bitstream - * and have valid defaults */ - slice->pic_output_flag = 1; - slice->collocated_from_l0_flag = 1; - slice->beta_offset_div2 = pps->beta_offset_div2; - slice->tc_offset_div2 = pps->tc_offset_div2; - slice->loop_filter_across_slices_enabled_flag = - pps->loop_filter_across_slices_enabled_flag; - - if (!slice->first_slice_segment_in_pic_flag) { - const guint n = ceil_log2 (PicSizeInCtbsY); - - if (pps->dependent_slice_segments_enabled_flag) - READ_UINT8 (&nr, slice->dependent_slice_segment_flag, 1); - /* sice_segment_address parsing */ - READ_UINT32 (&nr, slice->segment_address, n); - } - - if (!slice->dependent_slice_segment_flag) { - for (i = 0; i < pps->num_extra_slice_header_bits; i++) - nal_reader_skip (&nr, 1); - READ_UE_MAX (&nr, slice->type, 63); - - - if (pps->output_flag_present_flag) - READ_UINT8 (&nr, slice->pic_output_flag, 1); - if (sps->separate_colour_plane_flag == 1) - READ_UINT8 (&nr, slice->colour_plane_id, 2); - - if ((nalu->type != GST_H265_NAL_SLICE_IDR_W_RADL) - && (nalu->type != GST_H265_NAL_SLICE_IDR_N_LP)) { - READ_UINT16 (&nr, slice->pic_order_cnt_lsb, - (sps->log2_max_pic_order_cnt_lsb_minus4 + 4)); - - READ_UINT8 (&nr, slice->short_term_ref_pic_set_sps_flag, 1); - if (!slice->short_term_ref_pic_set_sps_flag) { - if (!gst_h265_parser_parse_short_term_ref_pic_sets - (&slice->short_term_ref_pic_sets, &nr, - sps->num_short_term_ref_pic_sets, sps)) - goto error; - } else if (sps->num_short_term_ref_pic_sets > 1) { - const guint n = ceil_log2 (sps->num_short_term_ref_pic_sets); - READ_UINT8 (&nr, slice->short_term_ref_pic_set_idx, n); - CHECK_ALLOWED_MAX (slice->short_term_ref_pic_set_idx, - sps->num_short_term_ref_pic_sets - 1); - } - - if (sps->long_term_ref_pics_present_flag) { - guint32 limit; - - if (sps->num_long_term_ref_pics_sps > 0) - READ_UE_MAX (&nr, slice->num_long_term_sps, - sps->num_long_term_ref_pics_sps); - - READ_UE_MAX (&nr, slice->num_long_term_pics, 16); - limit = slice->num_long_term_sps + slice->num_long_term_pics; - for (i = 0; i < limit; i++) { - if (i < slice->num_long_term_sps) { - if (sps->num_long_term_ref_pics_sps > 1) { - const guint n = ceil_log2 (sps->num_long_term_ref_pics_sps); - READ_UINT8 (&nr, slice->lt_idx_sps[i], n); - } - } else { - READ_UINT32 (&nr, slice->poc_lsb_lt[i], - (sps->log2_max_pic_order_cnt_lsb_minus4 + 4)); - READ_UINT8 (&nr, slice->used_by_curr_pic_lt_flag[i], 1); - } - - /* calculate UsedByCurrPicLt */ - if (i < slice->num_long_term_sps) - UsedByCurrPicLt[i] = - sps->used_by_curr_pic_lt_sps_flag[slice->lt_idx_sps[i]]; - else - UsedByCurrPicLt[i] = slice->used_by_curr_pic_lt_flag[i]; - READ_UINT8 (&nr, slice->delta_poc_msb_present_flag[i], 1); - if (slice->delta_poc_msb_present_flag[i]) - READ_UE (&nr, slice->delta_poc_msb_cycle_lt[i]); - } - } - if (sps->temporal_mvp_enabled_flag) - READ_UINT8 (&nr, slice->temporal_mvp_enabled_flag, 1); - } - - if (sps->sample_adaptive_offset_enabled_flag) { - READ_UINT8 (&nr, slice->sao_luma_flag, 1); - READ_UINT8 (&nr, slice->sao_chroma_flag, 1); - } - - if (GST_H265_IS_B_SLICE (slice) || GST_H265_IS_P_SLICE (slice)) { - READ_UINT8 (&nr, slice->num_ref_idx_active_override_flag, 1); - - if (slice->num_ref_idx_active_override_flag) { - READ_UE_MAX (&nr, slice->num_ref_idx_l0_active_minus1, 14); - if (GST_H265_IS_B_SLICE (slice)) - READ_UE_MAX (&nr, slice->num_ref_idx_l1_active_minus1, 14); - } else { - /*set default values */ - slice->num_ref_idx_l0_active_minus1 = - pps->num_ref_idx_l0_default_active_minus1; - slice->num_ref_idx_l1_active_minus1 = - pps->num_ref_idx_l1_default_active_minus1; - } - - /* calculate NumPocTotalCurr */ - if (slice->short_term_ref_pic_set_sps_flag) - stRPS = &sps->short_term_ref_pic_set[slice->short_term_ref_pic_set_idx]; - else - stRPS = &slice->short_term_ref_pic_sets; - - for (i = 0; i < stRPS->NumNegativePics; i++) - if (stRPS->UsedByCurrPicS0[i]) - NumPocTotalCurr++; - for (i = 0; i < stRPS->NumPositivePics; i++) - if (stRPS->UsedByCurrPicS1[i]) - NumPocTotalCurr++; - for (i = 0; - i < (slice->num_long_term_sps + slice->num_long_term_pics); i++) - if (UsedByCurrPicLt[i]) - NumPocTotalCurr++; - slice->NumPocTotalCurr = NumPocTotalCurr; - - if (pps->lists_modification_present_flag) { - if (NumPocTotalCurr > 1) - if (!gst_h265_slice_parse_ref_pic_list_modification (slice, &nr, - NumPocTotalCurr)) - goto error; - } - - if (GST_H265_IS_B_SLICE (slice)) - READ_UINT8 (&nr, slice->mvd_l1_zero_flag, 1); - if (pps->cabac_init_present_flag) - READ_UINT8 (&nr, slice->cabac_init_flag, 1); - if (slice->temporal_mvp_enabled_flag) { - if (GST_H265_IS_B_SLICE (slice)) - READ_UINT8 (&nr, slice->collocated_from_l0_flag, 1); - - if ((slice->collocated_from_l0_flag - && slice->num_ref_idx_l0_active_minus1 > 0) - || (!slice->collocated_from_l0_flag - && slice->num_ref_idx_l1_active_minus1 > 0)) { - - /*fixme: add optimization */ - if ((GST_H265_IS_P_SLICE (slice)) - || ((GST_H265_IS_B_SLICE (slice)) - && (slice->collocated_from_l0_flag))) { - READ_UE_MAX (&nr, slice->collocated_ref_idx, - slice->num_ref_idx_l0_active_minus1); - } else if ((GST_H265_IS_B_SLICE (slice)) - && (!slice->collocated_from_l0_flag)) { - READ_UE_MAX (&nr, slice->collocated_ref_idx, - slice->num_ref_idx_l1_active_minus1); - } - } - } - if ((pps->weighted_pred_flag && GST_H265_IS_P_SLICE (slice)) || - (pps->weighted_bipred_flag && GST_H265_IS_B_SLICE (slice))) - if (!gst_h265_slice_parse_pred_weight_table (slice, &nr)) - goto error; - READ_UE_MAX (&nr, slice->five_minus_max_num_merge_cand, 4); - } - - READ_SE_ALLOWED (&nr, slice->qp_delta, -87, 77); - if (pps->slice_chroma_qp_offsets_present_flag) { - READ_SE_ALLOWED (&nr, slice->cb_qp_offset, -12, 12); - READ_SE_ALLOWED (&nr, slice->cr_qp_offset, -12, 12); - } - - if (pps->deblocking_filter_override_enabled_flag) - READ_UINT8 (&nr, slice->deblocking_filter_override_flag, 1); - if (slice->deblocking_filter_override_flag) { - READ_UINT8 (&nr, slice->deblocking_filter_disabled_flag, 1); - if (!slice->deblocking_filter_disabled_flag) { - READ_SE_ALLOWED (&nr, slice->beta_offset_div2, -6, 6); - READ_SE_ALLOWED (&nr, slice->tc_offset_div2, -6, 6); - } - } - - if (pps->loop_filter_across_slices_enabled_flag && - (slice->sao_luma_flag || slice->sao_chroma_flag || - !slice->deblocking_filter_disabled_flag)) - READ_UINT8 (&nr, slice->loop_filter_across_slices_enabled_flag, 1); - } - - if (pps->tiles_enabled_flag || pps->entropy_coding_sync_enabled_flag) { - guint32 offset_max; - - if (!pps->tiles_enabled_flag && pps->entropy_coding_sync_enabled_flag) - offset_max = pps->PicHeightInCtbsY - 1; - else if (pps->tiles_enabled_flag && !pps->entropy_coding_sync_enabled_flag) - offset_max = - (pps->num_tile_columns_minus1 + 1) * (pps->num_tile_rows_minus1 + 1) - - 1; - else - offset_max = - (pps->num_tile_columns_minus1 + 1) * pps->PicHeightInCtbsY - 1; - - READ_UE_MAX (&nr, slice->num_entry_point_offsets, offset_max); - if (slice->num_entry_point_offsets > 0) { - READ_UE_MAX (&nr, slice->offset_len_minus1, 31); - slice->entry_point_offset_minus1 = - g_new0 (guint32, slice->num_entry_point_offsets); - for (i = 0; i < slice->num_entry_point_offsets; i++) - READ_UINT32 (&nr, slice->entry_point_offset_minus1[i], - (slice->offset_len_minus1 + 1)); - } - } - - if (pps->slice_segment_header_extension_present_flag) { - guint16 slice_segment_header_extension_length; - READ_UE_MAX (&nr, slice_segment_header_extension_length, 256); - for (i = 0; i < slice_segment_header_extension_length; i++) - if (!nal_reader_skip (&nr, 8)) - goto error; - } - - /* Skip the byte alignment bits */ - if (!nal_reader_skip (&nr, 1)) - goto error; - while (!nal_reader_is_byte_aligned (&nr)) { - if (!nal_reader_skip (&nr, 1)) - goto error; - } - - slice->header_size = nal_reader_get_pos (&nr); - slice->n_emulation_prevention_bytes = nal_reader_get_epb_count (&nr); - - return GST_H265_PARSER_OK; - -error: - GST_WARNING ("error parsing \"Slice header\""); - - gst_h265_slice_hdr_free (slice); - - return GST_H265_PARSER_ERROR; -} - -static gboolean -nal_reader_has_more_data_in_payload (NalReader * nr, - guint32 payload_start_pos_bit, guint32 payloadSize) -{ - if (nal_reader_is_byte_aligned (nr) && - (nal_reader_get_pos (nr) == (payload_start_pos_bit + 8 * payloadSize))) - return FALSE; - - return TRUE; -} - -static GstH265ParserResult -gst_h265_parser_parse_sei_message (GstH265Parser * parser, - guint8 nal_type, NalReader * nr, GstH265SEIMessage * sei) -{ - guint32 payloadSize; - guint8 payload_type_byte, payload_size_byte; - guint remaining, payload_size; - guint32 payload_start_pos_bit; - GstH265ParserResult res = GST_H265_PARSER_OK; - - GST_DEBUG ("parsing \"Sei message\""); - - memset (sei, 0, sizeof (*sei)); - - do { - READ_UINT8 (nr, payload_type_byte, 8); - sei->payloadType += payload_type_byte; - } while (payload_type_byte == 0xff); - payloadSize = 0; - do { - READ_UINT8 (nr, payload_size_byte, 8); - payloadSize += payload_size_byte; - } - while (payload_size_byte == 0xff); - - remaining = nal_reader_get_remaining (nr); - payload_size = payloadSize * 8 < remaining ? payloadSize * 8 : remaining; - - payload_start_pos_bit = nal_reader_get_pos (nr); - GST_DEBUG - ("SEI message received: payloadType %u, payloadSize = %u bytes", - sei->payloadType, payload_size); - - if (nal_type == GST_H265_NAL_PREFIX_SEI) { - switch (sei->payloadType) { - case GST_H265_SEI_BUF_PERIOD: - /* size not set; might depend on emulation_prevention_three_byte */ - res = gst_h265_parser_parse_buffering_period (parser, - &sei->payload.buffering_period, nr); - break; - case GST_H265_SEI_PIC_TIMING: - /* size not set; might depend on emulation_prevention_three_byte */ - res = gst_h265_parser_parse_pic_timing (parser, - &sei->payload.pic_timing, nr); - break; - default: - /* Just consume payloadSize bytes, which does not account for - emulation prevention bytes */ - if (!nal_reader_skip_long (nr, payload_size)) - goto error; - res = GST_H265_PARSER_OK; - break; - } - } else if (nal_type == GST_H265_NAL_SUFFIX_SEI) { - switch (sei->payloadType) { - default: - /* Just consume payloadSize bytes, which does not account for - emulation prevention bytes */ - if (!nal_reader_skip_long (nr, payload_size)) - goto error; - res = GST_H265_PARSER_OK; - break; - } - } - - /* Not parsing the reserved_payload_extension, but it shouldn't be - * an issue because of 1: There shall not be any reserved_payload_extension - * present in bitstreams conforming to the specification.2. Even though - * it is present, the size will be less than total PayloadSize since the - * size of reserved_payload_extension is supposed to be - * 8 * payloadSize - nEarlierBits - nPayloadZeroBits -1 which means the - * the current implementation will still skip all unnecessary bits correctly. - * In theory, we can have a more optimized implementation by skipping the - * data left in PayLoadSize without out individually checking for each bits, - * since the totoal size will be always less than payloadSize*/ - if (nal_reader_has_more_data_in_payload (nr, payload_start_pos_bit, - payloadSize)) { - /* Skip the byte alignment bits */ - if (!nal_reader_skip (nr, 1)) - goto error; - while (!nal_reader_is_byte_aligned (nr)) { - if (!nal_reader_skip (nr, 1)) - goto error; - } - } - - return res; - -error: - GST_WARNING ("error parsing \"Sei message\""); - return GST_H265_PARSER_ERROR; -} - -/** - * gst_h265_slice_hdr_copy: - * @dst_slice: The destination #GstH265SliceHdr to copy into - * @src_slice: The source #GstH265SliceHdr to copy from - * - * Copies @src_slice into @dst_slice - * - * Returns: %TRUE if everything went fine, %FALSE otherwise - */ -gboolean -gst_h265_slice_hdr_copy (GstH265SliceHdr * dst_slice, - const GstH265SliceHdr * src_slice) -{ - guint i; - - g_return_val_if_fail (dst_slice != NULL, FALSE); - g_return_val_if_fail (src_slice != NULL, FALSE); - - gst_h265_slice_hdr_free (dst_slice); - - *dst_slice = *src_slice; - - if (dst_slice->num_entry_point_offsets > 0) { - dst_slice->entry_point_offset_minus1 = - g_new0 (guint32, dst_slice->num_entry_point_offsets); - for (i = 0; i < dst_slice->num_entry_point_offsets; i++) - dst_slice->entry_point_offset_minus1[i] = - src_slice->entry_point_offset_minus1[i]; - } - - return TRUE; -} - -/** - * gst_h265_slice_hdr_free: - * slice_hdr: The #GstH265SliceHdr to free - * - * Frees @slice_hdr fields. - */ -void -gst_h265_slice_hdr_free (GstH265SliceHdr * slice_hdr) -{ - g_return_if_fail (slice_hdr != NULL); - - if (slice_hdr->num_entry_point_offsets > 0) - g_free (slice_hdr->entry_point_offset_minus1); - slice_hdr->entry_point_offset_minus1 = 0; -} - -/** - * gst_h265_sei_copy: - * @dst_sei: The destination #GstH265SEIMessage to copy into - * @src_sei: The source #GstH265SEIMessage to copy from - * - * Copies @src_sei into @dst_sei - * - * Returns: %TRUE if everything went fine, %FALSE otherwise - */ -gboolean -gst_h265_sei_copy (GstH265SEIMessage * dst_sei, - const GstH265SEIMessage * src_sei) -{ - guint i; - - g_return_val_if_fail (dst_sei != NULL, FALSE); - g_return_val_if_fail (src_sei != NULL, FALSE); - - gst_h265_sei_free (dst_sei); - - *dst_sei = *src_sei; - - if (dst_sei->payloadType == GST_H265_SEI_PIC_TIMING) { - GstH265PicTiming *dst_pic_timing = &dst_sei->payload.pic_timing; - const GstH265PicTiming *src_pic_timing = &src_sei->payload.pic_timing; - - if (dst_pic_timing->num_decoding_units_minus1 > 0) { - dst_pic_timing->num_nalus_in_du_minus1 = - g_new0 (guint32, (dst_pic_timing->num_decoding_units_minus1 + 1)); - dst_pic_timing->du_cpb_removal_delay_increment_minus1 = - g_new0 (guint8, (dst_pic_timing->num_decoding_units_minus1 + 1)); - - for (i = 0; i <= dst_pic_timing->num_decoding_units_minus1; i++) { - dst_pic_timing->num_nalus_in_du_minus1[i] = - src_pic_timing->num_nalus_in_du_minus1[i]; - dst_pic_timing->du_cpb_removal_delay_increment_minus1[i] = - src_pic_timing->du_cpb_removal_delay_increment_minus1[i]; - } - } - } - - return TRUE; -} - -/** - * gst_h265_sei_free: - * sei: The #GstH265SEIMessage to free - * - * Frees @sei fields. - */ -void -gst_h265_sei_free (GstH265SEIMessage * sei) -{ - g_return_if_fail (sei != NULL); - - if (sei->payloadType == GST_H265_SEI_PIC_TIMING) { - GstH265PicTiming *pic_timing = &sei->payload.pic_timing; - if (pic_timing->num_decoding_units_minus1 > 0) { - g_free (pic_timing->num_nalus_in_du_minus1); - g_free (pic_timing->du_cpb_removal_delay_increment_minus1); - } - pic_timing->num_nalus_in_du_minus1 = 0; - pic_timing->du_cpb_removal_delay_increment_minus1 = 0; - } -} - -/** - * gst_h265_parser_parse_sei: - * @nalparser: a #GstH265Parser - * @nalu: The #GST_H265_NAL_SEI #GstH265NalUnit to parse - * @messages: The GArray of #GstH265SEIMessage to fill. The caller must free it when done. - * - * Parses @data, create and fills the @messages array. - * - * Returns: a #GstH265ParserResult - */ -GstH265ParserResult -gst_h265_parser_parse_sei (GstH265Parser * nalparser, GstH265NalUnit * nalu, - GArray ** messages) -{ - NalReader nr; - GstH265SEIMessage sei; - GstH265ParserResult res; - - GST_DEBUG ("parsing SEI nal"); - nal_reader_init (&nr, nalu->data + nalu->offset + nalu->header_bytes, - nalu->size - nalu->header_bytes); - *messages = g_array_new (FALSE, FALSE, sizeof (GstH265SEIMessage)); - g_array_set_clear_func (*messages, (GDestroyNotify) gst_h265_sei_free); - - do { - res = gst_h265_parser_parse_sei_message (nalparser, nalu->type, &nr, &sei); - if (res == GST_H265_PARSER_OK) - g_array_append_val (*messages, sei); - else - break; - } while (nal_reader_has_more_data (&nr)); - - return res; -} - - -/** - * gst_h265_quant_matrix_4x4_get_zigzag_from_raster: - * @out_quant: (out): The resulting quantization matrix - * @quant: The source quantization matrix - * - * Converts quantization matrix @quant from raster scan order to - * zigzag scan order and store the resulting factors into @out_quant. - * - * Note: it is an error to pass the same table in both @quant and - * @out_quant arguments. - * - * Since: 1.6 - */ -void -gst_h265_quant_matrix_4x4_get_zigzag_from_raster (guint8 out_quant[16], - const guint8 quant[16]) -{ - guint i; - - g_return_if_fail (out_quant != quant); - - for (i = 0; i < 16; i++) - out_quant[i] = quant[zigzag_4x4[i]]; -} - -/** - * gst_h265_quant_matrix_4x4_get_raster_from_zigzag: - * @out_quant: (out): The resulting quantization matrix - * @quant: The source quantization matrix - * - * Converts quantization matrix @quant from zigzag scan order to - * raster scan order and store the resulting factors into @out_quant. - * - * Note: it is an error to pass the same table in both @quant and - * @out_quant arguments. - * - * Since: 1.6 - */ -void -gst_h265_quant_matrix_4x4_get_raster_from_zigzag (guint8 out_quant[16], - const guint8 quant[16]) -{ - guint i; - - g_return_if_fail (out_quant != quant); - - for (i = 0; i < 16; i++) - out_quant[zigzag_4x4[i]] = quant[i]; -} - -/** - * gst_h265_quant_matrix_8x8_get_zigzag_from_raster: - * @out_quant: (out): The resulting quantization matrix - * @quant: The source quantization matrix - * - * Converts quantization matrix @quant from raster scan order to - * zigzag scan order and store the resulting factors into @out_quant. - * - * Note: it is an error to pass the same table in both @quant and - * @out_quant arguments. - * - * Since: 1.6 - */ -void -gst_h265_quant_matrix_8x8_get_zigzag_from_raster (guint8 out_quant[64], - const guint8 quant[64]) -{ - guint i; - - g_return_if_fail (out_quant != quant); - - for (i = 0; i < 64; i++) - out_quant[i] = quant[zigzag_8x8[i]]; -} - -/** - * gst_h265_quant_matrix_8x8_get_raster_from_zigzag: - * @out_quant: (out): The resulting quantization matrix - * @quant: The source quantization matrix - * - * Converts quantization matrix @quant from zigzag scan order to - * raster scan order and store the resulting factors into @out_quant. - * - * Note: it is an error to pass the same table in both @quant and - * @out_quant arguments. - * - * Since: 1.6 - */ -void -gst_h265_quant_matrix_8x8_get_raster_from_zigzag (guint8 out_quant[64], - const guint8 quant[64]) -{ - guint i; - - g_return_if_fail (out_quant != quant); - - for (i = 0; i < 64; i++) - out_quant[zigzag_8x8[i]] = quant[i]; -} - -/** - * gst_h265_quant_matrix_4x4_get_uprightdiagonal_from_raster: - * @out_quant: (out): The resulting quantization matrix - * @quant: The source quantization matrix - * - * Converts quantization matrix @quant from raster scan order to - * uprightdiagonal scan order and store the resulting factors - * into @out_quant. - * - * Note: it is an error to pass the same table in both @quant and - * @out_quant arguments. - * - * Since: 1.6 - */ -void -gst_h265_quant_matrix_4x4_get_uprightdiagonal_from_raster (guint8 out_quant[16], - const guint8 quant[16]) -{ - guint i; - - g_return_if_fail (out_quant != quant); - - for (i = 0; i < 16; i++) - out_quant[i] = quant[uprightdiagonal_4x4[i]]; -} - -/** - * gst_h265_quant_matrix_4x4_get_raster_from_uprightdiagonal: - * @out_quant: (out): The resulting quantization matrix - * @quant: The source quantization matrix - * - * Converts quantization matrix @quant from uprightdiagonal scan order to - * raster scan order and store the resulting factors into @out_quant. - * - * Note: it is an error to pass the same table in both @quant and - * @out_quant arguments. - * - * Since: 1.6 - */ -void -gst_h265_quant_matrix_4x4_get_raster_from_uprightdiagonal (guint8 out_quant[16], - const guint8 quant[16]) -{ - guint i; - - g_return_if_fail (out_quant != quant); - - for (i = 0; i < 16; i++) - out_quant[uprightdiagonal_4x4[i]] = quant[i]; -} - -/** - * gst_h265_quant_matrix_8x8_get_uprightdiagonal_from_raster: - * @out_quant: (out): The resulting quantization matrix - * @quant: The source quantization matrix - * - * Converts quantization matrix @quant from raster scan order to - * uprightdiagonal scan order and store the resulting factors - * into @out_quant. - * - * Note: it is an error to pass the same table in both @quant and - * @out_quant arguments. - * - * Since: 1.6 - */ -void -gst_h265_quant_matrix_8x8_get_uprightdiagonal_from_raster (guint8 out_quant[64], - const guint8 quant[64]) -{ - guint i; - - g_return_if_fail (out_quant != quant); - - for (i = 0; i < 64; i++) - out_quant[i] = quant[uprightdiagonal_8x8[i]]; -} - -/** - * gst_h265_quant_matrix_8x8_get_raster_from_uprightdiagonal: - * @out_quant: (out): The resulting quantization matrix - * @quant: The source quantization matrix - * - * Converts quantization matrix @quant from uprightdiagonal scan order to - * raster scan order and store the resulting factors into @out_quant. - * - * Note: it is an error to pass the same table in both @quant and - * @out_quant arguments. - * - * Since: 1.6 - */ -void -gst_h265_quant_matrix_8x8_get_raster_from_uprightdiagonal (guint8 out_quant[64], - const guint8 quant[64]) -{ - guint i; - - g_return_if_fail (out_quant != quant); - - for (i = 0; i < 64; i++) - out_quant[uprightdiagonal_8x8[i]] = quant[i]; -} diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gsth265parser.h gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gsth265parser.h --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gsth265parser.h 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gsth265parser.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,1112 +0,0 @@ -/* Gstreamer H.265 bitstream parser - * Copyright (C) 2013 Intel Corporation - * Copyright (C) 2013 Sreerenj Balachandran - * - * Contact: Sreerenj Balachandran - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef __GST_H265_PARSER_H__ -#define __GST_H265_PARSER_H__ - -#ifndef GST_USE_UNSTABLE_API -#warning "The H.265 parsing library is unstable API and may change in future." -#warning "You can define GST_USE_UNSTABLE_API to avoid this warning." -#endif - -#include - -G_BEGIN_DECLS - -#define GST_H265_MAX_SUB_LAYERS 8 -#define GST_H265_MAX_VPS_COUNT 16 -#define GST_H265_MAX_SPS_COUNT 16 -#define GST_H265_MAX_PPS_COUNT 64 - -#define GST_H265_IS_B_SLICE(slice) ((slice)->type == GST_H265_B_SLICE) -#define GST_H265_IS_P_SLICE(slice) ((slice)->type == GST_H265_P_SLICE) -#define GST_H265_IS_I_SLICE(slice) ((slice)->type == GST_H265_I_SLICE) - -/** - * GstH265Profile: - * @GST_H265_PROFILE_MAIN: Main profile (A.3.2) - * @GST_H265_PROFILE_MAIN_10: Main 10 profile (A.3.3) - * @GST_H265_PROFILE_MAIN_STILL_PICTURE: Main Still Picture profile (A.3.4) - * - * H.265 Profiles. - * - */ -typedef enum { - GST_H265_PROFILE_MAIN = 1, - GST_H265_PROFILE_MAIN_10 = 2, - GST_H265_PROFILE_MAIN_STILL_PICTURE = 3 -} GstH265Profile; - -/** - * GstH265NalUnitType: - * @GST_H265_NAL_SLICE_TRAIL_N: Slice nal of a non-TSA, non-STSA trailing picture - * @GST_H265_NAL_SLICE_TRAIL_R: Slice nal of a non-TSA, non-STSA trailing picture - * @GST_H265_NAL_SLICE_TSA_N: Slice nal of a TSA picture - * @GST_H265_NAL_SLICE_TSA_R: Slice nal of a TSA picture - * @GST_H265_NAL_SLICE_STSA_N: Slice nal of a STSA picture - * @GST_H265_NAL_SLICE_STSA_R: Slice nal of a STSA picture - * @GST_H265_NAL_SLICE_RADL_N: Slice nal of a RADL picture - * @GST_H265_NAL_SLICE_RADL_R: Slice nal of a RADL piicture - * @GST_H265_NAL_SLICE_RASL_N: Slice nal of a RASL picture - * @GST_H265_NAL_SLICE_RASL_R: Slice nal of a RASL picture - * @GST_H265_NAL_SLICE_BLA_W_LP: Slice nal of a BLA picture - * @GST_H265_NAL_SLICE_BLA_W_RADL: Slice nal of a BLA picture - * @GST_H265_NAL_SLICE_BLA_N_LP: Slice nal of a BLA picture - * @GST_H265_NAL_SLICE_IDR_W_RADL: Slice nal of an IDR picture - * @GST_H265_NAL_SLICE_IDR_N_LP: Slice nal of an IDR picture - * @GST_H265_NAL_SLICE_CRA_NUT: Slice nal of a CRA picture - * @GST_H265_NAL_VPS: Video parameter set(VPS) nal unit - * @GST_H265_NAL_SPS: Sequence parameter set (SPS) nal unit - * @GST_H265_NAL_PPS: Picture parameter set (PPS) nal unit - * @GST_H265_NAL_AUD: Access unit (AU) delimiter nal unit - * @GST_H265_NAL_EOS: End of sequence (EOS) nal unit - * @GST_H265_NAL_EOB: End of bitstream (EOB) nal unit - * @GST_H265_NAL_FD: Filler data (FD) nal lunit - * @GST_H265_NAL_PREFIX_SEI: Supplemental enhancement information prefix nal unit - * @GST_H265_NAL_SUFFIX_SEI: Suppliemental enhancement information suffix nal unit - * - * Indicates the type of H265 Nal Units - */ -typedef enum -{ - GST_H265_NAL_SLICE_TRAIL_N = 0, - GST_H265_NAL_SLICE_TRAIL_R = 1, - GST_H265_NAL_SLICE_TSA_N = 2, - GST_H265_NAL_SLICE_TSA_R = 3, - GST_H265_NAL_SLICE_STSA_N = 4, - GST_H265_NAL_SLICE_STSA_R = 5, - GST_H265_NAL_SLICE_RADL_N = 6, - GST_H265_NAL_SLICE_RADL_R = 7, - GST_H265_NAL_SLICE_RASL_N = 8, - GST_H265_NAL_SLICE_RASL_R = 9, - GST_H265_NAL_SLICE_BLA_W_LP = 16, - GST_H265_NAL_SLICE_BLA_W_RADL = 17, - GST_H265_NAL_SLICE_BLA_N_LP = 18, - GST_H265_NAL_SLICE_IDR_W_RADL = 19, - GST_H265_NAL_SLICE_IDR_N_LP = 20, - GST_H265_NAL_SLICE_CRA_NUT = 21, - GST_H265_NAL_VPS = 32, - GST_H265_NAL_SPS = 33, - GST_H265_NAL_PPS = 34, - GST_H265_NAL_AUD = 35, - GST_H265_NAL_EOS = 36, - GST_H265_NAL_EOB = 37, - GST_H265_NAL_FD = 38, - GST_H265_NAL_PREFIX_SEI = 39, - GST_H265_NAL_SUFFIX_SEI = 40 -} GstH265NalUnitType; - -#define RESERVED_NON_IRAP_SUBLAYER_NAL_TYPE_MIN 10 -#define RESERVED_NON_IRAP_SUBLAYER_NAL_TYPE_MAX 15 - -#define RESERVED_IRAP_NAL_TYPE_MIN 22 -#define RESERVED_IRAP_NAL_TYPE_MAX 23 - -#define RESERVED_NON_IRAP_NAL_TYPE_MIN 24 -#define RESERVED_NON_IRAP_NAL_TYPE_MAX 31 - -#define RESERVED_NON_VCL_NAL_TYPE_MIN 41 -#define RESERVED_NON_VCL_NAL_TYPE_MAX 47 - -#define UNSPECIFIED_NON_VCL_NAL_TYPE_MIN 48 -#define UNSPECIFIED_NON_VCL_NAL_TYPE_MAX 63 - -/** - * GstH265ParserResult: - * @GST_H265_PARSER_OK: The parsing succeded - * @GST_H265_PARSER_BROKEN_DATA: The data to parse is broken - * @GST_H265_PARSER_BROKEN_LINK: The link to structure needed for the parsing couldn't be found - * @GST_H265_PARSER_ERROR: An error accured when parsing - * @GST_H265_PARSER_NO_NAL: No nal found during the parsing - * @GST_H265_PARSER_NO_NAL_END: Start of the nal found, but not the end. - * - * The result of parsing H265 data. - */ -typedef enum -{ - GST_H265_PARSER_OK, - GST_H265_PARSER_BROKEN_DATA, - GST_H265_PARSER_BROKEN_LINK, - GST_H265_PARSER_ERROR, - GST_H265_PARSER_NO_NAL, - GST_H265_PARSER_NO_NAL_END -} GstH265ParserResult; - -/** - * GstH265SEIPayloadType: - * @GST_H265_SEI_BUF_PERIOD: Buffering Period SEI Message - * @GST_H265_SEI_PIC_TIMING: Picture Timing SEI Message - * ... - * - * The type of SEI message. - */ -typedef enum -{ - GST_H265_SEI_BUF_PERIOD = 0, - GST_H265_SEI_PIC_TIMING = 1 - /* and more... */ -} GstH265SEIPayloadType; - -/** - * GstH265SEIPicStructType: - * @GST_H265_SEI_PIC_STRUCT_FRAME: Picture is a frame - * @GST_H265_SEI_PIC_STRUCT_TOP_FIELD: Top field of frame - * @GST_H265_SEI_PIC_STRUCT_BOTTOM_FIELD: Botom field of frame - * @GST_H265_SEI_PIC_STRUCT_TOP_BOTTOM: Top bottom field of frame - * @GST_H265_SEI_PIC_STRUCT_BOTTOM_TOP: bottom top field of frame - * @GST_H265_SEI_PIC_STRUCT_TOP_BOTTOM_TOP: top bottom top field of frame - * @GST_H265_SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM: bottom top bottom field of frame - * @GST_H265_SEI_PIC_STRUCT_FRAME_DOUBLING: indicates that the frame should - * be displayed two times consecutively - * @GST_H265_SEI_PIC_STRUCT_FRAME_TRIPLING: indicates that the frame should be - * displayed three times consecutively - * @GST_H265_SEI_PIC_STRUCT_TOP_PAIRED_PREVIOUS_BOTTOM: top field paired with - * previous bottom field in output order - * @GST_H265_SEI_PIC_STRUCT_BOTTOM_PAIRED_PREVIOUS_TOP: bottom field paried with - * previous top field in output order - * @GST_H265_SEI_PIC_STRUCT_TOP_PAIRED_NEXT_BOTTOM: top field paired with next - * bottom field in output order - * @GST_H265_SEI_PIC_STRUCT_BOTTOM_PAIRED_NEXT_TOP: bottom field paired with - * next top field in output order - * - * SEI pic_struct type - */ -typedef enum -{ - GST_H265_SEI_PIC_STRUCT_FRAME = 0, - GST_H265_SEI_PIC_STRUCT_TOP_FIELD = 1, - GST_H265_SEI_PIC_STRUCT_BOTTOM_FIELD = 2, - GST_H265_SEI_PIC_STRUCT_TOP_BOTTOM = 3, - GST_H265_SEI_PIC_STRUCT_BOTTOM_TOP = 4, - GST_H265_SEI_PIC_STRUCT_TOP_BOTTOM_TOP = 5, - GST_H265_SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM = 6, - GST_H265_SEI_PIC_STRUCT_FRAME_DOUBLING = 7, - GST_H265_SEI_PIC_STRUCT_FRAME_TRIPLING = 8, - GST_H265_SEI_PIC_STRUCT_TOP_PAIRED_PREVIOUS_BOTTOM = 9, - GST_H265_SEI_PIC_STRUCT_BOTTOM_PAIRED_PREVIOUS_TOP = 10, - GST_H265_SEI_PIC_STRUCT_TOP_PAIRED_NEXT_BOTTOM = 11, - GST_H265_SEI_PIC_STRUCT_BOTTOM_PAIRED_NEXT_TOP = 12 -} GstH265SEIPicStructType; - -/** - * GstH265SliceType: - * - * Type of Picture slice - */ - -typedef enum -{ - GST_H265_B_SLICE = 0, - GST_H265_P_SLICE = 1, - GST_H265_I_SLICE = 2 -} GstH265SliceType; - -typedef enum -{ - GST_H265_QUANT_MATIX_4X4 = 0, - GST_H265_QUANT_MATIX_8X8 = 1, - GST_H265_QUANT_MATIX_16X16 = 2, - GST_H265_QUANT_MATIX_32X32 = 3 -} GstH265QuantMatrixSize; - -typedef struct _GstH265Parser GstH265Parser; - -typedef struct _GstH265NalUnit GstH265NalUnit; - -typedef struct _GstH265VPS GstH265VPS; -typedef struct _GstH265SPS GstH265SPS; -typedef struct _GstH265PPS GstH265PPS; -typedef struct _GstH265ProfileTierLevel GstH265ProfileTierLevel; -typedef struct _GstH265SubLayerHRDParams GstH265SubLayerHRDParams; -typedef struct _GstH265HRDParams GstH265HRDParams; -typedef struct _GstH265VUIParams GstH265VUIParams; - -typedef struct _GstH265ScalingList GstH265ScalingList; -typedef struct _GstH265RefPicListModification GstH265RefPicListModification; -typedef struct _GstH265PredWeightTable GstH265PredWeightTable; -typedef struct _GstH265ShortTermRefPicSet GstH265ShortTermRefPicSet; -typedef struct _GstH265SliceHdr GstH265SliceHdr; - -typedef struct _GstH265PicTiming GstH265PicTiming; -typedef struct _GstH265BufferingPeriod GstH265BufferingPeriod; -typedef struct _GstH265SEIMessage GstH265SEIMessage; - -/** - * GstH265NalUnit: - * @type: A #GstH265NalUnitType - * @layer_id: A nal unit layer id - * @temporal_id_plus1: A nal unit temporal identifier - * @size: The size of the nal unit starting from @offset - * @offset: The offset of the actual start of the nal unit - * @sc_offset:The offset of the start code of the nal unit - * @valid: If the nal unit is valid, which mean it has - * already been parsed - * @data: The data from which the Nalu has been parsed - * - * Structure defining the Nal unit headers - */ -struct _GstH265NalUnit -{ - guint8 type; - guint8 layer_id; - guint8 temporal_id_plus1; - - /* calculated values */ - guint size; - guint offset; - guint sc_offset; - gboolean valid; - - guint8 *data; - guint8 header_bytes; -}; - -/** - * GstH265ProfileTierLevel: - * @profile_space: specifies the context for the interpretation of - * general_profile_idc and general_profile_combatibility_flag - * @tier_flag: the tier context for the interpretation of general_level_idc - * @profile_idc: profile id - * @profile_compatibility_flag: compatibility flags - * @progressive_source_flag: flag to indicate the type of stream - * @interlaced_source_flag: flag to indicate the type of stream - * @non_packed_constraint_flag: indicate the presence of frame packing - * arragement sei message - * @frame_only_constraint_flag: recognize the field_seq_flag - * @level idc: indicate the level which the CVS confirms - * @sub_layer_profile_present_flag: sublayer profile presence ind - * @sub_layer_level_present_flag:sublayer level presence indicator. - * @sub_layer_profile_space: profile space for sublayers - * @sub_layer_tier_flag: tier flags for sublayers. - * @sub_layer_profile_idc: conformant profile indicator for sublayers. - * @sub_layer_profile_compatibility_flag[6][32]: compatibility flags for sublayers - * @sub_layer_progressive_source_flag:progressive stream indicator for sublayer - * @sub_layer_interlaced_source_flag: interlaced stream indicator for sublayer - * @sub_layer_non_packed_constraint_flag: indicate the presence of - * frame packing arrangement sei message with in sublayers - * @sub_layer_frame_only_constraint_flag:recognize the sublayer - * specific field_seq_flag - * @sub_layer_level_idc:indicate the sublayer specific level - * - * Define ProfileTierLevel parameters - */ -struct _GstH265ProfileTierLevel { - guint8 profile_space; - guint8 tier_flag; - guint8 profile_idc; - - guint8 profile_compatibility_flag[32]; - - guint8 progressive_source_flag; - guint8 interlaced_source_flag; - guint8 non_packed_constraint_flag; - guint8 frame_only_constraint_flag; - guint8 level_idc; - - guint8 sub_layer_profile_present_flag[6]; - guint8 sub_layer_level_present_flag[6]; - - guint8 sub_layer_profile_space[6]; - guint8 sub_layer_tier_flag[6]; - guint8 sub_layer_profile_idc[6]; - guint8 sub_layer_profile_compatibility_flag[6][32]; - guint8 sub_layer_progressive_source_flag[6]; - guint8 sub_layer_interlaced_source_flag[6]; - guint8 sub_layer_non_packed_constraint_flag[6]; - guint8 sub_layer_frame_only_constraint_flag[6]; - guint8 sub_layer_level_idc[6]; -}; - -/** - * GstH265SubLayerHRDParams: - * @bit_rate_value_minus1:togeter with bit_rate_scale, it specifies - * the maximum input bitrate when the CPB operates at the access - * unit level - * @cpb_size_value_minus1: is used together with cpb_size_scale to - * specify the CPB size when the CPB operates at the access unit - * level - * @cpb_size_du_value_minus1: is used together with cpb_size_du_scale - * to specify the CPB size when the CPB operates at sub-picture - * level - * @bit_rate_du_value_minus1: together with bit_rate_scale, it - * specifies the maximum input bit rate when the CPB operates at the - * sub-picture level - * @cbr_flag: indicate whether HSS operates in intermittent bit rate - * mode or constant bit rate mode. - * - * Defines the Sublayer HRD parameters - */ -struct _GstH265SubLayerHRDParams -{ - guint32 bit_rate_value_minus1[32]; - guint32 cpb_size_value_minus1[32]; - - guint32 cpb_size_du_value_minus1[32]; - guint32 bit_rate_du_value_minus1[32]; - - guint8 cbr_flag[32]; -}; - -/** - * GstH265HRDParams: - * @nal_hrd_parameters_present_flag: indicate the presence of NAL HRD parameters - * @vcl_hrd_parameters_present_flag: indicate the presence of VCL HRD parameters - * @sub_pic_hrd_params_present_flag: indicate the presence of sub_pic_hrd_params - * @tick_divisor_minus2: is used to specify the clock sub-tick - * @du_cpb_removal_delay_increment_length_minus1: specifies the length, - * in bits, of the nal_initial_cpb_removal_delay - * @sub_pic_cpb_params_in_pic_timing_sei_flag: specifies the length, in bits, of - * the cpb_delay_offset and the au_cpb_removal_delay_minus1 syntax elements. - * @dpb_output_delay_du_length_minu1: specifies the length, in bits, of the - * dpb_delay_offset and the pic_dpb_output_delay syntax elements - * @bit_rate_scale: maximum input bitrate - * @cpb_size_scale: CPB size when operates in access unit level - * @cpb_size_du_scale: CPB size when operates in sub-picture level - * @initial_cpb_removal_delay_length_minus1: specifies the length, in bits, of the - * nal_initial_cpb_removal_delay, nal_initial_cpb_removal_offset, - * vcl_initial_cpb_removal_delay and vcl_initial_cpb_removal_offset. - * @au_cpb_removal_delay_length_minus1: specifies the length, in bits, of the - * cpb_delay_offset and the au_cpb_removal_delay_minus1 syntax elements - * @dpb_output_delay_length_minus1: specifies the length, in bits, of the - * dpb_delay_offset and the pic_dpb_output_delay syntax elements - * @fixed_pic_rate_general_flag: flag to indicate the presence of constraint - * on the temporal distance between the HRD output times of consecutive - * pictures in output order - * @fixed_pic_rate_within_cvs_flag: same as fixed_pic_rate_general_flag - * @elemental_duration_in_tc_minus1: temporal distance in clock ticks - * @low_delay_hrd_flag: specifies the HRD operational mode - * @cpb_cnt_minus1:specifies the number of alternative CPS specifications. - * @sublayer_hrd_params: Sublayer HRD parameters. - * - * Defines the HRD parameters - */ -struct _GstH265HRDParams -{ - guint8 nal_hrd_parameters_present_flag; - guint8 vcl_hrd_parameters_present_flag; - guint8 sub_pic_hrd_params_present_flag; - - guint8 tick_divisor_minus2; - guint8 du_cpb_removal_delay_increment_length_minus1; - guint8 sub_pic_cpb_params_in_pic_timing_sei_flag; - guint8 dpb_output_delay_du_length_minus1; - - guint8 bit_rate_scale; - guint8 cpb_size_scale; - guint8 cpb_size_du_scale; - - guint8 initial_cpb_removal_delay_length_minus1; - guint8 au_cpb_removal_delay_length_minus1; - guint8 dpb_output_delay_length_minus1; - - guint8 fixed_pic_rate_general_flag [7]; - guint8 fixed_pic_rate_within_cvs_flag [7]; - guint16 elemental_duration_in_tc_minus1 [7]; - guint8 low_delay_hrd_flag [7]; - guint8 cpb_cnt_minus1[7]; - - GstH265SubLayerHRDParams sublayer_hrd_params[7]; -}; - -/** - * GstH265VPS: - * @id: vps id - * @max_layers_minus1: should be zero, but can be other values in future - * @max_sub_layers_minus1:specifies the maximum number of temporal sub-layers - * @temporal_id_nesting_flag: specifies whether inter prediction is - * additionally restricted - * @profile_tier_level: ProfileTierLevel info - * @sub_layer_ordering_info_present_flag: indicates the presense of - * vps_max_dec_pic_buffering_minus1, vps_max_num_reorder_pics and - * vps_max_latency_increase_plus1 - * @max_dec_pic_buffering_minus1: specifies the maximum required size - * of the decoded picture buffer - * @max_num_reorder_pics: indicates the maximum allowed number of - * pictures that can precede any picture in the CVS in decoding - * order - * @max_latency_increase_plus1: is used to compute the value of - * VpsMaxLatencyPictures - * @max_layer_id: specifies the maximum allowed value of nuh_layer_id - * @num_layer_sets_minus1: specifies the number of layer sets - * @layer_id_included_flag: specifies whether a nuh_layer_id included - * in the layer identifier list - * @timing_info_present_flag: indicate the presence of - * num_units_in_tick, time_scale, poc_proportional_to_timing_flag - * and num_hrd_parameters - * @num_units_in_tick: number of time units in a tick - * @time_scale: number of time units that pass in one second - * @poc_proportional_to_timing_flag: indicate whether the picture - * order count is proportional to output timin - * @num_ticks_poc_diff_one_minus1: specifies the number of clock ticks - * corresponding to a difference of picture order count values equal - * to 1 - * @num_hrd_parameters: number of hrd_parameters present - * @hrd_layer_set_idx: index to the list of layer hrd params. - * @hrd_params: the GstH265HRDParams list - * - * Defines the VPS parameters - */ -struct _GstH265VPS { - guint8 id; - - guint8 max_layers_minus1; - guint8 max_sub_layers_minus1; - guint8 temporal_id_nesting_flag; - - GstH265ProfileTierLevel profile_tier_level; - - guint8 sub_layer_ordering_info_present_flag; - guint8 max_dec_pic_buffering_minus1[GST_H265_MAX_SUB_LAYERS]; - guint8 max_num_reorder_pics[GST_H265_MAX_SUB_LAYERS]; - guint32 max_latency_increase_plus1[GST_H265_MAX_SUB_LAYERS]; - - guint8 max_layer_id; - guint16 num_layer_sets_minus1; - - guint8 timing_info_present_flag; - guint32 num_units_in_tick; - guint32 time_scale; - guint8 poc_proportional_to_timing_flag; - guint32 num_ticks_poc_diff_one_minus1; - - guint16 num_hrd_parameters; - guint16 hrd_layer_set_idx; - guint8 cprms_present_flag; - - GstH265HRDParams hrd_params; - - guint8 vps_extension; - - gboolean valid; -}; -/** - * GstH265ShortTermRefPicSet: - * @inter_ref_pic_set_prediction_flag: %TRUE specifies that the stRpsIdx-th candidate - * short-term RPS is predicted from another candidate short-term RPS - * @delta_idx_minus1: plus 1 specifies the difference between the value of source and - * candidate short term RPS. - * @delta_rps_sign: delta_rps_sign and abs_delta_rps_minus1 together specify - * the value of the variable deltaRps. - * @abs_delta_rps_minus1: delta_rps_sign and abs_delta_rps_minus1 together specify - * the value of the variable deltaRps - * - * Defines the #GstH265ShortTermRefPicSet params - */ -struct _GstH265ShortTermRefPicSet -{ - guint8 inter_ref_pic_set_prediction_flag; - guint8 delta_idx_minus1; - guint8 delta_rps_sign; - guint16 abs_delta_rps_minus1; - - /* calculated values */ - guint8 NumDeltaPocs; - guint8 NumNegativePics; - guint8 NumPositivePics; - guint8 UsedByCurrPicS0[16]; - guint8 UsedByCurrPicS1[16]; - gint32 DeltaPocS0[16]; - gint32 DeltaPocS1[16]; -}; - -/** - * GstH265VUIParams: - * @aspect_ratio_info_present_flag: %TRUE specifies that aspect_ratio_idc is present. - * %FALSE specifies that aspect_ratio_idc is not present - * @aspect_ratio_idc specifies the value of the sample aspect ratio of the luma samples - * @sar_width indicates the horizontal size of the sample aspect ratio - * @sar_height indicates the vertical size of the sample aspect ratio - * @overscan_info_present_flag: %TRUE overscan_appropriate_flag is present %FALSE otherwize - * @overscan_appropriate_flag: %TRUE indicates that the cropped decoded pictures - * output are suitable for display using overscan. %FALSE the cropped decoded pictures - * output contain visually important information - * @video_signal_type_present_flag: %TRUE specifies that video_format, video_full_range_flag and - * colour_description_present_flag are present. - * @video_format: indicates the representation of the picture - * @video_full_range_flag: indicates the black level and range of the luma and chroma signals - * @colour_description_present_flag: %TRUE specifies that colour_primaries, - * transfer_characteristics and matrix_coefficients are present - * @colour_primaries: indicates the chromaticity coordinates of the source primaries - * @transfer_characteristics: indicates the opto-electronic transfer characteristic - * @matrix_coefficients: describes the matrix coefficients used in deriving luma and chroma signals - * @chroma_loc_info_present_flag: %TRUE specifies that chroma_sample_loc_type_top_field and - * chroma_sample_loc_type_bottom_field are present, %FALSE otherwize - * @chroma_sample_loc_type_top_field: specify the location of chroma for top field - * @chroma_sample_loc_type_bottom_field specify the location of chroma for bottom field - * @neutral_chroma_indication_flag: %TRUE indicate that the value of chroma samples is equla - * to 1<<(BitDepthchrom-1). - * @field_seq_flag: %TRUE indicate field and %FALSE indicate frame - * @frame_field_info_present_flag: %TRUE indicate picture timing SEI messages are present for every - * picture and include the pic_struct, source_scan_type, and duplicate_flag syntax elements. - * @default_display_window_flag: %TRUE indicate that the default display window parameters present - * def_disp_win_left_offset:left offset of display rect - * def_disp_win_right_offset: right offset of display rect - * def_disp_win_top_offset: top offset of display rect - * def_disp_win_bottom_offset: bottom offset of display rect - * @timing_info_present_flag: %TRUE specifies that num_units_in_tick, - * time_scale and fixed_frame_rate_flag are present in the bitstream - * @num_units_in_tick: is the number of time units of a clock operating at the frequency time_scale Hz - * @time_scale: is the number of time units that pass in one second - * @poc_proportional_to_timing_flag: %TRUE indicates that the picture order count value for each picture - * in the CVS that is not the first picture in the CVS, in decoding order, is proportional to the output - * time of the picture relative to the output time of the first picture in the CVS. - * @num_ticks_poc_diff_one_minus1: plus 1 specifies the number of clock ticks corresponding to a - * difference of picture order count values equal to 1 - * @hrd_parameters_present_flag: %TRUE if hrd parameters present in the bitstream - * @bitstream_restriction_flag: %TRUE specifies that the following coded video sequence bitstream restriction - * parameters are present - * @tiles_fixed_structure_flag: %TRUE indicates that each PPS that is active in the CVS has the same value - * of the syntax elements num_tile_columns_minus1, num_tile_rows_minus1, uniform_spacing_flag, - * column_width_minus1, row_height_minus1 and loop_filter_across_tiles_enabled_flag, when present - * @motion_vectors_over_pic_boundaries_flag: %FALSE indicates that no sample outside the - * picture boundaries and no sample at a fractional sample position, %TRUE indicates that one or more - * samples outside picture boundaries may be used in inter prediction - * @restricted_ref_pic_list_flag: %TRUE indicates that all P and B slices (when present) that belong to - * the same picture have an identical reference picture list 0, and that all B slices (when present) - * that belong to the same picture have an identical reference picture list 1 - * @min_spatial_segmentation_idc: when not equal to 0, establishes a bound on the maximum possible size - * of distinct coded spatial segmentation regions in the pictures of the CVS - * @max_bytes_per_pic_denom: indicates a number of bytes not exceeded by the sum of the sizes of - * the VCL NAL units associated with any coded picture in the coded video sequence. - * @max_bits_per_min_cu_denom: indicates an upper bound for the number of coded bits of coding_unit - * data for any coding block in any picture of the CVS - * @log2_max_mv_length_horizontal: indicate the maximum absolute value of a decoded horizontal - * motion vector component - * @log2_max_mv_length_vertical: indicate the maximum absolute value of a decoded vertical - * motion vector component - * - * The structure representing the VUI parameters. - */ -struct _GstH265VUIParams -{ - guint8 aspect_ratio_info_present_flag; - guint8 aspect_ratio_idc; - /* if aspect_ratio_idc == 255 */ - guint16 sar_width; - guint16 sar_height; - - guint8 overscan_info_present_flag; - /* if overscan_info_present_flag */ - guint8 overscan_appropriate_flag; - - guint8 video_signal_type_present_flag; - guint8 video_format; - guint8 video_full_range_flag; - guint8 colour_description_present_flag; - guint8 colour_primaries; - guint8 transfer_characteristics; - guint8 matrix_coefficients; - - guint8 chroma_loc_info_present_flag; - guint8 chroma_sample_loc_type_top_field; - guint8 chroma_sample_loc_type_bottom_field; - - guint8 neutral_chroma_indication_flag; - guint8 field_seq_flag; - guint8 frame_field_info_present_flag; - guint8 default_display_window_flag; - guint32 def_disp_win_left_offset; - guint32 def_disp_win_right_offset; - guint32 def_disp_win_top_offset; - guint32 def_disp_win_bottom_offset; - - guint8 timing_info_present_flag; - /* if timing_info_present_flag */ - guint32 num_units_in_tick; - guint32 time_scale; - guint8 poc_proportional_to_timing_flag; - /* if poc_proportional_to_timing_flag */ - guint32 num_ticks_poc_diff_one_minus1; - guint8 hrd_parameters_present_flag; - /*if hrd_parameters_present_flat */ - GstH265HRDParams hrd_params; - - guint8 bitstream_restriction_flag; - /* if bitstream_restriction_flag */ - guint8 tiles_fixed_structure_flag; - guint8 motion_vectors_over_pic_boundaries_flag; - guint8 restricted_ref_pic_lists_flag; - guint16 min_spatial_segmentation_idc; - guint8 max_bytes_per_pic_denom; - guint8 max_bits_per_min_cu_denom; - guint8 log2_max_mv_length_horizontal; - guint8 log2_max_mv_length_vertical; - - /* calculated values */ - guint par_n; - guint par_d; -}; - -/** - * GstH265ScalingList: - * @scaling_list_dc_coef_minus8_16x16: this plus 8 specifies the DC - * Coefficient values for 16x16 scaling list - * @scaling_list_dc_coef_minus8_32x32: this plus 8 specifies the DC - * Coefficient values for 32x32 scaling list - * @scaling_lists_4x4: 4x4 scaling list - * @scaling_lists_8x8: 8x8 scaling list - * @scaling_lists_16x16: 16x16 scaling list - * @guint8 scaling_lists_32x32: 32x32 scaling list - * - * Defines the GstH265ScalingList - */ -struct _GstH265ScalingList { - - gint16 scaling_list_dc_coef_minus8_16x16[6]; - gint16 scaling_list_dc_coef_minus8_32x32[2]; - - guint8 scaling_lists_4x4 [6][16]; - guint8 scaling_lists_8x8 [6][64]; - guint8 scaling_lists_16x16 [6][64]; - guint8 scaling_lists_32x32 [2][64]; -}; - -/** - * GstH265SPS: - * @id: The ID of the sequence parameter set - * @profile_idc: indicate the profile to which the coded video sequence conforms - * - * H265 Sequence Parameter Set (SPS) - */ -struct _GstH265SPS -{ - guint8 id; - - GstH265VPS *vps; - - guint8 max_sub_layers_minus1; - guint8 temporal_id_nesting_flag; - - GstH265ProfileTierLevel profile_tier_level; - - guint8 chroma_format_idc; - guint8 separate_colour_plane_flag; - guint16 pic_width_in_luma_samples; - guint16 pic_height_in_luma_samples; - - guint8 conformance_window_flag; - /* if conformance_window_flag */ - guint32 conf_win_left_offset; - guint32 conf_win_right_offset; - guint32 conf_win_top_offset; - guint32 conf_win_bottom_offset; - - guint8 bit_depth_luma_minus8; - guint8 bit_depth_chroma_minus8; - guint8 log2_max_pic_order_cnt_lsb_minus4; - - guint8 sub_layer_ordering_info_present_flag; - guint8 max_dec_pic_buffering_minus1[GST_H265_MAX_SUB_LAYERS]; - guint8 max_num_reorder_pics[GST_H265_MAX_SUB_LAYERS]; - guint8 max_latency_increase_plus1[GST_H265_MAX_SUB_LAYERS]; - - guint8 log2_min_luma_coding_block_size_minus3; - guint8 log2_diff_max_min_luma_coding_block_size; - guint8 log2_min_transform_block_size_minus2; - guint8 log2_diff_max_min_transform_block_size; - guint8 max_transform_hierarchy_depth_inter; - guint8 max_transform_hierarchy_depth_intra; - - guint8 scaling_list_enabled_flag; - /* if scaling_list_enabled_flag */ - guint8 scaling_list_data_present_flag; - - GstH265ScalingList scaling_list; - - guint8 amp_enabled_flag; - guint8 sample_adaptive_offset_enabled_flag; - guint8 pcm_enabled_flag; - /* if pcm_enabled_flag */ - guint8 pcm_sample_bit_depth_luma_minus1; - guint8 pcm_sample_bit_depth_chroma_minus1; - guint8 log2_min_pcm_luma_coding_block_size_minus3; - guint8 log2_diff_max_min_pcm_luma_coding_block_size; - guint8 pcm_loop_filter_disabled_flag; - - guint8 num_short_term_ref_pic_sets; - GstH265ShortTermRefPicSet short_term_ref_pic_set[65]; - - guint8 long_term_ref_pics_present_flag; - /* if long_term_ref_pics_present_flag */ - guint8 num_long_term_ref_pics_sps; - guint16 lt_ref_pic_poc_lsb_sps[32]; - guint8 used_by_curr_pic_lt_sps_flag[32]; - - guint8 temporal_mvp_enabled_flag; - guint8 strong_intra_smoothing_enabled_flag; - guint8 vui_parameters_present_flag; - - /* if vui_parameters_present_flat */ - GstH265VUIParams vui_params; - - guint8 sps_extension_flag; - - /* calculated values */ - guint8 chroma_array_type; - gint width, height; - gint crop_rect_width, crop_rect_height; - gint crop_rect_x, crop_rect_y; - gint fps_num, fps_den; - gboolean valid; -}; - -/** - * GstH265PPS: - * - * H265 Picture Parameter Set - */ -struct _GstH265PPS -{ - guint id; - - GstH265SPS *sps; - - guint8 dependent_slice_segments_enabled_flag; - guint8 output_flag_present_flag; - guint8 num_extra_slice_header_bits; - guint8 sign_data_hiding_enabled_flag; - guint8 cabac_init_present_flag; - guint8 num_ref_idx_l0_default_active_minus1; - guint8 num_ref_idx_l1_default_active_minus1; - gint8 init_qp_minus26; - guint8 constrained_intra_pred_flag; - guint8 transform_skip_enabled_flag; - guint8 cu_qp_delta_enabled_flag; - /*if cu_qp_delta_enabled_flag */ - guint8 diff_cu_qp_delta_depth; - - gint8 cb_qp_offset; - gint8 cr_qp_offset; - guint8 slice_chroma_qp_offsets_present_flag; - guint8 weighted_pred_flag; - guint8 weighted_bipred_flag; - guint8 transquant_bypass_enabled_flag; - guint8 tiles_enabled_flag; - guint8 entropy_coding_sync_enabled_flag; - - guint8 num_tile_columns_minus1; - guint8 num_tile_rows_minus1; - guint8 uniform_spacing_flag; - guint32 column_width_minus1[19]; - guint32 row_height_minus1[21]; - guint8 loop_filter_across_tiles_enabled_flag; - - guint8 loop_filter_across_slices_enabled_flag; - guint8 deblocking_filter_control_present_flag; - guint8 deblocking_filter_override_enabled_flag; - guint8 deblocking_filter_disabled_flag; - gint8 beta_offset_div2; - gint8 tc_offset_div2; - - guint8 scaling_list_data_present_flag; - - GstH265ScalingList scaling_list; - - guint8 lists_modification_present_flag; - guint8 log2_parallel_merge_level_minus2; - guint8 slice_segment_header_extension_present_flag; - - guint8 pps_extension_flag; - - /* calculated values */ - guint32 PicWidthInCtbsY; - guint32 PicHeightInCtbsY; - gboolean valid; -}; - -struct _GstH265RefPicListModification -{ - guint8 ref_pic_list_modification_flag_l0; - guint32 list_entry_l0[15]; - guint8 ref_pic_list_modification_flag_l1; - guint32 list_entry_l1[15]; -}; - -struct _GstH265PredWeightTable -{ - guint8 luma_log2_weight_denom; - gint8 delta_chroma_log2_weight_denom; - - guint8 luma_weight_l0_flag[15]; - guint8 chroma_weight_l0_flag[15]; - gint8 delta_luma_weight_l0[15]; - gint8 luma_offset_l0[15]; - gint8 delta_chroma_weight_l0 [15][2]; - gint16 delta_chroma_offset_l0 [15][2]; - - guint8 luma_weight_l1_flag[15]; - guint8 chroma_weight_l1_flag[15]; - gint8 delta_luma_weight_l1[15]; - gint8 luma_offset_l1[15]; - gint8 delta_chroma_weight_l1[15][2]; - gint16 delta_chroma_offset_l1[15][2]; -}; - -struct _GstH265SliceHdr -{ - guint8 first_slice_segment_in_pic_flag; - guint8 no_output_of_prior_pics_flag; - - GstH265PPS *pps; - - guint8 dependent_slice_segment_flag; - guint32 segment_address; - - guint8 type; - - guint8 pic_output_flag; - guint8 colour_plane_id; - guint16 pic_order_cnt_lsb; - - guint8 short_term_ref_pic_set_sps_flag; - GstH265ShortTermRefPicSet short_term_ref_pic_sets; - guint8 short_term_ref_pic_set_idx; - - guint8 num_long_term_sps; - guint8 num_long_term_pics; - guint8 lt_idx_sps[16]; - guint32 poc_lsb_lt[16]; - guint8 used_by_curr_pic_lt_flag[16]; - guint8 delta_poc_msb_present_flag[16]; - guint32 delta_poc_msb_cycle_lt[16]; - - guint8 temporal_mvp_enabled_flag; - guint8 sao_luma_flag; - guint8 sao_chroma_flag; - guint8 num_ref_idx_active_override_flag; - guint8 num_ref_idx_l0_active_minus1; - guint8 num_ref_idx_l1_active_minus1; - - GstH265RefPicListModification ref_pic_list_modification; - - guint8 mvd_l1_zero_flag; - guint8 cabac_init_flag; - guint8 collocated_from_l0_flag; - guint8 collocated_ref_idx; - - GstH265PredWeightTable pred_weight_table; - - guint8 five_minus_max_num_merge_cand; - - gint8 qp_delta; - gint8 cb_qp_offset; - gint8 cr_qp_offset; - - guint8 deblocking_filter_override_flag; - guint8 deblocking_filter_disabled_flag; - gint8 beta_offset_div2; - gint8 tc_offset_div2; - - guint8 loop_filter_across_slices_enabled_flag; - - guint32 num_entry_point_offsets; - guint8 offset_len_minus1; - guint32 *entry_point_offset_minus1; - - /* calculated values */ - - gint NumPocTotalCurr; - /* Size of the slice_header() in bits */ - guint header_size; - /* Number of emulation prevention bytes (EPB) in this slice_header() */ - guint n_emulation_prevention_bytes; -}; - -struct _GstH265PicTiming -{ - guint8 pic_struct; - guint8 source_scan_type; - guint8 duplicate_flag; - - guint8 au_cpb_removal_delay_minus1; - guint8 pic_dpb_output_delay; - guint8 pic_dpb_output_du_delay; - guint32 num_decoding_units_minus1; - guint8 du_common_cpb_removal_delay_flag; - guint8 du_common_cpb_removal_delay_increment_minus1; - guint32 *num_nalus_in_du_minus1; - guint8 *du_cpb_removal_delay_increment_minus1; -}; - -struct _GstH265BufferingPeriod -{ - GstH265SPS *sps; - - guint8 irap_cpb_params_present_flag; - guint8 cpb_delay_offset; - guint8 dpb_delay_offset; - guint8 concatenation_flag; - guint8 au_cpb_removal_delay_delta_minus1; - - /* seq->vui_parameters->nal_hrd_parameters_present_flag */ - guint8 nal_initial_cpb_removal_delay[32]; - guint8 nal_initial_cpb_removal_offset[32]; - guint8 nal_initial_alt_cpb_removal_delay[32]; - guint8 nal_initial_alt_cpb_removal_offset [32]; - - /* seq->vui_parameters->vcl_hrd_parameters_present_flag */ - guint8 vcl_initial_cpb_removal_delay[32]; - guint8 vcl_initial_cpb_removal_offset[32]; - guint8 vcl_initial_alt_cpb_removal_delay[32]; - guint8 vcl_initial_alt_cpb_removal_offset[32]; -}; - -struct _GstH265SEIMessage -{ - GstH265SEIPayloadType payloadType; - - union { - GstH265BufferingPeriod buffering_period; - GstH265PicTiming pic_timing; - /* ... could implement more */ - } payload; -}; - -/** - * GstH265Parser: - * - * H265 NAL Parser (opaque structure). - */ -struct _GstH265Parser -{ - /*< private >*/ - GstH265VPS vps[GST_H265_MAX_VPS_COUNT]; - GstH265SPS sps[GST_H265_MAX_SPS_COUNT]; - GstH265PPS pps[GST_H265_MAX_PPS_COUNT]; - GstH265VPS *last_vps; - GstH265SPS *last_sps; - GstH265PPS *last_pps; -}; - -GstH265Parser * gst_h265_parser_new (void); - -GstH265ParserResult gst_h265_parser_identify_nalu (GstH265Parser * parser, - const guint8 * data, - guint offset, - gsize size, - GstH265NalUnit * nalu); - -GstH265ParserResult gst_h265_parser_identify_nalu_unchecked (GstH265Parser * parser, - const guint8 * data, - guint offset, - gsize size, - GstH265NalUnit * nalu); - -GstH265ParserResult gst_h265_parser_identify_nalu_hevc (GstH265Parser * parser, - const guint8 * data, - guint offset, - gsize size, - guint8 nal_length_size, - GstH265NalUnit * nalu); - -GstH265ParserResult gst_h265_parser_parse_nal (GstH265Parser * parser, - GstH265NalUnit * nalu); - -GstH265ParserResult gst_h265_parser_parse_slice_hdr (GstH265Parser * parser, - GstH265NalUnit * nalu, - GstH265SliceHdr * slice); - -GstH265ParserResult gst_h265_parser_parse_vps (GstH265Parser * parser, - GstH265NalUnit * nalu, - GstH265VPS * vps); - -GstH265ParserResult gst_h265_parser_parse_sps (GstH265Parser * parser, - GstH265NalUnit * nalu, - GstH265SPS * sps, - gboolean parse_vui_params); - -GstH265ParserResult gst_h265_parser_parse_pps (GstH265Parser * parser, - GstH265NalUnit * nalu, - GstH265PPS * pps); - -GstH265ParserResult gst_h265_parser_parse_sei (GstH265Parser * parser, - GstH265NalUnit * nalu, - GArray **messages); - -void gst_h265_parser_free (GstH265Parser * parser); - -GstH265ParserResult gst_h265_parse_vps (GstH265NalUnit * nalu, - GstH265VPS * vps); - -GstH265ParserResult gst_h265_parse_sps (GstH265Parser * parser, - GstH265NalUnit * nalu, - GstH265SPS * sps, - gboolean parse_vui_params); - -GstH265ParserResult gst_h265_parse_pps (GstH265Parser * parser, - GstH265NalUnit * nalu, - GstH265PPS * pps); - -gboolean gst_h265_slice_hdr_copy (GstH265SliceHdr * dst_slice, - const GstH265SliceHdr * src_slice); - -void gst_h265_slice_hdr_free (GstH265SliceHdr * slice_hdr); - -gboolean gst_h265_sei_copy (GstH265SEIMessage * dest_sei, - const GstH265SEIMessage * src_sei); - -void gst_h265_sei_free (GstH265SEIMessage * sei); - -void gst_h265_quant_matrix_4x4_get_zigzag_from_raster (guint8 out_quant[16], - const guint8 quant[16]); - -void gst_h265_quant_matrix_4x4_get_raster_from_zigzag (guint8 out_quant[16], - const guint8 quant[16]); - -void gst_h265_quant_matrix_8x8_get_zigzag_from_raster (guint8 out_quant[64], - const guint8 quant[64]); - -void gst_h265_quant_matrix_8x8_get_raster_from_zigzag (guint8 out_quant[64], - const guint8 quant[64]); - -#define gst_h265_quant_matrix_16x16_get_zigzag_from_raster \ - gst_h265_quant_matrix_8x8_get_zigzag_from_raster -#define gst_h265_quant_matrix_16x16_get_raster_from_zigzag \ - gst_h265_quant_matrix_8x8_get_raster_from_zigzag -#define gst_h265_quant_matrix_32x32_get_zigzag_from_raster \ - gst_h265_quant_matrix_8x8_get_zigzag_from_raster -#define gst_h265_quant_matrix_32x32_get_raster_from_zigzag \ - gst_h265_quant_matrix_8x8_get_raster_from_zigzag - -void gst_h265_quant_matrix_4x4_get_uprightdiagonal_from_raster (guint8 out_quant[16], - const guint8 quant[16]); - -void gst_h265_quant_matrix_4x4_get_raster_from_uprightdiagonal (guint8 out_quant[16], - const guint8 quant[16]); - -void gst_h265_quant_matrix_8x8_get_uprightdiagonal_from_raster (guint8 out_quant[64], - const guint8 quant[64]); - -void gst_h265_quant_matrix_8x8_get_raster_from_uprightdiagonal (guint8 out_quant[64], - const guint8 quant[64]); - -#define gst_h265_quant_matrix_16x16_get_uprightdiagonal_from_raster \ - gst_h265_quant_matrix_8x8_get_uprightdiagonal_from_raster -#define gst_h265_quant_matrix_16x16_get_raster_from_uprightdiagonal\ - gst_h265_quant_matrix_8x8_get_raster_from_uprightdiagonal -#define gst_h265_quant_matrix_32x32_get_uprightdiagonal_from_raster \ - gst_h265_quant_matrix_8x8_get_uprightdiagonal_from_raster -#define gst_h265_quant_matrix_32x32_get_raster_from_uprightdiagonal\ - gst_h265_quant_matrix_8x8_get_raster_from_uprightdiagonal - -G_END_DECLS -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstjpegparser.c gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstjpegparser.c --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstjpegparser.c 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstjpegparser.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,762 +0,0 @@ -/* GStreamer JPEG parser - * Copyright (C) 2011-2012 Intel Corporation - * Copyright (C) 2015 Tim-Philipp Müller - * - * 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 - */ - -/** - * SECTION:gstjpegparser - * @short_description: Convenience library for JPEG bitstream parsing. - * - * - * - * Provides useful functions for parsing JPEG images - * - * - */ - -#include -#include -#include -#include "gstjpegparser.h" - -#ifndef GST_DISABLE_GST_DEBUG - -#define GST_CAT_DEFAULT ensure_debug_category() - -static GstDebugCategory * -ensure_debug_category (void) -{ - static gsize cat_gonce = 0; - - if (g_once_init_enter (&cat_gonce)) { - gsize cat_done; - - cat_done = (gsize) _gst_debug_category_new ("codecparsers_jpeg", 0, - "GstJpegCodecParser"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} -#else - -#define ensure_debug_category() /* NOOP */ - -#endif /* GST_DISABLE_GST_DEBUG */ - -#define DEBUG_PRINT_COMMENT 0 - -#define READ_UINT8(reader, val) G_STMT_START { \ - if (!gst_byte_reader_get_uint8 ((reader), &(val))) { \ - GST_WARNING ("failed to read uint8"); \ - goto failed; \ - } \ - } G_STMT_END - -#define READ_UINT16(reader, val) G_STMT_START { \ - if (!gst_byte_reader_get_uint16_be ((reader), &(val))) { \ - GST_WARNING ("failed to read uint16"); \ - goto failed; \ - } \ - } G_STMT_END - -#define READ_BYTES(reader, buf, length) G_STMT_START { \ - const guint8 *vals; \ - if (!gst_byte_reader_get_data (reader, length, &vals)) { \ - GST_WARNING ("failed to read bytes, size:%d", length); \ - goto failed; \ - } \ - memcpy (buf, vals, length); \ - } G_STMT_END - -#define U_READ_UINT8(reader, val) G_STMT_START { \ - (val) = gst_byte_reader_get_uint8_unchecked(reader); \ - } G_STMT_END - -#define U_READ_UINT16(reader, val) G_STMT_START { \ - (val) = gst_byte_reader_get_uint16_be_unchecked(reader); \ - } G_STMT_END - - -/* Table used to address an 8x8 matrix in zig-zag order */ -/* *INDENT-OFF* */ -static const guint8 zigzag_index[64] = { - 0, 1, 8, 16, 9, 2, 3, 10, - 17, 24, 32, 25, 18, 11, 4, 5, - 12, 19, 26, 33, 40, 48, 41, 34, - 27, 20, 13, 6, 7, 14, 21, 28, - 35, 42, 49, 56, 57, 50, 43, 36, - 29, 22, 15, 23, 30, 37, 44, 51, - 58, 59, 52, 45, 38, 31, 39, 46, - 53, 60, 61, 54, 47, 55, 62, 63 -}; -/* *INDENT-ON* */ - -/* Table K.1 - Luminance quantization table */ -/* *INDENT-OFF* */ -static const guint8 default_luminance_quant_table[64] = { - 16, 11, 10, 16, 24, 40, 51, 61, - 12, 12, 14, 19, 26, 58, 60, 55, - 14, 13, 16, 24, 40, 57, 69, 56, - 14, 17, 22, 29, 51, 87, 80, 62, - 18, 22, 37, 56, 68, 109, 103, 77, - 24, 35, 55, 64, 81, 104, 113, 92, - 49, 64, 78, 87, 103, 121, 120, 101, - 72, 92, 95, 98, 112, 100, 103, 99 -}; -/* *INDENT-ON* */ - -/* Table K.2 - Chrominance quantization table */ -/* *INDENT-OFF* */ -static const guint8 default_chrominance_quant_table[64] = { - 17, 18, 24, 47, 99, 99, 99, 99, - 18, 21, 26, 66, 99, 99, 99, 99, - 24, 26, 56, 99, 99, 99, 99, 99, - 47, 66, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99 -}; -/* *INDENT-ON* */ - -typedef struct _GstJpegHuffmanTableEntry GstJpegHuffmanTableEntry; -struct _GstJpegHuffmanTableEntry -{ - guint8 value; /* category */ - guint8 length; /* code length in bits */ -}; - -/* Table K.3 - Table for luminance DC coefficient differences */ -static const GstJpegHuffmanTableEntry default_luminance_dc_table[] = { - {0x00, 2}, {0x01, 3}, {0x02, 3}, {0x03, 3}, {0x04, 3}, {0x05, 3}, - {0x06, 4}, {0x07, 5}, {0x08, 6}, {0x09, 7}, {0x0a, 8}, {0x0b, 9} -}; - -/* Table K.4 - Table for chrominance DC coefficient differences */ -static const GstJpegHuffmanTableEntry default_chrominance_dc_table[] = { - {0x00, 2}, {0x01, 2}, {0x02, 2}, {0x03, 3}, {0x04, 4}, {0x05, 5}, - {0x06, 6}, {0x07, 7}, {0x08, 8}, {0x09, 9}, {0x0a, 10}, {0x0b, 11} -}; - -/* Table K.5 - Table for luminance AC coefficients */ -/* *INDENT-OFF* */ -static const GstJpegHuffmanTableEntry default_luminance_ac_table[] = { - {0x00, 4}, {0x01, 2}, {0x02, 2}, {0x03, 3}, {0x04, 4}, {0x05, 5}, - {0x06, 7}, {0x07, 8}, {0x08, 10}, {0x09, 16}, {0x0a, 16}, {0x11, 4}, - {0x12, 5}, {0x13, 7}, {0x14, 9}, {0x15, 11}, {0x16, 16}, {0x17, 16}, - {0x18, 16}, {0x19, 16}, {0x1a, 16}, {0x21, 5}, {0x22, 8}, {0x23, 10}, - {0x24, 12}, {0x25, 16}, {0x26, 16}, {0x27, 16}, {0x28, 16}, {0x29, 16}, - {0x2a, 16}, {0x31, 6}, {0x32, 9}, {0x33, 12}, {0x34, 16}, {0x35, 16}, - {0x36, 16}, {0x37, 16}, {0x38, 16}, {0x39, 16}, {0x3a, 16}, {0x41, 6}, - {0x42, 10}, {0x43, 16}, {0x44, 16}, {0x45, 16}, {0x46, 16}, {0x47, 16}, - {0x48, 16}, {0x49, 16}, {0x4a, 16}, {0x51, 7}, {0x52, 11}, {0x53, 16}, - {0x54, 16}, {0x55, 16}, {0x56, 16}, {0x57, 16}, {0x58, 16}, {0x59, 16}, - {0x5a, 16}, {0x61, 7}, {0x62, 12}, {0x63, 16}, {0x64, 16}, {0x65, 16}, - {0x66, 16}, {0x67, 16}, {0x68, 16}, {0x69, 16}, {0x6a, 16}, {0x71, 8}, - {0x72, 12}, {0x73, 16}, {0x74, 16}, {0x75, 16}, {0x76, 16}, {0x77, 16}, - {0x78, 16}, {0x79, 16}, {0x7a, 16}, {0x81, 9}, {0x82, 15}, {0x83, 16}, - {0x84, 16}, {0x85, 16}, {0x86, 16}, {0x87, 16}, {0x88, 16}, {0x89, 16}, - {0x8a, 16}, {0x91, 9}, {0x92, 16}, {0x93, 16}, {0x94, 16}, {0x95, 16}, - {0x96, 16}, {0x97, 16}, {0x98, 16}, {0x99, 16}, {0x9a, 16}, {0xa1, 9}, - {0xa2, 16}, {0xa3, 16}, {0xa4, 16}, {0xa5, 16}, {0xa6, 16}, {0xa7, 16}, - {0xa8, 16}, {0xa9, 16}, {0xaa, 16}, {0xb1, 10}, {0xb2, 16}, {0xb3, 16}, - {0xb4, 16}, {0xb5, 16}, {0xb6, 16}, {0xb7, 16}, {0xb8, 16}, {0xb9, 16}, - {0xba, 16}, {0xc1, 10}, {0xc2, 16}, {0xc3, 16}, {0xc4, 16}, {0xc5, 16}, - {0xc6, 16}, {0xc7, 16}, {0xc8, 16}, {0xc9, 16}, {0xca, 16}, {0xd1, 11}, - {0xd2, 16}, {0xd3, 16}, {0xd4, 16}, {0xd5, 16}, {0xd6, 16}, {0xd7, 16}, - {0xd8, 16}, {0xd9, 16}, {0xda, 16}, {0xe1, 16}, {0xe2, 16}, {0xe3, 16}, - {0xe4, 16}, {0xe5, 16}, {0xe6, 16}, {0xe7, 16}, {0xe8, 16}, {0xe9, 16}, - {0xea, 16}, {0xf0, 11}, {0xf1, 16}, {0xf2, 16}, {0xf3, 16}, {0xf4, 16}, - {0xf5, 16}, {0xf6, 16}, {0xf7, 16}, {0xf8, 16}, {0xf9, 16}, {0xfa, 16} -}; -/* *INDENT-ON* */ - -/* Table K.6 - Table for chrominance AC coefficients */ -/* *INDENT-OFF* */ -static const GstJpegHuffmanTableEntry default_chrominance_ac_table[] = { - {0x00, 2}, {0x01, 2}, {0x02, 3}, {0x03, 4}, {0x04, 5}, {0x05, 5}, - {0x06, 6}, {0x07, 7}, {0x08, 9}, {0x09, 10}, {0x0a, 12}, {0x11, 4}, - {0x12, 6}, {0x13, 8}, {0x14, 9}, {0x15, 11}, {0x16, 12}, {0x17, 16}, - {0x18, 16}, {0x19, 16}, {0x1a, 16}, {0x21, 5}, {0x22, 8}, {0x23, 10}, - {0x24, 12}, {0x25, 15}, {0x26, 16}, {0x27, 16}, {0x28, 16}, {0x29, 16}, - {0x2a, 16}, {0x31, 5}, {0x32, 8}, {0x33, 10}, {0x34, 12}, {0x35, 16}, - {0x36, 16}, {0x37, 16}, {0x38, 16}, {0x39, 16}, {0x3a, 16}, {0x41, 6}, - {0x42, 9}, {0x43, 16}, {0x44, 16}, {0x45, 16}, {0x46, 16}, {0x47, 16}, - {0x48, 16}, {0x49, 16}, {0x4a, 16}, {0x51, 6}, {0x52, 10}, {0x53, 16}, - {0x54, 16}, {0x55, 16}, {0x56, 16}, {0x57, 16}, {0x58, 16}, {0x59, 16}, - {0x5a, 16}, {0x61, 7}, {0x62, 11}, {0x63, 16}, {0x64, 16}, {0x65, 16}, - {0x66, 16}, {0x67, 16}, {0x68, 16}, {0x69, 16}, {0x6a, 16}, {0x71, 7}, - {0x72, 11}, {0x73, 16}, {0x74, 16}, {0x75, 16}, {0x76, 16}, {0x77, 16}, - {0x78, 16}, {0x79, 16}, {0x7a, 16}, {0x81, 8}, {0x82, 16}, {0x83, 16}, - {0x84, 16}, {0x85, 16}, {0x86, 16}, {0x87, 16}, {0x88, 16}, {0x89, 16}, - {0x8a, 16}, {0x91, 9}, {0x92, 16}, {0x93, 16}, {0x94, 16}, {0x95, 16}, - {0x96, 16}, {0x97, 16}, {0x98, 16}, {0x99, 16}, {0x9a, 16}, {0xa1, 9}, - {0xa2, 16}, {0xa3, 16}, {0xa4, 16}, {0xa5, 16}, {0xa6, 16}, {0xa7, 16}, - {0xa8, 16}, {0xa9, 16}, {0xaa, 16}, {0xb1, 9}, {0xb2, 16}, {0xb3, 16}, - {0xb4, 16}, {0xb5, 16}, {0xb6, 16}, {0xb7, 16}, {0xb8, 16}, {0xb9, 16}, - {0xba, 16}, {0xc1, 9}, {0xc2, 16}, {0xc3, 16}, {0xc4, 16}, {0xc5, 16}, - {0xc6, 16}, {0xc7, 16}, {0xc8, 16}, {0xc9, 16}, {0xca, 16}, {0xd1, 11}, - {0xd2, 16}, {0xd3, 16}, {0xd4, 16}, {0xd5, 16}, {0xd6, 16}, {0xd7, 16}, - {0xd8, 16}, {0xd9, 16}, {0xda, 16}, {0xe1, 14}, {0xe2, 16}, {0xe3, 16}, - {0xe4, 16}, {0xe5, 16}, {0xe6, 16}, {0xe7, 16}, {0xe8, 16}, {0xe9, 16}, - {0xea, 16}, {0xf0, 10}, {0xf1, 15}, {0xf2, 16}, {0xf3, 16}, {0xf4, 16}, - {0xf5, 16}, {0xf6, 16}, {0xf7, 16}, {0xf8, 16}, {0xf9, 16}, {0xfa, 16} -}; -/* *INDENT-ON* */ - -static gint gst_jpeg_scan_for_marker_code (const guint8 * data, gsize size, - guint offset); - -static inline gboolean -jpeg_parse_to_next_marker (GstByteReader * br, GstJpegMarker * marker) -{ - gint ofs; - - ofs = gst_jpeg_scan_for_marker_code (br->data, br->size, br->byte); - if (ofs < 0) - return FALSE; - - if (marker) - *marker = (GstJpegMarker) br->data[ofs + 1]; - - gst_byte_reader_skip_unchecked (br, ofs - br->byte); - return TRUE; -} - -/* gst_jpeg_scan_for_marker_code: - * @data: The data to parse - * @size: The size of @data - * @offset: The offset from which to start parsing - * - * Scans the JPEG bitstream contained in @data for the next marker - * code. If found, the function returns an offset to the marker code, - * including the 0xff prefix code but excluding any extra fill bytes. - * - * Returns: offset to the marker code if found, or -1 if not found. - */ -static gint -gst_jpeg_scan_for_marker_code (const guint8 * data, gsize size, guint offset) -{ - guint i; - - i = offset + 1; - while (i < size) { - const guint8 v = data[i]; - if (v < 0xc0) - i += 2; - else if (v < 0xff && data[i - 1] == 0xff) - return i - 1; - else - i++; - } - return -1; -} - -/** - * gst_jpeg_segment_parse_frame_header: - * @segment: the JPEG segment - * @frame_hdr: (out): The #GstJpegFrameHdr structure to fill in - * - * Parses the @frame_hdr JPEG frame header structure members from @segment. - * - * The caller must make sure there is enough data for the whole segment - * available. - * - * Returns: TRUE if the frame header was correctly parsed. - * - * Since: 1.6 - */ -gboolean -gst_jpeg_segment_parse_frame_header (const GstJpegSegment * segment, - GstJpegFrameHdr * frame_hdr) -{ - GstByteReader br; - guint8 val; - guint i; - - g_return_val_if_fail (segment != NULL, FALSE); - g_return_val_if_fail (frame_hdr != NULL, FALSE); - - if (segment->size < 8) - return FALSE; - - gst_byte_reader_init (&br, segment->data + segment->offset, segment->size); - gst_byte_reader_skip_unchecked (&br, 2); - - U_READ_UINT8 (&br, frame_hdr->sample_precision); - U_READ_UINT16 (&br, frame_hdr->height); - U_READ_UINT16 (&br, frame_hdr->width); - U_READ_UINT8 (&br, frame_hdr->num_components); - - if (frame_hdr->num_components > GST_JPEG_MAX_SCAN_COMPONENTS) - return FALSE; - - if (gst_byte_reader_get_remaining (&br) < 3 * frame_hdr->num_components) - return FALSE; - - for (i = 0; i < frame_hdr->num_components; i++) { - U_READ_UINT8 (&br, frame_hdr->components[i].identifier); - U_READ_UINT8 (&br, val); - frame_hdr->components[i].horizontal_factor = (val >> 4) & 0x0F; - frame_hdr->components[i].vertical_factor = (val & 0x0F); - U_READ_UINT8 (&br, frame_hdr->components[i].quant_table_selector); - if (frame_hdr->components[i].horizontal_factor > 4 - || frame_hdr->components[i].vertical_factor > 4 - || frame_hdr->components[i].quant_table_selector >= 4) - return FALSE; - } - - if (gst_byte_reader_get_remaining (&br) > 0) - GST_DEBUG ("data left at end of frame header segment"); - - return TRUE; -} - -/** - * gst_jpeg_segment_parse_scan_header: - * @segment: the JPEG segment - * @scan_hdr: (out): The #GstJpegScanHdr structure to fill in - * - * Parses the @scan_hdr JPEG scan header structure members from @segment. - * - * The caller must make sure there is enough data for the whole segment - * available. - * - * Returns: TRUE if the scan header was correctly parsed - * - * Since: 1.6 - */ -gboolean -gst_jpeg_segment_parse_scan_header (const GstJpegSegment * segment, - GstJpegScanHdr * scan_hdr) -{ - GstByteReader br; - guint8 val; - guint i; - - g_return_val_if_fail (segment != NULL, FALSE); - g_return_val_if_fail (scan_hdr != NULL, FALSE); - - gst_byte_reader_init (&br, segment->data + segment->offset, segment->size); - - if (segment->size < 3) - return FALSE; - - gst_byte_reader_skip_unchecked (&br, 2); - - U_READ_UINT8 (&br, scan_hdr->num_components); - - if (scan_hdr->num_components > GST_JPEG_MAX_SCAN_COMPONENTS) - return FALSE; - - if (gst_byte_reader_get_remaining (&br) < 2 * scan_hdr->num_components) - return FALSE; - - for (i = 0; i < scan_hdr->num_components; i++) { - U_READ_UINT8 (&br, scan_hdr->components[i].component_selector); - U_READ_UINT8 (&br, val); - scan_hdr->components[i].dc_selector = (val >> 4) & 0x0F; - scan_hdr->components[i].ac_selector = val & 0x0F; - if (scan_hdr->components[i].dc_selector >= 4 - || scan_hdr->components[i].ac_selector >= 4) - return FALSE; - } - - if (gst_byte_reader_get_remaining (&br) < 3) - return FALSE; - - /* FIXME: Ss, Se, Ah, Al */ - gst_byte_reader_skip_unchecked (&br, 3); - - if (gst_byte_reader_get_remaining (&br) > 0) - GST_DEBUG ("data left at end of scan header segment"); - - return TRUE; -} - -/** - * gst_jpeg_segment_parse_huffman_table: - * @segment: the JPEG segment - * @huff_tables: (out): The #GstJpegHuffmanTables structure to fill in - * - * Parses the JPEG Huffman table structure members from @segment. - * - * The caller must make sure there is enough data for the whole segment - * available. - * - * Note: @huf_tables represents the complete set of possible Huffman - * tables. However, the parser will only write to the Huffman table - * specified by the table destination identifier (Th). While doing so, - * the @valid flag of the specified Huffman table will also be set to - * %TRUE; - * - * Returns: TRUE if the Huffman table was correctly parsed. - * - * Since: 1.6 - */ -gboolean -gst_jpeg_segment_parse_huffman_table (const GstJpegSegment * segment, - GstJpegHuffmanTables * huff_tables) -{ - GstByteReader br; - GstJpegHuffmanTable *huf_table; - guint8 val, table_class, table_index; - guint32 value_count; - guint i; - - g_return_val_if_fail (segment != NULL, FALSE); - g_return_val_if_fail (huff_tables != NULL, FALSE); - - if (segment->size < 2) - return FALSE; - - gst_byte_reader_init (&br, segment->data + segment->offset, segment->size); - - gst_byte_reader_skip_unchecked (&br, 2); - - while (gst_byte_reader_get_remaining (&br) > 0) { - U_READ_UINT8 (&br, val); - table_class = ((val >> 4) & 0x0F); - table_index = (val & 0x0F); - if (table_index >= GST_JPEG_MAX_SCAN_COMPONENTS) - return FALSE; - if (table_class == 0) { - huf_table = &huff_tables->dc_tables[table_index]; - } else { - huf_table = &huff_tables->ac_tables[table_index]; - } - READ_BYTES (&br, huf_table->huf_bits, 16); - value_count = 0; - for (i = 0; i < 16; i++) - value_count += huf_table->huf_bits[i]; - READ_BYTES (&br, huf_table->huf_values, value_count); - huf_table->valid = TRUE; - } - return TRUE; - -failed: - return FALSE; -} - -/** - * gst_jpeg_segment_parse_quantization_table: - * @segment: the JPEG segment - * @quant_tables: (out): The #GstJpegQuantTables structure to fill in - * - * Parses the JPEG quantization table structure members from @segment. - * - * The caller must make sure there is enough data for the whole segment - * available. - * - * Note: @quant_tables represents the complete set of possible - * quantization tables. However, the parser will only write to the - * quantization table specified by the table destination identifier - * (Tq). While doing so, the @valid flag of the specified quantization - * table will also be set to %TRUE. - * - * Returns: TRUE if the quantization table was correctly parsed. - * - * Since: 1.6 - */ -gboolean -gst_jpeg_segment_parse_quantization_table (const GstJpegSegment * segment, - GstJpegQuantTables * quant_tables) -{ - GstByteReader br; - GstJpegQuantTable *quant_table; - guint8 val, table_index; - guint i; - - g_return_val_if_fail (segment != NULL, FALSE); - g_return_val_if_fail (quant_tables != NULL, FALSE); - - if (segment->size < 2) - return FALSE; - - gst_byte_reader_init (&br, segment->data + segment->offset, segment->size); - - gst_byte_reader_skip_unchecked (&br, 2); - - while (gst_byte_reader_get_remaining (&br) > 0) { - guint8 element_size; - - U_READ_UINT8 (&br, val); - table_index = (val & 0x0f); - if (table_index >= GST_JPEG_MAX_SCAN_COMPONENTS) - return FALSE; - quant_table = &quant_tables->quant_tables[table_index]; - quant_table->quant_precision = ((val >> 4) & 0x0f); - - element_size = (quant_table->quant_precision == 0) ? 1 : 2; - if (gst_byte_reader_get_remaining (&br) < - GST_JPEG_MAX_QUANT_ELEMENTS * element_size) - return FALSE; - for (i = 0; i < GST_JPEG_MAX_QUANT_ELEMENTS; i++) { - if (!quant_table->quant_precision) { /* 8-bit values */ - U_READ_UINT8 (&br, val); - quant_table->quant_table[i] = val; - } else { /* 16-bit values */ - U_READ_UINT16 (&br, quant_table->quant_table[i]); - } - } - quant_table->valid = TRUE; - } - return TRUE; -} - -/** - * gst_jpeg_segment_parse_restart_interval: - * @segment: the JPEG segment - * @interval: (out): The parsed restart interval value - * - * The caller must make sure there is enough data for the whole segment - * available. - * - * Returns: TRUE if the restart interval value was correctly parsed. - * - * Since: 1.6 - */ -gboolean -gst_jpeg_segment_parse_restart_interval (const GstJpegSegment * segment, - guint * interval) -{ - GstByteReader br; - guint16 val; - - g_return_val_if_fail (segment != NULL, FALSE); - g_return_val_if_fail (interval != NULL, FALSE); - - if (segment->size < 4) - return FALSE; - - gst_byte_reader_init (&br, segment->data + segment->offset, segment->size); - gst_byte_reader_skip_unchecked (&br, 2); - - U_READ_UINT16 (&br, val); - *interval = val; - return TRUE; -} - -static int -compare_huffman_table_entry (const void *a, const void *b) -{ - const GstJpegHuffmanTableEntry *const e1 = *(GstJpegHuffmanTableEntry **) a; - const GstJpegHuffmanTableEntry *const e2 = *(GstJpegHuffmanTableEntry **) b; - - if (e1->length == e2->length) - return (gint) e1->value - (gint) e2->value; - return (gint) e1->length - (gint) e2->length; -} - -static void -build_huffman_table (GstJpegHuffmanTable * huf_table, - const GstJpegHuffmanTableEntry * entries, guint num_entries) -{ - const GstJpegHuffmanTableEntry *sorted_entries[256]; - guint i, j, n; - - g_assert (num_entries <= G_N_ELEMENTS (sorted_entries)); - - for (i = 0; i < num_entries; i++) - sorted_entries[i] = &entries[i]; - qsort (sorted_entries, num_entries, sizeof (sorted_entries[0]), - compare_huffman_table_entry); - - for (i = 0, j = 1, n = 0; i < num_entries; i++) { - const GstJpegHuffmanTableEntry *const e = sorted_entries[i]; - if (e->length != j) { - huf_table->huf_bits[j++ - 1] = n; - for (; j < e->length; j++) - huf_table->huf_bits[j - 1] = 0; - n = 0; - } - huf_table->huf_values[i] = e->value; - n++; - } - huf_table->huf_bits[j - 1] = n; - - for (; j < G_N_ELEMENTS (huf_table->huf_bits); j++) - huf_table->huf_bits[j] = 0; - for (; i < G_N_ELEMENTS (huf_table->huf_values); i++) - huf_table->huf_values[i] = 0; - huf_table->valid = TRUE; -} - -/** - * gst_jpeg_get_default_huffman_tables: - * @huf_tables: (out): The default DC/AC Huffman tables to fill in - * - * Fills in @huf_tables with the default AC/DC Huffman tables, as - * specified by the JPEG standard. - * - * Since: 1.6 - */ -void -gst_jpeg_get_default_huffman_tables (GstJpegHuffmanTables * huf_tables) -{ - g_return_if_fail (huf_tables != NULL); - - /* Build DC tables */ - build_huffman_table (&huf_tables->dc_tables[0], default_luminance_dc_table, - G_N_ELEMENTS (default_luminance_dc_table)); - build_huffman_table (&huf_tables->dc_tables[1], default_chrominance_dc_table, - G_N_ELEMENTS (default_chrominance_dc_table)); - memcpy (&huf_tables->dc_tables[2], &huf_tables->dc_tables[1], - sizeof (huf_tables->dc_tables[2])); - - /* Build AC tables */ - build_huffman_table (&huf_tables->ac_tables[0], default_luminance_ac_table, - G_N_ELEMENTS (default_luminance_ac_table)); - build_huffman_table (&huf_tables->ac_tables[1], default_chrominance_ac_table, - G_N_ELEMENTS (default_chrominance_ac_table)); - memcpy (&huf_tables->ac_tables[2], &huf_tables->ac_tables[1], - sizeof (huf_tables->ac_tables[2])); -} - -static void -build_quant_table (GstJpegQuantTable * quant_table, const guint8 values[64]) -{ - guint i; - - for (i = 0; i < 64; i++) - quant_table->quant_table[i] = values[zigzag_index[i]]; - quant_table->quant_precision = 0; /* Pq = 0 (8-bit precision) */ - quant_table->valid = TRUE; -} - -/** - * gst_jpeg_get_default_quantization_table: - * @quant_tables: (out): The default luma/chroma quant-tables in zigzag mode - * - * Fills in @quant_tables with the default quantization tables, as - * specified by the JPEG standard. - * - * Since: 1.6 - */ -void -gst_jpeg_get_default_quantization_tables (GstJpegQuantTables * quant_tables) -{ - g_return_if_fail (quant_tables != NULL); - - build_quant_table (&quant_tables->quant_tables[0], - default_luminance_quant_table); - build_quant_table (&quant_tables->quant_tables[1], - default_chrominance_quant_table); - build_quant_table (&quant_tables->quant_tables[2], - default_chrominance_quant_table); -} - -/** - * gst_jpeg_parse: - * @segment: (out): pointer to a #GstJpegSegment structure to fill in - * @data: The data to parse - * @size: The size of @data - * @offset: The offset from which to start parsing - * - * Parses the JPEG bitstream contained in @data, and returns the - * detected segment as a #GstJpegSegment. - * - * Note that a valid segment may be returned with a length that exceeds - * the available data. It is up to the caller to make sure there's enough - * data available when parsing the segment. - * - * Returns: TRUE if a packet start code was found. - * - * Since: 1.6 - */ -gboolean -gst_jpeg_parse (GstJpegSegment * segment, - const guint8 * data, gsize size, guint offset) -{ - GstJpegSegment *seg = segment; - GstByteReader br; - guint16 length; - - g_return_val_if_fail (seg != NULL, FALSE); - g_return_val_if_fail (data != NULL, FALSE); - - if (size <= offset) { - GST_DEBUG ("failed to parse from offset %u, buffer is too small", offset); - return FALSE; - } - - size -= offset; - gst_byte_reader_init (&br, &data[offset], size); - - if (!jpeg_parse_to_next_marker (&br, &seg->marker)) { - GST_DEBUG ("failed to find marker code"); - return FALSE; - } - - gst_byte_reader_skip_unchecked (&br, 2); - seg->offset = offset + gst_byte_reader_get_pos (&br); - seg->size = -1; - - /* Try to find end of segment */ - switch (seg->marker) { - case GST_JPEG_MARKER_SOI: - case GST_JPEG_MARKER_EOI: - fixed_size_segment: - seg->size = 0; - break; - - case (GST_JPEG_MARKER_SOF_MIN + 0): /* Lf */ - case (GST_JPEG_MARKER_SOF_MIN + 1): /* Lf */ - case (GST_JPEG_MARKER_SOF_MIN + 2): /* Lf */ - case (GST_JPEG_MARKER_SOF_MIN + 3): /* Lf */ - case (GST_JPEG_MARKER_SOF_MIN + 9): /* Lf */ - case (GST_JPEG_MARKER_SOF_MIN + 10): /* Lf */ - case (GST_JPEG_MARKER_SOF_MIN + 11): /* Lf */ - case GST_JPEG_MARKER_SOS: /* Ls */ - case GST_JPEG_MARKER_DQT: /* Lq */ - case GST_JPEG_MARKER_DHT: /* Lh */ - case GST_JPEG_MARKER_DAC: /* La */ - case GST_JPEG_MARKER_DRI: /* Lr */ - case GST_JPEG_MARKER_COM: /* Lc */ - case GST_JPEG_MARKER_DNL: /* Ld */ - variable_size_segment: - READ_UINT16 (&br, length); - seg->size = length; - break; - - default: - /* Application data segment length (Lp) */ - if (seg->marker >= GST_JPEG_MARKER_APP_MIN && - seg->marker <= GST_JPEG_MARKER_APP_MAX) - goto variable_size_segment; - - /* Restart markers (fixed size, two bytes only) */ - if (seg->marker >= GST_JPEG_MARKER_RST_MIN && - seg->marker <= GST_JPEG_MARKER_RST_MAX) - goto fixed_size_segment; - - /* Fallback: scan for next marker */ - if (!jpeg_parse_to_next_marker (&br, NULL)) - goto failed; - seg->size = gst_byte_reader_get_pos (&br) - seg->offset; - break; - } - - seg->data = data; - return TRUE; - -failed: - return FALSE; -} diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstjpegparser.h gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstjpegparser.h --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstjpegparser.h 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstjpegparser.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,403 +0,0 @@ -/* GStreamer JPEG parser - * Copyright (C) 2011-2012 Intel Corporation - * Copyright (C) 2015 Tim-Philipp Müller - * - * 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 - */ - -#ifndef GST_JPEG_PARSER_H -#define GST_JPEG_PARSER_H - -#ifndef GST_USE_UNSTABLE_API -# warning "The JPEG parsing library is unstable API and may change in future." -# warning "You can define GST_USE_UNSTABLE_API to avoid this warning." -#endif - -#include - -G_BEGIN_DECLS - -/** - * GST_JPEG_MAX_FRAME_COMPONENTS: - * - * Maximum number of image components in a frame (Nf). - * - * Since: 1.6 - */ -#define GST_JPEG_MAX_FRAME_COMPONENTS 256 - -/** - * GST_JPEG_MAX_SCAN_COMPONENTS: - * - * Maximum number of image components in a scan (Ns). - * - * Since: 1.6 - */ -#define GST_JPEG_MAX_SCAN_COMPONENTS 4 - -/** - * GST_JPEG_MAX_QUANT_ELEMENTS: - * - * Number of elements in the quantization table. - * - * Since: 1.6 - */ -#define GST_JPEG_MAX_QUANT_ELEMENTS 64 - -typedef struct _GstJpegQuantTable GstJpegQuantTable; -typedef struct _GstJpegQuantTables GstJpegQuantTables; -typedef struct _GstJpegHuffmanTable GstJpegHuffmanTable; -typedef struct _GstJpegHuffmanTables GstJpegHuffmanTables; -typedef struct _GstJpegScanComponent GstJpegScanComponent; -typedef struct _GstJpegScanHdr GstJpegScanHdr; -typedef struct _GstJpegFrameComponent GstJpegFrameComponent; -typedef struct _GstJpegFrameHdr GstJpegFrameHdr; -typedef struct _GstJpegSegment GstJpegSegment; - -/** - * GstJpegMarker: - * @GST_JPEG_MARKER_SOF0: Start of frame marker code (Baseline) - * @GST_JPEG_MARKER_SOF1: Start of frame marker code (Extended Sequential, Huffman) - * @GST_JPEG_MARKER_SOF2: Start of frame marker code (Progressive, Huffman) - * @GST_JPEG_MARKER_SOF3: Start of frame marker code (Lossless, Huffman) - * @GST_JPEG_MARKER_SOF5: Start of frame marker code (Differential Sequential, Huffman) - * @GST_JPEG_MARKER_SOF6: Start of frame marker code (Differential Progressive, Huffman) - * @GST_JPEG_MARKER_SOF7: Start of frame marker code (Differential Lossless, Huffman) - * @GST_JPEG_MARKER_SOF9: Start of frame marker code (Extended Sequential, Arithmetic) - * @GST_JPEG_MARKER_SOF10: Start of frame marker code (Progressive, Arithmetic) - * @GST_JPEG_MARKER_SOF11: Start of frame marker code (Lossless, Arithmetic) - * @GST_JPEG_MARKER_SOF13: Start of frame marker code (Differential Sequential, Arithmetic) - * @GST_JPEG_MARKER_SOF14: Start of frame marker code (Differential Progressive, Arithmetic) - * @GST_JPEG_MARKER_SOF15: Start of frame marker code (Differential Lossless, Arithmetic) - * @GST_JPEG_MARKER_DHT: Huffman table marker code - * @GST_JPEG_MARKER_DAC: Arithmetic coding marker code - * @GST_JPEG_MARKER_RST_MIN: Restart interval min marker code - * @GST_JPEG_MARKER_RST_MAX: Restart interval max marker code - * @GST_JPEG_MARKER_SOI: Start of image marker code - * @GST_JPEG_MARKER_EOI: End of image marker code - * @GST_JPEG_MARKER_SOS: Start of scan marker code - * @GST_JPEG_MARKER_DQT: Define quantization table marker code - * @GST_JPEG_MARKER_DNL: Define number of lines marker code - * @GST_JPEG_MARKER_DRI: Define restart interval marker code - * @GST_JPEG_MARKER_APP0: Application segment 0 marker code - * @GST_JPEG_MARKER_APP1: Application segment 1 marker code - * @GST_JPEG_MARKER_APP2: Application segment 2 marker code - * @GST_JPEG_MARKER_APP3: Application segment 3 marker code - * @GST_JPEG_MARKER_APP4: Application segment 4 marker code - * @GST_JPEG_MARKER_APP5: Application segment 5 marker code - * @GST_JPEG_MARKER_APP6: Application segment 6 marker code - * @GST_JPEG_MARKER_APP7: Application segment 7 marker code - * @GST_JPEG_MARKER_APP8: Application segment 8 marker code - * @GST_JPEG_MARKER_APP9: Application segment 9 marker code - * @GST_JPEG_MARKER_APP10: Application segment 10 marker code - * @GST_JPEG_MARKER_APP11: Application segment 11 marker code - * @GST_JPEG_MARKER_APP12: Application segment 12 marker code - * @GST_JPEG_MARKER_APP13: Application segment 13 marker code - * @GST_JPEG_MARKER_APP14: Application segment 14 marker code - * @GST_JPEG_MARKER_APP15: Application segment 15 marker code - * @GST_JPEG_MARKER_COM: Comment marker code - * - * Indicates the type of JPEG segment. - * - * Since: 1.6 - */ -typedef enum { - GST_JPEG_MARKER_SOF0 = 0xC0, - GST_JPEG_MARKER_SOF1 = 0xC1, - GST_JPEG_MARKER_SOF2 = 0xC2, - GST_JPEG_MARKER_SOF3 = 0xC3, - /* 0xC4 = DHT see below */ - GST_JPEG_MARKER_SOF5 = 0xC5, - GST_JPEG_MARKER_SOF6 = 0xC6, - GST_JPEG_MARKER_SOF7 = 0xC7, - /* 0xC8 = reserved */ - GST_JPEG_MARKER_SOF9 = 0xC9, - GST_JPEG_MARKER_SOF10 = 0xCA, - GST_JPEG_MARKER_SOF11 = 0xCB, - /* 0xCC = DAC see below */ - GST_JPEG_MARKER_SOF13 = 0xCD, - GST_JPEG_MARKER_SOF14 = 0xCE, - GST_JPEG_MARKER_SOF15 = 0xCF, - GST_JPEG_MARKER_DHT = 0xC4, - GST_JPEG_MARKER_DAC = 0xCC, - GST_JPEG_MARKER_RST0 = 0xD0, - GST_JPEG_MARKER_RST1 = 0xD1, - GST_JPEG_MARKER_RST2 = 0xD2, - GST_JPEG_MARKER_RST3 = 0xD3, - GST_JPEG_MARKER_RST4 = 0xD4, - GST_JPEG_MARKER_RST5 = 0xD5, - GST_JPEG_MARKER_RST6 = 0xD6, - GST_JPEG_MARKER_RST7 = 0xD7, - GST_JPEG_MARKER_SOI = 0xD8, - GST_JPEG_MARKER_EOI = 0xD9, - GST_JPEG_MARKER_SOS = 0xDA, - GST_JPEG_MARKER_DQT = 0xDB, - GST_JPEG_MARKER_DNL = 0xDC, - GST_JPEG_MARKER_DRI = 0xDD, - GST_JPEG_MARKER_APP0 = 0xE0, - GST_JPEG_MARKER_APP1 = 0xE1, - GST_JPEG_MARKER_APP2 = 0xE2, - GST_JPEG_MARKER_APP3 = 0xE3, - GST_JPEG_MARKER_APP4 = 0xE4, - GST_JPEG_MARKER_APP5 = 0xE5, - GST_JPEG_MARKER_APP6 = 0xE6, - GST_JPEG_MARKER_APP7 = 0xE7, - GST_JPEG_MARKER_APP8 = 0xE8, - GST_JPEG_MARKER_APP9 = 0xE9, - GST_JPEG_MARKER_APP10 = 0xEA, - GST_JPEG_MARKER_APP11 = 0xEB, - GST_JPEG_MARKER_APP12 = 0xEC, - GST_JPEG_MARKER_APP13 = 0xED, - GST_JPEG_MARKER_APP14 = 0xEE, - GST_JPEG_MARKER_APP15 = 0xEF, - GST_JPEG_MARKER_COM = 0xFE, -} GstJpegMarker; - -#define GST_JPEG_MARKER_SOF_MIN GST_JPEG_MARKER_SOF0 -#define GST_JPEG_MARKER_SOF_MAX GST_JPEG_MARKER_SOF15 - -#define GST_JPEG_MARKER_APP_MIN GST_JPEG_MARKER_APP0 -#define GST_JPEG_MARKER_APP_MAX GST_JPEG_MARKER_APP15 - -#define GST_JPEG_MARKER_RST_MIN GST_JPEG_MARKER_RST0 -#define GST_JPEG_MARKER_RST_MAX GST_JPEG_MARKER_RST7 - -/** - * GstJpegProfile: - * @GST_JPEG_PROFILE_BASELINE: Baseline DCT - * @GST_JPEG_PROFILE_EXTENDED: Extended sequential DCT - * @GST_JPEG_PROFILE_PROGRESSIVE: Progressive DCT - * @GST_JPEG_PROFILE_LOSSLESS: Lossless (sequential) - * - * JPEG encoding processes. - * - * Since: 1.6 - */ -typedef enum { - GST_JPEG_PROFILE_BASELINE = 0x00, - GST_JPEG_PROFILE_EXTENDED = 0x01, - GST_JPEG_PROFILE_PROGRESSIVE = 0x02, - GST_JPEG_PROFILE_LOSSLESS = 0x03, -} GstJpegProfile; - -/** - * GstJpegEntropyCodingMode: - * @GST_JPEG_ENTROPY_CODING_HUFFMAN: Huffman coding - * @GST_JPEG_ENTROPY_CODING_ARITHMETIC: arithmetic coding - * - * JPEG entropy coding mode. - * - * Since: 1.6 - */ -typedef enum { - GST_JPEG_ENTROPY_CODING_HUFFMAN = 0x00, - GST_JPEG_ENTROPY_CODING_ARITHMETIC = 0x08 -} GstJpegEntropyCodingMode; - -/** - * GstJpegQuantTable: - * @quant_precision: Quantization table element precision (Pq) - * @quant_table: Quantization table elements (Qk) - * @valid: If the quantization table is valid, which means it has - * already been parsed - * - * Quantization table. - * - * Since: 1.6 - */ -struct _GstJpegQuantTable -{ - guint8 quant_precision; - guint16 quant_table[GST_JPEG_MAX_QUANT_ELEMENTS]; - gboolean valid; -}; - -/** - * GstJpegQuantTables: - * @quant_tables: All quantization tables - * - * Helper data structure that holds all quantization tables used to - * decode an image. - * - * Since: 1.6 - */ -struct _GstJpegQuantTables -{ - GstJpegQuantTable quant_tables[GST_JPEG_MAX_SCAN_COMPONENTS]; -}; - -/** - * GstJpegHuffmanTable: - * @huf_bits: Number of Huffman codes of length i + 1 (Li) - * @huf_vales: Value associated with each Huffman code (Vij) - * @valid: If the Huffman table is valid, which means it has already - * been parsed - * - * Huffman table. - * - * Since: 1.6 - */ -struct _GstJpegHuffmanTable -{ - guint8 huf_bits[16]; - guint8 huf_values[256]; - gboolean valid; -}; - -/** - * GstJpegHuffmanTables: - * @dc_tables: DC Huffman tables - * @ac_tables: AC Huffman tables - * - * Helper data structure that holds all AC/DC Huffman tables used to - * decode an image. - * - * Since: 1.6 - */ -struct _GstJpegHuffmanTables -{ - GstJpegHuffmanTable dc_tables[GST_JPEG_MAX_SCAN_COMPONENTS]; - GstJpegHuffmanTable ac_tables[GST_JPEG_MAX_SCAN_COMPONENTS]; -}; - -/** - * GstJpegScanComponent: - * @component_selector: Scan component selector (Csj) - * @dc_selector: DC entropy coding table destination selector (Tdj) - * @ac_selector: AC entropy coding table destination selector (Taj) - - * Component-specification parameters. - * - * Since: 1.6 - */ -struct _GstJpegScanComponent -{ - guint8 component_selector; /* 0 .. 255 */ - guint8 dc_selector; /* 0 .. 3 */ - guint8 ac_selector; /* 0 .. 3 */ -}; - -/** - * GstJpegScanHdr: - * @num_components: Number of image components in scan (Ns) - * @components: Image components - * - * Scan header. - * - * Since: 1.6 - */ -struct _GstJpegScanHdr -{ - guint8 num_components; /* 1 .. 4 */ - GstJpegScanComponent components[GST_JPEG_MAX_SCAN_COMPONENTS]; - - /*< private >*/ - guint8 _reserved1; /* Ss */ - guint8 _reserved2; /* Se */ - guint8 _reserved3; /* Al */ - guint8 _reserved4; /* Ah */ -}; - -/** - * GstJpegFrameComponent: - * @identifier: Component identifier (Ci) - * @horizontal_factor: Horizontal sampling factor (Hi) - * @vertical_factor: Vertical sampling factor (Vi) - * @quant_table_selector: Quantization table destination selector (Tqi) - * - * Component-specification parameters. - * - * Since: 1.6 - */ -struct _GstJpegFrameComponent -{ - guint8 identifier; /* 0 .. 255 */ - guint8 horizontal_factor; /* 1 .. 4 */ - guint8 vertical_factor; /* 1 .. 4 */ - guint8 quant_table_selector; /* 0 .. 3 */ -}; - -/** - * GstJpegFrameHdr: - * @sample_precision: Sample precision (P) - * @height: Number of lines (Y) - * @width: Number of samples per line (X) - * @num_components: Number of image components in frame (Nf) - * @components: Image components - * @restart_interval: Number of MCU in the restart interval (Ri) - * - * Frame header. - * - * Since: 1.6 - */ -struct _GstJpegFrameHdr -{ - guint8 sample_precision; /* 2 .. 16 */ - guint16 width; /* 1 .. 65535 */ - guint16 height; /* 0 .. 65535 */ - guint8 num_components; /* 1 .. 255 */ - GstJpegFrameComponent components[GST_JPEG_MAX_FRAME_COMPONENTS]; -}; - -/** - * GstJpegSegment: - * @marker: The type of the segment that starts at @offset - * @data: the data containing the jpeg segment starting at @offset - * @offset: The offset to the segment start in bytes. This is the - * exact start of the segment, no marker code included - * @size: The size of the segment in bytes, or -1 if the end was not - * found. It is the exact size of the segment, without the sync byte and - * marker code but including any length bytes. - * - * A structure that contains the type of a segment, its offset and its size. - * - * Since: 1.6 - */ -struct _GstJpegSegment -{ - GstJpegMarker marker; - const guint8 *data; - guint offset; - gssize size; -}; - -gboolean gst_jpeg_parse (GstJpegSegment * seg, - const guint8 * data, - gsize size, - guint offset); - -gboolean gst_jpeg_segment_parse_frame_header (const GstJpegSegment * segment, - GstJpegFrameHdr * frame_hdr); - -gboolean gst_jpeg_segment_parse_scan_header (const GstJpegSegment * segment, - GstJpegScanHdr * scan_hdr); - -gboolean gst_jpeg_segment_parse_huffman_table (const GstJpegSegment * segment, - GstJpegHuffmanTables * huff_tables); - -gboolean gst_jpeg_segment_parse_restart_interval (const GstJpegSegment * segment, - guint * interval); - -gboolean gst_jpeg_segment_parse_quantization_table (const GstJpegSegment * segment, - GstJpegQuantTables * quant_tables); - -void gst_jpeg_get_default_quantization_tables (GstJpegQuantTables * quant_tables); - -void gst_jpeg_get_default_huffman_tables (GstJpegHuffmanTables * huff_tables); - -G_END_DECLS - -#endif /* GST_JPEG_PARSER_H */ diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstmpeg4parser.c gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstmpeg4parser.c --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstmpeg4parser.c 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstmpeg4parser.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1750 +0,0 @@ -/* Gstreamer - * Copyright (C) <2011> Intel - * Copyright (C) <2011> Collabora Ltd. - * Copyright (C) <2011> Thibault Saunier - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -/** - * SECTION:gstmpeg4parser - * @short_description: Convenience library for parsing mpeg4 part 2 video - * bitstream. - * - * For more details about the structures, you can refer to the - * specifications: ISO-IEC-14496-2_2004_MPEG4_VISUAL.pdf - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - - -#include "gstmpeg4parser.h" -#include "parserutils.h" - -#ifndef GST_DISABLE_GST_DEBUG - -#define GST_CAT_DEFAULT ensure_debug_category() - -static GstDebugCategory * -ensure_debug_category (void) -{ - static gsize cat_gonce = 0; - - if (g_once_init_enter (&cat_gonce)) { - gsize cat_done; - - cat_done = (gsize) _gst_debug_category_new ("codecparsers_mpeg4", 0, - "GstMpeg4 codec parsing library"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} - -#else - -#define ensure_debug_category() /* NOOP */ - -#endif /* GST_DISABLE_GST_DEBUG */ - -#define CHECK_MARKER(br) G_STMT_START { \ - guint8 marker;\ - if (!gst_bit_reader_get_bits_uint8 (br, &marker, 1)) { \ - GST_WARNING ("failed to read marker bit"); \ - goto failed; \ - } else if (!marker) {\ - GST_WARNING ("Wrong marker bit"); \ - goto failed;\ - }\ -} G_STMT_END - -#define MARKER_UNCHECKED(br) G_STMT_START { \ - if (!gst_bit_reader_get_bits_uint8_unchecked (br, 1)) { \ - GST_WARNING ("Wrong marker bit"); \ - goto failed; \ - } \ -} G_STMT_END - -#define CHECK_REMAINING(br, needed) G_STMT_START { \ - if (gst_bit_reader_get_remaining (br) < needed) \ - goto failed; \ -} G_STMT_END - -static const guint8 default_intra_quant_mat[64] = { - 8, 17, 18, 19, 21, 23, 25, 27, - 17, 18, 19, 21, 23, 25, 27, 28, - 20, 21, 22, 23, 24, 26, 28, 30, - 21, 22, 23, 24, 26, 28, 30, 32, - 22, 23, 24, 26, 28, 30, 32, 35, - 23, 24, 26, 28, 30, 32, 35, 38, - 25, 26, 28, 30, 32, 35, 38, 41, - 27, 28, 30, 32, 35, 38, 41, 45 -}; - -static const guint8 default_non_intra_quant_mat[64] = { - 16, 17, 18, 19, 20, 21, 22, 23, - 17, 18, 19, 20, 21, 22, 23, 24, - 18, 19, 20, 21, 22, 23, 24, 25, - 19, 20, 21, 22, 23, 24, 26, 27, - 20, 21, 22, 23, 25, 26, 27, 28, - 21, 22, 23, 24, 26, 27, 28, 30, - 22, 23, 24, 26, 27, 28, 30, 31, - 23, 24, 25, 27, 28, 30, 31, 33, -}; - -static const guint8 mpeg4_zigzag_8x8[64] = { - 0, 1, 8, 16, 9, 2, 3, 10, - 17, 24, 32, 25, 18, 11, 4, 5, - 12, 19, 26, 33, 40, 48, 41, 34, - 27, 20, 13, 6, 7, 14, 21, 28, - 35, 42, 49, 56, 57, 50, 43, 36, - 29, 22, 15, 23, 30, 37, 44, 51, - 58, 59, 52, 45, 38, 31, 39, 46, - 53, 60, 61, 54, 47, 55, 62, 63 -}; - -static const VLCTable mpeg4_dmv_size_vlc_table[] = { - {0, 0x00, 2}, - {1, 0x02, 3}, - {2, 0x03, 3}, - {3, 0x04, 3}, - {4, 0x05, 3}, - {5, 0x06, 3}, - {6, 0x0e, 4}, - {7, 0x1e, 5}, - {8, 0x3e, 6}, - {9, 0x7e, 7}, - {10, 0xfe, 8}, - {11, 0x1fe, 9}, - {12, 0x3fe, 10}, - {13, 0x7fe, 11}, - {14, 0xffe, 12} -}; - -static void -mpeg4_util_par_from_info (guint8 aspect_ratio_info, guint8 * par_width, - guint8 * par_height) -{ - switch (aspect_ratio_info) { - case 0x02: - *par_width = 12; - *par_height = 11; - break; - case 0x03: - *par_width = 10; - *par_height = 11; - break; - case 0x04: - *par_width = 16; - *par_height = 11; - break; - case 0x05: - *par_width = 40; - *par_height = 33; - break; - - case 0x01: - default: - *par_width = 1; - *par_height = 1; - } -} - -static gboolean -parse_quant (GstBitReader * br, guint8 quant_mat[64], - const guint8 default_quant_mat[64], guint8 * load_quant_mat) -{ - READ_UINT8 (br, *load_quant_mat, 1); - if (*load_quant_mat) { - guint i; - guint8 val; - - val = 1; - for (i = 0; i < 64; i++) { - - if (val != 0) - READ_UINT8 (br, val, 8); - - if (val == 0) { - if (i == 0) - goto invalid_quant_mat; - quant_mat[mpeg4_zigzag_8x8[i]] = quant_mat[mpeg4_zigzag_8x8[i - 1]]; - } else - quant_mat[mpeg4_zigzag_8x8[i]] = val; - } - } else - memcpy (quant_mat, default_quant_mat, 64); - - return TRUE; - -failed: - GST_WARNING ("failed parsing quant matrix"); - return FALSE; - -invalid_quant_mat: - GST_WARNING ("the first value should be non zero"); - goto failed; -} - -static gboolean -parse_signal_type (GstBitReader * br, GstMpeg4VideoSignalType * signal_type) -{ - READ_UINT8 (br, signal_type->type, 1); - - if (signal_type->type) { - - READ_UINT8 (br, signal_type->format, 3); - READ_UINT8 (br, signal_type->range, 1); - READ_UINT8 (br, signal_type->color_description, 1); - - if (signal_type->color_description) { - READ_UINT8 (br, signal_type->color_primaries, 8); - READ_UINT8 (br, signal_type->transfer_characteristics, 8); - READ_UINT8 (br, signal_type->matrix_coefficients, 8); - } - } - - return TRUE; - -failed: - GST_WARNING ("failed parsing \"Video Signal Type\""); - - return FALSE; -} - -static gboolean -parse_sprite_trajectory (GstBitReader * br, - GstMpeg4SpriteTrajectory * sprite_traj, guint no_of_sprite_warping_points) -{ - guint i, length; - - for (i = 0; i < no_of_sprite_warping_points; i++) { - - if (!decode_vlc (br, &length, mpeg4_dmv_size_vlc_table, - G_N_ELEMENTS (mpeg4_dmv_size_vlc_table))) - goto failed; - - if (length) - READ_UINT16 (br, sprite_traj->vop_ref_points[i], length); - CHECK_MARKER (br); - - if (!decode_vlc (br, &length, mpeg4_dmv_size_vlc_table, - G_N_ELEMENTS (mpeg4_dmv_size_vlc_table))) - goto failed; - - if (length) - READ_UINT16 (br, sprite_traj->sprite_ref_points[i], length); - CHECK_MARKER (br); - } - - return TRUE; - -failed: - GST_WARNING ("Could not parse the sprite trajectory"); - return FALSE; -} - -static guint -find_psc (GstByteReader * br) -{ - guint psc_pos = -1, psc; - - if (!gst_byte_reader_peek_uint24_be (br, &psc)) - goto failed; - - /* Scan for the picture start code (22 bits - 0x0020) */ - while ((gst_byte_reader_get_remaining (br) >= 3)) { - if (gst_byte_reader_peek_uint24_be (br, &psc) && - ((psc & 0xfffffc) == 0x000080)) { - psc_pos = gst_byte_reader_get_pos (br); - break; - } else - gst_byte_reader_skip_unchecked (br, 1); - } - -failed: - - return psc_pos; -} - -static inline guint8 -compute_resync_marker_size (const GstMpeg4VideoObjectPlane * vop, - guint32 * pattern, guint32 * mask) -{ - guint8 off; - - /* FIXME handle the binary only shape case */ - switch (vop->coding_type) { - case (GST_MPEG4_I_VOP): - off = 16; - break; - case (GST_MPEG4_S_VOP): - case (GST_MPEG4_P_VOP): - off = 15 + vop->fcode_forward; - - break; - case (GST_MPEG4_B_VOP): - off = MAX (15 + MAX (vop->fcode_forward, vop->fcode_backward), 17); - - break; - default: - return -1; - } - - if (mask && pattern) { - switch (off) { - case 16: - *pattern = 0x00008000; - *mask = 0xffff8000; - break; - case 17: - *pattern = 0x00004000; - *mask = 0xffffc000; - break; - case 18: - *pattern = 0x00002000; - *mask = 0xffffe000; - break; - case 19: - *pattern = 0x00001000; - *mask = 0xfffff000; - break; - case 20: - *pattern = 0x00000800; - *mask = 0xfffff800; - break; - case 21: - *pattern = 0x00000400; - *mask = 0xfffffc00; - break; - case 22: - *pattern = 0x00000200; - *mask = 0xfffffe00; - break; - case 23: - *pattern = 0x00000100; - *mask = 0xffffff00; - break; - } - } - - return off + 1; /* Take the following 1 into account */ -} - -/** - * gst_mpeg4_next_resync: - * @packet: The #GstMpeg4Packet to fill - * @vop: The previously parsed #GstMpeg4VideoObjectPlane - * @offset: offset from which to start the parsing - * @data: The data to parse - * @size: The size of the @data to parse - * - * Parses @data and fills @packet with the information of the next resync packet - * found. - * - * Returns: a #GstMpeg4ParseResult - */ -static GstMpeg4ParseResult -gst_mpeg4_next_resync (GstMpeg4Packet * packet, - const GstMpeg4VideoObjectPlane * vop, const guint8 * data, gsize size, - gboolean first_resync_marker) -{ - guint markersize = 0, off1, off2; - guint32 mask = 0xff, pattern = 0xff; - GstByteReader br; - - gst_byte_reader_init (&br, data, size); - - g_return_val_if_fail (packet != NULL, GST_MPEG4_PARSER_ERROR); - g_return_val_if_fail (vop != NULL, GST_MPEG4_PARSER_ERROR); - - markersize = compute_resync_marker_size (vop, &pattern, &mask); - - if (first_resync_marker) { - off1 = 0; - } else { - off1 = gst_byte_reader_masked_scan_uint32 (&br, mask, pattern, 0, size); - } - - if (off1 == -1) - return GST_MPEG4_PARSER_NO_PACKET; - - GST_DEBUG ("Resync code found at %i", off1); - - packet->offset = off1; - packet->type = GST_MPEG4_RESYNC; - packet->marker_size = markersize; - - off2 = gst_byte_reader_masked_scan_uint32 (&br, mask, pattern, - off1 + 2, size - off1 - 2); - - if (off2 == -1) - return GST_MPEG4_PARSER_NO_PACKET_END; - - packet->size = off2 - off1; - - return GST_MPEG4_PARSER_OK; -} - - -/********** API **********/ - -/** - * gst_mpeg4_parse: - * @packet: The #GstMpeg4Packet to fill - * @skip_user_data: %TRUE to skip user data packet %FALSE otherwize - * @vop: The last parsed #GstMpeg4VideoObjectPlane or %NULL if you do - * not need to detect the resync codes. - * @offset: offset from which to start the parsing - * @data: The data to parse - * @size: The size of the @data to parse - * - * Parses @data and fills @packet with the information of the next packet - * found. - * - * Returns: a #GstMpeg4ParseResult - */ -GstMpeg4ParseResult -gst_mpeg4_parse (GstMpeg4Packet * packet, gboolean skip_user_data, - GstMpeg4VideoObjectPlane * vop, const guint8 * data, guint offset, - gsize size) -{ - gint off1, off2; - GstByteReader br; - GstMpeg4ParseResult resync_res; - static guint first_resync_marker = TRUE; - - gst_byte_reader_init (&br, data, size); - - g_return_val_if_fail (packet != NULL, GST_MPEG4_PARSER_ERROR); - - if (size - offset <= 4) { - GST_DEBUG ("Can't parse, buffer is to small size %" G_GSIZE_FORMAT - " at offset %d", size, offset); - return GST_MPEG4_PARSER_ERROR; - } - - if (vop) { - resync_res = - gst_mpeg4_next_resync (packet, vop, data + offset, size - offset, - first_resync_marker); - first_resync_marker = FALSE; - - /* We found a complet slice */ - if (resync_res == GST_MPEG4_PARSER_OK) - return resync_res; - else if (resync_res == GST_MPEG4_PARSER_NO_PACKET_END) { - /* It doesn't mean there is no standard packet end, look for it */ - off1 = packet->offset; - goto find_end; - } else if (resync_res == GST_MPEG4_PARSER_NO_PACKET) - return resync_res; - } else { - first_resync_marker = TRUE; - } - - off1 = gst_byte_reader_masked_scan_uint32 (&br, 0xffffff00, 0x00000100, - offset, size - offset); - - if (off1 == -1) { - GST_DEBUG ("No start code prefix in this buffer"); - return GST_MPEG4_PARSER_NO_PACKET; - } - - /* Recursively skip user data if needed */ - if (skip_user_data && data[off1 + 3] == GST_MPEG4_USER_DATA) - /* If we are here, we know no resync code has been found the first time, so we - * don't look for it this time */ - return gst_mpeg4_parse (packet, skip_user_data, NULL, data, off1 + 3, size); - - packet->offset = off1 + 3; - packet->data = data; - packet->type = (GstMpeg4StartCode) (data[off1 + 3]); - -find_end: - off2 = gst_byte_reader_masked_scan_uint32 (&br, 0xffffff00, 0x00000100, - off1 + 4, size - off1 - 4); - - if (off2 == -1) { - GST_DEBUG ("Packet start %d, No end found", off1 + 4); - - packet->size = G_MAXUINT; - return GST_MPEG4_PARSER_NO_PACKET_END; - } - - if (packet->type == GST_MPEG4_RESYNC) { - packet->size = (gsize) off2 - off1; - } else { - packet->size = (gsize) off2 - off1 - 3; - } - - GST_DEBUG ("Complete packet of type %x found at: %d, Size: %" G_GSIZE_FORMAT, - packet->type, packet->offset, packet->size); - return GST_MPEG4_PARSER_OK; - -} - -/** - * gst_h263_parse: - * @packet: The #GstMpeg4Packet to fill - * @offset: offset from which to start the parsing - * @data: The data to parse - * @size: The size of the @data to parse - * - * Parses @data and fills @packet with the information of the next packet - * found. - * - * Note that the type of the packet is meaningless in this case. - * - * Returns: a #GstMpeg4ParseResult - */ -GstMpeg4ParseResult -gst_h263_parse (GstMpeg4Packet * packet, - const guint8 * data, guint offset, gsize size) -{ - gint off1, off2; - GstByteReader br; - - gst_byte_reader_init (&br, data + offset, size - offset); - - g_return_val_if_fail (packet != NULL, GST_MPEG4_PARSER_ERROR); - - if (size - offset < 3) { - GST_DEBUG ("Can't parse, buffer is to small size %" G_GSIZE_FORMAT - " at offset %d", size, offset); - return GST_MPEG4_PARSER_ERROR; - } - - off1 = find_psc (&br); - - if (off1 == -1) { - GST_DEBUG ("No start code prefix in this buffer"); - return GST_MPEG4_PARSER_NO_PACKET; - } - - packet->offset = off1 + offset; - packet->data = data; - - gst_byte_reader_skip_unchecked (&br, 3); - off2 = find_psc (&br); - - if (off2 == -1) { - GST_DEBUG ("Packet start %d, No end found", off1); - - packet->size = G_MAXUINT; - return GST_MPEG4_PARSER_NO_PACKET_END; - } - - packet->size = (gsize) off2 - off1; - - GST_DEBUG ("Complete packet found at: %d, Size: %" G_GSIZE_FORMAT, - packet->offset, packet->size); - - return GST_MPEG4_PARSER_OK; -} - -/** - * gst_mpeg4_parse_visual_object_sequence: - * @vos: The #GstMpeg4VisualObjectSequence structure to fill - * @data: The data to parse, should contain the visual_object_sequence_start_code - * but not the start code prefix - * @size: The size of the @data to parse - * - * Parses @data containing the visual object sequence packet, and fills - * the @vos structure. - * - * Returns: a #GstMpeg4ParseResult - */ -GstMpeg4ParseResult -gst_mpeg4_parse_visual_object_sequence (GstMpeg4VisualObjectSequence * vos, - const guint8 * data, gsize size) -{ - guint8 vos_start_code; - GstBitReader br = GST_BIT_READER_INIT (data, size); - - g_return_val_if_fail (vos != NULL, GST_MPEG4_PARSER_ERROR); - - READ_UINT8 (&br, vos_start_code, 8); - if (vos_start_code != GST_MPEG4_VISUAL_OBJ_SEQ_START) - goto wrong_start_code; - - READ_UINT8 (&br, vos->profile_and_level_indication, 8); - - switch (vos->profile_and_level_indication) { - case 0x01: - vos->profile = GST_MPEG4_PROFILE_SIMPLE; - vos->level = GST_MPEG4_LEVEL1; - break; - case 0x02: - vos->profile = GST_MPEG4_PROFILE_SIMPLE; - vos->level = GST_MPEG4_LEVEL2; - break; - case 0x03: - vos->profile = GST_MPEG4_PROFILE_SIMPLE; - vos->level = GST_MPEG4_LEVEL3; - break; - case 0x08: - vos->profile = GST_MPEG4_PROFILE_SIMPLE; - vos->level = GST_MPEG4_LEVEL0; - break; - case 0x10: - vos->profile = GST_MPEG4_PROFILE_SIMPLE_SCALABLE; - vos->level = GST_MPEG4_LEVEL0; - break; - case 0x11: - vos->profile = GST_MPEG4_PROFILE_SIMPLE_SCALABLE; - vos->level = GST_MPEG4_LEVEL1; - break; - case 0x12: - vos->profile = GST_MPEG4_PROFILE_SIMPLE_SCALABLE; - vos->level = GST_MPEG4_LEVEL2; - break; - case 0x21: - vos->profile = GST_MPEG4_PROFILE_CORE; - vos->level = GST_MPEG4_LEVEL1; - break; - case 0x22: - vos->profile = GST_MPEG4_PROFILE_CORE; - vos->level = GST_MPEG4_LEVEL2; - break; - case 0x32: - vos->profile = GST_MPEG4_PROFILE_MAIN; - vos->level = GST_MPEG4_LEVEL2; - break; - case 0x33: - vos->profile = GST_MPEG4_PROFILE_MAIN; - vos->level = GST_MPEG4_LEVEL3; - break; - case 0x34: - vos->profile = GST_MPEG4_PROFILE_MAIN; - vos->level = GST_MPEG4_LEVEL4; - break; - case 0x42: - vos->profile = GST_MPEG4_PROFILE_N_BIT; - vos->level = GST_MPEG4_LEVEL2; - break; - case 0x51: - vos->profile = GST_MPEG4_PROFILE_SCALABLE_TEXTURE; - vos->level = GST_MPEG4_LEVEL1; - break; - case 0x61: - vos->profile = GST_MPEG4_PROFILE_SIMPLE_FACE_ANIMATION; - vos->level = GST_MPEG4_LEVEL1; - break; - case 0x62: - vos->profile = GST_MPEG4_PROFILE_SIMPLE_FACE_ANIMATION; - vos->level = GST_MPEG4_LEVEL2; - break; - case 0x63: - vos->profile = GST_MPEG4_PROFILE_SIMPLE_FBA; - vos->level = GST_MPEG4_LEVEL1; - break; - case 0x64: - vos->profile = GST_MPEG4_PROFILE_SIMPLE_FBA; - vos->level = GST_MPEG4_LEVEL2; - break; - case 0x71: - vos->profile = GST_MPEG4_PROFILE_BASIC_ANIMATED_TEXTURE; - vos->level = GST_MPEG4_LEVEL1; - break; - case 0x72: - vos->profile = GST_MPEG4_PROFILE_BASIC_ANIMATED_TEXTURE; - vos->level = GST_MPEG4_LEVEL2; - break; - case 0x81: - vos->profile = GST_MPEG4_PROFILE_HYBRID; - vos->level = GST_MPEG4_LEVEL1; - break; - case 0x82: - vos->profile = GST_MPEG4_PROFILE_HYBRID; - vos->level = GST_MPEG4_LEVEL2; - break; - case 0x91: - vos->profile = GST_MPEG4_PROFILE_ADVANCED_REALTIME_SIMPLE; - vos->level = GST_MPEG4_LEVEL1; - break; - case 0x92: - vos->profile = GST_MPEG4_PROFILE_ADVANCED_REALTIME_SIMPLE; - vos->level = GST_MPEG4_LEVEL2; - break; - case 0x93: - vos->profile = GST_MPEG4_PROFILE_ADVANCED_REALTIME_SIMPLE; - vos->level = GST_MPEG4_LEVEL3; - break; - case 0x94: - vos->profile = GST_MPEG4_PROFILE_ADVANCED_REALTIME_SIMPLE; - vos->level = GST_MPEG4_LEVEL4; - break; - case 0xa1: - vos->profile = GST_MPEG4_PROFILE_CORE_SCALABLE; - vos->level = GST_MPEG4_LEVEL1; - break; - case 0xa2: - vos->profile = GST_MPEG4_PROFILE_CORE_SCALABLE; - vos->level = GST_MPEG4_LEVEL2; - break; - case 0xa3: - vos->profile = GST_MPEG4_PROFILE_CORE_SCALABLE; - vos->level = GST_MPEG4_LEVEL3; - break; - case 0xb1: - vos->profile = GST_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY; - vos->level = GST_MPEG4_LEVEL1; - break; - case 0xb2: - vos->profile = GST_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY; - vos->level = GST_MPEG4_LEVEL2; - break; - case 0xb3: - vos->profile = GST_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY; - vos->level = GST_MPEG4_LEVEL3; - break; - case 0xb4: - vos->profile = GST_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY; - vos->level = GST_MPEG4_LEVEL4; - break; - case 0xc1: - vos->profile = GST_MPEG4_PROFILE_ADVANCED_CORE; - vos->level = GST_MPEG4_LEVEL1; - break; - case 0xc2: - vos->profile = GST_MPEG4_PROFILE_ADVANCED_CORE; - vos->level = GST_MPEG4_LEVEL2; - break; - case 0xc3: - vos->profile = GST_MPEG4_PROFILE_ADVANCED_CORE; - vos->level = GST_MPEG4_LEVEL3; - break; - case 0xd1: - vos->profile = GST_MPEG4_PROFILE_ADVANCED_SCALABLE_TEXTURE; - vos->level = GST_MPEG4_LEVEL1; - break; - case 0xd2: - vos->profile = GST_MPEG4_PROFILE_ADVANCED_SCALABLE_TEXTURE; - vos->level = GST_MPEG4_LEVEL2; - break; - case 0xd3: - vos->profile = GST_MPEG4_PROFILE_ADVANCED_SCALABLE_TEXTURE; - vos->level = GST_MPEG4_LEVEL3; - break; - case 0xe1: - vos->profile = GST_MPEG4_PROFILE_SIMPLE_STUDIO; - vos->level = GST_MPEG4_LEVEL1; - break; - case 0xe2: - vos->profile = GST_MPEG4_PROFILE_SIMPLE_STUDIO; - vos->level = GST_MPEG4_LEVEL2; - break; - case 0xe3: - vos->profile = GST_MPEG4_PROFILE_SIMPLE_STUDIO; - vos->level = GST_MPEG4_LEVEL3; - break; - case 0xe4: - vos->profile = GST_MPEG4_PROFILE_SIMPLE_STUDIO; - vos->level = GST_MPEG4_LEVEL4; - break; - case 0xe5: - vos->profile = GST_MPEG4_PROFILE_CORE_STUDIO; - vos->level = GST_MPEG4_LEVEL1; - break; - case 0xe6: - vos->profile = GST_MPEG4_PROFILE_CORE_STUDIO; - vos->level = GST_MPEG4_LEVEL2; - break; - case 0xe7: - vos->profile = GST_MPEG4_PROFILE_CORE_STUDIO; - vos->level = GST_MPEG4_LEVEL3; - break; - case 0xe8: - vos->profile = GST_MPEG4_PROFILE_CORE_STUDIO; - vos->level = GST_MPEG4_LEVEL4; - break; - case 0xf0: - vos->profile = GST_MPEG4_PROFILE_ADVANCED_SIMPLE; - vos->level = GST_MPEG4_LEVEL0; - break; - case 0xf1: - vos->profile = GST_MPEG4_PROFILE_ADVANCED_SIMPLE; - vos->level = GST_MPEG4_LEVEL1; - break; - case 0xf2: - vos->profile = GST_MPEG4_PROFILE_ADVANCED_SIMPLE; - vos->level = GST_MPEG4_LEVEL2; - break; - case 0xf3: - vos->profile = GST_MPEG4_PROFILE_ADVANCED_SIMPLE; - vos->level = GST_MPEG4_LEVEL3; - break; - case 0xf4: - vos->profile = GST_MPEG4_PROFILE_ADVANCED_SIMPLE; - vos->level = GST_MPEG4_LEVEL4; - break; - case 0xf5: - vos->profile = GST_MPEG4_PROFILE_ADVANCED_SIMPLE; - vos->level = GST_MPEG4_LEVEL5; - break; - case 0xf7: - vos->profile = GST_MPEG4_PROFILE_ADVANCED_SIMPLE; - vos->level = GST_MPEG4_LEVEL3b; - break; - case 0xf8: - vos->profile = GST_MPEG4_PROFILE_FINE_GRANULARITY_SCALABLE; - vos->level = GST_MPEG4_LEVEL0; - break; - case 0xf9: - vos->profile = GST_MPEG4_PROFILE_FINE_GRANULARITY_SCALABLE; - vos->level = GST_MPEG4_LEVEL1; - break; - case 0xfa: - vos->profile = GST_MPEG4_PROFILE_FINE_GRANULARITY_SCALABLE; - vos->level = GST_MPEG4_LEVEL2; - break; - case 0xfb: - vos->profile = GST_MPEG4_PROFILE_FINE_GRANULARITY_SCALABLE; - vos->level = GST_MPEG4_LEVEL3; - break; - case 0xfc: - vos->profile = GST_MPEG4_PROFILE_FINE_GRANULARITY_SCALABLE; - vos->level = GST_MPEG4_LEVEL4; - break; - case 0xfd: - vos->profile = GST_MPEG4_PROFILE_FINE_GRANULARITY_SCALABLE; - vos->level = GST_MPEG4_LEVEL5; - break; - default: - vos->profile = GST_MPEG4_PROFILE_RESERVED; - vos->level = GST_MPEG4_LEVEL_RESERVED; - break; - } - - return GST_MPEG4_PARSER_OK; - -wrong_start_code: - GST_WARNING ("got buffer with wrong start code"); - return GST_MPEG4_PARSER_ERROR; - -failed: - GST_WARNING ("failed parsing \"Visual Object\""); - return GST_MPEG4_PARSER_ERROR; -} - -/** - * gst_mpeg4_parse_visual_object: - * @vo: The #GstMpeg4VisualObject structure to fill - * @signal_type: The #GstMpeg4VideoSignalType to fill or %NULL - * @data: The data to parse, should contain the vo_start_code - * but not the start code prefix - * @size: The size of the @data to parse - * - * Parses @data containing the visual object packet, and fills - * the @vo structure. - * - * Returns: a #GstMpeg4ParseResult - */ -GstMpeg4ParseResult -gst_mpeg4_parse_visual_object (GstMpeg4VisualObject * vo, - GstMpeg4VideoSignalType * signal_type, const guint8 * data, gsize size) -{ - guint8 vo_start_code, type; - GstBitReader br = GST_BIT_READER_INIT (data, size); - - g_return_val_if_fail (vo != NULL, GST_MPEG4_PARSER_ERROR); - - GST_DEBUG ("Parsing visual object"); - - READ_UINT8 (&br, vo_start_code, 8); - if (vo_start_code != GST_MPEG4_VISUAL_OBJ) - goto wrong_start_code; - - /* set default values */ - vo->verid = 0x1; - vo->priority = 1; - - READ_UINT8 (&br, vo->is_identifier, 1); - if (vo->is_identifier) { - READ_UINT8 (&br, vo->verid, 4); - READ_UINT8 (&br, vo->priority, 3); - } - - READ_UINT8 (&br, type, 4); - vo->type = type; - - if ((type == GST_MPEG4_VIDEO_ID || - type == GST_MPEG4_STILL_TEXTURE_ID) && signal_type) { - - if (!parse_signal_type (&br, signal_type)) - goto failed; - - } else if (signal_type) { - signal_type->type = 0; - } - - return GST_MPEG4_PARSER_OK; - -wrong_start_code: - GST_WARNING ("got buffer with wrong start code"); - return GST_MPEG4_PARSER_ERROR; - -failed: - GST_WARNING ("failed parsing \"Visual Object\""); - return GST_MPEG4_PARSER_ERROR; -} - -/** - * gst_mpeg4_parse_video_object_layer: - * @vol: The #GstMpeg4VideoObjectLayer structure to fill - * @vo: The #GstMpeg4VisualObject currently being parsed or %NULL - * @data: The data to parse - * @size: The size of the @data to parse - * - * Parses @data containing the video object layer packet, and fills - * the @vol structure. - * - * Returns: a #GstMpeg4ParseResult - */ -GstMpeg4ParseResult -gst_mpeg4_parse_video_object_layer (GstMpeg4VideoObjectLayer * vol, - GstMpeg4VisualObject * vo, const guint8 * data, gsize size) -{ - guint8 video_object_layer_start_code; - - /* Used for enums types */ - guint8 tmp; - GstBitReader br = GST_BIT_READER_INIT (data, size); - - g_return_val_if_fail (vol != NULL, GST_MPEG4_PARSER_ERROR); - - GST_DEBUG ("Parsing video object layer"); - - READ_UINT8 (&br, video_object_layer_start_code, 8); - if (!(video_object_layer_start_code >= GST_MPEG4_VIDEO_LAYER_FIRST && - video_object_layer_start_code <= GST_MPEG4_VIDEO_LAYER_LAST)) - goto wrong_start_code; - - /* set default values */ - if (vo) { - vol->verid = vo->verid; - vol->priority = vo->priority; - } else { - vol->verid = 1; - vol->priority = 0; - } - - vol->low_delay = FALSE; - vol->chroma_format = 1; - vol->vbv_parameters = FALSE; - vol->quant_precision = 5; - vol->bits_per_pixel = 8; - vol->quarter_sample = FALSE; - vol->newpred_enable = FALSE; - vol->interlaced = 0; - vol->width = 0; - vol->height = 0; - - READ_UINT8 (&br, vol->random_accessible_vol, 1); - READ_UINT8 (&br, vol->video_object_type_indication, 8); - - READ_UINT8 (&br, vol->is_object_layer_identifier, 1); - if (vol->is_object_layer_identifier) { - READ_UINT8 (&br, vol->verid, 4); - READ_UINT8 (&br, vol->priority, 3); - } - - READ_UINT8 (&br, tmp, 4); - vol->aspect_ratio_info = tmp; - if (vol->aspect_ratio_info != GST_MPEG4_EXTENDED_PAR) { - mpeg4_util_par_from_info (vol->aspect_ratio_info, &vol->par_width, - &vol->par_height); - - } else { - gint v; - - READ_UINT8 (&br, vol->par_width, 8); - v = vol->par_width; - CHECK_ALLOWED (v, 1, 255); - - READ_UINT8 (&br, vol->par_height, 8); - v = vol->par_height; - CHECK_ALLOWED (v, 1, 255); - } - GST_DEBUG ("Pixel aspect ratio %d/%d", vol->par_width, vol->par_width); - - READ_UINT8 (&br, vol->control_parameters, 1); - if (vol->control_parameters) { - guint8 chroma_format; - - READ_UINT8 (&br, chroma_format, 2); - vol->chroma_format = chroma_format; - READ_UINT8 (&br, vol->low_delay, 1); - - READ_UINT8 (&br, vol->vbv_parameters, 1); - if (vol->vbv_parameters) { - CHECK_REMAINING (&br, 79); - - vol->first_half_bitrate = - gst_bit_reader_get_bits_uint16_unchecked (&br, 15); - MARKER_UNCHECKED (&br); - - vol->latter_half_bitrate = - gst_bit_reader_get_bits_uint16_unchecked (&br, 15); - MARKER_UNCHECKED (&br); - - vol->bit_rate = - (vol->first_half_bitrate << 15) | vol->latter_half_bitrate; - - vol->first_half_vbv_buffer_size = - gst_bit_reader_get_bits_uint16_unchecked (&br, 15); - MARKER_UNCHECKED (&br); - - vol->latter_half_vbv_buffer_size = - gst_bit_reader_get_bits_uint8_unchecked (&br, 3); - - vol->vbv_buffer_size = (vol->first_half_vbv_buffer_size << 15) | - vol->latter_half_vbv_buffer_size; - - vol->first_half_vbv_occupancy = - gst_bit_reader_get_bits_uint16_unchecked (&br, 11); - MARKER_UNCHECKED (&br); - - vol->latter_half_vbv_occupancy = - gst_bit_reader_get_bits_uint16_unchecked (&br, 15); - MARKER_UNCHECKED (&br); - } - } - - READ_UINT8 (&br, tmp, 2); - vol->shape = tmp; - - if (vol->shape == GST_MPEG4_GRAYSCALE) { - /* TODO support grayscale shapes, for now we just pass */ - - /* Something the standard starts to define... */ - GST_WARNING ("Grayscale shaped not supported"); - goto failed; - } - - if (vol->shape == GST_MPEG4_GRAYSCALE && vol->verid != 0x01) - READ_UINT8 (&br, vol->shape_extension, 4); - - CHECK_REMAINING (&br, 19); - - MARKER_UNCHECKED (&br); - vol->vop_time_increment_resolution = - gst_bit_reader_get_bits_uint16_unchecked (&br, 16); - if (vol->vop_time_increment_resolution < 1) { - GST_WARNING ("value not in allowed range. value: %d, range %d-%d", - vol->vop_time_increment_resolution, 1, G_MAXUINT16); - goto failed; - } - vol->vop_time_increment_bits = - g_bit_storage (vol->vop_time_increment_resolution); - - MARKER_UNCHECKED (&br); - vol->fixed_vop_rate = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - if (vol->fixed_vop_rate) - READ_UINT16 (&br, vol->fixed_vop_time_increment, - vol->vop_time_increment_bits); - - if (vol->shape != GST_MPEG4_BINARY_ONLY) { - if (vol->shape == GST_MPEG4_RECTANGULAR) { - CHECK_REMAINING (&br, 29); - - MARKER_UNCHECKED (&br); - vol->width = gst_bit_reader_get_bits_uint16_unchecked (&br, 13); - MARKER_UNCHECKED (&br); - vol->height = gst_bit_reader_get_bits_uint16_unchecked (&br, 13); - MARKER_UNCHECKED (&br); - } - - READ_UINT8 (&br, vol->interlaced, 1); - READ_UINT8 (&br, vol->obmc_disable, 1); - - if (vol->verid == 0x1) - READ_UINT8 (&br, tmp, 1); - else - READ_UINT8 (&br, tmp, 2); - vol->sprite_enable = tmp; - - if (vol->sprite_enable == GST_MPEG4_SPRITE_STATIC || - vol->sprite_enable == GST_MPEG4_SPRITE_GMG) { - - if (vol->sprite_enable == GST_MPEG4_SPRITE_GMG) - CHECK_REMAINING (&br, 9); - else { - CHECK_REMAINING (&br, 65); - - vol->sprite_width = gst_bit_reader_get_bits_uint16_unchecked (&br, 13); - MARKER_UNCHECKED (&br); - - vol->sprite_height = gst_bit_reader_get_bits_uint16_unchecked (&br, 13); - MARKER_UNCHECKED (&br); - - vol->sprite_left_coordinate = - gst_bit_reader_get_bits_uint16_unchecked (&br, 13); - MARKER_UNCHECKED (&br); - - vol->sprite_top_coordinate = - gst_bit_reader_get_bits_uint16_unchecked (&br, 13); - MARKER_UNCHECKED (&br); - } - vol->no_of_sprite_warping_points = - gst_bit_reader_get_bits_uint8_unchecked (&br, 6); - vol->sprite_warping_accuracy = - gst_bit_reader_get_bits_uint8_unchecked (&br, 2); - vol->sprite_brightness_change = - gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - - if (vol->sprite_enable != GST_MPEG4_SPRITE_GMG) - vol->low_latency_sprite_enable = - gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - } - - if (vol->verid != 0x1 && vol->shape != GST_MPEG4_RECTANGULAR) - READ_UINT8 (&br, vol->sadct_disable, 1); - - READ_UINT8 (&br, vol->not_8_bit, 1); - if (vol->not_8_bit) { - READ_UINT8 (&br, vol->quant_precision, 4); - CHECK_ALLOWED (vol->quant_precision, 3, 9); - - READ_UINT8 (&br, vol->bits_per_pixel, 4); - CHECK_ALLOWED (vol->bits_per_pixel, 4, 12); - } - - if (vol->shape == GST_MPEG4_GRAYSCALE) { - /* We don't actually support it */ - READ_UINT8 (&br, vol->no_gray_quant_update, 1); - READ_UINT8 (&br, vol->composition_method, 1); - READ_UINT8 (&br, vol->linear_composition, 1); - } - - READ_UINT8 (&br, vol->quant_type, 1); - if (vol->quant_type) { - if (!parse_quant (&br, vol->intra_quant_mat, default_intra_quant_mat, - &vol->load_intra_quant_mat)) - goto failed; - - if (!parse_quant (&br, vol->non_intra_quant_mat, - default_non_intra_quant_mat, &vol->load_non_intra_quant_mat)) - goto failed; - - if (vol->shape == GST_MPEG4_GRAYSCALE) { - /* Something the standard starts to define... */ - GST_WARNING ("Grayscale shaped not supported"); - goto failed; - } - - } else { - memset (&vol->intra_quant_mat, 0, 64); - memset (&vol->non_intra_quant_mat, 0, 64); - } - - if (vol->verid != 0x1) - READ_UINT8 (&br, vol->quarter_sample, 1); - - READ_UINT8 (&br, vol->complexity_estimation_disable, 1); - if (!vol->complexity_estimation_disable) { - guint8 estimation_method; - guint8 estimation_disable; - - /* skip unneeded properties */ - READ_UINT8 (&br, estimation_method, 2); - if (estimation_method < 2) { - READ_UINT8 (&br, estimation_disable, 1); - if (!estimation_disable) - SKIP (&br, 6); - READ_UINT8 (&br, estimation_disable, 1); - if (!estimation_disable) - SKIP (&br, 4); - CHECK_MARKER (&br); - READ_UINT8 (&br, estimation_disable, 1); - if (!estimation_disable) - SKIP (&br, 4); - READ_UINT8 (&br, estimation_disable, 1); - if (!estimation_disable) - SKIP (&br, 6); - CHECK_MARKER (&br); - - if (estimation_method == 1) { - READ_UINT8 (&br, estimation_disable, 1); - if (!estimation_disable) - SKIP (&br, 2); - } - } - } - - READ_UINT8 (&br, vol->resync_marker_disable, 1); - READ_UINT8 (&br, vol->data_partitioned, 1); - - if (vol->data_partitioned) - READ_UINT8 (&br, vol->reversible_vlc, 1); - - if (vol->verid != 0x01) { - READ_UINT8 (&br, vol->newpred_enable, 1); - if (vol->newpred_enable) - /* requested_upstream_message_type and newpred_segment_type */ - SKIP (&br, 3); - - READ_UINT8 (&br, vol->reduced_resolution_vop_enable, 1); - } - - READ_UINT8 (&br, vol->scalability, 1); - if (vol->scalability) { - SKIP (&br, 26); /* Few not needed props */ - READ_UINT8 (&br, vol->enhancement_type, 1); - } - - /* More unused infos */ - } else if (vol->verid != 0x01) { - GST_WARNING ("Binary only shapes not fully supported"); - goto failed; - } - /* ... */ - - return GST_MPEG4_PARSER_OK; - -failed: - GST_WARNING ("failed parsing \"Video Object Layer\""); - return GST_MPEG4_PARSER_ERROR; - -wrong_start_code: - GST_WARNING ("got buffer with wrong start code"); - goto failed; -} - -/** - * gst_mpeg4_parse_group_of_vop: - * @gov: The #GstMpeg4GroupOfVOP structure to fill - * @data: The data to parse - * @size: The size of the @data to parse - * - * Parses @data containing the group of video object plane packet, and fills - * the @gov structure. - * - * Returns: a #GstMpeg4ParseResult - */ -GstMpeg4ParseResult -gst_mpeg4_parse_group_of_vop (GstMpeg4GroupOfVOP * - gov, const guint8 * data, gsize size) -{ - guint8 gov_start_code; - GstBitReader br = GST_BIT_READER_INIT (data, size); - - g_return_val_if_fail (gov != NULL, GST_MPEG4_PARSER_ERROR); - - READ_UINT8 (&br, gov_start_code, 8); - if (gov_start_code != GST_MPEG4_GROUP_OF_VOP) - goto wrong_start_code; - - CHECK_REMAINING (&br, 65); - - gov->hours = gst_bit_reader_get_bits_uint8_unchecked (&br, 5); - gov->minutes = gst_bit_reader_get_bits_uint8_unchecked (&br, 6); - /* marker bit */ - MARKER_UNCHECKED (&br); - gov->seconds = gst_bit_reader_get_bits_uint8_unchecked (&br, 6); - - gov->closed = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - gov->broken_link = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - - return GST_MPEG4_PARSER_OK; - -failed: - GST_WARNING ("failed parsing \"Group of Video Object Plane\""); - return GST_MPEG4_PARSER_ERROR; - -wrong_start_code: - GST_WARNING ("got buffer with wrong start code"); - goto failed; -} - -/** - * gst_mpeg4_parse_video_object_plane: - * @vop: The #GstMpeg4VideoObjectPlane currently being parsed - * @sprite_trajectory: A #GstMpeg4SpriteTrajectory to fill or %NULL - * @vol: The #GstMpeg4VideoObjectLayer structure to fill - * @data: The data to parse - * @size: The size of the @data to parse - * - * Parses @data containing the video object plane packet, and fills the @vol - * structure. - * - * Returns: a #GstMpeg4ParseResult - */ -GstMpeg4ParseResult -gst_mpeg4_parse_video_object_plane (GstMpeg4VideoObjectPlane * vop, - GstMpeg4SpriteTrajectory * sprite_trajectory, - GstMpeg4VideoObjectLayer * vol, const guint8 * data, gsize size) -{ - guint8 vop_start_code, coding_type, modulo_time_base; - GstBitReader br = GST_BIT_READER_INIT (data, size); - - g_return_val_if_fail (vop != NULL, GST_MPEG4_PARSER_ERROR); - - if (vol->shape == GST_MPEG4_BINARY_ONLY) { - /* TODO: implement binary only shapes */ - GST_WARNING ("Binary only shapes not supported"); - goto failed; - } - - READ_UINT8 (&br, vop_start_code, 8); - if (vop_start_code != GST_MPEG4_VIDEO_OBJ_PLANE) - goto wrong_start_code; - - - /* set default values */ - vop->modulo_time_base = 0; - vop->rounding_type = 0; - vop->top_field_first = 1; - vop->alternate_vertical_scan_flag = 0; - vop->fcode_forward = 1; - vop->fcode_backward = 1; - - /* Compute macroblock informations */ - if (vol->interlaced) - vop->mb_height = (2 * (vol->height + 31) / 32); - else - vop->mb_height = (vol->height + 15) / 16; - - vop->mb_width = (vol->width + 15) / 16; - vop->mb_num = vop->mb_height * vop->mb_width; - - READ_UINT8 (&br, coding_type, 2); - vop->coding_type = coding_type; - - READ_UINT8 (&br, modulo_time_base, 1); - while (modulo_time_base) { - vop->modulo_time_base++; - - READ_UINT8 (&br, modulo_time_base, 1); - } - - CHECK_REMAINING (&br, vol->vop_time_increment_bits + 3); - - MARKER_UNCHECKED (&br); - vop->time_increment = - gst_bit_reader_get_bits_uint16_unchecked (&br, - vol->vop_time_increment_bits); - MARKER_UNCHECKED (&br); - - vop->coded = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - if (!vop->coded) - return GST_MPEG4_PARSER_OK; - - if (vol->newpred_enable) { - guint16 nbbits = - vop->time_increment + 3 < 15 ? vop->time_increment + 3 : 15; - - READ_UINT16 (&br, vop->id, nbbits); - READ_UINT8 (&br, vop->id_for_prediction_indication, 1); - if (vop->id_for_prediction_indication) { - /* Would be nice if the standard actually told us... */ - READ_UINT16 (&br, vop->id, nbbits); - CHECK_MARKER (&br); - } - } - - if (vol->shape != GST_MPEG4_BINARY_ONLY && - (vop->coding_type == GST_MPEG4_P_VOP || - (vop->coding_type == GST_MPEG4_S_VOP && - vol->sprite_enable == GST_MPEG4_SPRITE_GMG))) - READ_UINT8 (&br, vop->rounding_type, 1); - - if ((vol->reduced_resolution_vop_enable) && - (vol->shape == GST_MPEG4_RECTANGULAR || - (vop->coding_type = GST_MPEG4_P_VOP || - vop->coding_type == GST_MPEG4_I_VOP))) - READ_UINT8 (&br, vop->reduced_resolution, 1); - - if (vol->shape != GST_MPEG4_RECTANGULAR) { - if (vol->sprite_enable == GST_MPEG4_SPRITE_STATIC && - vop->coding_type == GST_MPEG4_I_VOP) { - CHECK_REMAINING (&br, 55); - - vop->width = gst_bit_reader_get_bits_uint16_unchecked (&br, 13); - MARKER_UNCHECKED (&br); - - vop->height = gst_bit_reader_get_bits_uint16_unchecked (&br, 13); - MARKER_UNCHECKED (&br); - - vop->horizontal_mc_spatial_ref = - gst_bit_reader_get_bits_uint16_unchecked (&br, 13); - MARKER_UNCHECKED (&br); - - vop->vertical_mc_spatial_ref = - gst_bit_reader_get_bits_uint16_unchecked (&br, 13); - MARKER_UNCHECKED (&br); - - /* Recompute the Macroblock informations - * accordingly to the new values */ - if (vol->interlaced) - vop->mb_height = (2 * (vol->height + 31) / 32); - else - vop->mb_height = (vol->height + 15) / 16; - - vop->mb_width = (vol->width + 15) / 16; - vop->mb_num = vop->mb_height * vop->mb_width; - } - - if ((vol->shape != GST_MPEG4_BINARY_ONLY) && - vol->scalability && vol->enhancement_type) - READ_UINT8 (&br, vop->background_composition, 1); - - READ_UINT8 (&br, vop->change_conv_ratio_disable, 1); - - READ_UINT8 (&br, vop->constant_alpha, 1); - if (vop->constant_alpha) - READ_UINT8 (&br, vop->constant_alpha_value, 1); - } - - if (vol->shape != GST_MPEG4_BINARY_ONLY) { - if (!vol->complexity_estimation_disable) { - GST_WARNING ("Complexity estimation not supported"); - goto failed; - } - - READ_UINT8 (&br, vop->intra_dc_vlc_thr, 3); - - if (vol->interlaced) { - READ_UINT8 (&br, vop->top_field_first, 1); - READ_UINT8 (&br, vop->alternate_vertical_scan_flag, 1); - } - } - - if ((vol->sprite_enable == GST_MPEG4_SPRITE_STATIC || - vol->sprite_enable == GST_MPEG4_SPRITE_GMG) && - vop->coding_type == GST_MPEG4_S_VOP) { - - /* only if @sprite_trajectory is not NULL we parse it */ - if (sprite_trajectory && vol->no_of_sprite_warping_points) - parse_sprite_trajectory (&br, sprite_trajectory, - vol->no_of_sprite_warping_points); - - if (vol->sprite_brightness_change) { - GST_WARNING ("sprite_brightness_change not supported"); - goto failed; - } - - if (vol->sprite_enable == GST_MPEG4_SPRITE_STATIC) { - GST_WARNING ("sprite enable static not supported"); - goto failed; - } - } - - if (vol->shape != GST_MPEG4_BINARY_ONLY) { - READ_UINT16 (&br, vop->quant, vol->quant_precision); - - if (vol->shape == GST_MPEG4_GRAYSCALE) { - /* TODO implement grayscale support */ - GST_WARNING ("Grayscale shapes no supported"); - - /* TODO implement me */ - goto failed; - } - - if (vop->coding_type != GST_MPEG4_I_VOP) { - READ_UINT8 (&br, vop->fcode_forward, 3); - CHECK_ALLOWED (vop->fcode_forward, 1, 7); - } - - if (vop->coding_type == GST_MPEG4_B_VOP) { - READ_UINT8 (&br, vop->fcode_backward, 3); - CHECK_ALLOWED (vop->fcode_backward, 1, 7); - } - } - - if (!vol->scalability) { - if (vol->shape != GST_MPEG4_RECTANGULAR) - READ_UINT8 (&br, vop->shape_coding_type, 1); - - } else { - if (vol->enhancement_type) { - READ_UINT8 (&br, vop->load_backward_shape, 1); - - if (vop->load_backward_shape) { - GST_WARNING ("Load backward shape not supported"); - goto failed; - } - - READ_UINT8 (&br, vop->ref_select_code, 2); - } - } - - vop->size = gst_bit_reader_get_pos (&br); - /* More things to possibly parse ... */ - - return GST_MPEG4_PARSER_OK; - -failed: - GST_WARNING ("failed parsing \"Video Object Plane\""); - return GST_MPEG4_PARSER_ERROR; - -wrong_start_code: - GST_WARNING ("got buffer with wrong start code"); - goto failed; -} - -/** - * gst_mpeg4_parse_video_plane_with_short_header: - * @shorthdr: The #GstMpeg4VideoPlaneShortHdr to parse - * @data: The data to parse - * @size: The size of the @data to parse - */ -GstMpeg4ParseResult -gst_mpeg4_parse_video_plane_short_header (GstMpeg4VideoPlaneShortHdr * - shorthdr, const guint8 * data, gsize size) -{ - guint8 zero_bits; - - GstBitReader br = GST_BIT_READER_INIT (data, size); - - g_return_val_if_fail (shorthdr != NULL, GST_MPEG4_PARSER_ERROR); - - if (gst_bit_reader_get_remaining (&br) < 48) - goto failed; - - if (gst_bit_reader_get_bits_uint32_unchecked (&br, 22) != 0x20) - goto failed; - - shorthdr->temporal_reference = - gst_bit_reader_get_bits_uint8_unchecked (&br, 8); - CHECK_MARKER (&br); - zero_bits = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - if (zero_bits != 0x00) - goto failed; - - shorthdr->split_screen_indicator = - gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - shorthdr->document_camera_indicator = - gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - shorthdr->full_picture_freeze_release = - gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - shorthdr->source_format = gst_bit_reader_get_bits_uint8_unchecked (&br, 3); - - /* Set parameters/Table 6-25 */ - switch (shorthdr->source_format) { - case 0x01: - shorthdr->vop_width = 128; - shorthdr->vop_height = 96; - shorthdr->num_macroblocks_in_gob = 8; - shorthdr->num_gobs_in_vop = 6; - break; - case 0x02: - shorthdr->vop_width = 176; - shorthdr->vop_height = 144; - shorthdr->num_macroblocks_in_gob = 11; - shorthdr->num_gobs_in_vop = 9; - break; - case 0x03: - shorthdr->vop_width = 352; - shorthdr->vop_height = 288; - shorthdr->num_macroblocks_in_gob = 22; - shorthdr->num_gobs_in_vop = 18; - break; - case 0x04: - shorthdr->vop_width = 704; - shorthdr->vop_height = 576; - shorthdr->num_macroblocks_in_gob = 88; - shorthdr->num_gobs_in_vop = 18; - break; - case 0x05: - shorthdr->vop_width = 1408; - shorthdr->vop_height = 1152; - shorthdr->num_macroblocks_in_gob = 352; - shorthdr->num_gobs_in_vop = 18; - break; - default: - shorthdr->vop_width = 0; - shorthdr->vop_height = 0; - shorthdr->num_macroblocks_in_gob = 0; - shorthdr->num_gobs_in_vop = 0; - } - - shorthdr->picture_coding_type = - gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - zero_bits = gst_bit_reader_get_bits_uint8_unchecked (&br, 4); - - if (zero_bits != 0x00) - goto failed; - - shorthdr->vop_quant = gst_bit_reader_get_bits_uint8_unchecked (&br, 5); - zero_bits = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - - if (zero_bits != 0x00) - goto failed; - - do { - READ_UINT8 (&br, shorthdr->pei, 1); - - if (shorthdr->pei == 1) - READ_UINT8 (&br, shorthdr->psupp, 8); - - } while (shorthdr->pei == 1); - - shorthdr->size = gst_bit_reader_get_pos (&br); - - return GST_MPEG4_PARSER_OK; - -failed: - GST_WARNING ("Could not parse the Plane short header"); - - return GST_MPEG4_PARSER_ERROR; -} - -/** - * gst_mpeg4_parse_video_packet_header: - * @videopackethdr: The #GstMpeg4VideoPacketHdr structure to fill - * @vol: The last parsed #GstMpeg4VideoObjectLayer, will be updated - * with the informations found during the parsing - * @vop: The last parsed #GstMpeg4VideoObjectPlane, will be updated - * with the informations found during the parsing - * @sprite_trajectory: A #GstMpeg4SpriteTrajectory to fill or %NULL - * with the informations found during the parsing - * @data: The data to parse, should be set after the resync marker. - * @size: The size of the data to parse - * - * Parsers @data containing the video packet header - * and fills the @videopackethdr structure - */ -GstMpeg4ParseResult -gst_mpeg4_parse_video_packet_header (GstMpeg4VideoPacketHdr * videopackethdr, - GstMpeg4VideoObjectLayer * vol, GstMpeg4VideoObjectPlane * vop, - GstMpeg4SpriteTrajectory * sprite_trajectory, const guint8 * data, - gsize size) -{ - guint8 markersize; - GstBitReader br = GST_BIT_READER_INIT (data, size); - - g_return_val_if_fail (videopackethdr != NULL, GST_MPEG4_PARSER_ERROR); - g_return_val_if_fail (vol != NULL, GST_MPEG4_PARSER_ERROR); - - markersize = compute_resync_marker_size (vop, NULL, NULL); - - CHECK_REMAINING (&br, markersize); - - if (gst_bit_reader_get_bits_uint32_unchecked (&br, markersize) != 0x01) - goto failed; - - if (vol->shape != GST_MPEG4_RECTANGULAR) { - READ_UINT8 (&br, videopackethdr->header_extension_code, 1); - if (vol->sprite_enable == GST_MPEG4_SPRITE_STATIC && - vop->coding_type == GST_MPEG4_I_VOP) { - - CHECK_REMAINING (&br, 56); - - U_READ_UINT16 (&br, vop->width, 13); - CHECK_MARKER (&br); - U_READ_UINT16 (&br, vop->height, 13); - CHECK_MARKER (&br); - U_READ_UINT16 (&br, vop->horizontal_mc_spatial_ref, 13); - CHECK_MARKER (&br); - U_READ_UINT16 (&br, vop->vertical_mc_spatial_ref, 13); - CHECK_MARKER (&br); - - /* Update macroblock infirmations */ - vop->mb_height = (vop->height + 15) / 16; - vop->mb_width = (vop->width + 15) / 16; - vop->mb_num = vop->mb_height * vop->mb_width; - } - } - - READ_UINT16 (&br, videopackethdr->macroblock_number, - g_bit_storage (vop->mb_num - 1)); - - if (vol->shape != GST_MPEG4_BINARY_ONLY) - READ_UINT16 (&br, videopackethdr->quant_scale, vol->quant_precision); - - if (vol->shape == GST_MPEG4_RECTANGULAR) - READ_UINT8 (&br, videopackethdr->header_extension_code, 1); - - if (videopackethdr->header_extension_code) { - guint timeincr = 0; - guint8 bit = 0, coding_type; - - do { - READ_UINT8 (&br, bit, 1); - timeincr++; - } while (bit); - - vol->vop_time_increment_bits = timeincr; - - CHECK_MARKER (&br); - READ_UINT16 (&br, vop->time_increment, timeincr); - CHECK_MARKER (&br); - READ_UINT8 (&br, coding_type, 2); - vop->coding_type = coding_type; - - if (vol->shape != GST_MPEG4_RECTANGULAR) { - READ_UINT8 (&br, vop->change_conv_ratio_disable, 1); - if (vop->coding_type != GST_MPEG4_I_VOP) - READ_UINT8 (&br, vop->shape_coding_type, 1); - } - - if (vol->shape != GST_MPEG4_BINARY_ONLY) { - READ_UINT8 (&br, vop->intra_dc_vlc_thr, 3); - - if (sprite_trajectory && vol->sprite_enable == GST_MPEG4_SPRITE_GMG && - vop->coding_type == GST_MPEG4_S_VOP && - vol->no_of_sprite_warping_points > 0) { - - parse_sprite_trajectory (&br, sprite_trajectory, - vol->no_of_sprite_warping_points); - } - - if (vol->reduced_resolution_vop_enable && - vol->shape == GST_MPEG4_RECTANGULAR && - (vop->coding_type == GST_MPEG4_P_VOP || - vop->coding_type == GST_MPEG4_I_VOP)) - READ_UINT8 (&br, vop->reduced_resolution, 1); - - if (vop->coding_type != GST_MPEG4_I_VOP) { - READ_UINT8 (&br, vop->fcode_forward, 3); - CHECK_ALLOWED (vop->fcode_forward, 1, 7); - } - - if (vop->coding_type == GST_MPEG4_B_VOP) { - READ_UINT8 (&br, vop->fcode_backward, 3); - CHECK_ALLOWED (vop->fcode_backward, 1, 7); - } - } - } - - if (vol->newpred_enable) { - guint16 nbbits = - vol->vop_time_increment_bits + 3 < 15 ? vop->time_increment + 3 : 15; - - READ_UINT16 (&br, vop->id, nbbits); - READ_UINT8 (&br, vop->id_for_prediction_indication, 1); - if (vop->id_for_prediction_indication) { - /* Would be nice if the standard actually told us... */ - READ_UINT16 (&br, vop->id, nbbits); - CHECK_MARKER (&br); - } - } - - videopackethdr->size = gst_bit_reader_get_pos (&br); - -failed: - GST_DEBUG ("Failed to parse video packet header"); - - return GST_MPEG4_PARSER_NO_PACKET; -} diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstmpeg4parser.h gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstmpeg4parser.h --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstmpeg4parser.h 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstmpeg4parser.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,583 +0,0 @@ -/* - * GStreamer - * Copyright (C) 2009 Carl-Anton Ingmarsson - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef __GST_MPEG4UTIL_H__ -#define __GST_MPEG4UTIL_H__ - -#include - -G_BEGIN_DECLS - -typedef struct _GstMpeg4VisualObjectSequence GstMpeg4VisualObjectSequence; -typedef struct _GstMpeg4VisualObject GstMpeg4VisualObject; -typedef struct _GstMpeg4VideoObjectLayer GstMpeg4VideoObjectLayer; -typedef struct _GstMpeg4GroupOfVOP GstMpeg4GroupOfVOP; -typedef struct _GstMpeg4VideoObjectPlane GstMpeg4VideoObjectPlane; -typedef struct _GstMpeg4VideoSignalType GstMpeg4VideoSignalType; -typedef struct _GstMpeg4VideoPlaneShortHdr GstMpeg4VideoPlaneShortHdr; -typedef struct _GstMpeg4VideoPacketHdr GstMpeg4VideoPacketHdr; - -typedef struct _GstMpeg4SpriteTrajectory GstMpeg4SpriteTrajectory; - -typedef struct _GstMpeg4Packet GstMpeg4Packet; - -/** - * GstMpeg4StartCode: - * - * Defines the different startcodes present in the bitstream as - * defined in: Table 6-3 — Start code values - */ -typedef enum -{ - GST_MPEG4_VIDEO_OBJ_FIRST = 0x00, - GST_MPEG4_VIDEO_OBJ_LAST = 0x1f, - GST_MPEG4_VIDEO_LAYER_FIRST = 0x20, - GST_MPEG4_VIDEO_LAYER_LAST = 0x2f, - GST_MPEG4_VISUAL_OBJ_SEQ_START = 0xb0, - GST_MPEG4_VISUAL_OBJ_SEQ_END = 0xb1, - GST_MPEG4_USER_DATA = 0xb2, - GST_MPEG4_GROUP_OF_VOP = 0xb3, - GST_MPEG4_VIDEO_SESSION_ERR = 0xb4, - GST_MPEG4_VISUAL_OBJ = 0xb5, - GST_MPEG4_VIDEO_OBJ_PLANE = 0xb6, - GST_MPEG4_FBA = 0xba, - GST_MPEG4_FBA_PLAN = 0xbb, - GST_MPEG4_MESH = 0xbc, - GST_MPEG4_MESH_PLAN = 0xbd, - GST_MPEG4_STILL_TEXTURE_OBJ = 0xbe, - GST_MPEG4_TEXTURE_SPATIAL = 0xbf, - GST_MPEG4_TEXTURE_SNR_LAYER = 0xc0, - GST_MPEG4_TEXTURE_TILE = 0xc1, - GST_MPEG4_SHAPE_LAYER = 0xc2, - GST_MPEG4_STUFFING = 0xc3, - GST_MPEG4_SYSTEM_FIRST = 0xc6, - GST_MPEG4_SYSTEM_LAST = 0xff, - GST_MPEG4_RESYNC = 0xfff -} GstMpeg4StartCode; - -/** - * GstMpeg4VisualObjectType: - * - * Defines the different visual object types as - * defined in: Table 6-5 -- Meaning of visual object type - */ -typedef enum { - GST_MPEG4_VIDEO_ID = 0x01, - GST_MPEG4_STILL_TEXTURE_ID = 0x02, - GST_MPEG4_STILL_MESH_ID = 0x03, - GST_MPEG4_STILL_FBA_ID = 0x04, - GST_MPEG4_STILL_3D_MESH_ID = 0x05, - /*... reserved */ - -} GstMpeg4VisualObjectType; - -/** - * GstMpeg4AspectRatioInfo: - * @GST_MPEG4_SQUARE: 1:1 square - * @GST_MPEG4_625_TYPE_4_3: 12:11 (625-type for 4:3 picture) - * @GST_MPEG4_525_TYPE_4_3: 10:11 (525-type for 4:3 picture) - * @GST_MPEG4_625_TYPE_16_9: 16:11 (625-type stretched for 16:9 picture) - * @GST_MPEG4_525_TYPE_16_9: 40:33 (525-type stretched for 16:9 picture) - * @GST_MPEG4_EXTENDED_PAR: Extended par - * - * Defines the different pixel aspect ratios as - * defined in: Table 6-12 -- Meaning of pixel aspect ratio - */ -typedef enum { - GST_MPEG4_SQUARE = 0x01, - GST_MPEG4_625_TYPE_4_3 = 0x02, - GST_MPEG4_525_TYPE_4_3 = 0x03, - GST_MPEG4_625_TYPE_16_9 = 0x04, - GST_MPEG4_525_TYPE_16_9 = 0x05, - GST_MPEG4_EXTENDED_PAR = 0x0f, -} GstMpeg4AspectRatioInfo; - -/** - * GstMpeg4ParseResult: - * @GST_MPEG4_PARSER_OK: The parsing went well - * @GST_MPEG4_PARSER_BROKEN_DATA: The bitstream was broken - * @GST_MPEG4_PARSER_NO_PACKET: There was no packet in the buffer - * @GST_MPEG4_PARSER_NO_PACKET_END: There was no packet end in the buffer - * @GST_MPEG4_PARSER_NO_PACKET_ERROR: An error accured durint the parsing - * - * Result type of any parsing function. - */ -typedef enum { - GST_MPEG4_PARSER_OK, - GST_MPEG4_PARSER_BROKEN_DATA, - GST_MPEG4_PARSER_NO_PACKET, - GST_MPEG4_PARSER_NO_PACKET_END, - GST_MPEG4_PARSER_ERROR, -} GstMpeg4ParseResult; - -/** - * GstMpeg4VideoObjectCodingType: - * @GST_MPEG4_I_VOP: intra-coded (I) - * @GST_MPEG4_P_VOP: predictive-coded (P) - * @GST_MPEG4_B_VOP: bidirectionally-predictive-coded (B) - * @GST_MPEG4_S_VOP: sprite (S) - * - * The vop coding types as defined in: - * Table 6-20 -- Meaning of vop_coding_type - */ -typedef enum { - GST_MPEG4_I_VOP = 0x0, - GST_MPEG4_P_VOP = 0x1, - GST_MPEG4_B_VOP = 0x2, - GST_MPEG4_S_VOP = 0x3 -} GstMpeg4VideoObjectCodingType; - -/** - * GstMpeg4ChromaFormat: - * - * The chroma format in use as - * defined in: Table 6-13 -- Meaning of chroma_format - */ -typedef enum { - /* Other value are reserved */ - GST_MPEG4_CHROMA_4_2_0 = 0x01 -} GstMpeg4ChromaFormat; - -/** - * GstMpeg4VideoObjectLayerShape: - * - * The different video object layer shapes as defined in: - * Table 6-16 — Video Object Layer shape type - */ -typedef enum { - GST_MPEG4_RECTANGULAR, - GST_MPEG4_BINARY, - GST_MPEG4_BINARY_ONLY, - GST_MPEG4_GRAYSCALE -} GstMpeg4VideoObjectLayerShape; - -/** - * GstMpeg4SpriteEnable: - * - * Indicates the usage of static sprite coding - * or global motion compensation (GMC) as defined in: - * Table V2 - 2 -- Meaning of sprite_enable codewords - */ -typedef enum { - GST_MPEG4_SPRITE_UNUSED, - GST_MPEG4_SPRITE_STATIC, - GST_MPEG4_SPRITE_GMG -} GstMpeg4SpriteEnable; - -/** - * GstMpeg4Profile: - * - * Different defined profiles as defined in: - * 9- Profiles and levels - * - * It is computed using: - * Table G.1 — FLC table for profile_and_level_indication - */ -typedef enum { - GST_MPEG4_PROFILE_CORE, - GST_MPEG4_PROFILE_MAIN, - GST_MPEG4_PROFILE_N_BIT, - GST_MPEG4_PROFILE_SIMPLE, - GST_MPEG4_PROFILE_HYBRID, - GST_MPEG4_PROFILE_RESERVED, - GST_MPEG4_PROFILE_SIMPLE_FBA, - GST_MPEG4_PROFILE_CORE_STUDIO, - GST_MPEG4_PROFILE_SIMPLE_STUDIO, - GST_MPEG4_PROFILE_CORE_SCALABLE, - GST_MPEG4_PROFILE_ADVANCED_CORE, - GST_MPEG4_PROFILE_ADVANCED_SIMPLE, - GST_MPEG4_PROFILE_SIMPLE_SCALABLE, - GST_MPEG4_PROFILE_SCALABLE_TEXTURE, - GST_MPEG4_PROFILE_SIMPLE_FACE_ANIMATION, - GST_MPEG4_PROFILE_BASIC_ANIMATED_TEXTURE, - GST_MPEG4_PROFILE_ADVANCED_REALTIME_SIMPLE, - GST_MPEG4_PROFILE_ADVANCED_SCALABLE_TEXTURE, - GST_MPEG4_PROFILE_FINE_GRANULARITY_SCALABLE, - GST_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY -} GstMpeg4Profile; - -/** - * GstMpeg4Level: - * - * Different levels as defined in: - * 9- Profiles and levels - * - * It is computed using: - * Table G.1 — FLC table for profile_and_level_indication - */ -typedef enum { - GST_MPEG4_LEVEL0, - GST_MPEG4_LEVEL1, - GST_MPEG4_LEVEL2, - GST_MPEG4_LEVEL3, - GST_MPEG4_LEVEL3b, - GST_MPEG4_LEVEL4, - GST_MPEG4_LEVEL5, - GST_MPEG4_LEVEL_RESERVED -} GstMpeg4Level; - -/** - * GstMpeg4VisualObjectSequence: - * - * The visual object sequence structure as defined in: - * 6.2.2 Visual Object Sequence and Visual Object - */ -struct _GstMpeg4VisualObjectSequence { - guint8 profile_and_level_indication; - - /* Computed according to: - * Table G.1 — FLC table for profile_and_level_indication */ - GstMpeg4Level level; - GstMpeg4Profile profile; -}; - -/** - * GstMpeg4VisualObject: - * - * The visual object structure as defined in: - * 6.2.2 Visual Object Sequence and Visual Object - */ -struct _GstMpeg4VisualObject { - guint8 is_identifier; - /* If is_identifier */ - guint8 verid; - guint8 priority; - - GstMpeg4VisualObjectType type; -}; - -/** - * GstMpeg4VideoSignalType: - * - * The video signal type structure as defined in: - * 6.2.2 Visual Object Sequence and Visual Object. - */ -struct _GstMpeg4VideoSignalType { - guint8 type; - - guint8 format; - guint8 range; - guint8 color_description; - guint8 color_primaries; - guint8 transfer_characteristics; - guint8 matrix_coefficients; -}; - -/** - * GstMpeg4VideoPlaneShortHdr: - * - * The video plane short header structure as defined in: - * 6.2.5.2 Video Plane with Short Header - */ -struct _GstMpeg4VideoPlaneShortHdr { - guint8 temporal_reference; - guint8 split_screen_indicator; - guint8 document_camera_indicator; - guint8 full_picture_freeze_release; - guint8 source_format; - guint8 picture_coding_type; - guint8 vop_quant; - guint8 pei; - guint8 psupp; - - /* Gob layer specific fields */ - guint8 gob_header_empty; - guint8 gob_number; - guint8 gob_frame_id; - guint8 quant_scale; - - /* Computed - * If all the values are set to 0, then it is reserved - * Table 6-25 -- Parameters Defined by source_format Field - */ - guint16 vop_width; - guint16 vop_height; - guint16 num_macroblocks_in_gob; - guint8 num_gobs_in_vop; - - /* The size in bits */ - guint size; -}; - -/** - * GstMpeg4VideoObjectLayer: - * - * The video object layer structure as defined in: - * 6.2.3 Video Object Layer - */ -struct _GstMpeg4VideoObjectLayer { - guint8 random_accessible_vol; - guint8 video_object_type_indication; - - guint8 is_object_layer_identifier; - /* if is_object_layer_identifier */ - guint8 verid; - guint8 priority; - - GstMpeg4AspectRatioInfo aspect_ratio_info; - guint8 par_width; - guint8 par_height; - - guint8 control_parameters; - /* if control_parameters */ - GstMpeg4ChromaFormat chroma_format; - guint8 low_delay; - guint8 vbv_parameters; - /* if vbv_parameters */ - guint16 first_half_bitrate; - guint16 latter_half_bitrate; - guint16 first_half_vbv_buffer_size; - guint16 latter_half_vbv_buffer_size; - guint16 first_half_vbv_occupancy; - guint16 latter_half_vbv_occupancy; - - /* Computed values */ - guint32 bit_rate; - guint32 vbv_buffer_size; - - GstMpeg4VideoObjectLayerShape shape; - /* if shape == GST_MPEG4_GRAYSCALE && verid =! 1 */ - guint8 shape_extension; - - guint16 vop_time_increment_resolution; - guint8 vop_time_increment_bits; - guint8 fixed_vop_rate; - /* if fixed_vop_rate */ - guint16 fixed_vop_time_increment; - - guint16 width; - guint16 height; - guint8 interlaced; - guint8 obmc_disable; - - GstMpeg4SpriteEnable sprite_enable; - /* if vol->sprite_enable == SPRITE_GMG or SPRITE_STATIC*/ - /* if vol->sprite_enable != GST_MPEG4_SPRITE_GMG */ - guint16 sprite_width; - guint16 sprite_height; - guint16 sprite_left_coordinate; - guint16 sprite_top_coordinate; - - guint8 no_of_sprite_warping_points; - guint8 sprite_warping_accuracy; - guint8 sprite_brightness_change; - /* if vol->sprite_enable != GST_MPEG4_SPRITE_GMG */ - guint8 low_latency_sprite_enable; - - /* if shape != GST_MPEG4_RECTANGULAR */ - guint8 sadct_disable; - - guint8 not_8_bit; - - /* if no_8_bit */ - guint8 quant_precision; - guint8 bits_per_pixel; - - /* if shape == GRAYSCALE */ - guint8 no_gray_quant_update; - guint8 composition_method; - guint8 linear_composition; - - guint8 quant_type; - /* if quant_type */ - guint8 load_intra_quant_mat; - guint8 intra_quant_mat[64]; - guint8 load_non_intra_quant_mat; - guint8 non_intra_quant_mat[64]; - - guint8 quarter_sample; - guint8 complexity_estimation_disable; - guint8 resync_marker_disable; - guint8 data_partitioned; - guint8 reversible_vlc; - guint8 newpred_enable; - guint8 reduced_resolution_vop_enable; - guint8 scalability; - guint8 enhancement_type; - - GstMpeg4VideoPlaneShortHdr short_hdr; -}; - -/** - * GstMpeg4SpriteTrajectory: - * - * The sprite trajectory structure as defined in: - * 7.8.4 Sprite reference point decoding and - * 6.2.5.4 Sprite coding - */ -struct _GstMpeg4SpriteTrajectory { - guint16 vop_ref_points[63]; /* Defined as "du" in 6.2.5.4 */ - guint16 sprite_ref_points[63]; /* Defined as "dv" in 6.2.5.4 */ -}; - -/** - * GstMpeg4GroupOfVOP: - * - * The group of video object plane structure as defined in: - * 6.2.4 Group of Video Object Plane - */ -struct _GstMpeg4GroupOfVOP { - guint8 hours; - guint8 minutes; - guint8 seconds; - - guint8 closed; - guint8 broken_link; -}; - -/** - * GstMpeg4VideoObjectPlane: - * - * The Video object plane structure as defined in: - * 6.2.5 Video Object Plane and Video Plane with Short Header - */ -struct _GstMpeg4VideoObjectPlane { - GstMpeg4VideoObjectCodingType coding_type; - - guint8 modulo_time_base; - guint16 time_increment; - - guint8 coded; - /* if newpred_enable */ - guint16 id; - guint8 id_for_prediction_indication; - guint16 id_for_prediction; - - guint16 width; - guint16 height; - guint16 horizontal_mc_spatial_ref; - guint16 vertical_mc_spatial_ref; - - guint8 rounding_type; - /*if vol->shape != GST_MPEG4_RECTANGULAR */ - guint8 background_composition; - guint8 change_conv_ratio_disable; - guint8 constant_alpha; - guint8 constant_alpha_value; - guint8 reduced_resolution; - - guint8 intra_dc_vlc_thr; - - - guint8 top_field_first; - guint8 alternate_vertical_scan_flag; - - guint16 quant; - - guint8 fcode_forward; - guint8 fcode_backward; - - guint8 shape_coding_type; - guint8 load_backward_shape; - guint8 ref_select_code; - - /* Computed macroblock informations */ - guint16 mb_height; - guint16 mb_width; - guint mb_num; - - /* The size of the header */ - guint size; -}; - -/** - * GstMpeg4VideoPacketHdr: - * @size: Size of the header in bit. - * - * The video packet header structure as defined in: - * 6.2.5.2 Video Plane with Short Header - */ -struct _GstMpeg4VideoPacketHdr { - guint8 header_extension_code; - guint16 macroblock_number; - guint16 quant_scale; - guint size; -}; - -/** - * GstMpeg4Packet: - * @type: the type of the packet that start at @offset - * @data: the data containing packet starting at @offset - * @offset: offset of the start of the packet (without the 3 bytes startcode), but - * including the #GstMpeg4StartCode byte. - * @size: The size in bytes of the packet or %G_MAXUINT if the end wasn't found. - * @marker_size: The size in bit of the resync marker. - * - * A structure that contains the type of a packet, its offset and its size - */ -struct _GstMpeg4Packet -{ - const guint8 *data; - guint offset; - gsize size; - guint marker_size; - - GstMpeg4StartCode type; -}; - -GstMpeg4ParseResult gst_h263_parse (GstMpeg4Packet * packet, - const guint8 * data, guint offset, - gsize size); - - -GstMpeg4ParseResult gst_mpeg4_parse (GstMpeg4Packet * packet, - gboolean skip_user_data, - GstMpeg4VideoObjectPlane *vop, - const guint8 * data, guint offset, - gsize size); - -GstMpeg4ParseResult -gst_mpeg4_parse_video_object_plane (GstMpeg4VideoObjectPlane *vop, - GstMpeg4SpriteTrajectory *sprite_trajectory, - GstMpeg4VideoObjectLayer *vol, - const guint8 * data, - gsize size); - -GstMpeg4ParseResult -gst_mpeg4_parse_group_of_vop (GstMpeg4GroupOfVOP *gov, - const guint8 * data, gsize size); - -GstMpeg4ParseResult -gst_mpeg4_parse_video_object_layer (GstMpeg4VideoObjectLayer *vol, - GstMpeg4VisualObject *vo, - const guint8 * data, gsize size); - -GstMpeg4ParseResult -gst_mpeg4_parse_visual_object (GstMpeg4VisualObject *vo, - GstMpeg4VideoSignalType *signal_type, - const guint8 * data, gsize size); - -GstMpeg4ParseResult -gst_mpeg4_parse_visual_object_sequence (GstMpeg4VisualObjectSequence *vos, - const guint8 * data, gsize size); -GstMpeg4ParseResult -gst_mpeg4_parse_video_plane_short_header (GstMpeg4VideoPlaneShortHdr * shorthdr, - const guint8 * data, gsize size); - -GstMpeg4ParseResult -gst_mpeg4_parse_video_packet_header (GstMpeg4VideoPacketHdr * videopackethdr, - GstMpeg4VideoObjectLayer * vol, - GstMpeg4VideoObjectPlane * vop, - GstMpeg4SpriteTrajectory * sprite_trajectory, - const guint8 * data, gsize size); - -G_END_DECLS - -#endif /* __GST_MPEG4UTIL_H__ */ diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstmpegvideoparser.c gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstmpegvideoparser.c --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstmpegvideoparser.c 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstmpegvideoparser.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1286 +0,0 @@ -/* Gstreamer - * Copyright (C) <2011> Intel Corporation - * Copyright (C) <2011> Collabora Ltd. - * Copyright (C) <2011> Thibault Saunier - * - * From bad/sys/vdpau/mpeg/mpegutil.c: - * Copyright (C) <2007> Jan Schmidt - * Copyright (C) <2009> Carl-Anton Ingmarsson - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -/** - * SECTION:gstmpegvideoparser - * @short_description: Convenience library for mpeg1 and 2 video - * bitstream parsing. - * - * - * - * Provides useful functions for mpeg videos bitstream parsing. - * - * - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "gstmpegvideoparser.h" -#include "parserutils.h" - -#include -#include -#include - -#define MARKER_BIT 0x1 - -/* default intra quant matrix, in zig-zag order */ -static const guint8 default_intra_quantizer_matrix[64] = { - 8, - 16, 16, - 19, 16, 19, - 22, 22, 22, 22, - 22, 22, 26, 24, 26, - 27, 27, 27, 26, 26, 26, - 26, 27, 27, 27, 29, 29, 29, - 34, 34, 34, 29, 29, 29, 27, 27, - 29, 29, 32, 32, 34, 34, 37, - 38, 37, 35, 35, 34, 35, - 38, 38, 40, 40, 40, - 48, 48, 46, 46, - 56, 56, 58, - 69, 69, - 83 -}; - -static const guint8 mpeg_zigzag_8x8[64] = { - 0, 1, 8, 16, 9, 2, 3, 10, - 17, 24, 32, 25, 18, 11, 4, 5, - 12, 19, 26, 33, 40, 48, 41, 34, - 27, 20, 13, 6, 7, 14, 21, 28, - 35, 42, 49, 56, 57, 50, 43, 36, - 29, 22, 15, 23, 30, 37, 44, 51, - 58, 59, 52, 45, 38, 31, 39, 46, - 53, 60, 61, 54, 47, 55, 62, 63 -}; - -enum -{ - GST_MPEG_VIDEO_MACROBLOCK_ESCAPE = G_MAXUINT, -}; - -/* Table B-1: Variable length codes for macroblock_address_increment */ -static const VLCTable mpeg2_mbaddr_vlc_table[] = { - {1, 0x01, 1}, - {2, 0x03, 3}, - {3, 0x02, 3}, - {4, 0x03, 4}, - {5, 0x02, 4}, - {6, 0x03, 5}, - {7, 0x02, 5}, - {8, 0x07, 7}, - {9, 0x06, 7}, - {10, 0x0b, 8}, - {11, 0x0a, 8}, - {12, 0x09, 8}, - {13, 0x08, 8}, - {14, 0x07, 8}, - {15, 0x06, 8}, - {16, 0x17, 10}, - {17, 0x16, 10}, - {18, 0x15, 10}, - {19, 0x14, 10}, - {20, 0x13, 10}, - {21, 0x12, 10}, - {22, 0x23, 11}, - {23, 0x22, 11}, - {24, 0x21, 11}, - {25, 0x20, 11}, - {26, 0x1f, 11}, - {27, 0x1e, 11}, - {28, 0x1d, 11}, - {29, 0x1c, 11}, - {30, 0x1b, 11}, - {31, 0x1a, 11}, - {32, 0x19, 11}, - {33, 0x18, 11}, - {GST_MPEG_VIDEO_MACROBLOCK_ESCAPE, 0x08, 11} -}; - -GST_DEBUG_CATEGORY (mpegvideo_parser_debug); -#define GST_CAT_DEFAULT mpegvideo_parser_debug - -#define INITIALIZE_DEBUG_CATEGORY \ - GST_DEBUG_CATEGORY_INIT (mpegvideo_parser_debug, "codecparsers_mpegvideo", \ - 0, "Mpegvideo parser library"); - - -/* Set the Pixel Aspect Ratio in our hdr from a ASR code in the data */ -static void -set_par_from_asr_mpeg1 (GstMpegVideoSequenceHdr * seqhdr, guint8 asr_code) -{ - int ratios[16][2] = { - {0, 0}, /* 0, Invalid */ - {1, 1}, /* 1, 1.0 */ - {10000, 6735}, /* 2, 0.6735 */ - {64, 45}, /* 3, 0.7031 16:9 625 line */ - {10000, 7615}, /* 4, 0.7615 */ - {10000, 8055}, /* 5, 0.8055 */ - {32, 27}, /* 6, 0.8437 */ - {10000, 8935}, /* 7, 0.8935 */ - {10000, 9375}, /* 8, 0.9375 */ - {10000, 9815}, /* 9, 0.9815 */ - {10000, 10255}, /* 10, 1.0255 */ - {10000, 10695}, /* 11, 1.0695 */ - {8, 9}, /* 12, 1.125 */ - {10000, 11575}, /* 13, 1.1575 */ - {10000, 12015}, /* 14, 1.2015 */ - {0, 0}, /* 15, invalid */ - }; - asr_code &= 0xf; - - seqhdr->par_w = ratios[asr_code][0]; - seqhdr->par_h = ratios[asr_code][1]; -} - -static void -set_fps_from_code (GstMpegVideoSequenceHdr * seqhdr, guint8 fps_code) -{ - const gint framerates[][2] = { - {30, 1}, {24000, 1001}, {24, 1}, {25, 1}, - {30000, 1001}, {30, 1}, {50, 1}, {60000, 1001}, - {60, 1}, {30, 1} - }; - - if (fps_code && fps_code < 10) { - seqhdr->fps_n = framerates[fps_code][0]; - seqhdr->fps_d = framerates[fps_code][1]; - } else { - GST_DEBUG ("unknown/invalid frame_rate_code %d", fps_code); - /* Force a valid framerate */ - /* FIXME or should this be kept unknown ?? */ - seqhdr->fps_n = 30000; - seqhdr->fps_d = 1001; - } -} - -/* @size and @offset are wrt current reader position */ -static inline gint -scan_for_start_codes (const GstByteReader * reader, guint offset, guint size) -{ - const guint8 *data; - guint i = 0; - - g_assert ((guint64) offset + size <= reader->size - reader->byte); - - /* we can't find the pattern with less than 4 bytes */ - if (G_UNLIKELY (size < 4)) - return -1; - - data = reader->data + reader->byte + offset; - - while (i <= (size - 4)) { - if (data[i + 2] > 1) { - i += 3; - } else if (data[i + 1]) { - i += 2; - } else if (data[i] || data[i + 2] != 1) { - i++; - } else { - break; - } - } - - if (i <= (size - 4)) - return offset + i; - - /* nothing found */ - return -1; -} - -/****** API *******/ - -/** - * gst_mpeg_video_parse: - * @packet: a #GstMpegVideoPacket to fill with the data and offset of the - * next packet found - * @data: The data to parse - * @size: The size of @data - * @offset: The offset from which to start parsing - * - * Parses the MPEG 1/2 video bitstream contained in @data, and returns the - * offset, and if known also the size, in @packet. This function will scan - * the data to find the next packet if needed. - * - * Returns: TRUE if a packet start code was found, otherwise FALSE. - */ -gboolean -gst_mpeg_video_parse (GstMpegVideoPacket * packet, - const guint8 * data, gsize size, guint offset) -{ - gint off; - GstByteReader br; - - INITIALIZE_DEBUG_CATEGORY; - - if (size <= offset) { - GST_DEBUG ("Can't parse from offset %d, buffer is to small", offset); - return FALSE; - } - - size -= offset; - gst_byte_reader_init (&br, &data[offset], size); - - off = scan_for_start_codes (&br, 0, size); - - if (off < 0) { - GST_DEBUG ("No start code prefix in this buffer"); - return FALSE; - } - - if (gst_byte_reader_skip (&br, off + 3) == FALSE) - goto failed; - - if (gst_byte_reader_get_uint8 (&br, &packet->type) == FALSE) - goto failed; - - packet->data = data; - packet->offset = offset + off + 4; - packet->size = -1; - - /* try to find end of packet */ - size -= off + 4; - off = scan_for_start_codes (&br, 0, size); - - if (off > 0) - packet->size = off; - - return TRUE; - -failed: - { - GST_WARNING ("Failed to parse"); - return FALSE; - } -} - -/** - * gst_mpeg_video_packet_parse_sequence_header: - * @packet: The #GstMpegVideoPacket that carries the data - * @seqhdr: (out): The #GstMpegVideoSequenceHdr structure to fill - * - * Parses the @seqhdr MPEG Video Sequence Header structure members - * from video @packet - * - * Returns: %TRUE if the seqhdr could be parsed correctly, %FALSE otherwize. - * - * Since: 1.2 - */ -gboolean -gst_mpeg_video_packet_parse_sequence_header (const GstMpegVideoPacket * packet, - GstMpegVideoSequenceHdr * seqhdr) -{ - GstBitReader br; - guint8 bits; - guint8 load_intra_flag, load_non_intra_flag; - - g_return_val_if_fail (seqhdr != NULL, FALSE); - - if (packet->size < 8) - return FALSE; - - INITIALIZE_DEBUG_CATEGORY; - - gst_bit_reader_init (&br, &packet->data[packet->offset], packet->size); - - /* Setting the height/width codes */ - READ_UINT16 (&br, seqhdr->width, 12); - READ_UINT16 (&br, seqhdr->height, 12); - - READ_UINT8 (&br, seqhdr->aspect_ratio_info, 4); - /* Interpret PAR according to MPEG-1. Needs to be reinterpreted - * later, if a sequence_display extension is seen */ - set_par_from_asr_mpeg1 (seqhdr, seqhdr->aspect_ratio_info); - - READ_UINT8 (&br, seqhdr->frame_rate_code, 4); - set_fps_from_code (seqhdr, seqhdr->frame_rate_code); - - READ_UINT32 (&br, seqhdr->bitrate_value, 18); - if (seqhdr->bitrate_value == 0x3ffff) { - /* VBR stream */ - seqhdr->bitrate = 0; - } else { - /* Value in header is in units of 400 bps */ - seqhdr->bitrate = seqhdr->bitrate_value * 400; - } - - READ_UINT8 (&br, bits, 1); - if (bits != MARKER_BIT) - goto failed; - - /* VBV buffer size */ - READ_UINT16 (&br, seqhdr->vbv_buffer_size_value, 10); - - /* constrained_parameters_flag */ - READ_UINT8 (&br, seqhdr->constrained_parameters_flag, 1); - - /* load_intra_quantiser_matrix */ - READ_UINT8 (&br, load_intra_flag, 1); - if (load_intra_flag) { - gint i; - for (i = 0; i < 64; i++) - READ_UINT8 (&br, seqhdr->intra_quantizer_matrix[i], 8); - } else - memcpy (seqhdr->intra_quantizer_matrix, default_intra_quantizer_matrix, 64); - - /* non intra quantizer matrix */ - READ_UINT8 (&br, load_non_intra_flag, 1); - if (load_non_intra_flag) { - gint i; - for (i = 0; i < 64; i++) - READ_UINT8 (&br, seqhdr->non_intra_quantizer_matrix[i], 8); - } else - memset (seqhdr->non_intra_quantizer_matrix, 16, 64); - - /* dump some info */ - GST_LOG ("width x height: %d x %d", seqhdr->width, seqhdr->height); - GST_LOG ("fps: %d/%d", seqhdr->fps_n, seqhdr->fps_d); - GST_LOG ("par: %d/%d", seqhdr->par_w, seqhdr->par_h); - GST_LOG ("bitrate: %d", seqhdr->bitrate); - - return TRUE; - - /* ERRORS */ -failed: - { - GST_WARNING ("Failed to parse sequence header"); - /* clear out stuff */ - memset (seqhdr, 0, sizeof (*seqhdr)); - return FALSE; - } -} - -/** - * gst_mpeg_video_packet_parse_sequence_extension: - * @packet: The #GstMpegVideoPacket that carries the data - * @seqext: (out): The #GstMpegVideoSequenceExt structure to fill - * - * Parses the @seqext MPEG Video Sequence Extension structure members - * from video @packet - * - * Returns: %TRUE if the seqext could be parsed correctly, %FALSE otherwize. - * - * Since: 1.2 - */ -gboolean -gst_mpeg_video_packet_parse_sequence_extension (const GstMpegVideoPacket * - packet, GstMpegVideoSequenceExt * seqext) -{ - GstBitReader br; - - g_return_val_if_fail (seqext != NULL, FALSE); - - if (packet->size < 6) { - GST_DEBUG ("not enough bytes to parse the extension"); - return FALSE; - } - - gst_bit_reader_init (&br, &packet->data[packet->offset], packet->size); - - if (gst_bit_reader_get_bits_uint8_unchecked (&br, 4) != - GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE) { - GST_DEBUG ("Not parsing a sequence extension"); - return FALSE; - } - - /* skip profile and level escape bit */ - gst_bit_reader_skip_unchecked (&br, 1); - - seqext->profile = gst_bit_reader_get_bits_uint8_unchecked (&br, 3); - seqext->level = gst_bit_reader_get_bits_uint8_unchecked (&br, 4); - - /* progressive */ - seqext->progressive = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - - /* chroma format */ - seqext->chroma_format = gst_bit_reader_get_bits_uint8_unchecked (&br, 2); - - /* resolution extension */ - seqext->horiz_size_ext = gst_bit_reader_get_bits_uint8_unchecked (&br, 2); - seqext->vert_size_ext = gst_bit_reader_get_bits_uint8_unchecked (&br, 2); - - seqext->bitrate_ext = gst_bit_reader_get_bits_uint16_unchecked (&br, 12); - - /* skip marker bits */ - gst_bit_reader_skip_unchecked (&br, 1); - - seqext->vbv_buffer_size_extension = - gst_bit_reader_get_bits_uint8_unchecked (&br, 8); - seqext->low_delay = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - - /* framerate extension */ - seqext->fps_n_ext = gst_bit_reader_get_bits_uint8_unchecked (&br, 2); - seqext->fps_d_ext = gst_bit_reader_get_bits_uint8_unchecked (&br, 2); - - return TRUE; -} - -/** - * gst_mpeg_video_packet_parse_sequence_display_extension: - * @packet: The #GstMpegVideoPacket that carries the data - * @seqdisplayext: (out): The #GstMpegVideoSequenceDisplayExt - * structure to fill - * - * Parses the @seqext MPEG Video Sequence Display Extension structure - * members from video @packet - * - * Returns: %TRUE if the seqext could be parsed correctly, %FALSE otherwize. - * - * Since: 1.2 - */ -gboolean -gst_mpeg_video_packet_parse_sequence_display_extension (const GstMpegVideoPacket - * packet, GstMpegVideoSequenceDisplayExt * seqdisplayext) -{ - GstBitReader br; - - g_return_val_if_fail (seqdisplayext != NULL, FALSE); - - if (packet->size < 5) { - GST_DEBUG ("not enough bytes to parse the extension"); - return FALSE; - } - - gst_bit_reader_init (&br, &packet->data[packet->offset], packet->size); - - if (gst_bit_reader_get_bits_uint8_unchecked (&br, 4) != - GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE_DISPLAY) { - GST_DEBUG ("Not parsing a sequence display extension"); - return FALSE; - } - - seqdisplayext->video_format = - gst_bit_reader_get_bits_uint8_unchecked (&br, 3); - seqdisplayext->colour_description_flag = - gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - - if (seqdisplayext->colour_description_flag) { - seqdisplayext->colour_primaries = - gst_bit_reader_get_bits_uint8_unchecked (&br, 8); - seqdisplayext->transfer_characteristics = - gst_bit_reader_get_bits_uint8_unchecked (&br, 8); - seqdisplayext->matrix_coefficients = - gst_bit_reader_get_bits_uint8_unchecked (&br, 8); - } - - if (gst_bit_reader_get_remaining (&br) < 29) { - GST_DEBUG ("Not enough remaining bytes to parse the extension"); - return FALSE; - } - - seqdisplayext->display_horizontal_size = - gst_bit_reader_get_bits_uint16_unchecked (&br, 14); - /* skip marker bit */ - gst_bit_reader_skip_unchecked (&br, 1); - seqdisplayext->display_vertical_size = - gst_bit_reader_get_bits_uint16_unchecked (&br, 14); - - return TRUE; -} - -/** - * gst_mpeg_video_packet_parse_sequence_scalable_extension: - * @packet: The #GstMpegVideoPacket that carries the data - * @seqscaleext: (out): The #GstMpegVideoSequenceScalableExt structure to fill - * - * Parses the @seqscaleext MPEG Video Sequence Scalable Extension structure - * members from video @packet - * - * Returns: %TRUE if the seqext could be parsed correctly, %FALSE otherwize. - * - * Since: 1.2 - */ -gboolean - gst_mpeg_video_packet_parse_sequence_scalable_extension - (const GstMpegVideoPacket * packet, - GstMpegVideoSequenceScalableExt * seqscaleext) { - GstBitReader br; - - g_return_val_if_fail (seqscaleext != NULL, FALSE); - - if (packet->size < 2) { - GST_DEBUG ("not enough bytes to parse the extension"); - return FALSE; - } - - gst_bit_reader_init (&br, &packet->data[packet->offset], packet->size); - - if (gst_bit_reader_get_bits_uint8_unchecked (&br, 4) != - GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE_SCALABLE) { - GST_DEBUG ("Not parsing a sequence scalable extension"); - return FALSE; - } - - READ_UINT8 (&br, seqscaleext->scalable_mode, 2); - READ_UINT8 (&br, seqscaleext->layer_id, 4); - - if (seqscaleext->scalable_mode == GST_MPEG_VIDEO_SEQ_SCALABLE_MODE_SPATIAL) { - READ_UINT16 (&br, seqscaleext->lower_layer_prediction_horizontal_size, 14); - - SKIP (&br, 1); - - READ_UINT16 (&br, seqscaleext->lower_layer_prediction_vertical_size, 14); - - READ_UINT8 (&br, seqscaleext->horizontal_subsampling_factor_m, 5); - READ_UINT8 (&br, seqscaleext->horizontal_subsampling_factor_n, 5); - READ_UINT8 (&br, seqscaleext->vertical_subsampling_factor_m, 5); - READ_UINT8 (&br, seqscaleext->vertical_subsampling_factor_n, 5); - } - - if (seqscaleext->scalable_mode == GST_MPEG_VIDEO_SEQ_SCALABLE_MODE_TEMPORAL) { - READ_UINT8 (&br, seqscaleext->picture_mux_enable, 1); - if (seqscaleext->picture_mux_enable) - READ_UINT8 (&br, seqscaleext->mux_to_progressive_sequence, 1); - READ_UINT8 (&br, seqscaleext->picture_mux_order, 3); - READ_UINT8 (&br, seqscaleext->picture_mux_factor, 3); - } - - return TRUE; - -failed: - GST_WARNING ("error parsing \"Sequence Scalable Extension\""); - return FALSE; -} - -gboolean -gst_mpeg_video_finalise_mpeg2_sequence_header (GstMpegVideoSequenceHdr * seqhdr, - GstMpegVideoSequenceExt * seqext, - GstMpegVideoSequenceDisplayExt * displayext) -{ - guint32 w; - guint32 h; - - if (seqext) { - seqhdr->fps_n = seqhdr->fps_n * (seqext->fps_n_ext + 1); - seqhdr->fps_d = seqhdr->fps_d * (seqext->fps_d_ext + 1); - /* Extend width and height to 14 bits by adding the extension bits */ - seqhdr->width |= (seqext->horiz_size_ext << 12); - seqhdr->height |= (seqext->vert_size_ext << 12); - seqhdr->bitrate += (seqext->bitrate_ext << 18) * 400; - } - - w = seqhdr->width; - h = seqhdr->height; - if (displayext) { - /* Use the display size for calculating PAR when display ext present. - * But we are handling this like what DVD players are doing. Which means, - * ignore the display extension values if they are greater than the width/height - * values provided by seqhdr and calculate the PAR based on the seqhdr values. */ - if (displayext->display_horizontal_size < w) - w = displayext->display_horizontal_size; - if (displayext->display_vertical_size < h) - h = displayext->display_vertical_size; - } - - /* Pixel_width = DAR_width * display_vertical_size */ - /* Pixel_height = DAR_height * display_horizontal_size */ - switch (seqhdr->aspect_ratio_info) { - case 0x01: /* Square pixels */ - seqhdr->par_w = seqhdr->par_h = 1; - break; - case 0x02: /* 3:4 DAR = 4:3 pixels */ - seqhdr->par_w = 4 * h; - seqhdr->par_h = 3 * w; - break; - case 0x03: /* 9:16 DAR */ - seqhdr->par_w = 16 * h; - seqhdr->par_h = 9 * w; - break; - case 0x04: /* 1:2.21 DAR */ - seqhdr->par_w = 221 * h; - seqhdr->par_h = 100 * w; - break; - default: - GST_DEBUG ("unknown/invalid aspect_ratio_information %d", - seqhdr->aspect_ratio_info); - break; - } - - return TRUE; -} - -/** - * gst_mpeg_video_packet_parse_quant_matrix_extension: - * @packet: The #GstMpegVideoPacket that carries the data - * @quant: (out): The #GstMpegVideoQuantMatrixExt structure to fill - * - * Parses the @quant MPEG Video Quantization Matrix Extension - * structure members from video @packet - * - * Returns: %TRUE if the quant matrix extension could be parsed correctly, - * %FALSE otherwize. - * - * Since: 1.2 - */ -gboolean -gst_mpeg_video_packet_parse_quant_matrix_extension (const GstMpegVideoPacket * - packet, GstMpegVideoQuantMatrixExt * quant) -{ - guint8 i; - GstBitReader br; - - g_return_val_if_fail (quant != NULL, FALSE); - - if (packet->size < 1) { - GST_DEBUG ("not enough bytes to parse the extension"); - return FALSE; - } - - gst_bit_reader_init (&br, &packet->data[packet->offset], packet->size); - - if (gst_bit_reader_get_bits_uint8_unchecked (&br, 4) != - GST_MPEG_VIDEO_PACKET_EXT_QUANT_MATRIX) { - GST_DEBUG ("Not parsing a quant matrix extension"); - return FALSE; - } - - READ_UINT8 (&br, quant->load_intra_quantiser_matrix, 1); - if (quant->load_intra_quantiser_matrix) { - for (i = 0; i < 64; i++) { - READ_UINT8 (&br, quant->intra_quantiser_matrix[i], 8); - } - } - - READ_UINT8 (&br, quant->load_non_intra_quantiser_matrix, 1); - if (quant->load_non_intra_quantiser_matrix) { - for (i = 0; i < 64; i++) { - READ_UINT8 (&br, quant->non_intra_quantiser_matrix[i], 8); - } - } - - READ_UINT8 (&br, quant->load_chroma_intra_quantiser_matrix, 1); - if (quant->load_chroma_intra_quantiser_matrix) { - for (i = 0; i < 64; i++) { - READ_UINT8 (&br, quant->chroma_intra_quantiser_matrix[i], 8); - } - } - - READ_UINT8 (&br, quant->load_chroma_non_intra_quantiser_matrix, 1); - if (quant->load_chroma_non_intra_quantiser_matrix) { - for (i = 0; i < 64; i++) { - READ_UINT8 (&br, quant->chroma_non_intra_quantiser_matrix[i], 8); - } - } - - return TRUE; - -failed: - GST_WARNING ("error parsing \"Quant Matrix Extension\""); - return FALSE; -} - -/** - * gst_mpeg_video_packet_parse_picture_extension: - * @packet: The #GstMpegVideoPacket that carries the data - * @ext: (out): The #GstMpegVideoPictureExt structure to fill - * - * Parse the @ext MPEG Video Picture Extension structure members from - * video @packet - * - * Returns: %TRUE if the picture extension could be parsed correctly, - * %FALSE otherwize. - * - * Since: 1.2 - */ -gboolean -gst_mpeg_video_packet_parse_picture_extension (const GstMpegVideoPacket * - packet, GstMpegVideoPictureExt * ext) -{ - GstBitReader br; - - g_return_val_if_fail (ext != NULL, FALSE); - - if (packet->size < 5) - return FALSE; - - gst_bit_reader_init (&br, &packet->data[packet->offset], packet->size); - - if (gst_bit_reader_get_bits_uint8_unchecked (&br, 4) != - GST_MPEG_VIDEO_PACKET_EXT_PICTURE) { - GST_DEBUG ("Extension is not a picture extension"); - return FALSE; - } - - /* f_code */ - READ_UINT8 (&br, ext->f_code[0][0], 4); - READ_UINT8 (&br, ext->f_code[0][1], 4); - READ_UINT8 (&br, ext->f_code[1][0], 4); - READ_UINT8 (&br, ext->f_code[1][1], 4); - - /* intra DC precision */ - READ_UINT8 (&br, ext->intra_dc_precision, 2); - - /* picture structure */ - READ_UINT8 (&br, ext->picture_structure, 2); - - /* top field first */ - READ_UINT8 (&br, ext->top_field_first, 1); - - /* frame pred frame dct */ - READ_UINT8 (&br, ext->frame_pred_frame_dct, 1); - - /* concealment motion vectors */ - READ_UINT8 (&br, ext->concealment_motion_vectors, 1); - - /* q scale type */ - READ_UINT8 (&br, ext->q_scale_type, 1); - - /* intra vlc format */ - READ_UINT8 (&br, ext->intra_vlc_format, 1); - - /* alternate scan */ - READ_UINT8 (&br, ext->alternate_scan, 1); - - /* repeat first field */ - READ_UINT8 (&br, ext->repeat_first_field, 1); - - /* chroma_420_type */ - READ_UINT8 (&br, ext->chroma_420_type, 1); - - /* progressive_frame */ - READ_UINT8 (&br, ext->progressive_frame, 1); - - /* composite display */ - READ_UINT8 (&br, ext->composite_display, 1); - - if (ext->composite_display) { - - /* v axis */ - READ_UINT8 (&br, ext->v_axis, 1); - - /* field sequence */ - READ_UINT8 (&br, ext->field_sequence, 3); - - /* sub carrier */ - READ_UINT8 (&br, ext->sub_carrier, 1); - - /* burst amplitude */ - READ_UINT8 (&br, ext->burst_amplitude, 7); - - /* sub_carrier phase */ - READ_UINT8 (&br, ext->sub_carrier_phase, 8); - } - - return TRUE; - -failed: - GST_WARNING ("error parsing \"Picture Coding Extension\""); - return FALSE; - -} - -/** - * gst_mpeg_video_packet_parse_picture_header: - * @packet: The #GstMpegVideoPacket that carries the data - * @pichdr: (out): The #GstMpegVideoPictureHdr structure to fill - * - * Parsers the @pichdr MPEG Video Picture Header structure members - * from video @packet - * - * Returns: %TRUE if the picture sequence could be parsed correctly, %FALSE - * otherwize. - * - * Since: 1.2 - */ -gboolean -gst_mpeg_video_packet_parse_picture_header (const GstMpegVideoPacket * packet, - GstMpegVideoPictureHdr * hdr) -{ - GstBitReader br; - - if (packet->size < 4) - goto failed; - - gst_bit_reader_init (&br, &packet->data[packet->offset], packet->size); - - /* temperal sequence number */ - if (!gst_bit_reader_get_bits_uint16 (&br, &hdr->tsn, 10)) - goto failed; - - - /* frame type */ - if (!gst_bit_reader_get_bits_uint8 (&br, (guint8 *) & hdr->pic_type, 3)) - goto failed; - - - if (hdr->pic_type == 0 || hdr->pic_type > 4) - goto bad_pic_type; /* Corrupted picture packet */ - - /* skip VBV delay */ - if (!gst_bit_reader_skip (&br, 16)) - goto failed; - - if (hdr->pic_type == GST_MPEG_VIDEO_PICTURE_TYPE_P - || hdr->pic_type == GST_MPEG_VIDEO_PICTURE_TYPE_B) { - - READ_UINT8 (&br, hdr->full_pel_forward_vector, 1); - - READ_UINT8 (&br, hdr->f_code[0][0], 3); - hdr->f_code[0][1] = hdr->f_code[0][0]; - } else { - hdr->full_pel_forward_vector = 0; - hdr->f_code[0][0] = hdr->f_code[0][1] = 0; - } - - if (hdr->pic_type == GST_MPEG_VIDEO_PICTURE_TYPE_B) { - READ_UINT8 (&br, hdr->full_pel_backward_vector, 1); - - READ_UINT8 (&br, hdr->f_code[1][0], 3); - hdr->f_code[1][1] = hdr->f_code[1][0]; - } else { - hdr->full_pel_backward_vector = 0; - hdr->f_code[1][0] = hdr->f_code[1][1] = 0; - } - - return TRUE; - -bad_pic_type: - { - GST_WARNING ("Unsupported picture type : %d", hdr->pic_type); - return FALSE; - } - -failed: - { - GST_WARNING ("Not enough data to parse picture header"); - return FALSE; - } -} - -/** - * gst_mpeg_video_packet_parse_gop: - * @packet: The #GstMpegVideoPacket that carries the data - * @gop: (out): The #GstMpegVideoGop structure to fill - * - * Parses the @gop MPEG Video Group of Picture structure members from - * video @packet - * - * Returns: %TRUE if the gop could be parsed correctly, %FALSE otherwize. - * - * Since: 1.2 - */ -gboolean -gst_mpeg_video_packet_parse_gop (const GstMpegVideoPacket * packet, - GstMpegVideoGop * gop) -{ - GstBitReader br; - - g_return_val_if_fail (gop != NULL, FALSE); - - if (packet->size < 4) - return FALSE; - - gst_bit_reader_init (&br, &packet->data[packet->offset], packet->size); - - READ_UINT8 (&br, gop->drop_frame_flag, 1); - - READ_UINT8 (&br, gop->hour, 5); - - READ_UINT8 (&br, gop->minute, 6); - - /* skip unused bit */ - if (!gst_bit_reader_skip (&br, 1)) - return FALSE; - - READ_UINT8 (&br, gop->second, 6); - - READ_UINT8 (&br, gop->frame, 6); - - READ_UINT8 (&br, gop->closed_gop, 1); - - READ_UINT8 (&br, gop->broken_link, 1); - - return TRUE; - -failed: - GST_WARNING ("error parsing \"GOP\""); - return FALSE; -} - -/** - * gst_mpeg_video_packet_parse_slice_header: - * @packet: The #GstMpegVideoPacket that carries the data - * @slice_hdr: (out): The #GstMpegVideoSliceHdr structure to fill - * @seqhdr: The #GstMpegVideoSequenceHdr header - * @seqscaleext: The #GstMpegVideoSequenceScalableExt header - * - * Parses the @GstMpegVideoSliceHdr structure members from @data - * - * Returns: %TRUE if the slice could be parsed correctly, %FALSE otherwize. - * - * Since: 1.2 - */ -gboolean -gst_mpeg_video_packet_parse_slice_header (const GstMpegVideoPacket * packet, - GstMpegVideoSliceHdr * slice_hdr, GstMpegVideoSequenceHdr * seqhdr, - GstMpegVideoSequenceScalableExt * seqscaleext) -{ - GstBitReader br; - guint height; - guint mb_inc; - guint8 bits, extra_bits; - guint8 vertical_position, vertical_position_extension = 0; - - g_return_val_if_fail (seqhdr != NULL, FALSE); - - if (packet->size < 1) - return FALSE; - - gst_bit_reader_init (&br, &packet->data[packet->offset], packet->size); - - if (packet->type < GST_MPEG_VIDEO_PACKET_SLICE_MIN || - packet->type > GST_MPEG_VIDEO_PACKET_SLICE_MAX) { - GST_DEBUG ("Not parsing a slice"); - return FALSE; - } - vertical_position = packet->type - GST_MPEG_VIDEO_PACKET_SLICE_MIN; - - height = seqhdr->height; - if (height > 2800) - READ_UINT8 (&br, vertical_position_extension, 3); - - if (seqscaleext) - if (seqscaleext->scalable_mode == - GST_MPEG_VIDEO_SEQ_SCALABLE_MODE_DATA_PARTITIONING) - READ_UINT8 (&br, slice_hdr->priority_breakpoint, 7); - - READ_UINT8 (&br, slice_hdr->quantiser_scale_code, 5); - - READ_UINT8 (&br, extra_bits, 1); - if (!extra_bits) - slice_hdr->intra_slice = 0; - else { - READ_UINT8 (&br, slice_hdr->intra_slice, 1); - SKIP (&br, 1); - READ_UINT8 (&br, slice_hdr->slice_picture_id, 6); - - READ_UINT8 (&br, bits, 1); - while (bits) { - READ_UINT8 (&br, extra_bits, 8); - READ_UINT8 (&br, bits, 1); - } - } - - slice_hdr->header_size = gst_bit_reader_get_pos (&br); - - if (height > 2800) - slice_hdr->mb_row = (vertical_position_extension << 7) + vertical_position; - else - slice_hdr->mb_row = vertical_position; - - slice_hdr->mb_column = -1; - do { - if (!decode_vlc (&br, &mb_inc, mpeg2_mbaddr_vlc_table, - G_N_ELEMENTS (mpeg2_mbaddr_vlc_table))) { - GST_WARNING ("failed to decode first macroblock_address_increment"); - goto failed; - } - slice_hdr->mb_column += - mb_inc == GST_MPEG_VIDEO_MACROBLOCK_ESCAPE ? 33 : mb_inc; - } while (mb_inc == GST_MPEG_VIDEO_MACROBLOCK_ESCAPE); - - return TRUE; - -failed: - GST_WARNING ("error parsing \"Slice\""); - return FALSE; -} - -/** - * gst_mpeg_video_quant_matrix_get_raster_from_zigzag: - * @out_quant: (out): The resulting quantization matrix - * @quant: The source quantization matrix - * - * Converts quantization matrix @quant from zigzag scan order to - * raster scan order and store the resulting factors into @out_quant. - * - * Note: it is an error to pass the same table in both @quant and - * @out_quant arguments. - * - * Since: 1.2 - */ -void -gst_mpeg_video_quant_matrix_get_raster_from_zigzag (guint8 out_quant[64], - const guint8 quant[64]) -{ - guint i; - - g_return_if_fail (out_quant != quant); - - for (i = 0; i < 64; i++) - out_quant[mpeg_zigzag_8x8[i]] = quant[i]; -} - -/** - * gst_mpeg_video_quant_matrix_get_zigzag_from_raster: - * @out_quant: (out): The resulting quantization matrix - * @quant: The source quantization matrix - * - * Converts quantization matrix @quant from raster scan order to - * zigzag scan order and store the resulting factors into @out_quant. - * - * Note: it is an error to pass the same table in both @quant and - * @out_quant arguments. - * - * Since: 1.2 - */ -void -gst_mpeg_video_quant_matrix_get_zigzag_from_raster (guint8 out_quant[64], - const guint8 quant[64]) -{ - guint i; - - g_return_if_fail (out_quant != quant); - - for (i = 0; i < 64; i++) - out_quant[i] = quant[mpeg_zigzag_8x8[i]]; -} - -/****** Deprecated API *******/ - -/** - * gst_mpeg_video_parse_sequence_header: - * @seqhdr: (out): The #GstMpegVideoSequenceHdr structure to fill - * @data: The data from which to parse the sequence header - * @size: The size of @data - * @offset: The offset in byte from which to start parsing @data - * - * Parses the @seqhdr Mpeg Video Sequence Header structure members from @data - * - * Returns: %TRUE if the seqhdr could be parsed correctly, %FALSE otherwize. - * - * Deprecated: Use gst_mpeg_video_packet_parse_sequence_header() instead. - */ -#ifndef GST_REMOVE_DEPRECATED -#ifdef GST_DISABLE_DEPRECATED -gboolean -gst_mpeg_video_parse_sequence_header (GstMpegVideoSequenceHdr * seqhdr, - const guint8 * data, gsize size, guint offset); -#endif -gboolean -gst_mpeg_video_parse_sequence_header (GstMpegVideoSequenceHdr * seqhdr, - const guint8 * data, gsize size, guint offset) -{ - GstMpegVideoPacket packet; - - packet.data = data; - packet.type = GST_MPEG_VIDEO_PACKET_SEQUENCE; - packet.offset = offset; - packet.size = size - offset; - return gst_mpeg_video_packet_parse_sequence_header (&packet, seqhdr); -} -#endif - -/** - * gst_mpeg_video_parse_sequence_extension: - * @seqext: (out): The #GstMpegVideoSequenceExt structure to fill - * @data: The data from which to parse the sequence extension - * @size: The size of @data - * @offset: The offset in byte from which to start parsing @data - * - * Parses the @seqext Mpeg Video Sequence Extension structure members from @data - * - * Returns: %TRUE if the seqext could be parsed correctly, %FALSE otherwize. - * - * Deprecated: Use gst_mpeg_video_packet_parse_sequence_extension() instead. - */ -#ifndef GST_REMOVE_DEPRECATED -#ifdef GST_DISABLE_DEPRECATED -gboolean -gst_mpeg_video_parse_sequence_extension (GstMpegVideoSequenceExt * seqext, - const guint8 * data, gsize size, guint offset); -#endif -gboolean -gst_mpeg_video_parse_sequence_extension (GstMpegVideoSequenceExt * seqext, - const guint8 * data, gsize size, guint offset) -{ - GstMpegVideoPacket packet; - - packet.data = data; - packet.type = GST_MPEG_VIDEO_PACKET_EXTENSION; - packet.offset = offset; - packet.size = size - offset; - return gst_mpeg_video_packet_parse_sequence_extension (&packet, seqext); -} -#endif - -#ifndef GST_REMOVE_DEPRECATED -#ifdef GST_DISABLE_DEPRECATED -gboolean -gst_mpeg_video_parse_sequence_display_extension (GstMpegVideoSequenceDisplayExt - * seqdisplayext, const guint8 * data, gsize size, guint offset); -#endif -gboolean -gst_mpeg_video_parse_sequence_display_extension (GstMpegVideoSequenceDisplayExt - * seqdisplayext, const guint8 * data, gsize size, guint offset) -{ - GstMpegVideoPacket packet; - - packet.data = data; - packet.type = GST_MPEG_VIDEO_PACKET_EXTENSION; - packet.offset = offset; - packet.size = size - offset; - return gst_mpeg_video_packet_parse_sequence_display_extension (&packet, - seqdisplayext); -} -#endif - -/** - * gst_mpeg_video_parse_quant_matrix_extension: - * @quant: (out): The #GstMpegVideoQuantMatrixExt structure to fill - * @data: The data from which to parse the Quantization Matrix extension - * @size: The size of @data - * @offset: The offset in byte from which to start the parsing - * - * Parses the @quant Mpeg Video Quant Matrix Extension structure members from - * @data - * - * Returns: %TRUE if the quant matrix extension could be parsed correctly, - * %FALSE otherwize. - * - * Deprecated: Use gst_mpeg_video_packet_parse_quant_matrix_extension() instead. - */ -#ifndef GST_REMOVE_DEPRECATED -#ifdef GST_DISABLE_DEPRECATED -gboolean -gst_mpeg_video_parse_quant_matrix_extension (GstMpegVideoQuantMatrixExt * quant, - const guint8 * data, gsize size, guint offset); -#endif -gboolean -gst_mpeg_video_parse_quant_matrix_extension (GstMpegVideoQuantMatrixExt * quant, - const guint8 * data, gsize size, guint offset) -{ - GstMpegVideoPacket packet; - - packet.data = data; - packet.type = GST_MPEG_VIDEO_PACKET_EXTENSION; - packet.offset = offset; - packet.size = size - offset; - return gst_mpeg_video_packet_parse_quant_matrix_extension (&packet, quant); -} -#endif - -/** - * gst_mpeg_video_parse_picture_header: - * @hdr: (out): The #GstMpegVideoPictureHdr structure to fill - * @data: The data from which to parse the picture header - * @size: The size of @data - * @offset: The offset in byte from which to start the parsing - * - * Parsers the @hdr Mpeg Video Picture Header structure members from @data - * - * Returns: %TRUE if the picture sequence could be parsed correctly, %FALSE - * otherwize. - * - * Deprecated: Use gst_mpeg_video_packet_parse_picture_header() instead. - */ -#ifndef GST_REMOVE_DEPRECATED -#ifdef GST_DISABLE_DEPRECATED -gboolean -gst_mpeg_video_parse_picture_header (GstMpegVideoPictureHdr * hdr, - const guint8 * data, gsize size, guint offset); -#endif -gboolean -gst_mpeg_video_parse_picture_header (GstMpegVideoPictureHdr * hdr, - const guint8 * data, gsize size, guint offset) -{ - GstMpegVideoPacket packet; - - packet.data = data; - packet.type = GST_MPEG_VIDEO_PACKET_PICTURE; - packet.offset = offset; - packet.size = size - offset; - return gst_mpeg_video_packet_parse_picture_header (&packet, hdr); -} -#endif - -/** - * gst_mpeg_video_parse_picture_extension: - * @ext: (out): The #GstMpegVideoPictureExt structure to fill - * @data: The data from which to parse the picture extension - * @size: The size of @data - * @offset: The offset in byte from which to start the parsing - * - * Parse the @ext Mpeg Video Picture Extension structure members from @data - * - * Returns: %TRUE if the picture extension could be parsed correctly, - * %FALSE otherwize. - * - * Deprecated: Use gst_mpeg_video_packet_parse_picture_extension() instead. - */ -#ifndef GST_REMOVE_DEPRECATED -#ifdef GST_DISABLE_DEPRECATED -gboolean -gst_mpeg_video_parse_picture_extension (GstMpegVideoPictureExt * ext, - const guint8 * data, gsize size, guint offset); -#endif -gboolean -gst_mpeg_video_parse_picture_extension (GstMpegVideoPictureExt * ext, - const guint8 * data, gsize size, guint offset) -{ - GstMpegVideoPacket packet; - - packet.data = data; - packet.type = GST_MPEG_VIDEO_PACKET_EXTENSION; - packet.offset = offset; - packet.size = size - offset; - return gst_mpeg_video_packet_parse_picture_extension (&packet, ext); -} -#endif - -/** - * gst_mpeg_video_parse_gop: - * @gop: (out): The #GstMpegVideoGop structure to fill - * @data: The data from which to parse the gop - * @size: The size of @data - * @offset: The offset in byte from which to start the parsing - * - * Parses the @gop Mpeg Video Group of Picture structure members from @data - * - * Returns: %TRUE if the gop could be parsed correctly, %FALSE otherwize. - * - * Deprecated: Use gst_mpeg_video_packet_parse_gop() instead. - */ -#ifndef GST_REMOVE_DEPRECATED -#ifdef GST_DISABLE_DEPRECATED -gboolean -gst_mpeg_video_parse_gop (GstMpegVideoGop * gop, const guint8 * data, - gsize size, guint offset); -#endif -gboolean -gst_mpeg_video_parse_gop (GstMpegVideoGop * gop, const guint8 * data, - gsize size, guint offset) -{ - GstMpegVideoPacket packet; - - packet.data = data; - packet.type = GST_MPEG_VIDEO_PACKET_GOP; - packet.offset = offset; - packet.size = size - offset; - return gst_mpeg_video_packet_parse_gop (&packet, gop); -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstmpegvideoparser.h gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstmpegvideoparser.h --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstmpegvideoparser.h 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstmpegvideoparser.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,554 +0,0 @@ -/* Gstreamer - * Copyright (C) <2011> Intel Corporation - * Copyright (C) <2011> Collabora Ltd. - * Copyright (C) <2011> Thibault Saunier - * - * From bad/sys/vdpau/mpeg/mpegutil.c: - * Copyright (C) <2007> Jan Schmidt - * Copyright (C) <2009> Carl-Anton Ingmarsson - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef __GST_MPEG_VIDEO_UTILS_H__ -#define __GST_MPEG_VIDEO_UTILS_H__ - -#ifndef GST_USE_UNSTABLE_API -#warning "The Mpeg video parsing library is unstable API and may change in future." -#warning "You can define GST_USE_UNSTABLE_API to avoid this warning." -#endif - -#include - -G_BEGIN_DECLS - -/** - * GstMpegVideoPacketTypeCode: - * @GST_MPEG_VIDEO_PACKET_PICTURE: Picture packet starting code - * @GST_MPEG_VIDEO_PACKET_SLICE_MIN: Slice min packet starting code - * @GST_MPEG_VIDEO_PACKET_SLICE_MAX: Slice max packet starting code - * @GST_MPEG_VIDEO_PACKET_USER_DATA: User data packet starting code - * @GST_MPEG_VIDEO_PACKET_SEQUENCE : Sequence packet starting code - * @GST_MPEG_VIDEO_PACKET_EXTENSION: Extension packet starting code - * @GST_MPEG_VIDEO_PACKET_SEQUENCE_END: Sequence end packet code - * @GST_MPEG_VIDEO_PACKET_GOP: Group of Picture packet starting code - * @GST_MPEG_VIDEO_PACKET_NONE: None packet code - * - * Indicates the type of MPEG packet - */ -typedef enum { - GST_MPEG_VIDEO_PACKET_PICTURE = 0x00, - GST_MPEG_VIDEO_PACKET_SLICE_MIN = 0x01, - GST_MPEG_VIDEO_PACKET_SLICE_MAX = 0xaf, - GST_MPEG_VIDEO_PACKET_USER_DATA = 0xb2, - GST_MPEG_VIDEO_PACKET_SEQUENCE = 0xb3, - GST_MPEG_VIDEO_PACKET_EXTENSION = 0xb5, - GST_MPEG_VIDEO_PACKET_SEQUENCE_END = 0xb7, - GST_MPEG_VIDEO_PACKET_GOP = 0xb8, - GST_MPEG_VIDEO_PACKET_NONE = 0xff -} GstMpegVideoPacketTypeCode; - -/** - * GST_MPEG_VIDEO_PACKET_IS_SLICE: - * @typecode: The MPEG video packet type code - * - * Checks whether a packet type code is a slice. - * - * Returns: %TRUE if the packet type code corresponds to a slice, - * else %FALSE. - */ -#define GST_MPEG_VIDEO_PACKET_IS_SLICE(typecode) ((typecode) >= GST_MPEG_VIDEO_PACKET_SLICE_MIN && \ - (typecode) <= GST_MPEG_VIDEO_PACKET_SLICE_MAX) - -/** - * GstMpegVideoPacketExtensionCode: - * @GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE: Sequence extension code - * @GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE_DISPLAY: Sequence Display extension code - * @GST_MPEG_VIDEO_PACKET_EXT_QUANT_MATRIX: Quantization Matrix extension code - * @GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE_SCALABLE: Sequence Scalable extension code - * @GST_MPEG_VIDEO_PACKET_EXT_PICTURE: Picture coding extension - * - * Indicates what type of packets are in this block, some are mutually - * exclusive though - ie, sequence packs are accumulated separately. GOP & - * Picture may occur together or separately. - */ -typedef enum { - GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE = 0x01, - GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE_DISPLAY = 0x02, - GST_MPEG_VIDEO_PACKET_EXT_QUANT_MATRIX = 0x03, - GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE_SCALABLE = 0x05, - GST_MPEG_VIDEO_PACKET_EXT_PICTURE = 0x08 -} GstMpegVideoPacketExtensionCode; - -/** - * GstMpegVideoSequenceScalableMode: - * @GST_MPEG_VIDEO_SEQ_SCALABLE_MODE_DATA_PARTITIONING: Data partitioning - * @GST_MPEG_VIDEO_SEQ_SCALABLE_MODE_SPATIAL: Spatial Scalability - * @GST_MPEG_VIDEO_SEQ_SCALABLE_MODE_SNR: SNR Scalability - * @GST_MPEG_VIDEO_SEQ_SCALABLE_MODE_TEMPORAL: Temporal Scalability - */ -typedef enum { - GST_MPEG_VIDEO_SEQ_SCALABLE_MODE_DATA_PARTITIONING = 0x00, - GST_MPEG_VIDEO_SEQ_SCALABLE_MODE_SPATIAL = 0x01, - GST_MPEG_VIDEO_SEQ_SCALABLE_MODE_SNR = 0x02, - GST_MPEG_VIDEO_SEQ_SCALABLE_MODE_TEMPORAL = 0x03 -} GstMpegVideoSequenceScalableMode; - -/** - * GstMpegVideoLevel: - * @GST_MPEG_VIDEO_LEVEL_LOW: Low level (LL) - * @GST_MPEG_VIDEO_LEVEL_MAIN: Main level (ML) - * @GST_MPEG_VIDEO_LEVEL_HIGH_1440: High 1440 level (H-14) - * @GST_MPEG_VIDEO_LEVEL_HIGH: High level (HL) - * - * Mpeg-2 Levels. - **/ -typedef enum { - GST_MPEG_VIDEO_LEVEL_HIGH = 0x04, - GST_MPEG_VIDEO_LEVEL_HIGH_1440 = 0x06, - GST_MPEG_VIDEO_LEVEL_MAIN = 0x08, - GST_MPEG_VIDEO_LEVEL_LOW = 0x0a -} GstMpegVideoLevel; - -/** - * GstMpegVideoProfile: - * @GST_MPEG_VIDEO_PROFILE_422: 4:2:2 profile (422) - * @GST_MPEG_VIDEO_PROFILE_HIGH: High profile (HP) - * @GST_MPEG_VIDEO_PROFILE_SPATIALLY_SCALABLE: Spatially Scalable profile (Spatial) - * @GST_MPEG_VIDEO_PROFILE_SNR_SCALABLE: SNR Scalable profile (SNR) - * @GST_MPEG_VIDEO_PROFILE_MAIN: Main profile (MP) - * @GST_MPEG_VIDEO_PROFILE_SIMPLE: Simple profile (SP) - * - * Mpeg-2 Profiles. - **/ -typedef enum { - GST_MPEG_VIDEO_PROFILE_422 = 0x00, - GST_MPEG_VIDEO_PROFILE_HIGH = 0x01, - GST_MPEG_VIDEO_PROFILE_SPATIALLY_SCALABLE = 0x02, - GST_MPEG_VIDEO_PROFILE_SNR_SCALABLE = 0x03, - GST_MPEG_VIDEO_PROFILE_MAIN = 0x04, - GST_MPEG_VIDEO_PROFILE_SIMPLE = 0x05 -} GstMpegVideoProfile; - -/** - * GstMpegVideoChromaFormat: - * @GST_MPEG_VIDEO_CHROMA_RES: Invalid (reserved for future use) - * @GST_MPEG_VIDEO_CHROMA_420: 4:2:0 subsampling - * @GST_MPEG_VIDEO_CHROMA_422: 4:2:2 subsampling - * @GST_MPEG_VIDEO_CHROMA_444: 4:4:4 (non-subsampled) - * - * Chroma subsampling type. - */ -typedef enum { - GST_MPEG_VIDEO_CHROMA_RES = 0x00, - GST_MPEG_VIDEO_CHROMA_420 = 0x01, - GST_MPEG_VIDEO_CHROMA_422 = 0x02, - GST_MPEG_VIDEO_CHROMA_444 = 0x03, -} GstMpegVideoChromaFormat; - -/** - * GstMpegVideoPictureType: - * @GST_MPEG_VIDEO_PICTURE_TYPE_I: Intra-coded (I) frame - * @GST_MPEG_VIDEO_PICTURE_TYPE_P: Predictive-codec (P) frame - * @GST_MPEG_VIDEO_PICTURE_TYPE_B: Bidirectionally predictive-coded (B) frame - * @GST_MPEG_VIDEO_PICTURE_TYPE_D: D frame - * - * Picture type. - */ -typedef enum { - GST_MPEG_VIDEO_PICTURE_TYPE_I = 0x01, - GST_MPEG_VIDEO_PICTURE_TYPE_P = 0x02, - GST_MPEG_VIDEO_PICTURE_TYPE_B = 0x03, - GST_MPEG_VIDEO_PICTURE_TYPE_D = 0x04 -} GstMpegVideoPictureType; - -/** - * GstMpegVideoPictureStructure: - * @GST_MPEG_VIDEO_PICTURE_STRUCTURE_TOP_FIELD: Top field - * @GST_MPEG_VIDEO_PICTURE_STRUCTURE_BOTTOM_FIELD: Bottom field - * @GST_MPEG_VIDEO_PICTURE_STRUCTURE_FRAME: Frame picture - * - * Picture structure type. - */ -typedef enum { - GST_MPEG_VIDEO_PICTURE_STRUCTURE_TOP_FIELD = 0x01, - GST_MPEG_VIDEO_PICTURE_STRUCTURE_BOTTOM_FIELD = 0x02, - GST_MPEG_VIDEO_PICTURE_STRUCTURE_FRAME = 0x03 -} GstMpegVideoPictureStructure; - -typedef struct _GstMpegVideoSequenceHdr GstMpegVideoSequenceHdr; -typedef struct _GstMpegVideoSequenceExt GstMpegVideoSequenceExt; -typedef struct _GstMpegVideoSequenceDisplayExt GstMpegVideoSequenceDisplayExt; -typedef struct _GstMpegVideoSequenceScalableExt GstMpegVideoSequenceScalableExt; -typedef struct _GstMpegVideoPictureHdr GstMpegVideoPictureHdr; -typedef struct _GstMpegVideoGop GstMpegVideoGop; -typedef struct _GstMpegVideoPictureExt GstMpegVideoPictureExt; -typedef struct _GstMpegVideoQuantMatrixExt GstMpegVideoQuantMatrixExt; -typedef struct _GstMpegVideoSliceHdr GstMpegVideoSliceHdr; -typedef struct _GstMpegVideoPacket GstMpegVideoPacket; - -/** - * GstMpegVideoSequenceHdr: - * @width: Width of each frame - * @height: Height of each frame - * @par_w: Calculated Pixel Aspect Ratio width - * @par_h: Calculated Pixel Aspect Ratio height - * @fps_n: Calculated Framrate nominator - * @fps_d: Calculated Framerate denominator - * @bitrate_value: Value of the bitrate as is in the stream (400bps unit) - * @bitrate: the real bitrate of the Mpeg video stream in bits per second, 0 if VBR stream - * @constrained_parameters_flag: %TRUE if this stream uses contrained parameters. - * @intra_quantizer_matrix: intra-quantization table, in zigzag scan order - * @non_intra_quantizer_matrix: non-intra quantization table, in zigzag scan order - * - * The Mpeg2 Video Sequence Header structure. - */ -struct _GstMpegVideoSequenceHdr -{ - guint16 width, height; - guint8 aspect_ratio_info; - guint8 frame_rate_code; - guint32 bitrate_value; - guint16 vbv_buffer_size_value; - - guint8 constrained_parameters_flag; - - guint8 intra_quantizer_matrix[64]; - guint8 non_intra_quantizer_matrix[64]; - - /* Calculated values */ - guint par_w, par_h; - guint fps_n, fps_d; - guint bitrate; -}; - -/** - * GstMpegVideoSequenceExt: - * @profile: mpeg2 decoder profile - * @level: mpeg2 decoder level - * @progressive: %TRUE if the frames are progressive %FALSE otherwise - * @chroma_format: indicates the chrominance format - * @horiz_size_ext: Horizontal size - * @vert_size_ext: Vertical size - * @bitrate_ext: The bitrate - * @vbv_buffer_size_extension: VBV vuffer size - * @low_delay: %TRUE if the sequence doesn't contain any B-pictures, %FALSE - * otherwise - * @fps_n_ext: Framerate nominator code - * @fps_d_ext: Framerate denominator code - * - * The Mpeg2 Video Sequence Extension structure. - **/ -struct _GstMpegVideoSequenceExt -{ - /* mpeg2 decoder profile */ - guint8 profile; - /* mpeg2 decoder level */ - guint8 level; - - guint8 progressive; - guint8 chroma_format; - - guint8 horiz_size_ext, vert_size_ext; - - guint16 bitrate_ext; - guint8 vbv_buffer_size_extension; - guint8 low_delay; - guint8 fps_n_ext, fps_d_ext; - -}; - -/** - * GstMpegVideoSequenceDisplayExt: - * @profile: mpeg2 decoder profil - - */ -struct _GstMpegVideoSequenceDisplayExt -{ - guint8 video_format; - guint8 colour_description_flag; - - /* if colour_description_flag: */ - guint8 colour_primaries; - guint8 transfer_characteristics; - guint8 matrix_coefficients; - - guint16 display_horizontal_size; - guint16 display_vertical_size; -}; - -/** - * GstMpegVideoSequenceScalableExt: - * @scalable_mode: - * @layer_id: - * @lower_layer_prediction_horizontal_size: - * @lower_layer_prediction_vertical_size: - * @horizontal_subsampling_factor_m: - * @horizontal_subsampling_factor_n: - * @vertical_subsampling_factor_m: - * @vertical_subsampling_factor_n: - * @picture_mux_enable: - * @mux_to_progressive_sequence: - * @picture_mux_order: - * @picture_mux_factor: - * - * The Sequence Scalable Extension structure. - * - * Since: 1.2 - */ -struct _GstMpegVideoSequenceScalableExt -{ - guint8 scalable_mode; - guint8 layer_id; - - /* if spatial scalability */ - guint16 lower_layer_prediction_horizontal_size; - guint16 lower_layer_prediction_vertical_size; - guint8 horizontal_subsampling_factor_m; - guint8 horizontal_subsampling_factor_n; - guint8 vertical_subsampling_factor_m; - guint8 vertical_subsampling_factor_n; - - /* if temporal scalability */ - guint8 picture_mux_enable; - guint8 mux_to_progressive_sequence; - guint8 picture_mux_order; - guint8 picture_mux_factor; -}; - -/** - * GstMpegVideoQuantMatrixExt: - * @load_intra_quantiser_matrix: - * @intra_quantiser_matrix: - * @load_non_intra_quantiser_matrix: - * @non_intra_quantiser_matrix: - * @load_chroma_intra_quantiser_matrix: - * @chroma_intra_quantiser_matrix: - * @load_chroma_non_intra_quantiser_matrix: - * @chroma_non_intra_quantiser_matrix: - * - * The Quant Matrix Extension structure that exposes quantization - * matrices in zigzag scan order. i.e. the original encoded scan - * order. - */ -struct _GstMpegVideoQuantMatrixExt -{ - guint8 load_intra_quantiser_matrix; - guint8 intra_quantiser_matrix[64]; - guint8 load_non_intra_quantiser_matrix; - guint8 non_intra_quantiser_matrix[64]; - guint8 load_chroma_intra_quantiser_matrix; - guint8 chroma_intra_quantiser_matrix[64]; - guint8 load_chroma_non_intra_quantiser_matrix; - guint8 chroma_non_intra_quantiser_matrix[64]; -}; - -/** - * GstMpegVideoPictureHdr: - * @tsn: Temporal Sequence Number - * @pic_type: Type of the frame - * @full_pel_forward_vector: the full pel forward flag of - * the frame: 0 or 1. - * @full_pel_backward_vector: the full pel backward flag - * of the frame: 0 or 1. - * @f_code: F code - * - * The Mpeg2 Video Picture Header structure. - */ -struct _GstMpegVideoPictureHdr -{ - guint16 tsn; - guint8 pic_type; - - guint8 full_pel_forward_vector, full_pel_backward_vector; - - guint8 f_code[2][2]; -}; - -/** - * GstMpegVideoPictureExt: - * @intra_dc_precision: Intra DC precision - * @picture_structure: Structure of the picture - * @top_field_first: Top field first - * @frame_pred_frame_dct: Frame - * @concealment_motion_vectors: Concealment Motion Vectors - * @q_scale_type: Q Scale Type - * @intra_vlc_format: Intra Vlc Format - * @alternate_scan: Alternate Scan - * @repeat_first_field: Repeat First Field - * @chroma_420_type: Chroma 420 Type - * @progressive_frame: %TRUE if the frame is progressive %FALSE otherwize - * - * The Mpeg2 Video Picture Extension structure. - */ -struct _GstMpegVideoPictureExt -{ - guint8 f_code[2][2]; - - guint8 intra_dc_precision; - guint8 picture_structure; - guint8 top_field_first; - guint8 frame_pred_frame_dct; - guint8 concealment_motion_vectors; - guint8 q_scale_type; - guint8 intra_vlc_format; - guint8 alternate_scan; - guint8 repeat_first_field; - guint8 chroma_420_type; - guint8 progressive_frame; - guint8 composite_display; - guint8 v_axis; - guint8 field_sequence; - guint8 sub_carrier; - guint8 burst_amplitude; - guint8 sub_carrier_phase; -}; - -/** - * GstMpegVideoGop: - * @drop_frame_flag: Drop Frame Flag - * @hour: Hour (0-23) - * @minute: Minute (O-59) - * @second: Second (0-59) - * @frame: Frame (0-59) - * @closed_gop: Closed Gop - * @broken_link: Broken link - * - * The Mpeg Video Group of Picture structure. - */ -struct _GstMpegVideoGop -{ - guint8 drop_frame_flag; - - guint8 hour, minute, second, frame; - - guint8 closed_gop; - guint8 broken_link; -}; - -/** - * GstMpegVideoSliceHdr: - * @slice_vertical_position_extension: Extension to slice_vertical_position - * @priority_breakpoint: Point where the bitstream shall be partitioned - * @quantiser_scale_code: Quantiser value (range: 1-31) - * @intra_slice: Equal to one if all the macroblocks are intra macro blocks. - * @slice_picture_id: Intended to aid recovery on severe bursts of - * errors for certain types of applications - * - * The Mpeg2 Video Slice Header structure. - * - * Since: 1.2 - */ -struct _GstMpegVideoSliceHdr -{ - guint8 priority_breakpoint; - guint8 quantiser_scale_code; - guint8 intra_slice; - guint8 slice_picture_id; - - /* Calculated values */ - guint header_size; /* slice_header size in bits */ - gint mb_row; /* macroblock row */ - gint mb_column; /* macroblock column */ -}; - -/** - * GstMpegVideoPacket: - * @type: the type of the packet that start at @offset, as a #GstMpegVideoPacketTypeCode - * @data: the data containing the packet starting at @offset - * @offset: the offset of the packet start in bytes from @data. This is the - * start of the packet itself without the sync code - * @size: The size in bytes of the packet or -1 if the end wasn't found. This - * is the size of the packet itself without the sync code - * - * A structure that contains the type of a packet, its offset and its size - */ -struct _GstMpegVideoPacket -{ - const guint8 *data; - guint8 type; - guint offset; - gint size; -}; - -gboolean gst_mpeg_video_parse (GstMpegVideoPacket * packet, - const guint8 * data, gsize size, guint offset); - -gboolean gst_mpeg_video_packet_parse_sequence_header (const GstMpegVideoPacket * packet, - GstMpegVideoSequenceHdr * seqhdr); - -gboolean gst_mpeg_video_packet_parse_sequence_extension (const GstMpegVideoPacket * packet, - GstMpegVideoSequenceExt * seqext); - -gboolean gst_mpeg_video_packet_parse_sequence_display_extension (const GstMpegVideoPacket * packet, - GstMpegVideoSequenceDisplayExt * seqdisplayext); - -gboolean gst_mpeg_video_packet_parse_sequence_scalable_extension (const GstMpegVideoPacket * packet, - GstMpegVideoSequenceScalableExt * seqscaleext); - -gboolean gst_mpeg_video_packet_parse_picture_header (const GstMpegVideoPacket * packet, - GstMpegVideoPictureHdr* pichdr); - -gboolean gst_mpeg_video_packet_parse_picture_extension (const GstMpegVideoPacket * packet, - GstMpegVideoPictureExt *picext); - -gboolean gst_mpeg_video_packet_parse_gop (const GstMpegVideoPacket * packet, - GstMpegVideoGop * gop); - -gboolean gst_mpeg_video_packet_parse_slice_header (const GstMpegVideoPacket * packet, - GstMpegVideoSliceHdr * slice_hdr, - GstMpegVideoSequenceHdr * seq_hdr, - GstMpegVideoSequenceScalableExt * seqscaleext); - -gboolean gst_mpeg_video_packet_parse_quant_matrix_extension (const GstMpegVideoPacket * packet, - GstMpegVideoQuantMatrixExt * quant); - -/* seqext and displayext may be NULL if not received */ -gboolean gst_mpeg_video_finalise_mpeg2_sequence_header (GstMpegVideoSequenceHdr *hdr, - GstMpegVideoSequenceExt *seqext, GstMpegVideoSequenceDisplayExt *displayext); - -#ifndef GST_DISABLE_DEPRECATED -gboolean gst_mpeg_video_parse_picture_header (GstMpegVideoPictureHdr* hdr, - const guint8 * data, gsize size, guint offset); - -gboolean gst_mpeg_video_parse_picture_extension (GstMpegVideoPictureExt *ext, - const guint8 * data, gsize size, guint offset); - -gboolean gst_mpeg_video_parse_gop (GstMpegVideoGop * gop, - const guint8 * data, gsize size, guint offset); - -gboolean gst_mpeg_video_parse_sequence_header (GstMpegVideoSequenceHdr * seqhdr, - const guint8 * data, gsize size, guint offset); - -gboolean gst_mpeg_video_parse_sequence_extension (GstMpegVideoSequenceExt * seqext, - const guint8 * data, gsize size, guint offset); - -gboolean gst_mpeg_video_parse_sequence_display_extension (GstMpegVideoSequenceDisplayExt * seqdisplayext, - const guint8 * data, gsize size, guint offset); - -gboolean gst_mpeg_video_parse_quant_matrix_extension (GstMpegVideoQuantMatrixExt * quant, - const guint8 * data, gsize size, guint offset); -#endif - -void gst_mpeg_video_quant_matrix_get_raster_from_zigzag (guint8 out_quant[64], - const guint8 quant[64]); - -void gst_mpeg_video_quant_matrix_get_zigzag_from_raster (guint8 out_quant[64], - const guint8 quant[64]); - -G_END_DECLS - -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstvc1parser.c gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstvc1parser.c --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstvc1parser.c 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstvc1parser.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2237 +0,0 @@ -/* Gstreamer - * Copyright (C) <2011> Intel - * Copyright (C) <2011> Collabora Ltd. - * Copyright (C) <2011> Thibault Saunier - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -/** - * SECTION:gstvc1parser - * @short_description: Convenience library for parsing vc1 video - * bitstream. - * - * For more details about the structures, look at the - * smpte specifications (S421m-2006.pdf). - * - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "gstvc1parser.h" -#include "parserutils.h" -#include -#include -#include -#include - -#ifndef GST_DISABLE_GST_DEBUG - -#define GST_CAT_DEFAULT ensure_debug_category() - -static GstDebugCategory * -ensure_debug_category (void) -{ - static gsize cat_gonce = 0; - - if (g_once_init_enter (&cat_gonce)) { - gsize cat_done; - - cat_done = (gsize) _gst_debug_category_new ("codecparsers_vc1", 0, - "VC1 codec parsing library"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} - -#else - -#define ensure_debug_category() /* NOOP */ - -#endif /* GST_DISABLE_GST_DEBUG */ - -static const guint8 vc1_pquant_table[3][32] = { - { /* Implicit quantizer */ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 29, 31}, - { /* Explicit quantizer, pquantizer uniform */ - 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}, - { /* Explicit quantizer, pquantizer non-uniform */ - 0, 1, 1, 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, 29, 31} -}; - -static const guint8 vc1_mvmode_table[2][5] = { - /* Table 47: P Picture High rate (PQUANT <= 12) MVMODE code table */ - { - GST_VC1_MVMODE_1MV, - GST_VC1_MVMODE_MIXED_MV, - GST_VC1_MVMODE_1MV_HPEL, - GST_VC1_MVMODE_INTENSITY_COMP, - GST_VC1_MVMODE_1MV_HPEL_BILINEAR}, - /* Table 46: P Picture Low rate (PQUANT > 12) MVMODE code table */ - { - GST_VC1_MVMODE_1MV_HPEL_BILINEAR, - GST_VC1_MVMODE_1MV, - GST_VC1_MVMODE_1MV_HPEL, - GST_VC1_MVMODE_INTENSITY_COMP, - GST_VC1_MVMODE_MIXED_MV} -}; - -static const guint8 vc1_mvmode2_table[2][4] = { - /* Table 50: P Picture High rate (PQUANT <= 12) MVMODE2 code table */ - { - GST_VC1_MVMODE_1MV, - GST_VC1_MVMODE_MIXED_MV, - GST_VC1_MVMODE_1MV_HPEL, - GST_VC1_MVMODE_1MV_HPEL_BILINEAR}, - /* Table 49: P Picture Low rate (PQUANT > 12) MVMODE2 code table */ - { - GST_VC1_MVMODE_1MV_HPEL_BILINEAR, - GST_VC1_MVMODE_1MV, - GST_VC1_MVMODE_1MV_HPEL, - GST_VC1_MVMODE_MIXED_MV} -}; - -/* Table 40: BFRACTION VLC Table */ -static const VLCTable vc1_bfraction_vlc_table[] = { - {GST_VC1_BFRACTION_BASIS / 2, 0x00, 3}, - {GST_VC1_BFRACTION_BASIS / 3, 0x01, 3}, - {(GST_VC1_BFRACTION_BASIS * 2) / 3, 0x02, 3}, - {GST_VC1_BFRACTION_BASIS / 4, 0x02, 3}, - {(GST_VC1_BFRACTION_BASIS * 3) / 4, 0x04, 3}, - {GST_VC1_BFRACTION_BASIS / 5, 0x05, 3}, - {(GST_VC1_BFRACTION_BASIS * 2) / 5, 0x06, 3}, - {(GST_VC1_BFRACTION_BASIS * 3) / 5, 0x70, 7}, - {(GST_VC1_BFRACTION_BASIS * 4) / 5, 0x71, 7}, - {GST_VC1_BFRACTION_BASIS / 6, 0x72, 7}, - {(GST_VC1_BFRACTION_BASIS * 5) / 6, 0x73, 7}, - {GST_VC1_BFRACTION_BASIS / 7, 0x74, 7}, - {(GST_VC1_BFRACTION_BASIS * 2) / 7, 0x75, 7}, - {(GST_VC1_BFRACTION_BASIS * 3) / 7, 0x76, 7}, - {(GST_VC1_BFRACTION_BASIS * 4) / 7, 0x77, 7}, - {(GST_VC1_BFRACTION_BASIS * 5) / 7, 0x78, 7}, - {(GST_VC1_BFRACTION_BASIS * 6) / 7, 0x79, 7}, - {GST_VC1_BFRACTION_BASIS / 8, 0x7a, 7}, - {(GST_VC1_BFRACTION_BASIS * 3) / 8, 0x7b, 7}, - {(GST_VC1_BFRACTION_BASIS * 5) / 8, 0x7c, 7}, - {(GST_VC1_BFRACTION_BASIS * 7) / 8, 0x7d, 7}, - {GST_VC1_BFRACTION_RESERVED, 0x7e, 7}, - {GST_VC1_BFRACTION_PTYPE_BI, 0x7f, 7} -}; - -/* Imode types */ -enum -{ - IMODE_RAW, - IMODE_NORM2, - IMODE_DIFF2, - IMODE_NORM6, - IMODE_DIFF6, - IMODE_ROWSKIP, - IMODE_COLSKIP -}; - -/* Table 69: IMODE VLC Codetable */ -static const VLCTable vc1_imode_vlc_table[] = { - {IMODE_NORM2, 0x02, 2}, - {IMODE_NORM6, 0x03, 2}, - {IMODE_ROWSKIP, 0x02, 3}, - {IMODE_COLSKIP, 0x03, 3}, - {IMODE_DIFF2, 0x01, 3}, - {IMODE_DIFF6, 0x01, 4}, - {IMODE_RAW, 0x00, 4} -}; - -/* Table 80: Norm-2/Diff-2 Code Table */ -static const VLCTable vc1_norm2_vlc_table[4] = { - {0, 0, 1}, - {2, 4, 3}, - {1, 5, 3}, - {3, 3, 2} -}; - -/* Table 81: Code table for 3x2 and 2x3 tiles */ -static const VLCTable vc1_norm6_vlc_table[64] = { - {0, 1, 1}, - {1, 2, 4}, - {2, 3, 4}, - {3, 0, 8}, - {4, 4, 4}, - {5, 1, 8}, - {6, 2, 8}, - {7, (2 << 5) | 7, 10}, - {8, 5, 4}, - {9, 3, 8}, - {10, 4, 8}, - {11, (2 << 5) | 11, 10}, - {12, 5, 8}, - {13, (2 << 5) | 13, 10}, - {14, (2 << 5) | 14, 10}, - {15, (3 << 8) | 14, 13}, - {16, 6, 4}, - {17, 6, 8}, - {18, 7, 8}, - {19, (2 << 5) | 19, 10}, - {20, 8, 8}, - {21, (2 << 5) | 21, 10}, - {22, (2 << 5) | 22, 10}, - {23, (3 << 8) | 13, 13}, - {24, 9, 8}, - {25, (2 << 5) | 25, 10}, - {26, (2 << 5) | 26, 10}, - {27, (3 << 8) | 12, 13}, - {28, (2 << 5) | 28, 10}, - {29, (3 << 8) | 11, 13}, - {30, (3 << 8) | 10, 13}, - {31, (3 << 4) | 7, 9}, - {32, 7, 4}, - {33, 10, 8}, - {34, 11, 8}, - {35, (2 << 5) | 3, 10}, - {36, 12, 8}, - {37, (2 << 5) | 5, 10}, - {38, (2 << 5) | 6, 10}, - {39, (3 << 8) | 9, 13}, - {40, 13, 8}, - {41, (2 << 5) | 9, 10}, - {42, (2 << 5) | 10, 10}, - {43, (3 << 8) | 8, 13}, - {44, (2 << 5) | 12, 10}, - {45, (3 << 8) | 7, 13}, - {46, (3 << 8) | 6, 13}, - {47, (3 << 4) | 6, 9}, - {48, 14, 8}, - {49, (2 << 5) | 17, 10}, - {50, (2 << 5) | 18, 10}, - {51, (3 << 8) | 5, 13}, - {52, (2 << 5) | 20, 10}, - {53, (3 << 8) | 4, 13}, - {54, (3 << 8) | 3, 13}, - {55, (3 << 4) | 5, 9}, - {56, (2 << 5) | 24, 10}, - {57, (3 << 8) | 2, 13}, - {58, (3 << 8) | 1, 13}, - {59, (3 << 4) | 4, 9}, - {60, (3 << 8) | 0, 13}, - {61, (3 << 4) | 3, 9}, - {62, (3 << 4) | 2, 9}, - {63, (3 << 1) | 1, 6} -}; - -/* SMPTE 421M Table 7 */ -typedef struct -{ - gint par_n, par_d; -} PAR; - -static const PAR aspect_ratios[] = { - {0, 0}, - {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}, - {0, 0}, - {0, 0} -}; - -/* SMPTE 421M Table 8 */ -static const guint framerates_n[] = { - 0, - 24 * 1000, - 25 * 1000, - 30 * 1000, - 50 * 1000, - 60 * 1000, - 48 * 1000, - 72 * 1000 -}; - -/* SMPTE 421M Table 9 */ -static const guint framerates_d[] = { - 0, - 1000, - 1001 -}; - - -static inline gboolean -decode_colskip (GstBitReader * br, guint8 * data, guint width, guint height, - guint stride, guint invert) -{ - guint x, y; - guint8 colskip, v; - - GST_DEBUG ("Parsing colskip"); - - invert &= 1; - for (x = 0; x < width; x++) { - READ_UINT8 (br, colskip, 1); - - if (data) { - if (colskip) { - for (y = 0; y < height; y++) { - READ_UINT8 (br, v, 1); - data[y * stride] = v ^ invert; - } - } else { - for (y = 0; y < height; y++) - data[y * stride] = invert; - } - data++; - } else if (colskip) - SKIP (br, height); - } - - return TRUE; - -failed: - GST_WARNING ("Failed to parse colskip"); - - return FALSE; -} - -static inline gboolean -decode_rowskip (GstBitReader * br, guint8 * data, guint width, guint height, - guint stride, guint invert) -{ - guint x, y; - guint8 rowskip, v; - - GST_DEBUG ("Parsing rowskip"); - - invert &= 1; - for (y = 0; y < height; y++) { - READ_UINT8 (br, rowskip, 1); - - if (data) { - if (!rowskip) - memset (data, invert, width); - else { - for (x = 0; x < width; x++) { - READ_UINT8 (br, v, 1); - data[x] = v ^ invert; - } - } - data += stride; - } else if (rowskip) - SKIP (br, width); - } - - return TRUE; - -failed: - GST_WARNING ("Failed to parse rowskip"); - - return FALSE; -} - -static inline gint8 -decode012 (GstBitReader * br) -{ - guint8 n; - - READ_UINT8 (br, n, 1); - - if (n == 0) - return 0; - - READ_UINT8 (br, n, 1); - - return n + 1; - -failed: - GST_WARNING ("Could not decode 0 1 2 returning -1"); - - return -1; -} - -static inline guint -calculate_nb_pan_scan_win (GstVC1AdvancedSeqHdr * advseqhdr, - GstVC1PicAdvanced * pic) -{ - if (advseqhdr->interlace && !advseqhdr->psf) { - if (advseqhdr->pulldown) - return pic->rff + 2; - - return 2; - - } else { - if (advseqhdr->pulldown) - return pic->rptfrm + 1; - - return 1; - } -} - -static gboolean -decode_refdist (GstBitReader * br, guint16 * value) -{ - guint16 tmp; - gint i = 2; - - if (!gst_bit_reader_peek_bits_uint16 (br, &tmp, i)) - goto failed; - - if (tmp < 0x03) { - READ_UINT16 (br, *value, i); - - return TRUE; - } - - do { - i++; - - if (!gst_bit_reader_peek_bits_uint16 (br, &tmp, i)) - goto failed; - - if (!(tmp >> i)) { - READ_UINT16 (br, *value, i); - - return TRUE; - } - } while (i < 16); - - -failed: - { - GST_WARNING ("Could not decode end 0 returning"); - - return FALSE; - } -} - -/*** bitplanes decoding ***/ -static gboolean -bitplane_decoding (GstBitReader * br, guint8 * data, - GstVC1SeqHdr * seqhdr, guint8 * is_raw) -{ - const guint width = seqhdr->mb_width; - const guint height = seqhdr->mb_height; - const guint stride = seqhdr->mb_stride; - guint imode, invert, invert_mask; - guint x, y, v, o; - guint8 *pdata = data; - - *is_raw = FALSE; - - GET_BITS (br, 1, &invert); - invert_mask = -invert; - - if (!decode_vlc (br, &imode, vc1_imode_vlc_table, - G_N_ELEMENTS (vc1_imode_vlc_table))) - goto failed; - - switch (imode) { - case IMODE_RAW: - - GST_DEBUG ("Parsing IMODE_RAW"); - - *is_raw = TRUE; - return TRUE; - - case IMODE_DIFF2: - invert_mask = 0; - /* fall-through */ - case IMODE_NORM2: - invert_mask &= 3; - - GST_DEBUG ("Parsing IMODE_DIFF2 or IMODE_NORM2 biplane"); - - x = 0; - o = (height * width) & 1; - if (o) { - GET_BITS (br, 1, &v); - if (pdata) { - *pdata++ = (v ^ invert_mask) & 1; - if (++x == width) { - x = 0; - pdata += stride - width; - } - } - } - - for (y = o; y < height * width; y += 2) { - if (!decode_vlc (br, &v, vc1_norm2_vlc_table, - G_N_ELEMENTS (vc1_norm2_vlc_table))) - goto failed; - if (pdata) { - v ^= invert_mask; - *pdata++ = v >> 1; - if (++x == width) { - x = 0; - pdata += stride - width; - } - *pdata++ = v & 1; - if (++x == width) { - x = 0; - pdata += stride - width; - } - } - } - break; - - case IMODE_DIFF6: - invert_mask = 0; - /* fall-through */ - case IMODE_NORM6: - - GST_DEBUG ("Parsing IMODE_DIFF6 or IMODE_NORM6 biplane"); - - if (!(height % 3) && (width % 3)) { /* decode 2x3 "vertical" tiles */ - for (y = 0; y < height; y += 3) { - for (x = width & 1; x < width; x += 2) { - if (!decode_vlc (br, &v, vc1_norm6_vlc_table, - G_N_ELEMENTS (vc1_norm6_vlc_table))) - goto failed; - - if (pdata) { - v ^= invert_mask; - pdata[x + 0] = v & 1; - pdata[x + 1] = (v >> 1) & 1; - pdata[x + 0 + stride] = (v >> 2) & 1; - pdata[x + 1 + stride] = (v >> 3) & 1; - pdata[x + 0 + stride * 2] = (v >> 4) & 1; - pdata[x + 1 + stride * 2] = (v >> 5) & 1; - } - } - if (pdata) - pdata += 3 * stride; - } - - x = width & 1; - y = 0; - } else { /* decode 3x2 "horizontal" tiles */ - - if (pdata) - pdata += (height & 1) * stride; - for (y = height & 1; y < height; y += 2) { - for (x = width % 3; x < width; x += 3) { - if (!decode_vlc (br, &v, vc1_norm6_vlc_table, - G_N_ELEMENTS (vc1_norm6_vlc_table))) - goto failed; - - if (pdata) { - v ^= invert_mask; - pdata[x + 0] = v & 1; - pdata[x + 1] = (v >> 1) & 1; - pdata[x + 2] = (v >> 2) & 1; - pdata[x + 0 + stride] = (v >> 3) & 1; - pdata[x + 1 + stride] = (v >> 4) & 1; - pdata[x + 2 + stride] = (v >> 5) & 1; - } - } - if (pdata) - pdata += 2 * stride; - } - - x = width % 3; - y = height & 1; - } - - if (x) { - if (data) - pdata = data; - if (!decode_colskip (br, pdata, x, height, stride, invert_mask)) - goto failed; - } - - if (y) { - if (data) - pdata = data + x; - if (!decode_rowskip (br, pdata, width - x, y, stride, invert_mask)) - goto failed; - } - break; - case IMODE_ROWSKIP: - - GST_DEBUG ("Parsing IMODE_ROWSKIP biplane"); - - if (!decode_rowskip (br, data, width, height, stride, invert_mask)) - goto failed; - break; - case IMODE_COLSKIP: - - GST_DEBUG ("Parsing IMODE_COLSKIP biplane"); - - if (!decode_colskip (br, data, width, height, stride, invert_mask)) - goto failed; - break; - } - - if (!data) - return TRUE; - - /* Applying diff operator */ - if (imode == IMODE_DIFF2 || imode == IMODE_DIFF6) { - pdata = data; - pdata[0] ^= invert; - - for (x = 1; x < width; x++) - pdata[x] ^= pdata[x - 1]; - - for (y = 1; y < height; y++) { - pdata[stride] ^= pdata[0]; - - for (x = 1; x < width; x++) { - if (pdata[stride + x - 1] != pdata[x]) - pdata[stride + x] ^= invert; - else - pdata[stride + x] ^= pdata[stride + x - 1]; - } - pdata += stride; - } - } - - return TRUE; - -failed: - GST_WARNING ("Failed to decode bitplane"); - - return FALSE; -} - -static gboolean -parse_vopdquant (GstBitReader * br, GstVC1FrameHdr * framehdr, guint8 dquant) -{ - GstVC1VopDquant *vopdquant = &framehdr->vopdquant; - - GST_DEBUG ("Parsing vopdquant"); - - vopdquant->dqbilevel = 0; - - if (dquant == 2) { - vopdquant->dquantfrm = 0; - - READ_UINT8 (br, vopdquant->pqdiff, 3); - - if (vopdquant->pqdiff != 7) - vopdquant->altpquant = framehdr->pquant + vopdquant->pqdiff + 1; - else { - READ_UINT8 (br, vopdquant->abspq, 5); - vopdquant->altpquant = vopdquant->abspq; - } - } else { - READ_UINT8 (br, vopdquant->dquantfrm, 1); - GST_DEBUG (" %u DquantFrm %u", gst_bit_reader_get_pos (br), - vopdquant->dquantfrm); - - if (vopdquant->dquantfrm) { - READ_UINT8 (br, vopdquant->dqprofile, 2); - - switch (vopdquant->dqprofile) { - case GST_VC1_DQPROFILE_SINGLE_EDGE: - case GST_VC1_DQPROFILE_DOUBLE_EDGES: - READ_UINT8 (br, vopdquant->dqbedge, 2); - break; - - case GST_VC1_DQPROFILE_ALL_MBS: - READ_UINT8 (br, vopdquant->dqbilevel, 1); - break; - } - - if (vopdquant->dqbilevel - || vopdquant->dqprofile != GST_VC1_DQPROFILE_ALL_MBS) { - { - READ_UINT8 (br, vopdquant->pqdiff, 3); - - if (vopdquant->pqdiff != 7) - vopdquant->altpquant = framehdr->pquant + vopdquant->pqdiff + 1; - else { - READ_UINT8 (br, vopdquant->abspq, 5); - vopdquant->altpquant = vopdquant->abspq; - } - } - } - } - } - - return TRUE; - -failed: - GST_WARNING ("Failed to parse vopdquant"); - - return FALSE; -} - -static inline gint -scan_for_start_codes (const guint8 * data, guint size) -{ - GstByteReader br; - gst_byte_reader_init (&br, data, size); - - /* NALU not empty, so we can at least expect 1 (even 2) bytes following sc */ - return gst_byte_reader_masked_scan_uint32 (&br, 0xffffff00, 0x00000100, - 0, size); -} - -static inline gint -get_unary (GstBitReader * br, gint stop, gint len) -{ - int i; - guint8 current = 0xff; - - for (i = 0; i < len; i++) { - current = gst_bit_reader_get_bits_uint8_unchecked (br, 1); - if (current == stop) - return i; - } - - return i; -} - -static inline void -calculate_framerate_bitrate (guint8 frmrtq_postproc, guint8 bitrtq_postproc, - guint * framerate, guint * bitrate) -{ - if (frmrtq_postproc == 0 && bitrtq_postproc == 31) { - *framerate = 0; - *bitrate = 0; - } else if (frmrtq_postproc == 0 && bitrtq_postproc == 30) { - *framerate = 2; - *bitrate = 1952; - } else if (frmrtq_postproc == 1 && bitrtq_postproc == 31) { - *framerate = 6; - *bitrate = 2016; - } else { - if (frmrtq_postproc == 7) { - *framerate = 30; - } else { - *framerate = 2 + (frmrtq_postproc * 4); - } - if (bitrtq_postproc == 31) { - *bitrate = 2016; - } else { - *bitrate = 32 + (bitrtq_postproc * 64); - } - } -} - -static inline void -calculate_mb_size (GstVC1SeqHdr * seqhdr, guint width, guint height) -{ - seqhdr->mb_width = (width + 15) >> 4; - seqhdr->mb_height = (height + 15) >> 4; - seqhdr->mb_stride = seqhdr->mb_width + 1; -} - -static GstVC1ParserResult -parse_hrd_param_flag (GstBitReader * br, GstVC1HrdParam * hrd_param) -{ - guint i; - - GST_DEBUG ("Parsing Hrd param flag"); - - - if (gst_bit_reader_get_remaining (br) < 13) - goto failed; - - hrd_param->hrd_num_leaky_buckets = - gst_bit_reader_get_bits_uint8_unchecked (br, 5); - hrd_param->bit_rate_exponent = - gst_bit_reader_get_bits_uint8_unchecked (br, 4); - hrd_param->buffer_size_exponent = - gst_bit_reader_get_bits_uint8_unchecked (br, 4); - - if (gst_bit_reader_get_remaining (br) < - (32 * hrd_param->hrd_num_leaky_buckets)) - goto failed; - - for (i = 0; i < hrd_param->hrd_num_leaky_buckets; i++) { - hrd_param->hrd_rate[i] = gst_bit_reader_get_bits_uint16_unchecked (br, 16); - hrd_param->hrd_buffer[i] = - gst_bit_reader_get_bits_uint16_unchecked (br, 16); - } - - return GST_VC1_PARSER_OK; - -failed: - GST_WARNING ("Failed to parse hrd param flag"); - - return GST_VC1_PARSER_ERROR; -} - -static GstVC1ParserResult -parse_sequence_header_advanced (GstVC1SeqHdr * seqhdr, GstBitReader * br) -{ - GstVC1AdvancedSeqHdr *advanced = &seqhdr->advanced; - guint8 tmp; - - GST_DEBUG ("Parsing sequence header in advanced mode"); - - READ_UINT8 (br, tmp, 3); - advanced->level = tmp; - advanced->par_n = 0; - advanced->par_d = 0; - advanced->fps_n = 0; - advanced->fps_d = 0; - - READ_UINT8 (br, advanced->colordiff_format, 2); - READ_UINT8 (br, advanced->frmrtq_postproc, 3); - READ_UINT8 (br, advanced->bitrtq_postproc, 5); - - calculate_framerate_bitrate (advanced->frmrtq_postproc, - advanced->bitrtq_postproc, &advanced->framerate, &advanced->bitrate); - - GST_DEBUG ("level %u, colordiff_format %u , frmrtq_postproc %u," - " bitrtq_postproc %u", advanced->level, advanced->colordiff_format, - advanced->frmrtq_postproc, advanced->bitrtq_postproc); - - if (gst_bit_reader_get_remaining (br) < 32) - goto failed; - - advanced->postprocflag = gst_bit_reader_get_bits_uint8_unchecked (br, 1); - advanced->max_coded_width = gst_bit_reader_get_bits_uint16_unchecked (br, 12); - advanced->max_coded_height = - gst_bit_reader_get_bits_uint16_unchecked (br, 12); - advanced->max_coded_width = (advanced->max_coded_width + 1) << 1; - advanced->max_coded_height = (advanced->max_coded_height + 1) << 1; - calculate_mb_size (seqhdr, advanced->max_coded_width, - advanced->max_coded_height); - advanced->pulldown = gst_bit_reader_get_bits_uint8_unchecked (br, 1); - advanced->interlace = gst_bit_reader_get_bits_uint8_unchecked (br, 1); - advanced->tfcntrflag = gst_bit_reader_get_bits_uint8_unchecked (br, 1); - advanced->finterpflag = gst_bit_reader_get_bits_uint8_unchecked (br, 1); - - GST_DEBUG ("postprocflag %u, max_coded_width %u, max_coded_height %u," - "pulldown %u, interlace %u, tfcntrflag %u, finterpflag %u", - advanced->postprocflag, advanced->max_coded_width, - advanced->max_coded_height, advanced->pulldown, - advanced->interlace, advanced->tfcntrflag, advanced->finterpflag); - - /* Skipping reserved bit */ - gst_bit_reader_skip_unchecked (br, 1); - - advanced->psf = gst_bit_reader_get_bits_uint8_unchecked (br, 1); - advanced->display_ext = gst_bit_reader_get_bits_uint8_unchecked (br, 1); - if (advanced->display_ext) { - READ_UINT16 (br, advanced->disp_horiz_size, 14); - READ_UINT16 (br, advanced->disp_vert_size, 14); - - advanced->disp_horiz_size++; - advanced->disp_vert_size++; - - READ_UINT8 (br, advanced->aspect_ratio_flag, 1); - - if (advanced->aspect_ratio_flag) { - READ_UINT8 (br, advanced->aspect_ratio, 4); - - if (advanced->aspect_ratio == 15) { - /* Aspect Width (6.1.14.3.2) and Aspect Height (6.1.14.3.3) - * syntax elements hold a binary encoding of sizes ranging - * from 1 to 256 */ - READ_UINT8 (br, advanced->aspect_horiz_size, 8); - READ_UINT8 (br, advanced->aspect_vert_size, 8); - advanced->par_n = 1 + advanced->aspect_horiz_size; - advanced->par_d = 1 + advanced->aspect_vert_size; - } else { - advanced->par_n = aspect_ratios[advanced->aspect_ratio].par_n; - advanced->par_d = aspect_ratios[advanced->aspect_ratio].par_d; - } - } - READ_UINT8 (br, advanced->framerate_flag, 1); - if (advanced->framerate_flag) { - READ_UINT8 (br, advanced->framerateind, 1); - - if (!advanced->framerateind) { - READ_UINT8 (br, advanced->frameratenr, 8); - READ_UINT8 (br, advanced->frameratedr, 4); - } else { - READ_UINT16 (br, advanced->framerateexp, 16); - } - if (advanced->frameratenr > 0 && - advanced->frameratenr < 8 && - advanced->frameratedr > 0 && advanced->frameratedr < 3) { - advanced->fps_n = framerates_n[advanced->frameratenr]; - advanced->fps_d = framerates_d[advanced->frameratedr]; - } else { - advanced->fps_n = advanced->framerateexp + 1; - advanced->fps_d = 32; - } - } - READ_UINT8 (br, advanced->color_format_flag, 1); - - if (advanced->color_format_flag) { - if (gst_bit_reader_get_remaining (br) < 24) - goto failed; - - advanced->color_prim = gst_bit_reader_get_bits_uint8_unchecked (br, 8); - advanced->transfer_char = gst_bit_reader_get_bits_uint8_unchecked (br, 8); - advanced->matrix_coef = gst_bit_reader_get_bits_uint8_unchecked (br, 8); - } - } - READ_UINT8 (br, advanced->hrd_param_flag, 1); - if (advanced->hrd_param_flag) - return parse_hrd_param_flag (br, &advanced->hrd_param); - - return GST_VC1_PARSER_OK; - -failed: - GST_WARNING ("Failed to parse advanced headers"); - - return GST_VC1_PARSER_ERROR; -} - -static GstVC1ParserResult -parse_frame_header_advanced (GstBitReader * br, GstVC1FrameHdr * framehdr, - GstVC1SeqHdr * seqhdr, GstVC1BitPlanes * bitplanes, gboolean field2) -{ - GstVC1AdvancedSeqHdr *advhdr = &seqhdr->advanced; - GstVC1PicAdvanced *pic = &framehdr->pic.advanced; - GstVC1EntryPointHdr *entrypthdr = &advhdr->entrypoint; - guint8 mvmodeidx; - - GST_DEBUG ("Parsing Frame header advanced %u", advhdr->interlace); - - /* Set the conveninence fields */ - framehdr->profile = seqhdr->profile; - framehdr->dquant = entrypthdr->dquant; - - if (advhdr->interlace) { - gint8 fcm = decode012 (br); - - if (fcm < 0) - goto failed; - - pic->fcm = (guint8) fcm; - } else - pic->fcm = GST_VC1_FRAME_PROGRESSIVE; - - if (pic->fcm == GST_VC1_FIELD_INTERLACE) { - READ_UINT8 (br, pic->fptype, 3); - if (field2) { - switch (pic->fptype) { - case 0x00: - case 0x02: - framehdr->ptype = GST_VC1_PICTURE_TYPE_I; - break; - case 0x01: - case 0x03: - framehdr->ptype = GST_VC1_PICTURE_TYPE_P; - break; - case 0x04: - case 0x06: - framehdr->ptype = GST_VC1_PICTURE_TYPE_B; - break; - case 0x05: - case 0x07: - framehdr->ptype = GST_VC1_PICTURE_TYPE_BI; - break; - } - } else { - switch (pic->fptype) { - case 0x00: - case 0x01: - framehdr->ptype = GST_VC1_PICTURE_TYPE_I; - break; - case 0x02: - case 0x03: - framehdr->ptype = GST_VC1_PICTURE_TYPE_P; - break; - case 0x04: - case 0x05: - framehdr->ptype = GST_VC1_PICTURE_TYPE_B; - break; - case 0x06: - case 0x07: - framehdr->ptype = GST_VC1_PICTURE_TYPE_BI; - break; - } - } - } else - framehdr->ptype = (guint8) get_unary (br, 0, 4); - - if (advhdr->tfcntrflag) { - READ_UINT8 (br, pic->tfcntr, 8); - GST_DEBUG ("tfcntr %u", pic->tfcntr); - } - - if (advhdr->pulldown) { - if (!advhdr->interlace || advhdr->psf) { - - READ_UINT8 (br, pic->rptfrm, 2); - GST_DEBUG ("rptfrm %u", pic->rptfrm); - - } else { - - READ_UINT8 (br, pic->tff, 1); - READ_UINT8 (br, pic->rff, 1); - GST_DEBUG ("tff %u, rff %u", pic->tff, pic->rff); - } - } - - if (entrypthdr->panscan_flag) { - READ_UINT8 (br, pic->ps_present, 1); - - if (pic->ps_present) { - guint i, nb_pan_scan_win = calculate_nb_pan_scan_win (advhdr, pic); - - if (gst_bit_reader_get_remaining (br) < 64 * nb_pan_scan_win) - goto failed; - - for (i = 0; i < nb_pan_scan_win; i++) { - pic->ps_hoffset = gst_bit_reader_get_bits_uint32_unchecked (br, 18); - pic->ps_voffset = gst_bit_reader_get_bits_uint32_unchecked (br, 18); - pic->ps_width = gst_bit_reader_get_bits_uint16_unchecked (br, 14); - pic->ps_height = gst_bit_reader_get_bits_uint16_unchecked (br, 14); - } - } - } - - if (framehdr->ptype == GST_VC1_PICTURE_TYPE_SKIPPED) - return GST_VC1_PARSER_OK; - - READ_UINT8 (br, pic->rndctrl, 1); - - if (advhdr->interlace) { - READ_UINT8 (br, pic->uvsamp, 1); - GST_DEBUG ("uvsamp %u", pic->uvsamp); - if (pic->fcm == GST_VC1_FIELD_INTERLACE && entrypthdr->refdist_flag && - pic->fptype < 4) - decode_refdist (br, &pic->refdist); - else - pic->refdist = 0; - } - - if (advhdr->finterpflag) { - READ_UINT8 (br, framehdr->interpfrm, 1); - GST_DEBUG ("interpfrm %u", framehdr->interpfrm); - } - - if ((pic->fcm != GST_VC1_FIELD_INTERLACE && - framehdr->ptype == GST_VC1_PICTURE_TYPE_B) || - (pic->fcm == GST_VC1_FIELD_INTERLACE && (pic->fptype > 4))) { - - guint bfraction; - - if (!decode_vlc (br, &bfraction, vc1_bfraction_vlc_table, - G_N_ELEMENTS (vc1_bfraction_vlc_table))) - goto failed; - - pic->bfraction = bfraction; - GST_DEBUG ("bfraction %u", pic->bfraction); - - if (pic->bfraction == GST_VC1_BFRACTION_PTYPE_BI) { - framehdr->ptype = GST_VC1_PICTURE_TYPE_BI; - } - - } - - READ_UINT8 (br, framehdr->pqindex, 5); - if (!framehdr->pqindex) - goto failed; - - /* compute pquant */ - if (entrypthdr->quantizer == GST_VC1_QUANTIZER_IMPLICITLY) - framehdr->pquant = vc1_pquant_table[0][framehdr->pqindex]; - else - framehdr->pquant = vc1_pquant_table[1][framehdr->pqindex]; - - framehdr->pquantizer = 1; - if (entrypthdr->quantizer == GST_VC1_QUANTIZER_IMPLICITLY) - framehdr->pquantizer = framehdr->pqindex < 9; - if (entrypthdr->quantizer == GST_VC1_QUANTIZER_NON_UNIFORM) - framehdr->pquantizer = 0; - - if (framehdr->pqindex <= 8) - READ_UINT8 (br, framehdr->halfqp, 1); - else - framehdr->halfqp = 0; - - if (entrypthdr->quantizer == GST_VC1_QUANTIZER_EXPLICITLY) { - READ_UINT8 (br, framehdr->pquantizer, 1); - } - - if (advhdr->postprocflag) - READ_UINT8 (br, pic->postproc, 2); - - GST_DEBUG ("Parsing %u picture, pqindex %u, pquant %u pquantizer %u" - "halfqp %u", framehdr->ptype, framehdr->pqindex, framehdr->pquant, - framehdr->pquantizer, framehdr->halfqp); - - switch (framehdr->ptype) { - case GST_VC1_PICTURE_TYPE_I: - case GST_VC1_PICTURE_TYPE_BI: - if (pic->fcm == GST_VC1_FRAME_INTERLACE) { - if (!bitplane_decoding (br, bitplanes ? bitplanes->fieldtx : NULL, - seqhdr, &pic->fieldtx)) - goto failed; - } - - if (!bitplane_decoding (br, bitplanes ? bitplanes->acpred : NULL, - seqhdr, &pic->acpred)) - goto failed; - - if (entrypthdr->overlap && framehdr->pquant <= 8) { - pic->condover = decode012 (br); - - if (pic->condover == (guint8) - 1) - goto failed; - - else if (pic->condover == GST_VC1_CONDOVER_SELECT) { - if (!bitplane_decoding (br, bitplanes ? bitplanes->overflags : NULL, - seqhdr, &pic->overflags)) - goto failed; - - GST_DEBUG ("overflags %u", pic->overflags); - } - } - - framehdr->transacfrm = get_unary (br, 0, 2); - pic->transacfrm2 = get_unary (br, 0, 2); - READ_UINT8 (br, framehdr->transdctab, 1); - - if (framehdr->dquant) - parse_vopdquant (br, framehdr, framehdr->dquant); - - GST_DEBUG - ("acpred %u, condover %u, transacfrm %u, transacfrm2 %u, transdctab %u", - pic->acpred, pic->condover, framehdr->transacfrm, pic->transacfrm2, - framehdr->transdctab); - break; - - case GST_VC1_PICTURE_TYPE_B: - if (entrypthdr->extended_mv) - pic->mvrange = get_unary (br, 0, 3); - else - pic->mvrange = 0; - - if (pic->fcm != GST_VC1_FRAME_PROGRESSIVE) { - if (entrypthdr->extended_dmv) - pic->dmvrange = get_unary (br, 0, 3); - } - - if (pic->fcm == GST_VC1_FRAME_INTERLACE) - READ_UINT8 (br, pic->intcomp, 1); - else - READ_UINT8 (br, pic->mvmode, 1); - - if (pic->fcm == GST_VC1_FIELD_INTERLACE) { - - if (!bitplane_decoding (br, bitplanes ? bitplanes->forwardmb : NULL, - seqhdr, &pic->forwardmb)) - goto failed; - - } else { - if (!bitplane_decoding (br, bitplanes ? bitplanes->directmb : NULL, - seqhdr, &pic->directmb)) - goto failed; - - if (!bitplane_decoding (br, bitplanes ? bitplanes->skipmb : NULL, - seqhdr, &pic->skipmb)) - goto failed; - } - - if (pic->fcm != GST_VC1_FRAME_PROGRESSIVE) { - if (gst_bit_reader_get_remaining (br) < 7) - goto failed; - - pic->mbmodetab = gst_bit_reader_get_bits_uint8_unchecked (br, 2); - pic->imvtab = gst_bit_reader_get_bits_uint8_unchecked (br, 2); - pic->icbptab = gst_bit_reader_get_bits_uint8_unchecked (br, 3); - - if (pic->fcm == GST_VC1_FRAME_INTERLACE) - READ_UINT8 (br, pic->mvbptab2, 2); - - if (pic->fcm == GST_VC1_FRAME_INTERLACE || - (pic->fcm == GST_VC1_FIELD_INTERLACE - && pic->mvmode == GST_VC1_MVMODE_MIXED_MV)) - READ_UINT8 (br, pic->mvbptab4, 2); - - } else { - READ_UINT8 (br, pic->mvtab, 2); - READ_UINT8 (br, pic->cbptab, 2); - } - - if (framehdr->dquant) { - parse_vopdquant (br, framehdr, framehdr->dquant); - } - - if (entrypthdr->vstransform) { - READ_UINT8 (br, pic->ttmbf, 1); - - if (pic->ttmbf) { - READ_UINT8 (br, pic->ttfrm, 2); - } - } - - framehdr->transacfrm = get_unary (br, 0, 2); - READ_UINT8 (br, framehdr->transdctab, 1); - - GST_DEBUG ("transacfrm %u transdctab %u mvmode %u mvtab %u," - "cbptab %u directmb %u skipmb %u", framehdr->transacfrm, - framehdr->transdctab, pic->mvmode, pic->mvtab, pic->cbptab, - pic->directmb, pic->skipmb); - - break; - case GST_VC1_PICTURE_TYPE_P: - if (pic->fcm == GST_VC1_FIELD_INTERLACE) { - READ_UINT8 (br, pic->numref, 1); - - if (pic->numref) - READ_UINT8 (br, pic->reffield, 1); - } - - if (entrypthdr->extended_mv) - pic->mvrange = get_unary (br, 0, 3); - else - pic->mvrange = 0; - - if (pic->fcm != GST_VC1_FRAME_PROGRESSIVE) { - if (entrypthdr->extended_dmv) - pic->dmvrange = get_unary (br, 0, 3); - } - - if (pic->fcm == GST_VC1_FRAME_INTERLACE) { - READ_UINT8 (br, pic->mvswitch4, 1); - READ_UINT8 (br, pic->intcomp, 1); - - if (pic->intcomp) { - READ_UINT8 (br, pic->lumscale, 6); - READ_UINT8 (br, pic->lumshift, 6); - } - } else { - - mvmodeidx = framehdr->pquant > 12; - pic->mvmode = vc1_mvmode_table[mvmodeidx][get_unary (br, 1, 4)]; - - if (pic->mvmode == GST_VC1_MVMODE_INTENSITY_COMP) { - pic->mvmode2 = vc1_mvmode2_table[mvmodeidx][get_unary (br, 1, 3)]; - - if (pic->fcm == GST_VC1_FIELD_INTERLACE) - pic->intcompfield = decode012 (br); - - READ_UINT8 (br, pic->lumscale, 6); - READ_UINT8 (br, pic->lumshift, 6); - GST_DEBUG ("lumscale %u lumshift %u", pic->lumscale, pic->lumshift); - - if (pic->fcm == GST_VC1_FIELD_INTERLACE && pic->intcompfield) { - READ_UINT8 (br, pic->lumscale2, 6); - READ_UINT8 (br, pic->lumshift2, 6); - } - } - - if (pic->fcm == GST_VC1_FRAME_PROGRESSIVE) { - if (pic->mvmode == GST_VC1_MVMODE_MIXED_MV || - (pic->mvmode == GST_VC1_MVMODE_INTENSITY_COMP && - pic->mvmode2 == GST_VC1_MVMODE_MIXED_MV)) { - - if (!bitplane_decoding (br, bitplanes ? bitplanes->mvtypemb : NULL, - seqhdr, &pic->mvtypemb)) - goto failed; - - GST_DEBUG ("mvtypemb %u", pic->mvtypemb); - } - } - } - - if (pic->fcm != GST_VC1_FIELD_INTERLACE) { - if (!bitplane_decoding (br, bitplanes ? bitplanes->skipmb : NULL, - seqhdr, &pic->skipmb)) - goto failed; - } - - if (pic->fcm != GST_VC1_FRAME_PROGRESSIVE) { - if (gst_bit_reader_get_remaining (br) < 7) - goto failed; - - pic->mbmodetab = gst_bit_reader_get_bits_uint8_unchecked (br, 2); - pic->imvtab = gst_bit_reader_get_bits_uint8_unchecked (br, 2); - pic->icbptab = gst_bit_reader_get_bits_uint8_unchecked (br, 3); - - if (pic->fcm != GST_VC1_FIELD_INTERLACE) { - READ_UINT8 (br, pic->mvbptab2, 2); - - if (pic->mvswitch4) - READ_UINT8 (br, pic->mvbptab4, 2); - - } else if (pic->mvmode == GST_VC1_MVMODE_MIXED_MV) - READ_UINT8 (br, pic->mvbptab4, 2); - - } else { - if (gst_bit_reader_get_remaining (br) < 4) - goto failed; - pic->mvtab = gst_bit_reader_get_bits_uint8_unchecked (br, 2); - pic->cbptab = gst_bit_reader_get_bits_uint8_unchecked (br, 2); - } - - if (framehdr->dquant) { - parse_vopdquant (br, framehdr, framehdr->dquant); - } - - if (entrypthdr->vstransform) { - READ_UINT8 (br, pic->ttmbf, 1); - - if (pic->ttmbf) { - READ_UINT8 (br, pic->ttfrm, 2); - } - } - - framehdr->transacfrm = get_unary (br, 0, 2); - READ_UINT8 (br, framehdr->transdctab, 1); - - GST_DEBUG ("transacfrm %u transdctab %u mvmode %u mvtab %u," - "cbptab %u skipmb %u", framehdr->transacfrm, framehdr->transdctab, - pic->mvmode, pic->mvtab, pic->cbptab, pic->skipmb); - - break; - - default: - goto failed; - break; - } - - return GST_VC1_PARSER_OK; - -failed: - GST_WARNING ("Failed to parse frame header"); - - return GST_VC1_PARSER_ERROR; -} - -static GstVC1ParserResult -parse_frame_header (GstBitReader * br, GstVC1FrameHdr * framehdr, - GstVC1SeqHdr * seqhdr, GstVC1BitPlanes * bitplanes) -{ - guint8 mvmodeidx, tmp; - GstVC1PicSimpleMain *pic = &framehdr->pic.simple; - GstVC1SeqStructC *structc = &seqhdr->struct_c; - - GST_DEBUG ("Parsing frame header in simple or main mode"); - - /* Set the conveninence fields */ - framehdr->profile = seqhdr->profile; - framehdr->dquant = structc->dquant; - - framehdr->interpfrm = 0; - if (structc->finterpflag) - READ_UINT8 (br, framehdr->interpfrm, 1); - - READ_UINT8 (br, pic->frmcnt, 2); - - pic->rangeredfrm = 0; - if (structc->rangered) { - READ_UINT8 (br, pic->rangeredfrm, 1); - } - - /* Figuring out the picture type */ - READ_UINT8 (br, tmp, 1); - framehdr->ptype = tmp; - - if (structc->maxbframes) { - if (!framehdr->ptype) { - READ_UINT8 (br, tmp, 1); - - if (tmp) - framehdr->ptype = GST_VC1_PICTURE_TYPE_I; - else - framehdr->ptype = GST_VC1_PICTURE_TYPE_B; - - } else - framehdr->ptype = GST_VC1_PICTURE_TYPE_P; - - } else { - if (framehdr->ptype) - framehdr->ptype = GST_VC1_PICTURE_TYPE_P; - else - framehdr->ptype = GST_VC1_PICTURE_TYPE_I; - } - - - if (framehdr->ptype == GST_VC1_PICTURE_TYPE_B) { - guint bfraction; - if (!decode_vlc (br, &bfraction, vc1_bfraction_vlc_table, - G_N_ELEMENTS (vc1_bfraction_vlc_table))) - goto failed; - - pic->bfraction = bfraction; - GST_DEBUG ("bfraction %d", pic->bfraction); - - if (pic->bfraction == GST_VC1_BFRACTION_PTYPE_BI) { - framehdr->ptype = GST_VC1_PICTURE_TYPE_BI; - } - } - - if (framehdr->ptype == GST_VC1_PICTURE_TYPE_I || - framehdr->ptype == GST_VC1_PICTURE_TYPE_BI) - READ_UINT8 (br, pic->bf, 7); - - READ_UINT8 (br, framehdr->pqindex, 5); - if (!framehdr->pqindex) - return GST_VC1_PARSER_ERROR; - - GST_DEBUG ("pqindex %u", framehdr->pqindex); - - /* compute pquant */ - if (structc->quantizer == GST_VC1_QUANTIZER_IMPLICITLY) - framehdr->pquant = vc1_pquant_table[0][framehdr->pqindex]; - else - framehdr->pquant = vc1_pquant_table[1][framehdr->pqindex]; - - GST_DEBUG ("pquant %u", framehdr->pquant); - - if (framehdr->pqindex <= 8) - READ_UINT8 (br, framehdr->halfqp, 1); - else - framehdr->halfqp = 0; - - /* Set pquantizer */ - framehdr->pquantizer = 1; - if (structc->quantizer == GST_VC1_QUANTIZER_IMPLICITLY) - framehdr->pquantizer = framehdr->pqindex < 9; - else if (structc->quantizer == GST_VC1_QUANTIZER_NON_UNIFORM) - framehdr->pquantizer = 0; - - if (structc->quantizer == GST_VC1_QUANTIZER_EXPLICITLY) - READ_UINT8 (br, framehdr->pquantizer, 1); - - if (structc->extended_mv == 1) { - pic->mvrange = get_unary (br, 0, 3); - GST_DEBUG ("mvrange %u", pic->mvrange); - } - - if (structc->multires && (framehdr->ptype == GST_VC1_PICTURE_TYPE_P || - framehdr->ptype == GST_VC1_PICTURE_TYPE_I)) { - READ_UINT8 (br, pic->respic, 2); - GST_DEBUG ("Respic %u", pic->respic); - } - - GST_DEBUG ("Parsing %u Frame, pquantizer %u, halfqp %u, rangeredfrm %u, " - "interpfrm %u", framehdr->ptype, framehdr->pquantizer, framehdr->halfqp, - pic->rangeredfrm, framehdr->interpfrm); - - switch (framehdr->ptype) { - case GST_VC1_PICTURE_TYPE_I: - case GST_VC1_PICTURE_TYPE_BI: - framehdr->transacfrm = get_unary (br, 0, 2); - pic->transacfrm2 = get_unary (br, 0, 2); - READ_UINT8 (br, framehdr->transdctab, 1); - - GST_DEBUG ("transacfrm %u, transacfrm2 %u, transdctab %u", - framehdr->transacfrm, pic->transacfrm2, framehdr->transdctab); - break; - - case GST_VC1_PICTURE_TYPE_P: - mvmodeidx = framehdr->pquant > 12; - pic->mvmode = vc1_mvmode_table[mvmodeidx][get_unary (br, 1, 4)]; - - if (pic->mvmode == GST_VC1_MVMODE_INTENSITY_COMP) { - pic->mvmode2 = vc1_mvmode2_table[mvmodeidx][get_unary (br, 1, 3)]; - READ_UINT8 (br, pic->lumscale, 6); - READ_UINT8 (br, pic->lumshift, 6); - GST_DEBUG ("lumscale %u lumshift %u", pic->lumscale, pic->lumshift); - } - - if (pic->mvmode == GST_VC1_MVMODE_MIXED_MV || - (pic->mvmode == GST_VC1_MVMODE_INTENSITY_COMP && - pic->mvmode2 == GST_VC1_MVMODE_MIXED_MV)) { - if (!bitplane_decoding (br, bitplanes ? bitplanes->mvtypemb : NULL, - seqhdr, &pic->mvtypemb)) - goto failed; - GST_DEBUG ("mvtypemb %u", pic->mvtypemb); - } - if (!bitplane_decoding (br, bitplanes ? bitplanes->skipmb : NULL, - seqhdr, &pic->skipmb)) - goto failed; - - READ_UINT8 (br, pic->mvtab, 2); - READ_UINT8 (br, pic->cbptab, 2); - - if (framehdr->dquant) { - parse_vopdquant (br, framehdr, framehdr->dquant); - } - - if (structc->vstransform) { - READ_UINT8 (br, pic->ttmbf, 1); - GST_DEBUG ("ttmbf %u", pic->ttmbf); - - if (pic->ttmbf) { - READ_UINT8 (br, pic->ttfrm, 2); - GST_DEBUG ("ttfrm %u", pic->ttfrm); - } - } - - framehdr->transacfrm = get_unary (br, 0, 2); - READ_UINT8 (br, framehdr->transdctab, 1); - - GST_DEBUG ("transacfrm %u transdctab %u mvmode %u mvtab %u," - "cbptab %u skipmb %u", framehdr->transacfrm, framehdr->transdctab, - pic->mvmode, pic->mvtab, pic->cbptab, pic->skipmb); - break; - - case GST_VC1_PICTURE_TYPE_B: - READ_UINT8 (br, pic->mvmode, 1); - if (!bitplane_decoding (br, bitplanes ? bitplanes->directmb : NULL, - seqhdr, &pic->directmb)) - goto failed; - - if (!bitplane_decoding (br, bitplanes ? bitplanes->skipmb : NULL, - seqhdr, &pic->skipmb)) - goto failed; - - READ_UINT8 (br, pic->mvtab, 2); - READ_UINT8 (br, pic->cbptab, 2); - - if (framehdr->dquant) - parse_vopdquant (br, framehdr, framehdr->dquant); - - if (structc->vstransform) { - READ_UINT8 (br, pic->ttmbf, 1); - - if (pic->ttmbf) { - READ_UINT8 (br, pic->ttfrm, 2); - } - } - - framehdr->transacfrm = get_unary (br, 0, 2); - READ_UINT8 (br, framehdr->transdctab, 1); - - GST_DEBUG ("transacfrm %u transdctab %u mvmode %u mvtab %u," - "cbptab %u directmb %u skipmb %u", framehdr->transacfrm, - framehdr->transdctab, pic->mvmode, pic->mvtab, pic->cbptab, - pic->directmb, pic->skipmb); - - break; - - default: - goto failed; - break; - } - - return GST_VC1_PARSER_OK; - -failed: - GST_WARNING ("Failed to parse Simple picture header"); - - return GST_VC1_PARSER_ERROR; -} - -static GstVC1ParserResult -parse_sequence_header_struct_a (GstBitReader * br, GstVC1SeqStructA * structa) -{ - if (gst_bit_reader_get_remaining (br) < 64) { - GST_WARNING ("Failed to parse struct A"); - - return GST_VC1_PARSER_ERROR; - } - - structa->vert_size = gst_bit_reader_get_bits_uint32_unchecked (br, 32); - structa->horiz_size = gst_bit_reader_get_bits_uint32_unchecked (br, 32); - - return GST_VC1_PARSER_OK; -} - -static GstVC1ParserResult -parse_sequence_header_struct_b (GstBitReader * br, GstVC1SeqStructB * structb) -{ - if (gst_bit_reader_get_remaining (br) < 96) { - GST_WARNING ("Failed to parse sequence header"); - - return GST_VC1_PARSER_ERROR; - } - - structb->level = gst_bit_reader_get_bits_uint8_unchecked (br, 3); - structb->cbr = gst_bit_reader_get_bits_uint8_unchecked (br, 1); - - /* res4 */ - gst_bit_reader_skip_unchecked (br, 4); - - structb->hrd_buffer = gst_bit_reader_get_bits_uint32_unchecked (br, 24); - structb->hrd_rate = gst_bit_reader_get_bits_uint32_unchecked (br, 32); - structb->framerate = gst_bit_reader_get_bits_uint32_unchecked (br, 32); - - return GST_VC1_PARSER_OK; -} - -static GstVC1ParserResult -parse_sequence_header_struct_c (GstBitReader * br, GstVC1SeqStructC * structc) -{ - guint8 old_interlaced_mode, tmp; - - READ_UINT8 (br, tmp, 2); - structc->profile = tmp; - - if (structc->profile == GST_VC1_PROFILE_ADVANCED) - return GST_VC1_PARSER_OK; - - GST_DEBUG ("Parsing sequence header in simple or main mode"); - - if (gst_bit_reader_get_remaining (br) < 29) - goto failed; - - /* Reserved bits */ - old_interlaced_mode = gst_bit_reader_get_bits_uint8_unchecked (br, 1); - if (old_interlaced_mode) - GST_WARNING ("Old interlaced mode used"); - - structc->wmvp = gst_bit_reader_get_bits_uint8_unchecked (br, 1); - if (structc->wmvp) - GST_DEBUG ("WMVP mode"); - - structc->frmrtq_postproc = gst_bit_reader_get_bits_uint8_unchecked (br, 3); - structc->bitrtq_postproc = gst_bit_reader_get_bits_uint8_unchecked (br, 5); - structc->loop_filter = gst_bit_reader_get_bits_uint8_unchecked (br, 1); - - calculate_framerate_bitrate (structc->frmrtq_postproc, - structc->bitrtq_postproc, &structc->framerate, &structc->bitrate); - - /* Skipping reserved3 bit */ - gst_bit_reader_skip_unchecked (br, 1); - - structc->multires = gst_bit_reader_get_bits_uint8_unchecked (br, 1); - - /* Skipping reserved4 bit */ - gst_bit_reader_skip_unchecked (br, 1); - - structc->fastuvmc = gst_bit_reader_get_bits_uint8_unchecked (br, 1); - structc->extended_mv = gst_bit_reader_get_bits_uint8_unchecked (br, 1); - structc->dquant = gst_bit_reader_get_bits_uint8_unchecked (br, 2); - structc->vstransform = gst_bit_reader_get_bits_uint8_unchecked (br, 1); - - /* Skipping reserved5 bit */ - gst_bit_reader_skip_unchecked (br, 1); - - structc->overlap = gst_bit_reader_get_bits_uint8_unchecked (br, 1); - structc->syncmarker = gst_bit_reader_get_bits_uint8_unchecked (br, 1); - structc->rangered = gst_bit_reader_get_bits_uint8_unchecked (br, 1); - structc->maxbframes = gst_bit_reader_get_bits_uint8_unchecked (br, 3); - structc->quantizer = gst_bit_reader_get_bits_uint8_unchecked (br, 2); - structc->finterpflag = gst_bit_reader_get_bits_uint8_unchecked (br, 1); - - GST_DEBUG ("frmrtq_postproc %u, bitrtq_postproc %u, loop_filter %u, " - "multires %u, fastuvmc %u, extended_mv %u, dquant %u, vstransform %u, " - "overlap %u, syncmarker %u, rangered %u, maxbframes %u, quantizer %u, " - "finterpflag %u", structc->frmrtq_postproc, structc->bitrtq_postproc, - structc->loop_filter, structc->multires, structc->fastuvmc, - structc->extended_mv, structc->dquant, structc->vstransform, - structc->overlap, structc->syncmarker, structc->rangered, - structc->maxbframes, structc->quantizer, structc->finterpflag); - - if (structc->wmvp) { - if (gst_bit_reader_get_remaining (br) < 29) - goto failed; - - structc->coded_width = gst_bit_reader_get_bits_uint16_unchecked (br, 11); - structc->coded_height = gst_bit_reader_get_bits_uint16_unchecked (br, 11); - structc->framerate = gst_bit_reader_get_bits_uint8_unchecked (br, 5); - gst_bit_reader_skip_unchecked (br, 1); - structc->slice_code = gst_bit_reader_get_bits_uint8_unchecked (br, 1); - - GST_DEBUG ("coded_width %u, coded_height %u, framerate %u slice_code %u", - structc->coded_width, structc->coded_height, structc->framerate, - structc->slice_code); - } - - return GST_VC1_PARSER_OK; - -failed: - GST_WARNING ("Failed to struct C"); - - return GST_VC1_PARSER_ERROR; -} - -/**** API ****/ -/** - * gst_vc1_identify_next_bdu: - * @data: The data to parse - * @size: the size of @data - * @bdu: (out): The #GstVC1BDU where to store parsed bdu headers - * - * Parses @data and fills @bdu fields - * - * Returns: a #GstVC1ParserResult - */ -GstVC1ParserResult -gst_vc1_identify_next_bdu (const guint8 * data, gsize size, GstVC1BDU * bdu) -{ - gint off1, off2; - - g_return_val_if_fail (bdu != NULL, GST_VC1_PARSER_ERROR); - - if (size < 4) { - GST_DEBUG ("Can't parse, buffer has too small size %" G_GSIZE_FORMAT, size); - return GST_VC1_PARSER_ERROR; - } - - off1 = scan_for_start_codes (data, size); - - if (off1 < 0) { - GST_DEBUG ("No start code prefix in this buffer"); - return GST_VC1_PARSER_NO_BDU; - } - - bdu->sc_offset = off1; - - bdu->offset = off1 + 4; - bdu->data = (guint8 *) data; - bdu->type = (GstVC1StartCode) (data[bdu->offset - 1]); - - if (bdu->type == GST_VC1_END_OF_SEQ) { - GST_DEBUG ("End-of-Seq BDU found"); - bdu->size = 0; - return GST_VC1_PARSER_OK; - } - - off2 = scan_for_start_codes (data + bdu->offset, size - bdu->offset); - if (off2 < 0) { - GST_DEBUG ("Bdu start %d, No end found", bdu->offset); - - return GST_VC1_PARSER_NO_BDU_END; - } - - if (off2 > 0 && data[bdu->offset + off2 - 1] == 00) - off2--; - - bdu->size = off2; - - GST_DEBUG ("Complete bdu found. Off: %d, Size: %d", bdu->offset, bdu->size); - return GST_VC1_PARSER_OK; -} - -/** - * gst_vc1_parse_sequence_layer: - * @data: The data to parse - * @size: the size of @data - * @seqlayer: The #GstVC1SeqLayer to set. - * - * Parses @data, and fills @seqlayer fields. - * - * Returns: a #GstVC1ParserResult - */ -GstVC1ParserResult -gst_vc1_parse_sequence_layer (const guint8 * data, gsize size, - GstVC1SeqLayer * seqlayer) -{ - guint32 tmp; - guint8 tmp8; - guint8 structA[8] = { 0, }; - guint8 structB[12] = { 0, }; - GstBitReader br; - GstByteReader byter = GST_BYTE_READER_INIT (data, size); - GstByteWriter bytew; - - g_return_val_if_fail (seqlayer != NULL, GST_VC1_PARSER_ERROR); - - /* Thanks to the specification, structA and structB fields are defined - * as unisgned integer msb first. - * But in sequence-layer there are serialized in little-endian byte order, - * so we must take care of their endianness before using bit reader */ - - if (!gst_byte_reader_get_uint24_le (&byter, &seqlayer->numframes)) - goto failed; - - if (!gst_byte_reader_get_uint8 (&byter, &tmp8)) - goto failed; - - if (tmp8 != 0xC5) - goto failed; - - /* 0x00000004 */ - if (!gst_byte_reader_get_uint32_le (&byter, &tmp)) - goto failed; - - if (tmp != 0x04) - goto failed; - - /* As an exception, structC is serialized in big-endian byte order so - * no endianness issue here but we should at least have 4 bytes */ - if (gst_byte_reader_get_remaining (&byter) < 4) - goto failed; - - gst_bit_reader_init (&br, data + gst_byte_reader_get_pos (&byter), 4); - if (parse_sequence_header_struct_c (&br, &seqlayer->struct_c) == - GST_VC1_PARSER_ERROR) - goto failed; - - gst_byte_reader_skip (&byter, 4); - - /* structA */ - gst_byte_writer_init_with_data (&bytew, structA, 8, TRUE); - gst_byte_reader_get_uint32_le (&byter, &tmp); - gst_byte_writer_put_uint32_be (&bytew, tmp); - gst_byte_reader_get_uint32_le (&byter, &tmp); - gst_byte_writer_put_uint32_be (&bytew, tmp); - - gst_bit_reader_init (&br, structA, 8); - if (parse_sequence_header_struct_a (&br, &seqlayer->struct_a) == - GST_VC1_PARSER_ERROR) - goto failed; - - /* 0x0000000C */ - if (!gst_byte_reader_get_uint32_le (&byter, &tmp)) - goto failed; - - if (tmp != 0x0C) - goto failed; - - /* structB */ - gst_byte_writer_reset (&bytew); - gst_byte_writer_init_with_data (&bytew, structB, 12, TRUE); - gst_byte_reader_get_uint32_le (&byter, &tmp); - gst_byte_writer_put_uint32_be (&bytew, tmp); - gst_byte_reader_get_uint32_le (&byter, &tmp); - gst_byte_writer_put_uint32_be (&bytew, tmp); - gst_byte_reader_get_uint32_le (&byter, &tmp); - gst_byte_writer_put_uint32_be (&bytew, tmp); - - gst_bit_reader_init (&br, structB, 12); - if (parse_sequence_header_struct_b (&br, &seqlayer->struct_b) == - GST_VC1_PARSER_ERROR) - goto failed; - - return GST_VC1_PARSER_OK; - -failed: - GST_WARNING ("Failed to parse sequence layer"); - - return GST_VC1_PARSER_ERROR; -} - -/** - * gst_vc1_parse_sequence_header_struct_a: - * @data: The data to parse - * @size: the size of @data - * @structa: The #GstVC1SeqStructA to set. - * - * Parses @data, and fills @structa fields. - * - * Returns: a #GstVC1ParserResult - */ -GstVC1ParserResult -gst_vc1_parse_sequence_header_struct_a (const guint8 * data, - gsize size, GstVC1SeqStructA * structa) -{ - GstBitReader br = GST_BIT_READER_INIT (data, size); - - g_return_val_if_fail (structa != NULL, GST_VC1_PARSER_ERROR); - - return parse_sequence_header_struct_a (&br, structa); -} - -/** - * gst_vc1_parse_sequence_header_struct_b: - * @data: The data to parse - * @size: the size of @data - * @structb: The #GstVC1SeqStructB to set. - * - * Parses @data, and fills @structb fields. - * - * Returns: a #GstVC1ParserResult - */ -GstVC1ParserResult -gst_vc1_parse_sequence_header_struct_b (const guint8 * data, - gsize size, GstVC1SeqStructB * structb) -{ - GstBitReader br = GST_BIT_READER_INIT (data, size); - - g_return_val_if_fail (structb != NULL, GST_VC1_PARSER_ERROR); - - return parse_sequence_header_struct_b (&br, structb); -} - -/** - * gst_vc1_parse_sequence_header_struct_c: - * @data: The data to parse - * @size: the size of @data - * @structc: The #GstVC1SeqStructC to set. - * - * Parses @data, and fills @structc fields. - * - * Returns: a #GstVC1ParserResult - */ -GstVC1ParserResult -gst_vc1_parse_sequence_header_struct_c (const guint8 * data, gsize size, - GstVC1SeqStructC * structc) -{ - GstBitReader br = GST_BIT_READER_INIT (data, size); - - g_return_val_if_fail (structc != NULL, GST_VC1_PARSER_ERROR); - - return parse_sequence_header_struct_c (&br, structc); -} - -/** -* gst_vc1_parse_sequence_header: -* @data: The data to parse -* @size: the size of @data -* @seqhdr: The #GstVC1SeqHdr to set. - * - * Parses @data, and fills @seqhdr fields. - * - * Returns: a #GstVC1ParserResult - */ -GstVC1ParserResult -gst_vc1_parse_sequence_header (const guint8 * data, gsize size, - GstVC1SeqHdr * seqhdr) -{ - GstBitReader br = GST_BIT_READER_INIT (data, size); - - g_return_val_if_fail (seqhdr != NULL, GST_VC1_PARSER_ERROR); - - if (parse_sequence_header_struct_c (&br, &seqhdr->struct_c) == - GST_VC1_PARSER_ERROR) - goto failed; - - /* Convenience field */ - seqhdr->profile = seqhdr->struct_c.profile; - - if (seqhdr->profile == GST_VC1_PROFILE_ADVANCED) - return parse_sequence_header_advanced (seqhdr, &br); - - /* Compute MB height and width */ - calculate_mb_size (seqhdr, seqhdr->struct_c.coded_width, - seqhdr->struct_c.coded_height); - - return GST_VC1_PARSER_OK; - -failed: - GST_WARNING ("Failed to parse sequence header"); - - return GST_VC1_PARSER_ERROR; -} - -/** - * gst_vc1_parse_entry_point_header: - * @data: The data to parse - * @size: the size of @data - * @entrypoint: (out): The #GstVC1EntryPointHdr to set. - * @seqhdr: The #GstVC1SeqHdr currently being parsed - * - * Parses @data, and sets @entrypoint fields. - * - * Returns: a #GstVC1EntryPointHdr - */ -GstVC1ParserResult -gst_vc1_parse_entry_point_header (const guint8 * data, gsize size, - GstVC1EntryPointHdr * entrypoint, GstVC1SeqHdr * seqhdr) -{ - GstBitReader br; - guint8 i; - GstVC1AdvancedSeqHdr *advanced = &seqhdr->advanced; - - g_return_val_if_fail (entrypoint != NULL, GST_VC1_PARSER_ERROR); - - gst_bit_reader_init (&br, data, size); - - if (gst_bit_reader_get_remaining (&br) < 13) - goto failed; - - entrypoint->broken_link = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - entrypoint->closed_entry = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - entrypoint->panscan_flag = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - entrypoint->refdist_flag = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - entrypoint->loopfilter = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - entrypoint->fastuvmc = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - entrypoint->extended_mv = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - entrypoint->dquant = gst_bit_reader_get_bits_uint8_unchecked (&br, 2); - entrypoint->vstransform = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - entrypoint->overlap = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - entrypoint->quantizer = gst_bit_reader_get_bits_uint8_unchecked (&br, 2); - - if (advanced->hrd_param_flag) { - if (seqhdr->advanced.hrd_param.hrd_num_leaky_buckets > - MAX_HRD_NUM_LEAKY_BUCKETS) { - GST_WARNING - ("hrd_num_leaky_buckets (%d) > MAX_HRD_NUM_LEAKY_BUCKETS (%d)", - seqhdr->advanced.hrd_param.hrd_num_leaky_buckets, - MAX_HRD_NUM_LEAKY_BUCKETS); - goto failed; - } - for (i = 0; i < seqhdr->advanced.hrd_param.hrd_num_leaky_buckets; i++) - READ_UINT8 (&br, entrypoint->hrd_full[i], 8); - } - - READ_UINT8 (&br, entrypoint->coded_size_flag, 1); - if (entrypoint->coded_size_flag) { - READ_UINT16 (&br, entrypoint->coded_width, 12); - READ_UINT16 (&br, entrypoint->coded_height, 12); - entrypoint->coded_height = (entrypoint->coded_height + 1) << 1; - entrypoint->coded_width = (entrypoint->coded_width + 1) << 1; - calculate_mb_size (seqhdr, entrypoint->coded_width, - entrypoint->coded_height); - } - - if (entrypoint->extended_mv) - READ_UINT8 (&br, entrypoint->extended_dmv, 1); - - READ_UINT8 (&br, entrypoint->range_mapy_flag, 1); - if (entrypoint->range_mapy_flag) - READ_UINT8 (&br, entrypoint->range_mapy, 3); - - READ_UINT8 (&br, entrypoint->range_mapuv_flag, 1); - if (entrypoint->range_mapy_flag) - READ_UINT8 (&br, entrypoint->range_mapuv, 3); - - advanced->entrypoint = *entrypoint; - - return GST_VC1_PARSER_OK; - -failed: - GST_WARNING ("Failed to parse entry point header"); - - return GST_VC1_PARSER_ERROR; -} - -/** - * gst_vc1_parse_frame_layer: - * @data: The data to parse - * @size: the size of @data - * @framelayer: The #GstVC1FrameLayer to fill. - * - * Parses @data, and fills @framelayer fields. - * - * Returns: a #GstVC1ParserResult - */ -GstVC1ParserResult -gst_vc1_parse_frame_layer (const guint8 * data, gsize size, - GstVC1FrameLayer * framelayer) -{ - GstBitReader br = GST_BIT_READER_INIT (data, size); - - if (gst_bit_reader_get_remaining (&br) < 64) { - GST_WARNING ("Could not parse frame layer"); - - return GST_VC1_PARSER_ERROR; - } - - /* set default values */ - framelayer->skiped_p_frame = 0; - - framelayer->key = gst_bit_reader_get_bits_uint8_unchecked (&br, 1); - gst_bit_reader_skip_unchecked (&br, 7); - - framelayer->framesize = gst_bit_reader_get_bits_uint32_unchecked (&br, 24); - - if (framelayer->framesize == 0 || framelayer->framesize == 1) - framelayer->skiped_p_frame = 1; - - /* compute next_framelayer_offset */ - framelayer->next_framelayer_offset = framelayer->framesize + 8; - - framelayer->timestamp = gst_bit_reader_get_bits_uint32_unchecked (&br, 32); - - return GST_VC1_PARSER_OK; -} - -/** - * gst_vc1_parse_frame_header: - * @data: The data to parse - * @size: the size of @data - * @framehdr: The #GstVC1FrameHdr to fill. - * @seqhdr: The #GstVC1SeqHdr currently being parsed - * @bitplanes: The #GstVC1BitPlanes to store bitplanes in or %NULL - * - * Parses @data, and fills @entrypoint fields. - * - * Returns: a #GstVC1ParserResult - */ -GstVC1ParserResult -gst_vc1_parse_frame_header (const guint8 * data, gsize size, - GstVC1FrameHdr * framehdr, GstVC1SeqHdr * seqhdr, - GstVC1BitPlanes * bitplanes) -{ - GstBitReader br; - GstVC1ParserResult result; - - gst_bit_reader_init (&br, data, size); - - if (seqhdr->profile == GST_VC1_PROFILE_ADVANCED) - result = parse_frame_header_advanced (&br, framehdr, seqhdr, bitplanes, - FALSE); - else - result = parse_frame_header (&br, framehdr, seqhdr, bitplanes); - - framehdr->header_size = gst_bit_reader_get_pos (&br); - return result; -} - -/** - * gst_vc1_parse_field_header: - * @data: The data to parse - * @size: the size of @data - * @fieldhdr: The #GstVC1FrameHdr to fill. - * @seqhdr: The #GstVC1SeqHdr currently being parsed - * @bitplanes: The #GstVC1BitPlanes to store bitplanes in or %NULL - * - * Parses @data, and fills @fieldhdr fields. - * - * Returns: a #GstVC1ParserResult - */ -GstVC1ParserResult -gst_vc1_parse_field_header (const guint8 * data, gsize size, - GstVC1FrameHdr * fieldhdr, GstVC1SeqHdr * seqhdr, - GstVC1BitPlanes * bitplanes) -{ - GstBitReader br; - GstVC1ParserResult result; - - gst_bit_reader_init (&br, data, size); - - result = parse_frame_header_advanced (&br, fieldhdr, seqhdr, bitplanes, TRUE); - - return result; -} - -/** - * gst_vc1_parse_slice_header: - * @data: The data to parse - * @size: The size of @data - * @slicehdr: The #GstVC1SliceHdr to fill - * @seqhdr: The #GstVC1SeqHdr that was previously parsed - * - * Parses @data, and fills @slicehdr fields. - * - * Returns: a #GstVC1ParserResult - * - * Since: 1.2 - */ -GstVC1ParserResult -gst_vc1_parse_slice_header (const guint8 * data, gsize size, - GstVC1SliceHdr * slicehdr, GstVC1SeqHdr * seqhdr) -{ - GstBitReader br; - GstVC1FrameHdr framehdr; - GstVC1ParserResult result; - guint8 pic_header_flag; - - GST_DEBUG ("Parsing slice header"); - - if (seqhdr->profile != GST_VC1_PROFILE_ADVANCED) - return GST_VC1_PARSER_BROKEN_DATA; - - gst_bit_reader_init (&br, data, size); - - READ_UINT16 (&br, slicehdr->slice_addr, 9); - READ_UINT8 (&br, pic_header_flag, 1); - if (pic_header_flag) - result = parse_frame_header_advanced (&br, &framehdr, seqhdr, NULL, FALSE); - else - result = GST_VC1_PARSER_OK; - - slicehdr->header_size = gst_bit_reader_get_pos (&br); - return result; - -failed: - GST_WARNING ("Failed to parse slice header"); - return GST_VC1_PARSER_ERROR; -} - -/** - * gst_vc1_bitplanes_new: - * - * Creates a new #GstVC1BitPlanes. It should be freed with - * gst_vc1_bitplanes_free() after use. - * - * Returns: a new #GstVC1BitPlanes - */ -GstVC1BitPlanes * -gst_vc1_bitplanes_new (void) -{ - return g_slice_new0 (GstVC1BitPlanes); -} - -/** - * gst_vc1_bitplane_free: - * @bitplanes: the #GstVC1BitPlanes to free - * - * Frees @bitplanes. - */ -void -gst_vc1_bitplanes_free (GstVC1BitPlanes * bitplanes) -{ - gst_vc1_bitplanes_free_1 (bitplanes); - g_slice_free (GstVC1BitPlanes, bitplanes); -} - -/** - * gst_vc1_bitplane_free_1: - * @bitplanes: The #GstVC1BitPlanes to free - * - * Frees @bitplanes fields. - */ -void -gst_vc1_bitplanes_free_1 (GstVC1BitPlanes * bitplanes) -{ - g_free (bitplanes->acpred); - g_free (bitplanes->fieldtx); - g_free (bitplanes->overflags); - g_free (bitplanes->mvtypemb); - g_free (bitplanes->skipmb); - g_free (bitplanes->directmb); - g_free (bitplanes->forwardmb); -} - -/** - * gst_vc1_bitplanes_ensure_size: - * @bitplanes: The #GstVC1BitPlanes to reset - * @seqhdr: The #GstVC1SeqHdr from which to set @bitplanes - * - * Fills the @bitplanes structure from @seqhdr, this function - * should be called after #gst_vc1_parse_sequence_header if - * in simple or main mode, or after #gst_vc1_parse_entry_point_header - * if in advanced mode. - * - * Returns: %TRUE if everything went fine, %FALSE otherwize - */ -gboolean -gst_vc1_bitplanes_ensure_size (GstVC1BitPlanes * bitplanes, - GstVC1SeqHdr * seqhdr) -{ - g_return_val_if_fail (bitplanes != NULL, FALSE); - g_return_val_if_fail (seqhdr != NULL, FALSE); - - if (bitplanes->size) { - bitplanes->size = seqhdr->mb_height * seqhdr->mb_stride; - bitplanes->acpred = - g_realloc_n (bitplanes->acpred, bitplanes->size, sizeof (guint8)); - bitplanes->fieldtx = - g_realloc_n (bitplanes->fieldtx, bitplanes->size, sizeof (guint8)); - bitplanes->overflags = - g_realloc_n (bitplanes->overflags, bitplanes->size, sizeof (guint8)); - bitplanes->mvtypemb = - g_realloc_n (bitplanes->mvtypemb, bitplanes->size, sizeof (guint8)); - bitplanes->skipmb = - g_realloc_n (bitplanes->skipmb, bitplanes->size, sizeof (guint8)); - bitplanes->directmb = - g_realloc_n (bitplanes->directmb, bitplanes->size, sizeof (guint8)); - bitplanes->forwardmb = - g_realloc_n (bitplanes->forwardmb, bitplanes->size, sizeof (guint8)); - } else { - bitplanes->size = seqhdr->mb_height * seqhdr->mb_stride; - bitplanes->acpred = g_malloc0 (bitplanes->size * sizeof (guint8)); - bitplanes->fieldtx = g_malloc0 (bitplanes->size * sizeof (guint8)); - bitplanes->overflags = g_malloc0 (bitplanes->size * sizeof (guint8)); - bitplanes->mvtypemb = g_malloc0 (bitplanes->size * sizeof (guint8)); - bitplanes->skipmb = g_malloc0 (bitplanes->size * sizeof (guint8)); - bitplanes->directmb = g_malloc0 (bitplanes->size * sizeof (guint8)); - bitplanes->forwardmb = g_malloc0 (bitplanes->size * sizeof (guint8)); - } - - return TRUE; -} diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstvc1parser.h gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstvc1parser.h --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstvc1parser.h 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstvc1parser.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,642 +0,0 @@ -/* Gstreamer - * Copyright (C) <2011> Intel - * Copyright (C) <2011> Collabora Ltd. - * Copyright (C) <2011> Thibault Saunier - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef __GST_VC1_PARSER_H__ -#define __GST_VC1_PARSER_H__ - -#ifndef GST_USE_UNSTABLE_API -#warning "The VC1 parsing library is unstable API and may change in future." -#warning "You can define GST_USE_UNSTABLE_API to avoid this warning." -#endif - -#include - -G_BEGIN_DECLS - -#define MAX_HRD_NUM_LEAKY_BUCKETS 31 - -/** - * GST_VC1_BFRACTION_BASIS: - * The @bfraction variable should be divided - * by this constant to have the actual value. - */ -#define GST_VC1_BFRACTION_BASIS 840 - -#define GST_VC1_BFRACTION_RESERVED (GST_VC1_BFRACTION_BASIS + 1) -#define GST_VC1_BFRACTION_PTYPE_BI (GST_VC1_BFRACTION_BASIS + 2) - -typedef enum { - GST_VC1_END_OF_SEQ = 0x0A, - GST_VC1_SLICE = 0x0B, - GST_VC1_FIELD = 0x0C, - GST_VC1_FRAME = 0x0D, - GST_VC1_ENTRYPOINT = 0x0E, - GST_VC1_SEQUENCE = 0x0F, - GST_VC1_SLICE_USER = 0x1B, - GST_VC1_FIELD_USER = 0x1C, - GST_VC1_FRAME_USER = 0x1D, - GST_VC1_ENTRY_POINT_USER = 0x1E, - GST_VC1_SEQUENCE_USER = 0x1F -} GstVC1StartCode; - -typedef enum { - GST_VC1_PROFILE_SIMPLE, - GST_VC1_PROFILE_MAIN, - GST_VC1_PROFILE_RESERVED, - GST_VC1_PROFILE_ADVANCED -} GstVC1Profile; - -typedef enum { - GST_VC1_PARSER_OK, - GST_VC1_PARSER_BROKEN_DATA, - GST_VC1_PARSER_NO_BDU, - GST_VC1_PARSER_NO_BDU_END, - GST_VC1_PARSER_ERROR, -} GstVC1ParserResult; - -typedef enum -{ - GST_VC1_PICTURE_TYPE_P, - GST_VC1_PICTURE_TYPE_B, - GST_VC1_PICTURE_TYPE_I, - GST_VC1_PICTURE_TYPE_BI, - GST_VC1_PICTURE_TYPE_SKIPPED -} GstVC1PictureType; - -typedef enum -{ - GST_VC1_LEVEL_LOW = 0, /* Simple/Main profile low level */ - GST_VC1_LEVEL_MEDIUM = 2, /* Simple/Main profile medium level */ - GST_VC1_LEVEL_HIGH = 4, /* Main profile high level */ - - GST_VC1_LEVEL_L0 = 0, /* Advanced profile level 0 */ - GST_VC1_LEVEL_L1 = 1, /* Advanced profile level 1 */ - GST_VC1_LEVEL_L2 = 2, /* Advanced profile level 2 */ - GST_VC1_LEVEL_L3 = 3, /* Advanced profile level 3 */ - GST_VC1_LEVEL_L4 = 4, /* Advanced profile level 4 */ - - /* 5 to 7 reserved */ - GST_VC1_LEVEL_UNKNOWN = 255 /* Unknown profile */ -} GstVC1Level; - -typedef enum -{ - GST_VC1_QUANTIZER_IMPLICITLY, - GST_VC1_QUANTIZER_EXPLICITLY, - GST_VC1_QUANTIZER_NON_UNIFORM, - GST_VC1_QUANTIZER_UNIFORM -} GstVC1QuantizerSpec; - -typedef enum { - GST_VC1_DQPROFILE_FOUR_EDGES, - GST_VC1_DQPROFILE_DOUBLE_EDGES, - GST_VC1_DQPROFILE_SINGLE_EDGE, - GST_VC1_DQPROFILE_ALL_MBS -} GstVC1DQProfile; - -typedef enum { - GST_VC1_CONDOVER_NONE, - GST_VC1_CONDOVER_ALL, - GST_VC1_CONDOVER_SELECT -} GstVC1Condover; - -/** - * GstVC1MvMode: - * - */ -typedef enum -{ - GST_VC1_MVMODE_1MV_HPEL_BILINEAR, - GST_VC1_MVMODE_1MV, - GST_VC1_MVMODE_1MV_HPEL, - GST_VC1_MVMODE_MIXED_MV, - GST_VC1_MVMODE_INTENSITY_COMP -} GstVC1MvMode; - -typedef enum -{ - GST_VC1_FRAME_PROGRESSIVE = 0x0, - GST_VC1_FRAME_INTERLACE = 0x10, - GST_VC1_FIELD_INTERLACE = 0x11 -} GstVC1FrameCodingMode; - -typedef struct _GstVC1SeqHdr GstVC1SeqHdr; -typedef struct _GstVC1AdvancedSeqHdr GstVC1AdvancedSeqHdr; -typedef struct _GstVC1HrdParam GstVC1HrdParam; -typedef struct _GstVC1EntryPointHdr GstVC1EntryPointHdr; - -typedef struct _GstVC1SeqLayer GstVC1SeqLayer; - -typedef struct _GstVC1SeqStructA GstVC1SeqStructA; -typedef struct _GstVC1SeqStructB GstVC1SeqStructB; -typedef struct _GstVC1SeqStructC GstVC1SeqStructC; - -/* Pictures Structures */ -typedef struct _GstVC1FrameLayer GstVC1FrameLayer; -typedef struct _GstVC1FrameHdr GstVC1FrameHdr; -typedef struct _GstVC1PicAdvanced GstVC1PicAdvanced; -typedef struct _GstVC1PicSimpleMain GstVC1PicSimpleMain; -typedef struct _GstVC1Picture GstVC1Picture; -typedef struct _GstVC1SliceHdr GstVC1SliceHdr; - -typedef struct _GstVC1VopDquant GstVC1VopDquant; - -typedef struct _GstVC1BitPlanes GstVC1BitPlanes; - -typedef struct _GstVC1BDU GstVC1BDU; - -struct _GstVC1HrdParam -{ - guint8 hrd_num_leaky_buckets; - guint8 bit_rate_exponent; - guint8 buffer_size_exponent; - guint16 hrd_rate[MAX_HRD_NUM_LEAKY_BUCKETS]; - guint16 hrd_buffer[MAX_HRD_NUM_LEAKY_BUCKETS]; -}; - -/** - * GstVC1EntryPointHdr: - * - * Structure for entrypoint header, this will be used only in advanced profiles - */ -struct _GstVC1EntryPointHdr -{ - guint8 broken_link; - guint8 closed_entry; - guint8 panscan_flag; - guint8 refdist_flag; - guint8 loopfilter; - guint8 fastuvmc; - guint8 extended_mv; - guint8 dquant; - guint8 vstransform; - guint8 overlap; - guint8 quantizer; - guint8 coded_size_flag; - guint16 coded_width; - guint16 coded_height; - guint8 extended_dmv; - guint8 range_mapy_flag; - guint8 range_mapy; - guint8 range_mapuv_flag; - guint8 range_mapuv; - - guint8 hrd_full[MAX_HRD_NUM_LEAKY_BUCKETS]; -}; - -/** - * GstVC1AdvancedSeqHdr: - * - * Structure for the advanced profile sequence headers specific parameters. - */ -struct _GstVC1AdvancedSeqHdr -{ - GstVC1Level level; - - guint8 frmrtq_postproc; - guint8 bitrtq_postproc; - guint8 postprocflag; - guint16 max_coded_width; - guint16 max_coded_height; - guint8 pulldown; - guint8 interlace; - guint8 tfcntrflag; - guint8 finterpflag; - guint8 psf; - guint8 display_ext; - guint16 disp_horiz_size; - guint16 disp_vert_size; - guint8 aspect_ratio_flag; - guint8 aspect_ratio; - guint8 aspect_horiz_size; - guint8 aspect_vert_size; - guint8 framerate_flag; - guint8 framerateind; - guint8 frameratenr; - guint8 frameratedr; - guint16 framerateexp; - guint8 color_format_flag; - guint8 color_prim; - guint8 transfer_char; - guint8 matrix_coef; - guint8 hrd_param_flag; - guint8 colordiff_format; - - GstVC1HrdParam hrd_param; - - /* computed */ - guint framerate; /* Around in fps, 0 if unknown*/ - guint bitrate; /* Around in kpbs, 0 if unknown*/ - guint par_n; - guint par_d; - guint fps_n; - guint fps_d; - - /* The last parsed entry point */ - GstVC1EntryPointHdr entrypoint; -}; - -struct _GstVC1SeqStructA -{ - guint32 vert_size; - guint32 horiz_size; -}; - -struct _GstVC1SeqStructB -{ - GstVC1Level level; - - guint8 cbr; - guint32 framerate; - - /* In simple and main profiles only */ - guint32 hrd_buffer; - guint32 hrd_rate; -}; - -struct _GstVC1SeqStructC -{ - GstVC1Profile profile; - - /* Only in simple and main profiles */ - guint8 frmrtq_postproc; - guint8 bitrtq_postproc; - guint8 res_sprite; - guint8 loop_filter; - guint8 multires; - guint8 fastuvmc; - guint8 extended_mv; - guint8 dquant; - guint8 vstransform; - guint8 overlap; - guint8 syncmarker; - guint8 rangered; - guint8 maxbframes; - guint8 quantizer; - guint8 finterpflag; - - /* Computed */ - guint framerate; /* Around in fps, 0 if unknown*/ - guint bitrate; /* Around in kpbs, 0 if unknown*/ - - /* This should be filled by user if previously known */ - guint16 coded_width; - /* This should be filled by user if previously known */ - guint16 coded_height; - - /* Wmvp specific */ - guint8 wmvp; /* Specify if the stream is wmp or not */ - /* In the wmvp case, the framerate is not computed but in the bistream */ - guint8 slice_code; -}; - -struct _GstVC1SeqLayer -{ - guint32 numframes; - - GstVC1SeqStructA struct_a; - GstVC1SeqStructB struct_b; - GstVC1SeqStructC struct_c; -}; - -/** - * GstVC1SeqHdr: - * - * Structure for sequence headers in any profile. - */ -struct _GstVC1SeqHdr -{ - GstVC1Profile profile; - - GstVC1SeqStructC struct_c; - - /* calculated */ - guint mb_height; - guint mb_width; - guint mb_stride; - - GstVC1AdvancedSeqHdr advanced; - -}; - -/** - * GstVC1PicSimpleMain: - * @bfaction: Should be divided by #GST_VC1_BFRACTION_BASIS - * to get the real value. - */ -struct _GstVC1PicSimpleMain -{ - guint8 frmcnt; - guint8 mvrange; - guint8 rangeredfrm; - - /* I and P pic simple and main profiles only */ - guint8 respic; - - /* I and BI pic simple and main profiles only */ - guint8 transacfrm2; - guint8 bf; - - /* B and P pic simple and main profiles only */ - guint8 mvmode; - guint8 mvtab; - guint8 ttmbf; - - /* P pic simple and main profiles only */ - guint8 mvmode2; - guint8 lumscale; - guint8 lumshift; - - guint8 cbptab; - guint8 ttfrm; - - /* B and BI picture only - * Should be divided by #GST_VC1_BFRACTION_BASIS - * to get the real value. */ - guint16 bfraction; - - /* Biplane value, those fields only mention the fact - * that the bitplane is in raw mode or not */ - guint8 mvtypemb; - guint8 skipmb; - guint8 directmb; /* B pic main profile only */ -}; - -/** - * GstVC1PicAdvanced: - * @bfaction: Should be divided by #GST_VC1_BFRACTION_BASIS - * to get the real value. - */ -struct _GstVC1PicAdvanced -{ - GstVC1FrameCodingMode fcm; - guint8 tfcntr; - - guint8 rptfrm; - guint8 tff; - guint8 rff; - guint8 ps_present; - guint32 ps_hoffset; - guint32 ps_voffset; - guint16 ps_width; - guint16 ps_height; - guint8 rndctrl; - guint8 uvsamp; - guint8 postproc; - - /* B and P picture specific */ - guint8 mvrange; - guint8 mvmode; - guint8 mvtab; - guint8 cbptab; - guint8 ttmbf; - guint8 ttfrm; - - /* B and BI picture only - * Should be divided by #GST_VC1_BFRACTION_BASIS - * to get the real value. */ - guint16 bfraction; - - /* ppic */ - guint8 mvmode2; - guint8 lumscale; - guint8 lumshift; - - /* bipic */ - guint8 bf; - guint8 condover; - guint8 transacfrm2; - - /* Biplane value, those fields only mention the fact - * that the bitplane is in raw mode or not */ - guint8 acpred; - guint8 overflags; - guint8 mvtypemb; - guint8 skipmb; - guint8 directmb; - guint8 forwardmb; /* B pic interlace field only */ - - /* For interlaced pictures only */ - guint8 fieldtx; - - /* P and B pictures */ - guint8 intcomp; - guint8 dmvrange; - guint8 mbmodetab; - guint8 imvtab; - guint8 icbptab; - guint8 mvbptab2; - guint8 mvbptab4; /* If 4mvswitch in ppic */ - - /* P picture */ - guint8 mvswitch4; - - /* For interlaced fields only */ - guint16 refdist; - guint8 fptype; /* Raw value */ - - /* P pic */ - guint8 numref; - guint8 reffield; - guint8 lumscale2; - guint8 lumshift2; - guint8 intcompfield; - -}; - -struct _GstVC1BitPlanes -{ - guint8 *acpred; - guint8 *fieldtx; - guint8 *overflags; - guint8 *mvtypemb; - guint8 *skipmb; - guint8 *directmb; - guint8 *forwardmb; - - guint size; /* Size of the arrays */ -}; - -struct _GstVC1VopDquant -{ - guint8 pqdiff; - guint8 abspq; - - /* Computed */ - guint8 altpquant; - - /* if dqant != 2*/ - guint8 dquantfrm; - guint8 dqprofile; - - /* Boundary edge selection. This represents DQSBEDGE - * if dqprofile == GST_VC1_DQPROFILE_SINGLE_EDGE or - * DQDBEDGE if dqprofile == GST_VC1_DQPROFILE_DOUBLE_EDGE */ - guint8 dqbedge; - - /* FIXME: remove */ - guint8 unused; - - /* if dqprofile == GST_VC1_DQPROFILE_ALL_MBS */ - guint8 dqbilevel; - -}; - -struct _GstVC1FrameLayer -{ - guint8 key; - guint32 framesize; - - guint32 timestamp; - - /* calculated */ - guint32 next_framelayer_offset; - guint8 skiped_p_frame; -}; - -/** - * GstVC1FrameHdr: - * - * Structure that represent picture in any profile or mode. - * You should look at @ptype and @profile to know what is currently - * in use. - */ -struct _GstVC1FrameHdr -{ - /* common fields */ - GstVC1PictureType ptype; - guint8 interpfrm; - guint8 halfqp; - guint8 transacfrm; - guint8 transdctab; - guint8 pqindex; - guint8 pquantizer; - - /* Computed */ - guint8 pquant; - - /* Convenience fields */ - guint8 profile; - guint8 dquant; - - /* If dquant */ - GstVC1VopDquant vopdquant; - - union { - GstVC1PicSimpleMain simple; - GstVC1PicAdvanced advanced; - } pic; - - /* Size of the picture layer in bits */ - guint header_size; -}; - -/** - * GstVC1SliceHdr: - * - * Structure that represents slice layer in advanced profile. - */ -struct _GstVC1SliceHdr -{ - guint16 slice_addr; - - /* Size of the slice layer in bits */ - guint header_size; -}; - -/** - * GstVC1BDU: - * - * Structure that represents a Bitstream Data Unit. - */ -struct _GstVC1BDU -{ - GstVC1StartCode type; - guint size; - guint sc_offset; - guint offset; - guint8 * data; -}; - -GstVC1ParserResult gst_vc1_identify_next_bdu (const guint8 *data, - gsize size, - GstVC1BDU *bdu); - - -GstVC1ParserResult gst_vc1_parse_sequence_header (const guint8 *data, - gsize size, - GstVC1SeqHdr * seqhdr); - -GstVC1ParserResult gst_vc1_parse_entry_point_header (const guint8 *data, - gsize size, - GstVC1EntryPointHdr * entrypoint, - GstVC1SeqHdr *seqhdr); - -GstVC1ParserResult gst_vc1_parse_sequence_layer (const guint8 *data, - gsize size, - GstVC1SeqLayer * seqlayer); - -GstVC1ParserResult -gst_vc1_parse_sequence_header_struct_a (const guint8 *data, - gsize size, - GstVC1SeqStructA *structa); -GstVC1ParserResult -gst_vc1_parse_sequence_header_struct_b (const guint8 *data, - gsize size, - GstVC1SeqStructB *structb); - -GstVC1ParserResult -gst_vc1_parse_sequence_header_struct_c (const guint8 *data, - gsize size, - GstVC1SeqStructC *structc); - -GstVC1ParserResult gst_vc1_parse_frame_layer (const guint8 *data, - gsize size, - GstVC1FrameLayer * framelayer); - -GstVC1ParserResult gst_vc1_parse_frame_header (const guint8 *data, - gsize size, - GstVC1FrameHdr * framehdr, - GstVC1SeqHdr *seqhdr, - GstVC1BitPlanes *bitplanes); - -GstVC1ParserResult gst_vc1_parse_field_header (const guint8 *data, - gsize size, - GstVC1FrameHdr * fieldhdr, - GstVC1SeqHdr *seqhdr, - GstVC1BitPlanes *bitplanes); - -GstVC1ParserResult gst_vc1_parse_slice_header (const guint8 *data, - gsize size, - GstVC1SliceHdr *slicehdr, - GstVC1SeqHdr *seqhdr); - -GstVC1BitPlanes * gst_vc1_bitplanes_new (void); - -void gst_vc1_bitplanes_free (GstVC1BitPlanes *bitplanes); - -void gst_vc1_bitplanes_free_1 (GstVC1BitPlanes *bitplanes); - -gboolean gst_vc1_bitplanes_ensure_size (GstVC1BitPlanes *bitplanes, - GstVC1SeqHdr *seqhdr); - -G_END_DECLS -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstvp8parser.c gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstvp8parser.c --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstvp8parser.c 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstvp8parser.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,567 +0,0 @@ -/* - * gstvp8parser.c - VP8 parser - * - * Copyright (C) 2013-2014 Intel Corporation - * Author: Halley Zhao - * Author: Gwenole Beauchesne - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -/** - * SECTION:gstvp8parser - * @short_description: Convenience library for parsing vp8 video bitstream. - * - * For more details about the structures, you can refer to the - * specifications: VP8-rfc6386.pdf - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif -#include -#include -#include "gstvp8parser.h" -#include "gstvp8rangedecoder.h" -#include "vp8utils.h" - -GST_DEBUG_CATEGORY (vp8_parser_debug); -#define GST_CAT_DEFAULT vp8_parser_debug - -#define INITIALIZE_DEBUG_CATEGORY ensure_debug_category () -static void -ensure_debug_category (void) -{ -#ifndef GST_DISABLE_GST_DEBUG - static gsize is_initialized; - - if (g_once_init_enter (&is_initialized)) { - GST_DEBUG_CATEGORY_INIT (vp8_parser_debug, "codecparsers_vp8", 0, - "vp8 parser library"); - g_once_init_leave (&is_initialized, TRUE); - } -#endif -} - -static GstVp8MvProbs vp8_mv_update_probs; -static GstVp8TokenProbs vp8_token_update_probs; - -static void -ensure_prob_tables (void) -{ - static gsize is_initialized; - - if (g_once_init_enter (&is_initialized)) { - gst_vp8_mv_update_probs_init (&vp8_mv_update_probs); - gst_vp8_token_update_probs_init (&vp8_token_update_probs); - g_once_init_leave (&is_initialized, TRUE); - } -} - -#define READ_BOOL(rd, val, field_name) \ - val = vp8_read_bool ((rd)) -#define READ_UINT(rd, val, nbits, field_name) \ - val = vp8_read_uint ((rd), (nbits)) -#define READ_SINT(rd, val, nbits, field_name) \ - val = vp8_read_sint ((rd), (nbits)) - -static inline gboolean -vp8_read_bool (GstVp8RangeDecoder * rd) -{ - return (gboolean) gst_vp8_range_decoder_read_literal (rd, 1); -} - -static inline guint -vp8_read_uint (GstVp8RangeDecoder * rd, guint nbits) -{ - return (guint) gst_vp8_range_decoder_read_literal (rd, nbits); -} - -static inline gint -vp8_read_sint (GstVp8RangeDecoder * rd, guint nbits) -{ - gint v; - - v = gst_vp8_range_decoder_read_literal (rd, nbits); - if (gst_vp8_range_decoder_read_literal (rd, 1)) - v = -v; - return v; -} - -/* Parse update_segmentation() */ -static gboolean -parse_update_segmentation (GstVp8RangeDecoder * rd, GstVp8Segmentation * seg) -{ - gboolean update; - gint i; - - seg->update_mb_segmentation_map = FALSE; - seg->update_segment_feature_data = FALSE; - - READ_BOOL (rd, seg->segmentation_enabled, "segmentation_enabled"); - if (!seg->segmentation_enabled) - return TRUE; - - READ_BOOL (rd, seg->update_mb_segmentation_map, "update_mb_segmentation_map"); - READ_BOOL (rd, seg->update_segment_feature_data, - "update_segment_feature_data"); - - if (seg->update_segment_feature_data) { - READ_UINT (rd, seg->segment_feature_mode, 1, "segment_feature_mode"); - - /* quantizer_update_value defaults to zero if update flag is zero - (Section 9.3, 4.b) */ - for (i = 0; i < 4; i++) { - READ_BOOL (rd, update, "quantizer_update"); - if (update) { - READ_SINT (rd, seg->quantizer_update_value[i], 7, - "quantizer_update_value"); - } else - seg->quantizer_update_value[i] = 0; - } - - /* lf_update_value defaults to zero if update flag is zero - (Section 9.3, 4.b) */ - for (i = 0; i < 4; i++) { - READ_BOOL (rd, update, "loop_filter_update"); - if (update) { - READ_SINT (rd, seg->lf_update_value[i], 6, "lf_update_value"); - } else - seg->lf_update_value[i] = 0; - } - } - - /* segment_prob defaults to 255 if update flag is zero - (Section 9.3, 5) */ - if (seg->update_mb_segmentation_map) { - for (i = 0; i < 3; i++) { - READ_BOOL (rd, update, "segment_prob_update"); - if (update) { - READ_UINT (rd, seg->segment_prob[i], 8, "segment_prob"); - } else - seg->segment_prob[i] = 255; - } - } - return TRUE; -} - -/* Parse mb_lf_adjustments() to update loop filter delta adjustments */ -static gboolean -parse_mb_lf_adjustments (GstVp8RangeDecoder * rd, GstVp8MbLfAdjustments * adj) -{ - gboolean update; - gint i; - - adj->mode_ref_lf_delta_update = FALSE; - - READ_BOOL (rd, adj->loop_filter_adj_enable, "loop_filter_adj_enable"); - if (!adj->loop_filter_adj_enable) - return TRUE; - - READ_BOOL (rd, adj->mode_ref_lf_delta_update, "mode_ref_lf_delta_update"); - if (!adj->mode_ref_lf_delta_update) - return TRUE; - - for (i = 0; i < 4; i++) { - READ_BOOL (rd, update, "ref_frame_delta_update_flag"); - if (update) { - READ_SINT (rd, adj->ref_frame_delta[i], 6, "ref_frame_delta_magniture"); - } - } - - for (i = 0; i < 4; i++) { - READ_BOOL (rd, update, "mb_mode_delta_update_flag"); - if (update) { - READ_SINT (rd, adj->mb_mode_delta[i], 6, "mb_mode_delta_magnitude"); - } - } - return TRUE; -} - -/* Parse quant_indices() */ -static gboolean -parse_quant_indices (GstVp8RangeDecoder * rd, GstVp8QuantIndices * qip) -{ - gboolean update; - - READ_UINT (rd, qip->y_ac_qi, 7, "y_ac_qi"); - - READ_BOOL (rd, update, "y_dc_delta_present"); - if (update) { - READ_SINT (rd, qip->y_dc_delta, 4, "y_dc_delta_magnitude"); - } else - qip->y_dc_delta = 0; - - READ_BOOL (rd, update, "y2_dc_delta_present"); - if (update) { - READ_SINT (rd, qip->y2_dc_delta, 4, "y2_dc_delta_magnitude"); - } else - qip->y2_dc_delta = 0; - - READ_BOOL (rd, update, "y2_ac_delta_present"); - if (update) { - READ_SINT (rd, qip->y2_ac_delta, 4, "y2_ac_delta_magnitude"); - } else - qip->y2_ac_delta = 0; - - READ_BOOL (rd, update, "uv_dc_delta_present"); - if (update) { - READ_SINT (rd, qip->uv_dc_delta, 4, "uv_dc_delta_magnitude"); - } else - qip->uv_dc_delta = 0; - - READ_BOOL (rd, update, "uv_ac_delta_present"); - if (update) { - READ_SINT (rd, qip->uv_ac_delta, 4, "uv_ac_delta_magnitude"); - } else - qip->uv_ac_delta = 0; - - return TRUE; -} - -/* Parse token_prob_update() to update persistent token probabilities */ -static gboolean -parse_token_prob_update (GstVp8RangeDecoder * rd, GstVp8TokenProbs * probs) -{ - gint i, j, k, l; - guint8 prob; - - for (i = 0; i < 4; i++) { - for (j = 0; j < 8; j++) { - for (k = 0; k < 3; k++) { - for (l = 0; l < 11; l++) { - if (gst_vp8_range_decoder_read (rd, - vp8_token_update_probs.prob[i][j][k][l])) { - READ_UINT (rd, prob, 8, "token_prob_update"); - probs->prob[i][j][k][l] = prob; - } - } - } - } - } - return TRUE; -} - -/* Parse prob_update() to update probabilities used for MV decoding */ -static gboolean -parse_mv_prob_update (GstVp8RangeDecoder * rd, GstVp8MvProbs * probs) -{ - gint i, j; - guint8 prob; - - for (i = 0; i < 2; i++) { - for (j = 0; j < 19; j++) { - if (gst_vp8_range_decoder_read (rd, vp8_mv_update_probs.prob[i][j])) { - READ_UINT (rd, prob, 7, "mv_prob_update"); - probs->prob[i][j] = prob ? (prob << 1) : 1; - } - } - } - return TRUE; -} - -/* Calculate partition sizes */ -static gboolean -calc_partition_sizes (GstVp8FrameHdr * frame_hdr, const guint8 * data, - guint size) -{ - const guint num_partitions = 1 << frame_hdr->log2_nbr_of_dct_partitions; - guint i, ofs, part_size, part_size_ofs = frame_hdr->first_part_size; - - ofs = part_size_ofs + 3 * (num_partitions - 1); - if (ofs > size) { - GST_ERROR ("not enough bytes left to parse partition sizes"); - return FALSE; - } - - /* The size of the last partition is not specified (9.5) */ - for (i = 0; i < num_partitions - 1; i++) { - part_size = (guint32) data[part_size_ofs + 0] | - ((guint32) data[part_size_ofs + 1] << 8) | - ((guint32) data[part_size_ofs + 2] << 16); - part_size_ofs += 3; - - frame_hdr->partition_size[i] = part_size; - ofs += part_size; - } - - if (ofs > size) { - GST_ERROR ("not enough bytes left to determine the last partition size"); - return FALSE; - } - frame_hdr->partition_size[i] = size - ofs; - - while (++i < G_N_ELEMENTS (frame_hdr->partition_size)) - frame_hdr->partition_size[i] = 0; - return TRUE; -} - -/* Parse uncompressed data chunk (19.1) */ -static GstVp8ParserResult -parse_uncompressed_data_chunk (GstVp8Parser * parser, GstByteReader * br, - GstVp8FrameHdr * frame_hdr) -{ - guint32 frame_tag, start_code; - guint16 size_code; - - GST_DEBUG ("parsing \"Uncompressed Data Chunk\""); - - if (!gst_byte_reader_get_uint24_le (br, &frame_tag)) - goto error; - - frame_hdr->key_frame = !(frame_tag & 0x01); - frame_hdr->version = (frame_tag >> 1) & 0x07; - frame_hdr->show_frame = (frame_tag >> 4) & 0x01; - frame_hdr->first_part_size = (frame_tag >> 5) & 0x7ffff; - - if (frame_hdr->key_frame) { - if (!gst_byte_reader_get_uint24_be (br, &start_code)) - goto error; - if (start_code != 0x9d012a) - GST_WARNING ("vp8 parser: invalid start code in frame header"); - - if (!gst_byte_reader_get_uint16_le (br, &size_code)) - goto error; - frame_hdr->width = size_code & 0x3fff; - frame_hdr->horiz_scale_code = size_code >> 14; - - if (!gst_byte_reader_get_uint16_le (br, &size_code)) { - goto error; - } - frame_hdr->height = size_code & 0x3fff; - frame_hdr->vert_scale_code = (size_code >> 14); - - /* Reset parser state on key frames */ - gst_vp8_parser_init (parser); - } else { - frame_hdr->width = 0; - frame_hdr->height = 0; - frame_hdr->horiz_scale_code = 0; - frame_hdr->vert_scale_code = 0; - } - - /* Calculated values */ - frame_hdr->data_chunk_size = gst_byte_reader_get_pos (br); - return GST_VP8_PARSER_OK; - -error: - GST_WARNING ("error parsing \"Uncompressed Data Chunk\""); - return GST_VP8_PARSER_ERROR; -} - -/* Parse Frame Header (19.2) */ -static GstVp8ParserResult -parse_frame_header (GstVp8Parser * parser, GstVp8RangeDecoder * rd, - GstVp8FrameHdr * frame_hdr) -{ - gboolean update; - guint i; - - GST_DEBUG ("parsing \"Frame Header\""); - - if (frame_hdr->key_frame) { - READ_UINT (rd, frame_hdr->color_space, 1, "color_space"); - READ_UINT (rd, frame_hdr->clamping_type, 1, "clamping_type"); - } - - if (!parse_update_segmentation (rd, &parser->segmentation)) - goto error; - - READ_UINT (rd, frame_hdr->filter_type, 1, "filter_type"); - READ_UINT (rd, frame_hdr->loop_filter_level, 6, "loop_filter_level"); - READ_UINT (rd, frame_hdr->sharpness_level, 3, "sharpness_level"); - - if (!parse_mb_lf_adjustments (rd, &parser->mb_lf_adjust)) - goto error; - - READ_UINT (rd, frame_hdr->log2_nbr_of_dct_partitions, 2, - "log2_nbr_of_dct_partitions"); - - if (!parse_quant_indices (rd, &frame_hdr->quant_indices)) - goto error; - - frame_hdr->copy_buffer_to_golden = 0; - frame_hdr->copy_buffer_to_alternate = 0; - if (frame_hdr->key_frame) { - READ_BOOL (rd, frame_hdr->refresh_entropy_probs, "refresh_entropy_probs"); - - frame_hdr->refresh_last = TRUE; - frame_hdr->refresh_golden_frame = TRUE; - frame_hdr->refresh_alternate_frame = TRUE; - - gst_vp8_mode_probs_init_defaults (&frame_hdr->mode_probs, TRUE); - } else { - READ_BOOL (rd, frame_hdr->refresh_golden_frame, "refresh_golden_frame"); - READ_BOOL (rd, frame_hdr->refresh_alternate_frame, - "refresh_alternate_frame"); - - if (!frame_hdr->refresh_golden_frame) { - READ_UINT (rd, frame_hdr->copy_buffer_to_golden, 2, - "copy_buffer_to_golden"); - } - - if (!frame_hdr->refresh_alternate_frame) { - READ_UINT (rd, frame_hdr->copy_buffer_to_alternate, 2, - "copy_buffer_to_alternate"); - } - - READ_UINT (rd, frame_hdr->sign_bias_golden, 1, "sign_bias_golden"); - READ_UINT (rd, frame_hdr->sign_bias_alternate, 1, "sign_bias_alternate"); - READ_BOOL (rd, frame_hdr->refresh_entropy_probs, "refresh_entropy_probs"); - READ_BOOL (rd, frame_hdr->refresh_last, "refresh_last"); - - memcpy (&frame_hdr->mode_probs, &parser->mode_probs, - sizeof (parser->mode_probs)); - } - memcpy (&frame_hdr->token_probs, &parser->token_probs, - sizeof (parser->token_probs)); - memcpy (&frame_hdr->mv_probs, &parser->mv_probs, sizeof (parser->mv_probs)); - - if (!parse_token_prob_update (rd, &frame_hdr->token_probs)) - goto error; - - READ_BOOL (rd, frame_hdr->mb_no_skip_coeff, "mb_no_skip_coeff"); - if (frame_hdr->mb_no_skip_coeff) { - READ_UINT (rd, frame_hdr->prob_skip_false, 8, "prob_skip_false"); - } - - if (!frame_hdr->key_frame) { - READ_UINT (rd, frame_hdr->prob_intra, 8, "prob_intra"); - READ_UINT (rd, frame_hdr->prob_last, 8, "prob_last"); - READ_UINT (rd, frame_hdr->prob_gf, 8, "prob_gf"); - - READ_BOOL (rd, update, "intra_16x16_prob_update_flag"); - if (update) { - for (i = 0; i < 4; i++) { - READ_UINT (rd, frame_hdr->mode_probs.y_prob[i], 8, "intra_16x16_prob"); - } - } - - READ_BOOL (rd, update, "intra_chroma_prob_update_flag"); - if (update) { - for (i = 0; i < 3; i++) { - READ_UINT (rd, frame_hdr->mode_probs.uv_prob[i], 8, - "intra_chroma_prob"); - } - } - - if (!parse_mv_prob_update (rd, &frame_hdr->mv_probs)) - goto error; - } - - /* Refresh entropy probabilities */ - if (frame_hdr->refresh_entropy_probs) { - memcpy (&parser->token_probs, &frame_hdr->token_probs, - sizeof (frame_hdr->token_probs)); - memcpy (&parser->mv_probs, &frame_hdr->mv_probs, - sizeof (frame_hdr->mv_probs)); - if (!frame_hdr->key_frame) - memcpy (&parser->mode_probs, &frame_hdr->mode_probs, - sizeof (frame_hdr->mode_probs)); - } - - /* Calculated values */ - frame_hdr->header_size = gst_vp8_range_decoder_get_pos (rd); - return GST_VP8_PARSER_OK; - -error: - GST_WARNING ("error parsing \"Frame Header\""); - return GST_VP8_PARSER_ERROR; -} - -/**** API ****/ -/** - * gst_vp8_parser_init: - * @parser: The #GstVp8Parser to initialize - * - * Initializes the supplied @parser structure with its default values. - * - * Since: 1.4 - */ -void -gst_vp8_parser_init (GstVp8Parser * parser) -{ - g_return_if_fail (parser != NULL); - - memset (&parser->segmentation, 0, sizeof (parser->segmentation)); - memset (&parser->mb_lf_adjust, 0, sizeof (parser->mb_lf_adjust)); - gst_vp8_token_probs_init_defaults (&parser->token_probs); - gst_vp8_mv_probs_init_defaults (&parser->mv_probs); - gst_vp8_mode_probs_init_defaults (&parser->mode_probs, FALSE); -} - -/** - * gst_vp8_parser_parse_frame_header: - * @parser: The #GstVp8Parser - * @frame_hdr: The #GstVp8FrameHdr to fill - * @data: The data to parse - * @size: The size of the @data to parse - * - * Parses the VP8 bitstream contained in @data, and fills in @frame_hdr - * with the information. The supplied @data shall point to a complete - * frame since there is no sync code specified for VP8 bitstreams. Thus, - * the @size argument shall represent the whole frame size. - * - * Returns: a #GstVp8ParserResult - * - * Since: 1.4 - */ -GstVp8ParserResult -gst_vp8_parser_parse_frame_header (GstVp8Parser * parser, - GstVp8FrameHdr * frame_hdr, const guint8 * data, gsize size) -{ - GstByteReader br; - GstVp8RangeDecoder rd; - GstVp8RangeDecoderState rd_state; - GstVp8ParserResult result; - - ensure_debug_category (); - ensure_prob_tables (); - - g_return_val_if_fail (frame_hdr != NULL, GST_VP8_PARSER_ERROR); - g_return_val_if_fail (parser != NULL, GST_VP8_PARSER_ERROR); - - /* Uncompressed Data Chunk */ - gst_byte_reader_init (&br, data, size); - - result = parse_uncompressed_data_chunk (parser, &br, frame_hdr); - if (result != GST_VP8_PARSER_OK) - return result; - - /* Frame Header */ - if (frame_hdr->data_chunk_size + frame_hdr->first_part_size > size) - return GST_VP8_PARSER_BROKEN_DATA; - - data += frame_hdr->data_chunk_size; - size -= frame_hdr->data_chunk_size; - if (!gst_vp8_range_decoder_init (&rd, data, frame_hdr->first_part_size)) - return GST_VP8_PARSER_BROKEN_DATA; - - result = parse_frame_header (parser, &rd, frame_hdr); - if (result != GST_VP8_PARSER_OK) - return result; - - /* Calculate partition sizes */ - if (!calc_partition_sizes (frame_hdr, data, size)) - return GST_VP8_PARSER_BROKEN_DATA; - - /* Sync range decoder state */ - gst_vp8_range_decoder_get_state (&rd, &rd_state); - frame_hdr->rd_range = rd_state.range; - frame_hdr->rd_value = rd_state.value; - frame_hdr->rd_count = rd_state.count; - return GST_VP8_PARSER_OK; -} diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstvp8parser.h gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstvp8parser.h --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstvp8parser.h 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstvp8parser.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,338 +0,0 @@ -/* - * gstvp8parser.h - VP8 parser - * - * Copyright (C) 2013-2014 Intel Corporation - * Author: Halley Zhao - * Author: Gwenole Beauchesne - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef GST_VP8_PARSER_H -#define GST_VP8_PARSER_H - -#include - -G_BEGIN_DECLS - -typedef struct _GstVp8FrameHdr GstVp8FrameHdr; -typedef struct _GstVp8QuantIndices GstVp8QuantIndices; -typedef struct _GstVp8Segmentation GstVp8Segmentation; -typedef struct _GstVp8MbLfAdjustments GstVp8MbLfAdjustments; -typedef struct _GstVp8TokenProbs GstVp8TokenProbs; -typedef struct _GstVp8MvProbs GstVp8MvProbs; -typedef struct _GstVp8ModeProbs GstVp8ModeProbs; -typedef struct _GstVp8Parser GstVp8Parser; - -/** - * GstVp8ParserResult: - * @GST_VP8_PARSER_OK: The parsing succeeded - * @GST_VP8_PARSER_BROKEN_DATA: The data to parse is broken - * @GST_VP8_PARSER_ERROR: An error accured when parsing - * - * The result of parsing VP8 data. - */ -typedef enum { - GST_VP8_PARSER_OK, - GST_VP8_PARSER_BROKEN_DATA, - GST_VP8_PARSER_ERROR, -} GstVp8ParserResult; - -/** - * GstVpQuantIndices: - * @y_ac_qi: indicates the dequantization table index used for the - * luma AC coefficients - * @y_dc_delta: indicates the delta value that is added to the - * baseline index to obtain the luma DC coefficient dequantization - * index - * @y2_dc_delta: indicates the delta value that is added to the - * baseline index to obtain the Y2 block DC coefficient dequantization - * index - * @y2_ac_delta: indicates the delta value that is added to the - * baseline index to obtain the Y2 block AC coefficient dequantization - * index - * @uv_dc_delta: indicates the delta value that is added to the - * baseline index to obtain the chroma DC coefficient dequantization - * index - * @uv_ac_delta: indicates the delta value that is added to the - * baseline index to obtain the chroma AC coefficient dequantization - * index - * - * Dequantization indices. - */ -struct _GstVp8QuantIndices -{ - guint8 y_ac_qi; - gint8 y_dc_delta; - gint8 y2_dc_delta; - gint8 y2_ac_delta; - gint8 uv_dc_delta; - gint8 uv_ac_delta; -}; - -/** - * GstVp8Segmentation: - * @segmentation_enabled: enables the segmentation feature for the - * current frame - * @update_mb_segmentation_map: determines if the MB segmentation map - * is updated in the current frame - * @update_segment_feature_data: indicates if the segment feature data - * is updated in the current frame - * @segment_feature_mode: indicates the feature data update mode (0: - * delta, 1: absolute value) - * @quantizer_update_value: indicates the update value for the segment - * quantizer - * @lf_update_value: indicates the update value for the loop filter level - * @segment_prob: indicates the branch probabilities of the segment_id - * decoding tree - * - * Segmentation feature data. - */ -struct _GstVp8Segmentation -{ - guint8 segmentation_enabled; - guint8 update_mb_segmentation_map; - guint8 update_segment_feature_data; - - /* if update_segment_feature_data == 1 */ - guint8 segment_feature_mode; - gint8 quantizer_update_value[4]; - gint8 lf_update_value[4]; - - /* if update_mb_segmentation_map == 1 */ - guint8 segment_prob[3]; -}; - -/** - * GstVp8MbLfAdjustments: - * @loop_filter_adj_enable: indicates if the MB-level loop filter - * adjustment is on for the current frame - * @mode_ref_lf_delta_update: indicates if the delta values used in an - * adjustment are updated in the current frame - * @ref_frame_delta: indicates the adjustment delta value - * corresponding to a certain used reference frame - * @mb_mode_delta: indicates the adjustment delta value corresponding - * to a certain MB prediction mode - * - * MB-level loop filter adjustments. - */ -struct _GstVp8MbLfAdjustments -{ - guint8 loop_filter_adj_enable; - guint8 mode_ref_lf_delta_update; - - /* if mode_ref_lf_delta_update == 1 */ - gint8 ref_frame_delta[4]; - gint8 mb_mode_delta[4]; -}; - -/** - * GstVp8TokenProbs: - * @prob: token probability - * - * Token probabilities, with cumulative updates applied. - * - * Each probability value in this matrix is live across frames, until - * they are reset to their default values on key frame. - */ -struct _GstVp8TokenProbs -{ - guint8 prob[4][8][3][11]; -}; - -/** - * GstVp8MvProbs: - * @prob: MV probability - * - * Probabilities used for motion vector decoding, with cumulative - * updates applied. - * - * Each probability value in this matrix is live across frames, until - * they are reset to their default values on key frame. - */ -struct _GstVp8MvProbs -{ - guint8 prob[2][19]; -}; - -/** - * GstVp8ModeProbs: - * @y_prob: indicates the branch probabilities of the luma - * intra-prediction mode decoding tree - * @uv_prob: indicates the branch probabilities of the chroma - * intra-prediction mode decoding tree - * - * Probabilities used for intra-prediction mode decoding tree. - * - * Each probability value in thie structure is live across frames, - * until they are reset to their default values on key frame. - */ -struct _GstVp8ModeProbs -{ - guint8 y_prob[4]; - guint8 uv_prob[3]; -}; - -/** - * GstVp8FrameHdr: - * @key_frame: indicates whether the frame is a key frame (1), or an - * inter frame (0) - * @version: version number - * @show_frame: indicates whether the frame is meant to be displayed (1), - * or not (0) - * @data_chunk_size: the size in bytes of the Uncompressed Data Chunk - * @first_part_size: the size in bytes of the first partition (control - * partition), excluding the uncompressed data chunk - * @width: the frame width in pixels - * @height: the frame height in pixels - * @horiz_scale_code: horizontal scale code value - * @vert_scale_code: vertical scale code value - * @color_space: defines the YUV color space of the sequence - * @clamping_type: specifies if the decoder is required to clamp the - * reconstructed pixel values - * @filter_type: determines whether the normal or the simple loop - * filter is used - * @loop_filter_level: controls the deblocking filter - * @sharpness_level: controls the deblocking filter - * @log2_nbr_of_dct_partitions: determines the number of separate - * partitions containing the DCT coefficients of the macroblocks - * @partition_size: determines the size of each separate partition - * containing the DCT coefficients of the macroblocks, including the - * very last one (calculated size) - * @quant_indices: dequantization indices (see #GstVp8QuantIndices) - * @token_probs: token probabilities (see #GstVp8TokenProbs) - * @mv_probs: probabilities used for motion vector decoding - * (see #GstVp8MvProbs) - * @mode_probs: probabilities used for intra-prediction mode decoding - * tree (see #GstVp8ModeProbs) - * @refresh_entropy_probs: determines whether updated token - * probabilities are used only for this frame or until further update - * @refresh_golden_frame: determines if the current decoded frame - * refreshes the golden frame - * @refresh_alternate_frame: determines if the current decoded frame - * refreshes the alternate reference frame - * @copy_buffer_to_golden: determines if the golden reference is - * replaced by another reference - * @copy_buffer_to_alternate: determines if the alternate reference is - * replaced by another reference - * @sign_bias_golden: controls the sign of motion vectors when the - * golden frame is referenced - * @sign_bias_alternate: controls the sign of motion vectors when the - * alternate frame is referenced - * @refresh_last: determines if the current decoded frame refreshes - * the last frame reference buffer - * @mb_no_skip_coeff: enables (0) or disables (1) the skipping of - * macroblocks containing no non-zero coefficients - * @prob_skip_false: indicates the probability that the macroblock is - * not skipped - * @prob_intra: indicates the probability of an intra macroblock - * @prob_last: indicates the probability that the last reference frame - * is used for inter-prediction - * @prob_gf: indicates the probability that the golden reference frame - * is used for inter-prediction - * @rd_range: last range decoder value for "Range" - * @rd_value: last range decoder value for "Value" - * @rd_count: number of bits left in range decoder "Value" (@rd_value) - * @header_size: the size in bits of the Frame Header, thus excluding - * any Uncompressed Data Chunk bytes - * - * Frame header. - */ -struct _GstVp8FrameHdr -{ - guint8 key_frame; - guint8 version; - guint8 show_frame; - guint8 data_chunk_size; - guint32 first_part_size; - - /* if key_frame == 1 */ - guint16 width; - guint16 height; - guint8 horiz_scale_code; - guint8 vert_scale_code; - guint8 color_space; - guint8 clamping_type; - - guint8 filter_type; - guint8 loop_filter_level; - guint8 sharpness_level; - guint8 log2_nbr_of_dct_partitions; - guint partition_size[8]; - - GstVp8QuantIndices quant_indices; - GstVp8TokenProbs token_probs; - GstVp8MvProbs mv_probs; - GstVp8ModeProbs mode_probs; - - guint8 refresh_entropy_probs; - guint8 refresh_last; - /* if key_frame != 1 */ - guint8 refresh_golden_frame; - guint8 refresh_alternate_frame; - guint8 copy_buffer_to_golden; - guint8 copy_buffer_to_alternate; - guint8 sign_bias_golden; - guint8 sign_bias_alternate; - - guint8 mb_no_skip_coeff; - guint8 prob_skip_false; - - /* if key_frame != 1 */ - guint8 prob_intra; - guint8 prob_last; - guint8 prob_gf; - - /* Range decoder state */ - guint8 rd_range; - guint8 rd_value; - guint8 rd_count; - - /* Size of the Frame Header in bits */ - guint header_size; -}; - -/** - * GstVp8Parser: - * @segmentation: segmentation feature data - * @mb_lf_adjust: MB-level loop filter adjustments - * @token_probs: token probabilities - * @mv_probs: probabilities used for motion vector decoding - * @mode_probs: probabilities used for intra-prediction mode decoding tree. - * - * Parser context that needs to be live across frames. For instance - * the probabilities tables stored in #GstVp8FrameHdr may depend on - * the previous frames. - */ -struct _GstVp8Parser -{ - GstVp8Segmentation segmentation; - GstVp8MbLfAdjustments mb_lf_adjust; - GstVp8TokenProbs token_probs; - GstVp8MvProbs mv_probs; - GstVp8ModeProbs mode_probs; -}; - -void -gst_vp8_parser_init (GstVp8Parser * parser); - -GstVp8ParserResult -gst_vp8_parser_parse_frame_header (GstVp8Parser * parser, - GstVp8FrameHdr * frame_hdr, const guint8 * data, gsize size); - -G_END_DECLS - -#endif /* GST_VP8_PARSER_H */ diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstvp8rangedecoder.c gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstvp8rangedecoder.c --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstvp8rangedecoder.c 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstvp8rangedecoder.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -/* - * gstvp8rangedecoder.c - VP8 range decoder interface - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "gstvp8rangedecoder.h" -#include "dboolhuff.h" - -#define BOOL_DECODER_CAST(rd) \ - ((BOOL_DECODER *)(&(rd)->_gst_reserved[0])) - -gboolean -gst_vp8_range_decoder_init (GstVp8RangeDecoder * rd, const guchar * buf, - guint buf_size) -{ - BOOL_DECODER *const bd = BOOL_DECODER_CAST (rd); - - g_return_val_if_fail (sizeof (rd->_gst_reserved) >= sizeof (*bd), FALSE); - - rd->buf = buf; - rd->buf_size = buf_size; - return vp8dx_start_decode (bd, buf, buf_size, NULL, NULL) == 0; -} - -gint -gst_vp8_range_decoder_read (GstVp8RangeDecoder * rd, guint8 prob) -{ - return vp8dx_decode_bool (BOOL_DECODER_CAST (rd), prob); -} - -gint -gst_vp8_range_decoder_read_literal (GstVp8RangeDecoder * rd, gint bits) -{ - return vp8_decode_value (BOOL_DECODER_CAST (rd), bits); -} - -guint -gst_vp8_range_decoder_get_pos (GstVp8RangeDecoder * rd) -{ - BOOL_DECODER *const bd = BOOL_DECODER_CAST (rd); - - return (bd->user_buffer - rd->buf) * 8 - (8 + bd->count); -} - -void -gst_vp8_range_decoder_get_state (GstVp8RangeDecoder * rd, - GstVp8RangeDecoderState * state) -{ - BOOL_DECODER *const bd = BOOL_DECODER_CAST (rd); - - if (bd->count < 0) - vp8dx_bool_decoder_fill (bd); - - state->range = bd->range; - state->value = (guint8) ((bd->value) >> (VP8_BD_VALUE_SIZE - 8)); - state->count = (8 + bd->count) % 8; -} diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstvp8rangedecoder.h gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstvp8rangedecoder.h --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstvp8rangedecoder.h 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstvp8rangedecoder.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ -/* - * gstvp8rangedecoder.h - VP8 range decoder interface - * - * Copyright (C) 2014 Intel Corporation - * Author: Gwenole Beauchesne - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef GST_VP8_RANGE_DECODER_H -#define GST_VP8_RANGE_DECODER_H - -#include -#include - -typedef struct _GstVp8RangeDecoder GstVp8RangeDecoder; -typedef struct _GstVp8RangeDecoderState GstVp8RangeDecoderState; - -/** -* GstVp8RangeDecoder: -* @buf: the original bitstream buffer start -* @buf_size: the original bitstream buffer size -* -* Range decoder. -*/ -struct _GstVp8RangeDecoder { - const guchar *buf; - guint buf_size; - - /*< private >*/ - gpointer _gst_reserved[GST_PADDING_LARGE]; -}; - -/** -* GstVp8RangeDecoderState: -* @range: current "Range" value -* @value: current "Value" value -* @count: number of bits left in "Value" for decoding -* -* Range decoder state. -*/ -struct _GstVp8RangeDecoderState { - guint8 range; - guint8 value; - guint8 count; -}; - -gboolean -gst_vp8_range_decoder_init (GstVp8RangeDecoder * rd, const guchar * buf, - guint buf_size); - -gint -gst_vp8_range_decoder_read (GstVp8RangeDecoder * rd, guint8 prob); - -gint -gst_vp8_range_decoder_read_literal (GstVp8RangeDecoder * rd, gint bits); - -guint -gst_vp8_range_decoder_get_pos (GstVp8RangeDecoder * rd); - -void -gst_vp8_range_decoder_get_state (GstVp8RangeDecoder * rd, - GstVp8RangeDecoderState * state); - -#endif /* GST_VP8_RANGE_DECODER_H */ diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstvp9parser.c gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstvp9parser.c --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstvp9parser.c 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstvp9parser.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,811 +0,0 @@ -/* gstvp9parser.c - * - * Copyright (C) 2013-2014 Intel Corporation - * Copyright (C) 2015 Intel Corporation - * Author: XuGuangxin - * Author: Sreerenj Balachandran - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -/** - * SECTION:gstvp9parser - * @short_description: Convenience library for parsing vp9 video bitstream. - * - * For more details about the structures, you can refer to the - * specifications: - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include "vp9utils.h" -#include "gstvp9parser.h" - -#define MIN_TILE_WIDTH_B64 4 -#define MAX_TILE_WIDTH_B64 64 - -/* order of sb64, where sb64 = 64x64 */ -#define ALIGN_SB64(w) ((w + 63) >> 6) - -GST_DEBUG_CATEGORY (gst_vp9_parser_debug); -#define GST_CAT_DEFAULT gst_vp9_parser_debug - -static gboolean initialized = FALSE; -#define INITIALIZE_DEBUG_CATEGORY \ - if (!initialized) { \ - GST_DEBUG_CATEGORY_INIT (gst_vp9_parser_debug, "codecparsers_vp9", 0, \ - "vp9 parser library"); \ - initialized = TRUE; \ - } - -#define gst_vp9_read_bit(br) gst_bit_reader_get_bits_uint8_unchecked(br, 1) -#define gst_vp9_read_bits(br, bits) gst_bit_reader_get_bits_uint32_unchecked(br, bits) - -#define GST_VP9_PARSER_GET_PRIVATE(parser) ((GstVp9ParserPrivate *)(parser->priv)) - -typedef struct _ReferenceSize -{ - guint32 width; - guint32 height; -} ReferenceSize; - -typedef struct -{ - /* for loop filters */ - gint8 ref_deltas[GST_VP9_MAX_REF_LF_DELTAS]; - gint8 mode_deltas[GST_VP9_MAX_MODE_LF_DELTAS]; - - guint8 segmentation_abs_delta; - GstVp9SegmentationInfoData segmentation[GST_VP9_MAX_SEGMENTS]; - - ReferenceSize reference[GST_VP9_REF_FRAMES]; -} GstVp9ParserPrivate; - -static gint32 -gst_vp9_read_signed_bits (GstBitReader * br, int bits) -{ - const gint32 value = gst_vp9_read_bits (br, bits); - return gst_vp9_read_bit (br) ? -value : value; -} - -static gboolean -verify_frame_marker (GstBitReader * br) -{ - guint8 frame_marker = gst_vp9_read_bits (br, 2); - if (frame_marker != GST_VP9_FRAME_MARKER) { - GST_ERROR ("Invalid VP9 Frame Marker !"); - return FALSE; - } - return TRUE; -} - -static gboolean -verify_sync_code (GstBitReader * const br) -{ - return (gst_vp9_read_bits (br, 24) == GST_VP9_SYNC_CODE); -} - -static gboolean -parse_bitdepth_colorspace_sampling (GstBitReader * const br, - GstVp9FrameHdr * frame_hdr) -{ - if (frame_hdr->profile > GST_VP9_PROFILE_1) - frame_hdr->bit_depth = - gst_vp9_read_bit (br) ? GST_VP9_BIT_DEPTH_12 : GST_VP9_BIT_DEPTH_10; - else - frame_hdr->bit_depth = GST_VP9_BIT_DEPTH_8; - - frame_hdr->color_space = gst_vp9_read_bits (br, 3); - if (frame_hdr->color_space != GST_VP9_CS_SRGB) { - frame_hdr->color_range = gst_vp9_read_bit (br); - - if (frame_hdr->profile == GST_VP9_PROFILE_1 - || frame_hdr->profile == GST_VP9_PROFILE_3) { - - frame_hdr->subsampling_x = gst_vp9_read_bit (br); - frame_hdr->subsampling_y = gst_vp9_read_bit (br); - - if (frame_hdr->subsampling_x == 1 && frame_hdr->subsampling_y == 1) { - GST_ERROR - ("4:2:0 subsampling is not supported in profile_1 or profile_3"); - goto error; - } - - if (gst_vp9_read_bit (br)) { - GST_ERROR ("Reserved bit set!"); - goto error; - } - } else { - frame_hdr->subsampling_y = frame_hdr->subsampling_x = 1; - } - } else { - frame_hdr->color_range = GST_VP9_CR_FULL; - - if (frame_hdr->profile == GST_VP9_PROFILE_1 - || frame_hdr->profile == GST_VP9_PROFILE_3) { - if (gst_vp9_read_bit (br)) { - GST_ERROR ("Reserved bit set!"); - goto error; - } - } else { - GST_ERROR - ("4:4:4 subsampling is not supported in profile_0 and profile_2"); - goto error; - } - } - return TRUE; - -error: - return FALSE; -} - -static guint -parse_profile (GstBitReader * br) -{ - guint8 profile = gst_vp9_read_bit (br); - profile |= gst_vp9_read_bit (br) << 1; - if (profile > 2) - profile += gst_vp9_read_bit (br); - return profile; -} - -static void -parse_frame_size (GstBitReader * br, guint32 * width, guint32 * height) -{ - const guint32 w = gst_vp9_read_bits (br, 16) + 1; - const guint32 h = gst_vp9_read_bits (br, 16) + 1; - *width = w; - *height = h; -} - -static void -parse_display_frame_size (GstBitReader * br, GstVp9FrameHdr * frame_hdr) -{ - frame_hdr->display_size_enabled = gst_vp9_read_bit (br); - if (frame_hdr->display_size_enabled) - parse_frame_size (br, &frame_hdr->display_width, - &frame_hdr->display_height); -} - -static void -parse_frame_size_from_refs (const GstVp9Parser * parser, - GstVp9FrameHdr * frame_hdr, GstBitReader * br) -{ - gboolean found = FALSE; - int i; - GstVp9ParserPrivate *priv = GST_VP9_PARSER_GET_PRIVATE (parser); - - for (i = 0; i < GST_VP9_REFS_PER_FRAME; i++) { - found = gst_vp9_read_bit (br); - - if (found) { - guint8 idx = frame_hdr->ref_frame_indices[i]; - frame_hdr->width = priv->reference[idx].width; - frame_hdr->height = priv->reference[idx].height; - break; - } - } - if (!found) - parse_frame_size (br, &frame_hdr->width, &frame_hdr->height); -} - -static GstVp9InterpFilter -parse_interp_filter (GstBitReader * br) -{ - const GstVp9InterpFilter filter_map[] = { - GST_VP9_INTERP_FILTER_EIGHTTAP_SMOOTH, - GST_VP9_INTERP_FILTER_EIGHTTAP, - GST_VP9_INTERP_FILTER_EIGHTTAP_SHARP, - GST_VP9_INTERP_FILTER_BILINEAR - }; - - return gst_vp9_read_bit (br) ? GST_VP9_INTERP_FILTER_SWITCHABLE : - filter_map[gst_vp9_read_bits (br, 2)]; -} - -static void -parse_loopfilter (GstVp9LoopFilter * lf, GstBitReader * br) -{ - lf->filter_level = gst_vp9_read_bits (br, 6); - lf->sharpness_level = gst_vp9_read_bits (br, 3); - - lf->mode_ref_delta_update = 0; - - lf->mode_ref_delta_enabled = gst_vp9_read_bit (br); - if (lf->mode_ref_delta_enabled) { - lf->mode_ref_delta_update = gst_vp9_read_bit (br); - if (lf->mode_ref_delta_update) { - int i; - for (i = 0; i < GST_VP9_MAX_REF_LF_DELTAS; i++) { - lf->update_ref_deltas[i] = gst_vp9_read_bit (br); - if (lf->update_ref_deltas[i]) - lf->ref_deltas[i] = gst_vp9_read_signed_bits (br, 6); - } - - for (i = 0; i < GST_VP9_MAX_MODE_LF_DELTAS; i++) { - lf->update_mode_deltas[i] = gst_vp9_read_bit (br); - if (lf->update_mode_deltas[i]) - lf->mode_deltas[i] = gst_vp9_read_signed_bits (br, 6); - } - } - } -} - -static gint8 -parse_delta_q (GstBitReader * br) -{ - return gst_vp9_read_bit (br) ? gst_vp9_read_signed_bits (br, 4) : 0; -} - -static void -parse_quantization (GstVp9QuantIndices* quant_indices, GstBitReader * br) -{ - quant_indices->y_ac_qi = gst_vp9_read_bits (br, QINDEX_BITS); - quant_indices->y_dc_delta = parse_delta_q (br); - quant_indices->uv_dc_delta = parse_delta_q (br); - quant_indices->uv_ac_delta = parse_delta_q (br); -} - -static void -parse_segmentation (GstVp9SegmentationInfo * seg, GstBitReader * br) -{ - int i; - - seg->update_map = FALSE; - seg->update_data = FALSE; - - seg->enabled = gst_vp9_read_bit (br); - if (!seg->enabled) - return; - - /* Segmentation map update */ - seg->update_map = gst_vp9_read_bit (br); - if (seg->update_map) { - for (i = 0; i < GST_VP9_SEG_TREE_PROBS; i++) { - seg->update_tree_probs[i] = gst_vp9_read_bit (br); - seg->tree_probs[i] = seg->update_tree_probs[i] ? - gst_vp9_read_bits (br, 8) : GST_VP9_MAX_PROB; - } - - seg->temporal_update = gst_vp9_read_bit (br); - if (seg->temporal_update) { - for (i = 0; i < GST_VP9_PREDICTION_PROBS; i++) { - seg->update_pred_probs[i] = gst_vp9_read_bit (br); - seg->pred_probs[i] = seg->update_pred_probs[i] ? - gst_vp9_read_bits (br, 8) : GST_VP9_MAX_PROB; - } - } else { - for (i = 0; i < GST_VP9_PREDICTION_PROBS; i++) - seg->pred_probs[i] = GST_VP9_MAX_PROB; - } - } - - /* Segmentation data update */ - seg->update_data = gst_vp9_read_bit (br); - - if (seg->update_data) { - /* clear all features */ - memset (seg->data, 0, sizeof (seg->data)); - - seg->abs_delta = gst_vp9_read_bit (br); - - for (i = 0; i < GST_VP9_MAX_SEGMENTS; i++) { - GstVp9SegmentationInfoData *seg_data = seg->data + i; - guint8 data; - - /* SEG_LVL_ALT_Q */ - seg_data->alternate_quantizer_enabled = gst_vp9_read_bit (br); - if (seg_data->alternate_quantizer_enabled) { - data = gst_vp9_read_bits (br, 8); - seg_data->alternate_quantizer = gst_vp9_read_bit (br) ? -data : data; - } - - /* SEG_LVL_ALT_LF */ - seg_data->alternate_loop_filter_enabled = gst_vp9_read_bit (br); - if (seg_data->alternate_loop_filter_enabled) { - data = gst_vp9_read_bits (br, 6); - seg_data->alternate_loop_filter = gst_vp9_read_bit (br) ? -data : data; - } - - /* SEG_LVL_REF_FRAME */ - seg_data->reference_frame_enabled = gst_vp9_read_bit (br); - if (seg_data->reference_frame_enabled) { - seg_data->reference_frame = gst_vp9_read_bits (br, 2); - } - - seg_data->reference_skip = gst_vp9_read_bit (br); - } - } -} - -guint32 -get_max_lb_tile_cols (guint32 sb_cols) -{ - gint max_log2 = 1; - while ((sb_cols >> max_log2) >= MIN_TILE_WIDTH_B64) - ++max_log2; - return max_log2 - 1; -} - -guint32 -get_min_lb_tile_cols (guint32 sb_cols) -{ - gint min_log2 = 0; - while ((MAX_TILE_WIDTH_B64 << min_log2) < sb_cols) - ++min_log2; - return min_log2; -} - - -static gboolean -parse_tile_info (GstVp9FrameHdr * frame_hdr, GstBitReader * br) -{ - const guint32 sb_cols = ALIGN_SB64 (frame_hdr->width); - guint32 min_lb_tile_cols = get_min_lb_tile_cols (sb_cols); - guint32 max_lb_tile_cols = get_max_lb_tile_cols (sb_cols); - - g_assert (min_lb_tile_cols <= max_lb_tile_cols); - guint32 max_ones = max_lb_tile_cols - min_lb_tile_cols; - - /* columns */ - frame_hdr->log2_tile_columns = min_lb_tile_cols; - while (max_ones-- && gst_vp9_read_bit (br)) - frame_hdr->log2_tile_columns++; - - if (frame_hdr->log2_tile_columns > 6) { - GST_ERROR ("Invalid number of tile columns..!"); - return FALSE; - } - - /* row */ - frame_hdr->log2_tile_rows = gst_vp9_read_bit (br); - if (frame_hdr->log2_tile_rows) - frame_hdr->log2_tile_rows += gst_vp9_read_bit (br); - - return TRUE; -} - -static void -loop_filter_update (GstVp9Parser * parser, const GstVp9LoopFilter * lf) -{ - GstVp9ParserPrivate *priv = GST_VP9_PARSER_GET_PRIVATE (parser); - int i; - - for (i = 0; i < GST_VP9_MAX_REF_LF_DELTAS; i++) { - if (lf->update_ref_deltas[i]) - priv->ref_deltas[i] = lf->ref_deltas[i]; - } - - for (i = 0; i < GST_VP9_MAX_MODE_LF_DELTAS; i++) { - if (lf->update_mode_deltas[i]) - priv->mode_deltas[i] = lf->mode_deltas[i]; - } -} - -static guint8 -seg_get_base_qindex (const GstVp9Parser * parser, - const GstVp9FrameHdr * frame_hdr, int segid) -{ - int seg_base = frame_hdr->quant_indices.y_ac_qi; - GstVp9ParserPrivate *priv = GST_VP9_PARSER_GET_PRIVATE (parser); - const GstVp9SegmentationInfoData *seg = priv->segmentation + segid; - /* DEBUG("id = %d, seg_base = %d, seg enable = %d, alt eanble = %d, abs = %d, alt= %d\n",segid, - seg_base, frame_hdr->segmentation.enabled, seg->alternate_quantizer_enabled, priv->segmentation_abs_delta, seg->alternate_quantizer); - */ - if (frame_hdr->segmentation.enabled && seg->alternate_quantizer_enabled) { - if (priv->segmentation_abs_delta) - seg_base = seg->alternate_quantizer; - else - seg_base += seg->alternate_quantizer; - } - return clamp (seg_base, 0, MAXQ); -} - -static guint8 -seg_get_filter_level (const GstVp9Parser * parser, - const GstVp9FrameHdr * frame_hdr, int segid) -{ - int seg_filter = frame_hdr->loopfilter.filter_level; - GstVp9ParserPrivate *priv = GST_VP9_PARSER_GET_PRIVATE (parser); - const GstVp9SegmentationInfoData *seg = priv->segmentation + segid; - - if (frame_hdr->segmentation.enabled && seg->alternate_loop_filter_enabled) { - if (priv->segmentation_abs_delta) - seg_filter = seg->alternate_loop_filter; - else - seg_filter += seg->alternate_loop_filter; - } - return clamp (seg_filter, 0, GST_VP9_MAX_LOOP_FILTER); -} - -/*save segmentation info from frame header to parser*/ -static void -segmentation_save (GstVp9Parser * parser, const GstVp9FrameHdr * frame_hdr) -{ - const GstVp9SegmentationInfo *info = &frame_hdr->segmentation; - if (!info->enabled) - return; - - if (info->update_map) { - g_assert (G_N_ELEMENTS (parser->mb_segment_tree_probs) == - G_N_ELEMENTS (info->tree_probs)); - g_assert (G_N_ELEMENTS (parser->segment_pred_probs) == - G_N_ELEMENTS (info->pred_probs)); - memcpy (parser->mb_segment_tree_probs, info->tree_probs, - sizeof (info->tree_probs)); - memcpy (parser->segment_pred_probs, info->pred_probs, - sizeof (info->pred_probs)); - } - - if (info->update_data) { - GstVp9ParserPrivate *priv = GST_VP9_PARSER_GET_PRIVATE (parser); - priv->segmentation_abs_delta = info->abs_delta; - g_assert (G_N_ELEMENTS (priv->segmentation) == G_N_ELEMENTS (info->data)); - memcpy (priv->segmentation, info->data, sizeof (info->data)); - } -} - -static void -segmentation_update (GstVp9Parser * parser, const GstVp9FrameHdr * frame_hdr) -{ - int i = 0; - const GstVp9ParserPrivate *priv = GST_VP9_PARSER_GET_PRIVATE (parser); - const GstVp9LoopFilter *lf = &frame_hdr->loopfilter; - const GstVp9QuantIndices *quant_indices = &frame_hdr->quant_indices; - int default_filter = lf->filter_level; - const int scale = 1 << (default_filter >> 5); - - segmentation_save (parser, frame_hdr); - - for (i = 0; i < GST_VP9_MAX_SEGMENTS; i++) { - guint8 q = seg_get_base_qindex (parser, frame_hdr, i); - - GstVp9Segmentation *seg = parser->segmentation + i; - const GstVp9SegmentationInfoData *info = priv->segmentation + i; - - seg->luma_dc_quant_scale = vp9_dc_quant (q, quant_indices->y_dc_delta, frame_hdr->bit_depth); - seg->luma_ac_quant_scale = vp9_ac_quant (q, 0, frame_hdr->bit_depth); - seg->chroma_dc_quant_scale = vp9_dc_quant (q, quant_indices->uv_dc_delta, frame_hdr->bit_depth); - seg->chroma_ac_quant_scale = vp9_ac_quant (q, quant_indices->uv_ac_delta, frame_hdr->bit_depth); - - if (lf->filter_level) { - guint8 filter = seg_get_filter_level (parser, frame_hdr, i); - - if (!lf->mode_ref_delta_enabled) { - memset (seg->filter_level, filter, sizeof (seg->filter_level)); - } else { - int ref, mode; - const int intra_filter = - filter + priv->ref_deltas[GST_VP9_REF_FRAME_INTRA] * scale; - seg->filter_level[GST_VP9_REF_FRAME_INTRA][0] = - clamp (intra_filter, 0, GST_VP9_MAX_LOOP_FILTER); - for (ref = GST_VP9_REF_FRAME_LAST; ref < GST_VP9_REF_FRAME_MAX; ++ref) { - for (mode = 0; mode < GST_VP9_MAX_MODE_LF_DELTAS; ++mode) { - const int inter_filter = filter + priv->ref_deltas[ref] * scale - + priv->mode_deltas[mode] * scale; - seg->filter_level[ref][mode] = - clamp (inter_filter, 0, GST_VP9_MAX_LOOP_FILTER); - } - } - } - } - seg->reference_frame_enabled = info->reference_frame_enabled;; - seg->reference_frame = info->reference_frame; - seg->reference_skip = info->reference_skip; - } -} - -static void -reference_update (GstVp9Parser * parser, const GstVp9FrameHdr * const frame_hdr) -{ - guint8 flag = 1; - guint8 refresh_frame_flags; - int i; - GstVp9ParserPrivate *priv = GST_VP9_PARSER_GET_PRIVATE (parser); - ReferenceSize *reference = priv->reference; - if (frame_hdr->frame_type == GST_VP9_KEY_FRAME) { - refresh_frame_flags = 0xff; - } else { - refresh_frame_flags = frame_hdr->refresh_frame_flags; - } - for (i = 0; i < GST_VP9_REF_FRAMES; i++) { - if (refresh_frame_flags & flag) { - reference[i].width = frame_hdr->width; - reference[i].height = frame_hdr->height; - } - flag <<= 1; - } -} - -static inline int -frame_is_intra_only (const GstVp9FrameHdr * frame_hdr) -{ - return frame_hdr->frame_type == GST_VP9_KEY_FRAME || frame_hdr->intra_only; -} - -static void -set_default_lf_deltas (GstVp9Parser * parser) -{ - GstVp9ParserPrivate *priv = GST_VP9_PARSER_GET_PRIVATE (parser); - priv->ref_deltas[GST_VP9_REF_FRAME_INTRA] = 1; - priv->ref_deltas[GST_VP9_REF_FRAME_LAST] = 0; - priv->ref_deltas[GST_VP9_REF_FRAME_GOLDEN] = -1; - priv->ref_deltas[GST_VP9_REF_FRAME_ALTREF] = -1; - - priv->mode_deltas[0] = 0; - priv->mode_deltas[1] = 0; -} - -static void -set_default_segmentation_info (GstVp9Parser * parser) -{ - GstVp9ParserPrivate *priv = GST_VP9_PARSER_GET_PRIVATE (parser); - - memset (priv->segmentation, 0, sizeof (priv->segmentation)); - - priv->segmentation_abs_delta = FALSE; -} - -static void -setup_past_independence (GstVp9Parser * parser, - GstVp9FrameHdr * const frame_hdr) -{ - set_default_lf_deltas (parser); - set_default_segmentation_info (parser); - - memset (frame_hdr->ref_frame_sign_bias, 0, - sizeof (frame_hdr->ref_frame_sign_bias)); -} - -static void -gst_vp9_parser_init (GstVp9Parser * parser) -{ - GstVp9ParserPrivate *priv = parser->priv; - - memset (parser, 0, sizeof (GstVp9Parser)); - memset (priv, 0, sizeof (GstVp9ParserPrivate)); - - parser->priv = priv; -} - -static GstVp9ParserResult -gst_vp9_parser_update (GstVp9Parser * parser, GstVp9FrameHdr * const frame_hdr) -{ - if (frame_hdr->frame_type == GST_VP9_KEY_FRAME) - gst_vp9_parser_init (parser); - - if (frame_is_intra_only (frame_hdr) || frame_hdr->error_resilient_mode) - setup_past_independence (parser, frame_hdr); - - loop_filter_update (parser, &frame_hdr->loopfilter); - segmentation_update (parser, frame_hdr); - reference_update (parser, frame_hdr); - - return GST_VP9_PARSER_OK; -} - - -/******** API *************/ - -/** - * gst_vp9_parser_new: - * - * Creates a new #GstVp9Parser. It should be freed with - * gst_vp9_parser_free after use. - * - * Returns: a new #GstVp9Parser - */ -GstVp9Parser * -gst_vp9_parser_new () -{ - GstVp9Parser *parser; - GstVp9ParserPrivate *priv; - - INITIALIZE_DEBUG_CATEGORY; - GST_DEBUG ("Create VP9 Parser"); - - parser = g_slice_new (GstVp9Parser); - if (!parser) - return NULL; - - priv = g_slice_new (GstVp9ParserPrivate); - if (!priv) - return NULL; - - parser->priv = priv; - gst_vp9_parser_init (parser); - - return parser; -} - -/** - * gst_vp9_parser_free: - * @parser: the #GstVp9Parser to free - * - * Frees @parser and sets it to %NULL - */ -void -gst_vp9_parser_free (GstVp9Parser * parser) -{ - if (parser) { - if (parser->priv) { - g_slice_free (GstVp9ParserPrivate, parser->priv); - parser->priv = NULL; - } - g_slice_free (GstVp9Parser, parser); - parser = NULL; - } -} - -/** - * gst_vp9_parser_parse_frame_header: - * @parser: The #GstVp9Parser - * @frame_hdr: The #GstVp9FrameHdr to fill - * @data: The data to parse - * @size: The size of the @data to parse - * - * Parses the VP9 bitstream contained in @data, and fills in @frame_hdr - * with the information. The @size argument represent the whole frame size. - * - * Returns: a #GstVp9ParserResult - * - */ -GstVp9ParserResult -gst_vp9_parser_parse_frame_header (GstVp9Parser * parser, - GstVp9FrameHdr * frame_hdr, const guint8 * data, gsize size) -{ - GstBitReader bit_reader; - GstBitReader *br = &bit_reader; - - gst_bit_reader_init (br, data, size); - memset (frame_hdr, 0, sizeof (*frame_hdr)); - - /* Parsing Uncompressed Data Chunk */ - - if (!verify_frame_marker (br)) - goto error; - - frame_hdr->profile = parse_profile (br); - if (frame_hdr->profile > GST_VP9_PROFILE_UNDEFINED) { - GST_ERROR ("Stream has undefined VP9 profile !"); - goto error; - } - - frame_hdr->show_existing_frame = gst_vp9_read_bit (br); - if (frame_hdr->show_existing_frame) { - frame_hdr->frame_to_show = gst_vp9_read_bits (br, GST_VP9_REF_FRAMES_LOG2); - return GST_VP9_PARSER_OK; - } - - frame_hdr->frame_type = gst_vp9_read_bit (br); - frame_hdr->show_frame = gst_vp9_read_bit (br); - frame_hdr->error_resilient_mode = gst_vp9_read_bit (br); - - if (frame_hdr->frame_type == GST_VP9_KEY_FRAME) { - - if (!verify_sync_code (br)) { - GST_ERROR ("Invalid VP9 Key-frame sync code !"); - goto error; - } - - if (!parse_bitdepth_colorspace_sampling (br, frame_hdr)) { - GST_ERROR ("Failed to parse color_space/bit_depth info !"); - goto error; - } - - parse_frame_size (br, &frame_hdr->width, &frame_hdr->height); - - parse_display_frame_size (br, frame_hdr); - - } else { - frame_hdr->intra_only = frame_hdr->show_frame ? 0 : gst_vp9_read_bit (br); - frame_hdr->reset_frame_context = frame_hdr->error_resilient_mode ? - 0 : gst_vp9_read_bits (br, 2); - - if (frame_hdr->intra_only) { - - if (!verify_sync_code (br)) { - GST_ERROR ("Invalid VP9 sync code in intra-only frame !"); - goto error; - } - - if (frame_hdr->profile > GST_VP9_PROFILE_0) { - if (!parse_bitdepth_colorspace_sampling (br, frame_hdr)) { - GST_ERROR ("Failed to parse color_space/bit_depth info !"); - goto error; - } - } else { - frame_hdr->color_space = GST_VP9_CS_BT_601; - frame_hdr->color_range = GST_VP9_CR_LIMITED; - frame_hdr->subsampling_y = frame_hdr->subsampling_x = 1; - frame_hdr->bit_depth = GST_VP9_BIT_DEPTH_8; - } - - frame_hdr->refresh_frame_flags = - gst_vp9_read_bits (br, GST_VP9_REF_FRAMES); - parse_frame_size (br, &frame_hdr->width, &frame_hdr->height); - parse_display_frame_size (br, frame_hdr); - - } else { - int i; - frame_hdr->refresh_frame_flags = - gst_vp9_read_bits (br, GST_VP9_REF_FRAMES); - - for (i = 0; i < GST_VP9_REFS_PER_FRAME; i++) { - frame_hdr->ref_frame_indices[i] = - gst_vp9_read_bits (br, GST_VP9_REF_FRAMES_LOG2); - frame_hdr->ref_frame_sign_bias[i] = gst_vp9_read_bit (br); - } - - parse_frame_size_from_refs (parser, frame_hdr, br); - parse_display_frame_size (br, frame_hdr); - - frame_hdr->allow_high_precision_mv = gst_vp9_read_bit (br); - frame_hdr->mcomp_filter_type = parse_interp_filter (br); - - /* Assing defalut values */ - frame_hdr->color_space = GST_VP9_CS_BT_601; - frame_hdr->color_range = GST_VP9_CR_LIMITED; - frame_hdr->subsampling_y = frame_hdr->subsampling_x = 1; - frame_hdr->bit_depth = GST_VP9_BIT_DEPTH_8; - } - } - - frame_hdr->refresh_frame_context = - frame_hdr->error_resilient_mode ? 0 : gst_vp9_read_bit (br); - frame_hdr->frame_parallel_decoding_mode = - frame_hdr->error_resilient_mode ? 1 : gst_vp9_read_bit (br); - frame_hdr->frame_context_idx = - gst_vp9_read_bits (br, GST_FRAME_CONTEXTS_LOG2); - - /* loopfilter header */ - parse_loopfilter (&frame_hdr->loopfilter, br); - - /* quantization header */ - parse_quantization (&frame_hdr->quant_indices, br); - /* set lossless_flag */ - frame_hdr->lossless_flag = frame_hdr->quant_indices.y_ac_qi == 0 && - frame_hdr->quant_indices.y_dc_delta == 0 && - frame_hdr->quant_indices.uv_dc_delta == 0 && frame_hdr->quant_indices.uv_ac_delta == 0; - - /* segmentation header */ - parse_segmentation (&frame_hdr->segmentation, br); - - /* tile header */ - if (!parse_tile_info (frame_hdr, br)) { - GST_ERROR ("Failed to parse tile info...!"); - goto error; - } - - /* size of the rest of the header */ - frame_hdr->first_partition_size = gst_vp9_read_bits (br, 16); - if (!frame_hdr->first_partition_size) { - GST_ERROR ("Failed to parse the first partition size...!"); - goto error; - } - - frame_hdr->frame_header_length_in_bytes = - (gst_bit_reader_get_pos (br) + 7) / 8; - - return gst_vp9_parser_update (parser, frame_hdr); - -error: - return GST_VP9_PARSER_ERROR; -} diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstvp9parser.h gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstvp9parser.h --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/gstvp9parser.h 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/gstvp9parser.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,464 +0,0 @@ -/* - * gstvp9parser.h - * - * Copyright (C) 2013-2014 Intel Corporation - * Copyright (C) 2015 Intel Corporation - * Author: XuGuangxin - * Author: Sreerenj Balachandran - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef GST_VP9_PARSER_H -#define GST_VP9_PARSER_H - -#ifndef GST_USE_UNSTABLE_API -#warning "The VP9 parsing library is unstable API and may change in future." -#warning "You can define GST_USE_UNSTABLE_API to avoid this warning." -#endif - -#include - -G_BEGIN_DECLS - -#define GST_VP9_FRAME_MARKER 0x02 -#define GST_VP9_SYNC_CODE 0x498342 - -#define GST_VP9_MAX_LOOP_FILTER 63 -#define GST_VP9_MAX_PROB 255 - -#define GST_VP9_REFS_PER_FRAME 3 -#define GST_VP9_REF_FRAMES_LOG2 3 -#define GST_VP9_REF_FRAMES (1 << GST_VP9_REF_FRAMES_LOG2) - -#define GST_FRAME_CONTEXTS_LOG2 2 - -#define GST_VP9_MAX_LOOP_FILTER 63 -#define GST_VP9_MAX_SHARPNESS 7 - -#define GST_VP9_MAX_REF_LF_DELTAS 4 -#define GST_VP9_MAX_MODE_LF_DELTAS 2 - -#define GST_VP9_SEGMENT_DELTADATA 0 -#define GST_VP9_SEGMENT_ABSDATA 1 - -#define GST_VP9_MAX_SEGMENTS 8 -#define GST_VP9_SEG_TREE_PROBS (GST_VP9_MAX_SEGMENTS-1) - -#define GST_VP9_PREDICTION_PROBS 3 - -typedef struct _GstVp9Parser GstVp9Parser; -typedef struct _GstVp9FrameHdr GstVp9FrameHdr; -typedef struct _GstVp9LoopFilter GstVp9LoopFilter; -typedef struct _GstVp9QuantIndices GstVp9QuantIndices; -typedef struct _GstVp9Segmentation GstVp9Segmentation; -typedef struct _GstVp9SegmentationInfo GstVp9SegmentationInfo; -typedef struct _GstVp9SegmentationInfoData GstVp9SegmentationInfoData; - -/** - * GstVp9ParseResult: - * @GST_VP9_PARSER_OK: The parsing went well - * @GST_VP9_PARSER_BROKEN_DATA: The data to parse is broken - * @GST_VP9_PARSER_NO_PACKET_ERROR: An error accured durint the parsing - * - * Result type of any parsing function. - */ -typedef enum -{ - GST_VP9_PARSER_OK, - GST_VP9_PARSER_BROKEN_DATA, - GST_VP9_PARSER_ERROR, -} GstVp9ParserResult; - -/** - * GstVp9Profile: Bitstream profiles indicated by 2-3 bits in the uncompressed header - * @GST_VP9_PROFILE_0: Profile 0, 8-bit 4:2:0 only. - * @GST_VP9_PROFILE_1: Profile 1, 8-bit 4:4:4, 4:2:2, and 4:4:0. - * @GST_VP9_PROFILE_2: Profile 2, 10-bit and 12-bit color only, with 4:2:0 sampling. - * @GST_VP9_PROFILE_3: Profile 3, 10-bit and 12-bit color only, with 4:2:2/4:4:4/4:4:0 sampling. - * @GST_VP9_PROFILE_UNDEFINED: Undefined profile - * - * VP9 Profiles - */ -typedef enum { - GST_VP9_PROFILE_0, - GST_VP9_PROFILE_1, - GST_VP9_PROFILE_2, - GST_VP9_PROFILE_3, - GST_VP9_PROFILE_UNDEFINED -} GstVP9Profile; - -/** - * GstVp9FrameType: - * @GST_VP9_KEY_FRAME: Key frame, only have intra blocks - * @GST_VP9_INTER_FRAME: Inter frame, both intra and inter blocks - * - * VP9 frame types - */ -typedef enum { - GST_VP9_KEY_FRAME = 0, - GST_VP9_INTER_FRAME = 1 -} GstVp9FrameType; - -/** - * GstVp9BitDepth: - * @GST_VP9_BIT_DEPTH_8: Bit depth is 8 - * @GST_VP9_BIT_DEPTH_10 Bit depth is 10 - * @GST_VP9_BIT_DEPTH_12:Bit depth is 12 - * - * Bit depths of encoded frames - */ -typedef enum { - GST_VP9_BIT_DEPTH_8 = 8, - GST_VP9_BIT_DEPTH_10 = 10, - GST_VP9_BIT_DEPTH_12 = 12 -} GstVp9BitDepth; - -/** - * GstVp9ColorSpace: - * @GST_VP9_CS_UNKNOWN: Unknown color space - * @GST_VP9_CS_BT_601: BT.601 - * @GST_VP9_CS_BT_709: BT.709 - * @GST_VP9_CS_SMPTE_170: SMPTE.170 - * @GST_VP9_CS_SMPTE_240: SMPTE.240 - * @GST_VP9_CS_BT_2020: BT.2020 - * @GST_VP9_CS_RESERVED: Reserved - * @GST_VP9_CS_SRGB: sRGB - * - * Supported ColorSpace standards - */ -typedef enum { - GST_VP9_CS_UNKNOWN = 0, - GST_VP9_CS_BT_601 = 1, - GST_VP9_CS_BT_709 = 2, - GST_VP9_CS_SMPTE_170 = 3, - GST_VP9_CS_SMPTE_240 = 4, - GST_VP9_CS_BT_2020 = 5, - GST_VP9_CS_RESERVED_2 = 6, - GST_VP9_CS_SRGB = 7 -} GstVp9ColorSpace; - -/** - * GstVp9ColorRange: - * @GST_VP9_CR_LIMITED: Y range is [16-235], UV range is [16-240] - * @GST_VP9_CR_FULL: Full range for Y,U and V [0-255] - * - * Possible color value ranges - */ -typedef enum { - GST_VP9_CR_LIMITED, - GST_VP9_CR_FULL -} GstVp9ColorRange; - -/** - * GstVp9InterpFilter: - * @GST_VP9_INTERP_FILTER_EIGHTTAP: EightTap interpolation filter - * @GST_VP9_INTERP_FILTER_EIGHTTAP_SMOOTH: Smooth interpolation filter - * @GST_VP9_INTERP_FILTER_EIGHTTAP_SHARP: Shart interpolation filter - * @GST_VP9_INTERP_FILTER_BILINEAR: Bilinear interpolation filter - * @GST_VP9_INTERP_FILTER_SWITCHABLE: Selectable interpolation filter - * - * Interpolation Filters Types - */ -typedef enum { - GST_VP9_INTERP_FILTER_EIGHTTAP = 0, - GST_VP9_INTERP_FILTER_EIGHTTAP_SMOOTH = 1, - GST_VP9_INTERP_FILTER_EIGHTTAP_SHARP = 2, - GST_VP9_INTERP_FILTER_BILINEAR = 3, - GST_VP9_INTERP_FILTER_SWITCHABLE = 4 -} GstVp9InterpFilter; - -/** - * GstVp9RefFrameType: - * @GST_VP9_REF_FRAME_INTRA: Intra reference frame - * @GST_VP9_REF_FRAME_LAST: Last Reference frame - * @GST_VP9_REF_FRAME_GOLDEN: Golden Reference frame - * @GST_VP9_REF_FRAME_ALTREF: Alternate Reference frame - * @GST_VP9_REF_FRAME_MAX: - * - * Reference Frame types - */ -typedef enum { - GST_VP9_REF_FRAME_INTRA = 0, - GST_VP9_REF_FRAME_LAST = 1, - GST_VP9_REF_FRAME_GOLDEN = 2, - GST_VP9_REF_FRAME_ALTREF = 3, - GST_VP9_REF_FRAME_MAX = 4 -} GstVp9RefFrameType; - -/** - * GstVp9QuantIndices: - * @y_ac_qi: indicates the dequantization table index used for the - * luma AC coefficients - * @y_dc_delta: indicates the delta value that is added to the - * baseline index to obtain the luma DC coefficient dequantization - * index - * @uv_dc_delta: indicates the delta value that is added to the - * baseline index to obtain the chroma DC coefficient dequantization - * index - * @uv_ac_delta: indicates the delta value that is added to the - * baseline index to obtain the chroma AC coefficient dequantization - * index - * - * Dequantization indices. - */ -struct _GstVp9QuantIndices -{ - guint8 y_ac_qi; - gint8 y_dc_delta; - gint8 uv_dc_delta; - gint8 uv_ac_delta; -}; - -/** - * GstVp9MbLoofFilter: - * @filter_level: indicates loop filter level for the current frame - * @sharpness_level: indicates sharpness level for thecurrent frame - * @mode_ref_delta_enabled: indicate if filter adjust is on - * @mode_ref_delta_update: indicates if the delta values used in an - * adjustment are updated in the current frame - * @update_ref_deltas: indicate which ref deltas are updated - * @ref_deltas: Loop filter strength adjustments based on - * frame type (intra, inter) - * @update_mode_deltas: indicate with mode deltas are updated - * @mode_deltas: Loop filter strength adjustments based on - * mode (zero, new mv) - * - * Loop filter values - */ -struct _GstVp9LoopFilter { - gint filter_level; - gint sharpness_level; - - guint8 mode_ref_delta_enabled; - guint8 mode_ref_delta_update; - guint8 update_ref_deltas[GST_VP9_MAX_REF_LF_DELTAS]; - gint8 ref_deltas[GST_VP9_MAX_REF_LF_DELTAS]; - guint8 update_mode_deltas[GST_VP9_MAX_MODE_LF_DELTAS]; - gint8 mode_deltas[GST_VP9_MAX_MODE_LF_DELTAS]; -}; - -/** -* GstVp9SegmentationInfoData: -* @alternate_quantizer_enabled: indicate alternate quantizer enabled at segment level -* @alternate_quantizer: alternate quantizer value -* @alternate_loop_filter_enabled: indicate alternate loop filter enabled at segment level -* @alternate_loop_filter: alternate loop filter -* @reference_frame_enabled: indicate alternate reference frame at segment level -* @reference_frame: alternate reference frame -* @reference_skip: a block skip mode that implies both the use of a (0,0) -* motion vector and that no residual will be coded. -* -* Segemtnation info for each segment -* -*/ -struct _GstVp9SegmentationInfoData { - /* SEG_LVL_ALT_Q */ - guint8 alternate_quantizer_enabled; - gint16 alternate_quantizer; - - /* SEG_LVL_ALT_LF */ - guint8 alternate_loop_filter_enabled; - gint8 alternate_loop_filter; - - /* SEG_LVL_REF_FRAME */ - guint8 reference_frame_enabled; - gint reference_frame; - - guint8 reference_skip; -}; - -/** - * GstVp9SegmentationInfo: - * @enabled: enables the segmentation feature for the current frame - * @update_map: determines if segmentation is updated in the current frame - * @update_tree_probs: determines if tree probabilities updated or not - * @tree_probs: segment tree probabilities - * @update_pred_probs:determines if prediction probabilities updated or not - * @pred_probs: prediction probabilities - * @abs_delta: interpretation of segment data values - * @temporal_update: type of map update - * @update_data: indicates if the segment feature data - * is updated in the current frame - * @data: segment feature data - * - * Segmentation info - */ -struct _GstVp9SegmentationInfo { - /* enable in setup_segmentation*/ - guint8 enabled; - /* update_map in setup_segmentation*/ - guint8 update_map; - /* tree_probs exist or not*/ - guint8 update_tree_probs[GST_VP9_SEG_TREE_PROBS]; - guint8 tree_probs[GST_VP9_SEG_TREE_PROBS]; - /* pred_probs exist or not*/ - guint8 update_pred_probs[GST_VP9_PREDICTION_PROBS]; - guint8 pred_probs[GST_VP9_PREDICTION_PROBS]; - - /* abs_delta in setup_segmentation */ - guint8 abs_delta; - /* temporal_update in setup_segmentation */ - guint8 temporal_update; - - /* update_data in setup_segmentation*/ - guint8 update_data; - GstVp9SegmentationInfoData data[GST_VP9_MAX_SEGMENTS]; -}; - -/** - * GstVp9FrameHdr: - * @profile: encoded profile - * @show_existing_frame: display already decoded frame instead of doing the decoding - * @frame_to_show: which frame to show if show_existing_frame is true - * @frame_type: frame type - * @show_frame: indicate whether is it displayable frame or not - * @error_resilient_mode: error resilent mode - * @subsampling_x: horizontal subsampling - * @subsampling_y: vertical subsampling - * @width: frame width - * @height: frame height - * @display_size_enabled: display size enabled (cropping) - * @display_width: display width - * @display_height: display height - * @frame_context_idx: frame context index - * @bit_depth: bit depth of the stream - * @color_space: color space standard - * @color_range: color range standard - * @intra_only: intra only frame - * @reset_frame_context: reset frame context - * @refresh_frame_flags: refresh reference frame flags - * @ref_frame_indices: reference frame index - * @ref_frame_sign_bias: sign bias for selecting altref,last and golden frames - * @allow_high_precision_mv: allow hight precision motion vector - * @mcomp_filter_type: interpolation filter type - * @refresh_frame_context: refresh frame context indicator - * @frame_parallel_decoding_mode: enable or disable parallel decoding support. - * @loopfilter: loopfilter values - * @quant_indices: quantization indeces - * @segmentation: segmentation info - * @log2_tile_rows: tile row indicator - * @log2_tile_columns: tile column indicator - * @first_partition_size: first partition size (after the uncompressed header) - * @lossless_flag: lossless mode decode - * @frame_header_length_in_bytes: length of uncompressed header - * - * Frame header - */ -struct _GstVp9FrameHdr -{ - guint profile; - guint8 show_existing_frame; - gint frame_to_show; - guint frame_type; - guint8 show_frame; - guint8 error_resilient_mode; - gint subsampling_x; - gint subsampling_y; - guint32 width; - guint32 height; - guint8 display_size_enabled; - guint32 display_width; - guint32 display_height; - guint frame_context_idx; - - guint bit_depth; - guint color_space; - guint color_range; - - guint8 intra_only; - gint reset_frame_context; - gint refresh_frame_flags; - - gint ref_frame_indices[GST_VP9_REFS_PER_FRAME]; - gint ref_frame_sign_bias[GST_VP9_REFS_PER_FRAME]; - gint allow_high_precision_mv; - guint8 mcomp_filter_type; - - gint refresh_frame_context; - /* frame_parallel_decoding_mode in vp9 code*/ - gint frame_parallel_decoding_mode; - - GstVp9LoopFilter loopfilter; - GstVp9QuantIndices quant_indices; - GstVp9SegmentationInfo segmentation; - - gint log2_tile_rows; - gint log2_tile_columns; - - guint32 first_partition_size; - - /* calculated values */ - guint lossless_flag; - guint32 frame_header_length_in_bytes; -}; - -/** - * GstVp9Segmentation: - * @filter_level: loop filter level - * @luma_ac_quant_scale: AC quant scale for luma(Y) component - * @luma_dc_quant_scale: DC quant scale for luma(Y) component - * @chroma_ac_quant_scale AC quant scale for chroma(U/V) component - * @chroma_dc_quant_scale: DC quant scale for chroma (U/V) component - * @reference_frame_enabled: alternate reference frame enablement - * @reference_frame: alternate reference frame - * @reference_skip: a block skip mode that implies both the use of a (0,0) - * motion vector and that no residual will be coded - * - * Segmentation info kept across multipe frames - */ -struct _GstVp9Segmentation -{ - guint8 filter_level[4][2]; - gint16 luma_ac_quant_scale; - gint16 luma_dc_quant_scale; - gint16 chroma_ac_quant_scale; - gint16 chroma_dc_quant_scale; - - guint8 reference_frame_enabled; - gint reference_frame; - - guint8 reference_skip; -}; - -/** - * GstVp9Parser: - * @priv: GstVp9ParserPrivate struct to keep track of state variables - * @mb_segment_tree_probs: decoding tree probabilities - * @segment_pred_probs: segement prediction probabiilties - * @segmentation: Segemenation info - * - * Parser context that needs to be live across frames - */ -struct _GstVp9Parser -{ - /* private stuct for tracking state variables across frames */ - void *priv; - - guint8 mb_segment_tree_probs[GST_VP9_SEG_TREE_PROBS]; - guint8 segment_pred_probs[GST_VP9_PREDICTION_PROBS]; - GstVp9Segmentation segmentation[GST_VP9_MAX_SEGMENTS]; -}; - -GstVp9Parser * gst_vp9_parser_new (void); - -GstVp9ParserResult gst_vp9_parser_parse_frame_header (GstVp9Parser* parser, GstVp9FrameHdr * frame_hdr, const guint8 * data, gsize size); - -void gst_vp9_parser_free (GstVp9Parser * parser); - -G_END_DECLS - -#endif /* GST_VP9_PARSER_H */ diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/nalutils.c gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/nalutils.c --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/nalutils.c 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/nalutils.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,309 +0,0 @@ -/* Gstreamer - * Copyright (C) <2011> Intel Corporation - * Copyright (C) <2011> Collabora Ltd. - * Copyright (C) <2011> Thibault Saunier - * - * Some bits C-c,C-v'ed and s/4/3 from h264parse and videoparsers/h264parse.c: - * Copyright (C) <2010> Mark Nauwelaerts - * Copyright (C) <2010> Collabora Multimedia - * Copyright (C) <2010> Nokia Corporation - * - * (C) 2005 Michal Benes - * (C) 2008 Wim Taymans - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -/** - * Common code for NAL parsing from h264 and h265 parsers. - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "nalutils.h" - -/* Compute Ceil(Log2(v)) */ -/* Derived from branchless code for integer log2(v) from: - */ -guint -ceil_log2 (guint32 v) -{ - guint r, shift; - - v--; - r = (v > 0xFFFF) << 4; - v >>= r; - shift = (v > 0xFF) << 3; - v >>= shift; - r |= shift; - shift = (v > 0xF) << 2; - v >>= shift; - r |= shift; - shift = (v > 0x3) << 1; - v >>= shift; - r |= shift; - r |= (v >> 1); - return r + 1; -} - -/****** Nal parser ******/ - -void -nal_reader_init (NalReader * nr, const guint8 * data, guint size) -{ - nr->data = data; - nr->size = size; - nr->n_epb = 0; - - nr->byte = 0; - nr->bits_in_cache = 0; - /* fill with something other than 0 to detect emulation prevention bytes */ - nr->first_byte = 0xff; - nr->cache = 0xff; -} - -inline gboolean -nal_reader_read (NalReader * nr, guint nbits) -{ - if (G_UNLIKELY (nr->byte * 8 + (nbits - nr->bits_in_cache) > nr->size * 8)) { - GST_DEBUG ("Can not read %u bits, bits in cache %u, Byte * 8 %u, size in " - "bits %u", nbits, nr->bits_in_cache, nr->byte * 8, nr->size * 8); - return FALSE; - } - - while (nr->bits_in_cache < nbits) { - guint8 byte; - gboolean check_three_byte; - - check_three_byte = TRUE; - next_byte: - if (G_UNLIKELY (nr->byte >= nr->size)) - return FALSE; - - byte = nr->data[nr->byte++]; - - /* check if the byte is a emulation_prevention_three_byte */ - if (check_three_byte && byte == 0x03 && nr->first_byte == 0x00 && - ((nr->cache & 0xff) == 0)) { - /* next byte goes unconditionally to the cache, even if it's 0x03 */ - check_three_byte = FALSE; - nr->n_epb++; - goto next_byte; - } - nr->cache = (nr->cache << 8) | nr->first_byte; - nr->first_byte = byte; - nr->bits_in_cache += 8; - } - - return TRUE; -} - -/* Skips the specified amount of bits. This is only suitable to a - cacheable number of bits */ -inline gboolean -nal_reader_skip (NalReader * nr, guint nbits) -{ - g_assert (nbits <= 8 * sizeof (nr->cache)); - - if (G_UNLIKELY (!nal_reader_read (nr, nbits))) - return FALSE; - - nr->bits_in_cache -= nbits; - - return TRUE; -} - -/* Generic version to skip any number of bits */ -gboolean -nal_reader_skip_long (NalReader * nr, guint nbits) -{ - /* Leave out enough bits in the cache once we are finished */ - const guint skip_size = 4 * sizeof (nr->cache); - guint remaining = nbits; - - nbits %= skip_size; - while (remaining > 0) { - if (!nal_reader_skip (nr, nbits)) - return FALSE; - remaining -= nbits; - nbits = skip_size; - } - return TRUE; -} - -inline guint -nal_reader_get_pos (const NalReader * nr) -{ - return nr->byte * 8 - nr->bits_in_cache; -} - -inline guint -nal_reader_get_remaining (const NalReader * nr) -{ - return (nr->size - nr->byte) * 8 + nr->bits_in_cache; -} - -inline guint -nal_reader_get_epb_count (const NalReader * nr) -{ - return nr->n_epb; -} - -#define NAL_READER_READ_BITS(bits) \ -gboolean \ -nal_reader_get_bits_uint##bits (NalReader *nr, guint##bits *val, guint nbits) \ -{ \ - guint shift; \ - \ - if (!nal_reader_read (nr, nbits)) \ - return FALSE; \ - \ - /* bring the required bits down and truncate */ \ - shift = nr->bits_in_cache - nbits; \ - *val = nr->first_byte >> shift; \ - \ - *val |= nr->cache << (8 - shift); \ - /* mask out required bits */ \ - if (nbits < bits) \ - *val &= ((guint##bits)1 << nbits) - 1; \ - \ - nr->bits_in_cache = shift; \ - \ - return TRUE; \ -} \ - -NAL_READER_READ_BITS (8); -NAL_READER_READ_BITS (16); -NAL_READER_READ_BITS (32); - -#define NAL_READER_PEEK_BITS(bits) \ -gboolean \ -nal_reader_peek_bits_uint##bits (const NalReader *nr, guint##bits *val, guint nbits) \ -{ \ - NalReader tmp; \ - \ - tmp = *nr; \ - return nal_reader_get_bits_uint##bits (&tmp, val, nbits); \ -} - -NAL_READER_PEEK_BITS (8); - -gboolean -nal_reader_get_ue (NalReader * nr, guint32 * val) -{ - guint i = 0; - guint8 bit; - guint32 value; - - if (G_UNLIKELY (!nal_reader_get_bits_uint8 (nr, &bit, 1))) - return FALSE; - - while (bit == 0) { - i++; - if (G_UNLIKELY (!nal_reader_get_bits_uint8 (nr, &bit, 1))) - return FALSE; - } - - if (G_UNLIKELY (i > 32)) - return FALSE; - - if (G_UNLIKELY (!nal_reader_get_bits_uint32 (nr, &value, i))) - return FALSE; - - *val = (1 << i) - 1 + value; - - return TRUE; -} - -inline gboolean -nal_reader_get_se (NalReader * nr, gint32 * val) -{ - guint32 value; - - if (G_UNLIKELY (!nal_reader_get_ue (nr, &value))) - return FALSE; - - if (value % 2) - *val = (value / 2) + 1; - else - *val = -(value / 2); - - return TRUE; -} - -gboolean -nal_reader_is_byte_aligned (NalReader * nr) -{ - if (nr->bits_in_cache != 0) - return FALSE; - return TRUE; -} - -gboolean -nal_reader_has_more_data (NalReader * nr) -{ - NalReader nr_tmp; - guint remaining, nbits; - guint8 rbsp_stop_one_bit, zero_bits; - - remaining = nal_reader_get_remaining (nr); - if (remaining == 0) - return FALSE; - - nr_tmp = *nr; - nr = &nr_tmp; - - /* The spec defines that more_rbsp_data() searches for the last bit - equal to 1, and that it is the rbsp_stop_one_bit. Subsequent bits - until byte boundary is reached shall be zero. - - This means that more_rbsp_data() is FALSE if the next bit is 1 - and the remaining bits until byte boundary are zero. One way to - be sure that this bit was the very last one, is that every other - bit after we reached byte boundary are also set to zero. - Otherwise, if the next bit is 0 or if there are non-zero bits - afterwards, then then we have more_rbsp_data() */ - if (!nal_reader_get_bits_uint8 (nr, &rbsp_stop_one_bit, 1)) - return FALSE; - if (!rbsp_stop_one_bit) - return TRUE; - - nbits = --remaining % 8; - while (remaining > 0) { - if (!nal_reader_get_bits_uint8 (nr, &zero_bits, nbits)) - return FALSE; - if (zero_bits != 0) - return TRUE; - remaining -= nbits; - nbits = 8; - } - return FALSE; -} - -/*********** end of nal parser ***************/ - -inline gint -scan_for_start_codes (const guint8 * data, guint size) -{ - GstByteReader br; - gst_byte_reader_init (&br, data, size); - - /* NALU not empty, so we can at least expect 1 (even 2) bytes following sc */ - return gst_byte_reader_masked_scan_uint32 (&br, 0xffffff00, 0x00000100, - 0, size); -} diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/nalutils.h gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/nalutils.h --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/nalutils.h 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/nalutils.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,162 +0,0 @@ -/* Gstreamer - * Copyright (C) <2011> Intel Corporation - * Copyright (C) <2011> Collabora Ltd. - * Copyright (C) <2011> Thibault Saunier - * - * Some bits C-c,C-v'ed and s/4/3 from h264parse and videoparsers/h264parse.c: - * Copyright (C) <2010> Mark Nauwelaerts - * Copyright (C) <2010> Collabora Multimedia - * Copyright (C) <2010> Nokia Corporation - * - * (C) 2005 Michal Benes - * (C) 2008 Wim Taymans - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -/** - * Common code for NAL parsing from h264 and h265 parsers. - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include -#include - -guint ceil_log2 (guint32 v); - -typedef struct -{ - const guint8 *data; - guint size; - - guint n_epb; /* Number of emulation prevention bytes */ - guint byte; /* Byte position */ - guint bits_in_cache; /* bitpos in the cache of next bit */ - guint8 first_byte; - guint64 cache; /* cached bytes */ -} NalReader; - -void nal_reader_init (NalReader * nr, const guint8 * data, guint size); - -gboolean nal_reader_read (NalReader * nr, guint nbits); -gboolean nal_reader_skip (NalReader * nr, guint nbits); -gboolean nal_reader_skip_long (NalReader * nr, guint nbits); -guint nal_reader_get_pos (const NalReader * nr); -guint nal_reader_get_remaining (const NalReader * nr); -guint nal_reader_get_epb_count (const NalReader * nr); - -gboolean nal_reader_is_byte_aligned (NalReader * nr); -gboolean nal_reader_has_more_data (NalReader * nr); - -#define NAL_READER_READ_BITS_H(bits) \ -gboolean nal_reader_get_bits_uint##bits (NalReader *nr, guint##bits *val, guint nbits) - -NAL_READER_READ_BITS_H (8); -NAL_READER_READ_BITS_H (16); -NAL_READER_READ_BITS_H (32); - -#define NAL_READER_PEEK_BITS_H(bits) \ -gboolean nal_reader_peek_bits_uint##bits (const NalReader *nr, guint##bits *val, guint nbits) - -NAL_READER_PEEK_BITS_H (8); - -gboolean nal_reader_get_ue (NalReader * nr, guint32 * val); -gboolean nal_reader_get_se (NalReader * nr, gint32 * val); - -#define CHECK_ALLOWED_MAX(val, max) { \ - if (val > max) { \ - GST_WARNING ("value greater than max. value: %d, max %d", \ - val, max); \ - goto error; \ - } \ -} - -#define CHECK_ALLOWED(val, min, max) { \ - if (val < min || val > max) { \ - GST_WARNING ("value not in allowed range. value: %d, range %d-%d", \ - val, min, max); \ - goto error; \ - } \ -} - -#define READ_UINT8(nr, val, nbits) { \ - if (!nal_reader_get_bits_uint8 (nr, &val, nbits)) { \ - GST_WARNING ("failed to read uint8, nbits: %d", nbits); \ - goto error; \ - } \ -} - -#define READ_UINT16(nr, val, nbits) { \ - if (!nal_reader_get_bits_uint16 (nr, &val, nbits)) { \ - GST_WARNING ("failed to read uint16, nbits: %d", nbits); \ - goto error; \ - } \ -} - -#define READ_UINT32(nr, val, nbits) { \ - if (!nal_reader_get_bits_uint32 (nr, &val, nbits)) { \ - GST_WARNING ("failed to read uint32, nbits: %d", nbits); \ - goto error; \ - } \ -} - -#define READ_UINT64(nr, val, nbits) { \ - if (!nal_reader_get_bits_uint64 (nr, &val, nbits)) { \ - GST_WARNING ("failed to read uint32, nbits: %d", nbits); \ - goto error; \ - } \ -} - -#define READ_UE(nr, val) { \ - if (!nal_reader_get_ue (nr, &val)) { \ - GST_WARNING ("failed to read UE"); \ - goto error; \ - } \ -} - -#define READ_UE_ALLOWED(nr, val, min, max) { \ - guint32 tmp; \ - READ_UE (nr, tmp); \ - CHECK_ALLOWED (tmp, min, max); \ - val = tmp; \ -} - -#define READ_UE_MAX(nr, val, max) { \ - guint32 tmp; \ - READ_UE (nr, tmp); \ - CHECK_ALLOWED_MAX (tmp, max); \ - val = tmp; \ -} - -#define READ_SE(nr, val) { \ - if (!nal_reader_get_se (nr, &val)) { \ - GST_WARNING ("failed to read SE"); \ - goto error; \ - } \ -} - -#define READ_SE_ALLOWED(nr, val, min, max) { \ - gint32 tmp; \ - READ_SE (nr, tmp); \ - CHECK_ALLOWED (tmp, min, max); \ - val = tmp; \ -} - -gint scan_for_start_codes (const guint8 * data, guint size); diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/parserutils.c gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/parserutils.c --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/parserutils.c 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/parserutils.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -/* Gstreamer - * Copyright (C) <2011> Intel Corporation - * Copyright (C) <2011> Collabora Ltd. - * Copyright (C) <2011> Thibault Saunier - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "parserutils.h" - -gboolean -decode_vlc (GstBitReader * br, guint * res, const VLCTable * table, - guint length) -{ - guint8 i; - guint cbits = 0; - guint32 value = 0; - - for (i = 0; i < length; i++) { - if (cbits != table[i].cbits) { - cbits = table[i].cbits; - if (!gst_bit_reader_peek_bits_uint32 (br, &value, cbits)) { - goto failed; - } - } - - if (value == table[i].cword) { - SKIP (br, cbits); - if (res) - *res = table[i].value; - - return TRUE; - } - } - - GST_DEBUG ("Did not find code"); - -failed: - { - GST_WARNING ("Could not decode VLC returning"); - - return FALSE; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/parserutils.h gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/parserutils.h --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/parserutils.h 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/parserutils.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,108 +0,0 @@ -/* Gstreamer - * Copyright (C) <2011> Intel - * Copyright (C) <2011> Collabora Ltd. - * Copyright (C) <2011> Thibault Saunier - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef __PARSER_UTILS__ -#define __PARSER_UTILS__ - -#include -#include - -/* Parsing utils */ -#define GET_BITS(b, num, bits) G_STMT_START { \ - if (!gst_bit_reader_get_bits_uint32(b, bits, num)) \ - goto failed; \ - GST_TRACE ("parsed %d bits: %d", num, *(bits)); \ -} G_STMT_END - -#define CHECK_ALLOWED(val, min, max) G_STMT_START { \ - if (val < min || val > max) { \ - GST_WARNING ("value not in allowed range. value: %d, range %d-%d", \ - val, min, max); \ - goto failed; \ - } \ -} G_STMT_END - -#define READ_UINT8(reader, val, nbits) G_STMT_START { \ - if (!gst_bit_reader_get_bits_uint8 (reader, &val, nbits)) { \ - GST_WARNING ("failed to read uint8, nbits: %d", nbits); \ - goto failed; \ - } \ -} G_STMT_END - -#define READ_UINT16(reader, val, nbits) G_STMT_START { \ - if (!gst_bit_reader_get_bits_uint16 (reader, &val, nbits)) { \ - GST_WARNING ("failed to read uint16, nbits: %d", nbits); \ - goto failed; \ - } \ -} G_STMT_END - -#define READ_UINT32(reader, val, nbits) G_STMT_START { \ - if (!gst_bit_reader_get_bits_uint32 (reader, &val, nbits)) { \ - GST_WARNING ("failed to read uint32, nbits: %d", nbits); \ - goto failed; \ - } \ -} G_STMT_END - -#define READ_UINT64(reader, val, nbits) G_STMT_START { \ - if (!gst_bit_reader_get_bits_uint64 (reader, &val, nbits)) { \ - GST_WARNING ("failed to read uint64, nbits: %d", nbits); \ - goto failed; \ - } \ -} G_STMT_END - - -#define U_READ_UINT8(reader, val, nbits) G_STMT_START { \ - val = gst_bit_reader_get_bits_uint8_unchecked (reader, nbits); \ -} G_STMT_END - -#define U_READ_UINT16(reader, val, nbits) G_STMT_START { \ - val = gst_bit_reader_get_bits_uint16_unchecked (reader, nbits); \ -} G_STMT_END - -#define U_READ_UINT32(reader, val, nbits) G_STMT_START { \ - val = gst_bit_reader_get_bits_uint32_unchecked (reader, nbits); \ -} G_STMT_END - -#define U_READ_UINT64(reader, val, nbits) G_STMT_START { \ - val = gst_bit_reader_get_bits_uint64_unchecked (reader, nbits); \ -} G_STMT_END - -#define SKIP(reader, nbits) G_STMT_START { \ - if (!gst_bit_reader_skip (reader, nbits)) { \ - GST_WARNING ("failed to skip nbits: %d", nbits); \ - goto failed; \ - } \ -} G_STMT_END - -typedef struct _VLCTable VLCTable; - -struct _VLCTable -{ - guint value; - guint cword; - guint cbits; -}; - -gboolean -decode_vlc (GstBitReader * br, guint * res, const VLCTable * table, - guint length); - -#endif /* __PARSER_UTILS__ */ diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/vp8utils.c gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/vp8utils.c --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/vp8utils.c 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/vp8utils.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,475 +0,0 @@ -/* - * vp8utils.c - VP8 pregenerated probability tables - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "vp8utils.h" - -/*---- entropy.c ----*/ -/* *INDENT-OFF* */ -const guint8 vp8_norm[256] = { - 0, 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 -}; -/* *INDENT-ON* */ - -/*---- entropymv.c ----*/ -/* *INDENT-OFF* */ -static const guint8 vp8_mv_update_probs[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 - } -}; -/* *INDENT-ON* */ - -/* *INDENT-OFF* */ -static const guint8 vp8_default_mv_probs[2][19] = { - { - /* row */ - 162, /* is short */ - 128, /* sign */ - 225, 146, 172, 147, 214, 39, 156, /* short tree */ - 128, 129, 132, 75, 145, 178, 206, 239, 254, 254 /* long bits */ - }, - { - /* same for column */ - 164, /* is short */ - 128, - 204, 170, 119, 235, 140, 230, 228, - 128, 130, 130, 74, 148, 180, 203, 236, 254, 254 /* long bits */ - } -}; -/* *INDENT-ON* */ - -/*---- vp8_entropymodedata.h ----*/ -static const guint8 vp8_nk_y_mode_probs[4] = { - 112, 86, 140, 37 -}; - -static const guint8 vp8_kf_y_mode_probs[4] = { - 145, 156, 163, 128 -}; - -static const guint8 vp8_nk_uv_mode_probs[3] = { - 162, 101, 204 -}; - -static const guint8 vp8_kf_uv_mode_probs[3] = { - 142, 114, 183 -}; - -/*--- coefupdateprobs.h ----*/ -/* *INDENT-OFF* */ -static const guint8 vp8_token_update_probs[4][8][3][11] = { - { - { - {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, }, - }, - }, -}; -/* *INDENT-ON* */ - -/*---- default_coef_probs.h ----*/ -/* *INDENT-OFF* */ -static const guint8 vp8_default_token_probs[4][8][3][11] = { - { /* Block Type ( 0 ) */ - { /* Coeff Band ( 0 )*/ - { 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 } - }, - { /* Coeff Band ( 1 )*/ - { 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 } - }, - { /* Coeff Band ( 2 )*/ - { 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 } - }, - { /* Coeff Band ( 3 )*/ - { 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 } - }, - { /* Coeff Band ( 4 )*/ - { 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 } - }, - { /* Coeff Band ( 5 )*/ - { 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 } - }, - { /* Coeff Band ( 6 )*/ - { 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 } - }, - { /* Coeff Band ( 7 )*/ - { 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 } - } - }, - { /* Block Type ( 1 ) */ - { /* Coeff Band ( 0 )*/ - { 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 } - }, - { /* Coeff Band ( 1 )*/ - { 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 } - }, - { /* Coeff Band ( 2 )*/ - { 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 } - }, - { /* Coeff Band ( 3 )*/ - { 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 } - }, - { /* Coeff Band ( 4 )*/ - { 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 } - }, - { /* Coeff Band ( 5 )*/ - { 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 } - }, - { /* Coeff Band ( 6 )*/ - { 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 } - }, - { /* Coeff Band ( 7 )*/ - { 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 } - } - }, - { /* Block Type ( 2 ) */ - { /* Coeff Band ( 0 )*/ - { 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 } - }, - { /* Coeff Band ( 1 )*/ - { 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 } - }, - { /* Coeff Band ( 2 )*/ - { 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 } - }, - { /* Coeff Band ( 3 )*/ - { 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 } - }, - { /* Coeff Band ( 4 )*/ - { 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 } - }, - { /* Coeff Band ( 5 )*/ - { 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 } - }, - { /* Coeff Band ( 6 )*/ - { 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 } - }, - { /* Coeff Band ( 7 )*/ - { 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 } - } - }, - { /* Block Type ( 3 ) */ - { /* Coeff Band ( 0 )*/ - { 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 } - }, - { /* Coeff Band ( 1 )*/ - { 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 } - }, - { /* Coeff Band ( 2 )*/ - { 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 } - }, - { /* Coeff Band ( 3 )*/ - { 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 } - }, - { /* Coeff Band ( 4 )*/ - { 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 } - }, - { /* Coeff Band ( 5 )*/ - { 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 } - }, - { /* Coeff Band ( 6 )*/ - { 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 } - }, - { /* Coeff Band ( 7 )*/ - { 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 } - } - } -}; -/* *INDENT-ON* */ - -void -gst_vp8_token_update_probs_init (GstVp8TokenProbs * probs) -{ - memcpy (probs->prob, vp8_token_update_probs, sizeof (vp8_token_update_probs)); -} - -void -gst_vp8_token_probs_init_defaults (GstVp8TokenProbs * probs) -{ - memcpy (probs->prob, vp8_default_token_probs, - sizeof (vp8_default_token_probs)); -} - -void -gst_vp8_mv_update_probs_init (GstVp8MvProbs * probs) -{ - memcpy (probs->prob, vp8_mv_update_probs, sizeof (vp8_mv_update_probs)); -} - -void -gst_vp8_mv_probs_init_defaults (GstVp8MvProbs * probs) -{ - memcpy (probs->prob, vp8_default_mv_probs, sizeof (vp8_default_mv_probs)); -} - -void -gst_vp8_mode_probs_init_defaults (GstVp8ModeProbs * probs, gboolean key_frame) -{ - if (key_frame) { - memcpy (probs->y_prob, vp8_kf_y_mode_probs, sizeof (vp8_kf_y_mode_probs)); - memcpy (probs->uv_prob, vp8_kf_uv_mode_probs, - sizeof (vp8_kf_uv_mode_probs)); - } else { - memcpy (probs->y_prob, vp8_nk_y_mode_probs, sizeof (vp8_nk_y_mode_probs)); - memcpy (probs->uv_prob, vp8_nk_uv_mode_probs, - sizeof (vp8_nk_uv_mode_probs)); - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/vp8utils.h gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/vp8utils.h --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/vp8utils.h 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/vp8utils.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -/* - * vp8utils.h - VP8 utilities (probability tables initialization) - * - * Copyright (C) 2013-2014 Intel Corporation - * Author: Gwenole Beauchesne - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef GST_VP8_UTILS_H -#define GST_VP8_UTILS_H - -#include - -void -gst_vp8_token_update_probs_init (GstVp8TokenProbs * probs); - -void -gst_vp8_token_probs_init_defaults (GstVp8TokenProbs * probs); - -void -gst_vp8_mv_update_probs_init (GstVp8MvProbs * probs); - -void -gst_vp8_mv_probs_init_defaults (GstVp8MvProbs * probs); - -void -gst_vp8_mode_probs_init_defaults (GstVp8ModeProbs * probs, gboolean key_frame); - -#endif /* GST_VP8_UTILS_H */ diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/vp9utils.c gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/vp9utils.c --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/vp9utils.c 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/vp9utils.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,263 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "vp9utils.h" - -static const int16_t dc_qlookup[QINDEX_RANGE] = { - 4, 8, 8, 9, 10, 11, 12, 12, - 13, 14, 15, 16, 17, 18, 19, 19, - 20, 21, 22, 23, 24, 25, 26, 26, - 27, 28, 29, 30, 31, 32, 32, 33, - 34, 35, 36, 37, 38, 38, 39, 40, - 41, 42, 43, 43, 44, 45, 46, 47, - 48, 48, 49, 50, 51, 52, 53, 53, - 54, 55, 56, 57, 57, 58, 59, 60, - 61, 62, 62, 63, 64, 65, 66, 66, - 67, 68, 69, 70, 70, 71, 72, 73, - 74, 74, 75, 76, 77, 78, 78, 79, - 80, 81, 81, 82, 83, 84, 85, 85, - 87, 88, 90, 92, 93, 95, 96, 98, - 99, 101, 102, 104, 105, 107, 108, 110, - 111, 113, 114, 116, 117, 118, 120, 121, - 123, 125, 127, 129, 131, 134, 136, 138, - 140, 142, 144, 146, 148, 150, 152, 154, - 156, 158, 161, 164, 166, 169, 172, 174, - 177, 180, 182, 185, 187, 190, 192, 195, - 199, 202, 205, 208, 211, 214, 217, 220, - 223, 226, 230, 233, 237, 240, 243, 247, - 250, 253, 257, 261, 265, 269, 272, 276, - 280, 284, 288, 292, 296, 300, 304, 309, - 313, 317, 322, 326, 330, 335, 340, 344, - 349, 354, 359, 364, 369, 374, 379, 384, - 389, 395, 400, 406, 411, 417, 423, 429, - 435, 441, 447, 454, 461, 467, 475, 482, - 489, 497, 505, 513, 522, 530, 539, 549, - 559, 569, 579, 590, 602, 614, 626, 640, - 654, 668, 684, 700, 717, 736, 755, 775, - 796, 819, 843, 869, 896, 925, 955, 988, - 1022, 1058, 1098, 1139, 1184, 1232, 1282, 1336, -}; - -static const int16_t dc_qlookup_10[QINDEX_RANGE] = { - 4, 9, 10, 13, 15, 17, 20, 22, - 25, 28, 31, 34, 37, 40, 43, 47, - 50, 53, 57, 60, 64, 68, 71, 75, - 78, 82, 86, 90, 93, 97, 101, 105, - 109, 113, 116, 120, 124, 128, 132, 136, - 140, 143, 147, 151, 155, 159, 163, 166, - 170, 174, 178, 182, 185, 189, 193, 197, - 200, 204, 208, 212, 215, 219, 223, 226, - 230, 233, 237, 241, 244, 248, 251, 255, - 259, 262, 266, 269, 273, 276, 280, 283, - 287, 290, 293, 297, 300, 304, 307, 310, - 314, 317, 321, 324, 327, 331, 334, 337, - 343, 350, 356, 362, 369, 375, 381, 387, - 394, 400, 406, 412, 418, 424, 430, 436, - 442, 448, 454, 460, 466, 472, 478, 484, - 490, 499, 507, 516, 525, 533, 542, 550, - 559, 567, 576, 584, 592, 601, 609, 617, - 625, 634, 644, 655, 666, 676, 687, 698, - 708, 718, 729, 739, 749, 759, 770, 782, - 795, 807, 819, 831, 844, 856, 868, 880, - 891, 906, 920, 933, 947, 961, 975, 988, - 1001, 1015, 1030, 1045, 1061, 1076, 1090, 1105, - 1120, 1137, 1153, 1170, 1186, 1202, 1218, 1236, - 1253, 1271, 1288, 1306, 1323, 1342, 1361, 1379, - 1398, 1416, 1436, 1456, 1476, 1496, 1516, 1537, - 1559, 1580, 1601, 1624, 1647, 1670, 1692, 1717, - 1741, 1766, 1791, 1817, 1844, 1871, 1900, 1929, - 1958, 1990, 2021, 2054, 2088, 2123, 2159, 2197, - 2236, 2276, 2319, 2363, 2410, 2458, 2508, 2561, - 2616, 2675, 2737, 2802, 2871, 2944, 3020, 3102, - 3188, 3280, 3375, 3478, 3586, 3702, 3823, 3953, - 4089, 4236, 4394, 4559, 4737, 4929, 5130, 5347, -}; - -static const int16_t dc_qlookup_12[QINDEX_RANGE] = { - 4, 12, 18, 25, 33, 41, 50, 60, - 70, 80, 91, 103, 115, 127, 140, 153, - 166, 180, 194, 208, 222, 237, 251, 266, - 281, 296, 312, 327, 343, 358, 374, 390, - 405, 421, 437, 453, 469, 484, 500, 516, - 532, 548, 564, 580, 596, 611, 627, 643, - 659, 674, 690, 706, 721, 737, 752, 768, - 783, 798, 814, 829, 844, 859, 874, 889, - 904, 919, 934, 949, 964, 978, 993, 1008, - 1022, 1037, 1051, 1065, 1080, 1094, 1108, 1122, - 1136, 1151, 1165, 1179, 1192, 1206, 1220, 1234, - 1248, 1261, 1275, 1288, 1302, 1315, 1329, 1342, - 1368, 1393, 1419, 1444, 1469, 1494, 1519, 1544, - 1569, 1594, 1618, 1643, 1668, 1692, 1717, 1741, - 1765, 1789, 1814, 1838, 1862, 1885, 1909, 1933, - 1957, 1992, 2027, 2061, 2096, 2130, 2165, 2199, - 2233, 2267, 2300, 2334, 2367, 2400, 2434, 2467, - 2499, 2532, 2575, 2618, 2661, 2704, 2746, 2788, - 2830, 2872, 2913, 2954, 2995, 3036, 3076, 3127, - 3177, 3226, 3275, 3324, 3373, 3421, 3469, 3517, - 3565, 3621, 3677, 3733, 3788, 3843, 3897, 3951, - 4005, 4058, 4119, 4181, 4241, 4301, 4361, 4420, - 4479, 4546, 4612, 4677, 4742, 4807, 4871, 4942, - 5013, 5083, 5153, 5222, 5291, 5367, 5442, 5517, - 5591, 5665, 5745, 5825, 5905, 5984, 6063, 6149, - 6234, 6319, 6404, 6495, 6587, 6678, 6769, 6867, - 6966, 7064, 7163, 7269, 7376, 7483, 7599, 7715, - 7832, 7958, 8085, 8214, 8352, 8492, 8635, 8788, - 8945, 9104, 9275, 9450, 9639, 9832, 10031, 10245, - 10465, 10702, 10946, 11210, 11482, 11776, 12081, 12409, - 12750, 13118, 13501, 13913, 14343, 14807, 15290, 15812, - 16356, 16943, 17575, 18237, 18949, 19718, 20521, 21387, -}; - -static const int16_t ac_qlookup[QINDEX_RANGE] = { - 4, 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, - 104, 106, 108, 110, 112, 114, 116, 118, - 120, 122, 124, 126, 128, 130, 132, 134, - 136, 138, 140, 142, 144, 146, 148, 150, - 152, 155, 158, 161, 164, 167, 170, 173, - 176, 179, 182, 185, 188, 191, 194, 197, - 200, 203, 207, 211, 215, 219, 223, 227, - 231, 235, 239, 243, 247, 251, 255, 260, - 265, 270, 275, 280, 285, 290, 295, 300, - 305, 311, 317, 323, 329, 335, 341, 347, - 353, 359, 366, 373, 380, 387, 394, 401, - 408, 416, 424, 432, 440, 448, 456, 465, - 474, 483, 492, 501, 510, 520, 530, 540, - 550, 560, 571, 582, 593, 604, 615, 627, - 639, 651, 663, 676, 689, 702, 715, 729, - 743, 757, 771, 786, 801, 816, 832, 848, - 864, 881, 898, 915, 933, 951, 969, 988, - 1007, 1026, 1046, 1066, 1087, 1108, 1129, 1151, - 1173, 1196, 1219, 1243, 1267, 1292, 1317, 1343, - 1369, 1396, 1423, 1451, 1479, 1508, 1537, 1567, - 1597, 1628, 1660, 1692, 1725, 1759, 1793, 1828, -}; - -static const int16_t ac_qlookup_10[QINDEX_RANGE] = { - 4, 9, 11, 13, 16, 18, 21, 24, - 27, 30, 33, 37, 40, 44, 48, 51, - 55, 59, 63, 67, 71, 75, 79, 83, - 88, 92, 96, 100, 105, 109, 114, 118, - 122, 127, 131, 136, 140, 145, 149, 154, - 158, 163, 168, 172, 177, 181, 186, 190, - 195, 199, 204, 208, 213, 217, 222, 226, - 231, 235, 240, 244, 249, 253, 258, 262, - 267, 271, 275, 280, 284, 289, 293, 297, - 302, 306, 311, 315, 319, 324, 328, 332, - 337, 341, 345, 349, 354, 358, 362, 367, - 371, 375, 379, 384, 388, 392, 396, 401, - 409, 417, 425, 433, 441, 449, 458, 466, - 474, 482, 490, 498, 506, 514, 523, 531, - 539, 547, 555, 563, 571, 579, 588, 596, - 604, 616, 628, 640, 652, 664, 676, 688, - 700, 713, 725, 737, 749, 761, 773, 785, - 797, 809, 825, 841, 857, 873, 889, 905, - 922, 938, 954, 970, 986, 1002, 1018, 1038, - 1058, 1078, 1098, 1118, 1138, 1158, 1178, 1198, - 1218, 1242, 1266, 1290, 1314, 1338, 1362, 1386, - 1411, 1435, 1463, 1491, 1519, 1547, 1575, 1603, - 1631, 1663, 1695, 1727, 1759, 1791, 1823, 1859, - 1895, 1931, 1967, 2003, 2039, 2079, 2119, 2159, - 2199, 2239, 2283, 2327, 2371, 2415, 2459, 2507, - 2555, 2603, 2651, 2703, 2755, 2807, 2859, 2915, - 2971, 3027, 3083, 3143, 3203, 3263, 3327, 3391, - 3455, 3523, 3591, 3659, 3731, 3803, 3876, 3952, - 4028, 4104, 4184, 4264, 4348, 4432, 4516, 4604, - 4692, 4784, 4876, 4972, 5068, 5168, 5268, 5372, - 5476, 5584, 5692, 5804, 5916, 6032, 6148, 6268, - 6388, 6512, 6640, 6768, 6900, 7036, 7172, 7312, -}; - -static const int16_t ac_qlookup_12[QINDEX_RANGE] = { - 4, 13, 19, 27, 35, 44, 54, 64, - 75, 87, 99, 112, 126, 139, 154, 168, - 183, 199, 214, 230, 247, 263, 280, 297, - 314, 331, 349, 366, 384, 402, 420, 438, - 456, 475, 493, 511, 530, 548, 567, 586, - 604, 623, 642, 660, 679, 698, 716, 735, - 753, 772, 791, 809, 828, 846, 865, 884, - 902, 920, 939, 957, 976, 994, 1012, 1030, - 1049, 1067, 1085, 1103, 1121, 1139, 1157, 1175, - 1193, 1211, 1229, 1246, 1264, 1282, 1299, 1317, - 1335, 1352, 1370, 1387, 1405, 1422, 1440, 1457, - 1474, 1491, 1509, 1526, 1543, 1560, 1577, 1595, - 1627, 1660, 1693, 1725, 1758, 1791, 1824, 1856, - 1889, 1922, 1954, 1987, 2020, 2052, 2085, 2118, - 2150, 2183, 2216, 2248, 2281, 2313, 2346, 2378, - 2411, 2459, 2508, 2556, 2605, 2653, 2701, 2750, - 2798, 2847, 2895, 2943, 2992, 3040, 3088, 3137, - 3185, 3234, 3298, 3362, 3426, 3491, 3555, 3619, - 3684, 3748, 3812, 3876, 3941, 4005, 4069, 4149, - 4230, 4310, 4390, 4470, 4550, 4631, 4711, 4791, - 4871, 4967, 5064, 5160, 5256, 5352, 5448, 5544, - 5641, 5737, 5849, 5961, 6073, 6185, 6297, 6410, - 6522, 6650, 6778, 6906, 7034, 7162, 7290, 7435, - 7579, 7723, 7867, 8011, 8155, 8315, 8475, 8635, - 8795, 8956, 9132, 9308, 9484, 9660, 9836, 10028, - 10220, 10412, 10604, 10812, 11020, 11228, 11437, 11661, - 11885, 12109, 12333, 12573, 12813, 13053, 13309, 13565, - 13821, 14093, 14365, 14637, 14925, 15213, 15502, 15806, - 16110, 16414, 16734, 17054, 17390, 17726, 18062, 18414, - 18766, 19134, 19502, 19886, 20270, 20670, 21070, 21486, - 21902, 22334, 22766, 23214, 23662, 24126, 24590, 25070, - 25551, 26047, 26559, 27071, 27599, 28143, 28687, 29247, -}; - -int clamp(int value, int low, int high) -{ - return value < low ? low : (value > high ? high : value); -} - -int16_t vp9_dc_quant(int qindex, int delta, int bit_depth) -{ - const uint8_t q_table_idx = clamp(qindex + delta, 0, MAXQ); - - switch (bit_depth) { - case 8: - return dc_qlookup[q_table_idx]; - case 10: - return dc_qlookup_10[q_table_idx]; - case 12: - return dc_qlookup_12[q_table_idx]; - default: - return -1; - } - return -1; -} - -int16_t vp9_ac_quant(int qindex, int delta, int bit_depth) -{ - const uint8_t q_table_idx = clamp(qindex + delta, 0, MAXQ); - - switch (bit_depth) { - case 8: - return ac_qlookup[q_table_idx]; - case 10: - return ac_qlookup_10[q_table_idx]; - case 12: - return ac_qlookup_12[q_table_idx]; - default: - return -1; - } - return -1; -} diff -Nru gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/vp9utils.h gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/vp9utils.h --- gstreamer-vaapi-0.7.0/ext/codecparsers/gst-libs/gst/codecparsers/vp9utils.h 2015-12-07 10:53:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/codecparsers/gst-libs/gst/codecparsers/vp9utils.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef __VP9_QUANT_H__ -#define __VP9_QUANT_H__ - -#include - -#define MAXQ 255 -#define QINDEX_RANGE 256 -#define QINDEX_BITS 8 - -int clamp(int value, int low, int high); - -int16_t vp9_dc_quant(int qindex, int delta, int bit_depth); - -int16_t vp9_ac_quant(int qindex, int delta, int bit_depth); - - -#endif //__VP9_QUANT_H__ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/gstlibvpx.c gstreamer-vaapi-1.8.2/ext/libvpx/gstlibvpx.c --- gstreamer-vaapi-0.7.0/ext/libvpx/gstlibvpx.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/gstlibvpx.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,119 +0,0 @@ -/* - * gstlibvpx.c - GStreamer/libvpx glue - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include -#include -#include -#include -#include "gstlibvpx.h" - -#define BOOL_DECODER_CAST(bd) \ - ((BOOL_DECODER *)(&(bd)->private[1])) - -bool -vp8_bool_decoder_init (vp8_bool_decoder * bd, const uint8_t * buf, - unsigned int buf_size) -{ - assert ((sizeof (*bd) - sizeof (bd->private[0])) >= sizeof (BOOL_DECODER)); - - bd->private[0] = (uintptr_t)buf; - return vp8dx_start_decode (BOOL_DECODER_CAST (bd), buf, buf_size, - NULL, NULL) == 0; -} - -int -vp8_bool_decoder_read (vp8_bool_decoder * bd, uint8_t prob) -{ - return vp8dx_decode_bool (BOOL_DECODER_CAST (bd), prob); -} - -int -vp8_bool_decoder_read_literal (vp8_bool_decoder * bd, int bits) -{ - return vp8_decode_value (BOOL_DECODER_CAST (bd), bits); -} - -unsigned int -vp8_bool_decoder_get_pos (vp8_bool_decoder * bd_) -{ - BOOL_DECODER *const bd = BOOL_DECODER_CAST (bd_); - - return ((uintptr_t)bd->user_buffer - bd_->private[0]) * 8 - (8 + bd->count); -} - -void -vp8_bool_decoder_get_state (vp8_bool_decoder * bd_, - vp8_bool_decoder_state * state) -{ - BOOL_DECODER *const bd = BOOL_DECODER_CAST (bd_); - - if (bd->count < 0) - vp8dx_bool_decoder_fill (bd); - - state->range = bd->range; - state->value = (uint8_t) ((bd->value) >> (VP8_BD_VALUE_SIZE - 8)); - state->count = (8 + bd->count) % 8; -} - -void -vp8_init_token_update_probs (uint8_t - probs[BLOCK_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS][ENTROPY_NODES]) -{ - memcpy (probs, vp8_coef_update_probs, sizeof (vp8_coef_update_probs)); -} - -void -vp8_init_default_token_probs (uint8_t - probs[BLOCK_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS][ENTROPY_NODES]) -{ - memcpy (probs, default_coef_probs, sizeof (default_coef_probs)); -} - -void -vp8_init_mv_update_probs (uint8_t probs[2][MVPcount]) -{ - memcpy (probs[0], vp8_mv_update_probs[0].prob, - sizeof (vp8_mv_update_probs[0].prob)); - memcpy (probs[1], vp8_mv_update_probs[1].prob, - sizeof (vp8_mv_update_probs[1].prob)); -} - -void -vp8_init_default_mv_probs (uint8_t probs[2][MVPcount]) -{ - memcpy (probs[0], vp8_default_mv_context[0].prob, - sizeof (vp8_default_mv_context[0].prob)); - memcpy (probs[1], vp8_default_mv_context[1].prob, - sizeof (vp8_default_mv_context[1].prob)); -} - -void -vp8_init_default_intra_mode_probs (uint8_t y_probs[VP8_YMODES-1], - uint8_t uv_probs[VP8_UV_MODES-1]) -{ - extern const uint8_t vp8_kf_ymode_prob[VP8_YMODES-1]; - extern const uint8_t vp8_kf_uv_mode_prob[VP8_UV_MODES-1]; - - memcpy (y_probs, vp8_kf_ymode_prob, sizeof (vp8_kf_ymode_prob)); - memcpy (uv_probs, vp8_kf_uv_mode_prob, sizeof (vp8_kf_uv_mode_prob)); -} - -void -vp8_init_default_inter_mode_probs (uint8_t y_probs[VP8_YMODES-1], - uint8_t uv_probs[VP8_UV_MODES-1]) -{ - extern const uint8_t vp8_ymode_prob[VP8_YMODES-1]; - extern const uint8_t vp8_uv_mode_prob[VP8_UV_MODES-1]; - - memcpy (y_probs, vp8_ymode_prob, sizeof (vp8_ymode_prob)); - memcpy (uv_probs, vp8_uv_mode_prob, sizeof (vp8_uv_mode_prob)); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/gstlibvpx.h gstreamer-vaapi-1.8.2/ext/libvpx/gstlibvpx.h --- gstreamer-vaapi-0.7.0/ext/libvpx/gstlibvpx.h 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/gstlibvpx.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -/* - * gstlibvpx.h - GStreamer/libvpx glue - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef GST_LIBVPX_H -#define GST_LIBVPX_H - -#include -#include - -typedef struct _vp8_bool_decoder vp8_bool_decoder; -typedef struct _vp8_bool_decoder_state vp8_bool_decoder_state; - -struct _vp8_bool_decoder { - uintptr_t private[16]; -}; - -struct _vp8_bool_decoder_state { - uint8_t range; /* Current "range" value (<= 255) */ - uint8_t value; /* Current "value" value */ - uint8_t count; /* Number of bits shifted out of value (<= 7) */ -}; - -bool -vp8_bool_decoder_init (vp8_bool_decoder * bd, const uint8_t * buf, - unsigned int buf_size); - -int -vp8_bool_decoder_read (vp8_bool_decoder * bd, uint8_t prob); - -int -vp8_bool_decoder_read_literal (vp8_bool_decoder * bd, int bits); - -unsigned int -vp8_bool_decoder_get_pos (vp8_bool_decoder * bd); - -void -vp8_bool_decoder_get_state (vp8_bool_decoder * bd, - vp8_bool_decoder_state * state); - -void -vp8_init_token_update_probs (uint8_t probs[4][8][3][11]); - -void -vp8_init_default_token_probs (uint8_t probs[4][8][3][11]); - -void -vp8_init_mv_update_probs (uint8_t probs[2][19]); - -void -vp8_init_default_mv_probs (uint8_t probs[2][19]); - -void -vp8_init_default_intra_mode_probs (uint8_t y_probs[4], uint8_t uv_probs[3]); - -void -vp8_init_default_inter_mode_probs (uint8_t y_probs[4], uint8_t uv_probs[3]); - -#endif /* GST_LIBVPX_H */ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/libgstcodecparsers_vpx.vers gstreamer-vaapi-1.8.2/ext/libvpx/libgstcodecparsers_vpx.vers --- gstreamer-vaapi-0.7.0/ext/libvpx/libgstcodecparsers_vpx.vers 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/libgstcodecparsers_vpx.vers 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -GSTREAMER { -global: - vp8_bool_decoder_init; - vp8_bool_decoder_read; - vp8_bool_decoder_read_literal; - vp8_bool_decoder_get_pos; - vp8_bool_decoder_get_state; - vp8_init_token_update_probs; - vp8_init_default_token_probs; - vp8_init_mv_update_probs; - vp8_init_default_mv_probs; - vp8_init_default_intra_mode_probs; - vp8_init_default_inter_mode_probs; -local: - *; -}; diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/Makefile.am gstreamer-vaapi-1.8.2/ext/libvpx/Makefile.am --- gstreamer-vaapi-0.7.0/ext/libvpx/Makefile.am 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,160 +0,0 @@ -# Makefile.am - Rules for the built-in libvpx sources -# -# Copyright (C) 2014 Intel Corporation -# Author: Gwenole Beauchesne -# -# 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; if not, write to the -# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, -# Boston, MA 02110-1301, USA. - -lib_LTLIBRARIES = -if USE_BUILTIN_LIBVPX -lib_LTLIBRARIES += libgstcodecparsers_vpx.la -endif - -gst_vpx_source_c = gstlibvpx.c -gst_vpx_source_h = gstlibvpx.h - -vpx_upstream = upstream -vpx_srcdir = $(srcdir)/$(vpx_upstream) -vpx_builddir = $(builddir)/$(vpx_upstream) -vpx_versions = libgstcodecparsers_vpx.vers - -vpx_cflags = \ - -I$(vpx_srcdir) \ - -I$(vpx_builddir) \ - $(NULL) - -vpx_libs = \ - -Wl,-Bsymbolic \ - -Wl,--whole-archive \ - -Wl,$(vpx_builddir)/libvpx.a \ - -Wl,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/$(vpx_versions) \ - -Wl,-lpthread \ - -Wl,-lm \ - $(NULL) - -libgstcodecparsers_vpx_la_SOURCES = $(gst_vpx_source_c) -libgstcodecparsers_vpx_la_CFLAGS = $(vpx_cflags) -libgstcodecparsers_vpx_la_DEPENDENCIES = vpx.build -libgstcodecparsers_vpx_la_LINK = $(LINK) $(vpx_libs) -EXTRA_libgstcodecparsers_vpx_la_DEPENDENCIES = $(srcdir)/$(vpx_versions) - -VPX_DEBUG = yes - -# Codecs -VP8_DECODER = enable -VP8_ENCODER = disable -VP9_DECODER = disable -VP9_ENCODER = disable - -clean-local: vpx.clean -maintainer-clean-local: vpx.maintainer.clean - -vpx.build: vpx.configure.stamp - @$(MAKE) -C $(vpx_builddir) - -vpx.clean: - @[ -d $(vpx_builddir) ] && \ - $(MAKE) -C $(vpx_builddir) clean || : - rm -f vpx.configure.stamp - -vpx.maintainer.clean: vpx.clean - rm -rf $(vpx_builddir) - -DISTCLEANFILES = \ - $(vpx_builddir)/config.mk \ - $(vpx_builddir)/config.log \ - $(vpx_builddir)/libs-x86_64-linux-gcc.mk \ - $(vpx_builddir)/Makefile \ - $(vpx_builddir)/vpx_config.c \ - $(vpx_builddir)/vpx_config.h \ - $(vpx_builddir)/vpx_config.asm \ - $(NULL) - -vpx.configure.stamp: - @[ -d $(vpx_builddir) ] || mkdir $(vpx_builddir); \ - cd $(vpx_builddir) ; \ - test "$(VPX_DEBUG)" = "yes" && \ - CONFIGURE_FLAGS="$$CONFIGURE_FLAGS --enable-debug" ; \ - $(abs_srcdir)/$(vpx_upstream)/configure $$CONFIGURE_FLAGS \ - --enable-static \ - --enable-pic \ - --disable-shared \ - --$(VP8_DECODER)-vp8-decoder \ - --$(VP8_ENCODER)-vp8-encoder \ - --$(VP9_DECODER)-vp9-decoder \ - --$(VP9_ENCODER)-vp9-encoder \ - --enable-runtime-cpu-detect \ - --disable-examples \ - --disable-docs \ - --disable-unit-tests && \ - cd .. && \ - touch $@ - -$(gst_vpx_source_c): vpx.build - -CLEANFILES = vpx.configure.stamp - -# Files for packaging -include $(srcdir)/sources.frag - -vpx_sources = \ - $(vpx_srcdir)/AUTHORS \ - $(vpx_srcdir)/CHANGELOG \ - $(vpx_srcdir)/LICENSE \ - $(vpx_srcdir)/PATENTS \ - $(vpx_srcdir)/build/make/ads2armasm_ms.pl \ - $(vpx_srcdir)/build/make/ads2gas_apple.pl \ - $(vpx_srcdir)/build/make/ads2gas.pl \ - $(vpx_srcdir)/build/make/Android.mk \ - $(vpx_srcdir)/build/make/armlink_adapter.sh \ - $(vpx_srcdir)/build/make/configure.sh \ - $(vpx_srcdir)/build/make/gen_asm_deps.sh \ - $(vpx_srcdir)/build/make/gen_msvs_def.sh \ - $(vpx_srcdir)/build/make/gen_msvs_proj.sh \ - $(vpx_srcdir)/build/make/gen_msvs_sln.sh \ - $(vpx_srcdir)/build/make/gen_msvs_vcxproj.sh \ - $(vpx_srcdir)/build/make/iosbuild.sh \ - $(vpx_srcdir)/build/make/Makefile \ - $(vpx_srcdir)/build/make/msvs_common.sh \ - $(vpx_srcdir)/build/make/rtcd.pl \ - $(vpx_srcdir)/build/make/thumb.pm \ - $(vpx_srcdir)/build/make/version.sh \ - $(vpx_srcdir)/configure \ - $(vpx_source_mak:%.mk=$(vpx_srcdir)/%.mk) \ - $(vpx_source_c:%.c=$(vpx_srcdir)/%.c) \ - $(vpx_source_h:%.h=$(vpx_srcdir)/%.h) \ - $(NULL) - -EXTRA_DIST = \ - sources.frag \ - $(gst_vpx_source_h) \ - $(vpx_sources) \ - $(vpx_versions) \ - $(NULL) - -# Avoid implicit rule that tries to compile .asm.o to .asm -dist-hook: - for f in $(vpx_source_asm); do \ - mkdir -p $(distdir)/$(vpx_upstream)/$$(dirname $$f); \ - cp -fpR $(vpx_srcdir)/$$f $(distdir)/$(vpx_upstream)/$$f; \ - done - --include $(top_srcdir)/git.mk - -# Tell version 3.79 and up of GNU make to not build goals in this -# directory in parallel. -.NOTPARALLEL: diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/Makefile.in gstreamer-vaapi-1.8.2/ext/libvpx/Makefile.in --- gstreamer-vaapi-0.7.0/ext/libvpx/Makefile.in 2015-12-07 10:54:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,1614 +0,0 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2014 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# Makefile.am - Rules for the built-in libvpx sources -# -# Copyright (C) 2014 Intel Corporation -# Author: Gwenole Beauchesne -# -# 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; if not, write to the -# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, -# Boston, MA 02110-1301, USA. - -# sources.frag - Generated list of source files for libvpx (-*- makefile -*-) -# -# Copyright (C) 2014 Intel Corporation -# Author: Gwenole Beauchesne -# -# 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; if not, write to the -# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, -# Boston, MA 02110-1301, USA. - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -@USE_BUILTIN_LIBVPX_TRUE@am__append_1 = libgstcodecparsers_vpx.la -subdir = ext/libvpx -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(libdir)" -LTLIBRARIES = $(lib_LTLIBRARIES) -libgstcodecparsers_vpx_la_LIBADD = -am__objects_1 = libgstcodecparsers_vpx_la-gstlibvpx.lo -am_libgstcodecparsers_vpx_la_OBJECTS = $(am__objects_1) -libgstcodecparsers_vpx_la_OBJECTS = \ - $(am_libgstcodecparsers_vpx_la_OBJECTS) -@USE_BUILTIN_LIBVPX_TRUE@am_libgstcodecparsers_vpx_la_rpath = -rpath \ -@USE_BUILTIN_LIBVPX_TRUE@ $(libdir) -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libgstcodecparsers_vpx_la_SOURCES) -DIST_SOURCES = $(libgstcodecparsers_vpx_la_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/sources.frag \ - $(top_srcdir)/build-aux/depcomp -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DLOPEN_LIBS = @DLOPEN_LIBS@ -DRM_CFLAGS = @DRM_CFLAGS@ -DRM_LIBS = @DRM_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGL_CFLAGS = @EGL_CFLAGS@ -EGL_LIBS = @EGL_LIBS@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GIT = @GIT@ -GLES2_CFLAGS = @GLES2_CFLAGS@ -GLES2_LIBS = @GLES2_LIBS@ -GLES3_CFLAGS = @GLES3_CFLAGS@ -GLES3_LIBS = @GLES3_LIBS@ -GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_LIBS = @GLIB_LIBS@ -GLIB_VERSION_REQUIRED = @GLIB_VERSION_REQUIRED@ -GL_CFLAGS = @GL_CFLAGS@ -GL_LIBS = @GL_LIBS@ -GMODULE_CFLAGS = @GMODULE_CFLAGS@ -GMODULE_LIBS = @GMODULE_LIBS@ -GMODULE_VERSION_REQUIRED = @GMODULE_VERSION_REQUIRED@ -GREP = @GREP@ -GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ -GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ -GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ -GST_API_VERSION = @GST_API_VERSION@ -GST_BASEVIDEO_CFLAGS = @GST_BASEVIDEO_CFLAGS@ -GST_BASEVIDEO_LIBS = @GST_BASEVIDEO_LIBS@ -GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ -GST_BASE_LIBS = @GST_BASE_LIBS@ -GST_CFLAGS = @GST_CFLAGS@ -GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ -GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ -GST_GL_CFLAGS = @GST_GL_CFLAGS@ -GST_GL_LIBS = @GST_GL_LIBS@ -GST_INTERFACES_CFLAGS = @GST_INTERFACES_CFLAGS@ -GST_INTERFACES_LIBS = @GST_INTERFACES_LIBS@ -GST_LIBS = @GST_LIBS@ -GST_PKG_VERSION = @GST_PKG_VERSION@ -GST_PLUGINS_BAD_VERSION_REQUIRED = @GST_PLUGINS_BAD_VERSION_REQUIRED@ -GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ -GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ -GST_PLUGINS_BASE_VERSION_REQUIRED = @GST_PLUGINS_BASE_VERSION_REQUIRED@ -GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ -GST_PLUGIN_PATH_1_0 = @GST_PLUGIN_PATH_1_0@ -GST_VAAPI_LT_LDFLAGS = @GST_VAAPI_LT_LDFLAGS@ -GST_VAAPI_LT_VERSION = @GST_VAAPI_LT_VERSION@ -GST_VAAPI_MAJOR_VERSION = @GST_VAAPI_MAJOR_VERSION@ -GST_VERSION_REQUIRED = @GST_VERSION_REQUIRED@ -GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ -GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ -GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ -GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ -GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ -GTKDOC_MKPDF = @GTKDOC_MKPDF@ -GTKDOC_REBASE = @GTKDOC_REBASE@ -GTKDOC_VERSION = @GTKDOC_VERSION@ -HTML_DIR = @HTML_DIR@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBVA_CFLAGS = @LIBVA_CFLAGS@ -LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ -LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ -LIBVA_LIBS = @LIBVA_LIBS@ -LIBVA_PACKAGE_VERSION = @LIBVA_PACKAGE_VERSION@ -LIBVA_PKGNAME = @LIBVA_PKGNAME@ -LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ -LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ -LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ -LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ -LIBVA_X11_PKGNAME = @LIBVA_X11_PKGNAME@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATCH = @PATCH@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TODAY = @TODAY@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ -VERSION = @VERSION@ -WAYLAND_API_VERSION = @WAYLAND_API_VERSION@ -WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ -WAYLAND_LIBS = @WAYLAND_LIBS@ -X11_CFLAGS = @X11_CFLAGS@ -X11_LIBS = @X11_LIBS@ -XRANDR_CFLAGS = @XRANDR_CFLAGS@ -XRANDR_LIBS = @XRANDR_LIBS@ -XRENDER_CFLAGS = @XRENDER_CFLAGS@ -XRENDER_LIBS = @XRENDER_LIBS@ -YASM = @YASM@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ -plugindir = @plugindir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -lib_LTLIBRARIES = $(am__append_1) -gst_vpx_source_c = gstlibvpx.c -gst_vpx_source_h = gstlibvpx.h -vpx_upstream = upstream -vpx_srcdir = $(srcdir)/$(vpx_upstream) -vpx_builddir = $(builddir)/$(vpx_upstream) -vpx_versions = libgstcodecparsers_vpx.vers -vpx_cflags = \ - -I$(vpx_srcdir) \ - -I$(vpx_builddir) \ - $(NULL) - -vpx_libs = \ - -Wl,-Bsymbolic \ - -Wl,--whole-archive \ - -Wl,$(vpx_builddir)/libvpx.a \ - -Wl,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/$(vpx_versions) \ - -Wl,-lpthread \ - -Wl,-lm \ - $(NULL) - -libgstcodecparsers_vpx_la_SOURCES = $(gst_vpx_source_c) -libgstcodecparsers_vpx_la_CFLAGS = $(vpx_cflags) -libgstcodecparsers_vpx_la_DEPENDENCIES = vpx.build -libgstcodecparsers_vpx_la_LINK = $(LINK) $(vpx_libs) -EXTRA_libgstcodecparsers_vpx_la_DEPENDENCIES = $(srcdir)/$(vpx_versions) -VPX_DEBUG = yes - -# Codecs -VP8_DECODER = enable -VP8_ENCODER = disable -VP9_DECODER = disable -VP9_ENCODER = disable -DISTCLEANFILES = \ - $(vpx_builddir)/config.mk \ - $(vpx_builddir)/config.log \ - $(vpx_builddir)/libs-x86_64-linux-gcc.mk \ - $(vpx_builddir)/Makefile \ - $(vpx_builddir)/vpx_config.c \ - $(vpx_builddir)/vpx_config.h \ - $(vpx_builddir)/vpx_config.asm \ - $(NULL) - -CLEANFILES = vpx.configure.stamp -vpx_source_mak = \ - build/make/Android.mk \ - docs.mk \ - examples.mk \ - libs.mk \ - solution.mk \ - test/android/Android.mk \ - test/test-data.mk \ - test/test.mk \ - third_party/googletest/gtest.mk \ - third_party/libwebm/Android.mk \ - vp8/vp8_common.mk \ - vp8/vp8cx_arm.mk \ - vp8/vp8cx.mk \ - vp8/vp8dx.mk \ - vp9/vp9_common.mk \ - vp9/vp9cx.mk \ - vp9/vp9dx.mk \ - vpx_mem/vpx_mem.mk \ - vpx_ports/vpx_ports.mk \ - vpx_scale/vpx_scale.mk \ - vpx/vpx_codec.mk \ - $(NULL) - -vpx_source_c = \ - args.c \ - examples/decode_to_md5.c \ - examples/decode_with_drops.c \ - examples/postproc.c \ - examples/resize_util.c \ - examples/set_maps.c \ - examples/simple_decoder.c \ - examples/simple_encoder.c \ - examples/twopass_encoder.c \ - examples/vp8cx_set_ref.c \ - examples/vp8_multi_resolution_encoder.c \ - examples/vp9_lossless_encoder.c \ - examples/vp9_spatial_svc_encoder.c \ - examples/vpx_temporal_svc_encoder.c \ - ivfdec.c \ - ivfenc.c \ - md5_utils.c \ - rate_hist.c \ - tools_common.c \ - video_reader.c \ - video_writer.c \ - vp8/common/alloccommon.c \ - vp8/common/arm/armv6/idct_blk_v6.c \ - vp8/common/arm/bilinearfilter_arm.c \ - vp8/common/arm/dequantize_arm.c \ - vp8/common/arm/filter_arm.c \ - vp8/common/arm/loopfilter_arm.c \ - vp8/common/arm/neon/bilinearpredict_neon.c \ - vp8/common/arm/neon/copymem_neon.c \ - vp8/common/arm/neon/dc_only_idct_add_neon.c \ - vp8/common/arm/neon/dequant_idct_neon.c \ - vp8/common/arm/neon/dequantizeb_neon.c \ - vp8/common/arm/neon/idct_blk_neon.c \ - vp8/common/arm/neon/idct_dequant_0_2x_neon.c \ - vp8/common/arm/neon/idct_dequant_full_2x_neon.c \ - vp8/common/arm/neon/iwalsh_neon.c \ - vp8/common/arm/neon/loopfilter_neon.c \ - vp8/common/arm/neon/loopfiltersimplehorizontaledge_neon.c \ - vp8/common/arm/neon/loopfiltersimpleverticaledge_neon.c \ - vp8/common/arm/neon/mbloopfilter_neon.c \ - vp8/common/arm/neon/reconintra_neon.c \ - vp8/common/arm/neon/sad_neon.c \ - vp8/common/arm/neon/shortidct4x4llm_neon.c \ - vp8/common/arm/neon/sixtappredict_neon.c \ - vp8/common/arm/neon/variance_neon.c \ - vp8/common/arm/neon/vp8_subpixelvariance_neon.c \ - vp8/common/arm/variance_arm.c \ - vp8/common/blockd.c \ - vp8/common/context.c \ - vp8/common/debugmodes.c \ - vp8/common/dequantize.c \ - vp8/common/entropy.c \ - vp8/common/entropymode.c \ - vp8/common/entropymv.c \ - vp8/common/extend.c \ - vp8/common/filter.c \ - vp8/common/findnearmv.c \ - vp8/common/generic/systemdependent.c \ - vp8/common/idct_blk.c \ - vp8/common/idctllm.c \ - vp8/common/loopfilter.c \ - vp8/common/loopfilter_filters.c \ - vp8/common/mbpitch.c \ - vp8/common/mfqe.c \ - vp8/common/mips/dspr2/dequantize_dspr2.c \ - vp8/common/mips/dspr2/filter_dspr2.c \ - vp8/common/mips/dspr2/idct_blk_dspr2.c \ - vp8/common/mips/dspr2/idctllm_dspr2.c \ - vp8/common/mips/dspr2/loopfilter_filters_dspr2.c \ - vp8/common/mips/dspr2/reconinter_dspr2.c \ - vp8/common/modecont.c \ - vp8/common/postproc.c \ - vp8/common/ppc/loopfilter_altivec.c \ - vp8/common/ppc/systemdependent.c \ - vp8/common/quant_common.c \ - vp8/common/reconinter.c \ - vp8/common/reconintra4x4.c \ - vp8/common/reconintra.c \ - vp8/common/rtcd.c \ - vp8/common/sad_c.c \ - vp8/common/setupintrarecon.c \ - vp8/common/swapyv12buffer.c \ - vp8/common/textblit.c \ - vp8/common/treecoder.c \ - vp8/common/variance_c.c \ - vp8/common/x86/filter_x86.c \ - vp8/common/x86/idct_blk_mmx.c \ - vp8/common/x86/idct_blk_sse2.c \ - vp8/common/x86/loopfilter_x86.c \ - vp8/common/x86/recon_wrapper_sse2.c \ - vp8/common/x86/variance_mmx.c \ - vp8/common/x86/variance_sse2.c \ - vp8/common/x86/variance_ssse3.c \ - vp8/common/x86/vp8_asm_stubs.c \ - vp8/decoder/dboolhuff.c \ - vp8/decoder/decodeframe.c \ - vp8/decoder/decodemv.c \ - vp8/decoder/detokenize.c \ - vp8/decoder/error_concealment.c \ - vp8/decoder/onyxd_if.c \ - vp8/decoder/threading.c \ - vp8/encoder/arm/dct_arm.c \ - vp8/encoder/arm/neon/denoising_neon.c \ - vp8/encoder/arm/neon/fastquantizeb_neon.c \ - vp8/encoder/arm/neon/shortfdct_neon.c \ - vp8/encoder/arm/neon/subtract_neon.c \ - vp8/encoder/arm/neon/vp8_mse16x16_neon.c \ - vp8/encoder/arm/neon/vp8_shortwalsh4x4_neon.c \ - vp8/encoder/bitstream.c \ - vp8/encoder/boolhuff.c \ - vp8/encoder/dct.c \ - vp8/encoder/denoising.c \ - vp8/encoder/encodeframe.c \ - vp8/encoder/encodeintra.c \ - vp8/encoder/encodemb.c \ - vp8/encoder/encodemv.c \ - vp8/encoder/ethreading.c \ - vp8/encoder/firstpass.c \ - vp8/encoder/lookahead.c \ - vp8/encoder/mcomp.c \ - vp8/encoder/modecosts.c \ - vp8/encoder/mr_dissim.c \ - vp8/encoder/onyx_if.c \ - vp8/encoder/pickinter.c \ - vp8/encoder/picklpf.c \ - vp8/encoder/ppc/csystemdependent.c \ - vp8/encoder/quantize.c \ - vp8/encoder/ratectrl.c \ - vp8/encoder/rdopt.c \ - vp8/encoder/segmentation.c \ - vp8/encoder/ssim.c \ - vp8/encoder/temporal_filter.c \ - vp8/encoder/tokenize.c \ - vp8/encoder/treewriter.c \ - vp8/encoder/x86/denoising_sse2.c \ - vp8/encoder/x86/quantize_sse2.c \ - vp8/encoder/x86/quantize_sse4.c \ - vp8/encoder/x86/quantize_ssse3.c \ - vp8/encoder/x86/vp8_enc_stubs_mmx.c \ - vp8/encoder/x86/vp8_enc_stubs_sse2.c \ - vp8/vp8_cx_iface.c \ - vp8/vp8_dx_iface.c \ - vp9/common/arm/neon/vp9_avg_neon.c \ - vp9/common/arm/neon/vp9_convolve8_avg_neon.c \ - vp9/common/arm/neon/vp9_convolve8_neon.c \ - vp9/common/arm/neon/vp9_convolve_neon.c \ - vp9/common/arm/neon/vp9_copy_neon.c \ - vp9/common/arm/neon/vp9_idct16x16_1_add_neon.c \ - vp9/common/arm/neon/vp9_idct16x16_add_neon.c \ - vp9/common/arm/neon/vp9_idct16x16_neon.c \ - vp9/common/arm/neon/vp9_idct32x32_1_add_neon.c \ - vp9/common/arm/neon/vp9_idct32x32_add_neon.c \ - vp9/common/arm/neon/vp9_idct4x4_1_add_neon.c \ - vp9/common/arm/neon/vp9_idct4x4_add_neon.c \ - vp9/common/arm/neon/vp9_idct8x8_1_add_neon.c \ - vp9/common/arm/neon/vp9_idct8x8_add_neon.c \ - vp9/common/arm/neon/vp9_iht4x4_add_neon.c \ - vp9/common/arm/neon/vp9_iht8x8_add_neon.c \ - vp9/common/arm/neon/vp9_loopfilter_16_neon.c \ - vp9/common/arm/neon/vp9_loopfilter_4_neon.c \ - vp9/common/arm/neon/vp9_loopfilter_8_neon.c \ - vp9/common/arm/neon/vp9_loopfilter_neon.c \ - vp9/common/arm/neon/vp9_reconintra_neon.c \ - vp9/common/mips/dspr2/vp9_convolve2_avg_dspr2.c \ - vp9/common/mips/dspr2/vp9_convolve2_avg_horiz_dspr2.c \ - vp9/common/mips/dspr2/vp9_convolve2_dspr2.c \ - vp9/common/mips/dspr2/vp9_convolve2_horiz_dspr2.c \ - vp9/common/mips/dspr2/vp9_convolve2_vert_dspr2.c \ - vp9/common/mips/dspr2/vp9_convolve8_avg_dspr2.c \ - vp9/common/mips/dspr2/vp9_convolve8_avg_horiz_dspr2.c \ - vp9/common/mips/dspr2/vp9_convolve8_dspr2.c \ - vp9/common/mips/dspr2/vp9_convolve8_horiz_dspr2.c \ - vp9/common/mips/dspr2/vp9_convolve8_vert_dspr2.c \ - vp9/common/mips/dspr2/vp9_intrapred16_dspr2.c \ - vp9/common/mips/dspr2/vp9_intrapred4_dspr2.c \ - vp9/common/mips/dspr2/vp9_intrapred8_dspr2.c \ - vp9/common/mips/dspr2/vp9_itrans16_dspr2.c \ - vp9/common/mips/dspr2/vp9_itrans32_cols_dspr2.c \ - vp9/common/mips/dspr2/vp9_itrans32_dspr2.c \ - vp9/common/mips/dspr2/vp9_itrans4_dspr2.c \ - vp9/common/mips/dspr2/vp9_itrans8_dspr2.c \ - vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.c \ - vp9/common/mips/dspr2/vp9_mbloop_loopfilter_dspr2.c \ - vp9/common/mips/dspr2/vp9_mblpf_horiz_loopfilter_dspr2.c \ - vp9/common/mips/dspr2/vp9_mblpf_vert_loopfilter_dspr2.c \ - vp9/common/vp9_alloccommon.c \ - vp9/common/vp9_blockd.c \ - vp9/common/vp9_common_data.c \ - vp9/common/vp9_convolve.c \ - vp9/common/vp9_debugmodes.c \ - vp9/common/vp9_entropy.c \ - vp9/common/vp9_entropymode.c \ - vp9/common/vp9_entropymv.c \ - vp9/common/vp9_filter.c \ - vp9/common/vp9_frame_buffers.c \ - vp9/common/vp9_idct.c \ - vp9/common/vp9_loopfilter.c \ - vp9/common/vp9_loopfilter_filters.c \ - vp9/common/vp9_mfqe.c \ - vp9/common/vp9_mvref_common.c \ - vp9/common/vp9_postproc.c \ - vp9/common/vp9_pred_common.c \ - vp9/common/vp9_prob.c \ - vp9/common/vp9_quant_common.c \ - vp9/common/vp9_reconinter.c \ - vp9/common/vp9_reconintra.c \ - vp9/common/vp9_rtcd.c \ - vp9/common/vp9_scale.c \ - vp9/common/vp9_scan.c \ - vp9/common/vp9_seg_common.c \ - vp9/common/vp9_textblit.c \ - vp9/common/vp9_thread.c \ - vp9/common/vp9_thread_common.c \ - vp9/common/vp9_tile_common.c \ - vp9/common/x86/vp9_asm_stubs.c \ - vp9/common/x86/vp9_high_loopfilter_intrin_sse2.c \ - vp9/common/x86/vp9_idct_intrin_sse2.c \ - vp9/common/x86/vp9_idct_intrin_ssse3.c \ - vp9/common/x86/vp9_loopfilter_intrin_avx2.c \ - vp9/common/x86/vp9_loopfilter_intrin_sse2.c \ - vp9/common/x86/vp9_subpixel_8t_intrin_avx2.c \ - vp9/common/x86/vp9_subpixel_8t_intrin_ssse3.c \ - vp9/decoder/vp9_decodeframe.c \ - vp9/decoder/vp9_decodemv.c \ - vp9/decoder/vp9_decoder.c \ - vp9/decoder/vp9_detokenize.c \ - vp9/decoder/vp9_dsubexp.c \ - vp9/decoder/vp9_dthread.c \ - vp9/decoder/vp9_read_bit_buffer.c \ - vp9/decoder/vp9_reader.c \ - vp9/encoder/arm/neon/vp9_avg_neon.c \ - vp9/encoder/arm/neon/vp9_dct_neon.c \ - vp9/encoder/arm/neon/vp9_quantize_neon.c \ - vp9/encoder/arm/neon/vp9_sad4d_neon.c \ - vp9/encoder/arm/neon/vp9_sad_neon.c \ - vp9/encoder/arm/neon/vp9_subtract_neon.c \ - vp9/encoder/arm/neon/vp9_variance_neon.c \ - vp9/encoder/vp9_aq_complexity.c \ - vp9/encoder/vp9_aq_cyclicrefresh.c \ - vp9/encoder/vp9_aq_variance.c \ - vp9/encoder/vp9_avg.c \ - vp9/encoder/vp9_bitstream.c \ - vp9/encoder/vp9_context_tree.c \ - vp9/encoder/vp9_cost.c \ - vp9/encoder/vp9_dct.c \ - vp9/encoder/vp9_denoiser.c \ - vp9/encoder/vp9_encodeframe.c \ - vp9/encoder/vp9_encodemb.c \ - vp9/encoder/vp9_encodemv.c \ - vp9/encoder/vp9_encoder.c \ - vp9/encoder/vp9_ethread.c \ - vp9/encoder/vp9_extend.c \ - vp9/encoder/vp9_firstpass.c \ - vp9/encoder/vp9_lookahead.c \ - vp9/encoder/vp9_mbgraph.c \ - vp9/encoder/vp9_mcomp.c \ - vp9/encoder/vp9_picklpf.c \ - vp9/encoder/vp9_pickmode.c \ - vp9/encoder/vp9_quantize.c \ - vp9/encoder/vp9_ratectrl.c \ - vp9/encoder/vp9_rd.c \ - vp9/encoder/vp9_rdopt.c \ - vp9/encoder/vp9_resize.c \ - vp9/encoder/vp9_sad.c \ - vp9/encoder/vp9_segmentation.c \ - vp9/encoder/vp9_skin_detection.c \ - vp9/encoder/vp9_speed_features.c \ - vp9/encoder/vp9_ssim.c \ - vp9/encoder/vp9_subexp.c \ - vp9/encoder/vp9_svc_layercontext.c \ - vp9/encoder/vp9_temporal_filter.c \ - vp9/encoder/vp9_tokenize.c \ - vp9/encoder/vp9_treewriter.c \ - vp9/encoder/vp9_variance.c \ - vp9/encoder/vp9_write_bit_buffer.c \ - vp9/encoder/vp9_writer.c \ - vp9/encoder/x86/vp9_avg_intrin_sse2.c \ - vp9/encoder/x86/vp9_dct32x32_avx2.c \ - vp9/encoder/x86/vp9_dct32x32_sse2.c \ - vp9/encoder/x86/vp9_dct_avx2.c \ - vp9/encoder/x86/vp9_dct_impl_sse2.c \ - vp9/encoder/x86/vp9_dct_sse2.c \ - vp9/encoder/x86/vp9_dct_ssse3.c \ - vp9/encoder/x86/vp9_denoiser_sse2.c \ - vp9/encoder/x86/vp9_error_intrin_avx2.c \ - vp9/encoder/x86/vp9_highbd_block_error_intrin_sse2.c \ - vp9/encoder/x86/vp9_highbd_quantize_intrin_sse2.c \ - vp9/encoder/x86/vp9_highbd_variance_sse2.c \ - vp9/encoder/x86/vp9_quantize_sse2.c \ - vp9/encoder/x86/vp9_sad4d_intrin_avx2.c \ - vp9/encoder/x86/vp9_sad_intrin_avx2.c \ - vp9/encoder/x86/vp9_subpel_variance_impl_intrin_avx2.c \ - vp9/encoder/x86/vp9_variance_avx2.c \ - vp9/encoder/x86/vp9_variance_impl_intrin_avx2.c \ - vp9/encoder/x86/vp9_variance_sse2.c \ - vp9/vp9_cx_iface.c \ - vp9/vp9_dx_iface.c \ - vpxdec.c \ - vpxenc.c \ - vpx_mem/memory_manager/hmm_alloc.c \ - vpx_mem/memory_manager/hmm_base.c \ - vpx_mem/memory_manager/hmm_dflt_abort.c \ - vpx_mem/memory_manager/hmm_grow.c \ - vpx_mem/memory_manager/hmm_largest.c \ - vpx_mem/memory_manager/hmm_resize.c \ - vpx_mem/memory_manager/hmm_shrink.c \ - vpx_mem/memory_manager/hmm_true.c \ - vpx_mem/vpx_mem.c \ - vpx_mem/vpx_mem_tracker.c \ - vpx_ports/arm_cpudetect.c \ - vpx_scale/generic/gen_scalers.c \ - vpx_scale/generic/vpx_scale.c \ - vpx_scale/generic/yv12config.c \ - vpx_scale/generic/yv12extend.c \ - vpx_scale/mips/dspr2/yv12extend_dspr2.c \ - vpx_scale/vpx_scale_rtcd.c \ - vpx_scale/win32/scaleopt.c \ - vpx/src/svc_encodeframe.c \ - vpx/src/vpx_codec.c \ - vpx/src/vpx_decoder.c \ - vpx/src/vpx_encoder.c \ - vpx/src/vpx_image.c \ - vpx/src/vpx_psnr.c \ - vpxstats.c \ - warnings.c \ - y4menc.c \ - y4minput.c \ - $(NULL) - -vpx_source_h = \ - args.h \ - ivfdec.h \ - ivfenc.h \ - md5_utils.h \ - rate_hist.h \ - vp8_rtcd.h \ - test/acm_random.h \ - test/clear_system_state.h \ - test/codec_factory.h \ - test/decode_test_driver.h \ - test/encode_test_driver.h \ - test/i420_video_source.h \ - test/ivf_video_source.h \ - test/md5_helper.h \ - test/register_state_check.h \ - test/test_vectors.h \ - test/util.h \ - test/video_source.h \ - test/webm_video_source.h \ - test/y4m_video_source.h \ - test/yuv_video_source.h \ - third_party/googletest/src/include/gtest/gtest.h \ - third_party/libyuv/include/libyuv/basic_types.h \ - third_party/libyuv/include/libyuv/compare.h \ - third_party/libyuv/include/libyuv/convert_argb.h \ - third_party/libyuv/include/libyuv/convert_from_argb.h \ - third_party/libyuv/include/libyuv/convert_from.h \ - third_party/libyuv/include/libyuv/convert.h \ - third_party/libyuv/include/libyuv/cpu_id.h \ - third_party/libyuv/include/libyuv/mjpeg_decoder.h \ - third_party/libyuv/include/libyuv/planar_functions.h \ - third_party/libyuv/include/libyuv/rotate_argb.h \ - third_party/libyuv/include/libyuv/rotate.h \ - third_party/libyuv/include/libyuv/row.h \ - third_party/libyuv/include/libyuv/scale_argb.h \ - third_party/libyuv/include/libyuv/scale.h \ - third_party/libyuv/include/libyuv/scale_row.h \ - third_party/libyuv/include/libyuv/version.h \ - third_party/libyuv/include/libyuv/video_common.h \ - tools_common.h \ - video_common.h \ - video_reader.h \ - video_writer.h \ - vp8/common/alloccommon.h \ - vp8/common/arm/bilinearfilter_arm.h \ - vp8/common/blockd.h \ - vp8/common/coefupdateprobs.h \ - vp8/common/common.h \ - vp8/common/default_coef_probs.h \ - vp8/common/entropy.h \ - vp8/common/entropymode.h \ - vp8/common/entropymv.h \ - vp8/common/extend.h \ - vp8/common/filter.h \ - vp8/common/findnearmv.h \ - vp8/common/header.h \ - vp8/common/invtrans.h \ - vp8/common/loopfilter.h \ - vp8/common/modecont.h \ - vp8/common/mv.h \ - vp8/common/onyxc_int.h \ - vp8/common/onyxd.h \ - vp8/common/onyx.h \ - vp8/common/postproc.h \ - vp8/common/ppflags.h \ - vp8/common/quant_common.h \ - vp8/common/reconinter.h \ - vp8/common/reconintra4x4.h \ - vp8/common/setupintrarecon.h \ - vp8/common/swapyv12buffer.h \ - vp8/common/systemdependent.h \ - vp8/common/threading.h \ - vp8/common/treecoder.h \ - vp8/common/variance.h \ - vp8/common/vp8_entropymodedata.h \ - vp8/common/x86/filter_x86.h \ - vp8/decoder/dboolhuff.h \ - vp8/decoder/decodemv.h \ - vp8/decoder/decoderthreading.h \ - vp8/decoder/detokenize.h \ - vp8/decoder/ec_types.h \ - vp8/decoder/error_concealment.h \ - vp8/decoder/onyxd_int.h \ - vp8/decoder/treereader.h \ - vp8/encoder/bitstream.h \ - vp8/encoder/block.h \ - vp8/encoder/boolhuff.h \ - vp8/encoder/dct_value_cost.h \ - vp8/encoder/dct_value_tokens.h \ - vp8/encoder/defaultcoefcounts.h \ - vp8/encoder/denoising.h \ - vp8/encoder/encodeframe.h \ - vp8/encoder/encodeintra.h \ - vp8/encoder/encodemb.h \ - vp8/encoder/encodemv.h \ - vp8/encoder/firstpass.h \ - vp8/encoder/lookahead.h \ - vp8/encoder/mcomp.h \ - vp8/encoder/modecosts.h \ - vp8/encoder/mr_dissim.h \ - vp8/encoder/onyx_int.h \ - vp8/encoder/pickinter.h \ - vp8/encoder/quantize.h \ - vp8/encoder/ratectrl.h \ - vp8/encoder/rdopt.h \ - vp8/encoder/segmentation.h \ - vp8/encoder/tokenize.h \ - vp8/encoder/treewriter.h \ - vp9/common/mips/dspr2/vp9_common_dspr2.h \ - vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.h \ - vp9/common/mips/dspr2/vp9_loopfilter_macros_dspr2.h \ - vp9/common/mips/dspr2/vp9_loopfilter_masks_dspr2.h \ - vp9/common/vp9_alloccommon.h \ - vp9/common/vp9_blockd.h \ - vp9/common/vp9_common_data.h \ - vp9/common/vp9_common.h \ - vp9/common/vp9_convolve.h \ - vp9/common/vp9_entropy.h \ - vp9/common/vp9_entropymode.h \ - vp9/common/vp9_entropymv.h \ - vp9/common/vp9_enums.h \ - vp9/common/vp9_filter.h \ - vp9/common/vp9_frame_buffers.h \ - vp9/common/vp9_idct.h \ - vp9/common/vp9_loopfilter.h \ - vp9/common/vp9_mfqe.h \ - vp9/common/vp9_mv.h \ - vp9/common/vp9_mvref_common.h \ - vp9/common/vp9_onyxc_int.h \ - vp9/common/vp9_postproc.h \ - vp9/common/vp9_ppflags.h \ - vp9/common/vp9_pred_common.h \ - vp9/common/vp9_prob.h \ - vp9/common/vp9_quant_common.h \ - vp9/common/vp9_reconinter.h \ - vp9/common/vp9_reconintra.h \ - vp9/common/vp9_scale.h \ - vp9/common/vp9_scan.h \ - vp9/common/vp9_seg_common.h \ - vp9/common/vp9_systemdependent.h \ - vp9/common/vp9_textblit.h \ - vp9/common/vp9_thread_common.h \ - vp9/common/vp9_thread.h \ - vp9/common/vp9_tile_common.h \ - vp9/common/x86/vp9_idct_intrin_sse2.h \ - vp9/decoder/vp9_decodeframe.h \ - vp9/decoder/vp9_decodemv.h \ - vp9/decoder/vp9_decoder.h \ - vp9/decoder/vp9_detokenize.h \ - vp9/decoder/vp9_dsubexp.h \ - vp9/decoder/vp9_dthread.h \ - vp9/decoder/vp9_read_bit_buffer.h \ - vp9/decoder/vp9_reader.h \ - vp9/encoder/vp9_aq_complexity.h \ - vp9/encoder/vp9_aq_cyclicrefresh.h \ - vp9/encoder/vp9_aq_variance.h \ - vp9/encoder/vp9_bitstream.h \ - vp9/encoder/vp9_block.h \ - vp9/encoder/vp9_context_tree.h \ - vp9/encoder/vp9_cost.h \ - vp9/encoder/vp9_dct.h \ - vp9/encoder/vp9_denoiser.h \ - vp9/encoder/vp9_encodeframe.h \ - vp9/encoder/vp9_encodemb.h \ - vp9/encoder/vp9_encodemv.h \ - vp9/encoder/vp9_encoder.h \ - vp9/encoder/vp9_ethread.h \ - vp9/encoder/vp9_extend.h \ - vp9/encoder/vp9_firstpass.h \ - vp9/encoder/vp9_lookahead.h \ - vp9/encoder/vp9_mbgraph.h \ - vp9/encoder/vp9_mcomp.h \ - vp9/encoder/vp9_picklpf.h \ - vp9/encoder/vp9_pickmode.h \ - vp9/encoder/vp9_quantize.h \ - vp9/encoder/vp9_ratectrl.h \ - vp9/encoder/vp9_rd.h \ - vp9/encoder/vp9_rdopt.h \ - vp9/encoder/vp9_resize.h \ - vp9/encoder/vp9_segmentation.h \ - vp9/encoder/vp9_skin_detection.h \ - vp9/encoder/vp9_speed_features.h \ - vp9/encoder/vp9_ssim.h \ - vp9/encoder/vp9_subexp.h \ - vp9/encoder/vp9_svc_layercontext.h \ - vp9/encoder/vp9_temporal_filter.h \ - vp9/encoder/vp9_tokenize.h \ - vp9/encoder/vp9_treewriter.h \ - vp9/encoder/vp9_variance.h \ - vp9/encoder/vp9_write_bit_buffer.h \ - vp9/encoder/vp9_writer.h \ - vp9/encoder/x86/vp9_dct_sse2.h \ - vp9/vp9_iface_common.h \ - vpxenc.h \ - vpx/internal/vpx_codec_internal.h \ - vpx/internal/vpx_psnr.h \ - vpx_mem/include/vpx_mem_intrnl.h \ - vpx_mem/include/vpx_mem_tracker.h \ - vpx_mem/memory_manager/include/cavl_if.h \ - vpx_mem/memory_manager/include/cavl_impl.h \ - vpx_mem/memory_manager/include/heapmm.h \ - vpx_mem/memory_manager/include/hmm_cnfg.h \ - vpx_mem/memory_manager/include/hmm_intrnl.h \ - vpx_mem/vpx_mem.h \ - vpx_ports/arm.h \ - vpx_ports/config.h \ - vpx_ports/emmintrin_compat.h \ - vpx_ports/mem.h \ - vpx_ports/mem_ops_aligned.h \ - vpx_ports/mem_ops.h \ - vpx_ports/vpx_once.h \ - vpx_ports/vpx_timer.h \ - vpx_ports/x86.h \ - vpx_scale/vpx_scale.h \ - vpx_scale/yv12config.h \ - vpxstats.h \ - vpx/svc_context.h \ - vpx/vp8cx.h \ - vpx/vp8dx.h \ - vpx/vp8.h \ - vpx/vpx_codec.h \ - vpx/vpx_decoder.h \ - vpx/vpx_encoder.h \ - vpx/vpx_frame_buffer.h \ - vpx/vpx_image.h \ - vpx/vpx_integer.h \ - vpx_scale_rtcd.h \ - warnings.h \ - webmdec.h \ - webmenc.h \ - y4menc.h \ - y4minput.h \ - $(NULL) - -vpx_source_asm = \ - third_party/libyuv/source/row_x86.asm \ - third_party/libyuv/source/x86inc.asm \ - third_party/x86inc/x86inc.asm \ - vp8/common/arm/armv6/bilinearfilter_v6.asm \ - vp8/common/arm/armv6/copymem16x16_v6.asm \ - vp8/common/arm/armv6/copymem8x4_v6.asm \ - vp8/common/arm/armv6/copymem8x8_v6.asm \ - vp8/common/arm/armv6/dc_only_idct_add_v6.asm \ - vp8/common/arm/armv6/dequant_idct_v6.asm \ - vp8/common/arm/armv6/dequantize_v6.asm \ - vp8/common/arm/armv6/filter_v6.asm \ - vp8/common/arm/armv6/idct_v6.asm \ - vp8/common/arm/armv6/intra4x4_predict_v6.asm \ - vp8/common/arm/armv6/iwalsh_v6.asm \ - vp8/common/arm/armv6/loopfilter_v6.asm \ - vp8/common/arm/armv6/simpleloopfilter_v6.asm \ - vp8/common/arm/armv6/sixtappredict8x4_v6.asm \ - vp8/common/arm/armv6/vp8_sad16x16_armv6.asm \ - vp8/common/arm/armv6/vp8_variance16x16_armv6.asm \ - vp8/common/arm/armv6/vp8_variance8x8_armv6.asm \ - vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm \ - vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm \ - vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm \ - vp8/common/ppc/copy_altivec.asm \ - vp8/common/ppc/filter_altivec.asm \ - vp8/common/ppc/filter_bilinear_altivec.asm \ - vp8/common/ppc/idctllm_altivec.asm \ - vp8/common/ppc/loopfilter_filters_altivec.asm \ - vp8/common/ppc/platform_altivec.asm \ - vp8/common/ppc/recon_altivec.asm \ - vp8/common/ppc/sad_altivec.asm \ - vp8/common/ppc/variance_altivec.asm \ - vp8/common/ppc/variance_subpixel_altivec.asm \ - vp8/common/x86/dequantize_mmx.asm \ - vp8/common/x86/idctllm_mmx.asm \ - vp8/common/x86/idctllm_sse2.asm \ - vp8/common/x86/iwalsh_mmx.asm \ - vp8/common/x86/iwalsh_sse2.asm \ - vp8/common/x86/loopfilter_block_sse2_x86_64.asm \ - vp8/common/x86/loopfilter_mmx.asm \ - vp8/common/x86/loopfilter_sse2.asm \ - vp8/common/x86/mfqe_sse2.asm \ - vp8/common/x86/postproc_mmx.asm \ - vp8/common/x86/postproc_sse2.asm \ - vp8/common/x86/recon_mmx.asm \ - vp8/common/x86/recon_sse2.asm \ - vp8/common/x86/sad_mmx.asm \ - vp8/common/x86/sad_sse2.asm \ - vp8/common/x86/sad_sse3.asm \ - vp8/common/x86/sad_sse4.asm \ - vp8/common/x86/sad_ssse3.asm \ - vp8/common/x86/subpixel_mmx.asm \ - vp8/common/x86/subpixel_sse2.asm \ - vp8/common/x86/subpixel_ssse3.asm \ - vp8/common/x86/variance_impl_mmx.asm \ - vp8/common/x86/variance_impl_sse2.asm \ - vp8/common/x86/variance_impl_ssse3.asm \ - vp8/encoder/arm/armv6/vp8_mse16x16_armv6.asm \ - vp8/encoder/arm/armv6/vp8_short_fdct4x4_armv6.asm \ - vp8/encoder/arm/armv6/walsh_v6.asm \ - vp8/encoder/ppc/encodemb_altivec.asm \ - vp8/encoder/ppc/fdct_altivec.asm \ - vp8/encoder/ppc/rdopt_altivec.asm \ - vp8/encoder/x86/dct_mmx.asm \ - vp8/encoder/x86/dct_sse2.asm \ - vp8/encoder/x86/encodeopt.asm \ - vp8/encoder/x86/fwalsh_sse2.asm \ - vp8/encoder/x86/quantize_mmx.asm \ - vp8/encoder/x86/ssim_opt_x86_64.asm \ - vp8/encoder/x86/subtract_mmx.asm \ - vp8/encoder/x86/subtract_sse2.asm \ - vp8/encoder/x86/temporal_filter_apply_sse2.asm \ - vp9/common/arm/neon/vp9_avg_neon_asm.asm \ - vp9/common/arm/neon/vp9_convolve8_avg_neon_asm.asm \ - vp9/common/arm/neon/vp9_convolve8_neon_asm.asm \ - vp9/common/arm/neon/vp9_copy_neon_asm.asm \ - vp9/common/arm/neon/vp9_idct16x16_1_add_neon_asm.asm \ - vp9/common/arm/neon/vp9_idct16x16_add_neon_asm.asm \ - vp9/common/arm/neon/vp9_idct32x32_1_add_neon_asm.asm \ - vp9/common/arm/neon/vp9_idct32x32_add_neon_asm.asm \ - vp9/common/arm/neon/vp9_idct4x4_1_add_neon_asm.asm \ - vp9/common/arm/neon/vp9_idct4x4_add_neon_asm.asm \ - vp9/common/arm/neon/vp9_idct8x8_1_add_neon_asm.asm \ - vp9/common/arm/neon/vp9_idct8x8_add_neon_asm.asm \ - vp9/common/arm/neon/vp9_loopfilter_16_neon_asm.asm \ - vp9/common/arm/neon/vp9_loopfilter_4_neon_asm.asm \ - vp9/common/arm/neon/vp9_loopfilter_8_neon_asm.asm \ - vp9/common/arm/neon/vp9_mb_lpf_neon.asm \ - vp9/common/arm/neon/vp9_reconintra_neon_asm.asm \ - vp9/common/arm/neon/vp9_save_reg_neon.asm \ - vp9/common/x86/vp9_copy_sse2.asm \ - vp9/common/x86/vp9_high_intrapred_sse2.asm \ - vp9/common/x86/vp9_high_subpixel_8t_sse2.asm \ - vp9/common/x86/vp9_high_subpixel_bilinear_sse2.asm \ - vp9/common/x86/vp9_idct_ssse3_x86_64.asm \ - vp9/encoder/x86/vp9_sad4d_sse2.asm \ - vp9/encoder/x86/vp9_sad_sse2.asm \ - vp9/encoder/x86/vp9_sad_sse3.asm \ - vp9/encoder/x86/vp9_sad_sse4.asm \ - vp9/encoder/x86/vp9_sad_ssse3.asm \ - vp9/encoder/x86/vp9_ssim_opt_x86_64.asm \ - vp9/encoder/x86/vp9_subpel_variance.asm \ - vp9/encoder/x86/vp9_subtract_sse2.asm \ - vp9/encoder/x86/vp9_temporal_filter_apply_sse2.asm \ - vpx_ports/emms.asm \ - vpx_ports/x86_abi_support.asm \ - $(NULL) - - -# Files for packaging -vpx_sources = \ - $(vpx_srcdir)/AUTHORS \ - $(vpx_srcdir)/CHANGELOG \ - $(vpx_srcdir)/LICENSE \ - $(vpx_srcdir)/PATENTS \ - $(vpx_srcdir)/build/make/ads2armasm_ms.pl \ - $(vpx_srcdir)/build/make/ads2gas_apple.pl \ - $(vpx_srcdir)/build/make/ads2gas.pl \ - $(vpx_srcdir)/build/make/Android.mk \ - $(vpx_srcdir)/build/make/armlink_adapter.sh \ - $(vpx_srcdir)/build/make/configure.sh \ - $(vpx_srcdir)/build/make/gen_asm_deps.sh \ - $(vpx_srcdir)/build/make/gen_msvs_def.sh \ - $(vpx_srcdir)/build/make/gen_msvs_proj.sh \ - $(vpx_srcdir)/build/make/gen_msvs_sln.sh \ - $(vpx_srcdir)/build/make/gen_msvs_vcxproj.sh \ - $(vpx_srcdir)/build/make/iosbuild.sh \ - $(vpx_srcdir)/build/make/Makefile \ - $(vpx_srcdir)/build/make/msvs_common.sh \ - $(vpx_srcdir)/build/make/rtcd.pl \ - $(vpx_srcdir)/build/make/thumb.pm \ - $(vpx_srcdir)/build/make/version.sh \ - $(vpx_srcdir)/configure \ - $(vpx_source_mak:%.mk=$(vpx_srcdir)/%.mk) \ - $(vpx_source_c:%.c=$(vpx_srcdir)/%.c) \ - $(vpx_source_h:%.h=$(vpx_srcdir)/%.h) \ - $(NULL) - -EXTRA_DIST = \ - sources.frag \ - $(gst_vpx_source_h) \ - $(vpx_sources) \ - $(vpx_versions) \ - $(NULL) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/sources.frag $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ext/libvpx/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu ext/libvpx/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; -$(srcdir)/sources.frag $(am__empty): - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -libgstcodecparsers_vpx.la: $(libgstcodecparsers_vpx_la_OBJECTS) $(libgstcodecparsers_vpx_la_DEPENDENCIES) $(EXTRA_libgstcodecparsers_vpx_la_DEPENDENCIES) - $(AM_V_GEN)$(libgstcodecparsers_vpx_la_LINK) $(am_libgstcodecparsers_vpx_la_rpath) $(libgstcodecparsers_vpx_la_OBJECTS) $(libgstcodecparsers_vpx_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstcodecparsers_vpx_la-gstlibvpx.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -libgstcodecparsers_vpx_la-gstlibvpx.lo: gstlibvpx.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstcodecparsers_vpx_la_CFLAGS) $(CFLAGS) -MT libgstcodecparsers_vpx_la-gstlibvpx.lo -MD -MP -MF $(DEPDIR)/libgstcodecparsers_vpx_la-gstlibvpx.Tpo -c -o libgstcodecparsers_vpx_la-gstlibvpx.lo `test -f 'gstlibvpx.c' || echo '$(srcdir)/'`gstlibvpx.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstcodecparsers_vpx_la-gstlibvpx.Tpo $(DEPDIR)/libgstcodecparsers_vpx_la-gstlibvpx.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstlibvpx.c' object='libgstcodecparsers_vpx_la-gstlibvpx.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstcodecparsers_vpx_la_CFLAGS) $(CFLAGS) -c -o libgstcodecparsers_vpx_la-gstlibvpx.lo `test -f 'gstlibvpx.c' || echo '$(srcdir)/'`gstlibvpx.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" distdir="$(distdir)" \ - dist-hook -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(libdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-libLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic \ - maintainer-clean-local - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-libLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool clean-local cscopelist-am \ - ctags ctags-am dist-hook distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-libLTLIBRARIES \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - maintainer-clean-local mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES - -.PRECIOUS: Makefile - - -clean-local: vpx.clean -maintainer-clean-local: vpx.maintainer.clean - -vpx.build: vpx.configure.stamp - @$(MAKE) -C $(vpx_builddir) - -vpx.clean: - @[ -d $(vpx_builddir) ] && \ - $(MAKE) -C $(vpx_builddir) clean || : - rm -f vpx.configure.stamp - -vpx.maintainer.clean: vpx.clean - rm -rf $(vpx_builddir) - -vpx.configure.stamp: - @[ -d $(vpx_builddir) ] || mkdir $(vpx_builddir); \ - cd $(vpx_builddir) ; \ - test "$(VPX_DEBUG)" = "yes" && \ - CONFIGURE_FLAGS="$$CONFIGURE_FLAGS --enable-debug" ; \ - $(abs_srcdir)/$(vpx_upstream)/configure $$CONFIGURE_FLAGS \ - --enable-static \ - --enable-pic \ - --disable-shared \ - --$(VP8_DECODER)-vp8-decoder \ - --$(VP8_ENCODER)-vp8-encoder \ - --$(VP9_DECODER)-vp9-decoder \ - --$(VP9_ENCODER)-vp9-encoder \ - --enable-runtime-cpu-detect \ - --disable-examples \ - --disable-docs \ - --disable-unit-tests && \ - cd .. && \ - touch $@ - -$(gst_vpx_source_c): vpx.build - -# Avoid implicit rule that tries to compile .asm.o to .asm -dist-hook: - for f in $(vpx_source_asm); do \ - mkdir -p $(distdir)/$(vpx_upstream)/$$(dirname $$f); \ - cp -fpR $(vpx_srcdir)/$$f $(distdir)/$(vpx_upstream)/$$f; \ - done - --include $(top_srcdir)/git.mk - -# Tell version 3.79 and up of GNU make to not build goals in this -# directory in parallel. -.NOTPARALLEL: - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/sources.frag gstreamer-vaapi-1.8.2/ext/libvpx/sources.frag --- gstreamer-vaapi-0.7.0/ext/libvpx/sources.frag 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/sources.frag 1970-01-01 00:00:00.000000000 +0000 @@ -1,717 +0,0 @@ -# sources.frag - Generated list of source files for libvpx (-*- makefile -*-) -# -# Copyright (C) 2014 Intel Corporation -# Author: Gwenole Beauchesne -# -# 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; if not, write to the -# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, -# Boston, MA 02110-1301, USA. - -vpx_source_mak = \ - build/make/Android.mk \ - docs.mk \ - examples.mk \ - libs.mk \ - solution.mk \ - test/android/Android.mk \ - test/test-data.mk \ - test/test.mk \ - third_party/googletest/gtest.mk \ - third_party/libwebm/Android.mk \ - vp8/vp8_common.mk \ - vp8/vp8cx_arm.mk \ - vp8/vp8cx.mk \ - vp8/vp8dx.mk \ - vp9/vp9_common.mk \ - vp9/vp9cx.mk \ - vp9/vp9dx.mk \ - vpx_mem/vpx_mem.mk \ - vpx_ports/vpx_ports.mk \ - vpx_scale/vpx_scale.mk \ - vpx/vpx_codec.mk \ - $(NULL) - -vpx_source_c = \ - args.c \ - examples/decode_to_md5.c \ - examples/decode_with_drops.c \ - examples/postproc.c \ - examples/resize_util.c \ - examples/set_maps.c \ - examples/simple_decoder.c \ - examples/simple_encoder.c \ - examples/twopass_encoder.c \ - examples/vp8cx_set_ref.c \ - examples/vp8_multi_resolution_encoder.c \ - examples/vp9_lossless_encoder.c \ - examples/vp9_spatial_svc_encoder.c \ - examples/vpx_temporal_svc_encoder.c \ - ivfdec.c \ - ivfenc.c \ - md5_utils.c \ - rate_hist.c \ - tools_common.c \ - video_reader.c \ - video_writer.c \ - vp8/common/alloccommon.c \ - vp8/common/arm/armv6/idct_blk_v6.c \ - vp8/common/arm/bilinearfilter_arm.c \ - vp8/common/arm/dequantize_arm.c \ - vp8/common/arm/filter_arm.c \ - vp8/common/arm/loopfilter_arm.c \ - vp8/common/arm/neon/bilinearpredict_neon.c \ - vp8/common/arm/neon/copymem_neon.c \ - vp8/common/arm/neon/dc_only_idct_add_neon.c \ - vp8/common/arm/neon/dequant_idct_neon.c \ - vp8/common/arm/neon/dequantizeb_neon.c \ - vp8/common/arm/neon/idct_blk_neon.c \ - vp8/common/arm/neon/idct_dequant_0_2x_neon.c \ - vp8/common/arm/neon/idct_dequant_full_2x_neon.c \ - vp8/common/arm/neon/iwalsh_neon.c \ - vp8/common/arm/neon/loopfilter_neon.c \ - vp8/common/arm/neon/loopfiltersimplehorizontaledge_neon.c \ - vp8/common/arm/neon/loopfiltersimpleverticaledge_neon.c \ - vp8/common/arm/neon/mbloopfilter_neon.c \ - vp8/common/arm/neon/reconintra_neon.c \ - vp8/common/arm/neon/sad_neon.c \ - vp8/common/arm/neon/shortidct4x4llm_neon.c \ - vp8/common/arm/neon/sixtappredict_neon.c \ - vp8/common/arm/neon/variance_neon.c \ - vp8/common/arm/neon/vp8_subpixelvariance_neon.c \ - vp8/common/arm/variance_arm.c \ - vp8/common/blockd.c \ - vp8/common/context.c \ - vp8/common/debugmodes.c \ - vp8/common/dequantize.c \ - vp8/common/entropy.c \ - vp8/common/entropymode.c \ - vp8/common/entropymv.c \ - vp8/common/extend.c \ - vp8/common/filter.c \ - vp8/common/findnearmv.c \ - vp8/common/generic/systemdependent.c \ - vp8/common/idct_blk.c \ - vp8/common/idctllm.c \ - vp8/common/loopfilter.c \ - vp8/common/loopfilter_filters.c \ - vp8/common/mbpitch.c \ - vp8/common/mfqe.c \ - vp8/common/mips/dspr2/dequantize_dspr2.c \ - vp8/common/mips/dspr2/filter_dspr2.c \ - vp8/common/mips/dspr2/idct_blk_dspr2.c \ - vp8/common/mips/dspr2/idctllm_dspr2.c \ - vp8/common/mips/dspr2/loopfilter_filters_dspr2.c \ - vp8/common/mips/dspr2/reconinter_dspr2.c \ - vp8/common/modecont.c \ - vp8/common/postproc.c \ - vp8/common/ppc/loopfilter_altivec.c \ - vp8/common/ppc/systemdependent.c \ - vp8/common/quant_common.c \ - vp8/common/reconinter.c \ - vp8/common/reconintra4x4.c \ - vp8/common/reconintra.c \ - vp8/common/rtcd.c \ - vp8/common/sad_c.c \ - vp8/common/setupintrarecon.c \ - vp8/common/swapyv12buffer.c \ - vp8/common/textblit.c \ - vp8/common/treecoder.c \ - vp8/common/variance_c.c \ - vp8/common/x86/filter_x86.c \ - vp8/common/x86/idct_blk_mmx.c \ - vp8/common/x86/idct_blk_sse2.c \ - vp8/common/x86/loopfilter_x86.c \ - vp8/common/x86/recon_wrapper_sse2.c \ - vp8/common/x86/variance_mmx.c \ - vp8/common/x86/variance_sse2.c \ - vp8/common/x86/variance_ssse3.c \ - vp8/common/x86/vp8_asm_stubs.c \ - vp8/decoder/dboolhuff.c \ - vp8/decoder/decodeframe.c \ - vp8/decoder/decodemv.c \ - vp8/decoder/detokenize.c \ - vp8/decoder/error_concealment.c \ - vp8/decoder/onyxd_if.c \ - vp8/decoder/threading.c \ - vp8/encoder/arm/dct_arm.c \ - vp8/encoder/arm/neon/denoising_neon.c \ - vp8/encoder/arm/neon/fastquantizeb_neon.c \ - vp8/encoder/arm/neon/shortfdct_neon.c \ - vp8/encoder/arm/neon/subtract_neon.c \ - vp8/encoder/arm/neon/vp8_mse16x16_neon.c \ - vp8/encoder/arm/neon/vp8_shortwalsh4x4_neon.c \ - vp8/encoder/bitstream.c \ - vp8/encoder/boolhuff.c \ - vp8/encoder/dct.c \ - vp8/encoder/denoising.c \ - vp8/encoder/encodeframe.c \ - vp8/encoder/encodeintra.c \ - vp8/encoder/encodemb.c \ - vp8/encoder/encodemv.c \ - vp8/encoder/ethreading.c \ - vp8/encoder/firstpass.c \ - vp8/encoder/lookahead.c \ - vp8/encoder/mcomp.c \ - vp8/encoder/modecosts.c \ - vp8/encoder/mr_dissim.c \ - vp8/encoder/onyx_if.c \ - vp8/encoder/pickinter.c \ - vp8/encoder/picklpf.c \ - vp8/encoder/ppc/csystemdependent.c \ - vp8/encoder/quantize.c \ - vp8/encoder/ratectrl.c \ - vp8/encoder/rdopt.c \ - vp8/encoder/segmentation.c \ - vp8/encoder/ssim.c \ - vp8/encoder/temporal_filter.c \ - vp8/encoder/tokenize.c \ - vp8/encoder/treewriter.c \ - vp8/encoder/x86/denoising_sse2.c \ - vp8/encoder/x86/quantize_sse2.c \ - vp8/encoder/x86/quantize_sse4.c \ - vp8/encoder/x86/quantize_ssse3.c \ - vp8/encoder/x86/vp8_enc_stubs_mmx.c \ - vp8/encoder/x86/vp8_enc_stubs_sse2.c \ - vp8/vp8_cx_iface.c \ - vp8/vp8_dx_iface.c \ - vp9/common/arm/neon/vp9_avg_neon.c \ - vp9/common/arm/neon/vp9_convolve8_avg_neon.c \ - vp9/common/arm/neon/vp9_convolve8_neon.c \ - vp9/common/arm/neon/vp9_convolve_neon.c \ - vp9/common/arm/neon/vp9_copy_neon.c \ - vp9/common/arm/neon/vp9_idct16x16_1_add_neon.c \ - vp9/common/arm/neon/vp9_idct16x16_add_neon.c \ - vp9/common/arm/neon/vp9_idct16x16_neon.c \ - vp9/common/arm/neon/vp9_idct32x32_1_add_neon.c \ - vp9/common/arm/neon/vp9_idct32x32_add_neon.c \ - vp9/common/arm/neon/vp9_idct4x4_1_add_neon.c \ - vp9/common/arm/neon/vp9_idct4x4_add_neon.c \ - vp9/common/arm/neon/vp9_idct8x8_1_add_neon.c \ - vp9/common/arm/neon/vp9_idct8x8_add_neon.c \ - vp9/common/arm/neon/vp9_iht4x4_add_neon.c \ - vp9/common/arm/neon/vp9_iht8x8_add_neon.c \ - vp9/common/arm/neon/vp9_loopfilter_16_neon.c \ - vp9/common/arm/neon/vp9_loopfilter_4_neon.c \ - vp9/common/arm/neon/vp9_loopfilter_8_neon.c \ - vp9/common/arm/neon/vp9_loopfilter_neon.c \ - vp9/common/arm/neon/vp9_reconintra_neon.c \ - vp9/common/mips/dspr2/vp9_convolve2_avg_dspr2.c \ - vp9/common/mips/dspr2/vp9_convolve2_avg_horiz_dspr2.c \ - vp9/common/mips/dspr2/vp9_convolve2_dspr2.c \ - vp9/common/mips/dspr2/vp9_convolve2_horiz_dspr2.c \ - vp9/common/mips/dspr2/vp9_convolve2_vert_dspr2.c \ - vp9/common/mips/dspr2/vp9_convolve8_avg_dspr2.c \ - vp9/common/mips/dspr2/vp9_convolve8_avg_horiz_dspr2.c \ - vp9/common/mips/dspr2/vp9_convolve8_dspr2.c \ - vp9/common/mips/dspr2/vp9_convolve8_horiz_dspr2.c \ - vp9/common/mips/dspr2/vp9_convolve8_vert_dspr2.c \ - vp9/common/mips/dspr2/vp9_intrapred16_dspr2.c \ - vp9/common/mips/dspr2/vp9_intrapred4_dspr2.c \ - vp9/common/mips/dspr2/vp9_intrapred8_dspr2.c \ - vp9/common/mips/dspr2/vp9_itrans16_dspr2.c \ - vp9/common/mips/dspr2/vp9_itrans32_cols_dspr2.c \ - vp9/common/mips/dspr2/vp9_itrans32_dspr2.c \ - vp9/common/mips/dspr2/vp9_itrans4_dspr2.c \ - vp9/common/mips/dspr2/vp9_itrans8_dspr2.c \ - vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.c \ - vp9/common/mips/dspr2/vp9_mbloop_loopfilter_dspr2.c \ - vp9/common/mips/dspr2/vp9_mblpf_horiz_loopfilter_dspr2.c \ - vp9/common/mips/dspr2/vp9_mblpf_vert_loopfilter_dspr2.c \ - vp9/common/vp9_alloccommon.c \ - vp9/common/vp9_blockd.c \ - vp9/common/vp9_common_data.c \ - vp9/common/vp9_convolve.c \ - vp9/common/vp9_debugmodes.c \ - vp9/common/vp9_entropy.c \ - vp9/common/vp9_entropymode.c \ - vp9/common/vp9_entropymv.c \ - vp9/common/vp9_filter.c \ - vp9/common/vp9_frame_buffers.c \ - vp9/common/vp9_idct.c \ - vp9/common/vp9_loopfilter.c \ - vp9/common/vp9_loopfilter_filters.c \ - vp9/common/vp9_mfqe.c \ - vp9/common/vp9_mvref_common.c \ - vp9/common/vp9_postproc.c \ - vp9/common/vp9_pred_common.c \ - vp9/common/vp9_prob.c \ - vp9/common/vp9_quant_common.c \ - vp9/common/vp9_reconinter.c \ - vp9/common/vp9_reconintra.c \ - vp9/common/vp9_rtcd.c \ - vp9/common/vp9_scale.c \ - vp9/common/vp9_scan.c \ - vp9/common/vp9_seg_common.c \ - vp9/common/vp9_textblit.c \ - vp9/common/vp9_thread.c \ - vp9/common/vp9_thread_common.c \ - vp9/common/vp9_tile_common.c \ - vp9/common/x86/vp9_asm_stubs.c \ - vp9/common/x86/vp9_high_loopfilter_intrin_sse2.c \ - vp9/common/x86/vp9_idct_intrin_sse2.c \ - vp9/common/x86/vp9_idct_intrin_ssse3.c \ - vp9/common/x86/vp9_loopfilter_intrin_avx2.c \ - vp9/common/x86/vp9_loopfilter_intrin_sse2.c \ - vp9/common/x86/vp9_subpixel_8t_intrin_avx2.c \ - vp9/common/x86/vp9_subpixel_8t_intrin_ssse3.c \ - vp9/decoder/vp9_decodeframe.c \ - vp9/decoder/vp9_decodemv.c \ - vp9/decoder/vp9_decoder.c \ - vp9/decoder/vp9_detokenize.c \ - vp9/decoder/vp9_dsubexp.c \ - vp9/decoder/vp9_dthread.c \ - vp9/decoder/vp9_read_bit_buffer.c \ - vp9/decoder/vp9_reader.c \ - vp9/encoder/arm/neon/vp9_avg_neon.c \ - vp9/encoder/arm/neon/vp9_dct_neon.c \ - vp9/encoder/arm/neon/vp9_quantize_neon.c \ - vp9/encoder/arm/neon/vp9_sad4d_neon.c \ - vp9/encoder/arm/neon/vp9_sad_neon.c \ - vp9/encoder/arm/neon/vp9_subtract_neon.c \ - vp9/encoder/arm/neon/vp9_variance_neon.c \ - vp9/encoder/vp9_aq_complexity.c \ - vp9/encoder/vp9_aq_cyclicrefresh.c \ - vp9/encoder/vp9_aq_variance.c \ - vp9/encoder/vp9_avg.c \ - vp9/encoder/vp9_bitstream.c \ - vp9/encoder/vp9_context_tree.c \ - vp9/encoder/vp9_cost.c \ - vp9/encoder/vp9_dct.c \ - vp9/encoder/vp9_denoiser.c \ - vp9/encoder/vp9_encodeframe.c \ - vp9/encoder/vp9_encodemb.c \ - vp9/encoder/vp9_encodemv.c \ - vp9/encoder/vp9_encoder.c \ - vp9/encoder/vp9_ethread.c \ - vp9/encoder/vp9_extend.c \ - vp9/encoder/vp9_firstpass.c \ - vp9/encoder/vp9_lookahead.c \ - vp9/encoder/vp9_mbgraph.c \ - vp9/encoder/vp9_mcomp.c \ - vp9/encoder/vp9_picklpf.c \ - vp9/encoder/vp9_pickmode.c \ - vp9/encoder/vp9_quantize.c \ - vp9/encoder/vp9_ratectrl.c \ - vp9/encoder/vp9_rd.c \ - vp9/encoder/vp9_rdopt.c \ - vp9/encoder/vp9_resize.c \ - vp9/encoder/vp9_sad.c \ - vp9/encoder/vp9_segmentation.c \ - vp9/encoder/vp9_skin_detection.c \ - vp9/encoder/vp9_speed_features.c \ - vp9/encoder/vp9_ssim.c \ - vp9/encoder/vp9_subexp.c \ - vp9/encoder/vp9_svc_layercontext.c \ - vp9/encoder/vp9_temporal_filter.c \ - vp9/encoder/vp9_tokenize.c \ - vp9/encoder/vp9_treewriter.c \ - vp9/encoder/vp9_variance.c \ - vp9/encoder/vp9_write_bit_buffer.c \ - vp9/encoder/vp9_writer.c \ - vp9/encoder/x86/vp9_avg_intrin_sse2.c \ - vp9/encoder/x86/vp9_dct32x32_avx2.c \ - vp9/encoder/x86/vp9_dct32x32_sse2.c \ - vp9/encoder/x86/vp9_dct_avx2.c \ - vp9/encoder/x86/vp9_dct_impl_sse2.c \ - vp9/encoder/x86/vp9_dct_sse2.c \ - vp9/encoder/x86/vp9_dct_ssse3.c \ - vp9/encoder/x86/vp9_denoiser_sse2.c \ - vp9/encoder/x86/vp9_error_intrin_avx2.c \ - vp9/encoder/x86/vp9_highbd_block_error_intrin_sse2.c \ - vp9/encoder/x86/vp9_highbd_quantize_intrin_sse2.c \ - vp9/encoder/x86/vp9_highbd_variance_sse2.c \ - vp9/encoder/x86/vp9_quantize_sse2.c \ - vp9/encoder/x86/vp9_sad4d_intrin_avx2.c \ - vp9/encoder/x86/vp9_sad_intrin_avx2.c \ - vp9/encoder/x86/vp9_subpel_variance_impl_intrin_avx2.c \ - vp9/encoder/x86/vp9_variance_avx2.c \ - vp9/encoder/x86/vp9_variance_impl_intrin_avx2.c \ - vp9/encoder/x86/vp9_variance_sse2.c \ - vp9/vp9_cx_iface.c \ - vp9/vp9_dx_iface.c \ - vpxdec.c \ - vpxenc.c \ - vpx_mem/memory_manager/hmm_alloc.c \ - vpx_mem/memory_manager/hmm_base.c \ - vpx_mem/memory_manager/hmm_dflt_abort.c \ - vpx_mem/memory_manager/hmm_grow.c \ - vpx_mem/memory_manager/hmm_largest.c \ - vpx_mem/memory_manager/hmm_resize.c \ - vpx_mem/memory_manager/hmm_shrink.c \ - vpx_mem/memory_manager/hmm_true.c \ - vpx_mem/vpx_mem.c \ - vpx_mem/vpx_mem_tracker.c \ - vpx_ports/arm_cpudetect.c \ - vpx_scale/generic/gen_scalers.c \ - vpx_scale/generic/vpx_scale.c \ - vpx_scale/generic/yv12config.c \ - vpx_scale/generic/yv12extend.c \ - vpx_scale/mips/dspr2/yv12extend_dspr2.c \ - vpx_scale/vpx_scale_rtcd.c \ - vpx_scale/win32/scaleopt.c \ - vpx/src/svc_encodeframe.c \ - vpx/src/vpx_codec.c \ - vpx/src/vpx_decoder.c \ - vpx/src/vpx_encoder.c \ - vpx/src/vpx_image.c \ - vpx/src/vpx_psnr.c \ - vpxstats.c \ - warnings.c \ - y4menc.c \ - y4minput.c \ - $(NULL) - -vpx_source_h = \ - args.h \ - ivfdec.h \ - ivfenc.h \ - md5_utils.h \ - rate_hist.h \ - vp8_rtcd.h \ - test/acm_random.h \ - test/clear_system_state.h \ - test/codec_factory.h \ - test/decode_test_driver.h \ - test/encode_test_driver.h \ - test/i420_video_source.h \ - test/ivf_video_source.h \ - test/md5_helper.h \ - test/register_state_check.h \ - test/test_vectors.h \ - test/util.h \ - test/video_source.h \ - test/webm_video_source.h \ - test/y4m_video_source.h \ - test/yuv_video_source.h \ - third_party/googletest/src/include/gtest/gtest.h \ - third_party/libyuv/include/libyuv/basic_types.h \ - third_party/libyuv/include/libyuv/compare.h \ - third_party/libyuv/include/libyuv/convert_argb.h \ - third_party/libyuv/include/libyuv/convert_from_argb.h \ - third_party/libyuv/include/libyuv/convert_from.h \ - third_party/libyuv/include/libyuv/convert.h \ - third_party/libyuv/include/libyuv/cpu_id.h \ - third_party/libyuv/include/libyuv/mjpeg_decoder.h \ - third_party/libyuv/include/libyuv/planar_functions.h \ - third_party/libyuv/include/libyuv/rotate_argb.h \ - third_party/libyuv/include/libyuv/rotate.h \ - third_party/libyuv/include/libyuv/row.h \ - third_party/libyuv/include/libyuv/scale_argb.h \ - third_party/libyuv/include/libyuv/scale.h \ - third_party/libyuv/include/libyuv/scale_row.h \ - third_party/libyuv/include/libyuv/version.h \ - third_party/libyuv/include/libyuv/video_common.h \ - tools_common.h \ - video_common.h \ - video_reader.h \ - video_writer.h \ - vp8/common/alloccommon.h \ - vp8/common/arm/bilinearfilter_arm.h \ - vp8/common/blockd.h \ - vp8/common/coefupdateprobs.h \ - vp8/common/common.h \ - vp8/common/default_coef_probs.h \ - vp8/common/entropy.h \ - vp8/common/entropymode.h \ - vp8/common/entropymv.h \ - vp8/common/extend.h \ - vp8/common/filter.h \ - vp8/common/findnearmv.h \ - vp8/common/header.h \ - vp8/common/invtrans.h \ - vp8/common/loopfilter.h \ - vp8/common/modecont.h \ - vp8/common/mv.h \ - vp8/common/onyxc_int.h \ - vp8/common/onyxd.h \ - vp8/common/onyx.h \ - vp8/common/postproc.h \ - vp8/common/ppflags.h \ - vp8/common/quant_common.h \ - vp8/common/reconinter.h \ - vp8/common/reconintra4x4.h \ - vp8/common/setupintrarecon.h \ - vp8/common/swapyv12buffer.h \ - vp8/common/systemdependent.h \ - vp8/common/threading.h \ - vp8/common/treecoder.h \ - vp8/common/variance.h \ - vp8/common/vp8_entropymodedata.h \ - vp8/common/x86/filter_x86.h \ - vp8/decoder/dboolhuff.h \ - vp8/decoder/decodemv.h \ - vp8/decoder/decoderthreading.h \ - vp8/decoder/detokenize.h \ - vp8/decoder/ec_types.h \ - vp8/decoder/error_concealment.h \ - vp8/decoder/onyxd_int.h \ - vp8/decoder/treereader.h \ - vp8/encoder/bitstream.h \ - vp8/encoder/block.h \ - vp8/encoder/boolhuff.h \ - vp8/encoder/dct_value_cost.h \ - vp8/encoder/dct_value_tokens.h \ - vp8/encoder/defaultcoefcounts.h \ - vp8/encoder/denoising.h \ - vp8/encoder/encodeframe.h \ - vp8/encoder/encodeintra.h \ - vp8/encoder/encodemb.h \ - vp8/encoder/encodemv.h \ - vp8/encoder/firstpass.h \ - vp8/encoder/lookahead.h \ - vp8/encoder/mcomp.h \ - vp8/encoder/modecosts.h \ - vp8/encoder/mr_dissim.h \ - vp8/encoder/onyx_int.h \ - vp8/encoder/pickinter.h \ - vp8/encoder/quantize.h \ - vp8/encoder/ratectrl.h \ - vp8/encoder/rdopt.h \ - vp8/encoder/segmentation.h \ - vp8/encoder/tokenize.h \ - vp8/encoder/treewriter.h \ - vp9/common/mips/dspr2/vp9_common_dspr2.h \ - vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.h \ - vp9/common/mips/dspr2/vp9_loopfilter_macros_dspr2.h \ - vp9/common/mips/dspr2/vp9_loopfilter_masks_dspr2.h \ - vp9/common/vp9_alloccommon.h \ - vp9/common/vp9_blockd.h \ - vp9/common/vp9_common_data.h \ - vp9/common/vp9_common.h \ - vp9/common/vp9_convolve.h \ - vp9/common/vp9_entropy.h \ - vp9/common/vp9_entropymode.h \ - vp9/common/vp9_entropymv.h \ - vp9/common/vp9_enums.h \ - vp9/common/vp9_filter.h \ - vp9/common/vp9_frame_buffers.h \ - vp9/common/vp9_idct.h \ - vp9/common/vp9_loopfilter.h \ - vp9/common/vp9_mfqe.h \ - vp9/common/vp9_mv.h \ - vp9/common/vp9_mvref_common.h \ - vp9/common/vp9_onyxc_int.h \ - vp9/common/vp9_postproc.h \ - vp9/common/vp9_ppflags.h \ - vp9/common/vp9_pred_common.h \ - vp9/common/vp9_prob.h \ - vp9/common/vp9_quant_common.h \ - vp9/common/vp9_reconinter.h \ - vp9/common/vp9_reconintra.h \ - vp9/common/vp9_scale.h \ - vp9/common/vp9_scan.h \ - vp9/common/vp9_seg_common.h \ - vp9/common/vp9_systemdependent.h \ - vp9/common/vp9_textblit.h \ - vp9/common/vp9_thread_common.h \ - vp9/common/vp9_thread.h \ - vp9/common/vp9_tile_common.h \ - vp9/common/x86/vp9_idct_intrin_sse2.h \ - vp9/decoder/vp9_decodeframe.h \ - vp9/decoder/vp9_decodemv.h \ - vp9/decoder/vp9_decoder.h \ - vp9/decoder/vp9_detokenize.h \ - vp9/decoder/vp9_dsubexp.h \ - vp9/decoder/vp9_dthread.h \ - vp9/decoder/vp9_read_bit_buffer.h \ - vp9/decoder/vp9_reader.h \ - vp9/encoder/vp9_aq_complexity.h \ - vp9/encoder/vp9_aq_cyclicrefresh.h \ - vp9/encoder/vp9_aq_variance.h \ - vp9/encoder/vp9_bitstream.h \ - vp9/encoder/vp9_block.h \ - vp9/encoder/vp9_context_tree.h \ - vp9/encoder/vp9_cost.h \ - vp9/encoder/vp9_dct.h \ - vp9/encoder/vp9_denoiser.h \ - vp9/encoder/vp9_encodeframe.h \ - vp9/encoder/vp9_encodemb.h \ - vp9/encoder/vp9_encodemv.h \ - vp9/encoder/vp9_encoder.h \ - vp9/encoder/vp9_ethread.h \ - vp9/encoder/vp9_extend.h \ - vp9/encoder/vp9_firstpass.h \ - vp9/encoder/vp9_lookahead.h \ - vp9/encoder/vp9_mbgraph.h \ - vp9/encoder/vp9_mcomp.h \ - vp9/encoder/vp9_picklpf.h \ - vp9/encoder/vp9_pickmode.h \ - vp9/encoder/vp9_quantize.h \ - vp9/encoder/vp9_ratectrl.h \ - vp9/encoder/vp9_rd.h \ - vp9/encoder/vp9_rdopt.h \ - vp9/encoder/vp9_resize.h \ - vp9/encoder/vp9_segmentation.h \ - vp9/encoder/vp9_skin_detection.h \ - vp9/encoder/vp9_speed_features.h \ - vp9/encoder/vp9_ssim.h \ - vp9/encoder/vp9_subexp.h \ - vp9/encoder/vp9_svc_layercontext.h \ - vp9/encoder/vp9_temporal_filter.h \ - vp9/encoder/vp9_tokenize.h \ - vp9/encoder/vp9_treewriter.h \ - vp9/encoder/vp9_variance.h \ - vp9/encoder/vp9_write_bit_buffer.h \ - vp9/encoder/vp9_writer.h \ - vp9/encoder/x86/vp9_dct_sse2.h \ - vp9/vp9_iface_common.h \ - vpxenc.h \ - vpx/internal/vpx_codec_internal.h \ - vpx/internal/vpx_psnr.h \ - vpx_mem/include/vpx_mem_intrnl.h \ - vpx_mem/include/vpx_mem_tracker.h \ - vpx_mem/memory_manager/include/cavl_if.h \ - vpx_mem/memory_manager/include/cavl_impl.h \ - vpx_mem/memory_manager/include/heapmm.h \ - vpx_mem/memory_manager/include/hmm_cnfg.h \ - vpx_mem/memory_manager/include/hmm_intrnl.h \ - vpx_mem/vpx_mem.h \ - vpx_ports/arm.h \ - vpx_ports/config.h \ - vpx_ports/emmintrin_compat.h \ - vpx_ports/mem.h \ - vpx_ports/mem_ops_aligned.h \ - vpx_ports/mem_ops.h \ - vpx_ports/vpx_once.h \ - vpx_ports/vpx_timer.h \ - vpx_ports/x86.h \ - vpx_scale/vpx_scale.h \ - vpx_scale/yv12config.h \ - vpxstats.h \ - vpx/svc_context.h \ - vpx/vp8cx.h \ - vpx/vp8dx.h \ - vpx/vp8.h \ - vpx/vpx_codec.h \ - vpx/vpx_decoder.h \ - vpx/vpx_encoder.h \ - vpx/vpx_frame_buffer.h \ - vpx/vpx_image.h \ - vpx/vpx_integer.h \ - vpx_scale_rtcd.h \ - warnings.h \ - webmdec.h \ - webmenc.h \ - y4menc.h \ - y4minput.h \ - $(NULL) - -vpx_source_asm = \ - third_party/libyuv/source/row_x86.asm \ - third_party/libyuv/source/x86inc.asm \ - third_party/x86inc/x86inc.asm \ - vp8/common/arm/armv6/bilinearfilter_v6.asm \ - vp8/common/arm/armv6/copymem16x16_v6.asm \ - vp8/common/arm/armv6/copymem8x4_v6.asm \ - vp8/common/arm/armv6/copymem8x8_v6.asm \ - vp8/common/arm/armv6/dc_only_idct_add_v6.asm \ - vp8/common/arm/armv6/dequant_idct_v6.asm \ - vp8/common/arm/armv6/dequantize_v6.asm \ - vp8/common/arm/armv6/filter_v6.asm \ - vp8/common/arm/armv6/idct_v6.asm \ - vp8/common/arm/armv6/intra4x4_predict_v6.asm \ - vp8/common/arm/armv6/iwalsh_v6.asm \ - vp8/common/arm/armv6/loopfilter_v6.asm \ - vp8/common/arm/armv6/simpleloopfilter_v6.asm \ - vp8/common/arm/armv6/sixtappredict8x4_v6.asm \ - vp8/common/arm/armv6/vp8_sad16x16_armv6.asm \ - vp8/common/arm/armv6/vp8_variance16x16_armv6.asm \ - vp8/common/arm/armv6/vp8_variance8x8_armv6.asm \ - vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm \ - vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm \ - vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm \ - vp8/common/ppc/copy_altivec.asm \ - vp8/common/ppc/filter_altivec.asm \ - vp8/common/ppc/filter_bilinear_altivec.asm \ - vp8/common/ppc/idctllm_altivec.asm \ - vp8/common/ppc/loopfilter_filters_altivec.asm \ - vp8/common/ppc/platform_altivec.asm \ - vp8/common/ppc/recon_altivec.asm \ - vp8/common/ppc/sad_altivec.asm \ - vp8/common/ppc/variance_altivec.asm \ - vp8/common/ppc/variance_subpixel_altivec.asm \ - vp8/common/x86/dequantize_mmx.asm \ - vp8/common/x86/idctllm_mmx.asm \ - vp8/common/x86/idctllm_sse2.asm \ - vp8/common/x86/iwalsh_mmx.asm \ - vp8/common/x86/iwalsh_sse2.asm \ - vp8/common/x86/loopfilter_block_sse2_x86_64.asm \ - vp8/common/x86/loopfilter_mmx.asm \ - vp8/common/x86/loopfilter_sse2.asm \ - vp8/common/x86/mfqe_sse2.asm \ - vp8/common/x86/postproc_mmx.asm \ - vp8/common/x86/postproc_sse2.asm \ - vp8/common/x86/recon_mmx.asm \ - vp8/common/x86/recon_sse2.asm \ - vp8/common/x86/sad_mmx.asm \ - vp8/common/x86/sad_sse2.asm \ - vp8/common/x86/sad_sse3.asm \ - vp8/common/x86/sad_sse4.asm \ - vp8/common/x86/sad_ssse3.asm \ - vp8/common/x86/subpixel_mmx.asm \ - vp8/common/x86/subpixel_sse2.asm \ - vp8/common/x86/subpixel_ssse3.asm \ - vp8/common/x86/variance_impl_mmx.asm \ - vp8/common/x86/variance_impl_sse2.asm \ - vp8/common/x86/variance_impl_ssse3.asm \ - vp8/encoder/arm/armv6/vp8_mse16x16_armv6.asm \ - vp8/encoder/arm/armv6/vp8_short_fdct4x4_armv6.asm \ - vp8/encoder/arm/armv6/walsh_v6.asm \ - vp8/encoder/ppc/encodemb_altivec.asm \ - vp8/encoder/ppc/fdct_altivec.asm \ - vp8/encoder/ppc/rdopt_altivec.asm \ - vp8/encoder/x86/dct_mmx.asm \ - vp8/encoder/x86/dct_sse2.asm \ - vp8/encoder/x86/encodeopt.asm \ - vp8/encoder/x86/fwalsh_sse2.asm \ - vp8/encoder/x86/quantize_mmx.asm \ - vp8/encoder/x86/ssim_opt_x86_64.asm \ - vp8/encoder/x86/subtract_mmx.asm \ - vp8/encoder/x86/subtract_sse2.asm \ - vp8/encoder/x86/temporal_filter_apply_sse2.asm \ - vp9/common/arm/neon/vp9_avg_neon_asm.asm \ - vp9/common/arm/neon/vp9_convolve8_avg_neon_asm.asm \ - vp9/common/arm/neon/vp9_convolve8_neon_asm.asm \ - vp9/common/arm/neon/vp9_copy_neon_asm.asm \ - vp9/common/arm/neon/vp9_idct16x16_1_add_neon_asm.asm \ - vp9/common/arm/neon/vp9_idct16x16_add_neon_asm.asm \ - vp9/common/arm/neon/vp9_idct32x32_1_add_neon_asm.asm \ - vp9/common/arm/neon/vp9_idct32x32_add_neon_asm.asm \ - vp9/common/arm/neon/vp9_idct4x4_1_add_neon_asm.asm \ - vp9/common/arm/neon/vp9_idct4x4_add_neon_asm.asm \ - vp9/common/arm/neon/vp9_idct8x8_1_add_neon_asm.asm \ - vp9/common/arm/neon/vp9_idct8x8_add_neon_asm.asm \ - vp9/common/arm/neon/vp9_loopfilter_16_neon_asm.asm \ - vp9/common/arm/neon/vp9_loopfilter_4_neon_asm.asm \ - vp9/common/arm/neon/vp9_loopfilter_8_neon_asm.asm \ - vp9/common/arm/neon/vp9_mb_lpf_neon.asm \ - vp9/common/arm/neon/vp9_reconintra_neon_asm.asm \ - vp9/common/arm/neon/vp9_save_reg_neon.asm \ - vp9/common/x86/vp9_copy_sse2.asm \ - vp9/common/x86/vp9_high_intrapred_sse2.asm \ - vp9/common/x86/vp9_high_subpixel_8t_sse2.asm \ - vp9/common/x86/vp9_high_subpixel_bilinear_sse2.asm \ - vp9/common/x86/vp9_idct_ssse3_x86_64.asm \ - vp9/encoder/x86/vp9_sad4d_sse2.asm \ - vp9/encoder/x86/vp9_sad_sse2.asm \ - vp9/encoder/x86/vp9_sad_sse3.asm \ - vp9/encoder/x86/vp9_sad_sse4.asm \ - vp9/encoder/x86/vp9_sad_ssse3.asm \ - vp9/encoder/x86/vp9_ssim_opt_x86_64.asm \ - vp9/encoder/x86/vp9_subpel_variance.asm \ - vp9/encoder/x86/vp9_subtract_sse2.asm \ - vp9/encoder/x86/vp9_temporal_filter_apply_sse2.asm \ - vpx_ports/emms.asm \ - vpx_ports/x86_abi_support.asm \ - $(NULL) diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/args.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/args.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/args.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/args.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,238 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include -#include -#include -#include "args.h" - -#ifdef _MSC_VER -#define snprintf _snprintf -#endif - -#if defined(__GNUC__) && __GNUC__ -extern void die(const char *fmt, ...) __attribute__((noreturn)); -#else -extern void die(const char *fmt, ...); -#endif - - -struct arg arg_init(char **argv) { - struct arg a; - - a.argv = argv; - a.argv_step = 1; - a.name = NULL; - a.val = NULL; - a.def = NULL; - return a; -} - -int arg_match(struct arg *arg_, const struct arg_def *def, char **argv) { - struct arg arg; - - if (!argv[0] || argv[0][0] != '-') - return 0; - - arg = arg_init(argv); - - if (def->short_name - && strlen(arg.argv[0]) == strlen(def->short_name) + 1 - && !strcmp(arg.argv[0] + 1, def->short_name)) { - - arg.name = arg.argv[0] + 1; - arg.val = def->has_val ? arg.argv[1] : NULL; - arg.argv_step = def->has_val ? 2 : 1; - } else if (def->long_name) { - const size_t name_len = strlen(def->long_name); - - if (strlen(arg.argv[0]) >= name_len + 2 - && arg.argv[0][1] == '-' - && !strncmp(arg.argv[0] + 2, def->long_name, name_len) - && (arg.argv[0][name_len + 2] == '=' - || arg.argv[0][name_len + 2] == '\0')) { - - arg.name = arg.argv[0] + 2; - arg.val = arg.name[name_len] == '=' ? arg.name + name_len + 1 : NULL; - arg.argv_step = 1; - } - } - - if (arg.name && !arg.val && def->has_val) - die("Error: option %s requires argument.\n", arg.name); - - if (arg.name && arg.val && !def->has_val) - die("Error: option %s requires no argument.\n", arg.name); - - if (arg.name - && (arg.val || !def->has_val)) { - arg.def = def; - *arg_ = arg; - return 1; - } - - return 0; -} - - -const char *arg_next(struct arg *arg) { - if (arg->argv[0]) - arg->argv += arg->argv_step; - - return *arg->argv; -} - - -char **argv_dup(int argc, const char **argv) { - char **new_argv = malloc((argc + 1) * sizeof(*argv)); - - memcpy(new_argv, argv, argc * sizeof(*argv)); - new_argv[argc] = NULL; - return new_argv; -} - - -void arg_show_usage(FILE *fp, const struct arg_def *const *defs) { - char option_text[40] = {0}; - - for (; *defs; defs++) { - const struct arg_def *def = *defs; - char *short_val = def->has_val ? " " : ""; - char *long_val = def->has_val ? "=" : ""; - - if (def->short_name && def->long_name) { - char *comma = def->has_val ? "," : ", "; - - snprintf(option_text, 37, "-%s%s%s --%s%6s", - def->short_name, short_val, comma, - def->long_name, long_val); - } else if (def->short_name) - snprintf(option_text, 37, "-%s%s", - def->short_name, short_val); - else if (def->long_name) - snprintf(option_text, 37, " --%s%s", - def->long_name, long_val); - - fprintf(fp, " %-37s\t%s\n", option_text, def->desc); - - if (def->enums) { - const struct arg_enum_list *listptr; - - fprintf(fp, " %-37s\t ", ""); - - for (listptr = def->enums; listptr->name; listptr++) - fprintf(fp, "%s%s", listptr->name, - listptr[1].name ? ", " : "\n"); - } - } -} - - -unsigned int arg_parse_uint(const struct arg *arg) { - long int rawval; - char *endptr; - - rawval = strtol(arg->val, &endptr, 10); - - if (arg->val[0] != '\0' && endptr[0] == '\0') { - if (rawval >= 0 && rawval <= UINT_MAX) - return rawval; - - die("Option %s: Value %ld out of range for unsigned int\n", - arg->name, rawval); - } - - die("Option %s: Invalid character '%c'\n", arg->name, *endptr); - return 0; -} - - -int arg_parse_int(const struct arg *arg) { - long int rawval; - char *endptr; - - rawval = strtol(arg->val, &endptr, 10); - - if (arg->val[0] != '\0' && endptr[0] == '\0') { - if (rawval >= INT_MIN && rawval <= INT_MAX) - return rawval; - - die("Option %s: Value %ld out of range for signed int\n", - arg->name, rawval); - } - - die("Option %s: Invalid character '%c'\n", arg->name, *endptr); - return 0; -} - - -struct vpx_rational { - int num; /**< fraction numerator */ - int den; /**< fraction denominator */ -}; -struct vpx_rational arg_parse_rational(const struct arg *arg) { - long int rawval; - char *endptr; - struct vpx_rational rat; - - /* parse numerator */ - rawval = strtol(arg->val, &endptr, 10); - - if (arg->val[0] != '\0' && endptr[0] == '/') { - if (rawval >= INT_MIN && rawval <= INT_MAX) - rat.num = rawval; - else die("Option %s: Value %ld out of range for signed int\n", - arg->name, rawval); - } else die("Option %s: Expected / at '%c'\n", arg->name, *endptr); - - /* parse denominator */ - rawval = strtol(endptr + 1, &endptr, 10); - - if (arg->val[0] != '\0' && endptr[0] == '\0') { - if (rawval >= INT_MIN && rawval <= INT_MAX) - rat.den = rawval; - else die("Option %s: Value %ld out of range for signed int\n", - arg->name, rawval); - } else die("Option %s: Invalid character '%c'\n", arg->name, *endptr); - - return rat; -} - - -int arg_parse_enum(const struct arg *arg) { - const struct arg_enum_list *listptr; - long int rawval; - char *endptr; - - /* First see if the value can be parsed as a raw value */ - rawval = strtol(arg->val, &endptr, 10); - if (arg->val[0] != '\0' && endptr[0] == '\0') { - /* Got a raw value, make sure it's valid */ - for (listptr = arg->def->enums; listptr->name; listptr++) - if (listptr->val == rawval) - return rawval; - } - - /* Next see if it can be parsed as a string */ - for (listptr = arg->def->enums; listptr->name; listptr++) - if (!strcmp(arg->val, listptr->name)) - return listptr->val; - - die("Option %s: Invalid value '%s'\n", arg->name, arg->val); - return 0; -} - - -int arg_parse_enum_or_int(const struct arg *arg) { - if (arg->def->enums) - return arg_parse_enum(arg); - return arg_parse_int(arg); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/args.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/args.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/args.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/args.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef ARGS_H_ -#define ARGS_H_ -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct arg { - char **argv; - const char *name; - const char *val; - unsigned int argv_step; - const struct arg_def *def; -}; - -struct arg_enum_list { - const char *name; - int val; -}; -#define ARG_ENUM_LIST_END {0} - -typedef struct arg_def { - const char *short_name; - const char *long_name; - int has_val; - const char *desc; - const struct arg_enum_list *enums; -} arg_def_t; -#define ARG_DEF(s,l,v,d) {s,l,v,d, NULL} -#define ARG_DEF_ENUM(s,l,v,d,e) {s,l,v,d,e} -#define ARG_DEF_LIST_END {0} - -struct arg arg_init(char **argv); -int arg_match(struct arg *arg_, const struct arg_def *def, char **argv); -const char *arg_next(struct arg *arg); -void arg_show_usage(FILE *fp, const struct arg_def *const *defs); -char **argv_dup(int argc, const char **argv); - -unsigned int arg_parse_uint(const struct arg *arg); -int arg_parse_int(const struct arg *arg); -struct vpx_rational arg_parse_rational(const struct arg *arg); -int arg_parse_enum(const struct arg *arg); -int arg_parse_enum_or_int(const struct arg *arg); -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // ARGS_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/AUTHORS gstreamer-vaapi-1.8.2/ext/libvpx/upstream/AUTHORS --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/AUTHORS 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/AUTHORS 1970-01-01 00:00:00.000000000 +0000 @@ -1,125 +0,0 @@ -# This file is automatically generated from the git commit history -# by tools/gen_authors.sh. - -Aaron Watry -Abo Talib Mahfoodh -Adam Xu -Adrian Grange -Ahmad Sharif -Alexander Voronov -Alex Converse -Alexis Ballier -Alok Ahuja -Alpha Lam -A.Mahfoodh -Ami Fischman -Andoni Morales Alastruey -Andres Mejia -Andrew Russell -Aron Rosenberg -Attila Nagy -changjun.yang -Charles 'Buck' Krasic -chm -Christian Duvivier -Daniel Kang -Deb Mukherjee -Dim Temp -Dmitry Kovalev -Dragan Mrdjan -Ehsan Akhgari -Erik Niemeyer -Fabio Pedretti -Frank Galligan -Fredrik Söderquist -Fritz Koenig -Gaute Strokkenes -Giuseppe Scrivano -Gordana Cmiljanovic -Guillaume Martres -Guillermo Ballester Valor -Hangyu Kuang -Hanno Böck -Henrik Lundin -Hui Su -Ivan Maltz -Jacek Caban -JackyChen -James Berry -James Yu -James Zern -Jan Gerber -Jan Kratochvil -Janne Salonen -Jeff Faust -Jeff Muizelaar -Jeff Petkau -Jia Jia -Jim Bankoski -Jingning Han -Joey Parrish -Johann Koenig -John Koleszar -John Stark -Joshua Bleecher Snyder -Joshua Litt -Justin Clift -Justin Lebar -KO Myung-Hun -Lawrence Velázquez -Lou Quillio -Luca Barbato -Makoto Kato -Mans Rullgard -Marco Paniconi -Mark Mentovai -Martin Ettl -Martin Storsjo -Matthew Heaney -Michael Kohler -Mike Frysinger -Mike Hommey -Mikhal Shemer -Minghai Shang -Morton Jonuschat -Parag Salasakar -Pascal Massimino -Patrik Westin -Paul Wilkins -Pavol Rusnak -Paweł Hajdan -Pengchong Jin -Peter de Rivaz -Philip Jägenstedt -Priit Laes -Rafael Ávila de Espíndola -Rafaël Carré -Ralph Giles -Rob Bradford -Ronald S. Bultje -Rui Ueyama -Sami Pietilä -Scott Graham -Scott LaVarnway -Sean McGovern -Sergey Ulanov -Shimon Doodkin -Stefan Holmer -Suman Sunkara -Taekhyun Kim -Takanori MATSUURA -Tamar Levy -Tao Bai -Tero Rintaluoma -Thijs Vermeir -Tim Kopp -Timothy B. Terriberry -Tom Finegan -Vignesh Venkatasubramanian -Yaowu Xu -Yongzhe Wang -Yunqing Wang -Zoe Liu -Google Inc. -The Mozilla Foundation -The Xiph.Org Foundation diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/ads2armasm_ms.pl gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/ads2armasm_ms.pl --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/ads2armasm_ms.pl 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/ads2armasm_ms.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -#!/usr/bin/env perl -## -## Copyright (c) 2013 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - -use FindBin; -use lib $FindBin::Bin; -use thumb; - -print "; This file was created from a .asm file\n"; -print "; using the ads2armasm_ms.pl script.\n"; - -while () -{ - undef $comment; - undef $line; - - s/REQUIRE8//; - s/PRESERVE8//; - s/^\s*ARM\s*$//; - s/AREA\s+\|\|(.*)\|\|/AREA |$1|/; - s/qsubaddx/qsax/i; - s/qaddsubx/qasx/i; - - thumb::FixThumbInstructions($_, 1); - - s/ldrneb/ldrbne/i; - s/ldrneh/ldrhne/i; - s/^(\s*)ENDP.*/$&\n$1ALIGN 4/; - - print; -} - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/ads2gas_apple.pl gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/ads2gas_apple.pl --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/ads2gas_apple.pl 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/ads2gas_apple.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,235 +0,0 @@ -#!/usr/bin/env perl -## -## Copyright (c) 2010 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - - -# ads2gas_apple.pl -# Author: Eric Fung (efung (at) acm.org) -# -# Convert ARM Developer Suite 1.0.1 syntax assembly source to GNU as format -# -# Usage: cat inputfile | perl ads2gas_apple.pl > outputfile -# - -my $chromium = 0; - -foreach my $arg (@ARGV) { - $chromium = 1 if ($arg eq "-chromium"); -} - -print "@ This file was created from a .asm file\n"; -print "@ using the ads2gas_apple.pl script.\n\n"; -print "\t.set WIDE_REFERENCE, 0\n"; -print "\t.set ARCHITECTURE, 5\n"; -print "\t.set DO1STROUNDING, 0\n"; - -my %register_aliases; -my %macro_aliases; - -my @mapping_list = ("\$0", "\$1", "\$2", "\$3", "\$4", "\$5", "\$6", "\$7", "\$8", "\$9"); - -my @incoming_array; - -my @imported_functions; - -# Perl trim function to remove whitespace from the start and end of the string -sub trim($) -{ - my $string = shift; - $string =~ s/^\s+//; - $string =~ s/\s+$//; - return $string; -} - -while () -{ - # Load and store alignment - s/@/,:/g; - - # Comment character - s/;/ @/g; - - # Hexadecimal constants prefaced by 0x - s/#&/#0x/g; - - # Convert :OR: to | - s/:OR:/ | /g; - - # Convert :AND: to & - s/:AND:/ & /g; - - # Convert :NOT: to ~ - s/:NOT:/ ~ /g; - - # Convert :SHL: to << - s/:SHL:/ << /g; - - # Convert :SHR: to >> - s/:SHR:/ >> /g; - - # Convert ELSE to .else - s/\bELSE\b/.else/g; - - # Convert ENDIF to .endif - s/\bENDIF\b/.endif/g; - - # Convert ELSEIF to .elseif - s/\bELSEIF\b/.elseif/g; - - # Convert LTORG to .ltorg - s/\bLTORG\b/.ltorg/g; - - # Convert IF :DEF:to .if - # gcc doesn't have the ability to do a conditional - # if defined variable that is set by IF :DEF: on - # armasm, so convert it to a normal .if and then - # make sure to define a value elesewhere - if (s/\bIF :DEF:\b/.if /g) - { - s/=/==/g; - } - - # Convert IF to .if - if (s/\bIF\b/.if/g) - { - s/=/==/g; - } - - # Convert INCLUDE to .INCLUDE "file" - s/INCLUDE(\s*)(.*)$/.include $1\"$2\"/; - - # Code directive (ARM vs Thumb) - s/CODE([0-9][0-9])/.code $1/; - - # No AREA required - # But ALIGNs in AREA must be obeyed - s/^\s*AREA.*ALIGN=([0-9])$/.text\n.p2align $1/; - # If no ALIGN, strip the AREA and align to 4 bytes - s/^\s*AREA.*$/.text\n.p2align 2/; - - # DCD to .word - # This one is for incoming symbols - s/DCD\s+\|(\w*)\|/.long $1/; - - # DCW to .short - s/DCW\s+\|(\w*)\|/.short $1/; - s/DCW(.*)/.short $1/; - - # Constants defined in scope - s/DCD(.*)/.long $1/; - s/DCB(.*)/.byte $1/; - - # Build a hash of all the register - alias pairs. - if (s/(.*)RN(.*)/$1 .req $2/g) - { - $register_aliases{trim($1)} = trim($2); - next; - } - - while (($key, $value) = each(%register_aliases)) - { - s/\b$key\b/$value/g; - } - - # Make function visible to linker, and make additional symbol with - # prepended underscore - s/EXPORT\s+\|([\$\w]*)\|/.globl _$1\n\t.globl $1/; - - # Prepend imported functions with _ - if (s/IMPORT\s+\|([\$\w]*)\|/.globl $1/) - { - $function = trim($1); - push(@imported_functions, $function); - } - - foreach $function (@imported_functions) - { - s/$function/_$function/; - } - - # No vertical bars required; make additional symbol with prepended - # underscore - s/^\|(\$?\w+)\|/_$1\n\t$1:/g; - - # Labels need trailing colon -# s/^(\w+)/$1:/ if !/EQU/; - # put the colon at the end of the line in the macro - s/^([a-zA-Z_0-9\$]+)/$1:/ if !/EQU/; - - # ALIGN directive - s/\bALIGN\b/.balign/g; - - # Strip ARM - s/\sARM/@ ARM/g; - - # Strip REQUIRE8 - #s/\sREQUIRE8/@ REQUIRE8/g; - s/\sREQUIRE8/@ /g; - - # Strip PRESERVE8 - s/\sPRESERVE8/@ PRESERVE8/g; - - # Strip PROC and ENDPROC - s/\bPROC\b/@/g; - s/\bENDP\b/@/g; - - # EQU directive - s/(.*)EQU(.*)/.set $1, $2/; - - # Begin macro definition - if (/\bMACRO\b/) - { - # Process next line down, which will be the macro definition - $_ = ; - - $trimmed = trim($_); - - # remove commas that are separating list - $trimmed =~ s/,//g; - - # string to array - @incoming_array = split(/\s+/, $trimmed); - - print ".macro @incoming_array[0]\n"; - - # remove the first element, as that is the name of the macro - shift (@incoming_array); - - @macro_aliases{@incoming_array} = @mapping_list; - - next; - } - - while (($key, $value) = each(%macro_aliases)) - { - $key =~ s/\$/\\\$/; - s/$key\b/$value/g; - } - - # For macros, use \ to reference formal params -# s/\$/\\/g; # End macro definition - s/\bMEND\b/.endm/; # No need to tell it where to stop assembling - next if /^\s*END\s*$/; - - # Clang used by Chromium differs slightly from clang in XCode in what it - # will accept in the assembly. - if ($chromium) { - s/qsubaddx/qsax/i; - s/qaddsubx/qasx/i; - s/ldrneb/ldrbne/i; - s/ldrneh/ldrhne/i; - s/(vqshrun\.s16 .*, \#)0$/${1}8/i; - - # http://llvm.org/bugs/show_bug.cgi?id=16022 - s/\.include/#include/; - } - - print; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/ads2gas.pl gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/ads2gas.pl --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/ads2gas.pl 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/ads2gas.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,236 +0,0 @@ -#!/usr/bin/env perl -## -## Copyright (c) 2010 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - - -# ads2gas.pl -# Author: Eric Fung (efung (at) acm.org) -# -# Convert ARM Developer Suite 1.0.1 syntax assembly source to GNU as format -# -# Usage: cat inputfile | perl ads2gas.pl > outputfile -# - -use FindBin; -use lib $FindBin::Bin; -use thumb; - -my $thumb = 0; - -foreach my $arg (@ARGV) { - $thumb = 1 if ($arg eq "-thumb"); -} - -print "@ This file was created from a .asm file\n"; -print "@ using the ads2gas.pl script.\n"; -print "\t.equ DO1STROUNDING, 0\n"; -if ($thumb) { - print "\t.syntax unified\n"; - print "\t.thumb\n"; -} - -# Stack of procedure names. -@proc_stack = (); - -while () -{ - undef $comment; - undef $line; - $comment_char = ";"; - $comment_sub = "@"; - - # Handle comments. - if (/$comment_char/) - { - $comment = ""; - ($line, $comment) = /(.*?)$comment_char(.*)/; - $_ = $line; - } - - # Load and store alignment - s/@/,:/g; - - # Hexadecimal constants prefaced by 0x - s/#&/#0x/g; - - # Convert :OR: to | - s/:OR:/ | /g; - - # Convert :AND: to & - s/:AND:/ & /g; - - # Convert :NOT: to ~ - s/:NOT:/ ~ /g; - - # Convert :SHL: to << - s/:SHL:/ << /g; - - # Convert :SHR: to >> - s/:SHR:/ >> /g; - - # Convert ELSE to .else - s/\bELSE\b/.else/g; - - # Convert ENDIF to .endif - s/\bENDIF\b/.endif/g; - - # Convert ELSEIF to .elseif - s/\bELSEIF\b/.elseif/g; - - # Convert LTORG to .ltorg - s/\bLTORG\b/.ltorg/g; - - # Convert endfunc to nothing. - s/\bendfunc\b//ig; - - # Convert FUNCTION to nothing. - s/\bFUNCTION\b//g; - s/\bfunction\b//g; - - s/\bENTRY\b//g; - s/\bMSARMASM\b/0/g; - s/^\s+end\s+$//g; - - # Convert IF :DEF:to .if - # gcc doesn't have the ability to do a conditional - # if defined variable that is set by IF :DEF: on - # armasm, so convert it to a normal .if and then - # make sure to define a value elesewhere - if (s/\bIF :DEF:\b/.if /g) - { - s/=/==/g; - } - - # Convert IF to .if - if (s/\bIF\b/.if/g) - { - s/=+/==/g; - } - - # Convert INCLUDE to .INCLUDE "file" - s/INCLUDE(\s*)(.*)$/.include $1\"$2\"/; - - # Code directive (ARM vs Thumb) - s/CODE([0-9][0-9])/.code $1/; - - # No AREA required - # But ALIGNs in AREA must be obeyed - s/^\s*AREA.*ALIGN=([0-9])$/.text\n.p2align $1/; - # If no ALIGN, strip the AREA and align to 4 bytes - s/^\s*AREA.*$/.text\n.p2align 2/; - - # DCD to .word - # This one is for incoming symbols - s/DCD\s+\|(\w*)\|/.long $1/; - - # DCW to .short - s/DCW\s+\|(\w*)\|/.short $1/; - s/DCW(.*)/.short $1/; - - # Constants defined in scope - s/DCD(.*)/.long $1/; - s/DCB(.*)/.byte $1/; - - # RN to .req - if (s/RN\s+([Rr]\d+|lr)/.req $1/) - { - print; - print "$comment_sub$comment\n" if defined $comment; - next; - } - - # Make function visible to linker, and make additional symbol with - # prepended underscore - s/EXPORT\s+\|([\$\w]*)\|/.global $1 \n\t.type $1, function/; - s/IMPORT\s+\|([\$\w]*)\|/.global $1/; - - s/EXPORT\s+([\$\w]*)/.global $1/; - s/export\s+([\$\w]*)/.global $1/; - - # No vertical bars required; make additional symbol with prepended - # underscore - s/^\|(\$?\w+)\|/_$1\n\t$1:/g; - - # Labels need trailing colon -# s/^(\w+)/$1:/ if !/EQU/; - # put the colon at the end of the line in the macro - s/^([a-zA-Z_0-9\$]+)/$1:/ if !/EQU/; - - # ALIGN directive - s/\bALIGN\b/.balign/g; - - if ($thumb) { - # ARM code - we force everything to thumb with the declaration in the header - s/\sARM//g; - } else { - # ARM code - s/\sARM/.arm/g; - } - - # push/pop - s/(push\s+)(r\d+)/stmdb sp\!, \{$2\}/g; - s/(pop\s+)(r\d+)/ldmia sp\!, \{$2\}/g; - - # NEON code - s/(vld1.\d+\s+)(q\d+)/$1\{$2\}/g; - s/(vtbl.\d+\s+[^,]+),([^,]+)/$1,\{$2\}/g; - - if ($thumb) { - thumb::FixThumbInstructions($_, 0); - } - - # eabi_attributes numerical equivalents can be found in the - # "ARM IHI 0045C" document. - - # REQUIRE8 Stack is required to be 8-byte aligned - s/\sREQUIRE8/.eabi_attribute 24, 1 \@Tag_ABI_align_needed/g; - - # PRESERVE8 Stack 8-byte align is preserved - s/\sPRESERVE8/.eabi_attribute 25, 1 \@Tag_ABI_align_preserved/g; - - # Use PROC and ENDP to give the symbols a .size directive. - # This makes them show up properly in debugging tools like gdb and valgrind. - if (/\bPROC\b/) - { - my $proc; - /^_([\.0-9A-Z_a-z]\w+)\b/; - $proc = $1; - push(@proc_stack, $proc) if ($proc); - s/\bPROC\b/@ $&/; - } - if (/\bENDP\b/) - { - my $proc; - s/\bENDP\b/@ $&/; - $proc = pop(@proc_stack); - $_ = "\t.size $proc, .-$proc".$_ if ($proc); - } - - # EQU directive - s/(\S+\s+)EQU(\s+\S+)/.equ $1, $2/; - - # Begin macro definition - if (/\bMACRO\b/) { - $_ = ; - s/^/.macro/; - s/\$//g; # remove formal param reference - s/;/@/g; # change comment characters - } - - # For macros, use \ to reference formal params - s/\$/\\/g; # End macro definition - s/\bMEND\b/.endm/; # No need to tell it where to stop assembling - next if /^\s*END\s*$/; - print; - print "$comment_sub$comment\n" if defined $comment; -} - -# Mark that this object doesn't need an executable stack. -printf ("\t.section\t.note.GNU-stack,\"\",\%\%progbits\n"); diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/Android.mk gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/Android.mk --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/Android.mk 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/Android.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,191 +0,0 @@ -## -## Copyright (c) 2012 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - -# -# This file is to be used for compiling libvpx for Android using the NDK. -# In an Android project place a libvpx checkout in the jni directory. -# Run the configure script from the jni directory. Base libvpx -# encoder/decoder configuration will look similar to: -# ./libvpx/configure --target=armv7-android-gcc --disable-examples \ -# --sdk-path=/opt/android-ndk-r6b/ -# -# When targeting Android, realtime-only is enabled by default. This can -# be overridden by adding the command line flag: -# --disable-realtime-only -# -# This will create .mk files that contain variables that contain the -# source files to compile. -# -# Place an Android.mk file in the jni directory that references the -# Android.mk file in the libvpx directory: -# LOCAL_PATH := $(call my-dir) -# include $(CLEAR_VARS) -# include jni/libvpx/build/make/Android.mk -# -# There are currently two TARGET_ARCH_ABI targets for ARM. -# armeabi and armeabi-v7a. armeabi-v7a is selected by creating an -# Application.mk in the jni directory that contains: -# APP_ABI := armeabi-v7a -# -# By default libvpx will detect at runtime the existance of NEON extension. -# For this we import the 'cpufeatures' module from the NDK sources. -# libvpx can also be configured without this runtime detection method. -# Configuring with --disable-runtime-cpu-detect will assume presence of NEON. -# Configuring with --disable-runtime-cpu-detect --disable-neon \ -# --disable-neon-asm -# will remove any NEON dependency. - -# To change to building armeabi, run ./libvpx/configure again, but with -# --target=armv6-android-gcc and modify the Application.mk file to -# set APP_ABI := armeabi -# -# Running ndk-build will build libvpx and include it in your project. -# - -CONFIG_DIR := $(LOCAL_PATH)/ -LIBVPX_PATH := $(LOCAL_PATH)/libvpx -ASM_CNV_PATH_LOCAL := $(TARGET_ARCH_ABI)/ads2gas -ASM_CNV_PATH := $(LOCAL_PATH)/$(ASM_CNV_PATH_LOCAL) - -# Use the makefiles generated by upstream configure to determine which files to -# build. Also set any architecture-specific flags. -ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) - include $(CONFIG_DIR)libs-armv7-android-gcc.mk - LOCAL_ARM_MODE := arm -else ifeq ($(TARGET_ARCH_ABI),armeabi) - include $(CONFIG_DIR)libs-armv6-android-gcc.mk - LOCAL_ARM_MODE := arm -else ifeq ($(TARGET_ARCH_ABI),arm64-v8a) - include $(CONFIG_DIR)libs-armv8-android-gcc.mk - LOCAL_ARM_MODE := arm -else ifeq ($(TARGET_ARCH_ABI),x86) - include $(CONFIG_DIR)libs-x86-android-gcc.mk -else ifeq ($(TARGET_ARCH_ABI),mips) - include $(CONFIG_DIR)libs-mips-android-gcc.mk -else - $(error Not a supported TARGET_ARCH_ABI: $(TARGET_ARCH_ABI)) -endif - -# Rule that is normally in Makefile created by libvpx -# configure. Used to filter out source files based on configuration. -enabled=$(filter-out $($(1)-no),$($(1)-yes)) - -# Override the relative path that is defined by the libvpx -# configure process -SRC_PATH_BARE := $(LIBVPX_PATH) - -# Include the list of files to be built -include $(LIBVPX_PATH)/libs.mk - -# Optimise the code. May want to revisit this setting in the future. -LOCAL_CFLAGS := -O3 - -# For x86, include the source code in the search path so it will find files -# like x86inc.asm and x86_abi_support.asm -LOCAL_ASMFLAGS := -I$(LIBVPX_PATH) - -.PRECIOUS: %.asm.s -$(ASM_CNV_PATH)/libvpx/%.asm.s: $(LIBVPX_PATH)/%.asm - @mkdir -p $(dir $@) - @$(CONFIG_DIR)$(ASM_CONVERSION) <$< > $@ - -# For building *_rtcd.h, which have rules in libs.mk -TGT_ISA:=$(word 1, $(subst -, ,$(TOOLCHAIN))) -target := libs - -LOCAL_SRC_FILES += vpx_config.c - -# Remove duplicate entries -CODEC_SRCS_UNIQUE = $(sort $(CODEC_SRCS)) - -# Pull out C files. vpx_config.c is in the immediate directory and -# so it does not need libvpx/ prefixed like the rest of the source files. -# The neon files with intrinsics need to have .neon appended so the proper -# flags are applied. -CODEC_SRCS_C = $(filter %.c, $(CODEC_SRCS_UNIQUE)) -LOCAL_NEON_SRCS_C = $(filter %_neon.c, $(CODEC_SRCS_C)) -LOCAL_CODEC_SRCS_C = $(filter-out vpx_config.c %_neon.c, $(CODEC_SRCS_C)) - -LOCAL_SRC_FILES += $(foreach file, $(LOCAL_CODEC_SRCS_C), libvpx/$(file)) -ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) - LOCAL_SRC_FILES += $(foreach file, $(LOCAL_NEON_SRCS_C), libvpx/$(file).neon) -else # If there are neon sources then we are building for arm64 and do not need to specify .neon - LOCAL_SRC_FILES += $(foreach file, $(LOCAL_NEON_SRCS_C), libvpx/$(file)) -endif - -# Pull out assembly files, splitting NEON from the rest. This is -# done to specify that the NEON assembly files use NEON assembler flags. -# x86 assembly matches %.asm, arm matches %.asm.s - -# x86: - -CODEC_SRCS_ASM_X86 = $(filter %.asm, $(CODEC_SRCS_UNIQUE)) -LOCAL_SRC_FILES += $(foreach file, $(CODEC_SRCS_ASM_X86), libvpx/$(file)) - -# arm: -CODEC_SRCS_ASM_ARM_ALL = $(filter %.asm.s, $(CODEC_SRCS_UNIQUE)) -CODEC_SRCS_ASM_ARM = $(foreach v, \ - $(CODEC_SRCS_ASM_ARM_ALL), \ - $(if $(findstring neon,$(v)),,$(v))) -CODEC_SRCS_ASM_ADS2GAS = $(patsubst %.s, \ - $(ASM_CNV_PATH_LOCAL)/libvpx/%.s, \ - $(CODEC_SRCS_ASM_ARM)) -LOCAL_SRC_FILES += $(CODEC_SRCS_ASM_ADS2GAS) - -ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) - CODEC_SRCS_ASM_NEON = $(foreach v, \ - $(CODEC_SRCS_ASM_ARM_ALL),\ - $(if $(findstring neon,$(v)),$(v),)) - CODEC_SRCS_ASM_NEON_ADS2GAS = $(patsubst %.s, \ - $(ASM_CNV_PATH_LOCAL)/libvpx/%.s, \ - $(CODEC_SRCS_ASM_NEON)) - LOCAL_SRC_FILES += $(patsubst %.s, \ - %.s.neon, \ - $(CODEC_SRCS_ASM_NEON_ADS2GAS)) -endif - -LOCAL_CFLAGS += \ - -DHAVE_CONFIG_H=vpx_config.h \ - -I$(LIBVPX_PATH) \ - -I$(ASM_CNV_PATH) - -LOCAL_MODULE := libvpx - -LOCAL_LDLIBS := -llog - -ifeq ($(CONFIG_RUNTIME_CPU_DETECT),yes) - LOCAL_STATIC_LIBRARIES := cpufeatures -endif - -# Add a dependency to force generation of the RTCD files. -ifeq ($(CONFIG_VP8), yes) -$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vp8_rtcd.h -endif -ifeq ($(CONFIG_VP9), yes) -$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vp9_rtcd.h -endif -$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vpx_scale_rtcd.h - -ifeq ($(TARGET_ARCH_ABI),x86) -$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vpx_config.asm -endif - -.PHONY: clean -clean: - @echo "Clean: ads2gas files [$(TARGET_ARCH_ABI)]" - @$(RM) $(CODEC_SRCS_ASM_ADS2GAS) $(CODEC_SRCS_ASM_NEON_ADS2GAS) - @$(RM) -r $(ASM_CNV_PATH) - @$(RM) $(CLEAN-OBJS) - -include $(BUILD_SHARED_LIBRARY) - -ifeq ($(CONFIG_RUNTIME_CPU_DETECT),yes) -$(call import-module,cpufeatures) -endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/armlink_adapter.sh gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/armlink_adapter.sh --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/armlink_adapter.sh 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/armlink_adapter.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -#!/bin/sh -## -## Copyright (c) 2010 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - - -verbose=0 -set -- $* -for i; do - if [ "$i" = "-o" ]; then - on_of=1 - elif [ "$i" = "-v" ]; then - verbose=1 - elif [ "$i" = "-g" ]; then - args="${args} --debug" - elif [ "$on_of" = "1" ]; then - outfile=$i - on_of=0 - elif [ -f "$i" ]; then - infiles="$infiles $i" - elif [ "${i#-l}" != "$i" ]; then - libs="$libs ${i#-l}" - elif [ "${i#-L}" != "$i" ]; then - libpaths="${libpaths} ${i#-L}" - else - args="${args} ${i}" - fi - shift -done - -# Absolutize library file names -for f in $libs; do - found=0 - for d in $libpaths; do - [ -f "$d/$f" ] && infiles="$infiles $d/$f" && found=1 && break - [ -f "$d/lib${f}.so" ] && infiles="$infiles $d/lib${f}.so" && found=1 && break - [ -f "$d/lib${f}.a" ] && infiles="$infiles $d/lib${f}.a" && found=1 && break - done - [ $found -eq 0 ] && infiles="$infiles $f" -done -for d in $libpaths; do - [ -n "$libsearchpath" ] && libsearchpath="${libsearchpath}," - libsearchpath="${libsearchpath}$d" -done - -cmd="armlink $args --userlibpath=$libsearchpath --output=$outfile $infiles" -[ $verbose -eq 1 ] && echo $cmd -$cmd diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/configure.sh gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/configure.sh --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/configure.sh 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/configure.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,1427 +0,0 @@ -#!/bin/sh -## -## configure.sh -## -## This script is sourced by the main configure script and contains -## utility functions and other common bits that aren't strictly libvpx -## related. -## -## This build system is based in part on the FFmpeg configure script. -## - - -# -# Logging / Output Functions -# -die_unknown(){ - echo "Unknown option \"$1\"." - echo "See $0 --help for available options." - clean_temp_files - exit 1 -} - -die() { - echo "$@" - echo - echo "Configuration failed. This could reflect a misconfiguration of your" - echo "toolchains, improper options selected, or another problem. If you" - echo "don't see any useful error messages above, the next step is to look" - echo "at the configure error log file ($logfile) to determine what" - echo "configure was trying to do when it died." - clean_temp_files - exit 1 -} - -log(){ - echo "$@" >>$logfile -} - -log_file(){ - log BEGIN $1 - cat -n $1 >>$logfile - log END $1 -} - -log_echo() { - echo "$@" - log "$@" -} - -fwrite () { - outfile=$1 - shift - echo "$@" >> ${outfile} -} - -show_help_pre(){ - for opt in ${CMDLINE_SELECT}; do - opt2=`echo $opt | sed -e 's;_;-;g'` - if enabled $opt; then - eval "toggle_${opt}=\"--disable-${opt2}\"" - else - eval "toggle_${opt}=\"--enable-${opt2} \"" - fi - done - - cat <>${logfile} 2>&1 -} - -check_cc() { - log check_cc "$@" - cat >${TMP_C} - log_file ${TMP_C} - check_cmd ${CC} ${CFLAGS} "$@" -c -o ${TMP_O} ${TMP_C} -} - -check_cxx() { - log check_cxx "$@" - cat >${TMP_CC} - log_file ${TMP_CC} - check_cmd ${CXX} ${CXXFLAGS} "$@" -c -o ${TMP_O} ${TMP_CC} -} - -check_cpp() { - log check_cpp "$@" - cat > ${TMP_C} - log_file ${TMP_C} - check_cmd ${CC} ${CFLAGS} "$@" -E -o ${TMP_O} ${TMP_C} -} - -check_ld() { - log check_ld "$@" - check_cc $@ \ - && check_cmd ${LD} ${LDFLAGS} "$@" -o ${TMP_X} ${TMP_O} ${extralibs} -} - -check_header(){ - log check_header "$@" - header=$1 - shift - var=`echo $header | sed 's/[^A-Za-z0-9_]/_/g'` - disable_feature $var - check_cpp "$@" <${TMP_ASM} <${TMP_X} - log_file ${TMP_X} - if ! grep -q '\.rodata .* 16$' ${TMP_X}; then - die "${AS} ${ASFLAGS} does not support section alignment (nasm <=2.08?)" - fi -} - -# tests for -m$1 toggling the feature given in $2. If $2 is empty $1 is used. -check_gcc_machine_option() { - opt="$1" - feature="$2" - [ -n "$feature" ] || feature="$opt" - - if enabled gcc && ! disabled "$feature" && ! check_cflags "-m$opt"; then - RTCD_OPTIONS="${RTCD_OPTIONS}--disable-$feature " - else - soft_enable "$feature" - fi -} - -write_common_config_banner() { - print_webm_license config.mk "##" "" - echo '# This file automatically generated by configure. Do not edit!' >> config.mk - echo "TOOLCHAIN := ${toolchain}" >> config.mk - - case ${toolchain} in - *-linux-rvct) - echo "ALT_LIBC := ${alt_libc}" >> config.mk - ;; - esac -} - -write_common_config_targets() { - for t in ${all_targets}; do - if enabled ${t}; then - if enabled universal || enabled child; then - fwrite config.mk "ALL_TARGETS += ${t}-${toolchain}" - else - fwrite config.mk "ALL_TARGETS += ${t}" - fi - fi - true; - done - true -} - -write_common_target_config_mk() { - saved_CC="${CC}" - saved_CXX="${CXX}" - enabled ccache && CC="ccache ${CC}" - enabled ccache && CXX="ccache ${CXX}" - print_webm_license $1 "##" "" - - cat >> $1 << EOF -# This file automatically generated by configure. Do not edit! -SRC_PATH="$source_path" -SRC_PATH_BARE=$source_path -BUILD_PFX=${BUILD_PFX} -TOOLCHAIN=${toolchain} -ASM_CONVERSION=${asm_conversion_cmd:-${source_path}/build/make/ads2gas.pl} -GEN_VCPROJ=${gen_vcproj_cmd} -MSVS_ARCH_DIR=${msvs_arch_dir} - -CC=${CC} -CXX=${CXX} -AR=${AR} -LD=${LD} -AS=${AS} -STRIP=${STRIP} -NM=${NM} - -CFLAGS = ${CFLAGS} -CXXFLAGS = ${CXXFLAGS} -ARFLAGS = -rus\$(if \$(quiet),c,v) -LDFLAGS = ${LDFLAGS} -ASFLAGS = ${ASFLAGS} -extralibs = ${extralibs} -AS_SFX = ${AS_SFX:-.asm} -EXE_SFX = ${EXE_SFX} -VCPROJ_SFX = ${VCPROJ_SFX} -RTCD_OPTIONS = ${RTCD_OPTIONS} -EOF - - if enabled rvct; then cat >> $1 << EOF -fmt_deps = sed -e 's;^__image.axf;\${@:.d=.o} \$@;' #hide -EOF - else cat >> $1 << EOF -fmt_deps = sed -e 's;^\([a-zA-Z0-9_]*\)\.o;\${@:.d=.o} \$@;' -EOF - fi - - print_config_mk ARCH "${1}" ${ARCH_LIST} - print_config_mk HAVE "${1}" ${HAVE_LIST} - print_config_mk CONFIG "${1}" ${CONFIG_LIST} - print_config_mk HAVE "${1}" gnu_strip - - enabled msvs && echo "CONFIG_VS_VERSION=${vs_version}" >> "${1}" - - CC="${saved_CC}" - CXX="${saved_CXX}" -} - -write_common_target_config_h() { - print_webm_license ${TMP_H} "/*" " */" - cat >> ${TMP_H} << EOF -/* This file automatically generated by configure. Do not edit! */ -#ifndef VPX_CONFIG_H -#define VPX_CONFIG_H -#define RESTRICT ${RESTRICT} -#define INLINE ${INLINE} -EOF - print_config_h ARCH "${TMP_H}" ${ARCH_LIST} - print_config_h HAVE "${TMP_H}" ${HAVE_LIST} - print_config_h CONFIG "${TMP_H}" ${CONFIG_LIST} - print_config_vars_h "${TMP_H}" ${VAR_LIST} - echo "#endif /* VPX_CONFIG_H */" >> ${TMP_H} - mkdir -p `dirname "$1"` - cmp "$1" ${TMP_H} >/dev/null 2>&1 || mv ${TMP_H} "$1" -} - -process_common_cmdline() { - for opt in "$@"; do - optval="${opt#*=}" - case "$opt" in - --child) - enable_feature child - ;; - --log*) - logging="$optval" - if ! disabled logging ; then - enabled logging || logfile="$logging" - else - logfile=/dev/null - fi - ;; - --target=*) - toolchain="${toolchain:-${optval}}" - ;; - --force-target=*) - toolchain="${toolchain:-${optval}}" - enable_feature force_toolchain - ;; - --cpu=*) - tune_cpu="$optval" - ;; - --extra-cflags=*) - extra_cflags="${optval}" - ;; - --enable-?*|--disable-?*) - eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'` - if echo "${ARCH_EXT_LIST}" | grep "^ *$option\$" >/dev/null; then - [ $action = "disable" ] && RTCD_OPTIONS="${RTCD_OPTIONS}--disable-${option} " - elif [ $action = "disable" ] && ! disabled $option ; then - echo "${CMDLINE_SELECT}" | grep "^ *$option\$" >/dev/null || - die_unknown $opt - log_echo " disabling $option" - elif [ $action = "enable" ] && ! enabled $option ; then - echo "${CMDLINE_SELECT}" | grep "^ *$option\$" >/dev/null || - die_unknown $opt - log_echo " enabling $option" - fi - ${action}_feature $option - ;; - --require-?*) - eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'` - if echo "${ARCH_EXT_LIST}" none | grep "^ *$option\$" >/dev/null; then - RTCD_OPTIONS="${RTCD_OPTIONS}${opt} " - else - die_unknown $opt - fi - ;; - --force-enable-?*|--force-disable-?*) - eval `echo "$opt" | sed 's/--force-/action=/;s/-/ option=/;s/-/_/g'` - ${action}_feature $option - ;; - --libc=*) - [ -d "${optval}" ] || die "Not a directory: ${optval}" - disable_feature builtin_libc - alt_libc="${optval}" - ;; - --as=*) - [ "${optval}" = yasm ] || [ "${optval}" = nasm ] \ - || [ "${optval}" = auto ] \ - || die "Must be yasm, nasm or auto: ${optval}" - alt_as="${optval}" - ;; - --size-limit=*) - w="${optval%%x*}" - h="${optval##*x}" - VAR_LIST="DECODE_WIDTH_LIMIT ${w} DECODE_HEIGHT_LIMIT ${h}" - [ ${w} -gt 0 ] && [ ${h} -gt 0 ] || die "Invalid size-limit: too small." - [ ${w} -lt 65536 ] && [ ${h} -lt 65536 ] \ - || die "Invalid size-limit: too big." - enable_feature size_limit - ;; - --prefix=*) - prefix="${optval}" - ;; - --libdir=*) - libdir="${optval}" - ;; - --sdk-path=*) - [ -d "${optval}" ] || die "Not a directory: ${optval}" - sdk_path="${optval}" - ;; - --libc|--as|--prefix|--libdir|--sdk-path) - die "Option ${opt} requires argument" - ;; - --help|-h) - show_help - ;; - *) - die_unknown $opt - ;; - esac - done -} - -process_cmdline() { - for opt do - optval="${opt#*=}" - case "$opt" in - *) - process_common_cmdline $opt - ;; - esac - done -} - -post_process_common_cmdline() { - prefix="${prefix:-/usr/local}" - prefix="${prefix%/}" - libdir="${libdir:-${prefix}/lib}" - libdir="${libdir%/}" - if [ "${libdir#${prefix}}" = "${libdir}" ]; then - die "Libdir ${libdir} must be a subdirectory of ${prefix}" - fi -} - -post_process_cmdline() { - true; -} - -setup_gnu_toolchain() { - CC=${CC:-${CROSS}gcc} - CXX=${CXX:-${CROSS}g++} - AR=${AR:-${CROSS}ar} - LD=${LD:-${CROSS}${link_with_cc:-ld}} - AS=${AS:-${CROSS}as} - STRIP=${STRIP:-${CROSS}strip} - NM=${NM:-${CROSS}nm} - AS_SFX=.s - EXE_SFX= -} - -# Reliably find the newest available Darwin SDKs. (Older versions of -# xcrun don't support --show-sdk-path.) -show_darwin_sdk_path() { - xcrun --sdk $1 --show-sdk-path 2>/dev/null || - xcodebuild -sdk $1 -version Path 2>/dev/null -} - -process_common_toolchain() { - if [ -z "$toolchain" ]; then - gcctarget="${CHOST:-$(gcc -dumpmachine 2> /dev/null)}" - - # detect tgt_isa - case "$gcctarget" in - armv6*) - tgt_isa=armv6 - ;; - armv7*-hardfloat*) - tgt_isa=armv7 - float_abi=hard - ;; - armv7*) - tgt_isa=armv7 - float_abi=softfp - ;; - *x86_64*|*amd64*) - tgt_isa=x86_64 - ;; - *i[3456]86*) - tgt_isa=x86 - ;; - *powerpc64*) - tgt_isa=ppc64 - ;; - *powerpc*) - tgt_isa=ppc32 - ;; - *sparc*) - tgt_isa=sparc - ;; - esac - - # detect tgt_os - case "$gcctarget" in - *darwin8*) - tgt_isa=universal - tgt_os=darwin8 - ;; - *darwin9*) - tgt_isa=universal - tgt_os=darwin9 - ;; - *darwin10*) - tgt_isa=x86_64 - tgt_os=darwin10 - ;; - *darwin11*) - tgt_isa=x86_64 - tgt_os=darwin11 - ;; - *darwin12*) - tgt_isa=x86_64 - tgt_os=darwin12 - ;; - *darwin13*) - tgt_isa=x86_64 - tgt_os=darwin13 - ;; - *darwin14*) - tgt_isa=x86_64 - tgt_os=darwin14 - ;; - x86_64*mingw32*) - tgt_os=win64 - ;; - *mingw32*|*cygwin*) - [ -z "$tgt_isa" ] && tgt_isa=x86 - tgt_os=win32 - ;; - *linux*|*bsd*) - tgt_os=linux - ;; - *solaris2.10) - tgt_os=solaris - ;; - *os2*) - tgt_os=os2 - ;; - esac - - if [ -n "$tgt_isa" ] && [ -n "$tgt_os" ]; then - toolchain=${tgt_isa}-${tgt_os}-gcc - fi - fi - - toolchain=${toolchain:-generic-gnu} - - is_in ${toolchain} ${all_platforms} || enabled force_toolchain \ - || die "Unrecognized toolchain '${toolchain}'" - - enabled child || log_echo "Configuring for target '${toolchain}'" - - # - # Set up toolchain variables - # - tgt_isa=$(echo ${toolchain} | awk 'BEGIN{FS="-"}{print $1}') - tgt_os=$(echo ${toolchain} | awk 'BEGIN{FS="-"}{print $2}') - tgt_cc=$(echo ${toolchain} | awk 'BEGIN{FS="-"}{print $3}') - - # Mark the specific ISA requested as enabled - soft_enable ${tgt_isa} - enable_feature ${tgt_os} - enable_feature ${tgt_cc} - - # Enable the architecture family - case ${tgt_isa} in - arm*) - enable_feature arm - ;; - mips*) - enable_feature mips - ;; - esac - - # PIC is probably what we want when building shared libs - enabled shared && soft_enable pic - - # Minimum iOS version for all target platforms (darwin and iphonesimulator). - IOS_VERSION_MIN="6.0" - - # Handle darwin variants. Newer SDKs allow targeting older - # platforms, so use the newest one available. - case ${toolchain} in - *-darwin*) - osx_sdk_dir="$(show_darwin_sdk_path macosx)" - if [ -d "${osx_sdk_dir}" ]; then - add_cflags "-isysroot ${osx_sdk_dir}" - add_ldflags "-isysroot ${osx_sdk_dir}" - fi - ;; - esac - - case ${toolchain} in - *-darwin8-*) - add_cflags "-mmacosx-version-min=10.4" - add_ldflags "-mmacosx-version-min=10.4" - ;; - *-darwin9-*) - add_cflags "-mmacosx-version-min=10.5" - add_ldflags "-mmacosx-version-min=10.5" - ;; - *-darwin10-*) - add_cflags "-mmacosx-version-min=10.6" - add_ldflags "-mmacosx-version-min=10.6" - ;; - *-darwin11-*) - add_cflags "-mmacosx-version-min=10.7" - add_ldflags "-mmacosx-version-min=10.7" - ;; - *-darwin12-*) - add_cflags "-mmacosx-version-min=10.8" - add_ldflags "-mmacosx-version-min=10.8" - ;; - *-darwin13-*) - add_cflags "-mmacosx-version-min=10.9" - add_ldflags "-mmacosx-version-min=10.9" - ;; - *-darwin14-*) - add_cflags "-mmacosx-version-min=10.10" - add_ldflags "-mmacosx-version-min=10.10" - ;; - *-iphonesimulator-*) - add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}" - add_ldflags "-miphoneos-version-min=${IOS_VERSION_MIN}" - iossim_sdk_dir="$(show_darwin_sdk_path iphonesimulator)" - if [ -d "${iossim_sdk_dir}" ]; then - add_cflags "-isysroot ${iossim_sdk_dir}" - add_ldflags "-isysroot ${iossim_sdk_dir}" - fi - ;; - esac - - # Handle Solaris variants. Solaris 10 needs -lposix4 - case ${toolchain} in - sparc-solaris-*) - add_extralibs -lposix4 - disable_feature fast_unaligned - ;; - *-solaris-*) - add_extralibs -lposix4 - ;; - esac - - # Process ARM architecture variants - case ${toolchain} in - arm*) - # on arm, isa versions are supersets - case ${tgt_isa} in - arm64|armv8) - soft_enable neon - ;; - armv7|armv7s) - soft_enable neon - # Only enable neon_asm when neon is also enabled. - enabled neon && soft_enable neon_asm - # If someone tries to force it through, die. - if disabled neon && enabled neon_asm; then - die "Disabling neon while keeping neon-asm is not supported" - fi - soft_enable media - soft_enable fast_unaligned - ;; - armv6) - soft_enable media - soft_enable fast_unaligned - ;; - esac - - asm_conversion_cmd="cat" - - case ${tgt_cc} in - gcc) - CROSS=${CROSS:-arm-none-linux-gnueabi-} - link_with_cc=gcc - setup_gnu_toolchain - arch_int=${tgt_isa##armv} - arch_int=${arch_int%%te} - check_add_asflags --defsym ARCHITECTURE=${arch_int} - tune_cflags="-mtune=" - if [ ${tgt_isa} = "armv7" ] || [ ${tgt_isa} = "armv7s" ]; then - if [ -z "${float_abi}" ]; then - check_cpp <&- || \ - die "Couldn't find CodeSourcery GCC from PATH" - - # Use armcc as a linker to enable translation of - # some gcc specific options such as -lm and -lpthread. - LD="armcc --translate_gcc" - - # create configuration file (uses path to CodeSourcery GCC) - armcc --arm_linux_configure --arm_linux_config_file=arm_linux.cfg - - add_cflags --arm_linux_paths --arm_linux_config_file=arm_linux.cfg - add_asflags --no_hide_all --apcs=/interwork - add_ldflags --arm_linux_paths --arm_linux_config_file=arm_linux.cfg - enabled pic && add_cflags --apcs=/fpic - enabled pic && add_asflags --apcs=/fpic - enabled shared && add_cflags --shared - fi - ;; - esac - ;; - mips*) - link_with_cc=gcc - setup_gnu_toolchain - tune_cflags="-mtune=" - if enabled dspr2; then - check_add_cflags -mips32r2 -mdspr2 - disable_feature fast_unaligned - fi - check_add_cflags -march=${tgt_isa} - check_add_asflags -march=${tgt_isa} - check_add_asflags -KPIC - ;; - ppc*) - enable_feature ppc - bits=${tgt_isa##ppc} - link_with_cc=gcc - setup_gnu_toolchain - add_asflags -force_cpusubtype_ALL -I"\$(dir \$<)darwin" - soft_enable altivec - enabled altivec && add_cflags -maltivec - - case "$tgt_os" in - linux*) - add_asflags -maltivec -mregnames -I"\$(dir \$<)linux" - ;; - darwin*) - darwin_arch="-arch ppc" - enabled ppc64 && darwin_arch="${darwin_arch}64" - add_cflags ${darwin_arch} -m${bits} -fasm-blocks - add_asflags ${darwin_arch} -force_cpusubtype_ALL -I"\$(dir \$<)darwin" - add_ldflags ${darwin_arch} -m${bits} - enabled altivec && add_cflags -faltivec - ;; - esac - ;; - x86*) - case ${tgt_os} in - win*) - enabled gcc && add_cflags -fno-common - ;; - solaris*) - CC=${CC:-${CROSS}gcc} - CXX=${CXX:-${CROSS}g++} - LD=${LD:-${CROSS}gcc} - CROSS=${CROSS:-g} - ;; - os2) - AS=${AS:-nasm} - ;; - esac - - AS="${alt_as:-${AS:-auto}}" - case ${tgt_cc} in - icc*) - CC=${CC:-icc} - LD=${LD:-icc} - setup_gnu_toolchain - add_cflags -use-msasm # remove -use-msasm too? - # add -no-intel-extensions to suppress warning #10237 - # refer to http://software.intel.com/en-us/forums/topic/280199 - add_ldflags -i-static -no-intel-extensions - enabled x86_64 && add_cflags -ipo -static -O3 -no-prec-div - enabled x86_64 && AR=xiar - case ${tune_cpu} in - atom*) - tune_cflags="-x" - tune_cpu="SSE3_ATOM" - ;; - *) - tune_cflags="-march=" - ;; - esac - ;; - gcc*) - link_with_cc=gcc - tune_cflags="-march=" - setup_gnu_toolchain - #for 32 bit x86 builds, -O3 did not turn on this flag - enabled optimizations && disabled gprof && check_add_cflags -fomit-frame-pointer - ;; - vs*) - # When building with Microsoft Visual Studio the assembler is - # invoked directly. Checking at configure time is unnecessary. - # Skip the check by setting AS arbitrarily - AS=msvs - msvs_arch_dir=x86-msvs - vc_version=${tgt_cc##vs} - case $vc_version in - 7|8|9|10) - echo "${tgt_cc} does not support avx/avx2, disabling....." - RTCD_OPTIONS="${RTCD_OPTIONS}--disable-avx --disable-avx2 " - soft_disable avx - soft_disable avx2 - ;; - esac - ;; - esac - - bits=32 - enabled x86_64 && bits=64 - check_cpp </dev/null 2>&1 && AS=nasm - which yasm >/dev/null 2>&1 && AS=yasm - if [ "${AS}" = nasm ] ; then - # Apple ships version 0.98 of nasm through at least Xcode 6. Revisit - # this check if they start shipping a compatible version. - apple=`nasm -v | grep "Apple"` - [ -n "${apple}" ] \ - && echo "Unsupported version of nasm: ${apple}" \ - && AS="" - fi - [ "${AS}" = auto ] || [ -z "${AS}" ] \ - && die "Neither yasm nor nasm have been found" - ;; - esac - log_echo " using $AS" - [ "${AS##*/}" = nasm ] && add_asflags -Ox - AS_SFX=.asm - case ${tgt_os} in - win32) - add_asflags -f win32 - enabled debug && add_asflags -g cv8 - EXE_SFX=.exe - ;; - win64) - add_asflags -f x64 - enabled debug && add_asflags -g cv8 - EXE_SFX=.exe - ;; - linux*|solaris*|android*) - add_asflags -f elf${bits} - enabled debug && [ "${AS}" = yasm ] && add_asflags -g dwarf2 - enabled debug && [ "${AS}" = nasm ] && add_asflags -g - [ "${AS##*/}" = nasm ] && check_asm_align - ;; - darwin*) - add_asflags -f macho${bits} - enabled x86 && darwin_arch="-arch i386" || darwin_arch="-arch x86_64" - add_cflags ${darwin_arch} - add_ldflags ${darwin_arch} - # -mdynamic-no-pic is still a bit of voodoo -- it was required at - # one time, but does not seem to be now, and it breaks some of the - # code that still relies on inline assembly. - # enabled icc && ! enabled pic && add_cflags -fno-pic -mdynamic-no-pic - enabled icc && ! enabled pic && add_cflags -fno-pic - ;; - iphonesimulator) - add_asflags -f macho${bits} - enabled x86 && sim_arch="-arch i386" || sim_arch="-arch x86_64" - add_cflags ${sim_arch} - add_ldflags ${sim_arch} - ;; - os2) - add_asflags -f aout - enabled debug && add_asflags -g - EXE_SFX=.exe - ;; - *) - log "Warning: Unknown os $tgt_os while setting up $AS flags" - ;; - esac - ;; - universal*|*-gcc|generic-gnu) - link_with_cc=gcc - enable_feature gcc - setup_gnu_toolchain - ;; - esac - - # Try to enable CPU specific tuning - if [ -n "${tune_cpu}" ]; then - if [ -n "${tune_cflags}" ]; then - check_add_cflags ${tune_cflags}${tune_cpu} || \ - die "Requested CPU '${tune_cpu}' not supported by compiler" - fi - if [ -n "${tune_asflags}" ]; then - check_add_asflags ${tune_asflags}${tune_cpu} || \ - die "Requested CPU '${tune_cpu}' not supported by assembler" - fi - if [ -z "${tune_cflags}${tune_asflags}" ]; then - log_echo "Warning: CPU tuning not supported by this toolchain" - fi - fi - - if enabled debug; then - check_add_cflags -g && check_add_ldflags -g - else - check_add_cflags -DNDEBUG - fi - - enabled gprof && check_add_cflags -pg && check_add_ldflags -pg - enabled gcov && - check_add_cflags -fprofile-arcs -ftest-coverage && - check_add_ldflags -fprofile-arcs -ftest-coverage - - if enabled optimizations; then - if enabled rvct; then - enabled small && check_add_cflags -Ospace || check_add_cflags -Otime - else - enabled small && check_add_cflags -O2 || check_add_cflags -O3 - fi - fi - - if [ "${tgt_isa}" = "x86_64" ] || [ "${tgt_isa}" = "x86" ]; then - soft_enable use_x86inc - fi - - # Position Independent Code (PIC) support, for building relocatable - # shared objects - enabled gcc && enabled pic && check_add_cflags -fPIC - - # Work around longjmp interception on glibc >= 2.11, to improve binary - # compatibility. See http://code.google.com/p/webm/issues/detail?id=166 - enabled linux && check_add_cflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 - - # Check for strip utility variant - ${STRIP} -V 2>/dev/null | grep GNU >/dev/null && enable_feature gnu_strip - - # Try to determine target endianness - check_cc </dev/null 2>&1 && enable_feature big_endian - - # Try to find which inline keywords are supported - check_cc <> $makefile - fi - done - prefix="${saved_prefix}" -} - -print_config_h() { - saved_prefix="${prefix}" - prefix=$1 - header=$2 - shift 2 - for cfg; do - upname="`toupper $cfg`" - if enabled $cfg; then - echo "#define ${prefix}_${upname} 1" >> $header - else - echo "#define ${prefix}_${upname} 0" >> $header - fi - done - prefix="${saved_prefix}" -} - -print_config_vars_h() { - header=$1 - shift - while [ $# -gt 0 ]; do - upname="`toupper $1`" - echo "#define ${upname} $2" >> $header - shift 2 - done -} - -print_webm_license() { - saved_prefix="${prefix}" - destination=$1 - prefix="$2" - suffix="$3" - shift 3 - cat < ${destination} -${prefix} Copyright (c) 2011 The WebM project authors. All Rights Reserved.${suffix} -${prefix} ${suffix} -${prefix} Use of this source code is governed by a BSD-style license${suffix} -${prefix} that can be found in the LICENSE file in the root of the source${suffix} -${prefix} tree. An additional intellectual property rights grant can be found${suffix} -${prefix} in the file PATENTS. All contributing project authors may${suffix} -${prefix} be found in the AUTHORS file in the root of the source tree.${suffix} -EOF - prefix="${saved_prefix}" -} - -process_targets() { - true; -} - -process_detect() { - true; -} - -enable_feature logging -logfile="config.log" -self=$0 -process() { - cmdline_args="$@" - process_cmdline "$@" - if enabled child; then - echo "# ${self} $@" >> ${logfile} - else - echo "# ${self} $@" > ${logfile} - fi - post_process_common_cmdline - post_process_cmdline - process_toolchain - process_detect - process_targets - - OOT_INSTALLS="${OOT_INSTALLS}" - if enabled source_path_used; then - # Prepare the PWD for building. - for f in ${OOT_INSTALLS}; do - install -D "${source_path}/$f" "$f" - done - fi - cp "${source_path}/build/make/Makefile" . - - clean_temp_files - true -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/gen_asm_deps.sh gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/gen_asm_deps.sh --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/gen_asm_deps.sh 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/gen_asm_deps.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -#!/bin/sh -## -## Copyright (c) 2010 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - - -self=$0 -show_help() { - echo "usage: $self [options] " - echo - echo "Generate Makefile dependency information from assembly code source" - echo - exit 1 -} -die_unknown(){ - echo "Unknown option \"$1\"." - echo "See $0 --help for available options." - exit 1 -} -for opt do - optval="${opt#*=}" - case "$opt" in - --build-pfx=*) pfx="${optval}" - ;; - --depfile=*) out="${optval}" - ;; - -I*) raw_inc_paths="${raw_inc_paths} ${opt}" - inc_path="${inc_path} ${opt#-I}" - ;; - -h|--help) show_help - ;; - *) [ -f "$opt" ] && srcfile="$opt" - ;; - esac -done - -[ -n "$srcfile" ] || show_help -sfx=${sfx:-asm} -includes=$(LC_ALL=C egrep -i "include +\"?[a-z0-9_/]+\.${sfx}" $srcfile | - perl -p -e "s;.*?([a-z0-9_/]+.${sfx}).*;\1;") -#" restore editor state -for inc in ${includes}; do - found_inc_path= - for idir in ${inc_path}; do - [ -f "${idir}/${inc}" ] && found_inc_path="${idir}" && break - done - if [ -f `dirname $srcfile`/$inc ]; then - # Handle include files in the same directory as the source - $self --build-pfx=$pfx --depfile=$out ${raw_inc_paths} `dirname $srcfile`/$inc - elif [ -n "${found_inc_path}" ]; then - # Handle include files on the include path - $self --build-pfx=$pfx --depfile=$out ${raw_inc_paths} "${found_inc_path}/$inc" - else - # Handle generated includes in the build root (which may not exist yet) - echo ${out} ${out%d}o: "${pfx}${inc}" - fi -done -echo ${out} ${out%d}o: $srcfile diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/gen_msvs_def.sh gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/gen_msvs_def.sh --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/gen_msvs_def.sh 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/gen_msvs_def.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ -#!/bin/bash -## -## Copyright (c) 2010 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - - -self=$0 -self_basename=${self##*/} -EOL=$'\n' - -show_help() { - cat < symbol1 [symbol2, symbol3, ...] - -where is either 'text' or 'data' - - -Options: - --help Print this message - --out=filename Write output to a file [stdout] - --name=project_name Name of the library (required) -EOF - exit 1 -} - -die() { - echo "${self_basename}: $@" - exit 1 -} - -die_unknown(){ - echo "Unknown option \"$1\"." - echo "See ${self_basename} --help for available options." - exit 1 -} - -text() { - for sym in "$@"; do - echo " $sym" >> ${outfile} - done -} - -data() { - for sym in "$@"; do - printf " %-40s DATA\n" "$sym" >> ${outfile} - done -} - -# Process command line -for opt in "$@"; do - optval="${opt#*=}" - case "$opt" in - --help|-h) show_help - ;; - --out=*) outfile="$optval" - ;; - --name=*) name="${optval}" - ;; - -*) die_unknown $opt - ;; - *) file_list[${#file_list[@]}]="$opt" - esac -done -outfile=${outfile:-/dev/stdout} -[ -n "$name" ] || die "Library name (--name) must be specified!" - -echo "LIBRARY ${name}" > ${outfile} -echo "EXPORTS" >> ${outfile} -for f in "${file_list[@]}"; do - . $f -done diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/gen_msvs_proj.sh gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/gen_msvs_proj.sh --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/gen_msvs_proj.sh 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/gen_msvs_proj.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,486 +0,0 @@ -#!/bin/bash -## -## Copyright (c) 2010 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - -self=$0 -self_basename=${self##*/} -self_dirname=$(dirname "$0") - -. "$self_dirname/msvs_common.sh"|| exit 127 - -show_help() { - cat <&2 - IFS=* - - open_tag Filter \ - Name=$name \ - Filter=$pats \ - UniqueIdentifier=`generate_uuid` \ - - file_list_sz=${#file_list[@]} - for i in ${!file_list[@]}; do - f=${file_list[i]} - for pat in ${pats//;/$IFS}; do - if [ "${f##*.}" == "$pat" ]; then - unset file_list[i] - - objf=$(echo ${f%.*}.obj \ - | sed -e "s,$src_path_bare,," \ - -e 's/^[\./]\+//g' -e 's,[:/ ],_,g') - open_tag File RelativePath="$f" - - if [ "$pat" == "asm" ] && $asm_use_custom_step; then - for plat in "${platforms[@]}"; do - for cfg in Debug Release; do - open_tag FileConfiguration \ - Name="${cfg}|${plat}" \ - - tag Tool \ - Name="VCCustomBuildTool" \ - Description="Assembling \$(InputFileName)" \ - CommandLine="$(eval echo \$asm_${cfg}_cmdline) -o \$(IntDir)\\$objf" \ - Outputs="\$(IntDir)\\$objf" \ - - close_tag FileConfiguration - done - done - fi - if [ "$pat" == "c" ] || \ - [ "$pat" == "cc" ] || [ "$pat" == "cpp" ]; then - for plat in "${platforms[@]}"; do - for cfg in Debug Release; do - open_tag FileConfiguration \ - Name="${cfg}|${plat}" \ - - tag Tool \ - Name="VCCLCompilerTool" \ - ObjectFile="\$(IntDir)\\$objf" \ - - close_tag FileConfiguration - done - done - fi - close_tag File - - break - fi - done - done - - close_tag Filter - IFS="$saveIFS" -} - -# Process command line -unset target -for opt in "$@"; do - optval="${opt#*=}" - case "$opt" in - --help|-h) show_help - ;; - --target=*) target="${optval}" - ;; - --out=*) outfile="$optval" - ;; - --name=*) name="${optval}" - ;; - --proj-guid=*) guid="${optval}" - ;; - --module-def=*) link_opts="${link_opts} ModuleDefinitionFile=${optval}" - ;; - --exe) proj_kind="exe" - ;; - --dll) proj_kind="dll" - ;; - --lib) proj_kind="lib" - ;; - --src-path-bare=*) - src_path_bare=$(fix_path "$optval") - src_path_bare=${src_path_bare%/} - ;; - --static-crt) use_static_runtime=true - ;; - --ver=*) - vs_ver="$optval" - case "$optval" in - [789]) - ;; - *) die Unrecognized Visual Studio Version in $opt - ;; - esac - ;; - -I*) - opt=${opt##-I} - opt=$(fix_path "$opt") - opt="${opt%/}" - incs="${incs}${incs:+;}"${opt}"" - yasmincs="${yasmincs} -I"${opt}"" - ;; - -D*) defines="${defines}${defines:+;}${opt##-D}" - ;; - -L*) # fudge . to $(OutDir) - if [ "${opt##-L}" == "." ]; then - libdirs="${libdirs}${libdirs:+;}"\$(OutDir)"" - else - # Also try directories for this platform/configuration - opt=${opt##-L} - opt=$(fix_path "$opt") - libdirs="${libdirs}${libdirs:+;}"${opt}"" - libdirs="${libdirs}${libdirs:+;}"${opt}/\$(PlatformName)/\$(ConfigurationName)"" - libdirs="${libdirs}${libdirs:+;}"${opt}/\$(PlatformName)"" - fi - ;; - -l*) libs="${libs}${libs:+ }${opt##-l}.lib" - ;; - -*) die_unknown $opt - ;; - *) - # The paths in file_list are fixed outside of the loop. - file_list[${#file_list[@]}]="$opt" - case "$opt" in - *.asm) uses_asm=true - ;; - esac - ;; - esac -done - -# Make one call to fix_path for file_list to improve performance. -fix_file_list - -outfile=${outfile:-/dev/stdout} -guid=${guid:-`generate_uuid`} -asm_use_custom_step=false -uses_asm=${uses_asm:-false} -case "${vs_ver:-8}" in - 7) vs_ver_id="7.10" - asm_use_custom_step=$uses_asm - warn_64bit='Detect64BitPortabilityProblems=true' - ;; - 8) vs_ver_id="8.00" - asm_use_custom_step=$uses_asm - warn_64bit='Detect64BitPortabilityProblems=true' - ;; - 9) vs_ver_id="9.00" - asm_use_custom_step=$uses_asm - warn_64bit='Detect64BitPortabilityProblems=false' - ;; -esac - -[ -n "$name" ] || die "Project name (--name) must be specified!" -[ -n "$target" ] || die "Target (--target) must be specified!" - -if ${use_static_runtime:-false}; then - release_runtime=0 - debug_runtime=1 - lib_sfx=mt -else - release_runtime=2 - debug_runtime=3 - lib_sfx=md -fi - -# Calculate debug lib names: If a lib ends in ${lib_sfx}.lib, then rename -# it to ${lib_sfx}d.lib. This precludes linking to release libs from a -# debug exe, so this may need to be refactored later. -for lib in ${libs}; do - if [ "$lib" != "${lib%${lib_sfx}.lib}" ]; then - lib=${lib%.lib}d.lib - fi - debug_libs="${debug_libs}${debug_libs:+ }${lib}" -done - - -# List Keyword for this target -case "$target" in - x86*) keyword="ManagedCProj" - ;; - *) die "Unsupported target $target!" -esac - -# List of all platforms supported for this target -case "$target" in - x86_64*) - platforms[0]="x64" - asm_Debug_cmdline="yasm -Xvc -g cv8 -f win64 ${yasmincs} "\$(InputPath)"" - asm_Release_cmdline="yasm -Xvc -f win64 ${yasmincs} "\$(InputPath)"" - ;; - x86*) - platforms[0]="Win32" - asm_Debug_cmdline="yasm -Xvc -g cv8 -f win32 ${yasmincs} "\$(InputPath)"" - asm_Release_cmdline="yasm -Xvc -f win32 ${yasmincs} "\$(InputPath)"" - ;; - *) die "Unsupported target $target!" - ;; -esac - -generate_vcproj() { - case "$proj_kind" in - exe) vs_ConfigurationType=1 - ;; - dll) vs_ConfigurationType=2 - ;; - *) vs_ConfigurationType=4 - ;; - esac - - echo "" - open_tag VisualStudioProject \ - ProjectType="Visual C++" \ - Version="${vs_ver_id}" \ - Name="${name}" \ - ProjectGUID="{${guid}}" \ - RootNamespace="${name}" \ - Keyword="${keyword}" \ - - open_tag Platforms - for plat in "${platforms[@]}"; do - tag Platform Name="$plat" - done - close_tag Platforms - - open_tag Configurations - for plat in "${platforms[@]}"; do - plat_no_ws=`echo $plat | sed 's/[^A-Za-z0-9_]/_/g'` - open_tag Configuration \ - Name="Debug|$plat" \ - OutputDirectory="\$(SolutionDir)$plat_no_ws/\$(ConfigurationName)" \ - IntermediateDirectory="$plat_no_ws/\$(ConfigurationName)/${name}" \ - ConfigurationType="$vs_ConfigurationType" \ - CharacterSet="1" \ - - case "$target" in - x86*) - case "$name" in - vpx) - tag Tool \ - Name="VCCLCompilerTool" \ - Optimization="0" \ - AdditionalIncludeDirectories="$incs" \ - PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \ - RuntimeLibrary="$debug_runtime" \ - UsePrecompiledHeader="0" \ - WarningLevel="3" \ - DebugInformationFormat="2" \ - $warn_64bit \ - - $uses_asm && tag Tool Name="YASM" IncludePaths="$incs" Debug="true" - ;; - *) - tag Tool \ - Name="VCCLCompilerTool" \ - Optimization="0" \ - AdditionalIncludeDirectories="$incs" \ - PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \ - RuntimeLibrary="$debug_runtime" \ - UsePrecompiledHeader="0" \ - WarningLevel="3" \ - DebugInformationFormat="2" \ - $warn_64bit \ - - $uses_asm && tag Tool Name="YASM" IncludePaths="$incs" Debug="true" - ;; - esac - ;; - esac - - case "$proj_kind" in - exe) - case "$target" in - x86*) - case "$name" in - *) - tag Tool \ - Name="VCLinkerTool" \ - AdditionalDependencies="$debug_libs \$(NoInherit)" \ - AdditionalLibraryDirectories="$libdirs" \ - GenerateDebugInformation="true" \ - ProgramDatabaseFile="\$(OutDir)/${name}.pdb" \ - ;; - esac - ;; - esac - ;; - lib) - case "$target" in - x86*) - tag Tool \ - Name="VCLibrarianTool" \ - OutputFile="\$(OutDir)/${name}${lib_sfx}d.lib" \ - - ;; - esac - ;; - dll) - tag Tool \ - Name="VCLinkerTool" \ - AdditionalDependencies="\$(NoInherit)" \ - LinkIncremental="2" \ - GenerateDebugInformation="true" \ - AssemblyDebug="1" \ - TargetMachine="1" \ - $link_opts \ - - ;; - esac - - close_tag Configuration - - open_tag Configuration \ - Name="Release|$plat" \ - OutputDirectory="\$(SolutionDir)$plat_no_ws/\$(ConfigurationName)" \ - IntermediateDirectory="$plat_no_ws/\$(ConfigurationName)/${name}" \ - ConfigurationType="$vs_ConfigurationType" \ - CharacterSet="1" \ - WholeProgramOptimization="0" \ - - case "$target" in - x86*) - case "$name" in - vpx) - tag Tool \ - Name="VCCLCompilerTool" \ - Optimization="2" \ - FavorSizeorSpeed="1" \ - AdditionalIncludeDirectories="$incs" \ - PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \ - RuntimeLibrary="$release_runtime" \ - UsePrecompiledHeader="0" \ - WarningLevel="3" \ - DebugInformationFormat="0" \ - $warn_64bit \ - - $uses_asm && tag Tool Name="YASM" IncludePaths="$incs" - ;; - *) - tag Tool \ - Name="VCCLCompilerTool" \ - AdditionalIncludeDirectories="$incs" \ - Optimization="2" \ - FavorSizeorSpeed="1" \ - PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \ - RuntimeLibrary="$release_runtime" \ - UsePrecompiledHeader="0" \ - WarningLevel="3" \ - DebugInformationFormat="0" \ - $warn_64bit \ - - $uses_asm && tag Tool Name="YASM" IncludePaths="$incs" - ;; - esac - ;; - esac - - case "$proj_kind" in - exe) - case "$target" in - x86*) - case "$name" in - *) - tag Tool \ - Name="VCLinkerTool" \ - AdditionalDependencies="$libs \$(NoInherit)" \ - AdditionalLibraryDirectories="$libdirs" \ - - ;; - esac - ;; - esac - ;; - lib) - case "$target" in - x86*) - tag Tool \ - Name="VCLibrarianTool" \ - OutputFile="\$(OutDir)/${name}${lib_sfx}.lib" \ - - ;; - esac - ;; - dll) # note differences to debug version: LinkIncremental, AssemblyDebug - tag Tool \ - Name="VCLinkerTool" \ - AdditionalDependencies="\$(NoInherit)" \ - LinkIncremental="1" \ - GenerateDebugInformation="true" \ - TargetMachine="1" \ - $link_opts \ - - ;; - esac - - close_tag Configuration - done - close_tag Configurations - - open_tag Files - generate_filter srcs "Source Files" "c;cc;cpp;def;odl;idl;hpj;bat;asm;asmx" - generate_filter hdrs "Header Files" "h;hm;inl;inc;xsd" - generate_filter resrcs "Resource Files" "rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" - generate_filter resrcs "Build Files" "mk" - close_tag Files - - tag Globals - close_tag VisualStudioProject - - # This must be done from within the {} subshell - echo "Ignored files list (${#file_list[@]} items) is:" >&2 - for f in "${file_list[@]}"; do - echo " $f" >&2 - done -} - -generate_vcproj | - sed -e '/"/s;\([^ "]\)/;\1\\;g' > ${outfile} - -exit - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/gen_msvs_sln.sh gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/gen_msvs_sln.sh --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/gen_msvs_sln.sh 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/gen_msvs_sln.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,324 +0,0 @@ -#!/bin/bash -## -## Copyright (c) 2010 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - - -self=$0 -self_basename=${self##*/} -EOL=$'\n' -EOLDOS=$'\r' - -show_help() { - cat <&2 - [ -f "${outfile}" ] && rm -f ${outfile}{,.mk} - exit 1 -} - -die_unknown(){ - echo "Unknown option \"$1\"." >&2 - echo "See ${self_basename} --help for available options." >&2 - [ -f "${outfile}" ] && rm -f ${outfile}{,.mk} - exit 1 -} - -indent1=$'\t' -indent="" -indent_push() { - indent="${indent}${indent1}" -} -indent_pop() { - indent="${indent%${indent1}}" -} - -parse_project() { - local file=$1 - if [ "$sfx" = "vcproj" ]; then - local name=`grep Name "$file" | awk 'BEGIN {FS="\""}{if (NR==1) print $2}'` - local guid=`grep ProjectGUID "$file" | awk 'BEGIN {FS="\""}{if (NR==1) print $2}'` - else - local name=`grep RootNamespace "$file" | sed 's,.*<.*>\(.*\).*,\1,'` - local guid=`grep ProjectGuid "$file" | sed 's,.*<.*>\(.*\).*,\1,'` - fi - - # save the project GUID to a varaible, normalizing to the basename of the - # vcproj file without the extension - local var - var=${file##*/} - var=${var%%.${sfx}} - eval "${var}_file=\"$1\"" - eval "${var}_name=$name" - eval "${var}_guid=$guid" - - if [ "$sfx" = "vcproj" ]; then - cur_config_list=`grep -A1 '/dev/null 2>&1 && echo yes) -.nodevenv.once: -${TAB}@echo " * \$(MSBUILD_TOOL) not found in path." -${TAB}@echo " * " -${TAB}@echo " * You will have to build all configurations manually using the" -${TAB}@echo " * Visual Studio IDE. To allow make to build them automatically," -${TAB}@echo " * add the Common7/IDE directory of your Visual Studio" -${TAB}@echo " * installation to your path, eg:" -${TAB}@echo " * C:\Program Files\Microsoft Visual Studio 8\Common7\IDE" -${TAB}@echo " * " -${TAB}@touch \$@ -CLEAN-OBJS += \$(if \$(found_devenv),,.nodevenv.once) - -EOF - - for sln_config in ${config_list}; do - local config=${sln_config%%|*} - local platform=${sln_config##*|} - local nows_sln_config=`echo $sln_config | sed -e 's/[^a-zA-Z0-9]/_/g'` - cat <${outfile} <>${outfile} -done -process_global >>${outfile} -process_makefile >${mkoutfile} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/gen_msvs_vcxproj.sh gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/gen_msvs_vcxproj.sh --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/gen_msvs_vcxproj.sh 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/gen_msvs_vcxproj.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,487 +0,0 @@ -#!/bin/bash -## -## Copyright (c) 2013 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - -self=$0 -self_basename=${self##*/} -self_dirname=$(dirname "$0") - -. "$self_dirname/msvs_common.sh"|| exit 127 - -show_help() { - cat <${content}" - indent_pop - else - echo "${indent}<${tag}>${content}" - fi -} - -generate_filter() { - local name=$1 - local pats=$2 - local file_list_sz - local i - local f - local saveIFS="$IFS" - local pack - echo "generating filter '$name' from ${#file_list[@]} files" >&2 - IFS=* - - file_list_sz=${#file_list[@]} - for i in ${!file_list[@]}; do - f=${file_list[i]} - for pat in ${pats//;/$IFS}; do - if [ "${f##*.}" == "$pat" ]; then - unset file_list[i] - - objf=$(echo ${f%.*}.obj \ - | sed -e "s,$src_path_bare,," \ - -e 's/^[\./]\+//g' -e 's,[:/ ],_,g') - - if ([ "$pat" == "asm" ] || [ "$pat" == "s" ]) && $asm_use_custom_step; then - # Avoid object file name collisions, i.e. vpx_config.c and - # vpx_config.asm produce the same object file without - # this additional suffix. - objf=${objf%.obj}_asm.obj - open_tag CustomBuild \ - Include="$f" - for plat in "${platforms[@]}"; do - for cfg in Debug Release; do - tag_content Message "Assembling %(Filename)%(Extension)" \ - Condition="'\$(Configuration)|\$(Platform)'=='$cfg|$plat'" - tag_content Command "$(eval echo \$asm_${cfg}_cmdline) -o \$(IntDir)$objf" \ - Condition="'\$(Configuration)|\$(Platform)'=='$cfg|$plat'" - tag_content Outputs "\$(IntDir)$objf" \ - Condition="'\$(Configuration)|\$(Platform)'=='$cfg|$plat'" - done - done - close_tag CustomBuild - elif [ "$pat" == "c" ] || \ - [ "$pat" == "cc" ] || [ "$pat" == "cpp" ]; then - open_tag ClCompile \ - Include="$f" - # Separate file names with Condition? - tag_content ObjectFileName "\$(IntDir)$objf" - # Check for AVX and turn it on to avoid warnings. - if [[ $f =~ avx.?\.c$ ]]; then - tag_content AdditionalOptions "/arch:AVX" - fi - close_tag ClCompile - elif [ "$pat" == "h" ] ; then - tag ClInclude \ - Include="$f" - elif [ "$pat" == "vcxproj" ] ; then - open_tag ProjectReference \ - Include="$f" - depguid=`grep ProjectGuid "$f" | sed 's,.*<.*>\(.*\).*,\1,'` - tag_content Project "$depguid" - tag_content ReferenceOutputAssembly false - close_tag ProjectReference - else - tag None \ - Include="$f" - fi - - break - fi - done - done - - IFS="$saveIFS" -} - -# Process command line -unset target -for opt in "$@"; do - optval="${opt#*=}" - case "$opt" in - --help|-h) show_help - ;; - --target=*) target="${optval}" - ;; - --out=*) outfile="$optval" - ;; - --name=*) name="${optval}" - ;; - --proj-guid=*) guid="${optval}" - ;; - --module-def=*) module_def="${optval}" - ;; - --exe) proj_kind="exe" - ;; - --dll) proj_kind="dll" - ;; - --lib) proj_kind="lib" - ;; - --src-path-bare=*) - src_path_bare=$(fix_path "$optval") - src_path_bare=${src_path_bare%/} - ;; - --static-crt) use_static_runtime=true - ;; - --enable-werror) werror=true - ;; - --ver=*) - vs_ver="$optval" - case "$optval" in - 10|11|12) - ;; - *) die Unrecognized Visual Studio Version in $opt - ;; - esac - ;; - -I*) - opt=${opt##-I} - opt=$(fix_path "$opt") - opt="${opt%/}" - incs="${incs}${incs:+;}"${opt}"" - yasmincs="${yasmincs} -I"${opt}"" - ;; - -D*) defines="${defines}${defines:+;}${opt##-D}" - ;; - -L*) # fudge . to $(OutDir) - if [ "${opt##-L}" == "." ]; then - libdirs="${libdirs}${libdirs:+;}"\$(OutDir)"" - else - # Also try directories for this platform/configuration - opt=${opt##-L} - opt=$(fix_path "$opt") - libdirs="${libdirs}${libdirs:+;}"${opt}"" - libdirs="${libdirs}${libdirs:+;}"${opt}/\$(PlatformName)/\$(Configuration)"" - libdirs="${libdirs}${libdirs:+;}"${opt}/\$(PlatformName)"" - fi - ;; - -l*) libs="${libs}${libs:+ }${opt##-l}.lib" - ;; - -*) die_unknown $opt - ;; - *) - # The paths in file_list are fixed outside of the loop. - file_list[${#file_list[@]}]="$opt" - case "$opt" in - *.asm|*.s) uses_asm=true - ;; - esac - ;; - esac -done - -# Make one call to fix_path for file_list to improve performance. -fix_file_list - -outfile=${outfile:-/dev/stdout} -guid=${guid:-`generate_uuid`} -asm_use_custom_step=false -uses_asm=${uses_asm:-false} -case "${vs_ver:-11}" in - 10|11|12) - asm_use_custom_step=$uses_asm - ;; -esac - -[ -n "$name" ] || die "Project name (--name) must be specified!" -[ -n "$target" ] || die "Target (--target) must be specified!" - -if ${use_static_runtime:-false}; then - release_runtime=MultiThreaded - debug_runtime=MultiThreadedDebug - lib_sfx=mt -else - release_runtime=MultiThreadedDLL - debug_runtime=MultiThreadedDebugDLL - lib_sfx=md -fi - -# Calculate debug lib names: If a lib ends in ${lib_sfx}.lib, then rename -# it to ${lib_sfx}d.lib. This precludes linking to release libs from a -# debug exe, so this may need to be refactored later. -for lib in ${libs}; do - if [ "$lib" != "${lib%${lib_sfx}.lib}" ]; then - lib=${lib%.lib}d.lib - fi - debug_libs="${debug_libs}${debug_libs:+ }${lib}" -done -debug_libs=${debug_libs// /;} -libs=${libs// /;} - - -# List of all platforms supported for this target -case "$target" in - x86_64*) - platforms[0]="x64" - asm_Debug_cmdline="yasm -Xvc -g cv8 -f win64 ${yasmincs} "%(FullPath)"" - asm_Release_cmdline="yasm -Xvc -f win64 ${yasmincs} "%(FullPath)"" - ;; - x86*) - platforms[0]="Win32" - asm_Debug_cmdline="yasm -Xvc -g cv8 -f win32 ${yasmincs} "%(FullPath)"" - asm_Release_cmdline="yasm -Xvc -f win32 ${yasmincs} "%(FullPath)"" - ;; - arm*) - platforms[0]="ARM" - asm_Debug_cmdline="armasm -nologo "%(FullPath)"" - asm_Release_cmdline="armasm -nologo "%(FullPath)"" - ;; - *) die "Unsupported target $target!" - ;; -esac - -generate_vcxproj() { - echo "" - open_tag Project \ - DefaultTargets="Build" \ - ToolsVersion="4.0" \ - xmlns="http://schemas.microsoft.com/developer/msbuild/2003" \ - - open_tag ItemGroup \ - Label="ProjectConfigurations" - for plat in "${platforms[@]}"; do - for config in Debug Release; do - open_tag ProjectConfiguration \ - Include="$config|$plat" - tag_content Configuration $config - tag_content Platform $plat - close_tag ProjectConfiguration - done - done - close_tag ItemGroup - - open_tag PropertyGroup \ - Label="Globals" - tag_content ProjectGuid "{${guid}}" - tag_content RootNamespace ${name} - tag_content Keyword ManagedCProj - if [ $vs_ver -ge 12 ] && [ "${platforms[0]}" = "ARM" ]; then - tag_content AppContainerApplication true - # The application type can be one of "Windows Store", - # "Windows Phone" or "Windows Phone Silverlight". The - # actual value doesn't matter from the libvpx point of view, - # since a static library built for one works on the others. - # The PlatformToolset field needs to be set in sync with this; - # for Windows Store and Windows Phone Silverlight it should be - # v120 while it should be v120_wp81 if the type is Windows Phone. - tag_content ApplicationType "Windows Store" - tag_content ApplicationTypeRevision 8.1 - fi - close_tag PropertyGroup - - tag Import \ - Project="\$(VCTargetsPath)\\Microsoft.Cpp.Default.props" - - for plat in "${platforms[@]}"; do - for config in Release Debug; do - open_tag PropertyGroup \ - Condition="'\$(Configuration)|\$(Platform)'=='$config|$plat'" \ - Label="Configuration" - if [ "$proj_kind" = "exe" ]; then - tag_content ConfigurationType Application - elif [ "$proj_kind" = "dll" ]; then - tag_content ConfigurationType DynamicLibrary - else - tag_content ConfigurationType StaticLibrary - fi - if [ "$vs_ver" = "11" ]; then - if [ "$plat" = "ARM" ]; then - # Setting the wp80 toolchain automatically sets the - # WINAPI_FAMILY define, which is required for building - # code for arm with the windows headers. Alternatively, - # one could add AppContainerApplication=true in the Globals - # section and add PrecompiledHeader=NotUsing and - # CompileAsWinRT=false in ClCompile and SubSystem=Console - # in Link. - tag_content PlatformToolset v110_wp80 - else - tag_content PlatformToolset v110 - fi - fi - if [ "$vs_ver" = "12" ]; then - # Setting a PlatformToolset indicating windows phone isn't - # enough to build code for arm with MSVC 2013, one strictly - # has to enable AppContainerApplication as well. - tag_content PlatformToolset v120 - fi - tag_content CharacterSet Unicode - if [ "$config" = "Release" ]; then - tag_content WholeProgramOptimization true - fi - close_tag PropertyGroup - done - done - - tag Import \ - Project="\$(VCTargetsPath)\\Microsoft.Cpp.props" - - open_tag ImportGroup \ - Label="PropertySheets" - tag Import \ - Project="\$(UserRootDir)\\Microsoft.Cpp.\$(Platform).user.props" \ - Condition="exists('\$(UserRootDir)\\Microsoft.Cpp.\$(Platform).user.props')" \ - Label="LocalAppDataPlatform" - close_tag ImportGroup - - tag PropertyGroup \ - Label="UserMacros" - - for plat in "${platforms[@]}"; do - plat_no_ws=`echo $plat | sed 's/[^A-Za-z0-9_]/_/g'` - for config in Debug Release; do - open_tag PropertyGroup \ - Condition="'\$(Configuration)|\$(Platform)'=='$config|$plat'" - tag_content OutDir "\$(SolutionDir)$plat_no_ws\\\$(Configuration)\\" - tag_content IntDir "$plat_no_ws\\\$(Configuration)\\${name}\\" - if [ "$proj_kind" == "lib" ]; then - if [ "$config" == "Debug" ]; then - config_suffix=d - else - config_suffix="" - fi - tag_content TargetName "${name}${lib_sfx}${config_suffix}" - fi - close_tag PropertyGroup - done - done - - for plat in "${platforms[@]}"; do - for config in Debug Release; do - open_tag ItemDefinitionGroup \ - Condition="'\$(Configuration)|\$(Platform)'=='$config|$plat'" - if [ "$name" == "vpx" ]; then - hostplat=$plat - if [ "$hostplat" == "ARM" ]; then - hostplat=Win32 - fi - fi - open_tag ClCompile - if [ "$config" = "Debug" ]; then - opt=Disabled - runtime=$debug_runtime - curlibs=$debug_libs - debug=_DEBUG - else - opt=MaxSpeed - runtime=$release_runtime - curlibs=$libs - tag_content FavorSizeOrSpeed Speed - debug=NDEBUG - fi - extradefines=";$defines" - tag_content Optimization $opt - tag_content AdditionalIncludeDirectories "$incs;%(AdditionalIncludeDirectories)" - tag_content PreprocessorDefinitions "WIN32;$debug;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE$extradefines;%(PreprocessorDefinitions)" - tag_content RuntimeLibrary $runtime - tag_content WarningLevel Level3 - if ${werror:-false}; then - tag_content TreatWarningAsError true - fi - if [ $vs_ver -ge 11 ]; then - # We need to override the defaults for these settings - # if AppContainerApplication is set. - tag_content CompileAsWinRT false - tag_content PrecompiledHeader NotUsing - tag_content SDLCheck false - fi - close_tag ClCompile - case "$proj_kind" in - exe) - open_tag Link - tag_content GenerateDebugInformation true - # Console is the default normally, but if - # AppContainerApplication is set, we need to override it. - tag_content SubSystem Console - close_tag Link - ;; - dll) - open_tag Link - tag_content GenerateDebugInformation true - tag_content ModuleDefinitionFile $module_def - close_tag Link - ;; - lib) - ;; - esac - close_tag ItemDefinitionGroup - done - - done - - open_tag ItemGroup - generate_filter "Source Files" "c;cc;cpp;def;odl;idl;hpj;bat;asm;asmx;s" - close_tag ItemGroup - open_tag ItemGroup - generate_filter "Header Files" "h;hm;inl;inc;xsd" - close_tag ItemGroup - open_tag ItemGroup - generate_filter "Build Files" "mk" - close_tag ItemGroup - open_tag ItemGroup - generate_filter "References" "vcxproj" - close_tag ItemGroup - - tag Import \ - Project="\$(VCTargetsPath)\\Microsoft.Cpp.targets" - - open_tag ImportGroup \ - Label="ExtensionTargets" - close_tag ImportGroup - - close_tag Project - - # This must be done from within the {} subshell - echo "Ignored files list (${#file_list[@]} items) is:" >&2 - for f in "${file_list[@]}"; do - echo " $f" >&2 - done -} - -# This regexp doesn't catch most of the strings in the vcxproj format, -# since they're like path instead of -# as previously. It still seems to work ok despite this. -generate_vcxproj | - sed -e '/"/s;\([^ "]\)/;\1\\;g' | - sed -e '/xmlns/s;\\;/;g' > ${outfile} - -exit diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/iosbuild.sh gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/iosbuild.sh --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/iosbuild.sh 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/iosbuild.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,274 +0,0 @@ -#!/bin/sh -## -## Copyright (c) 2014 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## -## -## This script generates 'VPX.framework'. An iOS app can encode and decode VPx -## video by including 'VPX.framework'. -## -## Run iosbuild.sh to create 'VPX.framework' in the current directory. -## -set -e -devnull='> /dev/null 2>&1' - -BUILD_ROOT="_iosbuild" -CONFIGURE_ARGS="--disable-docs - --disable-examples - --disable-libyuv - --disable-unit-tests" -DIST_DIR="_dist" -FRAMEWORK_DIR="VPX.framework" -HEADER_DIR="${FRAMEWORK_DIR}/Headers/vpx" -MAKE_JOBS=1 -SCRIPT_DIR=$(dirname "$0") -LIBVPX_SOURCE_DIR=$(cd ${SCRIPT_DIR}/../..; pwd) -LIPO=$(xcrun -sdk iphoneos${SDK} -find lipo) -ORIG_PWD="$(pwd)" -TARGETS="arm64-darwin-gcc - armv7-darwin-gcc - armv7s-darwin-gcc - x86-iphonesimulator-gcc - x86_64-iphonesimulator-gcc" - -# Configures for the target specified by $1, and invokes make with the dist -# target using $DIST_DIR as the distribution output directory. -build_target() { - local target="$1" - local old_pwd="$(pwd)" - - vlog "***Building target: ${target}***" - - mkdir "${target}" - cd "${target}" - eval "${LIBVPX_SOURCE_DIR}/configure" --target="${target}" \ - ${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS} ${devnull} - export DIST_DIR - eval make -j ${MAKE_JOBS} dist ${devnull} - cd "${old_pwd}" - - vlog "***Done building target: ${target}***" -} - -# Returns the preprocessor symbol for the target specified by $1. -target_to_preproc_symbol() { - target="$1" - case "${target}" in - arm64-*) - echo "__aarch64__" - ;; - armv7-*) - echo "__ARM_ARCH_7A__" - ;; - armv7s-*) - echo "__ARM_ARCH_7S__" - ;; - x86-*) - echo "__i386__" - ;; - x86_64-*) - echo "__x86_64__" - ;; - *) - echo "#error ${target} unknown/unsupported" - return 1 - ;; - esac -} - -# Create a vpx_config.h shim that, based on preprocessor settings for the -# current target CPU, includes the real vpx_config.h for the current target. -# $1 is the list of targets. -create_vpx_framework_config_shim() { - local targets="$1" - local config_file="${HEADER_DIR}/vpx_config.h" - local preproc_symbol="" - local target="" - local include_guard="VPX_FRAMEWORK_HEADERS_VPX_VPX_CONFIG_H_" - - local file_header="/* - * Copyright (c) $(date +%Y) The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -/* GENERATED FILE: DO NOT EDIT! */ - -#ifndef ${include_guard} -#define ${include_guard} - -#if defined" - - printf "%s" "${file_header}" > "${config_file}" - for target in ${targets}; do - preproc_symbol=$(target_to_preproc_symbol "${target}") - printf " ${preproc_symbol}\n" >> "${config_file}" - printf "#define VPX_FRAMEWORK_TARGET \"${target}\"\n" >> "${config_file}" - printf "#include \"VPX/vpx/${target}/vpx_config.h\"\n" >> "${config_file}" - printf "#elif defined" >> "${config_file}" - mkdir "${HEADER_DIR}/${target}" - cp -p "${BUILD_ROOT}/${target}/vpx_config.h" "${HEADER_DIR}/${target}" - done - - # Consume the last line of output from the loop: We don't want it. - sed -i '' -e '$d' "${config_file}" - - printf "#endif\n\n" >> "${config_file}" - printf "#endif // ${include_guard}" >> "${config_file}" -} - -# Configures and builds each target specified by $1, and then builds -# VPX.framework. -build_framework() { - local lib_list="" - local targets="$1" - local target="" - local target_dist_dir="" - - # Clean up from previous build(s). - rm -rf "${BUILD_ROOT}" "${FRAMEWORK_DIR}" - - # Create output dirs. - mkdir -p "${BUILD_ROOT}" - mkdir -p "${HEADER_DIR}" - - cd "${BUILD_ROOT}" - - for target in ${targets}; do - build_target "${target}" - target_dist_dir="${BUILD_ROOT}/${target}/${DIST_DIR}" - lib_list="${lib_list} ${target_dist_dir}/lib/libvpx.a" - done - - cd "${ORIG_PWD}" - - # The basic libvpx API includes are all the same; just grab the most recent - # set. - cp -p "${target_dist_dir}"/include/vpx/* "${HEADER_DIR}" - - # Build the fat library. - ${LIPO} -create ${lib_list} -output ${FRAMEWORK_DIR}/VPX - - # Create the vpx_config.h shim that allows usage of vpx_config.h from - # within VPX.framework. - create_vpx_framework_config_shim "${targets}" - - # Copy in vpx_version.h. - cp -p "${BUILD_ROOT}/${target}/vpx_version.h" "${HEADER_DIR}" - - vlog "Created fat library ${FRAMEWORK_DIR}/VPX containing:" - for lib in ${lib_list}; do - vlog " $(echo ${lib} | awk -F / '{print $2, $NF}')" - done - - # TODO(tomfinegan): Verify that expected targets are included within - # VPX.framework/VPX via lipo -info. -} - -# Trap function. Cleans up the subtree used to build all targets contained in -# $TARGETS. -cleanup() { - local readonly res=$? - cd "${ORIG_PWD}" - - if [ $res -ne 0 ]; then - elog "build exited with error ($res)" - fi - - if [ "${PRESERVE_BUILD_OUTPUT}" != "yes" ]; then - rm -rf "${BUILD_ROOT}" - fi -} - -iosbuild_usage() { -cat << EOF - Usage: ${0##*/} [arguments] - --help: Display this message and exit. - --extra-configure-args : Extra args to pass when configuring libvpx. - --jobs: Number of make jobs. - --preserve-build-output: Do not delete the build directory. - --show-build-output: Show output from each library build. - --targets : Override default target list. Defaults: - ${TARGETS} - --verbose: Output information about the environment and each stage of the - build. -EOF -} - -elog() { - echo "${0##*/} failed because: $@" 1>&2 -} - -vlog() { - if [ "${VERBOSE}" = "yes" ]; then - echo "$@" - fi -} - -trap cleanup EXIT - -# Parse the command line. -while [ -n "$1" ]; do - case "$1" in - --extra-configure-args) - EXTRA_CONFIGURE_ARGS="$2" - shift - ;; - --help) - iosbuild_usage - exit - ;; - --jobs) - MAKE_JOBS="$2" - shift - ;; - --preserve-build-output) - PRESERVE_BUILD_OUTPUT=yes - ;; - --show-build-output) - devnull= - ;; - --targets) - TARGETS="$2" - shift - ;; - --verbose) - VERBOSE=yes - ;; - *) - iosbuild_usage - exit 1 - ;; - esac - shift -done - -if [ "${VERBOSE}" = "yes" ]; then -cat << EOF - BUILD_ROOT=${BUILD_ROOT} - DIST_DIR=${DIST_DIR} - CONFIGURE_ARGS=${CONFIGURE_ARGS} - EXTRA_CONFIGURE_ARGS=${EXTRA_CONFIGURE_ARGS} - FRAMEWORK_DIR=${FRAMEWORK_DIR} - HEADER_DIR=${HEADER_DIR} - MAKE_JOBS=${MAKE_JOBS} - PRESERVE_BUILD_OUTPUT=${PRESERVE_BUILD_OUTPUT} - LIBVPX_SOURCE_DIR=${LIBVPX_SOURCE_DIR} - LIPO=${LIPO} - ORIG_PWD=${ORIG_PWD} - TARGETS="${TARGETS}" -EOF -fi - -build_framework "${TARGETS}" -echo "Successfully built '${FRAMEWORK_DIR}' for:" -echo " ${TARGETS}" diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/Makefile gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/Makefile --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/Makefile 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,453 +0,0 @@ -## -## Copyright (c) 2010 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - - -include config.mk -quiet?=true -ifeq ($(target),) -# If a target wasn't specified, invoke for all enabled targets. -.DEFAULT: - @for t in $(ALL_TARGETS); do \ - $(MAKE) --no-print-directory target=$$t $(MAKECMDGOALS) || exit $$?;\ - done -all: .DEFAULT -clean:: .DEFAULT -exampletest: .DEFAULT -install:: .DEFAULT -test:: .DEFAULT -testdata:: .DEFAULT -utiltest: .DEFAULT - - -# Note: md5sum is not installed on OS X, but openssl is. Openssl may not be -# installed on cygwin, so we need to autodetect here. -md5sum := $(firstword $(wildcard \ - $(foreach e,md5sum openssl,\ - $(foreach p,$(subst :, ,$(PATH)),$(p)/$(e)*))\ - )) -md5sum := $(if $(filter %openssl,$(md5sum)),$(md5sum) dgst -md5,$(md5sum)) - -TGT_CC:=$(word 3, $(subst -, ,$(TOOLCHAIN))) -dist: - @for t in $(ALL_TARGETS); do \ - $(MAKE) --no-print-directory target=$$t $(MAKECMDGOALS) || exit $$?;\ - done - # Run configure for the user with the current toolchain. - @if [ -d "$(DIST_DIR)/src" ]; then \ - mkdir -p "$(DIST_DIR)/build"; \ - cd "$(DIST_DIR)/build"; \ - echo "Rerunning configure $(CONFIGURE_ARGS)"; \ - ../src/configure $(CONFIGURE_ARGS); \ - $(if $(filter vs%,$(TGT_CC)),make NO_LAUNCH_DEVENV=1;) \ - fi - @if [ -d "$(DIST_DIR)" ]; then \ - echo " [MD5SUM] $(DIST_DIR)"; \ - cd $(DIST_DIR) && \ - $(md5sum) `find . -name md5sums.txt -prune -o -type f -print` \ - | sed -e 's/MD5(\(.*\))= \([0-9a-f]\{32\}\)/\2 \1/' \ - > md5sums.txt;\ - fi -endif - -ifneq ($(target),) -# Normally, we want to build the filename from the target and the toolchain. -# This disambiguates from the $(target).mk file that exists in the source tree. -# However, the toolchain is part of the target in universal builds, so we -# don't want to include TOOLCHAIN in that case. FAT_ARCHS is used to test -# if we're in the universal case. -include $(target)$(if $(FAT_ARCHS),,-$(TOOLCHAIN)).mk -endif -BUILD_ROOT?=. -VPATH=$(SRC_PATH_BARE) -CFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT) -I$(SRC_PATH) -CXXFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT) -I$(SRC_PATH) -ASFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT)/ -I$(SRC_PATH)/ -DIST_DIR?=dist -HOSTCC?=gcc -TGT_ISA:=$(word 1, $(subst -, ,$(TOOLCHAIN))) -TGT_OS:=$(word 2, $(subst -, ,$(TOOLCHAIN))) -TGT_CC:=$(word 3, $(subst -, ,$(TOOLCHAIN))) -quiet:=$(if $(or $(verbose), $(V)),, yes) -qexec=$(if $(quiet),@) - -# Cancel built-in implicit rules -%: %.o -%.asm: -%.a: -%: %.cc - -# -# Common rules" -# -.PHONY: all -all: - -.PHONY: clean -clean:: - rm -f $(OBJS-yes) $(OBJS-yes:.o=.d) $(OBJS-yes:.asm.s.o=.asm.s) - rm -f $(CLEAN-OBJS) - -.PHONY: clean -distclean: clean - if [ -z "$(target)" ]; then \ - rm -f Makefile; \ - rm -f config.log config.mk; \ - rm -f vpx_config.[hc] vpx_config.asm; \ - else \ - rm -f $(target)-$(TOOLCHAIN).mk; \ - fi - -.PHONY: dist -dist: -.PHONY: exampletest -exampletest: -.PHONY: install -install:: -.PHONY: test -test:: -.PHONY: testdata -testdata:: -.PHONY: utiltest -utiltest: - -# Add compiler flags for intrinsic files -ifeq ($(TOOLCHAIN), x86-os2-gcc) -STACKREALIGN=-mstackrealign -else -STACKREALIGN= -endif - -$(BUILD_PFX)%_mmx.c.d: CFLAGS += -mmmx -$(BUILD_PFX)%_mmx.c.o: CFLAGS += -mmmx -$(BUILD_PFX)%_sse2.c.d: CFLAGS += -msse2 $(STACKREALIGN) -$(BUILD_PFX)%_sse2.c.o: CFLAGS += -msse2 $(STACKREALIGN) -$(BUILD_PFX)%_sse3.c.d: CFLAGS += -msse3 $(STACKREALIGN) -$(BUILD_PFX)%_sse3.c.o: CFLAGS += -msse3 $(STACKREALIGN) -$(BUILD_PFX)%_ssse3.c.d: CFLAGS += -mssse3 $(STACKREALIGN) -$(BUILD_PFX)%_ssse3.c.o: CFLAGS += -mssse3 $(STACKREALIGN) -$(BUILD_PFX)%_sse4.c.d: CFLAGS += -msse4.1 $(STACKREALIGN) -$(BUILD_PFX)%_sse4.c.o: CFLAGS += -msse4.1 $(STACKREALIGN) -$(BUILD_PFX)%_avx.c.d: CFLAGS += -mavx $(STACKREALIGN) -$(BUILD_PFX)%_avx.c.o: CFLAGS += -mavx $(STACKREALIGN) -$(BUILD_PFX)%_avx2.c.d: CFLAGS += -mavx2 $(STACKREALIGN) -$(BUILD_PFX)%_avx2.c.o: CFLAGS += -mavx2 $(STACKREALIGN) - -$(BUILD_PFX)%.c.d: %.c - $(if $(quiet),@echo " [DEP] $@") - $(qexec)mkdir -p $(dir $@) - $(qexec)$(CC) $(INTERNAL_CFLAGS) $(CFLAGS) -M $< | $(fmt_deps) > $@ - -$(BUILD_PFX)%.c.o: %.c - $(if $(quiet),@echo " [CC] $@") - $(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@)) - $(qexec)$(CC) $(INTERNAL_CFLAGS) $(CFLAGS) -c -o $@ $< - -$(BUILD_PFX)%.cc.d: %.cc - $(if $(quiet),@echo " [DEP] $@") - $(qexec)mkdir -p $(dir $@) - $(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -M $< | $(fmt_deps) > $@ - -$(BUILD_PFX)%.cc.o: %.cc - $(if $(quiet),@echo " [CXX] $@") - $(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@)) - $(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -c -o $@ $< - -$(BUILD_PFX)%.cpp.d: %.cpp - $(if $(quiet),@echo " [DEP] $@") - $(qexec)mkdir -p $(dir $@) - $(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -M $< | $(fmt_deps) > $@ - -$(BUILD_PFX)%.cpp.o: %.cpp - $(if $(quiet),@echo " [CXX] $@") - $(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@)) - $(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -c -o $@ $< - -$(BUILD_PFX)%.asm.d: %.asm - $(if $(quiet),@echo " [DEP] $@") - $(qexec)mkdir -p $(dir $@) - $(qexec)$(SRC_PATH_BARE)/build/make/gen_asm_deps.sh \ - --build-pfx=$(BUILD_PFX) --depfile=$@ $(ASFLAGS) $< > $@ - -$(BUILD_PFX)%.asm.o: %.asm - $(if $(quiet),@echo " [AS] $@") - $(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@)) - $(qexec)$(AS) $(ASFLAGS) -o $@ $< - -$(BUILD_PFX)%.s.d: %.s - $(if $(quiet),@echo " [DEP] $@") - $(qexec)mkdir -p $(dir $@) - $(qexec)$(SRC_PATH_BARE)/build/make/gen_asm_deps.sh \ - --build-pfx=$(BUILD_PFX) --depfile=$@ $(ASFLAGS) $< > $@ - -$(BUILD_PFX)%.s.o: %.s - $(if $(quiet),@echo " [AS] $@") - $(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@)) - $(qexec)$(AS) $(ASFLAGS) -o $@ $< - -.PRECIOUS: %.c.S -%.c.S: CFLAGS += -DINLINE_ASM -$(BUILD_PFX)%.c.S: %.c - $(if $(quiet),@echo " [GEN] $@") - $(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@)) - $(qexec)$(CC) -S $(CFLAGS) -o $@ $< - -.PRECIOUS: %.asm.s -$(BUILD_PFX)%.asm.s: %.asm - $(if $(quiet),@echo " [ASM CONVERSION] $@") - $(qexec)mkdir -p $(dir $@) - $(qexec)$(ASM_CONVERSION) <$< >$@ - -# If we're in debug mode, pretend we don't have GNU strip, to fall back to -# the copy implementation -HAVE_GNU_STRIP := $(if $(CONFIG_DEBUG),,$(HAVE_GNU_STRIP)) -ifeq ($(HAVE_GNU_STRIP),yes) -# Older binutils strip global symbols not needed for relocation processing -# when given --strip-unneeded. Using nm and awk to identify globals and -# keep them caused command line length issues under mingw and segfaults in -# test_libvpx were observed under OS/2: simply use --strip-debug. -%.a: %_g.a - $(if $(quiet),@echo " [STRIP] $@ < $<") - $(qexec)$(STRIP) --strip-debug \ - -o $@ $< -else -%.a: %_g.a - $(if $(quiet),@echo " [CP] $@ < $<") - $(qexec)cp $< $@ -endif - -# -# Utility functions -# -pairmap=$(if $(strip $(2)),\ - $(call $(1),$(word 1,$(2)),$(word 2,$(2)))\ - $(call pairmap,$(1),$(wordlist 3,$(words $(2)),$(2)))\ -) - -enabled=$(filter-out $($(1)-no),$($(1)-yes)) -cond_enabled=$(if $(filter yes,$($(1))), $(call enabled,$(2))) - -find_file1=$(word 1,$(wildcard $(subst //,/,$(addsuffix /$(1),$(2))))) -find_file=$(foreach f,$(1),$(call find_file1,$(strip $(f)),$(strip $(2))) ) -obj_pats=.c=.c.o $(AS_SFX)=$(AS_SFX).o .cc=.cc.o .cpp=.cpp.o -objs=$(addprefix $(BUILD_PFX),$(foreach p,$(obj_pats),$(filter %.o,$(1:$(p))) )) - -install_map_templates=$(eval $(call install_map_template,$(1),$(2))) - -not=$(subst yes,no,$(1)) - -ifeq ($(CONFIG_MSVS),yes) -lib_file_name=$(1).lib -else -lib_file_name=lib$(1).a -endif -# -# Rule Templates -# -define linker_template -$(1): $(filter-out -%,$(2)) -$(1): - $(if $(quiet),@echo " [LD] $$@") - $(qexec)$$(LD) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs)) -endef -define linkerxx_template -$(1): $(filter-out -%,$(2)) -$(1): - $(if $(quiet),@echo " [LD] $$@") - $(qexec)$$(CXX) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs)) -endef -# make-3.80 has a bug with expanding large input strings to the eval function, -# which was triggered in some cases by the following component of -# linker_template: -# $(1): $$(call find_file, $(patsubst -l%,lib%.a,$(filter -l%,$(2))),\ -# $$(patsubst -L%,%,$$(filter -L%,$$(LDFLAGS) $(2)))) -# This may be useful to revisit in the future (it tries to locate libraries -# in a search path and add them as prerequisites - -define install_map_template -$(DIST_DIR)/$(1): $(2) - $(if $(quiet),@echo " [INSTALL] $$@") - $(qexec)mkdir -p $$(dir $$@) - $(qexec)cp -p $$< $$@ -endef - -define archive_template -# Not using a pattern rule here because we don't want to generate empty -# archives when they are listed as a dependency in files not responsible -# for creating them. -$(1): - $(if $(quiet),@echo " [AR] $$@") - $(qexec)$$(AR) $$(ARFLAGS) $$@ $$? -endef - -define so_template -# Not using a pattern rule here because we don't want to generate empty -# archives when they are listed as a dependency in files not responsible -# for creating them. -# -# This needs further abstraction for dealing with non-GNU linkers. -$(1): - $(if $(quiet),@echo " [LD] $$@") - $(qexec)$$(LD) -shared $$(LDFLAGS) \ - -Wl,--no-undefined -Wl,-soname,$$(SONAME) \ - -Wl,--version-script,$$(EXPORTS_FILE) -o $$@ \ - $$(filter %.o,$$^) $$(extralibs) -endef - -define dl_template -# Not using a pattern rule here because we don't want to generate empty -# archives when they are listed as a dependency in files not responsible -# for creating them. -$(1): - $(if $(quiet),@echo " [LD] $$@") - $(qexec)$$(LD) -dynamiclib $$(LDFLAGS) \ - -exported_symbols_list $$(EXPORTS_FILE) \ - -Wl,-headerpad_max_install_names,-compatibility_version,1.0,-current_version,$$(VERSION_MAJOR) \ - -o $$@ \ - $$(filter %.o,$$^) $$(extralibs) -endef - - - -define lipo_lib_template -$(1): $(addsuffix /$(1),$(FAT_ARCHS)) - $(if $(quiet),@echo " [LIPO] $$@") - $(qexec)libtool -static -o $$@ $$? -endef - -define lipo_bin_template -$(1): $(addsuffix /$(1),$(FAT_ARCHS)) - $(if $(quiet),@echo " [LIPO] $$@") - $(qexec)lipo -output $$@ -create $$? -endef - - -# -# Get current configuration -# -ifneq ($(target),) -include $(SRC_PATH_BARE)/$(target:-$(TOOLCHAIN)=).mk -endif - -skip_deps := $(filter %clean,$(MAKECMDGOALS)) -skip_deps += $(findstring testdata,$(MAKECMDGOALS)) -ifeq ($(strip $(skip_deps)),) - ifeq ($(CONFIG_DEPENDENCY_TRACKING),yes) - # Older versions of make don't like -include directives with no arguments - ifneq ($(filter %.d,$(OBJS-yes:.o=.d)),) - -include $(filter %.d,$(OBJS-yes:.o=.d)) - endif - endif -endif - -# -# Configuration dependent rules -# -$(call pairmap,install_map_templates,$(INSTALL_MAPS)) - -DOCS=$(call cond_enabled,CONFIG_INSTALL_DOCS,DOCS) -.docs: $(DOCS) - @touch $@ - -INSTALL-DOCS=$(call cond_enabled,CONFIG_INSTALL_DOCS,INSTALL-DOCS) -ifeq ($(MAKECMDGOALS),dist) -INSTALL-DOCS+=$(call cond_enabled,CONFIG_INSTALL_DOCS,DIST-DOCS) -endif -.install-docs: .docs $(addprefix $(DIST_DIR)/,$(INSTALL-DOCS)) - @touch $@ - -clean:: - rm -f .docs .install-docs $(DOCS) - -BINS=$(call enabled,BINS) -.bins: $(BINS) - @touch $@ - -INSTALL-BINS=$(call cond_enabled,CONFIG_INSTALL_BINS,INSTALL-BINS) -ifeq ($(MAKECMDGOALS),dist) -INSTALL-BINS+=$(call cond_enabled,CONFIG_INSTALL_BINS,DIST-BINS) -endif -.install-bins: .bins $(addprefix $(DIST_DIR)/,$(INSTALL-BINS)) - @touch $@ - -clean:: - rm -f .bins .install-bins $(BINS) - -LIBS=$(call enabled,LIBS) -.libs: $(LIBS) - @touch $@ -$(foreach lib,$(filter %_g.a,$(LIBS)),$(eval $(call archive_template,$(lib)))) -$(foreach lib,$(filter %so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH),$(LIBS)),$(eval $(call so_template,$(lib)))) -$(foreach lib,$(filter %$(SO_VERSION_MAJOR).dylib,$(LIBS)),$(eval $(call dl_template,$(lib)))) - -INSTALL-LIBS=$(call cond_enabled,CONFIG_INSTALL_LIBS,INSTALL-LIBS) -ifeq ($(MAKECMDGOALS),dist) -INSTALL-LIBS+=$(call cond_enabled,CONFIG_INSTALL_LIBS,DIST-LIBS) -endif -.install-libs: .libs $(addprefix $(DIST_DIR)/,$(INSTALL-LIBS)) - @touch $@ - -clean:: - rm -f .libs .install-libs $(LIBS) - -ifeq ($(CONFIG_EXTERNAL_BUILD),yes) -PROJECTS=$(call enabled,PROJECTS) -.projects: $(PROJECTS) - @touch $@ - -INSTALL-PROJECTS=$(call cond_enabled,CONFIG_INSTALL_PROJECTS,INSTALL-PROJECTS) -ifeq ($(MAKECMDGOALS),dist) -INSTALL-PROJECTS+=$(call cond_enabled,CONFIG_INSTALL_PROJECTS,DIST-PROJECTS) -endif -.install-projects: .projects $(addprefix $(DIST_DIR)/,$(INSTALL-PROJECTS)) - @touch $@ - -clean:: - rm -f .projects .install-projects $(PROJECTS) -endif - -# If there are any source files to be distributed, then include the build -# system too. -ifneq ($(call enabled,DIST-SRCS),) - DIST-SRCS-yes += configure - DIST-SRCS-yes += build/make/configure.sh - DIST-SRCS-yes += build/make/gen_asm_deps.sh - DIST-SRCS-yes += build/make/Makefile - DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_def.sh - DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_proj.sh - DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_sln.sh - DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_vcxproj.sh - DIST-SRCS-$(CONFIG_MSVS) += build/make/msvs_common.sh - DIST-SRCS-$(CONFIG_RVCT) += build/make/armlink_adapter.sh - DIST-SRCS-$(ARCH_ARM) += build/make/ads2gas.pl - DIST-SRCS-$(ARCH_ARM) += build/make/ads2gas_apple.pl - DIST-SRCS-$(ARCH_ARM) += build/make/ads2armasm_ms.pl - DIST-SRCS-$(ARCH_ARM) += build/make/thumb.pm - DIST-SRCS-yes += $(target:-$(TOOLCHAIN)=).mk -endif -INSTALL-SRCS := $(call cond_enabled,CONFIG_INSTALL_SRCS,INSTALL-SRCS) -ifeq ($(MAKECMDGOALS),dist) -INSTALL-SRCS += $(call cond_enabled,CONFIG_INSTALL_SRCS,DIST-SRCS) -endif -.install-srcs: $(addprefix $(DIST_DIR)/src/,$(INSTALL-SRCS)) - @touch $@ - -clean:: - rm -f .install-srcs - -ifeq ($(CONFIG_EXTERNAL_BUILD),yes) - BUILD_TARGETS += .projects - INSTALL_TARGETS += .install-projects -endif -BUILD_TARGETS += .docs .libs .bins -INSTALL_TARGETS += .install-docs .install-srcs .install-libs .install-bins -all: $(BUILD_TARGETS) -install:: $(INSTALL_TARGETS) -dist: $(INSTALL_TARGETS) -test:: diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/msvs_common.sh gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/msvs_common.sh --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/msvs_common.sh 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/msvs_common.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,113 +0,0 @@ -#!/bin/bash -## -## Copyright (c) 2014 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - -if [ "$(uname -o 2>/dev/null)" = "Cygwin" ] \ - && cygpath --help >/dev/null 2>&1; then - FIXPATH='cygpath -m' -else - FIXPATH='echo_path' -fi - -die() { - echo "${self_basename}: $@" >&2 - exit 1 -} - -die_unknown(){ - echo "Unknown option \"$1\"." >&2 - echo "See ${self_basename} --help for available options." >&2 - exit 1 -} - -echo_path() { - for path; do - echo "$path" - done -} - -# Output one, possibly changed based on the system, path per line. -fix_path() { - $FIXPATH "$@" -} - -# Corrects the paths in file_list in one pass for efficiency. -fix_file_list() { - # TODO(jzern): this could be more generic and take the array as a param. - files=$(fix_path "${file_list[@]}") - local IFS=$'\n' - file_list=($files) -} - -generate_uuid() { - local hex="0123456789ABCDEF" - local i - local uuid="" - local j - #93995380-89BD-4b04-88EB-625FBE52EBFB - for ((i=0; i<32; i++)); do - (( j = $RANDOM % 16 )) - uuid="${uuid}${hex:$j:1}" - done - echo "${uuid:0:8}-${uuid:8:4}-${uuid:12:4}-${uuid:16:4}-${uuid:20:12}" -} - -indent1=" " -indent="" -indent_push() { - indent="${indent}${indent1}" -} -indent_pop() { - indent="${indent%${indent1}}" -} - -tag_attributes() { - for opt in "$@"; do - optval="${opt#*=}" - [ -n "${optval}" ] || - die "Missing attribute value in '$opt' while generating $tag tag" - echo "${indent}${opt%%=*}=\"${optval}\"" - done -} - -open_tag() { - local tag=$1 - shift - if [ $# -ne 0 ]; then - echo "${indent}<${tag}" - indent_push - tag_attributes "$@" - echo "${indent}>" - else - echo "${indent}<${tag}>" - indent_push - fi -} - -close_tag() { - local tag=$1 - indent_pop - echo "${indent}" -} - -tag() { - local tag=$1 - shift - if [ $# -ne 0 ]; then - echo "${indent}<${tag}" - indent_push - tag_attributes "$@" - indent_pop - echo "${indent}/>" - else - echo "${indent}<${tag}/>" - fi -} - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/rtcd.pl gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/rtcd.pl --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/rtcd.pl 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/rtcd.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,421 +0,0 @@ -#!/usr/bin/env perl - -no strict 'refs'; -use warnings; -use Getopt::Long; -Getopt::Long::Configure("auto_help") if $Getopt::Long::VERSION > 2.32; - -my %ALL_FUNCS = (); -my @ALL_ARCHS; -my @ALL_FORWARD_DECLS; -my @REQUIRES; - -my %opts = (); -my %disabled = (); -my %required = (); - -my @argv; -foreach (@ARGV) { - $disabled{$1} = 1, next if /--disable-(.*)/; - $required{$1} = 1, next if /--require-(.*)/; - push @argv, $_; -} - -# NB: use GetOptions() instead of GetOptionsFromArray() for compatibility. -@ARGV = @argv; -GetOptions( - \%opts, - 'arch=s', - 'sym=s', - 'config=s', -); - -foreach my $opt (qw/arch config/) { - if (!defined($opts{$opt})) { - warn "--$opt is required!\n"; - Getopt::Long::HelpMessage('-exit' => 1); - } -} - -foreach my $defs_file (@ARGV) { - if (!-f $defs_file) { - warn "$defs_file: $!\n"; - Getopt::Long::HelpMessage('-exit' => 1); - } -} - -open CONFIG_FILE, $opts{config} or - die "Error opening config file '$opts{config}': $!\n"; - -my %config = (); -while () { - next if !/^(?:CONFIG_|HAVE_)/; - chomp; - my @pair = split /=/; - $config{$pair[0]} = $pair[1]; -} -close CONFIG_FILE; - -# -# Routines for the RTCD DSL to call -# -sub vpx_config($) { - return (defined $config{$_[0]}) ? $config{$_[0]} : ""; -} - -sub specialize { - my $fn=$_[0]; - shift; - foreach my $opt (@_) { - eval "\$${fn}_${opt}=${fn}_${opt}"; - } -} - -sub add_proto { - my $fn = splice(@_, -2, 1); - $ALL_FUNCS{$fn} = \@_; - specialize $fn, "c"; -} - -sub require { - foreach my $fn (keys %ALL_FUNCS) { - foreach my $opt (@_) { - my $ofn = eval "\$${fn}_${opt}"; - next if !$ofn; - - # if we already have a default, then we can disable it, as we know - # we can do better. - my $best = eval "\$${fn}_default"; - if ($best) { - my $best_ofn = eval "\$${best}"; - if ($best_ofn && "$best_ofn" ne "$ofn") { - eval "\$${best}_link = 'false'"; - } - } - eval "\$${fn}_default=${fn}_${opt}"; - eval "\$${fn}_${opt}_link='true'"; - } - } -} - -sub forward_decls { - push @ALL_FORWARD_DECLS, @_; -} - -# -# Include the user's directives -# -foreach my $f (@ARGV) { - open FILE, "<", $f or die "cannot open $f: $!\n"; - my $contents = join('', ); - close FILE; - eval $contents or warn "eval failed: $@\n"; -} - -# -# Process the directives according to the command line -# -sub process_forward_decls() { - foreach (@ALL_FORWARD_DECLS) { - $_->(); - } -} - -sub determine_indirection { - vpx_config("CONFIG_RUNTIME_CPU_DETECT") eq "yes" or &require(@ALL_ARCHS); - foreach my $fn (keys %ALL_FUNCS) { - my $n = ""; - my @val = @{$ALL_FUNCS{$fn}}; - my $args = pop @val; - my $rtyp = "@val"; - my $dfn = eval "\$${fn}_default"; - $dfn = eval "\$${dfn}"; - foreach my $opt (@_) { - my $ofn = eval "\$${fn}_${opt}"; - next if !$ofn; - my $link = eval "\$${fn}_${opt}_link"; - next if $link && $link eq "false"; - $n .= "x"; - } - if ($n eq "x") { - eval "\$${fn}_indirect = 'false'"; - } else { - eval "\$${fn}_indirect = 'true'"; - } - } -} - -sub declare_function_pointers { - foreach my $fn (sort keys %ALL_FUNCS) { - my @val = @{$ALL_FUNCS{$fn}}; - my $args = pop @val; - my $rtyp = "@val"; - my $dfn = eval "\$${fn}_default"; - $dfn = eval "\$${dfn}"; - foreach my $opt (@_) { - my $ofn = eval "\$${fn}_${opt}"; - next if !$ofn; - print "$rtyp ${ofn}($args);\n"; - } - if (eval "\$${fn}_indirect" eq "false") { - print "#define ${fn} ${dfn}\n"; - } else { - print "RTCD_EXTERN $rtyp (*${fn})($args);\n"; - } - print "\n"; - } -} - -sub set_function_pointers { - foreach my $fn (sort keys %ALL_FUNCS) { - my @val = @{$ALL_FUNCS{$fn}}; - my $args = pop @val; - my $rtyp = "@val"; - my $dfn = eval "\$${fn}_default"; - $dfn = eval "\$${dfn}"; - if (eval "\$${fn}_indirect" eq "true") { - print " $fn = $dfn;\n"; - foreach my $opt (@_) { - my $ofn = eval "\$${fn}_${opt}"; - next if !$ofn; - next if "$ofn" eq "$dfn"; - my $link = eval "\$${fn}_${opt}_link"; - next if $link && $link eq "false"; - my $cond = eval "\$have_${opt}"; - print " if (${cond}) $fn = $ofn;\n" - } - } - } -} - -sub filter { - my @filtered; - foreach (@_) { push @filtered, $_ unless $disabled{$_}; } - return @filtered; -} - -# -# Helper functions for generating the arch specific RTCD files -# -sub common_top() { - my $include_guard = uc($opts{sym})."_H_"; - print <) { - if (/HAVE_DSPR2=yes/) { - @ALL_ARCHS = filter("$opts{arch}", qw/dspr2/); - last; - } - } - close CONFIG_FILE; - mips; -} elsif ($opts{arch} eq 'armv6') { - @ALL_ARCHS = filter(qw/media/); - arm; -} elsif ($opts{arch} =~ /armv7\w?/) { - @ALL_ARCHS = filter(qw/media neon_asm neon/); - @REQUIRES = filter(keys %required ? keys %required : qw/media/); - &require(@REQUIRES); - arm; -} elsif ($opts{arch} eq 'armv8' || $opts{arch} eq 'arm64' ) { - @ALL_ARCHS = filter(qw/neon/); - arm; -} else { - unoptimized; -} - -__END__ - -=head1 NAME - -rtcd - - -=head1 SYNOPSIS - -Usage: rtcd.pl [options] FILE - -See 'perldoc rtcd.pl' for more details. - -=head1 DESCRIPTION - -Reads the Run Time CPU Detections definitions from FILE and generates a -C header file on stdout. - -=head1 OPTIONS - -Options: - --arch=ARCH Architecture to generate defs for (required) - --disable-EXT Disable support for EXT extensions - --require-EXT Require support for EXT extensions - --sym=SYMBOL Unique symbol to use for RTCD initialization function - --config=FILE File with CONFIG_FOO=yes lines to parse diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/thumb.pm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/thumb.pm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/thumb.pm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/thumb.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -#!/usr/bin/env perl -## -## Copyright (c) 2013 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - -package thumb; - -sub FixThumbInstructions($$) -{ - my $short_branches = $_[1]; - my $branch_shift_offset = $short_branches ? 1 : 0; - - # Write additions with shifts, such as "add r10, r11, lsl #8", - # in three operand form, "add r10, r10, r11, lsl #8". - s/(add\s+)(r\d+),\s*(r\d+),\s*(lsl #\d+)/$1$2, $2, $3, $4/g; - - # Convert additions with a non-constant shift into a sequence - # with left shift, addition and a right shift (to restore the - # register to the original value). Currently the right shift - # isn't necessary in the code base since the values in these - # registers aren't used, but doing the shift for consistency. - # This converts instructions such as "add r12, r12, r5, lsl r4" - # into the sequence "lsl r5, r4", "add r12, r12, r5", "lsr r5, r4". - s/^(\s*)(add)(\s+)(r\d+),\s*(r\d+),\s*(r\d+),\s*lsl (r\d+)/$1lsl$3$6, $7\n$1$2$3$4, $5, $6\n$1lsr$3$6, $7/g; - - # Convert loads with right shifts in the indexing into a - # sequence of an add, load and sub. This converts - # "ldrb r4, [r9, lr, asr #1]" into "add r9, r9, lr, asr #1", - # "ldrb r9, [r9]", "sub r9, r9, lr, asr #1". - s/^(\s*)(ldrb)(\s+)(r\d+),\s*\[(\w+),\s*(\w+),\s*(asr #\d+)\]/$1add $3$5, $5, $6, $7\n$1$2$3$4, [$5]\n$1sub $3$5, $5, $6, $7/g; - - # Convert register indexing with writeback into a separate add - # instruction. This converts "ldrb r12, [r1, r2]!" into - # "ldrb r12, [r1, r2]", "add r1, r1, r2". - s/^(\s*)(ldrb)(\s+)(r\d+),\s*\[(\w+),\s*(\w+)\]!/$1$2$3$4, [$5, $6]\n$1add $3$5, $6/g; - - # Convert negative register indexing into separate sub/add instructions. - # This converts "ldrne r4, [src, -pstep, lsl #1]" into - # "subne src, src, pstep, lsl #1", "ldrne r4, [src]", - # "addne src, src, pstep, lsl #1". In a couple of cases where - # this is used, it's used for two subsequent load instructions, - # where a hand-written version of it could merge two subsequent - # add and sub instructions. - s/^(\s*)((ldr|str|pld)(ne)?)(\s+)(r\d+,\s*)?\[(\w+), -([^\]]+)\]/$1sub$4$5$7, $7, $8\n$1$2$5$6\[$7\]\n$1add$4$5$7, $7, $8/g; - - # Convert register post indexing to a separate add instruction. - # This converts "ldrneb r9, [r0], r2" into "ldrneb r9, [r0]", - # "addne r0, r0, r2". - s/^(\s*)((ldr|str)(ne)?[bhd]?)(\s+)(\w+),(\s*\w+,)?\s*\[(\w+)\],\s*(\w+)/$1$2$5$6,$7 [$8]\n$1add$4$5$8, $8, $9/g; - - # Convert a conditional addition to the pc register into a series of - # instructions. This converts "addlt pc, pc, r3, lsl #2" into - # "itttt lt", "movlt.n r12, pc", "addlt.w r12, #12", - # "addlt.w r12, r12, r3, lsl #2", "movlt.n pc, r12". - # This assumes that r12 is free at this point. - s/^(\s*)addlt(\s+)pc,\s*pc,\s*(\w+),\s*lsl\s*#(\d+)/$1itttt$2lt\n$1movlt.n$2r12, pc\n$1addlt.w$2r12, #12\n$1addlt.w$2r12, r12, $3, lsl #($4-$branch_shift_offset)\n$1movlt.n$2pc, r12/g; - - # Convert "mov pc, lr" into "bx lr", since the former only works - # for switching from arm to thumb (and only in armv7), but not - # from thumb to arm. - s/mov(\s*)pc\s*,\s*lr/bx$1lr/g; -} - -1; diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/version.sh gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/version.sh --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/build/make/version.sh 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/build/make/version.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -#!/bin/sh -## -## Copyright (c) 2010 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - - - -for opt in "$@"; do - optval="${opt#*=}" - case "$opt" in - --bare) bare=true ;; - *) break ;; - esac - shift -done -source_path=${1:-.} -out_file=${2} -id=${3:-VERSION_STRING} - -git_version_id="" -if [ -d "${source_path}/.git" ]; then - # Source Path is a git working copy. Check for local modifications. - export GIT_DIR="${source_path}/.git" - git_version_id=`git describe --match=v[0-9]* 2>/dev/null` -fi - -changelog_version="" -for p in "${source_path}" "${source_path}/.."; do - if [ -z "$git_version_id" -a -f "${p}/CHANGELOG" ]; then - changelog_version=`head -n1 "${p}/CHANGELOG" | awk '{print $2}'` - changelog_version="${changelog_version}" - break - fi -done -version_str="${changelog_version}${git_version_id}" -bare_version=${version_str#v} -major_version=${bare_version%%.*} -bare_version=${bare_version#*.} -minor_version=${bare_version%%.*} -bare_version=${bare_version#*.} -patch_version=${bare_version%%-*} -bare_version=${bare_version#${patch_version}} -extra_version=${bare_version##-} - -#since they'll be used as integers below make sure they are or force to 0 -for v in major_version minor_version patch_version; do - if eval echo \$$v |grep -E -q '[^[:digit:]]'; then - eval $v=0 - fi -done - -if [ ${bare} ]; then - echo "${changelog_version}${git_version_id}" > $$.tmp -else - cat<$$.tmp -#define VERSION_MAJOR $major_version -#define VERSION_MINOR $minor_version -#define VERSION_PATCH $patch_version -#define VERSION_EXTRA "$extra_version" -#define VERSION_PACKED ((VERSION_MAJOR<<16)|(VERSION_MINOR<<8)|(VERSION_PATCH)) -#define ${id}_NOSP "${version_str}" -#define ${id} " ${version_str}" -EOF -fi -if [ -n "$out_file" ]; then -diff $$.tmp ${out_file} >/dev/null 2>&1 || cat $$.tmp > ${out_file} -else -cat $$.tmp -fi -rm $$.tmp diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/CHANGELOG gstreamer-vaapi-1.8.2/ext/libvpx/upstream/CHANGELOG --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/CHANGELOG 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/CHANGELOG 1970-01-01 00:00:00.000000000 +0000 @@ -1,607 +0,0 @@ -2015-04-03 v1.4.0 "Indian Runner Duck" - This release includes significant improvements to the VP9 codec. - - - Upgrading: - This release is ABI incompatible with 1.3.0. It drops the compatibility - layer, requiring VPX_IMG_FMT_* instead of IMG_FMT_*, and adds several codec - controls for VP9. - - - Enhancements: - Faster VP9 encoding and decoding - Multithreaded VP9 decoding (tile and frame-based) - Multithreaded VP9 encoding - on by default - YUV 4:2:2 and 4:4:4 support in VP9 - 10 and 12bit support in VP9 - 64bit ARM support by replacing ARM assembly with intrinsics - - - Bug Fixes: - Fixes a VP9 bitstream issue in Profile 1. This only affected non-YUV 4:2:0 - files. - - - Known Issues: - Frame Parallel decoding fails for segmented and non-420 files. - -2013-11-15 v1.3.0 "Forest" - This release introduces the VP9 codec in a backward-compatible way. - All existing users of VP8 can continue to use the library without - modification. However, some VP8 options do not map to VP9 in the same manner. - - The VP9 encoder in this release is not feature complete. Users interested in - the encoder are advised to use the git master branch and discuss issues on - libvpx mailing lists. - - - Upgrading: - This release is ABI and API compatible with Duclair (v1.0.0). Users - of older releases should refer to the Upgrading notes in this document - for that release. - - - Enhancements: - Get rid of bashisms in the main build scripts - Added usage info on command line options - Add lossless compression mode - Dll build of libvpx - Add additional Mac OS X targets: 10.7, 10.8 and 10.9 (darwin11-13) - Add option to disable documentation - configure: add --enable-external-build support - make: support V=1 as short form of verbose=yes - configure: support mingw-w64 - configure: support hardfloat armv7 CHOSTS - configure: add support for android x86 - Add estimated completion time to vpxenc - Don't exit on decode errors in vpxenc - vpxenc: support scaling prior to encoding - vpxdec: support scaling output - vpxenc: improve progress indicators with --skip - msvs: Don't link to winmm.lib - Add a new script for producing vcxproj files - Produce Visual Studio 10 and 11 project files - Produce Windows Phone project files - msvs-build: use msbuild for vs >= 2005 - configure: default configure log to config.log - Add encoding option --static-thresh - - - Speed: - Miscellaneous speed optimizations for VP8 and VP9. - - - Quality: - In general, quality is consistent with the Eider release. - - - Bug Fixes: - This release represents approximately a year of engineering effort, - and contains multiple bug fixes. Please refer to git history for details. - - -2012-12-21 v1.2.0 - This release acts as a checkpoint for a large amount of internal refactoring - and testing. It also contains a number of small bugfixes, so all users are - encouraged to upgrade. - - - Upgrading: - This release is ABI and API compatible with Duclair (v1.0.0). Users - of older releases should refer to the Upgrading notes in this - document for that release. - - - Enhancements: - VP8 optimizations for MIPS dspr2 - vpxenc: add -quiet option - - - Speed: - Encoder and decoder speed is consistent with the Eider release. - - - Quality: - In general, quality is consistent with the Eider release. - - Minor tweaks to ARNR filtering - Minor improvements to real time encoding with multiple temporal layers - - - Bug Fixes: - Fixes multithreaded encoder race condition in loopfilter - Fixes multi-resolution threaded encoding - Fix potential encoder dead-lock after picture resize - - -2012-05-09 v1.1.0 "Eider" - This introduces a number of enhancements, mostly focused on real-time - encoding. In addition, it fixes a decoder bug (first introduced in - Duclair) so all users of that release are encouraged to upgrade. - - - Upgrading: - This release is ABI and API compatible with Duclair (v1.0.0). Users - of older releases should refer to the Upgrading notes in this - document for that release. - - This release introduces a new temporal denoiser, controlled by the - VP8E_SET_NOISE_SENSITIVITY control. The temporal denoiser does not - currently take a strength parameter, so the control is effectively - a boolean - zero (off) or non-zero (on). For compatibility with - existing applications, the values accepted are the same as those - for the spatial denoiser (0-6). The temporal denoiser is enabled - by default, and the older spatial denoiser may be restored by - configuring with --disable-temporal-denoising. The temporal denoiser - is more computationally intensive than the spatial one. - - This release removes support for a legacy, decode only API that was - supported, but deprecated, at the initial release of libvpx - (v0.9.0). This is not expected to have any impact. If you are - impacted, you can apply a reversion to commit 2bf8fb58 locally. - Please update to the latest libvpx API if you are affected. - - - Enhancements: - Adds a motion compensated temporal denoiser to the encoder, which - gives higher quality than the older spatial denoiser. (See above - for notes on upgrading). - - In addition, support for new compilers and platforms were added, - including: - improved support for XCode - Android x86 NDK build - OS/2 support - SunCC support - - Changing resolution with vpx_codec_enc_config_set() is now - supported. Previously, reinitializing the codec was required to - change the input resolution. - - The vpxenc application has initial support for producing multiple - encodes from the same input in one call. Resizing is not yet - supported, but varying other codec parameters is. Use -- to - delineate output streams. Options persist from one stream to the - next. - - Also, the vpxenc application will now use a keyframe interval of - 5 seconds by default. Use the --kf-max-dist option to override. - - - Speed: - Decoder performance improved 2.5% versus Duclair. Encoder speed is - consistent with Duclair for most material. Two pass encoding of - slideshow-like material will see significant improvements. - - Large realtime encoding speed gains at a small quality expense are - possible by configuring the on-the-fly bitpacking experiment with - --enable-onthefly-bitpacking. Realtime encoder can be up to 13% - faster (ARM) depending on the number of threads and bitrate - settings. This technique sees constant gain over the 5-16 speed - range. For VC style input the loss seen is up to 0.2dB. See commit - 52cf4dca for further details. - - - Quality: - On the whole, quality is consistent with the Duclair release. Some - tweaks: - - Reduced blockiness in easy sections by applying a penalty to - intra modes. - - Improved quality of static sections (like slideshows) with - two pass encoding. - - Improved keyframe sizing with multiple temporal layers - - - Bug Fixes: - Corrected alt-ref contribution to frame rate for visible updates - to the alt-ref buffer. This affected applications making manual - usage of the frame reference flags, or temporal layers. - - Additional constraints were added to disable multi-frame quality - enhancement (MFQE) in sections of the frame where there is motion. - (#392) - - Fixed corruption issues when vpx_codec_enc_config_set() was called - with spatial resampling enabled. - - Fixed a decoder error introduced in Duclair where the segmentation - map was not being reinitialized on keyframes (#378) - - -2012-01-27 v1.0.0 "Duclair" - Our fourth named release, focused on performance and features related to - real-time encoding. It also fixes a decoder crash bug introduced in - v0.9.7, so all users of that release are encouraged to upgrade. - - - Upgrading: - This release is ABI incompatible with prior releases of libvpx, so the - "major" version number has been bumped to 1. You must recompile your - applications against the latest version of the libvpx headers. The - API remains compatible, and this should not require code changes in most - applications. - - - Enhancements: - This release introduces several substantial new features to the encoder, - of particular interest to real time streaming applications. - - Temporal scalability allows the encoder to produce a stream that can - be decimated to different frame rates, with independent rate targetting - for each substream. - - Multiframe quality enhancement postprocessing can make visual quality - more consistent in the presence of frames that are substantially - different quality than the surrounding frames, as in the temporal - scalability case and in some forced keyframe scenarios. - - Multiple-resolution encoding support allows the encoding of the - same content at different resolutions faster than encoding them - separately. - - - Speed: - Optimization targets for this release included the decoder and the real- - time modes of the encoder. Decoder speed on x86 has improved 10.5% with - this release. Encoder improvements followed a curve where speeds 1-3 - improved 4.0%-1.5%, speeds 4-8 improved <1%, and speeds 9-16 improved - 1.5% to 10.5%, respectively. "Best" mode speed is consistent with the - Cayuga release. - - - Quality: - Encoder quality in the single stream case is consistent with the Cayuga - release. - - - Bug Fixes: - This release fixes an OOB read decoder crash bug present in v0.9.7 - related to the clamping of motion vectors in SPLITMV blocks. This - behavior could be triggered by corrupt input or by starting - decoding from a P-frame. - - -2011-08-15 v0.9.7-p1 "Cayuga" patch 1 - This is an incremental bugfix release against Cayuga. All users of that - release are strongly encouraged to upgrade. - - - Fix potential OOB reads (cdae03a) - - An unbounded out of bounds read was discovered when the - decoder was requested to perform error concealment (new in - Cayuga) given a frame with corrupt partition sizes. - - A bounded out of bounds read was discovered affecting all - versions of libvpx. Given an multipartition input frame that - is truncated between the mode/mv partition and the first - residiual paritition (in the block of partition offsets), up - to 3 extra bytes could have been read from the source buffer. - The code will not take any action regardless of the contents - of these undefined bytes, as the truncated buffer is detected - immediately following the read based on the calculated - starting position of the coefficient partition. - - - Fix potential error concealment crash when the very first frame - is missing or corrupt (a609be5) - - - Fix significant artifacts in error concealment (a4c2211, 99d870a) - - - Revert 1-pass CBR rate control changes (e961317) - Further testing showed this change produced undesirable visual - artifacts, rolling back for now. - - -2011-08-02 v0.9.7 "Cayuga" - Our third named release, focused on a faster, higher quality, encoder. - - - Upgrading: - This release is backwards compatible with Aylesbury (v0.9.5) and - Bali (v0.9.6). Users of older releases should refer to the Upgrading - notes in this document for that release. - - - Enhancements: - Stereo 3D format support for vpxenc - Runtime detection of available processor cores. - Allow specifying --end-usage by enum name - vpxdec: test for frame corruption - vpxenc: add quantizer histogram display - vpxenc: add rate histogram display - Set VPX_FRAME_IS_DROPPABLE - update configure for ios sdk 4.3 - Avoid text relocations in ARM vp8 decoder - Generate a vpx.pc file for pkg-config. - New ways of passing encoded data between encoder and decoder. - - - Speed: - This release includes across-the-board speed improvements to the - encoder. On x86, these measure at approximately 11.5% in Best mode, - 21.5% in Good mode (speed 0), and 22.5% in Realtime mode (speed 6). - On ARM Cortex A9 with Neon extensions, real-time encoding of video - telephony content is 35% faster than Bali on single core and 48% - faster on multi-core. On the NVidia Tegra2 platform, real time - encoding is 40% faster than Bali. - - Decoder speed was not a priority for this release, but improved - approximately 8.4% on x86. - - Reduce motion vector search on alt-ref frame. - Encoder loopfilter running in its own thread - Reworked loopfilter to precalculate more parameters - SSE2/SSSE3 optimizations for build_predictors_mbuv{,_s}(). - Make hor UV predict ~2x faster (73 vs 132 cycles) using SSSE3. - Removed redundant checks - Reduced structure sizes - utilize preload in ARMv6 MC/LPF/Copy routines - ARM optimized quantization, dfct, variance, subtract - Increase chrow row alignment to 16 bytes. - disable trellis optimization for first pass - Write SSSE3 sub-pixel filter function - Improve SSE2 half-pixel filter funtions - Add vp8_sub_pixel_variance16x8_ssse3 function - Reduce unnecessary distortion computation - Use diamond search to replace full search - Preload reference area in sub-pixel motion search (real-time mode) - - - Quality: - This release focused primarily on one-pass use cases, including - video conferencing. Low latency data rate control was significantly - improved, improving streamability over bandwidth constrained links. - Added support for error concealment, allowing frames to maintain - visual quality in the presence of substantial packet loss. - - Add rc_max_intra_bitrate_pct control - Limit size of initial keyframe in one-pass. - Improve framerate adaptation - Improved 1-pass CBR rate control - Improved KF insertion after fades to still. - Improved key frame detection. - Improved activity masking (lower PSNR impact for same SSIM boost) - Improved interaction between GF and ARFs - Adding error-concealment to the decoder. - Adding support for independent partitions - Adjusted rate-distortion constants - - - - Bug Fixes: - Removed firstpass motion map - Fix parallel make install - Fix multithreaded encoding for 1 MB wide frame - Fixed iwalsh_neon build problems with RVDS4.1 - Fix semaphore emulation, spin-wait intrinsics on Windows - Fix build with xcode4 and simplify GLOBAL. - Mark ARM asm objects as allowing a non-executable stack. - Fix vpxenc encoding incorrect webm file header on big endian - - -2011-03-07 v0.9.6 "Bali" - Our second named release, focused on a faster, higher quality, encoder. - - - Upgrading: - This release is backwards compatible with Aylesbury (v0.9.5). Users - of older releases should refer to the Upgrading notes in this - document for that release. - - - Enhancements: - vpxenc --psnr shows a summary when encode completes - --tune=ssim option to enable activity masking - improved postproc visualizations for development - updated support for Apple iOS to SDK 4.2 - query decoder to determine which reference frames were updated - implemented error tracking in the decoder - fix pipe support on windows - - - Speed: - Primary focus was on good quality mode, speed 0. Average improvement - on x86 about 40%, up to 100% on user-generated content at that speed. - Best quality mode speed improved 35%, and realtime speed 10-20%. This - release also saw significant improvement in realtime encoding speed - on ARM platforms. - - Improved encoder threading - Dont pick encoder filter level when loopfilter is disabled. - Avoid double copying of key frames into alt and golden buffer - FDCT optimizations. - x86 sse2 temporal filter - SSSE3 version of fast quantizer - vp8_rd_pick_best_mbsegmentation code restructure - Adjusted breakout RD for SPLITMV - Changed segmentation check order - Improved rd_pick_intra4x4block - Adds armv6 optimized variance calculation - ARMv6 optimized sad16x16 - ARMv6 optimized half pixel variance calculations - Full search SAD function optimization in SSE4.1 - Improve MV prediction accuracy to achieve performance gain - Improve MV prediction in vp8_pick_inter_mode() for speed>3 - - - Quality: - Best quality mode improved PSNR 6.3%, and SSIM 6.1%. This release - also includes support for "activity masking," which greatly improves - SSIM at the expense of PSNR. For now, this feature is available with - the --tune=ssim option. Further experimentation in this area - is ongoing. This release also introduces a new rate control mode - called "CQ," which changes the allocation of bits within a clip to - the sections where they will have the most visual impact. - - Tuning for the more exact quantizer. - Relax rate control for last few frames - CQ Mode - Limit key frame quantizer for forced key frames. - KF/GF Pulsing - Add simple version of activity masking. - make rdmult adaptive for intra in quantizer RDO - cap the best quantizer for 2nd order DC - change the threshold of DC check for encode breakout - - - Bug Fixes: - Fix crash on Sparc Solaris. - Fix counter of fixed keyframe distance - ARNR filter pointer update bug fix - Fixed use of motion percentage in KF/GF group calc - Changed condition for using RD in Intra Mode - Fix encoder real-time only configuration. - Fix ARM encoder crash with multiple token partitions - Fixed bug first cluster timecode of webm file is wrong. - Fixed various encoder bugs with odd-sized images - vp8e_get_preview fixed when spatial resampling enabled - quantizer: fix assertion in fast quantizer path - Allocate source buffers to be multiples of 16 - Fix for manual Golden frame frequency - Fix drastic undershoot in long form content - - -2010-10-28 v0.9.5 "Aylesbury" - Our first named release, focused on a faster decoder, and a better encoder. - - - Upgrading: - This release incorporates backwards-incompatible changes to the - ivfenc and ivfdec tools. These tools are now called vpxenc and vpxdec. - - vpxdec - * the -q (quiet) option has been removed, and replaced with - -v (verbose). the output is quiet by default. Use -v to see - the version number of the binary. - - * The default behavior is now to write output to a single file - instead of individual frames. The -y option has been removed. - Y4M output is the default. - - * For raw I420/YV12 output instead of Y4M, the --i420 or --yv12 - options must be specified. - - $ ivfdec -o OUTPUT INPUT - $ vpxdec --i420 -o OUTPUT INPUT - - * If an output file is not specified, the default is to write - Y4M to stdout. This makes piping more natural. - - $ ivfdec -y -o - INPUT | ... - $ vpxdec INPUT | ... - - * The output file has additional flexibility for formatting the - filename. It supports escape characters for constructing a - filename from the width, height, and sequence number. This - replaces the -p option. To get the equivalent: - - $ ivfdec -p frame INPUT - $ vpxdec --i420 -o frame-%wx%h-%4.i420 INPUT - - vpxenc - * The output file must be specified with -o, rather than as the - last argument. - - $ ivfenc INPUT OUTPUT - $ vpxenc -o OUTPUT INPUT - - * The output defaults to webm. To get IVF output, use the --ivf - option. - - $ ivfenc INPUT OUTPUT.ivf - $ vpxenc -o OUTPUT.ivf --ivf INPUT - - - - Enhancements: - ivfenc and ivfdec have been renamed to vpxenc, vpxdec. - vpxdec supports .webm input - vpxdec writes .y4m by default - vpxenc writes .webm output by default - vpxenc --psnr now shows the average/overall PSNR at the end - ARM platforms now support runtime cpu detection - vpxdec visualizations added for motion vectors, block modes, references - vpxdec now silent by default - vpxdec --progress shows frame-by-frame timing information - vpxenc supports the distinction between --fps and --timebase - NASM is now a supported assembler - configure: enable PIC for shared libs by default - configure: add --enable-small - configure: support for ppc32-linux-gcc - configure: support for sparc-solaris-gcc - - - Bugs: - Improve handling of invalid frames - Fix valgrind errors in the NEON loop filters. - Fix loopfilter delta zero transitions - Fix valgrind errors in vp8_sixtap_predict8x4_armv6(). - Build fixes for darwin-icc - - - Speed: - 20-40% (average 28%) improvement in libvpx decoder speed, - including: - Rewrite vp8_short_walsh4x4_sse2() - Optimizations on the loopfilters. - Miscellaneous improvements for Atom - Add 4-tap version of 2nd-pass ARMv6 MC filter. - Improved multithread utilization - Better instruction choices on x86 - reorder data to use wider instructions - Update NEON wide idcts - Make block access to frame buffer sequential - Improved subset block search - Bilinear subpixel optimizations for ssse3. - Decrease memory footprint - - Encoder speed improvements (percentage gain not measured): - Skip unnecessary search of identical frames - Add SSE2 subtract functions - Improve bounds checking in vp8_diamond_search_sadx4() - Added vp8_fast_quantize_b_sse2 - - - Quality: - Over 7% overall PSNR improvement (6.3% SSIM) in "best" quality - encoding mode, and up to 60% improvement on very noisy, still - or slow moving source video - - Motion compensated temporal filter for Alt-Ref Noise Reduction - Improved use of trellis quantization on 2nd order Y blocks - Tune effect of motion on KF/GF boost in two pass - Allow coefficient optimization for good quality speed 0. - Improved control of active min quantizer for two pass. - Enable ARFs for non-lagged compress - -2010-09-02 v0.9.2 - - Enhancements: - Disable frame dropping by default - Improved multithreaded performance - Improved Force Key Frame Behaviour - Increased rate control buffer level precision - Fix bug in 1st pass motion compensation - ivfenc: correct fixed kf interval, --disable-kf - - Speed: - Changed above and left context data layout - Rework idct calling structure. - Removed unnecessary MB_MODE_INFO copies - x86: SSSE3 sixtap prediction - Reworked IDCT to include reconstruction (add) step - Swap alt/gold/new/last frame buffer ptrs instead of copying. - Improve SSE2 loopfilter functions - Change bitreader to use a larger window. - Avoid loopfilter reinitialization when possible - - Quality: - Normalize quantizer's zero bin and rounding factors - Add trellis quantization. - Make the quantizer exact. - Updates to ARNR filtering algorithm - Fix breakout thresh computation for golden & AltRef frames - Redo the forward 4x4 dct - Improve the accuracy of forward walsh-hadamard transform - Further adjustment of RD behaviour with Q and Zbin. - - Build System: - Allow linking of libs built with MinGW to MSVC - Fix target auto-detection on mingw32 - Allow --cpu= to work for x86. - configure: pass original arguments through to make dist - Fix builds without runtime CPU detection - msvs: fix install of codec sources - msvs: Change devenv.com command line for better msys support - msvs: Add vs9 targets. - Add x86_64-linux-icc target - - Bugs: - Potential crashes on older MinGW builds - Fix two-pass framrate for Y4M input. - Fixed simple loop filter, other crashes on ARM v6 - arm: fix missing dependency with --enable-shared - configure: support directories containing .o - Replace pinsrw (SSE) with MMX instructions - apple: include proper mach primatives - Fixed rate control bug with long key frame interval. - Fix DSO link errors on x86-64 when not using a version script - Fixed buffer selection for UV in AltRef filtering - - -2010-06-17 v0.9.1 - - Enhancements: - * ivfenc/ivfdec now support YUV4MPEG2 input and pipe I/O - * Speed optimizations - - Bugfixes: - * Rate control - * Prevent out-of-bounds accesses on invalid data - - Build system updates: - * Detect toolchain to be used automatically for native builds - * Support building shared libraries - * Better autotools emulation (--prefix, --libdir, DESTDIR) - - Updated LICENSE - * http://webmproject.blogspot.com/2010/06/changes-to-webm-open-source-license.html - - -2010-05-18 v0.9.0 - - Initial open source release. Welcome to WebM and VP8! - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/configure gstreamer-vaapi-1.8.2/ext/libvpx/upstream/configure --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/configure 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/configure 1970-01-01 00:00:00.000000000 +0000 @@ -1,796 +0,0 @@ -#!/bin/sh -## -## configure -## -## This script is the front-end to the build system. It provides a similar -## interface to standard configure scripts with some extra bits for dealing -## with toolchains that differ from the standard POSIX interface and -## for extracting subsets of the source tree. In theory, reusable parts -## of this script were intended to live in build/make/configure.sh, -## but in practice, the line is pretty blurry. -## -## This build system is based in part on the FFmpeg configure script. -## - -#source_path="`dirname \"$0\"`" -source_path=${0%/*} -. "${source_path}/build/make/configure.sh" - -show_help(){ - show_help_pre - cat << EOF -Advanced options: - ${toggle_libs} libraries - ${toggle_examples} examples - ${toggle_docs} documentation - ${toggle_unit_tests} unit tests - ${toggle_decode_perf_tests} build decoder perf tests with unit tests - ${toggle_encode_perf_tests} build encoder perf tests with unit tests - --cpu=CPU tune for the specified CPU (ARM: cortex-a8, X86: sse3) - --libc=PATH path to alternate libc - --size-limit=WxH max size to allow in the decoder - --as={yasm|nasm|auto} use specified assembler [auto, yasm preferred] - --sdk-path=PATH path to root of sdk (android builds only) - ${toggle_fast_unaligned} don't use unaligned accesses, even when - supported by hardware [auto] - ${toggle_codec_srcs} in/exclude codec library source code - ${toggle_debug_libs} in/exclude debug version of libraries - ${toggle_static_msvcrt} use static MSVCRT (VS builds only) - ${toggle_vp9_highbitdepth} use VP9 high bit depth (10/12) profiles - ${toggle_vp8} VP8 codec support - ${toggle_vp9} VP9 codec support - ${toggle_internal_stats} output of encoder internal stats for debug, if supported (encoders) - ${toggle_mem_tracker} track memory usage - ${toggle_postproc} postprocessing - ${toggle_vp9_postproc} vp9 specific postprocessing - ${toggle_multithread} multithreaded encoding and decoding - ${toggle_spatial_resampling} spatial sampling (scaling) support - ${toggle_realtime_only} enable this option while building for real-time encoding - ${toggle_onthefly_bitpacking} enable on-the-fly bitpacking in real-time encoding - ${toggle_error_concealment} enable this option to get a decoder which is able to conceal losses - ${toggle_coefficient_range_checking} - enable decoder to check if intermediate - transform coefficients are in valid range - ${toggle_runtime_cpu_detect} runtime cpu detection - ${toggle_shared} shared library support - ${toggle_static} static library support - ${toggle_small} favor smaller size over speed - ${toggle_postproc_visualizer} macro block / block level visualizers - ${toggle_multi_res_encoding} enable multiple-resolution encoding - ${toggle_temporal_denoising} enable temporal denoising and disable the spatial denoiser - ${toggle_vp9_temporal_denoising} - enable vp9 temporal denoising - ${toggle_webm_io} enable input from and output to WebM container - ${toggle_libyuv} enable libyuv - -Codecs: - Codecs can be selectively enabled or disabled individually, or by family: - --disable- - is equivalent to: - --disable--encoder - --disable--decoder - - Codecs available in this distribution: -EOF -#restore editor state ' - - family=""; - last_family=""; - c=""; - str=""; - for c in ${CODECS}; do - family=${c%_*} - if [ "${family}" != "${last_family}" ]; then - [ -z "${str}" ] || echo "${str}" - str="$(printf ' %10s:' ${family})" - fi - str="${str} $(printf '%10s' ${c#*_})" - last_family=${family} - done - echo "${str}" - show_help_post -} - -## -## BEGIN APPLICATION SPECIFIC CONFIGURATION -## - -# all_platforms is a list of all supported target platforms. Maintain -# alphabetically by architecture, generic-gnu last. -all_platforms="${all_platforms} armv6-darwin-gcc" -all_platforms="${all_platforms} armv6-linux-rvct" -all_platforms="${all_platforms} armv6-linux-gcc" -all_platforms="${all_platforms} armv6-none-rvct" -all_platforms="${all_platforms} arm64-darwin-gcc" -all_platforms="${all_platforms} armv7-android-gcc" #neon Cortex-A8 -all_platforms="${all_platforms} armv7-darwin-gcc" #neon Cortex-A8 -all_platforms="${all_platforms} armv7-linux-rvct" #neon Cortex-A8 -all_platforms="${all_platforms} armv7-linux-gcc" #neon Cortex-A8 -all_platforms="${all_platforms} armv7-none-rvct" #neon Cortex-A8 -all_platforms="${all_platforms} armv7-win32-vs11" -all_platforms="${all_platforms} armv7-win32-vs12" -all_platforms="${all_platforms} armv7s-darwin-gcc" -all_platforms="${all_platforms} mips32-linux-gcc" -all_platforms="${all_platforms} mips64-linux-gcc" -all_platforms="${all_platforms} ppc32-darwin8-gcc" -all_platforms="${all_platforms} ppc32-darwin9-gcc" -all_platforms="${all_platforms} ppc32-linux-gcc" -all_platforms="${all_platforms} ppc64-darwin8-gcc" -all_platforms="${all_platforms} ppc64-darwin9-gcc" -all_platforms="${all_platforms} ppc64-linux-gcc" -all_platforms="${all_platforms} sparc-solaris-gcc" -all_platforms="${all_platforms} x86-android-gcc" -all_platforms="${all_platforms} x86-darwin8-gcc" -all_platforms="${all_platforms} x86-darwin8-icc" -all_platforms="${all_platforms} x86-darwin9-gcc" -all_platforms="${all_platforms} x86-darwin9-icc" -all_platforms="${all_platforms} x86-darwin10-gcc" -all_platforms="${all_platforms} x86-darwin11-gcc" -all_platforms="${all_platforms} x86-darwin12-gcc" -all_platforms="${all_platforms} x86-darwin13-gcc" -all_platforms="${all_platforms} x86-darwin14-gcc" -all_platforms="${all_platforms} x86-iphonesimulator-gcc" -all_platforms="${all_platforms} x86-linux-gcc" -all_platforms="${all_platforms} x86-linux-icc" -all_platforms="${all_platforms} x86-os2-gcc" -all_platforms="${all_platforms} x86-solaris-gcc" -all_platforms="${all_platforms} x86-win32-gcc" -all_platforms="${all_platforms} x86-win32-vs7" -all_platforms="${all_platforms} x86-win32-vs8" -all_platforms="${all_platforms} x86-win32-vs9" -all_platforms="${all_platforms} x86-win32-vs10" -all_platforms="${all_platforms} x86-win32-vs11" -all_platforms="${all_platforms} x86-win32-vs12" -all_platforms="${all_platforms} x86_64-darwin9-gcc" -all_platforms="${all_platforms} x86_64-darwin10-gcc" -all_platforms="${all_platforms} x86_64-darwin11-gcc" -all_platforms="${all_platforms} x86_64-darwin12-gcc" -all_platforms="${all_platforms} x86_64-darwin13-gcc" -all_platforms="${all_platforms} x86_64-darwin14-gcc" -all_platforms="${all_platforms} x86_64-iphonesimulator-gcc" -all_platforms="${all_platforms} x86_64-linux-gcc" -all_platforms="${all_platforms} x86_64-linux-icc" -all_platforms="${all_platforms} x86_64-solaris-gcc" -all_platforms="${all_platforms} x86_64-win64-gcc" -all_platforms="${all_platforms} x86_64-win64-vs8" -all_platforms="${all_platforms} x86_64-win64-vs9" -all_platforms="${all_platforms} x86_64-win64-vs10" -all_platforms="${all_platforms} x86_64-win64-vs11" -all_platforms="${all_platforms} x86_64-win64-vs12" -all_platforms="${all_platforms} universal-darwin8-gcc" -all_platforms="${all_platforms} universal-darwin9-gcc" -all_platforms="${all_platforms} universal-darwin10-gcc" -all_platforms="${all_platforms} universal-darwin11-gcc" -all_platforms="${all_platforms} universal-darwin12-gcc" -all_platforms="${all_platforms} universal-darwin13-gcc" -all_platforms="${all_platforms} universal-darwin14-gcc" -all_platforms="${all_platforms} generic-gnu" - -# all_targets is a list of all targets that can be configured -# note that these should be in dependency order for now. -all_targets="libs examples docs" - -# all targets available are enabled, by default. -for t in ${all_targets}; do - [ -f "${source_path}/${t}.mk" ] && enable_feature ${t} -done - -if ! perl --version >/dev/null; then - die "Perl is required to build" -fi - - -if [ "`cd \"${source_path}\" && pwd`" != "`pwd`" ]; then - # test to see if source_path already configured - if [ -f "${source_path}/vpx_config.h" ]; then - die "source directory already configured; run 'make distclean' there first" - fi -fi - -# check installed doxygen version -doxy_version=$(doxygen --version 2>/dev/null) -doxy_major=${doxy_version%%.*} -if [ ${doxy_major:-0} -ge 1 ]; then - doxy_version=${doxy_version#*.} - doxy_minor=${doxy_version%%.*} - doxy_patch=${doxy_version##*.} - - [ $doxy_major -gt 1 ] && enable_feature doxygen - [ $doxy_minor -gt 5 ] && enable_feature doxygen - [ $doxy_minor -eq 5 ] && [ $doxy_patch -ge 3 ] && enable_feature doxygen -fi - -# install everything except the sources, by default. sources will have -# to be enabled when doing dist builds, since that's no longer a common -# case. -enabled doxygen && enable_feature install_docs -enable_feature install_bins -enable_feature install_libs - -enable_feature static -enable_feature optimizations -enable_feature dependency_tracking -enable_feature fast_unaligned #allow unaligned accesses, if supported by hw -enable_feature spatial_resampling -enable_feature multithread -enable_feature os_support -enable_feature temporal_denoising - -[ -d "${source_path}/../include" ] && enable_feature alt_tree_layout -for d in vp8 vp9; do - [ -d "${source_path}/${d}" ] && disable_feature alt_tree_layout; -done - -if ! enabled alt_tree_layout; then -# development environment -[ -d "${source_path}/vp8" ] && CODECS="${CODECS} vp8_encoder vp8_decoder" -[ -d "${source_path}/vp9" ] && CODECS="${CODECS} vp9_encoder vp9_decoder" -else -# customer environment -[ -f "${source_path}/../include/vpx/vp8cx.h" ] && CODECS="${CODECS} vp8_encoder" -[ -f "${source_path}/../include/vpx/vp8dx.h" ] && CODECS="${CODECS} vp8_decoder" -[ -f "${source_path}/../include/vpx/vp9cx.h" ] && CODECS="${CODECS} vp9_encoder" -[ -f "${source_path}/../include/vpx/vp9dx.h" ] && CODECS="${CODECS} vp9_decoder" -[ -f "${source_path}/../include/vpx/vp8cx.h" ] || disable_feature vp8_encoder -[ -f "${source_path}/../include/vpx/vp8dx.h" ] || disable_feature vp8_decoder -[ -f "${source_path}/../include/vpx/vp9cx.h" ] || disable_feature vp9_encoder -[ -f "${source_path}/../include/vpx/vp9dx.h" ] || disable_feature vp9_decoder - -[ -f "${source_path}/../lib/*/*mt.lib" ] && soft_enable static_msvcrt -fi - -CODECS="$(echo ${CODECS} | tr ' ' '\n')" -CODEC_FAMILIES="$(for c in ${CODECS}; do echo ${c%_*}; done | sort | uniq)" - -ARCH_LIST=" - arm - mips - x86 - x86_64 - ppc32 - ppc64 -" -ARCH_EXT_LIST=" - edsp - media - neon - neon_asm - - mips32 - dspr2 - - mips64 - - mmx - sse - sse2 - sse3 - ssse3 - sse4_1 - avx - avx2 - - altivec -" -HAVE_LIST=" - ${ARCH_EXT_LIST} - vpx_ports - stdint_h - alt_tree_layout - pthread_h - sys_mman_h - unistd_h -" -EXPERIMENT_LIST=" - spatial_svc - fp_mb_stats - emulate_hardware -" -CONFIG_LIST=" - dependency_tracking - external_build - install_docs - install_bins - install_libs - install_srcs - use_x86inc - debug - gprof - gcov - rvct - gcc - msvs - pic - big_endian - - codec_srcs - debug_libs - fast_unaligned - mem_manager - mem_tracker - mem_checks - - dequant_tokens - dc_recon - runtime_cpu_detect - postproc - vp9_postproc - multithread - internal_stats - ${CODECS} - ${CODEC_FAMILIES} - encoders - decoders - static_msvcrt - spatial_resampling - realtime_only - onthefly_bitpacking - error_concealment - shared - static - small - postproc_visualizer - os_support - unit_tests - webm_io - libyuv - decode_perf_tests - encode_perf_tests - multi_res_encoding - temporal_denoising - vp9_temporal_denoising - coefficient_range_checking - vp9_highbitdepth - experimental - size_limit - ${EXPERIMENT_LIST} -" -CMDLINE_SELECT=" - dependency_tracking - external_build - extra_warnings - werror - install_docs - install_bins - install_libs - install_srcs - debug - gprof - gcov - pic - use_x86inc - optimizations - ccache - runtime_cpu_detect - thumb - - libs - examples - docs - libc - as - size_limit - fast_unaligned - codec_srcs - debug_libs - - dequant_tokens - dc_recon - postproc - vp9_postproc - multithread - internal_stats - ${CODECS} - ${CODEC_FAMILIES} - static_msvcrt - mem_tracker - spatial_resampling - realtime_only - onthefly_bitpacking - error_concealment - shared - static - small - postproc_visualizer - unit_tests - webm_io - libyuv - decode_perf_tests - encode_perf_tests - multi_res_encoding - temporal_denoising - vp9_temporal_denoising - coefficient_range_checking - vp9_highbitdepth - experimental -" - -process_cmdline() { - for opt do - optval="${opt#*=}" - case "$opt" in - --disable-codecs) for c in ${CODECS}; do disable_feature $c; done ;; - --enable-?*|--disable-?*) - eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'` - if echo "${EXPERIMENT_LIST}" | grep "^ *$option\$" >/dev/null; then - if enabled experimental; then - ${action}_feature $option - else - log_echo "Ignoring $opt -- not in experimental mode." - fi - else - process_common_cmdline $opt - fi - ;; - *) process_common_cmdline "$opt" - ;; - esac - done -} - -post_process_cmdline() { - c="" - - # If the codec family is disabled, disable all components of that family. - # If the codec family is enabled, enable all components of that family. - log_echo "Configuring selected codecs" - for c in ${CODECS}; do - disabled ${c%%_*} && disable_feature ${c} - enabled ${c%%_*} && enable_feature ${c} - done - - # Enable all detected codecs, if they haven't been disabled - for c in ${CODECS}; do soft_enable $c; done - - # Enable the codec family if any component of that family is enabled - for c in ${CODECS}; do - enabled $c && enable_feature ${c%_*} - done - - # Set the {en,de}coders variable if any algorithm in that class is enabled - for c in ${CODECS}; do - enabled ${c} && enable_feature ${c##*_}s - done -} - - -process_targets() { - enabled child || write_common_config_banner - enabled universal || write_common_target_config_h ${BUILD_PFX}vpx_config.h - - # For fat binaries, call configure recursively to configure for each - # binary architecture to be included. - if enabled universal; then - # Call configure (ourselves) for each subarchitecture - for arch in $fat_bin_archs; do - BUILD_PFX=${arch}/ toolchain=${arch} $self --child $cmdline_args || exit $? - done - fi - - # The write_common_config (config.mk) logic is deferred until after the - # recursive calls to configure complete, because we want our universal - # targets to be executed last. - write_common_config_targets - enabled universal && echo "FAT_ARCHS=${fat_bin_archs}" >> config.mk - - # Calculate the default distribution name, based on the enabled features - cf="" - DIST_DIR=vpx - for cf in $CODEC_FAMILIES; do - if enabled ${cf}_encoder && enabled ${cf}_decoder; then - DIST_DIR="${DIST_DIR}-${cf}" - elif enabled ${cf}_encoder; then - DIST_DIR="${DIST_DIR}-${cf}cx" - elif enabled ${cf}_decoder; then - DIST_DIR="${DIST_DIR}-${cf}dx" - fi - done - enabled debug_libs && DIST_DIR="${DIST_DIR}-debug" - enabled codec_srcs && DIST_DIR="${DIST_DIR}-src" - ! enabled postproc && ! enabled vp9_postproc && DIST_DIR="${DIST_DIR}-nopost" - ! enabled multithread && DIST_DIR="${DIST_DIR}-nomt" - ! enabled install_docs && DIST_DIR="${DIST_DIR}-nodocs" - DIST_DIR="${DIST_DIR}-${tgt_isa}-${tgt_os}" - case "${tgt_os}" in - win*) enabled static_msvcrt && DIST_DIR="${DIST_DIR}mt" || DIST_DIR="${DIST_DIR}md" - DIST_DIR="${DIST_DIR}-${tgt_cc}" - ;; - esac - if [ -f "${source_path}/build/make/version.sh" ]; then - ver=`"$source_path/build/make/version.sh" --bare "$source_path"` - DIST_DIR="${DIST_DIR}-${ver}" - VERSION_STRING=${ver} - ver=${ver%%-*} - VERSION_PATCH=${ver##*.} - ver=${ver%.*} - VERSION_MINOR=${ver##*.} - ver=${ver#v} - VERSION_MAJOR=${ver%.*} - fi - enabled child || cat <> config.mk - -PREFIX=${prefix} -ifeq (\$(MAKECMDGOALS),dist) -DIST_DIR?=${DIST_DIR} -else -DIST_DIR?=\$(DESTDIR)${prefix} -endif -LIBSUBDIR=${libdir##${prefix}/} - -VERSION_STRING=${VERSION_STRING} - -VERSION_MAJOR=${VERSION_MAJOR} -VERSION_MINOR=${VERSION_MINOR} -VERSION_PATCH=${VERSION_PATCH} - -CONFIGURE_ARGS=${CONFIGURE_ARGS} -EOF - enabled child || echo "CONFIGURE_ARGS?=${CONFIGURE_ARGS}" >> config.mk - - # - # Write makefiles for all enabled targets - # - for tgt in libs examples docs solution; do - tgt_fn="$tgt-$toolchain.mk" - - if enabled $tgt; then - echo "Creating makefiles for ${toolchain} ${tgt}" - write_common_target_config_mk $tgt_fn ${BUILD_PFX}vpx_config.h - #write_${tgt}_config - fi - done - -} - -process_detect() { - if enabled shared; then - # Can only build shared libs on a subset of platforms. Doing this check - # here rather than at option parse time because the target auto-detect - # magic happens after the command line has been parsed. - if ! enabled linux; then - if enabled gnu; then - echo "--enable-shared is only supported on ELF; assuming this is OK" - else - die "--enable-shared only supported on ELF for now" - fi - fi - fi - if [ -z "$CC" ] || enabled external_build; then - echo "Bypassing toolchain for environment detection." - enable_feature external_build - check_header() { - log fake_check_header "$@" - header=$1 - shift - var=`echo $header | sed 's/[^A-Za-z0-9_]/_/g'` - disable_feature $var - # Headers common to all environments - case $header in - stdio.h) - true; - ;; - *) - result=false - for d in "$@"; do - [ -f "${d##-I}/$header" ] && result=true && break - done - ${result:-true} - esac && enable_feature $var - - # Specialize windows and POSIX environments. - case $toolchain in - *-win*-*) - case $header-$toolchain in - stdint*-gcc) true;; - *) false;; - esac && enable_feature $var - ;; - *) - case $header in - stdint.h) true;; - pthread.h) true;; - sys/mman.h) true;; - unistd.h) true;; - *) false;; - esac && enable_feature $var - esac - enabled $var - } - check_ld() { - true - } - fi - check_header stdio.h || die "Unable to invoke compiler: ${CC} ${CFLAGS}" - check_ld <> ${BUILD_PFX}vpx_config.c -static const char* const cfg = "$CONFIGURE_ARGS"; -const char *vpx_codec_build_config(void) {return cfg;} -EOF diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/docs.mk gstreamer-vaapi-1.8.2/ext/libvpx/upstream/docs.mk --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/docs.mk 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/docs.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -## -## Copyright (c) 2010 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - - -INSTALL_MAPS += docs/% docs/% -INSTALL_MAPS += src/% % -INSTALL_MAPS += % % - -# Static documentation authored in doxygen -CODEC_DOX := mainpage.dox \ - keywords.dox \ - usage.dox \ - usage_cx.dox \ - usage_dx.dox \ - -# Other doxy files sourced in Markdown -TXT_DOX = $(call enabled,TXT_DOX) - -EXAMPLE_PATH += $(SRC_PATH_BARE) #for CHANGELOG, README, etc -EXAMPLE_PATH += $(SRC_PATH_BARE)/examples - -doxyfile: $(if $(findstring examples, $(ALL_TARGETS)),examples.doxy) -doxyfile: libs.doxy_template libs.doxy - @echo " [CREATE] $@" - @cat $^ > $@ - @echo "STRIP_FROM_PATH += $(SRC_PATH_BARE) $(BUILD_ROOT)" >> $@ - @echo "INPUT += $(addprefix $(SRC_PATH_BARE)/,$(CODEC_DOX))" >> $@; - @echo "INPUT += $(TXT_DOX)" >> $@; - @echo "EXAMPLE_PATH += $(EXAMPLE_PATH)" >> $@ - -CLEAN-OBJS += doxyfile $(wildcard docs/html/*) -docs/html/index.html: doxyfile $(CODEC_DOX) $(TXT_DOX) - @echo " [DOXYGEN] $<" - @doxygen $< -DOCS-yes += docs/html/index.html - -DIST-DOCS-yes = $(wildcard docs/html/*) -DIST-DOCS-$(CONFIG_CODEC_SRCS) += $(addprefix src/,$(CODEC_DOX)) -DIST-DOCS-$(CONFIG_CODEC_SRCS) += src/libs.doxy_template -DIST-DOCS-yes += CHANGELOG -DIST-DOCS-yes += README diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/decode_to_md5.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/decode_to_md5.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/decode_to_md5.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/decode_to_md5.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Frame-by-frame MD5 Checksum -// =========================== -// -// This example builds upon the simple decoder loop to show how checksums -// of the decoded output can be generated. These are used for validating -// decoder implementations against the reference implementation, for example. -// -// MD5 algorithm -// ------------- -// The Message-Digest 5 (MD5) is a well known hash function. We have provided -// an implementation derived from the RSA Data Security, Inc. MD5 Message-Digest -// Algorithm for your use. Our implmentation only changes the interface of this -// reference code. You must include the `md5_utils.h` header for access to these -// functions. -// -// Processing The Decoded Data -// --------------------------- -// Each row of the image is passed to the MD5 accumulator. First the Y plane -// is processed, then U, then V. It is important to honor the image's `stride` -// values. - -#include -#include -#include - -#include "vpx/vp8dx.h" -#include "vpx/vpx_decoder.h" - -#include "../md5_utils.h" -#include "../tools_common.h" -#include "../video_reader.h" -#include "./vpx_config.h" - -static void get_image_md5(const vpx_image_t *img, unsigned char digest[16]) { - int plane, y; - MD5Context md5; - - MD5Init(&md5); - - for (plane = 0; plane < 3; ++plane) { - const unsigned char *buf = img->planes[plane]; - const int stride = img->stride[plane]; - const int w = plane ? (img->d_w + 1) >> 1 : img->d_w; - const int h = plane ? (img->d_h + 1) >> 1 : img->d_h; - - for (y = 0; y < h; ++y) { - MD5Update(&md5, buf, w); - buf += stride; - } - } - - MD5Final(digest, &md5); -} - -static void print_md5(FILE *stream, unsigned char digest[16]) { - int i; - - for (i = 0; i < 16; ++i) - fprintf(stream, "%02x", digest[i]); -} - -static const char *exec_name; - -void usage_exit() { - fprintf(stderr, "Usage: %s \n", exec_name); - exit(EXIT_FAILURE); -} - -int main(int argc, char **argv) { - int frame_cnt = 0; - FILE *outfile = NULL; - vpx_codec_ctx_t codec; - VpxVideoReader *reader = NULL; - const VpxVideoInfo *info = NULL; - const VpxInterface *decoder = NULL; - - exec_name = argv[0]; - - if (argc != 3) - die("Invalid number of arguments."); - - reader = vpx_video_reader_open(argv[1]); - if (!reader) - die("Failed to open %s for reading.", argv[1]); - - if (!(outfile = fopen(argv[2], "wb"))) - die("Failed to open %s for writing.", argv[2]); - - info = vpx_video_reader_get_info(reader); - - decoder = get_vpx_decoder_by_fourcc(info->codec_fourcc); - if (!decoder) - die("Unknown input codec."); - - printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface())); - - if (vpx_codec_dec_init(&codec, decoder->codec_interface(), NULL, 0)) - die_codec(&codec, "Failed to initialize decoder"); - - while (vpx_video_reader_read_frame(reader)) { - vpx_codec_iter_t iter = NULL; - vpx_image_t *img = NULL; - size_t frame_size = 0; - const unsigned char *frame = vpx_video_reader_get_frame(reader, - &frame_size); - if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0)) - die_codec(&codec, "Failed to decode frame"); - - while ((img = vpx_codec_get_frame(&codec, &iter)) != NULL) { - unsigned char digest[16]; - - get_image_md5(img, digest); - print_md5(outfile, digest); - fprintf(outfile, " img-%dx%d-%04d.i420\n", - img->d_w, img->d_h, ++frame_cnt); - } - } - - printf("Processed %d frames.\n", frame_cnt); - if (vpx_codec_destroy(&codec)) - die_codec(&codec, "Failed to destroy codec."); - - vpx_video_reader_close(reader); - - fclose(outfile); - return EXIT_SUCCESS; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/decode_with_drops.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/decode_with_drops.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/decode_with_drops.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/decode_with_drops.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Decode With Drops Example -// ========================= -// -// This is an example utility which drops a series of frames, as specified -// on the command line. This is useful for observing the error recovery -// features of the codec. -// -// Usage -// ----- -// This example adds a single argument to the `simple_decoder` example, -// which specifies the range or pattern of frames to drop. The parameter is -// parsed as follows: -// -// Dropping A Range Of Frames -// -------------------------- -// To drop a range of frames, specify the starting frame and the ending -// frame to drop, separated by a dash. The following command will drop -// frames 5 through 10 (base 1). -// -// $ ./decode_with_drops in.ivf out.i420 5-10 -// -// -// Dropping A Pattern Of Frames -// ---------------------------- -// To drop a pattern of frames, specify the number of frames to drop and -// the number of frames after which to repeat the pattern, separated by -// a forward-slash. The following command will drop 3 of 7 frames. -// Specifically, it will decode 4 frames, then drop 3 frames, and then -// repeat. -// -// $ ./decode_with_drops in.ivf out.i420 3/7 -// -// -// Extra Variables -// --------------- -// This example maintains the pattern passed on the command line in the -// `n`, `m`, and `is_range` variables: -// -// -// Making The Drop Decision -// ------------------------ -// The example decides whether to drop the frame based on the current -// frame number, immediately before decoding the frame. - -#include -#include -#include - -#include "vpx/vp8dx.h" -#include "vpx/vpx_decoder.h" - -#include "../tools_common.h" -#include "../video_reader.h" -#include "./vpx_config.h" - -static const char *exec_name; - -void usage_exit() { - fprintf(stderr, "Usage: %s \n", exec_name); - exit(EXIT_FAILURE); -} - -int main(int argc, char **argv) { - int frame_cnt = 0; - FILE *outfile = NULL; - vpx_codec_ctx_t codec; - const VpxInterface *decoder = NULL; - VpxVideoReader *reader = NULL; - const VpxVideoInfo *info = NULL; - int n = 0; - int m = 0; - int is_range = 0; - char *nptr = NULL; - - exec_name = argv[0]; - - if (argc != 4) - die("Invalid number of arguments."); - - reader = vpx_video_reader_open(argv[1]); - if (!reader) - die("Failed to open %s for reading.", argv[1]); - - if (!(outfile = fopen(argv[2], "wb"))) - die("Failed to open %s for writing.", argv[2]); - - n = strtol(argv[3], &nptr, 0); - m = strtol(nptr + 1, NULL, 0); - is_range = (*nptr == '-'); - if (!n || !m || (*nptr != '-' && *nptr != '/')) - die("Couldn't parse pattern %s.\n", argv[3]); - - info = vpx_video_reader_get_info(reader); - - decoder = get_vpx_decoder_by_fourcc(info->codec_fourcc); - if (!decoder) - die("Unknown input codec."); - - printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface())); - - if (vpx_codec_dec_init(&codec, decoder->codec_interface(), NULL, 0)) - die_codec(&codec, "Failed to initialize decoder."); - - while (vpx_video_reader_read_frame(reader)) { - vpx_codec_iter_t iter = NULL; - vpx_image_t *img = NULL; - size_t frame_size = 0; - int skip; - const unsigned char *frame = vpx_video_reader_get_frame(reader, - &frame_size); - if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0)) - die_codec(&codec, "Failed to decode frame."); - - ++frame_cnt; - - skip = (is_range && frame_cnt >= n && frame_cnt <= m) || - (!is_range && m - (frame_cnt - 1) % m <= n); - - if (!skip) { - putc('.', stdout); - - while ((img = vpx_codec_get_frame(&codec, &iter)) != NULL) - vpx_img_write(img, outfile); - } else { - putc('X', stdout); - } - - fflush(stdout); - } - - printf("Processed %d frames.\n", frame_cnt); - if (vpx_codec_destroy(&codec)) - die_codec(&codec, "Failed to destroy codec."); - - printf("Play: ffplay -f rawvideo -pix_fmt yuv420p -s %dx%d %s\n", - info->frame_width, info->frame_height, argv[2]); - - vpx_video_reader_close(reader); - fclose(outfile); - - return EXIT_SUCCESS; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/postproc.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/postproc.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/postproc.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/postproc.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,138 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Postprocessing Decoder -// ====================== -// -// This example adds postprocessing to the simple decoder loop. -// -// Initializing Postprocessing -// --------------------------- -// You must inform the codec that you might request postprocessing at -// initialization time. This is done by passing the VPX_CODEC_USE_POSTPROC -// flag to `vpx_codec_dec_init`. If the codec does not support -// postprocessing, this call will return VPX_CODEC_INCAPABLE. For -// demonstration purposes, we also fall back to default initialization if -// the codec does not provide support. -// -// Using Adaptive Postprocessing -// ----------------------------- -// VP6 provides "adaptive postprocessing." It will automatically select the -// best postprocessing filter on a frame by frame basis based on the amount -// of time remaining before the user's specified deadline expires. The -// special value 0 indicates that the codec should take as long as -// necessary to provide the best quality frame. This example gives the -// codec 15ms (15000us) to return a frame. Remember that this is a soft -// deadline, and the codec may exceed it doing its regular processing. In -// these cases, no additional postprocessing will be done. -// -// Codec Specific Postprocessing Controls -// -------------------------------------- -// Some codecs provide fine grained controls over their built-in -// postprocessors. VP8 is one example. The following sample code toggles -// postprocessing on and off every 15 frames. - -#include -#include -#include - -#include "vpx/vp8dx.h" -#include "vpx/vpx_decoder.h" - -#include "../tools_common.h" -#include "../video_reader.h" -#include "./vpx_config.h" - -static const char *exec_name; - -void usage_exit() { - fprintf(stderr, "Usage: %s \n", exec_name); - exit(EXIT_FAILURE); -} - -int main(int argc, char **argv) { - int frame_cnt = 0; - FILE *outfile = NULL; - vpx_codec_ctx_t codec; - vpx_codec_err_t res; - VpxVideoReader *reader = NULL; - const VpxInterface *decoder = NULL; - const VpxVideoInfo *info = NULL; - - exec_name = argv[0]; - - if (argc != 3) - die("Invalid number of arguments."); - - reader = vpx_video_reader_open(argv[1]); - if (!reader) - die("Failed to open %s for reading.", argv[1]); - - if (!(outfile = fopen(argv[2], "wb"))) - die("Failed to open %s for writing", argv[2]); - - info = vpx_video_reader_get_info(reader); - - decoder = get_vpx_decoder_by_fourcc(info->codec_fourcc); - if (!decoder) - die("Unknown input codec."); - - printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface())); - - res = vpx_codec_dec_init(&codec, decoder->codec_interface(), NULL, - VPX_CODEC_USE_POSTPROC); - if (res == VPX_CODEC_INCAPABLE) - die_codec(&codec, "Postproc not supported by this decoder."); - - if (res) - die_codec(&codec, "Failed to initialize decoder."); - - while (vpx_video_reader_read_frame(reader)) { - vpx_codec_iter_t iter = NULL; - vpx_image_t *img = NULL; - size_t frame_size = 0; - const unsigned char *frame = vpx_video_reader_get_frame(reader, - &frame_size); - - ++frame_cnt; - - if (frame_cnt % 30 == 1) { - vp8_postproc_cfg_t pp = {0, 0, 0}; - - if (vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp)) - die_codec(&codec, "Failed to turn off postproc."); - } else if (frame_cnt % 30 == 16) { - vp8_postproc_cfg_t pp = {VP8_DEBLOCK | VP8_DEMACROBLOCK | VP8_MFQE, - 4, 0}; - if (vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp)) - die_codec(&codec, "Failed to turn on postproc."); - }; - - // Decode the frame with 15ms deadline - if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 15000)) - die_codec(&codec, "Failed to decode frame"); - - while ((img = vpx_codec_get_frame(&codec, &iter)) != NULL) { - vpx_img_write(img, outfile); - } - } - - printf("Processed %d frames.\n", frame_cnt); - if (vpx_codec_destroy(&codec)) - die_codec(&codec, "Failed to destroy codec"); - - printf("Play: ffplay -f rawvideo -pix_fmt yuv420p -s %dx%d %s\n", - info->frame_width, info->frame_height, argv[2]); - - vpx_video_reader_close(reader); - - fclose(outfile); - return EXIT_SUCCESS; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/resize_util.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/resize_util.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/resize_util.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/resize_util.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include -#include -#include -#include - -#include "../vp9/encoder/vp9_resize.h" - -static const char *exec_name = NULL; - -static void usage() { - printf("Usage:\n"); - printf("%s x x ", - exec_name); - printf(" []\n"); -} - -void usage_exit() { - usage(); - exit(EXIT_FAILURE); -} - -static int parse_dim(char *v, int *width, int *height) { - char *x = strchr(v, 'x'); - if (x == NULL) - x = strchr(v, 'X'); - if (x == NULL) - return 0; - *width = atoi(v); - *height = atoi(&x[1]); - if (*width <= 0 || *height <= 0) - return 0; - else - return 1; -} - -int main(int argc, char *argv[]) { - char *fin, *fout; - FILE *fpin, *fpout; - uint8_t *inbuf, *outbuf; - uint8_t *inbuf_u, *outbuf_u; - uint8_t *inbuf_v, *outbuf_v; - int f, frames; - int width, height, target_width, target_height; - - exec_name = argv[0]; - - if (argc < 5) { - printf("Incorrect parameters:\n"); - usage(); - return 1; - } - - fin = argv[1]; - fout = argv[4]; - if (!parse_dim(argv[2], &width, &height)) { - printf("Incorrect parameters: %s\n", argv[2]); - usage(); - return 1; - } - if (!parse_dim(argv[3], &target_width, &target_height)) { - printf("Incorrect parameters: %s\n", argv[3]); - usage(); - return 1; - } - - fpin = fopen(fin, "rb"); - if (fpin == NULL) { - printf("Can't open file %s to read\n", fin); - usage(); - return 1; - } - fpout = fopen(fout, "wb"); - if (fpout == NULL) { - printf("Can't open file %s to write\n", fout); - usage(); - return 1; - } - if (argc >= 6) - frames = atoi(argv[5]); - else - frames = INT_MAX; - - printf("Input size: %dx%d\n", - width, height); - printf("Target size: %dx%d, Frames: ", - target_width, target_height); - if (frames == INT_MAX) - printf("All\n"); - else - printf("%d\n", frames); - - inbuf = (uint8_t*)malloc(width * height * 3 / 2); - outbuf = (uint8_t*)malloc(target_width * target_height * 3 / 2); - inbuf_u = inbuf + width * height; - inbuf_v = inbuf_u + width * height / 4; - outbuf_u = outbuf + target_width * target_height; - outbuf_v = outbuf_u + target_width * target_height / 4; - f = 0; - while (f < frames) { - if (fread(inbuf, width * height * 3 / 2, 1, fpin) != 1) - break; - vp9_resize_frame420(inbuf, width, inbuf_u, inbuf_v, width / 2, - height, width, - outbuf, target_width, outbuf_u, outbuf_v, - target_width / 2, - target_height, target_width); - fwrite(outbuf, target_width * target_height * 3 / 2, 1, fpout); - f++; - } - printf("%d frames processed\n", f); - fclose(fpin); - fclose(fpout); - - free(inbuf); - free(outbuf); - return 0; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/set_maps.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/set_maps.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/set_maps.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/set_maps.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,255 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -// VP8 Set Active and ROI Maps -// =========================== -// -// This is an example demonstrating how to control the VP8 encoder's -// ROI and Active maps. -// -// ROI (Reigon of Interest) maps are a way for the application to assign -// each macroblock in the image to a region, and then set quantizer and -// filtering parameters on that image. -// -// Active maps are a way for the application to specify on a -// macroblock-by-macroblock basis whether there is any activity in that -// macroblock. -// -// -// Configuration -// ------------- -// An ROI map is set on frame 22. If the width of the image in macroblocks -// is evenly divisble by 4, then the output will appear to have distinct -// columns, where the quantizer, loopfilter, and static threshold differ -// from column to column. -// -// An active map is set on frame 33. If the width of the image in macroblocks -// is evenly divisble by 4, then the output will appear to have distinct -// columns, where one column will have motion and the next will not. -// -// The active map is cleared on frame 44. -// -// Observing The Effects -// --------------------- -// Use the `simple_decoder` example to decode this sample, and observe -// the change in the image at frames 22, 33, and 44. - -#include -#include -#include -#include - -#include "vpx/vp8cx.h" -#include "vpx/vpx_encoder.h" - -#include "../tools_common.h" -#include "../video_writer.h" - -static const char *exec_name; - -void usage_exit() { - fprintf(stderr, "Usage: %s \n", - exec_name); - exit(EXIT_FAILURE); -} - -static void set_roi_map(const vpx_codec_enc_cfg_t *cfg, - vpx_codec_ctx_t *codec) { - unsigned int i; - vpx_roi_map_t roi; - memset(&roi, 0, sizeof(roi)); - - roi.rows = (cfg->g_h + 15) / 16; - roi.cols = (cfg->g_w + 15) / 16; - - roi.delta_q[0] = 0; - roi.delta_q[1] = -2; - roi.delta_q[2] = -4; - roi.delta_q[3] = -6; - - roi.delta_lf[0] = 0; - roi.delta_lf[1] = 1; - roi.delta_lf[2] = 2; - roi.delta_lf[3] = 3; - - roi.static_threshold[0] = 1500; - roi.static_threshold[1] = 1000; - roi.static_threshold[2] = 500; - roi.static_threshold[3] = 0; - - roi.roi_map = (uint8_t *)malloc(roi.rows * roi.cols); - for (i = 0; i < roi.rows * roi.cols; ++i) - roi.roi_map[i] = i % 4; - - if (vpx_codec_control(codec, VP8E_SET_ROI_MAP, &roi)) - die_codec(codec, "Failed to set ROI map"); - - free(roi.roi_map); -} - -static void set_active_map(const vpx_codec_enc_cfg_t *cfg, - vpx_codec_ctx_t *codec) { - unsigned int i; - vpx_active_map_t map = {0, 0, 0}; - - map.rows = (cfg->g_h + 15) / 16; - map.cols = (cfg->g_w + 15) / 16; - - map.active_map = (uint8_t *)malloc(map.rows * map.cols); - for (i = 0; i < map.rows * map.cols; ++i) - map.active_map[i] = i % 2; - - if (vpx_codec_control(codec, VP8E_SET_ACTIVEMAP, &map)) - die_codec(codec, "Failed to set active map"); - - free(map.active_map); -} - -static void unset_active_map(const vpx_codec_enc_cfg_t *cfg, - vpx_codec_ctx_t *codec) { - vpx_active_map_t map = {0, 0, 0}; - - map.rows = (cfg->g_h + 15) / 16; - map.cols = (cfg->g_w + 15) / 16; - map.active_map = NULL; - - if (vpx_codec_control(codec, VP8E_SET_ACTIVEMAP, &map)) - die_codec(codec, "Failed to set active map"); -} - -static int encode_frame(vpx_codec_ctx_t *codec, - vpx_image_t *img, - int frame_index, - VpxVideoWriter *writer) { - int got_pkts = 0; - vpx_codec_iter_t iter = NULL; - const vpx_codec_cx_pkt_t *pkt = NULL; - const vpx_codec_err_t res = vpx_codec_encode(codec, img, frame_index, 1, 0, - VPX_DL_GOOD_QUALITY); - if (res != VPX_CODEC_OK) - die_codec(codec, "Failed to encode frame"); - - while ((pkt = vpx_codec_get_cx_data(codec, &iter)) != NULL) { - got_pkts = 1; - - if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) { - const int keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0; - if (!vpx_video_writer_write_frame(writer, - pkt->data.frame.buf, - pkt->data.frame.sz, - pkt->data.frame.pts)) { - die_codec(codec, "Failed to write compressed frame"); - } - - printf(keyframe ? "K" : "."); - fflush(stdout); - } - } - - return got_pkts; -} - -int main(int argc, char **argv) { - FILE *infile = NULL; - vpx_codec_ctx_t codec; - vpx_codec_enc_cfg_t cfg; - int frame_count = 0; - vpx_image_t raw; - vpx_codec_err_t res; - VpxVideoInfo info; - VpxVideoWriter *writer = NULL; - const VpxInterface *encoder = NULL; - const int fps = 2; // TODO(dkovalev) add command line argument - const double bits_per_pixel_per_frame = 0.067; - - exec_name = argv[0]; - if (argc != 6) - die("Invalid number of arguments"); - - memset(&info, 0, sizeof(info)); - - encoder = get_vpx_encoder_by_name(argv[1]); - if (encoder == NULL) { - die("Unsupported codec."); - } - assert(encoder != NULL); - info.codec_fourcc = encoder->fourcc; - info.frame_width = strtol(argv[2], NULL, 0); - info.frame_height = strtol(argv[3], NULL, 0); - info.time_base.numerator = 1; - info.time_base.denominator = fps; - - if (info.frame_width <= 0 || - info.frame_height <= 0 || - (info.frame_width % 2) != 0 || - (info.frame_height % 2) != 0) { - die("Invalid frame size: %dx%d", info.frame_width, info.frame_height); - } - - if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, info.frame_width, - info.frame_height, 1)) { - die("Failed to allocate image."); - } - - printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface())); - - res = vpx_codec_enc_config_default(encoder->codec_interface(), &cfg, 0); - if (res) - die_codec(&codec, "Failed to get default codec config."); - - cfg.g_w = info.frame_width; - cfg.g_h = info.frame_height; - cfg.g_timebase.num = info.time_base.numerator; - cfg.g_timebase.den = info.time_base.denominator; - cfg.rc_target_bitrate = (unsigned int)(bits_per_pixel_per_frame * cfg.g_w * - cfg.g_h * fps / 1000); - cfg.g_lag_in_frames = 0; - - writer = vpx_video_writer_open(argv[5], kContainerIVF, &info); - if (!writer) - die("Failed to open %s for writing.", argv[5]); - - if (!(infile = fopen(argv[4], "rb"))) - die("Failed to open %s for reading.", argv[4]); - - if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0)) - die_codec(&codec, "Failed to initialize encoder"); - - // Encode frames. - while (vpx_img_read(&raw, infile)) { - ++frame_count; - - if (frame_count == 22 && encoder->fourcc == VP8_FOURCC) { - set_roi_map(&cfg, &codec); - } else if (frame_count == 33) { - set_active_map(&cfg, &codec); - } else if (frame_count == 44) { - unset_active_map(&cfg, &codec); - } - - encode_frame(&codec, &raw, frame_count, writer); - } - - // Flush encoder. - while (encode_frame(&codec, NULL, -1, writer)) {} - - printf("\n"); - fclose(infile); - printf("Processed %d frames.\n", frame_count); - - vpx_img_free(&raw); - if (vpx_codec_destroy(&codec)) - die_codec(&codec, "Failed to destroy codec."); - - vpx_video_writer_close(writer); - - return EXIT_SUCCESS; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/simple_decoder.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/simple_decoder.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/simple_decoder.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/simple_decoder.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,154 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -// Simple Decoder -// ============== -// -// This is an example of a simple decoder loop. It takes an input file -// containing the compressed data (in IVF format), passes it through the -// decoder, and writes the decompressed frames to disk. Other decoder -// examples build upon this one. -// -// The details of the IVF format have been elided from this example for -// simplicity of presentation, as IVF files will not generally be used by -// your application. In general, an IVF file consists of a file header, -// followed by a variable number of frames. Each frame consists of a frame -// header followed by a variable length payload. The length of the payload -// is specified in the first four bytes of the frame header. The payload is -// the raw compressed data. -// -// Standard Includes -// ----------------- -// For decoders, you only have to include `vpx_decoder.h` and then any -// header files for the specific codecs you use. In this case, we're using -// vp8. -// -// Initializing The Codec -// ---------------------- -// The libvpx decoder is initialized by the call to vpx_codec_dec_init(). -// Determining the codec interface to use is handled by VpxVideoReader and the -// functions prefixed with vpx_video_reader_. Discussion of those functions is -// beyond the scope of this example, but the main gist is to open the input file -// and parse just enough of it to determine if it's a VPx file and which VPx -// codec is contained within the file. -// Note the NULL pointer passed to vpx_codec_dec_init(). We do that in this -// example because we want the algorithm to determine the stream configuration -// (width/height) and allocate memory automatically. -// -// Decoding A Frame -// ---------------- -// Once the frame has been read into memory, it is decoded using the -// `vpx_codec_decode` function. The call takes a pointer to the data -// (`frame`) and the length of the data (`frame_size`). No application data -// is associated with the frame in this example, so the `user_priv` -// parameter is NULL. The `deadline` parameter is left at zero for this -// example. This parameter is generally only used when doing adaptive post -// processing. -// -// Codecs may produce a variable number of output frames for every call to -// `vpx_codec_decode`. These frames are retrieved by the -// `vpx_codec_get_frame` iterator function. The iterator variable `iter` is -// initialized to NULL each time `vpx_codec_decode` is called. -// `vpx_codec_get_frame` is called in a loop, returning a pointer to a -// decoded image or NULL to indicate the end of list. -// -// Processing The Decoded Data -// --------------------------- -// In this example, we simply write the encoded data to disk. It is -// important to honor the image's `stride` values. -// -// Cleanup -// ------- -// The `vpx_codec_destroy` call frees any memory allocated by the codec. -// -// Error Handling -// -------------- -// This example does not special case any error return codes. If there was -// an error, a descriptive message is printed and the program exits. With -// few exceptions, vpx_codec functions return an enumerated error status, -// with the value `0` indicating success. - -#include -#include -#include - -#include "vpx/vpx_decoder.h" - -#include "../tools_common.h" -#include "../video_reader.h" -#include "./vpx_config.h" - -static const char *exec_name; - -void usage_exit() { - fprintf(stderr, "Usage: %s \n", exec_name); - exit(EXIT_FAILURE); -} - -int main(int argc, char **argv) { - int frame_cnt = 0; - FILE *outfile = NULL; - vpx_codec_ctx_t codec; - VpxVideoReader *reader = NULL; - const VpxInterface *decoder = NULL; - const VpxVideoInfo *info = NULL; - - exec_name = argv[0]; - - if (argc != 3) - die("Invalid number of arguments."); - - reader = vpx_video_reader_open(argv[1]); - if (!reader) - die("Failed to open %s for reading.", argv[1]); - - if (!(outfile = fopen(argv[2], "wb"))) - die("Failed to open %s for writing.", argv[2]); - - info = vpx_video_reader_get_info(reader); - - decoder = get_vpx_decoder_by_fourcc(info->codec_fourcc); - if (!decoder) - die("Unknown input codec."); - - printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface())); - - if (vpx_codec_dec_init(&codec, decoder->codec_interface(), NULL, 0)) - die_codec(&codec, "Failed to initialize decoder."); - - while (vpx_video_reader_read_frame(reader)) { - vpx_codec_iter_t iter = NULL; - vpx_image_t *img = NULL; - size_t frame_size = 0; - const unsigned char *frame = vpx_video_reader_get_frame(reader, - &frame_size); - if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0)) - die_codec(&codec, "Failed to decode frame."); - - while ((img = vpx_codec_get_frame(&codec, &iter)) != NULL) { - vpx_img_write(img, outfile); - ++frame_cnt; - } - } - - printf("Processed %d frames.\n", frame_cnt); - if (vpx_codec_destroy(&codec)) - die_codec(&codec, "Failed to destroy codec"); - - printf("Play: ffplay -f rawvideo -pix_fmt yuv420p -s %dx%d %s\n", - info->frame_width, info->frame_height, argv[2]); - - vpx_video_reader_close(reader); - - fclose(outfile); - - return EXIT_SUCCESS; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/simple_encoder.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/simple_encoder.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/simple_encoder.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/simple_encoder.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,256 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Simple Encoder -// ============== -// -// This is an example of a simple encoder loop. It takes an input file in -// YV12 format, passes it through the encoder, and writes the compressed -// frames to disk in IVF format. Other decoder examples build upon this -// one. -// -// The details of the IVF format have been elided from this example for -// simplicity of presentation, as IVF files will not generally be used by -// your application. In general, an IVF file consists of a file header, -// followed by a variable number of frames. Each frame consists of a frame -// header followed by a variable length payload. The length of the payload -// is specified in the first four bytes of the frame header. The payload is -// the raw compressed data. -// -// Standard Includes -// ----------------- -// For encoders, you only have to include `vpx_encoder.h` and then any -// header files for the specific codecs you use. In this case, we're using -// vp8. -// -// Getting The Default Configuration -// --------------------------------- -// Encoders have the notion of "usage profiles." For example, an encoder -// may want to publish default configurations for both a video -// conferencing application and a best quality offline encoder. These -// obviously have very different default settings. Consult the -// documentation for your codec to see if it provides any default -// configurations. All codecs provide a default configuration, number 0, -// which is valid for material in the vacinity of QCIF/QVGA. -// -// Updating The Configuration -// --------------------------------- -// Almost all applications will want to update the default configuration -// with settings specific to their usage. Here we set the width and height -// of the video file to that specified on the command line. We also scale -// the default bitrate based on the ratio between the default resolution -// and the resolution specified on the command line. -// -// Initializing The Codec -// ---------------------- -// The encoder is initialized by the following code. -// -// Encoding A Frame -// ---------------- -// The frame is read as a continuous block (size width * height * 3 / 2) -// from the input file. If a frame was read (the input file has not hit -// EOF) then the frame is passed to the encoder. Otherwise, a NULL -// is passed, indicating the End-Of-Stream condition to the encoder. The -// `frame_cnt` is reused as the presentation time stamp (PTS) and each -// frame is shown for one frame-time in duration. The flags parameter is -// unused in this example. The deadline is set to VPX_DL_REALTIME to -// make the example run as quickly as possible. - -// Forced Keyframes -// ---------------- -// Keyframes can be forced by setting the VPX_EFLAG_FORCE_KF bit of the -// flags passed to `vpx_codec_control()`. In this example, we force a -// keyframe every frames. Note, the output stream can -// contain additional keyframes beyond those that have been forced using the -// VPX_EFLAG_FORCE_KF flag because of automatic keyframe placement by the -// encoder. -// -// Processing The Encoded Data -// --------------------------- -// Each packet of type `VPX_CODEC_CX_FRAME_PKT` contains the encoded data -// for this frame. We write a IVF frame header, followed by the raw data. -// -// Cleanup -// ------- -// The `vpx_codec_destroy` call frees any memory allocated by the codec. -// -// Error Handling -// -------------- -// This example does not special case any error return codes. If there was -// an error, a descriptive message is printed and the program exits. With -// few exeptions, vpx_codec functions return an enumerated error status, -// with the value `0` indicating success. -// -// Error Resiliency Features -// ------------------------- -// Error resiliency is controlled by the g_error_resilient member of the -// configuration structure. Use the `decode_with_drops` example to decode with -// frames 5-10 dropped. Compare the output for a file encoded with this example -// versus one encoded with the `simple_encoder` example. - -#include -#include -#include - -#include "vpx/vpx_encoder.h" - -#include "../tools_common.h" -#include "../video_writer.h" - -static const char *exec_name; - -void usage_exit() { - fprintf(stderr, - "Usage: %s " - " []\nSee comments in " - "simple_encoder.c for more information.\n", - exec_name); - exit(EXIT_FAILURE); -} - -static int encode_frame(vpx_codec_ctx_t *codec, - vpx_image_t *img, - int frame_index, - int flags, - VpxVideoWriter *writer) { - int got_pkts = 0; - vpx_codec_iter_t iter = NULL; - const vpx_codec_cx_pkt_t *pkt = NULL; - const vpx_codec_err_t res = vpx_codec_encode(codec, img, frame_index, 1, - flags, VPX_DL_GOOD_QUALITY); - if (res != VPX_CODEC_OK) - die_codec(codec, "Failed to encode frame"); - - while ((pkt = vpx_codec_get_cx_data(codec, &iter)) != NULL) { - got_pkts = 1; - - if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) { - const int keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0; - if (!vpx_video_writer_write_frame(writer, - pkt->data.frame.buf, - pkt->data.frame.sz, - pkt->data.frame.pts)) { - die_codec(codec, "Failed to write compressed frame"); - } - printf(keyframe ? "K" : "."); - fflush(stdout); - } - } - - return got_pkts; -} - -int main(int argc, char **argv) { - FILE *infile = NULL; - vpx_codec_ctx_t codec; - vpx_codec_enc_cfg_t cfg; - int frame_count = 0; - vpx_image_t raw; - vpx_codec_err_t res; - VpxVideoInfo info = {0}; - VpxVideoWriter *writer = NULL; - const VpxInterface *encoder = NULL; - const int fps = 30; // TODO(dkovalev) add command line argument - const int bitrate = 200; // kbit/s TODO(dkovalev) add command line argument - int keyframe_interval = 0; - - // TODO(dkovalev): Add some simple command line parsing code to make the - // command line more flexible. - const char *codec_arg = NULL; - const char *width_arg = NULL; - const char *height_arg = NULL; - const char *infile_arg = NULL; - const char *outfile_arg = NULL; - const char *keyframe_interval_arg = NULL; - - exec_name = argv[0]; - - if (argc < 7) - die("Invalid number of arguments"); - - codec_arg = argv[1]; - width_arg = argv[2]; - height_arg = argv[3]; - infile_arg = argv[4]; - outfile_arg = argv[5]; - keyframe_interval_arg = argv[6]; - - encoder = get_vpx_encoder_by_name(codec_arg); - if (!encoder) - die("Unsupported codec."); - - info.codec_fourcc = encoder->fourcc; - info.frame_width = strtol(width_arg, NULL, 0); - info.frame_height = strtol(height_arg, NULL, 0); - info.time_base.numerator = 1; - info.time_base.denominator = fps; - - if (info.frame_width <= 0 || - info.frame_height <= 0 || - (info.frame_width % 2) != 0 || - (info.frame_height % 2) != 0) { - die("Invalid frame size: %dx%d", info.frame_width, info.frame_height); - } - - if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, info.frame_width, - info.frame_height, 1)) { - die("Failed to allocate image."); - } - - keyframe_interval = strtol(keyframe_interval_arg, NULL, 0); - if (keyframe_interval < 0) - die("Invalid keyframe interval value."); - - printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface())); - - res = vpx_codec_enc_config_default(encoder->codec_interface(), &cfg, 0); - if (res) - die_codec(&codec, "Failed to get default codec config."); - - cfg.g_w = info.frame_width; - cfg.g_h = info.frame_height; - cfg.g_timebase.num = info.time_base.numerator; - cfg.g_timebase.den = info.time_base.denominator; - cfg.rc_target_bitrate = bitrate; - cfg.g_error_resilient = argc > 7 ? strtol(argv[7], NULL, 0) : 0; - - writer = vpx_video_writer_open(outfile_arg, kContainerIVF, &info); - if (!writer) - die("Failed to open %s for writing.", outfile_arg); - - if (!(infile = fopen(infile_arg, "rb"))) - die("Failed to open %s for reading.", infile_arg); - - if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0)) - die_codec(&codec, "Failed to initialize encoder"); - - // Encode frames. - while (vpx_img_read(&raw, infile)) { - int flags = 0; - if (keyframe_interval > 0 && frame_count % keyframe_interval == 0) - flags |= VPX_EFLAG_FORCE_KF; - encode_frame(&codec, &raw, frame_count++, flags, writer); - } - - // Flush encoder. - while (encode_frame(&codec, NULL, -1, 0, writer)) {}; - - printf("\n"); - fclose(infile); - printf("Processed %d frames.\n", frame_count); - - vpx_img_free(&raw); - if (vpx_codec_destroy(&codec)) - die_codec(&codec, "Failed to destroy codec."); - - vpx_video_writer_close(writer); - - return EXIT_SUCCESS; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/twopass_encoder.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/twopass_encoder.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/twopass_encoder.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/twopass_encoder.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,265 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Two Pass Encoder -// ================ -// -// This is an example of a two pass encoder loop. It takes an input file in -// YV12 format, passes it through the encoder twice, and writes the compressed -// frames to disk in IVF format. It builds upon the simple_encoder example. -// -// Twopass Variables -// ----------------- -// Twopass mode needs to track the current pass number and the buffer of -// statistics packets. -// -// Updating The Configuration -// --------------------------------- -// In two pass mode, the configuration has to be updated on each pass. The -// statistics buffer is passed on the last pass. -// -// Encoding A Frame -// ---------------- -// Encoding a frame in two pass mode is identical to the simple encoder -// example. To increase the quality while sacrificing encoding speed, -// VPX_DL_BEST_QUALITY can be used in place of VPX_DL_GOOD_QUALITY. -// -// Processing Statistics Packets -// ----------------------------- -// Each packet of type `VPX_CODEC_CX_FRAME_PKT` contains the encoded data -// for this frame. We write a IVF frame header, followed by the raw data. -// -// -// Pass Progress Reporting -// ----------------------------- -// It's sometimes helpful to see when each pass completes. -// -// -// Clean-up -// ----------------------------- -// Destruction of the encoder instance must be done on each pass. The -// raw image should be destroyed at the end as usual. - -#include -#include -#include - -#include "vpx/vpx_encoder.h" - -#include "../tools_common.h" -#include "../video_writer.h" - -static const char *exec_name; - -void usage_exit() { - fprintf(stderr, "Usage: %s \n", - exec_name); - exit(EXIT_FAILURE); -} - -static int get_frame_stats(vpx_codec_ctx_t *ctx, - const vpx_image_t *img, - vpx_codec_pts_t pts, - unsigned int duration, - vpx_enc_frame_flags_t flags, - unsigned int deadline, - vpx_fixed_buf_t *stats) { - int got_pkts = 0; - vpx_codec_iter_t iter = NULL; - const vpx_codec_cx_pkt_t *pkt = NULL; - const vpx_codec_err_t res = vpx_codec_encode(ctx, img, pts, duration, flags, - deadline); - if (res != VPX_CODEC_OK) - die_codec(ctx, "Failed to get frame stats."); - - while ((pkt = vpx_codec_get_cx_data(ctx, &iter)) != NULL) { - got_pkts = 1; - - if (pkt->kind == VPX_CODEC_STATS_PKT) { - const uint8_t *const pkt_buf = pkt->data.twopass_stats.buf; - const size_t pkt_size = pkt->data.twopass_stats.sz; - stats->buf = realloc(stats->buf, stats->sz + pkt_size); - memcpy((uint8_t *)stats->buf + stats->sz, pkt_buf, pkt_size); - stats->sz += pkt_size; - } - } - - return got_pkts; -} - -static int encode_frame(vpx_codec_ctx_t *ctx, - const vpx_image_t *img, - vpx_codec_pts_t pts, - unsigned int duration, - vpx_enc_frame_flags_t flags, - unsigned int deadline, - VpxVideoWriter *writer) { - int got_pkts = 0; - vpx_codec_iter_t iter = NULL; - const vpx_codec_cx_pkt_t *pkt = NULL; - const vpx_codec_err_t res = vpx_codec_encode(ctx, img, pts, duration, flags, - deadline); - if (res != VPX_CODEC_OK) - die_codec(ctx, "Failed to encode frame."); - - while ((pkt = vpx_codec_get_cx_data(ctx, &iter)) != NULL) { - got_pkts = 1; - if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) { - const int keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0; - - if (!vpx_video_writer_write_frame(writer, pkt->data.frame.buf, - pkt->data.frame.sz, - pkt->data.frame.pts)) - die_codec(ctx, "Failed to write compressed frame."); - printf(keyframe ? "K" : "."); - fflush(stdout); - } - } - - return got_pkts; -} - -static vpx_fixed_buf_t pass0(vpx_image_t *raw, - FILE *infile, - const VpxInterface *encoder, - const vpx_codec_enc_cfg_t *cfg) { - vpx_codec_ctx_t codec; - int frame_count = 0; - vpx_fixed_buf_t stats = {NULL, 0}; - - if (vpx_codec_enc_init(&codec, encoder->codec_interface(), cfg, 0)) - die_codec(&codec, "Failed to initialize encoder"); - - // Calculate frame statistics. - while (vpx_img_read(raw, infile)) { - ++frame_count; - get_frame_stats(&codec, raw, frame_count, 1, 0, VPX_DL_GOOD_QUALITY, - &stats); - } - - // Flush encoder. - while (get_frame_stats(&codec, NULL, frame_count, 1, 0, - VPX_DL_GOOD_QUALITY, &stats)) {} - - printf("Pass 0 complete. Processed %d frames.\n", frame_count); - if (vpx_codec_destroy(&codec)) - die_codec(&codec, "Failed to destroy codec."); - - return stats; -} - -static void pass1(vpx_image_t *raw, - FILE *infile, - const char *outfile_name, - const VpxInterface *encoder, - const vpx_codec_enc_cfg_t *cfg) { - VpxVideoInfo info = { - encoder->fourcc, - cfg->g_w, - cfg->g_h, - {cfg->g_timebase.num, cfg->g_timebase.den} - }; - VpxVideoWriter *writer = NULL; - vpx_codec_ctx_t codec; - int frame_count = 0; - - writer = vpx_video_writer_open(outfile_name, kContainerIVF, &info); - if (!writer) - die("Failed to open %s for writing", outfile_name); - - if (vpx_codec_enc_init(&codec, encoder->codec_interface(), cfg, 0)) - die_codec(&codec, "Failed to initialize encoder"); - - // Encode frames. - while (vpx_img_read(raw, infile)) { - ++frame_count; - encode_frame(&codec, raw, frame_count, 1, 0, VPX_DL_GOOD_QUALITY, writer); - } - - // Flush encoder. - while (encode_frame(&codec, NULL, -1, 1, 0, VPX_DL_GOOD_QUALITY, writer)) {} - - printf("\n"); - - if (vpx_codec_destroy(&codec)) - die_codec(&codec, "Failed to destroy codec."); - - vpx_video_writer_close(writer); - - printf("Pass 1 complete. Processed %d frames.\n", frame_count); -} - -int main(int argc, char **argv) { - FILE *infile = NULL; - int w, h; - vpx_codec_ctx_t codec; - vpx_codec_enc_cfg_t cfg; - vpx_image_t raw; - vpx_codec_err_t res; - vpx_fixed_buf_t stats; - - const VpxInterface *encoder = NULL; - const int fps = 30; // TODO(dkovalev) add command line argument - const int bitrate = 200; // kbit/s TODO(dkovalev) add command line argument - const char *const codec_arg = argv[1]; - const char *const width_arg = argv[2]; - const char *const height_arg = argv[3]; - const char *const infile_arg = argv[4]; - const char *const outfile_arg = argv[5]; - exec_name = argv[0]; - - if (argc != 6) - die("Invalid number of arguments."); - - encoder = get_vpx_encoder_by_name(codec_arg); - if (!encoder) - die("Unsupported codec."); - - w = strtol(width_arg, NULL, 0); - h = strtol(height_arg, NULL, 0); - - if (w <= 0 || h <= 0 || (w % 2) != 0 || (h % 2) != 0) - die("Invalid frame size: %dx%d", w, h); - - if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, w, h, 1)) - die("Failed to allocate image", w, h); - - printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface())); - - // Configuration - res = vpx_codec_enc_config_default(encoder->codec_interface(), &cfg, 0); - if (res) - die_codec(&codec, "Failed to get default codec config."); - - cfg.g_w = w; - cfg.g_h = h; - cfg.g_timebase.num = 1; - cfg.g_timebase.den = fps; - cfg.rc_target_bitrate = bitrate; - - if (!(infile = fopen(infile_arg, "rb"))) - die("Failed to open %s for reading", infile_arg); - - // Pass 0 - cfg.g_pass = VPX_RC_FIRST_PASS; - stats = pass0(&raw, infile, encoder, &cfg); - - // Pass 1 - rewind(infile); - cfg.g_pass = VPX_RC_LAST_PASS; - cfg.rc_twopass_stats_in = stats; - pass1(&raw, infile, outfile_arg, encoder, &cfg); - free(stats.buf); - - vpx_img_free(&raw); - fclose(infile); - - return EXIT_SUCCESS; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/vp8cx_set_ref.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/vp8cx_set_ref.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/vp8cx_set_ref.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/vp8cx_set_ref.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,194 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -// VP8 Set Reference Frame -// ======================= -// -// This is an example demonstrating how to overwrite the VP8 encoder's -// internal reference frame. In the sample we set the last frame to the -// current frame. If this is done at a cut scene it will avoid a keyframe. -// This technique could be used to bounce between two cameras. -// -// Note that the decoder would also have to set the reference frame to the -// same value on the same frame, or the video will become corrupt. -// -// Usage -// ----- -// This example adds a single argument to the `simple_encoder` example, -// which specifies the frame number to update the reference frame on. -// The parameter is parsed as follows: -// -// -// Extra Variables -// --------------- -// This example maintains the frame number passed on the command line -// in the `update_frame_num` variable. -// -// -// Configuration -// ------------- -// -// The reference frame is updated on the frame specified on the command -// line. -// -// Observing The Effects -// --------------------- -// Use the `simple_encoder` example to encode a sample with a cut scene. -// Determine the frame number of the cut scene by looking for a generated -// key-frame (indicated by a 'K'). Supply that frame number as an argument -// to this example, and observe that no key-frame is generated. - -#include -#include -#include - -#include "vpx/vp8cx.h" -#include "vpx/vpx_encoder.h" - -#include "../tools_common.h" -#include "../video_writer.h" - -static const char *exec_name; - -void usage_exit() { - fprintf(stderr, "Usage: %s \n", - exec_name); - exit(EXIT_FAILURE); -} - -static int encode_frame(vpx_codec_ctx_t *codec, - vpx_image_t *img, - int frame_index, - VpxVideoWriter *writer) { - int got_pkts = 0; - vpx_codec_iter_t iter = NULL; - const vpx_codec_cx_pkt_t *pkt = NULL; - const vpx_codec_err_t res = vpx_codec_encode(codec, img, frame_index, 1, 0, - VPX_DL_GOOD_QUALITY); - if (res != VPX_CODEC_OK) - die_codec(codec, "Failed to encode frame"); - - while ((pkt = vpx_codec_get_cx_data(codec, &iter)) != NULL) { - got_pkts = 1; - - if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) { - const int keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0; - if (!vpx_video_writer_write_frame(writer, - pkt->data.frame.buf, - pkt->data.frame.sz, - pkt->data.frame.pts)) { - die_codec(codec, "Failed to write compressed frame"); - } - - printf(keyframe ? "K" : "."); - fflush(stdout); - } - } - - return got_pkts; -} - -int main(int argc, char **argv) { - FILE *infile = NULL; - vpx_codec_ctx_t codec = {0}; - vpx_codec_enc_cfg_t cfg = {0}; - int frame_count = 0; - vpx_image_t raw; - vpx_codec_err_t res; - VpxVideoInfo info = {0}; - VpxVideoWriter *writer = NULL; - const VpxInterface *encoder = NULL; - int update_frame_num = 0; - const int fps = 30; // TODO(dkovalev) add command line argument - const int bitrate = 200; // kbit/s TODO(dkovalev) add command line argument - - exec_name = argv[0]; - - if (argc != 6) - die("Invalid number of arguments"); - - // TODO(dkovalev): add vp9 support and rename the file accordingly - encoder = get_vpx_encoder_by_name("vp8"); - if (!encoder) - die("Unsupported codec."); - - update_frame_num = atoi(argv[5]); - if (!update_frame_num) - die("Couldn't parse frame number '%s'\n", argv[5]); - - info.codec_fourcc = encoder->fourcc; - info.frame_width = strtol(argv[1], NULL, 0); - info.frame_height = strtol(argv[2], NULL, 0); - info.time_base.numerator = 1; - info.time_base.denominator = fps; - - if (info.frame_width <= 0 || - info.frame_height <= 0 || - (info.frame_width % 2) != 0 || - (info.frame_height % 2) != 0) { - die("Invalid frame size: %dx%d", info.frame_width, info.frame_height); - } - - if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, info.frame_width, - info.frame_height, 1)) { - die("Failed to allocate image."); - } - - printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface())); - - res = vpx_codec_enc_config_default(encoder->codec_interface(), &cfg, 0); - if (res) - die_codec(&codec, "Failed to get default codec config."); - - cfg.g_w = info.frame_width; - cfg.g_h = info.frame_height; - cfg.g_timebase.num = info.time_base.numerator; - cfg.g_timebase.den = info.time_base.denominator; - cfg.rc_target_bitrate = bitrate; - - writer = vpx_video_writer_open(argv[4], kContainerIVF, &info); - if (!writer) - die("Failed to open %s for writing.", argv[4]); - - if (!(infile = fopen(argv[3], "rb"))) - die("Failed to open %s for reading.", argv[3]); - - if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0)) - die_codec(&codec, "Failed to initialize encoder"); - - // Encode frames. - while (vpx_img_read(&raw, infile)) { - if (frame_count + 1 == update_frame_num) { - vpx_ref_frame_t ref; - ref.frame_type = VP8_LAST_FRAME; - ref.img = raw; - if (vpx_codec_control(&codec, VP8_SET_REFERENCE, &ref)) - die_codec(&codec, "Failed to set reference frame"); - } - - encode_frame(&codec, &raw, frame_count++, writer); - } - - // Flush encoder. - while (encode_frame(&codec, NULL, -1, writer)) {} - - printf("\n"); - fclose(infile); - printf("Processed %d frames.\n", frame_count); - - vpx_img_free(&raw); - if (vpx_codec_destroy(&codec)) - die_codec(&codec, "Failed to destroy codec."); - - vpx_video_writer_close(writer); - - return EXIT_SUCCESS; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/vp8_multi_resolution_encoder.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/vp8_multi_resolution_encoder.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/vp8_multi_resolution_encoder.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/vp8_multi_resolution_encoder.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,737 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -/* - * This is an example demonstrating multi-resolution encoding in VP8. - * High-resolution input video is down-sampled to lower-resolutions. The - * encoder then encodes the video and outputs multiple bitstreams with - * different resolutions. - * - * This test also allows for settings temporal layers for each spatial layer. - * Different number of temporal layers per spatial stream may be used. - * Currently up to 3 temporal layers per spatial stream (encoder) are supported - * in this test. - */ - -#include "./vpx_config.h" - -#include -#include -#include -#include -#include -#include -#include -#if USE_POSIX_MMAP -#include -#include -#include -#include -#include -#endif -#include "vpx_ports/vpx_timer.h" -#define VPX_CODEC_DISABLE_COMPAT 1 -#include "vpx/vpx_encoder.h" -#include "vpx/vp8cx.h" -#include "vpx_ports/mem_ops.h" -#include "./tools_common.h" -#define interface (vpx_codec_vp8_cx()) -#define fourcc 0x30385056 - -void usage_exit() { - exit(EXIT_FAILURE); -} - -/* - * The input video frame is downsampled several times to generate a multi-level - * hierarchical structure. NUM_ENCODERS is defined as the number of encoding - * levels required. For example, if the size of input video is 1280x720, - * NUM_ENCODERS is 3, and down-sampling factor is 2, the encoder outputs 3 - * bitstreams with resolution of 1280x720(level 0), 640x360(level 1), and - * 320x180(level 2) respectively. - */ - -/* Number of encoders (spatial resolutions) used in this test. */ -#define NUM_ENCODERS 3 - -/* Maximum number of temporal layers allowed for this test. */ -#define MAX_NUM_TEMPORAL_LAYERS 3 - -/* This example uses the scaler function in libyuv. */ -#include "third_party/libyuv/include/libyuv/basic_types.h" -#include "third_party/libyuv/include/libyuv/scale.h" -#include "third_party/libyuv/include/libyuv/cpu_id.h" - -int (*read_frame_p)(FILE *f, vpx_image_t *img); - -static int read_frame(FILE *f, vpx_image_t *img) { - size_t nbytes, to_read; - int res = 1; - - to_read = img->w*img->h*3/2; - nbytes = fread(img->planes[0], 1, to_read, f); - if(nbytes != to_read) { - res = 0; - if(nbytes > 0) - printf("Warning: Read partial frame. Check your width & height!\n"); - } - return res; -} - -static int read_frame_by_row(FILE *f, vpx_image_t *img) { - size_t nbytes, to_read; - int res = 1; - int plane; - - for (plane = 0; plane < 3; plane++) - { - unsigned char *ptr; - int w = (plane ? (1 + img->d_w) / 2 : img->d_w); - int h = (plane ? (1 + img->d_h) / 2 : img->d_h); - int r; - - /* Determine the correct plane based on the image format. The for-loop - * always counts in Y,U,V order, but this may not match the order of - * the data on disk. - */ - switch (plane) - { - case 1: - ptr = img->planes[img->fmt==VPX_IMG_FMT_YV12? VPX_PLANE_V : VPX_PLANE_U]; - break; - case 2: - ptr = img->planes[img->fmt==VPX_IMG_FMT_YV12?VPX_PLANE_U : VPX_PLANE_V]; - break; - default: - ptr = img->planes[plane]; - } - - for (r = 0; r < h; r++) - { - to_read = w; - - nbytes = fread(ptr, 1, to_read, f); - if(nbytes != to_read) { - res = 0; - if(nbytes > 0) - printf("Warning: Read partial frame. Check your width & height!\n"); - break; - } - - ptr += img->stride[plane]; - } - if (!res) - break; - } - - return res; -} - -static void write_ivf_file_header(FILE *outfile, - const vpx_codec_enc_cfg_t *cfg, - int frame_cnt) { - char header[32]; - - if(cfg->g_pass != VPX_RC_ONE_PASS && cfg->g_pass != VPX_RC_LAST_PASS) - return; - header[0] = 'D'; - header[1] = 'K'; - header[2] = 'I'; - header[3] = 'F'; - mem_put_le16(header+4, 0); /* version */ - mem_put_le16(header+6, 32); /* headersize */ - mem_put_le32(header+8, fourcc); /* headersize */ - mem_put_le16(header+12, cfg->g_w); /* width */ - mem_put_le16(header+14, cfg->g_h); /* height */ - mem_put_le32(header+16, cfg->g_timebase.den); /* rate */ - mem_put_le32(header+20, cfg->g_timebase.num); /* scale */ - mem_put_le32(header+24, frame_cnt); /* length */ - mem_put_le32(header+28, 0); /* unused */ - - (void) fwrite(header, 1, 32, outfile); -} - -static void write_ivf_frame_header(FILE *outfile, - const vpx_codec_cx_pkt_t *pkt) -{ - char header[12]; - vpx_codec_pts_t pts; - - if(pkt->kind != VPX_CODEC_CX_FRAME_PKT) - return; - - pts = pkt->data.frame.pts; - mem_put_le32(header, pkt->data.frame.sz); - mem_put_le32(header+4, pts&0xFFFFFFFF); - mem_put_le32(header+8, pts >> 32); - - (void) fwrite(header, 1, 12, outfile); -} - -/* Temporal scaling parameters */ -/* This sets all the temporal layer parameters given |num_temporal_layers|, - * including the target bit allocation across temporal layers. Bit allocation - * parameters will be passed in as user parameters in another version. - */ -static void set_temporal_layer_pattern(int num_temporal_layers, - vpx_codec_enc_cfg_t *cfg, - int bitrate, - int *layer_flags) -{ - assert(num_temporal_layers <= MAX_NUM_TEMPORAL_LAYERS); - switch (num_temporal_layers) - { - case 1: - { - /* 1-layer */ - cfg->ts_number_layers = 1; - cfg->ts_periodicity = 1; - cfg->ts_rate_decimator[0] = 1; - cfg->ts_layer_id[0] = 0; - cfg->ts_target_bitrate[0] = bitrate; - - // Update L only. - layer_flags[0] = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF; - break; - } - - case 2: - { - /* 2-layers, with sync point at first frame of layer 1. */ - cfg->ts_number_layers = 2; - cfg->ts_periodicity = 2; - cfg->ts_rate_decimator[0] = 2; - cfg->ts_rate_decimator[1] = 1; - cfg->ts_layer_id[0] = 0; - cfg->ts_layer_id[1] = 1; - // Use 60/40 bit allocation as example. - cfg->ts_target_bitrate[0] = 0.6f * bitrate; - cfg->ts_target_bitrate[1] = bitrate; - - /* 0=L, 1=GF */ - // ARF is used as predictor for all frames, and is only updated on - // key frame. Sync point every 8 frames. - - // Layer 0: predict from L and ARF, update L and G. - layer_flags[0] = VP8_EFLAG_NO_REF_GF | - VP8_EFLAG_NO_UPD_ARF; - - // Layer 1: sync point: predict from L and ARF, and update G. - layer_flags[1] = VP8_EFLAG_NO_REF_GF | - VP8_EFLAG_NO_UPD_LAST | - VP8_EFLAG_NO_UPD_ARF; - - // Layer 0, predict from L and ARF, update L. - layer_flags[2] = VP8_EFLAG_NO_REF_GF | - VP8_EFLAG_NO_UPD_GF | - VP8_EFLAG_NO_UPD_ARF; - - // Layer 1: predict from L, G and ARF, and update G. - layer_flags[3] = VP8_EFLAG_NO_UPD_ARF | - VP8_EFLAG_NO_UPD_LAST | - VP8_EFLAG_NO_UPD_ENTROPY; - - // Layer 0 - layer_flags[4] = layer_flags[2]; - - // Layer 1 - layer_flags[5] = layer_flags[3]; - - // Layer 0 - layer_flags[6] = layer_flags[4]; - - // Layer 1 - layer_flags[7] = layer_flags[5]; - break; - } - - case 3: - default: - { - // 3-layers structure where ARF is used as predictor for all frames, - // and is only updated on key frame. - // Sync points for layer 1 and 2 every 8 frames. - cfg->ts_number_layers = 3; - cfg->ts_periodicity = 4; - cfg->ts_rate_decimator[0] = 4; - cfg->ts_rate_decimator[1] = 2; - cfg->ts_rate_decimator[2] = 1; - cfg->ts_layer_id[0] = 0; - cfg->ts_layer_id[1] = 2; - cfg->ts_layer_id[2] = 1; - cfg->ts_layer_id[3] = 2; - // Use 40/20/40 bit allocation as example. - cfg->ts_target_bitrate[0] = 0.4f * bitrate; - cfg->ts_target_bitrate[1] = 0.6f * bitrate; - cfg->ts_target_bitrate[2] = bitrate; - - /* 0=L, 1=GF, 2=ARF */ - - // Layer 0: predict from L and ARF; update L and G. - layer_flags[0] = VP8_EFLAG_NO_UPD_ARF | - VP8_EFLAG_NO_REF_GF; - - // Layer 2: sync point: predict from L and ARF; update none. - layer_flags[1] = VP8_EFLAG_NO_REF_GF | - VP8_EFLAG_NO_UPD_GF | - VP8_EFLAG_NO_UPD_ARF | - VP8_EFLAG_NO_UPD_LAST | - VP8_EFLAG_NO_UPD_ENTROPY; - - // Layer 1: sync point: predict from L and ARF; update G. - layer_flags[2] = VP8_EFLAG_NO_REF_GF | - VP8_EFLAG_NO_UPD_ARF | - VP8_EFLAG_NO_UPD_LAST; - - // Layer 2: predict from L, G, ARF; update none. - layer_flags[3] = VP8_EFLAG_NO_UPD_GF | - VP8_EFLAG_NO_UPD_ARF | - VP8_EFLAG_NO_UPD_LAST | - VP8_EFLAG_NO_UPD_ENTROPY; - - // Layer 0: predict from L and ARF; update L. - layer_flags[4] = VP8_EFLAG_NO_UPD_GF | - VP8_EFLAG_NO_UPD_ARF | - VP8_EFLAG_NO_REF_GF; - - // Layer 2: predict from L, G, ARF; update none. - layer_flags[5] = layer_flags[3]; - - // Layer 1: predict from L, G, ARF; update G. - layer_flags[6] = VP8_EFLAG_NO_UPD_ARF | - VP8_EFLAG_NO_UPD_LAST; - - // Layer 2: predict from L, G, ARF; update none. - layer_flags[7] = layer_flags[3]; - break; - } - } -} - -/* The periodicity of the pattern given the number of temporal layers. */ -static int periodicity_to_num_layers[MAX_NUM_TEMPORAL_LAYERS] = {1, 8, 8}; - -int main(int argc, char **argv) -{ - FILE *infile, *outfile[NUM_ENCODERS]; - FILE *downsampled_input[NUM_ENCODERS - 1]; - char filename[50]; - vpx_codec_ctx_t codec[NUM_ENCODERS]; - vpx_codec_enc_cfg_t cfg[NUM_ENCODERS]; - int frame_cnt = 0; - vpx_image_t raw[NUM_ENCODERS]; - vpx_codec_err_t res[NUM_ENCODERS]; - - int i; - long width; - long height; - int length_frame; - int frame_avail; - int got_data; - int flags = 0; - int layer_id = 0; - - int layer_flags[VPX_TS_MAX_PERIODICITY * NUM_ENCODERS] - = {0}; - int flag_periodicity; - - /*Currently, only realtime mode is supported in multi-resolution encoding.*/ - int arg_deadline = VPX_DL_REALTIME; - - /* Set show_psnr to 1/0 to show/not show PSNR. Choose show_psnr=0 if you - don't need to know PSNR, which will skip PSNR calculation and save - encoding time. */ - int show_psnr = 0; - int key_frame_insert = 0; - uint64_t psnr_sse_total[NUM_ENCODERS] = {0}; - uint64_t psnr_samples_total[NUM_ENCODERS] = {0}; - double psnr_totals[NUM_ENCODERS][4] = {{0,0}}; - int psnr_count[NUM_ENCODERS] = {0}; - - double cx_time = 0; - struct timeval tv1, tv2, difftv; - - /* Set the required target bitrates for each resolution level. - * If target bitrate for highest-resolution level is set to 0, - * (i.e. target_bitrate[0]=0), we skip encoding at that level. - */ - unsigned int target_bitrate[NUM_ENCODERS]={1000, 500, 100}; - - /* Enter the frame rate of the input video */ - int framerate = 30; - - /* Set down-sampling factor for each resolution level. - dsf[0] controls down sampling from level 0 to level 1; - dsf[1] controls down sampling from level 1 to level 2; - dsf[2] is not used. */ - vpx_rational_t dsf[NUM_ENCODERS] = {{2, 1}, {2, 1}, {1, 1}}; - - /* Set the number of temporal layers for each encoder/resolution level, - * starting from highest resoln down to lowest resoln. */ - unsigned int num_temporal_layers[NUM_ENCODERS] = {3, 3, 3}; - - if(argc!= (7 + 3 * NUM_ENCODERS)) - die("Usage: %s " - " \n", - argv[0]); - - printf("Using %s\n",vpx_codec_iface_name(interface)); - - width = strtol(argv[1], NULL, 0); - height = strtol(argv[2], NULL, 0); - framerate = strtol(argv[3], NULL, 0); - - if(width < 16 || width%2 || height <16 || height%2) - die("Invalid resolution: %ldx%ld", width, height); - - /* Open input video file for encoding */ - if(!(infile = fopen(argv[4], "rb"))) - die("Failed to open %s for reading", argv[4]); - - /* Open output file for each encoder to output bitstreams */ - for (i=0; i< NUM_ENCODERS; i++) - { - if(!target_bitrate[i]) - { - outfile[i] = NULL; - continue; - } - - if(!(outfile[i] = fopen(argv[i+5], "wb"))) - die("Failed to open %s for writing", argv[i+4]); - } - - // Bitrates per spatial layer: overwrite default rates above. - for (i=0; i< NUM_ENCODERS; i++) - { - target_bitrate[i] = strtol(argv[NUM_ENCODERS + 5 + i], NULL, 0); - } - - // Temporal layers per spatial layers: overwrite default settings above. - for (i=0; i< NUM_ENCODERS; i++) - { - num_temporal_layers[i] = strtol(argv[2 * NUM_ENCODERS + 5 + i], NULL, 0); - if (num_temporal_layers[i] < 1 || num_temporal_layers[i] > 3) - die("Invalid temporal layers: %d, Must be 1, 2, or 3. \n", - num_temporal_layers); - } - - /* Open file to write out each spatially downsampled input stream. */ - for (i=0; i< NUM_ENCODERS - 1; i++) - { - // Highest resoln is encoder 0. - if (sprintf(filename,"ds%d.yuv",NUM_ENCODERS - i) < 0) - { - return EXIT_FAILURE; - } - downsampled_input[i] = fopen(filename,"wb"); - } - - key_frame_insert = strtol(argv[3 * NUM_ENCODERS + 5], NULL, 0); - - show_psnr = strtol(argv[3 * NUM_ENCODERS + 6], NULL, 0); - - - /* Populate default encoder configuration */ - for (i=0; i< NUM_ENCODERS; i++) - { - res[i] = vpx_codec_enc_config_default(interface, &cfg[i], 0); - if(res[i]) { - printf("Failed to get config: %s\n", vpx_codec_err_to_string(res[i])); - return EXIT_FAILURE; - } - } - - /* - * Update the default configuration according to needs of the application. - */ - /* Highest-resolution encoder settings */ - cfg[0].g_w = width; - cfg[0].g_h = height; - cfg[0].rc_dropframe_thresh = 0; - cfg[0].rc_end_usage = VPX_CBR; - cfg[0].rc_resize_allowed = 0; - cfg[0].rc_min_quantizer = 2; - cfg[0].rc_max_quantizer = 56; - cfg[0].rc_undershoot_pct = 100; - cfg[0].rc_overshoot_pct = 15; - cfg[0].rc_buf_initial_sz = 500; - cfg[0].rc_buf_optimal_sz = 600; - cfg[0].rc_buf_sz = 1000; - cfg[0].g_error_resilient = 1; /* Enable error resilient mode */ - cfg[0].g_lag_in_frames = 0; - - /* Disable automatic keyframe placement */ - /* Note: These 3 settings are copied to all levels. But, except the lowest - * resolution level, all other levels are set to VPX_KF_DISABLED internally. - */ - cfg[0].kf_mode = VPX_KF_AUTO; - cfg[0].kf_min_dist = 3000; - cfg[0].kf_max_dist = 3000; - - cfg[0].rc_target_bitrate = target_bitrate[0]; /* Set target bitrate */ - cfg[0].g_timebase.num = 1; /* Set fps */ - cfg[0].g_timebase.den = framerate; - - /* Other-resolution encoder settings */ - for (i=1; i< NUM_ENCODERS; i++) - { - memcpy(&cfg[i], &cfg[0], sizeof(vpx_codec_enc_cfg_t)); - - cfg[i].rc_target_bitrate = target_bitrate[i]; - - /* Note: Width & height of other-resolution encoders are calculated - * from the highest-resolution encoder's size and the corresponding - * down_sampling_factor. - */ - { - unsigned int iw = cfg[i-1].g_w*dsf[i-1].den + dsf[i-1].num - 1; - unsigned int ih = cfg[i-1].g_h*dsf[i-1].den + dsf[i-1].num - 1; - cfg[i].g_w = iw/dsf[i-1].num; - cfg[i].g_h = ih/dsf[i-1].num; - } - - /* Make width & height to be multiplier of 2. */ - // Should support odd size ??? - if((cfg[i].g_w)%2)cfg[i].g_w++; - if((cfg[i].g_h)%2)cfg[i].g_h++; - } - - - // Set the number of threads per encode/spatial layer. - // (1, 1, 1) means no encoder threading. - cfg[0].g_threads = 2; - cfg[1].g_threads = 1; - cfg[2].g_threads = 1; - - /* Allocate image for each encoder */ - for (i=0; i< NUM_ENCODERS; i++) - if(!vpx_img_alloc(&raw[i], VPX_IMG_FMT_I420, cfg[i].g_w, cfg[i].g_h, 32)) - die("Failed to allocate image", cfg[i].g_w, cfg[i].g_h); - - if (raw[0].stride[VPX_PLANE_Y] == raw[0].d_w) - read_frame_p = read_frame; - else - read_frame_p = read_frame_by_row; - - for (i=0; i< NUM_ENCODERS; i++) - if(outfile[i]) - write_ivf_file_header(outfile[i], &cfg[i], 0); - - /* Temporal layers settings */ - for ( i=0; i 0 && frame_cnt == key_frame_insert) - { - flags = VPX_EFLAG_FORCE_KF; - } - - vpx_codec_control(&codec[i], VP8E_SET_FRAME_FLAGS, flags); - vpx_codec_control(&codec[i], VP8E_SET_TEMPORAL_LAYER_ID, layer_id); - } - - gettimeofday(&tv1, NULL); - /* Encode each frame at multi-levels */ - /* Note the flags must be set to 0 in the encode call if they are set - for each frame with the vpx_codec_control(), as done above. */ - if(vpx_codec_encode(&codec[0], frame_avail? &raw[0] : NULL, - frame_cnt, 1, 0, arg_deadline)) - { - die_codec(&codec[0], "Failed to encode frame"); - } - gettimeofday(&tv2, NULL); - timersub(&tv2, &tv1, &difftv); - cx_time += (double)(difftv.tv_sec * 1000000 + difftv.tv_usec); - for (i=NUM_ENCODERS-1; i>=0 ; i--) - { - got_data = 0; - while( (pkt[i] = vpx_codec_get_cx_data(&codec[i], &iter[i])) ) - { - got_data = 1; - switch(pkt[i]->kind) { - case VPX_CODEC_CX_FRAME_PKT: - write_ivf_frame_header(outfile[i], pkt[i]); - (void) fwrite(pkt[i]->data.frame.buf, 1, - pkt[i]->data.frame.sz, outfile[i]); - break; - case VPX_CODEC_PSNR_PKT: - if (show_psnr) - { - int j; - - psnr_sse_total[i] += pkt[i]->data.psnr.sse[0]; - psnr_samples_total[i] += pkt[i]->data.psnr.samples[0]; - for (j = 0; j < 4; j++) - { - psnr_totals[i][j] += pkt[i]->data.psnr.psnr[j]; - } - psnr_count[i]++; - } - - break; - default: - break; - } - printf(pkt[i]->kind == VPX_CODEC_CX_FRAME_PKT - && (pkt[i]->data.frame.flags & VPX_FRAME_IS_KEY)? "K":""); - fflush(stdout); - } - } - frame_cnt++; - } - printf("\n"); - printf("FPS for encoding %d %f %f \n", frame_cnt, (float)cx_time / 1000000, - 1000000 * (double)frame_cnt / (double)cx_time); - - fclose(infile); - - printf("Processed %ld frames.\n",(long int)frame_cnt-1); - for (i=0; i< NUM_ENCODERS; i++) - { - /* Calculate PSNR and print it out */ - if ( (show_psnr) && (psnr_count[i]>0) ) - { - int j; - double ovpsnr = sse_to_psnr(psnr_samples_total[i], 255.0, - psnr_sse_total[i]); - - fprintf(stderr, "\n ENC%d PSNR (Overall/Avg/Y/U/V)", i); - - fprintf(stderr, " %.3lf", ovpsnr); - for (j = 0; j < 4; j++) - { - fprintf(stderr, " %.3lf", psnr_totals[i][j]/psnr_count[i]); - } - } - - if(vpx_codec_destroy(&codec[i])) - die_codec(&codec[i], "Failed to destroy codec"); - - vpx_img_free(&raw[i]); - - if(!outfile[i]) - continue; - - /* Try to rewrite the file header with the actual frame count */ - if(!fseek(outfile[i], 0, SEEK_SET)) - write_ivf_file_header(outfile[i], &cfg[i], frame_cnt-1); - fclose(outfile[i]); - } - printf("\n"); - - return EXIT_SUCCESS; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/vp9_lossless_encoder.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/vp9_lossless_encoder.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/vp9_lossless_encoder.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/vp9_lossless_encoder.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,144 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include - -#include "vpx/vpx_encoder.h" -#include "vpx/vp8cx.h" - -#include "../tools_common.h" -#include "../video_writer.h" - -static const char *exec_name; - -void usage_exit() { - fprintf(stderr, "vp9_lossless_encoder: Example demonstrating VP9 lossless " - "encoding feature. Supports raw input only.\n"); - fprintf(stderr, "Usage: %s \n", exec_name); - exit(EXIT_FAILURE); -} - -static int encode_frame(vpx_codec_ctx_t *codec, - vpx_image_t *img, - int frame_index, - int flags, - VpxVideoWriter *writer) { - int got_pkts = 0; - vpx_codec_iter_t iter = NULL; - const vpx_codec_cx_pkt_t *pkt = NULL; - const vpx_codec_err_t res = vpx_codec_encode(codec, img, frame_index, 1, - flags, VPX_DL_GOOD_QUALITY); - if (res != VPX_CODEC_OK) - die_codec(codec, "Failed to encode frame"); - - while ((pkt = vpx_codec_get_cx_data(codec, &iter)) != NULL) { - got_pkts = 1; - - if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) { - const int keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0; - if (!vpx_video_writer_write_frame(writer, - pkt->data.frame.buf, - pkt->data.frame.sz, - pkt->data.frame.pts)) { - die_codec(codec, "Failed to write compressed frame"); - } - printf(keyframe ? "K" : "."); - fflush(stdout); - } - } - - return got_pkts; -} - -int main(int argc, char **argv) { - FILE *infile = NULL; - vpx_codec_ctx_t codec; - vpx_codec_enc_cfg_t cfg; - int frame_count = 0; - vpx_image_t raw; - vpx_codec_err_t res; - VpxVideoInfo info = {0}; - VpxVideoWriter *writer = NULL; - const VpxInterface *encoder = NULL; - const int fps = 30; - - exec_name = argv[0]; - - if (argc < 5) - die("Invalid number of arguments"); - - encoder = get_vpx_encoder_by_name("vp9"); - if (!encoder) - die("Unsupported codec."); - - info.codec_fourcc = encoder->fourcc; - info.frame_width = strtol(argv[1], NULL, 0); - info.frame_height = strtol(argv[2], NULL, 0); - info.time_base.numerator = 1; - info.time_base.denominator = fps; - - if (info.frame_width <= 0 || - info.frame_height <= 0 || - (info.frame_width % 2) != 0 || - (info.frame_height % 2) != 0) { - die("Invalid frame size: %dx%d", info.frame_width, info.frame_height); - } - - if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, info.frame_width, - info.frame_height, 1)) { - die("Failed to allocate image."); - } - - printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface())); - - res = vpx_codec_enc_config_default(encoder->codec_interface(), &cfg, 0); - if (res) - die_codec(&codec, "Failed to get default codec config."); - - cfg.g_w = info.frame_width; - cfg.g_h = info.frame_height; - cfg.g_timebase.num = info.time_base.numerator; - cfg.g_timebase.den = info.time_base.denominator; - - writer = vpx_video_writer_open(argv[4], kContainerIVF, &info); - if (!writer) - die("Failed to open %s for writing.", argv[4]); - - if (!(infile = fopen(argv[3], "rb"))) - die("Failed to open %s for reading.", argv[3]); - - if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0)) - die_codec(&codec, "Failed to initialize encoder"); - - if (vpx_codec_control_(&codec, VP9E_SET_LOSSLESS, 1)) - die_codec(&codec, "Failed to use lossless mode"); - - // Encode frames. - while (vpx_img_read(&raw, infile)) { - encode_frame(&codec, &raw, frame_count++, 0, writer); - } - - // Flush encoder. - while (encode_frame(&codec, NULL, -1, 0, writer)) {} - - printf("\n"); - fclose(infile); - printf("Processed %d frames.\n", frame_count); - - vpx_img_free(&raw); - if (vpx_codec_destroy(&codec)) - die_codec(&codec, "Failed to destroy codec."); - - vpx_video_writer_close(writer); - - return EXIT_SUCCESS; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/vp9_spatial_svc_encoder.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/vp9_spatial_svc_encoder.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/vp9_spatial_svc_encoder.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/vp9_spatial_svc_encoder.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,448 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -/* - * This is an example demonstrating how to implement a multi-layer - * VP9 encoding scheme based on spatial scalability for video applications - * that benefit from a scalable bitstream. - */ - -#include -#include -#include -#include - -#include "../args.h" -#include "../tools_common.h" -#include "../video_writer.h" - -#include "vpx/svc_context.h" -#include "vpx/vp8cx.h" -#include "vpx/vpx_encoder.h" -#include "../vpxstats.h" - -static const arg_def_t skip_frames_arg = - ARG_DEF("s", "skip-frames", 1, "input frames to skip"); -static const arg_def_t frames_arg = - ARG_DEF("f", "frames", 1, "number of frames to encode"); -static const arg_def_t width_arg = ARG_DEF("w", "width", 1, "source width"); -static const arg_def_t height_arg = ARG_DEF("h", "height", 1, "source height"); -static const arg_def_t timebase_arg = - ARG_DEF("t", "timebase", 1, "timebase (num/den)"); -static const arg_def_t bitrate_arg = ARG_DEF( - "b", "target-bitrate", 1, "encoding bitrate, in kilobits per second"); -static const arg_def_t spatial_layers_arg = - ARG_DEF("sl", "spatial-layers", 1, "number of spatial SVC layers"); -static const arg_def_t temporal_layers_arg = - ARG_DEF("tl", "temporal-layers", 1, "number of temporal SVC layers"); -static const arg_def_t kf_dist_arg = - ARG_DEF("k", "kf-dist", 1, "number of frames between keyframes"); -static const arg_def_t scale_factors_arg = - ARG_DEF("r", "scale-factors", 1, "scale factors (lowest to highest layer)"); -static const arg_def_t passes_arg = - ARG_DEF("p", "passes", 1, "Number of passes (1/2)"); -static const arg_def_t pass_arg = - ARG_DEF(NULL, "pass", 1, "Pass to execute (1/2)"); -static const arg_def_t fpf_name_arg = - ARG_DEF(NULL, "fpf", 1, "First pass statistics file name"); -static const arg_def_t min_q_arg = - ARG_DEF(NULL, "min-q", 1, "Minimum quantizer"); -static const arg_def_t max_q_arg = - ARG_DEF(NULL, "max-q", 1, "Maximum quantizer"); -static const arg_def_t min_bitrate_arg = - ARG_DEF(NULL, "min-bitrate", 1, "Minimum bitrate"); -static const arg_def_t max_bitrate_arg = - ARG_DEF(NULL, "max-bitrate", 1, "Maximum bitrate"); -static const arg_def_t lag_in_frame_arg = - ARG_DEF(NULL, "lag-in-frames", 1, "Number of frame to input before " - "generating any outputs"); -static const arg_def_t rc_end_usage_arg = - ARG_DEF(NULL, "rc-end-usage", 1, "0 - 3: VBR, CBR, CQ, Q"); - -#if CONFIG_VP9_HIGHBITDEPTH -static const struct arg_enum_list bitdepth_enum[] = { - {"8", VPX_BITS_8}, - {"10", VPX_BITS_10}, - {"12", VPX_BITS_12}, - {NULL, 0} -}; - -static const arg_def_t bitdepth_arg = - ARG_DEF_ENUM("d", "bit-depth", 1, "Bit depth for codec 8, 10 or 12. ", - bitdepth_enum); -#endif // CONFIG_VP9_HIGHBITDEPTH - - -static const arg_def_t *svc_args[] = { - &frames_arg, &width_arg, &height_arg, - &timebase_arg, &bitrate_arg, &skip_frames_arg, &spatial_layers_arg, - &kf_dist_arg, &scale_factors_arg, &passes_arg, &pass_arg, - &fpf_name_arg, &min_q_arg, &max_q_arg, &min_bitrate_arg, - &max_bitrate_arg, &temporal_layers_arg, &lag_in_frame_arg, -#if CONFIG_VP9_HIGHBITDEPTH - &bitdepth_arg, -#endif - &rc_end_usage_arg, NULL -}; - -static const uint32_t default_frames_to_skip = 0; -static const uint32_t default_frames_to_code = 60 * 60; -static const uint32_t default_width = 1920; -static const uint32_t default_height = 1080; -static const uint32_t default_timebase_num = 1; -static const uint32_t default_timebase_den = 60; -static const uint32_t default_bitrate = 1000; -static const uint32_t default_spatial_layers = 5; -static const uint32_t default_temporal_layers = 1; -static const uint32_t default_kf_dist = 100; - -typedef struct { - const char *input_filename; - const char *output_filename; - uint32_t frames_to_code; - uint32_t frames_to_skip; - struct VpxInputContext input_ctx; - stats_io_t rc_stats; - int passes; - int pass; -} AppInput; - -static const char *exec_name; - -void usage_exit() { - fprintf(stderr, "Usage: %s input_filename output_filename\n", - exec_name); - fprintf(stderr, "Options:\n"); - arg_show_usage(stderr, svc_args); - exit(EXIT_FAILURE); -} - -static void parse_command_line(int argc, const char **argv_, - AppInput *app_input, SvcContext *svc_ctx, - vpx_codec_enc_cfg_t *enc_cfg) { - struct arg arg = {0}; - char **argv = NULL; - char **argi = NULL; - char **argj = NULL; - vpx_codec_err_t res; - int passes = 0; - int pass = 0; - const char *fpf_file_name = NULL; - unsigned int min_bitrate = 0; - unsigned int max_bitrate = 0; - char string_options[1024] = {0}; - - // initialize SvcContext with parameters that will be passed to vpx_svc_init - svc_ctx->log_level = SVC_LOG_DEBUG; - svc_ctx->spatial_layers = default_spatial_layers; - svc_ctx->temporal_layers = default_temporal_layers; - - // start with default encoder configuration - res = vpx_codec_enc_config_default(vpx_codec_vp9_cx(), enc_cfg, 0); - if (res) { - die("Failed to get config: %s\n", vpx_codec_err_to_string(res)); - } - // update enc_cfg with app default values - enc_cfg->g_w = default_width; - enc_cfg->g_h = default_height; - enc_cfg->g_timebase.num = default_timebase_num; - enc_cfg->g_timebase.den = default_timebase_den; - enc_cfg->rc_target_bitrate = default_bitrate; - enc_cfg->kf_min_dist = default_kf_dist; - enc_cfg->kf_max_dist = default_kf_dist; - enc_cfg->rc_end_usage = VPX_CQ; - - // initialize AppInput with default values - app_input->frames_to_code = default_frames_to_code; - app_input->frames_to_skip = default_frames_to_skip; - - // process command line options - argv = argv_dup(argc - 1, argv_ + 1); - for (argi = argj = argv; (*argj = *argi); argi += arg.argv_step) { - arg.argv_step = 1; - - if (arg_match(&arg, &frames_arg, argi)) { - app_input->frames_to_code = arg_parse_uint(&arg); - } else if (arg_match(&arg, &width_arg, argi)) { - enc_cfg->g_w = arg_parse_uint(&arg); - } else if (arg_match(&arg, &height_arg, argi)) { - enc_cfg->g_h = arg_parse_uint(&arg); - } else if (arg_match(&arg, &timebase_arg, argi)) { - enc_cfg->g_timebase = arg_parse_rational(&arg); - } else if (arg_match(&arg, &bitrate_arg, argi)) { - enc_cfg->rc_target_bitrate = arg_parse_uint(&arg); - } else if (arg_match(&arg, &skip_frames_arg, argi)) { - app_input->frames_to_skip = arg_parse_uint(&arg); - } else if (arg_match(&arg, &spatial_layers_arg, argi)) { - svc_ctx->spatial_layers = arg_parse_uint(&arg); - } else if (arg_match(&arg, &temporal_layers_arg, argi)) { - svc_ctx->temporal_layers = arg_parse_uint(&arg); - } else if (arg_match(&arg, &kf_dist_arg, argi)) { - enc_cfg->kf_min_dist = arg_parse_uint(&arg); - enc_cfg->kf_max_dist = enc_cfg->kf_min_dist; - } else if (arg_match(&arg, &scale_factors_arg, argi)) { - snprintf(string_options, sizeof(string_options), "%s scale-factors=%s", - string_options, arg.val); - } else if (arg_match(&arg, &passes_arg, argi)) { - passes = arg_parse_uint(&arg); - if (passes < 1 || passes > 2) { - die("Error: Invalid number of passes (%d)\n", passes); - } - } else if (arg_match(&arg, &pass_arg, argi)) { - pass = arg_parse_uint(&arg); - if (pass < 1 || pass > 2) { - die("Error: Invalid pass selected (%d)\n", pass); - } - } else if (arg_match(&arg, &fpf_name_arg, argi)) { - fpf_file_name = arg.val; - } else if (arg_match(&arg, &min_q_arg, argi)) { - snprintf(string_options, sizeof(string_options), "%s min-quantizers=%s", - string_options, arg.val); - } else if (arg_match(&arg, &max_q_arg, argi)) { - snprintf(string_options, sizeof(string_options), "%s max-quantizers=%s", - string_options, arg.val); - } else if (arg_match(&arg, &min_bitrate_arg, argi)) { - min_bitrate = arg_parse_uint(&arg); - } else if (arg_match(&arg, &max_bitrate_arg, argi)) { - max_bitrate = arg_parse_uint(&arg); - } else if (arg_match(&arg, &lag_in_frame_arg, argi)) { - enc_cfg->g_lag_in_frames = arg_parse_uint(&arg); - } else if (arg_match(&arg, &rc_end_usage_arg, argi)) { - enc_cfg->rc_end_usage = arg_parse_uint(&arg); -#if CONFIG_VP9_HIGHBITDEPTH - } else if (arg_match(&arg, &bitdepth_arg, argi)) { - enc_cfg->g_bit_depth = arg_parse_enum_or_int(&arg); - switch (enc_cfg->g_bit_depth) { - case VPX_BITS_8: - enc_cfg->g_input_bit_depth = 8; - enc_cfg->g_profile = 0; - break; - case VPX_BITS_10: - enc_cfg->g_input_bit_depth = 10; - enc_cfg->g_profile = 2; - break; - case VPX_BITS_12: - enc_cfg->g_input_bit_depth = 12; - enc_cfg->g_profile = 2; - break; - default: - die("Error: Invalid bit depth selected (%d)\n", enc_cfg->g_bit_depth); - break; - } -#endif // CONFIG_VP9_HIGHBITDEPTH - } else { - ++argj; - } - } - - // There will be a space in front of the string options - if (strlen(string_options) > 0) - vpx_svc_set_options(svc_ctx, string_options + 1); - - if (passes == 0 || passes == 1) { - if (pass) { - fprintf(stderr, "pass is ignored since there's only one pass\n"); - } - enc_cfg->g_pass = VPX_RC_ONE_PASS; - } else { - if (pass == 0) { - die("pass must be specified when passes is 2\n"); - } - - if (fpf_file_name == NULL) { - die("fpf must be specified when passes is 2\n"); - } - - if (pass == 1) { - enc_cfg->g_pass = VPX_RC_FIRST_PASS; - if (!stats_open_file(&app_input->rc_stats, fpf_file_name, 0)) { - fatal("Failed to open statistics store"); - } - } else { - enc_cfg->g_pass = VPX_RC_LAST_PASS; - if (!stats_open_file(&app_input->rc_stats, fpf_file_name, 1)) { - fatal("Failed to open statistics store"); - } - enc_cfg->rc_twopass_stats_in = stats_get(&app_input->rc_stats); - } - app_input->passes = passes; - app_input->pass = pass; - } - - if (enc_cfg->rc_target_bitrate > 0) { - if (min_bitrate > 0) { - enc_cfg->rc_2pass_vbr_minsection_pct = - min_bitrate * 100 / enc_cfg->rc_target_bitrate; - } - if (max_bitrate > 0) { - enc_cfg->rc_2pass_vbr_maxsection_pct = - max_bitrate * 100 / enc_cfg->rc_target_bitrate; - } - } - - // Check for unrecognized options - for (argi = argv; *argi; ++argi) - if (argi[0][0] == '-' && strlen(argi[0]) > 1) - die("Error: Unrecognized option %s\n", *argi); - - if (argv[0] == NULL || argv[1] == 0) { - usage_exit(); - } - app_input->input_filename = argv[0]; - app_input->output_filename = argv[1]; - free(argv); - - if (enc_cfg->g_w < 16 || enc_cfg->g_w % 2 || enc_cfg->g_h < 16 || - enc_cfg->g_h % 2) - die("Invalid resolution: %d x %d\n", enc_cfg->g_w, enc_cfg->g_h); - - printf( - "Codec %s\nframes: %d, skip: %d\n" - "layers: %d\n" - "width %d, height: %d,\n" - "num: %d, den: %d, bitrate: %d,\n" - "gop size: %d\n", - vpx_codec_iface_name(vpx_codec_vp9_cx()), app_input->frames_to_code, - app_input->frames_to_skip, - svc_ctx->spatial_layers, enc_cfg->g_w, enc_cfg->g_h, - enc_cfg->g_timebase.num, enc_cfg->g_timebase.den, - enc_cfg->rc_target_bitrate, enc_cfg->kf_max_dist); -} - -int main(int argc, const char **argv) { - AppInput app_input = {0}; - VpxVideoWriter *writer = NULL; - VpxVideoInfo info = {0}; - vpx_codec_ctx_t codec; - vpx_codec_enc_cfg_t enc_cfg; - SvcContext svc_ctx; - uint32_t i; - uint32_t frame_cnt = 0; - vpx_image_t raw; - vpx_codec_err_t res; - int pts = 0; /* PTS starts at 0 */ - int frame_duration = 1; /* 1 timebase tick per frame */ - FILE *infile = NULL; - int end_of_stream = 0; - int frames_received = 0; - - memset(&svc_ctx, 0, sizeof(svc_ctx)); - svc_ctx.log_print = 1; - exec_name = argv[0]; - parse_command_line(argc, argv, &app_input, &svc_ctx, &enc_cfg); - - // Allocate image buffer -#if CONFIG_VP9_HIGHBITDEPTH - if (!vpx_img_alloc(&raw, enc_cfg.g_input_bit_depth == 8 ? - VPX_IMG_FMT_I420 : VPX_IMG_FMT_I42016, - enc_cfg.g_w, enc_cfg.g_h, 32)) { - die("Failed to allocate image %dx%d\n", enc_cfg.g_w, enc_cfg.g_h); - } -#else - if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, enc_cfg.g_w, enc_cfg.g_h, 32)) { - die("Failed to allocate image %dx%d\n", enc_cfg.g_w, enc_cfg.g_h); - } -#endif // CONFIG_VP9_HIGHBITDEPTH - - if (!(infile = fopen(app_input.input_filename, "rb"))) - die("Failed to open %s for reading\n", app_input.input_filename); - - // Initialize codec - if (vpx_svc_init(&svc_ctx, &codec, vpx_codec_vp9_cx(), &enc_cfg) != - VPX_CODEC_OK) - die("Failed to initialize encoder\n"); - - info.codec_fourcc = VP9_FOURCC; - info.time_base.numerator = enc_cfg.g_timebase.num; - info.time_base.denominator = enc_cfg.g_timebase.den; - - if (!(app_input.passes == 2 && app_input.pass == 1)) { - // We don't save the bitstream for the 1st pass on two pass rate control - writer = vpx_video_writer_open(app_input.output_filename, kContainerIVF, - &info); - if (!writer) - die("Failed to open %s for writing\n", app_input.output_filename); - } - - // skip initial frames - for (i = 0; i < app_input.frames_to_skip; ++i) - vpx_img_read(&raw, infile); - - // Encode frames - while (!end_of_stream) { - vpx_codec_iter_t iter = NULL; - const vpx_codec_cx_pkt_t *cx_pkt; - if (frame_cnt >= app_input.frames_to_code || !vpx_img_read(&raw, infile)) { - // We need one extra vpx_svc_encode call at end of stream to flush - // encoder and get remaining data - end_of_stream = 1; - } - - res = vpx_svc_encode(&svc_ctx, &codec, (end_of_stream ? NULL : &raw), - pts, frame_duration, VPX_DL_GOOD_QUALITY); - printf("%s", vpx_svc_get_message(&svc_ctx)); - if (res != VPX_CODEC_OK) { - die_codec(&codec, "Failed to encode frame"); - } - - while ((cx_pkt = vpx_codec_get_cx_data(&codec, &iter)) != NULL) { - switch (cx_pkt->kind) { - case VPX_CODEC_CX_FRAME_PKT: { - if (cx_pkt->data.frame.sz > 0) - vpx_video_writer_write_frame(writer, - cx_pkt->data.frame.buf, - cx_pkt->data.frame.sz, - cx_pkt->data.frame.pts); - - printf("SVC frame: %d, kf: %d, size: %d, pts: %d\n", frames_received, - !!(cx_pkt->data.frame.flags & VPX_FRAME_IS_KEY), - (int)cx_pkt->data.frame.sz, (int)cx_pkt->data.frame.pts); - ++frames_received; - break; - } - case VPX_CODEC_STATS_PKT: { - stats_write(&app_input.rc_stats, - cx_pkt->data.twopass_stats.buf, - cx_pkt->data.twopass_stats.sz); - break; - } - default: { - break; - } - } - } - - if (!end_of_stream) { - ++frame_cnt; - pts += frame_duration; - } - } - - printf("Processed %d frames\n", frame_cnt); - - fclose(infile); - if (vpx_codec_destroy(&codec)) die_codec(&codec, "Failed to destroy codec"); - - if (app_input.passes == 2) - stats_close(&app_input.rc_stats, 1); - - if (writer) { - vpx_video_writer_close(writer); - } - - vpx_img_free(&raw); - - // display average size, psnr - printf("%s", vpx_svc_dump_statistics(&svc_ctx)); - - vpx_svc_release(&svc_ctx); - - return EXIT_SUCCESS; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/vpx_temporal_svc_encoder.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/vpx_temporal_svc_encoder.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples/vpx_temporal_svc_encoder.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples/vpx_temporal_svc_encoder.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,810 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// This is an example demonstrating how to implement a multi-layer VPx -// encoding scheme based on temporal scalability for video applications -// that benefit from a scalable bitstream. - -#include -#include -#include -#include -#include - -#include "./vpx_config.h" -#include "../vpx_ports/vpx_timer.h" -#include "vpx/vp8cx.h" -#include "vpx/vpx_encoder.h" - -#include "../tools_common.h" -#include "../video_writer.h" - -static const char *exec_name; - -void usage_exit() { - exit(EXIT_FAILURE); -} - -// Denoiser states, for temporal denoising. -enum denoiserState { - kDenoiserOff, - kDenoiserOnYOnly, - kDenoiserOnYUV, - kDenoiserOnYUVAggressive, - kDenoiserOnAdaptive -}; - -static int mode_to_num_layers[12] = {1, 2, 2, 3, 3, 3, 3, 5, 2, 3, 3, 3}; - -// For rate control encoding stats. -struct RateControlMetrics { - // Number of input frames per layer. - int layer_input_frames[VPX_TS_MAX_LAYERS]; - // Total (cumulative) number of encoded frames per layer. - int layer_tot_enc_frames[VPX_TS_MAX_LAYERS]; - // Number of encoded non-key frames per layer. - int layer_enc_frames[VPX_TS_MAX_LAYERS]; - // Framerate per layer layer (cumulative). - double layer_framerate[VPX_TS_MAX_LAYERS]; - // Target average frame size per layer (per-frame-bandwidth per layer). - double layer_pfb[VPX_TS_MAX_LAYERS]; - // Actual average frame size per layer. - double layer_avg_frame_size[VPX_TS_MAX_LAYERS]; - // Average rate mismatch per layer (|target - actual| / target). - double layer_avg_rate_mismatch[VPX_TS_MAX_LAYERS]; - // Actual encoding bitrate per layer (cumulative). - double layer_encoding_bitrate[VPX_TS_MAX_LAYERS]; - // Average of the short-time encoder actual bitrate. - // TODO(marpan): Should we add these short-time stats for each layer? - double avg_st_encoding_bitrate; - // Variance of the short-time encoder actual bitrate. - double variance_st_encoding_bitrate; - // Window (number of frames) for computing short-timee encoding bitrate. - int window_size; - // Number of window measurements. - int window_count; -}; - -// Note: these rate control metrics assume only 1 key frame in the -// sequence (i.e., first frame only). So for temporal pattern# 7 -// (which has key frame for every frame on base layer), the metrics -// computation will be off/wrong. -// TODO(marpan): Update these metrics to account for multiple key frames -// in the stream. -static void set_rate_control_metrics(struct RateControlMetrics *rc, - vpx_codec_enc_cfg_t *cfg) { - unsigned int i = 0; - // Set the layer (cumulative) framerate and the target layer (non-cumulative) - // per-frame-bandwidth, for the rate control encoding stats below. - const double framerate = cfg->g_timebase.den / cfg->g_timebase.num; - rc->layer_framerate[0] = framerate / cfg->ts_rate_decimator[0]; - rc->layer_pfb[0] = 1000.0 * cfg->ts_target_bitrate[0] / - rc->layer_framerate[0]; - for (i = 0; i < cfg->ts_number_layers; ++i) { - if (i > 0) { - rc->layer_framerate[i] = framerate / cfg->ts_rate_decimator[i]; - rc->layer_pfb[i] = 1000.0 * - (cfg->ts_target_bitrate[i] - cfg->ts_target_bitrate[i - 1]) / - (rc->layer_framerate[i] - rc->layer_framerate[i - 1]); - } - rc->layer_input_frames[i] = 0; - rc->layer_enc_frames[i] = 0; - rc->layer_tot_enc_frames[i] = 0; - rc->layer_encoding_bitrate[i] = 0.0; - rc->layer_avg_frame_size[i] = 0.0; - rc->layer_avg_rate_mismatch[i] = 0.0; - } - rc->window_count = 0; - rc->window_size = 15; - rc->avg_st_encoding_bitrate = 0.0; - rc->variance_st_encoding_bitrate = 0.0; -} - -static void printout_rate_control_summary(struct RateControlMetrics *rc, - vpx_codec_enc_cfg_t *cfg, - int frame_cnt) { - unsigned int i = 0; - int tot_num_frames = 0; - double perc_fluctuation = 0.0; - printf("Total number of processed frames: %d\n\n", frame_cnt -1); - printf("Rate control layer stats for %d layer(s):\n\n", - cfg->ts_number_layers); - for (i = 0; i < cfg->ts_number_layers; ++i) { - const int num_dropped = (i > 0) ? - (rc->layer_input_frames[i] - rc->layer_enc_frames[i]) : - (rc->layer_input_frames[i] - rc->layer_enc_frames[i] - 1); - tot_num_frames += rc->layer_input_frames[i]; - rc->layer_encoding_bitrate[i] = 0.001 * rc->layer_framerate[i] * - rc->layer_encoding_bitrate[i] / tot_num_frames; - rc->layer_avg_frame_size[i] = rc->layer_avg_frame_size[i] / - rc->layer_enc_frames[i]; - rc->layer_avg_rate_mismatch[i] = 100.0 * rc->layer_avg_rate_mismatch[i] / - rc->layer_enc_frames[i]; - printf("For layer#: %d \n", i); - printf("Bitrate (target vs actual): %d %f \n", cfg->ts_target_bitrate[i], - rc->layer_encoding_bitrate[i]); - printf("Average frame size (target vs actual): %f %f \n", rc->layer_pfb[i], - rc->layer_avg_frame_size[i]); - printf("Average rate_mismatch: %f \n", rc->layer_avg_rate_mismatch[i]); - printf("Number of input frames, encoded (non-key) frames, " - "and perc dropped frames: %d %d %f \n", rc->layer_input_frames[i], - rc->layer_enc_frames[i], - 100.0 * num_dropped / rc->layer_input_frames[i]); - printf("\n"); - } - rc->avg_st_encoding_bitrate = rc->avg_st_encoding_bitrate / rc->window_count; - rc->variance_st_encoding_bitrate = - rc->variance_st_encoding_bitrate / rc->window_count - - (rc->avg_st_encoding_bitrate * rc->avg_st_encoding_bitrate); - perc_fluctuation = 100.0 * sqrt(rc->variance_st_encoding_bitrate) / - rc->avg_st_encoding_bitrate; - printf("Short-time stats, for window of %d frames: \n",rc->window_size); - printf("Average, rms-variance, and percent-fluct: %f %f %f \n", - rc->avg_st_encoding_bitrate, - sqrt(rc->variance_st_encoding_bitrate), - perc_fluctuation); - if ((frame_cnt - 1) != tot_num_frames) - die("Error: Number of input frames not equal to output! \n"); -} - -// Temporal scaling parameters: -// NOTE: The 3 prediction frames cannot be used interchangeably due to -// differences in the way they are handled throughout the code. The -// frames should be allocated to layers in the order LAST, GF, ARF. -// Other combinations work, but may produce slightly inferior results. -static void set_temporal_layer_pattern(int layering_mode, - vpx_codec_enc_cfg_t *cfg, - int *layer_flags, - int *flag_periodicity) { - switch (layering_mode) { - case 0: { - // 1-layer. - int ids[1] = {0}; - cfg->ts_periodicity = 1; - *flag_periodicity = 1; - cfg->ts_number_layers = 1; - cfg->ts_rate_decimator[0] = 1; - memcpy(cfg->ts_layer_id, ids, sizeof(ids)); - // Update L only. - layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_UPD_GF | - VP8_EFLAG_NO_UPD_ARF; - break; - } - case 1: { - // 2-layers, 2-frame period. - int ids[2] = {0, 1}; - cfg->ts_periodicity = 2; - *flag_periodicity = 2; - cfg->ts_number_layers = 2; - cfg->ts_rate_decimator[0] = 2; - cfg->ts_rate_decimator[1] = 1; - memcpy(cfg->ts_layer_id, ids, sizeof(ids)); -#if 1 - // 0=L, 1=GF, Intra-layer prediction enabled. - layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_UPD_GF | - VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF; - layer_flags[1] = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST | - VP8_EFLAG_NO_REF_ARF; -#else - // 0=L, 1=GF, Intra-layer prediction disabled. - layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_UPD_GF | - VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF; - layer_flags[1] = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST | - VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_REF_LAST; -#endif - break; - } - case 2: { - // 2-layers, 3-frame period. - int ids[3] = {0, 1, 1}; - cfg->ts_periodicity = 3; - *flag_periodicity = 3; - cfg->ts_number_layers = 2; - cfg->ts_rate_decimator[0] = 3; - cfg->ts_rate_decimator[1] = 1; - memcpy(cfg->ts_layer_id, ids, sizeof(ids)); - // 0=L, 1=GF, Intra-layer prediction enabled. - layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF | - VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF; - layer_flags[1] = - layer_flags[2] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF | - VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST; - break; - } - case 3: { - // 3-layers, 6-frame period. - int ids[6] = {0, 2, 2, 1, 2, 2}; - cfg->ts_periodicity = 6; - *flag_periodicity = 6; - cfg->ts_number_layers = 3; - cfg->ts_rate_decimator[0] = 6; - cfg->ts_rate_decimator[1] = 3; - cfg->ts_rate_decimator[2] = 1; - memcpy(cfg->ts_layer_id, ids, sizeof(ids)); - // 0=L, 1=GF, 2=ARF, Intra-layer prediction enabled. - layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF | - VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF; - layer_flags[3] = VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_ARF | - VP8_EFLAG_NO_UPD_LAST; - layer_flags[1] = - layer_flags[2] = - layer_flags[4] = - layer_flags[5] = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_LAST; - break; - } - case 4: { - // 3-layers, 4-frame period. - int ids[4] = {0, 2, 1, 2}; - cfg->ts_periodicity = 4; - *flag_periodicity = 4; - cfg->ts_number_layers = 3; - cfg->ts_rate_decimator[0] = 4; - cfg->ts_rate_decimator[1] = 2; - cfg->ts_rate_decimator[2] = 1; - memcpy(cfg->ts_layer_id, ids, sizeof(ids)); - // 0=L, 1=GF, 2=ARF, Intra-layer prediction disabled. - layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF | - VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF; - layer_flags[2] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF | - VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST; - layer_flags[1] = - layer_flags[3] = VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST | - VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF; - break; - } - case 5: { - // 3-layers, 4-frame period. - int ids[4] = {0, 2, 1, 2}; - cfg->ts_periodicity = 4; - *flag_periodicity = 4; - cfg->ts_number_layers = 3; - cfg->ts_rate_decimator[0] = 4; - cfg->ts_rate_decimator[1] = 2; - cfg->ts_rate_decimator[2] = 1; - memcpy(cfg->ts_layer_id, ids, sizeof(ids)); - // 0=L, 1=GF, 2=ARF, Intra-layer prediction enabled in layer 1, disabled - // in layer 2. - layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF | - VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF; - layer_flags[2] = VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST | - VP8_EFLAG_NO_UPD_ARF; - layer_flags[1] = - layer_flags[3] = VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST | - VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF; - break; - } - case 6: { - // 3-layers, 4-frame period. - int ids[4] = {0, 2, 1, 2}; - cfg->ts_periodicity = 4; - *flag_periodicity = 4; - cfg->ts_number_layers = 3; - cfg->ts_rate_decimator[0] = 4; - cfg->ts_rate_decimator[1] = 2; - cfg->ts_rate_decimator[2] = 1; - memcpy(cfg->ts_layer_id, ids, sizeof(ids)); - // 0=L, 1=GF, 2=ARF, Intra-layer prediction enabled. - layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF | - VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF; - layer_flags[2] = VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST | - VP8_EFLAG_NO_UPD_ARF; - layer_flags[1] = - layer_flags[3] = VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF; - break; - } - case 7: { - // NOTE: Probably of academic interest only. - // 5-layers, 16-frame period. - int ids[16] = {0, 4, 3, 4, 2, 4, 3, 4, 1, 4, 3, 4, 2, 4, 3, 4}; - cfg->ts_periodicity = 16; - *flag_periodicity = 16; - cfg->ts_number_layers = 5; - cfg->ts_rate_decimator[0] = 16; - cfg->ts_rate_decimator[1] = 8; - cfg->ts_rate_decimator[2] = 4; - cfg->ts_rate_decimator[3] = 2; - cfg->ts_rate_decimator[4] = 1; - memcpy(cfg->ts_layer_id, ids, sizeof(ids)); - layer_flags[0] = VPX_EFLAG_FORCE_KF; - layer_flags[1] = - layer_flags[3] = - layer_flags[5] = - layer_flags[7] = - layer_flags[9] = - layer_flags[11] = - layer_flags[13] = - layer_flags[15] = VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF | - VP8_EFLAG_NO_UPD_ARF; - layer_flags[2] = - layer_flags[6] = - layer_flags[10] = - layer_flags[14] = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_GF; - layer_flags[4] = - layer_flags[12] = VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_UPD_ARF; - layer_flags[8] = VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_REF_GF; - break; - } - case 8: { - // 2-layers, with sync point at first frame of layer 1. - int ids[2] = {0, 1}; - cfg->ts_periodicity = 2; - *flag_periodicity = 8; - cfg->ts_number_layers = 2; - cfg->ts_rate_decimator[0] = 2; - cfg->ts_rate_decimator[1] = 1; - memcpy(cfg->ts_layer_id, ids, sizeof(ids)); - // 0=L, 1=GF. - // ARF is used as predictor for all frames, and is only updated on - // key frame. Sync point every 8 frames. - - // Layer 0: predict from L and ARF, update L and G. - layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF | - VP8_EFLAG_NO_UPD_ARF; - // Layer 1: sync point: predict from L and ARF, and update G. - layer_flags[1] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_LAST | - VP8_EFLAG_NO_UPD_ARF; - // Layer 0, predict from L and ARF, update L. - layer_flags[2] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_GF | - VP8_EFLAG_NO_UPD_ARF; - // Layer 1: predict from L, G and ARF, and update G. - layer_flags[3] = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST | - VP8_EFLAG_NO_UPD_ENTROPY; - // Layer 0. - layer_flags[4] = layer_flags[2]; - // Layer 1. - layer_flags[5] = layer_flags[3]; - // Layer 0. - layer_flags[6] = layer_flags[4]; - // Layer 1. - layer_flags[7] = layer_flags[5]; - break; - } - case 9: { - // 3-layers: Sync points for layer 1 and 2 every 8 frames. - int ids[4] = {0, 2, 1, 2}; - cfg->ts_periodicity = 4; - *flag_periodicity = 8; - cfg->ts_number_layers = 3; - cfg->ts_rate_decimator[0] = 4; - cfg->ts_rate_decimator[1] = 2; - cfg->ts_rate_decimator[2] = 1; - memcpy(cfg->ts_layer_id, ids, sizeof(ids)); - // 0=L, 1=GF, 2=ARF. - layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF | - VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF; - layer_flags[1] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF | - VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF; - layer_flags[2] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF | - VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ARF; - layer_flags[3] = - layer_flags[5] = VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF; - layer_flags[4] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF | - VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF; - layer_flags[6] = VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST | - VP8_EFLAG_NO_UPD_ARF; - layer_flags[7] = VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF | - VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_ENTROPY; - break; - } - case 10: { - // 3-layers structure where ARF is used as predictor for all frames, - // and is only updated on key frame. - // Sync points for layer 1 and 2 every 8 frames. - - int ids[4] = {0, 2, 1, 2}; - cfg->ts_periodicity = 4; - *flag_periodicity = 8; - cfg->ts_number_layers = 3; - cfg->ts_rate_decimator[0] = 4; - cfg->ts_rate_decimator[1] = 2; - cfg->ts_rate_decimator[2] = 1; - memcpy(cfg->ts_layer_id, ids, sizeof(ids)); - // 0=L, 1=GF, 2=ARF. - // Layer 0: predict from L and ARF; update L and G. - layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_UPD_ARF | - VP8_EFLAG_NO_REF_GF; - // Layer 2: sync point: predict from L and ARF; update none. - layer_flags[1] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_GF | - VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST | - VP8_EFLAG_NO_UPD_ENTROPY; - // Layer 1: sync point: predict from L and ARF; update G. - layer_flags[2] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_ARF | - VP8_EFLAG_NO_UPD_LAST; - // Layer 2: predict from L, G, ARF; update none. - layer_flags[3] = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF | - VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ENTROPY; - // Layer 0: predict from L and ARF; update L. - layer_flags[4] = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF | - VP8_EFLAG_NO_REF_GF; - // Layer 2: predict from L, G, ARF; update none. - layer_flags[5] = layer_flags[3]; - // Layer 1: predict from L, G, ARF; update G. - layer_flags[6] = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST; - // Layer 2: predict from L, G, ARF; update none. - layer_flags[7] = layer_flags[3]; - break; - } - case 11: - default: { - // 3-layers structure as in case 10, but no sync/refresh points for - // layer 1 and 2. - int ids[4] = {0, 2, 1, 2}; - cfg->ts_periodicity = 4; - *flag_periodicity = 8; - cfg->ts_number_layers = 3; - cfg->ts_rate_decimator[0] = 4; - cfg->ts_rate_decimator[1] = 2; - cfg->ts_rate_decimator[2] = 1; - memcpy(cfg->ts_layer_id, ids, sizeof(ids)); - // 0=L, 1=GF, 2=ARF. - // Layer 0: predict from L and ARF; update L. - layer_flags[0] = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF | - VP8_EFLAG_NO_REF_GF; - layer_flags[4] = layer_flags[0]; - // Layer 1: predict from L, G, ARF; update G. - layer_flags[2] = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST; - layer_flags[6] = layer_flags[2]; - // Layer 2: predict from L, G, ARF; update none. - layer_flags[1] = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF | - VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ENTROPY; - layer_flags[3] = layer_flags[1]; - layer_flags[5] = layer_flags[1]; - layer_flags[7] = layer_flags[1]; - break; - } - } -} - -int main(int argc, char **argv) { - VpxVideoWriter *outfile[VPX_TS_MAX_LAYERS] = {NULL}; - vpx_codec_ctx_t codec; - vpx_codec_enc_cfg_t cfg; - int frame_cnt = 0; - vpx_image_t raw; - vpx_codec_err_t res; - unsigned int width; - unsigned int height; - int speed; - int frame_avail; - int got_data; - int flags = 0; - unsigned int i; - int pts = 0; // PTS starts at 0. - int frame_duration = 1; // 1 timebase tick per frame. - int layering_mode = 0; - int layer_flags[VPX_TS_MAX_PERIODICITY] = {0}; - int flag_periodicity = 1; -#if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION) - vpx_svc_layer_id_t layer_id = {0, 0}; -#else - vpx_svc_layer_id_t layer_id = {0}; -#endif - const VpxInterface *encoder = NULL; - FILE *infile = NULL; - struct RateControlMetrics rc; - int64_t cx_time = 0; - const int min_args_base = 11; -#if CONFIG_VP9_HIGHBITDEPTH - vpx_bit_depth_t bit_depth = VPX_BITS_8; - int input_bit_depth = 8; - const int min_args = min_args_base + 1; -#else - const int min_args = min_args_base; -#endif // CONFIG_VP9_HIGHBITDEPTH - double sum_bitrate = 0.0; - double sum_bitrate2 = 0.0; - double framerate = 30.0; - - exec_name = argv[0]; - // Check usage and arguments. - if (argc < min_args) { -#if CONFIG_VP9_HIGHBITDEPTH - die("Usage: %s " - " " - " ... \n", argv[0]); -#else - die("Usage: %s " - " " - " ... \n", argv[0]); -#endif // CONFIG_VP9_HIGHBITDEPTH - } - - encoder = get_vpx_encoder_by_name(argv[3]); - if (!encoder) - die("Unsupported codec."); - - printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface())); - - width = strtol(argv[4], NULL, 0); - height = strtol(argv[5], NULL, 0); - if (width < 16 || width % 2 || height < 16 || height % 2) { - die("Invalid resolution: %d x %d", width, height); - } - - layering_mode = strtol(argv[10], NULL, 0); - if (layering_mode < 0 || layering_mode > 12) { - die("Invalid layering mode (0..12) %s", argv[10]); - } - - if (argc != min_args + mode_to_num_layers[layering_mode]) { - die("Invalid number of arguments"); - } - -#if CONFIG_VP9_HIGHBITDEPTH - switch (strtol(argv[argc-1], NULL, 0)) { - case 8: - bit_depth = VPX_BITS_8; - input_bit_depth = 8; - break; - case 10: - bit_depth = VPX_BITS_10; - input_bit_depth = 10; - break; - case 12: - bit_depth = VPX_BITS_12; - input_bit_depth = 12; - break; - default: - die("Invalid bit depth (8, 10, 12) %s", argv[argc-1]); - } - if (!vpx_img_alloc(&raw, - bit_depth == VPX_BITS_8 ? VPX_IMG_FMT_I420 : - VPX_IMG_FMT_I42016, - width, height, 32)) { - die("Failed to allocate image", width, height); - } -#else - if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, width, height, 32)) { - die("Failed to allocate image", width, height); - } -#endif // CONFIG_VP9_HIGHBITDEPTH - - // Populate encoder configuration. - res = vpx_codec_enc_config_default(encoder->codec_interface(), &cfg, 0); - if (res) { - printf("Failed to get config: %s\n", vpx_codec_err_to_string(res)); - return EXIT_FAILURE; - } - - // Update the default configuration with our settings. - cfg.g_w = width; - cfg.g_h = height; - -#if CONFIG_VP9_HIGHBITDEPTH - if (bit_depth != VPX_BITS_8) { - cfg.g_bit_depth = bit_depth; - cfg.g_input_bit_depth = input_bit_depth; - cfg.g_profile = 2; - } -#endif // CONFIG_VP9_HIGHBITDEPTH - - // Timebase format e.g. 30fps: numerator=1, demoninator = 30. - cfg.g_timebase.num = strtol(argv[6], NULL, 0); - cfg.g_timebase.den = strtol(argv[7], NULL, 0); - - speed = strtol(argv[8], NULL, 0); - if (speed < 0) { - die("Invalid speed setting: must be positive"); - } - - for (i = min_args_base; - (int)i < min_args_base + mode_to_num_layers[layering_mode]; - ++i) { - cfg.ts_target_bitrate[i - 11] = strtol(argv[i], NULL, 0); - } - - // Real time parameters. - cfg.rc_dropframe_thresh = strtol(argv[9], NULL, 0); - cfg.rc_end_usage = VPX_CBR; - cfg.rc_resize_allowed = 0; - cfg.rc_min_quantizer = 2; - cfg.rc_max_quantizer = 56; - if (strncmp(encoder->name, "vp9", 3) == 0) - cfg.rc_max_quantizer = 52; - cfg.rc_undershoot_pct = 50; - cfg.rc_overshoot_pct = 50; - cfg.rc_buf_initial_sz = 500; - cfg.rc_buf_optimal_sz = 600; - cfg.rc_buf_sz = 1000; - - // Use 1 thread as default. - cfg.g_threads = 1; - - // Enable error resilient mode. - cfg.g_error_resilient = 1; - cfg.g_lag_in_frames = 0; - cfg.kf_mode = VPX_KF_AUTO; - - // Disable automatic keyframe placement. - cfg.kf_min_dist = cfg.kf_max_dist = 3000; - - set_temporal_layer_pattern(layering_mode, - &cfg, - layer_flags, - &flag_periodicity); - - set_rate_control_metrics(&rc, &cfg); - - // Target bandwidth for the whole stream. - // Set to ts_target_bitrate for highest layer (total bitrate). - cfg.rc_target_bitrate = cfg.ts_target_bitrate[cfg.ts_number_layers - 1]; - - // Open input file. - if (!(infile = fopen(argv[1], "rb"))) { - die("Failed to open %s for reading", argv[1]); - } - - framerate = cfg.g_timebase.den / cfg.g_timebase.num; - // Open an output file for each stream. - for (i = 0; i < cfg.ts_number_layers; ++i) { - char file_name[PATH_MAX]; - VpxVideoInfo info; - info.codec_fourcc = encoder->fourcc; - info.frame_width = cfg.g_w; - info.frame_height = cfg.g_h; - info.time_base.numerator = cfg.g_timebase.num; - info.time_base.denominator = cfg.g_timebase.den; - - snprintf(file_name, sizeof(file_name), "%s_%d.ivf", argv[2], i); - outfile[i] = vpx_video_writer_open(file_name, kContainerIVF, &info); - if (!outfile[i]) - die("Failed to open %s for writing", file_name); - - assert(outfile[i] != NULL); - } - // No spatial layers in this encoder. - cfg.ss_number_layers = 1; - - // Initialize codec. -#if CONFIG_VP9_HIGHBITDEPTH - if (vpx_codec_enc_init( - &codec, encoder->codec_interface(), &cfg, - bit_depth == VPX_BITS_8 ? 0 : VPX_CODEC_USE_HIGHBITDEPTH)) -#else - if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0)) -#endif // CONFIG_VP9_HIGHBITDEPTH - die_codec(&codec, "Failed to initialize encoder"); - - if (strncmp(encoder->name, "vp8", 3) == 0) { - vpx_codec_control(&codec, VP8E_SET_CPUUSED, -speed); - vpx_codec_control(&codec, VP8E_SET_NOISE_SENSITIVITY, kDenoiserOnYOnly); - vpx_codec_control(&codec, VP8E_SET_STATIC_THRESHOLD, 1); - } else if (strncmp(encoder->name, "vp9", 3) == 0) { - vpx_codec_control(&codec, VP8E_SET_CPUUSED, speed); - vpx_codec_control(&codec, VP9E_SET_AQ_MODE, 3); - vpx_codec_control(&codec, VP9E_SET_FRAME_PERIODIC_BOOST, 0); - vpx_codec_control(&codec, VP9E_SET_NOISE_SENSITIVITY, 0); - vpx_codec_control(&codec, VP8E_SET_STATIC_THRESHOLD, 1); - vpx_codec_control(&codec, VP9E_SET_TILE_COLUMNS, (cfg.g_threads >> 1)); - if (vpx_codec_control(&codec, VP9E_SET_SVC, layering_mode > 0 ? 1: 0)) { - die_codec(&codec, "Failed to set SVC"); - } - } - if (strncmp(encoder->name, "vp8", 3) == 0) { - vpx_codec_control(&codec, VP8E_SET_SCREEN_CONTENT_MODE, 0); - } - vpx_codec_control(&codec, VP8E_SET_TOKEN_PARTITIONS, 1); - // This controls the maximum target size of the key frame. - // For generating smaller key frames, use a smaller max_intra_size_pct - // value, like 100 or 200. - { - const int max_intra_size_pct = 900; - vpx_codec_control(&codec, VP8E_SET_MAX_INTRA_BITRATE_PCT, - max_intra_size_pct); - } - - frame_avail = 1; - while (frame_avail || got_data) { - struct vpx_usec_timer timer; - vpx_codec_iter_t iter = NULL; - const vpx_codec_cx_pkt_t *pkt; -#if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION) - // Update the temporal layer_id. No spatial layers in this test. - layer_id.spatial_layer_id = 0; -#endif - layer_id.temporal_layer_id = - cfg.ts_layer_id[frame_cnt % cfg.ts_periodicity]; - if (strncmp(encoder->name, "vp9", 3) == 0) { - vpx_codec_control(&codec, VP9E_SET_SVC_LAYER_ID, &layer_id); - } else if (strncmp(encoder->name, "vp8", 3) == 0) { - vpx_codec_control(&codec, VP8E_SET_TEMPORAL_LAYER_ID, - layer_id.temporal_layer_id); - } - flags = layer_flags[frame_cnt % flag_periodicity]; - if (layering_mode == 0) - flags = 0; - frame_avail = vpx_img_read(&raw, infile); - if (frame_avail) - ++rc.layer_input_frames[layer_id.temporal_layer_id]; - vpx_usec_timer_start(&timer); - if (vpx_codec_encode(&codec, frame_avail? &raw : NULL, pts, 1, flags, - VPX_DL_REALTIME)) { - die_codec(&codec, "Failed to encode frame"); - } - vpx_usec_timer_mark(&timer); - cx_time += vpx_usec_timer_elapsed(&timer); - // Reset KF flag. - if (layering_mode != 7) { - layer_flags[0] &= ~VPX_EFLAG_FORCE_KF; - } - got_data = 0; - while ( (pkt = vpx_codec_get_cx_data(&codec, &iter)) ) { - got_data = 1; - switch (pkt->kind) { - case VPX_CODEC_CX_FRAME_PKT: - for (i = cfg.ts_layer_id[frame_cnt % cfg.ts_periodicity]; - i < cfg.ts_number_layers; ++i) { - vpx_video_writer_write_frame(outfile[i], pkt->data.frame.buf, - pkt->data.frame.sz, pts); - ++rc.layer_tot_enc_frames[i]; - rc.layer_encoding_bitrate[i] += 8.0 * pkt->data.frame.sz; - // Keep count of rate control stats per layer (for non-key frames). - if (i == cfg.ts_layer_id[frame_cnt % cfg.ts_periodicity] && - !(pkt->data.frame.flags & VPX_FRAME_IS_KEY)) { - rc.layer_avg_frame_size[i] += 8.0 * pkt->data.frame.sz; - rc.layer_avg_rate_mismatch[i] += - fabs(8.0 * pkt->data.frame.sz - rc.layer_pfb[i]) / - rc.layer_pfb[i]; - ++rc.layer_enc_frames[i]; - } - } - // Update for short-time encoding bitrate states, for moving window - // of size rc->window, shifted by rc->window / 2. - // Ignore first window segment, due to key frame. - if (frame_cnt > rc.window_size) { - sum_bitrate += 0.001 * 8.0 * pkt->data.frame.sz * framerate; - if (frame_cnt % rc.window_size == 0) { - rc.window_count += 1; - rc.avg_st_encoding_bitrate += sum_bitrate / rc.window_size; - rc.variance_st_encoding_bitrate += - (sum_bitrate / rc.window_size) * - (sum_bitrate / rc.window_size); - sum_bitrate = 0.0; - } - } - // Second shifted window. - if (frame_cnt > rc.window_size + rc.window_size / 2) { - sum_bitrate2 += 0.001 * 8.0 * pkt->data.frame.sz * framerate; - if (frame_cnt > 2 * rc.window_size && - frame_cnt % rc.window_size == 0) { - rc.window_count += 1; - rc.avg_st_encoding_bitrate += sum_bitrate2 / rc.window_size; - rc.variance_st_encoding_bitrate += - (sum_bitrate2 / rc.window_size) * - (sum_bitrate2 / rc.window_size); - sum_bitrate2 = 0.0; - } - } - break; - default: - break; - } - } - ++frame_cnt; - pts += frame_duration; - } - fclose(infile); - printout_rate_control_summary(&rc, &cfg, frame_cnt); - printf("\n"); - printf("Frame cnt and encoding time/FPS stats for encoding: %d %f %f \n", - frame_cnt, - 1000 * (float)cx_time / (double)(frame_cnt * 1000000), - 1000000 * (double)frame_cnt / (double)cx_time); - - if (vpx_codec_destroy(&codec)) - die_codec(&codec, "Failed to destroy codec"); - - // Try to rewrite the output file headers with the actual frame count. - for (i = 0; i < cfg.ts_number_layers; ++i) - vpx_video_writer_close(outfile[i]); - - vpx_img_free(&raw); - return EXIT_SUCCESS; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples.mk gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples.mk --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/examples.mk 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/examples.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,368 +0,0 @@ -## -## Copyright (c) 2010 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - -LIBYUV_SRCS += third_party/libyuv/include/libyuv/basic_types.h \ - third_party/libyuv/include/libyuv/convert.h \ - third_party/libyuv/include/libyuv/convert_argb.h \ - third_party/libyuv/include/libyuv/convert_from.h \ - third_party/libyuv/include/libyuv/cpu_id.h \ - third_party/libyuv/include/libyuv/planar_functions.h \ - third_party/libyuv/include/libyuv/rotate.h \ - third_party/libyuv/include/libyuv/row.h \ - third_party/libyuv/include/libyuv/scale.h \ - third_party/libyuv/include/libyuv/scale_row.h \ - third_party/libyuv/source/cpu_id.cc \ - third_party/libyuv/source/planar_functions.cc \ - third_party/libyuv/source/row_any.cc \ - third_party/libyuv/source/row_common.cc \ - third_party/libyuv/source/row_mips.cc \ - third_party/libyuv/source/row_neon.cc \ - third_party/libyuv/source/row_neon64.cc \ - third_party/libyuv/source/row_posix.cc \ - third_party/libyuv/source/row_win.cc \ - third_party/libyuv/source/scale.cc \ - third_party/libyuv/source/scale_common.cc \ - third_party/libyuv/source/scale_mips.cc \ - third_party/libyuv/source/scale_neon.cc \ - third_party/libyuv/source/scale_neon64.cc \ - third_party/libyuv/source/scale_posix.cc \ - third_party/libyuv/source/scale_win.cc \ - -LIBWEBM_MUXER_SRCS += third_party/libwebm/mkvmuxer.cpp \ - third_party/libwebm/mkvmuxerutil.cpp \ - third_party/libwebm/mkvwriter.cpp \ - third_party/libwebm/mkvmuxer.hpp \ - third_party/libwebm/mkvmuxertypes.hpp \ - third_party/libwebm/mkvmuxerutil.hpp \ - third_party/libwebm/mkvparser.hpp \ - third_party/libwebm/mkvwriter.hpp \ - third_party/libwebm/webmids.hpp - -LIBWEBM_PARSER_SRCS = third_party/libwebm/mkvparser.cpp \ - third_party/libwebm/mkvreader.cpp \ - third_party/libwebm/mkvparser.hpp \ - third_party/libwebm/mkvreader.hpp - -# List of examples to build. UTILS are tools meant for distribution -# while EXAMPLES demonstrate specific portions of the API. -UTILS-$(CONFIG_DECODERS) += vpxdec.c -vpxdec.SRCS += md5_utils.c md5_utils.h -vpxdec.SRCS += vpx_ports/mem_ops.h -vpxdec.SRCS += vpx_ports/mem_ops_aligned.h -vpxdec.SRCS += vpx_ports/vpx_timer.h -vpxdec.SRCS += vpx/vpx_integer.h -vpxdec.SRCS += args.c args.h -vpxdec.SRCS += ivfdec.c ivfdec.h -vpxdec.SRCS += tools_common.c tools_common.h -vpxdec.SRCS += y4menc.c y4menc.h -ifeq ($(CONFIG_LIBYUV),yes) - vpxdec.SRCS += $(LIBYUV_SRCS) -endif -ifeq ($(CONFIG_WEBM_IO),yes) - vpxdec.SRCS += $(LIBWEBM_PARSER_SRCS) - vpxdec.SRCS += webmdec.cc webmdec.h -endif -vpxdec.GUID = BA5FE66F-38DD-E034-F542-B1578C5FB950 -vpxdec.DESCRIPTION = Full featured decoder -UTILS-$(CONFIG_ENCODERS) += vpxenc.c -vpxenc.SRCS += args.c args.h y4minput.c y4minput.h vpxenc.h -vpxenc.SRCS += ivfdec.c ivfdec.h -vpxenc.SRCS += ivfenc.c ivfenc.h -vpxenc.SRCS += rate_hist.c rate_hist.h -vpxenc.SRCS += tools_common.c tools_common.h -vpxenc.SRCS += warnings.c warnings.h -vpxenc.SRCS += vpx_ports/mem_ops.h -vpxenc.SRCS += vpx_ports/mem_ops_aligned.h -vpxenc.SRCS += vpx_ports/vpx_timer.h -vpxenc.SRCS += vpxstats.c vpxstats.h -ifeq ($(CONFIG_LIBYUV),yes) - vpxenc.SRCS += $(LIBYUV_SRCS) -endif -ifeq ($(CONFIG_WEBM_IO),yes) - vpxenc.SRCS += $(LIBWEBM_MUXER_SRCS) - vpxenc.SRCS += webmenc.cc webmenc.h -endif -vpxenc.GUID = 548DEC74-7A15-4B2B-AFC3-AA102E7C25C1 -vpxenc.DESCRIPTION = Full featured encoder -ifeq ($(CONFIG_SPATIAL_SVC),yes) - EXAMPLES-$(CONFIG_VP9_ENCODER) += vp9_spatial_svc_encoder.c - vp9_spatial_svc_encoder.SRCS += args.c args.h - vp9_spatial_svc_encoder.SRCS += ivfenc.c ivfenc.h - vp9_spatial_svc_encoder.SRCS += tools_common.c tools_common.h - vp9_spatial_svc_encoder.SRCS += video_common.h - vp9_spatial_svc_encoder.SRCS += video_writer.h video_writer.c - vp9_spatial_svc_encoder.SRCS += vpxstats.c vpxstats.h - vp9_spatial_svc_encoder.GUID = 4A38598D-627D-4505-9C7B-D4020C84100D - vp9_spatial_svc_encoder.DESCRIPTION = VP9 Spatial SVC Encoder -endif - -ifneq ($(CONFIG_SHARED),yes) -EXAMPLES-$(CONFIG_VP9_ENCODER) += resize_util.c -endif - -EXAMPLES-$(CONFIG_ENCODERS) += vpx_temporal_svc_encoder.c -vpx_temporal_svc_encoder.SRCS += ivfenc.c ivfenc.h -vpx_temporal_svc_encoder.SRCS += tools_common.c tools_common.h -vpx_temporal_svc_encoder.SRCS += video_common.h -vpx_temporal_svc_encoder.SRCS += video_writer.h video_writer.c -vpx_temporal_svc_encoder.GUID = B18C08F2-A439-4502-A78E-849BE3D60947 -vpx_temporal_svc_encoder.DESCRIPTION = Temporal SVC Encoder -EXAMPLES-$(CONFIG_DECODERS) += simple_decoder.c -simple_decoder.GUID = D3BBF1E9-2427-450D-BBFF-B2843C1D44CC -simple_decoder.SRCS += ivfdec.h ivfdec.c -simple_decoder.SRCS += tools_common.h tools_common.c -simple_decoder.SRCS += video_common.h -simple_decoder.SRCS += video_reader.h video_reader.c -simple_decoder.SRCS += vpx_ports/mem_ops.h -simple_decoder.SRCS += vpx_ports/mem_ops_aligned.h -simple_decoder.DESCRIPTION = Simplified decoder loop -EXAMPLES-$(CONFIG_DECODERS) += postproc.c -postproc.SRCS += ivfdec.h ivfdec.c -postproc.SRCS += tools_common.h tools_common.c -postproc.SRCS += video_common.h -postproc.SRCS += video_reader.h video_reader.c -postproc.SRCS += vpx_ports/mem_ops.h -postproc.SRCS += vpx_ports/mem_ops_aligned.h -postproc.GUID = 65E33355-F35E-4088-884D-3FD4905881D7 -postproc.DESCRIPTION = Decoder postprocessor control -EXAMPLES-$(CONFIG_DECODERS) += decode_to_md5.c -decode_to_md5.SRCS += md5_utils.h md5_utils.c -decode_to_md5.SRCS += ivfdec.h ivfdec.c -decode_to_md5.SRCS += tools_common.h tools_common.c -decode_to_md5.SRCS += video_common.h -decode_to_md5.SRCS += video_reader.h video_reader.c -decode_to_md5.SRCS += vpx_ports/mem_ops.h -decode_to_md5.SRCS += vpx_ports/mem_ops_aligned.h -decode_to_md5.GUID = 59120B9B-2735-4BFE-B022-146CA340FE42 -decode_to_md5.DESCRIPTION = Frame by frame MD5 checksum -EXAMPLES-$(CONFIG_ENCODERS) += simple_encoder.c -simple_encoder.SRCS += ivfenc.h ivfenc.c -simple_encoder.SRCS += tools_common.h tools_common.c -simple_encoder.SRCS += video_common.h -simple_encoder.SRCS += video_writer.h video_writer.c -simple_encoder.GUID = 4607D299-8A71-4D2C-9B1D-071899B6FBFD -simple_encoder.DESCRIPTION = Simplified encoder loop -EXAMPLES-$(CONFIG_VP9_ENCODER) += vp9_lossless_encoder.c -vp9_lossless_encoder.SRCS += ivfenc.h ivfenc.c -vp9_lossless_encoder.SRCS += tools_common.h tools_common.c -vp9_lossless_encoder.SRCS += video_common.h -vp9_lossless_encoder.SRCS += video_writer.h video_writer.c -vp9_lossless_encoder.GUID = B63C7C88-5348-46DC-A5A6-CC151EF93366 -vp9_lossless_encoder.DESCRIPTION = Simplified lossless VP9 encoder -EXAMPLES-$(CONFIG_ENCODERS) += twopass_encoder.c -twopass_encoder.SRCS += ivfenc.h ivfenc.c -twopass_encoder.SRCS += tools_common.h tools_common.c -twopass_encoder.SRCS += video_common.h -twopass_encoder.SRCS += video_writer.h video_writer.c -twopass_encoder.GUID = 73494FA6-4AF9-4763-8FBB-265C92402FD8 -twopass_encoder.DESCRIPTION = Two-pass encoder loop -EXAMPLES-$(CONFIG_DECODERS) += decode_with_drops.c -decode_with_drops.SRCS += ivfdec.h ivfdec.c -decode_with_drops.SRCS += tools_common.h tools_common.c -decode_with_drops.SRCS += video_common.h -decode_with_drops.SRCS += video_reader.h video_reader.c -decode_with_drops.SRCS += vpx_ports/mem_ops.h -decode_with_drops.SRCS += vpx_ports/mem_ops_aligned.h -decode_with_drops.GUID = CE5C53C4-8DDA-438A-86ED-0DDD3CDB8D26 -decode_with_drops.DESCRIPTION = Drops frames while decoding -EXAMPLES-$(CONFIG_ENCODERS) += set_maps.c -set_maps.SRCS += ivfenc.h ivfenc.c -set_maps.SRCS += tools_common.h tools_common.c -set_maps.SRCS += video_common.h -set_maps.SRCS += video_writer.h video_writer.c -set_maps.GUID = ECB2D24D-98B8-4015-A465-A4AF3DCC145F -set_maps.DESCRIPTION = Set active and ROI maps -EXAMPLES-$(CONFIG_VP8_ENCODER) += vp8cx_set_ref.c -vp8cx_set_ref.SRCS += ivfenc.h ivfenc.c -vp8cx_set_ref.SRCS += tools_common.h tools_common.c -vp8cx_set_ref.SRCS += video_common.h -vp8cx_set_ref.SRCS += video_writer.h video_writer.c -vp8cx_set_ref.GUID = C5E31F7F-96F6-48BD-BD3E-10EBF6E8057A -vp8cx_set_ref.DESCRIPTION = VP8 set encoder reference frame - - -ifeq ($(CONFIG_MULTI_RES_ENCODING),yes) -ifeq ($(CONFIG_LIBYUV),yes) -EXAMPLES-$(CONFIG_VP8_ENCODER) += vp8_multi_resolution_encoder.c -vp8_multi_resolution_encoder.SRCS += ivfenc.h ivfenc.c -vp8_multi_resolution_encoder.SRCS += tools_common.h tools_common.c -vp8_multi_resolution_encoder.SRCS += video_writer.h video_writer.c -vp8_multi_resolution_encoder.SRCS += $(LIBYUV_SRCS) -vp8_multi_resolution_encoder.GUID = 04f8738e-63c8-423b-90fa-7c2703a374de -vp8_multi_resolution_encoder.DESCRIPTION = VP8 Multiple-resolution Encoding -endif -endif - -# Handle extra library flags depending on codec configuration - -# We should not link to math library (libm) on RVCT -# when building for bare-metal targets -ifeq ($(CONFIG_OS_SUPPORT), yes) -CODEC_EXTRA_LIBS-$(CONFIG_VP8) += m -CODEC_EXTRA_LIBS-$(CONFIG_VP9) += m -else - ifeq ($(CONFIG_GCC), yes) - CODEC_EXTRA_LIBS-$(CONFIG_VP8) += m - CODEC_EXTRA_LIBS-$(CONFIG_VP9) += m - endif -endif -# -# End of specified files. The rest of the build rules should happen -# automagically from here. -# - - -# Examples need different flags based on whether we're building -# from an installed tree or a version controlled tree. Determine -# the proper paths. -ifeq ($(HAVE_ALT_TREE_LAYOUT),yes) - LIB_PATH-yes := $(SRC_PATH_BARE)/../lib - INC_PATH-yes := $(SRC_PATH_BARE)/../include -else - LIB_PATH-yes += $(if $(BUILD_PFX),$(BUILD_PFX),.) - INC_PATH-$(CONFIG_VP8_DECODER) += $(SRC_PATH_BARE)/vp8 - INC_PATH-$(CONFIG_VP8_ENCODER) += $(SRC_PATH_BARE)/vp8 - INC_PATH-$(CONFIG_VP9_DECODER) += $(SRC_PATH_BARE)/vp9 - INC_PATH-$(CONFIG_VP9_ENCODER) += $(SRC_PATH_BARE)/vp9 -endif -INC_PATH-$(CONFIG_LIBYUV) += $(SRC_PATH_BARE)/third_party/libyuv/include -LIB_PATH := $(call enabled,LIB_PATH) -INC_PATH := $(call enabled,INC_PATH) -INTERNAL_CFLAGS = $(addprefix -I,$(INC_PATH)) -INTERNAL_LDFLAGS += $(addprefix -L,$(LIB_PATH)) - - -# Expand list of selected examples to build (as specified above) -UTILS = $(call enabled,UTILS) -EXAMPLES = $(addprefix examples/,$(call enabled,EXAMPLES)) -ALL_EXAMPLES = $(UTILS) $(EXAMPLES) -UTIL_SRCS = $(foreach ex,$(UTILS),$($(ex:.c=).SRCS)) -ALL_SRCS = $(foreach ex,$(ALL_EXAMPLES),$($(notdir $(ex:.c=)).SRCS)) -CODEC_EXTRA_LIBS=$(sort $(call enabled,CODEC_EXTRA_LIBS)) - - -# Expand all example sources into a variable containing all sources -# for that example (not just them main one specified in UTILS/EXAMPLES) -# and add this file to the list (for MSVS workspace generation) -$(foreach ex,$(ALL_EXAMPLES),$(eval $(notdir $(ex:.c=)).SRCS += $(ex) examples.mk)) - - -# If this is a universal (fat) binary, then all the subarchitectures have -# already been built and our job is to stitch them together. The -# BUILD_OBJS variable indicates whether we should be building -# (compiling, linking) the library. The LIPO_OBJS variable indicates -# that we're stitching. -$(eval $(if $(filter universal%,$(TOOLCHAIN)),LIPO_OBJS,BUILD_OBJS):=yes) - - -# Create build/install dependencies for all examples. The common case -# is handled here. The MSVS case is handled below. -NOT_MSVS = $(if $(CONFIG_MSVS),,yes) -DIST-BINS-$(NOT_MSVS) += $(addprefix bin/,$(ALL_EXAMPLES:.c=$(EXE_SFX))) -INSTALL-BINS-$(NOT_MSVS) += $(addprefix bin/,$(UTILS:.c=$(EXE_SFX))) -DIST-SRCS-yes += $(ALL_SRCS) -INSTALL-SRCS-yes += $(UTIL_SRCS) -OBJS-$(NOT_MSVS) += $(if $(BUILD_OBJS),$(call objs,$(ALL_SRCS))) -BINS-$(NOT_MSVS) += $(addprefix $(BUILD_PFX),$(ALL_EXAMPLES:.c=$(EXE_SFX))) - - -# Instantiate linker template for all examples. -CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx) -SHARED_LIB_SUF=$(if $(filter darwin%,$(TGT_OS)),.dylib,.so) -CODEC_LIB_SUF=$(if $(CONFIG_SHARED),$(SHARED_LIB_SUF),.a) -$(foreach bin,$(BINS-yes),\ - $(if $(BUILD_OBJS),$(eval $(bin):\ - $(LIB_PATH)/lib$(CODEC_LIB)$(CODEC_LIB_SUF)))\ - $(if $(BUILD_OBJS),$(eval $(call linker_template,$(bin),\ - $(call objs,$($(notdir $(bin:$(EXE_SFX)=)).SRCS)) \ - -l$(CODEC_LIB) $(addprefix -l,$(CODEC_EXTRA_LIBS))\ - )))\ - $(if $(LIPO_OBJS),$(eval $(call lipo_bin_template,$(bin))))\ - ) - - -# The following pairs define a mapping of locations in the distribution -# tree to locations in the source/build trees. -INSTALL_MAPS += src/%.c %.c -INSTALL_MAPS += src/% $(SRC_PATH_BARE)/% -INSTALL_MAPS += bin/% % -INSTALL_MAPS += % % - - -# Set up additional MSVS environment -ifeq ($(CONFIG_MSVS),yes) -CODEC_LIB=$(if $(CONFIG_SHARED),vpx,$(if $(CONFIG_STATIC_MSVCRT),vpxmt,vpxmd)) -# This variable uses deferred expansion intentionally, since the results of -# $(wildcard) may change during the course of the Make. -VS_PLATFORMS = $(foreach d,$(wildcard */Release/$(CODEC_LIB).lib),$(word 1,$(subst /, ,$(d)))) -INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),bin/$(p)/% $(p)/Release/%) -endif - -# Build Visual Studio Projects. We use a template here to instantiate -# explicit rules rather than using an implicit rule because we want to -# leverage make's VPATH searching rather than specifying the paths on -# each file in ALL_EXAMPLES. This has the unfortunate side effect that -# touching the source files trigger a rebuild of the project files -# even though there is no real dependency there (the dependency is on -# the makefiles). We may want to revisit this. -define vcproj_template -$(1): $($(1:.$(VCPROJ_SFX)=).SRCS) vpx.$(VCPROJ_SFX) - @echo " [vcproj] $$@" - $$(GEN_VCPROJ)\ - --exe\ - --target=$$(TOOLCHAIN)\ - --name=$$(@:.$(VCPROJ_SFX)=)\ - --ver=$$(CONFIG_VS_VERSION)\ - --proj-guid=$$($$(@:.$(VCPROJ_SFX)=).GUID)\ - --src-path-bare="$(SRC_PATH_BARE)" \ - $$(if $$(CONFIG_STATIC_MSVCRT),--static-crt) \ - --out=$$@ $$(INTERNAL_CFLAGS) $$(CFLAGS) \ - $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -l$$(CODEC_LIB) $$^ -endef -ALL_EXAMPLES_BASENAME := $(notdir $(ALL_EXAMPLES)) -PROJECTS-$(CONFIG_MSVS) += $(ALL_EXAMPLES_BASENAME:.c=.$(VCPROJ_SFX)) -INSTALL-BINS-$(CONFIG_MSVS) += $(foreach p,$(VS_PLATFORMS),\ - $(addprefix bin/$(p)/,$(ALL_EXAMPLES_BASENAME:.c=.exe))) -$(foreach proj,$(call enabled,PROJECTS),\ - $(eval $(call vcproj_template,$(proj)))) - -# -# Documentation Rules -# -%.dox: %.c - @echo " [DOXY] $@" - @mkdir -p $(dir $@) - @echo "/*!\page example_$(@F:.dox=) $(@F:.dox=)" > $@ - @echo " \includelineno $(> $@ - @echo "*/" >> $@ - -samples.dox: examples.mk - @echo " [DOXY] $@" - @echo "/*!\page samples Sample Code" > $@ - @echo " This SDK includes a number of sample applications."\ - "Each sample documents a feature of the SDK in both prose"\ - "and the associated C code."\ - "The following samples are included: ">>$@ - @$(foreach ex,$(sort $(notdir $(EXAMPLES:.c=))),\ - echo " - \subpage example_$(ex) $($(ex).DESCRIPTION)" >> $@;) - @echo >> $@ - @echo " In addition, the SDK contains a number of utilities."\ - "Since these utilities are built upon the concepts described"\ - "in the sample code listed above, they are not documented in"\ - "pieces like the samples are. Their source is included here"\ - "for reference. The following utilities are included:" >> $@ - @$(foreach ex,$(sort $(UTILS:.c=)),\ - echo " - \subpage example_$(ex) $($(ex).DESCRIPTION)" >> $@;) - @echo "*/" >> $@ - -CLEAN-OBJS += examples.doxy samples.dox $(ALL_EXAMPLES:.c=.dox) -DOCS-yes += examples.doxy samples.dox -examples.doxy: samples.dox $(ALL_EXAMPLES:.c=.dox) - @echo "INPUT += $^" > $@ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/ivfdec.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/ivfdec.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/ivfdec.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/ivfdec.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include - -#include "vpx_ports/mem_ops.h" - -#include "./ivfdec.h" - -static const char *IVF_SIGNATURE = "DKIF"; - -static void fix_framerate(int *num, int *den) { - // Some versions of vpxenc used 1/(2*fps) for the timebase, so - // we can guess the framerate using only the timebase in this - // case. Other files would require reading ahead to guess the - // timebase, like we do for webm. - if (*num < 1000) { - // Correct for the factor of 2 applied to the timebase in the encoder. - if (*num & 1) - *den *= 2; - else - *num /= 2; - } else { - // Don't know FPS for sure, and don't have readahead code - // (yet?), so just default to 30fps. - *num = 30; - *den = 1; - } -} - -int file_is_ivf(struct VpxInputContext *input_ctx) { - char raw_hdr[32]; - int is_ivf = 0; - - if (fread(raw_hdr, 1, 32, input_ctx->file) == 32) { - if (memcmp(IVF_SIGNATURE, raw_hdr, 4) == 0) { - is_ivf = 1; - - if (mem_get_le16(raw_hdr + 4) != 0) { - fprintf(stderr, "Error: Unrecognized IVF version! This file may not" - " decode properly."); - } - - input_ctx->fourcc = mem_get_le32(raw_hdr + 8); - input_ctx->width = mem_get_le16(raw_hdr + 12); - input_ctx->height = mem_get_le16(raw_hdr + 14); - input_ctx->framerate.numerator = mem_get_le32(raw_hdr + 16); - input_ctx->framerate.denominator = mem_get_le32(raw_hdr + 20); - fix_framerate(&input_ctx->framerate.numerator, - &input_ctx->framerate.denominator); - } - } - - if (!is_ivf) { - rewind(input_ctx->file); - input_ctx->detect.buf_read = 0; - } else { - input_ctx->detect.position = 4; - } - return is_ivf; -} - -int ivf_read_frame(FILE *infile, uint8_t **buffer, - size_t *bytes_read, size_t *buffer_size) { - char raw_header[IVF_FRAME_HDR_SZ] = {0}; - size_t frame_size = 0; - - if (fread(raw_header, IVF_FRAME_HDR_SZ, 1, infile) != 1) { - if (!feof(infile)) - warn("Failed to read frame size\n"); - } else { - frame_size = mem_get_le32(raw_header); - - if (frame_size > 256 * 1024 * 1024) { - warn("Read invalid frame size (%u)\n", (unsigned int)frame_size); - frame_size = 0; - } - - if (frame_size > *buffer_size) { - uint8_t *new_buffer = realloc(*buffer, 2 * frame_size); - - if (new_buffer) { - *buffer = new_buffer; - *buffer_size = 2 * frame_size; - } else { - warn("Failed to allocate compressed data buffer\n"); - frame_size = 0; - } - } - } - - if (!feof(infile)) { - if (fread(*buffer, 1, frame_size, infile) != frame_size) { - warn("Failed to read full frame\n"); - return 1; - } - - *bytes_read = frame_size; - return 0; - } - - return 1; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/ivfdec.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/ivfdec.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/ivfdec.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/ivfdec.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef IVFDEC_H_ -#define IVFDEC_H_ - -#include "./tools_common.h" - -#ifdef __cplusplus -extern "C" { -#endif - -int file_is_ivf(struct VpxInputContext *input); - -int ivf_read_frame(FILE *infile, uint8_t **buffer, - size_t *bytes_read, size_t *buffer_size); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif // IVFDEC_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/ivfenc.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/ivfenc.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/ivfenc.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/ivfenc.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "./ivfenc.h" - -#include "vpx/vpx_encoder.h" -#include "vpx_ports/mem_ops.h" - -void ivf_write_file_header(FILE *outfile, - const struct vpx_codec_enc_cfg *cfg, - unsigned int fourcc, - int frame_cnt) { - char header[32]; - - header[0] = 'D'; - header[1] = 'K'; - header[2] = 'I'; - header[3] = 'F'; - mem_put_le16(header + 4, 0); // version - mem_put_le16(header + 6, 32); // header size - mem_put_le32(header + 8, fourcc); // fourcc - mem_put_le16(header + 12, cfg->g_w); // width - mem_put_le16(header + 14, cfg->g_h); // height - mem_put_le32(header + 16, cfg->g_timebase.den); // rate - mem_put_le32(header + 20, cfg->g_timebase.num); // scale - mem_put_le32(header + 24, frame_cnt); // length - mem_put_le32(header + 28, 0); // unused - - fwrite(header, 1, 32, outfile); -} - -void ivf_write_frame_header(FILE *outfile, int64_t pts, size_t frame_size) { - char header[12]; - - mem_put_le32(header, (int)frame_size); - mem_put_le32(header + 4, (int)(pts & 0xFFFFFFFF)); - mem_put_le32(header + 8, (int)(pts >> 32)); - fwrite(header, 1, 12, outfile); -} - -void ivf_write_frame_size(FILE *outfile, size_t frame_size) { - char header[4]; - - mem_put_le32(header, (int)frame_size); - fwrite(header, 1, 4, outfile); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/ivfenc.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/ivfenc.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/ivfenc.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/ivfenc.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef IVFENC_H_ -#define IVFENC_H_ - -#include "./tools_common.h" - -struct vpx_codec_enc_cfg; -struct vpx_codec_cx_pkt; - -#ifdef __cplusplus -extern "C" { -#endif - -void ivf_write_file_header(FILE *outfile, - const struct vpx_codec_enc_cfg *cfg, - uint32_t fourcc, - int frame_cnt); - -void ivf_write_frame_header(FILE *outfile, int64_t pts, size_t frame_size); - -void ivf_write_frame_size(FILE *outfile, size_t frame_size); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif // IVFENC_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/libs.mk gstreamer-vaapi-1.8.2/ext/libvpx/upstream/libs.mk --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/libs.mk 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/libs.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,549 +0,0 @@ -## -## Copyright (c) 2010 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - - -# ARM assembly files are written in RVCT-style. We use some make magic to -# filter those files to allow GCC compilation -ifeq ($(ARCH_ARM),yes) - ASM:=$(if $(filter yes,$(CONFIG_GCC)$(CONFIG_MSVS)),.asm.s,.asm) -else - ASM:=.asm -endif - -# -# Rule to generate runtime cpu detection files -# -define rtcd_h_template -$$(BUILD_PFX)$(1).h: $$(SRC_PATH_BARE)/$(2) - @echo " [CREATE] $$@" - $$(qexec)$$(SRC_PATH_BARE)/build/make/rtcd.pl --arch=$$(TGT_ISA) \ - --sym=$(1) \ - --config=$$(CONFIG_DIR)$$(target)$$(if $$(FAT_ARCHS),,-$$(TOOLCHAIN)).mk \ - $$(RTCD_OPTIONS) $$^ > $$@ -CLEAN-OBJS += $$(BUILD_PFX)$(1).h -RTCD += $$(BUILD_PFX)$(1).h -endef - -CODEC_SRCS-yes += CHANGELOG -CODEC_SRCS-yes += libs.mk - -# If this is a universal (fat) binary, then all the subarchitectures have -# already been built and our job is to stitch them together. The -# BUILD_LIBVPX variable indicates whether we should be building -# (compiling, linking) the library. The LIPO_LIBVPX variable indicates -# that we're stitching. -$(eval $(if $(filter universal%,$(TOOLCHAIN)),LIPO_LIBVPX,BUILD_LIBVPX):=yes) - -include $(SRC_PATH_BARE)/vpx/vpx_codec.mk -CODEC_SRCS-yes += $(addprefix vpx/,$(call enabled,API_SRCS)) -CODEC_DOC_SRCS += $(addprefix vpx/,$(call enabled,API_DOC_SRCS)) - -include $(SRC_PATH_BARE)/vpx_mem/vpx_mem.mk -CODEC_SRCS-yes += $(addprefix vpx_mem/,$(call enabled,MEM_SRCS)) - -include $(SRC_PATH_BARE)/vpx_scale/vpx_scale.mk -CODEC_SRCS-yes += $(addprefix vpx_scale/,$(call enabled,SCALE_SRCS)) - -include $(SRC_PATH_BARE)/vpx_ports/vpx_ports.mk -CODEC_SRCS-yes += $(addprefix vpx_ports/,$(call enabled,PORTS_SRCS)) - -ifneq ($(CONFIG_VP8_ENCODER)$(CONFIG_VP8_DECODER),) - VP8_PREFIX=vp8/ - include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8_common.mk -endif - -ifeq ($(CONFIG_VP8_ENCODER),yes) - include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8cx.mk - CODEC_SRCS-yes += $(addprefix $(VP8_PREFIX),$(call enabled,VP8_CX_SRCS)) - CODEC_EXPORTS-yes += $(addprefix $(VP8_PREFIX),$(VP8_CX_EXPORTS)) - INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8cx.h - INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP8_PREFIX)/% - CODEC_DOC_SECTIONS += vp8 vp8_encoder -endif - -ifeq ($(CONFIG_VP8_DECODER),yes) - include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8dx.mk - CODEC_SRCS-yes += $(addprefix $(VP8_PREFIX),$(call enabled,VP8_DX_SRCS)) - CODEC_EXPORTS-yes += $(addprefix $(VP8_PREFIX),$(VP8_DX_EXPORTS)) - INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8dx.h - INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP8_PREFIX)/% - CODEC_DOC_SECTIONS += vp8 vp8_decoder -endif - -ifneq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_DECODER),) - VP9_PREFIX=vp9/ - include $(SRC_PATH_BARE)/$(VP9_PREFIX)vp9_common.mk -endif - -ifeq ($(CONFIG_VP9_ENCODER),yes) - VP9_PREFIX=vp9/ - include $(SRC_PATH_BARE)/$(VP9_PREFIX)vp9cx.mk - CODEC_SRCS-yes += $(addprefix $(VP9_PREFIX),$(call enabled,VP9_CX_SRCS)) - CODEC_EXPORTS-yes += $(addprefix $(VP9_PREFIX),$(VP9_CX_EXPORTS)) - CODEC_SRCS-yes += $(VP9_PREFIX)vp9cx.mk vpx/vp8.h vpx/vp8cx.h - INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8cx.h - INSTALL-LIBS-$(CONFIG_SPATIAL_SVC) += include/vpx/svc_context.h - INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP9_PREFIX)/% - CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8cx.h - CODEC_DOC_SECTIONS += vp9 vp9_encoder -endif - -ifeq ($(CONFIG_VP9_DECODER),yes) - VP9_PREFIX=vp9/ - include $(SRC_PATH_BARE)/$(VP9_PREFIX)vp9dx.mk - CODEC_SRCS-yes += $(addprefix $(VP9_PREFIX),$(call enabled,VP9_DX_SRCS)) - CODEC_EXPORTS-yes += $(addprefix $(VP9_PREFIX),$(VP9_DX_EXPORTS)) - CODEC_SRCS-yes += $(VP9_PREFIX)vp9dx.mk vpx/vp8.h vpx/vp8dx.h - INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8dx.h - INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP9_PREFIX)/% - CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8dx.h - CODEC_DOC_SECTIONS += vp9 vp9_decoder -endif - -VP9_PREFIX=vp9/ -$(BUILD_PFX)$(VP9_PREFIX)%.c.o: CFLAGS += -Wextra - -ifeq ($(CONFIG_ENCODERS),yes) - CODEC_DOC_SECTIONS += encoder -endif -ifeq ($(CONFIG_DECODERS),yes) - CODEC_DOC_SECTIONS += decoder -endif - - -ifeq ($(CONFIG_MSVS),yes) -CODEC_LIB=$(if $(CONFIG_STATIC_MSVCRT),vpxmt,vpxmd) -GTEST_LIB=$(if $(CONFIG_STATIC_MSVCRT),gtestmt,gtestmd) -# This variable uses deferred expansion intentionally, since the results of -# $(wildcard) may change during the course of the Make. -VS_PLATFORMS = $(foreach d,$(wildcard */Release/$(CODEC_LIB).lib),$(word 1,$(subst /, ,$(d)))) -endif - -# The following pairs define a mapping of locations in the distribution -# tree to locations in the source/build trees. -INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/vpx/% -INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/vpx_ports/% -INSTALL_MAPS += $(LIBSUBDIR)/% % -INSTALL_MAPS += src/% $(SRC_PATH_BARE)/% -ifeq ($(CONFIG_MSVS),yes) -INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Release/%) -INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Debug/%) -endif - -CODEC_SRCS-$(BUILD_LIBVPX) += build/make/version.sh -CODEC_SRCS-$(BUILD_LIBVPX) += build/make/rtcd.pl -CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/emmintrin_compat.h -CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/mem_ops.h -CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/mem_ops_aligned.h -CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/vpx_once.h -CODEC_SRCS-$(BUILD_LIBVPX) += $(BUILD_PFX)vpx_config.c -INSTALL-SRCS-no += $(BUILD_PFX)vpx_config.c -ifeq ($(ARCH_X86)$(ARCH_X86_64),yes) -INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += third_party/x86inc/x86inc.asm -endif -CODEC_EXPORTS-$(BUILD_LIBVPX) += vpx/exports_com -CODEC_EXPORTS-$(CONFIG_ENCODERS) += vpx/exports_enc -CODEC_EXPORTS-$(CONFIG_DECODERS) += vpx/exports_dec - -INSTALL-LIBS-yes += include/vpx/vpx_codec.h -INSTALL-LIBS-yes += include/vpx/vpx_frame_buffer.h -INSTALL-LIBS-yes += include/vpx/vpx_image.h -INSTALL-LIBS-yes += include/vpx/vpx_integer.h -INSTALL-LIBS-$(CONFIG_DECODERS) += include/vpx/vpx_decoder.h -INSTALL-LIBS-$(CONFIG_ENCODERS) += include/vpx/vpx_encoder.h -ifeq ($(CONFIG_EXTERNAL_BUILD),yes) -ifeq ($(CONFIG_MSVS),yes) -INSTALL-LIBS-yes += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/$(CODEC_LIB).lib) -INSTALL-LIBS-$(CONFIG_DEBUG_LIBS) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/$(CODEC_LIB)d.lib) -INSTALL-LIBS-$(CONFIG_SHARED) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/vpx.dll) -INSTALL-LIBS-$(CONFIG_SHARED) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/vpx.exp) -endif -else -INSTALL-LIBS-$(CONFIG_STATIC) += $(LIBSUBDIR)/libvpx.a -INSTALL-LIBS-$(CONFIG_DEBUG_LIBS) += $(LIBSUBDIR)/libvpx_g.a -endif - -CODEC_SRCS=$(call enabled,CODEC_SRCS) -INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(CODEC_SRCS) -INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(call enabled,CODEC_EXPORTS) - - -# Generate a list of all enabled sources, in particular for exporting to gyp -# based build systems. -libvpx_srcs.txt: - @echo " [CREATE] $@" - @echo $(CODEC_SRCS) | xargs -n1 echo | LC_ALL=C sort -u > $@ -CLEAN-OBJS += libvpx_srcs.txt - - -ifeq ($(CONFIG_EXTERNAL_BUILD),yes) -ifeq ($(CONFIG_MSVS),yes) - -vpx.def: $(call enabled,CODEC_EXPORTS) - @echo " [CREATE] $@" - $(qexec)$(SRC_PATH_BARE)/build/make/gen_msvs_def.sh\ - --name=vpx\ - --out=$@ $^ -CLEAN-OBJS += vpx.def - -# Assembly files that are included, but don't define symbols themselves. -# Filtered out to avoid Visual Studio build warnings. -ASM_INCLUDES := \ - third_party/x86inc/x86inc.asm \ - vpx_config.asm \ - vpx_ports/x86_abi_support.asm \ - -vpx.$(VCPROJ_SFX): $(CODEC_SRCS) vpx.def - @echo " [CREATE] $@" - $(qexec)$(GEN_VCPROJ) \ - $(if $(CONFIG_SHARED),--dll,--lib) \ - --target=$(TOOLCHAIN) \ - $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \ - --name=vpx \ - --proj-guid=DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74 \ - --module-def=vpx.def \ - --ver=$(CONFIG_VS_VERSION) \ - --src-path-bare="$(SRC_PATH_BARE)" \ - --out=$@ $(CFLAGS) \ - $(filter-out $(addprefix %, $(ASM_INCLUDES)), $^) \ - --src-path-bare="$(SRC_PATH_BARE)" \ - -PROJECTS-$(BUILD_LIBVPX) += vpx.$(VCPROJ_SFX) - -vpx.$(VCPROJ_SFX): vpx_config.asm -vpx.$(VCPROJ_SFX): $(RTCD) - -endif -else -LIBVPX_OBJS=$(call objs,$(CODEC_SRCS)) -OBJS-$(BUILD_LIBVPX) += $(LIBVPX_OBJS) -LIBS-$(if $(BUILD_LIBVPX),$(CONFIG_STATIC)) += $(BUILD_PFX)libvpx.a $(BUILD_PFX)libvpx_g.a -$(BUILD_PFX)libvpx_g.a: $(LIBVPX_OBJS) - - -BUILD_LIBVPX_SO := $(if $(BUILD_LIBVPX),$(CONFIG_SHARED)) - -SO_VERSION_MAJOR := 2 -SO_VERSION_MINOR := 0 -SO_VERSION_PATCH := 0 -ifeq ($(filter darwin%,$(TGT_OS)),$(TGT_OS)) -LIBVPX_SO := libvpx.$(SO_VERSION_MAJOR).dylib -EXPORT_FILE := libvpx.syms -LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \ - libvpx.dylib ) -else -LIBVPX_SO := libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH) -EXPORT_FILE := libvpx.ver -LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \ - libvpx.so libvpx.so.$(SO_VERSION_MAJOR) \ - libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR)) -endif - -LIBS-$(BUILD_LIBVPX_SO) += $(BUILD_PFX)$(LIBVPX_SO)\ - $(notdir $(LIBVPX_SO_SYMLINKS)) -$(BUILD_PFX)$(LIBVPX_SO): $(LIBVPX_OBJS) $(EXPORT_FILE) -$(BUILD_PFX)$(LIBVPX_SO): extralibs += -lm -$(BUILD_PFX)$(LIBVPX_SO): SONAME = libvpx.so.$(SO_VERSION_MAJOR) -$(BUILD_PFX)$(LIBVPX_SO): EXPORTS_FILE = $(EXPORT_FILE) - -libvpx.ver: $(call enabled,CODEC_EXPORTS) - @echo " [CREATE] $@" - $(qexec)echo "{ global:" > $@ - $(qexec)for f in $?; do awk '{print $$2";"}' < $$f >>$@; done - $(qexec)echo "local: *; };" >> $@ -CLEAN-OBJS += libvpx.ver - -libvpx.syms: $(call enabled,CODEC_EXPORTS) - @echo " [CREATE] $@" - $(qexec)awk '{print "_"$$2}' $^ >$@ -CLEAN-OBJS += libvpx.syms - -define libvpx_symlink_template -$(1): $(2) - @echo " [LN] $(2) $$@" - $(qexec)mkdir -p $$(dir $$@) - $(qexec)ln -sf $(2) $$@ -endef - -$(eval $(call libvpx_symlink_template,\ - $(addprefix $(BUILD_PFX),$(notdir $(LIBVPX_SO_SYMLINKS))),\ - $(BUILD_PFX)$(LIBVPX_SO))) -$(eval $(call libvpx_symlink_template,\ - $(addprefix $(DIST_DIR)/,$(LIBVPX_SO_SYMLINKS)),\ - $(LIBVPX_SO))) - - -INSTALL-LIBS-$(BUILD_LIBVPX_SO) += $(LIBVPX_SO_SYMLINKS) -INSTALL-LIBS-$(BUILD_LIBVPX_SO) += $(LIBSUBDIR)/$(LIBVPX_SO) - - -LIBS-$(BUILD_LIBVPX) += vpx.pc -vpx.pc: config.mk libs.mk - @echo " [CREATE] $@" - $(qexec)echo '# pkg-config file from libvpx $(VERSION_STRING)' > $@ - $(qexec)echo 'prefix=$(PREFIX)' >> $@ - $(qexec)echo 'exec_prefix=$${prefix}' >> $@ - $(qexec)echo 'libdir=$${prefix}/$(LIBSUBDIR)' >> $@ - $(qexec)echo 'includedir=$${prefix}/include' >> $@ - $(qexec)echo '' >> $@ - $(qexec)echo 'Name: vpx' >> $@ - $(qexec)echo 'Description: WebM Project VPx codec implementation' >> $@ - $(qexec)echo 'Version: $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)' >> $@ - $(qexec)echo 'Requires:' >> $@ - $(qexec)echo 'Conflicts:' >> $@ - $(qexec)echo 'Libs: -L$${libdir} -lvpx -lm' >> $@ -ifeq ($(HAVE_PTHREAD_H),yes) - $(qexec)echo 'Libs.private: -lm -lpthread' >> $@ -else - $(qexec)echo 'Libs.private: -lm' >> $@ -endif - $(qexec)echo 'Cflags: -I$${includedir}' >> $@ -INSTALL-LIBS-yes += $(LIBSUBDIR)/pkgconfig/vpx.pc -INSTALL_MAPS += $(LIBSUBDIR)/pkgconfig/%.pc %.pc -CLEAN-OBJS += vpx.pc -endif - -LIBS-$(LIPO_LIBVPX) += libvpx.a -$(eval $(if $(LIPO_LIBVPX),$(call lipo_lib_template,libvpx.a))) - -# -# Rule to make assembler configuration file from C configuration file -# -ifeq ($(ARCH_X86)$(ARCH_X86_64),yes) -# YASM -$(BUILD_PFX)vpx_config.asm: $(BUILD_PFX)vpx_config.h - @echo " [CREATE] $@" - @egrep "#define [A-Z0-9_]+ [01]" $< \ - | awk '{print $$2 " equ " $$3}' > $@ -else -ADS2GAS=$(if $(filter yes,$(CONFIG_GCC)),| $(ASM_CONVERSION)) -$(BUILD_PFX)vpx_config.asm: $(BUILD_PFX)vpx_config.h - @echo " [CREATE] $@" - @egrep "#define [A-Z0-9_]+ [01]" $< \ - | awk '{print $$2 " EQU " $$3}' $(ADS2GAS) > $@ - @echo " END" $(ADS2GAS) >> $@ -CLEAN-OBJS += $(BUILD_PFX)vpx_config.asm -endif - -# -# Add assembler dependencies for configuration. -# -$(filter %.s.o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm -$(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm - - -$(shell $(SRC_PATH_BARE)/build/make/version.sh "$(SRC_PATH_BARE)" $(BUILD_PFX)vpx_version.h) -CLEAN-OBJS += $(BUILD_PFX)vpx_version.h - - -## -## libvpx test directives -## -ifeq ($(CONFIG_UNIT_TESTS),yes) -LIBVPX_TEST_DATA_PATH ?= . - -include $(SRC_PATH_BARE)/test/test.mk -LIBVPX_TEST_SRCS=$(addprefix test/,$(call enabled,LIBVPX_TEST_SRCS)) -LIBVPX_TEST_BINS=./test_libvpx$(EXE_SFX) -LIBVPX_TEST_DATA=$(addprefix $(LIBVPX_TEST_DATA_PATH)/,\ - $(call enabled,LIBVPX_TEST_DATA)) -libvpx_test_data_url=http://downloads.webmproject.org/test_data/libvpx/$(1) - -libvpx_test_srcs.txt: - @echo " [CREATE] $@" - @echo $(LIBVPX_TEST_SRCS) | xargs -n1 echo | LC_ALL=C sort -u > $@ -CLEAN-OBJS += libvpx_test_srcs.txt - -$(LIBVPX_TEST_DATA): $(SRC_PATH_BARE)/test/test-data.sha1 - @echo " [DOWNLOAD] $@" - $(qexec)trap 'rm -f $@' INT TERM &&\ - curl -L -o $@ $(call libvpx_test_data_url,$(@F)) - -testdata:: $(LIBVPX_TEST_DATA) - $(qexec)[ -x "$$(which sha1sum)" ] && sha1sum=sha1sum;\ - [ -x "$$(which shasum)" ] && sha1sum=shasum;\ - [ -x "$$(which sha1)" ] && sha1sum=sha1;\ - if [ -n "$${sha1sum}" ]; then\ - set -e;\ - echo "Checking test data:";\ - if [ -n "$(LIBVPX_TEST_DATA)" ]; then\ - for f in $(call enabled,LIBVPX_TEST_DATA); do\ - grep $$f $(SRC_PATH_BARE)/test/test-data.sha1 |\ - (cd $(LIBVPX_TEST_DATA_PATH); $${sha1sum} -c);\ - done; \ - fi; \ - else\ - echo "Skipping test data integrity check, sha1sum not found.";\ - fi - -ifeq ($(CONFIG_EXTERNAL_BUILD),yes) -ifeq ($(CONFIG_MSVS),yes) - -gtest.$(VCPROJ_SFX): $(SRC_PATH_BARE)/third_party/googletest/src/src/gtest-all.cc - @echo " [CREATE] $@" - $(qexec)$(GEN_VCPROJ) \ - --lib \ - --target=$(TOOLCHAIN) \ - $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \ - --name=gtest \ - --proj-guid=EC00E1EC-AF68-4D92-A255-181690D1C9B1 \ - --ver=$(CONFIG_VS_VERSION) \ - --src-path-bare="$(SRC_PATH_BARE)" \ - -D_VARIADIC_MAX=10 \ - --out=gtest.$(VCPROJ_SFX) $(SRC_PATH_BARE)/third_party/googletest/src/src/gtest-all.cc \ - -I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" -I"$(SRC_PATH_BARE)/third_party/googletest/src" - -PROJECTS-$(CONFIG_MSVS) += gtest.$(VCPROJ_SFX) - -test_libvpx.$(VCPROJ_SFX): $(LIBVPX_TEST_SRCS) vpx.$(VCPROJ_SFX) gtest.$(VCPROJ_SFX) - @echo " [CREATE] $@" - $(qexec)$(GEN_VCPROJ) \ - --exe \ - --target=$(TOOLCHAIN) \ - --name=test_libvpx \ - -D_VARIADIC_MAX=10 \ - --proj-guid=CD837F5F-52D8-4314-A370-895D614166A7 \ - --ver=$(CONFIG_VS_VERSION) \ - --src-path-bare="$(SRC_PATH_BARE)" \ - $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \ - --out=$@ $(INTERNAL_CFLAGS) $(CFLAGS) \ - -I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \ - -L. -l$(CODEC_LIB) -l$(GTEST_LIB) $^ - -PROJECTS-$(CONFIG_MSVS) += test_libvpx.$(VCPROJ_SFX) - -LIBVPX_TEST_BINS := $(addprefix $(TGT_OS:win64=x64)/Release/,$(notdir $(LIBVPX_TEST_BINS))) -endif -else - -include $(SRC_PATH_BARE)/third_party/googletest/gtest.mk -GTEST_SRCS := $(addprefix third_party/googletest/src/,$(call enabled,GTEST_SRCS)) -GTEST_OBJS=$(call objs,$(GTEST_SRCS)) -ifeq ($(filter win%,$(TGT_OS)),$(TGT_OS)) -# Disabling pthreads globally will cause issues on darwin and possibly elsewhere -$(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += -DGTEST_HAS_PTHREAD=0 -endif -$(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src -$(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src/include -OBJS-$(BUILD_LIBVPX) += $(GTEST_OBJS) -LIBS-$(BUILD_LIBVPX) += $(BUILD_PFX)libgtest.a $(BUILD_PFX)libgtest_g.a -$(BUILD_PFX)libgtest_g.a: $(GTEST_OBJS) - -LIBVPX_TEST_OBJS=$(sort $(call objs,$(LIBVPX_TEST_SRCS))) -$(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src -$(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src/include -OBJS-$(BUILD_LIBVPX) += $(LIBVPX_TEST_OBJS) -BINS-$(BUILD_LIBVPX) += $(LIBVPX_TEST_BINS) - -CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx) -CODEC_LIB_SUF=$(if $(CONFIG_SHARED),.so,.a) -$(foreach bin,$(LIBVPX_TEST_BINS),\ - $(if $(BUILD_LIBVPX),$(eval $(bin): \ - lib$(CODEC_LIB)$(CODEC_LIB_SUF) libgtest.a ))\ - $(if $(BUILD_LIBVPX),$(eval $(call linkerxx_template,$(bin),\ - $(LIBVPX_TEST_OBJS) \ - -L. -lvpx -lgtest $(extralibs) -lm)\ - )))\ - $(if $(LIPO_LIBS),$(eval $(call lipo_bin_template,$(bin))))\ - -endif - -# Install test sources only if codec source is included -INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(patsubst $(SRC_PATH_BARE)/%,%,\ - $(shell find $(SRC_PATH_BARE)/third_party/googletest -type f)) -INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(LIBVPX_TEST_SRCS) - -define test_shard_template -test:: test_shard.$(1) -test_shard.$(1): $(LIBVPX_TEST_BINS) testdata - @set -e; \ - for t in $(LIBVPX_TEST_BINS); do \ - export GTEST_SHARD_INDEX=$(1); \ - export GTEST_TOTAL_SHARDS=$(2); \ - $$$$t; \ - done -.PHONY: test_shard.$(1) -endef - -NUM_SHARDS := 10 -SHARDS := 0 1 2 3 4 5 6 7 8 9 -$(foreach s,$(SHARDS),$(eval $(call test_shard_template,$(s),$(NUM_SHARDS)))) - -endif - -## -## documentation directives -## -CLEAN-OBJS += libs.doxy -DOCS-yes += libs.doxy -libs.doxy: $(CODEC_DOC_SRCS) - @echo " [CREATE] $@" - @rm -f $@ - @echo "INPUT += $^" >> $@ - @echo "INCLUDE_PATH += ." >> $@; - @echo "ENABLED_SECTIONS += $(sort $(CODEC_DOC_SECTIONS))" >> $@ - -## Generate rtcd.h for all objects -ifeq ($(CONFIG_DEPENDENCY_TRACKING),yes) -$(OBJS-yes:.o=.d): $(RTCD) -else -$(OBJS-yes): $(RTCD) -endif - -## Update the global src list -SRCS += $(CODEC_SRCS) $(LIBVPX_TEST_SRCS) $(GTEST_SRCS) - -## -## vpxdec/vpxenc tests. -## -ifeq ($(CONFIG_UNIT_TESTS),yes) -TEST_BIN_PATH = . -ifeq ($(CONFIG_MSVS),yes) -# MSVC will build both Debug and Release configurations of tools in a -# sub directory named for the current target. Assume the user wants to -# run the Release tools, and assign TEST_BIN_PATH accordingly. -# TODO(tomfinegan): Is this adequate for ARM? -# TODO(tomfinegan): Support running the debug versions of tools? -TEST_BIN_PATH := $(addsuffix /$(TGT_OS:win64=x64)/Release, $(TEST_BIN_PATH)) -endif -utiltest: testdata - $(qexec)$(SRC_PATH_BARE)/test/vpxdec.sh \ - --test-data-path $(LIBVPX_TEST_DATA_PATH) \ - --bin-path $(TEST_BIN_PATH) - $(qexec)$(SRC_PATH_BARE)/test/vpxenc.sh \ - --test-data-path $(LIBVPX_TEST_DATA_PATH) \ - --bin-path $(TEST_BIN_PATH) -else -utiltest: - @echo Unit tests must be enabled to make the utiltest target. -endif - -## -## Example tests. -## -ifeq ($(CONFIG_UNIT_TESTS),yes) -# All non-MSVC targets output example targets in a sub dir named examples. -EXAMPLES_BIN_PATH = examples -ifeq ($(CONFIG_MSVS),yes) -# MSVC will build both Debug and Release configurations of the examples in a -# sub directory named for the current target. Assume the user wants to -# run the Release tools, and assign EXAMPLES_BIN_PATH accordingly. -# TODO(tomfinegan): Is this adequate for ARM? -# TODO(tomfinegan): Support running the debug versions of tools? -EXAMPLES_BIN_PATH := $(TGT_OS:win64=x64)/Release -endif -exampletest: examples testdata - $(qexec)$(SRC_PATH_BARE)/test/examples.sh \ - --test-data-path $(LIBVPX_TEST_DATA_PATH) \ - --bin-path $(EXAMPLES_BIN_PATH) -else -exampletest: - @echo Unit tests must be enabled to make the exampletest target. -endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/LICENSE gstreamer-vaapi-1.8.2/ext/libvpx/upstream/LICENSE --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/LICENSE 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/LICENSE 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -Copyright (c) 2010, The WebM Project authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * 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. - - * Neither the name of Google, nor the WebM Project, nor the names - of its contributors may be used to endorse or promote products - derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"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 THE COPYRIGHT -HOLDER 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. - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/md5_utils.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/md5_utils.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/md5_utils.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/md5_utils.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,241 +0,0 @@ -/* - * This code implements the MD5 message-digest algorithm. - * The algorithm is due to Ron Rivest. This code was - * written by Colin Plumb in 1993, no copyright is claimed. - * This code is in the public domain; do with it what you wish. - * - * Equivalent code is available from RSA Data Security, Inc. - * This code has been tested against that, and is equivalent, - * except that you don't need to include two pages of legalese - * with every copy. - * - * To compute the message digest of a chunk of bytes, declare an - * MD5Context structure, pass it to MD5Init, call MD5Update as - * needed on buffers full of bytes, and then call MD5Final, which - * will fill a supplied 16-byte array with the digest. - * - * Changed so as no longer to depend on Colin Plumb's `usual.h' header - * definitions - * - Ian Jackson . - * Still in the public domain. - */ - -#include /* for memcpy() */ - -#include "md5_utils.h" - -void -byteSwap(UWORD32 *buf, unsigned words) { - md5byte *p; - - /* Only swap bytes for big endian machines */ - int i = 1; - - if (*(char *)&i == 1) - return; - - p = (md5byte *)buf; - - do { - *buf++ = (UWORD32)((unsigned)p[3] << 8 | p[2]) << 16 | - ((unsigned)p[1] << 8 | p[0]); - p += 4; - } while (--words); -} - -/* - * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious - * initialization constants. - */ -void -MD5Init(struct MD5Context *ctx) { - ctx->buf[0] = 0x67452301; - ctx->buf[1] = 0xefcdab89; - ctx->buf[2] = 0x98badcfe; - ctx->buf[3] = 0x10325476; - - ctx->bytes[0] = 0; - ctx->bytes[1] = 0; -} - -/* - * Update context to reflect the concatenation of another buffer full - * of bytes. - */ -void -MD5Update(struct MD5Context *ctx, md5byte const *buf, unsigned len) { - UWORD32 t; - - /* Update byte count */ - - t = ctx->bytes[0]; - - if ((ctx->bytes[0] = t + len) < t) - ctx->bytes[1]++; /* Carry from low to high */ - - t = 64 - (t & 0x3f); /* Space available in ctx->in (at least 1) */ - - if (t > len) { - memcpy((md5byte *)ctx->in + 64 - t, buf, len); - return; - } - - /* First chunk is an odd size */ - memcpy((md5byte *)ctx->in + 64 - t, buf, t); - byteSwap(ctx->in, 16); - MD5Transform(ctx->buf, ctx->in); - buf += t; - len -= t; - - /* Process data in 64-byte chunks */ - while (len >= 64) { - memcpy(ctx->in, buf, 64); - byteSwap(ctx->in, 16); - MD5Transform(ctx->buf, ctx->in); - buf += 64; - len -= 64; - } - - /* Handle any remaining bytes of data. */ - memcpy(ctx->in, buf, len); -} - -/* - * Final wrapup - pad to 64-byte boundary with the bit pattern - * 1 0* (64-bit count of bits processed, MSB-first) - */ -void -MD5Final(md5byte digest[16], struct MD5Context *ctx) { - int count = ctx->bytes[0] & 0x3f; /* Number of bytes in ctx->in */ - md5byte *p = (md5byte *)ctx->in + count; - - /* Set the first char of padding to 0x80. There is always room. */ - *p++ = 0x80; - - /* Bytes of padding needed to make 56 bytes (-8..55) */ - count = 56 - 1 - count; - - if (count < 0) { /* Padding forces an extra block */ - memset(p, 0, count + 8); - byteSwap(ctx->in, 16); - MD5Transform(ctx->buf, ctx->in); - p = (md5byte *)ctx->in; - count = 56; - } - - memset(p, 0, count); - byteSwap(ctx->in, 14); - - /* Append length in bits and transform */ - ctx->in[14] = ctx->bytes[0] << 3; - ctx->in[15] = ctx->bytes[1] << 3 | ctx->bytes[0] >> 29; - MD5Transform(ctx->buf, ctx->in); - - byteSwap(ctx->buf, 4); - memcpy(digest, ctx->buf, 16); - memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ -} - -#ifndef ASM_MD5 - -/* The four core functions - F1 is optimized somewhat */ - -/* #define F1(x, y, z) (x & y | ~x & z) */ -#define F1(x, y, z) (z ^ (x & (y ^ z))) -#define F2(x, y, z) F1(z, x, y) -#define F3(x, y, z) (x ^ y ^ z) -#define F4(x, y, z) (y ^ (x | ~z)) - -/* This is the central step in the MD5 algorithm. */ -#define MD5STEP(f,w,x,y,z,in,s) \ - (w += f(x,y,z) + in, w = (w<>(32-s)) + x) - -/* - * The core of the MD5 algorithm, this alters an existing MD5 hash to - * reflect the addition of 16 longwords of new data. MD5Update blocks - * the data and converts bytes into longwords for this routine. - */ -void -MD5Transform(UWORD32 buf[4], UWORD32 const in[16]) { - register UWORD32 a, b, c, d; - - a = buf[0]; - b = buf[1]; - c = buf[2]; - d = buf[3]; - - MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); - MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); - MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); - MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); - MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); - MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); - MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); - MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); - MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); - MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); - MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); - MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); - MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); - MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); - MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); - MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); - - MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); - MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); - MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); - MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); - MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); - MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); - MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); - MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); - MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); - MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); - MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); - MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); - MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); - MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); - MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); - MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); - - MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); - MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); - MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); - MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); - MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); - MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); - MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); - MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); - MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); - MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); - MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); - MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); - MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); - MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); - MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); - MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); - - MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); - MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); - MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); - MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); - MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); - MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); - MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); - MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); - MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); - MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); - MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); - MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); - MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); - MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); - MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); - MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); - - buf[0] += a; - buf[1] += b; - buf[2] += c; - buf[3] += d; -} - -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/md5_utils.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/md5_utils.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/md5_utils.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/md5_utils.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -/* - * This is the header file for the MD5 message-digest algorithm. - * The algorithm is due to Ron Rivest. This code was - * written by Colin Plumb in 1993, no copyright is claimed. - * This code is in the public domain; do with it what you wish. - * - * Equivalent code is available from RSA Data Security, Inc. - * This code has been tested against that, and is equivalent, - * except that you don't need to include two pages of legalese - * with every copy. - * - * To compute the message digest of a chunk of bytes, declare an - * MD5Context structure, pass it to MD5Init, call MD5Update as - * needed on buffers full of bytes, and then call MD5Final, which - * will fill a supplied 16-byte array with the digest. - * - * Changed so as no longer to depend on Colin Plumb's `usual.h' - * header definitions - * - Ian Jackson . - * Still in the public domain. - */ - -#ifndef MD5_UTILS_H_ -#define MD5_UTILS_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#define md5byte unsigned char -#define UWORD32 unsigned int - -typedef struct MD5Context MD5Context; -struct MD5Context { - UWORD32 buf[4]; - UWORD32 bytes[2]; - UWORD32 in[16]; -}; - -void MD5Init(struct MD5Context *context); -void MD5Update(struct MD5Context *context, md5byte const *buf, unsigned len); -void MD5Final(unsigned char digest[16], struct MD5Context *context); -void MD5Transform(UWORD32 buf[4], UWORD32 const in[16]); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // MD5_UTILS_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/PATENTS gstreamer-vaapi-1.8.2/ext/libvpx/upstream/PATENTS --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/PATENTS 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/PATENTS 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -Additional IP Rights Grant (Patents) ------------------------------------- - -"These implementations" means the copyrightable works that implement the WebM -codecs distributed by Google as part of the WebM Project. - -Google hereby grants to you a perpetual, worldwide, non-exclusive, no-charge, -royalty-free, irrevocable (except as stated in this section) patent license to -make, have made, use, offer to sell, sell, import, transfer, and otherwise -run, modify and propagate the contents of these implementations of WebM, where -such license applies only to those patent claims, both currently owned by -Google and acquired in the future, licensable by Google that are necessarily -infringed by these implementations of WebM. This grant does not include claims -that would be infringed only as a consequence of further modification of these -implementations. If you or your agent or exclusive licensee institute or order -or agree to the institution of patent litigation or any other patent -enforcement activity against any entity (including a cross-claim or -counterclaim in a lawsuit) alleging that any of these implementations of WebM -or any code incorporated within any of these implementations of WebM -constitutes direct or contributory patent infringement, or inducement of -patent infringement, then any patent rights granted to you under this License -for these implementations of WebM shall terminate as of the date such -litigation is filed. diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/rate_hist.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/rate_hist.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/rate_hist.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/rate_hist.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,282 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include -#include -#include - -#include "./rate_hist.h" - -#define RATE_BINS 100 -#define HIST_BAR_MAX 40 - -struct hist_bucket { - int low; - int high; - int count; -}; - -struct rate_hist { - int64_t *pts; - int *sz; - int samples; - int frames; - struct hist_bucket bucket[RATE_BINS]; - int total; -}; - -struct rate_hist *init_rate_histogram(const vpx_codec_enc_cfg_t *cfg, - const vpx_rational_t *fps) { - int i; - struct rate_hist *hist = malloc(sizeof(*hist)); - - // Determine the number of samples in the buffer. Use the file's framerate - // to determine the number of frames in rc_buf_sz milliseconds, with an - // adjustment (5/4) to account for alt-refs - hist->samples = cfg->rc_buf_sz * 5 / 4 * fps->num / fps->den / 1000; - - // prevent division by zero - if (hist->samples == 0) - hist->samples = 1; - - hist->frames = 0; - hist->total = 0; - - hist->pts = calloc(hist->samples, sizeof(*hist->pts)); - hist->sz = calloc(hist->samples, sizeof(*hist->sz)); - for (i = 0; i < RATE_BINS; i++) { - hist->bucket[i].low = INT_MAX; - hist->bucket[i].high = 0; - hist->bucket[i].count = 0; - } - - return hist; -} - -void destroy_rate_histogram(struct rate_hist *hist) { - if (hist) { - free(hist->pts); - free(hist->sz); - free(hist); - } -} - -void update_rate_histogram(struct rate_hist *hist, - const vpx_codec_enc_cfg_t *cfg, - const vpx_codec_cx_pkt_t *pkt) { - int i; - int64_t then = 0; - int64_t avg_bitrate = 0; - int64_t sum_sz = 0; - const int64_t now = pkt->data.frame.pts * 1000 * - (uint64_t)cfg->g_timebase.num / - (uint64_t)cfg->g_timebase.den; - - int idx = hist->frames++ % hist->samples; - hist->pts[idx] = now; - hist->sz[idx] = (int)pkt->data.frame.sz; - - if (now < cfg->rc_buf_initial_sz) - return; - - then = now; - - /* Sum the size over the past rc_buf_sz ms */ - for (i = hist->frames; i > 0 && hist->frames - i < hist->samples; i--) { - const int i_idx = (i - 1) % hist->samples; - - then = hist->pts[i_idx]; - if (now - then > cfg->rc_buf_sz) - break; - sum_sz += hist->sz[i_idx]; - } - - if (now == then) - return; - - avg_bitrate = sum_sz * 8 * 1000 / (now - then); - idx = (int)(avg_bitrate * (RATE_BINS / 2) / (cfg->rc_target_bitrate * 1000)); - if (idx < 0) - idx = 0; - if (idx > RATE_BINS - 1) - idx = RATE_BINS - 1; - if (hist->bucket[idx].low > avg_bitrate) - hist->bucket[idx].low = (int)avg_bitrate; - if (hist->bucket[idx].high < avg_bitrate) - hist->bucket[idx].high = (int)avg_bitrate; - hist->bucket[idx].count++; - hist->total++; -} - -static int merge_hist_buckets(struct hist_bucket *bucket, - int max_buckets, int *num_buckets) { - int small_bucket = 0, merge_bucket = INT_MAX, big_bucket = 0; - int buckets = *num_buckets; - int i; - - /* Find the extrema for this list of buckets */ - big_bucket = small_bucket = 0; - for (i = 0; i < buckets; i++) { - if (bucket[i].count < bucket[small_bucket].count) - small_bucket = i; - if (bucket[i].count > bucket[big_bucket].count) - big_bucket = i; - } - - /* If we have too many buckets, merge the smallest with an adjacent - * bucket. - */ - while (buckets > max_buckets) { - int last_bucket = buckets - 1; - - /* merge the small bucket with an adjacent one. */ - if (small_bucket == 0) - merge_bucket = 1; - else if (small_bucket == last_bucket) - merge_bucket = last_bucket - 1; - else if (bucket[small_bucket - 1].count < bucket[small_bucket + 1].count) - merge_bucket = small_bucket - 1; - else - merge_bucket = small_bucket + 1; - - assert(abs(merge_bucket - small_bucket) <= 1); - assert(small_bucket < buckets); - assert(big_bucket < buckets); - assert(merge_bucket < buckets); - - if (merge_bucket < small_bucket) { - bucket[merge_bucket].high = bucket[small_bucket].high; - bucket[merge_bucket].count += bucket[small_bucket].count; - } else { - bucket[small_bucket].high = bucket[merge_bucket].high; - bucket[small_bucket].count += bucket[merge_bucket].count; - merge_bucket = small_bucket; - } - - assert(bucket[merge_bucket].low != bucket[merge_bucket].high); - - buckets--; - - /* Remove the merge_bucket from the list, and find the new small - * and big buckets while we're at it - */ - big_bucket = small_bucket = 0; - for (i = 0; i < buckets; i++) { - if (i > merge_bucket) - bucket[i] = bucket[i + 1]; - - if (bucket[i].count < bucket[small_bucket].count) - small_bucket = i; - if (bucket[i].count > bucket[big_bucket].count) - big_bucket = i; - } - } - - *num_buckets = buckets; - return bucket[big_bucket].count; -} - -static void show_histogram(const struct hist_bucket *bucket, - int buckets, int total, int scale) { - const char *pat1, *pat2; - int i; - - switch ((int)(log(bucket[buckets - 1].high) / log(10)) + 1) { - case 1: - case 2: - pat1 = "%4d %2s: "; - pat2 = "%4d-%2d: "; - break; - case 3: - pat1 = "%5d %3s: "; - pat2 = "%5d-%3d: "; - break; - case 4: - pat1 = "%6d %4s: "; - pat2 = "%6d-%4d: "; - break; - case 5: - pat1 = "%7d %5s: "; - pat2 = "%7d-%5d: "; - break; - case 6: - pat1 = "%8d %6s: "; - pat2 = "%8d-%6d: "; - break; - case 7: - pat1 = "%9d %7s: "; - pat2 = "%9d-%7d: "; - break; - default: - pat1 = "%12d %10s: "; - pat2 = "%12d-%10d: "; - break; - } - - for (i = 0; i < buckets; i++) { - int len; - int j; - float pct; - - pct = (float)(100.0 * bucket[i].count / total); - len = HIST_BAR_MAX * bucket[i].count / scale; - if (len < 1) - len = 1; - assert(len <= HIST_BAR_MAX); - - if (bucket[i].low == bucket[i].high) - fprintf(stderr, pat1, bucket[i].low, ""); - else - fprintf(stderr, pat2, bucket[i].low, bucket[i].high); - - for (j = 0; j < HIST_BAR_MAX; j++) - fprintf(stderr, j < len ? "=" : " "); - fprintf(stderr, "\t%5d (%6.2f%%)\n", bucket[i].count, pct); - } -} - -void show_q_histogram(const int counts[64], int max_buckets) { - struct hist_bucket bucket[64]; - int buckets = 0; - int total = 0; - int scale; - int i; - - for (i = 0; i < 64; i++) { - if (counts[i]) { - bucket[buckets].low = bucket[buckets].high = i; - bucket[buckets].count = counts[i]; - buckets++; - total += counts[i]; - } - } - - fprintf(stderr, "\nQuantizer Selection:\n"); - scale = merge_hist_buckets(bucket, max_buckets, &buckets); - show_histogram(bucket, buckets, total, scale); -} - -void show_rate_histogram(struct rate_hist *hist, - const vpx_codec_enc_cfg_t *cfg, int max_buckets) { - int i, scale; - int buckets = 0; - - for (i = 0; i < RATE_BINS; i++) { - if (hist->bucket[i].low == INT_MAX) - continue; - hist->bucket[buckets++] = hist->bucket[i]; - } - - fprintf(stderr, "\nRate (over %dms window):\n", cfg->rc_buf_sz); - scale = merge_hist_buckets(hist->bucket, max_buckets, &buckets); - show_histogram(hist->bucket, buckets, hist->total, scale); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/rate_hist.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/rate_hist.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/rate_hist.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/rate_hist.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef RATE_HIST_H_ -#define RATE_HIST_H_ - -#include "vpx/vpx_encoder.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct rate_hist; - -struct rate_hist *init_rate_histogram(const vpx_codec_enc_cfg_t *cfg, - const vpx_rational_t *fps); - -void destroy_rate_histogram(struct rate_hist *hist); - -void update_rate_histogram(struct rate_hist *hist, - const vpx_codec_enc_cfg_t *cfg, - const vpx_codec_cx_pkt_t *pkt); - -void show_q_histogram(const int counts[64], int max_buckets); - -void show_rate_histogram(struct rate_hist *hist, const vpx_codec_enc_cfg_t *cfg, - int max_buckets); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // RATE_HIST_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/solution.mk gstreamer-vaapi-1.8.2/ext/libvpx/upstream/solution.mk --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/solution.mk 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/solution.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -## -## Copyright (c) 2010 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - -# libvpx reverse dependencies (targets that depend on libvpx) -VPX_NONDEPS=$(addsuffix .$(VCPROJ_SFX),vpx gtest) -VPX_RDEPS=$(foreach vcp,\ - $(filter-out $(VPX_NONDEPS),$^), --dep=$(vcp:.$(VCPROJ_SFX)=):vpx) - -vpx.sln: $(wildcard *.$(VCPROJ_SFX)) - @echo " [CREATE] $@" - $(SRC_PATH_BARE)/build/make/gen_msvs_sln.sh \ - $(if $(filter vpx.$(VCPROJ_SFX),$^),$(VPX_RDEPS)) \ - --dep=test_libvpx:gtest \ - --ver=$(CONFIG_VS_VERSION)\ - --out=$@ $^ -vpx.sln.mk: vpx.sln - @true - -PROJECTS-yes += vpx.sln vpx.sln.mk --include vpx.sln.mk - -# Always install this file, as it is an unconditional post-build rule. -INSTALL_MAPS += src/% $(SRC_PATH_BARE)/% -INSTALL-SRCS-yes += $(target).mk diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/acm_random.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/acm_random.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/acm_random.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/acm_random.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef TEST_ACM_RANDOM_H_ -#define TEST_ACM_RANDOM_H_ - -#include "third_party/googletest/src/include/gtest/gtest.h" - -#include "vpx/vpx_integer.h" - -namespace libvpx_test { - -class ACMRandom { - public: - ACMRandom() : random_(DeterministicSeed()) {} - - explicit ACMRandom(int seed) : random_(seed) {} - - void Reset(int seed) { - random_.Reseed(seed); - } - uint16_t Rand16(void) { - const uint32_t value = - random_.Generate(testing::internal::Random::kMaxRange); - return (value >> 15) & 0xffff; - } - - uint8_t Rand8(void) { - const uint32_t value = - random_.Generate(testing::internal::Random::kMaxRange); - // There's a bit more entropy in the upper bits of this implementation. - return (value >> 23) & 0xff; - } - - uint8_t Rand8Extremes(void) { - // Returns a random value near 0 or near 255, to better exercise - // saturation behavior. - const uint8_t r = Rand8(); - return r < 128 ? r << 4 : r >> 4; - } - - int PseudoUniform(int range) { - return random_.Generate(range); - } - - int operator()(int n) { - return PseudoUniform(n); - } - - static int DeterministicSeed(void) { - return 0xbaba; - } - - private: - testing::internal::Random random_; -}; - -} // namespace libvpx_test - -#endif // TEST_ACM_RANDOM_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/android/Android.mk gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/android/Android.mk --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/android/Android.mk 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/android/Android.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -# Copyright (c) 2013 The WebM project authors. All Rights Reserved. -# -# Use of this source code is governed by a BSD-style license -# that can be found in the LICENSE file in the root of the source -# tree. An additional intellectual property rights grant can be found -# in the file PATENTS. All contributing project authors may -# be found in the AUTHORS file in the root of the source tree. -# -# This make file builds vpx_test app for android. -# The test app itself runs on the command line through adb shell -# The paths are really messed up as the libvpx make file -# expects to be made from a parent directory. -CUR_WD := $(call my-dir) -BINDINGS_DIR := $(CUR_WD)/../../.. -LOCAL_PATH := $(CUR_WD)/../../.. - -#libwebm -include $(CLEAR_VARS) -include $(BINDINGS_DIR)/libvpx/third_party/libwebm/Android.mk -LOCAL_PATH := $(CUR_WD)/../../.. - -#libvpx -include $(CLEAR_VARS) -LOCAL_STATIC_LIBRARIES := libwebm -include $(BINDINGS_DIR)/libvpx/build/make/Android.mk -LOCAL_PATH := $(CUR_WD)/../.. - -#libgtest -include $(CLEAR_VARS) -LOCAL_ARM_MODE := arm -LOCAL_CPP_EXTENSION := .cc -LOCAL_MODULE := gtest -LOCAL_C_INCLUDES := $(LOCAL_PATH)/third_party/googletest/src/ -LOCAL_C_INCLUDES += $(LOCAL_PATH)/third_party/googletest/src/include/ -LOCAL_SRC_FILES := ./third_party/googletest/src/src/gtest-all.cc -include $(BUILD_STATIC_LIBRARY) - -#libvpx_test -include $(CLEAR_VARS) -LOCAL_ARM_MODE := arm -LOCAL_MODULE := libvpx_test -LOCAL_STATIC_LIBRARIES := gtest libwebm -LOCAL_SHARED_LIBRARIES := vpx -include $(LOCAL_PATH)/test/test.mk -LOCAL_C_INCLUDES := $(BINDINGS_DIR) -FILTERED_SRC := $(sort $(filter %.cc %.c, $(LIBVPX_TEST_SRCS-yes))) -LOCAL_SRC_FILES := $(addprefix ./test/, $(FILTERED_SRC)) -include $(BUILD_EXECUTABLE) diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/clear_system_state.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/clear_system_state.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/clear_system_state.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/clear_system_state.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef TEST_CLEAR_SYSTEM_STATE_H_ -#define TEST_CLEAR_SYSTEM_STATE_H_ - -#include "./vpx_config.h" -#if ARCH_X86 || ARCH_X86_64 -# include "vpx_ports/x86.h" -#endif - -namespace libvpx_test { - -// Reset system to a known state. This function should be used for all non-API -// test cases. -inline void ClearSystemState() { -#if ARCH_X86 || ARCH_X86_64 - vpx_reset_mmx_state(); -#endif -} - -} // namespace libvpx_test -#endif // TEST_CLEAR_SYSTEM_STATE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/codec_factory.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/codec_factory.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/codec_factory.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/codec_factory.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,257 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef TEST_CODEC_FACTORY_H_ -#define TEST_CODEC_FACTORY_H_ - -#include "./vpx_config.h" -#include "vpx/vpx_decoder.h" -#include "vpx/vpx_encoder.h" -#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER -#include "vpx/vp8cx.h" -#endif -#if CONFIG_VP8_DECODER || CONFIG_VP9_DECODER -#include "vpx/vp8dx.h" -#endif - -#include "test/decode_test_driver.h" -#include "test/encode_test_driver.h" -namespace libvpx_test { - -const int kCodecFactoryParam = 0; - -class CodecFactory { - public: - CodecFactory() {} - - virtual ~CodecFactory() {} - - virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg, - unsigned long deadline) const = 0; - - virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg, - const vpx_codec_flags_t flags, - unsigned long deadline) // NOLINT(runtime/int) - const = 0; - - virtual Encoder* CreateEncoder(vpx_codec_enc_cfg_t cfg, - unsigned long deadline, - const unsigned long init_flags, - TwopassStatsStore *stats) const = 0; - - virtual vpx_codec_err_t DefaultEncoderConfig(vpx_codec_enc_cfg_t *cfg, - int usage) const = 0; -}; - -/* Provide CodecTestWithParams classes for a variable number of parameters - * to avoid having to include a pointer to the CodecFactory in every test - * definition. - */ -template -class CodecTestWithParam : public ::testing::TestWithParam< - std::tr1::tuple< const libvpx_test::CodecFactory*, T1 > > { -}; - -template -class CodecTestWith2Params : public ::testing::TestWithParam< - std::tr1::tuple< const libvpx_test::CodecFactory*, T1, T2 > > { -}; - -template -class CodecTestWith3Params : public ::testing::TestWithParam< - std::tr1::tuple< const libvpx_test::CodecFactory*, T1, T2, T3 > > { -}; - -/* - * VP8 Codec Definitions - */ -#if CONFIG_VP8 -class VP8Decoder : public Decoder { - public: - VP8Decoder(vpx_codec_dec_cfg_t cfg, unsigned long deadline) - : Decoder(cfg, deadline) {} - - VP8Decoder(vpx_codec_dec_cfg_t cfg, const vpx_codec_flags_t flag, - unsigned long deadline) // NOLINT - : Decoder(cfg, flag, deadline) {} - - protected: - virtual vpx_codec_iface_t* CodecInterface() const { -#if CONFIG_VP8_DECODER - return &vpx_codec_vp8_dx_algo; -#else - return NULL; -#endif - } -}; - -class VP8Encoder : public Encoder { - public: - VP8Encoder(vpx_codec_enc_cfg_t cfg, unsigned long deadline, - const unsigned long init_flags, TwopassStatsStore *stats) - : Encoder(cfg, deadline, init_flags, stats) {} - - protected: - virtual vpx_codec_iface_t* CodecInterface() const { -#if CONFIG_VP8_ENCODER - return &vpx_codec_vp8_cx_algo; -#else - return NULL; -#endif - } -}; - -class VP8CodecFactory : public CodecFactory { - public: - VP8CodecFactory() : CodecFactory() {} - - virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg, - unsigned long deadline) const { - return CreateDecoder(cfg, 0, deadline); - } - - virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg, - const vpx_codec_flags_t flags, - unsigned long deadline) const { // NOLINT -#if CONFIG_VP8_DECODER - return new VP8Decoder(cfg, flags, deadline); -#else - return NULL; -#endif - } - - virtual Encoder* CreateEncoder(vpx_codec_enc_cfg_t cfg, - unsigned long deadline, - const unsigned long init_flags, - TwopassStatsStore *stats) const { -#if CONFIG_VP8_ENCODER - return new VP8Encoder(cfg, deadline, init_flags, stats); -#else - return NULL; -#endif - } - - virtual vpx_codec_err_t DefaultEncoderConfig(vpx_codec_enc_cfg_t *cfg, - int usage) const { -#if CONFIG_VP8_ENCODER - return vpx_codec_enc_config_default(&vpx_codec_vp8_cx_algo, cfg, usage); -#else - return VPX_CODEC_INCAPABLE; -#endif - } -}; - -const libvpx_test::VP8CodecFactory kVP8; - -#define VP8_INSTANTIATE_TEST_CASE(test, ...)\ - INSTANTIATE_TEST_CASE_P(VP8, test, \ - ::testing::Combine( \ - ::testing::Values(static_cast( \ - &libvpx_test::kVP8)), \ - __VA_ARGS__)) -#else -#define VP8_INSTANTIATE_TEST_CASE(test, ...) -#endif // CONFIG_VP8 - - -/* - * VP9 Codec Definitions - */ -#if CONFIG_VP9 -class VP9Decoder : public Decoder { - public: - VP9Decoder(vpx_codec_dec_cfg_t cfg, unsigned long deadline) - : Decoder(cfg, deadline) {} - - VP9Decoder(vpx_codec_dec_cfg_t cfg, const vpx_codec_flags_t flag, - unsigned long deadline) // NOLINT - : Decoder(cfg, flag, deadline) {} - - protected: - virtual vpx_codec_iface_t* CodecInterface() const { -#if CONFIG_VP9_DECODER - return &vpx_codec_vp9_dx_algo; -#else - return NULL; -#endif - } -}; - -class VP9Encoder : public Encoder { - public: - VP9Encoder(vpx_codec_enc_cfg_t cfg, unsigned long deadline, - const unsigned long init_flags, TwopassStatsStore *stats) - : Encoder(cfg, deadline, init_flags, stats) {} - - protected: - virtual vpx_codec_iface_t* CodecInterface() const { -#if CONFIG_VP9_ENCODER - return &vpx_codec_vp9_cx_algo; -#else - return NULL; -#endif - } -}; - -class VP9CodecFactory : public CodecFactory { - public: - VP9CodecFactory() : CodecFactory() {} - - virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg, - unsigned long deadline) const { - return CreateDecoder(cfg, 0, deadline); - } - - virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg, - const vpx_codec_flags_t flags, - unsigned long deadline) const { // NOLINT -#if CONFIG_VP9_DECODER - return new VP9Decoder(cfg, flags, deadline); -#else - return NULL; -#endif - } - - virtual Encoder* CreateEncoder(vpx_codec_enc_cfg_t cfg, - unsigned long deadline, - const unsigned long init_flags, - TwopassStatsStore *stats) const { -#if CONFIG_VP9_ENCODER - return new VP9Encoder(cfg, deadline, init_flags, stats); -#else - return NULL; -#endif - } - - virtual vpx_codec_err_t DefaultEncoderConfig(vpx_codec_enc_cfg_t *cfg, - int usage) const { -#if CONFIG_VP9_ENCODER - return vpx_codec_enc_config_default(&vpx_codec_vp9_cx_algo, cfg, usage); -#else - return VPX_CODEC_INCAPABLE; -#endif - } -}; - -const libvpx_test::VP9CodecFactory kVP9; - -#define VP9_INSTANTIATE_TEST_CASE(test, ...)\ - INSTANTIATE_TEST_CASE_P(VP9, test, \ - ::testing::Combine( \ - ::testing::Values(static_cast( \ - &libvpx_test::kVP9)), \ - __VA_ARGS__)) -#else -#define VP9_INSTANTIATE_TEST_CASE(test, ...) -#endif // CONFIG_VP9 - - -} // namespace libvpx_test - -#endif // TEST_CODEC_FACTORY_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/decode_test_driver.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/decode_test_driver.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/decode_test_driver.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/decode_test_driver.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,181 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef TEST_DECODE_TEST_DRIVER_H_ -#define TEST_DECODE_TEST_DRIVER_H_ -#include -#include "third_party/googletest/src/include/gtest/gtest.h" -#include "./vpx_config.h" -#include "vpx/vpx_decoder.h" - -namespace libvpx_test { - -class CodecFactory; -class CompressedVideoSource; - -// Provides an object to handle decoding output -class DxDataIterator { - public: - explicit DxDataIterator(vpx_codec_ctx_t *decoder) - : decoder_(decoder), iter_(NULL) {} - - const vpx_image_t *Next() { - return vpx_codec_get_frame(decoder_, &iter_); - } - - private: - vpx_codec_ctx_t *decoder_; - vpx_codec_iter_t iter_; -}; - -// Provides a simplified interface to manage one video decoding. -// Similar to Encoder class, the exact services should be added -// as more tests are added. -class Decoder { - public: - Decoder(vpx_codec_dec_cfg_t cfg, unsigned long deadline) - : cfg_(cfg), flags_(0), deadline_(deadline), init_done_(false) { - memset(&decoder_, 0, sizeof(decoder_)); - } - - Decoder(vpx_codec_dec_cfg_t cfg, const vpx_codec_flags_t flag, - unsigned long deadline) // NOLINT - : cfg_(cfg), flags_(flag), deadline_(deadline), init_done_(false) { - memset(&decoder_, 0, sizeof(decoder_)); - } - - virtual ~Decoder() { - vpx_codec_destroy(&decoder_); - } - - vpx_codec_err_t PeekStream(const uint8_t *cxdata, size_t size, - vpx_codec_stream_info_t *stream_info); - - vpx_codec_err_t DecodeFrame(const uint8_t *cxdata, size_t size); - - vpx_codec_err_t DecodeFrame(const uint8_t *cxdata, size_t size, - void *user_priv); - - DxDataIterator GetDxData() { - return DxDataIterator(&decoder_); - } - - void set_deadline(unsigned long deadline) { - deadline_ = deadline; - } - - void Control(int ctrl_id, int arg) { - Control(ctrl_id, arg, VPX_CODEC_OK); - } - - void Control(int ctrl_id, const void *arg) { - InitOnce(); - const vpx_codec_err_t res = vpx_codec_control_(&decoder_, ctrl_id, arg); - ASSERT_EQ(VPX_CODEC_OK, res) << DecodeError(); - } - - void Control(int ctrl_id, int arg, vpx_codec_err_t expected_value) { - InitOnce(); - const vpx_codec_err_t res = vpx_codec_control_(&decoder_, ctrl_id, arg); - ASSERT_EQ(expected_value, res) << DecodeError(); - } - - const char* DecodeError() { - const char *detail = vpx_codec_error_detail(&decoder_); - return detail ? detail : vpx_codec_error(&decoder_); - } - - // Passes the external frame buffer information to libvpx. - vpx_codec_err_t SetFrameBufferFunctions( - vpx_get_frame_buffer_cb_fn_t cb_get, - vpx_release_frame_buffer_cb_fn_t cb_release, void *user_priv) { - InitOnce(); - return vpx_codec_set_frame_buffer_functions( - &decoder_, cb_get, cb_release, user_priv); - } - - const char* GetDecoderName() const { - return vpx_codec_iface_name(CodecInterface()); - } - - bool IsVP8() const; - - vpx_codec_ctx_t * GetDecoder() { - return &decoder_; - } - - protected: - virtual vpx_codec_iface_t* CodecInterface() const = 0; - - void InitOnce() { - if (!init_done_) { - const vpx_codec_err_t res = vpx_codec_dec_init(&decoder_, - CodecInterface(), - &cfg_, flags_); - ASSERT_EQ(VPX_CODEC_OK, res) << DecodeError(); - init_done_ = true; - } - } - - vpx_codec_ctx_t decoder_; - vpx_codec_dec_cfg_t cfg_; - vpx_codec_flags_t flags_; - unsigned int deadline_; - bool init_done_; -}; - -// Common test functionality for all Decoder tests. -class DecoderTest { - public: - // Main decoding loop - virtual void RunLoop(CompressedVideoSource *video); - virtual void RunLoop(CompressedVideoSource *video, - const vpx_codec_dec_cfg_t &dec_cfg); - - virtual void set_cfg(const vpx_codec_dec_cfg_t &dec_cfg); - virtual void set_flags(const vpx_codec_flags_t flags); - - // Hook to be called before decompressing every frame. - virtual void PreDecodeFrameHook(const CompressedVideoSource& /*video*/, - Decoder* /*decoder*/) {} - - // Hook to be called to handle decode result. Return true to continue. - virtual bool HandleDecodeResult(const vpx_codec_err_t res_dec, - const CompressedVideoSource& /*video*/, - Decoder *decoder) { - EXPECT_EQ(VPX_CODEC_OK, res_dec) << decoder->DecodeError(); - return VPX_CODEC_OK == res_dec; - } - - // Hook to be called on every decompressed frame. - virtual void DecompressedFrameHook(const vpx_image_t& /*img*/, - const unsigned int /*frame_number*/) {} - - // Hook to be called on peek result - virtual void HandlePeekResult(Decoder* const decoder, - CompressedVideoSource *video, - const vpx_codec_err_t res_peek); - - protected: - explicit DecoderTest(const CodecFactory *codec) - : codec_(codec), - cfg_(), - flags_(0) {} - - virtual ~DecoderTest() {} - - const CodecFactory *codec_; - vpx_codec_dec_cfg_t cfg_; - vpx_codec_flags_t flags_; -}; - -} // namespace libvpx_test - -#endif // TEST_DECODE_TEST_DRIVER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/encode_test_driver.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/encode_test_driver.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/encode_test_driver.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/encode_test_driver.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,265 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef TEST_ENCODE_TEST_DRIVER_H_ -#define TEST_ENCODE_TEST_DRIVER_H_ - -#include -#include - -#include "./vpx_config.h" -#include "third_party/googletest/src/include/gtest/gtest.h" -#include "vpx/vpx_encoder.h" -#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER -#include "vpx/vp8cx.h" -#endif - -namespace libvpx_test { - -class CodecFactory; -class VideoSource; - -enum TestMode { - kRealTime, - kOnePassGood, - kOnePassBest, - kTwoPassGood, - kTwoPassBest -}; -#define ALL_TEST_MODES ::testing::Values(::libvpx_test::kRealTime, \ - ::libvpx_test::kOnePassGood, \ - ::libvpx_test::kOnePassBest, \ - ::libvpx_test::kTwoPassGood, \ - ::libvpx_test::kTwoPassBest) - -#define ONE_PASS_TEST_MODES ::testing::Values(::libvpx_test::kRealTime, \ - ::libvpx_test::kOnePassGood, \ - ::libvpx_test::kOnePassBest) - -#define TWO_PASS_TEST_MODES ::testing::Values(::libvpx_test::kTwoPassGood, \ - ::libvpx_test::kTwoPassBest) - - -// Provides an object to handle the libvpx get_cx_data() iteration pattern -class CxDataIterator { - public: - explicit CxDataIterator(vpx_codec_ctx_t *encoder) - : encoder_(encoder), iter_(NULL) {} - - const vpx_codec_cx_pkt_t *Next() { - return vpx_codec_get_cx_data(encoder_, &iter_); - } - - private: - vpx_codec_ctx_t *encoder_; - vpx_codec_iter_t iter_; -}; - -// Implements an in-memory store for libvpx twopass statistics -class TwopassStatsStore { - public: - void Append(const vpx_codec_cx_pkt_t &pkt) { - buffer_.append(reinterpret_cast(pkt.data.twopass_stats.buf), - pkt.data.twopass_stats.sz); - } - - vpx_fixed_buf_t buf() { - const vpx_fixed_buf_t buf = { &buffer_[0], buffer_.size() }; - return buf; - } - - void Reset() { - buffer_.clear(); - } - - protected: - std::string buffer_; -}; - - -// Provides a simplified interface to manage one video encoding pass, given -// a configuration and video source. -// -// TODO(jkoleszar): The exact services it provides and the appropriate -// level of abstraction will be fleshed out as more tests are written. -class Encoder { - public: - Encoder(vpx_codec_enc_cfg_t cfg, unsigned long deadline, - const unsigned long init_flags, TwopassStatsStore *stats) - : cfg_(cfg), deadline_(deadline), init_flags_(init_flags), stats_(stats) { - memset(&encoder_, 0, sizeof(encoder_)); - } - - virtual ~Encoder() { - vpx_codec_destroy(&encoder_); - } - - CxDataIterator GetCxData() { - return CxDataIterator(&encoder_); - } - - void InitEncoder(VideoSource *video); - - const vpx_image_t *GetPreviewFrame() { - return vpx_codec_get_preview_frame(&encoder_); - } - // This is a thin wrapper around vpx_codec_encode(), so refer to - // vpx_encoder.h for its semantics. - void EncodeFrame(VideoSource *video, const unsigned long frame_flags); - - // Convenience wrapper for EncodeFrame() - void EncodeFrame(VideoSource *video) { - EncodeFrame(video, 0); - } - - void Control(int ctrl_id, int arg) { - const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg); - ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); - } - - void Control(int ctrl_id, struct vpx_scaling_mode *arg) { - const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg); - ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); - } - - void Control(int ctrl_id, struct vpx_svc_layer_id *arg) { - const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg); - ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); - } - -#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER - void Control(int ctrl_id, vpx_active_map_t *arg) { - const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg); - ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); - } -#endif - - void Config(const vpx_codec_enc_cfg_t *cfg) { - const vpx_codec_err_t res = vpx_codec_enc_config_set(&encoder_, cfg); - ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); - cfg_ = *cfg; - } - - void set_deadline(unsigned long deadline) { - deadline_ = deadline; - } - - protected: - virtual vpx_codec_iface_t* CodecInterface() const = 0; - - const char *EncoderError() { - const char *detail = vpx_codec_error_detail(&encoder_); - return detail ? detail : vpx_codec_error(&encoder_); - } - - // Encode an image - void EncodeFrameInternal(const VideoSource &video, - const unsigned long frame_flags); - - // Flush the encoder on EOS - void Flush(); - - vpx_codec_ctx_t encoder_; - vpx_codec_enc_cfg_t cfg_; - unsigned long deadline_; - unsigned long init_flags_; - TwopassStatsStore *stats_; -}; - -// Common test functionality for all Encoder tests. -// -// This class is a mixin which provides the main loop common to all -// encoder tests. It provides hooks which can be overridden by subclasses -// to implement each test's specific behavior, while centralizing the bulk -// of the boilerplate. Note that it doesn't inherit the gtest testing -// classes directly, so that tests can be parameterized differently. -class EncoderTest { - protected: - explicit EncoderTest(const CodecFactory *codec) - : codec_(codec), abort_(false), init_flags_(0), frame_flags_(0), - last_pts_(0) {} - - virtual ~EncoderTest() {} - - // Initialize the cfg_ member with the default configuration. - void InitializeConfig(); - - // Map the TestMode enum to the deadline_ and passes_ variables. - void SetMode(TestMode mode); - - // Set encoder flag. - void set_init_flags(unsigned long flag) { // NOLINT(runtime/int) - init_flags_ = flag; - } - - // Main loop - virtual void RunLoop(VideoSource *video); - - // Hook to be called at the beginning of a pass. - virtual void BeginPassHook(unsigned int /*pass*/) {} - - // Hook to be called at the end of a pass. - virtual void EndPassHook() {} - - // Hook to be called before encoding a frame. - virtual void PreEncodeFrameHook(VideoSource* /*video*/) {} - virtual void PreEncodeFrameHook(VideoSource* /*video*/, - Encoder* /*encoder*/) {} - - // Hook to be called on every compressed data packet. - virtual void FramePktHook(const vpx_codec_cx_pkt_t* /*pkt*/) {} - - // Hook to be called on every PSNR packet. - virtual void PSNRPktHook(const vpx_codec_cx_pkt_t* /*pkt*/) {} - - // Hook to determine whether the encode loop should continue. - virtual bool Continue() const { - return !(::testing::Test::HasFatalFailure() || abort_); - } - - const CodecFactory *codec_; - // Hook to determine whether to decode frame after encoding - virtual bool DoDecode() const { return 1; } - - // Hook to handle encode/decode mismatch - virtual void MismatchHook(const vpx_image_t *img1, - const vpx_image_t *img2); - - // Hook to be called on every decompressed frame. - virtual void DecompressedFrameHook(const vpx_image_t& /*img*/, - vpx_codec_pts_t /*pts*/) {} - - // Hook to be called to handle decode result. Return true to continue. - virtual bool HandleDecodeResult(const vpx_codec_err_t res_dec, - const VideoSource& /*video*/, - Decoder *decoder) { - EXPECT_EQ(VPX_CODEC_OK, res_dec) << decoder->DecodeError(); - return VPX_CODEC_OK == res_dec; - } - - // Hook that can modify the encoder's output data - virtual const vpx_codec_cx_pkt_t *MutateEncoderOutputHook( - const vpx_codec_cx_pkt_t *pkt) { - return pkt; - } - - bool abort_; - vpx_codec_enc_cfg_t cfg_; - vpx_codec_dec_cfg_t dec_cfg_; - unsigned int passes_; - unsigned long deadline_; - TwopassStatsStore stats_; - unsigned long init_flags_; - unsigned long frame_flags_; - vpx_codec_pts_t last_pts_; -}; - -} // namespace libvpx_test - -#endif // TEST_ENCODE_TEST_DRIVER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/i420_video_source.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/i420_video_source.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/i420_video_source.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/i420_video_source.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef TEST_I420_VIDEO_SOURCE_H_ -#define TEST_I420_VIDEO_SOURCE_H_ -#include -#include -#include - -#include "test/yuv_video_source.h" - -namespace libvpx_test { - -// This class extends VideoSource to allow parsing of raw yv12 -// so that we can do actual file encodes. -class I420VideoSource : public YUVVideoSource { - public: - I420VideoSource(const std::string &file_name, - unsigned int width, unsigned int height, - int rate_numerator, int rate_denominator, - unsigned int start, int limit) - : YUVVideoSource(file_name, VPX_IMG_FMT_I420, - width, height, - rate_numerator, rate_denominator, - start, limit) {} -}; - -} // namespace libvpx_test - -#endif // TEST_I420_VIDEO_SOURCE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/ivf_video_source.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/ivf_video_source.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/ivf_video_source.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/ivf_video_source.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef TEST_IVF_VIDEO_SOURCE_H_ -#define TEST_IVF_VIDEO_SOURCE_H_ -#include -#include -#include -#include -#include "test/video_source.h" - -namespace libvpx_test { -const unsigned int kCodeBufferSize = 256 * 1024; -const unsigned int kIvfFileHdrSize = 32; -const unsigned int kIvfFrameHdrSize = 12; - -static unsigned int MemGetLe32(const uint8_t *mem) { - return (mem[3] << 24) | (mem[2] << 16) | (mem[1] << 8) | (mem[0]); -} - -// This class extends VideoSource to allow parsing of ivf files, -// so that we can do actual file decodes. -class IVFVideoSource : public CompressedVideoSource { - public: - explicit IVFVideoSource(const std::string &file_name) - : file_name_(file_name), - input_file_(NULL), - compressed_frame_buf_(NULL), - frame_sz_(0), - frame_(0), - end_of_file_(false) { - } - - virtual ~IVFVideoSource() { - delete[] compressed_frame_buf_; - - if (input_file_) - fclose(input_file_); - } - - virtual void Init() { - // Allocate a buffer for read in the compressed video frame. - compressed_frame_buf_ = new uint8_t[libvpx_test::kCodeBufferSize]; - ASSERT_TRUE(compressed_frame_buf_ != NULL) - << "Allocate frame buffer failed"; - } - - virtual void Begin() { - input_file_ = OpenTestDataFile(file_name_); - ASSERT_TRUE(input_file_ != NULL) << "Input file open failed. Filename: " - << file_name_; - - // Read file header - uint8_t file_hdr[kIvfFileHdrSize]; - ASSERT_EQ(kIvfFileHdrSize, fread(file_hdr, 1, kIvfFileHdrSize, input_file_)) - << "File header read failed."; - // Check file header - ASSERT_TRUE(file_hdr[0] == 'D' && file_hdr[1] == 'K' && file_hdr[2] == 'I' - && file_hdr[3] == 'F') << "Input is not an IVF file."; - - FillFrame(); - } - - virtual void Next() { - ++frame_; - FillFrame(); - } - - void FillFrame() { - ASSERT_TRUE(input_file_ != NULL); - uint8_t frame_hdr[kIvfFrameHdrSize]; - // Check frame header and read a frame from input_file. - if (fread(frame_hdr, 1, kIvfFrameHdrSize, input_file_) - != kIvfFrameHdrSize) { - end_of_file_ = true; - } else { - end_of_file_ = false; - - frame_sz_ = MemGetLe32(frame_hdr); - ASSERT_LE(frame_sz_, kCodeBufferSize) - << "Frame is too big for allocated code buffer"; - ASSERT_EQ(frame_sz_, - fread(compressed_frame_buf_, 1, frame_sz_, input_file_)) - << "Failed to read complete frame"; - } - } - - virtual const uint8_t *cxdata() const { - return end_of_file_ ? NULL : compressed_frame_buf_; - } - virtual size_t frame_size() const { return frame_sz_; } - virtual unsigned int frame_number() const { return frame_; } - - protected: - std::string file_name_; - FILE *input_file_; - uint8_t *compressed_frame_buf_; - size_t frame_sz_; - unsigned int frame_; - bool end_of_file_; -}; - -} // namespace libvpx_test - -#endif // TEST_IVF_VIDEO_SOURCE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/md5_helper.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/md5_helper.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/md5_helper.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/md5_helper.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef TEST_MD5_HELPER_H_ -#define TEST_MD5_HELPER_H_ - -#include "./md5_utils.h" -#include "vpx/vpx_decoder.h" - -namespace libvpx_test { -class MD5 { - public: - MD5() { - MD5Init(&md5_); - } - - void Add(const vpx_image_t *img) { - for (int plane = 0; plane < 3; ++plane) { - const uint8_t *buf = img->planes[plane]; - // Calculate the width and height to do the md5 check. For the chroma - // plane, we never want to round down and thus skip a pixel so if - // we are shifting by 1 (chroma_shift) we add 1 before doing the shift. - // This works only for chroma_shift of 0 and 1. - const int bytes_per_sample = - (img->fmt & VPX_IMG_FMT_HIGHBITDEPTH) ? 2 : 1; - const int h = plane ? (img->d_h + img->y_chroma_shift) >> - img->y_chroma_shift : img->d_h; - const int w = (plane ? (img->d_w + img->x_chroma_shift) >> - img->x_chroma_shift : img->d_w) * bytes_per_sample; - - for (int y = 0; y < h; ++y) { - MD5Update(&md5_, buf, w); - buf += img->stride[plane]; - } - } - } - - const char *Get(void) { - static const char hex[16] = { - '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', - }; - uint8_t tmp[16]; - MD5Context ctx_tmp = md5_; - - MD5Final(tmp, &ctx_tmp); - for (int i = 0; i < 16; i++) { - res_[i * 2 + 0] = hex[tmp[i] >> 4]; - res_[i * 2 + 1] = hex[tmp[i] & 0xf]; - } - res_[32] = 0; - - return res_; - } - - protected: - char res_[33]; - MD5Context md5_; -}; - -} // namespace libvpx_test - -#endif // TEST_MD5_HELPER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/register_state_check.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/register_state_check.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/register_state_check.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/register_state_check.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,196 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef TEST_REGISTER_STATE_CHECK_H_ -#define TEST_REGISTER_STATE_CHECK_H_ - -#include "third_party/googletest/src/include/gtest/gtest.h" -#include "./vpx_config.h" -#include "vpx/vpx_integer.h" - -// ASM_REGISTER_STATE_CHECK(asm_function) -// Minimally validates the environment pre & post function execution. This -// variant should be used with assembly functions which are not expected to -// fully restore the system state. See platform implementations of -// RegisterStateCheck for details. -// -// API_REGISTER_STATE_CHECK(api_function) -// Performs all the checks done by ASM_REGISTER_STATE_CHECK() and any -// additional checks to ensure the environment is in a consistent state pre & -// post function execution. This variant should be used with API functions. -// See platform implementations of RegisterStateCheckXXX for details. -// - -#if defined(_WIN64) - -#define _WIN32_LEAN_AND_MEAN -#include -#include - -namespace testing { -namespace internal { - -inline bool operator==(const M128A& lhs, const M128A& rhs) { - return (lhs.Low == rhs.Low && lhs.High == rhs.High); -} - -} // namespace internal -} // namespace testing - -namespace libvpx_test { - -// Compares the state of xmm[6-15] at construction with their state at -// destruction. These registers should be preserved by the callee on -// Windows x64. -class RegisterStateCheck { - public: - RegisterStateCheck() { initialized_ = StoreRegisters(&pre_context_); } - ~RegisterStateCheck() { EXPECT_TRUE(Check()); } - - private: - static bool StoreRegisters(CONTEXT* const context) { - const HANDLE this_thread = GetCurrentThread(); - EXPECT_TRUE(this_thread != NULL); - context->ContextFlags = CONTEXT_FLOATING_POINT; - const bool context_saved = GetThreadContext(this_thread, context) == TRUE; - EXPECT_TRUE(context_saved) << "GetLastError: " << GetLastError(); - return context_saved; - } - - // Compares the register state. Returns true if the states match. - bool Check() const { - if (!initialized_) return false; - CONTEXT post_context; - if (!StoreRegisters(&post_context)) return false; - - const M128A* xmm_pre = &pre_context_.Xmm6; - const M128A* xmm_post = &post_context.Xmm6; - for (int i = 6; i <= 15; ++i) { - EXPECT_EQ(*xmm_pre, *xmm_post) << "xmm" << i << " has been modified!"; - ++xmm_pre; - ++xmm_post; - } - return !testing::Test::HasNonfatalFailure(); - } - - bool initialized_; - CONTEXT pre_context_; -}; - -#define ASM_REGISTER_STATE_CHECK(statement) do { \ - libvpx_test::RegisterStateCheck reg_check; \ - statement; \ -} while (false) - -} // namespace libvpx_test - -#elif defined(CONFIG_SHARED) && defined(HAVE_NEON_ASM) && defined(CONFIG_VP9) \ - && !CONFIG_SHARED && HAVE_NEON_ASM && CONFIG_VP9 - -extern "C" { -// Save the d8-d15 registers into store. -void vp9_push_neon(int64_t *store); -} - -namespace libvpx_test { - -// Compares the state of d8-d15 at construction with their state at -// destruction. These registers should be preserved by the callee on -// arm platform. -class RegisterStateCheck { - public: - RegisterStateCheck() { initialized_ = StoreRegisters(pre_store_); } - ~RegisterStateCheck() { EXPECT_TRUE(Check()); } - - private: - static bool StoreRegisters(int64_t store[8]) { - vp9_push_neon(store); - return true; - } - - // Compares the register state. Returns true if the states match. - bool Check() const { - if (!initialized_) return false; - int64_t post_store[8]; - vp9_push_neon(post_store); - for (int i = 0; i < 8; ++i) { - EXPECT_EQ(pre_store_[i], post_store[i]) << "d" - << i + 8 << " has been modified"; - } - return !testing::Test::HasNonfatalFailure(); - } - - bool initialized_; - int64_t pre_store_[8]; -}; - -#define ASM_REGISTER_STATE_CHECK(statement) do { \ - libvpx_test::RegisterStateCheck reg_check; \ - statement; \ -} while (false) - -} // namespace libvpx_test - -#else - -namespace libvpx_test { - -class RegisterStateCheck {}; -#define ASM_REGISTER_STATE_CHECK(statement) statement - -} // namespace libvpx_test - -#endif // _WIN64 - -#if ARCH_X86 || ARCH_X86_64 -#if defined(__GNUC__) - -namespace libvpx_test { - -// Checks the FPU tag word pre/post execution to ensure emms has been called. -class RegisterStateCheckMMX { - public: - RegisterStateCheckMMX() { - __asm__ volatile("fstenv %0" : "=rm"(pre_fpu_env_)); - } - ~RegisterStateCheckMMX() { EXPECT_TRUE(Check()); } - - private: - // Checks the FPU tag word pre/post execution, returning false if not cleared - // to 0xffff. - bool Check() const { - EXPECT_EQ(0xffff, pre_fpu_env_[4]) - << "FPU was in an inconsistent state prior to call"; - - uint16_t post_fpu_env[14]; - __asm__ volatile("fstenv %0" : "=rm"(post_fpu_env)); - EXPECT_EQ(0xffff, post_fpu_env[4]) - << "FPU was left in an inconsistent state after call"; - return !testing::Test::HasNonfatalFailure(); - } - - uint16_t pre_fpu_env_[14]; -}; - -#define API_REGISTER_STATE_CHECK(statement) do { \ - libvpx_test::RegisterStateCheckMMX reg_check; \ - ASM_REGISTER_STATE_CHECK(statement); \ -} while (false) - -} // namespace libvpx_test - -#endif // __GNUC__ -#endif // ARCH_X86 || ARCH_X86_64 - -#ifndef API_REGISTER_STATE_CHECK -#define API_REGISTER_STATE_CHECK ASM_REGISTER_STATE_CHECK -#endif - -#endif // TEST_REGISTER_STATE_CHECK_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/test-data.mk gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/test-data.mk --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/test-data.mk 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/test-data.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,769 +0,0 @@ -LIBVPX_TEST_SRCS-yes += test-data.mk - -# Encoder test source -LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += hantro_collage_w352h288.yuv -LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += hantro_odd.yuv - -LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_10_420.y4m -LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_10_422.y4m -LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_10_444.y4m -LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_10_440.yuv -LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_12_420.y4m -LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_12_422.y4m -LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_12_444.y4m -LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_12_440.yuv -LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_420.y4m -LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_422.y4m -LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_444.y4m -LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_440.yuv - -LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += niklas_1280_720_30.y4m -LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += rush_hour_444.y4m -LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += screendata.y4m - -# Test vectors -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-001.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-001.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-002.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-002.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-003.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-003.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-004.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-004.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-005.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-005.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-006.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-006.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-007.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-007.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-008.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-008.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-009.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-009.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-010.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-010.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-011.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-011.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-012.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-012.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-013.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-013.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-014.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-014.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-015.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-015.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-016.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-016.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-017.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-017.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-018.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-018.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1400.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1400.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1411.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1411.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1416.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1416.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1417.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1417.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1402.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1402.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1412.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1412.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1418.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1418.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1424.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1424.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-01.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-01.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-02.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-02.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-03.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-03.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-04.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-04.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1401.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1401.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1403.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1403.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1407.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1407.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1408.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1408.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1409.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1409.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1410.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1410.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1413.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1413.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1414.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1414.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1415.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1415.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1425.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1425.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1426.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1426.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1427.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1427.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1432.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1432.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1435.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1435.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1436.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1436.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1437.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1437.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1441.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1441.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1442.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1442.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-04-partitions-1404.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-04-partitions-1404.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-04-partitions-1405.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-04-partitions-1405.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-04-partitions-1406.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-04-partitions-1406.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1428.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1428.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1429.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1429.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1430.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1430.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1431.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1431.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1433.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1433.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1434.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1434.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1438.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1438.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1439.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1439.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1440.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1440.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1443.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1443.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-06-smallsize.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-06-smallsize.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-00.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-00.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-01.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-01.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-02.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-02.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-03.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-03.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-04.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-04.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-05.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-05.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-06.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-06.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-07.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-07.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-08.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-08.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-09.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-09.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-10.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-10.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-11.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-11.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-12.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-12.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-13.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-13.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-14.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-14.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-15.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-15.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-16.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-16.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-17.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-17.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-18.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-18.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-19.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-19.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-20.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-20.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-21.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-21.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-22.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-22.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-23.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-23.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-24.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-24.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-25.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-25.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-26.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-26.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-27.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-27.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-28.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-28.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-29.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-29.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-30.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-30.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-31.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-31.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-32.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-32.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-33.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-33.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-34.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-34.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-35.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-35.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-36.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-36.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-37.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-37.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-38.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-38.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-39.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-39.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-40.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-40.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-41.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-41.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-42.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-42.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-43.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-43.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-44.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-44.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-45.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-45.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-46.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-46.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-47.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-47.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-48.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-48.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-49.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-49.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-50.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-50.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-51.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-51.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-52.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-52.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-53.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-53.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-54.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-54.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-55.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-55.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-56.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-56.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-57.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-57.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-58.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-58.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-59.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-59.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-60.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-60.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-61.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-61.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-62.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-62.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-63.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-63.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-01-sharpness-1.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-01-sharpness-1.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-01-sharpness-2.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-01-sharpness-2.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-01-sharpness-3.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-01-sharpness-3.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-01-sharpness-4.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-01-sharpness-4.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-01-sharpness-5.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-01-sharpness-5.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-01-sharpness-6.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-01-sharpness-6.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-01-sharpness-7.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-01-sharpness-7.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-08x08.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-08x08.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-08x10.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-08x10.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-08x16.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-08x16.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-08x18.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-08x18.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-08x32.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-08x32.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-08x34.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-08x34.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-08x64.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-08x64.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-08x66.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-08x66.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-10x08.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-10x08.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-10x10.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-10x10.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-10x16.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-10x16.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-10x18.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-10x18.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-10x32.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-10x32.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-10x34.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-10x34.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-10x64.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-10x64.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-10x66.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-10x66.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-16x08.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-16x08.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-16x10.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-16x10.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-16x16.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-16x16.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-16x18.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-16x18.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-16x32.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-16x32.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-16x34.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-16x34.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-16x64.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-16x64.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-16x66.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-16x66.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-18x08.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-18x08.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-18x10.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-18x10.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-18x16.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-18x16.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-18x18.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-18x18.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-18x32.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-18x32.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-18x34.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-18x34.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-18x64.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-18x64.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-18x66.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-18x66.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-32x08.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-32x08.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-32x10.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-32x10.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-32x16.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-32x16.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-32x18.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-32x18.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-32x32.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-32x32.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-32x34.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-32x34.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-32x64.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-32x64.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-32x66.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-32x66.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-34x08.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-34x08.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-34x10.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-34x10.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-34x16.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-34x16.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-34x18.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-34x18.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-34x32.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-34x32.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-34x34.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-34x34.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-34x64.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-34x64.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-34x66.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-34x66.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-64x08.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-64x08.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-64x10.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-64x10.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-64x16.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-64x16.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-64x18.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-64x18.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-64x32.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-64x32.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-64x34.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-64x34.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-64x64.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-64x64.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-64x66.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-64x66.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x08.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x08.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x10.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x10.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x16.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x16.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x18.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x18.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x32.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x32.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x34.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x34.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x64.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x64.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x66.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x66.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-lf-1920x1080.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-lf-1920x1080.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-deltaq.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-deltaq.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x196.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x196.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x198.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x198.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x200.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x200.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x202.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x202.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x208.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x208.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x210.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x210.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x224.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x224.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x226.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x226.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-198x196.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-198x196.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-198x198.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-198x198.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-198x200.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-198x200.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-198x202.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-198x202.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-198x208.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-198x208.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-198x210.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-198x210.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-198x224.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-198x224.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-198x226.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-198x226.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-200x196.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-200x196.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-200x198.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-200x198.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-200x200.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-200x200.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-200x202.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-200x202.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-200x208.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-200x208.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-200x210.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-200x210.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-200x224.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-200x224.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-200x226.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-200x226.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-202x196.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-202x196.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-202x198.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-202x198.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-202x200.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-202x200.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-202x202.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-202x202.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-202x208.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-202x208.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-202x210.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-202x210.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-202x224.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-202x224.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-202x226.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-202x226.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-208x196.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-208x196.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-208x198.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-208x198.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-208x200.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-208x200.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-208x202.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-208x202.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-208x208.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-208x208.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-208x210.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-208x210.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-208x224.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-208x224.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-208x226.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-208x226.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-210x196.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-210x196.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-210x198.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-210x198.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-210x200.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-210x200.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-210x202.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-210x202.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-210x208.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-210x208.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-210x210.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-210x210.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-210x224.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-210x224.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-210x226.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-210x226.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-224x196.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-224x196.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-224x198.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-224x198.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-224x200.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-224x200.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-224x202.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-224x202.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-224x208.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-224x208.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-224x210.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-224x210.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-224x224.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-224x224.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-224x226.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-224x226.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x196.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x196.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x198.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x198.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x200.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x200.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x202.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x202.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x208.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x208.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x210.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x210.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x224.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x224.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x226.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x226.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-05-resize.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-05-resize.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-06-bilinear.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-06-bilinear.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-07-frame_parallel.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-07-frame_parallel.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-07-frame_parallel-1.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-07-frame_parallel-1.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile-4x1.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile-4x1.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile-4x4.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile-4x4.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x2.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x2.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x2_frame_parallel.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x2_frame_parallel.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x4.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x4.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x4_frame_parallel.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x4_frame_parallel.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x8.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x8.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x8_frame_parallel.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x8_frame_parallel.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-09-aq2.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-09-aq2.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-09-lf_deltas.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-09-lf_deltas.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-09-subpixel-00.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-09-subpixel-00.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-10-show-existing-frame.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-10-show-existing-frame.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-10-show-existing-frame2.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-10-show-existing-frame2.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-11-size-351x287.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-11-size-351x287.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-11-size-351x288.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-11-size-351x288.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-11-size-352x287.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-11-size-352x287.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-12-droppable_1.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-12-droppable_1.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-12-droppable_2.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-12-droppable_2.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-12-droppable_3.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-12-droppable_3.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-13-largescaling.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-13-largescaling.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-1-16.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-1-16.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-1-2-4-8-16.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-1-2-4-8-16.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-1-2.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-1-2.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-1-4.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-1-4.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-1-8.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-1-8.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-16-1.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-16-1.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-16-2.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-16-2.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-16-4.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-16-4.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-16-8-4-2-1.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-16-8-4-2-1.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-16-8.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-16-8.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-2-1.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-2-1.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-2-16.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-2-16.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-2-4.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-2-4.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-2-8.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-2-8.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-4-1.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-4-1.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-4-16.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-4-16.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-4-2.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-4-2.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-4-8.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-4-8.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-8-1.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-8-1.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-8-16.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-8-16.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-8-2.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-8-2.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-8-4.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-8-4.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-15-segkey.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-15-segkey.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-15-segkey_adpq.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-15-segkey_adpq.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-16-intra-only.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-16-intra-only.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-17-show-existing-frame.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-17-show-existing-frame.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-18-resize.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-18-resize.ivf.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-19-skip.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-19-skip.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-19-skip-01.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-19-skip-01.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-19-skip-02.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-19-skip-02.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp91-2-04-yuv422.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp91-2-04-yuv422.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp91-2-04-yuv440.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp91-2-04-yuv440.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp91-2-04-yuv444.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp91-2-04-yuv444.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-20-big_superframe-01.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-20-big_superframe-01.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-20-big_superframe-02.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-20-big_superframe-02.webm.md5 -ifeq ($(CONFIG_VP9_HIGHBITDEPTH),yes) -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp92-2-20-10bit-yuv420.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp92-2-20-10bit-yuv420.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp92-2-20-12bit-yuv420.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp92-2-20-12bit-yuv420.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp93-2-20-10bit-yuv422.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp93-2-20-10bit-yuv422.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp93-2-20-12bit-yuv422.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp93-2-20-12bit-yuv422.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp93-2-20-10bit-yuv440.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp93-2-20-10bit-yuv440.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp93-2-20-12bit-yuv440.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp93-2-20-12bit-yuv440.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp93-2-20-10bit-yuv444.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp93-2-20-10bit-yuv444.webm.md5 -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp93-2-20-12bit-yuv444.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp93-2-20-12bit-yuv444.webm.md5 -endif # CONFIG_VP9_HIGHBITDEPTH - -# Invalid files for testing libvpx error checking. -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-01-v2.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-01-v2.webm.res -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-02-v2.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-02-v2.webm.res -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-03-v3.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-03-v3.webm.res -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-00-quantizer-00.webm.ivf.s5861_r01-05_b6-.v2.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-00-quantizer-00.webm.ivf.s5861_r01-05_b6-.v2.ivf.res -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-.ivf.res -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf.res -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-03-size-202x210.webm.ivf.s113306_r01-05_b6-.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-03-size-202x210.webm.ivf.s113306_r01-05_b6-.ivf.res -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-03-size-224x196.webm.ivf.s44156_r01-05_b6-.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-03-size-224x196.webm.ivf.s44156_r01-05_b6-.ivf.res -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-05-resize.ivf.s59293_r01-05_b6-.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-05-resize.ivf.s59293_r01-05_b6-.ivf.res -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-08-tile_1x2_frame_parallel.webm.ivf.s47039_r01-05_b6-.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-08-tile_1x2_frame_parallel.webm.ivf.s47039_r01-05_b6-.ivf.res -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-08-tile_1x8_frame_parallel.webm.ivf.s288_r01-05_b6-.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-08-tile_1x8_frame_parallel.webm.ivf.s288_r01-05_b6-.ivf.res -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-08-tile_1x4_frame_parallel_all_key.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-08-tile_1x4_frame_parallel_all_key.webm.res -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-09-aq2.webm.ivf.s3984_r01-05_b6-.v2.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-09-aq2.webm.ivf.s3984_r01-05_b6-.v2.ivf.res -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-09-subpixel-00.ivf.s19552_r01-05_b6-.v2.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-09-subpixel-00.ivf.s19552_r01-05_b6-.v2.ivf.res -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-09-subpixel-00.ivf.s20492_r01-05_b6-.v2.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-09-subpixel-00.ivf.s20492_r01-05_b6-.v2.ivf.res -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-12-droppable_1.ivf.s3676_r01-05_b6-.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-12-droppable_1.ivf.s3676_r01-05_b6-.ivf.res -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-12-droppable_1.ivf.s73804_r01-05_b6-.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-12-droppable_1.ivf.s73804_r01-05_b6-.ivf.res -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp91-2-mixedrefcsp-444to420.ivf -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp91-2-mixedrefcsp-444to420.ivf.res -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-07-frame_parallel-1.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-07-frame_parallel-2.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-07-frame_parallel-3.webm - -ifeq ($(CONFIG_DECODE_PERF_TESTS),yes) -# Encode / Decode test -LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += niklas_1280_720_30.yuv -# BBB VP9 streams -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_426x240_tile_1x1_180kbps.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_640x360_tile_1x2_337kbps.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_854x480_tile_1x2_651kbps.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_1280x720_tile_1x4_1310kbps.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_1920x1080_tile_1x1_2581kbps.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_1920x1080_tile_1x4_2586kbps.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_1920x1080_tile_1x4_fpm_2304kbps.webm -# Sintel VP9 streams -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-sintel_426x182_tile_1x1_171kbps.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-sintel_640x272_tile_1x2_318kbps.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-sintel_854x364_tile_1x2_621kbps.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-sintel_1280x546_tile_1x4_1257kbps.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-sintel_1920x818_tile_1x4_fpm_2279kbps.webm -# TOS VP9 streams -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-tos_426x178_tile_1x1_181kbps.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-tos_640x266_tile_1x2_336kbps.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-tos_854x356_tile_1x2_656kbps.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-tos_854x356_tile_1x2_fpm_546kbps.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-tos_1280x534_tile_1x4_1306kbps.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-tos_1280x534_tile_1x4_fpm_952kbps.webm -LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-tos_1920x800_tile_1x4_fpm_2335kbps.webm -endif # CONFIG_DECODE_PERF_TESTS - -ifeq ($(CONFIG_ENCODE_PERF_TESTS),yes) -LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += desktop_640_360_30.yuv -LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += kirland_640_480_30.yuv -LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += macmarcomoving_640_480_30.yuv -LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += macmarcostationary_640_480_30.yuv -LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += niklas_1280_720_30.yuv -LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += niklas_640_480_30.yuv -LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += tacomanarrows_640_480_30.yuv -LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += tacomasmallcameramovement_640_480_30.yuv -LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += thaloundeskmtg_640_480_30.yuv -endif # CONFIG_ENCODE_PERF_TESTS - -# sort and remove duplicates -LIBVPX_TEST_DATA-yes := $(sort $(LIBVPX_TEST_DATA-yes)) diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/test.mk gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/test.mk --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/test.mk 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/test.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,165 +0,0 @@ -LIBVPX_TEST_SRCS-yes += acm_random.h -LIBVPX_TEST_SRCS-yes += clear_system_state.h -LIBVPX_TEST_SRCS-yes += codec_factory.h -LIBVPX_TEST_SRCS-yes += md5_helper.h -LIBVPX_TEST_SRCS-yes += register_state_check.h -LIBVPX_TEST_SRCS-yes += test.mk -LIBVPX_TEST_SRCS-yes += test_libvpx.cc -LIBVPX_TEST_SRCS-yes += test_vectors.cc -LIBVPX_TEST_SRCS-yes += test_vectors.h -LIBVPX_TEST_SRCS-yes += util.h -LIBVPX_TEST_SRCS-yes += video_source.h - -## -## BLACK BOX TESTS -## -## Black box tests only use the public API. -## -LIBVPX_TEST_SRCS-yes += ../md5_utils.h ../md5_utils.c -LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ivf_video_source.h -LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += ../y4minput.h ../y4minput.c -LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += aq_segment_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += datarate_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += error_resilience_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += i420_video_source.h -LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += resize_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += y4m_video_source.h -LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += yuv_video_source.h - -LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += altref_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += config_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += cq_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += keyframe_test.cc - -LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER) += byte_alignment_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER) += external_frame_buffer_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER) += invalid_file_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER) += user_priv_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER) += vp9_frame_parallel_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += active_map_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += borders_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += cpu_speed_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += frame_size_tests.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_lossless_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_end_to_end_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_ethread_test.cc - -LIBVPX_TEST_SRCS-yes += decode_test_driver.cc -LIBVPX_TEST_SRCS-yes += decode_test_driver.h -LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += encode_test_driver.cc -LIBVPX_TEST_SRCS-yes += encode_test_driver.h - -## IVF writing. -LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += ../ivfenc.c ../ivfenc.h - -## Y4m parsing. -LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += y4m_test.cc ../y4menc.c ../y4menc.h - -## WebM Parsing -ifeq ($(CONFIG_WEBM_IO), yes) -LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvparser.cpp -LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvreader.cpp -LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvparser.hpp -LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvreader.hpp -LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += $(LIBWEBM_PARSER_SRCS) -LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ../tools_common.h -LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ../webmdec.cc -LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ../webmdec.h -LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += webm_video_source.h -endif - -LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += decode_api_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += test_vector_test.cc - -# Currently we only support decoder perf tests for vp9. Also they read from WebM -# files, so WebM IO is required. -ifeq ($(CONFIG_DECODE_PERF_TESTS)$(CONFIG_VP9_DECODER)$(CONFIG_WEBM_IO), \ - yesyesyes) -LIBVPX_TEST_SRCS-yes += decode_perf_test.cc -endif - -# encode perf tests are vp9 only -ifeq ($(CONFIG_ENCODE_PERF_TESTS)$(CONFIG_VP9_ENCODER), yesyes) -LIBVPX_TEST_SRCS-yes += encode_perf_test.cc -endif - -## -## WHITE BOX TESTS -## -## Whitebox tests invoke functions not exposed via the public API. Certain -## shared library builds don't make these functions accessible. -## -ifeq ($(CONFIG_SHARED),) - -## VP8 -ifneq ($(CONFIG_VP8_ENCODER)$(CONFIG_VP8_DECODER),) - -# These tests require both the encoder and decoder to be built. -ifeq ($(CONFIG_VP8_ENCODER)$(CONFIG_VP8_DECODER),yesyes) -LIBVPX_TEST_SRCS-yes += vp8_boolcoder_test.cc -LIBVPX_TEST_SRCS-yes += vp8_fragments_test.cc -endif - -LIBVPX_TEST_SRCS-$(CONFIG_POSTPROC) += pp_filter_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP8_DECODER) += vp8_decrypt_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += set_roi.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += subtract_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += variance_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += vp8_fdct4x4_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += quantize_test.cc - -LIBVPX_TEST_SRCS-yes += idct_test.cc -LIBVPX_TEST_SRCS-yes += intrapred_test.cc -LIBVPX_TEST_SRCS-yes += sixtap_predict_test.cc -LIBVPX_TEST_SRCS-yes += vpx_scale_test.cc - -ifeq ($(CONFIG_VP8_ENCODER)$(CONFIG_TEMPORAL_DENOISING),yesyes) -LIBVPX_TEST_SRCS-$(HAVE_SSE2) += vp8_denoiser_sse2_test.cc -endif - -endif # VP8 - -## VP9 -ifneq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_DECODER),) - -# These tests require both the encoder and decoder to be built. -ifeq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_DECODER),yesyes) -# IDCT test currently depends on FDCT function -LIBVPX_TEST_SRCS-yes += idct8x8_test.cc -LIBVPX_TEST_SRCS-yes += partial_idct_test.cc -LIBVPX_TEST_SRCS-yes += superframe_test.cc -LIBVPX_TEST_SRCS-yes += tile_independence_test.cc -LIBVPX_TEST_SRCS-yes += vp9_boolcoder_test.cc -LIBVPX_TEST_SRCS-yes += vp9_encoder_parms_get_to_decoder.cc -endif - -LIBVPX_TEST_SRCS-$(CONFIG_VP9) += convolve_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER) += vp9_thread_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER) += vp9_decrypt_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += dct16x16_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += dct32x32_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += fdct4x4_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += fdct8x8_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += variance_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_subtract_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += lpf_8_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_avg_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_error_block_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_quantize_test.cc -LIBVPX_TEST_SRCS-$(CONFIG_VP9) += vp9_intrapred_test.cc - -ifeq ($(CONFIG_VP9_ENCODER),yes) -LIBVPX_TEST_SRCS-$(CONFIG_SPATIAL_SVC) += svc_test.cc -endif - -ifeq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_TEMPORAL_DENOISING),yesyes) -LIBVPX_TEST_SRCS-$(HAVE_SSE2) += vp9_denoiser_sse2_test.cc -endif - -endif # VP9 - -LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += sad_test.cc - -endif # CONFIG_SHARED - -include $(SRC_PATH_BARE)/test/test-data.mk diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/test_vectors.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/test_vectors.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/test_vectors.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/test_vectors.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef TEST_TEST_VECTORS_H_ -#define TEST_TEST_VECTORS_H_ - -#include "./vpx_config.h" - -namespace libvpx_test { - -#if CONFIG_VP8_DECODER -extern const int kNumVP8TestVectors; -extern const char *const kVP8TestVectors[]; -#endif - -#if CONFIG_VP9_DECODER -extern const int kNumVP9TestVectors; -extern const char *const kVP9TestVectors[]; -#endif // CONFIG_VP9_DECODER - -} // namespace libvpx_test - -#endif // TEST_TEST_VECTORS_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/util.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/util.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/util.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/util.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef TEST_UTIL_H_ -#define TEST_UTIL_H_ - -#include -#include -#include "third_party/googletest/src/include/gtest/gtest.h" -#include "vpx/vpx_image.h" - -// Macros -#define GET_PARAM(k) std::tr1::get< k >(GetParam()) - -static double compute_psnr(const vpx_image_t *img1, - const vpx_image_t *img2) { - assert((img1->fmt == img2->fmt) && - (img1->d_w == img2->d_w) && - (img1->d_h == img2->d_h)); - - const unsigned int width_y = img1->d_w; - const unsigned int height_y = img1->d_h; - unsigned int i, j; - - int64_t sqrerr = 0; - for (i = 0; i < height_y; ++i) - for (j = 0; j < width_y; ++j) { - int64_t d = img1->planes[VPX_PLANE_Y][i * img1->stride[VPX_PLANE_Y] + j] - - img2->planes[VPX_PLANE_Y][i * img2->stride[VPX_PLANE_Y] + j]; - sqrerr += d * d; - } - double mse = static_cast(sqrerr) / (width_y * height_y); - double psnr = 100.0; - if (mse > 0.0) { - psnr = 10 * log10(255.0 * 255.0 / mse); - } - return psnr; -} - -#endif // TEST_UTIL_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/video_source.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/video_source.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/video_source.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/video_source.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,267 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef TEST_VIDEO_SOURCE_H_ -#define TEST_VIDEO_SOURCE_H_ - -#if defined(_WIN32) -#include -#endif -#include -#include -#include -#include "test/acm_random.h" -#include "vpx/vpx_encoder.h" - -namespace libvpx_test { - -// Helper macros to ensure LIBVPX_TEST_DATA_PATH is a quoted string. -// These are undefined right below GetDataPath -// NOTE: LIBVPX_TEST_DATA_PATH MUST NOT be a quoted string before -// Stringification or the GetDataPath will fail at runtime -#define TO_STRING(S) #S -#define STRINGIFY(S) TO_STRING(S) - -// A simple function to encapsulate cross platform retrieval of test data path -static std::string GetDataPath() { - const char *const data_path = getenv("LIBVPX_TEST_DATA_PATH"); - if (data_path == NULL) { -#ifdef LIBVPX_TEST_DATA_PATH - // In some environments, we cannot set environment variables - // Instead, we set the data path by using a preprocessor symbol - // which can be set from make files - return STRINGIFY(LIBVPX_TEST_DATA_PATH); -#else - return "."; -#endif - } - return data_path; -} - -// Undefining stringification macros because they are not used elsewhere -#undef TO_STRING -#undef STRINGIFY - -static FILE *OpenTestDataFile(const std::string& file_name) { - const std::string path_to_source = GetDataPath() + "/" + file_name; - return fopen(path_to_source.c_str(), "rb"); -} - -static FILE *GetTempOutFile(std::string *file_name) { - file_name->clear(); -#if defined(_WIN32) - char fname[MAX_PATH]; - char tmppath[MAX_PATH]; - if (GetTempPathA(MAX_PATH, tmppath)) { - // Assume for now that the filename generated is unique per process - if (GetTempFileNameA(tmppath, "lvx", 0, fname)) { - file_name->assign(fname); - return fopen(fname, "wb+"); - } - } - return NULL; -#else - return tmpfile(); -#endif -} - -class TempOutFile { - public: - TempOutFile() { - file_ = GetTempOutFile(&file_name_); - } - ~TempOutFile() { - CloseFile(); - if (!file_name_.empty()) { - EXPECT_EQ(0, remove(file_name_.c_str())); - } - } - FILE *file() { - return file_; - } - const std::string& file_name() { - return file_name_; - } - - protected: - void CloseFile() { - if (file_) { - fclose(file_); - file_ = NULL; - } - } - FILE *file_; - std::string file_name_; -}; - -// Abstract base class for test video sources, which provide a stream of -// vpx_image_t images with associated timestamps and duration. -class VideoSource { - public: - virtual ~VideoSource() {} - - // Prepare the stream for reading, rewind/open as necessary. - virtual void Begin() = 0; - - // Advance the cursor to the next frame - virtual void Next() = 0; - - // Get the current video frame, or NULL on End-Of-Stream. - virtual vpx_image_t *img() const = 0; - - // Get the presentation timestamp of the current frame. - virtual vpx_codec_pts_t pts() const = 0; - - // Get the current frame's duration - virtual unsigned long duration() const = 0; - - // Get the timebase for the stream - virtual vpx_rational_t timebase() const = 0; - - // Get the current frame counter, starting at 0. - virtual unsigned int frame() const = 0; - - // Get the current file limit. - virtual unsigned int limit() const = 0; -}; - - -class DummyVideoSource : public VideoSource { - public: - DummyVideoSource() - : img_(NULL), - limit_(100), - width_(80), - height_(64), - format_(VPX_IMG_FMT_I420) { - ReallocImage(); - } - - virtual ~DummyVideoSource() { vpx_img_free(img_); } - - virtual void Begin() { - frame_ = 0; - FillFrame(); - } - - virtual void Next() { - ++frame_; - FillFrame(); - } - - virtual vpx_image_t *img() const { - return (frame_ < limit_) ? img_ : NULL; - } - - // Models a stream where Timebase = 1/FPS, so pts == frame. - virtual vpx_codec_pts_t pts() const { return frame_; } - - virtual unsigned long duration() const { return 1; } - - virtual vpx_rational_t timebase() const { - const vpx_rational_t t = {1, 30}; - return t; - } - - virtual unsigned int frame() const { return frame_; } - - virtual unsigned int limit() const { return limit_; } - - void set_limit(unsigned int limit) { - limit_ = limit; - } - - void SetSize(unsigned int width, unsigned int height) { - if (width != width_ || height != height_) { - width_ = width; - height_ = height; - ReallocImage(); - } - } - - void SetImageFormat(vpx_img_fmt_t format) { - if (format_ != format) { - format_ = format; - ReallocImage(); - } - } - - protected: - virtual void FillFrame() { if (img_) memset(img_->img_data, 0, raw_sz_); } - - void ReallocImage() { - vpx_img_free(img_); - img_ = vpx_img_alloc(NULL, format_, width_, height_, 32); - raw_sz_ = ((img_->w + 31) & ~31) * img_->h * img_->bps / 8; - } - - vpx_image_t *img_; - size_t raw_sz_; - unsigned int limit_; - unsigned int frame_; - unsigned int width_; - unsigned int height_; - vpx_img_fmt_t format_; -}; - - -class RandomVideoSource : public DummyVideoSource { - public: - RandomVideoSource(int seed = ACMRandom::DeterministicSeed()) - : rnd_(seed), - seed_(seed) { } - - protected: - // Reset the RNG to get a matching stream for the second pass - virtual void Begin() { - frame_ = 0; - rnd_.Reset(seed_); - FillFrame(); - } - - // 15 frames of noise, followed by 15 static frames. Reset to 0 rather - // than holding previous frames to encourage keyframes to be thrown. - virtual void FillFrame() { - if (img_) { - if (frame_ % 30 < 15) - for (size_t i = 0; i < raw_sz_; ++i) - img_->img_data[i] = rnd_.Rand8(); - else - memset(img_->img_data, 0, raw_sz_); - } - } - - ACMRandom rnd_; - int seed_; -}; - -// Abstract base class for test video sources, which provide a stream of -// decompressed images to the decoder. -class CompressedVideoSource { - public: - virtual ~CompressedVideoSource() {} - - virtual void Init() = 0; - - // Prepare the stream for reading, rewind/open as necessary. - virtual void Begin() = 0; - - // Advance the cursor to the next frame - virtual void Next() = 0; - - virtual const uint8_t *cxdata() const = 0; - - virtual size_t frame_size() const = 0; - - virtual unsigned int frame_number() const = 0; -}; - -} // namespace libvpx_test - -#endif // TEST_VIDEO_SOURCE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/webm_video_source.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/webm_video_source.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/webm_video_source.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/webm_video_source.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef TEST_WEBM_VIDEO_SOURCE_H_ -#define TEST_WEBM_VIDEO_SOURCE_H_ -#include -#include -#include -#include -#include -#include "../tools_common.h" -#include "../webmdec.h" -#include "test/video_source.h" - -namespace libvpx_test { - -// This class extends VideoSource to allow parsing of WebM files, -// so that we can do actual file decodes. -class WebMVideoSource : public CompressedVideoSource { - public: - explicit WebMVideoSource(const std::string &file_name) - : file_name_(file_name), - vpx_ctx_(new VpxInputContext()), - webm_ctx_(new WebmInputContext()), - buf_(NULL), - buf_sz_(0), - frame_(0), - end_of_file_(false) { - } - - virtual ~WebMVideoSource() { - if (vpx_ctx_->file != NULL) - fclose(vpx_ctx_->file); - webm_free(webm_ctx_); - delete vpx_ctx_; - delete webm_ctx_; - } - - virtual void Init() { - } - - virtual void Begin() { - vpx_ctx_->file = OpenTestDataFile(file_name_); - ASSERT_TRUE(vpx_ctx_->file != NULL) << "Input file open failed. Filename: " - << file_name_; - - ASSERT_EQ(file_is_webm(webm_ctx_, vpx_ctx_), 1) << "file is not WebM"; - - FillFrame(); - } - - virtual void Next() { - ++frame_; - FillFrame(); - } - - void FillFrame() { - ASSERT_TRUE(vpx_ctx_->file != NULL); - const int status = webm_read_frame(webm_ctx_, &buf_, &buf_sz_, &buf_sz_); - ASSERT_GE(status, 0) << "webm_read_frame failed"; - if (status == 1) { - end_of_file_ = true; - } - } - - void SeekToNextKeyFrame() { - ASSERT_TRUE(vpx_ctx_->file != NULL); - do { - const int status = webm_read_frame(webm_ctx_, &buf_, &buf_sz_, &buf_sz_); - ASSERT_GE(status, 0) << "webm_read_frame failed"; - ++frame_; - if (status == 1) { - end_of_file_ = true; - } - } while (!webm_ctx_->is_key_frame && !end_of_file_); - } - - virtual const uint8_t *cxdata() const { - return end_of_file_ ? NULL : buf_; - } - virtual size_t frame_size() const { return buf_sz_; } - virtual unsigned int frame_number() const { return frame_; } - - protected: - std::string file_name_; - VpxInputContext *vpx_ctx_; - WebmInputContext *webm_ctx_; - uint8_t *buf_; - size_t buf_sz_; - unsigned int frame_; - bool end_of_file_; -}; - -} // namespace libvpx_test - -#endif // TEST_WEBM_VIDEO_SOURCE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/y4m_video_source.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/y4m_video_source.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/y4m_video_source.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/y4m_video_source.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef TEST_Y4M_VIDEO_SOURCE_H_ -#define TEST_Y4M_VIDEO_SOURCE_H_ -#include - -#include "test/video_source.h" -#include "./y4minput.h" - -namespace libvpx_test { - -// This class extends VideoSource to allow parsing of raw yv12 -// so that we can do actual file encodes. -class Y4mVideoSource : public VideoSource { - public: - Y4mVideoSource(const std::string &file_name, - unsigned int start, int limit) - : file_name_(file_name), - input_file_(NULL), - img_(new vpx_image_t()), - start_(start), - limit_(limit), - frame_(0), - framerate_numerator_(0), - framerate_denominator_(0), - y4m_() { - } - - virtual ~Y4mVideoSource() { - vpx_img_free(img_.get()); - CloseSource(); - } - - virtual void OpenSource() { - CloseSource(); - input_file_ = OpenTestDataFile(file_name_); - ASSERT_TRUE(input_file_ != NULL) << "Input file open failed. Filename: " - << file_name_; - } - - virtual void ReadSourceToStart() { - ASSERT_TRUE(input_file_ != NULL); - ASSERT_FALSE(y4m_input_open(&y4m_, input_file_, NULL, 0, 0)); - framerate_numerator_ = y4m_.fps_n; - framerate_denominator_ = y4m_.fps_d; - frame_ = 0; - for (unsigned int i = 0; i < start_; i++) { - Next(); - } - FillFrame(); - } - - virtual void Begin() { - OpenSource(); - ReadSourceToStart(); - } - - virtual void Next() { - ++frame_; - FillFrame(); - } - - virtual vpx_image_t *img() const { - return (frame_ < limit_) ? img_.get() : NULL; - } - - // Models a stream where Timebase = 1/FPS, so pts == frame. - virtual vpx_codec_pts_t pts() const { return frame_; } - - virtual unsigned long duration() const { return 1; } - - virtual vpx_rational_t timebase() const { - const vpx_rational_t t = { framerate_denominator_, framerate_numerator_ }; - return t; - } - - virtual unsigned int frame() const { return frame_; } - - virtual unsigned int limit() const { return limit_; } - - virtual void FillFrame() { - ASSERT_TRUE(input_file_ != NULL); - // Read a frame from input_file. - y4m_input_fetch_frame(&y4m_, input_file_, img_.get()); - } - - protected: - void CloseSource() { - y4m_input_close(&y4m_); - y4m_ = y4m_input(); - if (input_file_ != NULL) { - fclose(input_file_); - input_file_ = NULL; - } - } - - std::string file_name_; - FILE *input_file_; - testing::internal::scoped_ptr img_; - unsigned int start_; - unsigned int limit_; - unsigned int frame_; - int framerate_numerator_; - int framerate_denominator_; - y4m_input y4m_; -}; - -} // namespace libvpx_test - -#endif // TEST_Y4M_VIDEO_SOURCE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/yuv_video_source.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/yuv_video_source.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/test/yuv_video_source.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/test/yuv_video_source.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,151 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef TEST_YUV_VIDEO_SOURCE_H_ -#define TEST_YUV_VIDEO_SOURCE_H_ - -#include -#include -#include - -#include "test/video_source.h" -#include "vpx/vpx_image.h" - -namespace libvpx_test { - -// This class extends VideoSource to allow parsing of raw YUV -// formats of various color sampling and bit-depths so that we can -// do actual file encodes. -class YUVVideoSource : public VideoSource { - public: - YUVVideoSource(const std::string &file_name, vpx_img_fmt format, - unsigned int width, unsigned int height, - int rate_numerator, int rate_denominator, - unsigned int start, int limit) - : file_name_(file_name), - input_file_(NULL), - img_(NULL), - start_(start), - limit_(limit), - frame_(0), - width_(0), - height_(0), - format_(VPX_IMG_FMT_NONE), - framerate_numerator_(rate_numerator), - framerate_denominator_(rate_denominator) { - // This initializes format_, raw_size_, width_, height_ and allocates img. - SetSize(width, height, format); - } - - virtual ~YUVVideoSource() { - vpx_img_free(img_); - if (input_file_) - fclose(input_file_); - } - - virtual void Begin() { - if (input_file_) - fclose(input_file_); - input_file_ = OpenTestDataFile(file_name_); - ASSERT_TRUE(input_file_ != NULL) << "Input file open failed. Filename: " - << file_name_; - if (start_) - fseek(input_file_, static_cast(raw_size_) * start_, SEEK_SET); - - frame_ = start_; - FillFrame(); - } - - virtual void Next() { - ++frame_; - FillFrame(); - } - - virtual vpx_image_t *img() const { return (frame_ < limit_) ? img_ : NULL; } - - // Models a stream where Timebase = 1/FPS, so pts == frame. - virtual vpx_codec_pts_t pts() const { return frame_; } - - virtual unsigned long duration() const { return 1; } - - virtual vpx_rational_t timebase() const { - const vpx_rational_t t = { framerate_denominator_, framerate_numerator_ }; - return t; - } - - virtual unsigned int frame() const { return frame_; } - - virtual unsigned int limit() const { return limit_; } - - virtual void SetSize(unsigned int width, unsigned int height, - vpx_img_fmt format) { - if (width != width_ || height != height_ || format != format_) { - vpx_img_free(img_); - img_ = vpx_img_alloc(NULL, format, width, height, 1); - ASSERT_TRUE(img_ != NULL); - width_ = width; - height_ = height; - format_ = format; - switch (format) { - case VPX_IMG_FMT_I420: - raw_size_ = width * height * 3 / 2; - break; - case VPX_IMG_FMT_I422: - raw_size_ = width * height * 2; - break; - case VPX_IMG_FMT_I440: - raw_size_ = width * height * 2; - break; - case VPX_IMG_FMT_I444: - raw_size_ = width * height * 3; - break; - case VPX_IMG_FMT_I42016: - raw_size_ = width * height * 3; - break; - case VPX_IMG_FMT_I42216: - raw_size_ = width * height * 4; - break; - case VPX_IMG_FMT_I44016: - raw_size_ = width * height * 4; - break; - case VPX_IMG_FMT_I44416: - raw_size_ = width * height * 6; - break; - default: - ASSERT_TRUE(0); - } - } - } - - virtual void FillFrame() { - ASSERT_TRUE(input_file_ != NULL); - // Read a frame from input_file. - if (fread(img_->img_data, raw_size_, 1, input_file_) == 0) { - limit_ = frame_; - } - } - - protected: - std::string file_name_; - FILE *input_file_; - vpx_image_t *img_; - size_t raw_size_; - unsigned int start_; - unsigned int limit_; - unsigned int frame_; - unsigned int width_; - unsigned int height_; - vpx_img_fmt format_; - int framerate_numerator_; - int framerate_denominator_; -}; - -} // namespace libvpx_test - -#endif // TEST_YUV_VIDEO_SOURCE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/googletest/gtest.mk gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/googletest/gtest.mk --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/googletest/gtest.mk 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/googletest/gtest.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -GTEST_SRCS-yes += src/gtest-all.cc diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/googletest/src/include/gtest/gtest.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/googletest/src/include/gtest/gtest.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/googletest/src/include/gtest/gtest.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/googletest/src/include/gtest/gtest.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,20061 +0,0 @@ -// Copyright 2005, Google 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "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 THE COPYRIGHT -// OWNER 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. -// -// Author: wan@google.com (Zhanyong Wan) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file defines the public API for Google Test. It should be -// included by any test program that uses Google Test. -// -// IMPORTANT NOTE: Due to limitation of the C++ language, we have to -// leave some internal implementation details in this header file. -// They are clearly marked by comments like this: -// -// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -// -// Such code is NOT meant to be used by a user directly, and is subject -// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user -// program! -// -// Acknowledgment: Google Test borrowed the idea of automatic test -// registration from Barthelemy Dagenais' (barthelemy@prologique.com) -// easyUnit framework. - -#ifndef GTEST_INCLUDE_GTEST_GTEST_H_ -#define GTEST_INCLUDE_GTEST_GTEST_H_ - -#include -#include -#include - -// Copyright 2005, Google 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "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 THE COPYRIGHT -// OWNER 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. -// -// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file declares functions and macros used internally by -// Google Test. They are subject to change without notice. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_ - -// Copyright 2005, Google 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "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 THE COPYRIGHT -// OWNER 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. -// -// Authors: wan@google.com (Zhanyong Wan) -// -// Low-level types and utilities for porting Google Test to various -// platforms. They are subject to change without notice. DO NOT USE -// THEM IN USER CODE. -// -// This file is fundamental to Google Test. All other Google Test source -// files are expected to #include this. Therefore, it cannot #include -// any other Google Test header. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ - -// The user can define the following macros in the build script to -// control Google Test's behavior. If the user doesn't define a macro -// in this list, Google Test will define it. -// -// GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2) -// is/isn't available. -// GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions -// are enabled. -// GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string -// is/isn't available (some systems define -// ::string, which is different to std::string). -// GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string -// is/isn't available (some systems define -// ::wstring, which is different to std::wstring). -// GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular -// expressions are/aren't available. -// GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that -// is/isn't available. -// GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't -// enabled. -// GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that -// std::wstring does/doesn't work (Google Test can -// be used where std::wstring is unavailable). -// GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple -// is/isn't available. -// GTEST_HAS_SEH - Define it to 1/0 to indicate whether the -// compiler supports Microsoft's "Structured -// Exception Handling". -// GTEST_HAS_STREAM_REDIRECTION -// - Define it to 1/0 to indicate whether the -// platform supports I/O stream redirection using -// dup() and dup2(). -// GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google -// Test's own tr1 tuple implementation should be -// used. Unused when the user sets -// GTEST_HAS_TR1_TUPLE to 0. -// GTEST_LANG_CXX11 - Define it to 1/0 to indicate that Google Test -// is building in C++11/C++98 mode. -// GTEST_LINKED_AS_SHARED_LIBRARY -// - Define to 1 when compiling tests that use -// Google Test as a shared library (known as -// DLL on Windows). -// GTEST_CREATE_SHARED_LIBRARY -// - Define to 1 when compiling Google Test itself -// as a shared library. - -// This header defines the following utilities: -// -// Macros indicating the current platform (defined to 1 if compiled on -// the given platform; otherwise undefined): -// GTEST_OS_AIX - IBM AIX -// GTEST_OS_CYGWIN - Cygwin -// GTEST_OS_HPUX - HP-UX -// GTEST_OS_LINUX - Linux -// GTEST_OS_LINUX_ANDROID - Google Android -// GTEST_OS_MAC - Mac OS X -// GTEST_OS_IOS - iOS -// GTEST_OS_IOS_SIMULATOR - iOS simulator -// GTEST_OS_NACL - Google Native Client (NaCl) -// GTEST_OS_OPENBSD - OpenBSD -// GTEST_OS_QNX - QNX -// GTEST_OS_SOLARIS - Sun Solaris -// GTEST_OS_SYMBIAN - Symbian -// GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile) -// GTEST_OS_WINDOWS_DESKTOP - Windows Desktop -// GTEST_OS_WINDOWS_MINGW - MinGW -// GTEST_OS_WINDOWS_MOBILE - Windows Mobile -// GTEST_OS_ZOS - z/OS -// -// Among the platforms, Cygwin, Linux, Max OS X, and Windows have the -// most stable support. Since core members of the Google Test project -// don't have access to other platforms, support for them may be less -// stable. If you notice any problems on your platform, please notify -// googletestframework@googlegroups.com (patches for fixing them are -// even more welcome!). -// -// Note that it is possible that none of the GTEST_OS_* macros are defined. -// -// Macros indicating available Google Test features (defined to 1 if -// the corresponding feature is supported; otherwise undefined): -// GTEST_HAS_COMBINE - the Combine() function (for value-parameterized -// tests) -// GTEST_HAS_DEATH_TEST - death tests -// GTEST_HAS_PARAM_TEST - value-parameterized tests -// GTEST_HAS_TYPED_TEST - typed tests -// GTEST_HAS_TYPED_TEST_P - type-parameterized tests -// GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with -// GTEST_HAS_POSIX_RE (see above) which users can -// define themselves. -// GTEST_USES_SIMPLE_RE - our own simple regex is used; -// the above two are mutually exclusive. -// GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ(). -// -// Macros for basic C++ coding: -// GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning. -// GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a -// variable don't have to be used. -// GTEST_DISALLOW_ASSIGN_ - disables operator=. -// GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=. -// GTEST_MUST_USE_RESULT_ - declares that a function's result must be used. -// -// Synchronization: -// Mutex, MutexLock, ThreadLocal, GetThreadCount() -// - synchronization primitives. -// GTEST_IS_THREADSAFE - defined to 1 to indicate that the above -// synchronization primitives have real implementations -// and Google Test is thread-safe; or 0 otherwise. -// -// Template meta programming: -// is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only. -// IteratorTraits - partial implementation of std::iterator_traits, which -// is not available in libCstd when compiled with Sun C++. -// -// Smart pointers: -// scoped_ptr - as in TR2. -// -// Regular expressions: -// RE - a simple regular expression class using the POSIX -// Extended Regular Expression syntax on UNIX-like -// platforms, or a reduced regular exception syntax on -// other platforms, including Windows. -// -// Logging: -// GTEST_LOG_() - logs messages at the specified severity level. -// LogToStderr() - directs all log messages to stderr. -// FlushInfoLog() - flushes informational log messages. -// -// Stdout and stderr capturing: -// CaptureStdout() - starts capturing stdout. -// GetCapturedStdout() - stops capturing stdout and returns the captured -// string. -// CaptureStderr() - starts capturing stderr. -// GetCapturedStderr() - stops capturing stderr and returns the captured -// string. -// -// Integer types: -// TypeWithSize - maps an integer to a int type. -// Int32, UInt32, Int64, UInt64, TimeInMillis -// - integers of known sizes. -// BiggestInt - the biggest signed integer type. -// -// Command-line utilities: -// GTEST_FLAG() - references a flag. -// GTEST_DECLARE_*() - declares a flag. -// GTEST_DEFINE_*() - defines a flag. -// GetInjectableArgvs() - returns the command line as a vector of strings. -// -// Environment variable utilities: -// GetEnv() - gets the value of an environment variable. -// BoolFromGTestEnv() - parses a bool environment variable. -// Int32FromGTestEnv() - parses an Int32 environment variable. -// StringFromGTestEnv() - parses a string environment variable. - -#include // for isspace, etc -#include // for ptrdiff_t -#include -#include -#include -#ifndef _WIN32_WCE -# include -# include -#endif // !_WIN32_WCE - -#if defined __APPLE__ -# include -# include -#endif - -#include // NOLINT -#include // NOLINT -#include // NOLINT - -#define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com" -#define GTEST_FLAG_PREFIX_ "gtest_" -#define GTEST_FLAG_PREFIX_DASH_ "gtest-" -#define GTEST_FLAG_PREFIX_UPPER_ "GTEST_" -#define GTEST_NAME_ "Google Test" -#define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/" - -// Determines the version of gcc that is used to compile this. -#ifdef __GNUC__ -// 40302 means version 4.3.2. -# define GTEST_GCC_VER_ \ - (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__) -#endif // __GNUC__ - -// Determines the platform on which Google Test is compiled. -#ifdef __CYGWIN__ -# define GTEST_OS_CYGWIN 1 -#elif defined __SYMBIAN32__ -# define GTEST_OS_SYMBIAN 1 -#elif defined _WIN32 -# define GTEST_OS_WINDOWS 1 -# ifdef _WIN32_WCE -# define GTEST_OS_WINDOWS_MOBILE 1 -# elif defined(__MINGW__) || defined(__MINGW32__) -# define GTEST_OS_WINDOWS_MINGW 1 -# else -# define GTEST_OS_WINDOWS_DESKTOP 1 -# endif // _WIN32_WCE -#elif defined __APPLE__ -# define GTEST_OS_MAC 1 -# if TARGET_OS_IPHONE -# define GTEST_OS_IOS 1 -# if TARGET_IPHONE_SIMULATOR -# define GTEST_OS_IOS_SIMULATOR 1 -# endif -# endif -#elif defined __linux__ -# define GTEST_OS_LINUX 1 -# if defined __ANDROID__ -# define GTEST_OS_LINUX_ANDROID 1 -# endif -#elif defined __MVS__ -# define GTEST_OS_ZOS 1 -#elif defined(__sun) && defined(__SVR4) -# define GTEST_OS_SOLARIS 1 -#elif defined(_AIX) -# define GTEST_OS_AIX 1 -#elif defined(__hpux) -# define GTEST_OS_HPUX 1 -#elif defined __native_client__ -# define GTEST_OS_NACL 1 -#elif defined __OpenBSD__ -# define GTEST_OS_OPENBSD 1 -#elif defined __QNX__ -# define GTEST_OS_QNX 1 -#endif // __CYGWIN__ - -#ifndef GTEST_LANG_CXX11 -// gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when -// -std={c,gnu}++{0x,11} is passed. The C++11 standard specifies a -// value for __cplusplus, and recent versions of clang, gcc, and -// probably other compilers set that too in C++11 mode. -# if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L -// Compiling in at least C++11 mode. -# define GTEST_LANG_CXX11 1 -# else -# define GTEST_LANG_CXX11 0 -# endif -#endif - -// Brings in definitions for functions used in the testing::internal::posix -// namespace (read, write, close, chdir, isatty, stat). We do not currently -// use them on Windows Mobile. -#if !GTEST_OS_WINDOWS -// This assumes that non-Windows OSes provide unistd.h. For OSes where this -// is not the case, we need to include headers that provide the functions -// mentioned above. -# include -# include -#elif !GTEST_OS_WINDOWS_MOBILE -# include -# include -#endif - -#if GTEST_OS_LINUX_ANDROID -// Used to define __ANDROID_API__ matching the target NDK API level. -# include // NOLINT -#endif - -// Defines this to true iff Google Test can use POSIX regular expressions. -#ifndef GTEST_HAS_POSIX_RE -# if GTEST_OS_LINUX_ANDROID -// On Android, is only available starting with Gingerbread. -# define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 9) -# else -# define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS) -# endif -#endif - -#if GTEST_HAS_POSIX_RE - -// On some platforms, needs someone to define size_t, and -// won't compile otherwise. We can #include it here as we already -// included , which is guaranteed to define size_t through -// . -# include // NOLINT - -# define GTEST_USES_POSIX_RE 1 - -#elif GTEST_OS_WINDOWS - -// is not available on Windows. Use our own simple regex -// implementation instead. -# define GTEST_USES_SIMPLE_RE 1 - -#else - -// may not be available on this platform. Use our own -// simple regex implementation instead. -# define GTEST_USES_SIMPLE_RE 1 - -#endif // GTEST_HAS_POSIX_RE - -#ifndef GTEST_HAS_EXCEPTIONS -// The user didn't tell us whether exceptions are enabled, so we need -// to figure it out. -# if defined(_MSC_VER) || defined(__BORLANDC__) -// MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS -// macro to enable exceptions, so we'll do the same. -// Assumes that exceptions are enabled by default. -# ifndef _HAS_EXCEPTIONS -# define _HAS_EXCEPTIONS 1 -# endif // _HAS_EXCEPTIONS -# define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS -# elif defined(__GNUC__) && __EXCEPTIONS -// gcc defines __EXCEPTIONS to 1 iff exceptions are enabled. -# define GTEST_HAS_EXCEPTIONS 1 -# elif defined(__SUNPRO_CC) -// Sun Pro CC supports exceptions. However, there is no compile-time way of -// detecting whether they are enabled or not. Therefore, we assume that -// they are enabled unless the user tells us otherwise. -# define GTEST_HAS_EXCEPTIONS 1 -# elif defined(__IBMCPP__) && __EXCEPTIONS -// xlC defines __EXCEPTIONS to 1 iff exceptions are enabled. -# define GTEST_HAS_EXCEPTIONS 1 -# elif defined(__HP_aCC) -// Exception handling is in effect by default in HP aCC compiler. It has to -// be turned of by +noeh compiler option if desired. -# define GTEST_HAS_EXCEPTIONS 1 -# else -// For other compilers, we assume exceptions are disabled to be -// conservative. -# define GTEST_HAS_EXCEPTIONS 0 -# endif // defined(_MSC_VER) || defined(__BORLANDC__) -#endif // GTEST_HAS_EXCEPTIONS - -#if !defined(GTEST_HAS_STD_STRING) -// Even though we don't use this macro any longer, we keep it in case -// some clients still depend on it. -# define GTEST_HAS_STD_STRING 1 -#elif !GTEST_HAS_STD_STRING -// The user told us that ::std::string isn't available. -# error "Google Test cannot be used where ::std::string isn't available." -#endif // !defined(GTEST_HAS_STD_STRING) - -#ifndef GTEST_HAS_GLOBAL_STRING -// The user didn't tell us whether ::string is available, so we need -// to figure it out. - -# define GTEST_HAS_GLOBAL_STRING 0 - -#endif // GTEST_HAS_GLOBAL_STRING - -#ifndef GTEST_HAS_STD_WSTRING -// The user didn't tell us whether ::std::wstring is available, so we need -// to figure it out. -// TODO(wan@google.com): uses autoconf to detect whether ::std::wstring -// is available. - -// Cygwin 1.7 and below doesn't support ::std::wstring. -// Solaris' libc++ doesn't support it either. Android has -// no support for it at least as recent as Froyo (2.2). -# define GTEST_HAS_STD_WSTRING \ - (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS)) - -#endif // GTEST_HAS_STD_WSTRING - -#ifndef GTEST_HAS_GLOBAL_WSTRING -// The user didn't tell us whether ::wstring is available, so we need -// to figure it out. -# define GTEST_HAS_GLOBAL_WSTRING \ - (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING) -#endif // GTEST_HAS_GLOBAL_WSTRING - -// Determines whether RTTI is available. -#ifndef GTEST_HAS_RTTI -// The user didn't tell us whether RTTI is enabled, so we need to -// figure it out. - -# ifdef _MSC_VER - -# ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled. -# define GTEST_HAS_RTTI 1 -# else -# define GTEST_HAS_RTTI 0 -# endif - -// Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled. -# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302) - -# ifdef __GXX_RTTI -// When building against STLport with the Android NDK and with -// -frtti -fno-exceptions, the build fails at link time with undefined -// references to __cxa_bad_typeid. Note sure if STL or toolchain bug, -// so disable RTTI when detected. -# if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \ - !defined(__EXCEPTIONS) -# define GTEST_HAS_RTTI 0 -# else -# define GTEST_HAS_RTTI 1 -# endif // GTEST_OS_LINUX_ANDROID && __STLPORT_MAJOR && !__EXCEPTIONS -# else -# define GTEST_HAS_RTTI 0 -# endif // __GXX_RTTI - -// Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends -// using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the -// first version with C++ support. -# elif defined(__clang__) - -# define GTEST_HAS_RTTI __has_feature(cxx_rtti) - -// Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if -// both the typeid and dynamic_cast features are present. -# elif defined(__IBMCPP__) && (__IBMCPP__ >= 900) - -# ifdef __RTTI_ALL__ -# define GTEST_HAS_RTTI 1 -# else -# define GTEST_HAS_RTTI 0 -# endif - -# else - -// For all other compilers, we assume RTTI is enabled. -# define GTEST_HAS_RTTI 1 - -# endif // _MSC_VER - -#endif // GTEST_HAS_RTTI - -// It's this header's responsibility to #include when RTTI -// is enabled. -#if GTEST_HAS_RTTI -# include -#endif - -// Determines whether Google Test can use the pthreads library. -#ifndef GTEST_HAS_PTHREAD -// The user didn't tell us explicitly, so we assume pthreads support is -// available on Linux and Mac. -// -// To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0 -// to your compiler flags. -# define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \ - || GTEST_OS_QNX) -#endif // GTEST_HAS_PTHREAD - -#if GTEST_HAS_PTHREAD -// gtest-port.h guarantees to #include when GTEST_HAS_PTHREAD is -// true. -# include // NOLINT - -// For timespec and nanosleep, used below. -# include // NOLINT -#endif - -// Determines whether Google Test can use tr1/tuple. You can define -// this macro to 0 to prevent Google Test from using tuple (any -// feature depending on tuple with be disabled in this mode). -#ifndef GTEST_HAS_TR1_TUPLE -# if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) -// STLport, provided with the Android NDK, has neither or . -# define GTEST_HAS_TR1_TUPLE 0 -# else -// The user didn't tell us not to do it, so we assume it's OK. -# define GTEST_HAS_TR1_TUPLE 1 -# endif -#endif // GTEST_HAS_TR1_TUPLE - -// Determines whether Google Test's own tr1 tuple implementation -// should be used. -#ifndef GTEST_USE_OWN_TR1_TUPLE -// The user didn't tell us, so we need to figure it out. - -// We use our own TR1 tuple if we aren't sure the user has an -// implementation of it already. At this time, libstdc++ 4.0.0+ and -// MSVC 2010 are the only mainstream standard libraries that come -// with a TR1 tuple implementation. NVIDIA's CUDA NVCC compiler -// pretends to be GCC by defining __GNUC__ and friends, but cannot -// compile GCC's tuple implementation. MSVC 2008 (9.0) provides TR1 -// tuple in a 323 MB Feature Pack download, which we cannot assume the -// user has. QNX's QCC compiler is a modified GCC but it doesn't -// support TR1 tuple. libc++ only provides std::tuple, in C++11 mode, -// and it can be used with some compilers that define __GNUC__. -# if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \ - && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) || _MSC_VER >= 1600 -# define GTEST_ENV_HAS_TR1_TUPLE_ 1 -# endif - -// C++11 specifies that provides std::tuple. Use that if gtest is used -// in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6 -// can build with clang but need to use gcc4.2's libstdc++). -# if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325) -# define GTEST_ENV_HAS_STD_TUPLE_ 1 -# endif - -# if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_ -# define GTEST_USE_OWN_TR1_TUPLE 0 -# else -# define GTEST_USE_OWN_TR1_TUPLE 1 -# endif - -#endif // GTEST_USE_OWN_TR1_TUPLE - -// To avoid conditional compilation everywhere, we make it -// gtest-port.h's responsibility to #include the header implementing -// tr1/tuple. -#if GTEST_HAS_TR1_TUPLE - -# if GTEST_USE_OWN_TR1_TUPLE -// This file was GENERATED by command: -// pump.py gtest-tuple.h.pump -// DO NOT EDIT BY HAND!!! - -// Copyright 2009 Google 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "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 THE COPYRIGHT -// OWNER 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. -// -// Author: wan@google.com (Zhanyong Wan) - -// Implements a subset of TR1 tuple needed by Google Test and Google Mock. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ - -#include // For ::std::pair. - -// The compiler used in Symbian has a bug that prevents us from declaring the -// tuple template as a friend (it complains that tuple is redefined). This -// hack bypasses the bug by declaring the members that should otherwise be -// private as public. -// Sun Studio versions < 12 also have the above bug. -#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590) -# define GTEST_DECLARE_TUPLE_AS_FRIEND_ public: -#else -# define GTEST_DECLARE_TUPLE_AS_FRIEND_ \ - template friend class tuple; \ - private: -#endif - -// GTEST_n_TUPLE_(T) is the type of an n-tuple. -#define GTEST_0_TUPLE_(T) tuple<> -#define GTEST_1_TUPLE_(T) tuple -#define GTEST_2_TUPLE_(T) tuple -#define GTEST_3_TUPLE_(T) tuple -#define GTEST_4_TUPLE_(T) tuple -#define GTEST_5_TUPLE_(T) tuple -#define GTEST_6_TUPLE_(T) tuple -#define GTEST_7_TUPLE_(T) tuple -#define GTEST_8_TUPLE_(T) tuple -#define GTEST_9_TUPLE_(T) tuple -#define GTEST_10_TUPLE_(T) tuple - -// GTEST_n_TYPENAMES_(T) declares a list of n typenames. -#define GTEST_0_TYPENAMES_(T) -#define GTEST_1_TYPENAMES_(T) typename T##0 -#define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1 -#define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2 -#define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3 -#define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4 -#define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4, typename T##5 -#define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4, typename T##5, typename T##6 -#define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4, typename T##5, typename T##6, typename T##7 -#define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4, typename T##5, typename T##6, \ - typename T##7, typename T##8 -#define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4, typename T##5, typename T##6, \ - typename T##7, typename T##8, typename T##9 - -// In theory, defining stuff in the ::std namespace is undefined -// behavior. We can do this as we are playing the role of a standard -// library vendor. -namespace std { -namespace tr1 { - -template -class tuple; - -// Anything in namespace gtest_internal is Google Test's INTERNAL -// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code. -namespace gtest_internal { - -// ByRef::type is T if T is a reference; otherwise it's const T&. -template -struct ByRef { typedef const T& type; }; // NOLINT -template -struct ByRef { typedef T& type; }; // NOLINT - -// A handy wrapper for ByRef. -#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef::type - -// AddRef::type is T if T is a reference; otherwise it's T&. This -// is the same as tr1::add_reference::type. -template -struct AddRef { typedef T& type; }; // NOLINT -template -struct AddRef { typedef T& type; }; // NOLINT - -// A handy wrapper for AddRef. -#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef::type - -// A helper for implementing get(). -template class Get; - -// A helper for implementing tuple_element. kIndexValid is true -// iff k < the number of fields in tuple type T. -template -struct TupleElement; - -template -struct TupleElement { - typedef T0 type; -}; - -template -struct TupleElement { - typedef T1 type; -}; - -template -struct TupleElement { - typedef T2 type; -}; - -template -struct TupleElement { - typedef T3 type; -}; - -template -struct TupleElement { - typedef T4 type; -}; - -template -struct TupleElement { - typedef T5 type; -}; - -template -struct TupleElement { - typedef T6 type; -}; - -template -struct TupleElement { - typedef T7 type; -}; - -template -struct TupleElement { - typedef T8 type; -}; - -template -struct TupleElement { - typedef T9 type; -}; - -} // namespace gtest_internal - -template <> -class tuple<> { - public: - tuple() {} - tuple(const tuple& /* t */) {} - tuple& operator=(const tuple& /* t */) { return *this; } -}; - -template -class GTEST_1_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {} - - tuple(const tuple& t) : f0_(t.f0_) {} - - template - tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_1_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) { - f0_ = t.f0_; - return *this; - } - - T0 f0_; -}; - -template -class GTEST_2_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0), - f1_(f1) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {} - - template - tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {} - template - tuple(const ::std::pair& p) : f0_(p.first), f1_(p.second) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_2_TUPLE_(U)& t) { - return CopyFrom(t); - } - template - tuple& operator=(const ::std::pair& p) { - f0_ = p.first; - f1_ = p.second; - return *this; - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - return *this; - } - - T0 f0_; - T1 f1_; -}; - -template -class GTEST_3_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {} - - template - tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_3_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; -}; - -template -class GTEST_4_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2), - f3_(f3) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {} - - template - tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_4_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; -}; - -template -class GTEST_5_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, - GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_) {} - - template - tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_5_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; -}; - -template -class GTEST_6_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, - GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4), - f5_(f5) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_), f5_(t.f5_) {} - - template - tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_6_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - f5_ = t.f5_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; - T5 f5_; -}; - -template -class GTEST_7_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, - GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2), - f3_(f3), f4_(f4), f5_(f5), f6_(f6) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {} - - template - tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_7_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - f5_ = t.f5_; - f6_ = t.f6_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; - T5 f5_; - T6 f6_; -}; - -template -class GTEST_8_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, - GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, - GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4), - f5_(f5), f6_(f6), f7_(f7) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {} - - template - tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_8_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - f5_ = t.f5_; - f6_ = t.f6_; - f7_ = t.f7_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; - T5 f5_; - T6 f6_; - T7 f7_; -}; - -template -class GTEST_9_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, - GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7, - GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4), - f5_(f5), f6_(f6), f7_(f7), f8_(f8) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {} - - template - tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_9_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - f5_ = t.f5_; - f6_ = t.f6_; - f7_ = t.f7_; - f8_ = t.f8_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; - T5 f5_; - T6 f6_; - T7 f7_; - T8 f8_; -}; - -template -class tuple { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(), - f9_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, - GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7, - GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2), - f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {} - - template - tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), - f9_(t.f9_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_10_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - f5_ = t.f5_; - f6_ = t.f6_; - f7_ = t.f7_; - f8_ = t.f8_; - f9_ = t.f9_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; - T5 f5_; - T6 f6_; - T7 f7_; - T8 f8_; - T9 f9_; -}; - -// 6.1.3.2 Tuple creation functions. - -// Known limitations: we don't support passing an -// std::tr1::reference_wrapper to make_tuple(). And we don't -// implement tie(). - -inline tuple<> make_tuple() { return tuple<>(); } - -template -inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) { - return GTEST_1_TUPLE_(T)(f0); -} - -template -inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) { - return GTEST_2_TUPLE_(T)(f0, f1); -} - -template -inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) { - return GTEST_3_TUPLE_(T)(f0, f1, f2); -} - -template -inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3) { - return GTEST_4_TUPLE_(T)(f0, f1, f2, f3); -} - -template -inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4) { - return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4); -} - -template -inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4, const T5& f5) { - return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5); -} - -template -inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4, const T5& f5, const T6& f6) { - return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6); -} - -template -inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) { - return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7); -} - -template -inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7, - const T8& f8) { - return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8); -} - -template -inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7, - const T8& f8, const T9& f9) { - return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9); -} - -// 6.1.3.3 Tuple helper classes. - -template struct tuple_size; - -template -struct tuple_size { - static const int value = 0; -}; - -template -struct tuple_size { - static const int value = 1; -}; - -template -struct tuple_size { - static const int value = 2; -}; - -template -struct tuple_size { - static const int value = 3; -}; - -template -struct tuple_size { - static const int value = 4; -}; - -template -struct tuple_size { - static const int value = 5; -}; - -template -struct tuple_size { - static const int value = 6; -}; - -template -struct tuple_size { - static const int value = 7; -}; - -template -struct tuple_size { - static const int value = 8; -}; - -template -struct tuple_size { - static const int value = 9; -}; - -template -struct tuple_size { - static const int value = 10; -}; - -template -struct tuple_element { - typedef typename gtest_internal::TupleElement< - k < (tuple_size::value), k, Tuple>::type type; -}; - -#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element::type - -// 6.1.3.4 Element access. - -namespace gtest_internal { - -template <> -class Get<0> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple)) - Field(Tuple& t) { return t.f0_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple)) - ConstField(const Tuple& t) { return t.f0_; } -}; - -template <> -class Get<1> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple)) - Field(Tuple& t) { return t.f1_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple)) - ConstField(const Tuple& t) { return t.f1_; } -}; - -template <> -class Get<2> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple)) - Field(Tuple& t) { return t.f2_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple)) - ConstField(const Tuple& t) { return t.f2_; } -}; - -template <> -class Get<3> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple)) - Field(Tuple& t) { return t.f3_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple)) - ConstField(const Tuple& t) { return t.f3_; } -}; - -template <> -class Get<4> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple)) - Field(Tuple& t) { return t.f4_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple)) - ConstField(const Tuple& t) { return t.f4_; } -}; - -template <> -class Get<5> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple)) - Field(Tuple& t) { return t.f5_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple)) - ConstField(const Tuple& t) { return t.f5_; } -}; - -template <> -class Get<6> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple)) - Field(Tuple& t) { return t.f6_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple)) - ConstField(const Tuple& t) { return t.f6_; } -}; - -template <> -class Get<7> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple)) - Field(Tuple& t) { return t.f7_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple)) - ConstField(const Tuple& t) { return t.f7_; } -}; - -template <> -class Get<8> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple)) - Field(Tuple& t) { return t.f8_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple)) - ConstField(const Tuple& t) { return t.f8_; } -}; - -template <> -class Get<9> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple)) - Field(Tuple& t) { return t.f9_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple)) - ConstField(const Tuple& t) { return t.f9_; } -}; - -} // namespace gtest_internal - -template -GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T))) -get(GTEST_10_TUPLE_(T)& t) { - return gtest_internal::Get::Field(t); -} - -template -GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T))) -get(const GTEST_10_TUPLE_(T)& t) { - return gtest_internal::Get::ConstField(t); -} - -// 6.1.3.5 Relational operators - -// We only implement == and !=, as we don't have a need for the rest yet. - -namespace gtest_internal { - -// SameSizeTuplePrefixComparator::Eq(t1, t2) returns true if the -// first k fields of t1 equals the first k fields of t2. -// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if -// k1 != k2. -template -struct SameSizeTuplePrefixComparator; - -template <> -struct SameSizeTuplePrefixComparator<0, 0> { - template - static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) { - return true; - } -}; - -template -struct SameSizeTuplePrefixComparator { - template - static bool Eq(const Tuple1& t1, const Tuple2& t2) { - return SameSizeTuplePrefixComparator::Eq(t1, t2) && - ::std::tr1::get(t1) == ::std::tr1::get(t2); - } -}; - -} // namespace gtest_internal - -template -inline bool operator==(const GTEST_10_TUPLE_(T)& t, - const GTEST_10_TUPLE_(U)& u) { - return gtest_internal::SameSizeTuplePrefixComparator< - tuple_size::value, - tuple_size::value>::Eq(t, u); -} - -template -inline bool operator!=(const GTEST_10_TUPLE_(T)& t, - const GTEST_10_TUPLE_(U)& u) { return !(t == u); } - -// 6.1.4 Pairs. -// Unimplemented. - -} // namespace tr1 -} // namespace std - -#undef GTEST_0_TUPLE_ -#undef GTEST_1_TUPLE_ -#undef GTEST_2_TUPLE_ -#undef GTEST_3_TUPLE_ -#undef GTEST_4_TUPLE_ -#undef GTEST_5_TUPLE_ -#undef GTEST_6_TUPLE_ -#undef GTEST_7_TUPLE_ -#undef GTEST_8_TUPLE_ -#undef GTEST_9_TUPLE_ -#undef GTEST_10_TUPLE_ - -#undef GTEST_0_TYPENAMES_ -#undef GTEST_1_TYPENAMES_ -#undef GTEST_2_TYPENAMES_ -#undef GTEST_3_TYPENAMES_ -#undef GTEST_4_TYPENAMES_ -#undef GTEST_5_TYPENAMES_ -#undef GTEST_6_TYPENAMES_ -#undef GTEST_7_TYPENAMES_ -#undef GTEST_8_TYPENAMES_ -#undef GTEST_9_TYPENAMES_ -#undef GTEST_10_TYPENAMES_ - -#undef GTEST_DECLARE_TUPLE_AS_FRIEND_ -#undef GTEST_BY_REF_ -#undef GTEST_ADD_REF_ -#undef GTEST_TUPLE_ELEMENT_ - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ -# elif GTEST_ENV_HAS_STD_TUPLE_ -# include -// C++11 puts its tuple into the ::std namespace rather than -// ::std::tr1. gtest expects tuple to live in ::std::tr1, so put it there. -// This causes undefined behavior, but supported compilers react in -// the way we intend. -namespace std { -namespace tr1 { -using ::std::get; -using ::std::make_tuple; -using ::std::tuple; -using ::std::tuple_element; -using ::std::tuple_size; -} -} - -# elif GTEST_OS_SYMBIAN - -// On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to -// use STLport's tuple implementation, which unfortunately doesn't -// work as the copy of STLport distributed with Symbian is incomplete. -// By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to -// use its own tuple implementation. -# ifdef BOOST_HAS_TR1_TUPLE -# undef BOOST_HAS_TR1_TUPLE -# endif // BOOST_HAS_TR1_TUPLE - -// This prevents , which defines -// BOOST_HAS_TR1_TUPLE, from being #included by Boost's . -# define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED -# include - -# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000) -// GCC 4.0+ implements tr1/tuple in the header. This does -// not conform to the TR1 spec, which requires the header to be . - -# if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302 -// Until version 4.3.2, gcc has a bug that causes , -// which is #included by , to not compile when RTTI is -// disabled. _TR1_FUNCTIONAL is the header guard for -// . Hence the following #define is a hack to prevent -// from being included. -# define _TR1_FUNCTIONAL 1 -# include -# undef _TR1_FUNCTIONAL // Allows the user to #include - // if he chooses to. -# else -# include // NOLINT -# endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302 - -# else -// If the compiler is not GCC 4.0+, we assume the user is using a -// spec-conforming TR1 implementation. -# include // NOLINT -# endif // GTEST_USE_OWN_TR1_TUPLE - -#endif // GTEST_HAS_TR1_TUPLE - -// Determines whether clone(2) is supported. -// Usually it will only be available on Linux, excluding -// Linux on the Itanium architecture. -// Also see http://linux.die.net/man/2/clone. -#ifndef GTEST_HAS_CLONE -// The user didn't tell us, so we need to figure it out. - -# if GTEST_OS_LINUX && !defined(__ia64__) -# if GTEST_OS_LINUX_ANDROID -// On Android, clone() is only available on ARM starting with Gingerbread. -# if defined(__arm__) && __ANDROID_API__ >= 9 -# define GTEST_HAS_CLONE 1 -# else -# define GTEST_HAS_CLONE 0 -# endif -# else -# define GTEST_HAS_CLONE 1 -# endif -# else -# define GTEST_HAS_CLONE 0 -# endif // GTEST_OS_LINUX && !defined(__ia64__) - -#endif // GTEST_HAS_CLONE - -// Determines whether to support stream redirection. This is used to test -// output correctness and to implement death tests. -#ifndef GTEST_HAS_STREAM_REDIRECTION -// By default, we assume that stream redirection is supported on all -// platforms except known mobile ones. -# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN -# define GTEST_HAS_STREAM_REDIRECTION 0 -# else -# define GTEST_HAS_STREAM_REDIRECTION 1 -# endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN -#endif // GTEST_HAS_STREAM_REDIRECTION - -// Determines whether to support death tests. -// Google Test does not support death tests for VC 7.1 and earlier as -// abort() in a VC 7.1 application compiled as GUI in debug config -// pops up a dialog window that cannot be suppressed programmatically. -#if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \ - (GTEST_OS_MAC && !GTEST_OS_IOS) || GTEST_OS_IOS_SIMULATOR || \ - (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \ - GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \ - GTEST_OS_OPENBSD || GTEST_OS_QNX) -# define GTEST_HAS_DEATH_TEST 1 -# include // NOLINT -#endif - -// We don't support MSVC 7.1 with exceptions disabled now. Therefore -// all the compilers we care about are adequate for supporting -// value-parameterized tests. -#define GTEST_HAS_PARAM_TEST 1 - -// Determines whether to support type-driven tests. - -// Typed tests need and variadic macros, which GCC, VC++ 8.0, -// Sun Pro CC, IBM Visual Age, and HP aCC support. -#if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \ - defined(__IBMCPP__) || defined(__HP_aCC) -# define GTEST_HAS_TYPED_TEST 1 -# define GTEST_HAS_TYPED_TEST_P 1 -#endif - -// Determines whether to support Combine(). This only makes sense when -// value-parameterized tests are enabled. The implementation doesn't -// work on Sun Studio since it doesn't understand templated conversion -// operators. -#if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC) -# define GTEST_HAS_COMBINE 1 -#endif - -// Determines whether the system compiler uses UTF-16 for encoding wide strings. -#define GTEST_WIDE_STRING_USES_UTF16_ \ - (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX) - -// Determines whether test results can be streamed to a socket. -#if GTEST_OS_LINUX -# define GTEST_CAN_STREAM_RESULTS_ 1 -#endif - -// Defines some utility macros. - -// The GNU compiler emits a warning if nested "if" statements are followed by -// an "else" statement and braces are not used to explicitly disambiguate the -// "else" binding. This leads to problems with code like: -// -// if (gate) -// ASSERT_*(condition) << "Some message"; -// -// The "switch (0) case 0:" idiom is used to suppress this. -#ifdef __INTEL_COMPILER -# define GTEST_AMBIGUOUS_ELSE_BLOCKER_ -#else -# define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default: // NOLINT -#endif - -// Use this annotation at the end of a struct/class definition to -// prevent the compiler from optimizing away instances that are never -// used. This is useful when all interesting logic happens inside the -// c'tor and / or d'tor. Example: -// -// struct Foo { -// Foo() { ... } -// } GTEST_ATTRIBUTE_UNUSED_; -// -// Also use it after a variable or parameter declaration to tell the -// compiler the variable/parameter does not have to be used. -#if defined(__GNUC__) && !defined(COMPILER_ICC) -# define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused)) -#else -# define GTEST_ATTRIBUTE_UNUSED_ -#endif - -// A macro to disallow operator= -// This should be used in the private: declarations for a class. -#define GTEST_DISALLOW_ASSIGN_(type)\ - void operator=(type const &) - -// A macro to disallow copy constructor and operator= -// This should be used in the private: declarations for a class. -#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\ - type(type const &);\ - GTEST_DISALLOW_ASSIGN_(type) - -// Tell the compiler to warn about unused return values for functions declared -// with this macro. The macro should be used on function declarations -// following the argument list: -// -// Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_; -#if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC) -# define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result)) -#else -# define GTEST_MUST_USE_RESULT_ -#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC - -// Determine whether the compiler supports Microsoft's Structured Exception -// Handling. This is supported by several Windows compilers but generally -// does not exist on any other system. -#ifndef GTEST_HAS_SEH -// The user didn't tell us, so we need to figure it out. - -# if defined(_MSC_VER) || defined(__BORLANDC__) -// These two compilers are known to support SEH. -# define GTEST_HAS_SEH 1 -# else -// Assume no SEH. -# define GTEST_HAS_SEH 0 -# endif - -#endif // GTEST_HAS_SEH - -#ifdef _MSC_VER - -# if GTEST_LINKED_AS_SHARED_LIBRARY -# define GTEST_API_ __declspec(dllimport) -# elif GTEST_CREATE_SHARED_LIBRARY -# define GTEST_API_ __declspec(dllexport) -# endif - -#endif // _MSC_VER - -#ifndef GTEST_API_ -# define GTEST_API_ -#endif - -#ifdef __GNUC__ -// Ask the compiler to never inline a given function. -# define GTEST_NO_INLINE_ __attribute__((noinline)) -#else -# define GTEST_NO_INLINE_ -#endif - -// _LIBCPP_VERSION is defined by the libc++ library from the LLVM project. -#if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION) -# define GTEST_HAS_CXXABI_H_ 1 -#else -# define GTEST_HAS_CXXABI_H_ 0 -#endif - -namespace testing { - -class Message; - -namespace internal { - -// A secret type that Google Test users don't know about. It has no -// definition on purpose. Therefore it's impossible to create a -// Secret object, which is what we want. -class Secret; - -// The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time -// expression is true. For example, you could use it to verify the -// size of a static array: -// -// GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES, -// content_type_names_incorrect_size); -// -// or to make sure a struct is smaller than a certain size: -// -// GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large); -// -// The second argument to the macro is the name of the variable. If -// the expression is false, most compilers will issue a warning/error -// containing the name of the variable. - -template -struct CompileAssert { -}; - -#define GTEST_COMPILE_ASSERT_(expr, msg) \ - typedef ::testing::internal::CompileAssert<(static_cast(expr))> \ - msg[static_cast(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_ - -// Implementation details of GTEST_COMPILE_ASSERT_: -// -// - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1 -// elements (and thus is invalid) when the expression is false. -// -// - The simpler definition -// -// #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1] -// -// does not work, as gcc supports variable-length arrays whose sizes -// are determined at run-time (this is gcc's extension and not part -// of the C++ standard). As a result, gcc fails to reject the -// following code with the simple definition: -// -// int foo; -// GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is -// // not a compile-time constant. -// -// - By using the type CompileAssert<(bool(expr))>, we ensures that -// expr is a compile-time constant. (Template arguments must be -// determined at compile-time.) -// -// - The outter parentheses in CompileAssert<(bool(expr))> are necessary -// to work around a bug in gcc 3.4.4 and 4.0.1. If we had written -// -// CompileAssert -// -// instead, these compilers will refuse to compile -// -// GTEST_COMPILE_ASSERT_(5 > 0, some_message); -// -// (They seem to think the ">" in "5 > 0" marks the end of the -// template argument list.) -// -// - The array size is (bool(expr) ? 1 : -1), instead of simply -// -// ((expr) ? 1 : -1). -// -// This is to avoid running into a bug in MS VC 7.1, which -// causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1. - -// StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h. -// -// This template is declared, but intentionally undefined. -template -struct StaticAssertTypeEqHelper; - -template -struct StaticAssertTypeEqHelper {}; - -#if GTEST_HAS_GLOBAL_STRING -typedef ::string string; -#else -typedef ::std::string string; -#endif // GTEST_HAS_GLOBAL_STRING - -#if GTEST_HAS_GLOBAL_WSTRING -typedef ::wstring wstring; -#elif GTEST_HAS_STD_WSTRING -typedef ::std::wstring wstring; -#endif // GTEST_HAS_GLOBAL_WSTRING - -// A helper for suppressing warnings on constant condition. It just -// returns 'condition'. -GTEST_API_ bool IsTrue(bool condition); - -// Defines scoped_ptr. - -// This implementation of scoped_ptr is PARTIAL - it only contains -// enough stuff to satisfy Google Test's need. -template -class scoped_ptr { - public: - typedef T element_type; - - explicit scoped_ptr(T* p = NULL) : ptr_(p) {} - ~scoped_ptr() { reset(); } - - T& operator*() const { return *ptr_; } - T* operator->() const { return ptr_; } - T* get() const { return ptr_; } - - T* release() { - T* const ptr = ptr_; - ptr_ = NULL; - return ptr; - } - - void reset(T* p = NULL) { - if (p != ptr_) { - if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type. - delete ptr_; - } - ptr_ = p; - } - } - - private: - T* ptr_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr); -}; - -// Defines RE. - -// A simple C++ wrapper for . It uses the POSIX Extended -// Regular Expression syntax. -class GTEST_API_ RE { - public: - // A copy constructor is required by the Standard to initialize object - // references from r-values. - RE(const RE& other) { Init(other.pattern()); } - - // Constructs an RE from a string. - RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT - -#if GTEST_HAS_GLOBAL_STRING - - RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT - -#endif // GTEST_HAS_GLOBAL_STRING - - RE(const char* regex) { Init(regex); } // NOLINT - ~RE(); - - // Returns the string representation of the regex. - const char* pattern() const { return pattern_; } - - // FullMatch(str, re) returns true iff regular expression re matches - // the entire str. - // PartialMatch(str, re) returns true iff regular expression re - // matches a substring of str (including str itself). - // - // TODO(wan@google.com): make FullMatch() and PartialMatch() work - // when str contains NUL characters. - static bool FullMatch(const ::std::string& str, const RE& re) { - return FullMatch(str.c_str(), re); - } - static bool PartialMatch(const ::std::string& str, const RE& re) { - return PartialMatch(str.c_str(), re); - } - -#if GTEST_HAS_GLOBAL_STRING - - static bool FullMatch(const ::string& str, const RE& re) { - return FullMatch(str.c_str(), re); - } - static bool PartialMatch(const ::string& str, const RE& re) { - return PartialMatch(str.c_str(), re); - } - -#endif // GTEST_HAS_GLOBAL_STRING - - static bool FullMatch(const char* str, const RE& re); - static bool PartialMatch(const char* str, const RE& re); - - private: - void Init(const char* regex); - - // We use a const char* instead of an std::string, as Google Test used to be - // used where std::string is not available. TODO(wan@google.com): change to - // std::string. - const char* pattern_; - bool is_valid_; - -#if GTEST_USES_POSIX_RE - - regex_t full_regex_; // For FullMatch(). - regex_t partial_regex_; // For PartialMatch(). - -#else // GTEST_USES_SIMPLE_RE - - const char* full_pattern_; // For FullMatch(); - -#endif - - GTEST_DISALLOW_ASSIGN_(RE); -}; - -// Formats a source file path and a line number as they would appear -// in an error message from the compiler used to compile this code. -GTEST_API_ ::std::string FormatFileLocation(const char* file, int line); - -// Formats a file location for compiler-independent XML output. -// Although this function is not platform dependent, we put it next to -// FormatFileLocation in order to contrast the two functions. -GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file, - int line); - -// Defines logging utilities: -// GTEST_LOG_(severity) - logs messages at the specified severity level. The -// message itself is streamed into the macro. -// LogToStderr() - directs all log messages to stderr. -// FlushInfoLog() - flushes informational log messages. - -enum GTestLogSeverity { - GTEST_INFO, - GTEST_WARNING, - GTEST_ERROR, - GTEST_FATAL -}; - -// Formats log entry severity, provides a stream object for streaming the -// log message, and terminates the message with a newline when going out of -// scope. -class GTEST_API_ GTestLog { - public: - GTestLog(GTestLogSeverity severity, const char* file, int line); - - // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program. - ~GTestLog(); - - ::std::ostream& GetStream() { return ::std::cerr; } - - private: - const GTestLogSeverity severity_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog); -}; - -#define GTEST_LOG_(severity) \ - ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \ - __FILE__, __LINE__).GetStream() - -inline void LogToStderr() {} -inline void FlushInfoLog() { fflush(NULL); } - -// INTERNAL IMPLEMENTATION - DO NOT USE. -// -// GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition -// is not satisfied. -// Synopsys: -// GTEST_CHECK_(boolean_condition); -// or -// GTEST_CHECK_(boolean_condition) << "Additional message"; -// -// This checks the condition and if the condition is not satisfied -// it prints message about the condition violation, including the -// condition itself, plus additional message streamed into it, if any, -// and then it aborts the program. It aborts the program irrespective of -// whether it is built in the debug mode or not. -#define GTEST_CHECK_(condition) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::IsTrue(condition)) \ - ; \ - else \ - GTEST_LOG_(FATAL) << "Condition " #condition " failed. " - -// An all-mode assert to verify that the given POSIX-style function -// call returns 0 (indicating success). Known limitation: this -// doesn't expand to a balanced 'if' statement, so enclose the macro -// in {} if you need to use it as the only statement in an 'if' -// branch. -#define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ - if (const int gtest_error = (posix_call)) \ - GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ - << gtest_error - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Use ImplicitCast_ as a safe version of static_cast for upcasting in -// the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a -// const Foo*). When you use ImplicitCast_, the compiler checks that -// the cast is safe. Such explicit ImplicitCast_s are necessary in -// surprisingly many situations where C++ demands an exact type match -// instead of an argument type convertable to a target type. -// -// The syntax for using ImplicitCast_ is the same as for static_cast: -// -// ImplicitCast_(expr) -// -// ImplicitCast_ would have been part of the C++ standard library, -// but the proposal was submitted too late. It will probably make -// its way into the language in the future. -// -// This relatively ugly name is intentional. It prevents clashes with -// similar functions users may have (e.g., implicit_cast). The internal -// namespace alone is not enough because the function can be found by ADL. -template -inline To ImplicitCast_(To x) { return x; } - -// When you upcast (that is, cast a pointer from type Foo to type -// SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts -// always succeed. When you downcast (that is, cast a pointer from -// type Foo to type SubclassOfFoo), static_cast<> isn't safe, because -// how do you know the pointer is really of type SubclassOfFoo? It -// could be a bare Foo, or of type DifferentSubclassOfFoo. Thus, -// when you downcast, you should use this macro. In debug mode, we -// use dynamic_cast<> to double-check the downcast is legal (we die -// if it's not). In normal mode, we do the efficient static_cast<> -// instead. Thus, it's important to test in debug mode to make sure -// the cast is legal! -// This is the only place in the code we should use dynamic_cast<>. -// In particular, you SHOULDN'T be using dynamic_cast<> in order to -// do RTTI (eg code like this: -// if (dynamic_cast(foo)) HandleASubclass1Object(foo); -// if (dynamic_cast(foo)) HandleASubclass2Object(foo); -// You should design the code some other way not to need this. -// -// This relatively ugly name is intentional. It prevents clashes with -// similar functions users may have (e.g., down_cast). The internal -// namespace alone is not enough because the function can be found by ADL. -template // use like this: DownCast_(foo); -inline To DownCast_(From* f) { // so we only accept pointers - // Ensures that To is a sub-type of From *. This test is here only - // for compile-time type checking, and has no overhead in an - // optimized build at run-time, as it will be optimized away - // completely. - if (false) { - const To to = NULL; - ::testing::internal::ImplicitCast_(to); - } - -#if GTEST_HAS_RTTI - // RTTI: debug mode only! - GTEST_CHECK_(f == NULL || dynamic_cast(f) != NULL); -#endif - return static_cast(f); -} - -// Downcasts the pointer of type Base to Derived. -// Derived must be a subclass of Base. The parameter MUST -// point to a class of type Derived, not any subclass of it. -// When RTTI is available, the function performs a runtime -// check to enforce this. -template -Derived* CheckedDowncastToActualType(Base* base) { -#if GTEST_HAS_RTTI - GTEST_CHECK_(typeid(*base) == typeid(Derived)); - return dynamic_cast(base); // NOLINT -#else - return static_cast(base); // Poor man's downcast. -#endif -} - -#if GTEST_HAS_STREAM_REDIRECTION - -// Defines the stderr capturer: -// CaptureStdout - starts capturing stdout. -// GetCapturedStdout - stops capturing stdout and returns the captured string. -// CaptureStderr - starts capturing stderr. -// GetCapturedStderr - stops capturing stderr and returns the captured string. -// -GTEST_API_ void CaptureStdout(); -GTEST_API_ std::string GetCapturedStdout(); -GTEST_API_ void CaptureStderr(); -GTEST_API_ std::string GetCapturedStderr(); - -#endif // GTEST_HAS_STREAM_REDIRECTION - - -#if GTEST_HAS_DEATH_TEST - -const ::std::vector& GetInjectableArgvs(); -void SetInjectableArgvs(const ::std::vector* - new_argvs); - -// A copy of all command line arguments. Set by InitGoogleTest(). -extern ::std::vector g_argvs; - -#endif // GTEST_HAS_DEATH_TEST - -// Defines synchronization primitives. - -#if GTEST_HAS_PTHREAD - -// Sleeps for (roughly) n milli-seconds. This function is only for -// testing Google Test's own constructs. Don't use it in user tests, -// either directly or indirectly. -inline void SleepMilliseconds(int n) { - const timespec time = { - 0, // 0 seconds. - n * 1000L * 1000L, // And n ms. - }; - nanosleep(&time, NULL); -} - -// Allows a controller thread to pause execution of newly created -// threads until notified. Instances of this class must be created -// and destroyed in the controller thread. -// -// This class is only for testing Google Test's own constructs. Do not -// use it in user tests, either directly or indirectly. -class Notification { - public: - Notification() : notified_(false) { - GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL)); - } - ~Notification() { - pthread_mutex_destroy(&mutex_); - } - - // Notifies all threads created with this notification to start. Must - // be called from the controller thread. - void Notify() { - pthread_mutex_lock(&mutex_); - notified_ = true; - pthread_mutex_unlock(&mutex_); - } - - // Blocks until the controller thread notifies. Must be called from a test - // thread. - void WaitForNotification() { - for (;;) { - pthread_mutex_lock(&mutex_); - const bool notified = notified_; - pthread_mutex_unlock(&mutex_); - if (notified) - break; - SleepMilliseconds(10); - } - } - - private: - pthread_mutex_t mutex_; - bool notified_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification); -}; - -// As a C-function, ThreadFuncWithCLinkage cannot be templated itself. -// Consequently, it cannot select a correct instantiation of ThreadWithParam -// in order to call its Run(). Introducing ThreadWithParamBase as a -// non-templated base class for ThreadWithParam allows us to bypass this -// problem. -class ThreadWithParamBase { - public: - virtual ~ThreadWithParamBase() {} - virtual void Run() = 0; -}; - -// pthread_create() accepts a pointer to a function type with the C linkage. -// According to the Standard (7.5/1), function types with different linkages -// are different even if they are otherwise identical. Some compilers (for -// example, SunStudio) treat them as different types. Since class methods -// cannot be defined with C-linkage we need to define a free C-function to -// pass into pthread_create(). -extern "C" inline void* ThreadFuncWithCLinkage(void* thread) { - static_cast(thread)->Run(); - return NULL; -} - -// Helper class for testing Google Test's multi-threading constructs. -// To use it, write: -// -// void ThreadFunc(int param) { /* Do things with param */ } -// Notification thread_can_start; -// ... -// // The thread_can_start parameter is optional; you can supply NULL. -// ThreadWithParam thread(&ThreadFunc, 5, &thread_can_start); -// thread_can_start.Notify(); -// -// These classes are only for testing Google Test's own constructs. Do -// not use them in user tests, either directly or indirectly. -template -class ThreadWithParam : public ThreadWithParamBase { - public: - typedef void (*UserThreadFunc)(T); - - ThreadWithParam( - UserThreadFunc func, T param, Notification* thread_can_start) - : func_(func), - param_(param), - thread_can_start_(thread_can_start), - finished_(false) { - ThreadWithParamBase* const base = this; - // The thread can be created only after all fields except thread_ - // have been initialized. - GTEST_CHECK_POSIX_SUCCESS_( - pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base)); - } - ~ThreadWithParam() { Join(); } - - void Join() { - if (!finished_) { - GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0)); - finished_ = true; - } - } - - virtual void Run() { - if (thread_can_start_ != NULL) - thread_can_start_->WaitForNotification(); - func_(param_); - } - - private: - const UserThreadFunc func_; // User-supplied thread function. - const T param_; // User-supplied parameter to the thread function. - // When non-NULL, used to block execution until the controller thread - // notifies. - Notification* const thread_can_start_; - bool finished_; // true iff we know that the thread function has finished. - pthread_t thread_; // The native thread object. - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam); -}; - -// MutexBase and Mutex implement mutex on pthreads-based platforms. They -// are used in conjunction with class MutexLock: -// -// Mutex mutex; -// ... -// MutexLock lock(&mutex); // Acquires the mutex and releases it at the end -// // of the current scope. -// -// MutexBase implements behavior for both statically and dynamically -// allocated mutexes. Do not use MutexBase directly. Instead, write -// the following to define a static mutex: -// -// GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex); -// -// You can forward declare a static mutex like this: -// -// GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex); -// -// To create a dynamic mutex, just define an object of type Mutex. -class MutexBase { - public: - // Acquires this mutex. - void Lock() { - GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_)); - owner_ = pthread_self(); - has_owner_ = true; - } - - // Releases this mutex. - void Unlock() { - // Since the lock is being released the owner_ field should no longer be - // considered valid. We don't protect writing to has_owner_ here, as it's - // the caller's responsibility to ensure that the current thread holds the - // mutex when this is called. - has_owner_ = false; - GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_)); - } - - // Does nothing if the current thread holds the mutex. Otherwise, crashes - // with high probability. - void AssertHeld() const { - GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self())) - << "The current thread is not holding the mutex @" << this; - } - - // A static mutex may be used before main() is entered. It may even - // be used before the dynamic initialization stage. Therefore we - // must be able to initialize a static mutex object at link time. - // This means MutexBase has to be a POD and its member variables - // have to be public. - public: - pthread_mutex_t mutex_; // The underlying pthread mutex. - // has_owner_ indicates whether the owner_ field below contains a valid thread - // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All - // accesses to the owner_ field should be protected by a check of this field. - // An alternative might be to memset() owner_ to all zeros, but there's no - // guarantee that a zero'd pthread_t is necessarily invalid or even different - // from pthread_self(). - bool has_owner_; - pthread_t owner_; // The thread holding the mutex. -}; - -// Forward-declares a static mutex. -# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \ - extern ::testing::internal::MutexBase mutex - -// Defines and statically (i.e. at link time) initializes a static mutex. -// The initialization list here does not explicitly initialize each field, -// instead relying on default initialization for the unspecified fields. In -// particular, the owner_ field (a pthread_t) is not explicitly initialized. -// This allows initialization to work whether pthread_t is a scalar or struct. -// The flag -Wmissing-field-initializers must not be specified for this to work. -# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \ - ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false } - -// The Mutex class can only be used for mutexes created at runtime. It -// shares its API with MutexBase otherwise. -class Mutex : public MutexBase { - public: - Mutex() { - GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL)); - has_owner_ = false; - } - ~Mutex() { - GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_)); - } - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex); -}; - -// We cannot name this class MutexLock as the ctor declaration would -// conflict with a macro named MutexLock, which is defined on some -// platforms. Hence the typedef trick below. -class GTestMutexLock { - public: - explicit GTestMutexLock(MutexBase* mutex) - : mutex_(mutex) { mutex_->Lock(); } - - ~GTestMutexLock() { mutex_->Unlock(); } - - private: - MutexBase* const mutex_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock); -}; - -typedef GTestMutexLock MutexLock; - -// Helpers for ThreadLocal. - -// pthread_key_create() requires DeleteThreadLocalValue() to have -// C-linkage. Therefore it cannot be templatized to access -// ThreadLocal. Hence the need for class -// ThreadLocalValueHolderBase. -class ThreadLocalValueHolderBase { - public: - virtual ~ThreadLocalValueHolderBase() {} -}; - -// Called by pthread to delete thread-local data stored by -// pthread_setspecific(). -extern "C" inline void DeleteThreadLocalValue(void* value_holder) { - delete static_cast(value_holder); -} - -// Implements thread-local storage on pthreads-based systems. -// -// // Thread 1 -// ThreadLocal tl(100); // 100 is the default value for each thread. -// -// // Thread 2 -// tl.set(150); // Changes the value for thread 2 only. -// EXPECT_EQ(150, tl.get()); -// -// // Thread 1 -// EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value. -// tl.set(200); -// EXPECT_EQ(200, tl.get()); -// -// The template type argument T must have a public copy constructor. -// In addition, the default ThreadLocal constructor requires T to have -// a public default constructor. -// -// An object managed for a thread by a ThreadLocal instance is deleted -// when the thread exits. Or, if the ThreadLocal instance dies in -// that thread, when the ThreadLocal dies. It's the user's -// responsibility to ensure that all other threads using a ThreadLocal -// have exited when it dies, or the per-thread objects for those -// threads will not be deleted. -// -// Google Test only uses global ThreadLocal objects. That means they -// will die after main() has returned. Therefore, no per-thread -// object managed by Google Test will be leaked as long as all threads -// using Google Test have exited when main() returns. -template -class ThreadLocal { - public: - ThreadLocal() : key_(CreateKey()), - default_() {} - explicit ThreadLocal(const T& value) : key_(CreateKey()), - default_(value) {} - - ~ThreadLocal() { - // Destroys the managed object for the current thread, if any. - DeleteThreadLocalValue(pthread_getspecific(key_)); - - // Releases resources associated with the key. This will *not* - // delete managed objects for other threads. - GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_)); - } - - T* pointer() { return GetOrCreateValue(); } - const T* pointer() const { return GetOrCreateValue(); } - const T& get() const { return *pointer(); } - void set(const T& value) { *pointer() = value; } - - private: - // Holds a value of type T. - class ValueHolder : public ThreadLocalValueHolderBase { - public: - explicit ValueHolder(const T& value) : value_(value) {} - - T* pointer() { return &value_; } - - private: - T value_; - GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder); - }; - - static pthread_key_t CreateKey() { - pthread_key_t key; - // When a thread exits, DeleteThreadLocalValue() will be called on - // the object managed for that thread. - GTEST_CHECK_POSIX_SUCCESS_( - pthread_key_create(&key, &DeleteThreadLocalValue)); - return key; - } - - T* GetOrCreateValue() const { - ThreadLocalValueHolderBase* const holder = - static_cast(pthread_getspecific(key_)); - if (holder != NULL) { - return CheckedDowncastToActualType(holder)->pointer(); - } - - ValueHolder* const new_holder = new ValueHolder(default_); - ThreadLocalValueHolderBase* const holder_base = new_holder; - GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base)); - return new_holder->pointer(); - } - - // A key pthreads uses for looking up per-thread values. - const pthread_key_t key_; - const T default_; // The default value for each thread. - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal); -}; - -# define GTEST_IS_THREADSAFE 1 - -#else // GTEST_HAS_PTHREAD - -// A dummy implementation of synchronization primitives (mutex, lock, -// and thread-local variable). Necessary for compiling Google Test where -// mutex is not supported - using Google Test in multiple threads is not -// supported on such platforms. - -class Mutex { - public: - Mutex() {} - void Lock() {} - void Unlock() {} - void AssertHeld() const {} -}; - -# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \ - extern ::testing::internal::Mutex mutex - -# define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex - -class GTestMutexLock { - public: - explicit GTestMutexLock(Mutex*) {} // NOLINT -}; - -typedef GTestMutexLock MutexLock; - -template -class ThreadLocal { - public: - ThreadLocal() : value_() {} - explicit ThreadLocal(const T& value) : value_(value) {} - T* pointer() { return &value_; } - const T* pointer() const { return &value_; } - const T& get() const { return value_; } - void set(const T& value) { value_ = value; } - private: - T value_; -}; - -// The above synchronization primitives have dummy implementations. -// Therefore Google Test is not thread-safe. -# define GTEST_IS_THREADSAFE 0 - -#endif // GTEST_HAS_PTHREAD - -// Returns the number of threads running in the process, or 0 to indicate that -// we cannot detect it. -GTEST_API_ size_t GetThreadCount(); - -// Passing non-POD classes through ellipsis (...) crashes the ARM -// compiler and generates a warning in Sun Studio. The Nokia Symbian -// and the IBM XL C/C++ compiler try to instantiate a copy constructor -// for objects passed through ellipsis (...), failing for uncopyable -// objects. We define this to ensure that only POD is passed through -// ellipsis on these systems. -#if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC) -// We lose support for NULL detection where the compiler doesn't like -// passing non-POD classes through ellipsis (...). -# define GTEST_ELLIPSIS_NEEDS_POD_ 1 -#else -# define GTEST_CAN_COMPARE_NULL 1 -#endif - -// The Nokia Symbian and IBM XL C/C++ compilers cannot decide between -// const T& and const T* in a function template. These compilers -// _can_ decide between class template specializations for T and T*, -// so a tr1::type_traits-like is_pointer works. -#if defined(__SYMBIAN32__) || defined(__IBMCPP__) -# define GTEST_NEEDS_IS_POINTER_ 1 -#endif - -template -struct bool_constant { - typedef bool_constant type; - static const bool value = bool_value; -}; -template const bool bool_constant::value; - -typedef bool_constant false_type; -typedef bool_constant true_type; - -template -struct is_pointer : public false_type {}; - -template -struct is_pointer : public true_type {}; - -template -struct IteratorTraits { - typedef typename Iterator::value_type value_type; -}; - -template -struct IteratorTraits { - typedef T value_type; -}; - -template -struct IteratorTraits { - typedef T value_type; -}; - -#if GTEST_OS_WINDOWS -# define GTEST_PATH_SEP_ "\\" -# define GTEST_HAS_ALT_PATH_SEP_ 1 -// The biggest signed integer type the compiler supports. -typedef __int64 BiggestInt; -#else -# define GTEST_PATH_SEP_ "/" -# define GTEST_HAS_ALT_PATH_SEP_ 0 -typedef long long BiggestInt; // NOLINT -#endif // GTEST_OS_WINDOWS - -// Utilities for char. - -// isspace(int ch) and friends accept an unsigned char or EOF. char -// may be signed, depending on the compiler (or compiler flags). -// Therefore we need to cast a char to unsigned char before calling -// isspace(), etc. - -inline bool IsAlpha(char ch) { - return isalpha(static_cast(ch)) != 0; -} -inline bool IsAlNum(char ch) { - return isalnum(static_cast(ch)) != 0; -} -inline bool IsDigit(char ch) { - return isdigit(static_cast(ch)) != 0; -} -inline bool IsLower(char ch) { - return islower(static_cast(ch)) != 0; -} -inline bool IsSpace(char ch) { - return isspace(static_cast(ch)) != 0; -} -inline bool IsUpper(char ch) { - return isupper(static_cast(ch)) != 0; -} -inline bool IsXDigit(char ch) { - return isxdigit(static_cast(ch)) != 0; -} -inline bool IsXDigit(wchar_t ch) { - const unsigned char low_byte = static_cast(ch); - return ch == low_byte && isxdigit(low_byte) != 0; -} - -inline char ToLower(char ch) { - return static_cast(tolower(static_cast(ch))); -} -inline char ToUpper(char ch) { - return static_cast(toupper(static_cast(ch))); -} - -// The testing::internal::posix namespace holds wrappers for common -// POSIX functions. These wrappers hide the differences between -// Windows/MSVC and POSIX systems. Since some compilers define these -// standard functions as macros, the wrapper cannot have the same name -// as the wrapped function. - -namespace posix { - -// Functions with a different name on Windows. - -#if GTEST_OS_WINDOWS - -typedef struct _stat StatStruct; - -# ifdef __BORLANDC__ -inline int IsATTY(int fd) { return isatty(fd); } -inline int StrCaseCmp(const char* s1, const char* s2) { - return stricmp(s1, s2); -} -inline char* StrDup(const char* src) { return strdup(src); } -# else // !__BORLANDC__ -# if GTEST_OS_WINDOWS_MOBILE -inline int IsATTY(int /* fd */) { return 0; } -# else -inline int IsATTY(int fd) { return _isatty(fd); } -# endif // GTEST_OS_WINDOWS_MOBILE -inline int StrCaseCmp(const char* s1, const char* s2) { - return _stricmp(s1, s2); -} -inline char* StrDup(const char* src) { return _strdup(src); } -# endif // __BORLANDC__ - -# if GTEST_OS_WINDOWS_MOBILE -inline int FileNo(FILE* file) { return reinterpret_cast(_fileno(file)); } -// Stat(), RmDir(), and IsDir() are not needed on Windows CE at this -// time and thus not defined there. -# else -inline int FileNo(FILE* file) { return _fileno(file); } -inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); } -inline int RmDir(const char* dir) { return _rmdir(dir); } -inline bool IsDir(const StatStruct& st) { - return (_S_IFDIR & st.st_mode) != 0; -} -# endif // GTEST_OS_WINDOWS_MOBILE - -#else - -typedef struct stat StatStruct; - -inline int FileNo(FILE* file) { return fileno(file); } -inline int IsATTY(int fd) { return isatty(fd); } -inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); } -inline int StrCaseCmp(const char* s1, const char* s2) { - return strcasecmp(s1, s2); -} -inline char* StrDup(const char* src) { return strdup(src); } -inline int RmDir(const char* dir) { return rmdir(dir); } -inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); } - -#endif // GTEST_OS_WINDOWS - -// Functions deprecated by MSVC 8.0. - -#ifdef _MSC_VER -// Temporarily disable warning 4996 (deprecated function). -# pragma warning(push) -# pragma warning(disable:4996) -#endif - -inline const char* StrNCpy(char* dest, const char* src, size_t n) { - return strncpy(dest, src, n); -} - -// ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and -// StrError() aren't needed on Windows CE at this time and thus not -// defined there. - -#if !GTEST_OS_WINDOWS_MOBILE -inline int ChDir(const char* dir) { return chdir(dir); } -#endif -inline FILE* FOpen(const char* path, const char* mode) { - return fopen(path, mode); -} -#if !GTEST_OS_WINDOWS_MOBILE -inline FILE *FReopen(const char* path, const char* mode, FILE* stream) { - return freopen(path, mode, stream); -} -inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); } -#endif -inline int FClose(FILE* fp) { return fclose(fp); } -#if !GTEST_OS_WINDOWS_MOBILE -inline int Read(int fd, void* buf, unsigned int count) { - return static_cast(read(fd, buf, count)); -} -inline int Write(int fd, const void* buf, unsigned int count) { - return static_cast(write(fd, buf, count)); -} -inline int Close(int fd) { return close(fd); } -inline const char* StrError(int errnum) { return strerror(errnum); } -#endif -inline const char* GetEnv(const char* name) { -#if GTEST_OS_WINDOWS_MOBILE - // We are on Windows CE, which has no environment variables. - return NULL; -#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9) - // Environment variables which we programmatically clear will be set to the - // empty string rather than unset (NULL). Handle that case. - const char* const env = getenv(name); - return (env != NULL && env[0] != '\0') ? env : NULL; -#else - return getenv(name); -#endif -} - -#ifdef _MSC_VER -# pragma warning(pop) // Restores the warning state. -#endif - -#if GTEST_OS_WINDOWS_MOBILE -// Windows CE has no C library. The abort() function is used in -// several places in Google Test. This implementation provides a reasonable -// imitation of standard behaviour. -void Abort(); -#else -inline void Abort() { abort(); } -#endif // GTEST_OS_WINDOWS_MOBILE - -} // namespace posix - -// MSVC "deprecates" snprintf and issues warnings wherever it is used. In -// order to avoid these warnings, we need to use _snprintf or _snprintf_s on -// MSVC-based platforms. We map the GTEST_SNPRINTF_ macro to the appropriate -// function in order to achieve that. We use macro definition here because -// snprintf is a variadic function. -#if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE -// MSVC 2005 and above support variadic macros. -# define GTEST_SNPRINTF_(buffer, size, format, ...) \ - _snprintf_s(buffer, size, size, format, __VA_ARGS__) -#elif defined(_MSC_VER) -// Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't -// complain about _snprintf. -# define GTEST_SNPRINTF_ _snprintf -#else -# define GTEST_SNPRINTF_ snprintf -#endif - -// The maximum number a BiggestInt can represent. This definition -// works no matter BiggestInt is represented in one's complement or -// two's complement. -// -// We cannot rely on numeric_limits in STL, as __int64 and long long -// are not part of standard C++ and numeric_limits doesn't need to be -// defined for them. -const BiggestInt kMaxBiggestInt = - ~(static_cast(1) << (8*sizeof(BiggestInt) - 1)); - -// This template class serves as a compile-time function from size to -// type. It maps a size in bytes to a primitive type with that -// size. e.g. -// -// TypeWithSize<4>::UInt -// -// is typedef-ed to be unsigned int (unsigned integer made up of 4 -// bytes). -// -// Such functionality should belong to STL, but I cannot find it -// there. -// -// Google Test uses this class in the implementation of floating-point -// comparison. -// -// For now it only handles UInt (unsigned int) as that's all Google Test -// needs. Other types can be easily added in the future if need -// arises. -template -class TypeWithSize { - public: - // This prevents the user from using TypeWithSize with incorrect - // values of N. - typedef void UInt; -}; - -// The specialization for size 4. -template <> -class TypeWithSize<4> { - public: - // unsigned int has size 4 in both gcc and MSVC. - // - // As base/basictypes.h doesn't compile on Windows, we cannot use - // uint32, uint64, and etc here. - typedef int Int; - typedef unsigned int UInt; -}; - -// The specialization for size 8. -template <> -class TypeWithSize<8> { - public: -#if GTEST_OS_WINDOWS - typedef __int64 Int; - typedef unsigned __int64 UInt; -#else - typedef long long Int; // NOLINT - typedef unsigned long long UInt; // NOLINT -#endif // GTEST_OS_WINDOWS -}; - -// Integer types of known sizes. -typedef TypeWithSize<4>::Int Int32; -typedef TypeWithSize<4>::UInt UInt32; -typedef TypeWithSize<8>::Int Int64; -typedef TypeWithSize<8>::UInt UInt64; -typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds. - -// Utilities for command line flags and environment variables. - -// Macro for referencing flags. -#define GTEST_FLAG(name) FLAGS_gtest_##name - -// Macros for declaring flags. -#define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name) -#define GTEST_DECLARE_int32_(name) \ - GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name) -#define GTEST_DECLARE_string_(name) \ - GTEST_API_ extern ::std::string GTEST_FLAG(name) - -// Macros for defining flags. -#define GTEST_DEFINE_bool_(name, default_val, doc) \ - GTEST_API_ bool GTEST_FLAG(name) = (default_val) -#define GTEST_DEFINE_int32_(name, default_val, doc) \ - GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val) -#define GTEST_DEFINE_string_(name, default_val, doc) \ - GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val) - -// Thread annotations -#define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks) -#define GTEST_LOCK_EXCLUDED_(locks) - -// Parses 'str' for a 32-bit signed integer. If successful, writes the result -// to *value and returns true; otherwise leaves *value unchanged and returns -// false. -// TODO(chandlerc): Find a better way to refactor flag and environment parsing -// out of both gtest-port.cc and gtest.cc to avoid exporting this utility -// function. -bool ParseInt32(const Message& src_text, const char* str, Int32* value); - -// Parses a bool/Int32/string from the environment variable -// corresponding to the given Google Test flag. -bool BoolFromGTestEnv(const char* flag, bool default_val); -GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val); -const char* StringFromGTestEnv(const char* flag, const char* default_val); - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ - -#if GTEST_OS_LINUX -# include -# include -# include -# include -#endif // GTEST_OS_LINUX - -#if GTEST_HAS_EXCEPTIONS -# include -#endif - -#include -#include -#include -#include -#include -#include - -// Copyright 2005, Google 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "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 THE COPYRIGHT -// OWNER 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. -// -// Author: wan@google.com (Zhanyong Wan) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file defines the Message class. -// -// IMPORTANT NOTE: Due to limitation of the C++ language, we have to -// leave some internal implementation details in this header file. -// They are clearly marked by comments like this: -// -// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -// -// Such code is NOT meant to be used by a user directly, and is subject -// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user -// program! - -#ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ -#define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ - -#include - - -// Ensures that there is at least one operator<< in the global namespace. -// See Message& operator<<(...) below for why. -void operator<<(const testing::internal::Secret&, int); - -namespace testing { - -// The Message class works like an ostream repeater. -// -// Typical usage: -// -// 1. You stream a bunch of values to a Message object. -// It will remember the text in a stringstream. -// 2. Then you stream the Message object to an ostream. -// This causes the text in the Message to be streamed -// to the ostream. -// -// For example; -// -// testing::Message foo; -// foo << 1 << " != " << 2; -// std::cout << foo; -// -// will print "1 != 2". -// -// Message is not intended to be inherited from. In particular, its -// destructor is not virtual. -// -// Note that stringstream behaves differently in gcc and in MSVC. You -// can stream a NULL char pointer to it in the former, but not in the -// latter (it causes an access violation if you do). The Message -// class hides this difference by treating a NULL char pointer as -// "(null)". -class GTEST_API_ Message { - private: - // The type of basic IO manipulators (endl, ends, and flush) for - // narrow streams. - typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&); - - public: - // Constructs an empty Message. - Message(); - - // Copy constructor. - Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT - *ss_ << msg.GetString(); - } - - // Constructs a Message from a C-string. - explicit Message(const char* str) : ss_(new ::std::stringstream) { - *ss_ << str; - } - -#if GTEST_OS_SYMBIAN - // Streams a value (either a pointer or not) to this object. - template - inline Message& operator <<(const T& value) { - StreamHelper(typename internal::is_pointer::type(), value); - return *this; - } -#else - // Streams a non-pointer value to this object. - template - inline Message& operator <<(const T& val) { - // Some libraries overload << for STL containers. These - // overloads are defined in the global namespace instead of ::std. - // - // C++'s symbol lookup rule (i.e. Koenig lookup) says that these - // overloads are visible in either the std namespace or the global - // namespace, but not other namespaces, including the testing - // namespace which Google Test's Message class is in. - // - // To allow STL containers (and other types that has a << operator - // defined in the global namespace) to be used in Google Test - // assertions, testing::Message must access the custom << operator - // from the global namespace. With this using declaration, - // overloads of << defined in the global namespace and those - // visible via Koenig lookup are both exposed in this function. - using ::operator <<; - *ss_ << val; - return *this; - } - - // Streams a pointer value to this object. - // - // This function is an overload of the previous one. When you - // stream a pointer to a Message, this definition will be used as it - // is more specialized. (The C++ Standard, section - // [temp.func.order].) If you stream a non-pointer, then the - // previous definition will be used. - // - // The reason for this overload is that streaming a NULL pointer to - // ostream is undefined behavior. Depending on the compiler, you - // may get "0", "(nil)", "(null)", or an access violation. To - // ensure consistent result across compilers, we always treat NULL - // as "(null)". - template - inline Message& operator <<(T* const& pointer) { // NOLINT - if (pointer == NULL) { - *ss_ << "(null)"; - } else { - *ss_ << pointer; - } - return *this; - } -#endif // GTEST_OS_SYMBIAN - - // Since the basic IO manipulators are overloaded for both narrow - // and wide streams, we have to provide this specialized definition - // of operator <<, even though its body is the same as the - // templatized version above. Without this definition, streaming - // endl or other basic IO manipulators to Message will confuse the - // compiler. - Message& operator <<(BasicNarrowIoManip val) { - *ss_ << val; - return *this; - } - - // Instead of 1/0, we want to see true/false for bool values. - Message& operator <<(bool b) { - return *this << (b ? "true" : "false"); - } - - // These two overloads allow streaming a wide C string to a Message - // using the UTF-8 encoding. - Message& operator <<(const wchar_t* wide_c_str); - Message& operator <<(wchar_t* wide_c_str); - -#if GTEST_HAS_STD_WSTRING - // Converts the given wide string to a narrow string using the UTF-8 - // encoding, and streams the result to this Message object. - Message& operator <<(const ::std::wstring& wstr); -#endif // GTEST_HAS_STD_WSTRING - -#if GTEST_HAS_GLOBAL_WSTRING - // Converts the given wide string to a narrow string using the UTF-8 - // encoding, and streams the result to this Message object. - Message& operator <<(const ::wstring& wstr); -#endif // GTEST_HAS_GLOBAL_WSTRING - - // Gets the text streamed to this object so far as an std::string. - // Each '\0' character in the buffer is replaced with "\\0". - // - // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. - std::string GetString() const; - - private: - -#if GTEST_OS_SYMBIAN - // These are needed as the Nokia Symbian Compiler cannot decide between - // const T& and const T* in a function template. The Nokia compiler _can_ - // decide between class template specializations for T and T*, so a - // tr1::type_traits-like is_pointer works, and we can overload on that. - template - inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) { - if (pointer == NULL) { - *ss_ << "(null)"; - } else { - *ss_ << pointer; - } - } - template - inline void StreamHelper(internal::false_type /*is_pointer*/, - const T& value) { - // See the comments in Message& operator <<(const T&) above for why - // we need this using statement. - using ::operator <<; - *ss_ << value; - } -#endif // GTEST_OS_SYMBIAN - - // We'll hold the text streamed to this object here. - const internal::scoped_ptr< ::std::stringstream> ss_; - - // We declare (but don't implement) this to prevent the compiler - // from implementing the assignment operator. - void operator=(const Message&); -}; - -// Streams a Message to an ostream. -inline std::ostream& operator <<(std::ostream& os, const Message& sb) { - return os << sb.GetString(); -} - -namespace internal { - -// Converts a streamable value to an std::string. A NULL pointer is -// converted to "(null)". When the input value is a ::string, -// ::std::string, ::wstring, or ::std::wstring object, each NUL -// character in it is replaced with "\\0". -template -std::string StreamableToString(const T& streamable) { - return (Message() << streamable).GetString(); -} - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ -// Copyright 2005, Google 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "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 THE COPYRIGHT -// OWNER 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. -// -// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file declares the String class and functions used internally by -// Google Test. They are subject to change without notice. They should not used -// by code external to Google Test. -// -// This header file is #included by . -// It should not be #included by other files. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_ - -#ifdef __BORLANDC__ -// string.h is not guaranteed to provide strcpy on C++ Builder. -# include -#endif - -#include -#include - - -namespace testing { -namespace internal { - -// String - an abstract class holding static string utilities. -class GTEST_API_ String { - public: - // Static utility methods - - // Clones a 0-terminated C string, allocating memory using new. The - // caller is responsible for deleting the return value using - // delete[]. Returns the cloned string, or NULL if the input is - // NULL. - // - // This is different from strdup() in string.h, which allocates - // memory using malloc(). - static const char* CloneCString(const char* c_str); - -#if GTEST_OS_WINDOWS_MOBILE - // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be - // able to pass strings to Win32 APIs on CE we need to convert them - // to 'Unicode', UTF-16. - - // Creates a UTF-16 wide string from the given ANSI string, allocating - // memory using new. The caller is responsible for deleting the return - // value using delete[]. Returns the wide string, or NULL if the - // input is NULL. - // - // The wide string is created using the ANSI codepage (CP_ACP) to - // match the behaviour of the ANSI versions of Win32 calls and the - // C runtime. - static LPCWSTR AnsiToUtf16(const char* c_str); - - // Creates an ANSI string from the given wide string, allocating - // memory using new. The caller is responsible for deleting the return - // value using delete[]. Returns the ANSI string, or NULL if the - // input is NULL. - // - // The returned string is created using the ANSI codepage (CP_ACP) to - // match the behaviour of the ANSI versions of Win32 calls and the - // C runtime. - static const char* Utf16ToAnsi(LPCWSTR utf16_str); -#endif - - // Compares two C strings. Returns true iff they have the same content. - // - // Unlike strcmp(), this function can handle NULL argument(s). A - // NULL C string is considered different to any non-NULL C string, - // including the empty string. - static bool CStringEquals(const char* lhs, const char* rhs); - - // Converts a wide C string to a String using the UTF-8 encoding. - // NULL will be converted to "(null)". If an error occurred during - // the conversion, "(failed to convert from wide string)" is - // returned. - static std::string ShowWideCString(const wchar_t* wide_c_str); - - // Compares two wide C strings. Returns true iff they have the same - // content. - // - // Unlike wcscmp(), this function can handle NULL argument(s). A - // NULL C string is considered different to any non-NULL C string, - // including the empty string. - static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); - - // Compares two C strings, ignoring case. Returns true iff they - // have the same content. - // - // Unlike strcasecmp(), this function can handle NULL argument(s). - // A NULL C string is considered different to any non-NULL C string, - // including the empty string. - static bool CaseInsensitiveCStringEquals(const char* lhs, - const char* rhs); - - // Compares two wide C strings, ignoring case. Returns true iff they - // have the same content. - // - // Unlike wcscasecmp(), this function can handle NULL argument(s). - // A NULL C string is considered different to any non-NULL wide C string, - // including the empty string. - // NB: The implementations on different platforms slightly differ. - // On windows, this method uses _wcsicmp which compares according to LC_CTYPE - // environment variable. On GNU platform this method uses wcscasecmp - // which compares according to LC_CTYPE category of the current locale. - // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the - // current locale. - static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, - const wchar_t* rhs); - - // Returns true iff the given string ends with the given suffix, ignoring - // case. Any string is considered to end with an empty suffix. - static bool EndsWithCaseInsensitive( - const std::string& str, const std::string& suffix); - - // Formats an int value as "%02d". - static std::string FormatIntWidth2(int value); // "%02d" for width == 2 - - // Formats an int value as "%X". - static std::string FormatHexInt(int value); - - // Formats a byte as "%02X". - static std::string FormatByte(unsigned char value); - - private: - String(); // Not meant to be instantiated. -}; // class String - -// Gets the content of the stringstream's buffer as an std::string. Each '\0' -// character in the buffer is replaced with "\\0". -GTEST_API_ std::string StringStreamToString(::std::stringstream* stream); - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_ -// Copyright 2008, Google 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "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 THE COPYRIGHT -// OWNER 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. -// -// Author: keith.ray@gmail.com (Keith Ray) -// -// Google Test filepath utilities -// -// This header file declares classes and functions used internally by -// Google Test. They are subject to change without notice. -// -// This file is #included in . -// Do not include this header file separately! - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ - - -namespace testing { -namespace internal { - -// FilePath - a class for file and directory pathname manipulation which -// handles platform-specific conventions (like the pathname separator). -// Used for helper functions for naming files in a directory for xml output. -// Except for Set methods, all methods are const or static, which provides an -// "immutable value object" -- useful for peace of mind. -// A FilePath with a value ending in a path separator ("like/this/") represents -// a directory, otherwise it is assumed to represent a file. In either case, -// it may or may not represent an actual file or directory in the file system. -// Names are NOT checked for syntax correctness -- no checking for illegal -// characters, malformed paths, etc. - -class GTEST_API_ FilePath { - public: - FilePath() : pathname_("") { } - FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { } - - explicit FilePath(const std::string& pathname) : pathname_(pathname) { - Normalize(); - } - - FilePath& operator=(const FilePath& rhs) { - Set(rhs); - return *this; - } - - void Set(const FilePath& rhs) { - pathname_ = rhs.pathname_; - } - - const std::string& string() const { return pathname_; } - const char* c_str() const { return pathname_.c_str(); } - - // Returns the current working directory, or "" if unsuccessful. - static FilePath GetCurrentDir(); - - // Given directory = "dir", base_name = "test", number = 0, - // extension = "xml", returns "dir/test.xml". If number is greater - // than zero (e.g., 12), returns "dir/test_12.xml". - // On Windows platform, uses \ as the separator rather than /. - static FilePath MakeFileName(const FilePath& directory, - const FilePath& base_name, - int number, - const char* extension); - - // Given directory = "dir", relative_path = "test.xml", - // returns "dir/test.xml". - // On Windows, uses \ as the separator rather than /. - static FilePath ConcatPaths(const FilePath& directory, - const FilePath& relative_path); - - // Returns a pathname for a file that does not currently exist. The pathname - // will be directory/base_name.extension or - // directory/base_name_.extension if directory/base_name.extension - // already exists. The number will be incremented until a pathname is found - // that does not already exist. - // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. - // There could be a race condition if two or more processes are calling this - // function at the same time -- they could both pick the same filename. - static FilePath GenerateUniqueFileName(const FilePath& directory, - const FilePath& base_name, - const char* extension); - - // Returns true iff the path is "". - bool IsEmpty() const { return pathname_.empty(); } - - // If input name has a trailing separator character, removes it and returns - // the name, otherwise return the name string unmodified. - // On Windows platform, uses \ as the separator, other platforms use /. - FilePath RemoveTrailingPathSeparator() const; - - // Returns a copy of the FilePath with the directory part removed. - // Example: FilePath("path/to/file").RemoveDirectoryName() returns - // FilePath("file"). If there is no directory part ("just_a_file"), it returns - // the FilePath unmodified. If there is no file part ("just_a_dir/") it - // returns an empty FilePath (""). - // On Windows platform, '\' is the path separator, otherwise it is '/'. - FilePath RemoveDirectoryName() const; - - // RemoveFileName returns the directory path with the filename removed. - // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/". - // If the FilePath is "a_file" or "/a_file", RemoveFileName returns - // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does - // not have a file, like "just/a/dir/", it returns the FilePath unmodified. - // On Windows platform, '\' is the path separator, otherwise it is '/'. - FilePath RemoveFileName() const; - - // Returns a copy of the FilePath with the case-insensitive extension removed. - // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns - // FilePath("dir/file"). If a case-insensitive extension is not - // found, returns a copy of the original FilePath. - FilePath RemoveExtension(const char* extension) const; - - // Creates directories so that path exists. Returns true if successful or if - // the directories already exist; returns false if unable to create - // directories for any reason. Will also return false if the FilePath does - // not represent a directory (that is, it doesn't end with a path separator). - bool CreateDirectoriesRecursively() const; - - // Create the directory so that path exists. Returns true if successful or - // if the directory already exists; returns false if unable to create the - // directory for any reason, including if the parent directory does not - // exist. Not named "CreateDirectory" because that's a macro on Windows. - bool CreateFolder() const; - - // Returns true if FilePath describes something in the file-system, - // either a file, directory, or whatever, and that something exists. - bool FileOrDirectoryExists() const; - - // Returns true if pathname describes a directory in the file-system - // that exists. - bool DirectoryExists() const; - - // Returns true if FilePath ends with a path separator, which indicates that - // it is intended to represent a directory. Returns false otherwise. - // This does NOT check that a directory (or file) actually exists. - bool IsDirectory() const; - - // Returns true if pathname describes a root directory. (Windows has one - // root directory per disk drive.) - bool IsRootDirectory() const; - - // Returns true if pathname describes an absolute path. - bool IsAbsolutePath() const; - - private: - // Replaces multiple consecutive separators with a single separator. - // For example, "bar///foo" becomes "bar/foo". Does not eliminate other - // redundancies that might be in a pathname involving "." or "..". - // - // A pathname with multiple consecutive separators may occur either through - // user error or as a result of some scripts or APIs that generate a pathname - // with a trailing separator. On other platforms the same API or script - // may NOT generate a pathname with a trailing "/". Then elsewhere that - // pathname may have another "/" and pathname components added to it, - // without checking for the separator already being there. - // The script language and operating system may allow paths like "foo//bar" - // but some of the functions in FilePath will not handle that correctly. In - // particular, RemoveTrailingPathSeparator() only removes one separator, and - // it is called in CreateDirectoriesRecursively() assuming that it will change - // a pathname from directory syntax (trailing separator) to filename syntax. - // - // On Windows this method also replaces the alternate path separator '/' with - // the primary path separator '\\', so that for example "bar\\/\\foo" becomes - // "bar\\foo". - - void Normalize(); - - // Returns a pointer to the last occurence of a valid path separator in - // the FilePath. On Windows, for example, both '/' and '\' are valid path - // separators. Returns NULL if no path separator was found. - const char* FindLastPathSeparator() const; - - std::string pathname_; -}; // class FilePath - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ -// This file was GENERATED by command: -// pump.py gtest-type-util.h.pump -// DO NOT EDIT BY HAND!!! - -// Copyright 2008 Google 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "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 THE COPYRIGHT -// OWNER 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. -// -// Author: wan@google.com (Zhanyong Wan) - -// Type utilities needed for implementing typed and type-parameterized -// tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND! -// -// Currently we support at most 50 types in a list, and at most 50 -// type-parameterized tests in one type-parameterized test case. -// Please contact googletestframework@googlegroups.com if you need -// more. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ - - -// #ifdef __GNUC__ is too general here. It is possible to use gcc without using -// libstdc++ (which is where cxxabi.h comes from). -# if GTEST_HAS_CXXABI_H_ -# include -# elif defined(__HP_aCC) -# include -# endif // GTEST_HASH_CXXABI_H_ - -namespace testing { -namespace internal { - -// GetTypeName() returns a human-readable name of type T. -// NB: This function is also used in Google Mock, so don't move it inside of -// the typed-test-only section below. -template -std::string GetTypeName() { -# if GTEST_HAS_RTTI - - const char* const name = typeid(T).name(); -# if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC) - int status = 0; - // gcc's implementation of typeid(T).name() mangles the type name, - // so we have to demangle it. -# if GTEST_HAS_CXXABI_H_ - using abi::__cxa_demangle; -# endif // GTEST_HAS_CXXABI_H_ - char* const readable_name = __cxa_demangle(name, 0, 0, &status); - const std::string name_str(status == 0 ? readable_name : name); - free(readable_name); - return name_str; -# else - return name; -# endif // GTEST_HAS_CXXABI_H_ || __HP_aCC - -# else - - return ""; - -# endif // GTEST_HAS_RTTI -} - -#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - -// AssertyTypeEq::type is defined iff T1 and T2 are the same -// type. This can be used as a compile-time assertion to ensure that -// two types are equal. - -template -struct AssertTypeEq; - -template -struct AssertTypeEq { - typedef bool type; -}; - -// A unique type used as the default value for the arguments of class -// template Types. This allows us to simulate variadic templates -// (e.g. Types, Type, and etc), which C++ doesn't -// support directly. -struct None {}; - -// The following family of struct and struct templates are used to -// represent type lists. In particular, TypesN -// represents a type list with N types (T1, T2, ..., and TN) in it. -// Except for Types0, every struct in the family has two member types: -// Head for the first type in the list, and Tail for the rest of the -// list. - -// The empty type list. -struct Types0 {}; - -// Type lists of length 1, 2, 3, and so on. - -template -struct Types1 { - typedef T1 Head; - typedef Types0 Tail; -}; -template -struct Types2 { - typedef T1 Head; - typedef Types1 Tail; -}; - -template -struct Types3 { - typedef T1 Head; - typedef Types2 Tail; -}; - -template -struct Types4 { - typedef T1 Head; - typedef Types3 Tail; -}; - -template -struct Types5 { - typedef T1 Head; - typedef Types4 Tail; -}; - -template -struct Types6 { - typedef T1 Head; - typedef Types5 Tail; -}; - -template -struct Types7 { - typedef T1 Head; - typedef Types6 Tail; -}; - -template -struct Types8 { - typedef T1 Head; - typedef Types7 Tail; -}; - -template -struct Types9 { - typedef T1 Head; - typedef Types8 Tail; -}; - -template -struct Types10 { - typedef T1 Head; - typedef Types9 Tail; -}; - -template -struct Types11 { - typedef T1 Head; - typedef Types10 Tail; -}; - -template -struct Types12 { - typedef T1 Head; - typedef Types11 Tail; -}; - -template -struct Types13 { - typedef T1 Head; - typedef Types12 Tail; -}; - -template -struct Types14 { - typedef T1 Head; - typedef Types13 Tail; -}; - -template -struct Types15 { - typedef T1 Head; - typedef Types14 Tail; -}; - -template -struct Types16 { - typedef T1 Head; - typedef Types15 Tail; -}; - -template -struct Types17 { - typedef T1 Head; - typedef Types16 Tail; -}; - -template -struct Types18 { - typedef T1 Head; - typedef Types17 Tail; -}; - -template -struct Types19 { - typedef T1 Head; - typedef Types18 Tail; -}; - -template -struct Types20 { - typedef T1 Head; - typedef Types19 Tail; -}; - -template -struct Types21 { - typedef T1 Head; - typedef Types20 Tail; -}; - -template -struct Types22 { - typedef T1 Head; - typedef Types21 Tail; -}; - -template -struct Types23 { - typedef T1 Head; - typedef Types22 Tail; -}; - -template -struct Types24 { - typedef T1 Head; - typedef Types23 Tail; -}; - -template -struct Types25 { - typedef T1 Head; - typedef Types24 Tail; -}; - -template -struct Types26 { - typedef T1 Head; - typedef Types25 Tail; -}; - -template -struct Types27 { - typedef T1 Head; - typedef Types26 Tail; -}; - -template -struct Types28 { - typedef T1 Head; - typedef Types27 Tail; -}; - -template -struct Types29 { - typedef T1 Head; - typedef Types28 Tail; -}; - -template -struct Types30 { - typedef T1 Head; - typedef Types29 Tail; -}; - -template -struct Types31 { - typedef T1 Head; - typedef Types30 Tail; -}; - -template -struct Types32 { - typedef T1 Head; - typedef Types31 Tail; -}; - -template -struct Types33 { - typedef T1 Head; - typedef Types32 Tail; -}; - -template -struct Types34 { - typedef T1 Head; - typedef Types33 Tail; -}; - -template -struct Types35 { - typedef T1 Head; - typedef Types34 Tail; -}; - -template -struct Types36 { - typedef T1 Head; - typedef Types35 Tail; -}; - -template -struct Types37 { - typedef T1 Head; - typedef Types36 Tail; -}; - -template -struct Types38 { - typedef T1 Head; - typedef Types37 Tail; -}; - -template -struct Types39 { - typedef T1 Head; - typedef Types38 Tail; -}; - -template -struct Types40 { - typedef T1 Head; - typedef Types39 Tail; -}; - -template -struct Types41 { - typedef T1 Head; - typedef Types40 Tail; -}; - -template -struct Types42 { - typedef T1 Head; - typedef Types41 Tail; -}; - -template -struct Types43 { - typedef T1 Head; - typedef Types42 Tail; -}; - -template -struct Types44 { - typedef T1 Head; - typedef Types43 Tail; -}; - -template -struct Types45 { - typedef T1 Head; - typedef Types44 Tail; -}; - -template -struct Types46 { - typedef T1 Head; - typedef Types45 Tail; -}; - -template -struct Types47 { - typedef T1 Head; - typedef Types46 Tail; -}; - -template -struct Types48 { - typedef T1 Head; - typedef Types47 Tail; -}; - -template -struct Types49 { - typedef T1 Head; - typedef Types48 Tail; -}; - -template -struct Types50 { - typedef T1 Head; - typedef Types49 Tail; -}; - - -} // namespace internal - -// We don't want to require the users to write TypesN<...> directly, -// as that would require them to count the length. Types<...> is much -// easier to write, but generates horrible messages when there is a -// compiler error, as gcc insists on printing out each template -// argument, even if it has the default value (this means Types -// will appear as Types in the compiler -// errors). -// -// Our solution is to combine the best part of the two approaches: a -// user would write Types, and Google Test will translate -// that to TypesN internally to make error messages -// readable. The translation is done by the 'type' member of the -// Types template. -template -struct Types { - typedef internal::Types50 type; -}; - -template <> -struct Types { - typedef internal::Types0 type; -}; -template -struct Types { - typedef internal::Types1 type; -}; -template -struct Types { - typedef internal::Types2 type; -}; -template -struct Types { - typedef internal::Types3 type; -}; -template -struct Types { - typedef internal::Types4 type; -}; -template -struct Types { - typedef internal::Types5 type; -}; -template -struct Types { - typedef internal::Types6 type; -}; -template -struct Types { - typedef internal::Types7 type; -}; -template -struct Types { - typedef internal::Types8 type; -}; -template -struct Types { - typedef internal::Types9 type; -}; -template -struct Types { - typedef internal::Types10 type; -}; -template -struct Types { - typedef internal::Types11 type; -}; -template -struct Types { - typedef internal::Types12 type; -}; -template -struct Types { - typedef internal::Types13 type; -}; -template -struct Types { - typedef internal::Types14 type; -}; -template -struct Types { - typedef internal::Types15 type; -}; -template -struct Types { - typedef internal::Types16 type; -}; -template -struct Types { - typedef internal::Types17 type; -}; -template -struct Types { - typedef internal::Types18 type; -}; -template -struct Types { - typedef internal::Types19 type; -}; -template -struct Types { - typedef internal::Types20 type; -}; -template -struct Types { - typedef internal::Types21 type; -}; -template -struct Types { - typedef internal::Types22 type; -}; -template -struct Types { - typedef internal::Types23 type; -}; -template -struct Types { - typedef internal::Types24 type; -}; -template -struct Types { - typedef internal::Types25 type; -}; -template -struct Types { - typedef internal::Types26 type; -}; -template -struct Types { - typedef internal::Types27 type; -}; -template -struct Types { - typedef internal::Types28 type; -}; -template -struct Types { - typedef internal::Types29 type; -}; -template -struct Types { - typedef internal::Types30 type; -}; -template -struct Types { - typedef internal::Types31 type; -}; -template -struct Types { - typedef internal::Types32 type; -}; -template -struct Types { - typedef internal::Types33 type; -}; -template -struct Types { - typedef internal::Types34 type; -}; -template -struct Types { - typedef internal::Types35 type; -}; -template -struct Types { - typedef internal::Types36 type; -}; -template -struct Types { - typedef internal::Types37 type; -}; -template -struct Types { - typedef internal::Types38 type; -}; -template -struct Types { - typedef internal::Types39 type; -}; -template -struct Types { - typedef internal::Types40 type; -}; -template -struct Types { - typedef internal::Types41 type; -}; -template -struct Types { - typedef internal::Types42 type; -}; -template -struct Types { - typedef internal::Types43 type; -}; -template -struct Types { - typedef internal::Types44 type; -}; -template -struct Types { - typedef internal::Types45 type; -}; -template -struct Types { - typedef internal::Types46 type; -}; -template -struct Types { - typedef internal::Types47 type; -}; -template -struct Types { - typedef internal::Types48 type; -}; -template -struct Types { - typedef internal::Types49 type; -}; - -namespace internal { - -# define GTEST_TEMPLATE_ template class - -// The template "selector" struct TemplateSel is used to -// represent Tmpl, which must be a class template with one type -// parameter, as a type. TemplateSel::Bind::type is defined -// as the type Tmpl. This allows us to actually instantiate the -// template "selected" by TemplateSel. -// -// This trick is necessary for simulating typedef for class templates, -// which C++ doesn't support directly. -template -struct TemplateSel { - template - struct Bind { - typedef Tmpl type; - }; -}; - -# define GTEST_BIND_(TmplSel, T) \ - TmplSel::template Bind::type - -// A unique struct template used as the default value for the -// arguments of class template Templates. This allows us to simulate -// variadic templates (e.g. Templates, Templates, -// and etc), which C++ doesn't support directly. -template -struct NoneT {}; - -// The following family of struct and struct templates are used to -// represent template lists. In particular, TemplatesN represents a list of N templates (T1, T2, ..., and TN). Except -// for Templates0, every struct in the family has two member types: -// Head for the selector of the first template in the list, and Tail -// for the rest of the list. - -// The empty template list. -struct Templates0 {}; - -// Template lists of length 1, 2, 3, and so on. - -template -struct Templates1 { - typedef TemplateSel Head; - typedef Templates0 Tail; -}; -template -struct Templates2 { - typedef TemplateSel Head; - typedef Templates1 Tail; -}; - -template -struct Templates3 { - typedef TemplateSel Head; - typedef Templates2 Tail; -}; - -template -struct Templates4 { - typedef TemplateSel Head; - typedef Templates3 Tail; -}; - -template -struct Templates5 { - typedef TemplateSel Head; - typedef Templates4 Tail; -}; - -template -struct Templates6 { - typedef TemplateSel Head; - typedef Templates5 Tail; -}; - -template -struct Templates7 { - typedef TemplateSel Head; - typedef Templates6 Tail; -}; - -template -struct Templates8 { - typedef TemplateSel Head; - typedef Templates7 Tail; -}; - -template -struct Templates9 { - typedef TemplateSel Head; - typedef Templates8 Tail; -}; - -template -struct Templates10 { - typedef TemplateSel Head; - typedef Templates9 Tail; -}; - -template -struct Templates11 { - typedef TemplateSel Head; - typedef Templates10 Tail; -}; - -template -struct Templates12 { - typedef TemplateSel Head; - typedef Templates11 Tail; -}; - -template -struct Templates13 { - typedef TemplateSel Head; - typedef Templates12 Tail; -}; - -template -struct Templates14 { - typedef TemplateSel Head; - typedef Templates13 Tail; -}; - -template -struct Templates15 { - typedef TemplateSel Head; - typedef Templates14 Tail; -}; - -template -struct Templates16 { - typedef TemplateSel Head; - typedef Templates15 Tail; -}; - -template -struct Templates17 { - typedef TemplateSel Head; - typedef Templates16 Tail; -}; - -template -struct Templates18 { - typedef TemplateSel Head; - typedef Templates17 Tail; -}; - -template -struct Templates19 { - typedef TemplateSel Head; - typedef Templates18 Tail; -}; - -template -struct Templates20 { - typedef TemplateSel Head; - typedef Templates19 Tail; -}; - -template -struct Templates21 { - typedef TemplateSel Head; - typedef Templates20 Tail; -}; - -template -struct Templates22 { - typedef TemplateSel Head; - typedef Templates21 Tail; -}; - -template -struct Templates23 { - typedef TemplateSel Head; - typedef Templates22 Tail; -}; - -template -struct Templates24 { - typedef TemplateSel Head; - typedef Templates23 Tail; -}; - -template -struct Templates25 { - typedef TemplateSel Head; - typedef Templates24 Tail; -}; - -template -struct Templates26 { - typedef TemplateSel Head; - typedef Templates25 Tail; -}; - -template -struct Templates27 { - typedef TemplateSel Head; - typedef Templates26 Tail; -}; - -template -struct Templates28 { - typedef TemplateSel Head; - typedef Templates27 Tail; -}; - -template -struct Templates29 { - typedef TemplateSel Head; - typedef Templates28 Tail; -}; - -template -struct Templates30 { - typedef TemplateSel Head; - typedef Templates29 Tail; -}; - -template -struct Templates31 { - typedef TemplateSel Head; - typedef Templates30 Tail; -}; - -template -struct Templates32 { - typedef TemplateSel Head; - typedef Templates31 Tail; -}; - -template -struct Templates33 { - typedef TemplateSel Head; - typedef Templates32 Tail; -}; - -template -struct Templates34 { - typedef TemplateSel Head; - typedef Templates33 Tail; -}; - -template -struct Templates35 { - typedef TemplateSel Head; - typedef Templates34 Tail; -}; - -template -struct Templates36 { - typedef TemplateSel Head; - typedef Templates35 Tail; -}; - -template -struct Templates37 { - typedef TemplateSel Head; - typedef Templates36 Tail; -}; - -template -struct Templates38 { - typedef TemplateSel Head; - typedef Templates37 Tail; -}; - -template -struct Templates39 { - typedef TemplateSel Head; - typedef Templates38 Tail; -}; - -template -struct Templates40 { - typedef TemplateSel Head; - typedef Templates39 Tail; -}; - -template -struct Templates41 { - typedef TemplateSel Head; - typedef Templates40 Tail; -}; - -template -struct Templates42 { - typedef TemplateSel Head; - typedef Templates41 Tail; -}; - -template -struct Templates43 { - typedef TemplateSel Head; - typedef Templates42 Tail; -}; - -template -struct Templates44 { - typedef TemplateSel Head; - typedef Templates43 Tail; -}; - -template -struct Templates45 { - typedef TemplateSel Head; - typedef Templates44 Tail; -}; - -template -struct Templates46 { - typedef TemplateSel Head; - typedef Templates45 Tail; -}; - -template -struct Templates47 { - typedef TemplateSel Head; - typedef Templates46 Tail; -}; - -template -struct Templates48 { - typedef TemplateSel Head; - typedef Templates47 Tail; -}; - -template -struct Templates49 { - typedef TemplateSel Head; - typedef Templates48 Tail; -}; - -template -struct Templates50 { - typedef TemplateSel Head; - typedef Templates49 Tail; -}; - - -// We don't want to require the users to write TemplatesN<...> directly, -// as that would require them to count the length. Templates<...> is much -// easier to write, but generates horrible messages when there is a -// compiler error, as gcc insists on printing out each template -// argument, even if it has the default value (this means Templates -// will appear as Templates in the compiler -// errors). -// -// Our solution is to combine the best part of the two approaches: a -// user would write Templates, and Google Test will translate -// that to TemplatesN internally to make error messages -// readable. The translation is done by the 'type' member of the -// Templates template. -template -struct Templates { - typedef Templates50 type; -}; - -template <> -struct Templates { - typedef Templates0 type; -}; -template -struct Templates { - typedef Templates1 type; -}; -template -struct Templates { - typedef Templates2 type; -}; -template -struct Templates { - typedef Templates3 type; -}; -template -struct Templates { - typedef Templates4 type; -}; -template -struct Templates { - typedef Templates5 type; -}; -template -struct Templates { - typedef Templates6 type; -}; -template -struct Templates { - typedef Templates7 type; -}; -template -struct Templates { - typedef Templates8 type; -}; -template -struct Templates { - typedef Templates9 type; -}; -template -struct Templates { - typedef Templates10 type; -}; -template -struct Templates { - typedef Templates11 type; -}; -template -struct Templates { - typedef Templates12 type; -}; -template -struct Templates { - typedef Templates13 type; -}; -template -struct Templates { - typedef Templates14 type; -}; -template -struct Templates { - typedef Templates15 type; -}; -template -struct Templates { - typedef Templates16 type; -}; -template -struct Templates { - typedef Templates17 type; -}; -template -struct Templates { - typedef Templates18 type; -}; -template -struct Templates { - typedef Templates19 type; -}; -template -struct Templates { - typedef Templates20 type; -}; -template -struct Templates { - typedef Templates21 type; -}; -template -struct Templates { - typedef Templates22 type; -}; -template -struct Templates { - typedef Templates23 type; -}; -template -struct Templates { - typedef Templates24 type; -}; -template -struct Templates { - typedef Templates25 type; -}; -template -struct Templates { - typedef Templates26 type; -}; -template -struct Templates { - typedef Templates27 type; -}; -template -struct Templates { - typedef Templates28 type; -}; -template -struct Templates { - typedef Templates29 type; -}; -template -struct Templates { - typedef Templates30 type; -}; -template -struct Templates { - typedef Templates31 type; -}; -template -struct Templates { - typedef Templates32 type; -}; -template -struct Templates { - typedef Templates33 type; -}; -template -struct Templates { - typedef Templates34 type; -}; -template -struct Templates { - typedef Templates35 type; -}; -template -struct Templates { - typedef Templates36 type; -}; -template -struct Templates { - typedef Templates37 type; -}; -template -struct Templates { - typedef Templates38 type; -}; -template -struct Templates { - typedef Templates39 type; -}; -template -struct Templates { - typedef Templates40 type; -}; -template -struct Templates { - typedef Templates41 type; -}; -template -struct Templates { - typedef Templates42 type; -}; -template -struct Templates { - typedef Templates43 type; -}; -template -struct Templates { - typedef Templates44 type; -}; -template -struct Templates { - typedef Templates45 type; -}; -template -struct Templates { - typedef Templates46 type; -}; -template -struct Templates { - typedef Templates47 type; -}; -template -struct Templates { - typedef Templates48 type; -}; -template -struct Templates { - typedef Templates49 type; -}; - -// The TypeList template makes it possible to use either a single type -// or a Types<...> list in TYPED_TEST_CASE() and -// INSTANTIATE_TYPED_TEST_CASE_P(). - -template -struct TypeList { - typedef Types1 type; -}; - -template -struct TypeList > { - typedef typename Types::type type; -}; - -#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ - -// Due to C++ preprocessor weirdness, we need double indirection to -// concatenate two tokens when one of them is __LINE__. Writing -// -// foo ## __LINE__ -// -// will result in the token foo__LINE__, instead of foo followed by -// the current line number. For more details, see -// http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6 -#define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar) -#define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar - -class ProtocolMessage; -namespace proto2 { class Message; } - -namespace testing { - -// Forward declarations. - -class AssertionResult; // Result of an assertion. -class Message; // Represents a failure message. -class Test; // Represents a test. -class TestInfo; // Information about a test. -class TestPartResult; // Result of a test part. -class UnitTest; // A collection of test cases. - -template -::std::string PrintToString(const T& value); - -namespace internal { - -struct TraceInfo; // Information about a trace point. -class ScopedTrace; // Implements scoped trace. -class TestInfoImpl; // Opaque implementation of TestInfo -class UnitTestImpl; // Opaque implementation of UnitTest - -// How many times InitGoogleTest() has been called. -GTEST_API_ extern int g_init_gtest_count; - -// The text used in failure messages to indicate the start of the -// stack trace. -GTEST_API_ extern const char kStackTraceMarker[]; - -// Two overloaded helpers for checking at compile time whether an -// expression is a null pointer literal (i.e. NULL or any 0-valued -// compile-time integral constant). Their return values have -// different sizes, so we can use sizeof() to test which version is -// picked by the compiler. These helpers have no implementations, as -// we only need their signatures. -// -// Given IsNullLiteralHelper(x), the compiler will pick the first -// version if x can be implicitly converted to Secret*, and pick the -// second version otherwise. Since Secret is a secret and incomplete -// type, the only expression a user can write that has type Secret* is -// a null pointer literal. Therefore, we know that x is a null -// pointer literal if and only if the first version is picked by the -// compiler. -char IsNullLiteralHelper(Secret* p); -char (&IsNullLiteralHelper(...))[2]; // NOLINT - -// A compile-time bool constant that is true if and only if x is a -// null pointer literal (i.e. NULL or any 0-valued compile-time -// integral constant). -#ifdef GTEST_ELLIPSIS_NEEDS_POD_ -// We lose support for NULL detection where the compiler doesn't like -// passing non-POD classes through ellipsis (...). -# define GTEST_IS_NULL_LITERAL_(x) false -#else -# define GTEST_IS_NULL_LITERAL_(x) \ - (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1) -#endif // GTEST_ELLIPSIS_NEEDS_POD_ - -// Appends the user-supplied message to the Google-Test-generated message. -GTEST_API_ std::string AppendUserMessage( - const std::string& gtest_msg, const Message& user_msg); - -#if GTEST_HAS_EXCEPTIONS - -// This exception is thrown by (and only by) a failed Google Test -// assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions -// are enabled). We derive it from std::runtime_error, which is for -// errors presumably detectable only at run time. Since -// std::runtime_error inherits from std::exception, many testing -// frameworks know how to extract and print the message inside it. -class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error { - public: - explicit GoogleTestFailureException(const TestPartResult& failure); -}; - -#endif // GTEST_HAS_EXCEPTIONS - -// A helper class for creating scoped traces in user programs. -class GTEST_API_ ScopedTrace { - public: - // The c'tor pushes the given source file location and message onto - // a trace stack maintained by Google Test. - ScopedTrace(const char* file, int line, const Message& message); - - // The d'tor pops the info pushed by the c'tor. - // - // Note that the d'tor is not virtual in order to be efficient. - // Don't inherit from ScopedTrace! - ~ScopedTrace(); - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace); -} GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its - // c'tor and d'tor. Therefore it doesn't - // need to be used otherwise. - -// Constructs and returns the message for an equality assertion -// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure. -// -// The first four parameters are the expressions used in the assertion -// and their values, as strings. For example, for ASSERT_EQ(foo, bar) -// where foo is 5 and bar is 6, we have: -// -// expected_expression: "foo" -// actual_expression: "bar" -// expected_value: "5" -// actual_value: "6" -// -// The ignoring_case parameter is true iff the assertion is a -// *_STRCASEEQ*. When it's true, the string " (ignoring case)" will -// be inserted into the message. -GTEST_API_ AssertionResult EqFailure(const char* expected_expression, - const char* actual_expression, - const std::string& expected_value, - const std::string& actual_value, - bool ignoring_case); - -// Constructs a failure message for Boolean assertions such as EXPECT_TRUE. -GTEST_API_ std::string GetBoolAssertionFailureMessage( - const AssertionResult& assertion_result, - const char* expression_text, - const char* actual_predicate_value, - const char* expected_predicate_value); - -// This template class represents an IEEE floating-point number -// (either single-precision or double-precision, depending on the -// template parameters). -// -// The purpose of this class is to do more sophisticated number -// comparison. (Due to round-off error, etc, it's very unlikely that -// two floating-points will be equal exactly. Hence a naive -// comparison by the == operation often doesn't work.) -// -// Format of IEEE floating-point: -// -// The most-significant bit being the leftmost, an IEEE -// floating-point looks like -// -// sign_bit exponent_bits fraction_bits -// -// Here, sign_bit is a single bit that designates the sign of the -// number. -// -// For float, there are 8 exponent bits and 23 fraction bits. -// -// For double, there are 11 exponent bits and 52 fraction bits. -// -// More details can be found at -// http://en.wikipedia.org/wiki/IEEE_floating-point_standard. -// -// Template parameter: -// -// RawType: the raw floating-point type (either float or double) -template -class FloatingPoint { - public: - // Defines the unsigned integer type that has the same size as the - // floating point number. - typedef typename TypeWithSize::UInt Bits; - - // Constants. - - // # of bits in a number. - static const size_t kBitCount = 8*sizeof(RawType); - - // # of fraction bits in a number. - static const size_t kFractionBitCount = - std::numeric_limits::digits - 1; - - // # of exponent bits in a number. - static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount; - - // The mask for the sign bit. - static const Bits kSignBitMask = static_cast(1) << (kBitCount - 1); - - // The mask for the fraction bits. - static const Bits kFractionBitMask = - ~static_cast(0) >> (kExponentBitCount + 1); - - // The mask for the exponent bits. - static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask); - - // How many ULP's (Units in the Last Place) we want to tolerate when - // comparing two numbers. The larger the value, the more error we - // allow. A 0 value means that two numbers must be exactly the same - // to be considered equal. - // - // The maximum error of a single floating-point operation is 0.5 - // units in the last place. On Intel CPU's, all floating-point - // calculations are done with 80-bit precision, while double has 64 - // bits. Therefore, 4 should be enough for ordinary use. - // - // See the following article for more details on ULP: - // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ - static const size_t kMaxUlps = 4; - - // Constructs a FloatingPoint from a raw floating-point number. - // - // On an Intel CPU, passing a non-normalized NAN (Not a Number) - // around may change its bits, although the new value is guaranteed - // to be also a NAN. Therefore, don't expect this constructor to - // preserve the bits in x when x is a NAN. - explicit FloatingPoint(const RawType& x) { u_.value_ = x; } - - // Static methods - - // Reinterprets a bit pattern as a floating-point number. - // - // This function is needed to test the AlmostEquals() method. - static RawType ReinterpretBits(const Bits bits) { - FloatingPoint fp(0); - fp.u_.bits_ = bits; - return fp.u_.value_; - } - - // Returns the floating-point number that represent positive infinity. - static RawType Infinity() { - return ReinterpretBits(kExponentBitMask); - } - - // Returns the maximum representable finite floating-point number. - static RawType Max(); - - // Non-static methods - - // Returns the bits that represents this number. - const Bits &bits() const { return u_.bits_; } - - // Returns the exponent bits of this number. - Bits exponent_bits() const { return kExponentBitMask & u_.bits_; } - - // Returns the fraction bits of this number. - Bits fraction_bits() const { return kFractionBitMask & u_.bits_; } - - // Returns the sign bit of this number. - Bits sign_bit() const { return kSignBitMask & u_.bits_; } - - // Returns true iff this is NAN (not a number). - bool is_nan() const { - // It's a NAN if the exponent bits are all ones and the fraction - // bits are not entirely zeros. - return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0); - } - - // Returns true iff this number is at most kMaxUlps ULP's away from - // rhs. In particular, this function: - // - // - returns false if either number is (or both are) NAN. - // - treats really large numbers as almost equal to infinity. - // - thinks +0.0 and -0.0 are 0 DLP's apart. - bool AlmostEquals(const FloatingPoint& rhs) const { - // The IEEE standard says that any comparison operation involving - // a NAN must return false. - if (is_nan() || rhs.is_nan()) return false; - - return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_) - <= kMaxUlps; - } - - private: - // The data type used to store the actual floating-point number. - union FloatingPointUnion { - RawType value_; // The raw floating-point number. - Bits bits_; // The bits that represent the number. - }; - - // Converts an integer from the sign-and-magnitude representation to - // the biased representation. More precisely, let N be 2 to the - // power of (kBitCount - 1), an integer x is represented by the - // unsigned number x + N. - // - // For instance, - // - // -N + 1 (the most negative number representable using - // sign-and-magnitude) is represented by 1; - // 0 is represented by N; and - // N - 1 (the biggest number representable using - // sign-and-magnitude) is represented by 2N - 1. - // - // Read http://en.wikipedia.org/wiki/Signed_number_representations - // for more details on signed number representations. - static Bits SignAndMagnitudeToBiased(const Bits &sam) { - if (kSignBitMask & sam) { - // sam represents a negative number. - return ~sam + 1; - } else { - // sam represents a positive number. - return kSignBitMask | sam; - } - } - - // Given two numbers in the sign-and-magnitude representation, - // returns the distance between them as an unsigned number. - static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1, - const Bits &sam2) { - const Bits biased1 = SignAndMagnitudeToBiased(sam1); - const Bits biased2 = SignAndMagnitudeToBiased(sam2); - return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1); - } - - FloatingPointUnion u_; -}; - -// We cannot use std::numeric_limits::max() as it clashes with the max() -// macro defined by . -template <> -inline float FloatingPoint::Max() { return FLT_MAX; } -template <> -inline double FloatingPoint::Max() { return DBL_MAX; } - -// Typedefs the instances of the FloatingPoint template class that we -// care to use. -typedef FloatingPoint Float; -typedef FloatingPoint Double; - -// In order to catch the mistake of putting tests that use different -// test fixture classes in the same test case, we need to assign -// unique IDs to fixture classes and compare them. The TypeId type is -// used to hold such IDs. The user should treat TypeId as an opaque -// type: the only operation allowed on TypeId values is to compare -// them for equality using the == operator. -typedef const void* TypeId; - -template -class TypeIdHelper { - public: - // dummy_ must not have a const type. Otherwise an overly eager - // compiler (e.g. MSVC 7.1 & 8.0) may try to merge - // TypeIdHelper::dummy_ for different Ts as an "optimization". - static bool dummy_; -}; - -template -bool TypeIdHelper::dummy_ = false; - -// GetTypeId() returns the ID of type T. Different values will be -// returned for different types. Calling the function twice with the -// same type argument is guaranteed to return the same ID. -template -TypeId GetTypeId() { - // The compiler is required to allocate a different - // TypeIdHelper::dummy_ variable for each T used to instantiate - // the template. Therefore, the address of dummy_ is guaranteed to - // be unique. - return &(TypeIdHelper::dummy_); -} - -// Returns the type ID of ::testing::Test. Always call this instead -// of GetTypeId< ::testing::Test>() to get the type ID of -// ::testing::Test, as the latter may give the wrong result due to a -// suspected linker bug when compiling Google Test as a Mac OS X -// framework. -GTEST_API_ TypeId GetTestTypeId(); - -// Defines the abstract factory interface that creates instances -// of a Test object. -class TestFactoryBase { - public: - virtual ~TestFactoryBase() {} - - // Creates a test instance to run. The instance is both created and destroyed - // within TestInfoImpl::Run() - virtual Test* CreateTest() = 0; - - protected: - TestFactoryBase() {} - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase); -}; - -// This class provides implementation of TeastFactoryBase interface. -// It is used in TEST and TEST_F macros. -template -class TestFactoryImpl : public TestFactoryBase { - public: - virtual Test* CreateTest() { return new TestClass; } -}; - -#if GTEST_OS_WINDOWS - -// Predicate-formatters for implementing the HRESULT checking macros -// {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED} -// We pass a long instead of HRESULT to avoid causing an -// include dependency for the HRESULT type. -GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr, - long hr); // NOLINT -GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr, - long hr); // NOLINT - -#endif // GTEST_OS_WINDOWS - -// Types of SetUpTestCase() and TearDownTestCase() functions. -typedef void (*SetUpTestCaseFunc)(); -typedef void (*TearDownTestCaseFunc)(); - -// Creates a new TestInfo object and registers it with Google Test; -// returns the created object. -// -// Arguments: -// -// test_case_name: name of the test case -// name: name of the test -// type_param the name of the test's type parameter, or NULL if -// this is not a typed or a type-parameterized test. -// value_param text representation of the test's value parameter, -// or NULL if this is not a type-parameterized test. -// fixture_class_id: ID of the test fixture class -// set_up_tc: pointer to the function that sets up the test case -// tear_down_tc: pointer to the function that tears down the test case -// factory: pointer to the factory that creates a test object. -// The newly created TestInfo instance will assume -// ownership of the factory object. -GTEST_API_ TestInfo* MakeAndRegisterTestInfo( - const char* test_case_name, - const char* name, - const char* type_param, - const char* value_param, - TypeId fixture_class_id, - SetUpTestCaseFunc set_up_tc, - TearDownTestCaseFunc tear_down_tc, - TestFactoryBase* factory); - -// If *pstr starts with the given prefix, modifies *pstr to be right -// past the prefix and returns true; otherwise leaves *pstr unchanged -// and returns false. None of pstr, *pstr, and prefix can be NULL. -GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr); - -#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - -// State of the definition of a type-parameterized test case. -class GTEST_API_ TypedTestCasePState { - public: - TypedTestCasePState() : registered_(false) {} - - // Adds the given test name to defined_test_names_ and return true - // if the test case hasn't been registered; otherwise aborts the - // program. - bool AddTestName(const char* file, int line, const char* case_name, - const char* test_name) { - if (registered_) { - fprintf(stderr, "%s Test %s must be defined before " - "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n", - FormatFileLocation(file, line).c_str(), test_name, case_name); - fflush(stderr); - posix::Abort(); - } - defined_test_names_.insert(test_name); - return true; - } - - // Verifies that registered_tests match the test names in - // defined_test_names_; returns registered_tests if successful, or - // aborts the program otherwise. - const char* VerifyRegisteredTestNames( - const char* file, int line, const char* registered_tests); - - private: - bool registered_; - ::std::set defined_test_names_; -}; - -// Skips to the first non-space char after the first comma in 'str'; -// returns NULL if no comma is found in 'str'. -inline const char* SkipComma(const char* str) { - const char* comma = strchr(str, ','); - if (comma == NULL) { - return NULL; - } - while (IsSpace(*(++comma))) {} - return comma; -} - -// Returns the prefix of 'str' before the first comma in it; returns -// the entire string if it contains no comma. -inline std::string GetPrefixUntilComma(const char* str) { - const char* comma = strchr(str, ','); - return comma == NULL ? str : std::string(str, comma); -} - -// TypeParameterizedTest::Register() -// registers a list of type-parameterized tests with Google Test. The -// return value is insignificant - we just need to return something -// such that we can call this function in a namespace scope. -// -// Implementation note: The GTEST_TEMPLATE_ macro declares a template -// template parameter. It's defined in gtest-type-util.h. -template -class TypeParameterizedTest { - public: - // 'index' is the index of the test in the type list 'Types' - // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase, - // Types). Valid values for 'index' are [0, N - 1] where N is the - // length of Types. - static bool Register(const char* prefix, const char* case_name, - const char* test_names, int index) { - typedef typename Types::Head Type; - typedef Fixture FixtureClass; - typedef typename GTEST_BIND_(TestSel, Type) TestClass; - - // First, registers the first type-parameterized test in the type - // list. - MakeAndRegisterTestInfo( - (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/" - + StreamableToString(index)).c_str(), - GetPrefixUntilComma(test_names).c_str(), - GetTypeName().c_str(), - NULL, // No value parameter. - GetTypeId(), - TestClass::SetUpTestCase, - TestClass::TearDownTestCase, - new TestFactoryImpl); - - // Next, recurses (at compile time) with the tail of the type list. - return TypeParameterizedTest - ::Register(prefix, case_name, test_names, index + 1); - } -}; - -// The base case for the compile time recursion. -template -class TypeParameterizedTest { - public: - static bool Register(const char* /*prefix*/, const char* /*case_name*/, - const char* /*test_names*/, int /*index*/) { - return true; - } -}; - -// TypeParameterizedTestCase::Register() -// registers *all combinations* of 'Tests' and 'Types' with Google -// Test. The return value is insignificant - we just need to return -// something such that we can call this function in a namespace scope. -template -class TypeParameterizedTestCase { - public: - static bool Register(const char* prefix, const char* case_name, - const char* test_names) { - typedef typename Tests::Head Head; - - // First, register the first test in 'Test' for each type in 'Types'. - TypeParameterizedTest::Register( - prefix, case_name, test_names, 0); - - // Next, recurses (at compile time) with the tail of the test list. - return TypeParameterizedTestCase - ::Register(prefix, case_name, SkipComma(test_names)); - } -}; - -// The base case for the compile time recursion. -template -class TypeParameterizedTestCase { - public: - static bool Register(const char* /*prefix*/, const char* /*case_name*/, - const char* /*test_names*/) { - return true; - } -}; - -#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - -// Returns the current OS stack trace as an std::string. -// -// The maximum number of stack frames to be included is specified by -// the gtest_stack_trace_depth flag. The skip_count parameter -// specifies the number of top frames to be skipped, which doesn't -// count against the number of frames to be included. -// -// For example, if Foo() calls Bar(), which in turn calls -// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in -// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't. -GTEST_API_ std::string GetCurrentOsStackTraceExceptTop( - UnitTest* unit_test, int skip_count); - -// Helpers for suppressing warnings on unreachable code or constant -// condition. - -// Always returns true. -GTEST_API_ bool AlwaysTrue(); - -// Always returns false. -inline bool AlwaysFalse() { return !AlwaysTrue(); } - -// Helper for suppressing false warning from Clang on a const char* -// variable declared in a conditional expression always being NULL in -// the else branch. -struct GTEST_API_ ConstCharPtr { - ConstCharPtr(const char* str) : value(str) {} - operator bool() const { return true; } - const char* value; -}; - -// A simple Linear Congruential Generator for generating random -// numbers with a uniform distribution. Unlike rand() and srand(), it -// doesn't use global state (and therefore can't interfere with user -// code). Unlike rand_r(), it's portable. An LCG isn't very random, -// but it's good enough for our purposes. -class GTEST_API_ Random { - public: - static const UInt32 kMaxRange = 1u << 31; - - explicit Random(UInt32 seed) : state_(seed) {} - - void Reseed(UInt32 seed) { state_ = seed; } - - // Generates a random number from [0, range). Crashes if 'range' is - // 0 or greater than kMaxRange. - UInt32 Generate(UInt32 range); - - private: - UInt32 state_; - GTEST_DISALLOW_COPY_AND_ASSIGN_(Random); -}; - -// Defining a variable of type CompileAssertTypesEqual will cause a -// compiler error iff T1 and T2 are different types. -template -struct CompileAssertTypesEqual; - -template -struct CompileAssertTypesEqual { -}; - -// Removes the reference from a type if it is a reference type, -// otherwise leaves it unchanged. This is the same as -// tr1::remove_reference, which is not widely available yet. -template -struct RemoveReference { typedef T type; }; // NOLINT -template -struct RemoveReference { typedef T type; }; // NOLINT - -// A handy wrapper around RemoveReference that works when the argument -// T depends on template parameters. -#define GTEST_REMOVE_REFERENCE_(T) \ - typename ::testing::internal::RemoveReference::type - -// Removes const from a type if it is a const type, otherwise leaves -// it unchanged. This is the same as tr1::remove_const, which is not -// widely available yet. -template -struct RemoveConst { typedef T type; }; // NOLINT -template -struct RemoveConst { typedef T type; }; // NOLINT - -// MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above -// definition to fail to remove the const in 'const int[3]' and 'const -// char[3][4]'. The following specialization works around the bug. -template -struct RemoveConst { - typedef typename RemoveConst::type type[N]; -}; - -#if defined(_MSC_VER) && _MSC_VER < 1400 -// This is the only specialization that allows VC++ 7.1 to remove const in -// 'const int[3] and 'const int[3][4]'. However, it causes trouble with GCC -// and thus needs to be conditionally compiled. -template -struct RemoveConst { - typedef typename RemoveConst::type type[N]; -}; -#endif - -// A handy wrapper around RemoveConst that works when the argument -// T depends on template parameters. -#define GTEST_REMOVE_CONST_(T) \ - typename ::testing::internal::RemoveConst::type - -// Turns const U&, U&, const U, and U all into U. -#define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \ - GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T)) - -// Adds reference to a type if it is not a reference type, -// otherwise leaves it unchanged. This is the same as -// tr1::add_reference, which is not widely available yet. -template -struct AddReference { typedef T& type; }; // NOLINT -template -struct AddReference { typedef T& type; }; // NOLINT - -// A handy wrapper around AddReference that works when the argument T -// depends on template parameters. -#define GTEST_ADD_REFERENCE_(T) \ - typename ::testing::internal::AddReference::type - -// Adds a reference to const on top of T as necessary. For example, -// it transforms -// -// char ==> const char& -// const char ==> const char& -// char& ==> const char& -// const char& ==> const char& -// -// The argument T must depend on some template parameters. -#define GTEST_REFERENCE_TO_CONST_(T) \ - GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T)) - -// ImplicitlyConvertible::value is a compile-time bool -// constant that's true iff type From can be implicitly converted to -// type To. -template -class ImplicitlyConvertible { - private: - // We need the following helper functions only for their types. - // They have no implementations. - - // MakeFrom() is an expression whose type is From. We cannot simply - // use From(), as the type From may not have a public default - // constructor. - static From MakeFrom(); - - // These two functions are overloaded. Given an expression - // Helper(x), the compiler will pick the first version if x can be - // implicitly converted to type To; otherwise it will pick the - // second version. - // - // The first version returns a value of size 1, and the second - // version returns a value of size 2. Therefore, by checking the - // size of Helper(x), which can be done at compile time, we can tell - // which version of Helper() is used, and hence whether x can be - // implicitly converted to type To. - static char Helper(To); - static char (&Helper(...))[2]; // NOLINT - - // We have to put the 'public' section after the 'private' section, - // or MSVC refuses to compile the code. - public: - // MSVC warns about implicitly converting from double to int for - // possible loss of data, so we need to temporarily disable the - // warning. -#ifdef _MSC_VER -# pragma warning(push) // Saves the current warning state. -# pragma warning(disable:4244) // Temporarily disables warning 4244. - - static const bool value = - sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1; -# pragma warning(pop) // Restores the warning state. -#elif defined(__BORLANDC__) - // C++Builder cannot use member overload resolution during template - // instantiation. The simplest workaround is to use its C++0x type traits - // functions (C++Builder 2009 and above only). - static const bool value = __is_convertible(From, To); -#else - static const bool value = - sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1; -#endif // _MSV_VER -}; -template -const bool ImplicitlyConvertible::value; - -// IsAProtocolMessage::value is a compile-time bool constant that's -// true iff T is type ProtocolMessage, proto2::Message, or a subclass -// of those. -template -struct IsAProtocolMessage - : public bool_constant< - ImplicitlyConvertible::value || - ImplicitlyConvertible::value> { -}; - -// When the compiler sees expression IsContainerTest(0), if C is an -// STL-style container class, the first overload of IsContainerTest -// will be viable (since both C::iterator* and C::const_iterator* are -// valid types and NULL can be implicitly converted to them). It will -// be picked over the second overload as 'int' is a perfect match for -// the type of argument 0. If C::iterator or C::const_iterator is not -// a valid type, the first overload is not viable, and the second -// overload will be picked. Therefore, we can determine whether C is -// a container class by checking the type of IsContainerTest(0). -// The value of the expression is insignificant. -// -// Note that we look for both C::iterator and C::const_iterator. The -// reason is that C++ injects the name of a class as a member of the -// class itself (e.g. you can refer to class iterator as either -// 'iterator' or 'iterator::iterator'). If we look for C::iterator -// only, for example, we would mistakenly think that a class named -// iterator is an STL container. -// -// Also note that the simpler approach of overloading -// IsContainerTest(typename C::const_iterator*) and -// IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++. -typedef int IsContainer; -template -IsContainer IsContainerTest(int /* dummy */, - typename C::iterator* /* it */ = NULL, - typename C::const_iterator* /* const_it */ = NULL) { - return 0; -} - -typedef char IsNotContainer; -template -IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; } - -// EnableIf::type is void when 'Cond' is true, and -// undefined when 'Cond' is false. To use SFINAE to make a function -// overload only apply when a particular expression is true, add -// "typename EnableIf::type* = 0" as the last parameter. -template struct EnableIf; -template<> struct EnableIf { typedef void type; }; // NOLINT - -// Utilities for native arrays. - -// ArrayEq() compares two k-dimensional native arrays using the -// elements' operator==, where k can be any integer >= 0. When k is -// 0, ArrayEq() degenerates into comparing a single pair of values. - -template -bool ArrayEq(const T* lhs, size_t size, const U* rhs); - -// This generic version is used when k is 0. -template -inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; } - -// This overload is used when k >= 1. -template -inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) { - return internal::ArrayEq(lhs, N, rhs); -} - -// This helper reduces code bloat. If we instead put its logic inside -// the previous ArrayEq() function, arrays with different sizes would -// lead to different copies of the template code. -template -bool ArrayEq(const T* lhs, size_t size, const U* rhs) { - for (size_t i = 0; i != size; i++) { - if (!internal::ArrayEq(lhs[i], rhs[i])) - return false; - } - return true; -} - -// Finds the first element in the iterator range [begin, end) that -// equals elem. Element may be a native array type itself. -template -Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) { - for (Iter it = begin; it != end; ++it) { - if (internal::ArrayEq(*it, elem)) - return it; - } - return end; -} - -// CopyArray() copies a k-dimensional native array using the elements' -// operator=, where k can be any integer >= 0. When k is 0, -// CopyArray() degenerates into copying a single value. - -template -void CopyArray(const T* from, size_t size, U* to); - -// This generic version is used when k is 0. -template -inline void CopyArray(const T& from, U* to) { *to = from; } - -// This overload is used when k >= 1. -template -inline void CopyArray(const T(&from)[N], U(*to)[N]) { - internal::CopyArray(from, N, *to); -} - -// This helper reduces code bloat. If we instead put its logic inside -// the previous CopyArray() function, arrays with different sizes -// would lead to different copies of the template code. -template -void CopyArray(const T* from, size_t size, U* to) { - for (size_t i = 0; i != size; i++) { - internal::CopyArray(from[i], to + i); - } -} - -// The relation between an NativeArray object (see below) and the -// native array it represents. -enum RelationToSource { - kReference, // The NativeArray references the native array. - kCopy // The NativeArray makes a copy of the native array and - // owns the copy. -}; - -// Adapts a native array to a read-only STL-style container. Instead -// of the complete STL container concept, this adaptor only implements -// members useful for Google Mock's container matchers. New members -// should be added as needed. To simplify the implementation, we only -// support Element being a raw type (i.e. having no top-level const or -// reference modifier). It's the client's responsibility to satisfy -// this requirement. Element can be an array type itself (hence -// multi-dimensional arrays are supported). -template -class NativeArray { - public: - // STL-style container typedefs. - typedef Element value_type; - typedef Element* iterator; - typedef const Element* const_iterator; - - // Constructs from a native array. - NativeArray(const Element* array, size_t count, RelationToSource relation) { - Init(array, count, relation); - } - - // Copy constructor. - NativeArray(const NativeArray& rhs) { - Init(rhs.array_, rhs.size_, rhs.relation_to_source_); - } - - ~NativeArray() { - // Ensures that the user doesn't instantiate NativeArray with a - // const or reference type. - static_cast(StaticAssertTypeEqHelper()); - if (relation_to_source_ == kCopy) - delete[] array_; - } - - // STL-style container methods. - size_t size() const { return size_; } - const_iterator begin() const { return array_; } - const_iterator end() const { return array_ + size_; } - bool operator==(const NativeArray& rhs) const { - return size() == rhs.size() && - ArrayEq(begin(), size(), rhs.begin()); - } - - private: - // Initializes this object; makes a copy of the input array if - // 'relation' is kCopy. - void Init(const Element* array, size_t a_size, RelationToSource relation) { - if (relation == kReference) { - array_ = array; - } else { - Element* const copy = new Element[a_size]; - CopyArray(array, a_size, copy); - array_ = copy; - } - size_ = a_size; - relation_to_source_ = relation; - } - - const Element* array_; - size_t size_; - RelationToSource relation_to_source_; - - GTEST_DISALLOW_ASSIGN_(NativeArray); -}; - -} // namespace internal -} // namespace testing - -#define GTEST_MESSAGE_AT_(file, line, message, result_type) \ - ::testing::internal::AssertHelper(result_type, file, line, message) \ - = ::testing::Message() - -#define GTEST_MESSAGE_(message, result_type) \ - GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type) - -#define GTEST_FATAL_FAILURE_(message) \ - return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure) - -#define GTEST_NONFATAL_FAILURE_(message) \ - GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure) - -#define GTEST_SUCCESS_(message) \ - GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess) - -// Suppresses MSVC warnings 4072 (unreachable code) for the code following -// statement if it returns or throws (or doesn't return or throw in some -// situations). -#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \ - if (::testing::internal::AlwaysTrue()) { statement; } - -#define GTEST_TEST_THROW_(statement, expected_exception, fail) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::ConstCharPtr gtest_msg = "") { \ - bool gtest_caught_expected = false; \ - try { \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - } \ - catch (expected_exception const&) { \ - gtest_caught_expected = true; \ - } \ - catch (...) { \ - gtest_msg.value = \ - "Expected: " #statement " throws an exception of type " \ - #expected_exception ".\n Actual: it throws a different type."; \ - goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \ - } \ - if (!gtest_caught_expected) { \ - gtest_msg.value = \ - "Expected: " #statement " throws an exception of type " \ - #expected_exception ".\n Actual: it throws nothing."; \ - goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \ - } \ - } else \ - GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \ - fail(gtest_msg.value) - -#define GTEST_TEST_NO_THROW_(statement, fail) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - try { \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - } \ - catch (...) { \ - goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \ - } \ - } else \ - GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \ - fail("Expected: " #statement " doesn't throw an exception.\n" \ - " Actual: it throws.") - -#define GTEST_TEST_ANY_THROW_(statement, fail) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - bool gtest_caught_any = false; \ - try { \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - } \ - catch (...) { \ - gtest_caught_any = true; \ - } \ - if (!gtest_caught_any) { \ - goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \ - } \ - } else \ - GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \ - fail("Expected: " #statement " throws an exception.\n" \ - " Actual: it doesn't.") - - -// Implements Boolean test assertions such as EXPECT_TRUE. expression can be -// either a boolean expression or an AssertionResult. text is a textual -// represenation of expression as it was passed into the EXPECT_TRUE. -#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (const ::testing::AssertionResult gtest_ar_ = \ - ::testing::AssertionResult(expression)) \ - ; \ - else \ - fail(::testing::internal::GetBoolAssertionFailureMessage(\ - gtest_ar_, text, #actual, #expected).c_str()) - -#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \ - goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \ - } \ - } else \ - GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \ - fail("Expected: " #statement " doesn't generate new fatal " \ - "failures in the current thread.\n" \ - " Actual: it does.") - -// Expands to the name of the class that implements the given test. -#define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ - test_case_name##_##test_name##_Test - -// Helper macro for defining tests. -#define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\ -class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\ - public:\ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\ - private:\ - virtual void TestBody();\ - static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\ - GTEST_DISALLOW_COPY_AND_ASSIGN_(\ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\ -};\ -\ -::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\ - ::test_info_ =\ - ::testing::internal::MakeAndRegisterTestInfo(\ - #test_case_name, #test_name, NULL, NULL, \ - (parent_id), \ - parent_class::SetUpTestCase, \ - parent_class::TearDownTestCase, \ - new ::testing::internal::TestFactoryImpl<\ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\ -void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_ -// Copyright 2005, Google 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "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 THE COPYRIGHT -// OWNER 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. -// -// Author: wan@google.com (Zhanyong Wan) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file defines the public API for death tests. It is -// #included by gtest.h so a user doesn't need to include this -// directly. - -#ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ -#define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ - -// Copyright 2005, Google 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "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 THE COPYRIGHT -// OWNER 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. -// -// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file defines internal utilities needed for implementing -// death tests. They are subject to change without notice. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ - - -#include - -namespace testing { -namespace internal { - -GTEST_DECLARE_string_(internal_run_death_test); - -// Names of the flags (needed for parsing Google Test flags). -const char kDeathTestStyleFlag[] = "death_test_style"; -const char kDeathTestUseFork[] = "death_test_use_fork"; -const char kInternalRunDeathTestFlag[] = "internal_run_death_test"; - -#if GTEST_HAS_DEATH_TEST - -// DeathTest is a class that hides much of the complexity of the -// GTEST_DEATH_TEST_ macro. It is abstract; its static Create method -// returns a concrete class that depends on the prevailing death test -// style, as defined by the --gtest_death_test_style and/or -// --gtest_internal_run_death_test flags. - -// In describing the results of death tests, these terms are used with -// the corresponding definitions: -// -// exit status: The integer exit information in the format specified -// by wait(2) -// exit code: The integer code passed to exit(3), _exit(2), or -// returned from main() -class GTEST_API_ DeathTest { - public: - // Create returns false if there was an error determining the - // appropriate action to take for the current death test; for example, - // if the gtest_death_test_style flag is set to an invalid value. - // The LastMessage method will return a more detailed message in that - // case. Otherwise, the DeathTest pointer pointed to by the "test" - // argument is set. If the death test should be skipped, the pointer - // is set to NULL; otherwise, it is set to the address of a new concrete - // DeathTest object that controls the execution of the current test. - static bool Create(const char* statement, const RE* regex, - const char* file, int line, DeathTest** test); - DeathTest(); - virtual ~DeathTest() { } - - // A helper class that aborts a death test when it's deleted. - class ReturnSentinel { - public: - explicit ReturnSentinel(DeathTest* test) : test_(test) { } - ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); } - private: - DeathTest* const test_; - GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel); - } GTEST_ATTRIBUTE_UNUSED_; - - // An enumeration of possible roles that may be taken when a death - // test is encountered. EXECUTE means that the death test logic should - // be executed immediately. OVERSEE means that the program should prepare - // the appropriate environment for a child process to execute the death - // test, then wait for it to complete. - enum TestRole { OVERSEE_TEST, EXECUTE_TEST }; - - // An enumeration of the three reasons that a test might be aborted. - enum AbortReason { - TEST_ENCOUNTERED_RETURN_STATEMENT, - TEST_THREW_EXCEPTION, - TEST_DID_NOT_DIE - }; - - // Assumes one of the above roles. - virtual TestRole AssumeRole() = 0; - - // Waits for the death test to finish and returns its status. - virtual int Wait() = 0; - - // Returns true if the death test passed; that is, the test process - // exited during the test, its exit status matches a user-supplied - // predicate, and its stderr output matches a user-supplied regular - // expression. - // The user-supplied predicate may be a macro expression rather - // than a function pointer or functor, or else Wait and Passed could - // be combined. - virtual bool Passed(bool exit_status_ok) = 0; - - // Signals that the death test did not die as expected. - virtual void Abort(AbortReason reason) = 0; - - // Returns a human-readable outcome message regarding the outcome of - // the last death test. - static const char* LastMessage(); - - static void set_last_death_test_message(const std::string& message); - - private: - // A string containing a description of the outcome of the last death test. - static std::string last_death_test_message_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest); -}; - -// Factory interface for death tests. May be mocked out for testing. -class DeathTestFactory { - public: - virtual ~DeathTestFactory() { } - virtual bool Create(const char* statement, const RE* regex, - const char* file, int line, DeathTest** test) = 0; -}; - -// A concrete DeathTestFactory implementation for normal use. -class DefaultDeathTestFactory : public DeathTestFactory { - public: - virtual bool Create(const char* statement, const RE* regex, - const char* file, int line, DeathTest** test); -}; - -// Returns true if exit_status describes a process that was terminated -// by a signal, or exited normally with a nonzero exit code. -GTEST_API_ bool ExitedUnsuccessfully(int exit_status); - -// Traps C++ exceptions escaping statement and reports them as test -// failures. Note that trapping SEH exceptions is not implemented here. -# if GTEST_HAS_EXCEPTIONS -# define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \ - try { \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - } catch (const ::std::exception& gtest_exception) { \ - fprintf(\ - stderr, \ - "\n%s: Caught std::exception-derived exception escaping the " \ - "death test statement. Exception message: %s\n", \ - ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \ - gtest_exception.what()); \ - fflush(stderr); \ - death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \ - } catch (...) { \ - death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \ - } - -# else -# define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) - -# endif - -// This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*, -// ASSERT_EXIT*, and EXPECT_EXIT*. -# define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - const ::testing::internal::RE& gtest_regex = (regex); \ - ::testing::internal::DeathTest* gtest_dt; \ - if (!::testing::internal::DeathTest::Create(#statement, >est_regex, \ - __FILE__, __LINE__, >est_dt)) { \ - goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \ - } \ - if (gtest_dt != NULL) { \ - ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \ - gtest_dt_ptr(gtest_dt); \ - switch (gtest_dt->AssumeRole()) { \ - case ::testing::internal::DeathTest::OVERSEE_TEST: \ - if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \ - goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \ - } \ - break; \ - case ::testing::internal::DeathTest::EXECUTE_TEST: { \ - ::testing::internal::DeathTest::ReturnSentinel \ - gtest_sentinel(gtest_dt); \ - GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \ - gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \ - break; \ - } \ - default: \ - break; \ - } \ - } \ - } else \ - GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \ - fail(::testing::internal::DeathTest::LastMessage()) -// The symbol "fail" here expands to something into which a message -// can be streamed. - -// This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in -// NDEBUG mode. In this case we need the statements to be executed, the regex is -// ignored, and the macro must accept a streamed message even though the message -// is never printed. -# define GTEST_EXECUTE_STATEMENT_(statement, regex) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - } else \ - ::testing::Message() - -// A class representing the parsed contents of the -// --gtest_internal_run_death_test flag, as it existed when -// RUN_ALL_TESTS was called. -class InternalRunDeathTestFlag { - public: - InternalRunDeathTestFlag(const std::string& a_file, - int a_line, - int an_index, - int a_write_fd) - : file_(a_file), line_(a_line), index_(an_index), - write_fd_(a_write_fd) {} - - ~InternalRunDeathTestFlag() { - if (write_fd_ >= 0) - posix::Close(write_fd_); - } - - const std::string& file() const { return file_; } - int line() const { return line_; } - int index() const { return index_; } - int write_fd() const { return write_fd_; } - - private: - std::string file_; - int line_; - int index_; - int write_fd_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag); -}; - -// Returns a newly created InternalRunDeathTestFlag object with fields -// initialized from the GTEST_FLAG(internal_run_death_test) flag if -// the flag is specified; otherwise returns NULL. -InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag(); - -#else // GTEST_HAS_DEATH_TEST - -// This macro is used for implementing macros such as -// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where -// death tests are not supported. Those macros must compile on such systems -// iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on -// systems that support death tests. This allows one to write such a macro -// on a system that does not support death tests and be sure that it will -// compile on a death-test supporting system. -// -// Parameters: -// statement - A statement that a macro such as EXPECT_DEATH would test -// for program termination. This macro has to make sure this -// statement is compiled but not executed, to ensure that -// EXPECT_DEATH_IF_SUPPORTED compiles with a certain -// parameter iff EXPECT_DEATH compiles with it. -// regex - A regex that a macro such as EXPECT_DEATH would use to test -// the output of statement. This parameter has to be -// compiled but not evaluated by this macro, to ensure that -// this macro only accepts expressions that a macro such as -// EXPECT_DEATH would accept. -// terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED -// and a return statement for ASSERT_DEATH_IF_SUPPORTED. -// This ensures that ASSERT_DEATH_IF_SUPPORTED will not -// compile inside functions where ASSERT_DEATH doesn't -// compile. -// -// The branch that has an always false condition is used to ensure that -// statement and regex are compiled (and thus syntactically correct) but -// never executed. The unreachable code macro protects the terminator -// statement from generating an 'unreachable code' warning in case -// statement unconditionally returns or throws. The Message constructor at -// the end allows the syntax of streaming additional messages into the -// macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH. -# define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - GTEST_LOG_(WARNING) \ - << "Death tests are not supported on this platform.\n" \ - << "Statement '" #statement "' cannot be verified."; \ - } else if (::testing::internal::AlwaysFalse()) { \ - ::testing::internal::RE::PartialMatch(".*", (regex)); \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - terminator; \ - } else \ - ::testing::Message() - -#endif // GTEST_HAS_DEATH_TEST - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ - -namespace testing { - -// This flag controls the style of death tests. Valid values are "threadsafe", -// meaning that the death test child process will re-execute the test binary -// from the start, running only a single death test, or "fast", -// meaning that the child process will execute the test logic immediately -// after forking. -GTEST_DECLARE_string_(death_test_style); - -#if GTEST_HAS_DEATH_TEST - -namespace internal { - -// Returns a Boolean value indicating whether the caller is currently -// executing in the context of the death test child process. Tools such as -// Valgrind heap checkers may need this to modify their behavior in death -// tests. IMPORTANT: This is an internal utility. Using it may break the -// implementation of death tests. User code MUST NOT use it. -GTEST_API_ bool InDeathTestChild(); - -} // namespace internal - -// The following macros are useful for writing death tests. - -// Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is -// executed: -// -// 1. It generates a warning if there is more than one active -// thread. This is because it's safe to fork() or clone() only -// when there is a single thread. -// -// 2. The parent process clone()s a sub-process and runs the death -// test in it; the sub-process exits with code 0 at the end of the -// death test, if it hasn't exited already. -// -// 3. The parent process waits for the sub-process to terminate. -// -// 4. The parent process checks the exit code and error message of -// the sub-process. -// -// Examples: -// -// ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number"); -// for (int i = 0; i < 5; i++) { -// EXPECT_DEATH(server.ProcessRequest(i), -// "Invalid request .* in ProcessRequest()") -// << "Failed to die on request " << i; -// } -// -// ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting"); -// -// bool KilledBySIGHUP(int exit_code) { -// return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP; -// } -// -// ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!"); -// -// On the regular expressions used in death tests: -// -// On POSIX-compliant systems (*nix), we use the library, -// which uses the POSIX extended regex syntax. -// -// On other platforms (e.g. Windows), we only support a simple regex -// syntax implemented as part of Google Test. This limited -// implementation should be enough most of the time when writing -// death tests; though it lacks many features you can find in PCRE -// or POSIX extended regex syntax. For example, we don't support -// union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and -// repetition count ("x{5,7}"), among others. -// -// Below is the syntax that we do support. We chose it to be a -// subset of both PCRE and POSIX extended regex, so it's easy to -// learn wherever you come from. In the following: 'A' denotes a -// literal character, period (.), or a single \\ escape sequence; -// 'x' and 'y' denote regular expressions; 'm' and 'n' are for -// natural numbers. -// -// c matches any literal character c -// \\d matches any decimal digit -// \\D matches any character that's not a decimal digit -// \\f matches \f -// \\n matches \n -// \\r matches \r -// \\s matches any ASCII whitespace, including \n -// \\S matches any character that's not a whitespace -// \\t matches \t -// \\v matches \v -// \\w matches any letter, _, or decimal digit -// \\W matches any character that \\w doesn't match -// \\c matches any literal character c, which must be a punctuation -// . matches any single character except \n -// A? matches 0 or 1 occurrences of A -// A* matches 0 or many occurrences of A -// A+ matches 1 or many occurrences of A -// ^ matches the beginning of a string (not that of each line) -// $ matches the end of a string (not that of each line) -// xy matches x followed by y -// -// If you accidentally use PCRE or POSIX extended regex features -// not implemented by us, you will get a run-time failure. In that -// case, please try to rewrite your regular expression within the -// above syntax. -// -// This implementation is *not* meant to be as highly tuned or robust -// as a compiled regex library, but should perform well enough for a -// death test, which already incurs significant overhead by launching -// a child process. -// -// Known caveats: -// -// A "threadsafe" style death test obtains the path to the test -// program from argv[0] and re-executes it in the sub-process. For -// simplicity, the current implementation doesn't search the PATH -// when launching the sub-process. This means that the user must -// invoke the test program via a path that contains at least one -// path separator (e.g. path/to/foo_test and -// /absolute/path/to/bar_test are fine, but foo_test is not). This -// is rarely a problem as people usually don't put the test binary -// directory in PATH. -// -// TODO(wan@google.com): make thread-safe death tests search the PATH. - -// Asserts that a given statement causes the program to exit, with an -// integer exit status that satisfies predicate, and emitting error output -// that matches regex. -# define ASSERT_EXIT(statement, predicate, regex) \ - GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) - -// Like ASSERT_EXIT, but continues on to successive tests in the -// test case, if any: -# define EXPECT_EXIT(statement, predicate, regex) \ - GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) - -// Asserts that a given statement causes the program to exit, either by -// explicitly exiting with a nonzero exit code or being killed by a -// signal, and emitting error output that matches regex. -# define ASSERT_DEATH(statement, regex) \ - ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) - -// Like ASSERT_DEATH, but continues on to successive tests in the -// test case, if any: -# define EXPECT_DEATH(statement, regex) \ - EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) - -// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: - -// Tests that an exit code describes a normal exit with a given exit code. -class GTEST_API_ ExitedWithCode { - public: - explicit ExitedWithCode(int exit_code); - bool operator()(int exit_status) const; - private: - // No implementation - assignment is unsupported. - void operator=(const ExitedWithCode& other); - - const int exit_code_; -}; - -# if !GTEST_OS_WINDOWS -// Tests that an exit code describes an exit due to termination by a -// given signal. -class GTEST_API_ KilledBySignal { - public: - explicit KilledBySignal(int signum); - bool operator()(int exit_status) const; - private: - const int signum_; -}; -# endif // !GTEST_OS_WINDOWS - -// EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode. -// The death testing framework causes this to have interesting semantics, -// since the sideeffects of the call are only visible in opt mode, and not -// in debug mode. -// -// In practice, this can be used to test functions that utilize the -// LOG(DFATAL) macro using the following style: -// -// int DieInDebugOr12(int* sideeffect) { -// if (sideeffect) { -// *sideeffect = 12; -// } -// LOG(DFATAL) << "death"; -// return 12; -// } -// -// TEST(TestCase, TestDieOr12WorksInDgbAndOpt) { -// int sideeffect = 0; -// // Only asserts in dbg. -// EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death"); -// -// #ifdef NDEBUG -// // opt-mode has sideeffect visible. -// EXPECT_EQ(12, sideeffect); -// #else -// // dbg-mode no visible sideeffect. -// EXPECT_EQ(0, sideeffect); -// #endif -// } -// -// This will assert that DieInDebugReturn12InOpt() crashes in debug -// mode, usually due to a DCHECK or LOG(DFATAL), but returns the -// appropriate fallback value (12 in this case) in opt mode. If you -// need to test that a function has appropriate side-effects in opt -// mode, include assertions against the side-effects. A general -// pattern for this is: -// -// EXPECT_DEBUG_DEATH({ -// // Side-effects here will have an effect after this statement in -// // opt mode, but none in debug mode. -// EXPECT_EQ(12, DieInDebugOr12(&sideeffect)); -// }, "death"); -// -# ifdef NDEBUG - -# define EXPECT_DEBUG_DEATH(statement, regex) \ - GTEST_EXECUTE_STATEMENT_(statement, regex) - -# define ASSERT_DEBUG_DEATH(statement, regex) \ - GTEST_EXECUTE_STATEMENT_(statement, regex) - -# else - -# define EXPECT_DEBUG_DEATH(statement, regex) \ - EXPECT_DEATH(statement, regex) - -# define ASSERT_DEBUG_DEATH(statement, regex) \ - ASSERT_DEATH(statement, regex) - -# endif // NDEBUG for EXPECT_DEBUG_DEATH -#endif // GTEST_HAS_DEATH_TEST - -// EXPECT_DEATH_IF_SUPPORTED(statement, regex) and -// ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if -// death tests are supported; otherwise they just issue a warning. This is -// useful when you are combining death test assertions with normal test -// assertions in one test. -#if GTEST_HAS_DEATH_TEST -# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ - EXPECT_DEATH(statement, regex) -# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ - ASSERT_DEATH(statement, regex) -#else -# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ - GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, ) -# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ - GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return) -#endif - -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ -// This file was GENERATED by command: -// pump.py gtest-param-test.h.pump -// DO NOT EDIT BY HAND!!! - -// Copyright 2008, Google 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "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 THE COPYRIGHT -// OWNER 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. -// -// Authors: vladl@google.com (Vlad Losev) -// -// Macros and functions for implementing parameterized tests -// in Google C++ Testing Framework (Google Test) -// -// This file is generated by a SCRIPT. DO NOT EDIT BY HAND! -// -#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ -#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ - - -// Value-parameterized tests allow you to test your code with different -// parameters without writing multiple copies of the same test. -// -// Here is how you use value-parameterized tests: - -#if 0 - -// To write value-parameterized tests, first you should define a fixture -// class. It is usually derived from testing::TestWithParam (see below for -// another inheritance scheme that's sometimes useful in more complicated -// class hierarchies), where the type of your parameter values. -// TestWithParam is itself derived from testing::Test. T can be any -// copyable type. If it's a raw pointer, you are responsible for managing the -// lifespan of the pointed values. - -class FooTest : public ::testing::TestWithParam { - // You can implement all the usual class fixture members here. -}; - -// Then, use the TEST_P macro to define as many parameterized tests -// for this fixture as you want. The _P suffix is for "parameterized" -// or "pattern", whichever you prefer to think. - -TEST_P(FooTest, DoesBlah) { - // Inside a test, access the test parameter with the GetParam() method - // of the TestWithParam class: - EXPECT_TRUE(foo.Blah(GetParam())); - ... -} - -TEST_P(FooTest, HasBlahBlah) { - ... -} - -// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test -// case with any set of parameters you want. Google Test defines a number -// of functions for generating test parameters. They return what we call -// (surprise!) parameter generators. Here is a summary of them, which -// are all in the testing namespace: -// -// -// Range(begin, end [, step]) - Yields values {begin, begin+step, -// begin+step+step, ...}. The values do not -// include end. step defaults to 1. -// Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}. -// ValuesIn(container) - Yields values from a C-style array, an STL -// ValuesIn(begin,end) container, or an iterator range [begin, end). -// Bool() - Yields sequence {false, true}. -// Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product -// for the math savvy) of the values generated -// by the N generators. -// -// For more details, see comments at the definitions of these functions below -// in this file. -// -// The following statement will instantiate tests from the FooTest test case -// each with parameter values "meeny", "miny", and "moe". - -INSTANTIATE_TEST_CASE_P(InstantiationName, - FooTest, - Values("meeny", "miny", "moe")); - -// To distinguish different instances of the pattern, (yes, you -// can instantiate it more then once) the first argument to the -// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the -// actual test case name. Remember to pick unique prefixes for different -// instantiations. The tests from the instantiation above will have -// these names: -// -// * InstantiationName/FooTest.DoesBlah/0 for "meeny" -// * InstantiationName/FooTest.DoesBlah/1 for "miny" -// * InstantiationName/FooTest.DoesBlah/2 for "moe" -// * InstantiationName/FooTest.HasBlahBlah/0 for "meeny" -// * InstantiationName/FooTest.HasBlahBlah/1 for "miny" -// * InstantiationName/FooTest.HasBlahBlah/2 for "moe" -// -// You can use these names in --gtest_filter. -// -// This statement will instantiate all tests from FooTest again, each -// with parameter values "cat" and "dog": - -const char* pets[] = {"cat", "dog"}; -INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets)); - -// The tests from the instantiation above will have these names: -// -// * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat" -// * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog" -// * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat" -// * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog" -// -// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests -// in the given test case, whether their definitions come before or -// AFTER the INSTANTIATE_TEST_CASE_P statement. -// -// Please also note that generator expressions (including parameters to the -// generators) are evaluated in InitGoogleTest(), after main() has started. -// This allows the user on one hand, to adjust generator parameters in order -// to dynamically determine a set of tests to run and on the other hand, -// give the user a chance to inspect the generated tests with Google Test -// reflection API before RUN_ALL_TESTS() is executed. -// -// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc -// for more examples. -// -// In the future, we plan to publish the API for defining new parameter -// generators. But for now this interface remains part of the internal -// implementation and is subject to change. -// -// -// A parameterized test fixture must be derived from testing::Test and from -// testing::WithParamInterface, where T is the type of the parameter -// values. Inheriting from TestWithParam satisfies that requirement because -// TestWithParam inherits from both Test and WithParamInterface. In more -// complicated hierarchies, however, it is occasionally useful to inherit -// separately from Test and WithParamInterface. For example: - -class BaseTest : public ::testing::Test { - // You can inherit all the usual members for a non-parameterized test - // fixture here. -}; - -class DerivedTest : public BaseTest, public ::testing::WithParamInterface { - // The usual test fixture members go here too. -}; - -TEST_F(BaseTest, HasFoo) { - // This is an ordinary non-parameterized test. -} - -TEST_P(DerivedTest, DoesBlah) { - // GetParam works just the same here as if you inherit from TestWithParam. - EXPECT_TRUE(foo.Blah(GetParam())); -} - -#endif // 0 - - -#if !GTEST_OS_SYMBIAN -# include -#endif - -// scripts/fuse_gtest.py depends on gtest's own header being #included -// *unconditionally*. Therefore these #includes cannot be moved -// inside #if GTEST_HAS_PARAM_TEST. -// Copyright 2008 Google 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "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 THE COPYRIGHT -// OWNER 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. -// -// Author: vladl@google.com (Vlad Losev) - -// Type and function utilities for implementing parameterized tests. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_ - -#include -#include -#include - -// scripts/fuse_gtest.py depends on gtest's own header being #included -// *unconditionally*. Therefore these #includes cannot be moved -// inside #if GTEST_HAS_PARAM_TEST. -// Copyright 2003 Google 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "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 THE COPYRIGHT -// OWNER 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. -// -// Authors: Dan Egnor (egnor@google.com) -// -// A "smart" pointer type with reference tracking. Every pointer to a -// particular object is kept on a circular linked list. When the last pointer -// to an object is destroyed or reassigned, the object is deleted. -// -// Used properly, this deletes the object when the last reference goes away. -// There are several caveats: -// - Like all reference counting schemes, cycles lead to leaks. -// - Each smart pointer is actually two pointers (8 bytes instead of 4). -// - Every time a pointer is assigned, the entire list of pointers to that -// object is traversed. This class is therefore NOT SUITABLE when there -// will often be more than two or three pointers to a particular object. -// - References are only tracked as long as linked_ptr<> objects are copied. -// If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS -// will happen (double deletion). -// -// A good use of this class is storing object references in STL containers. -// You can safely put linked_ptr<> in a vector<>. -// Other uses may not be as good. -// -// Note: If you use an incomplete type with linked_ptr<>, the class -// *containing* linked_ptr<> must have a constructor and destructor (even -// if they do nothing!). -// -// Bill Gibbons suggested we use something like this. -// -// Thread Safety: -// Unlike other linked_ptr implementations, in this implementation -// a linked_ptr object is thread-safe in the sense that: -// - it's safe to copy linked_ptr objects concurrently, -// - it's safe to copy *from* a linked_ptr and read its underlying -// raw pointer (e.g. via get()) concurrently, and -// - it's safe to write to two linked_ptrs that point to the same -// shared object concurrently. -// TODO(wan@google.com): rename this to safe_linked_ptr to avoid -// confusion with normal linked_ptr. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_ - -#include -#include - - -namespace testing { -namespace internal { - -// Protects copying of all linked_ptr objects. -GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex); - -// This is used internally by all instances of linked_ptr<>. It needs to be -// a non-template class because different types of linked_ptr<> can refer to -// the same object (linked_ptr(obj) vs linked_ptr(obj)). -// So, it needs to be possible for different types of linked_ptr to participate -// in the same circular linked list, so we need a single class type here. -// -// DO NOT USE THIS CLASS DIRECTLY YOURSELF. Use linked_ptr. -class linked_ptr_internal { - public: - // Create a new circle that includes only this instance. - void join_new() { - next_ = this; - } - - // Many linked_ptr operations may change p.link_ for some linked_ptr - // variable p in the same circle as this object. Therefore we need - // to prevent two such operations from occurring concurrently. - // - // Note that different types of linked_ptr objects can coexist in a - // circle (e.g. linked_ptr, linked_ptr, and - // linked_ptr). Therefore we must use a single mutex to - // protect all linked_ptr objects. This can create serious - // contention in production code, but is acceptable in a testing - // framework. - - // Join an existing circle. - void join(linked_ptr_internal const* ptr) - GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) { - MutexLock lock(&g_linked_ptr_mutex); - - linked_ptr_internal const* p = ptr; - while (p->next_ != ptr) p = p->next_; - p->next_ = this; - next_ = ptr; - } - - // Leave whatever circle we're part of. Returns true if we were the - // last member of the circle. Once this is done, you can join() another. - bool depart() - GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) { - MutexLock lock(&g_linked_ptr_mutex); - - if (next_ == this) return true; - linked_ptr_internal const* p = next_; - while (p->next_ != this) p = p->next_; - p->next_ = next_; - return false; - } - - private: - mutable linked_ptr_internal const* next_; -}; - -template -class linked_ptr { - public: - typedef T element_type; - - // Take over ownership of a raw pointer. This should happen as soon as - // possible after the object is created. - explicit linked_ptr(T* ptr = NULL) { capture(ptr); } - ~linked_ptr() { depart(); } - - // Copy an existing linked_ptr<>, adding ourselves to the list of references. - template linked_ptr(linked_ptr const& ptr) { copy(&ptr); } - linked_ptr(linked_ptr const& ptr) { // NOLINT - assert(&ptr != this); - copy(&ptr); - } - - // Assignment releases the old value and acquires the new. - template linked_ptr& operator=(linked_ptr const& ptr) { - depart(); - copy(&ptr); - return *this; - } - - linked_ptr& operator=(linked_ptr const& ptr) { - if (&ptr != this) { - depart(); - copy(&ptr); - } - return *this; - } - - // Smart pointer members. - void reset(T* ptr = NULL) { - depart(); - capture(ptr); - } - T* get() const { return value_; } - T* operator->() const { return value_; } - T& operator*() const { return *value_; } - - bool operator==(T* p) const { return value_ == p; } - bool operator!=(T* p) const { return value_ != p; } - template - bool operator==(linked_ptr const& ptr) const { - return value_ == ptr.get(); - } - template - bool operator!=(linked_ptr const& ptr) const { - return value_ != ptr.get(); - } - - private: - template - friend class linked_ptr; - - T* value_; - linked_ptr_internal link_; - - void depart() { - if (link_.depart()) delete value_; - } - - void capture(T* ptr) { - value_ = ptr; - link_.join_new(); - } - - template void copy(linked_ptr const* ptr) { - value_ = ptr->get(); - if (value_) - link_.join(&ptr->link_); - else - link_.join_new(); - } -}; - -template inline -bool operator==(T* ptr, const linked_ptr& x) { - return ptr == x.get(); -} - -template inline -bool operator!=(T* ptr, const linked_ptr& x) { - return ptr != x.get(); -} - -// A function to convert T* into linked_ptr -// Doing e.g. make_linked_ptr(new FooBarBaz(arg)) is a shorter notation -// for linked_ptr >(new FooBarBaz(arg)) -template -linked_ptr make_linked_ptr(T* ptr) { - return linked_ptr(ptr); -} - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_ -// Copyright 2007, Google 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "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 THE COPYRIGHT -// OWNER 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. -// -// Author: wan@google.com (Zhanyong Wan) - -// Google Test - The Google C++ Testing Framework -// -// This file implements a universal value printer that can print a -// value of any type T: -// -// void ::testing::internal::UniversalPrinter::Print(value, ostream_ptr); -// -// A user can teach this function how to print a class type T by -// defining either operator<<() or PrintTo() in the namespace that -// defines T. More specifically, the FIRST defined function in the -// following list will be used (assuming T is defined in namespace -// foo): -// -// 1. foo::PrintTo(const T&, ostream*) -// 2. operator<<(ostream&, const T&) defined in either foo or the -// global namespace. -// -// If none of the above is defined, it will print the debug string of -// the value if it is a protocol buffer, or print the raw bytes in the -// value otherwise. -// -// To aid debugging: when T is a reference type, the address of the -// value is also printed; when T is a (const) char pointer, both the -// pointer value and the NUL-terminated string it points to are -// printed. -// -// We also provide some convenient wrappers: -// -// // Prints a value to a string. For a (const or not) char -// // pointer, the NUL-terminated string (but not the pointer) is -// // printed. -// std::string ::testing::PrintToString(const T& value); -// -// // Prints a value tersely: for a reference type, the referenced -// // value (but not the address) is printed; for a (const or not) char -// // pointer, the NUL-terminated string (but not the pointer) is -// // printed. -// void ::testing::internal::UniversalTersePrint(const T& value, ostream*); -// -// // Prints value using the type inferred by the compiler. The difference -// // from UniversalTersePrint() is that this function prints both the -// // pointer and the NUL-terminated string for a (const or not) char pointer. -// void ::testing::internal::UniversalPrint(const T& value, ostream*); -// -// // Prints the fields of a tuple tersely to a string vector, one -// // element for each field. Tuple support must be enabled in -// // gtest-port.h. -// std::vector UniversalTersePrintTupleFieldsToStrings( -// const Tuple& value); -// -// Known limitation: -// -// The print primitives print the elements of an STL-style container -// using the compiler-inferred type of *iter where iter is a -// const_iterator of the container. When const_iterator is an input -// iterator but not a forward iterator, this inferred type may not -// match value_type, and the print output may be incorrect. In -// practice, this is rarely a problem as for most containers -// const_iterator is a forward iterator. We'll fix this if there's an -// actual need for it. Note that this fix cannot rely on value_type -// being defined as many user-defined container types don't have -// value_type. - -#ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ -#define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ - -#include // NOLINT -#include -#include -#include -#include - -namespace testing { - -// Definitions in the 'internal' and 'internal2' name spaces are -// subject to change without notice. DO NOT USE THEM IN USER CODE! -namespace internal2 { - -// Prints the given number of bytes in the given object to the given -// ostream. -GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes, - size_t count, - ::std::ostream* os); - -// For selecting which printer to use when a given type has neither << -// nor PrintTo(). -enum TypeKind { - kProtobuf, // a protobuf type - kConvertibleToInteger, // a type implicitly convertible to BiggestInt - // (e.g. a named or unnamed enum type) - kOtherType // anything else -}; - -// TypeWithoutFormatter::PrintValue(value, os) is called -// by the universal printer to print a value of type T when neither -// operator<< nor PrintTo() is defined for T, where kTypeKind is the -// "kind" of T as defined by enum TypeKind. -template -class TypeWithoutFormatter { - public: - // This default version is called when kTypeKind is kOtherType. - static void PrintValue(const T& value, ::std::ostream* os) { - PrintBytesInObjectTo(reinterpret_cast(&value), - sizeof(value), os); - } -}; - -// We print a protobuf using its ShortDebugString() when the string -// doesn't exceed this many characters; otherwise we print it using -// DebugString() for better readability. -const size_t kProtobufOneLinerMaxLength = 50; - -template -class TypeWithoutFormatter { - public: - static void PrintValue(const T& value, ::std::ostream* os) { - const ::testing::internal::string short_str = value.ShortDebugString(); - const ::testing::internal::string pretty_str = - short_str.length() <= kProtobufOneLinerMaxLength ? - short_str : ("\n" + value.DebugString()); - *os << ("<" + pretty_str + ">"); - } -}; - -template -class TypeWithoutFormatter { - public: - // Since T has no << operator or PrintTo() but can be implicitly - // converted to BiggestInt, we print it as a BiggestInt. - // - // Most likely T is an enum type (either named or unnamed), in which - // case printing it as an integer is the desired behavior. In case - // T is not an enum, printing it as an integer is the best we can do - // given that it has no user-defined printer. - static void PrintValue(const T& value, ::std::ostream* os) { - const internal::BiggestInt kBigInt = value; - *os << kBigInt; - } -}; - -// Prints the given value to the given ostream. If the value is a -// protocol message, its debug string is printed; if it's an enum or -// of a type implicitly convertible to BiggestInt, it's printed as an -// integer; otherwise the bytes in the value are printed. This is -// what UniversalPrinter::Print() does when it knows nothing about -// type T and T has neither << operator nor PrintTo(). -// -// A user can override this behavior for a class type Foo by defining -// a << operator in the namespace where Foo is defined. -// -// We put this operator in namespace 'internal2' instead of 'internal' -// to simplify the implementation, as much code in 'internal' needs to -// use << in STL, which would conflict with our own << were it defined -// in 'internal'. -// -// Note that this operator<< takes a generic std::basic_ostream type instead of the more restricted std::ostream. If -// we define it to take an std::ostream instead, we'll get an -// "ambiguous overloads" compiler error when trying to print a type -// Foo that supports streaming to std::basic_ostream, as the compiler cannot tell whether -// operator<<(std::ostream&, const T&) or -// operator<<(std::basic_stream, const Foo&) is more -// specific. -template -::std::basic_ostream& operator<<( - ::std::basic_ostream& os, const T& x) { - TypeWithoutFormatter::value ? kProtobuf : - internal::ImplicitlyConvertible::value ? - kConvertibleToInteger : kOtherType)>::PrintValue(x, &os); - return os; -} - -} // namespace internal2 -} // namespace testing - -// This namespace MUST NOT BE NESTED IN ::testing, or the name look-up -// magic needed for implementing UniversalPrinter won't work. -namespace testing_internal { - -// Used to print a value that is not an STL-style container when the -// user doesn't define PrintTo() for it. -template -void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) { - // With the following statement, during unqualified name lookup, - // testing::internal2::operator<< appears as if it was declared in - // the nearest enclosing namespace that contains both - // ::testing_internal and ::testing::internal2, i.e. the global - // namespace. For more details, refer to the C++ Standard section - // 7.3.4-1 [namespace.udir]. This allows us to fall back onto - // testing::internal2::operator<< in case T doesn't come with a << - // operator. - // - // We cannot write 'using ::testing::internal2::operator<<;', which - // gcc 3.3 fails to compile due to a compiler bug. - using namespace ::testing::internal2; // NOLINT - - // Assuming T is defined in namespace foo, in the next statement, - // the compiler will consider all of: - // - // 1. foo::operator<< (thanks to Koenig look-up), - // 2. ::operator<< (as the current namespace is enclosed in ::), - // 3. testing::internal2::operator<< (thanks to the using statement above). - // - // The operator<< whose type matches T best will be picked. - // - // We deliberately allow #2 to be a candidate, as sometimes it's - // impossible to define #1 (e.g. when foo is ::std, defining - // anything in it is undefined behavior unless you are a compiler - // vendor.). - *os << value; -} - -} // namespace testing_internal - -namespace testing { -namespace internal { - -// UniversalPrinter::Print(value, ostream_ptr) prints the given -// value to the given ostream. The caller must ensure that -// 'ostream_ptr' is not NULL, or the behavior is undefined. -// -// We define UniversalPrinter as a class template (as opposed to a -// function template), as we need to partially specialize it for -// reference types, which cannot be done with function templates. -template -class UniversalPrinter; - -template -void UniversalPrint(const T& value, ::std::ostream* os); - -// Used to print an STL-style container when the user doesn't define -// a PrintTo() for it. -template -void DefaultPrintTo(IsContainer /* dummy */, - false_type /* is not a pointer */, - const C& container, ::std::ostream* os) { - const size_t kMaxCount = 32; // The maximum number of elements to print. - *os << '{'; - size_t count = 0; - for (typename C::const_iterator it = container.begin(); - it != container.end(); ++it, ++count) { - if (count > 0) { - *os << ','; - if (count == kMaxCount) { // Enough has been printed. - *os << " ..."; - break; - } - } - *os << ' '; - // We cannot call PrintTo(*it, os) here as PrintTo() doesn't - // handle *it being a native array. - internal::UniversalPrint(*it, os); - } - - if (count > 0) { - *os << ' '; - } - *os << '}'; -} - -// Used to print a pointer that is neither a char pointer nor a member -// pointer, when the user doesn't define PrintTo() for it. (A member -// variable pointer or member function pointer doesn't really point to -// a location in the address space. Their representation is -// implementation-defined. Therefore they will be printed as raw -// bytes.) -template -void DefaultPrintTo(IsNotContainer /* dummy */, - true_type /* is a pointer */, - T* p, ::std::ostream* os) { - if (p == NULL) { - *os << "NULL"; - } else { - // C++ doesn't allow casting from a function pointer to any object - // pointer. - // - // IsTrue() silences warnings: "Condition is always true", - // "unreachable code". - if (IsTrue(ImplicitlyConvertible::value)) { - // T is not a function type. We just call << to print p, - // relying on ADL to pick up user-defined << for their pointer - // types, if any. - *os << p; - } else { - // T is a function type, so '*os << p' doesn't do what we want - // (it just prints p as bool). We want to print p as a const - // void*. However, we cannot cast it to const void* directly, - // even using reinterpret_cast, as earlier versions of gcc - // (e.g. 3.4.5) cannot compile the cast when p is a function - // pointer. Casting to UInt64 first solves the problem. - *os << reinterpret_cast( - reinterpret_cast(p)); - } - } -} - -// Used to print a non-container, non-pointer value when the user -// doesn't define PrintTo() for it. -template -void DefaultPrintTo(IsNotContainer /* dummy */, - false_type /* is not a pointer */, - const T& value, ::std::ostream* os) { - ::testing_internal::DefaultPrintNonContainerTo(value, os); -} - -// Prints the given value using the << operator if it has one; -// otherwise prints the bytes in it. This is what -// UniversalPrinter::Print() does when PrintTo() is not specialized -// or overloaded for type T. -// -// A user can override this behavior for a class type Foo by defining -// an overload of PrintTo() in the namespace where Foo is defined. We -// give the user this option as sometimes defining a << operator for -// Foo is not desirable (e.g. the coding style may prevent doing it, -// or there is already a << operator but it doesn't do what the user -// wants). -template -void PrintTo(const T& value, ::std::ostream* os) { - // DefaultPrintTo() is overloaded. The type of its first two - // arguments determine which version will be picked. If T is an - // STL-style container, the version for container will be called; if - // T is a pointer, the pointer version will be called; otherwise the - // generic version will be called. - // - // Note that we check for container types here, prior to we check - // for protocol message types in our operator<<. The rationale is: - // - // For protocol messages, we want to give people a chance to - // override Google Mock's format by defining a PrintTo() or - // operator<<. For STL containers, other formats can be - // incompatible with Google Mock's format for the container - // elements; therefore we check for container types here to ensure - // that our format is used. - // - // The second argument of DefaultPrintTo() is needed to bypass a bug - // in Symbian's C++ compiler that prevents it from picking the right - // overload between: - // - // PrintTo(const T& x, ...); - // PrintTo(T* x, ...); - DefaultPrintTo(IsContainerTest(0), is_pointer(), value, os); -} - -// The following list of PrintTo() overloads tells -// UniversalPrinter::Print() how to print standard types (built-in -// types, strings, plain arrays, and pointers). - -// Overloads for various char types. -GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os); -GTEST_API_ void PrintTo(signed char c, ::std::ostream* os); -inline void PrintTo(char c, ::std::ostream* os) { - // When printing a plain char, we always treat it as unsigned. This - // way, the output won't be affected by whether the compiler thinks - // char is signed or not. - PrintTo(static_cast(c), os); -} - -// Overloads for other simple built-in types. -inline void PrintTo(bool x, ::std::ostream* os) { - *os << (x ? "true" : "false"); -} - -// Overload for wchar_t type. -// Prints a wchar_t as a symbol if it is printable or as its internal -// code otherwise and also as its decimal code (except for L'\0'). -// The L'\0' char is printed as "L'\\0'". The decimal code is printed -// as signed integer when wchar_t is implemented by the compiler -// as a signed type and is printed as an unsigned integer when wchar_t -// is implemented as an unsigned type. -GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); - -// Overloads for C strings. -GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); -inline void PrintTo(char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} - -// signed/unsigned char is often used for representing binary data, so -// we print pointers to it as void* to be safe. -inline void PrintTo(const signed char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} -inline void PrintTo(signed char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} -inline void PrintTo(const unsigned char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} -inline void PrintTo(unsigned char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} - -// MSVC can be configured to define wchar_t as a typedef of unsigned -// short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native -// type. When wchar_t is a typedef, defining an overload for const -// wchar_t* would cause unsigned short* be printed as a wide string, -// possibly causing invalid memory accesses. -#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) -// Overloads for wide C strings -GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os); -inline void PrintTo(wchar_t* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} -#endif - -// Overload for C arrays. Multi-dimensional arrays are printed -// properly. - -// Prints the given number of elements in an array, without printing -// the curly braces. -template -void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) { - UniversalPrint(a[0], os); - for (size_t i = 1; i != count; i++) { - *os << ", "; - UniversalPrint(a[i], os); - } -} - -// Overloads for ::string and ::std::string. -#if GTEST_HAS_GLOBAL_STRING -GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os); -inline void PrintTo(const ::string& s, ::std::ostream* os) { - PrintStringTo(s, os); -} -#endif // GTEST_HAS_GLOBAL_STRING - -GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os); -inline void PrintTo(const ::std::string& s, ::std::ostream* os) { - PrintStringTo(s, os); -} - -// Overloads for ::wstring and ::std::wstring. -#if GTEST_HAS_GLOBAL_WSTRING -GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os); -inline void PrintTo(const ::wstring& s, ::std::ostream* os) { - PrintWideStringTo(s, os); -} -#endif // GTEST_HAS_GLOBAL_WSTRING - -#if GTEST_HAS_STD_WSTRING -GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os); -inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) { - PrintWideStringTo(s, os); -} -#endif // GTEST_HAS_STD_WSTRING - -#if GTEST_HAS_TR1_TUPLE -// Overload for ::std::tr1::tuple. Needed for printing function arguments, -// which are packed as tuples. - -// Helper function for printing a tuple. T must be instantiated with -// a tuple type. -template -void PrintTupleTo(const T& t, ::std::ostream* os); - -// Overloaded PrintTo() for tuples of various arities. We support -// tuples of up-to 10 fields. The following implementation works -// regardless of whether tr1::tuple is implemented using the -// non-standard variadic template feature or not. - -inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo( - const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} -#endif // GTEST_HAS_TR1_TUPLE - -// Overload for std::pair. -template -void PrintTo(const ::std::pair& value, ::std::ostream* os) { - *os << '('; - // We cannot use UniversalPrint(value.first, os) here, as T1 may be - // a reference type. The same for printing value.second. - UniversalPrinter::Print(value.first, os); - *os << ", "; - UniversalPrinter::Print(value.second, os); - *os << ')'; -} - -// Implements printing a non-reference type T by letting the compiler -// pick the right overload of PrintTo() for T. -template -class UniversalPrinter { - public: - // MSVC warns about adding const to a function type, so we want to - // disable the warning. -#ifdef _MSC_VER -# pragma warning(push) // Saves the current warning state. -# pragma warning(disable:4180) // Temporarily disables warning 4180. -#endif // _MSC_VER - - // Note: we deliberately don't call this PrintTo(), as that name - // conflicts with ::testing::internal::PrintTo in the body of the - // function. - static void Print(const T& value, ::std::ostream* os) { - // By default, ::testing::internal::PrintTo() is used for printing - // the value. - // - // Thanks to Koenig look-up, if T is a class and has its own - // PrintTo() function defined in its namespace, that function will - // be visible here. Since it is more specific than the generic ones - // in ::testing::internal, it will be picked by the compiler in the - // following statement - exactly what we want. - PrintTo(value, os); - } - -#ifdef _MSC_VER -# pragma warning(pop) // Restores the warning state. -#endif // _MSC_VER -}; - -// UniversalPrintArray(begin, len, os) prints an array of 'len' -// elements, starting at address 'begin'. -template -void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) { - if (len == 0) { - *os << "{}"; - } else { - *os << "{ "; - const size_t kThreshold = 18; - const size_t kChunkSize = 8; - // If the array has more than kThreshold elements, we'll have to - // omit some details by printing only the first and the last - // kChunkSize elements. - // TODO(wan@google.com): let the user control the threshold using a flag. - if (len <= kThreshold) { - PrintRawArrayTo(begin, len, os); - } else { - PrintRawArrayTo(begin, kChunkSize, os); - *os << ", ..., "; - PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); - } - *os << " }"; - } -} -// This overload prints a (const) char array compactly. -GTEST_API_ void UniversalPrintArray( - const char* begin, size_t len, ::std::ostream* os); - -// This overload prints a (const) wchar_t array compactly. -GTEST_API_ void UniversalPrintArray( - const wchar_t* begin, size_t len, ::std::ostream* os); - -// Implements printing an array type T[N]. -template -class UniversalPrinter { - public: - // Prints the given array, omitting some elements when there are too - // many. - static void Print(const T (&a)[N], ::std::ostream* os) { - UniversalPrintArray(a, N, os); - } -}; - -// Implements printing a reference type T&. -template -class UniversalPrinter { - public: - // MSVC warns about adding const to a function type, so we want to - // disable the warning. -#ifdef _MSC_VER -# pragma warning(push) // Saves the current warning state. -# pragma warning(disable:4180) // Temporarily disables warning 4180. -#endif // _MSC_VER - - static void Print(const T& value, ::std::ostream* os) { - // Prints the address of the value. We use reinterpret_cast here - // as static_cast doesn't compile when T is a function type. - *os << "@" << reinterpret_cast(&value) << " "; - - // Then prints the value itself. - UniversalPrint(value, os); - } - -#ifdef _MSC_VER -# pragma warning(pop) // Restores the warning state. -#endif // _MSC_VER -}; - -// Prints a value tersely: for a reference type, the referenced value -// (but not the address) is printed; for a (const) char pointer, the -// NUL-terminated string (but not the pointer) is printed. - -template -class UniversalTersePrinter { - public: - static void Print(const T& value, ::std::ostream* os) { - UniversalPrint(value, os); - } -}; -template -class UniversalTersePrinter { - public: - static void Print(const T& value, ::std::ostream* os) { - UniversalPrint(value, os); - } -}; -template -class UniversalTersePrinter { - public: - static void Print(const T (&value)[N], ::std::ostream* os) { - UniversalPrinter::Print(value, os); - } -}; -template <> -class UniversalTersePrinter { - public: - static void Print(const char* str, ::std::ostream* os) { - if (str == NULL) { - *os << "NULL"; - } else { - UniversalPrint(string(str), os); - } - } -}; -template <> -class UniversalTersePrinter { - public: - static void Print(char* str, ::std::ostream* os) { - UniversalTersePrinter::Print(str, os); - } -}; - -#if GTEST_HAS_STD_WSTRING -template <> -class UniversalTersePrinter { - public: - static void Print(const wchar_t* str, ::std::ostream* os) { - if (str == NULL) { - *os << "NULL"; - } else { - UniversalPrint(::std::wstring(str), os); - } - } -}; -#endif - -template <> -class UniversalTersePrinter { - public: - static void Print(wchar_t* str, ::std::ostream* os) { - UniversalTersePrinter::Print(str, os); - } -}; - -template -void UniversalTersePrint(const T& value, ::std::ostream* os) { - UniversalTersePrinter::Print(value, os); -} - -// Prints a value using the type inferred by the compiler. The -// difference between this and UniversalTersePrint() is that for a -// (const) char pointer, this prints both the pointer and the -// NUL-terminated string. -template -void UniversalPrint(const T& value, ::std::ostream* os) { - // A workarond for the bug in VC++ 7.1 that prevents us from instantiating - // UniversalPrinter with T directly. - typedef T T1; - UniversalPrinter::Print(value, os); -} - -#if GTEST_HAS_TR1_TUPLE -typedef ::std::vector Strings; - -// This helper template allows PrintTo() for tuples and -// UniversalTersePrintTupleFieldsToStrings() to be defined by -// induction on the number of tuple fields. The idea is that -// TuplePrefixPrinter::PrintPrefixTo(t, os) prints the first N -// fields in tuple t, and can be defined in terms of -// TuplePrefixPrinter. - -// The inductive case. -template -struct TuplePrefixPrinter { - // Prints the first N fields of a tuple. - template - static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) { - TuplePrefixPrinter::PrintPrefixTo(t, os); - *os << ", "; - UniversalPrinter::type> - ::Print(::std::tr1::get(t), os); - } - - // Tersely prints the first N fields of a tuple to a string vector, - // one element for each field. - template - static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) { - TuplePrefixPrinter::TersePrintPrefixToStrings(t, strings); - ::std::stringstream ss; - UniversalTersePrint(::std::tr1::get(t), &ss); - strings->push_back(ss.str()); - } -}; - -// Base cases. -template <> -struct TuplePrefixPrinter<0> { - template - static void PrintPrefixTo(const Tuple&, ::std::ostream*) {} - - template - static void TersePrintPrefixToStrings(const Tuple&, Strings*) {} -}; -// We have to specialize the entire TuplePrefixPrinter<> class -// template here, even though the definition of -// TersePrintPrefixToStrings() is the same as the generic version, as -// Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't -// support specializing a method template of a class template. -template <> -struct TuplePrefixPrinter<1> { - template - static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) { - UniversalPrinter::type>:: - Print(::std::tr1::get<0>(t), os); - } - - template - static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) { - ::std::stringstream ss; - UniversalTersePrint(::std::tr1::get<0>(t), &ss); - strings->push_back(ss.str()); - } -}; - -// Helper function for printing a tuple. T must be instantiated with -// a tuple type. -template -void PrintTupleTo(const T& t, ::std::ostream* os) { - *os << "("; - TuplePrefixPrinter< ::std::tr1::tuple_size::value>:: - PrintPrefixTo(t, os); - *os << ")"; -} - -// Prints the fields of a tuple tersely to a string vector, one -// element for each field. See the comment before -// UniversalTersePrint() for how we define "tersely". -template -Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) { - Strings result; - TuplePrefixPrinter< ::std::tr1::tuple_size::value>:: - TersePrintPrefixToStrings(value, &result); - return result; -} -#endif // GTEST_HAS_TR1_TUPLE - -} // namespace internal - -template -::std::string PrintToString(const T& value) { - ::std::stringstream ss; - internal::UniversalTersePrinter::Print(value, &ss); - return ss.str(); -} - -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ - -#if GTEST_HAS_PARAM_TEST - -namespace testing { -namespace internal { - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Outputs a message explaining invalid registration of different -// fixture class for the same test case. This may happen when -// TEST_P macro is used to define two tests with the same name -// but in different namespaces. -GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name, - const char* file, int line); - -template class ParamGeneratorInterface; -template class ParamGenerator; - -// Interface for iterating over elements provided by an implementation -// of ParamGeneratorInterface. -template -class ParamIteratorInterface { - public: - virtual ~ParamIteratorInterface() {} - // A pointer to the base generator instance. - // Used only for the purposes of iterator comparison - // to make sure that two iterators belong to the same generator. - virtual const ParamGeneratorInterface* BaseGenerator() const = 0; - // Advances iterator to point to the next element - // provided by the generator. The caller is responsible - // for not calling Advance() on an iterator equal to - // BaseGenerator()->End(). - virtual void Advance() = 0; - // Clones the iterator object. Used for implementing copy semantics - // of ParamIterator. - virtual ParamIteratorInterface* Clone() const = 0; - // Dereferences the current iterator and provides (read-only) access - // to the pointed value. It is the caller's responsibility not to call - // Current() on an iterator equal to BaseGenerator()->End(). - // Used for implementing ParamGenerator::operator*(). - virtual const T* Current() const = 0; - // Determines whether the given iterator and other point to the same - // element in the sequence generated by the generator. - // Used for implementing ParamGenerator::operator==(). - virtual bool Equals(const ParamIteratorInterface& other) const = 0; -}; - -// Class iterating over elements provided by an implementation of -// ParamGeneratorInterface. It wraps ParamIteratorInterface -// and implements the const forward iterator concept. -template -class ParamIterator { - public: - typedef T value_type; - typedef const T& reference; - typedef ptrdiff_t difference_type; - - // ParamIterator assumes ownership of the impl_ pointer. - ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {} - ParamIterator& operator=(const ParamIterator& other) { - if (this != &other) - impl_.reset(other.impl_->Clone()); - return *this; - } - - const T& operator*() const { return *impl_->Current(); } - const T* operator->() const { return impl_->Current(); } - // Prefix version of operator++. - ParamIterator& operator++() { - impl_->Advance(); - return *this; - } - // Postfix version of operator++. - ParamIterator operator++(int /*unused*/) { - ParamIteratorInterface* clone = impl_->Clone(); - impl_->Advance(); - return ParamIterator(clone); - } - bool operator==(const ParamIterator& other) const { - return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_); - } - bool operator!=(const ParamIterator& other) const { - return !(*this == other); - } - - private: - friend class ParamGenerator; - explicit ParamIterator(ParamIteratorInterface* impl) : impl_(impl) {} - scoped_ptr > impl_; -}; - -// ParamGeneratorInterface is the binary interface to access generators -// defined in other translation units. -template -class ParamGeneratorInterface { - public: - typedef T ParamType; - - virtual ~ParamGeneratorInterface() {} - - // Generator interface definition - virtual ParamIteratorInterface* Begin() const = 0; - virtual ParamIteratorInterface* End() const = 0; -}; - -// Wraps ParamGeneratorInterface and provides general generator syntax -// compatible with the STL Container concept. -// This class implements copy initialization semantics and the contained -// ParamGeneratorInterface instance is shared among all copies -// of the original object. This is possible because that instance is immutable. -template -class ParamGenerator { - public: - typedef ParamIterator iterator; - - explicit ParamGenerator(ParamGeneratorInterface* impl) : impl_(impl) {} - ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {} - - ParamGenerator& operator=(const ParamGenerator& other) { - impl_ = other.impl_; - return *this; - } - - iterator begin() const { return iterator(impl_->Begin()); } - iterator end() const { return iterator(impl_->End()); } - - private: - linked_ptr > impl_; -}; - -// Generates values from a range of two comparable values. Can be used to -// generate sequences of user-defined types that implement operator+() and -// operator<(). -// This class is used in the Range() function. -template -class RangeGenerator : public ParamGeneratorInterface { - public: - RangeGenerator(T begin, T end, IncrementT step) - : begin_(begin), end_(end), - step_(step), end_index_(CalculateEndIndex(begin, end, step)) {} - virtual ~RangeGenerator() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, begin_, 0, step_); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, end_, end_index_, step_); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, T value, int index, - IncrementT step) - : base_(base), value_(value), index_(index), step_(step) {} - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - virtual void Advance() { - value_ = value_ + step_; - index_++; - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const T* Current() const { return &value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const int other_index = - CheckedDowncastToActualType(&other)->index_; - return index_ == other_index; - } - - private: - Iterator(const Iterator& other) - : ParamIteratorInterface(), - base_(other.base_), value_(other.value_), index_(other.index_), - step_(other.step_) {} - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - T value_; - int index_; - const IncrementT step_; - }; // class RangeGenerator::Iterator - - static int CalculateEndIndex(const T& begin, - const T& end, - const IncrementT& step) { - int end_index = 0; - for (T i = begin; i < end; i = i + step) - end_index++; - return end_index; - } - - // No implementation - assignment is unsupported. - void operator=(const RangeGenerator& other); - - const T begin_; - const T end_; - const IncrementT step_; - // The index for the end() iterator. All the elements in the generated - // sequence are indexed (0-based) to aid iterator comparison. - const int end_index_; -}; // class RangeGenerator - - -// Generates values from a pair of STL-style iterators. Used in the -// ValuesIn() function. The elements are copied from the source range -// since the source can be located on the stack, and the generator -// is likely to persist beyond that stack frame. -template -class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface { - public: - template - ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end) - : container_(begin, end) {} - virtual ~ValuesInIteratorRangeGenerator() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, container_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, container_.end()); - } - - private: - typedef typename ::std::vector ContainerType; - - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - typename ContainerType::const_iterator iterator) - : base_(base), iterator_(iterator) {} - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - virtual void Advance() { - ++iterator_; - value_.reset(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - // We need to use cached value referenced by iterator_ because *iterator_ - // can return a temporary object (and of type other then T), so just - // having "return &*iterator_;" doesn't work. - // value_ is updated here and not in Advance() because Advance() - // can advance iterator_ beyond the end of the range, and we cannot - // detect that fact. The client code, on the other hand, is - // responsible for not calling Current() on an out-of-range iterator. - virtual const T* Current() const { - if (value_.get() == NULL) - value_.reset(new T(*iterator_)); - return value_.get(); - } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - return iterator_ == - CheckedDowncastToActualType(&other)->iterator_; - } - - private: - Iterator(const Iterator& other) - // The explicit constructor call suppresses a false warning - // emitted by gcc when supplied with the -Wextra option. - : ParamIteratorInterface(), - base_(other.base_), - iterator_(other.iterator_) {} - - const ParamGeneratorInterface* const base_; - typename ContainerType::const_iterator iterator_; - // A cached value of *iterator_. We keep it here to allow access by - // pointer in the wrapping iterator's operator->(). - // value_ needs to be mutable to be accessed in Current(). - // Use of scoped_ptr helps manage cached value's lifetime, - // which is bound by the lifespan of the iterator itself. - mutable scoped_ptr value_; - }; // class ValuesInIteratorRangeGenerator::Iterator - - // No implementation - assignment is unsupported. - void operator=(const ValuesInIteratorRangeGenerator& other); - - const ContainerType container_; -}; // class ValuesInIteratorRangeGenerator - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Stores a parameter value and later creates tests parameterized with that -// value. -template -class ParameterizedTestFactory : public TestFactoryBase { - public: - typedef typename TestClass::ParamType ParamType; - explicit ParameterizedTestFactory(ParamType parameter) : - parameter_(parameter) {} - virtual Test* CreateTest() { - TestClass::SetParam(¶meter_); - return new TestClass(); - } - - private: - const ParamType parameter_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory); -}; - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// TestMetaFactoryBase is a base class for meta-factories that create -// test factories for passing into MakeAndRegisterTestInfo function. -template -class TestMetaFactoryBase { - public: - virtual ~TestMetaFactoryBase() {} - - virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0; -}; - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// TestMetaFactory creates test factories for passing into -// MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives -// ownership of test factory pointer, same factory object cannot be passed -// into that method twice. But ParameterizedTestCaseInfo is going to call -// it for each Test/Parameter value combination. Thus it needs meta factory -// creator class. -template -class TestMetaFactory - : public TestMetaFactoryBase { - public: - typedef typename TestCase::ParamType ParamType; - - TestMetaFactory() {} - - virtual TestFactoryBase* CreateTestFactory(ParamType parameter) { - return new ParameterizedTestFactory(parameter); - } - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory); -}; - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// ParameterizedTestCaseInfoBase is a generic interface -// to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase -// accumulates test information provided by TEST_P macro invocations -// and generators provided by INSTANTIATE_TEST_CASE_P macro invocations -// and uses that information to register all resulting test instances -// in RegisterTests method. The ParameterizeTestCaseRegistry class holds -// a collection of pointers to the ParameterizedTestCaseInfo objects -// and calls RegisterTests() on each of them when asked. -class ParameterizedTestCaseInfoBase { - public: - virtual ~ParameterizedTestCaseInfoBase() {} - - // Base part of test case name for display purposes. - virtual const string& GetTestCaseName() const = 0; - // Test case id to verify identity. - virtual TypeId GetTestCaseTypeId() const = 0; - // UnitTest class invokes this method to register tests in this - // test case right before running them in RUN_ALL_TESTS macro. - // This method should not be called more then once on any single - // instance of a ParameterizedTestCaseInfoBase derived class. - virtual void RegisterTests() = 0; - - protected: - ParameterizedTestCaseInfoBase() {} - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase); -}; - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// ParameterizedTestCaseInfo accumulates tests obtained from TEST_P -// macro invocations for a particular test case and generators -// obtained from INSTANTIATE_TEST_CASE_P macro invocations for that -// test case. It registers tests with all values generated by all -// generators when asked. -template -class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase { - public: - // ParamType and GeneratorCreationFunc are private types but are required - // for declarations of public methods AddTestPattern() and - // AddTestCaseInstantiation(). - typedef typename TestCase::ParamType ParamType; - // A function that returns an instance of appropriate generator type. - typedef ParamGenerator(GeneratorCreationFunc)(); - - explicit ParameterizedTestCaseInfo(const char* name) - : test_case_name_(name) {} - - // Test case base name for display purposes. - virtual const string& GetTestCaseName() const { return test_case_name_; } - // Test case id to verify identity. - virtual TypeId GetTestCaseTypeId() const { return GetTypeId(); } - // TEST_P macro uses AddTestPattern() to record information - // about a single test in a LocalTestInfo structure. - // test_case_name is the base name of the test case (without invocation - // prefix). test_base_name is the name of an individual test without - // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is - // test case base name and DoBar is test base name. - void AddTestPattern(const char* test_case_name, - const char* test_base_name, - TestMetaFactoryBase* meta_factory) { - tests_.push_back(linked_ptr(new TestInfo(test_case_name, - test_base_name, - meta_factory))); - } - // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information - // about a generator. - int AddTestCaseInstantiation(const string& instantiation_name, - GeneratorCreationFunc* func, - const char* /* file */, - int /* line */) { - instantiations_.push_back(::std::make_pair(instantiation_name, func)); - return 0; // Return value used only to run this method in namespace scope. - } - // UnitTest class invokes this method to register tests in this test case - // test cases right before running tests in RUN_ALL_TESTS macro. - // This method should not be called more then once on any single - // instance of a ParameterizedTestCaseInfoBase derived class. - // UnitTest has a guard to prevent from calling this method more then once. - virtual void RegisterTests() { - for (typename TestInfoContainer::iterator test_it = tests_.begin(); - test_it != tests_.end(); ++test_it) { - linked_ptr test_info = *test_it; - for (typename InstantiationContainer::iterator gen_it = - instantiations_.begin(); gen_it != instantiations_.end(); - ++gen_it) { - const string& instantiation_name = gen_it->first; - ParamGenerator generator((*gen_it->second)()); - - string test_case_name; - if ( !instantiation_name.empty() ) - test_case_name = instantiation_name + "/"; - test_case_name += test_info->test_case_base_name; - - int i = 0; - for (typename ParamGenerator::iterator param_it = - generator.begin(); - param_it != generator.end(); ++param_it, ++i) { - Message test_name_stream; - test_name_stream << test_info->test_base_name << "/" << i; - MakeAndRegisterTestInfo( - test_case_name.c_str(), - test_name_stream.GetString().c_str(), - NULL, // No type parameter. - PrintToString(*param_it).c_str(), - GetTestCaseTypeId(), - TestCase::SetUpTestCase, - TestCase::TearDownTestCase, - test_info->test_meta_factory->CreateTestFactory(*param_it)); - } // for param_it - } // for gen_it - } // for test_it - } // RegisterTests - - private: - // LocalTestInfo structure keeps information about a single test registered - // with TEST_P macro. - struct TestInfo { - TestInfo(const char* a_test_case_base_name, - const char* a_test_base_name, - TestMetaFactoryBase* a_test_meta_factory) : - test_case_base_name(a_test_case_base_name), - test_base_name(a_test_base_name), - test_meta_factory(a_test_meta_factory) {} - - const string test_case_base_name; - const string test_base_name; - const scoped_ptr > test_meta_factory; - }; - typedef ::std::vector > TestInfoContainer; - // Keeps pairs of - // received from INSTANTIATE_TEST_CASE_P macros. - typedef ::std::vector > - InstantiationContainer; - - const string test_case_name_; - TestInfoContainer tests_; - InstantiationContainer instantiations_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo); -}; // class ParameterizedTestCaseInfo - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase -// classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P -// macros use it to locate their corresponding ParameterizedTestCaseInfo -// descriptors. -class ParameterizedTestCaseRegistry { - public: - ParameterizedTestCaseRegistry() {} - ~ParameterizedTestCaseRegistry() { - for (TestCaseInfoContainer::iterator it = test_case_infos_.begin(); - it != test_case_infos_.end(); ++it) { - delete *it; - } - } - - // Looks up or creates and returns a structure containing information about - // tests and instantiations of a particular test case. - template - ParameterizedTestCaseInfo* GetTestCasePatternHolder( - const char* test_case_name, - const char* file, - int line) { - ParameterizedTestCaseInfo* typed_test_info = NULL; - for (TestCaseInfoContainer::iterator it = test_case_infos_.begin(); - it != test_case_infos_.end(); ++it) { - if ((*it)->GetTestCaseName() == test_case_name) { - if ((*it)->GetTestCaseTypeId() != GetTypeId()) { - // Complain about incorrect usage of Google Test facilities - // and terminate the program since we cannot guaranty correct - // test case setup and tear-down in this case. - ReportInvalidTestCaseType(test_case_name, file, line); - posix::Abort(); - } else { - // At this point we are sure that the object we found is of the same - // type we are looking for, so we downcast it to that type - // without further checks. - typed_test_info = CheckedDowncastToActualType< - ParameterizedTestCaseInfo >(*it); - } - break; - } - } - if (typed_test_info == NULL) { - typed_test_info = new ParameterizedTestCaseInfo(test_case_name); - test_case_infos_.push_back(typed_test_info); - } - return typed_test_info; - } - void RegisterTests() { - for (TestCaseInfoContainer::iterator it = test_case_infos_.begin(); - it != test_case_infos_.end(); ++it) { - (*it)->RegisterTests(); - } - } - - private: - typedef ::std::vector TestCaseInfoContainer; - - TestCaseInfoContainer test_case_infos_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry); -}; - -} // namespace internal -} // namespace testing - -#endif // GTEST_HAS_PARAM_TEST - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_ -// This file was GENERATED by command: -// pump.py gtest-param-util-generated.h.pump -// DO NOT EDIT BY HAND!!! - -// Copyright 2008 Google 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "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 THE COPYRIGHT -// OWNER 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. -// -// Author: vladl@google.com (Vlad Losev) - -// Type and function utilities for implementing parameterized tests. -// This file is generated by a SCRIPT. DO NOT EDIT BY HAND! -// -// Currently Google Test supports at most 50 arguments in Values, -// and at most 10 arguments in Combine. Please contact -// googletestframework@googlegroups.com if you need more. -// Please note that the number of arguments to Combine is limited -// by the maximum arity of the implementation of tr1::tuple which is -// currently set at 10. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ - -// scripts/fuse_gtest.py depends on gtest's own header being #included -// *unconditionally*. Therefore these #includes cannot be moved -// inside #if GTEST_HAS_PARAM_TEST. - -#if GTEST_HAS_PARAM_TEST - -namespace testing { - -// Forward declarations of ValuesIn(), which is implemented in -// include/gtest/gtest-param-test.h. -template -internal::ParamGenerator< - typename ::testing::internal::IteratorTraits::value_type> -ValuesIn(ForwardIterator begin, ForwardIterator end); - -template -internal::ParamGenerator ValuesIn(const T (&array)[N]); - -template -internal::ParamGenerator ValuesIn( - const Container& container); - -namespace internal { - -// Used in the Values() function to provide polymorphic capabilities. -template -class ValueArray1 { - public: - explicit ValueArray1(T1 v1) : v1_(v1) {} - - template - operator ParamGenerator() const { return ValuesIn(&v1_, &v1_ + 1); } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray1& other); - - const T1 v1_; -}; - -template -class ValueArray2 { - public: - ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray2& other); - - const T1 v1_; - const T2 v2_; -}; - -template -class ValueArray3 { - public: - ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray3& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; -}; - -template -class ValueArray4 { - public: - ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray4& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; -}; - -template -class ValueArray5 { - public: - ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray5& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; -}; - -template -class ValueArray6 { - public: - ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray6& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; -}; - -template -class ValueArray7 { - public: - ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray7& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; -}; - -template -class ValueArray8 { - public: - ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray8& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; -}; - -template -class ValueArray9 { - public: - ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray9& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; -}; - -template -class ValueArray10 { - public: - ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray10& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; -}; - -template -class ValueArray11 { - public: - ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), - v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray11& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; -}; - -template -class ValueArray12 { - public: - ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), - v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray12& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; -}; - -template -class ValueArray13 { - public: - ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), - v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), - v12_(v12), v13_(v13) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray13& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; -}; - -template -class ValueArray14 { - public: - ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray14& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; -}; - -template -class ValueArray15 { - public: - ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray15& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; -}; - -template -class ValueArray16 { - public: - ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), - v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), - v16_(v16) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray16& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; -}; - -template -class ValueArray17 { - public: - ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, - T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray17& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; -}; - -template -class ValueArray18 { - public: - ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray18& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; -}; - -template -class ValueArray19 { - public: - ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), - v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), - v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray19& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; -}; - -template -class ValueArray20 { - public: - ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), - v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), - v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), - v19_(v19), v20_(v20) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray20& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; -}; - -template -class ValueArray21 { - public: - ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), - v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), - v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), - v18_(v18), v19_(v19), v20_(v20), v21_(v21) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray21& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; -}; - -template -class ValueArray22 { - public: - ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray22& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; -}; - -template -class ValueArray23 { - public: - ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray23& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; -}; - -template -class ValueArray24 { - public: - ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), - v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), - v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), - v22_(v22), v23_(v23), v24_(v24) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray24& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; -}; - -template -class ValueArray25 { - public: - ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, - T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray25& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; -}; - -template -class ValueArray26 { - public: - ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray26& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; -}; - -template -class ValueArray27 { - public: - ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), - v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), - v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), - v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), - v26_(v26), v27_(v27) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray27& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; -}; - -template -class ValueArray28 { - public: - ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), - v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), - v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), - v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), - v25_(v25), v26_(v26), v27_(v27), v28_(v28) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray28& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; -}; - -template -class ValueArray29 { - public: - ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), - v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), - v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), - v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), - v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray29& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; -}; - -template -class ValueArray30 { - public: - ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray30& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; -}; - -template -class ValueArray31 { - public: - ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30), v31_(v31) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray31& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; -}; - -template -class ValueArray32 { - public: - ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), - v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), - v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), - v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), - v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray32& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; -}; - -template -class ValueArray33 { - public: - ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, - T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray33& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; -}; - -template -class ValueArray34 { - public: - ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33), v34_(v34) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray34& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; -}; - -template -class ValueArray35 { - public: - ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), - v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), - v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), - v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), - v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), - v32_(v32), v33_(v33), v34_(v34), v35_(v35) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray35& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; -}; - -template -class ValueArray36 { - public: - ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), - v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), - v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), - v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), - v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), - v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray36& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; -}; - -template -class ValueArray37 { - public: - ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), - v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), - v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), - v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), - v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), - v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), - v36_(v36), v37_(v37) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray37& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; -}; - -template -class ValueArray38 { - public: - ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), - v35_(v35), v36_(v36), v37_(v37), v38_(v38) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray38& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; -}; - -template -class ValueArray39 { - public: - ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), - v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray39& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; -}; - -template -class ValueArray40 { - public: - ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), - v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), - v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), - v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), - v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), - v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), - v40_(v40) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray40& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; -}; - -template -class ValueArray41 { - public: - ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, - T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), - v39_(v39), v40_(v40), v41_(v41) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray41& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; -}; - -template -class ValueArray42 { - public: - ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), - v39_(v39), v40_(v40), v41_(v41), v42_(v42) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray42& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; -}; - -template -class ValueArray43 { - public: - ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), - v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), - v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), - v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), - v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), - v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), - v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray43& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; -}; - -template -class ValueArray44 { - public: - ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), - v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), - v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), - v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), - v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), - v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), - v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), - v43_(v43), v44_(v44) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_), static_cast(v44_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray44& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; -}; - -template -class ValueArray45 { - public: - ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), - v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), - v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), - v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), - v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), - v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), - v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), - v42_(v42), v43_(v43), v44_(v44), v45_(v45) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_), static_cast(v44_), - static_cast(v45_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray45& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; -}; - -template -class ValueArray46 { - public: - ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), - v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), - v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_), static_cast(v44_), - static_cast(v45_), static_cast(v46_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray46& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; - const T46 v46_; -}; - -template -class ValueArray47 { - public: - ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), - v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), - v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46), - v47_(v47) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_), static_cast(v44_), - static_cast(v45_), static_cast(v46_), static_cast(v47_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray47& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; - const T46 v46_; - const T47 v47_; -}; - -template -class ValueArray48 { - public: - ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), - v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), - v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), - v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), - v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), - v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), - v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), - v46_(v46), v47_(v47), v48_(v48) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_), static_cast(v44_), - static_cast(v45_), static_cast(v46_), static_cast(v47_), - static_cast(v48_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray48& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; - const T46 v46_; - const T47 v47_; - const T48 v48_; -}; - -template -class ValueArray49 { - public: - ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, - T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), - v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), - v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_), static_cast(v44_), - static_cast(v45_), static_cast(v46_), static_cast(v47_), - static_cast(v48_), static_cast(v49_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray49& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; - const T46 v46_; - const T47 v47_; - const T48 v48_; - const T49 v49_; -}; - -template -class ValueArray50 { - public: - ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49, - T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), - v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), - v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_), static_cast(v44_), - static_cast(v45_), static_cast(v46_), static_cast(v47_), - static_cast(v48_), static_cast(v49_), static_cast(v50_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray50& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; - const T46 v46_; - const T47 v47_; - const T48 v48_; - const T49 v49_; - const T50 v50_; -}; - -# if GTEST_HAS_COMBINE -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Generates values from the Cartesian product of values produced -// by the argument generators. -// -template -class CartesianProductGenerator2 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator2(const ParamGenerator& g1, - const ParamGenerator& g2) - : g1_(g1), g2_(g2) {} - virtual ~CartesianProductGenerator2() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current2_; - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - ParamType current_value_; - }; // class CartesianProductGenerator2::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator2& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; -}; // class CartesianProductGenerator2 - - -template -class CartesianProductGenerator3 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator3(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3) - : g1_(g1), g2_(g2), g3_(g3) {} - virtual ~CartesianProductGenerator3() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current3_; - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - ParamType current_value_; - }; // class CartesianProductGenerator3::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator3& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; -}; // class CartesianProductGenerator3 - - -template -class CartesianProductGenerator4 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator4(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {} - virtual ~CartesianProductGenerator4() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current4_; - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - ParamType current_value_; - }; // class CartesianProductGenerator4::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator4& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; -}; // class CartesianProductGenerator4 - - -template -class CartesianProductGenerator5 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator5(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {} - virtual ~CartesianProductGenerator5() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current5_; - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - ParamType current_value_; - }; // class CartesianProductGenerator5::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator5& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; -}; // class CartesianProductGenerator5 - - -template -class CartesianProductGenerator6 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator6(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5, - const ParamGenerator& g6) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {} - virtual ~CartesianProductGenerator6() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5, - const ParamGenerator& g6, - const typename ParamGenerator::iterator& current6) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5), - begin6_(g6.begin()), end6_(g6.end()), current6_(current6) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current6_; - if (current6_ == end6_) { - current6_ = begin6_; - ++current5_; - } - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_ && - current6_ == typed_other->current6_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_), - begin6_(other.begin6_), - end6_(other.end6_), - current6_(other.current6_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_, *current6_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_ || - current6_ == end6_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - const typename ParamGenerator::iterator begin6_; - const typename ParamGenerator::iterator end6_; - typename ParamGenerator::iterator current6_; - ParamType current_value_; - }; // class CartesianProductGenerator6::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator6& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; - const ParamGenerator g6_; -}; // class CartesianProductGenerator6 - - -template -class CartesianProductGenerator7 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator7(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5, - const ParamGenerator& g6, const ParamGenerator& g7) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {} - virtual ~CartesianProductGenerator7() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, - g7_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5, - const ParamGenerator& g6, - const typename ParamGenerator::iterator& current6, - const ParamGenerator& g7, - const typename ParamGenerator::iterator& current7) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5), - begin6_(g6.begin()), end6_(g6.end()), current6_(current6), - begin7_(g7.begin()), end7_(g7.end()), current7_(current7) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current7_; - if (current7_ == end7_) { - current7_ = begin7_; - ++current6_; - } - if (current6_ == end6_) { - current6_ = begin6_; - ++current5_; - } - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_ && - current6_ == typed_other->current6_ && - current7_ == typed_other->current7_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_), - begin6_(other.begin6_), - end6_(other.end6_), - current6_(other.current6_), - begin7_(other.begin7_), - end7_(other.end7_), - current7_(other.current7_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_, *current6_, *current7_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_ || - current6_ == end6_ || - current7_ == end7_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - const typename ParamGenerator::iterator begin6_; - const typename ParamGenerator::iterator end6_; - typename ParamGenerator::iterator current6_; - const typename ParamGenerator::iterator begin7_; - const typename ParamGenerator::iterator end7_; - typename ParamGenerator::iterator current7_; - ParamType current_value_; - }; // class CartesianProductGenerator7::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator7& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; - const ParamGenerator g6_; - const ParamGenerator g7_; -}; // class CartesianProductGenerator7 - - -template -class CartesianProductGenerator8 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator8(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5, - const ParamGenerator& g6, const ParamGenerator& g7, - const ParamGenerator& g8) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), - g8_(g8) {} - virtual ~CartesianProductGenerator8() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, - g7_.begin(), g8_, g8_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, - g8_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5, - const ParamGenerator& g6, - const typename ParamGenerator::iterator& current6, - const ParamGenerator& g7, - const typename ParamGenerator::iterator& current7, - const ParamGenerator& g8, - const typename ParamGenerator::iterator& current8) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5), - begin6_(g6.begin()), end6_(g6.end()), current6_(current6), - begin7_(g7.begin()), end7_(g7.end()), current7_(current7), - begin8_(g8.begin()), end8_(g8.end()), current8_(current8) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current8_; - if (current8_ == end8_) { - current8_ = begin8_; - ++current7_; - } - if (current7_ == end7_) { - current7_ = begin7_; - ++current6_; - } - if (current6_ == end6_) { - current6_ = begin6_; - ++current5_; - } - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_ && - current6_ == typed_other->current6_ && - current7_ == typed_other->current7_ && - current8_ == typed_other->current8_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_), - begin6_(other.begin6_), - end6_(other.end6_), - current6_(other.current6_), - begin7_(other.begin7_), - end7_(other.end7_), - current7_(other.current7_), - begin8_(other.begin8_), - end8_(other.end8_), - current8_(other.current8_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_, *current6_, *current7_, *current8_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_ || - current6_ == end6_ || - current7_ == end7_ || - current8_ == end8_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - const typename ParamGenerator::iterator begin6_; - const typename ParamGenerator::iterator end6_; - typename ParamGenerator::iterator current6_; - const typename ParamGenerator::iterator begin7_; - const typename ParamGenerator::iterator end7_; - typename ParamGenerator::iterator current7_; - const typename ParamGenerator::iterator begin8_; - const typename ParamGenerator::iterator end8_; - typename ParamGenerator::iterator current8_; - ParamType current_value_; - }; // class CartesianProductGenerator8::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator8& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; - const ParamGenerator g6_; - const ParamGenerator g7_; - const ParamGenerator g8_; -}; // class CartesianProductGenerator8 - - -template -class CartesianProductGenerator9 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator9(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5, - const ParamGenerator& g6, const ParamGenerator& g7, - const ParamGenerator& g8, const ParamGenerator& g9) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), - g9_(g9) {} - virtual ~CartesianProductGenerator9() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, - g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, - g8_.end(), g9_, g9_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5, - const ParamGenerator& g6, - const typename ParamGenerator::iterator& current6, - const ParamGenerator& g7, - const typename ParamGenerator::iterator& current7, - const ParamGenerator& g8, - const typename ParamGenerator::iterator& current8, - const ParamGenerator& g9, - const typename ParamGenerator::iterator& current9) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5), - begin6_(g6.begin()), end6_(g6.end()), current6_(current6), - begin7_(g7.begin()), end7_(g7.end()), current7_(current7), - begin8_(g8.begin()), end8_(g8.end()), current8_(current8), - begin9_(g9.begin()), end9_(g9.end()), current9_(current9) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current9_; - if (current9_ == end9_) { - current9_ = begin9_; - ++current8_; - } - if (current8_ == end8_) { - current8_ = begin8_; - ++current7_; - } - if (current7_ == end7_) { - current7_ = begin7_; - ++current6_; - } - if (current6_ == end6_) { - current6_ = begin6_; - ++current5_; - } - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_ && - current6_ == typed_other->current6_ && - current7_ == typed_other->current7_ && - current8_ == typed_other->current8_ && - current9_ == typed_other->current9_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_), - begin6_(other.begin6_), - end6_(other.end6_), - current6_(other.current6_), - begin7_(other.begin7_), - end7_(other.end7_), - current7_(other.current7_), - begin8_(other.begin8_), - end8_(other.end8_), - current8_(other.current8_), - begin9_(other.begin9_), - end9_(other.end9_), - current9_(other.current9_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_, *current6_, *current7_, *current8_, - *current9_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_ || - current6_ == end6_ || - current7_ == end7_ || - current8_ == end8_ || - current9_ == end9_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - const typename ParamGenerator::iterator begin6_; - const typename ParamGenerator::iterator end6_; - typename ParamGenerator::iterator current6_; - const typename ParamGenerator::iterator begin7_; - const typename ParamGenerator::iterator end7_; - typename ParamGenerator::iterator current7_; - const typename ParamGenerator::iterator begin8_; - const typename ParamGenerator::iterator end8_; - typename ParamGenerator::iterator current8_; - const typename ParamGenerator::iterator begin9_; - const typename ParamGenerator::iterator end9_; - typename ParamGenerator::iterator current9_; - ParamType current_value_; - }; // class CartesianProductGenerator9::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator9& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; - const ParamGenerator g6_; - const ParamGenerator g7_; - const ParamGenerator g8_; - const ParamGenerator g9_; -}; // class CartesianProductGenerator9 - - -template -class CartesianProductGenerator10 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator10(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5, - const ParamGenerator& g6, const ParamGenerator& g7, - const ParamGenerator& g8, const ParamGenerator& g9, - const ParamGenerator& g10) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), - g9_(g9), g10_(g10) {} - virtual ~CartesianProductGenerator10() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, - g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, - g8_.end(), g9_, g9_.end(), g10_, g10_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5, - const ParamGenerator& g6, - const typename ParamGenerator::iterator& current6, - const ParamGenerator& g7, - const typename ParamGenerator::iterator& current7, - const ParamGenerator& g8, - const typename ParamGenerator::iterator& current8, - const ParamGenerator& g9, - const typename ParamGenerator::iterator& current9, - const ParamGenerator& g10, - const typename ParamGenerator::iterator& current10) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5), - begin6_(g6.begin()), end6_(g6.end()), current6_(current6), - begin7_(g7.begin()), end7_(g7.end()), current7_(current7), - begin8_(g8.begin()), end8_(g8.end()), current8_(current8), - begin9_(g9.begin()), end9_(g9.end()), current9_(current9), - begin10_(g10.begin()), end10_(g10.end()), current10_(current10) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current10_; - if (current10_ == end10_) { - current10_ = begin10_; - ++current9_; - } - if (current9_ == end9_) { - current9_ = begin9_; - ++current8_; - } - if (current8_ == end8_) { - current8_ = begin8_; - ++current7_; - } - if (current7_ == end7_) { - current7_ = begin7_; - ++current6_; - } - if (current6_ == end6_) { - current6_ = begin6_; - ++current5_; - } - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_ && - current6_ == typed_other->current6_ && - current7_ == typed_other->current7_ && - current8_ == typed_other->current8_ && - current9_ == typed_other->current9_ && - current10_ == typed_other->current10_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_), - begin6_(other.begin6_), - end6_(other.end6_), - current6_(other.current6_), - begin7_(other.begin7_), - end7_(other.end7_), - current7_(other.current7_), - begin8_(other.begin8_), - end8_(other.end8_), - current8_(other.current8_), - begin9_(other.begin9_), - end9_(other.end9_), - current9_(other.current9_), - begin10_(other.begin10_), - end10_(other.end10_), - current10_(other.current10_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_, *current6_, *current7_, *current8_, - *current9_, *current10_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_ || - current6_ == end6_ || - current7_ == end7_ || - current8_ == end8_ || - current9_ == end9_ || - current10_ == end10_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - const typename ParamGenerator::iterator begin6_; - const typename ParamGenerator::iterator end6_; - typename ParamGenerator::iterator current6_; - const typename ParamGenerator::iterator begin7_; - const typename ParamGenerator::iterator end7_; - typename ParamGenerator::iterator current7_; - const typename ParamGenerator::iterator begin8_; - const typename ParamGenerator::iterator end8_; - typename ParamGenerator::iterator current8_; - const typename ParamGenerator::iterator begin9_; - const typename ParamGenerator::iterator end9_; - typename ParamGenerator::iterator current9_; - const typename ParamGenerator::iterator begin10_; - const typename ParamGenerator::iterator end10_; - typename ParamGenerator::iterator current10_; - ParamType current_value_; - }; // class CartesianProductGenerator10::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator10& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; - const ParamGenerator g6_; - const ParamGenerator g7_; - const ParamGenerator g8_; - const ParamGenerator g9_; - const ParamGenerator g10_; -}; // class CartesianProductGenerator10 - - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Helper classes providing Combine() with polymorphic features. They allow -// casting CartesianProductGeneratorN to ParamGenerator if T is -// convertible to U. -// -template -class CartesianProductHolder2 { - public: -CartesianProductHolder2(const Generator1& g1, const Generator2& g2) - : g1_(g1), g2_(g2) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator2( - static_cast >(g1_), - static_cast >(g2_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder2& other); - - const Generator1 g1_; - const Generator2 g2_; -}; // class CartesianProductHolder2 - -template -class CartesianProductHolder3 { - public: -CartesianProductHolder3(const Generator1& g1, const Generator2& g2, - const Generator3& g3) - : g1_(g1), g2_(g2), g3_(g3) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator3( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder3& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; -}; // class CartesianProductHolder3 - -template -class CartesianProductHolder4 { - public: -CartesianProductHolder4(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator4( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder4& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; -}; // class CartesianProductHolder4 - -template -class CartesianProductHolder5 { - public: -CartesianProductHolder5(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator5( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder5& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; -}; // class CartesianProductHolder5 - -template -class CartesianProductHolder6 { - public: -CartesianProductHolder6(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5, - const Generator6& g6) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator6( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_), - static_cast >(g6_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder6& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; - const Generator6 g6_; -}; // class CartesianProductHolder6 - -template -class CartesianProductHolder7 { - public: -CartesianProductHolder7(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5, - const Generator6& g6, const Generator7& g7) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator7( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_), - static_cast >(g6_), - static_cast >(g7_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder7& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; - const Generator6 g6_; - const Generator7 g7_; -}; // class CartesianProductHolder7 - -template -class CartesianProductHolder8 { - public: -CartesianProductHolder8(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5, - const Generator6& g6, const Generator7& g7, const Generator8& g8) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), - g8_(g8) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator8( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_), - static_cast >(g6_), - static_cast >(g7_), - static_cast >(g8_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder8& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; - const Generator6 g6_; - const Generator7 g7_; - const Generator8 g8_; -}; // class CartesianProductHolder8 - -template -class CartesianProductHolder9 { - public: -CartesianProductHolder9(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5, - const Generator6& g6, const Generator7& g7, const Generator8& g8, - const Generator9& g9) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), - g9_(g9) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator9( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_), - static_cast >(g6_), - static_cast >(g7_), - static_cast >(g8_), - static_cast >(g9_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder9& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; - const Generator6 g6_; - const Generator7 g7_; - const Generator8 g8_; - const Generator9 g9_; -}; // class CartesianProductHolder9 - -template -class CartesianProductHolder10 { - public: -CartesianProductHolder10(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5, - const Generator6& g6, const Generator7& g7, const Generator8& g8, - const Generator9& g9, const Generator10& g10) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), - g9_(g9), g10_(g10) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator10( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_), - static_cast >(g6_), - static_cast >(g7_), - static_cast >(g8_), - static_cast >(g9_), - static_cast >(g10_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder10& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; - const Generator6 g6_; - const Generator7 g7_; - const Generator8 g8_; - const Generator9 g9_; - const Generator10 g10_; -}; // class CartesianProductHolder10 - -# endif // GTEST_HAS_COMBINE - -} // namespace internal -} // namespace testing - -#endif // GTEST_HAS_PARAM_TEST - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ - -#if GTEST_HAS_PARAM_TEST - -namespace testing { - -// Functions producing parameter generators. -// -// Google Test uses these generators to produce parameters for value- -// parameterized tests. When a parameterized test case is instantiated -// with a particular generator, Google Test creates and runs tests -// for each element in the sequence produced by the generator. -// -// In the following sample, tests from test case FooTest are instantiated -// each three times with parameter values 3, 5, and 8: -// -// class FooTest : public TestWithParam { ... }; -// -// TEST_P(FooTest, TestThis) { -// } -// TEST_P(FooTest, TestThat) { -// } -// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8)); -// - -// Range() returns generators providing sequences of values in a range. -// -// Synopsis: -// Range(start, end) -// - returns a generator producing a sequence of values {start, start+1, -// start+2, ..., }. -// Range(start, end, step) -// - returns a generator producing a sequence of values {start, start+step, -// start+step+step, ..., }. -// Notes: -// * The generated sequences never include end. For example, Range(1, 5) -// returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2) -// returns a generator producing {1, 3, 5, 7}. -// * start and end must have the same type. That type may be any integral or -// floating-point type or a user defined type satisfying these conditions: -// * It must be assignable (have operator=() defined). -// * It must have operator+() (operator+(int-compatible type) for -// two-operand version). -// * It must have operator<() defined. -// Elements in the resulting sequences will also have that type. -// * Condition start < end must be satisfied in order for resulting sequences -// to contain any elements. -// -template -internal::ParamGenerator Range(T start, T end, IncrementT step) { - return internal::ParamGenerator( - new internal::RangeGenerator(start, end, step)); -} - -template -internal::ParamGenerator Range(T start, T end) { - return Range(start, end, 1); -} - -// ValuesIn() function allows generation of tests with parameters coming from -// a container. -// -// Synopsis: -// ValuesIn(const T (&array)[N]) -// - returns a generator producing sequences with elements from -// a C-style array. -// ValuesIn(const Container& container) -// - returns a generator producing sequences with elements from -// an STL-style container. -// ValuesIn(Iterator begin, Iterator end) -// - returns a generator producing sequences with elements from -// a range [begin, end) defined by a pair of STL-style iterators. These -// iterators can also be plain C pointers. -// -// Please note that ValuesIn copies the values from the containers -// passed in and keeps them to generate tests in RUN_ALL_TESTS(). -// -// Examples: -// -// This instantiates tests from test case StringTest -// each with C-string values of "foo", "bar", and "baz": -// -// const char* strings[] = {"foo", "bar", "baz"}; -// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings)); -// -// This instantiates tests from test case StlStringTest -// each with STL strings with values "a" and "b": -// -// ::std::vector< ::std::string> GetParameterStrings() { -// ::std::vector< ::std::string> v; -// v.push_back("a"); -// v.push_back("b"); -// return v; -// } -// -// INSTANTIATE_TEST_CASE_P(CharSequence, -// StlStringTest, -// ValuesIn(GetParameterStrings())); -// -// -// This will also instantiate tests from CharTest -// each with parameter values 'a' and 'b': -// -// ::std::list GetParameterChars() { -// ::std::list list; -// list.push_back('a'); -// list.push_back('b'); -// return list; -// } -// ::std::list l = GetParameterChars(); -// INSTANTIATE_TEST_CASE_P(CharSequence2, -// CharTest, -// ValuesIn(l.begin(), l.end())); -// -template -internal::ParamGenerator< - typename ::testing::internal::IteratorTraits::value_type> -ValuesIn(ForwardIterator begin, ForwardIterator end) { - typedef typename ::testing::internal::IteratorTraits - ::value_type ParamType; - return internal::ParamGenerator( - new internal::ValuesInIteratorRangeGenerator(begin, end)); -} - -template -internal::ParamGenerator ValuesIn(const T (&array)[N]) { - return ValuesIn(array, array + N); -} - -template -internal::ParamGenerator ValuesIn( - const Container& container) { - return ValuesIn(container.begin(), container.end()); -} - -// Values() allows generating tests from explicitly specified list of -// parameters. -// -// Synopsis: -// Values(T v1, T v2, ..., T vN) -// - returns a generator producing sequences with elements v1, v2, ..., vN. -// -// For example, this instantiates tests from test case BarTest each -// with values "one", "two", and "three": -// -// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three")); -// -// This instantiates tests from test case BazTest each with values 1, 2, 3.5. -// The exact type of values will depend on the type of parameter in BazTest. -// -// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); -// -// Currently, Values() supports from 1 to 50 parameters. -// -template -internal::ValueArray1 Values(T1 v1) { - return internal::ValueArray1(v1); -} - -template -internal::ValueArray2 Values(T1 v1, T2 v2) { - return internal::ValueArray2(v1, v2); -} - -template -internal::ValueArray3 Values(T1 v1, T2 v2, T3 v3) { - return internal::ValueArray3(v1, v2, v3); -} - -template -internal::ValueArray4 Values(T1 v1, T2 v2, T3 v3, T4 v4) { - return internal::ValueArray4(v1, v2, v3, v4); -} - -template -internal::ValueArray5 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5) { - return internal::ValueArray5(v1, v2, v3, v4, v5); -} - -template -internal::ValueArray6 Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6) { - return internal::ValueArray6(v1, v2, v3, v4, v5, v6); -} - -template -internal::ValueArray7 Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6, T7 v7) { - return internal::ValueArray7(v1, v2, v3, v4, v5, - v6, v7); -} - -template -internal::ValueArray8 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { - return internal::ValueArray8(v1, v2, v3, v4, - v5, v6, v7, v8); -} - -template -internal::ValueArray9 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { - return internal::ValueArray9(v1, v2, v3, - v4, v5, v6, v7, v8, v9); -} - -template -internal::ValueArray10 Values(T1 v1, - T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { - return internal::ValueArray10(v1, - v2, v3, v4, v5, v6, v7, v8, v9, v10); -} - -template -internal::ValueArray11 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11) { - return internal::ValueArray11(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); -} - -template -internal::ValueArray12 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12) { - return internal::ValueArray12(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); -} - -template -internal::ValueArray13 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13) { - return internal::ValueArray13(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); -} - -template -internal::ValueArray14 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) { - return internal::ValueArray14(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, - v14); -} - -template -internal::ValueArray15 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) { - return internal::ValueArray15(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, - v13, v14, v15); -} - -template -internal::ValueArray16 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16) { - return internal::ValueArray16(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, - v12, v13, v14, v15, v16); -} - -template -internal::ValueArray17 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17) { - return internal::ValueArray17(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, - v11, v12, v13, v14, v15, v16, v17); -} - -template -internal::ValueArray18 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, - T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18) { - return internal::ValueArray18(v1, v2, v3, v4, v5, v6, v7, v8, v9, - v10, v11, v12, v13, v14, v15, v16, v17, v18); -} - -template -internal::ValueArray19 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, - T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, - T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) { - return internal::ValueArray19(v1, v2, v3, v4, v5, v6, v7, v8, - v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19); -} - -template -internal::ValueArray20 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) { - return internal::ValueArray20(v1, v2, v3, v4, v5, v6, v7, - v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20); -} - -template -internal::ValueArray21 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) { - return internal::ValueArray21(v1, v2, v3, v4, v5, v6, - v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21); -} - -template -internal::ValueArray22 Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22) { - return internal::ValueArray22(v1, v2, v3, v4, - v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22); -} - -template -internal::ValueArray23 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23) { - return internal::ValueArray23(v1, v2, v3, - v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23); -} - -template -internal::ValueArray24 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24) { - return internal::ValueArray24(v1, v2, - v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, - v19, v20, v21, v22, v23, v24); -} - -template -internal::ValueArray25 Values(T1 v1, - T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, - T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, - T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) { - return internal::ValueArray25(v1, - v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, - v18, v19, v20, v21, v22, v23, v24, v25); -} - -template -internal::ValueArray26 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26) { - return internal::ValueArray26(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, - v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26); -} - -template -internal::ValueArray27 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27) { - return internal::ValueArray27(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, - v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27); -} - -template -internal::ValueArray28 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28) { - return internal::ValueArray28(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, - v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, - v28); -} - -template -internal::ValueArray29 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29) { - return internal::ValueArray29(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, - v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, - v27, v28, v29); -} - -template -internal::ValueArray30 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, - T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, - T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) { - return internal::ValueArray30(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, - v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, - v26, v27, v28, v29, v30); -} - -template -internal::ValueArray31 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) { - return internal::ValueArray31(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, - v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, - v25, v26, v27, v28, v29, v30, v31); -} - -template -internal::ValueArray32 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32) { - return internal::ValueArray32(v1, v2, v3, v4, v5, v6, v7, v8, v9, - v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32); -} - -template -internal::ValueArray33 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, - T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33) { - return internal::ValueArray33(v1, v2, v3, v4, v5, v6, v7, v8, - v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32, v33); -} - -template -internal::ValueArray34 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, - T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, - T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, - T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, - T31 v31, T32 v32, T33 v33, T34 v34) { - return internal::ValueArray34(v1, v2, v3, v4, v5, v6, v7, - v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, - v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34); -} - -template -internal::ValueArray35 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, - T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, - T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) { - return internal::ValueArray35(v1, v2, v3, v4, v5, v6, - v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, - v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35); -} - -template -internal::ValueArray36 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, - T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, - T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) { - return internal::ValueArray36(v1, v2, v3, v4, - v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, - v34, v35, v36); -} - -template -internal::ValueArray37 Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, - T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, - T37 v37) { - return internal::ValueArray37(v1, v2, v3, - v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, - v34, v35, v36, v37); -} - -template -internal::ValueArray38 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, - T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, - T37 v37, T38 v38) { - return internal::ValueArray38(v1, v2, - v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, - v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, - v33, v34, v35, v36, v37, v38); -} - -template -internal::ValueArray39 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, - T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, - T37 v37, T38 v38, T39 v39) { - return internal::ValueArray39(v1, - v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, - v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, - v32, v33, v34, v35, v36, v37, v38, v39); -} - -template -internal::ValueArray40 Values(T1 v1, - T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, - T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, - T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, - T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, - T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) { - return internal::ValueArray40(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, - v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, - v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40); -} - -template -internal::ValueArray41 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) { - return internal::ValueArray41(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, - v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, - v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41); -} - -template -internal::ValueArray42 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42) { - return internal::ValueArray42(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, - v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, - v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, - v42); -} - -template -internal::ValueArray43 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43) { - return internal::ValueArray43(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, - v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, - v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, - v41, v42, v43); -} - -template -internal::ValueArray44 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44) { - return internal::ValueArray44(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, - v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, - v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, - v40, v41, v42, v43, v44); -} - -template -internal::ValueArray45 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, - T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, - T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, - T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, - T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) { - return internal::ValueArray45(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, - v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, - v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, - v39, v40, v41, v42, v43, v44, v45); -} - -template -internal::ValueArray46 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, - T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) { - return internal::ValueArray46(v1, v2, v3, v4, v5, v6, v7, v8, v9, - v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, - v38, v39, v40, v41, v42, v43, v44, v45, v46); -} - -template -internal::ValueArray47 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, - T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) { - return internal::ValueArray47(v1, v2, v3, v4, v5, v6, v7, v8, - v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, - v38, v39, v40, v41, v42, v43, v44, v45, v46, v47); -} - -template -internal::ValueArray48 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, - T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, - T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, - T48 v48) { - return internal::ValueArray48(v1, v2, v3, v4, v5, v6, v7, - v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, - v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, - v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48); -} - -template -internal::ValueArray49 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, - T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, - T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, - T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, - T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, - T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, - T47 v47, T48 v48, T49 v49) { - return internal::ValueArray49(v1, v2, v3, v4, v5, v6, - v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, - v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, - v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49); -} - -template -internal::ValueArray50 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, - T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, - T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, - T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, - T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) { - return internal::ValueArray50(v1, v2, v3, v4, - v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, - v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, - v48, v49, v50); -} - -// Bool() allows generating tests with parameters in a set of (false, true). -// -// Synopsis: -// Bool() -// - returns a generator producing sequences with elements {false, true}. -// -// It is useful when testing code that depends on Boolean flags. Combinations -// of multiple flags can be tested when several Bool()'s are combined using -// Combine() function. -// -// In the following example all tests in the test case FlagDependentTest -// will be instantiated twice with parameters false and true. -// -// class FlagDependentTest : public testing::TestWithParam { -// virtual void SetUp() { -// external_flag = GetParam(); -// } -// } -// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool()); -// -inline internal::ParamGenerator Bool() { - return Values(false, true); -} - -# if GTEST_HAS_COMBINE -// Combine() allows the user to combine two or more sequences to produce -// values of a Cartesian product of those sequences' elements. -// -// Synopsis: -// Combine(gen1, gen2, ..., genN) -// - returns a generator producing sequences with elements coming from -// the Cartesian product of elements from the sequences generated by -// gen1, gen2, ..., genN. The sequence elements will have a type of -// tuple where T1, T2, ..., TN are the types -// of elements from sequences produces by gen1, gen2, ..., genN. -// -// Combine can have up to 10 arguments. This number is currently limited -// by the maximum number of elements in the tuple implementation used by Google -// Test. -// -// Example: -// -// This will instantiate tests in test case AnimalTest each one with -// the parameter values tuple("cat", BLACK), tuple("cat", WHITE), -// tuple("dog", BLACK), and tuple("dog", WHITE): -// -// enum Color { BLACK, GRAY, WHITE }; -// class AnimalTest -// : public testing::TestWithParam > {...}; -// -// TEST_P(AnimalTest, AnimalLooksNice) {...} -// -// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest, -// Combine(Values("cat", "dog"), -// Values(BLACK, WHITE))); -// -// This will instantiate tests in FlagDependentTest with all variations of two -// Boolean flags: -// -// class FlagDependentTest -// : public testing::TestWithParam > { -// virtual void SetUp() { -// // Assigns external_flag_1 and external_flag_2 values from the tuple. -// tie(external_flag_1, external_flag_2) = GetParam(); -// } -// }; -// -// TEST_P(FlagDependentTest, TestFeature1) { -// // Test your code using external_flag_1 and external_flag_2 here. -// } -// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest, -// Combine(Bool(), Bool())); -// -template -internal::CartesianProductHolder2 Combine( - const Generator1& g1, const Generator2& g2) { - return internal::CartesianProductHolder2( - g1, g2); -} - -template -internal::CartesianProductHolder3 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3) { - return internal::CartesianProductHolder3( - g1, g2, g3); -} - -template -internal::CartesianProductHolder4 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4) { - return internal::CartesianProductHolder4( - g1, g2, g3, g4); -} - -template -internal::CartesianProductHolder5 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5) { - return internal::CartesianProductHolder5( - g1, g2, g3, g4, g5); -} - -template -internal::CartesianProductHolder6 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6) { - return internal::CartesianProductHolder6( - g1, g2, g3, g4, g5, g6); -} - -template -internal::CartesianProductHolder7 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7) { - return internal::CartesianProductHolder7( - g1, g2, g3, g4, g5, g6, g7); -} - -template -internal::CartesianProductHolder8 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7, const Generator8& g8) { - return internal::CartesianProductHolder8( - g1, g2, g3, g4, g5, g6, g7, g8); -} - -template -internal::CartesianProductHolder9 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7, const Generator8& g8, const Generator9& g9) { - return internal::CartesianProductHolder9( - g1, g2, g3, g4, g5, g6, g7, g8, g9); -} - -template -internal::CartesianProductHolder10 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7, const Generator8& g8, const Generator9& g9, - const Generator10& g10) { - return internal::CartesianProductHolder10( - g1, g2, g3, g4, g5, g6, g7, g8, g9, g10); -} -# endif // GTEST_HAS_COMBINE - - - -# define TEST_P(test_case_name, test_name) \ - class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ - : public test_case_name { \ - public: \ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \ - virtual void TestBody(); \ - private: \ - static int AddToRegistry() { \ - ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ - GetTestCasePatternHolder(\ - #test_case_name, __FILE__, __LINE__)->AddTestPattern(\ - #test_case_name, \ - #test_name, \ - new ::testing::internal::TestMetaFactory< \ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \ - return 0; \ - } \ - static int gtest_registering_dummy_; \ - GTEST_DISALLOW_COPY_AND_ASSIGN_(\ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \ - }; \ - int GTEST_TEST_CLASS_NAME_(test_case_name, \ - test_name)::gtest_registering_dummy_ = \ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \ - void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() - -# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \ - ::testing::internal::ParamGenerator \ - gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \ - int gtest_##prefix##test_case_name##_dummy_ = \ - ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ - GetTestCasePatternHolder(\ - #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\ - #prefix, \ - >est_##prefix##test_case_name##_EvalGenerator_, \ - __FILE__, __LINE__) - -} // namespace testing - -#endif // GTEST_HAS_PARAM_TEST - -#endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ -// Copyright 2006, Google 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "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 THE COPYRIGHT -// OWNER 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. -// -// Author: wan@google.com (Zhanyong Wan) -// -// Google C++ Testing Framework definitions useful in production code. - -#ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_ -#define GTEST_INCLUDE_GTEST_GTEST_PROD_H_ - -// When you need to test the private or protected members of a class, -// use the FRIEND_TEST macro to declare your tests as friends of the -// class. For example: -// -// class MyClass { -// private: -// void MyMethod(); -// FRIEND_TEST(MyClassTest, MyMethod); -// }; -// -// class MyClassTest : public testing::Test { -// // ... -// }; -// -// TEST_F(MyClassTest, MyMethod) { -// // Can call MyClass::MyMethod() here. -// } - -#define FRIEND_TEST(test_case_name, test_name)\ -friend class test_case_name##_##test_name##_Test - -#endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_ -// Copyright 2008, Google 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "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 THE COPYRIGHT -// OWNER 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. -// -// Author: mheule@google.com (Markus Heule) -// - -#ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ -#define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ - -#include -#include - -namespace testing { - -// A copyable object representing the result of a test part (i.e. an -// assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()). -// -// Don't inherit from TestPartResult as its destructor is not virtual. -class GTEST_API_ TestPartResult { - public: - // The possible outcomes of a test part (i.e. an assertion or an - // explicit SUCCEED(), FAIL(), or ADD_FAILURE()). - enum Type { - kSuccess, // Succeeded. - kNonFatalFailure, // Failed but the test can continue. - kFatalFailure // Failed and the test should be terminated. - }; - - // C'tor. TestPartResult does NOT have a default constructor. - // Always use this constructor (with parameters) to create a - // TestPartResult object. - TestPartResult(Type a_type, - const char* a_file_name, - int a_line_number, - const char* a_message) - : type_(a_type), - file_name_(a_file_name == NULL ? "" : a_file_name), - line_number_(a_line_number), - summary_(ExtractSummary(a_message)), - message_(a_message) { - } - - // Gets the outcome of the test part. - Type type() const { return type_; } - - // Gets the name of the source file where the test part took place, or - // NULL if it's unknown. - const char* file_name() const { - return file_name_.empty() ? NULL : file_name_.c_str(); - } - - // Gets the line in the source file where the test part took place, - // or -1 if it's unknown. - int line_number() const { return line_number_; } - - // Gets the summary of the failure message. - const char* summary() const { return summary_.c_str(); } - - // Gets the message associated with the test part. - const char* message() const { return message_.c_str(); } - - // Returns true iff the test part passed. - bool passed() const { return type_ == kSuccess; } - - // Returns true iff the test part failed. - bool failed() const { return type_ != kSuccess; } - - // Returns true iff the test part non-fatally failed. - bool nonfatally_failed() const { return type_ == kNonFatalFailure; } - - // Returns true iff the test part fatally failed. - bool fatally_failed() const { return type_ == kFatalFailure; } - - private: - Type type_; - - // Gets the summary of the failure message by omitting the stack - // trace in it. - static std::string ExtractSummary(const char* message); - - // The name of the source file where the test part took place, or - // "" if the source file is unknown. - std::string file_name_; - // The line in the source file where the test part took place, or -1 - // if the line number is unknown. - int line_number_; - std::string summary_; // The test failure summary. - std::string message_; // The test failure message. -}; - -// Prints a TestPartResult object. -std::ostream& operator<<(std::ostream& os, const TestPartResult& result); - -// An array of TestPartResult objects. -// -// Don't inherit from TestPartResultArray as its destructor is not -// virtual. -class GTEST_API_ TestPartResultArray { - public: - TestPartResultArray() {} - - // Appends the given TestPartResult to the array. - void Append(const TestPartResult& result); - - // Returns the TestPartResult at the given index (0-based). - const TestPartResult& GetTestPartResult(int index) const; - - // Returns the number of TestPartResult objects in the array. - int size() const; - - private: - std::vector array_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray); -}; - -// This interface knows how to report a test part result. -class TestPartResultReporterInterface { - public: - virtual ~TestPartResultReporterInterface() {} - - virtual void ReportTestPartResult(const TestPartResult& result) = 0; -}; - -namespace internal { - -// This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a -// statement generates new fatal failures. To do so it registers itself as the -// current test part result reporter. Besides checking if fatal failures were -// reported, it only delegates the reporting to the former result reporter. -// The original result reporter is restored in the destructor. -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -class GTEST_API_ HasNewFatalFailureHelper - : public TestPartResultReporterInterface { - public: - HasNewFatalFailureHelper(); - virtual ~HasNewFatalFailureHelper(); - virtual void ReportTestPartResult(const TestPartResult& result); - bool has_new_fatal_failure() const { return has_new_fatal_failure_; } - private: - bool has_new_fatal_failure_; - TestPartResultReporterInterface* original_reporter_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper); -}; - -} // namespace internal - -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ -// Copyright 2008 Google 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "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 THE COPYRIGHT -// OWNER 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. -// -// Author: wan@google.com (Zhanyong Wan) - -#ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ -#define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ - -// This header implements typed tests and type-parameterized tests. - -// Typed (aka type-driven) tests repeat the same test for types in a -// list. You must know which types you want to test with when writing -// typed tests. Here's how you do it: - -#if 0 - -// First, define a fixture class template. It should be parameterized -// by a type. Remember to derive it from testing::Test. -template -class FooTest : public testing::Test { - public: - ... - typedef std::list List; - static T shared_; - T value_; -}; - -// Next, associate a list of types with the test case, which will be -// repeated for each type in the list. The typedef is necessary for -// the macro to parse correctly. -typedef testing::Types MyTypes; -TYPED_TEST_CASE(FooTest, MyTypes); - -// If the type list contains only one type, you can write that type -// directly without Types<...>: -// TYPED_TEST_CASE(FooTest, int); - -// Then, use TYPED_TEST() instead of TEST_F() to define as many typed -// tests for this test case as you want. -TYPED_TEST(FooTest, DoesBlah) { - // Inside a test, refer to TypeParam to get the type parameter. - // Since we are inside a derived class template, C++ requires use to - // visit the members of FooTest via 'this'. - TypeParam n = this->value_; - - // To visit static members of the fixture, add the TestFixture:: - // prefix. - n += TestFixture::shared_; - - // To refer to typedefs in the fixture, add the "typename - // TestFixture::" prefix. - typename TestFixture::List values; - values.push_back(n); - ... -} - -TYPED_TEST(FooTest, HasPropertyA) { ... } - -#endif // 0 - -// Type-parameterized tests are abstract test patterns parameterized -// by a type. Compared with typed tests, type-parameterized tests -// allow you to define the test pattern without knowing what the type -// parameters are. The defined pattern can be instantiated with -// different types any number of times, in any number of translation -// units. -// -// If you are designing an interface or concept, you can define a -// suite of type-parameterized tests to verify properties that any -// valid implementation of the interface/concept should have. Then, -// each implementation can easily instantiate the test suite to verify -// that it conforms to the requirements, without having to write -// similar tests repeatedly. Here's an example: - -#if 0 - -// First, define a fixture class template. It should be parameterized -// by a type. Remember to derive it from testing::Test. -template -class FooTest : public testing::Test { - ... -}; - -// Next, declare that you will define a type-parameterized test case -// (the _P suffix is for "parameterized" or "pattern", whichever you -// prefer): -TYPED_TEST_CASE_P(FooTest); - -// Then, use TYPED_TEST_P() to define as many type-parameterized tests -// for this type-parameterized test case as you want. -TYPED_TEST_P(FooTest, DoesBlah) { - // Inside a test, refer to TypeParam to get the type parameter. - TypeParam n = 0; - ... -} - -TYPED_TEST_P(FooTest, HasPropertyA) { ... } - -// Now the tricky part: you need to register all test patterns before -// you can instantiate them. The first argument of the macro is the -// test case name; the rest are the names of the tests in this test -// case. -REGISTER_TYPED_TEST_CASE_P(FooTest, - DoesBlah, HasPropertyA); - -// Finally, you are free to instantiate the pattern with the types you -// want. If you put the above code in a header file, you can #include -// it in multiple C++ source files and instantiate it multiple times. -// -// To distinguish different instances of the pattern, the first -// argument to the INSTANTIATE_* macro is a prefix that will be added -// to the actual test case name. Remember to pick unique prefixes for -// different instances. -typedef testing::Types MyTypes; -INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes); - -// If the type list contains only one type, you can write that type -// directly without Types<...>: -// INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int); - -#endif // 0 - - -// Implements typed tests. - -#if GTEST_HAS_TYPED_TEST - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Expands to the name of the typedef for the type parameters of the -// given test case. -# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_ - -// The 'Types' template argument below must have spaces around it -// since some compilers may choke on '>>' when passing a template -// instance (e.g. Types) -# define TYPED_TEST_CASE(CaseName, Types) \ - typedef ::testing::internal::TypeList< Types >::type \ - GTEST_TYPE_PARAMS_(CaseName) - -# define TYPED_TEST(CaseName, TestName) \ - template \ - class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \ - : public CaseName { \ - private: \ - typedef CaseName TestFixture; \ - typedef gtest_TypeParam_ TypeParam; \ - virtual void TestBody(); \ - }; \ - bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \ - ::testing::internal::TypeParameterizedTest< \ - CaseName, \ - ::testing::internal::TemplateSel< \ - GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \ - GTEST_TYPE_PARAMS_(CaseName)>::Register(\ - "", #CaseName, #TestName, 0); \ - template \ - void GTEST_TEST_CLASS_NAME_(CaseName, TestName)::TestBody() - -#endif // GTEST_HAS_TYPED_TEST - -// Implements type-parameterized tests. - -#if GTEST_HAS_TYPED_TEST_P - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Expands to the namespace name that the type-parameterized tests for -// the given type-parameterized test case are defined in. The exact -// name of the namespace is subject to change without notice. -# define GTEST_CASE_NAMESPACE_(TestCaseName) \ - gtest_case_##TestCaseName##_ - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Expands to the name of the variable used to remember the names of -// the defined tests in the given test case. -# define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \ - gtest_typed_test_case_p_state_##TestCaseName##_ - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY. -// -// Expands to the name of the variable used to remember the names of -// the registered tests in the given test case. -# define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \ - gtest_registered_test_names_##TestCaseName##_ - -// The variables defined in the type-parameterized test macros are -// static as typically these macros are used in a .h file that can be -// #included in multiple translation units linked together. -# define TYPED_TEST_CASE_P(CaseName) \ - static ::testing::internal::TypedTestCasePState \ - GTEST_TYPED_TEST_CASE_P_STATE_(CaseName) - -# define TYPED_TEST_P(CaseName, TestName) \ - namespace GTEST_CASE_NAMESPACE_(CaseName) { \ - template \ - class TestName : public CaseName { \ - private: \ - typedef CaseName TestFixture; \ - typedef gtest_TypeParam_ TypeParam; \ - virtual void TestBody(); \ - }; \ - static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \ - GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\ - __FILE__, __LINE__, #CaseName, #TestName); \ - } \ - template \ - void GTEST_CASE_NAMESPACE_(CaseName)::TestName::TestBody() - -# define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \ - namespace GTEST_CASE_NAMESPACE_(CaseName) { \ - typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \ - } \ - static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \ - GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\ - __FILE__, __LINE__, #__VA_ARGS__) - -// The 'Types' template argument below must have spaces around it -// since some compilers may choke on '>>' when passing a template -// instance (e.g. Types) -# define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \ - bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \ - ::testing::internal::TypeParameterizedTestCase::type>::Register(\ - #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName)) - -#endif // GTEST_HAS_TYPED_TEST_P - -#endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ - -// Depending on the platform, different string classes are available. -// On Linux, in addition to ::std::string, Google also makes use of -// class ::string, which has the same interface as ::std::string, but -// has a different implementation. -// -// The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that -// ::string is available AND is a distinct type to ::std::string, or -// define it to 0 to indicate otherwise. -// -// If the user's ::std::string and ::string are the same class due to -// aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0. -// -// If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined -// heuristically. - -namespace testing { - -// Declares the flags. - -// This flag temporary enables the disabled tests. -GTEST_DECLARE_bool_(also_run_disabled_tests); - -// This flag brings the debugger on an assertion failure. -GTEST_DECLARE_bool_(break_on_failure); - -// This flag controls whether Google Test catches all test-thrown exceptions -// and logs them as failures. -GTEST_DECLARE_bool_(catch_exceptions); - -// This flag enables using colors in terminal output. Available values are -// "yes" to enable colors, "no" (disable colors), or "auto" (the default) -// to let Google Test decide. -GTEST_DECLARE_string_(color); - -// This flag sets up the filter to select by name using a glob pattern -// the tests to run. If the filter is not given all tests are executed. -GTEST_DECLARE_string_(filter); - -// This flag causes the Google Test to list tests. None of the tests listed -// are actually run if the flag is provided. -GTEST_DECLARE_bool_(list_tests); - -// This flag controls whether Google Test emits a detailed XML report to a file -// in addition to its normal textual output. -GTEST_DECLARE_string_(output); - -// This flags control whether Google Test prints the elapsed time for each -// test. -GTEST_DECLARE_bool_(print_time); - -// This flag specifies the random number seed. -GTEST_DECLARE_int32_(random_seed); - -// This flag sets how many times the tests are repeated. The default value -// is 1. If the value is -1 the tests are repeating forever. -GTEST_DECLARE_int32_(repeat); - -// This flag controls whether Google Test includes Google Test internal -// stack frames in failure stack traces. -GTEST_DECLARE_bool_(show_internal_stack_frames); - -// When this flag is specified, tests' order is randomized on every iteration. -GTEST_DECLARE_bool_(shuffle); - -// This flag specifies the maximum number of stack frames to be -// printed in a failure message. -GTEST_DECLARE_int32_(stack_trace_depth); - -// When this flag is specified, a failed assertion will throw an -// exception if exceptions are enabled, or exit the program with a -// non-zero code otherwise. -GTEST_DECLARE_bool_(throw_on_failure); - -// When this flag is set with a "host:port" string, on supported -// platforms test results are streamed to the specified port on -// the specified host machine. -GTEST_DECLARE_string_(stream_result_to); - -// The upper limit for valid stack trace depths. -const int kMaxStackTraceDepth = 100; - -namespace internal { - -class AssertHelper; -class DefaultGlobalTestPartResultReporter; -class ExecDeathTest; -class NoExecDeathTest; -class FinalSuccessChecker; -class GTestFlagSaver; -class StreamingListenerTest; -class TestResultAccessor; -class TestEventListenersAccessor; -class TestEventRepeater; -class UnitTestRecordPropertyTestHelper; -class WindowsDeathTest; -class UnitTestImpl* GetUnitTestImpl(); -void ReportFailureInUnknownLocation(TestPartResult::Type result_type, - const std::string& message); - -} // namespace internal - -// The friend relationship of some of these classes is cyclic. -// If we don't forward declare them the compiler might confuse the classes -// in friendship clauses with same named classes on the scope. -class Test; -class TestCase; -class TestInfo; -class UnitTest; - -// A class for indicating whether an assertion was successful. When -// the assertion wasn't successful, the AssertionResult object -// remembers a non-empty message that describes how it failed. -// -// To create an instance of this class, use one of the factory functions -// (AssertionSuccess() and AssertionFailure()). -// -// This class is useful for two purposes: -// 1. Defining predicate functions to be used with Boolean test assertions -// EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts -// 2. Defining predicate-format functions to be -// used with predicate assertions (ASSERT_PRED_FORMAT*, etc). -// -// For example, if you define IsEven predicate: -// -// testing::AssertionResult IsEven(int n) { -// if ((n % 2) == 0) -// return testing::AssertionSuccess(); -// else -// return testing::AssertionFailure() << n << " is odd"; -// } -// -// Then the failed expectation EXPECT_TRUE(IsEven(Fib(5))) -// will print the message -// -// Value of: IsEven(Fib(5)) -// Actual: false (5 is odd) -// Expected: true -// -// instead of a more opaque -// -// Value of: IsEven(Fib(5)) -// Actual: false -// Expected: true -// -// in case IsEven is a simple Boolean predicate. -// -// If you expect your predicate to be reused and want to support informative -// messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up -// about half as often as positive ones in our tests), supply messages for -// both success and failure cases: -// -// testing::AssertionResult IsEven(int n) { -// if ((n % 2) == 0) -// return testing::AssertionSuccess() << n << " is even"; -// else -// return testing::AssertionFailure() << n << " is odd"; -// } -// -// Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print -// -// Value of: IsEven(Fib(6)) -// Actual: true (8 is even) -// Expected: false -// -// NB: Predicates that support negative Boolean assertions have reduced -// performance in positive ones so be careful not to use them in tests -// that have lots (tens of thousands) of positive Boolean assertions. -// -// To use this class with EXPECT_PRED_FORMAT assertions such as: -// -// // Verifies that Foo() returns an even number. -// EXPECT_PRED_FORMAT1(IsEven, Foo()); -// -// you need to define: -// -// testing::AssertionResult IsEven(const char* expr, int n) { -// if ((n % 2) == 0) -// return testing::AssertionSuccess(); -// else -// return testing::AssertionFailure() -// << "Expected: " << expr << " is even\n Actual: it's " << n; -// } -// -// If Foo() returns 5, you will see the following message: -// -// Expected: Foo() is even -// Actual: it's 5 -// -class GTEST_API_ AssertionResult { - public: - // Copy constructor. - // Used in EXPECT_TRUE/FALSE(assertion_result). - AssertionResult(const AssertionResult& other); - // Used in the EXPECT_TRUE/FALSE(bool_expression). - explicit AssertionResult(bool success) : success_(success) {} - - // Returns true iff the assertion succeeded. - operator bool() const { return success_; } // NOLINT - - // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE. - AssertionResult operator!() const; - - // Returns the text streamed into this AssertionResult. Test assertions - // use it when they fail (i.e., the predicate's outcome doesn't match the - // assertion's expectation). When nothing has been streamed into the - // object, returns an empty string. - const char* message() const { - return message_.get() != NULL ? message_->c_str() : ""; - } - // TODO(vladl@google.com): Remove this after making sure no clients use it. - // Deprecated; please use message() instead. - const char* failure_message() const { return message(); } - - // Streams a custom failure message into this object. - template AssertionResult& operator<<(const T& value) { - AppendMessage(Message() << value); - return *this; - } - - // Allows streaming basic output manipulators such as endl or flush into - // this object. - AssertionResult& operator<<( - ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) { - AppendMessage(Message() << basic_manipulator); - return *this; - } - - private: - // Appends the contents of message to message_. - void AppendMessage(const Message& a_message) { - if (message_.get() == NULL) - message_.reset(new ::std::string); - message_->append(a_message.GetString().c_str()); - } - - // Stores result of the assertion predicate. - bool success_; - // Stores the message describing the condition in case the expectation - // construct is not satisfied with the predicate's outcome. - // Referenced via a pointer to avoid taking too much stack frame space - // with test assertions. - internal::scoped_ptr< ::std::string> message_; - - GTEST_DISALLOW_ASSIGN_(AssertionResult); -}; - -// Makes a successful assertion result. -GTEST_API_ AssertionResult AssertionSuccess(); - -// Makes a failed assertion result. -GTEST_API_ AssertionResult AssertionFailure(); - -// Makes a failed assertion result with the given failure message. -// Deprecated; use AssertionFailure() << msg. -GTEST_API_ AssertionResult AssertionFailure(const Message& msg); - -// The abstract class that all tests inherit from. -// -// In Google Test, a unit test program contains one or many TestCases, and -// each TestCase contains one or many Tests. -// -// When you define a test using the TEST macro, you don't need to -// explicitly derive from Test - the TEST macro automatically does -// this for you. -// -// The only time you derive from Test is when defining a test fixture -// to be used a TEST_F. For example: -// -// class FooTest : public testing::Test { -// protected: -// virtual void SetUp() { ... } -// virtual void TearDown() { ... } -// ... -// }; -// -// TEST_F(FooTest, Bar) { ... } -// TEST_F(FooTest, Baz) { ... } -// -// Test is not copyable. -class GTEST_API_ Test { - public: - friend class TestInfo; - - // Defines types for pointers to functions that set up and tear down - // a test case. - typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc; - typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc; - - // The d'tor is virtual as we intend to inherit from Test. - virtual ~Test(); - - // Sets up the stuff shared by all tests in this test case. - // - // Google Test will call Foo::SetUpTestCase() before running the first - // test in test case Foo. Hence a sub-class can define its own - // SetUpTestCase() method to shadow the one defined in the super - // class. - static void SetUpTestCase() {} - - // Tears down the stuff shared by all tests in this test case. - // - // Google Test will call Foo::TearDownTestCase() after running the last - // test in test case Foo. Hence a sub-class can define its own - // TearDownTestCase() method to shadow the one defined in the super - // class. - static void TearDownTestCase() {} - - // Returns true iff the current test has a fatal failure. - static bool HasFatalFailure(); - - // Returns true iff the current test has a non-fatal failure. - static bool HasNonfatalFailure(); - - // Returns true iff the current test has a (either fatal or - // non-fatal) failure. - static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); } - - // Logs a property for the current test, test case, or for the entire - // invocation of the test program when used outside of the context of a - // test case. Only the last value for a given key is remembered. These - // are public static so they can be called from utility functions that are - // not members of the test fixture. Calls to RecordProperty made during - // lifespan of the test (from the moment its constructor starts to the - // moment its destructor finishes) will be output in XML as attributes of - // the element. Properties recorded from fixture's - // SetUpTestCase or TearDownTestCase are logged as attributes of the - // corresponding element. Calls to RecordProperty made in the - // global context (before or after invocation of RUN_ALL_TESTS and from - // SetUp/TearDown method of Environment objects registered with Google - // Test) will be output as attributes of the element. - static void RecordProperty(const std::string& key, const std::string& value); - static void RecordProperty(const std::string& key, int value); - - protected: - // Creates a Test object. - Test(); - - // Sets up the test fixture. - virtual void SetUp(); - - // Tears down the test fixture. - virtual void TearDown(); - - private: - // Returns true iff the current test has the same fixture class as - // the first test in the current test case. - static bool HasSameFixtureClass(); - - // Runs the test after the test fixture has been set up. - // - // A sub-class must implement this to define the test logic. - // - // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM. - // Instead, use the TEST or TEST_F macro. - virtual void TestBody() = 0; - - // Sets up, executes, and tears down the test. - void Run(); - - // Deletes self. We deliberately pick an unusual name for this - // internal method to avoid clashing with names used in user TESTs. - void DeleteSelf_() { delete this; } - - // Uses a GTestFlagSaver to save and restore all Google Test flags. - const internal::GTestFlagSaver* const gtest_flag_saver_; - - // Often a user mis-spells SetUp() as Setup() and spends a long time - // wondering why it is never called by Google Test. The declaration of - // the following method is solely for catching such an error at - // compile time: - // - // - The return type is deliberately chosen to be not void, so it - // will be a conflict if a user declares void Setup() in his test - // fixture. - // - // - This method is private, so it will be another compiler error - // if a user calls it from his test fixture. - // - // DO NOT OVERRIDE THIS FUNCTION. - // - // If you see an error about overriding the following function or - // about it being private, you have mis-spelled SetUp() as Setup(). - struct Setup_should_be_spelled_SetUp {}; - virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; } - - // We disallow copying Tests. - GTEST_DISALLOW_COPY_AND_ASSIGN_(Test); -}; - -typedef internal::TimeInMillis TimeInMillis; - -// A copyable object representing a user specified test property which can be -// output as a key/value string pair. -// -// Don't inherit from TestProperty as its destructor is not virtual. -class TestProperty { - public: - // C'tor. TestProperty does NOT have a default constructor. - // Always use this constructor (with parameters) to create a - // TestProperty object. - TestProperty(const std::string& a_key, const std::string& a_value) : - key_(a_key), value_(a_value) { - } - - // Gets the user supplied key. - const char* key() const { - return key_.c_str(); - } - - // Gets the user supplied value. - const char* value() const { - return value_.c_str(); - } - - // Sets a new value, overriding the one supplied in the constructor. - void SetValue(const std::string& new_value) { - value_ = new_value; - } - - private: - // The key supplied by the user. - std::string key_; - // The value supplied by the user. - std::string value_; -}; - -// The result of a single Test. This includes a list of -// TestPartResults, a list of TestProperties, a count of how many -// death tests there are in the Test, and how much time it took to run -// the Test. -// -// TestResult is not copyable. -class GTEST_API_ TestResult { - public: - // Creates an empty TestResult. - TestResult(); - - // D'tor. Do not inherit from TestResult. - ~TestResult(); - - // Gets the number of all test parts. This is the sum of the number - // of successful test parts and the number of failed test parts. - int total_part_count() const; - - // Returns the number of the test properties. - int test_property_count() const; - - // Returns true iff the test passed (i.e. no test part failed). - bool Passed() const { return !Failed(); } - - // Returns true iff the test failed. - bool Failed() const; - - // Returns true iff the test fatally failed. - bool HasFatalFailure() const; - - // Returns true iff the test has a non-fatal failure. - bool HasNonfatalFailure() const; - - // Returns the elapsed time, in milliseconds. - TimeInMillis elapsed_time() const { return elapsed_time_; } - - // Returns the i-th test part result among all the results. i can range - // from 0 to test_property_count() - 1. If i is not in that range, aborts - // the program. - const TestPartResult& GetTestPartResult(int i) const; - - // Returns the i-th test property. i can range from 0 to - // test_property_count() - 1. If i is not in that range, aborts the - // program. - const TestProperty& GetTestProperty(int i) const; - - private: - friend class TestInfo; - friend class TestCase; - friend class UnitTest; - friend class internal::DefaultGlobalTestPartResultReporter; - friend class internal::ExecDeathTest; - friend class internal::TestResultAccessor; - friend class internal::UnitTestImpl; - friend class internal::WindowsDeathTest; - - // Gets the vector of TestPartResults. - const std::vector& test_part_results() const { - return test_part_results_; - } - - // Gets the vector of TestProperties. - const std::vector& test_properties() const { - return test_properties_; - } - - // Sets the elapsed time. - void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } - - // Adds a test property to the list. The property is validated and may add - // a non-fatal failure if invalid (e.g., if it conflicts with reserved - // key names). If a property is already recorded for the same key, the - // value will be updated, rather than storing multiple values for the same - // key. xml_element specifies the element for which the property is being - // recorded and is used for validation. - void RecordProperty(const std::string& xml_element, - const TestProperty& test_property); - - // Adds a failure if the key is a reserved attribute of Google Test - // testcase tags. Returns true if the property is valid. - // TODO(russr): Validate attribute names are legal and human readable. - static bool ValidateTestProperty(const std::string& xml_element, - const TestProperty& test_property); - - // Adds a test part result to the list. - void AddTestPartResult(const TestPartResult& test_part_result); - - // Returns the death test count. - int death_test_count() const { return death_test_count_; } - - // Increments the death test count, returning the new count. - int increment_death_test_count() { return ++death_test_count_; } - - // Clears the test part results. - void ClearTestPartResults(); - - // Clears the object. - void Clear(); - - // Protects mutable state of the property vector and of owned - // properties, whose values may be updated. - internal::Mutex test_properites_mutex_; - - // The vector of TestPartResults - std::vector test_part_results_; - // The vector of TestProperties - std::vector test_properties_; - // Running count of death tests. - int death_test_count_; - // The elapsed time, in milliseconds. - TimeInMillis elapsed_time_; - - // We disallow copying TestResult. - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult); -}; // class TestResult - -// A TestInfo object stores the following information about a test: -// -// Test case name -// Test name -// Whether the test should be run -// A function pointer that creates the test object when invoked -// Test result -// -// The constructor of TestInfo registers itself with the UnitTest -// singleton such that the RUN_ALL_TESTS() macro knows which tests to -// run. -class GTEST_API_ TestInfo { - public: - // Destructs a TestInfo object. This function is not virtual, so - // don't inherit from TestInfo. - ~TestInfo(); - - // Returns the test case name. - const char* test_case_name() const { return test_case_name_.c_str(); } - - // Returns the test name. - const char* name() const { return name_.c_str(); } - - // Returns the name of the parameter type, or NULL if this is not a typed - // or a type-parameterized test. - const char* type_param() const { - if (type_param_.get() != NULL) - return type_param_->c_str(); - return NULL; - } - - // Returns the text representation of the value parameter, or NULL if this - // is not a value-parameterized test. - const char* value_param() const { - if (value_param_.get() != NULL) - return value_param_->c_str(); - return NULL; - } - - // Returns true if this test should run, that is if the test is not - // disabled (or it is disabled but the also_run_disabled_tests flag has - // been specified) and its full name matches the user-specified filter. - // - // Google Test allows the user to filter the tests by their full names. - // The full name of a test Bar in test case Foo is defined as - // "Foo.Bar". Only the tests that match the filter will run. - // - // A filter is a colon-separated list of glob (not regex) patterns, - // optionally followed by a '-' and a colon-separated list of - // negative patterns (tests to exclude). A test is run if it - // matches one of the positive patterns and does not match any of - // the negative patterns. - // - // For example, *A*:Foo.* is a filter that matches any string that - // contains the character 'A' or starts with "Foo.". - bool should_run() const { return should_run_; } - - // Returns true iff this test will appear in the XML report. - bool is_reportable() const { - // For now, the XML report includes all tests matching the filter. - // In the future, we may trim tests that are excluded because of - // sharding. - return matches_filter_; - } - - // Returns the result of the test. - const TestResult* result() const { return &result_; } - - private: -#if GTEST_HAS_DEATH_TEST - friend class internal::DefaultDeathTestFactory; -#endif // GTEST_HAS_DEATH_TEST - friend class Test; - friend class TestCase; - friend class internal::UnitTestImpl; - friend class internal::StreamingListenerTest; - friend TestInfo* internal::MakeAndRegisterTestInfo( - const char* test_case_name, - const char* name, - const char* type_param, - const char* value_param, - internal::TypeId fixture_class_id, - Test::SetUpTestCaseFunc set_up_tc, - Test::TearDownTestCaseFunc tear_down_tc, - internal::TestFactoryBase* factory); - - // Constructs a TestInfo object. The newly constructed instance assumes - // ownership of the factory object. - TestInfo(const std::string& test_case_name, - const std::string& name, - const char* a_type_param, // NULL if not a type-parameterized test - const char* a_value_param, // NULL if not a value-parameterized test - internal::TypeId fixture_class_id, - internal::TestFactoryBase* factory); - - // Increments the number of death tests encountered in this test so - // far. - int increment_death_test_count() { - return result_.increment_death_test_count(); - } - - // Creates the test object, runs it, records its result, and then - // deletes it. - void Run(); - - static void ClearTestResult(TestInfo* test_info) { - test_info->result_.Clear(); - } - - // These fields are immutable properties of the test. - const std::string test_case_name_; // Test case name - const std::string name_; // Test name - // Name of the parameter type, or NULL if this is not a typed or a - // type-parameterized test. - const internal::scoped_ptr type_param_; - // Text representation of the value parameter, or NULL if this is not a - // value-parameterized test. - const internal::scoped_ptr value_param_; - const internal::TypeId fixture_class_id_; // ID of the test fixture class - bool should_run_; // True iff this test should run - bool is_disabled_; // True iff this test is disabled - bool matches_filter_; // True if this test matches the - // user-specified filter. - internal::TestFactoryBase* const factory_; // The factory that creates - // the test object - - // This field is mutable and needs to be reset before running the - // test for the second time. - TestResult result_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo); -}; - -// A test case, which consists of a vector of TestInfos. -// -// TestCase is not copyable. -class GTEST_API_ TestCase { - public: - // Creates a TestCase with the given name. - // - // TestCase does NOT have a default constructor. Always use this - // constructor to create a TestCase object. - // - // Arguments: - // - // name: name of the test case - // a_type_param: the name of the test's type parameter, or NULL if - // this is not a type-parameterized test. - // set_up_tc: pointer to the function that sets up the test case - // tear_down_tc: pointer to the function that tears down the test case - TestCase(const char* name, const char* a_type_param, - Test::SetUpTestCaseFunc set_up_tc, - Test::TearDownTestCaseFunc tear_down_tc); - - // Destructor of TestCase. - virtual ~TestCase(); - - // Gets the name of the TestCase. - const char* name() const { return name_.c_str(); } - - // Returns the name of the parameter type, or NULL if this is not a - // type-parameterized test case. - const char* type_param() const { - if (type_param_.get() != NULL) - return type_param_->c_str(); - return NULL; - } - - // Returns true if any test in this test case should run. - bool should_run() const { return should_run_; } - - // Gets the number of successful tests in this test case. - int successful_test_count() const; - - // Gets the number of failed tests in this test case. - int failed_test_count() const; - - // Gets the number of disabled tests that will be reported in the XML report. - int reportable_disabled_test_count() const; - - // Gets the number of disabled tests in this test case. - int disabled_test_count() const; - - // Gets the number of tests to be printed in the XML report. - int reportable_test_count() const; - - // Get the number of tests in this test case that should run. - int test_to_run_count() const; - - // Gets the number of all tests in this test case. - int total_test_count() const; - - // Returns true iff the test case passed. - bool Passed() const { return !Failed(); } - - // Returns true iff the test case failed. - bool Failed() const { return failed_test_count() > 0; } - - // Returns the elapsed time, in milliseconds. - TimeInMillis elapsed_time() const { return elapsed_time_; } - - // Returns the i-th test among all the tests. i can range from 0 to - // total_test_count() - 1. If i is not in that range, returns NULL. - const TestInfo* GetTestInfo(int i) const; - - // Returns the TestResult that holds test properties recorded during - // execution of SetUpTestCase and TearDownTestCase. - const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; } - - private: - friend class Test; - friend class internal::UnitTestImpl; - - // Gets the (mutable) vector of TestInfos in this TestCase. - std::vector& test_info_list() { return test_info_list_; } - - // Gets the (immutable) vector of TestInfos in this TestCase. - const std::vector& test_info_list() const { - return test_info_list_; - } - - // Returns the i-th test among all the tests. i can range from 0 to - // total_test_count() - 1. If i is not in that range, returns NULL. - TestInfo* GetMutableTestInfo(int i); - - // Sets the should_run member. - void set_should_run(bool should) { should_run_ = should; } - - // Adds a TestInfo to this test case. Will delete the TestInfo upon - // destruction of the TestCase object. - void AddTestInfo(TestInfo * test_info); - - // Clears the results of all tests in this test case. - void ClearResult(); - - // Clears the results of all tests in the given test case. - static void ClearTestCaseResult(TestCase* test_case) { - test_case->ClearResult(); - } - - // Runs every test in this TestCase. - void Run(); - - // Runs SetUpTestCase() for this TestCase. This wrapper is needed - // for catching exceptions thrown from SetUpTestCase(). - void RunSetUpTestCase() { (*set_up_tc_)(); } - - // Runs TearDownTestCase() for this TestCase. This wrapper is - // needed for catching exceptions thrown from TearDownTestCase(). - void RunTearDownTestCase() { (*tear_down_tc_)(); } - - // Returns true iff test passed. - static bool TestPassed(const TestInfo* test_info) { - return test_info->should_run() && test_info->result()->Passed(); - } - - // Returns true iff test failed. - static bool TestFailed(const TestInfo* test_info) { - return test_info->should_run() && test_info->result()->Failed(); - } - - // Returns true iff the test is disabled and will be reported in the XML - // report. - static bool TestReportableDisabled(const TestInfo* test_info) { - return test_info->is_reportable() && test_info->is_disabled_; - } - - // Returns true iff test is disabled. - static bool TestDisabled(const TestInfo* test_info) { - return test_info->is_disabled_; - } - - // Returns true iff this test will appear in the XML report. - static bool TestReportable(const TestInfo* test_info) { - return test_info->is_reportable(); - } - - // Returns true if the given test should run. - static bool ShouldRunTest(const TestInfo* test_info) { - return test_info->should_run(); - } - - // Shuffles the tests in this test case. - void ShuffleTests(internal::Random* random); - - // Restores the test order to before the first shuffle. - void UnshuffleTests(); - - // Name of the test case. - std::string name_; - // Name of the parameter type, or NULL if this is not a typed or a - // type-parameterized test. - const internal::scoped_ptr type_param_; - // The vector of TestInfos in their original order. It owns the - // elements in the vector. - std::vector test_info_list_; - // Provides a level of indirection for the test list to allow easy - // shuffling and restoring the test order. The i-th element in this - // vector is the index of the i-th test in the shuffled test list. - std::vector test_indices_; - // Pointer to the function that sets up the test case. - Test::SetUpTestCaseFunc set_up_tc_; - // Pointer to the function that tears down the test case. - Test::TearDownTestCaseFunc tear_down_tc_; - // True iff any test in this test case should run. - bool should_run_; - // Elapsed time, in milliseconds. - TimeInMillis elapsed_time_; - // Holds test properties recorded during execution of SetUpTestCase and - // TearDownTestCase. - TestResult ad_hoc_test_result_; - - // We disallow copying TestCases. - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase); -}; - -// An Environment object is capable of setting up and tearing down an -// environment. The user should subclass this to define his own -// environment(s). -// -// An Environment object does the set-up and tear-down in virtual -// methods SetUp() and TearDown() instead of the constructor and the -// destructor, as: -// -// 1. You cannot safely throw from a destructor. This is a problem -// as in some cases Google Test is used where exceptions are enabled, and -// we may want to implement ASSERT_* using exceptions where they are -// available. -// 2. You cannot use ASSERT_* directly in a constructor or -// destructor. -class Environment { - public: - // The d'tor is virtual as we need to subclass Environment. - virtual ~Environment() {} - - // Override this to define how to set up the environment. - virtual void SetUp() {} - - // Override this to define how to tear down the environment. - virtual void TearDown() {} - private: - // If you see an error about overriding the following function or - // about it being private, you have mis-spelled SetUp() as Setup(). - struct Setup_should_be_spelled_SetUp {}; - virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; } -}; - -// The interface for tracing execution of tests. The methods are organized in -// the order the corresponding events are fired. -class TestEventListener { - public: - virtual ~TestEventListener() {} - - // Fired before any test activity starts. - virtual void OnTestProgramStart(const UnitTest& unit_test) = 0; - - // Fired before each iteration of tests starts. There may be more than - // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration - // index, starting from 0. - virtual void OnTestIterationStart(const UnitTest& unit_test, - int iteration) = 0; - - // Fired before environment set-up for each iteration of tests starts. - virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0; - - // Fired after environment set-up for each iteration of tests ends. - virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0; - - // Fired before the test case starts. - virtual void OnTestCaseStart(const TestCase& test_case) = 0; - - // Fired before the test starts. - virtual void OnTestStart(const TestInfo& test_info) = 0; - - // Fired after a failed assertion or a SUCCEED() invocation. - virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0; - - // Fired after the test ends. - virtual void OnTestEnd(const TestInfo& test_info) = 0; - - // Fired after the test case ends. - virtual void OnTestCaseEnd(const TestCase& test_case) = 0; - - // Fired before environment tear-down for each iteration of tests starts. - virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0; - - // Fired after environment tear-down for each iteration of tests ends. - virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0; - - // Fired after each iteration of tests finishes. - virtual void OnTestIterationEnd(const UnitTest& unit_test, - int iteration) = 0; - - // Fired after all test activities have ended. - virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; -}; - -// The convenience class for users who need to override just one or two -// methods and are not concerned that a possible change to a signature of -// the methods they override will not be caught during the build. For -// comments about each method please see the definition of TestEventListener -// above. -class EmptyTestEventListener : public TestEventListener { - public: - virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} - virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, - int /*iteration*/) {} - virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} - virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} - virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} - virtual void OnTestStart(const TestInfo& /*test_info*/) {} - virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} - virtual void OnTestEnd(const TestInfo& /*test_info*/) {} - virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} - virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} - virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} - virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, - int /*iteration*/) {} - virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {} -}; - -// TestEventListeners lets users add listeners to track events in Google Test. -class GTEST_API_ TestEventListeners { - public: - TestEventListeners(); - ~TestEventListeners(); - - // Appends an event listener to the end of the list. Google Test assumes - // the ownership of the listener (i.e. it will delete the listener when - // the test program finishes). - void Append(TestEventListener* listener); - - // Removes the given event listener from the list and returns it. It then - // becomes the caller's responsibility to delete the listener. Returns - // NULL if the listener is not found in the list. - TestEventListener* Release(TestEventListener* listener); - - // Returns the standard listener responsible for the default console - // output. Can be removed from the listeners list to shut down default - // console output. Note that removing this object from the listener list - // with Release transfers its ownership to the caller and makes this - // function return NULL the next time. - TestEventListener* default_result_printer() const { - return default_result_printer_; - } - - // Returns the standard listener responsible for the default XML output - // controlled by the --gtest_output=xml flag. Can be removed from the - // listeners list by users who want to shut down the default XML output - // controlled by this flag and substitute it with custom one. Note that - // removing this object from the listener list with Release transfers its - // ownership to the caller and makes this function return NULL the next - // time. - TestEventListener* default_xml_generator() const { - return default_xml_generator_; - } - - private: - friend class TestCase; - friend class TestInfo; - friend class internal::DefaultGlobalTestPartResultReporter; - friend class internal::NoExecDeathTest; - friend class internal::TestEventListenersAccessor; - friend class internal::UnitTestImpl; - - // Returns repeater that broadcasts the TestEventListener events to all - // subscribers. - TestEventListener* repeater(); - - // Sets the default_result_printer attribute to the provided listener. - // The listener is also added to the listener list and previous - // default_result_printer is removed from it and deleted. The listener can - // also be NULL in which case it will not be added to the list. Does - // nothing if the previous and the current listener objects are the same. - void SetDefaultResultPrinter(TestEventListener* listener); - - // Sets the default_xml_generator attribute to the provided listener. The - // listener is also added to the listener list and previous - // default_xml_generator is removed from it and deleted. The listener can - // also be NULL in which case it will not be added to the list. Does - // nothing if the previous and the current listener objects are the same. - void SetDefaultXmlGenerator(TestEventListener* listener); - - // Controls whether events will be forwarded by the repeater to the - // listeners in the list. - bool EventForwardingEnabled() const; - void SuppressEventForwarding(); - - // The actual list of listeners. - internal::TestEventRepeater* repeater_; - // Listener responsible for the standard result output. - TestEventListener* default_result_printer_; - // Listener responsible for the creation of the XML output file. - TestEventListener* default_xml_generator_; - - // We disallow copying TestEventListeners. - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners); -}; - -// A UnitTest consists of a vector of TestCases. -// -// This is a singleton class. The only instance of UnitTest is -// created when UnitTest::GetInstance() is first called. This -// instance is never deleted. -// -// UnitTest is not copyable. -// -// This class is thread-safe as long as the methods are called -// according to their specification. -class GTEST_API_ UnitTest { - public: - // Gets the singleton UnitTest object. The first time this method - // is called, a UnitTest object is constructed and returned. - // Consecutive calls will return the same object. - static UnitTest* GetInstance(); - - // Runs all tests in this UnitTest object and prints the result. - // Returns 0 if successful, or 1 otherwise. - // - // This method can only be called from the main thread. - // - // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. - int Run() GTEST_MUST_USE_RESULT_; - - // Returns the working directory when the first TEST() or TEST_F() - // was executed. The UnitTest object owns the string. - const char* original_working_dir() const; - - // Returns the TestCase object for the test that's currently running, - // or NULL if no test is running. - const TestCase* current_test_case() const - GTEST_LOCK_EXCLUDED_(mutex_); - - // Returns the TestInfo object for the test that's currently running, - // or NULL if no test is running. - const TestInfo* current_test_info() const - GTEST_LOCK_EXCLUDED_(mutex_); - - // Returns the random seed used at the start of the current test run. - int random_seed() const; - -#if GTEST_HAS_PARAM_TEST - // Returns the ParameterizedTestCaseRegistry object used to keep track of - // value-parameterized tests and instantiate and register them. - // - // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. - internal::ParameterizedTestCaseRegistry& parameterized_test_registry() - GTEST_LOCK_EXCLUDED_(mutex_); -#endif // GTEST_HAS_PARAM_TEST - - // Gets the number of successful test cases. - int successful_test_case_count() const; - - // Gets the number of failed test cases. - int failed_test_case_count() const; - - // Gets the number of all test cases. - int total_test_case_count() const; - - // Gets the number of all test cases that contain at least one test - // that should run. - int test_case_to_run_count() const; - - // Gets the number of successful tests. - int successful_test_count() const; - - // Gets the number of failed tests. - int failed_test_count() const; - - // Gets the number of disabled tests that will be reported in the XML report. - int reportable_disabled_test_count() const; - - // Gets the number of disabled tests. - int disabled_test_count() const; - - // Gets the number of tests to be printed in the XML report. - int reportable_test_count() const; - - // Gets the number of all tests. - int total_test_count() const; - - // Gets the number of tests that should run. - int test_to_run_count() const; - - // Gets the time of the test program start, in ms from the start of the - // UNIX epoch. - TimeInMillis start_timestamp() const; - - // Gets the elapsed time, in milliseconds. - TimeInMillis elapsed_time() const; - - // Returns true iff the unit test passed (i.e. all test cases passed). - bool Passed() const; - - // Returns true iff the unit test failed (i.e. some test case failed - // or something outside of all tests failed). - bool Failed() const; - - // Gets the i-th test case among all the test cases. i can range from 0 to - // total_test_case_count() - 1. If i is not in that range, returns NULL. - const TestCase* GetTestCase(int i) const; - - // Returns the TestResult containing information on test failures and - // properties logged outside of individual test cases. - const TestResult& ad_hoc_test_result() const; - - // Returns the list of event listeners that can be used to track events - // inside Google Test. - TestEventListeners& listeners(); - - private: - // Registers and returns a global test environment. When a test - // program is run, all global test environments will be set-up in - // the order they were registered. After all tests in the program - // have finished, all global test environments will be torn-down in - // the *reverse* order they were registered. - // - // The UnitTest object takes ownership of the given environment. - // - // This method can only be called from the main thread. - Environment* AddEnvironment(Environment* env); - - // Adds a TestPartResult to the current TestResult object. All - // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) - // eventually call this to report their results. The user code - // should use the assertion macros instead of calling this directly. - void AddTestPartResult(TestPartResult::Type result_type, - const char* file_name, - int line_number, - const std::string& message, - const std::string& os_stack_trace) - GTEST_LOCK_EXCLUDED_(mutex_); - - // Adds a TestProperty to the current TestResult object when invoked from - // inside a test, to current TestCase's ad_hoc_test_result_ when invoked - // from SetUpTestCase or TearDownTestCase, or to the global property set - // when invoked elsewhere. If the result already contains a property with - // the same key, the value will be updated. - void RecordProperty(const std::string& key, const std::string& value); - - // Gets the i-th test case among all the test cases. i can range from 0 to - // total_test_case_count() - 1. If i is not in that range, returns NULL. - TestCase* GetMutableTestCase(int i); - - // Accessors for the implementation object. - internal::UnitTestImpl* impl() { return impl_; } - const internal::UnitTestImpl* impl() const { return impl_; } - - // These classes and funcions are friends as they need to access private - // members of UnitTest. - friend class Test; - friend class internal::AssertHelper; - friend class internal::ScopedTrace; - friend class internal::StreamingListenerTest; - friend class internal::UnitTestRecordPropertyTestHelper; - friend Environment* AddGlobalTestEnvironment(Environment* env); - friend internal::UnitTestImpl* internal::GetUnitTestImpl(); - friend void internal::ReportFailureInUnknownLocation( - TestPartResult::Type result_type, - const std::string& message); - - // Creates an empty UnitTest. - UnitTest(); - - // D'tor - virtual ~UnitTest(); - - // Pushes a trace defined by SCOPED_TRACE() on to the per-thread - // Google Test trace stack. - void PushGTestTrace(const internal::TraceInfo& trace) - GTEST_LOCK_EXCLUDED_(mutex_); - - // Pops a trace from the per-thread Google Test trace stack. - void PopGTestTrace() - GTEST_LOCK_EXCLUDED_(mutex_); - - // Protects mutable state in *impl_. This is mutable as some const - // methods need to lock it too. - mutable internal::Mutex mutex_; - - // Opaque implementation object. This field is never changed once - // the object is constructed. We don't mark it as const here, as - // doing so will cause a warning in the constructor of UnitTest. - // Mutable state in *impl_ is protected by mutex_. - internal::UnitTestImpl* impl_; - - // We disallow copying UnitTest. - GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest); -}; - -// A convenient wrapper for adding an environment for the test -// program. -// -// You should call this before RUN_ALL_TESTS() is called, probably in -// main(). If you use gtest_main, you need to call this before main() -// starts for it to take effect. For example, you can define a global -// variable like this: -// -// testing::Environment* const foo_env = -// testing::AddGlobalTestEnvironment(new FooEnvironment); -// -// However, we strongly recommend you to write your own main() and -// call AddGlobalTestEnvironment() there, as relying on initialization -// of global variables makes the code harder to read and may cause -// problems when you register multiple environments from different -// translation units and the environments have dependencies among them -// (remember that the compiler doesn't guarantee the order in which -// global variables from different translation units are initialized). -inline Environment* AddGlobalTestEnvironment(Environment* env) { - return UnitTest::GetInstance()->AddEnvironment(env); -} - -// Initializes Google Test. This must be called before calling -// RUN_ALL_TESTS(). In particular, it parses a command line for the -// flags that Google Test recognizes. Whenever a Google Test flag is -// seen, it is removed from argv, and *argc is decremented. -// -// No value is returned. Instead, the Google Test flag variables are -// updated. -// -// Calling the function for the second time has no user-visible effect. -GTEST_API_ void InitGoogleTest(int* argc, char** argv); - -// This overloaded version can be used in Windows programs compiled in -// UNICODE mode. -GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv); - -namespace internal { - -// FormatForComparison::Format(value) formats a -// value of type ToPrint that is an operand of a comparison assertion -// (e.g. ASSERT_EQ). OtherOperand is the type of the other operand in -// the comparison, and is used to help determine the best way to -// format the value. In particular, when the value is a C string -// (char pointer) and the other operand is an STL string object, we -// want to format the C string as a string, since we know it is -// compared by value with the string object. If the value is a char -// pointer but the other operand is not an STL string object, we don't -// know whether the pointer is supposed to point to a NUL-terminated -// string, and thus want to print it as a pointer to be safe. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. - -// The default case. -template -class FormatForComparison { - public: - static ::std::string Format(const ToPrint& value) { - return ::testing::PrintToString(value); - } -}; - -// Array. -template -class FormatForComparison { - public: - static ::std::string Format(const ToPrint* value) { - return FormatForComparison::Format(value); - } -}; - -// By default, print C string as pointers to be safe, as we don't know -// whether they actually point to a NUL-terminated string. - -#define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType) \ - template \ - class FormatForComparison { \ - public: \ - static ::std::string Format(CharType* value) { \ - return ::testing::PrintToString(static_cast(value)); \ - } \ - } - -GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char); -GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char); -GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t); -GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t); - -#undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_ - -// If a C string is compared with an STL string object, we know it's meant -// to point to a NUL-terminated string, and thus can print it as a string. - -#define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \ - template <> \ - class FormatForComparison { \ - public: \ - static ::std::string Format(CharType* value) { \ - return ::testing::PrintToString(value); \ - } \ - } - -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string); -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string); - -#if GTEST_HAS_GLOBAL_STRING -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string); -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string); -#endif - -#if GTEST_HAS_GLOBAL_WSTRING -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring); -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring); -#endif - -#if GTEST_HAS_STD_WSTRING -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring); -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring); -#endif - -#undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_ - -// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc) -// operand to be used in a failure message. The type (but not value) -// of the other operand may affect the format. This allows us to -// print a char* as a raw pointer when it is compared against another -// char* or void*, and print it as a C string when it is compared -// against an std::string object, for example. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -template -std::string FormatForComparisonFailureMessage( - const T1& value, const T2& /* other_operand */) { - return FormatForComparison::Format(value); -} - -// The helper function for {ASSERT|EXPECT}_EQ. -template -AssertionResult CmpHelperEQ(const char* expected_expression, - const char* actual_expression, - const T1& expected, - const T2& actual) { -#ifdef _MSC_VER -# pragma warning(push) // Saves the current warning state. -# pragma warning(disable:4389) // Temporarily disables warning on - // signed/unsigned mismatch. -#endif - - if (expected == actual) { - return AssertionSuccess(); - } - -#ifdef _MSC_VER -# pragma warning(pop) // Restores the warning state. -#endif - - return EqFailure(expected_expression, - actual_expression, - FormatForComparisonFailureMessage(expected, actual), - FormatForComparisonFailureMessage(actual, expected), - false); -} - -// With this overloaded version, we allow anonymous enums to be used -// in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums -// can be implicitly cast to BiggestInt. -GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression, - const char* actual_expression, - BiggestInt expected, - BiggestInt actual); - -// The helper class for {ASSERT|EXPECT}_EQ. The template argument -// lhs_is_null_literal is true iff the first argument to ASSERT_EQ() -// is a null pointer literal. The following default implementation is -// for lhs_is_null_literal being false. -template -class EqHelper { - public: - // This templatized version is for the general case. - template - static AssertionResult Compare(const char* expected_expression, - const char* actual_expression, - const T1& expected, - const T2& actual) { - return CmpHelperEQ(expected_expression, actual_expression, expected, - actual); - } - - // With this overloaded version, we allow anonymous enums to be used - // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous - // enums can be implicitly cast to BiggestInt. - // - // Even though its body looks the same as the above version, we - // cannot merge the two, as it will make anonymous enums unhappy. - static AssertionResult Compare(const char* expected_expression, - const char* actual_expression, - BiggestInt expected, - BiggestInt actual) { - return CmpHelperEQ(expected_expression, actual_expression, expected, - actual); - } -}; - -// This specialization is used when the first argument to ASSERT_EQ() -// is a null pointer literal, like NULL, false, or 0. -template <> -class EqHelper { - public: - // We define two overloaded versions of Compare(). The first - // version will be picked when the second argument to ASSERT_EQ() is - // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or - // EXPECT_EQ(false, a_bool). - template - static AssertionResult Compare( - const char* expected_expression, - const char* actual_expression, - const T1& expected, - const T2& actual, - // The following line prevents this overload from being considered if T2 - // is not a pointer type. We need this because ASSERT_EQ(NULL, my_ptr) - // expands to Compare("", "", NULL, my_ptr), which requires a conversion - // to match the Secret* in the other overload, which would otherwise make - // this template match better. - typename EnableIf::value>::type* = 0) { - return CmpHelperEQ(expected_expression, actual_expression, expected, - actual); - } - - // This version will be picked when the second argument to ASSERT_EQ() is a - // pointer, e.g. ASSERT_EQ(NULL, a_pointer). - template - static AssertionResult Compare( - const char* expected_expression, - const char* actual_expression, - // We used to have a second template parameter instead of Secret*. That - // template parameter would deduce to 'long', making this a better match - // than the first overload even without the first overload's EnableIf. - // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to - // non-pointer argument" (even a deduced integral argument), so the old - // implementation caused warnings in user code. - Secret* /* expected (NULL) */, - T* actual) { - // We already know that 'expected' is a null pointer. - return CmpHelperEQ(expected_expression, actual_expression, - static_cast(NULL), actual); - } -}; - -// A macro for implementing the helper functions needed to implement -// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste -// of similar code. -// -// For each templatized helper function, we also define an overloaded -// version for BiggestInt in order to reduce code bloat and allow -// anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled -// with gcc 4. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ -template \ -AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ - const T1& val1, const T2& val2) {\ - if (val1 op val2) {\ - return AssertionSuccess();\ - } else {\ - return AssertionFailure() \ - << "Expected: (" << expr1 << ") " #op " (" << expr2\ - << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\ - << " vs " << FormatForComparisonFailureMessage(val2, val1);\ - }\ -}\ -GTEST_API_ AssertionResult CmpHelper##op_name(\ - const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2) - -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. - -// Implements the helper function for {ASSERT|EXPECT}_NE -GTEST_IMPL_CMP_HELPER_(NE, !=); -// Implements the helper function for {ASSERT|EXPECT}_LE -GTEST_IMPL_CMP_HELPER_(LE, <=); -// Implements the helper function for {ASSERT|EXPECT}_LT -GTEST_IMPL_CMP_HELPER_(LT, <); -// Implements the helper function for {ASSERT|EXPECT}_GE -GTEST_IMPL_CMP_HELPER_(GE, >=); -// Implements the helper function for {ASSERT|EXPECT}_GT -GTEST_IMPL_CMP_HELPER_(GT, >); - -#undef GTEST_IMPL_CMP_HELPER_ - -// The helper function for {ASSERT|EXPECT}_STREQ. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression, - const char* actual_expression, - const char* expected, - const char* actual); - -// The helper function for {ASSERT|EXPECT}_STRCASEEQ. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression, - const char* actual_expression, - const char* expected, - const char* actual); - -// The helper function for {ASSERT|EXPECT}_STRNE. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, - const char* s2_expression, - const char* s1, - const char* s2); - -// The helper function for {ASSERT|EXPECT}_STRCASENE. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression, - const char* s2_expression, - const char* s1, - const char* s2); - - -// Helper function for *_STREQ on wide strings. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression, - const char* actual_expression, - const wchar_t* expected, - const wchar_t* actual); - -// Helper function for *_STRNE on wide strings. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, - const char* s2_expression, - const wchar_t* s1, - const wchar_t* s2); - -} // namespace internal - -// IsSubstring() and IsNotSubstring() are intended to be used as the -// first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by -// themselves. They check whether needle is a substring of haystack -// (NULL is considered a substring of itself only), and return an -// appropriate error message when they fail. -// -// The {needle,haystack}_expr arguments are the stringified -// expressions that generated the two real arguments. -GTEST_API_ AssertionResult IsSubstring( - const char* needle_expr, const char* haystack_expr, - const char* needle, const char* haystack); -GTEST_API_ AssertionResult IsSubstring( - const char* needle_expr, const char* haystack_expr, - const wchar_t* needle, const wchar_t* haystack); -GTEST_API_ AssertionResult IsNotSubstring( - const char* needle_expr, const char* haystack_expr, - const char* needle, const char* haystack); -GTEST_API_ AssertionResult IsNotSubstring( - const char* needle_expr, const char* haystack_expr, - const wchar_t* needle, const wchar_t* haystack); -GTEST_API_ AssertionResult IsSubstring( - const char* needle_expr, const char* haystack_expr, - const ::std::string& needle, const ::std::string& haystack); -GTEST_API_ AssertionResult IsNotSubstring( - const char* needle_expr, const char* haystack_expr, - const ::std::string& needle, const ::std::string& haystack); - -#if GTEST_HAS_STD_WSTRING -GTEST_API_ AssertionResult IsSubstring( - const char* needle_expr, const char* haystack_expr, - const ::std::wstring& needle, const ::std::wstring& haystack); -GTEST_API_ AssertionResult IsNotSubstring( - const char* needle_expr, const char* haystack_expr, - const ::std::wstring& needle, const ::std::wstring& haystack); -#endif // GTEST_HAS_STD_WSTRING - -namespace internal { - -// Helper template function for comparing floating-points. -// -// Template parameter: -// -// RawType: the raw floating-point type (either float or double) -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -template -AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression, - const char* actual_expression, - RawType expected, - RawType actual) { - const FloatingPoint lhs(expected), rhs(actual); - - if (lhs.AlmostEquals(rhs)) { - return AssertionSuccess(); - } - - ::std::stringstream expected_ss; - expected_ss << std::setprecision(std::numeric_limits::digits10 + 2) - << expected; - - ::std::stringstream actual_ss; - actual_ss << std::setprecision(std::numeric_limits::digits10 + 2) - << actual; - - return EqFailure(expected_expression, - actual_expression, - StringStreamToString(&expected_ss), - StringStreamToString(&actual_ss), - false); -} - -// Helper function for implementing ASSERT_NEAR. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1, - const char* expr2, - const char* abs_error_expr, - double val1, - double val2, - double abs_error); - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// A class that enables one to stream messages to assertion macros -class GTEST_API_ AssertHelper { - public: - // Constructor. - AssertHelper(TestPartResult::Type type, - const char* file, - int line, - const char* message); - ~AssertHelper(); - - // Message assignment is a semantic trick to enable assertion - // streaming; see the GTEST_MESSAGE_ macro below. - void operator=(const Message& message) const; - - private: - // We put our data in a struct so that the size of the AssertHelper class can - // be as small as possible. This is important because gcc is incapable of - // re-using stack space even for temporary variables, so every EXPECT_EQ - // reserves stack space for another AssertHelper. - struct AssertHelperData { - AssertHelperData(TestPartResult::Type t, - const char* srcfile, - int line_num, - const char* msg) - : type(t), file(srcfile), line(line_num), message(msg) { } - - TestPartResult::Type const type; - const char* const file; - int const line; - std::string const message; - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData); - }; - - AssertHelperData* const data_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper); -}; - -} // namespace internal - -#if GTEST_HAS_PARAM_TEST -// The pure interface class that all value-parameterized tests inherit from. -// A value-parameterized class must inherit from both ::testing::Test and -// ::testing::WithParamInterface. In most cases that just means inheriting -// from ::testing::TestWithParam, but more complicated test hierarchies -// may need to inherit from Test and WithParamInterface at different levels. -// -// This interface has support for accessing the test parameter value via -// the GetParam() method. -// -// Use it with one of the parameter generator defining functions, like Range(), -// Values(), ValuesIn(), Bool(), and Combine(). -// -// class FooTest : public ::testing::TestWithParam { -// protected: -// FooTest() { -// // Can use GetParam() here. -// } -// virtual ~FooTest() { -// // Can use GetParam() here. -// } -// virtual void SetUp() { -// // Can use GetParam() here. -// } -// virtual void TearDown { -// // Can use GetParam() here. -// } -// }; -// TEST_P(FooTest, DoesBar) { -// // Can use GetParam() method here. -// Foo foo; -// ASSERT_TRUE(foo.DoesBar(GetParam())); -// } -// INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10)); - -template -class WithParamInterface { - public: - typedef T ParamType; - virtual ~WithParamInterface() {} - - // The current parameter value. Is also available in the test fixture's - // constructor. This member function is non-static, even though it only - // references static data, to reduce the opportunity for incorrect uses - // like writing 'WithParamInterface::GetParam()' for a test that - // uses a fixture whose parameter type is int. - const ParamType& GetParam() const { - GTEST_CHECK_(parameter_ != NULL) - << "GetParam() can only be called inside a value-parameterized test " - << "-- did you intend to write TEST_P instead of TEST_F?"; - return *parameter_; - } - - private: - // Sets parameter value. The caller is responsible for making sure the value - // remains alive and unchanged throughout the current test. - static void SetParam(const ParamType* parameter) { - parameter_ = parameter; - } - - // Static value used for accessing parameter during a test lifetime. - static const ParamType* parameter_; - - // TestClass must be a subclass of WithParamInterface and Test. - template friend class internal::ParameterizedTestFactory; -}; - -template -const T* WithParamInterface::parameter_ = NULL; - -// Most value-parameterized classes can ignore the existence of -// WithParamInterface, and can just inherit from ::testing::TestWithParam. - -template -class TestWithParam : public Test, public WithParamInterface { -}; - -#endif // GTEST_HAS_PARAM_TEST - -// Macros for indicating success/failure in test code. - -// ADD_FAILURE unconditionally adds a failure to the current test. -// SUCCEED generates a success - it doesn't automatically make the -// current test successful, as a test is only successful when it has -// no failure. -// -// EXPECT_* verifies that a certain condition is satisfied. If not, -// it behaves like ADD_FAILURE. In particular: -// -// EXPECT_TRUE verifies that a Boolean condition is true. -// EXPECT_FALSE verifies that a Boolean condition is false. -// -// FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except -// that they will also abort the current function on failure. People -// usually want the fail-fast behavior of FAIL and ASSERT_*, but those -// writing data-driven tests often find themselves using ADD_FAILURE -// and EXPECT_* more. - -// Generates a nonfatal failure with a generic message. -#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed") - -// Generates a nonfatal failure at the given source file location with -// a generic message. -#define ADD_FAILURE_AT(file, line) \ - GTEST_MESSAGE_AT_(file, line, "Failed", \ - ::testing::TestPartResult::kNonFatalFailure) - -// Generates a fatal failure with a generic message. -#define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed") - -// Define this macro to 1 to omit the definition of FAIL(), which is a -// generic name and clashes with some other libraries. -#if !GTEST_DONT_DEFINE_FAIL -# define FAIL() GTEST_FAIL() -#endif - -// Generates a success with a generic message. -#define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded") - -// Define this macro to 1 to omit the definition of SUCCEED(), which -// is a generic name and clashes with some other libraries. -#if !GTEST_DONT_DEFINE_SUCCEED -# define SUCCEED() GTEST_SUCCEED() -#endif - -// Macros for testing exceptions. -// -// * {ASSERT|EXPECT}_THROW(statement, expected_exception): -// Tests that the statement throws the expected exception. -// * {ASSERT|EXPECT}_NO_THROW(statement): -// Tests that the statement doesn't throw any exception. -// * {ASSERT|EXPECT}_ANY_THROW(statement): -// Tests that the statement throws an exception. - -#define EXPECT_THROW(statement, expected_exception) \ - GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_) -#define EXPECT_NO_THROW(statement) \ - GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_) -#define EXPECT_ANY_THROW(statement) \ - GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_) -#define ASSERT_THROW(statement, expected_exception) \ - GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_) -#define ASSERT_NO_THROW(statement) \ - GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_) -#define ASSERT_ANY_THROW(statement) \ - GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_) - -// Boolean assertions. Condition can be either a Boolean expression or an -// AssertionResult. For more information on how to use AssertionResult with -// these macros see comments on that class. -#define EXPECT_TRUE(condition) \ - GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ - GTEST_NONFATAL_FAILURE_) -#define EXPECT_FALSE(condition) \ - GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \ - GTEST_NONFATAL_FAILURE_) -#define ASSERT_TRUE(condition) \ - GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ - GTEST_FATAL_FAILURE_) -#define ASSERT_FALSE(condition) \ - GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \ - GTEST_FATAL_FAILURE_) - -// Includes the auto-generated header that implements a family of -// generic predicate assertion macros. -// Copyright 2006, Google 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "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 THE COPYRIGHT -// OWNER 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. - -// This file is AUTOMATICALLY GENERATED on 10/31/2011 by command -// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND! -// -// Implements a family of generic predicate assertion macros. - -#ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ -#define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ - -// Makes sure this header is not included before gtest.h. -#ifndef GTEST_INCLUDE_GTEST_GTEST_H_ -# error Do not include gtest_pred_impl.h directly. Include gtest.h instead. -#endif // GTEST_INCLUDE_GTEST_GTEST_H_ - -// This header implements a family of generic predicate assertion -// macros: -// -// ASSERT_PRED_FORMAT1(pred_format, v1) -// ASSERT_PRED_FORMAT2(pred_format, v1, v2) -// ... -// -// where pred_format is a function or functor that takes n (in the -// case of ASSERT_PRED_FORMATn) values and their source expression -// text, and returns a testing::AssertionResult. See the definition -// of ASSERT_EQ in gtest.h for an example. -// -// If you don't care about formatting, you can use the more -// restrictive version: -// -// ASSERT_PRED1(pred, v1) -// ASSERT_PRED2(pred, v1, v2) -// ... -// -// where pred is an n-ary function or functor that returns bool, -// and the values v1, v2, ..., must support the << operator for -// streaming to std::ostream. -// -// We also define the EXPECT_* variations. -// -// For now we only support predicates whose arity is at most 5. -// Please email googletestframework@googlegroups.com if you need -// support for higher arities. - -// GTEST_ASSERT_ is the basic statement to which all of the assertions -// in this file reduce. Don't use this in your code. - -#define GTEST_ASSERT_(expression, on_failure) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (const ::testing::AssertionResult gtest_ar = (expression)) \ - ; \ - else \ - on_failure(gtest_ar.failure_message()) - - -// Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use -// this in your code. -template -AssertionResult AssertPred1Helper(const char* pred_text, - const char* e1, - Pred pred, - const T1& v1) { - if (pred(v1)) return AssertionSuccess(); - - return AssertionFailure() << pred_text << "(" - << e1 << ") evaluates to false, where" - << "\n" << e1 << " evaluates to " << v1; -} - -// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1. -// Don't use this in your code. -#define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\ - GTEST_ASSERT_(pred_format(#v1, v1), \ - on_failure) - -// Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use -// this in your code. -#define GTEST_PRED1_(pred, v1, on_failure)\ - GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \ - #v1, \ - pred, \ - v1), on_failure) - -// Unary predicate assertion macros. -#define EXPECT_PRED_FORMAT1(pred_format, v1) \ - GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_) -#define EXPECT_PRED1(pred, v1) \ - GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_) -#define ASSERT_PRED_FORMAT1(pred_format, v1) \ - GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_) -#define ASSERT_PRED1(pred, v1) \ - GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_) - - - -// Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use -// this in your code. -template -AssertionResult AssertPred2Helper(const char* pred_text, - const char* e1, - const char* e2, - Pred pred, - const T1& v1, - const T2& v2) { - if (pred(v1, v2)) return AssertionSuccess(); - - return AssertionFailure() << pred_text << "(" - << e1 << ", " - << e2 << ") evaluates to false, where" - << "\n" << e1 << " evaluates to " << v1 - << "\n" << e2 << " evaluates to " << v2; -} - -// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2. -// Don't use this in your code. -#define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\ - GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \ - on_failure) - -// Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use -// this in your code. -#define GTEST_PRED2_(pred, v1, v2, on_failure)\ - GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \ - #v1, \ - #v2, \ - pred, \ - v1, \ - v2), on_failure) - -// Binary predicate assertion macros. -#define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \ - GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_) -#define EXPECT_PRED2(pred, v1, v2) \ - GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_) -#define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \ - GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_) -#define ASSERT_PRED2(pred, v1, v2) \ - GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_) - - - -// Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use -// this in your code. -template -AssertionResult AssertPred3Helper(const char* pred_text, - const char* e1, - const char* e2, - const char* e3, - Pred pred, - const T1& v1, - const T2& v2, - const T3& v3) { - if (pred(v1, v2, v3)) return AssertionSuccess(); - - return AssertionFailure() << pred_text << "(" - << e1 << ", " - << e2 << ", " - << e3 << ") evaluates to false, where" - << "\n" << e1 << " evaluates to " << v1 - << "\n" << e2 << " evaluates to " << v2 - << "\n" << e3 << " evaluates to " << v3; -} - -// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3. -// Don't use this in your code. -#define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\ - GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \ - on_failure) - -// Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use -// this in your code. -#define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\ - GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \ - #v1, \ - #v2, \ - #v3, \ - pred, \ - v1, \ - v2, \ - v3), on_failure) - -// Ternary predicate assertion macros. -#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \ - GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_) -#define EXPECT_PRED3(pred, v1, v2, v3) \ - GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_) -#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \ - GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_) -#define ASSERT_PRED3(pred, v1, v2, v3) \ - GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_) - - - -// Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use -// this in your code. -template -AssertionResult AssertPred4Helper(const char* pred_text, - const char* e1, - const char* e2, - const char* e3, - const char* e4, - Pred pred, - const T1& v1, - const T2& v2, - const T3& v3, - const T4& v4) { - if (pred(v1, v2, v3, v4)) return AssertionSuccess(); - - return AssertionFailure() << pred_text << "(" - << e1 << ", " - << e2 << ", " - << e3 << ", " - << e4 << ") evaluates to false, where" - << "\n" << e1 << " evaluates to " << v1 - << "\n" << e2 << " evaluates to " << v2 - << "\n" << e3 << " evaluates to " << v3 - << "\n" << e4 << " evaluates to " << v4; -} - -// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4. -// Don't use this in your code. -#define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\ - GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \ - on_failure) - -// Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use -// this in your code. -#define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\ - GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \ - #v1, \ - #v2, \ - #v3, \ - #v4, \ - pred, \ - v1, \ - v2, \ - v3, \ - v4), on_failure) - -// 4-ary predicate assertion macros. -#define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \ - GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_) -#define EXPECT_PRED4(pred, v1, v2, v3, v4) \ - GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_) -#define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \ - GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_) -#define ASSERT_PRED4(pred, v1, v2, v3, v4) \ - GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_) - - - -// Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use -// this in your code. -template -AssertionResult AssertPred5Helper(const char* pred_text, - const char* e1, - const char* e2, - const char* e3, - const char* e4, - const char* e5, - Pred pred, - const T1& v1, - const T2& v2, - const T3& v3, - const T4& v4, - const T5& v5) { - if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess(); - - return AssertionFailure() << pred_text << "(" - << e1 << ", " - << e2 << ", " - << e3 << ", " - << e4 << ", " - << e5 << ") evaluates to false, where" - << "\n" << e1 << " evaluates to " << v1 - << "\n" << e2 << " evaluates to " << v2 - << "\n" << e3 << " evaluates to " << v3 - << "\n" << e4 << " evaluates to " << v4 - << "\n" << e5 << " evaluates to " << v5; -} - -// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5. -// Don't use this in your code. -#define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\ - GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \ - on_failure) - -// Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use -// this in your code. -#define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\ - GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \ - #v1, \ - #v2, \ - #v3, \ - #v4, \ - #v5, \ - pred, \ - v1, \ - v2, \ - v3, \ - v4, \ - v5), on_failure) - -// 5-ary predicate assertion macros. -#define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \ - GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_) -#define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \ - GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_) -#define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \ - GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_) -#define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \ - GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_) - - - -#endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ - -// Macros for testing equalities and inequalities. -// -// * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual -// * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2 -// * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2 -// * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2 -// * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2 -// * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2 -// -// When they are not, Google Test prints both the tested expressions and -// their actual values. The values must be compatible built-in types, -// or you will get a compiler error. By "compatible" we mean that the -// values can be compared by the respective operator. -// -// Note: -// -// 1. It is possible to make a user-defined type work with -// {ASSERT|EXPECT}_??(), but that requires overloading the -// comparison operators and is thus discouraged by the Google C++ -// Usage Guide. Therefore, you are advised to use the -// {ASSERT|EXPECT}_TRUE() macro to assert that two objects are -// equal. -// -// 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on -// pointers (in particular, C strings). Therefore, if you use it -// with two C strings, you are testing how their locations in memory -// are related, not how their content is related. To compare two C -// strings by content, use {ASSERT|EXPECT}_STR*(). -// -// 3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to -// {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you -// what the actual value is when it fails, and similarly for the -// other comparisons. -// -// 4. Do not depend on the order in which {ASSERT|EXPECT}_??() -// evaluate their arguments, which is undefined. -// -// 5. These macros evaluate their arguments exactly once. -// -// Examples: -// -// EXPECT_NE(5, Foo()); -// EXPECT_EQ(NULL, a_pointer); -// ASSERT_LT(i, array_size); -// ASSERT_GT(records.size(), 0) << "There is no record left."; - -#define EXPECT_EQ(expected, actual) \ - EXPECT_PRED_FORMAT2(::testing::internal:: \ - EqHelper::Compare, \ - expected, actual) -#define EXPECT_NE(expected, actual) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual) -#define EXPECT_LE(val1, val2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2) -#define EXPECT_LT(val1, val2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2) -#define EXPECT_GE(val1, val2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2) -#define EXPECT_GT(val1, val2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2) - -#define GTEST_ASSERT_EQ(expected, actual) \ - ASSERT_PRED_FORMAT2(::testing::internal:: \ - EqHelper::Compare, \ - expected, actual) -#define GTEST_ASSERT_NE(val1, val2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2) -#define GTEST_ASSERT_LE(val1, val2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2) -#define GTEST_ASSERT_LT(val1, val2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2) -#define GTEST_ASSERT_GE(val1, val2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2) -#define GTEST_ASSERT_GT(val1, val2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2) - -// Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of -// ASSERT_XY(), which clashes with some users' own code. - -#if !GTEST_DONT_DEFINE_ASSERT_EQ -# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2) -#endif - -#if !GTEST_DONT_DEFINE_ASSERT_NE -# define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2) -#endif - -#if !GTEST_DONT_DEFINE_ASSERT_LE -# define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2) -#endif - -#if !GTEST_DONT_DEFINE_ASSERT_LT -# define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2) -#endif - -#if !GTEST_DONT_DEFINE_ASSERT_GE -# define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2) -#endif - -#if !GTEST_DONT_DEFINE_ASSERT_GT -# define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2) -#endif - -// C-string Comparisons. All tests treat NULL and any non-NULL string -// as different. Two NULLs are equal. -// -// * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2 -// * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2 -// * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case -// * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case -// -// For wide or narrow string objects, you can use the -// {ASSERT|EXPECT}_??() macros. -// -// Don't depend on the order in which the arguments are evaluated, -// which is undefined. -// -// These macros evaluate their arguments exactly once. - -#define EXPECT_STREQ(expected, actual) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual) -#define EXPECT_STRNE(s1, s2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2) -#define EXPECT_STRCASEEQ(expected, actual) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual) -#define EXPECT_STRCASENE(s1, s2)\ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2) - -#define ASSERT_STREQ(expected, actual) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual) -#define ASSERT_STRNE(s1, s2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2) -#define ASSERT_STRCASEEQ(expected, actual) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual) -#define ASSERT_STRCASENE(s1, s2)\ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2) - -// Macros for comparing floating-point numbers. -// -// * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual): -// Tests that two float values are almost equal. -// * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual): -// Tests that two double values are almost equal. -// * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error): -// Tests that v1 and v2 are within the given distance to each other. -// -// Google Test uses ULP-based comparison to automatically pick a default -// error bound that is appropriate for the operands. See the -// FloatingPoint template class in gtest-internal.h if you are -// interested in the implementation details. - -#define EXPECT_FLOAT_EQ(expected, actual)\ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ - expected, actual) - -#define EXPECT_DOUBLE_EQ(expected, actual)\ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ - expected, actual) - -#define ASSERT_FLOAT_EQ(expected, actual)\ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ - expected, actual) - -#define ASSERT_DOUBLE_EQ(expected, actual)\ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ - expected, actual) - -#define EXPECT_NEAR(val1, val2, abs_error)\ - EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \ - val1, val2, abs_error) - -#define ASSERT_NEAR(val1, val2, abs_error)\ - ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \ - val1, val2, abs_error) - -// These predicate format functions work on floating-point values, and -// can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g. -// -// EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0); - -// Asserts that val1 is less than, or almost equal to, val2. Fails -// otherwise. In particular, it fails if either val1 or val2 is NaN. -GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2, - float val1, float val2); -GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2, - double val1, double val2); - - -#if GTEST_OS_WINDOWS - -// Macros that test for HRESULT failure and success, these are only useful -// on Windows, and rely on Windows SDK macros and APIs to compile. -// -// * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) -// -// When expr unexpectedly fails or succeeds, Google Test prints the -// expected result and the actual result with both a human-readable -// string representation of the error, if available, as well as the -// hex result code. -# define EXPECT_HRESULT_SUCCEEDED(expr) \ - EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) - -# define ASSERT_HRESULT_SUCCEEDED(expr) \ - ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) - -# define EXPECT_HRESULT_FAILED(expr) \ - EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) - -# define ASSERT_HRESULT_FAILED(expr) \ - ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) - -#endif // GTEST_OS_WINDOWS - -// Macros that execute statement and check that it doesn't generate new fatal -// failures in the current thread. -// -// * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); -// -// Examples: -// -// EXPECT_NO_FATAL_FAILURE(Process()); -// ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed"; -// -#define ASSERT_NO_FATAL_FAILURE(statement) \ - GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_) -#define EXPECT_NO_FATAL_FAILURE(statement) \ - GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_) - -// Causes a trace (including the source file path, the current line -// number, and the given message) to be included in every test failure -// message generated by code in the current scope. The effect is -// undone when the control leaves the current scope. -// -// The message argument can be anything streamable to std::ostream. -// -// In the implementation, we include the current line number as part -// of the dummy variable name, thus allowing multiple SCOPED_TRACE()s -// to appear in the same block - as long as they are on different -// lines. -#define SCOPED_TRACE(message) \ - ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\ - __FILE__, __LINE__, ::testing::Message() << (message)) - -// Compile-time assertion for type equality. -// StaticAssertTypeEq() compiles iff type1 and type2 are -// the same type. The value it returns is not interesting. -// -// Instead of making StaticAssertTypeEq a class template, we make it a -// function template that invokes a helper class template. This -// prevents a user from misusing StaticAssertTypeEq by -// defining objects of that type. -// -// CAVEAT: -// -// When used inside a method of a class template, -// StaticAssertTypeEq() is effective ONLY IF the method is -// instantiated. For example, given: -// -// template class Foo { -// public: -// void Bar() { testing::StaticAssertTypeEq(); } -// }; -// -// the code: -// -// void Test1() { Foo foo; } -// -// will NOT generate a compiler error, as Foo::Bar() is never -// actually instantiated. Instead, you need: -// -// void Test2() { Foo foo; foo.Bar(); } -// -// to cause a compiler error. -template -bool StaticAssertTypeEq() { - (void)internal::StaticAssertTypeEqHelper(); - return true; -} - -// Defines a test. -// -// The first parameter is the name of the test case, and the second -// parameter is the name of the test within the test case. -// -// The convention is to end the test case name with "Test". For -// example, a test case for the Foo class can be named FooTest. -// -// The user should put his test code between braces after using this -// macro. Example: -// -// TEST(FooTest, InitializesCorrectly) { -// Foo foo; -// EXPECT_TRUE(foo.StatusIsOK()); -// } - -// Note that we call GetTestTypeId() instead of GetTypeId< -// ::testing::Test>() here to get the type ID of testing::Test. This -// is to work around a suspected linker bug when using Google Test as -// a framework on Mac OS X. The bug causes GetTypeId< -// ::testing::Test>() to return different values depending on whether -// the call is from the Google Test framework itself or from user test -// code. GetTestTypeId() is guaranteed to always return the same -// value, as it always calls GetTypeId<>() from the Google Test -// framework. -#define GTEST_TEST(test_case_name, test_name)\ - GTEST_TEST_(test_case_name, test_name, \ - ::testing::Test, ::testing::internal::GetTestTypeId()) - -// Define this macro to 1 to omit the definition of TEST(), which -// is a generic name and clashes with some other libraries. -#if !GTEST_DONT_DEFINE_TEST -# define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name) -#endif - -// Defines a test that uses a test fixture. -// -// The first parameter is the name of the test fixture class, which -// also doubles as the test case name. The second parameter is the -// name of the test within the test case. -// -// A test fixture class must be declared earlier. The user should put -// his test code between braces after using this macro. Example: -// -// class FooTest : public testing::Test { -// protected: -// virtual void SetUp() { b_.AddElement(3); } -// -// Foo a_; -// Foo b_; -// }; -// -// TEST_F(FooTest, InitializesCorrectly) { -// EXPECT_TRUE(a_.StatusIsOK()); -// } -// -// TEST_F(FooTest, ReturnsElementCountCorrectly) { -// EXPECT_EQ(0, a_.size()); -// EXPECT_EQ(1, b_.size()); -// } - -#define TEST_F(test_fixture, test_name)\ - GTEST_TEST_(test_fixture, test_name, test_fixture, \ - ::testing::internal::GetTypeId()) - -} // namespace testing - -// Use this function in main() to run all tests. It returns 0 if all -// tests are successful, or 1 otherwise. -// -// RUN_ALL_TESTS() should be invoked after the command line has been -// parsed by InitGoogleTest(). -// -// This function was formerly a macro; thus, it is in the global -// namespace and has an all-caps name. -int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_; - -inline int RUN_ALL_TESTS() { - return ::testing::UnitTest::GetInstance()->Run(); -} - -#endif // GTEST_INCLUDE_GTEST_GTEST_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libwebm/Android.mk gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libwebm/Android.mk --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libwebm/Android.mk 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libwebm/Android.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_CPP_EXTENSION := .cpp -LOCAL_SRC_FILES := mkvmuxer.cpp \ - mkvmuxerutil.cpp \ - mkvparser.cpp \ - mkvreader.cpp \ - mkvwriter.cpp -LOCAL_MODULE := libwebm -include $(BUILD_STATIC_LIBRARY) diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/basic_types.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/basic_types.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/basic_types.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/basic_types.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,118 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_BASIC_TYPES_H_ // NOLINT -#define INCLUDE_LIBYUV_BASIC_TYPES_H_ - -#include // for NULL, size_t - -#if defined(__ANDROID__) || (defined(_MSC_VER) && (_MSC_VER < 1600)) -#include // for uintptr_t on x86 -#else -#include // for uintptr_t -#endif - -#ifndef GG_LONGLONG -#ifndef INT_TYPES_DEFINED -#define INT_TYPES_DEFINED -#ifdef COMPILER_MSVC -typedef unsigned __int64 uint64; -typedef __int64 int64; -#ifndef INT64_C -#define INT64_C(x) x ## I64 -#endif -#ifndef UINT64_C -#define UINT64_C(x) x ## UI64 -#endif -#define INT64_F "I64" -#else // COMPILER_MSVC -#if defined(__LP64__) && !defined(__OpenBSD__) && !defined(__APPLE__) -typedef unsigned long uint64; // NOLINT -typedef long int64; // NOLINT -#ifndef INT64_C -#define INT64_C(x) x ## L -#endif -#ifndef UINT64_C -#define UINT64_C(x) x ## UL -#endif -#define INT64_F "l" -#else // defined(__LP64__) && !defined(__OpenBSD__) && !defined(__APPLE__) -typedef unsigned long long uint64; // NOLINT -typedef long long int64; // NOLINT -#ifndef INT64_C -#define INT64_C(x) x ## LL -#endif -#ifndef UINT64_C -#define UINT64_C(x) x ## ULL -#endif -#define INT64_F "ll" -#endif // __LP64__ -#endif // COMPILER_MSVC -typedef unsigned int uint32; -typedef int int32; -typedef unsigned short uint16; // NOLINT -typedef short int16; // NOLINT -typedef unsigned char uint8; -typedef signed char int8; -#endif // INT_TYPES_DEFINED -#endif // GG_LONGLONG - -// Detect compiler is for x86 or x64. -#if defined(__x86_64__) || defined(_M_X64) || \ - defined(__i386__) || defined(_M_IX86) -#define CPU_X86 1 -#endif -// Detect compiler is for ARM. -#if defined(__arm__) || defined(_M_ARM) -#define CPU_ARM 1 -#endif - -#ifndef ALIGNP -#ifdef __cplusplus -#define ALIGNP(p, t) \ - (reinterpret_cast(((reinterpret_cast(p) + \ - ((t) - 1)) & ~((t) - 1)))) -#else -#define ALIGNP(p, t) \ - ((uint8*)((((uintptr_t)(p) + ((t) - 1)) & ~((t) - 1)))) /* NOLINT */ -#endif -#endif - -#if !defined(LIBYUV_API) -#if defined(_WIN32) || defined(__CYGWIN__) -#if defined(LIBYUV_BUILDING_SHARED_LIBRARY) -#define LIBYUV_API __declspec(dllexport) -#elif defined(LIBYUV_USING_SHARED_LIBRARY) -#define LIBYUV_API __declspec(dllimport) -#else -#define LIBYUV_API -#endif // LIBYUV_BUILDING_SHARED_LIBRARY -#elif defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__APPLE__) && \ - (defined(LIBYUV_BUILDING_SHARED_LIBRARY) || \ - defined(LIBYUV_USING_SHARED_LIBRARY)) -#define LIBYUV_API __attribute__ ((visibility ("default"))) -#else -#define LIBYUV_API -#endif // __GNUC__ -#endif // LIBYUV_API - -#define LIBYUV_BOOL int -#define LIBYUV_FALSE 0 -#define LIBYUV_TRUE 1 - -// Visual C x86 or GCC little endian. -#if defined(__x86_64__) || defined(_M_X64) || \ - defined(__i386__) || defined(_M_IX86) || \ - defined(__arm__) || defined(_M_ARM) || \ - (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) -#define LIBYUV_LITTLE_ENDIAN -#endif - -#endif // INCLUDE_LIBYUV_BASIC_TYPES_H_ NOLINT diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/compare.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/compare.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/compare.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/compare.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_COMPARE_H_ // NOLINT -#define INCLUDE_LIBYUV_COMPARE_H_ - -#include "libyuv/basic_types.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -// Compute a hash for specified memory. Seed of 5381 recommended. -LIBYUV_API -uint32 HashDjb2(const uint8* src, uint64 count, uint32 seed); - -// Scan an opaque argb image and return fourcc based on alpha offset. -// Returns FOURCC_ARGB, FOURCC_BGRA, or 0 if unknown. -LIBYUV_API -uint32 ARGBDetect(const uint8* argb, int stride_argb, int width, int height); - -// Sum Square Error - used to compute Mean Square Error or PSNR. -LIBYUV_API -uint64 ComputeSumSquareError(const uint8* src_a, - const uint8* src_b, int count); - -LIBYUV_API -uint64 ComputeSumSquareErrorPlane(const uint8* src_a, int stride_a, - const uint8* src_b, int stride_b, - int width, int height); - -static const int kMaxPsnr = 128; - -LIBYUV_API -double SumSquareErrorToPsnr(uint64 sse, uint64 count); - -LIBYUV_API -double CalcFramePsnr(const uint8* src_a, int stride_a, - const uint8* src_b, int stride_b, - int width, int height); - -LIBYUV_API -double I420Psnr(const uint8* src_y_a, int stride_y_a, - const uint8* src_u_a, int stride_u_a, - const uint8* src_v_a, int stride_v_a, - const uint8* src_y_b, int stride_y_b, - const uint8* src_u_b, int stride_u_b, - const uint8* src_v_b, int stride_v_b, - int width, int height); - -LIBYUV_API -double CalcFrameSsim(const uint8* src_a, int stride_a, - const uint8* src_b, int stride_b, - int width, int height); - -LIBYUV_API -double I420Ssim(const uint8* src_y_a, int stride_y_a, - const uint8* src_u_a, int stride_u_a, - const uint8* src_v_a, int stride_v_a, - const uint8* src_y_b, int stride_y_b, - const uint8* src_u_b, int stride_u_b, - const uint8* src_v_b, int stride_v_b, - int width, int height); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_COMPARE_H_ NOLINT diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/convert_argb.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/convert_argb.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/convert_argb.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/convert_argb.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,231 +0,0 @@ -/* - * Copyright 2012 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_CONVERT_ARGB_H_ // NOLINT -#define INCLUDE_LIBYUV_CONVERT_ARGB_H_ - -#include "libyuv/basic_types.h" -// TODO(fbarchard): Remove the following headers includes -#include "libyuv/convert_from.h" -#include "libyuv/planar_functions.h" -#include "libyuv/rotate.h" - -// TODO(fbarchard): This set of functions should exactly match convert.h -// TODO(fbarchard): Add tests. Create random content of right size and convert -// with C vs Opt and or to I420 and compare. -// TODO(fbarchard): Some of these functions lack parameter setting. - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -// Alias. -#define ARGBToARGB ARGBCopy - -// Copy ARGB to ARGB. -LIBYUV_API -int ARGBCopy(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert I420 to ARGB. -LIBYUV_API -int I420ToARGB(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert I422 to ARGB. -LIBYUV_API -int I422ToARGB(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert I444 to ARGB. -LIBYUV_API -int I444ToARGB(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert I411 to ARGB. -LIBYUV_API -int I411ToARGB(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert I400 (grey) to ARGB. -LIBYUV_API -int I400ToARGB(const uint8* src_y, int src_stride_y, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Alias. -#define YToARGB I400ToARGB_Reference - -// Convert I400 to ARGB. Reverse of ARGBToI400. -LIBYUV_API -int I400ToARGB_Reference(const uint8* src_y, int src_stride_y, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert NV12 to ARGB. -LIBYUV_API -int NV12ToARGB(const uint8* src_y, int src_stride_y, - const uint8* src_uv, int src_stride_uv, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert NV21 to ARGB. -LIBYUV_API -int NV21ToARGB(const uint8* src_y, int src_stride_y, - const uint8* src_vu, int src_stride_vu, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert M420 to ARGB. -LIBYUV_API -int M420ToARGB(const uint8* src_m420, int src_stride_m420, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert YUY2 to ARGB. -LIBYUV_API -int YUY2ToARGB(const uint8* src_yuy2, int src_stride_yuy2, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert UYVY to ARGB. -LIBYUV_API -int UYVYToARGB(const uint8* src_uyvy, int src_stride_uyvy, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert J420 to ARGB. -LIBYUV_API -int J420ToARGB(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert J422 to ARGB. -LIBYUV_API -int J422ToARGB(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// BGRA little endian (argb in memory) to ARGB. -LIBYUV_API -int BGRAToARGB(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// ABGR little endian (rgba in memory) to ARGB. -LIBYUV_API -int ABGRToARGB(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// RGBA little endian (abgr in memory) to ARGB. -LIBYUV_API -int RGBAToARGB(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Deprecated function name. -#define BG24ToARGB RGB24ToARGB - -// RGB little endian (bgr in memory) to ARGB. -LIBYUV_API -int RGB24ToARGB(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// RGB big endian (rgb in memory) to ARGB. -LIBYUV_API -int RAWToARGB(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// RGB16 (RGBP fourcc) little endian to ARGB. -LIBYUV_API -int RGB565ToARGB(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// RGB15 (RGBO fourcc) little endian to ARGB. -LIBYUV_API -int ARGB1555ToARGB(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// RGB12 (R444 fourcc) little endian to ARGB. -LIBYUV_API -int ARGB4444ToARGB(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -#ifdef HAVE_JPEG -// src_width/height provided by capture -// dst_width/height for clipping determine final size. -LIBYUV_API -int MJPGToARGB(const uint8* sample, size_t sample_size, - uint8* dst_argb, int dst_stride_argb, - int src_width, int src_height, - int dst_width, int dst_height); -#endif - -// Convert camera sample to ARGB with cropping, rotation and vertical flip. -// "src_size" is needed to parse MJPG. -// "dst_stride_argb" number of bytes in a row of the dst_argb plane. -// Normally this would be the same as dst_width, with recommended alignment -// to 16 bytes for better efficiency. -// If rotation of 90 or 270 is used, stride is affected. The caller should -// allocate the I420 buffer according to rotation. -// "dst_stride_u" number of bytes in a row of the dst_u plane. -// Normally this would be the same as (dst_width + 1) / 2, with -// recommended alignment to 16 bytes for better efficiency. -// If rotation of 90 or 270 is used, stride is affected. -// "crop_x" and "crop_y" are starting position for cropping. -// To center, crop_x = (src_width - dst_width) / 2 -// crop_y = (src_height - dst_height) / 2 -// "src_width" / "src_height" is size of src_frame in pixels. -// "src_height" can be negative indicating a vertically flipped image source. -// "crop_width" / "crop_height" is the size to crop the src to. -// Must be less than or equal to src_width/src_height -// Cropping parameters are pre-rotation. -// "rotation" can be 0, 90, 180 or 270. -// "format" is a fourcc. ie 'I420', 'YUY2' -// Returns 0 for successful; -1 for invalid parameter. Non-zero for failure. -LIBYUV_API -int ConvertToARGB(const uint8* src_frame, size_t src_size, - uint8* dst_argb, int dst_stride_argb, - int crop_x, int crop_y, - int src_width, int src_height, - int crop_width, int crop_height, - enum RotationMode rotation, - uint32 format); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_CONVERT_ARGB_H_ NOLINT diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/convert_from_argb.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/convert_from_argb.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/convert_from_argb.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/convert_from_argb.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,181 +0,0 @@ -/* - * Copyright 2012 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_ // NOLINT -#define INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_ - -#include "libyuv/basic_types.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -// Copy ARGB to ARGB. -#define ARGBToARGB ARGBCopy -LIBYUV_API -int ARGBCopy(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert ARGB To BGRA. -LIBYUV_API -int ARGBToBGRA(const uint8* src_argb, int src_stride_argb, - uint8* dst_bgra, int dst_stride_bgra, - int width, int height); - -// Convert ARGB To ABGR. -LIBYUV_API -int ARGBToABGR(const uint8* src_argb, int src_stride_argb, - uint8* dst_abgr, int dst_stride_abgr, - int width, int height); - -// Convert ARGB To RGBA. -LIBYUV_API -int ARGBToRGBA(const uint8* src_argb, int src_stride_argb, - uint8* dst_rgba, int dst_stride_rgba, - int width, int height); - -// Convert ARGB To RGB24. -LIBYUV_API -int ARGBToRGB24(const uint8* src_argb, int src_stride_argb, - uint8* dst_rgb24, int dst_stride_rgb24, - int width, int height); - -// Convert ARGB To RAW. -LIBYUV_API -int ARGBToRAW(const uint8* src_argb, int src_stride_argb, - uint8* dst_rgb, int dst_stride_rgb, - int width, int height); - -// Convert ARGB To RGB565. -LIBYUV_API -int ARGBToRGB565(const uint8* src_argb, int src_stride_argb, - uint8* dst_rgb565, int dst_stride_rgb565, - int width, int height); - -// Convert ARGB To RGB565 with 8x8 dither matrix (64 bytes). -// Values in dither matrix from 0 to 255. 128 is best for no dither. -LIBYUV_API -int ARGBToRGB565Dither(const uint8* src_argb, int src_stride_argb, - uint8* dst_rgb565, int dst_stride_rgb565, - const uint8* dither8x8, int width, int height); - -// Convert ARGB To ARGB1555. -LIBYUV_API -int ARGBToARGB1555(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb1555, int dst_stride_argb1555, - int width, int height); - -// Convert ARGB To ARGB4444. -LIBYUV_API -int ARGBToARGB4444(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb4444, int dst_stride_argb4444, - int width, int height); - -// Convert ARGB To I444. -LIBYUV_API -int ARGBToI444(const uint8* src_argb, int src_stride_argb, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert ARGB To I422. -LIBYUV_API -int ARGBToI422(const uint8* src_argb, int src_stride_argb, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert ARGB To I420. (also in convert.h) -LIBYUV_API -int ARGBToI420(const uint8* src_argb, int src_stride_argb, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert ARGB to J420. (JPeg full range I420). -LIBYUV_API -int ARGBToJ420(const uint8* src_argb, int src_stride_argb, - uint8* dst_yj, int dst_stride_yj, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert ARGB to J422. -LIBYUV_API -int ARGBToJ422(const uint8* src_argb, int src_stride_argb, - uint8* dst_yj, int dst_stride_yj, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert ARGB To I411. -LIBYUV_API -int ARGBToI411(const uint8* src_argb, int src_stride_argb, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert ARGB to J400. (JPeg full range). -LIBYUV_API -int ARGBToJ400(const uint8* src_argb, int src_stride_argb, - uint8* dst_yj, int dst_stride_yj, - int width, int height); - -// Convert ARGB to I400. -LIBYUV_API -int ARGBToI400(const uint8* src_argb, int src_stride_argb, - uint8* dst_y, int dst_stride_y, - int width, int height); - -// Convert ARGB To NV12. -LIBYUV_API -int ARGBToNV12(const uint8* src_argb, int src_stride_argb, - uint8* dst_y, int dst_stride_y, - uint8* dst_uv, int dst_stride_uv, - int width, int height); - -// Convert ARGB To NV21. -LIBYUV_API -int ARGBToNV21(const uint8* src_argb, int src_stride_argb, - uint8* dst_y, int dst_stride_y, - uint8* dst_vu, int dst_stride_vu, - int width, int height); - -// Convert ARGB To NV21. -LIBYUV_API -int ARGBToNV21(const uint8* src_argb, int src_stride_argb, - uint8* dst_y, int dst_stride_y, - uint8* dst_vu, int dst_stride_vu, - int width, int height); - -// Convert ARGB To YUY2. -LIBYUV_API -int ARGBToYUY2(const uint8* src_argb, int src_stride_argb, - uint8* dst_yuy2, int dst_stride_yuy2, - int width, int height); - -// Convert ARGB To UYVY. -LIBYUV_API -int ARGBToUYVY(const uint8* src_argb, int src_stride_argb, - uint8* dst_uyvy, int dst_stride_uyvy, - int width, int height); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_ NOLINT diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/convert_from.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/convert_from.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/convert_from.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/convert_from.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,170 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_CONVERT_FROM_H_ // NOLINT -#define INCLUDE_LIBYUV_CONVERT_FROM_H_ - -#include "libyuv/basic_types.h" -#include "libyuv/rotate.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -// See Also convert.h for conversions from formats to I420. - -// I420Copy in convert to I420ToI420. - -LIBYUV_API -int I420ToI422(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -LIBYUV_API -int I420ToI444(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -LIBYUV_API -int I420ToI411(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Copy to I400. Source can be I420, I422, I444, I400, NV12 or NV21. -LIBYUV_API -int I400Copy(const uint8* src_y, int src_stride_y, - uint8* dst_y, int dst_stride_y, - int width, int height); - -// TODO(fbarchard): I420ToM420 - -LIBYUV_API -int I420ToNV12(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_uv, int dst_stride_uv, - int width, int height); - -LIBYUV_API -int I420ToNV21(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_vu, int dst_stride_vu, - int width, int height); - -LIBYUV_API -int I420ToYUY2(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -LIBYUV_API -int I420ToUYVY(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -LIBYUV_API -int I420ToARGB(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -LIBYUV_API -int I420ToBGRA(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -LIBYUV_API -int I420ToABGR(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -LIBYUV_API -int I420ToRGBA(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_rgba, int dst_stride_rgba, - int width, int height); - -LIBYUV_API -int I420ToRGB24(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -LIBYUV_API -int I420ToRAW(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -LIBYUV_API -int I420ToRGB565(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -LIBYUV_API -int I420ToARGB1555(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -LIBYUV_API -int I420ToARGB4444(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -// Convert I420 to specified format. -// "dst_sample_stride" is bytes in a row for the destination. Pass 0 if the -// buffer has contiguous rows. Can be negative. A multiple of 16 is optimal. -LIBYUV_API -int ConvertFromI420(const uint8* y, int y_stride, - const uint8* u, int u_stride, - const uint8* v, int v_stride, - uint8* dst_sample, int dst_sample_stride, - int width, int height, - uint32 format); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_CONVERT_FROM_H_ NOLINT diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/convert.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/convert.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/convert.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/convert.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,243 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_CONVERT_H_ // NOLINT -#define INCLUDE_LIBYUV_CONVERT_H_ - -#include "libyuv/basic_types.h" -// TODO(fbarchard): Remove the following headers includes. -#include "libyuv/convert_from.h" -#include "libyuv/planar_functions.h" -#include "libyuv/rotate.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -// Convert I444 to I420. -LIBYUV_API -int I444ToI420(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert I422 to I420. -LIBYUV_API -int I422ToI420(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert I411 to I420. -LIBYUV_API -int I411ToI420(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Copy I420 to I420. -#define I420ToI420 I420Copy -LIBYUV_API -int I420Copy(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert I400 (grey) to I420. -LIBYUV_API -int I400ToI420(const uint8* src_y, int src_stride_y, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert NV12 to I420. -LIBYUV_API -int NV12ToI420(const uint8* src_y, int src_stride_y, - const uint8* src_uv, int src_stride_uv, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert NV21 to I420. -LIBYUV_API -int NV21ToI420(const uint8* src_y, int src_stride_y, - const uint8* src_vu, int src_stride_vu, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert YUY2 to I420. -LIBYUV_API -int YUY2ToI420(const uint8* src_yuy2, int src_stride_yuy2, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert UYVY to I420. -LIBYUV_API -int UYVYToI420(const uint8* src_uyvy, int src_stride_uyvy, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert M420 to I420. -LIBYUV_API -int M420ToI420(const uint8* src_m420, int src_stride_m420, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// ARGB little endian (bgra in memory) to I420. -LIBYUV_API -int ARGBToI420(const uint8* src_frame, int src_stride_frame, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// BGRA little endian (argb in memory) to I420. -LIBYUV_API -int BGRAToI420(const uint8* src_frame, int src_stride_frame, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// ABGR little endian (rgba in memory) to I420. -LIBYUV_API -int ABGRToI420(const uint8* src_frame, int src_stride_frame, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// RGBA little endian (abgr in memory) to I420. -LIBYUV_API -int RGBAToI420(const uint8* src_frame, int src_stride_frame, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// RGB little endian (bgr in memory) to I420. -LIBYUV_API -int RGB24ToI420(const uint8* src_frame, int src_stride_frame, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// RGB big endian (rgb in memory) to I420. -LIBYUV_API -int RAWToI420(const uint8* src_frame, int src_stride_frame, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// RGB16 (RGBP fourcc) little endian to I420. -LIBYUV_API -int RGB565ToI420(const uint8* src_frame, int src_stride_frame, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// RGB15 (RGBO fourcc) little endian to I420. -LIBYUV_API -int ARGB1555ToI420(const uint8* src_frame, int src_stride_frame, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// RGB12 (R444 fourcc) little endian to I420. -LIBYUV_API -int ARGB4444ToI420(const uint8* src_frame, int src_stride_frame, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -#ifdef HAVE_JPEG -// src_width/height provided by capture. -// dst_width/height for clipping determine final size. -LIBYUV_API -int MJPGToI420(const uint8* sample, size_t sample_size, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int src_width, int src_height, - int dst_width, int dst_height); - -// Query size of MJPG in pixels. -LIBYUV_API -int MJPGSize(const uint8* sample, size_t sample_size, - int* width, int* height); -#endif - -// Convert camera sample to I420 with cropping, rotation and vertical flip. -// "src_size" is needed to parse MJPG. -// "dst_stride_y" number of bytes in a row of the dst_y plane. -// Normally this would be the same as dst_width, with recommended alignment -// to 16 bytes for better efficiency. -// If rotation of 90 or 270 is used, stride is affected. The caller should -// allocate the I420 buffer according to rotation. -// "dst_stride_u" number of bytes in a row of the dst_u plane. -// Normally this would be the same as (dst_width + 1) / 2, with -// recommended alignment to 16 bytes for better efficiency. -// If rotation of 90 or 270 is used, stride is affected. -// "crop_x" and "crop_y" are starting position for cropping. -// To center, crop_x = (src_width - dst_width) / 2 -// crop_y = (src_height - dst_height) / 2 -// "src_width" / "src_height" is size of src_frame in pixels. -// "src_height" can be negative indicating a vertically flipped image source. -// "crop_width" / "crop_height" is the size to crop the src to. -// Must be less than or equal to src_width/src_height -// Cropping parameters are pre-rotation. -// "rotation" can be 0, 90, 180 or 270. -// "format" is a fourcc. ie 'I420', 'YUY2' -// Returns 0 for successful; -1 for invalid parameter. Non-zero for failure. -LIBYUV_API -int ConvertToI420(const uint8* src_frame, size_t src_size, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int crop_x, int crop_y, - int src_width, int src_height, - int crop_width, int crop_height, - enum RotationMode rotation, - uint32 format); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_CONVERT_H_ NOLINT diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/cpu_id.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/cpu_id.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/cpu_id.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/cpu_id.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_CPU_ID_H_ // NOLINT -#define INCLUDE_LIBYUV_CPU_ID_H_ - -#include "libyuv/basic_types.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -// TODO(fbarchard): Consider overlapping bits for different architectures. -// Internal flag to indicate cpuid requires initialization. -#define kCpuInit 0x1 - -// These flags are only valid on ARM processors. -static const int kCpuHasARM = 0x2; -static const int kCpuHasNEON = 0x4; -// 0x8 reserved for future ARM flag. - -// These flags are only valid on x86 processors. -static const int kCpuHasX86 = 0x10; -static const int kCpuHasSSE2 = 0x20; -static const int kCpuHasSSSE3 = 0x40; -static const int kCpuHasSSE41 = 0x80; -static const int kCpuHasSSE42 = 0x100; -static const int kCpuHasAVX = 0x200; -static const int kCpuHasAVX2 = 0x400; -static const int kCpuHasERMS = 0x800; -static const int kCpuHasFMA3 = 0x1000; -// 0x2000, 0x4000, 0x8000 reserved for future X86 flags. - -// These flags are only valid on MIPS processors. -static const int kCpuHasMIPS = 0x10000; -static const int kCpuHasMIPS_DSP = 0x20000; -static const int kCpuHasMIPS_DSPR2 = 0x40000; - -// Internal function used to auto-init. -LIBYUV_API -int InitCpuFlags(void); - -// Internal function for parsing /proc/cpuinfo. -LIBYUV_API -int ArmCpuCaps(const char* cpuinfo_name); - -// Detect CPU has SSE2 etc. -// Test_flag parameter should be one of kCpuHas constants above. -// returns non-zero if instruction set is detected -static __inline int TestCpuFlag(int test_flag) { - LIBYUV_API extern int cpu_info_; - return (cpu_info_ == kCpuInit ? InitCpuFlags() : cpu_info_) & test_flag; -} - -// For testing, allow CPU flags to be disabled. -// ie MaskCpuFlags(~kCpuHasSSSE3) to disable SSSE3. -// MaskCpuFlags(-1) to enable all cpu specific optimizations. -// MaskCpuFlags(0) to disable all cpu specific optimizations. -LIBYUV_API -void MaskCpuFlags(int enable_flags); - -// Low level cpuid for X86. Returns zeros on other CPUs. -// eax is the info type that you want. -// ecx is typically the cpu number, and should normally be zero. -LIBYUV_API -void CpuId(uint32 eax, uint32 ecx, uint32* cpu_info); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_CPU_ID_H_ NOLINT diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/mjpeg_decoder.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/mjpeg_decoder.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/mjpeg_decoder.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/mjpeg_decoder.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,192 +0,0 @@ -/* - * Copyright 2012 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_MJPEG_DECODER_H_ // NOLINT -#define INCLUDE_LIBYUV_MJPEG_DECODER_H_ - -#include "libyuv/basic_types.h" - -#ifdef __cplusplus -// NOTE: For a simplified public API use convert.h MJPGToI420(). - -struct jpeg_common_struct; -struct jpeg_decompress_struct; -struct jpeg_source_mgr; - -namespace libyuv { - -#ifdef __cplusplus -extern "C" { -#endif - -LIBYUV_BOOL ValidateJpeg(const uint8* sample, size_t sample_size); - -#ifdef __cplusplus -} // extern "C" -#endif - -static const uint32 kUnknownDataSize = 0xFFFFFFFF; - -enum JpegSubsamplingType { - kJpegYuv420, - kJpegYuv422, - kJpegYuv411, - kJpegYuv444, - kJpegYuv400, - kJpegUnknown -}; - -struct Buffer { - const uint8* data; - int len; -}; - -struct BufferVector { - Buffer* buffers; - int len; - int pos; -}; - -struct SetJmpErrorMgr; - -// MJPEG ("Motion JPEG") is a pseudo-standard video codec where the frames are -// simply independent JPEG images with a fixed huffman table (which is omitted). -// It is rarely used in video transmission, but is common as a camera capture -// format, especially in Logitech devices. This class implements a decoder for -// MJPEG frames. -// -// See http://tools.ietf.org/html/rfc2435 -class LIBYUV_API MJpegDecoder { - public: - typedef void (*CallbackFunction)(void* opaque, - const uint8* const* data, - const int* strides, - int rows); - - static const int kColorSpaceUnknown; - static const int kColorSpaceGrayscale; - static const int kColorSpaceRgb; - static const int kColorSpaceYCbCr; - static const int kColorSpaceCMYK; - static const int kColorSpaceYCCK; - - MJpegDecoder(); - ~MJpegDecoder(); - - // Loads a new frame, reads its headers, and determines the uncompressed - // image format. - // Returns LIBYUV_TRUE if image looks valid and format is supported. - // If return value is LIBYUV_TRUE, then the values for all the following - // getters are populated. - // src_len is the size of the compressed mjpeg frame in bytes. - LIBYUV_BOOL LoadFrame(const uint8* src, size_t src_len); - - // Returns width of the last loaded frame in pixels. - int GetWidth(); - - // Returns height of the last loaded frame in pixels. - int GetHeight(); - - // Returns format of the last loaded frame. The return value is one of the - // kColorSpace* constants. - int GetColorSpace(); - - // Number of color components in the color space. - int GetNumComponents(); - - // Sample factors of the n-th component. - int GetHorizSampFactor(int component); - - int GetVertSampFactor(int component); - - int GetHorizSubSampFactor(int component); - - int GetVertSubSampFactor(int component); - - // Public for testability. - int GetImageScanlinesPerImcuRow(); - - // Public for testability. - int GetComponentScanlinesPerImcuRow(int component); - - // Width of a component in bytes. - int GetComponentWidth(int component); - - // Height of a component. - int GetComponentHeight(int component); - - // Width of a component in bytes with padding for DCTSIZE. Public for testing. - int GetComponentStride(int component); - - // Size of a component in bytes. - int GetComponentSize(int component); - - // Call this after LoadFrame() if you decide you don't want to decode it - // after all. - LIBYUV_BOOL UnloadFrame(); - - // Decodes the entire image into a one-buffer-per-color-component format. - // dst_width must match exactly. dst_height must be <= to image height; if - // less, the image is cropped. "planes" must have size equal to at least - // GetNumComponents() and they must point to non-overlapping buffers of size - // at least GetComponentSize(i). The pointers in planes are incremented - // to point to after the end of the written data. - // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded. - LIBYUV_BOOL DecodeToBuffers(uint8** planes, int dst_width, int dst_height); - - // Decodes the entire image and passes the data via repeated calls to a - // callback function. Each call will get the data for a whole number of - // image scanlines. - // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded. - LIBYUV_BOOL DecodeToCallback(CallbackFunction fn, void* opaque, - int dst_width, int dst_height); - - // The helper function which recognizes the jpeg sub-sampling type. - static JpegSubsamplingType JpegSubsamplingTypeHelper( - int* subsample_x, int* subsample_y, int number_of_components); - - private: - void AllocOutputBuffers(int num_outbufs); - void DestroyOutputBuffers(); - - LIBYUV_BOOL StartDecode(); - LIBYUV_BOOL FinishDecode(); - - void SetScanlinePointers(uint8** data); - LIBYUV_BOOL DecodeImcuRow(); - - int GetComponentScanlinePadding(int component); - - // A buffer holding the input data for a frame. - Buffer buf_; - BufferVector buf_vec_; - - jpeg_decompress_struct* decompress_struct_; - jpeg_source_mgr* source_mgr_; - SetJmpErrorMgr* error_mgr_; - - // LIBYUV_TRUE iff at least one component has scanline padding. (i.e., - // GetComponentScanlinePadding() != 0.) - LIBYUV_BOOL has_scanline_padding_; - - // Temporaries used to point to scanline outputs. - int num_outbufs_; // Outermost size of all arrays below. - uint8*** scanlines_; - int* scanlines_sizes_; - // Temporary buffer used for decoding when we can't decode directly to the - // output buffers. Large enough for just one iMCU row. - uint8** databuf_; - int* databuf_strides_; -}; - -} // namespace libyuv - -#endif // __cplusplus -#endif // INCLUDE_LIBYUV_MJPEG_DECODER_H_ NOLINT diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/planar_functions.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/planar_functions.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/planar_functions.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/planar_functions.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,439 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_PLANAR_FUNCTIONS_H_ // NOLINT -#define INCLUDE_LIBYUV_PLANAR_FUNCTIONS_H_ - -#include "libyuv/basic_types.h" - -// TODO(fbarchard): Remove the following headers includes. -#include "libyuv/convert.h" -#include "libyuv/convert_argb.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -// Copy a plane of data. -LIBYUV_API -void CopyPlane(const uint8* src_y, int src_stride_y, - uint8* dst_y, int dst_stride_y, - int width, int height); - -LIBYUV_API -void CopyPlane_16(const uint16* src_y, int src_stride_y, - uint16* dst_y, int dst_stride_y, - int width, int height); - -// Set a plane of data to a 32 bit value. -LIBYUV_API -void SetPlane(uint8* dst_y, int dst_stride_y, - int width, int height, - uint32 value); - -// Copy I400. Supports inverting. -LIBYUV_API -int I400ToI400(const uint8* src_y, int src_stride_y, - uint8* dst_y, int dst_stride_y, - int width, int height); - - -// Copy I422 to I422. -#define I422ToI422 I422Copy -LIBYUV_API -int I422Copy(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Copy I444 to I444. -#define I444ToI444 I444Copy -LIBYUV_API -int I444Copy(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert YUY2 to I422. -LIBYUV_API -int YUY2ToI422(const uint8* src_yuy2, int src_stride_yuy2, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert UYVY to I422. -LIBYUV_API -int UYVYToI422(const uint8* src_uyvy, int src_stride_uyvy, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert I420 to I400. (calls CopyPlane ignoring u/v). -LIBYUV_API -int I420ToI400(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - int width, int height); - -// Alias -#define I420ToI420Mirror I420Mirror - -// I420 mirror. -LIBYUV_API -int I420Mirror(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Alias -#define I400ToI400Mirror I400Mirror - -// I400 mirror. A single plane is mirrored horizontally. -// Pass negative height to achieve 180 degree rotation. -LIBYUV_API -int I400Mirror(const uint8* src_y, int src_stride_y, - uint8* dst_y, int dst_stride_y, - int width, int height); - -// Alias -#define ARGBToARGBMirror ARGBMirror - -// ARGB mirror. -LIBYUV_API -int ARGBMirror(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert NV12 to RGB565. -LIBYUV_API -int NV12ToRGB565(const uint8* src_y, int src_stride_y, - const uint8* src_uv, int src_stride_uv, - uint8* dst_rgb565, int dst_stride_rgb565, - int width, int height); - -// Convert NV21 to RGB565. -LIBYUV_API -int NV21ToRGB565(const uint8* src_y, int src_stride_y, - const uint8* src_uv, int src_stride_uv, - uint8* dst_rgb565, int dst_stride_rgb565, - int width, int height); - -// I422ToARGB is in convert_argb.h -// Convert I422 to BGRA. -LIBYUV_API -int I422ToBGRA(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_bgra, int dst_stride_bgra, - int width, int height); - -// Convert I422 to ABGR. -LIBYUV_API -int I422ToABGR(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_abgr, int dst_stride_abgr, - int width, int height); - -// Convert I422 to RGBA. -LIBYUV_API -int I422ToRGBA(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_rgba, int dst_stride_rgba, - int width, int height); - -// Draw a rectangle into I420. -LIBYUV_API -int I420Rect(uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int x, int y, int width, int height, - int value_y, int value_u, int value_v); - -// Draw a rectangle into ARGB. -LIBYUV_API -int ARGBRect(uint8* dst_argb, int dst_stride_argb, - int x, int y, int width, int height, uint32 value); - -// Convert ARGB to gray scale ARGB. -LIBYUV_API -int ARGBGrayTo(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Make a rectangle of ARGB gray scale. -LIBYUV_API -int ARGBGray(uint8* dst_argb, int dst_stride_argb, - int x, int y, int width, int height); - -// Make a rectangle of ARGB Sepia tone. -LIBYUV_API -int ARGBSepia(uint8* dst_argb, int dst_stride_argb, - int x, int y, int width, int height); - -// Apply a matrix rotation to each ARGB pixel. -// matrix_argb is 4 signed ARGB values. -128 to 127 representing -2 to 2. -// The first 4 coefficients apply to B, G, R, A and produce B of the output. -// The next 4 coefficients apply to B, G, R, A and produce G of the output. -// The next 4 coefficients apply to B, G, R, A and produce R of the output. -// The last 4 coefficients apply to B, G, R, A and produce A of the output. -LIBYUV_API -int ARGBColorMatrix(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - const int8* matrix_argb, - int width, int height); - -// Deprecated. Use ARGBColorMatrix instead. -// Apply a matrix rotation to each ARGB pixel. -// matrix_argb is 3 signed ARGB values. -128 to 127 representing -1 to 1. -// The first 4 coefficients apply to B, G, R, A and produce B of the output. -// The next 4 coefficients apply to B, G, R, A and produce G of the output. -// The last 4 coefficients apply to B, G, R, A and produce R of the output. -LIBYUV_API -int RGBColorMatrix(uint8* dst_argb, int dst_stride_argb, - const int8* matrix_rgb, - int x, int y, int width, int height); - -// Apply a color table each ARGB pixel. -// Table contains 256 ARGB values. -LIBYUV_API -int ARGBColorTable(uint8* dst_argb, int dst_stride_argb, - const uint8* table_argb, - int x, int y, int width, int height); - -// Apply a color table each ARGB pixel but preserve destination alpha. -// Table contains 256 ARGB values. -LIBYUV_API -int RGBColorTable(uint8* dst_argb, int dst_stride_argb, - const uint8* table_argb, - int x, int y, int width, int height); - -// Apply a luma/color table each ARGB pixel but preserve destination alpha. -// Table contains 32768 values indexed by [Y][C] where 7 it 7 bit luma from -// RGB (YJ style) and C is an 8 bit color component (R, G or B). -LIBYUV_API -int ARGBLumaColorTable(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - const uint8* luma_rgb_table, - int width, int height); - -// Apply a 3 term polynomial to ARGB values. -// poly points to a 4x4 matrix. The first row is constants. The 2nd row is -// coefficients for b, g, r and a. The 3rd row is coefficients for b squared, -// g squared, r squared and a squared. The 4rd row is coefficients for b to -// the 3, g to the 3, r to the 3 and a to the 3. The values are summed and -// result clamped to 0 to 255. -// A polynomial approximation can be dirived using software such as 'R'. - -LIBYUV_API -int ARGBPolynomial(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - const float* poly, - int width, int height); - -// Quantize a rectangle of ARGB. Alpha unaffected. -// scale is a 16 bit fractional fixed point scaler between 0 and 65535. -// interval_size should be a value between 1 and 255. -// interval_offset should be a value between 0 and 255. -LIBYUV_API -int ARGBQuantize(uint8* dst_argb, int dst_stride_argb, - int scale, int interval_size, int interval_offset, - int x, int y, int width, int height); - -// Copy ARGB to ARGB. -LIBYUV_API -int ARGBCopy(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Copy ARGB to ARGB. -LIBYUV_API -int ARGBCopyAlpha(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Copy ARGB to ARGB. -LIBYUV_API -int ARGBCopyYToAlpha(const uint8* src_y, int src_stride_y, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -typedef void (*ARGBBlendRow)(const uint8* src_argb0, const uint8* src_argb1, - uint8* dst_argb, int width); - -// Get function to Alpha Blend ARGB pixels and store to destination. -LIBYUV_API -ARGBBlendRow GetARGBBlend(); - -// Alpha Blend ARGB images and store to destination. -// Alpha of destination is set to 255. -LIBYUV_API -int ARGBBlend(const uint8* src_argb0, int src_stride_argb0, - const uint8* src_argb1, int src_stride_argb1, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Multiply ARGB image by ARGB image. Shifted down by 8. Saturates to 255. -LIBYUV_API -int ARGBMultiply(const uint8* src_argb0, int src_stride_argb0, - const uint8* src_argb1, int src_stride_argb1, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Add ARGB image with ARGB image. Saturates to 255. -LIBYUV_API -int ARGBAdd(const uint8* src_argb0, int src_stride_argb0, - const uint8* src_argb1, int src_stride_argb1, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Subtract ARGB image (argb1) from ARGB image (argb0). Saturates to 0. -LIBYUV_API -int ARGBSubtract(const uint8* src_argb0, int src_stride_argb0, - const uint8* src_argb1, int src_stride_argb1, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert I422 to YUY2. -LIBYUV_API -int I422ToYUY2(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -// Convert I422 to UYVY. -LIBYUV_API -int I422ToUYVY(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -// Convert unattentuated ARGB to preattenuated ARGB. -LIBYUV_API -int ARGBAttenuate(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert preattentuated ARGB to unattenuated ARGB. -LIBYUV_API -int ARGBUnattenuate(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert MJPG to ARGB. -LIBYUV_API -int MJPGToARGB(const uint8* sample, size_t sample_size, - uint8* argb, int argb_stride, - int w, int h, int dw, int dh); - -// Internal function - do not call directly. -// Computes table of cumulative sum for image where the value is the sum -// of all values above and to the left of the entry. Used by ARGBBlur. -LIBYUV_API -int ARGBComputeCumulativeSum(const uint8* src_argb, int src_stride_argb, - int32* dst_cumsum, int dst_stride32_cumsum, - int width, int height); - -// Blur ARGB image. -// dst_cumsum table of width * (height + 1) * 16 bytes aligned to -// 16 byte boundary. -// dst_stride32_cumsum is number of ints in a row (width * 4). -// radius is number of pixels around the center. e.g. 1 = 3x3. 2=5x5. -// Blur is optimized for radius of 5 (11x11) or less. -LIBYUV_API -int ARGBBlur(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int32* dst_cumsum, int dst_stride32_cumsum, - int width, int height, int radius); - -// Multiply ARGB image by ARGB value. -LIBYUV_API -int ARGBShade(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height, uint32 value); - -// Interpolate between two ARGB images using specified amount of interpolation -// (0 to 255) and store to destination. -// 'interpolation' is specified as 8 bit fraction where 0 means 100% src_argb0 -// and 255 means 1% src_argb0 and 99% src_argb1. -// Internally uses ARGBScale bilinear filtering. -// Caveat: This function will write up to 16 bytes beyond the end of dst_argb. -LIBYUV_API -int ARGBInterpolate(const uint8* src_argb0, int src_stride_argb0, - const uint8* src_argb1, int src_stride_argb1, - uint8* dst_argb, int dst_stride_argb, - int width, int height, int interpolation); - -#if defined(__pnacl__) || defined(__CLR_VER) || defined(COVERAGE_ENABLED) || \ - defined(TARGET_IPHONE_SIMULATOR) -#define LIBYUV_DISABLE_X86 -#endif - -// Row functions for copying a pixels from a source with a slope to a row -// of destination. Useful for scaling, rotation, mirror, texture mapping. -LIBYUV_API -void ARGBAffineRow_C(const uint8* src_argb, int src_argb_stride, - uint8* dst_argb, const float* uv_dudv, int width); -// The following are available on all x86 platforms: -#if !defined(LIBYUV_DISABLE_X86) && \ - (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)) -LIBYUV_API -void ARGBAffineRow_SSE2(const uint8* src_argb, int src_argb_stride, - uint8* dst_argb, const float* uv_dudv, int width); -#define HAS_ARGBAFFINEROW_SSE2 -#endif // LIBYUV_DISABLE_X86 - -// Shuffle ARGB channel order. e.g. BGRA to ARGB. -// shuffler is 16 bytes and must be aligned. -LIBYUV_API -int ARGBShuffle(const uint8* src_bgra, int src_stride_bgra, - uint8* dst_argb, int dst_stride_argb, - const uint8* shuffler, int width, int height); - -// Sobel ARGB effect with planar output. -LIBYUV_API -int ARGBSobelToPlane(const uint8* src_argb, int src_stride_argb, - uint8* dst_y, int dst_stride_y, - int width, int height); - -// Sobel ARGB effect. -LIBYUV_API -int ARGBSobel(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Sobel ARGB effect w/ Sobel X, Sobel, Sobel Y in ARGB. -LIBYUV_API -int ARGBSobelXY(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_PLANAR_FUNCTIONS_H_ NOLINT diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/rotate_argb.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/rotate_argb.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/rotate_argb.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/rotate_argb.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -/* - * Copyright 2012 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_ROTATE_ARGB_H_ // NOLINT -#define INCLUDE_LIBYUV_ROTATE_ARGB_H_ - -#include "libyuv/basic_types.h" -#include "libyuv/rotate.h" // For RotationMode. - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -// Rotate ARGB frame -LIBYUV_API -int ARGBRotate(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int src_width, int src_height, enum RotationMode mode); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_ROTATE_ARGB_H_ NOLINT diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/rotate.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/rotate.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/rotate.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/rotate.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_ROTATE_H_ // NOLINT -#define INCLUDE_LIBYUV_ROTATE_H_ - -#include "libyuv/basic_types.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -// Supported rotation. -typedef enum RotationMode { - kRotate0 = 0, // No rotation. - kRotate90 = 90, // Rotate 90 degrees clockwise. - kRotate180 = 180, // Rotate 180 degrees. - kRotate270 = 270, // Rotate 270 degrees clockwise. - - // Deprecated. - kRotateNone = 0, - kRotateClockwise = 90, - kRotateCounterClockwise = 270, -} RotationModeEnum; - -// Rotate I420 frame. -LIBYUV_API -int I420Rotate(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int src_width, int src_height, enum RotationMode mode); - -// Rotate NV12 input and store in I420. -LIBYUV_API -int NV12ToI420Rotate(const uint8* src_y, int src_stride_y, - const uint8* src_uv, int src_stride_uv, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int src_width, int src_height, enum RotationMode mode); - -// Rotate a plane by 0, 90, 180, or 270. -LIBYUV_API -int RotatePlane(const uint8* src, int src_stride, - uint8* dst, int dst_stride, - int src_width, int src_height, enum RotationMode mode); - -// Rotate planes by 90, 180, 270. Deprecated. -LIBYUV_API -void RotatePlane90(const uint8* src, int src_stride, - uint8* dst, int dst_stride, - int width, int height); - -LIBYUV_API -void RotatePlane180(const uint8* src, int src_stride, - uint8* dst, int dst_stride, - int width, int height); - -LIBYUV_API -void RotatePlane270(const uint8* src, int src_stride, - uint8* dst, int dst_stride, - int width, int height); - -LIBYUV_API -void RotateUV90(const uint8* src, int src_stride, - uint8* dst_a, int dst_stride_a, - uint8* dst_b, int dst_stride_b, - int width, int height); - -// Rotations for when U and V are interleaved. -// These functions take one input pointer and -// split the data into two buffers while -// rotating them. Deprecated. -LIBYUV_API -void RotateUV180(const uint8* src, int src_stride, - uint8* dst_a, int dst_stride_a, - uint8* dst_b, int dst_stride_b, - int width, int height); - -LIBYUV_API -void RotateUV270(const uint8* src, int src_stride, - uint8* dst_a, int dst_stride_a, - uint8* dst_b, int dst_stride_b, - int width, int height); - -// The 90 and 270 functions are based on transposes. -// Doing a transpose with reversing the read/write -// order will result in a rotation by +- 90 degrees. -// Deprecated. -LIBYUV_API -void TransposePlane(const uint8* src, int src_stride, - uint8* dst, int dst_stride, - int width, int height); - -LIBYUV_API -void TransposeUV(const uint8* src, int src_stride, - uint8* dst_a, int dst_stride_a, - uint8* dst_b, int dst_stride_b, - int width, int height); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_ROTATE_H_ NOLINT diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/row.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/row.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/row.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/row.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,1795 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_ROW_H_ // NOLINT -#define INCLUDE_LIBYUV_ROW_H_ - -#include // For malloc. - -#include "libyuv/basic_types.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -#define IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a) - 1))) - -#ifdef __cplusplus -#define align_buffer_64(var, size) \ - uint8* var##_mem = reinterpret_cast(malloc((size) + 63)); \ - uint8* var = reinterpret_cast \ - ((reinterpret_cast(var##_mem) + 63) & ~63) -#else -#define align_buffer_64(var, size) \ - uint8* var##_mem = (uint8*)(malloc((size) + 63)); /* NOLINT */ \ - uint8* var = (uint8*)(((intptr_t)(var##_mem) + 63) & ~63) /* NOLINT */ -#endif - -#define free_aligned_buffer_64(var) \ - free(var##_mem); \ - var = 0 - -#if defined(__pnacl__) || defined(__CLR_VER) || defined(COVERAGE_ENABLED) || \ - defined(TARGET_IPHONE_SIMULATOR) || \ - (defined(__i386__) && !defined(__SSE2__)) || \ - (defined(_MSC_VER) && defined(__clang__)) -#define LIBYUV_DISABLE_X86 -#endif -// True if compiling for SSSE3 as a requirement. -#if defined(__SSSE3__) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 3)) -#define LIBYUV_SSSE3_ONLY -#endif - -// clang >= 3.5.0 required for Arm64. -#if defined(__clang__) && defined(__aarch64__) && !defined(LIBYUV_DISABLE_NEON) -#if (__clang_major__ < 3) || (__clang_major__ == 3 && (__clang_minor__ < 5)) -#define LIBYUV_DISABLE_NEON -#endif // clang >= 3.5 -#endif // __clang__ - -// The following are available on all x86 platforms: -#if !defined(LIBYUV_DISABLE_X86) && \ - (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)) -// Conversions: -#define HAS_ABGRTOUVROW_SSSE3 -#define HAS_ABGRTOYROW_SSSE3 -#define HAS_ARGB1555TOARGBROW_SSE2 -#define HAS_ARGB4444TOARGBROW_SSE2 -#define HAS_ARGBSHUFFLEROW_SSE2 -#define HAS_ARGBSHUFFLEROW_SSSE3 -#define HAS_ARGBTOARGB1555ROW_SSE2 -#define HAS_ARGBTOARGB4444ROW_SSE2 -#define HAS_ARGBTOBAYERGGROW_SSE2 -#define HAS_ARGBTORAWROW_SSSE3 -#define HAS_ARGBTORGB24ROW_SSSE3 -#define HAS_ARGBTORGB565ROW_SSE2 -#define HAS_ARGBTOUV422ROW_SSSE3 -#define HAS_ARGBTOUV444ROW_SSSE3 -#define HAS_ARGBTOUVJROW_SSSE3 -#define HAS_ARGBTOUVROW_SSSE3 -#define HAS_ARGBTOYJROW_SSSE3 -#define HAS_ARGBTOYROW_SSSE3 -#define HAS_BGRATOUVROW_SSSE3 -#define HAS_BGRATOYROW_SSSE3 -#define HAS_COPYROW_ERMS -#define HAS_COPYROW_SSE2 -#define HAS_I400TOARGBROW_SSE2 -#define HAS_I411TOARGBROW_SSSE3 -#define HAS_I422TOABGRROW_SSSE3 -#define HAS_I422TOARGB1555ROW_SSSE3 -#define HAS_I422TOARGB4444ROW_SSSE3 -#define HAS_I422TOARGBROW_SSSE3 -#define HAS_I422TOBGRAROW_SSSE3 -#define HAS_I422TORAWROW_SSSE3 -#define HAS_I422TORGB24ROW_SSSE3 -#define HAS_I422TORGB565ROW_SSSE3 -#define HAS_I422TORGBAROW_SSSE3 -#define HAS_I422TOUYVYROW_SSE2 -#define HAS_I422TOYUY2ROW_SSE2 -#define HAS_I444TOARGBROW_SSSE3 -// #define HAS_J422TOARGBROW_SSSE3 -#define HAS_MERGEUVROW_SSE2 -#define HAS_MIRRORROW_SSE2 -#define HAS_MIRRORROW_SSSE3 -#define HAS_MIRRORROW_UV_SSSE3 -#define HAS_MIRRORUVROW_SSSE3 -#define HAS_NV12TOARGBROW_SSSE3 -#define HAS_NV12TORGB565ROW_SSSE3 -#define HAS_NV21TOARGBROW_SSSE3 -#define HAS_NV21TORGB565ROW_SSSE3 -#define HAS_RAWTOARGBROW_SSSE3 -#define HAS_RAWTOYROW_SSSE3 -#define HAS_RGB24TOARGBROW_SSSE3 -#define HAS_RGB24TOYROW_SSSE3 -#define HAS_RGB565TOARGBROW_SSE2 -#define HAS_RGBATOUVROW_SSSE3 -#define HAS_RGBATOYROW_SSSE3 -#define HAS_SETROW_X86 -#define HAS_SETROW_ERMS -#define HAS_ARGBSETROW_X86 -#define HAS_SPLITUVROW_SSE2 -#define HAS_UYVYTOARGBROW_SSSE3 -#define HAS_UYVYTOUV422ROW_SSE2 -#define HAS_UYVYTOUVROW_SSE2 -#define HAS_UYVYTOYROW_SSE2 -#define HAS_YTOARGBROW_SSE2 -#define HAS_YUY2TOARGBROW_SSSE3 -#define HAS_YUY2TOUV422ROW_SSE2 -#define HAS_YUY2TOUVROW_SSE2 -#define HAS_YUY2TOYROW_SSE2 - -// Effects: -#define HAS_ARGBADDROW_SSE2 -#define HAS_ARGBAFFINEROW_SSE2 -#define HAS_ARGBATTENUATEROW_SSSE3 -#define HAS_ARGBBLENDROW_SSSE3 -#define HAS_ARGBCOLORMATRIXROW_SSSE3 -#define HAS_ARGBCOLORTABLEROW_X86 -#define HAS_ARGBCOPYALPHAROW_SSE2 -#define HAS_ARGBCOPYYTOALPHAROW_SSE2 -#define HAS_ARGBGRAYROW_SSSE3 -#define HAS_ARGBLUMACOLORTABLEROW_SSSE3 -#define HAS_ARGBMIRRORROW_SSE2 -#define HAS_ARGBMULTIPLYROW_SSE2 -#define HAS_ARGBPOLYNOMIALROW_SSE2 -#define HAS_ARGBQUANTIZEROW_SSE2 -#define HAS_ARGBSEPIAROW_SSSE3 -#define HAS_ARGBSHADEROW_SSE2 -#define HAS_ARGBSUBTRACTROW_SSE2 -#define HAS_ARGBUNATTENUATEROW_SSE2 -#define HAS_COMPUTECUMULATIVESUMROW_SSE2 -#define HAS_CUMULATIVESUMTOAVERAGEROW_SSE2 -#define HAS_INTERPOLATEROW_SSE2 -#define HAS_INTERPOLATEROW_SSSE3 -#define HAS_RGBCOLORTABLEROW_X86 -#define HAS_SOBELROW_SSE2 -#define HAS_SOBELTOPLANEROW_SSE2 -#define HAS_SOBELXROW_SSE2 -#define HAS_SOBELXYROW_SSE2 -#define HAS_SOBELYROW_SSE2 -#endif - -// The following are available on x64 Visual C: -#if !defined(LIBYUV_DISABLE_X86) && defined (_M_X64) -#define HAS_I422TOARGBROW_SSSE3 -#endif - -// GCC >= 4.7.0 required for AVX2. -#if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__)) -#if (__GNUC__ > 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 7)) -#define GCC_HAS_AVX2 1 -#endif // GNUC >= 4.7 -#endif // __GNUC__ - -// clang >= 3.4.0 required for AVX2. -#if defined(__clang__) && (defined(__x86_64__) || defined(__i386__)) -#if (__clang_major__ > 3) || (__clang_major__ == 3 && (__clang_minor__ >= 4)) -#define CLANG_HAS_AVX2 1 -#endif // clang >= 3.4 -#endif // __clang__ - -// Visual C 2012 required for AVX2. -#if defined(_M_IX86) && defined(_MSC_VER) && _MSC_VER >= 1700 -#define VISUALC_HAS_AVX2 1 -#endif // VisualStudio >= 2012 - -// The following are available require VS2012. Port to GCC. -#if !defined(LIBYUV_DISABLE_X86) && defined(VISUALC_HAS_AVX2) -// TODO(fbarchard): fix AVX2 versions of YUV conversion. bug=393 -#define HAS_I422TOABGRROW_AVX2 -#define HAS_I422TOARGBROW_AVX2 -#define HAS_I422TOBGRAROW_AVX2 -#define HAS_I422TORGBAROW_AVX2 -#define HAS_NV12TOARGBROW_AVX2 -#define HAS_NV21TOARGBROW_AVX2 -#define HAS_ARGBTORGB565ROW_AVX2 -#define HAS_ARGBTOARGB1555ROW_AVX2 -#define HAS_ARGBTOARGB4444ROW_AVX2 -#define HAS_NV12TORGB565ROW_AVX2 -#define HAS_NV21TORGB565ROW_AVX2 -#define HAS_I422TORGB565ROW_AVX2 -#define HAS_I422TOARGB1555ROW_AVX2 -#define HAS_I422TOARGB4444ROW_AVX2 -#endif - -// The following are available on all x86 platforms, but -// require VS2012, clang 3.4 or gcc 4.7. -// The code supports NaCL but requires a new compiler and validator. -#if !defined(LIBYUV_DISABLE_X86) && (defined(VISUALC_HAS_AVX2) || \ - defined(CLANG_HAS_AVX2) || defined(GCC_HAS_AVX2)) -#define HAS_ARGBCOPYALPHAROW_AVX2 -#define HAS_ARGBCOPYYTOALPHAROW_AVX2 -#define HAS_ARGBMIRRORROW_AVX2 -#define HAS_ARGBPOLYNOMIALROW_AVX2 -#define HAS_ARGBSHUFFLEROW_AVX2 -#define HAS_ARGBTOUVROW_AVX2 -#define HAS_ARGBTOYJROW_AVX2 -#define HAS_ARGBTOYROW_AVX2 -#define HAS_COPYROW_AVX -#define HAS_INTERPOLATEROW_AVX2 -#define HAS_MERGEUVROW_AVX2 -#define HAS_MIRRORROW_AVX2 -#define HAS_SPLITUVROW_AVX2 -#define HAS_UYVYTOUV422ROW_AVX2 -#define HAS_UYVYTOUVROW_AVX2 -#define HAS_UYVYTOYROW_AVX2 -#define HAS_YTOARGBROW_AVX2 -#define HAS_YUY2TOUV422ROW_AVX2 -#define HAS_YUY2TOUVROW_AVX2 -#define HAS_YUY2TOYROW_AVX2 - -// The following require HAS_I422TOARGBROW_AVX2 -#if defined(HAS_I422TOARGBROW_AVX2) -#define HAS_YUY2TOARGBROW_AVX2 -#define HAS_UYVYTOARGBROW_AVX2 -#endif - -// Effects: -#define HAS_ARGBADDROW_AVX2 -#define HAS_ARGBATTENUATEROW_AVX2 -#define HAS_ARGBMULTIPLYROW_AVX2 -#define HAS_ARGBSUBTRACTROW_AVX2 -#define HAS_ARGBUNATTENUATEROW_AVX2 -#endif - - -// The following are Yasm x86 only: -// TODO(fbarchard): Port AVX2 to inline. -#if !defined(LIBYUV_DISABLE_X86) && defined(HAVE_YASM) - (defined(_M_IX86) || defined(_M_X64) || \ - defined(__x86_64__) || defined(__i386__)) -#define HAS_MERGEUVROW_AVX2 -#define HAS_MERGEUVROW_MMX -#define HAS_SPLITUVROW_AVX2 -#define HAS_SPLITUVROW_MMX -#define HAS_UYVYTOYROW_AVX2 -#define HAS_UYVYTOYROW_MMX -#define HAS_YUY2TOYROW_AVX2 -#define HAS_YUY2TOYROW_MMX -#endif - -// The following are disabled when SSSE3 is available: -#if !defined(LIBYUV_DISABLE_X86) && \ - (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)) && \ - !defined(LIBYUV_SSSE3_ONLY) -#define HAS_ARGBATTENUATEROW_SSE2 -#define HAS_ARGBBLENDROW_SSE2 -#define HAS_MIRRORROW_SSE2 -#endif - -// The following are available on Neon platforms: -#if !defined(LIBYUV_DISABLE_NEON) && \ - (defined(__aarch64__) || defined(__ARM_NEON__) || defined(LIBYUV_NEON)) -#define HAS_ABGRTOUVROW_NEON -#define HAS_ABGRTOYROW_NEON -#define HAS_ARGB1555TOARGBROW_NEON -#define HAS_ARGB1555TOUVROW_NEON -#define HAS_ARGB1555TOYROW_NEON -#define HAS_ARGB4444TOARGBROW_NEON -#define HAS_ARGB4444TOUVROW_NEON -#define HAS_ARGB4444TOYROW_NEON -#define HAS_ARGBTOARGB1555ROW_NEON -#define HAS_ARGBTOARGB4444ROW_NEON -#define HAS_ARGBTOBAYERGGROW_NEON -#define HAS_ARGBTORAWROW_NEON -#define HAS_ARGBTORGB24ROW_NEON -#define HAS_ARGBTORGB565ROW_NEON -#define HAS_ARGBTOUV411ROW_NEON -#define HAS_ARGBTOUV422ROW_NEON -#define HAS_ARGBTOUV444ROW_NEON -#define HAS_ARGBTOUVJROW_NEON -#define HAS_ARGBTOUVROW_NEON -#define HAS_ARGBTOYJROW_NEON -#define HAS_ARGBTOYROW_NEON -#define HAS_BGRATOUVROW_NEON -#define HAS_BGRATOYROW_NEON -#define HAS_COPYROW_NEON -#define HAS_I400TOARGBROW_NEON -#define HAS_I411TOARGBROW_NEON -#define HAS_I422TOABGRROW_NEON -#define HAS_I422TOARGB1555ROW_NEON -#define HAS_I422TOARGB4444ROW_NEON -#define HAS_I422TOARGBROW_NEON -#define HAS_I422TOBGRAROW_NEON -#define HAS_I422TORAWROW_NEON -#define HAS_I422TORGB24ROW_NEON -#define HAS_I422TORGB565ROW_NEON -#define HAS_I422TORGBAROW_NEON -#define HAS_I422TOUYVYROW_NEON -#define HAS_I422TOYUY2ROW_NEON -#define HAS_I444TOARGBROW_NEON -#define HAS_MERGEUVROW_NEON -#define HAS_MIRRORROW_NEON -#define HAS_MIRRORUVROW_NEON -#define HAS_NV12TOARGBROW_NEON -#define HAS_NV12TORGB565ROW_NEON -#define HAS_NV21TOARGBROW_NEON -#define HAS_NV21TORGB565ROW_NEON -#define HAS_RAWTOARGBROW_NEON -#define HAS_RAWTOUVROW_NEON -#define HAS_RAWTOYROW_NEON -#define HAS_RGB24TOARGBROW_NEON -#define HAS_RGB24TOUVROW_NEON -#define HAS_RGB24TOYROW_NEON -#define HAS_RGB565TOARGBROW_NEON -#define HAS_RGB565TOUVROW_NEON -#define HAS_RGB565TOYROW_NEON -#define HAS_RGBATOUVROW_NEON -#define HAS_RGBATOYROW_NEON -#define HAS_SETROW_NEON -#define HAS_ARGBSETROW_NEON -#define HAS_SPLITUVROW_NEON -#define HAS_UYVYTOARGBROW_NEON -#define HAS_UYVYTOUV422ROW_NEON -#define HAS_UYVYTOUVROW_NEON -#define HAS_UYVYTOYROW_NEON -#define HAS_YTOARGBROW_NEON -#define HAS_YUY2TOARGBROW_NEON -#define HAS_YUY2TOUV422ROW_NEON -#define HAS_YUY2TOUVROW_NEON -#define HAS_YUY2TOYROW_NEON - -// Effects: -#define HAS_ARGBADDROW_NEON -#define HAS_ARGBATTENUATEROW_NEON -#define HAS_ARGBBLENDROW_NEON -#define HAS_ARGBGRAYROW_NEON -#define HAS_ARGBMIRRORROW_NEON -#define HAS_ARGBMULTIPLYROW_NEON -#define HAS_ARGBQUANTIZEROW_NEON -#define HAS_ARGBSEPIAROW_NEON -#define HAS_ARGBSHADEROW_NEON -#define HAS_ARGBSUBTRACTROW_NEON -#define HAS_INTERPOLATEROW_NEON -#define HAS_SOBELROW_NEON -#define HAS_SOBELTOPLANEROW_NEON -#define HAS_SOBELXROW_NEON -#define HAS_SOBELXYROW_NEON -#define HAS_SOBELYROW_NEON -#define HAS_ARGBCOLORMATRIXROW_NEON -#define HAS_ARGBSHUFFLEROW_NEON -#endif - -// The following are available on Mips platforms: -#if !defined(LIBYUV_DISABLE_MIPS) && defined(__mips__) && \ - (_MIPS_SIM == _MIPS_SIM_ABI32) && (__mips_isa_rev < 6) -#define HAS_COPYROW_MIPS -#if defined(__mips_dsp) && (__mips_dsp_rev >= 2) -#define HAS_I422TOABGRROW_MIPS_DSPR2 -#define HAS_I422TOARGBROW_MIPS_DSPR2 -#define HAS_I422TOBGRAROW_MIPS_DSPR2 -#define HAS_INTERPOLATEROW_MIPS_DSPR2 -#define HAS_MIRRORROW_MIPS_DSPR2 -#define HAS_MIRRORUVROW_MIPS_DSPR2 -#define HAS_SPLITUVROW_MIPS_DSPR2 -#endif -#endif - -#if defined(_MSC_VER) && !defined(__CLR_VER) -#define SIMD_ALIGNED(var) __declspec(align(16)) var -#define SIMD_ALIGNED32(var) __declspec(align(64)) var -typedef __declspec(align(16)) int16 vec16[8]; -typedef __declspec(align(16)) int32 vec32[4]; -typedef __declspec(align(16)) int8 vec8[16]; -typedef __declspec(align(16)) uint16 uvec16[8]; -typedef __declspec(align(16)) uint32 uvec32[4]; -typedef __declspec(align(16)) uint8 uvec8[16]; -typedef __declspec(align(32)) int16 lvec16[16]; -typedef __declspec(align(32)) int32 lvec32[8]; -typedef __declspec(align(32)) int8 lvec8[32]; -typedef __declspec(align(32)) uint16 ulvec16[16]; -typedef __declspec(align(32)) uint32 ulvec32[8]; -typedef __declspec(align(32)) uint8 ulvec8[32]; - -#elif defined(__GNUC__) -// Caveat GCC 4.2 to 4.7 have a known issue using vectors with const. -#define SIMD_ALIGNED(var) var __attribute__((aligned(16))) -#define SIMD_ALIGNED32(var) var __attribute__((aligned(64))) -typedef int16 __attribute__((vector_size(16))) vec16; -typedef int32 __attribute__((vector_size(16))) vec32; -typedef int8 __attribute__((vector_size(16))) vec8; -typedef uint16 __attribute__((vector_size(16))) uvec16; -typedef uint32 __attribute__((vector_size(16))) uvec32; -typedef uint8 __attribute__((vector_size(16))) uvec8; -typedef int16 __attribute__((vector_size(32))) lvec16; -typedef int32 __attribute__((vector_size(32))) lvec32; -typedef int8 __attribute__((vector_size(32))) lvec8; -typedef uint16 __attribute__((vector_size(32))) ulvec16; -typedef uint32 __attribute__((vector_size(32))) ulvec32; -typedef uint8 __attribute__((vector_size(32))) ulvec8; -#else -#define SIMD_ALIGNED(var) var -#define SIMD_ALIGNED32(var) var -typedef int16 vec16[8]; -typedef int32 vec32[4]; -typedef int8 vec8[16]; -typedef uint16 uvec16[8]; -typedef uint32 uvec32[4]; -typedef uint8 uvec8[16]; -typedef int16 lvec16[16]; -typedef int32 lvec32[8]; -typedef int8 lvec8[32]; -typedef uint16 ulvec16[16]; -typedef uint32 ulvec32[8]; -typedef uint8 ulvec8[32]; -#endif - -#if defined(__APPLE__) || defined(__x86_64__) || defined(__llvm__) -#define OMITFP -#else -#define OMITFP __attribute__((optimize("omit-frame-pointer"))) -#endif - -// NaCL macros for GCC x86 and x64. -#if defined(__native_client__) -#define LABELALIGN ".p2align 5\n" -#else -#define LABELALIGN -#endif -#if defined(__native_client__) && defined(__x86_64__) -// r14 is used for MEMOP macros. -#define NACL_R14 "r14", -#define BUNDLELOCK ".bundle_lock\n" -#define BUNDLEUNLOCK ".bundle_unlock\n" -#define MEMACCESS(base) "%%nacl:(%%r15,%q" #base ")" -#define MEMACCESS2(offset, base) "%%nacl:" #offset "(%%r15,%q" #base ")" -#define MEMLEA(offset, base) #offset "(%q" #base ")" -#define MEMLEA3(offset, index, scale) \ - #offset "(,%q" #index "," #scale ")" -#define MEMLEA4(offset, base, index, scale) \ - #offset "(%q" #base ",%q" #index "," #scale ")" -#define MEMMOVESTRING(s, d) "%%nacl:(%q" #s "),%%nacl:(%q" #d "), %%r15" -#define MEMSTORESTRING(reg, d) "%%" #reg ",%%nacl:(%q" #d "), %%r15" -#define MEMOPREG(opcode, offset, base, index, scale, reg) \ - BUNDLELOCK \ - "lea " #offset "(%q" #base ",%q" #index "," #scale "),%%r14d\n" \ - #opcode " (%%r15,%%r14),%%" #reg "\n" \ - BUNDLEUNLOCK -#define MEMOPMEM(opcode, reg, offset, base, index, scale) \ - BUNDLELOCK \ - "lea " #offset "(%q" #base ",%q" #index "," #scale "),%%r14d\n" \ - #opcode " %%" #reg ",(%%r15,%%r14)\n" \ - BUNDLEUNLOCK -#define MEMOPARG(opcode, offset, base, index, scale, arg) \ - BUNDLELOCK \ - "lea " #offset "(%q" #base ",%q" #index "," #scale "),%%r14d\n" \ - #opcode " (%%r15,%%r14),%" #arg "\n" \ - BUNDLEUNLOCK -#define VMEMOPREG(opcode, offset, base, index, scale, reg1, reg2) \ - BUNDLELOCK \ - "lea " #offset "(%q" #base ",%q" #index "," #scale "),%%r14d\n" \ - #opcode " (%%r15,%%r14),%%" #reg1 ",%%" #reg2 "\n" \ - BUNDLEUNLOCK -#define VEXTOPMEM(op, sel, reg, offset, base, index, scale) \ - BUNDLELOCK \ - "lea " #offset "(%q" #base ",%q" #index "," #scale "),%%r14d\n" \ - #op " $" #sel ",%%" #reg ",(%%r15,%%r14)\n" \ - BUNDLEUNLOCK -#else // defined(__native_client__) && defined(__x86_64__) -#define NACL_R14 -#define BUNDLEALIGN -#define MEMACCESS(base) "(%" #base ")" -#define MEMACCESS2(offset, base) #offset "(%" #base ")" -#define MEMLEA(offset, base) #offset "(%" #base ")" -#define MEMLEA3(offset, index, scale) \ - #offset "(,%" #index "," #scale ")" -#define MEMLEA4(offset, base, index, scale) \ - #offset "(%" #base ",%" #index "," #scale ")" -#define MEMMOVESTRING(s, d) -#define MEMSTORESTRING(reg, d) -#define MEMOPREG(opcode, offset, base, index, scale, reg) \ - #opcode " " #offset "(%" #base ",%" #index "," #scale "),%%" #reg "\n" -#define MEMOPMEM(opcode, reg, offset, base, index, scale) \ - #opcode " %%" #reg ","#offset "(%" #base ",%" #index "," #scale ")\n" -#define MEMOPARG(opcode, offset, base, index, scale, arg) \ - #opcode " " #offset "(%" #base ",%" #index "," #scale "),%" #arg "\n" -#define VMEMOPREG(opcode, offset, base, index, scale, reg1, reg2) \ - #opcode " " #offset "(%" #base ",%" #index "," #scale "),%%" #reg1 ",%%" \ - #reg2 "\n" -#define VEXTOPMEM(op, sel, reg, offset, base, index, scale) \ - #op " $" #sel ",%%" #reg ","#offset "(%" #base ",%" #index "," #scale ")\n" -#endif // defined(__native_client__) && defined(__x86_64__) - -#if defined(__arm__) || defined(__aarch64__) -#undef MEMACCESS -#if defined(__native_client__) -#define MEMACCESS(base) ".p2align 3\nbic %" #base ", #0xc0000000\n" -#else -#define MEMACCESS(base) -#endif -#endif - -void I444ToARGBRow_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToARGBRow_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I411ToARGBRow_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToBGRARow_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_bgra, - int width); -void I422ToABGRRow_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_abgr, - int width); -void I422ToRGBARow_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgba, - int width); -void I422ToRGB24Row_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgb24, - int width); -void I422ToRAWRow_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_raw, - int width); -void I422ToRGB565Row_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgb565, - int width); -void I422ToARGB1555Row_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb1555, - int width); -void I422ToARGB4444Row_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb4444, - int width); -void NV12ToARGBRow_NEON(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToARGBRow_NEON(const uint8* src_y, - const uint8* src_vu, - uint8* dst_argb, - int width); -void NV12ToRGB565Row_NEON(const uint8* src_y, - const uint8* src_uv, - uint8* dst_rgb565, - int width); -void NV21ToRGB565Row_NEON(const uint8* src_y, - const uint8* src_vu, - uint8* dst_rgb565, - int width); -void YUY2ToARGBRow_NEON(const uint8* src_yuy2, - uint8* dst_argb, - int width); -void UYVYToARGBRow_NEON(const uint8* src_uyvy, - uint8* dst_argb, - int width); - -void ARGBToYRow_AVX2(const uint8* src_argb, uint8* dst_y, int pix); -void ARGBToYRow_Any_AVX2(const uint8* src_argb, uint8* dst_y, int pix); -void ARGBToYRow_SSSE3(const uint8* src_argb, uint8* dst_y, int pix); -void ARGBToYJRow_AVX2(const uint8* src_argb, uint8* dst_y, int pix); -void ARGBToYJRow_Any_AVX2(const uint8* src_argb, uint8* dst_y, int pix); -void ARGBToYJRow_SSSE3(const uint8* src_argb, uint8* dst_y, int pix); -void BGRAToYRow_SSSE3(const uint8* src_bgra, uint8* dst_y, int pix); -void ABGRToYRow_SSSE3(const uint8* src_abgr, uint8* dst_y, int pix); -void RGBAToYRow_SSSE3(const uint8* src_rgba, uint8* dst_y, int pix); -void RGB24ToYRow_SSSE3(const uint8* src_rgb24, uint8* dst_y, int pix); -void RAWToYRow_SSSE3(const uint8* src_raw, uint8* dst_y, int pix); -void ARGBToYRow_NEON(const uint8* src_argb, uint8* dst_y, int pix); -void ARGBToYJRow_NEON(const uint8* src_argb, uint8* dst_y, int pix); -void ARGBToUV444Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v, - int pix); -void ARGBToUV422Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v, - int pix); -void ARGBToUV411Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v, - int pix); -void ARGBToUVRow_NEON(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int pix); -void ARGBToUVJRow_NEON(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int pix); -void BGRAToUVRow_NEON(const uint8* src_bgra, int src_stride_bgra, - uint8* dst_u, uint8* dst_v, int pix); -void ABGRToUVRow_NEON(const uint8* src_abgr, int src_stride_abgr, - uint8* dst_u, uint8* dst_v, int pix); -void RGBAToUVRow_NEON(const uint8* src_rgba, int src_stride_rgba, - uint8* dst_u, uint8* dst_v, int pix); -void RGB24ToUVRow_NEON(const uint8* src_rgb24, int src_stride_rgb24, - uint8* dst_u, uint8* dst_v, int pix); -void RAWToUVRow_NEON(const uint8* src_raw, int src_stride_raw, - uint8* dst_u, uint8* dst_v, int pix); -void RGB565ToUVRow_NEON(const uint8* src_rgb565, int src_stride_rgb565, - uint8* dst_u, uint8* dst_v, int pix); -void ARGB1555ToUVRow_NEON(const uint8* src_argb1555, int src_stride_argb1555, - uint8* dst_u, uint8* dst_v, int pix); -void ARGB4444ToUVRow_NEON(const uint8* src_argb4444, int src_stride_argb4444, - uint8* dst_u, uint8* dst_v, int pix); -void BGRAToYRow_NEON(const uint8* src_bgra, uint8* dst_y, int pix); -void ABGRToYRow_NEON(const uint8* src_abgr, uint8* dst_y, int pix); -void RGBAToYRow_NEON(const uint8* src_rgba, uint8* dst_y, int pix); -void RGB24ToYRow_NEON(const uint8* src_rgb24, uint8* dst_y, int pix); -void RAWToYRow_NEON(const uint8* src_raw, uint8* dst_y, int pix); -void RGB565ToYRow_NEON(const uint8* src_rgb565, uint8* dst_y, int pix); -void ARGB1555ToYRow_NEON(const uint8* src_argb1555, uint8* dst_y, int pix); -void ARGB4444ToYRow_NEON(const uint8* src_argb4444, uint8* dst_y, int pix); -void ARGBToYRow_C(const uint8* src_argb, uint8* dst_y, int pix); -void ARGBToYJRow_C(const uint8* src_argb, uint8* dst_y, int pix); -void BGRAToYRow_C(const uint8* src_bgra, uint8* dst_y, int pix); -void ABGRToYRow_C(const uint8* src_abgr, uint8* dst_y, int pix); -void RGBAToYRow_C(const uint8* src_rgba, uint8* dst_y, int pix); -void RGB24ToYRow_C(const uint8* src_rgb24, uint8* dst_y, int pix); -void RAWToYRow_C(const uint8* src_raw, uint8* dst_y, int pix); -void RGB565ToYRow_C(const uint8* src_rgb565, uint8* dst_y, int pix); -void ARGB1555ToYRow_C(const uint8* src_argb1555, uint8* dst_y, int pix); -void ARGB4444ToYRow_C(const uint8* src_argb4444, uint8* dst_y, int pix); -void ARGBToYRow_Any_SSSE3(const uint8* src_argb, uint8* dst_y, int pix); -void ARGBToYJRow_Any_SSSE3(const uint8* src_argb, uint8* dst_y, int pix); -void BGRAToYRow_Any_SSSE3(const uint8* src_bgra, uint8* dst_y, int pix); -void ABGRToYRow_Any_SSSE3(const uint8* src_abgr, uint8* dst_y, int pix); -void RGBAToYRow_Any_SSSE3(const uint8* src_rgba, uint8* dst_y, int pix); -void RGB24ToYRow_Any_SSSE3(const uint8* src_rgb24, uint8* dst_y, int pix); -void RAWToYRow_Any_SSSE3(const uint8* src_raw, uint8* dst_y, int pix); -void ARGBToYRow_Any_NEON(const uint8* src_argb, uint8* dst_y, int pix); -void ARGBToYJRow_Any_NEON(const uint8* src_argb, uint8* dst_y, int pix); -void BGRAToYRow_Any_NEON(const uint8* src_bgra, uint8* dst_y, int pix); -void ABGRToYRow_Any_NEON(const uint8* src_abgr, uint8* dst_y, int pix); -void RGBAToYRow_Any_NEON(const uint8* src_rgba, uint8* dst_y, int pix); -void RGB24ToYRow_Any_NEON(const uint8* src_rgb24, uint8* dst_y, int pix); -void RAWToYRow_Any_NEON(const uint8* src_raw, uint8* dst_y, int pix); -void RGB565ToYRow_Any_NEON(const uint8* src_rgb565, uint8* dst_y, int pix); -void ARGB1555ToYRow_Any_NEON(const uint8* src_argb1555, uint8* dst_y, int pix); -void ARGB4444ToYRow_Any_NEON(const uint8* src_argb4444, uint8* dst_y, int pix); - -void ARGBToUVRow_AVX2(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUVRow_Any_AVX2(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUVRow_SSSE3(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUVJRow_SSSE3(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int width); -void BGRAToUVRow_SSSE3(const uint8* src_bgra, int src_stride_bgra, - uint8* dst_u, uint8* dst_v, int width); -void ABGRToUVRow_SSSE3(const uint8* src_abgr, int src_stride_abgr, - uint8* dst_u, uint8* dst_v, int width); -void RGBAToUVRow_SSSE3(const uint8* src_rgba, int src_stride_rgba, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUVRow_Any_SSSE3(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUVJRow_Any_SSSE3(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int width); -void BGRAToUVRow_Any_SSSE3(const uint8* src_bgra, int src_stride_bgra, - uint8* dst_u, uint8* dst_v, int width); -void ABGRToUVRow_Any_SSSE3(const uint8* src_abgr, int src_stride_abgr, - uint8* dst_u, uint8* dst_v, int width); -void RGBAToUVRow_Any_SSSE3(const uint8* src_rgba, int src_stride_rgba, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUV444Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v, - int pix); -void ARGBToUV422Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v, - int pix); -void ARGBToUV411Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v, - int pix); -void ARGBToUVRow_Any_NEON(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int pix); -void ARGBToUVJRow_Any_NEON(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int pix); -void BGRAToUVRow_Any_NEON(const uint8* src_bgra, int src_stride_bgra, - uint8* dst_u, uint8* dst_v, int pix); -void ABGRToUVRow_Any_NEON(const uint8* src_abgr, int src_stride_abgr, - uint8* dst_u, uint8* dst_v, int pix); -void RGBAToUVRow_Any_NEON(const uint8* src_rgba, int src_stride_rgba, - uint8* dst_u, uint8* dst_v, int pix); -void RGB24ToUVRow_Any_NEON(const uint8* src_rgb24, int src_stride_rgb24, - uint8* dst_u, uint8* dst_v, int pix); -void RAWToUVRow_Any_NEON(const uint8* src_raw, int src_stride_raw, - uint8* dst_u, uint8* dst_v, int pix); -void RGB565ToUVRow_Any_NEON(const uint8* src_rgb565, int src_stride_rgb565, - uint8* dst_u, uint8* dst_v, int pix); -void ARGB1555ToUVRow_Any_NEON(const uint8* src_argb1555, - int src_stride_argb1555, - uint8* dst_u, uint8* dst_v, int pix); -void ARGB4444ToUVRow_Any_NEON(const uint8* src_argb4444, - int src_stride_argb4444, - uint8* dst_u, uint8* dst_v, int pix); -void ARGBToUVRow_C(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUVJRow_C(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int width); -void BGRAToUVRow_C(const uint8* src_bgra, int src_stride_bgra, - uint8* dst_u, uint8* dst_v, int width); -void ABGRToUVRow_C(const uint8* src_abgr, int src_stride_abgr, - uint8* dst_u, uint8* dst_v, int width); -void RGBAToUVRow_C(const uint8* src_rgba, int src_stride_rgba, - uint8* dst_u, uint8* dst_v, int width); -void RGB24ToUVRow_C(const uint8* src_rgb24, int src_stride_rgb24, - uint8* dst_u, uint8* dst_v, int width); -void RAWToUVRow_C(const uint8* src_raw, int src_stride_raw, - uint8* dst_u, uint8* dst_v, int width); -void RGB565ToUVRow_C(const uint8* src_rgb565, int src_stride_rgb565, - uint8* dst_u, uint8* dst_v, int width); -void ARGB1555ToUVRow_C(const uint8* src_argb1555, int src_stride_argb1555, - uint8* dst_u, uint8* dst_v, int width); -void ARGB4444ToUVRow_C(const uint8* src_argb4444, int src_stride_argb4444, - uint8* dst_u, uint8* dst_v, int width); - -void ARGBToUV444Row_SSSE3(const uint8* src_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUV444Row_Any_SSSE3(const uint8* src_argb, - uint8* dst_u, uint8* dst_v, int width); - -void ARGBToUV422Row_SSSE3(const uint8* src_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUV422Row_Any_SSSE3(const uint8* src_argb, - uint8* dst_u, uint8* dst_v, int width); - -void ARGBToUV444Row_C(const uint8* src_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUV422Row_C(const uint8* src_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUV411Row_C(const uint8* src_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUVJ422Row_C(const uint8* src_argb, - uint8* dst_u, uint8* dst_v, int width); - -void MirrorRow_AVX2(const uint8* src, uint8* dst, int width); -void MirrorRow_SSSE3(const uint8* src, uint8* dst, int width); -void MirrorRow_SSE2(const uint8* src, uint8* dst, int width); -void MirrorRow_NEON(const uint8* src, uint8* dst, int width); -void MirrorRow_MIPS_DSPR2(const uint8* src, uint8* dst, int width); -void MirrorRow_C(const uint8* src, uint8* dst, int width); -void MirrorRow_Any_AVX2(const uint8* src, uint8* dst, int width); -void MirrorRow_Any_SSSE3(const uint8* src, uint8* dst, int width); -void MirrorRow_Any_SSE2(const uint8* src, uint8* dst, int width); -void MirrorRow_Any_NEON(const uint8* src, uint8* dst, int width); - -void MirrorUVRow_SSSE3(const uint8* src_uv, uint8* dst_u, uint8* dst_v, - int width); -void MirrorUVRow_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v, - int width); -void MirrorUVRow_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, - int width); -void MirrorUVRow_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v, - int width); - -void ARGBMirrorRow_AVX2(const uint8* src, uint8* dst, int width); -void ARGBMirrorRow_SSE2(const uint8* src, uint8* dst, int width); -void ARGBMirrorRow_NEON(const uint8* src, uint8* dst, int width); -void ARGBMirrorRow_C(const uint8* src, uint8* dst, int width); -void ARGBMirrorRow_Any_AVX2(const uint8* src, uint8* dst, int width); -void ARGBMirrorRow_Any_SSE2(const uint8* src, uint8* dst, int width); -void ARGBMirrorRow_Any_NEON(const uint8* src, uint8* dst, int width); - -void SplitUVRow_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix); -void SplitUVRow_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix); -void SplitUVRow_AVX2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix); -void SplitUVRow_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix); -void SplitUVRow_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, - int pix); -void SplitUVRow_Any_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, - int pix); -void SplitUVRow_Any_AVX2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, - int pix); -void SplitUVRow_Any_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v, - int pix); -void SplitUVRow_Any_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, - int pix); - -void MergeUVRow_C(const uint8* src_u, const uint8* src_v, uint8* dst_uv, - int width); -void MergeUVRow_SSE2(const uint8* src_u, const uint8* src_v, uint8* dst_uv, - int width); -void MergeUVRow_AVX2(const uint8* src_u, const uint8* src_v, uint8* dst_uv, - int width); -void MergeUVRow_NEON(const uint8* src_u, const uint8* src_v, uint8* dst_uv, - int width); -void MergeUVRow_Any_SSE2(const uint8* src_u, const uint8* src_v, uint8* dst_uv, - int width); -void MergeUVRow_Any_AVX2(const uint8* src_u, const uint8* src_v, uint8* dst_uv, - int width); -void MergeUVRow_Any_NEON(const uint8* src_u, const uint8* src_v, uint8* dst_uv, - int width); - -void CopyRow_SSE2(const uint8* src, uint8* dst, int count); -void CopyRow_AVX(const uint8* src, uint8* dst, int count); -void CopyRow_ERMS(const uint8* src, uint8* dst, int count); -void CopyRow_NEON(const uint8* src, uint8* dst, int count); -void CopyRow_MIPS(const uint8* src, uint8* dst, int count); -void CopyRow_C(const uint8* src, uint8* dst, int count); -void CopyRow_Any_SSE2(const uint8* src, uint8* dst, int count); -void CopyRow_Any_AVX(const uint8* src, uint8* dst, int count); -void CopyRow_Any_NEON(const uint8* src, uint8* dst, int count); - -void CopyRow_16_C(const uint16* src, uint16* dst, int count); - -void ARGBCopyAlphaRow_C(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBCopyAlphaRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBCopyAlphaRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width); - -void ARGBCopyYToAlphaRow_C(const uint8* src_y, uint8* dst_argb, int width); -void ARGBCopyYToAlphaRow_SSE2(const uint8* src_y, uint8* dst_argb, int width); -void ARGBCopyYToAlphaRow_AVX2(const uint8* src_y, uint8* dst_argb, int width); - -void SetRow_C(uint8* dst, uint8 v8, int count); -void SetRow_X86(uint8* dst, uint8 v8, int count); -void SetRow_ERMS(uint8* dst, uint8 v8, int count); -void SetRow_NEON(uint8* dst, uint8 v8, int count); -void SetRow_Any_X86(uint8* dst, uint8 v8, int count); -void SetRow_Any_NEON(uint8* dst, uint8 v8, int count); - -void ARGBSetRow_C(uint8* dst_argb, uint32 v32, int count); -void ARGBSetRow_X86(uint8* dst_argb, uint32 v32, int count); -void ARGBSetRow_NEON(uint8* dst_argb, uint32 v32, int count); -void ARGBSetRow_Any_NEON(uint8* dst_argb, uint32 v32, int count); - -// ARGBShufflers for BGRAToARGB etc. -void ARGBShuffleRow_C(const uint8* src_argb, uint8* dst_argb, - const uint8* shuffler, int pix); -void ARGBShuffleRow_SSE2(const uint8* src_argb, uint8* dst_argb, - const uint8* shuffler, int pix); -void ARGBShuffleRow_SSSE3(const uint8* src_argb, uint8* dst_argb, - const uint8* shuffler, int pix); -void ARGBShuffleRow_AVX2(const uint8* src_argb, uint8* dst_argb, - const uint8* shuffler, int pix); -void ARGBShuffleRow_NEON(const uint8* src_argb, uint8* dst_argb, - const uint8* shuffler, int pix); -void ARGBShuffleRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb, - const uint8* shuffler, int pix); -void ARGBShuffleRow_Any_SSSE3(const uint8* src_argb, uint8* dst_argb, - const uint8* shuffler, int pix); -void ARGBShuffleRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb, - const uint8* shuffler, int pix); -void ARGBShuffleRow_Any_NEON(const uint8* src_argb, uint8* dst_argb, - const uint8* shuffler, int pix); - -void RGB24ToARGBRow_SSSE3(const uint8* src_rgb24, uint8* dst_argb, int pix); -void RAWToARGBRow_SSSE3(const uint8* src_raw, uint8* dst_argb, int pix); -void RGB565ToARGBRow_SSE2(const uint8* src_rgb565, uint8* dst_argb, int pix); -void ARGB1555ToARGBRow_SSE2(const uint8* src_argb1555, uint8* dst_argb, - int pix); -void ARGB4444ToARGBRow_SSE2(const uint8* src_argb4444, uint8* dst_argb, - int pix); - -void RGB24ToARGBRow_NEON(const uint8* src_rgb24, uint8* dst_argb, int pix); -void RAWToARGBRow_NEON(const uint8* src_raw, uint8* dst_argb, int pix); -void RGB565ToARGBRow_NEON(const uint8* src_rgb565, uint8* dst_argb, int pix); -void ARGB1555ToARGBRow_NEON(const uint8* src_argb1555, uint8* dst_argb, - int pix); -void ARGB4444ToARGBRow_NEON(const uint8* src_argb4444, uint8* dst_argb, - int pix); -void RGB24ToARGBRow_C(const uint8* src_rgb24, uint8* dst_argb, int pix); -void RAWToARGBRow_C(const uint8* src_raw, uint8* dst_argb, int pix); -void RGB565ToARGBRow_C(const uint8* src_rgb, uint8* dst_argb, int pix); -void ARGB1555ToARGBRow_C(const uint8* src_argb, uint8* dst_argb, int pix); -void ARGB4444ToARGBRow_C(const uint8* src_argb, uint8* dst_argb, int pix); -void RGB24ToARGBRow_Any_SSSE3(const uint8* src_rgb24, uint8* dst_argb, int pix); -void RAWToARGBRow_Any_SSSE3(const uint8* src_raw, uint8* dst_argb, int pix); -void RGB565ToARGBRow_Any_SSE2(const uint8* src_rgb565, uint8* dst_argb, - int pix); -void ARGB1555ToARGBRow_Any_SSE2(const uint8* src_argb1555, uint8* dst_argb, - int pix); -void ARGB4444ToARGBRow_Any_SSE2(const uint8* src_argb4444, uint8* dst_argb, - int pix); -void RGB24ToARGBRow_Any_NEON(const uint8* src_rgb24, uint8* dst_argb, int pix); -void RAWToARGBRow_Any_NEON(const uint8* src_raw, uint8* dst_argb, int pix); -void RGB565ToARGBRow_Any_NEON(const uint8* src_rgb565, uint8* dst_argb, - int pix); -void ARGB1555ToARGBRow_Any_NEON(const uint8* src_argb1555, uint8* dst_argb, - int pix); -void ARGB4444ToARGBRow_Any_NEON(const uint8* src_argb4444, uint8* dst_argb, - int pix); - -void ARGBToRGB24Row_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRAWRow_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRGB565Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB1555Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB4444Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix); - -void ARGBToRGB565Row_AVX2(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB1555Row_AVX2(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB4444Row_AVX2(const uint8* src_argb, uint8* dst_rgb, int pix); - -void ARGBToRGB24Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRAWRow_NEON(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRGB565Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB1555Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB4444Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix); - -void ARGBToRGBARow_C(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRGB24Row_C(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRAWRow_C(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRGB565Row_C(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB1555Row_C(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB4444Row_C(const uint8* src_argb, uint8* dst_rgb, int pix); - -void ARGBToRGB565DitherRow_C(const uint8* src_argb, uint8* dst_rgb, - const uint8* dither8x8, int pix); - -void I400ToARGBRow_SSE2(const uint8* src_y, uint8* dst_argb, int pix); -void I400ToARGBRow_NEON(const uint8* src_y, uint8* dst_argb, int pix); -void I400ToARGBRow_C(const uint8* src_y, uint8* dst_argb, int pix); -void I400ToARGBRow_Any_SSE2(const uint8* src_y, uint8* dst_argb, int pix); -void I400ToARGBRow_Any_NEON(const uint8* src_y, uint8* dst_argb, int pix); - -void I444ToARGBRow_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToARGBRow_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I411ToARGBRow_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void NV12ToARGBRow_C(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToRGB565Row_C(const uint8* src_y, - const uint8* src_vu, - uint8* dst_argb, - int width); -void NV12ToRGB565Row_C(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToARGBRow_C(const uint8* src_y, - const uint8* src_vu, - uint8* dst_argb, - int width); -void YUY2ToARGBRow_C(const uint8* src_yuy2, - uint8* dst_argb, - int width); -void UYVYToARGBRow_C(const uint8* src_uyvy, - uint8* dst_argb, - int width); -void J422ToARGBRow_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToBGRARow_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_bgra, - int width); -void I422ToABGRRow_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_abgr, - int width); -void I422ToRGBARow_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgba, - int width); -void I422ToRGB24Row_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgb24, - int width); -void I422ToRAWRow_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_raw, - int width); -void I422ToARGB4444Row_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb4444, - int width); -void I422ToARGB1555Row_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb4444, - int width); -void I422ToRGB565Row_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgb565, - int width); -void I422ToARGBRow_AVX2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToBGRARow_AVX2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToRGBARow_AVX2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToABGRRow_AVX2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I444ToARGBRow_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToARGBRow_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I411ToARGBRow_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void NV12ToARGBRow_SSSE3(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToARGBRow_SSSE3(const uint8* src_y, - const uint8* src_vu, - uint8* dst_argb, - int width); -void NV12ToARGBRow_AVX2(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToARGBRow_AVX2(const uint8* src_y, - const uint8* src_vu, - uint8* dst_argb, - int width); -void NV12ToRGB565Row_SSSE3(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToRGB565Row_SSSE3(const uint8* src_y, - const uint8* src_vu, - uint8* dst_argb, - int width); -void NV12ToRGB565Row_AVX2(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToRGB565Row_AVX2(const uint8* src_y, - const uint8* src_vu, - uint8* dst_argb, - int width); -void YUY2ToARGBRow_SSSE3(const uint8* src_yuy2, - uint8* dst_argb, - int width); -void UYVYToARGBRow_SSSE3(const uint8* src_uyvy, - uint8* dst_argb, - int width); -void YUY2ToARGBRow_AVX2(const uint8* src_yuy2, - uint8* dst_argb, - int width); -void UYVYToARGBRow_AVX2(const uint8* src_uyvy, - uint8* dst_argb, - int width); -void J422ToARGBRow_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToBGRARow_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_bgra, - int width); -void I422ToABGRRow_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_abgr, - int width); -void I422ToRGBARow_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgba, - int width); -void I422ToARGB4444Row_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToARGB4444Row_AVX2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToARGB1555Row_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToARGB1555Row_AVX2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToRGB565Row_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToRGB565Row_AVX2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToRGB24Row_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgb24, - int width); -void I422ToRAWRow_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_raw, - int width); -void I422ToARGBRow_Any_AVX2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToBGRARow_Any_AVX2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToRGBARow_Any_AVX2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToABGRRow_Any_AVX2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I444ToARGBRow_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToARGBRow_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I411ToARGBRow_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void NV12ToARGBRow_Any_SSSE3(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToARGBRow_Any_SSSE3(const uint8* src_y, - const uint8* src_vu, - uint8* dst_argb, - int width); -void NV12ToARGBRow_Any_AVX2(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToARGBRow_Any_AVX2(const uint8* src_y, - const uint8* src_vu, - uint8* dst_argb, - int width); -void NV12ToRGB565Row_Any_SSSE3(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToRGB565Row_Any_SSSE3(const uint8* src_y, - const uint8* src_vu, - uint8* dst_argb, - int width); -void NV12ToRGB565Row_Any_AVX2(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToRGB565Row_Any_AVX2(const uint8* src_y, - const uint8* src_vu, - uint8* dst_argb, - int width); -void YUY2ToARGBRow_Any_SSSE3(const uint8* src_yuy2, - uint8* dst_argb, - int width); -void UYVYToARGBRow_Any_SSSE3(const uint8* src_uyvy, - uint8* dst_argb, - int width); -void YUY2ToARGBRow_Any_AVX2(const uint8* src_yuy2, - uint8* dst_argb, - int width); -void UYVYToARGBRow_Any_AVX2(const uint8* src_uyvy, - uint8* dst_argb, - int width); -void I422ToBGRARow_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_bgra, - int width); -void I422ToABGRRow_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_abgr, - int width); -void I422ToRGBARow_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgba, - int width); -void I422ToARGB4444Row_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgba, - int width); -void I422ToARGB4444Row_Any_AVX2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgba, - int width); -void I422ToARGB1555Row_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgba, - int width); -void I422ToARGB1555Row_Any_AVX2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgba, - int width); -void I422ToRGB565Row_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgba, - int width); -void I422ToRGB565Row_Any_AVX2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgba, - int width); -void I422ToRGB24Row_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToRAWRow_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); - -void YToARGBRow_C(const uint8* src_y, - uint8* dst_argb, - int width); -void YToARGBRow_SSE2(const uint8* src_y, - uint8* dst_argb, - int width); -void YToARGBRow_AVX2(const uint8* src_y, - uint8* dst_argb, - int width); -void YToARGBRow_NEON(const uint8* src_y, - uint8* dst_argb, - int width); -void YToARGBRow_Any_SSE2(const uint8* src_y, - uint8* dst_argb, - int width); -void YToARGBRow_Any_AVX2(const uint8* src_y, - uint8* dst_argb, - int width); -void YToARGBRow_Any_NEON(const uint8* src_y, - uint8* dst_argb, - int width); - -// ARGB preattenuated alpha blend. -void ARGBBlendRow_SSSE3(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBBlendRow_SSE2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBBlendRow_NEON(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBBlendRow_C(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); - -// ARGB multiply images. Same API as Blend, but these require -// pointer and width alignment for SSE2. -void ARGBMultiplyRow_C(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBMultiplyRow_SSE2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBMultiplyRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBMultiplyRow_AVX2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBMultiplyRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBMultiplyRow_NEON(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBMultiplyRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); - -// ARGB add images. -void ARGBAddRow_C(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBAddRow_SSE2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBAddRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBAddRow_AVX2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBAddRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBAddRow_NEON(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBAddRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); - -// ARGB subtract images. Same API as Blend, but these require -// pointer and width alignment for SSE2. -void ARGBSubtractRow_C(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBSubtractRow_SSE2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBSubtractRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBSubtractRow_AVX2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBSubtractRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBSubtractRow_NEON(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBSubtractRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); - -void ARGBToRGB24Row_Any_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRAWRow_Any_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRGB565Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB1555Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB4444Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix); - -void ARGBToRGB565Row_Any_AVX2(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB1555Row_Any_AVX2(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB4444Row_Any_AVX2(const uint8* src_argb, uint8* dst_rgb, int pix); - -void ARGBToRGB24Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRAWRow_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRGB565Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB1555Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB4444Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix); - -void I444ToARGBRow_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToARGBRow_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I411ToARGBRow_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToBGRARow_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToABGRRow_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToRGBARow_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToRGB24Row_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToRAWRow_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToARGB4444Row_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToARGB1555Row_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToRGB565Row_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void NV12ToARGBRow_Any_NEON(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToARGBRow_Any_NEON(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV12ToRGB565Row_Any_NEON(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToRGB565Row_Any_NEON(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void YUY2ToARGBRow_Any_NEON(const uint8* src_yuy2, - uint8* dst_argb, - int width); -void UYVYToARGBRow_Any_NEON(const uint8* src_uyvy, - uint8* dst_argb, - int width); -void I422ToARGBRow_MIPS_DSPR2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToBGRARow_MIPS_DSPR2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToABGRRow_MIPS_DSPR2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToARGBRow_MIPS_DSPR2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToBGRARow_MIPS_DSPR2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToABGRRow_MIPS_DSPR2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); - -void YUY2ToYRow_AVX2(const uint8* src_yuy2, uint8* dst_y, int pix); -void YUY2ToUVRow_AVX2(const uint8* src_yuy2, int stride_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToUV422Row_AVX2(const uint8* src_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToYRow_SSE2(const uint8* src_yuy2, uint8* dst_y, int pix); -void YUY2ToUVRow_SSE2(const uint8* src_yuy2, int stride_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToUV422Row_SSE2(const uint8* src_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToYRow_NEON(const uint8* src_yuy2, uint8* dst_y, int pix); -void YUY2ToUVRow_NEON(const uint8* src_yuy2, int stride_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToUV422Row_NEON(const uint8* src_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToYRow_C(const uint8* src_yuy2, uint8* dst_y, int pix); -void YUY2ToUVRow_C(const uint8* src_yuy2, int stride_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToUV422Row_C(const uint8* src_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToYRow_Any_AVX2(const uint8* src_yuy2, uint8* dst_y, int pix); -void YUY2ToUVRow_Any_AVX2(const uint8* src_yuy2, int stride_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToUV422Row_Any_AVX2(const uint8* src_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToYRow_Any_SSE2(const uint8* src_yuy2, uint8* dst_y, int pix); -void YUY2ToUVRow_Any_SSE2(const uint8* src_yuy2, int stride_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToUV422Row_Any_SSE2(const uint8* src_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToYRow_Any_NEON(const uint8* src_yuy2, uint8* dst_y, int pix); -void YUY2ToUVRow_Any_NEON(const uint8* src_yuy2, int stride_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToUV422Row_Any_NEON(const uint8* src_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToYRow_AVX2(const uint8* src_uyvy, uint8* dst_y, int pix); -void UYVYToUVRow_AVX2(const uint8* src_uyvy, int stride_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToUV422Row_AVX2(const uint8* src_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToYRow_SSE2(const uint8* src_uyvy, uint8* dst_y, int pix); -void UYVYToUVRow_SSE2(const uint8* src_uyvy, int stride_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToUV422Row_SSE2(const uint8* src_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToYRow_AVX2(const uint8* src_uyvy, uint8* dst_y, int pix); -void UYVYToUVRow_AVX2(const uint8* src_uyvy, int stride_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToUV422Row_AVX2(const uint8* src_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToYRow_NEON(const uint8* src_uyvy, uint8* dst_y, int pix); -void UYVYToUVRow_NEON(const uint8* src_uyvy, int stride_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToUV422Row_NEON(const uint8* src_uyvy, - uint8* dst_u, uint8* dst_v, int pix); - -void UYVYToYRow_C(const uint8* src_uyvy, uint8* dst_y, int pix); -void UYVYToUVRow_C(const uint8* src_uyvy, int stride_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToUV422Row_C(const uint8* src_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToYRow_Any_AVX2(const uint8* src_uyvy, uint8* dst_y, int pix); -void UYVYToUVRow_Any_AVX2(const uint8* src_uyvy, int stride_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToUV422Row_Any_AVX2(const uint8* src_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToYRow_Any_SSE2(const uint8* src_uyvy, uint8* dst_y, int pix); -void UYVYToUVRow_Any_SSE2(const uint8* src_uyvy, int stride_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToUV422Row_Any_SSE2(const uint8* src_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToYRow_Any_NEON(const uint8* src_uyvy, uint8* dst_y, int pix); -void UYVYToUVRow_Any_NEON(const uint8* src_uyvy, int stride_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToUV422Row_Any_NEON(const uint8* src_uyvy, - uint8* dst_u, uint8* dst_v, int pix); - -void ARGBToBayerGGRow_C(const uint8* src_argb, uint8* dst_bayer, - uint32 /* selector */, int pix); -void ARGBToBayerGGRow_SSE2(const uint8* src_argb, uint8* dst_bayer, - uint32 /* selector */, int pix); -void ARGBToBayerGGRow_NEON(const uint8* src_argb, uint8* dst_bayer, - uint32 /* selector */, int pix); -void ARGBToBayerGGRow_Any_SSE2(const uint8* src_argb, uint8* dst_bayer, - uint32 /* selector */, int pix); -void ARGBToBayerGGRow_Any_NEON(const uint8* src_argb, uint8* dst_bayer, - uint32 /* selector */, int pix); - -void I422ToYUY2Row_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_yuy2, int width); -void I422ToUYVYRow_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_uyvy, int width); -void I422ToYUY2Row_SSE2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_yuy2, int width); -void I422ToUYVYRow_SSE2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_uyvy, int width); -void I422ToYUY2Row_Any_SSE2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_yuy2, int width); -void I422ToUYVYRow_Any_SSE2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_uyvy, int width); -void I422ToYUY2Row_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_yuy2, int width); -void I422ToUYVYRow_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_uyvy, int width); -void I422ToYUY2Row_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_yuy2, int width); -void I422ToUYVYRow_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_uyvy, int width); - -// Effects related row functions. -void ARGBAttenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBAttenuateRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBAttenuateRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBAttenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBAttenuateRow_NEON(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBAttenuateRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb, - int width); -void ARGBAttenuateRow_Any_SSSE3(const uint8* src_argb, uint8* dst_argb, - int width); -void ARGBAttenuateRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb, - int width); -void ARGBAttenuateRow_Any_NEON(const uint8* src_argb, uint8* dst_argb, - int width); - -// Inverse table for unattenuate, shared by C and SSE2. -extern const uint32 fixed_invtbl8[256]; -void ARGBUnattenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBUnattenuateRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBUnattenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBUnattenuateRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb, - int width); -void ARGBUnattenuateRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb, - int width); - -void ARGBGrayRow_C(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBGrayRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBGrayRow_NEON(const uint8* src_argb, uint8* dst_argb, int width); - -void ARGBSepiaRow_C(uint8* dst_argb, int width); -void ARGBSepiaRow_SSSE3(uint8* dst_argb, int width); -void ARGBSepiaRow_NEON(uint8* dst_argb, int width); - -void ARGBColorMatrixRow_C(const uint8* src_argb, uint8* dst_argb, - const int8* matrix_argb, int width); -void ARGBColorMatrixRow_SSSE3(const uint8* src_argb, uint8* dst_argb, - const int8* matrix_argb, int width); -void ARGBColorMatrixRow_NEON(const uint8* src_argb, uint8* dst_argb, - const int8* matrix_argb, int width); - -void ARGBColorTableRow_C(uint8* dst_argb, const uint8* table_argb, int width); -void ARGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width); - -void RGBColorTableRow_C(uint8* dst_argb, const uint8* table_argb, int width); -void RGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width); - -void ARGBQuantizeRow_C(uint8* dst_argb, int scale, int interval_size, - int interval_offset, int width); -void ARGBQuantizeRow_SSE2(uint8* dst_argb, int scale, int interval_size, - int interval_offset, int width); -void ARGBQuantizeRow_NEON(uint8* dst_argb, int scale, int interval_size, - int interval_offset, int width); - -void ARGBShadeRow_C(const uint8* src_argb, uint8* dst_argb, int width, - uint32 value); -void ARGBShadeRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width, - uint32 value); -void ARGBShadeRow_NEON(const uint8* src_argb, uint8* dst_argb, int width, - uint32 value); - -// Used for blur. -void CumulativeSumToAverageRow_SSE2(const int32* topleft, const int32* botleft, - int width, int area, uint8* dst, int count); -void ComputeCumulativeSumRow_SSE2(const uint8* row, int32* cumsum, - const int32* previous_cumsum, int width); - -void CumulativeSumToAverageRow_C(const int32* topleft, const int32* botleft, - int width, int area, uint8* dst, int count); -void ComputeCumulativeSumRow_C(const uint8* row, int32* cumsum, - const int32* previous_cumsum, int width); - -LIBYUV_API -void ARGBAffineRow_C(const uint8* src_argb, int src_argb_stride, - uint8* dst_argb, const float* uv_dudv, int width); -LIBYUV_API -void ARGBAffineRow_SSE2(const uint8* src_argb, int src_argb_stride, - uint8* dst_argb, const float* uv_dudv, int width); - -// Used for I420Scale, ARGBScale, and ARGBInterpolate. -void InterpolateRow_C(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, - int width, int source_y_fraction); -void InterpolateRow_SSE2(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); -void InterpolateRow_SSSE3(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); -void InterpolateRow_AVX2(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); -void InterpolateRow_NEON(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); -void InterpolateRow_MIPS_DSPR2(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); -void InterpolateRow_Any_NEON(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); -void InterpolateRow_Any_SSE2(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); -void InterpolateRow_Any_SSSE3(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); -void InterpolateRow_Any_AVX2(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); -void InterpolateRow_Any_MIPS_DSPR2(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); - -void InterpolateRow_16_C(uint16* dst_ptr, const uint16* src_ptr, - ptrdiff_t src_stride_ptr, - int width, int source_y_fraction); - -// Sobel images. -void SobelXRow_C(const uint8* src_y0, const uint8* src_y1, const uint8* src_y2, - uint8* dst_sobelx, int width); -void SobelXRow_SSE2(const uint8* src_y0, const uint8* src_y1, - const uint8* src_y2, uint8* dst_sobelx, int width); -void SobelXRow_NEON(const uint8* src_y0, const uint8* src_y1, - const uint8* src_y2, uint8* dst_sobelx, int width); -void SobelYRow_C(const uint8* src_y0, const uint8* src_y1, - uint8* dst_sobely, int width); -void SobelYRow_SSE2(const uint8* src_y0, const uint8* src_y1, - uint8* dst_sobely, int width); -void SobelYRow_NEON(const uint8* src_y0, const uint8* src_y1, - uint8* dst_sobely, int width); -void SobelRow_C(const uint8* src_sobelx, const uint8* src_sobely, - uint8* dst_argb, int width); -void SobelRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely, - uint8* dst_argb, int width); -void SobelRow_NEON(const uint8* src_sobelx, const uint8* src_sobely, - uint8* dst_argb, int width); -void SobelToPlaneRow_C(const uint8* src_sobelx, const uint8* src_sobely, - uint8* dst_y, int width); -void SobelToPlaneRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely, - uint8* dst_y, int width); -void SobelToPlaneRow_NEON(const uint8* src_sobelx, const uint8* src_sobely, - uint8* dst_y, int width); -void SobelXYRow_C(const uint8* src_sobelx, const uint8* src_sobely, - uint8* dst_argb, int width); -void SobelXYRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely, - uint8* dst_argb, int width); -void SobelXYRow_NEON(const uint8* src_sobelx, const uint8* src_sobely, - uint8* dst_argb, int width); - -void ARGBPolynomialRow_C(const uint8* src_argb, - uint8* dst_argb, const float* poly, - int width); -void ARGBPolynomialRow_SSE2(const uint8* src_argb, - uint8* dst_argb, const float* poly, - int width); -void ARGBPolynomialRow_AVX2(const uint8* src_argb, - uint8* dst_argb, const float* poly, - int width); - -void ARGBLumaColorTableRow_C(const uint8* src_argb, uint8* dst_argb, int width, - const uint8* luma, uint32 lumacoeff); -void ARGBLumaColorTableRow_SSSE3(const uint8* src_argb, uint8* dst_argb, - int width, - const uint8* luma, uint32 lumacoeff); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_ROW_H_ NOLINT diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/scale_argb.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/scale_argb.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/scale_argb.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/scale_argb.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -/* - * Copyright 2012 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_SCALE_ARGB_H_ // NOLINT -#define INCLUDE_LIBYUV_SCALE_ARGB_H_ - -#include "libyuv/basic_types.h" -#include "libyuv/scale.h" // For FilterMode - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -LIBYUV_API -int ARGBScale(const uint8* src_argb, int src_stride_argb, - int src_width, int src_height, - uint8* dst_argb, int dst_stride_argb, - int dst_width, int dst_height, - enum FilterMode filtering); - -// Clipped scale takes destination rectangle coordinates for clip values. -LIBYUV_API -int ARGBScaleClip(const uint8* src_argb, int src_stride_argb, - int src_width, int src_height, - uint8* dst_argb, int dst_stride_argb, - int dst_width, int dst_height, - int clip_x, int clip_y, int clip_width, int clip_height, - enum FilterMode filtering); - -// TODO(fbarchard): Implement this. -// Scale with YUV conversion to ARGB and clipping. -LIBYUV_API -int YUVToARGBScaleClip(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint32 src_fourcc, - int src_width, int src_height, - uint8* dst_argb, int dst_stride_argb, - uint32 dst_fourcc, - int dst_width, int dst_height, - int clip_x, int clip_y, int clip_width, int clip_height, - enum FilterMode filtering); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_SCALE_ARGB_H_ NOLINT diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/scale.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/scale.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/scale.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/scale.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,103 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_SCALE_H_ // NOLINT -#define INCLUDE_LIBYUV_SCALE_H_ - -#include "libyuv/basic_types.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -// Supported filtering. -typedef enum FilterMode { - kFilterNone = 0, // Point sample; Fastest. - kFilterLinear = 1, // Filter horizontally only. - kFilterBilinear = 2, // Faster than box, but lower quality scaling down. - kFilterBox = 3 // Highest quality. -} FilterModeEnum; - -// Scale a YUV plane. -LIBYUV_API -void ScalePlane(const uint8* src, int src_stride, - int src_width, int src_height, - uint8* dst, int dst_stride, - int dst_width, int dst_height, - enum FilterMode filtering); - -LIBYUV_API -void ScalePlane_16(const uint16* src, int src_stride, - int src_width, int src_height, - uint16* dst, int dst_stride, - int dst_width, int dst_height, - enum FilterMode filtering); - -// Scales a YUV 4:2:0 image from the src width and height to the -// dst width and height. -// If filtering is kFilterNone, a simple nearest-neighbor algorithm is -// used. This produces basic (blocky) quality at the fastest speed. -// If filtering is kFilterBilinear, interpolation is used to produce a better -// quality image, at the expense of speed. -// If filtering is kFilterBox, averaging is used to produce ever better -// quality image, at further expense of speed. -// Returns 0 if successful. - -LIBYUV_API -int I420Scale(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - int src_width, int src_height, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int dst_width, int dst_height, - enum FilterMode filtering); - -LIBYUV_API -int I420Scale_16(const uint16* src_y, int src_stride_y, - const uint16* src_u, int src_stride_u, - const uint16* src_v, int src_stride_v, - int src_width, int src_height, - uint16* dst_y, int dst_stride_y, - uint16* dst_u, int dst_stride_u, - uint16* dst_v, int dst_stride_v, - int dst_width, int dst_height, - enum FilterMode filtering); - -#ifdef __cplusplus -// Legacy API. Deprecated. -LIBYUV_API -int Scale(const uint8* src_y, const uint8* src_u, const uint8* src_v, - int src_stride_y, int src_stride_u, int src_stride_v, - int src_width, int src_height, - uint8* dst_y, uint8* dst_u, uint8* dst_v, - int dst_stride_y, int dst_stride_u, int dst_stride_v, - int dst_width, int dst_height, - LIBYUV_BOOL interpolate); - -// Legacy API. Deprecated. -LIBYUV_API -int ScaleOffset(const uint8* src_i420, int src_width, int src_height, - uint8* dst_i420, int dst_width, int dst_height, int dst_yoffset, - LIBYUV_BOOL interpolate); - -// For testing, allow disabling of specialized scalers. -LIBYUV_API -void SetUseReferenceImpl(LIBYUV_BOOL use); -#endif // __cplusplus - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_SCALE_H_ NOLINT diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/scale_row.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/scale_row.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/scale_row.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/scale_row.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,332 +0,0 @@ -/* - * Copyright 2013 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_SCALE_ROW_H_ // NOLINT -#define INCLUDE_LIBYUV_SCALE_ROW_H_ - -#include "libyuv/basic_types.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -#if defined(__pnacl__) || defined(__CLR_VER) || defined(COVERAGE_ENABLED) || \ - defined(TARGET_IPHONE_SIMULATOR) -#define LIBYUV_DISABLE_X86 -#endif - -// The following are available on all x86 platforms: -#if !defined(LIBYUV_DISABLE_X86) && \ - (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)) -#define HAS_SCALEROWDOWN2_SSE2 -#define HAS_SCALEROWDOWN4_SSE2 -#define HAS_SCALEROWDOWN34_SSSE3 -#define HAS_SCALEROWDOWN38_SSSE3 -#define HAS_SCALEADDROWS_SSE2 -#define HAS_SCALEFILTERCOLS_SSSE3 -#define HAS_SCALECOLSUP2_SSE2 -#define HAS_SCALEARGBROWDOWN2_SSE2 -#define HAS_SCALEARGBROWDOWNEVEN_SSE2 -#define HAS_SCALEARGBCOLS_SSE2 -#define HAS_SCALEARGBFILTERCOLS_SSSE3 -#define HAS_SCALEARGBCOLSUP2_SSE2 -#define HAS_FIXEDDIV_X86 -#define HAS_FIXEDDIV1_X86 -#endif - -// The following are available on Neon platforms: -#if !defined(LIBYUV_DISABLE_NEON) && !defined(__native_client__) && \ - (defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__)) -#define HAS_SCALEROWDOWN2_NEON -#define HAS_SCALEROWDOWN4_NEON -#define HAS_SCALEROWDOWN34_NEON -#define HAS_SCALEROWDOWN38_NEON -#define HAS_SCALEARGBROWDOWNEVEN_NEON -#define HAS_SCALEARGBROWDOWN2_NEON -#endif - -// The following are available on Mips platforms: -#if !defined(LIBYUV_DISABLE_MIPS) && !defined(__native_client__) && \ - defined(__mips__) && defined(__mips_dsp) && (__mips_dsp_rev >= 2) -#define HAS_SCALEROWDOWN2_MIPS_DSPR2 -#define HAS_SCALEROWDOWN4_MIPS_DSPR2 -#define HAS_SCALEROWDOWN34_MIPS_DSPR2 -#define HAS_SCALEROWDOWN38_MIPS_DSPR2 -#endif - -// Scale ARGB vertically with bilinear interpolation. -void ScalePlaneVertical(int src_height, - int dst_width, int dst_height, - int src_stride, int dst_stride, - const uint8* src_argb, uint8* dst_argb, - int x, int y, int dy, - int bpp, enum FilterMode filtering); - -void ScalePlaneVertical_16(int src_height, - int dst_width, int dst_height, - int src_stride, int dst_stride, - const uint16* src_argb, uint16* dst_argb, - int x, int y, int dy, - int wpp, enum FilterMode filtering); - -// Simplify the filtering based on scale factors. -enum FilterMode ScaleFilterReduce(int src_width, int src_height, - int dst_width, int dst_height, - enum FilterMode filtering); - -// Divide num by div and return as 16.16 fixed point result. -int FixedDiv_C(int num, int div); -int FixedDiv_X86(int num, int div); -// Divide num - 1 by div - 1 and return as 16.16 fixed point result. -int FixedDiv1_C(int num, int div); -int FixedDiv1_X86(int num, int div); -#ifdef HAS_FIXEDDIV_X86 -#define FixedDiv FixedDiv_X86 -#define FixedDiv1 FixedDiv1_X86 -#else -#define FixedDiv FixedDiv_C -#define FixedDiv1 FixedDiv1_C -#endif - -// Compute slope values for stepping. -void ScaleSlope(int src_width, int src_height, - int dst_width, int dst_height, - enum FilterMode filtering, - int* x, int* y, int* dx, int* dy); - -void ScaleRowDown2_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown2_16_C(const uint16* src_ptr, ptrdiff_t src_stride, - uint16* dst, int dst_width); -void ScaleRowDown2Linear_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown2Linear_16_C(const uint16* src_ptr, ptrdiff_t src_stride, - uint16* dst, int dst_width); -void ScaleRowDown2Box_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown2Box_16_C(const uint16* src_ptr, ptrdiff_t src_stride, - uint16* dst, int dst_width); -void ScaleRowDown4_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown4_16_C(const uint16* src_ptr, ptrdiff_t src_stride, - uint16* dst, int dst_width); -void ScaleRowDown4Box_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown4Box_16_C(const uint16* src_ptr, ptrdiff_t src_stride, - uint16* dst, int dst_width); -void ScaleRowDown34_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown34_16_C(const uint16* src_ptr, ptrdiff_t src_stride, - uint16* dst, int dst_width); -void ScaleRowDown34_0_Box_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* d, int dst_width); -void ScaleRowDown34_0_Box_16_C(const uint16* src_ptr, ptrdiff_t src_stride, - uint16* d, int dst_width); -void ScaleRowDown34_1_Box_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* d, int dst_width); -void ScaleRowDown34_1_Box_16_C(const uint16* src_ptr, ptrdiff_t src_stride, - uint16* d, int dst_width); -void ScaleCols_C(uint8* dst_ptr, const uint8* src_ptr, - int dst_width, int x, int dx); -void ScaleCols_16_C(uint16* dst_ptr, const uint16* src_ptr, - int dst_width, int x, int dx); -void ScaleColsUp2_C(uint8* dst_ptr, const uint8* src_ptr, - int dst_width, int, int); -void ScaleColsUp2_16_C(uint16* dst_ptr, const uint16* src_ptr, - int dst_width, int, int); -void ScaleFilterCols_C(uint8* dst_ptr, const uint8* src_ptr, - int dst_width, int x, int dx); -void ScaleFilterCols_16_C(uint16* dst_ptr, const uint16* src_ptr, - int dst_width, int x, int dx); -void ScaleFilterCols64_C(uint8* dst_ptr, const uint8* src_ptr, - int dst_width, int x, int dx); -void ScaleFilterCols64_16_C(uint16* dst_ptr, const uint16* src_ptr, - int dst_width, int x, int dx); -void ScaleRowDown38_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown38_16_C(const uint16* src_ptr, ptrdiff_t src_stride, - uint16* dst, int dst_width); -void ScaleRowDown38_3_Box_C(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown38_3_Box_16_C(const uint16* src_ptr, - ptrdiff_t src_stride, - uint16* dst_ptr, int dst_width); -void ScaleRowDown38_2_Box_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown38_2_Box_16_C(const uint16* src_ptr, ptrdiff_t src_stride, - uint16* dst_ptr, int dst_width); -void ScaleAddRows_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint16* dst_ptr, int src_width, int src_height); -void ScaleAddRows_16_C(const uint16* src_ptr, ptrdiff_t src_stride, - uint32* dst_ptr, int src_width, int src_height); -void ScaleARGBRowDown2_C(const uint8* src_argb, - ptrdiff_t src_stride, - uint8* dst_argb, int dst_width); -void ScaleARGBRowDown2Linear_C(const uint8* src_argb, - ptrdiff_t src_stride, - uint8* dst_argb, int dst_width); -void ScaleARGBRowDown2Box_C(const uint8* src_argb, ptrdiff_t src_stride, - uint8* dst_argb, int dst_width); -void ScaleARGBRowDownEven_C(const uint8* src_argb, ptrdiff_t src_stride, - int src_stepx, - uint8* dst_argb, int dst_width); -void ScaleARGBRowDownEvenBox_C(const uint8* src_argb, - ptrdiff_t src_stride, - int src_stepx, - uint8* dst_argb, int dst_width); -void ScaleARGBCols_C(uint8* dst_argb, const uint8* src_argb, - int dst_width, int x, int dx); -void ScaleARGBCols64_C(uint8* dst_argb, const uint8* src_argb, - int dst_width, int x, int dx); -void ScaleARGBColsUp2_C(uint8* dst_argb, const uint8* src_argb, - int dst_width, int, int); -void ScaleARGBFilterCols_C(uint8* dst_argb, const uint8* src_argb, - int dst_width, int x, int dx); -void ScaleARGBFilterCols64_C(uint8* dst_argb, const uint8* src_argb, - int dst_width, int x, int dx); - -void ScaleRowDown2_SSE2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown2Linear_SSE2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown2Box_SSE2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown4_SSE2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown4Box_SSE2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown34_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown34_1_Box_SSSE3(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown34_0_Box_SSSE3(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown38_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown38_3_Box_SSSE3(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown38_2_Box_SSSE3(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleAddRows_SSE2(const uint8* src_ptr, ptrdiff_t src_stride, - uint16* dst_ptr, int src_width, - int src_height); -void ScaleFilterCols_SSSE3(uint8* dst_ptr, const uint8* src_ptr, - int dst_width, int x, int dx); -void ScaleColsUp2_SSE2(uint8* dst_ptr, const uint8* src_ptr, - int dst_width, int x, int dx); -void ScaleARGBRowDown2_SSE2(const uint8* src_argb, - ptrdiff_t src_stride, - uint8* dst_argb, int dst_width); -void ScaleARGBRowDown2Linear_SSE2(const uint8* src_argb, - ptrdiff_t src_stride, - uint8* dst_argb, int dst_width); -void ScaleARGBRowDown2Box_SSE2(const uint8* src_argb, - ptrdiff_t src_stride, - uint8* dst_argb, int dst_width); -void ScaleARGBRowDownEven_SSE2(const uint8* src_argb, ptrdiff_t src_stride, - int src_stepx, - uint8* dst_argb, int dst_width); -void ScaleARGBRowDownEvenBox_SSE2(const uint8* src_argb, - ptrdiff_t src_stride, - int src_stepx, - uint8* dst_argb, int dst_width); -void ScaleARGBCols_SSE2(uint8* dst_argb, const uint8* src_argb, - int dst_width, int x, int dx); -void ScaleARGBFilterCols_SSSE3(uint8* dst_argb, const uint8* src_argb, - int dst_width, int x, int dx); -void ScaleARGBColsUp2_SSE2(uint8* dst_argb, const uint8* src_argb, - int dst_width, int x, int dx); -// Row functions. -void ScaleARGBRowDownEven_NEON(const uint8* src_argb, ptrdiff_t src_stride, - int src_stepx, - uint8* dst_argb, int dst_width); -void ScaleARGBRowDownEvenBox_NEON(const uint8* src_argb, ptrdiff_t src_stride, - int src_stepx, - uint8* dst_argb, int dst_width); -void ScaleARGBRowDown2_NEON(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleARGBRowDown2Box_NEON(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); - -// ScaleRowDown2Box also used by planar functions -// NEON downscalers with interpolation. - -// Note - not static due to reuse in convert for 444 to 420. -void ScaleRowDown2_NEON(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); - -void ScaleRowDown2Box_NEON(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); - -void ScaleRowDown4_NEON(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown4Box_NEON(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); - -// Down scale from 4 to 3 pixels. Use the neon multilane read/write -// to load up the every 4th pixel into a 4 different registers. -// Point samples 32 pixels to 24 pixels. -void ScaleRowDown34_NEON(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown34_0_Box_NEON(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown34_1_Box_NEON(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); - -// 32 -> 12 -void ScaleRowDown38_NEON(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -// 32x3 -> 12x1 -void ScaleRowDown38_3_Box_NEON(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -// 32x2 -> 12x1 -void ScaleRowDown38_2_Box_NEON(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); - -void ScaleRowDown2_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown2Box_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown4_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown4Box_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown34_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown34_0_Box_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* d, int dst_width); -void ScaleRowDown34_1_Box_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* d, int dst_width); -void ScaleRowDown38_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown38_2_Box_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown38_3_Box_MIPS_DSPR2(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_SCALE_ROW_H_ NOLINT diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/version.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/version.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/version.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/version.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -/* - * Copyright 2012 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT -#define INCLUDE_LIBYUV_VERSION_H_ - -#define LIBYUV_VERSION 1305 - -#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/video_common.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/video_common.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/include/libyuv/video_common.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/include/libyuv/video_common.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,182 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Common definitions for video, including fourcc and VideoFormat. - -#ifndef INCLUDE_LIBYUV_VIDEO_COMMON_H_ // NOLINT -#define INCLUDE_LIBYUV_VIDEO_COMMON_H_ - -#include "libyuv/basic_types.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -////////////////////////////////////////////////////////////////////////////// -// Definition of FourCC codes -////////////////////////////////////////////////////////////////////////////// - -// Convert four characters to a FourCC code. -// Needs to be a macro otherwise the OS X compiler complains when the kFormat* -// constants are used in a switch. -#ifdef __cplusplus -#define FOURCC(a, b, c, d) ( \ - (static_cast(a)) | (static_cast(b) << 8) | \ - (static_cast(c) << 16) | (static_cast(d) << 24)) -#else -#define FOURCC(a, b, c, d) ( \ - ((uint32)(a)) | ((uint32)(b) << 8) | /* NOLINT */ \ - ((uint32)(c) << 16) | ((uint32)(d) << 24)) /* NOLINT */ -#endif - -// Some pages discussing FourCC codes: -// http://www.fourcc.org/yuv.php -// http://v4l2spec.bytesex.org/spec/book1.htm -// http://developer.apple.com/quicktime/icefloe/dispatch020.html -// http://msdn.microsoft.com/library/windows/desktop/dd206750.aspx#nv12 -// http://people.xiph.org/~xiphmont/containers/nut/nut4cc.txt - -// FourCC codes grouped according to implementation efficiency. -// Primary formats should convert in 1 efficient step. -// Secondary formats are converted in 2 steps. -// Auxilliary formats call primary converters. -enum FourCC { - // 9 Primary YUV formats: 5 planar, 2 biplanar, 2 packed. - FOURCC_I420 = FOURCC('I', '4', '2', '0'), - FOURCC_I422 = FOURCC('I', '4', '2', '2'), - FOURCC_I444 = FOURCC('I', '4', '4', '4'), - FOURCC_I411 = FOURCC('I', '4', '1', '1'), - FOURCC_I400 = FOURCC('I', '4', '0', '0'), - FOURCC_NV21 = FOURCC('N', 'V', '2', '1'), - FOURCC_NV12 = FOURCC('N', 'V', '1', '2'), - FOURCC_YUY2 = FOURCC('Y', 'U', 'Y', '2'), - FOURCC_UYVY = FOURCC('U', 'Y', 'V', 'Y'), - - // 2 Secondary YUV formats: row biplanar. - FOURCC_M420 = FOURCC('M', '4', '2', '0'), - FOURCC_Q420 = FOURCC('Q', '4', '2', '0'), // deprecated. - - // 9 Primary RGB formats: 4 32 bpp, 2 24 bpp, 3 16 bpp. - FOURCC_ARGB = FOURCC('A', 'R', 'G', 'B'), - FOURCC_BGRA = FOURCC('B', 'G', 'R', 'A'), - FOURCC_ABGR = FOURCC('A', 'B', 'G', 'R'), - FOURCC_24BG = FOURCC('2', '4', 'B', 'G'), - FOURCC_RAW = FOURCC('r', 'a', 'w', ' '), - FOURCC_RGBA = FOURCC('R', 'G', 'B', 'A'), - FOURCC_RGBP = FOURCC('R', 'G', 'B', 'P'), // rgb565 LE. - FOURCC_RGBO = FOURCC('R', 'G', 'B', 'O'), // argb1555 LE. - FOURCC_R444 = FOURCC('R', '4', '4', '4'), // argb4444 LE. - - // 4 Secondary RGB formats: 4 Bayer Patterns. deprecated. - FOURCC_RGGB = FOURCC('R', 'G', 'G', 'B'), - FOURCC_BGGR = FOURCC('B', 'G', 'G', 'R'), - FOURCC_GRBG = FOURCC('G', 'R', 'B', 'G'), - FOURCC_GBRG = FOURCC('G', 'B', 'R', 'G'), - - // 1 Primary Compressed YUV format. - FOURCC_MJPG = FOURCC('M', 'J', 'P', 'G'), - - // 5 Auxiliary YUV variations: 3 with U and V planes are swapped, 1 Alias. - FOURCC_YV12 = FOURCC('Y', 'V', '1', '2'), - FOURCC_YV16 = FOURCC('Y', 'V', '1', '6'), - FOURCC_YV24 = FOURCC('Y', 'V', '2', '4'), - FOURCC_YU12 = FOURCC('Y', 'U', '1', '2'), // Linux version of I420. - FOURCC_J420 = FOURCC('J', '4', '2', '0'), - FOURCC_J400 = FOURCC('J', '4', '0', '0'), - - // 14 Auxiliary aliases. CanonicalFourCC() maps these to canonical fourcc. - FOURCC_IYUV = FOURCC('I', 'Y', 'U', 'V'), // Alias for I420. - FOURCC_YU16 = FOURCC('Y', 'U', '1', '6'), // Alias for I422. - FOURCC_YU24 = FOURCC('Y', 'U', '2', '4'), // Alias for I444. - FOURCC_YUYV = FOURCC('Y', 'U', 'Y', 'V'), // Alias for YUY2. - FOURCC_YUVS = FOURCC('y', 'u', 'v', 's'), // Alias for YUY2 on Mac. - FOURCC_HDYC = FOURCC('H', 'D', 'Y', 'C'), // Alias for UYVY. - FOURCC_2VUY = FOURCC('2', 'v', 'u', 'y'), // Alias for UYVY on Mac. - FOURCC_JPEG = FOURCC('J', 'P', 'E', 'G'), // Alias for MJPG. - FOURCC_DMB1 = FOURCC('d', 'm', 'b', '1'), // Alias for MJPG on Mac. - FOURCC_BA81 = FOURCC('B', 'A', '8', '1'), // Alias for BGGR. - FOURCC_RGB3 = FOURCC('R', 'G', 'B', '3'), // Alias for RAW. - FOURCC_BGR3 = FOURCC('B', 'G', 'R', '3'), // Alias for 24BG. - FOURCC_CM32 = FOURCC(0, 0, 0, 32), // Alias for BGRA kCMPixelFormat_32ARGB - FOURCC_CM24 = FOURCC(0, 0, 0, 24), // Alias for RAW kCMPixelFormat_24RGB - FOURCC_L555 = FOURCC('L', '5', '5', '5'), // Alias for RGBO. - FOURCC_L565 = FOURCC('L', '5', '6', '5'), // Alias for RGBP. - FOURCC_5551 = FOURCC('5', '5', '5', '1'), // Alias for RGBO. - - // 1 Auxiliary compressed YUV format set aside for capturer. - FOURCC_H264 = FOURCC('H', '2', '6', '4'), - - // Match any fourcc. - FOURCC_ANY = -1, -}; - -enum FourCCBpp { - // Canonical fourcc codes used in our code. - FOURCC_BPP_I420 = 12, - FOURCC_BPP_I422 = 16, - FOURCC_BPP_I444 = 24, - FOURCC_BPP_I411 = 12, - FOURCC_BPP_I400 = 8, - FOURCC_BPP_NV21 = 12, - FOURCC_BPP_NV12 = 12, - FOURCC_BPP_YUY2 = 16, - FOURCC_BPP_UYVY = 16, - FOURCC_BPP_M420 = 12, - FOURCC_BPP_Q420 = 12, - FOURCC_BPP_ARGB = 32, - FOURCC_BPP_BGRA = 32, - FOURCC_BPP_ABGR = 32, - FOURCC_BPP_RGBA = 32, - FOURCC_BPP_24BG = 24, - FOURCC_BPP_RAW = 24, - FOURCC_BPP_RGBP = 16, - FOURCC_BPP_RGBO = 16, - FOURCC_BPP_R444 = 16, - FOURCC_BPP_RGGB = 8, - FOURCC_BPP_BGGR = 8, - FOURCC_BPP_GRBG = 8, - FOURCC_BPP_GBRG = 8, - FOURCC_BPP_YV12 = 12, - FOURCC_BPP_YV16 = 16, - FOURCC_BPP_YV24 = 24, - FOURCC_BPP_YU12 = 12, - FOURCC_BPP_J420 = 12, - FOURCC_BPP_J400 = 8, - FOURCC_BPP_MJPG = 0, // 0 means unknown. - FOURCC_BPP_H264 = 0, - FOURCC_BPP_IYUV = 12, - FOURCC_BPP_YU16 = 16, - FOURCC_BPP_YU24 = 24, - FOURCC_BPP_YUYV = 16, - FOURCC_BPP_YUVS = 16, - FOURCC_BPP_HDYC = 16, - FOURCC_BPP_2VUY = 16, - FOURCC_BPP_JPEG = 1, - FOURCC_BPP_DMB1 = 1, - FOURCC_BPP_BA81 = 8, - FOURCC_BPP_RGB3 = 24, - FOURCC_BPP_BGR3 = 24, - FOURCC_BPP_CM32 = 32, - FOURCC_BPP_CM24 = 24, - - // Match any fourcc. - FOURCC_BPP_ANY = 0, // 0 means unknown. -}; - -// Converts fourcc aliases into canonical ones. -LIBYUV_API uint32 CanonicalFourCC(uint32 fourcc); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_VIDEO_COMMON_H_ NOLINT diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/source/row_x86.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/source/row_x86.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/source/row_x86.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/source/row_x86.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,146 +0,0 @@ -; -; Copyright 2012 The LibYuv Project Authors. All rights reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - -%ifdef __YASM_VERSION_ID__ -%if __YASM_VERSION_ID__ < 01020000h -%error AVX2 is supported only by yasm 1.2.0 or later. -%endif -%endif -%include "x86inc.asm" - -SECTION .text - -; cglobal numeric constants are parameters, gpr regs, mm regs - -; void YUY2ToYRow_SSE2(const uint8* src_yuy2, uint8* dst_y, int pix) - -%macro YUY2TOYROW 2-3 -cglobal %1ToYRow%3, 3, 3, 3, src_yuy2, dst_y, pix -%ifidn %1,YUY2 - pcmpeqb m2, m2, m2 ; generate mask 0x00ff00ff - psrlw m2, m2, 8 -%endif - - ALIGN 4 -.convertloop: - mov%2 m0, [src_yuy2q] - mov%2 m1, [src_yuy2q + mmsize] - lea src_yuy2q, [src_yuy2q + mmsize * 2] -%ifidn %1,YUY2 - pand m0, m0, m2 ; YUY2 even bytes are Y - pand m1, m1, m2 -%else - psrlw m0, m0, 8 ; UYVY odd bytes are Y - psrlw m1, m1, 8 -%endif - packuswb m0, m0, m1 -%if cpuflag(AVX2) - vpermq m0, m0, 0xd8 -%endif - sub pixd, mmsize - mov%2 [dst_yq], m0 - lea dst_yq, [dst_yq + mmsize] - jg .convertloop - REP_RET -%endmacro - -; TODO(fbarchard): Remove MMX. Add SSSE3 pshufb version. -INIT_MMX MMX -YUY2TOYROW YUY2,a, -YUY2TOYROW YUY2,u,_Unaligned -YUY2TOYROW UYVY,a, -YUY2TOYROW UYVY,u,_Unaligned -INIT_XMM SSE2 -YUY2TOYROW YUY2,a, -YUY2TOYROW YUY2,u,_Unaligned -YUY2TOYROW UYVY,a, -YUY2TOYROW UYVY,u,_Unaligned -INIT_YMM AVX2 -YUY2TOYROW YUY2,a, -YUY2TOYROW UYVY,a, - -; void SplitUVRow_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix) - -%macro SplitUVRow 1-2 -cglobal SplitUVRow%2, 4, 4, 5, src_uv, dst_u, dst_v, pix - pcmpeqb m4, m4, m4 ; generate mask 0x00ff00ff - psrlw m4, m4, 8 - sub dst_vq, dst_uq - - ALIGN 4 -.convertloop: - mov%1 m0, [src_uvq] - mov%1 m1, [src_uvq + mmsize] - lea src_uvq, [src_uvq + mmsize * 2] - psrlw m2, m0, 8 ; odd bytes - psrlw m3, m1, 8 - pand m0, m0, m4 ; even bytes - pand m1, m1, m4 - packuswb m0, m0, m1 - packuswb m2, m2, m3 -%if cpuflag(AVX2) - vpermq m0, m0, 0xd8 - vpermq m2, m2, 0xd8 -%endif - mov%1 [dst_uq], m0 - mov%1 [dst_uq + dst_vq], m2 - lea dst_uq, [dst_uq + mmsize] - sub pixd, mmsize - jg .convertloop - REP_RET -%endmacro - -INIT_MMX MMX -SplitUVRow a, -SplitUVRow u,_Unaligned -INIT_XMM SSE2 -SplitUVRow a, -SplitUVRow u,_Unaligned -INIT_YMM AVX2 -SplitUVRow a, - -; void MergeUVRow_SSE2(const uint8* src_u, const uint8* src_v, uint8* dst_uv, -; int width); - -%macro MergeUVRow_ 1-2 -cglobal MergeUVRow_%2, 4, 4, 3, src_u, src_v, dst_uv, pix - sub src_vq, src_uq - - ALIGN 4 -.convertloop: - mov%1 m0, [src_uq] - mov%1 m1, [src_vq] - lea src_uq, [src_uq + mmsize] - punpcklbw m2, m0, m1 // first 8 UV pairs - punpckhbw m0, m0, m1 // next 8 UV pairs -%if cpuflag(AVX2) - vperm2i128 m1, m2, m0, 0x20 // low 128 of ymm2 and low 128 of ymm0 - vperm2i128 m2, m2, m0, 0x31 // high 128 of ymm2 and high 128 of ymm0 - mov%1 [dst_uvq], m1 - mov%1 [dst_uvq + mmsize], m2 -%else - mov%1 [dst_uvq], m2 - mov%1 [dst_uvq + mmsize], m0 -%endif - lea dst_uvq, [dst_uvq + mmsize * 2] - sub pixd, mmsize - jg .convertloop - REP_RET -%endmacro - -INIT_MMX MMX -MergeUVRow_ a, -MergeUVRow_ u,_Unaligned -INIT_XMM SSE2 -MergeUVRow_ a, -MergeUVRow_ u,_Unaligned -INIT_YMM AVX2 -MergeUVRow_ a, - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/source/x86inc.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/source/x86inc.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/libyuv/source/x86inc.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/libyuv/source/x86inc.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,1136 +0,0 @@ -;***************************************************************************** -;* x86inc.asm: x264asm abstraction layer -;***************************************************************************** -;* Copyright (C) 2005-2012 x264 project -;* -;* Authors: Loren Merritt -;* Anton Mitrofanov -;* Jason Garrett-Glaser -;* Henrik Gramner -;* -;* Permission to use, copy, modify, and/or distribute this software for any -;* purpose with or without fee is hereby granted, provided that the above -;* copyright notice and this permission notice appear in all copies. -;* -;* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -;* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -;* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -;* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -;* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -;* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -;* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -;***************************************************************************** - -; This is a header file for the x264ASM assembly language, which uses -; NASM/YASM syntax combined with a large number of macros to provide easy -; abstraction between different calling conventions (x86_32, win64, linux64). -; It also has various other useful features to simplify writing the kind of -; DSP functions that are most often used in x264. - -; Unlike the rest of x264, this file is available under an ISC license, as it -; has significant usefulness outside of x264 and we want it to be available -; to the largest audience possible. Of course, if you modify it for your own -; purposes to add a new feature, we strongly encourage contributing a patch -; as this feature might be useful for others as well. Send patches or ideas -; to x264-devel@videolan.org . - -; Local changes for libyuv: -; remove %define program_name and references in labels -; rename cpus to uppercase - -%define WIN64 0 -%define UNIX64 0 -%if ARCH_X86_64 - %ifidn __OUTPUT_FORMAT__,win32 - %define WIN64 1 - %elifidn __OUTPUT_FORMAT__,win64 - %define WIN64 1 - %else - %define UNIX64 1 - %endif -%endif - -%ifdef PREFIX - %define mangle(x) _ %+ x -%else - %define mangle(x) x -%endif - -; Name of the .rodata section. -; Kludge: Something on OS X fails to align .rodata even given an align attribute, -; so use a different read-only section. -%macro SECTION_RODATA 0-1 16 - %ifidn __OUTPUT_FORMAT__,macho64 - SECTION .text align=%1 - %elifidn __OUTPUT_FORMAT__,macho - SECTION .text align=%1 - fakegot: - %elifidn __OUTPUT_FORMAT__,aout - section .text - %else - SECTION .rodata align=%1 - %endif -%endmacro - -; aout does not support align= -%macro SECTION_TEXT 0-1 16 - %ifidn __OUTPUT_FORMAT__,aout - SECTION .text - %else - SECTION .text align=%1 - %endif -%endmacro - -%if WIN64 - %define PIC -%elif ARCH_X86_64 == 0 -; x86_32 doesn't require PIC. -; Some distros prefer shared objects to be PIC, but nothing breaks if -; the code contains a few textrels, so we'll skip that complexity. - %undef PIC -%endif -%ifdef PIC - default rel -%endif - -; Always use long nops (reduces 0x90 spam in disassembly on x86_32) -CPU amdnop - -; Macros to eliminate most code duplication between x86_32 and x86_64: -; Currently this works only for leaf functions which load all their arguments -; into registers at the start, and make no other use of the stack. Luckily that -; covers most of x264's asm. - -; PROLOGUE: -; %1 = number of arguments. loads them from stack if needed. -; %2 = number of registers used. pushes callee-saved regs if needed. -; %3 = number of xmm registers used. pushes callee-saved xmm regs if needed. -; %4 = list of names to define to registers -; PROLOGUE can also be invoked by adding the same options to cglobal - -; e.g. -; cglobal foo, 2,3,0, dst, src, tmp -; declares a function (foo), taking two args (dst and src) and one local variable (tmp) - -; TODO Some functions can use some args directly from the stack. If they're the -; last args then you can just not declare them, but if they're in the middle -; we need more flexible macro. - -; RET: -; Pops anything that was pushed by PROLOGUE, and returns. - -; REP_RET: -; Same, but if it doesn't pop anything it becomes a 2-byte ret, for athlons -; which are slow when a normal ret follows a branch. - -; registers: -; rN and rNq are the native-size register holding function argument N -; rNd, rNw, rNb are dword, word, and byte size -; rNh is the high 8 bits of the word size -; rNm is the original location of arg N (a register or on the stack), dword -; rNmp is native size - -%macro DECLARE_REG 2-3 - %define r%1q %2 - %define r%1d %2d - %define r%1w %2w - %define r%1b %2b - %define r%1h %2h - %if %0 == 2 - %define r%1m %2d - %define r%1mp %2 - %elif ARCH_X86_64 ; memory - %define r%1m [rsp + stack_offset + %3] - %define r%1mp qword r %+ %1m - %else - %define r%1m [esp + stack_offset + %3] - %define r%1mp dword r %+ %1m - %endif - %define r%1 %2 -%endmacro - -%macro DECLARE_REG_SIZE 3 - %define r%1q r%1 - %define e%1q r%1 - %define r%1d e%1 - %define e%1d e%1 - %define r%1w %1 - %define e%1w %1 - %define r%1h %3 - %define e%1h %3 - %define r%1b %2 - %define e%1b %2 -%if ARCH_X86_64 == 0 - %define r%1 e%1 -%endif -%endmacro - -DECLARE_REG_SIZE ax, al, ah -DECLARE_REG_SIZE bx, bl, bh -DECLARE_REG_SIZE cx, cl, ch -DECLARE_REG_SIZE dx, dl, dh -DECLARE_REG_SIZE si, sil, null -DECLARE_REG_SIZE di, dil, null -DECLARE_REG_SIZE bp, bpl, null - -; t# defines for when per-arch register allocation is more complex than just function arguments - -%macro DECLARE_REG_TMP 1-* - %assign %%i 0 - %rep %0 - CAT_XDEFINE t, %%i, r%1 - %assign %%i %%i+1 - %rotate 1 - %endrep -%endmacro - -%macro DECLARE_REG_TMP_SIZE 0-* - %rep %0 - %define t%1q t%1 %+ q - %define t%1d t%1 %+ d - %define t%1w t%1 %+ w - %define t%1h t%1 %+ h - %define t%1b t%1 %+ b - %rotate 1 - %endrep -%endmacro - -DECLARE_REG_TMP_SIZE 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14 - -%if ARCH_X86_64 - %define gprsize 8 -%else - %define gprsize 4 -%endif - -%macro PUSH 1 - push %1 - %assign stack_offset stack_offset+gprsize -%endmacro - -%macro POP 1 - pop %1 - %assign stack_offset stack_offset-gprsize -%endmacro - -%macro PUSH_IF_USED 1-* - %rep %0 - %if %1 < regs_used - PUSH r%1 - %endif - %rotate 1 - %endrep -%endmacro - -%macro POP_IF_USED 1-* - %rep %0 - %if %1 < regs_used - pop r%1 - %endif - %rotate 1 - %endrep -%endmacro - -%macro LOAD_IF_USED 1-* - %rep %0 - %if %1 < num_args - mov r%1, r %+ %1 %+ mp - %endif - %rotate 1 - %endrep -%endmacro - -%macro SUB 2 - sub %1, %2 - %ifidn %1, rsp - %assign stack_offset stack_offset+(%2) - %endif -%endmacro - -%macro ADD 2 - add %1, %2 - %ifidn %1, rsp - %assign stack_offset stack_offset-(%2) - %endif -%endmacro - -%macro movifnidn 2 - %ifnidn %1, %2 - mov %1, %2 - %endif -%endmacro - -%macro movsxdifnidn 2 - %ifnidn %1, %2 - movsxd %1, %2 - %endif -%endmacro - -%macro ASSERT 1 - %if (%1) == 0 - %error assert failed - %endif -%endmacro - -%macro DEFINE_ARGS 0-* - %ifdef n_arg_names - %assign %%i 0 - %rep n_arg_names - CAT_UNDEF arg_name %+ %%i, q - CAT_UNDEF arg_name %+ %%i, d - CAT_UNDEF arg_name %+ %%i, w - CAT_UNDEF arg_name %+ %%i, h - CAT_UNDEF arg_name %+ %%i, b - CAT_UNDEF arg_name %+ %%i, m - CAT_UNDEF arg_name %+ %%i, mp - CAT_UNDEF arg_name, %%i - %assign %%i %%i+1 - %endrep - %endif - - %xdefine %%stack_offset stack_offset - %undef stack_offset ; so that the current value of stack_offset doesn't get baked in by xdefine - %assign %%i 0 - %rep %0 - %xdefine %1q r %+ %%i %+ q - %xdefine %1d r %+ %%i %+ d - %xdefine %1w r %+ %%i %+ w - %xdefine %1h r %+ %%i %+ h - %xdefine %1b r %+ %%i %+ b - %xdefine %1m r %+ %%i %+ m - %xdefine %1mp r %+ %%i %+ mp - CAT_XDEFINE arg_name, %%i, %1 - %assign %%i %%i+1 - %rotate 1 - %endrep - %xdefine stack_offset %%stack_offset - %assign n_arg_names %0 -%endmacro - -%if WIN64 ; Windows x64 ;================================================= - -DECLARE_REG 0, rcx -DECLARE_REG 1, rdx -DECLARE_REG 2, R8 -DECLARE_REG 3, R9 -DECLARE_REG 4, R10, 40 -DECLARE_REG 5, R11, 48 -DECLARE_REG 6, rax, 56 -DECLARE_REG 7, rdi, 64 -DECLARE_REG 8, rsi, 72 -DECLARE_REG 9, rbx, 80 -DECLARE_REG 10, rbp, 88 -DECLARE_REG 11, R12, 96 -DECLARE_REG 12, R13, 104 -DECLARE_REG 13, R14, 112 -DECLARE_REG 14, R15, 120 - -%macro PROLOGUE 2-4+ 0 ; #args, #regs, #xmm_regs, arg_names... - %assign num_args %1 - %assign regs_used %2 - ASSERT regs_used >= num_args - ASSERT regs_used <= 15 - PUSH_IF_USED 7, 8, 9, 10, 11, 12, 13, 14 - %if mmsize == 8 - %assign xmm_regs_used 0 - %else - WIN64_SPILL_XMM %3 - %endif - LOAD_IF_USED 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 - DEFINE_ARGS %4 -%endmacro - -%macro WIN64_SPILL_XMM 1 - %assign xmm_regs_used %1 - ASSERT xmm_regs_used <= 16 - %if xmm_regs_used > 6 - SUB rsp, (xmm_regs_used-6)*16+16 - %assign %%i xmm_regs_used - %rep (xmm_regs_used-6) - %assign %%i %%i-1 - movdqa [rsp + (%%i-6)*16+(~stack_offset&8)], xmm %+ %%i - %endrep - %endif -%endmacro - -%macro WIN64_RESTORE_XMM_INTERNAL 1 - %if xmm_regs_used > 6 - %assign %%i xmm_regs_used - %rep (xmm_regs_used-6) - %assign %%i %%i-1 - movdqa xmm %+ %%i, [%1 + (%%i-6)*16+(~stack_offset&8)] - %endrep - add %1, (xmm_regs_used-6)*16+16 - %endif -%endmacro - -%macro WIN64_RESTORE_XMM 1 - WIN64_RESTORE_XMM_INTERNAL %1 - %assign stack_offset stack_offset-(xmm_regs_used-6)*16+16 - %assign xmm_regs_used 0 -%endmacro - -%define has_epilogue regs_used > 7 || xmm_regs_used > 6 || mmsize == 32 - -%macro RET 0 - WIN64_RESTORE_XMM_INTERNAL rsp - POP_IF_USED 14, 13, 12, 11, 10, 9, 8, 7 -%if mmsize == 32 - vzeroupper -%endif - ret -%endmacro - -%elif ARCH_X86_64 ; *nix x64 ;============================================= - -DECLARE_REG 0, rdi -DECLARE_REG 1, rsi -DECLARE_REG 2, rdx -DECLARE_REG 3, rcx -DECLARE_REG 4, R8 -DECLARE_REG 5, R9 -DECLARE_REG 6, rax, 8 -DECLARE_REG 7, R10, 16 -DECLARE_REG 8, R11, 24 -DECLARE_REG 9, rbx, 32 -DECLARE_REG 10, rbp, 40 -DECLARE_REG 11, R12, 48 -DECLARE_REG 12, R13, 56 -DECLARE_REG 13, R14, 64 -DECLARE_REG 14, R15, 72 - -%macro PROLOGUE 2-4+ ; #args, #regs, #xmm_regs, arg_names... - %assign num_args %1 - %assign regs_used %2 - ASSERT regs_used >= num_args - ASSERT regs_used <= 15 - PUSH_IF_USED 9, 10, 11, 12, 13, 14 - LOAD_IF_USED 6, 7, 8, 9, 10, 11, 12, 13, 14 - DEFINE_ARGS %4 -%endmacro - -%define has_epilogue regs_used > 9 || mmsize == 32 - -%macro RET 0 - POP_IF_USED 14, 13, 12, 11, 10, 9 -%if mmsize == 32 - vzeroupper -%endif - ret -%endmacro - -%else ; X86_32 ;============================================================== - -DECLARE_REG 0, eax, 4 -DECLARE_REG 1, ecx, 8 -DECLARE_REG 2, edx, 12 -DECLARE_REG 3, ebx, 16 -DECLARE_REG 4, esi, 20 -DECLARE_REG 5, edi, 24 -DECLARE_REG 6, ebp, 28 -%define rsp esp - -%macro DECLARE_ARG 1-* - %rep %0 - %define r%1m [esp + stack_offset + 4*%1 + 4] - %define r%1mp dword r%1m - %rotate 1 - %endrep -%endmacro - -DECLARE_ARG 7, 8, 9, 10, 11, 12, 13, 14 - -%macro PROLOGUE 2-4+ ; #args, #regs, #xmm_regs, arg_names... - %assign num_args %1 - %assign regs_used %2 - %if regs_used > 7 - %assign regs_used 7 - %endif - ASSERT regs_used >= num_args - PUSH_IF_USED 3, 4, 5, 6 - LOAD_IF_USED 0, 1, 2, 3, 4, 5, 6 - DEFINE_ARGS %4 -%endmacro - -%define has_epilogue regs_used > 3 || mmsize == 32 - -%macro RET 0 - POP_IF_USED 6, 5, 4, 3 -%if mmsize == 32 - vzeroupper -%endif - ret -%endmacro - -%endif ;====================================================================== - -%if WIN64 == 0 -%macro WIN64_SPILL_XMM 1 -%endmacro -%macro WIN64_RESTORE_XMM 1 -%endmacro -%endif - -%macro REP_RET 0 - %if has_epilogue - RET - %else - rep ret - %endif -%endmacro - -%macro TAIL_CALL 2 ; callee, is_nonadjacent - %if has_epilogue - call %1 - RET - %elif %2 - jmp %1 - %endif -%endmacro - -;============================================================================= -; arch-independent part -;============================================================================= - -%assign function_align 16 - -; Begin a function. -; Applies any symbol mangling needed for C linkage, and sets up a define such that -; subsequent uses of the function name automatically refer to the mangled version. -; Appends cpuflags to the function name if cpuflags has been specified. -%macro cglobal 1-2+ ; name, [PROLOGUE args] -%if %0 == 1 - cglobal_internal %1 %+ SUFFIX -%else - cglobal_internal %1 %+ SUFFIX, %2 -%endif -%endmacro -%macro cglobal_internal 1-2+ - %ifndef cglobaled_%1 - %xdefine %1 mangle(%1) - %xdefine %1.skip_prologue %1 %+ .skip_prologue - CAT_XDEFINE cglobaled_, %1, 1 - %endif - %xdefine current_function %1 - %ifidn __OUTPUT_FORMAT__,elf - global %1:function hidden - %else - global %1 - %endif - align function_align - %1: - RESET_MM_PERMUTATION ; not really needed, but makes disassembly somewhat nicer - %assign stack_offset 0 - %if %0 > 1 - PROLOGUE %2 - %endif -%endmacro - -%macro cextern 1 - %xdefine %1 mangle(%1) - CAT_XDEFINE cglobaled_, %1, 1 - extern %1 -%endmacro - -; like cextern, but without the prefix -%macro cextern_naked 1 - %xdefine %1 mangle(%1) - CAT_XDEFINE cglobaled_, %1, 1 - extern %1 -%endmacro - -%macro const 2+ - %xdefine %1 mangle(%1) - global %1 - %1: %2 -%endmacro - -; This is needed for ELF, otherwise the GNU linker assumes the stack is -; executable by default. -%ifidn __OUTPUT_FORMAT__,elf -SECTION .note.GNU-stack noalloc noexec nowrite progbits -%endif -%ifidn __OUTPUT_FORMAT__,elf32 -section .note.GNU-stack noalloc noexec nowrite progbits -%endif -%ifidn __OUTPUT_FORMAT__,elf64 -section .note.GNU-stack noalloc noexec nowrite progbits -%endif - -; cpuflags - -%assign cpuflags_MMX (1<<0) -%assign cpuflags_MMX2 (1<<1) | cpuflags_MMX -%assign cpuflags_3dnow (1<<2) | cpuflags_MMX -%assign cpuflags_3dnow2 (1<<3) | cpuflags_3dnow -%assign cpuflags_SSE (1<<4) | cpuflags_MMX2 -%assign cpuflags_SSE2 (1<<5) | cpuflags_SSE -%assign cpuflags_SSE2slow (1<<6) | cpuflags_SSE2 -%assign cpuflags_SSE3 (1<<7) | cpuflags_SSE2 -%assign cpuflags_SSSE3 (1<<8) | cpuflags_SSE3 -%assign cpuflags_SSE4 (1<<9) | cpuflags_SSSE3 -%assign cpuflags_SSE42 (1<<10)| cpuflags_SSE4 -%assign cpuflags_AVX (1<<11)| cpuflags_SSE42 -%assign cpuflags_xop (1<<12)| cpuflags_AVX -%assign cpuflags_fma4 (1<<13)| cpuflags_AVX -%assign cpuflags_AVX2 (1<<14)| cpuflags_AVX -%assign cpuflags_fma3 (1<<15)| cpuflags_AVX - -%assign cpuflags_cache32 (1<<16) -%assign cpuflags_cache64 (1<<17) -%assign cpuflags_slowctz (1<<18) -%assign cpuflags_lzcnt (1<<19) -%assign cpuflags_misalign (1<<20) -%assign cpuflags_aligned (1<<21) ; not a cpu feature, but a function variant -%assign cpuflags_atom (1<<22) -%assign cpuflags_bmi1 (1<<23) -%assign cpuflags_bmi2 (1<<24)|cpuflags_bmi1 -%assign cpuflags_tbm (1<<25)|cpuflags_bmi1 - -%define cpuflag(x) ((cpuflags & (cpuflags_ %+ x)) == (cpuflags_ %+ x)) -%define notcpuflag(x) ((cpuflags & (cpuflags_ %+ x)) != (cpuflags_ %+ x)) - -; Takes up to 2 cpuflags from the above list. -; All subsequent functions (up to the next INIT_CPUFLAGS) is built for the specified cpu. -; You shouldn't need to invoke this macro directly, it's a subroutine for INIT_MMX &co. -%macro INIT_CPUFLAGS 0-2 - %if %0 >= 1 - %xdefine cpuname %1 - %assign cpuflags cpuflags_%1 - %if %0 >= 2 - %xdefine cpuname %1_%2 - %assign cpuflags cpuflags | cpuflags_%2 - %endif - %xdefine SUFFIX _ %+ cpuname - %if cpuflag(AVX) - %assign AVX_enabled 1 - %endif - %if mmsize == 16 && notcpuflag(SSE2) - %define mova movaps - %define movu movups - %define movnta movntps - %endif - %if cpuflag(aligned) - %define movu mova - %elifidn %1, SSE3 - %define movu lddqu - %endif - %else - %xdefine SUFFIX - %undef cpuname - %undef cpuflags - %endif -%endmacro - -; merge MMX and SSE* - -%macro CAT_XDEFINE 3 - %xdefine %1%2 %3 -%endmacro - -%macro CAT_UNDEF 2 - %undef %1%2 -%endmacro - -%macro INIT_MMX 0-1+ - %assign AVX_enabled 0 - %define RESET_MM_PERMUTATION INIT_MMX %1 - %define mmsize 8 - %define num_mmregs 8 - %define mova movq - %define movu movq - %define movh movd - %define movnta movntq - %assign %%i 0 - %rep 8 - CAT_XDEFINE m, %%i, mm %+ %%i - CAT_XDEFINE nmm, %%i, %%i - %assign %%i %%i+1 - %endrep - %rep 8 - CAT_UNDEF m, %%i - CAT_UNDEF nmm, %%i - %assign %%i %%i+1 - %endrep - INIT_CPUFLAGS %1 -%endmacro - -%macro INIT_XMM 0-1+ - %assign AVX_enabled 0 - %define RESET_MM_PERMUTATION INIT_XMM %1 - %define mmsize 16 - %define num_mmregs 8 - %if ARCH_X86_64 - %define num_mmregs 16 - %endif - %define mova movdqa - %define movu movdqu - %define movh movq - %define movnta movntdq - %assign %%i 0 - %rep num_mmregs - CAT_XDEFINE m, %%i, xmm %+ %%i - CAT_XDEFINE nxmm, %%i, %%i - %assign %%i %%i+1 - %endrep - INIT_CPUFLAGS %1 -%endmacro - -%macro INIT_YMM 0-1+ - %assign AVX_enabled 1 - %define RESET_MM_PERMUTATION INIT_YMM %1 - %define mmsize 32 - %define num_mmregs 8 - %if ARCH_X86_64 - %define num_mmregs 16 - %endif - %define mova vmovaps - %define movu vmovups - %undef movh - %define movnta vmovntps - %assign %%i 0 - %rep num_mmregs - CAT_XDEFINE m, %%i, ymm %+ %%i - CAT_XDEFINE nymm, %%i, %%i - %assign %%i %%i+1 - %endrep - INIT_CPUFLAGS %1 -%endmacro - -INIT_XMM - -; I often want to use macros that permute their arguments. e.g. there's no -; efficient way to implement butterfly or transpose or dct without swapping some -; arguments. -; -; I would like to not have to manually keep track of the permutations: -; If I insert a permutation in the middle of a function, it should automatically -; change everything that follows. For more complex macros I may also have multiple -; implementations, e.g. the SSE2 and SSSE3 versions may have different permutations. -; -; Hence these macros. Insert a PERMUTE or some SWAPs at the end of a macro that -; permutes its arguments. It's equivalent to exchanging the contents of the -; registers, except that this way you exchange the register names instead, so it -; doesn't cost any cycles. - -%macro PERMUTE 2-* ; takes a list of pairs to swap -%rep %0/2 - %xdefine tmp%2 m%2 - %xdefine ntmp%2 nm%2 - %rotate 2 -%endrep -%rep %0/2 - %xdefine m%1 tmp%2 - %xdefine nm%1 ntmp%2 - %undef tmp%2 - %undef ntmp%2 - %rotate 2 -%endrep -%endmacro - -%macro SWAP 2-* ; swaps a single chain (sometimes more concise than pairs) -%rep %0-1 -%ifdef m%1 - %xdefine tmp m%1 - %xdefine m%1 m%2 - %xdefine m%2 tmp - CAT_XDEFINE n, m%1, %1 - CAT_XDEFINE n, m%2, %2 -%else - ; If we were called as "SWAP m0,m1" rather than "SWAP 0,1" infer the original numbers here. - ; Be careful using this mode in nested macros though, as in some cases there may be - ; other copies of m# that have already been dereferenced and don't get updated correctly. - %xdefine %%n1 n %+ %1 - %xdefine %%n2 n %+ %2 - %xdefine tmp m %+ %%n1 - CAT_XDEFINE m, %%n1, m %+ %%n2 - CAT_XDEFINE m, %%n2, tmp - CAT_XDEFINE n, m %+ %%n1, %%n1 - CAT_XDEFINE n, m %+ %%n2, %%n2 -%endif - %undef tmp - %rotate 1 -%endrep -%endmacro - -; If SAVE_MM_PERMUTATION is placed at the end of a function, then any later -; calls to that function will automatically load the permutation, so values can -; be returned in mmregs. -%macro SAVE_MM_PERMUTATION 0-1 - %if %0 - %xdefine %%f %1_m - %else - %xdefine %%f current_function %+ _m - %endif - %assign %%i 0 - %rep num_mmregs - CAT_XDEFINE %%f, %%i, m %+ %%i - %assign %%i %%i+1 - %endrep -%endmacro - -%macro LOAD_MM_PERMUTATION 1 ; name to load from - %ifdef %1_m0 - %assign %%i 0 - %rep num_mmregs - CAT_XDEFINE m, %%i, %1_m %+ %%i - CAT_XDEFINE n, m %+ %%i, %%i - %assign %%i %%i+1 - %endrep - %endif -%endmacro - -; Append cpuflags to the callee's name iff the appended name is known and the plain name isn't -%macro call 1 - call_internal %1, %1 %+ SUFFIX -%endmacro -%macro call_internal 2 - %xdefine %%i %1 - %ifndef cglobaled_%1 - %ifdef cglobaled_%2 - %xdefine %%i %2 - %endif - %endif - call %%i - LOAD_MM_PERMUTATION %%i -%endmacro - -; Substitutions that reduce instruction size but are functionally equivalent -%macro add 2 - %ifnum %2 - %if %2==128 - sub %1, -128 - %else - add %1, %2 - %endif - %else - add %1, %2 - %endif -%endmacro - -%macro sub 2 - %ifnum %2 - %if %2==128 - add %1, -128 - %else - sub %1, %2 - %endif - %else - sub %1, %2 - %endif -%endmacro - -;============================================================================= -; AVX abstraction layer -;============================================================================= - -%assign i 0 -%rep 16 - %if i < 8 - CAT_XDEFINE sizeofmm, i, 8 - %endif - CAT_XDEFINE sizeofxmm, i, 16 - CAT_XDEFINE sizeofymm, i, 32 -%assign i i+1 -%endrep -%undef i - -%macro CHECK_AVX_INSTR_EMU 3-* - %xdefine %%opcode %1 - %xdefine %%dst %2 - %rep %0-2 - %ifidn %%dst, %3 - %error non-AVX emulation of ``%%opcode'' is not supported - %endif - %rotate 1 - %endrep -%endmacro - -;%1 == instruction -;%2 == 1 if float, 0 if int -;%3 == 1 if 4-operand (xmm, xmm, xmm, imm), 0 if 2- or 3-operand (xmm, xmm, xmm) -;%4 == number of operands given -;%5+: operands -%macro RUN_AVX_INSTR 6-7+ - %ifid %6 - %define %%sizeofreg sizeof%6 - %elifid %5 - %define %%sizeofreg sizeof%5 - %else - %define %%sizeofreg mmsize - %endif - %if %%sizeofreg==32 - %if %4>=3 - v%1 %5, %6, %7 - %else - v%1 %5, %6 - %endif - %else - %if %%sizeofreg==8 - %define %%regmov movq - %elif %2 - %define %%regmov movaps - %else - %define %%regmov movdqa - %endif - - %if %4>=3+%3 - %ifnidn %5, %6 - %if AVX_enabled && %%sizeofreg==16 - v%1 %5, %6, %7 - %else - CHECK_AVX_INSTR_EMU {%1 %5, %6, %7}, %5, %7 - %%regmov %5, %6 - %1 %5, %7 - %endif - %else - %1 %5, %7 - %endif - %elif %4>=3 - %1 %5, %6, %7 - %else - %1 %5, %6 - %endif - %endif -%endmacro - -; 3arg AVX ops with a memory arg can only have it in src2, -; whereas SSE emulation of 3arg prefers to have it in src1 (i.e. the mov). -; So, if the op is symmetric and the wrong one is memory, swap them. -%macro RUN_AVX_INSTR1 8 - %assign %%swap 0 - %if AVX_enabled - %ifnid %6 - %assign %%swap 1 - %endif - %elifnidn %5, %6 - %ifnid %7 - %assign %%swap 1 - %endif - %endif - %if %%swap && %3 == 0 && %8 == 1 - RUN_AVX_INSTR %1, %2, %3, %4, %5, %7, %6 - %else - RUN_AVX_INSTR %1, %2, %3, %4, %5, %6, %7 - %endif -%endmacro - -;%1 == instruction -;%2 == 1 if float, 0 if int -;%3 == 1 if 4-operand (xmm, xmm, xmm, imm), 0 if 2- or 3-operand (xmm, xmm, xmm) -;%4 == 1 if symmetric (i.e. doesn't matter which src arg is which), 0 if not -%macro AVX_INSTR 4 - %macro %1 2-9 fnord, fnord, fnord, %1, %2, %3, %4 - %ifidn %3, fnord - RUN_AVX_INSTR %6, %7, %8, 2, %1, %2 - %elifidn %4, fnord - RUN_AVX_INSTR1 %6, %7, %8, 3, %1, %2, %3, %9 - %elifidn %5, fnord - RUN_AVX_INSTR %6, %7, %8, 4, %1, %2, %3, %4 - %else - RUN_AVX_INSTR %6, %7, %8, 5, %1, %2, %3, %4, %5 - %endif - %endmacro -%endmacro - -AVX_INSTR addpd, 1, 0, 1 -AVX_INSTR addps, 1, 0, 1 -AVX_INSTR addsd, 1, 0, 1 -AVX_INSTR addss, 1, 0, 1 -AVX_INSTR addsubpd, 1, 0, 0 -AVX_INSTR addsubps, 1, 0, 0 -AVX_INSTR andpd, 1, 0, 1 -AVX_INSTR andps, 1, 0, 1 -AVX_INSTR andnpd, 1, 0, 0 -AVX_INSTR andnps, 1, 0, 0 -AVX_INSTR blendpd, 1, 0, 0 -AVX_INSTR blendps, 1, 0, 0 -AVX_INSTR blendvpd, 1, 0, 0 -AVX_INSTR blendvps, 1, 0, 0 -AVX_INSTR cmppd, 1, 0, 0 -AVX_INSTR cmpps, 1, 0, 0 -AVX_INSTR cmpsd, 1, 0, 0 -AVX_INSTR cmpss, 1, 0, 0 -AVX_INSTR cvtdq2ps, 1, 0, 0 -AVX_INSTR cvtps2dq, 1, 0, 0 -AVX_INSTR divpd, 1, 0, 0 -AVX_INSTR divps, 1, 0, 0 -AVX_INSTR divsd, 1, 0, 0 -AVX_INSTR divss, 1, 0, 0 -AVX_INSTR dppd, 1, 1, 0 -AVX_INSTR dpps, 1, 1, 0 -AVX_INSTR haddpd, 1, 0, 0 -AVX_INSTR haddps, 1, 0, 0 -AVX_INSTR hsubpd, 1, 0, 0 -AVX_INSTR hsubps, 1, 0, 0 -AVX_INSTR maxpd, 1, 0, 1 -AVX_INSTR maxps, 1, 0, 1 -AVX_INSTR maxsd, 1, 0, 1 -AVX_INSTR maxss, 1, 0, 1 -AVX_INSTR minpd, 1, 0, 1 -AVX_INSTR minps, 1, 0, 1 -AVX_INSTR minsd, 1, 0, 1 -AVX_INSTR minss, 1, 0, 1 -AVX_INSTR movhlps, 1, 0, 0 -AVX_INSTR movlhps, 1, 0, 0 -AVX_INSTR movsd, 1, 0, 0 -AVX_INSTR movss, 1, 0, 0 -AVX_INSTR mpsadbw, 0, 1, 0 -AVX_INSTR mulpd, 1, 0, 1 -AVX_INSTR mulps, 1, 0, 1 -AVX_INSTR mulsd, 1, 0, 1 -AVX_INSTR mulss, 1, 0, 1 -AVX_INSTR orpd, 1, 0, 1 -AVX_INSTR orps, 1, 0, 1 -AVX_INSTR pabsb, 0, 0, 0 -AVX_INSTR pabsw, 0, 0, 0 -AVX_INSTR pabsd, 0, 0, 0 -AVX_INSTR packsswb, 0, 0, 0 -AVX_INSTR packssdw, 0, 0, 0 -AVX_INSTR packuswb, 0, 0, 0 -AVX_INSTR packusdw, 0, 0, 0 -AVX_INSTR paddb, 0, 0, 1 -AVX_INSTR paddw, 0, 0, 1 -AVX_INSTR paddd, 0, 0, 1 -AVX_INSTR paddq, 0, 0, 1 -AVX_INSTR paddsb, 0, 0, 1 -AVX_INSTR paddsw, 0, 0, 1 -AVX_INSTR paddusb, 0, 0, 1 -AVX_INSTR paddusw, 0, 0, 1 -AVX_INSTR palignr, 0, 1, 0 -AVX_INSTR pand, 0, 0, 1 -AVX_INSTR pandn, 0, 0, 0 -AVX_INSTR pavgb, 0, 0, 1 -AVX_INSTR pavgw, 0, 0, 1 -AVX_INSTR pblendvb, 0, 0, 0 -AVX_INSTR pblendw, 0, 1, 0 -AVX_INSTR pcmpestri, 0, 0, 0 -AVX_INSTR pcmpestrm, 0, 0, 0 -AVX_INSTR pcmpistri, 0, 0, 0 -AVX_INSTR pcmpistrm, 0, 0, 0 -AVX_INSTR pcmpeqb, 0, 0, 1 -AVX_INSTR pcmpeqw, 0, 0, 1 -AVX_INSTR pcmpeqd, 0, 0, 1 -AVX_INSTR pcmpeqq, 0, 0, 1 -AVX_INSTR pcmpgtb, 0, 0, 0 -AVX_INSTR pcmpgtw, 0, 0, 0 -AVX_INSTR pcmpgtd, 0, 0, 0 -AVX_INSTR pcmpgtq, 0, 0, 0 -AVX_INSTR phaddw, 0, 0, 0 -AVX_INSTR phaddd, 0, 0, 0 -AVX_INSTR phaddsw, 0, 0, 0 -AVX_INSTR phsubw, 0, 0, 0 -AVX_INSTR phsubd, 0, 0, 0 -AVX_INSTR phsubsw, 0, 0, 0 -AVX_INSTR pmaddwd, 0, 0, 1 -AVX_INSTR pmaddubsw, 0, 0, 0 -AVX_INSTR pmaxsb, 0, 0, 1 -AVX_INSTR pmaxsw, 0, 0, 1 -AVX_INSTR pmaxsd, 0, 0, 1 -AVX_INSTR pmaxub, 0, 0, 1 -AVX_INSTR pmaxuw, 0, 0, 1 -AVX_INSTR pmaxud, 0, 0, 1 -AVX_INSTR pminsb, 0, 0, 1 -AVX_INSTR pminsw, 0, 0, 1 -AVX_INSTR pminsd, 0, 0, 1 -AVX_INSTR pminub, 0, 0, 1 -AVX_INSTR pminuw, 0, 0, 1 -AVX_INSTR pminud, 0, 0, 1 -AVX_INSTR pmovmskb, 0, 0, 0 -AVX_INSTR pmulhuw, 0, 0, 1 -AVX_INSTR pmulhrsw, 0, 0, 1 -AVX_INSTR pmulhw, 0, 0, 1 -AVX_INSTR pmullw, 0, 0, 1 -AVX_INSTR pmulld, 0, 0, 1 -AVX_INSTR pmuludq, 0, 0, 1 -AVX_INSTR pmuldq, 0, 0, 1 -AVX_INSTR por, 0, 0, 1 -AVX_INSTR psadbw, 0, 0, 1 -AVX_INSTR pshufb, 0, 0, 0 -AVX_INSTR pshufd, 0, 1, 0 -AVX_INSTR pshufhw, 0, 1, 0 -AVX_INSTR pshuflw, 0, 1, 0 -AVX_INSTR psignb, 0, 0, 0 -AVX_INSTR psignw, 0, 0, 0 -AVX_INSTR psignd, 0, 0, 0 -AVX_INSTR psllw, 0, 0, 0 -AVX_INSTR pslld, 0, 0, 0 -AVX_INSTR psllq, 0, 0, 0 -AVX_INSTR pslldq, 0, 0, 0 -AVX_INSTR psraw, 0, 0, 0 -AVX_INSTR psrad, 0, 0, 0 -AVX_INSTR psrlw, 0, 0, 0 -AVX_INSTR psrld, 0, 0, 0 -AVX_INSTR psrlq, 0, 0, 0 -AVX_INSTR psrldq, 0, 0, 0 -AVX_INSTR psubb, 0, 0, 0 -AVX_INSTR psubw, 0, 0, 0 -AVX_INSTR psubd, 0, 0, 0 -AVX_INSTR psubq, 0, 0, 0 -AVX_INSTR psubsb, 0, 0, 0 -AVX_INSTR psubsw, 0, 0, 0 -AVX_INSTR psubusb, 0, 0, 0 -AVX_INSTR psubusw, 0, 0, 0 -AVX_INSTR ptest, 0, 0, 0 -AVX_INSTR punpckhbw, 0, 0, 0 -AVX_INSTR punpckhwd, 0, 0, 0 -AVX_INSTR punpckhdq, 0, 0, 0 -AVX_INSTR punpckhqdq, 0, 0, 0 -AVX_INSTR punpcklbw, 0, 0, 0 -AVX_INSTR punpcklwd, 0, 0, 0 -AVX_INSTR punpckldq, 0, 0, 0 -AVX_INSTR punpcklqdq, 0, 0, 0 -AVX_INSTR pxor, 0, 0, 1 -AVX_INSTR shufps, 1, 1, 0 -AVX_INSTR subpd, 1, 0, 0 -AVX_INSTR subps, 1, 0, 0 -AVX_INSTR subsd, 1, 0, 0 -AVX_INSTR subss, 1, 0, 0 -AVX_INSTR unpckhpd, 1, 0, 0 -AVX_INSTR unpckhps, 1, 0, 0 -AVX_INSTR unpcklpd, 1, 0, 0 -AVX_INSTR unpcklps, 1, 0, 0 -AVX_INSTR xorpd, 1, 0, 1 -AVX_INSTR xorps, 1, 0, 1 - -; 3DNow instructions, for sharing code between AVX, SSE and 3DN -AVX_INSTR pfadd, 1, 0, 1 -AVX_INSTR pfsub, 1, 0, 0 -AVX_INSTR pfmul, 1, 0, 1 - -; base-4 constants for shuffles -%assign i 0 -%rep 256 - %assign j ((i>>6)&3)*1000 + ((i>>4)&3)*100 + ((i>>2)&3)*10 + (i&3) - %if j < 10 - CAT_XDEFINE q000, j, i - %elif j < 100 - CAT_XDEFINE q00, j, i - %elif j < 1000 - CAT_XDEFINE q0, j, i - %else - CAT_XDEFINE q, j, i - %endif -%assign i i+1 -%endrep -%undef i -%undef j - -%macro FMA_INSTR 3 - %macro %1 4-7 %1, %2, %3 - %if cpuflag(xop) - v%5 %1, %2, %3, %4 - %else - %6 %1, %2, %3 - %7 %1, %4 - %endif - %endmacro -%endmacro - -FMA_INSTR pmacsdd, pmulld, paddd -FMA_INSTR pmacsww, pmullw, paddw -FMA_INSTR pmadcswd, pmaddwd, paddd - -; tzcnt is equivalent to "rep bsf" and is backwards-compatible with bsf. -; This lets us use tzcnt without bumping the yasm version requirement yet. -%define tzcnt rep bsf diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/x86inc/x86inc.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/x86inc/x86inc.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/third_party/x86inc/x86inc.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/third_party/x86inc/x86inc.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,1231 +0,0 @@ -;***************************************************************************** -;* x86inc.asm: x264asm abstraction layer -;***************************************************************************** -;* Copyright (C) 2005-2012 x264 project -;* -;* Authors: Loren Merritt -;* Anton Mitrofanov -;* Jason Garrett-Glaser -;* Henrik Gramner -;* -;* Permission to use, copy, modify, and/or distribute this software for any -;* purpose with or without fee is hereby granted, provided that the above -;* copyright notice and this permission notice appear in all copies. -;* -;* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -;* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -;* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -;* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -;* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -;* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -;* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -;***************************************************************************** - -; This is a header file for the x264ASM assembly language, which uses -; NASM/YASM syntax combined with a large number of macros to provide easy -; abstraction between different calling conventions (x86_32, win64, linux64). -; It also has various other useful features to simplify writing the kind of -; DSP functions that are most often used in x264. - -; Unlike the rest of x264, this file is available under an ISC license, as it -; has significant usefulness outside of x264 and we want it to be available -; to the largest audience possible. Of course, if you modify it for your own -; purposes to add a new feature, we strongly encourage contributing a patch -; as this feature might be useful for others as well. Send patches or ideas -; to x264-devel@videolan.org . - -%include "vpx_config.asm" - -%define program_name vp9 - - -%define UNIX64 0 -%define WIN64 0 -%if ARCH_X86_64 - %ifidn __OUTPUT_FORMAT__,win32 - %define WIN64 1 - %elifidn __OUTPUT_FORMAT__,win64 - %define WIN64 1 - %elifidn __OUTPUT_FORMAT__,x64 - %define WIN64 1 - %else - %define UNIX64 1 - %endif -%endif - -%ifidn __OUTPUT_FORMAT__,elf32 - %define mangle(x) x -%elifidn __OUTPUT_FORMAT__,elf64 - %define mangle(x) x -%elifidn __OUTPUT_FORMAT__,elf - %define mangle(x) x -%elifidn __OUTPUT_FORMAT__,x64 - %define mangle(x) x -%elifidn __OUTPUT_FORMAT__,win64 - %define mangle(x) x -%else - %define mangle(x) _ %+ x -%endif - -; FIXME: All of the 64bit asm functions that take a stride as an argument -; via register, assume that the high dword of that register is filled with 0. -; This is true in practice (since we never do any 64bit arithmetic on strides, -; and x264's strides are all positive), but is not guaranteed by the ABI. - -; Name of the .rodata section. -; Kludge: Something on OS X fails to align .rodata even given an align attribute, -; so use a different read-only section. -%macro SECTION_RODATA 0-1 16 - %ifidn __OUTPUT_FORMAT__,macho64 - SECTION .text align=%1 - %elifidn __OUTPUT_FORMAT__,macho32 - SECTION .text align=%1 - fakegot: - %elifidn __OUTPUT_FORMAT__,macho - SECTION .text align=%1 - fakegot: - %elifidn __OUTPUT_FORMAT__,aout - section .text - %else - SECTION .rodata align=%1 - %endif -%endmacro - -; aout does not support align= -%macro SECTION_TEXT 0-1 16 - %ifidn __OUTPUT_FORMAT__,aout - SECTION .text - %else - SECTION .text align=%1 - %endif -%endmacro - -; PIC macros are copied from vpx_ports/x86_abi_support.asm. The "define PIC" -; from original code is added in for 64bit. -%ifidn __OUTPUT_FORMAT__,elf32 -%define ABI_IS_32BIT 1 -%elifidn __OUTPUT_FORMAT__,macho32 -%define ABI_IS_32BIT 1 -%elifidn __OUTPUT_FORMAT__,win32 -%define ABI_IS_32BIT 1 -%elifidn __OUTPUT_FORMAT__,aout -%define ABI_IS_32BIT 1 -%else -%define ABI_IS_32BIT 0 -%endif - -%if ABI_IS_32BIT - %if CONFIG_PIC=1 - %ifidn __OUTPUT_FORMAT__,elf32 - %define GET_GOT_SAVE_ARG 1 - %define WRT_PLT wrt ..plt - %macro GET_GOT 1 - extern _GLOBAL_OFFSET_TABLE_ - push %1 - call %%get_got - %%sub_offset: - jmp %%exitGG - %%get_got: - mov %1, [esp] - add %1, _GLOBAL_OFFSET_TABLE_ + $$ - %%sub_offset wrt ..gotpc - ret - %%exitGG: - %undef GLOBAL - %define GLOBAL(x) x + %1 wrt ..gotoff - %undef RESTORE_GOT - %define RESTORE_GOT pop %1 - %endmacro - %elifidn __OUTPUT_FORMAT__,macho32 - %define GET_GOT_SAVE_ARG 1 - %macro GET_GOT 1 - push %1 - call %%get_got - %%get_got: - pop %1 - %undef GLOBAL - %define GLOBAL(x) x + %1 - %%get_got - %undef RESTORE_GOT - %define RESTORE_GOT pop %1 - %endmacro - %endif - %endif - - %if ARCH_X86_64 == 0 - %undef PIC - %endif - -%else - %macro GET_GOT 1 - %endmacro - %define GLOBAL(x) rel x - %define WRT_PLT wrt ..plt - - %if WIN64 - %define PIC - %elifidn __OUTPUT_FORMAT__,macho64 - %define PIC - %elif CONFIG_PIC - %define PIC - %endif -%endif - -%ifnmacro GET_GOT - %macro GET_GOT 1 - %endmacro - %define GLOBAL(x) x -%endif -%ifndef RESTORE_GOT -%define RESTORE_GOT -%endif -%ifndef WRT_PLT -%define WRT_PLT -%endif - -%ifdef PIC - default rel -%endif -; Done with PIC macros - -; Always use long nops (reduces 0x90 spam in disassembly on x86_32) -%ifndef __NASM_VER__ -CPU amdnop -%else -%use smartalign -ALIGNMODE k7 -%endif - -; Macros to eliminate most code duplication between x86_32 and x86_64: -; Currently this works only for leaf functions which load all their arguments -; into registers at the start, and make no other use of the stack. Luckily that -; covers most of x264's asm. - -; PROLOGUE: -; %1 = number of arguments. loads them from stack if needed. -; %2 = number of registers used. pushes callee-saved regs if needed. -; %3 = number of xmm registers used. pushes callee-saved xmm regs if needed. -; %4 = list of names to define to registers -; PROLOGUE can also be invoked by adding the same options to cglobal - -; e.g. -; cglobal foo, 2,3,0, dst, src, tmp -; declares a function (foo), taking two args (dst and src) and one local variable (tmp) - -; TODO Some functions can use some args directly from the stack. If they're the -; last args then you can just not declare them, but if they're in the middle -; we need more flexible macro. - -; RET: -; Pops anything that was pushed by PROLOGUE, and returns. - -; REP_RET: -; Same, but if it doesn't pop anything it becomes a 2-byte ret, for athlons -; which are slow when a normal ret follows a branch. - -; registers: -; rN and rNq are the native-size register holding function argument N -; rNd, rNw, rNb are dword, word, and byte size -; rNm is the original location of arg N (a register or on the stack), dword -; rNmp is native size - -%macro DECLARE_REG 5-6 - %define r%1q %2 - %define r%1d %3 - %define r%1w %4 - %define r%1b %5 - %if %0 == 5 - %define r%1m %3 - %define r%1mp %2 - %elif ARCH_X86_64 ; memory - %define r%1m [rsp + stack_offset + %6] - %define r%1mp qword r %+ %1 %+ m - %else - %define r%1m [esp + stack_offset + %6] - %define r%1mp dword r %+ %1 %+ m - %endif - %define r%1 %2 -%endmacro - -%macro DECLARE_REG_SIZE 2 - %define r%1q r%1 - %define e%1q r%1 - %define r%1d e%1 - %define e%1d e%1 - %define r%1w %1 - %define e%1w %1 - %define r%1b %2 - %define e%1b %2 -%if ARCH_X86_64 == 0 - %define r%1 e%1 -%endif -%endmacro - -DECLARE_REG_SIZE ax, al -DECLARE_REG_SIZE bx, bl -DECLARE_REG_SIZE cx, cl -DECLARE_REG_SIZE dx, dl -DECLARE_REG_SIZE si, sil -DECLARE_REG_SIZE di, dil -DECLARE_REG_SIZE bp, bpl - -; t# defines for when per-arch register allocation is more complex than just function arguments - -%macro DECLARE_REG_TMP 1-* - %assign %%i 0 - %rep %0 - CAT_XDEFINE t, %%i, r%1 - %assign %%i %%i+1 - %rotate 1 - %endrep -%endmacro - -%macro DECLARE_REG_TMP_SIZE 0-* - %rep %0 - %define t%1q t%1 %+ q - %define t%1d t%1 %+ d - %define t%1w t%1 %+ w - %define t%1b t%1 %+ b - %rotate 1 - %endrep -%endmacro - -DECLARE_REG_TMP_SIZE 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14 - -%if ARCH_X86_64 - %define gprsize 8 -%else - %define gprsize 4 -%endif - -%macro PUSH 1 - push %1 - %assign stack_offset stack_offset+gprsize -%endmacro - -%macro POP 1 - pop %1 - %assign stack_offset stack_offset-gprsize -%endmacro - -%macro PUSH_IF_USED 1-* - %rep %0 - %if %1 < regs_used - PUSH r%1 - %endif - %rotate 1 - %endrep -%endmacro - -%macro POP_IF_USED 1-* - %rep %0 - %if %1 < regs_used - pop r%1 - %endif - %rotate 1 - %endrep -%endmacro - -%macro LOAD_IF_USED 1-* - %rep %0 - %if %1 < num_args - mov r%1, r %+ %1 %+ mp - %endif - %rotate 1 - %endrep -%endmacro - -%macro SUB 2 - sub %1, %2 - %ifidn %1, rsp - %assign stack_offset stack_offset+(%2) - %endif -%endmacro - -%macro ADD 2 - add %1, %2 - %ifidn %1, rsp - %assign stack_offset stack_offset-(%2) - %endif -%endmacro - -%macro movifnidn 2 - %ifnidn %1, %2 - mov %1, %2 - %endif -%endmacro - -%macro movsxdifnidn 2 - %ifnidn %1, %2 - movsxd %1, %2 - %endif -%endmacro - -%macro ASSERT 1 - %if (%1) == 0 - %error assert failed - %endif -%endmacro - -%macro DEFINE_ARGS 0-* - %ifdef n_arg_names - %assign %%i 0 - %rep n_arg_names - CAT_UNDEF arg_name %+ %%i, q - CAT_UNDEF arg_name %+ %%i, d - CAT_UNDEF arg_name %+ %%i, w - CAT_UNDEF arg_name %+ %%i, b - CAT_UNDEF arg_name %+ %%i, m - CAT_UNDEF arg_name %+ %%i, mp - CAT_UNDEF arg_name, %%i - %assign %%i %%i+1 - %endrep - %endif - - %xdefine %%stack_offset stack_offset - %undef stack_offset ; so that the current value of stack_offset doesn't get baked in by xdefine - %assign %%i 0 - %rep %0 - %xdefine %1q r %+ %%i %+ q - %xdefine %1d r %+ %%i %+ d - %xdefine %1w r %+ %%i %+ w - %xdefine %1b r %+ %%i %+ b - %xdefine %1m r %+ %%i %+ m - %xdefine %1mp r %+ %%i %+ mp - CAT_XDEFINE arg_name, %%i, %1 - %assign %%i %%i+1 - %rotate 1 - %endrep - %xdefine stack_offset %%stack_offset - %assign n_arg_names %0 -%endmacro - -%if ARCH_X86_64 -%macro ALLOC_STACK 2 ; stack_size, num_regs - %assign %%stack_aligment ((mmsize + 15) & ~15) - %assign stack_size_padded %1 - - %assign %%reg_num (%2 - 1) - %xdefine rsp_tmp r %+ %%reg_num - mov rsp_tmp, rsp - sub rsp, stack_size_padded - and rsp, ~(%%stack_aligment - 1) -%endmacro - -%macro RESTORE_STACK 0 ; reset rsp register - mov rsp, rsp_tmp -%endmacro -%endif - -%if WIN64 ; Windows x64 ;================================================= - -DECLARE_REG 0, rcx, ecx, cx, cl -DECLARE_REG 1, rdx, edx, dx, dl -DECLARE_REG 2, R8, R8D, R8W, R8B -DECLARE_REG 3, R9, R9D, R9W, R9B -DECLARE_REG 4, R10, R10D, R10W, R10B, 40 -DECLARE_REG 5, R11, R11D, R11W, R11B, 48 -DECLARE_REG 6, rax, eax, ax, al, 56 -DECLARE_REG 7, rdi, edi, di, dil, 64 -DECLARE_REG 8, rsi, esi, si, sil, 72 -DECLARE_REG 9, rbx, ebx, bx, bl, 80 -DECLARE_REG 10, rbp, ebp, bp, bpl, 88 -DECLARE_REG 11, R12, R12D, R12W, R12B, 96 -DECLARE_REG 12, R13, R13D, R13W, R13B, 104 -DECLARE_REG 13, R14, R14D, R14W, R14B, 112 -DECLARE_REG 14, R15, R15D, R15W, R15B, 120 - -%macro PROLOGUE 2-4+ 0 ; #args, #regs, #xmm_regs, arg_names... - %assign num_args %1 - %assign regs_used %2 - ASSERT regs_used >= num_args - ASSERT regs_used <= 15 - PUSH_IF_USED 7, 8, 9, 10, 11, 12, 13, 14 - %if mmsize == 8 - %assign xmm_regs_used 0 - %else - WIN64_SPILL_XMM %3 - %endif - LOAD_IF_USED 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 - DEFINE_ARGS %4 -%endmacro - -%macro WIN64_SPILL_XMM 1 - %assign xmm_regs_used %1 - ASSERT xmm_regs_used <= 16 - %if xmm_regs_used > 6 - SUB rsp, (xmm_regs_used-6)*16+16 - %assign %%i xmm_regs_used - %rep (xmm_regs_used-6) - %assign %%i %%i-1 - movdqa [rsp + (%%i-6)*16+(~stack_offset&8)], xmm %+ %%i - %endrep - %endif -%endmacro - -%macro WIN64_RESTORE_XMM_INTERNAL 1 - %if xmm_regs_used > 6 - %assign %%i xmm_regs_used - %rep (xmm_regs_used-6) - %assign %%i %%i-1 - movdqa xmm %+ %%i, [%1 + (%%i-6)*16+(~stack_offset&8)] - %endrep - add %1, (xmm_regs_used-6)*16+16 - %endif -%endmacro - -%macro WIN64_RESTORE_XMM 1 - WIN64_RESTORE_XMM_INTERNAL %1 - %assign stack_offset stack_offset-(xmm_regs_used-6)*16+16 - %assign xmm_regs_used 0 -%endmacro - -%macro RET 0 - WIN64_RESTORE_XMM_INTERNAL rsp - POP_IF_USED 14, 13, 12, 11, 10, 9, 8, 7 - ret -%endmacro - -%macro REP_RET 0 - %if regs_used > 7 || xmm_regs_used > 6 - RET - %else - rep ret - %endif -%endmacro - -%elif ARCH_X86_64 ; *nix x64 ;============================================= - -DECLARE_REG 0, rdi, edi, di, dil -DECLARE_REG 1, rsi, esi, si, sil -DECLARE_REG 2, rdx, edx, dx, dl -DECLARE_REG 3, rcx, ecx, cx, cl -DECLARE_REG 4, R8, R8D, R8W, R8B -DECLARE_REG 5, R9, R9D, R9W, R9B -DECLARE_REG 6, rax, eax, ax, al, 8 -DECLARE_REG 7, R10, R10D, R10W, R10B, 16 -DECLARE_REG 8, R11, R11D, R11W, R11B, 24 -DECLARE_REG 9, rbx, ebx, bx, bl, 32 -DECLARE_REG 10, rbp, ebp, bp, bpl, 40 -DECLARE_REG 11, R12, R12D, R12W, R12B, 48 -DECLARE_REG 12, R13, R13D, R13W, R13B, 56 -DECLARE_REG 13, R14, R14D, R14W, R14B, 64 -DECLARE_REG 14, R15, R15D, R15W, R15B, 72 - -%macro PROLOGUE 2-4+ ; #args, #regs, #xmm_regs, arg_names... - %assign num_args %1 - %assign regs_used %2 - ASSERT regs_used >= num_args - ASSERT regs_used <= 15 - PUSH_IF_USED 9, 10, 11, 12, 13, 14 - LOAD_IF_USED 6, 7, 8, 9, 10, 11, 12, 13, 14 - DEFINE_ARGS %4 -%endmacro - -%macro RET 0 - POP_IF_USED 14, 13, 12, 11, 10, 9 - ret -%endmacro - -%macro REP_RET 0 - %if regs_used > 9 - RET - %else - rep ret - %endif -%endmacro - -%else ; X86_32 ;============================================================== - -DECLARE_REG 0, eax, eax, ax, al, 4 -DECLARE_REG 1, ecx, ecx, cx, cl, 8 -DECLARE_REG 2, edx, edx, dx, dl, 12 -DECLARE_REG 3, ebx, ebx, bx, bl, 16 -DECLARE_REG 4, esi, esi, si, null, 20 -DECLARE_REG 5, edi, edi, di, null, 24 -DECLARE_REG 6, ebp, ebp, bp, null, 28 -%define rsp esp - -%macro DECLARE_ARG 1-* - %rep %0 - %define r%1m [esp + stack_offset + 4*%1 + 4] - %define r%1mp dword r%1m - %rotate 1 - %endrep -%endmacro - -DECLARE_ARG 7, 8, 9, 10, 11, 12, 13, 14 - -%macro PROLOGUE 2-4+ ; #args, #regs, #xmm_regs, arg_names... - %assign num_args %1 - %assign regs_used %2 - %if regs_used > 7 - %assign regs_used 7 - %endif - ASSERT regs_used >= num_args - PUSH_IF_USED 3, 4, 5, 6 - LOAD_IF_USED 0, 1, 2, 3, 4, 5, 6 - DEFINE_ARGS %4 -%endmacro - -%macro RET 0 - POP_IF_USED 6, 5, 4, 3 - ret -%endmacro - -%macro REP_RET 0 - %if regs_used > 3 - RET - %else - rep ret - %endif -%endmacro - -%endif ;====================================================================== - -%if WIN64 == 0 -%macro WIN64_SPILL_XMM 1 -%endmacro -%macro WIN64_RESTORE_XMM 1 -%endmacro -%endif - -;============================================================================= -; arch-independent part -;============================================================================= - -%assign function_align 16 - -; Begin a function. -; Applies any symbol mangling needed for C linkage, and sets up a define such that -; subsequent uses of the function name automatically refer to the mangled version. -; Appends cpuflags to the function name if cpuflags has been specified. -%macro cglobal 1-2+ ; name, [PROLOGUE args] -%if %0 == 1 - cglobal_internal %1 %+ SUFFIX -%else - cglobal_internal %1 %+ SUFFIX, %2 -%endif -%endmacro -%macro cglobal_internal 1-2+ - %ifndef cglobaled_%1 - %xdefine %1 mangle(program_name %+ _ %+ %1) - %xdefine %1.skip_prologue %1 %+ .skip_prologue - CAT_XDEFINE cglobaled_, %1, 1 - %endif - %xdefine current_function %1 - %ifdef CHROMIUM - %ifidn __OUTPUT_FORMAT__,elf - global %1:function hidden - %elifidn __OUTPUT_FORMAT__,elf32 - global %1:function hidden - %elifidn __OUTPUT_FORMAT__,elf64 - global %1:function hidden - %elifidn __OUTPUT_FORMAT__,macho32 - %ifdef __NASM_VER__ - global %1 - %else - global %1:private_extern - %endif - %elifidn __OUTPUT_FORMAT__,macho64 - %ifdef __NASM_VER__ - global %1 - %else - global %1:private_extern - %endif - %else - global %1 - %endif - %else - global %1 - %endif - align function_align - %1: - RESET_MM_PERMUTATION ; not really needed, but makes disassembly somewhat nicer - %assign stack_offset 0 - %if %0 > 1 - PROLOGUE %2 - %endif -%endmacro - -%macro cextern 1 - %xdefine %1 mangle(program_name %+ _ %+ %1) - CAT_XDEFINE cglobaled_, %1, 1 - extern %1 -%endmacro - -; like cextern, but without the prefix -%macro cextern_naked 1 - %xdefine %1 mangle(%1) - CAT_XDEFINE cglobaled_, %1, 1 - extern %1 -%endmacro - -%macro const 2+ - %xdefine %1 mangle(program_name %+ _ %+ %1) - global %1 - %1: %2 -%endmacro - -; This is needed for ELF, otherwise the GNU linker assumes the stack is -; executable by default. -%ifidn __OUTPUT_FORMAT__,elf -SECTION .note.GNU-stack noalloc noexec nowrite progbits -%elifidn __OUTPUT_FORMAT__,elf32 -SECTION .note.GNU-stack noalloc noexec nowrite progbits -%elifidn __OUTPUT_FORMAT__,elf64 -SECTION .note.GNU-stack noalloc noexec nowrite progbits -%endif - -; cpuflags - -%assign cpuflags_mmx (1<<0) -%assign cpuflags_mmx2 (1<<1) | cpuflags_mmx -%assign cpuflags_3dnow (1<<2) | cpuflags_mmx -%assign cpuflags_3dnow2 (1<<3) | cpuflags_3dnow -%assign cpuflags_sse (1<<4) | cpuflags_mmx2 -%assign cpuflags_sse2 (1<<5) | cpuflags_sse -%assign cpuflags_sse2slow (1<<6) | cpuflags_sse2 -%assign cpuflags_sse3 (1<<7) | cpuflags_sse2 -%assign cpuflags_ssse3 (1<<8) | cpuflags_sse3 -%assign cpuflags_sse4 (1<<9) | cpuflags_ssse3 -%assign cpuflags_sse42 (1<<10)| cpuflags_sse4 -%assign cpuflags_avx (1<<11)| cpuflags_sse42 -%assign cpuflags_xop (1<<12)| cpuflags_avx -%assign cpuflags_fma4 (1<<13)| cpuflags_avx - -%assign cpuflags_cache32 (1<<16) -%assign cpuflags_cache64 (1<<17) -%assign cpuflags_slowctz (1<<18) -%assign cpuflags_lzcnt (1<<19) -%assign cpuflags_misalign (1<<20) -%assign cpuflags_aligned (1<<21) ; not a cpu feature, but a function variant -%assign cpuflags_atom (1<<22) - -%define cpuflag(x) ((cpuflags & (cpuflags_ %+ x)) == (cpuflags_ %+ x)) -%define notcpuflag(x) ((cpuflags & (cpuflags_ %+ x)) != (cpuflags_ %+ x)) - -; Takes up to 2 cpuflags from the above list. -; All subsequent functions (up to the next INIT_CPUFLAGS) is built for the specified cpu. -; You shouldn't need to invoke this macro directly, it's a subroutine for INIT_MMX &co. -%macro INIT_CPUFLAGS 0-2 - %if %0 >= 1 - %xdefine cpuname %1 - %assign cpuflags cpuflags_%1 - %if %0 >= 2 - %xdefine cpuname %1_%2 - %assign cpuflags cpuflags | cpuflags_%2 - %endif - %xdefine SUFFIX _ %+ cpuname - %if cpuflag(avx) - %assign avx_enabled 1 - %endif - %if mmsize == 16 && notcpuflag(sse2) - %define mova movaps - %define movu movups - %define movnta movntps - %endif - %if cpuflag(aligned) - %define movu mova - %elifidn %1, sse3 - %define movu lddqu - %endif - %else - %xdefine SUFFIX - %undef cpuname - %undef cpuflags - %endif -%endmacro - -; merge mmx and sse* - -%macro CAT_XDEFINE 3 - %xdefine %1%2 %3 -%endmacro - -%macro CAT_UNDEF 2 - %undef %1%2 -%endmacro - -%macro INIT_MMX 0-1+ - %assign avx_enabled 0 - %define RESET_MM_PERMUTATION INIT_MMX %1 - %define mmsize 8 - %define num_mmregs 8 - %define mova movq - %define movu movq - %define movh movd - %define movnta movntq - %assign %%i 0 - %rep 8 - CAT_XDEFINE m, %%i, mm %+ %%i - CAT_XDEFINE nmm, %%i, %%i - %assign %%i %%i+1 - %endrep - %rep 8 - CAT_UNDEF m, %%i - CAT_UNDEF nmm, %%i - %assign %%i %%i+1 - %endrep - INIT_CPUFLAGS %1 -%endmacro - -%macro INIT_XMM 0-1+ - %assign avx_enabled 0 - %define RESET_MM_PERMUTATION INIT_XMM %1 - %define mmsize 16 - %define num_mmregs 8 - %if ARCH_X86_64 - %define num_mmregs 16 - %endif - %define mova movdqa - %define movu movdqu - %define movh movq - %define movnta movntdq - %assign %%i 0 - %rep num_mmregs - CAT_XDEFINE m, %%i, xmm %+ %%i - CAT_XDEFINE nxmm, %%i, %%i - %assign %%i %%i+1 - %endrep - INIT_CPUFLAGS %1 -%endmacro - -; FIXME: INIT_AVX can be replaced by INIT_XMM avx -%macro INIT_AVX 0 - INIT_XMM - %assign avx_enabled 1 - %define PALIGNR PALIGNR_SSSE3 - %define RESET_MM_PERMUTATION INIT_AVX -%endmacro - -%macro INIT_YMM 0-1+ - %assign avx_enabled 1 - %define RESET_MM_PERMUTATION INIT_YMM %1 - %define mmsize 32 - %define num_mmregs 8 - %if ARCH_X86_64 - %define num_mmregs 16 - %endif - %define mova vmovaps - %define movu vmovups - %undef movh - %define movnta vmovntps - %assign %%i 0 - %rep num_mmregs - CAT_XDEFINE m, %%i, ymm %+ %%i - CAT_XDEFINE nymm, %%i, %%i - %assign %%i %%i+1 - %endrep - INIT_CPUFLAGS %1 -%endmacro - -INIT_XMM - -; I often want to use macros that permute their arguments. e.g. there's no -; efficient way to implement butterfly or transpose or dct without swapping some -; arguments. -; -; I would like to not have to manually keep track of the permutations: -; If I insert a permutation in the middle of a function, it should automatically -; change everything that follows. For more complex macros I may also have multiple -; implementations, e.g. the SSE2 and SSSE3 versions may have different permutations. -; -; Hence these macros. Insert a PERMUTE or some SWAPs at the end of a macro that -; permutes its arguments. It's equivalent to exchanging the contents of the -; registers, except that this way you exchange the register names instead, so it -; doesn't cost any cycles. - -%macro PERMUTE 2-* ; takes a list of pairs to swap -%rep %0/2 - %xdefine tmp%2 m%2 - %xdefine ntmp%2 nm%2 - %rotate 2 -%endrep -%rep %0/2 - %xdefine m%1 tmp%2 - %xdefine nm%1 ntmp%2 - %undef tmp%2 - %undef ntmp%2 - %rotate 2 -%endrep -%endmacro - -%macro SWAP 2-* ; swaps a single chain (sometimes more concise than pairs) -%rep %0-1 -%ifdef m%1 - %xdefine tmp m%1 - %xdefine m%1 m%2 - %xdefine m%2 tmp - CAT_XDEFINE n, m%1, %1 - CAT_XDEFINE n, m%2, %2 -%else - ; If we were called as "SWAP m0,m1" rather than "SWAP 0,1" infer the original numbers here. - ; Be careful using this mode in nested macros though, as in some cases there may be - ; other copies of m# that have already been dereferenced and don't get updated correctly. - %xdefine %%n1 n %+ %1 - %xdefine %%n2 n %+ %2 - %xdefine tmp m %+ %%n1 - CAT_XDEFINE m, %%n1, m %+ %%n2 - CAT_XDEFINE m, %%n2, tmp - CAT_XDEFINE n, m %+ %%n1, %%n1 - CAT_XDEFINE n, m %+ %%n2, %%n2 -%endif - %undef tmp - %rotate 1 -%endrep -%endmacro - -; If SAVE_MM_PERMUTATION is placed at the end of a function, then any later -; calls to that function will automatically load the permutation, so values can -; be returned in mmregs. -%macro SAVE_MM_PERMUTATION 0-1 - %if %0 - %xdefine %%f %1_m - %else - %xdefine %%f current_function %+ _m - %endif - %assign %%i 0 - %rep num_mmregs - CAT_XDEFINE %%f, %%i, m %+ %%i - %assign %%i %%i+1 - %endrep -%endmacro - -%macro LOAD_MM_PERMUTATION 1 ; name to load from - %ifdef %1_m0 - %assign %%i 0 - %rep num_mmregs - CAT_XDEFINE m, %%i, %1_m %+ %%i - CAT_XDEFINE n, m %+ %%i, %%i - %assign %%i %%i+1 - %endrep - %endif -%endmacro - -; Append cpuflags to the callee's name iff the appended name is known and the plain name isn't -%macro call 1 - call_internal %1, %1 %+ SUFFIX -%endmacro -%macro call_internal 2 - %xdefine %%i %1 - %ifndef cglobaled_%1 - %ifdef cglobaled_%2 - %xdefine %%i %2 - %endif - %endif - call %%i - LOAD_MM_PERMUTATION %%i -%endmacro - -; Substitutions that reduce instruction size but are functionally equivalent -%macro add 2 - %ifnum %2 - %if %2==128 - sub %1, -128 - %else - add %1, %2 - %endif - %else - add %1, %2 - %endif -%endmacro - -%macro sub 2 - %ifnum %2 - %if %2==128 - add %1, -128 - %else - sub %1, %2 - %endif - %else - sub %1, %2 - %endif -%endmacro - -;============================================================================= -; AVX abstraction layer -;============================================================================= - -%assign i 0 -%rep 16 - %if i < 8 - CAT_XDEFINE sizeofmm, i, 8 - %endif - CAT_XDEFINE sizeofxmm, i, 16 - CAT_XDEFINE sizeofymm, i, 32 -%assign i i+1 -%endrep -%undef i - -;%1 == instruction -;%2 == 1 if float, 0 if int -;%3 == 1 if 4-operand (xmm, xmm, xmm, imm), 0 if 2- or 3-operand (xmm, xmm, xmm) -;%4 == number of operands given -;%5+: operands -%macro RUN_AVX_INSTR 6-7+ - %ifid %5 - %define %%size sizeof%5 - %else - %define %%size mmsize - %endif - %if %%size==32 - %if %0 >= 7 - v%1 %5, %6, %7 - %else - v%1 %5, %6 - %endif - %else - %if %%size==8 - %define %%regmov movq - %elif %2 - %define %%regmov movaps - %else - %define %%regmov movdqa - %endif - - %if %4>=3+%3 - %ifnidn %5, %6 - %if avx_enabled && sizeof%5==16 - v%1 %5, %6, %7 - %else - %%regmov %5, %6 - %1 %5, %7 - %endif - %else - %1 %5, %7 - %endif - %elif %3 - %1 %5, %6, %7 - %else - %1 %5, %6 - %endif - %endif -%endmacro - -; 3arg AVX ops with a memory arg can only have it in src2, -; whereas SSE emulation of 3arg prefers to have it in src1 (i.e. the mov). -; So, if the op is symmetric and the wrong one is memory, swap them. -%macro RUN_AVX_INSTR1 8 - %assign %%swap 0 - %if avx_enabled - %ifnid %6 - %assign %%swap 1 - %endif - %elifnidn %5, %6 - %ifnid %7 - %assign %%swap 1 - %endif - %endif - %if %%swap && %3 == 0 && %8 == 1 - RUN_AVX_INSTR %1, %2, %3, %4, %5, %7, %6 - %else - RUN_AVX_INSTR %1, %2, %3, %4, %5, %6, %7 - %endif -%endmacro - -;%1 == instruction -;%2 == 1 if float, 0 if int -;%3 == 1 if 4-operand (xmm, xmm, xmm, imm), 0 if 3-operand (xmm, xmm, xmm) -;%4 == 1 if symmetric (i.e. doesn't matter which src arg is which), 0 if not -%macro AVX_INSTR 4 - %macro %1 2-9 fnord, fnord, fnord, %1, %2, %3, %4 - %ifidn %3, fnord - RUN_AVX_INSTR %6, %7, %8, 2, %1, %2 - %elifidn %4, fnord - RUN_AVX_INSTR1 %6, %7, %8, 3, %1, %2, %3, %9 - %elifidn %5, fnord - RUN_AVX_INSTR %6, %7, %8, 4, %1, %2, %3, %4 - %else - RUN_AVX_INSTR %6, %7, %8, 5, %1, %2, %3, %4, %5 - %endif - %endmacro -%endmacro - -AVX_INSTR addpd, 1, 0, 1 -AVX_INSTR addps, 1, 0, 1 -AVX_INSTR addsd, 1, 0, 1 -AVX_INSTR addss, 1, 0, 1 -AVX_INSTR addsubpd, 1, 0, 0 -AVX_INSTR addsubps, 1, 0, 0 -AVX_INSTR andpd, 1, 0, 1 -AVX_INSTR andps, 1, 0, 1 -AVX_INSTR andnpd, 1, 0, 0 -AVX_INSTR andnps, 1, 0, 0 -AVX_INSTR blendpd, 1, 0, 0 -AVX_INSTR blendps, 1, 0, 0 -AVX_INSTR blendvpd, 1, 0, 0 -AVX_INSTR blendvps, 1, 0, 0 -AVX_INSTR cmppd, 1, 0, 0 -AVX_INSTR cmpps, 1, 0, 0 -AVX_INSTR cmpsd, 1, 0, 0 -AVX_INSTR cmpss, 1, 0, 0 -AVX_INSTR cvtdq2ps, 1, 0, 0 -AVX_INSTR cvtps2dq, 1, 0, 0 -AVX_INSTR divpd, 1, 0, 0 -AVX_INSTR divps, 1, 0, 0 -AVX_INSTR divsd, 1, 0, 0 -AVX_INSTR divss, 1, 0, 0 -AVX_INSTR dppd, 1, 1, 0 -AVX_INSTR dpps, 1, 1, 0 -AVX_INSTR haddpd, 1, 0, 0 -AVX_INSTR haddps, 1, 0, 0 -AVX_INSTR hsubpd, 1, 0, 0 -AVX_INSTR hsubps, 1, 0, 0 -AVX_INSTR maxpd, 1, 0, 1 -AVX_INSTR maxps, 1, 0, 1 -AVX_INSTR maxsd, 1, 0, 1 -AVX_INSTR maxss, 1, 0, 1 -AVX_INSTR minpd, 1, 0, 1 -AVX_INSTR minps, 1, 0, 1 -AVX_INSTR minsd, 1, 0, 1 -AVX_INSTR minss, 1, 0, 1 -AVX_INSTR movhlps, 1, 0, 0 -AVX_INSTR movlhps, 1, 0, 0 -AVX_INSTR movsd, 1, 0, 0 -AVX_INSTR movss, 1, 0, 0 -AVX_INSTR mpsadbw, 0, 1, 0 -AVX_INSTR mulpd, 1, 0, 1 -AVX_INSTR mulps, 1, 0, 1 -AVX_INSTR mulsd, 1, 0, 1 -AVX_INSTR mulss, 1, 0, 1 -AVX_INSTR orpd, 1, 0, 1 -AVX_INSTR orps, 1, 0, 1 -AVX_INSTR packsswb, 0, 0, 0 -AVX_INSTR packssdw, 0, 0, 0 -AVX_INSTR packuswb, 0, 0, 0 -AVX_INSTR packusdw, 0, 0, 0 -AVX_INSTR paddb, 0, 0, 1 -AVX_INSTR paddw, 0, 0, 1 -AVX_INSTR paddd, 0, 0, 1 -AVX_INSTR paddq, 0, 0, 1 -AVX_INSTR paddsb, 0, 0, 1 -AVX_INSTR paddsw, 0, 0, 1 -AVX_INSTR paddusb, 0, 0, 1 -AVX_INSTR paddusw, 0, 0, 1 -AVX_INSTR palignr, 0, 1, 0 -AVX_INSTR pand, 0, 0, 1 -AVX_INSTR pandn, 0, 0, 0 -AVX_INSTR pavgb, 0, 0, 1 -AVX_INSTR pavgw, 0, 0, 1 -AVX_INSTR pblendvb, 0, 0, 0 -AVX_INSTR pblendw, 0, 1, 0 -AVX_INSTR pcmpestri, 0, 0, 0 -AVX_INSTR pcmpestrm, 0, 0, 0 -AVX_INSTR pcmpistri, 0, 0, 0 -AVX_INSTR pcmpistrm, 0, 0, 0 -AVX_INSTR pcmpeqb, 0, 0, 1 -AVX_INSTR pcmpeqw, 0, 0, 1 -AVX_INSTR pcmpeqd, 0, 0, 1 -AVX_INSTR pcmpeqq, 0, 0, 1 -AVX_INSTR pcmpgtb, 0, 0, 0 -AVX_INSTR pcmpgtw, 0, 0, 0 -AVX_INSTR pcmpgtd, 0, 0, 0 -AVX_INSTR pcmpgtq, 0, 0, 0 -AVX_INSTR phaddw, 0, 0, 0 -AVX_INSTR phaddd, 0, 0, 0 -AVX_INSTR phaddsw, 0, 0, 0 -AVX_INSTR phsubw, 0, 0, 0 -AVX_INSTR phsubd, 0, 0, 0 -AVX_INSTR phsubsw, 0, 0, 0 -AVX_INSTR pmaddwd, 0, 0, 1 -AVX_INSTR pmaddubsw, 0, 0, 0 -AVX_INSTR pmaxsb, 0, 0, 1 -AVX_INSTR pmaxsw, 0, 0, 1 -AVX_INSTR pmaxsd, 0, 0, 1 -AVX_INSTR pmaxub, 0, 0, 1 -AVX_INSTR pmaxuw, 0, 0, 1 -AVX_INSTR pmaxud, 0, 0, 1 -AVX_INSTR pminsb, 0, 0, 1 -AVX_INSTR pminsw, 0, 0, 1 -AVX_INSTR pminsd, 0, 0, 1 -AVX_INSTR pminub, 0, 0, 1 -AVX_INSTR pminuw, 0, 0, 1 -AVX_INSTR pminud, 0, 0, 1 -AVX_INSTR pmulhuw, 0, 0, 1 -AVX_INSTR pmulhrsw, 0, 0, 1 -AVX_INSTR pmulhw, 0, 0, 1 -AVX_INSTR pmullw, 0, 0, 1 -AVX_INSTR pmulld, 0, 0, 1 -AVX_INSTR pmuludq, 0, 0, 1 -AVX_INSTR pmuldq, 0, 0, 1 -AVX_INSTR por, 0, 0, 1 -AVX_INSTR psadbw, 0, 0, 1 -AVX_INSTR pshufb, 0, 0, 0 -AVX_INSTR psignb, 0, 0, 0 -AVX_INSTR psignw, 0, 0, 0 -AVX_INSTR psignd, 0, 0, 0 -AVX_INSTR psllw, 0, 0, 0 -AVX_INSTR pslld, 0, 0, 0 -AVX_INSTR psllq, 0, 0, 0 -AVX_INSTR pslldq, 0, 0, 0 -AVX_INSTR psraw, 0, 0, 0 -AVX_INSTR psrad, 0, 0, 0 -AVX_INSTR psrlw, 0, 0, 0 -AVX_INSTR psrld, 0, 0, 0 -AVX_INSTR psrlq, 0, 0, 0 -AVX_INSTR psrldq, 0, 0, 0 -AVX_INSTR psubb, 0, 0, 0 -AVX_INSTR psubw, 0, 0, 0 -AVX_INSTR psubd, 0, 0, 0 -AVX_INSTR psubq, 0, 0, 0 -AVX_INSTR psubsb, 0, 0, 0 -AVX_INSTR psubsw, 0, 0, 0 -AVX_INSTR psubusb, 0, 0, 0 -AVX_INSTR psubusw, 0, 0, 0 -AVX_INSTR punpckhbw, 0, 0, 0 -AVX_INSTR punpckhwd, 0, 0, 0 -AVX_INSTR punpckhdq, 0, 0, 0 -AVX_INSTR punpckhqdq, 0, 0, 0 -AVX_INSTR punpcklbw, 0, 0, 0 -AVX_INSTR punpcklwd, 0, 0, 0 -AVX_INSTR punpckldq, 0, 0, 0 -AVX_INSTR punpcklqdq, 0, 0, 0 -AVX_INSTR pxor, 0, 0, 1 -AVX_INSTR shufps, 1, 1, 0 -AVX_INSTR subpd, 1, 0, 0 -AVX_INSTR subps, 1, 0, 0 -AVX_INSTR subsd, 1, 0, 0 -AVX_INSTR subss, 1, 0, 0 -AVX_INSTR unpckhpd, 1, 0, 0 -AVX_INSTR unpckhps, 1, 0, 0 -AVX_INSTR unpcklpd, 1, 0, 0 -AVX_INSTR unpcklps, 1, 0, 0 -AVX_INSTR xorpd, 1, 0, 1 -AVX_INSTR xorps, 1, 0, 1 - -; 3DNow instructions, for sharing code between AVX, SSE and 3DN -AVX_INSTR pfadd, 1, 0, 1 -AVX_INSTR pfsub, 1, 0, 0 -AVX_INSTR pfmul, 1, 0, 1 - -; base-4 constants for shuffles -%assign i 0 -%rep 256 - %assign j ((i>>6)&3)*1000 + ((i>>4)&3)*100 + ((i>>2)&3)*10 + (i&3) - %if j < 10 - CAT_XDEFINE q000, j, i - %elif j < 100 - CAT_XDEFINE q00, j, i - %elif j < 1000 - CAT_XDEFINE q0, j, i - %else - CAT_XDEFINE q, j, i - %endif -%assign i i+1 -%endrep -%undef i -%undef j - -%macro FMA_INSTR 3 - %macro %1 4-7 %1, %2, %3 - %if cpuflag(xop) - v%5 %1, %2, %3, %4 - %else - %6 %1, %2, %3 - %7 %1, %4 - %endif - %endmacro -%endmacro - -FMA_INSTR pmacsdd, pmulld, paddd -FMA_INSTR pmacsww, pmullw, paddw -FMA_INSTR pmadcswd, pmaddwd, paddd diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/tools_common.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/tools_common.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/tools_common.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/tools_common.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,486 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include -#include -#include - -#include "./tools_common.h" - -#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER -#include "vpx/vp8cx.h" -#endif - -#if CONFIG_VP8_DECODER || CONFIG_VP9_DECODER -#include "vpx/vp8dx.h" -#endif - -#if defined(_WIN32) || defined(__OS2__) -#include -#include - -#ifdef __OS2__ -#define _setmode setmode -#define _fileno fileno -#define _O_BINARY O_BINARY -#endif -#endif - -#define LOG_ERROR(label) do {\ - const char *l = label;\ - va_list ap;\ - va_start(ap, fmt);\ - if (l)\ - fprintf(stderr, "%s: ", l);\ - vfprintf(stderr, fmt, ap);\ - fprintf(stderr, "\n");\ - va_end(ap);\ -} while (0) - - -FILE *set_binary_mode(FILE *stream) { - (void)stream; -#if defined(_WIN32) || defined(__OS2__) - _setmode(_fileno(stream), _O_BINARY); -#endif - return stream; -} - -void die(const char *fmt, ...) { - LOG_ERROR(NULL); - usage_exit(); -} - -void fatal(const char *fmt, ...) { - LOG_ERROR("Fatal"); - exit(EXIT_FAILURE); -} - -void warn(const char *fmt, ...) { - LOG_ERROR("Warning"); -} - -void die_codec(vpx_codec_ctx_t *ctx, const char *s) { - const char *detail = vpx_codec_error_detail(ctx); - - printf("%s: %s\n", s, vpx_codec_error(ctx)); - if (detail) - printf(" %s\n", detail); - exit(EXIT_FAILURE); -} - -int read_yuv_frame(struct VpxInputContext *input_ctx, vpx_image_t *yuv_frame) { - FILE *f = input_ctx->file; - struct FileTypeDetectionBuffer *detect = &input_ctx->detect; - int plane = 0; - int shortread = 0; - const int bytespp = (yuv_frame->fmt & VPX_IMG_FMT_HIGHBITDEPTH) ? 2 : 1; - - for (plane = 0; plane < 3; ++plane) { - uint8_t *ptr; - const int w = vpx_img_plane_width(yuv_frame, plane); - const int h = vpx_img_plane_height(yuv_frame, plane); - int r; - - /* Determine the correct plane based on the image format. The for-loop - * always counts in Y,U,V order, but this may not match the order of - * the data on disk. - */ - switch (plane) { - case 1: - ptr = yuv_frame->planes[ - yuv_frame->fmt == VPX_IMG_FMT_YV12 ? VPX_PLANE_V : VPX_PLANE_U]; - break; - case 2: - ptr = yuv_frame->planes[ - yuv_frame->fmt == VPX_IMG_FMT_YV12 ? VPX_PLANE_U : VPX_PLANE_V]; - break; - default: - ptr = yuv_frame->planes[plane]; - } - - for (r = 0; r < h; ++r) { - size_t needed = w * bytespp; - size_t buf_position = 0; - const size_t left = detect->buf_read - detect->position; - if (left > 0) { - const size_t more = (left < needed) ? left : needed; - memcpy(ptr, detect->buf + detect->position, more); - buf_position = more; - needed -= more; - detect->position += more; - } - if (needed > 0) { - shortread |= (fread(ptr + buf_position, 1, needed, f) < needed); - } - - ptr += yuv_frame->stride[plane]; - } - } - - return shortread; -} - -static const VpxInterface vpx_encoders[] = { -#if CONFIG_VP8_ENCODER - {"vp8", VP8_FOURCC, &vpx_codec_vp8_cx}, -#endif - -#if CONFIG_VP9_ENCODER - {"vp9", VP9_FOURCC, &vpx_codec_vp9_cx}, -#endif -}; - -int get_vpx_encoder_count() { - return sizeof(vpx_encoders) / sizeof(vpx_encoders[0]); -} - -const VpxInterface *get_vpx_encoder_by_index(int i) { - return &vpx_encoders[i]; -} - -const VpxInterface *get_vpx_encoder_by_name(const char *name) { - int i; - - for (i = 0; i < get_vpx_encoder_count(); ++i) { - const VpxInterface *encoder = get_vpx_encoder_by_index(i); - if (strcmp(encoder->name, name) == 0) - return encoder; - } - - return NULL; -} - -static const VpxInterface vpx_decoders[] = { -#if CONFIG_VP8_DECODER - {"vp8", VP8_FOURCC, &vpx_codec_vp8_dx}, -#endif - -#if CONFIG_VP9_DECODER - {"vp9", VP9_FOURCC, &vpx_codec_vp9_dx}, -#endif -}; - -int get_vpx_decoder_count() { - return sizeof(vpx_decoders) / sizeof(vpx_decoders[0]); -} - -const VpxInterface *get_vpx_decoder_by_index(int i) { - return &vpx_decoders[i]; -} - -const VpxInterface *get_vpx_decoder_by_name(const char *name) { - int i; - - for (i = 0; i < get_vpx_decoder_count(); ++i) { - const VpxInterface *const decoder = get_vpx_decoder_by_index(i); - if (strcmp(decoder->name, name) == 0) - return decoder; - } - - return NULL; -} - -const VpxInterface *get_vpx_decoder_by_fourcc(uint32_t fourcc) { - int i; - - for (i = 0; i < get_vpx_decoder_count(); ++i) { - const VpxInterface *const decoder = get_vpx_decoder_by_index(i); - if (decoder->fourcc == fourcc) - return decoder; - } - - return NULL; -} - -// TODO(dkovalev): move this function to vpx_image.{c, h}, so it will be part -// of vpx_image_t support -int vpx_img_plane_width(const vpx_image_t *img, int plane) { - if (plane > 0 && img->x_chroma_shift > 0) - return (img->d_w + 1) >> img->x_chroma_shift; - else - return img->d_w; -} - -int vpx_img_plane_height(const vpx_image_t *img, int plane) { - if (plane > 0 && img->y_chroma_shift > 0) - return (img->d_h + 1) >> img->y_chroma_shift; - else - return img->d_h; -} - -void vpx_img_write(const vpx_image_t *img, FILE *file) { - int plane; - - for (plane = 0; plane < 3; ++plane) { - const unsigned char *buf = img->planes[plane]; - const int stride = img->stride[plane]; - const int w = vpx_img_plane_width(img, plane) * - ((img->fmt & VPX_IMG_FMT_HIGHBITDEPTH) ? 2 : 1); - const int h = vpx_img_plane_height(img, plane); - int y; - - for (y = 0; y < h; ++y) { - fwrite(buf, 1, w, file); - buf += stride; - } - } -} - -int vpx_img_read(vpx_image_t *img, FILE *file) { - int plane; - - for (plane = 0; plane < 3; ++plane) { - unsigned char *buf = img->planes[plane]; - const int stride = img->stride[plane]; - const int w = vpx_img_plane_width(img, plane) * - ((img->fmt & VPX_IMG_FMT_HIGHBITDEPTH) ? 2 : 1); - const int h = vpx_img_plane_height(img, plane); - int y; - - for (y = 0; y < h; ++y) { - if (fread(buf, 1, w, file) != (size_t)w) - return 0; - buf += stride; - } - } - - return 1; -} - -// TODO(dkovalev) change sse_to_psnr signature: double -> int64_t -double sse_to_psnr(double samples, double peak, double sse) { - static const double kMaxPSNR = 100.0; - - if (sse > 0.0) { - const double psnr = 10.0 * log10(samples * peak * peak / sse); - return psnr > kMaxPSNR ? kMaxPSNR : psnr; - } else { - return kMaxPSNR; - } -} - -// TODO(debargha): Consolidate the functions below into a separate file. -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH -static void highbd_img_upshift(vpx_image_t *dst, vpx_image_t *src, - int input_shift) { - // Note the offset is 1 less than half. - const int offset = input_shift > 0 ? (1 << (input_shift - 1)) - 1 : 0; - int plane; - if (dst->d_w != src->d_w || dst->d_h != src->d_h || - dst->x_chroma_shift != src->x_chroma_shift || - dst->y_chroma_shift != src->y_chroma_shift || - dst->fmt != src->fmt || input_shift < 0) { - fatal("Unsupported image conversion"); - } - switch (src->fmt) { - case VPX_IMG_FMT_I42016: - case VPX_IMG_FMT_I42216: - case VPX_IMG_FMT_I44416: - case VPX_IMG_FMT_I44016: - break; - default: - fatal("Unsupported image conversion"); - break; - } - for (plane = 0; plane < 3; plane++) { - int w = src->d_w; - int h = src->d_h; - int x, y; - if (plane) { - w = (w + src->x_chroma_shift) >> src->x_chroma_shift; - h = (h + src->y_chroma_shift) >> src->y_chroma_shift; - } - for (y = 0; y < h; y++) { - uint16_t *p_src = - (uint16_t *)(src->planes[plane] + y * src->stride[plane]); - uint16_t *p_dst = - (uint16_t *)(dst->planes[plane] + y * dst->stride[plane]); - for (x = 0; x < w; x++) - *p_dst++ = (*p_src++ << input_shift) + offset; - } - } -} - -static void lowbd_img_upshift(vpx_image_t *dst, vpx_image_t *src, - int input_shift) { - // Note the offset is 1 less than half. - const int offset = input_shift > 0 ? (1 << (input_shift - 1)) - 1 : 0; - int plane; - if (dst->d_w != src->d_w || dst->d_h != src->d_h || - dst->x_chroma_shift != src->x_chroma_shift || - dst->y_chroma_shift != src->y_chroma_shift || - dst->fmt != src->fmt + VPX_IMG_FMT_HIGHBITDEPTH || - input_shift < 0) { - fatal("Unsupported image conversion"); - } - switch (src->fmt) { - case VPX_IMG_FMT_I420: - case VPX_IMG_FMT_I422: - case VPX_IMG_FMT_I444: - case VPX_IMG_FMT_I440: - break; - default: - fatal("Unsupported image conversion"); - break; - } - for (plane = 0; plane < 3; plane++) { - int w = src->d_w; - int h = src->d_h; - int x, y; - if (plane) { - w = (w + src->x_chroma_shift) >> src->x_chroma_shift; - h = (h + src->y_chroma_shift) >> src->y_chroma_shift; - } - for (y = 0; y < h; y++) { - uint8_t *p_src = src->planes[plane] + y * src->stride[plane]; - uint16_t *p_dst = - (uint16_t *)(dst->planes[plane] + y * dst->stride[plane]); - for (x = 0; x < w; x++) { - *p_dst++ = (*p_src++ << input_shift) + offset; - } - } - } -} - -void vpx_img_upshift(vpx_image_t *dst, vpx_image_t *src, - int input_shift) { - if (src->fmt & VPX_IMG_FMT_HIGHBITDEPTH) { - highbd_img_upshift(dst, src, input_shift); - } else { - lowbd_img_upshift(dst, src, input_shift); - } -} - -void vpx_img_truncate_16_to_8(vpx_image_t *dst, vpx_image_t *src) { - int plane; - if (dst->fmt + VPX_IMG_FMT_HIGHBITDEPTH != src->fmt || - dst->d_w != src->d_w || dst->d_h != src->d_h || - dst->x_chroma_shift != src->x_chroma_shift || - dst->y_chroma_shift != src->y_chroma_shift) { - fatal("Unsupported image conversion"); - } - switch (dst->fmt) { - case VPX_IMG_FMT_I420: - case VPX_IMG_FMT_I422: - case VPX_IMG_FMT_I444: - case VPX_IMG_FMT_I440: - break; - default: - fatal("Unsupported image conversion"); - break; - } - for (plane = 0; plane < 3; plane++) { - int w = src->d_w; - int h = src->d_h; - int x, y; - if (plane) { - w = (w + src->x_chroma_shift) >> src->x_chroma_shift; - h = (h + src->y_chroma_shift) >> src->y_chroma_shift; - } - for (y = 0; y < h; y++) { - uint16_t *p_src = - (uint16_t *)(src->planes[plane] + y * src->stride[plane]); - uint8_t *p_dst = dst->planes[plane] + y * dst->stride[plane]; - for (x = 0; x < w; x++) { - *p_dst++ = *p_src++; - } - } - } -} - -static void highbd_img_downshift(vpx_image_t *dst, vpx_image_t *src, - int down_shift) { - int plane; - if (dst->d_w != src->d_w || dst->d_h != src->d_h || - dst->x_chroma_shift != src->x_chroma_shift || - dst->y_chroma_shift != src->y_chroma_shift || - dst->fmt != src->fmt || down_shift < 0) { - fatal("Unsupported image conversion"); - } - switch (src->fmt) { - case VPX_IMG_FMT_I42016: - case VPX_IMG_FMT_I42216: - case VPX_IMG_FMT_I44416: - case VPX_IMG_FMT_I44016: - break; - default: - fatal("Unsupported image conversion"); - break; - } - for (plane = 0; plane < 3; plane++) { - int w = src->d_w; - int h = src->d_h; - int x, y; - if (plane) { - w = (w + src->x_chroma_shift) >> src->x_chroma_shift; - h = (h + src->y_chroma_shift) >> src->y_chroma_shift; - } - for (y = 0; y < h; y++) { - uint16_t *p_src = - (uint16_t *)(src->planes[plane] + y * src->stride[plane]); - uint16_t *p_dst = - (uint16_t *)(dst->planes[plane] + y * dst->stride[plane]); - for (x = 0; x < w; x++) - *p_dst++ = *p_src++ >> down_shift; - } - } -} - -static void lowbd_img_downshift(vpx_image_t *dst, vpx_image_t *src, - int down_shift) { - int plane; - if (dst->d_w != src->d_w || dst->d_h != src->d_h || - dst->x_chroma_shift != src->x_chroma_shift || - dst->y_chroma_shift != src->y_chroma_shift || - src->fmt != dst->fmt + VPX_IMG_FMT_HIGHBITDEPTH || - down_shift < 0) { - fatal("Unsupported image conversion"); - } - switch (dst->fmt) { - case VPX_IMG_FMT_I420: - case VPX_IMG_FMT_I422: - case VPX_IMG_FMT_I444: - case VPX_IMG_FMT_I440: - break; - default: - fatal("Unsupported image conversion"); - break; - } - for (plane = 0; plane < 3; plane++) { - int w = src->d_w; - int h = src->d_h; - int x, y; - if (plane) { - w = (w + src->x_chroma_shift) >> src->x_chroma_shift; - h = (h + src->y_chroma_shift) >> src->y_chroma_shift; - } - for (y = 0; y < h; y++) { - uint16_t *p_src = - (uint16_t *)(src->planes[plane] + y * src->stride[plane]); - uint8_t *p_dst = dst->planes[plane] + y * dst->stride[plane]; - for (x = 0; x < w; x++) { - *p_dst++ = *p_src++ >> down_shift; - } - } - } -} - -void vpx_img_downshift(vpx_image_t *dst, vpx_image_t *src, - int down_shift) { - if (dst->fmt & VPX_IMG_FMT_HIGHBITDEPTH) { - highbd_img_downshift(dst, src, down_shift); - } else { - lowbd_img_downshift(dst, src, down_shift); - } -} -#endif // CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/tools_common.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/tools_common.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/tools_common.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/tools_common.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,162 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef TOOLS_COMMON_H_ -#define TOOLS_COMMON_H_ - -#include - -#include "./vpx_config.h" -#include "vpx/vpx_codec.h" -#include "vpx/vpx_image.h" -#include "vpx/vpx_integer.h" - -#if CONFIG_ENCODERS -#include "./y4minput.h" -#endif - -#if defined(_MSC_VER) -/* MSVS uses _f{seek,tell}i64. */ -#define fseeko _fseeki64 -#define ftello _ftelli64 -#elif defined(_WIN32) -/* MinGW uses f{seek,tell}o64 for large files. */ -#define fseeko fseeko64 -#define ftello ftello64 -#endif /* _WIN32 */ - -#if CONFIG_OS_SUPPORT -#if defined(_MSC_VER) -#include /* NOLINT */ -#define snprintf _snprintf -#define isatty _isatty -#define fileno _fileno -#else -#include /* NOLINT */ -#endif /* _MSC_VER */ -#endif /* CONFIG_OS_SUPPORT */ - -/* Use 32-bit file operations in WebM file format when building ARM - * executables (.axf) with RVCT. */ -#if !CONFIG_OS_SUPPORT -#define fseeko fseek -#define ftello ftell -#endif /* CONFIG_OS_SUPPORT */ - -#define LITERALU64(hi, lo) ((((uint64_t)hi) << 32) | lo) - -#ifndef PATH_MAX -#define PATH_MAX 512 -#endif - -#define IVF_FRAME_HDR_SZ (4 + 8) /* 4 byte size + 8 byte timestamp */ -#define IVF_FILE_HDR_SZ 32 - -#define RAW_FRAME_HDR_SZ sizeof(uint32_t) - -#define VP8_FOURCC 0x30385056 -#define VP9_FOURCC 0x30395056 - -enum VideoFileType { - FILE_TYPE_RAW, - FILE_TYPE_IVF, - FILE_TYPE_Y4M, - FILE_TYPE_WEBM -}; - -struct FileTypeDetectionBuffer { - char buf[4]; - size_t buf_read; - size_t position; -}; - -struct VpxRational { - int numerator; - int denominator; -}; - -struct VpxInputContext { - const char *filename; - FILE *file; - int64_t length; - struct FileTypeDetectionBuffer detect; - enum VideoFileType file_type; - uint32_t width; - uint32_t height; - vpx_img_fmt_t fmt; - vpx_bit_depth_t bit_depth; - int only_i420; - uint32_t fourcc; - struct VpxRational framerate; -#if CONFIG_ENCODERS - y4m_input y4m; -#endif -}; - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(__GNUC__) -#define VPX_NO_RETURN __attribute__((noreturn)) -#else -#define VPX_NO_RETURN -#endif - -/* Sets a stdio stream into binary mode */ -FILE *set_binary_mode(FILE *stream); - -void die(const char *fmt, ...) VPX_NO_RETURN; -void fatal(const char *fmt, ...) VPX_NO_RETURN; -void warn(const char *fmt, ...); - -void die_codec(vpx_codec_ctx_t *ctx, const char *s) VPX_NO_RETURN; - -/* The tool including this file must define usage_exit() */ -void usage_exit() VPX_NO_RETURN; - -#undef VPX_NO_RETURN - -int read_yuv_frame(struct VpxInputContext *input_ctx, vpx_image_t *yuv_frame); - -typedef struct VpxInterface { - const char *const name; - const uint32_t fourcc; - vpx_codec_iface_t *(*const codec_interface)(); -} VpxInterface; - -int get_vpx_encoder_count(); -const VpxInterface *get_vpx_encoder_by_index(int i); -const VpxInterface *get_vpx_encoder_by_name(const char *name); - -int get_vpx_decoder_count(); -const VpxInterface *get_vpx_decoder_by_index(int i); -const VpxInterface *get_vpx_decoder_by_name(const char *name); -const VpxInterface *get_vpx_decoder_by_fourcc(uint32_t fourcc); - -// TODO(dkovalev): move this function to vpx_image.{c, h}, so it will be part -// of vpx_image_t support -int vpx_img_plane_width(const vpx_image_t *img, int plane); -int vpx_img_plane_height(const vpx_image_t *img, int plane); -void vpx_img_write(const vpx_image_t *img, FILE *file); -int vpx_img_read(vpx_image_t *img, FILE *file); - -double sse_to_psnr(double samples, double peak, double mse); - -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH -void vpx_img_upshift(vpx_image_t *dst, vpx_image_t *src, int input_shift); -void vpx_img_downshift(vpx_image_t *dst, vpx_image_t *src, int down_shift); -void vpx_img_truncate_16_to_8(vpx_image_t *dst, vpx_image_t *src); -#endif - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif // TOOLS_COMMON_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/video_common.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/video_common.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/video_common.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/video_common.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VIDEO_COMMON_H_ -#define VIDEO_COMMON_H_ - -#include "./tools_common.h" - -typedef struct { - uint32_t codec_fourcc; - int frame_width; - int frame_height; - struct VpxRational time_base; -} VpxVideoInfo; - -#endif // VIDEO_COMMON_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/video_reader.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/video_reader.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/video_reader.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/video_reader.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./ivfdec.h" -#include "./video_reader.h" - -#include "vpx_ports/mem_ops.h" - -static const char *const kIVFSignature = "DKIF"; - -struct VpxVideoReaderStruct { - VpxVideoInfo info; - FILE *file; - uint8_t *buffer; - size_t buffer_size; - size_t frame_size; -}; - -VpxVideoReader *vpx_video_reader_open(const char *filename) { - char header[32]; - VpxVideoReader *reader = NULL; - FILE *const file = fopen(filename, "rb"); - if (!file) - return NULL; // Can't open file - - if (fread(header, 1, 32, file) != 32) - return NULL; // Can't read file header - - if (memcmp(kIVFSignature, header, 4) != 0) - return NULL; // Wrong IVF signature - - if (mem_get_le16(header + 4) != 0) - return NULL; // Wrong IVF version - - reader = calloc(1, sizeof(*reader)); - if (!reader) - return NULL; // Can't allocate VpxVideoReader - - reader->file = file; - reader->info.codec_fourcc = mem_get_le32(header + 8); - reader->info.frame_width = mem_get_le16(header + 12); - reader->info.frame_height = mem_get_le16(header + 14); - reader->info.time_base.numerator = mem_get_le32(header + 16); - reader->info.time_base.denominator = mem_get_le32(header + 20); - - return reader; -} - -void vpx_video_reader_close(VpxVideoReader *reader) { - if (reader) { - fclose(reader->file); - free(reader->buffer); - free(reader); - } -} - -int vpx_video_reader_read_frame(VpxVideoReader *reader) { - return !ivf_read_frame(reader->file, &reader->buffer, &reader->frame_size, - &reader->buffer_size); -} - -const uint8_t *vpx_video_reader_get_frame(VpxVideoReader *reader, - size_t *size) { - if (size) - *size = reader->frame_size; - - return reader->buffer; -} - -const VpxVideoInfo *vpx_video_reader_get_info(VpxVideoReader *reader) { - return &reader->info; -} - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/video_reader.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/video_reader.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/video_reader.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/video_reader.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VIDEO_READER_H_ -#define VIDEO_READER_H_ - -#include "./video_common.h" - -// The following code is work in progress. It is going to support transparent -// reading of input files. Right now only IVF format is supported for -// simplicity. The main goal the API is to be simple and easy to use in example -// code and in vpxenc/vpxdec later. All low-level details like memory -// buffer management are hidden from API users. -struct VpxVideoReaderStruct; -typedef struct VpxVideoReaderStruct VpxVideoReader; - -#ifdef __cplusplus -extern "C" { -#endif - -// Opens the input file for reading and inspects it to determine file type. -// Returns an opaque VpxVideoReader* upon success, or NULL upon failure. -// Right now only IVF format is supported. -VpxVideoReader *vpx_video_reader_open(const char *filename); - -// Frees all resources associated with VpxVideoReader* returned from -// vpx_video_reader_open() call. -void vpx_video_reader_close(VpxVideoReader *reader); - -// Reads frame from the file and stores it in internal buffer. -int vpx_video_reader_read_frame(VpxVideoReader *reader); - -// Returns the pointer to memory buffer with frame data read by last call to -// vpx_video_reader_read_frame(). -const uint8_t *vpx_video_reader_get_frame(VpxVideoReader *reader, - size_t *size); - -// Fills VpxVideoInfo with information from opened video file. -const VpxVideoInfo *vpx_video_reader_get_info(VpxVideoReader *reader); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VIDEO_READER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/video_writer.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/video_writer.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/video_writer.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/video_writer.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "./ivfenc.h" -#include "./video_writer.h" -#include "vpx/vpx_encoder.h" - -struct VpxVideoWriterStruct { - VpxVideoInfo info; - FILE *file; - int frame_count; -}; - -static void write_header(FILE *file, const VpxVideoInfo *info, - int frame_count) { - struct vpx_codec_enc_cfg cfg; - cfg.g_w = info->frame_width; - cfg.g_h = info->frame_height; - cfg.g_timebase.num = info->time_base.numerator; - cfg.g_timebase.den = info->time_base.denominator; - - ivf_write_file_header(file, &cfg, info->codec_fourcc, frame_count); -} - -VpxVideoWriter *vpx_video_writer_open(const char *filename, - VpxContainer container, - const VpxVideoInfo *info) { - if (container == kContainerIVF) { - VpxVideoWriter *writer = NULL; - FILE *const file = fopen(filename, "wb"); - if (!file) - return NULL; - - writer = malloc(sizeof(*writer)); - if (!writer) - return NULL; - - writer->frame_count = 0; - writer->info = *info; - writer->file = file; - - write_header(writer->file, info, 0); - - return writer; - } - - return NULL; -} - -void vpx_video_writer_close(VpxVideoWriter *writer) { - if (writer) { - // Rewriting frame header with real frame count - rewind(writer->file); - write_header(writer->file, &writer->info, writer->frame_count); - - fclose(writer->file); - free(writer); - } -} - -int vpx_video_writer_write_frame(VpxVideoWriter *writer, - const uint8_t *buffer, size_t size, - int64_t pts) { - ivf_write_frame_header(writer->file, pts, size); - if (fwrite(buffer, 1, size, writer->file) != size) - return 0; - - ++writer->frame_count; - - return 1; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/video_writer.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/video_writer.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/video_writer.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/video_writer.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VIDEO_WRITER_H_ -#define VIDEO_WRITER_H_ - -#include "./video_common.h" - -typedef enum { - kContainerIVF -} VpxContainer; - -struct VpxVideoWriterStruct; -typedef struct VpxVideoWriterStruct VpxVideoWriter; - -#ifdef __cplusplus -extern "C" { -#endif - -// Finds and opens writer for specified container format. -// Returns an opaque VpxVideoWriter* upon success, or NULL upon failure. -// Right now only IVF format is supported. -VpxVideoWriter *vpx_video_writer_open(const char *filename, - VpxContainer container, - const VpxVideoInfo *info); - -// Frees all resources associated with VpxVideoWriter* returned from -// vpx_video_writer_open() call. -void vpx_video_writer_close(VpxVideoWriter *writer); - -// Writes frame bytes to the file. -int vpx_video_writer_write_frame(VpxVideoWriter *writer, - const uint8_t *buffer, size_t size, - int64_t pts); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VIDEO_WRITER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/alloccommon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/alloccommon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/alloccommon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/alloccommon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "blockd.h" -#include "vpx_mem/vpx_mem.h" -#include "onyxc_int.h" -#include "findnearmv.h" -#include "entropymode.h" -#include "systemdependent.h" - -void vp8_de_alloc_frame_buffers(VP8_COMMON *oci) -{ - int i; - for (i = 0; i < NUM_YV12_BUFFERS; i++) - vp8_yv12_de_alloc_frame_buffer(&oci->yv12_fb[i]); - - vp8_yv12_de_alloc_frame_buffer(&oci->temp_scale_frame); -#if CONFIG_POSTPROC - vp8_yv12_de_alloc_frame_buffer(&oci->post_proc_buffer); - if (oci->post_proc_buffer_int_used) - vp8_yv12_de_alloc_frame_buffer(&oci->post_proc_buffer_int); - - vpx_free(oci->pp_limits_buffer); - oci->pp_limits_buffer = NULL; -#endif - - vpx_free(oci->above_context); - vpx_free(oci->mip); -#if CONFIG_ERROR_CONCEALMENT - vpx_free(oci->prev_mip); - oci->prev_mip = NULL; -#endif - - oci->above_context = NULL; - oci->mip = NULL; -} - -int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height) -{ - int i; - - vp8_de_alloc_frame_buffers(oci); - - /* our internal buffers are always multiples of 16 */ - if ((width & 0xf) != 0) - width += 16 - (width & 0xf); - - if ((height & 0xf) != 0) - height += 16 - (height & 0xf); - - - for (i = 0; i < NUM_YV12_BUFFERS; i++) - { - oci->fb_idx_ref_cnt[i] = 0; - oci->yv12_fb[i].flags = 0; - if (vp8_yv12_alloc_frame_buffer(&oci->yv12_fb[i], width, height, VP8BORDERINPIXELS) < 0) - goto allocation_fail; - } - - oci->new_fb_idx = 0; - oci->lst_fb_idx = 1; - oci->gld_fb_idx = 2; - oci->alt_fb_idx = 3; - - oci->fb_idx_ref_cnt[0] = 1; - oci->fb_idx_ref_cnt[1] = 1; - oci->fb_idx_ref_cnt[2] = 1; - oci->fb_idx_ref_cnt[3] = 1; - - if (vp8_yv12_alloc_frame_buffer(&oci->temp_scale_frame, width, 16, VP8BORDERINPIXELS) < 0) - goto allocation_fail; - - oci->mb_rows = height >> 4; - oci->mb_cols = width >> 4; - oci->MBs = oci->mb_rows * oci->mb_cols; - oci->mode_info_stride = oci->mb_cols + 1; - oci->mip = vpx_calloc((oci->mb_cols + 1) * (oci->mb_rows + 1), sizeof(MODE_INFO)); - - if (!oci->mip) - goto allocation_fail; - - oci->mi = oci->mip + oci->mode_info_stride + 1; - - /* Allocation of previous mode info will be done in vp8_decode_frame() - * as it is a decoder only data */ - - oci->above_context = vpx_calloc(sizeof(ENTROPY_CONTEXT_PLANES) * oci->mb_cols, 1); - - if (!oci->above_context) - goto allocation_fail; - -#if CONFIG_POSTPROC - if (vp8_yv12_alloc_frame_buffer(&oci->post_proc_buffer, width, height, VP8BORDERINPIXELS) < 0) - goto allocation_fail; - - oci->post_proc_buffer_int_used = 0; - vpx_memset(&oci->postproc_state, 0, sizeof(oci->postproc_state)); - vpx_memset(oci->post_proc_buffer.buffer_alloc, 128, - oci->post_proc_buffer.frame_size); - - /* Allocate buffer to store post-processing filter coefficients. - * - * Note: Round up mb_cols to support SIMD reads - */ - oci->pp_limits_buffer = vpx_memalign(16, 24 * ((oci->mb_cols + 1) & ~1)); - if (!oci->pp_limits_buffer) - goto allocation_fail; -#endif - - return 0; - -allocation_fail: - vp8_de_alloc_frame_buffers(oci); - return 1; -} - -void vp8_setup_version(VP8_COMMON *cm) -{ - switch (cm->version) - { - case 0: - cm->no_lpf = 0; - cm->filter_type = NORMAL_LOOPFILTER; - cm->use_bilinear_mc_filter = 0; - cm->full_pixel = 0; - break; - case 1: - cm->no_lpf = 0; - cm->filter_type = SIMPLE_LOOPFILTER; - cm->use_bilinear_mc_filter = 1; - cm->full_pixel = 0; - break; - case 2: - cm->no_lpf = 1; - cm->filter_type = NORMAL_LOOPFILTER; - cm->use_bilinear_mc_filter = 1; - cm->full_pixel = 0; - break; - case 3: - cm->no_lpf = 1; - cm->filter_type = SIMPLE_LOOPFILTER; - cm->use_bilinear_mc_filter = 1; - cm->full_pixel = 1; - break; - default: - /*4,5,6,7 are reserved for future use*/ - cm->no_lpf = 0; - cm->filter_type = NORMAL_LOOPFILTER; - cm->use_bilinear_mc_filter = 0; - cm->full_pixel = 0; - break; - } -} -void vp8_create_common(VP8_COMMON *oci) -{ - vp8_machine_specific_config(oci); - - vp8_init_mbmode_probs(oci); - vp8_default_bmode_probs(oci->fc.bmode_prob); - - oci->mb_no_coeff_skip = 1; - oci->no_lpf = 0; - oci->filter_type = NORMAL_LOOPFILTER; - oci->use_bilinear_mc_filter = 0; - oci->full_pixel = 0; - oci->multi_token_partition = ONE_PARTITION; - oci->clamp_type = RECON_CLAMP_REQUIRED; - - /* Initialize reference frame sign bias structure to defaults */ - vpx_memset(oci->ref_frame_sign_bias, 0, sizeof(oci->ref_frame_sign_bias)); - - /* Default disable buffer to buffer copying */ - oci->copy_buffer_to_gf = 0; - oci->copy_buffer_to_arf = 0; -} - -void vp8_remove_common(VP8_COMMON *oci) -{ - vp8_de_alloc_frame_buffers(oci); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/alloccommon.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/alloccommon.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/alloccommon.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/alloccommon.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_ALLOCCOMMON_H_ -#define VP8_COMMON_ALLOCCOMMON_H_ - -#include "onyxc_int.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void vp8_create_common(VP8_COMMON *oci); -void vp8_remove_common(VP8_COMMON *oci); -void vp8_de_alloc_frame_buffers(VP8_COMMON *oci); -int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height); -void vp8_setup_version(VP8_COMMON *oci); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_ALLOCCOMMON_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/bilinearfilter_v6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/bilinearfilter_v6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/bilinearfilter_v6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/bilinearfilter_v6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,237 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - EXPORT |vp8_filter_block2d_bil_first_pass_armv6| - EXPORT |vp8_filter_block2d_bil_second_pass_armv6| - - AREA |.text|, CODE, READONLY ; name this block of code - -;------------------------------------- -; r0 unsigned char *src_ptr, -; r1 unsigned short *dst_ptr, -; r2 unsigned int src_pitch, -; r3 unsigned int height, -; stack unsigned int width, -; stack const short *vp8_filter -;------------------------------------- -; The output is transposed stroed in output array to make it easy for second pass filtering. -|vp8_filter_block2d_bil_first_pass_armv6| PROC - stmdb sp!, {r4 - r11, lr} - - ldr r11, [sp, #40] ; vp8_filter address - ldr r4, [sp, #36] ; width - - mov r12, r3 ; outer-loop counter - - add r7, r2, r4 ; preload next row - pld [r0, r7] - - sub r2, r2, r4 ; src increment for height loop - - ldr r5, [r11] ; load up filter coefficients - - mov r3, r3, lsl #1 ; height*2 - add r3, r3, #2 ; plus 2 to make output buffer 4-bit aligned since height is actually (height+1) - - mov r11, r1 ; save dst_ptr for each row - - cmp r5, #128 ; if filter coef = 128, then skip the filter - beq bil_null_1st_filter - -|bil_height_loop_1st_v6| - ldrb r6, [r0] ; load source data - ldrb r7, [r0, #1] - ldrb r8, [r0, #2] - mov lr, r4, lsr #2 ; 4-in-parellel loop counter - -|bil_width_loop_1st_v6| - ldrb r9, [r0, #3] - ldrb r10, [r0, #4] - - pkhbt r6, r6, r7, lsl #16 ; src[1] | src[0] - pkhbt r7, r7, r8, lsl #16 ; src[2] | src[1] - - smuad r6, r6, r5 ; apply the filter - pkhbt r8, r8, r9, lsl #16 ; src[3] | src[2] - smuad r7, r7, r5 - pkhbt r9, r9, r10, lsl #16 ; src[4] | src[3] - - smuad r8, r8, r5 - smuad r9, r9, r5 - - add r0, r0, #4 - subs lr, lr, #1 - - add r6, r6, #0x40 ; round_shift_and_clamp - add r7, r7, #0x40 - usat r6, #16, r6, asr #7 - usat r7, #16, r7, asr #7 - - strh r6, [r1], r3 ; result is transposed and stored - - add r8, r8, #0x40 ; round_shift_and_clamp - strh r7, [r1], r3 - add r9, r9, #0x40 - usat r8, #16, r8, asr #7 - usat r9, #16, r9, asr #7 - - strh r8, [r1], r3 ; result is transposed and stored - - ldrneb r6, [r0] ; load source data - strh r9, [r1], r3 - - ldrneb r7, [r0, #1] - ldrneb r8, [r0, #2] - - bne bil_width_loop_1st_v6 - - add r0, r0, r2 ; move to next input row - subs r12, r12, #1 - - add r9, r2, r4, lsl #1 ; adding back block width - pld [r0, r9] ; preload next row - - add r11, r11, #2 ; move over to next column - mov r1, r11 - - bne bil_height_loop_1st_v6 - - ldmia sp!, {r4 - r11, pc} - -|bil_null_1st_filter| -|bil_height_loop_null_1st| - mov lr, r4, lsr #2 ; loop counter - -|bil_width_loop_null_1st| - ldrb r6, [r0] ; load data - ldrb r7, [r0, #1] - ldrb r8, [r0, #2] - ldrb r9, [r0, #3] - - strh r6, [r1], r3 ; store it to immediate buffer - add r0, r0, #4 - strh r7, [r1], r3 - subs lr, lr, #1 - strh r8, [r1], r3 - strh r9, [r1], r3 - - bne bil_width_loop_null_1st - - subs r12, r12, #1 - add r0, r0, r2 ; move to next input line - add r11, r11, #2 ; move over to next column - mov r1, r11 - - bne bil_height_loop_null_1st - - ldmia sp!, {r4 - r11, pc} - - ENDP ; |vp8_filter_block2d_bil_first_pass_armv6| - - -;--------------------------------- -; r0 unsigned short *src_ptr, -; r1 unsigned char *dst_ptr, -; r2 int dst_pitch, -; r3 unsigned int height, -; stack unsigned int width, -; stack const short *vp8_filter -;--------------------------------- -|vp8_filter_block2d_bil_second_pass_armv6| PROC - stmdb sp!, {r4 - r11, lr} - - ldr r11, [sp, #40] ; vp8_filter address - ldr r4, [sp, #36] ; width - - ldr r5, [r11] ; load up filter coefficients - mov r12, r4 ; outer-loop counter = width, since we work on transposed data matrix - mov r11, r1 - - cmp r5, #128 ; if filter coef = 128, then skip the filter - beq bil_null_2nd_filter - -|bil_height_loop_2nd| - ldr r6, [r0] ; load the data - ldr r8, [r0, #4] - ldrh r10, [r0, #8] - mov lr, r3, lsr #2 ; loop counter - -|bil_width_loop_2nd| - pkhtb r7, r6, r8 ; src[1] | src[2] - pkhtb r9, r8, r10 ; src[3] | src[4] - - smuad r6, r6, r5 ; apply filter - smuad r8, r8, r5 ; apply filter - - subs lr, lr, #1 - - smuadx r7, r7, r5 ; apply filter - smuadx r9, r9, r5 ; apply filter - - add r0, r0, #8 - - add r6, r6, #0x40 ; round_shift_and_clamp - add r7, r7, #0x40 - usat r6, #8, r6, asr #7 - usat r7, #8, r7, asr #7 - strb r6, [r1], r2 ; the result is transposed back and stored - - add r8, r8, #0x40 ; round_shift_and_clamp - strb r7, [r1], r2 - add r9, r9, #0x40 - usat r8, #8, r8, asr #7 - usat r9, #8, r9, asr #7 - strb r8, [r1], r2 ; the result is transposed back and stored - - ldrne r6, [r0] ; load data - strb r9, [r1], r2 - ldrne r8, [r0, #4] - ldrneh r10, [r0, #8] - - bne bil_width_loop_2nd - - subs r12, r12, #1 - add r0, r0, #4 ; update src for next row - add r11, r11, #1 - mov r1, r11 - - bne bil_height_loop_2nd - ldmia sp!, {r4 - r11, pc} - -|bil_null_2nd_filter| -|bil_height_loop_null_2nd| - mov lr, r3, lsr #2 - -|bil_width_loop_null_2nd| - ldr r6, [r0], #4 ; load data - subs lr, lr, #1 - ldr r8, [r0], #4 - - strb r6, [r1], r2 ; store data - mov r7, r6, lsr #16 - strb r7, [r1], r2 - mov r9, r8, lsr #16 - strb r8, [r1], r2 - strb r9, [r1], r2 - - bne bil_width_loop_null_2nd - - subs r12, r12, #1 - add r0, r0, #4 - add r11, r11, #1 - mov r1, r11 - - bne bil_height_loop_null_2nd - - ldmia sp!, {r4 - r11, pc} - ENDP ; |vp8_filter_block2d_second_pass_armv6| - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/copymem16x16_v6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/copymem16x16_v6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/copymem16x16_v6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/copymem16x16_v6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,186 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - EXPORT |vp8_copy_mem16x16_v6| - ; ARM - ; REQUIRE8 - ; PRESERVE8 - - AREA Block, CODE, READONLY ; name this block of code -;void copy_mem16x16_v6( unsigned char *src, int src_stride, unsigned char *dst, int dst_stride) -;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -|vp8_copy_mem16x16_v6| PROC - stmdb sp!, {r4 - r7} - ;push {r4-r7} - - ;preload - pld [r0, #31] ; preload for next 16x16 block - - ands r4, r0, #15 - beq copy_mem16x16_fast - - ands r4, r0, #7 - beq copy_mem16x16_8 - - ands r4, r0, #3 - beq copy_mem16x16_4 - - ;copy one byte each time - ldrb r4, [r0] - ldrb r5, [r0, #1] - ldrb r6, [r0, #2] - ldrb r7, [r0, #3] - - mov r12, #16 - -copy_mem16x16_1_loop - strb r4, [r2] - strb r5, [r2, #1] - strb r6, [r2, #2] - strb r7, [r2, #3] - - ldrb r4, [r0, #4] - ldrb r5, [r0, #5] - ldrb r6, [r0, #6] - ldrb r7, [r0, #7] - - subs r12, r12, #1 - - strb r4, [r2, #4] - strb r5, [r2, #5] - strb r6, [r2, #6] - strb r7, [r2, #7] - - ldrb r4, [r0, #8] - ldrb r5, [r0, #9] - ldrb r6, [r0, #10] - ldrb r7, [r0, #11] - - strb r4, [r2, #8] - strb r5, [r2, #9] - strb r6, [r2, #10] - strb r7, [r2, #11] - - ldrb r4, [r0, #12] - ldrb r5, [r0, #13] - ldrb r6, [r0, #14] - ldrb r7, [r0, #15] - - add r0, r0, r1 - - strb r4, [r2, #12] - strb r5, [r2, #13] - strb r6, [r2, #14] - strb r7, [r2, #15] - - add r2, r2, r3 - - ldrneb r4, [r0] - ldrneb r5, [r0, #1] - ldrneb r6, [r0, #2] - ldrneb r7, [r0, #3] - - pld [r0, #31] ; preload for next 16x16 block - - bne copy_mem16x16_1_loop - - ldmia sp!, {r4 - r7} - ;pop {r4-r7} - mov pc, lr - -;copy 4 bytes each time -copy_mem16x16_4 - ldr r4, [r0] - ldr r5, [r0, #4] - ldr r6, [r0, #8] - ldr r7, [r0, #12] - - mov r12, #16 - -copy_mem16x16_4_loop - subs r12, r12, #1 - add r0, r0, r1 - - str r4, [r2] - str r5, [r2, #4] - str r6, [r2, #8] - str r7, [r2, #12] - - add r2, r2, r3 - - ldrne r4, [r0] - ldrne r5, [r0, #4] - ldrne r6, [r0, #8] - ldrne r7, [r0, #12] - - pld [r0, #31] ; preload for next 16x16 block - - bne copy_mem16x16_4_loop - - ldmia sp!, {r4 - r7} - ;pop {r4-r7} - mov pc, lr - -;copy 8 bytes each time -copy_mem16x16_8 - sub r1, r1, #16 - sub r3, r3, #16 - - mov r12, #16 - -copy_mem16x16_8_loop - ldmia r0!, {r4-r5} - ;ldm r0, {r4-r5} - ldmia r0!, {r6-r7} - - add r0, r0, r1 - - stmia r2!, {r4-r5} - subs r12, r12, #1 - ;stm r2, {r4-r5} - stmia r2!, {r6-r7} - - add r2, r2, r3 - - pld [r0, #31] ; preload for next 16x16 block - bne copy_mem16x16_8_loop - - ldmia sp!, {r4 - r7} - ;pop {r4-r7} - mov pc, lr - -;copy 16 bytes each time -copy_mem16x16_fast - ;sub r1, r1, #16 - ;sub r3, r3, #16 - - mov r12, #16 - -copy_mem16x16_fast_loop - ldmia r0, {r4-r7} - ;ldm r0, {r4-r7} - add r0, r0, r1 - - subs r12, r12, #1 - stmia r2, {r4-r7} - ;stm r2, {r4-r7} - add r2, r2, r3 - - pld [r0, #31] ; preload for next 16x16 block - bne copy_mem16x16_fast_loop - - ldmia sp!, {r4 - r7} - ;pop {r4-r7} - mov pc, lr - - ENDP ; |vp8_copy_mem16x16_v6| - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/copymem8x4_v6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/copymem8x4_v6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/copymem8x4_v6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/copymem8x4_v6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,128 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - EXPORT |vp8_copy_mem8x4_v6| - ; ARM - ; REQUIRE8 - ; PRESERVE8 - - AREA Block, CODE, READONLY ; name this block of code -;void vp8_copy_mem8x4_v6( unsigned char *src, int src_stride, unsigned char *dst, int dst_stride) -;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -|vp8_copy_mem8x4_v6| PROC - ;push {r4-r5} - stmdb sp!, {r4-r5} - - ;preload - pld [r0] - pld [r0, r1] - pld [r0, r1, lsl #1] - - ands r4, r0, #7 - beq copy_mem8x4_fast - - ands r4, r0, #3 - beq copy_mem8x4_4 - - ;copy 1 byte each time - ldrb r4, [r0] - ldrb r5, [r0, #1] - - mov r12, #4 - -copy_mem8x4_1_loop - strb r4, [r2] - strb r5, [r2, #1] - - ldrb r4, [r0, #2] - ldrb r5, [r0, #3] - - subs r12, r12, #1 - - strb r4, [r2, #2] - strb r5, [r2, #3] - - ldrb r4, [r0, #4] - ldrb r5, [r0, #5] - - strb r4, [r2, #4] - strb r5, [r2, #5] - - ldrb r4, [r0, #6] - ldrb r5, [r0, #7] - - add r0, r0, r1 - - strb r4, [r2, #6] - strb r5, [r2, #7] - - add r2, r2, r3 - - ldrneb r4, [r0] - ldrneb r5, [r0, #1] - - bne copy_mem8x4_1_loop - - ldmia sp!, {r4 - r5} - ;pop {r4-r5} - mov pc, lr - -;copy 4 bytes each time -copy_mem8x4_4 - ldr r4, [r0] - ldr r5, [r0, #4] - - mov r12, #4 - -copy_mem8x4_4_loop - subs r12, r12, #1 - add r0, r0, r1 - - str r4, [r2] - str r5, [r2, #4] - - add r2, r2, r3 - - ldrne r4, [r0] - ldrne r5, [r0, #4] - - bne copy_mem8x4_4_loop - - ldmia sp!, {r4-r5} - ;pop {r4-r5} - mov pc, lr - -;copy 8 bytes each time -copy_mem8x4_fast - ;sub r1, r1, #8 - ;sub r3, r3, #8 - - mov r12, #4 - -copy_mem8x4_fast_loop - ldmia r0, {r4-r5} - ;ldm r0, {r4-r5} - add r0, r0, r1 - - subs r12, r12, #1 - stmia r2, {r4-r5} - ;stm r2, {r4-r5} - add r2, r2, r3 - - bne copy_mem8x4_fast_loop - - ldmia sp!, {r4-r5} - ;pop {r4-r5} - mov pc, lr - - ENDP ; |vp8_copy_mem8x4_v6| - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/copymem8x8_v6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/copymem8x8_v6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/copymem8x8_v6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/copymem8x8_v6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,128 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - EXPORT |vp8_copy_mem8x8_v6| - ; ARM - ; REQUIRE8 - ; PRESERVE8 - - AREA Block, CODE, READONLY ; name this block of code -;void copy_mem8x8_v6( unsigned char *src, int src_stride, unsigned char *dst, int dst_stride) -;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -|vp8_copy_mem8x8_v6| PROC - ;push {r4-r5} - stmdb sp!, {r4-r5} - - ;preload - pld [r0] - pld [r0, r1] - pld [r0, r1, lsl #1] - - ands r4, r0, #7 - beq copy_mem8x8_fast - - ands r4, r0, #3 - beq copy_mem8x8_4 - - ;copy 1 byte each time - ldrb r4, [r0] - ldrb r5, [r0, #1] - - mov r12, #8 - -copy_mem8x8_1_loop - strb r4, [r2] - strb r5, [r2, #1] - - ldrb r4, [r0, #2] - ldrb r5, [r0, #3] - - subs r12, r12, #1 - - strb r4, [r2, #2] - strb r5, [r2, #3] - - ldrb r4, [r0, #4] - ldrb r5, [r0, #5] - - strb r4, [r2, #4] - strb r5, [r2, #5] - - ldrb r4, [r0, #6] - ldrb r5, [r0, #7] - - add r0, r0, r1 - - strb r4, [r2, #6] - strb r5, [r2, #7] - - add r2, r2, r3 - - ldrneb r4, [r0] - ldrneb r5, [r0, #1] - - bne copy_mem8x8_1_loop - - ldmia sp!, {r4 - r5} - ;pop {r4-r5} - mov pc, lr - -;copy 4 bytes each time -copy_mem8x8_4 - ldr r4, [r0] - ldr r5, [r0, #4] - - mov r12, #8 - -copy_mem8x8_4_loop - subs r12, r12, #1 - add r0, r0, r1 - - str r4, [r2] - str r5, [r2, #4] - - add r2, r2, r3 - - ldrne r4, [r0] - ldrne r5, [r0, #4] - - bne copy_mem8x8_4_loop - - ldmia sp!, {r4 - r5} - ;pop {r4-r5} - mov pc, lr - -;copy 8 bytes each time -copy_mem8x8_fast - ;sub r1, r1, #8 - ;sub r3, r3, #8 - - mov r12, #8 - -copy_mem8x8_fast_loop - ldmia r0, {r4-r5} - ;ldm r0, {r4-r5} - add r0, r0, r1 - - subs r12, r12, #1 - stmia r2, {r4-r5} - ;stm r2, {r4-r5} - add r2, r2, r3 - - bne copy_mem8x8_fast_loop - - ldmia sp!, {r4-r5} - ;pop {r4-r5} - mov pc, lr - - ENDP ; |vp8_copy_mem8x8_v6| - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/dc_only_idct_add_v6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/dc_only_idct_add_v6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/dc_only_idct_add_v6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/dc_only_idct_add_v6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license and patent -; grant that can be found in the LICENSE file in the root of the source -; tree. All contributing project authors may be found in the AUTHORS -; file in the root of the source tree. -; - - EXPORT |vp8_dc_only_idct_add_v6| - - AREA |.text|, CODE, READONLY - -;void vp8_dc_only_idct_add_c(short input_dc, unsigned char *pred_ptr, -; int pred_stride, unsigned char *dst_ptr, -; int dst_stride) -; r0 input_dc -; r1 pred_ptr -; r2 pred_stride -; r3 dst_ptr -; sp dst_stride - -|vp8_dc_only_idct_add_v6| PROC - stmdb sp!, {r4 - r7} - - add r0, r0, #4 ; input_dc += 4 - ldr r12, c0x0000FFFF - ldr r4, [r1], r2 - and r0, r12, r0, asr #3 ; input_dc >> 3 + mask - ldr r6, [r1], r2 - orr r0, r0, r0, lsl #16 ; a1 | a1 - - ldr r12, [sp, #16] ; dst stride - - uxtab16 r5, r0, r4 ; a1+2 | a1+0 - uxtab16 r4, r0, r4, ror #8 ; a1+3 | a1+1 - uxtab16 r7, r0, r6 - uxtab16 r6, r0, r6, ror #8 - usat16 r5, #8, r5 - usat16 r4, #8, r4 - usat16 r7, #8, r7 - usat16 r6, #8, r6 - orr r5, r5, r4, lsl #8 - orr r7, r7, r6, lsl #8 - ldr r4, [r1], r2 - str r5, [r3], r12 - ldr r6, [r1] - str r7, [r3], r12 - - uxtab16 r5, r0, r4 - uxtab16 r4, r0, r4, ror #8 - uxtab16 r7, r0, r6 - uxtab16 r6, r0, r6, ror #8 - usat16 r5, #8, r5 - usat16 r4, #8, r4 - usat16 r7, #8, r7 - usat16 r6, #8, r6 - orr r5, r5, r4, lsl #8 - orr r7, r7, r6, lsl #8 - str r5, [r3], r12 - str r7, [r3] - - ldmia sp!, {r4 - r7} - bx lr - - ENDP ; |vp8_dc_only_idct_add_v6| - -; Constant Pool -c0x0000FFFF DCD 0x0000FFFF - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/dequant_idct_v6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/dequant_idct_v6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/dequant_idct_v6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/dequant_idct_v6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,190 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license and patent -; grant that can be found in the LICENSE file in the root of the source -; tree. All contributing project authors may be found in the AUTHORS -; file in the root of the source tree. -; - - EXPORT |vp8_dequant_idct_add_v6| - - AREA |.text|, CODE, READONLY -;void vp8_dequant_idct_v6(short *input, short *dq, -; unsigned char *dest, int stride) -; r0 = q -; r1 = dq -; r2 = dst -; r3 = stride - -|vp8_dequant_idct_add_v6| PROC - stmdb sp!, {r4-r11, lr} - - ldr r4, [r0] ;input - ldr r5, [r1], #4 ;dq - - sub sp, sp, #4 - str r3, [sp] - - mov r12, #4 - -vp8_dequant_add_loop - smulbb r6, r4, r5 - smultt r7, r4, r5 - - ldr r4, [r0, #4] ;input - ldr r5, [r1], #4 ;dq - - strh r6, [r0], #2 - strh r7, [r0], #2 - - smulbb r6, r4, r5 - smultt r7, r4, r5 - - subs r12, r12, #1 - - ldrne r4, [r0, #4] - ldrne r5, [r1], #4 - - strh r6, [r0], #2 - strh r7, [r0], #2 - - bne vp8_dequant_add_loop - - sub r0, r0, #32 - mov r1, r0 - -; short_idct4x4llm_v6_dual - ldr r3, cospi8sqrt2minus1 - ldr r4, sinpi8sqrt2 - ldr r6, [r0, #8] - mov r5, #2 -vp8_dequant_idct_loop1_v6 - ldr r12, [r0, #24] - ldr r14, [r0, #16] - smulwt r9, r3, r6 - smulwb r7, r3, r6 - smulwt r10, r4, r6 - smulwb r8, r4, r6 - pkhbt r7, r7, r9, lsl #16 - smulwt r11, r3, r12 - pkhbt r8, r8, r10, lsl #16 - uadd16 r6, r6, r7 - smulwt r7, r4, r12 - smulwb r9, r3, r12 - smulwb r10, r4, r12 - subs r5, r5, #1 - pkhbt r9, r9, r11, lsl #16 - ldr r11, [r0], #4 - pkhbt r10, r10, r7, lsl #16 - uadd16 r7, r12, r9 - usub16 r7, r8, r7 - uadd16 r6, r6, r10 - uadd16 r10, r11, r14 - usub16 r8, r11, r14 - uadd16 r9, r10, r6 - usub16 r10, r10, r6 - uadd16 r6, r8, r7 - usub16 r7, r8, r7 - str r6, [r1, #8] - ldrne r6, [r0, #8] - str r7, [r1, #16] - str r10, [r1, #24] - str r9, [r1], #4 - bne vp8_dequant_idct_loop1_v6 - - mov r5, #2 - sub r0, r1, #8 -vp8_dequant_idct_loop2_v6 - ldr r6, [r0], #4 - ldr r7, [r0], #4 - ldr r8, [r0], #4 - ldr r9, [r0], #4 - smulwt r1, r3, r6 - smulwt r12, r4, r6 - smulwt lr, r3, r8 - smulwt r10, r4, r8 - pkhbt r11, r8, r6, lsl #16 - pkhbt r1, lr, r1, lsl #16 - pkhbt r12, r10, r12, lsl #16 - pkhtb r6, r6, r8, asr #16 - uadd16 r6, r1, r6 - pkhbt lr, r9, r7, lsl #16 - uadd16 r10, r11, lr - usub16 lr, r11, lr - pkhtb r8, r7, r9, asr #16 - subs r5, r5, #1 - smulwt r1, r3, r8 - smulwb r7, r3, r8 - smulwt r11, r4, r8 - smulwb r9, r4, r8 - pkhbt r1, r7, r1, lsl #16 - uadd16 r8, r1, r8 - pkhbt r11, r9, r11, lsl #16 - usub16 r1, r12, r8 - uadd16 r8, r11, r6 - ldr r9, c0x00040004 - ldr r12, [sp] ; get stride from stack - uadd16 r6, r10, r8 - usub16 r7, r10, r8 - uadd16 r7, r7, r9 - uadd16 r6, r6, r9 - uadd16 r10, r14, r1 - usub16 r1, r14, r1 - uadd16 r10, r10, r9 - uadd16 r1, r1, r9 - ldr r11, [r2] ; load input from dst - mov r8, r7, asr #3 - pkhtb r9, r8, r10, asr #19 - mov r8, r1, asr #3 - pkhtb r8, r8, r6, asr #19 - uxtb16 lr, r11, ror #8 - qadd16 r9, r9, lr - uxtb16 lr, r11 - qadd16 r8, r8, lr - usat16 r9, #8, r9 - usat16 r8, #8, r8 - orr r9, r8, r9, lsl #8 - ldr r11, [r2, r12] ; load input from dst - mov r7, r7, lsl #16 - mov r1, r1, lsl #16 - mov r10, r10, lsl #16 - mov r6, r6, lsl #16 - mov r7, r7, asr #3 - pkhtb r7, r7, r10, asr #19 - mov r1, r1, asr #3 - pkhtb r1, r1, r6, asr #19 - uxtb16 r8, r11, ror #8 - qadd16 r7, r7, r8 - uxtb16 r8, r11 - qadd16 r1, r1, r8 - usat16 r7, #8, r7 - usat16 r1, #8, r1 - orr r1, r1, r7, lsl #8 - str r9, [r2], r12 ; store output to dst - str r1, [r2], r12 ; store output to dst - bne vp8_dequant_idct_loop2_v6 - -; vpx_memset - sub r0, r0, #32 - add sp, sp, #4 - - mov r12, #0 - str r12, [r0] - str r12, [r0, #4] - str r12, [r0, #8] - str r12, [r0, #12] - str r12, [r0, #16] - str r12, [r0, #20] - str r12, [r0, #24] - str r12, [r0, #28] - - ldmia sp!, {r4 - r11, pc} - ENDP ; |vp8_dequant_idct_add_v6| - -; Constant Pool -cospi8sqrt2minus1 DCD 0x00004E7B -sinpi8sqrt2 DCD 0x00008A8C -c0x00040004 DCD 0x00040004 - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/dequantize_v6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/dequantize_v6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/dequantize_v6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/dequantize_v6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - EXPORT |vp8_dequantize_b_loop_v6| - - AREA |.text|, CODE, READONLY ; name this block of code -;------------------------------- -;void vp8_dequantize_b_loop_v6(short *Q, short *DQC, short *DQ); -; r0 short *Q, -; r1 short *DQC -; r2 short *DQ -|vp8_dequantize_b_loop_v6| PROC - stmdb sp!, {r4-r9, lr} - - ldr r3, [r0] ;load Q - ldr r4, [r1] ;load DQC - ldr r5, [r0, #4] - ldr r6, [r1, #4] - - mov r12, #2 ;loop counter - -dequant_loop - smulbb r7, r3, r4 ;multiply - smultt r8, r3, r4 - smulbb r9, r5, r6 - smultt lr, r5, r6 - - ldr r3, [r0, #8] - ldr r4, [r1, #8] - ldr r5, [r0, #12] - ldr r6, [r1, #12] - - strh r7, [r2], #2 ;store result - smulbb r7, r3, r4 ;multiply - strh r8, [r2], #2 - smultt r8, r3, r4 - strh r9, [r2], #2 - smulbb r9, r5, r6 - strh lr, [r2], #2 - smultt lr, r5, r6 - - subs r12, r12, #1 - - add r0, r0, #16 - add r1, r1, #16 - - ldrne r3, [r0] - strh r7, [r2], #2 ;store result - ldrne r4, [r1] - strh r8, [r2], #2 - ldrne r5, [r0, #4] - strh r9, [r2], #2 - ldrne r6, [r1, #4] - strh lr, [r2], #2 - - bne dequant_loop - - ldmia sp!, {r4-r9, pc} - ENDP ;|vp8_dequantize_b_loop_v6| - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/filter_v6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/filter_v6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/filter_v6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/filter_v6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,624 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - EXPORT |vp8_filter_block2d_first_pass_armv6| - EXPORT |vp8_filter_block2d_first_pass_16x16_armv6| - EXPORT |vp8_filter_block2d_first_pass_8x8_armv6| - EXPORT |vp8_filter_block2d_second_pass_armv6| - EXPORT |vp8_filter4_block2d_second_pass_armv6| - EXPORT |vp8_filter_block2d_first_pass_only_armv6| - EXPORT |vp8_filter_block2d_second_pass_only_armv6| - - AREA |.text|, CODE, READONLY ; name this block of code -;------------------------------------- -; r0 unsigned char *src_ptr -; r1 short *output_ptr -; r2 unsigned int src_pixels_per_line -; r3 unsigned int output_width -; stack unsigned int output_height -; stack const short *vp8_filter -;------------------------------------- -; vp8_filter the input and put in the output array. Apply the 6 tap FIR filter with -; the output being a 2 byte value and the intput being a 1 byte value. -|vp8_filter_block2d_first_pass_armv6| PROC - stmdb sp!, {r4 - r11, lr} - - ldr r11, [sp, #40] ; vp8_filter address - ldr r7, [sp, #36] ; output height - - sub r2, r2, r3 ; inside loop increments input array, - ; so the height loop only needs to add - ; r2 - width to the input pointer - - mov r3, r3, lsl #1 ; multiply width by 2 because using shorts - add r12, r3, #16 ; square off the output - sub sp, sp, #4 - - ldr r4, [r11] ; load up packed filter coefficients - ldr r5, [r11, #4] - ldr r6, [r11, #8] - - str r1, [sp] ; push destination to stack - mov r7, r7, lsl #16 ; height is top part of counter - -; six tap filter -|height_loop_1st_6| - ldrb r8, [r0, #-2] ; load source data - ldrb r9, [r0, #-1] - ldrb r10, [r0], #2 - orr r7, r7, r3, lsr #2 ; construct loop counter - -|width_loop_1st_6| - ldrb r11, [r0, #-1] - - pkhbt lr, r8, r9, lsl #16 ; r9 | r8 - pkhbt r8, r9, r10, lsl #16 ; r10 | r9 - - ldrb r9, [r0] - - smuad lr, lr, r4 ; apply the filter - pkhbt r10, r10, r11, lsl #16 ; r11 | r10 - smuad r8, r8, r4 - pkhbt r11, r11, r9, lsl #16 ; r9 | r11 - - smlad lr, r10, r5, lr - ldrb r10, [r0, #1] - smlad r8, r11, r5, r8 - ldrb r11, [r0, #2] - - sub r7, r7, #1 - - pkhbt r9, r9, r10, lsl #16 ; r10 | r9 - pkhbt r10, r10, r11, lsl #16 ; r11 | r10 - - smlad lr, r9, r6, lr - smlad r11, r10, r6, r8 - - ands r10, r7, #0xff ; test loop counter - - add lr, lr, #0x40 ; round_shift_and_clamp - ldrneb r8, [r0, #-2] ; load data for next loop - usat lr, #8, lr, asr #7 - add r11, r11, #0x40 - ldrneb r9, [r0, #-1] - usat r11, #8, r11, asr #7 - - strh lr, [r1], r12 ; result is transposed and stored, which - ; will make second pass filtering easier. - ldrneb r10, [r0], #2 - strh r11, [r1], r12 - - bne width_loop_1st_6 - - ldr r1, [sp] ; load and update dst address - subs r7, r7, #0x10000 - add r0, r0, r2 ; move to next input line - - add r1, r1, #2 ; move over to next column - str r1, [sp] - - bne height_loop_1st_6 - - add sp, sp, #4 - ldmia sp!, {r4 - r11, pc} - - ENDP - -; -------------------------- -; 16x16 version -; ----------------------------- -|vp8_filter_block2d_first_pass_16x16_armv6| PROC - stmdb sp!, {r4 - r11, lr} - - ldr r11, [sp, #40] ; vp8_filter address - ldr r7, [sp, #36] ; output height - - add r4, r2, #18 ; preload next low - pld [r0, r4] - - sub r2, r2, r3 ; inside loop increments input array, - ; so the height loop only needs to add - ; r2 - width to the input pointer - - mov r3, r3, lsl #1 ; multiply width by 2 because using shorts - add r12, r3, #16 ; square off the output - sub sp, sp, #4 - - ldr r4, [r11] ; load up packed filter coefficients - ldr r5, [r11, #4] - ldr r6, [r11, #8] - - str r1, [sp] ; push destination to stack - mov r7, r7, lsl #16 ; height is top part of counter - -; six tap filter -|height_loop_1st_16_6| - ldrb r8, [r0, #-2] ; load source data - ldrb r9, [r0, #-1] - ldrb r10, [r0], #2 - orr r7, r7, r3, lsr #2 ; construct loop counter - -|width_loop_1st_16_6| - ldrb r11, [r0, #-1] - - pkhbt lr, r8, r9, lsl #16 ; r9 | r8 - pkhbt r8, r9, r10, lsl #16 ; r10 | r9 - - ldrb r9, [r0] - - smuad lr, lr, r4 ; apply the filter - pkhbt r10, r10, r11, lsl #16 ; r11 | r10 - smuad r8, r8, r4 - pkhbt r11, r11, r9, lsl #16 ; r9 | r11 - - smlad lr, r10, r5, lr - ldrb r10, [r0, #1] - smlad r8, r11, r5, r8 - ldrb r11, [r0, #2] - - sub r7, r7, #1 - - pkhbt r9, r9, r10, lsl #16 ; r10 | r9 - pkhbt r10, r10, r11, lsl #16 ; r11 | r10 - - smlad lr, r9, r6, lr - smlad r11, r10, r6, r8 - - ands r10, r7, #0xff ; test loop counter - - add lr, lr, #0x40 ; round_shift_and_clamp - ldrneb r8, [r0, #-2] ; load data for next loop - usat lr, #8, lr, asr #7 - add r11, r11, #0x40 - ldrneb r9, [r0, #-1] - usat r11, #8, r11, asr #7 - - strh lr, [r1], r12 ; result is transposed and stored, which - ; will make second pass filtering easier. - ldrneb r10, [r0], #2 - strh r11, [r1], r12 - - bne width_loop_1st_16_6 - - ldr r1, [sp] ; load and update dst address - subs r7, r7, #0x10000 - add r0, r0, r2 ; move to next input line - - add r11, r2, #34 ; adding back block width(=16) - pld [r0, r11] ; preload next low - - add r1, r1, #2 ; move over to next column - str r1, [sp] - - bne height_loop_1st_16_6 - - add sp, sp, #4 - ldmia sp!, {r4 - r11, pc} - - ENDP - -; -------------------------- -; 8x8 version -; ----------------------------- -|vp8_filter_block2d_first_pass_8x8_armv6| PROC - stmdb sp!, {r4 - r11, lr} - - ldr r11, [sp, #40] ; vp8_filter address - ldr r7, [sp, #36] ; output height - - add r4, r2, #10 ; preload next low - pld [r0, r4] - - sub r2, r2, r3 ; inside loop increments input array, - ; so the height loop only needs to add - ; r2 - width to the input pointer - - mov r3, r3, lsl #1 ; multiply width by 2 because using shorts - add r12, r3, #16 ; square off the output - sub sp, sp, #4 - - ldr r4, [r11] ; load up packed filter coefficients - ldr r5, [r11, #4] - ldr r6, [r11, #8] - - str r1, [sp] ; push destination to stack - mov r7, r7, lsl #16 ; height is top part of counter - -; six tap filter -|height_loop_1st_8_6| - ldrb r8, [r0, #-2] ; load source data - ldrb r9, [r0, #-1] - ldrb r10, [r0], #2 - orr r7, r7, r3, lsr #2 ; construct loop counter - -|width_loop_1st_8_6| - ldrb r11, [r0, #-1] - - pkhbt lr, r8, r9, lsl #16 ; r9 | r8 - pkhbt r8, r9, r10, lsl #16 ; r10 | r9 - - ldrb r9, [r0] - - smuad lr, lr, r4 ; apply the filter - pkhbt r10, r10, r11, lsl #16 ; r11 | r10 - smuad r8, r8, r4 - pkhbt r11, r11, r9, lsl #16 ; r9 | r11 - - smlad lr, r10, r5, lr - ldrb r10, [r0, #1] - smlad r8, r11, r5, r8 - ldrb r11, [r0, #2] - - sub r7, r7, #1 - - pkhbt r9, r9, r10, lsl #16 ; r10 | r9 - pkhbt r10, r10, r11, lsl #16 ; r11 | r10 - - smlad lr, r9, r6, lr - smlad r11, r10, r6, r8 - - ands r10, r7, #0xff ; test loop counter - - add lr, lr, #0x40 ; round_shift_and_clamp - ldrneb r8, [r0, #-2] ; load data for next loop - usat lr, #8, lr, asr #7 - add r11, r11, #0x40 - ldrneb r9, [r0, #-1] - usat r11, #8, r11, asr #7 - - strh lr, [r1], r12 ; result is transposed and stored, which - ; will make second pass filtering easier. - ldrneb r10, [r0], #2 - strh r11, [r1], r12 - - bne width_loop_1st_8_6 - - ldr r1, [sp] ; load and update dst address - subs r7, r7, #0x10000 - add r0, r0, r2 ; move to next input line - - add r11, r2, #18 ; adding back block width(=8) - pld [r0, r11] ; preload next low - - add r1, r1, #2 ; move over to next column - str r1, [sp] - - bne height_loop_1st_8_6 - - add sp, sp, #4 - ldmia sp!, {r4 - r11, pc} - - ENDP - -;--------------------------------- -; r0 short *src_ptr, -; r1 unsigned char *output_ptr, -; r2 unsigned int output_pitch, -; r3 unsigned int cnt, -; stack const short *vp8_filter -;--------------------------------- -|vp8_filter_block2d_second_pass_armv6| PROC - stmdb sp!, {r4 - r11, lr} - - ldr r11, [sp, #36] ; vp8_filter address - sub sp, sp, #4 - mov r7, r3, lsl #16 ; height is top part of counter - str r1, [sp] ; push destination to stack - - ldr r4, [r11] ; load up packed filter coefficients - ldr r5, [r11, #4] - ldr r6, [r11, #8] - - pkhbt r12, r5, r4 ; pack the filter differently - pkhbt r11, r6, r5 - - sub r0, r0, #4 ; offset input buffer - -|height_loop_2nd| - ldr r8, [r0] ; load the data - ldr r9, [r0, #4] - orr r7, r7, r3, lsr #1 ; loop counter - -|width_loop_2nd| - smuad lr, r4, r8 ; apply filter - sub r7, r7, #1 - smulbt r8, r4, r8 - - ldr r10, [r0, #8] - - smlad lr, r5, r9, lr - smladx r8, r12, r9, r8 - - ldrh r9, [r0, #12] - - smlad lr, r6, r10, lr - smladx r8, r11, r10, r8 - - add r0, r0, #4 - smlatb r10, r6, r9, r8 - - add lr, lr, #0x40 ; round_shift_and_clamp - ands r8, r7, #0xff - usat lr, #8, lr, asr #7 - add r10, r10, #0x40 - strb lr, [r1], r2 ; the result is transposed back and stored - usat r10, #8, r10, asr #7 - - ldrne r8, [r0] ; load data for next loop - ldrne r9, [r0, #4] - strb r10, [r1], r2 - - bne width_loop_2nd - - ldr r1, [sp] ; update dst for next loop - subs r7, r7, #0x10000 - add r0, r0, #16 ; updata src for next loop - add r1, r1, #1 - str r1, [sp] - - bne height_loop_2nd - - add sp, sp, #4 - ldmia sp!, {r4 - r11, pc} - - ENDP - -;--------------------------------- -; r0 short *src_ptr, -; r1 unsigned char *output_ptr, -; r2 unsigned int output_pitch, -; r3 unsigned int cnt, -; stack const short *vp8_filter -;--------------------------------- -|vp8_filter4_block2d_second_pass_armv6| PROC - stmdb sp!, {r4 - r11, lr} - - ldr r11, [sp, #36] ; vp8_filter address - mov r7, r3, lsl #16 ; height is top part of counter - - ldr r4, [r11] ; load up packed filter coefficients - add lr, r1, r3 ; save final destination pointer - ldr r5, [r11, #4] - ldr r6, [r11, #8] - - pkhbt r12, r5, r4 ; pack the filter differently - pkhbt r11, r6, r5 - mov r4, #0x40 ; rounding factor (for smlad{x}) - -|height_loop_2nd_4| - ldrd r8, r9, [r0, #-4] ; load the data - orr r7, r7, r3, lsr #1 ; loop counter - -|width_loop_2nd_4| - ldr r10, [r0, #4]! - smladx r6, r9, r12, r4 ; apply filter - pkhbt r8, r9, r8 - smlad r5, r8, r12, r4 - pkhbt r8, r10, r9 - smladx r6, r10, r11, r6 - sub r7, r7, #1 - smlad r5, r8, r11, r5 - - mov r8, r9 ; shift the data for the next loop - mov r9, r10 - - usat r6, #8, r6, asr #7 ; shift and clamp - usat r5, #8, r5, asr #7 - - strb r5, [r1], r2 ; the result is transposed back and stored - tst r7, #0xff - strb r6, [r1], r2 - - bne width_loop_2nd_4 - - subs r7, r7, #0x10000 - add r0, r0, #16 ; update src for next loop - sub r1, lr, r7, lsr #16 ; update dst for next loop - - bne height_loop_2nd_4 - - ldmia sp!, {r4 - r11, pc} - - ENDP - -;------------------------------------ -; r0 unsigned char *src_ptr -; r1 unsigned char *output_ptr, -; r2 unsigned int src_pixels_per_line -; r3 unsigned int cnt, -; stack unsigned int output_pitch, -; stack const short *vp8_filter -;------------------------------------ -|vp8_filter_block2d_first_pass_only_armv6| PROC - stmdb sp!, {r4 - r11, lr} - - add r7, r2, r3 ; preload next low - add r7, r7, #2 - pld [r0, r7] - - ldr r4, [sp, #36] ; output pitch - ldr r11, [sp, #40] ; HFilter address - sub sp, sp, #8 - - mov r7, r3 - sub r2, r2, r3 ; inside loop increments input array, - ; so the height loop only needs to add - ; r2 - width to the input pointer - - sub r4, r4, r3 - str r4, [sp] ; save modified output pitch - str r2, [sp, #4] - - mov r2, #0x40 - - ldr r4, [r11] ; load up packed filter coefficients - ldr r5, [r11, #4] - ldr r6, [r11, #8] - -; six tap filter -|height_loop_1st_only_6| - ldrb r8, [r0, #-2] ; load data - ldrb r9, [r0, #-1] - ldrb r10, [r0], #2 - - mov r12, r3, lsr #1 ; loop counter - -|width_loop_1st_only_6| - ldrb r11, [r0, #-1] - - pkhbt lr, r8, r9, lsl #16 ; r9 | r8 - pkhbt r8, r9, r10, lsl #16 ; r10 | r9 - - ldrb r9, [r0] - -;; smuad lr, lr, r4 - smlad lr, lr, r4, r2 - pkhbt r10, r10, r11, lsl #16 ; r11 | r10 -;; smuad r8, r8, r4 - smlad r8, r8, r4, r2 - pkhbt r11, r11, r9, lsl #16 ; r9 | r11 - - smlad lr, r10, r5, lr - ldrb r10, [r0, #1] - smlad r8, r11, r5, r8 - ldrb r11, [r0, #2] - - subs r12, r12, #1 - - pkhbt r9, r9, r10, lsl #16 ; r10 | r9 - pkhbt r10, r10, r11, lsl #16 ; r11 | r10 - - smlad lr, r9, r6, lr - smlad r10, r10, r6, r8 - -;; add lr, lr, #0x40 ; round_shift_and_clamp - ldrneb r8, [r0, #-2] ; load data for next loop - usat lr, #8, lr, asr #7 -;; add r10, r10, #0x40 - strb lr, [r1], #1 ; store the result - usat r10, #8, r10, asr #7 - - ldrneb r9, [r0, #-1] - strb r10, [r1], #1 - ldrneb r10, [r0], #2 - - bne width_loop_1st_only_6 - - ldr lr, [sp] ; load back output pitch - ldr r12, [sp, #4] ; load back output pitch - subs r7, r7, #1 - add r0, r0, r12 ; updata src for next loop - - add r11, r12, r3 ; preload next low - add r11, r11, #2 - pld [r0, r11] - - add r1, r1, lr ; update dst for next loop - - bne height_loop_1st_only_6 - - add sp, sp, #8 - ldmia sp!, {r4 - r11, pc} - ENDP ; |vp8_filter_block2d_first_pass_only_armv6| - - -;------------------------------------ -; r0 unsigned char *src_ptr, -; r1 unsigned char *output_ptr, -; r2 unsigned int src_pixels_per_line -; r3 unsigned int cnt, -; stack unsigned int output_pitch, -; stack const short *vp8_filter -;------------------------------------ -|vp8_filter_block2d_second_pass_only_armv6| PROC - stmdb sp!, {r4 - r11, lr} - - ldr r11, [sp, #40] ; VFilter address - ldr r12, [sp, #36] ; output pitch - - mov r7, r3, lsl #16 ; height is top part of counter - sub r0, r0, r2, lsl #1 ; need 6 elements for filtering, 2 before, 3 after - - sub sp, sp, #8 - - ldr r4, [r11] ; load up packed filter coefficients - ldr r5, [r11, #4] - ldr r6, [r11, #8] - - str r0, [sp] ; save r0 to stack - str r1, [sp, #4] ; save dst to stack - -; six tap filter -|width_loop_2nd_only_6| - ldrb r8, [r0], r2 ; load data - orr r7, r7, r3 ; loop counter - ldrb r9, [r0], r2 - ldrb r10, [r0], r2 - -|height_loop_2nd_only_6| - ; filter first column in this inner loop, than, move to next colum. - ldrb r11, [r0], r2 - - pkhbt lr, r8, r9, lsl #16 ; r9 | r8 - pkhbt r8, r9, r10, lsl #16 ; r10 | r9 - - ldrb r9, [r0], r2 - - smuad lr, lr, r4 - pkhbt r10, r10, r11, lsl #16 ; r11 | r10 - smuad r8, r8, r4 - pkhbt r11, r11, r9, lsl #16 ; r9 | r11 - - smlad lr, r10, r5, lr - ldrb r10, [r0], r2 - smlad r8, r11, r5, r8 - ldrb r11, [r0] - - sub r7, r7, #2 - sub r0, r0, r2, lsl #2 - - pkhbt r9, r9, r10, lsl #16 ; r10 | r9 - pkhbt r10, r10, r11, lsl #16 ; r11 | r10 - - smlad lr, r9, r6, lr - smlad r10, r10, r6, r8 - - ands r9, r7, #0xff - - add lr, lr, #0x40 ; round_shift_and_clamp - ldrneb r8, [r0], r2 ; load data for next loop - usat lr, #8, lr, asr #7 - add r10, r10, #0x40 - strb lr, [r1], r12 ; store the result for the column - usat r10, #8, r10, asr #7 - - ldrneb r9, [r0], r2 - strb r10, [r1], r12 - ldrneb r10, [r0], r2 - - bne height_loop_2nd_only_6 - - ldr r0, [sp] - ldr r1, [sp, #4] - subs r7, r7, #0x10000 - add r0, r0, #1 ; move to filter next column - str r0, [sp] - add r1, r1, #1 - str r1, [sp, #4] - - bne width_loop_2nd_only_6 - - add sp, sp, #8 - - ldmia sp!, {r4 - r11, pc} - ENDP ; |vp8_filter_block2d_second_pass_only_armv6| - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/idct_blk_v6.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/idct_blk_v6.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/idct_blk_v6.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/idct_blk_v6.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vpx_config.h" -#include "vp8_rtcd.h" - - -void vp8_dequant_idct_add_y_block_v6(short *q, short *dq, - unsigned char *dst, - int stride, char *eobs) -{ - int i; - - for (i = 0; i < 4; i++) - { - if (eobs[0] > 1) - vp8_dequant_idct_add_v6 (q, dq, dst, stride); - else if (eobs[0] == 1) - { - vp8_dc_only_idct_add_v6 (q[0]*dq[0], dst, stride, dst, stride); - ((int *)q)[0] = 0; - } - - if (eobs[1] > 1) - vp8_dequant_idct_add_v6 (q+16, dq, dst+4, stride); - else if (eobs[1] == 1) - { - vp8_dc_only_idct_add_v6 (q[16]*dq[0], dst+4, stride, dst+4, stride); - ((int *)(q+16))[0] = 0; - } - - if (eobs[2] > 1) - vp8_dequant_idct_add_v6 (q+32, dq, dst+8, stride); - else if (eobs[2] == 1) - { - vp8_dc_only_idct_add_v6 (q[32]*dq[0], dst+8, stride, dst+8, stride); - ((int *)(q+32))[0] = 0; - } - - if (eobs[3] > 1) - vp8_dequant_idct_add_v6 (q+48, dq, dst+12, stride); - else if (eobs[3] == 1) - { - vp8_dc_only_idct_add_v6 (q[48]*dq[0], dst+12, stride,dst+12,stride); - ((int *)(q+48))[0] = 0; - } - - q += 64; - dst += 4*stride; - eobs += 4; - } -} - -void vp8_dequant_idct_add_uv_block_v6(short *q, short *dq, - unsigned char *dstu, - unsigned char *dstv, - int stride, char *eobs) -{ - int i; - - for (i = 0; i < 2; i++) - { - if (eobs[0] > 1) - vp8_dequant_idct_add_v6 (q, dq, dstu, stride); - else if (eobs[0] == 1) - { - vp8_dc_only_idct_add_v6 (q[0]*dq[0], dstu, stride, dstu, stride); - ((int *)q)[0] = 0; - } - - if (eobs[1] > 1) - vp8_dequant_idct_add_v6 (q+16, dq, dstu+4, stride); - else if (eobs[1] == 1) - { - vp8_dc_only_idct_add_v6 (q[16]*dq[0], dstu+4, stride, - dstu+4, stride); - ((int *)(q+16))[0] = 0; - } - - q += 32; - dstu += 4*stride; - eobs += 2; - } - - for (i = 0; i < 2; i++) - { - if (eobs[0] > 1) - vp8_dequant_idct_add_v6 (q, dq, dstv, stride); - else if (eobs[0] == 1) - { - vp8_dc_only_idct_add_v6 (q[0]*dq[0], dstv, stride, dstv, stride); - ((int *)q)[0] = 0; - } - - if (eobs[1] > 1) - vp8_dequant_idct_add_v6 (q+16, dq, dstv+4, stride); - else if (eobs[1] == 1) - { - vp8_dc_only_idct_add_v6 (q[16]*dq[0], dstv+4, stride, - dstv+4, stride); - ((int *)(q+16))[0] = 0; - } - - q += 32; - dstv += 4*stride; - eobs += 2; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/idct_v6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/idct_v6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/idct_v6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/idct_v6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,202 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - EXPORT |vp8_short_idct4x4llm_v6_dual| - - AREA |.text|, CODE, READONLY - - -; void vp8_short_idct4x4llm_c(short *input, unsigned char *pred, int pitch, -; unsigned char *dst, int stride) -; r0 short* input -; r1 unsigned char* pred -; r2 int pitch -; r3 unsigned char* dst -; sp int stride - -|vp8_short_idct4x4llm_v6_dual| PROC - stmdb sp!, {r4-r11, lr} - - sub sp, sp, #4 - - mov r4, #0x00008A00 ; sin - orr r4, r4, #0x0000008C ; sinpi8sqrt2 - - mov r5, #0x00004E00 ; cos - orr r5, r5, #0x0000007B ; cospi8sqrt2minus1 - orr r5, r5, #1<<31 ; loop counter on top bit - -loop1_dual - ldr r6, [r0, #(4*2)] ; i5 | i4 - ldr r12, [r0, #(12*2)] ; i13|i12 - ldr r14, [r0, #(8*2)] ; i9 | i8 - - smulbt r9, r5, r6 ; (ip[5] * cospi8sqrt2minus1) >> 16 - smulbb r7, r5, r6 ; (ip[4] * cospi8sqrt2minus1) >> 16 - smulwt r10, r4, r6 ; (ip[5] * sinpi8sqrt2) >> 16 - smulwb r8, r4, r6 ; (ip[4] * sinpi8sqrt2) >> 16 - - smulbt r11, r5, r12 ; (ip[13] * cospi8sqrt2minus1) >> 16 - pkhtb r7, r9, r7, asr #16 ; 5c | 4c - pkhbt r8, r8, r10, lsl #16 ; 5s | 4s - uadd16 r6, r6, r7 ; 5c+5 | 4c+4 - - smulwt r7, r4, r12 ; (ip[13] * sinpi8sqrt2) >> 16 - smulbb r9, r5, r12 ; (ip[12] * cospi8sqrt2minus1) >> 16 - smulwb r10, r4, r12 ; (ip[12] * sinpi8sqrt2) >> 16 - - subs r5, r5, #1<<31 ; i-- - - pkhtb r9, r11, r9, asr #16 ; 13c | 12c - ldr r11, [r0] ; i1 | i0 - pkhbt r10, r10, r7, lsl #16 ; 13s | 12s - uadd16 r7, r12, r9 ; 13c+13 | 12c+12 - - usub16 r7, r8, r7 ; c - uadd16 r6, r6, r10 ; d - uadd16 r10, r11, r14 ; a - usub16 r8, r11, r14 ; b - - uadd16 r9, r10, r6 ; a+d - usub16 r10, r10, r6 ; a-d - uadd16 r6, r8, r7 ; b+c - usub16 r7, r8, r7 ; b-c - - ; use input buffer to store intermediate results - str r6, [r0, #(4*2)] ; o5 | o4 - str r7, [r0, #(8*2)] ; o9 | o8 - str r10,[r0, #(12*2)] ; o13|o12 - str r9, [r0], #4 ; o1 | o0 - - bcs loop1_dual - - sub r0, r0, #8 ; reset input/output - str r0, [sp] - -loop2_dual - - ldr r6, [r0, #(4*2)] ; i5 | i4 - ldr r12,[r0, #(2*2)] ; i3 | i2 - ldr r14,[r0, #(6*2)] ; i7 | i6 - ldr r0, [r0, #(0*2)] ; i1 | i0 - - smulbt r9, r5, r6 ; (ip[5] * cospi8sqrt2minus1) >> 16 - smulbt r7, r5, r0 ; (ip[1] * cospi8sqrt2minus1) >> 16 - smulwt r10, r4, r6 ; (ip[5] * sinpi8sqrt2) >> 16 - smulwt r8, r4, r0 ; (ip[1] * sinpi8sqrt2) >> 16 - - pkhbt r11, r6, r0, lsl #16 ; i0 | i4 - pkhtb r7, r7, r9, asr #16 ; 1c | 5c - pkhtb r0, r0, r6, asr #16 ; i1 | i5 - pkhbt r8, r10, r8, lsl #16 ; 1s | 5s = temp1 - - uadd16 r0, r7, r0 ; 1c+1 | 5c+5 = temp2 - pkhbt r9, r14, r12, lsl #16 ; i2 | i6 - uadd16 r10, r11, r9 ; a - usub16 r9, r11, r9 ; b - pkhtb r6, r12, r14, asr #16 ; i3 | i7 - - subs r5, r5, #1<<31 ; i-- - - smulbt r7, r5, r6 ; (ip[3] * cospi8sqrt2minus1) >> 16 - smulwt r11, r4, r6 ; (ip[3] * sinpi8sqrt2) >> 16 - smulbb r12, r5, r6 ; (ip[7] * cospi8sqrt2minus1) >> 16 - smulwb r14, r4, r6 ; (ip[7] * sinpi8sqrt2) >> 16 - - pkhtb r7, r7, r12, asr #16 ; 3c | 7c - pkhbt r11, r14, r11, lsl #16 ; 3s | 7s = temp1 - - uadd16 r6, r7, r6 ; 3c+3 | 7c+7 = temp2 - usub16 r12, r8, r6 ; c (o1 | o5) - uadd16 r6, r11, r0 ; d (o3 | o7) - uadd16 r7, r10, r6 ; a+d - - mov r8, #4 ; set up 4's - orr r8, r8, #0x40000 ; 4|4 - - usub16 r6, r10, r6 ; a-d - uadd16 r6, r6, r8 ; a-d+4, 3|7 - uadd16 r7, r7, r8 ; a+d+4, 0|4 - uadd16 r10, r9, r12 ; b+c - usub16 r0, r9, r12 ; b-c - uadd16 r10, r10, r8 ; b+c+4, 1|5 - uadd16 r8, r0, r8 ; b-c+4, 2|6 - - ldr lr, [sp, #40] ; dst stride - - ldrb r0, [r1] ; pred p0 - ldrb r11, [r1, #1] ; pred p1 - ldrb r12, [r1, #2] ; pred p2 - - add r0, r0, r7, asr #19 ; p0 + o0 - add r11, r11, r10, asr #19 ; p1 + o1 - add r12, r12, r8, asr #19 ; p2 + o2 - - usat r0, #8, r0 ; d0 = clip8(p0 + o0) - usat r11, #8, r11 ; d1 = clip8(p1 + o1) - usat r12, #8, r12 ; d2 = clip8(p2 + o2) - - add r0, r0, r11, lsl #8 ; |--|--|d1|d0| - - ldrb r11, [r1, #3] ; pred p3 - - add r0, r0, r12, lsl #16 ; |--|d2|d1|d0| - - add r11, r11, r6, asr #19 ; p3 + o3 - - sxth r7, r7 ; - sxth r10, r10 ; - - usat r11, #8, r11 ; d3 = clip8(p3 + o3) - - sxth r8, r8 ; - sxth r6, r6 ; - - add r0, r0, r11, lsl #24 ; |d3|d2|d1|d0| - - ldrb r12, [r1, r2]! ; pred p4 - str r0, [r3], lr - ldrb r11, [r1, #1] ; pred p5 - - add r12, r12, r7, asr #3 ; p4 + o4 - add r11, r11, r10, asr #3 ; p5 + o5 - - usat r12, #8, r12 ; d4 = clip8(p4 + o4) - usat r11, #8, r11 ; d5 = clip8(p5 + o5) - - ldrb r7, [r1, #2] ; pred p6 - ldrb r10, [r1, #3] ; pred p6 - - add r12, r12, r11, lsl #8 ; |--|--|d5|d4| - - add r7, r7, r8, asr #3 ; p6 + o6 - add r10, r10, r6, asr #3 ; p7 + o7 - - ldr r0, [sp] ; load input pointer - - usat r7, #8, r7 ; d6 = clip8(p6 + o6) - usat r10, #8, r10 ; d7 = clip8(p7 + o7) - - add r12, r12, r7, lsl #16 ; |--|d6|d5|d4| - add r12, r12, r10, lsl #24 ; |d7|d6|d5|d4| - - str r12, [r3], lr - add r0, r0, #16 - add r1, r1, r2 ; pred + pitch - - bcs loop2_dual - - add sp, sp, #4 ; idct_output buffer - ldmia sp!, {r4 - r11, pc} - - ENDP - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/intra4x4_predict_v6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/intra4x4_predict_v6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/intra4x4_predict_v6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/intra4x4_predict_v6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,611 +0,0 @@ -; -; Copyright (c) 2011 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - EXPORT |vp8_intra4x4_predict_armv6| - - ARM - REQUIRE8 - PRESERVE8 - - AREA ||.text||, CODE, READONLY, ALIGN=2 - - -;void vp8_intra4x4_predict_armv6(unsigned char *Above, unsigned char *yleft, -; B_PREDICTION_MODE left_stride, int b_mode, -; unsigned char *dst, int dst_stride, -; unsigned char top_left) - -; r0: *Above -; r1: *yleft -; r2: left_stride -; r3: b_mode -; sp + #40: dst -; sp + #44: dst_stride -; sp + #48: top_left -|vp8_intra4x4_predict_armv6| PROC - push {r4-r12, lr} - - cmp r3, #10 - addlt pc, pc, r3, lsl #2 ; position independent switch - pop {r4-r12, pc} ; default - b b_dc_pred - b b_tm_pred - b b_ve_pred - b b_he_pred - b b_ld_pred - b b_rd_pred - b b_vr_pred - b b_vl_pred - b b_hd_pred - b b_hu_pred - -b_dc_pred - ; load values - ldr r8, [r0] ; Above - ldrb r4, [r1], r2 ; Left[0] - mov r9, #0 - ldrb r5, [r1], r2 ; Left[1] - ldrb r6, [r1], r2 ; Left[2] - usad8 r12, r8, r9 - ldrb r7, [r1] ; Left[3] - - ; calculate dc - add r4, r4, r5 - add r4, r4, r6 - add r4, r4, r7 - add r4, r4, r12 - add r4, r4, #4 - ldr r0, [sp, #44] ; dst_stride - mov r12, r4, asr #3 ; (expected_dc + 4) >> 3 - - add r12, r12, r12, lsl #8 - ldr r3, [sp, #40] ; dst - add r12, r12, r12, lsl #16 - - ; store values - str r12, [r3], r0 - str r12, [r3], r0 - str r12, [r3], r0 - str r12, [r3] - - pop {r4-r12, pc} - -b_tm_pred - ldr r8, [r0] ; Above - ldrb r9, [sp, #48] ; top_left - ldrb r4, [r1], r2 ; Left[0] - ldrb r5, [r1], r2 ; Left[1] - ldrb r6, [r1], r2 ; Left[2] - ldrb r7, [r1] ; Left[3] - ldr r0, [sp, #44] ; dst_stride - ldr r3, [sp, #40] ; dst - - add r9, r9, r9, lsl #16 ; [tl|tl] - uxtb16 r10, r8 ; a[2|0] - uxtb16 r11, r8, ror #8 ; a[3|1] - ssub16 r10, r10, r9 ; a[2|0] - [tl|tl] - ssub16 r11, r11, r9 ; a[3|1] - [tl|tl] - - add r4, r4, r4, lsl #16 ; l[0|0] - add r5, r5, r5, lsl #16 ; l[1|1] - add r6, r6, r6, lsl #16 ; l[2|2] - add r7, r7, r7, lsl #16 ; l[3|3] - - sadd16 r1, r4, r10 ; l[0|0] + a[2|0] - [tl|tl] - sadd16 r2, r4, r11 ; l[0|0] + a[3|1] - [tl|tl] - usat16 r1, #8, r1 - usat16 r2, #8, r2 - - sadd16 r4, r5, r10 ; l[1|1] + a[2|0] - [tl|tl] - sadd16 r5, r5, r11 ; l[1|1] + a[3|1] - [tl|tl] - - add r12, r1, r2, lsl #8 ; [3|2|1|0] - str r12, [r3], r0 - - usat16 r4, #8, r4 - usat16 r5, #8, r5 - - sadd16 r1, r6, r10 ; l[2|2] + a[2|0] - [tl|tl] - sadd16 r2, r6, r11 ; l[2|2] + a[3|1] - [tl|tl] - - add r12, r4, r5, lsl #8 ; [3|2|1|0] - str r12, [r3], r0 - - usat16 r1, #8, r1 - usat16 r2, #8, r2 - - sadd16 r4, r7, r10 ; l[3|3] + a[2|0] - [tl|tl] - sadd16 r5, r7, r11 ; l[3|3] + a[3|1] - [tl|tl] - - add r12, r1, r2, lsl #8 ; [3|2|1|0] - - usat16 r4, #8, r4 - usat16 r5, #8, r5 - - str r12, [r3], r0 - - add r12, r4, r5, lsl #8 ; [3|2|1|0] - str r12, [r3] - - pop {r4-r12, pc} - -b_ve_pred - ldr r8, [r0] ; a[3|2|1|0] - ldr r11, c00FF00FF - ldrb r9, [sp, #48] ; top_left - ldrb r10, [r0, #4] ; a[4] - - ldr r0, c00020002 - - uxtb16 r4, r8 ; a[2|0] - uxtb16 r5, r8, ror #8 ; a[3|1] - ldr r2, [sp, #44] ; dst_stride - pkhbt r9, r9, r5, lsl #16 ; a[1|-1] - - add r9, r9, r4, lsl #1 ;[a[1]+2*a[2] | tl+2*a[0] ] - uxtab16 r9, r9, r5 ;[a[1]+2*a[2]+a[3] | tl+2*a[0]+a[1] ] - ldr r3, [sp, #40] ; dst - uxtab16 r9, r9, r0 ;[a[1]+2*a[2]+a[3]+2| tl+2*a[0]+a[1]+2] - - add r0, r0, r10, lsl #16 ;[a[4]+2 | 2] - add r0, r0, r4, asr #16 ;[a[4]+2 | a[2]+2] - add r0, r0, r5, lsl #1 ;[a[4]+2*a[3]+2 | a[2]+2*a[1]+2] - uadd16 r4, r4, r0 ;[a[4]+2*a[3]+a[2]+2|a[2]+2*a[1]+a[0]+2] - - and r9, r11, r9, asr #2 - and r4, r11, r4, asr #2 - add r9, r9, r4, lsl #8 - - ; store values - str r9, [r3], r2 - str r9, [r3], r2 - str r9, [r3], r2 - str r9, [r3] - - pop {r4-r12, pc} - - -b_he_pred - ldrb r4, [r1], r2 ; Left[0] - ldrb r8, [sp, #48] ; top_left - ldrb r5, [r1], r2 ; Left[1] - ldrb r6, [r1], r2 ; Left[2] - ldrb r7, [r1] ; Left[3] - - add r8, r8, r4 ; tl + l[0] - add r9, r4, r5 ; l[0] + l[1] - add r10, r5, r6 ; l[1] + l[2] - add r11, r6, r7 ; l[2] + l[3] - - mov r0, #2<<14 - - add r8, r8, r9 ; tl + 2*l[0] + l[1] - add r4, r9, r10 ; l[0] + 2*l[1] + l[2] - add r5, r10, r11 ; l[1] + 2*l[2] + l[3] - add r6, r11, r7, lsl #1 ; l[2] + 2*l[3] + l[3] - - - add r8, r0, r8, lsl #14 ; (tl + 2*l[0] + l[1])>>2 in top half - add r9, r0, r4, lsl #14 ; (l[0] + 2*l[1] + l[2])>>2 in top half - add r10,r0, r5, lsl #14 ; (l[1] + 2*l[2] + l[3])>>2 in top half - add r11,r0, r6, lsl #14 ; (l[2] + 2*l[3] + l[3])>>2 in top half - - pkhtb r8, r8, r8, asr #16 ; l[-|0|-|0] - pkhtb r9, r9, r9, asr #16 ; l[-|1|-|1] - pkhtb r10, r10, r10, asr #16 ; l[-|2|-|2] - pkhtb r11, r11, r11, asr #16 ; l[-|3|-|3] - - ldr r0, [sp, #44] ; dst_stride - ldr r3, [sp, #40] ; dst - - add r8, r8, r8, lsl #8 ; l[0|0|0|0] - add r9, r9, r9, lsl #8 ; l[1|1|1|1] - add r10, r10, r10, lsl #8 ; l[2|2|2|2] - add r11, r11, r11, lsl #8 ; l[3|3|3|3] - - ; store values - str r8, [r3], r0 - str r9, [r3], r0 - str r10, [r3], r0 - str r11, [r3] - - pop {r4-r12, pc} - -b_ld_pred - ldr r4, [r0] ; Above[0-3] - ldr r12, c00020002 - ldr r5, [r0, #4] ; Above[4-7] - ldr lr, c00FF00FF - - uxtb16 r6, r4 ; a[2|0] - uxtb16 r7, r4, ror #8 ; a[3|1] - uxtb16 r8, r5 ; a[6|4] - uxtb16 r9, r5, ror #8 ; a[7|5] - pkhtb r10, r6, r8 ; a[2|4] - pkhtb r11, r7, r9 ; a[3|5] - - add r4, r6, r7, lsl #1 ; [a2+2*a3 | a0+2*a1] - add r4, r4, r10, ror #16 ; [a2+2*a3+a4 | a0+2*a1+a2] - uxtab16 r4, r4, r12 ; [a2+2*a3+a4+2 | a0+2*a1+a2+2] - - add r5, r7, r10, ror #15 ; [a3+2*a4 | a1+2*a2] - add r5, r5, r11, ror #16 ; [a3+2*a4+a5 | a1+2*a2+a3] - uxtab16 r5, r5, r12 ; [a3+2*a4+a5+2 | a1+2*a2+a3+2] - - pkhtb r7, r9, r8, asr #16 - add r6, r8, r9, lsl #1 ; [a6+2*a7 | a4+2*a5] - uadd16 r6, r6, r7 ; [a6+2*a7+a7 | a4+2*a5+a6] - uxtab16 r6, r6, r12 ; [a6+2*a7+a7+2 | a4+2*a5+a6+2] - - uxth r7, r9 ; [ a5] - add r7, r7, r8, asr #15 ; [ a5+2*a6] - add r7, r7, r9, asr #16 ; [ a5+2*a6+a7] - uxtah r7, r7, r12 ; [ a5+2*a6+a7+2] - - ldr r0, [sp, #44] ; dst_stride - ldr r3, [sp, #40] ; dst - - ; scale down - and r4, lr, r4, asr #2 - and r5, lr, r5, asr #2 - and r6, lr, r6, asr #2 - mov r7, r7, asr #2 - - add r8, r4, r5, lsl #8 ; [3|2|1|0] - str r8, [r3], r0 - - mov r9, r8, lsr #8 - add r9, r9, r6, lsl #24 ; [4|3|2|1] - str r9, [r3], r0 - - mov r10, r9, lsr #8 - add r10, r10, r7, lsl #24 ; [5|4|3|2] - str r10, [r3], r0 - - mov r6, r6, lsr #16 - mov r11, r10, lsr #8 - add r11, r11, r6, lsl #24 ; [6|5|4|3] - str r11, [r3] - - pop {r4-r12, pc} - -b_rd_pred - ldrb r7, [r1], r2 ; l[0] = pp[3] - ldr lr, [r0] ; Above = pp[8|7|6|5] - ldrb r8, [sp, #48] ; tl = pp[4] - ldrb r6, [r1], r2 ; l[1] = pp[2] - ldrb r5, [r1], r2 ; l[2] = pp[1] - ldrb r4, [r1], r2 ; l[3] = pp[0] - - - uxtb16 r9, lr ; p[7|5] - uxtb16 r10, lr, ror #8 ; p[8|6] - add r4, r4, r6, lsl #16 ; p[2|0] - add r5, r5, r7, lsl #16 ; p[3|1] - add r6, r6, r8, lsl #16 ; p[4|2] - pkhbt r7, r7, r9, lsl #16 ; p[5|3] - pkhbt r8, r8, r10, lsl #16 ; p[6|4] - - ldr r12, c00020002 - ldr lr, c00FF00FF - - add r4, r4, r5, lsl #1 ; [p2+2*p3 | p0+2*p1] - add r4, r4, r6 ; [p2+2*p3+p4 | p0+2*p1+p2] - uxtab16 r4, r4, r12 ; [p2+2*p3+p4+2 | p0+2*p1+p2+2] - - add r5, r5, r6, lsl #1 ; [p3+2*p4 | p1+2*p2] - add r5, r5, r7 ; [p3+2*p4+p5 | p1+2*p2+p3] - uxtab16 r5, r5, r12 ; [p3+2*p4+p5+2 | p1+2*p2+p3+2] - - add r6, r7, r8, lsl #1 ; [p5+2*p6 | p3+2*p4] - add r6, r6, r9 ; [p5+2*p6+p7 | p3+2*p4+p5] - uxtab16 r6, r6, r12 ; [p5+2*p6+p7+2 | p3+2*p4+p5+2] - - add r7, r8, r9, lsl #1 ; [p6+2*p7 | p4+2*p5] - add r7, r7, r10 ; [p6+2*p7+p8 | p4+2*p5+p6] - uxtab16 r7, r7, r12 ; [p6+2*p7+p8+2 | p4+2*p5+p6+2] - - ldr r0, [sp, #44] ; dst_stride - ldr r3, [sp, #40] ; dst - - ; scale down - and r7, lr, r7, asr #2 - and r6, lr, r6, asr #2 - and r5, lr, r5, asr #2 - and r4, lr, r4, asr #2 - - add r8, r6, r7, lsl #8 ; [6|5|4|3] - str r8, [r3], r0 - - mov r9, r8, lsl #8 ; [5|4|3|-] - uxtab r9, r9, r4, ror #16 ; [5|4|3|2] - str r9, [r3], r0 - - mov r10, r9, lsl #8 ; [4|3|2|-] - uxtab r10, r10, r5 ; [4|3|2|1] - str r10, [r3], r0 - - mov r11, r10, lsl #8 ; [3|2|1|-] - uxtab r11, r11, r4 ; [3|2|1|0] - str r11, [r3] - - pop {r4-r12, pc} - -b_vr_pred - ldrb r7, [r1], r2 ; l[0] = pp[3] - ldr lr, [r0] ; Above = pp[8|7|6|5] - ldrb r8, [sp, #48] ; tl = pp[4] - ldrb r6, [r1], r2 ; l[1] = pp[2] - ldrb r5, [r1], r2 ; l[2] = pp[1] - ldrb r4, [r1] ; l[3] = pp[0] - - add r5, r5, r7, lsl #16 ; p[3|1] - add r6, r6, r8, lsl #16 ; p[4|2] - uxtb16 r9, lr ; p[7|5] - uxtb16 r10, lr, ror #8 ; p[8|6] - pkhbt r7, r7, r9, lsl #16 ; p[5|3] - pkhbt r8, r8, r10, lsl #16 ; p[6|4] - - ldr r4, c00010001 - ldr r12, c00020002 - ldr lr, c00FF00FF - - add r5, r5, r6, lsl #1 ; [p3+2*p4 | p1+2*p2] - add r5, r5, r7 ; [p3+2*p4+p5 | p1+2*p2+p3] - uxtab16 r5, r5, r12 ; [p3+2*p4+p5+2 | p1+2*p2+p3+2] - - add r6, r6, r7, lsl #1 ; [p4+2*p5 | p2+2*p3] - add r6, r6, r8 ; [p4+2*p5+p6 | p2+2*p3+p4] - uxtab16 r6, r6, r12 ; [p4+2*p5+p6+2 | p2+2*p3+p4+2] - - uadd16 r11, r8, r9 ; [p6+p7 | p4+p5] - uhadd16 r11, r11, r4 ; [(p6+p7+1)>>1 | (p4+p5+1)>>1] - ; [F|E] - - add r7, r7, r8, lsl #1 ; [p5+2*p6 | p3+2*p4] - add r7, r7, r9 ; [p5+2*p6+p7 | p3+2*p4+p5] - uxtab16 r7, r7, r12 ; [p5+2*p6+p7+2 | p3+2*p4+p5+2] - - uadd16 r2, r9, r10 ; [p7+p8 | p5+p6] - uhadd16 r2, r2, r4 ; [(p7+p8+1)>>1 | (p5+p6+1)>>1] - ; [J|I] - - add r8, r8, r9, lsl #1 ; [p6+2*p7 | p4+2*p5] - add r8, r8, r10 ; [p6+2*p7+p8 | p4+2*p5+p6] - uxtab16 r8, r8, r12 ; [p6+2*p7+p8+2 | p4+2*p5+p6+2] - - ldr r0, [sp, #44] ; dst_stride - ldr r3, [sp, #40] ; dst - - ; scale down - and r5, lr, r5, asr #2 ; [B|A] - and r6, lr, r6, asr #2 ; [D|C] - and r7, lr, r7, asr #2 ; [H|G] - and r8, lr, r8, asr #2 ; [L|K] - - add r12, r11, r2, lsl #8 ; [J|F|I|E] - str r12, [r3], r0 - - add r12, r7, r8, lsl #8 ; [L|H|K|G] - str r12, [r3], r0 - - pkhbt r2, r6, r2, lsl #16 ; [-|I|-|C] - add r2, r2, r11, lsl #8 ; [F|I|E|C] - - pkhtb r12, r6, r5 ; [-|D|-|A] - pkhtb r10, r7, r5, asr #16 ; [-|H|-|B] - str r2, [r3], r0 - add r12, r12, r10, lsl #8 ; [H|D|B|A] - str r12, [r3] - - pop {r4-r12, pc} - -b_vl_pred - ldr r4, [r0] ; [3|2|1|0] = Above[0-3] - ldr r12, c00020002 - ldr r5, [r0, #4] ; [7|6|5|4] = Above[4-7] - ldr lr, c00FF00FF - ldr r2, c00010001 - - mov r0, r4, lsr #16 ; [-|-|3|2] - add r0, r0, r5, lsl #16 ; [5|4|3|2] - uxtb16 r6, r4 ; [2|0] - uxtb16 r7, r4, ror #8 ; [3|1] - uxtb16 r8, r0 ; [4|2] - uxtb16 r9, r0, ror #8 ; [5|3] - uxtb16 r10, r5 ; [6|4] - uxtb16 r11, r5, ror #8 ; [7|5] - - uadd16 r4, r6, r7 ; [p2+p3 | p0+p1] - uhadd16 r4, r4, r2 ; [(p2+p3+1)>>1 | (p0+p1+1)>>1] - ; [B|A] - - add r5, r6, r7, lsl #1 ; [p2+2*p3 | p0+2*p1] - add r5, r5, r8 ; [p2+2*p3+p4 | p0+2*p1+p2] - uxtab16 r5, r5, r12 ; [p2+2*p3+p4+2 | p0+2*p1+p2+2] - - uadd16 r6, r7, r8 ; [p3+p4 | p1+p2] - uhadd16 r6, r6, r2 ; [(p3+p4+1)>>1 | (p1+p2+1)>>1] - ; [F|E] - - add r7, r7, r8, lsl #1 ; [p3+2*p4 | p1+2*p2] - add r7, r7, r9 ; [p3+2*p4+p5 | p1+2*p2+p3] - uxtab16 r7, r7, r12 ; [p3+2*p4+p5+2 | p1+2*p2+p3+2] - - add r8, r8, r9, lsl #1 ; [p4+2*p5 | p2+2*p3] - add r8, r8, r10 ; [p4+2*p5+p6 | p2+2*p3+p4] - uxtab16 r8, r8, r12 ; [p4+2*p5+p6+2 | p2+2*p3+p4+2] - - add r9, r9, r10, lsl #1 ; [p5+2*p6 | p3+2*p4] - add r9, r9, r11 ; [p5+2*p6+p7 | p3+2*p4+p5] - uxtab16 r9, r9, r12 ; [p5+2*p6+p7+2 | p3+2*p4+p5+2] - - ldr r0, [sp, #44] ; dst_stride - ldr r3, [sp, #40] ; dst - - ; scale down - and r5, lr, r5, asr #2 ; [D|C] - and r7, lr, r7, asr #2 ; [H|G] - and r8, lr, r8, asr #2 ; [I|D] - and r9, lr, r9, asr #2 ; [J|H] - - add r10, r4, r6, lsl #8 ; [F|B|E|A] - str r10, [r3], r0 - - add r5, r5, r7, lsl #8 ; [H|C|G|D] - str r5, [r3], r0 - - pkhtb r12, r8, r4, asr #16 ; [-|I|-|B] - pkhtb r10, r9, r8 ; [-|J|-|D] - - add r12, r6, r12, lsl #8 ; [I|F|B|E] - str r12, [r3], r0 - - add r10, r7, r10, lsl #8 ; [J|H|D|G] - str r10, [r3] - - pop {r4-r12, pc} - -b_hd_pred - ldrb r7, [r1], r2 ; l[0] = pp[3] - ldr lr, [r0] ; Above = pp[8|7|6|5] - ldrb r8, [sp, #48] ; tl = pp[4] - ldrb r6, [r1], r2 ; l[1] = pp[2] - ldrb r5, [r1], r2 ; l[2] = pp[1] - ldrb r4, [r1] ; l[3] = pp[0] - - uxtb16 r9, lr ; p[7|5] - uxtb16 r10, lr, ror #8 ; p[8|6] - - add r4, r4, r5, lsl #16 ; p[1|0] - add r5, r5, r6, lsl #16 ; p[2|1] - add r6, r6, r7, lsl #16 ; p[3|2] - add r7, r7, r8, lsl #16 ; p[4|3] - - ldr r12, c00020002 - ldr lr, c00FF00FF - ldr r2, c00010001 - - pkhtb r8, r7, r9 ; p[4|5] - pkhtb r1, r9, r10 ; p[7|6] - pkhbt r10, r8, r10, lsl #16 ; p[6|5] - - uadd16 r11, r4, r5 ; [p1+p2 | p0+p1] - uhadd16 r11, r11, r2 ; [(p1+p2+1)>>1 | (p0+p1+1)>>1] - ; [B|A] - - add r4, r4, r5, lsl #1 ; [p1+2*p2 | p0+2*p1] - add r4, r4, r6 ; [p1+2*p2+p3 | p0+2*p1+p2] - uxtab16 r4, r4, r12 ; [p1+2*p2+p3+2 | p0+2*p1+p2+2] - - uadd16 r0, r6, r7 ; [p3+p4 | p2+p3] - uhadd16 r0, r0, r2 ; [(p3+p4+1)>>1 | (p2+p3+1)>>1] - ; [F|E] - - add r5, r6, r7, lsl #1 ; [p3+2*p4 | p2+2*p3] - add r5, r5, r8, ror #16 ; [p3+2*p4+p5 | p2+2*p3+p4] - uxtab16 r5, r5, r12 ; [p3+2*p4+p5+2 | p2+2*p3+p4+2] - - add r6, r12, r8, ror #16 ; [p5+2 | p4+2] - add r6, r6, r10, lsl #1 ; [p5+2+2*p6 | p4+2+2*p5] - uxtab16 r6, r6, r1 ; [p5+2+2*p6+p7 | p4+2+2*p5+p6] - - ; scale down - and r4, lr, r4, asr #2 ; [D|C] - and r5, lr, r5, asr #2 ; [H|G] - and r6, lr, r6, asr #2 ; [J|I] - - ldr lr, [sp, #44] ; dst_stride - ldr r3, [sp, #40] ; dst - - pkhtb r2, r0, r6 ; [-|F|-|I] - pkhtb r12, r6, r5, asr #16 ; [-|J|-|H] - add r12, r12, r2, lsl #8 ; [F|J|I|H] - add r2, r0, r5, lsl #8 ; [H|F|G|E] - mov r12, r12, ror #24 ; [J|I|H|F] - str r12, [r3], lr - - mov r7, r11, asr #16 ; [-|-|-|B] - str r2, [r3], lr - add r7, r7, r0, lsl #16 ; [-|E|-|B] - add r7, r7, r4, asr #8 ; [-|E|D|B] - add r7, r7, r5, lsl #24 ; [G|E|D|B] - str r7, [r3], lr - - add r5, r11, r4, lsl #8 ; [D|B|C|A] - str r5, [r3] - - pop {r4-r12, pc} - - - -b_hu_pred - ldrb r4, [r1], r2 ; Left[0] - ldr r12, c00020002 - ldrb r5, [r1], r2 ; Left[1] - ldr lr, c00FF00FF - ldrb r6, [r1], r2 ; Left[2] - ldr r2, c00010001 - ldrb r7, [r1] ; Left[3] - - add r4, r4, r5, lsl #16 ; [1|0] - add r5, r5, r6, lsl #16 ; [2|1] - add r9, r6, r7, lsl #16 ; [3|2] - - uadd16 r8, r4, r5 ; [p1+p2 | p0+p1] - uhadd16 r8, r8, r2 ; [(p1+p2+1)>>1 | (p0+p1+1)>>1] - ; [B|A] - - add r4, r4, r5, lsl #1 ; [p1+2*p2 | p0+2*p1] - add r4, r4, r9 ; [p1+2*p2+p3 | p0+2*p1+p2] - uxtab16 r4, r4, r12 ; [p1+2*p2+p3+2 | p0+2*p1+p2+2] - ldr r2, [sp, #44] ; dst_stride - ldr r3, [sp, #40] ; dst - and r4, lr, r4, asr #2 ; [D|C] - - add r10, r6, r7 ; [p2+p3] - add r11, r10, r7, lsl #1 ; [p2+3*p3] - add r10, r10, #1 - add r11, r11, #2 - mov r10, r10, asr #1 ; [E] - mov r11, r11, asr #2 ; [F] - - add r9, r7, r9, asr #8 ; [-|-|G|G] - add r0, r8, r4, lsl #8 ; [D|B|C|A] - add r7, r9, r9, lsl #16 ; [G|G|G|G] - - str r0, [r3], r2 - - mov r1, r8, asr #16 ; [-|-|-|B] - add r1, r1, r4, asr #8 ; [-|-|D|B] - add r1, r1, r10, lsl #16 ; [-|E|D|B] - add r1, r1, r11, lsl #24 ; [F|E|D|B] - str r1, [r3], r2 - - add r10, r11, lsl #8 ; [-|-|F|E] - add r10, r10, r9, lsl #16 ; [G|G|F|E] - str r10, [r3], r2 - - str r7, [r3] - - pop {r4-r12, pc} - - ENDP - -; constants -c00010001 - DCD 0x00010001 -c00020002 - DCD 0x00020002 -c00FF00FF - DCD 0x00FF00FF - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/iwalsh_v6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/iwalsh_v6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/iwalsh_v6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/iwalsh_v6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,136 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - EXPORT |vp8_short_inv_walsh4x4_v6| - - ARM - REQUIRE8 - PRESERVE8 - - AREA |.text|, CODE, READONLY ; name this block of code - -;short vp8_short_inv_walsh4x4_v6(short *input, short *mb_dqcoeff) -|vp8_short_inv_walsh4x4_v6| PROC - - stmdb sp!, {r4 - r12, lr} - - ldr r2, [r0, #0] ; [1 | 0] - ldr r3, [r0, #4] ; [3 | 2] - ldr r4, [r0, #8] ; [5 | 4] - ldr r5, [r0, #12] ; [7 | 6] - ldr r6, [r0, #16] ; [9 | 8] - ldr r7, [r0, #20] ; [11 | 10] - ldr r8, [r0, #24] ; [13 | 12] - ldr r9, [r0, #28] ; [15 | 14] - - qadd16 r10, r2, r8 ; a1 [1+13 | 0+12] - qadd16 r11, r4, r6 ; b1 [5+9 | 4+8] - qsub16 r12, r4, r6 ; c1 [5-9 | 4-8] - qsub16 lr, r2, r8 ; d1 [1-13 | 0-12] - - qadd16 r2, r10, r11 ; a1 + b1 [1 | 0] - qadd16 r4, r12, lr ; c1 + d1 [5 | 4] - qsub16 r6, r10, r11 ; a1 - b1 [9 | 8] - qsub16 r8, lr, r12 ; d1 - c1 [13 | 12] - - qadd16 r10, r3, r9 ; a1 [3+15 | 2+14] - qadd16 r11, r5, r7 ; b1 [7+11 | 6+10] - qsub16 r12, r5, r7 ; c1 [7-11 | 6-10] - qsub16 lr, r3, r9 ; d1 [3-15 | 2-14] - - qadd16 r3, r10, r11 ; a1 + b1 [3 | 2] - qadd16 r5, r12, lr ; c1 + d1 [7 | 6] - qsub16 r7, r10, r11 ; a1 - b1 [11 | 10] - qsub16 r9, lr, r12 ; d1 - c1 [15 | 14] - - ; first transform complete - - qsubaddx r10, r2, r3 ; [c1|a1] [1-2 | 0+3] - qaddsubx r11, r2, r3 ; [b1|d1] [1+2 | 0-3] - qsubaddx r12, r4, r5 ; [c1|a1] [5-6 | 4+7] - qaddsubx lr, r4, r5 ; [b1|d1] [5+6 | 4-7] - - qaddsubx r2, r10, r11 ; [b2|c2] [c1+d1 | a1-b1] - qaddsubx r3, r11, r10 ; [a2|d2] [b1+a1 | d1-c1] - ldr r10, c0x00030003 - qaddsubx r4, r12, lr ; [b2|c2] [c1+d1 | a1-b1] - qaddsubx r5, lr, r12 ; [a2|d2] [b1+a1 | d1-c1] - - qadd16 r2, r2, r10 ; [b2+3|c2+3] - qadd16 r3, r3, r10 ; [a2+3|d2+3] - qadd16 r4, r4, r10 ; [b2+3|c2+3] - qadd16 r5, r5, r10 ; [a2+3|d2+3] - - asr r12, r3, #19 ; [0] - strh r12, [r1], #32 - asr lr, r2, #19 ; [1] - strh lr, [r1], #32 - sxth r2, r2 - sxth r3, r3 - asr r2, r2, #3 ; [2] - strh r2, [r1], #32 - asr r3, r3, #3 ; [3] - strh r3, [r1], #32 - - asr r12, r5, #19 ; [4] - strh r12, [r1], #32 - asr lr, r4, #19 ; [5] - strh lr, [r1], #32 - sxth r4, r4 - sxth r5, r5 - asr r4, r4, #3 ; [6] - strh r4, [r1], #32 - asr r5, r5, #3 ; [7] - strh r5, [r1], #32 - - qsubaddx r2, r6, r7 ; [c1|a1] [9-10 | 8+11] - qaddsubx r3, r6, r7 ; [b1|d1] [9+10 | 8-11] - qsubaddx r4, r8, r9 ; [c1|a1] [13-14 | 12+15] - qaddsubx r5, r8, r9 ; [b1|d1] [13+14 | 12-15] - - qaddsubx r6, r2, r3 ; [b2|c2] [c1+d1 | a1-b1] - qaddsubx r7, r3, r2 ; [a2|d2] [b1+a1 | d1-c1] - qaddsubx r8, r4, r5 ; [b2|c2] [c1+d1 | a1-b1] - qaddsubx r9, r5, r4 ; [a2|d2] [b1+a1 | d1-c1] - - qadd16 r6, r6, r10 ; [b2+3|c2+3] - qadd16 r7, r7, r10 ; [a2+3|d2+3] - qadd16 r8, r8, r10 ; [b2+3|c2+3] - qadd16 r9, r9, r10 ; [a2+3|d2+3] - - asr r12, r7, #19 ; [8] - strh r12, [r1], #32 - asr lr, r6, #19 ; [9] - strh lr, [r1], #32 - sxth r6, r6 - sxth r7, r7 - asr r6, r6, #3 ; [10] - strh r6, [r1], #32 - asr r7, r7, #3 ; [11] - strh r7, [r1], #32 - - asr r12, r9, #19 ; [12] - strh r12, [r1], #32 - asr lr, r8, #19 ; [13] - strh lr, [r1], #32 - sxth r8, r8 - sxth r9, r9 - asr r8, r8, #3 ; [14] - strh r8, [r1], #32 - asr r9, r9, #3 ; [15] - strh r9, [r1], #32 - - ldmia sp!, {r4 - r12, pc} - ENDP ; |vp8_short_inv_walsh4x4_v6| - - -; Constant Pool -c0x00030003 DCD 0x00030003 - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/loopfilter_v6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/loopfilter_v6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/loopfilter_v6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/loopfilter_v6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,1282 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - EXPORT |vp8_loop_filter_horizontal_edge_armv6| - EXPORT |vp8_mbloop_filter_horizontal_edge_armv6| - EXPORT |vp8_loop_filter_vertical_edge_armv6| - EXPORT |vp8_mbloop_filter_vertical_edge_armv6| - - AREA |.text|, CODE, READONLY ; name this block of code - - MACRO - TRANSPOSE_MATRIX $a0, $a1, $a2, $a3, $b0, $b1, $b2, $b3 - ; input: $a0, $a1, $a2, $a3; output: $b0, $b1, $b2, $b3 - ; a0: 03 02 01 00 - ; a1: 13 12 11 10 - ; a2: 23 22 21 20 - ; a3: 33 32 31 30 - ; b3 b2 b1 b0 - - uxtb16 $b1, $a1 ; xx 12 xx 10 - uxtb16 $b0, $a0 ; xx 02 xx 00 - uxtb16 $b3, $a3 ; xx 32 xx 30 - uxtb16 $b2, $a2 ; xx 22 xx 20 - orr $b1, $b0, $b1, lsl #8 ; 12 02 10 00 - orr $b3, $b2, $b3, lsl #8 ; 32 22 30 20 - - uxtb16 $a1, $a1, ror #8 ; xx 13 xx 11 - uxtb16 $a3, $a3, ror #8 ; xx 33 xx 31 - uxtb16 $a0, $a0, ror #8 ; xx 03 xx 01 - uxtb16 $a2, $a2, ror #8 ; xx 23 xx 21 - orr $a0, $a0, $a1, lsl #8 ; 13 03 11 01 - orr $a2, $a2, $a3, lsl #8 ; 33 23 31 21 - - pkhtb $b2, $b3, $b1, asr #16 ; 32 22 12 02 -- p1 - pkhbt $b0, $b1, $b3, lsl #16 ; 30 20 10 00 -- p3 - - pkhtb $b3, $a2, $a0, asr #16 ; 33 23 13 03 -- p0 - pkhbt $b1, $a0, $a2, lsl #16 ; 31 21 11 01 -- p2 - MEND - - -src RN r0 -pstep RN r1 -count RN r5 - -;r0 unsigned char *src_ptr, -;r1 int src_pixel_step, -;r2 const char *blimit, -;r3 const char *limit, -;stack const char *thresh, -;stack int count - -;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -|vp8_loop_filter_horizontal_edge_armv6| PROC -;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - stmdb sp!, {r4 - r11, lr} - - sub src, src, pstep, lsl #2 ; move src pointer down by 4 lines - ldr count, [sp, #40] ; count for 8-in-parallel - ldr r6, [sp, #36] ; load thresh address - sub sp, sp, #16 ; create temp buffer - - ldr r9, [src], pstep ; p3 - ldrb r4, [r2] ; blimit - ldr r10, [src], pstep ; p2 - ldrb r2, [r3] ; limit - ldr r11, [src], pstep ; p1 - orr r4, r4, r4, lsl #8 - ldrb r3, [r6] ; thresh - orr r2, r2, r2, lsl #8 - mov count, count, lsl #1 ; 4-in-parallel - orr r4, r4, r4, lsl #16 - orr r3, r3, r3, lsl #8 - orr r2, r2, r2, lsl #16 - orr r3, r3, r3, lsl #16 - -|Hnext8| - ; vp8_filter_mask() function - ; calculate breakout conditions - ldr r12, [src], pstep ; p0 - - uqsub8 r6, r9, r10 ; p3 - p2 - uqsub8 r7, r10, r9 ; p2 - p3 - uqsub8 r8, r10, r11 ; p2 - p1 - uqsub8 r10, r11, r10 ; p1 - p2 - - orr r6, r6, r7 ; abs (p3-p2) - orr r8, r8, r10 ; abs (p2-p1) - uqsub8 lr, r6, r2 ; compare to limit. lr: vp8_filter_mask - uqsub8 r8, r8, r2 ; compare to limit - uqsub8 r6, r11, r12 ; p1 - p0 - orr lr, lr, r8 - uqsub8 r7, r12, r11 ; p0 - p1 - ldr r9, [src], pstep ; q0 - ldr r10, [src], pstep ; q1 - orr r6, r6, r7 ; abs (p1-p0) - uqsub8 r7, r6, r2 ; compare to limit - uqsub8 r8, r6, r3 ; compare to thresh -- save r8 for later - orr lr, lr, r7 - - uqsub8 r6, r11, r10 ; p1 - q1 - uqsub8 r7, r10, r11 ; q1 - p1 - uqsub8 r11, r12, r9 ; p0 - q0 - uqsub8 r12, r9, r12 ; q0 - p0 - orr r6, r6, r7 ; abs (p1-q1) - ldr r7, c0x7F7F7F7F - orr r12, r11, r12 ; abs (p0-q0) - ldr r11, [src], pstep ; q2 - uqadd8 r12, r12, r12 ; abs (p0-q0) * 2 - and r6, r7, r6, lsr #1 ; abs (p1-q1) / 2 - uqsub8 r7, r9, r10 ; q0 - q1 - uqadd8 r12, r12, r6 ; abs (p0-q0)*2 + abs (p1-q1)/2 - uqsub8 r6, r10, r9 ; q1 - q0 - uqsub8 r12, r12, r4 ; compare to flimit - uqsub8 r9, r11, r10 ; q2 - q1 - - orr lr, lr, r12 - - ldr r12, [src], pstep ; q3 - uqsub8 r10, r10, r11 ; q1 - q2 - orr r6, r7, r6 ; abs (q1-q0) - orr r10, r9, r10 ; abs (q2-q1) - uqsub8 r7, r6, r2 ; compare to limit - uqsub8 r10, r10, r2 ; compare to limit - uqsub8 r6, r6, r3 ; compare to thresh -- save r6 for later - orr lr, lr, r7 - orr lr, lr, r10 - - uqsub8 r10, r12, r11 ; q3 - q2 - uqsub8 r9, r11, r12 ; q2 - q3 - - mvn r11, #0 ; r11 == -1 - - orr r10, r10, r9 ; abs (q3-q2) - uqsub8 r10, r10, r2 ; compare to limit - - mov r12, #0 - orr lr, lr, r10 - sub src, src, pstep, lsl #2 - - usub8 lr, r12, lr ; use usub8 instead of ssub8 - sel lr, r11, r12 ; filter mask: lr - - cmp lr, #0 - beq hskip_filter ; skip filtering - - sub src, src, pstep, lsl #1 ; move src pointer down by 6 lines - - ;vp8_hevmask() function - ;calculate high edge variance - orr r10, r6, r8 ; calculate vp8_hevmask - - ldr r7, [src], pstep ; p1 - - usub8 r10, r12, r10 ; use usub8 instead of ssub8 - sel r6, r12, r11 ; obtain vp8_hevmask: r6 - - ;vp8_filter() function - ldr r8, [src], pstep ; p0 - ldr r12, c0x80808080 - ldr r9, [src], pstep ; q0 - ldr r10, [src], pstep ; q1 - - eor r7, r7, r12 ; p1 offset to convert to a signed value - eor r8, r8, r12 ; p0 offset to convert to a signed value - eor r9, r9, r12 ; q0 offset to convert to a signed value - eor r10, r10, r12 ; q1 offset to convert to a signed value - - str r9, [sp] ; store qs0 temporarily - str r8, [sp, #4] ; store ps0 temporarily - str r10, [sp, #8] ; store qs1 temporarily - str r7, [sp, #12] ; store ps1 temporarily - - qsub8 r7, r7, r10 ; vp8_signed_char_clamp(ps1-qs1) - qsub8 r8, r9, r8 ; vp8_signed_char_clamp(vp8_filter + 3 * ( qs0 - ps0)) - - and r7, r7, r6 ; vp8_filter (r7) &= hev - - qadd8 r7, r7, r8 - ldr r9, c0x03030303 ; r9 = 3 --modified for vp8 - - qadd8 r7, r7, r8 - ldr r10, c0x04040404 - - qadd8 r7, r7, r8 - and r7, r7, lr ; vp8_filter &= mask; - - ;modify code for vp8 -- Filter1 = vp8_filter (r7) - qadd8 r8 , r7 , r9 ; Filter2 (r8) = vp8_signed_char_clamp(vp8_filter+3) - qadd8 r7 , r7 , r10 ; vp8_filter = vp8_signed_char_clamp(vp8_filter+4) - - mov r9, #0 - shadd8 r8 , r8 , r9 ; Filter2 >>= 3 - shadd8 r7 , r7 , r9 ; vp8_filter >>= 3 - shadd8 r8 , r8 , r9 - shadd8 r7 , r7 , r9 - shadd8 lr , r8 , r9 ; lr: Filter2 - shadd8 r7 , r7 , r9 ; r7: filter - - ;usub8 lr, r8, r10 ; s = (s==4)*-1 - ;sel lr, r11, r9 - ;usub8 r8, r10, r8 - ;sel r8, r11, r9 - ;and r8, r8, lr ; -1 for each element that equals 4 - - ;calculate output - ;qadd8 lr, r8, r7 ; u = vp8_signed_char_clamp(s + vp8_filter) - - ldr r8, [sp] ; load qs0 - ldr r9, [sp, #4] ; load ps0 - - ldr r10, c0x01010101 - - qsub8 r8 ,r8, r7 ; u = vp8_signed_char_clamp(qs0 - vp8_filter) - qadd8 r9, r9, lr ; u = vp8_signed_char_clamp(ps0 + Filter2) - - ;end of modification for vp8 - - mov lr, #0 - sadd8 r7, r7 , r10 ; vp8_filter += 1 - shadd8 r7, r7, lr ; vp8_filter >>= 1 - - ldr r11, [sp, #12] ; load ps1 - ldr r10, [sp, #8] ; load qs1 - - bic r7, r7, r6 ; vp8_filter &= ~hev - sub src, src, pstep, lsl #2 - - qadd8 r11, r11, r7 ; u = vp8_signed_char_clamp(ps1 + vp8_filter) - qsub8 r10, r10,r7 ; u = vp8_signed_char_clamp(qs1 - vp8_filter) - - eor r11, r11, r12 ; *op1 = u^0x80 - str r11, [src], pstep ; store op1 - eor r9, r9, r12 ; *op0 = u^0x80 - str r9, [src], pstep ; store op0 result - eor r8, r8, r12 ; *oq0 = u^0x80 - str r8, [src], pstep ; store oq0 result - eor r10, r10, r12 ; *oq1 = u^0x80 - str r10, [src], pstep ; store oq1 - - sub src, src, pstep, lsl #1 - -|hskip_filter| - add src, src, #4 - sub src, src, pstep, lsl #2 - - subs count, count, #1 - - ldrne r9, [src], pstep ; p3 - ldrne r10, [src], pstep ; p2 - ldrne r11, [src], pstep ; p1 - - bne Hnext8 - - add sp, sp, #16 - ldmia sp!, {r4 - r11, pc} - ENDP ; |vp8_loop_filter_horizontal_edge_armv6| - - -;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -|vp8_mbloop_filter_horizontal_edge_armv6| PROC -;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - stmdb sp!, {r4 - r11, lr} - - sub src, src, pstep, lsl #2 ; move src pointer down by 4 lines - ldr count, [sp, #40] ; count for 8-in-parallel - ldr r6, [sp, #36] ; load thresh address - sub sp, sp, #16 ; create temp buffer - - ldr r9, [src], pstep ; p3 - ldrb r4, [r2] ; blimit - ldr r10, [src], pstep ; p2 - ldrb r2, [r3] ; limit - ldr r11, [src], pstep ; p1 - orr r4, r4, r4, lsl #8 - ldrb r3, [r6] ; thresh - orr r2, r2, r2, lsl #8 - mov count, count, lsl #1 ; 4-in-parallel - orr r4, r4, r4, lsl #16 - orr r3, r3, r3, lsl #8 - orr r2, r2, r2, lsl #16 - orr r3, r3, r3, lsl #16 - -|MBHnext8| - - ; vp8_filter_mask() function - ; calculate breakout conditions - ldr r12, [src], pstep ; p0 - - uqsub8 r6, r9, r10 ; p3 - p2 - uqsub8 r7, r10, r9 ; p2 - p3 - uqsub8 r8, r10, r11 ; p2 - p1 - uqsub8 r10, r11, r10 ; p1 - p2 - - orr r6, r6, r7 ; abs (p3-p2) - orr r8, r8, r10 ; abs (p2-p1) - uqsub8 lr, r6, r2 ; compare to limit. lr: vp8_filter_mask - uqsub8 r8, r8, r2 ; compare to limit - - uqsub8 r6, r11, r12 ; p1 - p0 - orr lr, lr, r8 - uqsub8 r7, r12, r11 ; p0 - p1 - ldr r9, [src], pstep ; q0 - ldr r10, [src], pstep ; q1 - orr r6, r6, r7 ; abs (p1-p0) - uqsub8 r7, r6, r2 ; compare to limit - uqsub8 r8, r6, r3 ; compare to thresh -- save r8 for later - orr lr, lr, r7 - - uqsub8 r6, r11, r10 ; p1 - q1 - uqsub8 r7, r10, r11 ; q1 - p1 - uqsub8 r11, r12, r9 ; p0 - q0 - uqsub8 r12, r9, r12 ; q0 - p0 - orr r6, r6, r7 ; abs (p1-q1) - ldr r7, c0x7F7F7F7F - orr r12, r11, r12 ; abs (p0-q0) - ldr r11, [src], pstep ; q2 - uqadd8 r12, r12, r12 ; abs (p0-q0) * 2 - and r6, r7, r6, lsr #1 ; abs (p1-q1) / 2 - uqsub8 r7, r9, r10 ; q0 - q1 - uqadd8 r12, r12, r6 ; abs (p0-q0)*2 + abs (p1-q1)/2 - uqsub8 r6, r10, r9 ; q1 - q0 - uqsub8 r12, r12, r4 ; compare to flimit - uqsub8 r9, r11, r10 ; q2 - q1 - - orr lr, lr, r12 - - ldr r12, [src], pstep ; q3 - - uqsub8 r10, r10, r11 ; q1 - q2 - orr r6, r7, r6 ; abs (q1-q0) - orr r10, r9, r10 ; abs (q2-q1) - uqsub8 r7, r6, r2 ; compare to limit - uqsub8 r10, r10, r2 ; compare to limit - uqsub8 r6, r6, r3 ; compare to thresh -- save r6 for later - orr lr, lr, r7 - orr lr, lr, r10 - - uqsub8 r10, r12, r11 ; q3 - q2 - uqsub8 r9, r11, r12 ; q2 - q3 - - mvn r11, #0 ; r11 == -1 - - orr r10, r10, r9 ; abs (q3-q2) - uqsub8 r10, r10, r2 ; compare to limit - - mov r12, #0 - - orr lr, lr, r10 - - usub8 lr, r12, lr ; use usub8 instead of ssub8 - sel lr, r11, r12 ; filter mask: lr - - cmp lr, #0 - beq mbhskip_filter ; skip filtering - - ;vp8_hevmask() function - ;calculate high edge variance - sub src, src, pstep, lsl #2 ; move src pointer down by 6 lines - sub src, src, pstep, lsl #1 - - orr r10, r6, r8 - ldr r7, [src], pstep ; p1 - - usub8 r10, r12, r10 - sel r6, r12, r11 ; hev mask: r6 - - ;vp8_mbfilter() function - ;p2, q2 are only needed at the end. Don't need to load them in now. - ldr r8, [src], pstep ; p0 - ldr r12, c0x80808080 - ldr r9, [src], pstep ; q0 - ldr r10, [src] ; q1 - - eor r7, r7, r12 ; ps1 - eor r8, r8, r12 ; ps0 - eor r9, r9, r12 ; qs0 - eor r10, r10, r12 ; qs1 - - qsub8 r12, r9, r8 ; vp8_signed_char_clamp(vp8_filter + 3 * ( qs0 - ps0)) - str r7, [sp, #12] ; store ps1 temporarily - qsub8 r7, r7, r10 ; vp8_signed_char_clamp(ps1-qs1) - str r10, [sp, #8] ; store qs1 temporarily - qadd8 r7, r7, r12 - str r9, [sp] ; store qs0 temporarily - qadd8 r7, r7, r12 - str r8, [sp, #4] ; store ps0 temporarily - qadd8 r7, r7, r12 ; vp8_filter: r7 - - ldr r10, c0x03030303 ; r10 = 3 --modified for vp8 - ldr r9, c0x04040404 - - and r7, r7, lr ; vp8_filter &= mask (lr is free) - - mov r12, r7 ; Filter2: r12 - and r12, r12, r6 ; Filter2 &= hev - - ;modify code for vp8 - ;save bottom 3 bits so that we round one side +4 and the other +3 - qadd8 r8 , r12 , r9 ; Filter1 (r8) = vp8_signed_char_clamp(Filter2+4) - qadd8 r12 , r12 , r10 ; Filter2 (r12) = vp8_signed_char_clamp(Filter2+3) - - mov r10, #0 - shadd8 r8 , r8 , r10 ; Filter1 >>= 3 - shadd8 r12 , r12 , r10 ; Filter2 >>= 3 - shadd8 r8 , r8 , r10 - shadd8 r12 , r12 , r10 - shadd8 r8 , r8 , r10 ; r8: Filter1 - shadd8 r12 , r12 , r10 ; r12: Filter2 - - ldr r9, [sp] ; load qs0 - ldr r11, [sp, #4] ; load ps0 - - qsub8 r9 , r9, r8 ; qs0 = vp8_signed_char_clamp(qs0 - Filter1) - qadd8 r11, r11, r12 ; ps0 = vp8_signed_char_clamp(ps0 + Filter2) - - ;save bottom 3 bits so that we round one side +4 and the other +3 - ;and r8, r12, r10 ; s = Filter2 & 7 (s: r8) - ;qadd8 r12 , r12 , r9 ; Filter2 = vp8_signed_char_clamp(Filter2+4) - ;mov r10, #0 - ;shadd8 r12 , r12 , r10 ; Filter2 >>= 3 - ;usub8 lr, r8, r9 ; s = (s==4)*-1 - ;sel lr, r11, r10 - ;shadd8 r12 , r12 , r10 - ;usub8 r8, r9, r8 - ;sel r8, r11, r10 - ;ldr r9, [sp] ; load qs0 - ;ldr r11, [sp, #4] ; load ps0 - ;shadd8 r12 , r12 , r10 - ;and r8, r8, lr ; -1 for each element that equals 4 - ;qadd8 r10, r8, r12 ; u = vp8_signed_char_clamp(s + Filter2) - ;qsub8 r9 , r9, r12 ; qs0 = vp8_signed_char_clamp(qs0 - Filter2) - ;qadd8 r11, r11, r10 ; ps0 = vp8_signed_char_clamp(ps0 + u) - - ;end of modification for vp8 - - bic r12, r7, r6 ; vp8_filter &= ~hev ( r6 is free) - ;mov r12, r7 - - ;roughly 3/7th difference across boundary - mov lr, #0x1b ; 27 - mov r7, #0x3f ; 63 - - sxtb16 r6, r12 - sxtb16 r10, r12, ror #8 - smlabb r8, r6, lr, r7 - smlatb r6, r6, lr, r7 - smlabb r7, r10, lr, r7 - smultb r10, r10, lr - ssat r8, #8, r8, asr #7 - ssat r6, #8, r6, asr #7 - add r10, r10, #63 - ssat r7, #8, r7, asr #7 - ssat r10, #8, r10, asr #7 - - ldr lr, c0x80808080 - - pkhbt r6, r8, r6, lsl #16 - pkhbt r10, r7, r10, lsl #16 - uxtb16 r6, r6 - uxtb16 r10, r10 - - sub src, src, pstep - - orr r10, r6, r10, lsl #8 ; u = vp8_signed_char_clamp((63 + Filter2 * 27)>>7) - - qsub8 r8, r9, r10 ; s = vp8_signed_char_clamp(qs0 - u) - qadd8 r10, r11, r10 ; s = vp8_signed_char_clamp(ps0 + u) - eor r8, r8, lr ; *oq0 = s^0x80 - str r8, [src] ; store *oq0 - sub src, src, pstep - eor r10, r10, lr ; *op0 = s^0x80 - str r10, [src] ; store *op0 - - ;roughly 2/7th difference across boundary - mov lr, #0x12 ; 18 - mov r7, #0x3f ; 63 - - sxtb16 r6, r12 - sxtb16 r10, r12, ror #8 - smlabb r8, r6, lr, r7 - smlatb r6, r6, lr, r7 - smlabb r9, r10, lr, r7 - smlatb r10, r10, lr, r7 - ssat r8, #8, r8, asr #7 - ssat r6, #8, r6, asr #7 - ssat r9, #8, r9, asr #7 - ssat r10, #8, r10, asr #7 - - ldr lr, c0x80808080 - - pkhbt r6, r8, r6, lsl #16 - pkhbt r10, r9, r10, lsl #16 - - ldr r9, [sp, #8] ; load qs1 - ldr r11, [sp, #12] ; load ps1 - - uxtb16 r6, r6 - uxtb16 r10, r10 - - sub src, src, pstep - - orr r10, r6, r10, lsl #8 ; u = vp8_signed_char_clamp((63 + Filter2 * 18)>>7) - - qadd8 r11, r11, r10 ; s = vp8_signed_char_clamp(ps1 + u) - qsub8 r8, r9, r10 ; s = vp8_signed_char_clamp(qs1 - u) - eor r11, r11, lr ; *op1 = s^0x80 - str r11, [src], pstep ; store *op1 - eor r8, r8, lr ; *oq1 = s^0x80 - add src, src, pstep, lsl #1 - - mov r7, #0x3f ; 63 - - str r8, [src], pstep ; store *oq1 - - ;roughly 1/7th difference across boundary - mov lr, #0x9 ; 9 - ldr r9, [src] ; load q2 - - sxtb16 r6, r12 - sxtb16 r10, r12, ror #8 - smlabb r8, r6, lr, r7 - smlatb r6, r6, lr, r7 - smlabb r12, r10, lr, r7 - smlatb r10, r10, lr, r7 - ssat r8, #8, r8, asr #7 - ssat r6, #8, r6, asr #7 - ssat r12, #8, r12, asr #7 - ssat r10, #8, r10, asr #7 - - sub src, src, pstep, lsl #2 - - pkhbt r6, r8, r6, lsl #16 - pkhbt r10, r12, r10, lsl #16 - - sub src, src, pstep - ldr lr, c0x80808080 - - ldr r11, [src] ; load p2 - - uxtb16 r6, r6 - uxtb16 r10, r10 - - eor r9, r9, lr - eor r11, r11, lr - - orr r10, r6, r10, lsl #8 ; u = vp8_signed_char_clamp((63 + Filter2 * 9)>>7) - - qadd8 r8, r11, r10 ; s = vp8_signed_char_clamp(ps2 + u) - qsub8 r10, r9, r10 ; s = vp8_signed_char_clamp(qs2 - u) - eor r8, r8, lr ; *op2 = s^0x80 - str r8, [src], pstep, lsl #2 ; store *op2 - add src, src, pstep - eor r10, r10, lr ; *oq2 = s^0x80 - str r10, [src], pstep, lsl #1 ; store *oq2 - -|mbhskip_filter| - add src, src, #4 - sub src, src, pstep, lsl #3 - subs count, count, #1 - - ldrne r9, [src], pstep ; p3 - ldrne r10, [src], pstep ; p2 - ldrne r11, [src], pstep ; p1 - - bne MBHnext8 - - add sp, sp, #16 - ldmia sp!, {r4 - r11, pc} - ENDP ; |vp8_mbloop_filter_horizontal_edge_armv6| - - -;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -|vp8_loop_filter_vertical_edge_armv6| PROC -;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - stmdb sp!, {r4 - r11, lr} - - sub src, src, #4 ; move src pointer down by 4 - ldr count, [sp, #40] ; count for 8-in-parallel - ldr r12, [sp, #36] ; load thresh address - sub sp, sp, #16 ; create temp buffer - - ldr r6, [src], pstep ; load source data - ldrb r4, [r2] ; blimit - ldr r7, [src], pstep - ldrb r2, [r3] ; limit - ldr r8, [src], pstep - orr r4, r4, r4, lsl #8 - ldrb r3, [r12] ; thresh - orr r2, r2, r2, lsl #8 - ldr lr, [src], pstep - mov count, count, lsl #1 ; 4-in-parallel - orr r4, r4, r4, lsl #16 - orr r3, r3, r3, lsl #8 - orr r2, r2, r2, lsl #16 - orr r3, r3, r3, lsl #16 - -|Vnext8| - - ; vp8_filter_mask() function - ; calculate breakout conditions - ; transpose the source data for 4-in-parallel operation - TRANSPOSE_MATRIX r6, r7, r8, lr, r9, r10, r11, r12 - - uqsub8 r7, r9, r10 ; p3 - p2 - uqsub8 r8, r10, r9 ; p2 - p3 - uqsub8 r9, r10, r11 ; p2 - p1 - uqsub8 r10, r11, r10 ; p1 - p2 - orr r7, r7, r8 ; abs (p3-p2) - orr r10, r9, r10 ; abs (p2-p1) - uqsub8 lr, r7, r2 ; compare to limit. lr: vp8_filter_mask - uqsub8 r10, r10, r2 ; compare to limit - - sub src, src, pstep, lsl #2 ; move src pointer down by 4 lines - - orr lr, lr, r10 - - uqsub8 r6, r11, r12 ; p1 - p0 - uqsub8 r7, r12, r11 ; p0 - p1 - add src, src, #4 ; move src pointer up by 4 - orr r6, r6, r7 ; abs (p1-p0) - str r11, [sp, #12] ; save p1 - uqsub8 r10, r6, r2 ; compare to limit - uqsub8 r11, r6, r3 ; compare to thresh - orr lr, lr, r10 - - ; transpose uses 8 regs(r6 - r12 and lr). Need to save reg value now - ; transpose the source data for 4-in-parallel operation - ldr r6, [src], pstep ; load source data - str r11, [sp] ; push r11 to stack - ldr r7, [src], pstep - str r12, [sp, #4] ; save current reg before load q0 - q3 data - ldr r8, [src], pstep - str lr, [sp, #8] - ldr lr, [src], pstep - - TRANSPOSE_MATRIX r6, r7, r8, lr, r9, r10, r11, r12 - - ldr lr, [sp, #8] ; load back (f)limit accumulator - - uqsub8 r6, r12, r11 ; q3 - q2 - uqsub8 r7, r11, r12 ; q2 - q3 - uqsub8 r12, r11, r10 ; q2 - q1 - uqsub8 r11, r10, r11 ; q1 - q2 - orr r6, r6, r7 ; abs (q3-q2) - orr r7, r12, r11 ; abs (q2-q1) - uqsub8 r6, r6, r2 ; compare to limit - uqsub8 r7, r7, r2 ; compare to limit - ldr r11, [sp, #4] ; load back p0 - ldr r12, [sp, #12] ; load back p1 - orr lr, lr, r6 - orr lr, lr, r7 - - uqsub8 r6, r11, r9 ; p0 - q0 - uqsub8 r7, r9, r11 ; q0 - p0 - uqsub8 r8, r12, r10 ; p1 - q1 - uqsub8 r11, r10, r12 ; q1 - p1 - orr r6, r6, r7 ; abs (p0-q0) - ldr r7, c0x7F7F7F7F - orr r8, r8, r11 ; abs (p1-q1) - uqadd8 r6, r6, r6 ; abs (p0-q0) * 2 - and r8, r7, r8, lsr #1 ; abs (p1-q1) / 2 - uqsub8 r11, r10, r9 ; q1 - q0 - uqadd8 r6, r8, r6 ; abs (p0-q0)*2 + abs (p1-q1)/2 - uqsub8 r12, r9, r10 ; q0 - q1 - uqsub8 r6, r6, r4 ; compare to flimit - - orr r9, r11, r12 ; abs (q1-q0) - uqsub8 r8, r9, r2 ; compare to limit - uqsub8 r10, r9, r3 ; compare to thresh - orr lr, lr, r6 - orr lr, lr, r8 - - mvn r11, #0 ; r11 == -1 - mov r12, #0 - - usub8 lr, r12, lr - ldr r9, [sp] ; load the compared result - sel lr, r11, r12 ; filter mask: lr - - cmp lr, #0 - beq vskip_filter ; skip filtering - - ;vp8_hevmask() function - ;calculate high edge variance - - sub src, src, pstep, lsl #2 ; move src pointer down by 4 lines - - orr r9, r9, r10 - - ldrh r7, [src, #-2] - ldrh r8, [src], pstep - - usub8 r9, r12, r9 - sel r6, r12, r11 ; hev mask: r6 - - ;vp8_filter() function - ; load soure data to r6, r11, r12, lr - ldrh r9, [src, #-2] - ldrh r10, [src], pstep - - pkhbt r12, r7, r8, lsl #16 - - ldrh r7, [src, #-2] - ldrh r8, [src], pstep - - pkhbt r11, r9, r10, lsl #16 - - ldrh r9, [src, #-2] - ldrh r10, [src], pstep - - ; Transpose needs 8 regs(r6 - r12, and lr). Save r6 and lr first - str r6, [sp] - str lr, [sp, #4] - - pkhbt r6, r7, r8, lsl #16 - pkhbt lr, r9, r10, lsl #16 - - ;transpose r12, r11, r6, lr to r7, r8, r9, r10 - TRANSPOSE_MATRIX r12, r11, r6, lr, r7, r8, r9, r10 - - ;load back hev_mask r6 and filter_mask lr - ldr r12, c0x80808080 - ldr r6, [sp] - ldr lr, [sp, #4] - - eor r7, r7, r12 ; p1 offset to convert to a signed value - eor r8, r8, r12 ; p0 offset to convert to a signed value - eor r9, r9, r12 ; q0 offset to convert to a signed value - eor r10, r10, r12 ; q1 offset to convert to a signed value - - str r9, [sp] ; store qs0 temporarily - str r8, [sp, #4] ; store ps0 temporarily - str r10, [sp, #8] ; store qs1 temporarily - str r7, [sp, #12] ; store ps1 temporarily - - qsub8 r7, r7, r10 ; vp8_signed_char_clamp(ps1-qs1) - qsub8 r8, r9, r8 ; vp8_signed_char_clamp(vp8_filter + 3 * ( qs0 - ps0)) - - and r7, r7, r6 ; vp8_filter (r7) &= hev (r7 : filter) - - qadd8 r7, r7, r8 - ldr r9, c0x03030303 ; r9 = 3 --modified for vp8 - - qadd8 r7, r7, r8 - ldr r10, c0x04040404 - - qadd8 r7, r7, r8 - ;mvn r11, #0 ; r11 == -1 - - and r7, r7, lr ; vp8_filter &= mask - - ;modify code for vp8 -- Filter1 = vp8_filter (r7) - qadd8 r8 , r7 , r9 ; Filter2 (r8) = vp8_signed_char_clamp(vp8_filter+3) - qadd8 r7 , r7 , r10 ; vp8_filter = vp8_signed_char_clamp(vp8_filter+4) - - mov r9, #0 - shadd8 r8 , r8 , r9 ; Filter2 >>= 3 - shadd8 r7 , r7 , r9 ; vp8_filter >>= 3 - shadd8 r8 , r8 , r9 - shadd8 r7 , r7 , r9 - shadd8 lr , r8 , r9 ; lr: filter2 - shadd8 r7 , r7 , r9 ; r7: filter - - ;usub8 lr, r8, r10 ; s = (s==4)*-1 - ;sel lr, r11, r9 - ;usub8 r8, r10, r8 - ;sel r8, r11, r9 - ;and r8, r8, lr ; -1 for each element that equals 4 -- r8: s - - ;calculate output - ;qadd8 lr, r8, r7 ; u = vp8_signed_char_clamp(s + vp8_filter) - - ldr r8, [sp] ; load qs0 - ldr r9, [sp, #4] ; load ps0 - - ldr r10, c0x01010101 - - qsub8 r8, r8, r7 ; u = vp8_signed_char_clamp(qs0 - vp8_filter) - qadd8 r9, r9, lr ; u = vp8_signed_char_clamp(ps0 + Filter2) - ;end of modification for vp8 - - eor r8, r8, r12 - eor r9, r9, r12 - - mov lr, #0 - - sadd8 r7, r7, r10 - shadd8 r7, r7, lr - - ldr r10, [sp, #8] ; load qs1 - ldr r11, [sp, #12] ; load ps1 - - bic r7, r7, r6 ; r7: vp8_filter - - qsub8 r10 , r10, r7 ; u = vp8_signed_char_clamp(qs1 - vp8_filter) - qadd8 r11, r11, r7 ; u = vp8_signed_char_clamp(ps1 + vp8_filter) - eor r10, r10, r12 - eor r11, r11, r12 - - sub src, src, pstep, lsl #2 - - ;we can use TRANSPOSE_MATRIX macro to transpose output - input: q1, q0, p0, p1 - ;output is b0, b1, b2, b3 - ;b0: 03 02 01 00 - ;b1: 13 12 11 10 - ;b2: 23 22 21 20 - ;b3: 33 32 31 30 - ; p1 p0 q0 q1 - ; (a3 a2 a1 a0) - TRANSPOSE_MATRIX r11, r9, r8, r10, r6, r7, r12, lr - - strh r6, [src, #-2] ; store the result - mov r6, r6, lsr #16 - strh r6, [src], pstep - - strh r7, [src, #-2] - mov r7, r7, lsr #16 - strh r7, [src], pstep - - strh r12, [src, #-2] - mov r12, r12, lsr #16 - strh r12, [src], pstep - - strh lr, [src, #-2] - mov lr, lr, lsr #16 - strh lr, [src], pstep - -|vskip_filter| - sub src, src, #4 - subs count, count, #1 - - ldrne r6, [src], pstep ; load source data - ldrne r7, [src], pstep - ldrne r8, [src], pstep - ldrne lr, [src], pstep - - bne Vnext8 - - add sp, sp, #16 - - ldmia sp!, {r4 - r11, pc} - ENDP ; |vp8_loop_filter_vertical_edge_armv6| - - - -;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -|vp8_mbloop_filter_vertical_edge_armv6| PROC -;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - stmdb sp!, {r4 - r11, lr} - - sub src, src, #4 ; move src pointer down by 4 - ldr count, [sp, #40] ; count for 8-in-parallel - ldr r12, [sp, #36] ; load thresh address - pld [src, #23] ; preload for next block - sub sp, sp, #16 ; create temp buffer - - ldr r6, [src], pstep ; load source data - ldrb r4, [r2] ; blimit - pld [src, #23] - ldr r7, [src], pstep - ldrb r2, [r3] ; limit - pld [src, #23] - ldr r8, [src], pstep - orr r4, r4, r4, lsl #8 - ldrb r3, [r12] ; thresh - orr r2, r2, r2, lsl #8 - pld [src, #23] - ldr lr, [src], pstep - mov count, count, lsl #1 ; 4-in-parallel - orr r4, r4, r4, lsl #16 - orr r3, r3, r3, lsl #8 - orr r2, r2, r2, lsl #16 - orr r3, r3, r3, lsl #16 - -|MBVnext8| - ; vp8_filter_mask() function - ; calculate breakout conditions - ; transpose the source data for 4-in-parallel operation - TRANSPOSE_MATRIX r6, r7, r8, lr, r9, r10, r11, r12 - - uqsub8 r7, r9, r10 ; p3 - p2 - uqsub8 r8, r10, r9 ; p2 - p3 - uqsub8 r9, r10, r11 ; p2 - p1 - uqsub8 r10, r11, r10 ; p1 - p2 - orr r7, r7, r8 ; abs (p3-p2) - orr r10, r9, r10 ; abs (p2-p1) - uqsub8 lr, r7, r2 ; compare to limit. lr: vp8_filter_mask - uqsub8 r10, r10, r2 ; compare to limit - - sub src, src, pstep, lsl #2 ; move src pointer down by 4 lines - - orr lr, lr, r10 - - uqsub8 r6, r11, r12 ; p1 - p0 - uqsub8 r7, r12, r11 ; p0 - p1 - add src, src, #4 ; move src pointer up by 4 - orr r6, r6, r7 ; abs (p1-p0) - str r11, [sp, #12] ; save p1 - uqsub8 r10, r6, r2 ; compare to limit - uqsub8 r11, r6, r3 ; compare to thresh - orr lr, lr, r10 - - ; transpose uses 8 regs(r6 - r12 and lr). Need to save reg value now - ; transpose the source data for 4-in-parallel operation - ldr r6, [src], pstep ; load source data - str r11, [sp] ; push r11 to stack - ldr r7, [src], pstep - str r12, [sp, #4] ; save current reg before load q0 - q3 data - ldr r8, [src], pstep - str lr, [sp, #8] - ldr lr, [src], pstep - - - TRANSPOSE_MATRIX r6, r7, r8, lr, r9, r10, r11, r12 - - ldr lr, [sp, #8] ; load back (f)limit accumulator - - uqsub8 r6, r12, r11 ; q3 - q2 - uqsub8 r7, r11, r12 ; q2 - q3 - uqsub8 r12, r11, r10 ; q2 - q1 - uqsub8 r11, r10, r11 ; q1 - q2 - orr r6, r6, r7 ; abs (q3-q2) - orr r7, r12, r11 ; abs (q2-q1) - uqsub8 r6, r6, r2 ; compare to limit - uqsub8 r7, r7, r2 ; compare to limit - ldr r11, [sp, #4] ; load back p0 - ldr r12, [sp, #12] ; load back p1 - orr lr, lr, r6 - orr lr, lr, r7 - - uqsub8 r6, r11, r9 ; p0 - q0 - uqsub8 r7, r9, r11 ; q0 - p0 - uqsub8 r8, r12, r10 ; p1 - q1 - uqsub8 r11, r10, r12 ; q1 - p1 - orr r6, r6, r7 ; abs (p0-q0) - ldr r7, c0x7F7F7F7F - orr r8, r8, r11 ; abs (p1-q1) - uqadd8 r6, r6, r6 ; abs (p0-q0) * 2 - and r8, r7, r8, lsr #1 ; abs (p1-q1) / 2 - uqsub8 r11, r10, r9 ; q1 - q0 - uqadd8 r6, r8, r6 ; abs (p0-q0)*2 + abs (p1-q1)/2 - uqsub8 r12, r9, r10 ; q0 - q1 - uqsub8 r6, r6, r4 ; compare to flimit - - orr r9, r11, r12 ; abs (q1-q0) - uqsub8 r8, r9, r2 ; compare to limit - uqsub8 r10, r9, r3 ; compare to thresh - orr lr, lr, r6 - orr lr, lr, r8 - - mvn r11, #0 ; r11 == -1 - mov r12, #0 - - usub8 lr, r12, lr - ldr r9, [sp] ; load the compared result - sel lr, r11, r12 ; filter mask: lr - - cmp lr, #0 - beq mbvskip_filter ; skip filtering - - - - ;vp8_hevmask() function - ;calculate high edge variance - - sub src, src, pstep, lsl #2 ; move src pointer down by 4 lines - - orr r9, r9, r10 - - ldrh r7, [src, #-2] - ldrh r8, [src], pstep - - usub8 r9, r12, r9 - sel r6, r12, r11 ; hev mask: r6 - - - ; vp8_mbfilter() function - ; p2, q2 are only needed at the end. Don't need to load them in now. - ; Transpose needs 8 regs(r6 - r12, and lr). Save r6 and lr first - ; load soure data to r6, r11, r12, lr - ldrh r9, [src, #-2] - ldrh r10, [src], pstep - - pkhbt r12, r7, r8, lsl #16 - - ldrh r7, [src, #-2] - ldrh r8, [src], pstep - - pkhbt r11, r9, r10, lsl #16 - - ldrh r9, [src, #-2] - ldrh r10, [src], pstep - - str r6, [sp] ; save r6 - str lr, [sp, #4] ; save lr - - pkhbt r6, r7, r8, lsl #16 - pkhbt lr, r9, r10, lsl #16 - - ;transpose r12, r11, r6, lr to p1, p0, q0, q1 - TRANSPOSE_MATRIX r12, r11, r6, lr, r7, r8, r9, r10 - - ;load back hev_mask r6 and filter_mask lr - ldr r12, c0x80808080 - ldr r6, [sp] - ldr lr, [sp, #4] - - eor r7, r7, r12 ; ps1 - eor r8, r8, r12 ; ps0 - eor r9, r9, r12 ; qs0 - eor r10, r10, r12 ; qs1 - - qsub8 r12, r9, r8 ; vp8_signed_char_clamp(vp8_filter + 3 * ( qs0 - ps0)) - str r7, [sp, #12] ; store ps1 temporarily - qsub8 r7, r7, r10 ; vp8_signed_char_clamp(ps1-qs1) - str r10, [sp, #8] ; store qs1 temporarily - qadd8 r7, r7, r12 - str r9, [sp] ; store qs0 temporarily - qadd8 r7, r7, r12 - str r8, [sp, #4] ; store ps0 temporarily - qadd8 r7, r7, r12 ; vp8_filter: r7 - - ldr r10, c0x03030303 ; r10 = 3 --modified for vp8 - ldr r9, c0x04040404 - ;mvn r11, #0 ; r11 == -1 - - and r7, r7, lr ; vp8_filter &= mask (lr is free) - - mov r12, r7 ; Filter2: r12 - and r12, r12, r6 ; Filter2 &= hev - - ;modify code for vp8 - ;save bottom 3 bits so that we round one side +4 and the other +3 - qadd8 r8 , r12 , r9 ; Filter1 (r8) = vp8_signed_char_clamp(Filter2+4) - qadd8 r12 , r12 , r10 ; Filter2 (r12) = vp8_signed_char_clamp(Filter2+3) - - mov r10, #0 - shadd8 r8 , r8 , r10 ; Filter1 >>= 3 - shadd8 r12 , r12 , r10 ; Filter2 >>= 3 - shadd8 r8 , r8 , r10 - shadd8 r12 , r12 , r10 - shadd8 r8 , r8 , r10 ; r8: Filter1 - shadd8 r12 , r12 , r10 ; r12: Filter2 - - ldr r9, [sp] ; load qs0 - ldr r11, [sp, #4] ; load ps0 - - qsub8 r9 , r9, r8 ; qs0 = vp8_signed_char_clamp(qs0 - Filter1) - qadd8 r11, r11, r12 ; ps0 = vp8_signed_char_clamp(ps0 + Filter2) - - ;save bottom 3 bits so that we round one side +4 and the other +3 - ;and r8, r12, r10 ; s = Filter2 & 7 (s: r8) - ;qadd8 r12 , r12 , r9 ; Filter2 = vp8_signed_char_clamp(Filter2+4) - ;mov r10, #0 - ;shadd8 r12 , r12 , r10 ; Filter2 >>= 3 - ;usub8 lr, r8, r9 ; s = (s==4)*-1 - ;sel lr, r11, r10 - ;shadd8 r12 , r12 , r10 - ;usub8 r8, r9, r8 - ;sel r8, r11, r10 - ;ldr r9, [sp] ; load qs0 - ;ldr r11, [sp, #4] ; load ps0 - ;shadd8 r12 , r12 , r10 - ;and r8, r8, lr ; -1 for each element that equals 4 - ;qadd8 r10, r8, r12 ; u = vp8_signed_char_clamp(s + Filter2) - ;qsub8 r9 , r9, r12 ; qs0 = vp8_signed_char_clamp(qs0 - Filter2) - ;qadd8 r11, r11, r10 ; ps0 = vp8_signed_char_clamp(ps0 + u) - - ;end of modification for vp8 - - bic r12, r7, r6 ;vp8_filter &= ~hev ( r6 is free) - ;mov r12, r7 - - ;roughly 3/7th difference across boundary - mov lr, #0x1b ; 27 - mov r7, #0x3f ; 63 - - sxtb16 r6, r12 - sxtb16 r10, r12, ror #8 - smlabb r8, r6, lr, r7 - smlatb r6, r6, lr, r7 - smlabb r7, r10, lr, r7 - smultb r10, r10, lr - ssat r8, #8, r8, asr #7 - ssat r6, #8, r6, asr #7 - add r10, r10, #63 - ssat r7, #8, r7, asr #7 - ssat r10, #8, r10, asr #7 - - ldr lr, c0x80808080 - - pkhbt r6, r8, r6, lsl #16 - pkhbt r10, r7, r10, lsl #16 - uxtb16 r6, r6 - uxtb16 r10, r10 - - sub src, src, pstep, lsl #2 ; move src pointer down by 4 lines - - orr r10, r6, r10, lsl #8 ; u = vp8_signed_char_clamp((63 + Filter2 * 27)>>7) - - qsub8 r8, r9, r10 ; s = vp8_signed_char_clamp(qs0 - u) - qadd8 r10, r11, r10 ; s = vp8_signed_char_clamp(ps0 + u) - eor r8, r8, lr ; *oq0 = s^0x80 - eor r10, r10, lr ; *op0 = s^0x80 - - strb r10, [src, #-1] ; store op0 result - strb r8, [src], pstep ; store oq0 result - mov r10, r10, lsr #8 - mov r8, r8, lsr #8 - strb r10, [src, #-1] - strb r8, [src], pstep - mov r10, r10, lsr #8 - mov r8, r8, lsr #8 - strb r10, [src, #-1] - strb r8, [src], pstep - mov r10, r10, lsr #8 - mov r8, r8, lsr #8 - strb r10, [src, #-1] - strb r8, [src], pstep - - ;roughly 2/7th difference across boundary - mov lr, #0x12 ; 18 - mov r7, #0x3f ; 63 - - sxtb16 r6, r12 - sxtb16 r10, r12, ror #8 - smlabb r8, r6, lr, r7 - smlatb r6, r6, lr, r7 - smlabb r9, r10, lr, r7 - - smlatb r10, r10, lr, r7 - ssat r8, #8, r8, asr #7 - ssat r6, #8, r6, asr #7 - ssat r9, #8, r9, asr #7 - ssat r10, #8, r10, asr #7 - - sub src, src, pstep, lsl #2 ; move src pointer down by 4 lines - - pkhbt r6, r8, r6, lsl #16 - pkhbt r10, r9, r10, lsl #16 - - ldr r9, [sp, #8] ; load qs1 - ldr r11, [sp, #12] ; load ps1 - ldr lr, c0x80808080 - - uxtb16 r6, r6 - uxtb16 r10, r10 - - add src, src, #2 - - orr r10, r6, r10, lsl #8 ; u = vp8_signed_char_clamp((63 + Filter2 * 18)>>7) - - qsub8 r8, r9, r10 ; s = vp8_signed_char_clamp(qs1 - u) - qadd8 r10, r11, r10 ; s = vp8_signed_char_clamp(ps1 + u) - eor r8, r8, lr ; *oq1 = s^0x80 - eor r10, r10, lr ; *op1 = s^0x80 - - ldrb r11, [src, #-5] ; load p2 for 1/7th difference across boundary - strb r10, [src, #-4] ; store op1 - strb r8, [src, #-1] ; store oq1 - ldrb r9, [src], pstep ; load q2 for 1/7th difference across boundary - - mov r10, r10, lsr #8 - mov r8, r8, lsr #8 - - ldrb r6, [src, #-5] - strb r10, [src, #-4] - strb r8, [src, #-1] - ldrb r7, [src], pstep - - mov r10, r10, lsr #8 - mov r8, r8, lsr #8 - orr r11, r11, r6, lsl #8 - orr r9, r9, r7, lsl #8 - - ldrb r6, [src, #-5] - strb r10, [src, #-4] - strb r8, [src, #-1] - ldrb r7, [src], pstep - - mov r10, r10, lsr #8 - mov r8, r8, lsr #8 - orr r11, r11, r6, lsl #16 - orr r9, r9, r7, lsl #16 - - ldrb r6, [src, #-5] - strb r10, [src, #-4] - strb r8, [src, #-1] - ldrb r7, [src], pstep - orr r11, r11, r6, lsl #24 - orr r9, r9, r7, lsl #24 - - ;roughly 1/7th difference across boundary - eor r9, r9, lr - eor r11, r11, lr - - mov lr, #0x9 ; 9 - mov r7, #0x3f ; 63 - - sxtb16 r6, r12 - sxtb16 r10, r12, ror #8 - smlabb r8, r6, lr, r7 - smlatb r6, r6, lr, r7 - smlabb r12, r10, lr, r7 - smlatb r10, r10, lr, r7 - ssat r8, #8, r8, asr #7 - ssat r6, #8, r6, asr #7 - ssat r12, #8, r12, asr #7 - ssat r10, #8, r10, asr #7 - - sub src, src, pstep, lsl #2 - - pkhbt r6, r8, r6, lsl #16 - pkhbt r10, r12, r10, lsl #16 - - uxtb16 r6, r6 - uxtb16 r10, r10 - - ldr lr, c0x80808080 - - orr r10, r6, r10, lsl #8 ; u = vp8_signed_char_clamp((63 + Filter2 * 9)>>7) - - qadd8 r8, r11, r10 ; s = vp8_signed_char_clamp(ps2 + u) - qsub8 r10, r9, r10 ; s = vp8_signed_char_clamp(qs2 - u) - eor r8, r8, lr ; *op2 = s^0x80 - eor r10, r10, lr ; *oq2 = s^0x80 - - strb r8, [src, #-5] ; store *op2 - strb r10, [src], pstep ; store *oq2 - mov r8, r8, lsr #8 - mov r10, r10, lsr #8 - strb r8, [src, #-5] - strb r10, [src], pstep - mov r8, r8, lsr #8 - mov r10, r10, lsr #8 - strb r8, [src, #-5] - strb r10, [src], pstep - mov r8, r8, lsr #8 - mov r10, r10, lsr #8 - strb r8, [src, #-5] - strb r10, [src], pstep - - ;adjust src pointer for next loop - sub src, src, #2 - -|mbvskip_filter| - sub src, src, #4 - subs count, count, #1 - - pld [src, #23] ; preload for next block - ldrne r6, [src], pstep ; load source data - pld [src, #23] - ldrne r7, [src], pstep - pld [src, #23] - ldrne r8, [src], pstep - pld [src, #23] - ldrne lr, [src], pstep - - bne MBVnext8 - - add sp, sp, #16 - - ldmia sp!, {r4 - r11, pc} - ENDP ; |vp8_mbloop_filter_vertical_edge_armv6| - -; Constant Pool -c0x80808080 DCD 0x80808080 -c0x03030303 DCD 0x03030303 -c0x04040404 DCD 0x04040404 -c0x01010101 DCD 0x01010101 -c0x7F7F7F7F DCD 0x7F7F7F7F - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/simpleloopfilter_v6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/simpleloopfilter_v6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/simpleloopfilter_v6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/simpleloopfilter_v6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,286 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - EXPORT |vp8_loop_filter_simple_horizontal_edge_armv6| - EXPORT |vp8_loop_filter_simple_vertical_edge_armv6| - - AREA |.text|, CODE, READONLY ; name this block of code - - MACRO - TRANSPOSE_MATRIX $a0, $a1, $a2, $a3, $b0, $b1, $b2, $b3 - ; input: $a0, $a1, $a2, $a3; output: $b0, $b1, $b2, $b3 - ; a0: 03 02 01 00 - ; a1: 13 12 11 10 - ; a2: 23 22 21 20 - ; a3: 33 32 31 30 - ; b3 b2 b1 b0 - - uxtb16 $b1, $a1 ; xx 12 xx 10 - uxtb16 $b0, $a0 ; xx 02 xx 00 - uxtb16 $b3, $a3 ; xx 32 xx 30 - uxtb16 $b2, $a2 ; xx 22 xx 20 - orr $b1, $b0, $b1, lsl #8 ; 12 02 10 00 - orr $b3, $b2, $b3, lsl #8 ; 32 22 30 20 - - uxtb16 $a1, $a1, ror #8 ; xx 13 xx 11 - uxtb16 $a3, $a3, ror #8 ; xx 33 xx 31 - uxtb16 $a0, $a0, ror #8 ; xx 03 xx 01 - uxtb16 $a2, $a2, ror #8 ; xx 23 xx 21 - orr $a0, $a0, $a1, lsl #8 ; 13 03 11 01 - orr $a2, $a2, $a3, lsl #8 ; 33 23 31 21 - - pkhtb $b2, $b3, $b1, asr #16 ; 32 22 12 02 -- p1 - pkhbt $b0, $b1, $b3, lsl #16 ; 30 20 10 00 -- p3 - - pkhtb $b3, $a2, $a0, asr #16 ; 33 23 13 03 -- p0 - pkhbt $b1, $a0, $a2, lsl #16 ; 31 21 11 01 -- p2 - MEND - - - -src RN r0 -pstep RN r1 - -;r0 unsigned char *src_ptr, -;r1 int src_pixel_step, -;r2 const char *blimit - -;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -|vp8_loop_filter_simple_horizontal_edge_armv6| PROC -;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - stmdb sp!, {r4 - r11, lr} - - ldrb r12, [r2] ; blimit - ldr r3, [src, -pstep, lsl #1] ; p1 - ldr r4, [src, -pstep] ; p0 - ldr r5, [src] ; q0 - ldr r6, [src, pstep] ; q1 - orr r12, r12, r12, lsl #8 ; blimit - ldr r2, c0x80808080 - orr r12, r12, r12, lsl #16 ; blimit - mov r9, #4 ; double the count. we're doing 4 at a time - mov lr, #0 ; need 0 in a couple places - -|simple_hnext8| - ; vp8_simple_filter_mask() - - uqsub8 r7, r3, r6 ; p1 - q1 - uqsub8 r8, r6, r3 ; q1 - p1 - uqsub8 r10, r4, r5 ; p0 - q0 - uqsub8 r11, r5, r4 ; q0 - p0 - orr r8, r8, r7 ; abs(p1 - q1) - orr r10, r10, r11 ; abs(p0 - q0) - uqadd8 r10, r10, r10 ; abs(p0 - q0) * 2 - uhadd8 r8, r8, lr ; abs(p1 - q2) >> 1 - uqadd8 r10, r10, r8 ; abs(p0 - q0)*2 + abs(p1 - q1)/2 - mvn r8, #0 - usub8 r10, r12, r10 ; compare to flimit. usub8 sets GE flags - sel r10, r8, lr ; filter mask: F or 0 - cmp r10, #0 - beq simple_hskip_filter ; skip filtering if all masks are 0x00 - - ;vp8_simple_filter() - - eor r3, r3, r2 ; p1 offset to convert to a signed value - eor r6, r6, r2 ; q1 offset to convert to a signed value - eor r4, r4, r2 ; p0 offset to convert to a signed value - eor r5, r5, r2 ; q0 offset to convert to a signed value - - qsub8 r3, r3, r6 ; vp8_filter = p1 - q1 - qsub8 r6, r5, r4 ; q0 - p0 - qadd8 r3, r3, r6 ; += q0 - p0 - ldr r7, c0x04040404 - qadd8 r3, r3, r6 ; += q0 - p0 - ldr r8, c0x03030303 - qadd8 r3, r3, r6 ; vp8_filter = p1-q1 + 3*(q0-p0)) - ;STALL - and r3, r3, r10 ; vp8_filter &= mask - - qadd8 r7 , r3 , r7 ; Filter1 = vp8_filter + 4 - qadd8 r8 , r3 , r8 ; Filter2 = vp8_filter + 3 - - shadd8 r7 , r7 , lr - shadd8 r8 , r8 , lr - shadd8 r7 , r7 , lr - shadd8 r8 , r8 , lr - shadd8 r7 , r7 , lr ; Filter1 >>= 3 - shadd8 r8 , r8 , lr ; Filter2 >>= 3 - - qsub8 r5 ,r5, r7 ; u = q0 - Filter1 - qadd8 r4, r4, r8 ; u = p0 + Filter2 - eor r5, r5, r2 ; *oq0 = u^0x80 - str r5, [src] ; store oq0 result - eor r4, r4, r2 ; *op0 = u^0x80 - str r4, [src, -pstep] ; store op0 result - -|simple_hskip_filter| - subs r9, r9, #1 - addne src, src, #4 ; next row - - ldrne r3, [src, -pstep, lsl #1] ; p1 - ldrne r4, [src, -pstep] ; p0 - ldrne r5, [src] ; q0 - ldrne r6, [src, pstep] ; q1 - - bne simple_hnext8 - - ldmia sp!, {r4 - r11, pc} - ENDP ; |vp8_loop_filter_simple_horizontal_edge_armv6| - - -;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -|vp8_loop_filter_simple_vertical_edge_armv6| PROC -;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - stmdb sp!, {r4 - r11, lr} - - ldrb r12, [r2] ; r12: blimit - ldr r2, c0x80808080 - orr r12, r12, r12, lsl #8 - - ; load soure data to r7, r8, r9, r10 - ldrh r3, [src, #-2] - pld [src, #23] ; preload for next block - ldrh r4, [src], pstep - orr r12, r12, r12, lsl #16 - - ldrh r5, [src, #-2] - pld [src, #23] - ldrh r6, [src], pstep - - pkhbt r7, r3, r4, lsl #16 - - ldrh r3, [src, #-2] - pld [src, #23] - ldrh r4, [src], pstep - - pkhbt r8, r5, r6, lsl #16 - - ldrh r5, [src, #-2] - pld [src, #23] - ldrh r6, [src], pstep - mov r11, #4 ; double the count. we're doing 4 at a time - -|simple_vnext8| - ; vp8_simple_filter_mask() function - pkhbt r9, r3, r4, lsl #16 - pkhbt r10, r5, r6, lsl #16 - - ;transpose r7, r8, r9, r10 to r3, r4, r5, r6 - TRANSPOSE_MATRIX r7, r8, r9, r10, r3, r4, r5, r6 - - uqsub8 r7, r3, r6 ; p1 - q1 - uqsub8 r8, r6, r3 ; q1 - p1 - uqsub8 r9, r4, r5 ; p0 - q0 - uqsub8 r10, r5, r4 ; q0 - p0 - orr r7, r7, r8 ; abs(p1 - q1) - orr r9, r9, r10 ; abs(p0 - q0) - mov r8, #0 - uqadd8 r9, r9, r9 ; abs(p0 - q0) * 2 - uhadd8 r7, r7, r8 ; abs(p1 - q1) / 2 - uqadd8 r7, r7, r9 ; abs(p0 - q0)*2 + abs(p1 - q1)/2 - mvn r10, #0 ; r10 == -1 - - usub8 r7, r12, r7 ; compare to flimit - sel lr, r10, r8 ; filter mask - - cmp lr, #0 - beq simple_vskip_filter ; skip filtering - - ;vp8_simple_filter() function - eor r3, r3, r2 ; p1 offset to convert to a signed value - eor r6, r6, r2 ; q1 offset to convert to a signed value - eor r4, r4, r2 ; p0 offset to convert to a signed value - eor r5, r5, r2 ; q0 offset to convert to a signed value - - qsub8 r3, r3, r6 ; vp8_filter = p1 - q1 - qsub8 r6, r5, r4 ; q0 - p0 - - qadd8 r3, r3, r6 ; vp8_filter += q0 - p0 - ldr r9, c0x03030303 ; r9 = 3 - - qadd8 r3, r3, r6 ; vp8_filter += q0 - p0 - ldr r7, c0x04040404 - - qadd8 r3, r3, r6 ; vp8_filter = p1-q1 + 3*(q0-p0)) - ;STALL - and r3, r3, lr ; vp8_filter &= mask - - qadd8 r9 , r3 , r9 ; Filter2 = vp8_filter + 3 - qadd8 r3 , r3 , r7 ; Filter1 = vp8_filter + 4 - - shadd8 r9 , r9 , r8 - shadd8 r3 , r3 , r8 - shadd8 r9 , r9 , r8 - shadd8 r3 , r3 , r8 - shadd8 r9 , r9 , r8 ; Filter2 >>= 3 - shadd8 r3 , r3 , r8 ; Filter1 >>= 3 - - ;calculate output - sub src, src, pstep, lsl #2 - - qadd8 r4, r4, r9 ; u = p0 + Filter2 - qsub8 r5, r5, r3 ; u = q0 - Filter1 - eor r4, r4, r2 ; *op0 = u^0x80 - eor r5, r5, r2 ; *oq0 = u^0x80 - - strb r4, [src, #-1] ; store the result - mov r4, r4, lsr #8 - strb r5, [src], pstep - mov r5, r5, lsr #8 - - strb r4, [src, #-1] - mov r4, r4, lsr #8 - strb r5, [src], pstep - mov r5, r5, lsr #8 - - strb r4, [src, #-1] - mov r4, r4, lsr #8 - strb r5, [src], pstep - mov r5, r5, lsr #8 - - strb r4, [src, #-1] - strb r5, [src], pstep - -|simple_vskip_filter| - subs r11, r11, #1 - - ; load soure data to r7, r8, r9, r10 - ldrneh r3, [src, #-2] - pld [src, #23] ; preload for next block - ldrneh r4, [src], pstep - - ldrneh r5, [src, #-2] - pld [src, #23] - ldrneh r6, [src], pstep - - pkhbt r7, r3, r4, lsl #16 - - ldrneh r3, [src, #-2] - pld [src, #23] - ldrneh r4, [src], pstep - - pkhbt r8, r5, r6, lsl #16 - - ldrneh r5, [src, #-2] - pld [src, #23] - ldrneh r6, [src], pstep - - bne simple_vnext8 - - ldmia sp!, {r4 - r11, pc} - ENDP ; |vp8_loop_filter_simple_vertical_edge_armv6| - -; Constant Pool -c0x80808080 DCD 0x80808080 -c0x03030303 DCD 0x03030303 -c0x04040404 DCD 0x04040404 - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/sixtappredict8x4_v6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/sixtappredict8x4_v6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/sixtappredict8x4_v6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/sixtappredict8x4_v6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,273 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - EXPORT |vp8_sixtap_predict8x4_armv6| - - AREA |.text|, CODE, READONLY ; name this block of code -;------------------------------------- -; r0 unsigned char *src_ptr, -; r1 int src_pixels_per_line, -; r2 int xoffset, -; r3 int yoffset, -; stack unsigned char *dst_ptr, -; stack int dst_pitch -;------------------------------------- -;note: In first pass, store the result in transpose(8linesx9columns) on stack. Temporary stack size is 184. -;Line width is 20 that is 9 short data plus 2 to make it 4bytes aligned. In second pass, load data from stack, -;and the result is stored in transpose. -|vp8_sixtap_predict8x4_armv6| PROC - stmdb sp!, {r4 - r11, lr} - str r3, [sp, #-184]! ;reserve space on stack for temporary storage, store yoffset - - cmp r2, #0 ;skip first_pass filter if xoffset=0 - add lr, sp, #4 ;point to temporary buffer - beq skip_firstpass_filter - -;first-pass filter - adr r12, filter8_coeff - sub r0, r0, r1, lsl #1 - - add r3, r1, #10 ; preload next low - pld [r0, r3] - - add r2, r12, r2, lsl #4 ;calculate filter location - add r0, r0, #3 ;adjust src only for loading convinience - - ldr r3, [r2] ; load up packed filter coefficients - ldr r4, [r2, #4] - ldr r5, [r2, #8] - - mov r2, #0x90000 ; height=9 is top part of counter - - sub r1, r1, #8 - -|first_pass_hloop_v6| - ldrb r6, [r0, #-5] ; load source data - ldrb r7, [r0, #-4] - ldrb r8, [r0, #-3] - ldrb r9, [r0, #-2] - ldrb r10, [r0, #-1] - - orr r2, r2, #0x4 ; construct loop counter. width=8=4x2 - - pkhbt r6, r6, r7, lsl #16 ; r7 | r6 - pkhbt r7, r7, r8, lsl #16 ; r8 | r7 - - pkhbt r8, r8, r9, lsl #16 ; r9 | r8 - pkhbt r9, r9, r10, lsl #16 ; r10 | r9 - -|first_pass_wloop_v6| - smuad r11, r6, r3 ; vp8_filter[0], vp8_filter[1] - smuad r12, r7, r3 - - ldrb r6, [r0], #1 - - smlad r11, r8, r4, r11 ; vp8_filter[2], vp8_filter[3] - ldrb r7, [r0], #1 - smlad r12, r9, r4, r12 - - pkhbt r10, r10, r6, lsl #16 ; r10 | r9 - pkhbt r6, r6, r7, lsl #16 ; r11 | r10 - smlad r11, r10, r5, r11 ; vp8_filter[4], vp8_filter[5] - smlad r12, r6, r5, r12 - - sub r2, r2, #1 - - add r11, r11, #0x40 ; round_shift_and_clamp - tst r2, #0xff ; test loop counter - usat r11, #8, r11, asr #7 - add r12, r12, #0x40 - strh r11, [lr], #20 ; result is transposed and stored, which - usat r12, #8, r12, asr #7 - - strh r12, [lr], #20 - - movne r11, r6 - movne r12, r7 - - movne r6, r8 - movne r7, r9 - movne r8, r10 - movne r9, r11 - movne r10, r12 - - bne first_pass_wloop_v6 - - ;;add r9, ppl, #30 ; attempt to load 2 adjacent cache lines - ;;IF ARCHITECTURE=6 - ;pld [src, ppl] - ;;pld [src, r9] - ;;ENDIF - - subs r2, r2, #0x10000 - - sub lr, lr, #158 - - add r0, r0, r1 ; move to next input line - - add r11, r1, #18 ; preload next low. adding back block width(=8), which is subtracted earlier - pld [r0, r11] - - bne first_pass_hloop_v6 - -;second pass filter -secondpass_filter - ldr r3, [sp], #4 ; load back yoffset - ldr r0, [sp, #216] ; load dst address from stack 180+36 - ldr r1, [sp, #220] ; load dst stride from stack 180+40 - - cmp r3, #0 - beq skip_secondpass_filter - - adr r12, filter8_coeff - add lr, r12, r3, lsl #4 ;calculate filter location - - mov r2, #0x00080000 - - ldr r3, [lr] ; load up packed filter coefficients - ldr r4, [lr, #4] - ldr r5, [lr, #8] - - pkhbt r12, r4, r3 ; pack the filter differently - pkhbt r11, r5, r4 - -second_pass_hloop_v6 - ldr r6, [sp] ; load the data - ldr r7, [sp, #4] - - orr r2, r2, #2 ; loop counter - -second_pass_wloop_v6 - smuad lr, r3, r6 ; apply filter - smulbt r10, r3, r6 - - ldr r8, [sp, #8] - - smlad lr, r4, r7, lr - smladx r10, r12, r7, r10 - - ldrh r9, [sp, #12] - - smlad lr, r5, r8, lr - smladx r10, r11, r8, r10 - - add sp, sp, #4 - smlatb r10, r5, r9, r10 - - sub r2, r2, #1 - - add lr, lr, #0x40 ; round_shift_and_clamp - tst r2, #0xff - usat lr, #8, lr, asr #7 - add r10, r10, #0x40 - strb lr, [r0], r1 ; the result is transposed back and stored - usat r10, #8, r10, asr #7 - - strb r10, [r0],r1 - - movne r6, r7 - movne r7, r8 - - bne second_pass_wloop_v6 - - subs r2, r2, #0x10000 - add sp, sp, #12 ; updata src for next loop (20-8) - sub r0, r0, r1, lsl #2 - add r0, r0, #1 - - bne second_pass_hloop_v6 - - add sp, sp, #20 - ldmia sp!, {r4 - r11, pc} - -;-------------------- -skip_firstpass_filter - sub r0, r0, r1, lsl #1 - sub r1, r1, #8 - mov r2, #9 - -skip_firstpass_hloop - ldrb r4, [r0], #1 ; load data - subs r2, r2, #1 - ldrb r5, [r0], #1 - strh r4, [lr], #20 ; store it to immediate buffer - ldrb r6, [r0], #1 ; load data - strh r5, [lr], #20 - ldrb r7, [r0], #1 - strh r6, [lr], #20 - ldrb r8, [r0], #1 - strh r7, [lr], #20 - ldrb r9, [r0], #1 - strh r8, [lr], #20 - ldrb r10, [r0], #1 - strh r9, [lr], #20 - ldrb r11, [r0], #1 - strh r10, [lr], #20 - add r0, r0, r1 ; move to next input line - strh r11, [lr], #20 - - sub lr, lr, #158 ; move over to next column - bne skip_firstpass_hloop - - b secondpass_filter - -;-------------------- -skip_secondpass_filter - mov r2, #8 - add sp, sp, #4 ;start from src[0] instead of src[-2] - -skip_secondpass_hloop - ldr r6, [sp], #4 - subs r2, r2, #1 - ldr r8, [sp], #4 - - mov r7, r6, lsr #16 ; unpack - strb r6, [r0], r1 - mov r9, r8, lsr #16 - strb r7, [r0], r1 - add sp, sp, #12 ; 20-8 - strb r8, [r0], r1 - strb r9, [r0], r1 - - sub r0, r0, r1, lsl #2 - add r0, r0, #1 - - bne skip_secondpass_hloop - - add sp, sp, #16 ; 180 - (160 +4) - - ldmia sp!, {r4 - r11, pc} - - ENDP - -;----------------- -;One word each is reserved. Label filter_coeff can be used to access the data. -;Data address: filter_coeff, filter_coeff+4, filter_coeff+8 ... -filter8_coeff - DCD 0x00000000, 0x00000080, 0x00000000, 0x00000000 - DCD 0xfffa0000, 0x000c007b, 0x0000ffff, 0x00000000 - DCD 0xfff50002, 0x0024006c, 0x0001fff8, 0x00000000 - DCD 0xfff70000, 0x0032005d, 0x0000fffa, 0x00000000 - DCD 0xfff00003, 0x004d004d, 0x0003fff0, 0x00000000 - DCD 0xfffa0000, 0x005d0032, 0x0000fff7, 0x00000000 - DCD 0xfff80001, 0x006c0024, 0x0002fff5, 0x00000000 - DCD 0xffff0000, 0x007b000c, 0x0000fffa, 0x00000000 - - ;DCD 0, 0, 128, 0, 0, 0 - ;DCD 0, -6, 123, 12, -1, 0 - ;DCD 2, -11, 108, 36, -8, 1 - ;DCD 0, -9, 93, 50, -6, 0 - ;DCD 3, -16, 77, 77, -16, 3 - ;DCD 0, -6, 50, 93, -9, 0 - ;DCD 1, -8, 36, 108, -11, 2 - ;DCD 0, -1, 12, 123, -6, 0 - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_sad16x16_armv6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_sad16x16_armv6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_sad16x16_armv6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_sad16x16_armv6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,96 +0,0 @@ -; -; Copyright (c) 2011 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - EXPORT |vp8_sad16x16_armv6| - - ARM - REQUIRE8 - PRESERVE8 - - AREA ||.text||, CODE, READONLY, ALIGN=2 - -; r0 const unsigned char *src_ptr -; r1 int src_stride -; r2 const unsigned char *ref_ptr -; r3 int ref_stride -; stack max_sad (not used) -|vp8_sad16x16_armv6| PROC - stmfd sp!, {r4-r12, lr} - - pld [r0, r1, lsl #0] - pld [r2, r3, lsl #0] - pld [r0, r1, lsl #1] - pld [r2, r3, lsl #1] - - mov r4, #0 ; sad = 0; - mov r5, #8 ; loop count - -loop - ; 1st row - ldr r6, [r0, #0x0] ; load 4 src pixels (1A) - ldr r8, [r2, #0x0] ; load 4 ref pixels (1A) - ldr r7, [r0, #0x4] ; load 4 src pixels (1A) - ldr r9, [r2, #0x4] ; load 4 ref pixels (1A) - ldr r10, [r0, #0x8] ; load 4 src pixels (1B) - ldr r11, [r0, #0xC] ; load 4 src pixels (1B) - - usada8 r4, r8, r6, r4 ; calculate sad for 4 pixels - usad8 r8, r7, r9 ; calculate sad for 4 pixels - - ldr r12, [r2, #0x8] ; load 4 ref pixels (1B) - ldr lr, [r2, #0xC] ; load 4 ref pixels (1B) - - add r0, r0, r1 ; set src pointer to next row - add r2, r2, r3 ; set dst pointer to next row - - pld [r0, r1, lsl #1] - pld [r2, r3, lsl #1] - - usada8 r4, r10, r12, r4 ; calculate sad for 4 pixels - usada8 r8, r11, lr, r8 ; calculate sad for 4 pixels - - ldr r6, [r0, #0x0] ; load 4 src pixels (2A) - ldr r7, [r0, #0x4] ; load 4 src pixels (2A) - add r4, r4, r8 ; add partial sad values - - ; 2nd row - ldr r8, [r2, #0x0] ; load 4 ref pixels (2A) - ldr r9, [r2, #0x4] ; load 4 ref pixels (2A) - ldr r10, [r0, #0x8] ; load 4 src pixels (2B) - ldr r11, [r0, #0xC] ; load 4 src pixels (2B) - - usada8 r4, r6, r8, r4 ; calculate sad for 4 pixels - usad8 r8, r7, r9 ; calculate sad for 4 pixels - - ldr r12, [r2, #0x8] ; load 4 ref pixels (2B) - ldr lr, [r2, #0xC] ; load 4 ref pixels (2B) - - add r0, r0, r1 ; set src pointer to next row - add r2, r2, r3 ; set dst pointer to next row - - usada8 r4, r10, r12, r4 ; calculate sad for 4 pixels - usada8 r8, r11, lr, r8 ; calculate sad for 4 pixels - - pld [r0, r1, lsl #1] - pld [r2, r3, lsl #1] - - subs r5, r5, #1 ; decrement loop counter - add r4, r4, r8 ; add partial sad values - - bne loop - - mov r0, r4 ; return sad - ldmfd sp!, {r4-r12, pc} - - ENDP - - END - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_variance16x16_armv6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_variance16x16_armv6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_variance16x16_armv6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_variance16x16_armv6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,154 +0,0 @@ -; -; Copyright (c) 2011 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - EXPORT |vp8_variance16x16_armv6| - - ARM - REQUIRE8 - PRESERVE8 - - AREA ||.text||, CODE, READONLY, ALIGN=2 - -; r0 unsigned char *src_ptr -; r1 int source_stride -; r2 unsigned char *ref_ptr -; r3 int recon_stride -; stack unsigned int *sse -|vp8_variance16x16_armv6| PROC - - stmfd sp!, {r4-r12, lr} - - pld [r0, r1, lsl #0] - pld [r2, r3, lsl #0] - - mov r8, #0 ; initialize sum = 0 - mov r11, #0 ; initialize sse = 0 - mov r12, #16 ; set loop counter to 16 (=block height) - -loop - ; 1st 4 pixels - ldr r4, [r0, #0] ; load 4 src pixels - ldr r5, [r2, #0] ; load 4 ref pixels - - mov lr, #0 ; constant zero - - usub8 r6, r4, r5 ; calculate difference - pld [r0, r1, lsl #1] - sel r7, r6, lr ; select bytes with positive difference - usub8 r9, r5, r4 ; calculate difference with reversed operands - pld [r2, r3, lsl #1] - sel r6, r9, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r4, r7, lr ; calculate sum of positive differences - usad8 r5, r6, lr ; calculate sum of negative differences - orr r6, r6, r7 ; differences of all 4 pixels - ; calculate total sum - adds r8, r8, r4 ; add positive differences to sum - subs r8, r8, r5 ; subtract negative differences from sum - - ; calculate sse - uxtb16 r5, r6 ; byte (two pixels) to halfwords - uxtb16 r10, r6, ror #8 ; another two pixels to halfwords - smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) - - ; 2nd 4 pixels - ldr r4, [r0, #4] ; load 4 src pixels - ldr r5, [r2, #4] ; load 4 ref pixels - smlad r11, r10, r10, r11 ; dual signed multiply, add and accumulate (2) - - usub8 r6, r4, r5 ; calculate difference - sel r7, r6, lr ; select bytes with positive difference - usub8 r9, r5, r4 ; calculate difference with reversed operands - sel r6, r9, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r4, r7, lr ; calculate sum of positive differences - usad8 r5, r6, lr ; calculate sum of negative differences - orr r6, r6, r7 ; differences of all 4 pixels - - ; calculate total sum - add r8, r8, r4 ; add positive differences to sum - sub r8, r8, r5 ; subtract negative differences from sum - - ; calculate sse - uxtb16 r5, r6 ; byte (two pixels) to halfwords - uxtb16 r10, r6, ror #8 ; another two pixels to halfwords - smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) - - ; 3rd 4 pixels - ldr r4, [r0, #8] ; load 4 src pixels - ldr r5, [r2, #8] ; load 4 ref pixels - smlad r11, r10, r10, r11 ; dual signed multiply, add and accumulate (2) - - usub8 r6, r4, r5 ; calculate difference - sel r7, r6, lr ; select bytes with positive difference - usub8 r9, r5, r4 ; calculate difference with reversed operands - sel r6, r9, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r4, r7, lr ; calculate sum of positive differences - usad8 r5, r6, lr ; calculate sum of negative differences - orr r6, r6, r7 ; differences of all 4 pixels - - ; calculate total sum - add r8, r8, r4 ; add positive differences to sum - sub r8, r8, r5 ; subtract negative differences from sum - - ; calculate sse - uxtb16 r5, r6 ; byte (two pixels) to halfwords - uxtb16 r10, r6, ror #8 ; another two pixels to halfwords - smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) - - ; 4th 4 pixels - ldr r4, [r0, #12] ; load 4 src pixels - ldr r5, [r2, #12] ; load 4 ref pixels - smlad r11, r10, r10, r11 ; dual signed multiply, add and accumulate (2) - - usub8 r6, r4, r5 ; calculate difference - add r0, r0, r1 ; set src_ptr to next row - sel r7, r6, lr ; select bytes with positive difference - usub8 r9, r5, r4 ; calculate difference with reversed operands - add r2, r2, r3 ; set dst_ptr to next row - sel r6, r9, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r4, r7, lr ; calculate sum of positive differences - usad8 r5, r6, lr ; calculate sum of negative differences - orr r6, r6, r7 ; differences of all 4 pixels - - ; calculate total sum - add r8, r8, r4 ; add positive differences to sum - sub r8, r8, r5 ; subtract negative differences from sum - - ; calculate sse - uxtb16 r5, r6 ; byte (two pixels) to halfwords - uxtb16 r10, r6, ror #8 ; another two pixels to halfwords - smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) - smlad r11, r10, r10, r11 ; dual signed multiply, add and accumulate (2) - - - subs r12, r12, #1 - - bne loop - - ; return stuff - ldr r6, [sp, #40] ; get address of sse - mul r0, r8, r8 ; sum * sum - str r11, [r6] ; store sse - sub r0, r11, r0, lsr #8 ; return (sse - ((sum * sum) >> 8)) - - ldmfd sp!, {r4-r12, pc} - - ENDP - - END - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_variance8x8_armv6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_variance8x8_armv6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_variance8x8_armv6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_variance8x8_armv6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,101 +0,0 @@ -; -; Copyright (c) 2011 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - EXPORT |vp8_variance8x8_armv6| - - ARM - - AREA ||.text||, CODE, READONLY, ALIGN=2 - -; r0 unsigned char *src_ptr -; r1 int source_stride -; r2 unsigned char *ref_ptr -; r3 int recon_stride -; stack unsigned int *sse -|vp8_variance8x8_armv6| PROC - - push {r4-r10, lr} - - pld [r0, r1, lsl #0] - pld [r2, r3, lsl #0] - - mov r12, #8 ; set loop counter to 8 (=block height) - mov r4, #0 ; initialize sum = 0 - mov r5, #0 ; initialize sse = 0 - -loop - ; 1st 4 pixels - ldr r6, [r0, #0x0] ; load 4 src pixels - ldr r7, [r2, #0x0] ; load 4 ref pixels - - mov lr, #0 ; constant zero - - usub8 r8, r6, r7 ; calculate difference - pld [r0, r1, lsl #1] - sel r10, r8, lr ; select bytes with positive difference - usub8 r9, r7, r6 ; calculate difference with reversed operands - pld [r2, r3, lsl #1] - sel r8, r9, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r6, r10, lr ; calculate sum of positive differences - usad8 r7, r8, lr ; calculate sum of negative differences - orr r8, r8, r10 ; differences of all 4 pixels - ; calculate total sum - add r4, r4, r6 ; add positive differences to sum - sub r4, r4, r7 ; subtract negative differences from sum - - ; calculate sse - uxtb16 r7, r8 ; byte (two pixels) to halfwords - uxtb16 r10, r8, ror #8 ; another two pixels to halfwords - smlad r5, r7, r7, r5 ; dual signed multiply, add and accumulate (1) - - ; 2nd 4 pixels - ldr r6, [r0, #0x4] ; load 4 src pixels - ldr r7, [r2, #0x4] ; load 4 ref pixels - smlad r5, r10, r10, r5 ; dual signed multiply, add and accumulate (2) - - usub8 r8, r6, r7 ; calculate difference - add r0, r0, r1 ; set src_ptr to next row - sel r10, r8, lr ; select bytes with positive difference - usub8 r9, r7, r6 ; calculate difference with reversed operands - add r2, r2, r3 ; set dst_ptr to next row - sel r8, r9, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r6, r10, lr ; calculate sum of positive differences - usad8 r7, r8, lr ; calculate sum of negative differences - orr r8, r8, r10 ; differences of all 4 pixels - - ; calculate total sum - add r4, r4, r6 ; add positive differences to sum - sub r4, r4, r7 ; subtract negative differences from sum - - ; calculate sse - uxtb16 r7, r8 ; byte (two pixels) to halfwords - uxtb16 r10, r8, ror #8 ; another two pixels to halfwords - smlad r5, r7, r7, r5 ; dual signed multiply, add and accumulate (1) - subs r12, r12, #1 ; next row - smlad r5, r10, r10, r5 ; dual signed multiply, add and accumulate (2) - - bne loop - - ; return stuff - ldr r8, [sp, #32] ; get address of sse - mul r1, r4, r4 ; sum * sum - str r5, [r8] ; store sse - sub r0, r5, r1, ASR #6 ; return (sse - ((sum * sum) >> 6)) - - pop {r4-r10, pc} - - ENDP - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,182 +0,0 @@ -; -; Copyright (c) 2011 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - EXPORT |vp8_variance_halfpixvar16x16_h_armv6| - - ARM - REQUIRE8 - PRESERVE8 - - AREA ||.text||, CODE, READONLY, ALIGN=2 - -; r0 unsigned char *src_ptr -; r1 int source_stride -; r2 unsigned char *ref_ptr -; r3 int recon_stride -; stack unsigned int *sse -|vp8_variance_halfpixvar16x16_h_armv6| PROC - - stmfd sp!, {r4-r12, lr} - - pld [r0, r1, lsl #0] - pld [r2, r3, lsl #0] - - mov r8, #0 ; initialize sum = 0 - ldr r10, c80808080 - mov r11, #0 ; initialize sse = 0 - mov r12, #16 ; set loop counter to 16 (=block height) - mov lr, #0 ; constant zero -loop - ; 1st 4 pixels - ldr r4, [r0, #0] ; load 4 src pixels - ldr r6, [r0, #1] ; load 4 src pixels with 1 byte offset - ldr r5, [r2, #0] ; load 4 ref pixels - - ; bilinear interpolation - mvn r6, r6 - uhsub8 r4, r4, r6 - eor r4, r4, r10 - - usub8 r6, r4, r5 ; calculate difference - pld [r0, r1, lsl #1] - sel r7, r6, lr ; select bytes with positive difference - usub8 r6, r5, r4 ; calculate difference with reversed operands - pld [r2, r3, lsl #1] - sel r6, r6, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r4, r7, lr ; calculate sum of positive differences - usad8 r5, r6, lr ; calculate sum of negative differences - orr r6, r6, r7 ; differences of all 4 pixels - ; calculate total sum - adds r8, r8, r4 ; add positive differences to sum - subs r8, r8, r5 ; subtract negative differences from sum - - ; calculate sse - uxtb16 r5, r6 ; byte (two pixels) to halfwords - uxtb16 r7, r6, ror #8 ; another two pixels to halfwords - smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) - - ; 2nd 4 pixels - ldr r4, [r0, #4] ; load 4 src pixels - ldr r6, [r0, #5] ; load 4 src pixels with 1 byte offset - ldr r5, [r2, #4] ; load 4 ref pixels - - ; bilinear interpolation - mvn r6, r6 - uhsub8 r4, r4, r6 - eor r4, r4, r10 - - smlad r11, r7, r7, r11 ; dual signed multiply, add and accumulate (2) - - usub8 r6, r4, r5 ; calculate difference - sel r7, r6, lr ; select bytes with positive difference - usub8 r6, r5, r4 ; calculate difference with reversed operands - sel r6, r6, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r4, r7, lr ; calculate sum of positive differences - usad8 r5, r6, lr ; calculate sum of negative differences - orr r6, r6, r7 ; differences of all 4 pixels - - ; calculate total sum - add r8, r8, r4 ; add positive differences to sum - sub r8, r8, r5 ; subtract negative differences from sum - - ; calculate sse - uxtb16 r5, r6 ; byte (two pixels) to halfwords - uxtb16 r7, r6, ror #8 ; another two pixels to halfwords - smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) - - ; 3rd 4 pixels - ldr r4, [r0, #8] ; load 4 src pixels - ldr r6, [r0, #9] ; load 4 src pixels with 1 byte offset - ldr r5, [r2, #8] ; load 4 ref pixels - - ; bilinear interpolation - mvn r6, r6 - uhsub8 r4, r4, r6 - eor r4, r4, r10 - - smlad r11, r7, r7, r11 ; dual signed multiply, add and accumulate (2) - - usub8 r6, r4, r5 ; calculate difference - sel r7, r6, lr ; select bytes with positive difference - usub8 r6, r5, r4 ; calculate difference with reversed operands - sel r6, r6, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r4, r7, lr ; calculate sum of positive differences - usad8 r5, r6, lr ; calculate sum of negative differences - orr r6, r6, r7 ; differences of all 4 pixels - - ; calculate total sum - add r8, r8, r4 ; add positive differences to sum - sub r8, r8, r5 ; subtract negative differences from sum - - ; calculate sse - uxtb16 r5, r6 ; byte (two pixels) to halfwords - uxtb16 r7, r6, ror #8 ; another two pixels to halfwords - smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) - - ; 4th 4 pixels - ldr r4, [r0, #12] ; load 4 src pixels - ldr r6, [r0, #13] ; load 4 src pixels with 1 byte offset - ldr r5, [r2, #12] ; load 4 ref pixels - - ; bilinear interpolation - mvn r6, r6 - uhsub8 r4, r4, r6 - eor r4, r4, r10 - - smlad r11, r7, r7, r11 ; dual signed multiply, add and accumulate (2) - - usub8 r6, r4, r5 ; calculate difference - add r0, r0, r1 ; set src_ptr to next row - sel r7, r6, lr ; select bytes with positive difference - usub8 r6, r5, r4 ; calculate difference with reversed operands - add r2, r2, r3 ; set dst_ptr to next row - sel r6, r6, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r4, r7, lr ; calculate sum of positive differences - usad8 r5, r6, lr ; calculate sum of negative differences - orr r6, r6, r7 ; differences of all 4 pixels - - ; calculate total sum - add r8, r8, r4 ; add positive differences to sum - sub r8, r8, r5 ; subtract negative differences from sum - - ; calculate sse - uxtb16 r5, r6 ; byte (two pixels) to halfwords - uxtb16 r7, r6, ror #8 ; another two pixels to halfwords - smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) - smlad r11, r7, r7, r11 ; dual signed multiply, add and accumulate (2) - - subs r12, r12, #1 - - bne loop - - ; return stuff - ldr r6, [sp, #40] ; get address of sse - mul r0, r8, r8 ; sum * sum - str r11, [r6] ; store sse - sub r0, r11, r0, lsr #8 ; return (sse - ((sum * sum) >> 8)) - - ldmfd sp!, {r4-r12, pc} - - ENDP - -c80808080 - DCD 0x80808080 - - END - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,222 +0,0 @@ -; -; Copyright (c) 2011 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - EXPORT |vp8_variance_halfpixvar16x16_hv_armv6| - - ARM - REQUIRE8 - PRESERVE8 - - AREA ||.text||, CODE, READONLY, ALIGN=2 - -; r0 unsigned char *src_ptr -; r1 int source_stride -; r2 unsigned char *ref_ptr -; r3 int recon_stride -; stack unsigned int *sse -|vp8_variance_halfpixvar16x16_hv_armv6| PROC - - stmfd sp!, {r4-r12, lr} - - pld [r0, r1, lsl #0] - pld [r2, r3, lsl #0] - - mov r8, #0 ; initialize sum = 0 - ldr r10, c80808080 - mov r11, #0 ; initialize sse = 0 - mov r12, #16 ; set loop counter to 16 (=block height) - mov lr, #0 ; constant zero -loop - add r9, r0, r1 ; pointer to pixels on the next row - ; 1st 4 pixels - ldr r4, [r0, #0] ; load source pixels a, row N - ldr r6, [r0, #1] ; load source pixels b, row N - ldr r5, [r9, #0] ; load source pixels c, row N+1 - ldr r7, [r9, #1] ; load source pixels d, row N+1 - - ; x = (a + b + 1) >> 1, interpolate pixels horizontally on row N - mvn r6, r6 - uhsub8 r4, r4, r6 - eor r4, r4, r10 - ; y = (c + d + 1) >> 1, interpolate pixels horizontally on row N+1 - mvn r7, r7 - uhsub8 r5, r5, r7 - eor r5, r5, r10 - ; z = (x + y + 1) >> 1, interpolate half pixel values vertically - mvn r5, r5 - uhsub8 r4, r4, r5 - ldr r5, [r2, #0] ; load 4 ref pixels - eor r4, r4, r10 - - usub8 r6, r4, r5 ; calculate difference - pld [r0, r1, lsl #1] - sel r7, r6, lr ; select bytes with positive difference - usub8 r6, r5, r4 ; calculate difference with reversed operands - pld [r2, r3, lsl #1] - sel r6, r6, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r4, r7, lr ; calculate sum of positive differences - usad8 r5, r6, lr ; calculate sum of negative differences - orr r6, r6, r7 ; differences of all 4 pixels - ; calculate total sum - adds r8, r8, r4 ; add positive differences to sum - subs r8, r8, r5 ; subtract negative differences from sum - - ; calculate sse - uxtb16 r5, r6 ; byte (two pixels) to halfwords - uxtb16 r7, r6, ror #8 ; another two pixels to halfwords - smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) - - ; 2nd 4 pixels - ldr r4, [r0, #4] ; load source pixels a, row N - ldr r6, [r0, #5] ; load source pixels b, row N - ldr r5, [r9, #4] ; load source pixels c, row N+1 - - smlad r11, r7, r7, r11 ; dual signed multiply, add and accumulate (2) - - ldr r7, [r9, #5] ; load source pixels d, row N+1 - - ; x = (a + b + 1) >> 1, interpolate pixels horizontally on row N - mvn r6, r6 - uhsub8 r4, r4, r6 - eor r4, r4, r10 - ; y = (c + d + 1) >> 1, interpolate pixels horizontally on row N+1 - mvn r7, r7 - uhsub8 r5, r5, r7 - eor r5, r5, r10 - ; z = (x + y + 1) >> 1, interpolate half pixel values vertically - mvn r5, r5 - uhsub8 r4, r4, r5 - ldr r5, [r2, #4] ; load 4 ref pixels - eor r4, r4, r10 - - usub8 r6, r4, r5 ; calculate difference - sel r7, r6, lr ; select bytes with positive difference - usub8 r6, r5, r4 ; calculate difference with reversed operands - sel r6, r6, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r4, r7, lr ; calculate sum of positive differences - usad8 r5, r6, lr ; calculate sum of negative differences - orr r6, r6, r7 ; differences of all 4 pixels - - ; calculate total sum - add r8, r8, r4 ; add positive differences to sum - sub r8, r8, r5 ; subtract negative differences from sum - - ; calculate sse - uxtb16 r5, r6 ; byte (two pixels) to halfwords - uxtb16 r7, r6, ror #8 ; another two pixels to halfwords - smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) - - ; 3rd 4 pixels - ldr r4, [r0, #8] ; load source pixels a, row N - ldr r6, [r0, #9] ; load source pixels b, row N - ldr r5, [r9, #8] ; load source pixels c, row N+1 - - smlad r11, r7, r7, r11 ; dual signed multiply, add and accumulate (2) - - ldr r7, [r9, #9] ; load source pixels d, row N+1 - - ; x = (a + b + 1) >> 1, interpolate pixels horizontally on row N - mvn r6, r6 - uhsub8 r4, r4, r6 - eor r4, r4, r10 - ; y = (c + d + 1) >> 1, interpolate pixels horizontally on row N+1 - mvn r7, r7 - uhsub8 r5, r5, r7 - eor r5, r5, r10 - ; z = (x + y + 1) >> 1, interpolate half pixel values vertically - mvn r5, r5 - uhsub8 r4, r4, r5 - ldr r5, [r2, #8] ; load 4 ref pixels - eor r4, r4, r10 - - usub8 r6, r4, r5 ; calculate difference - sel r7, r6, lr ; select bytes with positive difference - usub8 r6, r5, r4 ; calculate difference with reversed operands - sel r6, r6, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r4, r7, lr ; calculate sum of positive differences - usad8 r5, r6, lr ; calculate sum of negative differences - orr r6, r6, r7 ; differences of all 4 pixels - - ; calculate total sum - add r8, r8, r4 ; add positive differences to sum - sub r8, r8, r5 ; subtract negative differences from sum - - ; calculate sse - uxtb16 r5, r6 ; byte (two pixels) to halfwords - uxtb16 r7, r6, ror #8 ; another two pixels to halfwords - smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) - - ; 4th 4 pixels - ldr r4, [r0, #12] ; load source pixels a, row N - ldr r6, [r0, #13] ; load source pixels b, row N - ldr r5, [r9, #12] ; load source pixels c, row N+1 - smlad r11, r7, r7, r11 ; dual signed multiply, add and accumulate (2) - ldr r7, [r9, #13] ; load source pixels d, row N+1 - - ; x = (a + b + 1) >> 1, interpolate pixels horizontally on row N - mvn r6, r6 - uhsub8 r4, r4, r6 - eor r4, r4, r10 - ; y = (c + d + 1) >> 1, interpolate pixels horizontally on row N+1 - mvn r7, r7 - uhsub8 r5, r5, r7 - eor r5, r5, r10 - ; z = (x + y + 1) >> 1, interpolate half pixel values vertically - mvn r5, r5 - uhsub8 r4, r4, r5 - ldr r5, [r2, #12] ; load 4 ref pixels - eor r4, r4, r10 - - usub8 r6, r4, r5 ; calculate difference - add r0, r0, r1 ; set src_ptr to next row - sel r7, r6, lr ; select bytes with positive difference - usub8 r6, r5, r4 ; calculate difference with reversed operands - add r2, r2, r3 ; set dst_ptr to next row - sel r6, r6, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r4, r7, lr ; calculate sum of positive differences - usad8 r5, r6, lr ; calculate sum of negative differences - orr r6, r6, r7 ; differences of all 4 pixels - - ; calculate total sum - add r8, r8, r4 ; add positive differences to sum - sub r8, r8, r5 ; subtract negative differences from sum - - ; calculate sse - uxtb16 r5, r6 ; byte (two pixels) to halfwords - uxtb16 r7, r6, ror #8 ; another two pixels to halfwords - smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) - subs r12, r12, #1 - smlad r11, r7, r7, r11 ; dual signed multiply, add and accumulate (2) - - bne loop - - ; return stuff - ldr r6, [sp, #40] ; get address of sse - mul r0, r8, r8 ; sum * sum - str r11, [r6] ; store sse - sub r0, r11, r0, lsr #8 ; return (sse - ((sum * sum) >> 8)) - - ldmfd sp!, {r4-r12, pc} - - ENDP - -c80808080 - DCD 0x80808080 - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,184 +0,0 @@ -; -; Copyright (c) 2011 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - EXPORT |vp8_variance_halfpixvar16x16_v_armv6| - - ARM - REQUIRE8 - PRESERVE8 - - AREA ||.text||, CODE, READONLY, ALIGN=2 - -; r0 unsigned char *src_ptr -; r1 int source_stride -; r2 unsigned char *ref_ptr -; r3 int recon_stride -; stack unsigned int *sse -|vp8_variance_halfpixvar16x16_v_armv6| PROC - - stmfd sp!, {r4-r12, lr} - - pld [r0, r1, lsl #0] - pld [r2, r3, lsl #0] - - mov r8, #0 ; initialize sum = 0 - ldr r10, c80808080 - mov r11, #0 ; initialize sse = 0 - mov r12, #16 ; set loop counter to 16 (=block height) - mov lr, #0 ; constant zero -loop - add r9, r0, r1 ; set src pointer to next row - ; 1st 4 pixels - ldr r4, [r0, #0] ; load 4 src pixels - ldr r6, [r9, #0] ; load 4 src pixels from next row - ldr r5, [r2, #0] ; load 4 ref pixels - - ; bilinear interpolation - mvn r6, r6 - uhsub8 r4, r4, r6 - eor r4, r4, r10 - - usub8 r6, r4, r5 ; calculate difference - pld [r0, r1, lsl #1] - sel r7, r6, lr ; select bytes with positive difference - usub8 r6, r5, r4 ; calculate difference with reversed operands - pld [r2, r3, lsl #1] - sel r6, r6, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r4, r7, lr ; calculate sum of positive differences - usad8 r5, r6, lr ; calculate sum of negative differences - orr r6, r6, r7 ; differences of all 4 pixels - ; calculate total sum - adds r8, r8, r4 ; add positive differences to sum - subs r8, r8, r5 ; subtract negative differences from sum - - ; calculate sse - uxtb16 r5, r6 ; byte (two pixels) to halfwords - uxtb16 r7, r6, ror #8 ; another two pixels to halfwords - smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) - - ; 2nd 4 pixels - ldr r4, [r0, #4] ; load 4 src pixels - ldr r6, [r9, #4] ; load 4 src pixels from next row - ldr r5, [r2, #4] ; load 4 ref pixels - - ; bilinear interpolation - mvn r6, r6 - uhsub8 r4, r4, r6 - eor r4, r4, r10 - - smlad r11, r7, r7, r11 ; dual signed multiply, add and accumulate (2) - - usub8 r6, r4, r5 ; calculate difference - sel r7, r6, lr ; select bytes with positive difference - usub8 r6, r5, r4 ; calculate difference with reversed operands - sel r6, r6, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r4, r7, lr ; calculate sum of positive differences - usad8 r5, r6, lr ; calculate sum of negative differences - orr r6, r6, r7 ; differences of all 4 pixels - - ; calculate total sum - add r8, r8, r4 ; add positive differences to sum - sub r8, r8, r5 ; subtract negative differences from sum - - ; calculate sse - uxtb16 r5, r6 ; byte (two pixels) to halfwords - uxtb16 r7, r6, ror #8 ; another two pixels to halfwords - smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) - - ; 3rd 4 pixels - ldr r4, [r0, #8] ; load 4 src pixels - ldr r6, [r9, #8] ; load 4 src pixels from next row - ldr r5, [r2, #8] ; load 4 ref pixels - - ; bilinear interpolation - mvn r6, r6 - uhsub8 r4, r4, r6 - eor r4, r4, r10 - - smlad r11, r7, r7, r11 ; dual signed multiply, add and accumulate (2) - - usub8 r6, r4, r5 ; calculate difference - sel r7, r6, lr ; select bytes with positive difference - usub8 r6, r5, r4 ; calculate difference with reversed operands - sel r6, r6, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r4, r7, lr ; calculate sum of positive differences - usad8 r5, r6, lr ; calculate sum of negative differences - orr r6, r6, r7 ; differences of all 4 pixels - - ; calculate total sum - add r8, r8, r4 ; add positive differences to sum - sub r8, r8, r5 ; subtract negative differences from sum - - ; calculate sse - uxtb16 r5, r6 ; byte (two pixels) to halfwords - uxtb16 r7, r6, ror #8 ; another two pixels to halfwords - smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) - - ; 4th 4 pixels - ldr r4, [r0, #12] ; load 4 src pixels - ldr r6, [r9, #12] ; load 4 src pixels from next row - ldr r5, [r2, #12] ; load 4 ref pixels - - ; bilinear interpolation - mvn r6, r6 - uhsub8 r4, r4, r6 - eor r4, r4, r10 - - smlad r11, r7, r7, r11 ; dual signed multiply, add and accumulate (2) - - usub8 r6, r4, r5 ; calculate difference - add r0, r0, r1 ; set src_ptr to next row - sel r7, r6, lr ; select bytes with positive difference - usub8 r6, r5, r4 ; calculate difference with reversed operands - add r2, r2, r3 ; set dst_ptr to next row - sel r6, r6, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r4, r7, lr ; calculate sum of positive differences - usad8 r5, r6, lr ; calculate sum of negative differences - orr r6, r6, r7 ; differences of all 4 pixels - - ; calculate total sum - add r8, r8, r4 ; add positive differences to sum - sub r8, r8, r5 ; subtract negative differences from sum - - ; calculate sse - uxtb16 r5, r6 ; byte (two pixels) to halfwords - uxtb16 r7, r6, ror #8 ; another two pixels to halfwords - smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) - smlad r11, r7, r7, r11 ; dual signed multiply, add and accumulate (2) - - - subs r12, r12, #1 - - bne loop - - ; return stuff - ldr r6, [sp, #40] ; get address of sse - mul r0, r8, r8 ; sum * sum - str r11, [r6] ; store sse - sub r0, r11, r0, lsr #8 ; return (sse - ((sum * sum) >> 8)) - - ldmfd sp!, {r4-r12, pc} - - ENDP - -c80808080 - DCD 0x80808080 - - END - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/bilinearfilter_arm.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/bilinearfilter_arm.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/bilinearfilter_arm.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/bilinearfilter_arm.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include -#include "vp8/common/filter.h" -#include "bilinearfilter_arm.h" - -void vp8_filter_block2d_bil_armv6 -( - unsigned char *src_ptr, - unsigned char *dst_ptr, - unsigned int src_pitch, - unsigned int dst_pitch, - const short *HFilter, - const short *VFilter, - int Width, - int Height -) -{ - unsigned short FData[36*16]; /* Temp data buffer used in filtering */ - - /* First filter 1-D horizontally... */ - vp8_filter_block2d_bil_first_pass_armv6(src_ptr, FData, src_pitch, Height + 1, Width, HFilter); - - /* then 1-D vertically... */ - vp8_filter_block2d_bil_second_pass_armv6(FData, dst_ptr, dst_pitch, Height, Width, VFilter); -} - - -void vp8_bilinear_predict4x4_armv6 -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - vp8_filter_block2d_bil_armv6(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 4, 4); -} - -void vp8_bilinear_predict8x8_armv6 -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - vp8_filter_block2d_bil_armv6(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 8, 8); -} - -void vp8_bilinear_predict8x4_armv6 -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - vp8_filter_block2d_bil_armv6(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 8, 4); -} - -void vp8_bilinear_predict16x16_armv6 -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - vp8_filter_block2d_bil_armv6(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 16, 16); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/bilinearfilter_arm.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/bilinearfilter_arm.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/bilinearfilter_arm.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/bilinearfilter_arm.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2011 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_ARM_BILINEARFILTER_ARM_H_ -#define VP8_COMMON_ARM_BILINEARFILTER_ARM_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -extern void vp8_filter_block2d_bil_first_pass_armv6 -( - const unsigned char *src_ptr, - unsigned short *dst_ptr, - unsigned int src_pitch, - unsigned int height, - unsigned int width, - const short *vp8_filter -); - -extern void vp8_filter_block2d_bil_second_pass_armv6 -( - const unsigned short *src_ptr, - unsigned char *dst_ptr, - int dst_pitch, - unsigned int height, - unsigned int width, - const short *vp8_filter -); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_ARM_BILINEARFILTER_ARM_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/dequantize_arm.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/dequantize_arm.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/dequantize_arm.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/dequantize_arm.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "vp8/common/blockd.h" - -#if HAVE_MEDIA -extern void vp8_dequantize_b_loop_v6(short *Q, short *DQC, short *DQ); - -void vp8_dequantize_b_v6(BLOCKD *d, short *DQC) -{ - short *DQ = d->dqcoeff; - short *Q = d->qcoeff; - - vp8_dequantize_b_loop_v6(Q, DQC, DQ); -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/filter_arm.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/filter_arm.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/filter_arm.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/filter_arm.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,221 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include -#include "vp8/common/filter.h" -#include "vpx_ports/mem.h" - -extern void vp8_filter_block2d_first_pass_armv6 -( - unsigned char *src_ptr, - short *output_ptr, - unsigned int src_pixels_per_line, - unsigned int output_width, - unsigned int output_height, - const short *vp8_filter -); - -// 8x8 -extern void vp8_filter_block2d_first_pass_8x8_armv6 -( - unsigned char *src_ptr, - short *output_ptr, - unsigned int src_pixels_per_line, - unsigned int output_width, - unsigned int output_height, - const short *vp8_filter -); - -// 16x16 -extern void vp8_filter_block2d_first_pass_16x16_armv6 -( - unsigned char *src_ptr, - short *output_ptr, - unsigned int src_pixels_per_line, - unsigned int output_width, - unsigned int output_height, - const short *vp8_filter -); - -extern void vp8_filter_block2d_second_pass_armv6 -( - short *src_ptr, - unsigned char *output_ptr, - unsigned int output_pitch, - unsigned int cnt, - const short *vp8_filter -); - -extern void vp8_filter4_block2d_second_pass_armv6 -( - short *src_ptr, - unsigned char *output_ptr, - unsigned int output_pitch, - unsigned int cnt, - const short *vp8_filter -); - -extern void vp8_filter_block2d_first_pass_only_armv6 -( - unsigned char *src_ptr, - unsigned char *output_ptr, - unsigned int src_pixels_per_line, - unsigned int cnt, - unsigned int output_pitch, - const short *vp8_filter -); - - -extern void vp8_filter_block2d_second_pass_only_armv6 -( - unsigned char *src_ptr, - unsigned char *output_ptr, - unsigned int src_pixels_per_line, - unsigned int cnt, - unsigned int output_pitch, - const short *vp8_filter -); - -#if HAVE_MEDIA -void vp8_sixtap_predict4x4_armv6 -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - DECLARE_ALIGNED_ARRAY(4, short, FData, 12*4); /* Temp data buffer used in filtering */ - - - HFilter = vp8_sub_pel_filters[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters[yoffset]; /* 6 tap */ - - /* Vfilter is null. First pass only */ - if (xoffset && !yoffset) - { - /*vp8_filter_block2d_first_pass_armv6 ( src_ptr, FData+2, src_pixels_per_line, 4, 4, HFilter ); - vp8_filter_block2d_second_pass_armv6 ( FData+2, dst_ptr, dst_pitch, 4, VFilter );*/ - - vp8_filter_block2d_first_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 4, dst_pitch, HFilter); - } - /* Hfilter is null. Second pass only */ - else if (!xoffset && yoffset) - { - vp8_filter_block2d_second_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 4, dst_pitch, VFilter); - } - else - { - /* Vfilter is a 4 tap filter */ - if (yoffset & 0x1) - { - vp8_filter_block2d_first_pass_armv6(src_ptr - src_pixels_per_line, FData + 1, src_pixels_per_line, 4, 7, HFilter); - vp8_filter4_block2d_second_pass_armv6(FData + 2, dst_ptr, dst_pitch, 4, VFilter); - } - /* Vfilter is 6 tap filter */ - else - { - vp8_filter_block2d_first_pass_armv6(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 4, 9, HFilter); - vp8_filter_block2d_second_pass_armv6(FData + 2, dst_ptr, dst_pitch, 4, VFilter); - } - } -} - -void vp8_sixtap_predict8x8_armv6 -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - DECLARE_ALIGNED_ARRAY(4, short, FData, 16*8); /* Temp data buffer used in filtering */ - - HFilter = vp8_sub_pel_filters[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters[yoffset]; /* 6 tap */ - - if (xoffset && !yoffset) - { - vp8_filter_block2d_first_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 8, dst_pitch, HFilter); - } - /* Hfilter is null. Second pass only */ - else if (!xoffset && yoffset) - { - vp8_filter_block2d_second_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 8, dst_pitch, VFilter); - } - else - { - if (yoffset & 0x1) - { - vp8_filter_block2d_first_pass_8x8_armv6(src_ptr - src_pixels_per_line, FData + 1, src_pixels_per_line, 8, 11, HFilter); - vp8_filter4_block2d_second_pass_armv6(FData + 2, dst_ptr, dst_pitch, 8, VFilter); - } - else - { - vp8_filter_block2d_first_pass_8x8_armv6(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 8, 13, HFilter); - vp8_filter_block2d_second_pass_armv6(FData + 2, dst_ptr, dst_pitch, 8, VFilter); - } - } -} - - -void vp8_sixtap_predict16x16_armv6 -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - DECLARE_ALIGNED_ARRAY(4, short, FData, 24*16); /* Temp data buffer used in filtering */ - - HFilter = vp8_sub_pel_filters[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters[yoffset]; /* 6 tap */ - - if (xoffset && !yoffset) - { - vp8_filter_block2d_first_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 16, dst_pitch, HFilter); - } - /* Hfilter is null. Second pass only */ - else if (!xoffset && yoffset) - { - vp8_filter_block2d_second_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 16, dst_pitch, VFilter); - } - else - { - if (yoffset & 0x1) - { - vp8_filter_block2d_first_pass_16x16_armv6(src_ptr - src_pixels_per_line, FData + 1, src_pixels_per_line, 16, 19, HFilter); - vp8_filter4_block2d_second_pass_armv6(FData + 2, dst_ptr, dst_pitch, 16, VFilter); - } - else - { - vp8_filter_block2d_first_pass_16x16_armv6(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 16, 21, HFilter); - vp8_filter_block2d_second_pass_armv6(FData + 2, dst_ptr, dst_pitch, 16, VFilter); - } - } - -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/loopfilter_arm.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/loopfilter_arm.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/loopfilter_arm.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/loopfilter_arm.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,181 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "vp8/common/loopfilter.h" -#include "vp8/common/onyxc_int.h" - -#define prototype_loopfilter(sym) \ - void sym(unsigned char *src, int pitch, const unsigned char *blimit,\ - const unsigned char *limit, const unsigned char *thresh, int count) - -#if HAVE_MEDIA -extern prototype_loopfilter(vp8_loop_filter_horizontal_edge_armv6); -extern prototype_loopfilter(vp8_loop_filter_vertical_edge_armv6); -extern prototype_loopfilter(vp8_mbloop_filter_horizontal_edge_armv6); -extern prototype_loopfilter(vp8_mbloop_filter_vertical_edge_armv6); -#endif - -#if HAVE_NEON -typedef void loopfilter_y_neon(unsigned char *src, int pitch, - unsigned char blimit, unsigned char limit, unsigned char thresh); -typedef void loopfilter_uv_neon(unsigned char *u, int pitch, - unsigned char blimit, unsigned char limit, unsigned char thresh, - unsigned char *v); - -extern loopfilter_y_neon vp8_loop_filter_horizontal_edge_y_neon; -extern loopfilter_y_neon vp8_loop_filter_vertical_edge_y_neon; -extern loopfilter_uv_neon vp8_loop_filter_horizontal_edge_uv_neon; -extern loopfilter_uv_neon vp8_loop_filter_vertical_edge_uv_neon; - -extern loopfilter_y_neon vp8_mbloop_filter_horizontal_edge_y_neon; -extern loopfilter_y_neon vp8_mbloop_filter_vertical_edge_y_neon; -extern loopfilter_uv_neon vp8_mbloop_filter_horizontal_edge_uv_neon; -extern loopfilter_uv_neon vp8_mbloop_filter_vertical_edge_uv_neon; -#endif - -#if HAVE_MEDIA -/* ARMV6/MEDIA loopfilter functions*/ -/* Horizontal MB filtering */ -void vp8_loop_filter_mbh_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_mbloop_filter_horizontal_edge_armv6(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); - - if (u_ptr) - vp8_mbloop_filter_horizontal_edge_armv6(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); - - if (v_ptr) - vp8_mbloop_filter_horizontal_edge_armv6(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); -} - -/* Vertical MB Filtering */ -void vp8_loop_filter_mbv_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_mbloop_filter_vertical_edge_armv6(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); - - if (u_ptr) - vp8_mbloop_filter_vertical_edge_armv6(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); - - if (v_ptr) - vp8_mbloop_filter_vertical_edge_armv6(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); -} - -/* Horizontal B Filtering */ -void vp8_loop_filter_bh_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_loop_filter_horizontal_edge_armv6(y_ptr + 4 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_horizontal_edge_armv6(y_ptr + 8 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_horizontal_edge_armv6(y_ptr + 12 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - - if (u_ptr) - vp8_loop_filter_horizontal_edge_armv6(u_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); - - if (v_ptr) - vp8_loop_filter_horizontal_edge_armv6(v_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); -} - -void vp8_loop_filter_bhs_armv6(unsigned char *y_ptr, int y_stride, - const unsigned char *blimit) -{ - vp8_loop_filter_simple_horizontal_edge_armv6(y_ptr + 4 * y_stride, y_stride, blimit); - vp8_loop_filter_simple_horizontal_edge_armv6(y_ptr + 8 * y_stride, y_stride, blimit); - vp8_loop_filter_simple_horizontal_edge_armv6(y_ptr + 12 * y_stride, y_stride, blimit); -} - -/* Vertical B Filtering */ -void vp8_loop_filter_bv_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_loop_filter_vertical_edge_armv6(y_ptr + 4, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_vertical_edge_armv6(y_ptr + 8, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_vertical_edge_armv6(y_ptr + 12, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - - if (u_ptr) - vp8_loop_filter_vertical_edge_armv6(u_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); - - if (v_ptr) - vp8_loop_filter_vertical_edge_armv6(v_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); -} - -void vp8_loop_filter_bvs_armv6(unsigned char *y_ptr, int y_stride, - const unsigned char *blimit) -{ - vp8_loop_filter_simple_vertical_edge_armv6(y_ptr + 4, y_stride, blimit); - vp8_loop_filter_simple_vertical_edge_armv6(y_ptr + 8, y_stride, blimit); - vp8_loop_filter_simple_vertical_edge_armv6(y_ptr + 12, y_stride, blimit); -} -#endif - -#if HAVE_NEON -/* NEON loopfilter functions */ -/* Horizontal MB filtering */ -void vp8_loop_filter_mbh_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - unsigned char mblim = *lfi->mblim; - unsigned char lim = *lfi->lim; - unsigned char hev_thr = *lfi->hev_thr; - vp8_mbloop_filter_horizontal_edge_y_neon(y_ptr, y_stride, mblim, lim, hev_thr); - - if (u_ptr) - vp8_mbloop_filter_horizontal_edge_uv_neon(u_ptr, uv_stride, mblim, lim, hev_thr, v_ptr); -} - -/* Vertical MB Filtering */ -void vp8_loop_filter_mbv_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - unsigned char mblim = *lfi->mblim; - unsigned char lim = *lfi->lim; - unsigned char hev_thr = *lfi->hev_thr; - - vp8_mbloop_filter_vertical_edge_y_neon(y_ptr, y_stride, mblim, lim, hev_thr); - - if (u_ptr) - vp8_mbloop_filter_vertical_edge_uv_neon(u_ptr, uv_stride, mblim, lim, hev_thr, v_ptr); -} - -/* Horizontal B Filtering */ -void vp8_loop_filter_bh_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - unsigned char blim = *lfi->blim; - unsigned char lim = *lfi->lim; - unsigned char hev_thr = *lfi->hev_thr; - - vp8_loop_filter_horizontal_edge_y_neon(y_ptr + 4 * y_stride, y_stride, blim, lim, hev_thr); - vp8_loop_filter_horizontal_edge_y_neon(y_ptr + 8 * y_stride, y_stride, blim, lim, hev_thr); - vp8_loop_filter_horizontal_edge_y_neon(y_ptr + 12 * y_stride, y_stride, blim, lim, hev_thr); - - if (u_ptr) - vp8_loop_filter_horizontal_edge_uv_neon(u_ptr + 4 * uv_stride, uv_stride, blim, lim, hev_thr, v_ptr + 4 * uv_stride); -} - -/* Vertical B Filtering */ -void vp8_loop_filter_bv_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - unsigned char blim = *lfi->blim; - unsigned char lim = *lfi->lim; - unsigned char hev_thr = *lfi->hev_thr; - - vp8_loop_filter_vertical_edge_y_neon(y_ptr + 4, y_stride, blim, lim, hev_thr); - vp8_loop_filter_vertical_edge_y_neon(y_ptr + 8, y_stride, blim, lim, hev_thr); - vp8_loop_filter_vertical_edge_y_neon(y_ptr + 12, y_stride, blim, lim, hev_thr); - - if (u_ptr) - vp8_loop_filter_vertical_edge_uv_neon(u_ptr + 4, uv_stride, blim, lim, hev_thr, v_ptr + 4); -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/bilinearpredict_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/bilinearpredict_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/bilinearpredict_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/bilinearpredict_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,699 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -static const uint8_t bifilter4_coeff[8][2] = { - {128, 0}, - {112, 16}, - { 96, 32}, - { 80, 48}, - { 64, 64}, - { 48, 80}, - { 32, 96}, - { 16, 112} -}; - -void vp8_bilinear_predict4x4_neon( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch) { - uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8, d6u8; - uint8x8_t d26u8, d27u8, d28u8, d29u8, d30u8; - uint8x16_t q1u8, q2u8; - uint16x8_t q1u16, q2u16; - uint16x8_t q7u16, q8u16, q9u16; - uint64x2_t q4u64, q5u64; - uint64x1_t d12u64; - uint32x2x2_t d0u32x2, d1u32x2, d2u32x2, d3u32x2; - - if (xoffset == 0) { // skip_1stpass_filter - uint32x2_t d28u32 = vdup_n_u32(0); - uint32x2_t d29u32 = vdup_n_u32(0); - uint32x2_t d30u32 = vdup_n_u32(0); - - d28u32 = vld1_lane_u32((const uint32_t *)src_ptr, d28u32, 0); - src_ptr += src_pixels_per_line; - d28u32 = vld1_lane_u32((const uint32_t *)src_ptr, d28u32, 1); - src_ptr += src_pixels_per_line; - d29u32 = vld1_lane_u32((const uint32_t *)src_ptr, d29u32, 0); - src_ptr += src_pixels_per_line; - d29u32 = vld1_lane_u32((const uint32_t *)src_ptr, d29u32, 1); - src_ptr += src_pixels_per_line; - d30u32 = vld1_lane_u32((const uint32_t *)src_ptr, d30u32, 0); - d28u8 = vreinterpret_u8_u32(d28u32); - d29u8 = vreinterpret_u8_u32(d29u32); - d30u8 = vreinterpret_u8_u32(d30u32); - } else { - d2u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line; - d3u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line; - d4u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line; - d5u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line; - d6u8 = vld1_u8(src_ptr); - - q1u8 = vcombine_u8(d2u8, d3u8); - q2u8 = vcombine_u8(d4u8, d5u8); - - d0u8 = vdup_n_u8(bifilter4_coeff[xoffset][0]); - d1u8 = vdup_n_u8(bifilter4_coeff[xoffset][1]); - - q4u64 = vshrq_n_u64(vreinterpretq_u64_u8(q1u8), 8); - q5u64 = vshrq_n_u64(vreinterpretq_u64_u8(q2u8), 8); - d12u64 = vshr_n_u64(vreinterpret_u64_u8(d6u8), 8); - - d0u32x2 = vzip_u32(vreinterpret_u32_u8(vget_low_u8(q1u8)), - vreinterpret_u32_u8(vget_high_u8(q1u8))); - d1u32x2 = vzip_u32(vreinterpret_u32_u8(vget_low_u8(q2u8)), - vreinterpret_u32_u8(vget_high_u8(q2u8))); - d2u32x2 = vzip_u32(vreinterpret_u32_u64(vget_low_u64(q4u64)), - vreinterpret_u32_u64(vget_high_u64(q4u64))); - d3u32x2 = vzip_u32(vreinterpret_u32_u64(vget_low_u64(q5u64)), - vreinterpret_u32_u64(vget_high_u64(q5u64))); - - q7u16 = vmull_u8(vreinterpret_u8_u32(d0u32x2.val[0]), d0u8); - q8u16 = vmull_u8(vreinterpret_u8_u32(d1u32x2.val[0]), d0u8); - q9u16 = vmull_u8(d6u8, d0u8); - - q7u16 = vmlal_u8(q7u16, vreinterpret_u8_u32(d2u32x2.val[0]), d1u8); - q8u16 = vmlal_u8(q8u16, vreinterpret_u8_u32(d3u32x2.val[0]), d1u8); - q9u16 = vmlal_u8(q9u16, vreinterpret_u8_u64(d12u64), d1u8); - - d28u8 = vqrshrn_n_u16(q7u16, 7); - d29u8 = vqrshrn_n_u16(q8u16, 7); - d30u8 = vqrshrn_n_u16(q9u16, 7); - } - - // secondpass_filter - if (yoffset == 0) { // skip_2ndpass_filter - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d28u8), 0); - dst_ptr += dst_pitch; - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d28u8), 1); - dst_ptr += dst_pitch; - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d29u8), 0); - dst_ptr += dst_pitch; - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d29u8), 1); - } else { - d0u8 = vdup_n_u8(bifilter4_coeff[yoffset][0]); - d1u8 = vdup_n_u8(bifilter4_coeff[yoffset][1]); - - q1u16 = vmull_u8(d28u8, d0u8); - q2u16 = vmull_u8(d29u8, d0u8); - - d26u8 = vext_u8(d28u8, d29u8, 4); - d27u8 = vext_u8(d29u8, d30u8, 4); - - q1u16 = vmlal_u8(q1u16, d26u8, d1u8); - q2u16 = vmlal_u8(q2u16, d27u8, d1u8); - - d2u8 = vqrshrn_n_u16(q1u16, 7); - d3u8 = vqrshrn_n_u16(q2u16, 7); - - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d2u8), 0); - dst_ptr += dst_pitch; - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d2u8), 1); - dst_ptr += dst_pitch; - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d3u8), 0); - dst_ptr += dst_pitch; - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d3u8), 1); - } - return; -} - -void vp8_bilinear_predict8x4_neon( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch) { - uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8; - uint8x8_t d7u8, d9u8, d11u8, d22u8, d23u8, d24u8, d25u8, d26u8; - uint8x16_t q1u8, q2u8, q3u8, q4u8, q5u8; - uint16x8_t q1u16, q2u16, q3u16, q4u16; - uint16x8_t q6u16, q7u16, q8u16, q9u16, q10u16; - - if (xoffset == 0) { // skip_1stpass_filter - d22u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line; - d23u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line; - d24u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line; - d25u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line; - d26u8 = vld1_u8(src_ptr); - } else { - q1u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line; - q2u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line; - q3u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line; - q4u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line; - q5u8 = vld1q_u8(src_ptr); - - d0u8 = vdup_n_u8(bifilter4_coeff[xoffset][0]); - d1u8 = vdup_n_u8(bifilter4_coeff[xoffset][1]); - - q6u16 = vmull_u8(vget_low_u8(q1u8), d0u8); - q7u16 = vmull_u8(vget_low_u8(q2u8), d0u8); - q8u16 = vmull_u8(vget_low_u8(q3u8), d0u8); - q9u16 = vmull_u8(vget_low_u8(q4u8), d0u8); - q10u16 = vmull_u8(vget_low_u8(q5u8), d0u8); - - d3u8 = vext_u8(vget_low_u8(q1u8), vget_high_u8(q1u8), 1); - d5u8 = vext_u8(vget_low_u8(q2u8), vget_high_u8(q2u8), 1); - d7u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 1); - d9u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 1); - d11u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 1); - - q6u16 = vmlal_u8(q6u16, d3u8, d1u8); - q7u16 = vmlal_u8(q7u16, d5u8, d1u8); - q8u16 = vmlal_u8(q8u16, d7u8, d1u8); - q9u16 = vmlal_u8(q9u16, d9u8, d1u8); - q10u16 = vmlal_u8(q10u16, d11u8, d1u8); - - d22u8 = vqrshrn_n_u16(q6u16, 7); - d23u8 = vqrshrn_n_u16(q7u16, 7); - d24u8 = vqrshrn_n_u16(q8u16, 7); - d25u8 = vqrshrn_n_u16(q9u16, 7); - d26u8 = vqrshrn_n_u16(q10u16, 7); - } - - // secondpass_filter - if (yoffset == 0) { // skip_2ndpass_filter - vst1_u8((uint8_t *)dst_ptr, d22u8); dst_ptr += dst_pitch; - vst1_u8((uint8_t *)dst_ptr, d23u8); dst_ptr += dst_pitch; - vst1_u8((uint8_t *)dst_ptr, d24u8); dst_ptr += dst_pitch; - vst1_u8((uint8_t *)dst_ptr, d25u8); - } else { - d0u8 = vdup_n_u8(bifilter4_coeff[yoffset][0]); - d1u8 = vdup_n_u8(bifilter4_coeff[yoffset][1]); - - q1u16 = vmull_u8(d22u8, d0u8); - q2u16 = vmull_u8(d23u8, d0u8); - q3u16 = vmull_u8(d24u8, d0u8); - q4u16 = vmull_u8(d25u8, d0u8); - - q1u16 = vmlal_u8(q1u16, d23u8, d1u8); - q2u16 = vmlal_u8(q2u16, d24u8, d1u8); - q3u16 = vmlal_u8(q3u16, d25u8, d1u8); - q4u16 = vmlal_u8(q4u16, d26u8, d1u8); - - d2u8 = vqrshrn_n_u16(q1u16, 7); - d3u8 = vqrshrn_n_u16(q2u16, 7); - d4u8 = vqrshrn_n_u16(q3u16, 7); - d5u8 = vqrshrn_n_u16(q4u16, 7); - - vst1_u8((uint8_t *)dst_ptr, d2u8); dst_ptr += dst_pitch; - vst1_u8((uint8_t *)dst_ptr, d3u8); dst_ptr += dst_pitch; - vst1_u8((uint8_t *)dst_ptr, d4u8); dst_ptr += dst_pitch; - vst1_u8((uint8_t *)dst_ptr, d5u8); - } - return; -} - -void vp8_bilinear_predict8x8_neon( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch) { - uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8, d6u8, d7u8, d8u8, d9u8, d11u8; - uint8x8_t d22u8, d23u8, d24u8, d25u8, d26u8, d27u8, d28u8, d29u8, d30u8; - uint8x16_t q1u8, q2u8, q3u8, q4u8, q5u8; - uint16x8_t q1u16, q2u16, q3u16, q4u16, q5u16; - uint16x8_t q6u16, q7u16, q8u16, q9u16, q10u16; - - if (xoffset == 0) { // skip_1stpass_filter - d22u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line; - d23u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line; - d24u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line; - d25u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line; - d26u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line; - d27u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line; - d28u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line; - d29u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line; - d30u8 = vld1_u8(src_ptr); - } else { - q1u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line; - q2u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line; - q3u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line; - q4u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line; - - d0u8 = vdup_n_u8(bifilter4_coeff[xoffset][0]); - d1u8 = vdup_n_u8(bifilter4_coeff[xoffset][1]); - - q6u16 = vmull_u8(vget_low_u8(q1u8), d0u8); - q7u16 = vmull_u8(vget_low_u8(q2u8), d0u8); - q8u16 = vmull_u8(vget_low_u8(q3u8), d0u8); - q9u16 = vmull_u8(vget_low_u8(q4u8), d0u8); - - d3u8 = vext_u8(vget_low_u8(q1u8), vget_high_u8(q1u8), 1); - d5u8 = vext_u8(vget_low_u8(q2u8), vget_high_u8(q2u8), 1); - d7u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 1); - d9u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 1); - - q6u16 = vmlal_u8(q6u16, d3u8, d1u8); - q7u16 = vmlal_u8(q7u16, d5u8, d1u8); - q8u16 = vmlal_u8(q8u16, d7u8, d1u8); - q9u16 = vmlal_u8(q9u16, d9u8, d1u8); - - d22u8 = vqrshrn_n_u16(q6u16, 7); - d23u8 = vqrshrn_n_u16(q7u16, 7); - d24u8 = vqrshrn_n_u16(q8u16, 7); - d25u8 = vqrshrn_n_u16(q9u16, 7); - - // first_pass filtering on the rest 5-line data - q1u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line; - q2u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line; - q3u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line; - q4u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line; - q5u8 = vld1q_u8(src_ptr); - - q6u16 = vmull_u8(vget_low_u8(q1u8), d0u8); - q7u16 = vmull_u8(vget_low_u8(q2u8), d0u8); - q8u16 = vmull_u8(vget_low_u8(q3u8), d0u8); - q9u16 = vmull_u8(vget_low_u8(q4u8), d0u8); - q10u16 = vmull_u8(vget_low_u8(q5u8), d0u8); - - d3u8 = vext_u8(vget_low_u8(q1u8), vget_high_u8(q1u8), 1); - d5u8 = vext_u8(vget_low_u8(q2u8), vget_high_u8(q2u8), 1); - d7u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 1); - d9u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 1); - d11u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 1); - - q6u16 = vmlal_u8(q6u16, d3u8, d1u8); - q7u16 = vmlal_u8(q7u16, d5u8, d1u8); - q8u16 = vmlal_u8(q8u16, d7u8, d1u8); - q9u16 = vmlal_u8(q9u16, d9u8, d1u8); - q10u16 = vmlal_u8(q10u16, d11u8, d1u8); - - d26u8 = vqrshrn_n_u16(q6u16, 7); - d27u8 = vqrshrn_n_u16(q7u16, 7); - d28u8 = vqrshrn_n_u16(q8u16, 7); - d29u8 = vqrshrn_n_u16(q9u16, 7); - d30u8 = vqrshrn_n_u16(q10u16, 7); - } - - // secondpass_filter - if (yoffset == 0) { // skip_2ndpass_filter - vst1_u8((uint8_t *)dst_ptr, d22u8); dst_ptr += dst_pitch; - vst1_u8((uint8_t *)dst_ptr, d23u8); dst_ptr += dst_pitch; - vst1_u8((uint8_t *)dst_ptr, d24u8); dst_ptr += dst_pitch; - vst1_u8((uint8_t *)dst_ptr, d25u8); dst_ptr += dst_pitch; - vst1_u8((uint8_t *)dst_ptr, d26u8); dst_ptr += dst_pitch; - vst1_u8((uint8_t *)dst_ptr, d27u8); dst_ptr += dst_pitch; - vst1_u8((uint8_t *)dst_ptr, d28u8); dst_ptr += dst_pitch; - vst1_u8((uint8_t *)dst_ptr, d29u8); - } else { - d0u8 = vdup_n_u8(bifilter4_coeff[yoffset][0]); - d1u8 = vdup_n_u8(bifilter4_coeff[yoffset][1]); - - q1u16 = vmull_u8(d22u8, d0u8); - q2u16 = vmull_u8(d23u8, d0u8); - q3u16 = vmull_u8(d24u8, d0u8); - q4u16 = vmull_u8(d25u8, d0u8); - q5u16 = vmull_u8(d26u8, d0u8); - q6u16 = vmull_u8(d27u8, d0u8); - q7u16 = vmull_u8(d28u8, d0u8); - q8u16 = vmull_u8(d29u8, d0u8); - - q1u16 = vmlal_u8(q1u16, d23u8, d1u8); - q2u16 = vmlal_u8(q2u16, d24u8, d1u8); - q3u16 = vmlal_u8(q3u16, d25u8, d1u8); - q4u16 = vmlal_u8(q4u16, d26u8, d1u8); - q5u16 = vmlal_u8(q5u16, d27u8, d1u8); - q6u16 = vmlal_u8(q6u16, d28u8, d1u8); - q7u16 = vmlal_u8(q7u16, d29u8, d1u8); - q8u16 = vmlal_u8(q8u16, d30u8, d1u8); - - d2u8 = vqrshrn_n_u16(q1u16, 7); - d3u8 = vqrshrn_n_u16(q2u16, 7); - d4u8 = vqrshrn_n_u16(q3u16, 7); - d5u8 = vqrshrn_n_u16(q4u16, 7); - d6u8 = vqrshrn_n_u16(q5u16, 7); - d7u8 = vqrshrn_n_u16(q6u16, 7); - d8u8 = vqrshrn_n_u16(q7u16, 7); - d9u8 = vqrshrn_n_u16(q8u16, 7); - - vst1_u8((uint8_t *)dst_ptr, d2u8); dst_ptr += dst_pitch; - vst1_u8((uint8_t *)dst_ptr, d3u8); dst_ptr += dst_pitch; - vst1_u8((uint8_t *)dst_ptr, d4u8); dst_ptr += dst_pitch; - vst1_u8((uint8_t *)dst_ptr, d5u8); dst_ptr += dst_pitch; - vst1_u8((uint8_t *)dst_ptr, d6u8); dst_ptr += dst_pitch; - vst1_u8((uint8_t *)dst_ptr, d7u8); dst_ptr += dst_pitch; - vst1_u8((uint8_t *)dst_ptr, d8u8); dst_ptr += dst_pitch; - vst1_u8((uint8_t *)dst_ptr, d9u8); - } - return; -} - -void vp8_bilinear_predict16x16_neon( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch) { - int i; - unsigned char tmp[272]; - unsigned char *tmpp; - uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8, d6u8, d7u8, d8u8, d9u8; - uint8x8_t d10u8, d11u8, d12u8, d13u8, d14u8, d15u8, d16u8, d17u8, d18u8; - uint8x8_t d19u8, d20u8, d21u8; - uint8x16_t q1u8, q2u8, q3u8, q4u8, q5u8, q6u8, q7u8, q8u8, q9u8, q10u8; - uint8x16_t q11u8, q12u8, q13u8, q14u8, q15u8; - uint16x8_t q1u16, q2u16, q3u16, q4u16, q5u16, q6u16, q7u16, q8u16; - uint16x8_t q9u16, q10u16, q11u16, q12u16, q13u16, q14u16; - - if (xoffset == 0) { // secondpass_bfilter16x16_only - d0u8 = vdup_n_u8(bifilter4_coeff[yoffset][0]); - d1u8 = vdup_n_u8(bifilter4_coeff[yoffset][1]); - - q11u8 = vld1q_u8(src_ptr); - src_ptr += src_pixels_per_line; - for (i = 4; i > 0; i--) { - q12u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line; - q13u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line; - q14u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line; - q15u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line; - - q1u16 = vmull_u8(vget_low_u8(q11u8), d0u8); - q2u16 = vmull_u8(vget_high_u8(q11u8), d0u8); - q3u16 = vmull_u8(vget_low_u8(q12u8), d0u8); - q4u16 = vmull_u8(vget_high_u8(q12u8), d0u8); - q5u16 = vmull_u8(vget_low_u8(q13u8), d0u8); - q6u16 = vmull_u8(vget_high_u8(q13u8), d0u8); - q7u16 = vmull_u8(vget_low_u8(q14u8), d0u8); - q8u16 = vmull_u8(vget_high_u8(q14u8), d0u8); - - q1u16 = vmlal_u8(q1u16, vget_low_u8(q12u8), d1u8); - q2u16 = vmlal_u8(q2u16, vget_high_u8(q12u8), d1u8); - q3u16 = vmlal_u8(q3u16, vget_low_u8(q13u8), d1u8); - q4u16 = vmlal_u8(q4u16, vget_high_u8(q13u8), d1u8); - q5u16 = vmlal_u8(q5u16, vget_low_u8(q14u8), d1u8); - q6u16 = vmlal_u8(q6u16, vget_high_u8(q14u8), d1u8); - q7u16 = vmlal_u8(q7u16, vget_low_u8(q15u8), d1u8); - q8u16 = vmlal_u8(q8u16, vget_high_u8(q15u8), d1u8); - - d2u8 = vqrshrn_n_u16(q1u16, 7); - d3u8 = vqrshrn_n_u16(q2u16, 7); - d4u8 = vqrshrn_n_u16(q3u16, 7); - d5u8 = vqrshrn_n_u16(q4u16, 7); - d6u8 = vqrshrn_n_u16(q5u16, 7); - d7u8 = vqrshrn_n_u16(q6u16, 7); - d8u8 = vqrshrn_n_u16(q7u16, 7); - d9u8 = vqrshrn_n_u16(q8u16, 7); - - q1u8 = vcombine_u8(d2u8, d3u8); - q2u8 = vcombine_u8(d4u8, d5u8); - q3u8 = vcombine_u8(d6u8, d7u8); - q4u8 = vcombine_u8(d8u8, d9u8); - - q11u8 = q15u8; - - vst1q_u8((uint8_t *)dst_ptr, q1u8); dst_ptr += dst_pitch; - vst1q_u8((uint8_t *)dst_ptr, q2u8); dst_ptr += dst_pitch; - vst1q_u8((uint8_t *)dst_ptr, q3u8); dst_ptr += dst_pitch; - vst1q_u8((uint8_t *)dst_ptr, q4u8); dst_ptr += dst_pitch; - } - return; - } - - if (yoffset == 0) { // firstpass_bfilter16x16_only - d0u8 = vdup_n_u8(bifilter4_coeff[xoffset][0]); - d1u8 = vdup_n_u8(bifilter4_coeff[xoffset][1]); - - for (i = 4; i > 0 ; i--) { - d2u8 = vld1_u8(src_ptr); - d3u8 = vld1_u8(src_ptr + 8); - d4u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line; - d5u8 = vld1_u8(src_ptr); - d6u8 = vld1_u8(src_ptr + 8); - d7u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line; - d8u8 = vld1_u8(src_ptr); - d9u8 = vld1_u8(src_ptr + 8); - d10u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line; - d11u8 = vld1_u8(src_ptr); - d12u8 = vld1_u8(src_ptr + 8); - d13u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line; - - q7u16 = vmull_u8(d2u8, d0u8); - q8u16 = vmull_u8(d3u8, d0u8); - q9u16 = vmull_u8(d5u8, d0u8); - q10u16 = vmull_u8(d6u8, d0u8); - q11u16 = vmull_u8(d8u8, d0u8); - q12u16 = vmull_u8(d9u8, d0u8); - q13u16 = vmull_u8(d11u8, d0u8); - q14u16 = vmull_u8(d12u8, d0u8); - - d2u8 = vext_u8(d2u8, d3u8, 1); - d5u8 = vext_u8(d5u8, d6u8, 1); - d8u8 = vext_u8(d8u8, d9u8, 1); - d11u8 = vext_u8(d11u8, d12u8, 1); - - q7u16 = vmlal_u8(q7u16, d2u8, d1u8); - q9u16 = vmlal_u8(q9u16, d5u8, d1u8); - q11u16 = vmlal_u8(q11u16, d8u8, d1u8); - q13u16 = vmlal_u8(q13u16, d11u8, d1u8); - - d3u8 = vext_u8(d3u8, d4u8, 1); - d6u8 = vext_u8(d6u8, d7u8, 1); - d9u8 = vext_u8(d9u8, d10u8, 1); - d12u8 = vext_u8(d12u8, d13u8, 1); - - q8u16 = vmlal_u8(q8u16, d3u8, d1u8); - q10u16 = vmlal_u8(q10u16, d6u8, d1u8); - q12u16 = vmlal_u8(q12u16, d9u8, d1u8); - q14u16 = vmlal_u8(q14u16, d12u8, d1u8); - - d14u8 = vqrshrn_n_u16(q7u16, 7); - d15u8 = vqrshrn_n_u16(q8u16, 7); - d16u8 = vqrshrn_n_u16(q9u16, 7); - d17u8 = vqrshrn_n_u16(q10u16, 7); - d18u8 = vqrshrn_n_u16(q11u16, 7); - d19u8 = vqrshrn_n_u16(q12u16, 7); - d20u8 = vqrshrn_n_u16(q13u16, 7); - d21u8 = vqrshrn_n_u16(q14u16, 7); - - q7u8 = vcombine_u8(d14u8, d15u8); - q8u8 = vcombine_u8(d16u8, d17u8); - q9u8 = vcombine_u8(d18u8, d19u8); - q10u8 =vcombine_u8(d20u8, d21u8); - - vst1q_u8((uint8_t *)dst_ptr, q7u8); dst_ptr += dst_pitch; - vst1q_u8((uint8_t *)dst_ptr, q8u8); dst_ptr += dst_pitch; - vst1q_u8((uint8_t *)dst_ptr, q9u8); dst_ptr += dst_pitch; - vst1q_u8((uint8_t *)dst_ptr, q10u8); dst_ptr += dst_pitch; - } - return; - } - - d0u8 = vdup_n_u8(bifilter4_coeff[xoffset][0]); - d1u8 = vdup_n_u8(bifilter4_coeff[xoffset][1]); - - d2u8 = vld1_u8(src_ptr); - d3u8 = vld1_u8(src_ptr + 8); - d4u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line; - d5u8 = vld1_u8(src_ptr); - d6u8 = vld1_u8(src_ptr + 8); - d7u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line; - d8u8 = vld1_u8(src_ptr); - d9u8 = vld1_u8(src_ptr + 8); - d10u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line; - d11u8 = vld1_u8(src_ptr); - d12u8 = vld1_u8(src_ptr + 8); - d13u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line; - - // First Pass: output_height lines x output_width columns (17x16) - tmpp = tmp; - for (i = 3; i > 0; i--) { - q7u16 = vmull_u8(d2u8, d0u8); - q8u16 = vmull_u8(d3u8, d0u8); - q9u16 = vmull_u8(d5u8, d0u8); - q10u16 = vmull_u8(d6u8, d0u8); - q11u16 = vmull_u8(d8u8, d0u8); - q12u16 = vmull_u8(d9u8, d0u8); - q13u16 = vmull_u8(d11u8, d0u8); - q14u16 = vmull_u8(d12u8, d0u8); - - d2u8 = vext_u8(d2u8, d3u8, 1); - d5u8 = vext_u8(d5u8, d6u8, 1); - d8u8 = vext_u8(d8u8, d9u8, 1); - d11u8 = vext_u8(d11u8, d12u8, 1); - - q7u16 = vmlal_u8(q7u16, d2u8, d1u8); - q9u16 = vmlal_u8(q9u16, d5u8, d1u8); - q11u16 = vmlal_u8(q11u16, d8u8, d1u8); - q13u16 = vmlal_u8(q13u16, d11u8, d1u8); - - d3u8 = vext_u8(d3u8, d4u8, 1); - d6u8 = vext_u8(d6u8, d7u8, 1); - d9u8 = vext_u8(d9u8, d10u8, 1); - d12u8 = vext_u8(d12u8, d13u8, 1); - - q8u16 = vmlal_u8(q8u16, d3u8, d1u8); - q10u16 = vmlal_u8(q10u16, d6u8, d1u8); - q12u16 = vmlal_u8(q12u16, d9u8, d1u8); - q14u16 = vmlal_u8(q14u16, d12u8, d1u8); - - d14u8 = vqrshrn_n_u16(q7u16, 7); - d15u8 = vqrshrn_n_u16(q8u16, 7); - d16u8 = vqrshrn_n_u16(q9u16, 7); - d17u8 = vqrshrn_n_u16(q10u16, 7); - d18u8 = vqrshrn_n_u16(q11u16, 7); - d19u8 = vqrshrn_n_u16(q12u16, 7); - d20u8 = vqrshrn_n_u16(q13u16, 7); - d21u8 = vqrshrn_n_u16(q14u16, 7); - - d2u8 = vld1_u8(src_ptr); - d3u8 = vld1_u8(src_ptr + 8); - d4u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line; - d5u8 = vld1_u8(src_ptr); - d6u8 = vld1_u8(src_ptr + 8); - d7u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line; - d8u8 = vld1_u8(src_ptr); - d9u8 = vld1_u8(src_ptr + 8); - d10u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line; - d11u8 = vld1_u8(src_ptr); - d12u8 = vld1_u8(src_ptr + 8); - d13u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line; - - q7u8 = vcombine_u8(d14u8, d15u8); - q8u8 = vcombine_u8(d16u8, d17u8); - q9u8 = vcombine_u8(d18u8, d19u8); - q10u8 = vcombine_u8(d20u8, d21u8); - - vst1q_u8((uint8_t *)tmpp, q7u8); tmpp += 16; - vst1q_u8((uint8_t *)tmpp, q8u8); tmpp += 16; - vst1q_u8((uint8_t *)tmpp, q9u8); tmpp += 16; - vst1q_u8((uint8_t *)tmpp, q10u8); tmpp += 16; - } - - // First-pass filtering for rest 5 lines - d14u8 = vld1_u8(src_ptr); - d15u8 = vld1_u8(src_ptr + 8); - d16u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line; - - q9u16 = vmull_u8(d2u8, d0u8); - q10u16 = vmull_u8(d3u8, d0u8); - q11u16 = vmull_u8(d5u8, d0u8); - q12u16 = vmull_u8(d6u8, d0u8); - q13u16 = vmull_u8(d8u8, d0u8); - q14u16 = vmull_u8(d9u8, d0u8); - - d2u8 = vext_u8(d2u8, d3u8, 1); - d5u8 = vext_u8(d5u8, d6u8, 1); - d8u8 = vext_u8(d8u8, d9u8, 1); - - q9u16 = vmlal_u8(q9u16, d2u8, d1u8); - q11u16 = vmlal_u8(q11u16, d5u8, d1u8); - q13u16 = vmlal_u8(q13u16, d8u8, d1u8); - - d3u8 = vext_u8(d3u8, d4u8, 1); - d6u8 = vext_u8(d6u8, d7u8, 1); - d9u8 = vext_u8(d9u8, d10u8, 1); - - q10u16 = vmlal_u8(q10u16, d3u8, d1u8); - q12u16 = vmlal_u8(q12u16, d6u8, d1u8); - q14u16 = vmlal_u8(q14u16, d9u8, d1u8); - - q1u16 = vmull_u8(d11u8, d0u8); - q2u16 = vmull_u8(d12u8, d0u8); - q3u16 = vmull_u8(d14u8, d0u8); - q4u16 = vmull_u8(d15u8, d0u8); - - d11u8 = vext_u8(d11u8, d12u8, 1); - d14u8 = vext_u8(d14u8, d15u8, 1); - - q1u16 = vmlal_u8(q1u16, d11u8, d1u8); - q3u16 = vmlal_u8(q3u16, d14u8, d1u8); - - d12u8 = vext_u8(d12u8, d13u8, 1); - d15u8 = vext_u8(d15u8, d16u8, 1); - - q2u16 = vmlal_u8(q2u16, d12u8, d1u8); - q4u16 = vmlal_u8(q4u16, d15u8, d1u8); - - d10u8 = vqrshrn_n_u16(q9u16, 7); - d11u8 = vqrshrn_n_u16(q10u16, 7); - d12u8 = vqrshrn_n_u16(q11u16, 7); - d13u8 = vqrshrn_n_u16(q12u16, 7); - d14u8 = vqrshrn_n_u16(q13u16, 7); - d15u8 = vqrshrn_n_u16(q14u16, 7); - d16u8 = vqrshrn_n_u16(q1u16, 7); - d17u8 = vqrshrn_n_u16(q2u16, 7); - d18u8 = vqrshrn_n_u16(q3u16, 7); - d19u8 = vqrshrn_n_u16(q4u16, 7); - - q5u8 = vcombine_u8(d10u8, d11u8); - q6u8 = vcombine_u8(d12u8, d13u8); - q7u8 = vcombine_u8(d14u8, d15u8); - q8u8 = vcombine_u8(d16u8, d17u8); - q9u8 = vcombine_u8(d18u8, d19u8); - - vst1q_u8((uint8_t *)tmpp, q5u8); tmpp += 16; - vst1q_u8((uint8_t *)tmpp, q6u8); tmpp += 16; - vst1q_u8((uint8_t *)tmpp, q7u8); tmpp += 16; - vst1q_u8((uint8_t *)tmpp, q8u8); tmpp += 16; - vst1q_u8((uint8_t *)tmpp, q9u8); - - // secondpass_filter - d0u8 = vdup_n_u8(bifilter4_coeff[yoffset][0]); - d1u8 = vdup_n_u8(bifilter4_coeff[yoffset][1]); - - tmpp = tmp; - q11u8 = vld1q_u8(tmpp); - tmpp += 16; - for (i = 4; i > 0; i--) { - q12u8 = vld1q_u8(tmpp); tmpp += 16; - q13u8 = vld1q_u8(tmpp); tmpp += 16; - q14u8 = vld1q_u8(tmpp); tmpp += 16; - q15u8 = vld1q_u8(tmpp); tmpp += 16; - - q1u16 = vmull_u8(vget_low_u8(q11u8), d0u8); - q2u16 = vmull_u8(vget_high_u8(q11u8), d0u8); - q3u16 = vmull_u8(vget_low_u8(q12u8), d0u8); - q4u16 = vmull_u8(vget_high_u8(q12u8), d0u8); - q5u16 = vmull_u8(vget_low_u8(q13u8), d0u8); - q6u16 = vmull_u8(vget_high_u8(q13u8), d0u8); - q7u16 = vmull_u8(vget_low_u8(q14u8), d0u8); - q8u16 = vmull_u8(vget_high_u8(q14u8), d0u8); - - q1u16 = vmlal_u8(q1u16, vget_low_u8(q12u8), d1u8); - q2u16 = vmlal_u8(q2u16, vget_high_u8(q12u8), d1u8); - q3u16 = vmlal_u8(q3u16, vget_low_u8(q13u8), d1u8); - q4u16 = vmlal_u8(q4u16, vget_high_u8(q13u8), d1u8); - q5u16 = vmlal_u8(q5u16, vget_low_u8(q14u8), d1u8); - q6u16 = vmlal_u8(q6u16, vget_high_u8(q14u8), d1u8); - q7u16 = vmlal_u8(q7u16, vget_low_u8(q15u8), d1u8); - q8u16 = vmlal_u8(q8u16, vget_high_u8(q15u8), d1u8); - - d2u8 = vqrshrn_n_u16(q1u16, 7); - d3u8 = vqrshrn_n_u16(q2u16, 7); - d4u8 = vqrshrn_n_u16(q3u16, 7); - d5u8 = vqrshrn_n_u16(q4u16, 7); - d6u8 = vqrshrn_n_u16(q5u16, 7); - d7u8 = vqrshrn_n_u16(q6u16, 7); - d8u8 = vqrshrn_n_u16(q7u16, 7); - d9u8 = vqrshrn_n_u16(q8u16, 7); - - q1u8 = vcombine_u8(d2u8, d3u8); - q2u8 = vcombine_u8(d4u8, d5u8); - q3u8 = vcombine_u8(d6u8, d7u8); - q4u8 = vcombine_u8(d8u8, d9u8); - - q11u8 = q15u8; - - vst1q_u8((uint8_t *)dst_ptr, q1u8); dst_ptr += dst_pitch; - vst1q_u8((uint8_t *)dst_ptr, q2u8); dst_ptr += dst_pitch; - vst1q_u8((uint8_t *)dst_ptr, q3u8); dst_ptr += dst_pitch; - vst1q_u8((uint8_t *)dst_ptr, q4u8); dst_ptr += dst_pitch; - } - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/copymem_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/copymem_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/copymem_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/copymem_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -void vp8_copy_mem8x4_neon( - unsigned char *src, - int src_stride, - unsigned char *dst, - int dst_stride) { - uint8x8_t vtmp; - int r; - - for (r = 0; r < 4; r++) { - vtmp = vld1_u8(src); - vst1_u8(dst, vtmp); - src += src_stride; - dst += dst_stride; - } -} - -void vp8_copy_mem8x8_neon( - unsigned char *src, - int src_stride, - unsigned char *dst, - int dst_stride) { - uint8x8_t vtmp; - int r; - - for (r = 0; r < 8; r++) { - vtmp = vld1_u8(src); - vst1_u8(dst, vtmp); - src += src_stride; - dst += dst_stride; - } -} - -void vp8_copy_mem16x16_neon( - unsigned char *src, - int src_stride, - unsigned char *dst, - int dst_stride) { - int r; - uint8x16_t qtmp; - - for (r = 0; r < 16; r++) { - qtmp = vld1q_u8(src); - vst1q_u8(dst, qtmp); - src += src_stride; - dst += dst_stride; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/dc_only_idct_add_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/dc_only_idct_add_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/dc_only_idct_add_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/dc_only_idct_add_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -void vp8_dc_only_idct_add_neon( - int16_t input_dc, - unsigned char *pred_ptr, - int pred_stride, - unsigned char *dst_ptr, - int dst_stride) { - int i; - uint16_t a1 = ((input_dc + 4) >> 3); - uint32x2_t d2u32 = vdup_n_u32(0); - uint8x8_t d2u8; - uint16x8_t q1u16; - uint16x8_t qAdd; - - qAdd = vdupq_n_u16(a1); - - for (i = 0; i < 2; i++) { - d2u32 = vld1_lane_u32((const uint32_t *)pred_ptr, d2u32, 0); - pred_ptr += pred_stride; - d2u32 = vld1_lane_u32((const uint32_t *)pred_ptr, d2u32, 1); - pred_ptr += pred_stride; - - q1u16 = vaddw_u8(qAdd, vreinterpret_u8_u32(d2u32)); - d2u8 = vqmovun_s16(vreinterpretq_s16_u16(q1u16)); - - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d2u8), 0); - dst_ptr += dst_stride; - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d2u8), 1); - dst_ptr += dst_stride; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/dequant_idct_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/dequant_idct_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/dequant_idct_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/dequant_idct_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,142 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -static const int16_t cospi8sqrt2minus1 = 20091; -static const int16_t sinpi8sqrt2 = 35468; - -void vp8_dequant_idct_add_neon( - int16_t *input, - int16_t *dq, - unsigned char *dst, - int stride) { - unsigned char *dst0; - int32x2_t d14, d15; - int16x4_t d2, d3, d4, d5, d10, d11, d12, d13; - int16x8_t q1, q2, q3, q4, q5, q6; - int16x8_t qEmpty = vdupq_n_s16(0); - int32x2x2_t d2tmp0, d2tmp1; - int16x4x2_t d2tmp2, d2tmp3; - - d14 = d15 = vdup_n_s32(0); - - // load input - q3 = vld1q_s16(input); - vst1q_s16(input, qEmpty); - input += 8; - q4 = vld1q_s16(input); - vst1q_s16(input, qEmpty); - - // load dq - q5 = vld1q_s16(dq); - dq += 8; - q6 = vld1q_s16(dq); - - // load src from dst - dst0 = dst; - d14 = vld1_lane_s32((const int32_t *)dst0, d14, 0); - dst0 += stride; - d14 = vld1_lane_s32((const int32_t *)dst0, d14, 1); - dst0 += stride; - d15 = vld1_lane_s32((const int32_t *)dst0, d15, 0); - dst0 += stride; - d15 = vld1_lane_s32((const int32_t *)dst0, d15, 1); - - q1 = vreinterpretq_s16_u16(vmulq_u16(vreinterpretq_u16_s16(q3), - vreinterpretq_u16_s16(q5))); - q2 = vreinterpretq_s16_u16(vmulq_u16(vreinterpretq_u16_s16(q4), - vreinterpretq_u16_s16(q6))); - - d12 = vqadd_s16(vget_low_s16(q1), vget_low_s16(q2)); - d13 = vqsub_s16(vget_low_s16(q1), vget_low_s16(q2)); - - q2 = vcombine_s16(vget_high_s16(q1), vget_high_s16(q2)); - - q3 = vqdmulhq_n_s16(q2, sinpi8sqrt2); - q4 = vqdmulhq_n_s16(q2, cospi8sqrt2minus1); - - q3 = vshrq_n_s16(q3, 1); - q4 = vshrq_n_s16(q4, 1); - - q3 = vqaddq_s16(q3, q2); - q4 = vqaddq_s16(q4, q2); - - d10 = vqsub_s16(vget_low_s16(q3), vget_high_s16(q4)); - d11 = vqadd_s16(vget_high_s16(q3), vget_low_s16(q4)); - - d2 = vqadd_s16(d12, d11); - d3 = vqadd_s16(d13, d10); - d4 = vqsub_s16(d13, d10); - d5 = vqsub_s16(d12, d11); - - d2tmp0 = vtrn_s32(vreinterpret_s32_s16(d2), vreinterpret_s32_s16(d4)); - d2tmp1 = vtrn_s32(vreinterpret_s32_s16(d3), vreinterpret_s32_s16(d5)); - d2tmp2 = vtrn_s16(vreinterpret_s16_s32(d2tmp0.val[0]), - vreinterpret_s16_s32(d2tmp1.val[0])); - d2tmp3 = vtrn_s16(vreinterpret_s16_s32(d2tmp0.val[1]), - vreinterpret_s16_s32(d2tmp1.val[1])); - - // loop 2 - q2 = vcombine_s16(d2tmp2.val[1], d2tmp3.val[1]); - - q3 = vqdmulhq_n_s16(q2, sinpi8sqrt2); - q4 = vqdmulhq_n_s16(q2, cospi8sqrt2minus1); - - d12 = vqadd_s16(d2tmp2.val[0], d2tmp3.val[0]); - d13 = vqsub_s16(d2tmp2.val[0], d2tmp3.val[0]); - - q3 = vshrq_n_s16(q3, 1); - q4 = vshrq_n_s16(q4, 1); - - q3 = vqaddq_s16(q3, q2); - q4 = vqaddq_s16(q4, q2); - - d10 = vqsub_s16(vget_low_s16(q3), vget_high_s16(q4)); - d11 = vqadd_s16(vget_high_s16(q3), vget_low_s16(q4)); - - d2 = vqadd_s16(d12, d11); - d3 = vqadd_s16(d13, d10); - d4 = vqsub_s16(d13, d10); - d5 = vqsub_s16(d12, d11); - - d2 = vrshr_n_s16(d2, 3); - d3 = vrshr_n_s16(d3, 3); - d4 = vrshr_n_s16(d4, 3); - d5 = vrshr_n_s16(d5, 3); - - d2tmp0 = vtrn_s32(vreinterpret_s32_s16(d2), vreinterpret_s32_s16(d4)); - d2tmp1 = vtrn_s32(vreinterpret_s32_s16(d3), vreinterpret_s32_s16(d5)); - d2tmp2 = vtrn_s16(vreinterpret_s16_s32(d2tmp0.val[0]), - vreinterpret_s16_s32(d2tmp1.val[0])); - d2tmp3 = vtrn_s16(vreinterpret_s16_s32(d2tmp0.val[1]), - vreinterpret_s16_s32(d2tmp1.val[1])); - - q1 = vcombine_s16(d2tmp2.val[0], d2tmp2.val[1]); - q2 = vcombine_s16(d2tmp3.val[0], d2tmp3.val[1]); - - q1 = vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(q1), - vreinterpret_u8_s32(d14))); - q2 = vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(q2), - vreinterpret_u8_s32(d15))); - - d14 = vreinterpret_s32_u8(vqmovun_s16(q1)); - d15 = vreinterpret_s32_u8(vqmovun_s16(q2)); - - dst0 = dst; - vst1_lane_s32((int32_t *)dst0, d14, 0); - dst0 += stride; - vst1_lane_s32((int32_t *)dst0, d14, 1); - dst0 += stride; - vst1_lane_s32((int32_t *)dst0, d15, 0); - dst0 += stride; - vst1_lane_s32((int32_t *)dst0, d15, 1); - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/dequantizeb_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/dequantizeb_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/dequantizeb_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/dequantizeb_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "vp8/common/blockd.h" - -void vp8_dequantize_b_neon(BLOCKD *d, short *DQC) { - int16x8x2_t qQ, qDQC, qDQ; - - qQ = vld2q_s16(d->qcoeff); - qDQC = vld2q_s16(DQC); - - qDQ.val[0] = vmulq_s16(qQ.val[0], qDQC.val[0]); - qDQ.val[1] = vmulq_s16(qQ.val[1], qDQC.val[1]); - - vst2q_s16(d->dqcoeff, qDQ); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/idct_blk_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/idct_blk_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/idct_blk_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/idct_blk_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vpx_config.h" -#include "vp8_rtcd.h" - -/* place these declarations here because we don't want to maintain them - * outside of this scope - */ -void idct_dequant_full_2x_neon(short *q, short *dq, - unsigned char *dst, int stride); -void idct_dequant_0_2x_neon(short *q, short dq, - unsigned char *dst, int stride); - - -void vp8_dequant_idct_add_y_block_neon(short *q, short *dq, - unsigned char *dst, - int stride, char *eobs) -{ - int i; - - for (i = 0; i < 4; i++) - { - if (((short *)(eobs))[0]) - { - if (((short *)eobs)[0] & 0xfefe) - idct_dequant_full_2x_neon (q, dq, dst, stride); - else - idct_dequant_0_2x_neon (q, dq[0], dst, stride); - } - - if (((short *)(eobs))[1]) - { - if (((short *)eobs)[1] & 0xfefe) - idct_dequant_full_2x_neon (q+32, dq, dst+8, stride); - else - idct_dequant_0_2x_neon (q+32, dq[0], dst+8, stride); - } - q += 64; - dst += 4*stride; - eobs += 4; - } -} - -void vp8_dequant_idct_add_uv_block_neon(short *q, short *dq, - unsigned char *dstu, - unsigned char *dstv, - int stride, char *eobs) -{ - if (((short *)(eobs))[0]) - { - if (((short *)eobs)[0] & 0xfefe) - idct_dequant_full_2x_neon (q, dq, dstu, stride); - else - idct_dequant_0_2x_neon (q, dq[0], dstu, stride); - } - - q += 32; - dstu += 4*stride; - - if (((short *)(eobs))[1]) - { - if (((short *)eobs)[1] & 0xfefe) - idct_dequant_full_2x_neon (q, dq, dstu, stride); - else - idct_dequant_0_2x_neon (q, dq[0], dstu, stride); - } - - q += 32; - - if (((short *)(eobs))[2]) - { - if (((short *)eobs)[2] & 0xfefe) - idct_dequant_full_2x_neon (q, dq, dstv, stride); - else - idct_dequant_0_2x_neon (q, dq[0], dstv, stride); - } - - q += 32; - dstv += 4*stride; - - if (((short *)(eobs))[3]) - { - if (((short *)eobs)[3] & 0xfefe) - idct_dequant_full_2x_neon (q, dq, dstv, stride); - else - idct_dequant_0_2x_neon (q, dq[0], dstv, stride); - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/idct_dequant_0_2x_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/idct_dequant_0_2x_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/idct_dequant_0_2x_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/idct_dequant_0_2x_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -void idct_dequant_0_2x_neon( - int16_t *q, - int16_t dq, - unsigned char *dst, - int stride) { - unsigned char *dst0; - int i, a0, a1; - int16x8x2_t q2Add; - int32x2_t d2s32, d4s32; - uint8x8_t d2u8, d4u8; - uint16x8_t q1u16, q2u16; - - a0 = ((q[0] * dq) + 4) >> 3; - a1 = ((q[16] * dq) + 4) >> 3; - q[0] = q[16] = 0; - q2Add.val[0] = vdupq_n_s16((int16_t)a0); - q2Add.val[1] = vdupq_n_s16((int16_t)a1); - - for (i = 0; i < 2; i++, dst += 4) { - dst0 = dst; - d2s32 = vld1_lane_s32((const int32_t *)dst0, d2s32, 0); - dst0 += stride; - d2s32 = vld1_lane_s32((const int32_t *)dst0, d2s32, 1); - dst0 += stride; - d4s32 = vld1_lane_s32((const int32_t *)dst0, d4s32, 0); - dst0 += stride; - d4s32 = vld1_lane_s32((const int32_t *)dst0, d4s32, 1); - - q1u16 = vaddw_u8(vreinterpretq_u16_s16(q2Add.val[i]), - vreinterpret_u8_s32(d2s32)); - q2u16 = vaddw_u8(vreinterpretq_u16_s16(q2Add.val[i]), - vreinterpret_u8_s32(d4s32)); - - d2u8 = vqmovun_s16(vreinterpretq_s16_u16(q1u16)); - d4u8 = vqmovun_s16(vreinterpretq_s16_u16(q2u16)); - - d2s32 = vreinterpret_s32_u8(d2u8); - d4s32 = vreinterpret_s32_u8(d4u8); - - dst0 = dst; - vst1_lane_s32((int32_t *)dst0, d2s32, 0); - dst0 += stride; - vst1_lane_s32((int32_t *)dst0, d2s32, 1); - dst0 += stride; - vst1_lane_s32((int32_t *)dst0, d4s32, 0); - dst0 += stride; - vst1_lane_s32((int32_t *)dst0, d4s32, 1); - } - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/idct_dequant_full_2x_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/idct_dequant_full_2x_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/idct_dequant_full_2x_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/idct_dequant_full_2x_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -static const int16_t cospi8sqrt2minus1 = 20091; -static const int16_t sinpi8sqrt2 = 17734; -// because the lowest bit in 0x8a8c is 0, we can pre-shift this - -void idct_dequant_full_2x_neon( - int16_t *q, - int16_t *dq, - unsigned char *dst, - int stride) { - unsigned char *dst0, *dst1; - int32x2_t d28, d29, d30, d31; - int16x8_t q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11; - int16x8_t qEmpty = vdupq_n_s16(0); - int32x4x2_t q2tmp0, q2tmp1; - int16x8x2_t q2tmp2, q2tmp3; - int16x4_t dLow0, dLow1, dHigh0, dHigh1; - - d28 = d29 = d30 = d31 = vdup_n_s32(0); - - // load dq - q0 = vld1q_s16(dq); - dq += 8; - q1 = vld1q_s16(dq); - - // load q - q2 = vld1q_s16(q); - vst1q_s16(q, qEmpty); - q += 8; - q3 = vld1q_s16(q); - vst1q_s16(q, qEmpty); - q += 8; - q4 = vld1q_s16(q); - vst1q_s16(q, qEmpty); - q += 8; - q5 = vld1q_s16(q); - vst1q_s16(q, qEmpty); - - // load src from dst - dst0 = dst; - dst1 = dst + 4; - d28 = vld1_lane_s32((const int32_t *)dst0, d28, 0); - dst0 += stride; - d28 = vld1_lane_s32((const int32_t *)dst1, d28, 1); - dst1 += stride; - d29 = vld1_lane_s32((const int32_t *)dst0, d29, 0); - dst0 += stride; - d29 = vld1_lane_s32((const int32_t *)dst1, d29, 1); - dst1 += stride; - - d30 = vld1_lane_s32((const int32_t *)dst0, d30, 0); - dst0 += stride; - d30 = vld1_lane_s32((const int32_t *)dst1, d30, 1); - dst1 += stride; - d31 = vld1_lane_s32((const int32_t *)dst0, d31, 0); - d31 = vld1_lane_s32((const int32_t *)dst1, d31, 1); - - q2 = vmulq_s16(q2, q0); - q3 = vmulq_s16(q3, q1); - q4 = vmulq_s16(q4, q0); - q5 = vmulq_s16(q5, q1); - - // vswp - dLow0 = vget_low_s16(q2); - dHigh0 = vget_high_s16(q2); - dLow1 = vget_low_s16(q4); - dHigh1 = vget_high_s16(q4); - q2 = vcombine_s16(dLow0, dLow1); - q4 = vcombine_s16(dHigh0, dHigh1); - - dLow0 = vget_low_s16(q3); - dHigh0 = vget_high_s16(q3); - dLow1 = vget_low_s16(q5); - dHigh1 = vget_high_s16(q5); - q3 = vcombine_s16(dLow0, dLow1); - q5 = vcombine_s16(dHigh0, dHigh1); - - q6 = vqdmulhq_n_s16(q4, sinpi8sqrt2); - q7 = vqdmulhq_n_s16(q5, sinpi8sqrt2); - q8 = vqdmulhq_n_s16(q4, cospi8sqrt2minus1); - q9 = vqdmulhq_n_s16(q5, cospi8sqrt2minus1); - - q10 = vqaddq_s16(q2, q3); - q11 = vqsubq_s16(q2, q3); - - q8 = vshrq_n_s16(q8, 1); - q9 = vshrq_n_s16(q9, 1); - - q4 = vqaddq_s16(q4, q8); - q5 = vqaddq_s16(q5, q9); - - q2 = vqsubq_s16(q6, q5); - q3 = vqaddq_s16(q7, q4); - - q4 = vqaddq_s16(q10, q3); - q5 = vqaddq_s16(q11, q2); - q6 = vqsubq_s16(q11, q2); - q7 = vqsubq_s16(q10, q3); - - q2tmp0 = vtrnq_s32(vreinterpretq_s32_s16(q4), vreinterpretq_s32_s16(q6)); - q2tmp1 = vtrnq_s32(vreinterpretq_s32_s16(q5), vreinterpretq_s32_s16(q7)); - q2tmp2 = vtrnq_s16(vreinterpretq_s16_s32(q2tmp0.val[0]), - vreinterpretq_s16_s32(q2tmp1.val[0])); - q2tmp3 = vtrnq_s16(vreinterpretq_s16_s32(q2tmp0.val[1]), - vreinterpretq_s16_s32(q2tmp1.val[1])); - - // loop 2 - q8 = vqdmulhq_n_s16(q2tmp2.val[1], sinpi8sqrt2); - q9 = vqdmulhq_n_s16(q2tmp3.val[1], sinpi8sqrt2); - q10 = vqdmulhq_n_s16(q2tmp2.val[1], cospi8sqrt2minus1); - q11 = vqdmulhq_n_s16(q2tmp3.val[1], cospi8sqrt2minus1); - - q2 = vqaddq_s16(q2tmp2.val[0], q2tmp3.val[0]); - q3 = vqsubq_s16(q2tmp2.val[0], q2tmp3.val[0]); - - q10 = vshrq_n_s16(q10, 1); - q11 = vshrq_n_s16(q11, 1); - - q10 = vqaddq_s16(q2tmp2.val[1], q10); - q11 = vqaddq_s16(q2tmp3.val[1], q11); - - q8 = vqsubq_s16(q8, q11); - q9 = vqaddq_s16(q9, q10); - - q4 = vqaddq_s16(q2, q9); - q5 = vqaddq_s16(q3, q8); - q6 = vqsubq_s16(q3, q8); - q7 = vqsubq_s16(q2, q9); - - q4 = vrshrq_n_s16(q4, 3); - q5 = vrshrq_n_s16(q5, 3); - q6 = vrshrq_n_s16(q6, 3); - q7 = vrshrq_n_s16(q7, 3); - - q2tmp0 = vtrnq_s32(vreinterpretq_s32_s16(q4), vreinterpretq_s32_s16(q6)); - q2tmp1 = vtrnq_s32(vreinterpretq_s32_s16(q5), vreinterpretq_s32_s16(q7)); - q2tmp2 = vtrnq_s16(vreinterpretq_s16_s32(q2tmp0.val[0]), - vreinterpretq_s16_s32(q2tmp1.val[0])); - q2tmp3 = vtrnq_s16(vreinterpretq_s16_s32(q2tmp0.val[1]), - vreinterpretq_s16_s32(q2tmp1.val[1])); - - q4 = vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(q2tmp2.val[0]), - vreinterpret_u8_s32(d28))); - q5 = vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(q2tmp2.val[1]), - vreinterpret_u8_s32(d29))); - q6 = vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(q2tmp3.val[0]), - vreinterpret_u8_s32(d30))); - q7 = vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(q2tmp3.val[1]), - vreinterpret_u8_s32(d31))); - - d28 = vreinterpret_s32_u8(vqmovun_s16(q4)); - d29 = vreinterpret_s32_u8(vqmovun_s16(q5)); - d30 = vreinterpret_s32_u8(vqmovun_s16(q6)); - d31 = vreinterpret_s32_u8(vqmovun_s16(q7)); - - dst0 = dst; - dst1 = dst + 4; - vst1_lane_s32((int32_t *)dst0, d28, 0); - dst0 += stride; - vst1_lane_s32((int32_t *)dst1, d28, 1); - dst1 += stride; - vst1_lane_s32((int32_t *)dst0, d29, 0); - dst0 += stride; - vst1_lane_s32((int32_t *)dst1, d29, 1); - dst1 += stride; - - vst1_lane_s32((int32_t *)dst0, d30, 0); - dst0 += stride; - vst1_lane_s32((int32_t *)dst1, d30, 1); - dst1 += stride; - vst1_lane_s32((int32_t *)dst0, d31, 0); - vst1_lane_s32((int32_t *)dst1, d31, 1); - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/iwalsh_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/iwalsh_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/iwalsh_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/iwalsh_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -void vp8_short_inv_walsh4x4_neon( - int16_t *input, - int16_t *mb_dqcoeff) { - int16x8_t q0s16, q1s16, q2s16, q3s16; - int16x4_t d4s16, d5s16, d6s16, d7s16; - int16x4x2_t v2tmp0, v2tmp1; - int32x2x2_t v2tmp2, v2tmp3; - int16x8_t qAdd3; - - q0s16 = vld1q_s16(input); - q1s16 = vld1q_s16(input + 8); - - // 1st for loop - d4s16 = vadd_s16(vget_low_s16(q0s16), vget_high_s16(q1s16)); - d6s16 = vadd_s16(vget_high_s16(q0s16), vget_low_s16(q1s16)); - d5s16 = vsub_s16(vget_low_s16(q0s16), vget_high_s16(q1s16)); - d7s16 = vsub_s16(vget_high_s16(q0s16), vget_low_s16(q1s16)); - - q2s16 = vcombine_s16(d4s16, d5s16); - q3s16 = vcombine_s16(d6s16, d7s16); - - q0s16 = vaddq_s16(q2s16, q3s16); - q1s16 = vsubq_s16(q2s16, q3s16); - - v2tmp2 = vtrn_s32(vreinterpret_s32_s16(vget_low_s16(q0s16)), - vreinterpret_s32_s16(vget_low_s16(q1s16))); - v2tmp3 = vtrn_s32(vreinterpret_s32_s16(vget_high_s16(q0s16)), - vreinterpret_s32_s16(vget_high_s16(q1s16))); - v2tmp0 = vtrn_s16(vreinterpret_s16_s32(v2tmp2.val[0]), - vreinterpret_s16_s32(v2tmp3.val[0])); - v2tmp1 = vtrn_s16(vreinterpret_s16_s32(v2tmp2.val[1]), - vreinterpret_s16_s32(v2tmp3.val[1])); - - // 2nd for loop - d4s16 = vadd_s16(v2tmp0.val[0], v2tmp1.val[1]); - d6s16 = vadd_s16(v2tmp0.val[1], v2tmp1.val[0]); - d5s16 = vsub_s16(v2tmp0.val[0], v2tmp1.val[1]); - d7s16 = vsub_s16(v2tmp0.val[1], v2tmp1.val[0]); - q2s16 = vcombine_s16(d4s16, d5s16); - q3s16 = vcombine_s16(d6s16, d7s16); - - qAdd3 = vdupq_n_s16(3); - - q0s16 = vaddq_s16(q2s16, q3s16); - q1s16 = vsubq_s16(q2s16, q3s16); - - q0s16 = vaddq_s16(q0s16, qAdd3); - q1s16 = vaddq_s16(q1s16, qAdd3); - - q0s16 = vshrq_n_s16(q0s16, 3); - q1s16 = vshrq_n_s16(q1s16, 3); - - // store - vst1_lane_s16(mb_dqcoeff, vget_low_s16(q0s16), 0); - mb_dqcoeff += 16; - vst1_lane_s16(mb_dqcoeff, vget_high_s16(q0s16), 0); - mb_dqcoeff += 16; - vst1_lane_s16(mb_dqcoeff, vget_low_s16(q1s16), 0); - mb_dqcoeff += 16; - vst1_lane_s16(mb_dqcoeff, vget_high_s16(q1s16), 0); - mb_dqcoeff += 16; - - vst1_lane_s16(mb_dqcoeff, vget_low_s16(q0s16), 1); - mb_dqcoeff += 16; - vst1_lane_s16(mb_dqcoeff, vget_high_s16(q0s16), 1); - mb_dqcoeff += 16; - vst1_lane_s16(mb_dqcoeff, vget_low_s16(q1s16), 1); - mb_dqcoeff += 16; - vst1_lane_s16(mb_dqcoeff, vget_high_s16(q1s16), 1); - mb_dqcoeff += 16; - - vst1_lane_s16(mb_dqcoeff, vget_low_s16(q0s16), 2); - mb_dqcoeff += 16; - vst1_lane_s16(mb_dqcoeff, vget_high_s16(q0s16), 2); - mb_dqcoeff += 16; - vst1_lane_s16(mb_dqcoeff, vget_low_s16(q1s16), 2); - mb_dqcoeff += 16; - vst1_lane_s16(mb_dqcoeff, vget_high_s16(q1s16), 2); - mb_dqcoeff += 16; - - vst1_lane_s16(mb_dqcoeff, vget_low_s16(q0s16), 3); - mb_dqcoeff += 16; - vst1_lane_s16(mb_dqcoeff, vget_high_s16(q0s16), 3); - mb_dqcoeff += 16; - vst1_lane_s16(mb_dqcoeff, vget_low_s16(q1s16), 3); - mb_dqcoeff += 16; - vst1_lane_s16(mb_dqcoeff, vget_high_s16(q1s16), 3); - mb_dqcoeff += 16; - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/loopfilter_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/loopfilter_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/loopfilter_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/loopfilter_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,550 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "./vpx_config.h" -#include "vpx_ports/arm.h" - -static INLINE void vp8_loop_filter_neon( - uint8x16_t qblimit, // flimit - uint8x16_t qlimit, // limit - uint8x16_t qthresh, // thresh - uint8x16_t q3, // p3 - uint8x16_t q4, // p2 - uint8x16_t q5, // p1 - uint8x16_t q6, // p0 - uint8x16_t q7, // q0 - uint8x16_t q8, // q1 - uint8x16_t q9, // q2 - uint8x16_t q10, // q3 - uint8x16_t *q5r, // p1 - uint8x16_t *q6r, // p0 - uint8x16_t *q7r, // q0 - uint8x16_t *q8r) { // q1 - uint8x16_t q0u8, q1u8, q2u8, q11u8, q12u8, q13u8, q14u8, q15u8; - int16x8_t q2s16, q11s16; - uint16x8_t q4u16; - int8x16_t q1s8, q2s8, q10s8, q11s8, q12s8, q13s8; - int8x8_t d2s8, d3s8; - - q11u8 = vabdq_u8(q3, q4); - q12u8 = vabdq_u8(q4, q5); - q13u8 = vabdq_u8(q5, q6); - q14u8 = vabdq_u8(q8, q7); - q3 = vabdq_u8(q9, q8); - q4 = vabdq_u8(q10, q9); - - q11u8 = vmaxq_u8(q11u8, q12u8); - q12u8 = vmaxq_u8(q13u8, q14u8); - q3 = vmaxq_u8(q3, q4); - q15u8 = vmaxq_u8(q11u8, q12u8); - - q9 = vabdq_u8(q6, q7); - - // vp8_hevmask - q13u8 = vcgtq_u8(q13u8, qthresh); - q14u8 = vcgtq_u8(q14u8, qthresh); - q15u8 = vmaxq_u8(q15u8, q3); - - q2u8 = vabdq_u8(q5, q8); - q9 = vqaddq_u8(q9, q9); - - q15u8 = vcgeq_u8(qlimit, q15u8); - - // vp8_filter() function - // convert to signed - q10 = vdupq_n_u8(0x80); - q8 = veorq_u8(q8, q10); - q7 = veorq_u8(q7, q10); - q6 = veorq_u8(q6, q10); - q5 = veorq_u8(q5, q10); - - q2u8 = vshrq_n_u8(q2u8, 1); - q9 = vqaddq_u8(q9, q2u8); - - q10 = vdupq_n_u8(3); - - q2s16 = vsubl_s8(vget_low_s8(vreinterpretq_s8_u8(q7)), - vget_low_s8(vreinterpretq_s8_u8(q6))); - q11s16 = vsubl_s8(vget_high_s8(vreinterpretq_s8_u8(q7)), - vget_high_s8(vreinterpretq_s8_u8(q6))); - - q9 = vcgeq_u8(qblimit, q9); - - q1s8 = vqsubq_s8(vreinterpretq_s8_u8(q5), - vreinterpretq_s8_u8(q8)); - - q14u8 = vorrq_u8(q13u8, q14u8); - - q4u16 = vmovl_u8(vget_low_u8(q10)); - q2s16 = vmulq_s16(q2s16, vreinterpretq_s16_u16(q4u16)); - q11s16 = vmulq_s16(q11s16, vreinterpretq_s16_u16(q4u16)); - - q1u8 = vandq_u8(vreinterpretq_u8_s8(q1s8), q14u8); - q15u8 = vandq_u8(q15u8, q9); - - q1s8 = vreinterpretq_s8_u8(q1u8); - q2s16 = vaddw_s8(q2s16, vget_low_s8(q1s8)); - q11s16 = vaddw_s8(q11s16, vget_high_s8(q1s8)); - - q9 = vdupq_n_u8(4); - // vp8_filter = clamp(vp8_filter + 3 * ( qs0 - ps0)) - d2s8 = vqmovn_s16(q2s16); - d3s8 = vqmovn_s16(q11s16); - q1s8 = vcombine_s8(d2s8, d3s8); - q1u8 = vandq_u8(vreinterpretq_u8_s8(q1s8), q15u8); - q1s8 = vreinterpretq_s8_u8(q1u8); - - q2s8 = vqaddq_s8(q1s8, vreinterpretq_s8_u8(q10)); - q1s8 = vqaddq_s8(q1s8, vreinterpretq_s8_u8(q9)); - q2s8 = vshrq_n_s8(q2s8, 3); - q1s8 = vshrq_n_s8(q1s8, 3); - - q11s8 = vqaddq_s8(vreinterpretq_s8_u8(q6), q2s8); - q10s8 = vqsubq_s8(vreinterpretq_s8_u8(q7), q1s8); - - q1s8 = vrshrq_n_s8(q1s8, 1); - q1s8 = vbicq_s8(q1s8, vreinterpretq_s8_u8(q14u8)); - - q13s8 = vqaddq_s8(vreinterpretq_s8_u8(q5), q1s8); - q12s8 = vqsubq_s8(vreinterpretq_s8_u8(q8), q1s8); - - q0u8 = vdupq_n_u8(0x80); - *q8r = veorq_u8(vreinterpretq_u8_s8(q12s8), q0u8); - *q7r = veorq_u8(vreinterpretq_u8_s8(q10s8), q0u8); - *q6r = veorq_u8(vreinterpretq_u8_s8(q11s8), q0u8); - *q5r = veorq_u8(vreinterpretq_u8_s8(q13s8), q0u8); - return; -} - -void vp8_loop_filter_horizontal_edge_y_neon( - unsigned char *src, - int pitch, - unsigned char blimit, - unsigned char limit, - unsigned char thresh) { - uint8x16_t qblimit, qlimit, qthresh, q3, q4; - uint8x16_t q5, q6, q7, q8, q9, q10; - - qblimit = vdupq_n_u8(blimit); - qlimit = vdupq_n_u8(limit); - qthresh = vdupq_n_u8(thresh); - src -= (pitch << 2); - - q3 = vld1q_u8(src); - src += pitch; - q4 = vld1q_u8(src); - src += pitch; - q5 = vld1q_u8(src); - src += pitch; - q6 = vld1q_u8(src); - src += pitch; - q7 = vld1q_u8(src); - src += pitch; - q8 = vld1q_u8(src); - src += pitch; - q9 = vld1q_u8(src); - src += pitch; - q10 = vld1q_u8(src); - - vp8_loop_filter_neon(qblimit, qlimit, qthresh, q3, q4, - q5, q6, q7, q8, q9, q10, - &q5, &q6, &q7, &q8); - - src -= (pitch * 5); - vst1q_u8(src, q5); - src += pitch; - vst1q_u8(src, q6); - src += pitch; - vst1q_u8(src, q7); - src += pitch; - vst1q_u8(src, q8); - return; -} - -void vp8_loop_filter_horizontal_edge_uv_neon( - unsigned char *u, - int pitch, - unsigned char blimit, - unsigned char limit, - unsigned char thresh, - unsigned char *v) { - uint8x16_t qblimit, qlimit, qthresh, q3, q4; - uint8x16_t q5, q6, q7, q8, q9, q10; - uint8x8_t d6, d7, d8, d9, d10, d11, d12, d13, d14; - uint8x8_t d15, d16, d17, d18, d19, d20, d21; - - qblimit = vdupq_n_u8(blimit); - qlimit = vdupq_n_u8(limit); - qthresh = vdupq_n_u8(thresh); - - u -= (pitch << 2); - v -= (pitch << 2); - - d6 = vld1_u8(u); - u += pitch; - d7 = vld1_u8(v); - v += pitch; - d8 = vld1_u8(u); - u += pitch; - d9 = vld1_u8(v); - v += pitch; - d10 = vld1_u8(u); - u += pitch; - d11 = vld1_u8(v); - v += pitch; - d12 = vld1_u8(u); - u += pitch; - d13 = vld1_u8(v); - v += pitch; - d14 = vld1_u8(u); - u += pitch; - d15 = vld1_u8(v); - v += pitch; - d16 = vld1_u8(u); - u += pitch; - d17 = vld1_u8(v); - v += pitch; - d18 = vld1_u8(u); - u += pitch; - d19 = vld1_u8(v); - v += pitch; - d20 = vld1_u8(u); - d21 = vld1_u8(v); - - q3 = vcombine_u8(d6, d7); - q4 = vcombine_u8(d8, d9); - q5 = vcombine_u8(d10, d11); - q6 = vcombine_u8(d12, d13); - q7 = vcombine_u8(d14, d15); - q8 = vcombine_u8(d16, d17); - q9 = vcombine_u8(d18, d19); - q10 = vcombine_u8(d20, d21); - - vp8_loop_filter_neon(qblimit, qlimit, qthresh, q3, q4, - q5, q6, q7, q8, q9, q10, - &q5, &q6, &q7, &q8); - - u -= (pitch * 5); - vst1_u8(u, vget_low_u8(q5)); - u += pitch; - vst1_u8(u, vget_low_u8(q6)); - u += pitch; - vst1_u8(u, vget_low_u8(q7)); - u += pitch; - vst1_u8(u, vget_low_u8(q8)); - - v -= (pitch * 5); - vst1_u8(v, vget_high_u8(q5)); - v += pitch; - vst1_u8(v, vget_high_u8(q6)); - v += pitch; - vst1_u8(v, vget_high_u8(q7)); - v += pitch; - vst1_u8(v, vget_high_u8(q8)); - return; -} - -static INLINE void write_4x8(unsigned char *dst, int pitch, - const uint8x8x4_t result) { -#ifdef VPX_INCOMPATIBLE_GCC - /* - * uint8x8x4_t result - 00 01 02 03 | 04 05 06 07 - 10 11 12 13 | 14 15 16 17 - 20 21 22 23 | 24 25 26 27 - 30 31 32 33 | 34 35 36 37 - --- - * after vtrn_u16 - 00 01 20 21 | 04 05 24 25 - 02 03 22 23 | 06 07 26 27 - 10 11 30 31 | 14 15 34 35 - 12 13 32 33 | 16 17 36 37 - --- - * after vtrn_u8 - 00 10 20 30 | 04 14 24 34 - 01 11 21 31 | 05 15 25 35 - 02 12 22 32 | 06 16 26 36 - 03 13 23 33 | 07 17 27 37 - */ - const uint16x4x2_t r02_u16 = vtrn_u16(vreinterpret_u16_u8(result.val[0]), - vreinterpret_u16_u8(result.val[2])); - const uint16x4x2_t r13_u16 = vtrn_u16(vreinterpret_u16_u8(result.val[1]), - vreinterpret_u16_u8(result.val[3])); - const uint8x8x2_t r01_u8 = vtrn_u8(vreinterpret_u8_u16(r02_u16.val[0]), - vreinterpret_u8_u16(r13_u16.val[0])); - const uint8x8x2_t r23_u8 = vtrn_u8(vreinterpret_u8_u16(r02_u16.val[1]), - vreinterpret_u8_u16(r13_u16.val[1])); - const uint32x2_t x_0_4 = vreinterpret_u32_u8(r01_u8.val[0]); - const uint32x2_t x_1_5 = vreinterpret_u32_u8(r01_u8.val[1]); - const uint32x2_t x_2_6 = vreinterpret_u32_u8(r23_u8.val[0]); - const uint32x2_t x_3_7 = vreinterpret_u32_u8(r23_u8.val[1]); - vst1_lane_u32((uint32_t *)dst, x_0_4, 0); - dst += pitch; - vst1_lane_u32((uint32_t *)dst, x_1_5, 0); - dst += pitch; - vst1_lane_u32((uint32_t *)dst, x_2_6, 0); - dst += pitch; - vst1_lane_u32((uint32_t *)dst, x_3_7, 0); - dst += pitch; - vst1_lane_u32((uint32_t *)dst, x_0_4, 1); - dst += pitch; - vst1_lane_u32((uint32_t *)dst, x_1_5, 1); - dst += pitch; - vst1_lane_u32((uint32_t *)dst, x_2_6, 1); - dst += pitch; - vst1_lane_u32((uint32_t *)dst, x_3_7, 1); -#else - vst4_lane_u8(dst, result, 0); - dst += pitch; - vst4_lane_u8(dst, result, 1); - dst += pitch; - vst4_lane_u8(dst, result, 2); - dst += pitch; - vst4_lane_u8(dst, result, 3); - dst += pitch; - vst4_lane_u8(dst, result, 4); - dst += pitch; - vst4_lane_u8(dst, result, 5); - dst += pitch; - vst4_lane_u8(dst, result, 6); - dst += pitch; - vst4_lane_u8(dst, result, 7); -#endif // VPX_INCOMPATIBLE_GCC -} - -void vp8_loop_filter_vertical_edge_y_neon( - unsigned char *src, - int pitch, - unsigned char blimit, - unsigned char limit, - unsigned char thresh) { - unsigned char *s, *d; - uint8x16_t qblimit, qlimit, qthresh, q3, q4; - uint8x16_t q5, q6, q7, q8, q9, q10; - uint8x8_t d6, d7, d8, d9, d10, d11, d12, d13, d14; - uint8x8_t d15, d16, d17, d18, d19, d20, d21; - uint32x4x2_t q2tmp0, q2tmp1, q2tmp2, q2tmp3; - uint16x8x2_t q2tmp4, q2tmp5, q2tmp6, q2tmp7; - uint8x16x2_t q2tmp8, q2tmp9, q2tmp10, q2tmp11; - uint8x8x4_t q4ResultH, q4ResultL; - - qblimit = vdupq_n_u8(blimit); - qlimit = vdupq_n_u8(limit); - qthresh = vdupq_n_u8(thresh); - - s = src - 4; - d6 = vld1_u8(s); - s += pitch; - d8 = vld1_u8(s); - s += pitch; - d10 = vld1_u8(s); - s += pitch; - d12 = vld1_u8(s); - s += pitch; - d14 = vld1_u8(s); - s += pitch; - d16 = vld1_u8(s); - s += pitch; - d18 = vld1_u8(s); - s += pitch; - d20 = vld1_u8(s); - s += pitch; - d7 = vld1_u8(s); - s += pitch; - d9 = vld1_u8(s); - s += pitch; - d11 = vld1_u8(s); - s += pitch; - d13 = vld1_u8(s); - s += pitch; - d15 = vld1_u8(s); - s += pitch; - d17 = vld1_u8(s); - s += pitch; - d19 = vld1_u8(s); - s += pitch; - d21 = vld1_u8(s); - - q3 = vcombine_u8(d6, d7); - q4 = vcombine_u8(d8, d9); - q5 = vcombine_u8(d10, d11); - q6 = vcombine_u8(d12, d13); - q7 = vcombine_u8(d14, d15); - q8 = vcombine_u8(d16, d17); - q9 = vcombine_u8(d18, d19); - q10 = vcombine_u8(d20, d21); - - q2tmp0 = vtrnq_u32(vreinterpretq_u32_u8(q3), vreinterpretq_u32_u8(q7)); - q2tmp1 = vtrnq_u32(vreinterpretq_u32_u8(q4), vreinterpretq_u32_u8(q8)); - q2tmp2 = vtrnq_u32(vreinterpretq_u32_u8(q5), vreinterpretq_u32_u8(q9)); - q2tmp3 = vtrnq_u32(vreinterpretq_u32_u8(q6), vreinterpretq_u32_u8(q10)); - - q2tmp4 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp0.val[0]), - vreinterpretq_u16_u32(q2tmp2.val[0])); - q2tmp5 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp1.val[0]), - vreinterpretq_u16_u32(q2tmp3.val[0])); - q2tmp6 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp0.val[1]), - vreinterpretq_u16_u32(q2tmp2.val[1])); - q2tmp7 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp1.val[1]), - vreinterpretq_u16_u32(q2tmp3.val[1])); - - q2tmp8 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp4.val[0]), - vreinterpretq_u8_u16(q2tmp5.val[0])); - q2tmp9 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp4.val[1]), - vreinterpretq_u8_u16(q2tmp5.val[1])); - q2tmp10 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp6.val[0]), - vreinterpretq_u8_u16(q2tmp7.val[0])); - q2tmp11 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp6.val[1]), - vreinterpretq_u8_u16(q2tmp7.val[1])); - - q3 = q2tmp8.val[0]; - q4 = q2tmp8.val[1]; - q5 = q2tmp9.val[0]; - q6 = q2tmp9.val[1]; - q7 = q2tmp10.val[0]; - q8 = q2tmp10.val[1]; - q9 = q2tmp11.val[0]; - q10 = q2tmp11.val[1]; - - vp8_loop_filter_neon(qblimit, qlimit, qthresh, q3, q4, - q5, q6, q7, q8, q9, q10, - &q5, &q6, &q7, &q8); - - q4ResultL.val[0] = vget_low_u8(q5); // d10 - q4ResultL.val[1] = vget_low_u8(q6); // d12 - q4ResultL.val[2] = vget_low_u8(q7); // d14 - q4ResultL.val[3] = vget_low_u8(q8); // d16 - q4ResultH.val[0] = vget_high_u8(q5); // d11 - q4ResultH.val[1] = vget_high_u8(q6); // d13 - q4ResultH.val[2] = vget_high_u8(q7); // d15 - q4ResultH.val[3] = vget_high_u8(q8); // d17 - - d = src - 2; - write_4x8(d, pitch, q4ResultL); - d += pitch * 8; - write_4x8(d, pitch, q4ResultH); -} - -void vp8_loop_filter_vertical_edge_uv_neon( - unsigned char *u, - int pitch, - unsigned char blimit, - unsigned char limit, - unsigned char thresh, - unsigned char *v) { - unsigned char *us, *ud; - unsigned char *vs, *vd; - uint8x16_t qblimit, qlimit, qthresh, q3, q4; - uint8x16_t q5, q6, q7, q8, q9, q10; - uint8x8_t d6, d7, d8, d9, d10, d11, d12, d13, d14; - uint8x8_t d15, d16, d17, d18, d19, d20, d21; - uint32x4x2_t q2tmp0, q2tmp1, q2tmp2, q2tmp3; - uint16x8x2_t q2tmp4, q2tmp5, q2tmp6, q2tmp7; - uint8x16x2_t q2tmp8, q2tmp9, q2tmp10, q2tmp11; - uint8x8x4_t q4ResultH, q4ResultL; - - qblimit = vdupq_n_u8(blimit); - qlimit = vdupq_n_u8(limit); - qthresh = vdupq_n_u8(thresh); - - us = u - 4; - d6 = vld1_u8(us); - us += pitch; - d8 = vld1_u8(us); - us += pitch; - d10 = vld1_u8(us); - us += pitch; - d12 = vld1_u8(us); - us += pitch; - d14 = vld1_u8(us); - us += pitch; - d16 = vld1_u8(us); - us += pitch; - d18 = vld1_u8(us); - us += pitch; - d20 = vld1_u8(us); - - vs = v - 4; - d7 = vld1_u8(vs); - vs += pitch; - d9 = vld1_u8(vs); - vs += pitch; - d11 = vld1_u8(vs); - vs += pitch; - d13 = vld1_u8(vs); - vs += pitch; - d15 = vld1_u8(vs); - vs += pitch; - d17 = vld1_u8(vs); - vs += pitch; - d19 = vld1_u8(vs); - vs += pitch; - d21 = vld1_u8(vs); - - q3 = vcombine_u8(d6, d7); - q4 = vcombine_u8(d8, d9); - q5 = vcombine_u8(d10, d11); - q6 = vcombine_u8(d12, d13); - q7 = vcombine_u8(d14, d15); - q8 = vcombine_u8(d16, d17); - q9 = vcombine_u8(d18, d19); - q10 = vcombine_u8(d20, d21); - - q2tmp0 = vtrnq_u32(vreinterpretq_u32_u8(q3), vreinterpretq_u32_u8(q7)); - q2tmp1 = vtrnq_u32(vreinterpretq_u32_u8(q4), vreinterpretq_u32_u8(q8)); - q2tmp2 = vtrnq_u32(vreinterpretq_u32_u8(q5), vreinterpretq_u32_u8(q9)); - q2tmp3 = vtrnq_u32(vreinterpretq_u32_u8(q6), vreinterpretq_u32_u8(q10)); - - q2tmp4 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp0.val[0]), - vreinterpretq_u16_u32(q2tmp2.val[0])); - q2tmp5 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp1.val[0]), - vreinterpretq_u16_u32(q2tmp3.val[0])); - q2tmp6 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp0.val[1]), - vreinterpretq_u16_u32(q2tmp2.val[1])); - q2tmp7 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp1.val[1]), - vreinterpretq_u16_u32(q2tmp3.val[1])); - - q2tmp8 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp4.val[0]), - vreinterpretq_u8_u16(q2tmp5.val[0])); - q2tmp9 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp4.val[1]), - vreinterpretq_u8_u16(q2tmp5.val[1])); - q2tmp10 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp6.val[0]), - vreinterpretq_u8_u16(q2tmp7.val[0])); - q2tmp11 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp6.val[1]), - vreinterpretq_u8_u16(q2tmp7.val[1])); - - q3 = q2tmp8.val[0]; - q4 = q2tmp8.val[1]; - q5 = q2tmp9.val[0]; - q6 = q2tmp9.val[1]; - q7 = q2tmp10.val[0]; - q8 = q2tmp10.val[1]; - q9 = q2tmp11.val[0]; - q10 = q2tmp11.val[1]; - - vp8_loop_filter_neon(qblimit, qlimit, qthresh, q3, q4, - q5, q6, q7, q8, q9, q10, - &q5, &q6, &q7, &q8); - - q4ResultL.val[0] = vget_low_u8(q5); // d10 - q4ResultL.val[1] = vget_low_u8(q6); // d12 - q4ResultL.val[2] = vget_low_u8(q7); // d14 - q4ResultL.val[3] = vget_low_u8(q8); // d16 - ud = u - 2; - write_4x8(ud, pitch, q4ResultL); - - q4ResultH.val[0] = vget_high_u8(q5); // d11 - q4ResultH.val[1] = vget_high_u8(q6); // d13 - q4ResultH.val[2] = vget_high_u8(q7); // d15 - q4ResultH.val[3] = vget_high_u8(q8); // d17 - vd = v - 2; - write_4x8(vd, pitch, q4ResultH); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/loopfiltersimplehorizontaledge_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/loopfiltersimplehorizontaledge_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/loopfiltersimplehorizontaledge_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/loopfiltersimplehorizontaledge_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "./vpx_config.h" - -static INLINE void vp8_loop_filter_simple_horizontal_edge_neon( - unsigned char *s, - int p, - const unsigned char *blimit) { - uint8_t *sp; - uint8x16_t qblimit, q0u8; - uint8x16_t q5u8, q6u8, q7u8, q8u8, q9u8, q10u8, q14u8, q15u8; - int16x8_t q2s16, q3s16, q13s16; - int8x8_t d8s8, d9s8; - int8x16_t q2s8, q3s8, q4s8, q10s8, q11s8, q14s8; - - qblimit = vdupq_n_u8(*blimit); - - sp = s - (p << 1); - q5u8 = vld1q_u8(sp); - sp += p; - q6u8 = vld1q_u8(sp); - sp += p; - q7u8 = vld1q_u8(sp); - sp += p; - q8u8 = vld1q_u8(sp); - - q15u8 = vabdq_u8(q6u8, q7u8); - q14u8 = vabdq_u8(q5u8, q8u8); - - q15u8 = vqaddq_u8(q15u8, q15u8); - q14u8 = vshrq_n_u8(q14u8, 1); - q0u8 = vdupq_n_u8(0x80); - q13s16 = vdupq_n_s16(3); - q15u8 = vqaddq_u8(q15u8, q14u8); - - q5u8 = veorq_u8(q5u8, q0u8); - q6u8 = veorq_u8(q6u8, q0u8); - q7u8 = veorq_u8(q7u8, q0u8); - q8u8 = veorq_u8(q8u8, q0u8); - - q15u8 = vcgeq_u8(qblimit, q15u8); - - q2s16 = vsubl_s8(vget_low_s8(vreinterpretq_s8_u8(q7u8)), - vget_low_s8(vreinterpretq_s8_u8(q6u8))); - q3s16 = vsubl_s8(vget_high_s8(vreinterpretq_s8_u8(q7u8)), - vget_high_s8(vreinterpretq_s8_u8(q6u8))); - - q4s8 = vqsubq_s8(vreinterpretq_s8_u8(q5u8), - vreinterpretq_s8_u8(q8u8)); - - q2s16 = vmulq_s16(q2s16, q13s16); - q3s16 = vmulq_s16(q3s16, q13s16); - - q10u8 = vdupq_n_u8(3); - q9u8 = vdupq_n_u8(4); - - q2s16 = vaddw_s8(q2s16, vget_low_s8(q4s8)); - q3s16 = vaddw_s8(q3s16, vget_high_s8(q4s8)); - - d8s8 = vqmovn_s16(q2s16); - d9s8 = vqmovn_s16(q3s16); - q4s8 = vcombine_s8(d8s8, d9s8); - - q14s8 = vandq_s8(q4s8, vreinterpretq_s8_u8(q15u8)); - - q2s8 = vqaddq_s8(q14s8, vreinterpretq_s8_u8(q10u8)); - q3s8 = vqaddq_s8(q14s8, vreinterpretq_s8_u8(q9u8)); - q2s8 = vshrq_n_s8(q2s8, 3); - q3s8 = vshrq_n_s8(q3s8, 3); - - q11s8 = vqaddq_s8(vreinterpretq_s8_u8(q6u8), q2s8); - q10s8 = vqsubq_s8(vreinterpretq_s8_u8(q7u8), q3s8); - - q6u8 = veorq_u8(vreinterpretq_u8_s8(q11s8), q0u8); - q7u8 = veorq_u8(vreinterpretq_u8_s8(q10s8), q0u8); - - vst1q_u8(s, q7u8); - s -= p; - vst1q_u8(s, q6u8); - return; -} - -void vp8_loop_filter_bhs_neon( - unsigned char *y_ptr, - int y_stride, - const unsigned char *blimit) { - y_ptr += y_stride * 4; - vp8_loop_filter_simple_horizontal_edge_neon(y_ptr, y_stride, blimit); - y_ptr += y_stride * 4; - vp8_loop_filter_simple_horizontal_edge_neon(y_ptr, y_stride, blimit); - y_ptr += y_stride * 4; - vp8_loop_filter_simple_horizontal_edge_neon(y_ptr, y_stride, blimit); - return; -} - -void vp8_loop_filter_mbhs_neon( - unsigned char *y_ptr, - int y_stride, - const unsigned char *blimit) { - vp8_loop_filter_simple_horizontal_edge_neon(y_ptr, y_stride, blimit); - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/loopfiltersimpleverticaledge_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/loopfiltersimpleverticaledge_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/loopfiltersimpleverticaledge_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/loopfiltersimpleverticaledge_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,280 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "./vpx_config.h" -#include "vpx_ports/arm.h" - -#ifdef VPX_INCOMPATIBLE_GCC -static INLINE void write_2x4(unsigned char *dst, int pitch, - const uint8x8x2_t result) { - /* - * uint8x8x2_t result - 00 01 02 03 | 04 05 06 07 - 10 11 12 13 | 14 15 16 17 - --- - * after vtrn_u8 - 00 10 02 12 | 04 14 06 16 - 01 11 03 13 | 05 15 07 17 - */ - const uint8x8x2_t r01_u8 = vtrn_u8(result.val[0], - result.val[1]); - const uint16x4_t x_0_4 = vreinterpret_u16_u8(r01_u8.val[0]); - const uint16x4_t x_1_5 = vreinterpret_u16_u8(r01_u8.val[1]); - vst1_lane_u16((uint16_t *)dst, x_0_4, 0); - dst += pitch; - vst1_lane_u16((uint16_t *)dst, x_1_5, 0); - dst += pitch; - vst1_lane_u16((uint16_t *)dst, x_0_4, 1); - dst += pitch; - vst1_lane_u16((uint16_t *)dst, x_1_5, 1); - dst += pitch; - vst1_lane_u16((uint16_t *)dst, x_0_4, 2); - dst += pitch; - vst1_lane_u16((uint16_t *)dst, x_1_5, 2); - dst += pitch; - vst1_lane_u16((uint16_t *)dst, x_0_4, 3); - dst += pitch; - vst1_lane_u16((uint16_t *)dst, x_1_5, 3); -} - -static INLINE void write_2x8(unsigned char *dst, int pitch, - const uint8x8x2_t result, - const uint8x8x2_t result2) { - write_2x4(dst, pitch, result); - dst += pitch * 8; - write_2x4(dst, pitch, result2); -} -#else -static INLINE void write_2x8(unsigned char *dst, int pitch, - const uint8x8x2_t result, - const uint8x8x2_t result2) { - vst2_lane_u8(dst, result, 0); - dst += pitch; - vst2_lane_u8(dst, result, 1); - dst += pitch; - vst2_lane_u8(dst, result, 2); - dst += pitch; - vst2_lane_u8(dst, result, 3); - dst += pitch; - vst2_lane_u8(dst, result, 4); - dst += pitch; - vst2_lane_u8(dst, result, 5); - dst += pitch; - vst2_lane_u8(dst, result, 6); - dst += pitch; - vst2_lane_u8(dst, result, 7); - dst += pitch; - - vst2_lane_u8(dst, result2, 0); - dst += pitch; - vst2_lane_u8(dst, result2, 1); - dst += pitch; - vst2_lane_u8(dst, result2, 2); - dst += pitch; - vst2_lane_u8(dst, result2, 3); - dst += pitch; - vst2_lane_u8(dst, result2, 4); - dst += pitch; - vst2_lane_u8(dst, result2, 5); - dst += pitch; - vst2_lane_u8(dst, result2, 6); - dst += pitch; - vst2_lane_u8(dst, result2, 7); -} -#endif // VPX_INCOMPATIBLE_GCC - - -#ifdef VPX_INCOMPATIBLE_GCC -static INLINE -uint8x8x4_t read_4x8(unsigned char *src, int pitch, uint8x8x4_t x) { - const uint8x8_t a = vld1_u8(src); - const uint8x8_t b = vld1_u8(src + pitch * 1); - const uint8x8_t c = vld1_u8(src + pitch * 2); - const uint8x8_t d = vld1_u8(src + pitch * 3); - const uint8x8_t e = vld1_u8(src + pitch * 4); - const uint8x8_t f = vld1_u8(src + pitch * 5); - const uint8x8_t g = vld1_u8(src + pitch * 6); - const uint8x8_t h = vld1_u8(src + pitch * 7); - const uint32x2x2_t r04_u32 = vtrn_u32(vreinterpret_u32_u8(a), - vreinterpret_u32_u8(e)); - const uint32x2x2_t r15_u32 = vtrn_u32(vreinterpret_u32_u8(b), - vreinterpret_u32_u8(f)); - const uint32x2x2_t r26_u32 = vtrn_u32(vreinterpret_u32_u8(c), - vreinterpret_u32_u8(g)); - const uint32x2x2_t r37_u32 = vtrn_u32(vreinterpret_u32_u8(d), - vreinterpret_u32_u8(h)); - const uint16x4x2_t r02_u16 = vtrn_u16(vreinterpret_u16_u32(r04_u32.val[0]), - vreinterpret_u16_u32(r26_u32.val[0])); - const uint16x4x2_t r13_u16 = vtrn_u16(vreinterpret_u16_u32(r15_u32.val[0]), - vreinterpret_u16_u32(r37_u32.val[0])); - const uint8x8x2_t r01_u8 = vtrn_u8(vreinterpret_u8_u16(r02_u16.val[0]), - vreinterpret_u8_u16(r13_u16.val[0])); - const uint8x8x2_t r23_u8 = vtrn_u8(vreinterpret_u8_u16(r02_u16.val[1]), - vreinterpret_u8_u16(r13_u16.val[1])); - /* - * after vtrn_u32 - 00 01 02 03 | 40 41 42 43 - 10 11 12 13 | 50 51 52 53 - 20 21 22 23 | 60 61 62 63 - 30 31 32 33 | 70 71 72 73 - --- - * after vtrn_u16 - 00 01 20 21 | 40 41 60 61 - 02 03 22 23 | 42 43 62 63 - 10 11 30 31 | 50 51 70 71 - 12 13 32 33 | 52 52 72 73 - - 00 01 20 21 | 40 41 60 61 - 10 11 30 31 | 50 51 70 71 - 02 03 22 23 | 42 43 62 63 - 12 13 32 33 | 52 52 72 73 - --- - * after vtrn_u8 - 00 10 20 30 | 40 50 60 70 - 01 11 21 31 | 41 51 61 71 - 02 12 22 32 | 42 52 62 72 - 03 13 23 33 | 43 53 63 73 - */ - x.val[0] = r01_u8.val[0]; - x.val[1] = r01_u8.val[1]; - x.val[2] = r23_u8.val[0]; - x.val[3] = r23_u8.val[1]; - - return x; -} -#else -static INLINE -uint8x8x4_t read_4x8(unsigned char *src, int pitch, uint8x8x4_t x) { - x = vld4_lane_u8(src, x, 0); - src += pitch; - x = vld4_lane_u8(src, x, 1); - src += pitch; - x = vld4_lane_u8(src, x, 2); - src += pitch; - x = vld4_lane_u8(src, x, 3); - src += pitch; - x = vld4_lane_u8(src, x, 4); - src += pitch; - x = vld4_lane_u8(src, x, 5); - src += pitch; - x = vld4_lane_u8(src, x, 6); - src += pitch; - x = vld4_lane_u8(src, x, 7); - return x; -} -#endif // VPX_INCOMPATIBLE_GCC - -static INLINE void vp8_loop_filter_simple_vertical_edge_neon( - unsigned char *s, - int p, - const unsigned char *blimit) { - unsigned char *src1; - uint8x16_t qblimit, q0u8; - uint8x16_t q3u8, q4u8, q5u8, q6u8, q7u8, q11u8, q12u8, q14u8, q15u8; - int16x8_t q2s16, q13s16, q11s16; - int8x8_t d28s8, d29s8; - int8x16_t q2s8, q3s8, q10s8, q11s8, q14s8; - uint8x8x4_t d0u8x4; // d6, d7, d8, d9 - uint8x8x4_t d1u8x4; // d10, d11, d12, d13 - uint8x8x2_t d2u8x2; // d12, d13 - uint8x8x2_t d3u8x2; // d14, d15 - - qblimit = vdupq_n_u8(*blimit); - - src1 = s - 2; - d0u8x4 = read_4x8(src1, p, d0u8x4); - src1 += p * 8; - d1u8x4 = read_4x8(src1, p, d1u8x4); - - q3u8 = vcombine_u8(d0u8x4.val[0], d1u8x4.val[0]); // d6 d10 - q4u8 = vcombine_u8(d0u8x4.val[2], d1u8x4.val[2]); // d8 d12 - q5u8 = vcombine_u8(d0u8x4.val[1], d1u8x4.val[1]); // d7 d11 - q6u8 = vcombine_u8(d0u8x4.val[3], d1u8x4.val[3]); // d9 d13 - - q15u8 = vabdq_u8(q5u8, q4u8); - q14u8 = vabdq_u8(q3u8, q6u8); - - q15u8 = vqaddq_u8(q15u8, q15u8); - q14u8 = vshrq_n_u8(q14u8, 1); - q0u8 = vdupq_n_u8(0x80); - q11s16 = vdupq_n_s16(3); - q15u8 = vqaddq_u8(q15u8, q14u8); - - q3u8 = veorq_u8(q3u8, q0u8); - q4u8 = veorq_u8(q4u8, q0u8); - q5u8 = veorq_u8(q5u8, q0u8); - q6u8 = veorq_u8(q6u8, q0u8); - - q15u8 = vcgeq_u8(qblimit, q15u8); - - q2s16 = vsubl_s8(vget_low_s8(vreinterpretq_s8_u8(q4u8)), - vget_low_s8(vreinterpretq_s8_u8(q5u8))); - q13s16 = vsubl_s8(vget_high_s8(vreinterpretq_s8_u8(q4u8)), - vget_high_s8(vreinterpretq_s8_u8(q5u8))); - - q14s8 = vqsubq_s8(vreinterpretq_s8_u8(q3u8), - vreinterpretq_s8_u8(q6u8)); - - q2s16 = vmulq_s16(q2s16, q11s16); - q13s16 = vmulq_s16(q13s16, q11s16); - - q11u8 = vdupq_n_u8(3); - q12u8 = vdupq_n_u8(4); - - q2s16 = vaddw_s8(q2s16, vget_low_s8(q14s8)); - q13s16 = vaddw_s8(q13s16, vget_high_s8(q14s8)); - - d28s8 = vqmovn_s16(q2s16); - d29s8 = vqmovn_s16(q13s16); - q14s8 = vcombine_s8(d28s8, d29s8); - - q14s8 = vandq_s8(q14s8, vreinterpretq_s8_u8(q15u8)); - - q2s8 = vqaddq_s8(q14s8, vreinterpretq_s8_u8(q11u8)); - q3s8 = vqaddq_s8(q14s8, vreinterpretq_s8_u8(q12u8)); - q2s8 = vshrq_n_s8(q2s8, 3); - q14s8 = vshrq_n_s8(q3s8, 3); - - q11s8 = vqaddq_s8(vreinterpretq_s8_u8(q5u8), q2s8); - q10s8 = vqsubq_s8(vreinterpretq_s8_u8(q4u8), q14s8); - - q6u8 = veorq_u8(vreinterpretq_u8_s8(q11s8), q0u8); - q7u8 = veorq_u8(vreinterpretq_u8_s8(q10s8), q0u8); - - d2u8x2.val[0] = vget_low_u8(q6u8); // d12 - d2u8x2.val[1] = vget_low_u8(q7u8); // d14 - d3u8x2.val[0] = vget_high_u8(q6u8); // d13 - d3u8x2.val[1] = vget_high_u8(q7u8); // d15 - - src1 = s - 1; - write_2x8(src1, p, d2u8x2, d3u8x2); -} - -void vp8_loop_filter_bvs_neon( - unsigned char *y_ptr, - int y_stride, - const unsigned char *blimit) { - y_ptr += 4; - vp8_loop_filter_simple_vertical_edge_neon(y_ptr, y_stride, blimit); - y_ptr += 4; - vp8_loop_filter_simple_vertical_edge_neon(y_ptr, y_stride, blimit); - y_ptr += 4; - vp8_loop_filter_simple_vertical_edge_neon(y_ptr, y_stride, blimit); - return; -} - -void vp8_loop_filter_mbvs_neon( - unsigned char *y_ptr, - int y_stride, - const unsigned char *blimit) { - vp8_loop_filter_simple_vertical_edge_neon(y_ptr, y_stride, blimit); - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/mbloopfilter_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/mbloopfilter_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/mbloopfilter_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/mbloopfilter_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,625 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "./vpx_config.h" - -static INLINE void vp8_mbloop_filter_neon( - uint8x16_t qblimit, // mblimit - uint8x16_t qlimit, // limit - uint8x16_t qthresh, // thresh - uint8x16_t q3, // p2 - uint8x16_t q4, // p2 - uint8x16_t q5, // p1 - uint8x16_t q6, // p0 - uint8x16_t q7, // q0 - uint8x16_t q8, // q1 - uint8x16_t q9, // q2 - uint8x16_t q10, // q3 - uint8x16_t *q4r, // p1 - uint8x16_t *q5r, // p1 - uint8x16_t *q6r, // p0 - uint8x16_t *q7r, // q0 - uint8x16_t *q8r, // q1 - uint8x16_t *q9r) { // q1 - uint8x16_t q0u8, q1u8, q11u8, q12u8, q13u8, q14u8, q15u8; - int16x8_t q0s16, q2s16, q11s16, q12s16, q13s16, q14s16, q15s16; - int8x16_t q1s8, q6s8, q7s8, q2s8, q11s8, q13s8; - uint16x8_t q0u16, q11u16, q12u16, q13u16, q14u16, q15u16; - int8x16_t q0s8, q12s8, q14s8, q15s8; - int8x8_t d0, d1, d2, d3, d4, d5, d24, d25, d28, d29; - - q11u8 = vabdq_u8(q3, q4); - q12u8 = vabdq_u8(q4, q5); - q13u8 = vabdq_u8(q5, q6); - q14u8 = vabdq_u8(q8, q7); - q1u8 = vabdq_u8(q9, q8); - q0u8 = vabdq_u8(q10, q9); - - q11u8 = vmaxq_u8(q11u8, q12u8); - q12u8 = vmaxq_u8(q13u8, q14u8); - q1u8 = vmaxq_u8(q1u8, q0u8); - q15u8 = vmaxq_u8(q11u8, q12u8); - - q12u8 = vabdq_u8(q6, q7); - - // vp8_hevmask - q13u8 = vcgtq_u8(q13u8, qthresh); - q14u8 = vcgtq_u8(q14u8, qthresh); - q15u8 = vmaxq_u8(q15u8, q1u8); - - q15u8 = vcgeq_u8(qlimit, q15u8); - - q1u8 = vabdq_u8(q5, q8); - q12u8 = vqaddq_u8(q12u8, q12u8); - - // vp8_filter() function - // convert to signed - q0u8 = vdupq_n_u8(0x80); - q9 = veorq_u8(q9, q0u8); - q8 = veorq_u8(q8, q0u8); - q7 = veorq_u8(q7, q0u8); - q6 = veorq_u8(q6, q0u8); - q5 = veorq_u8(q5, q0u8); - q4 = veorq_u8(q4, q0u8); - - q1u8 = vshrq_n_u8(q1u8, 1); - q12u8 = vqaddq_u8(q12u8, q1u8); - - q14u8 = vorrq_u8(q13u8, q14u8); - q12u8 = vcgeq_u8(qblimit, q12u8); - - q2s16 = vsubl_s8(vget_low_s8(vreinterpretq_s8_u8(q7)), - vget_low_s8(vreinterpretq_s8_u8(q6))); - q13s16 = vsubl_s8(vget_high_s8(vreinterpretq_s8_u8(q7)), - vget_high_s8(vreinterpretq_s8_u8(q6))); - - q1s8 = vqsubq_s8(vreinterpretq_s8_u8(q5), - vreinterpretq_s8_u8(q8)); - - q11s16 = vdupq_n_s16(3); - q2s16 = vmulq_s16(q2s16, q11s16); - q13s16 = vmulq_s16(q13s16, q11s16); - - q15u8 = vandq_u8(q15u8, q12u8); - - q2s16 = vaddw_s8(q2s16, vget_low_s8(q1s8)); - q13s16 = vaddw_s8(q13s16, vget_high_s8(q1s8)); - - q12u8 = vdupq_n_u8(3); - q11u8 = vdupq_n_u8(4); - // vp8_filter = clamp(vp8_filter + 3 * ( qs0 - ps0)) - d2 = vqmovn_s16(q2s16); - d3 = vqmovn_s16(q13s16); - q1s8 = vcombine_s8(d2, d3); - q1s8 = vandq_s8(q1s8, vreinterpretq_s8_u8(q15u8)); - q13s8 = vandq_s8(q1s8, vreinterpretq_s8_u8(q14u8)); - - q2s8 = vqaddq_s8(q13s8, vreinterpretq_s8_u8(q11u8)); - q13s8 = vqaddq_s8(q13s8, vreinterpretq_s8_u8(q12u8)); - q2s8 = vshrq_n_s8(q2s8, 3); - q13s8 = vshrq_n_s8(q13s8, 3); - - q7s8 = vqsubq_s8(vreinterpretq_s8_u8(q7), q2s8); - q6s8 = vqaddq_s8(vreinterpretq_s8_u8(q6), q13s8); - - q1s8 = vbicq_s8(q1s8, vreinterpretq_s8_u8(q14u8)); - - q0u16 = q11u16 = q12u16 = q13u16 = q14u16 = q15u16 = vdupq_n_u16(63); - d5 = vdup_n_s8(9); - d4 = vdup_n_s8(18); - - q0s16 = vmlal_s8(vreinterpretq_s16_u16(q0u16), vget_low_s8(q1s8), d5); - q11s16 = vmlal_s8(vreinterpretq_s16_u16(q11u16), vget_high_s8(q1s8), d5); - d5 = vdup_n_s8(27); - q12s16 = vmlal_s8(vreinterpretq_s16_u16(q12u16), vget_low_s8(q1s8), d4); - q13s16 = vmlal_s8(vreinterpretq_s16_u16(q13u16), vget_high_s8(q1s8), d4); - q14s16 = vmlal_s8(vreinterpretq_s16_u16(q14u16), vget_low_s8(q1s8), d5); - q15s16 = vmlal_s8(vreinterpretq_s16_u16(q15u16), vget_high_s8(q1s8), d5); - - d0 = vqshrn_n_s16(q0s16 , 7); - d1 = vqshrn_n_s16(q11s16, 7); - d24 = vqshrn_n_s16(q12s16, 7); - d25 = vqshrn_n_s16(q13s16, 7); - d28 = vqshrn_n_s16(q14s16, 7); - d29 = vqshrn_n_s16(q15s16, 7); - - q0s8 = vcombine_s8(d0, d1); - q12s8 = vcombine_s8(d24, d25); - q14s8 = vcombine_s8(d28, d29); - - q11s8 = vqsubq_s8(vreinterpretq_s8_u8(q9), q0s8); - q0s8 = vqaddq_s8(vreinterpretq_s8_u8(q4), q0s8); - q13s8 = vqsubq_s8(vreinterpretq_s8_u8(q8), q12s8); - q12s8 = vqaddq_s8(vreinterpretq_s8_u8(q5), q12s8); - q15s8 = vqsubq_s8((q7s8), q14s8); - q14s8 = vqaddq_s8((q6s8), q14s8); - - q1u8 = vdupq_n_u8(0x80); - *q9r = veorq_u8(vreinterpretq_u8_s8(q11s8), q1u8); - *q8r = veorq_u8(vreinterpretq_u8_s8(q13s8), q1u8); - *q7r = veorq_u8(vreinterpretq_u8_s8(q15s8), q1u8); - *q6r = veorq_u8(vreinterpretq_u8_s8(q14s8), q1u8); - *q5r = veorq_u8(vreinterpretq_u8_s8(q12s8), q1u8); - *q4r = veorq_u8(vreinterpretq_u8_s8(q0s8), q1u8); - return; -} - -void vp8_mbloop_filter_horizontal_edge_y_neon( - unsigned char *src, - int pitch, - unsigned char blimit, - unsigned char limit, - unsigned char thresh) { - uint8x16_t qblimit, qlimit, qthresh, q3, q4; - uint8x16_t q5, q6, q7, q8, q9, q10; - - qblimit = vdupq_n_u8(blimit); - qlimit = vdupq_n_u8(limit); - qthresh = vdupq_n_u8(thresh); - - src -= (pitch << 2); - - q3 = vld1q_u8(src); - src += pitch; - q4 = vld1q_u8(src); - src += pitch; - q5 = vld1q_u8(src); - src += pitch; - q6 = vld1q_u8(src); - src += pitch; - q7 = vld1q_u8(src); - src += pitch; - q8 = vld1q_u8(src); - src += pitch; - q9 = vld1q_u8(src); - src += pitch; - q10 = vld1q_u8(src); - - vp8_mbloop_filter_neon(qblimit, qlimit, qthresh, q3, q4, - q5, q6, q7, q8, q9, q10, - &q4, &q5, &q6, &q7, &q8, &q9); - - src -= (pitch * 6); - vst1q_u8(src, q4); - src += pitch; - vst1q_u8(src, q5); - src += pitch; - vst1q_u8(src, q6); - src += pitch; - vst1q_u8(src, q7); - src += pitch; - vst1q_u8(src, q8); - src += pitch; - vst1q_u8(src, q9); - return; -} - -void vp8_mbloop_filter_horizontal_edge_uv_neon( - unsigned char *u, - int pitch, - unsigned char blimit, - unsigned char limit, - unsigned char thresh, - unsigned char *v) { - uint8x16_t qblimit, qlimit, qthresh, q3, q4; - uint8x16_t q5, q6, q7, q8, q9, q10; - uint8x8_t d6, d7, d8, d9, d10, d11, d12, d13, d14; - uint8x8_t d15, d16, d17, d18, d19, d20, d21; - - qblimit = vdupq_n_u8(blimit); - qlimit = vdupq_n_u8(limit); - qthresh = vdupq_n_u8(thresh); - - u -= (pitch << 2); - v -= (pitch << 2); - - d6 = vld1_u8(u); - u += pitch; - d7 = vld1_u8(v); - v += pitch; - d8 = vld1_u8(u); - u += pitch; - d9 = vld1_u8(v); - v += pitch; - d10 = vld1_u8(u); - u += pitch; - d11 = vld1_u8(v); - v += pitch; - d12 = vld1_u8(u); - u += pitch; - d13 = vld1_u8(v); - v += pitch; - d14 = vld1_u8(u); - u += pitch; - d15 = vld1_u8(v); - v += pitch; - d16 = vld1_u8(u); - u += pitch; - d17 = vld1_u8(v); - v += pitch; - d18 = vld1_u8(u); - u += pitch; - d19 = vld1_u8(v); - v += pitch; - d20 = vld1_u8(u); - d21 = vld1_u8(v); - - q3 = vcombine_u8(d6, d7); - q4 = vcombine_u8(d8, d9); - q5 = vcombine_u8(d10, d11); - q6 = vcombine_u8(d12, d13); - q7 = vcombine_u8(d14, d15); - q8 = vcombine_u8(d16, d17); - q9 = vcombine_u8(d18, d19); - q10 = vcombine_u8(d20, d21); - - vp8_mbloop_filter_neon(qblimit, qlimit, qthresh, q3, q4, - q5, q6, q7, q8, q9, q10, - &q4, &q5, &q6, &q7, &q8, &q9); - - u -= (pitch * 6); - v -= (pitch * 6); - vst1_u8(u, vget_low_u8(q4)); - u += pitch; - vst1_u8(v, vget_high_u8(q4)); - v += pitch; - vst1_u8(u, vget_low_u8(q5)); - u += pitch; - vst1_u8(v, vget_high_u8(q5)); - v += pitch; - vst1_u8(u, vget_low_u8(q6)); - u += pitch; - vst1_u8(v, vget_high_u8(q6)); - v += pitch; - vst1_u8(u, vget_low_u8(q7)); - u += pitch; - vst1_u8(v, vget_high_u8(q7)); - v += pitch; - vst1_u8(u, vget_low_u8(q8)); - u += pitch; - vst1_u8(v, vget_high_u8(q8)); - v += pitch; - vst1_u8(u, vget_low_u8(q9)); - vst1_u8(v, vget_high_u8(q9)); - return; -} - -void vp8_mbloop_filter_vertical_edge_y_neon( - unsigned char *src, - int pitch, - unsigned char blimit, - unsigned char limit, - unsigned char thresh) { - unsigned char *s1, *s2; - uint8x16_t qblimit, qlimit, qthresh, q3, q4; - uint8x16_t q5, q6, q7, q8, q9, q10; - uint8x8_t d6, d7, d8, d9, d10, d11, d12, d13, d14; - uint8x8_t d15, d16, d17, d18, d19, d20, d21; - uint32x4x2_t q2tmp0, q2tmp1, q2tmp2, q2tmp3; - uint16x8x2_t q2tmp4, q2tmp5, q2tmp6, q2tmp7; - uint8x16x2_t q2tmp8, q2tmp9, q2tmp10, q2tmp11; - - qblimit = vdupq_n_u8(blimit); - qlimit = vdupq_n_u8(limit); - qthresh = vdupq_n_u8(thresh); - - s1 = src - 4; - s2 = s1 + 8 * pitch; - d6 = vld1_u8(s1); - s1 += pitch; - d7 = vld1_u8(s2); - s2 += pitch; - d8 = vld1_u8(s1); - s1 += pitch; - d9 = vld1_u8(s2); - s2 += pitch; - d10 = vld1_u8(s1); - s1 += pitch; - d11 = vld1_u8(s2); - s2 += pitch; - d12 = vld1_u8(s1); - s1 += pitch; - d13 = vld1_u8(s2); - s2 += pitch; - d14 = vld1_u8(s1); - s1 += pitch; - d15 = vld1_u8(s2); - s2 += pitch; - d16 = vld1_u8(s1); - s1 += pitch; - d17 = vld1_u8(s2); - s2 += pitch; - d18 = vld1_u8(s1); - s1 += pitch; - d19 = vld1_u8(s2); - s2 += pitch; - d20 = vld1_u8(s1); - d21 = vld1_u8(s2); - - q3 = vcombine_u8(d6, d7); - q4 = vcombine_u8(d8, d9); - q5 = vcombine_u8(d10, d11); - q6 = vcombine_u8(d12, d13); - q7 = vcombine_u8(d14, d15); - q8 = vcombine_u8(d16, d17); - q9 = vcombine_u8(d18, d19); - q10 = vcombine_u8(d20, d21); - - q2tmp0 = vtrnq_u32(vreinterpretq_u32_u8(q3), vreinterpretq_u32_u8(q7)); - q2tmp1 = vtrnq_u32(vreinterpretq_u32_u8(q4), vreinterpretq_u32_u8(q8)); - q2tmp2 = vtrnq_u32(vreinterpretq_u32_u8(q5), vreinterpretq_u32_u8(q9)); - q2tmp3 = vtrnq_u32(vreinterpretq_u32_u8(q6), vreinterpretq_u32_u8(q10)); - - q2tmp4 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp0.val[0]), - vreinterpretq_u16_u32(q2tmp2.val[0])); - q2tmp5 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp1.val[0]), - vreinterpretq_u16_u32(q2tmp3.val[0])); - q2tmp6 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp0.val[1]), - vreinterpretq_u16_u32(q2tmp2.val[1])); - q2tmp7 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp1.val[1]), - vreinterpretq_u16_u32(q2tmp3.val[1])); - - q2tmp8 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp4.val[0]), - vreinterpretq_u8_u16(q2tmp5.val[0])); - q2tmp9 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp4.val[1]), - vreinterpretq_u8_u16(q2tmp5.val[1])); - q2tmp10 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp6.val[0]), - vreinterpretq_u8_u16(q2tmp7.val[0])); - q2tmp11 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp6.val[1]), - vreinterpretq_u8_u16(q2tmp7.val[1])); - - q3 = q2tmp8.val[0]; - q4 = q2tmp8.val[1]; - q5 = q2tmp9.val[0]; - q6 = q2tmp9.val[1]; - q7 = q2tmp10.val[0]; - q8 = q2tmp10.val[1]; - q9 = q2tmp11.val[0]; - q10 = q2tmp11.val[1]; - - vp8_mbloop_filter_neon(qblimit, qlimit, qthresh, q3, q4, - q5, q6, q7, q8, q9, q10, - &q4, &q5, &q6, &q7, &q8, &q9); - - q2tmp0 = vtrnq_u32(vreinterpretq_u32_u8(q3), vreinterpretq_u32_u8(q7)); - q2tmp1 = vtrnq_u32(vreinterpretq_u32_u8(q4), vreinterpretq_u32_u8(q8)); - q2tmp2 = vtrnq_u32(vreinterpretq_u32_u8(q5), vreinterpretq_u32_u8(q9)); - q2tmp3 = vtrnq_u32(vreinterpretq_u32_u8(q6), vreinterpretq_u32_u8(q10)); - - q2tmp4 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp0.val[0]), - vreinterpretq_u16_u32(q2tmp2.val[0])); - q2tmp5 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp1.val[0]), - vreinterpretq_u16_u32(q2tmp3.val[0])); - q2tmp6 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp0.val[1]), - vreinterpretq_u16_u32(q2tmp2.val[1])); - q2tmp7 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp1.val[1]), - vreinterpretq_u16_u32(q2tmp3.val[1])); - - q2tmp8 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp4.val[0]), - vreinterpretq_u8_u16(q2tmp5.val[0])); - q2tmp9 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp4.val[1]), - vreinterpretq_u8_u16(q2tmp5.val[1])); - q2tmp10 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp6.val[0]), - vreinterpretq_u8_u16(q2tmp7.val[0])); - q2tmp11 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp6.val[1]), - vreinterpretq_u8_u16(q2tmp7.val[1])); - - q3 = q2tmp8.val[0]; - q4 = q2tmp8.val[1]; - q5 = q2tmp9.val[0]; - q6 = q2tmp9.val[1]; - q7 = q2tmp10.val[0]; - q8 = q2tmp10.val[1]; - q9 = q2tmp11.val[0]; - q10 = q2tmp11.val[1]; - - s1 -= 7 * pitch; - s2 -= 7 * pitch; - - vst1_u8(s1, vget_low_u8(q3)); - s1 += pitch; - vst1_u8(s2, vget_high_u8(q3)); - s2 += pitch; - vst1_u8(s1, vget_low_u8(q4)); - s1 += pitch; - vst1_u8(s2, vget_high_u8(q4)); - s2 += pitch; - vst1_u8(s1, vget_low_u8(q5)); - s1 += pitch; - vst1_u8(s2, vget_high_u8(q5)); - s2 += pitch; - vst1_u8(s1, vget_low_u8(q6)); - s1 += pitch; - vst1_u8(s2, vget_high_u8(q6)); - s2 += pitch; - vst1_u8(s1, vget_low_u8(q7)); - s1 += pitch; - vst1_u8(s2, vget_high_u8(q7)); - s2 += pitch; - vst1_u8(s1, vget_low_u8(q8)); - s1 += pitch; - vst1_u8(s2, vget_high_u8(q8)); - s2 += pitch; - vst1_u8(s1, vget_low_u8(q9)); - s1 += pitch; - vst1_u8(s2, vget_high_u8(q9)); - s2 += pitch; - vst1_u8(s1, vget_low_u8(q10)); - vst1_u8(s2, vget_high_u8(q10)); - return; -} - -void vp8_mbloop_filter_vertical_edge_uv_neon( - unsigned char *u, - int pitch, - unsigned char blimit, - unsigned char limit, - unsigned char thresh, - unsigned char *v) { - unsigned char *us, *ud; - unsigned char *vs, *vd; - uint8x16_t qblimit, qlimit, qthresh, q3, q4; - uint8x16_t q5, q6, q7, q8, q9, q10; - uint8x8_t d6, d7, d8, d9, d10, d11, d12, d13, d14; - uint8x8_t d15, d16, d17, d18, d19, d20, d21; - uint32x4x2_t q2tmp0, q2tmp1, q2tmp2, q2tmp3; - uint16x8x2_t q2tmp4, q2tmp5, q2tmp6, q2tmp7; - uint8x16x2_t q2tmp8, q2tmp9, q2tmp10, q2tmp11; - - qblimit = vdupq_n_u8(blimit); - qlimit = vdupq_n_u8(limit); - qthresh = vdupq_n_u8(thresh); - - us = u - 4; - vs = v - 4; - d6 = vld1_u8(us); - us += pitch; - d7 = vld1_u8(vs); - vs += pitch; - d8 = vld1_u8(us); - us += pitch; - d9 = vld1_u8(vs); - vs += pitch; - d10 = vld1_u8(us); - us += pitch; - d11 = vld1_u8(vs); - vs += pitch; - d12 = vld1_u8(us); - us += pitch; - d13 = vld1_u8(vs); - vs += pitch; - d14 = vld1_u8(us); - us += pitch; - d15 = vld1_u8(vs); - vs += pitch; - d16 = vld1_u8(us); - us += pitch; - d17 = vld1_u8(vs); - vs += pitch; - d18 = vld1_u8(us); - us += pitch; - d19 = vld1_u8(vs); - vs += pitch; - d20 = vld1_u8(us); - d21 = vld1_u8(vs); - - q3 = vcombine_u8(d6, d7); - q4 = vcombine_u8(d8, d9); - q5 = vcombine_u8(d10, d11); - q6 = vcombine_u8(d12, d13); - q7 = vcombine_u8(d14, d15); - q8 = vcombine_u8(d16, d17); - q9 = vcombine_u8(d18, d19); - q10 = vcombine_u8(d20, d21); - - q2tmp0 = vtrnq_u32(vreinterpretq_u32_u8(q3), vreinterpretq_u32_u8(q7)); - q2tmp1 = vtrnq_u32(vreinterpretq_u32_u8(q4), vreinterpretq_u32_u8(q8)); - q2tmp2 = vtrnq_u32(vreinterpretq_u32_u8(q5), vreinterpretq_u32_u8(q9)); - q2tmp3 = vtrnq_u32(vreinterpretq_u32_u8(q6), vreinterpretq_u32_u8(q10)); - - q2tmp4 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp0.val[0]), - vreinterpretq_u16_u32(q2tmp2.val[0])); - q2tmp5 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp1.val[0]), - vreinterpretq_u16_u32(q2tmp3.val[0])); - q2tmp6 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp0.val[1]), - vreinterpretq_u16_u32(q2tmp2.val[1])); - q2tmp7 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp1.val[1]), - vreinterpretq_u16_u32(q2tmp3.val[1])); - - q2tmp8 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp4.val[0]), - vreinterpretq_u8_u16(q2tmp5.val[0])); - q2tmp9 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp4.val[1]), - vreinterpretq_u8_u16(q2tmp5.val[1])); - q2tmp10 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp6.val[0]), - vreinterpretq_u8_u16(q2tmp7.val[0])); - q2tmp11 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp6.val[1]), - vreinterpretq_u8_u16(q2tmp7.val[1])); - - q3 = q2tmp8.val[0]; - q4 = q2tmp8.val[1]; - q5 = q2tmp9.val[0]; - q6 = q2tmp9.val[1]; - q7 = q2tmp10.val[0]; - q8 = q2tmp10.val[1]; - q9 = q2tmp11.val[0]; - q10 = q2tmp11.val[1]; - - vp8_mbloop_filter_neon(qblimit, qlimit, qthresh, q3, q4, - q5, q6, q7, q8, q9, q10, - &q4, &q5, &q6, &q7, &q8, &q9); - - q2tmp0 = vtrnq_u32(vreinterpretq_u32_u8(q3), vreinterpretq_u32_u8(q7)); - q2tmp1 = vtrnq_u32(vreinterpretq_u32_u8(q4), vreinterpretq_u32_u8(q8)); - q2tmp2 = vtrnq_u32(vreinterpretq_u32_u8(q5), vreinterpretq_u32_u8(q9)); - q2tmp3 = vtrnq_u32(vreinterpretq_u32_u8(q6), vreinterpretq_u32_u8(q10)); - - q2tmp4 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp0.val[0]), - vreinterpretq_u16_u32(q2tmp2.val[0])); - q2tmp5 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp1.val[0]), - vreinterpretq_u16_u32(q2tmp3.val[0])); - q2tmp6 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp0.val[1]), - vreinterpretq_u16_u32(q2tmp2.val[1])); - q2tmp7 = vtrnq_u16(vreinterpretq_u16_u32(q2tmp1.val[1]), - vreinterpretq_u16_u32(q2tmp3.val[1])); - - q2tmp8 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp4.val[0]), - vreinterpretq_u8_u16(q2tmp5.val[0])); - q2tmp9 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp4.val[1]), - vreinterpretq_u8_u16(q2tmp5.val[1])); - q2tmp10 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp6.val[0]), - vreinterpretq_u8_u16(q2tmp7.val[0])); - q2tmp11 = vtrnq_u8(vreinterpretq_u8_u16(q2tmp6.val[1]), - vreinterpretq_u8_u16(q2tmp7.val[1])); - - q3 = q2tmp8.val[0]; - q4 = q2tmp8.val[1]; - q5 = q2tmp9.val[0]; - q6 = q2tmp9.val[1]; - q7 = q2tmp10.val[0]; - q8 = q2tmp10.val[1]; - q9 = q2tmp11.val[0]; - q10 = q2tmp11.val[1]; - - ud = u - 4; - vst1_u8(ud, vget_low_u8(q3)); - ud += pitch; - vst1_u8(ud, vget_low_u8(q4)); - ud += pitch; - vst1_u8(ud, vget_low_u8(q5)); - ud += pitch; - vst1_u8(ud, vget_low_u8(q6)); - ud += pitch; - vst1_u8(ud, vget_low_u8(q7)); - ud += pitch; - vst1_u8(ud, vget_low_u8(q8)); - ud += pitch; - vst1_u8(ud, vget_low_u8(q9)); - ud += pitch; - vst1_u8(ud, vget_low_u8(q10)); - - vd = v - 4; - vst1_u8(vd, vget_high_u8(q3)); - vd += pitch; - vst1_u8(vd, vget_high_u8(q4)); - vd += pitch; - vst1_u8(vd, vget_high_u8(q5)); - vd += pitch; - vst1_u8(vd, vget_high_u8(q6)); - vd += pitch; - vst1_u8(vd, vget_high_u8(q7)); - vd += pitch; - vst1_u8(vd, vget_high_u8(q8)); - vd += pitch; - vst1_u8(vd, vget_high_u8(q9)); - vd += pitch; - vst1_u8(vd, vget_high_u8(q10)); - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/reconintra_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/reconintra_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/reconintra_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/reconintra_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,210 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "vp8/common/blockd.h" - -void vp8_build_intra_predictors_mby_s_neon(MACROBLOCKD *x, - unsigned char * yabove_row, - unsigned char * yleft, - int left_stride, - unsigned char * ypred_ptr, - int y_stride) { - const int mode = x->mode_info_context->mbmi.mode; - int i; - - switch (mode) { - case DC_PRED: - { - int shift = x->up_available + x->left_available; - uint8x16_t v_expected_dc = vdupq_n_u8(128); - - if (shift) { - unsigned int average = 0; - int expected_dc; - if (x->up_available) { - const uint8x16_t v_above = vld1q_u8(yabove_row); - const uint16x8_t a = vpaddlq_u8(v_above); - const uint32x4_t b = vpaddlq_u16(a); - const uint64x2_t c = vpaddlq_u32(b); - const uint32x2_t d = vadd_u32(vreinterpret_u32_u64(vget_low_u64(c)), - vreinterpret_u32_u64(vget_high_u64(c))); - average = vget_lane_u32(d, 0); - } - if (x->left_available) { - for (i = 0; i < 16; ++i) { - average += yleft[0]; - yleft += left_stride; - } - } - shift += 3; - expected_dc = (average + (1 << (shift - 1))) >> shift; - v_expected_dc = vmovq_n_u8((uint8_t)expected_dc); - } - for (i = 0; i < 16; ++i) { - vst1q_u8(ypred_ptr, v_expected_dc); - ypred_ptr += y_stride; - } - } - break; - case V_PRED: - { - const uint8x16_t v_above = vld1q_u8(yabove_row); - for (i = 0; i < 16; ++i) { - vst1q_u8(ypred_ptr, v_above); - ypred_ptr += y_stride; - } - } - break; - case H_PRED: - { - for (i = 0; i < 16; ++i) { - const uint8x16_t v_yleft = vmovq_n_u8((uint8_t)yleft[0]); - yleft += left_stride; - vst1q_u8(ypred_ptr, v_yleft); - ypred_ptr += y_stride; - } - } - break; - case TM_PRED: - { - const uint16x8_t v_ytop_left = vmovq_n_u16((int16_t)yabove_row[-1]); - const uint8x16_t v_above = vld1q_u8(yabove_row); - for (i = 0; i < 16; ++i) { - const uint8x8_t v_yleft = vmov_n_u8((int8_t)yleft[0]); - const uint16x8_t a_lo = vaddl_u8(vget_low_u8(v_above), v_yleft); - const uint16x8_t a_hi = vaddl_u8(vget_high_u8(v_above), v_yleft); - const int16x8_t b_lo = vsubq_s16(vreinterpretq_s16_u16(a_lo), - vreinterpretq_s16_u16(v_ytop_left)); - const int16x8_t b_hi = vsubq_s16(vreinterpretq_s16_u16(a_hi), - vreinterpretq_s16_u16(v_ytop_left)); - const uint8x8_t pred_lo = vqmovun_s16(b_lo); - const uint8x8_t pred_hi = vqmovun_s16(b_hi); - - vst1q_u8(ypred_ptr, vcombine_u8(pred_lo, pred_hi)); - ypred_ptr += y_stride; - yleft += left_stride; - } - } - break; - } -} - -void vp8_build_intra_predictors_mbuv_s_neon(MACROBLOCKD *x, - unsigned char * uabove_row, - unsigned char * vabove_row, - unsigned char * uleft, - unsigned char * vleft, - int left_stride, - unsigned char * upred_ptr, - unsigned char * vpred_ptr, - int pred_stride) { - const int mode = x->mode_info_context->mbmi.uv_mode; - int i; - - switch (mode) { - case DC_PRED: - { - int shift = x->up_available + x->left_available; - uint8x8_t v_expected_udc = vdup_n_u8(128); - uint8x8_t v_expected_vdc = vdup_n_u8(128); - - if (shift) { - unsigned int average_u = 0; - unsigned int average_v = 0; - int expected_udc; - int expected_vdc; - if (x->up_available) { - const uint8x8_t v_uabove = vld1_u8(uabove_row); - const uint8x8_t v_vabove = vld1_u8(vabove_row); - const uint16x8_t a = vpaddlq_u8(vcombine_u8(v_uabove, v_vabove)); - const uint32x4_t b = vpaddlq_u16(a); - const uint64x2_t c = vpaddlq_u32(b); - average_u = vgetq_lane_u32(vreinterpretq_u32_u64((c)), 0); - average_v = vgetq_lane_u32(vreinterpretq_u32_u64((c)), 2); - } - if (x->left_available) { - for (i = 0; i < 8; ++i) { - average_u += uleft[0]; - uleft += left_stride; - average_v += vleft[0]; - vleft += left_stride; - } - } - shift += 2; - expected_udc = (average_u + (1 << (shift - 1))) >> shift; - expected_vdc = (average_v + (1 << (shift - 1))) >> shift; - v_expected_udc = vmov_n_u8((uint8_t)expected_udc); - v_expected_vdc = vmov_n_u8((uint8_t)expected_vdc); - } - for (i = 0; i < 8; ++i) { - vst1_u8(upred_ptr, v_expected_udc); - upred_ptr += pred_stride; - vst1_u8(vpred_ptr, v_expected_vdc); - vpred_ptr += pred_stride; - } - } - break; - case V_PRED: - { - const uint8x8_t v_uabove = vld1_u8(uabove_row); - const uint8x8_t v_vabove = vld1_u8(vabove_row); - for (i = 0; i < 8; ++i) { - vst1_u8(upred_ptr, v_uabove); - upred_ptr += pred_stride; - vst1_u8(vpred_ptr, v_vabove); - vpred_ptr += pred_stride; - } - } - break; - case H_PRED: - { - for (i = 0; i < 8; ++i) { - const uint8x8_t v_uleft = vmov_n_u8((uint8_t)uleft[0]); - const uint8x8_t v_vleft = vmov_n_u8((uint8_t)vleft[0]); - uleft += left_stride; - vleft += left_stride; - vst1_u8(upred_ptr, v_uleft); - upred_ptr += pred_stride; - vst1_u8(vpred_ptr, v_vleft); - vpred_ptr += pred_stride; - } - } - break; - case TM_PRED: - { - const uint16x8_t v_utop_left = vmovq_n_u16((int16_t)uabove_row[-1]); - const uint16x8_t v_vtop_left = vmovq_n_u16((int16_t)vabove_row[-1]); - const uint8x8_t v_uabove = vld1_u8(uabove_row); - const uint8x8_t v_vabove = vld1_u8(vabove_row); - for (i = 0; i < 8; ++i) { - const uint8x8_t v_uleft = vmov_n_u8((int8_t)uleft[0]); - const uint8x8_t v_vleft = vmov_n_u8((int8_t)vleft[0]); - const uint16x8_t a_u = vaddl_u8(v_uabove, v_uleft); - const uint16x8_t a_v = vaddl_u8(v_vabove, v_vleft); - const int16x8_t b_u = vsubq_s16(vreinterpretq_s16_u16(a_u), - vreinterpretq_s16_u16(v_utop_left)); - const int16x8_t b_v = vsubq_s16(vreinterpretq_s16_u16(a_v), - vreinterpretq_s16_u16(v_vtop_left)); - const uint8x8_t pred_u = vqmovun_s16(b_u); - const uint8x8_t pred_v = vqmovun_s16(b_v); - - vst1_u8(upred_ptr, pred_u); - vst1_u8(vpred_ptr, pred_v); - upred_ptr += pred_stride; - vpred_ptr += pred_stride; - uleft += left_stride; - vleft += left_stride; - } - } - break; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/sad_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/sad_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/sad_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/sad_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,184 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -unsigned int vp8_sad8x8_neon( - unsigned char *src_ptr, - int src_stride, - unsigned char *ref_ptr, - int ref_stride) { - uint8x8_t d0, d8; - uint16x8_t q12; - uint32x4_t q1; - uint64x2_t q3; - uint32x2_t d5; - int i; - - d0 = vld1_u8(src_ptr); - src_ptr += src_stride; - d8 = vld1_u8(ref_ptr); - ref_ptr += ref_stride; - q12 = vabdl_u8(d0, d8); - - for (i = 0; i < 7; i++) { - d0 = vld1_u8(src_ptr); - src_ptr += src_stride; - d8 = vld1_u8(ref_ptr); - ref_ptr += ref_stride; - q12 = vabal_u8(q12, d0, d8); - } - - q1 = vpaddlq_u16(q12); - q3 = vpaddlq_u32(q1); - d5 = vadd_u32(vreinterpret_u32_u64(vget_low_u64(q3)), - vreinterpret_u32_u64(vget_high_u64(q3))); - - return vget_lane_u32(d5, 0); -} - -unsigned int vp8_sad8x16_neon( - unsigned char *src_ptr, - int src_stride, - unsigned char *ref_ptr, - int ref_stride) { - uint8x8_t d0, d8; - uint16x8_t q12; - uint32x4_t q1; - uint64x2_t q3; - uint32x2_t d5; - int i; - - d0 = vld1_u8(src_ptr); - src_ptr += src_stride; - d8 = vld1_u8(ref_ptr); - ref_ptr += ref_stride; - q12 = vabdl_u8(d0, d8); - - for (i = 0; i < 15; i++) { - d0 = vld1_u8(src_ptr); - src_ptr += src_stride; - d8 = vld1_u8(ref_ptr); - ref_ptr += ref_stride; - q12 = vabal_u8(q12, d0, d8); - } - - q1 = vpaddlq_u16(q12); - q3 = vpaddlq_u32(q1); - d5 = vadd_u32(vreinterpret_u32_u64(vget_low_u64(q3)), - vreinterpret_u32_u64(vget_high_u64(q3))); - - return vget_lane_u32(d5, 0); -} - -unsigned int vp8_sad4x4_neon( - unsigned char *src_ptr, - int src_stride, - unsigned char *ref_ptr, - int ref_stride) { - uint8x8_t d0, d8; - uint16x8_t q12; - uint32x2_t d1; - uint64x1_t d3; - int i; - - d0 = vld1_u8(src_ptr); - src_ptr += src_stride; - d8 = vld1_u8(ref_ptr); - ref_ptr += ref_stride; - q12 = vabdl_u8(d0, d8); - - for (i = 0; i < 3; i++) { - d0 = vld1_u8(src_ptr); - src_ptr += src_stride; - d8 = vld1_u8(ref_ptr); - ref_ptr += ref_stride; - q12 = vabal_u8(q12, d0, d8); - } - - d1 = vpaddl_u16(vget_low_u16(q12)); - d3 = vpaddl_u32(d1); - - return vget_lane_u32(vreinterpret_u32_u64(d3), 0); -} - -unsigned int vp8_sad16x16_neon( - unsigned char *src_ptr, - int src_stride, - unsigned char *ref_ptr, - int ref_stride) { - uint8x16_t q0, q4; - uint16x8_t q12, q13; - uint32x4_t q1; - uint64x2_t q3; - uint32x2_t d5; - int i; - - q0 = vld1q_u8(src_ptr); - src_ptr += src_stride; - q4 = vld1q_u8(ref_ptr); - ref_ptr += ref_stride; - q12 = vabdl_u8(vget_low_u8(q0), vget_low_u8(q4)); - q13 = vabdl_u8(vget_high_u8(q0), vget_high_u8(q4)); - - for (i = 0; i < 15; i++) { - q0 = vld1q_u8(src_ptr); - src_ptr += src_stride; - q4 = vld1q_u8(ref_ptr); - ref_ptr += ref_stride; - q12 = vabal_u8(q12, vget_low_u8(q0), vget_low_u8(q4)); - q13 = vabal_u8(q13, vget_high_u8(q0), vget_high_u8(q4)); - } - - q12 = vaddq_u16(q12, q13); - q1 = vpaddlq_u16(q12); - q3 = vpaddlq_u32(q1); - d5 = vadd_u32(vreinterpret_u32_u64(vget_low_u64(q3)), - vreinterpret_u32_u64(vget_high_u64(q3))); - - return vget_lane_u32(d5, 0); -} - -unsigned int vp8_sad16x8_neon( - unsigned char *src_ptr, - int src_stride, - unsigned char *ref_ptr, - int ref_stride) { - uint8x16_t q0, q4; - uint16x8_t q12, q13; - uint32x4_t q1; - uint64x2_t q3; - uint32x2_t d5; - int i; - - q0 = vld1q_u8(src_ptr); - src_ptr += src_stride; - q4 = vld1q_u8(ref_ptr); - ref_ptr += ref_stride; - q12 = vabdl_u8(vget_low_u8(q0), vget_low_u8(q4)); - q13 = vabdl_u8(vget_high_u8(q0), vget_high_u8(q4)); - - for (i = 0; i < 7; i++) { - q0 = vld1q_u8(src_ptr); - src_ptr += src_stride; - q4 = vld1q_u8(ref_ptr); - ref_ptr += ref_stride; - q12 = vabal_u8(q12, vget_low_u8(q0), vget_low_u8(q4)); - q13 = vabal_u8(q13, vget_high_u8(q0), vget_high_u8(q4)); - } - - q12 = vaddq_u16(q12, q13); - q1 = vpaddlq_u16(q12); - q3 = vpaddlq_u32(q1); - d5 = vadd_u32(vreinterpret_u32_u64(vget_low_u64(q3)), - vreinterpret_u32_u64(vget_high_u64(q3))); - - return vget_lane_u32(d5, 0); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/shortidct4x4llm_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/shortidct4x4llm_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/shortidct4x4llm_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/shortidct4x4llm_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -static const int16_t cospi8sqrt2minus1 = 20091; -static const int16_t sinpi8sqrt2 = 35468; - -void vp8_short_idct4x4llm_neon( - int16_t *input, - unsigned char *pred_ptr, - int pred_stride, - unsigned char *dst_ptr, - int dst_stride) { - int i; - uint32x2_t d6u32 = vdup_n_u32(0); - uint8x8_t d1u8; - int16x4_t d2, d3, d4, d5, d10, d11, d12, d13; - uint16x8_t q1u16; - int16x8_t q1s16, q2s16, q3s16, q4s16; - int32x2x2_t v2tmp0, v2tmp1; - int16x4x2_t v2tmp2, v2tmp3; - - d2 = vld1_s16(input); - d3 = vld1_s16(input + 4); - d4 = vld1_s16(input + 8); - d5 = vld1_s16(input + 12); - - // 1st for loop - q1s16 = vcombine_s16(d2, d4); // Swap d3 d4 here - q2s16 = vcombine_s16(d3, d5); - - q3s16 = vqdmulhq_n_s16(q2s16, sinpi8sqrt2); - q4s16 = vqdmulhq_n_s16(q2s16, cospi8sqrt2minus1); - - d12 = vqadd_s16(vget_low_s16(q1s16), vget_high_s16(q1s16)); // a1 - d13 = vqsub_s16(vget_low_s16(q1s16), vget_high_s16(q1s16)); // b1 - - q3s16 = vshrq_n_s16(q3s16, 1); - q4s16 = vshrq_n_s16(q4s16, 1); - - q3s16 = vqaddq_s16(q3s16, q2s16); - q4s16 = vqaddq_s16(q4s16, q2s16); - - d10 = vqsub_s16(vget_low_s16(q3s16), vget_high_s16(q4s16)); // c1 - d11 = vqadd_s16(vget_high_s16(q3s16), vget_low_s16(q4s16)); // d1 - - d2 = vqadd_s16(d12, d11); - d3 = vqadd_s16(d13, d10); - d4 = vqsub_s16(d13, d10); - d5 = vqsub_s16(d12, d11); - - v2tmp0 = vtrn_s32(vreinterpret_s32_s16(d2), vreinterpret_s32_s16(d4)); - v2tmp1 = vtrn_s32(vreinterpret_s32_s16(d3), vreinterpret_s32_s16(d5)); - v2tmp2 = vtrn_s16(vreinterpret_s16_s32(v2tmp0.val[0]), - vreinterpret_s16_s32(v2tmp1.val[0])); - v2tmp3 = vtrn_s16(vreinterpret_s16_s32(v2tmp0.val[1]), - vreinterpret_s16_s32(v2tmp1.val[1])); - - // 2nd for loop - q1s16 = vcombine_s16(v2tmp2.val[0], v2tmp3.val[0]); - q2s16 = vcombine_s16(v2tmp2.val[1], v2tmp3.val[1]); - - q3s16 = vqdmulhq_n_s16(q2s16, sinpi8sqrt2); - q4s16 = vqdmulhq_n_s16(q2s16, cospi8sqrt2minus1); - - d12 = vqadd_s16(vget_low_s16(q1s16), vget_high_s16(q1s16)); // a1 - d13 = vqsub_s16(vget_low_s16(q1s16), vget_high_s16(q1s16)); // b1 - - q3s16 = vshrq_n_s16(q3s16, 1); - q4s16 = vshrq_n_s16(q4s16, 1); - - q3s16 = vqaddq_s16(q3s16, q2s16); - q4s16 = vqaddq_s16(q4s16, q2s16); - - d10 = vqsub_s16(vget_low_s16(q3s16), vget_high_s16(q4s16)); // c1 - d11 = vqadd_s16(vget_high_s16(q3s16), vget_low_s16(q4s16)); // d1 - - d2 = vqadd_s16(d12, d11); - d3 = vqadd_s16(d13, d10); - d4 = vqsub_s16(d13, d10); - d5 = vqsub_s16(d12, d11); - - d2 = vrshr_n_s16(d2, 3); - d3 = vrshr_n_s16(d3, 3); - d4 = vrshr_n_s16(d4, 3); - d5 = vrshr_n_s16(d5, 3); - - v2tmp0 = vtrn_s32(vreinterpret_s32_s16(d2), vreinterpret_s32_s16(d4)); - v2tmp1 = vtrn_s32(vreinterpret_s32_s16(d3), vreinterpret_s32_s16(d5)); - v2tmp2 = vtrn_s16(vreinterpret_s16_s32(v2tmp0.val[0]), - vreinterpret_s16_s32(v2tmp1.val[0])); - v2tmp3 = vtrn_s16(vreinterpret_s16_s32(v2tmp0.val[1]), - vreinterpret_s16_s32(v2tmp1.val[1])); - - q1s16 = vcombine_s16(v2tmp2.val[0], v2tmp2.val[1]); - q2s16 = vcombine_s16(v2tmp3.val[0], v2tmp3.val[1]); - - // dc_only_idct_add - for (i = 0; i < 2; i++, q1s16 = q2s16) { - d6u32 = vld1_lane_u32((const uint32_t *)pred_ptr, d6u32, 0); - pred_ptr += pred_stride; - d6u32 = vld1_lane_u32((const uint32_t *)pred_ptr, d6u32, 1); - pred_ptr += pred_stride; - - q1u16 = vaddw_u8(vreinterpretq_u16_s16(q1s16), - vreinterpret_u8_u32(d6u32)); - d1u8 = vqmovun_s16(vreinterpretq_s16_u16(q1u16)); - - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d1u8), 0); - dst_ptr += dst_stride; - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d1u8), 1); - dst_ptr += dst_stride; - } - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/sixtappredict_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/sixtappredict_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/sixtappredict_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/sixtappredict_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1754 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "vpx_ports/mem.h" - -static const int8_t vp8_sub_pel_filters[8][8] = { - {0, 0, 128, 0, 0, 0, 0, 0}, /* note that 1/8 pel positionyys are */ - {0, -6, 123, 12, -1, 0, 0, 0}, /* just as per alpha -0.5 bicubic */ - {2, -11, 108, 36, -8, 1, 0, 0}, /* New 1/4 pel 6 tap filter */ - {0, -9, 93, 50, -6, 0, 0, 0}, - {3, -16, 77, 77, -16, 3, 0, 0}, /* New 1/2 pel 6 tap filter */ - {0, -6, 50, 93, -9, 0, 0, 0}, - {1, -8, 36, 108, -11, 2, 0, 0}, /* New 1/4 pel 6 tap filter */ - {0, -1, 12, 123, -6, 0, 0, 0}, -}; - -void vp8_sixtap_predict4x4_neon( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch) { - unsigned char *src; - uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8, d18u8, d19u8, d20u8, d21u8; - uint8x8_t d23u8, d24u8, d25u8, d26u8, d27u8, d28u8, d29u8, d30u8, d31u8; - int8x8_t dtmps8, d0s8, d1s8, d2s8, d3s8, d4s8, d5s8; - uint16x8_t q3u16, q4u16, q5u16, q6u16, q7u16; - uint16x8_t q8u16, q9u16, q10u16, q11u16, q12u16; - int16x8_t q3s16, q4s16, q5s16, q6s16, q7s16; - int16x8_t q8s16, q9s16, q10s16, q11s16, q12s16; - uint8x16_t q3u8, q4u8, q5u8, q6u8, q11u8; - uint64x2_t q3u64, q4u64, q5u64, q6u64, q9u64, q10u64; - uint32x2x2_t d0u32x2, d1u32x2; - - if (xoffset == 0) { // secondpass_filter4x4_only - uint32x2_t d27u32 = vdup_n_u32(0); - uint32x2_t d28u32 = vdup_n_u32(0); - uint32x2_t d29u32 = vdup_n_u32(0); - uint32x2_t d30u32 = vdup_n_u32(0); - uint32x2_t d31u32 = vdup_n_u32(0); - - // load second_pass filter - dtmps8 = vld1_s8(vp8_sub_pel_filters[yoffset]); - d0s8 = vdup_lane_s8(dtmps8, 0); - d1s8 = vdup_lane_s8(dtmps8, 1); - d2s8 = vdup_lane_s8(dtmps8, 2); - d3s8 = vdup_lane_s8(dtmps8, 3); - d4s8 = vdup_lane_s8(dtmps8, 4); - d5s8 = vdup_lane_s8(dtmps8, 5); - d0u8 = vreinterpret_u8_s8(vabs_s8(d0s8)); - d1u8 = vreinterpret_u8_s8(vabs_s8(d1s8)); - d2u8 = vreinterpret_u8_s8(vabs_s8(d2s8)); - d3u8 = vreinterpret_u8_s8(vabs_s8(d3s8)); - d4u8 = vreinterpret_u8_s8(vabs_s8(d4s8)); - d5u8 = vreinterpret_u8_s8(vabs_s8(d5s8)); - - // load src data - src = src_ptr - src_pixels_per_line * 2; - d27u32 = vld1_lane_u32((const uint32_t *)src, d27u32, 0); - src += src_pixels_per_line; - d27u32 = vld1_lane_u32((const uint32_t *)src, d27u32, 1); - src += src_pixels_per_line; - d28u32 = vld1_lane_u32((const uint32_t *)src, d28u32, 0); - src += src_pixels_per_line; - d28u32 = vld1_lane_u32((const uint32_t *)src, d28u32, 1); - src += src_pixels_per_line; - d29u32 = vld1_lane_u32((const uint32_t *)src, d29u32, 0); - src += src_pixels_per_line; - d29u32 = vld1_lane_u32((const uint32_t *)src, d29u32, 1); - src += src_pixels_per_line; - d30u32 = vld1_lane_u32((const uint32_t *)src, d30u32, 0); - src += src_pixels_per_line; - d30u32 = vld1_lane_u32((const uint32_t *)src, d30u32, 1); - src += src_pixels_per_line; - d31u32 = vld1_lane_u32((const uint32_t *)src, d31u32, 0); - - d27u8 = vreinterpret_u8_u32(d27u32); - d28u8 = vreinterpret_u8_u32(d28u32); - d29u8 = vreinterpret_u8_u32(d29u32); - d30u8 = vreinterpret_u8_u32(d30u32); - d31u8 = vreinterpret_u8_u32(d31u32); - - d23u8 = vext_u8(d27u8, d28u8, 4); - d24u8 = vext_u8(d28u8, d29u8, 4); - d25u8 = vext_u8(d29u8, d30u8, 4); - d26u8 = vext_u8(d30u8, d31u8, 4); - - q3u16 = vmull_u8(d27u8, d0u8); - q4u16 = vmull_u8(d28u8, d0u8); - q5u16 = vmull_u8(d25u8, d5u8); - q6u16 = vmull_u8(d26u8, d5u8); - - q3u16 = vmlsl_u8(q3u16, d29u8, d4u8); - q4u16 = vmlsl_u8(q4u16, d30u8, d4u8); - q5u16 = vmlsl_u8(q5u16, d23u8, d1u8); - q6u16 = vmlsl_u8(q6u16, d24u8, d1u8); - - q3u16 = vmlal_u8(q3u16, d28u8, d2u8); - q4u16 = vmlal_u8(q4u16, d29u8, d2u8); - q5u16 = vmlal_u8(q5u16, d24u8, d3u8); - q6u16 = vmlal_u8(q6u16, d25u8, d3u8); - - q3s16 = vreinterpretq_s16_u16(q3u16); - q4s16 = vreinterpretq_s16_u16(q4u16); - q5s16 = vreinterpretq_s16_u16(q5u16); - q6s16 = vreinterpretq_s16_u16(q6u16); - - q5s16 = vqaddq_s16(q5s16, q3s16); - q6s16 = vqaddq_s16(q6s16, q4s16); - - d3u8 = vqrshrun_n_s16(q5s16, 7); - d4u8 = vqrshrun_n_s16(q6s16, 7); - - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d3u8), 0); - dst_ptr += dst_pitch; - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d3u8), 1); - dst_ptr += dst_pitch; - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d4u8), 0); - dst_ptr += dst_pitch; - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d4u8), 1); - return; - } - - // load first_pass filter - dtmps8 = vld1_s8(vp8_sub_pel_filters[xoffset]); - d0s8 = vdup_lane_s8(dtmps8, 0); - d1s8 = vdup_lane_s8(dtmps8, 1); - d2s8 = vdup_lane_s8(dtmps8, 2); - d3s8 = vdup_lane_s8(dtmps8, 3); - d4s8 = vdup_lane_s8(dtmps8, 4); - d5s8 = vdup_lane_s8(dtmps8, 5); - d0u8 = vreinterpret_u8_s8(vabs_s8(d0s8)); - d1u8 = vreinterpret_u8_s8(vabs_s8(d1s8)); - d2u8 = vreinterpret_u8_s8(vabs_s8(d2s8)); - d3u8 = vreinterpret_u8_s8(vabs_s8(d3s8)); - d4u8 = vreinterpret_u8_s8(vabs_s8(d4s8)); - d5u8 = vreinterpret_u8_s8(vabs_s8(d5s8)); - - // First pass: output_height lines x output_width columns (9x4) - - if (yoffset == 0) // firstpass_filter4x4_only - src = src_ptr - 2; - else - src = src_ptr - 2 - (src_pixels_per_line * 2); - - q3u8 = vld1q_u8(src); - src += src_pixels_per_line; - q4u8 = vld1q_u8(src); - src += src_pixels_per_line; - q5u8 = vld1q_u8(src); - src += src_pixels_per_line; - q6u8 = vld1q_u8(src); - src += src_pixels_per_line; - - d18u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 5); - d19u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 5); - d20u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 5); - d21u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 5); - - // vswp here - q3u8 = vcombine_u8(vget_low_u8(q3u8), vget_low_u8(q4u8)); - q5u8 = vcombine_u8(vget_low_u8(q5u8), vget_low_u8(q6u8)); - - d0u32x2 = vzip_u32(vreinterpret_u32_u8(d18u8), // d18 d19 - vreinterpret_u32_u8(d19u8)); - d1u32x2 = vzip_u32(vreinterpret_u32_u8(d20u8), // d20 d21 - vreinterpret_u32_u8(d21u8)); - q7u16 = vmull_u8(vreinterpret_u8_u32(d0u32x2.val[0]), d5u8); - q8u16 = vmull_u8(vreinterpret_u8_u32(d1u32x2.val[0]), d5u8); - - // keep original src data in q4 q6 - q4u64 = vreinterpretq_u64_u8(q3u8); - q6u64 = vreinterpretq_u64_u8(q5u8); - - d0u32x2 = vzip_u32(vreinterpret_u32_u8(vget_low_u8(q3u8)), // d6 d7 - vreinterpret_u32_u8(vget_high_u8(q3u8))); - d1u32x2 = vzip_u32(vreinterpret_u32_u8(vget_low_u8(q5u8)), // d10 d11 - vreinterpret_u32_u8(vget_high_u8(q5u8))); - q9u64 = vshrq_n_u64(q4u64, 8); - q10u64 = vshrq_n_u64(q6u64, 8); - q7u16 = vmlal_u8(q7u16, vreinterpret_u8_u32(d0u32x2.val[0]), d0u8); - q8u16 = vmlal_u8(q8u16, vreinterpret_u8_u32(d1u32x2.val[0]), d0u8); - - d0u32x2 = vzip_u32(vreinterpret_u32_u64(vget_low_u64(q9u64)), // d18 d19 - vreinterpret_u32_u64(vget_high_u64(q9u64))); - d1u32x2 = vzip_u32(vreinterpret_u32_u64(vget_low_u64(q10u64)), // d20 d211 - vreinterpret_u32_u64(vget_high_u64(q10u64))); - q3u64 = vshrq_n_u64(q4u64, 32); - q5u64 = vshrq_n_u64(q6u64, 32); - q7u16 = vmlsl_u8(q7u16, vreinterpret_u8_u32(d0u32x2.val[0]), d1u8); - q8u16 = vmlsl_u8(q8u16, vreinterpret_u8_u32(d1u32x2.val[0]), d1u8); - - d0u32x2 = vzip_u32(vreinterpret_u32_u64(vget_low_u64(q3u64)), // d6 d7 - vreinterpret_u32_u64(vget_high_u64(q3u64))); - d1u32x2 = vzip_u32(vreinterpret_u32_u64(vget_low_u64(q5u64)), // d10 d11 - vreinterpret_u32_u64(vget_high_u64(q5u64))); - q9u64 = vshrq_n_u64(q4u64, 16); - q10u64 = vshrq_n_u64(q6u64, 16); - q7u16 = vmlsl_u8(q7u16, vreinterpret_u8_u32(d0u32x2.val[0]), d4u8); - q8u16 = vmlsl_u8(q8u16, vreinterpret_u8_u32(d1u32x2.val[0]), d4u8); - - d0u32x2 = vzip_u32(vreinterpret_u32_u64(vget_low_u64(q9u64)), // d18 d19 - vreinterpret_u32_u64(vget_high_u64(q9u64))); - d1u32x2 = vzip_u32(vreinterpret_u32_u64(vget_low_u64(q10u64)), // d20 d211 - vreinterpret_u32_u64(vget_high_u64(q10u64))); - q3u64 = vshrq_n_u64(q4u64, 24); - q5u64 = vshrq_n_u64(q6u64, 24); - q7u16 = vmlal_u8(q7u16, vreinterpret_u8_u32(d0u32x2.val[0]), d2u8); - q8u16 = vmlal_u8(q8u16, vreinterpret_u8_u32(d1u32x2.val[0]), d2u8); - - d0u32x2 = vzip_u32(vreinterpret_u32_u64(vget_low_u64(q3u64)), // d6 d7 - vreinterpret_u32_u64(vget_high_u64(q3u64))); - d1u32x2 = vzip_u32(vreinterpret_u32_u64(vget_low_u64(q5u64)), // d10 d11 - vreinterpret_u32_u64(vget_high_u64(q5u64))); - q9u16 = vmull_u8(vreinterpret_u8_u32(d0u32x2.val[0]), d3u8); - q10u16 = vmull_u8(vreinterpret_u8_u32(d1u32x2.val[0]), d3u8); - - q7s16 = vreinterpretq_s16_u16(q7u16); - q8s16 = vreinterpretq_s16_u16(q8u16); - q9s16 = vreinterpretq_s16_u16(q9u16); - q10s16 = vreinterpretq_s16_u16(q10u16); - q7s16 = vqaddq_s16(q7s16, q9s16); - q8s16 = vqaddq_s16(q8s16, q10s16); - - d27u8 = vqrshrun_n_s16(q7s16, 7); - d28u8 = vqrshrun_n_s16(q8s16, 7); - - if (yoffset == 0) { // firstpass_filter4x4_only - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d27u8), 0); - dst_ptr += dst_pitch; - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d27u8), 1); - dst_ptr += dst_pitch; - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d28u8), 0); - dst_ptr += dst_pitch; - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d28u8), 1); - return; - } - - // First Pass on rest 5-line data - q3u8 = vld1q_u8(src); - src += src_pixels_per_line; - q4u8 = vld1q_u8(src); - src += src_pixels_per_line; - q5u8 = vld1q_u8(src); - src += src_pixels_per_line; - q6u8 = vld1q_u8(src); - src += src_pixels_per_line; - q11u8 = vld1q_u8(src); - - d18u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 5); - d19u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 5); - d20u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 5); - d21u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 5); - - // vswp here - q3u8 = vcombine_u8(vget_low_u8(q3u8), vget_low_u8(q4u8)); - q5u8 = vcombine_u8(vget_low_u8(q5u8), vget_low_u8(q6u8)); - - d0u32x2 = vzip_u32(vreinterpret_u32_u8(d18u8), // d18 d19 - vreinterpret_u32_u8(d19u8)); - d1u32x2 = vzip_u32(vreinterpret_u32_u8(d20u8), // d20 d21 - vreinterpret_u32_u8(d21u8)); - d31u8 = vext_u8(vget_low_u8(q11u8), vget_high_u8(q11u8), 5); - q7u16 = vmull_u8(vreinterpret_u8_u32(d0u32x2.val[0]), d5u8); - q8u16 = vmull_u8(vreinterpret_u8_u32(d1u32x2.val[0]), d5u8); - q12u16 = vmull_u8(d31u8, d5u8); - - q4u64 = vreinterpretq_u64_u8(q3u8); - q6u64 = vreinterpretq_u64_u8(q5u8); - - d0u32x2 = vzip_u32(vreinterpret_u32_u8(vget_low_u8(q3u8)), // d6 d7 - vreinterpret_u32_u8(vget_high_u8(q3u8))); - d1u32x2 = vzip_u32(vreinterpret_u32_u8(vget_low_u8(q5u8)), // d10 d11 - vreinterpret_u32_u8(vget_high_u8(q5u8))); - q9u64 = vshrq_n_u64(q4u64, 8); - q10u64 = vshrq_n_u64(q6u64, 8); - q7u16 = vmlal_u8(q7u16, vreinterpret_u8_u32(d0u32x2.val[0]), d0u8); - q8u16 = vmlal_u8(q8u16, vreinterpret_u8_u32(d1u32x2.val[0]), d0u8); - q12u16 = vmlal_u8(q12u16, vget_low_u8(q11u8), d0u8); - - d0u32x2 = vzip_u32(vreinterpret_u32_u64(vget_low_u64(q9u64)), // d18 d19 - vreinterpret_u32_u64(vget_high_u64(q9u64))); - d1u32x2 = vzip_u32(vreinterpret_u32_u64(vget_low_u64(q10u64)), // d20 d211 - vreinterpret_u32_u64(vget_high_u64(q10u64))); - q3u64 = vshrq_n_u64(q4u64, 32); - q5u64 = vshrq_n_u64(q6u64, 32); - d31u8 = vext_u8(vget_low_u8(q11u8), vget_high_u8(q11u8), 1); - q7u16 = vmlsl_u8(q7u16, vreinterpret_u8_u32(d0u32x2.val[0]), d1u8); - q8u16 = vmlsl_u8(q8u16, vreinterpret_u8_u32(d1u32x2.val[0]), d1u8); - q12u16 = vmlsl_u8(q12u16, d31u8, d1u8); - - d0u32x2 = vzip_u32(vreinterpret_u32_u64(vget_low_u64(q3u64)), // d6 d7 - vreinterpret_u32_u64(vget_high_u64(q3u64))); - d1u32x2 = vzip_u32(vreinterpret_u32_u64(vget_low_u64(q5u64)), // d10 d11 - vreinterpret_u32_u64(vget_high_u64(q5u64))); - q9u64 = vshrq_n_u64(q4u64, 16); - q10u64 = vshrq_n_u64(q6u64, 16); - d31u8 = vext_u8(vget_low_u8(q11u8), vget_high_u8(q11u8), 4); - q7u16 = vmlsl_u8(q7u16, vreinterpret_u8_u32(d0u32x2.val[0]), d4u8); - q8u16 = vmlsl_u8(q8u16, vreinterpret_u8_u32(d1u32x2.val[0]), d4u8); - q12u16 = vmlsl_u8(q12u16, d31u8, d4u8); - - d0u32x2 = vzip_u32(vreinterpret_u32_u64(vget_low_u64(q9u64)), // d18 d19 - vreinterpret_u32_u64(vget_high_u64(q9u64))); - d1u32x2 = vzip_u32(vreinterpret_u32_u64(vget_low_u64(q10u64)), // d20 d211 - vreinterpret_u32_u64(vget_high_u64(q10u64))); - q3u64 = vshrq_n_u64(q4u64, 24); - q5u64 = vshrq_n_u64(q6u64, 24); - d31u8 = vext_u8(vget_low_u8(q11u8), vget_high_u8(q11u8), 2); - q7u16 = vmlal_u8(q7u16, vreinterpret_u8_u32(d0u32x2.val[0]), d2u8); - q8u16 = vmlal_u8(q8u16, vreinterpret_u8_u32(d1u32x2.val[0]), d2u8); - q12u16 = vmlal_u8(q12u16, d31u8, d2u8); - - d0u32x2 = vzip_u32(vreinterpret_u32_u64(vget_low_u64(q3u64)), // d6 d7 - vreinterpret_u32_u64(vget_high_u64(q3u64))); - d1u32x2 = vzip_u32(vreinterpret_u32_u64(vget_low_u64(q5u64)), // d10 d11 - vreinterpret_u32_u64(vget_high_u64(q5u64))); - d31u8 = vext_u8(vget_low_u8(q11u8), vget_high_u8(q11u8), 3); - q9u16 = vmull_u8(vreinterpret_u8_u32(d0u32x2.val[0]), d3u8); - q10u16 = vmull_u8(vreinterpret_u8_u32(d1u32x2.val[0]), d3u8); - q11u16 = vmull_u8(d31u8, d3u8); - - q7s16 = vreinterpretq_s16_u16(q7u16); - q8s16 = vreinterpretq_s16_u16(q8u16); - q9s16 = vreinterpretq_s16_u16(q9u16); - q10s16 = vreinterpretq_s16_u16(q10u16); - q11s16 = vreinterpretq_s16_u16(q11u16); - q12s16 = vreinterpretq_s16_u16(q12u16); - q7s16 = vqaddq_s16(q7s16, q9s16); - q8s16 = vqaddq_s16(q8s16, q10s16); - q12s16 = vqaddq_s16(q12s16, q11s16); - - d29u8 = vqrshrun_n_s16(q7s16, 7); - d30u8 = vqrshrun_n_s16(q8s16, 7); - d31u8 = vqrshrun_n_s16(q12s16, 7); - - // Second pass: 4x4 - dtmps8 = vld1_s8(vp8_sub_pel_filters[yoffset]); - d0s8 = vdup_lane_s8(dtmps8, 0); - d1s8 = vdup_lane_s8(dtmps8, 1); - d2s8 = vdup_lane_s8(dtmps8, 2); - d3s8 = vdup_lane_s8(dtmps8, 3); - d4s8 = vdup_lane_s8(dtmps8, 4); - d5s8 = vdup_lane_s8(dtmps8, 5); - d0u8 = vreinterpret_u8_s8(vabs_s8(d0s8)); - d1u8 = vreinterpret_u8_s8(vabs_s8(d1s8)); - d2u8 = vreinterpret_u8_s8(vabs_s8(d2s8)); - d3u8 = vreinterpret_u8_s8(vabs_s8(d3s8)); - d4u8 = vreinterpret_u8_s8(vabs_s8(d4s8)); - d5u8 = vreinterpret_u8_s8(vabs_s8(d5s8)); - - d23u8 = vext_u8(d27u8, d28u8, 4); - d24u8 = vext_u8(d28u8, d29u8, 4); - d25u8 = vext_u8(d29u8, d30u8, 4); - d26u8 = vext_u8(d30u8, d31u8, 4); - - q3u16 = vmull_u8(d27u8, d0u8); - q4u16 = vmull_u8(d28u8, d0u8); - q5u16 = vmull_u8(d25u8, d5u8); - q6u16 = vmull_u8(d26u8, d5u8); - - q3u16 = vmlsl_u8(q3u16, d29u8, d4u8); - q4u16 = vmlsl_u8(q4u16, d30u8, d4u8); - q5u16 = vmlsl_u8(q5u16, d23u8, d1u8); - q6u16 = vmlsl_u8(q6u16, d24u8, d1u8); - - q3u16 = vmlal_u8(q3u16, d28u8, d2u8); - q4u16 = vmlal_u8(q4u16, d29u8, d2u8); - q5u16 = vmlal_u8(q5u16, d24u8, d3u8); - q6u16 = vmlal_u8(q6u16, d25u8, d3u8); - - q3s16 = vreinterpretq_s16_u16(q3u16); - q4s16 = vreinterpretq_s16_u16(q4u16); - q5s16 = vreinterpretq_s16_u16(q5u16); - q6s16 = vreinterpretq_s16_u16(q6u16); - - q5s16 = vqaddq_s16(q5s16, q3s16); - q6s16 = vqaddq_s16(q6s16, q4s16); - - d3u8 = vqrshrun_n_s16(q5s16, 7); - d4u8 = vqrshrun_n_s16(q6s16, 7); - - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d3u8), 0); - dst_ptr += dst_pitch; - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d3u8), 1); - dst_ptr += dst_pitch; - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d4u8), 0); - dst_ptr += dst_pitch; - vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d4u8), 1); - return; -} - -void vp8_sixtap_predict8x4_neon( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch) { - unsigned char *src; - uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8, d6u8, d7u8, d8u8, d9u8; - uint8x8_t d22u8, d23u8, d24u8, d25u8, d26u8; - uint8x8_t d27u8, d28u8, d29u8, d30u8, d31u8; - int8x8_t dtmps8, d0s8, d1s8, d2s8, d3s8, d4s8, d5s8; - uint16x8_t q3u16, q4u16, q5u16, q6u16, q7u16; - uint16x8_t q8u16, q9u16, q10u16, q11u16, q12u16; - int16x8_t q3s16, q4s16, q5s16, q6s16, q7s16; - int16x8_t q8s16, q9s16, q10s16, q11s16, q12s16; - uint8x16_t q3u8, q4u8, q5u8, q6u8, q7u8; - - if (xoffset == 0) { // secondpass_filter8x4_only - // load second_pass filter - dtmps8 = vld1_s8(vp8_sub_pel_filters[yoffset]); - d0s8 = vdup_lane_s8(dtmps8, 0); - d1s8 = vdup_lane_s8(dtmps8, 1); - d2s8 = vdup_lane_s8(dtmps8, 2); - d3s8 = vdup_lane_s8(dtmps8, 3); - d4s8 = vdup_lane_s8(dtmps8, 4); - d5s8 = vdup_lane_s8(dtmps8, 5); - d0u8 = vreinterpret_u8_s8(vabs_s8(d0s8)); - d1u8 = vreinterpret_u8_s8(vabs_s8(d1s8)); - d2u8 = vreinterpret_u8_s8(vabs_s8(d2s8)); - d3u8 = vreinterpret_u8_s8(vabs_s8(d3s8)); - d4u8 = vreinterpret_u8_s8(vabs_s8(d4s8)); - d5u8 = vreinterpret_u8_s8(vabs_s8(d5s8)); - - // load src data - src = src_ptr - src_pixels_per_line * 2; - d22u8 = vld1_u8(src); - src += src_pixels_per_line; - d23u8 = vld1_u8(src); - src += src_pixels_per_line; - d24u8 = vld1_u8(src); - src += src_pixels_per_line; - d25u8 = vld1_u8(src); - src += src_pixels_per_line; - d26u8 = vld1_u8(src); - src += src_pixels_per_line; - d27u8 = vld1_u8(src); - src += src_pixels_per_line; - d28u8 = vld1_u8(src); - src += src_pixels_per_line; - d29u8 = vld1_u8(src); - src += src_pixels_per_line; - d30u8 = vld1_u8(src); - - q3u16 = vmull_u8(d22u8, d0u8); - q4u16 = vmull_u8(d23u8, d0u8); - q5u16 = vmull_u8(d24u8, d0u8); - q6u16 = vmull_u8(d25u8, d0u8); - - q3u16 = vmlsl_u8(q3u16, d23u8, d1u8); - q4u16 = vmlsl_u8(q4u16, d24u8, d1u8); - q5u16 = vmlsl_u8(q5u16, d25u8, d1u8); - q6u16 = vmlsl_u8(q6u16, d26u8, d1u8); - - q3u16 = vmlsl_u8(q3u16, d26u8, d4u8); - q4u16 = vmlsl_u8(q4u16, d27u8, d4u8); - q5u16 = vmlsl_u8(q5u16, d28u8, d4u8); - q6u16 = vmlsl_u8(q6u16, d29u8, d4u8); - - q3u16 = vmlal_u8(q3u16, d24u8, d2u8); - q4u16 = vmlal_u8(q4u16, d25u8, d2u8); - q5u16 = vmlal_u8(q5u16, d26u8, d2u8); - q6u16 = vmlal_u8(q6u16, d27u8, d2u8); - - q3u16 = vmlal_u8(q3u16, d27u8, d5u8); - q4u16 = vmlal_u8(q4u16, d28u8, d5u8); - q5u16 = vmlal_u8(q5u16, d29u8, d5u8); - q6u16 = vmlal_u8(q6u16, d30u8, d5u8); - - q7u16 = vmull_u8(d25u8, d3u8); - q8u16 = vmull_u8(d26u8, d3u8); - q9u16 = vmull_u8(d27u8, d3u8); - q10u16 = vmull_u8(d28u8, d3u8); - - q3s16 = vreinterpretq_s16_u16(q3u16); - q4s16 = vreinterpretq_s16_u16(q4u16); - q5s16 = vreinterpretq_s16_u16(q5u16); - q6s16 = vreinterpretq_s16_u16(q6u16); - q7s16 = vreinterpretq_s16_u16(q7u16); - q8s16 = vreinterpretq_s16_u16(q8u16); - q9s16 = vreinterpretq_s16_u16(q9u16); - q10s16 = vreinterpretq_s16_u16(q10u16); - - q7s16 = vqaddq_s16(q7s16, q3s16); - q8s16 = vqaddq_s16(q8s16, q4s16); - q9s16 = vqaddq_s16(q9s16, q5s16); - q10s16 = vqaddq_s16(q10s16, q6s16); - - d6u8 = vqrshrun_n_s16(q7s16, 7); - d7u8 = vqrshrun_n_s16(q8s16, 7); - d8u8 = vqrshrun_n_s16(q9s16, 7); - d9u8 = vqrshrun_n_s16(q10s16, 7); - - vst1_u8(dst_ptr, d6u8); - dst_ptr += dst_pitch; - vst1_u8(dst_ptr, d7u8); - dst_ptr += dst_pitch; - vst1_u8(dst_ptr, d8u8); - dst_ptr += dst_pitch; - vst1_u8(dst_ptr, d9u8); - return; - } - - // load first_pass filter - dtmps8 = vld1_s8(vp8_sub_pel_filters[xoffset]); - d0s8 = vdup_lane_s8(dtmps8, 0); - d1s8 = vdup_lane_s8(dtmps8, 1); - d2s8 = vdup_lane_s8(dtmps8, 2); - d3s8 = vdup_lane_s8(dtmps8, 3); - d4s8 = vdup_lane_s8(dtmps8, 4); - d5s8 = vdup_lane_s8(dtmps8, 5); - d0u8 = vreinterpret_u8_s8(vabs_s8(d0s8)); - d1u8 = vreinterpret_u8_s8(vabs_s8(d1s8)); - d2u8 = vreinterpret_u8_s8(vabs_s8(d2s8)); - d3u8 = vreinterpret_u8_s8(vabs_s8(d3s8)); - d4u8 = vreinterpret_u8_s8(vabs_s8(d4s8)); - d5u8 = vreinterpret_u8_s8(vabs_s8(d5s8)); - - // First pass: output_height lines x output_width columns (9x4) - if (yoffset == 0) // firstpass_filter4x4_only - src = src_ptr - 2; - else - src = src_ptr - 2 - (src_pixels_per_line * 2); - q3u8 = vld1q_u8(src); - src += src_pixels_per_line; - q4u8 = vld1q_u8(src); - src += src_pixels_per_line; - q5u8 = vld1q_u8(src); - src += src_pixels_per_line; - q6u8 = vld1q_u8(src); - - q7u16 = vmull_u8(vget_low_u8(q3u8), d0u8); - q8u16 = vmull_u8(vget_low_u8(q4u8), d0u8); - q9u16 = vmull_u8(vget_low_u8(q5u8), d0u8); - q10u16 = vmull_u8(vget_low_u8(q6u8), d0u8); - - d28u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 1); - d29u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 1); - d30u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 1); - d31u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 1); - - q7u16 = vmlsl_u8(q7u16, d28u8, d1u8); - q8u16 = vmlsl_u8(q8u16, d29u8, d1u8); - q9u16 = vmlsl_u8(q9u16, d30u8, d1u8); - q10u16 = vmlsl_u8(q10u16, d31u8, d1u8); - - d28u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 4); - d29u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 4); - d30u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 4); - d31u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 4); - - q7u16 = vmlsl_u8(q7u16, d28u8, d4u8); - q8u16 = vmlsl_u8(q8u16, d29u8, d4u8); - q9u16 = vmlsl_u8(q9u16, d30u8, d4u8); - q10u16 = vmlsl_u8(q10u16, d31u8, d4u8); - - d28u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 2); - d29u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 2); - d30u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 2); - d31u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 2); - - q7u16 = vmlal_u8(q7u16, d28u8, d2u8); - q8u16 = vmlal_u8(q8u16, d29u8, d2u8); - q9u16 = vmlal_u8(q9u16, d30u8, d2u8); - q10u16 = vmlal_u8(q10u16, d31u8, d2u8); - - d28u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 5); - d29u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 5); - d30u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 5); - d31u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 5); - - q7u16 = vmlal_u8(q7u16, d28u8, d5u8); - q8u16 = vmlal_u8(q8u16, d29u8, d5u8); - q9u16 = vmlal_u8(q9u16, d30u8, d5u8); - q10u16 = vmlal_u8(q10u16, d31u8, d5u8); - - d28u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 3); - d29u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 3); - d30u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 3); - d31u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 3); - - q3u16 = vmull_u8(d28u8, d3u8); - q4u16 = vmull_u8(d29u8, d3u8); - q5u16 = vmull_u8(d30u8, d3u8); - q6u16 = vmull_u8(d31u8, d3u8); - - q3s16 = vreinterpretq_s16_u16(q3u16); - q4s16 = vreinterpretq_s16_u16(q4u16); - q5s16 = vreinterpretq_s16_u16(q5u16); - q6s16 = vreinterpretq_s16_u16(q6u16); - q7s16 = vreinterpretq_s16_u16(q7u16); - q8s16 = vreinterpretq_s16_u16(q8u16); - q9s16 = vreinterpretq_s16_u16(q9u16); - q10s16 = vreinterpretq_s16_u16(q10u16); - - q7s16 = vqaddq_s16(q7s16, q3s16); - q8s16 = vqaddq_s16(q8s16, q4s16); - q9s16 = vqaddq_s16(q9s16, q5s16); - q10s16 = vqaddq_s16(q10s16, q6s16); - - d22u8 = vqrshrun_n_s16(q7s16, 7); - d23u8 = vqrshrun_n_s16(q8s16, 7); - d24u8 = vqrshrun_n_s16(q9s16, 7); - d25u8 = vqrshrun_n_s16(q10s16, 7); - - if (yoffset == 0) { // firstpass_filter8x4_only - vst1_u8(dst_ptr, d22u8); - dst_ptr += dst_pitch; - vst1_u8(dst_ptr, d23u8); - dst_ptr += dst_pitch; - vst1_u8(dst_ptr, d24u8); - dst_ptr += dst_pitch; - vst1_u8(dst_ptr, d25u8); - return; - } - - // First Pass on rest 5-line data - src += src_pixels_per_line; - q3u8 = vld1q_u8(src); - src += src_pixels_per_line; - q4u8 = vld1q_u8(src); - src += src_pixels_per_line; - q5u8 = vld1q_u8(src); - src += src_pixels_per_line; - q6u8 = vld1q_u8(src); - src += src_pixels_per_line; - q7u8 = vld1q_u8(src); - - q8u16 = vmull_u8(vget_low_u8(q3u8), d0u8); - q9u16 = vmull_u8(vget_low_u8(q4u8), d0u8); - q10u16 = vmull_u8(vget_low_u8(q5u8), d0u8); - q11u16 = vmull_u8(vget_low_u8(q6u8), d0u8); - q12u16 = vmull_u8(vget_low_u8(q7u8), d0u8); - - d27u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 1); - d28u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 1); - d29u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 1); - d30u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 1); - d31u8 = vext_u8(vget_low_u8(q7u8), vget_high_u8(q7u8), 1); - - q8u16 = vmlsl_u8(q8u16, d27u8, d1u8); - q9u16 = vmlsl_u8(q9u16, d28u8, d1u8); - q10u16 = vmlsl_u8(q10u16, d29u8, d1u8); - q11u16 = vmlsl_u8(q11u16, d30u8, d1u8); - q12u16 = vmlsl_u8(q12u16, d31u8, d1u8); - - d27u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 4); - d28u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 4); - d29u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 4); - d30u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 4); - d31u8 = vext_u8(vget_low_u8(q7u8), vget_high_u8(q7u8), 4); - - q8u16 = vmlsl_u8(q8u16, d27u8, d4u8); - q9u16 = vmlsl_u8(q9u16, d28u8, d4u8); - q10u16 = vmlsl_u8(q10u16, d29u8, d4u8); - q11u16 = vmlsl_u8(q11u16, d30u8, d4u8); - q12u16 = vmlsl_u8(q12u16, d31u8, d4u8); - - d27u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 2); - d28u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 2); - d29u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 2); - d30u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 2); - d31u8 = vext_u8(vget_low_u8(q7u8), vget_high_u8(q7u8), 2); - - q8u16 = vmlal_u8(q8u16, d27u8, d2u8); - q9u16 = vmlal_u8(q9u16, d28u8, d2u8); - q10u16 = vmlal_u8(q10u16, d29u8, d2u8); - q11u16 = vmlal_u8(q11u16, d30u8, d2u8); - q12u16 = vmlal_u8(q12u16, d31u8, d2u8); - - d27u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 5); - d28u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 5); - d29u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 5); - d30u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 5); - d31u8 = vext_u8(vget_low_u8(q7u8), vget_high_u8(q7u8), 5); - - q8u16 = vmlal_u8(q8u16, d27u8, d5u8); - q9u16 = vmlal_u8(q9u16, d28u8, d5u8); - q10u16 = vmlal_u8(q10u16, d29u8, d5u8); - q11u16 = vmlal_u8(q11u16, d30u8, d5u8); - q12u16 = vmlal_u8(q12u16, d31u8, d5u8); - - d27u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 3); - d28u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 3); - d29u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 3); - d30u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 3); - d31u8 = vext_u8(vget_low_u8(q7u8), vget_high_u8(q7u8), 3); - - q3u16 = vmull_u8(d27u8, d3u8); - q4u16 = vmull_u8(d28u8, d3u8); - q5u16 = vmull_u8(d29u8, d3u8); - q6u16 = vmull_u8(d30u8, d3u8); - q7u16 = vmull_u8(d31u8, d3u8); - - q3s16 = vreinterpretq_s16_u16(q3u16); - q4s16 = vreinterpretq_s16_u16(q4u16); - q5s16 = vreinterpretq_s16_u16(q5u16); - q6s16 = vreinterpretq_s16_u16(q6u16); - q7s16 = vreinterpretq_s16_u16(q7u16); - q8s16 = vreinterpretq_s16_u16(q8u16); - q9s16 = vreinterpretq_s16_u16(q9u16); - q10s16 = vreinterpretq_s16_u16(q10u16); - q11s16 = vreinterpretq_s16_u16(q11u16); - q12s16 = vreinterpretq_s16_u16(q12u16); - - q8s16 = vqaddq_s16(q8s16, q3s16); - q9s16 = vqaddq_s16(q9s16, q4s16); - q10s16 = vqaddq_s16(q10s16, q5s16); - q11s16 = vqaddq_s16(q11s16, q6s16); - q12s16 = vqaddq_s16(q12s16, q7s16); - - d26u8 = vqrshrun_n_s16(q8s16, 7); - d27u8 = vqrshrun_n_s16(q9s16, 7); - d28u8 = vqrshrun_n_s16(q10s16, 7); - d29u8 = vqrshrun_n_s16(q11s16, 7); - d30u8 = vqrshrun_n_s16(q12s16, 7); - - // Second pass: 8x4 - dtmps8 = vld1_s8(vp8_sub_pel_filters[yoffset]); - d0s8 = vdup_lane_s8(dtmps8, 0); - d1s8 = vdup_lane_s8(dtmps8, 1); - d2s8 = vdup_lane_s8(dtmps8, 2); - d3s8 = vdup_lane_s8(dtmps8, 3); - d4s8 = vdup_lane_s8(dtmps8, 4); - d5s8 = vdup_lane_s8(dtmps8, 5); - d0u8 = vreinterpret_u8_s8(vabs_s8(d0s8)); - d1u8 = vreinterpret_u8_s8(vabs_s8(d1s8)); - d2u8 = vreinterpret_u8_s8(vabs_s8(d2s8)); - d3u8 = vreinterpret_u8_s8(vabs_s8(d3s8)); - d4u8 = vreinterpret_u8_s8(vabs_s8(d4s8)); - d5u8 = vreinterpret_u8_s8(vabs_s8(d5s8)); - - q3u16 = vmull_u8(d22u8, d0u8); - q4u16 = vmull_u8(d23u8, d0u8); - q5u16 = vmull_u8(d24u8, d0u8); - q6u16 = vmull_u8(d25u8, d0u8); - - q3u16 = vmlsl_u8(q3u16, d23u8, d1u8); - q4u16 = vmlsl_u8(q4u16, d24u8, d1u8); - q5u16 = vmlsl_u8(q5u16, d25u8, d1u8); - q6u16 = vmlsl_u8(q6u16, d26u8, d1u8); - - q3u16 = vmlsl_u8(q3u16, d26u8, d4u8); - q4u16 = vmlsl_u8(q4u16, d27u8, d4u8); - q5u16 = vmlsl_u8(q5u16, d28u8, d4u8); - q6u16 = vmlsl_u8(q6u16, d29u8, d4u8); - - q3u16 = vmlal_u8(q3u16, d24u8, d2u8); - q4u16 = vmlal_u8(q4u16, d25u8, d2u8); - q5u16 = vmlal_u8(q5u16, d26u8, d2u8); - q6u16 = vmlal_u8(q6u16, d27u8, d2u8); - - q3u16 = vmlal_u8(q3u16, d27u8, d5u8); - q4u16 = vmlal_u8(q4u16, d28u8, d5u8); - q5u16 = vmlal_u8(q5u16, d29u8, d5u8); - q6u16 = vmlal_u8(q6u16, d30u8, d5u8); - - q7u16 = vmull_u8(d25u8, d3u8); - q8u16 = vmull_u8(d26u8, d3u8); - q9u16 = vmull_u8(d27u8, d3u8); - q10u16 = vmull_u8(d28u8, d3u8); - - q3s16 = vreinterpretq_s16_u16(q3u16); - q4s16 = vreinterpretq_s16_u16(q4u16); - q5s16 = vreinterpretq_s16_u16(q5u16); - q6s16 = vreinterpretq_s16_u16(q6u16); - q7s16 = vreinterpretq_s16_u16(q7u16); - q8s16 = vreinterpretq_s16_u16(q8u16); - q9s16 = vreinterpretq_s16_u16(q9u16); - q10s16 = vreinterpretq_s16_u16(q10u16); - - q7s16 = vqaddq_s16(q7s16, q3s16); - q8s16 = vqaddq_s16(q8s16, q4s16); - q9s16 = vqaddq_s16(q9s16, q5s16); - q10s16 = vqaddq_s16(q10s16, q6s16); - - d6u8 = vqrshrun_n_s16(q7s16, 7); - d7u8 = vqrshrun_n_s16(q8s16, 7); - d8u8 = vqrshrun_n_s16(q9s16, 7); - d9u8 = vqrshrun_n_s16(q10s16, 7); - - vst1_u8(dst_ptr, d6u8); - dst_ptr += dst_pitch; - vst1_u8(dst_ptr, d7u8); - dst_ptr += dst_pitch; - vst1_u8(dst_ptr, d8u8); - dst_ptr += dst_pitch; - vst1_u8(dst_ptr, d9u8); - return; -} - -void vp8_sixtap_predict8x8_neon( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch) { - unsigned char *src, *tmpp; - unsigned char tmp[64]; - int i; - uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8, d6u8, d7u8, d8u8, d9u8; - uint8x8_t d18u8, d19u8, d20u8, d21u8, d22u8, d23u8, d24u8, d25u8; - uint8x8_t d26u8, d27u8, d28u8, d29u8, d30u8, d31u8; - int8x8_t dtmps8, d0s8, d1s8, d2s8, d3s8, d4s8, d5s8; - uint16x8_t q3u16, q4u16, q5u16, q6u16, q7u16; - uint16x8_t q8u16, q9u16, q10u16, q11u16, q12u16; - int16x8_t q3s16, q4s16, q5s16, q6s16, q7s16; - int16x8_t q8s16, q9s16, q10s16, q11s16, q12s16; - uint8x16_t q3u8, q4u8, q5u8, q6u8, q7u8, q9u8, q10u8, q11u8, q12u8; - - if (xoffset == 0) { // secondpass_filter8x8_only - // load second_pass filter - dtmps8 = vld1_s8(vp8_sub_pel_filters[yoffset]); - d0s8 = vdup_lane_s8(dtmps8, 0); - d1s8 = vdup_lane_s8(dtmps8, 1); - d2s8 = vdup_lane_s8(dtmps8, 2); - d3s8 = vdup_lane_s8(dtmps8, 3); - d4s8 = vdup_lane_s8(dtmps8, 4); - d5s8 = vdup_lane_s8(dtmps8, 5); - d0u8 = vreinterpret_u8_s8(vabs_s8(d0s8)); - d1u8 = vreinterpret_u8_s8(vabs_s8(d1s8)); - d2u8 = vreinterpret_u8_s8(vabs_s8(d2s8)); - d3u8 = vreinterpret_u8_s8(vabs_s8(d3s8)); - d4u8 = vreinterpret_u8_s8(vabs_s8(d4s8)); - d5u8 = vreinterpret_u8_s8(vabs_s8(d5s8)); - - // load src data - src = src_ptr - src_pixels_per_line * 2; - d18u8 = vld1_u8(src); - src += src_pixels_per_line; - d19u8 = vld1_u8(src); - src += src_pixels_per_line; - d20u8 = vld1_u8(src); - src += src_pixels_per_line; - d21u8 = vld1_u8(src); - src += src_pixels_per_line; - d22u8 = vld1_u8(src); - src += src_pixels_per_line; - d23u8 = vld1_u8(src); - src += src_pixels_per_line; - d24u8 = vld1_u8(src); - src += src_pixels_per_line; - d25u8 = vld1_u8(src); - src += src_pixels_per_line; - d26u8 = vld1_u8(src); - src += src_pixels_per_line; - d27u8 = vld1_u8(src); - src += src_pixels_per_line; - d28u8 = vld1_u8(src); - src += src_pixels_per_line; - d29u8 = vld1_u8(src); - src += src_pixels_per_line; - d30u8 = vld1_u8(src); - - for (i = 2; i > 0; i--) { - q3u16 = vmull_u8(d18u8, d0u8); - q4u16 = vmull_u8(d19u8, d0u8); - q5u16 = vmull_u8(d20u8, d0u8); - q6u16 = vmull_u8(d21u8, d0u8); - - q3u16 = vmlsl_u8(q3u16, d19u8, d1u8); - q4u16 = vmlsl_u8(q4u16, d20u8, d1u8); - q5u16 = vmlsl_u8(q5u16, d21u8, d1u8); - q6u16 = vmlsl_u8(q6u16, d22u8, d1u8); - - q3u16 = vmlsl_u8(q3u16, d22u8, d4u8); - q4u16 = vmlsl_u8(q4u16, d23u8, d4u8); - q5u16 = vmlsl_u8(q5u16, d24u8, d4u8); - q6u16 = vmlsl_u8(q6u16, d25u8, d4u8); - - q3u16 = vmlal_u8(q3u16, d20u8, d2u8); - q4u16 = vmlal_u8(q4u16, d21u8, d2u8); - q5u16 = vmlal_u8(q5u16, d22u8, d2u8); - q6u16 = vmlal_u8(q6u16, d23u8, d2u8); - - q3u16 = vmlal_u8(q3u16, d23u8, d5u8); - q4u16 = vmlal_u8(q4u16, d24u8, d5u8); - q5u16 = vmlal_u8(q5u16, d25u8, d5u8); - q6u16 = vmlal_u8(q6u16, d26u8, d5u8); - - q7u16 = vmull_u8(d21u8, d3u8); - q8u16 = vmull_u8(d22u8, d3u8); - q9u16 = vmull_u8(d23u8, d3u8); - q10u16 = vmull_u8(d24u8, d3u8); - - q3s16 = vreinterpretq_s16_u16(q3u16); - q4s16 = vreinterpretq_s16_u16(q4u16); - q5s16 = vreinterpretq_s16_u16(q5u16); - q6s16 = vreinterpretq_s16_u16(q6u16); - q7s16 = vreinterpretq_s16_u16(q7u16); - q8s16 = vreinterpretq_s16_u16(q8u16); - q9s16 = vreinterpretq_s16_u16(q9u16); - q10s16 = vreinterpretq_s16_u16(q10u16); - - q7s16 = vqaddq_s16(q7s16, q3s16); - q8s16 = vqaddq_s16(q8s16, q4s16); - q9s16 = vqaddq_s16(q9s16, q5s16); - q10s16 = vqaddq_s16(q10s16, q6s16); - - d6u8 = vqrshrun_n_s16(q7s16, 7); - d7u8 = vqrshrun_n_s16(q8s16, 7); - d8u8 = vqrshrun_n_s16(q9s16, 7); - d9u8 = vqrshrun_n_s16(q10s16, 7); - - d18u8 = d22u8; - d19u8 = d23u8; - d20u8 = d24u8; - d21u8 = d25u8; - d22u8 = d26u8; - d23u8 = d27u8; - d24u8 = d28u8; - d25u8 = d29u8; - d26u8 = d30u8; - - vst1_u8(dst_ptr, d6u8); - dst_ptr += dst_pitch; - vst1_u8(dst_ptr, d7u8); - dst_ptr += dst_pitch; - vst1_u8(dst_ptr, d8u8); - dst_ptr += dst_pitch; - vst1_u8(dst_ptr, d9u8); - dst_ptr += dst_pitch; - } - return; - } - - // load first_pass filter - dtmps8 = vld1_s8(vp8_sub_pel_filters[xoffset]); - d0s8 = vdup_lane_s8(dtmps8, 0); - d1s8 = vdup_lane_s8(dtmps8, 1); - d2s8 = vdup_lane_s8(dtmps8, 2); - d3s8 = vdup_lane_s8(dtmps8, 3); - d4s8 = vdup_lane_s8(dtmps8, 4); - d5s8 = vdup_lane_s8(dtmps8, 5); - d0u8 = vreinterpret_u8_s8(vabs_s8(d0s8)); - d1u8 = vreinterpret_u8_s8(vabs_s8(d1s8)); - d2u8 = vreinterpret_u8_s8(vabs_s8(d2s8)); - d3u8 = vreinterpret_u8_s8(vabs_s8(d3s8)); - d4u8 = vreinterpret_u8_s8(vabs_s8(d4s8)); - d5u8 = vreinterpret_u8_s8(vabs_s8(d5s8)); - - // First pass: output_height lines x output_width columns (9x4) - if (yoffset == 0) // firstpass_filter4x4_only - src = src_ptr - 2; - else - src = src_ptr - 2 - (src_pixels_per_line * 2); - - tmpp = tmp; - for (i = 2; i > 0; i--) { - q3u8 = vld1q_u8(src); - src += src_pixels_per_line; - q4u8 = vld1q_u8(src); - src += src_pixels_per_line; - q5u8 = vld1q_u8(src); - src += src_pixels_per_line; - q6u8 = vld1q_u8(src); - src += src_pixels_per_line; - - __builtin_prefetch(src); - __builtin_prefetch(src + src_pixels_per_line); - __builtin_prefetch(src + src_pixels_per_line * 2); - - q7u16 = vmull_u8(vget_low_u8(q3u8), d0u8); - q8u16 = vmull_u8(vget_low_u8(q4u8), d0u8); - q9u16 = vmull_u8(vget_low_u8(q5u8), d0u8); - q10u16 = vmull_u8(vget_low_u8(q6u8), d0u8); - - d28u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 1); - d29u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 1); - d30u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 1); - d31u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 1); - - q7u16 = vmlsl_u8(q7u16, d28u8, d1u8); - q8u16 = vmlsl_u8(q8u16, d29u8, d1u8); - q9u16 = vmlsl_u8(q9u16, d30u8, d1u8); - q10u16 = vmlsl_u8(q10u16, d31u8, d1u8); - - d28u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 4); - d29u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 4); - d30u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 4); - d31u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 4); - - q7u16 = vmlsl_u8(q7u16, d28u8, d4u8); - q8u16 = vmlsl_u8(q8u16, d29u8, d4u8); - q9u16 = vmlsl_u8(q9u16, d30u8, d4u8); - q10u16 = vmlsl_u8(q10u16, d31u8, d4u8); - - d28u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 2); - d29u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 2); - d30u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 2); - d31u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 2); - - q7u16 = vmlal_u8(q7u16, d28u8, d2u8); - q8u16 = vmlal_u8(q8u16, d29u8, d2u8); - q9u16 = vmlal_u8(q9u16, d30u8, d2u8); - q10u16 = vmlal_u8(q10u16, d31u8, d2u8); - - d28u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 5); - d29u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 5); - d30u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 5); - d31u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 5); - - q7u16 = vmlal_u8(q7u16, d28u8, d5u8); - q8u16 = vmlal_u8(q8u16, d29u8, d5u8); - q9u16 = vmlal_u8(q9u16, d30u8, d5u8); - q10u16 = vmlal_u8(q10u16, d31u8, d5u8); - - d28u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 3); - d29u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 3); - d30u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 3); - d31u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 3); - - q3u16 = vmull_u8(d28u8, d3u8); - q4u16 = vmull_u8(d29u8, d3u8); - q5u16 = vmull_u8(d30u8, d3u8); - q6u16 = vmull_u8(d31u8, d3u8); - - q3s16 = vreinterpretq_s16_u16(q3u16); - q4s16 = vreinterpretq_s16_u16(q4u16); - q5s16 = vreinterpretq_s16_u16(q5u16); - q6s16 = vreinterpretq_s16_u16(q6u16); - q7s16 = vreinterpretq_s16_u16(q7u16); - q8s16 = vreinterpretq_s16_u16(q8u16); - q9s16 = vreinterpretq_s16_u16(q9u16); - q10s16 = vreinterpretq_s16_u16(q10u16); - - q7s16 = vqaddq_s16(q7s16, q3s16); - q8s16 = vqaddq_s16(q8s16, q4s16); - q9s16 = vqaddq_s16(q9s16, q5s16); - q10s16 = vqaddq_s16(q10s16, q6s16); - - d22u8 = vqrshrun_n_s16(q7s16, 7); - d23u8 = vqrshrun_n_s16(q8s16, 7); - d24u8 = vqrshrun_n_s16(q9s16, 7); - d25u8 = vqrshrun_n_s16(q10s16, 7); - - if (yoffset == 0) { // firstpass_filter8x4_only - vst1_u8(dst_ptr, d22u8); - dst_ptr += dst_pitch; - vst1_u8(dst_ptr, d23u8); - dst_ptr += dst_pitch; - vst1_u8(dst_ptr, d24u8); - dst_ptr += dst_pitch; - vst1_u8(dst_ptr, d25u8); - dst_ptr += dst_pitch; - } else { - vst1_u8(tmpp, d22u8); - tmpp += 8; - vst1_u8(tmpp, d23u8); - tmpp += 8; - vst1_u8(tmpp, d24u8); - tmpp += 8; - vst1_u8(tmpp, d25u8); - tmpp += 8; - } - } - if (yoffset == 0) - return; - - // First Pass on rest 5-line data - q3u8 = vld1q_u8(src); - src += src_pixels_per_line; - q4u8 = vld1q_u8(src); - src += src_pixels_per_line; - q5u8 = vld1q_u8(src); - src += src_pixels_per_line; - q6u8 = vld1q_u8(src); - src += src_pixels_per_line; - q7u8 = vld1q_u8(src); - - q8u16 = vmull_u8(vget_low_u8(q3u8), d0u8); - q9u16 = vmull_u8(vget_low_u8(q4u8), d0u8); - q10u16 = vmull_u8(vget_low_u8(q5u8), d0u8); - q11u16 = vmull_u8(vget_low_u8(q6u8), d0u8); - q12u16 = vmull_u8(vget_low_u8(q7u8), d0u8); - - d27u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 1); - d28u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 1); - d29u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 1); - d30u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 1); - d31u8 = vext_u8(vget_low_u8(q7u8), vget_high_u8(q7u8), 1); - - q8u16 = vmlsl_u8(q8u16, d27u8, d1u8); - q9u16 = vmlsl_u8(q9u16, d28u8, d1u8); - q10u16 = vmlsl_u8(q10u16, d29u8, d1u8); - q11u16 = vmlsl_u8(q11u16, d30u8, d1u8); - q12u16 = vmlsl_u8(q12u16, d31u8, d1u8); - - d27u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 4); - d28u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 4); - d29u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 4); - d30u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 4); - d31u8 = vext_u8(vget_low_u8(q7u8), vget_high_u8(q7u8), 4); - - q8u16 = vmlsl_u8(q8u16, d27u8, d4u8); - q9u16 = vmlsl_u8(q9u16, d28u8, d4u8); - q10u16 = vmlsl_u8(q10u16, d29u8, d4u8); - q11u16 = vmlsl_u8(q11u16, d30u8, d4u8); - q12u16 = vmlsl_u8(q12u16, d31u8, d4u8); - - d27u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 2); - d28u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 2); - d29u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 2); - d30u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 2); - d31u8 = vext_u8(vget_low_u8(q7u8), vget_high_u8(q7u8), 2); - - q8u16 = vmlal_u8(q8u16, d27u8, d2u8); - q9u16 = vmlal_u8(q9u16, d28u8, d2u8); - q10u16 = vmlal_u8(q10u16, d29u8, d2u8); - q11u16 = vmlal_u8(q11u16, d30u8, d2u8); - q12u16 = vmlal_u8(q12u16, d31u8, d2u8); - - d27u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 5); - d28u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 5); - d29u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 5); - d30u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 5); - d31u8 = vext_u8(vget_low_u8(q7u8), vget_high_u8(q7u8), 5); - - q8u16 = vmlal_u8(q8u16, d27u8, d5u8); - q9u16 = vmlal_u8(q9u16, d28u8, d5u8); - q10u16 = vmlal_u8(q10u16, d29u8, d5u8); - q11u16 = vmlal_u8(q11u16, d30u8, d5u8); - q12u16 = vmlal_u8(q12u16, d31u8, d5u8); - - d27u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 3); - d28u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 3); - d29u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 3); - d30u8 = vext_u8(vget_low_u8(q6u8), vget_high_u8(q6u8), 3); - d31u8 = vext_u8(vget_low_u8(q7u8), vget_high_u8(q7u8), 3); - - q3u16 = vmull_u8(d27u8, d3u8); - q4u16 = vmull_u8(d28u8, d3u8); - q5u16 = vmull_u8(d29u8, d3u8); - q6u16 = vmull_u8(d30u8, d3u8); - q7u16 = vmull_u8(d31u8, d3u8); - - q3s16 = vreinterpretq_s16_u16(q3u16); - q4s16 = vreinterpretq_s16_u16(q4u16); - q5s16 = vreinterpretq_s16_u16(q5u16); - q6s16 = vreinterpretq_s16_u16(q6u16); - q7s16 = vreinterpretq_s16_u16(q7u16); - q8s16 = vreinterpretq_s16_u16(q8u16); - q9s16 = vreinterpretq_s16_u16(q9u16); - q10s16 = vreinterpretq_s16_u16(q10u16); - q11s16 = vreinterpretq_s16_u16(q11u16); - q12s16 = vreinterpretq_s16_u16(q12u16); - - q8s16 = vqaddq_s16(q8s16, q3s16); - q9s16 = vqaddq_s16(q9s16, q4s16); - q10s16 = vqaddq_s16(q10s16, q5s16); - q11s16 = vqaddq_s16(q11s16, q6s16); - q12s16 = vqaddq_s16(q12s16, q7s16); - - d26u8 = vqrshrun_n_s16(q8s16, 7); - d27u8 = vqrshrun_n_s16(q9s16, 7); - d28u8 = vqrshrun_n_s16(q10s16, 7); - d29u8 = vqrshrun_n_s16(q11s16, 7); - d30u8 = vqrshrun_n_s16(q12s16, 7); - - // Second pass: 8x8 - dtmps8 = vld1_s8(vp8_sub_pel_filters[yoffset]); - d0s8 = vdup_lane_s8(dtmps8, 0); - d1s8 = vdup_lane_s8(dtmps8, 1); - d2s8 = vdup_lane_s8(dtmps8, 2); - d3s8 = vdup_lane_s8(dtmps8, 3); - d4s8 = vdup_lane_s8(dtmps8, 4); - d5s8 = vdup_lane_s8(dtmps8, 5); - d0u8 = vreinterpret_u8_s8(vabs_s8(d0s8)); - d1u8 = vreinterpret_u8_s8(vabs_s8(d1s8)); - d2u8 = vreinterpret_u8_s8(vabs_s8(d2s8)); - d3u8 = vreinterpret_u8_s8(vabs_s8(d3s8)); - d4u8 = vreinterpret_u8_s8(vabs_s8(d4s8)); - d5u8 = vreinterpret_u8_s8(vabs_s8(d5s8)); - - tmpp = tmp; - q9u8 = vld1q_u8(tmpp); - tmpp += 16; - q10u8 = vld1q_u8(tmpp); - tmpp += 16; - q11u8 = vld1q_u8(tmpp); - tmpp += 16; - q12u8 = vld1q_u8(tmpp); - - d18u8 = vget_low_u8(q9u8); - d19u8 = vget_high_u8(q9u8); - d20u8 = vget_low_u8(q10u8); - d21u8 = vget_high_u8(q10u8); - d22u8 = vget_low_u8(q11u8); - d23u8 = vget_high_u8(q11u8); - d24u8 = vget_low_u8(q12u8); - d25u8 = vget_high_u8(q12u8); - - for (i = 2; i > 0; i--) { - q3u16 = vmull_u8(d18u8, d0u8); - q4u16 = vmull_u8(d19u8, d0u8); - q5u16 = vmull_u8(d20u8, d0u8); - q6u16 = vmull_u8(d21u8, d0u8); - - q3u16 = vmlsl_u8(q3u16, d19u8, d1u8); - q4u16 = vmlsl_u8(q4u16, d20u8, d1u8); - q5u16 = vmlsl_u8(q5u16, d21u8, d1u8); - q6u16 = vmlsl_u8(q6u16, d22u8, d1u8); - - q3u16 = vmlsl_u8(q3u16, d22u8, d4u8); - q4u16 = vmlsl_u8(q4u16, d23u8, d4u8); - q5u16 = vmlsl_u8(q5u16, d24u8, d4u8); - q6u16 = vmlsl_u8(q6u16, d25u8, d4u8); - - q3u16 = vmlal_u8(q3u16, d20u8, d2u8); - q4u16 = vmlal_u8(q4u16, d21u8, d2u8); - q5u16 = vmlal_u8(q5u16, d22u8, d2u8); - q6u16 = vmlal_u8(q6u16, d23u8, d2u8); - - q3u16 = vmlal_u8(q3u16, d23u8, d5u8); - q4u16 = vmlal_u8(q4u16, d24u8, d5u8); - q5u16 = vmlal_u8(q5u16, d25u8, d5u8); - q6u16 = vmlal_u8(q6u16, d26u8, d5u8); - - q7u16 = vmull_u8(d21u8, d3u8); - q8u16 = vmull_u8(d22u8, d3u8); - q9u16 = vmull_u8(d23u8, d3u8); - q10u16 = vmull_u8(d24u8, d3u8); - - q3s16 = vreinterpretq_s16_u16(q3u16); - q4s16 = vreinterpretq_s16_u16(q4u16); - q5s16 = vreinterpretq_s16_u16(q5u16); - q6s16 = vreinterpretq_s16_u16(q6u16); - q7s16 = vreinterpretq_s16_u16(q7u16); - q8s16 = vreinterpretq_s16_u16(q8u16); - q9s16 = vreinterpretq_s16_u16(q9u16); - q10s16 = vreinterpretq_s16_u16(q10u16); - - q7s16 = vqaddq_s16(q7s16, q3s16); - q8s16 = vqaddq_s16(q8s16, q4s16); - q9s16 = vqaddq_s16(q9s16, q5s16); - q10s16 = vqaddq_s16(q10s16, q6s16); - - d6u8 = vqrshrun_n_s16(q7s16, 7); - d7u8 = vqrshrun_n_s16(q8s16, 7); - d8u8 = vqrshrun_n_s16(q9s16, 7); - d9u8 = vqrshrun_n_s16(q10s16, 7); - - d18u8 = d22u8; - d19u8 = d23u8; - d20u8 = d24u8; - d21u8 = d25u8; - d22u8 = d26u8; - d23u8 = d27u8; - d24u8 = d28u8; - d25u8 = d29u8; - d26u8 = d30u8; - - vst1_u8(dst_ptr, d6u8); - dst_ptr += dst_pitch; - vst1_u8(dst_ptr, d7u8); - dst_ptr += dst_pitch; - vst1_u8(dst_ptr, d8u8); - dst_ptr += dst_pitch; - vst1_u8(dst_ptr, d9u8); - dst_ptr += dst_pitch; - } - return; -} - -void vp8_sixtap_predict16x16_neon( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch) { - unsigned char *src, *src_tmp, *dst, *tmpp; - unsigned char tmp[336]; - int i, j; - uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8, d6u8, d7u8, d8u8, d9u8; - uint8x8_t d10u8, d11u8, d12u8, d13u8, d14u8, d15u8, d18u8, d19u8; - uint8x8_t d20u8, d21u8, d22u8, d23u8, d24u8, d25u8, d26u8, d27u8; - uint8x8_t d28u8, d29u8, d30u8, d31u8; - int8x8_t dtmps8, d0s8, d1s8, d2s8, d3s8, d4s8, d5s8; - uint8x16_t q3u8, q4u8; - uint16x8_t q3u16, q4u16, q5u16, q6u16, q7u16, q8u16, q9u16, q10u16; - uint16x8_t q11u16, q12u16, q13u16, q15u16; - int16x8_t q3s16, q4s16, q5s16, q6s16, q7s16, q8s16, q9s16, q10s16; - int16x8_t q11s16, q12s16, q13s16, q15s16; - - if (xoffset == 0) { // secondpass_filter8x8_only - // load second_pass filter - dtmps8 = vld1_s8(vp8_sub_pel_filters[yoffset]); - d0s8 = vdup_lane_s8(dtmps8, 0); - d1s8 = vdup_lane_s8(dtmps8, 1); - d2s8 = vdup_lane_s8(dtmps8, 2); - d3s8 = vdup_lane_s8(dtmps8, 3); - d4s8 = vdup_lane_s8(dtmps8, 4); - d5s8 = vdup_lane_s8(dtmps8, 5); - d0u8 = vreinterpret_u8_s8(vabs_s8(d0s8)); - d1u8 = vreinterpret_u8_s8(vabs_s8(d1s8)); - d2u8 = vreinterpret_u8_s8(vabs_s8(d2s8)); - d3u8 = vreinterpret_u8_s8(vabs_s8(d3s8)); - d4u8 = vreinterpret_u8_s8(vabs_s8(d4s8)); - d5u8 = vreinterpret_u8_s8(vabs_s8(d5s8)); - - // load src data - src_tmp = src_ptr - src_pixels_per_line * 2; - for (i = 0; i < 2; i++) { - src = src_tmp + i * 8; - dst = dst_ptr + i * 8; - d18u8 = vld1_u8(src); - src += src_pixels_per_line; - d19u8 = vld1_u8(src); - src += src_pixels_per_line; - d20u8 = vld1_u8(src); - src += src_pixels_per_line; - d21u8 = vld1_u8(src); - src += src_pixels_per_line; - d22u8 = vld1_u8(src); - src += src_pixels_per_line; - for (j = 0; j < 4; j++) { - d23u8 = vld1_u8(src); - src += src_pixels_per_line; - d24u8 = vld1_u8(src); - src += src_pixels_per_line; - d25u8 = vld1_u8(src); - src += src_pixels_per_line; - d26u8 = vld1_u8(src); - src += src_pixels_per_line; - - q3u16 = vmull_u8(d18u8, d0u8); - q4u16 = vmull_u8(d19u8, d0u8); - q5u16 = vmull_u8(d20u8, d0u8); - q6u16 = vmull_u8(d21u8, d0u8); - - q3u16 = vmlsl_u8(q3u16, d19u8, d1u8); - q4u16 = vmlsl_u8(q4u16, d20u8, d1u8); - q5u16 = vmlsl_u8(q5u16, d21u8, d1u8); - q6u16 = vmlsl_u8(q6u16, d22u8, d1u8); - - q3u16 = vmlsl_u8(q3u16, d22u8, d4u8); - q4u16 = vmlsl_u8(q4u16, d23u8, d4u8); - q5u16 = vmlsl_u8(q5u16, d24u8, d4u8); - q6u16 = vmlsl_u8(q6u16, d25u8, d4u8); - - q3u16 = vmlal_u8(q3u16, d20u8, d2u8); - q4u16 = vmlal_u8(q4u16, d21u8, d2u8); - q5u16 = vmlal_u8(q5u16, d22u8, d2u8); - q6u16 = vmlal_u8(q6u16, d23u8, d2u8); - - q3u16 = vmlal_u8(q3u16, d23u8, d5u8); - q4u16 = vmlal_u8(q4u16, d24u8, d5u8); - q5u16 = vmlal_u8(q5u16, d25u8, d5u8); - q6u16 = vmlal_u8(q6u16, d26u8, d5u8); - - q7u16 = vmull_u8(d21u8, d3u8); - q8u16 = vmull_u8(d22u8, d3u8); - q9u16 = vmull_u8(d23u8, d3u8); - q10u16 = vmull_u8(d24u8, d3u8); - - q3s16 = vreinterpretq_s16_u16(q3u16); - q4s16 = vreinterpretq_s16_u16(q4u16); - q5s16 = vreinterpretq_s16_u16(q5u16); - q6s16 = vreinterpretq_s16_u16(q6u16); - q7s16 = vreinterpretq_s16_u16(q7u16); - q8s16 = vreinterpretq_s16_u16(q8u16); - q9s16 = vreinterpretq_s16_u16(q9u16); - q10s16 = vreinterpretq_s16_u16(q10u16); - - q7s16 = vqaddq_s16(q7s16, q3s16); - q8s16 = vqaddq_s16(q8s16, q4s16); - q9s16 = vqaddq_s16(q9s16, q5s16); - q10s16 = vqaddq_s16(q10s16, q6s16); - - d6u8 = vqrshrun_n_s16(q7s16, 7); - d7u8 = vqrshrun_n_s16(q8s16, 7); - d8u8 = vqrshrun_n_s16(q9s16, 7); - d9u8 = vqrshrun_n_s16(q10s16, 7); - - d18u8 = d22u8; - d19u8 = d23u8; - d20u8 = d24u8; - d21u8 = d25u8; - d22u8 = d26u8; - - vst1_u8(dst, d6u8); - dst += dst_pitch; - vst1_u8(dst, d7u8); - dst += dst_pitch; - vst1_u8(dst, d8u8); - dst += dst_pitch; - vst1_u8(dst, d9u8); - dst += dst_pitch; - } - } - return; - } - - // load first_pass filter - dtmps8 = vld1_s8(vp8_sub_pel_filters[xoffset]); - d0s8 = vdup_lane_s8(dtmps8, 0); - d1s8 = vdup_lane_s8(dtmps8, 1); - d2s8 = vdup_lane_s8(dtmps8, 2); - d3s8 = vdup_lane_s8(dtmps8, 3); - d4s8 = vdup_lane_s8(dtmps8, 4); - d5s8 = vdup_lane_s8(dtmps8, 5); - d0u8 = vreinterpret_u8_s8(vabs_s8(d0s8)); - d1u8 = vreinterpret_u8_s8(vabs_s8(d1s8)); - d2u8 = vreinterpret_u8_s8(vabs_s8(d2s8)); - d3u8 = vreinterpret_u8_s8(vabs_s8(d3s8)); - d4u8 = vreinterpret_u8_s8(vabs_s8(d4s8)); - d5u8 = vreinterpret_u8_s8(vabs_s8(d5s8)); - - // First pass: output_height lines x output_width columns (9x4) - if (yoffset == 0) { // firstpass_filter4x4_only - src = src_ptr - 2; - dst = dst_ptr; - for (i = 0; i < 8; i++) { - d6u8 = vld1_u8(src); - d7u8 = vld1_u8(src + 8); - d8u8 = vld1_u8(src + 16); - src += src_pixels_per_line; - d9u8 = vld1_u8(src); - d10u8 = vld1_u8(src + 8); - d11u8 = vld1_u8(src + 16); - src += src_pixels_per_line; - - __builtin_prefetch(src); - __builtin_prefetch(src + src_pixels_per_line); - - q6u16 = vmull_u8(d6u8, d0u8); - q7u16 = vmull_u8(d7u8, d0u8); - q8u16 = vmull_u8(d9u8, d0u8); - q9u16 = vmull_u8(d10u8, d0u8); - - d20u8 = vext_u8(d6u8, d7u8, 1); - d21u8 = vext_u8(d9u8, d10u8, 1); - d22u8 = vext_u8(d7u8, d8u8, 1); - d23u8 = vext_u8(d10u8, d11u8, 1); - d24u8 = vext_u8(d6u8, d7u8, 4); - d25u8 = vext_u8(d9u8, d10u8, 4); - d26u8 = vext_u8(d7u8, d8u8, 4); - d27u8 = vext_u8(d10u8, d11u8, 4); - d28u8 = vext_u8(d6u8, d7u8, 5); - d29u8 = vext_u8(d9u8, d10u8, 5); - - q6u16 = vmlsl_u8(q6u16, d20u8, d1u8); - q8u16 = vmlsl_u8(q8u16, d21u8, d1u8); - q7u16 = vmlsl_u8(q7u16, d22u8, d1u8); - q9u16 = vmlsl_u8(q9u16, d23u8, d1u8); - q6u16 = vmlsl_u8(q6u16, d24u8, d4u8); - q8u16 = vmlsl_u8(q8u16, d25u8, d4u8); - q7u16 = vmlsl_u8(q7u16, d26u8, d4u8); - q9u16 = vmlsl_u8(q9u16, d27u8, d4u8); - q6u16 = vmlal_u8(q6u16, d28u8, d5u8); - q8u16 = vmlal_u8(q8u16, d29u8, d5u8); - - d20u8 = vext_u8(d7u8, d8u8, 5); - d21u8 = vext_u8(d10u8, d11u8, 5); - d22u8 = vext_u8(d6u8, d7u8, 2); - d23u8 = vext_u8(d9u8, d10u8, 2); - d24u8 = vext_u8(d7u8, d8u8, 2); - d25u8 = vext_u8(d10u8, d11u8, 2); - d26u8 = vext_u8(d6u8, d7u8, 3); - d27u8 = vext_u8(d9u8, d10u8, 3); - d28u8 = vext_u8(d7u8, d8u8, 3); - d29u8 = vext_u8(d10u8, d11u8, 3); - - q7u16 = vmlal_u8(q7u16, d20u8, d5u8); - q9u16 = vmlal_u8(q9u16, d21u8, d5u8); - q6u16 = vmlal_u8(q6u16, d22u8, d2u8); - q8u16 = vmlal_u8(q8u16, d23u8, d2u8); - q7u16 = vmlal_u8(q7u16, d24u8, d2u8); - q9u16 = vmlal_u8(q9u16, d25u8, d2u8); - - q10u16 = vmull_u8(d26u8, d3u8); - q11u16 = vmull_u8(d27u8, d3u8); - q12u16 = vmull_u8(d28u8, d3u8); - q15u16 = vmull_u8(d29u8, d3u8); - - q6s16 = vreinterpretq_s16_u16(q6u16); - q7s16 = vreinterpretq_s16_u16(q7u16); - q8s16 = vreinterpretq_s16_u16(q8u16); - q9s16 = vreinterpretq_s16_u16(q9u16); - q10s16 = vreinterpretq_s16_u16(q10u16); - q11s16 = vreinterpretq_s16_u16(q11u16); - q12s16 = vreinterpretq_s16_u16(q12u16); - q15s16 = vreinterpretq_s16_u16(q15u16); - - q6s16 = vqaddq_s16(q6s16, q10s16); - q8s16 = vqaddq_s16(q8s16, q11s16); - q7s16 = vqaddq_s16(q7s16, q12s16); - q9s16 = vqaddq_s16(q9s16, q15s16); - - d6u8 = vqrshrun_n_s16(q6s16, 7); - d7u8 = vqrshrun_n_s16(q7s16, 7); - d8u8 = vqrshrun_n_s16(q8s16, 7); - d9u8 = vqrshrun_n_s16(q9s16, 7); - - q3u8 = vcombine_u8(d6u8, d7u8); - q4u8 = vcombine_u8(d8u8, d9u8); - vst1q_u8(dst, q3u8); - dst += dst_pitch; - vst1q_u8(dst, q4u8); - dst += dst_pitch; - } - return; - } - - src = src_ptr - 2 - src_pixels_per_line * 2; - tmpp = tmp; - for (i = 0; i < 7; i++) { - d6u8 = vld1_u8(src); - d7u8 = vld1_u8(src + 8); - d8u8 = vld1_u8(src + 16); - src += src_pixels_per_line; - d9u8 = vld1_u8(src); - d10u8 = vld1_u8(src + 8); - d11u8 = vld1_u8(src + 16); - src += src_pixels_per_line; - d12u8 = vld1_u8(src); - d13u8 = vld1_u8(src + 8); - d14u8 = vld1_u8(src + 16); - src += src_pixels_per_line; - - __builtin_prefetch(src); - __builtin_prefetch(src + src_pixels_per_line); - __builtin_prefetch(src + src_pixels_per_line * 2); - - q8u16 = vmull_u8(d6u8, d0u8); - q9u16 = vmull_u8(d7u8, d0u8); - q10u16 = vmull_u8(d9u8, d0u8); - q11u16 = vmull_u8(d10u8, d0u8); - q12u16 = vmull_u8(d12u8, d0u8); - q13u16 = vmull_u8(d13u8, d0u8); - - d28u8 = vext_u8(d6u8, d7u8, 1); - d29u8 = vext_u8(d9u8, d10u8, 1); - d30u8 = vext_u8(d12u8, d13u8, 1); - q8u16 = vmlsl_u8(q8u16, d28u8, d1u8); - q10u16 = vmlsl_u8(q10u16, d29u8, d1u8); - q12u16 = vmlsl_u8(q12u16, d30u8, d1u8); - d28u8 = vext_u8(d7u8, d8u8, 1); - d29u8 = vext_u8(d10u8, d11u8, 1); - d30u8 = vext_u8(d13u8, d14u8, 1); - q9u16 = vmlsl_u8(q9u16, d28u8, d1u8); - q11u16 = vmlsl_u8(q11u16, d29u8, d1u8); - q13u16 = vmlsl_u8(q13u16, d30u8, d1u8); - - d28u8 = vext_u8(d6u8, d7u8, 4); - d29u8 = vext_u8(d9u8, d10u8, 4); - d30u8 = vext_u8(d12u8, d13u8, 4); - q8u16 = vmlsl_u8(q8u16, d28u8, d4u8); - q10u16 = vmlsl_u8(q10u16, d29u8, d4u8); - q12u16 = vmlsl_u8(q12u16, d30u8, d4u8); - d28u8 = vext_u8(d7u8, d8u8, 4); - d29u8 = vext_u8(d10u8, d11u8, 4); - d30u8 = vext_u8(d13u8, d14u8, 4); - q9u16 = vmlsl_u8(q9u16, d28u8, d4u8); - q11u16 = vmlsl_u8(q11u16, d29u8, d4u8); - q13u16 = vmlsl_u8(q13u16, d30u8, d4u8); - - d28u8 = vext_u8(d6u8, d7u8, 5); - d29u8 = vext_u8(d9u8, d10u8, 5); - d30u8 = vext_u8(d12u8, d13u8, 5); - q8u16 = vmlal_u8(q8u16, d28u8, d5u8); - q10u16 = vmlal_u8(q10u16, d29u8, d5u8); - q12u16 = vmlal_u8(q12u16, d30u8, d5u8); - d28u8 = vext_u8(d7u8, d8u8, 5); - d29u8 = vext_u8(d10u8, d11u8, 5); - d30u8 = vext_u8(d13u8, d14u8, 5); - q9u16 = vmlal_u8(q9u16, d28u8, d5u8); - q11u16 = vmlal_u8(q11u16, d29u8, d5u8); - q13u16 = vmlal_u8(q13u16, d30u8, d5u8); - - d28u8 = vext_u8(d6u8, d7u8, 2); - d29u8 = vext_u8(d9u8, d10u8, 2); - d30u8 = vext_u8(d12u8, d13u8, 2); - q8u16 = vmlal_u8(q8u16, d28u8, d2u8); - q10u16 = vmlal_u8(q10u16, d29u8, d2u8); - q12u16 = vmlal_u8(q12u16, d30u8, d2u8); - d28u8 = vext_u8(d7u8, d8u8, 2); - d29u8 = vext_u8(d10u8, d11u8, 2); - d30u8 = vext_u8(d13u8, d14u8, 2); - q9u16 = vmlal_u8(q9u16, d28u8, d2u8); - q11u16 = vmlal_u8(q11u16, d29u8, d2u8); - q13u16 = vmlal_u8(q13u16, d30u8, d2u8); - - d28u8 = vext_u8(d6u8, d7u8, 3); - d29u8 = vext_u8(d9u8, d10u8, 3); - d30u8 = vext_u8(d12u8, d13u8, 3); - d15u8 = vext_u8(d7u8, d8u8, 3); - d31u8 = vext_u8(d10u8, d11u8, 3); - d6u8 = vext_u8(d13u8, d14u8, 3); - q4u16 = vmull_u8(d28u8, d3u8); - q5u16 = vmull_u8(d29u8, d3u8); - q6u16 = vmull_u8(d30u8, d3u8); - q4s16 = vreinterpretq_s16_u16(q4u16); - q5s16 = vreinterpretq_s16_u16(q5u16); - q6s16 = vreinterpretq_s16_u16(q6u16); - q8s16 = vreinterpretq_s16_u16(q8u16); - q10s16 = vreinterpretq_s16_u16(q10u16); - q12s16 = vreinterpretq_s16_u16(q12u16); - q8s16 = vqaddq_s16(q8s16, q4s16); - q10s16 = vqaddq_s16(q10s16, q5s16); - q12s16 = vqaddq_s16(q12s16, q6s16); - - q6u16 = vmull_u8(d15u8, d3u8); - q7u16 = vmull_u8(d31u8, d3u8); - q3u16 = vmull_u8(d6u8, d3u8); - q3s16 = vreinterpretq_s16_u16(q3u16); - q6s16 = vreinterpretq_s16_u16(q6u16); - q7s16 = vreinterpretq_s16_u16(q7u16); - q9s16 = vreinterpretq_s16_u16(q9u16); - q11s16 = vreinterpretq_s16_u16(q11u16); - q13s16 = vreinterpretq_s16_u16(q13u16); - q9s16 = vqaddq_s16(q9s16, q6s16); - q11s16 = vqaddq_s16(q11s16, q7s16); - q13s16 = vqaddq_s16(q13s16, q3s16); - - d6u8 = vqrshrun_n_s16(q8s16, 7); - d7u8 = vqrshrun_n_s16(q9s16, 7); - d8u8 = vqrshrun_n_s16(q10s16, 7); - d9u8 = vqrshrun_n_s16(q11s16, 7); - d10u8 = vqrshrun_n_s16(q12s16, 7); - d11u8 = vqrshrun_n_s16(q13s16, 7); - - vst1_u8(tmpp, d6u8); - tmpp += 8; - vst1_u8(tmpp, d7u8); - tmpp += 8; - vst1_u8(tmpp, d8u8); - tmpp += 8; - vst1_u8(tmpp, d9u8); - tmpp += 8; - vst1_u8(tmpp, d10u8); - tmpp += 8; - vst1_u8(tmpp, d11u8); - tmpp += 8; - } - - // Second pass: 16x16 - dtmps8 = vld1_s8(vp8_sub_pel_filters[yoffset]); - d0s8 = vdup_lane_s8(dtmps8, 0); - d1s8 = vdup_lane_s8(dtmps8, 1); - d2s8 = vdup_lane_s8(dtmps8, 2); - d3s8 = vdup_lane_s8(dtmps8, 3); - d4s8 = vdup_lane_s8(dtmps8, 4); - d5s8 = vdup_lane_s8(dtmps8, 5); - d0u8 = vreinterpret_u8_s8(vabs_s8(d0s8)); - d1u8 = vreinterpret_u8_s8(vabs_s8(d1s8)); - d2u8 = vreinterpret_u8_s8(vabs_s8(d2s8)); - d3u8 = vreinterpret_u8_s8(vabs_s8(d3s8)); - d4u8 = vreinterpret_u8_s8(vabs_s8(d4s8)); - d5u8 = vreinterpret_u8_s8(vabs_s8(d5s8)); - - for (i = 0; i < 2; i++) { - dst = dst_ptr + 8 * i; - tmpp = tmp + 8 * i; - d18u8 = vld1_u8(tmpp); - tmpp += 16; - d19u8 = vld1_u8(tmpp); - tmpp += 16; - d20u8 = vld1_u8(tmpp); - tmpp += 16; - d21u8 = vld1_u8(tmpp); - tmpp += 16; - d22u8 = vld1_u8(tmpp); - tmpp += 16; - for (j = 0; j < 4; j++) { - d23u8 = vld1_u8(tmpp); - tmpp += 16; - d24u8 = vld1_u8(tmpp); - tmpp += 16; - d25u8 = vld1_u8(tmpp); - tmpp += 16; - d26u8 = vld1_u8(tmpp); - tmpp += 16; - - q3u16 = vmull_u8(d18u8, d0u8); - q4u16 = vmull_u8(d19u8, d0u8); - q5u16 = vmull_u8(d20u8, d0u8); - q6u16 = vmull_u8(d21u8, d0u8); - - q3u16 = vmlsl_u8(q3u16, d19u8, d1u8); - q4u16 = vmlsl_u8(q4u16, d20u8, d1u8); - q5u16 = vmlsl_u8(q5u16, d21u8, d1u8); - q6u16 = vmlsl_u8(q6u16, d22u8, d1u8); - - q3u16 = vmlsl_u8(q3u16, d22u8, d4u8); - q4u16 = vmlsl_u8(q4u16, d23u8, d4u8); - q5u16 = vmlsl_u8(q5u16, d24u8, d4u8); - q6u16 = vmlsl_u8(q6u16, d25u8, d4u8); - - q3u16 = vmlal_u8(q3u16, d20u8, d2u8); - q4u16 = vmlal_u8(q4u16, d21u8, d2u8); - q5u16 = vmlal_u8(q5u16, d22u8, d2u8); - q6u16 = vmlal_u8(q6u16, d23u8, d2u8); - - q3u16 = vmlal_u8(q3u16, d23u8, d5u8); - q4u16 = vmlal_u8(q4u16, d24u8, d5u8); - q5u16 = vmlal_u8(q5u16, d25u8, d5u8); - q6u16 = vmlal_u8(q6u16, d26u8, d5u8); - - q7u16 = vmull_u8(d21u8, d3u8); - q8u16 = vmull_u8(d22u8, d3u8); - q9u16 = vmull_u8(d23u8, d3u8); - q10u16 = vmull_u8(d24u8, d3u8); - - q3s16 = vreinterpretq_s16_u16(q3u16); - q4s16 = vreinterpretq_s16_u16(q4u16); - q5s16 = vreinterpretq_s16_u16(q5u16); - q6s16 = vreinterpretq_s16_u16(q6u16); - q7s16 = vreinterpretq_s16_u16(q7u16); - q8s16 = vreinterpretq_s16_u16(q8u16); - q9s16 = vreinterpretq_s16_u16(q9u16); - q10s16 = vreinterpretq_s16_u16(q10u16); - - q7s16 = vqaddq_s16(q7s16, q3s16); - q8s16 = vqaddq_s16(q8s16, q4s16); - q9s16 = vqaddq_s16(q9s16, q5s16); - q10s16 = vqaddq_s16(q10s16, q6s16); - - d6u8 = vqrshrun_n_s16(q7s16, 7); - d7u8 = vqrshrun_n_s16(q8s16, 7); - d8u8 = vqrshrun_n_s16(q9s16, 7); - d9u8 = vqrshrun_n_s16(q10s16, 7); - - d18u8 = d22u8; - d19u8 = d23u8; - d20u8 = d24u8; - d21u8 = d25u8; - d22u8 = d26u8; - - vst1_u8(dst, d6u8); - dst += dst_pitch; - vst1_u8(dst, d7u8); - dst += dst_pitch; - vst1_u8(dst, d8u8); - dst += dst_pitch; - vst1_u8(dst, d9u8); - dst += dst_pitch; - } - } - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/variance_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/variance_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/variance_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/variance_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,320 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "vpx_ports/mem.h" - -unsigned int vp8_variance16x16_neon( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) { - int i; - int16x4_t d22s16, d23s16, d24s16, d25s16, d26s16, d27s16, d28s16, d29s16; - uint32x2_t d0u32, d10u32; - int64x1_t d0s64, d1s64; - uint8x16_t q0u8, q1u8, q2u8, q3u8; - uint16x8_t q11u16, q12u16, q13u16, q14u16; - int32x4_t q8s32, q9s32, q10s32; - int64x2_t q0s64, q1s64, q5s64; - - q8s32 = vdupq_n_s32(0); - q9s32 = vdupq_n_s32(0); - q10s32 = vdupq_n_s32(0); - - for (i = 0; i < 8; i++) { - q0u8 = vld1q_u8(src_ptr); - src_ptr += source_stride; - q1u8 = vld1q_u8(src_ptr); - src_ptr += source_stride; - __builtin_prefetch(src_ptr); - - q2u8 = vld1q_u8(ref_ptr); - ref_ptr += recon_stride; - q3u8 = vld1q_u8(ref_ptr); - ref_ptr += recon_stride; - __builtin_prefetch(ref_ptr); - - q11u16 = vsubl_u8(vget_low_u8(q0u8), vget_low_u8(q2u8)); - q12u16 = vsubl_u8(vget_high_u8(q0u8), vget_high_u8(q2u8)); - q13u16 = vsubl_u8(vget_low_u8(q1u8), vget_low_u8(q3u8)); - q14u16 = vsubl_u8(vget_high_u8(q1u8), vget_high_u8(q3u8)); - - d22s16 = vreinterpret_s16_u16(vget_low_u16(q11u16)); - d23s16 = vreinterpret_s16_u16(vget_high_u16(q11u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q11u16)); - q9s32 = vmlal_s16(q9s32, d22s16, d22s16); - q10s32 = vmlal_s16(q10s32, d23s16, d23s16); - - d24s16 = vreinterpret_s16_u16(vget_low_u16(q12u16)); - d25s16 = vreinterpret_s16_u16(vget_high_u16(q12u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q12u16)); - q9s32 = vmlal_s16(q9s32, d24s16, d24s16); - q10s32 = vmlal_s16(q10s32, d25s16, d25s16); - - d26s16 = vreinterpret_s16_u16(vget_low_u16(q13u16)); - d27s16 = vreinterpret_s16_u16(vget_high_u16(q13u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q13u16)); - q9s32 = vmlal_s16(q9s32, d26s16, d26s16); - q10s32 = vmlal_s16(q10s32, d27s16, d27s16); - - d28s16 = vreinterpret_s16_u16(vget_low_u16(q14u16)); - d29s16 = vreinterpret_s16_u16(vget_high_u16(q14u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q14u16)); - q9s32 = vmlal_s16(q9s32, d28s16, d28s16); - q10s32 = vmlal_s16(q10s32, d29s16, d29s16); - } - - q10s32 = vaddq_s32(q10s32, q9s32); - q0s64 = vpaddlq_s32(q8s32); - q1s64 = vpaddlq_s32(q10s32); - - d0s64 = vadd_s64(vget_low_s64(q0s64), vget_high_s64(q0s64)); - d1s64 = vadd_s64(vget_low_s64(q1s64), vget_high_s64(q1s64)); - - q5s64 = vmull_s32(vreinterpret_s32_s64(d0s64), - vreinterpret_s32_s64(d0s64)); - vst1_lane_u32((uint32_t *)sse, vreinterpret_u32_s64(d1s64), 0); - - d10u32 = vshr_n_u32(vreinterpret_u32_s64(vget_low_s64(q5s64)), 8); - d0u32 = vsub_u32(vreinterpret_u32_s64(d1s64), d10u32); - - return vget_lane_u32(d0u32, 0); -} - -unsigned int vp8_variance16x8_neon( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) { - int i; - int16x4_t d22s16, d23s16, d24s16, d25s16, d26s16, d27s16, d28s16, d29s16; - uint32x2_t d0u32, d10u32; - int64x1_t d0s64, d1s64; - uint8x16_t q0u8, q1u8, q2u8, q3u8; - uint16x8_t q11u16, q12u16, q13u16, q14u16; - int32x4_t q8s32, q9s32, q10s32; - int64x2_t q0s64, q1s64, q5s64; - - q8s32 = vdupq_n_s32(0); - q9s32 = vdupq_n_s32(0); - q10s32 = vdupq_n_s32(0); - - for (i = 0; i < 4; i++) { // variance16x8_neon_loop - q0u8 = vld1q_u8(src_ptr); - src_ptr += source_stride; - q1u8 = vld1q_u8(src_ptr); - src_ptr += source_stride; - __builtin_prefetch(src_ptr); - - q2u8 = vld1q_u8(ref_ptr); - ref_ptr += recon_stride; - q3u8 = vld1q_u8(ref_ptr); - ref_ptr += recon_stride; - __builtin_prefetch(ref_ptr); - - q11u16 = vsubl_u8(vget_low_u8(q0u8), vget_low_u8(q2u8)); - q12u16 = vsubl_u8(vget_high_u8(q0u8), vget_high_u8(q2u8)); - q13u16 = vsubl_u8(vget_low_u8(q1u8), vget_low_u8(q3u8)); - q14u16 = vsubl_u8(vget_high_u8(q1u8), vget_high_u8(q3u8)); - - d22s16 = vreinterpret_s16_u16(vget_low_u16(q11u16)); - d23s16 = vreinterpret_s16_u16(vget_high_u16(q11u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q11u16)); - q9s32 = vmlal_s16(q9s32, d22s16, d22s16); - q10s32 = vmlal_s16(q10s32, d23s16, d23s16); - - d24s16 = vreinterpret_s16_u16(vget_low_u16(q12u16)); - d25s16 = vreinterpret_s16_u16(vget_high_u16(q12u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q12u16)); - q9s32 = vmlal_s16(q9s32, d24s16, d24s16); - q10s32 = vmlal_s16(q10s32, d25s16, d25s16); - - d26s16 = vreinterpret_s16_u16(vget_low_u16(q13u16)); - d27s16 = vreinterpret_s16_u16(vget_high_u16(q13u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q13u16)); - q9s32 = vmlal_s16(q9s32, d26s16, d26s16); - q10s32 = vmlal_s16(q10s32, d27s16, d27s16); - - d28s16 = vreinterpret_s16_u16(vget_low_u16(q14u16)); - d29s16 = vreinterpret_s16_u16(vget_high_u16(q14u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q14u16)); - q9s32 = vmlal_s16(q9s32, d28s16, d28s16); - q10s32 = vmlal_s16(q10s32, d29s16, d29s16); - } - - q10s32 = vaddq_s32(q10s32, q9s32); - q0s64 = vpaddlq_s32(q8s32); - q1s64 = vpaddlq_s32(q10s32); - - d0s64 = vadd_s64(vget_low_s64(q0s64), vget_high_s64(q0s64)); - d1s64 = vadd_s64(vget_low_s64(q1s64), vget_high_s64(q1s64)); - - q5s64 = vmull_s32(vreinterpret_s32_s64(d0s64), - vreinterpret_s32_s64(d0s64)); - vst1_lane_u32((uint32_t *)sse, vreinterpret_u32_s64(d1s64), 0); - - d10u32 = vshr_n_u32(vreinterpret_u32_s64(vget_low_s64(q5s64)), 7); - d0u32 = vsub_u32(vreinterpret_u32_s64(d1s64), d10u32); - - return vget_lane_u32(d0u32, 0); -} - -unsigned int vp8_variance8x16_neon( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) { - int i; - uint8x8_t d0u8, d2u8, d4u8, d6u8; - int16x4_t d22s16, d23s16, d24s16, d25s16; - uint32x2_t d0u32, d10u32; - int64x1_t d0s64, d1s64; - uint16x8_t q11u16, q12u16; - int32x4_t q8s32, q9s32, q10s32; - int64x2_t q0s64, q1s64, q5s64; - - q8s32 = vdupq_n_s32(0); - q9s32 = vdupq_n_s32(0); - q10s32 = vdupq_n_s32(0); - - for (i = 0; i < 8; i++) { // variance8x16_neon_loop - d0u8 = vld1_u8(src_ptr); - src_ptr += source_stride; - d2u8 = vld1_u8(src_ptr); - src_ptr += source_stride; - __builtin_prefetch(src_ptr); - - d4u8 = vld1_u8(ref_ptr); - ref_ptr += recon_stride; - d6u8 = vld1_u8(ref_ptr); - ref_ptr += recon_stride; - __builtin_prefetch(ref_ptr); - - q11u16 = vsubl_u8(d0u8, d4u8); - q12u16 = vsubl_u8(d2u8, d6u8); - - d22s16 = vreinterpret_s16_u16(vget_low_u16(q11u16)); - d23s16 = vreinterpret_s16_u16(vget_high_u16(q11u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q11u16)); - q9s32 = vmlal_s16(q9s32, d22s16, d22s16); - q10s32 = vmlal_s16(q10s32, d23s16, d23s16); - - d24s16 = vreinterpret_s16_u16(vget_low_u16(q12u16)); - d25s16 = vreinterpret_s16_u16(vget_high_u16(q12u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q12u16)); - q9s32 = vmlal_s16(q9s32, d24s16, d24s16); - q10s32 = vmlal_s16(q10s32, d25s16, d25s16); - } - - q10s32 = vaddq_s32(q10s32, q9s32); - q0s64 = vpaddlq_s32(q8s32); - q1s64 = vpaddlq_s32(q10s32); - - d0s64 = vadd_s64(vget_low_s64(q0s64), vget_high_s64(q0s64)); - d1s64 = vadd_s64(vget_low_s64(q1s64), vget_high_s64(q1s64)); - - q5s64 = vmull_s32(vreinterpret_s32_s64(d0s64), - vreinterpret_s32_s64(d0s64)); - vst1_lane_u32((uint32_t *)sse, vreinterpret_u32_s64(d1s64), 0); - - d10u32 = vshr_n_u32(vreinterpret_u32_s64(vget_low_s64(q5s64)), 7); - d0u32 = vsub_u32(vreinterpret_u32_s64(d1s64), d10u32); - - return vget_lane_u32(d0u32, 0); -} - -unsigned int vp8_variance8x8_neon( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) { - int i; - uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8, d6u8, d7u8; - int16x4_t d22s16, d23s16, d24s16, d25s16, d26s16, d27s16, d28s16, d29s16; - uint32x2_t d0u32, d10u32; - int64x1_t d0s64, d1s64; - uint16x8_t q11u16, q12u16, q13u16, q14u16; - int32x4_t q8s32, q9s32, q10s32; - int64x2_t q0s64, q1s64, q5s64; - - q8s32 = vdupq_n_s32(0); - q9s32 = vdupq_n_s32(0); - q10s32 = vdupq_n_s32(0); - - for (i = 0; i < 2; i++) { // variance8x8_neon_loop - d0u8 = vld1_u8(src_ptr); - src_ptr += source_stride; - d1u8 = vld1_u8(src_ptr); - src_ptr += source_stride; - d2u8 = vld1_u8(src_ptr); - src_ptr += source_stride; - d3u8 = vld1_u8(src_ptr); - src_ptr += source_stride; - - d4u8 = vld1_u8(ref_ptr); - ref_ptr += recon_stride; - d5u8 = vld1_u8(ref_ptr); - ref_ptr += recon_stride; - d6u8 = vld1_u8(ref_ptr); - ref_ptr += recon_stride; - d7u8 = vld1_u8(ref_ptr); - ref_ptr += recon_stride; - - q11u16 = vsubl_u8(d0u8, d4u8); - q12u16 = vsubl_u8(d1u8, d5u8); - q13u16 = vsubl_u8(d2u8, d6u8); - q14u16 = vsubl_u8(d3u8, d7u8); - - d22s16 = vreinterpret_s16_u16(vget_low_u16(q11u16)); - d23s16 = vreinterpret_s16_u16(vget_high_u16(q11u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q11u16)); - q9s32 = vmlal_s16(q9s32, d22s16, d22s16); - q10s32 = vmlal_s16(q10s32, d23s16, d23s16); - - d24s16 = vreinterpret_s16_u16(vget_low_u16(q12u16)); - d25s16 = vreinterpret_s16_u16(vget_high_u16(q12u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q12u16)); - q9s32 = vmlal_s16(q9s32, d24s16, d24s16); - q10s32 = vmlal_s16(q10s32, d25s16, d25s16); - - d26s16 = vreinterpret_s16_u16(vget_low_u16(q13u16)); - d27s16 = vreinterpret_s16_u16(vget_high_u16(q13u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q13u16)); - q9s32 = vmlal_s16(q9s32, d26s16, d26s16); - q10s32 = vmlal_s16(q10s32, d27s16, d27s16); - - d28s16 = vreinterpret_s16_u16(vget_low_u16(q14u16)); - d29s16 = vreinterpret_s16_u16(vget_high_u16(q14u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q14u16)); - q9s32 = vmlal_s16(q9s32, d28s16, d28s16); - q10s32 = vmlal_s16(q10s32, d29s16, d29s16); - } - - q10s32 = vaddq_s32(q10s32, q9s32); - q0s64 = vpaddlq_s32(q8s32); - q1s64 = vpaddlq_s32(q10s32); - - d0s64 = vadd_s64(vget_low_s64(q0s64), vget_high_s64(q0s64)); - d1s64 = vadd_s64(vget_low_s64(q1s64), vget_high_s64(q1s64)); - - q5s64 = vmull_s32(vreinterpret_s32_s64(d0s64), - vreinterpret_s32_s64(d0s64)); - vst1_lane_u32((uint32_t *)sse, vreinterpret_u32_s64(d1s64), 0); - - d10u32 = vshr_n_u32(vreinterpret_u32_s64(vget_low_s64(q5s64)), 6); - d0u32 = vsub_u32(vreinterpret_u32_s64(d1s64), d10u32); - - return vget_lane_u32(d0u32, 0); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/vp8_subpixelvariance_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/vp8_subpixelvariance_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/neon/vp8_subpixelvariance_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/neon/vp8_subpixelvariance_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1023 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "vpx_ports/mem.h" -#include "vpx/vpx_integer.h" - -static const uint16_t bilinear_taps_coeff[8][2] = { - {128, 0}, - {112, 16}, - { 96, 32}, - { 80, 48}, - { 64, 64}, - { 48, 80}, - { 32, 96}, - { 16, 112} -}; - -unsigned int vp8_sub_pixel_variance16x16_neon_func( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse) { - int i; - DECLARE_ALIGNED_ARRAY(16, unsigned char, tmp, 528); - unsigned char *tmpp; - unsigned char *tmpp2; - uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8, d6u8, d7u8, d8u8, d9u8; - uint8x8_t d10u8, d11u8, d12u8, d13u8, d14u8, d15u8, d16u8, d17u8, d18u8; - uint8x8_t d19u8, d20u8, d21u8; - int16x4_t d22s16, d23s16, d24s16, d25s16, d26s16, d27s16, d28s16, d29s16; - uint32x2_t d0u32, d10u32; - int64x1_t d0s64, d1s64, d2s64, d3s64; - uint8x16_t q0u8, q1u8, q2u8, q3u8, q4u8, q5u8, q6u8, q7u8, q8u8, q9u8; - uint8x16_t q10u8, q11u8, q12u8, q13u8, q14u8, q15u8; - uint16x8_t q1u16, q2u16, q3u16, q4u16, q5u16, q6u16, q7u16, q8u16; - uint16x8_t q9u16, q10u16, q11u16, q12u16, q13u16, q14u16; - int32x4_t q8s32, q9s32, q10s32; - int64x2_t q0s64, q1s64, q5s64; - - tmpp2 = tmp + 272; - tmpp = tmp; - if (xoffset == 0) { // secondpass_bfilter16x16_only - d0u8 = vdup_n_u8(bilinear_taps_coeff[yoffset][0]); - d1u8 = vdup_n_u8(bilinear_taps_coeff[yoffset][1]); - - q11u8 = vld1q_u8(src_ptr); - src_ptr += src_pixels_per_line; - for (i = 4; i > 0; i--) { - q12u8 = vld1q_u8(src_ptr); - src_ptr += src_pixels_per_line; - q13u8 = vld1q_u8(src_ptr); - src_ptr += src_pixels_per_line; - q14u8 = vld1q_u8(src_ptr); - src_ptr += src_pixels_per_line; - q15u8 = vld1q_u8(src_ptr); - src_ptr += src_pixels_per_line; - - __builtin_prefetch(src_ptr); - __builtin_prefetch(src_ptr + src_pixels_per_line); - __builtin_prefetch(src_ptr + src_pixels_per_line * 2); - - q1u16 = vmull_u8(vget_low_u8(q11u8), d0u8); - q2u16 = vmull_u8(vget_high_u8(q11u8), d0u8); - q3u16 = vmull_u8(vget_low_u8(q12u8), d0u8); - q4u16 = vmull_u8(vget_high_u8(q12u8), d0u8); - q5u16 = vmull_u8(vget_low_u8(q13u8), d0u8); - q6u16 = vmull_u8(vget_high_u8(q13u8), d0u8); - q7u16 = vmull_u8(vget_low_u8(q14u8), d0u8); - q8u16 = vmull_u8(vget_high_u8(q14u8), d0u8); - - q1u16 = vmlal_u8(q1u16, vget_low_u8(q12u8), d1u8); - q2u16 = vmlal_u8(q2u16, vget_high_u8(q12u8), d1u8); - q3u16 = vmlal_u8(q3u16, vget_low_u8(q13u8), d1u8); - q4u16 = vmlal_u8(q4u16, vget_high_u8(q13u8), d1u8); - q5u16 = vmlal_u8(q5u16, vget_low_u8(q14u8), d1u8); - q6u16 = vmlal_u8(q6u16, vget_high_u8(q14u8), d1u8); - q7u16 = vmlal_u8(q7u16, vget_low_u8(q15u8), d1u8); - q8u16 = vmlal_u8(q8u16, vget_high_u8(q15u8), d1u8); - - d2u8 = vqrshrn_n_u16(q1u16, 7); - d3u8 = vqrshrn_n_u16(q2u16, 7); - d4u8 = vqrshrn_n_u16(q3u16, 7); - d5u8 = vqrshrn_n_u16(q4u16, 7); - d6u8 = vqrshrn_n_u16(q5u16, 7); - d7u8 = vqrshrn_n_u16(q6u16, 7); - d8u8 = vqrshrn_n_u16(q7u16, 7); - d9u8 = vqrshrn_n_u16(q8u16, 7); - - q1u8 = vcombine_u8(d2u8, d3u8); - q2u8 = vcombine_u8(d4u8, d5u8); - q3u8 = vcombine_u8(d6u8, d7u8); - q4u8 = vcombine_u8(d8u8, d9u8); - - q11u8 = q15u8; - - vst1q_u8((uint8_t *)tmpp2, q1u8); - tmpp2 += 16; - vst1q_u8((uint8_t *)tmpp2, q2u8); - tmpp2 += 16; - vst1q_u8((uint8_t *)tmpp2, q3u8); - tmpp2 += 16; - vst1q_u8((uint8_t *)tmpp2, q4u8); - tmpp2 += 16; - } - } else if (yoffset == 0) { // firstpass_bfilter16x16_only - d0u8 = vdup_n_u8(bilinear_taps_coeff[xoffset][0]); - d1u8 = vdup_n_u8(bilinear_taps_coeff[xoffset][1]); - - for (i = 4; i > 0 ; i--) { - d2u8 = vld1_u8(src_ptr); - d3u8 = vld1_u8(src_ptr + 8); - d4u8 = vld1_u8(src_ptr + 16); - src_ptr += src_pixels_per_line; - d5u8 = vld1_u8(src_ptr); - d6u8 = vld1_u8(src_ptr + 8); - d7u8 = vld1_u8(src_ptr + 16); - src_ptr += src_pixels_per_line; - d8u8 = vld1_u8(src_ptr); - d9u8 = vld1_u8(src_ptr + 8); - d10u8 = vld1_u8(src_ptr + 16); - src_ptr += src_pixels_per_line; - d11u8 = vld1_u8(src_ptr); - d12u8 = vld1_u8(src_ptr + 8); - d13u8 = vld1_u8(src_ptr + 16); - src_ptr += src_pixels_per_line; - - __builtin_prefetch(src_ptr); - __builtin_prefetch(src_ptr + src_pixels_per_line); - __builtin_prefetch(src_ptr + src_pixels_per_line * 2); - - q7u16 = vmull_u8(d2u8, d0u8); - q8u16 = vmull_u8(d3u8, d0u8); - q9u16 = vmull_u8(d5u8, d0u8); - q10u16 = vmull_u8(d6u8, d0u8); - q11u16 = vmull_u8(d8u8, d0u8); - q12u16 = vmull_u8(d9u8, d0u8); - q13u16 = vmull_u8(d11u8, d0u8); - q14u16 = vmull_u8(d12u8, d0u8); - - d2u8 = vext_u8(d2u8, d3u8, 1); - d5u8 = vext_u8(d5u8, d6u8, 1); - d8u8 = vext_u8(d8u8, d9u8, 1); - d11u8 = vext_u8(d11u8, d12u8, 1); - - q7u16 = vmlal_u8(q7u16, d2u8, d1u8); - q9u16 = vmlal_u8(q9u16, d5u8, d1u8); - q11u16 = vmlal_u8(q11u16, d8u8, d1u8); - q13u16 = vmlal_u8(q13u16, d11u8, d1u8); - - d3u8 = vext_u8(d3u8, d4u8, 1); - d6u8 = vext_u8(d6u8, d7u8, 1); - d9u8 = vext_u8(d9u8, d10u8, 1); - d12u8 = vext_u8(d12u8, d13u8, 1); - - q8u16 = vmlal_u8(q8u16, d3u8, d1u8); - q10u16 = vmlal_u8(q10u16, d6u8, d1u8); - q12u16 = vmlal_u8(q12u16, d9u8, d1u8); - q14u16 = vmlal_u8(q14u16, d12u8, d1u8); - - d14u8 = vqrshrn_n_u16(q7u16, 7); - d15u8 = vqrshrn_n_u16(q8u16, 7); - d16u8 = vqrshrn_n_u16(q9u16, 7); - d17u8 = vqrshrn_n_u16(q10u16, 7); - d18u8 = vqrshrn_n_u16(q11u16, 7); - d19u8 = vqrshrn_n_u16(q12u16, 7); - d20u8 = vqrshrn_n_u16(q13u16, 7); - d21u8 = vqrshrn_n_u16(q14u16, 7); - - q7u8 = vcombine_u8(d14u8, d15u8); - q8u8 = vcombine_u8(d16u8, d17u8); - q9u8 = vcombine_u8(d18u8, d19u8); - q10u8 = vcombine_u8(d20u8, d21u8); - - vst1q_u8((uint8_t *)tmpp2, q7u8); - tmpp2 += 16; - vst1q_u8((uint8_t *)tmpp2, q8u8); - tmpp2 += 16; - vst1q_u8((uint8_t *)tmpp2, q9u8); - tmpp2 += 16; - vst1q_u8((uint8_t *)tmpp2, q10u8); - tmpp2 += 16; - } - } else { - d0u8 = vdup_n_u8(bilinear_taps_coeff[xoffset][0]); - d1u8 = vdup_n_u8(bilinear_taps_coeff[xoffset][1]); - - d2u8 = vld1_u8(src_ptr); - d3u8 = vld1_u8(src_ptr + 8); - d4u8 = vld1_u8(src_ptr + 16); - src_ptr += src_pixels_per_line; - d5u8 = vld1_u8(src_ptr); - d6u8 = vld1_u8(src_ptr + 8); - d7u8 = vld1_u8(src_ptr + 16); - src_ptr += src_pixels_per_line; - d8u8 = vld1_u8(src_ptr); - d9u8 = vld1_u8(src_ptr + 8); - d10u8 = vld1_u8(src_ptr + 16); - src_ptr += src_pixels_per_line; - d11u8 = vld1_u8(src_ptr); - d12u8 = vld1_u8(src_ptr + 8); - d13u8 = vld1_u8(src_ptr + 16); - src_ptr += src_pixels_per_line; - - // First Pass: output_height lines x output_width columns (17x16) - for (i = 3; i > 0; i--) { - q7u16 = vmull_u8(d2u8, d0u8); - q8u16 = vmull_u8(d3u8, d0u8); - q9u16 = vmull_u8(d5u8, d0u8); - q10u16 = vmull_u8(d6u8, d0u8); - q11u16 = vmull_u8(d8u8, d0u8); - q12u16 = vmull_u8(d9u8, d0u8); - q13u16 = vmull_u8(d11u8, d0u8); - q14u16 = vmull_u8(d12u8, d0u8); - - d2u8 = vext_u8(d2u8, d3u8, 1); - d5u8 = vext_u8(d5u8, d6u8, 1); - d8u8 = vext_u8(d8u8, d9u8, 1); - d11u8 = vext_u8(d11u8, d12u8, 1); - - q7u16 = vmlal_u8(q7u16, d2u8, d1u8); - q9u16 = vmlal_u8(q9u16, d5u8, d1u8); - q11u16 = vmlal_u8(q11u16, d8u8, d1u8); - q13u16 = vmlal_u8(q13u16, d11u8, d1u8); - - d3u8 = vext_u8(d3u8, d4u8, 1); - d6u8 = vext_u8(d6u8, d7u8, 1); - d9u8 = vext_u8(d9u8, d10u8, 1); - d12u8 = vext_u8(d12u8, d13u8, 1); - - q8u16 = vmlal_u8(q8u16, d3u8, d1u8); - q10u16 = vmlal_u8(q10u16, d6u8, d1u8); - q12u16 = vmlal_u8(q12u16, d9u8, d1u8); - q14u16 = vmlal_u8(q14u16, d12u8, d1u8); - - d14u8 = vqrshrn_n_u16(q7u16, 7); - d15u8 = vqrshrn_n_u16(q8u16, 7); - d16u8 = vqrshrn_n_u16(q9u16, 7); - d17u8 = vqrshrn_n_u16(q10u16, 7); - d18u8 = vqrshrn_n_u16(q11u16, 7); - d19u8 = vqrshrn_n_u16(q12u16, 7); - d20u8 = vqrshrn_n_u16(q13u16, 7); - d21u8 = vqrshrn_n_u16(q14u16, 7); - - d2u8 = vld1_u8(src_ptr); - d3u8 = vld1_u8(src_ptr + 8); - d4u8 = vld1_u8(src_ptr + 16); - src_ptr += src_pixels_per_line; - d5u8 = vld1_u8(src_ptr); - d6u8 = vld1_u8(src_ptr + 8); - d7u8 = vld1_u8(src_ptr + 16); - src_ptr += src_pixels_per_line; - d8u8 = vld1_u8(src_ptr); - d9u8 = vld1_u8(src_ptr + 8); - d10u8 = vld1_u8(src_ptr + 16); - src_ptr += src_pixels_per_line; - d11u8 = vld1_u8(src_ptr); - d12u8 = vld1_u8(src_ptr + 8); - d13u8 = vld1_u8(src_ptr + 16); - src_ptr += src_pixels_per_line; - - q7u8 = vcombine_u8(d14u8, d15u8); - q8u8 = vcombine_u8(d16u8, d17u8); - q9u8 = vcombine_u8(d18u8, d19u8); - q10u8 = vcombine_u8(d20u8, d21u8); - - vst1q_u8((uint8_t *)tmpp, q7u8); - tmpp += 16; - vst1q_u8((uint8_t *)tmpp, q8u8); - tmpp += 16; - vst1q_u8((uint8_t *)tmpp, q9u8); - tmpp += 16; - vst1q_u8((uint8_t *)tmpp, q10u8); - tmpp += 16; - } - - // First-pass filtering for rest 5 lines - d14u8 = vld1_u8(src_ptr); - d15u8 = vld1_u8(src_ptr + 8); - d16u8 = vld1_u8(src_ptr + 16); - src_ptr += src_pixels_per_line; - - q9u16 = vmull_u8(d2u8, d0u8); - q10u16 = vmull_u8(d3u8, d0u8); - q11u16 = vmull_u8(d5u8, d0u8); - q12u16 = vmull_u8(d6u8, d0u8); - q13u16 = vmull_u8(d8u8, d0u8); - q14u16 = vmull_u8(d9u8, d0u8); - - d2u8 = vext_u8(d2u8, d3u8, 1); - d5u8 = vext_u8(d5u8, d6u8, 1); - d8u8 = vext_u8(d8u8, d9u8, 1); - - q9u16 = vmlal_u8(q9u16, d2u8, d1u8); - q11u16 = vmlal_u8(q11u16, d5u8, d1u8); - q13u16 = vmlal_u8(q13u16, d8u8, d1u8); - - d3u8 = vext_u8(d3u8, d4u8, 1); - d6u8 = vext_u8(d6u8, d7u8, 1); - d9u8 = vext_u8(d9u8, d10u8, 1); - - q10u16 = vmlal_u8(q10u16, d3u8, d1u8); - q12u16 = vmlal_u8(q12u16, d6u8, d1u8); - q14u16 = vmlal_u8(q14u16, d9u8, d1u8); - - q1u16 = vmull_u8(d11u8, d0u8); - q2u16 = vmull_u8(d12u8, d0u8); - q3u16 = vmull_u8(d14u8, d0u8); - q4u16 = vmull_u8(d15u8, d0u8); - - d11u8 = vext_u8(d11u8, d12u8, 1); - d14u8 = vext_u8(d14u8, d15u8, 1); - - q1u16 = vmlal_u8(q1u16, d11u8, d1u8); - q3u16 = vmlal_u8(q3u16, d14u8, d1u8); - - d12u8 = vext_u8(d12u8, d13u8, 1); - d15u8 = vext_u8(d15u8, d16u8, 1); - - q2u16 = vmlal_u8(q2u16, d12u8, d1u8); - q4u16 = vmlal_u8(q4u16, d15u8, d1u8); - - d10u8 = vqrshrn_n_u16(q9u16, 7); - d11u8 = vqrshrn_n_u16(q10u16, 7); - d12u8 = vqrshrn_n_u16(q11u16, 7); - d13u8 = vqrshrn_n_u16(q12u16, 7); - d14u8 = vqrshrn_n_u16(q13u16, 7); - d15u8 = vqrshrn_n_u16(q14u16, 7); - d16u8 = vqrshrn_n_u16(q1u16, 7); - d17u8 = vqrshrn_n_u16(q2u16, 7); - d18u8 = vqrshrn_n_u16(q3u16, 7); - d19u8 = vqrshrn_n_u16(q4u16, 7); - - q5u8 = vcombine_u8(d10u8, d11u8); - q6u8 = vcombine_u8(d12u8, d13u8); - q7u8 = vcombine_u8(d14u8, d15u8); - q8u8 = vcombine_u8(d16u8, d17u8); - q9u8 = vcombine_u8(d18u8, d19u8); - - vst1q_u8((uint8_t *)tmpp, q5u8); - tmpp += 16; - vst1q_u8((uint8_t *)tmpp, q6u8); - tmpp += 16; - vst1q_u8((uint8_t *)tmpp, q7u8); - tmpp += 16; - vst1q_u8((uint8_t *)tmpp, q8u8); - tmpp += 16; - vst1q_u8((uint8_t *)tmpp, q9u8); - - // secondpass_filter - d0u8 = vdup_n_u8(bilinear_taps_coeff[yoffset][0]); - d1u8 = vdup_n_u8(bilinear_taps_coeff[yoffset][1]); - - tmpp = tmp; - tmpp2 = tmpp + 272; - q11u8 = vld1q_u8(tmpp); - tmpp += 16; - for (i = 4; i > 0; i--) { - q12u8 = vld1q_u8(tmpp); - tmpp += 16; - q13u8 = vld1q_u8(tmpp); - tmpp += 16; - q14u8 = vld1q_u8(tmpp); - tmpp += 16; - q15u8 = vld1q_u8(tmpp); - tmpp += 16; - - q1u16 = vmull_u8(vget_low_u8(q11u8), d0u8); - q2u16 = vmull_u8(vget_high_u8(q11u8), d0u8); - q3u16 = vmull_u8(vget_low_u8(q12u8), d0u8); - q4u16 = vmull_u8(vget_high_u8(q12u8), d0u8); - q5u16 = vmull_u8(vget_low_u8(q13u8), d0u8); - q6u16 = vmull_u8(vget_high_u8(q13u8), d0u8); - q7u16 = vmull_u8(vget_low_u8(q14u8), d0u8); - q8u16 = vmull_u8(vget_high_u8(q14u8), d0u8); - - q1u16 = vmlal_u8(q1u16, vget_low_u8(q12u8), d1u8); - q2u16 = vmlal_u8(q2u16, vget_high_u8(q12u8), d1u8); - q3u16 = vmlal_u8(q3u16, vget_low_u8(q13u8), d1u8); - q4u16 = vmlal_u8(q4u16, vget_high_u8(q13u8), d1u8); - q5u16 = vmlal_u8(q5u16, vget_low_u8(q14u8), d1u8); - q6u16 = vmlal_u8(q6u16, vget_high_u8(q14u8), d1u8); - q7u16 = vmlal_u8(q7u16, vget_low_u8(q15u8), d1u8); - q8u16 = vmlal_u8(q8u16, vget_high_u8(q15u8), d1u8); - - d2u8 = vqrshrn_n_u16(q1u16, 7); - d3u8 = vqrshrn_n_u16(q2u16, 7); - d4u8 = vqrshrn_n_u16(q3u16, 7); - d5u8 = vqrshrn_n_u16(q4u16, 7); - d6u8 = vqrshrn_n_u16(q5u16, 7); - d7u8 = vqrshrn_n_u16(q6u16, 7); - d8u8 = vqrshrn_n_u16(q7u16, 7); - d9u8 = vqrshrn_n_u16(q8u16, 7); - - q1u8 = vcombine_u8(d2u8, d3u8); - q2u8 = vcombine_u8(d4u8, d5u8); - q3u8 = vcombine_u8(d6u8, d7u8); - q4u8 = vcombine_u8(d8u8, d9u8); - - q11u8 = q15u8; - - vst1q_u8((uint8_t *)tmpp2, q1u8); - tmpp2 += 16; - vst1q_u8((uint8_t *)tmpp2, q2u8); - tmpp2 += 16; - vst1q_u8((uint8_t *)tmpp2, q3u8); - tmpp2 += 16; - vst1q_u8((uint8_t *)tmpp2, q4u8); - tmpp2 += 16; - } - } - - // sub_pixel_variance16x16_neon - q8s32 = vdupq_n_s32(0); - q9s32 = vdupq_n_s32(0); - q10s32 = vdupq_n_s32(0); - - tmpp = tmp + 272; - for (i = 0; i < 8; i++) { // sub_pixel_variance16x16_neon_loop - q0u8 = vld1q_u8(tmpp); - tmpp += 16; - q1u8 = vld1q_u8(tmpp); - tmpp += 16; - q2u8 = vld1q_u8(dst_ptr); - dst_ptr += dst_pixels_per_line; - q3u8 = vld1q_u8(dst_ptr); - dst_ptr += dst_pixels_per_line; - - d0u8 = vget_low_u8(q0u8); - d1u8 = vget_high_u8(q0u8); - d2u8 = vget_low_u8(q1u8); - d3u8 = vget_high_u8(q1u8); - - q11u16 = vsubl_u8(d0u8, vget_low_u8(q2u8)); - q12u16 = vsubl_u8(d1u8, vget_high_u8(q2u8)); - q13u16 = vsubl_u8(d2u8, vget_low_u8(q3u8)); - q14u16 = vsubl_u8(d3u8, vget_high_u8(q3u8)); - - d22s16 = vreinterpret_s16_u16(vget_low_u16(q11u16)); - d23s16 = vreinterpret_s16_u16(vget_high_u16(q11u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q11u16)); - q9s32 = vmlal_s16(q9s32, d22s16, d22s16); - q10s32 = vmlal_s16(q10s32, d23s16, d23s16); - - d24s16 = vreinterpret_s16_u16(vget_low_u16(q12u16)); - d25s16 = vreinterpret_s16_u16(vget_high_u16(q12u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q12u16)); - q9s32 = vmlal_s16(q9s32, d24s16, d24s16); - q10s32 = vmlal_s16(q10s32, d25s16, d25s16); - - d26s16 = vreinterpret_s16_u16(vget_low_u16(q13u16)); - d27s16 = vreinterpret_s16_u16(vget_high_u16(q13u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q13u16)); - q9s32 = vmlal_s16(q9s32, d26s16, d26s16); - q10s32 = vmlal_s16(q10s32, d27s16, d27s16); - - d28s16 = vreinterpret_s16_u16(vget_low_u16(q14u16)); - d29s16 = vreinterpret_s16_u16(vget_high_u16(q14u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q14u16)); - q9s32 = vmlal_s16(q9s32, d28s16, d28s16); - q10s32 = vmlal_s16(q10s32, d29s16, d29s16); - } - - q10s32 = vaddq_s32(q10s32, q9s32); - q0s64 = vpaddlq_s32(q8s32); - q1s64 = vpaddlq_s32(q10s32); - - d0s64 = vget_low_s64(q0s64); - d1s64 = vget_high_s64(q0s64); - d2s64 = vget_low_s64(q1s64); - d3s64 = vget_high_s64(q1s64); - d0s64 = vadd_s64(d0s64, d1s64); - d1s64 = vadd_s64(d2s64, d3s64); - - q5s64 = vmull_s32(vreinterpret_s32_s64(d0s64), - vreinterpret_s32_s64(d0s64)); - vst1_lane_u32((uint32_t *)sse, vreinterpret_u32_s64(d1s64), 0); - - d10u32 = vshr_n_u32(vreinterpret_u32_s64(vget_low_s64(q5s64)), 8); - d0u32 = vsub_u32(vreinterpret_u32_s64(d1s64), d10u32); - - return vget_lane_u32(d0u32, 0); -} - -unsigned int vp8_variance_halfpixvar16x16_h_neon( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) { - int i; - uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8, d6u8, d7u8; - int16x4_t d0s16, d1s16, d2s16, d3s16, d4s16, d5s16, d6s16, d7s16; - int16x4_t d8s16, d9s16, d10s16, d11s16, d12s16, d13s16, d14s16, d15s16; - uint32x2_t d0u32, d10u32; - int64x1_t d0s64, d1s64, d2s64, d3s64; - uint8x16_t q0u8, q1u8, q2u8, q3u8, q4u8, q5u8, q6u8; - uint8x16_t q7u8, q11u8, q12u8, q13u8, q14u8; - uint16x8_t q0u16, q1u16, q2u16, q3u16, q4u16, q5u16, q6u16, q7u16; - int32x4_t q8s32, q9s32, q10s32; - int64x2_t q0s64, q1s64, q5s64; - - q8s32 = vdupq_n_s32(0); - q9s32 = vdupq_n_s32(0); - q10s32 = vdupq_n_s32(0); - - for (i = 0; i < 4; i++) { // vp8_filt_fpo16x16s_4_0_loop_neon - q0u8 = vld1q_u8(src_ptr); - q1u8 = vld1q_u8(src_ptr + 16); - src_ptr += source_stride; - q2u8 = vld1q_u8(src_ptr); - q3u8 = vld1q_u8(src_ptr + 16); - src_ptr += source_stride; - q4u8 = vld1q_u8(src_ptr); - q5u8 = vld1q_u8(src_ptr + 16); - src_ptr += source_stride; - q6u8 = vld1q_u8(src_ptr); - q7u8 = vld1q_u8(src_ptr + 16); - src_ptr += source_stride; - - q11u8 = vld1q_u8(ref_ptr); - ref_ptr += recon_stride; - q12u8 = vld1q_u8(ref_ptr); - ref_ptr += recon_stride; - q13u8 = vld1q_u8(ref_ptr); - ref_ptr += recon_stride; - q14u8 = vld1q_u8(ref_ptr); - ref_ptr += recon_stride; - - q1u8 = vextq_u8(q0u8, q1u8, 1); - q3u8 = vextq_u8(q2u8, q3u8, 1); - q5u8 = vextq_u8(q4u8, q5u8, 1); - q7u8 = vextq_u8(q6u8, q7u8, 1); - - q0u8 = vrhaddq_u8(q0u8, q1u8); - q1u8 = vrhaddq_u8(q2u8, q3u8); - q2u8 = vrhaddq_u8(q4u8, q5u8); - q3u8 = vrhaddq_u8(q6u8, q7u8); - - d0u8 = vget_low_u8(q0u8); - d1u8 = vget_high_u8(q0u8); - d2u8 = vget_low_u8(q1u8); - d3u8 = vget_high_u8(q1u8); - d4u8 = vget_low_u8(q2u8); - d5u8 = vget_high_u8(q2u8); - d6u8 = vget_low_u8(q3u8); - d7u8 = vget_high_u8(q3u8); - - q4u16 = vsubl_u8(d0u8, vget_low_u8(q11u8)); - q5u16 = vsubl_u8(d1u8, vget_high_u8(q11u8)); - q6u16 = vsubl_u8(d2u8, vget_low_u8(q12u8)); - q7u16 = vsubl_u8(d3u8, vget_high_u8(q12u8)); - q0u16 = vsubl_u8(d4u8, vget_low_u8(q13u8)); - q1u16 = vsubl_u8(d5u8, vget_high_u8(q13u8)); - q2u16 = vsubl_u8(d6u8, vget_low_u8(q14u8)); - q3u16 = vsubl_u8(d7u8, vget_high_u8(q14u8)); - - d8s16 = vreinterpret_s16_u16(vget_low_u16(q4u16)); - d9s16 = vreinterpret_s16_u16(vget_high_u16(q4u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q4u16)); - q9s32 = vmlal_s16(q9s32, d8s16, d8s16); - q10s32 = vmlal_s16(q10s32, d9s16, d9s16); - d10s16 = vreinterpret_s16_u16(vget_low_u16(q5u16)); - d11s16 = vreinterpret_s16_u16(vget_high_u16(q5u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q5u16)); - q9s32 = vmlal_s16(q9s32, d10s16, d10s16); - q10s32 = vmlal_s16(q10s32, d11s16, d11s16); - d12s16 = vreinterpret_s16_u16(vget_low_u16(q6u16)); - d13s16 = vreinterpret_s16_u16(vget_high_u16(q6u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q6u16)); - q9s32 = vmlal_s16(q9s32, d12s16, d12s16); - q10s32 = vmlal_s16(q10s32, d13s16, d13s16); - d14s16 = vreinterpret_s16_u16(vget_low_u16(q7u16)); - d15s16 = vreinterpret_s16_u16(vget_high_u16(q7u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q7u16)); - q9s32 = vmlal_s16(q9s32, d14s16, d14s16); - q10s32 = vmlal_s16(q10s32, d15s16, d15s16); - d0s16 = vreinterpret_s16_u16(vget_low_u16(q0u16)); - d1s16 = vreinterpret_s16_u16(vget_high_u16(q0u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q0u16)); - q9s32 = vmlal_s16(q9s32, d0s16, d0s16); - q10s32 = vmlal_s16(q10s32, d1s16, d1s16); - d2s16 = vreinterpret_s16_u16(vget_low_u16(q1u16)); - d3s16 = vreinterpret_s16_u16(vget_high_u16(q1u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q1u16)); - q9s32 = vmlal_s16(q9s32, d2s16, d2s16); - q10s32 = vmlal_s16(q10s32, d3s16, d3s16); - d4s16 = vreinterpret_s16_u16(vget_low_u16(q2u16)); - d5s16 = vreinterpret_s16_u16(vget_high_u16(q2u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q2u16)); - q9s32 = vmlal_s16(q9s32, d4s16, d4s16); - q10s32 = vmlal_s16(q10s32, d5s16, d5s16); - d6s16 = vreinterpret_s16_u16(vget_low_u16(q3u16)); - d7s16 = vreinterpret_s16_u16(vget_high_u16(q3u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q3u16)); - q9s32 = vmlal_s16(q9s32, d6s16, d6s16); - q10s32 = vmlal_s16(q10s32, d7s16, d7s16); - } - - q10s32 = vaddq_s32(q10s32, q9s32); - q0s64 = vpaddlq_s32(q8s32); - q1s64 = vpaddlq_s32(q10s32); - - d0s64 = vget_low_s64(q0s64); - d1s64 = vget_high_s64(q0s64); - d2s64 = vget_low_s64(q1s64); - d3s64 = vget_high_s64(q1s64); - d0s64 = vadd_s64(d0s64, d1s64); - d1s64 = vadd_s64(d2s64, d3s64); - - q5s64 = vmull_s32(vreinterpret_s32_s64(d0s64), - vreinterpret_s32_s64(d0s64)); - vst1_lane_u32((uint32_t *)sse, vreinterpret_u32_s64(d1s64), 0); - - d10u32 = vshr_n_u32(vreinterpret_u32_s64(vget_low_s64(q5s64)), 8); - d0u32 = vsub_u32(vreinterpret_u32_s64(d1s64), d10u32); - - return vget_lane_u32(d0u32, 0); -} - -unsigned int vp8_variance_halfpixvar16x16_v_neon( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) { - int i; - uint8x8_t d0u8, d1u8, d4u8, d5u8, d8u8, d9u8, d12u8, d13u8; - int16x4_t d22s16, d23s16, d24s16, d25s16, d26s16, d27s16, d28s16, d29s16; - int16x4_t d0s16, d1s16, d2s16, d3s16, d4s16, d5s16, d6s16, d7s16; - uint32x2_t d0u32, d10u32; - int64x1_t d0s64, d1s64, d2s64, d3s64; - uint8x16_t q0u8, q1u8, q2u8, q3u8, q4u8, q5u8, q6u8, q7u8, q15u8; - uint16x8_t q0u16, q1u16, q2u16, q3u16, q11u16, q12u16, q13u16, q14u16; - int32x4_t q8s32, q9s32, q10s32; - int64x2_t q0s64, q1s64, q5s64; - - q8s32 = vdupq_n_s32(0); - q9s32 = vdupq_n_s32(0); - q10s32 = vdupq_n_s32(0); - - q0u8 = vld1q_u8(src_ptr); - src_ptr += source_stride; - for (i = 0; i < 4; i++) { // vp8_filt_fpo16x16s_4_0_loop_neon - q2u8 = vld1q_u8(src_ptr); - src_ptr += source_stride; - q4u8 = vld1q_u8(src_ptr); - src_ptr += source_stride; - q6u8 = vld1q_u8(src_ptr); - src_ptr += source_stride; - q15u8 = vld1q_u8(src_ptr); - src_ptr += source_stride; - - q1u8 = vld1q_u8(ref_ptr); - ref_ptr += recon_stride; - q3u8 = vld1q_u8(ref_ptr); - ref_ptr += recon_stride; - q5u8 = vld1q_u8(ref_ptr); - ref_ptr += recon_stride; - q7u8 = vld1q_u8(ref_ptr); - ref_ptr += recon_stride; - - q0u8 = vrhaddq_u8(q0u8, q2u8); - q2u8 = vrhaddq_u8(q2u8, q4u8); - q4u8 = vrhaddq_u8(q4u8, q6u8); - q6u8 = vrhaddq_u8(q6u8, q15u8); - - d0u8 = vget_low_u8(q0u8); - d1u8 = vget_high_u8(q0u8); - d4u8 = vget_low_u8(q2u8); - d5u8 = vget_high_u8(q2u8); - d8u8 = vget_low_u8(q4u8); - d9u8 = vget_high_u8(q4u8); - d12u8 = vget_low_u8(q6u8); - d13u8 = vget_high_u8(q6u8); - - q11u16 = vsubl_u8(d0u8, vget_low_u8(q1u8)); - q12u16 = vsubl_u8(d1u8, vget_high_u8(q1u8)); - q13u16 = vsubl_u8(d4u8, vget_low_u8(q3u8)); - q14u16 = vsubl_u8(d5u8, vget_high_u8(q3u8)); - q0u16 = vsubl_u8(d8u8, vget_low_u8(q5u8)); - q1u16 = vsubl_u8(d9u8, vget_high_u8(q5u8)); - q2u16 = vsubl_u8(d12u8, vget_low_u8(q7u8)); - q3u16 = vsubl_u8(d13u8, vget_high_u8(q7u8)); - - d22s16 = vreinterpret_s16_u16(vget_low_u16(q11u16)); - d23s16 = vreinterpret_s16_u16(vget_high_u16(q11u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q11u16)); - q9s32 = vmlal_s16(q9s32, d22s16, d22s16); - q10s32 = vmlal_s16(q10s32, d23s16, d23s16); - d24s16 = vreinterpret_s16_u16(vget_low_u16(q12u16)); - d25s16 = vreinterpret_s16_u16(vget_high_u16(q12u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q12u16)); - q9s32 = vmlal_s16(q9s32, d24s16, d24s16); - q10s32 = vmlal_s16(q10s32, d25s16, d25s16); - d26s16 = vreinterpret_s16_u16(vget_low_u16(q13u16)); - d27s16 = vreinterpret_s16_u16(vget_high_u16(q13u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q13u16)); - q9s32 = vmlal_s16(q9s32, d26s16, d26s16); - q10s32 = vmlal_s16(q10s32, d27s16, d27s16); - d28s16 = vreinterpret_s16_u16(vget_low_u16(q14u16)); - d29s16 = vreinterpret_s16_u16(vget_high_u16(q14u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q14u16)); - q9s32 = vmlal_s16(q9s32, d28s16, d28s16); - q10s32 = vmlal_s16(q10s32, d29s16, d29s16); - d0s16 = vreinterpret_s16_u16(vget_low_u16(q0u16)); - d1s16 = vreinterpret_s16_u16(vget_high_u16(q0u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q0u16)); - q9s32 = vmlal_s16(q9s32, d0s16, d0s16); - q10s32 = vmlal_s16(q10s32, d1s16, d1s16); - d2s16 = vreinterpret_s16_u16(vget_low_u16(q1u16)); - d3s16 = vreinterpret_s16_u16(vget_high_u16(q1u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q1u16)); - q9s32 = vmlal_s16(q9s32, d2s16, d2s16); - q10s32 = vmlal_s16(q10s32, d3s16, d3s16); - d4s16 = vreinterpret_s16_u16(vget_low_u16(q2u16)); - d5s16 = vreinterpret_s16_u16(vget_high_u16(q2u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q2u16)); - q9s32 = vmlal_s16(q9s32, d4s16, d4s16); - q10s32 = vmlal_s16(q10s32, d5s16, d5s16); - d6s16 = vreinterpret_s16_u16(vget_low_u16(q3u16)); - d7s16 = vreinterpret_s16_u16(vget_high_u16(q3u16)); - q8s32 = vpadalq_s16(q8s32, vreinterpretq_s16_u16(q3u16)); - q9s32 = vmlal_s16(q9s32, d6s16, d6s16); - q10s32 = vmlal_s16(q10s32, d7s16, d7s16); - - q0u8 = q15u8; - } - - q10s32 = vaddq_s32(q10s32, q9s32); - q0s64 = vpaddlq_s32(q8s32); - q1s64 = vpaddlq_s32(q10s32); - - d0s64 = vget_low_s64(q0s64); - d1s64 = vget_high_s64(q0s64); - d2s64 = vget_low_s64(q1s64); - d3s64 = vget_high_s64(q1s64); - d0s64 = vadd_s64(d0s64, d1s64); - d1s64 = vadd_s64(d2s64, d3s64); - - q5s64 = vmull_s32(vreinterpret_s32_s64(d0s64), - vreinterpret_s32_s64(d0s64)); - vst1_lane_u32((uint32_t *)sse, vreinterpret_u32_s64(d1s64), 0); - - d10u32 = vshr_n_u32(vreinterpret_u32_s64(vget_low_s64(q5s64)), 8); - d0u32 = vsub_u32(vreinterpret_u32_s64(d1s64), d10u32); - - return vget_lane_u32(d0u32, 0); -} - -unsigned int vp8_variance_halfpixvar16x16_hv_neon( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) { - int i; - uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8, d6u8, d7u8; - int16x4_t d0s16, d1s16, d2s16, d3s16, d10s16, d11s16, d12s16, d13s16; - int16x4_t d18s16, d19s16, d20s16, d21s16, d22s16, d23s16, d24s16, d25s16; - uint32x2_t d0u32, d10u32; - int64x1_t d0s64, d1s64, d2s64, d3s64; - uint8x16_t q0u8, q1u8, q2u8, q3u8, q4u8, q5u8, q6u8, q7u8, q8u8, q9u8; - uint16x8_t q0u16, q1u16, q5u16, q6u16, q9u16, q10u16, q11u16, q12u16; - int32x4_t q13s32, q14s32, q15s32; - int64x2_t q0s64, q1s64, q5s64; - - q13s32 = vdupq_n_s32(0); - q14s32 = vdupq_n_s32(0); - q15s32 = vdupq_n_s32(0); - - q0u8 = vld1q_u8(src_ptr); - q1u8 = vld1q_u8(src_ptr + 16); - src_ptr += source_stride; - q1u8 = vextq_u8(q0u8, q1u8, 1); - q0u8 = vrhaddq_u8(q0u8, q1u8); - for (i = 0; i < 4; i++) { // vp8_filt_fpo16x16s_4_0_loop_neon - q2u8 = vld1q_u8(src_ptr); - q3u8 = vld1q_u8(src_ptr + 16); - src_ptr += source_stride; - q4u8 = vld1q_u8(src_ptr); - q5u8 = vld1q_u8(src_ptr + 16); - src_ptr += source_stride; - q6u8 = vld1q_u8(src_ptr); - q7u8 = vld1q_u8(src_ptr + 16); - src_ptr += source_stride; - q8u8 = vld1q_u8(src_ptr); - q9u8 = vld1q_u8(src_ptr + 16); - src_ptr += source_stride; - - q3u8 = vextq_u8(q2u8, q3u8, 1); - q5u8 = vextq_u8(q4u8, q5u8, 1); - q7u8 = vextq_u8(q6u8, q7u8, 1); - q9u8 = vextq_u8(q8u8, q9u8, 1); - - q1u8 = vrhaddq_u8(q2u8, q3u8); - q2u8 = vrhaddq_u8(q4u8, q5u8); - q3u8 = vrhaddq_u8(q6u8, q7u8); - q4u8 = vrhaddq_u8(q8u8, q9u8); - q0u8 = vrhaddq_u8(q0u8, q1u8); - q1u8 = vrhaddq_u8(q1u8, q2u8); - q2u8 = vrhaddq_u8(q2u8, q3u8); - q3u8 = vrhaddq_u8(q3u8, q4u8); - - q5u8 = vld1q_u8(ref_ptr); - ref_ptr += recon_stride; - q6u8 = vld1q_u8(ref_ptr); - ref_ptr += recon_stride; - q7u8 = vld1q_u8(ref_ptr); - ref_ptr += recon_stride; - q8u8 = vld1q_u8(ref_ptr); - ref_ptr += recon_stride; - - d0u8 = vget_low_u8(q0u8); - d1u8 = vget_high_u8(q0u8); - d2u8 = vget_low_u8(q1u8); - d3u8 = vget_high_u8(q1u8); - d4u8 = vget_low_u8(q2u8); - d5u8 = vget_high_u8(q2u8); - d6u8 = vget_low_u8(q3u8); - d7u8 = vget_high_u8(q3u8); - - q9u16 = vsubl_u8(d0u8, vget_low_u8(q5u8)); - q10u16 = vsubl_u8(d1u8, vget_high_u8(q5u8)); - q11u16 = vsubl_u8(d2u8, vget_low_u8(q6u8)); - q12u16 = vsubl_u8(d3u8, vget_high_u8(q6u8)); - q0u16 = vsubl_u8(d4u8, vget_low_u8(q7u8)); - q1u16 = vsubl_u8(d5u8, vget_high_u8(q7u8)); - q5u16 = vsubl_u8(d6u8, vget_low_u8(q8u8)); - q6u16 = vsubl_u8(d7u8, vget_high_u8(q8u8)); - - d18s16 = vreinterpret_s16_u16(vget_low_u16(q9u16)); - d19s16 = vreinterpret_s16_u16(vget_high_u16(q9u16)); - q13s32 = vpadalq_s16(q13s32, vreinterpretq_s16_u16(q9u16)); - q14s32 = vmlal_s16(q14s32, d18s16, d18s16); - q15s32 = vmlal_s16(q15s32, d19s16, d19s16); - - d20s16 = vreinterpret_s16_u16(vget_low_u16(q10u16)); - d21s16 = vreinterpret_s16_u16(vget_high_u16(q10u16)); - q13s32 = vpadalq_s16(q13s32, vreinterpretq_s16_u16(q10u16)); - q14s32 = vmlal_s16(q14s32, d20s16, d20s16); - q15s32 = vmlal_s16(q15s32, d21s16, d21s16); - - d22s16 = vreinterpret_s16_u16(vget_low_u16(q11u16)); - d23s16 = vreinterpret_s16_u16(vget_high_u16(q11u16)); - q13s32 = vpadalq_s16(q13s32, vreinterpretq_s16_u16(q11u16)); - q14s32 = vmlal_s16(q14s32, d22s16, d22s16); - q15s32 = vmlal_s16(q15s32, d23s16, d23s16); - - d24s16 = vreinterpret_s16_u16(vget_low_u16(q12u16)); - d25s16 = vreinterpret_s16_u16(vget_high_u16(q12u16)); - q13s32 = vpadalq_s16(q13s32, vreinterpretq_s16_u16(q12u16)); - q14s32 = vmlal_s16(q14s32, d24s16, d24s16); - q15s32 = vmlal_s16(q15s32, d25s16, d25s16); - - d0s16 = vreinterpret_s16_u16(vget_low_u16(q0u16)); - d1s16 = vreinterpret_s16_u16(vget_high_u16(q0u16)); - q13s32 = vpadalq_s16(q13s32, vreinterpretq_s16_u16(q0u16)); - q14s32 = vmlal_s16(q14s32, d0s16, d0s16); - q15s32 = vmlal_s16(q15s32, d1s16, d1s16); - - d2s16 = vreinterpret_s16_u16(vget_low_u16(q1u16)); - d3s16 = vreinterpret_s16_u16(vget_high_u16(q1u16)); - q13s32 = vpadalq_s16(q13s32, vreinterpretq_s16_u16(q1u16)); - q14s32 = vmlal_s16(q14s32, d2s16, d2s16); - q15s32 = vmlal_s16(q15s32, d3s16, d3s16); - - d10s16 = vreinterpret_s16_u16(vget_low_u16(q5u16)); - d11s16 = vreinterpret_s16_u16(vget_high_u16(q5u16)); - q13s32 = vpadalq_s16(q13s32, vreinterpretq_s16_u16(q5u16)); - q14s32 = vmlal_s16(q14s32, d10s16, d10s16); - q15s32 = vmlal_s16(q15s32, d11s16, d11s16); - - d12s16 = vreinterpret_s16_u16(vget_low_u16(q6u16)); - d13s16 = vreinterpret_s16_u16(vget_high_u16(q6u16)); - q13s32 = vpadalq_s16(q13s32, vreinterpretq_s16_u16(q6u16)); - q14s32 = vmlal_s16(q14s32, d12s16, d12s16); - q15s32 = vmlal_s16(q15s32, d13s16, d13s16); - - q0u8 = q4u8; - } - - q15s32 = vaddq_s32(q14s32, q15s32); - q0s64 = vpaddlq_s32(q13s32); - q1s64 = vpaddlq_s32(q15s32); - - d0s64 = vget_low_s64(q0s64); - d1s64 = vget_high_s64(q0s64); - d2s64 = vget_low_s64(q1s64); - d3s64 = vget_high_s64(q1s64); - d0s64 = vadd_s64(d0s64, d1s64); - d1s64 = vadd_s64(d2s64, d3s64); - - q5s64 = vmull_s32(vreinterpret_s32_s64(d0s64), - vreinterpret_s32_s64(d0s64)); - vst1_lane_u32((uint32_t *)sse, vreinterpret_u32_s64(d1s64), 0); - - d10u32 = vshr_n_u32(vreinterpret_u32_s64(vget_low_s64(q5s64)), 8); - d0u32 = vsub_u32(vreinterpret_u32_s64(d1s64), d10u32); - - return vget_lane_u32(d0u32, 0); -} - -enum { kWidth8 = 8 }; -enum { kHeight8 = 8 }; -enum { kHeight8PlusOne = 9 }; -enum { kPixelStepOne = 1 }; -enum { kAlign16 = 16 }; - -#define FILTER_BITS 7 - -static INLINE int horizontal_add_s16x8(const int16x8_t v_16x8) { - const int32x4_t a = vpaddlq_s16(v_16x8); - const int64x2_t b = vpaddlq_s32(a); - const int32x2_t c = vadd_s32(vreinterpret_s32_s64(vget_low_s64(b)), - vreinterpret_s32_s64(vget_high_s64(b))); - return vget_lane_s32(c, 0); -} - -static INLINE int horizontal_add_s32x4(const int32x4_t v_32x4) { - const int64x2_t b = vpaddlq_s32(v_32x4); - const int32x2_t c = vadd_s32(vreinterpret_s32_s64(vget_low_s64(b)), - vreinterpret_s32_s64(vget_high_s64(b))); - return vget_lane_s32(c, 0); -} - -static void variance_neon_w8(const uint8_t *a, int a_stride, - const uint8_t *b, int b_stride, - int w, int h, unsigned int *sse, int *sum) { - int i, j; - int16x8_t v_sum = vdupq_n_s16(0); - int32x4_t v_sse_lo = vdupq_n_s32(0); - int32x4_t v_sse_hi = vdupq_n_s32(0); - - for (i = 0; i < h; ++i) { - for (j = 0; j < w; j += 8) { - const uint8x8_t v_a = vld1_u8(&a[j]); - const uint8x8_t v_b = vld1_u8(&b[j]); - const uint16x8_t v_diff = vsubl_u8(v_a, v_b); - const int16x8_t sv_diff = vreinterpretq_s16_u16(v_diff); - v_sum = vaddq_s16(v_sum, sv_diff); - v_sse_lo = vmlal_s16(v_sse_lo, - vget_low_s16(sv_diff), - vget_low_s16(sv_diff)); - v_sse_hi = vmlal_s16(v_sse_hi, - vget_high_s16(sv_diff), - vget_high_s16(sv_diff)); - } - a += a_stride; - b += b_stride; - } - - *sum = horizontal_add_s16x8(v_sum); - *sse = (unsigned int)horizontal_add_s32x4(vaddq_s32(v_sse_lo, v_sse_hi)); -} - -static unsigned int variance8x8_neon(const uint8_t *a, int a_stride, - const uint8_t *b, int b_stride, - unsigned int *sse) { - int sum; - variance_neon_w8(a, a_stride, b, b_stride, kWidth8, kHeight8, sse, &sum); - return *sse - (((int64_t)sum * sum) / (kWidth8 * kHeight8)); -} - -static void var_filter_block2d_bil_w8(const uint8_t *src_ptr, - uint8_t *output_ptr, - unsigned int src_pixels_per_line, - int pixel_step, - unsigned int output_height, - unsigned int output_width, - const uint16_t *vpx_filter) { - const uint8x8_t f0 = vmov_n_u8((uint8_t)vpx_filter[0]); - const uint8x8_t f1 = vmov_n_u8((uint8_t)vpx_filter[1]); - unsigned int i; - for (i = 0; i < output_height; ++i) { - const uint8x8_t src_0 = vld1_u8(&src_ptr[0]); - const uint8x8_t src_1 = vld1_u8(&src_ptr[pixel_step]); - const uint16x8_t a = vmull_u8(src_0, f0); - const uint16x8_t b = vmlal_u8(a, src_1, f1); - const uint8x8_t out = vrshrn_n_u16(b, FILTER_BITS); - vst1_u8(&output_ptr[0], out); - // Next row... - src_ptr += src_pixels_per_line; - output_ptr += output_width; - } -} - -unsigned int vp8_sub_pixel_variance8x8_neon( - const unsigned char *src, - int src_stride, - int xoffset, - int yoffset, - const unsigned char *dst, - int dst_stride, - unsigned int *sse) { - DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, temp2, kHeight8PlusOne * kWidth8); - DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, fdata3, kHeight8PlusOne * kWidth8); - if (xoffset == 0) { - var_filter_block2d_bil_w8(src, temp2, src_stride, kWidth8, kHeight8, - kWidth8, bilinear_taps_coeff[yoffset]); - } else if (yoffset == 0) { - var_filter_block2d_bil_w8(src, temp2, src_stride, kPixelStepOne, - kHeight8PlusOne, kWidth8, - bilinear_taps_coeff[xoffset]); - } else { - var_filter_block2d_bil_w8(src, fdata3, src_stride, kPixelStepOne, - kHeight8PlusOne, kWidth8, - bilinear_taps_coeff[xoffset]); - var_filter_block2d_bil_w8(fdata3, temp2, kWidth8, kWidth8, kHeight8, - kWidth8, bilinear_taps_coeff[yoffset]); - } - return variance8x8_neon(temp2, kWidth8, dst, dst_stride, sse); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/variance_arm.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/variance_arm.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/arm/variance_arm.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/arm/variance_arm.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "vp8/common/variance.h" -#include "vp8/common/filter.h" - -#if HAVE_MEDIA -#include "vp8/common/arm/bilinearfilter_arm.h" - -unsigned int vp8_sub_pixel_variance8x8_armv6 -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse -) -{ - unsigned short first_pass[10*8]; - unsigned char second_pass[8*8]; - const short *HFilter, *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - vp8_filter_block2d_bil_first_pass_armv6(src_ptr, first_pass, - src_pixels_per_line, - 9, 8, HFilter); - vp8_filter_block2d_bil_second_pass_armv6(first_pass, second_pass, - 8, 8, 8, VFilter); - - return vp8_variance8x8_armv6(second_pass, 8, dst_ptr, - dst_pixels_per_line, sse); -} - -unsigned int vp8_sub_pixel_variance16x16_armv6 -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse -) -{ - unsigned short first_pass[36*16]; - unsigned char second_pass[20*16]; - const short *HFilter, *VFilter; - unsigned int var; - - if (xoffset == 4 && yoffset == 0) - { - var = vp8_variance_halfpixvar16x16_h_armv6(src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, sse); - } - else if (xoffset == 0 && yoffset == 4) - { - var = vp8_variance_halfpixvar16x16_v_armv6(src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, sse); - } - else if (xoffset == 4 && yoffset == 4) - { - var = vp8_variance_halfpixvar16x16_hv_armv6(src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, sse); - } - else - { - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - vp8_filter_block2d_bil_first_pass_armv6(src_ptr, first_pass, - src_pixels_per_line, - 17, 16, HFilter); - vp8_filter_block2d_bil_second_pass_armv6(first_pass, second_pass, - 16, 16, 16, VFilter); - - var = vp8_variance16x16_armv6(second_pass, 16, dst_ptr, - dst_pixels_per_line, sse); - } - return var; -} - -#endif /* HAVE_MEDIA */ - - -#if HAVE_NEON - -extern unsigned int vp8_sub_pixel_variance16x16_neon_func -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse -); - -unsigned int vp8_sub_pixel_variance16x16_neon -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse -) -{ - if (xoffset == 4 && yoffset == 0) - return vp8_variance_halfpixvar16x16_h_neon(src_ptr, src_pixels_per_line, dst_ptr, dst_pixels_per_line, sse); - else if (xoffset == 0 && yoffset == 4) - return vp8_variance_halfpixvar16x16_v_neon(src_ptr, src_pixels_per_line, dst_ptr, dst_pixels_per_line, sse); - else if (xoffset == 4 && yoffset == 4) - return vp8_variance_halfpixvar16x16_hv_neon(src_ptr, src_pixels_per_line, dst_ptr, dst_pixels_per_line, sse); - else - return vp8_sub_pixel_variance16x16_neon_func(src_ptr, src_pixels_per_line, xoffset, yoffset, dst_ptr, dst_pixels_per_line, sse); -} - -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/blockd.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/blockd.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/blockd.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/blockd.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "blockd.h" -#include "vpx_mem/vpx_mem.h" - -const unsigned char vp8_block2left[25] = -{ - 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 -}; -const unsigned char vp8_block2above[25] = -{ - 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 8 -}; diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/blockd.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/blockd.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/blockd.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/blockd.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,312 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_BLOCKD_H_ -#define VP8_COMMON_BLOCKD_H_ - -void vpx_log(const char *format, ...); - -#include "vpx_config.h" -#include "vpx_scale/yv12config.h" -#include "mv.h" -#include "treecoder.h" -#include "vpx_ports/mem.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/*#define DCPRED 1*/ -#define DCPREDSIMTHRESH 0 -#define DCPREDCNTTHRESH 3 - -#define MB_FEATURE_TREE_PROBS 3 -#define MAX_MB_SEGMENTS 4 - -#define MAX_REF_LF_DELTAS 4 -#define MAX_MODE_LF_DELTAS 4 - -/* Segment Feature Masks */ -#define SEGMENT_DELTADATA 0 -#define SEGMENT_ABSDATA 1 - -typedef struct -{ - int r, c; -} POS; - -#define PLANE_TYPE_Y_NO_DC 0 -#define PLANE_TYPE_Y2 1 -#define PLANE_TYPE_UV 2 -#define PLANE_TYPE_Y_WITH_DC 3 - - -typedef char ENTROPY_CONTEXT; -typedef struct -{ - ENTROPY_CONTEXT y1[4]; - ENTROPY_CONTEXT u[2]; - ENTROPY_CONTEXT v[2]; - ENTROPY_CONTEXT y2; -} ENTROPY_CONTEXT_PLANES; - -extern const unsigned char vp8_block2left[25]; -extern const unsigned char vp8_block2above[25]; - -#define VP8_COMBINEENTROPYCONTEXTS( Dest, A, B) \ - Dest = (A)+(B); - - -typedef enum -{ - KEY_FRAME = 0, - INTER_FRAME = 1 -} FRAME_TYPE; - -typedef enum -{ - DC_PRED, /* average of above and left pixels */ - V_PRED, /* vertical prediction */ - H_PRED, /* horizontal prediction */ - TM_PRED, /* Truemotion prediction */ - B_PRED, /* block based prediction, each block has its own prediction mode */ - - NEARESTMV, - NEARMV, - ZEROMV, - NEWMV, - SPLITMV, - - MB_MODE_COUNT -} MB_PREDICTION_MODE; - -/* Macroblock level features */ -typedef enum -{ - MB_LVL_ALT_Q = 0, /* Use alternate Quantizer .... */ - MB_LVL_ALT_LF = 1, /* Use alternate loop filter value... */ - MB_LVL_MAX = 2 /* Number of MB level features supported */ - -} MB_LVL_FEATURES; - -/* Segment Feature Masks */ -#define SEGMENT_ALTQ 0x01 -#define SEGMENT_ALT_LF 0x02 - -#define VP8_YMODES (B_PRED + 1) -#define VP8_UV_MODES (TM_PRED + 1) - -#define VP8_MVREFS (1 + SPLITMV - NEARESTMV) - -typedef enum -{ - B_DC_PRED, /* average of above and left pixels */ - B_TM_PRED, - - B_VE_PRED, /* vertical prediction */ - B_HE_PRED, /* horizontal prediction */ - - B_LD_PRED, - B_RD_PRED, - - B_VR_PRED, - B_VL_PRED, - B_HD_PRED, - B_HU_PRED, - - LEFT4X4, - ABOVE4X4, - ZERO4X4, - NEW4X4, - - B_MODE_COUNT -} B_PREDICTION_MODE; - -#define VP8_BINTRAMODES (B_HU_PRED + 1) /* 10 */ -#define VP8_SUBMVREFS (1 + NEW4X4 - LEFT4X4) - -/* For keyframes, intra block modes are predicted by the (already decoded) - modes for the Y blocks to the left and above us; for interframes, there - is a single probability table. */ - -union b_mode_info -{ - B_PREDICTION_MODE as_mode; - int_mv mv; -}; - -typedef enum -{ - INTRA_FRAME = 0, - LAST_FRAME = 1, - GOLDEN_FRAME = 2, - ALTREF_FRAME = 3, - MAX_REF_FRAMES = 4 -} MV_REFERENCE_FRAME; - -typedef struct -{ - uint8_t mode, uv_mode; - uint8_t ref_frame; - uint8_t is_4x4; - int_mv mv; - - uint8_t partitioning; - uint8_t mb_skip_coeff; /* does this mb has coefficients at all, 1=no coefficients, 0=need decode tokens */ - uint8_t need_to_clamp_mvs; - uint8_t segment_id; /* Which set of segmentation parameters should be used for this MB */ -} MB_MODE_INFO; - -typedef struct modeinfo -{ - MB_MODE_INFO mbmi; - union b_mode_info bmi[16]; -} MODE_INFO; - -#if CONFIG_MULTI_RES_ENCODING -/* The mb-level information needed to be stored for higher-resolution encoder */ -typedef struct -{ - MB_PREDICTION_MODE mode; - MV_REFERENCE_FRAME ref_frame; - int_mv mv; - int dissim; /* dissimilarity level of the macroblock */ -} LOWER_RES_MB_INFO; - -/* The frame-level information needed to be stored for higher-resolution - * encoder */ -typedef struct -{ - FRAME_TYPE frame_type; - int is_frame_dropped; - // The frame rate for the lowest resolution. - double low_res_framerate; - /* The frame number of each reference frames */ - unsigned int low_res_ref_frames[MAX_REF_FRAMES]; - // The video frame counter value for the key frame, for lowest resolution. - unsigned int key_frame_counter_value; - LOWER_RES_MB_INFO *mb_info; -} LOWER_RES_FRAME_INFO; -#endif - -typedef struct blockd -{ - short *qcoeff; - short *dqcoeff; - unsigned char *predictor; - short *dequant; - - int offset; - char *eob; - - union b_mode_info bmi; -} BLOCKD; - -typedef void (*vp8_subpix_fn_t)(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); - -typedef struct macroblockd -{ - DECLARE_ALIGNED(16, unsigned char, predictor[384]); - DECLARE_ALIGNED(16, short, qcoeff[400]); - DECLARE_ALIGNED(16, short, dqcoeff[400]); - DECLARE_ALIGNED(16, char, eobs[25]); - - DECLARE_ALIGNED(16, short, dequant_y1[16]); - DECLARE_ALIGNED(16, short, dequant_y1_dc[16]); - DECLARE_ALIGNED(16, short, dequant_y2[16]); - DECLARE_ALIGNED(16, short, dequant_uv[16]); - - /* 16 Y blocks, 4 U, 4 V, 1 DC 2nd order block, each with 16 entries. */ - BLOCKD block[25]; - int fullpixel_mask; - - YV12_BUFFER_CONFIG pre; /* Filtered copy of previous frame reconstruction */ - YV12_BUFFER_CONFIG dst; - - MODE_INFO *mode_info_context; - int mode_info_stride; - - FRAME_TYPE frame_type; - - int up_available; - int left_available; - - unsigned char *recon_above[3]; - unsigned char *recon_left[3]; - int recon_left_stride[2]; - - /* Y,U,V,Y2 */ - ENTROPY_CONTEXT_PLANES *above_context; - ENTROPY_CONTEXT_PLANES *left_context; - - /* 0 indicates segmentation at MB level is not enabled. Otherwise the individual bits indicate which features are active. */ - unsigned char segmentation_enabled; - - /* 0 (do not update) 1 (update) the macroblock segmentation map. */ - unsigned char update_mb_segmentation_map; - - /* 0 (do not update) 1 (update) the macroblock segmentation feature data. */ - unsigned char update_mb_segmentation_data; - - /* 0 (do not update) 1 (update) the macroblock segmentation feature data. */ - unsigned char mb_segement_abs_delta; - - /* Per frame flags that define which MB level features (such as quantizer or loop filter level) */ - /* are enabled and when enabled the proabilities used to decode the per MB flags in MB_MODE_INFO */ - vp8_prob mb_segment_tree_probs[MB_FEATURE_TREE_PROBS]; /* Probability Tree used to code Segment number */ - - signed char segment_feature_data[MB_LVL_MAX][MAX_MB_SEGMENTS]; /* Segment parameters */ - - /* mode_based Loop filter adjustment */ - unsigned char mode_ref_lf_delta_enabled; - unsigned char mode_ref_lf_delta_update; - - /* Delta values have the range +/- MAX_LOOP_FILTER */ - signed char last_ref_lf_deltas[MAX_REF_LF_DELTAS]; /* 0 = Intra, Last, GF, ARF */ - signed char ref_lf_deltas[MAX_REF_LF_DELTAS]; /* 0 = Intra, Last, GF, ARF */ - signed char last_mode_lf_deltas[MAX_MODE_LF_DELTAS]; /* 0 = BPRED, ZERO_MV, MV, SPLIT */ - signed char mode_lf_deltas[MAX_MODE_LF_DELTAS]; /* 0 = BPRED, ZERO_MV, MV, SPLIT */ - - /* Distance of MB away from frame edges */ - int mb_to_left_edge; - int mb_to_right_edge; - int mb_to_top_edge; - int mb_to_bottom_edge; - - - - vp8_subpix_fn_t subpixel_predict; - vp8_subpix_fn_t subpixel_predict8x4; - vp8_subpix_fn_t subpixel_predict8x8; - vp8_subpix_fn_t subpixel_predict16x16; - - void *current_bc; - - int corrupted; - -#if ARCH_X86 || ARCH_X86_64 - /* This is an intermediate buffer currently used in sub-pixel motion search - * to keep a copy of the reference area. This buffer can be used for other - * purpose. - */ - DECLARE_ALIGNED(32, unsigned char, y_buf[22*32]); -#endif -} MACROBLOCKD; - - -extern void vp8_build_block_doffsets(MACROBLOCKD *x); -extern void vp8_setup_block_dptrs(MACROBLOCKD *x); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_BLOCKD_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/coefupdateprobs.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/coefupdateprobs.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/coefupdateprobs.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/coefupdateprobs.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,197 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP8_COMMON_COEFUPDATEPROBS_H_ -#define VP8_COMMON_COEFUPDATEPROBS_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Update probabilities for the nodes in the token entropy tree. - Generated file included by entropy.c */ - -const vp8_prob vp8_coef_update_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES] = -{ - { - { - {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, }, - }, - }, -}; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_COEFUPDATEPROBS_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/common.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/common.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/common.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/common.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_COMMON_H_ -#define VP8_COMMON_COMMON_H_ - -#include - -/* Interface header for common constant data structures and lookup tables */ - -#include "vpx_mem/vpx_mem.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define MIN(x, y) (((x) < (y)) ? (x) : (y)) -#define MAX(x, y) (((x) > (y)) ? (x) : (y)) - -/* Only need this for fixed-size arrays, for structs just assign. */ - -#define vp8_copy( Dest, Src) { \ - assert( sizeof( Dest) == sizeof( Src)); \ - vpx_memcpy( Dest, Src, sizeof( Src)); \ - } - -/* Use this for variably-sized arrays. */ - -#define vp8_copy_array( Dest, Src, N) { \ - assert( sizeof( *Dest) == sizeof( *Src)); \ - vpx_memcpy( Dest, Src, N * sizeof( *Src)); \ - } - -#define vp8_zero( Dest) vpx_memset( &Dest, 0, sizeof( Dest)); - -#define vp8_zero_array( Dest, N) vpx_memset( Dest, 0, N * sizeof( *Dest)); - - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_COMMON_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/context.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/context.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/context.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/context.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,399 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "entropy.h" - -/* *** GENERATED FILE: DO NOT EDIT *** */ - -#if 0 -int Contexts[vp8_coef_counter_dimen]; - -const int default_contexts[vp8_coef_counter_dimen] = -{ - { - // Block Type ( 0 ) - { - // Coeff Band ( 0 ) - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - }, - { - // Coeff Band ( 1 ) - {30190, 26544, 225, 24, 4, 0, 0, 0, 0, 0, 0, 4171593,}, - {26846, 25157, 1241, 130, 26, 6, 1, 0, 0, 0, 0, 149987,}, - {10484, 9538, 1006, 160, 36, 18, 0, 0, 0, 0, 0, 15104,}, - }, - { - // Coeff Band ( 2 ) - {25842, 40456, 1126, 83, 11, 2, 0, 0, 0, 0, 0, 0,}, - {9338, 8010, 512, 73, 7, 3, 2, 0, 0, 0, 0, 43294,}, - {1047, 751, 149, 31, 13, 6, 1, 0, 0, 0, 0, 879,}, - }, - { - // Coeff Band ( 3 ) - {26136, 9826, 252, 13, 0, 0, 0, 0, 0, 0, 0, 0,}, - {8134, 5574, 191, 14, 2, 0, 0, 0, 0, 0, 0, 35302,}, - { 605, 677, 116, 9, 1, 0, 0, 0, 0, 0, 0, 611,}, - }, - { - // Coeff Band ( 4 ) - {10263, 15463, 283, 17, 0, 0, 0, 0, 0, 0, 0, 0,}, - {2773, 2191, 128, 9, 2, 2, 0, 0, 0, 0, 0, 10073,}, - { 134, 125, 32, 4, 0, 2, 0, 0, 0, 0, 0, 50,}, - }, - { - // Coeff Band ( 5 ) - {10483, 2663, 23, 1, 0, 0, 0, 0, 0, 0, 0, 0,}, - {2137, 1251, 27, 1, 1, 0, 0, 0, 0, 0, 0, 14362,}, - { 116, 156, 14, 2, 1, 0, 0, 0, 0, 0, 0, 190,}, - }, - { - // Coeff Band ( 6 ) - {40977, 27614, 412, 28, 0, 0, 0, 0, 0, 0, 0, 0,}, - {6113, 5213, 261, 22, 3, 0, 0, 0, 0, 0, 0, 26164,}, - { 382, 312, 50, 14, 2, 0, 0, 0, 0, 0, 0, 345,}, - }, - { - // Coeff Band ( 7 ) - { 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 319,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,}, - }, - }, - { - // Block Type ( 1 ) - { - // Coeff Band ( 0 ) - {3268, 19382, 1043, 250, 93, 82, 49, 26, 17, 8, 25, 82289,}, - {8758, 32110, 5436, 1832, 827, 668, 420, 153, 24, 0, 3, 52914,}, - {9337, 23725, 8487, 3954, 2107, 1836, 1069, 399, 59, 0, 0, 18620,}, - }, - { - // Coeff Band ( 1 ) - {12419, 8420, 452, 62, 9, 1, 0, 0, 0, 0, 0, 0,}, - {11715, 8705, 693, 92, 15, 7, 2, 0, 0, 0, 0, 53988,}, - {7603, 8585, 2306, 778, 270, 145, 39, 5, 0, 0, 0, 9136,}, - }, - { - // Coeff Band ( 2 ) - {15938, 14335, 1207, 184, 55, 13, 4, 1, 0, 0, 0, 0,}, - {7415, 6829, 1138, 244, 71, 26, 7, 0, 0, 0, 0, 9980,}, - {1580, 1824, 655, 241, 89, 46, 10, 2, 0, 0, 0, 429,}, - }, - { - // Coeff Band ( 3 ) - {19453, 5260, 201, 19, 0, 0, 0, 0, 0, 0, 0, 0,}, - {9173, 3758, 213, 22, 1, 1, 0, 0, 0, 0, 0, 9820,}, - {1689, 1277, 276, 51, 17, 4, 0, 0, 0, 0, 0, 679,}, - }, - { - // Coeff Band ( 4 ) - {12076, 10667, 620, 85, 19, 9, 5, 0, 0, 0, 0, 0,}, - {4665, 3625, 423, 55, 19, 9, 0, 0, 0, 0, 0, 5127,}, - { 415, 440, 143, 34, 20, 7, 2, 0, 0, 0, 0, 101,}, - }, - { - // Coeff Band ( 5 ) - {12183, 4846, 115, 11, 1, 0, 0, 0, 0, 0, 0, 0,}, - {4226, 3149, 177, 21, 2, 0, 0, 0, 0, 0, 0, 7157,}, - { 375, 621, 189, 51, 11, 4, 1, 0, 0, 0, 0, 198,}, - }, - { - // Coeff Band ( 6 ) - {61658, 37743, 1203, 94, 10, 3, 0, 0, 0, 0, 0, 0,}, - {15514, 11563, 903, 111, 14, 5, 0, 0, 0, 0, 0, 25195,}, - { 929, 1077, 291, 78, 14, 7, 1, 0, 0, 0, 0, 507,}, - }, - { - // Coeff Band ( 7 ) - { 0, 990, 15, 3, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 0, 412, 13, 0, 0, 0, 0, 0, 0, 0, 0, 1641,}, - { 0, 18, 7, 1, 0, 0, 0, 0, 0, 0, 0, 30,}, - }, - }, - { - // Block Type ( 2 ) - { - // Coeff Band ( 0 ) - { 953, 24519, 628, 120, 28, 12, 4, 0, 0, 0, 0, 2248798,}, - {1525, 25654, 2647, 617, 239, 143, 42, 5, 0, 0, 0, 66837,}, - {1180, 11011, 3001, 1237, 532, 448, 239, 54, 5, 0, 0, 7122,}, - }, - { - // Coeff Band ( 1 ) - {1356, 2220, 67, 10, 4, 1, 0, 0, 0, 0, 0, 0,}, - {1450, 2544, 102, 18, 4, 3, 0, 0, 0, 0, 0, 57063,}, - {1182, 2110, 470, 130, 41, 21, 0, 0, 0, 0, 0, 6047,}, - }, - { - // Coeff Band ( 2 ) - { 370, 3378, 200, 30, 5, 4, 1, 0, 0, 0, 0, 0,}, - { 293, 1006, 131, 29, 11, 0, 0, 0, 0, 0, 0, 5404,}, - { 114, 387, 98, 23, 4, 8, 1, 0, 0, 0, 0, 236,}, - }, - { - // Coeff Band ( 3 ) - { 579, 194, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 395, 213, 5, 1, 0, 0, 0, 0, 0, 0, 0, 4157,}, - { 119, 122, 4, 0, 0, 0, 0, 0, 0, 0, 0, 300,}, - }, - { - // Coeff Band ( 4 ) - { 38, 557, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 21, 114, 12, 1, 0, 0, 0, 0, 0, 0, 0, 427,}, - { 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,}, - }, - { - // Coeff Band ( 5 ) - { 52, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 18, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 652,}, - { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30,}, - }, - { - // Coeff Band ( 6 ) - { 640, 569, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 25, 77, 2, 0, 0, 0, 0, 0, 0, 0, 0, 517,}, - { 4, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,}, - }, - { - // Coeff Band ( 7 ) - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - }, - }, - { - // Block Type ( 3 ) - { - // Coeff Band ( 0 ) - {2506, 20161, 2707, 767, 261, 178, 107, 30, 14, 3, 0, 100694,}, - {8806, 36478, 8817, 3268, 1280, 850, 401, 114, 42, 0, 0, 58572,}, - {11003, 27214, 11798, 5716, 2482, 2072, 1048, 175, 32, 0, 0, 19284,}, - }, - { - // Coeff Band ( 1 ) - {9738, 11313, 959, 205, 70, 18, 11, 1, 0, 0, 0, 0,}, - {12628, 15085, 1507, 273, 52, 19, 9, 0, 0, 0, 0, 54280,}, - {10701, 15846, 5561, 1926, 813, 570, 249, 36, 0, 0, 0, 6460,}, - }, - { - // Coeff Band ( 2 ) - {6781, 22539, 2784, 634, 182, 123, 20, 4, 0, 0, 0, 0,}, - {6263, 11544, 2649, 790, 259, 168, 27, 5, 0, 0, 0, 20539,}, - {3109, 4075, 2031, 896, 457, 386, 158, 29, 0, 0, 0, 1138,}, - }, - { - // Coeff Band ( 3 ) - {11515, 4079, 465, 73, 5, 14, 2, 0, 0, 0, 0, 0,}, - {9361, 5834, 650, 96, 24, 8, 4, 0, 0, 0, 0, 22181,}, - {4343, 3974, 1360, 415, 132, 96, 14, 1, 0, 0, 0, 1267,}, - }, - { - // Coeff Band ( 4 ) - {4787, 9297, 823, 168, 44, 12, 4, 0, 0, 0, 0, 0,}, - {3619, 4472, 719, 198, 60, 31, 3, 0, 0, 0, 0, 8401,}, - {1157, 1175, 483, 182, 88, 31, 8, 0, 0, 0, 0, 268,}, - }, - { - // Coeff Band ( 5 ) - {8299, 1226, 32, 5, 1, 0, 0, 0, 0, 0, 0, 0,}, - {3502, 1568, 57, 4, 1, 1, 0, 0, 0, 0, 0, 9811,}, - {1055, 1070, 166, 29, 6, 1, 0, 0, 0, 0, 0, 527,}, - }, - { - // Coeff Band ( 6 ) - {27414, 27927, 1989, 347, 69, 26, 0, 0, 0, 0, 0, 0,}, - {5876, 10074, 1574, 341, 91, 24, 4, 0, 0, 0, 0, 21954,}, - {1571, 2171, 778, 324, 124, 65, 16, 0, 0, 0, 0, 979,}, - }, - { - // Coeff Band ( 7 ) - { 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 459,}, - { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13,}, - }, - }, -}; - -//Update probabilities for the nodes in the token entropy tree. -const vp8_prob tree_update_probs[vp8_coef_tree_dimen] = -{ - { - { - {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, }, - }, - }, -}; -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/debugmodes.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/debugmodes.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/debugmodes.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/debugmodes.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include -#include "blockd.h" - - -void vp8_print_modes_and_motion_vectors(MODE_INFO *mi, int rows, int cols, int frame) -{ - - int mb_row; - int mb_col; - int mb_index = 0; - FILE *mvs = fopen("mvs.stt", "a"); - - /* print out the macroblock Y modes */ - mb_index = 0; - fprintf(mvs, "Mb Modes for Frame %d\n", frame); - - for (mb_row = 0; mb_row < rows; mb_row++) - { - for (mb_col = 0; mb_col < cols; mb_col++) - { - - fprintf(mvs, "%2d ", mi[mb_index].mbmi.mode); - - mb_index++; - } - - fprintf(mvs, "\n"); - mb_index++; - } - - fprintf(mvs, "\n"); - - mb_index = 0; - fprintf(mvs, "Mb mv ref for Frame %d\n", frame); - - for (mb_row = 0; mb_row < rows; mb_row++) - { - for (mb_col = 0; mb_col < cols; mb_col++) - { - - fprintf(mvs, "%2d ", mi[mb_index].mbmi.ref_frame); - - mb_index++; - } - - fprintf(mvs, "\n"); - mb_index++; - } - - fprintf(mvs, "\n"); - - /* print out the macroblock UV modes */ - mb_index = 0; - fprintf(mvs, "UV Modes for Frame %d\n", frame); - - for (mb_row = 0; mb_row < rows; mb_row++) - { - for (mb_col = 0; mb_col < cols; mb_col++) - { - - fprintf(mvs, "%2d ", mi[mb_index].mbmi.uv_mode); - - mb_index++; - } - - mb_index++; - fprintf(mvs, "\n"); - } - - fprintf(mvs, "\n"); - - /* print out the block modes */ - mb_index = 0; - fprintf(mvs, "Mbs for Frame %d\n", frame); - { - int b_row; - - for (b_row = 0; b_row < 4 * rows; b_row++) - { - int b_col; - int bindex; - - for (b_col = 0; b_col < 4 * cols; b_col++) - { - mb_index = (b_row >> 2) * (cols + 1) + (b_col >> 2); - bindex = (b_row & 3) * 4 + (b_col & 3); - - if (mi[mb_index].mbmi.mode == B_PRED) - fprintf(mvs, "%2d ", mi[mb_index].bmi[bindex].as_mode); - else - fprintf(mvs, "xx "); - - } - - fprintf(mvs, "\n"); - } - } - fprintf(mvs, "\n"); - - /* print out the macroblock mvs */ - mb_index = 0; - fprintf(mvs, "MVs for Frame %d\n", frame); - - for (mb_row = 0; mb_row < rows; mb_row++) - { - for (mb_col = 0; mb_col < cols; mb_col++) - { - fprintf(mvs, "%5d:%-5d", mi[mb_index].mbmi.mv.as_mv.row / 2, mi[mb_index].mbmi.mv.as_mv.col / 2); - - mb_index++; - } - - mb_index++; - fprintf(mvs, "\n"); - } - - fprintf(mvs, "\n"); - - - /* print out the block modes */ - mb_index = 0; - fprintf(mvs, "MVs for Frame %d\n", frame); - { - int b_row; - - for (b_row = 0; b_row < 4 * rows; b_row++) - { - int b_col; - int bindex; - - for (b_col = 0; b_col < 4 * cols; b_col++) - { - mb_index = (b_row >> 2) * (cols + 1) + (b_col >> 2); - bindex = (b_row & 3) * 4 + (b_col & 3); - fprintf(mvs, "%3d:%-3d ", mi[mb_index].bmi[bindex].mv.as_mv.row, mi[mb_index].bmi[bindex].mv.as_mv.col); - - } - - fprintf(mvs, "\n"); - } - } - fprintf(mvs, "\n"); - - - fclose(mvs); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/default_coef_probs.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/default_coef_probs.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/default_coef_probs.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/default_coef_probs.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,200 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. -*/ - -#ifndef VP8_COMMON_DEFAULT_COEF_PROBS_H_ -#define VP8_COMMON_DEFAULT_COEF_PROBS_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/*Generated file, included by entropy.c*/ - - -static const vp8_prob default_coef_probs [BLOCK_TYPES] - [COEF_BANDS] - [PREV_COEF_CONTEXTS] - [ENTROPY_NODES] = -{ - { /* Block Type ( 0 ) */ - { /* Coeff Band ( 0 )*/ - { 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 } - }, - { /* Coeff Band ( 1 )*/ - { 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 } - }, - { /* Coeff Band ( 2 )*/ - { 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 } - }, - { /* Coeff Band ( 3 )*/ - { 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 } - }, - { /* Coeff Band ( 4 )*/ - { 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 } - }, - { /* Coeff Band ( 5 )*/ - { 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 } - }, - { /* Coeff Band ( 6 )*/ - { 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 } - }, - { /* Coeff Band ( 7 )*/ - { 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 } - } - }, - { /* Block Type ( 1 ) */ - { /* Coeff Band ( 0 )*/ - { 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 } - }, - { /* Coeff Band ( 1 )*/ - { 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 } - }, - { /* Coeff Band ( 2 )*/ - { 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 } - }, - { /* Coeff Band ( 3 )*/ - { 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 } - }, - { /* Coeff Band ( 4 )*/ - { 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 } - }, - { /* Coeff Band ( 5 )*/ - { 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 } - }, - { /* Coeff Band ( 6 )*/ - { 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 } - }, - { /* Coeff Band ( 7 )*/ - { 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 } - } - }, - { /* Block Type ( 2 ) */ - { /* Coeff Band ( 0 )*/ - { 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 } - }, - { /* Coeff Band ( 1 )*/ - { 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 } - }, - { /* Coeff Band ( 2 )*/ - { 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 } - }, - { /* Coeff Band ( 3 )*/ - { 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 } - }, - { /* Coeff Band ( 4 )*/ - { 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 } - }, - { /* Coeff Band ( 5 )*/ - { 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 } - }, - { /* Coeff Band ( 6 )*/ - { 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 } - }, - { /* Coeff Band ( 7 )*/ - { 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 } - } - }, - { /* Block Type ( 3 ) */ - { /* Coeff Band ( 0 )*/ - { 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 } - }, - { /* Coeff Band ( 1 )*/ - { 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 } - }, - { /* Coeff Band ( 2 )*/ - { 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 } - }, - { /* Coeff Band ( 3 )*/ - { 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 } - }, - { /* Coeff Band ( 4 )*/ - { 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 } - }, - { /* Coeff Band ( 5 )*/ - { 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 } - }, - { /* Coeff Band ( 6 )*/ - { 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 } - }, - { /* Coeff Band ( 7 )*/ - { 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 } - } - } -}; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_DEFAULT_COEF_PROBS_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/dequantize.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/dequantize.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/dequantize.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/dequantize.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "vp8/common/blockd.h" -#include "vpx_mem/vpx_mem.h" - -void vp8_dequantize_b_c(BLOCKD *d, short *DQC) -{ - int i; - short *DQ = d->dqcoeff; - short *Q = d->qcoeff; - - for (i = 0; i < 16; i++) - { - DQ[i] = Q[i] * DQC[i]; - } -} - -void vp8_dequant_idct_add_c(short *input, short *dq, - unsigned char *dest, int stride) -{ - int i; - - for (i = 0; i < 16; i++) - { - input[i] = dq[i] * input[i]; - } - - vp8_short_idct4x4llm_c(input, dest, stride, dest, stride); - - vpx_memset(input, 0, 32); - -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/entropy.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/entropy.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/entropy.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/entropy.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "entropy.h" -#include "blockd.h" -#include "onyxc_int.h" -#include "vpx_mem/vpx_mem.h" - -#include "coefupdateprobs.h" - -DECLARE_ALIGNED(16, const unsigned char, vp8_norm[256]) = -{ - 0, 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 -}; - -DECLARE_ALIGNED(16, const unsigned char, vp8_coef_bands[16]) = -{ 0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7}; - -DECLARE_ALIGNED(16, const unsigned char, - vp8_prev_token_class[MAX_ENTROPY_TOKENS]) = -{ 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0}; - -DECLARE_ALIGNED(16, const int, vp8_default_zig_zag1d[16]) = -{ - 0, 1, 4, 8, - 5, 2, 3, 6, - 9, 12, 13, 10, - 7, 11, 14, 15, -}; - -DECLARE_ALIGNED(16, const short, vp8_default_inv_zig_zag[16]) = -{ - 1, 2, 6, 7, - 3, 5, 8, 13, - 4, 9, 12, 14, - 10, 11, 15, 16 -}; - -/* vp8_default_zig_zag_mask generated with: - - void vp8_init_scan_order_mask() - { - int i; - - for (i = 0; i < 16; i++) - { - vp8_default_zig_zag_mask[vp8_default_zig_zag1d[i]] = 1 << i; - } - - } -*/ -DECLARE_ALIGNED(16, const short, vp8_default_zig_zag_mask[16]) = -{ - 1, 2, 32, 64, - 4, 16, 128, 4096, - 8, 256, 2048, 8192, - 512, 1024, 16384, -32768 -}; - -const int vp8_mb_feature_data_bits[MB_LVL_MAX] = {7, 6}; - -/* Array indices are identical to previously-existing CONTEXT_NODE indices */ - -const vp8_tree_index vp8_coef_tree[ 22] = /* corresponding _CONTEXT_NODEs */ -{ - -DCT_EOB_TOKEN, 2, /* 0 = EOB */ - -ZERO_TOKEN, 4, /* 1 = ZERO */ - -ONE_TOKEN, 6, /* 2 = ONE */ - 8, 12, /* 3 = LOW_VAL */ - -TWO_TOKEN, 10, /* 4 = TWO */ - -THREE_TOKEN, -FOUR_TOKEN, /* 5 = THREE */ - 14, 16, /* 6 = HIGH_LOW */ - -DCT_VAL_CATEGORY1, -DCT_VAL_CATEGORY2, /* 7 = CAT_ONE */ - 18, 20, /* 8 = CAT_THREEFOUR */ - -DCT_VAL_CATEGORY3, -DCT_VAL_CATEGORY4, /* 9 = CAT_THREE */ - -DCT_VAL_CATEGORY5, -DCT_VAL_CATEGORY6 /* 10 = CAT_FIVE */ -}; - -/* vp8_coef_encodings generated with: - vp8_tokens_from_tree(vp8_coef_encodings, vp8_coef_tree); -*/ -vp8_token vp8_coef_encodings[MAX_ENTROPY_TOKENS] = -{ - {2, 2}, - {6, 3}, - {28, 5}, - {58, 6}, - {59, 6}, - {60, 6}, - {61, 6}, - {124, 7}, - {125, 7}, - {126, 7}, - {127, 7}, - {0, 1} -}; - -/* Trees for extra bits. Probabilities are constant and - do not depend on previously encoded bits */ - -static const vp8_prob Pcat1[] = { 159}; -static const vp8_prob Pcat2[] = { 165, 145}; -static const vp8_prob Pcat3[] = { 173, 148, 140}; -static const vp8_prob Pcat4[] = { 176, 155, 140, 135}; -static const vp8_prob Pcat5[] = { 180, 157, 141, 134, 130}; -static const vp8_prob Pcat6[] = -{ 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129}; - - -/* tree index tables generated with: - - void init_bit_tree(vp8_tree_index *p, int n) - { - int i = 0; - - while (++i < n) - { - p[0] = p[1] = i << 1; - p += 2; - } - - p[0] = p[1] = 0; - } - - void init_bit_trees() - { - init_bit_tree(cat1, 1); - init_bit_tree(cat2, 2); - init_bit_tree(cat3, 3); - init_bit_tree(cat4, 4); - init_bit_tree(cat5, 5); - init_bit_tree(cat6, 11); - } -*/ - -static const vp8_tree_index cat1[2] = { 0, 0 }; -static const vp8_tree_index cat2[4] = { 2, 2, 0, 0 }; -static const vp8_tree_index cat3[6] = { 2, 2, 4, 4, 0, 0 }; -static const vp8_tree_index cat4[8] = { 2, 2, 4, 4, 6, 6, 0, 0 }; -static const vp8_tree_index cat5[10] = { 2, 2, 4, 4, 6, 6, 8, 8, 0, 0 }; -static const vp8_tree_index cat6[22] = { 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, - 14, 14, 16, 16, 18, 18, 20, 20, 0, 0 }; - -const vp8_extra_bit_struct vp8_extra_bits[12] = -{ - { 0, 0, 0, 0}, - { 0, 0, 0, 1}, - { 0, 0, 0, 2}, - { 0, 0, 0, 3}, - { 0, 0, 0, 4}, - { cat1, Pcat1, 1, 5}, - { cat2, Pcat2, 2, 7}, - { cat3, Pcat3, 3, 11}, - { cat4, Pcat4, 4, 19}, - { cat5, Pcat5, 5, 35}, - { cat6, Pcat6, 11, 67}, - { 0, 0, 0, 0} -}; - -#include "default_coef_probs.h" - -void vp8_default_coef_probs(VP8_COMMON *pc) -{ - vpx_memcpy(pc->fc.coef_probs, default_coef_probs, - sizeof(default_coef_probs)); -} - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/entropy.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/entropy.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/entropy.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/entropy.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_ENTROPY_H_ -#define VP8_COMMON_ENTROPY_H_ - -#include "treecoder.h" -#include "blockd.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Coefficient token alphabet */ - -#define ZERO_TOKEN 0 /* 0 Extra Bits 0+0 */ -#define ONE_TOKEN 1 /* 1 Extra Bits 0+1 */ -#define TWO_TOKEN 2 /* 2 Extra Bits 0+1 */ -#define THREE_TOKEN 3 /* 3 Extra Bits 0+1 */ -#define FOUR_TOKEN 4 /* 4 Extra Bits 0+1 */ -#define DCT_VAL_CATEGORY1 5 /* 5-6 Extra Bits 1+1 */ -#define DCT_VAL_CATEGORY2 6 /* 7-10 Extra Bits 2+1 */ -#define DCT_VAL_CATEGORY3 7 /* 11-18 Extra Bits 3+1 */ -#define DCT_VAL_CATEGORY4 8 /* 19-34 Extra Bits 4+1 */ -#define DCT_VAL_CATEGORY5 9 /* 35-66 Extra Bits 5+1 */ -#define DCT_VAL_CATEGORY6 10 /* 67+ Extra Bits 11+1 */ -#define DCT_EOB_TOKEN 11 /* EOB Extra Bits 0+0 */ - -#define MAX_ENTROPY_TOKENS 12 -#define ENTROPY_NODES 11 - -extern const vp8_tree_index vp8_coef_tree[]; - -extern const struct vp8_token_struct vp8_coef_encodings[MAX_ENTROPY_TOKENS]; - -typedef struct -{ - vp8_tree_p tree; - const vp8_prob *prob; - int Len; - int base_val; -} vp8_extra_bit_struct; - -extern const vp8_extra_bit_struct vp8_extra_bits[12]; /* indexed by token value */ - -#define PROB_UPDATE_BASELINE_COST 7 - -#define MAX_PROB 255 -#define DCT_MAX_VALUE 2048 - - -/* Coefficients are predicted via a 3-dimensional probability table. */ - -/* Outside dimension. 0 = Y no DC, 1 = Y2, 2 = UV, 3 = Y with DC */ - -#define BLOCK_TYPES 4 - -/* Middle dimension is a coarsening of the coefficient's - position within the 4x4 DCT. */ - -#define COEF_BANDS 8 -extern DECLARE_ALIGNED(16, const unsigned char, vp8_coef_bands[16]); - -/* Inside dimension is 3-valued measure of nearby complexity, that is, - the extent to which nearby coefficients are nonzero. For the first - coefficient (DC, unless block type is 0), we look at the (already encoded) - blocks above and to the left of the current block. The context index is - then the number (0,1,or 2) of these blocks having nonzero coefficients. - After decoding a coefficient, the measure is roughly the size of the - most recently decoded coefficient (0 for 0, 1 for 1, 2 for >1). - Note that the intuitive meaning of this measure changes as coefficients - are decoded, e.g., prior to the first token, a zero means that my neighbors - are empty while, after the first token, because of the use of end-of-block, - a zero means we just decoded a zero and hence guarantees that a non-zero - coefficient will appear later in this block. However, this shift - in meaning is perfectly OK because our context depends also on the - coefficient band (and since zigzag positions 0, 1, and 2 are in - distinct bands). */ - -/*# define DC_TOKEN_CONTEXTS 3*/ /* 00, 0!0, !0!0 */ -# define PREV_COEF_CONTEXTS 3 - -extern DECLARE_ALIGNED(16, const unsigned char, vp8_prev_token_class[MAX_ENTROPY_TOKENS]); - -extern const vp8_prob vp8_coef_update_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES]; - - -struct VP8Common; -void vp8_default_coef_probs(struct VP8Common *); - -extern DECLARE_ALIGNED(16, const int, vp8_default_zig_zag1d[16]); -extern DECLARE_ALIGNED(16, const short, vp8_default_inv_zig_zag[16]); -extern DECLARE_ALIGNED(16, const short, vp8_default_zig_zag_mask[16]); -extern const int vp8_mb_feature_data_bits[MB_LVL_MAX]; - -void vp8_coef_tree_initialize(void); -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_ENTROPY_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/entropymode.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/entropymode.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/entropymode.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/entropymode.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,171 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#define USE_PREBUILT_TABLES - -#include "entropymode.h" -#include "entropy.h" -#include "vpx_mem/vpx_mem.h" - -#include "vp8_entropymodedata.h" - -int vp8_mv_cont(const int_mv *l, const int_mv *a) -{ - int lez = (l->as_int == 0); - int aez = (a->as_int == 0); - int lea = (l->as_int == a->as_int); - - if (lea && lez) - return SUBMVREF_LEFT_ABOVE_ZED; - - if (lea) - return SUBMVREF_LEFT_ABOVE_SAME; - - if (aez) - return SUBMVREF_ABOVE_ZED; - - if (lez) - return SUBMVREF_LEFT_ZED; - - return SUBMVREF_NORMAL; -} - -static const vp8_prob sub_mv_ref_prob [VP8_SUBMVREFS-1] = { 180, 162, 25}; - -const vp8_prob vp8_sub_mv_ref_prob2 [SUBMVREF_COUNT][VP8_SUBMVREFS-1] = -{ - { 147, 136, 18 }, - { 106, 145, 1 }, - { 179, 121, 1 }, - { 223, 1 , 34 }, - { 208, 1 , 1 } -}; - - - -const vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS] = -{ - { - 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, - } -}; - -const int vp8_mbsplit_count [VP8_NUMMBSPLITS] = { 2, 2, 4, 16}; - -const vp8_prob vp8_mbsplit_probs [VP8_NUMMBSPLITS-1] = { 110, 111, 150}; - - -/* Array indices are identical to previously-existing INTRAMODECONTEXTNODES. */ - -const vp8_tree_index vp8_bmode_tree[18] = /* INTRAMODECONTEXTNODE value */ -{ - -B_DC_PRED, 2, /* 0 = DC_NODE */ - -B_TM_PRED, 4, /* 1 = TM_NODE */ - -B_VE_PRED, 6, /* 2 = VE_NODE */ - 8, 12, /* 3 = COM_NODE */ - -B_HE_PRED, 10, /* 4 = HE_NODE */ - -B_RD_PRED, -B_VR_PRED, /* 5 = RD_NODE */ - -B_LD_PRED, 14, /* 6 = LD_NODE */ - -B_VL_PRED, 16, /* 7 = VL_NODE */ - -B_HD_PRED, -B_HU_PRED /* 8 = HD_NODE */ -}; - -/* Again, these trees use the same probability indices as their - explicitly-programmed predecessors. */ - -const vp8_tree_index vp8_ymode_tree[8] = -{ - -DC_PRED, 2, - 4, 6, - -V_PRED, -H_PRED, - -TM_PRED, -B_PRED -}; - -const vp8_tree_index vp8_kf_ymode_tree[8] = -{ - -B_PRED, 2, - 4, 6, - -DC_PRED, -V_PRED, - -H_PRED, -TM_PRED -}; - -const vp8_tree_index vp8_uv_mode_tree[6] = -{ - -DC_PRED, 2, - -V_PRED, 4, - -H_PRED, -TM_PRED -}; - -const vp8_tree_index vp8_mbsplit_tree[6] = -{ - -3, 2, - -2, 4, - -0, -1 -}; - -const vp8_tree_index vp8_mv_ref_tree[8] = -{ - -ZEROMV, 2, - -NEARESTMV, 4, - -NEARMV, 6, - -NEWMV, -SPLITMV -}; - -const vp8_tree_index vp8_sub_mv_ref_tree[6] = -{ - -LEFT4X4, 2, - -ABOVE4X4, 4, - -ZERO4X4, -NEW4X4 -}; - -const vp8_tree_index vp8_small_mvtree [14] = -{ - 2, 8, - 4, 6, - -0, -1, - -2, -3, - 10, 12, - -4, -5, - -6, -7 -}; - -void vp8_init_mbmode_probs(VP8_COMMON *x) -{ - vpx_memcpy(x->fc.ymode_prob, vp8_ymode_prob, sizeof(vp8_ymode_prob)); - vpx_memcpy(x->fc.uv_mode_prob, vp8_uv_mode_prob, sizeof(vp8_uv_mode_prob)); - vpx_memcpy(x->fc.sub_mv_ref_prob, sub_mv_ref_prob, sizeof(sub_mv_ref_prob)); -} - -void vp8_default_bmode_probs(vp8_prob p [VP8_BINTRAMODES-1]) -{ - vpx_memcpy(p, vp8_bmode_prob, sizeof(vp8_bmode_prob)); -} - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/entropymode.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/entropymode.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/entropymode.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/entropymode.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_ENTROPYMODE_H_ -#define VP8_COMMON_ENTROPYMODE_H_ - -#include "onyxc_int.h" -#include "treecoder.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum -{ - SUBMVREF_NORMAL, - SUBMVREF_LEFT_ZED, - SUBMVREF_ABOVE_ZED, - SUBMVREF_LEFT_ABOVE_SAME, - SUBMVREF_LEFT_ABOVE_ZED -} sumvfref_t; - -typedef int vp8_mbsplit[16]; - -#define VP8_NUMMBSPLITS 4 - -extern const vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS]; - -extern const int vp8_mbsplit_count [VP8_NUMMBSPLITS]; /* # of subsets */ - -extern const vp8_prob vp8_mbsplit_probs [VP8_NUMMBSPLITS-1]; - -extern int vp8_mv_cont(const int_mv *l, const int_mv *a); -#define SUBMVREF_COUNT 5 -extern const vp8_prob vp8_sub_mv_ref_prob2 [SUBMVREF_COUNT][VP8_SUBMVREFS-1]; - - -extern const unsigned int vp8_kf_default_bmode_counts [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES]; - - -extern const vp8_tree_index vp8_bmode_tree[]; - -extern const vp8_tree_index vp8_ymode_tree[]; -extern const vp8_tree_index vp8_kf_ymode_tree[]; -extern const vp8_tree_index vp8_uv_mode_tree[]; - -extern const vp8_tree_index vp8_mbsplit_tree[]; -extern const vp8_tree_index vp8_mv_ref_tree[]; -extern const vp8_tree_index vp8_sub_mv_ref_tree[]; - -extern const struct vp8_token_struct vp8_bmode_encodings[VP8_BINTRAMODES]; -extern const struct vp8_token_struct vp8_ymode_encodings[VP8_YMODES]; -extern const struct vp8_token_struct vp8_kf_ymode_encodings[VP8_YMODES]; -extern const struct vp8_token_struct vp8_uv_mode_encodings[VP8_UV_MODES]; -extern const struct vp8_token_struct vp8_mbsplit_encodings[VP8_NUMMBSPLITS]; - -/* Inter mode values do not start at zero */ - -extern const struct vp8_token_struct vp8_mv_ref_encoding_array[VP8_MVREFS]; -extern const struct vp8_token_struct vp8_sub_mv_ref_encoding_array[VP8_SUBMVREFS]; - -extern const vp8_tree_index vp8_small_mvtree[]; - -extern const struct vp8_token_struct vp8_small_mvencodings[8]; - -/* Key frame default mode probs */ -extern const vp8_prob vp8_kf_bmode_prob[VP8_BINTRAMODES][VP8_BINTRAMODES] -[VP8_BINTRAMODES-1]; -extern const vp8_prob vp8_kf_uv_mode_prob[VP8_UV_MODES-1]; -extern const vp8_prob vp8_kf_ymode_prob[VP8_YMODES-1]; - -void vp8_init_mbmode_probs(VP8_COMMON *x); -void vp8_default_bmode_probs(vp8_prob dest [VP8_BINTRAMODES-1]); -void vp8_kf_default_bmode_probs(vp8_prob dest [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES-1]); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_ENTROPYMODE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/entropymv.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/entropymv.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/entropymv.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/entropymv.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "entropymv.h" - -const MV_CONTEXT vp8_mv_update_probs[2] = -{ - {{ - 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 - }} -}; -const MV_CONTEXT vp8_default_mv_context[2] = -{ - {{ - /* row */ - 162, /* is short */ - 128, /* sign */ - 225, 146, 172, 147, 214, 39, 156, /* short tree */ - 128, 129, 132, 75, 145, 178, 206, 239, 254, 254 /* long bits */ - }}, - - - - {{ - /* same for column */ - 164, /* is short */ - 128, - 204, 170, 119, 235, 140, 230, 228, - 128, 130, 130, 74, 148, 180, 203, 236, 254, 254 /* long bits */ - - }} -}; diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/entropymv.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/entropymv.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/entropymv.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/entropymv.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_ENTROPYMV_H_ -#define VP8_COMMON_ENTROPYMV_H_ - -#include "treecoder.h" - -#ifdef __cplusplus -extern "C" { -#endif - -enum -{ - mv_max = 1023, /* max absolute value of a MV component */ - MVvals = (2 * mv_max) + 1, /* # possible values "" */ - mvfp_max = 255, /* max absolute value of a full pixel MV component */ - MVfpvals = (2 * mvfp_max) +1, /* # possible full pixel MV values */ - - mvlong_width = 10, /* Large MVs have 9 bit magnitudes */ - mvnum_short = 8, /* magnitudes 0 through 7 */ - - /* probability offsets for coding each MV component */ - - mvpis_short = 0, /* short (<= 7) vs long (>= 8) */ - MVPsign, /* sign for non-zero */ - MVPshort, /* 8 short values = 7-position tree */ - - MVPbits = MVPshort + mvnum_short - 1, /* mvlong_width long value bits */ - MVPcount = MVPbits + mvlong_width /* (with independent probabilities) */ -}; - -typedef struct mv_context -{ - vp8_prob prob[MVPcount]; /* often come in row, col pairs */ -} MV_CONTEXT; - -extern const MV_CONTEXT vp8_mv_update_probs[2], vp8_default_mv_context[2]; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_ENTROPYMV_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/extend.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/extend.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/extend.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/extend.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,188 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "extend.h" -#include "vpx_mem/vpx_mem.h" - - -static void copy_and_extend_plane -( - unsigned char *s, /* source */ - int sp, /* source pitch */ - unsigned char *d, /* destination */ - int dp, /* destination pitch */ - int h, /* height */ - int w, /* width */ - int et, /* extend top border */ - int el, /* extend left border */ - int eb, /* extend bottom border */ - int er /* extend right border */ -) -{ - int i; - unsigned char *src_ptr1, *src_ptr2; - unsigned char *dest_ptr1, *dest_ptr2; - int linesize; - - /* copy the left and right most columns out */ - src_ptr1 = s; - src_ptr2 = s + w - 1; - dest_ptr1 = d - el; - dest_ptr2 = d + w; - - for (i = 0; i < h; i++) - { - vpx_memset(dest_ptr1, src_ptr1[0], el); - vpx_memcpy(dest_ptr1 + el, src_ptr1, w); - vpx_memset(dest_ptr2, src_ptr2[0], er); - src_ptr1 += sp; - src_ptr2 += sp; - dest_ptr1 += dp; - dest_ptr2 += dp; - } - - /* Now copy the top and bottom lines into each line of the respective - * borders - */ - src_ptr1 = d - el; - src_ptr2 = d + dp * (h - 1) - el; - dest_ptr1 = d + dp * (-et) - el; - dest_ptr2 = d + dp * (h) - el; - linesize = el + er + w; - - for (i = 0; i < et; i++) - { - vpx_memcpy(dest_ptr1, src_ptr1, linesize); - dest_ptr1 += dp; - } - - for (i = 0; i < eb; i++) - { - vpx_memcpy(dest_ptr2, src_ptr2, linesize); - dest_ptr2 += dp; - } -} - - -void vp8_copy_and_extend_frame(YV12_BUFFER_CONFIG *src, - YV12_BUFFER_CONFIG *dst) -{ - int et = dst->border; - int el = dst->border; - int eb = dst->border + dst->y_height - src->y_height; - int er = dst->border + dst->y_width - src->y_width; - - copy_and_extend_plane(src->y_buffer, src->y_stride, - dst->y_buffer, dst->y_stride, - src->y_height, src->y_width, - et, el, eb, er); - - et = dst->border >> 1; - el = dst->border >> 1; - eb = (dst->border >> 1) + dst->uv_height - src->uv_height; - er = (dst->border >> 1) + dst->uv_width - src->uv_width; - - copy_and_extend_plane(src->u_buffer, src->uv_stride, - dst->u_buffer, dst->uv_stride, - src->uv_height, src->uv_width, - et, el, eb, er); - - copy_and_extend_plane(src->v_buffer, src->uv_stride, - dst->v_buffer, dst->uv_stride, - src->uv_height, src->uv_width, - et, el, eb, er); -} - - -void vp8_copy_and_extend_frame_with_rect(YV12_BUFFER_CONFIG *src, - YV12_BUFFER_CONFIG *dst, - int srcy, int srcx, - int srch, int srcw) -{ - int et = dst->border; - int el = dst->border; - int eb = dst->border + dst->y_height - src->y_height; - int er = dst->border + dst->y_width - src->y_width; - int src_y_offset = srcy * src->y_stride + srcx; - int dst_y_offset = srcy * dst->y_stride + srcx; - int src_uv_offset = ((srcy * src->uv_stride) >> 1) + (srcx >> 1); - int dst_uv_offset = ((srcy * dst->uv_stride) >> 1) + (srcx >> 1); - - /* If the side is not touching the bounder then don't extend. */ - if (srcy) - et = 0; - if (srcx) - el = 0; - if (srcy + srch != src->y_height) - eb = 0; - if (srcx + srcw != src->y_width) - er = 0; - - copy_and_extend_plane(src->y_buffer + src_y_offset, - src->y_stride, - dst->y_buffer + dst_y_offset, - dst->y_stride, - srch, srcw, - et, el, eb, er); - - et = (et + 1) >> 1; - el = (el + 1) >> 1; - eb = (eb + 1) >> 1; - er = (er + 1) >> 1; - srch = (srch + 1) >> 1; - srcw = (srcw + 1) >> 1; - - copy_and_extend_plane(src->u_buffer + src_uv_offset, - src->uv_stride, - dst->u_buffer + dst_uv_offset, - dst->uv_stride, - srch, srcw, - et, el, eb, er); - - copy_and_extend_plane(src->v_buffer + src_uv_offset, - src->uv_stride, - dst->v_buffer + dst_uv_offset, - dst->uv_stride, - srch, srcw, - et, el, eb, er); -} - - -/* note the extension is only for the last row, for intra prediction purpose */ -void vp8_extend_mb_row(YV12_BUFFER_CONFIG *ybf, - unsigned char *YPtr, - unsigned char *UPtr, - unsigned char *VPtr) -{ - int i; - - YPtr += ybf->y_stride * 14; - UPtr += ybf->uv_stride * 6; - VPtr += ybf->uv_stride * 6; - - for (i = 0; i < 4; i++) - { - YPtr[i] = YPtr[-1]; - UPtr[i] = UPtr[-1]; - VPtr[i] = VPtr[-1]; - } - - YPtr += ybf->y_stride; - UPtr += ybf->uv_stride; - VPtr += ybf->uv_stride; - - for (i = 0; i < 4; i++) - { - YPtr[i] = YPtr[-1]; - UPtr[i] = UPtr[-1]; - VPtr[i] = VPtr[-1]; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/extend.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/extend.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/extend.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/extend.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_EXTEND_H_ -#define VP8_COMMON_EXTEND_H_ - -#include "vpx_scale/yv12config.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void vp8_extend_mb_row(YV12_BUFFER_CONFIG *ybf, unsigned char *YPtr, unsigned char *UPtr, unsigned char *VPtr); -void vp8_copy_and_extend_frame(YV12_BUFFER_CONFIG *src, - YV12_BUFFER_CONFIG *dst); -void vp8_copy_and_extend_frame_with_rect(YV12_BUFFER_CONFIG *src, - YV12_BUFFER_CONFIG *dst, - int srcy, int srcx, - int srch, int srcw); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_EXTEND_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/filter.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/filter.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/filter.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/filter.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,492 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "filter.h" - -DECLARE_ALIGNED(16, const short, vp8_bilinear_filters[8][2]) = -{ - { 128, 0 }, - { 112, 16 }, - { 96, 32 }, - { 80, 48 }, - { 64, 64 }, - { 48, 80 }, - { 32, 96 }, - { 16, 112 } -}; - -DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters[8][6]) = -{ - - { 0, 0, 128, 0, 0, 0 }, /* note that 1/8 pel positions are just as per alpha -0.5 bicubic */ - { 0, -6, 123, 12, -1, 0 }, - { 2, -11, 108, 36, -8, 1 }, /* New 1/4 pel 6 tap filter */ - { 0, -9, 93, 50, -6, 0 }, - { 3, -16, 77, 77, -16, 3 }, /* New 1/2 pel 6 tap filter */ - { 0, -6, 50, 93, -9, 0 }, - { 1, -8, 36, 108, -11, 2 }, /* New 1/4 pel 6 tap filter */ - { 0, -1, 12, 123, -6, 0 }, -}; - -static void filter_block2d_first_pass -( - unsigned char *src_ptr, - int *output_ptr, - unsigned int src_pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter -) -{ - unsigned int i, j; - int Temp; - - for (i = 0; i < output_height; i++) - { - for (j = 0; j < output_width; j++) - { - Temp = ((int)src_ptr[-2 * (int)pixel_step] * vp8_filter[0]) + - ((int)src_ptr[-1 * (int)pixel_step] * vp8_filter[1]) + - ((int)src_ptr[0] * vp8_filter[2]) + - ((int)src_ptr[pixel_step] * vp8_filter[3]) + - ((int)src_ptr[2*pixel_step] * vp8_filter[4]) + - ((int)src_ptr[3*pixel_step] * vp8_filter[5]) + - (VP8_FILTER_WEIGHT >> 1); /* Rounding */ - - /* Normalize back to 0-255 */ - Temp = Temp >> VP8_FILTER_SHIFT; - - if (Temp < 0) - Temp = 0; - else if (Temp > 255) - Temp = 255; - - output_ptr[j] = Temp; - src_ptr++; - } - - /* Next row... */ - src_ptr += src_pixels_per_line - output_width; - output_ptr += output_width; - } -} - -static void filter_block2d_second_pass -( - int *src_ptr, - unsigned char *output_ptr, - int output_pitch, - unsigned int src_pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter -) -{ - unsigned int i, j; - int Temp; - - for (i = 0; i < output_height; i++) - { - for (j = 0; j < output_width; j++) - { - /* Apply filter */ - Temp = ((int)src_ptr[-2 * (int)pixel_step] * vp8_filter[0]) + - ((int)src_ptr[-1 * (int)pixel_step] * vp8_filter[1]) + - ((int)src_ptr[0] * vp8_filter[2]) + - ((int)src_ptr[pixel_step] * vp8_filter[3]) + - ((int)src_ptr[2*pixel_step] * vp8_filter[4]) + - ((int)src_ptr[3*pixel_step] * vp8_filter[5]) + - (VP8_FILTER_WEIGHT >> 1); /* Rounding */ - - /* Normalize back to 0-255 */ - Temp = Temp >> VP8_FILTER_SHIFT; - - if (Temp < 0) - Temp = 0; - else if (Temp > 255) - Temp = 255; - - output_ptr[j] = (unsigned char)Temp; - src_ptr++; - } - - /* Start next row */ - src_ptr += src_pixels_per_line - output_width; - output_ptr += output_pitch; - } -} - - -static void filter_block2d -( - unsigned char *src_ptr, - unsigned char *output_ptr, - unsigned int src_pixels_per_line, - int output_pitch, - const short *HFilter, - const short *VFilter -) -{ - int FData[9*4]; /* Temp data buffer used in filtering */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 1, 9, 4, HFilter); - - /* then filter verticaly... */ - filter_block2d_second_pass(FData + 8, output_ptr, output_pitch, 4, 4, 4, 4, VFilter); -} - - -void vp8_sixtap_predict4x4_c -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_sub_pel_filters[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters[yoffset]; /* 6 tap */ - - filter_block2d(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter); -} -void vp8_sixtap_predict8x8_c -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - int FData[13*16]; /* Temp data buffer used in filtering */ - - HFilter = vp8_sub_pel_filters[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters[yoffset]; /* 6 tap */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 1, 13, 8, HFilter); - - - /* then filter verticaly... */ - filter_block2d_second_pass(FData + 16, dst_ptr, dst_pitch, 8, 8, 8, 8, VFilter); - -} - -void vp8_sixtap_predict8x4_c -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - int FData[13*16]; /* Temp data buffer used in filtering */ - - HFilter = vp8_sub_pel_filters[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters[yoffset]; /* 6 tap */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 1, 9, 8, HFilter); - - - /* then filter verticaly... */ - filter_block2d_second_pass(FData + 16, dst_ptr, dst_pitch, 8, 8, 4, 8, VFilter); - -} - -void vp8_sixtap_predict16x16_c -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - int FData[21*24]; /* Temp data buffer used in filtering */ - - - HFilter = vp8_sub_pel_filters[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters[yoffset]; /* 6 tap */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 1, 21, 16, HFilter); - - /* then filter verticaly... */ - filter_block2d_second_pass(FData + 32, dst_ptr, dst_pitch, 16, 16, 16, 16, VFilter); - -} - - -/**************************************************************************** - * - * ROUTINE : filter_block2d_bil_first_pass - * - * INPUTS : UINT8 *src_ptr : Pointer to source block. - * UINT32 src_stride : Stride of source block. - * UINT32 height : Block height. - * UINT32 width : Block width. - * INT32 *vp8_filter : Array of 2 bi-linear filter taps. - * - * OUTPUTS : INT32 *dst_ptr : Pointer to filtered block. - * - * RETURNS : void - * - * FUNCTION : Applies a 1-D 2-tap bi-linear filter to the source block - * in the horizontal direction to produce the filtered output - * block. Used to implement first-pass of 2-D separable filter. - * - * SPECIAL NOTES : Produces INT32 output to retain precision for next pass. - * Two filter taps should sum to VP8_FILTER_WEIGHT. - * - ****************************************************************************/ -static void filter_block2d_bil_first_pass -( - unsigned char *src_ptr, - unsigned short *dst_ptr, - unsigned int src_stride, - unsigned int height, - unsigned int width, - const short *vp8_filter -) -{ - unsigned int i, j; - - for (i = 0; i < height; i++) - { - for (j = 0; j < width; j++) - { - /* Apply bilinear filter */ - dst_ptr[j] = (((int)src_ptr[0] * vp8_filter[0]) + - ((int)src_ptr[1] * vp8_filter[1]) + - (VP8_FILTER_WEIGHT / 2)) >> VP8_FILTER_SHIFT; - src_ptr++; - } - - /* Next row... */ - src_ptr += src_stride - width; - dst_ptr += width; - } -} - -/**************************************************************************** - * - * ROUTINE : filter_block2d_bil_second_pass - * - * INPUTS : INT32 *src_ptr : Pointer to source block. - * UINT32 dst_pitch : Destination block pitch. - * UINT32 height : Block height. - * UINT32 width : Block width. - * INT32 *vp8_filter : Array of 2 bi-linear filter taps. - * - * OUTPUTS : UINT16 *dst_ptr : Pointer to filtered block. - * - * RETURNS : void - * - * FUNCTION : Applies a 1-D 2-tap bi-linear filter to the source block - * in the vertical direction to produce the filtered output - * block. Used to implement second-pass of 2-D separable filter. - * - * SPECIAL NOTES : Requires 32-bit input as produced by filter_block2d_bil_first_pass. - * Two filter taps should sum to VP8_FILTER_WEIGHT. - * - ****************************************************************************/ -static void filter_block2d_bil_second_pass -( - unsigned short *src_ptr, - unsigned char *dst_ptr, - int dst_pitch, - unsigned int height, - unsigned int width, - const short *vp8_filter -) -{ - unsigned int i, j; - int Temp; - - for (i = 0; i < height; i++) - { - for (j = 0; j < width; j++) - { - /* Apply filter */ - Temp = ((int)src_ptr[0] * vp8_filter[0]) + - ((int)src_ptr[width] * vp8_filter[1]) + - (VP8_FILTER_WEIGHT / 2); - dst_ptr[j] = (unsigned int)(Temp >> VP8_FILTER_SHIFT); - src_ptr++; - } - - /* Next row... */ - dst_ptr += dst_pitch; - } -} - - -/**************************************************************************** - * - * ROUTINE : filter_block2d_bil - * - * INPUTS : UINT8 *src_ptr : Pointer to source block. - * UINT32 src_pitch : Stride of source block. - * UINT32 dst_pitch : Stride of destination block. - * INT32 *HFilter : Array of 2 horizontal filter taps. - * INT32 *VFilter : Array of 2 vertical filter taps. - * INT32 Width : Block width - * INT32 Height : Block height - * - * OUTPUTS : UINT16 *dst_ptr : Pointer to filtered block. - * - * RETURNS : void - * - * FUNCTION : 2-D filters an input block by applying a 2-tap - * bi-linear filter horizontally followed by a 2-tap - * bi-linear filter vertically on the result. - * - * SPECIAL NOTES : The largest block size can be handled here is 16x16 - * - ****************************************************************************/ -static void filter_block2d_bil -( - unsigned char *src_ptr, - unsigned char *dst_ptr, - unsigned int src_pitch, - unsigned int dst_pitch, - const short *HFilter, - const short *VFilter, - int Width, - int Height -) -{ - - unsigned short FData[17*16]; /* Temp data buffer used in filtering */ - - /* First filter 1-D horizontally... */ - filter_block2d_bil_first_pass(src_ptr, FData, src_pitch, Height + 1, Width, HFilter); - - /* then 1-D vertically... */ - filter_block2d_bil_second_pass(FData, dst_ptr, dst_pitch, Height, Width, VFilter); -} - - -void vp8_bilinear_predict4x4_c -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; -#if 0 - { - int i; - unsigned char temp1[16]; - unsigned char temp2[16]; - - bilinear_predict4x4_mmx(src_ptr, src_pixels_per_line, xoffset, yoffset, temp1, 4); - filter_block2d_bil(src_ptr, temp2, src_pixels_per_line, 4, HFilter, VFilter, 4, 4); - - for (i = 0; i < 16; i++) - { - if (temp1[i] != temp2[i]) - { - bilinear_predict4x4_mmx(src_ptr, src_pixels_per_line, xoffset, yoffset, temp1, 4); - filter_block2d_bil(src_ptr, temp2, src_pixels_per_line, 4, HFilter, VFilter, 4, 4); - } - } - } -#endif - filter_block2d_bil(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 4, 4); - -} - -void vp8_bilinear_predict8x8_c -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - filter_block2d_bil(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 8, 8); - -} - -void vp8_bilinear_predict8x4_c -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - filter_block2d_bil(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 8, 4); - -} - -void vp8_bilinear_predict16x16_c -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - filter_block2d_bil(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 16, 16); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/filter.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/filter.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/filter.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/filter.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2011 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_FILTER_H_ -#define VP8_COMMON_FILTER_H_ - -#include "vpx_ports/mem.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define BLOCK_HEIGHT_WIDTH 4 -#define VP8_FILTER_WEIGHT 128 -#define VP8_FILTER_SHIFT 7 - -extern DECLARE_ALIGNED(16, const short, vp8_bilinear_filters[8][2]); -extern DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters[8][6]); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_FILTER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/findnearmv.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/findnearmv.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/findnearmv.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/findnearmv.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,193 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "findnearmv.h" - -const unsigned char vp8_mbsplit_offset[4][16] = { - { 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 2, 8, 10, 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} -}; - -/* Predict motion vectors using those from already-decoded nearby blocks. - Note that we only consider one 4x4 subblock from each candidate 16x16 - macroblock. */ -void vp8_find_near_mvs -( - MACROBLOCKD *xd, - const MODE_INFO *here, - int_mv *nearest, - int_mv *nearby, - int_mv *best_mv, - int cnt[4], - int refframe, - int *ref_frame_sign_bias -) -{ - const MODE_INFO *above = here - xd->mode_info_stride; - const MODE_INFO *left = here - 1; - const MODE_INFO *aboveleft = above - 1; - int_mv near_mvs[4]; - int_mv *mv = near_mvs; - int *cntx = cnt; - enum {CNT_INTRA, CNT_NEAREST, CNT_NEAR, CNT_SPLITMV}; - - /* Zero accumulators */ - mv[0].as_int = mv[1].as_int = mv[2].as_int = 0; - cnt[0] = cnt[1] = cnt[2] = cnt[3] = 0; - - /* Process above */ - if (above->mbmi.ref_frame != INTRA_FRAME) - { - if (above->mbmi.mv.as_int) - { - (++mv)->as_int = above->mbmi.mv.as_int; - mv_bias(ref_frame_sign_bias[above->mbmi.ref_frame], refframe, mv, ref_frame_sign_bias); - ++cntx; - } - - *cntx += 2; - } - - /* Process left */ - if (left->mbmi.ref_frame != INTRA_FRAME) - { - if (left->mbmi.mv.as_int) - { - int_mv this_mv; - - this_mv.as_int = left->mbmi.mv.as_int; - mv_bias(ref_frame_sign_bias[left->mbmi.ref_frame], refframe, &this_mv, ref_frame_sign_bias); - - if (this_mv.as_int != mv->as_int) - { - (++mv)->as_int = this_mv.as_int; - ++cntx; - } - - *cntx += 2; - } - else - cnt[CNT_INTRA] += 2; - } - - /* Process above left */ - if (aboveleft->mbmi.ref_frame != INTRA_FRAME) - { - if (aboveleft->mbmi.mv.as_int) - { - int_mv this_mv; - - this_mv.as_int = aboveleft->mbmi.mv.as_int; - mv_bias(ref_frame_sign_bias[aboveleft->mbmi.ref_frame], refframe, &this_mv, ref_frame_sign_bias); - - if (this_mv.as_int != mv->as_int) - { - (++mv)->as_int = this_mv.as_int; - ++cntx; - } - - *cntx += 1; - } - else - cnt[CNT_INTRA] += 1; - } - - /* If we have three distinct MV's ... */ - if (cnt[CNT_SPLITMV]) - { - /* See if above-left MV can be merged with NEAREST */ - if (mv->as_int == near_mvs[CNT_NEAREST].as_int) - cnt[CNT_NEAREST] += 1; - } - - cnt[CNT_SPLITMV] = ((above->mbmi.mode == SPLITMV) - + (left->mbmi.mode == SPLITMV)) * 2 - + (aboveleft->mbmi.mode == SPLITMV); - - /* Swap near and nearest if necessary */ - if (cnt[CNT_NEAR] > cnt[CNT_NEAREST]) - { - int tmp; - tmp = cnt[CNT_NEAREST]; - cnt[CNT_NEAREST] = cnt[CNT_NEAR]; - cnt[CNT_NEAR] = tmp; - tmp = near_mvs[CNT_NEAREST].as_int; - near_mvs[CNT_NEAREST].as_int = near_mvs[CNT_NEAR].as_int; - near_mvs[CNT_NEAR].as_int = tmp; - } - - /* Use near_mvs[0] to store the "best" MV */ - if (cnt[CNT_NEAREST] >= cnt[CNT_INTRA]) - near_mvs[CNT_INTRA] = near_mvs[CNT_NEAREST]; - - /* Set up return values */ - best_mv->as_int = near_mvs[0].as_int; - nearest->as_int = near_mvs[CNT_NEAREST].as_int; - nearby->as_int = near_mvs[CNT_NEAR].as_int; -} - - -static void invert_and_clamp_mvs(int_mv *inv, int_mv *src, MACROBLOCKD *xd) -{ - inv->as_mv.row = src->as_mv.row * -1; - inv->as_mv.col = src->as_mv.col * -1; - vp8_clamp_mv2(inv, xd); - vp8_clamp_mv2(src, xd); -} - - -int vp8_find_near_mvs_bias -( - MACROBLOCKD *xd, - const MODE_INFO *here, - int_mv mode_mv_sb[2][MB_MODE_COUNT], - int_mv best_mv_sb[2], - int cnt[4], - int refframe, - int *ref_frame_sign_bias -) -{ - int sign_bias = ref_frame_sign_bias[refframe]; - - vp8_find_near_mvs(xd, - here, - &mode_mv_sb[sign_bias][NEARESTMV], - &mode_mv_sb[sign_bias][NEARMV], - &best_mv_sb[sign_bias], - cnt, - refframe, - ref_frame_sign_bias); - - invert_and_clamp_mvs(&mode_mv_sb[!sign_bias][NEARESTMV], - &mode_mv_sb[sign_bias][NEARESTMV], xd); - invert_and_clamp_mvs(&mode_mv_sb[!sign_bias][NEARMV], - &mode_mv_sb[sign_bias][NEARMV], xd); - invert_and_clamp_mvs(&best_mv_sb[!sign_bias], - &best_mv_sb[sign_bias], xd); - - return sign_bias; -} - - -vp8_prob *vp8_mv_ref_probs( - vp8_prob p[VP8_MVREFS-1], const int near_mv_ref_ct[4] -) -{ - p[0] = vp8_mode_contexts [near_mv_ref_ct[0]] [0]; - p[1] = vp8_mode_contexts [near_mv_ref_ct[1]] [1]; - p[2] = vp8_mode_contexts [near_mv_ref_ct[2]] [2]; - p[3] = vp8_mode_contexts [near_mv_ref_ct[3]] [3]; - /*p[3] = vp8_mode_contexts [near_mv_ref_ct[1] + near_mv_ref_ct[2] + near_mv_ref_ct[3]] [3];*/ - return p; -} - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/findnearmv.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/findnearmv.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/findnearmv.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/findnearmv.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_FINDNEARMV_H_ -#define VP8_COMMON_FINDNEARMV_H_ - -#include "mv.h" -#include "blockd.h" -#include "modecont.h" -#include "treecoder.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -static void mv_bias(int refmb_ref_frame_sign_bias, int refframe, int_mv *mvp, - const int *ref_frame_sign_bias) -{ - if (refmb_ref_frame_sign_bias != ref_frame_sign_bias[refframe]) - { - mvp->as_mv.row *= -1; - mvp->as_mv.col *= -1; - } -} - -#define LEFT_TOP_MARGIN (16 << 3) -#define RIGHT_BOTTOM_MARGIN (16 << 3) -static void vp8_clamp_mv2(int_mv *mv, const MACROBLOCKD *xd) -{ - if (mv->as_mv.col < (xd->mb_to_left_edge - LEFT_TOP_MARGIN)) - mv->as_mv.col = xd->mb_to_left_edge - LEFT_TOP_MARGIN; - else if (mv->as_mv.col > xd->mb_to_right_edge + RIGHT_BOTTOM_MARGIN) - mv->as_mv.col = xd->mb_to_right_edge + RIGHT_BOTTOM_MARGIN; - - if (mv->as_mv.row < (xd->mb_to_top_edge - LEFT_TOP_MARGIN)) - mv->as_mv.row = xd->mb_to_top_edge - LEFT_TOP_MARGIN; - else if (mv->as_mv.row > xd->mb_to_bottom_edge + RIGHT_BOTTOM_MARGIN) - mv->as_mv.row = xd->mb_to_bottom_edge + RIGHT_BOTTOM_MARGIN; -} - -static void vp8_clamp_mv(int_mv *mv, int mb_to_left_edge, int mb_to_right_edge, - int mb_to_top_edge, int mb_to_bottom_edge) -{ - mv->as_mv.col = (mv->as_mv.col < mb_to_left_edge) ? - mb_to_left_edge : mv->as_mv.col; - mv->as_mv.col = (mv->as_mv.col > mb_to_right_edge) ? - mb_to_right_edge : mv->as_mv.col; - mv->as_mv.row = (mv->as_mv.row < mb_to_top_edge) ? - mb_to_top_edge : mv->as_mv.row; - mv->as_mv.row = (mv->as_mv.row > mb_to_bottom_edge) ? - mb_to_bottom_edge : mv->as_mv.row; -} -static unsigned int vp8_check_mv_bounds(int_mv *mv, int mb_to_left_edge, - int mb_to_right_edge, int mb_to_top_edge, - int mb_to_bottom_edge) -{ - unsigned int need_to_clamp; - need_to_clamp = (mv->as_mv.col < mb_to_left_edge); - need_to_clamp |= (mv->as_mv.col > mb_to_right_edge); - need_to_clamp |= (mv->as_mv.row < mb_to_top_edge); - need_to_clamp |= (mv->as_mv.row > mb_to_bottom_edge); - return need_to_clamp; -} - -void vp8_find_near_mvs -( - MACROBLOCKD *xd, - const MODE_INFO *here, - int_mv *nearest, int_mv *nearby, int_mv *best, - int near_mv_ref_cts[4], - int refframe, - int *ref_frame_sign_bias -); - - -int vp8_find_near_mvs_bias -( - MACROBLOCKD *xd, - const MODE_INFO *here, - int_mv mode_mv_sb[2][MB_MODE_COUNT], - int_mv best_mv_sb[2], - int cnt[4], - int refframe, - int *ref_frame_sign_bias -); - - -vp8_prob *vp8_mv_ref_probs( - vp8_prob p[VP8_MVREFS-1], const int near_mv_ref_ct[4] -); - -extern const unsigned char vp8_mbsplit_offset[4][16]; - - -static int left_block_mv(const MODE_INFO *cur_mb, int b) -{ - if (!(b & 3)) - { - /* On L edge, get from MB to left of us */ - --cur_mb; - - if(cur_mb->mbmi.mode != SPLITMV) - return cur_mb->mbmi.mv.as_int; - b += 4; - } - - return (cur_mb->bmi + b - 1)->mv.as_int; -} - -static int above_block_mv(const MODE_INFO *cur_mb, int b, int mi_stride) -{ - if (!(b >> 2)) - { - /* On top edge, get from MB above us */ - cur_mb -= mi_stride; - - if(cur_mb->mbmi.mode != SPLITMV) - return cur_mb->mbmi.mv.as_int; - b += 16; - } - - return (cur_mb->bmi + (b - 4))->mv.as_int; -} -static B_PREDICTION_MODE left_block_mode(const MODE_INFO *cur_mb, int b) -{ - if (!(b & 3)) - { - /* On L edge, get from MB to left of us */ - --cur_mb; - switch (cur_mb->mbmi.mode) - { - case B_PRED: - return (cur_mb->bmi + b + 3)->as_mode; - case DC_PRED: - return B_DC_PRED; - case V_PRED: - return B_VE_PRED; - case H_PRED: - return B_HE_PRED; - case TM_PRED: - return B_TM_PRED; - default: - return B_DC_PRED; - } - } - - return (cur_mb->bmi + b - 1)->as_mode; -} - -static B_PREDICTION_MODE above_block_mode(const MODE_INFO *cur_mb, int b, int mi_stride) -{ - if (!(b >> 2)) - { - /* On top edge, get from MB above us */ - cur_mb -= mi_stride; - - switch (cur_mb->mbmi.mode) - { - case B_PRED: - return (cur_mb->bmi + b + 12)->as_mode; - case DC_PRED: - return B_DC_PRED; - case V_PRED: - return B_VE_PRED; - case H_PRED: - return B_HE_PRED; - case TM_PRED: - return B_TM_PRED; - default: - return B_DC_PRED; - } - } - - return (cur_mb->bmi + b - 4)->as_mode; -} - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_FINDNEARMV_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/generic/systemdependent.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/generic/systemdependent.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/generic/systemdependent.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/generic/systemdependent.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#if ARCH_ARM -#include "vpx_ports/arm.h" -#elif ARCH_X86 || ARCH_X86_64 -#include "vpx_ports/x86.h" -#endif -#include "vp8/common/onyxc_int.h" - -#if CONFIG_MULTITHREAD -#if HAVE_UNISTD_H && !defined(__OS2__) -#include -#elif defined(_WIN32) -#include -typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); -#elif defined(__OS2__) -#define INCL_DOS -#define INCL_DOSSPINLOCK -#include -#endif -#endif - -#if CONFIG_MULTITHREAD -static int get_cpu_count() -{ - int core_count = 16; - -#if HAVE_UNISTD_H && !defined(__OS2__) -#if defined(_SC_NPROCESSORS_ONLN) - core_count = sysconf(_SC_NPROCESSORS_ONLN); -#elif defined(_SC_NPROC_ONLN) - core_count = sysconf(_SC_NPROC_ONLN); -#endif -#elif defined(_WIN32) - { - PGNSI pGNSI; - SYSTEM_INFO sysinfo; - - /* Call GetNativeSystemInfo if supported or - * GetSystemInfo otherwise. */ - - pGNSI = (PGNSI) GetProcAddress( - GetModuleHandle(TEXT("kernel32.dll")), "GetNativeSystemInfo"); - if (pGNSI != NULL) - pGNSI(&sysinfo); - else - GetSystemInfo(&sysinfo); - - core_count = sysinfo.dwNumberOfProcessors; - } -#elif defined(__OS2__) - { - ULONG proc_id; - ULONG status; - - core_count = 0; - for (proc_id = 1; ; proc_id++) - { - if (DosGetProcessorStatus(proc_id, &status)) - break; - - if (status == PROC_ONLINE) - core_count++; - } - } -#else - /* other platforms */ -#endif - - return core_count > 0 ? core_count : 1; -} -#endif - -void vp8_clear_system_state_c() {}; - -void vp8_machine_specific_config(VP8_COMMON *ctx) -{ -#if CONFIG_MULTITHREAD - ctx->processor_core_count = get_cpu_count(); -#endif /* CONFIG_MULTITHREAD */ - -#if ARCH_ARM - ctx->cpu_caps = arm_cpu_caps(); -#elif ARCH_X86 || ARCH_X86_64 - ctx->cpu_caps = x86_simd_caps(); -#endif -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/header.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/header.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/header.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/header.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_HEADER_H_ -#define VP8_COMMON_HEADER_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* 24 bits total */ -typedef struct -{ - unsigned int type: 1; - unsigned int version: 3; - unsigned int show_frame: 1; - - /* Allow 2^20 bytes = 8 megabits for first partition */ - - unsigned int first_partition_length_in_bytes: 19; - -#ifdef PACKET_TESTING - unsigned int frame_number; - unsigned int update_gold: 1; - unsigned int uses_gold: 1; - unsigned int update_last: 1; - unsigned int uses_last: 1; -#endif - -} VP8_HEADER; - -#ifdef PACKET_TESTING -#define VP8_HEADER_SIZE 8 -#else -#define VP8_HEADER_SIZE 3 -#endif - - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_HEADER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/idct_blk.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/idct_blk.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/idct_blk.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/idct_blk.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "vpx_mem/vpx_mem.h" - -void vp8_dequant_idct_add_c(short *input, short *dq, - unsigned char *dest, int stride); -void vp8_dc_only_idct_add_c(short input_dc, unsigned char * pred, - int pred_stride, unsigned char *dst_ptr, - int dst_stride); - -void vp8_dequant_idct_add_y_block_c - (short *q, short *dq, - unsigned char *dst, int stride, char *eobs) -{ - int i, j; - - for (i = 0; i < 4; i++) - { - for (j = 0; j < 4; j++) - { - if (*eobs++ > 1) - vp8_dequant_idct_add_c (q, dq, dst, stride); - else - { - vp8_dc_only_idct_add_c (q[0]*dq[0], dst, stride, dst, stride); - vpx_memset(q, 0, 2 * sizeof(q[0])); - } - - q += 16; - dst += 4; - } - - dst += 4*stride - 16; - } -} - -void vp8_dequant_idct_add_uv_block_c - (short *q, short *dq, - unsigned char *dstu, unsigned char *dstv, int stride, char *eobs) -{ - int i, j; - - for (i = 0; i < 2; i++) - { - for (j = 0; j < 2; j++) - { - if (*eobs++ > 1) - vp8_dequant_idct_add_c (q, dq, dstu, stride); - else - { - vp8_dc_only_idct_add_c (q[0]*dq[0], dstu, stride, dstu, stride); - vpx_memset(q, 0, 2 * sizeof(q[0])); - } - - q += 16; - dstu += 4; - } - - dstu += 4*stride - 8; - } - - for (i = 0; i < 2; i++) - { - for (j = 0; j < 2; j++) - { - if (*eobs++ > 1) - vp8_dequant_idct_add_c (q, dq, dstv, stride); - else - { - vp8_dc_only_idct_add_c (q[0]*dq[0], dstv, stride, dstv, stride); - vpx_memset(q, 0, 2 * sizeof(q[0])); - } - - q += 16; - dstv += 4; - } - - dstv += 4*stride - 8; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/idctllm.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/idctllm.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/idctllm.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/idctllm.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,204 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/**************************************************************************** - * Notes: - * - * This implementation makes use of 16 bit fixed point verio of two multiply - * constants: - * 1. sqrt(2) * cos (pi/8) - * 2. sqrt(2) * sin (pi/8) - * Becuase the first constant is bigger than 1, to maintain the same 16 bit - * fixed point precision as the second one, we use a trick of - * x * a = x + x*(a-1) - * so - * x * sqrt(2) * cos (pi/8) = x + x * (sqrt(2) *cos(pi/8)-1). - **************************************************************************/ -static const int cospi8sqrt2minus1 = 20091; -static const int sinpi8sqrt2 = 35468; - -void vp8_short_idct4x4llm_c(short *input, unsigned char *pred_ptr, - int pred_stride, unsigned char *dst_ptr, - int dst_stride) -{ - int i; - int r, c; - int a1, b1, c1, d1; - short output[16]; - short *ip = input; - short *op = output; - int temp1, temp2; - int shortpitch = 4; - - for (i = 0; i < 4; i++) - { - a1 = ip[0] + ip[8]; - b1 = ip[0] - ip[8]; - - temp1 = (ip[4] * sinpi8sqrt2) >> 16; - temp2 = ip[12] + ((ip[12] * cospi8sqrt2minus1) >> 16); - c1 = temp1 - temp2; - - temp1 = ip[4] + ((ip[4] * cospi8sqrt2minus1) >> 16); - temp2 = (ip[12] * sinpi8sqrt2) >> 16; - d1 = temp1 + temp2; - - op[shortpitch*0] = a1 + d1; - op[shortpitch*3] = a1 - d1; - - op[shortpitch*1] = b1 + c1; - op[shortpitch*2] = b1 - c1; - - ip++; - op++; - } - - ip = output; - op = output; - - for (i = 0; i < 4; i++) - { - a1 = ip[0] + ip[2]; - b1 = ip[0] - ip[2]; - - temp1 = (ip[1] * sinpi8sqrt2) >> 16; - temp2 = ip[3] + ((ip[3] * cospi8sqrt2minus1) >> 16); - c1 = temp1 - temp2; - - temp1 = ip[1] + ((ip[1] * cospi8sqrt2minus1) >> 16); - temp2 = (ip[3] * sinpi8sqrt2) >> 16; - d1 = temp1 + temp2; - - - op[0] = (a1 + d1 + 4) >> 3; - op[3] = (a1 - d1 + 4) >> 3; - - op[1] = (b1 + c1 + 4) >> 3; - op[2] = (b1 - c1 + 4) >> 3; - - ip += shortpitch; - op += shortpitch; - } - - ip = output; - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - int a = ip[c] + pred_ptr[c] ; - - if (a < 0) - a = 0; - - if (a > 255) - a = 255; - - dst_ptr[c] = (unsigned char) a ; - } - ip += 4; - dst_ptr += dst_stride; - pred_ptr += pred_stride; - } -} - -void vp8_dc_only_idct_add_c(short input_dc, unsigned char *pred_ptr, - int pred_stride, unsigned char *dst_ptr, - int dst_stride) -{ - int a1 = ((input_dc + 4) >> 3); - int r, c; - - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - int a = a1 + pred_ptr[c] ; - - if (a < 0) - a = 0; - - if (a > 255) - a = 255; - - dst_ptr[c] = (unsigned char) a ; - } - - dst_ptr += dst_stride; - pred_ptr += pred_stride; - } - -} - -void vp8_short_inv_walsh4x4_c(short *input, short *mb_dqcoeff) -{ - short output[16]; - int i; - int a1, b1, c1, d1; - int a2, b2, c2, d2; - short *ip = input; - short *op = output; - - for (i = 0; i < 4; i++) - { - a1 = ip[0] + ip[12]; - b1 = ip[4] + ip[8]; - c1 = ip[4] - ip[8]; - d1 = ip[0] - ip[12]; - - op[0] = a1 + b1; - op[4] = c1 + d1; - op[8] = a1 - b1; - op[12] = d1 - c1; - ip++; - op++; - } - - ip = output; - op = output; - - for (i = 0; i < 4; i++) - { - a1 = ip[0] + ip[3]; - b1 = ip[1] + ip[2]; - c1 = ip[1] - ip[2]; - d1 = ip[0] - ip[3]; - - a2 = a1 + b1; - b2 = c1 + d1; - c2 = a1 - b1; - d2 = d1 - c1; - - op[0] = (a2 + 3) >> 3; - op[1] = (b2 + 3) >> 3; - op[2] = (c2 + 3) >> 3; - op[3] = (d2 + 3) >> 3; - - ip += 4; - op += 4; - } - - for(i = 0; i < 16; i++) - { - mb_dqcoeff[i * 16] = output[i]; - } -} - -void vp8_short_inv_walsh4x4_1_c(short *input, short *mb_dqcoeff) -{ - int i; - int a1; - - a1 = ((input[0] + 3) >> 3); - for(i = 0; i < 16; i++) - { - mb_dqcoeff[i * 16] = a1; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/invtrans.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/invtrans.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/invtrans.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/invtrans.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_INVTRANS_H_ -#define VP8_COMMON_INVTRANS_H_ - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "blockd.h" -#include "onyxc_int.h" - -#if CONFIG_MULTITHREAD -#include "vpx_mem/vpx_mem.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -static void eob_adjust(char *eobs, short *diff) -{ - /* eob adjust.... the idct can only skip if both the dc and eob are zero */ - int js; - for(js = 0; js < 16; js++) - { - if((eobs[js] == 0) && (diff[0] != 0)) - eobs[js]++; - diff+=16; - } -} - -static void vp8_inverse_transform_mby(MACROBLOCKD *xd) -{ - short *DQC = xd->dequant_y1; - - if (xd->mode_info_context->mbmi.mode != SPLITMV) - { - /* do 2nd order transform on the dc block */ - if (xd->eobs[24] > 1) - { - vp8_short_inv_walsh4x4 - (&xd->block[24].dqcoeff[0], xd->qcoeff); - } - else - { - vp8_short_inv_walsh4x4_1 - (&xd->block[24].dqcoeff[0], xd->qcoeff); - } - eob_adjust(xd->eobs, xd->qcoeff); - - DQC = xd->dequant_y1_dc; - } - vp8_dequant_idct_add_y_block - (xd->qcoeff, DQC, - xd->dst.y_buffer, - xd->dst.y_stride, xd->eobs); -} -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_INVTRANS_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/loopfilter.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/loopfilter.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/loopfilter.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/loopfilter.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,662 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "loopfilter.h" -#include "onyxc_int.h" -#include "vpx_mem/vpx_mem.h" - - -static void lf_init_lut(loop_filter_info_n *lfi) -{ - int filt_lvl; - - for (filt_lvl = 0; filt_lvl <= MAX_LOOP_FILTER; filt_lvl++) - { - if (filt_lvl >= 40) - { - lfi->hev_thr_lut[KEY_FRAME][filt_lvl] = 2; - lfi->hev_thr_lut[INTER_FRAME][filt_lvl] = 3; - } - else if (filt_lvl >= 20) - { - lfi->hev_thr_lut[KEY_FRAME][filt_lvl] = 1; - lfi->hev_thr_lut[INTER_FRAME][filt_lvl] = 2; - } - else if (filt_lvl >= 15) - { - lfi->hev_thr_lut[KEY_FRAME][filt_lvl] = 1; - lfi->hev_thr_lut[INTER_FRAME][filt_lvl] = 1; - } - else - { - lfi->hev_thr_lut[KEY_FRAME][filt_lvl] = 0; - lfi->hev_thr_lut[INTER_FRAME][filt_lvl] = 0; - } - } - - lfi->mode_lf_lut[DC_PRED] = 1; - lfi->mode_lf_lut[V_PRED] = 1; - lfi->mode_lf_lut[H_PRED] = 1; - lfi->mode_lf_lut[TM_PRED] = 1; - lfi->mode_lf_lut[B_PRED] = 0; - - lfi->mode_lf_lut[ZEROMV] = 1; - lfi->mode_lf_lut[NEARESTMV] = 2; - lfi->mode_lf_lut[NEARMV] = 2; - lfi->mode_lf_lut[NEWMV] = 2; - lfi->mode_lf_lut[SPLITMV] = 3; - -} - -void vp8_loop_filter_update_sharpness(loop_filter_info_n *lfi, - int sharpness_lvl) -{ - int i; - - /* For each possible value for the loop filter fill out limits */ - for (i = 0; i <= MAX_LOOP_FILTER; i++) - { - int filt_lvl = i; - int block_inside_limit = 0; - - /* Set loop filter paramaeters that control sharpness. */ - block_inside_limit = filt_lvl >> (sharpness_lvl > 0); - block_inside_limit = block_inside_limit >> (sharpness_lvl > 4); - - if (sharpness_lvl > 0) - { - if (block_inside_limit > (9 - sharpness_lvl)) - block_inside_limit = (9 - sharpness_lvl); - } - - if (block_inside_limit < 1) - block_inside_limit = 1; - - vpx_memset(lfi->lim[i], block_inside_limit, SIMD_WIDTH); - vpx_memset(lfi->blim[i], (2 * filt_lvl + block_inside_limit), - SIMD_WIDTH); - vpx_memset(lfi->mblim[i], (2 * (filt_lvl + 2) + block_inside_limit), - SIMD_WIDTH); - } -} - -void vp8_loop_filter_init(VP8_COMMON *cm) -{ - loop_filter_info_n *lfi = &cm->lf_info; - int i; - - /* init limits for given sharpness*/ - vp8_loop_filter_update_sharpness(lfi, cm->sharpness_level); - cm->last_sharpness_level = cm->sharpness_level; - - /* init LUT for lvl and hev thr picking */ - lf_init_lut(lfi); - - /* init hev threshold const vectors */ - for(i = 0; i < 4 ; i++) - { - vpx_memset(lfi->hev_thr[i], i, SIMD_WIDTH); - } -} - -void vp8_loop_filter_frame_init(VP8_COMMON *cm, - MACROBLOCKD *mbd, - int default_filt_lvl) -{ - int seg, /* segment number */ - ref, /* index in ref_lf_deltas */ - mode; /* index in mode_lf_deltas */ - - loop_filter_info_n *lfi = &cm->lf_info; - - /* update limits if sharpness has changed */ - if(cm->last_sharpness_level != cm->sharpness_level) - { - vp8_loop_filter_update_sharpness(lfi, cm->sharpness_level); - cm->last_sharpness_level = cm->sharpness_level; - } - - for(seg = 0; seg < MAX_MB_SEGMENTS; seg++) - { - int lvl_seg = default_filt_lvl; - int lvl_ref, lvl_mode; - - /* Note the baseline filter values for each segment */ - if (mbd->segmentation_enabled) - { - /* Abs value */ - if (mbd->mb_segement_abs_delta == SEGMENT_ABSDATA) - { - lvl_seg = mbd->segment_feature_data[MB_LVL_ALT_LF][seg]; - } - else /* Delta Value */ - { - lvl_seg += mbd->segment_feature_data[MB_LVL_ALT_LF][seg]; - lvl_seg = (lvl_seg > 0) ? ((lvl_seg > 63) ? 63: lvl_seg) : 0; - } - } - - if (!mbd->mode_ref_lf_delta_enabled) - { - /* we could get rid of this if we assume that deltas are set to - * zero when not in use; encoder always uses deltas - */ - vpx_memset(lfi->lvl[seg][0], lvl_seg, 4 * 4 ); - continue; - } - - /* INTRA_FRAME */ - ref = INTRA_FRAME; - - /* Apply delta for reference frame */ - lvl_ref = lvl_seg + mbd->ref_lf_deltas[ref]; - - /* Apply delta for Intra modes */ - mode = 0; /* B_PRED */ - /* Only the split mode BPRED has a further special case */ - lvl_mode = lvl_ref + mbd->mode_lf_deltas[mode]; - /* clamp */ - lvl_mode = (lvl_mode > 0) ? (lvl_mode > 63 ? 63 : lvl_mode) : 0; - - lfi->lvl[seg][ref][mode] = lvl_mode; - - mode = 1; /* all the rest of Intra modes */ - /* clamp */ - lvl_mode = (lvl_ref > 0) ? (lvl_ref > 63 ? 63 : lvl_ref) : 0; - lfi->lvl[seg][ref][mode] = lvl_mode; - - /* LAST, GOLDEN, ALT */ - for(ref = 1; ref < MAX_REF_FRAMES; ref++) - { - /* Apply delta for reference frame */ - lvl_ref = lvl_seg + mbd->ref_lf_deltas[ref]; - - /* Apply delta for Inter modes */ - for (mode = 1; mode < 4; mode++) - { - lvl_mode = lvl_ref + mbd->mode_lf_deltas[mode]; - /* clamp */ - lvl_mode = (lvl_mode > 0) ? (lvl_mode > 63 ? 63 : lvl_mode) : 0; - - lfi->lvl[seg][ref][mode] = lvl_mode; - } - } - } -} - - -void vp8_loop_filter_row_normal(VP8_COMMON *cm, MODE_INFO *mode_info_context, - int mb_row, int post_ystride, int post_uvstride, - unsigned char *y_ptr, unsigned char *u_ptr, - unsigned char *v_ptr) -{ - int mb_col; - int filter_level; - loop_filter_info_n *lfi_n = &cm->lf_info; - loop_filter_info lfi; - FRAME_TYPE frame_type = cm->frame_type; - - for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) - { - int skip_lf = (mode_info_context->mbmi.mode != B_PRED && - mode_info_context->mbmi.mode != SPLITMV && - mode_info_context->mbmi.mb_skip_coeff); - - const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi.mode]; - const int seg = mode_info_context->mbmi.segment_id; - const int ref_frame = mode_info_context->mbmi.ref_frame; - - filter_level = lfi_n->lvl[seg][ref_frame][mode_index]; - - if (filter_level) - { - const int hev_index = lfi_n->hev_thr_lut[frame_type][filter_level]; - lfi.mblim = lfi_n->mblim[filter_level]; - lfi.blim = lfi_n->blim[filter_level]; - lfi.lim = lfi_n->lim[filter_level]; - lfi.hev_thr = lfi_n->hev_thr[hev_index]; - - if (mb_col > 0) - vp8_loop_filter_mbv - (y_ptr, u_ptr, v_ptr, post_ystride, post_uvstride, &lfi); - - if (!skip_lf) - vp8_loop_filter_bv - (y_ptr, u_ptr, v_ptr, post_ystride, post_uvstride, &lfi); - - /* don't apply across umv border */ - if (mb_row > 0) - vp8_loop_filter_mbh - (y_ptr, u_ptr, v_ptr, post_ystride, post_uvstride, &lfi); - - if (!skip_lf) - vp8_loop_filter_bh - (y_ptr, u_ptr, v_ptr, post_ystride, post_uvstride, &lfi); - } - - y_ptr += 16; - u_ptr += 8; - v_ptr += 8; - - mode_info_context++; /* step to next MB */ - } - -} - -void vp8_loop_filter_row_simple(VP8_COMMON *cm, MODE_INFO *mode_info_context, - int mb_row, int post_ystride, int post_uvstride, - unsigned char *y_ptr, unsigned char *u_ptr, - unsigned char *v_ptr) -{ - int mb_col; - int filter_level; - loop_filter_info_n *lfi_n = &cm->lf_info; - (void)post_uvstride; - - for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) - { - int skip_lf = (mode_info_context->mbmi.mode != B_PRED && - mode_info_context->mbmi.mode != SPLITMV && - mode_info_context->mbmi.mb_skip_coeff); - - const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi.mode]; - const int seg = mode_info_context->mbmi.segment_id; - const int ref_frame = mode_info_context->mbmi.ref_frame; - - filter_level = lfi_n->lvl[seg][ref_frame][mode_index]; - - if (filter_level) - { - if (mb_col > 0) - vp8_loop_filter_simple_mbv - (y_ptr, post_ystride, lfi_n->mblim[filter_level]); - - if (!skip_lf) - vp8_loop_filter_simple_bv - (y_ptr, post_ystride, lfi_n->blim[filter_level]); - - /* don't apply across umv border */ - if (mb_row > 0) - vp8_loop_filter_simple_mbh - (y_ptr, post_ystride, lfi_n->mblim[filter_level]); - - if (!skip_lf) - vp8_loop_filter_simple_bh - (y_ptr, post_ystride, lfi_n->blim[filter_level]); - } - - y_ptr += 16; - u_ptr += 8; - v_ptr += 8; - - mode_info_context++; /* step to next MB */ - } - -} -void vp8_loop_filter_frame(VP8_COMMON *cm, - MACROBLOCKD *mbd, - int frame_type) -{ - YV12_BUFFER_CONFIG *post = cm->frame_to_show; - loop_filter_info_n *lfi_n = &cm->lf_info; - loop_filter_info lfi; - - int mb_row; - int mb_col; - int mb_rows = cm->mb_rows; - int mb_cols = cm->mb_cols; - - int filter_level; - - unsigned char *y_ptr, *u_ptr, *v_ptr; - - /* Point at base of Mb MODE_INFO list */ - const MODE_INFO *mode_info_context = cm->mi; - int post_y_stride = post->y_stride; - int post_uv_stride = post->uv_stride; - - /* Initialize the loop filter for this frame. */ - vp8_loop_filter_frame_init(cm, mbd, cm->filter_level); - - /* Set up the buffer pointers */ - y_ptr = post->y_buffer; - u_ptr = post->u_buffer; - v_ptr = post->v_buffer; - - /* vp8_filter each macro block */ - if (cm->filter_type == NORMAL_LOOPFILTER) - { - for (mb_row = 0; mb_row < mb_rows; mb_row++) - { - for (mb_col = 0; mb_col < mb_cols; mb_col++) - { - int skip_lf = (mode_info_context->mbmi.mode != B_PRED && - mode_info_context->mbmi.mode != SPLITMV && - mode_info_context->mbmi.mb_skip_coeff); - - const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi.mode]; - const int seg = mode_info_context->mbmi.segment_id; - const int ref_frame = mode_info_context->mbmi.ref_frame; - - filter_level = lfi_n->lvl[seg][ref_frame][mode_index]; - - if (filter_level) - { - const int hev_index = lfi_n->hev_thr_lut[frame_type][filter_level]; - lfi.mblim = lfi_n->mblim[filter_level]; - lfi.blim = lfi_n->blim[filter_level]; - lfi.lim = lfi_n->lim[filter_level]; - lfi.hev_thr = lfi_n->hev_thr[hev_index]; - - if (mb_col > 0) - vp8_loop_filter_mbv - (y_ptr, u_ptr, v_ptr, post_y_stride, post_uv_stride, &lfi); - - if (!skip_lf) - vp8_loop_filter_bv - (y_ptr, u_ptr, v_ptr, post_y_stride, post_uv_stride, &lfi); - - /* don't apply across umv border */ - if (mb_row > 0) - vp8_loop_filter_mbh - (y_ptr, u_ptr, v_ptr, post_y_stride, post_uv_stride, &lfi); - - if (!skip_lf) - vp8_loop_filter_bh - (y_ptr, u_ptr, v_ptr, post_y_stride, post_uv_stride, &lfi); - } - - y_ptr += 16; - u_ptr += 8; - v_ptr += 8; - - mode_info_context++; /* step to next MB */ - } - y_ptr += post_y_stride * 16 - post->y_width; - u_ptr += post_uv_stride * 8 - post->uv_width; - v_ptr += post_uv_stride * 8 - post->uv_width; - - mode_info_context++; /* Skip border mb */ - - } - } - else /* SIMPLE_LOOPFILTER */ - { - for (mb_row = 0; mb_row < mb_rows; mb_row++) - { - for (mb_col = 0; mb_col < mb_cols; mb_col++) - { - int skip_lf = (mode_info_context->mbmi.mode != B_PRED && - mode_info_context->mbmi.mode != SPLITMV && - mode_info_context->mbmi.mb_skip_coeff); - - const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi.mode]; - const int seg = mode_info_context->mbmi.segment_id; - const int ref_frame = mode_info_context->mbmi.ref_frame; - - filter_level = lfi_n->lvl[seg][ref_frame][mode_index]; - if (filter_level) - { - const unsigned char * mblim = lfi_n->mblim[filter_level]; - const unsigned char * blim = lfi_n->blim[filter_level]; - - if (mb_col > 0) - vp8_loop_filter_simple_mbv - (y_ptr, post_y_stride, mblim); - - if (!skip_lf) - vp8_loop_filter_simple_bv - (y_ptr, post_y_stride, blim); - - /* don't apply across umv border */ - if (mb_row > 0) - vp8_loop_filter_simple_mbh - (y_ptr, post_y_stride, mblim); - - if (!skip_lf) - vp8_loop_filter_simple_bh - (y_ptr, post_y_stride, blim); - } - - y_ptr += 16; - u_ptr += 8; - v_ptr += 8; - - mode_info_context++; /* step to next MB */ - } - y_ptr += post_y_stride * 16 - post->y_width; - u_ptr += post_uv_stride * 8 - post->uv_width; - v_ptr += post_uv_stride * 8 - post->uv_width; - - mode_info_context++; /* Skip border mb */ - - } - } -} - -void vp8_loop_filter_frame_yonly -( - VP8_COMMON *cm, - MACROBLOCKD *mbd, - int default_filt_lvl -) -{ - YV12_BUFFER_CONFIG *post = cm->frame_to_show; - - unsigned char *y_ptr; - int mb_row; - int mb_col; - - loop_filter_info_n *lfi_n = &cm->lf_info; - loop_filter_info lfi; - - int filter_level; - FRAME_TYPE frame_type = cm->frame_type; - - /* Point at base of Mb MODE_INFO list */ - const MODE_INFO *mode_info_context = cm->mi; - -#if 0 - if(default_filt_lvl == 0) /* no filter applied */ - return; -#endif - - /* Initialize the loop filter for this frame. */ - vp8_loop_filter_frame_init( cm, mbd, default_filt_lvl); - - /* Set up the buffer pointers */ - y_ptr = post->y_buffer; - - /* vp8_filter each macro block */ - for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) - { - for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) - { - int skip_lf = (mode_info_context->mbmi.mode != B_PRED && - mode_info_context->mbmi.mode != SPLITMV && - mode_info_context->mbmi.mb_skip_coeff); - - const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi.mode]; - const int seg = mode_info_context->mbmi.segment_id; - const int ref_frame = mode_info_context->mbmi.ref_frame; - - filter_level = lfi_n->lvl[seg][ref_frame][mode_index]; - - if (filter_level) - { - if (cm->filter_type == NORMAL_LOOPFILTER) - { - const int hev_index = lfi_n->hev_thr_lut[frame_type][filter_level]; - lfi.mblim = lfi_n->mblim[filter_level]; - lfi.blim = lfi_n->blim[filter_level]; - lfi.lim = lfi_n->lim[filter_level]; - lfi.hev_thr = lfi_n->hev_thr[hev_index]; - - if (mb_col > 0) - vp8_loop_filter_mbv - (y_ptr, 0, 0, post->y_stride, 0, &lfi); - - if (!skip_lf) - vp8_loop_filter_bv - (y_ptr, 0, 0, post->y_stride, 0, &lfi); - - /* don't apply across umv border */ - if (mb_row > 0) - vp8_loop_filter_mbh - (y_ptr, 0, 0, post->y_stride, 0, &lfi); - - if (!skip_lf) - vp8_loop_filter_bh - (y_ptr, 0, 0, post->y_stride, 0, &lfi); - } - else - { - if (mb_col > 0) - vp8_loop_filter_simple_mbv - (y_ptr, post->y_stride, lfi_n->mblim[filter_level]); - - if (!skip_lf) - vp8_loop_filter_simple_bv - (y_ptr, post->y_stride, lfi_n->blim[filter_level]); - - /* don't apply across umv border */ - if (mb_row > 0) - vp8_loop_filter_simple_mbh - (y_ptr, post->y_stride, lfi_n->mblim[filter_level]); - - if (!skip_lf) - vp8_loop_filter_simple_bh - (y_ptr, post->y_stride, lfi_n->blim[filter_level]); - } - } - - y_ptr += 16; - mode_info_context ++; /* step to next MB */ - - } - - y_ptr += post->y_stride * 16 - post->y_width; - mode_info_context ++; /* Skip border mb */ - } - -} - -void vp8_loop_filter_partial_frame -( - VP8_COMMON *cm, - MACROBLOCKD *mbd, - int default_filt_lvl -) -{ - YV12_BUFFER_CONFIG *post = cm->frame_to_show; - - unsigned char *y_ptr; - int mb_row; - int mb_col; - int mb_cols = post->y_width >> 4; - int mb_rows = post->y_height >> 4; - - int linestocopy; - - loop_filter_info_n *lfi_n = &cm->lf_info; - loop_filter_info lfi; - - int filter_level; - FRAME_TYPE frame_type = cm->frame_type; - - const MODE_INFO *mode_info_context; - -#if 0 - if(default_filt_lvl == 0) /* no filter applied */ - return; -#endif - - /* Initialize the loop filter for this frame. */ - vp8_loop_filter_frame_init( cm, mbd, default_filt_lvl); - - /* number of MB rows to use in partial filtering */ - linestocopy = mb_rows / PARTIAL_FRAME_FRACTION; - linestocopy = linestocopy ? linestocopy << 4 : 16; /* 16 lines per MB */ - - /* Set up the buffer pointers; partial image starts at ~middle of frame */ - y_ptr = post->y_buffer + ((post->y_height >> 5) * 16) * post->y_stride; - mode_info_context = cm->mi + (post->y_height >> 5) * (mb_cols + 1); - - /* vp8_filter each macro block */ - for (mb_row = 0; mb_row<(linestocopy >> 4); mb_row++) - { - for (mb_col = 0; mb_col < mb_cols; mb_col++) - { - int skip_lf = (mode_info_context->mbmi.mode != B_PRED && - mode_info_context->mbmi.mode != SPLITMV && - mode_info_context->mbmi.mb_skip_coeff); - - const int mode_index = - lfi_n->mode_lf_lut[mode_info_context->mbmi.mode]; - const int seg = mode_info_context->mbmi.segment_id; - const int ref_frame = mode_info_context->mbmi.ref_frame; - - filter_level = lfi_n->lvl[seg][ref_frame][mode_index]; - - if (filter_level) - { - if (cm->filter_type == NORMAL_LOOPFILTER) - { - const int hev_index = lfi_n->hev_thr_lut[frame_type][filter_level]; - lfi.mblim = lfi_n->mblim[filter_level]; - lfi.blim = lfi_n->blim[filter_level]; - lfi.lim = lfi_n->lim[filter_level]; - lfi.hev_thr = lfi_n->hev_thr[hev_index]; - - if (mb_col > 0) - vp8_loop_filter_mbv - (y_ptr, 0, 0, post->y_stride, 0, &lfi); - - if (!skip_lf) - vp8_loop_filter_bv - (y_ptr, 0, 0, post->y_stride, 0, &lfi); - - vp8_loop_filter_mbh - (y_ptr, 0, 0, post->y_stride, 0, &lfi); - - if (!skip_lf) - vp8_loop_filter_bh - (y_ptr, 0, 0, post->y_stride, 0, &lfi); - } - else - { - if (mb_col > 0) - vp8_loop_filter_simple_mbv - (y_ptr, post->y_stride, lfi_n->mblim[filter_level]); - - if (!skip_lf) - vp8_loop_filter_simple_bv - (y_ptr, post->y_stride, lfi_n->blim[filter_level]); - - vp8_loop_filter_simple_mbh - (y_ptr, post->y_stride, lfi_n->mblim[filter_level]); - - if (!skip_lf) - vp8_loop_filter_simple_bh - (y_ptr, post->y_stride, lfi_n->blim[filter_level]); - } - } - - y_ptr += 16; - mode_info_context += 1; /* step to next MB */ - } - - y_ptr += post->y_stride * 16 - post->y_width; - mode_info_context += 1; /* Skip border mb */ - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/loopfilter_filters.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/loopfilter_filters.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/loopfilter_filters.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/loopfilter_filters.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,430 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include -#include "loopfilter.h" -#include "onyxc_int.h" - -typedef unsigned char uc; - -static signed char vp8_signed_char_clamp(int t) -{ - t = (t < -128 ? -128 : t); - t = (t > 127 ? 127 : t); - return (signed char) t; -} - - -/* should we apply any filter at all ( 11111111 yes, 00000000 no) */ -static signed char vp8_filter_mask(uc limit, uc blimit, - uc p3, uc p2, uc p1, uc p0, - uc q0, uc q1, uc q2, uc q3) -{ - signed char mask = 0; - mask |= (abs(p3 - p2) > limit); - mask |= (abs(p2 - p1) > limit); - mask |= (abs(p1 - p0) > limit); - mask |= (abs(q1 - q0) > limit); - mask |= (abs(q2 - q1) > limit); - mask |= (abs(q3 - q2) > limit); - mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 > blimit); - return mask - 1; -} - -/* is there high variance internal edge ( 11111111 yes, 00000000 no) */ -static signed char vp8_hevmask(uc thresh, uc p1, uc p0, uc q0, uc q1) -{ - signed char hev = 0; - hev |= (abs(p1 - p0) > thresh) * -1; - hev |= (abs(q1 - q0) > thresh) * -1; - return hev; -} - -static void vp8_filter(signed char mask, uc hev, uc *op1, - uc *op0, uc *oq0, uc *oq1) - -{ - signed char ps0, qs0; - signed char ps1, qs1; - signed char filter_value, Filter1, Filter2; - signed char u; - - ps1 = (signed char) * op1 ^ 0x80; - ps0 = (signed char) * op0 ^ 0x80; - qs0 = (signed char) * oq0 ^ 0x80; - qs1 = (signed char) * oq1 ^ 0x80; - - /* add outer taps if we have high edge variance */ - filter_value = vp8_signed_char_clamp(ps1 - qs1); - filter_value &= hev; - - /* inner taps */ - filter_value = vp8_signed_char_clamp(filter_value + 3 * (qs0 - ps0)); - filter_value &= mask; - - /* save bottom 3 bits so that we round one side +4 and the other +3 - * if it equals 4 we'll set to adjust by -1 to account for the fact - * we'd round 3 the other way - */ - Filter1 = vp8_signed_char_clamp(filter_value + 4); - Filter2 = vp8_signed_char_clamp(filter_value + 3); - Filter1 >>= 3; - Filter2 >>= 3; - u = vp8_signed_char_clamp(qs0 - Filter1); - *oq0 = u ^ 0x80; - u = vp8_signed_char_clamp(ps0 + Filter2); - *op0 = u ^ 0x80; - filter_value = Filter1; - - /* outer tap adjustments */ - filter_value += 1; - filter_value >>= 1; - filter_value &= ~hev; - - u = vp8_signed_char_clamp(qs1 - filter_value); - *oq1 = u ^ 0x80; - u = vp8_signed_char_clamp(ps1 + filter_value); - *op1 = u ^ 0x80; - -} -void vp8_loop_filter_horizontal_edge_c -( - unsigned char *s, - int p, /* pitch */ - const unsigned char *blimit, - const unsigned char *limit, - const unsigned char *thresh, - int count -) -{ - int hev = 0; /* high edge variance */ - signed char mask = 0; - int i = 0; - - /* loop filter designed to work using chars so that we can make maximum use - * of 8 bit simd instructions. - */ - do - { - mask = vp8_filter_mask(limit[0], blimit[0], - s[-4*p], s[-3*p], s[-2*p], s[-1*p], - s[0*p], s[1*p], s[2*p], s[3*p]); - - hev = vp8_hevmask(thresh[0], s[-2*p], s[-1*p], s[0*p], s[1*p]); - - vp8_filter(mask, hev, s - 2 * p, s - 1 * p, s, s + 1 * p); - - ++s; - } - while (++i < count * 8); -} - -void vp8_loop_filter_vertical_edge_c -( - unsigned char *s, - int p, - const unsigned char *blimit, - const unsigned char *limit, - const unsigned char *thresh, - int count -) -{ - int hev = 0; /* high edge variance */ - signed char mask = 0; - int i = 0; - - /* loop filter designed to work using chars so that we can make maximum use - * of 8 bit simd instructions. - */ - do - { - mask = vp8_filter_mask(limit[0], blimit[0], - s[-4], s[-3], s[-2], s[-1], s[0], s[1], s[2], s[3]); - - hev = vp8_hevmask(thresh[0], s[-2], s[-1], s[0], s[1]); - - vp8_filter(mask, hev, s - 2, s - 1, s, s + 1); - - s += p; - } - while (++i < count * 8); -} - -static void vp8_mbfilter(signed char mask, uc hev, - uc *op2, uc *op1, uc *op0, uc *oq0, uc *oq1, uc *oq2) -{ - signed char s, u; - signed char filter_value, Filter1, Filter2; - signed char ps2 = (signed char) * op2 ^ 0x80; - signed char ps1 = (signed char) * op1 ^ 0x80; - signed char ps0 = (signed char) * op0 ^ 0x80; - signed char qs0 = (signed char) * oq0 ^ 0x80; - signed char qs1 = (signed char) * oq1 ^ 0x80; - signed char qs2 = (signed char) * oq2 ^ 0x80; - - /* add outer taps if we have high edge variance */ - filter_value = vp8_signed_char_clamp(ps1 - qs1); - filter_value = vp8_signed_char_clamp(filter_value + 3 * (qs0 - ps0)); - filter_value &= mask; - - Filter2 = filter_value; - Filter2 &= hev; - - /* save bottom 3 bits so that we round one side +4 and the other +3 */ - Filter1 = vp8_signed_char_clamp(Filter2 + 4); - Filter2 = vp8_signed_char_clamp(Filter2 + 3); - Filter1 >>= 3; - Filter2 >>= 3; - qs0 = vp8_signed_char_clamp(qs0 - Filter1); - ps0 = vp8_signed_char_clamp(ps0 + Filter2); - - - /* only apply wider filter if not high edge variance */ - filter_value &= ~hev; - Filter2 = filter_value; - - /* roughly 3/7th difference across boundary */ - u = vp8_signed_char_clamp((63 + Filter2 * 27) >> 7); - s = vp8_signed_char_clamp(qs0 - u); - *oq0 = s ^ 0x80; - s = vp8_signed_char_clamp(ps0 + u); - *op0 = s ^ 0x80; - - /* roughly 2/7th difference across boundary */ - u = vp8_signed_char_clamp((63 + Filter2 * 18) >> 7); - s = vp8_signed_char_clamp(qs1 - u); - *oq1 = s ^ 0x80; - s = vp8_signed_char_clamp(ps1 + u); - *op1 = s ^ 0x80; - - /* roughly 1/7th difference across boundary */ - u = vp8_signed_char_clamp((63 + Filter2 * 9) >> 7); - s = vp8_signed_char_clamp(qs2 - u); - *oq2 = s ^ 0x80; - s = vp8_signed_char_clamp(ps2 + u); - *op2 = s ^ 0x80; -} - -void vp8_mbloop_filter_horizontal_edge_c -( - unsigned char *s, - int p, - const unsigned char *blimit, - const unsigned char *limit, - const unsigned char *thresh, - int count -) -{ - signed char hev = 0; /* high edge variance */ - signed char mask = 0; - int i = 0; - - /* loop filter designed to work using chars so that we can make maximum use - * of 8 bit simd instructions. - */ - do - { - - mask = vp8_filter_mask(limit[0], blimit[0], - s[-4*p], s[-3*p], s[-2*p], s[-1*p], - s[0*p], s[1*p], s[2*p], s[3*p]); - - hev = vp8_hevmask(thresh[0], s[-2*p], s[-1*p], s[0*p], s[1*p]); - - vp8_mbfilter(mask, hev, s - 3 * p, s - 2 * p, s - 1 * p, s, s + 1 * p, s + 2 * p); - - ++s; - } - while (++i < count * 8); - -} - - -void vp8_mbloop_filter_vertical_edge_c -( - unsigned char *s, - int p, - const unsigned char *blimit, - const unsigned char *limit, - const unsigned char *thresh, - int count -) -{ - signed char hev = 0; /* high edge variance */ - signed char mask = 0; - int i = 0; - - do - { - - mask = vp8_filter_mask(limit[0], blimit[0], - s[-4], s[-3], s[-2], s[-1], s[0], s[1], s[2], s[3]); - - hev = vp8_hevmask(thresh[0], s[-2], s[-1], s[0], s[1]); - - vp8_mbfilter(mask, hev, s - 3, s - 2, s - 1, s, s + 1, s + 2); - - s += p; - } - while (++i < count * 8); - -} - -/* should we apply any filter at all ( 11111111 yes, 00000000 no) */ -static signed char vp8_simple_filter_mask(uc blimit, uc p1, uc p0, uc q0, uc q1) -{ -/* Why does this cause problems for win32? - * error C2143: syntax error : missing ';' before 'type' - * (void) limit; - */ - signed char mask = (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 <= blimit) * -1; - return mask; -} - -static void vp8_simple_filter(signed char mask, uc *op1, uc *op0, uc *oq0, uc *oq1) -{ - signed char filter_value, Filter1, Filter2; - signed char p1 = (signed char) * op1 ^ 0x80; - signed char p0 = (signed char) * op0 ^ 0x80; - signed char q0 = (signed char) * oq0 ^ 0x80; - signed char q1 = (signed char) * oq1 ^ 0x80; - signed char u; - - filter_value = vp8_signed_char_clamp(p1 - q1); - filter_value = vp8_signed_char_clamp(filter_value + 3 * (q0 - p0)); - filter_value &= mask; - - /* save bottom 3 bits so that we round one side +4 and the other +3 */ - Filter1 = vp8_signed_char_clamp(filter_value + 4); - Filter1 >>= 3; - u = vp8_signed_char_clamp(q0 - Filter1); - *oq0 = u ^ 0x80; - - Filter2 = vp8_signed_char_clamp(filter_value + 3); - Filter2 >>= 3; - u = vp8_signed_char_clamp(p0 + Filter2); - *op0 = u ^ 0x80; -} - -void vp8_loop_filter_simple_horizontal_edge_c -( - unsigned char *s, - int p, - const unsigned char *blimit -) -{ - signed char mask = 0; - int i = 0; - - do - { - mask = vp8_simple_filter_mask(blimit[0], s[-2*p], s[-1*p], s[0*p], s[1*p]); - vp8_simple_filter(mask, s - 2 * p, s - 1 * p, s, s + 1 * p); - ++s; - } - while (++i < 16); -} - -void vp8_loop_filter_simple_vertical_edge_c -( - unsigned char *s, - int p, - const unsigned char *blimit -) -{ - signed char mask = 0; - int i = 0; - - do - { - mask = vp8_simple_filter_mask(blimit[0], s[-2], s[-1], s[0], s[1]); - vp8_simple_filter(mask, s - 2, s - 1, s, s + 1); - s += p; - } - while (++i < 16); - -} - -/* Horizontal MB filtering */ -void vp8_loop_filter_mbh_c(unsigned char *y_ptr, unsigned char *u_ptr, - unsigned char *v_ptr, int y_stride, int uv_stride, - loop_filter_info *lfi) -{ - vp8_mbloop_filter_horizontal_edge_c(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); - - if (u_ptr) - vp8_mbloop_filter_horizontal_edge_c(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); - - if (v_ptr) - vp8_mbloop_filter_horizontal_edge_c(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); -} - -/* Vertical MB Filtering */ -void vp8_loop_filter_mbv_c(unsigned char *y_ptr, unsigned char *u_ptr, - unsigned char *v_ptr, int y_stride, int uv_stride, - loop_filter_info *lfi) -{ - vp8_mbloop_filter_vertical_edge_c(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); - - if (u_ptr) - vp8_mbloop_filter_vertical_edge_c(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); - - if (v_ptr) - vp8_mbloop_filter_vertical_edge_c(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); -} - -/* Horizontal B Filtering */ -void vp8_loop_filter_bh_c(unsigned char *y_ptr, unsigned char *u_ptr, - unsigned char *v_ptr, int y_stride, int uv_stride, - loop_filter_info *lfi) -{ - vp8_loop_filter_horizontal_edge_c(y_ptr + 4 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_horizontal_edge_c(y_ptr + 8 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_horizontal_edge_c(y_ptr + 12 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - - if (u_ptr) - vp8_loop_filter_horizontal_edge_c(u_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); - - if (v_ptr) - vp8_loop_filter_horizontal_edge_c(v_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); -} - -void vp8_loop_filter_bhs_c(unsigned char *y_ptr, int y_stride, - const unsigned char *blimit) -{ - vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 4 * y_stride, y_stride, blimit); - vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 8 * y_stride, y_stride, blimit); - vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 12 * y_stride, y_stride, blimit); -} - -/* Vertical B Filtering */ -void vp8_loop_filter_bv_c(unsigned char *y_ptr, unsigned char *u_ptr, - unsigned char *v_ptr, int y_stride, int uv_stride, - loop_filter_info *lfi) -{ - vp8_loop_filter_vertical_edge_c(y_ptr + 4, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_vertical_edge_c(y_ptr + 8, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_vertical_edge_c(y_ptr + 12, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - - if (u_ptr) - vp8_loop_filter_vertical_edge_c(u_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); - - if (v_ptr) - vp8_loop_filter_vertical_edge_c(v_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); -} - -void vp8_loop_filter_bvs_c(unsigned char *y_ptr, int y_stride, - const unsigned char *blimit) -{ - vp8_loop_filter_simple_vertical_edge_c(y_ptr + 4, y_stride, blimit); - vp8_loop_filter_simple_vertical_edge_c(y_ptr + 8, y_stride, blimit); - vp8_loop_filter_simple_vertical_edge_c(y_ptr + 12, y_stride, blimit); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/loopfilter.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/loopfilter.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/loopfilter.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/loopfilter.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_LOOPFILTER_H_ -#define VP8_COMMON_LOOPFILTER_H_ - -#include "vpx_ports/mem.h" -#include "vpx_config.h" -#include "vp8_rtcd.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define MAX_LOOP_FILTER 63 -/* fraction of total macroblock rows to be used in fast filter level picking */ -/* has to be > 2 */ -#define PARTIAL_FRAME_FRACTION 8 - -typedef enum -{ - NORMAL_LOOPFILTER = 0, - SIMPLE_LOOPFILTER = 1 -} LOOPFILTERTYPE; - -#if ARCH_ARM -#define SIMD_WIDTH 1 -#else -#define SIMD_WIDTH 16 -#endif - -/* Need to align this structure so when it is declared and - * passed it can be loaded into vector registers. - */ -typedef struct -{ - DECLARE_ALIGNED(SIMD_WIDTH, unsigned char, mblim[MAX_LOOP_FILTER + 1][SIMD_WIDTH]); - DECLARE_ALIGNED(SIMD_WIDTH, unsigned char, blim[MAX_LOOP_FILTER + 1][SIMD_WIDTH]); - DECLARE_ALIGNED(SIMD_WIDTH, unsigned char, lim[MAX_LOOP_FILTER + 1][SIMD_WIDTH]); - DECLARE_ALIGNED(SIMD_WIDTH, unsigned char, hev_thr[4][SIMD_WIDTH]); - unsigned char lvl[4][4][4]; - unsigned char hev_thr_lut[2][MAX_LOOP_FILTER + 1]; - unsigned char mode_lf_lut[10]; -} loop_filter_info_n; - -typedef struct loop_filter_info -{ - const unsigned char * mblim; - const unsigned char * blim; - const unsigned char * lim; - const unsigned char * hev_thr; -} loop_filter_info; - - -typedef void loop_filter_uvfunction -( - unsigned char *u, /* source pointer */ - int p, /* pitch */ - const unsigned char *blimit, - const unsigned char *limit, - const unsigned char *thresh, - unsigned char *v -); - -/* assorted loopfilter functions which get used elsewhere */ -struct VP8Common; -struct macroblockd; -struct modeinfo; - -void vp8_loop_filter_init(struct VP8Common *cm); - -void vp8_loop_filter_frame_init(struct VP8Common *cm, - struct macroblockd *mbd, - int default_filt_lvl); - -void vp8_loop_filter_frame(struct VP8Common *cm, struct macroblockd *mbd, - int frame_type); - -void vp8_loop_filter_partial_frame(struct VP8Common *cm, - struct macroblockd *mbd, - int default_filt_lvl); - -void vp8_loop_filter_frame_yonly(struct VP8Common *cm, - struct macroblockd *mbd, - int default_filt_lvl); - -void vp8_loop_filter_update_sharpness(loop_filter_info_n *lfi, - int sharpness_lvl); - -void vp8_loop_filter_row_normal(struct VP8Common *cm, - struct modeinfo *mode_info_context, - int mb_row, int post_ystride, int post_uvstride, - unsigned char *y_ptr, unsigned char *u_ptr, - unsigned char *v_ptr); - -void vp8_loop_filter_row_simple(struct VP8Common *cm, - struct modeinfo *mode_info_context, - int mb_row, int post_ystride, int post_uvstride, - unsigned char *y_ptr, unsigned char *u_ptr, - unsigned char *v_ptr); -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_LOOPFILTER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/mbpitch.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/mbpitch.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/mbpitch.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/mbpitch.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "blockd.h" - -void vp8_setup_block_dptrs(MACROBLOCKD *x) -{ - int r, c; - - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - x->block[r*4+c].predictor = x->predictor + r * 4 * 16 + c * 4; - } - } - - for (r = 0; r < 2; r++) - { - for (c = 0; c < 2; c++) - { - x->block[16+r*2+c].predictor = x->predictor + 256 + r * 4 * 8 + c * 4; - - } - } - - for (r = 0; r < 2; r++) - { - for (c = 0; c < 2; c++) - { - x->block[20+r*2+c].predictor = x->predictor + 320 + r * 4 * 8 + c * 4; - - } - } - - for (r = 0; r < 25; r++) - { - x->block[r].qcoeff = x->qcoeff + r * 16; - x->block[r].dqcoeff = x->dqcoeff + r * 16; - x->block[r].eob = x->eobs + r; - } -} - -void vp8_build_block_doffsets(MACROBLOCKD *x) -{ - int block; - - for (block = 0; block < 16; block++) /* y blocks */ - { - x->block[block].offset = - (block >> 2) * 4 * x->dst.y_stride + (block & 3) * 4; - } - - for (block = 16; block < 20; block++) /* U and V blocks */ - { - x->block[block+4].offset = - x->block[block].offset = - ((block - 16) >> 1) * 4 * x->dst.uv_stride + (block & 1) * 4; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/mfqe.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/mfqe.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/mfqe.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/mfqe.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,385 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/* MFQE: Multiframe Quality Enhancement - * In rate limited situations keyframes may cause significant visual artifacts - * commonly referred to as "popping." This file implements a postproccesing - * algorithm which blends data from the preceeding frame when there is no - * motion and the q from the previous frame is lower which indicates that it is - * higher quality. - */ - -#include "postproc.h" -#include "variance.h" -#include "vpx_mem/vpx_mem.h" -#include "vp8_rtcd.h" -#include "vpx_scale/yv12config.h" - -#include -#include - -static void filter_by_weight(unsigned char *src, int src_stride, - unsigned char *dst, int dst_stride, - int block_size, int src_weight) -{ - int dst_weight = (1 << MFQE_PRECISION) - src_weight; - int rounding_bit = 1 << (MFQE_PRECISION - 1); - int r, c; - - for (r = 0; r < block_size; r++) - { - for (c = 0; c < block_size; c++) - { - dst[c] = (src[c] * src_weight + - dst[c] * dst_weight + - rounding_bit) >> MFQE_PRECISION; - } - src += src_stride; - dst += dst_stride; - } -} - -void vp8_filter_by_weight16x16_c(unsigned char *src, int src_stride, - unsigned char *dst, int dst_stride, - int src_weight) -{ - filter_by_weight(src, src_stride, dst, dst_stride, 16, src_weight); -} - -void vp8_filter_by_weight8x8_c(unsigned char *src, int src_stride, - unsigned char *dst, int dst_stride, - int src_weight) -{ - filter_by_weight(src, src_stride, dst, dst_stride, 8, src_weight); -} - -void vp8_filter_by_weight4x4_c(unsigned char *src, int src_stride, - unsigned char *dst, int dst_stride, - int src_weight) -{ - filter_by_weight(src, src_stride, dst, dst_stride, 4, src_weight); -} - -static void apply_ifactor(unsigned char *y_src, - int y_src_stride, - unsigned char *y_dst, - int y_dst_stride, - unsigned char *u_src, - unsigned char *v_src, - int uv_src_stride, - unsigned char *u_dst, - unsigned char *v_dst, - int uv_dst_stride, - int block_size, - int src_weight) -{ - if (block_size == 16) - { - vp8_filter_by_weight16x16(y_src, y_src_stride, y_dst, y_dst_stride, src_weight); - vp8_filter_by_weight8x8(u_src, uv_src_stride, u_dst, uv_dst_stride, src_weight); - vp8_filter_by_weight8x8(v_src, uv_src_stride, v_dst, uv_dst_stride, src_weight); - } - else /* if (block_size == 8) */ - { - vp8_filter_by_weight8x8(y_src, y_src_stride, y_dst, y_dst_stride, src_weight); - vp8_filter_by_weight4x4(u_src, uv_src_stride, u_dst, uv_dst_stride, src_weight); - vp8_filter_by_weight4x4(v_src, uv_src_stride, v_dst, uv_dst_stride, src_weight); - } -} - -static unsigned int int_sqrt(unsigned int x) -{ - unsigned int y = x; - unsigned int guess; - int p = 1; - while (y>>=1) p++; - p>>=1; - - guess=0; - while (p>=0) - { - guess |= (1<> 1; - int qdiff = qcurr - qprev; - - int i; - unsigned char *up; - unsigned char *udp; - unsigned char *vp; - unsigned char *vdp; - - unsigned int act, actd, sad, usad, vsad, sse, thr, thrsq, actrisk; - - if (blksize == 16) - { - actd = (vp8_variance16x16(yd, yd_stride, VP8_ZEROS, 0, &sse)+128)>>8; - act = (vp8_variance16x16(y, y_stride, VP8_ZEROS, 0, &sse)+128)>>8; -#ifdef USE_SSD - sad = (vp8_variance16x16(y, y_stride, yd, yd_stride, &sse)); - sad = (sse + 128)>>8; - usad = (vp8_variance8x8(u, uv_stride, ud, uvd_stride, &sse)); - usad = (sse + 32)>>6; - vsad = (vp8_variance8x8(v, uv_stride, vd, uvd_stride, &sse)); - vsad = (sse + 32)>>6; -#else - sad = (vp8_sad16x16(y, y_stride, yd, yd_stride, UINT_MAX) + 128) >> 8; - usad = (vp8_sad8x8(u, uv_stride, ud, uvd_stride, UINT_MAX) + 32) >> 6; - vsad = (vp8_sad8x8(v, uv_stride, vd, uvd_stride, UINT_MAX)+ 32) >> 6; -#endif - } - else /* if (blksize == 8) */ - { - actd = (vp8_variance8x8(yd, yd_stride, VP8_ZEROS, 0, &sse)+32)>>6; - act = (vp8_variance8x8(y, y_stride, VP8_ZEROS, 0, &sse)+32)>>6; -#ifdef USE_SSD - sad = (vp8_variance8x8(y, y_stride, yd, yd_stride, &sse)); - sad = (sse + 32)>>6; - usad = (vp8_variance4x4(u, uv_stride, ud, uvd_stride, &sse)); - usad = (sse + 8)>>4; - vsad = (vp8_variance4x4(v, uv_stride, vd, uvd_stride, &sse)); - vsad = (sse + 8)>>4; -#else - sad = (vp8_sad8x8(y, y_stride, yd, yd_stride, UINT_MAX) + 32) >> 6; - usad = (vp8_sad4x4(u, uv_stride, ud, uvd_stride, UINT_MAX) + 8) >> 4; - vsad = (vp8_sad4x4(v, uv_stride, vd, uvd_stride, UINT_MAX) + 8) >> 4; -#endif - } - - actrisk = (actd > act * 5); - - /* thr = qdiff/16 + log2(act) + log4(qprev) */ - thr = (qdiff >> 4); - while (actd >>= 1) thr++; - while (qprev >>= 2) thr++; - -#ifdef USE_SSD - thrsq = thr * thr; - if (sad < thrsq && - /* additional checks for color mismatch and excessive addition of - * high-frequencies */ - 4 * usad < thrsq && 4 * vsad < thrsq && !actrisk) -#else - if (sad < thr && - /* additional checks for color mismatch and excessive addition of - * high-frequencies */ - 2 * usad < thr && 2 * vsad < thr && !actrisk) -#endif - { - int ifactor; -#ifdef USE_SSD - /* TODO: optimize this later to not need sqr root */ - sad = int_sqrt(sad); -#endif - ifactor = (sad << MFQE_PRECISION) / thr; - ifactor >>= (qdiff >> 5); - - if (ifactor) - { - apply_ifactor(y, y_stride, yd, yd_stride, - u, v, uv_stride, - ud, vd, uvd_stride, - blksize, ifactor); - } - } - else /* else implicitly copy from previous frame */ - { - if (blksize == 16) - { - vp8_copy_mem16x16(y, y_stride, yd, yd_stride); - vp8_copy_mem8x8(u, uv_stride, ud, uvd_stride); - vp8_copy_mem8x8(v, uv_stride, vd, uvd_stride); - } - else /* if (blksize == 8) */ - { - vp8_copy_mem8x8(y, y_stride, yd, yd_stride); - for (up = u, udp = ud, i = 0; i < uvblksize; ++i, up += uv_stride, udp += uvd_stride) - vpx_memcpy(udp, up, uvblksize); - for (vp = v, vdp = vd, i = 0; i < uvblksize; ++i, vp += uv_stride, vdp += uvd_stride) - vpx_memcpy(vdp, vp, uvblksize); - } - } -} - -static int qualify_inter_mb(const MODE_INFO *mode_info_context, int *map) -{ - if (mode_info_context->mbmi.mb_skip_coeff) - map[0] = map[1] = map[2] = map[3] = 1; - else if (mode_info_context->mbmi.mode==SPLITMV) - { - static int ndx[4][4] = - { - {0, 1, 4, 5}, - {2, 3, 6, 7}, - {8, 9, 12, 13}, - {10, 11, 14, 15} - }; - int i, j; - for (i=0; i<4; ++i) - { - map[i] = 1; - for (j=0; j<4 && map[j]; ++j) - map[i] &= (mode_info_context->bmi[ndx[i][j]].mv.as_mv.row <= 2 && - mode_info_context->bmi[ndx[i][j]].mv.as_mv.col <= 2); - } - } - else - { - map[0] = map[1] = map[2] = map[3] = - (mode_info_context->mbmi.mode > B_PRED && - abs(mode_info_context->mbmi.mv.as_mv.row) <= 2 && - abs(mode_info_context->mbmi.mv.as_mv.col) <= 2); - } - return (map[0]+map[1]+map[2]+map[3]); -} - -void vp8_multiframe_quality_enhance -( - VP8_COMMON *cm -) -{ - YV12_BUFFER_CONFIG *show = cm->frame_to_show; - YV12_BUFFER_CONFIG *dest = &cm->post_proc_buffer; - - FRAME_TYPE frame_type = cm->frame_type; - /* Point at base of Mb MODE_INFO list has motion vectors etc */ - const MODE_INFO *mode_info_context = cm->show_frame_mi; - int mb_row; - int mb_col; - int totmap, map[4]; - int qcurr = cm->base_qindex; - int qprev = cm->postproc_state.last_base_qindex; - - unsigned char *y_ptr, *u_ptr, *v_ptr; - unsigned char *yd_ptr, *ud_ptr, *vd_ptr; - - /* Set up the buffer pointers */ - y_ptr = show->y_buffer; - u_ptr = show->u_buffer; - v_ptr = show->v_buffer; - yd_ptr = dest->y_buffer; - ud_ptr = dest->u_buffer; - vd_ptr = dest->v_buffer; - - /* postprocess each macro block */ - for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) - { - for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) - { - /* if motion is high there will likely be no benefit */ - if (frame_type == INTER_FRAME) totmap = qualify_inter_mb(mode_info_context, map); - else totmap = (frame_type == KEY_FRAME ? 4 : 0); - if (totmap) - { - if (totmap < 4) - { - int i, j; - for (i=0; i<2; ++i) - for (j=0; j<2; ++j) - { - if (map[i*2+j]) - { - multiframe_quality_enhance_block(8, qcurr, qprev, - y_ptr + 8*(i*show->y_stride+j), - u_ptr + 4*(i*show->uv_stride+j), - v_ptr + 4*(i*show->uv_stride+j), - show->y_stride, - show->uv_stride, - yd_ptr + 8*(i*dest->y_stride+j), - ud_ptr + 4*(i*dest->uv_stride+j), - vd_ptr + 4*(i*dest->uv_stride+j), - dest->y_stride, - dest->uv_stride); - } - else - { - /* copy a 8x8 block */ - int k; - unsigned char *up = u_ptr + 4*(i*show->uv_stride+j); - unsigned char *udp = ud_ptr + 4*(i*dest->uv_stride+j); - unsigned char *vp = v_ptr + 4*(i*show->uv_stride+j); - unsigned char *vdp = vd_ptr + 4*(i*dest->uv_stride+j); - vp8_copy_mem8x8(y_ptr + 8*(i*show->y_stride+j), show->y_stride, - yd_ptr + 8*(i*dest->y_stride+j), dest->y_stride); - for (k = 0; k < 4; ++k, up += show->uv_stride, udp += dest->uv_stride, - vp += show->uv_stride, vdp += dest->uv_stride) - { - vpx_memcpy(udp, up, 4); - vpx_memcpy(vdp, vp, 4); - } - } - } - } - else /* totmap = 4 */ - { - multiframe_quality_enhance_block(16, qcurr, qprev, y_ptr, - u_ptr, v_ptr, - show->y_stride, - show->uv_stride, - yd_ptr, ud_ptr, vd_ptr, - dest->y_stride, - dest->uv_stride); - } - } - else - { - vp8_copy_mem16x16(y_ptr, show->y_stride, yd_ptr, dest->y_stride); - vp8_copy_mem8x8(u_ptr, show->uv_stride, ud_ptr, dest->uv_stride); - vp8_copy_mem8x8(v_ptr, show->uv_stride, vd_ptr, dest->uv_stride); - } - y_ptr += 16; - u_ptr += 8; - v_ptr += 8; - yd_ptr += 16; - ud_ptr += 8; - vd_ptr += 8; - mode_info_context++; /* step to next MB */ - } - - y_ptr += show->y_stride * 16 - 16 * cm->mb_cols; - u_ptr += show->uv_stride * 8 - 8 * cm->mb_cols; - v_ptr += show->uv_stride * 8 - 8 * cm->mb_cols; - yd_ptr += dest->y_stride * 16 - 16 * cm->mb_cols; - ud_ptr += dest->uv_stride * 8 - 8 * cm->mb_cols; - vd_ptr += dest->uv_stride * 8 - 8 * cm->mb_cols; - - mode_info_context++; /* Skip border mb */ - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/mips/dspr2/dequantize_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/mips/dspr2/dequantize_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/mips/dspr2/dequantize_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/mips/dspr2/dequantize_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "vpx_mem/vpx_mem.h" - -#if HAVE_DSPR2 -void vp8_dequant_idct_add_dspr2(short *input, short *dq, - unsigned char *dest, int stride) -{ - int i; - - for (i = 0; i < 16; i++) - { - input[i] = dq[i] * input[i]; - } - - vp8_short_idct4x4llm_dspr2(input, dest, stride, dest, stride); - - vpx_memset(input, 0, 32); - -} - -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/mips/dspr2/filter_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/mips/dspr2/filter_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/mips/dspr2/filter_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/mips/dspr2/filter_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2823 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include -#include "vp8_rtcd.h" -#include "vpx_ports/mem.h" - -#if HAVE_DSPR2 -#define CROP_WIDTH 256 -unsigned char ff_cropTbl[256 + 2 * CROP_WIDTH]; - -static const unsigned short sub_pel_filterss[8][3] = -{ - { 0, 0, 0}, - { 0, 0x0601, 0x7b0c}, - { 0x0201, 0x0b08, 0x6c24}, - { 0, 0x0906, 0x5d32}, - { 0x0303, 0x1010, 0x4d4d}, - { 0, 0x0609, 0x325d}, - { 0x0102, 0x080b, 0x246c}, - { 0, 0x0106, 0x0c7b}, -}; - - -static const int sub_pel_filters_int[8][3] = -{ - { 0, 0, 0}, - { 0x0000fffa, 0x007b000c, 0xffff0000}, - { 0x0002fff5, 0x006c0024, 0xfff80001}, - { 0x0000fff7, 0x005d0032, 0xfffa0000}, - { 0x0003fff0, 0x004d004d, 0xfff00003}, - { 0x0000fffa, 0x0032005d, 0xfff70000}, - { 0x0001fff8, 0x0024006c, 0xfff50002}, - { 0x0000ffff, 0x000c007b, 0xfffa0000}, -}; - - -static const int sub_pel_filters_inv[8][3] = -{ - { 0, 0, 0}, - { 0xfffa0000, 0x000c007b, 0x0000ffff}, - { 0xfff50002, 0x0024006c, 0x0001fff8}, - { 0xfff70000, 0x0032005d, 0x0000fffa}, - { 0xfff00003, 0x004d004d, 0x0003fff0}, - { 0xfffa0000, 0x005d0032, 0x0000fff7}, - { 0xfff80001, 0x006c0024, 0x0002fff5}, - { 0xffff0000, 0x007b000c, 0x0000fffa}, -}; - - -static const int sub_pel_filters_int_tap_4[8][2] = -{ - { 0, 0}, - { 0xfffa007b, 0x000cffff}, - { 0, 0}, - { 0xfff7005d, 0x0032fffa}, - { 0, 0}, - { 0xfffa0032, 0x005dfff7}, - { 0, 0}, - { 0xffff000c, 0x007bfffa}, -}; - - -static const int sub_pel_filters_inv_tap_4[8][2] = -{ - { 0, 0}, - { 0x007bfffa, 0xffff000c}, - { 0, 0}, - { 0x005dfff7, 0xfffa0032}, - { 0, 0}, - { 0x0032fffa, 0xfff7005d}, - { 0, 0}, - { 0x000cffff, 0xfffa007b}, -}; - -inline void prefetch_load(unsigned char *src) -{ - __asm__ __volatile__ ( - "pref 0, 0(%[src]) \n\t" - : - : [src] "r" (src) - ); -} - - -inline void prefetch_store(unsigned char *dst) -{ - __asm__ __volatile__ ( - "pref 1, 0(%[dst]) \n\t" - : - : [dst] "r" (dst) - ); -} - -void dsputil_static_init(void) -{ - int i; - - for (i = 0; i < 256; i++) ff_cropTbl[i + CROP_WIDTH] = i; - - for (i = 0; i < CROP_WIDTH; i++) - { - ff_cropTbl[i] = 0; - ff_cropTbl[i + CROP_WIDTH + 256] = 255; - } -} - -void vp8_filter_block2d_first_pass_4 -( - unsigned char *RESTRICT src_ptr, - unsigned char *RESTRICT dst_ptr, - unsigned int src_pixels_per_line, - unsigned int output_height, - int xoffset, - int pitch -) -{ - unsigned int i; - int Temp1, Temp2, Temp3, Temp4; - - unsigned int vector4a = 64; - int vector1b, vector2b, vector3b; - unsigned int tp1, tp2, tn1, tn2; - unsigned int p1, p2, p3; - unsigned int n1, n2, n3; - unsigned char *cm = ff_cropTbl + CROP_WIDTH; - - vector3b = sub_pel_filters_inv[xoffset][2]; - - /* if (xoffset == 0) we don't need any filtering */ - if (vector3b == 0) - { - for (i = 0; i < output_height; i++) - { - /* prefetch src_ptr data to cache memory */ - prefetch_load(src_ptr + src_pixels_per_line); - dst_ptr[0] = src_ptr[0]; - dst_ptr[1] = src_ptr[1]; - dst_ptr[2] = src_ptr[2]; - dst_ptr[3] = src_ptr[3]; - - /* next row... */ - src_ptr += src_pixels_per_line; - dst_ptr += 4; - } - } - else - { - if (vector3b > 65536) - { - /* 6 tap filter */ - - vector1b = sub_pel_filters_inv[xoffset][0]; - vector2b = sub_pel_filters_inv[xoffset][1]; - - /* prefetch src_ptr data to cache memory */ - prefetch_load(src_ptr + src_pixels_per_line); - - for (i = output_height; i--;) - { - /* apply filter with vectors pairs */ - __asm__ __volatile__ ( - "ulw %[tp1], -2(%[src_ptr]) \n\t" - "ulw %[tp2], 2(%[src_ptr]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "preceu.ph.qbr %[p1], %[tp1] \n\t" - "preceu.ph.qbl %[p2], %[tp1] \n\t" - "preceu.ph.qbr %[p3], %[tp2] \n\t" - "dpa.w.ph $ac3, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[p3], %[vector3b] \n\t" - - /* even 2. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "preceu.ph.qbl %[p1], %[tp2] \n\t" - "balign %[tp2], %[tp1], 3 \n\t" - "extp %[Temp1], $ac3, 9 \n\t" - "dpa.w.ph $ac2, %[p2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p3], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[p1], %[vector3b] \n\t" - - /* odd 1. pixel */ - "ulw %[tn2], 3(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "preceu.ph.qbr %[n1], %[tp2] \n\t" - "preceu.ph.qbl %[n2], %[tp2] \n\t" - "preceu.ph.qbr %[n3], %[tn2] \n\t" - "extp %[Temp3], $ac2, 9 \n\t" - "dpa.w.ph $ac3, %[n1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[n2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[n3], %[vector3b] \n\t" - - /* even 2. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "preceu.ph.qbl %[n1], %[tn2] \n\t" - "extp %[Temp2], $ac3, 9 \n\t" - "dpa.w.ph $ac2, %[n2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[n3], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[n1], %[vector3b] \n\t" - "extp %[Temp4], $ac2, 9 \n\t" - - /* clamp */ - "lbux %[tp1], %[Temp1](%[cm]) \n\t" - "lbux %[tn1], %[Temp2](%[cm]) \n\t" - "lbux %[tp2], %[Temp3](%[cm]) \n\t" - "lbux %[n2], %[Temp4](%[cm]) \n\t" - - /* store bytes */ - "sb %[tp1], 0(%[dst_ptr]) \n\t" - "sb %[tn1], 1(%[dst_ptr]) \n\t" - "sb %[tp2], 2(%[dst_ptr]) \n\t" - "sb %[n2], 3(%[dst_ptr]) \n\t" - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), [tn1] "=&r" (tn1), - [tn2] "=&r" (tn2), [p1] "=&r" (p1), [p2] "=&r" (p2), - [p3] "=&r" (p3), [n1] "=&r" (n1), [n2] "=&r" (n2), - [n3] "=&r" (n3), [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=&r" (Temp4) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector4a] "r" (vector4a), [cm] "r" (cm), [dst_ptr] "r" (dst_ptr), - [vector3b] "r" (vector3b), [src_ptr] "r" (src_ptr) - ); - - /* Next row... */ - src_ptr += src_pixels_per_line; - dst_ptr += pitch; - } - } - else - { - /* 4 tap filter */ - - vector1b = sub_pel_filters_inv_tap_4[xoffset][0]; - vector2b = sub_pel_filters_inv_tap_4[xoffset][1]; - - for (i = output_height; i--;) - { - /* apply filter with vectors pairs */ - __asm__ __volatile__ ( - "ulw %[tp1], -1(%[src_ptr]) \n\t" - "ulw %[tp2], 3(%[src_ptr]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "preceu.ph.qbr %[p1], %[tp1] \n\t" - "preceu.ph.qbl %[p2], %[tp1] \n\t" - "preceu.ph.qbr %[p3], %[tp2] \n\t" - "dpa.w.ph $ac3, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p2], %[vector2b] \n\t" - - /* even 2. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "dpa.w.ph $ac2, %[p2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p3], %[vector2b] \n\t" - "extp %[Temp1], $ac3, 9 \n\t" - - /* odd 1. pixel */ - "srl %[tn1], %[tp2], 8 \n\t" - "balign %[tp2], %[tp1], 3 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "preceu.ph.qbr %[n1], %[tp2] \n\t" - "preceu.ph.qbl %[n2], %[tp2] \n\t" - "preceu.ph.qbr %[n3], %[tn1] \n\t" - "extp %[Temp3], $ac2, 9 \n\t" - "dpa.w.ph $ac3, %[n1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[n2], %[vector2b] \n\t" - - /* odd 2. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "extp %[Temp2], $ac3, 9 \n\t" - "dpa.w.ph $ac2, %[n2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[n3], %[vector2b] \n\t" - "extp %[Temp4], $ac2, 9 \n\t" - - /* clamp and store results */ - "lbux %[tp1], %[Temp1](%[cm]) \n\t" - "lbux %[tn1], %[Temp2](%[cm]) \n\t" - "lbux %[tp2], %[Temp3](%[cm]) \n\t" - "sb %[tp1], 0(%[dst_ptr]) \n\t" - "sb %[tn1], 1(%[dst_ptr]) \n\t" - "lbux %[n2], %[Temp4](%[cm]) \n\t" - "sb %[tp2], 2(%[dst_ptr]) \n\t" - "sb %[n2], 3(%[dst_ptr]) \n\t" - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), [tn1] "=&r" (tn1), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), - [n1] "=&r" (n1), [n2] "=&r" (n2), [n3] "=&r" (n3), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=&r" (Temp4) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector4a] "r" (vector4a), [cm] "r" (cm), [dst_ptr] "r" (dst_ptr), - [src_ptr] "r" (src_ptr) - ); - /* Next row... */ - src_ptr += src_pixels_per_line; - dst_ptr += pitch; - } - } - } -} - -void vp8_filter_block2d_first_pass_8_all -( - unsigned char *RESTRICT src_ptr, - unsigned char *RESTRICT dst_ptr, - unsigned int src_pixels_per_line, - unsigned int output_height, - int xoffset, - int pitch -) -{ - unsigned int i; - int Temp1, Temp2, Temp3, Temp4; - - unsigned int vector4a = 64; - unsigned int vector1b, vector2b, vector3b; - unsigned int tp1, tp2, tn1, tn2; - unsigned int p1, p2, p3, p4; - unsigned int n1, n2, n3, n4; - - unsigned char *cm = ff_cropTbl + CROP_WIDTH; - - /* if (xoffset == 0) we don't need any filtering */ - if (xoffset == 0) - { - for (i = 0; i < output_height; i++) - { - /* prefetch src_ptr data to cache memory */ - prefetch_load(src_ptr + src_pixels_per_line); - - dst_ptr[0] = src_ptr[0]; - dst_ptr[1] = src_ptr[1]; - dst_ptr[2] = src_ptr[2]; - dst_ptr[3] = src_ptr[3]; - dst_ptr[4] = src_ptr[4]; - dst_ptr[5] = src_ptr[5]; - dst_ptr[6] = src_ptr[6]; - dst_ptr[7] = src_ptr[7]; - - /* next row... */ - src_ptr += src_pixels_per_line; - dst_ptr += 8; - } - } - else - { - vector3b = sub_pel_filters_inv[xoffset][2]; - - if (vector3b > 65536) - { - /* 6 tap filter */ - - vector1b = sub_pel_filters_inv[xoffset][0]; - vector2b = sub_pel_filters_inv[xoffset][1]; - - for (i = output_height; i--;) - { - /* prefetch src_ptr data to cache memory */ - prefetch_load(src_ptr + src_pixels_per_line); - - /* apply filter with vectors pairs */ - __asm__ __volatile__ ( - "ulw %[tp1], -2(%[src_ptr]) \n\t" - "ulw %[tp2], 2(%[src_ptr]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "preceu.ph.qbr %[p1], %[tp1] \n\t" - "preceu.ph.qbl %[p2], %[tp1] \n\t" - "preceu.ph.qbr %[p3], %[tp2] \n\t" - "dpa.w.ph $ac3, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[p3], %[vector3b] \n\t" - - /* even 2. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "preceu.ph.qbl %[p1], %[tp2] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p3], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[p1], %[vector3b] \n\t" - - "balign %[tp2], %[tp1], 3 \n\t" - "extp %[Temp1], $ac3, 9 \n\t" - "ulw %[tn2], 3(%[src_ptr]) \n\t" - - /* odd 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "preceu.ph.qbr %[n1], %[tp2] \n\t" - "preceu.ph.qbl %[n2], %[tp2] \n\t" - "preceu.ph.qbr %[n3], %[tn2] \n\t" - "extp %[Temp3], $ac2, 9 \n\t" - "dpa.w.ph $ac3, %[n1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[n2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[n3], %[vector3b] \n\t" - - /* odd 2. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "preceu.ph.qbl %[n1], %[tn2] \n\t" - "dpa.w.ph $ac2, %[n2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[n3], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[n1], %[vector3b] \n\t" - "ulw %[tp1], 6(%[src_ptr]) \n\t" - "extp %[Temp2], $ac3, 9 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "preceu.ph.qbr %[p2], %[tp1] \n\t" - "extp %[Temp4], $ac2, 9 \n\t" - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), [tn2] "=&r" (tn2), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), - [n1] "=&r" (n1), [n2] "=&r" (n2), [n3] "=&r" (n3), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=r" (Temp4) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector4a] "r" (vector4a), [vector3b] "r" (vector3b), - [src_ptr] "r" (src_ptr) - ); - - /* clamp and store results */ - dst_ptr[0] = cm[Temp1]; - dst_ptr[1] = cm[Temp2]; - dst_ptr[2] = cm[Temp3]; - dst_ptr[3] = cm[Temp4]; - - /* next 4 pixels */ - __asm__ __volatile__ ( - /* even 3. pixel */ - "dpa.w.ph $ac3, %[p3], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p1], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[p2], %[vector3b] \n\t" - - /* even 4. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "preceu.ph.qbl %[p4], %[tp1] \n\t" - "dpa.w.ph $ac2, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[p4], %[vector3b] \n\t" - - "ulw %[tn1], 7(%[src_ptr]) \n\t" - "extp %[Temp1], $ac3, 9 \n\t" - - /* odd 3. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "preceu.ph.qbr %[n2], %[tn1] \n\t" - "dpa.w.ph $ac3, %[n3], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[n1], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[n2], %[vector3b] \n\t" - "extp %[Temp3], $ac2, 9 \n\t" - - /* odd 4. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "preceu.ph.qbl %[n4], %[tn1] \n\t" - "dpa.w.ph $ac2, %[n1], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[n2], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[n4], %[vector3b] \n\t" - "extp %[Temp2], $ac3, 9 \n\t" - "extp %[Temp4], $ac2, 9 \n\t" - - : [tn1] "=&r" (tn1), [n2] "=&r" (n2), - [p4] "=&r" (p4), [n4] "=&r" (n4), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=r" (Temp4) - : [tp1] "r" (tp1), [vector1b] "r" (vector1b), [p2] "r" (p2), - [vector2b] "r" (vector2b), [n1] "r" (n1), [p1] "r" (p1), - [vector4a] "r" (vector4a), [vector3b] "r" (vector3b), - [p3] "r" (p3), [n3] "r" (n3), [src_ptr] "r" (src_ptr) - ); - - /* clamp and store results */ - dst_ptr[4] = cm[Temp1]; - dst_ptr[5] = cm[Temp2]; - dst_ptr[6] = cm[Temp3]; - dst_ptr[7] = cm[Temp4]; - - src_ptr += src_pixels_per_line; - dst_ptr += pitch; - } - } - else - { - /* 4 tap filter */ - - vector1b = sub_pel_filters_inv_tap_4[xoffset][0]; - vector2b = sub_pel_filters_inv_tap_4[xoffset][1]; - - for (i = output_height; i--;) - { - /* prefetch src_ptr data to cache memory */ - prefetch_load(src_ptr + src_pixels_per_line); - - /* apply filter with vectors pairs */ - __asm__ __volatile__ ( - "ulw %[tp1], -1(%[src_ptr]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "preceu.ph.qbr %[p1], %[tp1] \n\t" - "preceu.ph.qbl %[p2], %[tp1] \n\t" - "dpa.w.ph $ac3, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p2], %[vector2b] \n\t" - - "ulw %[tp2], 3(%[src_ptr]) \n\t" - - /* even 2. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "preceu.ph.qbr %[p3], %[tp2] \n\t" - "preceu.ph.qbl %[p4], %[tp2] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p3], %[vector2b] \n\t" - "extp %[Temp1], $ac3, 9 \n\t" - - "balign %[tp2], %[tp1], 3 \n\t" - - /* odd 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "preceu.ph.qbr %[n1], %[tp2] \n\t" - "preceu.ph.qbl %[n2], %[tp2] \n\t" - "dpa.w.ph $ac3, %[n1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[n2], %[vector2b] \n\t" - "extp %[Temp3], $ac2, 9 \n\t" - - "ulw %[tn2], 4(%[src_ptr]) \n\t" - - /* odd 2. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "preceu.ph.qbr %[n3], %[tn2] \n\t" - "preceu.ph.qbl %[n4], %[tn2] \n\t" - "dpa.w.ph $ac2, %[n2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[n3], %[vector2b] \n\t" - "ulw %[tp1], 7(%[src_ptr]) \n\t" - "extp %[Temp2], $ac3, 9 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "extp %[Temp4], $ac2, 9 \n\t" - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), - [tn2] "=&r" (tn2), [p1] "=&r" (p1), [p2] "=&r" (p2), - [p3] "=&r" (p3), [p4] "=&r" (p4), [n1] "=&r" (n1), - [n2] "=&r" (n2), [n3] "=&r" (n3), [n4] "=&r" (n4), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=r" (Temp4) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector4a] "r" (vector4a), [src_ptr] "r" (src_ptr) - ); - - /* clamp and store results */ - dst_ptr[0] = cm[Temp1]; - dst_ptr[1] = cm[Temp2]; - dst_ptr[2] = cm[Temp3]; - dst_ptr[3] = cm[Temp4]; - - /* next 4 pixels */ - __asm__ __volatile__ ( - /* even 3. pixel */ - "dpa.w.ph $ac3, %[p3], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p4], %[vector2b] \n\t" - - /* even 4. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "preceu.ph.qbr %[p2], %[tp1] \n\t" - "dpa.w.ph $ac2, %[p4], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector2b] \n\t" - "extp %[Temp1], $ac3, 9 \n\t" - - /* odd 3. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "dpa.w.ph $ac3, %[n3], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[n4], %[vector2b] \n\t" - "ulw %[tn1], 8(%[src_ptr]) \n\t" - "extp %[Temp3], $ac2, 9 \n\t" - - /* odd 4. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "preceu.ph.qbr %[n2], %[tn1] \n\t" - "dpa.w.ph $ac2, %[n4], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[n2], %[vector2b] \n\t" - "extp %[Temp2], $ac3, 9 \n\t" - "extp %[Temp4], $ac2, 9 \n\t" - - : [tn1] "=&r" (tn1), [p2] "=&r" (p2), [n2] "=&r" (n2), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=r" (Temp4) - : [tp1] "r" (tp1), [p3] "r" (p3), [p4] "r" (p4), - [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector4a] "r" (vector4a), [src_ptr] "r" (src_ptr), - [n3] "r" (n3), [n4] "r" (n4) - ); - - /* clamp and store results */ - dst_ptr[4] = cm[Temp1]; - dst_ptr[5] = cm[Temp2]; - dst_ptr[6] = cm[Temp3]; - dst_ptr[7] = cm[Temp4]; - - /* next row... */ - src_ptr += src_pixels_per_line; - dst_ptr += pitch; - } - } - } -} - - -void vp8_filter_block2d_first_pass16_6tap -( - unsigned char *RESTRICT src_ptr, - unsigned char *RESTRICT dst_ptr, - unsigned int src_pixels_per_line, - unsigned int output_height, - int xoffset, - int pitch -) -{ - unsigned int i; - int Temp1, Temp2, Temp3, Temp4; - - unsigned int vector4a; - unsigned int vector1b, vector2b, vector3b; - unsigned int tp1, tp2, tn1, tn2; - unsigned int p1, p2, p3, p4; - unsigned int n1, n2, n3, n4; - unsigned char *cm = ff_cropTbl + CROP_WIDTH; - - vector1b = sub_pel_filters_inv[xoffset][0]; - vector2b = sub_pel_filters_inv[xoffset][1]; - vector3b = sub_pel_filters_inv[xoffset][2]; - vector4a = 64; - - for (i = output_height; i--;) - { - /* prefetch src_ptr data to cache memory */ - prefetch_load(src_ptr + src_pixels_per_line); - - /* apply filter with vectors pairs */ - __asm__ __volatile__ ( - "ulw %[tp1], -2(%[src_ptr]) \n\t" - "ulw %[tp2], 2(%[src_ptr]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "preceu.ph.qbr %[p1], %[tp1] \n\t" - "preceu.ph.qbl %[p2], %[tp1] \n\t" - "preceu.ph.qbr %[p3], %[tp2] \n\t" - "dpa.w.ph $ac3, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[p3], %[vector3b] \n\t" - - /* even 2. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "preceu.ph.qbl %[p1], %[tp2] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p3], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[p1], %[vector3b] \n\t" - - "balign %[tp2], %[tp1], 3 \n\t" - "ulw %[tn2], 3(%[src_ptr]) \n\t" - "extp %[Temp1], $ac3, 9 \n\t" - - /* odd 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "preceu.ph.qbr %[n1], %[tp2] \n\t" - "preceu.ph.qbl %[n2], %[tp2] \n\t" - "preceu.ph.qbr %[n3], %[tn2] \n\t" - "extp %[Temp3], $ac2, 9 \n\t" - "dpa.w.ph $ac3, %[n1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[n2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[n3], %[vector3b] \n\t" - - /* odd 2. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "preceu.ph.qbl %[n1], %[tn2] \n\t" - "dpa.w.ph $ac2, %[n2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[n3], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[n1], %[vector3b] \n\t" - "ulw %[tp1], 6(%[src_ptr]) \n\t" - "extp %[Temp2], $ac3, 9 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "preceu.ph.qbr %[p2], %[tp1] \n\t" - "extp %[Temp4], $ac2, 9 \n\t" - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), [tn2] "=&r" (tn2), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), - [n1] "=&r" (n1), [n2] "=&r" (n2), [n3] "=&r" (n3), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=r" (Temp4) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector4a] "r" (vector4a), [vector3b] "r" (vector3b), - [src_ptr] "r" (src_ptr) - ); - - /* clamp and store results */ - dst_ptr[0] = cm[Temp1]; - dst_ptr[1] = cm[Temp2]; - dst_ptr[2] = cm[Temp3]; - dst_ptr[3] = cm[Temp4]; - - /* next 4 pixels */ - __asm__ __volatile__ ( - /* even 3. pixel */ - "dpa.w.ph $ac3, %[p3], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p1], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[p2], %[vector3b] \n\t" - - /* even 4. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "preceu.ph.qbl %[p4], %[tp1] \n\t" - "dpa.w.ph $ac2, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[p4], %[vector3b] \n\t" - "ulw %[tn1], 7(%[src_ptr]) \n\t" - "extp %[Temp1], $ac3, 9 \n\t" - - /* odd 3. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "preceu.ph.qbr %[n2], %[tn1] \n\t" - "dpa.w.ph $ac3, %[n3], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[n1], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[n2], %[vector3b] \n\t" - "extp %[Temp3], $ac2, 9 \n\t" - - /* odd 4. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "preceu.ph.qbl %[n4], %[tn1] \n\t" - "dpa.w.ph $ac2, %[n1], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[n2], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[n4], %[vector3b] \n\t" - "ulw %[tp2], 10(%[src_ptr]) \n\t" - "extp %[Temp2], $ac3, 9 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "preceu.ph.qbr %[p1], %[tp2] \n\t" - "extp %[Temp4], $ac2, 9 \n\t" - - : [tn1] "=&r" (tn1), [tp2] "=&r" (tp2), [n2] "=&r" (n2), - [p4] "=&r" (p4), [n4] "=&r" (n4), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=r" (Temp4) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [tp1] "r" (tp1), [n1] "r" (n1), [p1] "r" (p1), - [vector4a] "r" (vector4a), [p2] "r" (p2), [vector3b] "r" (vector3b), - [p3] "r" (p3), [n3] "r" (n3), [src_ptr] "r" (src_ptr) - ); - - /* clamp and store results */ - dst_ptr[4] = cm[Temp1]; - dst_ptr[5] = cm[Temp2]; - dst_ptr[6] = cm[Temp3]; - dst_ptr[7] = cm[Temp4]; - - /* next 4 pixels */ - __asm__ __volatile__ ( - /* even 5. pixel */ - "dpa.w.ph $ac3, %[p2], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p4], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[p1], %[vector3b] \n\t" - - /* even 6. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "preceu.ph.qbl %[p3], %[tp2] \n\t" - "dpa.w.ph $ac2, %[p4], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p1], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[p3], %[vector3b] \n\t" - - "ulw %[tn1], 11(%[src_ptr]) \n\t" - "extp %[Temp1], $ac3, 9 \n\t" - - /* odd 5. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "preceu.ph.qbr %[n1], %[tn1] \n\t" - "dpa.w.ph $ac3, %[n2], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[n4], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[n1], %[vector3b] \n\t" - "extp %[Temp3], $ac2, 9 \n\t" - - /* odd 6. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "preceu.ph.qbl %[n3], %[tn1] \n\t" - "dpa.w.ph $ac2, %[n4], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[n1], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[n3], %[vector3b] \n\t" - "ulw %[tp1], 14(%[src_ptr]) \n\t" - "extp %[Temp2], $ac3, 9 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "preceu.ph.qbr %[p4], %[tp1] \n\t" - "extp %[Temp4], $ac2, 9 \n\t" - - : [tn1] "=&r" (tn1), [tp1] "=&r" (tp1), - [n1] "=&r" (n1), [p3] "=&r" (p3), [n3] "=&r" (n3), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=r" (Temp4) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [tp2] "r" (tp2), [p2] "r" (p2), [n2] "r" (n2), - [p4] "r" (p4), [n4] "r" (n4), [p1] "r" (p1), [src_ptr] "r" (src_ptr), - [vector4a] "r" (vector4a), [vector3b] "r" (vector3b) - ); - - /* clamp and store results */ - dst_ptr[8] = cm[Temp1]; - dst_ptr[9] = cm[Temp2]; - dst_ptr[10] = cm[Temp3]; - dst_ptr[11] = cm[Temp4]; - - /* next 4 pixels */ - __asm__ __volatile__ ( - /* even 7. pixel */ - "dpa.w.ph $ac3, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p3], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[p4], %[vector3b] \n\t" - - /* even 8. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "preceu.ph.qbl %[p2], %[tp1] \n\t" - "dpa.w.ph $ac2, %[p3], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p4], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector3b] \n\t" - "ulw %[tn1], 15(%[src_ptr]) \n\t" - "extp %[Temp1], $ac3, 9 \n\t" - - /* odd 7. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "preceu.ph.qbr %[n4], %[tn1] \n\t" - "dpa.w.ph $ac3, %[n1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[n3], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[n4], %[vector3b] \n\t" - "extp %[Temp3], $ac2, 9 \n\t" - - /* odd 8. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "preceu.ph.qbl %[n2], %[tn1] \n\t" - "dpa.w.ph $ac2, %[n3], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[n4], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[n2], %[vector3b] \n\t" - "extp %[Temp2], $ac3, 9 \n\t" - "extp %[Temp4], $ac2, 9 \n\t" - - /* clamp and store results */ - "lbux %[tp1], %[Temp1](%[cm]) \n\t" - "lbux %[tn1], %[Temp2](%[cm]) \n\t" - "lbux %[p2], %[Temp3](%[cm]) \n\t" - "sb %[tp1], 12(%[dst_ptr]) \n\t" - "sb %[tn1], 13(%[dst_ptr]) \n\t" - "lbux %[n2], %[Temp4](%[cm]) \n\t" - "sb %[p2], 14(%[dst_ptr]) \n\t" - "sb %[n2], 15(%[dst_ptr]) \n\t" - - : [tn1] "=&r" (tn1), [p2] "=&r" (p2), [n2] "=&r" (n2), [n4] "=&r" (n4), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=r" (Temp4) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [tp1] "r" (tp1), [p4] "r" (p4), [n1] "r" (n1), [p1] "r" (p1), - [vector4a] "r" (vector4a), [vector3b] "r" (vector3b), [p3] "r" (p3), - [n3] "r" (n3), [src_ptr] "r" (src_ptr), - [cm] "r" (cm), [dst_ptr] "r" (dst_ptr) - ); - - src_ptr += src_pixels_per_line; - dst_ptr += pitch; - } -} - - -void vp8_filter_block2d_first_pass16_0 -( - unsigned char *RESTRICT src_ptr, - unsigned char *RESTRICT output_ptr, - unsigned int src_pixels_per_line -) -{ - int Temp1, Temp2, Temp3, Temp4; - int i; - - /* prefetch src_ptr data to cache memory */ - prefetch_store(output_ptr + 32); - - /* copy memory from src buffer to dst buffer */ - for (i = 0; i < 7; i++) - { - __asm__ __volatile__ ( - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "ulw %[Temp3], 8(%[src_ptr]) \n\t" - "ulw %[Temp4], 12(%[src_ptr]) \n\t" - "sw %[Temp1], 0(%[output_ptr]) \n\t" - "sw %[Temp2], 4(%[output_ptr]) \n\t" - "sw %[Temp3], 8(%[output_ptr]) \n\t" - "sw %[Temp4], 12(%[output_ptr]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - : [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3), - [Temp4] "=&r" (Temp4), [src_ptr] "+r" (src_ptr) - : [src_pixels_per_line] "r" (src_pixels_per_line), - [output_ptr] "r" (output_ptr) - ); - - __asm__ __volatile__ ( - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "ulw %[Temp3], 8(%[src_ptr]) \n\t" - "ulw %[Temp4], 12(%[src_ptr]) \n\t" - "sw %[Temp1], 16(%[output_ptr]) \n\t" - "sw %[Temp2], 20(%[output_ptr]) \n\t" - "sw %[Temp3], 24(%[output_ptr]) \n\t" - "sw %[Temp4], 28(%[output_ptr]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - : [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3), - [Temp4] "=&r" (Temp4), [src_ptr] "+r" (src_ptr) - : [src_pixels_per_line] "r" (src_pixels_per_line), - [output_ptr] "r" (output_ptr) - ); - - __asm__ __volatile__ ( - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "ulw %[Temp3], 8(%[src_ptr]) \n\t" - "ulw %[Temp4], 12(%[src_ptr]) \n\t" - "sw %[Temp1], 32(%[output_ptr]) \n\t" - "sw %[Temp2], 36(%[output_ptr]) \n\t" - "sw %[Temp3], 40(%[output_ptr]) \n\t" - "sw %[Temp4], 44(%[output_ptr]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - : [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3), - [Temp4] "=&r" (Temp4), [src_ptr] "+r" (src_ptr) - : [src_pixels_per_line] "r" (src_pixels_per_line), - [output_ptr] "r" (output_ptr) - ); - - output_ptr += 48; - } -} - - -void vp8_filter_block2d_first_pass16_4tap -( - unsigned char *RESTRICT src_ptr, - unsigned char *RESTRICT output_ptr, - unsigned int src_pixels_per_line, - unsigned int output_width, - unsigned int output_height, - int xoffset, - int yoffset, - unsigned char *RESTRICT dst_ptr, - int pitch -) -{ - unsigned int i, j; - int Temp1, Temp2, Temp3, Temp4; - - unsigned int vector4a; - int vector1b, vector2b; - unsigned int tp1, tp2, tp3, tn1; - unsigned int p1, p2, p3; - unsigned int n1, n2, n3; - unsigned char *cm = ff_cropTbl + CROP_WIDTH; - - vector4a = 64; - - vector1b = sub_pel_filters_inv_tap_4[xoffset][0]; - vector2b = sub_pel_filters_inv_tap_4[xoffset][1]; - - /* if (yoffset == 0) don't need temp buffer, data will be stored in dst_ptr */ - if (yoffset == 0) - { - output_height -= 5; - src_ptr += (src_pixels_per_line + src_pixels_per_line); - - for (i = output_height; i--;) - { - __asm__ __volatile__ ( - "ulw %[tp3], -1(%[src_ptr]) \n\t" - : [tp3] "=&r" (tp3) - : [src_ptr] "r" (src_ptr) - ); - - /* processing 4 adjacent pixels */ - for (j = 0; j < 16; j += 4) - { - /* apply filter with vectors pairs */ - __asm__ __volatile__ ( - "ulw %[tp2], 3(%[src_ptr]) \n\t" - "move %[tp1], %[tp3] \n\t" - - /* even 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "mthi $0, $ac3 \n\t" - "move %[tp3], %[tp2] \n\t" - "preceu.ph.qbr %[p1], %[tp1] \n\t" - "preceu.ph.qbl %[p2], %[tp1] \n\t" - "preceu.ph.qbr %[p3], %[tp2] \n\t" - "dpa.w.ph $ac3, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p2], %[vector2b] \n\t" - - /* even 2. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "mthi $0, $ac2 \n\t" - "dpa.w.ph $ac2, %[p2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p3], %[vector2b] \n\t" - "extr.w %[Temp1], $ac3, 7 \n\t" - - /* odd 1. pixel */ - "ulw %[tn1], 4(%[src_ptr]) \n\t" - "balign %[tp2], %[tp1], 3 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $0, $ac3 \n\t" - "preceu.ph.qbr %[n1], %[tp2] \n\t" - "preceu.ph.qbl %[n2], %[tp2] \n\t" - "preceu.ph.qbr %[n3], %[tn1] \n\t" - "extr.w %[Temp3], $ac2, 7 \n\t" - "dpa.w.ph $ac3, %[n1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[n2], %[vector2b] \n\t" - - /* odd 2. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "mthi $0, $ac2 \n\t" - "extr.w %[Temp2], $ac3, 7 \n\t" - "dpa.w.ph $ac2, %[n2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[n3], %[vector2b] \n\t" - "extr.w %[Temp4], $ac2, 7 \n\t" - - /* clamp and store results */ - "lbux %[tp1], %[Temp1](%[cm]) \n\t" - "lbux %[tn1], %[Temp2](%[cm]) \n\t" - "lbux %[tp2], %[Temp3](%[cm]) \n\t" - "sb %[tp1], 0(%[dst_ptr]) \n\t" - "sb %[tn1], 1(%[dst_ptr]) \n\t" - "lbux %[n2], %[Temp4](%[cm]) \n\t" - "sb %[tp2], 2(%[dst_ptr]) \n\t" - "sb %[n2], 3(%[dst_ptr]) \n\t" - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), [tp3] "=&r" (tp3), - [tn1] "=&r" (tn1), [p1] "=&r" (p1), [p2] "=&r" (p2), - [n1] "=&r" (n1), [n2] "=&r" (n2), [n3] "=&r" (n3), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [p3] "=&r" (p3), - [Temp3] "=&r" (Temp3), [Temp4] "=&r" (Temp4) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector4a] "r" (vector4a), [cm] "r" (cm), [dst_ptr] "r" (dst_ptr), - [src_ptr] "r" (src_ptr) - ); - - src_ptr += 4; - } - - /* Next row... */ - src_ptr += src_pixels_per_line - 16; - dst_ptr += pitch; - } - } - else - { - for (i = output_height; i--;) - { - /* processing 4 adjacent pixels */ - for (j = 0; j < 16; j += 4) - { - /* apply filter with vectors pairs */ - __asm__ __volatile__ ( - "ulw %[tp1], -1(%[src_ptr]) \n\t" - "ulw %[tp2], 3(%[src_ptr]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "mthi $0, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[tp1] \n\t" - "preceu.ph.qbl %[p2], %[tp1] \n\t" - "preceu.ph.qbr %[p3], %[tp2] \n\t" - "dpa.w.ph $ac3, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p2], %[vector2b] \n\t" - - /* even 2. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "mthi $0, $ac2 \n\t" - "dpa.w.ph $ac2, %[p2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p3], %[vector2b] \n\t" - "extr.w %[Temp1], $ac3, 7 \n\t" - - /* odd 1. pixel */ - "ulw %[tn1], 4(%[src_ptr]) \n\t" - "balign %[tp2], %[tp1], 3 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $0, $ac3 \n\t" - "preceu.ph.qbr %[n1], %[tp2] \n\t" - "preceu.ph.qbl %[n2], %[tp2] \n\t" - "preceu.ph.qbr %[n3], %[tn1] \n\t" - "extr.w %[Temp3], $ac2, 7 \n\t" - "dpa.w.ph $ac3, %[n1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[n2], %[vector2b] \n\t" - - /* odd 2. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "mthi $0, $ac2 \n\t" - "extr.w %[Temp2], $ac3, 7 \n\t" - "dpa.w.ph $ac2, %[n2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[n3], %[vector2b] \n\t" - "extr.w %[Temp4], $ac2, 7 \n\t" - - /* clamp and store results */ - "lbux %[tp1], %[Temp1](%[cm]) \n\t" - "lbux %[tn1], %[Temp2](%[cm]) \n\t" - "lbux %[tp2], %[Temp3](%[cm]) \n\t" - "sb %[tp1], 0(%[output_ptr]) \n\t" - "sb %[tn1], 1(%[output_ptr]) \n\t" - "lbux %[n2], %[Temp4](%[cm]) \n\t" - "sb %[tp2], 2(%[output_ptr]) \n\t" - "sb %[n2], 3(%[output_ptr]) \n\t" - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), [tn1] "=&r" (tn1), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), - [n1] "=&r" (n1), [n2] "=&r" (n2), [n3] "=&r" (n3), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=&r" (Temp4) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector4a] "r" (vector4a), [cm] "r" (cm), - [output_ptr] "r" (output_ptr), [src_ptr] "r" (src_ptr) - ); - - src_ptr += 4; - } - - /* next row... */ - src_ptr += src_pixels_per_line; - output_ptr += output_width; - } - } -} - - -void vp8_filter_block2d_second_pass4 -( - unsigned char *RESTRICT src_ptr, - unsigned char *RESTRICT output_ptr, - int output_pitch, - int yoffset -) -{ - unsigned int i; - - int Temp1, Temp2, Temp3, Temp4; - unsigned int vector1b, vector2b, vector3b, vector4a; - - unsigned char src_ptr_l2; - unsigned char src_ptr_l1; - unsigned char src_ptr_0; - unsigned char src_ptr_r1; - unsigned char src_ptr_r2; - unsigned char src_ptr_r3; - - unsigned char *cm = ff_cropTbl + CROP_WIDTH; - - vector4a = 64; - - /* load filter coefficients */ - vector1b = sub_pel_filterss[yoffset][0]; - vector2b = sub_pel_filterss[yoffset][2]; - vector3b = sub_pel_filterss[yoffset][1]; - - if (vector1b) - { - /* 6 tap filter */ - - for (i = 2; i--;) - { - /* prefetch src_ptr data to cache memory */ - prefetch_load(src_ptr); - - /* do not allow compiler to reorder instructions */ - __asm__ __volatile__ ( - ".set noreorder \n\t" - : - : - ); - - /* apply filter with vectors pairs */ - __asm__ __volatile__ ( - "lbu %[src_ptr_l2], -8(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -4(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 0(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 4(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 8(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 12(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac2 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac2, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac2, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac2, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -7(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -3(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 1(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 5(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 9(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 13(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "extp %[Temp1], $ac2, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac3, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac3, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac3, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -6(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -2(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 2(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 6(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 10(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 14(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac0 \n\t" - "extp %[Temp2], $ac3, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac0, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac0, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac0, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -5(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -1(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 3(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 7(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 11(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 15(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "extp %[Temp3], $ac0, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac1, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac1, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac1, %[src_ptr_l1], %[vector3b] \n\t" - "extp %[Temp4], $ac1, 9 \n\t" - - : [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=r" (Temp4), - [src_ptr_l1] "=&r" (src_ptr_l1), [src_ptr_0] "=&r" (src_ptr_0), - [src_ptr_r1] "=&r" (src_ptr_r1), [src_ptr_r2] "=&r" (src_ptr_r2), - [src_ptr_l2] "=&r" (src_ptr_l2), [src_ptr_r3] "=&r" (src_ptr_r3) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector3b] "r" (vector3b), [vector4a] "r" (vector4a), - [src_ptr] "r" (src_ptr) - ); - - /* clamp and store results */ - output_ptr[0] = cm[Temp1]; - output_ptr[1] = cm[Temp2]; - output_ptr[2] = cm[Temp3]; - output_ptr[3] = cm[Temp4]; - - output_ptr += output_pitch; - - /* apply filter with vectors pairs */ - __asm__ __volatile__ ( - "lbu %[src_ptr_l2], -4(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], 0(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 4(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 8(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 12(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 16(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac2, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac2, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac2, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -3(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], 1(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 5(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 9(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 13(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 17(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "extp %[Temp1], $ac2, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac3, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac3, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac3, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -2(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], 2(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 6(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 10(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 14(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 18(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac0 \n\t" - "extp %[Temp2], $ac3, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac0, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac0, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac0, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -1(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], 3(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 7(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 11(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 15(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 19(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "extp %[Temp3], $ac0, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac1, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac1, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac1, %[src_ptr_l1], %[vector3b] \n\t" - "extp %[Temp4], $ac1, 9 \n\t" - - : [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=r" (Temp4), - [src_ptr_l1] "=&r" (src_ptr_l1), [src_ptr_0] "=&r" (src_ptr_0), - [src_ptr_r1] "=&r" (src_ptr_r1), [src_ptr_r2] "=&r" (src_ptr_r2), - [src_ptr_l2] "=&r" (src_ptr_l2), [src_ptr_r3] "=&r" (src_ptr_r3) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector3b] "r" (vector3b), [vector4a] "r" (vector4a), - [src_ptr] "r" (src_ptr) - ); - - /* clamp and store results */ - output_ptr[0] = cm[Temp1]; - output_ptr[1] = cm[Temp2]; - output_ptr[2] = cm[Temp3]; - output_ptr[3] = cm[Temp4]; - - src_ptr += 8; - output_ptr += output_pitch; - } - } - else - { - /* 4 tap filter */ - - /* prefetch src_ptr data to cache memory */ - prefetch_load(src_ptr); - - for (i = 2; i--;) - { - /* do not allow compiler to reorder instructions */ - __asm__ __volatile__ ( - ".set noreorder \n\t" - : - : - ); - - /* apply filter with vectors pairs */ - __asm__ __volatile__ ( - "lbu %[src_ptr_l1], -4(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 0(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 4(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 8(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac2, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac2, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l1], -3(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 1(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 5(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 9(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "extp %[Temp1], $ac2, 9 \n\t" - - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac3, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac3, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l1], -2(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 2(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 6(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 10(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac0 \n\t" - "extp %[Temp2], $ac3, 9 \n\t" - - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac0, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac0, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l1], -1(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 3(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 7(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 11(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "extp %[Temp3], $ac0, 9 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac1, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac1, %[src_ptr_l1], %[vector3b] \n\t" - "extp %[Temp4], $ac1, 9 \n\t" - - : [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=r" (Temp4), - [src_ptr_l1] "=&r" (src_ptr_l1), [src_ptr_0] "=&r" (src_ptr_0), - [src_ptr_r1] "=&r" (src_ptr_r1), [src_ptr_r2] "=&r" (src_ptr_r2) - : [vector2b] "r" (vector2b), [vector3b] "r" (vector3b), - [vector4a] "r" (vector4a), [src_ptr] "r" (src_ptr) - ); - - /* clamp and store results */ - output_ptr[0] = cm[Temp1]; - output_ptr[1] = cm[Temp2]; - output_ptr[2] = cm[Temp3]; - output_ptr[3] = cm[Temp4]; - - output_ptr += output_pitch; - - /* apply filter with vectors pairs */ - __asm__ __volatile__ ( - "lbu %[src_ptr_l1], 0(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 4(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 8(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 12(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac2, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac2, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l1], 1(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 5(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 9(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 13(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "extp %[Temp1], $ac2, 9 \n\t" - - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac3, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac3, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l1], 2(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 6(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 10(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 14(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac0 \n\t" - "extp %[Temp2], $ac3, 9 \n\t" - - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac0, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac0, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l1], 3(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 7(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 11(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 15(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "extp %[Temp3], $ac0, 9 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac1, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac1, %[src_ptr_l1], %[vector3b] \n\t" - "extp %[Temp4], $ac1, 9 \n\t" - - : [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=r" (Temp4), - [src_ptr_l1] "=&r" (src_ptr_l1), [src_ptr_0] "=&r" (src_ptr_0), - [src_ptr_r1] "=&r" (src_ptr_r1), [src_ptr_r2] "=&r" (src_ptr_r2) - : [vector2b] "r" (vector2b), [vector3b] "r" (vector3b), - [vector4a] "r" (vector4a), [src_ptr] "r" (src_ptr) - ); - - /* clamp and store results */ - output_ptr[0] = cm[Temp1]; - output_ptr[1] = cm[Temp2]; - output_ptr[2] = cm[Temp3]; - output_ptr[3] = cm[Temp4]; - - src_ptr += 8; - output_ptr += output_pitch; - } - } -} - - -void vp8_filter_block2d_second_pass_8 -( - unsigned char *RESTRICT src_ptr, - unsigned char *RESTRICT output_ptr, - int output_pitch, - unsigned int output_height, - unsigned int output_width, - unsigned int yoffset -) -{ - unsigned int i; - - int Temp1, Temp2, Temp3, Temp4, Temp5, Temp6, Temp7, Temp8; - unsigned int vector1b, vector2b, vector3b, vector4a; - - unsigned char src_ptr_l2; - unsigned char src_ptr_l1; - unsigned char src_ptr_0; - unsigned char src_ptr_r1; - unsigned char src_ptr_r2; - unsigned char src_ptr_r3; - unsigned char *cm = ff_cropTbl + CROP_WIDTH; - - vector4a = 64; - - vector1b = sub_pel_filterss[yoffset][0]; - vector2b = sub_pel_filterss[yoffset][2]; - vector3b = sub_pel_filterss[yoffset][1]; - - if (vector1b) - { - /* 6 tap filter */ - - /* prefetch src_ptr data to cache memory */ - prefetch_load(src_ptr); - - for (i = output_height; i--;) - { - /* apply filter with vectors pairs */ - __asm__ __volatile__ ( - "lbu %[src_ptr_l2], -16(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -8(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 0(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 8(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 16(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 24(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac2 \n\t" - - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "dpau.h.qbr $ac2, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac2, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac2, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -15(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -7(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 1(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 9(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 17(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 25(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "extp %[Temp1], $ac2, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac3, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac3, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac3, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -14(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -6(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 2(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 10(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 18(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 26(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac0 \n\t" - "extp %[Temp2], $ac3, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac0, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac0, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac0, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -13(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -5(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 3(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 11(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 19(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 27(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "extp %[Temp3], $ac0, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac1, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac1, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac1, %[src_ptr_l1], %[vector3b] \n\t" - - : [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3), - [src_ptr_l1] "=&r" (src_ptr_l1), [src_ptr_0] "=&r" (src_ptr_0), - [src_ptr_r1] "=&r" (src_ptr_r1), [src_ptr_r2] "=&r" (src_ptr_r2), - [src_ptr_l2] "=&r" (src_ptr_l2), [src_ptr_r3] "=&r" (src_ptr_r3) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector3b] "r" (vector3b), [vector4a] "r" (vector4a), - [src_ptr] "r" (src_ptr) - ); - - /* apply filter with vectors pairs */ - __asm__ __volatile__ ( - "lbu %[src_ptr_l2], -12(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -4(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 4(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 12(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 20(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 28(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac2 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac2, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac2, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac2, %[src_ptr_l1], %[vector3b] \n\t" - "extp %[Temp4], $ac1, 9 \n\t" - - "lbu %[src_ptr_l2], -11(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -3(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 5(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 13(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 21(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 29(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "extp %[Temp5], $ac2, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac3, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac3, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac3, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -10(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -2(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 6(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 14(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 22(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 30(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac0 \n\t" - "extp %[Temp6], $ac3, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac0, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac0, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac0, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -9(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -1(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 7(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 15(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 23(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 31(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "extp %[Temp7], $ac0, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac1, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac1, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac1, %[src_ptr_l1], %[vector3b] \n\t" - "extp %[Temp8], $ac1, 9 \n\t" - - : [Temp4] "=&r" (Temp4), [Temp5] "=&r" (Temp5), - [Temp6] "=&r" (Temp6), [Temp7] "=&r" (Temp7), [Temp8] "=r" (Temp8), - [src_ptr_l1] "=&r" (src_ptr_l1), [src_ptr_0] "=&r" (src_ptr_0), - [src_ptr_r1] "=&r" (src_ptr_r1), [src_ptr_r2] "=&r" (src_ptr_r2), - [src_ptr_l2] "=&r" (src_ptr_l2),[src_ptr_r3] "=&r" (src_ptr_r3) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector3b] "r" (vector3b), [vector4a] "r" (vector4a), - [src_ptr] "r" (src_ptr) - ); - - /* clamp and store results */ - output_ptr[0] = cm[Temp1]; - output_ptr[1] = cm[Temp2]; - output_ptr[2] = cm[Temp3]; - output_ptr[3] = cm[Temp4]; - output_ptr[4] = cm[Temp5]; - output_ptr[5] = cm[Temp6]; - output_ptr[6] = cm[Temp7]; - output_ptr[7] = cm[Temp8]; - - src_ptr += 8; - output_ptr += output_pitch; - } - } - else - { - /* 4 tap filter */ - - /* prefetch src_ptr data to cache memory */ - prefetch_load(src_ptr); - - for (i = output_height; i--;) - { - __asm__ __volatile__ ( - "lbu %[src_ptr_l1], -8(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 0(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 8(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 16(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac2, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac2, %[src_ptr_l1], %[vector3b] \n\t" - - : [src_ptr_l1] "=&r" (src_ptr_l1), [src_ptr_0] "=&r" (src_ptr_0), - [src_ptr_r1] "=&r" (src_ptr_r1), [src_ptr_r2] "=&r" (src_ptr_r2) - : [vector2b] "r" (vector2b), [vector3b] "r" (vector3b), - [vector4a] "r" (vector4a), [src_ptr] "r" (src_ptr) - ); - - __asm__ __volatile__ ( - "lbu %[src_ptr_l1], -7(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 1(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 9(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 17(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac3, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac3, %[src_ptr_l1], %[vector3b] \n\t" - "extp %[Temp1], $ac2, 9 \n\t" - - : [Temp1] "=r" (Temp1), - [src_ptr_l1] "=&r" (src_ptr_l1), [src_ptr_0] "=&r" (src_ptr_0), - [src_ptr_r1] "=&r" (src_ptr_r1), [src_ptr_r2] "=&r" (src_ptr_r2) - : [vector2b] "r" (vector2b), [vector3b] "r" (vector3b), - [vector4a] "r" (vector4a), [src_ptr] "r" (src_ptr) - ); - - src_ptr_l1 = src_ptr[-6]; - src_ptr_0 = src_ptr[2]; - src_ptr_r1 = src_ptr[10]; - src_ptr_r2 = src_ptr[18]; - - __asm__ __volatile__ ( - "mtlo %[vector4a], $ac0 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac0, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac0, %[src_ptr_l1], %[vector3b] \n\t" - "extp %[Temp2], $ac3, 9 \n\t" - - : [Temp2] "=r" (Temp2) - : [vector2b] "r" (vector2b), [vector3b] "r" (vector3b), - [src_ptr_l1] "r" (src_ptr_l1), [src_ptr_0] "r" (src_ptr_0), - [src_ptr_r1] "r" (src_ptr_r1), [src_ptr_r2] "r" (src_ptr_r2), - [vector4a] "r" (vector4a) - ); - - src_ptr_l1 = src_ptr[-5]; - src_ptr_0 = src_ptr[3]; - src_ptr_r1 = src_ptr[11]; - src_ptr_r2 = src_ptr[19]; - - __asm__ __volatile__ ( - "mtlo %[vector4a], $ac1 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac1, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac1, %[src_ptr_l1], %[vector3b] \n\t" - "extp %[Temp3], $ac0, 9 \n\t" - - : [Temp3] "=r" (Temp3) - : [vector2b] "r" (vector2b), [vector3b] "r" (vector3b), - [src_ptr_l1] "r" (src_ptr_l1), [src_ptr_0] "r" (src_ptr_0), - [src_ptr_r1] "r" (src_ptr_r1), [src_ptr_r2] "r" (src_ptr_r2), - [vector4a] "r" (vector4a) - ); - - src_ptr_l1 = src_ptr[-4]; - src_ptr_0 = src_ptr[4]; - src_ptr_r1 = src_ptr[12]; - src_ptr_r2 = src_ptr[20]; - - __asm__ __volatile__ ( - "mtlo %[vector4a], $ac2 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac2, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac2, %[src_ptr_l1], %[vector3b] \n\t" - "extp %[Temp4], $ac1, 9 \n\t" - - : [Temp4] "=r" (Temp4) - : [vector2b] "r" (vector2b), [vector3b] "r" (vector3b), - [src_ptr_l1] "r" (src_ptr_l1), [src_ptr_0] "r" (src_ptr_0), - [src_ptr_r1] "r" (src_ptr_r1), [src_ptr_r2] "r" (src_ptr_r2), - [vector4a] "r" (vector4a) - ); - - src_ptr_l1 = src_ptr[-3]; - src_ptr_0 = src_ptr[5]; - src_ptr_r1 = src_ptr[13]; - src_ptr_r2 = src_ptr[21]; - - __asm__ __volatile__ ( - "mtlo %[vector4a], $ac3 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac3, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac3, %[src_ptr_l1], %[vector3b] \n\t" - "extp %[Temp5], $ac2, 9 \n\t" - - : [Temp5] "=&r" (Temp5) - : [vector2b] "r" (vector2b), [vector3b] "r" (vector3b), - [src_ptr_l1] "r" (src_ptr_l1), [src_ptr_0] "r" (src_ptr_0), - [src_ptr_r1] "r" (src_ptr_r1), [src_ptr_r2] "r" (src_ptr_r2), - [vector4a] "r" (vector4a) - ); - - src_ptr_l1 = src_ptr[-2]; - src_ptr_0 = src_ptr[6]; - src_ptr_r1 = src_ptr[14]; - src_ptr_r2 = src_ptr[22]; - - __asm__ __volatile__ ( - "mtlo %[vector4a], $ac0 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac0, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac0, %[src_ptr_l1], %[vector3b] \n\t" - "extp %[Temp6], $ac3, 9 \n\t" - - : [Temp6] "=r" (Temp6) - : [vector2b] "r" (vector2b), [vector3b] "r" (vector3b), - [src_ptr_l1] "r" (src_ptr_l1), [src_ptr_0] "r" (src_ptr_0), - [src_ptr_r1] "r" (src_ptr_r1), [src_ptr_r2] "r" (src_ptr_r2), - [vector4a] "r" (vector4a) - ); - - src_ptr_l1 = src_ptr[-1]; - src_ptr_0 = src_ptr[7]; - src_ptr_r1 = src_ptr[15]; - src_ptr_r2 = src_ptr[23]; - - __asm__ __volatile__ ( - "mtlo %[vector4a], $ac1 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac1, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac1, %[src_ptr_l1], %[vector3b] \n\t" - "extp %[Temp7], $ac0, 9 \n\t" - "extp %[Temp8], $ac1, 9 \n\t" - - : [Temp7] "=&r" (Temp7), [Temp8] "=r" (Temp8) - : [vector2b] "r" (vector2b), [vector3b] "r" (vector3b), - [src_ptr_l1] "r" (src_ptr_l1), [src_ptr_0] "r" (src_ptr_0), - [src_ptr_r1] "r" (src_ptr_r1), [src_ptr_r2] "r" (src_ptr_r2), - [vector4a] "r" (vector4a) - ); - - /* clamp and store results */ - output_ptr[0] = cm[Temp1]; - output_ptr[1] = cm[Temp2]; - output_ptr[2] = cm[Temp3]; - output_ptr[3] = cm[Temp4]; - output_ptr[4] = cm[Temp5]; - output_ptr[5] = cm[Temp6]; - output_ptr[6] = cm[Temp7]; - output_ptr[7] = cm[Temp8]; - - src_ptr += 8; - output_ptr += output_pitch; - } - } -} - - -void vp8_filter_block2d_second_pass161 -( - unsigned char *RESTRICT src_ptr, - unsigned char *RESTRICT output_ptr, - int output_pitch, - const unsigned short *vp8_filter -) -{ - unsigned int i, j; - - int Temp1, Temp2, Temp3, Temp4, Temp5, Temp6, Temp7, Temp8; - unsigned int vector4a; - unsigned int vector1b, vector2b, vector3b; - - unsigned char src_ptr_l2; - unsigned char src_ptr_l1; - unsigned char src_ptr_0; - unsigned char src_ptr_r1; - unsigned char src_ptr_r2; - unsigned char src_ptr_r3; - unsigned char *cm = ff_cropTbl + CROP_WIDTH; - - vector4a = 64; - - vector1b = vp8_filter[0]; - vector2b = vp8_filter[2]; - vector3b = vp8_filter[1]; - - if (vector1b == 0) - { - /* 4 tap filter */ - - /* prefetch src_ptr data to cache memory */ - prefetch_load(src_ptr + 16); - - for (i = 16; i--;) - { - /* unrolling for loop */ - for (j = 0; j < 16; j += 8) - { - /* apply filter with vectors pairs */ - __asm__ __volatile__ ( - "lbu %[src_ptr_l1], -16(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 0(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 16(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 32(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac2, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac2, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l1], -15(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 1(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 17(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 33(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "extp %[Temp1], $ac2, 9 \n\t" - - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac3, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac3, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l1], -14(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 2(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 18(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 34(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "extp %[Temp2], $ac3, 9 \n\t" - - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac1, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac1, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l1], -13(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 3(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 19(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 35(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "extp %[Temp3], $ac1, 9 \n\t" - - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac3, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac3, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l1], -12(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 4(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 20(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 36(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "extp %[Temp4], $ac3, 9 \n\t" - - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac2, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac2, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l1], -11(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 5(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 21(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 37(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "extp %[Temp5], $ac2, 9 \n\t" - - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac3, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac3, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l1], -10(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 6(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 22(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 38(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "extp %[Temp6], $ac3, 9 \n\t" - - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac1, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac1, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l1], -9(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 7(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 23(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 39(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "extp %[Temp7], $ac1, 9 \n\t" - - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac3, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac3, %[src_ptr_l1], %[vector3b] \n\t" - "extp %[Temp8], $ac3, 9 \n\t" - - : [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=&r" (Temp4), - [Temp5] "=&r" (Temp5), [Temp6] "=&r" (Temp6), - [Temp7] "=&r" (Temp7), [Temp8] "=r" (Temp8), - [src_ptr_l1] "=&r" (src_ptr_l1), [src_ptr_0] "=&r" (src_ptr_0), - [src_ptr_r1] "=&r" (src_ptr_r1), [src_ptr_r2] "=&r" (src_ptr_r2) - : [vector2b] "r" (vector2b), [vector3b] "r" (vector3b), - [vector4a] "r" (vector4a), [src_ptr] "r" (src_ptr) - ); - - /* clamp and store results */ - output_ptr[j] = cm[Temp1]; - output_ptr[j + 1] = cm[Temp2]; - output_ptr[j + 2] = cm[Temp3]; - output_ptr[j + 3] = cm[Temp4]; - output_ptr[j + 4] = cm[Temp5]; - output_ptr[j + 5] = cm[Temp6]; - output_ptr[j + 6] = cm[Temp7]; - output_ptr[j + 7] = cm[Temp8]; - - src_ptr += 8; - } - - output_ptr += output_pitch; - } - } - else - { - /* 4 tap filter */ - - /* prefetch src_ptr data to cache memory */ - prefetch_load(src_ptr + 16); - - /* unroll for loop */ - for (i = 16; i--;) - { - /* apply filter with vectors pairs */ - __asm__ __volatile__ ( - "lbu %[src_ptr_l2], -32(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -16(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 0(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 16(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 32(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 48(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac2 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac2, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac2, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac2, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -31(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -15(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 1(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 17(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 33(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 49(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac0 \n\t" - "extp %[Temp1], $ac2, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac0, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac0, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac0, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -30(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -14(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 2(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 18(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 34(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 50(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "extp %[Temp2], $ac0, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac1, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac1, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac1, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -29(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -13(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 3(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 19(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 35(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 51(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "extp %[Temp3], $ac1, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac3, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac3, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac3, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -28(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -12(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 4(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 20(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 36(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 52(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "extp %[Temp4], $ac3, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac2, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac2, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac2, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -27(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -11(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 5(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 21(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 37(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 53(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac0 \n\t" - "extp %[Temp5], $ac2, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac0, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac0, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac0, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -26(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -10(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 6(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 22(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 38(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 54(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "extp %[Temp6], $ac0, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac1, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac1, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac1, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -25(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -9(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 7(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 23(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 39(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 55(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "extp %[Temp7], $ac1, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac3, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac3, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac3, %[src_ptr_l1], %[vector3b] \n\t" - "extp %[Temp8], $ac3, 9 \n\t" - - : [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=&r" (Temp4), - [Temp5] "=&r" (Temp5), [Temp6] "=&r" (Temp6), - [Temp7] "=&r" (Temp7), [Temp8] "=r" (Temp8), - [src_ptr_l1] "=&r" (src_ptr_l1), [src_ptr_0] "=&r" (src_ptr_0), - [src_ptr_r1] "=&r" (src_ptr_r1), [src_ptr_r2] "=&r" (src_ptr_r2), - [src_ptr_l2] "=&r" (src_ptr_l2),[src_ptr_r3] "=&r" (src_ptr_r3) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector3b] "r" (vector3b), [vector4a] "r" (vector4a), - [src_ptr] "r" (src_ptr) - ); - - /* clamp and store results */ - output_ptr[0] = cm[Temp1]; - output_ptr[1] = cm[Temp2]; - output_ptr[2] = cm[Temp3]; - output_ptr[3] = cm[Temp4]; - output_ptr[4] = cm[Temp5]; - output_ptr[5] = cm[Temp6]; - output_ptr[6] = cm[Temp7]; - output_ptr[7] = cm[Temp8]; - - /* apply filter with vectors pairs */ - __asm__ __volatile__ ( - "lbu %[src_ptr_l2], -24(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -8(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 8(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 24(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 40(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 56(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac2 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac2, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac2, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac2, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -23(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -7(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 9(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 25(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 41(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 57(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac0 \n\t" - "extp %[Temp1], $ac2, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac0, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac0, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac0, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -22(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -6(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 10(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 26(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 42(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 58(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "extp %[Temp2], $ac0, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac1, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac1, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac1, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -21(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -5(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 11(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 27(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 43(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 59(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "extp %[Temp3], $ac1, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac3, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac3, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac3, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -20(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -4(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 12(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 28(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 44(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 60(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "extp %[Temp4], $ac3, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac2, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac2, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac2, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -19(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -3(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 13(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 29(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 45(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 61(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac0 \n\t" - "extp %[Temp5], $ac2, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac0, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac0, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac0, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -18(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -2(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 14(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 30(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 46(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 62(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "extp %[Temp6], $ac0, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac1, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac1, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac1, %[src_ptr_l1], %[vector3b] \n\t" - - "lbu %[src_ptr_l2], -17(%[src_ptr]) \n\t" - "lbu %[src_ptr_l1], -1(%[src_ptr]) \n\t" - "lbu %[src_ptr_0], 15(%[src_ptr]) \n\t" - "lbu %[src_ptr_r1], 31(%[src_ptr]) \n\t" - "lbu %[src_ptr_r2], 47(%[src_ptr]) \n\t" - "lbu %[src_ptr_r3], 63(%[src_ptr]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "extp %[Temp7], $ac1, 9 \n\t" - - "append %[src_ptr_l2], %[src_ptr_r3], 8 \n\t" - "append %[src_ptr_0], %[src_ptr_r1], 8 \n\t" - "append %[src_ptr_l1], %[src_ptr_r2], 8 \n\t" - "dpau.h.qbr $ac3, %[src_ptr_l2], %[vector1b] \n\t" - "dpau.h.qbr $ac3, %[src_ptr_0], %[vector2b] \n\t" - "dpsu.h.qbr $ac3, %[src_ptr_l1], %[vector3b] \n\t" - "extp %[Temp8], $ac3, 9 \n\t" - - : [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=&r" (Temp4), - [Temp5] "=&r" (Temp5), [Temp6] "=&r" (Temp6), - [Temp7] "=&r" (Temp7), [Temp8] "=r" (Temp8), - [src_ptr_l1] "=&r" (src_ptr_l1), [src_ptr_0] "=&r" (src_ptr_0), - [src_ptr_r1] "=&r" (src_ptr_r1), [src_ptr_r2] "=&r" (src_ptr_r2), - [src_ptr_l2] "=&r" (src_ptr_l2), [src_ptr_r3] "=&r" (src_ptr_r3) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector3b] "r" (vector3b), [vector4a] "r" (vector4a), - [src_ptr] "r" (src_ptr) - ); - - src_ptr += 16; - output_ptr[8] = cm[Temp1]; - output_ptr[9] = cm[Temp2]; - output_ptr[10] = cm[Temp3]; - output_ptr[11] = cm[Temp4]; - output_ptr[12] = cm[Temp5]; - output_ptr[13] = cm[Temp6]; - output_ptr[14] = cm[Temp7]; - output_ptr[15] = cm[Temp8]; - - output_ptr += output_pitch; - } - } -} - - -void vp8_sixtap_predict4x4_dspr2 -( - unsigned char *RESTRICT src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *RESTRICT dst_ptr, - int dst_pitch -) -{ - unsigned char FData[9 * 4]; /* Temp data bufffer used in filtering */ - unsigned int pos = 16; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - if (yoffset) - { - /* First filter 1-D horizontally... */ - vp8_filter_block2d_first_pass_4(src_ptr - (2 * src_pixels_per_line), FData, - src_pixels_per_line, 9, xoffset, 4); - /* then filter verticaly... */ - vp8_filter_block2d_second_pass4(FData + 8, dst_ptr, dst_pitch, yoffset); - } - else - /* if (yoffsset == 0) vp8_filter_block2d_first_pass save data to dst_ptr */ - vp8_filter_block2d_first_pass_4(src_ptr, dst_ptr, src_pixels_per_line, - 4, xoffset, dst_pitch); -} - - -void vp8_sixtap_predict8x8_dspr2 -( - unsigned char *RESTRICT src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *RESTRICT dst_ptr, - int dst_pitch -) -{ - - unsigned char FData[13 * 8]; /* Temp data bufffer used in filtering */ - unsigned int pos, Temp1, Temp2; - - pos = 16; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - if (yoffset) - { - - src_ptr = src_ptr - (2 * src_pixels_per_line); - - if (xoffset) - /* filter 1-D horizontally... */ - vp8_filter_block2d_first_pass_8_all(src_ptr, FData, src_pixels_per_line, - 13, xoffset, 8); - - else - { - /* prefetch src_ptr data to cache memory */ - prefetch_load(src_ptr + 2 * src_pixels_per_line); - - __asm__ __volatile__ ( - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 0(%[FData]) \n\t" - "sw %[Temp2], 4(%[FData]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 8(%[FData]) \n\t" - "sw %[Temp2], 12(%[FData]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 16(%[FData]) \n\t" - "sw %[Temp2], 20(%[FData]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 24(%[FData]) \n\t" - "sw %[Temp2], 28(%[FData]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 32(%[FData]) \n\t" - "sw %[Temp2], 36(%[FData]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 40(%[FData]) \n\t" - "sw %[Temp2], 44(%[FData]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 48(%[FData]) \n\t" - "sw %[Temp2], 52(%[FData]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 56(%[FData]) \n\t" - "sw %[Temp2], 60(%[FData]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 64(%[FData]) \n\t" - "sw %[Temp2], 68(%[FData]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 72(%[FData]) \n\t" - "sw %[Temp2], 76(%[FData]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 80(%[FData]) \n\t" - "sw %[Temp2], 84(%[FData]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 88(%[FData]) \n\t" - "sw %[Temp2], 92(%[FData]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 96(%[FData]) \n\t" - "sw %[Temp2], 100(%[FData]) \n\t" - - : [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2) - : [FData] "r" (FData), [src_ptr] "r" (src_ptr), - [src_pixels_per_line] "r" (src_pixels_per_line) - ); - } - - /* filter verticaly... */ - vp8_filter_block2d_second_pass_8(FData + 16, dst_ptr, dst_pitch, 8, 8, yoffset); - } - - /* if (yoffsset == 0) vp8_filter_block2d_first_pass save data to dst_ptr */ - else - { - if (xoffset) - vp8_filter_block2d_first_pass_8_all(src_ptr, dst_ptr, src_pixels_per_line, - 8, xoffset, dst_pitch); - - else - { - /* copy from src buffer to dst buffer */ - __asm__ __volatile__ ( - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 0(%[dst_ptr]) \n\t" - "sw %[Temp2], 4(%[dst_ptr]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 8(%[dst_ptr]) \n\t" - "sw %[Temp2], 12(%[dst_ptr]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 16(%[dst_ptr]) \n\t" - "sw %[Temp2], 20(%[dst_ptr]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 24(%[dst_ptr]) \n\t" - "sw %[Temp2], 28(%[dst_ptr]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 32(%[dst_ptr]) \n\t" - "sw %[Temp2], 36(%[dst_ptr]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 40(%[dst_ptr]) \n\t" - "sw %[Temp2], 44(%[dst_ptr]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 48(%[dst_ptr]) \n\t" - "sw %[Temp2], 52(%[dst_ptr]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 56(%[dst_ptr]) \n\t" - "sw %[Temp2], 60(%[dst_ptr]) \n\t" - - : [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2) - : [dst_ptr] "r" (dst_ptr), [src_ptr] "r" (src_ptr), - [src_pixels_per_line] "r" (src_pixels_per_line) - ); - } - } -} - - -void vp8_sixtap_predict8x4_dspr2 -( - unsigned char *RESTRICT src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *RESTRICT dst_ptr, - int dst_pitch -) -{ - unsigned char FData[9 * 8]; /* Temp data bufffer used in filtering */ - unsigned int pos, Temp1, Temp2; - - pos = 16; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - if (yoffset) - { - - src_ptr = src_ptr - (2 * src_pixels_per_line); - - if (xoffset) - /* filter 1-D horizontally... */ - vp8_filter_block2d_first_pass_8_all(src_ptr, FData, src_pixels_per_line, - 9, xoffset, 8); - - else - { - /* prefetch src_ptr data to cache memory */ - prefetch_load(src_ptr + 2 * src_pixels_per_line); - - __asm__ __volatile__ ( - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 0(%[FData]) \n\t" - "sw %[Temp2], 4(%[FData]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 8(%[FData]) \n\t" - "sw %[Temp2], 12(%[FData]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 16(%[FData]) \n\t" - "sw %[Temp2], 20(%[FData]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 24(%[FData]) \n\t" - "sw %[Temp2], 28(%[FData]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 32(%[FData]) \n\t" - "sw %[Temp2], 36(%[FData]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 40(%[FData]) \n\t" - "sw %[Temp2], 44(%[FData]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 48(%[FData]) \n\t" - "sw %[Temp2], 52(%[FData]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 56(%[FData]) \n\t" - "sw %[Temp2], 60(%[FData]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 64(%[FData]) \n\t" - "sw %[Temp2], 68(%[FData]) \n\t" - - : [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2) - : [FData] "r" (FData), [src_ptr] "r" (src_ptr), - [src_pixels_per_line] "r" (src_pixels_per_line) - ); - } - - /* filter verticaly... */ - vp8_filter_block2d_second_pass_8(FData + 16, dst_ptr, dst_pitch, 4, 8, yoffset); - } - - /* if (yoffsset == 0) vp8_filter_block2d_first_pass save data to dst_ptr */ - else - { - if (xoffset) - vp8_filter_block2d_first_pass_8_all(src_ptr, dst_ptr, src_pixels_per_line, - 4, xoffset, dst_pitch); - - else - { - /* copy from src buffer to dst buffer */ - __asm__ __volatile__ ( - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 0(%[dst_ptr]) \n\t" - "sw %[Temp2], 4(%[dst_ptr]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 8(%[dst_ptr]) \n\t" - "sw %[Temp2], 12(%[dst_ptr]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 16(%[dst_ptr]) \n\t" - "sw %[Temp2], 20(%[dst_ptr]) \n\t" - "addu %[src_ptr], %[src_ptr], %[src_pixels_per_line] \n\t" - - "ulw %[Temp1], 0(%[src_ptr]) \n\t" - "ulw %[Temp2], 4(%[src_ptr]) \n\t" - "sw %[Temp1], 24(%[dst_ptr]) \n\t" - "sw %[Temp2], 28(%[dst_ptr]) \n\t" - - : [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2) - : [dst_ptr] "r" (dst_ptr), [src_ptr] "r" (src_ptr), - [src_pixels_per_line] "r" (src_pixels_per_line) - ); - } - } -} - - -void vp8_sixtap_predict16x16_dspr2 -( - unsigned char *RESTRICT src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *RESTRICT dst_ptr, - int dst_pitch -) -{ - const unsigned short *VFilter; - unsigned char FData[21 * 16]; /* Temp data bufffer used in filtering */ - unsigned int pos; - - VFilter = sub_pel_filterss[yoffset]; - - pos = 16; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - if (yoffset) - { - - src_ptr = src_ptr - (2 * src_pixels_per_line); - - switch (xoffset) - { - /* filter 1-D horizontally... */ - case 2: - case 4: - case 6: - /* 6 tap filter */ - vp8_filter_block2d_first_pass16_6tap(src_ptr, FData, src_pixels_per_line, - 21, xoffset, 16); - break; - - case 0: - /* only copy buffer */ - vp8_filter_block2d_first_pass16_0(src_ptr, FData, src_pixels_per_line); - break; - - case 1: - case 3: - case 5: - case 7: - /* 4 tap filter */ - vp8_filter_block2d_first_pass16_4tap(src_ptr, FData, src_pixels_per_line, 16, - 21, xoffset, yoffset, dst_ptr, dst_pitch); - break; - } - - /* filter verticaly... */ - vp8_filter_block2d_second_pass161(FData + 32, dst_ptr, dst_pitch, VFilter); - } - else - { - /* if (yoffsset == 0) vp8_filter_block2d_first_pass save data to dst_ptr */ - switch (xoffset) - { - case 2: - case 4: - case 6: - /* 6 tap filter */ - vp8_filter_block2d_first_pass16_6tap(src_ptr, dst_ptr, src_pixels_per_line, - 16, xoffset, dst_pitch); - break; - - case 1: - case 3: - case 5: - case 7: - /* 4 tap filter */ - vp8_filter_block2d_first_pass16_4tap(src_ptr, dst_ptr, src_pixels_per_line, 16, - 21, xoffset, yoffset, dst_ptr, dst_pitch); - break; - } - } -} - -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/mips/dspr2/idct_blk_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/mips/dspr2/idct_blk_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/mips/dspr2/idct_blk_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/mips/dspr2/idct_blk_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vpx_config.h" -#include "vp8_rtcd.h" - -#if HAVE_DSPR2 - -void vp8_dequant_idct_add_y_block_dspr2 -(short *q, short *dq, - unsigned char *dst, int stride, char *eobs) -{ - int i, j; - - for (i = 0; i < 4; i++) - { - for (j = 0; j < 4; j++) - { - if (*eobs++ > 1) - vp8_dequant_idct_add_dspr2(q, dq, dst, stride); - else - { - vp8_dc_only_idct_add_dspr2(q[0]*dq[0], dst, stride, dst, stride); - ((int *)q)[0] = 0; - } - - q += 16; - dst += 4; - } - - dst += 4 * stride - 16; - } -} - -void vp8_dequant_idct_add_uv_block_dspr2 -(short *q, short *dq, - unsigned char *dstu, unsigned char *dstv, int stride, char *eobs) -{ - int i, j; - - for (i = 0; i < 2; i++) - { - for (j = 0; j < 2; j++) - { - if (*eobs++ > 1) - vp8_dequant_idct_add_dspr2(q, dq, dstu, stride); - else - { - vp8_dc_only_idct_add_dspr2(q[0]*dq[0], dstu, stride, dstu, stride); - ((int *)q)[0] = 0; - } - - q += 16; - dstu += 4; - } - - dstu += 4 * stride - 8; - } - - for (i = 0; i < 2; i++) - { - for (j = 0; j < 2; j++) - { - if (*eobs++ > 1) - vp8_dequant_idct_add_dspr2(q, dq, dstv, stride); - else - { - vp8_dc_only_idct_add_dspr2(q[0]*dq[0], dstv, stride, dstv, stride); - ((int *)q)[0] = 0; - } - - q += 16; - dstv += 4; - } - - dstv += 4 * stride - 8; - } -} - -#endif - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/mips/dspr2/idctllm_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/mips/dspr2/idctllm_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/mips/dspr2/idctllm_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/mips/dspr2/idctllm_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,369 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vp8_rtcd.h" - -#if HAVE_DSPR2 -#define CROP_WIDTH 256 - -/****************************************************************************** - * Notes: - * - * This implementation makes use of 16 bit fixed point version of two multiply - * constants: - * 1. sqrt(2) * cos (pi/8) - * 2. sqrt(2) * sin (pi/8) - * Since the first constant is bigger than 1, to maintain the same 16 bit - * fixed point precision as the second one, we use a trick of - * x * a = x + x*(a-1) - * so - * x * sqrt(2) * cos (pi/8) = x + x * (sqrt(2) *cos(pi/8)-1). - ****************************************************************************/ -extern unsigned char ff_cropTbl[256 + 2 * CROP_WIDTH]; -static const int cospi8sqrt2minus1 = 20091; -static const int sinpi8sqrt2 = 35468; - -inline void prefetch_load_short(short *src) -{ - __asm__ __volatile__ ( - "pref 0, 0(%[src]) \n\t" - : - : [src] "r" (src) - ); -} - -void vp8_short_idct4x4llm_dspr2(short *input, unsigned char *pred_ptr, - int pred_stride, unsigned char *dst_ptr, - int dst_stride) -{ - int r, c; - int a1, b1, c1, d1; - short output[16]; - short *ip = input; - short *op = output; - int temp1, temp2; - int shortpitch = 4; - - int c2, d2; - int temp3, temp4; - unsigned char *cm = ff_cropTbl + CROP_WIDTH; - - /* prepare data for load */ - prefetch_load_short(ip + 8); - - /* first loop is unrolled */ - a1 = ip[0] + ip[8]; - b1 = ip[0] - ip[8]; - - temp1 = (ip[4] * sinpi8sqrt2) >> 16; - temp2 = ip[12] + ((ip[12] * cospi8sqrt2minus1) >> 16); - c1 = temp1 - temp2; - - temp1 = ip[4] + ((ip[4] * cospi8sqrt2minus1) >> 16); - temp2 = (ip[12] * sinpi8sqrt2) >> 16; - d1 = temp1 + temp2; - - temp3 = (ip[5] * sinpi8sqrt2) >> 16; - temp4 = ip[13] + ((ip[13] * cospi8sqrt2minus1) >> 16); - c2 = temp3 - temp4; - - temp3 = ip[5] + ((ip[5] * cospi8sqrt2minus1) >> 16); - temp4 = (ip[13] * sinpi8sqrt2) >> 16; - d2 = temp3 + temp4; - - op[0] = a1 + d1; - op[12] = a1 - d1; - op[4] = b1 + c1; - op[8] = b1 - c1; - - a1 = ip[1] + ip[9]; - b1 = ip[1] - ip[9]; - - op[1] = a1 + d2; - op[13] = a1 - d2; - op[5] = b1 + c2; - op[9] = b1 - c2; - - a1 = ip[2] + ip[10]; - b1 = ip[2] - ip[10]; - - temp1 = (ip[6] * sinpi8sqrt2) >> 16; - temp2 = ip[14] + ((ip[14] * cospi8sqrt2minus1) >> 16); - c1 = temp1 - temp2; - - temp1 = ip[6] + ((ip[6] * cospi8sqrt2minus1) >> 16); - temp2 = (ip[14] * sinpi8sqrt2) >> 16; - d1 = temp1 + temp2; - - temp3 = (ip[7] * sinpi8sqrt2) >> 16; - temp4 = ip[15] + ((ip[15] * cospi8sqrt2minus1) >> 16); - c2 = temp3 - temp4; - - temp3 = ip[7] + ((ip[7] * cospi8sqrt2minus1) >> 16); - temp4 = (ip[15] * sinpi8sqrt2) >> 16; - d2 = temp3 + temp4; - - op[2] = a1 + d1; - op[14] = a1 - d1; - op[6] = b1 + c1; - op[10] = b1 - c1; - - a1 = ip[3] + ip[11]; - b1 = ip[3] - ip[11]; - - op[3] = a1 + d2; - op[15] = a1 - d2; - op[7] = b1 + c2; - op[11] = b1 - c2; - - ip = output; - - /* prepare data for load */ - prefetch_load_short(ip + shortpitch); - - /* second loop is unrolled */ - a1 = ip[0] + ip[2]; - b1 = ip[0] - ip[2]; - - temp1 = (ip[1] * sinpi8sqrt2) >> 16; - temp2 = ip[3] + ((ip[3] * cospi8sqrt2minus1) >> 16); - c1 = temp1 - temp2; - - temp1 = ip[1] + ((ip[1] * cospi8sqrt2minus1) >> 16); - temp2 = (ip[3] * sinpi8sqrt2) >> 16; - d1 = temp1 + temp2; - - temp3 = (ip[5] * sinpi8sqrt2) >> 16; - temp4 = ip[7] + ((ip[7] * cospi8sqrt2minus1) >> 16); - c2 = temp3 - temp4; - - temp3 = ip[5] + ((ip[5] * cospi8sqrt2minus1) >> 16); - temp4 = (ip[7] * sinpi8sqrt2) >> 16; - d2 = temp3 + temp4; - - op[0] = (a1 + d1 + 4) >> 3; - op[3] = (a1 - d1 + 4) >> 3; - op[1] = (b1 + c1 + 4) >> 3; - op[2] = (b1 - c1 + 4) >> 3; - - a1 = ip[4] + ip[6]; - b1 = ip[4] - ip[6]; - - op[4] = (a1 + d2 + 4) >> 3; - op[7] = (a1 - d2 + 4) >> 3; - op[5] = (b1 + c2 + 4) >> 3; - op[6] = (b1 - c2 + 4) >> 3; - - a1 = ip[8] + ip[10]; - b1 = ip[8] - ip[10]; - - temp1 = (ip[9] * sinpi8sqrt2) >> 16; - temp2 = ip[11] + ((ip[11] * cospi8sqrt2minus1) >> 16); - c1 = temp1 - temp2; - - temp1 = ip[9] + ((ip[9] * cospi8sqrt2minus1) >> 16); - temp2 = (ip[11] * sinpi8sqrt2) >> 16; - d1 = temp1 + temp2; - - temp3 = (ip[13] * sinpi8sqrt2) >> 16; - temp4 = ip[15] + ((ip[15] * cospi8sqrt2minus1) >> 16); - c2 = temp3 - temp4; - - temp3 = ip[13] + ((ip[13] * cospi8sqrt2minus1) >> 16); - temp4 = (ip[15] * sinpi8sqrt2) >> 16; - d2 = temp3 + temp4; - - op[8] = (a1 + d1 + 4) >> 3; - op[11] = (a1 - d1 + 4) >> 3; - op[9] = (b1 + c1 + 4) >> 3; - op[10] = (b1 - c1 + 4) >> 3; - - a1 = ip[12] + ip[14]; - b1 = ip[12] - ip[14]; - - op[12] = (a1 + d2 + 4) >> 3; - op[15] = (a1 - d2 + 4) >> 3; - op[13] = (b1 + c2 + 4) >> 3; - op[14] = (b1 - c2 + 4) >> 3; - - ip = output; - - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - short a = ip[c] + pred_ptr[c] ; - dst_ptr[c] = cm[a] ; - } - - ip += 4; - dst_ptr += dst_stride; - pred_ptr += pred_stride; - } -} - -void vp8_dc_only_idct_add_dspr2(short input_dc, unsigned char *pred_ptr, int pred_stride, unsigned char *dst_ptr, int dst_stride) -{ - int a1; - int i, absa1; - int t2, vector_a1, vector_a; - - /* a1 = ((input_dc + 4) >> 3); */ - __asm__ __volatile__ ( - "addi %[a1], %[input_dc], 4 \n\t" - "sra %[a1], %[a1], 3 \n\t" - : [a1] "=r" (a1) - : [input_dc] "r" (input_dc) - ); - - if (a1 < 0) - { - /* use quad-byte - * input and output memory are four byte aligned - */ - __asm__ __volatile__ ( - "abs %[absa1], %[a1] \n\t" - "replv.qb %[vector_a1], %[absa1] \n\t" - : [absa1] "=r" (absa1), [vector_a1] "=r" (vector_a1) - : [a1] "r" (a1) - ); - - /* use (a1 - predptr[c]) instead a1 + predptr[c] */ - for (i = 4; i--;) - { - __asm__ __volatile__ ( - "lw %[t2], 0(%[pred_ptr]) \n\t" - "add %[pred_ptr], %[pred_ptr], %[pred_stride] \n\t" - "subu_s.qb %[vector_a], %[t2], %[vector_a1] \n\t" - "sw %[vector_a], 0(%[dst_ptr]) \n\t" - "add %[dst_ptr], %[dst_ptr], %[dst_stride] \n\t" - : [t2] "=&r" (t2), [vector_a] "=&r" (vector_a), - [dst_ptr] "+&r" (dst_ptr), [pred_ptr] "+&r" (pred_ptr) - : [dst_stride] "r" (dst_stride), [pred_stride] "r" (pred_stride), [vector_a1] "r" (vector_a1) - ); - } - } - else - { - /* use quad-byte - * input and output memory are four byte aligned - */ - __asm__ __volatile__ ( - "replv.qb %[vector_a1], %[a1] \n\t" - : [vector_a1] "=r" (vector_a1) - : [a1] "r" (a1) - ); - - for (i = 4; i--;) - { - __asm__ __volatile__ ( - "lw %[t2], 0(%[pred_ptr]) \n\t" - "add %[pred_ptr], %[pred_ptr], %[pred_stride] \n\t" - "addu_s.qb %[vector_a], %[vector_a1], %[t2] \n\t" - "sw %[vector_a], 0(%[dst_ptr]) \n\t" - "add %[dst_ptr], %[dst_ptr], %[dst_stride] \n\t" - : [t2] "=&r" (t2), [vector_a] "=&r" (vector_a), - [dst_ptr] "+&r" (dst_ptr), [pred_ptr] "+&r" (pred_ptr) - : [dst_stride] "r" (dst_stride), [pred_stride] "r" (pred_stride), [vector_a1] "r" (vector_a1) - ); - } - } - -} - -void vp8_short_inv_walsh4x4_dspr2(short *input, short *mb_dqcoeff) -{ - short output[16]; - int i; - int a1, b1, c1, d1; - int a2, b2, c2, d2; - short *ip = input; - short *op = output; - - prefetch_load_short(ip); - - for (i = 4; i--;) - { - a1 = ip[0] + ip[12]; - b1 = ip[4] + ip[8]; - c1 = ip[4] - ip[8]; - d1 = ip[0] - ip[12]; - - op[0] = a1 + b1; - op[4] = c1 + d1; - op[8] = a1 - b1; - op[12] = d1 - c1; - - ip++; - op++; - } - - ip = output; - op = output; - - prefetch_load_short(ip); - - for (i = 4; i--;) - { - a1 = ip[0] + ip[3] + 3; - b1 = ip[1] + ip[2]; - c1 = ip[1] - ip[2]; - d1 = ip[0] - ip[3] + 3; - - a2 = a1 + b1; - b2 = d1 + c1; - c2 = a1 - b1; - d2 = d1 - c1; - - op[0] = a2 >> 3; - op[1] = b2 >> 3; - op[2] = c2 >> 3; - op[3] = d2 >> 3; - - ip += 4; - op += 4; - } - - for (i = 0; i < 16; i++) - { - mb_dqcoeff[i * 16] = output[i]; - } -} - -void vp8_short_inv_walsh4x4_1_dspr2(short *input, short *mb_dqcoeff) -{ - int a1; - - a1 = ((input[0] + 3) >> 3); - - __asm__ __volatile__ ( - "sh %[a1], 0(%[mb_dqcoeff]) \n\t" - "sh %[a1], 32(%[mb_dqcoeff]) \n\t" - "sh %[a1], 64(%[mb_dqcoeff]) \n\t" - "sh %[a1], 96(%[mb_dqcoeff]) \n\t" - "sh %[a1], 128(%[mb_dqcoeff]) \n\t" - "sh %[a1], 160(%[mb_dqcoeff]) \n\t" - "sh %[a1], 192(%[mb_dqcoeff]) \n\t" - "sh %[a1], 224(%[mb_dqcoeff]) \n\t" - "sh %[a1], 256(%[mb_dqcoeff]) \n\t" - "sh %[a1], 288(%[mb_dqcoeff]) \n\t" - "sh %[a1], 320(%[mb_dqcoeff]) \n\t" - "sh %[a1], 352(%[mb_dqcoeff]) \n\t" - "sh %[a1], 384(%[mb_dqcoeff]) \n\t" - "sh %[a1], 416(%[mb_dqcoeff]) \n\t" - "sh %[a1], 448(%[mb_dqcoeff]) \n\t" - "sh %[a1], 480(%[mb_dqcoeff]) \n\t" - - : - : [a1] "r" (a1), [mb_dqcoeff] "r" (mb_dqcoeff) - ); -} - -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/mips/dspr2/loopfilter_filters_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/mips/dspr2/loopfilter_filters_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/mips/dspr2/loopfilter_filters_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/mips/dspr2/loopfilter_filters_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2622 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include -#include "vp8_rtcd.h" -#include "vp8/common/onyxc_int.h" - -#if HAVE_DSPR2 -typedef unsigned char uc; - -/* prefetch data for load */ -inline void prefetch_load_lf(unsigned char *src) -{ - __asm__ __volatile__ ( - "pref 0, 0(%[src]) \n\t" - : - : [src] "r" (src) - ); -} - - -/* prefetch data for store */ -inline void prefetch_store_lf(unsigned char *dst) -{ - __asm__ __volatile__ ( - "pref 1, 0(%[dst]) \n\t" - : - : [dst] "r" (dst) - ); -} - -/* processing 4 pixels at the same time - * compute hev and mask in the same function - */ -static __inline void vp8_filter_mask_vec_mips -( - uint32_t limit, - uint32_t flimit, - uint32_t p1, - uint32_t p0, - uint32_t p3, - uint32_t p2, - uint32_t q0, - uint32_t q1, - uint32_t q2, - uint32_t q3, - uint32_t thresh, - uint32_t *hev, - uint32_t *mask -) -{ - uint32_t c, r, r3, r_k; - uint32_t s1, s2, s3; - uint32_t ones = 0xFFFFFFFF; - uint32_t hev1; - - __asm__ __volatile__ ( - /* mask |= (abs(p3 - p2) > limit) */ - "subu_s.qb %[c], %[p3], %[p2] \n\t" - "subu_s.qb %[r_k], %[p2], %[p3] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[limit], %[r_k] \n\t" - "or %[r], $0, %[c] \n\t" - - /* mask |= (abs(p2 - p1) > limit) */ - "subu_s.qb %[c], %[p2], %[p1] \n\t" - "subu_s.qb %[r_k], %[p1], %[p2] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[limit], %[r_k] \n\t" - "or %[r], %[r], %[c] \n\t" - - /* mask |= (abs(p1 - p0) > limit) - * hev |= (abs(p1 - p0) > thresh) - */ - "subu_s.qb %[c], %[p1], %[p0] \n\t" - "subu_s.qb %[r_k], %[p0], %[p1] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[thresh], %[r_k] \n\t" - "or %[r3], $0, %[c] \n\t" - "cmpgu.lt.qb %[c], %[limit], %[r_k] \n\t" - "or %[r], %[r], %[c] \n\t" - - /* mask |= (abs(q1 - q0) > limit) - * hev |= (abs(q1 - q0) > thresh) - */ - "subu_s.qb %[c], %[q1], %[q0] \n\t" - "subu_s.qb %[r_k], %[q0], %[q1] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[thresh], %[r_k] \n\t" - "or %[r3], %[r3], %[c] \n\t" - "cmpgu.lt.qb %[c], %[limit], %[r_k] \n\t" - "or %[r], %[r], %[c] \n\t" - - /* mask |= (abs(q2 - q1) > limit) */ - "subu_s.qb %[c], %[q2], %[q1] \n\t" - "subu_s.qb %[r_k], %[q1], %[q2] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[limit], %[r_k] \n\t" - "or %[r], %[r], %[c] \n\t" - "sll %[r3], %[r3], 24 \n\t" - - /* mask |= (abs(q3 - q2) > limit) */ - "subu_s.qb %[c], %[q3], %[q2] \n\t" - "subu_s.qb %[r_k], %[q2], %[q3] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[limit], %[r_k] \n\t" - "or %[r], %[r], %[c] \n\t" - - : [c] "=&r" (c), [r_k] "=&r" (r_k), - [r] "=&r" (r), [r3] "=&r" (r3) - : [limit] "r" (limit), [p3] "r" (p3), [p2] "r" (p2), - [p1] "r" (p1), [p0] "r" (p0), [q1] "r" (q1), [q0] "r" (q0), - [q2] "r" (q2), [q3] "r" (q3), [thresh] "r" (thresh) - ); - - __asm__ __volatile__ ( - /* abs(p0 - q0) */ - "subu_s.qb %[c], %[p0], %[q0] \n\t" - "subu_s.qb %[r_k], %[q0], %[p0] \n\t" - "wrdsp %[r3] \n\t" - "or %[s1], %[r_k], %[c] \n\t" - - /* abs(p1 - q1) */ - "subu_s.qb %[c], %[p1], %[q1] \n\t" - "addu_s.qb %[s3], %[s1], %[s1] \n\t" - "pick.qb %[hev1], %[ones], $0 \n\t" - "subu_s.qb %[r_k], %[q1], %[p1] \n\t" - "or %[s2], %[r_k], %[c] \n\t" - - /* abs(p0 - q0) * 2 + abs(p1 - q1) / 2 > flimit * 2 + limit */ - "shrl.qb %[s2], %[s2], 1 \n\t" - "addu_s.qb %[s1], %[s2], %[s3] \n\t" - "cmpgu.lt.qb %[c], %[flimit], %[s1] \n\t" - "or %[r], %[r], %[c] \n\t" - "sll %[r], %[r], 24 \n\t" - - "wrdsp %[r] \n\t" - "pick.qb %[s2], $0, %[ones] \n\t" - - : [c] "=&r" (c), [r_k] "=&r" (r_k), [s1] "=&r" (s1), [hev1] "=&r" (hev1), - [s2] "=&r" (s2), [r] "+r" (r), [s3] "=&r" (s3) - : [p0] "r" (p0), [q0] "r" (q0), [p1] "r" (p1), [r3] "r" (r3), - [q1] "r" (q1), [ones] "r" (ones), [flimit] "r" (flimit) - ); - - *hev = hev1; - *mask = s2; -} - - -/* inputs & outputs are quad-byte vectors */ -static __inline void vp8_filter_mips -( - uint32_t mask, - uint32_t hev, - uint32_t *ps1, - uint32_t *ps0, - uint32_t *qs0, - uint32_t *qs1 -) -{ - int32_t vp8_filter_l, vp8_filter_r; - int32_t Filter1_l, Filter1_r, Filter2_l, Filter2_r; - int32_t subr_r, subr_l; - uint32_t t1, t2, HWM, t3; - uint32_t hev_l, hev_r, mask_l, mask_r, invhev_l, invhev_r; - - int32_t vps1, vps0, vqs0, vqs1; - int32_t vps1_l, vps1_r, vps0_l, vps0_r, vqs0_l, vqs0_r, vqs1_l, vqs1_r; - uint32_t N128; - - N128 = 0x80808080; - t1 = 0x03000300; - t2 = 0x04000400; - t3 = 0x01000100; - HWM = 0xFF00FF00; - - vps0 = (*ps0) ^ N128; - vps1 = (*ps1) ^ N128; - vqs0 = (*qs0) ^ N128; - vqs1 = (*qs1) ^ N128; - - /* use halfword pairs instead quad-bytes because of accuracy */ - vps0_l = vps0 & HWM; - vps0_r = vps0 << 8; - vps0_r = vps0_r & HWM; - - vps1_l = vps1 & HWM; - vps1_r = vps1 << 8; - vps1_r = vps1_r & HWM; - - vqs0_l = vqs0 & HWM; - vqs0_r = vqs0 << 8; - vqs0_r = vqs0_r & HWM; - - vqs1_l = vqs1 & HWM; - vqs1_r = vqs1 << 8; - vqs1_r = vqs1_r & HWM; - - mask_l = mask & HWM; - mask_r = mask << 8; - mask_r = mask_r & HWM; - - hev_l = hev & HWM; - hev_r = hev << 8; - hev_r = hev_r & HWM; - - __asm__ __volatile__ ( - /* vp8_filter = vp8_signed_char_clamp(ps1 - qs1); */ - "subq_s.ph %[vp8_filter_l], %[vps1_l], %[vqs1_l] \n\t" - "subq_s.ph %[vp8_filter_r], %[vps1_r], %[vqs1_r] \n\t" - - /* qs0 - ps0 */ - "subq_s.ph %[subr_l], %[vqs0_l], %[vps0_l] \n\t" - "subq_s.ph %[subr_r], %[vqs0_r], %[vps0_r] \n\t" - - /* vp8_filter &= hev; */ - "and %[vp8_filter_l], %[vp8_filter_l], %[hev_l] \n\t" - "and %[vp8_filter_r], %[vp8_filter_r], %[hev_r] \n\t" - - /* vp8_filter = vp8_signed_char_clamp(vp8_filter + 3 * (qs0 - ps0)); */ - "addq_s.ph %[vp8_filter_l], %[vp8_filter_l], %[subr_l] \n\t" - "addq_s.ph %[vp8_filter_r], %[vp8_filter_r], %[subr_r] \n\t" - "xor %[invhev_l], %[hev_l], %[HWM] \n\t" - "addq_s.ph %[vp8_filter_l], %[vp8_filter_l], %[subr_l] \n\t" - "addq_s.ph %[vp8_filter_r], %[vp8_filter_r], %[subr_r] \n\t" - "xor %[invhev_r], %[hev_r], %[HWM] \n\t" - "addq_s.ph %[vp8_filter_l], %[vp8_filter_l], %[subr_l] \n\t" - "addq_s.ph %[vp8_filter_r], %[vp8_filter_r], %[subr_r] \n\t" - - /* vp8_filter &= mask; */ - "and %[vp8_filter_l], %[vp8_filter_l], %[mask_l] \n\t" - "and %[vp8_filter_r], %[vp8_filter_r], %[mask_r] \n\t" - - : [vp8_filter_l] "=&r" (vp8_filter_l), [vp8_filter_r] "=&r" (vp8_filter_r), - [subr_l] "=&r" (subr_l), [subr_r] "=&r" (subr_r), - [invhev_l] "=&r" (invhev_l), [invhev_r] "=&r" (invhev_r) - - : [vps0_l] "r" (vps0_l), [vps0_r] "r" (vps0_r), [vps1_l] "r" (vps1_l), - [vps1_r] "r" (vps1_r), [vqs0_l] "r" (vqs0_l), [vqs0_r] "r" (vqs0_r), - [vqs1_l] "r" (vqs1_l), [vqs1_r] "r" (vqs1_r), - [mask_l] "r" (mask_l), [mask_r] "r" (mask_r), - [hev_l] "r" (hev_l), [hev_r] "r" (hev_r), - [HWM] "r" (HWM) - ); - - /* save bottom 3 bits so that we round one side +4 and the other +3 */ - __asm__ __volatile__ ( - /* Filter2 = vp8_signed_char_clamp(vp8_filter + 3) >>= 3; */ - "addq_s.ph %[Filter1_l], %[vp8_filter_l], %[t2] \n\t" - "addq_s.ph %[Filter1_r], %[vp8_filter_r], %[t2] \n\t" - - /* Filter1 = vp8_signed_char_clamp(vp8_filter + 4) >>= 3; */ - "addq_s.ph %[Filter2_l], %[vp8_filter_l], %[t1] \n\t" - "addq_s.ph %[Filter2_r], %[vp8_filter_r], %[t1] \n\t" - "shra.ph %[Filter1_r], %[Filter1_r], 3 \n\t" - "shra.ph %[Filter1_l], %[Filter1_l], 3 \n\t" - - "shra.ph %[Filter2_l], %[Filter2_l], 3 \n\t" - "shra.ph %[Filter2_r], %[Filter2_r], 3 \n\t" - - "and %[Filter1_l], %[Filter1_l], %[HWM] \n\t" - "and %[Filter1_r], %[Filter1_r], %[HWM] \n\t" - - /* vps0 = vp8_signed_char_clamp(ps0 + Filter2); */ - "addq_s.ph %[vps0_l], %[vps0_l], %[Filter2_l] \n\t" - "addq_s.ph %[vps0_r], %[vps0_r], %[Filter2_r] \n\t" - - /* vqs0 = vp8_signed_char_clamp(qs0 - Filter1); */ - "subq_s.ph %[vqs0_l], %[vqs0_l], %[Filter1_l] \n\t" - "subq_s.ph %[vqs0_r], %[vqs0_r], %[Filter1_r] \n\t" - - : [Filter1_l] "=&r" (Filter1_l), [Filter1_r] "=&r" (Filter1_r), - [Filter2_l] "=&r" (Filter2_l), [Filter2_r] "=&r" (Filter2_r), - [vps0_l] "+r" (vps0_l), [vps0_r] "+r" (vps0_r), - [vqs0_l] "+r" (vqs0_l), [vqs0_r] "+r" (vqs0_r) - - : [t1] "r" (t1), [t2] "r" (t2), - [vp8_filter_l] "r" (vp8_filter_l), [vp8_filter_r] "r" (vp8_filter_r), - [HWM] "r" (HWM) - ); - - __asm__ __volatile__ ( - /* (vp8_filter += 1) >>= 1 */ - "addqh.ph %[Filter1_l], %[Filter1_l], %[t3] \n\t" - "addqh.ph %[Filter1_r], %[Filter1_r], %[t3] \n\t" - - /* vp8_filter &= ~hev; */ - "and %[Filter1_l], %[Filter1_l], %[invhev_l] \n\t" - "and %[Filter1_r], %[Filter1_r], %[invhev_r] \n\t" - - /* vps1 = vp8_signed_char_clamp(ps1 + vp8_filter); */ - "addq_s.ph %[vps1_l], %[vps1_l], %[Filter1_l] \n\t" - "addq_s.ph %[vps1_r], %[vps1_r], %[Filter1_r] \n\t" - - /* vqs1 = vp8_signed_char_clamp(qs1 - vp8_filter); */ - "subq_s.ph %[vqs1_l], %[vqs1_l], %[Filter1_l] \n\t" - "subq_s.ph %[vqs1_r], %[vqs1_r], %[Filter1_r] \n\t" - - : [Filter1_l] "+r" (Filter1_l), [Filter1_r] "+r" (Filter1_r), - [vps1_l] "+r" (vps1_l), [vps1_r] "+r" (vps1_r), - [vqs1_l] "+r" (vqs1_l), [vqs1_r] "+r" (vqs1_r) - - : [t3] "r" (t3), [invhev_l] "r" (invhev_l), [invhev_r] "r" (invhev_r) - ); - - /* Create quad-bytes from halfword pairs */ - vqs0_l = vqs0_l & HWM; - vqs1_l = vqs1_l & HWM; - vps0_l = vps0_l & HWM; - vps1_l = vps1_l & HWM; - - __asm__ __volatile__ ( - "shrl.ph %[vqs0_r], %[vqs0_r], 8 \n\t" - "shrl.ph %[vps0_r], %[vps0_r], 8 \n\t" - "shrl.ph %[vqs1_r], %[vqs1_r], 8 \n\t" - "shrl.ph %[vps1_r], %[vps1_r], 8 \n\t" - - : [vps1_r] "+r" (vps1_r), [vqs1_r] "+r" (vqs1_r), - [vps0_r] "+r" (vps0_r), [vqs0_r] "+r" (vqs0_r) - : - ); - - vqs0 = vqs0_l | vqs0_r; - vqs1 = vqs1_l | vqs1_r; - vps0 = vps0_l | vps0_r; - vps1 = vps1_l | vps1_r; - - *ps0 = vps0 ^ N128; - *ps1 = vps1 ^ N128; - *qs0 = vqs0 ^ N128; - *qs1 = vqs1 ^ N128; -} - -void vp8_loop_filter_horizontal_edge_mips -( - unsigned char *s, - int p, - unsigned int flimit, - unsigned int limit, - unsigned int thresh, - int count -) -{ - uint32_t mask; - uint32_t hev; - uint32_t pm1, p0, p1, p2, p3, p4, p5, p6; - unsigned char *sm1, *s0, *s1, *s2, *s3, *s4, *s5, *s6; - - mask = 0; - hev = 0; - p1 = 0; - p2 = 0; - p3 = 0; - p4 = 0; - - /* prefetch data for store */ - prefetch_store_lf(s); - - /* loop filter designed to work using chars so that we can make maximum use - * of 8 bit simd instructions. - */ - - sm1 = s - (p << 2); - s0 = s - p - p - p; - s1 = s - p - p ; - s2 = s - p; - s3 = s; - s4 = s + p; - s5 = s + p + p; - s6 = s + p + p + p; - - /* load quad-byte vectors - * memory is 4 byte aligned - */ - p1 = *((uint32_t *)(s1)); - p2 = *((uint32_t *)(s2)); - p3 = *((uint32_t *)(s3)); - p4 = *((uint32_t *)(s4)); - - /* if (p1 - p4 == 0) and (p2 - p3 == 0) - * mask will be zero and filtering is not needed - */ - if (!(((p1 - p4) == 0) && ((p2 - p3) == 0))) - { - - pm1 = *((uint32_t *)(sm1)); - p0 = *((uint32_t *)(s0)); - p5 = *((uint32_t *)(s5)); - p6 = *((uint32_t *)(s6)); - - vp8_filter_mask_vec_mips(limit, flimit, p1, p2, pm1, p0, p3, p4, p5, p6, - thresh, &hev, &mask); - - /* if mask == 0 do filtering is not needed */ - if (mask) - { - /* filtering */ - vp8_filter_mips(mask, hev, &p1, &p2, &p3, &p4); - - /* unpack processed 4x4 neighborhood */ - *((uint32_t *)s1) = p1; - *((uint32_t *)s2) = p2; - *((uint32_t *)s3) = p3; - *((uint32_t *)s4) = p4; - } - } - - sm1 += 4; - s0 += 4; - s1 += 4; - s2 += 4; - s3 += 4; - s4 += 4; - s5 += 4; - s6 += 4; - - /* load quad-byte vectors - * memory is 4 byte aligned - */ - p1 = *((uint32_t *)(s1)); - p2 = *((uint32_t *)(s2)); - p3 = *((uint32_t *)(s3)); - p4 = *((uint32_t *)(s4)); - - /* if (p1 - p4 == 0) and (p2 - p3 == 0) - * mask will be zero and filtering is not needed - */ - if (!(((p1 - p4) == 0) && ((p2 - p3) == 0))) - { - - pm1 = *((uint32_t *)(sm1)); - p0 = *((uint32_t *)(s0)); - p5 = *((uint32_t *)(s5)); - p6 = *((uint32_t *)(s6)); - - vp8_filter_mask_vec_mips(limit, flimit, p1, p2, pm1, p0, p3, p4, p5, p6, - thresh, &hev, &mask); - - /* if mask == 0 do filtering is not needed */ - if (mask) - { - /* filtering */ - vp8_filter_mips(mask, hev, &p1, &p2, &p3, &p4); - - /* unpack processed 4x4 neighborhood */ - *((uint32_t *)s1) = p1; - *((uint32_t *)s2) = p2; - *((uint32_t *)s3) = p3; - *((uint32_t *)s4) = p4; - } - } - - sm1 += 4; - s0 += 4; - s1 += 4; - s2 += 4; - s3 += 4; - s4 += 4; - s5 += 4; - s6 += 4; - - /* load quad-byte vectors - * memory is 4 byte aligned - */ - p1 = *((uint32_t *)(s1)); - p2 = *((uint32_t *)(s2)); - p3 = *((uint32_t *)(s3)); - p4 = *((uint32_t *)(s4)); - - /* if (p1 - p4 == 0) and (p2 - p3 == 0) - * mask will be zero and filtering is not needed - */ - if (!(((p1 - p4) == 0) && ((p2 - p3) == 0))) - { - - pm1 = *((uint32_t *)(sm1)); - p0 = *((uint32_t *)(s0)); - p5 = *((uint32_t *)(s5)); - p6 = *((uint32_t *)(s6)); - - vp8_filter_mask_vec_mips(limit, flimit, p1, p2, pm1, p0, p3, p4, p5, p6, - thresh, &hev, &mask); - - /* if mask == 0 do filtering is not needed */ - if (mask) - { - /* filtering */ - vp8_filter_mips(mask, hev, &p1, &p2, &p3, &p4); - - /* unpack processed 4x4 neighborhood */ - *((uint32_t *)s1) = p1; - *((uint32_t *)s2) = p2; - *((uint32_t *)s3) = p3; - *((uint32_t *)s4) = p4; - } - } - - sm1 += 4; - s0 += 4; - s1 += 4; - s2 += 4; - s3 += 4; - s4 += 4; - s5 += 4; - s6 += 4; - - /* load quad-byte vectors - * memory is 4 byte aligned - */ - p1 = *((uint32_t *)(s1)); - p2 = *((uint32_t *)(s2)); - p3 = *((uint32_t *)(s3)); - p4 = *((uint32_t *)(s4)); - - /* if (p1 - p4 == 0) and (p2 - p3 == 0) - * mask will be zero and filtering is not needed - */ - if (!(((p1 - p4) == 0) && ((p2 - p3) == 0))) - { - - pm1 = *((uint32_t *)(sm1)); - p0 = *((uint32_t *)(s0)); - p5 = *((uint32_t *)(s5)); - p6 = *((uint32_t *)(s6)); - - vp8_filter_mask_vec_mips(limit, flimit, p1, p2, pm1, p0, p3, p4, p5, p6, - thresh, &hev, &mask); - - /* if mask == 0 do filtering is not needed */ - if (mask) - { - /* filtering */ - vp8_filter_mips(mask, hev, &p1, &p2, &p3, &p4); - - /* unpack processed 4x4 neighborhood */ - *((uint32_t *)s1) = p1; - *((uint32_t *)s2) = p2; - *((uint32_t *)s3) = p3; - *((uint32_t *)s4) = p4; - } - } -} - -void vp8_loop_filter_uvhorizontal_edge_mips -( - unsigned char *s, - int p, - unsigned int flimit, - unsigned int limit, - unsigned int thresh, - int count -) -{ - uint32_t mask; - uint32_t hev; - uint32_t pm1, p0, p1, p2, p3, p4, p5, p6; - unsigned char *sm1, *s0, *s1, *s2, *s3, *s4, *s5, *s6; - - mask = 0; - hev = 0; - p1 = 0; - p2 = 0; - p3 = 0; - p4 = 0; - - /* loop filter designed to work using chars so that we can make maximum use - * of 8 bit simd instructions. - */ - - sm1 = s - (p << 2); - s0 = s - p - p - p; - s1 = s - p - p ; - s2 = s - p; - s3 = s; - s4 = s + p; - s5 = s + p + p; - s6 = s + p + p + p; - - /* load quad-byte vectors - * memory is 4 byte aligned - */ - p1 = *((uint32_t *)(s1)); - p2 = *((uint32_t *)(s2)); - p3 = *((uint32_t *)(s3)); - p4 = *((uint32_t *)(s4)); - - /* if (p1 - p4 == 0) and (p2 - p3 == 0) - * mask will be zero and filtering is not needed - */ - if (!(((p1 - p4) == 0) && ((p2 - p3) == 0))) - { - - pm1 = *((uint32_t *)(sm1)); - p0 = *((uint32_t *)(s0)); - p5 = *((uint32_t *)(s5)); - p6 = *((uint32_t *)(s6)); - - vp8_filter_mask_vec_mips(limit, flimit, p1, p2, pm1, p0, p3, p4, p5, p6, - thresh, &hev, &mask); - - /* if mask == 0 do filtering is not needed */ - if (mask) - { - /* filtering */ - vp8_filter_mips(mask, hev, &p1, &p2, &p3, &p4); - - /* unpack processed 4x4 neighborhood */ - *((uint32_t *)s1) = p1; - *((uint32_t *)s2) = p2; - *((uint32_t *)s3) = p3; - *((uint32_t *)s4) = p4; - } - } - - sm1 += 4; - s0 += 4; - s1 += 4; - s2 += 4; - s3 += 4; - s4 += 4; - s5 += 4; - s6 += 4; - - /* load quad-byte vectors - * memory is 4 byte aligned - */ - p1 = *((uint32_t *)(s1)); - p2 = *((uint32_t *)(s2)); - p3 = *((uint32_t *)(s3)); - p4 = *((uint32_t *)(s4)); - - /* if (p1 - p4 == 0) and (p2 - p3 == 0) - * mask will be zero and filtering is not needed - */ - if (!(((p1 - p4) == 0) && ((p2 - p3) == 0))) - { - - pm1 = *((uint32_t *)(sm1)); - p0 = *((uint32_t *)(s0)); - p5 = *((uint32_t *)(s5)); - p6 = *((uint32_t *)(s6)); - - vp8_filter_mask_vec_mips(limit, flimit, p1, p2, pm1, p0, p3, p4, p5, p6, - thresh, &hev, &mask); - - /* if mask == 0 do filtering is not needed */ - if (mask) - { - /* filtering */ - vp8_filter_mips(mask, hev, &p1, &p2, &p3, &p4); - - /* unpack processed 4x4 neighborhood */ - *((uint32_t *)s1) = p1; - *((uint32_t *)s2) = p2; - *((uint32_t *)s3) = p3; - *((uint32_t *)s4) = p4; - } - } -} - -void vp8_loop_filter_vertical_edge_mips -( - unsigned char *s, - int p, - const unsigned int flimit, - const unsigned int limit, - const unsigned int thresh, - int count -) -{ - int i; - uint32_t mask, hev; - uint32_t pm1, p0, p1, p2, p3, p4, p5, p6; - unsigned char *s1, *s2, *s3, *s4; - uint32_t prim1, prim2, sec3, sec4, prim3, prim4; - - hev = 0; - mask = 0; - i = 0; - pm1 = 0; - p0 = 0; - p1 = 0; - p2 = 0; - p3 = 0; - p4 = 0; - p5 = 0; - p6 = 0; - - /* loop filter designed to work using chars so that we can make maximum use - * of 8 bit simd instructions. - */ - - /* apply filter on 4 pixesl at the same time */ - do - { - - /* prefetch data for store */ - prefetch_store_lf(s + p); - - s1 = s; - s2 = s + p; - s3 = s2 + p; - s4 = s3 + p; - s = s4 + p; - - /* load quad-byte vectors - * memory is 4 byte aligned - */ - p2 = *((uint32_t *)(s1 - 4)); - p6 = *((uint32_t *)(s1)); - p1 = *((uint32_t *)(s2 - 4)); - p5 = *((uint32_t *)(s2)); - p0 = *((uint32_t *)(s3 - 4)); - p4 = *((uint32_t *)(s3)); - pm1 = *((uint32_t *)(s4 - 4)); - p3 = *((uint32_t *)(s4)); - - /* transpose pm1, p0, p1, p2 */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[p2], %[p1] \n\t" - "precr.qb.ph %[prim2], %[p2], %[p1] \n\t" - "precrq.qb.ph %[prim3], %[p0], %[pm1] \n\t" - "precr.qb.ph %[prim4], %[p0], %[pm1] \n\t" - - "precrq.qb.ph %[p1], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[pm1], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[p2], %[p1], %[sec3] \n\t" - "precrq.ph.w %[p0], %[pm1], %[sec4] \n\t" - "append %[p1], %[sec3], 16 \n\t" - "append %[pm1], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [p2] "+r" (p2), [p1] "+r" (p1), [p0] "+r" (p0), [pm1] "+r" (pm1), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - /* transpose p3, p4, p5, p6 */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[p6], %[p5] \n\t" - "precr.qb.ph %[prim2], %[p6], %[p5] \n\t" - "precrq.qb.ph %[prim3], %[p4], %[p3] \n\t" - "precr.qb.ph %[prim4], %[p4], %[p3] \n\t" - - "precrq.qb.ph %[p5], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[p3], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[p6], %[p5], %[sec3] \n\t" - "precrq.ph.w %[p4], %[p3], %[sec4] \n\t" - "append %[p5], %[sec3], 16 \n\t" - "append %[p3], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [p6] "+r" (p6), [p5] "+r" (p5), [p4] "+r" (p4), [p3] "+r" (p3), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - /* if (p1 - p4 == 0) and (p2 - p3 == 0) - * mask will be zero and filtering is not needed - */ - if (!(((p1 - p4) == 0) && ((p2 - p3) == 0))) - { - - vp8_filter_mask_vec_mips(limit, flimit, p1, p2, pm1, p0, p3, p4, p5, p6, - thresh, &hev, &mask); - - /* if mask == 0 do filtering is not needed */ - if (mask) - { - /* filtering */ - vp8_filter_mips(mask, hev, &p1, &p2, &p3, &p4); - - /* unpack processed 4x4 neighborhood - * don't use transpose on output data - * because memory isn't aligned - */ - __asm__ __volatile__ ( - "sb %[p4], 1(%[s4]) \n\t" - "sb %[p3], 0(%[s4]) \n\t" - "sb %[p2], -1(%[s4]) \n\t" - "sb %[p1], -2(%[s4]) \n\t" - : - : [p4] "r" (p4), [p3] "r" (p3), [s4] "r" (s4), - [p2] "r" (p2), [p1] "r" (p1) - ); - - __asm__ __volatile__ ( - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - : [p4] "+r" (p4), [p3] "+r" (p3), [p2] "+r" (p2), [p1] "+r" (p1) - : - ); - - __asm__ __volatile__ ( - "sb %[p4], 1(%[s3]) \n\t" - "sb %[p3], 0(%[s3]) \n\t" - "sb %[p2], -1(%[s3]) \n\t" - "sb %[p1], -2(%[s3]) \n\t" - : [p1] "+r" (p1) - : [p4] "r" (p4), [p3] "r" (p3), [s3] "r" (s3), [p2] "r" (p2) - ); - - __asm__ __volatile__ ( - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - : [p4] "+r" (p4), [p3] "+r" (p3), [p2] "+r" (p2), [p1] "+r" (p1) - : - ); - - __asm__ __volatile__ ( - "sb %[p4], 1(%[s2]) \n\t" - "sb %[p3], 0(%[s2]) \n\t" - "sb %[p2], -1(%[s2]) \n\t" - "sb %[p1], -2(%[s2]) \n\t" - : - : [p4] "r" (p4), [p3] "r" (p3), [s2] "r" (s2), - [p2] "r" (p2), [p1] "r" (p1) - ); - - __asm__ __volatile__ ( - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - : [p4] "+r" (p4), [p3] "+r" (p3), [p2] "+r" (p2), [p1] "+r" (p1) - : - ); - - __asm__ __volatile__ ( - "sb %[p4], 1(%[s1]) \n\t" - "sb %[p3], 0(%[s1]) \n\t" - "sb %[p2], -1(%[s1]) \n\t" - "sb %[p1], -2(%[s1]) \n\t" - : - : [p4] "r" (p4), [p3] "r" (p3), [s1] "r" (s1), - [p2] "r" (p2), [p1] "r" (p1) - ); - } - } - - s1 = s; - s2 = s + p; - s3 = s2 + p; - s4 = s3 + p; - s = s4 + p; - - /* load quad-byte vectors - * memory is 4 byte aligned - */ - p2 = *((uint32_t *)(s1 - 4)); - p6 = *((uint32_t *)(s1)); - p1 = *((uint32_t *)(s2 - 4)); - p5 = *((uint32_t *)(s2)); - p0 = *((uint32_t *)(s3 - 4)); - p4 = *((uint32_t *)(s3)); - pm1 = *((uint32_t *)(s4 - 4)); - p3 = *((uint32_t *)(s4)); - - /* transpose pm1, p0, p1, p2 */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[p2], %[p1] \n\t" - "precr.qb.ph %[prim2], %[p2], %[p1] \n\t" - "precrq.qb.ph %[prim3], %[p0], %[pm1] \n\t" - "precr.qb.ph %[prim4], %[p0], %[pm1] \n\t" - - "precrq.qb.ph %[p1], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[pm1], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[p2], %[p1], %[sec3] \n\t" - "precrq.ph.w %[p0], %[pm1], %[sec4] \n\t" - "append %[p1], %[sec3], 16 \n\t" - "append %[pm1], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [p2] "+r" (p2), [p1] "+r" (p1), [p0] "+r" (p0), [pm1] "+r" (pm1), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - /* transpose p3, p4, p5, p6 */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[p6], %[p5] \n\t" - "precr.qb.ph %[prim2], %[p6], %[p5] \n\t" - "precrq.qb.ph %[prim3], %[p4], %[p3] \n\t" - "precr.qb.ph %[prim4], %[p4], %[p3] \n\t" - - "precrq.qb.ph %[p5], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[p3], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[p6], %[p5], %[sec3] \n\t" - "precrq.ph.w %[p4], %[p3], %[sec4] \n\t" - "append %[p5], %[sec3], 16 \n\t" - "append %[p3], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [p6] "+r" (p6), [p5] "+r" (p5), [p4] "+r" (p4), [p3] "+r" (p3), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - /* if (p1 - p4 == 0) and (p2 - p3 == 0) - * mask will be zero and filtering is not needed - */ - if (!(((p1 - p4) == 0) && ((p2 - p3) == 0))) - { - - vp8_filter_mask_vec_mips(limit, flimit, p1, p2, pm1, p0, p3, p4, p5, p6, - thresh, &hev, &mask); - - /* if mask == 0 do filtering is not needed */ - if (mask) - { - /* filtering */ - vp8_filter_mips(mask, hev, &p1, &p2, &p3, &p4); - - /* unpack processed 4x4 neighborhood - * don't use transpose on output data - * because memory isn't aligned - */ - __asm__ __volatile__ ( - "sb %[p4], 1(%[s4]) \n\t" - "sb %[p3], 0(%[s4]) \n\t" - "sb %[p2], -1(%[s4]) \n\t" - "sb %[p1], -2(%[s4]) \n\t" - : - : [p4] "r" (p4), [p3] "r" (p3), [s4] "r" (s4), - [p2] "r" (p2), [p1] "r" (p1) - ); - - __asm__ __volatile__ ( - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - : [p4] "+r" (p4), [p3] "+r" (p3), [p2] "+r" (p2), [p1] "+r" (p1) - : - ); - - __asm__ __volatile__ ( - "sb %[p4], 1(%[s3]) \n\t" - "sb %[p3], 0(%[s3]) \n\t" - "sb %[p2], -1(%[s3]) \n\t" - "sb %[p1], -2(%[s3]) \n\t" - : [p1] "+r" (p1) - : [p4] "r" (p4), [p3] "r" (p3), [s3] "r" (s3), [p2] "r" (p2) - ); - - __asm__ __volatile__ ( - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - : [p4] "+r" (p4), [p3] "+r" (p3), [p2] "+r" (p2), [p1] "+r" (p1) - : - ); - - __asm__ __volatile__ ( - "sb %[p4], 1(%[s2]) \n\t" - "sb %[p3], 0(%[s2]) \n\t" - "sb %[p2], -1(%[s2]) \n\t" - "sb %[p1], -2(%[s2]) \n\t" - : - : [p4] "r" (p4), [p3] "r" (p3), [s2] "r" (s2), - [p2] "r" (p2), [p1] "r" (p1) - ); - - __asm__ __volatile__ ( - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - : [p4] "+r" (p4), [p3] "+r" (p3), [p2] "+r" (p2), [p1] "+r" (p1) - : - ); - - __asm__ __volatile__ ( - "sb %[p4], 1(%[s1]) \n\t" - "sb %[p3], 0(%[s1]) \n\t" - "sb %[p2], -1(%[s1]) \n\t" - "sb %[p1], -2(%[s1]) \n\t" - : - : [p4] "r" (p4), [p3] "r" (p3), [s1] "r" (s1), - [p2] "r" (p2), [p1] "r" (p1) - ); - } - } - - i += 8; - } - - while (i < count); -} - -void vp8_loop_filter_uvvertical_edge_mips -( - unsigned char *s, - int p, - unsigned int flimit, - unsigned int limit, - unsigned int thresh, - int count -) -{ - uint32_t mask, hev; - uint32_t pm1, p0, p1, p2, p3, p4, p5, p6; - unsigned char *s1, *s2, *s3, *s4; - uint32_t prim1, prim2, sec3, sec4, prim3, prim4; - - /* loop filter designed to work using chars so that we can make maximum use - * of 8 bit simd instructions. - */ - - /* apply filter on 4 pixesl at the same time */ - - s1 = s; - s2 = s + p; - s3 = s2 + p; - s4 = s3 + p; - - /* load quad-byte vectors - * memory is 4 byte aligned - */ - p2 = *((uint32_t *)(s1 - 4)); - p6 = *((uint32_t *)(s1)); - p1 = *((uint32_t *)(s2 - 4)); - p5 = *((uint32_t *)(s2)); - p0 = *((uint32_t *)(s3 - 4)); - p4 = *((uint32_t *)(s3)); - pm1 = *((uint32_t *)(s4 - 4)); - p3 = *((uint32_t *)(s4)); - - /* transpose pm1, p0, p1, p2 */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[p2], %[p1] \n\t" - "precr.qb.ph %[prim2], %[p2], %[p1] \n\t" - "precrq.qb.ph %[prim3], %[p0], %[pm1] \n\t" - "precr.qb.ph %[prim4], %[p0], %[pm1] \n\t" - - "precrq.qb.ph %[p1], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[pm1], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[p2], %[p1], %[sec3] \n\t" - "precrq.ph.w %[p0], %[pm1], %[sec4] \n\t" - "append %[p1], %[sec3], 16 \n\t" - "append %[pm1], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [p2] "+r" (p2), [p1] "+r" (p1), [p0] "+r" (p0), [pm1] "+r" (pm1), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - /* transpose p3, p4, p5, p6 */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[p6], %[p5] \n\t" - "precr.qb.ph %[prim2], %[p6], %[p5] \n\t" - "precrq.qb.ph %[prim3], %[p4], %[p3] \n\t" - "precr.qb.ph %[prim4], %[p4], %[p3] \n\t" - - "precrq.qb.ph %[p5], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[p3], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[p6], %[p5], %[sec3] \n\t" - "precrq.ph.w %[p4], %[p3], %[sec4] \n\t" - "append %[p5], %[sec3], 16 \n\t" - "append %[p3], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [p6] "+r" (p6), [p5] "+r" (p5), [p4] "+r" (p4), [p3] "+r" (p3), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - /* if (p1 - p4 == 0) and (p2 - p3 == 0) - * mask will be zero and filtering is not needed - */ - if (!(((p1 - p4) == 0) && ((p2 - p3) == 0))) - { - - vp8_filter_mask_vec_mips(limit, flimit, p1, p2, pm1, p0, p3, p4, p5, p6, - thresh, &hev, &mask); - - /* if mask == 0 do filtering is not needed */ - if (mask) - { - /* filtering */ - vp8_filter_mips(mask, hev, &p1, &p2, &p3, &p4); - - /* unpack processed 4x4 neighborhood - * don't use transpose on output data - * because memory isn't aligned - */ - __asm__ __volatile__ ( - "sb %[p4], 1(%[s4]) \n\t" - "sb %[p3], 0(%[s4]) \n\t" - "sb %[p2], -1(%[s4]) \n\t" - "sb %[p1], -2(%[s4]) \n\t" - : - : [p4] "r" (p4), [p3] "r" (p3), [s4] "r" (s4), - [p2] "r" (p2), [p1] "r" (p1) - ); - - __asm__ __volatile__ ( - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - : [p4] "+r" (p4), [p3] "+r" (p3), [p2] "+r" (p2), [p1] "+r" (p1) - : - ); - - __asm__ __volatile__ ( - "sb %[p4], 1(%[s3]) \n\t" - "sb %[p3], 0(%[s3]) \n\t" - "sb %[p2], -1(%[s3]) \n\t" - "sb %[p1], -2(%[s3]) \n\t" - : [p1] "+r" (p1) - : [p4] "r" (p4), [p3] "r" (p3), [s3] "r" (s3), [p2] "r" (p2) - ); - - __asm__ __volatile__ ( - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - : [p4] "+r" (p4), [p3] "+r" (p3), [p2] "+r" (p2), [p1] "+r" (p1) - : - ); - - __asm__ __volatile__ ( - "sb %[p4], 1(%[s2]) \n\t" - "sb %[p3], 0(%[s2]) \n\t" - "sb %[p2], -1(%[s2]) \n\t" - "sb %[p1], -2(%[s2]) \n\t" - : - : [p4] "r" (p4), [p3] "r" (p3), [s2] "r" (s2), - [p2] "r" (p2), [p1] "r" (p1) - ); - - __asm__ __volatile__ ( - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - : [p4] "+r" (p4), [p3] "+r" (p3), [p2] "+r" (p2), [p1] "+r" (p1) - : - ); - - __asm__ __volatile__ ( - "sb %[p4], 1(%[s1]) \n\t" - "sb %[p3], 0(%[s1]) \n\t" - "sb %[p2], -1(%[s1]) \n\t" - "sb %[p1], -2(%[s1]) \n\t" - : - : [p4] "r" (p4), [p3] "r" (p3), [s1] "r" (s1), [p2] "r" (p2), [p1] "r" (p1) - ); - } - } - - s1 = s4 + p; - s2 = s1 + p; - s3 = s2 + p; - s4 = s3 + p; - - /* load quad-byte vectors - * memory is 4 byte aligned - */ - p2 = *((uint32_t *)(s1 - 4)); - p6 = *((uint32_t *)(s1)); - p1 = *((uint32_t *)(s2 - 4)); - p5 = *((uint32_t *)(s2)); - p0 = *((uint32_t *)(s3 - 4)); - p4 = *((uint32_t *)(s3)); - pm1 = *((uint32_t *)(s4 - 4)); - p3 = *((uint32_t *)(s4)); - - /* transpose pm1, p0, p1, p2 */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[p2], %[p1] \n\t" - "precr.qb.ph %[prim2], %[p2], %[p1] \n\t" - "precrq.qb.ph %[prim3], %[p0], %[pm1] \n\t" - "precr.qb.ph %[prim4], %[p0], %[pm1] \n\t" - - "precrq.qb.ph %[p1], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[pm1], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[p2], %[p1], %[sec3] \n\t" - "precrq.ph.w %[p0], %[pm1], %[sec4] \n\t" - "append %[p1], %[sec3], 16 \n\t" - "append %[pm1], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [p2] "+r" (p2), [p1] "+r" (p1), [p0] "+r" (p0), [pm1] "+r" (pm1), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - /* transpose p3, p4, p5, p6 */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[p6], %[p5] \n\t" - "precr.qb.ph %[prim2], %[p6], %[p5] \n\t" - "precrq.qb.ph %[prim3], %[p4], %[p3] \n\t" - "precr.qb.ph %[prim4], %[p4], %[p3] \n\t" - - "precrq.qb.ph %[p5], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[p3], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[p6], %[p5], %[sec3] \n\t" - "precrq.ph.w %[p4], %[p3], %[sec4] \n\t" - "append %[p5], %[sec3], 16 \n\t" - "append %[p3], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [p6] "+r" (p6), [p5] "+r" (p5), [p4] "+r" (p4), [p3] "+r" (p3), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - /* if (p1 - p4 == 0) and (p2 - p3 == 0) - * mask will be zero and filtering is not needed - */ - if (!(((p1 - p4) == 0) && ((p2 - p3) == 0))) - { - - vp8_filter_mask_vec_mips(limit, flimit, p1, p2, pm1, p0, p3, p4, p5, p6, - thresh, &hev, &mask); - - /* if mask == 0 do filtering is not needed */ - if (mask) - { - /* filtering */ - vp8_filter_mips(mask, hev, &p1, &p2, &p3, &p4); - - /* unpack processed 4x4 neighborhood - * don't use transpose on output data - * because memory isn't aligned - */ - __asm__ __volatile__ ( - "sb %[p4], 1(%[s4]) \n\t" - "sb %[p3], 0(%[s4]) \n\t" - "sb %[p2], -1(%[s4]) \n\t" - "sb %[p1], -2(%[s4]) \n\t" - : - : [p4] "r" (p4), [p3] "r" (p3), [s4] "r" (s4), - [p2] "r" (p2), [p1] "r" (p1) - ); - - __asm__ __volatile__ ( - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - : [p4] "+r" (p4), [p3] "+r" (p3), [p2] "+r" (p2), [p1] "+r" (p1) - : - ); - - __asm__ __volatile__ ( - "sb %[p4], 1(%[s3]) \n\t" - "sb %[p3], 0(%[s3]) \n\t" - "sb %[p2], -1(%[s3]) \n\t" - "sb %[p1], -2(%[s3]) \n\t" - : [p1] "+r" (p1) - : [p4] "r" (p4), [p3] "r" (p3), [s3] "r" (s3), [p2] "r" (p2) - ); - - __asm__ __volatile__ ( - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - : [p4] "+r" (p4), [p3] "+r" (p3), [p2] "+r" (p2), [p1] "+r" (p1) - : - ); - - __asm__ __volatile__ ( - "sb %[p4], 1(%[s2]) \n\t" - "sb %[p3], 0(%[s2]) \n\t" - "sb %[p2], -1(%[s2]) \n\t" - "sb %[p1], -2(%[s2]) \n\t" - : - : [p4] "r" (p4), [p3] "r" (p3), [s2] "r" (s2), - [p2] "r" (p2), [p1] "r" (p1) - ); - - __asm__ __volatile__ ( - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - : [p4] "+r" (p4), [p3] "+r" (p3), [p2] "+r" (p2), [p1] "+r" (p1) - : - ); - - __asm__ __volatile__ ( - "sb %[p4], 1(%[s1]) \n\t" - "sb %[p3], 0(%[s1]) \n\t" - "sb %[p2], -1(%[s1]) \n\t" - "sb %[p1], -2(%[s1]) \n\t" - : - : [p4] "r" (p4), [p3] "r" (p3), [s1] "r" (s1), - [p2] "r" (p2), [p1] "r" (p1) - ); - } - } -} - -/* inputs & outputs are quad-byte vectors */ -static __inline void vp8_mbfilter_mips -( - uint32_t mask, - uint32_t hev, - uint32_t *ps2, - uint32_t *ps1, - uint32_t *ps0, - uint32_t *qs0, - uint32_t *qs1, - uint32_t *qs2 -) -{ - int32_t vps2, vps1, vps0, vqs0, vqs1, vqs2; - int32_t vps2_l, vps1_l, vps0_l, vqs0_l, vqs1_l, vqs2_l; - int32_t vps2_r, vps1_r, vps0_r, vqs0_r, vqs1_r, vqs2_r; - uint32_t HWM, vp8_filter_l, vp8_filter_r, mask_l, mask_r, hev_l, hev_r, subr_r, subr_l; - uint32_t Filter2_l, Filter2_r, t1, t2, Filter1_l, Filter1_r, invhev_l, invhev_r; - uint32_t N128, R63; - uint32_t u1_l, u1_r, u2_l, u2_r, u3_l, u3_r; - - R63 = 0x003F003F; - HWM = 0xFF00FF00; - N128 = 0x80808080; - t1 = 0x03000300; - t2 = 0x04000400; - - vps0 = (*ps0) ^ N128; - vps1 = (*ps1) ^ N128; - vps2 = (*ps2) ^ N128; - vqs0 = (*qs0) ^ N128; - vqs1 = (*qs1) ^ N128; - vqs2 = (*qs2) ^ N128; - - /* use halfword pairs instead quad-bytes because of accuracy */ - vps0_l = vps0 & HWM; - vps0_r = vps0 << 8; - vps0_r = vps0_r & HWM; - - vqs0_l = vqs0 & HWM; - vqs0_r = vqs0 << 8; - vqs0_r = vqs0_r & HWM; - - vps1_l = vps1 & HWM; - vps1_r = vps1 << 8; - vps1_r = vps1_r & HWM; - - vqs1_l = vqs1 & HWM; - vqs1_r = vqs1 << 8; - vqs1_r = vqs1_r & HWM; - - vqs2_l = vqs2 & HWM; - vqs2_r = vqs2 << 8; - vqs2_r = vqs2_r & HWM; - - __asm__ __volatile__ ( - /* qs0 - ps0 */ - "subq_s.ph %[subr_l], %[vqs0_l], %[vps0_l] \n\t" - "subq_s.ph %[subr_r], %[vqs0_r], %[vps0_r] \n\t" - - /* vp8_filter = vp8_signed_char_clamp(ps1 - qs1); */ - "subq_s.ph %[vp8_filter_l], %[vps1_l], %[vqs1_l] \n\t" - "subq_s.ph %[vp8_filter_r], %[vps1_r], %[vqs1_r] \n\t" - - : [vp8_filter_l] "=&r" (vp8_filter_l), [vp8_filter_r] "=r" (vp8_filter_r), - [subr_l] "=&r" (subr_l), [subr_r] "=&r" (subr_r) - : [vps0_l] "r" (vps0_l), [vps0_r] "r" (vps0_r), [vps1_l] "r" (vps1_l), - [vps1_r] "r" (vps1_r), [vqs0_l] "r" (vqs0_l), [vqs0_r] "r" (vqs0_r), - [vqs1_l] "r" (vqs1_l), [vqs1_r] "r" (vqs1_r) - ); - - vps2_l = vps2 & HWM; - vps2_r = vps2 << 8; - vps2_r = vps2_r & HWM; - - /* add outer taps if we have high edge variance */ - __asm__ __volatile__ ( - /* vp8_filter = vp8_signed_char_clamp(vp8_filter + 3 * (qs0 - ps0)); */ - "addq_s.ph %[vp8_filter_l], %[vp8_filter_l], %[subr_l] \n\t" - "addq_s.ph %[vp8_filter_r], %[vp8_filter_r], %[subr_r] \n\t" - "and %[mask_l], %[HWM], %[mask] \n\t" - "sll %[mask_r], %[mask], 8 \n\t" - "and %[mask_r], %[HWM], %[mask_r] \n\t" - "addq_s.ph %[vp8_filter_l], %[vp8_filter_l], %[subr_l] \n\t" - "addq_s.ph %[vp8_filter_r], %[vp8_filter_r], %[subr_r] \n\t" - "and %[hev_l], %[HWM], %[hev] \n\t" - "sll %[hev_r], %[hev], 8 \n\t" - "and %[hev_r], %[HWM], %[hev_r] \n\t" - "addq_s.ph %[vp8_filter_l], %[vp8_filter_l], %[subr_l] \n\t" - "addq_s.ph %[vp8_filter_r], %[vp8_filter_r], %[subr_r] \n\t" - - /* vp8_filter &= mask; */ - "and %[vp8_filter_l], %[vp8_filter_l], %[mask_l] \n\t" - "and %[vp8_filter_r], %[vp8_filter_r], %[mask_r] \n\t" - - /* Filter2 = vp8_filter & hev; */ - "and %[Filter2_l], %[vp8_filter_l], %[hev_l] \n\t" - "and %[Filter2_r], %[vp8_filter_r], %[hev_r] \n\t" - - : [vp8_filter_l] "+r" (vp8_filter_l), [vp8_filter_r] "+r" (vp8_filter_r), - [hev_l] "=&r" (hev_l), [hev_r] "=&r" (hev_r), - [mask_l] "=&r" (mask_l), [mask_r] "=&r" (mask_r), - [Filter2_l] "=&r" (Filter2_l), [Filter2_r] "=&r" (Filter2_r) - : [subr_l] "r" (subr_l), [subr_r] "r" (subr_r), - [HWM] "r" (HWM), [hev] "r" (hev), [mask] "r" (mask) - ); - - /* save bottom 3 bits so that we round one side +4 and the other +3 */ - __asm__ __volatile__ ( - /* Filter1 = vp8_signed_char_clamp(Filter2 + 4) >>= 3; */ - "addq_s.ph %[Filter1_l], %[Filter2_l], %[t2] \n\t" - "xor %[invhev_l], %[hev_l], %[HWM] \n\t" - "addq_s.ph %[Filter1_r], %[Filter2_r], %[t2] \n\t" - - /* Filter2 = vp8_signed_char_clamp(Filter2 + 3) >>= 3; */ - "addq_s.ph %[Filter2_l], %[Filter2_l], %[t1] \n\t" - "addq_s.ph %[Filter2_r], %[Filter2_r], %[t1] \n\t" - - "shra.ph %[Filter1_l], %[Filter1_l], 3 \n\t" - "shra.ph %[Filter1_r], %[Filter1_r], 3 \n\t" - - "shra.ph %[Filter2_l], %[Filter2_l], 3 \n\t" - "shra.ph %[Filter2_r], %[Filter2_r], 3 \n\t" - "and %[Filter1_l], %[Filter1_l], %[HWM] \n\t" - "and %[Filter1_r], %[Filter1_r], %[HWM] \n\t" - "xor %[invhev_r], %[hev_r], %[HWM] \n\t" - - /* qs0 = vp8_signed_char_clamp(qs0 - Filter1); */ - "subq_s.ph %[vqs0_l], %[vqs0_l], %[Filter1_l] \n\t" - "subq_s.ph %[vqs0_r], %[vqs0_r], %[Filter1_r] \n\t" - - /* ps0 = vp8_signed_char_clamp(ps0 + Filter2); */ - "addq_s.ph %[vps0_l], %[vps0_l], %[Filter2_l] \n\t" - "addq_s.ph %[vps0_r], %[vps0_r], %[Filter2_r] \n\t" - - : [invhev_l] "=&r" (invhev_l), [invhev_r] "=&r" (invhev_r), - [Filter1_l] "=&r" (Filter1_l), [Filter1_r] "=&r" (Filter1_r), - [Filter2_l] "+r" (Filter2_l), [Filter2_r] "+r" (Filter2_r), - [vps0_l] "+r" (vps0_l), [vps0_r] "+r" (vps0_r), - [vqs0_l] "+r" (vqs0_l), [vqs0_r] "+r" (vqs0_r) - : [t1] "r" (t1), [t2] "r" (t2), [HWM] "r" (HWM), - [hev_l] "r" (hev_l), [hev_r] "r" (hev_r) - ); - - /* only apply wider filter if not high edge variance */ - __asm__ __volatile__ ( - /* vp8_filter &= ~hev; */ - "and %[Filter2_l], %[vp8_filter_l], %[invhev_l] \n\t" - "and %[Filter2_r], %[vp8_filter_r], %[invhev_r] \n\t" - - "shra.ph %[Filter2_l], %[Filter2_l], 8 \n\t" - "shra.ph %[Filter2_r], %[Filter2_r], 8 \n\t" - - : [Filter2_l] "=&r" (Filter2_l), [Filter2_r] "=&r" (Filter2_r) - : [vp8_filter_l] "r" (vp8_filter_l), [vp8_filter_r] "r" (vp8_filter_r), - [invhev_l] "r" (invhev_l), [invhev_r] "r" (invhev_r) - ); - - /* roughly 3/7th difference across boundary */ - __asm__ __volatile__ ( - "shll.ph %[u3_l], %[Filter2_l], 3 \n\t" - "shll.ph %[u3_r], %[Filter2_r], 3 \n\t" - - "addq.ph %[u3_l], %[u3_l], %[Filter2_l] \n\t" - "addq.ph %[u3_r], %[u3_r], %[Filter2_r] \n\t" - - "shll.ph %[u2_l], %[u3_l], 1 \n\t" - "shll.ph %[u2_r], %[u3_r], 1 \n\t" - - "addq.ph %[u1_l], %[u3_l], %[u2_l] \n\t" - "addq.ph %[u1_r], %[u3_r], %[u2_r] \n\t" - - "addq.ph %[u2_l], %[u2_l], %[R63] \n\t" - "addq.ph %[u2_r], %[u2_r], %[R63] \n\t" - - "addq.ph %[u3_l], %[u3_l], %[R63] \n\t" - "addq.ph %[u3_r], %[u3_r], %[R63] \n\t" - - /* vp8_signed_char_clamp((63 + Filter2 * 27) >> 7) - * vp8_signed_char_clamp((63 + Filter2 * 18) >> 7) - */ - "addq.ph %[u1_l], %[u1_l], %[R63] \n\t" - "addq.ph %[u1_r], %[u1_r], %[R63] \n\t" - "shra.ph %[u1_l], %[u1_l], 7 \n\t" - "shra.ph %[u1_r], %[u1_r], 7 \n\t" - "shra.ph %[u2_l], %[u2_l], 7 \n\t" - "shra.ph %[u2_r], %[u2_r], 7 \n\t" - "shll.ph %[u1_l], %[u1_l], 8 \n\t" - "shll.ph %[u1_r], %[u1_r], 8 \n\t" - "shll.ph %[u2_l], %[u2_l], 8 \n\t" - "shll.ph %[u2_r], %[u2_r], 8 \n\t" - - /* vqs0 = vp8_signed_char_clamp(qs0 - u); */ - "subq_s.ph %[vqs0_l], %[vqs0_l], %[u1_l] \n\t" - "subq_s.ph %[vqs0_r], %[vqs0_r], %[u1_r] \n\t" - - /* vps0 = vp8_signed_char_clamp(ps0 + u); */ - "addq_s.ph %[vps0_l], %[vps0_l], %[u1_l] \n\t" - "addq_s.ph %[vps0_r], %[vps0_r], %[u1_r] \n\t" - - : [u1_l] "=&r" (u1_l), [u1_r] "=&r" (u1_r), [u2_l] "=&r" (u2_l), - [u2_r] "=&r" (u2_r), [u3_l] "=&r" (u3_l), [u3_r] "=&r" (u3_r), - [vps0_l] "+r" (vps0_l), [vps0_r] "+r" (vps0_r), - [vqs0_l] "+r" (vqs0_l), [vqs0_r] "+r" (vqs0_r) - : [R63] "r" (R63), - [Filter2_l] "r" (Filter2_l), [Filter2_r] "r" (Filter2_r) - ); - - __asm__ __volatile__ ( - /* vqs1 = vp8_signed_char_clamp(qs1 - u); */ - "subq_s.ph %[vqs1_l], %[vqs1_l], %[u2_l] \n\t" - "addq_s.ph %[vps1_l], %[vps1_l], %[u2_l] \n\t" - - /* vps1 = vp8_signed_char_clamp(ps1 + u); */ - "addq_s.ph %[vps1_r], %[vps1_r], %[u2_r] \n\t" - "subq_s.ph %[vqs1_r], %[vqs1_r], %[u2_r] \n\t" - - : [vps1_l] "+r" (vps1_l), [vps1_r] "+r" (vps1_r), - [vqs1_l] "+r" (vqs1_l), [vqs1_r] "+r" (vqs1_r) - : [u2_l] "r" (u2_l), [u2_r] "r" (u2_r) - ); - - /* roughly 1/7th difference across boundary */ - __asm__ __volatile__ ( - /* u = vp8_signed_char_clamp((63 + Filter2 * 9) >> 7); */ - "shra.ph %[u3_l], %[u3_l], 7 \n\t" - "shra.ph %[u3_r], %[u3_r], 7 \n\t" - "shll.ph %[u3_l], %[u3_l], 8 \n\t" - "shll.ph %[u3_r], %[u3_r], 8 \n\t" - - /* vqs2 = vp8_signed_char_clamp(qs2 - u); */ - "subq_s.ph %[vqs2_l], %[vqs2_l], %[u3_l] \n\t" - "subq_s.ph %[vqs2_r], %[vqs2_r], %[u3_r] \n\t" - - /* vps2 = vp8_signed_char_clamp(ps2 + u); */ - "addq_s.ph %[vps2_l], %[vps2_l], %[u3_l] \n\t" - "addq_s.ph %[vps2_r], %[vps2_r], %[u3_r] \n\t" - - : [u3_l] "+r" (u3_l), [u3_r] "+r" (u3_r), [vps2_l] "+r" (vps2_l), - [vps2_r] "+r" (vps2_r), [vqs2_l] "+r" (vqs2_l), [vqs2_r] "+r" (vqs2_r) - : - ); - - /* Create quad-bytes from halfword pairs */ - __asm__ __volatile__ ( - "and %[vqs0_l], %[vqs0_l], %[HWM] \n\t" - "shrl.ph %[vqs0_r], %[vqs0_r], 8 \n\t" - - "and %[vps0_l], %[vps0_l], %[HWM] \n\t" - "shrl.ph %[vps0_r], %[vps0_r], 8 \n\t" - - "and %[vqs1_l], %[vqs1_l], %[HWM] \n\t" - "shrl.ph %[vqs1_r], %[vqs1_r], 8 \n\t" - - "and %[vps1_l], %[vps1_l], %[HWM] \n\t" - "shrl.ph %[vps1_r], %[vps1_r], 8 \n\t" - - "and %[vqs2_l], %[vqs2_l], %[HWM] \n\t" - "shrl.ph %[vqs2_r], %[vqs2_r], 8 \n\t" - - "and %[vps2_l], %[vps2_l], %[HWM] \n\t" - "shrl.ph %[vps2_r], %[vps2_r], 8 \n\t" - - "or %[vqs0_r], %[vqs0_l], %[vqs0_r] \n\t" - "or %[vps0_r], %[vps0_l], %[vps0_r] \n\t" - "or %[vqs1_r], %[vqs1_l], %[vqs1_r] \n\t" - "or %[vps1_r], %[vps1_l], %[vps1_r] \n\t" - "or %[vqs2_r], %[vqs2_l], %[vqs2_r] \n\t" - "or %[vps2_r], %[vps2_l], %[vps2_r] \n\t" - - : [vps1_l] "+r" (vps1_l), [vps1_r] "+r" (vps1_r), [vqs1_l] "+r" (vqs1_l), - [vqs1_r] "+r" (vqs1_r), [vps0_l] "+r" (vps0_l), [vps0_r] "+r" (vps0_r), - [vqs0_l] "+r" (vqs0_l), [vqs0_r] "+r" (vqs0_r), [vqs2_l] "+r" (vqs2_l), - [vqs2_r] "+r" (vqs2_r), [vps2_r] "+r" (vps2_r), [vps2_l] "+r" (vps2_l) - : [HWM] "r" (HWM) - ); - - *ps0 = vps0_r ^ N128; - *ps1 = vps1_r ^ N128; - *ps2 = vps2_r ^ N128; - *qs0 = vqs0_r ^ N128; - *qs1 = vqs1_r ^ N128; - *qs2 = vqs2_r ^ N128; -} - -void vp8_mbloop_filter_horizontal_edge_mips -( - unsigned char *s, - int p, - unsigned int flimit, - unsigned int limit, - unsigned int thresh, - int count -) -{ - int i; - uint32_t mask, hev; - uint32_t pm1, p0, p1, p2, p3, p4, p5, p6; - unsigned char *sm1, *s0, *s1, *s2, *s3, *s4, *s5, *s6; - - mask = 0; - hev = 0; - i = 0; - p1 = 0; - p2 = 0; - p3 = 0; - p4 = 0; - - /* loop filter designed to work using chars so that we can make maximum use - * of 8 bit simd instructions. - */ - - sm1 = s - (p << 2); - s0 = s - p - p - p; - s1 = s - p - p; - s2 = s - p; - s3 = s; - s4 = s + p; - s5 = s + p + p; - s6 = s + p + p + p; - - /* prefetch data for load */ - prefetch_load_lf(s + p); - - /* apply filter on 4 pixesl at the same time */ - do - { - /* load quad-byte vectors - * memory is 4 byte aligned - */ - p1 = *((uint32_t *)(s1)); - p2 = *((uint32_t *)(s2)); - p3 = *((uint32_t *)(s3)); - p4 = *((uint32_t *)(s4)); - - /* if (p1 - p4 == 0) and (p2 - p3 == 0) - * mask will be zero and filtering is not needed - */ - if (!(((p1 - p4) == 0) && ((p2 - p3) == 0))) - { - - pm1 = *((uint32_t *)(sm1)); - p0 = *((uint32_t *)(s0)); - p5 = *((uint32_t *)(s5)); - p6 = *((uint32_t *)(s6)); - - vp8_filter_mask_vec_mips(limit, flimit, p1, p2, pm1, p0, p3, p4, p5, p6, - thresh, &hev, &mask); - - /* if mask == 0 do filtering is not needed */ - if (mask) - { - /* filtering */ - vp8_mbfilter_mips(mask, hev, &p0, &p1, &p2, &p3, &p4, &p5); - - /* unpack processed 4x4 neighborhood - * memory is 4 byte aligned - */ - *((uint32_t *)s0) = p0; - *((uint32_t *)s1) = p1; - *((uint32_t *)s2) = p2; - *((uint32_t *)s3) = p3; - *((uint32_t *)s4) = p4; - *((uint32_t *)s5) = p5; - } - } - - sm1 += 4; - s0 += 4; - s1 += 4; - s2 += 4; - s3 += 4; - s4 += 4; - s5 += 4; - s6 += 4; - - /* load quad-byte vectors - * memory is 4 byte aligned - */ - p1 = *((uint32_t *)(s1)); - p2 = *((uint32_t *)(s2)); - p3 = *((uint32_t *)(s3)); - p4 = *((uint32_t *)(s4)); - - /* if (p1 - p4 == 0) and (p2 - p3 == 0) - * mask will be zero and filtering is not needed - */ - if (!(((p1 - p4) == 0) && ((p2 - p3) == 0))) - { - - pm1 = *((uint32_t *)(sm1)); - p0 = *((uint32_t *)(s0)); - p5 = *((uint32_t *)(s5)); - p6 = *((uint32_t *)(s6)); - - vp8_filter_mask_vec_mips(limit, flimit, p1, p2, pm1, p0, p3, p4, p5, p6, - thresh, &hev, &mask); - - /* if mask == 0 do filtering is not needed */ - if (mask) - { - /* filtering */ - vp8_mbfilter_mips(mask, hev, &p0, &p1, &p2, &p3, &p4, &p5); - - /* unpack processed 4x4 neighborhood - * memory is 4 byte aligned - */ - *((uint32_t *)s0) = p0; - *((uint32_t *)s1) = p1; - *((uint32_t *)s2) = p2; - *((uint32_t *)s3) = p3; - *((uint32_t *)s4) = p4; - *((uint32_t *)s5) = p5; - } - } - - sm1 += 4; - s0 += 4; - s1 += 4; - s2 += 4; - s3 += 4; - s4 += 4; - s5 += 4; - s6 += 4; - - i += 8; - } - - while (i < count); -} - -void vp8_mbloop_filter_uvhorizontal_edge_mips -( - unsigned char *s, - int p, - unsigned int flimit, - unsigned int limit, - unsigned int thresh, - int count -) -{ - uint32_t mask, hev; - uint32_t pm1, p0, p1, p2, p3, p4, p5, p6; - unsigned char *sm1, *s0, *s1, *s2, *s3, *s4, *s5, *s6; - - mask = 0; - hev = 0; - p1 = 0; - p2 = 0; - p3 = 0; - p4 = 0; - - /* loop filter designed to work using chars so that we can make maximum use - * of 8 bit simd instructions. - */ - - sm1 = s - (p << 2); - s0 = s - p - p - p; - s1 = s - p - p; - s2 = s - p; - s3 = s; - s4 = s + p; - s5 = s + p + p; - s6 = s + p + p + p; - - /* load quad-byte vectors - * memory is 4 byte aligned - */ - p1 = *((uint32_t *)(s1)); - p2 = *((uint32_t *)(s2)); - p3 = *((uint32_t *)(s3)); - p4 = *((uint32_t *)(s4)); - - /* if (p1 - p4 == 0) and (p2 - p3 == 0) - * mask will be zero and filtering is not needed - */ - if (!(((p1 - p4) == 0) && ((p2 - p3) == 0))) - { - - pm1 = *((uint32_t *)(sm1)); - p0 = *((uint32_t *)(s0)); - p5 = *((uint32_t *)(s5)); - p6 = *((uint32_t *)(s6)); - - /* if mask == 0 do filtering is not needed */ - vp8_filter_mask_vec_mips(limit, flimit, p1, p2, pm1, p0, p3, p4, p5, p6, - thresh, &hev, &mask); - - if (mask) - { - /* filtering */ - vp8_mbfilter_mips(mask, hev, &p0, &p1, &p2, &p3, &p4, &p5); - - /* unpack processed 4x4 neighborhood - * memory is 4 byte aligned - */ - *((uint32_t *)s0) = p0; - *((uint32_t *)s1) = p1; - *((uint32_t *)s2) = p2; - *((uint32_t *)s3) = p3; - *((uint32_t *)s4) = p4; - *((uint32_t *)s5) = p5; - } - } - - sm1 += 4; - s0 += 4; - s1 += 4; - s2 += 4; - s3 += 4; - s4 += 4; - s5 += 4; - s6 += 4; - - /* load quad-byte vectors - * memory is 4 byte aligned - */ - p1 = *((uint32_t *)(s1)); - p2 = *((uint32_t *)(s2)); - p3 = *((uint32_t *)(s3)); - p4 = *((uint32_t *)(s4)); - - /* if (p1 - p4 == 0) and (p2 - p3 == 0) - * mask will be zero and filtering is not needed - */ - if (!(((p1 - p4) == 0) && ((p2 - p3) == 0))) - { - - pm1 = *((uint32_t *)(sm1)); - p0 = *((uint32_t *)(s0)); - p5 = *((uint32_t *)(s5)); - p6 = *((uint32_t *)(s6)); - - vp8_filter_mask_vec_mips(limit, flimit, p1, p2, pm1, p0, p3, p4, p5, p6, - thresh, &hev, &mask); - - /* if mask == 0 do filtering is not needed */ - if (mask) - { - /* filtering */ - vp8_mbfilter_mips(mask, hev, &p0, &p1, &p2, &p3, &p4, &p5); - - /* unpack processed 4x4 neighborhood - * memory is 4 byte aligned - */ - *((uint32_t *)s0) = p0; - *((uint32_t *)s1) = p1; - *((uint32_t *)s2) = p2; - *((uint32_t *)s3) = p3; - *((uint32_t *)s4) = p4; - *((uint32_t *)s5) = p5; - } - } -} - - -void vp8_mbloop_filter_vertical_edge_mips -( - unsigned char *s, - int p, - unsigned int flimit, - unsigned int limit, - unsigned int thresh, - int count -) -{ - - int i; - uint32_t mask, hev; - uint32_t pm1, p0, p1, p2, p3, p4, p5, p6; - unsigned char *s1, *s2, *s3, *s4; - uint32_t prim1, prim2, sec3, sec4, prim3, prim4; - - mask = 0; - hev = 0; - i = 0; - pm1 = 0; - p0 = 0; - p1 = 0; - p2 = 0; - p3 = 0; - p4 = 0; - p5 = 0; - p6 = 0; - - /* loop filter designed to work using chars so that we can make maximum use - * of 8 bit simd instructions. - */ - - /* apply filter on 4 pixesl at the same time */ - do - { - s1 = s; - s2 = s + p; - s3 = s2 + p; - s4 = s3 + p; - s = s4 + p; - - /* load quad-byte vectors - * memory is 4 byte aligned - */ - p2 = *((uint32_t *)(s1 - 4)); - p6 = *((uint32_t *)(s1)); - p1 = *((uint32_t *)(s2 - 4)); - p5 = *((uint32_t *)(s2)); - p0 = *((uint32_t *)(s3 - 4)); - p4 = *((uint32_t *)(s3)); - pm1 = *((uint32_t *)(s4 - 4)); - p3 = *((uint32_t *)(s4)); - - /* transpose pm1, p0, p1, p2 */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[p2], %[p1] \n\t" - "precr.qb.ph %[prim2], %[p2], %[p1] \n\t" - "precrq.qb.ph %[prim3], %[p0], %[pm1] \n\t" - "precr.qb.ph %[prim4], %[p0], %[pm1] \n\t" - - "precrq.qb.ph %[p1], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[pm1], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[p2], %[p1], %[sec3] \n\t" - "precrq.ph.w %[p0], %[pm1], %[sec4] \n\t" - "append %[p1], %[sec3], 16 \n\t" - "append %[pm1], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [p2] "+r" (p2), [p1] "+r" (p1), [p0] "+r" (p0), [pm1] "+r" (pm1), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - /* transpose p3, p4, p5, p6 */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[p6], %[p5] \n\t" - "precr.qb.ph %[prim2], %[p6], %[p5] \n\t" - "precrq.qb.ph %[prim3], %[p4], %[p3] \n\t" - "precr.qb.ph %[prim4], %[p4], %[p3] \n\t" - - "precrq.qb.ph %[p5], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[p3], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[p6], %[p5], %[sec3] \n\t" - "precrq.ph.w %[p4], %[p3], %[sec4] \n\t" - "append %[p5], %[sec3], 16 \n\t" - "append %[p3], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [p6] "+r" (p6), [p5] "+r" (p5), [p4] "+r" (p4), [p3] "+r" (p3), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - /* if (p1 - p4 == 0) and (p2 - p3 == 0) - * mask will be zero and filtering is not needed - */ - if (!(((p1 - p4) == 0) && ((p2 - p3) == 0))) - { - - vp8_filter_mask_vec_mips(limit, flimit, p1, p2, pm1, p0, p3, p4, p5, p6, - thresh, &hev, &mask); - - /* if mask == 0 do filtering is not needed */ - if (mask) - { - /* filtering */ - vp8_mbfilter_mips(mask, hev, &p0, &p1, &p2, &p3, &p4, &p5); - - /* don't use transpose on output data - * because memory isn't aligned - */ - __asm__ __volatile__ ( - "sb %[p5], 2(%[s4]) \n\t" - "sb %[p4], 1(%[s4]) \n\t" - "sb %[p3], 0(%[s4]) \n\t" - "sb %[p2], -1(%[s4]) \n\t" - "sb %[p1], -2(%[s4]) \n\t" - "sb %[p0], -3(%[s4]) \n\t" - : - : [p5] "r" (p5), [p4] "r" (p4), [p3] "r" (p3), [s4] "r" (s4), - [p2] "r" (p2), [p1] "r" (p1), [p0] "r" (p0) - ); - - __asm__ __volatile__ ( - "srl %[p5], %[p5], 8 \n\t" - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - "srl %[p0], %[p0], 8 \n\t" - : [p5] "+r" (p5), [p4] "+r" (p4), [p3] "+r" (p3), - [p2] "+r" (p2), [p1] "+r" (p1), [p0] "+r" (p0) - : - ); - - __asm__ __volatile__ ( - "sb %[p5], 2(%[s3]) \n\t" - "sb %[p4], 1(%[s3]) \n\t" - "sb %[p3], 0(%[s3]) \n\t" - "sb %[p2], -1(%[s3]) \n\t" - "sb %[p1], -2(%[s3]) \n\t" - "sb %[p0], -3(%[s3]) \n\t" - : - : [p5] "r" (p5), [p4] "r" (p4), [p3] "r" (p3), [s3] "r" (s3), - [p2] "r" (p2), [p1] "r" (p1), [p0] "r" (p0) - ); - - __asm__ __volatile__ ( - "srl %[p5], %[p5], 8 \n\t" - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - "srl %[p0], %[p0], 8 \n\t" - : [p5] "+r" (p5), [p4] "+r" (p4), [p3] "+r" (p3), - [p2] "+r" (p2), [p1] "+r" (p1), [p0] "+r" (p0) - : - ); - - __asm__ __volatile__ ( - "sb %[p5], 2(%[s2]) \n\t" - "sb %[p4], 1(%[s2]) \n\t" - "sb %[p3], 0(%[s2]) \n\t" - "sb %[p2], -1(%[s2]) \n\t" - "sb %[p1], -2(%[s2]) \n\t" - "sb %[p0], -3(%[s2]) \n\t" - : - : [p5] "r" (p5), [p4] "r" (p4), [p3] "r" (p3), [s2] "r" (s2), - [p2] "r" (p2), [p1] "r" (p1), [p0] "r" (p0) - ); - - __asm__ __volatile__ ( - "srl %[p5], %[p5], 8 \n\t" - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - "srl %[p0], %[p0], 8 \n\t" - : [p5] "+r" (p5), [p4] "+r" (p4), [p3] "+r" (p3), - [p2] "+r" (p2), [p1] "+r" (p1), [p0] "+r" (p0) - : - ); - - __asm__ __volatile__ ( - "sb %[p5], 2(%[s1]) \n\t" - "sb %[p4], 1(%[s1]) \n\t" - "sb %[p3], 0(%[s1]) \n\t" - "sb %[p2], -1(%[s1]) \n\t" - "sb %[p1], -2(%[s1]) \n\t" - "sb %[p0], -3(%[s1]) \n\t" - : - : [p5] "r" (p5), [p4] "r" (p4), [p3] "r" (p3), [s1] "r" (s1), - [p2] "r" (p2), [p1] "r" (p1), [p0] "r" (p0) - ); - } - } - - i += 4; - } - - while (i < count); -} - -void vp8_mbloop_filter_uvvertical_edge_mips -( - unsigned char *s, - int p, - unsigned int flimit, - unsigned int limit, - unsigned int thresh, - int count -) -{ - uint32_t mask, hev; - uint32_t pm1, p0, p1, p2, p3, p4, p5, p6; - unsigned char *s1, *s2, *s3, *s4; - uint32_t prim1, prim2, sec3, sec4, prim3, prim4; - - mask = 0; - hev = 0; - pm1 = 0; - p0 = 0; - p1 = 0; - p2 = 0; - p3 = 0; - p4 = 0; - p5 = 0; - p6 = 0; - - /* loop filter designed to work using chars so that we can make maximum use - * of 8 bit simd instructions. - */ - - /* apply filter on 4 pixesl at the same time */ - - s1 = s; - s2 = s + p; - s3 = s2 + p; - s4 = s3 + p; - - /* prefetch data for load */ - prefetch_load_lf(s + 2 * p); - - /* load quad-byte vectors - * memory is 4 byte aligned - */ - p2 = *((uint32_t *)(s1 - 4)); - p6 = *((uint32_t *)(s1)); - p1 = *((uint32_t *)(s2 - 4)); - p5 = *((uint32_t *)(s2)); - p0 = *((uint32_t *)(s3 - 4)); - p4 = *((uint32_t *)(s3)); - pm1 = *((uint32_t *)(s4 - 4)); - p3 = *((uint32_t *)(s4)); - - /* transpose pm1, p0, p1, p2 */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[p2], %[p1] \n\t" - "precr.qb.ph %[prim2], %[p2], %[p1] \n\t" - "precrq.qb.ph %[prim3], %[p0], %[pm1] \n\t" - "precr.qb.ph %[prim4], %[p0], %[pm1] \n\t" - - "precrq.qb.ph %[p1], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[pm1], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[p2], %[p1], %[sec3] \n\t" - "precrq.ph.w %[p0], %[pm1], %[sec4] \n\t" - "append %[p1], %[sec3], 16 \n\t" - "append %[pm1], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [p2] "+r" (p2), [p1] "+r" (p1), [p0] "+r" (p0), [pm1] "+r" (pm1), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - /* transpose p3, p4, p5, p6 */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[p6], %[p5] \n\t" - "precr.qb.ph %[prim2], %[p6], %[p5] \n\t" - "precrq.qb.ph %[prim3], %[p4], %[p3] \n\t" - "precr.qb.ph %[prim4], %[p4], %[p3] \n\t" - - "precrq.qb.ph %[p5], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[p3], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[p6], %[p5], %[sec3] \n\t" - "precrq.ph.w %[p4], %[p3], %[sec4] \n\t" - "append %[p5], %[sec3], 16 \n\t" - "append %[p3], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [p6] "+r" (p6), [p5] "+r" (p5), [p4] "+r" (p4), [p3] "+r" (p3), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - /* if (p1 - p4 == 0) and (p2 - p3 == 0) - * mask will be zero and filtering is not needed - */ - if (!(((p1 - p4) == 0) && ((p2 - p3) == 0))) - { - - vp8_filter_mask_vec_mips(limit, flimit, p1, p2, pm1, p0, p3, p4, p5, p6, - thresh, &hev, &mask); - - /* if mask == 0 do filtering is not needed */ - if (mask) - { - /* filtering */ - vp8_mbfilter_mips(mask, hev, &p0, &p1, &p2, &p3, &p4, &p5); - - /* don't use transpose on output data - * because memory isn't aligned - */ - __asm__ __volatile__ ( - "sb %[p5], 2(%[s4]) \n\t" - "sb %[p4], 1(%[s4]) \n\t" - "sb %[p3], 0(%[s4]) \n\t" - "sb %[p2], -1(%[s4]) \n\t" - "sb %[p1], -2(%[s4]) \n\t" - "sb %[p0], -3(%[s4]) \n\t" - : - : [p5] "r" (p5), [p4] "r" (p4), [p3] "r" (p3), [s4] "r" (s4), - [p2] "r" (p2), [p1] "r" (p1), [p0] "r" (p0) - ); - - __asm__ __volatile__ ( - "srl %[p5], %[p5], 8 \n\t" - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - "srl %[p0], %[p0], 8 \n\t" - : [p5] "+r" (p5), [p4] "+r" (p4), [p3] "+r" (p3), - [p2] "+r" (p2), [p1] "+r" (p1), [p0] "+r" (p0) - : - ); - - __asm__ __volatile__ ( - "sb %[p5], 2(%[s3]) \n\t" - "sb %[p4], 1(%[s3]) \n\t" - "sb %[p3], 0(%[s3]) \n\t" - "sb %[p2], -1(%[s3]) \n\t" - "sb %[p1], -2(%[s3]) \n\t" - "sb %[p0], -3(%[s3]) \n\t" - : - : [p5] "r" (p5), [p4] "r" (p4), [p3] "r" (p3), [s3] "r" (s3), - [p2] "r" (p2), [p1] "r" (p1), [p0] "r" (p0) - ); - - __asm__ __volatile__ ( - "srl %[p5], %[p5], 8 \n\t" - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - "srl %[p0], %[p0], 8 \n\t" - : [p5] "+r" (p5), [p4] "+r" (p4), [p3] "+r" (p3), - [p2] "+r" (p2), [p1] "+r" (p1), [p0] "+r" (p0) - : - ); - - __asm__ __volatile__ ( - "sb %[p5], 2(%[s2]) \n\t" - "sb %[p4], 1(%[s2]) \n\t" - "sb %[p3], 0(%[s2]) \n\t" - "sb %[p2], -1(%[s2]) \n\t" - "sb %[p1], -2(%[s2]) \n\t" - "sb %[p0], -3(%[s2]) \n\t" - : - : [p5] "r" (p5), [p4] "r" (p4), [p3] "r" (p3), [s2] "r" (s2), - [p2] "r" (p2), [p1] "r" (p1), [p0] "r" (p0) - ); - - __asm__ __volatile__ ( - "srl %[p5], %[p5], 8 \n\t" - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - "srl %[p0], %[p0], 8 \n\t" - : [p5] "+r" (p5), [p4] "+r" (p4), [p3] "+r" (p3), - [p2] "+r" (p2), [p1] "+r" (p1), [p0] "+r" (p0) - : - ); - - __asm__ __volatile__ ( - "sb %[p5], 2(%[s1]) \n\t" - "sb %[p4], 1(%[s1]) \n\t" - "sb %[p3], 0(%[s1]) \n\t" - "sb %[p2], -1(%[s1]) \n\t" - "sb %[p1], -2(%[s1]) \n\t" - "sb %[p0], -3(%[s1]) \n\t" - : - : [p5] "r" (p5), [p4] "r" (p4), [p3] "r" (p3), [s1] "r" (s1), - [p2] "r" (p2), [p1] "r" (p1), [p0] "r" (p0) - ); - } - } - - s1 = s4 + p; - s2 = s1 + p; - s3 = s2 + p; - s4 = s3 + p; - - /* load quad-byte vectors - * memory is 4 byte aligned - */ - p2 = *((uint32_t *)(s1 - 4)); - p6 = *((uint32_t *)(s1)); - p1 = *((uint32_t *)(s2 - 4)); - p5 = *((uint32_t *)(s2)); - p0 = *((uint32_t *)(s3 - 4)); - p4 = *((uint32_t *)(s3)); - pm1 = *((uint32_t *)(s4 - 4)); - p3 = *((uint32_t *)(s4)); - - /* transpose pm1, p0, p1, p2 */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[p2], %[p1] \n\t" - "precr.qb.ph %[prim2], %[p2], %[p1] \n\t" - "precrq.qb.ph %[prim3], %[p0], %[pm1] \n\t" - "precr.qb.ph %[prim4], %[p0], %[pm1] \n\t" - - "precrq.qb.ph %[p1], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[pm1], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[p2], %[p1], %[sec3] \n\t" - "precrq.ph.w %[p0], %[pm1], %[sec4] \n\t" - "append %[p1], %[sec3], 16 \n\t" - "append %[pm1], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [p2] "+r" (p2), [p1] "+r" (p1), [p0] "+r" (p0), [pm1] "+r" (pm1), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - /* transpose p3, p4, p5, p6 */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[p6], %[p5] \n\t" - "precr.qb.ph %[prim2], %[p6], %[p5] \n\t" - "precrq.qb.ph %[prim3], %[p4], %[p3] \n\t" - "precr.qb.ph %[prim4], %[p4], %[p3] \n\t" - - "precrq.qb.ph %[p5], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[p3], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[p6], %[p5], %[sec3] \n\t" - "precrq.ph.w %[p4], %[p3], %[sec4] \n\t" - "append %[p5], %[sec3], 16 \n\t" - "append %[p3], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [p6] "+r" (p6), [p5] "+r" (p5), [p4] "+r" (p4), [p3] "+r" (p3), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - /* if (p1 - p4 == 0) and (p2 - p3 == 0) - * mask will be zero and filtering is not needed - */ - if (!(((p1 - p4) == 0) && ((p2 - p3) == 0))) - { - - vp8_filter_mask_vec_mips(limit, flimit, p1, p2, pm1, p0, p3, p4, p5, p6, thresh, &hev, &mask); - - /* if mask == 0 do filtering is not needed */ - if (mask) - { - /* filtering */ - vp8_mbfilter_mips(mask, hev, &p0, &p1, &p2, &p3, &p4, &p5); - - /* don't use transpose on output data - * because memory isn't aligned - */ - __asm__ __volatile__ ( - "sb %[p5], 2(%[s4]) \n\t" - "sb %[p4], 1(%[s4]) \n\t" - "sb %[p3], 0(%[s4]) \n\t" - "sb %[p2], -1(%[s4]) \n\t" - "sb %[p1], -2(%[s4]) \n\t" - "sb %[p0], -3(%[s4]) \n\t" - : - : [p5] "r" (p5), [p4] "r" (p4), [p3] "r" (p3), [s4] "r" (s4), - [p2] "r" (p2), [p1] "r" (p1), [p0] "r" (p0) - ); - - __asm__ __volatile__ ( - "srl %[p5], %[p5], 8 \n\t" - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - "srl %[p0], %[p0], 8 \n\t" - : [p5] "+r" (p5), [p4] "+r" (p4), [p3] "+r" (p3), - [p2] "+r" (p2), [p1] "+r" (p1), [p0] "+r" (p0) - : - ); - - __asm__ __volatile__ ( - "sb %[p5], 2(%[s3]) \n\t" - "sb %[p4], 1(%[s3]) \n\t" - "sb %[p3], 0(%[s3]) \n\t" - "sb %[p2], -1(%[s3]) \n\t" - "sb %[p1], -2(%[s3]) \n\t" - "sb %[p0], -3(%[s3]) \n\t" - : - : [p5] "r" (p5), [p4] "r" (p4), [p3] "r" (p3), [s3] "r" (s3), - [p2] "r" (p2), [p1] "r" (p1), [p0] "r" (p0) - ); - - __asm__ __volatile__ ( - "srl %[p5], %[p5], 8 \n\t" - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - "srl %[p0], %[p0], 8 \n\t" - : [p5] "+r" (p5), [p4] "+r" (p4), [p3] "+r" (p3), - [p2] "+r" (p2), [p1] "+r" (p1), [p0] "+r" (p0) - : - ); - - __asm__ __volatile__ ( - "sb %[p5], 2(%[s2]) \n\t" - "sb %[p4], 1(%[s2]) \n\t" - "sb %[p3], 0(%[s2]) \n\t" - "sb %[p2], -1(%[s2]) \n\t" - "sb %[p1], -2(%[s2]) \n\t" - "sb %[p0], -3(%[s2]) \n\t" - : - : [p5] "r" (p5), [p4] "r" (p4), [p3] "r" (p3), [s2] "r" (s2), - [p2] "r" (p2), [p1] "r" (p1), [p0] "r" (p0) - ); - - __asm__ __volatile__ ( - "srl %[p5], %[p5], 8 \n\t" - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - "srl %[p0], %[p0], 8 \n\t" - : [p5] "+r" (p5), [p4] "+r" (p4), [p3] "+r" (p3), - [p2] "+r" (p2), [p1] "+r" (p1), [p0] "+r" (p0) - : - ); - - __asm__ __volatile__ ( - "sb %[p5], 2(%[s1]) \n\t" - "sb %[p4], 1(%[s1]) \n\t" - "sb %[p3], 0(%[s1]) \n\t" - "sb %[p2], -1(%[s1]) \n\t" - "sb %[p1], -2(%[s1]) \n\t" - "sb %[p0], -3(%[s1]) \n\t" - : - : [p5] "r" (p5), [p4] "r" (p4), [p3] "r" (p3), [s1] "r" (s1), - [p2] "r" (p2), [p1] "r" (p1), [p0] "r" (p0) - ); - } - } -} - -/* Horizontal MB filtering */ -void vp8_loop_filter_mbh_dspr2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - unsigned int thresh_vec, flimit_vec, limit_vec; - unsigned char thresh, flimit, limit, flimit_temp; - - /* use direct value instead pointers */ - limit = *(lfi->lim); - flimit_temp = *(lfi->mblim); - thresh = *(lfi->hev_thr); - flimit = flimit_temp; - - /* create quad-byte */ - __asm__ __volatile__ ( - "replv.qb %[thresh_vec], %[thresh] \n\t" - "replv.qb %[flimit_vec], %[flimit] \n\t" - "replv.qb %[limit_vec], %[limit] \n\t" - : [thresh_vec] "=&r" (thresh_vec), [flimit_vec] "=&r" (flimit_vec), [limit_vec] "=r" (limit_vec) - : [thresh] "r" (thresh), [flimit] "r" (flimit), [limit] "r" (limit) - ); - - vp8_mbloop_filter_horizontal_edge_mips(y_ptr, y_stride, flimit_vec, limit_vec, thresh_vec, 16); - - if (u_ptr) - { - vp8_mbloop_filter_uvhorizontal_edge_mips(u_ptr, uv_stride, flimit_vec, limit_vec, thresh_vec, 0); - } - - if (v_ptr) - { - vp8_mbloop_filter_uvhorizontal_edge_mips(v_ptr, uv_stride, flimit_vec, limit_vec, thresh_vec, 0); - } -} - - -/* Vertical MB Filtering */ -void vp8_loop_filter_mbv_dspr2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - unsigned int thresh_vec, flimit_vec, limit_vec; - unsigned char thresh, flimit, limit, flimit_temp; - - /* use direct value instead pointers */ - limit = *(lfi->lim); - flimit_temp = *(lfi->mblim); - thresh = *(lfi->hev_thr); - flimit = flimit_temp; - - /* create quad-byte */ - __asm__ __volatile__ ( - "replv.qb %[thresh_vec], %[thresh] \n\t" - "replv.qb %[flimit_vec], %[flimit] \n\t" - "replv.qb %[limit_vec], %[limit] \n\t" - : [thresh_vec] "=&r" (thresh_vec), [flimit_vec] "=&r" (flimit_vec), [limit_vec] "=r" (limit_vec) - : [thresh] "r" (thresh), [flimit] "r" (flimit), [limit] "r" (limit) - ); - - vp8_mbloop_filter_vertical_edge_mips(y_ptr, y_stride, flimit_vec, limit_vec, thresh_vec, 16); - - if (u_ptr) - vp8_mbloop_filter_uvvertical_edge_mips(u_ptr, uv_stride, flimit_vec, limit_vec, thresh_vec, 0); - - if (v_ptr) - vp8_mbloop_filter_uvvertical_edge_mips(v_ptr, uv_stride, flimit_vec, limit_vec, thresh_vec, 0); -} - - -/* Horizontal B Filtering */ -void vp8_loop_filter_bh_dspr2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - unsigned int thresh_vec, flimit_vec, limit_vec; - unsigned char thresh, flimit, limit, flimit_temp; - - /* use direct value instead pointers */ - limit = *(lfi->lim); - flimit_temp = *(lfi->blim); - thresh = *(lfi->hev_thr); - flimit = flimit_temp; - - /* create quad-byte */ - __asm__ __volatile__ ( - "replv.qb %[thresh_vec], %[thresh] \n\t" - "replv.qb %[flimit_vec], %[flimit] \n\t" - "replv.qb %[limit_vec], %[limit] \n\t" - : [thresh_vec] "=&r" (thresh_vec), [flimit_vec] "=&r" (flimit_vec), [limit_vec] "=r" (limit_vec) - : [thresh] "r" (thresh), [flimit] "r" (flimit), [limit] "r" (limit) - ); - - vp8_loop_filter_horizontal_edge_mips(y_ptr + 4 * y_stride, y_stride, flimit_vec, limit_vec, thresh_vec, 16); - vp8_loop_filter_horizontal_edge_mips(y_ptr + 8 * y_stride, y_stride, flimit_vec, limit_vec, thresh_vec, 16); - vp8_loop_filter_horizontal_edge_mips(y_ptr + 12 * y_stride, y_stride, flimit_vec, limit_vec, thresh_vec, 16); - - if (u_ptr) - vp8_loop_filter_uvhorizontal_edge_mips(u_ptr + 4 * uv_stride, uv_stride, flimit_vec, limit_vec, thresh_vec, 0); - - if (v_ptr) - vp8_loop_filter_uvhorizontal_edge_mips(v_ptr + 4 * uv_stride, uv_stride, flimit_vec, limit_vec, thresh_vec, 0); -} - - -/* Vertical B Filtering */ -void vp8_loop_filter_bv_dspr2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - unsigned int thresh_vec, flimit_vec, limit_vec; - unsigned char thresh, flimit, limit, flimit_temp; - - /* use direct value instead pointers */ - limit = *(lfi->lim); - flimit_temp = *(lfi->blim); - thresh = *(lfi->hev_thr); - flimit = flimit_temp; - - /* create quad-byte */ - __asm__ __volatile__ ( - "replv.qb %[thresh_vec], %[thresh] \n\t" - "replv.qb %[flimit_vec], %[flimit] \n\t" - "replv.qb %[limit_vec], %[limit] \n\t" - : [thresh_vec] "=&r" (thresh_vec), [flimit_vec] "=&r" (flimit_vec), [limit_vec] "=r" (limit_vec) - : [thresh] "r" (thresh), [flimit] "r" (flimit), [limit] "r" (limit) - ); - - vp8_loop_filter_vertical_edge_mips(y_ptr + 4, y_stride, flimit_vec, limit_vec, thresh_vec, 16); - vp8_loop_filter_vertical_edge_mips(y_ptr + 8, y_stride, flimit_vec, limit_vec, thresh_vec, 16); - vp8_loop_filter_vertical_edge_mips(y_ptr + 12, y_stride, flimit_vec, limit_vec, thresh_vec, 16); - - if (u_ptr) - vp8_loop_filter_uvvertical_edge_mips(u_ptr + 4, uv_stride, flimit_vec, limit_vec, thresh_vec, 0); - - if (v_ptr) - vp8_loop_filter_uvvertical_edge_mips(v_ptr + 4, uv_stride, flimit_vec, limit_vec, thresh_vec, 0); -} - -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/mips/dspr2/reconinter_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/mips/dspr2/reconinter_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/mips/dspr2/reconinter_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/mips/dspr2/reconinter_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "vpx/vpx_integer.h" - -#if HAVE_DSPR2 -inline void prefetch_load_int(unsigned char *src) -{ - __asm__ __volatile__ ( - "pref 0, 0(%[src]) \n\t" - : - : [src] "r" (src) - ); -} - - -__inline void vp8_copy_mem16x16_dspr2( - unsigned char *RESTRICT src, - int src_stride, - unsigned char *RESTRICT dst, - int dst_stride) -{ - int r; - unsigned int a0, a1, a2, a3; - - for (r = 16; r--;) - { - /* load src data in cache memory */ - prefetch_load_int(src + src_stride); - - /* use unaligned memory load and store */ - __asm__ __volatile__ ( - "ulw %[a0], 0(%[src]) \n\t" - "ulw %[a1], 4(%[src]) \n\t" - "ulw %[a2], 8(%[src]) \n\t" - "ulw %[a3], 12(%[src]) \n\t" - "sw %[a0], 0(%[dst]) \n\t" - "sw %[a1], 4(%[dst]) \n\t" - "sw %[a2], 8(%[dst]) \n\t" - "sw %[a3], 12(%[dst]) \n\t" - : [a0] "=&r" (a0), [a1] "=&r" (a1), - [a2] "=&r" (a2), [a3] "=&r" (a3) - : [src] "r" (src), [dst] "r" (dst) - ); - - src += src_stride; - dst += dst_stride; - } -} - - -__inline void vp8_copy_mem8x8_dspr2( - unsigned char *RESTRICT src, - int src_stride, - unsigned char *RESTRICT dst, - int dst_stride) -{ - int r; - unsigned int a0, a1; - - /* load src data in cache memory */ - prefetch_load_int(src + src_stride); - - for (r = 8; r--;) - { - /* use unaligned memory load and store */ - __asm__ __volatile__ ( - "ulw %[a0], 0(%[src]) \n\t" - "ulw %[a1], 4(%[src]) \n\t" - "sw %[a0], 0(%[dst]) \n\t" - "sw %[a1], 4(%[dst]) \n\t" - : [a0] "=&r" (a0), [a1] "=&r" (a1) - : [src] "r" (src), [dst] "r" (dst) - ); - - src += src_stride; - dst += dst_stride; - } -} - - -__inline void vp8_copy_mem8x4_dspr2( - unsigned char *RESTRICT src, - int src_stride, - unsigned char *RESTRICT dst, - int dst_stride) -{ - int r; - unsigned int a0, a1; - - /* load src data in cache memory */ - prefetch_load_int(src + src_stride); - - for (r = 4; r--;) - { - /* use unaligned memory load and store */ - __asm__ __volatile__ ( - "ulw %[a0], 0(%[src]) \n\t" - "ulw %[a1], 4(%[src]) \n\t" - "sw %[a0], 0(%[dst]) \n\t" - "sw %[a1], 4(%[dst]) \n\t" - : [a0] "=&r" (a0), [a1] "=&r" (a1) - : [src] "r" (src), [dst] "r" (dst) - ); - - src += src_stride; - dst += dst_stride; - } -} - -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/modecont.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/modecont.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/modecont.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/modecont.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "entropy.h" - -const int vp8_mode_contexts[6][4] = -{ - { - /* 0 */ - 7, 1, 1, 143, - }, - { - /* 1 */ - 14, 18, 14, 107, - }, - { - /* 2 */ - 135, 64, 57, 68, - }, - { - /* 3 */ - 60, 56, 128, 65, - }, - { - /* 4 */ - 159, 134, 128, 34, - }, - { - /* 5 */ - 234, 188, 128, 28, - }, -}; diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/modecont.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/modecont.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/modecont.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/modecont.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_MODECONT_H_ -#define VP8_COMMON_MODECONT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -extern const int vp8_mode_contexts[6][4]; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_MODECONT_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/mv.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/mv.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/mv.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/mv.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_MV_H_ -#define VP8_COMMON_MV_H_ -#include "vpx/vpx_integer.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct -{ - short row; - short col; -} MV; - -typedef union int_mv -{ - uint32_t as_int; - MV as_mv; -} int_mv; /* facilitates faster equality tests and copies */ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_MV_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/onyxc_int.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/onyxc_int.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/onyxc_int.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/onyxc_int.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_ONYXC_INT_H_ -#define VP8_COMMON_ONYXC_INT_H_ - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "vpx/internal/vpx_codec_internal.h" -#include "loopfilter.h" -#include "entropymv.h" -#include "entropy.h" -#if CONFIG_POSTPROC -#include "postproc.h" -#endif - -/*#ifdef PACKET_TESTING*/ -#include "header.h" -/*#endif*/ - -#ifdef __cplusplus -extern "C" { -#endif - -#define MINQ 0 -#define MAXQ 127 -#define QINDEX_RANGE (MAXQ + 1) - -#define NUM_YV12_BUFFERS 4 - -#define MAX_PARTITIONS 9 - -typedef struct frame_contexts -{ - vp8_prob bmode_prob [VP8_BINTRAMODES-1]; - vp8_prob ymode_prob [VP8_YMODES-1]; /* interframe intra mode probs */ - vp8_prob uv_mode_prob [VP8_UV_MODES-1]; - vp8_prob sub_mv_ref_prob [VP8_SUBMVREFS-1]; - vp8_prob coef_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES]; - MV_CONTEXT mvc[2]; -} FRAME_CONTEXT; - -typedef enum -{ - ONE_PARTITION = 0, - TWO_PARTITION = 1, - FOUR_PARTITION = 2, - EIGHT_PARTITION = 3 -} TOKEN_PARTITION; - -typedef enum -{ - RECON_CLAMP_REQUIRED = 0, - RECON_CLAMP_NOTREQUIRED = 1 -} CLAMP_TYPE; - -typedef struct VP8Common - -{ - struct vpx_internal_error_info error; - - DECLARE_ALIGNED(16, short, Y1dequant[QINDEX_RANGE][2]); - DECLARE_ALIGNED(16, short, Y2dequant[QINDEX_RANGE][2]); - DECLARE_ALIGNED(16, short, UVdequant[QINDEX_RANGE][2]); - - int Width; - int Height; - int horiz_scale; - int vert_scale; - - CLAMP_TYPE clamp_type; - - YV12_BUFFER_CONFIG *frame_to_show; - - YV12_BUFFER_CONFIG yv12_fb[NUM_YV12_BUFFERS]; - int fb_idx_ref_cnt[NUM_YV12_BUFFERS]; - int new_fb_idx, lst_fb_idx, gld_fb_idx, alt_fb_idx; - - YV12_BUFFER_CONFIG temp_scale_frame; - -#if CONFIG_POSTPROC - YV12_BUFFER_CONFIG post_proc_buffer; - YV12_BUFFER_CONFIG post_proc_buffer_int; - int post_proc_buffer_int_used; - unsigned char *pp_limits_buffer; /* post-processing filter coefficients */ -#endif - - FRAME_TYPE last_frame_type; /* Save last frame's frame type for motion search. */ - FRAME_TYPE frame_type; - - int show_frame; - - int frame_flags; - int MBs; - int mb_rows; - int mb_cols; - int mode_info_stride; - - /* profile settings */ - int mb_no_coeff_skip; - int no_lpf; - int use_bilinear_mc_filter; - int full_pixel; - - int base_qindex; - - int y1dc_delta_q; - int y2dc_delta_q; - int y2ac_delta_q; - int uvdc_delta_q; - int uvac_delta_q; - - /* We allocate a MODE_INFO struct for each macroblock, together with - an extra row on top and column on the left to simplify prediction. */ - - MODE_INFO *mip; /* Base of allocated array */ - MODE_INFO *mi; /* Corresponds to upper left visible macroblock */ -#if CONFIG_ERROR_CONCEALMENT - MODE_INFO *prev_mip; /* MODE_INFO array 'mip' from last decoded frame */ - MODE_INFO *prev_mi; /* 'mi' from last frame (points into prev_mip) */ -#endif - MODE_INFO *show_frame_mi; /* MODE_INFO for the last decoded frame - to show */ - LOOPFILTERTYPE filter_type; - - loop_filter_info_n lf_info; - - int filter_level; - int last_sharpness_level; - int sharpness_level; - - int refresh_last_frame; /* Two state 0 = NO, 1 = YES */ - int refresh_golden_frame; /* Two state 0 = NO, 1 = YES */ - int refresh_alt_ref_frame; /* Two state 0 = NO, 1 = YES */ - - int copy_buffer_to_gf; /* 0 none, 1 Last to GF, 2 ARF to GF */ - int copy_buffer_to_arf; /* 0 none, 1 Last to ARF, 2 GF to ARF */ - - int refresh_entropy_probs; /* Two state 0 = NO, 1 = YES */ - - int ref_frame_sign_bias[MAX_REF_FRAMES]; /* Two state 0, 1 */ - - /* Y,U,V,Y2 */ - ENTROPY_CONTEXT_PLANES *above_context; /* row of context for each plane */ - ENTROPY_CONTEXT_PLANES left_context; /* (up to) 4 contexts "" */ - - FRAME_CONTEXT lfc; /* last frame entropy */ - FRAME_CONTEXT fc; /* this frame entropy */ - - unsigned int current_video_frame; - - int version; - - TOKEN_PARTITION multi_token_partition; - -#ifdef PACKET_TESTING - VP8_HEADER oh; -#endif -#if CONFIG_POSTPROC_VISUALIZER - double bitrate; - double framerate; -#endif - -#if CONFIG_MULTITHREAD - int processor_core_count; -#endif -#if CONFIG_POSTPROC - struct postproc_state postproc_state; -#endif - int cpu_caps; -} VP8_COMMON; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_ONYXC_INT_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/onyxd.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/onyxd.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/onyxd.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/onyxd.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_ONYXD_H_ -#define VP8_COMMON_ONYXD_H_ - - -/* Create/destroy static data structures. */ -#ifdef __cplusplus -extern "C" -{ -#endif -#include "vpx_scale/yv12config.h" -#include "ppflags.h" -#include "vpx_ports/mem.h" -#include "vpx/vpx_codec.h" -#include "vpx/vp8.h" - - struct VP8D_COMP; - - typedef struct - { - int Width; - int Height; - int Version; - int postprocess; - int max_threads; - int error_concealment; - } VP8D_CONFIG; - - typedef enum - { - VP8D_OK = 0 - } VP8D_SETTING; - - void vp8dx_initialize(void); - - void vp8dx_set_setting(struct VP8D_COMP* comp, VP8D_SETTING oxst, int x); - - int vp8dx_get_setting(struct VP8D_COMP* comp, VP8D_SETTING oxst); - - int vp8dx_receive_compressed_data(struct VP8D_COMP* comp, - size_t size, const uint8_t *dest, - int64_t time_stamp); - int vp8dx_get_raw_frame(struct VP8D_COMP* comp, YV12_BUFFER_CONFIG *sd, int64_t *time_stamp, int64_t *time_end_stamp, vp8_ppflags_t *flags); - - vpx_codec_err_t vp8dx_get_reference(struct VP8D_COMP* comp, enum vpx_ref_frame_type ref_frame_flag, YV12_BUFFER_CONFIG *sd); - vpx_codec_err_t vp8dx_set_reference(struct VP8D_COMP* comp, enum vpx_ref_frame_type ref_frame_flag, YV12_BUFFER_CONFIG *sd); - -#ifdef __cplusplus -} -#endif - - -#endif // VP8_COMMON_ONYXD_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/onyx.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/onyx.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/onyx.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/onyx.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,282 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_ONYX_H_ -#define VP8_COMMON_ONYX_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include "vpx_config.h" -#include "vpx/internal/vpx_codec_internal.h" -#include "vpx/vp8cx.h" -#include "vpx/vpx_encoder.h" -#include "vpx_scale/yv12config.h" -#include "ppflags.h" - - struct VP8_COMP; - - /* Create/destroy static data structures. */ - - typedef enum - { - NORMAL = 0, - FOURFIVE = 1, - THREEFIVE = 2, - ONETWO = 3 - - } VPX_SCALING; - - typedef enum - { - USAGE_LOCAL_FILE_PLAYBACK = 0x0, - USAGE_STREAM_FROM_SERVER = 0x1, - USAGE_CONSTRAINED_QUALITY = 0x2, - USAGE_CONSTANT_QUALITY = 0x3 - } END_USAGE; - - - typedef enum - { - MODE_REALTIME = 0x0, - MODE_GOODQUALITY = 0x1, - MODE_BESTQUALITY = 0x2, - MODE_FIRSTPASS = 0x3, - MODE_SECONDPASS = 0x4, - MODE_SECONDPASS_BEST = 0x5 - } MODE; - - typedef enum - { - FRAMEFLAGS_KEY = 1, - FRAMEFLAGS_GOLDEN = 2, - FRAMEFLAGS_ALTREF = 4 - } FRAMETYPE_FLAGS; - - -#include - static void Scale2Ratio(int mode, int *hr, int *hs) - { - switch (mode) - { - case NORMAL: - *hr = 1; - *hs = 1; - break; - case FOURFIVE: - *hr = 4; - *hs = 5; - break; - case THREEFIVE: - *hr = 3; - *hs = 5; - break; - case ONETWO: - *hr = 1; - *hs = 2; - break; - default: - *hr = 1; - *hs = 1; - assert(0); - break; - } - } - - typedef struct - { - /* 4 versions of bitstream defined: - * 0 best quality/slowest decode, 3 lowest quality/fastest decode - */ - int Version; - int Width; - int Height; - struct vpx_rational timebase; - unsigned int target_bandwidth; /* kilobits per second */ - - /* Parameter used for applying denoiser. - * For temporal denoiser: noise_sensitivity = 0 means off, - * noise_sensitivity = 1 means temporal denoiser on for Y channel only, - * noise_sensitivity = 2 means temporal denoiser on for all channels. - * noise_sensitivity = 3 means aggressive denoising mode. - * noise_sensitivity >= 4 means adaptive denoising mode. - * Temporal denoiser is enabled via the configuration option: - * CONFIG_TEMPORAL_DENOISING. - * For spatial denoiser: noise_sensitivity controls the amount of - * pre-processing blur: noise_sensitivity = 0 means off. - * Spatial denoiser invoked under !CONFIG_TEMPORAL_DENOISING. - */ - int noise_sensitivity; - - /* parameter used for sharpening output: recommendation 0: */ - int Sharpness; - int cpu_used; - unsigned int rc_max_intra_bitrate_pct; - unsigned int screen_content_mode; - - /* mode -> - *(0)=Realtime/Live Encoding. This mode is optimized for realtim - * encoding (for example, capturing a television signal or feed - * from a live camera). ( speed setting controls how fast ) - *(1)=Good Quality Fast Encoding. The encoder balances quality with - * the amount of time it takes to encode the output. ( speed - * setting controls how fast ) - *(2)=One Pass - Best Quality. The encoder places priority on the - * quality of the output over encoding speed. The output is - * compressed at the highest possible quality. This option takes - * the longest amount of time to encode. ( speed setting ignored - * ) - *(3)=Two Pass - First Pass. The encoder generates a file of - * statistics for use in the second encoding pass. ( speed - * setting controls how fast ) - *(4)=Two Pass - Second Pass. The encoder uses the statistics that - * were generated in the first encoding pass to create the - * compressed output. ( speed setting controls how fast ) - *(5)=Two Pass - Second Pass Best. The encoder uses the statistics - * that were generated in the first encoding pass to create the - * compressed output using the highest possible quality, and - * taking a longer amount of time to encode.. ( speed setting - * ignored ) - */ - int Mode; - - /* Key Framing Operations */ - int auto_key; /* automatically detect cut scenes */ - int key_freq; /* maximum distance to key frame. */ - - /* lagged compression (if allow_lag == 0 lag_in_frames is ignored) */ - int allow_lag; - int lag_in_frames; /* how many frames lag before we start encoding */ - - /* - * DATARATE CONTROL OPTIONS - */ - - int end_usage; /* vbr or cbr */ - - /* buffer targeting aggressiveness */ - int under_shoot_pct; - int over_shoot_pct; - - /* buffering parameters */ - int64_t starting_buffer_level; - int64_t optimal_buffer_level; - int64_t maximum_buffer_size; - - int64_t starting_buffer_level_in_ms; - int64_t optimal_buffer_level_in_ms; - int64_t maximum_buffer_size_in_ms; - - /* controlling quality */ - int fixed_q; - int worst_allowed_q; - int best_allowed_q; - int cq_level; - - /* allow internal resizing */ - int allow_spatial_resampling; - int resample_down_water_mark; - int resample_up_water_mark; - - /* allow internal frame rate alterations */ - int allow_df; - int drop_frames_water_mark; - - /* two pass datarate control */ - int two_pass_vbrbias; - int two_pass_vbrmin_section; - int two_pass_vbrmax_section; - - /* - * END DATARATE CONTROL OPTIONS - */ - - /* these parameters aren't to be used in final build don't use!!! */ - int play_alternate; - int alt_freq; - int alt_q; - int key_q; - int gold_q; - - - int multi_threaded; /* how many threads to run the encoder on */ - int token_partitions; /* how many token partitions to create */ - - /* early breakout threshold: for video conf recommend 800 */ - int encode_breakout; - - /* Bitfield defining the error resiliency features to enable. - * Can provide decodable frames after losses in previous - * frames and decodable partitions after losses in the same frame. - */ - unsigned int error_resilient_mode; - - int arnr_max_frames; - int arnr_strength; - int arnr_type; - - vpx_fixed_buf_t two_pass_stats_in; - struct vpx_codec_pkt_list *output_pkt_list; - - vp8e_tuning tuning; - - /* Temporal scaling parameters */ - unsigned int number_of_layers; - unsigned int target_bitrate[VPX_TS_MAX_PERIODICITY]; - unsigned int rate_decimator[VPX_TS_MAX_PERIODICITY]; - unsigned int periodicity; - unsigned int layer_id[VPX_TS_MAX_PERIODICITY]; - -#if CONFIG_MULTI_RES_ENCODING - /* Number of total resolutions encoded */ - unsigned int mr_total_resolutions; - - /* Current encoder ID */ - unsigned int mr_encoder_id; - - /* Down-sampling factor */ - vpx_rational_t mr_down_sampling_factor; - - /* Memory location to store low-resolution encoder's mode info */ - void* mr_low_res_mode_info; -#endif - } VP8_CONFIG; - - - void vp8_initialize(); - - struct VP8_COMP* vp8_create_compressor(VP8_CONFIG *oxcf); - void vp8_remove_compressor(struct VP8_COMP* *comp); - - void vp8_init_config(struct VP8_COMP* onyx, VP8_CONFIG *oxcf); - void vp8_change_config(struct VP8_COMP* onyx, VP8_CONFIG *oxcf); - - int vp8_receive_raw_frame(struct VP8_COMP* comp, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, int64_t time_stamp, int64_t end_time_stamp); - int vp8_get_compressed_data(struct VP8_COMP* comp, unsigned int *frame_flags, unsigned long *size, unsigned char *dest, unsigned char *dest_end, int64_t *time_stamp, int64_t *time_end, int flush); - int vp8_get_preview_raw_frame(struct VP8_COMP* comp, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *flags); - - int vp8_use_as_reference(struct VP8_COMP* comp, int ref_frame_flags); - int vp8_update_reference(struct VP8_COMP* comp, int ref_frame_flags); - int vp8_get_reference(struct VP8_COMP* comp, enum vpx_ref_frame_type ref_frame_flag, YV12_BUFFER_CONFIG *sd); - int vp8_set_reference(struct VP8_COMP* comp, enum vpx_ref_frame_type ref_frame_flag, YV12_BUFFER_CONFIG *sd); - int vp8_update_entropy(struct VP8_COMP* comp, int update); - int vp8_set_roimap(struct VP8_COMP* comp, unsigned char *map, unsigned int rows, unsigned int cols, int delta_q[4], int delta_lf[4], unsigned int threshold[4]); - int vp8_set_active_map(struct VP8_COMP* comp, unsigned char *map, unsigned int rows, unsigned int cols); - int vp8_set_internal_size(struct VP8_COMP* comp, VPX_SCALING horiz_mode, VPX_SCALING vert_mode); - int vp8_get_quantizer(struct VP8_COMP* c); - -#ifdef __cplusplus -} -#endif - -#endif // VP8_COMMON_ONYX_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/postproc.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/postproc.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/postproc.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/postproc.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1206 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "vpx_scale_rtcd.h" -#include "vpx_scale/yv12config.h" -#include "postproc.h" -#include "common.h" -#include "vpx_scale/vpx_scale.h" -#include "systemdependent.h" - -#include -#include -#include -#include - -#define RGB_TO_YUV(t) \ - ( (0.257*(float)(t>>16)) + (0.504*(float)(t>>8&0xff)) + (0.098*(float)(t&0xff)) + 16), \ - (-(0.148*(float)(t>>16)) - (0.291*(float)(t>>8&0xff)) + (0.439*(float)(t&0xff)) + 128), \ - ( (0.439*(float)(t>>16)) - (0.368*(float)(t>>8&0xff)) - (0.071*(float)(t&0xff)) + 128) - -/* global constants */ -#if CONFIG_POSTPROC_VISUALIZER -static const unsigned char MB_PREDICTION_MODE_colors[MB_MODE_COUNT][3] = -{ - { RGB_TO_YUV(0x98FB98) }, /* PaleGreen */ - { RGB_TO_YUV(0x00FF00) }, /* Green */ - { RGB_TO_YUV(0xADFF2F) }, /* GreenYellow */ - { RGB_TO_YUV(0x228B22) }, /* ForestGreen */ - { RGB_TO_YUV(0x006400) }, /* DarkGreen */ - { RGB_TO_YUV(0x98F5FF) }, /* Cadet Blue */ - { RGB_TO_YUV(0x6CA6CD) }, /* Sky Blue */ - { RGB_TO_YUV(0x00008B) }, /* Dark blue */ - { RGB_TO_YUV(0x551A8B) }, /* Purple */ - { RGB_TO_YUV(0xFF0000) } /* Red */ -}; - -static const unsigned char B_PREDICTION_MODE_colors[B_MODE_COUNT][3] = -{ - { RGB_TO_YUV(0x6633ff) }, /* Purple */ - { RGB_TO_YUV(0xcc33ff) }, /* Magenta */ - { RGB_TO_YUV(0xff33cc) }, /* Pink */ - { RGB_TO_YUV(0xff3366) }, /* Coral */ - { RGB_TO_YUV(0x3366ff) }, /* Blue */ - { RGB_TO_YUV(0xed00f5) }, /* Dark Blue */ - { RGB_TO_YUV(0x2e00b8) }, /* Dark Purple */ - { RGB_TO_YUV(0xff6633) }, /* Orange */ - { RGB_TO_YUV(0x33ccff) }, /* Light Blue */ - { RGB_TO_YUV(0x8ab800) }, /* Green */ - { RGB_TO_YUV(0xffcc33) }, /* Light Orange */ - { RGB_TO_YUV(0x33ffcc) }, /* Aqua */ - { RGB_TO_YUV(0x66ff33) }, /* Light Green */ - { RGB_TO_YUV(0xccff33) }, /* Yellow */ -}; - -static const unsigned char MV_REFERENCE_FRAME_colors[MAX_REF_FRAMES][3] = -{ - { RGB_TO_YUV(0x00ff00) }, /* Blue */ - { RGB_TO_YUV(0x0000ff) }, /* Green */ - { RGB_TO_YUV(0xffff00) }, /* Yellow */ - { RGB_TO_YUV(0xff0000) }, /* Red */ -}; -#endif - -const short vp8_rv[] = -{ - 8, 5, 2, 2, 8, 12, 4, 9, 8, 3, - 0, 3, 9, 0, 0, 0, 8, 3, 14, 4, - 10, 1, 11, 14, 1, 14, 9, 6, 12, 11, - 8, 6, 10, 0, 0, 8, 9, 0, 3, 14, - 8, 11, 13, 4, 2, 9, 0, 3, 9, 6, - 1, 2, 3, 14, 13, 1, 8, 2, 9, 7, - 3, 3, 1, 13, 13, 6, 6, 5, 2, 7, - 11, 9, 11, 8, 7, 3, 2, 0, 13, 13, - 14, 4, 12, 5, 12, 10, 8, 10, 13, 10, - 4, 14, 4, 10, 0, 8, 11, 1, 13, 7, - 7, 14, 6, 14, 13, 2, 13, 5, 4, 4, - 0, 10, 0, 5, 13, 2, 12, 7, 11, 13, - 8, 0, 4, 10, 7, 2, 7, 2, 2, 5, - 3, 4, 7, 3, 3, 14, 14, 5, 9, 13, - 3, 14, 3, 6, 3, 0, 11, 8, 13, 1, - 13, 1, 12, 0, 10, 9, 7, 6, 2, 8, - 5, 2, 13, 7, 1, 13, 14, 7, 6, 7, - 9, 6, 10, 11, 7, 8, 7, 5, 14, 8, - 4, 4, 0, 8, 7, 10, 0, 8, 14, 11, - 3, 12, 5, 7, 14, 3, 14, 5, 2, 6, - 11, 12, 12, 8, 0, 11, 13, 1, 2, 0, - 5, 10, 14, 7, 8, 0, 4, 11, 0, 8, - 0, 3, 10, 5, 8, 0, 11, 6, 7, 8, - 10, 7, 13, 9, 2, 5, 1, 5, 10, 2, - 4, 3, 5, 6, 10, 8, 9, 4, 11, 14, - 0, 10, 0, 5, 13, 2, 12, 7, 11, 13, - 8, 0, 4, 10, 7, 2, 7, 2, 2, 5, - 3, 4, 7, 3, 3, 14, 14, 5, 9, 13, - 3, 14, 3, 6, 3, 0, 11, 8, 13, 1, - 13, 1, 12, 0, 10, 9, 7, 6, 2, 8, - 5, 2, 13, 7, 1, 13, 14, 7, 6, 7, - 9, 6, 10, 11, 7, 8, 7, 5, 14, 8, - 4, 4, 0, 8, 7, 10, 0, 8, 14, 11, - 3, 12, 5, 7, 14, 3, 14, 5, 2, 6, - 11, 12, 12, 8, 0, 11, 13, 1, 2, 0, - 5, 10, 14, 7, 8, 0, 4, 11, 0, 8, - 0, 3, 10, 5, 8, 0, 11, 6, 7, 8, - 10, 7, 13, 9, 2, 5, 1, 5, 10, 2, - 4, 3, 5, 6, 10, 8, 9, 4, 11, 14, - 3, 8, 3, 7, 8, 5, 11, 4, 12, 3, - 11, 9, 14, 8, 14, 13, 4, 3, 1, 2, - 14, 6, 5, 4, 4, 11, 4, 6, 2, 1, - 5, 8, 8, 12, 13, 5, 14, 10, 12, 13, - 0, 9, 5, 5, 11, 10, 13, 9, 10, 13, -}; - -extern void vp8_blit_text(const char *msg, unsigned char *address, const int pitch); -extern void vp8_blit_line(int x0, int x1, int y0, int y1, unsigned char *image, const int pitch); -/*********************************************************************************************************** - */ -void vp8_post_proc_down_and_across_mb_row_c -( - unsigned char *src_ptr, - unsigned char *dst_ptr, - int src_pixels_per_line, - int dst_pixels_per_line, - int cols, - unsigned char *f, - int size -) -{ - unsigned char *p_src, *p_dst; - int row; - int col; - unsigned char v; - unsigned char d[4]; - - for (row = 0; row < size; row++) - { - /* post_proc_down for one row */ - p_src = src_ptr; - p_dst = dst_ptr; - - for (col = 0; col < cols; col++) - { - unsigned char p_above2 = p_src[col - 2 * src_pixels_per_line]; - unsigned char p_above1 = p_src[col - src_pixels_per_line]; - unsigned char p_below1 = p_src[col + src_pixels_per_line]; - unsigned char p_below2 = p_src[col + 2 * src_pixels_per_line]; - - v = p_src[col]; - - if ((abs(v - p_above2) < f[col]) && (abs(v - p_above1) < f[col]) - && (abs(v - p_below1) < f[col]) && (abs(v - p_below2) < f[col])) - { - unsigned char k1, k2, k3; - k1 = (p_above2 + p_above1 + 1) >> 1; - k2 = (p_below2 + p_below1 + 1) >> 1; - k3 = (k1 + k2 + 1) >> 1; - v = (k3 + v + 1) >> 1; - } - - p_dst[col] = v; - } - - /* now post_proc_across */ - p_src = dst_ptr; - p_dst = dst_ptr; - - p_src[-2] = p_src[-1] = p_src[0]; - p_src[cols] = p_src[cols + 1] = p_src[cols - 1]; - - for (col = 0; col < cols; col++) - { - v = p_src[col]; - - if ((abs(v - p_src[col - 2]) < f[col]) - && (abs(v - p_src[col - 1]) < f[col]) - && (abs(v - p_src[col + 1]) < f[col]) - && (abs(v - p_src[col + 2]) < f[col])) - { - unsigned char k1, k2, k3; - k1 = (p_src[col - 2] + p_src[col - 1] + 1) >> 1; - k2 = (p_src[col + 2] + p_src[col + 1] + 1) >> 1; - k3 = (k1 + k2 + 1) >> 1; - v = (k3 + v + 1) >> 1; - } - - d[col & 3] = v; - - if (col >= 2) - p_dst[col - 2] = d[(col - 2) & 3]; - } - - /* handle the last two pixels */ - p_dst[col - 2] = d[(col - 2) & 3]; - p_dst[col - 1] = d[(col - 1) & 3]; - - /* next row */ - src_ptr += src_pixels_per_line; - dst_ptr += dst_pixels_per_line; - } -} - -static int q2mbl(int x) -{ - if (x < 20) x = 20; - - x = 50 + (x - 50) * 10 / 8; - return x * x / 3; -} - -void vp8_mbpost_proc_across_ip_c(unsigned char *src, int pitch, int rows, int cols, int flimit) -{ - int r, c, i; - - unsigned char *s = src; - unsigned char d[16]; - - for (r = 0; r < rows; r++) - { - int sumsq = 0; - int sum = 0; - - for (i = -8; i < 0; i++) - s[i]=s[0]; - - /* 17 avoids valgrind warning - we buffer values in c in d - * and only write them when we've read 8 ahead... - */ - for (i = 0; i < 17; i++) - s[i+cols]=s[cols-1]; - - for (i = -8; i <= 6; i++) - { - sumsq += s[i] * s[i]; - sum += s[i]; - d[i+8] = 0; - } - - for (c = 0; c < cols + 8; c++) - { - int x = s[c+7] - s[c-8]; - int y = s[c+7] + s[c-8]; - - sum += x; - sumsq += x * y; - - d[c&15] = s[c]; - - if (sumsq * 15 - sum * sum < flimit) - { - d[c&15] = (8 + sum + s[c]) >> 4; - } - - s[c-8] = d[(c-8)&15]; - } - - s += pitch; - } -} - -void vp8_mbpost_proc_down_c(unsigned char *dst, int pitch, int rows, int cols, int flimit) -{ - int r, c, i; - const short *rv3 = &vp8_rv[63&rand()]; - - for (c = 0; c < cols; c++ ) - { - unsigned char *s = &dst[c]; - int sumsq = 0; - int sum = 0; - unsigned char d[16]; - const short *rv2 = rv3 + ((c * 17) & 127); - - for (i = -8; i < 0; i++) - s[i*pitch]=s[0]; - - /* 17 avoids valgrind warning - we buffer values in c in d - * and only write them when we've read 8 ahead... - */ - for (i = 0; i < 17; i++) - s[(i+rows)*pitch]=s[(rows-1)*pitch]; - - for (i = -8; i <= 6; i++) - { - sumsq += s[i*pitch] * s[i*pitch]; - sum += s[i*pitch]; - } - - for (r = 0; r < rows + 8; r++) - { - sumsq += s[7*pitch] * s[ 7*pitch] - s[-8*pitch] * s[-8*pitch]; - sum += s[7*pitch] - s[-8*pitch]; - d[r&15] = s[0]; - - if (sumsq * 15 - sum * sum < flimit) - { - d[r&15] = (rv2[r&127] + sum + s[0]) >> 4; - } - if (r >= 8) - s[-8*pitch] = d[(r-8)&15]; - s += pitch; - } - } -} - -#if CONFIG_POSTPROC -static void vp8_de_mblock(YV12_BUFFER_CONFIG *post, - int q) -{ - vp8_mbpost_proc_across_ip(post->y_buffer, post->y_stride, post->y_height, - post->y_width, q2mbl(q)); - vp8_mbpost_proc_down(post->y_buffer, post->y_stride, post->y_height, - post->y_width, q2mbl(q)); -} - -void vp8_deblock(VP8_COMMON *cm, - YV12_BUFFER_CONFIG *source, - YV12_BUFFER_CONFIG *post, - int q, - int low_var_thresh, - int flag) -{ - double level = 6.0e-05 * q * q * q - .0067 * q * q + .306 * q + .0065; - int ppl = (int)(level + .5); - - const MODE_INFO *mode_info_context = cm->show_frame_mi; - int mbr, mbc; - - /* The pixel thresholds are adjusted according to if or not the macroblock - * is a skipped block. */ - unsigned char *ylimits = cm->pp_limits_buffer; - unsigned char *uvlimits = cm->pp_limits_buffer + 16 * cm->mb_cols; - (void) low_var_thresh; - (void) flag; - - if (ppl > 0) - { - for (mbr = 0; mbr < cm->mb_rows; mbr++) - { - unsigned char *ylptr = ylimits; - unsigned char *uvlptr = uvlimits; - for (mbc = 0; mbc < cm->mb_cols; mbc++) - { - unsigned char mb_ppl; - - if (mode_info_context->mbmi.mb_skip_coeff) - mb_ppl = (unsigned char)ppl >> 1; - else - mb_ppl = (unsigned char)ppl; - - vpx_memset(ylptr, mb_ppl, 16); - vpx_memset(uvlptr, mb_ppl, 8); - - ylptr += 16; - uvlptr += 8; - mode_info_context++; - } - mode_info_context++; - - vp8_post_proc_down_and_across_mb_row( - source->y_buffer + 16 * mbr * source->y_stride, - post->y_buffer + 16 * mbr * post->y_stride, source->y_stride, - post->y_stride, source->y_width, ylimits, 16); - - vp8_post_proc_down_and_across_mb_row( - source->u_buffer + 8 * mbr * source->uv_stride, - post->u_buffer + 8 * mbr * post->uv_stride, source->uv_stride, - post->uv_stride, source->uv_width, uvlimits, 8); - vp8_post_proc_down_and_across_mb_row( - source->v_buffer + 8 * mbr * source->uv_stride, - post->v_buffer + 8 * mbr * post->uv_stride, source->uv_stride, - post->uv_stride, source->uv_width, uvlimits, 8); - } - } else - { - vp8_yv12_copy_frame(source, post); - } -} -#endif - -void vp8_de_noise(VP8_COMMON *cm, - YV12_BUFFER_CONFIG *source, - YV12_BUFFER_CONFIG *post, - int q, - int low_var_thresh, - int flag, - int uvfilter) -{ - int mbr; - double level = 6.0e-05 * q * q * q - .0067 * q * q + .306 * q + .0065; - int ppl = (int)(level + .5); - int mb_rows = cm->mb_rows; - int mb_cols = cm->mb_cols; - unsigned char *limits = cm->pp_limits_buffer;; - (void) post; - (void) low_var_thresh; - (void) flag; - - vpx_memset(limits, (unsigned char)ppl, 16 * mb_cols); - - /* TODO: The original code don't filter the 2 outer rows and columns. */ - for (mbr = 0; mbr < mb_rows; mbr++) - { - vp8_post_proc_down_and_across_mb_row( - source->y_buffer + 16 * mbr * source->y_stride, - source->y_buffer + 16 * mbr * source->y_stride, - source->y_stride, source->y_stride, source->y_width, limits, 16); - if (uvfilter == 1) { - vp8_post_proc_down_and_across_mb_row( - source->u_buffer + 8 * mbr * source->uv_stride, - source->u_buffer + 8 * mbr * source->uv_stride, - source->uv_stride, source->uv_stride, source->uv_width, limits, - 8); - vp8_post_proc_down_and_across_mb_row( - source->v_buffer + 8 * mbr * source->uv_stride, - source->v_buffer + 8 * mbr * source->uv_stride, - source->uv_stride, source->uv_stride, source->uv_width, limits, - 8); - } - } -} - -double vp8_gaussian(double sigma, double mu, double x) -{ - return 1 / (sigma * sqrt(2.0 * 3.14159265)) * - (exp(-(x - mu) * (x - mu) / (2 * sigma * sigma))); -} - -static void fillrd(struct postproc_state *state, int q, int a) -{ - char char_dist[300]; - - double sigma; - int i; - - vp8_clear_system_state(); - - - sigma = a + .5 + .6 * (63 - q) / 63.0; - - /* set up a lookup table of 256 entries that matches - * a gaussian distribution with sigma determined by q. - */ - { - int next, j; - - next = 0; - - for (i = -32; i < 32; i++) - { - const int v = (int)(.5 + 256 * vp8_gaussian(sigma, 0, i)); - - if (v) - { - for (j = 0; j < v; j++) - { - char_dist[next+j] = (char) i; - } - - next = next + j; - } - - } - - for (; next < 256; next++) - char_dist[next] = 0; - - } - - for (i = 0; i < 3072; i++) - { - state->noise[i] = char_dist[rand() & 0xff]; - } - - for (i = 0; i < 16; i++) - { - state->blackclamp[i] = -char_dist[0]; - state->whiteclamp[i] = -char_dist[0]; - state->bothclamp[i] = -2 * char_dist[0]; - } - - state->last_q = q; - state->last_noise = a; -} - -/**************************************************************************** - * - * ROUTINE : plane_add_noise_c - * - * INPUTS : unsigned char *Start starting address of buffer to add gaussian - * noise to - * unsigned int Width width of plane - * unsigned int Height height of plane - * int Pitch distance between subsequent lines of frame - * int q quantizer used to determine amount of noise - * to add - * - * OUTPUTS : None. - * - * RETURNS : void. - * - * FUNCTION : adds gaussian noise to a plane of pixels - * - * SPECIAL NOTES : None. - * - ****************************************************************************/ -void vp8_plane_add_noise_c(unsigned char *Start, char *noise, - char blackclamp[16], - char whiteclamp[16], - char bothclamp[16], - unsigned int Width, unsigned int Height, int Pitch) -{ - unsigned int i, j; - (void)bothclamp; - - for (i = 0; i < Height; i++) - { - unsigned char *Pos = Start + i * Pitch; - char *Ref = (char *)(noise + (rand() & 0xff)); - - for (j = 0; j < Width; j++) - { - if (Pos[j] < blackclamp[0]) - Pos[j] = blackclamp[0]; - - if (Pos[j] > 255 + whiteclamp[0]) - Pos[j] = 255 + whiteclamp[0]; - - Pos[j] += Ref[j]; - } - } -} - -/* Blend the macro block with a solid colored square. Leave the - * edges unblended to give distinction to macro blocks in areas - * filled with the same color block. - */ -void vp8_blend_mb_inner_c (unsigned char *y, unsigned char *u, unsigned char *v, - int y_1, int u_1, int v_1, int alpha, int stride) -{ - int i, j; - int y1_const = y_1*((1<<16)-alpha); - int u1_const = u_1*((1<<16)-alpha); - int v1_const = v_1*((1<<16)-alpha); - - y += 2*stride + 2; - for (i = 0; i < 12; i++) - { - for (j = 0; j < 12; j++) - { - y[j] = (y[j]*alpha + y1_const)>>16; - } - y += stride; - } - - stride >>= 1; - - u += stride + 1; - v += stride + 1; - - for (i = 0; i < 6; i++) - { - for (j = 0; j < 6; j++) - { - u[j] = (u[j]*alpha + u1_const)>>16; - v[j] = (v[j]*alpha + v1_const)>>16; - } - u += stride; - v += stride; - } -} - -/* Blend only the edge of the macro block. Leave center - * unblended to allow for other visualizations to be layered. - */ -void vp8_blend_mb_outer_c (unsigned char *y, unsigned char *u, unsigned char *v, - int y_1, int u_1, int v_1, int alpha, int stride) -{ - int i, j; - int y1_const = y_1*((1<<16)-alpha); - int u1_const = u_1*((1<<16)-alpha); - int v1_const = v_1*((1<<16)-alpha); - - for (i = 0; i < 2; i++) - { - for (j = 0; j < 16; j++) - { - y[j] = (y[j]*alpha + y1_const)>>16; - } - y += stride; - } - - for (i = 0; i < 12; i++) - { - y[0] = (y[0]*alpha + y1_const)>>16; - y[1] = (y[1]*alpha + y1_const)>>16; - y[14] = (y[14]*alpha + y1_const)>>16; - y[15] = (y[15]*alpha + y1_const)>>16; - y += stride; - } - - for (i = 0; i < 2; i++) - { - for (j = 0; j < 16; j++) - { - y[j] = (y[j]*alpha + y1_const)>>16; - } - y += stride; - } - - stride >>= 1; - - for (j = 0; j < 8; j++) - { - u[j] = (u[j]*alpha + u1_const)>>16; - v[j] = (v[j]*alpha + v1_const)>>16; - } - u += stride; - v += stride; - - for (i = 0; i < 6; i++) - { - u[0] = (u[0]*alpha + u1_const)>>16; - v[0] = (v[0]*alpha + v1_const)>>16; - - u[7] = (u[7]*alpha + u1_const)>>16; - v[7] = (v[7]*alpha + v1_const)>>16; - - u += stride; - v += stride; - } - - for (j = 0; j < 8; j++) - { - u[j] = (u[j]*alpha + u1_const)>>16; - v[j] = (v[j]*alpha + v1_const)>>16; - } -} - -void vp8_blend_b_c (unsigned char *y, unsigned char *u, unsigned char *v, - int y_1, int u_1, int v_1, int alpha, int stride) -{ - int i, j; - int y1_const = y_1*((1<<16)-alpha); - int u1_const = u_1*((1<<16)-alpha); - int v1_const = v_1*((1<<16)-alpha); - - for (i = 0; i < 4; i++) - { - for (j = 0; j < 4; j++) - { - y[j] = (y[j]*alpha + y1_const)>>16; - } - y += stride; - } - - stride >>= 1; - - for (i = 0; i < 2; i++) - { - for (j = 0; j < 2; j++) - { - u[j] = (u[j]*alpha + u1_const)>>16; - v[j] = (v[j]*alpha + v1_const)>>16; - } - u += stride; - v += stride; - } -} - -static void constrain_line (int x_0, int *x_1, int y_0, int *y_1, int width, int height) -{ - int dx; - int dy; - - if (*x_1 > width) - { - dx = *x_1 - x_0; - dy = *y_1 - y_0; - - *x_1 = width; - if (dx) - *y_1 = ((width-x_0)*dy)/dx + y_0; - } - if (*x_1 < 0) - { - dx = *x_1 - x_0; - dy = *y_1 - y_0; - - *x_1 = 0; - if (dx) - *y_1 = ((0-x_0)*dy)/dx + y_0; - } - if (*y_1 > height) - { - dx = *x_1 - x_0; - dy = *y_1 - y_0; - - *y_1 = height; - if (dy) - *x_1 = ((height-y_0)*dx)/dy + x_0; - } - if (*y_1 < 0) - { - dx = *x_1 - x_0; - dy = *y_1 - y_0; - - *y_1 = 0; - if (dy) - *x_1 = ((0-y_0)*dx)/dy + x_0; - } -} - -#if CONFIG_POSTPROC -int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *ppflags) -{ - int q = oci->filter_level * 10 / 6; - int flags = ppflags->post_proc_flag; - int deblock_level = ppflags->deblocking_level; - int noise_level = ppflags->noise_level; - - if (!oci->frame_to_show) - return -1; - - if (q > 63) - q = 63; - - if (!flags) - { - *dest = *oci->frame_to_show; - - /* handle problem with extending borders */ - dest->y_width = oci->Width; - dest->y_height = oci->Height; - dest->uv_height = dest->y_height / 2; - oci->postproc_state.last_base_qindex = oci->base_qindex; - oci->postproc_state.last_frame_valid = 1; - return 0; - } - - /* Allocate post_proc_buffer_int if needed */ - if ((flags & VP8D_MFQE) && !oci->post_proc_buffer_int_used) - { - if ((flags & VP8D_DEBLOCK) || (flags & VP8D_DEMACROBLOCK)) - { - int width = (oci->Width + 15) & ~15; - int height = (oci->Height + 15) & ~15; - - if (vp8_yv12_alloc_frame_buffer(&oci->post_proc_buffer_int, - width, height, VP8BORDERINPIXELS)) - vpx_internal_error(&oci->error, VPX_CODEC_MEM_ERROR, - "Failed to allocate MFQE framebuffer"); - - oci->post_proc_buffer_int_used = 1; - - /* insure that postproc is set to all 0's so that post proc - * doesn't pull random data in from edge - */ - vpx_memset((&oci->post_proc_buffer_int)->buffer_alloc,128,(&oci->post_proc_buffer)->frame_size); - - } - } - - vp8_clear_system_state(); - - if ((flags & VP8D_MFQE) && - oci->postproc_state.last_frame_valid && - oci->current_video_frame >= 2 && - oci->postproc_state.last_base_qindex < 60 && - oci->base_qindex - oci->postproc_state.last_base_qindex >= 20) - { - vp8_multiframe_quality_enhance(oci); - if (((flags & VP8D_DEBLOCK) || (flags & VP8D_DEMACROBLOCK)) && - oci->post_proc_buffer_int_used) - { - vp8_yv12_copy_frame(&oci->post_proc_buffer, &oci->post_proc_buffer_int); - if (flags & VP8D_DEMACROBLOCK) - { - vp8_deblock(oci, &oci->post_proc_buffer_int, &oci->post_proc_buffer, - q + (deblock_level - 5) * 10, 1, 0); - vp8_de_mblock(&oci->post_proc_buffer, - q + (deblock_level - 5) * 10); - } - else if (flags & VP8D_DEBLOCK) - { - vp8_deblock(oci, &oci->post_proc_buffer_int, &oci->post_proc_buffer, - q, 1, 0); - } - } - /* Move partially towards the base q of the previous frame */ - oci->postproc_state.last_base_qindex = (3*oci->postproc_state.last_base_qindex + oci->base_qindex)>>2; - } - else if (flags & VP8D_DEMACROBLOCK) - { - vp8_deblock(oci, oci->frame_to_show, &oci->post_proc_buffer, - q + (deblock_level - 5) * 10, 1, 0); - vp8_de_mblock(&oci->post_proc_buffer, q + (deblock_level - 5) * 10); - - oci->postproc_state.last_base_qindex = oci->base_qindex; - } - else if (flags & VP8D_DEBLOCK) - { - vp8_deblock(oci, oci->frame_to_show, &oci->post_proc_buffer, - q, 1, 0); - oci->postproc_state.last_base_qindex = oci->base_qindex; - } - else - { - vp8_yv12_copy_frame(oci->frame_to_show, &oci->post_proc_buffer); - oci->postproc_state.last_base_qindex = oci->base_qindex; - } - oci->postproc_state.last_frame_valid = 1; - - if (flags & VP8D_ADDNOISE) - { - if (oci->postproc_state.last_q != q - || oci->postproc_state.last_noise != noise_level) - { - fillrd(&oci->postproc_state, 63 - q, noise_level); - } - - vp8_plane_add_noise - (oci->post_proc_buffer.y_buffer, - oci->postproc_state.noise, - oci->postproc_state.blackclamp, - oci->postproc_state.whiteclamp, - oci->postproc_state.bothclamp, - oci->post_proc_buffer.y_width, oci->post_proc_buffer.y_height, - oci->post_proc_buffer.y_stride); - } - -#if CONFIG_POSTPROC_VISUALIZER - if (flags & VP8D_DEBUG_TXT_FRAME_INFO) - { - char message[512]; - sprintf(message, "F%1dG%1dQ%3dF%3dP%d_s%dx%d", - (oci->frame_type == KEY_FRAME), - oci->refresh_golden_frame, - oci->base_qindex, - oci->filter_level, - flags, - oci->mb_cols, oci->mb_rows); - vp8_blit_text(message, oci->post_proc_buffer.y_buffer, oci->post_proc_buffer.y_stride); - } - - if (flags & VP8D_DEBUG_TXT_MBLK_MODES) - { - int i, j; - unsigned char *y_ptr; - YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer; - int mb_rows = post->y_height >> 4; - int mb_cols = post->y_width >> 4; - int mb_index = 0; - MODE_INFO *mi = oci->mi; - - y_ptr = post->y_buffer + 4 * post->y_stride + 4; - - /* vp8_filter each macro block */ - for (i = 0; i < mb_rows; i++) - { - for (j = 0; j < mb_cols; j++) - { - char zz[4]; - - sprintf(zz, "%c", mi[mb_index].mbmi.mode + 'a'); - - vp8_blit_text(zz, y_ptr, post->y_stride); - mb_index ++; - y_ptr += 16; - } - - mb_index ++; /* border */ - y_ptr += post->y_stride * 16 - post->y_width; - - } - } - - if (flags & VP8D_DEBUG_TXT_DC_DIFF) - { - int i, j; - unsigned char *y_ptr; - YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer; - int mb_rows = post->y_height >> 4; - int mb_cols = post->y_width >> 4; - int mb_index = 0; - MODE_INFO *mi = oci->mi; - - y_ptr = post->y_buffer + 4 * post->y_stride + 4; - - /* vp8_filter each macro block */ - for (i = 0; i < mb_rows; i++) - { - for (j = 0; j < mb_cols; j++) - { - char zz[4]; - int dc_diff = !(mi[mb_index].mbmi.mode != B_PRED && - mi[mb_index].mbmi.mode != SPLITMV && - mi[mb_index].mbmi.mb_skip_coeff); - - if (oci->frame_type == KEY_FRAME) - sprintf(zz, "a"); - else - sprintf(zz, "%c", dc_diff + '0'); - - vp8_blit_text(zz, y_ptr, post->y_stride); - mb_index ++; - y_ptr += 16; - } - - mb_index ++; /* border */ - y_ptr += post->y_stride * 16 - post->y_width; - - } - } - - if (flags & VP8D_DEBUG_TXT_RATE_INFO) - { - char message[512]; - sprintf(message, "Bitrate: %10.2f framerate: %10.2f ", oci->bitrate, oci->framerate); - vp8_blit_text(message, oci->post_proc_buffer.y_buffer, oci->post_proc_buffer.y_stride); - } - - /* Draw motion vectors */ - if ((flags & VP8D_DEBUG_DRAW_MV) && ppflags->display_mv_flag) - { - YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer; - int width = post->y_width; - int height = post->y_height; - unsigned char *y_buffer = oci->post_proc_buffer.y_buffer; - int y_stride = oci->post_proc_buffer.y_stride; - MODE_INFO *mi = oci->mi; - int x0, y0; - - for (y0 = 0; y0 < height; y0 += 16) - { - for (x0 = 0; x0 < width; x0 += 16) - { - int x1, y1; - - if (!(ppflags->display_mv_flag & (1<mbmi.mode))) - { - mi++; - continue; - } - - if (mi->mbmi.mode == SPLITMV) - { - switch (mi->mbmi.partitioning) - { - case 0 : /* mv_top_bottom */ - { - union b_mode_info *bmi = &mi->bmi[0]; - MV *mv = &bmi->mv.as_mv; - - x1 = x0 + 8 + (mv->col >> 3); - y1 = y0 + 4 + (mv->row >> 3); - - constrain_line (x0+8, &x1, y0+4, &y1, width, height); - vp8_blit_line (x0+8, x1, y0+4, y1, y_buffer, y_stride); - - bmi = &mi->bmi[8]; - - x1 = x0 + 8 + (mv->col >> 3); - y1 = y0 +12 + (mv->row >> 3); - - constrain_line (x0+8, &x1, y0+12, &y1, width, height); - vp8_blit_line (x0+8, x1, y0+12, y1, y_buffer, y_stride); - - break; - } - case 1 : /* mv_left_right */ - { - union b_mode_info *bmi = &mi->bmi[0]; - MV *mv = &bmi->mv.as_mv; - - x1 = x0 + 4 + (mv->col >> 3); - y1 = y0 + 8 + (mv->row >> 3); - - constrain_line (x0+4, &x1, y0+8, &y1, width, height); - vp8_blit_line (x0+4, x1, y0+8, y1, y_buffer, y_stride); - - bmi = &mi->bmi[2]; - - x1 = x0 +12 + (mv->col >> 3); - y1 = y0 + 8 + (mv->row >> 3); - - constrain_line (x0+12, &x1, y0+8, &y1, width, height); - vp8_blit_line (x0+12, x1, y0+8, y1, y_buffer, y_stride); - - break; - } - case 2 : /* mv_quarters */ - { - union b_mode_info *bmi = &mi->bmi[0]; - MV *mv = &bmi->mv.as_mv; - - x1 = x0 + 4 + (mv->col >> 3); - y1 = y0 + 4 + (mv->row >> 3); - - constrain_line (x0+4, &x1, y0+4, &y1, width, height); - vp8_blit_line (x0+4, x1, y0+4, y1, y_buffer, y_stride); - - bmi = &mi->bmi[2]; - - x1 = x0 +12 + (mv->col >> 3); - y1 = y0 + 4 + (mv->row >> 3); - - constrain_line (x0+12, &x1, y0+4, &y1, width, height); - vp8_blit_line (x0+12, x1, y0+4, y1, y_buffer, y_stride); - - bmi = &mi->bmi[8]; - - x1 = x0 + 4 + (mv->col >> 3); - y1 = y0 +12 + (mv->row >> 3); - - constrain_line (x0+4, &x1, y0+12, &y1, width, height); - vp8_blit_line (x0+4, x1, y0+12, y1, y_buffer, y_stride); - - bmi = &mi->bmi[10]; - - x1 = x0 +12 + (mv->col >> 3); - y1 = y0 +12 + (mv->row >> 3); - - constrain_line (x0+12, &x1, y0+12, &y1, width, height); - vp8_blit_line (x0+12, x1, y0+12, y1, y_buffer, y_stride); - break; - } - default : - { - union b_mode_info *bmi = mi->bmi; - int bx0, by0; - - for (by0 = y0; by0 < (y0+16); by0 += 4) - { - for (bx0 = x0; bx0 < (x0+16); bx0 += 4) - { - MV *mv = &bmi->mv.as_mv; - - x1 = bx0 + 2 + (mv->col >> 3); - y1 = by0 + 2 + (mv->row >> 3); - - constrain_line (bx0+2, &x1, by0+2, &y1, width, height); - vp8_blit_line (bx0+2, x1, by0+2, y1, y_buffer, y_stride); - - bmi++; - } - } - } - } - } - else if (mi->mbmi.mode >= NEARESTMV) - { - MV *mv = &mi->mbmi.mv.as_mv; - const int lx0 = x0 + 8; - const int ly0 = y0 + 8; - - x1 = lx0 + (mv->col >> 3); - y1 = ly0 + (mv->row >> 3); - - if (x1 != lx0 && y1 != ly0) - { - constrain_line (lx0, &x1, ly0-1, &y1, width, height); - vp8_blit_line (lx0, x1, ly0-1, y1, y_buffer, y_stride); - - constrain_line (lx0, &x1, ly0+1, &y1, width, height); - vp8_blit_line (lx0, x1, ly0+1, y1, y_buffer, y_stride); - } - else - vp8_blit_line (lx0, x1, ly0, y1, y_buffer, y_stride); - } - - mi++; - } - mi++; - } - } - - /* Color in block modes */ - if ((flags & VP8D_DEBUG_CLR_BLK_MODES) - && (ppflags->display_mb_modes_flag || ppflags->display_b_modes_flag)) - { - int y, x; - YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer; - int width = post->y_width; - int height = post->y_height; - unsigned char *y_ptr = oci->post_proc_buffer.y_buffer; - unsigned char *u_ptr = oci->post_proc_buffer.u_buffer; - unsigned char *v_ptr = oci->post_proc_buffer.v_buffer; - int y_stride = oci->post_proc_buffer.y_stride; - MODE_INFO *mi = oci->mi; - - for (y = 0; y < height; y += 16) - { - for (x = 0; x < width; x += 16) - { - int Y = 0, U = 0, V = 0; - - if (mi->mbmi.mode == B_PRED && - ((ppflags->display_mb_modes_flag & B_PRED) || ppflags->display_b_modes_flag)) - { - int by, bx; - unsigned char *yl, *ul, *vl; - union b_mode_info *bmi = mi->bmi; - - yl = y_ptr + x; - ul = u_ptr + (x>>1); - vl = v_ptr + (x>>1); - - for (by = 0; by < 16; by += 4) - { - for (bx = 0; bx < 16; bx += 4) - { - if ((ppflags->display_b_modes_flag & (1<mbmi.mode)) - || (ppflags->display_mb_modes_flag & B_PRED)) - { - Y = B_PREDICTION_MODE_colors[bmi->as_mode][0]; - U = B_PREDICTION_MODE_colors[bmi->as_mode][1]; - V = B_PREDICTION_MODE_colors[bmi->as_mode][2]; - - vp8_blend_b - (yl+bx, ul+(bx>>1), vl+(bx>>1), Y, U, V, 0xc000, y_stride); - } - bmi++; - } - - yl += y_stride*4; - ul += y_stride*1; - vl += y_stride*1; - } - } - else if (ppflags->display_mb_modes_flag & (1<mbmi.mode)) - { - Y = MB_PREDICTION_MODE_colors[mi->mbmi.mode][0]; - U = MB_PREDICTION_MODE_colors[mi->mbmi.mode][1]; - V = MB_PREDICTION_MODE_colors[mi->mbmi.mode][2]; - - vp8_blend_mb_inner - (y_ptr+x, u_ptr+(x>>1), v_ptr+(x>>1), Y, U, V, 0xc000, y_stride); - } - - mi++; - } - y_ptr += y_stride*16; - u_ptr += y_stride*4; - v_ptr += y_stride*4; - - mi++; - } - } - - /* Color in frame reference blocks */ - if ((flags & VP8D_DEBUG_CLR_FRM_REF_BLKS) && ppflags->display_ref_frame_flag) - { - int y, x; - YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer; - int width = post->y_width; - int height = post->y_height; - unsigned char *y_ptr = oci->post_proc_buffer.y_buffer; - unsigned char *u_ptr = oci->post_proc_buffer.u_buffer; - unsigned char *v_ptr = oci->post_proc_buffer.v_buffer; - int y_stride = oci->post_proc_buffer.y_stride; - MODE_INFO *mi = oci->mi; - - for (y = 0; y < height; y += 16) - { - for (x = 0; x < width; x +=16) - { - int Y = 0, U = 0, V = 0; - - if (ppflags->display_ref_frame_flag & (1<mbmi.ref_frame)) - { - Y = MV_REFERENCE_FRAME_colors[mi->mbmi.ref_frame][0]; - U = MV_REFERENCE_FRAME_colors[mi->mbmi.ref_frame][1]; - V = MV_REFERENCE_FRAME_colors[mi->mbmi.ref_frame][2]; - - vp8_blend_mb_outer - (y_ptr+x, u_ptr+(x>>1), v_ptr+(x>>1), Y, U, V, 0xc000, y_stride); - } - - mi++; - } - y_ptr += y_stride*16; - u_ptr += y_stride*4; - v_ptr += y_stride*4; - - mi++; - } - } -#endif - - *dest = oci->post_proc_buffer; - - /* handle problem with extending borders */ - dest->y_width = oci->Width; - dest->y_height = oci->Height; - dest->uv_height = dest->y_height / 2; - return 0; -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/postproc.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/postproc.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/postproc.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/postproc.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_POSTPROC_H_ -#define VP8_COMMON_POSTPROC_H_ - -#include "vpx_ports/mem.h" -struct postproc_state -{ - int last_q; - int last_noise; - char noise[3072]; - int last_base_qindex; - int last_frame_valid; - DECLARE_ALIGNED(16, char, blackclamp[16]); - DECLARE_ALIGNED(16, char, whiteclamp[16]); - DECLARE_ALIGNED(16, char, bothclamp[16]); -}; -#include "onyxc_int.h" -#include "ppflags.h" - -#ifdef __cplusplus -extern "C" { -#endif -int vp8_post_proc_frame(struct VP8Common *oci, YV12_BUFFER_CONFIG *dest, - vp8_ppflags_t *flags); - - -void vp8_de_noise(struct VP8Common *oci, - YV12_BUFFER_CONFIG *source, - YV12_BUFFER_CONFIG *post, - int q, - int low_var_thresh, - int flag, - int uvfilter); - -void vp8_deblock(struct VP8Common *oci, - YV12_BUFFER_CONFIG *source, - YV12_BUFFER_CONFIG *post, - int q, - int low_var_thresh, - int flag); - -#define MFQE_PRECISION 4 - -void vp8_multiframe_quality_enhance(struct VP8Common *cm); -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_POSTPROC_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/copy_altivec.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/copy_altivec.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/copy_altivec.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/copy_altivec.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - .globl copy_mem16x16_ppc - -;# r3 unsigned char *src -;# r4 int src_stride -;# r5 unsigned char *dst -;# r6 int dst_stride - -;# Make the assumption that input will not be aligned, -;# but the output will be. So two reads and a perm -;# for the input, but only one store for the output. -copy_mem16x16_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xe000 - mtspr 256, r12 ;# set VRSAVE - - li r10, 16 - mtctr r10 - -cp_16x16_loop: - lvsl v0, 0, r3 ;# permutate value for alignment - - lvx v1, 0, r3 - lvx v2, r10, r3 - - vperm v1, v1, v2, v0 - - stvx v1, 0, r5 - - add r3, r3, r4 ;# increment source pointer - add r5, r5, r6 ;# increment destination pointer - - bdnz cp_16x16_loop - - mtspr 256, r11 ;# reset old VRSAVE - - blr diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/filter_altivec.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/filter_altivec.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/filter_altivec.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/filter_altivec.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,1013 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - .globl sixtap_predict_ppc - .globl sixtap_predict8x4_ppc - .globl sixtap_predict8x8_ppc - .globl sixtap_predict16x16_ppc - -.macro load_c V, LABEL, OFF, R0, R1 - lis \R0, \LABEL@ha - la \R1, \LABEL@l(\R0) - lvx \V, \OFF, \R1 -.endm - -.macro load_hfilter V0, V1 - load_c \V0, HFilter, r5, r9, r10 - - addi r5, r5, 16 - lvx \V1, r5, r10 -.endm - -;# Vertical filtering -.macro Vprolog - load_c v0, VFilter, r6, r3, r10 - - vspltish v5, 8 - vspltish v6, 3 - vslh v6, v5, v6 ;# 0x0040 0040 0040 0040 0040 0040 0040 0040 - - vspltb v1, v0, 1 - vspltb v2, v0, 2 - vspltb v3, v0, 3 - vspltb v4, v0, 4 - vspltb v5, v0, 5 - vspltb v0, v0, 0 -.endm - -.macro vpre_load - Vprolog - li r10, 16 - lvx v10, 0, r9 ;# v10..v14 = first 5 rows - lvx v11, r10, r9 - addi r9, r9, 32 - lvx v12, 0, r9 - lvx v13, r10, r9 - addi r9, r9, 32 - lvx v14, 0, r9 -.endm - -.macro Msum Re, Ro, V, T, TMP - ;# (Re,Ro) += (V*T) - vmuleub \TMP, \V, \T ;# trashes v8 - vadduhm \Re, \Re, \TMP ;# Re = evens, saturation unnecessary - vmuloub \TMP, \V, \T - vadduhm \Ro, \Ro, \TMP ;# Ro = odds -.endm - -.macro vinterp_no_store P0 P1 P2 P3 P4 P5 - vmuleub v8, \P0, v0 ;# 64 + 4 positive taps - vadduhm v16, v6, v8 - vmuloub v8, \P0, v0 - vadduhm v17, v6, v8 - Msum v16, v17, \P2, v2, v8 - Msum v16, v17, \P3, v3, v8 - Msum v16, v17, \P5, v5, v8 - - vmuleub v18, \P1, v1 ;# 2 negative taps - vmuloub v19, \P1, v1 - Msum v18, v19, \P4, v4, v8 - - vsubuhs v16, v16, v18 ;# subtract neg from pos - vsubuhs v17, v17, v19 - vsrh v16, v16, v7 ;# divide by 128 - vsrh v17, v17, v7 ;# v16 v17 = evens, odds - vmrghh v18, v16, v17 ;# v18 v19 = 16-bit result in order - vmrglh v19, v16, v17 - vpkuhus \P0, v18, v19 ;# P0 = 8-bit result -.endm - -.macro vinterp_no_store_8x8 P0 P1 P2 P3 P4 P5 - vmuleub v24, \P0, v13 ;# 64 + 4 positive taps - vadduhm v21, v20, v24 - vmuloub v24, \P0, v13 - vadduhm v22, v20, v24 - Msum v21, v22, \P2, v15, v25 - Msum v21, v22, \P3, v16, v25 - Msum v21, v22, \P5, v18, v25 - - vmuleub v23, \P1, v14 ;# 2 negative taps - vmuloub v24, \P1, v14 - Msum v23, v24, \P4, v17, v25 - - vsubuhs v21, v21, v23 ;# subtract neg from pos - vsubuhs v22, v22, v24 - vsrh v21, v21, v19 ;# divide by 128 - vsrh v22, v22, v19 ;# v16 v17 = evens, odds - vmrghh v23, v21, v22 ;# v18 v19 = 16-bit result in order - vmrglh v24, v21, v22 - vpkuhus \P0, v23, v24 ;# P0 = 8-bit result -.endm - - -.macro Vinterp P0 P1 P2 P3 P4 P5 - vinterp_no_store \P0, \P1, \P2, \P3, \P4, \P5 - stvx \P0, 0, r7 - add r7, r7, r8 ;# 33 ops per 16 pels -.endm - - -.macro luma_v P0, P1, P2, P3, P4, P5 - addi r9, r9, 16 ;# P5 = newest input row - lvx \P5, 0, r9 - Vinterp \P0, \P1, \P2, \P3, \P4, \P5 -.endm - -.macro luma_vtwo - luma_v v10, v11, v12, v13, v14, v15 - luma_v v11, v12, v13, v14, v15, v10 -.endm - -.macro luma_vfour - luma_vtwo - luma_v v12, v13, v14, v15, v10, v11 - luma_v v13, v14, v15, v10, v11, v12 -.endm - -.macro luma_vsix - luma_vfour - luma_v v14, v15, v10, v11, v12, v13 - luma_v v15, v10, v11, v12, v13, v14 -.endm - -.macro Interp4 R I I4 - vmsummbm \R, v13, \I, v15 - vmsummbm \R, v14, \I4, \R -.endm - -.macro Read8x8 VD, RS, RP, increment_counter - lvsl v21, 0, \RS ;# permutate value for alignment - - ;# input to filter is 21 bytes wide, output is 16 bytes. - ;# input will can span three vectors if not aligned correctly. - lvx \VD, 0, \RS - lvx v20, r10, \RS - -.if \increment_counter - add \RS, \RS, \RP -.endif - - vperm \VD, \VD, v20, v21 -.endm - -.macro interp_8x8 R - vperm v20, \R, \R, v16 ;# v20 = 0123 1234 2345 3456 - vperm v21, \R, \R, v17 ;# v21 = 4567 5678 6789 789A - Interp4 v20, v20, v21 ;# v20 = result 0 1 2 3 - vperm \R, \R, \R, v18 ;# R = 89AB 9ABC ABCx BCxx - Interp4 v21, v21, \R ;# v21 = result 4 5 6 7 - - vpkswus \R, v20, v21 ;# R = 0 1 2 3 4 5 6 7 - vsrh \R, \R, v19 - - vpkuhus \R, \R, \R ;# saturate and pack - -.endm - -.macro Read4x4 VD, RS, RP, increment_counter - lvsl v21, 0, \RS ;# permutate value for alignment - - ;# input to filter is 21 bytes wide, output is 16 bytes. - ;# input will can span three vectors if not aligned correctly. - lvx v20, 0, \RS - -.if \increment_counter - add \RS, \RS, \RP -.endif - - vperm \VD, v20, v20, v21 -.endm - .text - - .align 2 -;# r3 unsigned char * src -;# r4 int src_pitch -;# r5 int x_offset -;# r6 int y_offset -;# r7 unsigned char * dst -;# r8 int dst_pitch -sixtap_predict_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xff87 - ori r12, r12, 0xffc0 - mtspr 256, r12 ;# set VRSAVE - - stwu r1,-32(r1) ;# create space on the stack - - slwi. r5, r5, 5 ;# index into horizontal filter array - - vspltish v19, 7 - - ;# If there isn't any filtering to be done for the horizontal, then - ;# just skip to the second pass. - beq- vertical_only_4x4 - - ;# load up horizontal filter - load_hfilter v13, v14 - - ;# rounding added in on the multiply - vspltisw v16, 8 - vspltisw v15, 3 - vslw v15, v16, v15 ;# 0x00000040000000400000004000000040 - - ;# Load up permutation constants - load_c v16, B_0123, 0, r9, r10 - load_c v17, B_4567, 0, r9, r10 - load_c v18, B_89AB, 0, r9, r10 - - ;# Back off input buffer by 2 bytes. Need 2 before and 3 after - addi r3, r3, -2 - - addi r9, r3, 0 - li r10, 16 - Read8x8 v2, r3, r4, 1 - Read8x8 v3, r3, r4, 1 - Read8x8 v4, r3, r4, 1 - Read8x8 v5, r3, r4, 1 - - slwi. r6, r6, 4 ;# index into vertical filter array - - ;# filter a line - interp_8x8 v2 - interp_8x8 v3 - interp_8x8 v4 - interp_8x8 v5 - - ;# Finished filtering main horizontal block. If there is no - ;# vertical filtering, jump to storing the data. Otherwise - ;# load up and filter the additional 5 lines that are needed - ;# for the vertical filter. - beq- store_4x4 - - ;# only needed if there is a vertical filter present - ;# if the second filter is not null then need to back off by 2*pitch - sub r9, r9, r4 - sub r9, r9, r4 - - Read8x8 v0, r9, r4, 1 - Read8x8 v1, r9, r4, 0 - Read8x8 v6, r3, r4, 1 - Read8x8 v7, r3, r4, 1 - Read8x8 v8, r3, r4, 0 - - interp_8x8 v0 - interp_8x8 v1 - interp_8x8 v6 - interp_8x8 v7 - interp_8x8 v8 - - b second_pass_4x4 - -vertical_only_4x4: - ;# only needed if there is a vertical filter present - ;# if the second filter is not null then need to back off by 2*pitch - sub r3, r3, r4 - sub r3, r3, r4 - li r10, 16 - - Read8x8 v0, r3, r4, 1 - Read8x8 v1, r3, r4, 1 - Read8x8 v2, r3, r4, 1 - Read8x8 v3, r3, r4, 1 - Read8x8 v4, r3, r4, 1 - Read8x8 v5, r3, r4, 1 - Read8x8 v6, r3, r4, 1 - Read8x8 v7, r3, r4, 1 - Read8x8 v8, r3, r4, 0 - - slwi r6, r6, 4 ;# index into vertical filter array - -second_pass_4x4: - load_c v20, b_hilo_4x4, 0, r9, r10 - load_c v21, b_hilo, 0, r9, r10 - - ;# reposition input so that it can go through the - ;# filtering phase with one pass. - vperm v0, v0, v1, v20 ;# 0 1 x x - vperm v2, v2, v3, v20 ;# 2 3 x x - vperm v4, v4, v5, v20 ;# 4 5 x x - vperm v6, v6, v7, v20 ;# 6 7 x x - - vperm v0, v0, v2, v21 ;# 0 1 2 3 - vperm v4, v4, v6, v21 ;# 4 5 6 7 - - vsldoi v1, v0, v4, 4 - vsldoi v2, v0, v4, 8 - vsldoi v3, v0, v4, 12 - - vsldoi v5, v4, v8, 4 - - load_c v13, VFilter, r6, r9, r10 - - vspltish v15, 8 - vspltish v20, 3 - vslh v20, v15, v20 ;# 0x0040 0040 0040 0040 0040 0040 0040 0040 - - vspltb v14, v13, 1 - vspltb v15, v13, 2 - vspltb v16, v13, 3 - vspltb v17, v13, 4 - vspltb v18, v13, 5 - vspltb v13, v13, 0 - - vinterp_no_store_8x8 v0, v1, v2, v3, v4, v5 - - stvx v0, 0, r1 - - lwz r0, 0(r1) - stw r0, 0(r7) - add r7, r7, r8 - - lwz r0, 4(r1) - stw r0, 0(r7) - add r7, r7, r8 - - lwz r0, 8(r1) - stw r0, 0(r7) - add r7, r7, r8 - - lwz r0, 12(r1) - stw r0, 0(r7) - - b exit_4x4 - -store_4x4: - - stvx v2, 0, r1 - lwz r0, 0(r1) - stw r0, 0(r7) - add r7, r7, r8 - - stvx v3, 0, r1 - lwz r0, 0(r1) - stw r0, 0(r7) - add r7, r7, r8 - - stvx v4, 0, r1 - lwz r0, 0(r1) - stw r0, 0(r7) - add r7, r7, r8 - - stvx v5, 0, r1 - lwz r0, 0(r1) - stw r0, 0(r7) - -exit_4x4: - - addi r1, r1, 32 ;# recover stack - - mtspr 256, r11 ;# reset old VRSAVE - - blr - -.macro w_8x8 V, D, R, P - stvx \V, 0, r1 - lwz \R, 0(r1) - stw \R, 0(r7) - lwz \R, 4(r1) - stw \R, 4(r7) - add \D, \D, \P -.endm - - .align 2 -;# r3 unsigned char * src -;# r4 int src_pitch -;# r5 int x_offset -;# r6 int y_offset -;# r7 unsigned char * dst -;# r8 int dst_pitch - -sixtap_predict8x4_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xffff - ori r12, r12, 0xffc0 - mtspr 256, r12 ;# set VRSAVE - - stwu r1,-32(r1) ;# create space on the stack - - slwi. r5, r5, 5 ;# index into horizontal filter array - - vspltish v19, 7 - - ;# If there isn't any filtering to be done for the horizontal, then - ;# just skip to the second pass. - beq- second_pass_pre_copy_8x4 - - load_hfilter v13, v14 - - ;# rounding added in on the multiply - vspltisw v16, 8 - vspltisw v15, 3 - vslw v15, v16, v15 ;# 0x00000040000000400000004000000040 - - ;# Load up permutation constants - load_c v16, B_0123, 0, r9, r10 - load_c v17, B_4567, 0, r9, r10 - load_c v18, B_89AB, 0, r9, r10 - - ;# Back off input buffer by 2 bytes. Need 2 before and 3 after - addi r3, r3, -2 - - addi r9, r3, 0 - li r10, 16 - Read8x8 v2, r3, r4, 1 - Read8x8 v3, r3, r4, 1 - Read8x8 v4, r3, r4, 1 - Read8x8 v5, r3, r4, 1 - - slwi. r6, r6, 4 ;# index into vertical filter array - - ;# filter a line - interp_8x8 v2 - interp_8x8 v3 - interp_8x8 v4 - interp_8x8 v5 - - ;# Finished filtering main horizontal block. If there is no - ;# vertical filtering, jump to storing the data. Otherwise - ;# load up and filter the additional 5 lines that are needed - ;# for the vertical filter. - beq- store_8x4 - - ;# only needed if there is a vertical filter present - ;# if the second filter is not null then need to back off by 2*pitch - sub r9, r9, r4 - sub r9, r9, r4 - - Read8x8 v0, r9, r4, 1 - Read8x8 v1, r9, r4, 0 - Read8x8 v6, r3, r4, 1 - Read8x8 v7, r3, r4, 1 - Read8x8 v8, r3, r4, 0 - - interp_8x8 v0 - interp_8x8 v1 - interp_8x8 v6 - interp_8x8 v7 - interp_8x8 v8 - - b second_pass_8x4 - -second_pass_pre_copy_8x4: - ;# only needed if there is a vertical filter present - ;# if the second filter is not null then need to back off by 2*pitch - sub r3, r3, r4 - sub r3, r3, r4 - li r10, 16 - - Read8x8 v0, r3, r4, 1 - Read8x8 v1, r3, r4, 1 - Read8x8 v2, r3, r4, 1 - Read8x8 v3, r3, r4, 1 - Read8x8 v4, r3, r4, 1 - Read8x8 v5, r3, r4, 1 - Read8x8 v6, r3, r4, 1 - Read8x8 v7, r3, r4, 1 - Read8x8 v8, r3, r4, 1 - - slwi r6, r6, 4 ;# index into vertical filter array - -second_pass_8x4: - load_c v13, VFilter, r6, r9, r10 - - vspltish v15, 8 - vspltish v20, 3 - vslh v20, v15, v20 ;# 0x0040 0040 0040 0040 0040 0040 0040 0040 - - vspltb v14, v13, 1 - vspltb v15, v13, 2 - vspltb v16, v13, 3 - vspltb v17, v13, 4 - vspltb v18, v13, 5 - vspltb v13, v13, 0 - - vinterp_no_store_8x8 v0, v1, v2, v3, v4, v5 - vinterp_no_store_8x8 v1, v2, v3, v4, v5, v6 - vinterp_no_store_8x8 v2, v3, v4, v5, v6, v7 - vinterp_no_store_8x8 v3, v4, v5, v6, v7, v8 - - cmpi cr0, r8, 8 - beq cr0, store_aligned_8x4 - - w_8x8 v0, r7, r0, r8 - w_8x8 v1, r7, r0, r8 - w_8x8 v2, r7, r0, r8 - w_8x8 v3, r7, r0, r8 - - b exit_8x4 - -store_aligned_8x4: - - load_c v10, b_hilo, 0, r9, r10 - - vperm v0, v0, v1, v10 - vperm v2, v2, v3, v10 - - stvx v0, 0, r7 - addi r7, r7, 16 - stvx v2, 0, r7 - - b exit_8x4 - -store_8x4: - cmpi cr0, r8, 8 - beq cr0, store_aligned2_8x4 - - w_8x8 v2, r7, r0, r8 - w_8x8 v3, r7, r0, r8 - w_8x8 v4, r7, r0, r8 - w_8x8 v5, r7, r0, r8 - - b exit_8x4 - -store_aligned2_8x4: - load_c v10, b_hilo, 0, r9, r10 - - vperm v2, v2, v3, v10 - vperm v4, v4, v5, v10 - - stvx v2, 0, r7 - addi r7, r7, 16 - stvx v4, 0, r7 - -exit_8x4: - - addi r1, r1, 32 ;# recover stack - - mtspr 256, r11 ;# reset old VRSAVE - - - blr - - .align 2 -;# r3 unsigned char * src -;# r4 int src_pitch -;# r5 int x_offset -;# r6 int y_offset -;# r7 unsigned char * dst -;# r8 int dst_pitch - -;# Because the width that needs to be filtered will fit in a single altivec -;# register there is no need to loop. Everything can stay in registers. -sixtap_predict8x8_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xffff - ori r12, r12, 0xffc0 - mtspr 256, r12 ;# set VRSAVE - - stwu r1,-32(r1) ;# create space on the stack - - slwi. r5, r5, 5 ;# index into horizontal filter array - - vspltish v19, 7 - - ;# If there isn't any filtering to be done for the horizontal, then - ;# just skip to the second pass. - beq- second_pass_pre_copy_8x8 - - load_hfilter v13, v14 - - ;# rounding added in on the multiply - vspltisw v16, 8 - vspltisw v15, 3 - vslw v15, v16, v15 ;# 0x00000040000000400000004000000040 - - ;# Load up permutation constants - load_c v16, B_0123, 0, r9, r10 - load_c v17, B_4567, 0, r9, r10 - load_c v18, B_89AB, 0, r9, r10 - - ;# Back off input buffer by 2 bytes. Need 2 before and 3 after - addi r3, r3, -2 - - addi r9, r3, 0 - li r10, 16 - Read8x8 v2, r3, r4, 1 - Read8x8 v3, r3, r4, 1 - Read8x8 v4, r3, r4, 1 - Read8x8 v5, r3, r4, 1 - Read8x8 v6, r3, r4, 1 - Read8x8 v7, r3, r4, 1 - Read8x8 v8, r3, r4, 1 - Read8x8 v9, r3, r4, 1 - - slwi. r6, r6, 4 ;# index into vertical filter array - - ;# filter a line - interp_8x8 v2 - interp_8x8 v3 - interp_8x8 v4 - interp_8x8 v5 - interp_8x8 v6 - interp_8x8 v7 - interp_8x8 v8 - interp_8x8 v9 - - ;# Finished filtering main horizontal block. If there is no - ;# vertical filtering, jump to storing the data. Otherwise - ;# load up and filter the additional 5 lines that are needed - ;# for the vertical filter. - beq- store_8x8 - - ;# only needed if there is a vertical filter present - ;# if the second filter is not null then need to back off by 2*pitch - sub r9, r9, r4 - sub r9, r9, r4 - - Read8x8 v0, r9, r4, 1 - Read8x8 v1, r9, r4, 0 - Read8x8 v10, r3, r4, 1 - Read8x8 v11, r3, r4, 1 - Read8x8 v12, r3, r4, 0 - - interp_8x8 v0 - interp_8x8 v1 - interp_8x8 v10 - interp_8x8 v11 - interp_8x8 v12 - - b second_pass_8x8 - -second_pass_pre_copy_8x8: - ;# only needed if there is a vertical filter present - ;# if the second filter is not null then need to back off by 2*pitch - sub r3, r3, r4 - sub r3, r3, r4 - li r10, 16 - - Read8x8 v0, r3, r4, 1 - Read8x8 v1, r3, r4, 1 - Read8x8 v2, r3, r4, 1 - Read8x8 v3, r3, r4, 1 - Read8x8 v4, r3, r4, 1 - Read8x8 v5, r3, r4, 1 - Read8x8 v6, r3, r4, 1 - Read8x8 v7, r3, r4, 1 - Read8x8 v8, r3, r4, 1 - Read8x8 v9, r3, r4, 1 - Read8x8 v10, r3, r4, 1 - Read8x8 v11, r3, r4, 1 - Read8x8 v12, r3, r4, 0 - - slwi r6, r6, 4 ;# index into vertical filter array - -second_pass_8x8: - load_c v13, VFilter, r6, r9, r10 - - vspltish v15, 8 - vspltish v20, 3 - vslh v20, v15, v20 ;# 0x0040 0040 0040 0040 0040 0040 0040 0040 - - vspltb v14, v13, 1 - vspltb v15, v13, 2 - vspltb v16, v13, 3 - vspltb v17, v13, 4 - vspltb v18, v13, 5 - vspltb v13, v13, 0 - - vinterp_no_store_8x8 v0, v1, v2, v3, v4, v5 - vinterp_no_store_8x8 v1, v2, v3, v4, v5, v6 - vinterp_no_store_8x8 v2, v3, v4, v5, v6, v7 - vinterp_no_store_8x8 v3, v4, v5, v6, v7, v8 - vinterp_no_store_8x8 v4, v5, v6, v7, v8, v9 - vinterp_no_store_8x8 v5, v6, v7, v8, v9, v10 - vinterp_no_store_8x8 v6, v7, v8, v9, v10, v11 - vinterp_no_store_8x8 v7, v8, v9, v10, v11, v12 - - cmpi cr0, r8, 8 - beq cr0, store_aligned_8x8 - - w_8x8 v0, r7, r0, r8 - w_8x8 v1, r7, r0, r8 - w_8x8 v2, r7, r0, r8 - w_8x8 v3, r7, r0, r8 - w_8x8 v4, r7, r0, r8 - w_8x8 v5, r7, r0, r8 - w_8x8 v6, r7, r0, r8 - w_8x8 v7, r7, r0, r8 - - b exit_8x8 - -store_aligned_8x8: - - load_c v10, b_hilo, 0, r9, r10 - - vperm v0, v0, v1, v10 - vperm v2, v2, v3, v10 - vperm v4, v4, v5, v10 - vperm v6, v6, v7, v10 - - stvx v0, 0, r7 - addi r7, r7, 16 - stvx v2, 0, r7 - addi r7, r7, 16 - stvx v4, 0, r7 - addi r7, r7, 16 - stvx v6, 0, r7 - - b exit_8x8 - -store_8x8: - cmpi cr0, r8, 8 - beq cr0, store_aligned2_8x8 - - w_8x8 v2, r7, r0, r8 - w_8x8 v3, r7, r0, r8 - w_8x8 v4, r7, r0, r8 - w_8x8 v5, r7, r0, r8 - w_8x8 v6, r7, r0, r8 - w_8x8 v7, r7, r0, r8 - w_8x8 v8, r7, r0, r8 - w_8x8 v9, r7, r0, r8 - - b exit_8x8 - -store_aligned2_8x8: - load_c v10, b_hilo, 0, r9, r10 - - vperm v2, v2, v3, v10 - vperm v4, v4, v5, v10 - vperm v6, v6, v7, v10 - vperm v8, v8, v9, v10 - - stvx v2, 0, r7 - addi r7, r7, 16 - stvx v4, 0, r7 - addi r7, r7, 16 - stvx v6, 0, r7 - addi r7, r7, 16 - stvx v8, 0, r7 - -exit_8x8: - - addi r1, r1, 32 ;# recover stack - - mtspr 256, r11 ;# reset old VRSAVE - - blr - - .align 2 -;# r3 unsigned char * src -;# r4 int src_pitch -;# r5 int x_offset -;# r6 int y_offset -;# r7 unsigned char * dst -;# r8 int dst_pitch - -;# Two pass filtering. First pass is Horizontal edges, second pass is vertical -;# edges. One of the filters can be null, but both won't be. Needs to use a -;# temporary buffer because the source buffer can't be modified and the buffer -;# for the destination is not large enough to hold the temporary data. -sixtap_predict16x16_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xffff - ori r12, r12, 0xf000 - mtspr 256, r12 ;# set VRSAVE - - stwu r1,-416(r1) ;# create space on the stack - - ;# Three possiblities - ;# 1. First filter is null. Don't use a temp buffer. - ;# 2. Second filter is null. Don't use a temp buffer. - ;# 3. Neither are null, use temp buffer. - - ;# First Pass (horizontal edge) - ;# setup pointers for src - ;# if possiblity (1) then setup the src pointer to be the orginal and jump - ;# to second pass. this is based on if x_offset is 0. - - ;# load up horizontal filter - slwi. r5, r5, 5 ;# index into horizontal filter array - - load_hfilter v4, v5 - - beq- copy_horizontal_16x21 - - ;# Back off input buffer by 2 bytes. Need 2 before and 3 after - addi r3, r3, -2 - - slwi. r6, r6, 4 ;# index into vertical filter array - - ;# setup constants - ;# v14 permutation value for alignment - load_c v14, b_hperm, 0, r9, r10 - - ;# These statements are guessing that there won't be a second pass, - ;# but if there is then inside the bypass they need to be set - li r0, 16 ;# prepare for no vertical filter - - ;# Change the output pointer and pitch to be the actual - ;# desination instead of a temporary buffer. - addi r9, r7, 0 - addi r5, r8, 0 - - ;# no vertical filter, so write the output from the first pass - ;# directly into the output buffer. - beq- no_vertical_filter_bypass - - ;# if the second filter is not null then need to back off by 2*pitch - sub r3, r3, r4 - sub r3, r3, r4 - - ;# setup counter for the number of lines that are going to be filtered - li r0, 21 - - ;# use the stack as temporary storage - la r9, 48(r1) - li r5, 16 - -no_vertical_filter_bypass: - - mtctr r0 - - ;# rounding added in on the multiply - vspltisw v10, 8 - vspltisw v12, 3 - vslw v12, v10, v12 ;# 0x00000040000000400000004000000040 - - ;# downshift by 7 ( divide by 128 ) at the end - vspltish v13, 7 - - ;# index to the next set of vectors in the row. - li r10, 16 - li r12, 32 - -horizontal_loop_16x16: - - lvsl v15, 0, r3 ;# permutate value for alignment - - ;# input to filter is 21 bytes wide, output is 16 bytes. - ;# input will can span three vectors if not aligned correctly. - lvx v1, 0, r3 - lvx v2, r10, r3 - lvx v3, r12, r3 - - vperm v8, v1, v2, v15 - vperm v9, v2, v3, v15 ;# v8 v9 = 21 input pixels left-justified - - vsldoi v11, v8, v9, 4 - - ;# set 0 - vmsummbm v6, v4, v8, v12 ;# taps times elements - vmsummbm v0, v5, v11, v6 - - ;# set 1 - vsldoi v10, v8, v9, 1 - vsldoi v11, v8, v9, 5 - - vmsummbm v6, v4, v10, v12 - vmsummbm v1, v5, v11, v6 - - ;# set 2 - vsldoi v10, v8, v9, 2 - vsldoi v11, v8, v9, 6 - - vmsummbm v6, v4, v10, v12 - vmsummbm v2, v5, v11, v6 - - ;# set 3 - vsldoi v10, v8, v9, 3 - vsldoi v11, v8, v9, 7 - - vmsummbm v6, v4, v10, v12 - vmsummbm v3, v5, v11, v6 - - vpkswus v0, v0, v1 ;# v0 = 0 4 8 C 1 5 9 D (16-bit) - vpkswus v1, v2, v3 ;# v1 = 2 6 A E 3 7 B F - - vsrh v0, v0, v13 ;# divide v0, v1 by 128 - vsrh v1, v1, v13 - - vpkuhus v0, v0, v1 ;# v0 = scrambled 8-bit result - vperm v0, v0, v0, v14 ;# v0 = correctly-ordered result - - stvx v0, 0, r9 - add r9, r9, r5 - - add r3, r3, r4 - - bdnz horizontal_loop_16x16 - - ;# check again to see if vertical filter needs to be done. - cmpi cr0, r6, 0 - beq cr0, end_16x16 - - ;# yes there is, so go to the second pass - b second_pass_16x16 - -copy_horizontal_16x21: - li r10, 21 - mtctr r10 - - li r10, 16 - - sub r3, r3, r4 - sub r3, r3, r4 - - ;# this is done above if there is a horizontal filter, - ;# if not it needs to be done down here. - slwi r6, r6, 4 ;# index into vertical filter array - - ;# always write to the stack when doing a horizontal copy - la r9, 48(r1) - -copy_horizontal_loop_16x21: - lvsl v15, 0, r3 ;# permutate value for alignment - - lvx v1, 0, r3 - lvx v2, r10, r3 - - vperm v8, v1, v2, v15 - - stvx v8, 0, r9 - addi r9, r9, 16 - - add r3, r3, r4 - - bdnz copy_horizontal_loop_16x21 - -second_pass_16x16: - - ;# always read from the stack when doing a vertical filter - la r9, 48(r1) - - ;# downshift by 7 ( divide by 128 ) at the end - vspltish v7, 7 - - vpre_load - - luma_vsix - luma_vsix - luma_vfour - -end_16x16: - - addi r1, r1, 416 ;# recover stack - - mtspr 256, r11 ;# reset old VRSAVE - - blr - - .data - - .align 4 -HFilter: - .byte 0, 0,128, 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,128, 0 - .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - .byte 0, -6,123, 12, 0, -6,123, 12, 0, -6,123, 12, 0, -6,123, 12 - .byte -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0 - .byte 2,-11,108, 36, 2,-11,108, 36, 2,-11,108, 36, 2,-11,108, 36 - .byte -8, 1, 0, 0, -8, 1, 0, 0, -8, 1, 0, 0, -8, 1, 0, 0 - .byte 0, -9, 93, 50, 0, -9, 93, 50, 0, -9, 93, 50, 0, -9, 93, 50 - .byte -6, 0, 0, 0, -6, 0, 0, 0, -6, 0, 0, 0, -6, 0, 0, 0 - .byte 3,-16, 77, 77, 3,-16, 77, 77, 3,-16, 77, 77, 3,-16, 77, 77 - .byte -16, 3, 0, 0,-16, 3, 0, 0,-16, 3, 0, 0,-16, 3, 0, 0 - .byte 0, -6, 50, 93, 0, -6, 50, 93, 0, -6, 50, 93, 0, -6, 50, 93 - .byte -9, 0, 0, 0, -9, 0, 0, 0, -9, 0, 0, 0, -9, 0, 0, 0 - .byte 1, -8, 36,108, 1, -8, 36,108, 1, -8, 36,108, 1, -8, 36,108 - .byte -11, 2, 0, 0,-11, 2, 0, 0,-11, 2, 0, 0,-11, 2, 0, 0 - .byte 0, -1, 12,123, 0, -1, 12,123, 0, -1, 12,123, 0, -1, 12,123 - .byte -6, 0, 0, 0, -6, 0, 0, 0, -6, 0, 0, 0, -6, 0, 0, 0 - - .align 4 -VFilter: - .byte 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - .byte 0, 6,123, 12, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - .byte 2, 11,108, 36, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - .byte 0, 9, 93, 50, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - .byte 3, 16, 77, 77, 16, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - .byte 0, 6, 50, 93, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - .byte 1, 8, 36,108, 11, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - .byte 0, 1, 12,123, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - - .align 4 -b_hperm: - .byte 0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15 - - .align 4 -B_0123: - .byte 0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6 - - .align 4 -B_4567: - .byte 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 8, 9, 7, 8, 9, 10 - - .align 4 -B_89AB: - .byte 8, 9, 10, 11, 9, 10, 11, 12, 10, 11, 12, 13, 11, 12, 13, 14 - - .align 4 -b_hilo: - .byte 0, 1, 2, 3, 4, 5, 6, 7, 16, 17, 18, 19, 20, 21, 22, 23 - - .align 4 -b_hilo_4x4: - .byte 0, 1, 2, 3, 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, 0 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/filter_bilinear_altivec.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/filter_bilinear_altivec.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/filter_bilinear_altivec.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/filter_bilinear_altivec.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,677 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - .globl bilinear_predict4x4_ppc - .globl bilinear_predict8x4_ppc - .globl bilinear_predict8x8_ppc - .globl bilinear_predict16x16_ppc - -.macro load_c V, LABEL, OFF, R0, R1 - lis \R0, \LABEL@ha - la \R1, \LABEL@l(\R0) - lvx \V, \OFF, \R1 -.endm - -.macro load_vfilter V0, V1 - load_c \V0, vfilter_b, r6, r9, r10 - - addi r6, r6, 16 - lvx \V1, r6, r10 -.endm - -.macro HProlog jump_label - ;# load up horizontal filter - slwi. r5, r5, 4 ;# index into horizontal filter array - - ;# index to the next set of vectors in the row. - li r10, 16 - li r12, 32 - - ;# downshift by 7 ( divide by 128 ) at the end - vspltish v19, 7 - - ;# If there isn't any filtering to be done for the horizontal, then - ;# just skip to the second pass. - beq \jump_label - - load_c v20, hfilter_b, r5, r9, r0 - - ;# setup constants - ;# v14 permutation value for alignment - load_c v28, b_hperm_b, 0, r9, r0 - - ;# rounding added in on the multiply - vspltisw v21, 8 - vspltisw v18, 3 - vslw v18, v21, v18 ;# 0x00000040000000400000004000000040 - - slwi. r6, r6, 5 ;# index into vertical filter array -.endm - -;# Filters a horizontal line -;# expects: -;# r3 src_ptr -;# r4 pitch -;# r10 16 -;# r12 32 -;# v17 perm intput -;# v18 rounding -;# v19 shift -;# v20 filter taps -;# v21 tmp -;# v22 tmp -;# v23 tmp -;# v24 tmp -;# v25 tmp -;# v26 tmp -;# v27 tmp -;# v28 perm output -;# -.macro HFilter V - vperm v24, v21, v21, v10 ;# v20 = 0123 1234 2345 3456 - vperm v25, v21, v21, v11 ;# v21 = 4567 5678 6789 789A - - vmsummbm v24, v20, v24, v18 - vmsummbm v25, v20, v25, v18 - - vpkswus v24, v24, v25 ;# v24 = 0 4 8 C 1 5 9 D (16-bit) - - vsrh v24, v24, v19 ;# divide v0, v1 by 128 - - vpkuhus \V, v24, v24 ;# \V = scrambled 8-bit result -.endm - -.macro hfilter_8 V, increment_counter - lvsl v17, 0, r3 ;# permutate value for alignment - - ;# input to filter is 9 bytes wide, output is 8 bytes. - lvx v21, 0, r3 - lvx v22, r10, r3 - -.if \increment_counter - add r3, r3, r4 -.endif - vperm v21, v21, v22, v17 - - HFilter \V -.endm - - -.macro load_and_align_8 V, increment_counter - lvsl v17, 0, r3 ;# permutate value for alignment - - ;# input to filter is 21 bytes wide, output is 16 bytes. - ;# input will can span three vectors if not aligned correctly. - lvx v21, 0, r3 - lvx v22, r10, r3 - -.if \increment_counter - add r3, r3, r4 -.endif - - vperm \V, v21, v22, v17 -.endm - -.macro write_aligned_8 V, increment_counter - stvx \V, 0, r7 - -.if \increment_counter - add r7, r7, r8 -.endif -.endm - -.macro vfilter_16 P0 P1 - vmuleub v22, \P0, v20 ;# 64 + 4 positive taps - vadduhm v22, v18, v22 - vmuloub v23, \P0, v20 - vadduhm v23, v18, v23 - - vmuleub v24, \P1, v21 - vadduhm v22, v22, v24 ;# Re = evens, saturation unnecessary - vmuloub v25, \P1, v21 - vadduhm v23, v23, v25 ;# Ro = odds - - vsrh v22, v22, v19 ;# divide by 128 - vsrh v23, v23, v19 ;# v16 v17 = evens, odds - vmrghh \P0, v22, v23 ;# v18 v19 = 16-bit result in order - vmrglh v23, v22, v23 - vpkuhus \P0, \P0, v23 ;# P0 = 8-bit result -.endm - - -.macro w_8x8 V, D, R, P - stvx \V, 0, r1 - lwz \R, 0(r1) - stw \R, 0(r7) - lwz \R, 4(r1) - stw \R, 4(r7) - add \D, \D, \P -.endm - - - .align 2 -;# r3 unsigned char * src -;# r4 int src_pitch -;# r5 int x_offset -;# r6 int y_offset -;# r7 unsigned char * dst -;# r8 int dst_pitch -bilinear_predict4x4_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xf830 - ori r12, r12, 0xfff8 - mtspr 256, r12 ;# set VRSAVE - - stwu r1,-32(r1) ;# create space on the stack - - HProlog second_pass_4x4_pre_copy_b - - ;# Load up permutation constants - load_c v10, b_0123_b, 0, r9, r12 - load_c v11, b_4567_b, 0, r9, r12 - - hfilter_8 v0, 1 - hfilter_8 v1, 1 - hfilter_8 v2, 1 - hfilter_8 v3, 1 - - ;# Finished filtering main horizontal block. If there is no - ;# vertical filtering, jump to storing the data. Otherwise - ;# load up and filter the additional line that is needed - ;# for the vertical filter. - beq store_out_4x4_b - - hfilter_8 v4, 0 - - b second_pass_4x4_b - -second_pass_4x4_pre_copy_b: - slwi r6, r6, 5 ;# index into vertical filter array - - load_and_align_8 v0, 1 - load_and_align_8 v1, 1 - load_and_align_8 v2, 1 - load_and_align_8 v3, 1 - load_and_align_8 v4, 1 - -second_pass_4x4_b: - vspltish v20, 8 - vspltish v18, 3 - vslh v18, v20, v18 ;# 0x0040 0040 0040 0040 0040 0040 0040 0040 - - load_vfilter v20, v21 - - vfilter_16 v0, v1 - vfilter_16 v1, v2 - vfilter_16 v2, v3 - vfilter_16 v3, v4 - -store_out_4x4_b: - - stvx v0, 0, r1 - lwz r0, 0(r1) - stw r0, 0(r7) - add r7, r7, r8 - - stvx v1, 0, r1 - lwz r0, 0(r1) - stw r0, 0(r7) - add r7, r7, r8 - - stvx v2, 0, r1 - lwz r0, 0(r1) - stw r0, 0(r7) - add r7, r7, r8 - - stvx v3, 0, r1 - lwz r0, 0(r1) - stw r0, 0(r7) - -exit_4x4: - - addi r1, r1, 32 ;# recover stack - mtspr 256, r11 ;# reset old VRSAVE - - blr - - .align 2 -;# r3 unsigned char * src -;# r4 int src_pitch -;# r5 int x_offset -;# r6 int y_offset -;# r7 unsigned char * dst -;# r8 int dst_pitch -bilinear_predict8x4_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xf830 - ori r12, r12, 0xfff8 - mtspr 256, r12 ;# set VRSAVE - - stwu r1,-32(r1) ;# create space on the stack - - HProlog second_pass_8x4_pre_copy_b - - ;# Load up permutation constants - load_c v10, b_0123_b, 0, r9, r12 - load_c v11, b_4567_b, 0, r9, r12 - - hfilter_8 v0, 1 - hfilter_8 v1, 1 - hfilter_8 v2, 1 - hfilter_8 v3, 1 - - ;# Finished filtering main horizontal block. If there is no - ;# vertical filtering, jump to storing the data. Otherwise - ;# load up and filter the additional line that is needed - ;# for the vertical filter. - beq store_out_8x4_b - - hfilter_8 v4, 0 - - b second_pass_8x4_b - -second_pass_8x4_pre_copy_b: - slwi r6, r6, 5 ;# index into vertical filter array - - load_and_align_8 v0, 1 - load_and_align_8 v1, 1 - load_and_align_8 v2, 1 - load_and_align_8 v3, 1 - load_and_align_8 v4, 1 - -second_pass_8x4_b: - vspltish v20, 8 - vspltish v18, 3 - vslh v18, v20, v18 ;# 0x0040 0040 0040 0040 0040 0040 0040 0040 - - load_vfilter v20, v21 - - vfilter_16 v0, v1 - vfilter_16 v1, v2 - vfilter_16 v2, v3 - vfilter_16 v3, v4 - -store_out_8x4_b: - - cmpi cr0, r8, 8 - beq cr0, store_aligned_8x4_b - - w_8x8 v0, r7, r0, r8 - w_8x8 v1, r7, r0, r8 - w_8x8 v2, r7, r0, r8 - w_8x8 v3, r7, r0, r8 - - b exit_8x4 - -store_aligned_8x4_b: - load_c v10, b_hilo_b, 0, r9, r10 - - vperm v0, v0, v1, v10 - vperm v2, v2, v3, v10 - - stvx v0, 0, r7 - addi r7, r7, 16 - stvx v2, 0, r7 - -exit_8x4: - - addi r1, r1, 32 ;# recover stack - mtspr 256, r11 ;# reset old VRSAVE - - blr - - .align 2 -;# r3 unsigned char * src -;# r4 int src_pitch -;# r5 int x_offset -;# r6 int y_offset -;# r7 unsigned char * dst -;# r8 int dst_pitch -bilinear_predict8x8_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xfff0 - ori r12, r12, 0xffff - mtspr 256, r12 ;# set VRSAVE - - stwu r1,-32(r1) ;# create space on the stack - - HProlog second_pass_8x8_pre_copy_b - - ;# Load up permutation constants - load_c v10, b_0123_b, 0, r9, r12 - load_c v11, b_4567_b, 0, r9, r12 - - hfilter_8 v0, 1 - hfilter_8 v1, 1 - hfilter_8 v2, 1 - hfilter_8 v3, 1 - hfilter_8 v4, 1 - hfilter_8 v5, 1 - hfilter_8 v6, 1 - hfilter_8 v7, 1 - - ;# Finished filtering main horizontal block. If there is no - ;# vertical filtering, jump to storing the data. Otherwise - ;# load up and filter the additional line that is needed - ;# for the vertical filter. - beq store_out_8x8_b - - hfilter_8 v8, 0 - - b second_pass_8x8_b - -second_pass_8x8_pre_copy_b: - slwi r6, r6, 5 ;# index into vertical filter array - - load_and_align_8 v0, 1 - load_and_align_8 v1, 1 - load_and_align_8 v2, 1 - load_and_align_8 v3, 1 - load_and_align_8 v4, 1 - load_and_align_8 v5, 1 - load_and_align_8 v6, 1 - load_and_align_8 v7, 1 - load_and_align_8 v8, 0 - -second_pass_8x8_b: - vspltish v20, 8 - vspltish v18, 3 - vslh v18, v20, v18 ;# 0x0040 0040 0040 0040 0040 0040 0040 0040 - - load_vfilter v20, v21 - - vfilter_16 v0, v1 - vfilter_16 v1, v2 - vfilter_16 v2, v3 - vfilter_16 v3, v4 - vfilter_16 v4, v5 - vfilter_16 v5, v6 - vfilter_16 v6, v7 - vfilter_16 v7, v8 - -store_out_8x8_b: - - cmpi cr0, r8, 8 - beq cr0, store_aligned_8x8_b - - w_8x8 v0, r7, r0, r8 - w_8x8 v1, r7, r0, r8 - w_8x8 v2, r7, r0, r8 - w_8x8 v3, r7, r0, r8 - w_8x8 v4, r7, r0, r8 - w_8x8 v5, r7, r0, r8 - w_8x8 v6, r7, r0, r8 - w_8x8 v7, r7, r0, r8 - - b exit_8x8 - -store_aligned_8x8_b: - load_c v10, b_hilo_b, 0, r9, r10 - - vperm v0, v0, v1, v10 - vperm v2, v2, v3, v10 - vperm v4, v4, v5, v10 - vperm v6, v6, v7, v10 - - stvx v0, 0, r7 - addi r7, r7, 16 - stvx v2, 0, r7 - addi r7, r7, 16 - stvx v4, 0, r7 - addi r7, r7, 16 - stvx v6, 0, r7 - -exit_8x8: - - addi r1, r1, 32 ;# recover stack - mtspr 256, r11 ;# reset old VRSAVE - - blr - -;# Filters a horizontal line -;# expects: -;# r3 src_ptr -;# r4 pitch -;# r10 16 -;# r12 32 -;# v17 perm intput -;# v18 rounding -;# v19 shift -;# v20 filter taps -;# v21 tmp -;# v22 tmp -;# v23 tmp -;# v24 tmp -;# v25 tmp -;# v26 tmp -;# v27 tmp -;# v28 perm output -;# -.macro hfilter_16 V, increment_counter - - lvsl v17, 0, r3 ;# permutate value for alignment - - ;# input to filter is 21 bytes wide, output is 16 bytes. - ;# input will can span three vectors if not aligned correctly. - lvx v21, 0, r3 - lvx v22, r10, r3 - lvx v23, r12, r3 - -.if \increment_counter - add r3, r3, r4 -.endif - vperm v21, v21, v22, v17 - vperm v22, v22, v23, v17 ;# v8 v9 = 21 input pixels left-justified - - ;# set 0 - vmsummbm v24, v20, v21, v18 ;# taps times elements - - ;# set 1 - vsldoi v23, v21, v22, 1 - vmsummbm v25, v20, v23, v18 - - ;# set 2 - vsldoi v23, v21, v22, 2 - vmsummbm v26, v20, v23, v18 - - ;# set 3 - vsldoi v23, v21, v22, 3 - vmsummbm v27, v20, v23, v18 - - vpkswus v24, v24, v25 ;# v24 = 0 4 8 C 1 5 9 D (16-bit) - vpkswus v25, v26, v27 ;# v25 = 2 6 A E 3 7 B F - - vsrh v24, v24, v19 ;# divide v0, v1 by 128 - vsrh v25, v25, v19 - - vpkuhus \V, v24, v25 ;# \V = scrambled 8-bit result - vperm \V, \V, v0, v28 ;# \V = correctly-ordered result -.endm - -.macro load_and_align_16 V, increment_counter - lvsl v17, 0, r3 ;# permutate value for alignment - - ;# input to filter is 21 bytes wide, output is 16 bytes. - ;# input will can span three vectors if not aligned correctly. - lvx v21, 0, r3 - lvx v22, r10, r3 - -.if \increment_counter - add r3, r3, r4 -.endif - - vperm \V, v21, v22, v17 -.endm - -.macro write_16 V, increment_counter - stvx \V, 0, r7 - -.if \increment_counter - add r7, r7, r8 -.endif -.endm - - .align 2 -;# r3 unsigned char * src -;# r4 int src_pitch -;# r5 int x_offset -;# r6 int y_offset -;# r7 unsigned char * dst -;# r8 int dst_pitch -bilinear_predict16x16_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xffff - ori r12, r12, 0xfff8 - mtspr 256, r12 ;# set VRSAVE - - HProlog second_pass_16x16_pre_copy_b - - hfilter_16 v0, 1 - hfilter_16 v1, 1 - hfilter_16 v2, 1 - hfilter_16 v3, 1 - hfilter_16 v4, 1 - hfilter_16 v5, 1 - hfilter_16 v6, 1 - hfilter_16 v7, 1 - hfilter_16 v8, 1 - hfilter_16 v9, 1 - hfilter_16 v10, 1 - hfilter_16 v11, 1 - hfilter_16 v12, 1 - hfilter_16 v13, 1 - hfilter_16 v14, 1 - hfilter_16 v15, 1 - - ;# Finished filtering main horizontal block. If there is no - ;# vertical filtering, jump to storing the data. Otherwise - ;# load up and filter the additional line that is needed - ;# for the vertical filter. - beq store_out_16x16_b - - hfilter_16 v16, 0 - - b second_pass_16x16_b - -second_pass_16x16_pre_copy_b: - slwi r6, r6, 5 ;# index into vertical filter array - - load_and_align_16 v0, 1 - load_and_align_16 v1, 1 - load_and_align_16 v2, 1 - load_and_align_16 v3, 1 - load_and_align_16 v4, 1 - load_and_align_16 v5, 1 - load_and_align_16 v6, 1 - load_and_align_16 v7, 1 - load_and_align_16 v8, 1 - load_and_align_16 v9, 1 - load_and_align_16 v10, 1 - load_and_align_16 v11, 1 - load_and_align_16 v12, 1 - load_and_align_16 v13, 1 - load_and_align_16 v14, 1 - load_and_align_16 v15, 1 - load_and_align_16 v16, 0 - -second_pass_16x16_b: - vspltish v20, 8 - vspltish v18, 3 - vslh v18, v20, v18 ;# 0x0040 0040 0040 0040 0040 0040 0040 0040 - - load_vfilter v20, v21 - - vfilter_16 v0, v1 - vfilter_16 v1, v2 - vfilter_16 v2, v3 - vfilter_16 v3, v4 - vfilter_16 v4, v5 - vfilter_16 v5, v6 - vfilter_16 v6, v7 - vfilter_16 v7, v8 - vfilter_16 v8, v9 - vfilter_16 v9, v10 - vfilter_16 v10, v11 - vfilter_16 v11, v12 - vfilter_16 v12, v13 - vfilter_16 v13, v14 - vfilter_16 v14, v15 - vfilter_16 v15, v16 - -store_out_16x16_b: - - write_16 v0, 1 - write_16 v1, 1 - write_16 v2, 1 - write_16 v3, 1 - write_16 v4, 1 - write_16 v5, 1 - write_16 v6, 1 - write_16 v7, 1 - write_16 v8, 1 - write_16 v9, 1 - write_16 v10, 1 - write_16 v11, 1 - write_16 v12, 1 - write_16 v13, 1 - write_16 v14, 1 - write_16 v15, 0 - - mtspr 256, r11 ;# reset old VRSAVE - - blr - - .data - - .align 4 -hfilter_b: - .byte 128, 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0 - .byte 112, 16, 0, 0,112, 16, 0, 0,112, 16, 0, 0,112, 16, 0, 0 - .byte 96, 32, 0, 0, 96, 32, 0, 0, 96, 32, 0, 0, 96, 32, 0, 0 - .byte 80, 48, 0, 0, 80, 48, 0, 0, 80, 48, 0, 0, 80, 48, 0, 0 - .byte 64, 64, 0, 0, 64, 64, 0, 0, 64, 64, 0, 0, 64, 64, 0, 0 - .byte 48, 80, 0, 0, 48, 80, 0, 0, 48, 80, 0, 0, 48, 80, 0, 0 - .byte 32, 96, 0, 0, 32, 96, 0, 0, 32, 96, 0, 0, 32, 96, 0, 0 - .byte 16,112, 0, 0, 16,112, 0, 0, 16,112, 0, 0, 16,112, 0, 0 - - .align 4 -vfilter_b: - .byte 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 - .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - .byte 112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112 - .byte 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 - .byte 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96 - .byte 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32 - .byte 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80 - .byte 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48 - .byte 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 - .byte 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 - .byte 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48 - .byte 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80 - .byte 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32 - .byte 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96 - .byte 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 - .byte 112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112 - - .align 4 -b_hperm_b: - .byte 0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15 - - .align 4 -b_0123_b: - .byte 0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6 - - .align 4 -b_4567_b: - .byte 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 8, 9, 7, 8, 9, 10 - -b_hilo_b: - .byte 0, 1, 2, 3, 4, 5, 6, 7, 16, 17, 18, 19, 20, 21, 22, 23 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/idctllm_altivec.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/idctllm_altivec.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/idctllm_altivec.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/idctllm_altivec.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,189 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - .globl short_idct4x4llm_ppc - -.macro load_c V, LABEL, OFF, R0, R1 - lis \R0, \LABEL@ha - la \R1, \LABEL@l(\R0) - lvx \V, \OFF, \R1 -.endm - -;# r3 short *input -;# r4 short *output -;# r5 int pitch - .align 2 -short_idct4x4llm_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xfff8 - mtspr 256, r12 ;# set VRSAVE - - load_c v8, sinpi8sqrt2, 0, r9, r10 - load_c v9, cospi8sqrt2minus1, 0, r9, r10 - load_c v10, hi_hi, 0, r9, r10 - load_c v11, lo_lo, 0, r9, r10 - load_c v12, shift_16, 0, r9, r10 - - li r10, 16 - lvx v0, 0, r3 ;# input ip[0], ip[ 4] - lvx v1, r10, r3 ;# input ip[8], ip[12] - - ;# first pass - vupkhsh v2, v0 - vupkhsh v3, v1 - vaddsws v6, v2, v3 ;# a1 = ip[0]+ip[8] - vsubsws v7, v2, v3 ;# b1 = ip[0]-ip[8] - - vupklsh v0, v0 - vmulosh v4, v0, v8 - vsraw v4, v4, v12 - vaddsws v4, v4, v0 ;# ip[ 4] * sin(pi/8) * sqrt(2) - - vupklsh v1, v1 - vmulosh v5, v1, v9 - vsraw v5, v5, v12 ;# ip[12] * cos(pi/8) * sqrt(2) - vaddsws v5, v5, v1 - - vsubsws v4, v4, v5 ;# c1 - - vmulosh v3, v1, v8 - vsraw v3, v3, v12 - vaddsws v3, v3, v1 ;# ip[12] * sin(pi/8) * sqrt(2) - - vmulosh v5, v0, v9 - vsraw v5, v5, v12 ;# ip[ 4] * cos(pi/8) * sqrt(2) - vaddsws v5, v5, v0 - - vaddsws v3, v3, v5 ;# d1 - - vaddsws v0, v6, v3 ;# a1 + d1 - vsubsws v3, v6, v3 ;# a1 - d1 - - vaddsws v1, v7, v4 ;# b1 + c1 - vsubsws v2, v7, v4 ;# b1 - c1 - - ;# transpose input - vmrghw v4, v0, v1 ;# a0 b0 a1 b1 - vmrghw v5, v2, v3 ;# c0 d0 c1 d1 - - vmrglw v6, v0, v1 ;# a2 b2 a3 b3 - vmrglw v7, v2, v3 ;# c2 d2 c3 d3 - - vperm v0, v4, v5, v10 ;# a0 b0 c0 d0 - vperm v1, v4, v5, v11 ;# a1 b1 c1 d1 - - vperm v2, v6, v7, v10 ;# a2 b2 c2 d2 - vperm v3, v6, v7, v11 ;# a3 b3 c3 d3 - - ;# second pass - vaddsws v6, v0, v2 ;# a1 = ip[0]+ip[8] - vsubsws v7, v0, v2 ;# b1 = ip[0]-ip[8] - - vmulosh v4, v1, v8 - vsraw v4, v4, v12 - vaddsws v4, v4, v1 ;# ip[ 4] * sin(pi/8) * sqrt(2) - - vmulosh v5, v3, v9 - vsraw v5, v5, v12 ;# ip[12] * cos(pi/8) * sqrt(2) - vaddsws v5, v5, v3 - - vsubsws v4, v4, v5 ;# c1 - - vmulosh v2, v3, v8 - vsraw v2, v2, v12 - vaddsws v2, v2, v3 ;# ip[12] * sin(pi/8) * sqrt(2) - - vmulosh v5, v1, v9 - vsraw v5, v5, v12 ;# ip[ 4] * cos(pi/8) * sqrt(2) - vaddsws v5, v5, v1 - - vaddsws v3, v2, v5 ;# d1 - - vaddsws v0, v6, v3 ;# a1 + d1 - vsubsws v3, v6, v3 ;# a1 - d1 - - vaddsws v1, v7, v4 ;# b1 + c1 - vsubsws v2, v7, v4 ;# b1 - c1 - - vspltish v6, 4 - vspltish v7, 3 - - vpkswss v0, v0, v1 - vpkswss v1, v2, v3 - - vaddshs v0, v0, v6 - vaddshs v1, v1, v6 - - vsrah v0, v0, v7 - vsrah v1, v1, v7 - - ;# transpose output - vmrghh v2, v0, v1 ;# a0 c0 a1 c1 a2 c2 a3 c3 - vmrglh v3, v0, v1 ;# b0 d0 b1 d1 b2 d2 b3 d3 - - vmrghh v0, v2, v3 ;# a0 b0 c0 d0 a1 b1 c1 d1 - vmrglh v1, v2, v3 ;# a2 b2 c2 d2 a3 b3 c3 d3 - - stwu r1,-416(r1) ;# create space on the stack - - stvx v0, 0, r1 - lwz r6, 0(r1) - stw r6, 0(r4) - lwz r6, 4(r1) - stw r6, 4(r4) - - add r4, r4, r5 - - lwz r6, 8(r1) - stw r6, 0(r4) - lwz r6, 12(r1) - stw r6, 4(r4) - - add r4, r4, r5 - - stvx v1, 0, r1 - lwz r6, 0(r1) - stw r6, 0(r4) - lwz r6, 4(r1) - stw r6, 4(r4) - - add r4, r4, r5 - - lwz r6, 8(r1) - stw r6, 0(r4) - lwz r6, 12(r1) - stw r6, 4(r4) - - addi r1, r1, 416 ;# recover stack - - mtspr 256, r11 ;# reset old VRSAVE - - blr - - .align 4 -sinpi8sqrt2: - .short 35468, 35468, 35468, 35468, 35468, 35468, 35468, 35468 - - .align 4 -cospi8sqrt2minus1: - .short 20091, 20091, 20091, 20091, 20091, 20091, 20091, 20091 - - .align 4 -shift_16: - .long 16, 16, 16, 16 - - .align 4 -hi_hi: - .byte 0, 1, 2, 3, 4, 5, 6, 7, 16, 17, 18, 19, 20, 21, 22, 23 - - .align 4 -lo_lo: - .byte 8, 9, 10, 11, 12, 13, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/loopfilter_altivec.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/loopfilter_altivec.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/loopfilter_altivec.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/loopfilter_altivec.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "loopfilter.h" -#include "onyxc_int.h" - -typedef void loop_filter_function_y_ppc -( - unsigned char *s, // source pointer - int p, // pitch - const signed char *flimit, - const signed char *limit, - const signed char *thresh -); - -typedef void loop_filter_function_uv_ppc -( - unsigned char *u, // source pointer - unsigned char *v, // source pointer - int p, // pitch - const signed char *flimit, - const signed char *limit, - const signed char *thresh -); - -typedef void loop_filter_function_s_ppc -( - unsigned char *s, // source pointer - int p, // pitch - const signed char *flimit -); - -loop_filter_function_y_ppc mbloop_filter_horizontal_edge_y_ppc; -loop_filter_function_y_ppc mbloop_filter_vertical_edge_y_ppc; -loop_filter_function_y_ppc loop_filter_horizontal_edge_y_ppc; -loop_filter_function_y_ppc loop_filter_vertical_edge_y_ppc; - -loop_filter_function_uv_ppc mbloop_filter_horizontal_edge_uv_ppc; -loop_filter_function_uv_ppc mbloop_filter_vertical_edge_uv_ppc; -loop_filter_function_uv_ppc loop_filter_horizontal_edge_uv_ppc; -loop_filter_function_uv_ppc loop_filter_vertical_edge_uv_ppc; - -loop_filter_function_s_ppc loop_filter_simple_horizontal_edge_ppc; -loop_filter_function_s_ppc loop_filter_simple_vertical_edge_ppc; - -// Horizontal MB filtering -void loop_filter_mbh_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - mbloop_filter_horizontal_edge_y_ppc(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr); - - if (u_ptr) - mbloop_filter_horizontal_edge_uv_ppc(u_ptr, v_ptr, uv_stride, lfi->mbflim, lfi->lim, lfi->thr); -} - -void loop_filter_mbhs_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - (void)u_ptr; - (void)v_ptr; - (void)uv_stride; - loop_filter_simple_horizontal_edge_ppc(y_ptr, y_stride, lfi->mbflim); -} - -// Vertical MB Filtering -void loop_filter_mbv_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - mbloop_filter_vertical_edge_y_ppc(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr); - - if (u_ptr) - mbloop_filter_vertical_edge_uv_ppc(u_ptr, v_ptr, uv_stride, lfi->mbflim, lfi->lim, lfi->thr); -} - -void loop_filter_mbvs_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - (void)u_ptr; - (void)v_ptr; - (void)uv_stride; - loop_filter_simple_vertical_edge_ppc(y_ptr, y_stride, lfi->mbflim); -} - -// Horizontal B Filtering -void loop_filter_bh_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - // These should all be done at once with one call, instead of 3 - loop_filter_horizontal_edge_y_ppc(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr); - loop_filter_horizontal_edge_y_ppc(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr); - loop_filter_horizontal_edge_y_ppc(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr); - - if (u_ptr) - loop_filter_horizontal_edge_uv_ppc(u_ptr + 4 * uv_stride, v_ptr + 4 * uv_stride, uv_stride, lfi->flim, lfi->lim, lfi->thr); -} - -void loop_filter_bhs_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - (void)u_ptr; - (void)v_ptr; - (void)uv_stride; - loop_filter_simple_horizontal_edge_ppc(y_ptr + 4 * y_stride, y_stride, lfi->flim); - loop_filter_simple_horizontal_edge_ppc(y_ptr + 8 * y_stride, y_stride, lfi->flim); - loop_filter_simple_horizontal_edge_ppc(y_ptr + 12 * y_stride, y_stride, lfi->flim); -} - -// Vertical B Filtering -void loop_filter_bv_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - loop_filter_vertical_edge_y_ppc(y_ptr, y_stride, lfi->flim, lfi->lim, lfi->thr); - - if (u_ptr) - loop_filter_vertical_edge_uv_ppc(u_ptr + 4, v_ptr + 4, uv_stride, lfi->flim, lfi->lim, lfi->thr); -} - -void loop_filter_bvs_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - (void)u_ptr; - (void)v_ptr; - (void)uv_stride; - loop_filter_simple_vertical_edge_ppc(y_ptr + 4, y_stride, lfi->flim); - loop_filter_simple_vertical_edge_ppc(y_ptr + 8, y_stride, lfi->flim); - loop_filter_simple_vertical_edge_ppc(y_ptr + 12, y_stride, lfi->flim); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/loopfilter_filters_altivec.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/loopfilter_filters_altivec.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/loopfilter_filters_altivec.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/loopfilter_filters_altivec.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,1253 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - .globl mbloop_filter_horizontal_edge_y_ppc - .globl loop_filter_horizontal_edge_y_ppc - .globl mbloop_filter_vertical_edge_y_ppc - .globl loop_filter_vertical_edge_y_ppc - - .globl mbloop_filter_horizontal_edge_uv_ppc - .globl loop_filter_horizontal_edge_uv_ppc - .globl mbloop_filter_vertical_edge_uv_ppc - .globl loop_filter_vertical_edge_uv_ppc - - .globl loop_filter_simple_horizontal_edge_ppc - .globl loop_filter_simple_vertical_edge_ppc - - .text -;# We often need to perform transposes (and other transpose-like operations) -;# on matrices of data. This is simplified by the fact that we usually -;# operate on hunks of data whose dimensions are powers of 2, or at least -;# divisible by highish powers of 2. -;# -;# These operations can be very confusing. They become more straightforward -;# when we think of them as permutations of address bits: Concatenate a -;# group of vector registers and think of it as occupying a block of -;# memory beginning at address zero. The low four bits 0...3 of the -;# address then correspond to position within a register, the higher-order -;# address bits select the register. -;# -;# Although register selection, at the code level, is arbitrary, things -;# are simpler if we use contiguous ranges of register numbers, simpler -;# still if the low-order bits of the register number correspond to -;# conceptual address bits. We do this whenever reasonable. -;# -;# A 16x16 transpose can then be thought of as an operation on -;# a 256-element block of memory. It takes 8 bits 0...7 to address this -;# memory and the effect of a transpose is to interchange address bit -;# 0 with 4, 1 with 5, 2 with 6, and 3 with 7. Bits 0...3 index the -;# column, which is interchanged with the row addressed by bits 4..7. -;# -;# The altivec merge instructions provide a rapid means of effecting -;# many of these transforms. They operate at three widths (8,16,32). -;# Writing V(x) for vector register #x, paired merges permute address -;# indices as follows. -;# -;# 0->1 1->2 2->3 3->(4+d) (4+s)->0: -;# -;# vmrghb V( x), V( y), V( y + (1<2 2->3 3->(4+d) (4+s)->1: -;# -;# vmrghh V( x), V( y), V( y + (1<3 3->(4+d) (4+s)->2: -;# -;# vmrghw V( x), V( y), V( y + (1<(4+d) (4+s)->3 by the sequence: -;# -;# vperm V( x), V( y), V( y + (1<4 1<->5 2<->6 3<->7, which we accomplish by -;# 4 iterations of the cyclic transform 0->1->2->3->4->5->6->7->0. -;# -;# Except for the fact that the destination registers get written -;# before we are done referencing the old contents, the cyclic transform -;# is effected by -;# -;# x = 0; do { -;# vmrghb V(2x), V(x), V(x+8); -;# vmrghb V(2x+1), V(x), V(x+8); -;# } while( ++x < 8); -;# -;# For clarity, and because we can afford it, we do this transpose -;# using all 32 registers, alternating the banks 0..15 and 16 .. 31, -;# leaving the final result in 16 .. 31, as the lower registers are -;# used in the filtering itself. -;# -.macro Tpair A, B, X, Y - vmrghb \A, \X, \Y - vmrglb \B, \X, \Y -.endm - -;# Each step takes 8*2 = 16 instructions - -.macro t16_even - Tpair v16,v17, v0,v8 - Tpair v18,v19, v1,v9 - Tpair v20,v21, v2,v10 - Tpair v22,v23, v3,v11 - Tpair v24,v25, v4,v12 - Tpair v26,v27, v5,v13 - Tpair v28,v29, v6,v14 - Tpair v30,v31, v7,v15 -.endm - -.macro t16_odd - Tpair v0,v1, v16,v24 - Tpair v2,v3, v17,v25 - Tpair v4,v5, v18,v26 - Tpair v6,v7, v19,v27 - Tpair v8,v9, v20,v28 - Tpair v10,v11, v21,v29 - Tpair v12,v13, v22,v30 - Tpair v14,v15, v23,v31 -.endm - -;# Whole transpose takes 4*16 = 64 instructions - -.macro t16_full - t16_odd - t16_even - t16_odd - t16_even -.endm - -;# Vertical edge filtering requires transposes. For the simple filter, -;# we need to convert 16 rows of 4 pels each into 4 registers of 16 pels -;# each. Writing 0 ... 63 for the pixel indices, the desired result is: -;# -;# v0 = 0 1 ... 14 15 -;# v1 = 16 17 ... 30 31 -;# v2 = 32 33 ... 47 48 -;# v3 = 49 50 ... 62 63 -;# -;# In frame-buffer memory, the layout is: -;# -;# 0 16 32 48 -;# 1 17 33 49 -;# ... -;# 15 31 47 63. -;# -;# We begin by reading the data 32 bits at a time (using scalar operations) -;# into a temporary array, reading the rows of the array into vector registers, -;# with the following layout: -;# -;# v0 = 0 16 32 48 4 20 36 52 8 24 40 56 12 28 44 60 -;# v1 = 1 17 33 49 5 21 ... 45 61 -;# v2 = 2 18 ... 46 62 -;# v3 = 3 19 ... 47 63 -;# -;# From the "address-bit" perspective discussed above, we simply need to -;# interchange bits 0 <-> 4 and 1 <-> 5, leaving bits 2 and 3 alone. -;# In other words, we transpose each of the four 4x4 submatrices. -;# -;# This transformation is its own inverse, and we need to perform it -;# again before writing the pixels back into the frame buffer. -;# -;# It acts in place on registers v0...v3, uses v4...v7 as temporaries, -;# and assumes that v14/v15 contain the b_hihi/b_lolo selectors -;# defined above. We think of both groups of 4 registers as having -;# "addresses" {0,1,2,3} * 16. -;# -.macro Transpose4times4x4 Vlo, Vhi - - ;# d=s=0 0->1 1->2 2->3 3->4 4->0 =5= - - vmrghb v4, v0, v1 - vmrglb v5, v0, v1 - vmrghb v6, v2, v3 - vmrglb v7, v2, v3 - - ;# d=0 s=1 =0= 1->2 2->3 3->4 4->5 5->1 - - vmrghh v0, v4, v6 - vmrglh v1, v4, v6 - vmrghh v2, v5, v7 - vmrglh v3, v5, v7 - - ;# d=s=0 =0= =1= 2->3 3->4 4->2 =5= - - vmrghw v4, v0, v1 - vmrglw v5, v0, v1 - vmrghw v6, v2, v3 - vmrglw v7, v2, v3 - - ;# d=0 s=1 =0= =1= =2= 3->4 4->5 5->3 - - vperm v0, v4, v6, \Vlo - vperm v1, v4, v6, \Vhi - vperm v2, v5, v7, \Vlo - vperm v3, v5, v7, \Vhi -.endm -;# end Transpose4times4x4 - - -;# Normal mb vertical edge filter transpose. -;# -;# We read 8 columns of data, initially in the following pattern: -;# -;# (0,0) (1,0) ... (7,0) (0,1) (1,1) ... (7,1) -;# (0,2) (1,2) ... (7,2) (0,3) (1,3) ... (7,3) -;# ... -;# (0,14) (1,14) .. (7,14) (0,15) (1,15) .. (7,15) -;# -;# and wish to convert to: -;# -;# (0,0) ... (0,15) -;# (1,0) ... (1,15) -;# ... -;# (7,0) ... (7,15). -;# -;# In "address bit" language, we wish to map -;# -;# 0->4 1->5 2->6 3->0 4->1 5->2 6->3, i.e., I -> (I+4) mod 7. -;# -;# This can be accomplished by 4 iterations of the cyclic transform -;# -;# I -> (I+1) mod 7; -;# -;# each iteration can be realized by (d=0, s=2): -;# -;# x = 0; do Tpair( V(2x),V(2x+1), V(x),V(x+4)) while( ++x < 4); -;# -;# The input/output is in registers v0...v7. We use v10...v17 as mirrors; -;# preserving v8 = sign converter. -;# -;# Inverse transpose is similar, except here I -> (I+3) mod 7 and the -;# result lands in the "mirror" registers v10...v17 -;# -.macro t8x16_odd - Tpair v10, v11, v0, v4 - Tpair v12, v13, v1, v5 - Tpair v14, v15, v2, v6 - Tpair v16, v17, v3, v7 -.endm - -.macro t8x16_even - Tpair v0, v1, v10, v14 - Tpair v2, v3, v11, v15 - Tpair v4, v5, v12, v16 - Tpair v6, v7, v13, v17 -.endm - -.macro transpose8x16_fwd - t8x16_odd - t8x16_even - t8x16_odd - t8x16_even -.endm - -.macro transpose8x16_inv - t8x16_odd - t8x16_even - t8x16_odd -.endm - -.macro Transpose16x16 - vmrghb v0, v16, v24 - vmrglb v1, v16, v24 - vmrghb v2, v17, v25 - vmrglb v3, v17, v25 - vmrghb v4, v18, v26 - vmrglb v5, v18, v26 - vmrghb v6, v19, v27 - vmrglb v7, v19, v27 - vmrghb v8, v20, v28 - vmrglb v9, v20, v28 - vmrghb v10, v21, v29 - vmrglb v11, v21, v29 - vmrghb v12, v22, v30 - vmrglb v13, v22, v30 - vmrghb v14, v23, v31 - vmrglb v15, v23, v31 - vmrghb v16, v0, v8 - vmrglb v17, v0, v8 - vmrghb v18, v1, v9 - vmrglb v19, v1, v9 - vmrghb v20, v2, v10 - vmrglb v21, v2, v10 - vmrghb v22, v3, v11 - vmrglb v23, v3, v11 - vmrghb v24, v4, v12 - vmrglb v25, v4, v12 - vmrghb v26, v5, v13 - vmrglb v27, v5, v13 - vmrghb v28, v6, v14 - vmrglb v29, v6, v14 - vmrghb v30, v7, v15 - vmrglb v31, v7, v15 - vmrghb v0, v16, v24 - vmrglb v1, v16, v24 - vmrghb v2, v17, v25 - vmrglb v3, v17, v25 - vmrghb v4, v18, v26 - vmrglb v5, v18, v26 - vmrghb v6, v19, v27 - vmrglb v7, v19, v27 - vmrghb v8, v20, v28 - vmrglb v9, v20, v28 - vmrghb v10, v21, v29 - vmrglb v11, v21, v29 - vmrghb v12, v22, v30 - vmrglb v13, v22, v30 - vmrghb v14, v23, v31 - vmrglb v15, v23, v31 - vmrghb v16, v0, v8 - vmrglb v17, v0, v8 - vmrghb v18, v1, v9 - vmrglb v19, v1, v9 - vmrghb v20, v2, v10 - vmrglb v21, v2, v10 - vmrghb v22, v3, v11 - vmrglb v23, v3, v11 - vmrghb v24, v4, v12 - vmrglb v25, v4, v12 - vmrghb v26, v5, v13 - vmrglb v27, v5, v13 - vmrghb v28, v6, v14 - vmrglb v29, v6, v14 - vmrghb v30, v7, v15 - vmrglb v31, v7, v15 -.endm - -;# load_g loads a global vector (whose address is in the local variable Gptr) -;# into vector register Vreg. Trashes r0 -.macro load_g Vreg, Gptr - lwz r0, \Gptr - lvx \Vreg, 0, r0 -.endm - -;# exploit the saturation here. if the answer is negative -;# it will be clamped to 0. orring 0 with a positive -;# number will be the positive number (abs) -;# RES = abs( A-B), trashes TMP -.macro Abs RES, TMP, A, B - vsububs \RES, \A, \B - vsububs \TMP, \B, \A - vor \RES, \RES, \TMP -.endm - -;# RES = Max( RES, abs( A-B)), trashes TMP -.macro max_abs RES, TMP, A, B - vsububs \TMP, \A, \B - vmaxub \RES, \RES, \TMP - vsububs \TMP, \B, \A - vmaxub \RES, \RES, \TMP -.endm - -.macro Masks - ;# build masks - ;# input is all 8 bit unsigned (0-255). need to - ;# do abs(vala-valb) > limit. but no need to compare each - ;# value to the limit. find the max of the absolute differences - ;# and compare that to the limit. - ;# First hev - Abs v14, v13, v2, v3 ;# |P1 - P0| - max_abs v14, v13, v5, v4 ;# |Q1 - Q0| - - vcmpgtub v10, v14, v10 ;# HEV = true if thresh exceeded - - ;# Next limit - max_abs v14, v13, v0, v1 ;# |P3 - P2| - max_abs v14, v13, v1, v2 ;# |P2 - P1| - max_abs v14, v13, v6, v5 ;# |Q2 - Q1| - max_abs v14, v13, v7, v6 ;# |Q3 - Q2| - - vcmpgtub v9, v14, v9 ;# R = true if limit exceeded - - ;# flimit - Abs v14, v13, v3, v4 ;# |P0 - Q0| - - vcmpgtub v8, v14, v8 ;# X = true if flimit exceeded - - vor v8, v8, v9 ;# R = true if flimit or limit exceeded - ;# done building masks -.endm - -.macro build_constants RFL, RLI, RTH, FL, LI, TH - ;# build constants - lvx \FL, 0, \RFL ;# flimit - lvx \LI, 0, \RLI ;# limit - lvx \TH, 0, \RTH ;# thresh - - vspltisb v11, 8 - vspltisb v12, 4 - vslb v11, v11, v12 ;# 0x80808080808080808080808080808080 -.endm - -.macro load_data_y - ;# setup strides/pointers to be able to access - ;# all of the data - add r5, r4, r4 ;# r5 = 2 * stride - sub r6, r3, r5 ;# r6 -> 2 rows back - neg r7, r4 ;# r7 = -stride - - ;# load 16 pixels worth of data to work on - sub r0, r6, r5 ;# r0 -> 4 rows back (temp) - lvx v0, 0, r0 ;# P3 (read only) - lvx v1, r7, r6 ;# P2 - lvx v2, 0, r6 ;# P1 - lvx v3, r7, r3 ;# P0 - lvx v4, 0, r3 ;# Q0 - lvx v5, r4, r3 ;# Q1 - lvx v6, r5, r3 ;# Q2 - add r0, r3, r5 ;# r0 -> 2 rows fwd (temp) - lvx v7, r4, r0 ;# Q3 (read only) -.endm - -;# Expects -;# v10 == HEV -;# v13 == tmp -;# v14 == tmp -.macro common_adjust P0, Q0, P1, Q1, HEV_PRESENT - vxor \P1, \P1, v11 ;# SP1 - vxor \P0, \P0, v11 ;# SP0 - vxor \Q0, \Q0, v11 ;# SQ0 - vxor \Q1, \Q1, v11 ;# SQ1 - - vsubsbs v13, \P1, \Q1 ;# f = c (P1 - Q1) -.if \HEV_PRESENT - vand v13, v13, v10 ;# f &= hev -.endif - vsubsbs v14, \Q0, \P0 ;# -126 <= X = Q0-P0 <= +126 - vaddsbs v13, v13, v14 - vaddsbs v13, v13, v14 - vaddsbs v13, v13, v14 ;# A = c( c(P1-Q1) + 3*(Q0-P0)) - - vandc v13, v13, v8 ;# f &= mask - - vspltisb v8, 3 - vspltisb v9, 4 - - vaddsbs v14, v13, v9 ;# f1 = c (f+4) - vaddsbs v15, v13, v8 ;# f2 = c (f+3) - - vsrab v13, v14, v8 ;# f1 >>= 3 - vsrab v15, v15, v8 ;# f2 >>= 3 - - vsubsbs \Q0, \Q0, v13 ;# u1 = c (SQ0 - f1) - vaddsbs \P0, \P0, v15 ;# u2 = c (SP0 + f2) -.endm - -.macro vp8_mbfilter - Masks - - ;# start the fitering here - vxor v1, v1, v11 ;# SP2 - vxor v2, v2, v11 ;# SP1 - vxor v3, v3, v11 ;# SP0 - vxor v4, v4, v11 ;# SQ0 - vxor v5, v5, v11 ;# SQ1 - vxor v6, v6, v11 ;# SQ2 - - ;# add outer taps if we have high edge variance - vsubsbs v13, v2, v5 ;# f = c (SP1-SQ1) - - vsubsbs v14, v4, v3 ;# SQ0-SP0 - vaddsbs v13, v13, v14 - vaddsbs v13, v13, v14 - vaddsbs v13, v13, v14 ;# f = c( c(SP1-SQ1) + 3*(SQ0-SP0)) - - vandc v13, v13, v8 ;# f &= mask - vand v15, v13, v10 ;# f2 = f & hev - - ;# save bottom 3 bits so that we round one side +4 and the other +3 - vspltisb v8, 3 - vspltisb v9, 4 - - vaddsbs v14, v15, v9 ;# f1 = c (f+4) - vaddsbs v15, v15, v8 ;# f2 = c (f+3) - - vsrab v14, v14, v8 ;# f1 >>= 3 - vsrab v15, v15, v8 ;# f2 >>= 3 - - vsubsbs v4, v4, v14 ;# u1 = c (SQ0 - f1) - vaddsbs v3, v3, v15 ;# u2 = c (SP0 + f2) - - ;# only apply wider filter if not high edge variance - vandc v13, v13, v10 ;# f &= ~hev - - vspltisb v9, 2 - vnor v8, v8, v8 - vsrb v9, v8, v9 ;# 0x3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f - vupkhsb v9, v9 ;# 0x003f003f003f003f003f003f003f003f - vspltisb v8, 9 - - ;# roughly 1/7th difference across boundary - vspltish v10, 7 - vmulosb v14, v8, v13 ;# A = c( c(P1-Q1) + 3*(Q0-P0)) - vmulesb v15, v8, v13 - vaddshs v14, v14, v9 ;# += 63 - vaddshs v15, v15, v9 - vsrah v14, v14, v10 ;# >>= 7 - vsrah v15, v15, v10 - vmrglh v10, v15, v14 - vmrghh v15, v15, v14 - - vpkshss v10, v15, v10 ;# X = saturated down to bytes - - vsubsbs v6, v6, v10 ;# subtract from Q and add to P - vaddsbs v1, v1, v10 - - vxor v6, v6, v11 - vxor v1, v1, v11 - - ;# roughly 2/7th difference across boundary - vspltish v10, 7 - vaddubm v12, v8, v8 - vmulosb v14, v12, v13 ;# A = c( c(P1-Q1) + 3*(Q0-P0)) - vmulesb v15, v12, v13 - vaddshs v14, v14, v9 - vaddshs v15, v15, v9 - vsrah v14, v14, v10 ;# >>= 7 - vsrah v15, v15, v10 - vmrglh v10, v15, v14 - vmrghh v15, v15, v14 - - vpkshss v10, v15, v10 ;# X = saturated down to bytes - - vsubsbs v5, v5, v10 ;# subtract from Q and add to P - vaddsbs v2, v2, v10 - - vxor v5, v5, v11 - vxor v2, v2, v11 - - ;# roughly 3/7th difference across boundary - vspltish v10, 7 - vaddubm v12, v12, v8 - vmulosb v14, v12, v13 ;# A = c( c(P1-Q1) + 3*(Q0-P0)) - vmulesb v15, v12, v13 - vaddshs v14, v14, v9 - vaddshs v15, v15, v9 - vsrah v14, v14, v10 ;# >>= 7 - vsrah v15, v15, v10 - vmrglh v10, v15, v14 - vmrghh v15, v15, v14 - - vpkshss v10, v15, v10 ;# X = saturated down to bytes - - vsubsbs v4, v4, v10 ;# subtract from Q and add to P - vaddsbs v3, v3, v10 - - vxor v4, v4, v11 - vxor v3, v3, v11 -.endm - -.macro SBFilter - Masks - - common_adjust v3, v4, v2, v5, 1 - - ;# outer tap adjustments - vspltisb v8, 1 - - vaddubm v13, v13, v8 ;# f += 1 - vsrab v13, v13, v8 ;# f >>= 1 - - vandc v13, v13, v10 ;# f &= ~hev - - vsubsbs v5, v5, v13 ;# u1 = c (SQ1 - f) - vaddsbs v2, v2, v13 ;# u2 = c (SP1 + f) - - vxor v2, v2, v11 - vxor v3, v3, v11 - vxor v4, v4, v11 - vxor v5, v5, v11 -.endm - - .align 2 -mbloop_filter_horizontal_edge_y_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xffff - mtspr 256, r12 ;# set VRSAVE - - build_constants r5, r6, r7, v8, v9, v10 - - load_data_y - - vp8_mbfilter - - stvx v1, r7, r6 ;# P2 - stvx v2, 0, r6 ;# P1 - stvx v3, r7, r3 ;# P0 - stvx v4, 0, r3 ;# Q0 - stvx v5, r4, r3 ;# Q1 - stvx v6, r5, r3 ;# Q2 - - mtspr 256, r11 ;# reset old VRSAVE - - blr - - .align 2 -;# r3 unsigned char *s -;# r4 int p -;# r5 const signed char *flimit -;# r6 const signed char *limit -;# r7 const signed char *thresh -loop_filter_horizontal_edge_y_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xffff - mtspr 256, r12 ;# set VRSAVE - - build_constants r5, r6, r7, v8, v9, v10 - - load_data_y - - SBFilter - - stvx v2, 0, r6 ;# P1 - stvx v3, r7, r3 ;# P0 - stvx v4, 0, r3 ;# Q0 - stvx v5, r4, r3 ;# Q1 - - mtspr 256, r11 ;# reset old VRSAVE - - blr - -;# Filtering a vertical mb. Each mb is aligned on a 16 byte boundary. -;# So we can read in an entire mb aligned. However if we want to filter the mb -;# edge we run into problems. For the loopfilter we require 4 bytes before the mb -;# and 4 after for a total of 8 bytes. Reading 16 bytes inorder to get 4 is a bit -;# of a waste. So this is an even uglier way to get around that. -;# Using the regular register file words are read in and then saved back out to -;# memory to align and order them up. Then they are read in using the -;# vector register file. -.macro RLVmb V, R - lwzux r0, r3, r4 - stw r0, 4(\R) - lwz r0,-4(r3) - stw r0, 0(\R) - lwzux r0, r3, r4 - stw r0,12(\R) - lwz r0,-4(r3) - stw r0, 8(\R) - lvx \V, 0, \R -.endm - -.macro WLVmb V, R - stvx \V, 0, \R - lwz r0,12(\R) - stwux r0, r3, r4 - lwz r0, 8(\R) - stw r0,-4(r3) - lwz r0, 4(\R) - stwux r0, r3, r4 - lwz r0, 0(\R) - stw r0,-4(r3) -.endm - - .align 2 -;# r3 unsigned char *s -;# r4 int p -;# r5 const signed char *flimit -;# r6 const signed char *limit -;# r7 const signed char *thresh -mbloop_filter_vertical_edge_y_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xffff - ori r12, r12, 0xc000 - mtspr 256, r12 ;# set VRSAVE - - la r9, -48(r1) ;# temporary space for reading in vectors - sub r3, r3, r4 - - RLVmb v0, r9 - RLVmb v1, r9 - RLVmb v2, r9 - RLVmb v3, r9 - RLVmb v4, r9 - RLVmb v5, r9 - RLVmb v6, r9 - RLVmb v7, r9 - - transpose8x16_fwd - - build_constants r5, r6, r7, v8, v9, v10 - - vp8_mbfilter - - transpose8x16_inv - - add r3, r3, r4 - neg r4, r4 - - WLVmb v17, r9 - WLVmb v16, r9 - WLVmb v15, r9 - WLVmb v14, r9 - WLVmb v13, r9 - WLVmb v12, r9 - WLVmb v11, r9 - WLVmb v10, r9 - - mtspr 256, r11 ;# reset old VRSAVE - - blr - -.macro RL V, R, P - lvx \V, 0, \R - add \R, \R, \P -.endm - -.macro WL V, R, P - stvx \V, 0, \R - add \R, \R, \P -.endm - -.macro Fil P3, P2, P1, P0, Q0, Q1, Q2, Q3 - ;# K = |P0-P1| already - Abs v14, v13, \Q0, \Q1 ;# M = |Q0-Q1| - vmaxub v14, v14, v4 ;# M = max( |P0-P1|, |Q0-Q1|) - vcmpgtub v10, v14, v0 - - Abs v4, v5, \Q2, \Q3 ;# K = |Q2-Q3| = next |P0-P1] - - max_abs v14, v13, \Q1, \Q2 ;# M = max( M, |Q1-Q2|) - max_abs v14, v13, \P1, \P2 ;# M = max( M, |P1-P2|) - max_abs v14, v13, \P2, \P3 ;# M = max( M, |P2-P3|) - - vmaxub v14, v14, v4 ;# M = max interior abs diff - vcmpgtub v9, v14, v2 ;# M = true if int_l exceeded - - Abs v14, v13, \P0, \Q0 ;# X = Abs( P0-Q0) - vcmpgtub v8, v14, v3 ;# X = true if edge_l exceeded - vor v8, v8, v9 ;# M = true if edge_l or int_l exceeded - - ;# replace P1,Q1 w/signed versions - common_adjust \P0, \Q0, \P1, \Q1, 1 - - vaddubm v13, v13, v1 ;# -16 <= M <= 15, saturation irrelevant - vsrab v13, v13, v1 - vandc v13, v13, v10 ;# adjust P1,Q1 by (M+1)>>1 if ! hev - vsubsbs \Q1, \Q1, v13 - vaddsbs \P1, \P1, v13 - - vxor \P1, \P1, v11 ;# P1 - vxor \P0, \P0, v11 ;# P0 - vxor \Q0, \Q0, v11 ;# Q0 - vxor \Q1, \Q1, v11 ;# Q1 -.endm - - - .align 2 -;# r3 unsigned char *s -;# r4 int p -;# r5 const signed char *flimit -;# r6 const signed char *limit -;# r7 const signed char *thresh -loop_filter_vertical_edge_y_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xffff - ori r12, r12, 0xffff - mtspr 256, r12 ;# set VRSAVE - - addi r9, r3, 0 - RL v16, r9, r4 - RL v17, r9, r4 - RL v18, r9, r4 - RL v19, r9, r4 - RL v20, r9, r4 - RL v21, r9, r4 - RL v22, r9, r4 - RL v23, r9, r4 - RL v24, r9, r4 - RL v25, r9, r4 - RL v26, r9, r4 - RL v27, r9, r4 - RL v28, r9, r4 - RL v29, r9, r4 - RL v30, r9, r4 - lvx v31, 0, r9 - - Transpose16x16 - - vspltisb v1, 1 - - build_constants r5, r6, r7, v3, v2, v0 - - Abs v4, v5, v19, v18 ;# K(v14) = first |P0-P1| - - Fil v16, v17, v18, v19, v20, v21, v22, v23 - Fil v20, v21, v22, v23, v24, v25, v26, v27 - Fil v24, v25, v26, v27, v28, v29, v30, v31 - - Transpose16x16 - - addi r9, r3, 0 - WL v16, r9, r4 - WL v17, r9, r4 - WL v18, r9, r4 - WL v19, r9, r4 - WL v20, r9, r4 - WL v21, r9, r4 - WL v22, r9, r4 - WL v23, r9, r4 - WL v24, r9, r4 - WL v25, r9, r4 - WL v26, r9, r4 - WL v27, r9, r4 - WL v28, r9, r4 - WL v29, r9, r4 - WL v30, r9, r4 - stvx v31, 0, r9 - - mtspr 256, r11 ;# reset old VRSAVE - - blr - -;# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- UV FILTERING -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -.macro active_chroma_sel V - andi. r7, r3, 8 ;# row origin modulo 16 - add r7, r7, r7 ;# selects selectors - lis r12, _chromaSelectors@ha - la r0, _chromaSelectors@l(r12) - lwzux r0, r7, r0 ;# leave selector addr in r7 - - lvx \V, 0, r0 ;# mask to concatenate active U,V pels -.endm - -.macro hread_uv Dest, U, V, Offs, VMask - lvx \U, \Offs, r3 - lvx \V, \Offs, r4 - vperm \Dest, \U, \V, \VMask ;# Dest = active part of U then V -.endm - -.macro hwrite_uv New, U, V, Offs, Umask, Vmask - vperm \U, \New, \U, \Umask ;# Combine new pels with siblings - vperm \V, \New, \V, \Vmask - stvx \U, \Offs, r3 ;# Write to frame buffer - stvx \V, \Offs, r4 -.endm - -;# Process U,V in parallel. -.macro load_chroma_h - neg r9, r5 ;# r9 = -1 * stride - add r8, r9, r9 ;# r8 = -2 * stride - add r10, r5, r5 ;# r10 = 2 * stride - - active_chroma_sel v12 - - ;# P3, Q3 are read-only; need not save addresses or sibling pels - add r6, r8, r8 ;# r6 = -4 * stride - hread_uv v0, v14, v15, r6, v12 - add r6, r10, r5 ;# r6 = 3 * stride - hread_uv v7, v14, v15, r6, v12 - - ;# Others are read/write; save addresses and sibling pels - - add r6, r8, r9 ;# r6 = -3 * stride - hread_uv v1, v16, v17, r6, v12 - hread_uv v2, v18, v19, r8, v12 - hread_uv v3, v20, v21, r9, v12 - hread_uv v4, v22, v23, 0, v12 - hread_uv v5, v24, v25, r5, v12 - hread_uv v6, v26, v27, r10, v12 -.endm - -.macro uresult_sel V - load_g \V, 4(r7) -.endm - -.macro vresult_sel V - load_g \V, 8(r7) -.endm - -;# always write P1,P0,Q0,Q1 -.macro store_chroma_h - uresult_sel v11 - vresult_sel v12 - hwrite_uv v2, v18, v19, r8, v11, v12 - hwrite_uv v3, v20, v21, r9, v11, v12 - hwrite_uv v4, v22, v23, 0, v11, v12 - hwrite_uv v5, v24, v25, r5, v11, v12 -.endm - - .align 2 -;# r3 unsigned char *u -;# r4 unsigned char *v -;# r5 int p -;# r6 const signed char *flimit -;# r7 const signed char *limit -;# r8 const signed char *thresh -mbloop_filter_horizontal_edge_uv_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xffff - ori r12, r12, 0xffff - mtspr 256, r12 ;# set VRSAVE - - build_constants r6, r7, r8, v8, v9, v10 - - load_chroma_h - - vp8_mbfilter - - store_chroma_h - - hwrite_uv v1, v16, v17, r6, v11, v12 ;# v1 == P2 - hwrite_uv v6, v26, v27, r10, v11, v12 ;# v6 == Q2 - - mtspr 256, r11 ;# reset old VRSAVE - - blr - - .align 2 -;# r3 unsigned char *u -;# r4 unsigned char *v -;# r5 int p -;# r6 const signed char *flimit -;# r7 const signed char *limit -;# r8 const signed char *thresh -loop_filter_horizontal_edge_uv_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xffff - ori r12, r12, 0xffff - mtspr 256, r12 ;# set VRSAVE - - build_constants r6, r7, r8, v8, v9, v10 - - load_chroma_h - - SBFilter - - store_chroma_h - - mtspr 256, r11 ;# reset old VRSAVE - - blr - -.macro R V, R - lwzux r0, r3, r5 - stw r0, 4(\R) - lwz r0,-4(r3) - stw r0, 0(\R) - lwzux r0, r4, r5 - stw r0,12(\R) - lwz r0,-4(r4) - stw r0, 8(\R) - lvx \V, 0, \R -.endm - - -.macro W V, R - stvx \V, 0, \R - lwz r0,12(\R) - stwux r0, r4, r5 - lwz r0, 8(\R) - stw r0,-4(r4) - lwz r0, 4(\R) - stwux r0, r3, r5 - lwz r0, 0(\R) - stw r0,-4(r3) -.endm - -.macro chroma_vread R - sub r3, r3, r5 ;# back up one line for simplicity - sub r4, r4, r5 - - R v0, \R - R v1, \R - R v2, \R - R v3, \R - R v4, \R - R v5, \R - R v6, \R - R v7, \R - - transpose8x16_fwd -.endm - -.macro chroma_vwrite R - - transpose8x16_inv - - add r3, r3, r5 - add r4, r4, r5 - neg r5, r5 ;# Write rows back in reverse order - - W v17, \R - W v16, \R - W v15, \R - W v14, \R - W v13, \R - W v12, \R - W v11, \R - W v10, \R -.endm - - .align 2 -;# r3 unsigned char *u -;# r4 unsigned char *v -;# r5 int p -;# r6 const signed char *flimit -;# r7 const signed char *limit -;# r8 const signed char *thresh -mbloop_filter_vertical_edge_uv_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xffff - ori r12, r12, 0xc000 - mtspr 256, r12 ;# set VRSAVE - - la r9, -48(r1) ;# temporary space for reading in vectors - - chroma_vread r9 - - build_constants r6, r7, r8, v8, v9, v10 - - vp8_mbfilter - - chroma_vwrite r9 - - mtspr 256, r11 ;# reset old VRSAVE - - blr - - .align 2 -;# r3 unsigned char *u -;# r4 unsigned char *v -;# r5 int p -;# r6 const signed char *flimit -;# r7 const signed char *limit -;# r8 const signed char *thresh -loop_filter_vertical_edge_uv_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xffff - ori r12, r12, 0xc000 - mtspr 256, r12 ;# set VRSAVE - - la r9, -48(r1) ;# temporary space for reading in vectors - - chroma_vread r9 - - build_constants r6, r7, r8, v8, v9, v10 - - SBFilter - - chroma_vwrite r9 - - mtspr 256, r11 ;# reset old VRSAVE - - blr - -;# -=-=-=-=-=-=-=-=-=-=-=-=-=-= SIMPLE LOOP FILTER =-=-=-=-=-=-=-=-=-=-=-=-=-=- - -.macro vp8_simple_filter - Abs v14, v13, v1, v2 ;# M = abs( P0 - Q0) - vcmpgtub v8, v14, v8 ;# v5 = true if _over_ limit - - ;# preserve unsigned v0 and v3 - common_adjust v1, v2, v0, v3, 0 - - vxor v1, v1, v11 - vxor v2, v2, v11 ;# cvt Q0, P0 back to pels -.endm - -.macro simple_vertical - addi r8, 0, 16 - addi r7, r5, 32 - - lvx v0, 0, r5 - lvx v1, r8, r5 - lvx v2, 0, r7 - lvx v3, r8, r7 - - lis r12, _B_hihi@ha - la r0, _B_hihi@l(r12) - lvx v16, 0, r0 - - lis r12, _B_lolo@ha - la r0, _B_lolo@l(r12) - lvx v17, 0, r0 - - Transpose4times4x4 v16, v17 - vp8_simple_filter - - vxor v0, v0, v11 - vxor v3, v3, v11 ;# cvt Q0, P0 back to pels - - Transpose4times4x4 v16, v17 - - stvx v0, 0, r5 - stvx v1, r8, r5 - stvx v2, 0, r7 - stvx v3, r8, r7 -.endm - - .align 2 -;# r3 unsigned char *s -;# r4 int p -;# r5 const signed char *flimit -loop_filter_simple_horizontal_edge_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xffff - mtspr 256, r12 ;# set VRSAVE - - ;# build constants - lvx v8, 0, r5 ;# flimit - - vspltisb v11, 8 - vspltisb v12, 4 - vslb v11, v11, v12 ;# 0x80808080808080808080808080808080 - - neg r5, r4 ;# r5 = -1 * stride - add r6, r5, r5 ;# r6 = -2 * stride - - lvx v0, r6, r3 ;# v0 = P1 = 16 pels two rows above edge - lvx v1, r5, r3 ;# v1 = P0 = 16 pels one row above edge - lvx v2, 0, r3 ;# v2 = Q0 = 16 pels one row below edge - lvx v3, r4, r3 ;# v3 = Q1 = 16 pels two rows below edge - - vp8_simple_filter - - stvx v1, r5, r3 ;# store P0 - stvx v2, 0, r3 ;# store Q0 - - mtspr 256, r11 ;# reset old VRSAVE - - blr - -.macro RLV Offs - stw r0, (\Offs*4)(r5) - lwzux r0, r7, r4 -.endm - -.macro WLV Offs - lwz r0, (\Offs*4)(r5) - stwux r0, r7, r4 -.endm - - .align 2 -;# r3 unsigned char *s -;# r4 int p -;# r5 const signed char *flimit -loop_filter_simple_vertical_edge_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xffff - ori r12, r12, 0xc000 - mtspr 256, r12 ;# set VRSAVE - - ;# build constants - lvx v8, 0, r5 ;# flimit - - vspltisb v11, 8 - vspltisb v12, 4 - vslb v11, v11, v12 ;# 0x80808080808080808080808080808080 - - la r5, -96(r1) ;# temporary space for reading in vectors - - ;# Store 4 pels at word "Offs" in temp array, then advance r7 - ;# to next row and read another 4 pels from the frame buffer. - - subi r7, r3, 2 ;# r7 -> 2 pels before start - lwzx r0, 0, r7 ;# read first 4 pels - - ;# 16 unaligned word accesses - RLV 0 - RLV 4 - RLV 8 - RLV 12 - RLV 1 - RLV 5 - RLV 9 - RLV 13 - RLV 2 - RLV 6 - RLV 10 - RLV 14 - RLV 3 - RLV 7 - RLV 11 - - stw r0, (15*4)(r5) ;# write last 4 pels - - simple_vertical - - ;# Read temp array, write frame buffer. - subi r7, r3, 2 ;# r7 -> 2 pels before start - lwzx r0, 0, r5 ;# read/write first 4 pels - stwx r0, 0, r7 - - WLV 4 - WLV 8 - WLV 12 - WLV 1 - WLV 5 - WLV 9 - WLV 13 - WLV 2 - WLV 6 - WLV 10 - WLV 14 - WLV 3 - WLV 7 - WLV 11 - WLV 15 - - mtspr 256, r11 ;# reset old VRSAVE - - blr - - .data - -_chromaSelectors: - .long _B_hihi - .long _B_Ures0 - .long _B_Vres0 - .long 0 - .long _B_lolo - .long _B_Ures8 - .long _B_Vres8 - .long 0 - - .align 4 -_B_Vres8: - .byte 16, 17, 18, 19, 20, 21, 22, 23, 8, 9, 10, 11, 12, 13, 14, 15 - - .align 4 -_B_Ures8: - .byte 16, 17, 18, 19, 20, 21, 22, 23, 0, 1, 2, 3, 4, 5, 6, 7 - - .align 4 -_B_lolo: - .byte 8, 9, 10, 11, 12, 13, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31 - - .align 4 -_B_Vres0: - .byte 8, 9, 10, 11, 12, 13, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31 - .align 4 -_B_Ures0: - .byte 0, 1, 2, 3, 4, 5, 6, 7, 24, 25, 26, 27, 28, 29, 30, 31 - - .align 4 -_B_hihi: - .byte 0, 1, 2, 3, 4, 5, 6, 7, 16, 17, 18, 19, 20, 21, 22, 23 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/platform_altivec.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/platform_altivec.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/platform_altivec.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/platform_altivec.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - .globl save_platform_context - .globl restore_platform_context - -.macro W V P - stvx \V, 0, \P - addi \P, \P, 16 -.endm - -.macro R V P - lvx \V, 0, \P - addi \P, \P, 16 -.endm - -;# r3 context_ptr - .align 2 -save_platform_contex: - W v20, r3 - W v21, r3 - W v22, r3 - W v23, r3 - W v24, r3 - W v25, r3 - W v26, r3 - W v27, r3 - W v28, r3 - W v29, r3 - W v30, r3 - W v31, r3 - - blr - -;# r3 context_ptr - .align 2 -restore_platform_context: - R v20, r3 - R v21, r3 - R v22, r3 - R v23, r3 - R v24, r3 - R v25, r3 - R v26, r3 - R v27, r3 - R v28, r3 - R v29, r3 - R v30, r3 - R v31, r3 - - blr diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/recon_altivec.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/recon_altivec.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/recon_altivec.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/recon_altivec.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,175 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - .globl recon4b_ppc - .globl recon2b_ppc - .globl recon_b_ppc - -.macro row_of16 Diff Pred Dst Stride - lvx v1, 0, \Pred ;# v1 = pred = p0..p15 - addi \Pred, \Pred, 16 ;# next pred - vmrghb v2, v0, v1 ;# v2 = 16-bit p0..p7 - lvx v3, 0, \Diff ;# v3 = d0..d7 - vaddshs v2, v2, v3 ;# v2 = r0..r7 - vmrglb v1, v0, v1 ;# v1 = 16-bit p8..p15 - lvx v3, r8, \Diff ;# v3 = d8..d15 - addi \Diff, \Diff, 32 ;# next diff - vaddshs v3, v3, v1 ;# v3 = r8..r15 - vpkshus v2, v2, v3 ;# v2 = 8-bit r0..r15 - stvx v2, 0, \Dst ;# to dst - add \Dst, \Dst, \Stride ;# next dst -.endm - - .text - .align 2 -;# r3 = short *diff_ptr, -;# r4 = unsigned char *pred_ptr, -;# r5 = unsigned char *dst_ptr, -;# r6 = int stride -recon4b_ppc: - mfspr r0, 256 ;# get old VRSAVE - stw r0, -8(r1) ;# save old VRSAVE to stack - oris r0, r0, 0xf000 - mtspr 256,r0 ;# set VRSAVE - - vxor v0, v0, v0 - li r8, 16 - - row_of16 r3, r4, r5, r6 - row_of16 r3, r4, r5, r6 - row_of16 r3, r4, r5, r6 - row_of16 r3, r4, r5, r6 - - lwz r12, -8(r1) ;# restore old VRSAVE from stack - mtspr 256, r12 ;# reset old VRSAVE - - blr - -.macro two_rows_of8 Diff Pred Dst Stride write_first_four_pels - lvx v1, 0, \Pred ;# v1 = pred = p0..p15 - vmrghb v2, v0, v1 ;# v2 = 16-bit p0..p7 - lvx v3, 0, \Diff ;# v3 = d0..d7 - vaddshs v2, v2, v3 ;# v2 = r0..r7 - vmrglb v1, v0, v1 ;# v1 = 16-bit p8..p15 - lvx v3, r8, \Diff ;# v2 = d8..d15 - vaddshs v3, v3, v1 ;# v3 = r8..r15 - vpkshus v2, v2, v3 ;# v3 = 8-bit r0..r15 - stvx v2, 0, r10 ;# 2 rows to dst from buf - lwz r0, 0(r10) -.if \write_first_four_pels - stw r0, 0(\Dst) - .else - stwux r0, \Dst, \Stride -.endif - lwz r0, 4(r10) - stw r0, 4(\Dst) - lwz r0, 8(r10) - stwux r0, \Dst, \Stride ;# advance dst to next row - lwz r0, 12(r10) - stw r0, 4(\Dst) -.endm - - .align 2 -;# r3 = short *diff_ptr, -;# r4 = unsigned char *pred_ptr, -;# r5 = unsigned char *dst_ptr, -;# r6 = int stride - -recon2b_ppc: - mfspr r0, 256 ;# get old VRSAVE - stw r0, -8(r1) ;# save old VRSAVE to stack - oris r0, r0, 0xf000 - mtspr 256,r0 ;# set VRSAVE - - vxor v0, v0, v0 - li r8, 16 - - la r10, -48(r1) ;# buf - - two_rows_of8 r3, r4, r5, r6, 1 - - addi r4, r4, 16; ;# next pred - addi r3, r3, 32; ;# next diff - - two_rows_of8 r3, r4, r5, r6, 0 - - lwz r12, -8(r1) ;# restore old VRSAVE from stack - mtspr 256, r12 ;# reset old VRSAVE - - blr - -.macro get_two_diff_rows - stw r0, 0(r10) - lwz r0, 4(r3) - stw r0, 4(r10) - lwzu r0, 32(r3) - stw r0, 8(r10) - lwz r0, 4(r3) - stw r0, 12(r10) - lvx v3, 0, r10 -.endm - - .align 2 -;# r3 = short *diff_ptr, -;# r4 = unsigned char *pred_ptr, -;# r5 = unsigned char *dst_ptr, -;# r6 = int stride -recon_b_ppc: - mfspr r0, 256 ;# get old VRSAVE - stw r0, -8(r1) ;# save old VRSAVE to stack - oris r0, r0, 0xf000 - mtspr 256,r0 ;# set VRSAVE - - vxor v0, v0, v0 - - la r10, -48(r1) ;# buf - - lwz r0, 0(r4) - stw r0, 0(r10) - lwz r0, 16(r4) - stw r0, 4(r10) - lwz r0, 32(r4) - stw r0, 8(r10) - lwz r0, 48(r4) - stw r0, 12(r10) - - lvx v1, 0, r10; ;# v1 = pred = p0..p15 - - lwz r0, 0(r3) ;# v3 = d0..d7 - - get_two_diff_rows - - vmrghb v2, v0, v1; ;# v2 = 16-bit p0..p7 - vaddshs v2, v2, v3; ;# v2 = r0..r7 - - lwzu r0, 32(r3) ;# v3 = d8..d15 - - get_two_diff_rows - - vmrglb v1, v0, v1; ;# v1 = 16-bit p8..p15 - vaddshs v3, v3, v1; ;# v3 = r8..r15 - - vpkshus v2, v2, v3; ;# v2 = 8-bit r0..r15 - stvx v2, 0, r10; ;# 16 pels to dst from buf - - lwz r0, 0(r10) - stw r0, 0(r5) - lwz r0, 4(r10) - stwux r0, r5, r6 - lwz r0, 8(r10) - stwux r0, r5, r6 - lwz r0, 12(r10) - stwx r0, r5, r6 - - lwz r12, -8(r1) ;# restore old VRSAVE from stack - mtspr 256, r12 ;# reset old VRSAVE - - blr diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/sad_altivec.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/sad_altivec.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/sad_altivec.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/sad_altivec.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,277 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - .globl vp8_sad16x16_ppc - .globl vp8_sad16x8_ppc - .globl vp8_sad8x16_ppc - .globl vp8_sad8x8_ppc - .globl vp8_sad4x4_ppc - -.macro load_aligned_16 V R O - lvsl v3, 0, \R ;# permutate value for alignment - - lvx v1, 0, \R - lvx v2, \O, \R - - vperm \V, v1, v2, v3 -.endm - -.macro prologue - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xffc0 - mtspr 256, r12 ;# set VRSAVE - - stwu r1, -32(r1) ;# create space on the stack - - li r10, 16 ;# load offset and loop counter - - vspltisw v8, 0 ;# zero out total to start -.endm - -.macro epilogue - addi r1, r1, 32 ;# recover stack - - mtspr 256, r11 ;# reset old VRSAVE -.endm - -.macro SAD_16 - ;# v6 = abs (v4 - v5) - vsububs v6, v4, v5 - vsububs v7, v5, v4 - vor v6, v6, v7 - - ;# v8 += abs (v4 - v5) - vsum4ubs v8, v6, v8 -.endm - -.macro sad_16_loop loop_label - lvsl v3, 0, r5 ;# only needs to be done once per block - - ;# preload a line of data before getting into the loop - lvx v4, 0, r3 - lvx v1, 0, r5 - lvx v2, r10, r5 - - add r5, r5, r6 - add r3, r3, r4 - - vperm v5, v1, v2, v3 - - .align 4 -\loop_label: - ;# compute difference on first row - vsububs v6, v4, v5 - vsububs v7, v5, v4 - - ;# load up next set of data - lvx v9, 0, r3 - lvx v1, 0, r5 - lvx v2, r10, r5 - - ;# perform abs() of difference - vor v6, v6, v7 - add r3, r3, r4 - - ;# add to the running tally - vsum4ubs v8, v6, v8 - - ;# now onto the next line - vperm v5, v1, v2, v3 - add r5, r5, r6 - lvx v4, 0, r3 - - ;# compute difference on second row - vsububs v6, v9, v5 - lvx v1, 0, r5 - vsububs v7, v5, v9 - lvx v2, r10, r5 - vor v6, v6, v7 - add r3, r3, r4 - vsum4ubs v8, v6, v8 - vperm v5, v1, v2, v3 - add r5, r5, r6 - - bdnz \loop_label - - vspltisw v7, 0 - - vsumsws v8, v8, v7 - - stvx v8, 0, r1 - lwz r3, 12(r1) -.endm - -.macro sad_8_loop loop_label - .align 4 -\loop_label: - ;# only one of the inputs should need to be aligned. - load_aligned_16 v4, r3, r10 - load_aligned_16 v5, r5, r10 - - ;# move onto the next line - add r3, r3, r4 - add r5, r5, r6 - - ;# only one of the inputs should need to be aligned. - load_aligned_16 v6, r3, r10 - load_aligned_16 v7, r5, r10 - - ;# move onto the next line - add r3, r3, r4 - add r5, r5, r6 - - vmrghb v4, v4, v6 - vmrghb v5, v5, v7 - - SAD_16 - - bdnz \loop_label - - vspltisw v7, 0 - - vsumsws v8, v8, v7 - - stvx v8, 0, r1 - lwz r3, 12(r1) -.endm - - .align 2 -;# r3 unsigned char *src_ptr -;# r4 int src_stride -;# r5 unsigned char *ref_ptr -;# r6 int ref_stride -;# -;# r3 return value -vp8_sad16x16_ppc: - - prologue - - li r9, 8 - mtctr r9 - - sad_16_loop sad16x16_loop - - epilogue - - blr - - .align 2 -;# r3 unsigned char *src_ptr -;# r4 int src_stride -;# r5 unsigned char *ref_ptr -;# r6 int ref_stride -;# -;# r3 return value -vp8_sad16x8_ppc: - - prologue - - li r9, 4 - mtctr r9 - - sad_16_loop sad16x8_loop - - epilogue - - blr - - .align 2 -;# r3 unsigned char *src_ptr -;# r4 int src_stride -;# r5 unsigned char *ref_ptr -;# r6 int ref_stride -;# -;# r3 return value -vp8_sad8x16_ppc: - - prologue - - li r9, 8 - mtctr r9 - - sad_8_loop sad8x16_loop - - epilogue - - blr - - .align 2 -;# r3 unsigned char *src_ptr -;# r4 int src_stride -;# r5 unsigned char *ref_ptr -;# r6 int ref_stride -;# -;# r3 return value -vp8_sad8x8_ppc: - - prologue - - li r9, 4 - mtctr r9 - - sad_8_loop sad8x8_loop - - epilogue - - blr - -.macro transfer_4x4 I P - lwz r0, 0(\I) - add \I, \I, \P - - lwz r7, 0(\I) - add \I, \I, \P - - lwz r8, 0(\I) - add \I, \I, \P - - lwz r9, 0(\I) - - stw r0, 0(r1) - stw r7, 4(r1) - stw r8, 8(r1) - stw r9, 12(r1) -.endm - - .align 2 -;# r3 unsigned char *src_ptr -;# r4 int src_stride -;# r5 unsigned char *ref_ptr -;# r6 int ref_stride -;# -;# r3 return value -vp8_sad4x4_ppc: - - prologue - - transfer_4x4 r3, r4 - lvx v4, 0, r1 - - transfer_4x4 r5, r6 - lvx v5, 0, r1 - - vspltisw v8, 0 ;# zero out total to start - - ;# v6 = abs (v4 - v5) - vsububs v6, v4, v5 - vsububs v7, v5, v4 - vor v6, v6, v7 - - ;# v8 += abs (v4 - v5) - vsum4ubs v7, v6, v8 - vsumsws v7, v7, v8 - - stvx v7, 0, r1 - lwz r3, 12(r1) - - epilogue - - blr diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/systemdependent.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/systemdependent.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/systemdependent.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/systemdependent.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,165 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "subpixel.h" -#include "loopfilter.h" -#include "recon.h" -#include "onyxc_int.h" - -extern void (*vp8_post_proc_down_and_across_mb_row)( - unsigned char *src_ptr, - unsigned char *dst_ptr, - int src_pixels_per_line, - int dst_pixels_per_line, - int cols, - unsigned char *f, - int size -); - -extern void (*vp8_mbpost_proc_down)(unsigned char *dst, int pitch, int rows, int cols, int flimit); -extern void vp8_mbpost_proc_down_c(unsigned char *dst, int pitch, int rows, int cols, int flimit); -extern void (*vp8_mbpost_proc_across_ip)(unsigned char *src, int pitch, int rows, int cols, int flimit); -extern void vp8_mbpost_proc_across_ip_c(unsigned char *src, int pitch, int rows, int cols, int flimit); - -extern void vp8_post_proc_down_and_across_mb_row_c -( - unsigned char *src_ptr, - unsigned char *dst_ptr, - int src_pixels_per_line, - int dst_pixels_per_line, - int cols, - unsigned char *f, - int size -); -void vp8_plane_add_noise_c(unsigned char *Start, unsigned int Width, unsigned int Height, int Pitch, int q, int a); - -extern copy_mem_block_function *vp8_copy_mem16x16; -extern copy_mem_block_function *vp8_copy_mem8x8; -extern copy_mem_block_function *vp8_copy_mem8x4; - -// PPC -extern subpixel_predict_function sixtap_predict_ppc; -extern subpixel_predict_function sixtap_predict8x4_ppc; -extern subpixel_predict_function sixtap_predict8x8_ppc; -extern subpixel_predict_function sixtap_predict16x16_ppc; -extern subpixel_predict_function bilinear_predict4x4_ppc; -extern subpixel_predict_function bilinear_predict8x4_ppc; -extern subpixel_predict_function bilinear_predict8x8_ppc; -extern subpixel_predict_function bilinear_predict16x16_ppc; - -extern copy_mem_block_function copy_mem16x16_ppc; - -void recon_b_ppc(short *diff_ptr, unsigned char *pred_ptr, unsigned char *dst_ptr, int stride); -void recon2b_ppc(short *diff_ptr, unsigned char *pred_ptr, unsigned char *dst_ptr, int stride); -void recon4b_ppc(short *diff_ptr, unsigned char *pred_ptr, unsigned char *dst_ptr, int stride); - -extern void short_idct4x4llm_ppc(short *input, short *output, int pitch); - -// Generic C -extern subpixel_predict_function vp8_sixtap_predict_c; -extern subpixel_predict_function vp8_sixtap_predict8x4_c; -extern subpixel_predict_function vp8_sixtap_predict8x8_c; -extern subpixel_predict_function vp8_sixtap_predict16x16_c; -extern subpixel_predict_function vp8_bilinear_predict4x4_c; -extern subpixel_predict_function vp8_bilinear_predict8x4_c; -extern subpixel_predict_function vp8_bilinear_predict8x8_c; -extern subpixel_predict_function vp8_bilinear_predict16x16_c; - -extern copy_mem_block_function vp8_copy_mem16x16_c; -extern copy_mem_block_function vp8_copy_mem8x8_c; -extern copy_mem_block_function vp8_copy_mem8x4_c; - -void vp8_recon_b_c(short *diff_ptr, unsigned char *pred_ptr, unsigned char *dst_ptr, int stride); -void vp8_recon2b_c(short *diff_ptr, unsigned char *pred_ptr, unsigned char *dst_ptr, int stride); -void vp8_recon4b_c(short *diff_ptr, unsigned char *pred_ptr, unsigned char *dst_ptr, int stride); - -extern void vp8_short_idct4x4llm_1_c(short *input, short *output, int pitch); -extern void vp8_short_idct4x4llm_c(short *input, short *output, int pitch); -extern void vp8_dc_only_idct_c(short input_dc, short *output, int pitch); - -// PPC -extern loop_filter_block_function loop_filter_mbv_ppc; -extern loop_filter_block_function loop_filter_bv_ppc; -extern loop_filter_block_function loop_filter_mbh_ppc; -extern loop_filter_block_function loop_filter_bh_ppc; - -extern loop_filter_block_function loop_filter_mbvs_ppc; -extern loop_filter_block_function loop_filter_bvs_ppc; -extern loop_filter_block_function loop_filter_mbhs_ppc; -extern loop_filter_block_function loop_filter_bhs_ppc; - -// Generic C -extern loop_filter_block_function vp8_loop_filter_mbv_c; -extern loop_filter_block_function vp8_loop_filter_bv_c; -extern loop_filter_block_function vp8_loop_filter_mbh_c; -extern loop_filter_block_function vp8_loop_filter_bh_c; - -extern loop_filter_block_function vp8_loop_filter_mbvs_c; -extern loop_filter_block_function vp8_loop_filter_bvs_c; -extern loop_filter_block_function vp8_loop_filter_mbhs_c; -extern loop_filter_block_function vp8_loop_filter_bhs_c; - -extern loop_filter_block_function *vp8_lf_mbvfull; -extern loop_filter_block_function *vp8_lf_mbhfull; -extern loop_filter_block_function *vp8_lf_bvfull; -extern loop_filter_block_function *vp8_lf_bhfull; - -extern loop_filter_block_function *vp8_lf_mbvsimple; -extern loop_filter_block_function *vp8_lf_mbhsimple; -extern loop_filter_block_function *vp8_lf_bvsimple; -extern loop_filter_block_function *vp8_lf_bhsimple; - -void vp8_clear_c(void) -{ -} - -void vp8_machine_specific_config(void) -{ - // Pure C: - vp8_clear_system_state = vp8_clear_c; - vp8_recon_b = vp8_recon_b_c; - vp8_recon4b = vp8_recon4b_c; - vp8_recon2b = vp8_recon2b_c; - - vp8_bilinear_predict16x16 = bilinear_predict16x16_ppc; - vp8_bilinear_predict8x8 = bilinear_predict8x8_ppc; - vp8_bilinear_predict8x4 = bilinear_predict8x4_ppc; - vp8_bilinear_predict = bilinear_predict4x4_ppc; - - vp8_sixtap_predict16x16 = sixtap_predict16x16_ppc; - vp8_sixtap_predict8x8 = sixtap_predict8x8_ppc; - vp8_sixtap_predict8x4 = sixtap_predict8x4_ppc; - vp8_sixtap_predict = sixtap_predict_ppc; - - vp8_short_idct4x4_1 = vp8_short_idct4x4llm_1_c; - vp8_short_idct4x4 = short_idct4x4llm_ppc; - vp8_dc_only_idct = vp8_dc_only_idct_c; - - vp8_lf_mbvfull = loop_filter_mbv_ppc; - vp8_lf_bvfull = loop_filter_bv_ppc; - vp8_lf_mbhfull = loop_filter_mbh_ppc; - vp8_lf_bhfull = loop_filter_bh_ppc; - - vp8_lf_mbvsimple = loop_filter_mbvs_ppc; - vp8_lf_bvsimple = loop_filter_bvs_ppc; - vp8_lf_mbhsimple = loop_filter_mbhs_ppc; - vp8_lf_bhsimple = loop_filter_bhs_ppc; - - vp8_post_proc_down_and_across_mb_row = vp8_post_proc_down_and_across_mb_row_c; - vp8_mbpost_proc_down = vp8_mbpost_proc_down_c; - vp8_mbpost_proc_across_ip = vp8_mbpost_proc_across_ip_c; - vp8_plane_add_noise = vp8_plane_add_noise_c; - - vp8_copy_mem16x16 = copy_mem16x16_ppc; - vp8_copy_mem8x8 = vp8_copy_mem8x8_c; - vp8_copy_mem8x4 = vp8_copy_mem8x4_c; - -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/variance_altivec.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/variance_altivec.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/variance_altivec.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/variance_altivec.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,375 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - .globl vp8_get8x8var_ppc - .globl vp8_get16x16var_ppc - .globl vp8_mse16x16_ppc - .globl vp8_variance16x16_ppc - .globl vp8_variance16x8_ppc - .globl vp8_variance8x16_ppc - .globl vp8_variance8x8_ppc - .globl vp8_variance4x4_ppc - -.macro load_aligned_16 V R O - lvsl v3, 0, \R ;# permutate value for alignment - - lvx v1, 0, \R - lvx v2, \O, \R - - vperm \V, v1, v2, v3 -.endm - -.macro prologue - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xffc0 - mtspr 256, r12 ;# set VRSAVE - - stwu r1, -32(r1) ;# create space on the stack - - li r10, 16 ;# load offset and loop counter - - vspltisw v7, 0 ;# zero for merging - vspltisw v8, 0 ;# zero out total to start - vspltisw v9, 0 ;# zero out total for dif^2 -.endm - -.macro epilogue - addi r1, r1, 32 ;# recover stack - - mtspr 256, r11 ;# reset old VRSAVE -.endm - -.macro compute_sum_sse - ;# Compute sum first. Unpack to so signed subract - ;# can be used. Only have a half word signed - ;# subract. Do high, then low. - vmrghb v2, v7, v4 - vmrghb v3, v7, v5 - vsubshs v2, v2, v3 - vsum4shs v8, v2, v8 - - vmrglb v2, v7, v4 - vmrglb v3, v7, v5 - vsubshs v2, v2, v3 - vsum4shs v8, v2, v8 - - ;# Now compute sse. - vsububs v2, v4, v5 - vsububs v3, v5, v4 - vor v2, v2, v3 - - vmsumubm v9, v2, v2, v9 -.endm - -.macro variance_16 DS loop_label store_sum -\loop_label: - ;# only one of the inputs should need to be aligned. - load_aligned_16 v4, r3, r10 - load_aligned_16 v5, r5, r10 - - ;# move onto the next line - add r3, r3, r4 - add r5, r5, r6 - - compute_sum_sse - - bdnz \loop_label - - vsumsws v8, v8, v7 - vsumsws v9, v9, v7 - - stvx v8, 0, r1 - lwz r3, 12(r1) - - stvx v9, 0, r1 - lwz r4, 12(r1) - -.if \store_sum - stw r3, 0(r8) ;# sum -.endif - stw r4, 0(r7) ;# sse - - mullw r3, r3, r3 ;# sum*sum - srlwi r3, r3, \DS ;# (sum*sum) >> DS - subf r3, r3, r4 ;# sse - ((sum*sum) >> DS) -.endm - -.macro variance_8 DS loop_label store_sum -\loop_label: - ;# only one of the inputs should need to be aligned. - load_aligned_16 v4, r3, r10 - load_aligned_16 v5, r5, r10 - - ;# move onto the next line - add r3, r3, r4 - add r5, r5, r6 - - ;# only one of the inputs should need to be aligned. - load_aligned_16 v6, r3, r10 - load_aligned_16 v0, r5, r10 - - ;# move onto the next line - add r3, r3, r4 - add r5, r5, r6 - - vmrghb v4, v4, v6 - vmrghb v5, v5, v0 - - compute_sum_sse - - bdnz \loop_label - - vsumsws v8, v8, v7 - vsumsws v9, v9, v7 - - stvx v8, 0, r1 - lwz r3, 12(r1) - - stvx v9, 0, r1 - lwz r4, 12(r1) - -.if \store_sum - stw r3, 0(r8) ;# sum -.endif - stw r4, 0(r7) ;# sse - - mullw r3, r3, r3 ;# sum*sum - srlwi r3, r3, \DS ;# (sum*sum) >> 8 - subf r3, r3, r4 ;# sse - ((sum*sum) >> 8) -.endm - - .align 2 -;# r3 unsigned char *src_ptr -;# r4 int source_stride -;# r5 unsigned char *ref_ptr -;# r6 int recon_stride -;# r7 unsigned int *SSE -;# r8 int *Sum -;# -;# r3 return value -vp8_get8x8var_ppc: - - prologue - - li r9, 4 - mtctr r9 - - variance_8 6, get8x8var_loop, 1 - - epilogue - - blr - - .align 2 -;# r3 unsigned char *src_ptr -;# r4 int source_stride -;# r5 unsigned char *ref_ptr -;# r6 int recon_stride -;# r7 unsigned int *SSE -;# r8 int *Sum -;# -;# r3 return value -vp8_get16x16var_ppc: - - prologue - - mtctr r10 - - variance_16 8, get16x16var_loop, 1 - - epilogue - - blr - - .align 2 -;# r3 unsigned char *src_ptr -;# r4 int source_stride -;# r5 unsigned char *ref_ptr -;# r6 int recon_stride -;# r7 unsigned int *sse -;# -;# r 3 return value -vp8_mse16x16_ppc: - prologue - - mtctr r10 - -mse16x16_loop: - ;# only one of the inputs should need to be aligned. - load_aligned_16 v4, r3, r10 - load_aligned_16 v5, r5, r10 - - ;# move onto the next line - add r3, r3, r4 - add r5, r5, r6 - - ;# Now compute sse. - vsububs v2, v4, v5 - vsububs v3, v5, v4 - vor v2, v2, v3 - - vmsumubm v9, v2, v2, v9 - - bdnz mse16x16_loop - - vsumsws v9, v9, v7 - - stvx v9, 0, r1 - lwz r3, 12(r1) - - stvx v9, 0, r1 - lwz r3, 12(r1) - - stw r3, 0(r7) ;# sse - - epilogue - - blr - - .align 2 -;# r3 unsigned char *src_ptr -;# r4 int source_stride -;# r5 unsigned char *ref_ptr -;# r6 int recon_stride -;# r7 unsigned int *sse -;# -;# r3 return value -vp8_variance16x16_ppc: - - prologue - - mtctr r10 - - variance_16 8, variance16x16_loop, 0 - - epilogue - - blr - - .align 2 -;# r3 unsigned char *src_ptr -;# r4 int source_stride -;# r5 unsigned char *ref_ptr -;# r6 int recon_stride -;# r7 unsigned int *sse -;# -;# r3 return value -vp8_variance16x8_ppc: - - prologue - - li r9, 8 - mtctr r9 - - variance_16 7, variance16x8_loop, 0 - - epilogue - - blr - - .align 2 -;# r3 unsigned char *src_ptr -;# r4 int source_stride -;# r5 unsigned char *ref_ptr -;# r6 int recon_stride -;# r7 unsigned int *sse -;# -;# r3 return value -vp8_variance8x16_ppc: - - prologue - - li r9, 8 - mtctr r9 - - variance_8 7, variance8x16_loop, 0 - - epilogue - - blr - - .align 2 -;# r3 unsigned char *src_ptr -;# r4 int source_stride -;# r5 unsigned char *ref_ptr -;# r6 int recon_stride -;# r7 unsigned int *sse -;# -;# r3 return value -vp8_variance8x8_ppc: - - prologue - - li r9, 4 - mtctr r9 - - variance_8 6, variance8x8_loop, 0 - - epilogue - - blr - -.macro transfer_4x4 I P - lwz r0, 0(\I) - add \I, \I, \P - - lwz r10,0(\I) - add \I, \I, \P - - lwz r8, 0(\I) - add \I, \I, \P - - lwz r9, 0(\I) - - stw r0, 0(r1) - stw r10, 4(r1) - stw r8, 8(r1) - stw r9, 12(r1) -.endm - - .align 2 -;# r3 unsigned char *src_ptr -;# r4 int source_stride -;# r5 unsigned char *ref_ptr -;# r6 int recon_stride -;# r7 unsigned int *sse -;# -;# r3 return value -vp8_variance4x4_ppc: - - prologue - - transfer_4x4 r3, r4 - lvx v4, 0, r1 - - transfer_4x4 r5, r6 - lvx v5, 0, r1 - - compute_sum_sse - - vsumsws v8, v8, v7 - vsumsws v9, v9, v7 - - stvx v8, 0, r1 - lwz r3, 12(r1) - - stvx v9, 0, r1 - lwz r4, 12(r1) - - stw r4, 0(r7) ;# sse - - mullw r3, r3, r3 ;# sum*sum - srlwi r3, r3, 4 ;# (sum*sum) >> 4 - subf r3, r3, r4 ;# sse - ((sum*sum) >> 4) - - epilogue - - blr diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/variance_subpixel_altivec.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/variance_subpixel_altivec.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppc/variance_subpixel_altivec.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppc/variance_subpixel_altivec.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,865 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - .globl vp8_sub_pixel_variance4x4_ppc - .globl vp8_sub_pixel_variance8x8_ppc - .globl vp8_sub_pixel_variance8x16_ppc - .globl vp8_sub_pixel_variance16x8_ppc - .globl vp8_sub_pixel_variance16x16_ppc - -.macro load_c V, LABEL, OFF, R0, R1 - lis \R0, \LABEL@ha - la \R1, \LABEL@l(\R0) - lvx \V, \OFF, \R1 -.endm - -.macro load_vfilter V0, V1 - load_c \V0, vfilter_b, r6, r12, r10 - - addi r6, r6, 16 - lvx \V1, r6, r10 -.endm - -.macro HProlog jump_label - ;# load up horizontal filter - slwi. r5, r5, 4 ;# index into horizontal filter array - - ;# index to the next set of vectors in the row. - li r10, 16 - - ;# downshift by 7 ( divide by 128 ) at the end - vspltish v19, 7 - - ;# If there isn't any filtering to be done for the horizontal, then - ;# just skip to the second pass. - beq \jump_label - - load_c v20, hfilter_b, r5, r12, r0 - - ;# setup constants - ;# v14 permutation value for alignment - load_c v28, b_hperm_b, 0, r12, r0 - - ;# index to the next set of vectors in the row. - li r12, 32 - - ;# rounding added in on the multiply - vspltisw v21, 8 - vspltisw v18, 3 - vslw v18, v21, v18 ;# 0x00000040000000400000004000000040 - - slwi. r6, r6, 5 ;# index into vertical filter array -.endm - -;# Filters a horizontal line -;# expects: -;# r3 src_ptr -;# r4 pitch -;# r10 16 -;# r12 32 -;# v17 perm intput -;# v18 rounding -;# v19 shift -;# v20 filter taps -;# v21 tmp -;# v22 tmp -;# v23 tmp -;# v24 tmp -;# v25 tmp -;# v26 tmp -;# v27 tmp -;# v28 perm output -;# - -.macro hfilter_8 V, hp, lp, increment_counter - lvsl v17, 0, r3 ;# permutate value for alignment - - ;# input to filter is 9 bytes wide, output is 8 bytes. - lvx v21, 0, r3 - lvx v22, r10, r3 - -.if \increment_counter - add r3, r3, r4 -.endif - vperm v21, v21, v22, v17 - - vperm v24, v21, v21, \hp ;# v20 = 0123 1234 2345 3456 - vperm v25, v21, v21, \lp ;# v21 = 4567 5678 6789 789A - - vmsummbm v24, v20, v24, v18 - vmsummbm v25, v20, v25, v18 - - vpkswus v24, v24, v25 ;# v24 = 0 4 8 C 1 5 9 D (16-bit) - - vsrh v24, v24, v19 ;# divide v0, v1 by 128 - - vpkuhus \V, v24, v24 ;# \V = scrambled 8-bit result -.endm - -.macro vfilter_16 P0 P1 - vmuleub v22, \P0, v20 ;# 64 + 4 positive taps - vadduhm v22, v18, v22 - vmuloub v23, \P0, v20 - vadduhm v23, v18, v23 - - vmuleub v24, \P1, v21 - vadduhm v22, v22, v24 ;# Re = evens, saturation unnecessary - vmuloub v25, \P1, v21 - vadduhm v23, v23, v25 ;# Ro = odds - - vsrh v22, v22, v19 ;# divide by 128 - vsrh v23, v23, v19 ;# v16 v17 = evens, odds - vmrghh \P0, v22, v23 ;# v18 v19 = 16-bit result in order - vmrglh v23, v22, v23 - vpkuhus \P0, \P0, v23 ;# P0 = 8-bit result -.endm - -.macro compute_sum_sse src, ref, sum, sse, t1, t2, z0 - ;# Compute sum first. Unpack to so signed subract - ;# can be used. Only have a half word signed - ;# subract. Do high, then low. - vmrghb \t1, \z0, \src - vmrghb \t2, \z0, \ref - vsubshs \t1, \t1, \t2 - vsum4shs \sum, \t1, \sum - - vmrglb \t1, \z0, \src - vmrglb \t2, \z0, \ref - vsubshs \t1, \t1, \t2 - vsum4shs \sum, \t1, \sum - - ;# Now compute sse. - vsububs \t1, \src, \ref - vsububs \t2, \ref, \src - vor \t1, \t1, \t2 - - vmsumubm \sse, \t1, \t1, \sse -.endm - -.macro variance_final sum, sse, z0, DS - vsumsws \sum, \sum, \z0 - vsumsws \sse, \sse, \z0 - - stvx \sum, 0, r1 - lwz r3, 12(r1) - - stvx \sse, 0, r1 - lwz r4, 12(r1) - - stw r4, 0(r9) ;# sse - - mullw r3, r3, r3 ;# sum*sum - srlwi r3, r3, \DS ;# (sum*sum) >> 8 - subf r3, r3, r4 ;# sse - ((sum*sum) >> 8) -.endm - -.macro compute_sum_sse_16 V, increment_counter - load_and_align_16 v16, r7, r8, \increment_counter - compute_sum_sse \V, v16, v18, v19, v20, v21, v23 -.endm - -.macro load_and_align_16 V, R, P, increment_counter - lvsl v17, 0, \R ;# permutate value for alignment - - ;# input to filter is 21 bytes wide, output is 16 bytes. - ;# input will can span three vectors if not aligned correctly. - lvx v21, 0, \R - lvx v22, r10, \R - -.if \increment_counter - add \R, \R, \P -.endif - - vperm \V, v21, v22, v17 -.endm - - .align 2 -;# r3 unsigned char *src_ptr -;# r4 int src_pixels_per_line -;# r5 int xoffset -;# r6 int yoffset -;# r7 unsigned char *dst_ptr -;# r8 int dst_pixels_per_line -;# r9 unsigned int *sse -;# -;# r3 return value -vp8_sub_pixel_variance4x4_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xf830 - ori r12, r12, 0xfff8 - mtspr 256, r12 ;# set VRSAVE - - stwu r1,-32(r1) ;# create space on the stack - - HProlog second_pass_4x4_pre_copy_b - - ;# Load up permutation constants - load_c v10, b_0123_b, 0, r12, r0 - load_c v11, b_4567_b, 0, r12, r0 - - hfilter_8 v0, v10, v11, 1 - hfilter_8 v1, v10, v11, 1 - hfilter_8 v2, v10, v11, 1 - hfilter_8 v3, v10, v11, 1 - - ;# Finished filtering main horizontal block. If there is no - ;# vertical filtering, jump to storing the data. Otherwise - ;# load up and filter the additional line that is needed - ;# for the vertical filter. - beq compute_sum_sse_4x4_b - - hfilter_8 v4, v10, v11, 0 - - b second_pass_4x4_b - -second_pass_4x4_pre_copy_b: - slwi r6, r6, 5 ;# index into vertical filter array - - load_and_align_16 v0, r3, r4, 1 - load_and_align_16 v1, r3, r4, 1 - load_and_align_16 v2, r3, r4, 1 - load_and_align_16 v3, r3, r4, 1 - load_and_align_16 v4, r3, r4, 0 - -second_pass_4x4_b: - vspltish v20, 8 - vspltish v18, 3 - vslh v18, v20, v18 ;# 0x0040 0040 0040 0040 0040 0040 0040 0040 - - load_vfilter v20, v21 - - vfilter_16 v0, v1 - vfilter_16 v1, v2 - vfilter_16 v2, v3 - vfilter_16 v3, v4 - -compute_sum_sse_4x4_b: - vspltish v18, 0 ;# sum - vspltish v19, 0 ;# sse - vspltish v23, 0 ;# unpack - li r10, 16 - - load_and_align_16 v4, r7, r8, 1 - load_and_align_16 v5, r7, r8, 1 - load_and_align_16 v6, r7, r8, 1 - load_and_align_16 v7, r7, r8, 1 - - vmrghb v0, v0, v1 - vmrghb v1, v2, v3 - - vmrghb v2, v4, v5 - vmrghb v3, v6, v7 - - load_c v10, b_hilo_b, 0, r12, r0 - - vperm v0, v0, v1, v10 - vperm v1, v2, v3, v10 - - compute_sum_sse v0, v1, v18, v19, v20, v21, v23 - - variance_final v18, v19, v23, 4 - - addi r1, r1, 32 ;# recover stack - mtspr 256, r11 ;# reset old VRSAVE - - blr - - .align 2 -;# r3 unsigned char *src_ptr -;# r4 int src_pixels_per_line -;# r5 int xoffset -;# r6 int yoffset -;# r7 unsigned char *dst_ptr -;# r8 int dst_pixels_per_line -;# r9 unsigned int *sse -;# -;# r3 return value -vp8_sub_pixel_variance8x8_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xfff0 - ori r12, r12, 0xffff - mtspr 256, r12 ;# set VRSAVE - - stwu r1,-32(r1) ;# create space on the stack - - HProlog second_pass_8x8_pre_copy_b - - ;# Load up permutation constants - load_c v10, b_0123_b, 0, r12, r0 - load_c v11, b_4567_b, 0, r12, r0 - - hfilter_8 v0, v10, v11, 1 - hfilter_8 v1, v10, v11, 1 - hfilter_8 v2, v10, v11, 1 - hfilter_8 v3, v10, v11, 1 - hfilter_8 v4, v10, v11, 1 - hfilter_8 v5, v10, v11, 1 - hfilter_8 v6, v10, v11, 1 - hfilter_8 v7, v10, v11, 1 - - ;# Finished filtering main horizontal block. If there is no - ;# vertical filtering, jump to storing the data. Otherwise - ;# load up and filter the additional line that is needed - ;# for the vertical filter. - beq compute_sum_sse_8x8_b - - hfilter_8 v8, v10, v11, 0 - - b second_pass_8x8_b - -second_pass_8x8_pre_copy_b: - slwi. r6, r6, 5 ;# index into vertical filter array - - load_and_align_16 v0, r3, r4, 1 - load_and_align_16 v1, r3, r4, 1 - load_and_align_16 v2, r3, r4, 1 - load_and_align_16 v3, r3, r4, 1 - load_and_align_16 v4, r3, r4, 1 - load_and_align_16 v5, r3, r4, 1 - load_and_align_16 v6, r3, r4, 1 - load_and_align_16 v7, r3, r4, 1 - load_and_align_16 v8, r3, r4, 0 - - beq compute_sum_sse_8x8_b - -second_pass_8x8_b: - vspltish v20, 8 - vspltish v18, 3 - vslh v18, v20, v18 ;# 0x0040 0040 0040 0040 0040 0040 0040 0040 - - load_vfilter v20, v21 - - vfilter_16 v0, v1 - vfilter_16 v1, v2 - vfilter_16 v2, v3 - vfilter_16 v3, v4 - vfilter_16 v4, v5 - vfilter_16 v5, v6 - vfilter_16 v6, v7 - vfilter_16 v7, v8 - -compute_sum_sse_8x8_b: - vspltish v18, 0 ;# sum - vspltish v19, 0 ;# sse - vspltish v23, 0 ;# unpack - li r10, 16 - - vmrghb v0, v0, v1 - vmrghb v1, v2, v3 - vmrghb v2, v4, v5 - vmrghb v3, v6, v7 - - load_and_align_16 v4, r7, r8, 1 - load_and_align_16 v5, r7, r8, 1 - load_and_align_16 v6, r7, r8, 1 - load_and_align_16 v7, r7, r8, 1 - load_and_align_16 v8, r7, r8, 1 - load_and_align_16 v9, r7, r8, 1 - load_and_align_16 v10, r7, r8, 1 - load_and_align_16 v11, r7, r8, 0 - - vmrghb v4, v4, v5 - vmrghb v5, v6, v7 - vmrghb v6, v8, v9 - vmrghb v7, v10, v11 - - compute_sum_sse v0, v4, v18, v19, v20, v21, v23 - compute_sum_sse v1, v5, v18, v19, v20, v21, v23 - compute_sum_sse v2, v6, v18, v19, v20, v21, v23 - compute_sum_sse v3, v7, v18, v19, v20, v21, v23 - - variance_final v18, v19, v23, 6 - - addi r1, r1, 32 ;# recover stack - mtspr 256, r11 ;# reset old VRSAVE - blr - - .align 2 -;# r3 unsigned char *src_ptr -;# r4 int src_pixels_per_line -;# r5 int xoffset -;# r6 int yoffset -;# r7 unsigned char *dst_ptr -;# r8 int dst_pixels_per_line -;# r9 unsigned int *sse -;# -;# r3 return value -vp8_sub_pixel_variance8x16_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xffff - ori r12, r12, 0xfffc - mtspr 256, r12 ;# set VRSAVE - - stwu r1,-32(r1) ;# create space on the stack - - HProlog second_pass_8x16_pre_copy_b - - ;# Load up permutation constants - load_c v29, b_0123_b, 0, r12, r0 - load_c v30, b_4567_b, 0, r12, r0 - - hfilter_8 v0, v29, v30, 1 - hfilter_8 v1, v29, v30, 1 - hfilter_8 v2, v29, v30, 1 - hfilter_8 v3, v29, v30, 1 - hfilter_8 v4, v29, v30, 1 - hfilter_8 v5, v29, v30, 1 - hfilter_8 v6, v29, v30, 1 - hfilter_8 v7, v29, v30, 1 - hfilter_8 v8, v29, v30, 1 - hfilter_8 v9, v29, v30, 1 - hfilter_8 v10, v29, v30, 1 - hfilter_8 v11, v29, v30, 1 - hfilter_8 v12, v29, v30, 1 - hfilter_8 v13, v29, v30, 1 - hfilter_8 v14, v29, v30, 1 - hfilter_8 v15, v29, v30, 1 - - ;# Finished filtering main horizontal block. If there is no - ;# vertical filtering, jump to storing the data. Otherwise - ;# load up and filter the additional line that is needed - ;# for the vertical filter. - beq compute_sum_sse_8x16_b - - hfilter_8 v16, v29, v30, 0 - - b second_pass_8x16_b - -second_pass_8x16_pre_copy_b: - slwi. r6, r6, 5 ;# index into vertical filter array - - load_and_align_16 v0, r3, r4, 1 - load_and_align_16 v1, r3, r4, 1 - load_and_align_16 v2, r3, r4, 1 - load_and_align_16 v3, r3, r4, 1 - load_and_align_16 v4, r3, r4, 1 - load_and_align_16 v5, r3, r4, 1 - load_and_align_16 v6, r3, r4, 1 - load_and_align_16 v7, r3, r4, 1 - load_and_align_16 v8, r3, r4, 1 - load_and_align_16 v9, r3, r4, 1 - load_and_align_16 v10, r3, r4, 1 - load_and_align_16 v11, r3, r4, 1 - load_and_align_16 v12, r3, r4, 1 - load_and_align_16 v13, r3, r4, 1 - load_and_align_16 v14, r3, r4, 1 - load_and_align_16 v15, r3, r4, 1 - load_and_align_16 v16, r3, r4, 0 - - beq compute_sum_sse_8x16_b - -second_pass_8x16_b: - vspltish v20, 8 - vspltish v18, 3 - vslh v18, v20, v18 ;# 0x0040 0040 0040 0040 0040 0040 0040 0040 - - load_vfilter v20, v21 - - vfilter_16 v0, v1 - vfilter_16 v1, v2 - vfilter_16 v2, v3 - vfilter_16 v3, v4 - vfilter_16 v4, v5 - vfilter_16 v5, v6 - vfilter_16 v6, v7 - vfilter_16 v7, v8 - vfilter_16 v8, v9 - vfilter_16 v9, v10 - vfilter_16 v10, v11 - vfilter_16 v11, v12 - vfilter_16 v12, v13 - vfilter_16 v13, v14 - vfilter_16 v14, v15 - vfilter_16 v15, v16 - -compute_sum_sse_8x16_b: - vspltish v18, 0 ;# sum - vspltish v19, 0 ;# sse - vspltish v23, 0 ;# unpack - li r10, 16 - - vmrghb v0, v0, v1 - vmrghb v1, v2, v3 - vmrghb v2, v4, v5 - vmrghb v3, v6, v7 - vmrghb v4, v8, v9 - vmrghb v5, v10, v11 - vmrghb v6, v12, v13 - vmrghb v7, v14, v15 - - load_and_align_16 v8, r7, r8, 1 - load_and_align_16 v9, r7, r8, 1 - load_and_align_16 v10, r7, r8, 1 - load_and_align_16 v11, r7, r8, 1 - load_and_align_16 v12, r7, r8, 1 - load_and_align_16 v13, r7, r8, 1 - load_and_align_16 v14, r7, r8, 1 - load_and_align_16 v15, r7, r8, 1 - - vmrghb v8, v8, v9 - vmrghb v9, v10, v11 - vmrghb v10, v12, v13 - vmrghb v11, v14, v15 - - compute_sum_sse v0, v8, v18, v19, v20, v21, v23 - compute_sum_sse v1, v9, v18, v19, v20, v21, v23 - compute_sum_sse v2, v10, v18, v19, v20, v21, v23 - compute_sum_sse v3, v11, v18, v19, v20, v21, v23 - - load_and_align_16 v8, r7, r8, 1 - load_and_align_16 v9, r7, r8, 1 - load_and_align_16 v10, r7, r8, 1 - load_and_align_16 v11, r7, r8, 1 - load_and_align_16 v12, r7, r8, 1 - load_and_align_16 v13, r7, r8, 1 - load_and_align_16 v14, r7, r8, 1 - load_and_align_16 v15, r7, r8, 0 - - vmrghb v8, v8, v9 - vmrghb v9, v10, v11 - vmrghb v10, v12, v13 - vmrghb v11, v14, v15 - - compute_sum_sse v4, v8, v18, v19, v20, v21, v23 - compute_sum_sse v5, v9, v18, v19, v20, v21, v23 - compute_sum_sse v6, v10, v18, v19, v20, v21, v23 - compute_sum_sse v7, v11, v18, v19, v20, v21, v23 - - variance_final v18, v19, v23, 7 - - addi r1, r1, 32 ;# recover stack - mtspr 256, r11 ;# reset old VRSAVE - blr - -;# Filters a horizontal line -;# expects: -;# r3 src_ptr -;# r4 pitch -;# r10 16 -;# r12 32 -;# v17 perm intput -;# v18 rounding -;# v19 shift -;# v20 filter taps -;# v21 tmp -;# v22 tmp -;# v23 tmp -;# v24 tmp -;# v25 tmp -;# v26 tmp -;# v27 tmp -;# v28 perm output -;# -.macro hfilter_16 V, increment_counter - - lvsl v17, 0, r3 ;# permutate value for alignment - - ;# input to filter is 21 bytes wide, output is 16 bytes. - ;# input will can span three vectors if not aligned correctly. - lvx v21, 0, r3 - lvx v22, r10, r3 - lvx v23, r12, r3 - -.if \increment_counter - add r3, r3, r4 -.endif - vperm v21, v21, v22, v17 - vperm v22, v22, v23, v17 ;# v8 v9 = 21 input pixels left-justified - - ;# set 0 - vmsummbm v24, v20, v21, v18 ;# taps times elements - - ;# set 1 - vsldoi v23, v21, v22, 1 - vmsummbm v25, v20, v23, v18 - - ;# set 2 - vsldoi v23, v21, v22, 2 - vmsummbm v26, v20, v23, v18 - - ;# set 3 - vsldoi v23, v21, v22, 3 - vmsummbm v27, v20, v23, v18 - - vpkswus v24, v24, v25 ;# v24 = 0 4 8 C 1 5 9 D (16-bit) - vpkswus v25, v26, v27 ;# v25 = 2 6 A E 3 7 B F - - vsrh v24, v24, v19 ;# divide v0, v1 by 128 - vsrh v25, v25, v19 - - vpkuhus \V, v24, v25 ;# \V = scrambled 8-bit result - vperm \V, \V, v0, v28 ;# \V = correctly-ordered result -.endm - - .align 2 -;# r3 unsigned char *src_ptr -;# r4 int src_pixels_per_line -;# r5 int xoffset -;# r6 int yoffset -;# r7 unsigned char *dst_ptr -;# r8 int dst_pixels_per_line -;# r9 unsigned int *sse -;# -;# r3 return value -vp8_sub_pixel_variance16x8_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xffff - ori r12, r12, 0xfff8 - mtspr 256, r12 ;# set VRSAVE - - stwu r1, -32(r1) ;# create space on the stack - - HProlog second_pass_16x8_pre_copy_b - - hfilter_16 v0, 1 - hfilter_16 v1, 1 - hfilter_16 v2, 1 - hfilter_16 v3, 1 - hfilter_16 v4, 1 - hfilter_16 v5, 1 - hfilter_16 v6, 1 - hfilter_16 v7, 1 - - ;# Finished filtering main horizontal block. If there is no - ;# vertical filtering, jump to storing the data. Otherwise - ;# load up and filter the additional line that is needed - ;# for the vertical filter. - beq compute_sum_sse_16x8_b - - hfilter_16 v8, 0 - - b second_pass_16x8_b - -second_pass_16x8_pre_copy_b: - slwi. r6, r6, 5 ;# index into vertical filter array - - load_and_align_16 v0, r3, r4, 1 - load_and_align_16 v1, r3, r4, 1 - load_and_align_16 v2, r3, r4, 1 - load_and_align_16 v3, r3, r4, 1 - load_and_align_16 v4, r3, r4, 1 - load_and_align_16 v5, r3, r4, 1 - load_and_align_16 v6, r3, r4, 1 - load_and_align_16 v7, r3, r4, 1 - load_and_align_16 v8, r3, r4, 1 - - beq compute_sum_sse_16x8_b - -second_pass_16x8_b: - vspltish v20, 8 - vspltish v18, 3 - vslh v18, v20, v18 ;# 0x0040 0040 0040 0040 0040 0040 0040 0040 - - load_vfilter v20, v21 - - vfilter_16 v0, v1 - vfilter_16 v1, v2 - vfilter_16 v2, v3 - vfilter_16 v3, v4 - vfilter_16 v4, v5 - vfilter_16 v5, v6 - vfilter_16 v6, v7 - vfilter_16 v7, v8 - -compute_sum_sse_16x8_b: - vspltish v18, 0 ;# sum - vspltish v19, 0 ;# sse - vspltish v23, 0 ;# unpack - li r10, 16 - - compute_sum_sse_16 v0, 1 - compute_sum_sse_16 v1, 1 - compute_sum_sse_16 v2, 1 - compute_sum_sse_16 v3, 1 - compute_sum_sse_16 v4, 1 - compute_sum_sse_16 v5, 1 - compute_sum_sse_16 v6, 1 - compute_sum_sse_16 v7, 0 - - variance_final v18, v19, v23, 7 - - addi r1, r1, 32 ;# recover stack - - mtspr 256, r11 ;# reset old VRSAVE - - blr - - .align 2 -;# r3 unsigned char *src_ptr -;# r4 int src_pixels_per_line -;# r5 int xoffset -;# r6 int yoffset -;# r7 unsigned char *dst_ptr -;# r8 int dst_pixels_per_line -;# r9 unsigned int *sse -;# -;# r3 return value -vp8_sub_pixel_variance16x16_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xffff - ori r12, r12, 0xfff8 - mtspr 256, r12 ;# set VRSAVE - - stwu r1, -32(r1) ;# create space on the stack - - HProlog second_pass_16x16_pre_copy_b - - hfilter_16 v0, 1 - hfilter_16 v1, 1 - hfilter_16 v2, 1 - hfilter_16 v3, 1 - hfilter_16 v4, 1 - hfilter_16 v5, 1 - hfilter_16 v6, 1 - hfilter_16 v7, 1 - hfilter_16 v8, 1 - hfilter_16 v9, 1 - hfilter_16 v10, 1 - hfilter_16 v11, 1 - hfilter_16 v12, 1 - hfilter_16 v13, 1 - hfilter_16 v14, 1 - hfilter_16 v15, 1 - - ;# Finished filtering main horizontal block. If there is no - ;# vertical filtering, jump to storing the data. Otherwise - ;# load up and filter the additional line that is needed - ;# for the vertical filter. - beq compute_sum_sse_16x16_b - - hfilter_16 v16, 0 - - b second_pass_16x16_b - -second_pass_16x16_pre_copy_b: - slwi. r6, r6, 5 ;# index into vertical filter array - - load_and_align_16 v0, r3, r4, 1 - load_and_align_16 v1, r3, r4, 1 - load_and_align_16 v2, r3, r4, 1 - load_and_align_16 v3, r3, r4, 1 - load_and_align_16 v4, r3, r4, 1 - load_and_align_16 v5, r3, r4, 1 - load_and_align_16 v6, r3, r4, 1 - load_and_align_16 v7, r3, r4, 1 - load_and_align_16 v8, r3, r4, 1 - load_and_align_16 v9, r3, r4, 1 - load_and_align_16 v10, r3, r4, 1 - load_and_align_16 v11, r3, r4, 1 - load_and_align_16 v12, r3, r4, 1 - load_and_align_16 v13, r3, r4, 1 - load_and_align_16 v14, r3, r4, 1 - load_and_align_16 v15, r3, r4, 1 - load_and_align_16 v16, r3, r4, 0 - - beq compute_sum_sse_16x16_b - -second_pass_16x16_b: - vspltish v20, 8 - vspltish v18, 3 - vslh v18, v20, v18 ;# 0x0040 0040 0040 0040 0040 0040 0040 0040 - - load_vfilter v20, v21 - - vfilter_16 v0, v1 - vfilter_16 v1, v2 - vfilter_16 v2, v3 - vfilter_16 v3, v4 - vfilter_16 v4, v5 - vfilter_16 v5, v6 - vfilter_16 v6, v7 - vfilter_16 v7, v8 - vfilter_16 v8, v9 - vfilter_16 v9, v10 - vfilter_16 v10, v11 - vfilter_16 v11, v12 - vfilter_16 v12, v13 - vfilter_16 v13, v14 - vfilter_16 v14, v15 - vfilter_16 v15, v16 - -compute_sum_sse_16x16_b: - vspltish v18, 0 ;# sum - vspltish v19, 0 ;# sse - vspltish v23, 0 ;# unpack - li r10, 16 - - compute_sum_sse_16 v0, 1 - compute_sum_sse_16 v1, 1 - compute_sum_sse_16 v2, 1 - compute_sum_sse_16 v3, 1 - compute_sum_sse_16 v4, 1 - compute_sum_sse_16 v5, 1 - compute_sum_sse_16 v6, 1 - compute_sum_sse_16 v7, 1 - compute_sum_sse_16 v8, 1 - compute_sum_sse_16 v9, 1 - compute_sum_sse_16 v10, 1 - compute_sum_sse_16 v11, 1 - compute_sum_sse_16 v12, 1 - compute_sum_sse_16 v13, 1 - compute_sum_sse_16 v14, 1 - compute_sum_sse_16 v15, 0 - - variance_final v18, v19, v23, 8 - - addi r1, r1, 32 ;# recover stack - - mtspr 256, r11 ;# reset old VRSAVE - - blr - - .data - - .align 4 -hfilter_b: - .byte 128, 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0 - .byte 112, 16, 0, 0,112, 16, 0, 0,112, 16, 0, 0,112, 16, 0, 0 - .byte 96, 32, 0, 0, 96, 32, 0, 0, 96, 32, 0, 0, 96, 32, 0, 0 - .byte 80, 48, 0, 0, 80, 48, 0, 0, 80, 48, 0, 0, 80, 48, 0, 0 - .byte 64, 64, 0, 0, 64, 64, 0, 0, 64, 64, 0, 0, 64, 64, 0, 0 - .byte 48, 80, 0, 0, 48, 80, 0, 0, 48, 80, 0, 0, 48, 80, 0, 0 - .byte 32, 96, 0, 0, 32, 96, 0, 0, 32, 96, 0, 0, 32, 96, 0, 0 - .byte 16,112, 0, 0, 16,112, 0, 0, 16,112, 0, 0, 16,112, 0, 0 - - .align 4 -vfilter_b: - .byte 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 - .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - .byte 112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112 - .byte 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 - .byte 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96 - .byte 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32 - .byte 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80 - .byte 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48 - .byte 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 - .byte 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 - .byte 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48 - .byte 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80 - .byte 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32 - .byte 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96 - .byte 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 - .byte 112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112 - - .align 4 -b_hperm_b: - .byte 0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15 - - .align 4 -b_0123_b: - .byte 0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6 - - .align 4 -b_4567_b: - .byte 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 8, 9, 7, 8, 9, 10 - -b_hilo_b: - .byte 0, 1, 2, 3, 4, 5, 6, 7, 16, 17, 18, 19, 20, 21, 22, 23 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppflags.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppflags.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/ppflags.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/ppflags.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_PPFLAGS_H_ -#define VP8_COMMON_PPFLAGS_H_ - -#ifdef __cplusplus -extern "C" { -#endif -enum -{ - VP8D_NOFILTERING = 0, - VP8D_DEBLOCK = 1<<0, - VP8D_DEMACROBLOCK = 1<<1, - VP8D_ADDNOISE = 1<<2, - VP8D_DEBUG_TXT_FRAME_INFO = 1<<3, - VP8D_DEBUG_TXT_MBLK_MODES = 1<<4, - VP8D_DEBUG_TXT_DC_DIFF = 1<<5, - VP8D_DEBUG_TXT_RATE_INFO = 1<<6, - VP8D_DEBUG_DRAW_MV = 1<<7, - VP8D_DEBUG_CLR_BLK_MODES = 1<<8, - VP8D_DEBUG_CLR_FRM_REF_BLKS = 1<<9, - VP8D_MFQE = 1<<10 -}; - -typedef struct -{ - int post_proc_flag; - int deblocking_level; - int noise_level; - int display_ref_frame_flag; - int display_mb_modes_flag; - int display_b_modes_flag; - int display_mv_flag; -} vp8_ppflags_t; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_PPFLAGS_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/quant_common.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/quant_common.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/quant_common.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/quant_common.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "quant_common.h" - -static const int dc_qlookup[QINDEX_RANGE] = -{ - 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 int ac_qlookup[QINDEX_RANGE] = -{ - 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, -}; - - -int vp8_dc_quant(int QIndex, int Delta) -{ - int retval; - - QIndex = QIndex + Delta; - - if (QIndex > 127) - QIndex = 127; - else if (QIndex < 0) - QIndex = 0; - - retval = dc_qlookup[ QIndex ]; - return retval; -} - -int vp8_dc2quant(int QIndex, int Delta) -{ - int retval; - - QIndex = QIndex + Delta; - - if (QIndex > 127) - QIndex = 127; - else if (QIndex < 0) - QIndex = 0; - - retval = dc_qlookup[ QIndex ] * 2; - return retval; - -} -int vp8_dc_uv_quant(int QIndex, int Delta) -{ - int retval; - - QIndex = QIndex + Delta; - - if (QIndex > 127) - QIndex = 127; - else if (QIndex < 0) - QIndex = 0; - - retval = dc_qlookup[ QIndex ]; - - if (retval > 132) - retval = 132; - - return retval; -} - -int vp8_ac_yquant(int QIndex) -{ - int retval; - - if (QIndex > 127) - QIndex = 127; - else if (QIndex < 0) - QIndex = 0; - - retval = ac_qlookup[ QIndex ]; - return retval; -} - -int vp8_ac2quant(int QIndex, int Delta) -{ - int retval; - - QIndex = QIndex + Delta; - - if (QIndex > 127) - QIndex = 127; - else if (QIndex < 0) - QIndex = 0; - - /* For all x in [0..284], x*155/100 is bitwise equal to (x*101581) >> 16. - * The smallest precision for that is '(x*6349) >> 12' but 16 is a good - * word size. */ - retval = (ac_qlookup[ QIndex ] * 101581) >> 16; - - if (retval < 8) - retval = 8; - - return retval; -} -int vp8_ac_uv_quant(int QIndex, int Delta) -{ - int retval; - - QIndex = QIndex + Delta; - - if (QIndex > 127) - QIndex = 127; - else if (QIndex < 0) - QIndex = 0; - - retval = ac_qlookup[ QIndex ]; - return retval; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/quant_common.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/quant_common.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/quant_common.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/quant_common.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP8_COMMON_QUANT_COMMON_H_ -#define VP8_COMMON_QUANT_COMMON_H_ - - -#include "string.h" -#include "blockd.h" -#include "onyxc_int.h" - -#ifdef __cplusplus -extern "C" { -#endif - -extern int vp8_ac_yquant(int QIndex); -extern int vp8_dc_quant(int QIndex, int Delta); -extern int vp8_dc2quant(int QIndex, int Delta); -extern int vp8_ac2quant(int QIndex, int Delta); -extern int vp8_dc_uv_quant(int QIndex, int Delta); -extern int vp8_ac_uv_quant(int QIndex, int Delta); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_QUANT_COMMON_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/reconinter.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/reconinter.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/reconinter.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/reconinter.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,587 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "vpx/vpx_integer.h" -#include "blockd.h" -#include "reconinter.h" -#if CONFIG_RUNTIME_CPU_DETECT -#include "onyxc_int.h" -#endif - -void vp8_copy_mem16x16_c( - unsigned char *src, - int src_stride, - unsigned char *dst, - int dst_stride) -{ - - int r; - - for (r = 0; r < 16; r++) - { -#if !(CONFIG_FAST_UNALIGNED) - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; - dst[3] = src[3]; - dst[4] = src[4]; - dst[5] = src[5]; - dst[6] = src[6]; - dst[7] = src[7]; - dst[8] = src[8]; - dst[9] = src[9]; - dst[10] = src[10]; - dst[11] = src[11]; - dst[12] = src[12]; - dst[13] = src[13]; - dst[14] = src[14]; - dst[15] = src[15]; - -#else - ((uint32_t *)dst)[0] = ((uint32_t *)src)[0] ; - ((uint32_t *)dst)[1] = ((uint32_t *)src)[1] ; - ((uint32_t *)dst)[2] = ((uint32_t *)src)[2] ; - ((uint32_t *)dst)[3] = ((uint32_t *)src)[3] ; - -#endif - src += src_stride; - dst += dst_stride; - - } - -} - -void vp8_copy_mem8x8_c( - unsigned char *src, - int src_stride, - unsigned char *dst, - int dst_stride) -{ - int r; - - for (r = 0; r < 8; r++) - { -#if !(CONFIG_FAST_UNALIGNED) - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; - dst[3] = src[3]; - dst[4] = src[4]; - dst[5] = src[5]; - dst[6] = src[6]; - dst[7] = src[7]; -#else - ((uint32_t *)dst)[0] = ((uint32_t *)src)[0] ; - ((uint32_t *)dst)[1] = ((uint32_t *)src)[1] ; -#endif - src += src_stride; - dst += dst_stride; - - } - -} - -void vp8_copy_mem8x4_c( - unsigned char *src, - int src_stride, - unsigned char *dst, - int dst_stride) -{ - int r; - - for (r = 0; r < 4; r++) - { -#if !(CONFIG_FAST_UNALIGNED) - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; - dst[3] = src[3]; - dst[4] = src[4]; - dst[5] = src[5]; - dst[6] = src[6]; - dst[7] = src[7]; -#else - ((uint32_t *)dst)[0] = ((uint32_t *)src)[0] ; - ((uint32_t *)dst)[1] = ((uint32_t *)src)[1] ; -#endif - src += src_stride; - dst += dst_stride; - - } - -} - - -void vp8_build_inter_predictors_b(BLOCKD *d, int pitch, unsigned char *base_pre, int pre_stride, vp8_subpix_fn_t sppf) -{ - int r; - unsigned char *pred_ptr = d->predictor; - unsigned char *ptr; - ptr = base_pre + d->offset + (d->bmi.mv.as_mv.row >> 3) * pre_stride + (d->bmi.mv.as_mv.col >> 3); - - if (d->bmi.mv.as_mv.row & 7 || d->bmi.mv.as_mv.col & 7) - { - sppf(ptr, pre_stride, d->bmi.mv.as_mv.col & 7, d->bmi.mv.as_mv.row & 7, pred_ptr, pitch); - } - else - { - for (r = 0; r < 4; r++) - { - pred_ptr[0] = ptr[0]; - pred_ptr[1] = ptr[1]; - pred_ptr[2] = ptr[2]; - pred_ptr[3] = ptr[3]; - pred_ptr += pitch; - ptr += pre_stride; - } - } -} - -static void build_inter_predictors4b(MACROBLOCKD *x, BLOCKD *d, unsigned char *dst, int dst_stride, unsigned char *base_pre, int pre_stride) -{ - unsigned char *ptr; - ptr = base_pre + d->offset + (d->bmi.mv.as_mv.row >> 3) * pre_stride + (d->bmi.mv.as_mv.col >> 3); - - if (d->bmi.mv.as_mv.row & 7 || d->bmi.mv.as_mv.col & 7) - { - x->subpixel_predict8x8(ptr, pre_stride, d->bmi.mv.as_mv.col & 7, d->bmi.mv.as_mv.row & 7, dst, dst_stride); - } - else - { - vp8_copy_mem8x8(ptr, pre_stride, dst, dst_stride); - } -} - -static void build_inter_predictors2b(MACROBLOCKD *x, BLOCKD *d, unsigned char *dst, int dst_stride, unsigned char *base_pre, int pre_stride) -{ - unsigned char *ptr; - ptr = base_pre + d->offset + (d->bmi.mv.as_mv.row >> 3) * pre_stride + (d->bmi.mv.as_mv.col >> 3); - - if (d->bmi.mv.as_mv.row & 7 || d->bmi.mv.as_mv.col & 7) - { - x->subpixel_predict8x4(ptr, pre_stride, d->bmi.mv.as_mv.col & 7, d->bmi.mv.as_mv.row & 7, dst, dst_stride); - } - else - { - vp8_copy_mem8x4(ptr, pre_stride, dst, dst_stride); - } -} - -static void build_inter_predictors_b(BLOCKD *d, unsigned char *dst, int dst_stride, unsigned char *base_pre, int pre_stride, vp8_subpix_fn_t sppf) -{ - int r; - unsigned char *ptr; - ptr = base_pre + d->offset + (d->bmi.mv.as_mv.row >> 3) * pre_stride + (d->bmi.mv.as_mv.col >> 3); - - if (d->bmi.mv.as_mv.row & 7 || d->bmi.mv.as_mv.col & 7) - { - sppf(ptr, pre_stride, d->bmi.mv.as_mv.col & 7, d->bmi.mv.as_mv.row & 7, dst, dst_stride); - } - else - { - for (r = 0; r < 4; r++) - { - dst[0] = ptr[0]; - dst[1] = ptr[1]; - dst[2] = ptr[2]; - dst[3] = ptr[3]; - dst += dst_stride; - ptr += pre_stride; - } - } -} - - -/*encoder only*/ -void vp8_build_inter16x16_predictors_mbuv(MACROBLOCKD *x) -{ - unsigned char *uptr, *vptr; - unsigned char *upred_ptr = &x->predictor[256]; - unsigned char *vpred_ptr = &x->predictor[320]; - - int mv_row = x->mode_info_context->mbmi.mv.as_mv.row; - int mv_col = x->mode_info_context->mbmi.mv.as_mv.col; - int offset; - int pre_stride = x->pre.uv_stride; - - /* calc uv motion vectors */ - mv_row += 1 | (mv_row >> (sizeof(int) * CHAR_BIT - 1)); - mv_col += 1 | (mv_col >> (sizeof(int) * CHAR_BIT - 1)); - mv_row /= 2; - mv_col /= 2; - mv_row &= x->fullpixel_mask; - mv_col &= x->fullpixel_mask; - - offset = (mv_row >> 3) * pre_stride + (mv_col >> 3); - uptr = x->pre.u_buffer + offset; - vptr = x->pre.v_buffer + offset; - - if ((mv_row | mv_col) & 7) - { - x->subpixel_predict8x8(uptr, pre_stride, mv_col & 7, mv_row & 7, upred_ptr, 8); - x->subpixel_predict8x8(vptr, pre_stride, mv_col & 7, mv_row & 7, vpred_ptr, 8); - } - else - { - vp8_copy_mem8x8(uptr, pre_stride, upred_ptr, 8); - vp8_copy_mem8x8(vptr, pre_stride, vpred_ptr, 8); - } -} - -/*encoder only*/ -void vp8_build_inter4x4_predictors_mbuv(MACROBLOCKD *x) -{ - int i, j; - int pre_stride = x->pre.uv_stride; - unsigned char *base_pre; - - /* build uv mvs */ - for (i = 0; i < 2; i++) - { - for (j = 0; j < 2; j++) - { - int yoffset = i * 8 + j * 2; - int uoffset = 16 + i * 2 + j; - int voffset = 20 + i * 2 + j; - - int temp; - - temp = x->block[yoffset ].bmi.mv.as_mv.row - + x->block[yoffset+1].bmi.mv.as_mv.row - + x->block[yoffset+4].bmi.mv.as_mv.row - + x->block[yoffset+5].bmi.mv.as_mv.row; - - temp += 4 + ((temp >> (sizeof(temp) * CHAR_BIT - 1)) * 8); - - x->block[uoffset].bmi.mv.as_mv.row = (temp / 8) & x->fullpixel_mask; - - temp = x->block[yoffset ].bmi.mv.as_mv.col - + x->block[yoffset+1].bmi.mv.as_mv.col - + x->block[yoffset+4].bmi.mv.as_mv.col - + x->block[yoffset+5].bmi.mv.as_mv.col; - - temp += 4 + ((temp >> (sizeof(temp) * CHAR_BIT - 1)) * 8); - - x->block[uoffset].bmi.mv.as_mv.col = (temp / 8) & x->fullpixel_mask; - - x->block[voffset].bmi.mv.as_int = x->block[uoffset].bmi.mv.as_int; - } - } - - base_pre = x->pre.u_buffer; - for (i = 16; i < 20; i += 2) - { - BLOCKD *d0 = &x->block[i]; - BLOCKD *d1 = &x->block[i+1]; - - if (d0->bmi.mv.as_int == d1->bmi.mv.as_int) - build_inter_predictors2b(x, d0, d0->predictor, 8, base_pre, pre_stride); - else - { - vp8_build_inter_predictors_b(d0, 8, base_pre, pre_stride, x->subpixel_predict); - vp8_build_inter_predictors_b(d1, 8, base_pre, pre_stride, x->subpixel_predict); - } - } - - base_pre = x->pre.v_buffer; - for (i = 20; i < 24; i += 2) - { - BLOCKD *d0 = &x->block[i]; - BLOCKD *d1 = &x->block[i+1]; - - if (d0->bmi.mv.as_int == d1->bmi.mv.as_int) - build_inter_predictors2b(x, d0, d0->predictor, 8, base_pre, pre_stride); - else - { - vp8_build_inter_predictors_b(d0, 8, base_pre, pre_stride, x->subpixel_predict); - vp8_build_inter_predictors_b(d1, 8, base_pre, pre_stride, x->subpixel_predict); - } - } -} - - -/*encoder only*/ -void vp8_build_inter16x16_predictors_mby(MACROBLOCKD *x, - unsigned char *dst_y, - int dst_ystride) -{ - unsigned char *ptr_base; - unsigned char *ptr; - int mv_row = x->mode_info_context->mbmi.mv.as_mv.row; - int mv_col = x->mode_info_context->mbmi.mv.as_mv.col; - int pre_stride = x->pre.y_stride; - - ptr_base = x->pre.y_buffer; - ptr = ptr_base + (mv_row >> 3) * pre_stride + (mv_col >> 3); - - if ((mv_row | mv_col) & 7) - { - x->subpixel_predict16x16(ptr, pre_stride, mv_col & 7, mv_row & 7, - dst_y, dst_ystride); - } - else - { - vp8_copy_mem16x16(ptr, pre_stride, dst_y, - dst_ystride); - } -} - -static void clamp_mv_to_umv_border(MV *mv, const MACROBLOCKD *xd) -{ - /* If the MV points so far into the UMV border that no visible pixels - * are used for reconstruction, the subpel part of the MV can be - * discarded and the MV limited to 16 pixels with equivalent results. - * - * This limit kicks in at 19 pixels for the top and left edges, for - * the 16 pixels plus 3 taps right of the central pixel when subpel - * filtering. The bottom and right edges use 16 pixels plus 2 pixels - * left of the central pixel when filtering. - */ - if (mv->col < (xd->mb_to_left_edge - (19 << 3))) - mv->col = xd->mb_to_left_edge - (16 << 3); - else if (mv->col > xd->mb_to_right_edge + (18 << 3)) - mv->col = xd->mb_to_right_edge + (16 << 3); - - if (mv->row < (xd->mb_to_top_edge - (19 << 3))) - mv->row = xd->mb_to_top_edge - (16 << 3); - else if (mv->row > xd->mb_to_bottom_edge + (18 << 3)) - mv->row = xd->mb_to_bottom_edge + (16 << 3); -} - -/* A version of the above function for chroma block MVs.*/ -static void clamp_uvmv_to_umv_border(MV *mv, const MACROBLOCKD *xd) -{ - mv->col = (2*mv->col < (xd->mb_to_left_edge - (19 << 3))) ? - (xd->mb_to_left_edge - (16 << 3)) >> 1 : mv->col; - mv->col = (2*mv->col > xd->mb_to_right_edge + (18 << 3)) ? - (xd->mb_to_right_edge + (16 << 3)) >> 1 : mv->col; - - mv->row = (2*mv->row < (xd->mb_to_top_edge - (19 << 3))) ? - (xd->mb_to_top_edge - (16 << 3)) >> 1 : mv->row; - mv->row = (2*mv->row > xd->mb_to_bottom_edge + (18 << 3)) ? - (xd->mb_to_bottom_edge + (16 << 3)) >> 1 : mv->row; -} - -void vp8_build_inter16x16_predictors_mb(MACROBLOCKD *x, - unsigned char *dst_y, - unsigned char *dst_u, - unsigned char *dst_v, - int dst_ystride, - int dst_uvstride) -{ - int offset; - unsigned char *ptr; - unsigned char *uptr, *vptr; - - int_mv _16x16mv; - - unsigned char *ptr_base = x->pre.y_buffer; - int pre_stride = x->pre.y_stride; - - _16x16mv.as_int = x->mode_info_context->mbmi.mv.as_int; - - if (x->mode_info_context->mbmi.need_to_clamp_mvs) - { - clamp_mv_to_umv_border(&_16x16mv.as_mv, x); - } - - ptr = ptr_base + ( _16x16mv.as_mv.row >> 3) * pre_stride + (_16x16mv.as_mv.col >> 3); - - if ( _16x16mv.as_int & 0x00070007) - { - x->subpixel_predict16x16(ptr, pre_stride, _16x16mv.as_mv.col & 7, _16x16mv.as_mv.row & 7, dst_y, dst_ystride); - } - else - { - vp8_copy_mem16x16(ptr, pre_stride, dst_y, dst_ystride); - } - - /* calc uv motion vectors */ - _16x16mv.as_mv.row += 1 | (_16x16mv.as_mv.row >> (sizeof(int) * CHAR_BIT - 1)); - _16x16mv.as_mv.col += 1 | (_16x16mv.as_mv.col >> (sizeof(int) * CHAR_BIT - 1)); - _16x16mv.as_mv.row /= 2; - _16x16mv.as_mv.col /= 2; - _16x16mv.as_mv.row &= x->fullpixel_mask; - _16x16mv.as_mv.col &= x->fullpixel_mask; - - pre_stride >>= 1; - offset = ( _16x16mv.as_mv.row >> 3) * pre_stride + (_16x16mv.as_mv.col >> 3); - uptr = x->pre.u_buffer + offset; - vptr = x->pre.v_buffer + offset; - - if ( _16x16mv.as_int & 0x00070007) - { - x->subpixel_predict8x8(uptr, pre_stride, _16x16mv.as_mv.col & 7, _16x16mv.as_mv.row & 7, dst_u, dst_uvstride); - x->subpixel_predict8x8(vptr, pre_stride, _16x16mv.as_mv.col & 7, _16x16mv.as_mv.row & 7, dst_v, dst_uvstride); - } - else - { - vp8_copy_mem8x8(uptr, pre_stride, dst_u, dst_uvstride); - vp8_copy_mem8x8(vptr, pre_stride, dst_v, dst_uvstride); - } -} - -static void build_inter4x4_predictors_mb(MACROBLOCKD *x) -{ - int i; - unsigned char *base_dst = x->dst.y_buffer; - unsigned char *base_pre = x->pre.y_buffer; - - if (x->mode_info_context->mbmi.partitioning < 3) - { - BLOCKD *b; - int dst_stride = x->dst.y_stride; - - x->block[ 0].bmi = x->mode_info_context->bmi[ 0]; - x->block[ 2].bmi = x->mode_info_context->bmi[ 2]; - x->block[ 8].bmi = x->mode_info_context->bmi[ 8]; - x->block[10].bmi = x->mode_info_context->bmi[10]; - if (x->mode_info_context->mbmi.need_to_clamp_mvs) - { - clamp_mv_to_umv_border(&x->block[ 0].bmi.mv.as_mv, x); - clamp_mv_to_umv_border(&x->block[ 2].bmi.mv.as_mv, x); - clamp_mv_to_umv_border(&x->block[ 8].bmi.mv.as_mv, x); - clamp_mv_to_umv_border(&x->block[10].bmi.mv.as_mv, x); - } - - b = &x->block[ 0]; - build_inter_predictors4b(x, b, base_dst + b->offset, dst_stride, base_pre, dst_stride); - b = &x->block[ 2]; - build_inter_predictors4b(x, b, base_dst + b->offset, dst_stride, base_pre, dst_stride); - b = &x->block[ 8]; - build_inter_predictors4b(x, b, base_dst + b->offset, dst_stride, base_pre, dst_stride); - b = &x->block[10]; - build_inter_predictors4b(x, b, base_dst + b->offset, dst_stride, base_pre, dst_stride); - } - else - { - for (i = 0; i < 16; i += 2) - { - BLOCKD *d0 = &x->block[i]; - BLOCKD *d1 = &x->block[i+1]; - int dst_stride = x->dst.y_stride; - - x->block[i+0].bmi = x->mode_info_context->bmi[i+0]; - x->block[i+1].bmi = x->mode_info_context->bmi[i+1]; - if (x->mode_info_context->mbmi.need_to_clamp_mvs) - { - clamp_mv_to_umv_border(&x->block[i+0].bmi.mv.as_mv, x); - clamp_mv_to_umv_border(&x->block[i+1].bmi.mv.as_mv, x); - } - - if (d0->bmi.mv.as_int == d1->bmi.mv.as_int) - build_inter_predictors2b(x, d0, base_dst + d0->offset, dst_stride, base_pre, dst_stride); - else - { - build_inter_predictors_b(d0, base_dst + d0->offset, dst_stride, base_pre, dst_stride, x->subpixel_predict); - build_inter_predictors_b(d1, base_dst + d1->offset, dst_stride, base_pre, dst_stride, x->subpixel_predict); - } - - } - - } - base_dst = x->dst.u_buffer; - base_pre = x->pre.u_buffer; - for (i = 16; i < 20; i += 2) - { - BLOCKD *d0 = &x->block[i]; - BLOCKD *d1 = &x->block[i+1]; - int dst_stride = x->dst.uv_stride; - - /* Note: uv mvs already clamped in build_4x4uvmvs() */ - - if (d0->bmi.mv.as_int == d1->bmi.mv.as_int) - build_inter_predictors2b(x, d0, base_dst + d0->offset, dst_stride, base_pre, dst_stride); - else - { - build_inter_predictors_b(d0, base_dst + d0->offset, dst_stride, base_pre, dst_stride, x->subpixel_predict); - build_inter_predictors_b(d1, base_dst + d1->offset, dst_stride, base_pre, dst_stride, x->subpixel_predict); - } - } - - base_dst = x->dst.v_buffer; - base_pre = x->pre.v_buffer; - for (i = 20; i < 24; i += 2) - { - BLOCKD *d0 = &x->block[i]; - BLOCKD *d1 = &x->block[i+1]; - int dst_stride = x->dst.uv_stride; - - /* Note: uv mvs already clamped in build_4x4uvmvs() */ - - if (d0->bmi.mv.as_int == d1->bmi.mv.as_int) - build_inter_predictors2b(x, d0, base_dst + d0->offset, dst_stride, base_pre, dst_stride); - else - { - build_inter_predictors_b(d0, base_dst + d0->offset, dst_stride, base_pre, dst_stride, x->subpixel_predict); - build_inter_predictors_b(d1, base_dst + d1->offset, dst_stride, base_pre, dst_stride, x->subpixel_predict); - } - } -} - -static -void build_4x4uvmvs(MACROBLOCKD *x) -{ - int i, j; - - for (i = 0; i < 2; i++) - { - for (j = 0; j < 2; j++) - { - int yoffset = i * 8 + j * 2; - int uoffset = 16 + i * 2 + j; - int voffset = 20 + i * 2 + j; - - int temp; - - temp = x->mode_info_context->bmi[yoffset + 0].mv.as_mv.row - + x->mode_info_context->bmi[yoffset + 1].mv.as_mv.row - + x->mode_info_context->bmi[yoffset + 4].mv.as_mv.row - + x->mode_info_context->bmi[yoffset + 5].mv.as_mv.row; - - temp += 4 + ((temp >> (sizeof(temp) * CHAR_BIT - 1)) * 8); - - x->block[uoffset].bmi.mv.as_mv.row = (temp / 8) & x->fullpixel_mask; - - temp = x->mode_info_context->bmi[yoffset + 0].mv.as_mv.col - + x->mode_info_context->bmi[yoffset + 1].mv.as_mv.col - + x->mode_info_context->bmi[yoffset + 4].mv.as_mv.col - + x->mode_info_context->bmi[yoffset + 5].mv.as_mv.col; - - temp += 4 + ((temp >> (sizeof(temp) * CHAR_BIT - 1)) * 8); - - x->block[uoffset].bmi.mv.as_mv.col = (temp / 8) & x->fullpixel_mask; - - if (x->mode_info_context->mbmi.need_to_clamp_mvs) - clamp_uvmv_to_umv_border(&x->block[uoffset].bmi.mv.as_mv, x); - - x->block[voffset].bmi.mv.as_int = x->block[uoffset].bmi.mv.as_int; - } - } -} - -void vp8_build_inter_predictors_mb(MACROBLOCKD *xd) -{ - if (xd->mode_info_context->mbmi.mode != SPLITMV) - { - vp8_build_inter16x16_predictors_mb(xd, xd->dst.y_buffer, - xd->dst.u_buffer, xd->dst.v_buffer, - xd->dst.y_stride, xd->dst.uv_stride); - } - else - { - build_4x4uvmvs(xd); - build_inter4x4_predictors_mb(xd); - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/reconinter.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/reconinter.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/reconinter.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/reconinter.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_RECONINTER_H_ -#define VP8_COMMON_RECONINTER_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -extern void vp8_build_inter_predictors_mb(MACROBLOCKD *x); -extern void vp8_build_inter16x16_predictors_mb(MACROBLOCKD *x, - unsigned char *dst_y, - unsigned char *dst_u, - unsigned char *dst_v, - int dst_ystride, - int dst_uvstride); - - -extern void vp8_build_inter16x16_predictors_mby(MACROBLOCKD *x, - unsigned char *dst_y, - int dst_ystride); -extern void vp8_build_inter_predictors_b(BLOCKD *d, int pitch, - unsigned char *base_pre, - int pre_stride, - vp8_subpix_fn_t sppf); - -extern void vp8_build_inter16x16_predictors_mbuv(MACROBLOCKD *x); -extern void vp8_build_inter4x4_predictors_mbuv(MACROBLOCKD *x); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_RECONINTER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/reconintra4x4.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/reconintra4x4.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/reconintra4x4.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/reconintra4x4.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,297 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "blockd.h" - -void vp8_intra4x4_predict_c(unsigned char *Above, - unsigned char *yleft, int left_stride, - int _b_mode, - unsigned char *dst, int dst_stride, - unsigned char top_left) -{ - int i, r, c; - B_PREDICTION_MODE b_mode = (B_PREDICTION_MODE)_b_mode; - unsigned char Left[4]; - Left[0] = yleft[0]; - Left[1] = yleft[left_stride]; - Left[2] = yleft[2 * left_stride]; - Left[3] = yleft[3 * left_stride]; - - switch (b_mode) - { - case B_DC_PRED: - { - int expected_dc = 0; - - for (i = 0; i < 4; i++) - { - expected_dc += Above[i]; - expected_dc += Left[i]; - } - - expected_dc = (expected_dc + 4) >> 3; - - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - dst[c] = expected_dc; - } - - dst += dst_stride; - } - } - break; - case B_TM_PRED: - { - /* prediction similar to true_motion prediction */ - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - int pred = Above[c] - top_left + Left[r]; - - if (pred < 0) - pred = 0; - - if (pred > 255) - pred = 255; - - dst[c] = pred; - } - - dst += dst_stride; - } - } - break; - - case B_VE_PRED: - { - - unsigned int ap[4]; - ap[0] = (top_left + 2 * Above[0] + Above[1] + 2) >> 2; - ap[1] = (Above[0] + 2 * Above[1] + Above[2] + 2) >> 2; - ap[2] = (Above[1] + 2 * Above[2] + Above[3] + 2) >> 2; - ap[3] = (Above[2] + 2 * Above[3] + Above[4] + 2) >> 2; - - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - - dst[c] = ap[c]; - } - - dst += dst_stride; - } - - } - break; - - - case B_HE_PRED: - { - - unsigned int lp[4]; - lp[0] = (top_left + 2 * Left[0] + Left[1] + 2) >> 2; - lp[1] = (Left[0] + 2 * Left[1] + Left[2] + 2) >> 2; - lp[2] = (Left[1] + 2 * Left[2] + Left[3] + 2) >> 2; - lp[3] = (Left[2] + 2 * Left[3] + Left[3] + 2) >> 2; - - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - dst[c] = lp[r]; - } - - dst += dst_stride; - } - } - break; - case B_LD_PRED: - { - unsigned char *ptr = Above; - dst[0 * dst_stride + 0] = (ptr[0] + ptr[1] * 2 + ptr[2] + 2) >> 2; - dst[0 * dst_stride + 1] = - dst[1 * dst_stride + 0] = (ptr[1] + ptr[2] * 2 + ptr[3] + 2) >> 2; - dst[0 * dst_stride + 2] = - dst[1 * dst_stride + 1] = - dst[2 * dst_stride + 0] = (ptr[2] + ptr[3] * 2 + ptr[4] + 2) >> 2; - dst[0 * dst_stride + 3] = - dst[1 * dst_stride + 2] = - dst[2 * dst_stride + 1] = - dst[3 * dst_stride + 0] = (ptr[3] + ptr[4] * 2 + ptr[5] + 2) >> 2; - dst[1 * dst_stride + 3] = - dst[2 * dst_stride + 2] = - dst[3 * dst_stride + 1] = (ptr[4] + ptr[5] * 2 + ptr[6] + 2) >> 2; - dst[2 * dst_stride + 3] = - dst[3 * dst_stride + 2] = (ptr[5] + ptr[6] * 2 + ptr[7] + 2) >> 2; - dst[3 * dst_stride + 3] = (ptr[6] + ptr[7] * 2 + ptr[7] + 2) >> 2; - - } - break; - case B_RD_PRED: - { - - unsigned char pp[9]; - - pp[0] = Left[3]; - pp[1] = Left[2]; - pp[2] = Left[1]; - pp[3] = Left[0]; - pp[4] = top_left; - pp[5] = Above[0]; - pp[6] = Above[1]; - pp[7] = Above[2]; - pp[8] = Above[3]; - - dst[3 * dst_stride + 0] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2; - dst[3 * dst_stride + 1] = - dst[2 * dst_stride + 0] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2; - dst[3 * dst_stride + 2] = - dst[2 * dst_stride + 1] = - dst[1 * dst_stride + 0] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2; - dst[3 * dst_stride + 3] = - dst[2 * dst_stride + 2] = - dst[1 * dst_stride + 1] = - dst[0 * dst_stride + 0] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2; - dst[2 * dst_stride + 3] = - dst[1 * dst_stride + 2] = - dst[0 * dst_stride + 1] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2; - dst[1 * dst_stride + 3] = - dst[0 * dst_stride + 2] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2; - dst[0 * dst_stride + 3] = (pp[6] + pp[7] * 2 + pp[8] + 2) >> 2; - - } - break; - case B_VR_PRED: - { - - unsigned char pp[9]; - - pp[0] = Left[3]; - pp[1] = Left[2]; - pp[2] = Left[1]; - pp[3] = Left[0]; - pp[4] = top_left; - pp[5] = Above[0]; - pp[6] = Above[1]; - pp[7] = Above[2]; - pp[8] = Above[3]; - - - dst[3 * dst_stride + 0] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2; - dst[2 * dst_stride + 0] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2; - dst[3 * dst_stride + 1] = - dst[1 * dst_stride + 0] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2; - dst[2 * dst_stride + 1] = - dst[0 * dst_stride + 0] = (pp[4] + pp[5] + 1) >> 1; - dst[3 * dst_stride + 2] = - dst[1 * dst_stride + 1] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2; - dst[2 * dst_stride + 2] = - dst[0 * dst_stride + 1] = (pp[5] + pp[6] + 1) >> 1; - dst[3 * dst_stride + 3] = - dst[1 * dst_stride + 2] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2; - dst[2 * dst_stride + 3] = - dst[0 * dst_stride + 2] = (pp[6] + pp[7] + 1) >> 1; - dst[1 * dst_stride + 3] = (pp[6] + pp[7] * 2 + pp[8] + 2) >> 2; - dst[0 * dst_stride + 3] = (pp[7] + pp[8] + 1) >> 1; - - } - break; - case B_VL_PRED: - { - - unsigned char *pp = Above; - - dst[0 * dst_stride + 0] = (pp[0] + pp[1] + 1) >> 1; - dst[1 * dst_stride + 0] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2; - dst[2 * dst_stride + 0] = - dst[0 * dst_stride + 1] = (pp[1] + pp[2] + 1) >> 1; - dst[1 * dst_stride + 1] = - dst[3 * dst_stride + 0] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2; - dst[2 * dst_stride + 1] = - dst[0 * dst_stride + 2] = (pp[2] + pp[3] + 1) >> 1; - dst[3 * dst_stride + 1] = - dst[1 * dst_stride + 2] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2; - dst[0 * dst_stride + 3] = - dst[2 * dst_stride + 2] = (pp[3] + pp[4] + 1) >> 1; - dst[1 * dst_stride + 3] = - dst[3 * dst_stride + 2] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2; - dst[2 * dst_stride + 3] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2; - dst[3 * dst_stride + 3] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2; - } - break; - - case B_HD_PRED: - { - unsigned char pp[9]; - pp[0] = Left[3]; - pp[1] = Left[2]; - pp[2] = Left[1]; - pp[3] = Left[0]; - pp[4] = top_left; - pp[5] = Above[0]; - pp[6] = Above[1]; - pp[7] = Above[2]; - pp[8] = Above[3]; - - - dst[3 * dst_stride + 0] = (pp[0] + pp[1] + 1) >> 1; - dst[3 * dst_stride + 1] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2; - dst[2 * dst_stride + 0] = - dst[3 * dst_stride + 2] = (pp[1] + pp[2] + 1) >> 1; - dst[2 * dst_stride + 1] = - dst[3 * dst_stride + 3] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2; - dst[2 * dst_stride + 2] = - dst[1 * dst_stride + 0] = (pp[2] + pp[3] + 1) >> 1; - dst[2 * dst_stride + 3] = - dst[1 * dst_stride + 1] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2; - dst[1 * dst_stride + 2] = - dst[0 * dst_stride + 0] = (pp[3] + pp[4] + 1) >> 1; - dst[1 * dst_stride + 3] = - dst[0 * dst_stride + 1] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2; - dst[0 * dst_stride + 2] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2; - dst[0 * dst_stride + 3] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2; - } - break; - - - case B_HU_PRED: - { - unsigned char *pp = Left; - dst[0 * dst_stride + 0] = (pp[0] + pp[1] + 1) >> 1; - dst[0 * dst_stride + 1] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2; - dst[0 * dst_stride + 2] = - dst[1 * dst_stride + 0] = (pp[1] + pp[2] + 1) >> 1; - dst[0 * dst_stride + 3] = - dst[1 * dst_stride + 1] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2; - dst[1 * dst_stride + 2] = - dst[2 * dst_stride + 0] = (pp[2] + pp[3] + 1) >> 1; - dst[1 * dst_stride + 3] = - dst[2 * dst_stride + 1] = (pp[2] + pp[3] * 2 + pp[3] + 2) >> 2; - dst[2 * dst_stride + 2] = - dst[2 * dst_stride + 3] = - dst[3 * dst_stride + 0] = - dst[3 * dst_stride + 1] = - dst[3 * dst_stride + 2] = - dst[3 * dst_stride + 3] = pp[3]; - } - break; - - default: - break; - - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/reconintra4x4.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/reconintra4x4.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/reconintra4x4.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/reconintra4x4.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_RECONINTRA4X4_H_ -#define VP8_COMMON_RECONINTRA4X4_H_ -#include "vp8/common/blockd.h" - -#ifdef __cplusplus -extern "C" { -#endif - -static void intra_prediction_down_copy(MACROBLOCKD *xd, - unsigned char *above_right_src) -{ - int dst_stride = xd->dst.y_stride; - unsigned char *above_right_dst = xd->dst.y_buffer - dst_stride + 16; - - unsigned int *src_ptr = (unsigned int *)above_right_src; - unsigned int *dst_ptr0 = (unsigned int *)(above_right_dst + 4 * dst_stride); - unsigned int *dst_ptr1 = (unsigned int *)(above_right_dst + 8 * dst_stride); - unsigned int *dst_ptr2 = (unsigned int *)(above_right_dst + 12 * dst_stride); - - *dst_ptr0 = *src_ptr; - *dst_ptr1 = *src_ptr; - *dst_ptr2 = *src_ptr; -} - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_RECONINTRA4X4_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/reconintra.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/reconintra.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/reconintra.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/reconintra.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,280 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "vpx_mem/vpx_mem.h" -#include "blockd.h" - -void vp8_build_intra_predictors_mby_s_c(MACROBLOCKD *x, - unsigned char * yabove_row, - unsigned char * yleft, - int left_stride, - unsigned char * ypred_ptr, - int y_stride) -{ - unsigned char yleft_col[16]; - unsigned char ytop_left = yabove_row[-1]; - int r, c, i; - - for (i = 0; i < 16; i++) - { - yleft_col[i] = yleft[i* left_stride]; - } - - /* for Y */ - switch (x->mode_info_context->mbmi.mode) - { - case DC_PRED: - { - int expected_dc; - int shift; - int average = 0; - - - if (x->up_available || x->left_available) - { - if (x->up_available) - { - for (i = 0; i < 16; i++) - { - average += yabove_row[i]; - } - } - - if (x->left_available) - { - - for (i = 0; i < 16; i++) - { - average += yleft_col[i]; - } - - } - - - - shift = 3 + x->up_available + x->left_available; - expected_dc = (average + (1 << (shift - 1))) >> shift; - } - else - { - expected_dc = 128; - } - - /*vpx_memset(ypred_ptr, expected_dc, 256);*/ - for (r = 0; r < 16; r++) - { - vpx_memset(ypred_ptr, expected_dc, 16); - ypred_ptr += y_stride; - } - } - break; - case V_PRED: - { - - for (r = 0; r < 16; r++) - { - - ((int *)ypred_ptr)[0] = ((int *)yabove_row)[0]; - ((int *)ypred_ptr)[1] = ((int *)yabove_row)[1]; - ((int *)ypred_ptr)[2] = ((int *)yabove_row)[2]; - ((int *)ypred_ptr)[3] = ((int *)yabove_row)[3]; - ypred_ptr += y_stride; - } - } - break; - case H_PRED: - { - - for (r = 0; r < 16; r++) - { - - vpx_memset(ypred_ptr, yleft_col[r], 16); - ypred_ptr += y_stride; - } - - } - break; - case TM_PRED: - { - - for (r = 0; r < 16; r++) - { - for (c = 0; c < 16; c++) - { - int pred = yleft_col[r] + yabove_row[ c] - ytop_left; - - if (pred < 0) - pred = 0; - - if (pred > 255) - pred = 255; - - ypred_ptr[c] = pred; - } - - ypred_ptr += y_stride; - } - - } - break; - case B_PRED: - case NEARESTMV: - case NEARMV: - case ZEROMV: - case NEWMV: - case SPLITMV: - case MB_MODE_COUNT: - break; - } -} - -void vp8_build_intra_predictors_mbuv_s_c(MACROBLOCKD *x, - unsigned char * uabove_row, - unsigned char * vabove_row, - unsigned char * uleft, - unsigned char * vleft, - int left_stride, - unsigned char * upred_ptr, - unsigned char * vpred_ptr, - int pred_stride) -{ - unsigned char uleft_col[8]; - unsigned char utop_left = uabove_row[-1]; - unsigned char vleft_col[8]; - unsigned char vtop_left = vabove_row[-1]; - - int i, j; - - for (i = 0; i < 8; i++) - { - uleft_col[i] = uleft [i* left_stride]; - vleft_col[i] = vleft [i* left_stride]; - } - - switch (x->mode_info_context->mbmi.uv_mode) - { - case DC_PRED: - { - int expected_udc; - int expected_vdc; - int shift; - int Uaverage = 0; - int Vaverage = 0; - - if (x->up_available) - { - for (i = 0; i < 8; i++) - { - Uaverage += uabove_row[i]; - Vaverage += vabove_row[i]; - } - } - - if (x->left_available) - { - for (i = 0; i < 8; i++) - { - Uaverage += uleft_col[i]; - Vaverage += vleft_col[i]; - } - } - - if (!x->up_available && !x->left_available) - { - expected_udc = 128; - expected_vdc = 128; - } - else - { - shift = 2 + x->up_available + x->left_available; - expected_udc = (Uaverage + (1 << (shift - 1))) >> shift; - expected_vdc = (Vaverage + (1 << (shift - 1))) >> shift; - } - - - /*vpx_memset(upred_ptr,expected_udc,64);*/ - /*vpx_memset(vpred_ptr,expected_vdc,64);*/ - for (i = 0; i < 8; i++) - { - vpx_memset(upred_ptr, expected_udc, 8); - vpx_memset(vpred_ptr, expected_vdc, 8); - upred_ptr += pred_stride; - vpred_ptr += pred_stride; - } - } - break; - case V_PRED: - { - for (i = 0; i < 8; i++) - { - vpx_memcpy(upred_ptr, uabove_row, 8); - vpx_memcpy(vpred_ptr, vabove_row, 8); - upred_ptr += pred_stride; - vpred_ptr += pred_stride; - } - - } - break; - case H_PRED: - { - for (i = 0; i < 8; i++) - { - vpx_memset(upred_ptr, uleft_col[i], 8); - vpx_memset(vpred_ptr, vleft_col[i], 8); - upred_ptr += pred_stride; - vpred_ptr += pred_stride; - } - } - - break; - case TM_PRED: - { - for (i = 0; i < 8; i++) - { - for (j = 0; j < 8; j++) - { - int predu = uleft_col[i] + uabove_row[j] - utop_left; - int predv = vleft_col[i] + vabove_row[j] - vtop_left; - - if (predu < 0) - predu = 0; - - if (predu > 255) - predu = 255; - - if (predv < 0) - predv = 0; - - if (predv > 255) - predv = 255; - - upred_ptr[j] = predu; - vpred_ptr[j] = predv; - } - - upred_ptr += pred_stride; - vpred_ptr += pred_stride; - } - - } - break; - case B_PRED: - case NEARESTMV: - case NEARMV: - case ZEROMV: - case NEWMV: - case SPLITMV: - case MB_MODE_COUNT: - break; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/rtcd.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/rtcd.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/rtcd.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/rtcd.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2011 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#include "vpx_config.h" -#define RTCD_C -#include "vp8_rtcd.h" -#include "vpx_ports/vpx_once.h" - -extern void vpx_scale_rtcd(void); - -void vp8_rtcd() -{ - vpx_scale_rtcd(); - once(setup_rtcd_internal); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/sad_c.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/sad_c.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/sad_c.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/sad_c.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,302 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include -#include -#include "vpx_config.h" -#include "vpx/vpx_integer.h" - -static unsigned int sad_mx_n_c(const unsigned char *src_ptr, int src_stride, - const unsigned char *ref_ptr, int ref_stride, - unsigned int max_sad, int m, int n) -{ - int r, c; - unsigned int sad = 0; - - for (r = 0; r < n; r++) - { - for (c = 0; c < m; c++) - { - sad += abs(src_ptr[c] - ref_ptr[c]); - } - - if (sad > max_sad) - break; - - src_ptr += src_stride; - ref_ptr += ref_stride; - } - - return sad; -} - -/* max_sad is provided as an optional optimization point. Alternative - * implementations of these functions are not required to check it. - */ - -unsigned int vp8_sad16x16_c(const unsigned char *src_ptr, int src_stride, - const unsigned char *ref_ptr, int ref_stride, - unsigned int max_sad) -{ - return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 16, 16); -} - -unsigned int vp8_sad8x8_c(const unsigned char *src_ptr, int src_stride, - const unsigned char *ref_ptr, int ref_stride, - unsigned int max_sad) -{ - return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 8, 8); -} - -unsigned int vp8_sad16x8_c(const unsigned char *src_ptr, int src_stride, - const unsigned char *ref_ptr, int ref_stride, - unsigned int max_sad) -{ - return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 16, 8); - -} - -unsigned int vp8_sad8x16_c(const unsigned char *src_ptr, int src_stride, - const unsigned char *ref_ptr, int ref_stride, - unsigned int max_sad) -{ - return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 8, 16); -} - -unsigned int vp8_sad4x4_c(const unsigned char *src_ptr, int src_stride, - const unsigned char *ref_ptr, int ref_stride, - unsigned int max_sad) -{ - return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 4, 4); -} - -void vp8_sad16x16x3_c(const unsigned char *src_ptr, int src_stride, - const unsigned char *ref_ptr, int ref_stride, - unsigned int *sad_array) -{ - sad_array[0] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 0, ref_stride, UINT_MAX); - sad_array[1] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, UINT_MAX); - sad_array[2] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, UINT_MAX); -} - -void vp8_sad16x16x8_c(const unsigned char *src_ptr, int src_stride, - const unsigned char *ref_ptr, int ref_stride, - unsigned short *sad_array) -{ - sad_array[0] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 0, ref_stride, UINT_MAX); - sad_array[1] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, UINT_MAX); - sad_array[2] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, UINT_MAX); - sad_array[3] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 3, ref_stride, UINT_MAX); - sad_array[4] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 4, ref_stride, UINT_MAX); - sad_array[5] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 5, ref_stride, UINT_MAX); - sad_array[6] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 6, ref_stride, UINT_MAX); - sad_array[7] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 7, ref_stride, UINT_MAX); -} - -void vp8_sad16x8x3_c(const unsigned char *src_ptr, int src_stride, - const unsigned char *ref_ptr, int ref_stride, - unsigned int *sad_array) -{ - sad_array[0] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 0, ref_stride, UINT_MAX); - sad_array[1] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, UINT_MAX); - sad_array[2] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, UINT_MAX); -} - -void vp8_sad16x8x8_c(const unsigned char *src_ptr, int src_stride, - const unsigned char *ref_ptr, int ref_stride, - unsigned short *sad_array) -{ - sad_array[0] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 0, ref_stride, UINT_MAX); - sad_array[1] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, UINT_MAX); - sad_array[2] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, UINT_MAX); - sad_array[3] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 3, ref_stride, UINT_MAX); - sad_array[4] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 4, ref_stride, UINT_MAX); - sad_array[5] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 5, ref_stride, UINT_MAX); - sad_array[6] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 6, ref_stride, UINT_MAX); - sad_array[7] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 7, ref_stride, UINT_MAX); -} - -void vp8_sad8x8x3_c(const unsigned char *src_ptr, int src_stride, - const unsigned char *ref_ptr, int ref_stride, - unsigned int *sad_array) -{ - sad_array[0] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 0, ref_stride, UINT_MAX); - sad_array[1] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, UINT_MAX); - sad_array[2] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, UINT_MAX); -} - -void vp8_sad8x8x8_c(const unsigned char *src_ptr, int src_stride, - const unsigned char *ref_ptr, int ref_stride, - unsigned short *sad_array) -{ - sad_array[0] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 0, ref_stride, UINT_MAX); - sad_array[1] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, UINT_MAX); - sad_array[2] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, UINT_MAX); - sad_array[3] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 3, ref_stride, UINT_MAX); - sad_array[4] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 4, ref_stride, UINT_MAX); - sad_array[5] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 5, ref_stride, UINT_MAX); - sad_array[6] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 6, ref_stride, UINT_MAX); - sad_array[7] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 7, ref_stride, UINT_MAX); -} - -void vp8_sad8x16x3_c(const unsigned char *src_ptr, int src_stride, - const unsigned char *ref_ptr, int ref_stride, - unsigned int *sad_array) -{ - sad_array[0] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 0, ref_stride, UINT_MAX); - sad_array[1] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, UINT_MAX); - sad_array[2] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, UINT_MAX); -} - -void vp8_sad8x16x8_c(const unsigned char *src_ptr, int src_stride, - const unsigned char *ref_ptr, int ref_stride, - unsigned short *sad_array) -{ - sad_array[0] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 0, ref_stride, UINT_MAX); - sad_array[1] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, UINT_MAX); - sad_array[2] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, UINT_MAX); - sad_array[3] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 3, ref_stride, UINT_MAX); - sad_array[4] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 4, ref_stride, UINT_MAX); - sad_array[5] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 5, ref_stride, UINT_MAX); - sad_array[6] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 6, ref_stride, UINT_MAX); - sad_array[7] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 7, ref_stride, UINT_MAX); -} - -void vp8_sad4x4x3_c(const unsigned char *src_ptr, int src_stride, - const unsigned char *ref_ptr, int ref_stride, - unsigned int *sad_array) -{ - sad_array[0] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 0, ref_stride, UINT_MAX); - sad_array[1] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, UINT_MAX); - sad_array[2] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, UINT_MAX); -} - -void vp8_sad4x4x8_c(const unsigned char *src_ptr, int src_stride, - const unsigned char *ref_ptr, int ref_stride, - unsigned short *sad_array) -{ - sad_array[0] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 0, ref_stride, UINT_MAX); - sad_array[1] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, UINT_MAX); - sad_array[2] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, UINT_MAX); - sad_array[3] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 3, ref_stride, UINT_MAX); - sad_array[4] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 4, ref_stride, UINT_MAX); - sad_array[5] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 5, ref_stride, UINT_MAX); - sad_array[6] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 6, ref_stride, UINT_MAX); - sad_array[7] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 7, ref_stride, UINT_MAX); -} - -void vp8_sad16x16x4d_c(const unsigned char *src_ptr, int src_stride, - const unsigned char * const ref_ptr[], int ref_stride, - unsigned int *sad_array) -{ - sad_array[0] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr[0], ref_stride, UINT_MAX); - sad_array[1] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr[1], ref_stride, UINT_MAX); - sad_array[2] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr[2], ref_stride, UINT_MAX); - sad_array[3] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr[3], ref_stride, UINT_MAX); -} - -void vp8_sad16x8x4d_c(const unsigned char *src_ptr, int src_stride, - const unsigned char * const ref_ptr[], int ref_stride, - unsigned int *sad_array) -{ - sad_array[0] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr[0], ref_stride, UINT_MAX); - sad_array[1] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr[1], ref_stride, UINT_MAX); - sad_array[2] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr[2], ref_stride, UINT_MAX); - sad_array[3] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr[3], ref_stride, UINT_MAX); -} - -void vp8_sad8x8x4d_c(const unsigned char *src_ptr, int src_stride, - const unsigned char * const ref_ptr[], int ref_stride, - unsigned int *sad_array) -{ - sad_array[0] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr[0], ref_stride, UINT_MAX); - sad_array[1] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr[1], ref_stride, UINT_MAX); - sad_array[2] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr[2], ref_stride, UINT_MAX); - sad_array[3] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr[3], ref_stride, UINT_MAX); -} - -void vp8_sad8x16x4d_c(const unsigned char *src_ptr, int src_stride, - const unsigned char * const ref_ptr[], int ref_stride, - unsigned int *sad_array) -{ - sad_array[0] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr[0], ref_stride, UINT_MAX); - sad_array[1] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr[1], ref_stride, UINT_MAX); - sad_array[2] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr[2], ref_stride, UINT_MAX); - sad_array[3] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr[3], ref_stride, UINT_MAX); -} - -void vp8_sad4x4x4d_c(const unsigned char *src_ptr, int src_stride, - const unsigned char * const ref_ptr[], int ref_stride, - unsigned int *sad_array) -{ - sad_array[0] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr[0], ref_stride, UINT_MAX); - sad_array[1] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr[1], ref_stride, UINT_MAX); - sad_array[2] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr[2], ref_stride, UINT_MAX); - sad_array[3] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr[3], ref_stride, UINT_MAX); -} - -/* Copy 2 macroblocks to a buffer */ -void vp8_copy32xn_c(unsigned char *src_ptr, int src_stride, - unsigned char *dst_ptr, int dst_stride, - int height) -{ - int r; - - for (r = 0; r < height; r++) - { -#if !(CONFIG_FAST_UNALIGNED) - dst_ptr[0] = src_ptr[0]; - dst_ptr[1] = src_ptr[1]; - dst_ptr[2] = src_ptr[2]; - dst_ptr[3] = src_ptr[3]; - dst_ptr[4] = src_ptr[4]; - dst_ptr[5] = src_ptr[5]; - dst_ptr[6] = src_ptr[6]; - dst_ptr[7] = src_ptr[7]; - dst_ptr[8] = src_ptr[8]; - dst_ptr[9] = src_ptr[9]; - dst_ptr[10] = src_ptr[10]; - dst_ptr[11] = src_ptr[11]; - dst_ptr[12] = src_ptr[12]; - dst_ptr[13] = src_ptr[13]; - dst_ptr[14] = src_ptr[14]; - dst_ptr[15] = src_ptr[15]; - dst_ptr[16] = src_ptr[16]; - dst_ptr[17] = src_ptr[17]; - dst_ptr[18] = src_ptr[18]; - dst_ptr[19] = src_ptr[19]; - dst_ptr[20] = src_ptr[20]; - dst_ptr[21] = src_ptr[21]; - dst_ptr[22] = src_ptr[22]; - dst_ptr[23] = src_ptr[23]; - dst_ptr[24] = src_ptr[24]; - dst_ptr[25] = src_ptr[25]; - dst_ptr[26] = src_ptr[26]; - dst_ptr[27] = src_ptr[27]; - dst_ptr[28] = src_ptr[28]; - dst_ptr[29] = src_ptr[29]; - dst_ptr[30] = src_ptr[30]; - dst_ptr[31] = src_ptr[31]; -#else - ((uint32_t *)dst_ptr)[0] = ((uint32_t *)src_ptr)[0] ; - ((uint32_t *)dst_ptr)[1] = ((uint32_t *)src_ptr)[1] ; - ((uint32_t *)dst_ptr)[2] = ((uint32_t *)src_ptr)[2] ; - ((uint32_t *)dst_ptr)[3] = ((uint32_t *)src_ptr)[3] ; - ((uint32_t *)dst_ptr)[4] = ((uint32_t *)src_ptr)[4] ; - ((uint32_t *)dst_ptr)[5] = ((uint32_t *)src_ptr)[5] ; - ((uint32_t *)dst_ptr)[6] = ((uint32_t *)src_ptr)[6] ; - ((uint32_t *)dst_ptr)[7] = ((uint32_t *)src_ptr)[7] ; -#endif - src_ptr += src_stride; - dst_ptr += dst_stride; - - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/setupintrarecon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/setupintrarecon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/setupintrarecon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/setupintrarecon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "setupintrarecon.h" -#include "vpx_mem/vpx_mem.h" - -void vp8_setup_intra_recon(YV12_BUFFER_CONFIG *ybf) -{ - int i; - - /* set up frame new frame for intra coded blocks */ - vpx_memset(ybf->y_buffer - 1 - ybf->y_stride, 127, ybf->y_width + 5); - for (i = 0; i < ybf->y_height; i++) - ybf->y_buffer[ybf->y_stride *i - 1] = (unsigned char) 129; - - vpx_memset(ybf->u_buffer - 1 - ybf->uv_stride, 127, ybf->uv_width + 5); - for (i = 0; i < ybf->uv_height; i++) - ybf->u_buffer[ybf->uv_stride *i - 1] = (unsigned char) 129; - - vpx_memset(ybf->v_buffer - 1 - ybf->uv_stride, 127, ybf->uv_width + 5); - for (i = 0; i < ybf->uv_height; i++) - ybf->v_buffer[ybf->uv_stride *i - 1] = (unsigned char) 129; - -} - -void vp8_setup_intra_recon_top_line(YV12_BUFFER_CONFIG *ybf) -{ - vpx_memset(ybf->y_buffer - 1 - ybf->y_stride, 127, ybf->y_width + 5); - vpx_memset(ybf->u_buffer - 1 - ybf->uv_stride, 127, ybf->uv_width + 5); - vpx_memset(ybf->v_buffer - 1 - ybf->uv_stride, 127, ybf->uv_width + 5); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/setupintrarecon.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/setupintrarecon.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/setupintrarecon.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/setupintrarecon.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP8_COMMON_SETUPINTRARECON_H_ -#define VP8_COMMON_SETUPINTRARECON_H_ - -#include "vpx_scale/yv12config.h" - -#ifdef __cplusplus -extern "C" { -#endif -extern void vp8_setup_intra_recon(YV12_BUFFER_CONFIG *ybf); -extern void vp8_setup_intra_recon_top_line(YV12_BUFFER_CONFIG *ybf); - -static -void setup_intra_recon_left(unsigned char *y_buffer, - unsigned char *u_buffer, - unsigned char *v_buffer, - int y_stride, - int uv_stride) -{ - int i; - - for (i = 0; i < 16; i++) - y_buffer[y_stride *i] = (unsigned char) 129; - - for (i = 0; i < 8; i++) - u_buffer[uv_stride *i] = (unsigned char) 129; - - for (i = 0; i < 8; i++) - v_buffer[uv_stride *i] = (unsigned char) 129; -} - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_SETUPINTRARECON_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/swapyv12buffer.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/swapyv12buffer.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/swapyv12buffer.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/swapyv12buffer.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "swapyv12buffer.h" - -void vp8_swap_yv12_buffer(YV12_BUFFER_CONFIG *new_frame, YV12_BUFFER_CONFIG *last_frame) -{ - unsigned char *temp; - - temp = last_frame->buffer_alloc; - last_frame->buffer_alloc = new_frame->buffer_alloc; - new_frame->buffer_alloc = temp; - - temp = last_frame->y_buffer; - last_frame->y_buffer = new_frame->y_buffer; - new_frame->y_buffer = temp; - - temp = last_frame->u_buffer; - last_frame->u_buffer = new_frame->u_buffer; - new_frame->u_buffer = temp; - - temp = last_frame->v_buffer; - last_frame->v_buffer = new_frame->v_buffer; - new_frame->v_buffer = temp; - -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/swapyv12buffer.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/swapyv12buffer.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/swapyv12buffer.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/swapyv12buffer.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_SWAPYV12BUFFER_H_ -#define VP8_COMMON_SWAPYV12BUFFER_H_ - -#include "vpx_scale/yv12config.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void vp8_swap_yv12_buffer(YV12_BUFFER_CONFIG *new_frame, YV12_BUFFER_CONFIG *last_frame); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_SWAPYV12BUFFER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/systemdependent.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/systemdependent.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/systemdependent.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/systemdependent.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP8_COMMON_SYSTEMDEPENDENT_H_ -#define VP8_COMMON_SYSTEMDEPENDENT_H_ - -#include "vpx_config.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct VP8Common; -void vp8_machine_specific_config(struct VP8Common *); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_SYSTEMDEPENDENT_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/textblit.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/textblit.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/textblit.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/textblit.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - - -void vp8_blit_text(const char *msg, unsigned char *address, const int pitch) -{ - int letter_bitmap; - unsigned char *output_pos = address; - int colpos; - const int font[] = - { - 0x0, 0x5C00, 0x8020, 0xAFABEA, 0xD7EC0, 0x1111111, 0x1855740, 0x18000, - 0x45C0, 0x74400, 0x51140, 0x23880, 0xC4000, 0x21080, 0x80000, 0x111110, - 0xE9D72E, 0x87E40, 0x12AD732, 0xAAD62A, 0x4F94C4, 0x4D6B7, 0x456AA, - 0x3E8423, 0xAAD6AA, 0xAAD6A2, 0x2800, 0x2A00, 0x8A880, 0x52940, 0x22A20, - 0x15422, 0x6AD62E, 0x1E4A53E, 0xAAD6BF, 0x8C62E, 0xE8C63F, 0x118D6BF, - 0x1094BF, 0xCAC62E, 0x1F2109F, 0x118FE31, 0xF8C628, 0x8A89F, 0x108421F, - 0x1F1105F, 0x1F4105F, 0xE8C62E, 0x2294BF, 0x164C62E, 0x12694BF, 0x8AD6A2, - 0x10FC21, 0x1F8421F, 0x744107, 0xF8220F, 0x1151151, 0x117041, 0x119D731, - 0x47E0, 0x1041041, 0xFC400, 0x10440, 0x1084210, 0x820 - }; - colpos = 0; - - while (msg[colpos] != 0) - { - char letter = msg[colpos]; - int fontcol, fontrow; - - if (letter <= 'Z' && letter >= ' ') - letter_bitmap = font[letter-' ']; - else if (letter <= 'z' && letter >= 'a') - letter_bitmap = font[letter-'a'+'A' - ' ']; - else - letter_bitmap = font[0]; - - for (fontcol = 6; fontcol >= 0 ; fontcol--) - for (fontrow = 0; fontrow < 5; fontrow++) - output_pos[fontrow *pitch + fontcol] = - ((letter_bitmap >> (fontcol * 5)) & (1 << fontrow) ? 255 : 0); - - output_pos += 7; - colpos++; - } -} - -static void plot (const int x, const int y, unsigned char *image, const int pitch) -{ - image [x+y*pitch] ^= 255; -} - -/* Bresenham line algorithm */ -void vp8_blit_line(int x0, int x1, int y0, int y1, unsigned char *image, const int pitch) -{ - int steep = abs(y1 - y0) > abs(x1 - x0); - int deltax, deltay; - int error, ystep, y, x; - - if (steep) - { - int t; - t = x0; - x0 = y0; - y0 = t; - - t = x1; - x1 = y1; - y1 = t; - } - - if (x0 > x1) - { - int t; - t = x0; - x0 = x1; - x1 = t; - - t = y0; - y0 = y1; - y1 = t; - } - - deltax = x1 - x0; - deltay = abs(y1 - y0); - error = deltax / 2; - - y = y0; - - if (y0 < y1) - ystep = 1; - else - ystep = -1; - - if (steep) - { - for (x = x0; x <= x1; x++) - { - plot(y,x, image, pitch); - - error = error - deltay; - if (error < 0) - { - y = y + ystep; - error = error + deltax; - } - } - } - else - { - for (x = x0; x <= x1; x++) - { - plot(x,y, image, pitch); - - error = error - deltay; - if (error < 0) - { - y = y + ystep; - error = error + deltax; - } - } - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/threading.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/threading.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/threading.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/threading.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,194 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_THREADING_H_ -#define VP8_COMMON_THREADING_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#if CONFIG_OS_SUPPORT && CONFIG_MULTITHREAD - -/* Thread management macros */ -#ifdef _WIN32 -/* Win32 */ -#include -#include -#define THREAD_FUNCTION DWORD WINAPI -#define THREAD_FUNCTION_RETURN DWORD -#define THREAD_SPECIFIC_INDEX DWORD -#define pthread_t HANDLE -#define pthread_attr_t DWORD -#define pthread_create(thhandle,attr,thfunc,tharg) (int)((*thhandle=(HANDLE)_beginthreadex(NULL,0,(unsigned int (__stdcall *)(void *))thfunc,tharg,0,NULL))==NULL) -#define pthread_join(thread, result) ((WaitForSingleObject((thread),INFINITE)!=WAIT_OBJECT_0) || !CloseHandle(thread)) -#define pthread_detach(thread) if(thread!=NULL)CloseHandle(thread) -#define thread_sleep(nms) Sleep(nms) -#define pthread_cancel(thread) terminate_thread(thread,0) -#define ts_key_create(ts_key, destructor) {ts_key = TlsAlloc();}; -#define pthread_getspecific(ts_key) TlsGetValue(ts_key) -#define pthread_setspecific(ts_key, value) TlsSetValue(ts_key, (void *)value) -#define pthread_self() GetCurrentThreadId() - -#elif defined(__OS2__) -/* OS/2 */ -#define INCL_DOS -#include - -#include -#define THREAD_FUNCTION void -#define THREAD_FUNCTION_RETURN void -#define THREAD_SPECIFIC_INDEX PULONG -#define pthread_t TID -#define pthread_attr_t ULONG -#define pthread_create(thhandle,attr,thfunc,tharg) \ - ((int)((*(thhandle)=_beginthread(thfunc,NULL,1024*1024,tharg))==-1)) -#define pthread_join(thread, result) ((int)DosWaitThread(&(thread),0)) -#define pthread_detach(thread) 0 -#define thread_sleep(nms) DosSleep(nms) -#define pthread_cancel(thread) DosKillThread(thread) -#define ts_key_create(ts_key, destructor) \ - DosAllocThreadLocalMemory(1, &(ts_key)); -#define pthread_getspecific(ts_key) ((void *)(*(ts_key))) -#define pthread_setspecific(ts_key, value) (*(ts_key)=(ULONG)(value)) -#define pthread_self() _gettid() -#else -#ifdef __APPLE__ -#include -#include -#include -#include -#include - -#else -#include -#endif - -#include -/* pthreads */ -/* Nearly everything is already defined */ -#define THREAD_FUNCTION void * -#define THREAD_FUNCTION_RETURN void * -#define THREAD_SPECIFIC_INDEX pthread_key_t -#define ts_key_create(ts_key, destructor) pthread_key_create (&(ts_key), destructor); -#endif - -/* Syncrhronization macros: Win32 and Pthreads */ -#ifdef _WIN32 -#define sem_t HANDLE -#define pause(voidpara) __asm PAUSE -#define sem_init(sem, sem_attr1, sem_init_value) (int)((*sem = CreateSemaphore(NULL,0,32768,NULL))==NULL) -#define sem_wait(sem) (int)(WAIT_OBJECT_0 != WaitForSingleObject(*sem,INFINITE)) -#define sem_post(sem) ReleaseSemaphore(*sem,1,NULL) -#define sem_destroy(sem) if(*sem)((int)(CloseHandle(*sem))==TRUE) -#define thread_sleep(nms) Sleep(nms) - -#elif defined(__OS2__) -typedef struct -{ - HEV event; - HMTX wait_mutex; - HMTX count_mutex; - int count; -} sem_t; - -static inline int sem_init(sem_t *sem, int pshared, unsigned int value) -{ - DosCreateEventSem(NULL, &sem->event, pshared ? DC_SEM_SHARED : 0, - value > 0 ? TRUE : FALSE); - DosCreateMutexSem(NULL, &sem->wait_mutex, 0, FALSE); - DosCreateMutexSem(NULL, &sem->count_mutex, 0, FALSE); - - sem->count = value; - - return 0; -} - -static inline int sem_wait(sem_t * sem) -{ - DosRequestMutexSem(sem->wait_mutex, -1); - - DosWaitEventSem(sem->event, -1); - - DosRequestMutexSem(sem->count_mutex, -1); - - sem->count--; - if (sem->count == 0) - { - ULONG post_count; - - DosResetEventSem(sem->event, &post_count); - } - - DosReleaseMutexSem(sem->count_mutex); - - DosReleaseMutexSem(sem->wait_mutex); - - return 0; -} - -static inline int sem_post(sem_t * sem) -{ - DosRequestMutexSem(sem->count_mutex, -1); - - if (sem->count < 32768) - { - sem->count++; - DosPostEventSem(sem->event); - } - - DosReleaseMutexSem(sem->count_mutex); - - return 0; -} - -static inline int sem_destroy(sem_t * sem) -{ - DosCloseEventSem(sem->event); - DosCloseMutexSem(sem->wait_mutex); - DosCloseMutexSem(sem->count_mutex); - - return 0; -} - -#define thread_sleep(nms) DosSleep(nms) - -#else - -#ifdef __APPLE__ -#define sem_t semaphore_t -#define sem_init(X,Y,Z) semaphore_create(mach_task_self(), X, SYNC_POLICY_FIFO, Z) -#define sem_wait(sem) (semaphore_wait(*sem) ) -#define sem_post(sem) semaphore_signal(*sem) -#define sem_destroy(sem) semaphore_destroy(mach_task_self(),*sem) -#define thread_sleep(nms) /* { struct timespec ts;ts.tv_sec=0; ts.tv_nsec = 1000*nms;nanosleep(&ts, NULL);} */ -#else -#include -#include -#define thread_sleep(nms) sched_yield();/* {struct timespec ts;ts.tv_sec=0; ts.tv_nsec = 1000*nms;nanosleep(&ts, NULL);} */ -#endif -/* Not Windows. Assume pthreads */ - -#endif - -#if ARCH_X86 || ARCH_X86_64 -#include "vpx_ports/x86.h" -#else -#define x86_pause_hint() -#endif - -#endif /* CONFIG_OS_SUPPORT && CONFIG_MULTITHREAD */ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_THREADING_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/treecoder.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/treecoder.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/treecoder.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/treecoder.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#if CONFIG_DEBUG -#include -#endif -#include - -#include "treecoder.h" - -static void tree2tok( - struct vp8_token_struct *const p, - vp8_tree t, - int i, - int v, - int L -) -{ - v += v; - ++L; - - do - { - const vp8_tree_index j = t[i++]; - - if (j <= 0) - { - p[-j].value = v; - p[-j].Len = L; - } - else - tree2tok(p, t, j, v, L); - } - while (++v & 1); -} - -void vp8_tokens_from_tree(struct vp8_token_struct *p, vp8_tree t) -{ - tree2tok(p, t, 0, 0, 0); -} - -void vp8_tokens_from_tree_offset(struct vp8_token_struct *p, vp8_tree t, - int offset) -{ - tree2tok(p - offset, t, 0, 0, 0); -} - -static void branch_counts( - int n, /* n = size of alphabet */ - vp8_token tok [ /* n */ ], - vp8_tree tree, - unsigned int branch_ct [ /* n-1 */ ] [2], - const unsigned int num_events[ /* n */ ] -) -{ - const int tree_len = n - 1; - int t = 0; - -#if CONFIG_DEBUG - assert(tree_len); -#endif - - do - { - branch_ct[t][0] = branch_ct[t][1] = 0; - } - while (++t < tree_len); - - t = 0; - - do - { - int L = tok[t].Len; - const int enc = tok[t].value; - const unsigned int ct = num_events[t]; - - vp8_tree_index i = 0; - - do - { - const int b = (enc >> --L) & 1; - const int j = i >> 1; -#if CONFIG_DEBUG - assert(j < tree_len && 0 <= L); -#endif - - branch_ct [j] [b] += ct; - i = tree[ i + b]; - } - while (i > 0); - -#if CONFIG_DEBUG - assert(!L); -#endif - } - while (++t < n); - -} - - -void vp8_tree_probs_from_distribution( - int n, /* n = size of alphabet */ - vp8_token tok [ /* n */ ], - vp8_tree tree, - vp8_prob probs [ /* n-1 */ ], - unsigned int branch_ct [ /* n-1 */ ] [2], - const unsigned int num_events[ /* n */ ], - unsigned int Pfac, - int rd -) -{ - const int tree_len = n - 1; - int t = 0; - - branch_counts(n, tok, tree, branch_ct, num_events); - - do - { - const unsigned int *const c = branch_ct[t]; - const unsigned int tot = c[0] + c[1]; - -#if CONFIG_DEBUG - assert(tot < (1 << 24)); /* no overflow below */ -#endif - - if (tot) - { - const unsigned int p = ((c[0] * Pfac) + (rd ? tot >> 1 : 0)) / tot; - probs[t] = p < 256 ? (p ? p : 1) : 255; /* agree w/old version for now */ - } - else - probs[t] = vp8_prob_half; - } - while (++t < tree_len); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/treecoder.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/treecoder.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/treecoder.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/treecoder.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_TREECODER_H_ -#define VP8_COMMON_TREECODER_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef unsigned char vp8bc_index_t; /* probability index */ - - -typedef unsigned char vp8_prob; - -#define vp8_prob_half ( (vp8_prob) 128) - -typedef signed char vp8_tree_index; -struct bool_coder_spec; - -typedef struct bool_coder_spec bool_coder_spec; -typedef struct bool_writer bool_writer; -typedef struct bool_reader bool_reader; - -typedef const bool_coder_spec c_bool_coder_spec; -typedef const bool_writer c_bool_writer; -typedef const bool_reader c_bool_reader; - - - -# define vp8_complement( x) (255 - x) - - -/* We build coding trees compactly in arrays. - Each node of the tree is a pair of vp8_tree_indices. - Array index often references a corresponding probability table. - Index <= 0 means done encoding/decoding and value = -Index, - Index > 0 means need another bit, specification at index. - Nonnegative indices are always even; processing begins at node 0. */ - -typedef const vp8_tree_index vp8_tree[], *vp8_tree_p; - - -typedef const struct vp8_token_struct -{ - int value; - int Len; -} vp8_token; - -/* Construct encoding array from tree. */ - -void vp8_tokens_from_tree(struct vp8_token_struct *, vp8_tree); -void vp8_tokens_from_tree_offset(struct vp8_token_struct *, vp8_tree, - int offset); - - -/* Convert array of token occurrence counts into a table of probabilities - for the associated binary encoding tree. Also writes count of branches - taken for each node on the tree; this facilitiates decisions as to - probability updates. */ - -void vp8_tree_probs_from_distribution( - int n, /* n = size of alphabet */ - vp8_token tok [ /* n */ ], - vp8_tree tree, - vp8_prob probs [ /* n-1 */ ], - unsigned int branch_ct [ /* n-1 */ ] [2], - const unsigned int num_events[ /* n */ ], - unsigned int Pfactor, - int Round -); - -/* Variant of above using coder spec rather than hardwired 8-bit probs. */ - -void vp8bc_tree_probs_from_distribution( - int n, /* n = size of alphabet */ - vp8_token tok [ /* n */ ], - vp8_tree tree, - vp8_prob probs [ /* n-1 */ ], - unsigned int branch_ct [ /* n-1 */ ] [2], - const unsigned int num_events[ /* n */ ], - c_bool_coder_spec *s -); - - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_TREECODER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/variance_c.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/variance_c.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/variance_c.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/variance_c.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,458 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "variance.h" -#include "filter.h" - - -unsigned int vp8_get_mb_ss_c -( - const short *src_ptr -) -{ - unsigned int i = 0, sum = 0; - - do - { - sum += (src_ptr[i] * src_ptr[i]); - i++; - } - while (i < 256); - - return sum; -} - - -static void variance( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - int w, - int h, - unsigned int *sse, - int *sum) -{ - int i, j; - int diff; - - *sum = 0; - *sse = 0; - - for (i = 0; i < h; i++) - { - for (j = 0; j < w; j++) - { - diff = src_ptr[j] - ref_ptr[j]; - *sum += diff; - *sse += diff * diff; - } - - src_ptr += source_stride; - ref_ptr += recon_stride; - } -} - - -unsigned int vp8_variance16x16_c( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - unsigned int var; - int avg; - - - variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 16, &var, &avg); - *sse = var; - return (var - (((unsigned int)avg * avg) >> 8)); -} - -unsigned int vp8_variance8x16_c( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - unsigned int var; - int avg; - - - variance(src_ptr, source_stride, ref_ptr, recon_stride, 8, 16, &var, &avg); - *sse = var; - return (var - (((unsigned int)avg * avg) >> 7)); -} - -unsigned int vp8_variance16x8_c( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - unsigned int var; - int avg; - - - variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 8, &var, &avg); - *sse = var; - return (var - (((unsigned int)avg * avg) >> 7)); -} - - -unsigned int vp8_variance8x8_c( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - unsigned int var; - int avg; - - - variance(src_ptr, source_stride, ref_ptr, recon_stride, 8, 8, &var, &avg); - *sse = var; - return (var - (((unsigned int)avg * avg) >> 6)); -} - -unsigned int vp8_variance4x4_c( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - unsigned int var; - int avg; - - - variance(src_ptr, source_stride, ref_ptr, recon_stride, 4, 4, &var, &avg); - *sse = var; - return (var - (((unsigned int)avg * avg) >> 4)); -} - - -unsigned int vp8_mse16x16_c( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - unsigned int var; - int avg; - - variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 16, &var, &avg); - *sse = var; - return var; -} - - -/**************************************************************************** - * - * ROUTINE : filter_block2d_bil_first_pass - * - * INPUTS : UINT8 *src_ptr : Pointer to source block. - * UINT32 src_pixels_per_line : Stride of input block. - * UINT32 pixel_step : Offset between filter input samples (see notes). - * UINT32 output_height : Input block height. - * UINT32 output_width : Input block width. - * INT32 *vp8_filter : Array of 2 bi-linear filter taps. - * - * OUTPUTS : INT32 *output_ptr : Pointer to filtered block. - * - * RETURNS : void - * - * FUNCTION : Applies a 1-D 2-tap bi-linear filter to the source block in - * either horizontal or vertical direction to produce the - * filtered output block. Used to implement first-pass - * of 2-D separable filter. - * - * SPECIAL NOTES : Produces INT32 output to retain precision for next pass. - * Two filter taps should sum to VP8_FILTER_WEIGHT. - * pixel_step defines whether the filter is applied - * horizontally (pixel_step=1) or vertically (pixel_step=stride). - * It defines the offset required to move from one input - * to the next. - * - ****************************************************************************/ -static void var_filter_block2d_bil_first_pass -( - const unsigned char *src_ptr, - unsigned short *output_ptr, - unsigned int src_pixels_per_line, - int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter -) -{ - unsigned int i, j; - - for (i = 0; i < output_height; i++) - { - for (j = 0; j < output_width; j++) - { - /* Apply bilinear filter */ - output_ptr[j] = (((int)src_ptr[0] * vp8_filter[0]) + - ((int)src_ptr[pixel_step] * vp8_filter[1]) + - (VP8_FILTER_WEIGHT / 2)) >> VP8_FILTER_SHIFT; - src_ptr++; - } - - /* Next row... */ - src_ptr += src_pixels_per_line - output_width; - output_ptr += output_width; - } -} - -/**************************************************************************** - * - * ROUTINE : filter_block2d_bil_second_pass - * - * INPUTS : INT32 *src_ptr : Pointer to source block. - * UINT32 src_pixels_per_line : Stride of input block. - * UINT32 pixel_step : Offset between filter input samples (see notes). - * UINT32 output_height : Input block height. - * UINT32 output_width : Input block width. - * INT32 *vp8_filter : Array of 2 bi-linear filter taps. - * - * OUTPUTS : UINT16 *output_ptr : Pointer to filtered block. - * - * RETURNS : void - * - * FUNCTION : Applies a 1-D 2-tap bi-linear filter to the source block in - * either horizontal or vertical direction to produce the - * filtered output block. Used to implement second-pass - * of 2-D separable filter. - * - * SPECIAL NOTES : Requires 32-bit input as produced by filter_block2d_bil_first_pass. - * Two filter taps should sum to VP8_FILTER_WEIGHT. - * pixel_step defines whether the filter is applied - * horizontally (pixel_step=1) or vertically (pixel_step=stride). - * It defines the offset required to move from one input - * to the next. - * - ****************************************************************************/ -static void var_filter_block2d_bil_second_pass -( - const unsigned short *src_ptr, - unsigned char *output_ptr, - unsigned int src_pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter -) -{ - unsigned int i, j; - int Temp; - - for (i = 0; i < output_height; i++) - { - for (j = 0; j < output_width; j++) - { - /* Apply filter */ - Temp = ((int)src_ptr[0] * vp8_filter[0]) + - ((int)src_ptr[pixel_step] * vp8_filter[1]) + - (VP8_FILTER_WEIGHT / 2); - output_ptr[j] = (unsigned int)(Temp >> VP8_FILTER_SHIFT); - src_ptr++; - } - - /* Next row... */ - src_ptr += src_pixels_per_line - output_width; - output_ptr += output_width; - } -} - - -unsigned int vp8_sub_pixel_variance4x4_c -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse -) -{ - unsigned char temp2[20*16]; - const short *HFilter, *VFilter; - unsigned short FData3[5*4]; /* Temp data bufffer used in filtering */ - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - /* First filter 1d Horizontal */ - var_filter_block2d_bil_first_pass(src_ptr, FData3, src_pixels_per_line, 1, 5, 4, HFilter); - - /* Now filter Verticaly */ - var_filter_block2d_bil_second_pass(FData3, temp2, 4, 4, 4, 4, VFilter); - - return vp8_variance4x4_c(temp2, 4, dst_ptr, dst_pixels_per_line, sse); -} - - -unsigned int vp8_sub_pixel_variance8x8_c -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse -) -{ - unsigned short FData3[9*8]; /* Temp data bufffer used in filtering */ - unsigned char temp2[20*16]; - const short *HFilter, *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - var_filter_block2d_bil_first_pass(src_ptr, FData3, src_pixels_per_line, 1, 9, 8, HFilter); - var_filter_block2d_bil_second_pass(FData3, temp2, 8, 8, 8, 8, VFilter); - - return vp8_variance8x8_c(temp2, 8, dst_ptr, dst_pixels_per_line, sse); -} - -unsigned int vp8_sub_pixel_variance16x16_c -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse -) -{ - unsigned short FData3[17*16]; /* Temp data bufffer used in filtering */ - unsigned char temp2[20*16]; - const short *HFilter, *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - var_filter_block2d_bil_first_pass(src_ptr, FData3, src_pixels_per_line, 1, 17, 16, HFilter); - var_filter_block2d_bil_second_pass(FData3, temp2, 16, 16, 16, 16, VFilter); - - return vp8_variance16x16_c(temp2, 16, dst_ptr, dst_pixels_per_line, sse); -} - - -unsigned int vp8_variance_halfpixvar16x16_h_c( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - return vp8_sub_pixel_variance16x16_c(src_ptr, source_stride, 4, 0, - ref_ptr, recon_stride, sse); -} - - -unsigned int vp8_variance_halfpixvar16x16_v_c( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - return vp8_sub_pixel_variance16x16_c(src_ptr, source_stride, 0, 4, - ref_ptr, recon_stride, sse); -} - - -unsigned int vp8_variance_halfpixvar16x16_hv_c( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - return vp8_sub_pixel_variance16x16_c(src_ptr, source_stride, 4, 4, - ref_ptr, recon_stride, sse); -} - - -unsigned int vp8_sub_pixel_mse16x16_c -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse -) -{ - vp8_sub_pixel_variance16x16_c(src_ptr, src_pixels_per_line, xoffset, yoffset, dst_ptr, dst_pixels_per_line, sse); - return *sse; -} - -unsigned int vp8_sub_pixel_variance16x8_c -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse -) -{ - unsigned short FData3[16*9]; /* Temp data bufffer used in filtering */ - unsigned char temp2[20*16]; - const short *HFilter, *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - var_filter_block2d_bil_first_pass(src_ptr, FData3, src_pixels_per_line, 1, 9, 16, HFilter); - var_filter_block2d_bil_second_pass(FData3, temp2, 16, 16, 8, 16, VFilter); - - return vp8_variance16x8_c(temp2, 16, dst_ptr, dst_pixels_per_line, sse); -} - -unsigned int vp8_sub_pixel_variance8x16_c -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse -) -{ - unsigned short FData3[9*16]; /* Temp data bufffer used in filtering */ - unsigned char temp2[20*16]; - const short *HFilter, *VFilter; - - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - - var_filter_block2d_bil_first_pass(src_ptr, FData3, src_pixels_per_line, 1, 17, 8, HFilter); - var_filter_block2d_bil_second_pass(FData3, temp2, 8, 8, 16, 8, VFilter); - - return vp8_variance8x16_c(temp2, 8, dst_ptr, dst_pixels_per_line, sse); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/variance.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/variance.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/variance.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/variance.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_COMMON_VARIANCE_H_ -#define VP8_COMMON_VARIANCE_H_ - -#include "vpx_config.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef unsigned int(*vp8_sad_fn_t)( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int ref_stride, - unsigned int max_sad); - -typedef void (*vp8_copy32xn_fn_t)( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int ref_stride, - int n); - -typedef void (*vp8_sad_multi_fn_t)( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int ref_stride, - unsigned int *sad_array); - -typedef void (*vp8_sad_multi1_fn_t) - ( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int ref_stride, - unsigned short *sad_array - ); - -typedef void (*vp8_sad_multi_d_fn_t) - ( - const unsigned char *src_ptr, - int source_stride, - const unsigned char * const ref_ptr[], - int ref_stride, - unsigned int *sad_array - ); - -typedef unsigned int (*vp8_variance_fn_t) - ( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int ref_stride, - unsigned int *sse - ); - -typedef unsigned int (*vp8_subpixvariance_fn_t) - ( - const unsigned char *src_ptr, - int source_stride, - int xoffset, - int yoffset, - const unsigned char *ref_ptr, - int Refstride, - unsigned int *sse - ); - -typedef void (*vp8_ssimpf_fn_t) - ( - unsigned char *s, - int sp, - unsigned char *r, - int rp, - unsigned long *sum_s, - unsigned long *sum_r, - unsigned long *sum_sq_s, - unsigned long *sum_sq_r, - unsigned long *sum_sxr - ); - -typedef unsigned int (*vp8_getmbss_fn_t)(const short *); - -typedef unsigned int (*vp8_get16x16prederror_fn_t) - ( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int ref_stride - ); - -typedef struct variance_vtable -{ - vp8_sad_fn_t sdf; - vp8_variance_fn_t vf; - vp8_subpixvariance_fn_t svf; - vp8_variance_fn_t svf_halfpix_h; - vp8_variance_fn_t svf_halfpix_v; - vp8_variance_fn_t svf_halfpix_hv; - vp8_sad_multi_fn_t sdx3f; - vp8_sad_multi1_fn_t sdx8f; - vp8_sad_multi_d_fn_t sdx4df; -#if ARCH_X86 || ARCH_X86_64 - vp8_copy32xn_fn_t copymem; -#endif -} vp8_variance_fn_ptr_t; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_VARIANCE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/vp8_entropymodedata.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/vp8_entropymodedata.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/vp8_entropymodedata.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/vp8_entropymodedata.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,254 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. -*/ - -#ifndef VP8_COMMON_VP8_ENTROPYMODEDATA_H_ -#define VP8_COMMON_VP8_ENTROPYMODEDATA_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/*Generated file, included by entropymode.c*/ - - -const struct vp8_token_struct vp8_bmode_encodings[VP8_BINTRAMODES] = -{ - { 0, 1 }, - { 2, 2 }, - { 6, 3 }, - { 28, 5 }, - { 30, 5 }, - { 58, 6 }, - { 59, 6 }, - { 62, 6 }, - { 126, 7 }, - { 127, 7 } -}; - -const struct vp8_token_struct vp8_ymode_encodings[VP8_YMODES] = -{ - { 0, 1 }, - { 4, 3 }, - { 5, 3 }, - { 6, 3 }, - { 7, 3 } -}; - -const struct vp8_token_struct vp8_kf_ymode_encodings[VP8_YMODES] = -{ - { 4, 3 }, - { 5, 3 }, - { 6, 3 }, - { 7, 3 }, - { 0, 1 } -}; - -const struct vp8_token_struct vp8_uv_mode_encodings[VP8_UV_MODES] = -{ - { 0, 1 }, - { 2, 2 }, - { 6, 3 }, - { 7, 3 } -}; - -const struct vp8_token_struct vp8_mbsplit_encodings[VP8_NUMMBSPLITS] = -{ - { 6, 3 }, - { 7, 3 }, - { 2, 2 }, - { 0, 1 } -}; - -const struct vp8_token_struct vp8_mv_ref_encoding_array[VP8_MVREFS] = -{ - { 2, 2 }, - { 6, 3 }, - { 0, 1 }, - { 14, 4 }, - { 15, 4 } -}; - -const struct vp8_token_struct vp8_sub_mv_ref_encoding_array[VP8_SUBMVREFS] = -{ - { 0, 1 }, - { 2, 2 }, - { 6, 3 }, - { 7, 3 } -}; - -const struct vp8_token_struct vp8_small_mvencodings[8] = -{ - { 0, 3 }, - { 1, 3 }, - { 2, 3 }, - { 3, 3 }, - { 4, 3 }, - { 5, 3 }, - { 6, 3 }, - { 7, 3 } -}; - -const vp8_prob vp8_ymode_prob[VP8_YMODES-1] = -{ - 112, 86, 140, 37 -}; - -const vp8_prob vp8_kf_ymode_prob[VP8_YMODES-1] = -{ - 145, 156, 163, 128 -}; - -const vp8_prob vp8_uv_mode_prob[VP8_UV_MODES-1] = -{ - 162, 101, 204 -}; - -const vp8_prob vp8_kf_uv_mode_prob[VP8_UV_MODES-1] = -{ - 142, 114, 183 -}; - -const vp8_prob vp8_bmode_prob[VP8_BINTRAMODES-1] = -{ - 120, 90, 79, 133, 87, 85, 80, 111, 151 -}; - - - -const vp8_prob vp8_kf_bmode_prob -[VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES-1] = -{ - { - { 231, 120, 48, 89, 115, 113, 120, 152, 112 }, - { 152, 179, 64, 126, 170, 118, 46, 70, 95 }, - { 175, 69, 143, 80, 85, 82, 72, 155, 103 }, - { 56, 58, 10, 171, 218, 189, 17, 13, 152 }, - { 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 }, - { 170, 46, 55, 19, 136, 160, 33, 206, 71 }, - { 63, 20, 8, 114, 114, 208, 12, 9, 226 }, - { 81, 40, 11, 96, 182, 84, 29, 16, 36 } - }, - { - { 134, 183, 89, 137, 98, 101, 106, 165, 148 }, - { 72, 187, 100, 130, 157, 111, 32, 75, 80 }, - { 66, 102, 167, 99, 74, 62, 40, 234, 128 }, - { 41, 53, 9, 178, 241, 141, 26, 8, 107 }, - { 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 }, - { 87, 68, 71, 44, 114, 51, 15, 186, 23 }, - { 47, 41, 14, 110, 182, 183, 21, 17, 194 }, - { 66, 45, 25, 102, 197, 189, 23, 18, 22 } - }, - { - { 88, 88, 147, 150, 42, 46, 45, 196, 205 }, - { 43, 97, 183, 117, 85, 38, 35, 179, 61 }, - { 39, 53, 200, 87, 26, 21, 43, 232, 171 }, - { 56, 34, 51, 104, 114, 102, 29, 93, 77 }, - { 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 }, - { 68, 25, 106, 22, 64, 171, 36, 225, 114 }, - { 34, 19, 21, 102, 132, 188, 16, 76, 124 }, - { 62, 18, 78, 95, 85, 57, 50, 48, 51 } - }, - { - { 193, 101, 35, 159, 215, 111, 89, 46, 111 }, - { 60, 148, 31, 172, 219, 228, 21, 18, 111 }, - { 112, 113, 77, 85, 179, 255, 38, 120, 114 }, - { 40, 42, 1, 196, 245, 209, 10, 25, 109 }, - { 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 }, - { 142, 78, 78, 16, 255, 128, 34, 197, 171 }, - { 41, 40, 5, 102, 211, 183, 4, 1, 221 }, - { 51, 50, 17, 168, 209, 192, 23, 25, 82 } - }, - { - { 125, 98, 42, 88, 104, 85, 117, 175, 82 }, - { 95, 84, 53, 89, 128, 100, 113, 101, 45 }, - { 75, 79, 123, 47, 51, 128, 81, 171, 1 }, - { 57, 17, 5, 71, 102, 57, 53, 41, 49 }, - { 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 }, - { 101, 29, 16, 10, 85, 128, 101, 196, 26 }, - { 57, 18, 10, 102, 102, 213, 34, 20, 43 }, - { 117, 20, 15, 36, 163, 128, 68, 1, 26 } - }, - { - { 138, 31, 36, 171, 27, 166, 38, 44, 229 }, - { 67, 87, 58, 169, 82, 115, 26, 59, 179 }, - { 63, 59, 90, 180, 59, 166, 93, 73, 154 }, - { 40, 40, 21, 116, 143, 209, 34, 39, 175 }, - { 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 }, - { 65, 32, 73, 115, 28, 128, 23, 128, 205 }, - { 40, 3, 9, 115, 51, 192, 18, 6, 223 }, - { 87, 37, 9, 115, 59, 77, 64, 21, 47 } - }, - { - { 104, 55, 44, 218, 9, 54, 53, 130, 226 }, - { 64, 90, 70, 205, 40, 41, 23, 26, 57 }, - { 54, 57, 112, 184, 5, 41, 38, 166, 213 }, - { 30, 34, 26, 133, 152, 116, 10, 32, 134 }, - { 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 }, - { 88, 31, 35, 67, 102, 85, 55, 186, 85 }, - { 56, 21, 23, 111, 59, 205, 45, 37, 192 }, - { 55, 38, 70, 124, 73, 102, 1, 34, 98 } - }, - { - { 102, 61, 71, 37, 34, 53, 31, 243, 192 }, - { 69, 60, 71, 38, 73, 119, 28, 222, 37 }, - { 68, 45, 128, 34, 1, 47, 11, 245, 171 }, - { 62, 17, 19, 70, 146, 85, 55, 62, 70 }, - { 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 }, - { 86, 6, 28, 5, 64, 255, 25, 248, 1 }, - { 56, 8, 17, 132, 137, 255, 55, 116, 128 }, - { 58, 15, 20, 82, 135, 57, 26, 121, 40 } - }, - { - { 164, 50, 31, 137, 154, 133, 25, 35, 218 }, - { 51, 103, 44, 131, 131, 123, 31, 6, 158 }, - { 86, 40, 64, 135, 148, 224, 45, 183, 128 }, - { 22, 26, 17, 131, 240, 154, 14, 1, 209 }, - { 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 }, - { 85, 26, 85, 85, 128, 128, 32, 146, 171 }, - { 18, 11, 7, 63, 144, 171, 4, 4, 246 }, - { 35, 27, 10, 146, 174, 171, 12, 26, 128 } - }, - { - { 190, 80, 35, 99, 180, 80, 126, 54, 45 }, - { 85, 126, 47, 87, 176, 51, 41, 20, 32 }, - { 101, 75, 128, 139, 118, 146, 116, 128, 85 }, - { 56, 41, 15, 176, 236, 85, 37, 9, 62 }, - { 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 }, - { 138, 45, 61, 62, 219, 1, 81, 188, 64 }, - { 32, 41, 20, 117, 151, 142, 20, 21, 163 }, - { 112, 19, 12, 61, 195, 128, 48, 4, 24 } - } -}; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_VP8_ENTROPYMODEDATA_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/dequantize_mmx.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/dequantize_mmx.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/dequantize_mmx.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/dequantize_mmx.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,258 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - - -;void vp8_dequantize_b_impl_mmx(short *sq, short *dq, short *q) -global sym(vp8_dequantize_b_impl_mmx) PRIVATE -sym(vp8_dequantize_b_impl_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 3 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;sq - mov rdi, arg(1) ;dq - mov rax, arg(2) ;q - - movq mm1, [rsi] - pmullw mm1, [rax+0] ; mm4 *= kernel 0 modifiers. - movq [rdi], mm1 - - movq mm1, [rsi+8] - pmullw mm1, [rax+8] ; mm4 *= kernel 0 modifiers. - movq [rdi+8], mm1 - - movq mm1, [rsi+16] - pmullw mm1, [rax+16] ; mm4 *= kernel 0 modifiers. - movq [rdi+16], mm1 - - movq mm1, [rsi+24] - pmullw mm1, [rax+24] ; mm4 *= kernel 0 modifiers. - movq [rdi+24], mm1 - - ; begin epilog - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret - - -;void dequant_idct_add_mmx( -;short *input, 0 -;short *dq, 1 -;unsigned char *dest, 2 -;int stride) 3 -global sym(vp8_dequant_idct_add_mmx) PRIVATE -sym(vp8_dequant_idct_add_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 4 - GET_GOT rbx - push rdi - ; end prolog - - mov rax, arg(0) ;input - mov rdx, arg(1) ;dq - - - movq mm0, [rax ] - pmullw mm0, [rdx] - - movq mm1, [rax +8] - pmullw mm1, [rdx +8] - - movq mm2, [rax+16] - pmullw mm2, [rdx+16] - - movq mm3, [rax+24] - pmullw mm3, [rdx+24] - - mov rdx, arg(2) ;dest - - pxor mm7, mm7 - - - movq [rax], mm7 - movq [rax+8], mm7 - - movq [rax+16],mm7 - movq [rax+24],mm7 - - - movsxd rdi, dword ptr arg(3) ;stride - - psubw mm0, mm2 ; b1= 0-2 - paddw mm2, mm2 ; - - movq mm5, mm1 - paddw mm2, mm0 ; a1 =0+2 - - pmulhw mm5, [GLOBAL(x_s1sqr2)]; - paddw mm5, mm1 ; ip1 * sin(pi/8) * sqrt(2) - - movq mm7, mm3 ; - pmulhw mm7, [GLOBAL(x_c1sqr2less1)]; - - paddw mm7, mm3 ; ip3 * cos(pi/8) * sqrt(2) - psubw mm7, mm5 ; c1 - - movq mm5, mm1 - movq mm4, mm3 - - pmulhw mm5, [GLOBAL(x_c1sqr2less1)] - paddw mm5, mm1 - - pmulhw mm3, [GLOBAL(x_s1sqr2)] - paddw mm3, mm4 - - paddw mm3, mm5 ; d1 - movq mm6, mm2 ; a1 - - movq mm4, mm0 ; b1 - paddw mm2, mm3 ;0 - - paddw mm4, mm7 ;1 - psubw mm0, mm7 ;2 - - psubw mm6, mm3 ;3 - - movq mm1, mm2 ; 03 02 01 00 - movq mm3, mm4 ; 23 22 21 20 - - punpcklwd mm1, mm0 ; 11 01 10 00 - punpckhwd mm2, mm0 ; 13 03 12 02 - - punpcklwd mm3, mm6 ; 31 21 30 20 - punpckhwd mm4, mm6 ; 33 23 32 22 - - movq mm0, mm1 ; 11 01 10 00 - movq mm5, mm2 ; 13 03 12 02 - - punpckldq mm0, mm3 ; 30 20 10 00 - punpckhdq mm1, mm3 ; 31 21 11 01 - - punpckldq mm2, mm4 ; 32 22 12 02 - punpckhdq mm5, mm4 ; 33 23 13 03 - - movq mm3, mm5 ; 33 23 13 03 - - psubw mm0, mm2 ; b1= 0-2 - paddw mm2, mm2 ; - - movq mm5, mm1 - paddw mm2, mm0 ; a1 =0+2 - - pmulhw mm5, [GLOBAL(x_s1sqr2)]; - paddw mm5, mm1 ; ip1 * sin(pi/8) * sqrt(2) - - movq mm7, mm3 ; - pmulhw mm7, [GLOBAL(x_c1sqr2less1)]; - - paddw mm7, mm3 ; ip3 * cos(pi/8) * sqrt(2) - psubw mm7, mm5 ; c1 - - movq mm5, mm1 - movq mm4, mm3 - - pmulhw mm5, [GLOBAL(x_c1sqr2less1)] - paddw mm5, mm1 - - pmulhw mm3, [GLOBAL(x_s1sqr2)] - paddw mm3, mm4 - - paddw mm3, mm5 ; d1 - paddw mm0, [GLOBAL(fours)] - - paddw mm2, [GLOBAL(fours)] - movq mm6, mm2 ; a1 - - movq mm4, mm0 ; b1 - paddw mm2, mm3 ;0 - - paddw mm4, mm7 ;1 - psubw mm0, mm7 ;2 - - psubw mm6, mm3 ;3 - psraw mm2, 3 - - psraw mm0, 3 - psraw mm4, 3 - - psraw mm6, 3 - - movq mm1, mm2 ; 03 02 01 00 - movq mm3, mm4 ; 23 22 21 20 - - punpcklwd mm1, mm0 ; 11 01 10 00 - punpckhwd mm2, mm0 ; 13 03 12 02 - - punpcklwd mm3, mm6 ; 31 21 30 20 - punpckhwd mm4, mm6 ; 33 23 32 22 - - movq mm0, mm1 ; 11 01 10 00 - movq mm5, mm2 ; 13 03 12 02 - - punpckldq mm0, mm3 ; 30 20 10 00 - punpckhdq mm1, mm3 ; 31 21 11 01 - - punpckldq mm2, mm4 ; 32 22 12 02 - punpckhdq mm5, mm4 ; 33 23 13 03 - - pxor mm7, mm7 - - movd mm4, [rdx] - punpcklbw mm4, mm7 - paddsw mm0, mm4 - packuswb mm0, mm7 - movd [rdx], mm0 - - movd mm4, [rdx+rdi] - punpcklbw mm4, mm7 - paddsw mm1, mm4 - packuswb mm1, mm7 - movd [rdx+rdi], mm1 - - movd mm4, [rdx+2*rdi] - punpcklbw mm4, mm7 - paddsw mm2, mm4 - packuswb mm2, mm7 - movd [rdx+rdi*2], mm2 - - add rdx, rdi - - movd mm4, [rdx+2*rdi] - punpcklbw mm4, mm7 - paddsw mm5, mm4 - packuswb mm5, mm7 - movd [rdx+rdi*2], mm5 - - ; begin epilog - pop rdi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - -SECTION_RODATA -align 16 -x_s1sqr2: - times 4 dw 0x8A8C -align 16 -x_c1sqr2less1: - times 4 dw 0x4E7B -align 16 -fours: - times 4 dw 0x0004 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/filter_x86.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/filter_x86.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/filter_x86.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/filter_x86.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2011 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vp8/common/x86/filter_x86.h" - -DECLARE_ALIGNED(16, const short, vp8_bilinear_filters_x86_4[8][8]) = -{ - { 128, 128, 128, 128, 0, 0, 0, 0 }, - { 112, 112, 112, 112, 16, 16, 16, 16 }, - { 96, 96, 96, 96, 32, 32, 32, 32 }, - { 80, 80, 80, 80, 48, 48, 48, 48 }, - { 64, 64, 64, 64, 64, 64, 64, 64 }, - { 48, 48, 48, 48, 80, 80, 80, 80 }, - { 32, 32, 32, 32, 96, 96, 96, 96 }, - { 16, 16, 16, 16, 112, 112, 112, 112 } -}; - -DECLARE_ALIGNED(16, const short, vp8_bilinear_filters_x86_8[8][16]) = -{ - { 128, 128, 128, 128, 128, 128, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 112, 112, 112, 112, 112, 112, 112, 112, 16, 16, 16, 16, 16, 16, 16, 16 }, - { 96, 96, 96, 96, 96, 96, 96, 96, 32, 32, 32, 32, 32, 32, 32, 32 }, - { 80, 80, 80, 80, 80, 80, 80, 80, 48, 48, 48, 48, 48, 48, 48, 48 }, - { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 }, - { 48, 48, 48, 48, 48, 48, 48, 48, 80, 80, 80, 80, 80, 80, 80, 80 }, - { 32, 32, 32, 32, 32, 32, 32, 32, 96, 96, 96, 96, 96, 96, 96, 96 }, - { 16, 16, 16, 16, 16, 16, 16, 16, 112, 112, 112, 112, 112, 112, 112, 112 } -}; diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/filter_x86.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/filter_x86.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/filter_x86.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/filter_x86.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2011 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP8_COMMON_X86_FILTER_X86_H_ -#define VP8_COMMON_X86_FILTER_X86_H_ - -#include "vpx_ports/mem.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* x86 assembly specific copy of vp8/common/filter.c:vp8_bilinear_filters with - * duplicated values */ - -/* duplicated 4x */ -extern DECLARE_ALIGNED(16, const short, vp8_bilinear_filters_x86_4[8][8]); - -/* duplicated 8x */ -extern DECLARE_ALIGNED(16, const short, vp8_bilinear_filters_x86_8[8][16]); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_COMMON_X86_FILTER_X86_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/idct_blk_mmx.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/idct_blk_mmx.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/idct_blk_mmx.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/idct_blk_mmx.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "vp8/common/blockd.h" -#include "vpx_mem/vpx_mem.h" - -extern void vp8_dequantize_b_impl_mmx(short *sq, short *dq, short *q); - -void vp8_dequantize_b_mmx(BLOCKD *d, short *DQC) -{ - short *sq = (short *) d->qcoeff; - short *dq = (short *) d->dqcoeff; - - vp8_dequantize_b_impl_mmx(sq, dq, DQC); -} - -void vp8_dequant_idct_add_y_block_mmx - (short *q, short *dq, - unsigned char *dst, int stride, char *eobs) -{ - int i; - - for (i = 0; i < 4; i++) - { - if (eobs[0] > 1) - vp8_dequant_idct_add_mmx (q, dq, dst, stride); - else if (eobs[0] == 1) - { - vp8_dc_only_idct_add_mmx (q[0]*dq[0], dst, stride, dst, stride); - vpx_memset(q, 0, 2 * sizeof(q[0])); - } - - if (eobs[1] > 1) - vp8_dequant_idct_add_mmx (q+16, dq, dst+4, stride); - else if (eobs[1] == 1) - { - vp8_dc_only_idct_add_mmx (q[16]*dq[0], dst+4, stride, - dst+4, stride); - vpx_memset(q + 16, 0, 2 * sizeof(q[0])); - } - - if (eobs[2] > 1) - vp8_dequant_idct_add_mmx (q+32, dq, dst+8, stride); - else if (eobs[2] == 1) - { - vp8_dc_only_idct_add_mmx (q[32]*dq[0], dst+8, stride, - dst+8, stride); - vpx_memset(q + 32, 0, 2 * sizeof(q[0])); - } - - if (eobs[3] > 1) - vp8_dequant_idct_add_mmx (q+48, dq, dst+12, stride); - else if (eobs[3] == 1) - { - vp8_dc_only_idct_add_mmx (q[48]*dq[0], dst+12, stride, - dst+12, stride); - vpx_memset(q + 48, 0, 2 * sizeof(q[0])); - } - - q += 64; - dst += 4*stride; - eobs += 4; - } -} - -void vp8_dequant_idct_add_uv_block_mmx - (short *q, short *dq, - unsigned char *dstu, unsigned char *dstv, int stride, char *eobs) -{ - int i; - - for (i = 0; i < 2; i++) - { - if (eobs[0] > 1) - vp8_dequant_idct_add_mmx (q, dq, dstu, stride); - else if (eobs[0] == 1) - { - vp8_dc_only_idct_add_mmx (q[0]*dq[0], dstu, stride, dstu, stride); - vpx_memset(q, 0, 2 * sizeof(q[0])); - } - - if (eobs[1] > 1) - vp8_dequant_idct_add_mmx (q+16, dq, dstu+4, stride); - else if (eobs[1] == 1) - { - vp8_dc_only_idct_add_mmx (q[16]*dq[0], dstu+4, stride, - dstu+4, stride); - vpx_memset(q + 16, 0, 2 * sizeof(q[0])); - } - - q += 32; - dstu += 4*stride; - eobs += 2; - } - - for (i = 0; i < 2; i++) - { - if (eobs[0] > 1) - vp8_dequant_idct_add_mmx (q, dq, dstv, stride); - else if (eobs[0] == 1) - { - vp8_dc_only_idct_add_mmx (q[0]*dq[0], dstv, stride, dstv, stride); - vpx_memset(q, 0, 2 * sizeof(q[0])); - } - - if (eobs[1] > 1) - vp8_dequant_idct_add_mmx (q+16, dq, dstv+4, stride); - else if (eobs[1] == 1) - { - vp8_dc_only_idct_add_mmx (q[16]*dq[0], dstv+4, stride, - dstv+4, stride); - vpx_memset(q + 16, 0, 2 * sizeof(q[0])); - } - - q += 32; - dstv += 4*stride; - eobs += 2; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/idct_blk_sse2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/idct_blk_sse2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/idct_blk_sse2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/idct_blk_sse2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vpx_config.h" -#include "vp8_rtcd.h" - -void vp8_idct_dequant_0_2x_sse2 - (short *q, short *dq , - unsigned char *dst, int dst_stride); -void vp8_idct_dequant_full_2x_sse2 - (short *q, short *dq , - unsigned char *dst, int dst_stride); - -void vp8_dequant_idct_add_y_block_sse2 - (short *q, short *dq, - unsigned char *dst, int stride, char *eobs) -{ - int i; - - for (i = 0; i < 4; i++) - { - if (((short *)(eobs))[0]) - { - if (((short *)(eobs))[0] & 0xfefe) - vp8_idct_dequant_full_2x_sse2 (q, dq, dst, stride); - else - vp8_idct_dequant_0_2x_sse2 (q, dq, dst, stride); - } - if (((short *)(eobs))[1]) - { - if (((short *)(eobs))[1] & 0xfefe) - vp8_idct_dequant_full_2x_sse2 (q+32, dq, dst+8, stride); - else - vp8_idct_dequant_0_2x_sse2 (q+32, dq, dst+8, stride); - } - q += 64; - dst += stride*4; - eobs += 4; - } -} - -void vp8_dequant_idct_add_uv_block_sse2 - (short *q, short *dq, - unsigned char *dstu, unsigned char *dstv, int stride, char *eobs) -{ - if (((short *)(eobs))[0]) - { - if (((short *)(eobs))[0] & 0xfefe) - vp8_idct_dequant_full_2x_sse2 (q, dq, dstu, stride); - else - vp8_idct_dequant_0_2x_sse2 (q, dq, dstu, stride); - } - q += 32; - dstu += stride*4; - - if (((short *)(eobs))[1]) - { - if (((short *)(eobs))[1] & 0xfefe) - vp8_idct_dequant_full_2x_sse2 (q, dq, dstu, stride); - else - vp8_idct_dequant_0_2x_sse2 (q, dq, dstu, stride); - } - q += 32; - - if (((short *)(eobs))[2]) - { - if (((short *)(eobs))[2] & 0xfefe) - vp8_idct_dequant_full_2x_sse2 (q, dq, dstv, stride); - else - vp8_idct_dequant_0_2x_sse2 (q, dq, dstv, stride); - } - q += 32; - dstv += stride*4; - - if (((short *)(eobs))[3]) - { - if (((short *)(eobs))[3] & 0xfefe) - vp8_idct_dequant_full_2x_sse2 (q, dq, dstv, stride); - else - vp8_idct_dequant_0_2x_sse2 (q, dq, dstv, stride); - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/idctllm_mmx.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/idctllm_mmx.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/idctllm_mmx.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/idctllm_mmx.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,295 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -; /**************************************************************************** -; * Notes: -; * -; * This implementation makes use of 16 bit fixed point version of two multiply -; * constants: -; * 1. sqrt(2) * cos (pi/8) -; * 2. sqrt(2) * sin (pi/8) -; * Because the first constant is bigger than 1, to maintain the same 16 bit -; * fixed point precision as the second one, we use a trick of -; * x * a = x + x*(a-1) -; * so -; * x * sqrt(2) * cos (pi/8) = x + x * (sqrt(2) *cos(pi/8)-1). -; * -; * For the second constant, because of the 16bit version is 35468, which -; * is bigger than 32768, in signed 16 bit multiply, it becomes a negative -; * number. -; * (x * (unsigned)35468 >> 16) = x * (signed)35468 >> 16 + x -; * -; **************************************************************************/ - - -;void vp8_short_idct4x4llm_mmx(short *input, unsigned char *pred, -;int pitch, unsigned char *dest,int stride) -global sym(vp8_short_idct4x4llm_mmx) PRIVATE -sym(vp8_short_idct4x4llm_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - mov rax, arg(0) ;input - mov rsi, arg(1) ;pred - - movq mm0, [rax ] - movq mm1, [rax+ 8] - movq mm2, [rax+16] - movq mm3, [rax+24] - -%if 0 - pxor mm7, mm7 - movq [rax], mm7 - movq [rax+8], mm7 - movq [rax+16],mm7 - movq [rax+24],mm7 -%endif - movsxd rax, dword ptr arg(2) ;pitch - mov rdx, arg(3) ;dest - movsxd rdi, dword ptr arg(4) ;stride - - - psubw mm0, mm2 ; b1= 0-2 - paddw mm2, mm2 ; - - movq mm5, mm1 - paddw mm2, mm0 ; a1 =0+2 - - pmulhw mm5, [GLOBAL(x_s1sqr2)]; - paddw mm5, mm1 ; ip1 * sin(pi/8) * sqrt(2) - - movq mm7, mm3 ; - pmulhw mm7, [GLOBAL(x_c1sqr2less1)]; - - paddw mm7, mm3 ; ip3 * cos(pi/8) * sqrt(2) - psubw mm7, mm5 ; c1 - - movq mm5, mm1 - movq mm4, mm3 - - pmulhw mm5, [GLOBAL(x_c1sqr2less1)] - paddw mm5, mm1 - - pmulhw mm3, [GLOBAL(x_s1sqr2)] - paddw mm3, mm4 - - paddw mm3, mm5 ; d1 - movq mm6, mm2 ; a1 - - movq mm4, mm0 ; b1 - paddw mm2, mm3 ;0 - - paddw mm4, mm7 ;1 - psubw mm0, mm7 ;2 - - psubw mm6, mm3 ;3 - - movq mm1, mm2 ; 03 02 01 00 - movq mm3, mm4 ; 23 22 21 20 - - punpcklwd mm1, mm0 ; 11 01 10 00 - punpckhwd mm2, mm0 ; 13 03 12 02 - - punpcklwd mm3, mm6 ; 31 21 30 20 - punpckhwd mm4, mm6 ; 33 23 32 22 - - movq mm0, mm1 ; 11 01 10 00 - movq mm5, mm2 ; 13 03 12 02 - - punpckldq mm0, mm3 ; 30 20 10 00 - punpckhdq mm1, mm3 ; 31 21 11 01 - - punpckldq mm2, mm4 ; 32 22 12 02 - punpckhdq mm5, mm4 ; 33 23 13 03 - - movq mm3, mm5 ; 33 23 13 03 - - psubw mm0, mm2 ; b1= 0-2 - paddw mm2, mm2 ; - - movq mm5, mm1 - paddw mm2, mm0 ; a1 =0+2 - - pmulhw mm5, [GLOBAL(x_s1sqr2)]; - paddw mm5, mm1 ; ip1 * sin(pi/8) * sqrt(2) - - movq mm7, mm3 ; - pmulhw mm7, [GLOBAL(x_c1sqr2less1)]; - - paddw mm7, mm3 ; ip3 * cos(pi/8) * sqrt(2) - psubw mm7, mm5 ; c1 - - movq mm5, mm1 - movq mm4, mm3 - - pmulhw mm5, [GLOBAL(x_c1sqr2less1)] - paddw mm5, mm1 - - pmulhw mm3, [GLOBAL(x_s1sqr2)] - paddw mm3, mm4 - - paddw mm3, mm5 ; d1 - paddw mm0, [GLOBAL(fours)] - - paddw mm2, [GLOBAL(fours)] - movq mm6, mm2 ; a1 - - movq mm4, mm0 ; b1 - paddw mm2, mm3 ;0 - - paddw mm4, mm7 ;1 - psubw mm0, mm7 ;2 - - psubw mm6, mm3 ;3 - psraw mm2, 3 - - psraw mm0, 3 - psraw mm4, 3 - - psraw mm6, 3 - - movq mm1, mm2 ; 03 02 01 00 - movq mm3, mm4 ; 23 22 21 20 - - punpcklwd mm1, mm0 ; 11 01 10 00 - punpckhwd mm2, mm0 ; 13 03 12 02 - - punpcklwd mm3, mm6 ; 31 21 30 20 - punpckhwd mm4, mm6 ; 33 23 32 22 - - movq mm0, mm1 ; 11 01 10 00 - movq mm5, mm2 ; 13 03 12 02 - - punpckldq mm0, mm3 ; 30 20 10 00 - punpckhdq mm1, mm3 ; 31 21 11 01 - - punpckldq mm2, mm4 ; 32 22 12 02 - punpckhdq mm5, mm4 ; 33 23 13 03 - - pxor mm7, mm7 - - movd mm4, [rsi] - punpcklbw mm4, mm7 - paddsw mm0, mm4 - packuswb mm0, mm7 - movd [rdx], mm0 - - movd mm4, [rsi+rax] - punpcklbw mm4, mm7 - paddsw mm1, mm4 - packuswb mm1, mm7 - movd [rdx+rdi], mm1 - - movd mm4, [rsi+2*rax] - punpcklbw mm4, mm7 - paddsw mm2, mm4 - packuswb mm2, mm7 - movd [rdx+rdi*2], mm2 - - add rdx, rdi - add rsi, rax - - movd mm4, [rsi+2*rax] - punpcklbw mm4, mm7 - paddsw mm5, mm4 - packuswb mm5, mm7 - movd [rdx+rdi*2], mm5 - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - -;void vp8_dc_only_idct_add_mmx( -;short input_dc, -;unsigned char *pred_ptr, -;int pred_stride, -;unsigned char *dst_ptr, -;int stride) -global sym(vp8_dc_only_idct_add_mmx) PRIVATE -sym(vp8_dc_only_idct_add_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - GET_GOT rbx - ; end prolog - - movd mm5, arg(0) ;input_dc - mov rax, arg(1) ;pred_ptr - movsxd rdx, dword ptr arg(2) ;pred_stride - - pxor mm0, mm0 - - paddw mm5, [GLOBAL(fours)] - lea rcx, [rdx + rdx*2] - - psraw mm5, 3 - - punpcklwd mm5, mm5 - - punpckldq mm5, mm5 - - movd mm1, [rax] - movd mm2, [rax+rdx] - movd mm3, [rax+2*rdx] - movd mm4, [rax+rcx] - - mov rax, arg(3) ;d -- destination - movsxd rdx, dword ptr arg(4) ;dst_stride - - punpcklbw mm1, mm0 - paddsw mm1, mm5 - packuswb mm1, mm0 ; pack and unpack to saturate - lea rcx, [rdx + rdx*2] - - punpcklbw mm2, mm0 - paddsw mm2, mm5 - packuswb mm2, mm0 ; pack and unpack to saturate - - punpcklbw mm3, mm0 - paddsw mm3, mm5 - packuswb mm3, mm0 ; pack and unpack to saturate - - punpcklbw mm4, mm0 - paddsw mm4, mm5 - packuswb mm4, mm0 ; pack and unpack to saturate - - movd [rax], mm1 - movd [rax+rdx], mm2 - movd [rax+2*rdx], mm3 - movd [rax+rcx], mm4 - - ; begin epilog - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - -SECTION_RODATA -align 16 -x_s1sqr2: - times 4 dw 0x8A8C -align 16 -x_c1sqr2less1: - times 4 dw 0x4E7B -align 16 -fours: - times 4 dw 0x0004 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/idctllm_sse2.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/idctllm_sse2.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/idctllm_sse2.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/idctllm_sse2.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,708 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -;void vp8_idct_dequant_0_2x_sse2 -; ( -; short *qcoeff - 0 -; short *dequant - 1 -; unsigned char *dst - 2 -; int dst_stride - 3 -; ) - -global sym(vp8_idct_dequant_0_2x_sse2) PRIVATE -sym(vp8_idct_dequant_0_2x_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 4 - GET_GOT rbx - ; end prolog - - mov rdx, arg(1) ; dequant - mov rax, arg(0) ; qcoeff - - movd xmm4, [rax] - movd xmm5, [rdx] - - pinsrw xmm4, [rax+32], 4 - pinsrw xmm5, [rdx], 4 - - pmullw xmm4, xmm5 - - ; Zero out xmm5, for use unpacking - pxor xmm5, xmm5 - - ; clear coeffs - movd [rax], xmm5 - movd [rax+32], xmm5 -;pshufb - mov rax, arg(2) ; dst - movsxd rdx, dword ptr arg(3) ; dst_stride - - pshuflw xmm4, xmm4, 00000000b - pshufhw xmm4, xmm4, 00000000b - - lea rcx, [rdx + rdx*2] - paddw xmm4, [GLOBAL(fours)] - - psraw xmm4, 3 - - movq xmm0, [rax] - movq xmm1, [rax+rdx] - movq xmm2, [rax+2*rdx] - movq xmm3, [rax+rcx] - - punpcklbw xmm0, xmm5 - punpcklbw xmm1, xmm5 - punpcklbw xmm2, xmm5 - punpcklbw xmm3, xmm5 - - - ; Add to predict buffer - paddw xmm0, xmm4 - paddw xmm1, xmm4 - paddw xmm2, xmm4 - paddw xmm3, xmm4 - - ; pack up before storing - packuswb xmm0, xmm5 - packuswb xmm1, xmm5 - packuswb xmm2, xmm5 - packuswb xmm3, xmm5 - - ; store blocks back out - movq [rax], xmm0 - movq [rax + rdx], xmm1 - - lea rax, [rax + 2*rdx] - - movq [rax], xmm2 - movq [rax + rdx], xmm3 - - ; begin epilog - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - -;void vp8_idct_dequant_full_2x_sse2 -; ( -; short *qcoeff - 0 -; short *dequant - 1 -; unsigned char *dst - 2 -; int dst_stride - 3 -; ) -global sym(vp8_idct_dequant_full_2x_sse2) PRIVATE -sym(vp8_idct_dequant_full_2x_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 4 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - ; special case when 2 blocks have 0 or 1 coeffs - ; dc is set as first coeff, so no need to load qcoeff - mov rax, arg(0) ; qcoeff - mov rdx, arg(1) ; dequant - mov rdi, arg(2) ; dst - - - ; Zero out xmm7, for use unpacking - pxor xmm7, xmm7 - - - ; note the transpose of xmm1 and xmm2, necessary for shuffle - ; to spit out sensicle data - movdqa xmm0, [rax] - movdqa xmm2, [rax+16] - movdqa xmm1, [rax+32] - movdqa xmm3, [rax+48] - - ; Clear out coeffs - movdqa [rax], xmm7 - movdqa [rax+16], xmm7 - movdqa [rax+32], xmm7 - movdqa [rax+48], xmm7 - - ; dequantize qcoeff buffer - pmullw xmm0, [rdx] - pmullw xmm2, [rdx+16] - pmullw xmm1, [rdx] - pmullw xmm3, [rdx+16] - movsxd rdx, dword ptr arg(3) ; dst_stride - - ; repack so block 0 row x and block 1 row x are together - movdqa xmm4, xmm0 - punpckldq xmm0, xmm1 - punpckhdq xmm4, xmm1 - - pshufd xmm0, xmm0, 11011000b - pshufd xmm1, xmm4, 11011000b - - movdqa xmm4, xmm2 - punpckldq xmm2, xmm3 - punpckhdq xmm4, xmm3 - - pshufd xmm2, xmm2, 11011000b - pshufd xmm3, xmm4, 11011000b - - ; first pass - psubw xmm0, xmm2 ; b1 = 0-2 - paddw xmm2, xmm2 ; - - movdqa xmm5, xmm1 - paddw xmm2, xmm0 ; a1 = 0+2 - - pmulhw xmm5, [GLOBAL(x_s1sqr2)] - lea rcx, [rdx + rdx*2] ;dst_stride * 3 - paddw xmm5, xmm1 ; ip1 * sin(pi/8) * sqrt(2) - - movdqa xmm7, xmm3 - pmulhw xmm7, [GLOBAL(x_c1sqr2less1)] - - paddw xmm7, xmm3 ; ip3 * cos(pi/8) * sqrt(2) - psubw xmm7, xmm5 ; c1 - - movdqa xmm5, xmm1 - movdqa xmm4, xmm3 - - pmulhw xmm5, [GLOBAL(x_c1sqr2less1)] - paddw xmm5, xmm1 - - pmulhw xmm3, [GLOBAL(x_s1sqr2)] - paddw xmm3, xmm4 - - paddw xmm3, xmm5 ; d1 - movdqa xmm6, xmm2 ; a1 - - movdqa xmm4, xmm0 ; b1 - paddw xmm2, xmm3 ;0 - - paddw xmm4, xmm7 ;1 - psubw xmm0, xmm7 ;2 - - psubw xmm6, xmm3 ;3 - - ; transpose for the second pass - movdqa xmm7, xmm2 ; 103 102 101 100 003 002 001 000 - punpcklwd xmm2, xmm0 ; 007 003 006 002 005 001 004 000 - punpckhwd xmm7, xmm0 ; 107 103 106 102 105 101 104 100 - - movdqa xmm5, xmm4 ; 111 110 109 108 011 010 009 008 - punpcklwd xmm4, xmm6 ; 015 011 014 010 013 009 012 008 - punpckhwd xmm5, xmm6 ; 115 111 114 110 113 109 112 108 - - - movdqa xmm1, xmm2 ; 007 003 006 002 005 001 004 000 - punpckldq xmm2, xmm4 ; 013 009 005 001 012 008 004 000 - punpckhdq xmm1, xmm4 ; 015 011 007 003 014 010 006 002 - - movdqa xmm6, xmm7 ; 107 103 106 102 105 101 104 100 - punpckldq xmm7, xmm5 ; 113 109 105 101 112 108 104 100 - punpckhdq xmm6, xmm5 ; 115 111 107 103 114 110 106 102 - - - movdqa xmm5, xmm2 ; 013 009 005 001 012 008 004 000 - punpckldq xmm2, xmm7 ; 112 108 012 008 104 100 004 000 - punpckhdq xmm5, xmm7 ; 113 109 013 009 105 101 005 001 - - movdqa xmm7, xmm1 ; 015 011 007 003 014 010 006 002 - punpckldq xmm1, xmm6 ; 114 110 014 010 106 102 006 002 - punpckhdq xmm7, xmm6 ; 115 111 015 011 107 103 007 003 - - pshufd xmm0, xmm2, 11011000b - pshufd xmm2, xmm1, 11011000b - - pshufd xmm1, xmm5, 11011000b - pshufd xmm3, xmm7, 11011000b - - ; second pass - psubw xmm0, xmm2 ; b1 = 0-2 - paddw xmm2, xmm2 - - movdqa xmm5, xmm1 - paddw xmm2, xmm0 ; a1 = 0+2 - - pmulhw xmm5, [GLOBAL(x_s1sqr2)] - paddw xmm5, xmm1 ; ip1 * sin(pi/8) * sqrt(2) - - movdqa xmm7, xmm3 - pmulhw xmm7, [GLOBAL(x_c1sqr2less1)] - - paddw xmm7, xmm3 ; ip3 * cos(pi/8) * sqrt(2) - psubw xmm7, xmm5 ; c1 - - movdqa xmm5, xmm1 - movdqa xmm4, xmm3 - - pmulhw xmm5, [GLOBAL(x_c1sqr2less1)] - paddw xmm5, xmm1 - - pmulhw xmm3, [GLOBAL(x_s1sqr2)] - paddw xmm3, xmm4 - - paddw xmm3, xmm5 ; d1 - paddw xmm0, [GLOBAL(fours)] - - paddw xmm2, [GLOBAL(fours)] - movdqa xmm6, xmm2 ; a1 - - movdqa xmm4, xmm0 ; b1 - paddw xmm2, xmm3 ;0 - - paddw xmm4, xmm7 ;1 - psubw xmm0, xmm7 ;2 - - psubw xmm6, xmm3 ;3 - psraw xmm2, 3 - - psraw xmm0, 3 - psraw xmm4, 3 - - psraw xmm6, 3 - - ; transpose to save - movdqa xmm7, xmm2 ; 103 102 101 100 003 002 001 000 - punpcklwd xmm2, xmm0 ; 007 003 006 002 005 001 004 000 - punpckhwd xmm7, xmm0 ; 107 103 106 102 105 101 104 100 - - movdqa xmm5, xmm4 ; 111 110 109 108 011 010 009 008 - punpcklwd xmm4, xmm6 ; 015 011 014 010 013 009 012 008 - punpckhwd xmm5, xmm6 ; 115 111 114 110 113 109 112 108 - - - movdqa xmm1, xmm2 ; 007 003 006 002 005 001 004 000 - punpckldq xmm2, xmm4 ; 013 009 005 001 012 008 004 000 - punpckhdq xmm1, xmm4 ; 015 011 007 003 014 010 006 002 - - movdqa xmm6, xmm7 ; 107 103 106 102 105 101 104 100 - punpckldq xmm7, xmm5 ; 113 109 105 101 112 108 104 100 - punpckhdq xmm6, xmm5 ; 115 111 107 103 114 110 106 102 - - - movdqa xmm5, xmm2 ; 013 009 005 001 012 008 004 000 - punpckldq xmm2, xmm7 ; 112 108 012 008 104 100 004 000 - punpckhdq xmm5, xmm7 ; 113 109 013 009 105 101 005 001 - - movdqa xmm7, xmm1 ; 015 011 007 003 014 010 006 002 - punpckldq xmm1, xmm6 ; 114 110 014 010 106 102 006 002 - punpckhdq xmm7, xmm6 ; 115 111 015 011 107 103 007 003 - - pshufd xmm0, xmm2, 11011000b - pshufd xmm2, xmm1, 11011000b - - pshufd xmm1, xmm5, 11011000b - pshufd xmm3, xmm7, 11011000b - - pxor xmm7, xmm7 - - ; Load up predict blocks - movq xmm4, [rdi] - movq xmm5, [rdi+rdx] - - punpcklbw xmm4, xmm7 - punpcklbw xmm5, xmm7 - - paddw xmm0, xmm4 - paddw xmm1, xmm5 - - movq xmm4, [rdi+2*rdx] - movq xmm5, [rdi+rcx] - - punpcklbw xmm4, xmm7 - punpcklbw xmm5, xmm7 - - paddw xmm2, xmm4 - paddw xmm3, xmm5 - -.finish: - - ; pack up before storing - packuswb xmm0, xmm7 - packuswb xmm1, xmm7 - packuswb xmm2, xmm7 - packuswb xmm3, xmm7 - - ; store blocks back out - movq [rdi], xmm0 - movq [rdi + rdx], xmm1 - movq [rdi + rdx*2], xmm2 - movq [rdi + rcx], xmm3 - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -;void vp8_idct_dequant_dc_0_2x_sse2 -; ( -; short *qcoeff - 0 -; short *dequant - 1 -; unsigned char *dst - 2 -; int dst_stride - 3 -; short *dc - 4 -; ) -global sym(vp8_idct_dequant_dc_0_2x_sse2) PRIVATE -sym(vp8_idct_dequant_dc_0_2x_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - GET_GOT rbx - push rdi - ; end prolog - - ; special case when 2 blocks have 0 or 1 coeffs - ; dc is set as first coeff, so no need to load qcoeff - mov rax, arg(0) ; qcoeff - - mov rdi, arg(2) ; dst - mov rdx, arg(4) ; dc - - ; Zero out xmm5, for use unpacking - pxor xmm5, xmm5 - - ; load up 2 dc words here == 2*16 = doubleword - movd xmm4, [rdx] - - movsxd rdx, dword ptr arg(3) ; dst_stride - lea rcx, [rdx + rdx*2] - ; Load up predict blocks - movq xmm0, [rdi] - movq xmm1, [rdi+rdx*1] - movq xmm2, [rdi+rdx*2] - movq xmm3, [rdi+rcx] - - ; Duplicate and expand dc across - punpcklwd xmm4, xmm4 - punpckldq xmm4, xmm4 - - ; Rounding to dequant and downshift - paddw xmm4, [GLOBAL(fours)] - psraw xmm4, 3 - - ; Predict buffer needs to be expanded from bytes to words - punpcklbw xmm0, xmm5 - punpcklbw xmm1, xmm5 - punpcklbw xmm2, xmm5 - punpcklbw xmm3, xmm5 - - ; Add to predict buffer - paddw xmm0, xmm4 - paddw xmm1, xmm4 - paddw xmm2, xmm4 - paddw xmm3, xmm4 - - ; pack up before storing - packuswb xmm0, xmm5 - packuswb xmm1, xmm5 - packuswb xmm2, xmm5 - packuswb xmm3, xmm5 - - ; store blocks back out - movq [rdi], xmm0 - movq [rdi + rdx], xmm1 - movq [rdi + rdx*2], xmm2 - movq [rdi + rcx], xmm3 - - ; begin epilog - pop rdi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret -;void vp8_idct_dequant_dc_full_2x_sse2 -; ( -; short *qcoeff - 0 -; short *dequant - 1 -; unsigned char *dst - 2 -; int dst_stride - 3 -; short *dc - 4 -; ) -global sym(vp8_idct_dequant_dc_full_2x_sse2) PRIVATE -sym(vp8_idct_dequant_dc_full_2x_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - SAVE_XMM 7 - GET_GOT rbx - push rdi - ; end prolog - - ; special case when 2 blocks have 0 or 1 coeffs - ; dc is set as first coeff, so no need to load qcoeff - mov rax, arg(0) ; qcoeff - mov rdx, arg(1) ; dequant - - mov rdi, arg(2) ; dst - - ; Zero out xmm7, for use unpacking - pxor xmm7, xmm7 - - - ; note the transpose of xmm1 and xmm2, necessary for shuffle - ; to spit out sensicle data - movdqa xmm0, [rax] - movdqa xmm2, [rax+16] - movdqa xmm1, [rax+32] - movdqa xmm3, [rax+48] - - ; Clear out coeffs - movdqa [rax], xmm7 - movdqa [rax+16], xmm7 - movdqa [rax+32], xmm7 - movdqa [rax+48], xmm7 - - ; dequantize qcoeff buffer - pmullw xmm0, [rdx] - pmullw xmm2, [rdx+16] - pmullw xmm1, [rdx] - pmullw xmm3, [rdx+16] - - ; DC component - mov rdx, arg(4) - - ; repack so block 0 row x and block 1 row x are together - movdqa xmm4, xmm0 - punpckldq xmm0, xmm1 - punpckhdq xmm4, xmm1 - - pshufd xmm0, xmm0, 11011000b - pshufd xmm1, xmm4, 11011000b - - movdqa xmm4, xmm2 - punpckldq xmm2, xmm3 - punpckhdq xmm4, xmm3 - - pshufd xmm2, xmm2, 11011000b - pshufd xmm3, xmm4, 11011000b - - ; insert DC component - pinsrw xmm0, [rdx], 0 - pinsrw xmm0, [rdx+2], 4 - - ; first pass - psubw xmm0, xmm2 ; b1 = 0-2 - paddw xmm2, xmm2 ; - - movdqa xmm5, xmm1 - paddw xmm2, xmm0 ; a1 = 0+2 - - pmulhw xmm5, [GLOBAL(x_s1sqr2)] - paddw xmm5, xmm1 ; ip1 * sin(pi/8) * sqrt(2) - - movdqa xmm7, xmm3 - pmulhw xmm7, [GLOBAL(x_c1sqr2less1)] - - paddw xmm7, xmm3 ; ip3 * cos(pi/8) * sqrt(2) - psubw xmm7, xmm5 ; c1 - - movdqa xmm5, xmm1 - movdqa xmm4, xmm3 - - pmulhw xmm5, [GLOBAL(x_c1sqr2less1)] - paddw xmm5, xmm1 - - pmulhw xmm3, [GLOBAL(x_s1sqr2)] - paddw xmm3, xmm4 - - paddw xmm3, xmm5 ; d1 - movdqa xmm6, xmm2 ; a1 - - movdqa xmm4, xmm0 ; b1 - paddw xmm2, xmm3 ;0 - - paddw xmm4, xmm7 ;1 - psubw xmm0, xmm7 ;2 - - psubw xmm6, xmm3 ;3 - - ; transpose for the second pass - movdqa xmm7, xmm2 ; 103 102 101 100 003 002 001 000 - punpcklwd xmm2, xmm0 ; 007 003 006 002 005 001 004 000 - punpckhwd xmm7, xmm0 ; 107 103 106 102 105 101 104 100 - - movdqa xmm5, xmm4 ; 111 110 109 108 011 010 009 008 - punpcklwd xmm4, xmm6 ; 015 011 014 010 013 009 012 008 - punpckhwd xmm5, xmm6 ; 115 111 114 110 113 109 112 108 - - - movdqa xmm1, xmm2 ; 007 003 006 002 005 001 004 000 - punpckldq xmm2, xmm4 ; 013 009 005 001 012 008 004 000 - punpckhdq xmm1, xmm4 ; 015 011 007 003 014 010 006 002 - - movdqa xmm6, xmm7 ; 107 103 106 102 105 101 104 100 - punpckldq xmm7, xmm5 ; 113 109 105 101 112 108 104 100 - punpckhdq xmm6, xmm5 ; 115 111 107 103 114 110 106 102 - - - movdqa xmm5, xmm2 ; 013 009 005 001 012 008 004 000 - punpckldq xmm2, xmm7 ; 112 108 012 008 104 100 004 000 - punpckhdq xmm5, xmm7 ; 113 109 013 009 105 101 005 001 - - movdqa xmm7, xmm1 ; 015 011 007 003 014 010 006 002 - punpckldq xmm1, xmm6 ; 114 110 014 010 106 102 006 002 - punpckhdq xmm7, xmm6 ; 115 111 015 011 107 103 007 003 - - pshufd xmm0, xmm2, 11011000b - pshufd xmm2, xmm1, 11011000b - - pshufd xmm1, xmm5, 11011000b - pshufd xmm3, xmm7, 11011000b - - ; second pass - psubw xmm0, xmm2 ; b1 = 0-2 - paddw xmm2, xmm2 - - movdqa xmm5, xmm1 - paddw xmm2, xmm0 ; a1 = 0+2 - - pmulhw xmm5, [GLOBAL(x_s1sqr2)] - paddw xmm5, xmm1 ; ip1 * sin(pi/8) * sqrt(2) - - movdqa xmm7, xmm3 - pmulhw xmm7, [GLOBAL(x_c1sqr2less1)] - - paddw xmm7, xmm3 ; ip3 * cos(pi/8) * sqrt(2) - psubw xmm7, xmm5 ; c1 - - movdqa xmm5, xmm1 - movdqa xmm4, xmm3 - - pmulhw xmm5, [GLOBAL(x_c1sqr2less1)] - paddw xmm5, xmm1 - - pmulhw xmm3, [GLOBAL(x_s1sqr2)] - paddw xmm3, xmm4 - - paddw xmm3, xmm5 ; d1 - paddw xmm0, [GLOBAL(fours)] - - paddw xmm2, [GLOBAL(fours)] - movdqa xmm6, xmm2 ; a1 - - movdqa xmm4, xmm0 ; b1 - paddw xmm2, xmm3 ;0 - - paddw xmm4, xmm7 ;1 - psubw xmm0, xmm7 ;2 - - psubw xmm6, xmm3 ;3 - psraw xmm2, 3 - - psraw xmm0, 3 - psraw xmm4, 3 - - psraw xmm6, 3 - - ; transpose to save - movdqa xmm7, xmm2 ; 103 102 101 100 003 002 001 000 - punpcklwd xmm2, xmm0 ; 007 003 006 002 005 001 004 000 - punpckhwd xmm7, xmm0 ; 107 103 106 102 105 101 104 100 - - movdqa xmm5, xmm4 ; 111 110 109 108 011 010 009 008 - punpcklwd xmm4, xmm6 ; 015 011 014 010 013 009 012 008 - punpckhwd xmm5, xmm6 ; 115 111 114 110 113 109 112 108 - - - movdqa xmm1, xmm2 ; 007 003 006 002 005 001 004 000 - punpckldq xmm2, xmm4 ; 013 009 005 001 012 008 004 000 - punpckhdq xmm1, xmm4 ; 015 011 007 003 014 010 006 002 - - movdqa xmm6, xmm7 ; 107 103 106 102 105 101 104 100 - punpckldq xmm7, xmm5 ; 113 109 105 101 112 108 104 100 - punpckhdq xmm6, xmm5 ; 115 111 107 103 114 110 106 102 - - - movdqa xmm5, xmm2 ; 013 009 005 001 012 008 004 000 - punpckldq xmm2, xmm7 ; 112 108 012 008 104 100 004 000 - punpckhdq xmm5, xmm7 ; 113 109 013 009 105 101 005 001 - - movdqa xmm7, xmm1 ; 015 011 007 003 014 010 006 002 - punpckldq xmm1, xmm6 ; 114 110 014 010 106 102 006 002 - punpckhdq xmm7, xmm6 ; 115 111 015 011 107 103 007 003 - - pshufd xmm0, xmm2, 11011000b - pshufd xmm2, xmm1, 11011000b - - pshufd xmm1, xmm5, 11011000b - pshufd xmm3, xmm7, 11011000b - - pxor xmm7, xmm7 - - ; Load up predict blocks - movsxd rdx, dword ptr arg(3) ; dst_stride - movq xmm4, [rdi] - movq xmm5, [rdi+rdx] - lea rcx, [rdx + rdx*2] - - punpcklbw xmm4, xmm7 - punpcklbw xmm5, xmm7 - - paddw xmm0, xmm4 - paddw xmm1, xmm5 - - movq xmm4, [rdi+rdx*2] - movq xmm5, [rdi+rcx] - - punpcklbw xmm4, xmm7 - punpcklbw xmm5, xmm7 - - paddw xmm2, xmm4 - paddw xmm3, xmm5 - -.finish: - - ; pack up before storing - packuswb xmm0, xmm7 - packuswb xmm1, xmm7 - packuswb xmm2, xmm7 - packuswb xmm3, xmm7 - - ; Load destination stride before writing out, - ; doesn't need to persist - movsxd rdx, dword ptr arg(3) ; dst_stride - - ; store blocks back out - movq [rdi], xmm0 - movq [rdi + rdx], xmm1 - - lea rdi, [rdi + 2*rdx] - - movq [rdi], xmm2 - movq [rdi + rdx], xmm3 - - - ; begin epilog - pop rdi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -SECTION_RODATA -align 16 -fours: - times 8 dw 0x0004 -align 16 -x_s1sqr2: - times 8 dw 0x8A8C -align 16 -x_c1sqr2less1: - times 8 dw 0x4E7B diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/iwalsh_mmx.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/iwalsh_mmx.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/iwalsh_mmx.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/iwalsh_mmx.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,140 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -;void vp8_short_inv_walsh4x4_mmx(short *input, short *output) -global sym(vp8_short_inv_walsh4x4_mmx) PRIVATE -sym(vp8_short_inv_walsh4x4_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 2 - ; end prolog - - mov rdx, arg(0) - mov rax, 30003h - - movq mm0, [rdx + 0] ;ip[0] - movq mm1, [rdx + 8] ;ip[4] - movq mm7, rax - - movq mm2, [rdx + 16] ;ip[8] - movq mm3, [rdx + 24] ;ip[12] - punpcklwd mm7, mm7 ;0003000300030003h - mov rdx, arg(1) - - movq mm4, mm0 - movq mm5, mm1 - - paddw mm4, mm3 ;ip[0] + ip[12] aka al - paddw mm5, mm2 ;ip[4] + ip[8] aka bl - - movq mm6, mm4 ;temp al - paddw mm4, mm5 ;al + bl - psubw mm6, mm5 ;al - bl - - psubw mm0, mm3 ;ip[0] - ip[12] aka d1 - psubw mm1, mm2 ;ip[4] - ip[8] aka c1 - - movq mm5, mm0 ;temp dl - paddw mm0, mm1 ;dl + cl - psubw mm5, mm1 ;dl - cl - - ; 03 02 01 00 - ; 13 12 11 10 - ; 23 22 21 20 - ; 33 32 31 30 - - movq mm3, mm4 ; 03 02 01 00 - punpcklwd mm4, mm0 ; 11 01 10 00 - punpckhwd mm3, mm0 ; 13 03 12 02 - - movq mm1, mm6 ; 23 22 21 20 - punpcklwd mm6, mm5 ; 31 21 30 20 - punpckhwd mm1, mm5 ; 33 23 32 22 - - movq mm0, mm4 ; 11 01 10 00 - movq mm2, mm3 ; 13 03 12 02 - - punpckldq mm0, mm6 ; 30 20 10 00 aka ip[0] - punpckhdq mm4, mm6 ; 31 21 11 01 aka ip[4] - - punpckldq mm2, mm1 ; 32 22 12 02 aka ip[8] - punpckhdq mm3, mm1 ; 33 23 13 03 aka ip[12] -;~~~~~~~~~~~~~~~~~~~~~ - movq mm1, mm0 - movq mm5, mm4 - paddw mm1, mm3 ;ip[0] + ip[12] aka al - paddw mm5, mm2 ;ip[4] + ip[8] aka bl - - movq mm6, mm1 ;temp al - paddw mm1, mm5 ;al + bl - psubw mm6, mm5 ;al - bl - paddw mm1, mm7 - paddw mm6, mm7 - psraw mm1, 3 - psraw mm6, 3 - - psubw mm0, mm3 ;ip[0] - ip[12] aka d1 - psubw mm4, mm2 ;ip[4] - ip[8] aka c1 - - movq mm5, mm0 ;temp dl - paddw mm0, mm4 ;dl + cl - psubw mm5, mm4 ;dl - cl - paddw mm0, mm7 - paddw mm5, mm7 - psraw mm0, 3 - psraw mm5, 3 -;~~~~~~~~~~~~~~~~~~~~~ - - movd eax, mm1 - movd ecx, mm0 - psrlq mm0, 32 - psrlq mm1, 32 - mov word ptr[rdx+32*0], ax - mov word ptr[rdx+32*1], cx - shr eax, 16 - shr ecx, 16 - mov word ptr[rdx+32*4], ax - mov word ptr[rdx+32*5], cx - movd eax, mm1 - movd ecx, mm0 - mov word ptr[rdx+32*8], ax - mov word ptr[rdx+32*9], cx - shr eax, 16 - shr ecx, 16 - mov word ptr[rdx+32*12], ax - mov word ptr[rdx+32*13], cx - - movd eax, mm6 - movd ecx, mm5 - psrlq mm5, 32 - psrlq mm6, 32 - mov word ptr[rdx+32*2], ax - mov word ptr[rdx+32*3], cx - shr eax, 16 - shr ecx, 16 - mov word ptr[rdx+32*6], ax - mov word ptr[rdx+32*7], cx - movd eax, mm6 - movd ecx, mm5 - mov word ptr[rdx+32*10], ax - mov word ptr[rdx+32*11], cx - shr eax, 16 - shr ecx, 16 - mov word ptr[rdx+32*14], ax - mov word ptr[rdx+32*15], cx - - ; begin epilog - UNSHADOW_ARGS - pop rbp - ret - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/iwalsh_sse2.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/iwalsh_sse2.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/iwalsh_sse2.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/iwalsh_sse2.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -;void vp8_short_inv_walsh4x4_sse2(short *input, short *output) -global sym(vp8_short_inv_walsh4x4_sse2) PRIVATE -sym(vp8_short_inv_walsh4x4_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 2 - ; end prolog - - mov rcx, arg(0) - mov rdx, arg(1) - mov rax, 30003h - - movdqa xmm0, [rcx + 0] ;ip[4] ip[0] - movdqa xmm1, [rcx + 16] ;ip[12] ip[8] - - - pshufd xmm2, xmm1, 4eh ;ip[8] ip[12] - movdqa xmm3, xmm0 ;ip[4] ip[0] - - paddw xmm0, xmm2 ;ip[4]+ip[8] ip[0]+ip[12] aka b1 a1 - psubw xmm3, xmm2 ;ip[4]-ip[8] ip[0]-ip[12] aka c1 d1 - - movdqa xmm4, xmm0 - punpcklqdq xmm0, xmm3 ;d1 a1 - punpckhqdq xmm4, xmm3 ;c1 b1 - - movdqa xmm1, xmm4 ;c1 b1 - paddw xmm4, xmm0 ;dl+cl a1+b1 aka op[4] op[0] - psubw xmm0, xmm1 ;d1-c1 a1-b1 aka op[12] op[8] - - ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ; 13 12 11 10 03 02 01 00 - ; - ; 33 32 31 30 23 22 21 20 - ; - movdqa xmm3, xmm4 ; 13 12 11 10 03 02 01 00 - punpcklwd xmm4, xmm0 ; 23 03 22 02 21 01 20 00 - punpckhwd xmm3, xmm0 ; 33 13 32 12 31 11 30 10 - movdqa xmm1, xmm4 ; 23 03 22 02 21 01 20 00 - punpcklwd xmm4, xmm3 ; 31 21 11 01 30 20 10 00 - punpckhwd xmm1, xmm3 ; 33 23 13 03 32 22 12 02 - ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - movd xmm0, eax - pshufd xmm2, xmm1, 4eh ;ip[8] ip[12] - movdqa xmm3, xmm4 ;ip[4] ip[0] - - pshufd xmm0, xmm0, 0 ;03 03 03 03 03 03 03 03 - - paddw xmm4, xmm2 ;ip[4]+ip[8] ip[0]+ip[12] aka b1 a1 - psubw xmm3, xmm2 ;ip[4]-ip[8] ip[0]-ip[12] aka c1 d1 - - movdqa xmm5, xmm4 - punpcklqdq xmm4, xmm3 ;d1 a1 - punpckhqdq xmm5, xmm3 ;c1 b1 - - movdqa xmm1, xmm5 ;c1 b1 - paddw xmm5, xmm4 ;dl+cl a1+b1 aka op[4] op[0] - psubw xmm4, xmm1 ;d1-c1 a1-b1 aka op[12] op[8] - - paddw xmm5, xmm0 - paddw xmm4, xmm0 - psraw xmm5, 3 - psraw xmm4, 3 - - movd eax, xmm5 - movd ecx, xmm4 - psrldq xmm5, 4 - psrldq xmm4, 4 - mov word ptr[rdx+32*0], ax - mov word ptr[rdx+32*2], cx - shr eax, 16 - shr ecx, 16 - mov word ptr[rdx+32*4], ax - mov word ptr[rdx+32*6], cx - movd eax, xmm5 - movd ecx, xmm4 - psrldq xmm5, 4 - psrldq xmm4, 4 - mov word ptr[rdx+32*8], ax - mov word ptr[rdx+32*10], cx - shr eax, 16 - shr ecx, 16 - mov word ptr[rdx+32*12], ax - mov word ptr[rdx+32*14], cx - - movd eax, xmm5 - movd ecx, xmm4 - psrldq xmm5, 4 - psrldq xmm4, 4 - mov word ptr[rdx+32*1], ax - mov word ptr[rdx+32*3], cx - shr eax, 16 - shr ecx, 16 - mov word ptr[rdx+32*5], ax - mov word ptr[rdx+32*7], cx - movd eax, xmm5 - movd ecx, xmm4 - mov word ptr[rdx+32*9], ax - mov word ptr[rdx+32*11], cx - shr eax, 16 - shr ecx, 16 - mov word ptr[rdx+32*13], ax - mov word ptr[rdx+32*15], cx - - ; begin epilog - UNSHADOW_ARGS - pop rbp - ret diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/loopfilter_block_sse2_x86_64.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/loopfilter_block_sse2_x86_64.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/loopfilter_block_sse2_x86_64.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/loopfilter_block_sse2_x86_64.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,815 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -%macro LF_ABS 2 - ; %1 value not preserved - ; %2 value preserved - ; output in %1 - movdqa scratch1, %2 ; v2 - - psubusb scratch1, %1 ; v2 - v1 - psubusb %1, %2 ; v1 - v2 - por %1, scratch1 ; abs(v2 - v1) -%endmacro - -%macro LF_FILTER_HEV_MASK 8-9 - - LF_ABS %1, %2 ; abs(p3 - p2) - LF_ABS %2, %3 ; abs(p2 - p1) - pmaxub %1, %2 ; accumulate mask -%if %0 == 8 - movdqa scratch2, %3 ; save p1 - LF_ABS scratch2, %4 ; abs(p1 - p0) -%endif - LF_ABS %4, %5 ; abs(p0 - q0) - LF_ABS %5, %6 ; abs(q0 - q1) -%if %0 == 8 - pmaxub %5, scratch2 ; accumulate hev -%else - pmaxub %5, %9 -%endif - pmaxub %1, %5 ; accumulate mask - - LF_ABS %3, %6 ; abs(p1 - q1) - LF_ABS %6, %7 ; abs(q1 - q2) - pmaxub %1, %6 ; accumulate mask - LF_ABS %7, %8 ; abs(q2 - q3) - pmaxub %1, %7 ; accumulate mask - - paddusb %4, %4 ; 2 * abs(p0 - q0) - pand %3, [GLOBAL(tfe)] - psrlw %3, 1 ; abs(p1 - q1) / 2 - paddusb %4, %3 ; abs(p0 - q0) * 2 + abs(p1 - q1) / 2 - - psubusb %1, [limit] - psubusb %4, [blimit] - por %1, %4 - pcmpeqb %1, zero ; mask - - psubusb %5, [thresh] - pcmpeqb %5, zero ; ~hev -%endmacro - -%macro LF_FILTER 6 - ; %1-%4: p1-q1 - ; %5: mask - ; %6: hev - - movdqa scratch2, %6 ; save hev - - pxor %1, [GLOBAL(t80)] ; ps1 - pxor %4, [GLOBAL(t80)] ; qs1 - movdqa scratch1, %1 - psubsb scratch1, %4 ; signed_char_clamp(ps1 - qs1) - pandn scratch2, scratch1 ; vp8_filter &= hev - - pxor %2, [GLOBAL(t80)] ; ps0 - pxor %3, [GLOBAL(t80)] ; qs0 - movdqa scratch1, %3 - psubsb scratch1, %2 ; qs0 - ps0 - paddsb scratch2, scratch1 ; vp8_filter += (qs0 - ps0) - paddsb scratch2, scratch1 ; vp8_filter += (qs0 - ps0) - paddsb scratch2, scratch1 ; vp8_filter += (qs0 - ps0) - pand %5, scratch2 ; &= mask - - movdqa scratch2, %5 - paddsb %5, [GLOBAL(t4)] ; Filter1 - paddsb scratch2, [GLOBAL(t3)] ; Filter2 - - ; Filter1 >> 3 - movdqa scratch1, zero - pcmpgtb scratch1, %5 - psrlw %5, 3 - pand scratch1, [GLOBAL(te0)] - pand %5, [GLOBAL(t1f)] - por %5, scratch1 - - psubsb %3, %5 ; qs0 - Filter1 - pxor %3, [GLOBAL(t80)] - - ; Filter2 >> 3 - movdqa scratch1, zero - pcmpgtb scratch1, scratch2 - psrlw scratch2, 3 - pand scratch1, [GLOBAL(te0)] - pand scratch2, [GLOBAL(t1f)] - por scratch2, scratch1 - - paddsb %2, scratch2 ; ps0 + Filter2 - pxor %2, [GLOBAL(t80)] - - ; outer tap adjustments - paddsb %5, [GLOBAL(t1)] - movdqa scratch1, zero - pcmpgtb scratch1, %5 - psrlw %5, 1 - pand scratch1, [GLOBAL(t80)] - pand %5, [GLOBAL(t7f)] - por %5, scratch1 - pand %5, %6 ; vp8_filter &= ~hev - - psubsb %4, %5 ; qs1 - vp8_filter - pxor %4, [GLOBAL(t80)] - - paddsb %1, %5 ; ps1 + vp8_filter - pxor %1, [GLOBAL(t80)] -%endmacro - -;void vp8_loop_filter_bh_y_sse2 -;( -; unsigned char *src_ptr, -; int src_pixel_step, -; const char *blimit, -; const char *limit, -; const char *thresh -;) -global sym(vp8_loop_filter_bh_y_sse2) PRIVATE -sym(vp8_loop_filter_bh_y_sse2): - -%if LIBVPX_YASM_WIN64 - %define src rcx ; src_ptr - %define stride rdx ; src_pixel_step - %define blimit r8 - %define limit r9 - %define thresh r10 - - %define spp rax - %define stride3 r11 - %define stride5 r12 - %define stride7 r13 - - push rbp - mov rbp, rsp - SAVE_XMM 11 - push r12 - push r13 - mov thresh, arg(4) -%else - %define src rdi ; src_ptr - %define stride rsi ; src_pixel_step - %define blimit rdx - %define limit rcx - %define thresh r8 - - %define spp rax - %define stride3 r9 - %define stride5 r10 - %define stride7 r11 -%endif - - %define scratch1 xmm5 - %define scratch2 xmm6 - %define zero xmm7 - - %define i0 [src] - %define i1 [spp] - %define i2 [src + 2 * stride] - %define i3 [spp + 2 * stride] - %define i4 [src + 4 * stride] - %define i5 [spp + 4 * stride] - %define i6 [src + 2 * stride3] - %define i7 [spp + 2 * stride3] - %define i8 [src + 8 * stride] - %define i9 [spp + 8 * stride] - %define i10 [src + 2 * stride5] - %define i11 [spp + 2 * stride5] - %define i12 [src + 4 * stride3] - %define i13 [spp + 4 * stride3] - %define i14 [src + 2 * stride7] - %define i15 [spp + 2 * stride7] - - ; prep work - lea spp, [src + stride] - lea stride3, [stride + 2 * stride] - lea stride5, [stride3 + 2 * stride] - lea stride7, [stride3 + 4 * stride] - pxor zero, zero - - ; load the first set into registers - movdqa xmm0, i0 - movdqa xmm1, i1 - movdqa xmm2, i2 - movdqa xmm3, i3 - movdqa xmm4, i4 - movdqa xmm8, i5 - movdqa xmm9, i6 ; q2, will contain abs(p1-p0) - movdqa xmm10, i7 -LF_FILTER_HEV_MASK xmm0, xmm1, xmm2, xmm3, xmm4, xmm8, xmm9, xmm10 - - movdqa xmm1, i2 - movdqa xmm2, i3 - movdqa xmm3, i4 - movdqa xmm8, i5 -LF_FILTER xmm1, xmm2, xmm3, xmm8, xmm0, xmm4 - movdqa i2, xmm1 - movdqa i3, xmm2 - -; second set - movdqa i4, xmm3 - movdqa i5, xmm8 - - movdqa xmm0, i6 - movdqa xmm1, i7 - movdqa xmm2, i8 - movdqa xmm4, i9 - movdqa xmm10, i10 ; q2, will contain abs(p1-p0) - movdqa xmm11, i11 -LF_FILTER_HEV_MASK xmm3, xmm8, xmm0, xmm1, xmm2, xmm4, xmm10, xmm11, xmm9 - - movdqa xmm0, i6 - movdqa xmm1, i7 - movdqa xmm4, i8 - movdqa xmm8, i9 -LF_FILTER xmm0, xmm1, xmm4, xmm8, xmm3, xmm2 - movdqa i6, xmm0 - movdqa i7, xmm1 - -; last set - movdqa i8, xmm4 - movdqa i9, xmm8 - - movdqa xmm0, i10 - movdqa xmm1, i11 - movdqa xmm2, i12 - movdqa xmm3, i13 - movdqa xmm9, i14 ; q2, will contain abs(p1-p0) - movdqa xmm11, i15 -LF_FILTER_HEV_MASK xmm4, xmm8, xmm0, xmm1, xmm2, xmm3, xmm9, xmm11, xmm10 - - movdqa xmm0, i10 - movdqa xmm1, i11 - movdqa xmm3, i12 - movdqa xmm8, i13 -LF_FILTER xmm0, xmm1, xmm3, xmm8, xmm4, xmm2 - movdqa i10, xmm0 - movdqa i11, xmm1 - movdqa i12, xmm3 - movdqa i13, xmm8 - -%if LIBVPX_YASM_WIN64 - pop r13 - pop r12 - RESTORE_XMM - pop rbp -%endif - - ret - - -;void vp8_loop_filter_bv_y_sse2 -;( -; unsigned char *src_ptr, -; int src_pixel_step, -; const char *blimit, -; const char *limit, -; const char *thresh -;) - -global sym(vp8_loop_filter_bv_y_sse2) PRIVATE -sym(vp8_loop_filter_bv_y_sse2): - -%if LIBVPX_YASM_WIN64 - %define src rcx ; src_ptr - %define stride rdx ; src_pixel_step - %define blimit r8 - %define limit r9 - %define thresh r10 - - %define spp rax - %define stride3 r11 - %define stride5 r12 - %define stride7 r13 - - push rbp - mov rbp, rsp - SAVE_XMM 15 - push r12 - push r13 - mov thresh, arg(4) -%else - %define src rdi - %define stride rsi - %define blimit rdx - %define limit rcx - %define thresh r8 - - %define spp rax - %define stride3 r9 - %define stride5 r10 - %define stride7 r11 -%endif - - %define scratch1 xmm5 - %define scratch2 xmm6 - %define zero xmm7 - - %define s0 [src] - %define s1 [spp] - %define s2 [src + 2 * stride] - %define s3 [spp + 2 * stride] - %define s4 [src + 4 * stride] - %define s5 [spp + 4 * stride] - %define s6 [src + 2 * stride3] - %define s7 [spp + 2 * stride3] - %define s8 [src + 8 * stride] - %define s9 [spp + 8 * stride] - %define s10 [src + 2 * stride5] - %define s11 [spp + 2 * stride5] - %define s12 [src + 4 * stride3] - %define s13 [spp + 4 * stride3] - %define s14 [src + 2 * stride7] - %define s15 [spp + 2 * stride7] - - %define i0 [rsp] - %define i1 [rsp + 16] - %define i2 [rsp + 32] - %define i3 [rsp + 48] - %define i4 [rsp + 64] - %define i5 [rsp + 80] - %define i6 [rsp + 96] - %define i7 [rsp + 112] - %define i8 [rsp + 128] - %define i9 [rsp + 144] - %define i10 [rsp + 160] - %define i11 [rsp + 176] - %define i12 [rsp + 192] - %define i13 [rsp + 208] - %define i14 [rsp + 224] - %define i15 [rsp + 240] - - ALIGN_STACK 16, rax - - ; reserve stack space - %define temp_storage 0 ; size is 256 (16*16) - %define stack_size 256 - sub rsp, stack_size - - ; prep work - lea spp, [src + stride] - lea stride3, [stride + 2 * stride] - lea stride5, [stride3 + 2 * stride] - lea stride7, [stride3 + 4 * stride] - - ; 8-f - movdqa xmm0, s8 - movdqa xmm1, xmm0 - punpcklbw xmm0, s9 ; 80 90 - punpckhbw xmm1, s9 ; 88 98 - - movdqa xmm2, s10 - movdqa xmm3, xmm2 - punpcklbw xmm2, s11 ; a0 b0 - punpckhbw xmm3, s11 ; a8 b8 - - movdqa xmm4, xmm0 - punpcklwd xmm0, xmm2 ; 80 90 a0 b0 - punpckhwd xmm4, xmm2 ; 84 94 a4 b4 - - movdqa xmm2, xmm1 - punpcklwd xmm1, xmm3 ; 88 98 a8 b8 - punpckhwd xmm2, xmm3 ; 8c 9c ac bc - - ; using xmm[0124] - ; work on next 4 rows - - movdqa xmm3, s12 - movdqa xmm5, xmm3 - punpcklbw xmm3, s13 ; c0 d0 - punpckhbw xmm5, s13 ; c8 d8 - - movdqa xmm6, s14 - movdqa xmm7, xmm6 - punpcklbw xmm6, s15 ; e0 f0 - punpckhbw xmm7, s15 ; e8 f8 - - movdqa xmm8, xmm3 - punpcklwd xmm3, xmm6 ; c0 d0 e0 f0 - punpckhwd xmm8, xmm6 ; c4 d4 e4 f4 - - movdqa xmm6, xmm5 - punpcklwd xmm5, xmm7 ; c8 d8 e8 f8 - punpckhwd xmm6, xmm7 ; cc dc ec fc - - ; pull the third and fourth sets together - - movdqa xmm7, xmm0 - punpckldq xmm0, xmm3 ; 80 90 a0 b0 c0 d0 e0 f0 - punpckhdq xmm7, xmm3 ; 82 92 a2 b2 c2 d2 e2 f2 - - movdqa xmm3, xmm4 - punpckldq xmm4, xmm8 ; 84 94 a4 b4 c4 d4 e4 f4 - punpckhdq xmm3, xmm8 ; 86 96 a6 b6 c6 d6 e6 f6 - - movdqa xmm8, xmm1 - punpckldq xmm1, xmm5 ; 88 88 a8 b8 c8 d8 e8 f8 - punpckhdq xmm8, xmm5 ; 8a 9a aa ba ca da ea fa - - movdqa xmm5, xmm2 - punpckldq xmm2, xmm6 ; 8c 9c ac bc cc dc ec fc - punpckhdq xmm5, xmm6 ; 8e 9e ae be ce de ee fe - - ; save the calculations. we only have 15 registers ... - movdqa i0, xmm0 - movdqa i1, xmm7 - movdqa i2, xmm4 - movdqa i3, xmm3 - movdqa i4, xmm1 - movdqa i5, xmm8 - movdqa i6, xmm2 - movdqa i7, xmm5 - - ; 0-7 - movdqa xmm0, s0 - movdqa xmm1, xmm0 - punpcklbw xmm0, s1 ; 00 10 - punpckhbw xmm1, s1 ; 08 18 - - movdqa xmm2, s2 - movdqa xmm3, xmm2 - punpcklbw xmm2, s3 ; 20 30 - punpckhbw xmm3, s3 ; 28 38 - - movdqa xmm4, xmm0 - punpcklwd xmm0, xmm2 ; 00 10 20 30 - punpckhwd xmm4, xmm2 ; 04 14 24 34 - - movdqa xmm2, xmm1 - punpcklwd xmm1, xmm3 ; 08 18 28 38 - punpckhwd xmm2, xmm3 ; 0c 1c 2c 3c - - ; using xmm[0124] - ; work on next 4 rows - - movdqa xmm3, s4 - movdqa xmm5, xmm3 - punpcklbw xmm3, s5 ; 40 50 - punpckhbw xmm5, s5 ; 48 58 - - movdqa xmm6, s6 - movdqa xmm7, xmm6 - punpcklbw xmm6, s7 ; 60 70 - punpckhbw xmm7, s7 ; 68 78 - - movdqa xmm8, xmm3 - punpcklwd xmm3, xmm6 ; 40 50 60 70 - punpckhwd xmm8, xmm6 ; 44 54 64 74 - - movdqa xmm6, xmm5 - punpcklwd xmm5, xmm7 ; 48 58 68 78 - punpckhwd xmm6, xmm7 ; 4c 5c 6c 7c - - ; pull the first two sets together - - movdqa xmm7, xmm0 - punpckldq xmm0, xmm3 ; 00 10 20 30 40 50 60 70 - punpckhdq xmm7, xmm3 ; 02 12 22 32 42 52 62 72 - - movdqa xmm3, xmm4 - punpckldq xmm4, xmm8 ; 04 14 24 34 44 54 64 74 - punpckhdq xmm3, xmm8 ; 06 16 26 36 46 56 66 76 - - movdqa xmm8, xmm1 - punpckldq xmm1, xmm5 ; 08 18 28 38 48 58 68 78 - punpckhdq xmm8, xmm5 ; 0a 1a 2a 3a 4a 5a 6a 7a - - movdqa xmm5, xmm2 - punpckldq xmm2, xmm6 ; 0c 1c 2c 3c 4c 5c 6c 7c - punpckhdq xmm5, xmm6 ; 0e 1e 2e 3e 4e 5e 6e 7e - ; final combination - - movdqa xmm6, xmm0 - punpcklqdq xmm0, i0 - punpckhqdq xmm6, i0 - - movdqa xmm9, xmm7 - punpcklqdq xmm7, i1 - punpckhqdq xmm9, i1 - - movdqa xmm10, xmm4 - punpcklqdq xmm4, i2 - punpckhqdq xmm10, i2 - - movdqa xmm11, xmm3 - punpcklqdq xmm3, i3 - punpckhqdq xmm11, i3 - - movdqa xmm12, xmm1 - punpcklqdq xmm1, i4 - punpckhqdq xmm12, i4 - - movdqa xmm13, xmm8 - punpcklqdq xmm8, i5 - punpckhqdq xmm13, i5 - - movdqa xmm14, xmm2 - punpcklqdq xmm2, i6 - punpckhqdq xmm14, i6 - - movdqa xmm15, xmm5 - punpcklqdq xmm5, i7 - punpckhqdq xmm15, i7 - - movdqa i0, xmm0 - movdqa i1, xmm6 - movdqa i2, xmm7 - movdqa i3, xmm9 - movdqa i4, xmm4 - movdqa i5, xmm10 - movdqa i6, xmm3 - movdqa i7, xmm11 - movdqa i8, xmm1 - movdqa i9, xmm12 - movdqa i10, xmm8 - movdqa i11, xmm13 - movdqa i12, xmm2 - movdqa i13, xmm14 - movdqa i14, xmm5 - movdqa i15, xmm15 - -; TRANSPOSED DATA AVAILABLE ON THE STACK - - movdqa xmm12, xmm6 - movdqa xmm13, xmm7 - - pxor zero, zero - -LF_FILTER_HEV_MASK xmm0, xmm12, xmm13, xmm9, xmm4, xmm10, xmm3, xmm11 - - movdqa xmm1, i2 - movdqa xmm2, i3 - movdqa xmm8, i4 - movdqa xmm9, i5 -LF_FILTER xmm1, xmm2, xmm8, xmm9, xmm0, xmm4 - movdqa i2, xmm1 - movdqa i3, xmm2 - -; second set - movdqa i4, xmm8 - movdqa i5, xmm9 - - movdqa xmm0, i6 - movdqa xmm1, i7 - movdqa xmm2, i8 - movdqa xmm4, i9 - movdqa xmm10, i10 ; q2, will contain abs(p1-p0) - movdqa xmm11, i11 -LF_FILTER_HEV_MASK xmm8, xmm9, xmm0, xmm1, xmm2, xmm4, xmm10, xmm11, xmm3 - - movdqa xmm0, i6 - movdqa xmm1, i7 - movdqa xmm3, i8 - movdqa xmm4, i9 -LF_FILTER xmm0, xmm1, xmm3, xmm4, xmm8, xmm2 - movdqa i6, xmm0 - movdqa i7, xmm1 - -; last set - movdqa i8, xmm3 - movdqa i9, xmm4 - - movdqa xmm0, i10 - movdqa xmm1, i11 - movdqa xmm2, i12 - movdqa xmm8, i13 - movdqa xmm9, i14 ; q2, will contain abs(p1-p0) - movdqa xmm11, i15 -LF_FILTER_HEV_MASK xmm3, xmm4, xmm0, xmm1, xmm2, xmm8, xmm9, xmm11, xmm10 - - movdqa xmm0, i10 - movdqa xmm1, i11 - movdqa xmm4, i12 - movdqa xmm8, i13 -LF_FILTER xmm0, xmm1, xmm4, xmm8, xmm3, xmm2 - movdqa i10, xmm0 - movdqa i11, xmm1 - movdqa i12, xmm4 - movdqa i13, xmm8 - - -; RESHUFFLE AND WRITE OUT - ; 8-f - movdqa xmm0, i8 - movdqa xmm1, xmm0 - punpcklbw xmm0, i9 ; 80 90 - punpckhbw xmm1, i9 ; 88 98 - - movdqa xmm2, i10 - movdqa xmm3, xmm2 - punpcklbw xmm2, i11 ; a0 b0 - punpckhbw xmm3, i11 ; a8 b8 - - movdqa xmm4, xmm0 - punpcklwd xmm0, xmm2 ; 80 90 a0 b0 - punpckhwd xmm4, xmm2 ; 84 94 a4 b4 - - movdqa xmm2, xmm1 - punpcklwd xmm1, xmm3 ; 88 98 a8 b8 - punpckhwd xmm2, xmm3 ; 8c 9c ac bc - - ; using xmm[0124] - ; work on next 4 rows - - movdqa xmm3, i12 - movdqa xmm5, xmm3 - punpcklbw xmm3, i13 ; c0 d0 - punpckhbw xmm5, i13 ; c8 d8 - - movdqa xmm6, i14 - movdqa xmm7, xmm6 - punpcklbw xmm6, i15 ; e0 f0 - punpckhbw xmm7, i15 ; e8 f8 - - movdqa xmm8, xmm3 - punpcklwd xmm3, xmm6 ; c0 d0 e0 f0 - punpckhwd xmm8, xmm6 ; c4 d4 e4 f4 - - movdqa xmm6, xmm5 - punpcklwd xmm5, xmm7 ; c8 d8 e8 f8 - punpckhwd xmm6, xmm7 ; cc dc ec fc - - ; pull the third and fourth sets together - - movdqa xmm7, xmm0 - punpckldq xmm0, xmm3 ; 80 90 a0 b0 c0 d0 e0 f0 - punpckhdq xmm7, xmm3 ; 82 92 a2 b2 c2 d2 e2 f2 - - movdqa xmm3, xmm4 - punpckldq xmm4, xmm8 ; 84 94 a4 b4 c4 d4 e4 f4 - punpckhdq xmm3, xmm8 ; 86 96 a6 b6 c6 d6 e6 f6 - - movdqa xmm8, xmm1 - punpckldq xmm1, xmm5 ; 88 88 a8 b8 c8 d8 e8 f8 - punpckhdq xmm8, xmm5 ; 8a 9a aa ba ca da ea fa - - movdqa xmm5, xmm2 - punpckldq xmm2, xmm6 ; 8c 9c ac bc cc dc ec fc - punpckhdq xmm5, xmm6 ; 8e 9e ae be ce de ee fe - - ; save the calculations. we only have 15 registers ... - movdqa i8, xmm0 - movdqa i9, xmm7 - movdqa i10, xmm4 - movdqa i11, xmm3 - movdqa i12, xmm1 - movdqa i13, xmm8 - movdqa i14, xmm2 - movdqa i15, xmm5 - - ; 0-7 - movdqa xmm0, i0 - movdqa xmm1, xmm0 - punpcklbw xmm0, i1 ; 00 10 - punpckhbw xmm1, i1 ; 08 18 - - movdqa xmm2, i2 - movdqa xmm3, xmm2 - punpcklbw xmm2, i3 ; 20 30 - punpckhbw xmm3, i3 ; 28 38 - - movdqa xmm4, xmm0 - punpcklwd xmm0, xmm2 ; 00 10 20 30 - punpckhwd xmm4, xmm2 ; 04 14 24 34 - - movdqa xmm2, xmm1 - punpcklwd xmm1, xmm3 ; 08 18 28 38 - punpckhwd xmm2, xmm3 ; 0c 1c 2c 3c - - ; using xmm[0124] - ; work on next 4 rows - - movdqa xmm3, i4 - movdqa xmm5, xmm3 - punpcklbw xmm3, i5 ; 40 50 - punpckhbw xmm5, i5 ; 48 58 - - movdqa xmm6, i6 - movdqa xmm7, xmm6 - punpcklbw xmm6, i7 ; 60 70 - punpckhbw xmm7, i7 ; 68 78 - - movdqa xmm8, xmm3 - punpcklwd xmm3, xmm6 ; 40 50 60 70 - punpckhwd xmm8, xmm6 ; 44 54 64 74 - - movdqa xmm6, xmm5 - punpcklwd xmm5, xmm7 ; 48 58 68 78 - punpckhwd xmm6, xmm7 ; 4c 5c 6c 7c - - ; pull the first two sets together - - movdqa xmm7, xmm0 - punpckldq xmm0, xmm3 ; 00 10 20 30 40 50 60 70 - punpckhdq xmm7, xmm3 ; 02 12 22 32 42 52 62 72 - - movdqa xmm3, xmm4 - punpckldq xmm4, xmm8 ; 04 14 24 34 44 54 64 74 - punpckhdq xmm3, xmm8 ; 06 16 26 36 46 56 66 76 - - movdqa xmm8, xmm1 - punpckldq xmm1, xmm5 ; 08 18 28 38 48 58 68 78 - punpckhdq xmm8, xmm5 ; 0a 1a 2a 3a 4a 5a 6a 7a - - movdqa xmm5, xmm2 - punpckldq xmm2, xmm6 ; 0c 1c 2c 3c 4c 5c 6c 7c - punpckhdq xmm5, xmm6 ; 0e 1e 2e 3e 4e 5e 6e 7e - ; final combination - - movdqa xmm6, xmm0 - punpcklqdq xmm0, i8 - punpckhqdq xmm6, i8 - - movdqa xmm9, xmm7 - punpcklqdq xmm7, i9 - punpckhqdq xmm9, i9 - - movdqa xmm10, xmm4 - punpcklqdq xmm4, i10 - punpckhqdq xmm10, i10 - - movdqa xmm11, xmm3 - punpcklqdq xmm3, i11 - punpckhqdq xmm11, i11 - - movdqa xmm12, xmm1 - punpcklqdq xmm1, i12 - punpckhqdq xmm12, i12 - - movdqa xmm13, xmm8 - punpcklqdq xmm8, i13 - punpckhqdq xmm13, i13 - - movdqa xmm14, xmm2 - punpcklqdq xmm2, i14 - punpckhqdq xmm14, i14 - - movdqa xmm15, xmm5 - punpcklqdq xmm5, i15 - punpckhqdq xmm15, i15 - - movdqa s0, xmm0 - movdqa s1, xmm6 - movdqa s2, xmm7 - movdqa s3, xmm9 - movdqa s4, xmm4 - movdqa s5, xmm10 - movdqa s6, xmm3 - movdqa s7, xmm11 - movdqa s8, xmm1 - movdqa s9, xmm12 - movdqa s10, xmm8 - movdqa s11, xmm13 - movdqa s12, xmm2 - movdqa s13, xmm14 - movdqa s14, xmm5 - movdqa s15, xmm15 - - ; free stack space - add rsp, stack_size - - ; un-ALIGN_STACK - pop rsp - -%if LIBVPX_YASM_WIN64 - pop r13 - pop r12 - RESTORE_XMM - pop rbp -%endif - - ret - -SECTION_RODATA -align 16 -te0: - times 16 db 0xe0 -align 16 -t7f: - times 16 db 0x7f -align 16 -tfe: - times 16 db 0xfe -align 16 -t1f: - times 16 db 0x1f -align 16 -t80: - times 16 db 0x80 -align 16 -t1: - times 16 db 0x01 -align 16 -t3: - times 16 db 0x03 -align 16 -t4: - times 16 db 0x04 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/loopfilter_mmx.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/loopfilter_mmx.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/loopfilter_mmx.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/loopfilter_mmx.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,1753 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - - -;void vp8_loop_filter_horizontal_edge_mmx -;( -; unsigned char *src_ptr, -; int src_pixel_step, -; const char *blimit, -; const char *limit, -; const char *thresh, -; int count -;) -global sym(vp8_loop_filter_horizontal_edge_mmx) PRIVATE -sym(vp8_loop_filter_horizontal_edge_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, 32 ; reserve 32 bytes - %define t0 [rsp + 0] ;__declspec(align(16)) char t0[8]; - %define t1 [rsp + 16] ;__declspec(align(16)) char t1[8]; - - mov rsi, arg(0) ;src_ptr - movsxd rax, dword ptr arg(1) ;src_pixel_step ; destination pitch? - - movsxd rcx, dword ptr arg(5) ;count -.next8_h: - mov rdx, arg(3) ;limit - movq mm7, [rdx] - mov rdi, rsi ; rdi points to row +1 for indirect addressing - add rdi, rax - - ; calculate breakout conditions - movq mm2, [rdi+2*rax] ; q3 - movq mm1, [rsi+2*rax] ; q2 - movq mm6, mm1 ; q2 - psubusb mm1, mm2 ; q2-=q3 - psubusb mm2, mm6 ; q3-=q2 - por mm1, mm2 ; abs(q3-q2) - psubusb mm1, mm7 ; - - - movq mm4, [rsi+rax] ; q1 - movq mm3, mm4 ; q1 - psubusb mm4, mm6 ; q1-=q2 - psubusb mm6, mm3 ; q2-=q1 - por mm4, mm6 ; abs(q2-q1) - - psubusb mm4, mm7 - por mm1, mm4 - - movq mm4, [rsi] ; q0 - movq mm0, mm4 ; q0 - psubusb mm4, mm3 ; q0-=q1 - psubusb mm3, mm0 ; q1-=q0 - por mm4, mm3 ; abs(q0-q1) - movq t0, mm4 ; save to t0 - psubusb mm4, mm7 - por mm1, mm4 - - - neg rax ; negate pitch to deal with above border - - movq mm2, [rsi+4*rax] ; p3 - movq mm4, [rdi+4*rax] ; p2 - movq mm5, mm4 ; p2 - psubusb mm4, mm2 ; p2-=p3 - psubusb mm2, mm5 ; p3-=p2 - por mm4, mm2 ; abs(p3 - p2) - psubusb mm4, mm7 - por mm1, mm4 - - - movq mm4, [rsi+2*rax] ; p1 - movq mm3, mm4 ; p1 - psubusb mm4, mm5 ; p1-=p2 - psubusb mm5, mm3 ; p2-=p1 - por mm4, mm5 ; abs(p2 - p1) - psubusb mm4, mm7 - por mm1, mm4 - - movq mm2, mm3 ; p1 - - movq mm4, [rsi+rax] ; p0 - movq mm5, mm4 ; p0 - psubusb mm4, mm3 ; p0-=p1 - psubusb mm3, mm5 ; p1-=p0 - por mm4, mm3 ; abs(p1 - p0) - movq t1, mm4 ; save to t1 - psubusb mm4, mm7 - por mm1, mm4 - - movq mm3, [rdi] ; q1 - movq mm4, mm3 ; q1 - psubusb mm3, mm2 ; q1-=p1 - psubusb mm2, mm4 ; p1-=q1 - por mm2, mm3 ; abs(p1-q1) - pand mm2, [GLOBAL(tfe)] ; set lsb of each byte to zero - psrlw mm2, 1 ; abs(p1-q1)/2 - - movq mm6, mm5 ; p0 - movq mm3, [rsi] ; q0 - psubusb mm5, mm3 ; p0-=q0 - psubusb mm3, mm6 ; q0-=p0 - por mm5, mm3 ; abs(p0 - q0) - paddusb mm5, mm5 ; abs(p0-q0)*2 - paddusb mm5, mm2 ; abs (p0 - q0) *2 + abs(p1-q1)/2 - - mov rdx, arg(2) ;blimit ; get blimit - movq mm7, [rdx] ; blimit - - psubusb mm5, mm7 ; abs (p0 - q0) *2 + abs(p1-q1)/2 > blimit - por mm1, mm5 - pxor mm5, mm5 - pcmpeqb mm1, mm5 ; mask mm1 - - ; calculate high edge variance - mov rdx, arg(4) ;thresh ; get thresh - movq mm7, [rdx] ; - movq mm4, t0 ; get abs (q1 - q0) - psubusb mm4, mm7 - movq mm3, t1 ; get abs (p1 - p0) - psubusb mm3, mm7 - paddb mm4, mm3 ; abs(q1 - q0) > thresh || abs(p1 - p0) > thresh - - pcmpeqb mm4, mm5 - - pcmpeqb mm5, mm5 - pxor mm4, mm5 - - - ; start work on filters - movq mm2, [rsi+2*rax] ; p1 - movq mm7, [rdi] ; q1 - pxor mm2, [GLOBAL(t80)] ; p1 offset to convert to signed values - pxor mm7, [GLOBAL(t80)] ; q1 offset to convert to signed values - psubsb mm2, mm7 ; p1 - q1 - pand mm2, mm4 ; high var mask (hvm)(p1 - q1) - pxor mm6, [GLOBAL(t80)] ; offset to convert to signed values - pxor mm0, [GLOBAL(t80)] ; offset to convert to signed values - movq mm3, mm0 ; q0 - psubsb mm0, mm6 ; q0 - p0 - paddsb mm2, mm0 ; 1 * (q0 - p0) + hvm(p1 - q1) - paddsb mm2, mm0 ; 2 * (q0 - p0) + hvm(p1 - q1) - paddsb mm2, mm0 ; 3 * (q0 - p0) + hvm(p1 - q1) - pand mm1, mm2 ; mask filter values we don't care about - movq mm2, mm1 - paddsb mm1, [GLOBAL(t4)] ; 3* (q0 - p0) + hvm(p1 - q1) + 4 - paddsb mm2, [GLOBAL(t3)] ; 3* (q0 - p0) + hvm(p1 - q1) + 3 - - pxor mm0, mm0 ; - pxor mm5, mm5 - punpcklbw mm0, mm2 ; - punpckhbw mm5, mm2 ; - psraw mm0, 11 ; - psraw mm5, 11 - packsswb mm0, mm5 - movq mm2, mm0 ; (3* (q0 - p0) + hvm(p1 - q1) + 3) >> 3; - - pxor mm0, mm0 ; 0 - movq mm5, mm1 ; abcdefgh - punpcklbw mm0, mm1 ; e0f0g0h0 - psraw mm0, 11 ; sign extended shift right by 3 - pxor mm1, mm1 ; 0 - punpckhbw mm1, mm5 ; a0b0c0d0 - psraw mm1, 11 ; sign extended shift right by 3 - movq mm5, mm0 ; save results - - packsswb mm0, mm1 ; (3* (q0 - p0) + hvm(p1 - q1) + 4) >>3 - paddsw mm5, [GLOBAL(ones)] - paddsw mm1, [GLOBAL(ones)] - psraw mm5, 1 ; partial shifted one more time for 2nd tap - psraw mm1, 1 ; partial shifted one more time for 2nd tap - packsswb mm5, mm1 ; (3* (q0 - p0) + hvm(p1 - q1) + 4) >>4 - pandn mm4, mm5 ; high edge variance additive - - paddsb mm6, mm2 ; p0+= p0 add - pxor mm6, [GLOBAL(t80)] ; unoffset - movq [rsi+rax], mm6 ; write back - - movq mm6, [rsi+2*rax] ; p1 - pxor mm6, [GLOBAL(t80)] ; reoffset - paddsb mm6, mm4 ; p1+= p1 add - pxor mm6, [GLOBAL(t80)] ; unoffset - movq [rsi+2*rax], mm6 ; write back - - psubsb mm3, mm0 ; q0-= q0 add - pxor mm3, [GLOBAL(t80)] ; unoffset - movq [rsi], mm3 ; write back - - psubsb mm7, mm4 ; q1-= q1 add - pxor mm7, [GLOBAL(t80)] ; unoffset - movq [rdi], mm7 ; write back - - add rsi,8 - neg rax - dec rcx - jnz .next8_h - - add rsp, 32 - pop rsp - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_loop_filter_vertical_edge_mmx -;( -; unsigned char *src_ptr, -; int src_pixel_step, -; const char *blimit, -; const char *limit, -; const char *thresh, -; int count -;) -global sym(vp8_loop_filter_vertical_edge_mmx) PRIVATE -sym(vp8_loop_filter_vertical_edge_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, 64 ; reserve 64 bytes - %define t0 [rsp + 0] ;__declspec(align(16)) char t0[8]; - %define t1 [rsp + 16] ;__declspec(align(16)) char t1[8]; - %define srct [rsp + 32] ;__declspec(align(16)) char srct[32]; - - mov rsi, arg(0) ;src_ptr - movsxd rax, dword ptr arg(1) ;src_pixel_step ; destination pitch? - - lea rsi, [rsi + rax*4 - 4] - - movsxd rcx, dword ptr arg(5) ;count -.next8_v: - mov rdi, rsi ; rdi points to row +1 for indirect addressing - add rdi, rax - - - ;transpose - movq mm6, [rsi+2*rax] ; 67 66 65 64 63 62 61 60 - movq mm7, mm6 ; 77 76 75 74 73 72 71 70 - - punpckhbw mm7, [rdi+2*rax] ; 77 67 76 66 75 65 74 64 - punpcklbw mm6, [rdi+2*rax] ; 73 63 72 62 71 61 70 60 - - movq mm4, [rsi] ; 47 46 45 44 43 42 41 40 - movq mm5, mm4 ; 47 46 45 44 43 42 41 40 - - punpckhbw mm5, [rsi+rax] ; 57 47 56 46 55 45 54 44 - punpcklbw mm4, [rsi+rax] ; 53 43 52 42 51 41 50 40 - - movq mm3, mm5 ; 57 47 56 46 55 45 54 44 - punpckhwd mm5, mm7 ; 77 67 57 47 76 66 56 46 - - punpcklwd mm3, mm7 ; 75 65 55 45 74 64 54 44 - movq mm2, mm4 ; 53 43 52 42 51 41 50 40 - - punpckhwd mm4, mm6 ; 73 63 53 43 72 62 52 42 - punpcklwd mm2, mm6 ; 71 61 51 41 70 60 50 40 - - neg rax - movq mm6, [rsi+rax*2] ; 27 26 25 24 23 22 21 20 - - movq mm1, mm6 ; 27 26 25 24 23 22 21 20 - punpckhbw mm6, [rsi+rax] ; 37 27 36 36 35 25 34 24 - - punpcklbw mm1, [rsi+rax] ; 33 23 32 22 31 21 30 20 - movq mm7, [rsi+rax*4]; ; 07 06 05 04 03 02 01 00 - - punpckhbw mm7, [rdi+rax*4] ; 17 07 16 06 15 05 14 04 - movq mm0, mm7 ; 17 07 16 06 15 05 14 04 - - punpckhwd mm7, mm6 ; 37 27 17 07 36 26 16 06 - punpcklwd mm0, mm6 ; 35 25 15 05 34 24 14 04 - - movq mm6, mm7 ; 37 27 17 07 36 26 16 06 - punpckhdq mm7, mm5 ; 77 67 57 47 37 27 17 07 = q3 - - punpckldq mm6, mm5 ; 76 66 56 46 36 26 16 06 = q2 - - movq mm5, mm6 ; 76 66 56 46 36 26 16 06 - psubusb mm5, mm7 ; q2-q3 - - psubusb mm7, mm6 ; q3-q2 - por mm7, mm5; ; mm7=abs (q3-q2) - - movq mm5, mm0 ; 35 25 15 05 34 24 14 04 - punpckhdq mm5, mm3 ; 75 65 55 45 35 25 15 05 = q1 - - punpckldq mm0, mm3 ; 74 64 54 44 34 24 15 04 = q0 - movq mm3, mm5 ; 75 65 55 45 35 25 15 05 = q1 - - psubusb mm3, mm6 ; q1-q2 - psubusb mm6, mm5 ; q2-q1 - - por mm6, mm3 ; mm6=abs(q2-q1) - lea rdx, srct - - movq [rdx+24], mm5 ; save q1 - movq [rdx+16], mm0 ; save q0 - - movq mm3, [rsi+rax*4] ; 07 06 05 04 03 02 01 00 - punpcklbw mm3, [rdi+rax*4] ; 13 03 12 02 11 01 10 00 - - movq mm0, mm3 ; 13 03 12 02 11 01 10 00 - punpcklwd mm0, mm1 ; 31 21 11 01 30 20 10 00 - - punpckhwd mm3, mm1 ; 33 23 13 03 32 22 12 02 - movq mm1, mm0 ; 31 21 11 01 30 20 10 00 - - punpckldq mm0, mm2 ; 70 60 50 40 30 20 10 00 =p3 - punpckhdq mm1, mm2 ; 71 61 51 41 31 21 11 01 =p2 - - movq mm2, mm1 ; 71 61 51 41 31 21 11 01 =p2 - psubusb mm2, mm0 ; p2-p3 - - psubusb mm0, mm1 ; p3-p2 - por mm0, mm2 ; mm0=abs(p3-p2) - - movq mm2, mm3 ; 33 23 13 03 32 22 12 02 - punpckldq mm2, mm4 ; 72 62 52 42 32 22 12 02 = p1 - - punpckhdq mm3, mm4 ; 73 63 53 43 33 23 13 03 = p0 - movq [rdx+8], mm3 ; save p0 - - movq [rdx], mm2 ; save p1 - movq mm5, mm2 ; mm5 = p1 - - psubusb mm2, mm1 ; p1-p2 - psubusb mm1, mm5 ; p2-p1 - - por mm1, mm2 ; mm1=abs(p2-p1) - mov rdx, arg(3) ;limit - - movq mm4, [rdx] ; mm4 = limit - psubusb mm7, mm4 - - psubusb mm0, mm4 - psubusb mm1, mm4 - - psubusb mm6, mm4 - por mm7, mm6 - - por mm0, mm1 - por mm0, mm7 ; abs(q3-q2) > limit || abs(p3-p2) > limit ||abs(p2-p1) > limit || abs(q2-q1) > limit - - movq mm1, mm5 ; p1 - - movq mm7, mm3 ; mm3=mm7=p0 - psubusb mm7, mm5 ; p0 - p1 - - psubusb mm5, mm3 ; p1 - p0 - por mm5, mm7 ; abs(p1-p0) - - movq t0, mm5 ; save abs(p1-p0) - lea rdx, srct - - psubusb mm5, mm4 - por mm0, mm5 ; mm0=mask - - movq mm5, [rdx+16] ; mm5=q0 - movq mm7, [rdx+24] ; mm7=q1 - - movq mm6, mm5 ; mm6=q0 - movq mm2, mm7 ; q1 - psubusb mm5, mm7 ; q0-q1 - - psubusb mm7, mm6 ; q1-q0 - por mm7, mm5 ; abs(q1-q0) - - movq t1, mm7 ; save abs(q1-q0) - psubusb mm7, mm4 - - por mm0, mm7 ; mask - - movq mm5, mm2 ; q1 - psubusb mm5, mm1 ; q1-=p1 - psubusb mm1, mm2 ; p1-=q1 - por mm5, mm1 ; abs(p1-q1) - pand mm5, [GLOBAL(tfe)] ; set lsb of each byte to zero - psrlw mm5, 1 ; abs(p1-q1)/2 - - mov rdx, arg(2) ;blimit ; - - movq mm4, [rdx] ;blimit - movq mm1, mm3 ; mm1=mm3=p0 - - movq mm7, mm6 ; mm7=mm6=q0 - psubusb mm1, mm7 ; p0-q0 - - psubusb mm7, mm3 ; q0-p0 - por mm1, mm7 ; abs(q0-p0) - paddusb mm1, mm1 ; abs(q0-p0)*2 - paddusb mm1, mm5 ; abs (p0 - q0) *2 + abs(p1-q1)/2 - - psubusb mm1, mm4 ; abs (p0 - q0) *2 + abs(p1-q1)/2 > blimit - por mm1, mm0; ; mask - - pxor mm0, mm0 - pcmpeqb mm1, mm0 - - ; calculate high edge variance - mov rdx, arg(4) ;thresh ; get thresh - movq mm7, [rdx] - ; - movq mm4, t0 ; get abs (q1 - q0) - psubusb mm4, mm7 - - movq mm3, t1 ; get abs (p1 - p0) - psubusb mm3, mm7 - - por mm4, mm3 ; abs(q1 - q0) > thresh || abs(p1 - p0) > thresh - pcmpeqb mm4, mm0 - - pcmpeqb mm0, mm0 - pxor mm4, mm0 - - - - ; start work on filters - lea rdx, srct - - movq mm2, [rdx] ; p1 - movq mm7, [rdx+24] ; q1 - - movq mm6, [rdx+8] ; p0 - movq mm0, [rdx+16] ; q0 - - pxor mm2, [GLOBAL(t80)] ; p1 offset to convert to signed values - pxor mm7, [GLOBAL(t80)] ; q1 offset to convert to signed values - - psubsb mm2, mm7 ; p1 - q1 - pand mm2, mm4 ; high var mask (hvm)(p1 - q1) - - pxor mm6, [GLOBAL(t80)] ; offset to convert to signed values - pxor mm0, [GLOBAL(t80)] ; offset to convert to signed values - - movq mm3, mm0 ; q0 - psubsb mm0, mm6 ; q0 - p0 - - paddsb mm2, mm0 ; 1 * (q0 - p0) + hvm(p1 - q1) - paddsb mm2, mm0 ; 2 * (q0 - p0) + hvm(p1 - q1) - - paddsb mm2, mm0 ; 3 * (q0 - p0) + hvm(p1 - q1) - pand mm1, mm2 ; mask filter values we don't care about - - movq mm2, mm1 - paddsb mm1, [GLOBAL(t4)] ; 3* (q0 - p0) + hvm(p1 - q1) + 4 - - paddsb mm2, [GLOBAL(t3)] ; 3* (q0 - p0) + hvm(p1 - q1) + 3 - pxor mm0, mm0 ; - - pxor mm5, mm5 - punpcklbw mm0, mm2 ; - - punpckhbw mm5, mm2 ; - psraw mm0, 11 ; - - psraw mm5, 11 - packsswb mm0, mm5 - - movq mm2, mm0 ; (3* (q0 - p0) + hvm(p1 - q1) + 3) >> 3; - - pxor mm0, mm0 ; 0 - movq mm5, mm1 ; abcdefgh - - punpcklbw mm0, mm1 ; e0f0g0h0 - psraw mm0, 11 ; sign extended shift right by 3 - - pxor mm1, mm1 ; 0 - punpckhbw mm1, mm5 ; a0b0c0d0 - - psraw mm1, 11 ; sign extended shift right by 3 - movq mm5, mm0 ; save results - - packsswb mm0, mm1 ; (3* (q0 - p0) + hvm(p1 - q1) + 4) >>3 - paddsw mm5, [GLOBAL(ones)] - - paddsw mm1, [GLOBAL(ones)] - psraw mm5, 1 ; partial shifted one more time for 2nd tap - - psraw mm1, 1 ; partial shifted one more time for 2nd tap - packsswb mm5, mm1 ; (3* (q0 - p0) + hvm(p1 - q1) + 4) >>4 - - pandn mm4, mm5 ; high edge variance additive - - paddsb mm6, mm2 ; p0+= p0 add - pxor mm6, [GLOBAL(t80)] ; unoffset - - ; mm6=p0 ; - movq mm1, [rdx] ; p1 - pxor mm1, [GLOBAL(t80)] ; reoffset - - paddsb mm1, mm4 ; p1+= p1 add - pxor mm1, [GLOBAL(t80)] ; unoffset - ; mm6 = p0 mm1 = p1 - - psubsb mm3, mm0 ; q0-= q0 add - pxor mm3, [GLOBAL(t80)] ; unoffset - - ; mm3 = q0 - psubsb mm7, mm4 ; q1-= q1 add - pxor mm7, [GLOBAL(t80)] ; unoffset - ; mm7 = q1 - - ; transpose and write back - ; mm1 = 72 62 52 42 32 22 12 02 - ; mm6 = 73 63 53 43 33 23 13 03 - ; mm3 = 74 64 54 44 34 24 14 04 - ; mm7 = 75 65 55 45 35 25 15 05 - - movq mm2, mm1 ; 72 62 52 42 32 22 12 02 - punpcklbw mm2, mm6 ; 33 32 23 22 13 12 03 02 - - movq mm4, mm3 ; 74 64 54 44 34 24 14 04 - punpckhbw mm1, mm6 ; 73 72 63 62 53 52 43 42 - - punpcklbw mm4, mm7 ; 35 34 25 24 15 14 05 04 - punpckhbw mm3, mm7 ; 75 74 65 64 55 54 45 44 - - movq mm6, mm2 ; 33 32 23 22 13 12 03 02 - punpcklwd mm2, mm4 ; 15 14 13 12 05 04 03 02 - - punpckhwd mm6, mm4 ; 35 34 33 32 25 24 23 22 - movq mm5, mm1 ; 73 72 63 62 53 52 43 42 - - punpcklwd mm1, mm3 ; 55 54 53 52 45 44 43 42 - punpckhwd mm5, mm3 ; 75 74 73 72 65 64 63 62 - - - ; mm2 = 15 14 13 12 05 04 03 02 - ; mm6 = 35 34 33 32 25 24 23 22 - ; mm5 = 55 54 53 52 45 44 43 42 - ; mm1 = 75 74 73 72 65 64 63 62 - - - - movd [rsi+rax*4+2], mm2 - psrlq mm2, 32 - - movd [rdi+rax*4+2], mm2 - movd [rsi+rax*2+2], mm6 - - psrlq mm6, 32 - movd [rsi+rax+2],mm6 - - movd [rsi+2], mm1 - psrlq mm1, 32 - - movd [rdi+2], mm1 - neg rax - - movd [rdi+rax+2],mm5 - psrlq mm5, 32 - - movd [rdi+rax*2+2], mm5 - - lea rsi, [rsi+rax*8] - dec rcx - jnz .next8_v - - add rsp, 64 - pop rsp - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_mbloop_filter_horizontal_edge_mmx -;( -; unsigned char *src_ptr, -; int src_pixel_step, -; const char *blimit, -; const char *limit, -; const char *thresh, -; int count -;) -global sym(vp8_mbloop_filter_horizontal_edge_mmx) PRIVATE -sym(vp8_mbloop_filter_horizontal_edge_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, 32 ; reserve 32 bytes - %define t0 [rsp + 0] ;__declspec(align(16)) char t0[8]; - %define t1 [rsp + 16] ;__declspec(align(16)) char t1[8]; - - mov rsi, arg(0) ;src_ptr - movsxd rax, dword ptr arg(1) ;src_pixel_step ; destination pitch? - - movsxd rcx, dword ptr arg(5) ;count -.next8_mbh: - mov rdx, arg(3) ;limit - movq mm7, [rdx] - mov rdi, rsi ; rdi points to row +1 for indirect addressing - add rdi, rax - - ; calculate breakout conditions - movq mm2, [rdi+2*rax] ; q3 - - movq mm1, [rsi+2*rax] ; q2 - movq mm6, mm1 ; q2 - psubusb mm1, mm2 ; q2-=q3 - psubusb mm2, mm6 ; q3-=q2 - por mm1, mm2 ; abs(q3-q2) - psubusb mm1, mm7 - - - ; mm1 = abs(q3-q2), mm6 =q2, mm7 = limit - movq mm4, [rsi+rax] ; q1 - movq mm3, mm4 ; q1 - psubusb mm4, mm6 ; q1-=q2 - psubusb mm6, mm3 ; q2-=q1 - por mm4, mm6 ; abs(q2-q1) - psubusb mm4, mm7 - por mm1, mm4 - - - ; mm1 = mask, mm3=q1, mm7 = limit - - movq mm4, [rsi] ; q0 - movq mm0, mm4 ; q0 - psubusb mm4, mm3 ; q0-=q1 - psubusb mm3, mm0 ; q1-=q0 - por mm4, mm3 ; abs(q0-q1) - movq t0, mm4 ; save to t0 - psubusb mm4, mm7 - por mm1, mm4 - - - ; mm1 = mask, mm0=q0, mm7 = limit, t0 = abs(q0-q1) - - neg rax ; negate pitch to deal with above border - - movq mm2, [rsi+4*rax] ; p3 - movq mm4, [rdi+4*rax] ; p2 - movq mm5, mm4 ; p2 - psubusb mm4, mm2 ; p2-=p3 - psubusb mm2, mm5 ; p3-=p2 - por mm4, mm2 ; abs(p3 - p2) - psubusb mm4, mm7 - por mm1, mm4 - ; mm1 = mask, mm0=q0, mm7 = limit, t0 = abs(q0-q1) - - movq mm4, [rsi+2*rax] ; p1 - movq mm3, mm4 ; p1 - psubusb mm4, mm5 ; p1-=p2 - psubusb mm5, mm3 ; p2-=p1 - por mm4, mm5 ; abs(p2 - p1) - psubusb mm4, mm7 - por mm1, mm4 - - movq mm2, mm3 ; p1 - - - ; mm1 = mask, mm0=q0, mm7 = limit, t0 = abs(q0-q1) - - movq mm4, [rsi+rax] ; p0 - movq mm5, mm4 ; p0 - psubusb mm4, mm3 ; p0-=p1 - psubusb mm3, mm5 ; p1-=p0 - por mm4, mm3 ; abs(p1 - p0) - movq t1, mm4 ; save to t1 - psubusb mm4, mm7 - por mm1, mm4 - ; mm1 = mask, mm0=q0, mm7 = limit, t0 = abs(q0-q1) t1 = abs(p1-p0) - ; mm5 = p0 - movq mm3, [rdi] ; q1 - movq mm4, mm3 ; q1 - psubusb mm3, mm2 ; q1-=p1 - psubusb mm2, mm4 ; p1-=q1 - por mm2, mm3 ; abs(p1-q1) - pand mm2, [GLOBAL(tfe)] ; set lsb of each byte to zero - psrlw mm2, 1 ; abs(p1-q1)/2 - - movq mm6, mm5 ; p0 - movq mm3, mm0 ; q0 - psubusb mm5, mm3 ; p0-=q0 - psubusb mm3, mm6 ; q0-=p0 - por mm5, mm3 ; abs(p0 - q0) - paddusb mm5, mm5 ; abs(p0-q0)*2 - paddusb mm5, mm2 ; abs (p0 - q0) *2 + abs(p1-q1)/2 - - mov rdx, arg(2) ;blimit ; get blimit - movq mm7, [rdx] ; blimit - - psubusb mm5, mm7 ; abs (p0 - q0) *2 + abs(p1-q1)/2 > blimit - por mm1, mm5 - pxor mm5, mm5 - pcmpeqb mm1, mm5 ; mask mm1 - - ; mm1 = mask, mm0=q0, mm7 = blimit, t0 = abs(q0-q1) t1 = abs(p1-p0) - ; mm6 = p0, - - ; calculate high edge variance - mov rdx, arg(4) ;thresh ; get thresh - movq mm7, [rdx] ; - movq mm4, t0 ; get abs (q1 - q0) - psubusb mm4, mm7 - movq mm3, t1 ; get abs (p1 - p0) - psubusb mm3, mm7 - paddb mm4, mm3 ; abs(q1 - q0) > thresh || abs(p1 - p0) > thresh - - pcmpeqb mm4, mm5 - - pcmpeqb mm5, mm5 - pxor mm4, mm5 - - - - ; mm1 = mask, mm0=q0, mm7 = thresh, t0 = abs(q0-q1) t1 = abs(p1-p0) - ; mm6 = p0, mm4=hev - ; start work on filters - movq mm2, [rsi+2*rax] ; p1 - movq mm7, [rdi] ; q1 - pxor mm2, [GLOBAL(t80)] ; p1 offset to convert to signed values - pxor mm7, [GLOBAL(t80)] ; q1 offset to convert to signed values - psubsb mm2, mm7 ; p1 - q1 - - pxor mm6, [GLOBAL(t80)] ; offset to convert to signed values - pxor mm0, [GLOBAL(t80)] ; offset to convert to signed values - movq mm3, mm0 ; q0 - psubsb mm0, mm6 ; q0 - p0 - paddsb mm2, mm0 ; 1 * (q0 - p0) + (p1 - q1) - paddsb mm2, mm0 ; 2 * (q0 - p0) - paddsb mm2, mm0 ; 3 * (q0 - p0) + (p1 - q1) - pand mm1, mm2 ; mask filter values we don't care about - - - ; mm1 = vp8_filter, mm4=hev, mm6=ps0, mm3=qs0 - movq mm2, mm1 ; vp8_filter - pand mm2, mm4; ; Filter2 = vp8_filter & hev - - movq mm5, mm2 ; - paddsb mm5, [GLOBAL(t3)]; - - pxor mm0, mm0 ; 0 - pxor mm7, mm7 ; 0 - - punpcklbw mm0, mm5 ; e0f0g0h0 - psraw mm0, 11 ; sign extended shift right by 3 - punpckhbw mm7, mm5 ; a0b0c0d0 - psraw mm7, 11 ; sign extended shift right by 3 - packsswb mm0, mm7 ; Filter2 >>=3; - - movq mm5, mm0 ; Filter2 - - paddsb mm2, [GLOBAL(t4)] ; vp8_signed_char_clamp(Filter2 + 4) - pxor mm0, mm0 ; 0 - pxor mm7, mm7 ; 0 - - punpcklbw mm0, mm2 ; e0f0g0h0 - psraw mm0, 11 ; sign extended shift right by 3 - punpckhbw mm7, mm2 ; a0b0c0d0 - psraw mm7, 11 ; sign extended shift right by 3 - packsswb mm0, mm7 ; Filter2 >>=3; - - ; mm0= filter2 mm1 = vp8_filter, mm3 =qs0 mm5=s mm4 =hev mm6=ps0 - psubsb mm3, mm0 ; qs0 =qs0 - filter1 - paddsb mm6, mm5 ; ps0 =ps0 + Fitler2 - - ; mm1=vp8_filter, mm3=qs0, mm4 =hev mm6=ps0 - ; vp8_filter &= ~hev; - ; Filter2 = vp8_filter; - pandn mm4, mm1 ; vp8_filter&=~hev - - - ; mm3=qs0, mm4=filter2, mm6=ps0 - - ; u = vp8_signed_char_clamp((63 + Filter2 * 27)>>7); - ; s = vp8_signed_char_clamp(qs0 - u); - ; *oq0 = s^0x80; - ; s = vp8_signed_char_clamp(ps0 + u); - ; *op0 = s^0x80; - pxor mm0, mm0 - - pxor mm1, mm1 - pxor mm2, mm2 - punpcklbw mm1, mm4 - punpckhbw mm2, mm4 - pmulhw mm1, [GLOBAL(s27)] - pmulhw mm2, [GLOBAL(s27)] - paddw mm1, [GLOBAL(s63)] - paddw mm2, [GLOBAL(s63)] - psraw mm1, 7 - psraw mm2, 7 - packsswb mm1, mm2 - - psubsb mm3, mm1 - paddsb mm6, mm1 - - pxor mm3, [GLOBAL(t80)] - pxor mm6, [GLOBAL(t80)] - movq [rsi+rax], mm6 - movq [rsi], mm3 - - ; roughly 2/7th difference across boundary - ; u = vp8_signed_char_clamp((63 + Filter2 * 18)>>7); - ; s = vp8_signed_char_clamp(qs1 - u); - ; *oq1 = s^0x80; - ; s = vp8_signed_char_clamp(ps1 + u); - ; *op1 = s^0x80; - pxor mm1, mm1 - pxor mm2, mm2 - punpcklbw mm1, mm4 - punpckhbw mm2, mm4 - pmulhw mm1, [GLOBAL(s18)] - pmulhw mm2, [GLOBAL(s18)] - paddw mm1, [GLOBAL(s63)] - paddw mm2, [GLOBAL(s63)] - psraw mm1, 7 - psraw mm2, 7 - packsswb mm1, mm2 - - movq mm3, [rdi] - movq mm6, [rsi+rax*2] ; p1 - - pxor mm3, [GLOBAL(t80)] - pxor mm6, [GLOBAL(t80)] - - paddsb mm6, mm1 - psubsb mm3, mm1 - - pxor mm6, [GLOBAL(t80)] - pxor mm3, [GLOBAL(t80)] - movq [rdi], mm3 - movq [rsi+rax*2], mm6 - - ; roughly 1/7th difference across boundary - ; u = vp8_signed_char_clamp((63 + Filter2 * 9)>>7); - ; s = vp8_signed_char_clamp(qs2 - u); - ; *oq2 = s^0x80; - ; s = vp8_signed_char_clamp(ps2 + u); - ; *op2 = s^0x80; - pxor mm1, mm1 - pxor mm2, mm2 - punpcklbw mm1, mm4 - punpckhbw mm2, mm4 - pmulhw mm1, [GLOBAL(s9)] - pmulhw mm2, [GLOBAL(s9)] - paddw mm1, [GLOBAL(s63)] - paddw mm2, [GLOBAL(s63)] - psraw mm1, 7 - psraw mm2, 7 - packsswb mm1, mm2 - - - movq mm6, [rdi+rax*4] - neg rax - movq mm3, [rdi+rax ] - - pxor mm6, [GLOBAL(t80)] - pxor mm3, [GLOBAL(t80)] - - paddsb mm6, mm1 - psubsb mm3, mm1 - - pxor mm6, [GLOBAL(t80)] - pxor mm3, [GLOBAL(t80)] - movq [rdi+rax ], mm3 - neg rax - movq [rdi+rax*4], mm6 - -;EARLY_BREAK_OUT: - neg rax - add rsi,8 - dec rcx - jnz .next8_mbh - - add rsp, 32 - pop rsp - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_mbloop_filter_vertical_edge_mmx -;( -; unsigned char *src_ptr, -; int src_pixel_step, -; const char *blimit, -; const char *limit, -; const char *thresh, -; int count -;) -global sym(vp8_mbloop_filter_vertical_edge_mmx) PRIVATE -sym(vp8_mbloop_filter_vertical_edge_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, 96 ; reserve 96 bytes - %define t0 [rsp + 0] ;__declspec(align(16)) char t0[8]; - %define t1 [rsp + 16] ;__declspec(align(16)) char t1[8]; - %define srct [rsp + 32] ;__declspec(align(16)) char srct[64]; - - mov rsi, arg(0) ;src_ptr - movsxd rax, dword ptr arg(1) ;src_pixel_step ; destination pitch? - - lea rsi, [rsi + rax*4 - 4] - - movsxd rcx, dword ptr arg(5) ;count -.next8_mbv: - lea rdi, [rsi + rax] ; rdi points to row +1 for indirect addressing - - ;transpose - movq mm0, [rdi+2*rax] ; 77 76 75 74 73 72 71 70 - movq mm6, [rsi+2*rax] ; 67 66 65 64 63 62 61 60 - - movq mm7, mm6 ; 77 76 75 74 73 72 71 70 - punpckhbw mm7, mm0 ; 77 67 76 66 75 65 74 64 - - punpcklbw mm6, mm0 ; 73 63 72 62 71 61 70 60 - movq mm0, [rsi+rax] ; 57 56 55 54 53 52 51 50 - - movq mm4, [rsi] ; 47 46 45 44 43 42 41 40 - movq mm5, mm4 ; 47 46 45 44 43 42 41 40 - - punpckhbw mm5, mm0 ; 57 47 56 46 55 45 54 44 - punpcklbw mm4, mm0 ; 53 43 52 42 51 41 50 40 - - movq mm3, mm5 ; 57 47 56 46 55 45 54 44 - punpckhwd mm5, mm7 ; 77 67 57 47 76 66 56 46 - - punpcklwd mm3, mm7 ; 75 65 55 45 74 64 54 44 - movq mm2, mm4 ; 53 43 52 42 51 41 50 40 - - punpckhwd mm4, mm6 ; 73 63 53 43 72 62 52 42 - punpcklwd mm2, mm6 ; 71 61 51 41 70 60 50 40 - - neg rax - - movq mm7, [rsi+rax] ; 37 36 35 34 33 32 31 30 - movq mm6, [rsi+rax*2] ; 27 26 25 24 23 22 21 20 - - movq mm1, mm6 ; 27 26 25 24 23 22 21 20 - punpckhbw mm6, mm7 ; 37 27 36 36 35 25 34 24 - - punpcklbw mm1, mm7 ; 33 23 32 22 31 21 30 20 - - movq mm7, [rsi+rax*4]; ; 07 06 05 04 03 02 01 00 - punpckhbw mm7, [rdi+rax*4] ; 17 07 16 06 15 05 14 04 - - movq mm0, mm7 ; 17 07 16 06 15 05 14 04 - punpckhwd mm7, mm6 ; 37 27 17 07 36 26 16 06 - - punpcklwd mm0, mm6 ; 35 25 15 05 34 24 14 04 - movq mm6, mm7 ; 37 27 17 07 36 26 16 06 - - punpckhdq mm7, mm5 ; 77 67 57 47 37 27 17 07 = q3 - punpckldq mm6, mm5 ; 76 66 56 46 36 26 16 06 = q2 - - lea rdx, srct - movq mm5, mm6 ; 76 66 56 46 36 26 16 06 - - movq [rdx+56], mm7 - psubusb mm5, mm7 ; q2-q3 - - - movq [rdx+48], mm6 - psubusb mm7, mm6 ; q3-q2 - - por mm7, mm5; ; mm7=abs (q3-q2) - movq mm5, mm0 ; 35 25 15 05 34 24 14 04 - - punpckhdq mm5, mm3 ; 75 65 55 45 35 25 15 05 = q1 - punpckldq mm0, mm3 ; 74 64 54 44 34 24 15 04 = q0 - - movq mm3, mm5 ; 75 65 55 45 35 25 15 05 = q1 - psubusb mm3, mm6 ; q1-q2 - - psubusb mm6, mm5 ; q2-q1 - por mm6, mm3 ; mm6=abs(q2-q1) - - movq [rdx+40], mm5 ; save q1 - movq [rdx+32], mm0 ; save q0 - - movq mm3, [rsi+rax*4] ; 07 06 05 04 03 02 01 00 - punpcklbw mm3, [rdi+rax*4] ; 13 03 12 02 11 01 10 00 - - movq mm0, mm3 ; 13 03 12 02 11 01 10 00 - punpcklwd mm0, mm1 ; 31 21 11 01 30 20 10 00 - - punpckhwd mm3, mm1 ; 33 23 13 03 32 22 12 02 - movq mm1, mm0 ; 31 21 11 01 30 20 10 00 - - punpckldq mm0, mm2 ; 70 60 50 40 30 20 10 00 =p3 - punpckhdq mm1, mm2 ; 71 61 51 41 31 21 11 01 =p2 - - movq [rdx], mm0 ; save p3 - movq [rdx+8], mm1 ; save p2 - - movq mm2, mm1 ; 71 61 51 41 31 21 11 01 =p2 - psubusb mm2, mm0 ; p2-p3 - - psubusb mm0, mm1 ; p3-p2 - por mm0, mm2 ; mm0=abs(p3-p2) - - movq mm2, mm3 ; 33 23 13 03 32 22 12 02 - punpckldq mm2, mm4 ; 72 62 52 42 32 22 12 02 = p1 - - punpckhdq mm3, mm4 ; 73 63 53 43 33 23 13 03 = p0 - movq [rdx+24], mm3 ; save p0 - - movq [rdx+16], mm2 ; save p1 - movq mm5, mm2 ; mm5 = p1 - - psubusb mm2, mm1 ; p1-p2 - psubusb mm1, mm5 ; p2-p1 - - por mm1, mm2 ; mm1=abs(p2-p1) - mov rdx, arg(3) ;limit - - movq mm4, [rdx] ; mm4 = limit - psubusb mm7, mm4 ; abs(q3-q2) > limit - - psubusb mm0, mm4 ; abs(p3-p2) > limit - psubusb mm1, mm4 ; abs(p2-p1) > limit - - psubusb mm6, mm4 ; abs(q2-q1) > limit - por mm7, mm6 ; or - - por mm0, mm1 ; - por mm0, mm7 ; abs(q3-q2) > limit || abs(p3-p2) > limit ||abs(p2-p1) > limit || abs(q2-q1) > limit - - movq mm1, mm5 ; p1 - - movq mm7, mm3 ; mm3=mm7=p0 - psubusb mm7, mm5 ; p0 - p1 - - psubusb mm5, mm3 ; p1 - p0 - por mm5, mm7 ; abs(p1-p0) - - movq t0, mm5 ; save abs(p1-p0) - lea rdx, srct - - psubusb mm5, mm4 ; mm5 = abs(p1-p0) > limit - por mm0, mm5 ; mm0=mask - - movq mm5, [rdx+32] ; mm5=q0 - movq mm7, [rdx+40] ; mm7=q1 - - movq mm6, mm5 ; mm6=q0 - movq mm2, mm7 ; q1 - psubusb mm5, mm7 ; q0-q1 - - psubusb mm7, mm6 ; q1-q0 - por mm7, mm5 ; abs(q1-q0) - - movq t1, mm7 ; save abs(q1-q0) - psubusb mm7, mm4 ; mm7=abs(q1-q0)> limit - - por mm0, mm7 ; mask - - movq mm5, mm2 ; q1 - psubusb mm5, mm1 ; q1-=p1 - psubusb mm1, mm2 ; p1-=q1 - por mm5, mm1 ; abs(p1-q1) - pand mm5, [GLOBAL(tfe)] ; set lsb of each byte to zero - psrlw mm5, 1 ; abs(p1-q1)/2 - - mov rdx, arg(2) ;blimit ; - - movq mm4, [rdx] ;blimit - movq mm1, mm3 ; mm1=mm3=p0 - - movq mm7, mm6 ; mm7=mm6=q0 - psubusb mm1, mm7 ; p0-q0 - - psubusb mm7, mm3 ; q0-p0 - por mm1, mm7 ; abs(q0-p0) - paddusb mm1, mm1 ; abs(q0-p0)*2 - paddusb mm1, mm5 ; abs (p0 - q0) *2 + abs(p1-q1)/2 - - psubusb mm1, mm4 ; abs (p0 - q0) *2 + abs(p1-q1)/2 > blimit - por mm1, mm0; ; mask - - pxor mm0, mm0 - pcmpeqb mm1, mm0 - - ; calculate high edge variance - mov rdx, arg(4) ;thresh ; get thresh - movq mm7, [rdx] - ; - movq mm4, t0 ; get abs (q1 - q0) - psubusb mm4, mm7 ; abs(q1 - q0) > thresh - - movq mm3, t1 ; get abs (p1 - p0) - psubusb mm3, mm7 ; abs(p1 - p0)> thresh - - por mm4, mm3 ; abs(q1 - q0) > thresh || abs(p1 - p0) > thresh - pcmpeqb mm4, mm0 - - pcmpeqb mm0, mm0 - pxor mm4, mm0 - - - - - ; start work on filters - lea rdx, srct - - ; start work on filters - movq mm2, [rdx+16] ; p1 - movq mm7, [rdx+40] ; q1 - pxor mm2, [GLOBAL(t80)] ; p1 offset to convert to signed values - pxor mm7, [GLOBAL(t80)] ; q1 offset to convert to signed values - psubsb mm2, mm7 ; p1 - q1 - - movq mm6, [rdx+24] ; p0 - movq mm0, [rdx+32] ; q0 - pxor mm6, [GLOBAL(t80)] ; offset to convert to signed values - pxor mm0, [GLOBAL(t80)] ; offset to convert to signed values - - movq mm3, mm0 ; q0 - psubsb mm0, mm6 ; q0 - p0 - paddsb mm2, mm0 ; 1 * (q0 - p0) + (p1 - q1) - paddsb mm2, mm0 ; 2 * (q0 - p0) - paddsb mm2, mm0 ; 3 * (q0 - p0) + (p1 - q1) - pand mm1, mm2 ; mask filter values we don't care about - - ; mm1 = vp8_filter, mm4=hev, mm6=ps0, mm3=qs0 - movq mm2, mm1 ; vp8_filter - pand mm2, mm4; ; Filter2 = vp8_filter & hev - - movq mm5, mm2 ; - paddsb mm5, [GLOBAL(t3)]; - - pxor mm0, mm0 ; 0 - pxor mm7, mm7 ; 0 - - punpcklbw mm0, mm5 ; e0f0g0h0 - psraw mm0, 11 ; sign extended shift right by 3 - punpckhbw mm7, mm5 ; a0b0c0d0 - psraw mm7, 11 ; sign extended shift right by 3 - packsswb mm0, mm7 ; Filter2 >>=3; - - movq mm5, mm0 ; Filter2 - - paddsb mm2, [GLOBAL(t4)] ; vp8_signed_char_clamp(Filter2 + 4) - pxor mm0, mm0 ; 0 - pxor mm7, mm7 ; 0 - - punpcklbw mm0, mm2 ; e0f0g0h0 - psraw mm0, 11 ; sign extended shift right by 3 - punpckhbw mm7, mm2 ; a0b0c0d0 - psraw mm7, 11 ; sign extended shift right by 3 - packsswb mm0, mm7 ; Filter2 >>=3; - - ; mm0= filter2 mm1 = vp8_filter, mm3 =qs0 mm5=s mm4 =hev mm6=ps0 - psubsb mm3, mm0 ; qs0 =qs0 - filter1 - paddsb mm6, mm5 ; ps0 =ps0 + Fitler2 - - ; mm1=vp8_filter, mm3=qs0, mm4 =hev mm6=ps0 - ; vp8_filter &= ~hev; - ; Filter2 = vp8_filter; - pandn mm4, mm1 ; vp8_filter&=~hev - - - ; mm3=qs0, mm4=filter2, mm6=ps0 - - ; u = vp8_signed_char_clamp((63 + Filter2 * 27)>>7); - ; s = vp8_signed_char_clamp(qs0 - u); - ; *oq0 = s^0x80; - ; s = vp8_signed_char_clamp(ps0 + u); - ; *op0 = s^0x80; - pxor mm0, mm0 - - pxor mm1, mm1 - pxor mm2, mm2 - punpcklbw mm1, mm4 - punpckhbw mm2, mm4 - pmulhw mm1, [GLOBAL(s27)] - pmulhw mm2, [GLOBAL(s27)] - paddw mm1, [GLOBAL(s63)] - paddw mm2, [GLOBAL(s63)] - psraw mm1, 7 - psraw mm2, 7 - packsswb mm1, mm2 - - psubsb mm3, mm1 - paddsb mm6, mm1 - - pxor mm3, [GLOBAL(t80)] - pxor mm6, [GLOBAL(t80)] - movq [rdx+24], mm6 - movq [rdx+32], mm3 - - ; roughly 2/7th difference across boundary - ; u = vp8_signed_char_clamp((63 + Filter2 * 18)>>7); - ; s = vp8_signed_char_clamp(qs1 - u); - ; *oq1 = s^0x80; - ; s = vp8_signed_char_clamp(ps1 + u); - ; *op1 = s^0x80; - pxor mm1, mm1 - pxor mm2, mm2 - punpcklbw mm1, mm4 - punpckhbw mm2, mm4 - pmulhw mm1, [GLOBAL(s18)] - pmulhw mm2, [GLOBAL(s18)] - paddw mm1, [GLOBAL(s63)] - paddw mm2, [GLOBAL(s63)] - psraw mm1, 7 - psraw mm2, 7 - packsswb mm1, mm2 - - movq mm3, [rdx + 40] - movq mm6, [rdx + 16] ; p1 - pxor mm3, [GLOBAL(t80)] - pxor mm6, [GLOBAL(t80)] - - paddsb mm6, mm1 - psubsb mm3, mm1 - - pxor mm6, [GLOBAL(t80)] - pxor mm3, [GLOBAL(t80)] - movq [rdx + 40], mm3 - movq [rdx + 16], mm6 - - ; roughly 1/7th difference across boundary - ; u = vp8_signed_char_clamp((63 + Filter2 * 9)>>7); - ; s = vp8_signed_char_clamp(qs2 - u); - ; *oq2 = s^0x80; - ; s = vp8_signed_char_clamp(ps2 + u); - ; *op2 = s^0x80; - pxor mm1, mm1 - pxor mm2, mm2 - punpcklbw mm1, mm4 - punpckhbw mm2, mm4 - pmulhw mm1, [GLOBAL(s9)] - pmulhw mm2, [GLOBAL(s9)] - paddw mm1, [GLOBAL(s63)] - paddw mm2, [GLOBAL(s63)] - psraw mm1, 7 - psraw mm2, 7 - packsswb mm1, mm2 - - movq mm6, [rdx+ 8] - movq mm3, [rdx+48] - - pxor mm6, [GLOBAL(t80)] - pxor mm3, [GLOBAL(t80)] - - paddsb mm6, mm1 - psubsb mm3, mm1 - - pxor mm6, [GLOBAL(t80)] ; mm6 = 71 61 51 41 31 21 11 01 - pxor mm3, [GLOBAL(t80)] ; mm3 = 76 66 56 46 36 26 15 06 - - ; transpose and write back - movq mm0, [rdx] ; mm0 = 70 60 50 40 30 20 10 00 - movq mm1, mm0 ; mm0 = 70 60 50 40 30 20 10 00 - - punpcklbw mm0, mm6 ; mm0 = 31 30 21 20 11 10 01 00 - punpckhbw mm1, mm6 ; mm3 = 71 70 61 60 51 50 41 40 - - movq mm2, [rdx+16] ; mm2 = 72 62 52 42 32 22 12 02 - movq mm6, mm2 ; mm3 = 72 62 52 42 32 22 12 02 - - punpcklbw mm2, [rdx+24] ; mm2 = 33 32 23 22 13 12 03 02 - punpckhbw mm6, [rdx+24] ; mm3 = 73 72 63 62 53 52 43 42 - - movq mm5, mm0 ; mm5 = 31 30 21 20 11 10 01 00 - punpcklwd mm0, mm2 ; mm0 = 13 12 11 10 03 02 01 00 - - punpckhwd mm5, mm2 ; mm5 = 33 32 31 30 23 22 21 20 - movq mm4, mm1 ; mm4 = 71 70 61 60 51 50 41 40 - - punpcklwd mm1, mm6 ; mm1 = 53 52 51 50 43 42 41 40 - punpckhwd mm4, mm6 ; mm4 = 73 72 71 70 63 62 61 60 - - movq mm2, [rdx+32] ; mm2 = 74 64 54 44 34 24 14 04 - punpcklbw mm2, [rdx+40] ; mm2 = 35 34 25 24 15 14 05 04 - - movq mm6, mm3 ; mm6 = 76 66 56 46 36 26 15 06 - punpcklbw mm6, [rdx+56] ; mm6 = 37 36 27 26 17 16 07 06 - - movq mm7, mm2 ; mm7 = 35 34 25 24 15 14 05 04 - punpcklwd mm2, mm6 ; mm2 = 17 16 15 14 07 06 05 04 - - punpckhwd mm7, mm6 ; mm7 = 37 36 35 34 27 26 25 24 - movq mm6, mm0 ; mm6 = 13 12 11 10 03 02 01 00 - - punpckldq mm0, mm2 ; mm0 = 07 06 05 04 03 02 01 00 - punpckhdq mm6, mm2 ; mm6 = 17 16 15 14 13 12 11 10 - - movq [rsi+rax*4], mm0 ; write out - movq [rdi+rax*4], mm6 ; write out - - movq mm0, mm5 ; mm0 = 33 32 31 30 23 22 21 20 - punpckldq mm0, mm7 ; mm0 = 27 26 25 24 23 22 20 20 - - punpckhdq mm5, mm7 ; mm5 = 37 36 35 34 33 32 31 30 - movq [rsi+rax*2], mm0 ; write out - - movq [rdi+rax*2], mm5 ; write out - movq mm2, [rdx+32] ; mm2 = 74 64 54 44 34 24 14 04 - - punpckhbw mm2, [rdx+40] ; mm2 = 75 74 65 64 54 54 45 44 - punpckhbw mm3, [rdx+56] ; mm3 = 77 76 67 66 57 56 47 46 - - movq mm5, mm2 ; mm5 = 75 74 65 64 54 54 45 44 - punpcklwd mm2, mm3 ; mm2 = 57 56 55 54 47 46 45 44 - - punpckhwd mm5, mm3 ; mm5 = 77 76 75 74 67 66 65 64 - movq mm0, mm1 ; mm0= 53 52 51 50 43 42 41 40 - - movq mm3, mm4 ; mm4 = 73 72 71 70 63 62 61 60 - punpckldq mm0, mm2 ; mm0 = 47 46 45 44 43 42 41 40 - - punpckhdq mm1, mm2 ; mm1 = 57 56 55 54 53 52 51 50 - movq [rsi], mm0 ; write out - - movq [rdi], mm1 ; write out - neg rax - - punpckldq mm3, mm5 ; mm3 = 67 66 65 64 63 62 61 60 - punpckhdq mm4, mm5 ; mm4 = 77 76 75 74 73 72 71 60 - - movq [rsi+rax*2], mm3 - movq [rdi+rax*2], mm4 - - lea rsi, [rsi+rax*8] - dec rcx - - jnz .next8_mbv - - add rsp, 96 - pop rsp - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_loop_filter_simple_horizontal_edge_mmx -;( -; unsigned char *src_ptr, -; int src_pixel_step, -; const char *blimit -;) -global sym(vp8_loop_filter_simple_horizontal_edge_mmx) PRIVATE -sym(vp8_loop_filter_simple_horizontal_edge_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 3 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - movsxd rax, dword ptr arg(1) ;src_pixel_step ; destination pitch? - - mov rcx, 2 ; count -.nexts8_h: - mov rdx, arg(2) ;blimit ; get blimit - movq mm3, [rdx] ; - - mov rdi, rsi ; rdi points to row +1 for indirect addressing - add rdi, rax - neg rax - - ; calculate mask - movq mm1, [rsi+2*rax] ; p1 - movq mm0, [rdi] ; q1 - movq mm2, mm1 - movq mm7, mm0 - movq mm4, mm0 - psubusb mm0, mm1 ; q1-=p1 - psubusb mm1, mm4 ; p1-=q1 - por mm1, mm0 ; abs(p1-q1) - pand mm1, [GLOBAL(tfe)] ; set lsb of each byte to zero - psrlw mm1, 1 ; abs(p1-q1)/2 - - movq mm5, [rsi+rax] ; p0 - movq mm4, [rsi] ; q0 - movq mm0, mm4 ; q0 - movq mm6, mm5 ; p0 - psubusb mm5, mm4 ; p0-=q0 - psubusb mm4, mm6 ; q0-=p0 - por mm5, mm4 ; abs(p0 - q0) - paddusb mm5, mm5 ; abs(p0-q0)*2 - paddusb mm5, mm1 ; abs (p0 - q0) *2 + abs(p1-q1)/2 - - psubusb mm5, mm3 ; abs(p0 - q0) *2 + abs(p1-q1)/2 > blimit - pxor mm3, mm3 - pcmpeqb mm5, mm3 - - ; start work on filters - pxor mm2, [GLOBAL(t80)] ; p1 offset to convert to signed values - pxor mm7, [GLOBAL(t80)] ; q1 offset to convert to signed values - psubsb mm2, mm7 ; p1 - q1 - - pxor mm6, [GLOBAL(t80)] ; offset to convert to signed values - pxor mm0, [GLOBAL(t80)] ; offset to convert to signed values - movq mm3, mm0 ; q0 - psubsb mm0, mm6 ; q0 - p0 - paddsb mm2, mm0 ; p1 - q1 + 1 * (q0 - p0) - paddsb mm2, mm0 ; p1 - q1 + 2 * (q0 - p0) - paddsb mm2, mm0 ; p1 - q1 + 3 * (q0 - p0) - pand mm5, mm2 ; mask filter values we don't care about - - ; do + 4 side - paddsb mm5, [GLOBAL(t4)] ; 3* (q0 - p0) + (p1 - q1) + 4 - - movq mm0, mm5 ; get a copy of filters - psllw mm0, 8 ; shift left 8 - psraw mm0, 3 ; arithmetic shift right 11 - psrlw mm0, 8 - movq mm1, mm5 ; get a copy of filters - psraw mm1, 11 ; arithmetic shift right 11 - psllw mm1, 8 ; shift left 8 to put it back - - por mm0, mm1 ; put the two together to get result - - psubsb mm3, mm0 ; q0-= q0 add - pxor mm3, [GLOBAL(t80)] ; unoffset - movq [rsi], mm3 ; write back - - - ; now do +3 side - psubsb mm5, [GLOBAL(t1s)] ; +3 instead of +4 - - movq mm0, mm5 ; get a copy of filters - psllw mm0, 8 ; shift left 8 - psraw mm0, 3 ; arithmetic shift right 11 - psrlw mm0, 8 - psraw mm5, 11 ; arithmetic shift right 11 - psllw mm5, 8 ; shift left 8 to put it back - por mm0, mm5 ; put the two together to get result - - - paddsb mm6, mm0 ; p0+= p0 add - pxor mm6, [GLOBAL(t80)] ; unoffset - movq [rsi+rax], mm6 ; write back - - add rsi,8 - neg rax - dec rcx - jnz .nexts8_h - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_loop_filter_simple_vertical_edge_mmx -;( -; unsigned char *src_ptr, -; int src_pixel_step, -; const char *blimit -;) -global sym(vp8_loop_filter_simple_vertical_edge_mmx) PRIVATE -sym(vp8_loop_filter_simple_vertical_edge_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 3 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, 32 ; reserve 32 bytes - %define t0 [rsp + 0] ;__declspec(align(16)) char t0[8]; - %define t1 [rsp + 16] ;__declspec(align(16)) char t1[8]; - - mov rsi, arg(0) ;src_ptr - movsxd rax, dword ptr arg(1) ;src_pixel_step ; destination pitch? - - lea rsi, [rsi + rax*4- 2]; ; - mov rcx, 2 ; count -.nexts8_v: - - lea rdi, [rsi + rax]; - movd mm0, [rdi + rax * 2] ; xx xx xx xx 73 72 71 70 - - movd mm6, [rsi + rax * 2] ; xx xx xx xx 63 62 61 60 - punpcklbw mm6, mm0 ; 73 63 72 62 71 61 70 60 - - movd mm0, [rsi + rax] ; xx xx xx xx 53 52 51 50 - movd mm4, [rsi] ; xx xx xx xx 43 42 41 40 - - punpcklbw mm4, mm0 ; 53 43 52 42 51 41 50 40 - movq mm5, mm4 ; 53 43 52 42 51 41 50 40 - - punpcklwd mm4, mm6 ; 71 61 51 41 70 60 50 40 - punpckhwd mm5, mm6 ; 73 63 53 43 72 62 52 42 - - neg rax - - movd mm7, [rsi + rax] ; xx xx xx xx 33 32 31 30 - movd mm6, [rsi + rax * 2] ; xx xx xx xx 23 22 21 20 - - punpcklbw mm6, mm7 ; 33 23 32 22 31 21 30 20 - movd mm1, [rdi + rax * 4] ; xx xx xx xx 13 12 11 10 - - movd mm0, [rsi + rax * 4] ; xx xx xx xx 03 02 01 00 - punpcklbw mm0, mm1 ; 13 03 12 02 11 01 10 00 - - movq mm2, mm0 ; 13 03 12 02 11 01 10 00 - punpcklwd mm0, mm6 ; 31 21 11 01 30 20 10 00 - - punpckhwd mm2, mm6 ; 33 23 13 03 32 22 12 02 - movq mm1, mm0 ; 13 03 12 02 11 01 10 00 - - punpckldq mm0, mm4 ; 70 60 50 40 30 20 10 00 = p1 - movq mm3, mm2 ; 33 23 13 03 32 22 12 02 - - punpckhdq mm1, mm4 ; 71 61 51 41 31 21 11 01 = p0 - punpckldq mm2, mm5 ; 72 62 52 42 32 22 12 02 = q0 - - punpckhdq mm3, mm5 ; 73 63 53 43 33 23 13 03 = q1 - - - ; calculate mask - movq mm6, mm0 ; p1 - movq mm7, mm3 ; q1 - psubusb mm7, mm6 ; q1-=p1 - psubusb mm6, mm3 ; p1-=q1 - por mm6, mm7 ; abs(p1-q1) - pand mm6, [GLOBAL(tfe)] ; set lsb of each byte to zero - psrlw mm6, 1 ; abs(p1-q1)/2 - - movq mm5, mm1 ; p0 - movq mm4, mm2 ; q0 - - psubusb mm5, mm2 ; p0-=q0 - psubusb mm4, mm1 ; q0-=p0 - - por mm5, mm4 ; abs(p0 - q0) - paddusb mm5, mm5 ; abs(p0-q0)*2 - paddusb mm5, mm6 ; abs (p0 - q0) *2 + abs(p1-q1)/2 - - mov rdx, arg(2) ;blimit ; get blimit - movq mm7, [rdx] - - psubusb mm5, mm7 ; abs(p0 - q0) *2 + abs(p1-q1)/2 > blimit - pxor mm7, mm7 - pcmpeqb mm5, mm7 ; mm5 = mask - - ; start work on filters - movq t0, mm0 - movq t1, mm3 - - pxor mm0, [GLOBAL(t80)] ; p1 offset to convert to signed values - pxor mm3, [GLOBAL(t80)] ; q1 offset to convert to signed values - - psubsb mm0, mm3 ; p1 - q1 - movq mm6, mm1 ; p0 - - movq mm7, mm2 ; q0 - pxor mm6, [GLOBAL(t80)] ; offset to convert to signed values - - pxor mm7, [GLOBAL(t80)] ; offset to convert to signed values - movq mm3, mm7 ; offseted ; q0 - - psubsb mm7, mm6 ; q0 - p0 - paddsb mm0, mm7 ; p1 - q1 + 1 * (q0 - p0) - - paddsb mm0, mm7 ; p1 - q1 + 2 * (q0 - p0) - paddsb mm0, mm7 ; p1 - q1 + 3 * (q0 - p0) - - pand mm5, mm0 ; mask filter values we don't care about - - paddsb mm5, [GLOBAL(t4)] ; 3* (q0 - p0) + (p1 - q1) + 4 - - movq mm0, mm5 ; get a copy of filters - psllw mm0, 8 ; shift left 8 - psraw mm0, 3 ; arithmetic shift right 11 - psrlw mm0, 8 - - movq mm7, mm5 ; get a copy of filters - psraw mm7, 11 ; arithmetic shift right 11 - psllw mm7, 8 ; shift left 8 to put it back - - por mm0, mm7 ; put the two together to get result - - psubsb mm3, mm0 ; q0-= q0sz add - pxor mm3, [GLOBAL(t80)] ; unoffset - - ; now do +3 side - psubsb mm5, [GLOBAL(t1s)] ; +3 instead of +4 - - movq mm0, mm5 ; get a copy of filters - psllw mm0, 8 ; shift left 8 - psraw mm0, 3 ; arithmetic shift right 11 - psrlw mm0, 8 - - psraw mm5, 11 ; arithmetic shift right 11 - psllw mm5, 8 ; shift left 8 to put it back - por mm0, mm5 ; put the two together to get result - - paddsb mm6, mm0 ; p0+= p0 add - pxor mm6, [GLOBAL(t80)] ; unoffset - - - movq mm0, t0 - movq mm4, t1 - - ; mm0 = 70 60 50 40 30 20 10 00 - ; mm6 = 71 61 51 41 31 21 11 01 - ; mm3 = 72 62 52 42 32 22 12 02 - ; mm4 = 73 63 53 43 33 23 13 03 - ; transpose back to write out - - movq mm1, mm0 ; - punpcklbw mm0, mm6 ; 31 30 21 20 11 10 01 00 - - punpckhbw mm1, mm6 ; 71 70 61 60 51 50 41 40 - movq mm2, mm3 ; - - punpcklbw mm2, mm4 ; 33 32 23 22 13 12 03 02 - movq mm5, mm1 ; 71 70 61 60 51 50 41 40 - - punpckhbw mm3, mm4 ; 73 72 63 62 53 52 43 42 - movq mm6, mm0 ; 31 30 21 20 11 10 01 00 - - punpcklwd mm0, mm2 ; 13 12 11 10 03 02 01 00 - punpckhwd mm6, mm2 ; 33 32 31 30 23 22 21 20 - - movd [rsi+rax*4], mm0 ; write 03 02 01 00 - punpcklwd mm1, mm3 ; 53 52 51 50 43 42 41 40 - - psrlq mm0, 32 ; xx xx xx xx 13 12 11 10 - punpckhwd mm5, mm3 ; 73 72 71 70 63 62 61 60 - - movd [rdi+rax*4], mm0 ; write 13 12 11 10 - movd [rsi+rax*2], mm6 ; write 23 22 21 20 - - psrlq mm6, 32 ; 33 32 31 30 - movd [rsi], mm1 ; write 43 42 41 40 - - movd [rsi + rax], mm6 ; write 33 32 31 30 - neg rax - - movd [rsi + rax*2], mm5 ; write 63 62 61 60 - psrlq mm1, 32 ; 53 52 51 50 - - movd [rdi], mm1 ; write out 53 52 51 50 - psrlq mm5, 32 ; 73 72 71 70 - - movd [rdi + rax*2], mm5 ; write 73 72 71 70 - - lea rsi, [rsi+rax*8] ; next 8 - - dec rcx - jnz .nexts8_v - - add rsp, 32 - pop rsp - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - - - -;void fast_loop_filter_vertical_edges_mmx(unsigned char *y_ptr, -; int y_stride, -; loop_filter_info *lfi) -;{ -; -; -; vp8_loop_filter_simple_vertical_edge_mmx(y_ptr+4, y_stride, lfi->flim,lfi->lim,lfi->thr,2); -; vp8_loop_filter_simple_vertical_edge_mmx(y_ptr+8, y_stride, lfi->flim,lfi->lim,lfi->thr,2); -; vp8_loop_filter_simple_vertical_edge_mmx(y_ptr+12, y_stride, lfi->flim,lfi->lim,lfi->thr,2); -;} - -SECTION_RODATA -align 16 -tfe: - times 8 db 0xfe -align 16 -t80: - times 8 db 0x80 -align 16 -t1s: - times 8 db 0x01 -align 16 -t3: - times 8 db 0x03 -align 16 -t4: - times 8 db 0x04 -align 16 -ones: - times 4 dw 0x0001 -align 16 -s27: - times 4 dw 0x1b00 -align 16 -s18: - times 4 dw 0x1200 -align 16 -s9: - times 4 dw 0x0900 -align 16 -s63: - times 4 dw 0x003f diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/loopfilter_sse2.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/loopfilter_sse2.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/loopfilter_sse2.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/loopfilter_sse2.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,1640 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" -%define _t0 0 -%define _t1 _t0 + 16 -%define _p3 _t1 + 16 -%define _p2 _p3 + 16 -%define _p1 _p2 + 16 -%define _p0 _p1 + 16 -%define _q0 _p0 + 16 -%define _q1 _q0 + 16 -%define _q2 _q1 + 16 -%define _q3 _q2 + 16 -%define lf_var_size 160 - -; Use of pmaxub instead of psubusb to compute filter mask was seen -; in ffvp8 - -%macro LFH_FILTER_AND_HEV_MASK 1 -%if %1 - movdqa xmm2, [rdi+2*rax] ; q3 - movdqa xmm1, [rsi+2*rax] ; q2 - movdqa xmm4, [rsi+rax] ; q1 - movdqa xmm5, [rsi] ; q0 - neg rax ; negate pitch to deal with above border -%else - movlps xmm2, [rsi + rcx*2] ; q3 - movlps xmm1, [rsi + rcx] ; q2 - movlps xmm4, [rsi] ; q1 - movlps xmm5, [rsi + rax] ; q0 - - movhps xmm2, [rdi + rcx*2] - movhps xmm1, [rdi + rcx] - movhps xmm4, [rdi] - movhps xmm5, [rdi + rax] - - lea rsi, [rsi + rax*4] - lea rdi, [rdi + rax*4] - - movdqa [rsp+_q2], xmm1 ; store q2 - movdqa [rsp+_q1], xmm4 ; store q1 -%endif - movdqa xmm7, [rdx] ;limit - - movdqa xmm6, xmm1 ; q2 - movdqa xmm3, xmm4 ; q1 - - psubusb xmm1, xmm2 ; q2-=q3 - psubusb xmm2, xmm6 ; q3-=q2 - - psubusb xmm4, xmm6 ; q1-=q2 - psubusb xmm6, xmm3 ; q2-=q1 - - por xmm4, xmm6 ; abs(q2-q1) - por xmm1, xmm2 ; abs(q3-q2) - - movdqa xmm0, xmm5 ; q0 - pmaxub xmm1, xmm4 - - psubusb xmm5, xmm3 ; q0-=q1 - psubusb xmm3, xmm0 ; q1-=q0 - - por xmm5, xmm3 ; abs(q0-q1) - movdqa [rsp+_t0], xmm5 ; save to t0 - - pmaxub xmm1, xmm5 - -%if %1 - movdqa xmm2, [rsi+4*rax] ; p3 - movdqa xmm4, [rdi+4*rax] ; p2 - movdqa xmm6, [rsi+2*rax] ; p1 -%else - movlps xmm2, [rsi + rax] ; p3 - movlps xmm4, [rsi] ; p2 - movlps xmm6, [rsi + rcx] ; p1 - - movhps xmm2, [rdi + rax] - movhps xmm4, [rdi] - movhps xmm6, [rdi + rcx] - - movdqa [rsp+_p2], xmm4 ; store p2 - movdqa [rsp+_p1], xmm6 ; store p1 -%endif - - movdqa xmm5, xmm4 ; p2 - movdqa xmm3, xmm6 ; p1 - - psubusb xmm4, xmm2 ; p2-=p3 - psubusb xmm2, xmm5 ; p3-=p2 - - psubusb xmm3, xmm5 ; p1-=p2 - pmaxub xmm1, xmm4 ; abs(p3 - p2) - - psubusb xmm5, xmm6 ; p2-=p1 - pmaxub xmm1, xmm2 ; abs(p3 - p2) - - pmaxub xmm1, xmm5 ; abs(p2 - p1) - movdqa xmm2, xmm6 ; p1 - - pmaxub xmm1, xmm3 ; abs(p2 - p1) -%if %1 - movdqa xmm4, [rsi+rax] ; p0 - movdqa xmm3, [rdi] ; q1 -%else - movlps xmm4, [rsi + rcx*2] ; p0 - movhps xmm4, [rdi + rcx*2] - movdqa xmm3, [rsp+_q1] ; q1 -%endif - - movdqa xmm5, xmm4 ; p0 - psubusb xmm4, xmm6 ; p0-=p1 - - psubusb xmm6, xmm5 ; p1-=p0 - - por xmm6, xmm4 ; abs(p1 - p0) - mov rdx, arg(2) ; get blimit - - movdqa [rsp+_t1], xmm6 ; save to t1 - - movdqa xmm4, xmm3 ; q1 - pmaxub xmm1, xmm6 - - psubusb xmm3, xmm2 ; q1-=p1 - psubusb xmm2, xmm4 ; p1-=q1 - - psubusb xmm1, xmm7 - por xmm2, xmm3 ; abs(p1-q1) - - movdqa xmm7, [rdx] ; blimit - mov rdx, arg(4) ; hev get thresh - - movdqa xmm3, xmm0 ; q0 - pand xmm2, [GLOBAL(tfe)] ; set lsb of each byte to zero - - movdqa xmm6, xmm5 ; p0 - psrlw xmm2, 1 ; abs(p1-q1)/2 - - psubusb xmm5, xmm3 ; p0-=q0 - psubusb xmm3, xmm6 ; q0-=p0 - por xmm5, xmm3 ; abs(p0 - q0) - - paddusb xmm5, xmm5 ; abs(p0-q0)*2 - - movdqa xmm4, [rsp+_t0] ; hev get abs (q1 - q0) - movdqa xmm3, [rsp+_t1] ; get abs (p1 - p0) - - paddusb xmm5, xmm2 ; abs (p0 - q0) *2 + abs(p1-q1)/2 - - movdqa xmm2, [rdx] ; hev - - psubusb xmm5, xmm7 ; abs (p0 - q0) *2 + abs(p1-q1)/2 > blimit - psubusb xmm4, xmm2 ; hev - - psubusb xmm3, xmm2 ; hev - por xmm1, xmm5 - - pxor xmm7, xmm7 - paddb xmm4, xmm3 ; hev abs(q1 - q0) > thresh || abs(p1 - p0) > thresh - - pcmpeqb xmm4, xmm5 ; hev - pcmpeqb xmm3, xmm3 ; hev - - pcmpeqb xmm1, xmm7 ; mask xmm1 - pxor xmm4, xmm3 ; hev -%endmacro - -%macro B_FILTER 1 - movdqa xmm3, [GLOBAL(t80)] -%if %1 == 0 - movdqa xmm2, [rsp+_p1] ; p1 - movdqa xmm7, [rsp+_q1] ; q1 -%elif %1 == 1 - movdqa xmm2, [rsi+2*rax] ; p1 - movdqa xmm7, [rdi] ; q1 -%elif %1 == 2 - movdqa xmm2, [rsp+_p1] ; p1 - movdqa xmm6, [rsp+_p0] ; p0 - movdqa xmm0, [rsp+_q0] ; q0 - movdqa xmm7, [rsp+_q1] ; q1 -%endif - - pxor xmm2, xmm3 ; p1 offset to convert to signed values - pxor xmm7, xmm3 ; q1 offset to convert to signed values - - psubsb xmm2, xmm7 ; p1 - q1 - pxor xmm6, xmm3 ; offset to convert to signed values - - pand xmm2, xmm4 ; high var mask (hvm)(p1 - q1) - pxor xmm0, xmm3 ; offset to convert to signed values - - movdqa xmm3, xmm0 ; q0 - psubsb xmm0, xmm6 ; q0 - p0 - paddsb xmm2, xmm0 ; 1 * (q0 - p0) + hvm(p1 - q1) - paddsb xmm2, xmm0 ; 2 * (q0 - p0) + hvm(p1 - q1) - paddsb xmm2, xmm0 ; 3 * (q0 - p0) + hvm(p1 - q1) - pand xmm1, xmm2 ; mask filter values we don't care about - - movdqa xmm2, xmm1 - paddsb xmm1, [GLOBAL(t4)] ; 3* (q0 - p0) + hvm(p1 - q1) + 4 - paddsb xmm2, [GLOBAL(t3)] ; 3* (q0 - p0) + hvm(p1 - q1) + 3 - - punpckhbw xmm5, xmm2 ; axbxcxdx - punpcklbw xmm2, xmm2 ; exfxgxhx - - punpcklbw xmm0, xmm1 ; exfxgxhx - psraw xmm5, 11 ; sign extended shift right by 3 - - punpckhbw xmm1, xmm1 ; axbxcxdx - psraw xmm2, 11 ; sign extended shift right by 3 - - packsswb xmm2, xmm5 ; (3* (q0 - p0) + hvm(p1 - q1) + 3) >> 3; - psraw xmm0, 11 ; sign extended shift right by 3 - - psraw xmm1, 11 ; sign extended shift right by 3 - movdqa xmm5, xmm0 ; save results - - packsswb xmm0, xmm1 ; (3* (q0 - p0) + hvm(p1 - q1) + 4) >>3 - - paddsb xmm6, xmm2 ; p0+= p0 add - - movdqa xmm2, [GLOBAL(ones)] - paddsw xmm5, xmm2 - paddsw xmm1, xmm2 - psraw xmm5, 1 ; partial shifted one more time for 2nd tap - psraw xmm1, 1 ; partial shifted one more time for 2nd tap - packsswb xmm5, xmm1 ; (3* (q0 - p0) + hvm(p1 - q1) + 4) >>4 - movdqa xmm2, [GLOBAL(t80)] - -%if %1 == 0 - movdqa xmm1, [rsp+_p1] ; p1 - lea rsi, [rsi + rcx*2] - lea rdi, [rdi + rcx*2] -%elif %1 == 1 - movdqa xmm1, [rsi+2*rax] ; p1 -%elif %1 == 2 - movdqa xmm1, [rsp+_p1] ; p1 -%endif - - pandn xmm4, xmm5 ; high edge variance additive - pxor xmm6, xmm2 ; unoffset - - pxor xmm1, xmm2 ; reoffset - psubsb xmm3, xmm0 ; q0-= q0 add - - paddsb xmm1, xmm4 ; p1+= p1 add - pxor xmm3, xmm2 ; unoffset - - pxor xmm1, xmm2 ; unoffset - psubsb xmm7, xmm4 ; q1-= q1 add - - pxor xmm7, xmm2 ; unoffset -%if %1 == 0 - movq [rsi], xmm6 ; p0 - movhps [rdi], xmm6 - movq [rsi + rax], xmm1 ; p1 - movhps [rdi + rax], xmm1 - movq [rsi + rcx], xmm3 ; q0 - movhps [rdi + rcx], xmm3 - movq [rsi + rcx*2], xmm7 ; q1 - movhps [rdi + rcx*2], xmm7 -%elif %1 == 1 - movdqa [rsi+rax], xmm6 ; write back - movdqa [rsi+2*rax], xmm1 ; write back - movdqa [rsi], xmm3 ; write back - movdqa [rdi], xmm7 ; write back -%endif - -%endmacro - -%if ABI_IS_32BIT - -;void vp8_loop_filter_horizontal_edge_sse2 -;( -; unsigned char *src_ptr, -; int src_pixel_step, -; const char *blimit, -; const char *limit, -; const char *thresh, -;) -global sym(vp8_loop_filter_horizontal_edge_sse2) PRIVATE -sym(vp8_loop_filter_horizontal_edge_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, lf_var_size - - mov rsi, arg(0) ;src_ptr - movsxd rax, dword ptr arg(1) ;src_pixel_step - - mov rdx, arg(3) ;limit - - lea rdi, [rsi+rax] ; rdi points to row +1 for indirect addressing - - ; calculate breakout conditions and high edge variance - LFH_FILTER_AND_HEV_MASK 1 - ; filter and write back the result - B_FILTER 1 - - add rsp, lf_var_size - pop rsp - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -%endif - -;void vp8_loop_filter_horizontal_edge_uv_sse2 -;( -; unsigned char *src_ptr, -; int src_pixel_step, -; const char *blimit, -; const char *limit, -; const char *thresh, -; int count -;) -global sym(vp8_loop_filter_horizontal_edge_uv_sse2) PRIVATE -sym(vp8_loop_filter_horizontal_edge_uv_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, lf_var_size - - mov rsi, arg(0) ; u - mov rdi, arg(5) ; v - movsxd rax, dword ptr arg(1) ; src_pixel_step - mov rcx, rax - neg rax ; negate pitch to deal with above border - - mov rdx, arg(3) ;limit - - lea rsi, [rsi + rcx] - lea rdi, [rdi + rcx] - - ; calculate breakout conditions and high edge variance - LFH_FILTER_AND_HEV_MASK 0 - ; filter and write back the result - B_FILTER 0 - - add rsp, lf_var_size - pop rsp - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - -%macro MB_FILTER_AND_WRITEBACK 1 - movdqa xmm3, [GLOBAL(t80)] -%if %1 == 0 - movdqa xmm2, [rsp+_p1] ; p1 - movdqa xmm7, [rsp+_q1] ; q1 -%elif %1 == 1 - movdqa xmm2, [rsi+2*rax] ; p1 - movdqa xmm7, [rdi] ; q1 - - mov rcx, rax - neg rcx -%elif %1 == 2 - movdqa xmm2, [rsp+_p1] ; p1 - movdqa xmm6, [rsp+_p0] ; p0 - movdqa xmm0, [rsp+_q0] ; q0 - movdqa xmm7, [rsp+_q1] ; q1 -%endif - - pxor xmm2, xmm3 ; p1 offset to convert to signed values - pxor xmm7, xmm3 ; q1 offset to convert to signed values - pxor xmm6, xmm3 ; offset to convert to signed values - pxor xmm0, xmm3 ; offset to convert to signed values - - psubsb xmm2, xmm7 ; p1 - q1 - - movdqa xmm3, xmm0 ; q0 - psubsb xmm0, xmm6 ; q0 - p0 - paddsb xmm2, xmm0 ; 1 * (q0 - p0) + (p1 - q1) - paddsb xmm2, xmm0 ; 2 * (q0 - p0) - paddsb xmm2, xmm0 ; 3 * (q0 - p0) + (p1 - q1) - pand xmm1, xmm2 ; mask filter values we don't care about - - movdqa xmm2, xmm1 ; vp8_filter - - pand xmm2, xmm4 ; Filter2 = vp8_filter & hev - pxor xmm0, xmm0 - - pandn xmm4, xmm1 ; vp8_filter&=~hev - pxor xmm1, xmm1 - - punpcklbw xmm0, xmm4 ; Filter 2 (hi) - punpckhbw xmm1, xmm4 ; Filter 2 (lo) - - movdqa xmm5, xmm2 - - movdqa xmm4, [GLOBAL(s9)] - paddsb xmm5, [GLOBAL(t3)] ; vp8_signed_char_clamp(Filter2 + 3) - paddsb xmm2, [GLOBAL(t4)] ; vp8_signed_char_clamp(Filter2 + 4) - - pmulhw xmm1, xmm4 ; Filter 2 (lo) * 9 - pmulhw xmm0, xmm4 ; Filter 2 (hi) * 9 - - punpckhbw xmm7, xmm5 ; axbxcxdx - punpcklbw xmm5, xmm5 ; exfxgxhx - - psraw xmm7, 11 ; sign extended shift right by 3 - - psraw xmm5, 11 ; sign extended shift right by 3 - punpckhbw xmm4, xmm2 ; axbxcxdx - - punpcklbw xmm2, xmm2 ; exfxgxhx - psraw xmm4, 11 ; sign extended shift right by 3 - - packsswb xmm5, xmm7 ; Filter2 >>=3; - psraw xmm2, 11 ; sign extended shift right by 3 - - packsswb xmm2, xmm4 ; Filter1 >>=3; - - paddsb xmm6, xmm5 ; ps0 =ps0 + Fitler2 - - psubsb xmm3, xmm2 ; qs0 =qs0 - Filter1 - movdqa xmm7, xmm1 - - movdqa xmm4, [GLOBAL(s63)] - movdqa xmm5, xmm0 - movdqa xmm2, xmm5 - paddw xmm0, xmm4 ; Filter 2 (hi) * 9 + 63 - paddw xmm1, xmm4 ; Filter 2 (lo) * 9 + 63 - movdqa xmm4, xmm7 - - paddw xmm5, xmm5 ; Filter 2 (hi) * 18 - - paddw xmm7, xmm7 ; Filter 2 (lo) * 18 - paddw xmm5, xmm0 ; Filter 2 (hi) * 27 + 63 - - paddw xmm7, xmm1 ; Filter 2 (lo) * 27 + 63 - paddw xmm2, xmm0 ; Filter 2 (hi) * 18 + 63 - psraw xmm0, 7 ; (Filter 2 (hi) * 9 + 63) >> 7 - - paddw xmm4, xmm1 ; Filter 2 (lo) * 18 + 63 - psraw xmm1, 7 ; (Filter 2 (lo) * 9 + 63) >> 7 - psraw xmm2, 7 ; (Filter 2 (hi) * 18 + 63) >> 7 - - packsswb xmm0, xmm1 ; u1 = vp8_signed_char_clamp((63 + Filter2 * 9)>>7) - - psraw xmm4, 7 ; (Filter 2 (lo) * 18 + 63) >> 7 - psraw xmm5, 7 ; (Filter 2 (hi) * 27 + 63) >> 7 - psraw xmm7, 7 ; (Filter 2 (lo) * 27 + 63) >> 7 - - packsswb xmm5, xmm7 ; u3 = vp8_signed_char_clamp((63 + Filter2 * 27)>>7) - packsswb xmm2, xmm4 ; u2 = vp8_signed_char_clamp((63 + Filter2 * 18)>>7) - movdqa xmm7, [GLOBAL(t80)] - -%if %1 == 0 - movdqa xmm1, [rsp+_q1] ; q1 - movdqa xmm4, [rsp+_p1] ; p1 - lea rsi, [rsi+rcx*2] - lea rdi, [rdi+rcx*2] - -%elif %1 == 1 - movdqa xmm1, [rdi] ; q1 - movdqa xmm4, [rsi+rax*2] ; p1 -%elif %1 == 2 - movdqa xmm4, [rsp+_p1] ; p1 - movdqa xmm1, [rsp+_q1] ; q1 -%endif - - pxor xmm1, xmm7 - pxor xmm4, xmm7 - - psubsb xmm3, xmm5 ; sq = vp8_signed_char_clamp(qs0 - u3) - paddsb xmm6, xmm5 ; sp = vp8_signed_char_clamp(ps0 - u3) - psubsb xmm1, xmm2 ; sq = vp8_signed_char_clamp(qs1 - u2) - paddsb xmm4, xmm2 ; sp = vp8_signed_char_clamp(ps1 - u2) - -%if %1 == 1 - movdqa xmm2, [rdi+rax*4] ; p2 - movdqa xmm5, [rdi+rcx] ; q2 -%else - movdqa xmm2, [rsp+_p2] ; p2 - movdqa xmm5, [rsp+_q2] ; q2 -%endif - - pxor xmm1, xmm7 ; *oq1 = sq^0x80; - pxor xmm4, xmm7 ; *op1 = sp^0x80; - pxor xmm2, xmm7 - pxor xmm5, xmm7 - paddsb xmm2, xmm0 ; sp = vp8_signed_char_clamp(ps2 - u) - psubsb xmm5, xmm0 ; sq = vp8_signed_char_clamp(qs2 - u) - pxor xmm2, xmm7 ; *op2 = sp^0x80; - pxor xmm5, xmm7 ; *oq2 = sq^0x80; - pxor xmm3, xmm7 ; *oq0 = sq^0x80 - pxor xmm6, xmm7 ; *oq0 = sp^0x80 -%if %1 == 0 - movq [rsi], xmm6 ; p0 - movhps [rdi], xmm6 - movq [rsi + rcx], xmm3 ; q0 - movhps [rdi + rcx], xmm3 - lea rdx, [rcx + rcx*2] - movq [rsi+rcx*2], xmm1 ; q1 - movhps [rdi+rcx*2], xmm1 - - movq [rsi + rax], xmm4 ; p1 - movhps [rdi + rax], xmm4 - - movq [rsi+rax*2], xmm2 ; p2 - movhps [rdi+rax*2], xmm2 - - movq [rsi+rdx], xmm5 ; q2 - movhps [rdi+rdx], xmm5 -%elif %1 == 1 - movdqa [rdi+rcx], xmm5 ; q2 - movdqa [rdi], xmm1 ; q1 - movdqa [rsi], xmm3 ; q0 - movdqa [rsi+rax ], xmm6 ; p0 - movdqa [rsi+rax*2], xmm4 ; p1 - movdqa [rdi+rax*4], xmm2 ; p2 -%elif %1 == 2 - movdqa [rsp+_p1], xmm4 ; p1 - movdqa [rsp+_p0], xmm6 ; p0 - movdqa [rsp+_q0], xmm3 ; q0 - movdqa [rsp+_q1], xmm1 ; q1 -%endif - -%endmacro - - -;void vp8_mbloop_filter_horizontal_edge_sse2 -;( -; unsigned char *src_ptr, -; int src_pixel_step, -; const char *blimit, -; const char *limit, -; const char *thresh, -;) -global sym(vp8_mbloop_filter_horizontal_edge_sse2) PRIVATE -sym(vp8_mbloop_filter_horizontal_edge_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, lf_var_size - - mov rsi, arg(0) ;src_ptr - movsxd rax, dword ptr arg(1) ;src_pixel_step - mov rdx, arg(3) ;limit - - lea rdi, [rsi+rax] ; rdi points to row +1 for indirect addressing - - ; calculate breakout conditions and high edge variance - LFH_FILTER_AND_HEV_MASK 1 - ; filter and write back the results - MB_FILTER_AND_WRITEBACK 1 - - add rsp, lf_var_size - pop rsp - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_mbloop_filter_horizontal_edge_uv_sse2 -;( -; unsigned char *u, -; int src_pixel_step, -; const char *blimit, -; const char *limit, -; const char *thresh, -; unsigned char *v -;) -global sym(vp8_mbloop_filter_horizontal_edge_uv_sse2) PRIVATE -sym(vp8_mbloop_filter_horizontal_edge_uv_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, lf_var_size - - mov rsi, arg(0) ; u - mov rdi, arg(5) ; v - movsxd rax, dword ptr arg(1) ; src_pixel_step - mov rcx, rax - neg rax ; negate pitch to deal with above border - mov rdx, arg(3) ;limit - - lea rsi, [rsi + rcx] - lea rdi, [rdi + rcx] - - ; calculate breakout conditions and high edge variance - LFH_FILTER_AND_HEV_MASK 0 - ; filter and write back the results - MB_FILTER_AND_WRITEBACK 0 - - add rsp, lf_var_size - pop rsp - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - -%macro TRANSPOSE_16X8 2 - movq xmm4, [rsi] ; xx xx xx xx xx xx xx xx 07 06 05 04 03 02 01 00 - movq xmm1, [rdi] ; xx xx xx xx xx xx xx xx 17 16 15 14 13 12 11 10 - movq xmm0, [rsi+2*rax] ; xx xx xx xx xx xx xx xx 27 26 25 24 23 22 21 20 - movq xmm7, [rdi+2*rax] ; xx xx xx xx xx xx xx xx 37 36 35 34 33 32 31 30 - movq xmm5, [rsi+4*rax] ; xx xx xx xx xx xx xx xx 47 46 45 44 43 42 41 40 - movq xmm2, [rdi+4*rax] ; xx xx xx xx xx xx xx xx 57 56 55 54 53 52 51 50 - - punpcklbw xmm4, xmm1 ; 17 07 16 06 15 05 14 04 13 03 12 02 11 01 10 00 - - movq xmm1, [rdi+2*rcx] ; xx xx xx xx xx xx xx xx 77 76 75 74 73 72 71 70 - - movdqa xmm3, xmm4 ; 17 07 16 06 15 05 14 04 13 03 12 02 11 01 10 00 - punpcklbw xmm0, xmm7 ; 37 27 36 36 35 25 34 24 33 23 32 22 31 21 30 20 - - movq xmm7, [rsi+2*rcx] ; xx xx xx xx xx xx xx xx 67 66 65 64 63 62 61 60 - - punpcklbw xmm5, xmm2 ; 57 47 56 46 55 45 54 44 53 43 52 42 51 41 50 40 -%if %1 - lea rsi, [rsi+rax*8] - lea rdi, [rdi+rax*8] -%else - mov rsi, arg(5) ; v_ptr -%endif - - movdqa xmm6, xmm5 ; 57 47 56 46 55 45 54 44 53 43 52 42 51 41 50 40 - punpcklbw xmm7, xmm1 ; 77 67 76 66 75 65 74 64 73 63 72 62 71 61 70 60 - punpcklwd xmm5, xmm7 ; 73 63 53 43 72 62 52 42 71 61 51 41 70 60 50 40 - punpckhwd xmm6, xmm7 ; 77 67 57 47 76 66 56 46 75 65 55 45 74 64 54 44 - punpcklwd xmm3, xmm0 ; 33 23 13 03 32 22 12 02 31 21 11 01 30 20 10 00 - -%if %1 == 0 - lea rdi, [rsi + rax - 4] ; rdi points to row +1 for indirect addressing - lea rsi, [rsi - 4] -%endif - - movdqa xmm2, xmm3 ; 33 23 13 03 32 22 12 02 31 21 11 01 30 20 10 00 - punpckhwd xmm4, xmm0 ; 37 27 17 07 36 26 16 06 35 25 15 05 34 24 14 04 - - movdqa xmm7, xmm4 ; 37 27 17 07 36 26 16 06 35 25 15 05 34 24 14 04 - punpckhdq xmm3, xmm5 ; 73 63 53 43 33 23 13 03 72 62 52 42 32 22 12 02 - - punpckhdq xmm7, xmm6 ; 77 67 57 47 37 27 17 07 76 66 56 46 36 26 16 06 - - punpckldq xmm4, xmm6 ; 75 65 55 45 35 25 15 05 74 64 54 44 34 24 14 04 - - punpckldq xmm2, xmm5 ; 71 61 51 41 31 21 11 01 70 60 50 40 30 20 10 00 - - movdqa [rsp+_t0], xmm2 ; save to free XMM2 - - movq xmm2, [rsi] ; xx xx xx xx xx xx xx xx 87 86 85 84 83 82 81 80 - movq xmm6, [rdi] ; xx xx xx xx xx xx xx xx 97 96 95 94 93 92 91 90 - movq xmm0, [rsi+2*rax] ; xx xx xx xx xx xx xx xx a7 a6 a5 a4 a3 a2 a1 a0 - movq xmm5, [rdi+2*rax] ; xx xx xx xx xx xx xx xx b7 b6 b5 b4 b3 b2 b1 b0 - movq xmm1, [rsi+4*rax] ; xx xx xx xx xx xx xx xx c7 c6 c5 c4 c3 c2 c1 c0 - - punpcklbw xmm2, xmm6 ; 97 87 96 86 95 85 94 84 93 83 92 82 91 81 90 80 - - movq xmm6, [rdi+4*rax] ; xx xx xx xx xx xx xx xx d7 d6 d5 d4 d3 d2 d1 d0 - - punpcklbw xmm0, xmm5 ; b7 a7 b6 a6 b5 a5 b4 a4 b3 a3 b2 a2 b1 a1 b0 a0 - - movq xmm5, [rsi+2*rcx] ; xx xx xx xx xx xx xx xx e7 e6 e5 e4 e3 e2 e1 e0 - - punpcklbw xmm1, xmm6 ; d7 c7 d6 c6 d5 c5 d4 c4 d3 c3 d2 c2 d1 e1 d0 c0 - - movq xmm6, [rdi+2*rcx] ; xx xx xx xx xx xx xx xx f7 f6 f5 f4 f3 f2 f1 f0 - - punpcklbw xmm5, xmm6 ; f7 e7 f6 e6 f5 e5 f4 e4 f3 e3 f2 e2 f1 e1 f0 e0 - - movdqa xmm6, xmm1 ; - punpckhwd xmm6, xmm5 ; f7 e7 d7 c7 f6 e6 d6 c6 f5 e5 d5 c5 f4 e4 d4 c4 - - punpcklwd xmm1, xmm5 ; f3 e3 d3 c3 f2 e2 d2 c2 f1 e1 d1 c1 f0 e0 d0 c0 - movdqa xmm5, xmm2 ; 97 87 96 86 95 85 94 84 93 83 92 82 91 81 90 80 - - punpcklwd xmm5, xmm0 ; b3 a3 93 83 b2 a2 92 82 b1 a1 91 81 b0 a0 90 80 - - punpckhwd xmm2, xmm0 ; b7 a7 97 87 b6 a6 96 86 b5 a5 95 85 b4 a4 94 84 - - movdqa xmm0, xmm5 - punpckldq xmm0, xmm1 ; f1 e1 d1 c1 b1 a1 91 81 f0 e0 d0 c0 b0 a0 90 80 - - punpckhdq xmm5, xmm1 ; f3 e3 d3 c3 b3 a3 93 83 f2 e2 d2 c2 b2 a2 92 82 - movdqa xmm1, xmm2 ; b7 a7 97 87 b6 a6 96 86 b5 a5 95 85 b4 a4 94 84 - - punpckldq xmm1, xmm6 ; f5 e5 d5 c5 b5 a5 95 85 f4 e4 d4 c4 b4 a4 94 84 - - punpckhdq xmm2, xmm6 ; f7 e7 d7 c7 b7 a7 97 87 f6 e6 d6 c6 b6 a6 96 86 - movdqa xmm6, xmm7 ; 77 67 57 47 37 27 17 07 76 66 56 46 36 26 16 06 - - punpcklqdq xmm6, xmm2 ; f6 e6 d6 c6 b6 a6 96 86 76 66 56 46 36 26 16 06 - - punpckhqdq xmm7, xmm2 ; f7 e7 d7 c7 b7 a7 97 87 77 67 57 47 37 27 17 07 - -%if %2 == 0 - movdqa [rsp+_q3], xmm7 ; save 7 - movdqa [rsp+_q2], xmm6 ; save 6 -%endif - movdqa xmm2, xmm3 ; 73 63 53 43 33 23 13 03 72 62 52 42 32 22 12 02 - punpckhqdq xmm3, xmm5 ; f3 e3 d3 c3 b3 a3 93 83 73 63 53 43 33 23 13 03 - punpcklqdq xmm2, xmm5 ; f2 e2 d2 c2 b2 a2 92 82 72 62 52 42 32 22 12 02 - movdqa [rsp+_p1], xmm2 ; save 2 - - movdqa xmm5, xmm4 ; 75 65 55 45 35 25 15 05 74 64 54 44 34 24 14 04 - punpcklqdq xmm4, xmm1 ; f4 e4 d4 c4 b4 a4 94 84 74 64 54 44 34 24 14 04 - movdqa [rsp+_p0], xmm3 ; save 3 - - punpckhqdq xmm5, xmm1 ; f5 e5 d5 c5 b5 a5 95 85 75 65 55 45 35 25 15 05 - - movdqa [rsp+_q0], xmm4 ; save 4 - movdqa [rsp+_q1], xmm5 ; save 5 - movdqa xmm1, [rsp+_t0] - - movdqa xmm2, xmm1 ; - punpckhqdq xmm1, xmm0 ; f1 e1 d1 c1 b1 a1 91 81 71 61 51 41 31 21 11 01 - punpcklqdq xmm2, xmm0 ; f0 e0 d0 c0 b0 a0 90 80 70 60 50 40 30 20 10 00 - -%if %2 == 0 - movdqa [rsp+_p2], xmm1 - movdqa [rsp+_p3], xmm2 -%endif - -%endmacro - -%macro LFV_FILTER_MASK_HEV_MASK 0 - movdqa xmm0, xmm6 ; q2 - psubusb xmm0, xmm7 ; q2-q3 - - psubusb xmm7, xmm6 ; q3-q2 - movdqa xmm4, xmm5 ; q1 - - por xmm7, xmm0 ; abs (q3-q2) - psubusb xmm4, xmm6 ; q1-q2 - - movdqa xmm0, xmm1 - psubusb xmm6, xmm5 ; q2-q1 - - por xmm6, xmm4 ; abs (q2-q1) - psubusb xmm0, xmm2 ; p2 - p3; - - psubusb xmm2, xmm1 ; p3 - p2; - por xmm0, xmm2 ; abs(p2-p3) - - movdqa xmm5, [rsp+_p1] ; p1 - pmaxub xmm0, xmm7 - - movdqa xmm2, xmm5 ; p1 - psubusb xmm5, xmm1 ; p1-p2 - psubusb xmm1, xmm2 ; p2-p1 - - movdqa xmm7, xmm3 ; p0 - psubusb xmm7, xmm2 ; p0-p1 - - por xmm1, xmm5 ; abs(p2-p1) - pmaxub xmm0, xmm6 - - pmaxub xmm0, xmm1 - movdqa xmm1, xmm2 ; p1 - - psubusb xmm2, xmm3 ; p1-p0 - - por xmm2, xmm7 ; abs(p1-p0) - - pmaxub xmm0, xmm2 - - movdqa xmm5, [rsp+_q0] ; q0 - movdqa xmm7, [rsp+_q1] ; q1 - - mov rdx, arg(3) ; limit - - movdqa xmm6, xmm5 ; q0 - movdqa xmm4, xmm7 ; q1 - - psubusb xmm5, xmm7 ; q0-q1 - psubusb xmm7, xmm6 ; q1-q0 - - por xmm7, xmm5 ; abs(q1-q0) - - pmaxub xmm0, xmm7 - - psubusb xmm0, [rdx] ; limit - - mov rdx, arg(2) ; blimit - movdqa xmm5, xmm4 ; q1 - - psubusb xmm5, xmm1 ; q1-=p1 - psubusb xmm1, xmm4 ; p1-=q1 - - por xmm5, xmm1 ; abs(p1-q1) - movdqa xmm1, xmm3 ; p0 - - pand xmm5, [GLOBAL(tfe)] ; set lsb of each byte to zero - psubusb xmm1, xmm6 ; p0-q0 - - movdqa xmm4, [rdx] ; blimit - mov rdx, arg(4) ; get thresh - - psrlw xmm5, 1 ; abs(p1-q1)/2 - psubusb xmm6, xmm3 ; q0-p0 - - por xmm1, xmm6 ; abs(q0-p0) - paddusb xmm1, xmm1 ; abs(q0-p0)*2 - movdqa xmm3, [rdx] - - paddusb xmm1, xmm5 ; abs (p0 - q0) *2 + abs(p1-q1)/2 - psubusb xmm2, xmm3 ; abs(q1 - q0) > thresh - - psubusb xmm7, xmm3 ; abs(p1 - p0)> thresh - - psubusb xmm1, xmm4 ; abs (p0 - q0) *2 + abs(p1-q1)/2 > blimit - por xmm2, xmm7 ; abs(q1 - q0) > thresh || abs(p1 - p0) > thresh - - por xmm1, xmm0 ; mask - pcmpeqb xmm2, xmm0 - - pxor xmm0, xmm0 - pcmpeqb xmm4, xmm4 - - pcmpeqb xmm1, xmm0 - pxor xmm4, xmm2 -%endmacro - -%macro BV_TRANSPOSE 0 - ; xmm1 = f2 e2 d2 c2 b2 a2 92 82 72 62 52 42 32 22 12 02 - ; xmm6 = f3 e3 d3 c3 b3 a3 93 83 73 63 53 43 33 23 13 03 - ; xmm3 = f4 e4 d4 c4 b4 a4 94 84 74 64 54 44 34 24 14 04 - ; xmm7 = f5 e5 d5 c5 b5 a5 95 85 75 65 55 45 35 25 15 05 - movdqa xmm2, xmm1 ; f2 e2 d2 c2 b2 a2 92 82 72 62 52 42 32 22 12 02 - punpcklbw xmm2, xmm6 ; 73 72 63 62 53 52 43 42 33 32 23 22 13 12 03 02 - - movdqa xmm4, xmm3 ; f4 e4 d4 c4 b4 a4 94 84 74 64 54 44 34 24 14 04 - punpckhbw xmm1, xmm6 ; f3 f2 e3 e2 d3 d2 c3 c2 b3 b2 a3 a2 93 92 83 82 - - punpcklbw xmm4, xmm7 ; 75 74 65 64 55 54 45 44 35 34 25 24 15 14 05 04 - - punpckhbw xmm3, xmm7 ; f5 f4 e5 e4 d5 d4 c5 c4 b5 b4 a5 a4 95 94 85 84 - - movdqa xmm6, xmm2 ; 73 72 63 62 53 52 43 42 33 32 23 22 13 12 03 02 - punpcklwd xmm2, xmm4 ; 35 34 33 32 25 24 23 22 15 14 13 12 05 04 03 02 - - punpckhwd xmm6, xmm4 ; 75 74 73 72 65 64 63 62 55 54 53 52 45 44 43 42 - movdqa xmm5, xmm1 ; f3 f2 e3 e2 d3 d2 c3 c2 b3 b2 a3 a2 93 92 83 82 - - punpcklwd xmm1, xmm3 ; b5 b4 b3 b2 a5 a4 a3 a2 95 94 93 92 85 84 83 82 - - punpckhwd xmm5, xmm3 ; f5 f4 f3 f2 e5 e4 e3 e2 d5 d4 d3 d2 c5 c4 c3 c2 - ; xmm2 = 35 34 33 32 25 24 23 22 15 14 13 12 05 04 03 02 - ; xmm6 = 75 74 73 72 65 64 63 62 55 54 53 52 45 44 43 42 - ; xmm1 = b5 b4 b3 b2 a5 a4 a3 a2 95 94 93 92 85 84 83 82 - ; xmm5 = f5 f4 f3 f2 e5 e4 e3 e2 d5 d4 d3 d2 c5 c4 c3 c2 -%endmacro - -%macro BV_WRITEBACK 2 - movd [rsi+2], %1 - movd [rsi+4*rax+2], %2 - psrldq %1, 4 - psrldq %2, 4 - movd [rdi+2], %1 - movd [rdi+4*rax+2], %2 - psrldq %1, 4 - psrldq %2, 4 - movd [rsi+2*rax+2], %1 - movd [rsi+2*rcx+2], %2 - psrldq %1, 4 - psrldq %2, 4 - movd [rdi+2*rax+2], %1 - movd [rdi+2*rcx+2], %2 -%endmacro - -%if ABI_IS_32BIT - -;void vp8_loop_filter_vertical_edge_sse2 -;( -; unsigned char *src_ptr, -; int src_pixel_step, -; const char *blimit, -; const char *limit, -; const char *thresh, -;) -global sym(vp8_loop_filter_vertical_edge_sse2) PRIVATE -sym(vp8_loop_filter_vertical_edge_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, lf_var_size - - mov rsi, arg(0) ; src_ptr - movsxd rax, dword ptr arg(1) ; src_pixel_step - - lea rsi, [rsi - 4] - lea rdi, [rsi + rax] ; rdi points to row +1 for indirect addressing - lea rcx, [rax*2+rax] - - ;transpose 16x8 to 8x16, and store the 8-line result on stack. - TRANSPOSE_16X8 1, 1 - - ; calculate filter mask and high edge variance - LFV_FILTER_MASK_HEV_MASK - - ; start work on filters - B_FILTER 2 - - ; transpose and write back - only work on q1, q0, p0, p1 - BV_TRANSPOSE - ; store 16-line result - - lea rdx, [rax] - neg rdx - - BV_WRITEBACK xmm1, xmm5 - - lea rsi, [rsi+rdx*8] - lea rdi, [rdi+rdx*8] - BV_WRITEBACK xmm2, xmm6 - - add rsp, lf_var_size - pop rsp - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -%endif - -;void vp8_loop_filter_vertical_edge_uv_sse2 -;( -; unsigned char *u, -; int src_pixel_step, -; const char *blimit, -; const char *limit, -; const char *thresh, -; unsigned char *v -;) -global sym(vp8_loop_filter_vertical_edge_uv_sse2) PRIVATE -sym(vp8_loop_filter_vertical_edge_uv_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, lf_var_size - - mov rsi, arg(0) ; u_ptr - movsxd rax, dword ptr arg(1) ; src_pixel_step - - lea rsi, [rsi - 4] - lea rdi, [rsi + rax] ; rdi points to row +1 for indirect addressing - lea rcx, [rax+2*rax] - - ;transpose 16x8 to 8x16, and store the 8-line result on stack. - TRANSPOSE_16X8 0, 1 - - ; calculate filter mask and high edge variance - LFV_FILTER_MASK_HEV_MASK - - ; start work on filters - B_FILTER 2 - - ; transpose and write back - only work on q1, q0, p0, p1 - BV_TRANSPOSE - - lea rdi, [rsi + rax] ; rdi points to row +1 for indirect addressing - - ; store 16-line result - BV_WRITEBACK xmm1, xmm5 - - mov rsi, arg(0) ; u_ptr - lea rsi, [rsi - 4] - lea rdi, [rsi + rax] ; rdi points to row +1 for indirect addressing - BV_WRITEBACK xmm2, xmm6 - - add rsp, lf_var_size - pop rsp - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -%macro MBV_TRANSPOSE 0 - movdqa xmm0, [rsp+_p3] ; f0 e0 d0 c0 b0 a0 90 80 70 60 50 40 30 20 10 00 - movdqa xmm1, xmm0 ; f0 e0 d0 c0 b0 a0 90 80 70 60 50 40 30 20 10 00 - - punpcklbw xmm0, xmm2 ; 71 70 61 60 51 50 41 40 31 30 21 20 11 10 01 00 - punpckhbw xmm1, xmm2 ; f1 f0 e1 e0 d1 d0 c1 c0 b1 b0 a1 a0 91 90 81 80 - - movdqa xmm7, [rsp+_p1] ; f2 e2 d2 c2 b2 a2 92 82 72 62 52 42 32 22 12 02 - movdqa xmm6, xmm7 ; f2 e2 d2 c2 b2 a2 92 82 72 62 52 42 32 22 12 02 - - punpcklbw xmm7, [rsp+_p0] ; 73 72 63 62 53 52 43 42 33 32 23 22 13 12 03 02 - punpckhbw xmm6, [rsp+_p0] ; f3 f2 e3 e2 d3 d2 c3 c2 b3 b2 a3 a2 93 92 83 82 - - movdqa xmm3, xmm0 ; 71 70 61 60 51 50 41 40 31 30 21 20 11 10 01 00 - punpcklwd xmm0, xmm7 ; 33 32 31 30 23 22 21 20 13 12 11 10 03 02 01 00 - - punpckhwd xmm3, xmm7 ; 73 72 71 70 63 62 61 60 53 52 51 50 43 42 41 40 - movdqa xmm4, xmm1 ; f1 f0 e1 e0 d1 d0 c1 c0 b1 b0 a1 a0 91 90 81 80 - - punpcklwd xmm1, xmm6 ; b3 b2 b1 b0 a3 a2 a1 a0 93 92 91 90 83 82 81 80 - punpckhwd xmm4, xmm6 ; f3 f2 f1 f0 e3 e2 e1 e0 d3 d2 d1 d0 c3 c2 c1 c0 - - movdqa xmm7, [rsp+_q0] ; f4 e4 d4 c4 b4 a4 94 84 74 64 54 44 34 24 14 04 - punpcklbw xmm7, [rsp+_q1] ; 75 74 65 64 55 54 45 44 35 34 25 24 15 14 05 04 - - movdqa xmm6, xmm5 ; f6 e6 d6 c6 b6 a6 96 86 76 66 56 46 36 26 16 06 - punpcklbw xmm6, [rsp+_q3] ; 77 76 67 66 57 56 47 46 37 36 27 26 17 16 07 06 - - movdqa xmm2, xmm7 ; 75 74 65 64 55 54 45 44 35 34 25 24 15 14 05 04 - punpcklwd xmm7, xmm6 ; 37 36 35 34 27 26 25 24 17 16 15 14 07 06 05 04 - - punpckhwd xmm2, xmm6 ; 77 76 75 74 67 66 65 64 57 56 55 54 47 46 45 44 - movdqa xmm6, xmm0 ; 33 32 31 30 23 22 21 20 13 12 11 10 03 02 01 00 - - punpckldq xmm0, xmm7 ; 17 16 15 14 13 12 11 10 07 06 05 04 03 02 01 00 - punpckhdq xmm6, xmm7 ; 37 36 35 34 33 32 31 30 27 26 25 24 23 22 21 20 -%endmacro - -%macro MBV_WRITEBACK_1 0 - movq [rsi], xmm0 - movhps [rdi], xmm0 - - movq [rsi+2*rax], xmm6 - movhps [rdi+2*rax], xmm6 - - movdqa xmm0, xmm3 ; 73 72 71 70 63 62 61 60 53 52 51 50 43 42 41 40 - punpckldq xmm0, xmm2 ; 57 56 55 54 53 52 51 50 47 46 45 44 43 42 41 40 - punpckhdq xmm3, xmm2 ; 77 76 75 74 73 72 71 70 67 66 65 64 63 62 61 60 - - movq [rsi+4*rax], xmm0 - movhps [rdi+4*rax], xmm0 - - movq [rsi+2*rcx], xmm3 - movhps [rdi+2*rcx], xmm3 - - movdqa xmm7, [rsp+_q0] ; f4 e4 d4 c4 b4 a4 94 84 74 64 54 44 34 24 14 04 - punpckhbw xmm7, [rsp+_q1] ; f5 f4 e5 e4 d5 d4 c5 c4 b5 b4 a5 a4 95 94 85 84 - punpckhbw xmm5, [rsp+_q3] ; f7 f6 e7 e6 d7 d6 c7 c6 b7 b6 a7 a6 97 96 87 86 - - movdqa xmm0, xmm7 - punpcklwd xmm0, xmm5 ; b7 b6 b4 b4 a7 a6 a5 a4 97 96 95 94 87 86 85 84 - punpckhwd xmm7, xmm5 ; f7 f6 f5 f4 e7 e6 e5 e4 d7 d6 d5 d4 c7 c6 c5 c4 - - movdqa xmm5, xmm1 ; b3 b2 b1 b0 a3 a2 a1 a0 93 92 91 90 83 82 81 80 - punpckldq xmm1, xmm0 ; 97 96 95 94 93 92 91 90 87 86 85 83 84 82 81 80 - punpckhdq xmm5, xmm0 ; b7 b6 b5 b4 b3 b2 b1 b0 a7 a6 a5 a4 a3 a2 a1 a0 -%endmacro - -%macro MBV_WRITEBACK_2 0 - movq [rsi], xmm1 - movhps [rdi], xmm1 - - movq [rsi+2*rax], xmm5 - movhps [rdi+2*rax], xmm5 - - movdqa xmm1, xmm4 ; f3 f2 f1 f0 e3 e2 e1 e0 d3 d2 d1 d0 c3 c2 c1 c0 - punpckldq xmm1, xmm7 ; d7 d6 d5 d4 d3 d2 d1 d0 c7 c6 c5 c4 c3 c2 c1 c0 - punpckhdq xmm4, xmm7 ; f7 f6 f4 f4 f3 f2 f1 f0 e7 e6 e5 e4 e3 e2 e1 e0 - - movq [rsi+4*rax], xmm1 - movhps [rdi+4*rax], xmm1 - - movq [rsi+2*rcx], xmm4 - movhps [rdi+2*rcx], xmm4 -%endmacro - - -;void vp8_mbloop_filter_vertical_edge_sse2 -;( -; unsigned char *src_ptr, -; int src_pixel_step, -; const char *blimit, -; const char *limit, -; const char *thresh, -;) -global sym(vp8_mbloop_filter_vertical_edge_sse2) PRIVATE -sym(vp8_mbloop_filter_vertical_edge_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, lf_var_size - - mov rsi, arg(0) ; src_ptr - movsxd rax, dword ptr arg(1) ; src_pixel_step - - lea rsi, [rsi - 4] - lea rdi, [rsi + rax] ; rdi points to row +1 for indirect addressing - lea rcx, [rax*2+rax] - - ; Transpose - TRANSPOSE_16X8 1, 0 - - ; calculate filter mask and high edge variance - LFV_FILTER_MASK_HEV_MASK - - neg rax - ; start work on filters - MB_FILTER_AND_WRITEBACK 2 - - lea rsi, [rsi+rax*8] - lea rdi, [rdi+rax*8] - - ; transpose and write back - MBV_TRANSPOSE - - neg rax - - MBV_WRITEBACK_1 - - - lea rsi, [rsi+rax*8] - lea rdi, [rdi+rax*8] - MBV_WRITEBACK_2 - - add rsp, lf_var_size - pop rsp - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_mbloop_filter_vertical_edge_uv_sse2 -;( -; unsigned char *u, -; int src_pixel_step, -; const char *blimit, -; const char *limit, -; const char *thresh, -; unsigned char *v -;) -global sym(vp8_mbloop_filter_vertical_edge_uv_sse2) PRIVATE -sym(vp8_mbloop_filter_vertical_edge_uv_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, lf_var_size - - mov rsi, arg(0) ; u_ptr - movsxd rax, dword ptr arg(1) ; src_pixel_step - - lea rsi, [rsi - 4] - lea rdi, [rsi + rax] ; rdi points to row +1 for indirect addressing - lea rcx, [rax+2*rax] - - ; Transpose - TRANSPOSE_16X8 0, 0 - - ; calculate filter mask and high edge variance - LFV_FILTER_MASK_HEV_MASK - - ; start work on filters - MB_FILTER_AND_WRITEBACK 2 - - ; transpose and write back - MBV_TRANSPOSE - - mov rsi, arg(0) ;u_ptr - lea rsi, [rsi - 4] - lea rdi, [rsi + rax] - MBV_WRITEBACK_1 - mov rsi, arg(5) ;v_ptr - lea rsi, [rsi - 4] - lea rdi, [rsi + rax] - MBV_WRITEBACK_2 - - add rsp, lf_var_size - pop rsp - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_loop_filter_simple_horizontal_edge_sse2 -;( -; unsigned char *src_ptr, -; int src_pixel_step, -; const char *blimit, -;) -global sym(vp8_loop_filter_simple_horizontal_edge_sse2) PRIVATE -sym(vp8_loop_filter_simple_horizontal_edge_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 3 - SAVE_XMM 7 - GET_GOT rbx - ; end prolog - - mov rcx, arg(0) ;src_ptr - movsxd rax, dword ptr arg(1) ;src_pixel_step ; destination pitch? - movdqa xmm6, [GLOBAL(tfe)] - lea rdx, [rcx + rax] - neg rax - - ; calculate mask - movdqa xmm0, [rdx] ; q1 - mov rdx, arg(2) ;blimit - movdqa xmm1, [rcx+2*rax] ; p1 - - movdqa xmm2, xmm1 - movdqa xmm3, xmm0 - - psubusb xmm0, xmm1 ; q1-=p1 - psubusb xmm1, xmm3 ; p1-=q1 - por xmm1, xmm0 ; abs(p1-q1) - pand xmm1, xmm6 ; set lsb of each byte to zero - psrlw xmm1, 1 ; abs(p1-q1)/2 - - movdqa xmm7, XMMWORD PTR [rdx] - - movdqa xmm5, [rcx+rax] ; p0 - movdqa xmm4, [rcx] ; q0 - movdqa xmm0, xmm4 ; q0 - movdqa xmm6, xmm5 ; p0 - psubusb xmm5, xmm4 ; p0-=q0 - psubusb xmm4, xmm6 ; q0-=p0 - por xmm5, xmm4 ; abs(p0 - q0) - - movdqa xmm4, [GLOBAL(t80)] - - paddusb xmm5, xmm5 ; abs(p0-q0)*2 - paddusb xmm5, xmm1 ; abs (p0 - q0) *2 + abs(p1-q1)/2 - psubusb xmm5, xmm7 ; abs(p0 - q0) *2 + abs(p1-q1)/2 > blimit - pxor xmm7, xmm7 - pcmpeqb xmm5, xmm7 - - - ; start work on filters - pxor xmm2, xmm4 ; p1 offset to convert to signed values - pxor xmm3, xmm4 ; q1 offset to convert to signed values - psubsb xmm2, xmm3 ; p1 - q1 - - pxor xmm6, xmm4 ; offset to convert to signed values - pxor xmm0, xmm4 ; offset to convert to signed values - movdqa xmm3, xmm0 ; q0 - psubsb xmm0, xmm6 ; q0 - p0 - paddsb xmm2, xmm0 ; p1 - q1 + 1 * (q0 - p0) - paddsb xmm2, xmm0 ; p1 - q1 + 2 * (q0 - p0) - paddsb xmm2, xmm0 ; p1 - q1 + 3 * (q0 - p0) - pand xmm5, xmm2 ; mask filter values we don't care about - - movdqa xmm0, xmm5 - paddsb xmm5, [GLOBAL(t3)] ; 3* (q0 - p0) + (p1 - q1) + 4 - paddsb xmm0, [GLOBAL(t4)] ; +3 instead of +4 - - movdqa xmm1, [GLOBAL(te0)] - movdqa xmm2, [GLOBAL(t1f)] - -; pxor xmm7, xmm7 - pcmpgtb xmm7, xmm0 ;save sign - pand xmm7, xmm1 ;preserve the upper 3 bits - psrlw xmm0, 3 - pand xmm0, xmm2 ;clear out upper 3 bits - por xmm0, xmm7 ;add sign - psubsb xmm3, xmm0 ; q0-= q0sz add - - pxor xmm7, xmm7 - pcmpgtb xmm7, xmm5 ;save sign - pand xmm7, xmm1 ;preserve the upper 3 bits - psrlw xmm5, 3 - pand xmm5, xmm2 ;clear out upper 3 bits - por xmm5, xmm7 ;add sign - paddsb xmm6, xmm5 ; p0+= p0 add - - pxor xmm3, xmm4 ; unoffset - movdqa [rcx], xmm3 ; write back - - pxor xmm6, xmm4 ; unoffset - movdqa [rcx+rax], xmm6 ; write back - - ; begin epilog - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_loop_filter_simple_vertical_edge_sse2 -;( -; unsigned char *src_ptr, -; int src_pixel_step, -; const char *blimit, -;) -global sym(vp8_loop_filter_simple_vertical_edge_sse2) PRIVATE -sym(vp8_loop_filter_simple_vertical_edge_sse2): - push rbp ; save old base pointer value. - mov rbp, rsp ; set new base pointer value. - SHADOW_ARGS_TO_STACK 3 - SAVE_XMM 7 - GET_GOT rbx ; save callee-saved reg - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, 32 ; reserve 32 bytes - %define t0 [rsp + 0] ;__declspec(align(16)) char t0[16]; - %define t1 [rsp + 16] ;__declspec(align(16)) char t1[16]; - - mov rsi, arg(0) ;src_ptr - movsxd rax, dword ptr arg(1) ;src_pixel_step ; destination pitch? - - lea rsi, [rsi - 2 ] - lea rdi, [rsi + rax] - lea rdx, [rsi + rax*4] - lea rcx, [rdx + rax] - - movd xmm0, [rsi] ; (high 96 bits unused) 03 02 01 00 - movd xmm1, [rdx] ; (high 96 bits unused) 43 42 41 40 - movd xmm2, [rdi] ; 13 12 11 10 - movd xmm3, [rcx] ; 53 52 51 50 - punpckldq xmm0, xmm1 ; (high 64 bits unused) 43 42 41 40 03 02 01 00 - punpckldq xmm2, xmm3 ; 53 52 51 50 13 12 11 10 - - movd xmm4, [rsi + rax*2] ; 23 22 21 20 - movd xmm5, [rdx + rax*2] ; 63 62 61 60 - movd xmm6, [rdi + rax*2] ; 33 32 31 30 - movd xmm7, [rcx + rax*2] ; 73 72 71 70 - punpckldq xmm4, xmm5 ; 63 62 61 60 23 22 21 20 - punpckldq xmm6, xmm7 ; 73 72 71 70 33 32 31 30 - - punpcklbw xmm0, xmm2 ; 53 43 52 42 51 41 50 40 13 03 12 02 11 01 10 00 - punpcklbw xmm4, xmm6 ; 73 63 72 62 71 61 70 60 33 23 32 22 31 21 30 20 - - movdqa xmm1, xmm0 - punpcklwd xmm0, xmm4 ; 33 23 13 03 32 22 12 02 31 21 11 01 30 20 10 00 - punpckhwd xmm1, xmm4 ; 73 63 53 43 72 62 52 42 71 61 51 41 70 60 50 40 - - movdqa xmm2, xmm0 - punpckldq xmm0, xmm1 ; 71 61 51 41 31 21 11 01 70 60 50 40 30 20 10 00 - punpckhdq xmm2, xmm1 ; 73 63 53 43 33 23 13 03 72 62 52 42 32 22 12 02 - - lea rsi, [rsi + rax*8] - lea rdi, [rsi + rax] - lea rdx, [rsi + rax*4] - lea rcx, [rdx + rax] - - movd xmm4, [rsi] ; 83 82 81 80 - movd xmm1, [rdx] ; c3 c2 c1 c0 - movd xmm6, [rdi] ; 93 92 91 90 - movd xmm3, [rcx] ; d3 d2 d1 d0 - punpckldq xmm4, xmm1 ; c3 c2 c1 c0 83 82 81 80 - punpckldq xmm6, xmm3 ; d3 d2 d1 d0 93 92 91 90 - - movd xmm1, [rsi + rax*2] ; a3 a2 a1 a0 - movd xmm5, [rdx + rax*2] ; e3 e2 e1 e0 - movd xmm3, [rdi + rax*2] ; b3 b2 b1 b0 - movd xmm7, [rcx + rax*2] ; f3 f2 f1 f0 - punpckldq xmm1, xmm5 ; e3 e2 e1 e0 a3 a2 a1 a0 - punpckldq xmm3, xmm7 ; f3 f2 f1 f0 b3 b2 b1 b0 - - punpcklbw xmm4, xmm6 ; d3 c3 d2 c2 d1 c1 d0 c0 93 83 92 82 91 81 90 80 - punpcklbw xmm1, xmm3 ; f3 e3 f2 e2 f1 e1 f0 e0 b3 a3 b2 a2 b1 a1 b0 a0 - - movdqa xmm7, xmm4 - punpcklwd xmm4, xmm1 ; b3 a3 93 83 b2 a2 92 82 b1 a1 91 81 b0 a0 90 80 - punpckhwd xmm7, xmm1 ; f3 e3 d3 c3 f2 e2 d2 c2 f1 e1 d1 c1 f0 e0 d0 c0 - - movdqa xmm6, xmm4 - punpckldq xmm4, xmm7 ; f1 e1 d1 c1 b1 a1 91 81 f0 e0 d0 c0 b0 a0 90 80 - punpckhdq xmm6, xmm7 ; f3 e3 d3 c3 b3 a3 93 83 f2 e2 d2 c2 b2 a2 92 82 - - movdqa xmm1, xmm0 - movdqa xmm3, xmm2 - - punpcklqdq xmm0, xmm4 ; p1 f0 e0 d0 c0 b0 a0 90 80 70 60 50 40 30 20 10 00 - punpckhqdq xmm1, xmm4 ; p0 f1 e1 d1 c1 b1 a1 91 81 71 61 51 41 31 21 11 01 - punpcklqdq xmm2, xmm6 ; q0 f2 e2 d2 c2 b2 a2 92 82 72 62 52 42 32 22 12 02 - punpckhqdq xmm3, xmm6 ; q1 f3 e3 d3 c3 b3 a3 93 83 73 63 53 43 33 23 13 03 - - mov rdx, arg(2) ;blimit - - ; calculate mask - movdqa xmm6, xmm0 ; p1 - movdqa xmm7, xmm3 ; q1 - psubusb xmm7, xmm0 ; q1-=p1 - psubusb xmm6, xmm3 ; p1-=q1 - por xmm6, xmm7 ; abs(p1-q1) - pand xmm6, [GLOBAL(tfe)] ; set lsb of each byte to zero - psrlw xmm6, 1 ; abs(p1-q1)/2 - - movdqa xmm7, [rdx] - - movdqa xmm5, xmm1 ; p0 - movdqa xmm4, xmm2 ; q0 - psubusb xmm5, xmm2 ; p0-=q0 - psubusb xmm4, xmm1 ; q0-=p0 - por xmm5, xmm4 ; abs(p0 - q0) - paddusb xmm5, xmm5 ; abs(p0-q0)*2 - paddusb xmm5, xmm6 ; abs (p0 - q0) *2 + abs(p1-q1)/2 - - movdqa xmm4, [GLOBAL(t80)] - - psubusb xmm5, xmm7 ; abs(p0 - q0) *2 + abs(p1-q1)/2 > blimit - pxor xmm7, xmm7 - pcmpeqb xmm5, xmm7 ; mm5 = mask - - ; start work on filters - movdqa t0, xmm0 - movdqa t1, xmm3 - - pxor xmm0, xmm4 ; p1 offset to convert to signed values - pxor xmm3, xmm4 ; q1 offset to convert to signed values - psubsb xmm0, xmm3 ; p1 - q1 - - pxor xmm1, xmm4 ; offset to convert to signed values - pxor xmm2, xmm4 ; offset to convert to signed values - - movdqa xmm3, xmm2 ; offseted ; q0 - psubsb xmm2, xmm1 ; q0 - p0 - paddsb xmm0, xmm2 ; p1 - q1 + 1 * (q0 - p0) - paddsb xmm0, xmm2 ; p1 - q1 + 2 * (q0 - p0) - paddsb xmm0, xmm2 ; p1 - q1 + 3 * (q0 - p0) - pand xmm5, xmm0 ; mask filter values we don't care about - - movdqa xmm0, xmm5 - paddsb xmm5, [GLOBAL(t3)] ; 3* (q0 - p0) + (p1 - q1) + 4 - paddsb xmm0, [GLOBAL(t4)] ; +3 instead of +4 - - movdqa xmm6, [GLOBAL(te0)] - movdqa xmm2, [GLOBAL(t1f)] - -; pxor xmm7, xmm7 - pcmpgtb xmm7, xmm0 ;save sign - pand xmm7, xmm6 ;preserve the upper 3 bits - psrlw xmm0, 3 - pand xmm0, xmm2 ;clear out upper 3 bits - por xmm0, xmm7 ;add sign - psubsb xmm3, xmm0 ; q0-= q0sz add - - pxor xmm7, xmm7 - pcmpgtb xmm7, xmm5 ;save sign - pand xmm7, xmm6 ;preserve the upper 3 bits - psrlw xmm5, 3 - pand xmm5, xmm2 ;clear out upper 3 bits - por xmm5, xmm7 ;add sign - paddsb xmm1, xmm5 ; p0+= p0 add - - pxor xmm3, xmm4 ; unoffset q0 - pxor xmm1, xmm4 ; unoffset p0 - - movdqa xmm0, t0 ; p1 - movdqa xmm4, t1 ; q1 - - ; write out order: xmm0 xmm2 xmm1 xmm3 - lea rdx, [rsi + rax*4] - - ; transpose back to write out - ; p1 f0 e0 d0 c0 b0 a0 90 80 70 60 50 40 30 20 10 00 - ; p0 f1 e1 d1 c1 b1 a1 91 81 71 61 51 41 31 21 11 01 - ; q0 f2 e2 d2 c2 b2 a2 92 82 72 62 52 42 32 22 12 02 - ; q1 f3 e3 d3 c3 b3 a3 93 83 73 63 53 43 33 23 13 03 - movdqa xmm6, xmm0 - punpcklbw xmm0, xmm1 ; 71 70 61 60 51 50 41 40 31 30 21 20 11 10 01 00 - punpckhbw xmm6, xmm1 ; f1 f0 e1 e0 d1 d0 c1 c0 b1 b0 a1 a0 91 90 81 80 - - movdqa xmm5, xmm3 - punpcklbw xmm3, xmm4 ; 73 72 63 62 53 52 43 42 33 32 23 22 13 12 03 02 - punpckhbw xmm5, xmm4 ; f3 f2 e3 e2 d3 d2 c3 c2 b3 b2 a3 a2 93 92 83 82 - - movdqa xmm2, xmm0 - punpcklwd xmm0, xmm3 ; 33 32 31 30 23 22 21 20 13 12 11 10 03 02 01 00 - punpckhwd xmm2, xmm3 ; 73 72 71 70 63 62 61 60 53 52 51 50 43 42 41 40 - - movdqa xmm3, xmm6 - punpcklwd xmm6, xmm5 ; b3 b2 b1 b0 a3 a2 a1 a0 93 92 91 90 83 82 81 80 - punpckhwd xmm3, xmm5 ; f3 f2 f1 f0 e3 e2 e1 e0 d3 d2 d1 d0 c3 c2 c1 c0 - - movd [rsi], xmm6 ; write the second 8-line result - movd [rdx], xmm3 - psrldq xmm6, 4 - psrldq xmm3, 4 - movd [rdi], xmm6 - movd [rcx], xmm3 - psrldq xmm6, 4 - psrldq xmm3, 4 - movd [rsi + rax*2], xmm6 - movd [rdx + rax*2], xmm3 - psrldq xmm6, 4 - psrldq xmm3, 4 - movd [rdi + rax*2], xmm6 - movd [rcx + rax*2], xmm3 - - neg rax - lea rsi, [rsi + rax*8] - neg rax - lea rdi, [rsi + rax] - lea rdx, [rsi + rax*4] - lea rcx, [rdx + rax] - - movd [rsi], xmm0 ; write the first 8-line result - movd [rdx], xmm2 - psrldq xmm0, 4 - psrldq xmm2, 4 - movd [rdi], xmm0 - movd [rcx], xmm2 - psrldq xmm0, 4 - psrldq xmm2, 4 - movd [rsi + rax*2], xmm0 - movd [rdx + rax*2], xmm2 - psrldq xmm0, 4 - psrldq xmm2, 4 - movd [rdi + rax*2], xmm0 - movd [rcx + rax*2], xmm2 - - add rsp, 32 - pop rsp - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -SECTION_RODATA -align 16 -tfe: - times 16 db 0xfe -align 16 -t80: - times 16 db 0x80 -align 16 -t1s: - times 16 db 0x01 -align 16 -t3: - times 16 db 0x03 -align 16 -t4: - times 16 db 0x04 -align 16 -ones: - times 8 dw 0x0001 -align 16 -s9: - times 8 dw 0x0900 -align 16 -s63: - times 8 dw 0x003f -align 16 -te0: - times 16 db 0xe0 -align 16 -t1f: - times 16 db 0x1f diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/loopfilter_x86.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/loopfilter_x86.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/loopfilter_x86.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/loopfilter_x86.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,198 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "vp8/common/loopfilter.h" - -#define prototype_loopfilter(sym) \ - void sym(unsigned char *src, int pitch, const unsigned char *blimit,\ - const unsigned char *limit, const unsigned char *thresh, int count) - -#define prototype_loopfilter_nc(sym) \ - void sym(unsigned char *src, int pitch, const unsigned char *blimit,\ - const unsigned char *limit, const unsigned char *thresh) - -#define prototype_simple_loopfilter(sym) \ - void sym(unsigned char *y, int ystride, const unsigned char *blimit) - -prototype_loopfilter(vp8_mbloop_filter_vertical_edge_mmx); -prototype_loopfilter(vp8_mbloop_filter_horizontal_edge_mmx); -prototype_loopfilter(vp8_loop_filter_vertical_edge_mmx); -prototype_loopfilter(vp8_loop_filter_horizontal_edge_mmx); -prototype_simple_loopfilter(vp8_loop_filter_simple_horizontal_edge_mmx); -prototype_simple_loopfilter(vp8_loop_filter_simple_vertical_edge_mmx); - -#if HAVE_SSE2 && ARCH_X86_64 -prototype_loopfilter(vp8_loop_filter_bv_y_sse2); -prototype_loopfilter(vp8_loop_filter_bh_y_sse2); -#else -prototype_loopfilter_nc(vp8_loop_filter_vertical_edge_sse2); -prototype_loopfilter_nc(vp8_loop_filter_horizontal_edge_sse2); -#endif -prototype_loopfilter_nc(vp8_mbloop_filter_vertical_edge_sse2); -prototype_loopfilter_nc(vp8_mbloop_filter_horizontal_edge_sse2); - -extern loop_filter_uvfunction vp8_loop_filter_horizontal_edge_uv_sse2; -extern loop_filter_uvfunction vp8_loop_filter_vertical_edge_uv_sse2; -extern loop_filter_uvfunction vp8_mbloop_filter_horizontal_edge_uv_sse2; -extern loop_filter_uvfunction vp8_mbloop_filter_vertical_edge_uv_sse2; - -#if HAVE_MMX -/* Horizontal MB filtering */ -void vp8_loop_filter_mbh_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_mbloop_filter_horizontal_edge_mmx(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); - - if (u_ptr) - vp8_mbloop_filter_horizontal_edge_mmx(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); - - if (v_ptr) - vp8_mbloop_filter_horizontal_edge_mmx(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); -} - - -/* Vertical MB Filtering */ -void vp8_loop_filter_mbv_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_mbloop_filter_vertical_edge_mmx(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); - - if (u_ptr) - vp8_mbloop_filter_vertical_edge_mmx(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); - - if (v_ptr) - vp8_mbloop_filter_vertical_edge_mmx(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); -} - - -/* Horizontal B Filtering */ -void vp8_loop_filter_bh_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_loop_filter_horizontal_edge_mmx(y_ptr + 4 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_horizontal_edge_mmx(y_ptr + 8 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_horizontal_edge_mmx(y_ptr + 12 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - - if (u_ptr) - vp8_loop_filter_horizontal_edge_mmx(u_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); - - if (v_ptr) - vp8_loop_filter_horizontal_edge_mmx(v_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); -} - - -void vp8_loop_filter_bhs_mmx(unsigned char *y_ptr, int y_stride, const unsigned char *blimit) -{ - vp8_loop_filter_simple_horizontal_edge_mmx(y_ptr + 4 * y_stride, y_stride, blimit); - vp8_loop_filter_simple_horizontal_edge_mmx(y_ptr + 8 * y_stride, y_stride, blimit); - vp8_loop_filter_simple_horizontal_edge_mmx(y_ptr + 12 * y_stride, y_stride, blimit); -} - - -/* Vertical B Filtering */ -void vp8_loop_filter_bv_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_loop_filter_vertical_edge_mmx(y_ptr + 4, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_vertical_edge_mmx(y_ptr + 8, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_vertical_edge_mmx(y_ptr + 12, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - - if (u_ptr) - vp8_loop_filter_vertical_edge_mmx(u_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); - - if (v_ptr) - vp8_loop_filter_vertical_edge_mmx(v_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); -} - - -void vp8_loop_filter_bvs_mmx(unsigned char *y_ptr, int y_stride, const unsigned char *blimit) -{ - vp8_loop_filter_simple_vertical_edge_mmx(y_ptr + 4, y_stride, blimit); - vp8_loop_filter_simple_vertical_edge_mmx(y_ptr + 8, y_stride, blimit); - vp8_loop_filter_simple_vertical_edge_mmx(y_ptr + 12, y_stride, blimit); -} -#endif - - -/* Horizontal MB filtering */ -#if HAVE_SSE2 -void vp8_loop_filter_mbh_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_mbloop_filter_horizontal_edge_sse2(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr); - - if (u_ptr) - vp8_mbloop_filter_horizontal_edge_uv_sse2(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, v_ptr); -} - - -/* Vertical MB Filtering */ -void vp8_loop_filter_mbv_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_mbloop_filter_vertical_edge_sse2(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr); - - if (u_ptr) - vp8_mbloop_filter_vertical_edge_uv_sse2(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, v_ptr); -} - - -/* Horizontal B Filtering */ -void vp8_loop_filter_bh_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ -#if ARCH_X86_64 - vp8_loop_filter_bh_y_sse2(y_ptr, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); -#else - vp8_loop_filter_horizontal_edge_sse2(y_ptr + 4 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr); - vp8_loop_filter_horizontal_edge_sse2(y_ptr + 8 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr); - vp8_loop_filter_horizontal_edge_sse2(y_ptr + 12 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr); -#endif - - if (u_ptr) - vp8_loop_filter_horizontal_edge_uv_sse2(u_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, v_ptr + 4 * uv_stride); -} - - -void vp8_loop_filter_bhs_sse2(unsigned char *y_ptr, int y_stride, const unsigned char *blimit) -{ - vp8_loop_filter_simple_horizontal_edge_sse2(y_ptr + 4 * y_stride, y_stride, blimit); - vp8_loop_filter_simple_horizontal_edge_sse2(y_ptr + 8 * y_stride, y_stride, blimit); - vp8_loop_filter_simple_horizontal_edge_sse2(y_ptr + 12 * y_stride, y_stride, blimit); -} - - -/* Vertical B Filtering */ -void vp8_loop_filter_bv_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ -#if ARCH_X86_64 - vp8_loop_filter_bv_y_sse2(y_ptr, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); -#else - vp8_loop_filter_vertical_edge_sse2(y_ptr + 4, y_stride, lfi->blim, lfi->lim, lfi->hev_thr); - vp8_loop_filter_vertical_edge_sse2(y_ptr + 8, y_stride, lfi->blim, lfi->lim, lfi->hev_thr); - vp8_loop_filter_vertical_edge_sse2(y_ptr + 12, y_stride, lfi->blim, lfi->lim, lfi->hev_thr); -#endif - - if (u_ptr) - vp8_loop_filter_vertical_edge_uv_sse2(u_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, v_ptr + 4); -} - - -void vp8_loop_filter_bvs_sse2(unsigned char *y_ptr, int y_stride, const unsigned char *blimit) -{ - vp8_loop_filter_simple_vertical_edge_sse2(y_ptr + 4, y_stride, blimit); - vp8_loop_filter_simple_vertical_edge_sse2(y_ptr + 8, y_stride, blimit); - vp8_loop_filter_simple_vertical_edge_sse2(y_ptr + 12, y_stride, blimit); -} - -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/mfqe_sse2.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/mfqe_sse2.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/mfqe_sse2.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/mfqe_sse2.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,287 +0,0 @@ -; -; Copyright (c) 2012 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -;void vp8_filter_by_weight16x16_sse2 -;( -; unsigned char *src, -; int src_stride, -; unsigned char *dst, -; int dst_stride, -; int src_weight -;) -global sym(vp8_filter_by_weight16x16_sse2) PRIVATE -sym(vp8_filter_by_weight16x16_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - SAVE_XMM 6 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - movd xmm0, arg(4) ; src_weight - pshuflw xmm0, xmm0, 0x0 ; replicate to all low words - punpcklqdq xmm0, xmm0 ; replicate to all hi words - - movdqa xmm1, [GLOBAL(tMFQE)] - psubw xmm1, xmm0 ; dst_weight - - mov rax, arg(0) ; src - mov rsi, arg(1) ; src_stride - mov rdx, arg(2) ; dst - mov rdi, arg(3) ; dst_stride - - mov rcx, 16 ; loop count - pxor xmm6, xmm6 - -.combine - movdqa xmm2, [rax] - movdqa xmm4, [rdx] - add rax, rsi - - ; src * src_weight - movdqa xmm3, xmm2 - punpcklbw xmm2, xmm6 - punpckhbw xmm3, xmm6 - pmullw xmm2, xmm0 - pmullw xmm3, xmm0 - - ; dst * dst_weight - movdqa xmm5, xmm4 - punpcklbw xmm4, xmm6 - punpckhbw xmm5, xmm6 - pmullw xmm4, xmm1 - pmullw xmm5, xmm1 - - ; sum, round and shift - paddw xmm2, xmm4 - paddw xmm3, xmm5 - paddw xmm2, [GLOBAL(tMFQE_round)] - paddw xmm3, [GLOBAL(tMFQE_round)] - psrlw xmm2, 4 - psrlw xmm3, 4 - - packuswb xmm2, xmm3 - movdqa [rdx], xmm2 - add rdx, rdi - - dec rcx - jnz .combine - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - - ret - -;void vp8_filter_by_weight8x8_sse2 -;( -; unsigned char *src, -; int src_stride, -; unsigned char *dst, -; int dst_stride, -; int src_weight -;) -global sym(vp8_filter_by_weight8x8_sse2) PRIVATE -sym(vp8_filter_by_weight8x8_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - movd xmm0, arg(4) ; src_weight - pshuflw xmm0, xmm0, 0x0 ; replicate to all low words - punpcklqdq xmm0, xmm0 ; replicate to all hi words - - movdqa xmm1, [GLOBAL(tMFQE)] - psubw xmm1, xmm0 ; dst_weight - - mov rax, arg(0) ; src - mov rsi, arg(1) ; src_stride - mov rdx, arg(2) ; dst - mov rdi, arg(3) ; dst_stride - - mov rcx, 8 ; loop count - pxor xmm4, xmm4 - -.combine - movq xmm2, [rax] - movq xmm3, [rdx] - add rax, rsi - - ; src * src_weight - punpcklbw xmm2, xmm4 - pmullw xmm2, xmm0 - - ; dst * dst_weight - punpcklbw xmm3, xmm4 - pmullw xmm3, xmm1 - - ; sum, round and shift - paddw xmm2, xmm3 - paddw xmm2, [GLOBAL(tMFQE_round)] - psrlw xmm2, 4 - - packuswb xmm2, xmm4 - movq [rdx], xmm2 - add rdx, rdi - - dec rcx - jnz .combine - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - - ret - -;void vp8_variance_and_sad_16x16_sse2 | arg -;( -; unsigned char *src1, 0 -; int stride1, 1 -; unsigned char *src2, 2 -; int stride2, 3 -; unsigned int *variance, 4 -; unsigned int *sad, 5 -;) -global sym(vp8_variance_and_sad_16x16_sse2) PRIVATE -sym(vp8_variance_and_sad_16x16_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - mov rax, arg(0) ; src1 - mov rcx, arg(1) ; stride1 - mov rdx, arg(2) ; src2 - mov rdi, arg(3) ; stride2 - - mov rsi, 16 ; block height - - ; Prep accumulator registers - pxor xmm3, xmm3 ; SAD - pxor xmm4, xmm4 ; sum of src2 - pxor xmm5, xmm5 ; sum of src2^2 - - ; Because we're working with the actual output frames - ; we can't depend on any kind of data alignment. -.accumulate - movdqa xmm0, [rax] ; src1 - movdqa xmm1, [rdx] ; src2 - add rax, rcx ; src1 + stride1 - add rdx, rdi ; src2 + stride2 - - ; SAD(src1, src2) - psadbw xmm0, xmm1 - paddusw xmm3, xmm0 - - ; SUM(src2) - pxor xmm2, xmm2 - psadbw xmm2, xmm1 ; sum src2 by misusing SAD against 0 - paddusw xmm4, xmm2 - - ; pmaddubsw would be ideal if it took two unsigned values. instead, - ; it expects a signed and an unsigned value. so instead we zero extend - ; and operate on words. - pxor xmm2, xmm2 - movdqa xmm0, xmm1 - punpcklbw xmm0, xmm2 - punpckhbw xmm1, xmm2 - pmaddwd xmm0, xmm0 - pmaddwd xmm1, xmm1 - paddd xmm5, xmm0 - paddd xmm5, xmm1 - - sub rsi, 1 - jnz .accumulate - - ; phaddd only operates on adjacent double words. - ; Finalize SAD and store - movdqa xmm0, xmm3 - psrldq xmm0, 8 - paddusw xmm0, xmm3 - paddd xmm0, [GLOBAL(t128)] - psrld xmm0, 8 - - mov rax, arg(5) - movd [rax], xmm0 - - ; Accumulate sum of src2 - movdqa xmm0, xmm4 - psrldq xmm0, 8 - paddusw xmm0, xmm4 - ; Square src2. Ignore high value - pmuludq xmm0, xmm0 - psrld xmm0, 8 - - ; phaddw could be used to sum adjacent values but we want - ; all the values summed. promote to doubles, accumulate, - ; shift and sum - pxor xmm2, xmm2 - movdqa xmm1, xmm5 - punpckldq xmm1, xmm2 - punpckhdq xmm5, xmm2 - paddd xmm1, xmm5 - movdqa xmm2, xmm1 - psrldq xmm1, 8 - paddd xmm1, xmm2 - - psubd xmm1, xmm0 - - ; (variance + 128) >> 8 - paddd xmm1, [GLOBAL(t128)] - psrld xmm1, 8 - mov rax, arg(4) - - movd [rax], xmm1 - - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - -SECTION_RODATA -align 16 -t128: -%ifndef __NASM_VER__ - ddq 128 -%elif CONFIG_BIG_ENDIAN - dq 0, 128 -%else - dq 128, 0 -%endif -align 16 -tMFQE: ; 1 << MFQE_PRECISION - times 8 dw 0x10 -align 16 -tMFQE_round: ; 1 << (MFQE_PRECISION - 1) - times 8 dw 0x08 - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/postproc_mmx.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/postproc_mmx.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/postproc_mmx.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/postproc_mmx.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,315 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -%define VP8_FILTER_WEIGHT 128 -%define VP8_FILTER_SHIFT 7 - -;void vp8_mbpost_proc_down_mmx(unsigned char *dst, -; int pitch, int rows, int cols,int flimit) -extern sym(vp8_rv) -global sym(vp8_mbpost_proc_down_mmx) PRIVATE -sym(vp8_mbpost_proc_down_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, 136 - - ; unsigned char d[16][8] at [rsp] - ; create flimit2 at [rsp+128] - mov eax, dword ptr arg(4) ;flimit - mov [rsp+128], eax - mov [rsp+128+4], eax -%define flimit2 [rsp+128] - -%if ABI_IS_32BIT=0 - lea r8, [GLOBAL(sym(vp8_rv))] -%endif - - ;rows +=8; - add dword ptr arg(2), 8 - - ;for(c=0; cmode_info_context->mbmi.uv_mode; - build_intra_predictors_mbuv_fn_t fn; - - switch (mode) { - case V_PRED: fn = vp8_intra_pred_uv_ve_mmx; break; - case H_PRED: fn = ho_func; break; - case TM_PRED: fn = tm_func; break; - case DC_PRED: - if (x->up_available) { - if (x->left_available) { - fn = vp8_intra_pred_uv_dc_mmx2; break; - } else { - fn = vp8_intra_pred_uv_dctop_mmx2; break; - } - } else if (x->left_available) { - fn = vp8_intra_pred_uv_dcleft_mmx2; break; - } else { - fn = vp8_intra_pred_uv_dc128_mmx; break; - } - break; - default: return; - } - - fn(dst_u, dst_stride, uabove_row, uleft, left_stride); - fn(dst_v, dst_stride, vabove_row, vleft, left_stride); -} - -void vp8_build_intra_predictors_mbuv_s_sse2(MACROBLOCKD *x, - unsigned char * uabove_row, - unsigned char * vabove_row, - unsigned char * uleft, - unsigned char * vleft, - int left_stride, - unsigned char * upred_ptr, - unsigned char * vpred_ptr, - int pred_stride) -{ - vp8_build_intra_predictors_mbuv_x86(x, - uabove_row, vabove_row, - upred_ptr, - vpred_ptr, pred_stride, - uleft, - vleft, - left_stride, - vp8_intra_pred_uv_tm_sse2, - vp8_intra_pred_uv_ho_mmx2); -} - -void vp8_build_intra_predictors_mbuv_s_ssse3(MACROBLOCKD *x, - unsigned char * uabove_row, - unsigned char * vabove_row, - unsigned char * uleft, - unsigned char * vleft, - int left_stride, - unsigned char * upred_ptr, - unsigned char * vpred_ptr, - int pred_stride) -{ - vp8_build_intra_predictors_mbuv_x86(x, - uabove_row, vabove_row, - upred_ptr, - vpred_ptr, pred_stride, - uleft, - vleft, - left_stride, - vp8_intra_pred_uv_tm_ssse3, - vp8_intra_pred_uv_ho_ssse3); -} - -#define build_intra_predictors_mby_prototype(sym) \ - void sym(unsigned char *dst, int dst_stride, \ - const unsigned char *above, \ - const unsigned char *left, int left_stride) -typedef build_intra_predictors_mby_prototype((*build_intra_predictors_mby_fn_t)); - -extern build_intra_predictors_mby_prototype(vp8_intra_pred_y_dc_sse2); -extern build_intra_predictors_mby_prototype(vp8_intra_pred_y_dctop_sse2); -extern build_intra_predictors_mby_prototype(vp8_intra_pred_y_dcleft_sse2); -extern build_intra_predictors_mby_prototype(vp8_intra_pred_y_dc128_sse2); -extern build_intra_predictors_mby_prototype(vp8_intra_pred_y_ho_sse2); -extern build_intra_predictors_mby_prototype(vp8_intra_pred_y_ve_sse2); -extern build_intra_predictors_mby_prototype(vp8_intra_pred_y_tm_sse2); -extern build_intra_predictors_mby_prototype(vp8_intra_pred_y_tm_ssse3); - -static void vp8_build_intra_predictors_mby_x86(MACROBLOCKD *x, - unsigned char * yabove_row, - unsigned char *dst_y, - int dst_stride, - unsigned char * yleft, - int left_stride, - build_intra_predictors_mby_fn_t tm_func) -{ - int mode = x->mode_info_context->mbmi.mode; - build_intra_predictors_mbuv_fn_t fn; - - switch (mode) { - case V_PRED: fn = vp8_intra_pred_y_ve_sse2; break; - case H_PRED: fn = vp8_intra_pred_y_ho_sse2; break; - case TM_PRED: fn = tm_func; break; - case DC_PRED: - if (x->up_available) { - if (x->left_available) { - fn = vp8_intra_pred_y_dc_sse2; break; - } else { - fn = vp8_intra_pred_y_dctop_sse2; break; - } - } else if (x->left_available) { - fn = vp8_intra_pred_y_dcleft_sse2; break; - } else { - fn = vp8_intra_pred_y_dc128_sse2; break; - } - break; - default: return; - } - - fn(dst_y, dst_stride, yabove_row, yleft, left_stride); - return; -} - -void vp8_build_intra_predictors_mby_s_sse2(MACROBLOCKD *x, - unsigned char * yabove_row, - unsigned char * yleft, - int left_stride, - unsigned char * ypred_ptr, - int y_stride) -{ - vp8_build_intra_predictors_mby_x86(x, yabove_row, ypred_ptr, - y_stride, yleft, left_stride, - vp8_intra_pred_y_tm_sse2); -} - -void vp8_build_intra_predictors_mby_s_ssse3(MACROBLOCKD *x, - unsigned char * yabove_row, - unsigned char * yleft, - int left_stride, - unsigned char * ypred_ptr, - int y_stride) -{ - vp8_build_intra_predictors_mby_x86(x, yabove_row, ypred_ptr, - y_stride, yleft, left_stride, - vp8_intra_pred_y_tm_ssse3); - -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/sad_mmx.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/sad_mmx.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/sad_mmx.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/sad_mmx.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,427 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -global sym(vp8_sad16x16_mmx) PRIVATE -global sym(vp8_sad8x16_mmx) PRIVATE -global sym(vp8_sad8x8_mmx) PRIVATE -global sym(vp8_sad4x4_mmx) PRIVATE -global sym(vp8_sad16x8_mmx) PRIVATE - -;unsigned int vp8_sad16x16_mmx( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride) -sym(vp8_sad16x16_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 4 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - lea rcx, [rsi+rax*8] - - lea rcx, [rcx+rax*8] - pxor mm7, mm7 - - pxor mm6, mm6 - -.x16x16sad_mmx_loop: - - movq mm0, QWORD PTR [rsi] - movq mm2, QWORD PTR [rsi+8] - - movq mm1, QWORD PTR [rdi] - movq mm3, QWORD PTR [rdi+8] - - movq mm4, mm0 - movq mm5, mm2 - - psubusb mm0, mm1 - psubusb mm1, mm4 - - psubusb mm2, mm3 - psubusb mm3, mm5 - - por mm0, mm1 - por mm2, mm3 - - movq mm1, mm0 - movq mm3, mm2 - - punpcklbw mm0, mm6 - punpcklbw mm2, mm6 - - punpckhbw mm1, mm6 - punpckhbw mm3, mm6 - - paddw mm0, mm2 - paddw mm1, mm3 - - - lea rsi, [rsi+rax] - add rdi, rdx - - paddw mm7, mm0 - paddw mm7, mm1 - - cmp rsi, rcx - jne .x16x16sad_mmx_loop - - - movq mm0, mm7 - - punpcklwd mm0, mm6 - punpckhwd mm7, mm6 - - paddw mm0, mm7 - movq mm7, mm0 - - - psrlq mm0, 32 - paddw mm7, mm0 - - movq rax, mm7 - - pop rdi - pop rsi - mov rsp, rbp - ; begin epilog - UNSHADOW_ARGS - pop rbp - ret - - -;unsigned int vp8_sad8x16_mmx( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride) -sym(vp8_sad8x16_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 4 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - lea rcx, [rsi+rax*8] - - lea rcx, [rcx+rax*8] - pxor mm7, mm7 - - pxor mm6, mm6 - -.x8x16sad_mmx_loop: - - movq mm0, QWORD PTR [rsi] - movq mm1, QWORD PTR [rdi] - - movq mm2, mm0 - psubusb mm0, mm1 - - psubusb mm1, mm2 - por mm0, mm1 - - movq mm2, mm0 - punpcklbw mm0, mm6 - - punpckhbw mm2, mm6 - lea rsi, [rsi+rax] - - add rdi, rdx - paddw mm7, mm0 - - paddw mm7, mm2 - cmp rsi, rcx - - jne .x8x16sad_mmx_loop - - movq mm0, mm7 - punpcklwd mm0, mm6 - - punpckhwd mm7, mm6 - paddw mm0, mm7 - - movq mm7, mm0 - psrlq mm0, 32 - - paddw mm7, mm0 - movq rax, mm7 - - pop rdi - pop rsi - mov rsp, rbp - ; begin epilog - UNSHADOW_ARGS - pop rbp - ret - - -;unsigned int vp8_sad8x8_mmx( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride) -sym(vp8_sad8x8_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 4 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - lea rcx, [rsi+rax*8] - pxor mm7, mm7 - - pxor mm6, mm6 - -.x8x8sad_mmx_loop: - - movq mm0, QWORD PTR [rsi] - movq mm1, QWORD PTR [rdi] - - movq mm2, mm0 - psubusb mm0, mm1 - - psubusb mm1, mm2 - por mm0, mm1 - - movq mm2, mm0 - punpcklbw mm0, mm6 - - punpckhbw mm2, mm6 - paddw mm0, mm2 - - lea rsi, [rsi+rax] - add rdi, rdx - - paddw mm7, mm0 - cmp rsi, rcx - - jne .x8x8sad_mmx_loop - - movq mm0, mm7 - punpcklwd mm0, mm6 - - punpckhwd mm7, mm6 - paddw mm0, mm7 - - movq mm7, mm0 - psrlq mm0, 32 - - paddw mm7, mm0 - movq rax, mm7 - - pop rdi - pop rsi - mov rsp, rbp - ; begin epilog - UNSHADOW_ARGS - pop rbp - ret - - -;unsigned int vp8_sad4x4_mmx( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride) -sym(vp8_sad4x4_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 4 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - movd mm0, DWORD PTR [rsi] - movd mm1, DWORD PTR [rdi] - - movd mm2, DWORD PTR [rsi+rax] - movd mm3, DWORD PTR [rdi+rdx] - - punpcklbw mm0, mm2 - punpcklbw mm1, mm3 - - movq mm2, mm0 - psubusb mm0, mm1 - - psubusb mm1, mm2 - por mm0, mm1 - - movq mm2, mm0 - pxor mm3, mm3 - - punpcklbw mm0, mm3 - punpckhbw mm2, mm3 - - paddw mm0, mm2 - - lea rsi, [rsi+rax*2] - lea rdi, [rdi+rdx*2] - - movd mm4, DWORD PTR [rsi] - movd mm5, DWORD PTR [rdi] - - movd mm6, DWORD PTR [rsi+rax] - movd mm7, DWORD PTR [rdi+rdx] - - punpcklbw mm4, mm6 - punpcklbw mm5, mm7 - - movq mm6, mm4 - psubusb mm4, mm5 - - psubusb mm5, mm6 - por mm4, mm5 - - movq mm5, mm4 - punpcklbw mm4, mm3 - - punpckhbw mm5, mm3 - paddw mm4, mm5 - - paddw mm0, mm4 - movq mm1, mm0 - - punpcklwd mm0, mm3 - punpckhwd mm1, mm3 - - paddw mm0, mm1 - movq mm1, mm0 - - psrlq mm0, 32 - paddw mm0, mm1 - - movq rax, mm0 - - pop rdi - pop rsi - mov rsp, rbp - ; begin epilog - UNSHADOW_ARGS - pop rbp - ret - - -;unsigned int vp8_sad16x8_mmx( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride) -sym(vp8_sad16x8_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 4 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - lea rcx, [rsi+rax*8] - pxor mm7, mm7 - - pxor mm6, mm6 - -.x16x8sad_mmx_loop: - - movq mm0, [rsi] - movq mm1, [rdi] - - movq mm2, [rsi+8] - movq mm3, [rdi+8] - - movq mm4, mm0 - movq mm5, mm2 - - psubusb mm0, mm1 - psubusb mm1, mm4 - - psubusb mm2, mm3 - psubusb mm3, mm5 - - por mm0, mm1 - por mm2, mm3 - - movq mm1, mm0 - movq mm3, mm2 - - punpcklbw mm0, mm6 - punpckhbw mm1, mm6 - - punpcklbw mm2, mm6 - punpckhbw mm3, mm6 - - - paddw mm0, mm2 - paddw mm1, mm3 - - paddw mm0, mm1 - lea rsi, [rsi+rax] - - add rdi, rdx - paddw mm7, mm0 - - cmp rsi, rcx - jne .x16x8sad_mmx_loop - - movq mm0, mm7 - punpcklwd mm0, mm6 - - punpckhwd mm7, mm6 - paddw mm0, mm7 - - movq mm7, mm0 - psrlq mm0, 32 - - paddw mm7, mm0 - movq rax, mm7 - - pop rdi - pop rsi - mov rsp, rbp - ; begin epilog - UNSHADOW_ARGS - pop rbp - ret diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/sad_sse2.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/sad_sse2.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/sad_sse2.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/sad_sse2.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,410 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -;unsigned int vp8_sad16x16_wmt( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride) -global sym(vp8_sad16x16_wmt) PRIVATE -sym(vp8_sad16x16_wmt): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 4 - SAVE_XMM 6 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - lea rcx, [rsi+rax*8] - - lea rcx, [rcx+rax*8] - pxor xmm6, xmm6 - -.x16x16sad_wmt_loop: - - movq xmm0, QWORD PTR [rsi] - movq xmm2, QWORD PTR [rsi+8] - - movq xmm1, QWORD PTR [rdi] - movq xmm3, QWORD PTR [rdi+8] - - movq xmm4, QWORD PTR [rsi+rax] - movq xmm5, QWORD PTR [rdi+rdx] - - - punpcklbw xmm0, xmm2 - punpcklbw xmm1, xmm3 - - psadbw xmm0, xmm1 - movq xmm2, QWORD PTR [rsi+rax+8] - - movq xmm3, QWORD PTR [rdi+rdx+8] - lea rsi, [rsi+rax*2] - - lea rdi, [rdi+rdx*2] - punpcklbw xmm4, xmm2 - - punpcklbw xmm5, xmm3 - psadbw xmm4, xmm5 - - paddw xmm6, xmm0 - paddw xmm6, xmm4 - - cmp rsi, rcx - jne .x16x16sad_wmt_loop - - movq xmm0, xmm6 - psrldq xmm6, 8 - - paddw xmm0, xmm6 - movq rax, xmm0 - - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -;unsigned int vp8_sad8x16_wmt( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride, -; int max_sad) -global sym(vp8_sad8x16_wmt) PRIVATE -sym(vp8_sad8x16_wmt): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - push rbx - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - movsxd rbx, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - lea rcx, [rsi+rbx*8] - - lea rcx, [rcx+rbx*8] - pxor mm7, mm7 - -.x8x16sad_wmt_loop: - - movq rax, mm7 - cmp eax, arg(4) - ja .x8x16sad_wmt_early_exit - - movq mm0, QWORD PTR [rsi] - movq mm1, QWORD PTR [rdi] - - movq mm2, QWORD PTR [rsi+rbx] - movq mm3, QWORD PTR [rdi+rdx] - - psadbw mm0, mm1 - psadbw mm2, mm3 - - lea rsi, [rsi+rbx*2] - lea rdi, [rdi+rdx*2] - - paddw mm7, mm0 - paddw mm7, mm2 - - cmp rsi, rcx - jne .x8x16sad_wmt_loop - - movq rax, mm7 - -.x8x16sad_wmt_early_exit: - - ; begin epilog - pop rdi - pop rsi - pop rbx - UNSHADOW_ARGS - pop rbp - ret - - -;unsigned int vp8_sad8x8_wmt( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride) -global sym(vp8_sad8x8_wmt) PRIVATE -sym(vp8_sad8x8_wmt): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - push rbx - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - movsxd rbx, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - lea rcx, [rsi+rbx*8] - pxor mm7, mm7 - -.x8x8sad_wmt_loop: - - movq rax, mm7 - cmp eax, arg(4) - ja .x8x8sad_wmt_early_exit - - movq mm0, QWORD PTR [rsi] - movq mm1, QWORD PTR [rdi] - - psadbw mm0, mm1 - lea rsi, [rsi+rbx] - - add rdi, rdx - paddw mm7, mm0 - - cmp rsi, rcx - jne .x8x8sad_wmt_loop - - movq rax, mm7 -.x8x8sad_wmt_early_exit: - - ; begin epilog - pop rdi - pop rsi - pop rbx - UNSHADOW_ARGS - pop rbp - ret - -;unsigned int vp8_sad4x4_wmt( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride) -global sym(vp8_sad4x4_wmt) PRIVATE -sym(vp8_sad4x4_wmt): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 4 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - movd mm0, DWORD PTR [rsi] - movd mm1, DWORD PTR [rdi] - - movd mm2, DWORD PTR [rsi+rax] - movd mm3, DWORD PTR [rdi+rdx] - - punpcklbw mm0, mm2 - punpcklbw mm1, mm3 - - psadbw mm0, mm1 - lea rsi, [rsi+rax*2] - - lea rdi, [rdi+rdx*2] - movd mm4, DWORD PTR [rsi] - - movd mm5, DWORD PTR [rdi] - movd mm6, DWORD PTR [rsi+rax] - - movd mm7, DWORD PTR [rdi+rdx] - punpcklbw mm4, mm6 - - punpcklbw mm5, mm7 - psadbw mm4, mm5 - - paddw mm0, mm4 - movq rax, mm0 - - ; begin epilog - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret - - -;unsigned int vp8_sad16x8_wmt( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride) -global sym(vp8_sad16x8_wmt) PRIVATE -sym(vp8_sad16x8_wmt): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - push rbx - push rsi - push rdi - ; end prolog - - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - movsxd rbx, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - lea rcx, [rsi+rbx*8] - pxor mm7, mm7 - -.x16x8sad_wmt_loop: - - movq rax, mm7 - cmp eax, arg(4) - ja .x16x8sad_wmt_early_exit - - movq mm0, QWORD PTR [rsi] - movq mm2, QWORD PTR [rsi+8] - - movq mm1, QWORD PTR [rdi] - movq mm3, QWORD PTR [rdi+8] - - movq mm4, QWORD PTR [rsi+rbx] - movq mm5, QWORD PTR [rdi+rdx] - - psadbw mm0, mm1 - psadbw mm2, mm3 - - movq mm1, QWORD PTR [rsi+rbx+8] - movq mm3, QWORD PTR [rdi+rdx+8] - - psadbw mm4, mm5 - psadbw mm1, mm3 - - lea rsi, [rsi+rbx*2] - lea rdi, [rdi+rdx*2] - - paddw mm0, mm2 - paddw mm4, mm1 - - paddw mm7, mm0 - paddw mm7, mm4 - - cmp rsi, rcx - jne .x16x8sad_wmt_loop - - movq rax, mm7 - -.x16x8sad_wmt_early_exit: - - ; begin epilog - pop rdi - pop rsi - pop rbx - UNSHADOW_ARGS - pop rbp - ret - -;void vp8_copy32xn_sse2( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *dst_ptr, -; int dst_stride, -; int height); -global sym(vp8_copy32xn_sse2) PRIVATE -sym(vp8_copy32xn_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - SAVE_XMM 7 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;dst_ptr - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;dst_stride - movsxd rcx, dword ptr arg(4) ;height - -.block_copy_sse2_loopx4: - movdqu xmm0, XMMWORD PTR [rsi] - movdqu xmm1, XMMWORD PTR [rsi + 16] - movdqu xmm2, XMMWORD PTR [rsi + rax] - movdqu xmm3, XMMWORD PTR [rsi + rax + 16] - - lea rsi, [rsi+rax*2] - - movdqu xmm4, XMMWORD PTR [rsi] - movdqu xmm5, XMMWORD PTR [rsi + 16] - movdqu xmm6, XMMWORD PTR [rsi + rax] - movdqu xmm7, XMMWORD PTR [rsi + rax + 16] - - lea rsi, [rsi+rax*2] - - movdqa XMMWORD PTR [rdi], xmm0 - movdqa XMMWORD PTR [rdi + 16], xmm1 - movdqa XMMWORD PTR [rdi + rdx], xmm2 - movdqa XMMWORD PTR [rdi + rdx + 16], xmm3 - - lea rdi, [rdi+rdx*2] - - movdqa XMMWORD PTR [rdi], xmm4 - movdqa XMMWORD PTR [rdi + 16], xmm5 - movdqa XMMWORD PTR [rdi + rdx], xmm6 - movdqa XMMWORD PTR [rdi + rdx + 16], xmm7 - - lea rdi, [rdi+rdx*2] - - sub rcx, 4 - cmp rcx, 4 - jge .block_copy_sse2_loopx4 - - cmp rcx, 0 - je .copy_is_done - -.block_copy_sse2_loop: - movdqu xmm0, XMMWORD PTR [rsi] - movdqu xmm1, XMMWORD PTR [rsi + 16] - lea rsi, [rsi+rax] - - movdqa XMMWORD PTR [rdi], xmm0 - movdqa XMMWORD PTR [rdi + 16], xmm1 - lea rdi, [rdi+rdx] - - sub rcx, 1 - jne .block_copy_sse2_loop - -.copy_is_done: - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/sad_sse3.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/sad_sse3.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/sad_sse3.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/sad_sse3.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,960 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - -%include "vpx_ports/x86_abi_support.asm" - -%macro STACK_FRAME_CREATE_X3 0 -%if ABI_IS_32BIT - %define src_ptr rsi - %define src_stride rax - %define ref_ptr rdi - %define ref_stride rdx - %define end_ptr rcx - %define ret_var rbx - %define result_ptr arg(4) - %define max_sad arg(4) - %define height dword ptr arg(4) - push rbp - mov rbp, rsp - push rsi - push rdi - push rbx - - mov rsi, arg(0) ; src_ptr - mov rdi, arg(2) ; ref_ptr - - movsxd rax, dword ptr arg(1) ; src_stride - movsxd rdx, dword ptr arg(3) ; ref_stride -%else - %if LIBVPX_YASM_WIN64 - SAVE_XMM 7, u - %define src_ptr rcx - %define src_stride rdx - %define ref_ptr r8 - %define ref_stride r9 - %define end_ptr r10 - %define ret_var r11 - %define result_ptr [rsp+xmm_stack_space+8+4*8] - %define max_sad [rsp+xmm_stack_space+8+4*8] - %define height dword ptr [rsp+xmm_stack_space+8+4*8] - %else - %define src_ptr rdi - %define src_stride rsi - %define ref_ptr rdx - %define ref_stride rcx - %define end_ptr r9 - %define ret_var r10 - %define result_ptr r8 - %define max_sad r8 - %define height r8 - %endif -%endif - -%endmacro - -%macro STACK_FRAME_DESTROY_X3 0 - %define src_ptr - %define src_stride - %define ref_ptr - %define ref_stride - %define end_ptr - %define ret_var - %define result_ptr - %define max_sad - %define height - -%if ABI_IS_32BIT - pop rbx - pop rdi - pop rsi - pop rbp -%else - %if LIBVPX_YASM_WIN64 - RESTORE_XMM - %endif -%endif - ret -%endmacro - -%macro STACK_FRAME_CREATE_X4 0 -%if ABI_IS_32BIT - %define src_ptr rsi - %define src_stride rax - %define r0_ptr rcx - %define r1_ptr rdx - %define r2_ptr rbx - %define r3_ptr rdi - %define ref_stride rbp - %define result_ptr arg(4) - push rbp - mov rbp, rsp - push rsi - push rdi - push rbx - - push rbp - mov rdi, arg(2) ; ref_ptr_base - - LOAD_X4_ADDRESSES rdi, rcx, rdx, rax, rdi - - mov rsi, arg(0) ; src_ptr - - movsxd rbx, dword ptr arg(1) ; src_stride - movsxd rbp, dword ptr arg(3) ; ref_stride - - xchg rbx, rax -%else - %if LIBVPX_YASM_WIN64 - SAVE_XMM 7, u - %define src_ptr rcx - %define src_stride rdx - %define r0_ptr rsi - %define r1_ptr r10 - %define r2_ptr r11 - %define r3_ptr r8 - %define ref_stride r9 - %define result_ptr [rsp+xmm_stack_space+16+4*8] - push rsi - - LOAD_X4_ADDRESSES r8, r0_ptr, r1_ptr, r2_ptr, r3_ptr - %else - %define src_ptr rdi - %define src_stride rsi - %define r0_ptr r9 - %define r1_ptr r10 - %define r2_ptr r11 - %define r3_ptr rdx - %define ref_stride rcx - %define result_ptr r8 - - LOAD_X4_ADDRESSES rdx, r0_ptr, r1_ptr, r2_ptr, r3_ptr - - %endif -%endif -%endmacro - -%macro STACK_FRAME_DESTROY_X4 0 - %define src_ptr - %define src_stride - %define r0_ptr - %define r1_ptr - %define r2_ptr - %define r3_ptr - %define ref_stride - %define result_ptr - -%if ABI_IS_32BIT - pop rbx - pop rdi - pop rsi - pop rbp -%else - %if LIBVPX_YASM_WIN64 - pop rsi - RESTORE_XMM - %endif -%endif - ret -%endmacro - -%macro PROCESS_16X2X3 5 -%if %1==0 - movdqa xmm0, XMMWORD PTR [%2] - lddqu xmm5, XMMWORD PTR [%3] - lddqu xmm6, XMMWORD PTR [%3+1] - lddqu xmm7, XMMWORD PTR [%3+2] - - psadbw xmm5, xmm0 - psadbw xmm6, xmm0 - psadbw xmm7, xmm0 -%else - movdqa xmm0, XMMWORD PTR [%2] - lddqu xmm1, XMMWORD PTR [%3] - lddqu xmm2, XMMWORD PTR [%3+1] - lddqu xmm3, XMMWORD PTR [%3+2] - - psadbw xmm1, xmm0 - psadbw xmm2, xmm0 - psadbw xmm3, xmm0 - - paddw xmm5, xmm1 - paddw xmm6, xmm2 - paddw xmm7, xmm3 -%endif - movdqa xmm0, XMMWORD PTR [%2+%4] - lddqu xmm1, XMMWORD PTR [%3+%5] - lddqu xmm2, XMMWORD PTR [%3+%5+1] - lddqu xmm3, XMMWORD PTR [%3+%5+2] - -%if %1==0 || %1==1 - lea %2, [%2+%4*2] - lea %3, [%3+%5*2] -%endif - - psadbw xmm1, xmm0 - psadbw xmm2, xmm0 - psadbw xmm3, xmm0 - - paddw xmm5, xmm1 - paddw xmm6, xmm2 - paddw xmm7, xmm3 -%endmacro - -%macro PROCESS_8X2X3 5 -%if %1==0 - movq mm0, QWORD PTR [%2] - movq mm5, QWORD PTR [%3] - movq mm6, QWORD PTR [%3+1] - movq mm7, QWORD PTR [%3+2] - - psadbw mm5, mm0 - psadbw mm6, mm0 - psadbw mm7, mm0 -%else - movq mm0, QWORD PTR [%2] - movq mm1, QWORD PTR [%3] - movq mm2, QWORD PTR [%3+1] - movq mm3, QWORD PTR [%3+2] - - psadbw mm1, mm0 - psadbw mm2, mm0 - psadbw mm3, mm0 - - paddw mm5, mm1 - paddw mm6, mm2 - paddw mm7, mm3 -%endif - movq mm0, QWORD PTR [%2+%4] - movq mm1, QWORD PTR [%3+%5] - movq mm2, QWORD PTR [%3+%5+1] - movq mm3, QWORD PTR [%3+%5+2] - -%if %1==0 || %1==1 - lea %2, [%2+%4*2] - lea %3, [%3+%5*2] -%endif - - psadbw mm1, mm0 - psadbw mm2, mm0 - psadbw mm3, mm0 - - paddw mm5, mm1 - paddw mm6, mm2 - paddw mm7, mm3 -%endmacro - -%macro LOAD_X4_ADDRESSES 5 - mov %2, [%1+REG_SZ_BYTES*0] - mov %3, [%1+REG_SZ_BYTES*1] - - mov %4, [%1+REG_SZ_BYTES*2] - mov %5, [%1+REG_SZ_BYTES*3] -%endmacro - -%macro PROCESS_16X2X4 8 -%if %1==0 - movdqa xmm0, XMMWORD PTR [%2] - lddqu xmm4, XMMWORD PTR [%3] - lddqu xmm5, XMMWORD PTR [%4] - lddqu xmm6, XMMWORD PTR [%5] - lddqu xmm7, XMMWORD PTR [%6] - - psadbw xmm4, xmm0 - psadbw xmm5, xmm0 - psadbw xmm6, xmm0 - psadbw xmm7, xmm0 -%else - movdqa xmm0, XMMWORD PTR [%2] - lddqu xmm1, XMMWORD PTR [%3] - lddqu xmm2, XMMWORD PTR [%4] - lddqu xmm3, XMMWORD PTR [%5] - - psadbw xmm1, xmm0 - psadbw xmm2, xmm0 - psadbw xmm3, xmm0 - - paddw xmm4, xmm1 - lddqu xmm1, XMMWORD PTR [%6] - paddw xmm5, xmm2 - paddw xmm6, xmm3 - - psadbw xmm1, xmm0 - paddw xmm7, xmm1 -%endif - movdqa xmm0, XMMWORD PTR [%2+%7] - lddqu xmm1, XMMWORD PTR [%3+%8] - lddqu xmm2, XMMWORD PTR [%4+%8] - lddqu xmm3, XMMWORD PTR [%5+%8] - - psadbw xmm1, xmm0 - psadbw xmm2, xmm0 - psadbw xmm3, xmm0 - - paddw xmm4, xmm1 - lddqu xmm1, XMMWORD PTR [%6+%8] - paddw xmm5, xmm2 - paddw xmm6, xmm3 - -%if %1==0 || %1==1 - lea %2, [%2+%7*2] - lea %3, [%3+%8*2] - - lea %4, [%4+%8*2] - lea %5, [%5+%8*2] - - lea %6, [%6+%8*2] -%endif - psadbw xmm1, xmm0 - paddw xmm7, xmm1 - -%endmacro - -%macro PROCESS_8X2X4 8 -%if %1==0 - movq mm0, QWORD PTR [%2] - movq mm4, QWORD PTR [%3] - movq mm5, QWORD PTR [%4] - movq mm6, QWORD PTR [%5] - movq mm7, QWORD PTR [%6] - - psadbw mm4, mm0 - psadbw mm5, mm0 - psadbw mm6, mm0 - psadbw mm7, mm0 -%else - movq mm0, QWORD PTR [%2] - movq mm1, QWORD PTR [%3] - movq mm2, QWORD PTR [%4] - movq mm3, QWORD PTR [%5] - - psadbw mm1, mm0 - psadbw mm2, mm0 - psadbw mm3, mm0 - - paddw mm4, mm1 - movq mm1, QWORD PTR [%6] - paddw mm5, mm2 - paddw mm6, mm3 - - psadbw mm1, mm0 - paddw mm7, mm1 -%endif - movq mm0, QWORD PTR [%2+%7] - movq mm1, QWORD PTR [%3+%8] - movq mm2, QWORD PTR [%4+%8] - movq mm3, QWORD PTR [%5+%8] - - psadbw mm1, mm0 - psadbw mm2, mm0 - psadbw mm3, mm0 - - paddw mm4, mm1 - movq mm1, QWORD PTR [%6+%8] - paddw mm5, mm2 - paddw mm6, mm3 - -%if %1==0 || %1==1 - lea %2, [%2+%7*2] - lea %3, [%3+%8*2] - - lea %4, [%4+%8*2] - lea %5, [%5+%8*2] - - lea %6, [%6+%8*2] -%endif - psadbw mm1, mm0 - paddw mm7, mm1 - -%endmacro - -;void int vp8_sad16x16x3_sse3( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride, -; int *results) -global sym(vp8_sad16x16x3_sse3) PRIVATE -sym(vp8_sad16x16x3_sse3): - - STACK_FRAME_CREATE_X3 - - PROCESS_16X2X3 0, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_16X2X3 2, src_ptr, ref_ptr, src_stride, ref_stride - - mov rcx, result_ptr - - movq xmm0, xmm5 - psrldq xmm5, 8 - - paddw xmm0, xmm5 - movd [rcx], xmm0 -;- - movq xmm0, xmm6 - psrldq xmm6, 8 - - paddw xmm0, xmm6 - movd [rcx+4], xmm0 -;- - movq xmm0, xmm7 - psrldq xmm7, 8 - - paddw xmm0, xmm7 - movd [rcx+8], xmm0 - - STACK_FRAME_DESTROY_X3 - -;void int vp8_sad16x8x3_sse3( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride, -; int *results) -global sym(vp8_sad16x8x3_sse3) PRIVATE -sym(vp8_sad16x8x3_sse3): - - STACK_FRAME_CREATE_X3 - - PROCESS_16X2X3 0, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_16X2X3 2, src_ptr, ref_ptr, src_stride, ref_stride - - mov rcx, result_ptr - - movq xmm0, xmm5 - psrldq xmm5, 8 - - paddw xmm0, xmm5 - movd [rcx], xmm0 -;- - movq xmm0, xmm6 - psrldq xmm6, 8 - - paddw xmm0, xmm6 - movd [rcx+4], xmm0 -;- - movq xmm0, xmm7 - psrldq xmm7, 8 - - paddw xmm0, xmm7 - movd [rcx+8], xmm0 - - STACK_FRAME_DESTROY_X3 - -;void int vp8_sad8x16x3_sse3( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride, -; int *results) -global sym(vp8_sad8x16x3_sse3) PRIVATE -sym(vp8_sad8x16x3_sse3): - - STACK_FRAME_CREATE_X3 - - PROCESS_8X2X3 0, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_8X2X3 2, src_ptr, ref_ptr, src_stride, ref_stride - - mov rcx, result_ptr - - punpckldq mm5, mm6 - - movq [rcx], mm5 - movd [rcx+8], mm7 - - STACK_FRAME_DESTROY_X3 - -;void int vp8_sad8x8x3_sse3( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride, -; int *results) -global sym(vp8_sad8x8x3_sse3) PRIVATE -sym(vp8_sad8x8x3_sse3): - - STACK_FRAME_CREATE_X3 - - PROCESS_8X2X3 0, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_8X2X3 2, src_ptr, ref_ptr, src_stride, ref_stride - - mov rcx, result_ptr - - punpckldq mm5, mm6 - - movq [rcx], mm5 - movd [rcx+8], mm7 - - STACK_FRAME_DESTROY_X3 - -;void int vp8_sad4x4x3_sse3( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride, -; int *results) -global sym(vp8_sad4x4x3_sse3) PRIVATE -sym(vp8_sad4x4x3_sse3): - - STACK_FRAME_CREATE_X3 - - movd mm0, DWORD PTR [src_ptr] - movd mm1, DWORD PTR [ref_ptr] - - movd mm2, DWORD PTR [src_ptr+src_stride] - movd mm3, DWORD PTR [ref_ptr+ref_stride] - - punpcklbw mm0, mm2 - punpcklbw mm1, mm3 - - movd mm4, DWORD PTR [ref_ptr+1] - movd mm5, DWORD PTR [ref_ptr+2] - - movd mm2, DWORD PTR [ref_ptr+ref_stride+1] - movd mm3, DWORD PTR [ref_ptr+ref_stride+2] - - psadbw mm1, mm0 - - punpcklbw mm4, mm2 - punpcklbw mm5, mm3 - - psadbw mm4, mm0 - psadbw mm5, mm0 - - lea src_ptr, [src_ptr+src_stride*2] - lea ref_ptr, [ref_ptr+ref_stride*2] - - movd mm0, DWORD PTR [src_ptr] - movd mm2, DWORD PTR [ref_ptr] - - movd mm3, DWORD PTR [src_ptr+src_stride] - movd mm6, DWORD PTR [ref_ptr+ref_stride] - - punpcklbw mm0, mm3 - punpcklbw mm2, mm6 - - movd mm3, DWORD PTR [ref_ptr+1] - movd mm7, DWORD PTR [ref_ptr+2] - - psadbw mm2, mm0 - - paddw mm1, mm2 - - movd mm2, DWORD PTR [ref_ptr+ref_stride+1] - movd mm6, DWORD PTR [ref_ptr+ref_stride+2] - - punpcklbw mm3, mm2 - punpcklbw mm7, mm6 - - psadbw mm3, mm0 - psadbw mm7, mm0 - - paddw mm3, mm4 - paddw mm7, mm5 - - mov rcx, result_ptr - - punpckldq mm1, mm3 - - movq [rcx], mm1 - movd [rcx+8], mm7 - - STACK_FRAME_DESTROY_X3 - -;unsigned int vp8_sad16x16_sse3( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride, -; int max_sad) -;%define lddqu movdqu -global sym(vp8_sad16x16_sse3) PRIVATE -sym(vp8_sad16x16_sse3): - - STACK_FRAME_CREATE_X3 - - mov end_ptr, 4 - pxor xmm7, xmm7 - -.vp8_sad16x16_sse3_loop: - movdqa xmm0, XMMWORD PTR [src_ptr] - movdqu xmm1, XMMWORD PTR [ref_ptr] - movdqa xmm2, XMMWORD PTR [src_ptr+src_stride] - movdqu xmm3, XMMWORD PTR [ref_ptr+ref_stride] - - lea src_ptr, [src_ptr+src_stride*2] - lea ref_ptr, [ref_ptr+ref_stride*2] - - movdqa xmm4, XMMWORD PTR [src_ptr] - movdqu xmm5, XMMWORD PTR [ref_ptr] - movdqa xmm6, XMMWORD PTR [src_ptr+src_stride] - - psadbw xmm0, xmm1 - - movdqu xmm1, XMMWORD PTR [ref_ptr+ref_stride] - - psadbw xmm2, xmm3 - psadbw xmm4, xmm5 - psadbw xmm6, xmm1 - - lea src_ptr, [src_ptr+src_stride*2] - lea ref_ptr, [ref_ptr+ref_stride*2] - - paddw xmm7, xmm0 - paddw xmm7, xmm2 - paddw xmm7, xmm4 - paddw xmm7, xmm6 - - sub end_ptr, 1 - jne .vp8_sad16x16_sse3_loop - - movq xmm0, xmm7 - psrldq xmm7, 8 - paddw xmm0, xmm7 - movq rax, xmm0 - - STACK_FRAME_DESTROY_X3 - -;void vp8_copy32xn_sse3( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *dst_ptr, -; int dst_stride, -; int height); -global sym(vp8_copy32xn_sse3) PRIVATE -sym(vp8_copy32xn_sse3): - - STACK_FRAME_CREATE_X3 - -.block_copy_sse3_loopx4: - lea end_ptr, [src_ptr+src_stride*2] - - movdqu xmm0, XMMWORD PTR [src_ptr] - movdqu xmm1, XMMWORD PTR [src_ptr + 16] - movdqu xmm2, XMMWORD PTR [src_ptr + src_stride] - movdqu xmm3, XMMWORD PTR [src_ptr + src_stride + 16] - movdqu xmm4, XMMWORD PTR [end_ptr] - movdqu xmm5, XMMWORD PTR [end_ptr + 16] - movdqu xmm6, XMMWORD PTR [end_ptr + src_stride] - movdqu xmm7, XMMWORD PTR [end_ptr + src_stride + 16] - - lea src_ptr, [src_ptr+src_stride*4] - - lea end_ptr, [ref_ptr+ref_stride*2] - - movdqa XMMWORD PTR [ref_ptr], xmm0 - movdqa XMMWORD PTR [ref_ptr + 16], xmm1 - movdqa XMMWORD PTR [ref_ptr + ref_stride], xmm2 - movdqa XMMWORD PTR [ref_ptr + ref_stride + 16], xmm3 - movdqa XMMWORD PTR [end_ptr], xmm4 - movdqa XMMWORD PTR [end_ptr + 16], xmm5 - movdqa XMMWORD PTR [end_ptr + ref_stride], xmm6 - movdqa XMMWORD PTR [end_ptr + ref_stride + 16], xmm7 - - lea ref_ptr, [ref_ptr+ref_stride*4] - - sub height, 4 - cmp height, 4 - jge .block_copy_sse3_loopx4 - - ;Check to see if there is more rows need to be copied. - cmp height, 0 - je .copy_is_done - -.block_copy_sse3_loop: - movdqu xmm0, XMMWORD PTR [src_ptr] - movdqu xmm1, XMMWORD PTR [src_ptr + 16] - lea src_ptr, [src_ptr+src_stride] - - movdqa XMMWORD PTR [ref_ptr], xmm0 - movdqa XMMWORD PTR [ref_ptr + 16], xmm1 - lea ref_ptr, [ref_ptr+ref_stride] - - sub height, 1 - jne .block_copy_sse3_loop - -.copy_is_done: - STACK_FRAME_DESTROY_X3 - -;void vp8_sad16x16x4d_sse3( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr_base, -; int ref_stride, -; int *results) -global sym(vp8_sad16x16x4d_sse3) PRIVATE -sym(vp8_sad16x16x4d_sse3): - - STACK_FRAME_CREATE_X4 - - PROCESS_16X2X4 0, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - PROCESS_16X2X4 2, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - -%if ABI_IS_32BIT - pop rbp -%endif - mov rcx, result_ptr - - movq xmm0, xmm4 - psrldq xmm4, 8 - - paddw xmm0, xmm4 - movd [rcx], xmm0 -;- - movq xmm0, xmm5 - psrldq xmm5, 8 - - paddw xmm0, xmm5 - movd [rcx+4], xmm0 -;- - movq xmm0, xmm6 - psrldq xmm6, 8 - - paddw xmm0, xmm6 - movd [rcx+8], xmm0 -;- - movq xmm0, xmm7 - psrldq xmm7, 8 - - paddw xmm0, xmm7 - movd [rcx+12], xmm0 - - STACK_FRAME_DESTROY_X4 - -;void vp8_sad16x8x4d_sse3( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr_base, -; int ref_stride, -; int *results) -global sym(vp8_sad16x8x4d_sse3) PRIVATE -sym(vp8_sad16x8x4d_sse3): - - STACK_FRAME_CREATE_X4 - - PROCESS_16X2X4 0, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - PROCESS_16X2X4 2, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - -%if ABI_IS_32BIT - pop rbp -%endif - mov rcx, result_ptr - - movq xmm0, xmm4 - psrldq xmm4, 8 - - paddw xmm0, xmm4 - movd [rcx], xmm0 -;- - movq xmm0, xmm5 - psrldq xmm5, 8 - - paddw xmm0, xmm5 - movd [rcx+4], xmm0 -;- - movq xmm0, xmm6 - psrldq xmm6, 8 - - paddw xmm0, xmm6 - movd [rcx+8], xmm0 -;- - movq xmm0, xmm7 - psrldq xmm7, 8 - - paddw xmm0, xmm7 - movd [rcx+12], xmm0 - - STACK_FRAME_DESTROY_X4 - -;void int vp8_sad8x16x4d_sse3( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride, -; int *results) -global sym(vp8_sad8x16x4d_sse3) PRIVATE -sym(vp8_sad8x16x4d_sse3): - - STACK_FRAME_CREATE_X4 - - PROCESS_8X2X4 0, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - PROCESS_8X2X4 2, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - -%if ABI_IS_32BIT - pop rbp -%endif - mov rcx, result_ptr - - punpckldq mm4, mm5 - punpckldq mm6, mm7 - - movq [rcx], mm4 - movq [rcx+8], mm6 - - STACK_FRAME_DESTROY_X4 - -;void int vp8_sad8x8x4d_sse3( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride, -; int *results) -global sym(vp8_sad8x8x4d_sse3) PRIVATE -sym(vp8_sad8x8x4d_sse3): - - STACK_FRAME_CREATE_X4 - - PROCESS_8X2X4 0, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - PROCESS_8X2X4 2, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride - -%if ABI_IS_32BIT - pop rbp -%endif - mov rcx, result_ptr - - punpckldq mm4, mm5 - punpckldq mm6, mm7 - - movq [rcx], mm4 - movq [rcx+8], mm6 - - STACK_FRAME_DESTROY_X4 - -;void int vp8_sad4x4x4d_sse3( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride, -; int *results) -global sym(vp8_sad4x4x4d_sse3) PRIVATE -sym(vp8_sad4x4x4d_sse3): - - STACK_FRAME_CREATE_X4 - - movd mm0, DWORD PTR [src_ptr] - movd mm1, DWORD PTR [r0_ptr] - - movd mm2, DWORD PTR [src_ptr+src_stride] - movd mm3, DWORD PTR [r0_ptr+ref_stride] - - punpcklbw mm0, mm2 - punpcklbw mm1, mm3 - - movd mm4, DWORD PTR [r1_ptr] - movd mm5, DWORD PTR [r2_ptr] - - movd mm6, DWORD PTR [r3_ptr] - movd mm2, DWORD PTR [r1_ptr+ref_stride] - - movd mm3, DWORD PTR [r2_ptr+ref_stride] - movd mm7, DWORD PTR [r3_ptr+ref_stride] - - psadbw mm1, mm0 - - punpcklbw mm4, mm2 - punpcklbw mm5, mm3 - - punpcklbw mm6, mm7 - psadbw mm4, mm0 - - psadbw mm5, mm0 - psadbw mm6, mm0 - - - - lea src_ptr, [src_ptr+src_stride*2] - lea r0_ptr, [r0_ptr+ref_stride*2] - - lea r1_ptr, [r1_ptr+ref_stride*2] - lea r2_ptr, [r2_ptr+ref_stride*2] - - lea r3_ptr, [r3_ptr+ref_stride*2] - - movd mm0, DWORD PTR [src_ptr] - movd mm2, DWORD PTR [r0_ptr] - - movd mm3, DWORD PTR [src_ptr+src_stride] - movd mm7, DWORD PTR [r0_ptr+ref_stride] - - punpcklbw mm0, mm3 - punpcklbw mm2, mm7 - - movd mm3, DWORD PTR [r1_ptr] - movd mm7, DWORD PTR [r2_ptr] - - psadbw mm2, mm0 -%if ABI_IS_32BIT - mov rax, rbp - - pop rbp -%define ref_stride rax -%endif - mov rsi, result_ptr - - paddw mm1, mm2 - movd [rsi], mm1 - - movd mm2, DWORD PTR [r1_ptr+ref_stride] - movd mm1, DWORD PTR [r2_ptr+ref_stride] - - punpcklbw mm3, mm2 - punpcklbw mm7, mm1 - - psadbw mm3, mm0 - psadbw mm7, mm0 - - movd mm2, DWORD PTR [r3_ptr] - movd mm1, DWORD PTR [r3_ptr+ref_stride] - - paddw mm3, mm4 - paddw mm7, mm5 - - movd [rsi+4], mm3 - punpcklbw mm2, mm1 - - movd [rsi+8], mm7 - psadbw mm2, mm0 - - paddw mm2, mm6 - movd [rsi+12], mm2 - - - STACK_FRAME_DESTROY_X4 - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/sad_sse4.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/sad_sse4.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/sad_sse4.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/sad_sse4.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,353 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -%macro PROCESS_16X2X8 1 -%if %1 - movdqa xmm0, XMMWORD PTR [rsi] - movq xmm1, MMWORD PTR [rdi] - movq xmm3, MMWORD PTR [rdi+8] - movq xmm2, MMWORD PTR [rdi+16] - punpcklqdq xmm1, xmm3 - punpcklqdq xmm3, xmm2 - - movdqa xmm2, xmm1 - mpsadbw xmm1, xmm0, 0x0 - mpsadbw xmm2, xmm0, 0x5 - - psrldq xmm0, 8 - - movdqa xmm4, xmm3 - mpsadbw xmm3, xmm0, 0x0 - mpsadbw xmm4, xmm0, 0x5 - - paddw xmm1, xmm2 - paddw xmm1, xmm3 - paddw xmm1, xmm4 -%else - movdqa xmm0, XMMWORD PTR [rsi] - movq xmm5, MMWORD PTR [rdi] - movq xmm3, MMWORD PTR [rdi+8] - movq xmm2, MMWORD PTR [rdi+16] - punpcklqdq xmm5, xmm3 - punpcklqdq xmm3, xmm2 - - movdqa xmm2, xmm5 - mpsadbw xmm5, xmm0, 0x0 - mpsadbw xmm2, xmm0, 0x5 - - psrldq xmm0, 8 - - movdqa xmm4, xmm3 - mpsadbw xmm3, xmm0, 0x0 - mpsadbw xmm4, xmm0, 0x5 - - paddw xmm5, xmm2 - paddw xmm5, xmm3 - paddw xmm5, xmm4 - - paddw xmm1, xmm5 -%endif - movdqa xmm0, XMMWORD PTR [rsi + rax] - movq xmm5, MMWORD PTR [rdi+ rdx] - movq xmm3, MMWORD PTR [rdi+ rdx+8] - movq xmm2, MMWORD PTR [rdi+ rdx+16] - punpcklqdq xmm5, xmm3 - punpcklqdq xmm3, xmm2 - - lea rsi, [rsi+rax*2] - lea rdi, [rdi+rdx*2] - - movdqa xmm2, xmm5 - mpsadbw xmm5, xmm0, 0x0 - mpsadbw xmm2, xmm0, 0x5 - - psrldq xmm0, 8 - movdqa xmm4, xmm3 - mpsadbw xmm3, xmm0, 0x0 - mpsadbw xmm4, xmm0, 0x5 - - paddw xmm5, xmm2 - paddw xmm5, xmm3 - paddw xmm5, xmm4 - - paddw xmm1, xmm5 -%endmacro - -%macro PROCESS_8X2X8 1 -%if %1 - movq xmm0, MMWORD PTR [rsi] - movq xmm1, MMWORD PTR [rdi] - movq xmm3, MMWORD PTR [rdi+8] - punpcklqdq xmm1, xmm3 - - movdqa xmm2, xmm1 - mpsadbw xmm1, xmm0, 0x0 - mpsadbw xmm2, xmm0, 0x5 - paddw xmm1, xmm2 -%else - movq xmm0, MMWORD PTR [rsi] - movq xmm5, MMWORD PTR [rdi] - movq xmm3, MMWORD PTR [rdi+8] - punpcklqdq xmm5, xmm3 - - movdqa xmm2, xmm5 - mpsadbw xmm5, xmm0, 0x0 - mpsadbw xmm2, xmm0, 0x5 - paddw xmm5, xmm2 - - paddw xmm1, xmm5 -%endif - movq xmm0, MMWORD PTR [rsi + rax] - movq xmm5, MMWORD PTR [rdi+ rdx] - movq xmm3, MMWORD PTR [rdi+ rdx+8] - punpcklqdq xmm5, xmm3 - - lea rsi, [rsi+rax*2] - lea rdi, [rdi+rdx*2] - - movdqa xmm2, xmm5 - mpsadbw xmm5, xmm0, 0x0 - mpsadbw xmm2, xmm0, 0x5 - paddw xmm5, xmm2 - - paddw xmm1, xmm5 -%endmacro - -%macro PROCESS_4X2X8 1 -%if %1 - movd xmm0, [rsi] - movq xmm1, MMWORD PTR [rdi] - movq xmm3, MMWORD PTR [rdi+8] - punpcklqdq xmm1, xmm3 - - mpsadbw xmm1, xmm0, 0x0 -%else - movd xmm0, [rsi] - movq xmm5, MMWORD PTR [rdi] - movq xmm3, MMWORD PTR [rdi+8] - punpcklqdq xmm5, xmm3 - - mpsadbw xmm5, xmm0, 0x0 - - paddw xmm1, xmm5 -%endif - movd xmm0, [rsi + rax] - movq xmm5, MMWORD PTR [rdi+ rdx] - movq xmm3, MMWORD PTR [rdi+ rdx+8] - punpcklqdq xmm5, xmm3 - - lea rsi, [rsi+rax*2] - lea rdi, [rdi+rdx*2] - - mpsadbw xmm5, xmm0, 0x0 - - paddw xmm1, xmm5 -%endmacro - - -;void vp8_sad16x16x8_sse4( -; const unsigned char *src_ptr, -; int src_stride, -; const unsigned char *ref_ptr, -; int ref_stride, -; unsigned short *sad_array); -global sym(vp8_sad16x16x8_sse4) PRIVATE -sym(vp8_sad16x16x8_sse4): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - PROCESS_16X2X8 1 - PROCESS_16X2X8 0 - PROCESS_16X2X8 0 - PROCESS_16X2X8 0 - PROCESS_16X2X8 0 - PROCESS_16X2X8 0 - PROCESS_16X2X8 0 - PROCESS_16X2X8 0 - - mov rdi, arg(4) ;Results - movdqa XMMWORD PTR [rdi], xmm1 - - ; begin epilog - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_sad16x8x8_sse4( -; const unsigned char *src_ptr, -; int src_stride, -; const unsigned char *ref_ptr, -; int ref_stride, -; unsigned short *sad_array -;); -global sym(vp8_sad16x8x8_sse4) PRIVATE -sym(vp8_sad16x8x8_sse4): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - PROCESS_16X2X8 1 - PROCESS_16X2X8 0 - PROCESS_16X2X8 0 - PROCESS_16X2X8 0 - - mov rdi, arg(4) ;Results - movdqa XMMWORD PTR [rdi], xmm1 - - ; begin epilog - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_sad8x8x8_sse4( -; const unsigned char *src_ptr, -; int src_stride, -; const unsigned char *ref_ptr, -; int ref_stride, -; unsigned short *sad_array -;); -global sym(vp8_sad8x8x8_sse4) PRIVATE -sym(vp8_sad8x8x8_sse4): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - PROCESS_8X2X8 1 - PROCESS_8X2X8 0 - PROCESS_8X2X8 0 - PROCESS_8X2X8 0 - - mov rdi, arg(4) ;Results - movdqa XMMWORD PTR [rdi], xmm1 - - ; begin epilog - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_sad8x16x8_sse4( -; const unsigned char *src_ptr, -; int src_stride, -; const unsigned char *ref_ptr, -; int ref_stride, -; unsigned short *sad_array -;); -global sym(vp8_sad8x16x8_sse4) PRIVATE -sym(vp8_sad8x16x8_sse4): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - PROCESS_8X2X8 1 - PROCESS_8X2X8 0 - PROCESS_8X2X8 0 - PROCESS_8X2X8 0 - PROCESS_8X2X8 0 - PROCESS_8X2X8 0 - PROCESS_8X2X8 0 - PROCESS_8X2X8 0 - mov rdi, arg(4) ;Results - movdqa XMMWORD PTR [rdi], xmm1 - - ; begin epilog - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_sad4x4x8_c( -; const unsigned char *src_ptr, -; int src_stride, -; const unsigned char *ref_ptr, -; int ref_stride, -; unsigned short *sad_array -;); -global sym(vp8_sad4x4x8_sse4) PRIVATE -sym(vp8_sad4x4x8_sse4): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - PROCESS_4X2X8 1 - PROCESS_4X2X8 0 - - mov rdi, arg(4) ;Results - movdqa XMMWORD PTR [rdi], xmm1 - - ; begin epilog - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret - - - - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/sad_ssse3.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/sad_ssse3.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/sad_ssse3.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/sad_ssse3.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,370 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -%macro PROCESS_16X2X3 1 -%if %1 - movdqa xmm0, XMMWORD PTR [rsi] - lddqu xmm5, XMMWORD PTR [rdi] - lddqu xmm6, XMMWORD PTR [rdi+1] - lddqu xmm7, XMMWORD PTR [rdi+2] - - psadbw xmm5, xmm0 - psadbw xmm6, xmm0 - psadbw xmm7, xmm0 -%else - movdqa xmm0, XMMWORD PTR [rsi] - lddqu xmm1, XMMWORD PTR [rdi] - lddqu xmm2, XMMWORD PTR [rdi+1] - lddqu xmm3, XMMWORD PTR [rdi+2] - - psadbw xmm1, xmm0 - psadbw xmm2, xmm0 - psadbw xmm3, xmm0 - - paddw xmm5, xmm1 - paddw xmm6, xmm2 - paddw xmm7, xmm3 -%endif - movdqa xmm0, XMMWORD PTR [rsi+rax] - lddqu xmm1, XMMWORD PTR [rdi+rdx] - lddqu xmm2, XMMWORD PTR [rdi+rdx+1] - lddqu xmm3, XMMWORD PTR [rdi+rdx+2] - - lea rsi, [rsi+rax*2] - lea rdi, [rdi+rdx*2] - - psadbw xmm1, xmm0 - psadbw xmm2, xmm0 - psadbw xmm3, xmm0 - - paddw xmm5, xmm1 - paddw xmm6, xmm2 - paddw xmm7, xmm3 -%endmacro - -%macro PROCESS_16X2X3_OFFSET 2 -%if %1 - movdqa xmm0, XMMWORD PTR [rsi] - movdqa xmm4, XMMWORD PTR [rdi] - movdqa xmm7, XMMWORD PTR [rdi+16] - - movdqa xmm5, xmm7 - palignr xmm5, xmm4, %2 - - movdqa xmm6, xmm7 - palignr xmm6, xmm4, (%2+1) - - palignr xmm7, xmm4, (%2+2) - - psadbw xmm5, xmm0 - psadbw xmm6, xmm0 - psadbw xmm7, xmm0 -%else - movdqa xmm0, XMMWORD PTR [rsi] - movdqa xmm4, XMMWORD PTR [rdi] - movdqa xmm3, XMMWORD PTR [rdi+16] - - movdqa xmm1, xmm3 - palignr xmm1, xmm4, %2 - - movdqa xmm2, xmm3 - palignr xmm2, xmm4, (%2+1) - - palignr xmm3, xmm4, (%2+2) - - psadbw xmm1, xmm0 - psadbw xmm2, xmm0 - psadbw xmm3, xmm0 - - paddw xmm5, xmm1 - paddw xmm6, xmm2 - paddw xmm7, xmm3 -%endif - movdqa xmm0, XMMWORD PTR [rsi+rax] - movdqa xmm4, XMMWORD PTR [rdi+rdx] - movdqa xmm3, XMMWORD PTR [rdi+rdx+16] - - movdqa xmm1, xmm3 - palignr xmm1, xmm4, %2 - - movdqa xmm2, xmm3 - palignr xmm2, xmm4, (%2+1) - - palignr xmm3, xmm4, (%2+2) - - lea rsi, [rsi+rax*2] - lea rdi, [rdi+rdx*2] - - psadbw xmm1, xmm0 - psadbw xmm2, xmm0 - psadbw xmm3, xmm0 - - paddw xmm5, xmm1 - paddw xmm6, xmm2 - paddw xmm7, xmm3 -%endmacro - -%macro PROCESS_16X16X3_OFFSET 2 -%2_aligned_by_%1: - - sub rdi, %1 - - PROCESS_16X2X3_OFFSET 1, %1 - PROCESS_16X2X3_OFFSET 0, %1 - PROCESS_16X2X3_OFFSET 0, %1 - PROCESS_16X2X3_OFFSET 0, %1 - PROCESS_16X2X3_OFFSET 0, %1 - PROCESS_16X2X3_OFFSET 0, %1 - PROCESS_16X2X3_OFFSET 0, %1 - PROCESS_16X2X3_OFFSET 0, %1 - - jmp %2_store_off - -%endmacro - -%macro PROCESS_16X8X3_OFFSET 2 -%2_aligned_by_%1: - - sub rdi, %1 - - PROCESS_16X2X3_OFFSET 1, %1 - PROCESS_16X2X3_OFFSET 0, %1 - PROCESS_16X2X3_OFFSET 0, %1 - PROCESS_16X2X3_OFFSET 0, %1 - - jmp %2_store_off - -%endmacro - -;void int vp8_sad16x16x3_ssse3( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride, -; int *results) -global sym(vp8_sad16x16x3_ssse3) PRIVATE -sym(vp8_sad16x16x3_ssse3): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - SAVE_XMM 7 - push rsi - push rdi - push rcx - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - mov rdx, 0xf - and rdx, rdi - - jmp .vp8_sad16x16x3_ssse3_skiptable -.vp8_sad16x16x3_ssse3_jumptable: - dd .vp8_sad16x16x3_ssse3_aligned_by_0 - .vp8_sad16x16x3_ssse3_do_jump - dd .vp8_sad16x16x3_ssse3_aligned_by_1 - .vp8_sad16x16x3_ssse3_do_jump - dd .vp8_sad16x16x3_ssse3_aligned_by_2 - .vp8_sad16x16x3_ssse3_do_jump - dd .vp8_sad16x16x3_ssse3_aligned_by_3 - .vp8_sad16x16x3_ssse3_do_jump - dd .vp8_sad16x16x3_ssse3_aligned_by_4 - .vp8_sad16x16x3_ssse3_do_jump - dd .vp8_sad16x16x3_ssse3_aligned_by_5 - .vp8_sad16x16x3_ssse3_do_jump - dd .vp8_sad16x16x3_ssse3_aligned_by_6 - .vp8_sad16x16x3_ssse3_do_jump - dd .vp8_sad16x16x3_ssse3_aligned_by_7 - .vp8_sad16x16x3_ssse3_do_jump - dd .vp8_sad16x16x3_ssse3_aligned_by_8 - .vp8_sad16x16x3_ssse3_do_jump - dd .vp8_sad16x16x3_ssse3_aligned_by_9 - .vp8_sad16x16x3_ssse3_do_jump - dd .vp8_sad16x16x3_ssse3_aligned_by_10 - .vp8_sad16x16x3_ssse3_do_jump - dd .vp8_sad16x16x3_ssse3_aligned_by_11 - .vp8_sad16x16x3_ssse3_do_jump - dd .vp8_sad16x16x3_ssse3_aligned_by_12 - .vp8_sad16x16x3_ssse3_do_jump - dd .vp8_sad16x16x3_ssse3_aligned_by_13 - .vp8_sad16x16x3_ssse3_do_jump - dd .vp8_sad16x16x3_ssse3_aligned_by_14 - .vp8_sad16x16x3_ssse3_do_jump - dd .vp8_sad16x16x3_ssse3_aligned_by_15 - .vp8_sad16x16x3_ssse3_do_jump -.vp8_sad16x16x3_ssse3_skiptable: - - call .vp8_sad16x16x3_ssse3_do_jump -.vp8_sad16x16x3_ssse3_do_jump: - pop rcx ; get the address of do_jump - mov rax, .vp8_sad16x16x3_ssse3_jumptable - .vp8_sad16x16x3_ssse3_do_jump - add rax, rcx ; get the absolute address of vp8_sad16x16x3_ssse3_jumptable - - movsxd rax, dword [rax + 4*rdx] ; get the 32 bit offset from the jumptable - add rcx, rax - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - jmp rcx - - PROCESS_16X16X3_OFFSET 0, .vp8_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 1, .vp8_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 2, .vp8_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 3, .vp8_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 4, .vp8_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 5, .vp8_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 6, .vp8_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 7, .vp8_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 8, .vp8_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 9, .vp8_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 10, .vp8_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 11, .vp8_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 12, .vp8_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 13, .vp8_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 14, .vp8_sad16x16x3_ssse3 - -.vp8_sad16x16x3_ssse3_aligned_by_15: - PROCESS_16X2X3 1 - PROCESS_16X2X3 0 - PROCESS_16X2X3 0 - PROCESS_16X2X3 0 - PROCESS_16X2X3 0 - PROCESS_16X2X3 0 - PROCESS_16X2X3 0 - PROCESS_16X2X3 0 - -.vp8_sad16x16x3_ssse3_store_off: - mov rdi, arg(4) ;Results - - movq xmm0, xmm5 - psrldq xmm5, 8 - - paddw xmm0, xmm5 - movd [rdi], xmm0 -;- - movq xmm0, xmm6 - psrldq xmm6, 8 - - paddw xmm0, xmm6 - movd [rdi+4], xmm0 -;- - movq xmm0, xmm7 - psrldq xmm7, 8 - - paddw xmm0, xmm7 - movd [rdi+8], xmm0 - - ; begin epilog - pop rcx - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -;void int vp8_sad16x8x3_ssse3( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride, -; int *results) -global sym(vp8_sad16x8x3_ssse3) PRIVATE -sym(vp8_sad16x8x3_ssse3): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - SAVE_XMM 7 - push rsi - push rdi - push rcx - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - mov rdx, 0xf - and rdx, rdi - - jmp .vp8_sad16x8x3_ssse3_skiptable -.vp8_sad16x8x3_ssse3_jumptable: - dd .vp8_sad16x8x3_ssse3_aligned_by_0 - .vp8_sad16x8x3_ssse3_do_jump - dd .vp8_sad16x8x3_ssse3_aligned_by_1 - .vp8_sad16x8x3_ssse3_do_jump - dd .vp8_sad16x8x3_ssse3_aligned_by_2 - .vp8_sad16x8x3_ssse3_do_jump - dd .vp8_sad16x8x3_ssse3_aligned_by_3 - .vp8_sad16x8x3_ssse3_do_jump - dd .vp8_sad16x8x3_ssse3_aligned_by_4 - .vp8_sad16x8x3_ssse3_do_jump - dd .vp8_sad16x8x3_ssse3_aligned_by_5 - .vp8_sad16x8x3_ssse3_do_jump - dd .vp8_sad16x8x3_ssse3_aligned_by_6 - .vp8_sad16x8x3_ssse3_do_jump - dd .vp8_sad16x8x3_ssse3_aligned_by_7 - .vp8_sad16x8x3_ssse3_do_jump - dd .vp8_sad16x8x3_ssse3_aligned_by_8 - .vp8_sad16x8x3_ssse3_do_jump - dd .vp8_sad16x8x3_ssse3_aligned_by_9 - .vp8_sad16x8x3_ssse3_do_jump - dd .vp8_sad16x8x3_ssse3_aligned_by_10 - .vp8_sad16x8x3_ssse3_do_jump - dd .vp8_sad16x8x3_ssse3_aligned_by_11 - .vp8_sad16x8x3_ssse3_do_jump - dd .vp8_sad16x8x3_ssse3_aligned_by_12 - .vp8_sad16x8x3_ssse3_do_jump - dd .vp8_sad16x8x3_ssse3_aligned_by_13 - .vp8_sad16x8x3_ssse3_do_jump - dd .vp8_sad16x8x3_ssse3_aligned_by_14 - .vp8_sad16x8x3_ssse3_do_jump - dd .vp8_sad16x8x3_ssse3_aligned_by_15 - .vp8_sad16x8x3_ssse3_do_jump -.vp8_sad16x8x3_ssse3_skiptable: - - call .vp8_sad16x8x3_ssse3_do_jump -.vp8_sad16x8x3_ssse3_do_jump: - pop rcx ; get the address of do_jump - mov rax, .vp8_sad16x8x3_ssse3_jumptable - .vp8_sad16x8x3_ssse3_do_jump - add rax, rcx ; get the absolute address of vp8_sad16x8x3_ssse3_jumptable - - movsxd rax, dword [rax + 4*rdx] ; get the 32 bit offset from the jumptable - add rcx, rax - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - jmp rcx - - PROCESS_16X8X3_OFFSET 0, .vp8_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 1, .vp8_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 2, .vp8_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 3, .vp8_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 4, .vp8_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 5, .vp8_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 6, .vp8_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 7, .vp8_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 8, .vp8_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 9, .vp8_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 10, .vp8_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 11, .vp8_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 12, .vp8_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 13, .vp8_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 14, .vp8_sad16x8x3_ssse3 - -.vp8_sad16x8x3_ssse3_aligned_by_15: - - PROCESS_16X2X3 1 - PROCESS_16X2X3 0 - PROCESS_16X2X3 0 - PROCESS_16X2X3 0 - -.vp8_sad16x8x3_ssse3_store_off: - mov rdi, arg(4) ;Results - - movq xmm0, xmm5 - psrldq xmm5, 8 - - paddw xmm0, xmm5 - movd [rdi], xmm0 -;- - movq xmm0, xmm6 - psrldq xmm6, 8 - - paddw xmm0, xmm6 - movd [rdi+4], xmm0 -;- - movq xmm0, xmm7 - psrldq xmm7, 8 - - paddw xmm0, xmm7 - movd [rdi+8], xmm0 - - ; begin epilog - pop rcx - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/subpixel_mmx.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/subpixel_mmx.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/subpixel_mmx.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/subpixel_mmx.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,702 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" -extern sym(vp8_bilinear_filters_x86_8) - - -%define BLOCK_HEIGHT_WIDTH 4 -%define vp8_filter_weight 128 -%define VP8_FILTER_SHIFT 7 - - -;void vp8_filter_block1d_h6_mmx -;( -; unsigned char *src_ptr, -; unsigned short *output_ptr, -; unsigned int src_pixels_per_line, -; unsigned int pixel_step, -; unsigned int output_height, -; unsigned int output_width, -; short * vp8_filter -;) -global sym(vp8_filter_block1d_h6_mmx) PRIVATE -sym(vp8_filter_block1d_h6_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - mov rdx, arg(6) ;vp8_filter - - movq mm1, [rdx + 16] ; do both the negative taps first!!! - movq mm2, [rdx + 32] ; - movq mm6, [rdx + 48] ; - movq mm7, [rdx + 64] ; - - mov rdi, arg(1) ;output_ptr - mov rsi, arg(0) ;src_ptr - movsxd rcx, dword ptr arg(4) ;output_height - movsxd rax, dword ptr arg(5) ;output_width ; destination pitch? - pxor mm0, mm0 ; mm0 = 00000000 - -.nextrow: - movq mm3, [rsi-2] ; mm3 = p-2..p5 - movq mm4, mm3 ; mm4 = p-2..p5 - psrlq mm3, 8 ; mm3 = p-1..p5 - punpcklbw mm3, mm0 ; mm3 = p-1..p2 - pmullw mm3, mm1 ; mm3 *= kernel 1 modifiers. - - movq mm5, mm4 ; mm5 = p-2..p5 - punpckhbw mm4, mm0 ; mm5 = p2..p5 - pmullw mm4, mm7 ; mm5 *= kernel 4 modifiers - paddsw mm3, mm4 ; mm3 += mm5 - - movq mm4, mm5 ; mm4 = p-2..p5; - psrlq mm5, 16 ; mm5 = p0..p5; - punpcklbw mm5, mm0 ; mm5 = p0..p3 - pmullw mm5, mm2 ; mm5 *= kernel 2 modifiers - paddsw mm3, mm5 ; mm3 += mm5 - - movq mm5, mm4 ; mm5 = p-2..p5 - psrlq mm4, 24 ; mm4 = p1..p5 - punpcklbw mm4, mm0 ; mm4 = p1..p4 - pmullw mm4, mm6 ; mm5 *= kernel 3 modifiers - paddsw mm3, mm4 ; mm3 += mm5 - - ; do outer positive taps - movd mm4, [rsi+3] - punpcklbw mm4, mm0 ; mm5 = p3..p6 - pmullw mm4, [rdx+80] ; mm5 *= kernel 0 modifiers - paddsw mm3, mm4 ; mm3 += mm5 - - punpcklbw mm5, mm0 ; mm5 = p-2..p1 - pmullw mm5, [rdx] ; mm5 *= kernel 5 modifiers - paddsw mm3, mm5 ; mm3 += mm5 - - paddsw mm3, [GLOBAL(rd)] ; mm3 += round value - psraw mm3, VP8_FILTER_SHIFT ; mm3 /= 128 - packuswb mm3, mm0 ; pack and unpack to saturate - punpcklbw mm3, mm0 ; - - movq [rdi], mm3 ; store the results in the destination - -%if ABI_IS_32BIT - add rsi, dword ptr arg(2) ;src_pixels_per_line ; next line - add rdi, rax; -%else - movsxd r8, dword ptr arg(2) ;src_pixels_per_line - add rdi, rax; - - add rsi, r8 ; next line -%endif - - dec rcx ; decrement count - jnz .nextrow ; next row - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_filter_block1dc_v6_mmx -;( -; short *src_ptr, -; unsigned char *output_ptr, -; int output_pitch, -; unsigned int pixels_per_line, -; unsigned int pixel_step, -; unsigned int output_height, -; unsigned int output_width, -; short * vp8_filter -;) -global sym(vp8_filter_block1dc_v6_mmx) PRIVATE -sym(vp8_filter_block1dc_v6_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 8 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - movq mm5, [GLOBAL(rd)] - push rbx - mov rbx, arg(7) ;vp8_filter - movq mm1, [rbx + 16] ; do both the negative taps first!!! - movq mm2, [rbx + 32] ; - movq mm6, [rbx + 48] ; - movq mm7, [rbx + 64] ; - - movsxd rdx, dword ptr arg(3) ;pixels_per_line - mov rdi, arg(1) ;output_ptr - mov rsi, arg(0) ;src_ptr - sub rsi, rdx - sub rsi, rdx - movsxd rcx, DWORD PTR arg(5) ;output_height - movsxd rax, DWORD PTR arg(2) ;output_pitch ; destination pitch? - pxor mm0, mm0 ; mm0 = 00000000 - - -.nextrow_cv: - movq mm3, [rsi+rdx] ; mm3 = p0..p8 = row -1 - pmullw mm3, mm1 ; mm3 *= kernel 1 modifiers. - - - movq mm4, [rsi + 4*rdx] ; mm4 = p0..p3 = row 2 - pmullw mm4, mm7 ; mm4 *= kernel 4 modifiers. - paddsw mm3, mm4 ; mm3 += mm4 - - movq mm4, [rsi + 2*rdx] ; mm4 = p0..p3 = row 0 - pmullw mm4, mm2 ; mm4 *= kernel 2 modifiers. - paddsw mm3, mm4 ; mm3 += mm4 - - movq mm4, [rsi] ; mm4 = p0..p3 = row -2 - pmullw mm4, [rbx] ; mm4 *= kernel 0 modifiers. - paddsw mm3, mm4 ; mm3 += mm4 - - - add rsi, rdx ; move source forward 1 line to avoid 3 * pitch - movq mm4, [rsi + 2*rdx] ; mm4 = p0..p3 = row 1 - pmullw mm4, mm6 ; mm4 *= kernel 3 modifiers. - paddsw mm3, mm4 ; mm3 += mm4 - - movq mm4, [rsi + 4*rdx] ; mm4 = p0..p3 = row 3 - pmullw mm4, [rbx +80] ; mm4 *= kernel 3 modifiers. - paddsw mm3, mm4 ; mm3 += mm4 - - - paddsw mm3, mm5 ; mm3 += round value - psraw mm3, VP8_FILTER_SHIFT ; mm3 /= 128 - packuswb mm3, mm0 ; pack and saturate - - movd [rdi],mm3 ; store the results in the destination - ; the subsequent iterations repeat 3 out of 4 of these reads. Since the - ; recon block should be in cache this shouldn't cost much. Its obviously - ; avoidable!!!. - lea rdi, [rdi+rax] ; - dec rcx ; decrement count - jnz .nextrow_cv ; next row - - pop rbx - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - - -;void bilinear_predict8x8_mmx -;( -; unsigned char *src_ptr, -; int src_pixels_per_line, -; int xoffset, -; int yoffset, -; unsigned char *dst_ptr, -; int dst_pitch -;) -global sym(vp8_bilinear_predict8x8_mmx) PRIVATE -sym(vp8_bilinear_predict8x8_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - ;const short *HFilter = vp8_bilinear_filters_x86_8[xoffset]; - ;const short *VFilter = vp8_bilinear_filters_x86_8[yoffset]; - - movsxd rax, dword ptr arg(2) ;xoffset - mov rdi, arg(4) ;dst_ptr ; - - shl rax, 5 ; offset * 32 - lea rcx, [GLOBAL(sym(vp8_bilinear_filters_x86_8))] - - add rax, rcx ; HFilter - mov rsi, arg(0) ;src_ptr ; - - movsxd rdx, dword ptr arg(5) ;dst_pitch - movq mm1, [rax] ; - - movq mm2, [rax+16] ; - movsxd rax, dword ptr arg(3) ;yoffset - - pxor mm0, mm0 ; - - shl rax, 5 ; offset*32 - add rax, rcx ; VFilter - - lea rcx, [rdi+rdx*8] ; - movsxd rdx, dword ptr arg(1) ;src_pixels_per_line ; - - - - ; get the first horizontal line done ; - movq mm3, [rsi] ; xx 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 - movq mm4, mm3 ; make a copy of current line - - punpcklbw mm3, mm0 ; xx 00 01 02 03 04 05 06 - punpckhbw mm4, mm0 ; - - pmullw mm3, mm1 ; - pmullw mm4, mm1 ; - - movq mm5, [rsi+1] ; - movq mm6, mm5 ; - - punpcklbw mm5, mm0 ; - punpckhbw mm6, mm0 ; - - pmullw mm5, mm2 ; - pmullw mm6, mm2 ; - - paddw mm3, mm5 ; - paddw mm4, mm6 ; - - paddw mm3, [GLOBAL(rd)] ; xmm3 += round value - psraw mm3, VP8_FILTER_SHIFT ; xmm3 /= 128 - - paddw mm4, [GLOBAL(rd)] ; - psraw mm4, VP8_FILTER_SHIFT ; - - movq mm7, mm3 ; - packuswb mm7, mm4 ; - - add rsi, rdx ; next line -.next_row_8x8: - movq mm3, [rsi] ; xx 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 - movq mm4, mm3 ; make a copy of current line - - punpcklbw mm3, mm0 ; xx 00 01 02 03 04 05 06 - punpckhbw mm4, mm0 ; - - pmullw mm3, mm1 ; - pmullw mm4, mm1 ; - - movq mm5, [rsi+1] ; - movq mm6, mm5 ; - - punpcklbw mm5, mm0 ; - punpckhbw mm6, mm0 ; - - pmullw mm5, mm2 ; - pmullw mm6, mm2 ; - - paddw mm3, mm5 ; - paddw mm4, mm6 ; - - movq mm5, mm7 ; - movq mm6, mm7 ; - - punpcklbw mm5, mm0 ; - punpckhbw mm6, mm0 - - pmullw mm5, [rax] ; - pmullw mm6, [rax] ; - - paddw mm3, [GLOBAL(rd)] ; xmm3 += round value - psraw mm3, VP8_FILTER_SHIFT ; xmm3 /= 128 - - paddw mm4, [GLOBAL(rd)] ; - psraw mm4, VP8_FILTER_SHIFT ; - - movq mm7, mm3 ; - packuswb mm7, mm4 ; - - - pmullw mm3, [rax+16] ; - pmullw mm4, [rax+16] ; - - paddw mm3, mm5 ; - paddw mm4, mm6 ; - - - paddw mm3, [GLOBAL(rd)] ; xmm3 += round value - psraw mm3, VP8_FILTER_SHIFT ; xmm3 /= 128 - - paddw mm4, [GLOBAL(rd)] ; - psraw mm4, VP8_FILTER_SHIFT ; - - packuswb mm3, mm4 - - movq [rdi], mm3 ; store the results in the destination - -%if ABI_IS_32BIT - add rsi, rdx ; next line - add rdi, dword ptr arg(5) ;dst_pitch ; -%else - movsxd r8, dword ptr arg(5) ;dst_pitch - add rsi, rdx ; next line - add rdi, r8 ;dst_pitch -%endif - cmp rdi, rcx ; - jne .next_row_8x8 - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - - -;void bilinear_predict8x4_mmx -;( -; unsigned char *src_ptr, -; int src_pixels_per_line, -; int xoffset, -; int yoffset, -; unsigned char *dst_ptr, -; int dst_pitch -;) -global sym(vp8_bilinear_predict8x4_mmx) PRIVATE -sym(vp8_bilinear_predict8x4_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - ;const short *HFilter = vp8_bilinear_filters_x86_8[xoffset]; - ;const short *VFilter = vp8_bilinear_filters_x86_8[yoffset]; - - movsxd rax, dword ptr arg(2) ;xoffset - mov rdi, arg(4) ;dst_ptr ; - - lea rcx, [GLOBAL(sym(vp8_bilinear_filters_x86_8))] - shl rax, 5 - - mov rsi, arg(0) ;src_ptr ; - add rax, rcx - - movsxd rdx, dword ptr arg(5) ;dst_pitch - movq mm1, [rax] ; - - movq mm2, [rax+16] ; - movsxd rax, dword ptr arg(3) ;yoffset - - pxor mm0, mm0 ; - shl rax, 5 - - add rax, rcx - lea rcx, [rdi+rdx*4] ; - - movsxd rdx, dword ptr arg(1) ;src_pixels_per_line ; - - ; get the first horizontal line done ; - movq mm3, [rsi] ; xx 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 - movq mm4, mm3 ; make a copy of current line - - punpcklbw mm3, mm0 ; xx 00 01 02 03 04 05 06 - punpckhbw mm4, mm0 ; - - pmullw mm3, mm1 ; - pmullw mm4, mm1 ; - - movq mm5, [rsi+1] ; - movq mm6, mm5 ; - - punpcklbw mm5, mm0 ; - punpckhbw mm6, mm0 ; - - pmullw mm5, mm2 ; - pmullw mm6, mm2 ; - - paddw mm3, mm5 ; - paddw mm4, mm6 ; - - paddw mm3, [GLOBAL(rd)] ; xmm3 += round value - psraw mm3, VP8_FILTER_SHIFT ; xmm3 /= 128 - - paddw mm4, [GLOBAL(rd)] ; - psraw mm4, VP8_FILTER_SHIFT ; - - movq mm7, mm3 ; - packuswb mm7, mm4 ; - - add rsi, rdx ; next line -.next_row_8x4: - movq mm3, [rsi] ; xx 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 - movq mm4, mm3 ; make a copy of current line - - punpcklbw mm3, mm0 ; xx 00 01 02 03 04 05 06 - punpckhbw mm4, mm0 ; - - pmullw mm3, mm1 ; - pmullw mm4, mm1 ; - - movq mm5, [rsi+1] ; - movq mm6, mm5 ; - - punpcklbw mm5, mm0 ; - punpckhbw mm6, mm0 ; - - pmullw mm5, mm2 ; - pmullw mm6, mm2 ; - - paddw mm3, mm5 ; - paddw mm4, mm6 ; - - movq mm5, mm7 ; - movq mm6, mm7 ; - - punpcklbw mm5, mm0 ; - punpckhbw mm6, mm0 - - pmullw mm5, [rax] ; - pmullw mm6, [rax] ; - - paddw mm3, [GLOBAL(rd)] ; xmm3 += round value - psraw mm3, VP8_FILTER_SHIFT ; xmm3 /= 128 - - paddw mm4, [GLOBAL(rd)] ; - psraw mm4, VP8_FILTER_SHIFT ; - - movq mm7, mm3 ; - packuswb mm7, mm4 ; - - - pmullw mm3, [rax+16] ; - pmullw mm4, [rax+16] ; - - paddw mm3, mm5 ; - paddw mm4, mm6 ; - - - paddw mm3, [GLOBAL(rd)] ; xmm3 += round value - psraw mm3, VP8_FILTER_SHIFT ; xmm3 /= 128 - - paddw mm4, [GLOBAL(rd)] ; - psraw mm4, VP8_FILTER_SHIFT ; - - packuswb mm3, mm4 - - movq [rdi], mm3 ; store the results in the destination - -%if ABI_IS_32BIT - add rsi, rdx ; next line - add rdi, dword ptr arg(5) ;dst_pitch ; -%else - movsxd r8, dword ptr arg(5) ;dst_pitch - add rsi, rdx ; next line - add rdi, r8 -%endif - cmp rdi, rcx ; - jne .next_row_8x4 - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - - -;void bilinear_predict4x4_mmx -;( -; unsigned char *src_ptr, -; int src_pixels_per_line, -; int xoffset, -; int yoffset, -; unsigned char *dst_ptr, -; int dst_pitch -;) -global sym(vp8_bilinear_predict4x4_mmx) PRIVATE -sym(vp8_bilinear_predict4x4_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - ;const short *HFilter = vp8_bilinear_filters_x86_8[xoffset]; - ;const short *VFilter = vp8_bilinear_filters_x86_8[yoffset]; - - movsxd rax, dword ptr arg(2) ;xoffset - mov rdi, arg(4) ;dst_ptr ; - - lea rcx, [GLOBAL(sym(vp8_bilinear_filters_x86_8))] - shl rax, 5 - - add rax, rcx ; HFilter - mov rsi, arg(0) ;src_ptr ; - - movsxd rdx, dword ptr arg(5) ;ldst_pitch - movq mm1, [rax] ; - - movq mm2, [rax+16] ; - movsxd rax, dword ptr arg(3) ;yoffset - - pxor mm0, mm0 ; - shl rax, 5 - - add rax, rcx - lea rcx, [rdi+rdx*4] ; - - movsxd rdx, dword ptr arg(1) ;src_pixels_per_line ; - - ; get the first horizontal line done ; - movd mm3, [rsi] ; xx 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 - punpcklbw mm3, mm0 ; xx 00 01 02 03 04 05 06 - - pmullw mm3, mm1 ; - movd mm5, [rsi+1] ; - - punpcklbw mm5, mm0 ; - pmullw mm5, mm2 ; - - paddw mm3, mm5 ; - paddw mm3, [GLOBAL(rd)] ; xmm3 += round value - - psraw mm3, VP8_FILTER_SHIFT ; xmm3 /= 128 - - movq mm7, mm3 ; - packuswb mm7, mm0 ; - - add rsi, rdx ; next line -.next_row_4x4: - movd mm3, [rsi] ; xx 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 - punpcklbw mm3, mm0 ; xx 00 01 02 03 04 05 06 - - pmullw mm3, mm1 ; - movd mm5, [rsi+1] ; - - punpcklbw mm5, mm0 ; - pmullw mm5, mm2 ; - - paddw mm3, mm5 ; - - movq mm5, mm7 ; - punpcklbw mm5, mm0 ; - - pmullw mm5, [rax] ; - paddw mm3, [GLOBAL(rd)] ; xmm3 += round value - - psraw mm3, VP8_FILTER_SHIFT ; xmm3 /= 128 - movq mm7, mm3 ; - - packuswb mm7, mm0 ; - - pmullw mm3, [rax+16] ; - paddw mm3, mm5 ; - - - paddw mm3, [GLOBAL(rd)] ; xmm3 += round value - psraw mm3, VP8_FILTER_SHIFT ; xmm3 /= 128 - - packuswb mm3, mm0 - movd [rdi], mm3 ; store the results in the destination - -%if ABI_IS_32BIT - add rsi, rdx ; next line - add rdi, dword ptr arg(5) ;dst_pitch ; -%else - movsxd r8, dword ptr arg(5) ;dst_pitch ; - add rsi, rdx ; next line - add rdi, r8 -%endif - - cmp rdi, rcx ; - jne .next_row_4x4 - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - - - -SECTION_RODATA -align 16 -rd: - times 4 dw 0x40 - -align 16 -global HIDDEN_DATA(sym(vp8_six_tap_mmx)) -sym(vp8_six_tap_mmx): - times 8 dw 0 - times 8 dw 0 - times 8 dw 128 - times 8 dw 0 - times 8 dw 0 - times 8 dw 0 - - times 8 dw 0 - times 8 dw -6 - times 8 dw 123 - times 8 dw 12 - times 8 dw -1 - times 8 dw 0 - - 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 0 - times 8 dw -9 - times 8 dw 93 - times 8 dw 50 - times 8 dw -6 - times 8 dw 0 - - 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 0 - times 8 dw -6 - times 8 dw 50 - times 8 dw 93 - times 8 dw -9 - times 8 dw 0 - - times 8 dw 1 - times 8 dw -8 - times 8 dw 36 - times 8 dw 108 - times 8 dw -11 - times 8 dw 2 - - times 8 dw 0 - times 8 dw -1 - times 8 dw 12 - times 8 dw 123 - times 8 dw -6 - times 8 dw 0 - - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/subpixel_sse2.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/subpixel_sse2.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/subpixel_sse2.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/subpixel_sse2.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,1372 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" -extern sym(vp8_bilinear_filters_x86_8) - -%define BLOCK_HEIGHT_WIDTH 4 -%define VP8_FILTER_WEIGHT 128 -%define VP8_FILTER_SHIFT 7 - - -;/************************************************************************************ -; Notes: filter_block1d_h6 applies a 6 tap filter horizontally to the input pixels. The -; input pixel array has output_height rows. This routine assumes that output_height is an -; even number. This function handles 8 pixels in horizontal direction, calculating ONE -; rows each iteration to take advantage of the 128 bits operations. -;*************************************************************************************/ -;void vp8_filter_block1d8_h6_sse2 -;( -; unsigned char *src_ptr, -; unsigned short *output_ptr, -; unsigned int src_pixels_per_line, -; unsigned int pixel_step, -; unsigned int output_height, -; unsigned int output_width, -; short *vp8_filter -;) -global sym(vp8_filter_block1d8_h6_sse2) PRIVATE -sym(vp8_filter_block1d8_h6_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - mov rdx, arg(6) ;vp8_filter - mov rsi, arg(0) ;src_ptr - - mov rdi, arg(1) ;output_ptr - - movsxd rcx, dword ptr arg(4) ;output_height - movsxd rax, dword ptr arg(2) ;src_pixels_per_line ; Pitch for Source -%if ABI_IS_32BIT=0 - movsxd r8, dword ptr arg(5) ;output_width -%endif - pxor xmm0, xmm0 ; clear xmm0 for unpack - -.filter_block1d8_h6_rowloop: - movq xmm3, MMWORD PTR [rsi - 2] - movq xmm1, MMWORD PTR [rsi + 6] - - prefetcht2 [rsi+rax-2] - - pslldq xmm1, 8 - por xmm1, xmm3 - - movdqa xmm4, xmm1 - movdqa xmm5, xmm1 - - movdqa xmm6, xmm1 - movdqa xmm7, xmm1 - - punpcklbw xmm3, xmm0 ; xx05 xx04 xx03 xx02 xx01 xx01 xx-1 xx-2 - psrldq xmm4, 1 ; xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 00 -1 - - pmullw xmm3, XMMWORD PTR [rdx] ; x[-2] * H[-2]; Tap 1 - punpcklbw xmm4, xmm0 ; xx06 xx05 xx04 xx03 xx02 xx01 xx00 xx-1 - - psrldq xmm5, 2 ; xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 00 - pmullw xmm4, XMMWORD PTR [rdx+16] ; x[-1] * H[-1]; Tap 2 - - - punpcklbw xmm5, xmm0 ; xx07 xx06 xx05 xx04 xx03 xx02 xx01 xx00 - psrldq xmm6, 3 ; xx xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 - - pmullw xmm5, [rdx+32] ; x[ 0] * H[ 0]; Tap 3 - - punpcklbw xmm6, xmm0 ; xx08 xx07 xx06 xx05 xx04 xx03 xx02 xx01 - psrldq xmm7, 4 ; xx xx xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 - - pmullw xmm6, [rdx+48] ; x[ 1] * h[ 1] ; Tap 4 - - punpcklbw xmm7, xmm0 ; xx09 xx08 xx07 xx06 xx05 xx04 xx03 xx02 - psrldq xmm1, 5 ; xx xx xx xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 - - - pmullw xmm7, [rdx+64] ; x[ 2] * h[ 2] ; Tap 5 - - punpcklbw xmm1, xmm0 ; xx0a xx09 xx08 xx07 xx06 xx05 xx04 xx03 - pmullw xmm1, [rdx+80] ; x[ 3] * h[ 3] ; Tap 6 - - - paddsw xmm4, xmm7 - paddsw xmm4, xmm5 - - paddsw xmm4, xmm3 - paddsw xmm4, xmm6 - - paddsw xmm4, xmm1 - paddsw xmm4, [GLOBAL(rd)] - - psraw xmm4, 7 - - packuswb xmm4, xmm0 - punpcklbw xmm4, xmm0 - - movdqa XMMWORD Ptr [rdi], xmm4 - lea rsi, [rsi + rax] - -%if ABI_IS_32BIT - add rdi, DWORD Ptr arg(5) ;[output_width] -%else - add rdi, r8 -%endif - dec rcx - - jnz .filter_block1d8_h6_rowloop ; next row - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_filter_block1d16_h6_sse2 -;( -; unsigned char *src_ptr, -; unsigned short *output_ptr, -; unsigned int src_pixels_per_line, -; unsigned int pixel_step, -; unsigned int output_height, -; unsigned int output_width, -; short *vp8_filter -;) -;/************************************************************************************ -; Notes: filter_block1d_h6 applies a 6 tap filter horizontally to the input pixels. The -; input pixel array has output_height rows. This routine assumes that output_height is an -; even number. This function handles 8 pixels in horizontal direction, calculating ONE -; rows each iteration to take advantage of the 128 bits operations. -;*************************************************************************************/ -global sym(vp8_filter_block1d16_h6_sse2) PRIVATE -sym(vp8_filter_block1d16_h6_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - mov rdx, arg(6) ;vp8_filter - mov rsi, arg(0) ;src_ptr - - mov rdi, arg(1) ;output_ptr - - movsxd rcx, dword ptr arg(4) ;output_height - movsxd rax, dword ptr arg(2) ;src_pixels_per_line ; Pitch for Source -%if ABI_IS_32BIT=0 - movsxd r8, dword ptr arg(5) ;output_width -%endif - - pxor xmm0, xmm0 ; clear xmm0 for unpack - -.filter_block1d16_h6_sse2_rowloop: - movq xmm3, MMWORD PTR [rsi - 2] - movq xmm1, MMWORD PTR [rsi + 6] - - movq xmm2, MMWORD PTR [rsi +14] - pslldq xmm2, 8 - - por xmm2, xmm1 - prefetcht2 [rsi+rax-2] - - pslldq xmm1, 8 - por xmm1, xmm3 - - movdqa xmm4, xmm1 - movdqa xmm5, xmm1 - - movdqa xmm6, xmm1 - movdqa xmm7, xmm1 - - punpcklbw xmm3, xmm0 ; xx05 xx04 xx03 xx02 xx01 xx01 xx-1 xx-2 - psrldq xmm4, 1 ; xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 00 -1 - - pmullw xmm3, XMMWORD PTR [rdx] ; x[-2] * H[-2]; Tap 1 - punpcklbw xmm4, xmm0 ; xx06 xx05 xx04 xx03 xx02 xx01 xx00 xx-1 - - psrldq xmm5, 2 ; xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 00 - pmullw xmm4, XMMWORD PTR [rdx+16] ; x[-1] * H[-1]; Tap 2 - - - punpcklbw xmm5, xmm0 ; xx07 xx06 xx05 xx04 xx03 xx02 xx01 xx00 - psrldq xmm6, 3 ; xx xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 - - pmullw xmm5, [rdx+32] ; x[ 0] * H[ 0]; Tap 3 - - punpcklbw xmm6, xmm0 ; xx08 xx07 xx06 xx05 xx04 xx03 xx02 xx01 - psrldq xmm7, 4 ; xx xx xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 - - pmullw xmm6, [rdx+48] ; x[ 1] * h[ 1] ; Tap 4 - - punpcklbw xmm7, xmm0 ; xx09 xx08 xx07 xx06 xx05 xx04 xx03 xx02 - psrldq xmm1, 5 ; xx xx xx xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 - - - pmullw xmm7, [rdx+64] ; x[ 2] * h[ 2] ; Tap 5 - - punpcklbw xmm1, xmm0 ; xx0a xx09 xx08 xx07 xx06 xx05 xx04 xx03 - pmullw xmm1, [rdx+80] ; x[ 3] * h[ 3] ; Tap 6 - - paddsw xmm4, xmm7 - paddsw xmm4, xmm5 - - paddsw xmm4, xmm3 - paddsw xmm4, xmm6 - - paddsw xmm4, xmm1 - paddsw xmm4, [GLOBAL(rd)] - - psraw xmm4, 7 - - packuswb xmm4, xmm0 - punpcklbw xmm4, xmm0 - - movdqa XMMWORD Ptr [rdi], xmm4 - - movdqa xmm3, xmm2 - movdqa xmm4, xmm2 - - movdqa xmm5, xmm2 - movdqa xmm6, xmm2 - - movdqa xmm7, xmm2 - - punpcklbw xmm3, xmm0 ; xx05 xx04 xx03 xx02 xx01 xx01 xx-1 xx-2 - psrldq xmm4, 1 ; xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 00 -1 - - pmullw xmm3, XMMWORD PTR [rdx] ; x[-2] * H[-2]; Tap 1 - punpcklbw xmm4, xmm0 ; xx06 xx05 xx04 xx03 xx02 xx01 xx00 xx-1 - - psrldq xmm5, 2 ; xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 00 - pmullw xmm4, XMMWORD PTR [rdx+16] ; x[-1] * H[-1]; Tap 2 - - - punpcklbw xmm5, xmm0 ; xx07 xx06 xx05 xx04 xx03 xx02 xx01 xx00 - psrldq xmm6, 3 ; xx xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 - - pmullw xmm5, [rdx+32] ; x[ 0] * H[ 0]; Tap 3 - - punpcklbw xmm6, xmm0 ; xx08 xx07 xx06 xx05 xx04 xx03 xx02 xx01 - psrldq xmm7, 4 ; xx xx xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 - - pmullw xmm6, [rdx+48] ; x[ 1] * h[ 1] ; Tap 4 - - punpcklbw xmm7, xmm0 ; xx09 xx08 xx07 xx06 xx05 xx04 xx03 xx02 - psrldq xmm2, 5 ; xx xx xx xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 - - pmullw xmm7, [rdx+64] ; x[ 2] * h[ 2] ; Tap 5 - - punpcklbw xmm2, xmm0 ; xx0a xx09 xx08 xx07 xx06 xx05 xx04 xx03 - pmullw xmm2, [rdx+80] ; x[ 3] * h[ 3] ; Tap 6 - - - paddsw xmm4, xmm7 - paddsw xmm4, xmm5 - - paddsw xmm4, xmm3 - paddsw xmm4, xmm6 - - paddsw xmm4, xmm2 - paddsw xmm4, [GLOBAL(rd)] - - psraw xmm4, 7 - - packuswb xmm4, xmm0 - punpcklbw xmm4, xmm0 - - movdqa XMMWORD Ptr [rdi+16], xmm4 - - lea rsi, [rsi + rax] -%if ABI_IS_32BIT - add rdi, DWORD Ptr arg(5) ;[output_width] -%else - add rdi, r8 -%endif - - dec rcx - jnz .filter_block1d16_h6_sse2_rowloop ; next row - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_filter_block1d8_v6_sse2 -;( -; short *src_ptr, -; unsigned char *output_ptr, -; int dst_ptich, -; unsigned int pixels_per_line, -; unsigned int pixel_step, -; unsigned int output_height, -; unsigned int output_width, -; short * vp8_filter -;) -;/************************************************************************************ -; Notes: filter_block1d8_v6 applies a 6 tap filter vertically to the input pixels. The -; input pixel array has output_height rows. -;*************************************************************************************/ -global sym(vp8_filter_block1d8_v6_sse2) PRIVATE -sym(vp8_filter_block1d8_v6_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 8 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - mov rax, arg(7) ;vp8_filter - movsxd rdx, dword ptr arg(3) ;pixels_per_line - - mov rdi, arg(1) ;output_ptr - mov rsi, arg(0) ;src_ptr - - sub rsi, rdx - sub rsi, rdx - - movsxd rcx, DWORD PTR arg(5) ;[output_height] - pxor xmm0, xmm0 ; clear xmm0 - - movdqa xmm7, XMMWORD PTR [GLOBAL(rd)] -%if ABI_IS_32BIT=0 - movsxd r8, dword ptr arg(2) ; dst_ptich -%endif - -.vp8_filter_block1d8_v6_sse2_loop: - movdqa xmm1, XMMWORD PTR [rsi] - pmullw xmm1, [rax] - - movdqa xmm2, XMMWORD PTR [rsi + rdx] - pmullw xmm2, [rax + 16] - - movdqa xmm3, XMMWORD PTR [rsi + rdx * 2] - pmullw xmm3, [rax + 32] - - movdqa xmm5, XMMWORD PTR [rsi + rdx * 4] - pmullw xmm5, [rax + 64] - - add rsi, rdx - movdqa xmm4, XMMWORD PTR [rsi + rdx * 2] - - pmullw xmm4, [rax + 48] - movdqa xmm6, XMMWORD PTR [rsi + rdx * 4] - - pmullw xmm6, [rax + 80] - - paddsw xmm2, xmm5 - paddsw xmm2, xmm3 - - paddsw xmm2, xmm1 - paddsw xmm2, xmm4 - - paddsw xmm2, xmm6 - paddsw xmm2, xmm7 - - psraw xmm2, 7 - packuswb xmm2, xmm0 ; pack and saturate - - movq QWORD PTR [rdi], xmm2 ; store the results in the destination -%if ABI_IS_32BIT - add rdi, DWORD PTR arg(2) ;[dst_ptich] -%else - add rdi, r8 -%endif - dec rcx ; decrement count - jnz .vp8_filter_block1d8_v6_sse2_loop ; next row - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_filter_block1d16_v6_sse2 -;( -; unsigned short *src_ptr, -; unsigned char *output_ptr, -; int dst_ptich, -; unsigned int pixels_per_line, -; unsigned int pixel_step, -; unsigned int output_height, -; unsigned int output_width, -; const short *vp8_filter -;) -;/************************************************************************************ -; Notes: filter_block1d16_v6 applies a 6 tap filter vertically to the input pixels. The -; input pixel array has output_height rows. -;*************************************************************************************/ -global sym(vp8_filter_block1d16_v6_sse2) PRIVATE -sym(vp8_filter_block1d16_v6_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 8 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - mov rax, arg(7) ;vp8_filter - movsxd rdx, dword ptr arg(3) ;pixels_per_line - - mov rdi, arg(1) ;output_ptr - mov rsi, arg(0) ;src_ptr - - sub rsi, rdx - sub rsi, rdx - - movsxd rcx, DWORD PTR arg(5) ;[output_height] -%if ABI_IS_32BIT=0 - movsxd r8, dword ptr arg(2) ; dst_ptich -%endif - -.vp8_filter_block1d16_v6_sse2_loop: -; The order for adding 6-tap is 2 5 3 1 4 6. Read in data in that order. - movdqa xmm1, XMMWORD PTR [rsi + rdx] ; line 2 - movdqa xmm2, XMMWORD PTR [rsi + rdx + 16] - pmullw xmm1, [rax + 16] - pmullw xmm2, [rax + 16] - - movdqa xmm3, XMMWORD PTR [rsi + rdx * 4] ; line 5 - movdqa xmm4, XMMWORD PTR [rsi + rdx * 4 + 16] - pmullw xmm3, [rax + 64] - pmullw xmm4, [rax + 64] - - movdqa xmm5, XMMWORD PTR [rsi + rdx * 2] ; line 3 - movdqa xmm6, XMMWORD PTR [rsi + rdx * 2 + 16] - pmullw xmm5, [rax + 32] - pmullw xmm6, [rax + 32] - - movdqa xmm7, XMMWORD PTR [rsi] ; line 1 - movdqa xmm0, XMMWORD PTR [rsi + 16] - pmullw xmm7, [rax] - pmullw xmm0, [rax] - - paddsw xmm1, xmm3 - paddsw xmm2, xmm4 - paddsw xmm1, xmm5 - paddsw xmm2, xmm6 - paddsw xmm1, xmm7 - paddsw xmm2, xmm0 - - add rsi, rdx - - movdqa xmm3, XMMWORD PTR [rsi + rdx * 2] ; line 4 - movdqa xmm4, XMMWORD PTR [rsi + rdx * 2 + 16] - pmullw xmm3, [rax + 48] - pmullw xmm4, [rax + 48] - - movdqa xmm5, XMMWORD PTR [rsi + rdx * 4] ; line 6 - movdqa xmm6, XMMWORD PTR [rsi + rdx * 4 + 16] - pmullw xmm5, [rax + 80] - pmullw xmm6, [rax + 80] - - movdqa xmm7, XMMWORD PTR [GLOBAL(rd)] - pxor xmm0, xmm0 ; clear xmm0 - - paddsw xmm1, xmm3 - paddsw xmm2, xmm4 - paddsw xmm1, xmm5 - paddsw xmm2, xmm6 - - paddsw xmm1, xmm7 - paddsw xmm2, xmm7 - - psraw xmm1, 7 - psraw xmm2, 7 - - packuswb xmm1, xmm2 ; pack and saturate - movdqa XMMWORD PTR [rdi], xmm1 ; store the results in the destination -%if ABI_IS_32BIT - add rdi, DWORD PTR arg(2) ;[dst_ptich] -%else - add rdi, r8 -%endif - dec rcx ; decrement count - jnz .vp8_filter_block1d16_v6_sse2_loop ; next row - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_filter_block1d8_h6_only_sse2 -;( -; unsigned char *src_ptr, -; unsigned int src_pixels_per_line, -; unsigned char *output_ptr, -; int dst_ptich, -; unsigned int output_height, -; const short *vp8_filter -;) -; First-pass filter only when yoffset==0 -global sym(vp8_filter_block1d8_h6_only_sse2) PRIVATE -sym(vp8_filter_block1d8_h6_only_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - mov rdx, arg(5) ;vp8_filter - mov rsi, arg(0) ;src_ptr - - mov rdi, arg(2) ;output_ptr - - movsxd rcx, dword ptr arg(4) ;output_height - movsxd rax, dword ptr arg(1) ;src_pixels_per_line ; Pitch for Source -%if ABI_IS_32BIT=0 - movsxd r8, dword ptr arg(3) ;dst_ptich -%endif - pxor xmm0, xmm0 ; clear xmm0 for unpack - -.filter_block1d8_h6_only_rowloop: - movq xmm3, MMWORD PTR [rsi - 2] - movq xmm1, MMWORD PTR [rsi + 6] - - prefetcht2 [rsi+rax-2] - - pslldq xmm1, 8 - por xmm1, xmm3 - - movdqa xmm4, xmm1 - movdqa xmm5, xmm1 - - movdqa xmm6, xmm1 - movdqa xmm7, xmm1 - - punpcklbw xmm3, xmm0 ; xx05 xx04 xx03 xx02 xx01 xx01 xx-1 xx-2 - psrldq xmm4, 1 ; xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 00 -1 - - pmullw xmm3, XMMWORD PTR [rdx] ; x[-2] * H[-2]; Tap 1 - punpcklbw xmm4, xmm0 ; xx06 xx05 xx04 xx03 xx02 xx01 xx00 xx-1 - - psrldq xmm5, 2 ; xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 00 - pmullw xmm4, XMMWORD PTR [rdx+16] ; x[-1] * H[-1]; Tap 2 - - - punpcklbw xmm5, xmm0 ; xx07 xx06 xx05 xx04 xx03 xx02 xx01 xx00 - psrldq xmm6, 3 ; xx xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 - - pmullw xmm5, [rdx+32] ; x[ 0] * H[ 0]; Tap 3 - - punpcklbw xmm6, xmm0 ; xx08 xx07 xx06 xx05 xx04 xx03 xx02 xx01 - psrldq xmm7, 4 ; xx xx xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 - - pmullw xmm6, [rdx+48] ; x[ 1] * h[ 1] ; Tap 4 - - punpcklbw xmm7, xmm0 ; xx09 xx08 xx07 xx06 xx05 xx04 xx03 xx02 - psrldq xmm1, 5 ; xx xx xx xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 - - - pmullw xmm7, [rdx+64] ; x[ 2] * h[ 2] ; Tap 5 - - punpcklbw xmm1, xmm0 ; xx0a xx09 xx08 xx07 xx06 xx05 xx04 xx03 - pmullw xmm1, [rdx+80] ; x[ 3] * h[ 3] ; Tap 6 - - - paddsw xmm4, xmm7 - paddsw xmm4, xmm5 - - paddsw xmm4, xmm3 - paddsw xmm4, xmm6 - - paddsw xmm4, xmm1 - paddsw xmm4, [GLOBAL(rd)] - - psraw xmm4, 7 - - packuswb xmm4, xmm0 - - movq QWORD PTR [rdi], xmm4 ; store the results in the destination - lea rsi, [rsi + rax] - -%if ABI_IS_32BIT - add rdi, DWORD Ptr arg(3) ;dst_ptich -%else - add rdi, r8 -%endif - dec rcx - - jnz .filter_block1d8_h6_only_rowloop ; next row - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_filter_block1d16_h6_only_sse2 -;( -; unsigned char *src_ptr, -; unsigned int src_pixels_per_line, -; unsigned char *output_ptr, -; int dst_ptich, -; unsigned int output_height, -; const short *vp8_filter -;) -; First-pass filter only when yoffset==0 -global sym(vp8_filter_block1d16_h6_only_sse2) PRIVATE -sym(vp8_filter_block1d16_h6_only_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - mov rdx, arg(5) ;vp8_filter - mov rsi, arg(0) ;src_ptr - - mov rdi, arg(2) ;output_ptr - - movsxd rcx, dword ptr arg(4) ;output_height - movsxd rax, dword ptr arg(1) ;src_pixels_per_line ; Pitch for Source -%if ABI_IS_32BIT=0 - movsxd r8, dword ptr arg(3) ;dst_ptich -%endif - - pxor xmm0, xmm0 ; clear xmm0 for unpack - -.filter_block1d16_h6_only_sse2_rowloop: - movq xmm3, MMWORD PTR [rsi - 2] - movq xmm1, MMWORD PTR [rsi + 6] - - movq xmm2, MMWORD PTR [rsi +14] - pslldq xmm2, 8 - - por xmm2, xmm1 - prefetcht2 [rsi+rax-2] - - pslldq xmm1, 8 - por xmm1, xmm3 - - movdqa xmm4, xmm1 - movdqa xmm5, xmm1 - - movdqa xmm6, xmm1 - movdqa xmm7, xmm1 - - punpcklbw xmm3, xmm0 ; xx05 xx04 xx03 xx02 xx01 xx01 xx-1 xx-2 - psrldq xmm4, 1 ; xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 00 -1 - - pmullw xmm3, XMMWORD PTR [rdx] ; x[-2] * H[-2]; Tap 1 - punpcklbw xmm4, xmm0 ; xx06 xx05 xx04 xx03 xx02 xx01 xx00 xx-1 - - psrldq xmm5, 2 ; xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 00 - pmullw xmm4, XMMWORD PTR [rdx+16] ; x[-1] * H[-1]; Tap 2 - - punpcklbw xmm5, xmm0 ; xx07 xx06 xx05 xx04 xx03 xx02 xx01 xx00 - psrldq xmm6, 3 ; xx xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 - - pmullw xmm5, [rdx+32] ; x[ 0] * H[ 0]; Tap 3 - - punpcklbw xmm6, xmm0 ; xx08 xx07 xx06 xx05 xx04 xx03 xx02 xx01 - psrldq xmm7, 4 ; xx xx xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 - - pmullw xmm6, [rdx+48] ; x[ 1] * h[ 1] ; Tap 4 - - punpcklbw xmm7, xmm0 ; xx09 xx08 xx07 xx06 xx05 xx04 xx03 xx02 - psrldq xmm1, 5 ; xx xx xx xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 - - pmullw xmm7, [rdx+64] ; x[ 2] * h[ 2] ; Tap 5 - - punpcklbw xmm1, xmm0 ; xx0a xx09 xx08 xx07 xx06 xx05 xx04 xx03 - pmullw xmm1, [rdx+80] ; x[ 3] * h[ 3] ; Tap 6 - - paddsw xmm4, xmm7 - paddsw xmm4, xmm5 - - paddsw xmm4, xmm3 - paddsw xmm4, xmm6 - - paddsw xmm4, xmm1 - paddsw xmm4, [GLOBAL(rd)] - - psraw xmm4, 7 - - packuswb xmm4, xmm0 ; lower 8 bytes - - movq QWORD Ptr [rdi], xmm4 ; store the results in the destination - - movdqa xmm3, xmm2 - movdqa xmm4, xmm2 - - movdqa xmm5, xmm2 - movdqa xmm6, xmm2 - - movdqa xmm7, xmm2 - - punpcklbw xmm3, xmm0 ; xx05 xx04 xx03 xx02 xx01 xx01 xx-1 xx-2 - psrldq xmm4, 1 ; xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 00 -1 - - pmullw xmm3, XMMWORD PTR [rdx] ; x[-2] * H[-2]; Tap 1 - punpcklbw xmm4, xmm0 ; xx06 xx05 xx04 xx03 xx02 xx01 xx00 xx-1 - - psrldq xmm5, 2 ; xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 00 - pmullw xmm4, XMMWORD PTR [rdx+16] ; x[-1] * H[-1]; Tap 2 - - punpcklbw xmm5, xmm0 ; xx07 xx06 xx05 xx04 xx03 xx02 xx01 xx00 - psrldq xmm6, 3 ; xx xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 - - pmullw xmm5, [rdx+32] ; x[ 0] * H[ 0]; Tap 3 - - punpcklbw xmm6, xmm0 ; xx08 xx07 xx06 xx05 xx04 xx03 xx02 xx01 - psrldq xmm7, 4 ; xx xx xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 02 - - pmullw xmm6, [rdx+48] ; x[ 1] * h[ 1] ; Tap 4 - - punpcklbw xmm7, xmm0 ; xx09 xx08 xx07 xx06 xx05 xx04 xx03 xx02 - psrldq xmm2, 5 ; xx xx xx xx xx 0d 0c 0b 0a 09 08 07 06 05 04 03 - - pmullw xmm7, [rdx+64] ; x[ 2] * h[ 2] ; Tap 5 - - punpcklbw xmm2, xmm0 ; xx0a xx09 xx08 xx07 xx06 xx05 xx04 xx03 - pmullw xmm2, [rdx+80] ; x[ 3] * h[ 3] ; Tap 6 - - paddsw xmm4, xmm7 - paddsw xmm4, xmm5 - - paddsw xmm4, xmm3 - paddsw xmm4, xmm6 - - paddsw xmm4, xmm2 - paddsw xmm4, [GLOBAL(rd)] - - psraw xmm4, 7 - - packuswb xmm4, xmm0 ; higher 8 bytes - - movq QWORD Ptr [rdi+8], xmm4 ; store the results in the destination - - lea rsi, [rsi + rax] -%if ABI_IS_32BIT - add rdi, DWORD Ptr arg(3) ;dst_ptich -%else - add rdi, r8 -%endif - - dec rcx - jnz .filter_block1d16_h6_only_sse2_rowloop ; next row - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_filter_block1d8_v6_only_sse2 -;( -; unsigned char *src_ptr, -; unsigned int src_pixels_per_line, -; unsigned char *output_ptr, -; int dst_ptich, -; unsigned int output_height, -; const short *vp8_filter -;) -; Second-pass filter only when xoffset==0 -global sym(vp8_filter_block1d8_v6_only_sse2) PRIVATE -sym(vp8_filter_block1d8_v6_only_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;output_ptr - - movsxd rcx, dword ptr arg(4) ;output_height - movsxd rdx, dword ptr arg(1) ;src_pixels_per_line - - mov rax, arg(5) ;vp8_filter - - pxor xmm0, xmm0 ; clear xmm0 - - movdqa xmm7, XMMWORD PTR [GLOBAL(rd)] -%if ABI_IS_32BIT=0 - movsxd r8, dword ptr arg(3) ; dst_ptich -%endif - -.vp8_filter_block1d8_v6_only_sse2_loop: - movq xmm1, MMWORD PTR [rsi] - movq xmm2, MMWORD PTR [rsi + rdx] - movq xmm3, MMWORD PTR [rsi + rdx * 2] - movq xmm5, MMWORD PTR [rsi + rdx * 4] - add rsi, rdx - movq xmm4, MMWORD PTR [rsi + rdx * 2] - movq xmm6, MMWORD PTR [rsi + rdx * 4] - - punpcklbw xmm1, xmm0 - pmullw xmm1, [rax] - - punpcklbw xmm2, xmm0 - pmullw xmm2, [rax + 16] - - punpcklbw xmm3, xmm0 - pmullw xmm3, [rax + 32] - - punpcklbw xmm5, xmm0 - pmullw xmm5, [rax + 64] - - punpcklbw xmm4, xmm0 - pmullw xmm4, [rax + 48] - - punpcklbw xmm6, xmm0 - pmullw xmm6, [rax + 80] - - paddsw xmm2, xmm5 - paddsw xmm2, xmm3 - - paddsw xmm2, xmm1 - paddsw xmm2, xmm4 - - paddsw xmm2, xmm6 - paddsw xmm2, xmm7 - - psraw xmm2, 7 - packuswb xmm2, xmm0 ; pack and saturate - - movq QWORD PTR [rdi], xmm2 ; store the results in the destination -%if ABI_IS_32BIT - add rdi, DWORD PTR arg(3) ;[dst_ptich] -%else - add rdi, r8 -%endif - dec rcx ; decrement count - jnz .vp8_filter_block1d8_v6_only_sse2_loop ; next row - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_unpack_block1d16_h6_sse2 -;( -; unsigned char *src_ptr, -; unsigned short *output_ptr, -; unsigned int src_pixels_per_line, -; unsigned int output_height, -; unsigned int output_width -;) -global sym(vp8_unpack_block1d16_h6_sse2) PRIVATE -sym(vp8_unpack_block1d16_h6_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(1) ;output_ptr - - movsxd rcx, dword ptr arg(3) ;output_height - movsxd rax, dword ptr arg(2) ;src_pixels_per_line ; Pitch for Source - - pxor xmm0, xmm0 ; clear xmm0 for unpack -%if ABI_IS_32BIT=0 - movsxd r8, dword ptr arg(4) ;output_width ; Pitch for Source -%endif - -.unpack_block1d16_h6_sse2_rowloop: - movq xmm1, MMWORD PTR [rsi] ; 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 00 -1 -2 - movq xmm3, MMWORD PTR [rsi+8] ; make copy of xmm1 - - punpcklbw xmm3, xmm0 ; xx05 xx04 xx03 xx02 xx01 xx01 xx-1 xx-2 - punpcklbw xmm1, xmm0 - - movdqa XMMWORD Ptr [rdi], xmm1 - movdqa XMMWORD Ptr [rdi + 16], xmm3 - - lea rsi, [rsi + rax] -%if ABI_IS_32BIT - add rdi, DWORD Ptr arg(4) ;[output_width] -%else - add rdi, r8 -%endif - dec rcx - jnz .unpack_block1d16_h6_sse2_rowloop ; next row - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_bilinear_predict16x16_sse2 -;( -; unsigned char *src_ptr, -; int src_pixels_per_line, -; int xoffset, -; int yoffset, -; unsigned char *dst_ptr, -; int dst_pitch -;) -extern sym(vp8_bilinear_filters_x86_8) -global sym(vp8_bilinear_predict16x16_sse2) PRIVATE -sym(vp8_bilinear_predict16x16_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - ;const short *HFilter = vp8_bilinear_filters_x86_8[xoffset] - ;const short *VFilter = vp8_bilinear_filters_x86_8[yoffset] - - lea rcx, [GLOBAL(sym(vp8_bilinear_filters_x86_8))] - movsxd rax, dword ptr arg(2) ;xoffset - - cmp rax, 0 ;skip first_pass filter if xoffset=0 - je .b16x16_sp_only - - shl rax, 5 - add rax, rcx ;HFilter - - mov rdi, arg(4) ;dst_ptr - mov rsi, arg(0) ;src_ptr - movsxd rdx, dword ptr arg(5) ;dst_pitch - - movdqa xmm1, [rax] - movdqa xmm2, [rax+16] - - movsxd rax, dword ptr arg(3) ;yoffset - - cmp rax, 0 ;skip second_pass filter if yoffset=0 - je .b16x16_fp_only - - shl rax, 5 - add rax, rcx ;VFilter - - lea rcx, [rdi+rdx*8] - lea rcx, [rcx+rdx*8] - movsxd rdx, dword ptr arg(1) ;src_pixels_per_line - - pxor xmm0, xmm0 - -%if ABI_IS_32BIT=0 - movsxd r8, dword ptr arg(5) ;dst_pitch -%endif - ; get the first horizontal line done - movdqu xmm3, [rsi] ; xx 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 - movdqa xmm4, xmm3 ; make a copy of current line - - punpcklbw xmm3, xmm0 ; xx 00 01 02 03 04 05 06 - punpckhbw xmm4, xmm0 - - pmullw xmm3, xmm1 - pmullw xmm4, xmm1 - - movdqu xmm5, [rsi+1] - movdqa xmm6, xmm5 - - punpcklbw xmm5, xmm0 - punpckhbw xmm6, xmm0 - - pmullw xmm5, xmm2 - pmullw xmm6, xmm2 - - paddw xmm3, xmm5 - paddw xmm4, xmm6 - - paddw xmm3, [GLOBAL(rd)] ; xmm3 += round value - psraw xmm3, VP8_FILTER_SHIFT ; xmm3 /= 128 - - paddw xmm4, [GLOBAL(rd)] - psraw xmm4, VP8_FILTER_SHIFT - - movdqa xmm7, xmm3 - packuswb xmm7, xmm4 - - add rsi, rdx ; next line -.next_row: - movdqu xmm3, [rsi] ; xx 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 - movdqa xmm4, xmm3 ; make a copy of current line - - punpcklbw xmm3, xmm0 ; xx 00 01 02 03 04 05 06 - punpckhbw xmm4, xmm0 - - pmullw xmm3, xmm1 - pmullw xmm4, xmm1 - - movdqu xmm5, [rsi+1] - movdqa xmm6, xmm5 - - punpcklbw xmm5, xmm0 - punpckhbw xmm6, xmm0 - - pmullw xmm5, xmm2 - pmullw xmm6, xmm2 - - paddw xmm3, xmm5 - paddw xmm4, xmm6 - - movdqa xmm5, xmm7 - movdqa xmm6, xmm7 - - punpcklbw xmm5, xmm0 - punpckhbw xmm6, xmm0 - - pmullw xmm5, [rax] - pmullw xmm6, [rax] - - paddw xmm3, [GLOBAL(rd)] ; xmm3 += round value - psraw xmm3, VP8_FILTER_SHIFT ; xmm3 /= 128 - - paddw xmm4, [GLOBAL(rd)] - psraw xmm4, VP8_FILTER_SHIFT - - movdqa xmm7, xmm3 - packuswb xmm7, xmm4 - - pmullw xmm3, [rax+16] - pmullw xmm4, [rax+16] - - paddw xmm3, xmm5 - paddw xmm4, xmm6 - - paddw xmm3, [GLOBAL(rd)] ; xmm3 += round value - psraw xmm3, VP8_FILTER_SHIFT ; xmm3 /= 128 - - paddw xmm4, [GLOBAL(rd)] - psraw xmm4, VP8_FILTER_SHIFT - - packuswb xmm3, xmm4 - movdqa [rdi], xmm3 ; store the results in the destination - - add rsi, rdx ; next line -%if ABI_IS_32BIT - add rdi, DWORD PTR arg(5) ;dst_pitch -%else - add rdi, r8 -%endif - - cmp rdi, rcx - jne .next_row - - jmp .done - -.b16x16_sp_only: - movsxd rax, dword ptr arg(3) ;yoffset - shl rax, 5 - add rax, rcx ;VFilter - - mov rdi, arg(4) ;dst_ptr - mov rsi, arg(0) ;src_ptr - movsxd rdx, dword ptr arg(5) ;dst_pitch - - movdqa xmm1, [rax] - movdqa xmm2, [rax+16] - - lea rcx, [rdi+rdx*8] - lea rcx, [rcx+rdx*8] - movsxd rax, dword ptr arg(1) ;src_pixels_per_line - - pxor xmm0, xmm0 - - ; get the first horizontal line done - movdqu xmm7, [rsi] ; xx 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 - - add rsi, rax ; next line -.next_row_spo: - movdqu xmm3, [rsi] ; xx 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 - - movdqa xmm5, xmm7 - movdqa xmm6, xmm7 - - movdqa xmm4, xmm3 ; make a copy of current line - movdqa xmm7, xmm3 - - punpcklbw xmm5, xmm0 - punpckhbw xmm6, xmm0 - punpcklbw xmm3, xmm0 ; xx 00 01 02 03 04 05 06 - punpckhbw xmm4, xmm0 - - pmullw xmm5, xmm1 - pmullw xmm6, xmm1 - pmullw xmm3, xmm2 - pmullw xmm4, xmm2 - - paddw xmm3, xmm5 - paddw xmm4, xmm6 - - paddw xmm3, [GLOBAL(rd)] ; xmm3 += round value - psraw xmm3, VP8_FILTER_SHIFT ; xmm3 /= 128 - - paddw xmm4, [GLOBAL(rd)] - psraw xmm4, VP8_FILTER_SHIFT - - packuswb xmm3, xmm4 - movdqa [rdi], xmm3 ; store the results in the destination - - add rsi, rax ; next line - add rdi, rdx ;dst_pitch - cmp rdi, rcx - jne .next_row_spo - - jmp .done - -.b16x16_fp_only: - lea rcx, [rdi+rdx*8] - lea rcx, [rcx+rdx*8] - movsxd rax, dword ptr arg(1) ;src_pixels_per_line - pxor xmm0, xmm0 - -.next_row_fpo: - movdqu xmm3, [rsi] ; xx 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 - movdqa xmm4, xmm3 ; make a copy of current line - - punpcklbw xmm3, xmm0 ; xx 00 01 02 03 04 05 06 - punpckhbw xmm4, xmm0 - - pmullw xmm3, xmm1 - pmullw xmm4, xmm1 - - movdqu xmm5, [rsi+1] - movdqa xmm6, xmm5 - - punpcklbw xmm5, xmm0 - punpckhbw xmm6, xmm0 - - pmullw xmm5, xmm2 - pmullw xmm6, xmm2 - - paddw xmm3, xmm5 - paddw xmm4, xmm6 - - paddw xmm3, [GLOBAL(rd)] ; xmm3 += round value - psraw xmm3, VP8_FILTER_SHIFT ; xmm3 /= 128 - - paddw xmm4, [GLOBAL(rd)] - psraw xmm4, VP8_FILTER_SHIFT - - packuswb xmm3, xmm4 - movdqa [rdi], xmm3 ; store the results in the destination - - add rsi, rax ; next line - add rdi, rdx ; dst_pitch - cmp rdi, rcx - jne .next_row_fpo - -.done: - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_bilinear_predict8x8_sse2 -;( -; unsigned char *src_ptr, -; int src_pixels_per_line, -; int xoffset, -; int yoffset, -; unsigned char *dst_ptr, -; int dst_pitch -;) -global sym(vp8_bilinear_predict8x8_sse2) PRIVATE -sym(vp8_bilinear_predict8x8_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, 144 ; reserve 144 bytes - - ;const short *HFilter = vp8_bilinear_filters_x86_8[xoffset] - ;const short *VFilter = vp8_bilinear_filters_x86_8[yoffset] - lea rcx, [GLOBAL(sym(vp8_bilinear_filters_x86_8))] - - mov rsi, arg(0) ;src_ptr - movsxd rdx, dword ptr arg(1) ;src_pixels_per_line - - ;Read 9-line unaligned data in and put them on stack. This gives a big - ;performance boost. - movdqu xmm0, [rsi] - lea rax, [rdx + rdx*2] - movdqu xmm1, [rsi+rdx] - movdqu xmm2, [rsi+rdx*2] - add rsi, rax - movdqu xmm3, [rsi] - movdqu xmm4, [rsi+rdx] - movdqu xmm5, [rsi+rdx*2] - add rsi, rax - movdqu xmm6, [rsi] - movdqu xmm7, [rsi+rdx] - - movdqa XMMWORD PTR [rsp], xmm0 - - movdqu xmm0, [rsi+rdx*2] - - movdqa XMMWORD PTR [rsp+16], xmm1 - movdqa XMMWORD PTR [rsp+32], xmm2 - movdqa XMMWORD PTR [rsp+48], xmm3 - movdqa XMMWORD PTR [rsp+64], xmm4 - movdqa XMMWORD PTR [rsp+80], xmm5 - movdqa XMMWORD PTR [rsp+96], xmm6 - movdqa XMMWORD PTR [rsp+112], xmm7 - movdqa XMMWORD PTR [rsp+128], xmm0 - - movsxd rax, dword ptr arg(2) ;xoffset - shl rax, 5 - add rax, rcx ;HFilter - - mov rdi, arg(4) ;dst_ptr - movsxd rdx, dword ptr arg(5) ;dst_pitch - - movdqa xmm1, [rax] - movdqa xmm2, [rax+16] - - movsxd rax, dword ptr arg(3) ;yoffset - shl rax, 5 - add rax, rcx ;VFilter - - lea rcx, [rdi+rdx*8] - - movdqa xmm5, [rax] - movdqa xmm6, [rax+16] - - pxor xmm0, xmm0 - - ; get the first horizontal line done - movdqa xmm3, XMMWORD PTR [rsp] - movdqa xmm4, xmm3 ; make a copy of current line - psrldq xmm4, 1 - - punpcklbw xmm3, xmm0 ; 00 01 02 03 04 05 06 07 - punpcklbw xmm4, xmm0 ; 01 02 03 04 05 06 07 08 - - pmullw xmm3, xmm1 - pmullw xmm4, xmm2 - - paddw xmm3, xmm4 - - paddw xmm3, [GLOBAL(rd)] ; xmm3 += round value - psraw xmm3, VP8_FILTER_SHIFT ; xmm3 /= 128 - - movdqa xmm7, xmm3 - add rsp, 16 ; next line -.next_row8x8: - movdqa xmm3, XMMWORD PTR [rsp] ; 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 - movdqa xmm4, xmm3 ; make a copy of current line - psrldq xmm4, 1 - - punpcklbw xmm3, xmm0 ; 00 01 02 03 04 05 06 07 - punpcklbw xmm4, xmm0 ; 01 02 03 04 05 06 07 08 - - pmullw xmm3, xmm1 - pmullw xmm4, xmm2 - - paddw xmm3, xmm4 - pmullw xmm7, xmm5 - - paddw xmm3, [GLOBAL(rd)] ; xmm3 += round value - psraw xmm3, VP8_FILTER_SHIFT ; xmm3 /= 128 - - movdqa xmm4, xmm3 - - pmullw xmm3, xmm6 - paddw xmm3, xmm7 - - movdqa xmm7, xmm4 - - paddw xmm3, [GLOBAL(rd)] ; xmm3 += round value - psraw xmm3, VP8_FILTER_SHIFT ; xmm3 /= 128 - - packuswb xmm3, xmm0 - movq [rdi], xmm3 ; store the results in the destination - - add rsp, 16 ; next line - add rdi, rdx - - cmp rdi, rcx - jne .next_row8x8 - - ;add rsp, 144 - pop rsp - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - -SECTION_RODATA -align 16 -rd: - times 8 dw 0x40 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/subpixel_ssse3.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/subpixel_ssse3.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/subpixel_ssse3.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/subpixel_ssse3.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,1508 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -%define BLOCK_HEIGHT_WIDTH 4 -%define VP8_FILTER_WEIGHT 128 -%define VP8_FILTER_SHIFT 7 - - -;/************************************************************************************ -; Notes: filter_block1d_h6 applies a 6 tap filter horizontally to the input pixels. The -; input pixel array has output_height rows. This routine assumes that output_height is an -; even number. This function handles 8 pixels in horizontal direction, calculating ONE -; rows each iteration to take advantage of the 128 bits operations. -; -; This is an implementation of some of the SSE optimizations first seen in ffvp8 -; -;*************************************************************************************/ -;void vp8_filter_block1d8_h6_ssse3 -;( -; unsigned char *src_ptr, -; unsigned int src_pixels_per_line, -; unsigned char *output_ptr, -; unsigned int output_pitch, -; unsigned int output_height, -; unsigned int vp8_filter_index -;) -global sym(vp8_filter_block1d8_h6_ssse3) PRIVATE -sym(vp8_filter_block1d8_h6_ssse3): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - movsxd rdx, DWORD PTR arg(5) ;table index - xor rsi, rsi - shl rdx, 4 - - movdqa xmm7, [GLOBAL(rd)] - - lea rax, [GLOBAL(k0_k5)] - add rax, rdx - mov rdi, arg(2) ;output_ptr - - cmp esi, DWORD PTR [rax] - je vp8_filter_block1d8_h4_ssse3 - - movdqa xmm4, XMMWORD PTR [rax] ;k0_k5 - movdqa xmm5, XMMWORD PTR [rax+256] ;k2_k4 - movdqa xmm6, XMMWORD PTR [rax+128] ;k1_k3 - - mov rsi, arg(0) ;src_ptr - movsxd rax, dword ptr arg(1) ;src_pixels_per_line - movsxd rcx, dword ptr arg(4) ;output_height - - movsxd rdx, dword ptr arg(3) ;output_pitch - - sub rdi, rdx -;xmm3 free -.filter_block1d8_h6_rowloop_ssse3: - movq xmm0, MMWORD PTR [rsi - 2] ; -2 -1 0 1 2 3 4 5 - - movq xmm2, MMWORD PTR [rsi + 3] ; 3 4 5 6 7 8 9 10 - - punpcklbw xmm0, xmm2 ; -2 3 -1 4 0 5 1 6 2 7 3 8 4 9 5 10 - - movdqa xmm1, xmm0 - pmaddubsw xmm0, xmm4 - - movdqa xmm2, xmm1 - pshufb xmm1, [GLOBAL(shuf2bfrom1)] - - pshufb xmm2, [GLOBAL(shuf3bfrom1)] - pmaddubsw xmm1, xmm5 - - lea rdi, [rdi + rdx] - pmaddubsw xmm2, xmm6 - - lea rsi, [rsi + rax] - dec rcx - - paddsw xmm0, xmm1 - paddsw xmm2, xmm7 - - paddsw xmm0, xmm2 - - psraw xmm0, 7 - - packuswb xmm0, xmm0 - - movq MMWORD Ptr [rdi], xmm0 - jnz .filter_block1d8_h6_rowloop_ssse3 - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -vp8_filter_block1d8_h4_ssse3: - movdqa xmm5, XMMWORD PTR [rax+256] ;k2_k4 - movdqa xmm6, XMMWORD PTR [rax+128] ;k1_k3 - - movdqa xmm3, XMMWORD PTR [GLOBAL(shuf2bfrom1)] - movdqa xmm4, XMMWORD PTR [GLOBAL(shuf3bfrom1)] - - mov rsi, arg(0) ;src_ptr - - movsxd rax, dword ptr arg(1) ;src_pixels_per_line - movsxd rcx, dword ptr arg(4) ;output_height - - movsxd rdx, dword ptr arg(3) ;output_pitch - - sub rdi, rdx - -.filter_block1d8_h4_rowloop_ssse3: - movq xmm0, MMWORD PTR [rsi - 2] ; -2 -1 0 1 2 3 4 5 - - movq xmm1, MMWORD PTR [rsi + 3] ; 3 4 5 6 7 8 9 10 - - punpcklbw xmm0, xmm1 ; -2 3 -1 4 0 5 1 6 2 7 3 8 4 9 5 10 - - movdqa xmm2, xmm0 - pshufb xmm0, xmm3 - - pshufb xmm2, xmm4 - pmaddubsw xmm0, xmm5 - - lea rdi, [rdi + rdx] - pmaddubsw xmm2, xmm6 - - lea rsi, [rsi + rax] - dec rcx - - paddsw xmm0, xmm7 - - paddsw xmm0, xmm2 - - psraw xmm0, 7 - - packuswb xmm0, xmm0 - - movq MMWORD Ptr [rdi], xmm0 - - jnz .filter_block1d8_h4_rowloop_ssse3 - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret -;void vp8_filter_block1d16_h6_ssse3 -;( -; unsigned char *src_ptr, -; unsigned int src_pixels_per_line, -; unsigned char *output_ptr, -; unsigned int output_pitch, -; unsigned int output_height, -; unsigned int vp8_filter_index -;) -global sym(vp8_filter_block1d16_h6_ssse3) PRIVATE -sym(vp8_filter_block1d16_h6_ssse3): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - movsxd rdx, DWORD PTR arg(5) ;table index - xor rsi, rsi - shl rdx, 4 ; - - lea rax, [GLOBAL(k0_k5)] - add rax, rdx - - mov rdi, arg(2) ;output_ptr - - mov rsi, arg(0) ;src_ptr - - movdqa xmm4, XMMWORD PTR [rax] ;k0_k5 - movdqa xmm5, XMMWORD PTR [rax+256] ;k2_k4 - movdqa xmm6, XMMWORD PTR [rax+128] ;k1_k3 - - movsxd rax, dword ptr arg(1) ;src_pixels_per_line - movsxd rcx, dword ptr arg(4) ;output_height - movsxd rdx, dword ptr arg(3) ;output_pitch - -.filter_block1d16_h6_rowloop_ssse3: - movq xmm0, MMWORD PTR [rsi - 2] ; -2 -1 0 1 2 3 4 5 - - movq xmm3, MMWORD PTR [rsi + 3] ; 3 4 5 6 7 8 9 10 - - punpcklbw xmm0, xmm3 ; -2 3 -1 4 0 5 1 6 2 7 3 8 4 9 5 10 - - movdqa xmm1, xmm0 - pmaddubsw xmm0, xmm4 - - movdqa xmm2, xmm1 - pshufb xmm1, [GLOBAL(shuf2bfrom1)] - - pshufb xmm2, [GLOBAL(shuf3bfrom1)] - movq xmm3, MMWORD PTR [rsi + 6] - - pmaddubsw xmm1, xmm5 - movq xmm7, MMWORD PTR [rsi + 11] - - pmaddubsw xmm2, xmm6 - punpcklbw xmm3, xmm7 - - paddsw xmm0, xmm1 - movdqa xmm1, xmm3 - - pmaddubsw xmm3, xmm4 - paddsw xmm0, xmm2 - - movdqa xmm2, xmm1 - paddsw xmm0, [GLOBAL(rd)] - - pshufb xmm1, [GLOBAL(shuf2bfrom1)] - pshufb xmm2, [GLOBAL(shuf3bfrom1)] - - psraw xmm0, 7 - pmaddubsw xmm1, xmm5 - - pmaddubsw xmm2, xmm6 - packuswb xmm0, xmm0 - - lea rsi, [rsi + rax] - paddsw xmm3, xmm1 - - paddsw xmm3, xmm2 - - paddsw xmm3, [GLOBAL(rd)] - - psraw xmm3, 7 - - packuswb xmm3, xmm3 - - punpcklqdq xmm0, xmm3 - - movdqa XMMWORD Ptr [rdi], xmm0 - - lea rdi, [rdi + rdx] - dec rcx - jnz .filter_block1d16_h6_rowloop_ssse3 - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -;void vp8_filter_block1d4_h6_ssse3 -;( -; unsigned char *src_ptr, -; unsigned int src_pixels_per_line, -; unsigned char *output_ptr, -; unsigned int output_pitch, -; unsigned int output_height, -; unsigned int vp8_filter_index -;) -global sym(vp8_filter_block1d4_h6_ssse3) PRIVATE -sym(vp8_filter_block1d4_h6_ssse3): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - movsxd rdx, DWORD PTR arg(5) ;table index - xor rsi, rsi - shl rdx, 4 ; - - lea rax, [GLOBAL(k0_k5)] - add rax, rdx - movdqa xmm7, [GLOBAL(rd)] - - cmp esi, DWORD PTR [rax] - je .vp8_filter_block1d4_h4_ssse3 - - movdqa xmm4, XMMWORD PTR [rax] ;k0_k5 - movdqa xmm5, XMMWORD PTR [rax+256] ;k2_k4 - movdqa xmm6, XMMWORD PTR [rax+128] ;k1_k3 - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;output_ptr - movsxd rax, dword ptr arg(1) ;src_pixels_per_line - movsxd rcx, dword ptr arg(4) ;output_height - - movsxd rdx, dword ptr arg(3) ;output_pitch - -;xmm3 free -.filter_block1d4_h6_rowloop_ssse3: - movdqu xmm0, XMMWORD PTR [rsi - 2] - - movdqa xmm1, xmm0 - pshufb xmm0, [GLOBAL(shuf1b)] - - movdqa xmm2, xmm1 - pshufb xmm1, [GLOBAL(shuf2b)] - pmaddubsw xmm0, xmm4 - pshufb xmm2, [GLOBAL(shuf3b)] - pmaddubsw xmm1, xmm5 - -;-- - pmaddubsw xmm2, xmm6 - - lea rsi, [rsi + rax] -;-- - paddsw xmm0, xmm1 - paddsw xmm0, xmm7 - pxor xmm1, xmm1 - paddsw xmm0, xmm2 - psraw xmm0, 7 - packuswb xmm0, xmm0 - - movd DWORD PTR [rdi], xmm0 - - add rdi, rdx - dec rcx - jnz .filter_block1d4_h6_rowloop_ssse3 - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -.vp8_filter_block1d4_h4_ssse3: - movdqa xmm5, XMMWORD PTR [rax+256] ;k2_k4 - movdqa xmm6, XMMWORD PTR [rax+128] ;k1_k3 - movdqa xmm0, XMMWORD PTR [GLOBAL(shuf2b)] - movdqa xmm3, XMMWORD PTR [GLOBAL(shuf3b)] - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;output_ptr - movsxd rax, dword ptr arg(1) ;src_pixels_per_line - movsxd rcx, dword ptr arg(4) ;output_height - - movsxd rdx, dword ptr arg(3) ;output_pitch - -.filter_block1d4_h4_rowloop_ssse3: - movdqu xmm1, XMMWORD PTR [rsi - 2] - - movdqa xmm2, xmm1 - pshufb xmm1, xmm0 ;;[GLOBAL(shuf2b)] - pshufb xmm2, xmm3 ;;[GLOBAL(shuf3b)] - pmaddubsw xmm1, xmm5 - -;-- - pmaddubsw xmm2, xmm6 - - lea rsi, [rsi + rax] -;-- - paddsw xmm1, xmm7 - paddsw xmm1, xmm2 - psraw xmm1, 7 - packuswb xmm1, xmm1 - - movd DWORD PTR [rdi], xmm1 - - add rdi, rdx - dec rcx - jnz .filter_block1d4_h4_rowloop_ssse3 - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - - -;void vp8_filter_block1d16_v6_ssse3 -;( -; unsigned char *src_ptr, -; unsigned int src_pitch, -; unsigned char *output_ptr, -; unsigned int out_pitch, -; unsigned int output_height, -; unsigned int vp8_filter_index -;) -global sym(vp8_filter_block1d16_v6_ssse3) PRIVATE -sym(vp8_filter_block1d16_v6_ssse3): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - movsxd rdx, DWORD PTR arg(5) ;table index - xor rsi, rsi - shl rdx, 4 ; - - lea rax, [GLOBAL(k0_k5)] - add rax, rdx - - cmp esi, DWORD PTR [rax] - je .vp8_filter_block1d16_v4_ssse3 - - movdqa xmm5, XMMWORD PTR [rax] ;k0_k5 - movdqa xmm6, XMMWORD PTR [rax+256] ;k2_k4 - movdqa xmm7, XMMWORD PTR [rax+128] ;k1_k3 - - mov rsi, arg(0) ;src_ptr - movsxd rdx, DWORD PTR arg(1) ;pixels_per_line - mov rdi, arg(2) ;output_ptr - -%if ABI_IS_32BIT=0 - movsxd r8, DWORD PTR arg(3) ;out_pitch -%endif - mov rax, rsi - movsxd rcx, DWORD PTR arg(4) ;output_height - add rax, rdx - - -.vp8_filter_block1d16_v6_ssse3_loop: - movq xmm1, MMWORD PTR [rsi] ;A - movq xmm2, MMWORD PTR [rsi + rdx] ;B - movq xmm3, MMWORD PTR [rsi + rdx * 2] ;C - movq xmm4, MMWORD PTR [rax + rdx * 2] ;D - movq xmm0, MMWORD PTR [rsi + rdx * 4] ;E - - punpcklbw xmm2, xmm4 ;B D - punpcklbw xmm3, xmm0 ;C E - - movq xmm0, MMWORD PTR [rax + rdx * 4] ;F - - pmaddubsw xmm3, xmm6 - punpcklbw xmm1, xmm0 ;A F - pmaddubsw xmm2, xmm7 - pmaddubsw xmm1, xmm5 - - paddsw xmm2, xmm3 - paddsw xmm2, xmm1 - paddsw xmm2, [GLOBAL(rd)] - psraw xmm2, 7 - packuswb xmm2, xmm2 - - movq MMWORD PTR [rdi], xmm2 ;store the results - - movq xmm1, MMWORD PTR [rsi + 8] ;A - movq xmm2, MMWORD PTR [rsi + rdx + 8] ;B - movq xmm3, MMWORD PTR [rsi + rdx * 2 + 8] ;C - movq xmm4, MMWORD PTR [rax + rdx * 2 + 8] ;D - movq xmm0, MMWORD PTR [rsi + rdx * 4 + 8] ;E - - punpcklbw xmm2, xmm4 ;B D - punpcklbw xmm3, xmm0 ;C E - - movq xmm0, MMWORD PTR [rax + rdx * 4 + 8] ;F - pmaddubsw xmm3, xmm6 - punpcklbw xmm1, xmm0 ;A F - pmaddubsw xmm2, xmm7 - pmaddubsw xmm1, xmm5 - - add rsi, rdx - add rax, rdx -;-- -;-- - paddsw xmm2, xmm3 - paddsw xmm2, xmm1 - paddsw xmm2, [GLOBAL(rd)] - psraw xmm2, 7 - packuswb xmm2, xmm2 - - movq MMWORD PTR [rdi+8], xmm2 - -%if ABI_IS_32BIT - add rdi, DWORD PTR arg(3) ;out_pitch -%else - add rdi, r8 -%endif - dec rcx - jnz .vp8_filter_block1d16_v6_ssse3_loop - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -.vp8_filter_block1d16_v4_ssse3: - movdqa xmm6, XMMWORD PTR [rax+256] ;k2_k4 - movdqa xmm7, XMMWORD PTR [rax+128] ;k1_k3 - - mov rsi, arg(0) ;src_ptr - movsxd rdx, DWORD PTR arg(1) ;pixels_per_line - mov rdi, arg(2) ;output_ptr - -%if ABI_IS_32BIT=0 - movsxd r8, DWORD PTR arg(3) ;out_pitch -%endif - mov rax, rsi - movsxd rcx, DWORD PTR arg(4) ;output_height - add rax, rdx - -.vp8_filter_block1d16_v4_ssse3_loop: - movq xmm2, MMWORD PTR [rsi + rdx] ;B - movq xmm3, MMWORD PTR [rsi + rdx * 2] ;C - movq xmm4, MMWORD PTR [rax + rdx * 2] ;D - movq xmm0, MMWORD PTR [rsi + rdx * 4] ;E - - punpcklbw xmm2, xmm4 ;B D - punpcklbw xmm3, xmm0 ;C E - - pmaddubsw xmm3, xmm6 - pmaddubsw xmm2, xmm7 - movq xmm5, MMWORD PTR [rsi + rdx + 8] ;B - movq xmm1, MMWORD PTR [rsi + rdx * 2 + 8] ;C - movq xmm4, MMWORD PTR [rax + rdx * 2 + 8] ;D - movq xmm0, MMWORD PTR [rsi + rdx * 4 + 8] ;E - - paddsw xmm2, [GLOBAL(rd)] - paddsw xmm2, xmm3 - psraw xmm2, 7 - packuswb xmm2, xmm2 - - punpcklbw xmm5, xmm4 ;B D - punpcklbw xmm1, xmm0 ;C E - - pmaddubsw xmm1, xmm6 - pmaddubsw xmm5, xmm7 - - movdqa xmm4, [GLOBAL(rd)] - add rsi, rdx - add rax, rdx -;-- -;-- - paddsw xmm5, xmm1 - paddsw xmm5, xmm4 - psraw xmm5, 7 - packuswb xmm5, xmm5 - - punpcklqdq xmm2, xmm5 - - movdqa XMMWORD PTR [rdi], xmm2 - -%if ABI_IS_32BIT - add rdi, DWORD PTR arg(3) ;out_pitch -%else - add rdi, r8 -%endif - dec rcx - jnz .vp8_filter_block1d16_v4_ssse3_loop - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -;void vp8_filter_block1d8_v6_ssse3 -;( -; unsigned char *src_ptr, -; unsigned int src_pitch, -; unsigned char *output_ptr, -; unsigned int out_pitch, -; unsigned int output_height, -; unsigned int vp8_filter_index -;) -global sym(vp8_filter_block1d8_v6_ssse3) PRIVATE -sym(vp8_filter_block1d8_v6_ssse3): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - movsxd rdx, DWORD PTR arg(5) ;table index - xor rsi, rsi - shl rdx, 4 ; - - lea rax, [GLOBAL(k0_k5)] - add rax, rdx - - movsxd rdx, DWORD PTR arg(1) ;pixels_per_line - mov rdi, arg(2) ;output_ptr -%if ABI_IS_32BIT=0 - movsxd r8, DWORD PTR arg(3) ; out_pitch -%endif - movsxd rcx, DWORD PTR arg(4) ;[output_height] - - cmp esi, DWORD PTR [rax] - je .vp8_filter_block1d8_v4_ssse3 - - movdqa xmm5, XMMWORD PTR [rax] ;k0_k5 - movdqa xmm6, XMMWORD PTR [rax+256] ;k2_k4 - movdqa xmm7, XMMWORD PTR [rax+128] ;k1_k3 - - mov rsi, arg(0) ;src_ptr - - mov rax, rsi - add rax, rdx - -.vp8_filter_block1d8_v6_ssse3_loop: - movq xmm1, MMWORD PTR [rsi] ;A - movq xmm2, MMWORD PTR [rsi + rdx] ;B - movq xmm3, MMWORD PTR [rsi + rdx * 2] ;C - movq xmm4, MMWORD PTR [rax + rdx * 2] ;D - movq xmm0, MMWORD PTR [rsi + rdx * 4] ;E - - punpcklbw xmm2, xmm4 ;B D - punpcklbw xmm3, xmm0 ;C E - - movq xmm0, MMWORD PTR [rax + rdx * 4] ;F - movdqa xmm4, [GLOBAL(rd)] - - pmaddubsw xmm3, xmm6 - punpcklbw xmm1, xmm0 ;A F - pmaddubsw xmm2, xmm7 - pmaddubsw xmm1, xmm5 - add rsi, rdx - add rax, rdx -;-- -;-- - paddsw xmm2, xmm3 - paddsw xmm2, xmm1 - paddsw xmm2, xmm4 - psraw xmm2, 7 - packuswb xmm2, xmm2 - - movq MMWORD PTR [rdi], xmm2 - -%if ABI_IS_32BIT - add rdi, DWORD PTR arg(3) ;[out_pitch] -%else - add rdi, r8 -%endif - dec rcx - jnz .vp8_filter_block1d8_v6_ssse3_loop - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -.vp8_filter_block1d8_v4_ssse3: - movdqa xmm6, XMMWORD PTR [rax+256] ;k2_k4 - movdqa xmm7, XMMWORD PTR [rax+128] ;k1_k3 - movdqa xmm5, [GLOBAL(rd)] - - mov rsi, arg(0) ;src_ptr - - mov rax, rsi - add rax, rdx - -.vp8_filter_block1d8_v4_ssse3_loop: - movq xmm2, MMWORD PTR [rsi + rdx] ;B - movq xmm3, MMWORD PTR [rsi + rdx * 2] ;C - movq xmm4, MMWORD PTR [rax + rdx * 2] ;D - movq xmm0, MMWORD PTR [rsi + rdx * 4] ;E - - punpcklbw xmm2, xmm4 ;B D - punpcklbw xmm3, xmm0 ;C E - - pmaddubsw xmm3, xmm6 - pmaddubsw xmm2, xmm7 - add rsi, rdx - add rax, rdx -;-- -;-- - paddsw xmm2, xmm3 - paddsw xmm2, xmm5 - psraw xmm2, 7 - packuswb xmm2, xmm2 - - movq MMWORD PTR [rdi], xmm2 - -%if ABI_IS_32BIT - add rdi, DWORD PTR arg(3) ;[out_pitch] -%else - add rdi, r8 -%endif - dec rcx - jnz .vp8_filter_block1d8_v4_ssse3_loop - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret -;void vp8_filter_block1d4_v6_ssse3 -;( -; unsigned char *src_ptr, -; unsigned int src_pitch, -; unsigned char *output_ptr, -; unsigned int out_pitch, -; unsigned int output_height, -; unsigned int vp8_filter_index -;) -global sym(vp8_filter_block1d4_v6_ssse3) PRIVATE -sym(vp8_filter_block1d4_v6_ssse3): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - movsxd rdx, DWORD PTR arg(5) ;table index - xor rsi, rsi - shl rdx, 4 ; - - lea rax, [GLOBAL(k0_k5)] - add rax, rdx - - movsxd rdx, DWORD PTR arg(1) ;pixels_per_line - mov rdi, arg(2) ;output_ptr -%if ABI_IS_32BIT=0 - movsxd r8, DWORD PTR arg(3) ; out_pitch -%endif - movsxd rcx, DWORD PTR arg(4) ;[output_height] - - cmp esi, DWORD PTR [rax] - je .vp8_filter_block1d4_v4_ssse3 - - movq mm5, MMWORD PTR [rax] ;k0_k5 - movq mm6, MMWORD PTR [rax+256] ;k2_k4 - movq mm7, MMWORD PTR [rax+128] ;k1_k3 - - mov rsi, arg(0) ;src_ptr - - mov rax, rsi - add rax, rdx - -.vp8_filter_block1d4_v6_ssse3_loop: - movd mm1, DWORD PTR [rsi] ;A - movd mm2, DWORD PTR [rsi + rdx] ;B - movd mm3, DWORD PTR [rsi + rdx * 2] ;C - movd mm4, DWORD PTR [rax + rdx * 2] ;D - movd mm0, DWORD PTR [rsi + rdx * 4] ;E - - punpcklbw mm2, mm4 ;B D - punpcklbw mm3, mm0 ;C E - - movd mm0, DWORD PTR [rax + rdx * 4] ;F - - movq mm4, [GLOBAL(rd)] - - pmaddubsw mm3, mm6 - punpcklbw mm1, mm0 ;A F - pmaddubsw mm2, mm7 - pmaddubsw mm1, mm5 - add rsi, rdx - add rax, rdx -;-- -;-- - paddsw mm2, mm3 - paddsw mm2, mm1 - paddsw mm2, mm4 - psraw mm2, 7 - packuswb mm2, mm2 - - movd DWORD PTR [rdi], mm2 - -%if ABI_IS_32BIT - add rdi, DWORD PTR arg(3) ;[out_pitch] -%else - add rdi, r8 -%endif - dec rcx - jnz .vp8_filter_block1d4_v6_ssse3_loop - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - -.vp8_filter_block1d4_v4_ssse3: - movq mm6, MMWORD PTR [rax+256] ;k2_k4 - movq mm7, MMWORD PTR [rax+128] ;k1_k3 - movq mm5, MMWORD PTR [GLOBAL(rd)] - - mov rsi, arg(0) ;src_ptr - - mov rax, rsi - add rax, rdx - -.vp8_filter_block1d4_v4_ssse3_loop: - movd mm2, DWORD PTR [rsi + rdx] ;B - movd mm3, DWORD PTR [rsi + rdx * 2] ;C - movd mm4, DWORD PTR [rax + rdx * 2] ;D - movd mm0, DWORD PTR [rsi + rdx * 4] ;E - - punpcklbw mm2, mm4 ;B D - punpcklbw mm3, mm0 ;C E - - pmaddubsw mm3, mm6 - pmaddubsw mm2, mm7 - add rsi, rdx - add rax, rdx -;-- -;-- - paddsw mm2, mm3 - paddsw mm2, mm5 - psraw mm2, 7 - packuswb mm2, mm2 - - movd DWORD PTR [rdi], mm2 - -%if ABI_IS_32BIT - add rdi, DWORD PTR arg(3) ;[out_pitch] -%else - add rdi, r8 -%endif - dec rcx - jnz .vp8_filter_block1d4_v4_ssse3_loop - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - -;void vp8_bilinear_predict16x16_ssse3 -;( -; unsigned char *src_ptr, -; int src_pixels_per_line, -; int xoffset, -; int yoffset, -; unsigned char *dst_ptr, -; int dst_pitch -;) -global sym(vp8_bilinear_predict16x16_ssse3) PRIVATE -sym(vp8_bilinear_predict16x16_ssse3): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - lea rcx, [GLOBAL(vp8_bilinear_filters_ssse3)] - movsxd rax, dword ptr arg(2) ; xoffset - - cmp rax, 0 ; skip first_pass filter if xoffset=0 - je .b16x16_sp_only - - shl rax, 4 - lea rax, [rax + rcx] ; HFilter - - mov rdi, arg(4) ; dst_ptr - mov rsi, arg(0) ; src_ptr - movsxd rdx, dword ptr arg(5) ; dst_pitch - - movdqa xmm1, [rax] - - movsxd rax, dword ptr arg(3) ; yoffset - - cmp rax, 0 ; skip second_pass filter if yoffset=0 - je .b16x16_fp_only - - shl rax, 4 - lea rax, [rax + rcx] ; VFilter - - lea rcx, [rdi+rdx*8] - lea rcx, [rcx+rdx*8] - movsxd rdx, dword ptr arg(1) ; src_pixels_per_line - - movdqa xmm2, [rax] - -%if ABI_IS_32BIT=0 - movsxd r8, dword ptr arg(5) ; dst_pitch -%endif - movq xmm3, [rsi] ; 00 01 02 03 04 05 06 07 - movq xmm5, [rsi+1] ; 01 02 03 04 05 06 07 08 - - punpcklbw xmm3, xmm5 ; 00 01 01 02 02 03 03 04 04 05 05 06 06 07 07 08 - movq xmm4, [rsi+8] ; 08 09 10 11 12 13 14 15 - - movq xmm5, [rsi+9] ; 09 10 11 12 13 14 15 16 - - lea rsi, [rsi + rdx] ; next line - - pmaddubsw xmm3, xmm1 ; 00 02 04 06 08 10 12 14 - - punpcklbw xmm4, xmm5 ; 08 09 09 10 10 11 11 12 12 13 13 14 14 15 15 16 - pmaddubsw xmm4, xmm1 ; 01 03 05 07 09 11 13 15 - - paddw xmm3, [GLOBAL(rd)] ; xmm3 += round value - psraw xmm3, VP8_FILTER_SHIFT ; xmm3 /= 128 - - paddw xmm4, [GLOBAL(rd)] ; xmm4 += round value - psraw xmm4, VP8_FILTER_SHIFT ; xmm4 /= 128 - - movdqa xmm7, xmm3 - packuswb xmm7, xmm4 ; 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 - -.next_row: - movq xmm6, [rsi] ; 00 01 02 03 04 05 06 07 - movq xmm5, [rsi+1] ; 01 02 03 04 05 06 07 08 - - punpcklbw xmm6, xmm5 - movq xmm4, [rsi+8] ; 08 09 10 11 12 13 14 15 - - movq xmm5, [rsi+9] ; 09 10 11 12 13 14 15 16 - lea rsi, [rsi + rdx] ; next line - - pmaddubsw xmm6, xmm1 - - punpcklbw xmm4, xmm5 - pmaddubsw xmm4, xmm1 - - paddw xmm6, [GLOBAL(rd)] ; xmm6 += round value - psraw xmm6, VP8_FILTER_SHIFT ; xmm6 /= 128 - - paddw xmm4, [GLOBAL(rd)] ; xmm4 += round value - psraw xmm4, VP8_FILTER_SHIFT ; xmm4 /= 128 - - packuswb xmm6, xmm4 - movdqa xmm5, xmm7 - - punpcklbw xmm5, xmm6 - pmaddubsw xmm5, xmm2 - - punpckhbw xmm7, xmm6 - pmaddubsw xmm7, xmm2 - - paddw xmm5, [GLOBAL(rd)] ; xmm5 += round value - psraw xmm5, VP8_FILTER_SHIFT ; xmm5 /= 128 - - paddw xmm7, [GLOBAL(rd)] ; xmm7 += round value - psraw xmm7, VP8_FILTER_SHIFT ; xmm7 /= 128 - - packuswb xmm5, xmm7 - movdqa xmm7, xmm6 - - movdqa [rdi], xmm5 ; store the results in the destination -%if ABI_IS_32BIT - add rdi, DWORD PTR arg(5) ; dst_pitch -%else - add rdi, r8 -%endif - - cmp rdi, rcx - jne .next_row - - jmp .done - -.b16x16_sp_only: - movsxd rax, dword ptr arg(3) ; yoffset - shl rax, 4 - lea rax, [rax + rcx] ; VFilter - - mov rdi, arg(4) ; dst_ptr - mov rsi, arg(0) ; src_ptr - movsxd rdx, dword ptr arg(5) ; dst_pitch - - movdqa xmm1, [rax] ; VFilter - - lea rcx, [rdi+rdx*8] - lea rcx, [rcx+rdx*8] - movsxd rax, dword ptr arg(1) ; src_pixels_per_line - - ; get the first horizontal line done - movq xmm4, [rsi] ; load row 0 - movq xmm2, [rsi + 8] ; load row 0 - - lea rsi, [rsi + rax] ; next line -.next_row_sp: - movq xmm3, [rsi] ; load row + 1 - movq xmm5, [rsi + 8] ; load row + 1 - - punpcklbw xmm4, xmm3 - punpcklbw xmm2, xmm5 - - pmaddubsw xmm4, xmm1 - movq xmm7, [rsi + rax] ; load row + 2 - - pmaddubsw xmm2, xmm1 - movq xmm6, [rsi + rax + 8] ; load row + 2 - - punpcklbw xmm3, xmm7 - punpcklbw xmm5, xmm6 - - pmaddubsw xmm3, xmm1 - paddw xmm4, [GLOBAL(rd)] - - pmaddubsw xmm5, xmm1 - paddw xmm2, [GLOBAL(rd)] - - psraw xmm4, VP8_FILTER_SHIFT - psraw xmm2, VP8_FILTER_SHIFT - - packuswb xmm4, xmm2 - paddw xmm3, [GLOBAL(rd)] - - movdqa [rdi], xmm4 ; store row 0 - paddw xmm5, [GLOBAL(rd)] - - psraw xmm3, VP8_FILTER_SHIFT - psraw xmm5, VP8_FILTER_SHIFT - - packuswb xmm3, xmm5 - movdqa xmm4, xmm7 - - movdqa [rdi + rdx],xmm3 ; store row 1 - lea rsi, [rsi + 2*rax] - - movdqa xmm2, xmm6 - lea rdi, [rdi + 2*rdx] - - cmp rdi, rcx - jne .next_row_sp - - jmp .done - -.b16x16_fp_only: - lea rcx, [rdi+rdx*8] - lea rcx, [rcx+rdx*8] - movsxd rax, dword ptr arg(1) ; src_pixels_per_line - -.next_row_fp: - movq xmm2, [rsi] ; 00 01 02 03 04 05 06 07 - movq xmm4, [rsi+1] ; 01 02 03 04 05 06 07 08 - - punpcklbw xmm2, xmm4 - movq xmm3, [rsi+8] ; 08 09 10 11 12 13 14 15 - - pmaddubsw xmm2, xmm1 - movq xmm4, [rsi+9] ; 09 10 11 12 13 14 15 16 - - lea rsi, [rsi + rax] ; next line - punpcklbw xmm3, xmm4 - - pmaddubsw xmm3, xmm1 - movq xmm5, [rsi] - - paddw xmm2, [GLOBAL(rd)] - movq xmm7, [rsi+1] - - movq xmm6, [rsi+8] - psraw xmm2, VP8_FILTER_SHIFT - - punpcklbw xmm5, xmm7 - movq xmm7, [rsi+9] - - paddw xmm3, [GLOBAL(rd)] - pmaddubsw xmm5, xmm1 - - psraw xmm3, VP8_FILTER_SHIFT - punpcklbw xmm6, xmm7 - - packuswb xmm2, xmm3 - pmaddubsw xmm6, xmm1 - - movdqa [rdi], xmm2 ; store the results in the destination - paddw xmm5, [GLOBAL(rd)] - - lea rdi, [rdi + rdx] ; dst_pitch - psraw xmm5, VP8_FILTER_SHIFT - - paddw xmm6, [GLOBAL(rd)] - psraw xmm6, VP8_FILTER_SHIFT - - packuswb xmm5, xmm6 - lea rsi, [rsi + rax] ; next line - - movdqa [rdi], xmm5 ; store the results in the destination - lea rdi, [rdi + rdx] ; dst_pitch - - cmp rdi, rcx - - jne .next_row_fp - -.done: - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -;void vp8_bilinear_predict8x8_ssse3 -;( -; unsigned char *src_ptr, -; int src_pixels_per_line, -; int xoffset, -; int yoffset, -; unsigned char *dst_ptr, -; int dst_pitch -;) -global sym(vp8_bilinear_predict8x8_ssse3) PRIVATE -sym(vp8_bilinear_predict8x8_ssse3): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, 144 ; reserve 144 bytes - - lea rcx, [GLOBAL(vp8_bilinear_filters_ssse3)] - - mov rsi, arg(0) ;src_ptr - movsxd rdx, dword ptr arg(1) ;src_pixels_per_line - - ;Read 9-line unaligned data in and put them on stack. This gives a big - ;performance boost. - movdqu xmm0, [rsi] - lea rax, [rdx + rdx*2] - movdqu xmm1, [rsi+rdx] - movdqu xmm2, [rsi+rdx*2] - add rsi, rax - movdqu xmm3, [rsi] - movdqu xmm4, [rsi+rdx] - movdqu xmm5, [rsi+rdx*2] - add rsi, rax - movdqu xmm6, [rsi] - movdqu xmm7, [rsi+rdx] - - movdqa XMMWORD PTR [rsp], xmm0 - - movdqu xmm0, [rsi+rdx*2] - - movdqa XMMWORD PTR [rsp+16], xmm1 - movdqa XMMWORD PTR [rsp+32], xmm2 - movdqa XMMWORD PTR [rsp+48], xmm3 - movdqa XMMWORD PTR [rsp+64], xmm4 - movdqa XMMWORD PTR [rsp+80], xmm5 - movdqa XMMWORD PTR [rsp+96], xmm6 - movdqa XMMWORD PTR [rsp+112], xmm7 - movdqa XMMWORD PTR [rsp+128], xmm0 - - movsxd rax, dword ptr arg(2) ; xoffset - cmp rax, 0 ; skip first_pass filter if xoffset=0 - je .b8x8_sp_only - - shl rax, 4 - add rax, rcx ; HFilter - - mov rdi, arg(4) ; dst_ptr - movsxd rdx, dword ptr arg(5) ; dst_pitch - - movdqa xmm0, [rax] - - movsxd rax, dword ptr arg(3) ; yoffset - cmp rax, 0 ; skip second_pass filter if yoffset=0 - je .b8x8_fp_only - - shl rax, 4 - lea rax, [rax + rcx] ; VFilter - - lea rcx, [rdi+rdx*8] - - movdqa xmm1, [rax] - - ; get the first horizontal line done - movdqa xmm3, [rsp] ; 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 - movdqa xmm5, xmm3 ; 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 xx - - psrldq xmm5, 1 - lea rsp, [rsp + 16] ; next line - - punpcklbw xmm3, xmm5 ; 00 01 01 02 02 03 03 04 04 05 05 06 06 07 07 08 - pmaddubsw xmm3, xmm0 ; 00 02 04 06 08 10 12 14 - - paddw xmm3, [GLOBAL(rd)] ; xmm3 += round value - psraw xmm3, VP8_FILTER_SHIFT ; xmm3 /= 128 - - movdqa xmm7, xmm3 - packuswb xmm7, xmm7 ; 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 - -.next_row: - movdqa xmm6, [rsp] ; 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 - lea rsp, [rsp + 16] ; next line - - movdqa xmm5, xmm6 - - psrldq xmm5, 1 - - punpcklbw xmm6, xmm5 - pmaddubsw xmm6, xmm0 - - paddw xmm6, [GLOBAL(rd)] ; xmm6 += round value - psraw xmm6, VP8_FILTER_SHIFT ; xmm6 /= 128 - - packuswb xmm6, xmm6 - - punpcklbw xmm7, xmm6 - pmaddubsw xmm7, xmm1 - - paddw xmm7, [GLOBAL(rd)] ; xmm7 += round value - psraw xmm7, VP8_FILTER_SHIFT ; xmm7 /= 128 - - packuswb xmm7, xmm7 - - movq [rdi], xmm7 ; store the results in the destination - lea rdi, [rdi + rdx] - - movdqa xmm7, xmm6 - - cmp rdi, rcx - jne .next_row - - jmp .done8x8 - -.b8x8_sp_only: - movsxd rax, dword ptr arg(3) ; yoffset - shl rax, 4 - lea rax, [rax + rcx] ; VFilter - - mov rdi, arg(4) ;dst_ptr - movsxd rdx, dword ptr arg(5) ; dst_pitch - - movdqa xmm0, [rax] ; VFilter - - movq xmm1, XMMWORD PTR [rsp] - movq xmm2, XMMWORD PTR [rsp+16] - - movq xmm3, XMMWORD PTR [rsp+32] - punpcklbw xmm1, xmm2 - - movq xmm4, XMMWORD PTR [rsp+48] - punpcklbw xmm2, xmm3 - - movq xmm5, XMMWORD PTR [rsp+64] - punpcklbw xmm3, xmm4 - - movq xmm6, XMMWORD PTR [rsp+80] - punpcklbw xmm4, xmm5 - - movq xmm7, XMMWORD PTR [rsp+96] - punpcklbw xmm5, xmm6 - - pmaddubsw xmm1, xmm0 - pmaddubsw xmm2, xmm0 - - pmaddubsw xmm3, xmm0 - pmaddubsw xmm4, xmm0 - - pmaddubsw xmm5, xmm0 - punpcklbw xmm6, xmm7 - - pmaddubsw xmm6, xmm0 - paddw xmm1, [GLOBAL(rd)] - - paddw xmm2, [GLOBAL(rd)] - psraw xmm1, VP8_FILTER_SHIFT - - paddw xmm3, [GLOBAL(rd)] - psraw xmm2, VP8_FILTER_SHIFT - - paddw xmm4, [GLOBAL(rd)] - psraw xmm3, VP8_FILTER_SHIFT - - paddw xmm5, [GLOBAL(rd)] - psraw xmm4, VP8_FILTER_SHIFT - - paddw xmm6, [GLOBAL(rd)] - psraw xmm5, VP8_FILTER_SHIFT - - psraw xmm6, VP8_FILTER_SHIFT - packuswb xmm1, xmm1 - - packuswb xmm2, xmm2 - movq [rdi], xmm1 - - packuswb xmm3, xmm3 - movq [rdi+rdx], xmm2 - - packuswb xmm4, xmm4 - movq xmm1, XMMWORD PTR [rsp+112] - - lea rdi, [rdi + 2*rdx] - movq xmm2, XMMWORD PTR [rsp+128] - - packuswb xmm5, xmm5 - movq [rdi], xmm3 - - packuswb xmm6, xmm6 - movq [rdi+rdx], xmm4 - - lea rdi, [rdi + 2*rdx] - punpcklbw xmm7, xmm1 - - movq [rdi], xmm5 - pmaddubsw xmm7, xmm0 - - movq [rdi+rdx], xmm6 - punpcklbw xmm1, xmm2 - - pmaddubsw xmm1, xmm0 - paddw xmm7, [GLOBAL(rd)] - - psraw xmm7, VP8_FILTER_SHIFT - paddw xmm1, [GLOBAL(rd)] - - psraw xmm1, VP8_FILTER_SHIFT - packuswb xmm7, xmm7 - - packuswb xmm1, xmm1 - lea rdi, [rdi + 2*rdx] - - movq [rdi], xmm7 - - movq [rdi+rdx], xmm1 - lea rsp, [rsp + 144] - - jmp .done8x8 - -.b8x8_fp_only: - lea rcx, [rdi+rdx*8] - -.next_row_fp: - movdqa xmm1, XMMWORD PTR [rsp] - movdqa xmm3, XMMWORD PTR [rsp+16] - - movdqa xmm2, xmm1 - movdqa xmm5, XMMWORD PTR [rsp+32] - - psrldq xmm2, 1 - movdqa xmm7, XMMWORD PTR [rsp+48] - - movdqa xmm4, xmm3 - psrldq xmm4, 1 - - movdqa xmm6, xmm5 - psrldq xmm6, 1 - - punpcklbw xmm1, xmm2 - pmaddubsw xmm1, xmm0 - - punpcklbw xmm3, xmm4 - pmaddubsw xmm3, xmm0 - - punpcklbw xmm5, xmm6 - pmaddubsw xmm5, xmm0 - - movdqa xmm2, xmm7 - psrldq xmm2, 1 - - punpcklbw xmm7, xmm2 - pmaddubsw xmm7, xmm0 - - paddw xmm1, [GLOBAL(rd)] - psraw xmm1, VP8_FILTER_SHIFT - - paddw xmm3, [GLOBAL(rd)] - psraw xmm3, VP8_FILTER_SHIFT - - paddw xmm5, [GLOBAL(rd)] - psraw xmm5, VP8_FILTER_SHIFT - - paddw xmm7, [GLOBAL(rd)] - psraw xmm7, VP8_FILTER_SHIFT - - packuswb xmm1, xmm1 - packuswb xmm3, xmm3 - - packuswb xmm5, xmm5 - movq [rdi], xmm1 - - packuswb xmm7, xmm7 - movq [rdi+rdx], xmm3 - - lea rdi, [rdi + 2*rdx] - movq [rdi], xmm5 - - lea rsp, [rsp + 4*16] - movq [rdi+rdx], xmm7 - - lea rdi, [rdi + 2*rdx] - cmp rdi, rcx - - jne .next_row_fp - - lea rsp, [rsp + 16] - -.done8x8: - ;add rsp, 144 - pop rsp - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -SECTION_RODATA -align 16 -shuf1b: - db 0, 5, 1, 6, 2, 7, 3, 8, 4, 9, 5, 10, 6, 11, 7, 12 -shuf2b: - db 2, 4, 3, 5, 4, 6, 5, 7, 6, 8, 7, 9, 8, 10, 9, 11 -shuf3b: - db 1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8, 7, 9, 8, 10 - -align 16 -shuf2bfrom1: - db 4, 8, 6, 1, 8, 3, 1, 5, 3, 7, 5, 9, 7,11, 9,13 -align 16 -shuf3bfrom1: - db 2, 6, 4, 8, 6, 1, 8, 3, 1, 5, 3, 7, 5, 9, 7,11 - -align 16 -rd: - times 8 dw 0x40 - -align 16 -k0_k5: - times 8 db 0, 0 ;placeholder - times 8 db 0, 0 - times 8 db 2, 1 - times 8 db 0, 0 - times 8 db 3, 3 - times 8 db 0, 0 - times 8 db 1, 2 - times 8 db 0, 0 -k1_k3: - times 8 db 0, 0 ;placeholder - times 8 db -6, 12 - times 8 db -11, 36 - times 8 db -9, 50 - times 8 db -16, 77 - times 8 db -6, 93 - times 8 db -8, 108 - times 8 db -1, 123 -k2_k4: - times 8 db 128, 0 ;placeholder - times 8 db 123, -1 - times 8 db 108, -8 - times 8 db 93, -6 - times 8 db 77, -16 - times 8 db 50, -9 - times 8 db 36, -11 - times 8 db 12, -6 -align 16 -vp8_bilinear_filters_ssse3: - times 8 db 128, 0 - times 8 db 112, 16 - times 8 db 96, 32 - times 8 db 80, 48 - times 8 db 64, 64 - times 8 db 48, 80 - times 8 db 32, 96 - times 8 db 16, 112 - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/variance_impl_mmx.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/variance_impl_mmx.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/variance_impl_mmx.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/variance_impl_mmx.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,851 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -;unsigned int vp8_get_mb_ss_mmx( short *src_ptr ) -global sym(vp8_get_mb_ss_mmx) PRIVATE -sym(vp8_get_mb_ss_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - GET_GOT rbx - push rsi - push rdi - sub rsp, 8 - ; end prolog - - mov rax, arg(0) ;src_ptr - mov rcx, 16 - pxor mm4, mm4 - -.NEXTROW: - movq mm0, [rax] - movq mm1, [rax+8] - movq mm2, [rax+16] - movq mm3, [rax+24] - pmaddwd mm0, mm0 - pmaddwd mm1, mm1 - pmaddwd mm2, mm2 - pmaddwd mm3, mm3 - - paddd mm4, mm0 - paddd mm4, mm1 - paddd mm4, mm2 - paddd mm4, mm3 - - add rax, 32 - dec rcx - ja .NEXTROW - movq QWORD PTR [rsp], mm4 - - ;return sum[0]+sum[1]; - movsxd rax, dword ptr [rsp] - movsxd rcx, dword ptr [rsp+4] - add rax, rcx - - - ; begin epilog - add rsp, 8 - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - - -;unsigned int vp8_get8x8var_mmx -;( -; unsigned char *src_ptr, -; int source_stride, -; unsigned char *ref_ptr, -; int recon_stride, -; unsigned int *SSE, -; int *Sum -;) -global sym(vp8_get8x8var_mmx) PRIVATE -sym(vp8_get8x8var_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - push rsi - push rdi - push rbx - sub rsp, 16 - ; end prolog - - - pxor mm5, mm5 ; Blank mmx6 - pxor mm6, mm6 ; Blank mmx7 - pxor mm7, mm7 ; Blank mmx7 - - mov rax, arg(0) ;[src_ptr] ; Load base addresses - mov rbx, arg(2) ;[ref_ptr] - movsxd rcx, dword ptr arg(1) ;[source_stride] - movsxd rdx, dword ptr arg(3) ;[recon_stride] - - ; Row 1 - movq mm0, [rax] ; Copy eight bytes to mm0 - movq mm1, [rbx] ; Copy eight bytes to mm1 - movq mm2, mm0 ; Take copies - movq mm3, mm1 ; Take copies - - punpcklbw mm0, mm6 ; unpack to higher prrcision - punpcklbw mm1, mm6 - punpckhbw mm2, mm6 ; unpack to higher prrcision - punpckhbw mm3, mm6 - psubsw mm0, mm1 ; A-B (low order) to MM0 - psubsw mm2, mm3 ; A-B (high order) to MM2 - - paddw mm5, mm0 ; accumulate differences in mm5 - paddw mm5, mm2 ; accumulate differences in mm5 - - pmaddwd mm0, mm0 ; square and accumulate - pmaddwd mm2, mm2 ; square and accumulate - add rbx,rdx ; Inc pointer into ref data - add rax,rcx ; Inc pointer into the new data - movq mm1, [rbx] ; Copy eight bytes to mm1 - paddd mm7, mm0 ; accumulate in mm7 - paddd mm7, mm2 ; accumulate in mm7 - - - ; Row 2 - movq mm0, [rax] ; Copy eight bytes to mm0 - movq mm2, mm0 ; Take copies - movq mm3, mm1 ; Take copies - - punpcklbw mm0, mm6 ; unpack to higher prrcision - punpcklbw mm1, mm6 - punpckhbw mm2, mm6 ; unpack to higher prrcision - punpckhbw mm3, mm6 - psubsw mm0, mm1 ; A-B (low order) to MM0 - psubsw mm2, mm3 ; A-B (high order) to MM2 - - paddw mm5, mm0 ; accumulate differences in mm5 - paddw mm5, mm2 ; accumulate differences in mm5 - - pmaddwd mm0, mm0 ; square and accumulate - pmaddwd mm2, mm2 ; square and accumulate - add rbx,rdx ; Inc pointer into ref data - add rax,rcx ; Inc pointer into the new data - movq mm1, [rbx] ; Copy eight bytes to mm1 - paddd mm7, mm0 ; accumulate in mm7 - paddd mm7, mm2 ; accumulate in mm7 - - ; Row 3 - movq mm0, [rax] ; Copy eight bytes to mm0 - movq mm2, mm0 ; Take copies - movq mm3, mm1 ; Take copies - - punpcklbw mm0, mm6 ; unpack to higher prrcision - punpcklbw mm1, mm6 - punpckhbw mm2, mm6 ; unpack to higher prrcision - punpckhbw mm3, mm6 - psubsw mm0, mm1 ; A-B (low order) to MM0 - psubsw mm2, mm3 ; A-B (high order) to MM2 - - paddw mm5, mm0 ; accumulate differences in mm5 - paddw mm5, mm2 ; accumulate differences in mm5 - - pmaddwd mm0, mm0 ; square and accumulate - pmaddwd mm2, mm2 ; square and accumulate - add rbx,rdx ; Inc pointer into ref data - add rax,rcx ; Inc pointer into the new data - movq mm1, [rbx] ; Copy eight bytes to mm1 - paddd mm7, mm0 ; accumulate in mm7 - paddd mm7, mm2 ; accumulate in mm7 - - ; Row 4 - movq mm0, [rax] ; Copy eight bytes to mm0 - movq mm2, mm0 ; Take copies - movq mm3, mm1 ; Take copies - - punpcklbw mm0, mm6 ; unpack to higher prrcision - punpcklbw mm1, mm6 - punpckhbw mm2, mm6 ; unpack to higher prrcision - punpckhbw mm3, mm6 - psubsw mm0, mm1 ; A-B (low order) to MM0 - psubsw mm2, mm3 ; A-B (high order) to MM2 - - paddw mm5, mm0 ; accumulate differences in mm5 - paddw mm5, mm2 ; accumulate differences in mm5 - - pmaddwd mm0, mm0 ; square and accumulate - pmaddwd mm2, mm2 ; square and accumulate - add rbx,rdx ; Inc pointer into ref data - add rax,rcx ; Inc pointer into the new data - movq mm1, [rbx] ; Copy eight bytes to mm1 - paddd mm7, mm0 ; accumulate in mm7 - paddd mm7, mm2 ; accumulate in mm7 - - ; Row 5 - movq mm0, [rax] ; Copy eight bytes to mm0 - movq mm2, mm0 ; Take copies - movq mm3, mm1 ; Take copies - - punpcklbw mm0, mm6 ; unpack to higher prrcision - punpcklbw mm1, mm6 - punpckhbw mm2, mm6 ; unpack to higher prrcision - punpckhbw mm3, mm6 - psubsw mm0, mm1 ; A-B (low order) to MM0 - psubsw mm2, mm3 ; A-B (high order) to MM2 - - paddw mm5, mm0 ; accumulate differences in mm5 - paddw mm5, mm2 ; accumulate differences in mm5 - - pmaddwd mm0, mm0 ; square and accumulate - pmaddwd mm2, mm2 ; square and accumulate - add rbx,rdx ; Inc pointer into ref data - add rax,rcx ; Inc pointer into the new data - movq mm1, [rbx] ; Copy eight bytes to mm1 - ; movq mm4, [rbx + rdx] - paddd mm7, mm0 ; accumulate in mm7 - paddd mm7, mm2 ; accumulate in mm7 - - ; Row 6 - movq mm0, [rax] ; Copy eight bytes to mm0 - movq mm2, mm0 ; Take copies - movq mm3, mm1 ; Take copies - - punpcklbw mm0, mm6 ; unpack to higher prrcision - punpcklbw mm1, mm6 - punpckhbw mm2, mm6 ; unpack to higher prrcision - punpckhbw mm3, mm6 - psubsw mm0, mm1 ; A-B (low order) to MM0 - psubsw mm2, mm3 ; A-B (high order) to MM2 - - paddw mm5, mm0 ; accumulate differences in mm5 - paddw mm5, mm2 ; accumulate differences in mm5 - - pmaddwd mm0, mm0 ; square and accumulate - pmaddwd mm2, mm2 ; square and accumulate - add rbx,rdx ; Inc pointer into ref data - add rax,rcx ; Inc pointer into the new data - movq mm1, [rbx] ; Copy eight bytes to mm1 - paddd mm7, mm0 ; accumulate in mm7 - paddd mm7, mm2 ; accumulate in mm7 - - ; Row 7 - movq mm0, [rax] ; Copy eight bytes to mm0 - movq mm2, mm0 ; Take copies - movq mm3, mm1 ; Take copies - - punpcklbw mm0, mm6 ; unpack to higher prrcision - punpcklbw mm1, mm6 - punpckhbw mm2, mm6 ; unpack to higher prrcision - punpckhbw mm3, mm6 - psubsw mm0, mm1 ; A-B (low order) to MM0 - psubsw mm2, mm3 ; A-B (high order) to MM2 - - paddw mm5, mm0 ; accumulate differences in mm5 - paddw mm5, mm2 ; accumulate differences in mm5 - - pmaddwd mm0, mm0 ; square and accumulate - pmaddwd mm2, mm2 ; square and accumulate - add rbx,rdx ; Inc pointer into ref data - add rax,rcx ; Inc pointer into the new data - movq mm1, [rbx] ; Copy eight bytes to mm1 - paddd mm7, mm0 ; accumulate in mm7 - paddd mm7, mm2 ; accumulate in mm7 - - ; Row 8 - movq mm0, [rax] ; Copy eight bytes to mm0 - movq mm2, mm0 ; Take copies - movq mm3, mm1 ; Take copies - - punpcklbw mm0, mm6 ; unpack to higher prrcision - punpcklbw mm1, mm6 - punpckhbw mm2, mm6 ; unpack to higher prrcision - punpckhbw mm3, mm6 - psubsw mm0, mm1 ; A-B (low order) to MM0 - psubsw mm2, mm3 ; A-B (high order) to MM2 - - paddw mm5, mm0 ; accumulate differences in mm5 - paddw mm5, mm2 ; accumulate differences in mm5 - - pmaddwd mm0, mm0 ; square and accumulate - pmaddwd mm2, mm2 ; square and accumulate - add rbx,rdx ; Inc pointer into ref data - add rax,rcx ; Inc pointer into the new data - paddd mm7, mm0 ; accumulate in mm7 - paddd mm7, mm2 ; accumulate in mm7 - - ; Now accumulate the final results. - movq QWORD PTR [rsp+8], mm5 ; copy back accumulated results into normal memory - movq QWORD PTR [rsp], mm7 ; copy back accumulated results into normal memory - movsx rdx, WORD PTR [rsp+8] - movsx rcx, WORD PTR [rsp+10] - movsx rbx, WORD PTR [rsp+12] - movsx rax, WORD PTR [rsp+14] - add rdx, rcx - add rbx, rax - add rdx, rbx ;XSum - movsxd rax, DWORD PTR [rsp] - movsxd rcx, DWORD PTR [rsp+4] - add rax, rcx ;XXSum - mov rsi, arg(4) ;SSE - mov rdi, arg(5) ;Sum - mov dword ptr [rsi], eax - mov dword ptr [rdi], edx - xor rax, rax ; return 0 - - - ; begin epilog - add rsp, 16 - pop rbx - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret - - - -;unsigned int -;vp8_get4x4var_mmx -;( -; unsigned char *src_ptr, -; int source_stride, -; unsigned char *ref_ptr, -; int recon_stride, -; unsigned int *SSE, -; int *Sum -;) -global sym(vp8_get4x4var_mmx) PRIVATE -sym(vp8_get4x4var_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - push rsi - push rdi - push rbx - sub rsp, 16 - ; end prolog - - - pxor mm5, mm5 ; Blank mmx6 - pxor mm6, mm6 ; Blank mmx7 - pxor mm7, mm7 ; Blank mmx7 - - mov rax, arg(0) ;[src_ptr] ; Load base addresses - mov rbx, arg(2) ;[ref_ptr] - movsxd rcx, dword ptr arg(1) ;[source_stride] - movsxd rdx, dword ptr arg(3) ;[recon_stride] - - ; Row 1 - movd mm0, [rax] ; Copy four bytes to mm0 - movd mm1, [rbx] ; Copy four bytes to mm1 - punpcklbw mm0, mm6 ; unpack to higher prrcision - punpcklbw mm1, mm6 - psubsw mm0, mm1 ; A-B (low order) to MM0 - paddw mm5, mm0 ; accumulate differences in mm5 - pmaddwd mm0, mm0 ; square and accumulate - add rbx,rdx ; Inc pointer into ref data - add rax,rcx ; Inc pointer into the new data - movd mm1, [rbx] ; Copy four bytes to mm1 - paddd mm7, mm0 ; accumulate in mm7 - - - ; Row 2 - movd mm0, [rax] ; Copy four bytes to mm0 - punpcklbw mm0, mm6 ; unpack to higher prrcision - punpcklbw mm1, mm6 - psubsw mm0, mm1 ; A-B (low order) to MM0 - paddw mm5, mm0 ; accumulate differences in mm5 - - pmaddwd mm0, mm0 ; square and accumulate - add rbx,rdx ; Inc pointer into ref data - add rax,rcx ; Inc pointer into the new data - movd mm1, [rbx] ; Copy four bytes to mm1 - paddd mm7, mm0 ; accumulate in mm7 - - ; Row 3 - movd mm0, [rax] ; Copy four bytes to mm0 - punpcklbw mm0, mm6 ; unpack to higher precision - punpcklbw mm1, mm6 - psubsw mm0, mm1 ; A-B (low order) to MM0 - paddw mm5, mm0 ; accumulate differences in mm5 - - pmaddwd mm0, mm0 ; square and accumulate - add rbx,rdx ; Inc pointer into ref data - add rax,rcx ; Inc pointer into the new data - movd mm1, [rbx] ; Copy four bytes to mm1 - paddd mm7, mm0 ; accumulate in mm7 - - ; Row 4 - movd mm0, [rax] ; Copy four bytes to mm0 - - punpcklbw mm0, mm6 ; unpack to higher prrcision - punpcklbw mm1, mm6 - psubsw mm0, mm1 ; A-B (low order) to MM0 - - paddw mm5, mm0 ; accumulate differences in mm5 - - pmaddwd mm0, mm0 ; square and accumulate - paddd mm7, mm0 ; accumulate in mm7 - - - ; Now accumulate the final results. - movq QWORD PTR [rsp+8], mm5 ; copy back accumulated results into normal memory - movq QWORD PTR [rsp], mm7 ; copy back accumulated results into normal memory - movsx rdx, WORD PTR [rsp+8] - movsx rcx, WORD PTR [rsp+10] - movsx rbx, WORD PTR [rsp+12] - movsx rax, WORD PTR [rsp+14] - add rdx, rcx - add rbx, rax - add rdx, rbx ;XSum - movsxd rax, DWORD PTR [rsp] - movsxd rcx, DWORD PTR [rsp+4] - add rax, rcx ;XXSum - mov rsi, arg(4) ;SSE - mov rdi, arg(5) ;Sum - mov dword ptr [rsi], eax - mov dword ptr [rdi], edx - xor rax, rax ; return 0 - - - ; begin epilog - add rsp, 16 - pop rbx - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret - - - -;unsigned int -;vp8_get4x4sse_cs_mmx -;( -; unsigned char *src_ptr, -; int source_stride, -; unsigned char *ref_ptr, -; int recon_stride -;) -global sym(vp8_get4x4sse_cs_mmx) PRIVATE -sym(vp8_get4x4sse_cs_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 4 - push rsi - push rdi - push rbx - ; end prolog - - - pxor mm6, mm6 ; Blank mmx7 - pxor mm7, mm7 ; Blank mmx7 - - mov rax, arg(0) ;[src_ptr] ; Load base addresses - mov rbx, arg(2) ;[ref_ptr] - movsxd rcx, dword ptr arg(1) ;[source_stride] - movsxd rdx, dword ptr arg(3) ;[recon_stride] - ; Row 1 - movd mm0, [rax] ; Copy eight bytes to mm0 - movd mm1, [rbx] ; Copy eight bytes to mm1 - punpcklbw mm0, mm6 ; unpack to higher prrcision - punpcklbw mm1, mm6 - psubsw mm0, mm1 ; A-B (low order) to MM0 - pmaddwd mm0, mm0 ; square and accumulate - add rbx,rdx ; Inc pointer into ref data - add rax,rcx ; Inc pointer into the new data - movd mm1, [rbx] ; Copy eight bytes to mm1 - paddd mm7, mm0 ; accumulate in mm7 - - ; Row 2 - movd mm0, [rax] ; Copy eight bytes to mm0 - punpcklbw mm0, mm6 ; unpack to higher prrcision - punpcklbw mm1, mm6 - psubsw mm0, mm1 ; A-B (low order) to MM0 - pmaddwd mm0, mm0 ; square and accumulate - add rbx,rdx ; Inc pointer into ref data - add rax,rcx ; Inc pointer into the new data - movd mm1, [rbx] ; Copy eight bytes to mm1 - paddd mm7, mm0 ; accumulate in mm7 - - ; Row 3 - movd mm0, [rax] ; Copy eight bytes to mm0 - punpcklbw mm1, mm6 - punpcklbw mm0, mm6 ; unpack to higher prrcision - psubsw mm0, mm1 ; A-B (low order) to MM0 - - pmaddwd mm0, mm0 ; square and accumulate - add rbx,rdx ; Inc pointer into ref data - add rax,rcx ; Inc pointer into the new data - movd mm1, [rbx] ; Copy eight bytes to mm1 - paddd mm7, mm0 ; accumulate in mm7 - - ; Row 4 - movd mm0, [rax] ; Copy eight bytes to mm0 - punpcklbw mm0, mm6 ; unpack to higher prrcision - punpcklbw mm1, mm6 - psubsw mm0, mm1 ; A-B (low order) to MM0 - pmaddwd mm0, mm0 ; square and accumulate - paddd mm7, mm0 ; accumulate in mm7 - - movq mm0, mm7 ; - psrlq mm7, 32 - - paddd mm0, mm7 - movq rax, mm0 - - - ; begin epilog - pop rbx - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret - -%define mmx_filter_shift 7 - -;void vp8_filter_block2d_bil4x4_var_mmx -;( -; unsigned char *ref_ptr, -; int ref_pixels_per_line, -; unsigned char *src_ptr, -; int src_pixels_per_line, -; unsigned short *HFilter, -; unsigned short *VFilter, -; int *sum, -; unsigned int *sumsquared -;) -global sym(vp8_filter_block2d_bil4x4_var_mmx) PRIVATE -sym(vp8_filter_block2d_bil4x4_var_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 8 - GET_GOT rbx - push rsi - push rdi - sub rsp, 16 - ; end prolog - - - pxor mm6, mm6 ; - pxor mm7, mm7 ; - - mov rax, arg(4) ;HFilter ; - mov rdx, arg(5) ;VFilter ; - - mov rsi, arg(0) ;ref_ptr ; - mov rdi, arg(2) ;src_ptr ; - - mov rcx, 4 ; - pxor mm0, mm0 ; - - movd mm1, [rsi] ; - movd mm3, [rsi+1] ; - - punpcklbw mm1, mm0 ; - pmullw mm1, [rax] ; - - punpcklbw mm3, mm0 ; - pmullw mm3, [rax+8] ; - - paddw mm1, mm3 ; - paddw mm1, [GLOBAL(mmx_bi_rd)] ; - - psraw mm1, mmx_filter_shift ; - movq mm5, mm1 - -%if ABI_IS_32BIT - add rsi, dword ptr arg(1) ;ref_pixels_per_line ; -%else - movsxd r8, dword ptr arg(1) ;ref_pixels_per_line ; - add rsi, r8 -%endif - -.filter_block2d_bil4x4_var_mmx_loop: - - movd mm1, [rsi] ; - movd mm3, [rsi+1] ; - - punpcklbw mm1, mm0 ; - pmullw mm1, [rax] ; - - punpcklbw mm3, mm0 ; - pmullw mm3, [rax+8] ; - - paddw mm1, mm3 ; - paddw mm1, [GLOBAL(mmx_bi_rd)] ; - - psraw mm1, mmx_filter_shift ; - movq mm3, mm5 ; - - movq mm5, mm1 ; - pmullw mm3, [rdx] ; - - pmullw mm1, [rdx+8] ; - paddw mm1, mm3 ; - - - paddw mm1, [GLOBAL(mmx_bi_rd)] ; - psraw mm1, mmx_filter_shift ; - - movd mm3, [rdi] ; - punpcklbw mm3, mm0 ; - - psubw mm1, mm3 ; - paddw mm6, mm1 ; - - pmaddwd mm1, mm1 ; - paddd mm7, mm1 ; - -%if ABI_IS_32BIT - add rsi, dword ptr arg(1) ;ref_pixels_per_line ; - add rdi, dword ptr arg(3) ;src_pixels_per_line ; -%else - movsxd r8, dword ptr arg(1) ;ref_pixels_per_line - movsxd r9, dword ptr arg(3) ;src_pixels_per_line - add rsi, r8 - add rdi, r9 -%endif - sub rcx, 1 ; - jnz .filter_block2d_bil4x4_var_mmx_loop ; - - - pxor mm3, mm3 ; - pxor mm2, mm2 ; - - punpcklwd mm2, mm6 ; - punpckhwd mm3, mm6 ; - - paddd mm2, mm3 ; - movq mm6, mm2 ; - - psrlq mm6, 32 ; - paddd mm2, mm6 ; - - psrad mm2, 16 ; - movq mm4, mm7 ; - - psrlq mm4, 32 ; - paddd mm4, mm7 ; - - mov rdi, arg(6) ;sum - mov rsi, arg(7) ;sumsquared - - movd dword ptr [rdi], mm2 ; - movd dword ptr [rsi], mm4 ; - - - - ; begin epilog - add rsp, 16 - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - - - - -;void vp8_filter_block2d_bil_var_mmx -;( -; unsigned char *ref_ptr, -; int ref_pixels_per_line, -; unsigned char *src_ptr, -; int src_pixels_per_line, -; unsigned int Height, -; unsigned short *HFilter, -; unsigned short *VFilter, -; int *sum, -; unsigned int *sumsquared -;) -global sym(vp8_filter_block2d_bil_var_mmx) PRIVATE -sym(vp8_filter_block2d_bil_var_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 9 - GET_GOT rbx - push rsi - push rdi - sub rsp, 16 - ; end prolog - - pxor mm6, mm6 ; - pxor mm7, mm7 ; - mov rax, arg(5) ;HFilter ; - - mov rdx, arg(6) ;VFilter ; - mov rsi, arg(0) ;ref_ptr ; - - mov rdi, arg(2) ;src_ptr ; - movsxd rcx, dword ptr arg(4) ;Height ; - - pxor mm0, mm0 ; - movq mm1, [rsi] ; - - movq mm3, [rsi+1] ; - movq mm2, mm1 ; - - movq mm4, mm3 ; - punpcklbw mm1, mm0 ; - - punpckhbw mm2, mm0 ; - pmullw mm1, [rax] ; - - pmullw mm2, [rax] ; - punpcklbw mm3, mm0 ; - - punpckhbw mm4, mm0 ; - pmullw mm3, [rax+8] ; - - pmullw mm4, [rax+8] ; - paddw mm1, mm3 ; - - paddw mm2, mm4 ; - paddw mm1, [GLOBAL(mmx_bi_rd)] ; - - psraw mm1, mmx_filter_shift ; - paddw mm2, [GLOBAL(mmx_bi_rd)] ; - - psraw mm2, mmx_filter_shift ; - movq mm5, mm1 - - packuswb mm5, mm2 ; -%if ABI_IS_32BIT - add rsi, dword ptr arg(1) ;ref_pixels_per_line -%else - movsxd r8, dword ptr arg(1) ;ref_pixels_per_line - add rsi, r8 -%endif - -.filter_block2d_bil_var_mmx_loop: - - movq mm1, [rsi] ; - movq mm3, [rsi+1] ; - - movq mm2, mm1 ; - movq mm4, mm3 ; - - punpcklbw mm1, mm0 ; - punpckhbw mm2, mm0 ; - - pmullw mm1, [rax] ; - pmullw mm2, [rax] ; - - punpcklbw mm3, mm0 ; - punpckhbw mm4, mm0 ; - - pmullw mm3, [rax+8] ; - pmullw mm4, [rax+8] ; - - paddw mm1, mm3 ; - paddw mm2, mm4 ; - - paddw mm1, [GLOBAL(mmx_bi_rd)] ; - psraw mm1, mmx_filter_shift ; - - paddw mm2, [GLOBAL(mmx_bi_rd)] ; - psraw mm2, mmx_filter_shift ; - - movq mm3, mm5 ; - movq mm4, mm5 ; - - punpcklbw mm3, mm0 ; - punpckhbw mm4, mm0 ; - - movq mm5, mm1 ; - packuswb mm5, mm2 ; - - pmullw mm3, [rdx] ; - pmullw mm4, [rdx] ; - - pmullw mm1, [rdx+8] ; - pmullw mm2, [rdx+8] ; - - paddw mm1, mm3 ; - paddw mm2, mm4 ; - - paddw mm1, [GLOBAL(mmx_bi_rd)] ; - paddw mm2, [GLOBAL(mmx_bi_rd)] ; - - psraw mm1, mmx_filter_shift ; - psraw mm2, mmx_filter_shift ; - - movq mm3, [rdi] ; - movq mm4, mm3 ; - - punpcklbw mm3, mm0 ; - punpckhbw mm4, mm0 ; - - psubw mm1, mm3 ; - psubw mm2, mm4 ; - - paddw mm6, mm1 ; - pmaddwd mm1, mm1 ; - - paddw mm6, mm2 ; - pmaddwd mm2, mm2 ; - - paddd mm7, mm1 ; - paddd mm7, mm2 ; - -%if ABI_IS_32BIT - add rsi, dword ptr arg(1) ;ref_pixels_per_line ; - add rdi, dword ptr arg(3) ;src_pixels_per_line ; -%else - movsxd r8, dword ptr arg(1) ;ref_pixels_per_line ; - movsxd r9, dword ptr arg(3) ;src_pixels_per_line ; - add rsi, r8 - add rdi, r9 -%endif - sub rcx, 1 ; - jnz .filter_block2d_bil_var_mmx_loop ; - - - pxor mm3, mm3 ; - pxor mm2, mm2 ; - - punpcklwd mm2, mm6 ; - punpckhwd mm3, mm6 ; - - paddd mm2, mm3 ; - movq mm6, mm2 ; - - psrlq mm6, 32 ; - paddd mm2, mm6 ; - - psrad mm2, 16 ; - movq mm4, mm7 ; - - psrlq mm4, 32 ; - paddd mm4, mm7 ; - - mov rdi, arg(7) ;sum - mov rsi, arg(8) ;sumsquared - - movd dword ptr [rdi], mm2 ; - movd dword ptr [rsi], mm4 ; - - ; begin epilog - add rsp, 16 - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - - -SECTION_RODATA -;short mmx_bi_rd[4] = { 64, 64, 64, 64}; -align 16 -mmx_bi_rd: - times 4 dw 64 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/variance_impl_sse2.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/variance_impl_sse2.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/variance_impl_sse2.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/variance_impl_sse2.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,1359 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -%define xmm_filter_shift 7 - -;unsigned int vp8_get_mb_ss_sse2 -;( -; short *src_ptr -;) -global sym(vp8_get_mb_ss_sse2) PRIVATE -sym(vp8_get_mb_ss_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 1 - GET_GOT rbx - push rsi - push rdi - sub rsp, 16 - ; end prolog - - - mov rax, arg(0) ;[src_ptr] - mov rcx, 8 - pxor xmm4, xmm4 - -.NEXTROW: - movdqa xmm0, [rax] - movdqa xmm1, [rax+16] - movdqa xmm2, [rax+32] - movdqa xmm3, [rax+48] - pmaddwd xmm0, xmm0 - pmaddwd xmm1, xmm1 - pmaddwd xmm2, xmm2 - pmaddwd xmm3, xmm3 - - paddd xmm0, xmm1 - paddd xmm2, xmm3 - paddd xmm4, xmm0 - paddd xmm4, xmm2 - - add rax, 0x40 - dec rcx - ja .NEXTROW - - movdqa xmm3,xmm4 - psrldq xmm4,8 - paddd xmm4,xmm3 - movdqa xmm3,xmm4 - psrldq xmm4,4 - paddd xmm4,xmm3 - movq rax,xmm4 - - - ; begin epilog - add rsp, 16 - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - - -;unsigned int vp8_get16x16var_sse2 -;( -; unsigned char * src_ptr, -; int source_stride, -; unsigned char * ref_ptr, -; int recon_stride, -; unsigned int * SSE, -; int * Sum -;) -global sym(vp8_get16x16var_sse2) PRIVATE -sym(vp8_get16x16var_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - SAVE_XMM 7 - push rbx - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;[src_ptr] - mov rdi, arg(2) ;[ref_ptr] - - movsxd rax, DWORD PTR arg(1) ;[source_stride] - movsxd rdx, DWORD PTR arg(3) ;[recon_stride] - - ; Prefetch data - lea rcx, [rax+rax*2] - prefetcht0 [rsi] - prefetcht0 [rsi+rax] - prefetcht0 [rsi+rax*2] - prefetcht0 [rsi+rcx] - lea rbx, [rsi+rax*4] - prefetcht0 [rbx] - prefetcht0 [rbx+rax] - prefetcht0 [rbx+rax*2] - prefetcht0 [rbx+rcx] - - lea rcx, [rdx+rdx*2] - prefetcht0 [rdi] - prefetcht0 [rdi+rdx] - prefetcht0 [rdi+rdx*2] - prefetcht0 [rdi+rcx] - lea rbx, [rdi+rdx*4] - prefetcht0 [rbx] - prefetcht0 [rbx+rdx] - prefetcht0 [rbx+rdx*2] - prefetcht0 [rbx+rcx] - - pxor xmm0, xmm0 ; clear xmm0 for unpack - pxor xmm7, xmm7 ; clear xmm7 for accumulating diffs - - pxor xmm6, xmm6 ; clear xmm6 for accumulating sse - mov rcx, 16 - -.var16loop: - movdqu xmm1, XMMWORD PTR [rsi] - movdqu xmm2, XMMWORD PTR [rdi] - - prefetcht0 [rsi+rax*8] - prefetcht0 [rdi+rdx*8] - - movdqa xmm3, xmm1 - movdqa xmm4, xmm2 - - - punpcklbw xmm1, xmm0 - punpckhbw xmm3, xmm0 - - punpcklbw xmm2, xmm0 - punpckhbw xmm4, xmm0 - - - psubw xmm1, xmm2 - psubw xmm3, xmm4 - - paddw xmm7, xmm1 - pmaddwd xmm1, xmm1 - - paddw xmm7, xmm3 - pmaddwd xmm3, xmm3 - - paddd xmm6, xmm1 - paddd xmm6, xmm3 - - add rsi, rax - add rdi, rdx - - sub rcx, 1 - jnz .var16loop - - - movdqa xmm1, xmm6 - pxor xmm6, xmm6 - - pxor xmm5, xmm5 - punpcklwd xmm6, xmm7 - - punpckhwd xmm5, xmm7 - psrad xmm5, 16 - - psrad xmm6, 16 - paddd xmm6, xmm5 - - movdqa xmm2, xmm1 - punpckldq xmm1, xmm0 - - punpckhdq xmm2, xmm0 - movdqa xmm7, xmm6 - - paddd xmm1, xmm2 - punpckldq xmm6, xmm0 - - punpckhdq xmm7, xmm0 - paddd xmm6, xmm7 - - movdqa xmm2, xmm1 - movdqa xmm7, xmm6 - - psrldq xmm1, 8 - psrldq xmm6, 8 - - paddd xmm7, xmm6 - paddd xmm1, xmm2 - - mov rax, arg(5) ;[Sum] - mov rdi, arg(4) ;[SSE] - - movd DWORD PTR [rax], xmm7 - movd DWORD PTR [rdi], xmm1 - - - ; begin epilog - pop rdi - pop rsi - pop rbx - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - - - -;unsigned int vp8_get8x8var_sse2 -;( -; unsigned char * src_ptr, -; int source_stride, -; unsigned char * ref_ptr, -; int recon_stride, -; unsigned int * SSE, -; int * Sum -;) -global sym(vp8_get8x8var_sse2) PRIVATE -sym(vp8_get8x8var_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 6 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - sub rsp, 16 - ; end prolog - - mov rsi, arg(0) ;[src_ptr] - mov rdi, arg(2) ;[ref_ptr] - - movsxd rax, DWORD PTR arg(1) ;[source_stride] - movsxd rdx, DWORD PTR arg(3) ;[recon_stride] - - pxor xmm0, xmm0 ; clear xmm0 for unpack - pxor xmm7, xmm7 ; clear xmm7 for accumulating diffs - - movq xmm1, QWORD PTR [rsi] - movq xmm2, QWORD PTR [rdi] - - punpcklbw xmm1, xmm0 - punpcklbw xmm2, xmm0 - - psubsw xmm1, xmm2 - paddw xmm7, xmm1 - - pmaddwd xmm1, xmm1 - - movq xmm2, QWORD PTR[rsi + rax] - movq xmm3, QWORD PTR[rdi + rdx] - - punpcklbw xmm2, xmm0 - punpcklbw xmm3, xmm0 - - psubsw xmm2, xmm3 - paddw xmm7, xmm2 - - pmaddwd xmm2, xmm2 - paddd xmm1, xmm2 - - - movq xmm2, QWORD PTR[rsi + rax * 2] - movq xmm3, QWORD PTR[rdi + rdx * 2] - - punpcklbw xmm2, xmm0 - punpcklbw xmm3, xmm0 - - psubsw xmm2, xmm3 - paddw xmm7, xmm2 - - pmaddwd xmm2, xmm2 - paddd xmm1, xmm2 - - - lea rsi, [rsi + rax * 2] - lea rdi, [rdi + rdx * 2] - movq xmm2, QWORD PTR[rsi + rax] - movq xmm3, QWORD PTR[rdi + rdx] - - punpcklbw xmm2, xmm0 - punpcklbw xmm3, xmm0 - - psubsw xmm2, xmm3 - paddw xmm7, xmm2 - - pmaddwd xmm2, xmm2 - paddd xmm1, xmm2 - - movq xmm2, QWORD PTR[rsi + rax *2] - movq xmm3, QWORD PTR[rdi + rdx *2] - - punpcklbw xmm2, xmm0 - punpcklbw xmm3, xmm0 - - psubsw xmm2, xmm3 - paddw xmm7, xmm2 - - pmaddwd xmm2, xmm2 - paddd xmm1, xmm2 - - - lea rsi, [rsi + rax * 2] - lea rdi, [rdi + rdx * 2] - - - movq xmm2, QWORD PTR[rsi + rax] - movq xmm3, QWORD PTR[rdi + rdx] - - punpcklbw xmm2, xmm0 - punpcklbw xmm3, xmm0 - - psubsw xmm2, xmm3 - paddw xmm7, xmm2 - - pmaddwd xmm2, xmm2 - paddd xmm1, xmm2 - - movq xmm2, QWORD PTR[rsi + rax *2] - movq xmm3, QWORD PTR[rdi + rdx *2] - - punpcklbw xmm2, xmm0 - punpcklbw xmm3, xmm0 - - psubsw xmm2, xmm3 - paddw xmm7, xmm2 - - pmaddwd xmm2, xmm2 - paddd xmm1, xmm2 - - - lea rsi, [rsi + rax * 2] - lea rdi, [rdi + rdx * 2] - - movq xmm2, QWORD PTR[rsi + rax] - movq xmm3, QWORD PTR[rdi + rdx] - - punpcklbw xmm2, xmm0 - punpcklbw xmm3, xmm0 - - psubsw xmm2, xmm3 - paddw xmm7, xmm2 - - pmaddwd xmm2, xmm2 - paddd xmm1, xmm2 - - - movdqa xmm6, xmm7 - punpcklwd xmm6, xmm0 - - punpckhwd xmm7, xmm0 - movdqa xmm2, xmm1 - - paddw xmm6, xmm7 - punpckldq xmm1, xmm0 - - punpckhdq xmm2, xmm0 - movdqa xmm7, xmm6 - - paddd xmm1, xmm2 - punpckldq xmm6, xmm0 - - punpckhdq xmm7, xmm0 - paddw xmm6, xmm7 - - movdqa xmm2, xmm1 - movdqa xmm7, xmm6 - - psrldq xmm1, 8 - psrldq xmm6, 8 - - paddw xmm7, xmm6 - paddd xmm1, xmm2 - - mov rax, arg(5) ;[Sum] - mov rdi, arg(4) ;[SSE] - - movq rdx, xmm7 - movsx rcx, dx - - mov dword ptr [rax], ecx - movd DWORD PTR [rdi], xmm1 - - ; begin epilog - add rsp, 16 - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -;void vp8_filter_block2d_bil_var_sse2 -;( -; unsigned char *ref_ptr, -; int ref_pixels_per_line, -; unsigned char *src_ptr, -; int src_pixels_per_line, -; unsigned int Height, -; int xoffset, -; int yoffset, -; int *sum, -; unsigned int *sumsquared;; -; -;) -global sym(vp8_filter_block2d_bil_var_sse2) PRIVATE -sym(vp8_filter_block2d_bil_var_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 9 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - push rbx - ; end prolog - - pxor xmm6, xmm6 ; - pxor xmm7, xmm7 ; - - lea rsi, [GLOBAL(xmm_bi_rd)] ; rounding - movdqa xmm4, XMMWORD PTR [rsi] - - lea rcx, [GLOBAL(vp8_bilinear_filters_sse2)] - movsxd rax, dword ptr arg(5) ; xoffset - - cmp rax, 0 ; skip first_pass filter if xoffset=0 - je filter_block2d_bil_var_sse2_sp_only - - shl rax, 5 ; point to filter coeff with xoffset - lea rax, [rax + rcx] ; HFilter - - movsxd rdx, dword ptr arg(6) ; yoffset - - cmp rdx, 0 ; skip second_pass filter if yoffset=0 - je filter_block2d_bil_var_sse2_fp_only - - shl rdx, 5 - lea rdx, [rdx + rcx] ; VFilter - - mov rsi, arg(0) ;ref_ptr - mov rdi, arg(2) ;src_ptr - movsxd rcx, dword ptr arg(4) ;Height - - pxor xmm0, xmm0 ; - movq xmm1, QWORD PTR [rsi] ; - movq xmm3, QWORD PTR [rsi+1] ; - - punpcklbw xmm1, xmm0 ; - pmullw xmm1, [rax] ; - punpcklbw xmm3, xmm0 - pmullw xmm3, [rax+16] ; - - paddw xmm1, xmm3 ; - paddw xmm1, xmm4 ; - psraw xmm1, xmm_filter_shift ; - movdqa xmm5, xmm1 - - movsxd rbx, dword ptr arg(1) ;ref_pixels_per_line - lea rsi, [rsi + rbx] -%if ABI_IS_32BIT=0 - movsxd r9, dword ptr arg(3) ;src_pixels_per_line -%endif - -filter_block2d_bil_var_sse2_loop: - movq xmm1, QWORD PTR [rsi] ; - movq xmm3, QWORD PTR [rsi+1] ; - - punpcklbw xmm1, xmm0 ; - pmullw xmm1, [rax] ; - punpcklbw xmm3, xmm0 ; - pmullw xmm3, [rax+16] ; - - paddw xmm1, xmm3 ; - paddw xmm1, xmm4 ; - psraw xmm1, xmm_filter_shift ; - - movdqa xmm3, xmm5 ; - movdqa xmm5, xmm1 ; - - pmullw xmm3, [rdx] ; - pmullw xmm1, [rdx+16] ; - paddw xmm1, xmm3 ; - paddw xmm1, xmm4 ; - psraw xmm1, xmm_filter_shift ; - - movq xmm3, QWORD PTR [rdi] ; - punpcklbw xmm3, xmm0 ; - - psubw xmm1, xmm3 ; - paddw xmm6, xmm1 ; - - pmaddwd xmm1, xmm1 ; - paddd xmm7, xmm1 ; - - lea rsi, [rsi + rbx] ;ref_pixels_per_line -%if ABI_IS_32BIT - add rdi, dword ptr arg(3) ;src_pixels_per_line -%else - lea rdi, [rdi + r9] -%endif - - sub rcx, 1 ; - jnz filter_block2d_bil_var_sse2_loop ; - - jmp filter_block2d_bil_variance - -filter_block2d_bil_var_sse2_sp_only: - movsxd rdx, dword ptr arg(6) ; yoffset - - cmp rdx, 0 ; skip all if both xoffset=0 and yoffset=0 - je filter_block2d_bil_var_sse2_full_pixel - - shl rdx, 5 - lea rdx, [rdx + rcx] ; VFilter - - mov rsi, arg(0) ;ref_ptr - mov rdi, arg(2) ;src_ptr - movsxd rcx, dword ptr arg(4) ;Height - movsxd rax, dword ptr arg(1) ;ref_pixels_per_line - - pxor xmm0, xmm0 ; - movq xmm1, QWORD PTR [rsi] ; - punpcklbw xmm1, xmm0 ; - - movsxd rbx, dword ptr arg(3) ;src_pixels_per_line - lea rsi, [rsi + rax] - -filter_block2d_bil_sp_only_loop: - movq xmm3, QWORD PTR [rsi] ; - punpcklbw xmm3, xmm0 ; - movdqa xmm5, xmm3 - - pmullw xmm1, [rdx] ; - pmullw xmm3, [rdx+16] ; - paddw xmm1, xmm3 ; - paddw xmm1, xmm4 ; - psraw xmm1, xmm_filter_shift ; - - movq xmm3, QWORD PTR [rdi] ; - punpcklbw xmm3, xmm0 ; - - psubw xmm1, xmm3 ; - paddw xmm6, xmm1 ; - - pmaddwd xmm1, xmm1 ; - paddd xmm7, xmm1 ; - - movdqa xmm1, xmm5 ; - lea rsi, [rsi + rax] ;ref_pixels_per_line - lea rdi, [rdi + rbx] ;src_pixels_per_line - - sub rcx, 1 ; - jnz filter_block2d_bil_sp_only_loop ; - - jmp filter_block2d_bil_variance - -filter_block2d_bil_var_sse2_full_pixel: - mov rsi, arg(0) ;ref_ptr - mov rdi, arg(2) ;src_ptr - movsxd rcx, dword ptr arg(4) ;Height - movsxd rax, dword ptr arg(1) ;ref_pixels_per_line - movsxd rbx, dword ptr arg(3) ;src_pixels_per_line - pxor xmm0, xmm0 ; - -filter_block2d_bil_full_pixel_loop: - movq xmm1, QWORD PTR [rsi] ; - punpcklbw xmm1, xmm0 ; - - movq xmm2, QWORD PTR [rdi] ; - punpcklbw xmm2, xmm0 ; - - psubw xmm1, xmm2 ; - paddw xmm6, xmm1 ; - - pmaddwd xmm1, xmm1 ; - paddd xmm7, xmm1 ; - - lea rsi, [rsi + rax] ;ref_pixels_per_line - lea rdi, [rdi + rbx] ;src_pixels_per_line - - sub rcx, 1 ; - jnz filter_block2d_bil_full_pixel_loop ; - - jmp filter_block2d_bil_variance - -filter_block2d_bil_var_sse2_fp_only: - mov rsi, arg(0) ;ref_ptr - mov rdi, arg(2) ;src_ptr - movsxd rcx, dword ptr arg(4) ;Height - movsxd rdx, dword ptr arg(1) ;ref_pixels_per_line - - pxor xmm0, xmm0 ; - movsxd rbx, dword ptr arg(3) ;src_pixels_per_line - -filter_block2d_bil_fp_only_loop: - movq xmm1, QWORD PTR [rsi] ; - movq xmm3, QWORD PTR [rsi+1] ; - - punpcklbw xmm1, xmm0 ; - pmullw xmm1, [rax] ; - punpcklbw xmm3, xmm0 ; - pmullw xmm3, [rax+16] ; - - paddw xmm1, xmm3 ; - paddw xmm1, xmm4 ; - psraw xmm1, xmm_filter_shift ; - - movq xmm3, QWORD PTR [rdi] ; - punpcklbw xmm3, xmm0 ; - - psubw xmm1, xmm3 ; - paddw xmm6, xmm1 ; - - pmaddwd xmm1, xmm1 ; - paddd xmm7, xmm1 ; - lea rsi, [rsi + rdx] - lea rdi, [rdi + rbx] ;src_pixels_per_line - - sub rcx, 1 ; - jnz filter_block2d_bil_fp_only_loop ; - - jmp filter_block2d_bil_variance - -filter_block2d_bil_variance: - movdq2q mm6, xmm6 ; - movdq2q mm7, xmm7 ; - - psrldq xmm6, 8 - psrldq xmm7, 8 - - movdq2q mm2, xmm6 - movdq2q mm3, xmm7 - - paddw mm6, mm2 - paddd mm7, mm3 - - pxor mm3, mm3 ; - pxor mm2, mm2 ; - - punpcklwd mm2, mm6 ; - punpckhwd mm3, mm6 ; - - paddd mm2, mm3 ; - movq mm6, mm2 ; - - psrlq mm6, 32 ; - paddd mm2, mm6 ; - - psrad mm2, 16 ; - movq mm4, mm7 ; - - psrlq mm4, 32 ; - paddd mm4, mm7 ; - - mov rsi, arg(7) ; sum - mov rdi, arg(8) ; sumsquared - - movd [rsi], mm2 ; xsum - movd [rdi], mm4 ; xxsum - - ; begin epilog - pop rbx - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_half_horiz_vert_variance8x_h_sse2 -;( -; unsigned char *ref_ptr, -; int ref_pixels_per_line, -; unsigned char *src_ptr, -; int src_pixels_per_line, -; unsigned int Height, -; int *sum, -; unsigned int *sumsquared -;) -global sym(vp8_half_horiz_vert_variance8x_h_sse2) PRIVATE -sym(vp8_half_horiz_vert_variance8x_h_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - -%if ABI_IS_32BIT=0 - movsxd r8, dword ptr arg(1) ;ref_pixels_per_line - movsxd r9, dword ptr arg(3) ;src_pixels_per_line -%endif - - pxor xmm6, xmm6 ; error accumulator - pxor xmm7, xmm7 ; sse eaccumulator - mov rsi, arg(0) ;ref_ptr ; - - mov rdi, arg(2) ;src_ptr ; - movsxd rcx, dword ptr arg(4) ;Height ; - movsxd rax, dword ptr arg(1) ;ref_pixels_per_line - - pxor xmm0, xmm0 ; - - movq xmm5, QWORD PTR [rsi] ; xmm5 = s0,s1,s2..s8 - movq xmm3, QWORD PTR [rsi+1] ; xmm3 = s1,s2,s3..s9 - pavgb xmm5, xmm3 ; xmm5 = avg(xmm1,xmm3) horizontal line 1 - -%if ABI_IS_32BIT - add rsi, dword ptr arg(1) ;ref_pixels_per_line ; next source -%else - add rsi, r8 -%endif - -vp8_half_horiz_vert_variance8x_h_1: - - movq xmm1, QWORD PTR [rsi] ; - movq xmm2, QWORD PTR [rsi+1] ; - pavgb xmm1, xmm2 ; xmm1 = avg(xmm1,xmm3) horizontal line i+1 - - pavgb xmm5, xmm1 ; xmm = vertical average of the above - punpcklbw xmm5, xmm0 ; xmm5 = words of above - - movq xmm3, QWORD PTR [rdi] ; xmm3 = d0,d1,d2..d8 - punpcklbw xmm3, xmm0 ; xmm3 = words of above - - psubw xmm5, xmm3 ; xmm5 -= xmm3 - paddw xmm6, xmm5 ; xmm6 += accumulated column differences - pmaddwd xmm5, xmm5 ; xmm5 *= xmm5 - paddd xmm7, xmm5 ; xmm7 += accumulated square column differences - - movdqa xmm5, xmm1 ; save xmm1 for use on the next row - -%if ABI_IS_32BIT - add esi, dword ptr arg(1) ;ref_pixels_per_line ; next source - add edi, dword ptr arg(3) ;src_pixels_per_line ; next destination -%else - add rsi, r8 - add rdi, r9 -%endif - - sub rcx, 1 ; - jnz vp8_half_horiz_vert_variance8x_h_1 ; - - movdq2q mm6, xmm6 ; - movdq2q mm7, xmm7 ; - - psrldq xmm6, 8 - psrldq xmm7, 8 - - movdq2q mm2, xmm6 - movdq2q mm3, xmm7 - - paddw mm6, mm2 - paddd mm7, mm3 - - pxor mm3, mm3 ; - pxor mm2, mm2 ; - - punpcklwd mm2, mm6 ; - punpckhwd mm3, mm6 ; - - paddd mm2, mm3 ; - movq mm6, mm2 ; - - psrlq mm6, 32 ; - paddd mm2, mm6 ; - - psrad mm2, 16 ; - movq mm4, mm7 ; - - psrlq mm4, 32 ; - paddd mm4, mm7 ; - - mov rsi, arg(5) ; sum - mov rdi, arg(6) ; sumsquared - - movd [rsi], mm2 ; - movd [rdi], mm4 ; - - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -;void vp8_half_horiz_vert_variance16x_h_sse2 -;( -; unsigned char *ref_ptr, -; int ref_pixels_per_line, -; unsigned char *src_ptr, -; int src_pixels_per_line, -; unsigned int Height, -; int *sum, -; unsigned int *sumsquared -;) -global sym(vp8_half_horiz_vert_variance16x_h_sse2) PRIVATE -sym(vp8_half_horiz_vert_variance16x_h_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - pxor xmm6, xmm6 ; error accumulator - pxor xmm7, xmm7 ; sse eaccumulator - mov rsi, arg(0) ;ref_ptr ; - - mov rdi, arg(2) ;src_ptr ; - movsxd rcx, dword ptr arg(4) ;Height ; - movsxd rax, dword ptr arg(1) ;ref_pixels_per_line - movsxd rdx, dword ptr arg(3) ;src_pixels_per_line - - pxor xmm0, xmm0 ; - - movdqu xmm5, XMMWORD PTR [rsi] - movdqu xmm3, XMMWORD PTR [rsi+1] - pavgb xmm5, xmm3 ; xmm5 = avg(xmm1,xmm3) horizontal line 1 - - lea rsi, [rsi + rax] - -vp8_half_horiz_vert_variance16x_h_1: - movdqu xmm1, XMMWORD PTR [rsi] ; - movdqu xmm2, XMMWORD PTR [rsi+1] ; - pavgb xmm1, xmm2 ; xmm1 = avg(xmm1,xmm3) horizontal line i+1 - - pavgb xmm5, xmm1 ; xmm = vertical average of the above - - movdqa xmm4, xmm5 - punpcklbw xmm5, xmm0 ; xmm5 = words of above - punpckhbw xmm4, xmm0 - - movq xmm3, QWORD PTR [rdi] ; xmm3 = d0,d1,d2..d7 - punpcklbw xmm3, xmm0 ; xmm3 = words of above - psubw xmm5, xmm3 ; xmm5 -= xmm3 - - movq xmm3, QWORD PTR [rdi+8] - punpcklbw xmm3, xmm0 - psubw xmm4, xmm3 - - paddw xmm6, xmm5 ; xmm6 += accumulated column differences - paddw xmm6, xmm4 - pmaddwd xmm5, xmm5 ; xmm5 *= xmm5 - pmaddwd xmm4, xmm4 - paddd xmm7, xmm5 ; xmm7 += accumulated square column differences - paddd xmm7, xmm4 - - movdqa xmm5, xmm1 ; save xmm1 for use on the next row - - lea rsi, [rsi + rax] - lea rdi, [rdi + rdx] - - sub rcx, 1 ; - jnz vp8_half_horiz_vert_variance16x_h_1 ; - - pxor xmm1, xmm1 - pxor xmm5, xmm5 - - punpcklwd xmm0, xmm6 - punpckhwd xmm1, xmm6 - psrad xmm0, 16 - psrad xmm1, 16 - paddd xmm0, xmm1 - movdqa xmm1, xmm0 - - movdqa xmm6, xmm7 - punpckldq xmm6, xmm5 - punpckhdq xmm7, xmm5 - paddd xmm6, xmm7 - - punpckldq xmm0, xmm5 - punpckhdq xmm1, xmm5 - paddd xmm0, xmm1 - - movdqa xmm7, xmm6 - movdqa xmm1, xmm0 - - psrldq xmm7, 8 - psrldq xmm1, 8 - - paddd xmm6, xmm7 - paddd xmm0, xmm1 - - mov rsi, arg(5) ;[Sum] - mov rdi, arg(6) ;[SSE] - - movd [rsi], xmm0 - movd [rdi], xmm6 - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_half_vert_variance8x_h_sse2 -;( -; unsigned char *ref_ptr, -; int ref_pixels_per_line, -; unsigned char *src_ptr, -; int src_pixels_per_line, -; unsigned int Height, -; int *sum, -; unsigned int *sumsquared -;) -global sym(vp8_half_vert_variance8x_h_sse2) PRIVATE -sym(vp8_half_vert_variance8x_h_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - -%if ABI_IS_32BIT=0 - movsxd r8, dword ptr arg(1) ;ref_pixels_per_line - movsxd r9, dword ptr arg(3) ;src_pixels_per_line -%endif - - pxor xmm6, xmm6 ; error accumulator - pxor xmm7, xmm7 ; sse eaccumulator - mov rsi, arg(0) ;ref_ptr ; - - mov rdi, arg(2) ;src_ptr ; - movsxd rcx, dword ptr arg(4) ;Height ; - movsxd rax, dword ptr arg(1) ;ref_pixels_per_line - - pxor xmm0, xmm0 ; -vp8_half_vert_variance8x_h_1: - movq xmm5, QWORD PTR [rsi] ; xmm5 = s0,s1,s2..s8 - movq xmm3, QWORD PTR [rsi+rax] ; xmm3 = s1,s2,s3..s9 - - pavgb xmm5, xmm3 ; xmm5 = avg(xmm1,xmm3) - punpcklbw xmm5, xmm0 ; xmm5 = words of above - - movq xmm3, QWORD PTR [rdi] ; xmm3 = d0,d1,d2..d8 - punpcklbw xmm3, xmm0 ; xmm3 = words of above - - psubw xmm5, xmm3 ; xmm5 -= xmm3 - paddw xmm6, xmm5 ; xmm6 += accumulated column differences - pmaddwd xmm5, xmm5 ; xmm5 *= xmm5 - paddd xmm7, xmm5 ; xmm7 += accumulated square column differences - -%if ABI_IS_32BIT - add esi, dword ptr arg(1) ;ref_pixels_per_line ; next source - add edi, dword ptr arg(3) ;src_pixels_per_line ; next destination -%else - add rsi, r8 - add rdi, r9 -%endif - - sub rcx, 1 ; - jnz vp8_half_vert_variance8x_h_1 ; - - movdq2q mm6, xmm6 ; - movdq2q mm7, xmm7 ; - - psrldq xmm6, 8 - psrldq xmm7, 8 - - movdq2q mm2, xmm6 - movdq2q mm3, xmm7 - - paddw mm6, mm2 - paddd mm7, mm3 - - pxor mm3, mm3 ; - pxor mm2, mm2 ; - - punpcklwd mm2, mm6 ; - punpckhwd mm3, mm6 ; - - paddd mm2, mm3 ; - movq mm6, mm2 ; - - psrlq mm6, 32 ; - paddd mm2, mm6 ; - - psrad mm2, 16 ; - movq mm4, mm7 ; - - psrlq mm4, 32 ; - paddd mm4, mm7 ; - - mov rsi, arg(5) ; sum - mov rdi, arg(6) ; sumsquared - - movd [rsi], mm2 ; - movd [rdi], mm4 ; - - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -;void vp8_half_vert_variance16x_h_sse2 -;( -; unsigned char *ref_ptr, -; int ref_pixels_per_line, -; unsigned char *src_ptr, -; int src_pixels_per_line, -; unsigned int Height, -; int *sum, -; unsigned int *sumsquared -;) -global sym(vp8_half_vert_variance16x_h_sse2) PRIVATE -sym(vp8_half_vert_variance16x_h_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - pxor xmm6, xmm6 ; error accumulator - pxor xmm7, xmm7 ; sse eaccumulator - mov rsi, arg(0) ;ref_ptr - - mov rdi, arg(2) ;src_ptr - movsxd rcx, dword ptr arg(4) ;Height - movsxd rax, dword ptr arg(1) ;ref_pixels_per_line - movsxd rdx, dword ptr arg(3) ;src_pixels_per_line - - movdqu xmm5, XMMWORD PTR [rsi] - lea rsi, [rsi + rax ] - pxor xmm0, xmm0 - -vp8_half_vert_variance16x_h_1: - movdqu xmm3, XMMWORD PTR [rsi] - - pavgb xmm5, xmm3 ; xmm5 = avg(xmm1,xmm3) - movdqa xmm4, xmm5 - punpcklbw xmm5, xmm0 - punpckhbw xmm4, xmm0 - - movq xmm2, QWORD PTR [rdi] - punpcklbw xmm2, xmm0 - psubw xmm5, xmm2 - movq xmm2, QWORD PTR [rdi+8] - punpcklbw xmm2, xmm0 - psubw xmm4, xmm2 - - paddw xmm6, xmm5 ; xmm6 += accumulated column differences - paddw xmm6, xmm4 - pmaddwd xmm5, xmm5 ; xmm5 *= xmm5 - pmaddwd xmm4, xmm4 - paddd xmm7, xmm5 ; xmm7 += accumulated square column differences - paddd xmm7, xmm4 - - movdqa xmm5, xmm3 - - lea rsi, [rsi + rax] - lea rdi, [rdi + rdx] - - sub rcx, 1 - jnz vp8_half_vert_variance16x_h_1 - - pxor xmm1, xmm1 - pxor xmm5, xmm5 - - punpcklwd xmm0, xmm6 - punpckhwd xmm1, xmm6 - psrad xmm0, 16 - psrad xmm1, 16 - paddd xmm0, xmm1 - movdqa xmm1, xmm0 - - movdqa xmm6, xmm7 - punpckldq xmm6, xmm5 - punpckhdq xmm7, xmm5 - paddd xmm6, xmm7 - - punpckldq xmm0, xmm5 - punpckhdq xmm1, xmm5 - paddd xmm0, xmm1 - - movdqa xmm7, xmm6 - movdqa xmm1, xmm0 - - psrldq xmm7, 8 - psrldq xmm1, 8 - - paddd xmm6, xmm7 - paddd xmm0, xmm1 - - mov rsi, arg(5) ;[Sum] - mov rdi, arg(6) ;[SSE] - - movd [rsi], xmm0 - movd [rdi], xmm6 - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_half_horiz_variance8x_h_sse2 -;( -; unsigned char *ref_ptr, -; int ref_pixels_per_line, -; unsigned char *src_ptr, -; int src_pixels_per_line, -; unsigned int Height, -; int *sum, -; unsigned int *sumsquared -;) -global sym(vp8_half_horiz_variance8x_h_sse2) PRIVATE -sym(vp8_half_horiz_variance8x_h_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - -%if ABI_IS_32BIT=0 - movsxd r8, dword ptr arg(1) ;ref_pixels_per_line - movsxd r9, dword ptr arg(3) ;src_pixels_per_line -%endif - - pxor xmm6, xmm6 ; error accumulator - pxor xmm7, xmm7 ; sse eaccumulator - mov rsi, arg(0) ;ref_ptr ; - - mov rdi, arg(2) ;src_ptr ; - movsxd rcx, dword ptr arg(4) ;Height ; - - pxor xmm0, xmm0 ; -vp8_half_horiz_variance8x_h_1: - movq xmm5, QWORD PTR [rsi] ; xmm5 = s0,s1,s2..s8 - movq xmm3, QWORD PTR [rsi+1] ; xmm3 = s1,s2,s3..s9 - - pavgb xmm5, xmm3 ; xmm5 = avg(xmm1,xmm3) - punpcklbw xmm5, xmm0 ; xmm5 = words of above - - movq xmm3, QWORD PTR [rdi] ; xmm3 = d0,d1,d2..d8 - punpcklbw xmm3, xmm0 ; xmm3 = words of above - - psubw xmm5, xmm3 ; xmm5 -= xmm3 - paddw xmm6, xmm5 ; xmm6 += accumulated column differences - pmaddwd xmm5, xmm5 ; xmm5 *= xmm5 - paddd xmm7, xmm5 ; xmm7 += accumulated square column differences - -%if ABI_IS_32BIT - add esi, dword ptr arg(1) ;ref_pixels_per_line ; next source - add edi, dword ptr arg(3) ;src_pixels_per_line ; next destination -%else - add rsi, r8 - add rdi, r9 -%endif - sub rcx, 1 ; - jnz vp8_half_horiz_variance8x_h_1 ; - - movdq2q mm6, xmm6 ; - movdq2q mm7, xmm7 ; - - psrldq xmm6, 8 - psrldq xmm7, 8 - - movdq2q mm2, xmm6 - movdq2q mm3, xmm7 - - paddw mm6, mm2 - paddd mm7, mm3 - - pxor mm3, mm3 ; - pxor mm2, mm2 ; - - punpcklwd mm2, mm6 ; - punpckhwd mm3, mm6 ; - - paddd mm2, mm3 ; - movq mm6, mm2 ; - - psrlq mm6, 32 ; - paddd mm2, mm6 ; - - psrad mm2, 16 ; - movq mm4, mm7 ; - - psrlq mm4, 32 ; - paddd mm4, mm7 ; - - mov rsi, arg(5) ; sum - mov rdi, arg(6) ; sumsquared - - movd [rsi], mm2 ; - movd [rdi], mm4 ; - - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -;void vp8_half_horiz_variance16x_h_sse2 -;( -; unsigned char *ref_ptr, -; int ref_pixels_per_line, -; unsigned char *src_ptr, -; int src_pixels_per_line, -; unsigned int Height, -; int *sum, -; unsigned int *sumsquared -;) -global sym(vp8_half_horiz_variance16x_h_sse2) PRIVATE -sym(vp8_half_horiz_variance16x_h_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - pxor xmm6, xmm6 ; error accumulator - pxor xmm7, xmm7 ; sse eaccumulator - mov rsi, arg(0) ;ref_ptr ; - - mov rdi, arg(2) ;src_ptr ; - movsxd rcx, dword ptr arg(4) ;Height ; - movsxd rax, dword ptr arg(1) ;ref_pixels_per_line - movsxd rdx, dword ptr arg(3) ;src_pixels_per_line - - pxor xmm0, xmm0 ; - -vp8_half_horiz_variance16x_h_1: - movdqu xmm5, XMMWORD PTR [rsi] ; xmm5 = s0,s1,s2..s15 - movdqu xmm3, XMMWORD PTR [rsi+1] ; xmm3 = s1,s2,s3..s16 - - pavgb xmm5, xmm3 ; xmm5 = avg(xmm1,xmm3) - movdqa xmm1, xmm5 - punpcklbw xmm5, xmm0 ; xmm5 = words of above - punpckhbw xmm1, xmm0 - - movq xmm3, QWORD PTR [rdi] ; xmm3 = d0,d1,d2..d7 - punpcklbw xmm3, xmm0 ; xmm3 = words of above - movq xmm2, QWORD PTR [rdi+8] - punpcklbw xmm2, xmm0 - - psubw xmm5, xmm3 ; xmm5 -= xmm3 - psubw xmm1, xmm2 - paddw xmm6, xmm5 ; xmm6 += accumulated column differences - paddw xmm6, xmm1 - pmaddwd xmm5, xmm5 ; xmm5 *= xmm5 - pmaddwd xmm1, xmm1 - paddd xmm7, xmm5 ; xmm7 += accumulated square column differences - paddd xmm7, xmm1 - - lea rsi, [rsi + rax] - lea rdi, [rdi + rdx] - - sub rcx, 1 ; - jnz vp8_half_horiz_variance16x_h_1 ; - - pxor xmm1, xmm1 - pxor xmm5, xmm5 - - punpcklwd xmm0, xmm6 - punpckhwd xmm1, xmm6 - psrad xmm0, 16 - psrad xmm1, 16 - paddd xmm0, xmm1 - movdqa xmm1, xmm0 - - movdqa xmm6, xmm7 - punpckldq xmm6, xmm5 - punpckhdq xmm7, xmm5 - paddd xmm6, xmm7 - - punpckldq xmm0, xmm5 - punpckhdq xmm1, xmm5 - paddd xmm0, xmm1 - - movdqa xmm7, xmm6 - movdqa xmm1, xmm0 - - psrldq xmm7, 8 - psrldq xmm1, 8 - - paddd xmm6, xmm7 - paddd xmm0, xmm1 - - mov rsi, arg(5) ;[Sum] - mov rdi, arg(6) ;[SSE] - - movd [rsi], xmm0 - movd [rdi], xmm6 - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -SECTION_RODATA -; short xmm_bi_rd[8] = { 64, 64, 64, 64,64, 64, 64, 64}; -align 16 -xmm_bi_rd: - times 8 dw 64 -align 16 -vp8_bilinear_filters_sse2: - dw 128, 128, 128, 128, 128, 128, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0 - dw 112, 112, 112, 112, 112, 112, 112, 112, 16, 16, 16, 16, 16, 16, 16, 16 - dw 96, 96, 96, 96, 96, 96, 96, 96, 32, 32, 32, 32, 32, 32, 32, 32 - dw 80, 80, 80, 80, 80, 80, 80, 80, 48, 48, 48, 48, 48, 48, 48, 48 - dw 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 - dw 48, 48, 48, 48, 48, 48, 48, 48, 80, 80, 80, 80, 80, 80, 80, 80 - dw 32, 32, 32, 32, 32, 32, 32, 32, 96, 96, 96, 96, 96, 96, 96, 96 - dw 16, 16, 16, 16, 16, 16, 16, 16, 112, 112, 112, 112, 112, 112, 112, 112 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/variance_impl_ssse3.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/variance_impl_ssse3.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/variance_impl_ssse3.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/variance_impl_ssse3.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,364 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -%define xmm_filter_shift 7 - - -;void vp8_filter_block2d_bil_var_ssse3 -;( -; unsigned char *ref_ptr, -; int ref_pixels_per_line, -; unsigned char *src_ptr, -; int src_pixels_per_line, -; unsigned int Height, -; int xoffset, -; int yoffset, -; int *sum, -; unsigned int *sumsquared;; -; -;) -;Note: The filter coefficient at offset=0 is 128. Since the second register -;for Pmaddubsw is signed bytes, we must calculate zero offset seperately. -global sym(vp8_filter_block2d_bil_var_ssse3) PRIVATE -sym(vp8_filter_block2d_bil_var_ssse3): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 9 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - pxor xmm6, xmm6 - pxor xmm7, xmm7 - - lea rcx, [GLOBAL(vp8_bilinear_filters_ssse3)] - movsxd rax, dword ptr arg(5) ; xoffset - - cmp rax, 0 ; skip first_pass filter if xoffset=0 - je .filter_block2d_bil_var_ssse3_sp_only - - shl rax, 4 ; point to filter coeff with xoffset - lea rax, [rax + rcx] ; HFilter - - movsxd rdx, dword ptr arg(6) ; yoffset - - cmp rdx, 0 ; skip second_pass filter if yoffset=0 - je .filter_block2d_bil_var_ssse3_fp_only - - shl rdx, 4 - lea rdx, [rdx + rcx] ; VFilter - - mov rsi, arg(0) ;ref_ptr - mov rdi, arg(2) ;src_ptr - movsxd rcx, dword ptr arg(4) ;Height - - movdqu xmm0, XMMWORD PTR [rsi] - movdqu xmm1, XMMWORD PTR [rsi+1] - movdqa xmm2, xmm0 - - punpcklbw xmm0, xmm1 - punpckhbw xmm2, xmm1 - pmaddubsw xmm0, [rax] - pmaddubsw xmm2, [rax] - - paddw xmm0, [GLOBAL(xmm_bi_rd)] - paddw xmm2, [GLOBAL(xmm_bi_rd)] - psraw xmm0, xmm_filter_shift - psraw xmm2, xmm_filter_shift - - packuswb xmm0, xmm2 - -%if ABI_IS_32BIT - add rsi, dword ptr arg(1) ;ref_pixels_per_line -%else - movsxd r8, dword ptr arg(1) ;ref_pixels_per_line - movsxd r9, dword ptr arg(3) ;src_pixels_per_line - lea rsi, [rsi + r8] -%endif - -.filter_block2d_bil_var_ssse3_loop: - movdqu xmm1, XMMWORD PTR [rsi] - movdqu xmm2, XMMWORD PTR [rsi+1] - movdqa xmm3, xmm1 - - punpcklbw xmm1, xmm2 - punpckhbw xmm3, xmm2 - pmaddubsw xmm1, [rax] - pmaddubsw xmm3, [rax] - - paddw xmm1, [GLOBAL(xmm_bi_rd)] - paddw xmm3, [GLOBAL(xmm_bi_rd)] - psraw xmm1, xmm_filter_shift - psraw xmm3, xmm_filter_shift - packuswb xmm1, xmm3 - - movdqa xmm2, xmm0 - movdqa xmm0, xmm1 - movdqa xmm3, xmm2 - - punpcklbw xmm2, xmm1 - punpckhbw xmm3, xmm1 - pmaddubsw xmm2, [rdx] - pmaddubsw xmm3, [rdx] - - paddw xmm2, [GLOBAL(xmm_bi_rd)] - paddw xmm3, [GLOBAL(xmm_bi_rd)] - psraw xmm2, xmm_filter_shift - psraw xmm3, xmm_filter_shift - - movq xmm1, QWORD PTR [rdi] - pxor xmm4, xmm4 - punpcklbw xmm1, xmm4 - movq xmm5, QWORD PTR [rdi+8] - punpcklbw xmm5, xmm4 - - psubw xmm2, xmm1 - psubw xmm3, xmm5 - paddw xmm6, xmm2 - paddw xmm6, xmm3 - pmaddwd xmm2, xmm2 - pmaddwd xmm3, xmm3 - paddd xmm7, xmm2 - paddd xmm7, xmm3 - -%if ABI_IS_32BIT - add rsi, dword ptr arg(1) ;ref_pixels_per_line - add rdi, dword ptr arg(3) ;src_pixels_per_line -%else - lea rsi, [rsi + r8] - lea rdi, [rdi + r9] -%endif - - sub rcx, 1 - jnz .filter_block2d_bil_var_ssse3_loop - - jmp .filter_block2d_bil_variance - -.filter_block2d_bil_var_ssse3_sp_only: - movsxd rdx, dword ptr arg(6) ; yoffset - - cmp rdx, 0 ; Both xoffset =0 and yoffset=0 - je .filter_block2d_bil_var_ssse3_full_pixel - - shl rdx, 4 - lea rdx, [rdx + rcx] ; VFilter - - mov rsi, arg(0) ;ref_ptr - mov rdi, arg(2) ;src_ptr - movsxd rcx, dword ptr arg(4) ;Height - movsxd rax, dword ptr arg(1) ;ref_pixels_per_line - - movdqu xmm1, XMMWORD PTR [rsi] - movdqa xmm0, xmm1 - -%if ABI_IS_32BIT=0 - movsxd r9, dword ptr arg(3) ;src_pixels_per_line -%endif - - lea rsi, [rsi + rax] - -.filter_block2d_bil_sp_only_loop: - movdqu xmm3, XMMWORD PTR [rsi] - movdqa xmm2, xmm1 - movdqa xmm0, xmm3 - - punpcklbw xmm1, xmm3 - punpckhbw xmm2, xmm3 - pmaddubsw xmm1, [rdx] - pmaddubsw xmm2, [rdx] - - paddw xmm1, [GLOBAL(xmm_bi_rd)] - paddw xmm2, [GLOBAL(xmm_bi_rd)] - psraw xmm1, xmm_filter_shift - psraw xmm2, xmm_filter_shift - - movq xmm3, QWORD PTR [rdi] - pxor xmm4, xmm4 - punpcklbw xmm3, xmm4 - movq xmm5, QWORD PTR [rdi+8] - punpcklbw xmm5, xmm4 - - psubw xmm1, xmm3 - psubw xmm2, xmm5 - paddw xmm6, xmm1 - paddw xmm6, xmm2 - pmaddwd xmm1, xmm1 - pmaddwd xmm2, xmm2 - paddd xmm7, xmm1 - paddd xmm7, xmm2 - - movdqa xmm1, xmm0 - lea rsi, [rsi + rax] ;ref_pixels_per_line - -%if ABI_IS_32BIT - add rdi, dword ptr arg(3) ;src_pixels_per_line -%else - lea rdi, [rdi + r9] -%endif - - sub rcx, 1 - jnz .filter_block2d_bil_sp_only_loop - - jmp .filter_block2d_bil_variance - -.filter_block2d_bil_var_ssse3_full_pixel: - mov rsi, arg(0) ;ref_ptr - mov rdi, arg(2) ;src_ptr - movsxd rcx, dword ptr arg(4) ;Height - movsxd rax, dword ptr arg(1) ;ref_pixels_per_line - movsxd rdx, dword ptr arg(3) ;src_pixels_per_line - pxor xmm0, xmm0 - -.filter_block2d_bil_full_pixel_loop: - movq xmm1, QWORD PTR [rsi] - punpcklbw xmm1, xmm0 - movq xmm2, QWORD PTR [rsi+8] - punpcklbw xmm2, xmm0 - - movq xmm3, QWORD PTR [rdi] - punpcklbw xmm3, xmm0 - movq xmm4, QWORD PTR [rdi+8] - punpcklbw xmm4, xmm0 - - psubw xmm1, xmm3 - psubw xmm2, xmm4 - paddw xmm6, xmm1 - paddw xmm6, xmm2 - pmaddwd xmm1, xmm1 - pmaddwd xmm2, xmm2 - paddd xmm7, xmm1 - paddd xmm7, xmm2 - - lea rsi, [rsi + rax] ;ref_pixels_per_line - lea rdi, [rdi + rdx] ;src_pixels_per_line - sub rcx, 1 - jnz .filter_block2d_bil_full_pixel_loop - - jmp .filter_block2d_bil_variance - -.filter_block2d_bil_var_ssse3_fp_only: - mov rsi, arg(0) ;ref_ptr - mov rdi, arg(2) ;src_ptr - movsxd rcx, dword ptr arg(4) ;Height - movsxd rdx, dword ptr arg(1) ;ref_pixels_per_line - - pxor xmm0, xmm0 - -%if ABI_IS_32BIT=0 - movsxd r9, dword ptr arg(3) ;src_pixels_per_line -%endif - -.filter_block2d_bil_fp_only_loop: - movdqu xmm1, XMMWORD PTR [rsi] - movdqu xmm2, XMMWORD PTR [rsi+1] - movdqa xmm3, xmm1 - - punpcklbw xmm1, xmm2 - punpckhbw xmm3, xmm2 - pmaddubsw xmm1, [rax] - pmaddubsw xmm3, [rax] - - paddw xmm1, [GLOBAL(xmm_bi_rd)] - paddw xmm3, [GLOBAL(xmm_bi_rd)] - psraw xmm1, xmm_filter_shift - psraw xmm3, xmm_filter_shift - - movq xmm2, XMMWORD PTR [rdi] - pxor xmm4, xmm4 - punpcklbw xmm2, xmm4 - movq xmm5, QWORD PTR [rdi+8] - punpcklbw xmm5, xmm4 - - psubw xmm1, xmm2 - psubw xmm3, xmm5 - paddw xmm6, xmm1 - paddw xmm6, xmm3 - pmaddwd xmm1, xmm1 - pmaddwd xmm3, xmm3 - paddd xmm7, xmm1 - paddd xmm7, xmm3 - - lea rsi, [rsi + rdx] -%if ABI_IS_32BIT - add rdi, dword ptr arg(3) ;src_pixels_per_line -%else - lea rdi, [rdi + r9] -%endif - - sub rcx, 1 - jnz .filter_block2d_bil_fp_only_loop - - jmp .filter_block2d_bil_variance - -.filter_block2d_bil_variance: - pxor xmm0, xmm0 - pxor xmm1, xmm1 - pxor xmm5, xmm5 - - punpcklwd xmm0, xmm6 - punpckhwd xmm1, xmm6 - psrad xmm0, 16 - psrad xmm1, 16 - paddd xmm0, xmm1 - movdqa xmm1, xmm0 - - movdqa xmm6, xmm7 - punpckldq xmm6, xmm5 - punpckhdq xmm7, xmm5 - paddd xmm6, xmm7 - - punpckldq xmm0, xmm5 - punpckhdq xmm1, xmm5 - paddd xmm0, xmm1 - - movdqa xmm7, xmm6 - movdqa xmm1, xmm0 - - psrldq xmm7, 8 - psrldq xmm1, 8 - - paddd xmm6, xmm7 - paddd xmm0, xmm1 - - mov rsi, arg(7) ;[Sum] - mov rdi, arg(8) ;[SSE] - - movd [rsi], xmm0 - movd [rdi], xmm6 - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - -SECTION_RODATA -align 16 -xmm_bi_rd: - times 8 dw 64 -align 16 -vp8_bilinear_filters_ssse3: - times 8 db 128, 0 - times 8 db 112, 16 - times 8 db 96, 32 - times 8 db 80, 48 - times 8 db 64, 64 - times 8 db 48, 80 - times 8 db 32, 96 - times 8 db 16, 112 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/variance_mmx.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/variance_mmx.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/variance_mmx.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/variance_mmx.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,397 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vpx_config.h" -#include "vp8/common/variance.h" -#include "vpx_ports/mem.h" -#include "vp8/common/x86/filter_x86.h" - -extern void filter_block1d_h6_mmx -( - const unsigned char *src_ptr, - unsigned short *output_ptr, - unsigned int src_pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - short *filter -); -extern void filter_block1d_v6_mmx -( - const short *src_ptr, - unsigned char *output_ptr, - unsigned int pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - short *filter -); - -extern unsigned int vp8_get_mb_ss_mmx(const short *src_ptr); -extern unsigned int vp8_get8x8var_mmx -( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *SSE, - int *Sum -); -extern unsigned int vp8_get4x4var_mmx -( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *SSE, - int *Sum -); -extern void vp8_filter_block2d_bil4x4_var_mmx -( - const unsigned char *ref_ptr, - int ref_pixels_per_line, - const unsigned char *src_ptr, - int src_pixels_per_line, - const short *HFilter, - const short *VFilter, - int *sum, - unsigned int *sumsquared -); -extern void vp8_filter_block2d_bil_var_mmx -( - const unsigned char *ref_ptr, - int ref_pixels_per_line, - const unsigned char *src_ptr, - int src_pixels_per_line, - unsigned int Height, - const short *HFilter, - const short *VFilter, - int *sum, - unsigned int *sumsquared -); - - -unsigned int vp8_variance4x4_mmx( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - unsigned int var; - int avg; - - vp8_get4x4var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg) ; - *sse = var; - return (var - (((unsigned int)avg * avg) >> 4)); - -} - -unsigned int vp8_variance8x8_mmx( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - unsigned int var; - int avg; - - vp8_get8x8var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg) ; - *sse = var; - - return (var - (((unsigned int)avg * avg) >> 6)); - -} - -unsigned int vp8_mse16x16_mmx( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - unsigned int sse0, sse1, sse2, sse3, var; - int sum0, sum1, sum2, sum3; - - - vp8_get8x8var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0) ; - vp8_get8x8var_mmx(src_ptr + 8, source_stride, ref_ptr + 8, recon_stride, &sse1, &sum1); - vp8_get8x8var_mmx(src_ptr + 8 * source_stride, source_stride, ref_ptr + 8 * recon_stride, recon_stride, &sse2, &sum2) ; - vp8_get8x8var_mmx(src_ptr + 8 * source_stride + 8, source_stride, ref_ptr + 8 * recon_stride + 8, recon_stride, &sse3, &sum3); - - var = sse0 + sse1 + sse2 + sse3; - *sse = var; - return var; -} - - -unsigned int vp8_variance16x16_mmx( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - unsigned int sse0, sse1, sse2, sse3, var; - int sum0, sum1, sum2, sum3, avg; - - - vp8_get8x8var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0) ; - vp8_get8x8var_mmx(src_ptr + 8, source_stride, ref_ptr + 8, recon_stride, &sse1, &sum1); - vp8_get8x8var_mmx(src_ptr + 8 * source_stride, source_stride, ref_ptr + 8 * recon_stride, recon_stride, &sse2, &sum2) ; - vp8_get8x8var_mmx(src_ptr + 8 * source_stride + 8, source_stride, ref_ptr + 8 * recon_stride + 8, recon_stride, &sse3, &sum3); - - var = sse0 + sse1 + sse2 + sse3; - avg = sum0 + sum1 + sum2 + sum3; - *sse = var; - return (var - (((unsigned int)avg * avg) >> 8)); -} - -unsigned int vp8_variance16x8_mmx( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - unsigned int sse0, sse1, var; - int sum0, sum1, avg; - - vp8_get8x8var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0) ; - vp8_get8x8var_mmx(src_ptr + 8, source_stride, ref_ptr + 8, recon_stride, &sse1, &sum1); - - var = sse0 + sse1; - avg = sum0 + sum1; - *sse = var; - return (var - (((unsigned int)avg * avg) >> 7)); - -} - - -unsigned int vp8_variance8x16_mmx( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - unsigned int sse0, sse1, var; - int sum0, sum1, avg; - - vp8_get8x8var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0) ; - vp8_get8x8var_mmx(src_ptr + 8 * source_stride, source_stride, ref_ptr + 8 * recon_stride, recon_stride, &sse1, &sum1) ; - - var = sse0 + sse1; - avg = sum0 + sum1; - *sse = var; - - return (var - (((unsigned int)avg * avg) >> 7)); - -} - - -unsigned int vp8_sub_pixel_variance4x4_mmx -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse) - -{ - int xsum; - unsigned int xxsum; - vp8_filter_block2d_bil4x4_var_mmx( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, - vp8_bilinear_filters_x86_4[xoffset], vp8_bilinear_filters_x86_4[yoffset], - &xsum, &xxsum - ); - *sse = xxsum; - return (xxsum - (((unsigned int)xsum * xsum) >> 4)); -} - - -unsigned int vp8_sub_pixel_variance8x8_mmx -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse -) -{ - - int xsum; - unsigned int xxsum; - vp8_filter_block2d_bil_var_mmx( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 8, - vp8_bilinear_filters_x86_4[xoffset], vp8_bilinear_filters_x86_4[yoffset], - &xsum, &xxsum - ); - *sse = xxsum; - return (xxsum - (((unsigned int)xsum * xsum) >> 6)); -} - -unsigned int vp8_sub_pixel_variance16x16_mmx -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse -) -{ - - int xsum0, xsum1; - unsigned int xxsum0, xxsum1; - - - vp8_filter_block2d_bil_var_mmx( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 16, - vp8_bilinear_filters_x86_4[xoffset], vp8_bilinear_filters_x86_4[yoffset], - &xsum0, &xxsum0 - ); - - - vp8_filter_block2d_bil_var_mmx( - src_ptr + 8, src_pixels_per_line, - dst_ptr + 8, dst_pixels_per_line, 16, - vp8_bilinear_filters_x86_4[xoffset], vp8_bilinear_filters_x86_4[yoffset], - &xsum1, &xxsum1 - ); - - xsum0 += xsum1; - xxsum0 += xxsum1; - - *sse = xxsum0; - return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8)); - - -} - -unsigned int vp8_sub_pixel_mse16x16_mmx( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse -) -{ - vp8_sub_pixel_variance16x16_mmx(src_ptr, src_pixels_per_line, xoffset, yoffset, dst_ptr, dst_pixels_per_line, sse); - return *sse; -} - -unsigned int vp8_sub_pixel_variance16x8_mmx -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse -) -{ - int xsum0, xsum1; - unsigned int xxsum0, xxsum1; - - - vp8_filter_block2d_bil_var_mmx( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 8, - vp8_bilinear_filters_x86_4[xoffset], vp8_bilinear_filters_x86_4[yoffset], - &xsum0, &xxsum0 - ); - - - vp8_filter_block2d_bil_var_mmx( - src_ptr + 8, src_pixels_per_line, - dst_ptr + 8, dst_pixels_per_line, 8, - vp8_bilinear_filters_x86_4[xoffset], vp8_bilinear_filters_x86_4[yoffset], - &xsum1, &xxsum1 - ); - - xsum0 += xsum1; - xxsum0 += xxsum1; - - *sse = xxsum0; - return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 7)); -} - -unsigned int vp8_sub_pixel_variance8x16_mmx -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse -) -{ - int xsum; - unsigned int xxsum; - vp8_filter_block2d_bil_var_mmx( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 16, - vp8_bilinear_filters_x86_4[xoffset], vp8_bilinear_filters_x86_4[yoffset], - &xsum, &xxsum - ); - *sse = xxsum; - return (xxsum - (((unsigned int)xsum * xsum) >> 7)); -} - - -unsigned int vp8_variance_halfpixvar16x16_h_mmx( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - return vp8_sub_pixel_variance16x16_mmx(src_ptr, source_stride, 4, 0, - ref_ptr, recon_stride, sse); -} - - -unsigned int vp8_variance_halfpixvar16x16_v_mmx( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - return vp8_sub_pixel_variance16x16_mmx(src_ptr, source_stride, 0, 4, - ref_ptr, recon_stride, sse); -} - - -unsigned int vp8_variance_halfpixvar16x16_hv_mmx( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - return vp8_sub_pixel_variance16x16_mmx(src_ptr, source_stride, 4, 4, - ref_ptr, recon_stride, sse); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/variance_sse2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/variance_sse2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/variance_sse2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/variance_sse2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,557 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vpx_config.h" -#include "vp8/common/variance.h" -#include "vpx_ports/mem.h" -#include "vp8/common/x86/filter_x86.h" - -extern void filter_block1d_h6_mmx(const unsigned char *src_ptr, unsigned short *output_ptr, unsigned int src_pixels_per_line, unsigned int pixel_step, unsigned int output_height, unsigned int output_width, short *filter); -extern void filter_block1d_v6_mmx(const short *src_ptr, unsigned char *output_ptr, unsigned int pixels_per_line, unsigned int pixel_step, unsigned int output_height, unsigned int output_width, short *filter); -extern void filter_block1d8_h6_sse2(const unsigned char *src_ptr, unsigned short *output_ptr, unsigned int src_pixels_per_line, unsigned int pixel_step, unsigned int output_height, unsigned int output_width, short *filter); -extern void filter_block1d8_v6_sse2(const short *src_ptr, unsigned char *output_ptr, unsigned int pixels_per_line, unsigned int pixel_step, unsigned int output_height, unsigned int output_width, short *filter); - -extern void vp8_filter_block2d_bil4x4_var_mmx -( - const unsigned char *ref_ptr, - int ref_pixels_per_line, - const unsigned char *src_ptr, - int src_pixels_per_line, - const short *HFilter, - const short *VFilter, - int *sum, - unsigned int *sumsquared -); - -extern unsigned int vp8_get4x4var_mmx -( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *SSE, - int *Sum -); - -unsigned int vp8_get_mb_ss_sse2 -( - const short *src_ptr -); -unsigned int vp8_get16x16var_sse2 -( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *SSE, - int *Sum -); -unsigned int vp8_get8x8var_sse2 -( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *SSE, - int *Sum -); -void vp8_filter_block2d_bil_var_sse2 -( - const unsigned char *ref_ptr, - int ref_pixels_per_line, - const unsigned char *src_ptr, - int src_pixels_per_line, - unsigned int Height, - int xoffset, - int yoffset, - int *sum, - unsigned int *sumsquared -); -void vp8_half_horiz_vert_variance8x_h_sse2 -( - const unsigned char *ref_ptr, - int ref_pixels_per_line, - const unsigned char *src_ptr, - int src_pixels_per_line, - unsigned int Height, - int *sum, - unsigned int *sumsquared -); -void vp8_half_horiz_vert_variance16x_h_sse2 -( - const unsigned char *ref_ptr, - int ref_pixels_per_line, - const unsigned char *src_ptr, - int src_pixels_per_line, - unsigned int Height, - int *sum, - unsigned int *sumsquared -); -void vp8_half_horiz_variance8x_h_sse2 -( - const unsigned char *ref_ptr, - int ref_pixels_per_line, - const unsigned char *src_ptr, - int src_pixels_per_line, - unsigned int Height, - int *sum, - unsigned int *sumsquared -); -void vp8_half_horiz_variance16x_h_sse2 -( - const unsigned char *ref_ptr, - int ref_pixels_per_line, - const unsigned char *src_ptr, - int src_pixels_per_line, - unsigned int Height, - int *sum, - unsigned int *sumsquared -); -void vp8_half_vert_variance8x_h_sse2 -( - const unsigned char *ref_ptr, - int ref_pixels_per_line, - const unsigned char *src_ptr, - int src_pixels_per_line, - unsigned int Height, - int *sum, - unsigned int *sumsquared -); -void vp8_half_vert_variance16x_h_sse2 -( - const unsigned char *ref_ptr, - int ref_pixels_per_line, - const unsigned char *src_ptr, - int src_pixels_per_line, - unsigned int Height, - int *sum, - unsigned int *sumsquared -); - -unsigned int vp8_variance4x4_wmt( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - unsigned int var; - int avg; - - vp8_get4x4var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg) ; - *sse = var; - return (var - (((unsigned int)avg * avg) >> 4)); - -} - -unsigned int vp8_variance8x8_wmt -( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - unsigned int var; - int avg; - - vp8_get8x8var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg) ; - *sse = var; - return (var - (((unsigned int)avg * avg) >> 6)); - -} - - -unsigned int vp8_variance16x16_wmt -( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - unsigned int sse0; - int sum0; - - - vp8_get16x16var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0) ; - *sse = sse0; - return (sse0 - (((unsigned int)sum0 * sum0) >> 8)); -} -unsigned int vp8_mse16x16_wmt( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - - unsigned int sse0; - int sum0; - vp8_get16x16var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0) ; - *sse = sse0; - return sse0; - -} - - -unsigned int vp8_variance16x8_wmt -( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - unsigned int sse0, sse1, var; - int sum0, sum1, avg; - - vp8_get8x8var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0) ; - vp8_get8x8var_sse2(src_ptr + 8, source_stride, ref_ptr + 8, recon_stride, &sse1, &sum1); - - var = sse0 + sse1; - avg = sum0 + sum1; - *sse = var; - return (var - (((unsigned int)avg * avg) >> 7)); - -} - -unsigned int vp8_variance8x16_wmt -( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) -{ - unsigned int sse0, sse1, var; - int sum0, sum1, avg; - - vp8_get8x8var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0) ; - vp8_get8x8var_sse2(src_ptr + 8 * source_stride, source_stride, ref_ptr + 8 * recon_stride, recon_stride, &sse1, &sum1) ; - - var = sse0 + sse1; - avg = sum0 + sum1; - *sse = var; - return (var - (((unsigned int)avg * avg) >> 7)); - -} - -unsigned int vp8_sub_pixel_variance4x4_wmt -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse -) -{ - int xsum; - unsigned int xxsum; - vp8_filter_block2d_bil4x4_var_mmx( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, - vp8_bilinear_filters_x86_4[xoffset], vp8_bilinear_filters_x86_4[yoffset], - &xsum, &xxsum - ); - *sse = xxsum; - return (xxsum - (((unsigned int)xsum * xsum) >> 4)); -} - - -unsigned int vp8_sub_pixel_variance8x8_wmt -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse -) -{ - int xsum; - unsigned int xxsum; - - if (xoffset == 4 && yoffset == 0) - { - vp8_half_horiz_variance8x_h_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 8, - &xsum, &xxsum); - } - else if (xoffset == 0 && yoffset == 4) - { - vp8_half_vert_variance8x_h_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 8, - &xsum, &xxsum); - } - else if (xoffset == 4 && yoffset == 4) - { - vp8_half_horiz_vert_variance8x_h_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 8, - &xsum, &xxsum); - } - else - { - vp8_filter_block2d_bil_var_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 8, - xoffset, yoffset, - &xsum, &xxsum); - } - - *sse = xxsum; - return (xxsum - (((unsigned int)xsum * xsum) >> 6)); -} - -unsigned int vp8_sub_pixel_variance16x16_wmt -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse -) -{ - int xsum0, xsum1; - unsigned int xxsum0, xxsum1; - - - /* note we could avoid these if statements if the calling function - * just called the appropriate functions inside. - */ - if (xoffset == 4 && yoffset == 0) - { - vp8_half_horiz_variance16x_h_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 16, - &xsum0, &xxsum0); - } - else if (xoffset == 0 && yoffset == 4) - { - vp8_half_vert_variance16x_h_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 16, - &xsum0, &xxsum0); - } - else if (xoffset == 4 && yoffset == 4) - { - vp8_half_horiz_vert_variance16x_h_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 16, - &xsum0, &xxsum0); - } - else - { - vp8_filter_block2d_bil_var_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 16, - xoffset, yoffset, - &xsum0, &xxsum0 - ); - - vp8_filter_block2d_bil_var_sse2( - src_ptr + 8, src_pixels_per_line, - dst_ptr + 8, dst_pixels_per_line, 16, - xoffset, yoffset, - &xsum1, &xxsum1 - ); - xsum0 += xsum1; - xxsum0 += xxsum1; - } - - *sse = xxsum0; - return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8)); -} - -unsigned int vp8_sub_pixel_mse16x16_wmt( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse -) -{ - vp8_sub_pixel_variance16x16_wmt(src_ptr, src_pixels_per_line, xoffset, yoffset, dst_ptr, dst_pixels_per_line, sse); - return *sse; -} - -unsigned int vp8_sub_pixel_variance16x8_wmt -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse - -) -{ - int xsum0, xsum1; - unsigned int xxsum0, xxsum1; - - if (xoffset == 4 && yoffset == 0) - { - vp8_half_horiz_variance16x_h_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 8, - &xsum0, &xxsum0); - } - else if (xoffset == 0 && yoffset == 4) - { - vp8_half_vert_variance16x_h_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 8, - &xsum0, &xxsum0); - } - else if (xoffset == 4 && yoffset == 4) - { - vp8_half_horiz_vert_variance16x_h_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 8, - &xsum0, &xxsum0); - } - else - { - vp8_filter_block2d_bil_var_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 8, - xoffset, yoffset, - &xsum0, &xxsum0); - - vp8_filter_block2d_bil_var_sse2( - src_ptr + 8, src_pixels_per_line, - dst_ptr + 8, dst_pixels_per_line, 8, - xoffset, yoffset, - &xsum1, &xxsum1); - xsum0 += xsum1; - xxsum0 += xxsum1; - } - - *sse = xxsum0; - return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 7)); -} - -unsigned int vp8_sub_pixel_variance8x16_wmt -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse -) -{ - int xsum; - unsigned int xxsum; - - if (xoffset == 4 && yoffset == 0) - { - vp8_half_horiz_variance8x_h_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 16, - &xsum, &xxsum); - } - else if (xoffset == 0 && yoffset == 4) - { - vp8_half_vert_variance8x_h_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 16, - &xsum, &xxsum); - } - else if (xoffset == 4 && yoffset == 4) - { - vp8_half_horiz_vert_variance8x_h_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 16, - &xsum, &xxsum); - } - else - { - vp8_filter_block2d_bil_var_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 16, - xoffset, yoffset, - &xsum, &xxsum); - } - - *sse = xxsum; - return (xxsum - (((unsigned int)xsum * xsum) >> 7)); -} - - -unsigned int vp8_variance_halfpixvar16x16_h_wmt( - const unsigned char *src_ptr, - int src_pixels_per_line, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse) -{ - int xsum0; - unsigned int xxsum0; - - vp8_half_horiz_variance16x_h_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 16, - &xsum0, &xxsum0); - - *sse = xxsum0; - return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8)); -} - - -unsigned int vp8_variance_halfpixvar16x16_v_wmt( - const unsigned char *src_ptr, - int src_pixels_per_line, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse) -{ - int xsum0; - unsigned int xxsum0; - vp8_half_vert_variance16x_h_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 16, - &xsum0, &xxsum0); - - *sse = xxsum0; - return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8)); -} - - -unsigned int vp8_variance_halfpixvar16x16_hv_wmt( - const unsigned char *src_ptr, - int src_pixels_per_line, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse) -{ - int xsum0; - unsigned int xxsum0; - - vp8_half_horiz_vert_variance16x_h_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 16, - &xsum0, &xxsum0); - - *sse = xxsum0; - return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8)); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/variance_ssse3.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/variance_ssse3.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/variance_ssse3.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/variance_ssse3.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,165 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vpx_config.h" -#include "vp8/common/variance.h" -#include "vpx_ports/mem.h" - -extern unsigned int vp8_get16x16var_sse2 -( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *SSE, - int *Sum -); -extern void vp8_half_horiz_vert_variance16x_h_sse2 -( - const unsigned char *ref_ptr, - int ref_pixels_per_line, - const unsigned char *src_ptr, - int src_pixels_per_line, - unsigned int Height, - int *sum, - unsigned int *sumsquared -); -extern void vp8_half_horiz_variance16x_h_sse2 -( - const unsigned char *ref_ptr, - int ref_pixels_per_line, - const unsigned char *src_ptr, - int src_pixels_per_line, - unsigned int Height, - int *sum, - unsigned int *sumsquared -); -extern void vp8_half_vert_variance16x_h_sse2 -( - const unsigned char *ref_ptr, - int ref_pixels_per_line, - const unsigned char *src_ptr, - int src_pixels_per_line, - unsigned int Height, - int *sum, - unsigned int *sumsquared -); -extern void vp8_filter_block2d_bil_var_ssse3 -( - const unsigned char *ref_ptr, - int ref_pixels_per_line, - const unsigned char *src_ptr, - int src_pixels_per_line, - unsigned int Height, - int xoffset, - int yoffset, - int *sum, - unsigned int *sumsquared -); - -unsigned int vp8_sub_pixel_variance16x16_ssse3 -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse -) -{ - int xsum0; - unsigned int xxsum0; - - /* note we could avoid these if statements if the calling function - * just called the appropriate functions inside. - */ - if (xoffset == 4 && yoffset == 0) - { - vp8_half_horiz_variance16x_h_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 16, - &xsum0, &xxsum0); - } - else if (xoffset == 0 && yoffset == 4) - { - vp8_half_vert_variance16x_h_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 16, - &xsum0, &xxsum0); - } - else if (xoffset == 4 && yoffset == 4) - { - vp8_half_horiz_vert_variance16x_h_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 16, - &xsum0, &xxsum0); - } - else - { - vp8_filter_block2d_bil_var_ssse3( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 16, - xoffset, yoffset, - &xsum0, &xxsum0); - } - - *sse = xxsum0; - return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8)); -} - -unsigned int vp8_sub_pixel_variance16x8_ssse3 -( - const unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - const unsigned char *dst_ptr, - int dst_pixels_per_line, - unsigned int *sse - -) -{ - int xsum0; - unsigned int xxsum0; - - if (xoffset == 4 && yoffset == 0) - { - vp8_half_horiz_variance16x_h_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 8, - &xsum0, &xxsum0); - } - else if (xoffset == 0 && yoffset == 4) - { - vp8_half_vert_variance16x_h_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 8, - &xsum0, &xxsum0); - } - else if (xoffset == 4 && yoffset == 4) - { - vp8_half_horiz_vert_variance16x_h_sse2( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 8, - &xsum0, &xxsum0); - } - else - { - vp8_filter_block2d_bil_var_ssse3( - src_ptr, src_pixels_per_line, - dst_ptr, dst_pixels_per_line, 8, - xoffset, yoffset, - &xsum0, &xxsum0); - } - - *sse = xxsum0; - return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 7)); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/vp8_asm_stubs.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/vp8_asm_stubs.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/common/x86/vp8_asm_stubs.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/common/x86/vp8_asm_stubs.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,625 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "vpx_ports/mem.h" -#include "filter_x86.h" - -extern const short vp8_six_tap_mmx[8][6*8]; - -extern void vp8_filter_block1d_h6_mmx -( - unsigned char *src_ptr, - unsigned short *output_ptr, - unsigned int src_pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter -); -extern void vp8_filter_block1dc_v6_mmx -( - unsigned short *src_ptr, - unsigned char *output_ptr, - int output_pitch, - unsigned int pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter -); -extern void vp8_filter_block1d8_h6_sse2 -( - unsigned char *src_ptr, - unsigned short *output_ptr, - unsigned int src_pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter -); -extern void vp8_filter_block1d16_h6_sse2 -( - unsigned char *src_ptr, - unsigned short *output_ptr, - unsigned int src_pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter -); -extern void vp8_filter_block1d8_v6_sse2 -( - unsigned short *src_ptr, - unsigned char *output_ptr, - int dst_ptich, - unsigned int pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter -); -extern void vp8_filter_block1d16_v6_sse2 -( - unsigned short *src_ptr, - unsigned char *output_ptr, - int dst_ptich, - unsigned int pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter -); -extern void vp8_unpack_block1d16_h6_sse2 -( - unsigned char *src_ptr, - unsigned short *output_ptr, - unsigned int src_pixels_per_line, - unsigned int output_height, - unsigned int output_width -); -extern void vp8_filter_block1d8_h6_only_sse2 -( - unsigned char *src_ptr, - unsigned int src_pixels_per_line, - unsigned char *output_ptr, - int dst_ptich, - unsigned int output_height, - const short *vp8_filter -); -extern void vp8_filter_block1d16_h6_only_sse2 -( - unsigned char *src_ptr, - unsigned int src_pixels_per_line, - unsigned char *output_ptr, - int dst_ptich, - unsigned int output_height, - const short *vp8_filter -); -extern void vp8_filter_block1d8_v6_only_sse2 -( - unsigned char *src_ptr, - unsigned int src_pixels_per_line, - unsigned char *output_ptr, - int dst_ptich, - unsigned int output_height, - const short *vp8_filter -); - - -#if HAVE_MMX -void vp8_sixtap_predict4x4_mmx -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 16*16); /* Temp data bufffer used in filtering */ - const short *HFilter, *VFilter; - HFilter = vp8_six_tap_mmx[xoffset]; - vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 9, 8, HFilter); - VFilter = vp8_six_tap_mmx[yoffset]; - vp8_filter_block1dc_v6_mmx(FData2 + 8, dst_ptr, dst_pitch, 8, 4 , 4, 4, VFilter); - -} - - -void vp8_sixtap_predict16x16_mmx -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - - DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 24*24); /* Temp data bufffer used in filtering */ - - const short *HFilter, *VFilter; - - - HFilter = vp8_six_tap_mmx[xoffset]; - - vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 21, 32, HFilter); - vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line) + 4, FData2 + 4, src_pixels_per_line, 1, 21, 32, HFilter); - vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line) + 8, FData2 + 8, src_pixels_per_line, 1, 21, 32, HFilter); - vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line) + 12, FData2 + 12, src_pixels_per_line, 1, 21, 32, HFilter); - - VFilter = vp8_six_tap_mmx[yoffset]; - vp8_filter_block1dc_v6_mmx(FData2 + 32, dst_ptr, dst_pitch, 32, 16 , 16, 16, VFilter); - vp8_filter_block1dc_v6_mmx(FData2 + 36, dst_ptr + 4, dst_pitch, 32, 16 , 16, 16, VFilter); - vp8_filter_block1dc_v6_mmx(FData2 + 40, dst_ptr + 8, dst_pitch, 32, 16 , 16, 16, VFilter); - vp8_filter_block1dc_v6_mmx(FData2 + 44, dst_ptr + 12, dst_pitch, 32, 16 , 16, 16, VFilter); - -} - - -void vp8_sixtap_predict8x8_mmx -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - - DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256); /* Temp data bufffer used in filtering */ - - const short *HFilter, *VFilter; - - HFilter = vp8_six_tap_mmx[xoffset]; - vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 13, 16, HFilter); - vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line) + 4, FData2 + 4, src_pixels_per_line, 1, 13, 16, HFilter); - - VFilter = vp8_six_tap_mmx[yoffset]; - vp8_filter_block1dc_v6_mmx(FData2 + 16, dst_ptr, dst_pitch, 16, 8 , 8, 8, VFilter); - vp8_filter_block1dc_v6_mmx(FData2 + 20, dst_ptr + 4, dst_pitch, 16, 8 , 8, 8, VFilter); - -} - - -void vp8_sixtap_predict8x4_mmx -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - - DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256); /* Temp data bufffer used in filtering */ - - const short *HFilter, *VFilter; - - HFilter = vp8_six_tap_mmx[xoffset]; - vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 9, 16, HFilter); - vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line) + 4, FData2 + 4, src_pixels_per_line, 1, 9, 16, HFilter); - - VFilter = vp8_six_tap_mmx[yoffset]; - vp8_filter_block1dc_v6_mmx(FData2 + 16, dst_ptr, dst_pitch, 16, 8 , 4, 8, VFilter); - vp8_filter_block1dc_v6_mmx(FData2 + 20, dst_ptr + 4, dst_pitch, 16, 8 , 4, 8, VFilter); - -} - - - -void vp8_bilinear_predict16x16_mmx -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - vp8_bilinear_predict8x8_mmx(src_ptr, src_pixels_per_line, xoffset, yoffset, dst_ptr, dst_pitch); - vp8_bilinear_predict8x8_mmx(src_ptr + 8, src_pixels_per_line, xoffset, yoffset, dst_ptr + 8, dst_pitch); - vp8_bilinear_predict8x8_mmx(src_ptr + 8 * src_pixels_per_line, src_pixels_per_line, xoffset, yoffset, dst_ptr + dst_pitch * 8, dst_pitch); - vp8_bilinear_predict8x8_mmx(src_ptr + 8 * src_pixels_per_line + 8, src_pixels_per_line, xoffset, yoffset, dst_ptr + dst_pitch * 8 + 8, dst_pitch); -} -#endif - - -#if HAVE_SSE2 -void vp8_sixtap_predict16x16_sse2 -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch - -) -{ - DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 24*24); /* Temp data bufffer used in filtering */ - - const short *HFilter, *VFilter; - - if (xoffset) - { - if (yoffset) - { - HFilter = vp8_six_tap_mmx[xoffset]; - vp8_filter_block1d16_h6_sse2(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 21, 32, HFilter); - VFilter = vp8_six_tap_mmx[yoffset]; - vp8_filter_block1d16_v6_sse2(FData2 + 32, dst_ptr, dst_pitch, 32, 16 , 16, dst_pitch, VFilter); - } - else - { - /* First-pass only */ - HFilter = vp8_six_tap_mmx[xoffset]; - vp8_filter_block1d16_h6_only_sse2(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 16, HFilter); - } - } - else - { - /* Second-pass only */ - VFilter = vp8_six_tap_mmx[yoffset]; - vp8_unpack_block1d16_h6_sse2(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 21, 32); - vp8_filter_block1d16_v6_sse2(FData2 + 32, dst_ptr, dst_pitch, 32, 16 , 16, dst_pitch, VFilter); - } -} - - -void vp8_sixtap_predict8x8_sse2 -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256); /* Temp data bufffer used in filtering */ - const short *HFilter, *VFilter; - - if (xoffset) - { - if (yoffset) - { - HFilter = vp8_six_tap_mmx[xoffset]; - vp8_filter_block1d8_h6_sse2(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 13, 16, HFilter); - VFilter = vp8_six_tap_mmx[yoffset]; - vp8_filter_block1d8_v6_sse2(FData2 + 16, dst_ptr, dst_pitch, 16, 8 , 8, dst_pitch, VFilter); - } - else - { - /* First-pass only */ - HFilter = vp8_six_tap_mmx[xoffset]; - vp8_filter_block1d8_h6_only_sse2(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 8, HFilter); - } - } - else - { - /* Second-pass only */ - VFilter = vp8_six_tap_mmx[yoffset]; - vp8_filter_block1d8_v6_only_sse2(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, dst_ptr, dst_pitch, 8, VFilter); - } -} - - -void vp8_sixtap_predict8x4_sse2 -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256); /* Temp data bufffer used in filtering */ - const short *HFilter, *VFilter; - - if (xoffset) - { - if (yoffset) - { - HFilter = vp8_six_tap_mmx[xoffset]; - vp8_filter_block1d8_h6_sse2(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 9, 16, HFilter); - VFilter = vp8_six_tap_mmx[yoffset]; - vp8_filter_block1d8_v6_sse2(FData2 + 16, dst_ptr, dst_pitch, 16, 8 , 4, dst_pitch, VFilter); - } - else - { - /* First-pass only */ - HFilter = vp8_six_tap_mmx[xoffset]; - vp8_filter_block1d8_h6_only_sse2(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 4, HFilter); - } - } - else - { - /* Second-pass only */ - VFilter = vp8_six_tap_mmx[yoffset]; - vp8_filter_block1d8_v6_only_sse2(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, dst_ptr, dst_pitch, 4, VFilter); - } -} - -#endif - -#if HAVE_SSSE3 - -extern void vp8_filter_block1d8_h6_ssse3 -( - unsigned char *src_ptr, - unsigned int src_pixels_per_line, - unsigned char *output_ptr, - unsigned int output_pitch, - unsigned int output_height, - unsigned int vp8_filter_index -); - -extern void vp8_filter_block1d16_h6_ssse3 -( - unsigned char *src_ptr, - unsigned int src_pixels_per_line, - unsigned char *output_ptr, - unsigned int output_pitch, - unsigned int output_height, - unsigned int vp8_filter_index -); - -extern void vp8_filter_block1d16_v6_ssse3 -( - unsigned char *src_ptr, - unsigned int src_pitch, - unsigned char *output_ptr, - unsigned int out_pitch, - unsigned int output_height, - unsigned int vp8_filter_index -); - -extern void vp8_filter_block1d8_v6_ssse3 -( - unsigned char *src_ptr, - unsigned int src_pitch, - unsigned char *output_ptr, - unsigned int out_pitch, - unsigned int output_height, - unsigned int vp8_filter_index -); - -extern void vp8_filter_block1d4_h6_ssse3 -( - unsigned char *src_ptr, - unsigned int src_pixels_per_line, - unsigned char *output_ptr, - unsigned int output_pitch, - unsigned int output_height, - unsigned int vp8_filter_index -); - -extern void vp8_filter_block1d4_v6_ssse3 -( - unsigned char *src_ptr, - unsigned int src_pitch, - unsigned char *output_ptr, - unsigned int out_pitch, - unsigned int output_height, - unsigned int vp8_filter_index -); - -void vp8_sixtap_predict16x16_ssse3 -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch - -) -{ - DECLARE_ALIGNED_ARRAY(16, unsigned char, FData2, 24*24); - - if (xoffset) - { - if (yoffset) - { - vp8_filter_block1d16_h6_ssse3(src_ptr - (2 * src_pixels_per_line), - src_pixels_per_line, FData2, - 16, 21, xoffset); - vp8_filter_block1d16_v6_ssse3(FData2 , 16, dst_ptr, dst_pitch, - 16, yoffset); - } - else - { - /* First-pass only */ - vp8_filter_block1d16_h6_ssse3(src_ptr, src_pixels_per_line, - dst_ptr, dst_pitch, 16, xoffset); - } - } - else - { - if (yoffset) - { - /* Second-pass only */ - vp8_filter_block1d16_v6_ssse3(src_ptr - (2 * src_pixels_per_line), - src_pixels_per_line, - dst_ptr, dst_pitch, 16, yoffset); - } - else - { - /* ssse3 second-pass only function couldn't handle (xoffset==0 && - * yoffset==0) case correctly. Add copy function here to guarantee - * six-tap function handles all possible offsets. */ - vp8_copy_mem16x16(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch); - } - } -} - -void vp8_sixtap_predict8x8_ssse3 -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - DECLARE_ALIGNED_ARRAY(16, unsigned char, FData2, 256); - - if (xoffset) - { - if (yoffset) - { - vp8_filter_block1d8_h6_ssse3(src_ptr - (2 * src_pixels_per_line), - src_pixels_per_line, FData2, - 8, 13, xoffset); - vp8_filter_block1d8_v6_ssse3(FData2, 8, dst_ptr, dst_pitch, - 8, yoffset); - } - else - { - vp8_filter_block1d8_h6_ssse3(src_ptr, src_pixels_per_line, - dst_ptr, dst_pitch, 8, xoffset); - } - } - else - { - if (yoffset) - { - /* Second-pass only */ - vp8_filter_block1d8_v6_ssse3(src_ptr - (2 * src_pixels_per_line), - src_pixels_per_line, - dst_ptr, dst_pitch, 8, yoffset); - } - else - { - /* ssse3 second-pass only function couldn't handle (xoffset==0 && - * yoffset==0) case correctly. Add copy function here to guarantee - * six-tap function handles all possible offsets. */ - vp8_copy_mem8x8(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch); - } - } -} - - -void vp8_sixtap_predict8x4_ssse3 -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - DECLARE_ALIGNED_ARRAY(16, unsigned char, FData2, 256); - - if (xoffset) - { - if (yoffset) - { - vp8_filter_block1d8_h6_ssse3(src_ptr - (2 * src_pixels_per_line), - src_pixels_per_line, FData2, - 8, 9, xoffset); - vp8_filter_block1d8_v6_ssse3(FData2, 8, dst_ptr, dst_pitch, - 4, yoffset); - } - else - { - /* First-pass only */ - vp8_filter_block1d8_h6_ssse3(src_ptr, src_pixels_per_line, - dst_ptr, dst_pitch, 4, xoffset); - } - } - else - { - if (yoffset) - { - /* Second-pass only */ - vp8_filter_block1d8_v6_ssse3(src_ptr - (2 * src_pixels_per_line), - src_pixels_per_line, - dst_ptr, dst_pitch, 4, yoffset); - } - else - { - /* ssse3 second-pass only function couldn't handle (xoffset==0 && - * yoffset==0) case correctly. Add copy function here to guarantee - * six-tap function handles all possible offsets. */ - vp8_copy_mem8x4(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch); - } - } -} - -void vp8_sixtap_predict4x4_ssse3 -( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - DECLARE_ALIGNED_ARRAY(16, unsigned char, FData2, 4*9); - - if (xoffset) - { - if (yoffset) - { - vp8_filter_block1d4_h6_ssse3(src_ptr - (2 * src_pixels_per_line), - src_pixels_per_line, - FData2, 4, 9, xoffset); - vp8_filter_block1d4_v6_ssse3(FData2, 4, dst_ptr, dst_pitch, - 4, yoffset); - } - else - { - vp8_filter_block1d4_h6_ssse3(src_ptr, src_pixels_per_line, - dst_ptr, dst_pitch, 4, xoffset); - } - } - else - { - if (yoffset) - { - vp8_filter_block1d4_v6_ssse3(src_ptr - (2 * src_pixels_per_line), - src_pixels_per_line, - dst_ptr, dst_pitch, 4, yoffset); - } - else - { - /* ssse3 second-pass only function couldn't handle (xoffset==0 && - * yoffset==0) case correctly. Add copy function here to guarantee - * six-tap function handles all possible offsets. */ - int r; - - for (r = 0; r < 4; r++) - { - dst_ptr[0] = src_ptr[0]; - dst_ptr[1] = src_ptr[1]; - dst_ptr[2] = src_ptr[2]; - dst_ptr[3] = src_ptr[3]; - dst_ptr += dst_pitch; - src_ptr += src_pixels_per_line; - } - } - } -} - -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/dboolhuff.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/dboolhuff.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/dboolhuff.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/dboolhuff.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "dboolhuff.h" -#include "vp8/common/common.h" - -int vp8dx_start_decode(BOOL_DECODER *br, - const unsigned char *source, - unsigned int source_sz, - vpx_decrypt_cb decrypt_cb, - void *decrypt_state) -{ - br->user_buffer_end = source+source_sz; - br->user_buffer = source; - br->value = 0; - br->count = -8; - br->range = 255; - br->decrypt_cb = decrypt_cb; - br->decrypt_state = decrypt_state; - - if (source_sz && !source) - return 1; - - /* Populate the buffer */ - vp8dx_bool_decoder_fill(br); - - return 0; -} - -void vp8dx_bool_decoder_fill(BOOL_DECODER *br) -{ - const unsigned char *bufptr = br->user_buffer; - VP8_BD_VALUE value = br->value; - int count = br->count; - int shift = VP8_BD_VALUE_SIZE - CHAR_BIT - (count + CHAR_BIT); - size_t bytes_left = br->user_buffer_end - bufptr; - size_t bits_left = bytes_left * CHAR_BIT; - int x = (int)(shift + CHAR_BIT - bits_left); - int loop_end = 0; - unsigned char decrypted[sizeof(VP8_BD_VALUE) + 1]; - - if (br->decrypt_cb) { - size_t n = MIN(sizeof(decrypted), bytes_left); - br->decrypt_cb(br->decrypt_state, bufptr, decrypted, (int)n); - bufptr = decrypted; - } - - if(x >= 0) - { - count += VP8_LOTS_OF_BITS; - loop_end = x; - } - - if (x < 0 || bits_left) - { - while(shift >= loop_end) - { - count += CHAR_BIT; - value |= (VP8_BD_VALUE)*bufptr << shift; - ++bufptr; - ++br->user_buffer; - shift -= CHAR_BIT; - } - } - - br->value = value; - br->count = count; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/dboolhuff.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/dboolhuff.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/dboolhuff.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/dboolhuff.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,141 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_DECODER_DBOOLHUFF_H_ -#define VP8_DECODER_DBOOLHUFF_H_ - -#include -#include - -#include "vpx_config.h" -#include "vpx_ports/mem.h" -#include "vpx/vp8dx.h" -#include "vpx/vpx_integer.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef size_t VP8_BD_VALUE; - -#define VP8_BD_VALUE_SIZE ((int)sizeof(VP8_BD_VALUE)*CHAR_BIT) - -/*This is meant to be a large, positive constant that can still be efficiently - loaded as an immediate (on platforms like ARM, for example). - Even relatively modest values like 100 would work fine.*/ -#define VP8_LOTS_OF_BITS (0x40000000) - -typedef struct -{ - const unsigned char *user_buffer_end; - const unsigned char *user_buffer; - VP8_BD_VALUE value; - int count; - unsigned int range; - vpx_decrypt_cb decrypt_cb; - void *decrypt_state; -} BOOL_DECODER; - -DECLARE_ALIGNED(16, extern const unsigned char, vp8_norm[256]); - -int vp8dx_start_decode(BOOL_DECODER *br, - const unsigned char *source, - unsigned int source_sz, - vpx_decrypt_cb decrypt_cb, - void *decrypt_state); - -void vp8dx_bool_decoder_fill(BOOL_DECODER *br); - - -static int vp8dx_decode_bool(BOOL_DECODER *br, int probability) { - unsigned int bit = 0; - VP8_BD_VALUE value; - unsigned int split; - VP8_BD_VALUE bigsplit; - int count; - unsigned int range; - - split = 1 + (((br->range - 1) * probability) >> 8); - - if(br->count < 0) - vp8dx_bool_decoder_fill(br); - - value = br->value; - count = br->count; - - bigsplit = (VP8_BD_VALUE)split << (VP8_BD_VALUE_SIZE - 8); - - range = split; - - if (value >= bigsplit) - { - range = br->range - split; - value = value - bigsplit; - bit = 1; - } - - { - register unsigned int shift = vp8_norm[range]; - range <<= shift; - value <<= shift; - count -= shift; - } - br->value = value; - br->count = count; - br->range = range; - - return bit; -} - -static int vp8_decode_value(BOOL_DECODER *br, int bits) -{ - int z = 0; - int bit; - - for (bit = bits - 1; bit >= 0; bit--) - { - z |= (vp8dx_decode_bool(br, 0x80) << bit); - } - - return z; -} - -static int vp8dx_bool_error(BOOL_DECODER *br) -{ - /* Check if we have reached the end of the buffer. - * - * Variable 'count' stores the number of bits in the 'value' buffer, minus - * 8. The top byte is part of the algorithm, and the remainder is buffered - * to be shifted into it. So if count == 8, the top 16 bits of 'value' are - * occupied, 8 for the algorithm and 8 in the buffer. - * - * When reading a byte from the user's buffer, count is filled with 8 and - * one byte is filled into the value buffer. When we reach the end of the - * data, count is additionally filled with VP8_LOTS_OF_BITS. So when - * count == VP8_LOTS_OF_BITS - 1, the user's data has been exhausted. - */ - if ((br->count > VP8_BD_VALUE_SIZE) && (br->count < VP8_LOTS_OF_BITS)) - { - /* We have tried to decode bits after the end of - * stream was encountered. - */ - return 1; - } - - /* No error. */ - return 0; -} - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_DECODER_DBOOLHUFF_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/decodeframe.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/decodeframe.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/decodeframe.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/decodeframe.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1399 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "./vpx_scale_rtcd.h" -#include "onyxd_int.h" -#include "vp8/common/header.h" -#include "vp8/common/reconintra4x4.h" -#include "vp8/common/reconinter.h" -#include "detokenize.h" -#include "vp8/common/common.h" -#include "vp8/common/invtrans.h" -#include "vp8/common/alloccommon.h" -#include "vp8/common/entropymode.h" -#include "vp8/common/quant_common.h" -#include "vpx_scale/vpx_scale.h" -#include "vp8/common/setupintrarecon.h" - -#include "decodemv.h" -#include "vp8/common/extend.h" -#if CONFIG_ERROR_CONCEALMENT -#include "error_concealment.h" -#endif -#include "vpx_mem/vpx_mem.h" -#include "vp8/common/threading.h" -#include "decoderthreading.h" -#include "dboolhuff.h" - -#include -#include - -void vp8cx_init_de_quantizer(VP8D_COMP *pbi) -{ - int Q; - VP8_COMMON *const pc = & pbi->common; - - for (Q = 0; Q < QINDEX_RANGE; Q++) - { - pc->Y1dequant[Q][0] = (short)vp8_dc_quant(Q, pc->y1dc_delta_q); - pc->Y2dequant[Q][0] = (short)vp8_dc2quant(Q, pc->y2dc_delta_q); - pc->UVdequant[Q][0] = (short)vp8_dc_uv_quant(Q, pc->uvdc_delta_q); - - pc->Y1dequant[Q][1] = (short)vp8_ac_yquant(Q); - pc->Y2dequant[Q][1] = (short)vp8_ac2quant(Q, pc->y2ac_delta_q); - pc->UVdequant[Q][1] = (short)vp8_ac_uv_quant(Q, pc->uvac_delta_q); - } -} - -void vp8_mb_init_dequantizer(VP8D_COMP *pbi, MACROBLOCKD *xd) -{ - int i; - int QIndex; - MB_MODE_INFO *mbmi = &xd->mode_info_context->mbmi; - VP8_COMMON *const pc = & pbi->common; - - /* Decide whether to use the default or alternate baseline Q value. */ - if (xd->segmentation_enabled) - { - /* Abs Value */ - if (xd->mb_segement_abs_delta == SEGMENT_ABSDATA) - QIndex = xd->segment_feature_data[MB_LVL_ALT_Q][mbmi->segment_id]; - - /* Delta Value */ - else - { - QIndex = pc->base_qindex + xd->segment_feature_data[MB_LVL_ALT_Q][mbmi->segment_id]; - QIndex = (QIndex >= 0) ? ((QIndex <= MAXQ) ? QIndex : MAXQ) : 0; /* Clamp to valid range */ - } - } - else - QIndex = pc->base_qindex; - - /* Set up the macroblock dequant constants */ - xd->dequant_y1_dc[0] = 1; - xd->dequant_y1[0] = pc->Y1dequant[QIndex][0]; - xd->dequant_y2[0] = pc->Y2dequant[QIndex][0]; - xd->dequant_uv[0] = pc->UVdequant[QIndex][0]; - - for (i = 1; i < 16; i++) - { - xd->dequant_y1_dc[i] = - xd->dequant_y1[i] = pc->Y1dequant[QIndex][1]; - xd->dequant_y2[i] = pc->Y2dequant[QIndex][1]; - xd->dequant_uv[i] = pc->UVdequant[QIndex][1]; - } -} - -static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, - unsigned int mb_idx) -{ - MB_PREDICTION_MODE mode; - int i; -#if CONFIG_ERROR_CONCEALMENT - int corruption_detected = 0; -#else - (void)mb_idx; -#endif - - if (xd->mode_info_context->mbmi.mb_skip_coeff) - { - vp8_reset_mb_tokens_context(xd); - } - else if (!vp8dx_bool_error(xd->current_bc)) - { - int eobtotal; - eobtotal = vp8_decode_mb_tokens(pbi, xd); - - /* Special case: Force the loopfilter to skip when eobtotal is zero */ - xd->mode_info_context->mbmi.mb_skip_coeff = (eobtotal==0); - } - - mode = xd->mode_info_context->mbmi.mode; - - if (xd->segmentation_enabled) - vp8_mb_init_dequantizer(pbi, xd); - - -#if CONFIG_ERROR_CONCEALMENT - - if(pbi->ec_active) - { - int throw_residual; - /* When we have independent partitions we can apply residual even - * though other partitions within the frame are corrupt. - */ - throw_residual = (!pbi->independent_partitions && - pbi->frame_corrupt_residual); - throw_residual = (throw_residual || vp8dx_bool_error(xd->current_bc)); - - if ((mb_idx >= pbi->mvs_corrupt_from_mb || throw_residual)) - { - /* MB with corrupt residuals or corrupt mode/motion vectors. - * Better to use the predictor as reconstruction. - */ - pbi->frame_corrupt_residual = 1; - vpx_memset(xd->qcoeff, 0, sizeof(xd->qcoeff)); - vp8_conceal_corrupt_mb(xd); - - - corruption_detected = 1; - - /* force idct to be skipped for B_PRED and use the - * prediction only for reconstruction - * */ - vpx_memset(xd->eobs, 0, 25); - } - } -#endif - - /* do prediction */ - if (xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME) - { - vp8_build_intra_predictors_mbuv_s(xd, - xd->recon_above[1], - xd->recon_above[2], - xd->recon_left[1], - xd->recon_left[2], - xd->recon_left_stride[1], - xd->dst.u_buffer, xd->dst.v_buffer, - xd->dst.uv_stride); - - if (mode != B_PRED) - { - vp8_build_intra_predictors_mby_s(xd, - xd->recon_above[0], - xd->recon_left[0], - xd->recon_left_stride[0], - xd->dst.y_buffer, - xd->dst.y_stride); - } - else - { - short *DQC = xd->dequant_y1; - int dst_stride = xd->dst.y_stride; - - /* clear out residual eob info */ - if(xd->mode_info_context->mbmi.mb_skip_coeff) - vpx_memset(xd->eobs, 0, 25); - - intra_prediction_down_copy(xd, xd->recon_above[0] + 16); - - for (i = 0; i < 16; i++) - { - BLOCKD *b = &xd->block[i]; - unsigned char *dst = xd->dst.y_buffer + b->offset; - B_PREDICTION_MODE b_mode = - xd->mode_info_context->bmi[i].as_mode; - unsigned char *Above = dst - dst_stride; - unsigned char *yleft = dst - 1; - int left_stride = dst_stride; - unsigned char top_left = Above[-1]; - - vp8_intra4x4_predict(Above, yleft, left_stride, b_mode, - dst, dst_stride, top_left); - - if (xd->eobs[i]) - { - if (xd->eobs[i] > 1) - { - vp8_dequant_idct_add(b->qcoeff, DQC, dst, dst_stride); - } - else - { - vp8_dc_only_idct_add - (b->qcoeff[0] * DQC[0], - dst, dst_stride, - dst, dst_stride); - vpx_memset(b->qcoeff, 0, 2 * sizeof(b->qcoeff[0])); - } - } - } - } - } - else - { - vp8_build_inter_predictors_mb(xd); - } - - -#if CONFIG_ERROR_CONCEALMENT - if (corruption_detected) - { - return; - } -#endif - - if(!xd->mode_info_context->mbmi.mb_skip_coeff) - { - /* dequantization and idct */ - if (mode != B_PRED) - { - short *DQC = xd->dequant_y1; - - if (mode != SPLITMV) - { - BLOCKD *b = &xd->block[24]; - - /* do 2nd order transform on the dc block */ - if (xd->eobs[24] > 1) - { - vp8_dequantize_b(b, xd->dequant_y2); - - vp8_short_inv_walsh4x4(&b->dqcoeff[0], - xd->qcoeff); - vpx_memset(b->qcoeff, 0, 16 * sizeof(b->qcoeff[0])); - } - else - { - b->dqcoeff[0] = b->qcoeff[0] * xd->dequant_y2[0]; - vp8_short_inv_walsh4x4_1(&b->dqcoeff[0], - xd->qcoeff); - vpx_memset(b->qcoeff, 0, 2 * sizeof(b->qcoeff[0])); - } - - /* override the dc dequant constant in order to preserve the - * dc components - */ - DQC = xd->dequant_y1_dc; - } - - vp8_dequant_idct_add_y_block - (xd->qcoeff, DQC, - xd->dst.y_buffer, - xd->dst.y_stride, xd->eobs); - } - - vp8_dequant_idct_add_uv_block - (xd->qcoeff+16*16, xd->dequant_uv, - xd->dst.u_buffer, xd->dst.v_buffer, - xd->dst.uv_stride, xd->eobs+16); - } -} - -static int get_delta_q(vp8_reader *bc, int prev, int *q_update) -{ - int ret_val = 0; - - if (vp8_read_bit(bc)) - { - ret_val = vp8_read_literal(bc, 4); - - if (vp8_read_bit(bc)) - ret_val = -ret_val; - } - - /* Trigger a quantizer update if the delta-q value has changed */ - if (ret_val != prev) - *q_update = 1; - - return ret_val; -} - -#ifdef PACKET_TESTING -#include -FILE *vpxlog = 0; -#endif - -static void yv12_extend_frame_top_c(YV12_BUFFER_CONFIG *ybf) -{ - int i; - unsigned char *src_ptr1; - unsigned char *dest_ptr1; - - unsigned int Border; - int plane_stride; - - /***********/ - /* Y Plane */ - /***********/ - Border = ybf->border; - plane_stride = ybf->y_stride; - src_ptr1 = ybf->y_buffer - Border; - dest_ptr1 = src_ptr1 - (Border * plane_stride); - - for (i = 0; i < (int)Border; i++) - { - vpx_memcpy(dest_ptr1, src_ptr1, plane_stride); - dest_ptr1 += plane_stride; - } - - - /***********/ - /* U Plane */ - /***********/ - plane_stride = ybf->uv_stride; - Border /= 2; - src_ptr1 = ybf->u_buffer - Border; - dest_ptr1 = src_ptr1 - (Border * plane_stride); - - for (i = 0; i < (int)(Border); i++) - { - vpx_memcpy(dest_ptr1, src_ptr1, plane_stride); - dest_ptr1 += plane_stride; - } - - /***********/ - /* V Plane */ - /***********/ - - src_ptr1 = ybf->v_buffer - Border; - dest_ptr1 = src_ptr1 - (Border * plane_stride); - - for (i = 0; i < (int)(Border); i++) - { - vpx_memcpy(dest_ptr1, src_ptr1, plane_stride); - dest_ptr1 += plane_stride; - } -} - -static void yv12_extend_frame_bottom_c(YV12_BUFFER_CONFIG *ybf) -{ - int i; - unsigned char *src_ptr1, *src_ptr2; - unsigned char *dest_ptr2; - - unsigned int Border; - int plane_stride; - int plane_height; - - /***********/ - /* Y Plane */ - /***********/ - Border = ybf->border; - plane_stride = ybf->y_stride; - plane_height = ybf->y_height; - - src_ptr1 = ybf->y_buffer - Border; - src_ptr2 = src_ptr1 + (plane_height * plane_stride) - plane_stride; - dest_ptr2 = src_ptr2 + plane_stride; - - for (i = 0; i < (int)Border; i++) - { - vpx_memcpy(dest_ptr2, src_ptr2, plane_stride); - dest_ptr2 += plane_stride; - } - - - /***********/ - /* U Plane */ - /***********/ - plane_stride = ybf->uv_stride; - plane_height = ybf->uv_height; - Border /= 2; - - src_ptr1 = ybf->u_buffer - Border; - src_ptr2 = src_ptr1 + (plane_height * plane_stride) - plane_stride; - dest_ptr2 = src_ptr2 + plane_stride; - - for (i = 0; i < (int)(Border); i++) - { - vpx_memcpy(dest_ptr2, src_ptr2, plane_stride); - dest_ptr2 += plane_stride; - } - - /***********/ - /* V Plane */ - /***********/ - - src_ptr1 = ybf->v_buffer - Border; - src_ptr2 = src_ptr1 + (plane_height * plane_stride) - plane_stride; - dest_ptr2 = src_ptr2 + plane_stride; - - for (i = 0; i < (int)(Border); i++) - { - vpx_memcpy(dest_ptr2, src_ptr2, plane_stride); - dest_ptr2 += plane_stride; - } -} - -static void yv12_extend_frame_left_right_c(YV12_BUFFER_CONFIG *ybf, - unsigned char *y_src, - unsigned char *u_src, - unsigned char *v_src) -{ - int i; - unsigned char *src_ptr1, *src_ptr2; - unsigned char *dest_ptr1, *dest_ptr2; - - unsigned int Border; - int plane_stride; - int plane_height; - int plane_width; - - /***********/ - /* Y Plane */ - /***********/ - Border = ybf->border; - plane_stride = ybf->y_stride; - plane_height = 16; - plane_width = ybf->y_width; - - /* copy the left and right most columns out */ - src_ptr1 = y_src; - src_ptr2 = src_ptr1 + plane_width - 1; - dest_ptr1 = src_ptr1 - Border; - dest_ptr2 = src_ptr2 + 1; - - for (i = 0; i < plane_height; i++) - { - vpx_memset(dest_ptr1, src_ptr1[0], Border); - vpx_memset(dest_ptr2, src_ptr2[0], Border); - src_ptr1 += plane_stride; - src_ptr2 += plane_stride; - dest_ptr1 += plane_stride; - dest_ptr2 += plane_stride; - } - - /***********/ - /* U Plane */ - /***********/ - plane_stride = ybf->uv_stride; - plane_height = 8; - plane_width = ybf->uv_width; - Border /= 2; - - /* copy the left and right most columns out */ - src_ptr1 = u_src; - src_ptr2 = src_ptr1 + plane_width - 1; - dest_ptr1 = src_ptr1 - Border; - dest_ptr2 = src_ptr2 + 1; - - for (i = 0; i < plane_height; i++) - { - vpx_memset(dest_ptr1, src_ptr1[0], Border); - vpx_memset(dest_ptr2, src_ptr2[0], Border); - src_ptr1 += plane_stride; - src_ptr2 += plane_stride; - dest_ptr1 += plane_stride; - dest_ptr2 += plane_stride; - } - - /***********/ - /* V Plane */ - /***********/ - - /* copy the left and right most columns out */ - src_ptr1 = v_src; - src_ptr2 = src_ptr1 + plane_width - 1; - dest_ptr1 = src_ptr1 - Border; - dest_ptr2 = src_ptr2 + 1; - - for (i = 0; i < plane_height; i++) - { - vpx_memset(dest_ptr1, src_ptr1[0], Border); - vpx_memset(dest_ptr2, src_ptr2[0], Border); - src_ptr1 += plane_stride; - src_ptr2 += plane_stride; - dest_ptr1 += plane_stride; - dest_ptr2 += plane_stride; - } -} - -static void decode_mb_rows(VP8D_COMP *pbi) -{ - VP8_COMMON *const pc = & pbi->common; - MACROBLOCKD *const xd = & pbi->mb; - - MODE_INFO *lf_mic = xd->mode_info_context; - - int ibc = 0; - int num_part = 1 << pc->multi_token_partition; - - int recon_yoffset, recon_uvoffset; - int mb_row, mb_col; - int mb_idx = 0; - - YV12_BUFFER_CONFIG *yv12_fb_new = pbi->dec_fb_ref[INTRA_FRAME]; - - int recon_y_stride = yv12_fb_new->y_stride; - int recon_uv_stride = yv12_fb_new->uv_stride; - - unsigned char *ref_buffer[MAX_REF_FRAMES][3]; - unsigned char *dst_buffer[3]; - unsigned char *lf_dst[3]; - unsigned char *eb_dst[3]; - int i; - int ref_fb_corrupted[MAX_REF_FRAMES]; - - ref_fb_corrupted[INTRA_FRAME] = 0; - - for(i = 1; i < MAX_REF_FRAMES; i++) - { - YV12_BUFFER_CONFIG *this_fb = pbi->dec_fb_ref[i]; - - ref_buffer[i][0] = this_fb->y_buffer; - ref_buffer[i][1] = this_fb->u_buffer; - ref_buffer[i][2] = this_fb->v_buffer; - - ref_fb_corrupted[i] = this_fb->corrupted; - } - - /* Set up the buffer pointers */ - eb_dst[0] = lf_dst[0] = dst_buffer[0] = yv12_fb_new->y_buffer; - eb_dst[1] = lf_dst[1] = dst_buffer[1] = yv12_fb_new->u_buffer; - eb_dst[2] = lf_dst[2] = dst_buffer[2] = yv12_fb_new->v_buffer; - - xd->up_available = 0; - - /* Initialize the loop filter for this frame. */ - if(pc->filter_level) - vp8_loop_filter_frame_init(pc, xd, pc->filter_level); - - vp8_setup_intra_recon_top_line(yv12_fb_new); - - /* Decode the individual macro block */ - for (mb_row = 0; mb_row < pc->mb_rows; mb_row++) - { - if (num_part > 1) - { - xd->current_bc = & pbi->mbc[ibc]; - ibc++; - - if (ibc == num_part) - ibc = 0; - } - - recon_yoffset = mb_row * recon_y_stride * 16; - recon_uvoffset = mb_row * recon_uv_stride * 8; - - /* reset contexts */ - xd->above_context = pc->above_context; - vpx_memset(xd->left_context, 0, sizeof(ENTROPY_CONTEXT_PLANES)); - - xd->left_available = 0; - - xd->mb_to_top_edge = -((mb_row * 16) << 3); - xd->mb_to_bottom_edge = ((pc->mb_rows - 1 - mb_row) * 16) << 3; - - xd->recon_above[0] = dst_buffer[0] + recon_yoffset; - xd->recon_above[1] = dst_buffer[1] + recon_uvoffset; - xd->recon_above[2] = dst_buffer[2] + recon_uvoffset; - - xd->recon_left[0] = xd->recon_above[0] - 1; - xd->recon_left[1] = xd->recon_above[1] - 1; - xd->recon_left[2] = xd->recon_above[2] - 1; - - xd->recon_above[0] -= xd->dst.y_stride; - xd->recon_above[1] -= xd->dst.uv_stride; - xd->recon_above[2] -= xd->dst.uv_stride; - - /* TODO: move to outside row loop */ - xd->recon_left_stride[0] = xd->dst.y_stride; - xd->recon_left_stride[1] = xd->dst.uv_stride; - - setup_intra_recon_left(xd->recon_left[0], xd->recon_left[1], - xd->recon_left[2], xd->dst.y_stride, - xd->dst.uv_stride); - - for (mb_col = 0; mb_col < pc->mb_cols; mb_col++) - { - /* Distance of Mb to the various image edges. - * These are specified to 8th pel as they are always compared to values - * that are in 1/8th pel units - */ - xd->mb_to_left_edge = -((mb_col * 16) << 3); - xd->mb_to_right_edge = ((pc->mb_cols - 1 - mb_col) * 16) << 3; - -#if CONFIG_ERROR_CONCEALMENT - { - int corrupt_residual = (!pbi->independent_partitions && - pbi->frame_corrupt_residual) || - vp8dx_bool_error(xd->current_bc); - if (pbi->ec_active && - xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME && - corrupt_residual) - { - /* We have an intra block with corrupt coefficients, better to - * conceal with an inter block. Interpolate MVs from neighboring - * MBs. - * - * Note that for the first mb with corrupt residual in a frame, - * we might not discover that before decoding the residual. That - * happens after this check, and therefore no inter concealment - * will be done. - */ - vp8_interpolate_motion(xd, - mb_row, mb_col, - pc->mb_rows, pc->mb_cols, - pc->mode_info_stride); - } - } -#endif - - xd->dst.y_buffer = dst_buffer[0] + recon_yoffset; - xd->dst.u_buffer = dst_buffer[1] + recon_uvoffset; - xd->dst.v_buffer = dst_buffer[2] + recon_uvoffset; - - if (xd->mode_info_context->mbmi.ref_frame >= LAST_FRAME) { - MV_REFERENCE_FRAME ref = xd->mode_info_context->mbmi.ref_frame; - xd->pre.y_buffer = ref_buffer[ref][0] + recon_yoffset; - xd->pre.u_buffer = ref_buffer[ref][1] + recon_uvoffset; - xd->pre.v_buffer = ref_buffer[ref][2] + recon_uvoffset; - } else { - // ref_frame is INTRA_FRAME, pre buffer should not be used. - xd->pre.y_buffer = 0; - xd->pre.u_buffer = 0; - xd->pre.v_buffer = 0; - } - - /* propagate errors from reference frames */ - xd->corrupted |= ref_fb_corrupted[xd->mode_info_context->mbmi.ref_frame]; - - decode_macroblock(pbi, xd, mb_idx); - - mb_idx++; - xd->left_available = 1; - - /* check if the boolean decoder has suffered an error */ - xd->corrupted |= vp8dx_bool_error(xd->current_bc); - - xd->recon_above[0] += 16; - xd->recon_above[1] += 8; - xd->recon_above[2] += 8; - xd->recon_left[0] += 16; - xd->recon_left[1] += 8; - xd->recon_left[2] += 8; - - recon_yoffset += 16; - recon_uvoffset += 8; - - ++xd->mode_info_context; /* next mb */ - - xd->above_context++; - } - - /* adjust to the next row of mbs */ - vp8_extend_mb_row(yv12_fb_new, xd->dst.y_buffer + 16, - xd->dst.u_buffer + 8, xd->dst.v_buffer + 8); - - ++xd->mode_info_context; /* skip prediction column */ - xd->up_available = 1; - - if(pc->filter_level) - { - if(mb_row > 0) - { - if (pc->filter_type == NORMAL_LOOPFILTER) - vp8_loop_filter_row_normal(pc, lf_mic, mb_row-1, - recon_y_stride, recon_uv_stride, - lf_dst[0], lf_dst[1], lf_dst[2]); - else - vp8_loop_filter_row_simple(pc, lf_mic, mb_row-1, - recon_y_stride, recon_uv_stride, - lf_dst[0], lf_dst[1], lf_dst[2]); - if(mb_row > 1) - { - yv12_extend_frame_left_right_c(yv12_fb_new, - eb_dst[0], - eb_dst[1], - eb_dst[2]); - - eb_dst[0] += recon_y_stride * 16; - eb_dst[1] += recon_uv_stride * 8; - eb_dst[2] += recon_uv_stride * 8; - } - - lf_dst[0] += recon_y_stride * 16; - lf_dst[1] += recon_uv_stride * 8; - lf_dst[2] += recon_uv_stride * 8; - lf_mic += pc->mb_cols; - lf_mic++; /* Skip border mb */ - } - } - else - { - if(mb_row > 0) - { - /**/ - yv12_extend_frame_left_right_c(yv12_fb_new, - eb_dst[0], - eb_dst[1], - eb_dst[2]); - eb_dst[0] += recon_y_stride * 16; - eb_dst[1] += recon_uv_stride * 8; - eb_dst[2] += recon_uv_stride * 8; - } - } - } - - if(pc->filter_level) - { - if (pc->filter_type == NORMAL_LOOPFILTER) - vp8_loop_filter_row_normal(pc, lf_mic, mb_row-1, recon_y_stride, - recon_uv_stride, lf_dst[0], lf_dst[1], - lf_dst[2]); - else - vp8_loop_filter_row_simple(pc, lf_mic, mb_row-1, recon_y_stride, - recon_uv_stride, lf_dst[0], lf_dst[1], - lf_dst[2]); - - yv12_extend_frame_left_right_c(yv12_fb_new, - eb_dst[0], - eb_dst[1], - eb_dst[2]); - eb_dst[0] += recon_y_stride * 16; - eb_dst[1] += recon_uv_stride * 8; - eb_dst[2] += recon_uv_stride * 8; - } - yv12_extend_frame_left_right_c(yv12_fb_new, - eb_dst[0], - eb_dst[1], - eb_dst[2]); - yv12_extend_frame_top_c(yv12_fb_new); - yv12_extend_frame_bottom_c(yv12_fb_new); - -} - -static unsigned int read_partition_size(VP8D_COMP *pbi, - const unsigned char *cx_size) -{ - unsigned char temp[3]; - if (pbi->decrypt_cb) - { - pbi->decrypt_cb(pbi->decrypt_state, cx_size, temp, 3); - cx_size = temp; - } - return cx_size[0] + (cx_size[1] << 8) + (cx_size[2] << 16); -} - -static int read_is_valid(const unsigned char *start, - size_t len, - const unsigned char *end) -{ - return (start + len > start && start + len <= end); -} - -static unsigned int read_available_partition_size( - VP8D_COMP *pbi, - const unsigned char *token_part_sizes, - const unsigned char *fragment_start, - const unsigned char *first_fragment_end, - const unsigned char *fragment_end, - int i, - int num_part) -{ - VP8_COMMON* pc = &pbi->common; - const unsigned char *partition_size_ptr = token_part_sizes + i * 3; - unsigned int partition_size = 0; - ptrdiff_t bytes_left = fragment_end - fragment_start; - /* Calculate the length of this partition. The last partition - * size is implicit. If the partition size can't be read, then - * either use the remaining data in the buffer (for EC mode) - * or throw an error. - */ - if (i < num_part - 1) - { - if (read_is_valid(partition_size_ptr, 3, first_fragment_end)) - partition_size = read_partition_size(pbi, partition_size_ptr); - else if (pbi->ec_active) - partition_size = (unsigned int)bytes_left; - else - vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME, - "Truncated partition size data"); - } - else - partition_size = (unsigned int)bytes_left; - - /* Validate the calculated partition length. If the buffer - * described by the partition can't be fully read, then restrict - * it to the portion that can be (for EC mode) or throw an error. - */ - if (!read_is_valid(fragment_start, partition_size, fragment_end)) - { - if (pbi->ec_active) - partition_size = (unsigned int)bytes_left; - else - vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME, - "Truncated packet or corrupt partition " - "%d length", i + 1); - } - return partition_size; -} - - -static void setup_token_decoder(VP8D_COMP *pbi, - const unsigned char* token_part_sizes) -{ - vp8_reader *bool_decoder = &pbi->mbc[0]; - unsigned int partition_idx; - unsigned int fragment_idx; - unsigned int num_token_partitions; - const unsigned char *first_fragment_end = pbi->fragments.ptrs[0] + - pbi->fragments.sizes[0]; - - TOKEN_PARTITION multi_token_partition = - (TOKEN_PARTITION)vp8_read_literal(&pbi->mbc[8], 2); - if (!vp8dx_bool_error(&pbi->mbc[8])) - pbi->common.multi_token_partition = multi_token_partition; - num_token_partitions = 1 << pbi->common.multi_token_partition; - - /* Check for partitions within the fragments and unpack the fragments - * so that each fragment pointer points to its corresponding partition. */ - for (fragment_idx = 0; fragment_idx < pbi->fragments.count; ++fragment_idx) - { - unsigned int fragment_size = pbi->fragments.sizes[fragment_idx]; - const unsigned char *fragment_end = pbi->fragments.ptrs[fragment_idx] + - fragment_size; - /* Special case for handling the first partition since we have already - * read its size. */ - if (fragment_idx == 0) - { - /* Size of first partition + token partition sizes element */ - ptrdiff_t ext_first_part_size = token_part_sizes - - pbi->fragments.ptrs[0] + 3 * (num_token_partitions - 1); - fragment_size -= (unsigned int)ext_first_part_size; - if (fragment_size > 0) - { - pbi->fragments.sizes[0] = (unsigned int)ext_first_part_size; - /* The fragment contains an additional partition. Move to - * next. */ - fragment_idx++; - pbi->fragments.ptrs[fragment_idx] = pbi->fragments.ptrs[0] + - pbi->fragments.sizes[0]; - } - } - /* Split the chunk into partitions read from the bitstream */ - while (fragment_size > 0) - { - ptrdiff_t partition_size = read_available_partition_size( - pbi, - token_part_sizes, - pbi->fragments.ptrs[fragment_idx], - first_fragment_end, - fragment_end, - fragment_idx - 1, - num_token_partitions); - pbi->fragments.sizes[fragment_idx] = (unsigned int)partition_size; - fragment_size -= (unsigned int)partition_size; - assert(fragment_idx <= num_token_partitions); - if (fragment_size > 0) - { - /* The fragment contains an additional partition. - * Move to next. */ - fragment_idx++; - pbi->fragments.ptrs[fragment_idx] = - pbi->fragments.ptrs[fragment_idx - 1] + partition_size; - } - } - } - - pbi->fragments.count = num_token_partitions + 1; - - for (partition_idx = 1; partition_idx < pbi->fragments.count; ++partition_idx) - { - if (vp8dx_start_decode(bool_decoder, - pbi->fragments.ptrs[partition_idx], - pbi->fragments.sizes[partition_idx], - pbi->decrypt_cb, pbi->decrypt_state)) - vpx_internal_error(&pbi->common.error, VPX_CODEC_MEM_ERROR, - "Failed to allocate bool decoder %d", - partition_idx); - - bool_decoder++; - } - -#if CONFIG_MULTITHREAD - /* Clamp number of decoder threads */ - if (pbi->decoding_thread_count > num_token_partitions - 1) - pbi->decoding_thread_count = num_token_partitions - 1; -#endif -} - - -static void init_frame(VP8D_COMP *pbi) -{ - VP8_COMMON *const pc = & pbi->common; - MACROBLOCKD *const xd = & pbi->mb; - - if (pc->frame_type == KEY_FRAME) - { - /* Various keyframe initializations */ - vpx_memcpy(pc->fc.mvc, vp8_default_mv_context, sizeof(vp8_default_mv_context)); - - vp8_init_mbmode_probs(pc); - - vp8_default_coef_probs(pc); - - /* reset the segment feature data to 0 with delta coding (Default state). */ - vpx_memset(xd->segment_feature_data, 0, sizeof(xd->segment_feature_data)); - xd->mb_segement_abs_delta = SEGMENT_DELTADATA; - - /* reset the mode ref deltasa for loop filter */ - vpx_memset(xd->ref_lf_deltas, 0, sizeof(xd->ref_lf_deltas)); - vpx_memset(xd->mode_lf_deltas, 0, sizeof(xd->mode_lf_deltas)); - - /* All buffers are implicitly updated on key frames. */ - pc->refresh_golden_frame = 1; - pc->refresh_alt_ref_frame = 1; - pc->copy_buffer_to_gf = 0; - pc->copy_buffer_to_arf = 0; - - /* Note that Golden and Altref modes cannot be used on a key frame so - * ref_frame_sign_bias[] is undefined and meaningless - */ - pc->ref_frame_sign_bias[GOLDEN_FRAME] = 0; - pc->ref_frame_sign_bias[ALTREF_FRAME] = 0; - } - else - { - /* To enable choice of different interploation filters */ - if (!pc->use_bilinear_mc_filter) - { - xd->subpixel_predict = vp8_sixtap_predict4x4; - xd->subpixel_predict8x4 = vp8_sixtap_predict8x4; - xd->subpixel_predict8x8 = vp8_sixtap_predict8x8; - xd->subpixel_predict16x16 = vp8_sixtap_predict16x16; - } - else - { - xd->subpixel_predict = vp8_bilinear_predict4x4; - xd->subpixel_predict8x4 = vp8_bilinear_predict8x4; - xd->subpixel_predict8x8 = vp8_bilinear_predict8x8; - xd->subpixel_predict16x16 = vp8_bilinear_predict16x16; - } - - if (pbi->decoded_key_frame && pbi->ec_enabled && !pbi->ec_active) - pbi->ec_active = 1; - } - - xd->left_context = &pc->left_context; - xd->mode_info_context = pc->mi; - xd->frame_type = pc->frame_type; - xd->mode_info_context->mbmi.mode = DC_PRED; - xd->mode_info_stride = pc->mode_info_stride; - xd->corrupted = 0; /* init without corruption */ - - xd->fullpixel_mask = 0xffffffff; - if(pc->full_pixel) - xd->fullpixel_mask = 0xfffffff8; - -} - -int vp8_decode_frame(VP8D_COMP *pbi) -{ - vp8_reader *const bc = &pbi->mbc[8]; - VP8_COMMON *const pc = &pbi->common; - MACROBLOCKD *const xd = &pbi->mb; - const unsigned char *data = pbi->fragments.ptrs[0]; - const unsigned char *data_end = data + pbi->fragments.sizes[0]; - ptrdiff_t first_partition_length_in_bytes; - - int i, j, k, l; - const int *const mb_feature_data_bits = vp8_mb_feature_data_bits; - int corrupt_tokens = 0; - int prev_independent_partitions = pbi->independent_partitions; - - YV12_BUFFER_CONFIG *yv12_fb_new = pbi->dec_fb_ref[INTRA_FRAME]; - - /* start with no corruption of current frame */ - xd->corrupted = 0; - yv12_fb_new->corrupted = 0; - - if (data_end - data < 3) - { - if (!pbi->ec_active) - { - vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME, - "Truncated packet"); - } - - /* Declare the missing frame as an inter frame since it will - be handled as an inter frame when we have estimated its - motion vectors. */ - pc->frame_type = INTER_FRAME; - pc->version = 0; - pc->show_frame = 1; - first_partition_length_in_bytes = 0; - } - else - { - unsigned char clear_buffer[10]; - const unsigned char *clear = data; - if (pbi->decrypt_cb) - { - int n = (int)MIN(sizeof(clear_buffer), data_end - data); - pbi->decrypt_cb(pbi->decrypt_state, data, clear_buffer, n); - clear = clear_buffer; - } - - pc->frame_type = (FRAME_TYPE)(clear[0] & 1); - pc->version = (clear[0] >> 1) & 7; - pc->show_frame = (clear[0] >> 4) & 1; - first_partition_length_in_bytes = - (clear[0] | (clear[1] << 8) | (clear[2] << 16)) >> 5; - - if (!pbi->ec_active && - (data + first_partition_length_in_bytes > data_end - || data + first_partition_length_in_bytes < data)) - vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME, - "Truncated packet or corrupt partition 0 length"); - - data += 3; - clear += 3; - - vp8_setup_version(pc); - - - if (pc->frame_type == KEY_FRAME) - { - /* vet via sync code */ - /* When error concealment is enabled we should only check the sync - * code if we have enough bits available - */ - if (!pbi->ec_active || data + 3 < data_end) - { - if (clear[0] != 0x9d || clear[1] != 0x01 || clear[2] != 0x2a) - vpx_internal_error(&pc->error, VPX_CODEC_UNSUP_BITSTREAM, - "Invalid frame sync code"); - } - - /* If error concealment is enabled we should only parse the new size - * if we have enough data. Otherwise we will end up with the wrong - * size. - */ - if (!pbi->ec_active || data + 6 < data_end) - { - pc->Width = (clear[3] | (clear[4] << 8)) & 0x3fff; - pc->horiz_scale = clear[4] >> 6; - pc->Height = (clear[5] | (clear[6] << 8)) & 0x3fff; - pc->vert_scale = clear[6] >> 6; - } - data += 7; - clear += 7; - } - else - { - vpx_memcpy(&xd->pre, yv12_fb_new, sizeof(YV12_BUFFER_CONFIG)); - vpx_memcpy(&xd->dst, yv12_fb_new, sizeof(YV12_BUFFER_CONFIG)); - } - } - if ((!pbi->decoded_key_frame && pc->frame_type != KEY_FRAME)) - { - return -1; - } - - init_frame(pbi); - - if (vp8dx_start_decode(bc, data, (unsigned int)(data_end - data), - pbi->decrypt_cb, pbi->decrypt_state)) - vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR, - "Failed to allocate bool decoder 0"); - if (pc->frame_type == KEY_FRAME) { - (void)vp8_read_bit(bc); // colorspace - pc->clamp_type = (CLAMP_TYPE)vp8_read_bit(bc); - } - - /* Is segmentation enabled */ - xd->segmentation_enabled = (unsigned char)vp8_read_bit(bc); - - if (xd->segmentation_enabled) - { - /* Signal whether or not the segmentation map is being explicitly updated this frame. */ - xd->update_mb_segmentation_map = (unsigned char)vp8_read_bit(bc); - xd->update_mb_segmentation_data = (unsigned char)vp8_read_bit(bc); - - if (xd->update_mb_segmentation_data) - { - xd->mb_segement_abs_delta = (unsigned char)vp8_read_bit(bc); - - vpx_memset(xd->segment_feature_data, 0, sizeof(xd->segment_feature_data)); - - /* For each segmentation feature (Quant and loop filter level) */ - for (i = 0; i < MB_LVL_MAX; i++) - { - for (j = 0; j < MAX_MB_SEGMENTS; j++) - { - /* Frame level data */ - if (vp8_read_bit(bc)) - { - xd->segment_feature_data[i][j] = (signed char)vp8_read_literal(bc, mb_feature_data_bits[i]); - - if (vp8_read_bit(bc)) - xd->segment_feature_data[i][j] = -xd->segment_feature_data[i][j]; - } - else - xd->segment_feature_data[i][j] = 0; - } - } - } - - if (xd->update_mb_segmentation_map) - { - /* Which macro block level features are enabled */ - vpx_memset(xd->mb_segment_tree_probs, 255, sizeof(xd->mb_segment_tree_probs)); - - /* Read the probs used to decode the segment id for each macro block. */ - for (i = 0; i < MB_FEATURE_TREE_PROBS; i++) - { - /* If not explicitly set value is defaulted to 255 by memset above */ - if (vp8_read_bit(bc)) - xd->mb_segment_tree_probs[i] = (vp8_prob)vp8_read_literal(bc, 8); - } - } - } - else - { - /* No segmentation updates on this frame */ - xd->update_mb_segmentation_map = 0; - xd->update_mb_segmentation_data = 0; - } - - /* Read the loop filter level and type */ - pc->filter_type = (LOOPFILTERTYPE) vp8_read_bit(bc); - pc->filter_level = vp8_read_literal(bc, 6); - pc->sharpness_level = vp8_read_literal(bc, 3); - - /* Read in loop filter deltas applied at the MB level based on mode or ref frame. */ - xd->mode_ref_lf_delta_update = 0; - xd->mode_ref_lf_delta_enabled = (unsigned char)vp8_read_bit(bc); - - if (xd->mode_ref_lf_delta_enabled) - { - /* Do the deltas need to be updated */ - xd->mode_ref_lf_delta_update = (unsigned char)vp8_read_bit(bc); - - if (xd->mode_ref_lf_delta_update) - { - /* Send update */ - for (i = 0; i < MAX_REF_LF_DELTAS; i++) - { - if (vp8_read_bit(bc)) - { - /*sign = vp8_read_bit( bc );*/ - xd->ref_lf_deltas[i] = (signed char)vp8_read_literal(bc, 6); - - if (vp8_read_bit(bc)) /* Apply sign */ - xd->ref_lf_deltas[i] = xd->ref_lf_deltas[i] * -1; - } - } - - /* Send update */ - for (i = 0; i < MAX_MODE_LF_DELTAS; i++) - { - if (vp8_read_bit(bc)) - { - /*sign = vp8_read_bit( bc );*/ - xd->mode_lf_deltas[i] = (signed char)vp8_read_literal(bc, 6); - - if (vp8_read_bit(bc)) /* Apply sign */ - xd->mode_lf_deltas[i] = xd->mode_lf_deltas[i] * -1; - } - } - } - } - - setup_token_decoder(pbi, data + first_partition_length_in_bytes); - - xd->current_bc = &pbi->mbc[0]; - - /* Read the default quantizers. */ - { - int Q, q_update; - - Q = vp8_read_literal(bc, 7); /* AC 1st order Q = default */ - pc->base_qindex = Q; - q_update = 0; - pc->y1dc_delta_q = get_delta_q(bc, pc->y1dc_delta_q, &q_update); - pc->y2dc_delta_q = get_delta_q(bc, pc->y2dc_delta_q, &q_update); - pc->y2ac_delta_q = get_delta_q(bc, pc->y2ac_delta_q, &q_update); - pc->uvdc_delta_q = get_delta_q(bc, pc->uvdc_delta_q, &q_update); - pc->uvac_delta_q = get_delta_q(bc, pc->uvac_delta_q, &q_update); - - if (q_update) - vp8cx_init_de_quantizer(pbi); - - /* MB level dequantizer setup */ - vp8_mb_init_dequantizer(pbi, &pbi->mb); - } - - /* Determine if the golden frame or ARF buffer should be updated and how. - * For all non key frames the GF and ARF refresh flags and sign bias - * flags must be set explicitly. - */ - if (pc->frame_type != KEY_FRAME) - { - /* Should the GF or ARF be updated from the current frame */ - pc->refresh_golden_frame = vp8_read_bit(bc); -#if CONFIG_ERROR_CONCEALMENT - /* Assume we shouldn't refresh golden if the bit is missing */ - xd->corrupted |= vp8dx_bool_error(bc); - if (pbi->ec_active && xd->corrupted) - pc->refresh_golden_frame = 0; -#endif - - pc->refresh_alt_ref_frame = vp8_read_bit(bc); -#if CONFIG_ERROR_CONCEALMENT - /* Assume we shouldn't refresh altref if the bit is missing */ - xd->corrupted |= vp8dx_bool_error(bc); - if (pbi->ec_active && xd->corrupted) - pc->refresh_alt_ref_frame = 0; -#endif - - /* Buffer to buffer copy flags. */ - pc->copy_buffer_to_gf = 0; - - if (!pc->refresh_golden_frame) - pc->copy_buffer_to_gf = vp8_read_literal(bc, 2); - -#if CONFIG_ERROR_CONCEALMENT - /* Assume we shouldn't copy to the golden if the bit is missing */ - xd->corrupted |= vp8dx_bool_error(bc); - if (pbi->ec_active && xd->corrupted) - pc->copy_buffer_to_gf = 0; -#endif - - pc->copy_buffer_to_arf = 0; - - if (!pc->refresh_alt_ref_frame) - pc->copy_buffer_to_arf = vp8_read_literal(bc, 2); - -#if CONFIG_ERROR_CONCEALMENT - /* Assume we shouldn't copy to the alt-ref if the bit is missing */ - xd->corrupted |= vp8dx_bool_error(bc); - if (pbi->ec_active && xd->corrupted) - pc->copy_buffer_to_arf = 0; -#endif - - - pc->ref_frame_sign_bias[GOLDEN_FRAME] = vp8_read_bit(bc); - pc->ref_frame_sign_bias[ALTREF_FRAME] = vp8_read_bit(bc); - } - - pc->refresh_entropy_probs = vp8_read_bit(bc); -#if CONFIG_ERROR_CONCEALMENT - /* Assume we shouldn't refresh the probabilities if the bit is - * missing */ - xd->corrupted |= vp8dx_bool_error(bc); - if (pbi->ec_active && xd->corrupted) - pc->refresh_entropy_probs = 0; -#endif - if (pc->refresh_entropy_probs == 0) - { - vpx_memcpy(&pc->lfc, &pc->fc, sizeof(pc->fc)); - } - - pc->refresh_last_frame = pc->frame_type == KEY_FRAME || vp8_read_bit(bc); - -#if CONFIG_ERROR_CONCEALMENT - /* Assume we should refresh the last frame if the bit is missing */ - xd->corrupted |= vp8dx_bool_error(bc); - if (pbi->ec_active && xd->corrupted) - pc->refresh_last_frame = 1; -#endif - - if (0) - { - FILE *z = fopen("decodestats.stt", "a"); - fprintf(z, "%6d F:%d,G:%d,A:%d,L:%d,Q:%d\n", - pc->current_video_frame, - pc->frame_type, - pc->refresh_golden_frame, - pc->refresh_alt_ref_frame, - pc->refresh_last_frame, - pc->base_qindex); - fclose(z); - } - - { - pbi->independent_partitions = 1; - - /* read coef probability tree */ - for (i = 0; i < BLOCK_TYPES; i++) - for (j = 0; j < COEF_BANDS; j++) - for (k = 0; k < PREV_COEF_CONTEXTS; k++) - for (l = 0; l < ENTROPY_NODES; l++) - { - - vp8_prob *const p = pc->fc.coef_probs [i][j][k] + l; - - if (vp8_read(bc, vp8_coef_update_probs [i][j][k][l])) - { - *p = (vp8_prob)vp8_read_literal(bc, 8); - - } - if (k > 0 && *p != pc->fc.coef_probs[i][j][k-1][l]) - pbi->independent_partitions = 0; - - } - } - - /* clear out the coeff buffer */ - vpx_memset(xd->qcoeff, 0, sizeof(xd->qcoeff)); - - vp8_decode_mode_mvs(pbi); - -#if CONFIG_ERROR_CONCEALMENT - if (pbi->ec_active && - pbi->mvs_corrupt_from_mb < (unsigned int)pc->mb_cols * pc->mb_rows) - { - /* Motion vectors are missing in this frame. We will try to estimate - * them and then continue decoding the frame as usual */ - vp8_estimate_missing_mvs(pbi); - } -#endif - - vpx_memset(pc->above_context, 0, sizeof(ENTROPY_CONTEXT_PLANES) * pc->mb_cols); - pbi->frame_corrupt_residual = 0; - -#if CONFIG_MULTITHREAD - if (pbi->b_multithreaded_rd && pc->multi_token_partition != ONE_PARTITION) - { - unsigned int thread; - vp8mt_decode_mb_rows(pbi, xd); - vp8_yv12_extend_frame_borders(yv12_fb_new); - for (thread = 0; thread < pbi->decoding_thread_count; ++thread) - corrupt_tokens |= pbi->mb_row_di[thread].mbd.corrupted; - } - else -#endif - { - decode_mb_rows(pbi); - corrupt_tokens |= xd->corrupted; - } - - /* Collect information about decoder corruption. */ - /* 1. Check first boolean decoder for errors. */ - yv12_fb_new->corrupted = vp8dx_bool_error(bc); - /* 2. Check the macroblock information */ - yv12_fb_new->corrupted |= corrupt_tokens; - - if (!pbi->decoded_key_frame) - { - if (pc->frame_type == KEY_FRAME && - !yv12_fb_new->corrupted) - pbi->decoded_key_frame = 1; - else - vpx_internal_error(&pbi->common.error, VPX_CODEC_CORRUPT_FRAME, - "A stream must start with a complete key frame"); - } - - /* vpx_log("Decoder: Frame Decoded, Size Roughly:%d bytes \n",bc->pos+pbi->bc2.pos); */ - - if (pc->refresh_entropy_probs == 0) - { - vpx_memcpy(&pc->fc, &pc->lfc, sizeof(pc->fc)); - pbi->independent_partitions = prev_independent_partitions; - } - -#ifdef PACKET_TESTING - { - FILE *f = fopen("decompressor.VP8", "ab"); - unsigned int size = pbi->bc2.pos + pbi->bc.pos + 8; - fwrite((void *) &size, 4, 1, f); - fwrite((void *) pbi->Source, size, 1, f); - fclose(f); - } -#endif - - return 0; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/decodemv.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/decodemv.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/decodemv.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/decodemv.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,670 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "treereader.h" -#include "vp8/common/entropymv.h" -#include "vp8/common/entropymode.h" -#include "onyxd_int.h" -#include "vp8/common/findnearmv.h" - -#if CONFIG_DEBUG -#include -#endif -static B_PREDICTION_MODE read_bmode(vp8_reader *bc, const vp8_prob *p) -{ - const int i = vp8_treed_read(bc, vp8_bmode_tree, p); - - return (B_PREDICTION_MODE)i; -} - -static MB_PREDICTION_MODE read_ymode(vp8_reader *bc, const vp8_prob *p) -{ - const int i = vp8_treed_read(bc, vp8_ymode_tree, p); - - return (MB_PREDICTION_MODE)i; -} - -static MB_PREDICTION_MODE read_kf_ymode(vp8_reader *bc, const vp8_prob *p) -{ - const int i = vp8_treed_read(bc, vp8_kf_ymode_tree, p); - - return (MB_PREDICTION_MODE)i; -} - -static MB_PREDICTION_MODE read_uv_mode(vp8_reader *bc, const vp8_prob *p) -{ - const int i = vp8_treed_read(bc, vp8_uv_mode_tree, p); - - return (MB_PREDICTION_MODE)i; -} - -static void read_kf_modes(VP8D_COMP *pbi, MODE_INFO *mi) -{ - vp8_reader *const bc = & pbi->mbc[8]; - const int mis = pbi->common.mode_info_stride; - - mi->mbmi.ref_frame = INTRA_FRAME; - mi->mbmi.mode = read_kf_ymode(bc, vp8_kf_ymode_prob); - - if (mi->mbmi.mode == B_PRED) - { - int i = 0; - mi->mbmi.is_4x4 = 1; - - do - { - const B_PREDICTION_MODE A = above_block_mode(mi, i, mis); - const B_PREDICTION_MODE L = left_block_mode(mi, i); - - mi->bmi[i].as_mode = - read_bmode(bc, vp8_kf_bmode_prob [A] [L]); - } - while (++i < 16); - } - - mi->mbmi.uv_mode = read_uv_mode(bc, vp8_kf_uv_mode_prob); -} - -static int read_mvcomponent(vp8_reader *r, const MV_CONTEXT *mvc) -{ - const vp8_prob *const p = (const vp8_prob *) mvc; - int x = 0; - - if (vp8_read(r, p [mvpis_short])) /* Large */ - { - int i = 0; - - do - { - x += vp8_read(r, p [MVPbits + i]) << i; - } - while (++i < 3); - - i = mvlong_width - 1; /* Skip bit 3, which is sometimes implicit */ - - do - { - x += vp8_read(r, p [MVPbits + i]) << i; - } - while (--i > 3); - - if (!(x & 0xFFF0) || vp8_read(r, p [MVPbits + 3])) - x += 8; - } - else /* small */ - x = vp8_treed_read(r, vp8_small_mvtree, p + MVPshort); - - if (x && vp8_read(r, p [MVPsign])) - x = -x; - - return x; -} - -static void read_mv(vp8_reader *r, MV *mv, const MV_CONTEXT *mvc) -{ - mv->row = (short)(read_mvcomponent(r, mvc) * 2); - mv->col = (short)(read_mvcomponent(r, ++mvc) * 2); -} - - -static void read_mvcontexts(vp8_reader *bc, MV_CONTEXT *mvc) -{ - int i = 0; - - do - { - const vp8_prob *up = vp8_mv_update_probs[i].prob; - vp8_prob *p = (vp8_prob *)(mvc + i); - vp8_prob *const pstop = p + MVPcount; - - do - { - if (vp8_read(bc, *up++)) - { - const vp8_prob x = (vp8_prob)vp8_read_literal(bc, 7); - - *p = x ? x << 1 : 1; - } - } - while (++p < pstop); - } - while (++i < 2); -} - -static const unsigned char mbsplit_fill_count[4] = {8, 8, 4, 1}; -static const unsigned char mbsplit_fill_offset[4][16] = { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, - { 0, 1, 4, 5, 8, 9, 12, 13, 2, 3, 6, 7, 10, 11, 14, 15}, - { 0, 1, 4, 5, 2, 3, 6, 7, 8, 9, 12, 13, 10, 11, 14, 15}, - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} -}; - - -static void mb_mode_mv_init(VP8D_COMP *pbi) -{ - vp8_reader *const bc = & pbi->mbc[8]; - MV_CONTEXT *const mvc = pbi->common.fc.mvc; - -#if CONFIG_ERROR_CONCEALMENT - /* Default is that no macroblock is corrupt, therefore we initialize - * mvs_corrupt_from_mb to something very big, which we can be sure is - * outside the frame. */ - pbi->mvs_corrupt_from_mb = UINT_MAX; -#endif - /* Read the mb_no_coeff_skip flag */ - pbi->common.mb_no_coeff_skip = (int)vp8_read_bit(bc); - - pbi->prob_skip_false = 0; - if (pbi->common.mb_no_coeff_skip) - pbi->prob_skip_false = (vp8_prob)vp8_read_literal(bc, 8); - - if(pbi->common.frame_type != KEY_FRAME) - { - pbi->prob_intra = (vp8_prob)vp8_read_literal(bc, 8); - pbi->prob_last = (vp8_prob)vp8_read_literal(bc, 8); - pbi->prob_gf = (vp8_prob)vp8_read_literal(bc, 8); - - if (vp8_read_bit(bc)) - { - int i = 0; - - do - { - pbi->common.fc.ymode_prob[i] = - (vp8_prob) vp8_read_literal(bc, 8); - } - while (++i < 4); - } - - if (vp8_read_bit(bc)) - { - int i = 0; - - do - { - pbi->common.fc.uv_mode_prob[i] = - (vp8_prob) vp8_read_literal(bc, 8); - } - while (++i < 3); - } - - read_mvcontexts(bc, mvc); - } -} - -const vp8_prob vp8_sub_mv_ref_prob3 [8][VP8_SUBMVREFS-1] = -{ - { 147, 136, 18 }, /* SUBMVREF_NORMAL */ - { 223, 1 , 34 }, /* SUBMVREF_LEFT_ABOVE_SAME */ - { 106, 145, 1 }, /* SUBMVREF_LEFT_ZED */ - { 208, 1 , 1 }, /* SUBMVREF_LEFT_ABOVE_ZED */ - { 179, 121, 1 }, /* SUBMVREF_ABOVE_ZED */ - { 223, 1 , 34 }, /* SUBMVREF_LEFT_ABOVE_SAME */ - { 179, 121, 1 }, /* SUBMVREF_ABOVE_ZED */ - { 208, 1 , 1 } /* SUBMVREF_LEFT_ABOVE_ZED */ -}; - -static -const vp8_prob * get_sub_mv_ref_prob(const int left, const int above) -{ - int lez = (left == 0); - int aez = (above == 0); - int lea = (left == above); - const vp8_prob * prob; - - prob = vp8_sub_mv_ref_prob3[(aez << 2) | - (lez << 1) | - (lea)]; - - return prob; -} - -static void decode_split_mv(vp8_reader *const bc, MODE_INFO *mi, - const MODE_INFO *left_mb, const MODE_INFO *above_mb, - MB_MODE_INFO *mbmi, int_mv best_mv, - MV_CONTEXT *const mvc, int mb_to_left_edge, - int mb_to_right_edge, int mb_to_top_edge, - int mb_to_bottom_edge) -{ - int s; /* split configuration (16x8, 8x16, 8x8, 4x4) */ - int num_p; /* number of partitions in the split configuration - (see vp8_mbsplit_count) */ - int j = 0; - - s = 3; - num_p = 16; - if( vp8_read(bc, 110) ) - { - s = 2; - num_p = 4; - if( vp8_read(bc, 111) ) - { - s = vp8_read(bc, 150); - num_p = 2; - } - } - - do /* for each subset j */ - { - int_mv leftmv, abovemv; - int_mv blockmv; - int k; /* first block in subset j */ - - const vp8_prob *prob; - k = vp8_mbsplit_offset[s][j]; - - if (!(k & 3)) - { - /* On L edge, get from MB to left of us */ - if(left_mb->mbmi.mode != SPLITMV) - leftmv.as_int = left_mb->mbmi.mv.as_int; - else - leftmv.as_int = (left_mb->bmi + k + 4 - 1)->mv.as_int; - } - else - leftmv.as_int = (mi->bmi + k - 1)->mv.as_int; - - if (!(k >> 2)) - { - /* On top edge, get from MB above us */ - if(above_mb->mbmi.mode != SPLITMV) - abovemv.as_int = above_mb->mbmi.mv.as_int; - else - abovemv.as_int = (above_mb->bmi + k + 16 - 4)->mv.as_int; - } - else - abovemv.as_int = (mi->bmi + k - 4)->mv.as_int; - - prob = get_sub_mv_ref_prob(leftmv.as_int, abovemv.as_int); - - if( vp8_read(bc, prob[0]) ) - { - if( vp8_read(bc, prob[1]) ) - { - blockmv.as_int = 0; - if( vp8_read(bc, prob[2]) ) - { - blockmv.as_mv.row = read_mvcomponent(bc, &mvc[0]) * 2; - blockmv.as_mv.row += best_mv.as_mv.row; - blockmv.as_mv.col = read_mvcomponent(bc, &mvc[1]) * 2; - blockmv.as_mv.col += best_mv.as_mv.col; - } - } - else - { - blockmv.as_int = abovemv.as_int; - } - } - else - { - blockmv.as_int = leftmv.as_int; - } - - mbmi->need_to_clamp_mvs |= vp8_check_mv_bounds(&blockmv, - mb_to_left_edge, - mb_to_right_edge, - mb_to_top_edge, - mb_to_bottom_edge); - - { - /* Fill (uniform) modes, mvs of jth subset. - Must do it here because ensuing subsets can - refer back to us via "left" or "above". */ - const unsigned char *fill_offset; - unsigned int fill_count = mbsplit_fill_count[s]; - - fill_offset = &mbsplit_fill_offset[s] - [(unsigned char)j * mbsplit_fill_count[s]]; - - do { - mi->bmi[ *fill_offset].mv.as_int = blockmv.as_int; - fill_offset++; - }while (--fill_count); - } - - } - while (++j < num_p); - - mbmi->partitioning = s; -} - -static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi) -{ - vp8_reader *const bc = & pbi->mbc[8]; - mbmi->ref_frame = (MV_REFERENCE_FRAME) vp8_read(bc, pbi->prob_intra); - if (mbmi->ref_frame) /* inter MB */ - { - enum {CNT_INTRA, CNT_NEAREST, CNT_NEAR, CNT_SPLITMV}; - int cnt[4]; - int *cntx = cnt; - int_mv near_mvs[4]; - int_mv *nmv = near_mvs; - const int mis = pbi->mb.mode_info_stride; - const MODE_INFO *above = mi - mis; - const MODE_INFO *left = mi - 1; - const MODE_INFO *aboveleft = above - 1; - int *ref_frame_sign_bias = pbi->common.ref_frame_sign_bias; - - mbmi->need_to_clamp_mvs = 0; - - if (vp8_read(bc, pbi->prob_last)) - { - mbmi->ref_frame = - (MV_REFERENCE_FRAME)((int)(2 + vp8_read(bc, pbi->prob_gf))); - } - - /* Zero accumulators */ - nmv[0].as_int = nmv[1].as_int = nmv[2].as_int = 0; - cnt[0] = cnt[1] = cnt[2] = cnt[3] = 0; - - /* Process above */ - if (above->mbmi.ref_frame != INTRA_FRAME) - { - if (above->mbmi.mv.as_int) - { - (++nmv)->as_int = above->mbmi.mv.as_int; - mv_bias(ref_frame_sign_bias[above->mbmi.ref_frame], - mbmi->ref_frame, nmv, ref_frame_sign_bias); - ++cntx; - } - - *cntx += 2; - } - - /* Process left */ - if (left->mbmi.ref_frame != INTRA_FRAME) - { - if (left->mbmi.mv.as_int) - { - int_mv this_mv; - - this_mv.as_int = left->mbmi.mv.as_int; - mv_bias(ref_frame_sign_bias[left->mbmi.ref_frame], - mbmi->ref_frame, &this_mv, ref_frame_sign_bias); - - if (this_mv.as_int != nmv->as_int) - { - (++nmv)->as_int = this_mv.as_int; - ++cntx; - } - - *cntx += 2; - } - else - cnt[CNT_INTRA] += 2; - } - - /* Process above left */ - if (aboveleft->mbmi.ref_frame != INTRA_FRAME) - { - if (aboveleft->mbmi.mv.as_int) - { - int_mv this_mv; - - this_mv.as_int = aboveleft->mbmi.mv.as_int; - mv_bias(ref_frame_sign_bias[aboveleft->mbmi.ref_frame], - mbmi->ref_frame, &this_mv, ref_frame_sign_bias); - - if (this_mv.as_int != nmv->as_int) - { - (++nmv)->as_int = this_mv.as_int; - ++cntx; - } - - *cntx += 1; - } - else - cnt[CNT_INTRA] += 1; - } - - if( vp8_read(bc, vp8_mode_contexts [cnt[CNT_INTRA]] [0]) ) - { - - /* If we have three distinct MV's ... */ - /* See if above-left MV can be merged with NEAREST */ - cnt[CNT_NEAREST] += ( (cnt[CNT_SPLITMV] > 0) & - (nmv->as_int == near_mvs[CNT_NEAREST].as_int)); - - /* Swap near and nearest if necessary */ - if (cnt[CNT_NEAR] > cnt[CNT_NEAREST]) - { - int tmp; - tmp = cnt[CNT_NEAREST]; - cnt[CNT_NEAREST] = cnt[CNT_NEAR]; - cnt[CNT_NEAR] = tmp; - tmp = near_mvs[CNT_NEAREST].as_int; - near_mvs[CNT_NEAREST].as_int = near_mvs[CNT_NEAR].as_int; - near_mvs[CNT_NEAR].as_int = tmp; - } - - if( vp8_read(bc, vp8_mode_contexts [cnt[CNT_NEAREST]] [1]) ) - { - - if( vp8_read(bc, vp8_mode_contexts [cnt[CNT_NEAR]] [2]) ) - { - int mb_to_top_edge; - int mb_to_bottom_edge; - int mb_to_left_edge; - int mb_to_right_edge; - MV_CONTEXT *const mvc = pbi->common.fc.mvc; - int near_index; - - mb_to_top_edge = pbi->mb.mb_to_top_edge; - mb_to_bottom_edge = pbi->mb.mb_to_bottom_edge; - mb_to_top_edge -= LEFT_TOP_MARGIN; - mb_to_bottom_edge += RIGHT_BOTTOM_MARGIN; - mb_to_right_edge = pbi->mb.mb_to_right_edge; - mb_to_right_edge += RIGHT_BOTTOM_MARGIN; - mb_to_left_edge = pbi->mb.mb_to_left_edge; - mb_to_left_edge -= LEFT_TOP_MARGIN; - - /* Use near_mvs[0] to store the "best" MV */ - near_index = CNT_INTRA + - (cnt[CNT_NEAREST] >= cnt[CNT_INTRA]); - - vp8_clamp_mv2(&near_mvs[near_index], &pbi->mb); - - cnt[CNT_SPLITMV] = ((above->mbmi.mode == SPLITMV) - + (left->mbmi.mode == SPLITMV)) * 2 - + (aboveleft->mbmi.mode == SPLITMV); - - if( vp8_read(bc, vp8_mode_contexts [cnt[CNT_SPLITMV]] [3]) ) - { - decode_split_mv(bc, mi, left, above, - mbmi, - near_mvs[near_index], - mvc, mb_to_left_edge, - mb_to_right_edge, - mb_to_top_edge, - mb_to_bottom_edge); - mbmi->mv.as_int = mi->bmi[15].mv.as_int; - mbmi->mode = SPLITMV; - mbmi->is_4x4 = 1; - } - else - { - int_mv *const mbmi_mv = & mbmi->mv; - read_mv(bc, &mbmi_mv->as_mv, (const MV_CONTEXT *) mvc); - mbmi_mv->as_mv.row += near_mvs[near_index].as_mv.row; - mbmi_mv->as_mv.col += near_mvs[near_index].as_mv.col; - - /* Don't need to check this on NEARMV and NEARESTMV - * modes since those modes clamp the MV. The NEWMV mode - * does not, so signal to the prediction stage whether - * special handling may be required. - */ - mbmi->need_to_clamp_mvs = - vp8_check_mv_bounds(mbmi_mv, mb_to_left_edge, - mb_to_right_edge, - mb_to_top_edge, - mb_to_bottom_edge); - mbmi->mode = NEWMV; - } - } - else - { - mbmi->mode = NEARMV; - mbmi->mv.as_int = near_mvs[CNT_NEAR].as_int; - vp8_clamp_mv2(&mbmi->mv, &pbi->mb); - } - } - else - { - mbmi->mode = NEARESTMV; - mbmi->mv.as_int = near_mvs[CNT_NEAREST].as_int; - vp8_clamp_mv2(&mbmi->mv, &pbi->mb); - } - } - else - { - mbmi->mode = ZEROMV; - mbmi->mv.as_int = 0; - } - -#if CONFIG_ERROR_CONCEALMENT - if(pbi->ec_enabled && (mbmi->mode != SPLITMV)) - { - mi->bmi[ 0].mv.as_int = - mi->bmi[ 1].mv.as_int = - mi->bmi[ 2].mv.as_int = - mi->bmi[ 3].mv.as_int = - mi->bmi[ 4].mv.as_int = - mi->bmi[ 5].mv.as_int = - mi->bmi[ 6].mv.as_int = - mi->bmi[ 7].mv.as_int = - mi->bmi[ 8].mv.as_int = - mi->bmi[ 9].mv.as_int = - mi->bmi[10].mv.as_int = - mi->bmi[11].mv.as_int = - mi->bmi[12].mv.as_int = - mi->bmi[13].mv.as_int = - mi->bmi[14].mv.as_int = - mi->bmi[15].mv.as_int = mbmi->mv.as_int; - } -#endif - } - else - { - /* required for left and above block mv */ - mbmi->mv.as_int = 0; - - /* MB is intra coded */ - if ((mbmi->mode = read_ymode(bc, pbi->common.fc.ymode_prob)) == B_PRED) - { - int j = 0; - mbmi->is_4x4 = 1; - do - { - mi->bmi[j].as_mode = read_bmode(bc, pbi->common.fc.bmode_prob); - } - while (++j < 16); - } - - mbmi->uv_mode = read_uv_mode(bc, pbi->common.fc.uv_mode_prob); - } - -} - -static void read_mb_features(vp8_reader *r, MB_MODE_INFO *mi, MACROBLOCKD *x) -{ - /* Is segmentation enabled */ - if (x->segmentation_enabled && x->update_mb_segmentation_map) - { - /* If so then read the segment id. */ - if (vp8_read(r, x->mb_segment_tree_probs[0])) - mi->segment_id = - (unsigned char)(2 + vp8_read(r, x->mb_segment_tree_probs[2])); - else - mi->segment_id = - (unsigned char)(vp8_read(r, x->mb_segment_tree_probs[1])); - } -} - -static void decode_mb_mode_mvs(VP8D_COMP *pbi, MODE_INFO *mi, - MB_MODE_INFO *mbmi) -{ - (void)mbmi; - - /* Read the Macroblock segmentation map if it is being updated explicitly - * this frame (reset to 0 above by default) - * By default on a key frame reset all MBs to segment 0 - */ - if (pbi->mb.update_mb_segmentation_map) - read_mb_features(&pbi->mbc[8], &mi->mbmi, &pbi->mb); - else if(pbi->common.frame_type == KEY_FRAME) - mi->mbmi.segment_id = 0; - - /* Read the macroblock coeff skip flag if this feature is in use, - * else default to 0 */ - if (pbi->common.mb_no_coeff_skip) - mi->mbmi.mb_skip_coeff = vp8_read(&pbi->mbc[8], pbi->prob_skip_false); - else - mi->mbmi.mb_skip_coeff = 0; - - mi->mbmi.is_4x4 = 0; - if(pbi->common.frame_type == KEY_FRAME) - read_kf_modes(pbi, mi); - else - read_mb_modes_mv(pbi, mi, &mi->mbmi); - -} - -void vp8_decode_mode_mvs(VP8D_COMP *pbi) -{ - MODE_INFO *mi = pbi->common.mi; - int mb_row = -1; - int mb_to_right_edge_start; - - mb_mode_mv_init(pbi); - - pbi->mb.mb_to_top_edge = 0; - pbi->mb.mb_to_bottom_edge = ((pbi->common.mb_rows - 1) * 16) << 3; - mb_to_right_edge_start = ((pbi->common.mb_cols - 1) * 16) << 3; - - while (++mb_row < pbi->common.mb_rows) - { - int mb_col = -1; - - pbi->mb.mb_to_left_edge = 0; - pbi->mb.mb_to_right_edge = mb_to_right_edge_start; - - while (++mb_col < pbi->common.mb_cols) - { -#if CONFIG_ERROR_CONCEALMENT - int mb_num = mb_row * pbi->common.mb_cols + mb_col; -#endif - - decode_mb_mode_mvs(pbi, mi, &mi->mbmi); - -#if CONFIG_ERROR_CONCEALMENT - /* look for corruption. set mvs_corrupt_from_mb to the current - * mb_num if the frame is corrupt from this macroblock. */ - if (vp8dx_bool_error(&pbi->mbc[8]) && mb_num < - (int)pbi->mvs_corrupt_from_mb) - { - pbi->mvs_corrupt_from_mb = mb_num; - /* no need to continue since the partition is corrupt from - * here on. - */ - return; - } -#endif - - pbi->mb.mb_to_left_edge -= (16 << 3); - pbi->mb.mb_to_right_edge -= (16 << 3); - mi++; /* next macroblock */ - } - pbi->mb.mb_to_top_edge -= (16 << 3); - pbi->mb.mb_to_bottom_edge -= (16 << 3); - - mi++; /* skip left predictor each row */ - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/decodemv.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/decodemv.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/decodemv.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/decodemv.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP8_DECODER_DECODEMV_H_ -#define VP8_DECODER_DECODEMV_H_ - -#include "onyxd_int.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void vp8_decode_mode_mvs(VP8D_COMP *); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_DECODER_DECODEMV_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/decoderthreading.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/decoderthreading.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/decoderthreading.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/decoderthreading.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP8_DECODER_DECODERTHREADING_H_ -#define VP8_DECODER_DECODERTHREADING_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#if CONFIG_MULTITHREAD -void vp8mt_decode_mb_rows(VP8D_COMP *pbi, MACROBLOCKD *xd); -void vp8_decoder_remove_threads(VP8D_COMP *pbi); -void vp8_decoder_create_threads(VP8D_COMP *pbi); -void vp8mt_alloc_temp_buffers(VP8D_COMP *pbi, int width, int prev_mb_rows); -void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows); -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_DECODER_DECODERTHREADING_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/detokenize.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/detokenize.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/detokenize.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/detokenize.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,245 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vp8/common/blockd.h" -#include "onyxd_int.h" -#include "vpx_mem/vpx_mem.h" -#include "vpx_ports/mem.h" -#include "detokenize.h" - -void vp8_reset_mb_tokens_context(MACROBLOCKD *x) -{ - ENTROPY_CONTEXT *a_ctx = ((ENTROPY_CONTEXT *)x->above_context); - ENTROPY_CONTEXT *l_ctx = ((ENTROPY_CONTEXT *)x->left_context); - - vpx_memset(a_ctx, 0, sizeof(ENTROPY_CONTEXT_PLANES)-1); - vpx_memset(l_ctx, 0, sizeof(ENTROPY_CONTEXT_PLANES)-1); - - /* Clear entropy contexts for Y2 blocks */ - if (!x->mode_info_context->mbmi.is_4x4) - { - a_ctx[8] = l_ctx[8] = 0; - } -} - -/* - ------------------------------------------------------------------------------ - Residual decoding (Paragraph 13.2 / 13.3) -*/ -static const uint8_t kBands[16 + 1] = { - 0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, - 0 /* extra entry as sentinel */ -}; - -static const uint8_t kCat3[] = { 173, 148, 140, 0 }; -static const uint8_t kCat4[] = { 176, 155, 140, 135, 0 }; -static const uint8_t kCat5[] = { 180, 157, 141, 134, 130, 0 }; -static const uint8_t kCat6[] = - { 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0 }; -static const uint8_t* const kCat3456[] = { kCat3, kCat4, kCat5, kCat6 }; -static const uint8_t kZigzag[16] = { - 0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15 -}; - -#define VP8GetBit vp8dx_decode_bool -#define NUM_PROBAS 11 -#define NUM_CTX 3 - -/* for const-casting */ -typedef const uint8_t (*ProbaArray)[NUM_CTX][NUM_PROBAS]; - -static int GetSigned(BOOL_DECODER *br, int value_to_sign) -{ - int split = (br->range + 1) >> 1; - VP8_BD_VALUE bigsplit = (VP8_BD_VALUE)split << (VP8_BD_VALUE_SIZE - 8); - int v; - - if(br->count < 0) - vp8dx_bool_decoder_fill(br); - - if ( br->value < bigsplit ) - { - br->range = split; - v= value_to_sign; - } - else - { - br->range = br->range-split; - br->value = br->value-bigsplit; - v = -value_to_sign; - } - br->range +=br->range; - br->value +=br->value; - br->count--; - - return v; -} -/* - Returns the position of the last non-zero coeff plus one - (and 0 if there's no coeff at all) -*/ -static int GetCoeffs(BOOL_DECODER *br, ProbaArray prob, - int ctx, int n, int16_t* out) -{ - const uint8_t* p = prob[n][ctx]; - if (!VP8GetBit(br, p[0])) - { /* first EOB is more a 'CBP' bit. */ - return 0; - } - while (1) - { - ++n; - if (!VP8GetBit(br, p[1])) - { - p = prob[kBands[n]][0]; - } - else - { /* non zero coeff */ - int v, j; - if (!VP8GetBit(br, p[2])) - { - p = prob[kBands[n]][1]; - v = 1; - } - else - { - if (!VP8GetBit(br, p[3])) - { - if (!VP8GetBit(br, p[4])) - { - v = 2; - } - else - { - v = 3 + VP8GetBit(br, p[5]); - } - } - else - { - if (!VP8GetBit(br, p[6])) - { - if (!VP8GetBit(br, p[7])) - { - v = 5 + VP8GetBit(br, 159); - } else - { - v = 7 + 2 * VP8GetBit(br, 165); - v += VP8GetBit(br, 145); - } - } - else - { - const uint8_t* tab; - const int bit1 = VP8GetBit(br, p[8]); - const int bit0 = VP8GetBit(br, p[9 + bit1]); - const int cat = 2 * bit1 + bit0; - v = 0; - for (tab = kCat3456[cat]; *tab; ++tab) - { - v += v + VP8GetBit(br, *tab); - } - v += 3 + (8 << cat); - } - } - p = prob[kBands[n]][2]; - } - j = kZigzag[n - 1]; - - out[j] = GetSigned(br, v); - - if (n == 16 || !VP8GetBit(br, p[0])) - { /* EOB */ - return n; - } - } - if (n == 16) - { - return 16; - } - } -} - -int vp8_decode_mb_tokens(VP8D_COMP *dx, MACROBLOCKD *x) -{ - BOOL_DECODER *bc = x->current_bc; - const FRAME_CONTEXT * const fc = &dx->common.fc; - char *eobs = x->eobs; - - int i; - int nonzeros; - int eobtotal = 0; - - short *qcoeff_ptr; - ProbaArray coef_probs; - ENTROPY_CONTEXT *a_ctx = ((ENTROPY_CONTEXT *)x->above_context); - ENTROPY_CONTEXT *l_ctx = ((ENTROPY_CONTEXT *)x->left_context); - ENTROPY_CONTEXT *a; - ENTROPY_CONTEXT *l; - int skip_dc = 0; - - qcoeff_ptr = &x->qcoeff[0]; - - if (!x->mode_info_context->mbmi.is_4x4) - { - a = a_ctx + 8; - l = l_ctx + 8; - - coef_probs = fc->coef_probs [1]; - - nonzeros = GetCoeffs(bc, coef_probs, (*a + *l), 0, qcoeff_ptr + 24 * 16); - *a = *l = (nonzeros > 0); - - eobs[24] = nonzeros; - eobtotal += nonzeros - 16; - - coef_probs = fc->coef_probs [0]; - skip_dc = 1; - } - else - { - coef_probs = fc->coef_probs [3]; - skip_dc = 0; - } - - for (i = 0; i < 16; ++i) - { - a = a_ctx + (i&3); - l = l_ctx + ((i&0xc)>>2); - - nonzeros = GetCoeffs(bc, coef_probs, (*a + *l), skip_dc, qcoeff_ptr); - *a = *l = (nonzeros > 0); - - nonzeros += skip_dc; - eobs[i] = nonzeros; - eobtotal += nonzeros; - qcoeff_ptr += 16; - } - - coef_probs = fc->coef_probs [2]; - - a_ctx += 4; - l_ctx += 4; - for (i = 16; i < 24; ++i) - { - a = a_ctx + ((i > 19)<<1) + (i&1); - l = l_ctx + ((i > 19)<<1) + ((i&3)>1); - - nonzeros = GetCoeffs(bc, coef_probs, (*a + *l), 0, qcoeff_ptr); - *a = *l = (nonzeros > 0); - - eobs[i] = nonzeros; - eobtotal += nonzeros; - qcoeff_ptr += 16; - } - - return eobtotal; -} - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/detokenize.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/detokenize.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/detokenize.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/detokenize.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP8_DECODER_DETOKENIZE_H_ -#define VP8_DECODER_DETOKENIZE_H_ - -#include "onyxd_int.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void vp8_reset_mb_tokens_context(MACROBLOCKD *x); -int vp8_decode_mb_tokens(VP8D_COMP *, MACROBLOCKD *); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_DECODER_DETOKENIZE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/ec_types.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/ec_types.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/ec_types.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/ec_types.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2011 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP8_DECODER_EC_TYPES_H_ -#define VP8_DECODER_EC_TYPES_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#define MAX_OVERLAPS 16 - - -/* The area (pixel area in Q6) the block pointed to by bmi overlaps - * another block with. - */ -typedef struct -{ - int overlap; - union b_mode_info *bmi; -} OVERLAP_NODE; - -/* Structure to keep track of overlapping blocks on a block level. */ -typedef struct -{ - /* TODO(holmer): This array should be exchanged for a linked list */ - OVERLAP_NODE overlaps[MAX_OVERLAPS]; -} B_OVERLAP; - -/* Structure used to hold all the overlaps of a macroblock. The overlaps of a - * macroblock is further divided into block overlaps. - */ -typedef struct -{ - B_OVERLAP overlaps[16]; -} MB_OVERLAP; - -/* Structure for keeping track of motion vectors and which reference frame they - * refer to. Used for motion vector interpolation. - */ -typedef struct -{ - MV mv; - MV_REFERENCE_FRAME ref_frame; -} EC_BLOCK; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_DECODER_EC_TYPES_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/error_concealment.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/error_concealment.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/error_concealment.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/error_concealment.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,596 +0,0 @@ -/* - * Copyright (c) 2011 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "error_concealment.h" -#include "onyxd_int.h" -#include "decodemv.h" -#include "vpx_mem/vpx_mem.h" -#include "vp8/common/findnearmv.h" -#include "vp8/common/common.h" - -#define FLOOR(x,q) ((x) & -(1 << (q))) - -#define NUM_NEIGHBORS 20 - -typedef struct ec_position -{ - int row; - int col; -} EC_POS; - -/* - * Regenerate the table in Matlab with: - * x = meshgrid((1:4), (1:4)); - * y = meshgrid((1:4), (1:4))'; - * W = round((1./(sqrt(x.^2 + y.^2))*2^7)); - * W(1,1) = 0; - */ -static const int weights_q7[5][5] = { - { 0, 128, 64, 43, 32 }, - {128, 91, 57, 40, 31 }, - { 64, 57, 45, 36, 29 }, - { 43, 40, 36, 30, 26 }, - { 32, 31, 29, 26, 23 } -}; - -int vp8_alloc_overlap_lists(VP8D_COMP *pbi) -{ - if (pbi->overlaps != NULL) - { - vpx_free(pbi->overlaps); - pbi->overlaps = NULL; - } - - pbi->overlaps = vpx_calloc(pbi->common.mb_rows * pbi->common.mb_cols, - sizeof(MB_OVERLAP)); - - if (pbi->overlaps == NULL) - return -1; - - return 0; -} - -void vp8_de_alloc_overlap_lists(VP8D_COMP *pbi) -{ - vpx_free(pbi->overlaps); - pbi->overlaps = NULL; -} - -/* Inserts a new overlap area value to the list of overlaps of a block */ -static void assign_overlap(OVERLAP_NODE* overlaps, - union b_mode_info *bmi, - int overlap) -{ - int i; - if (overlap <= 0) - return; - /* Find and assign to the next empty overlap node in the list of overlaps. - * Empty is defined as bmi == NULL */ - for (i = 0; i < MAX_OVERLAPS; i++) - { - if (overlaps[i].bmi == NULL) - { - overlaps[i].bmi = bmi; - overlaps[i].overlap = overlap; - break; - } - } -} - -/* Calculates the overlap area between two 4x4 squares, where the first - * square has its upper-left corner at (b1_row, b1_col) and the second - * square has its upper-left corner at (b2_row, b2_col). Doesn't - * properly handle squares which do not overlap. - */ -static int block_overlap(int b1_row, int b1_col, int b2_row, int b2_col) -{ - const int int_top = MAX(b1_row, b2_row); // top - const int int_left = MAX(b1_col, b2_col); // left - /* Since each block is 4x4 pixels, adding 4 (Q3) to the left/top edge - * gives us the right/bottom edge. - */ - const int int_right = MIN(b1_col + (4<<3), b2_col + (4<<3)); // right - const int int_bottom = MIN(b1_row + (4<<3), b2_row + (4<<3)); // bottom - return (int_bottom - int_top) * (int_right - int_left); -} - -/* Calculates the overlap area for all blocks in a macroblock at position - * (mb_row, mb_col) in macroblocks, which are being overlapped by a given - * overlapping block at position (new_row, new_col) (in pixels, Q3). The - * first block being overlapped in the macroblock has position (first_blk_row, - * first_blk_col) in blocks relative the upper-left corner of the image. - */ -static void calculate_overlaps_mb(B_OVERLAP *b_overlaps, union b_mode_info *bmi, - int new_row, int new_col, - int mb_row, int mb_col, - int first_blk_row, int first_blk_col) -{ - /* Find the blocks within this MB (defined by mb_row, mb_col) which are - * overlapped by bmi and calculate and assign overlap for each of those - * blocks. */ - - /* Block coordinates relative the upper-left block */ - const int rel_ol_blk_row = first_blk_row - mb_row * 4; - const int rel_ol_blk_col = first_blk_col - mb_col * 4; - /* If the block partly overlaps any previous MB, these coordinates - * can be < 0. We don't want to access blocks in previous MBs. - */ - const int blk_idx = MAX(rel_ol_blk_row,0) * 4 + MAX(rel_ol_blk_col,0); - /* Upper left overlapping block */ - B_OVERLAP *b_ol_ul = &(b_overlaps[blk_idx]); - - /* Calculate and assign overlaps for all blocks in this MB - * which the motion compensated block overlaps - */ - /* Avoid calculating overlaps for blocks in later MBs */ - int end_row = MIN(4 + mb_row * 4 - first_blk_row, 2); - int end_col = MIN(4 + mb_col * 4 - first_blk_col, 2); - int row, col; - - /* Check if new_row and new_col are evenly divisible by 4 (Q3), - * and if so we shouldn't check neighboring blocks - */ - if (new_row >= 0 && (new_row & 0x1F) == 0) - end_row = 1; - if (new_col >= 0 && (new_col & 0x1F) == 0) - end_col = 1; - - /* Check if the overlapping block partly overlaps a previous MB - * and if so, we're overlapping fewer blocks in this MB. - */ - if (new_row < (mb_row*16)<<3) - end_row = 1; - if (new_col < (mb_col*16)<<3) - end_col = 1; - - for (row = 0; row < end_row; ++row) - { - for (col = 0; col < end_col; ++col) - { - /* input in Q3, result in Q6 */ - const int overlap = block_overlap(new_row, new_col, - (((first_blk_row + row) * - 4) << 3), - (((first_blk_col + col) * - 4) << 3)); - assign_overlap(b_ol_ul[row * 4 + col].overlaps, bmi, overlap); - } - } -} - -void vp8_calculate_overlaps(MB_OVERLAP *overlap_ul, - int mb_rows, int mb_cols, - union b_mode_info *bmi, - int b_row, int b_col) -{ - MB_OVERLAP *mb_overlap; - int row, col, rel_row, rel_col; - int new_row, new_col; - int end_row, end_col; - int overlap_b_row, overlap_b_col; - int overlap_mb_row, overlap_mb_col; - - /* mb subpixel position */ - row = (4 * b_row) << 3; /* Q3 */ - col = (4 * b_col) << 3; /* Q3 */ - - /* reverse compensate for motion */ - new_row = row - bmi->mv.as_mv.row; - new_col = col - bmi->mv.as_mv.col; - - if (new_row >= ((16*mb_rows) << 3) || new_col >= ((16*mb_cols) << 3)) - { - /* the new block ended up outside the frame */ - return; - } - - if (new_row <= (-4 << 3) || new_col <= (-4 << 3)) - { - /* outside the frame */ - return; - } - /* overlapping block's position in blocks */ - overlap_b_row = FLOOR(new_row / 4, 3) >> 3; - overlap_b_col = FLOOR(new_col / 4, 3) >> 3; - - /* overlapping block's MB position in MBs - * operations are done in Q3 - */ - overlap_mb_row = FLOOR((overlap_b_row << 3) / 4, 3) >> 3; - overlap_mb_col = FLOOR((overlap_b_col << 3) / 4, 3) >> 3; - - end_row = MIN(mb_rows - overlap_mb_row, 2); - end_col = MIN(mb_cols - overlap_mb_col, 2); - - /* Don't calculate overlap for MBs we don't overlap */ - /* Check if the new block row starts at the last block row of the MB */ - if (abs(new_row - ((16*overlap_mb_row) << 3)) < ((3*4) << 3)) - end_row = 1; - /* Check if the new block col starts at the last block col of the MB */ - if (abs(new_col - ((16*overlap_mb_col) << 3)) < ((3*4) << 3)) - end_col = 1; - - /* find the MB(s) this block is overlapping */ - for (rel_row = 0; rel_row < end_row; ++rel_row) - { - for (rel_col = 0; rel_col < end_col; ++rel_col) - { - if (overlap_mb_row + rel_row < 0 || - overlap_mb_col + rel_col < 0) - continue; - mb_overlap = overlap_ul + (overlap_mb_row + rel_row) * mb_cols + - overlap_mb_col + rel_col; - - calculate_overlaps_mb(mb_overlap->overlaps, bmi, - new_row, new_col, - overlap_mb_row + rel_row, - overlap_mb_col + rel_col, - overlap_b_row + rel_row, - overlap_b_col + rel_col); - } - } -} - -/* Estimates a motion vector given the overlapping blocks' motion vectors. - * Filters out all overlapping blocks which do not refer to the correct - * reference frame type. - */ -static void estimate_mv(const OVERLAP_NODE *overlaps, union b_mode_info *bmi) -{ - int i; - int overlap_sum = 0; - int row_acc = 0; - int col_acc = 0; - - bmi->mv.as_int = 0; - for (i=0; i < MAX_OVERLAPS; ++i) - { - if (overlaps[i].bmi == NULL) - break; - col_acc += overlaps[i].overlap * overlaps[i].bmi->mv.as_mv.col; - row_acc += overlaps[i].overlap * overlaps[i].bmi->mv.as_mv.row; - overlap_sum += overlaps[i].overlap; - } - if (overlap_sum > 0) - { - /* Q9 / Q6 = Q3 */ - bmi->mv.as_mv.col = col_acc / overlap_sum; - bmi->mv.as_mv.row = row_acc / overlap_sum; - } - else - { - bmi->mv.as_mv.col = 0; - bmi->mv.as_mv.row = 0; - } -} - -/* Estimates all motion vectors for a macroblock given the lists of - * overlaps for each block. Decides whether or not the MVs must be clamped. - */ -static void estimate_mb_mvs(const B_OVERLAP *block_overlaps, - MODE_INFO *mi, - int mb_to_left_edge, - int mb_to_right_edge, - int mb_to_top_edge, - int mb_to_bottom_edge) -{ - int row, col; - int non_zero_count = 0; - MV * const filtered_mv = &(mi->mbmi.mv.as_mv); - union b_mode_info * const bmi = mi->bmi; - filtered_mv->col = 0; - filtered_mv->row = 0; - mi->mbmi.need_to_clamp_mvs = 0; - for (row = 0; row < 4; ++row) - { - int this_b_to_top_edge = mb_to_top_edge + ((row*4)<<3); - int this_b_to_bottom_edge = mb_to_bottom_edge - ((row*4)<<3); - for (col = 0; col < 4; ++col) - { - int i = row * 4 + col; - int this_b_to_left_edge = mb_to_left_edge + ((col*4)<<3); - int this_b_to_right_edge = mb_to_right_edge - ((col*4)<<3); - /* Estimate vectors for all blocks which are overlapped by this */ - /* type. Interpolate/extrapolate the rest of the block's MVs */ - estimate_mv(block_overlaps[i].overlaps, &(bmi[i])); - mi->mbmi.need_to_clamp_mvs |= vp8_check_mv_bounds( - &bmi[i].mv, - this_b_to_left_edge, - this_b_to_right_edge, - this_b_to_top_edge, - this_b_to_bottom_edge); - if (bmi[i].mv.as_int != 0) - { - ++non_zero_count; - filtered_mv->col += bmi[i].mv.as_mv.col; - filtered_mv->row += bmi[i].mv.as_mv.row; - } - } - } - if (non_zero_count > 0) - { - filtered_mv->col /= non_zero_count; - filtered_mv->row /= non_zero_count; - } -} - -static void calc_prev_mb_overlaps(MB_OVERLAP *overlaps, MODE_INFO *prev_mi, - int mb_row, int mb_col, - int mb_rows, int mb_cols) -{ - int sub_row; - int sub_col; - for (sub_row = 0; sub_row < 4; ++sub_row) - { - for (sub_col = 0; sub_col < 4; ++sub_col) - { - vp8_calculate_overlaps( - overlaps, mb_rows, mb_cols, - &(prev_mi->bmi[sub_row * 4 + sub_col]), - 4 * mb_row + sub_row, - 4 * mb_col + sub_col); - } - } -} - -/* Estimate all missing motion vectors. This function does the same as the one - * above, but has different input arguments. */ -static void estimate_missing_mvs(MB_OVERLAP *overlaps, - MODE_INFO *mi, MODE_INFO *prev_mi, - int mb_rows, int mb_cols, - unsigned int first_corrupt) -{ - int mb_row, mb_col; - vpx_memset(overlaps, 0, sizeof(MB_OVERLAP) * mb_rows * mb_cols); - /* First calculate the overlaps for all blocks */ - for (mb_row = 0; mb_row < mb_rows; ++mb_row) - { - for (mb_col = 0; mb_col < mb_cols; ++mb_col) - { - /* We're only able to use blocks referring to the last frame - * when extrapolating new vectors. - */ - if (prev_mi->mbmi.ref_frame == LAST_FRAME) - { - calc_prev_mb_overlaps(overlaps, prev_mi, - mb_row, mb_col, - mb_rows, mb_cols); - } - ++prev_mi; - } - ++prev_mi; - } - - mb_row = first_corrupt / mb_cols; - mb_col = first_corrupt - mb_row * mb_cols; - mi += mb_row*(mb_cols + 1) + mb_col; - /* Go through all macroblocks in the current image with missing MVs - * and calculate new MVs using the overlaps. - */ - for (; mb_row < mb_rows; ++mb_row) - { - int mb_to_top_edge = -((mb_row * 16)) << 3; - int mb_to_bottom_edge = ((mb_rows - 1 - mb_row) * 16) << 3; - for (; mb_col < mb_cols; ++mb_col) - { - int mb_to_left_edge = -((mb_col * 16) << 3); - int mb_to_right_edge = ((mb_cols - 1 - mb_col) * 16) << 3; - const B_OVERLAP *block_overlaps = - overlaps[mb_row*mb_cols + mb_col].overlaps; - mi->mbmi.ref_frame = LAST_FRAME; - mi->mbmi.mode = SPLITMV; - mi->mbmi.uv_mode = DC_PRED; - mi->mbmi.partitioning = 3; - mi->mbmi.segment_id = 0; - estimate_mb_mvs(block_overlaps, - mi, - mb_to_left_edge, - mb_to_right_edge, - mb_to_top_edge, - mb_to_bottom_edge); - ++mi; - } - mb_col = 0; - ++mi; - } -} - -void vp8_estimate_missing_mvs(VP8D_COMP *pbi) -{ - VP8_COMMON * const pc = &pbi->common; - estimate_missing_mvs(pbi->overlaps, - pc->mi, pc->prev_mi, - pc->mb_rows, pc->mb_cols, - pbi->mvs_corrupt_from_mb); -} - -static void assign_neighbor(EC_BLOCK *neighbor, MODE_INFO *mi, int block_idx) -{ - assert(mi->mbmi.ref_frame < MAX_REF_FRAMES); - neighbor->ref_frame = mi->mbmi.ref_frame; - neighbor->mv = mi->bmi[block_idx].mv.as_mv; -} - -/* Finds the neighboring blocks of a macroblocks. In the general case - * 20 blocks are found. If a fewer number of blocks are found due to - * image boundaries, those positions in the EC_BLOCK array are left "empty". - * The neighbors are enumerated with the upper-left neighbor as the first - * element, the second element refers to the neighbor to right of the previous - * neighbor, and so on. The last element refers to the neighbor below the first - * neighbor. - */ -static void find_neighboring_blocks(MODE_INFO *mi, - EC_BLOCK *neighbors, - int mb_row, int mb_col, - int mb_rows, int mb_cols, - int mi_stride) -{ - int i = 0; - int j; - if (mb_row > 0) - { - /* upper left */ - if (mb_col > 0) - assign_neighbor(&neighbors[i], mi - mi_stride - 1, 15); - ++i; - /* above */ - for (j = 12; j < 16; ++j, ++i) - assign_neighbor(&neighbors[i], mi - mi_stride, j); - } - else - i += 5; - if (mb_col < mb_cols - 1) - { - /* upper right */ - if (mb_row > 0) - assign_neighbor(&neighbors[i], mi - mi_stride + 1, 12); - ++i; - /* right */ - for (j = 0; j <= 12; j += 4, ++i) - assign_neighbor(&neighbors[i], mi + 1, j); - } - else - i += 5; - if (mb_row < mb_rows - 1) - { - /* lower right */ - if (mb_col < mb_cols - 1) - assign_neighbor(&neighbors[i], mi + mi_stride + 1, 0); - ++i; - /* below */ - for (j = 0; j < 4; ++j, ++i) - assign_neighbor(&neighbors[i], mi + mi_stride, j); - } - else - i += 5; - if (mb_col > 0) - { - /* lower left */ - if (mb_row < mb_rows - 1) - assign_neighbor(&neighbors[i], mi + mi_stride - 1, 4); - ++i; - /* left */ - for (j = 3; j < 16; j += 4, ++i) - { - assign_neighbor(&neighbors[i], mi - 1, j); - } - } - else - i += 5; - assert(i == 20); -} - -/* Interpolates all motion vectors for a macroblock from the neighboring blocks' - * motion vectors. - */ -static void interpolate_mvs(MACROBLOCKD *mb, - EC_BLOCK *neighbors, - MV_REFERENCE_FRAME dom_ref_frame) -{ - int row, col, i; - MODE_INFO * const mi = mb->mode_info_context; - /* Table with the position of the neighboring blocks relative the position - * of the upper left block of the current MB. Starting with the upper left - * neighbor and going to the right. - */ - const EC_POS neigh_pos[NUM_NEIGHBORS] = { - {-1,-1}, {-1,0}, {-1,1}, {-1,2}, {-1,3}, - {-1,4}, {0,4}, {1,4}, {2,4}, {3,4}, - {4,4}, {4,3}, {4,2}, {4,1}, {4,0}, - {4,-1}, {3,-1}, {2,-1}, {1,-1}, {0,-1} - }; - mi->mbmi.need_to_clamp_mvs = 0; - for (row = 0; row < 4; ++row) - { - int mb_to_top_edge = mb->mb_to_top_edge + ((row*4)<<3); - int mb_to_bottom_edge = mb->mb_to_bottom_edge - ((row*4)<<3); - for (col = 0; col < 4; ++col) - { - int mb_to_left_edge = mb->mb_to_left_edge + ((col*4)<<3); - int mb_to_right_edge = mb->mb_to_right_edge - ((col*4)<<3); - int w_sum = 0; - int mv_row_sum = 0; - int mv_col_sum = 0; - int_mv * const mv = &(mi->bmi[row*4 + col].mv); - mv->as_int = 0; - for (i = 0; i < NUM_NEIGHBORS; ++i) - { - /* Calculate the weighted sum of neighboring MVs referring - * to the dominant frame type. - */ - const int w = weights_q7[abs(row - neigh_pos[i].row)] - [abs(col - neigh_pos[i].col)]; - if (neighbors[i].ref_frame != dom_ref_frame) - continue; - w_sum += w; - /* Q7 * Q3 = Q10 */ - mv_row_sum += w*neighbors[i].mv.row; - mv_col_sum += w*neighbors[i].mv.col; - } - if (w_sum > 0) - { - /* Avoid division by zero. - * Normalize with the sum of the coefficients - * Q3 = Q10 / Q7 - */ - mv->as_mv.row = mv_row_sum / w_sum; - mv->as_mv.col = mv_col_sum / w_sum; - mi->mbmi.need_to_clamp_mvs |= vp8_check_mv_bounds( - mv, - mb_to_left_edge, - mb_to_right_edge, - mb_to_top_edge, - mb_to_bottom_edge); - } - } - } -} - -void vp8_interpolate_motion(MACROBLOCKD *mb, - int mb_row, int mb_col, - int mb_rows, int mb_cols, - int mi_stride) -{ - /* Find relevant neighboring blocks */ - EC_BLOCK neighbors[NUM_NEIGHBORS]; - int i; - /* Initialize the array. MAX_REF_FRAMES is interpreted as "doesn't exist" */ - for (i = 0; i < NUM_NEIGHBORS; ++i) - { - neighbors[i].ref_frame = MAX_REF_FRAMES; - neighbors[i].mv.row = neighbors[i].mv.col = 0; - } - find_neighboring_blocks(mb->mode_info_context, - neighbors, - mb_row, mb_col, - mb_rows, mb_cols, - mb->mode_info_stride); - /* Interpolate MVs for the missing blocks from the surrounding - * blocks which refer to the last frame. */ - interpolate_mvs(mb, neighbors, LAST_FRAME); - - mb->mode_info_context->mbmi.ref_frame = LAST_FRAME; - mb->mode_info_context->mbmi.mode = SPLITMV; - mb->mode_info_context->mbmi.uv_mode = DC_PRED; - mb->mode_info_context->mbmi.partitioning = 3; - mb->mode_info_context->mbmi.segment_id = 0; -} - -void vp8_conceal_corrupt_mb(MACROBLOCKD *xd) -{ - /* This macroblock has corrupt residual, use the motion compensated - image (predictor) for concealment */ - - /* The build predictor functions now output directly into the dst buffer, - * so the copies are no longer necessary */ - -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/error_concealment.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/error_concealment.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/error_concealment.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/error_concealment.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2011 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_DECODER_ERROR_CONCEALMENT_H_ -#define VP8_DECODER_ERROR_CONCEALMENT_H_ - -#include "onyxd_int.h" -#include "ec_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Allocate memory for the overlap lists */ -int vp8_alloc_overlap_lists(VP8D_COMP *pbi); - -/* Deallocate the overlap lists */ -void vp8_de_alloc_overlap_lists(VP8D_COMP *pbi); - -/* Estimate all missing motion vectors. */ -void vp8_estimate_missing_mvs(VP8D_COMP *pbi); - -/* Functions for spatial MV interpolation */ - -/* Interpolates all motion vectors for a macroblock mb at position - * (mb_row, mb_col). */ -void vp8_interpolate_motion(MACROBLOCKD *mb, - int mb_row, int mb_col, - int mb_rows, int mb_cols, - int mi_stride); - -/* Conceal a macroblock with corrupt residual. - * Copies the prediction signal to the reconstructed image. - */ -void vp8_conceal_corrupt_mb(MACROBLOCKD *xd); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_DECODER_ERROR_CONCEALMENT_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/onyxd_if.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/onyxd_if.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/onyxd_if.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/onyxd_if.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,505 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vp8/common/onyxc_int.h" -#if CONFIG_POSTPROC -#include "vp8/common/postproc.h" -#endif -#include "vp8/common/onyxd.h" -#include "onyxd_int.h" -#include "vpx_mem/vpx_mem.h" -#include "vp8/common/alloccommon.h" -#include "vp8/common/loopfilter.h" -#include "vp8/common/swapyv12buffer.h" -#include "vp8/common/threading.h" -#include "decoderthreading.h" -#include -#include - -#include "vp8/common/quant_common.h" -#include "./vpx_scale_rtcd.h" -#include "vpx_scale/vpx_scale.h" -#include "vp8/common/systemdependent.h" -#include "vpx_ports/vpx_timer.h" -#include "detokenize.h" -#if CONFIG_ERROR_CONCEALMENT -#include "error_concealment.h" -#endif -#if ARCH_ARM -#include "vpx_ports/arm.h" -#endif - -extern void vp8_init_loop_filter(VP8_COMMON *cm); -extern void vp8cx_init_de_quantizer(VP8D_COMP *pbi); -static int get_free_fb (VP8_COMMON *cm); -static void ref_cnt_fb (int *buf, int *idx, int new_idx); - -static void remove_decompressor(VP8D_COMP *pbi) -{ -#if CONFIG_ERROR_CONCEALMENT - vp8_de_alloc_overlap_lists(pbi); -#endif - vp8_remove_common(&pbi->common); - vpx_free(pbi); -} - -static struct VP8D_COMP * create_decompressor(VP8D_CONFIG *oxcf) -{ - VP8D_COMP *pbi = vpx_memalign(32, sizeof(VP8D_COMP)); - - if (!pbi) - return NULL; - - vpx_memset(pbi, 0, sizeof(VP8D_COMP)); - - if (setjmp(pbi->common.error.jmp)) - { - pbi->common.error.setjmp = 0; - remove_decompressor(pbi); - return 0; - } - - pbi->common.error.setjmp = 1; - - vp8_create_common(&pbi->common); - - pbi->common.current_video_frame = 0; - pbi->ready_for_new_data = 1; - - /* vp8cx_init_de_quantizer() is first called here. Add check in frame_init_dequantizer() to avoid - * unnecessary calling of vp8cx_init_de_quantizer() for every frame. - */ - vp8cx_init_de_quantizer(pbi); - - vp8_loop_filter_init(&pbi->common); - - pbi->common.error.setjmp = 0; - -#if CONFIG_ERROR_CONCEALMENT - pbi->ec_enabled = oxcf->error_concealment; - pbi->overlaps = NULL; -#else - (void)oxcf; - pbi->ec_enabled = 0; -#endif - /* Error concealment is activated after a key frame has been - * decoded without errors when error concealment is enabled. - */ - pbi->ec_active = 0; - - pbi->decoded_key_frame = 0; - - /* Independent partitions is activated when a frame updates the - * token probability table to have equal probabilities over the - * PREV_COEF context. - */ - pbi->independent_partitions = 0; - - vp8_setup_block_dptrs(&pbi->mb); - - return pbi; -} - -vpx_codec_err_t vp8dx_get_reference(VP8D_COMP *pbi, enum vpx_ref_frame_type ref_frame_flag, YV12_BUFFER_CONFIG *sd) -{ - VP8_COMMON *cm = &pbi->common; - int ref_fb_idx; - - if (ref_frame_flag == VP8_LAST_FRAME) - ref_fb_idx = cm->lst_fb_idx; - else if (ref_frame_flag == VP8_GOLD_FRAME) - ref_fb_idx = cm->gld_fb_idx; - else if (ref_frame_flag == VP8_ALTR_FRAME) - ref_fb_idx = cm->alt_fb_idx; - else{ - vpx_internal_error(&pbi->common.error, VPX_CODEC_ERROR, - "Invalid reference frame"); - return pbi->common.error.error_code; - } - - if(cm->yv12_fb[ref_fb_idx].y_height != sd->y_height || - cm->yv12_fb[ref_fb_idx].y_width != sd->y_width || - cm->yv12_fb[ref_fb_idx].uv_height != sd->uv_height || - cm->yv12_fb[ref_fb_idx].uv_width != sd->uv_width){ - vpx_internal_error(&pbi->common.error, VPX_CODEC_ERROR, - "Incorrect buffer dimensions"); - } - else - vp8_yv12_copy_frame(&cm->yv12_fb[ref_fb_idx], sd); - - return pbi->common.error.error_code; -} - - -vpx_codec_err_t vp8dx_set_reference(VP8D_COMP *pbi, enum vpx_ref_frame_type ref_frame_flag, YV12_BUFFER_CONFIG *sd) -{ - VP8_COMMON *cm = &pbi->common; - int *ref_fb_ptr = NULL; - int free_fb; - - if (ref_frame_flag == VP8_LAST_FRAME) - ref_fb_ptr = &cm->lst_fb_idx; - else if (ref_frame_flag == VP8_GOLD_FRAME) - ref_fb_ptr = &cm->gld_fb_idx; - else if (ref_frame_flag == VP8_ALTR_FRAME) - ref_fb_ptr = &cm->alt_fb_idx; - else{ - vpx_internal_error(&pbi->common.error, VPX_CODEC_ERROR, - "Invalid reference frame"); - return pbi->common.error.error_code; - } - - if(cm->yv12_fb[*ref_fb_ptr].y_height != sd->y_height || - cm->yv12_fb[*ref_fb_ptr].y_width != sd->y_width || - cm->yv12_fb[*ref_fb_ptr].uv_height != sd->uv_height || - cm->yv12_fb[*ref_fb_ptr].uv_width != sd->uv_width){ - vpx_internal_error(&pbi->common.error, VPX_CODEC_ERROR, - "Incorrect buffer dimensions"); - } - else{ - /* Find an empty frame buffer. */ - free_fb = get_free_fb(cm); - /* Decrease fb_idx_ref_cnt since it will be increased again in - * ref_cnt_fb() below. */ - cm->fb_idx_ref_cnt[free_fb]--; - - /* Manage the reference counters and copy image. */ - ref_cnt_fb (cm->fb_idx_ref_cnt, ref_fb_ptr, free_fb); - vp8_yv12_copy_frame(sd, &cm->yv12_fb[*ref_fb_ptr]); - } - - return pbi->common.error.error_code; -} - -static int get_free_fb (VP8_COMMON *cm) -{ - int i; - for (i = 0; i < NUM_YV12_BUFFERS; i++) - if (cm->fb_idx_ref_cnt[i] == 0) - break; - - assert(i < NUM_YV12_BUFFERS); - cm->fb_idx_ref_cnt[i] = 1; - return i; -} - -static void ref_cnt_fb (int *buf, int *idx, int new_idx) -{ - if (buf[*idx] > 0) - buf[*idx]--; - - *idx = new_idx; - - buf[new_idx]++; -} - -/* If any buffer copy / swapping is signalled it should be done here. */ -static int swap_frame_buffers (VP8_COMMON *cm) -{ - int err = 0; - - /* The alternate reference frame or golden frame can be updated - * using the new, last, or golden/alt ref frame. If it - * is updated using the newly decoded frame it is a refresh. - * An update using the last or golden/alt ref frame is a copy. - */ - if (cm->copy_buffer_to_arf) - { - int new_fb = 0; - - if (cm->copy_buffer_to_arf == 1) - new_fb = cm->lst_fb_idx; - else if (cm->copy_buffer_to_arf == 2) - new_fb = cm->gld_fb_idx; - else - err = -1; - - ref_cnt_fb (cm->fb_idx_ref_cnt, &cm->alt_fb_idx, new_fb); - } - - if (cm->copy_buffer_to_gf) - { - int new_fb = 0; - - if (cm->copy_buffer_to_gf == 1) - new_fb = cm->lst_fb_idx; - else if (cm->copy_buffer_to_gf == 2) - new_fb = cm->alt_fb_idx; - else - err = -1; - - ref_cnt_fb (cm->fb_idx_ref_cnt, &cm->gld_fb_idx, new_fb); - } - - if (cm->refresh_golden_frame) - ref_cnt_fb (cm->fb_idx_ref_cnt, &cm->gld_fb_idx, cm->new_fb_idx); - - if (cm->refresh_alt_ref_frame) - ref_cnt_fb (cm->fb_idx_ref_cnt, &cm->alt_fb_idx, cm->new_fb_idx); - - if (cm->refresh_last_frame) - { - ref_cnt_fb (cm->fb_idx_ref_cnt, &cm->lst_fb_idx, cm->new_fb_idx); - - cm->frame_to_show = &cm->yv12_fb[cm->lst_fb_idx]; - } - else - cm->frame_to_show = &cm->yv12_fb[cm->new_fb_idx]; - - cm->fb_idx_ref_cnt[cm->new_fb_idx]--; - - return err; -} - -int check_fragments_for_errors(VP8D_COMP *pbi) -{ - if (!pbi->ec_active && - pbi->fragments.count <= 1 && pbi->fragments.sizes[0] == 0) - { - VP8_COMMON *cm = &pbi->common; - - /* If error concealment is disabled we won't signal missing frames - * to the decoder. - */ - if (cm->fb_idx_ref_cnt[cm->lst_fb_idx] > 1) - { - /* The last reference shares buffer with another reference - * buffer. Move it to its own buffer before setting it as - * corrupt, otherwise we will make multiple buffers corrupt. - */ - const int prev_idx = cm->lst_fb_idx; - cm->fb_idx_ref_cnt[prev_idx]--; - cm->lst_fb_idx = get_free_fb(cm); - vp8_yv12_copy_frame(&cm->yv12_fb[prev_idx], - &cm->yv12_fb[cm->lst_fb_idx]); - } - /* This is used to signal that we are missing frames. - * We do not know if the missing frame(s) was supposed to update - * any of the reference buffers, but we act conservative and - * mark only the last buffer as corrupted. - */ - cm->yv12_fb[cm->lst_fb_idx].corrupted = 1; - - /* Signal that we have no frame to show. */ - cm->show_frame = 0; - - /* Nothing more to do. */ - return 0; - } - - return 1; -} - -int vp8dx_receive_compressed_data(VP8D_COMP *pbi, size_t size, - const uint8_t *source, - int64_t time_stamp) -{ - VP8_COMMON *cm = &pbi->common; - int retcode = -1; - (void)size; - (void)source; - - pbi->common.error.error_code = VPX_CODEC_OK; - - retcode = check_fragments_for_errors(pbi); - if(retcode <= 0) - return retcode; - - cm->new_fb_idx = get_free_fb (cm); - - /* setup reference frames for vp8_decode_frame */ - pbi->dec_fb_ref[INTRA_FRAME] = &cm->yv12_fb[cm->new_fb_idx]; - pbi->dec_fb_ref[LAST_FRAME] = &cm->yv12_fb[cm->lst_fb_idx]; - pbi->dec_fb_ref[GOLDEN_FRAME] = &cm->yv12_fb[cm->gld_fb_idx]; - pbi->dec_fb_ref[ALTREF_FRAME] = &cm->yv12_fb[cm->alt_fb_idx]; - - if (setjmp(pbi->common.error.jmp)) - { - /* We do not know if the missing frame(s) was supposed to update - * any of the reference buffers, but we act conservative and - * mark only the last buffer as corrupted. - */ - cm->yv12_fb[cm->lst_fb_idx].corrupted = 1; - - if (cm->fb_idx_ref_cnt[cm->new_fb_idx] > 0) - cm->fb_idx_ref_cnt[cm->new_fb_idx]--; - - goto decode_exit; - } - - pbi->common.error.setjmp = 1; - - retcode = vp8_decode_frame(pbi); - - if (retcode < 0) - { - if (cm->fb_idx_ref_cnt[cm->new_fb_idx] > 0) - cm->fb_idx_ref_cnt[cm->new_fb_idx]--; - - pbi->common.error.error_code = VPX_CODEC_ERROR; - goto decode_exit; - } - - if (swap_frame_buffers (cm)) - { - pbi->common.error.error_code = VPX_CODEC_ERROR; - goto decode_exit; - } - - vp8_clear_system_state(); - - if (cm->show_frame) - { - cm->current_video_frame++; - cm->show_frame_mi = cm->mi; - } - - #if CONFIG_ERROR_CONCEALMENT - /* swap the mode infos to storage for future error concealment */ - if (pbi->ec_enabled && pbi->common.prev_mi) - { - MODE_INFO* tmp = pbi->common.prev_mi; - int row, col; - pbi->common.prev_mi = pbi->common.mi; - pbi->common.mi = tmp; - - /* Propagate the segment_ids to the next frame */ - for (row = 0; row < pbi->common.mb_rows; ++row) - { - for (col = 0; col < pbi->common.mb_cols; ++col) - { - const int i = row*pbi->common.mode_info_stride + col; - pbi->common.mi[i].mbmi.segment_id = - pbi->common.prev_mi[i].mbmi.segment_id; - } - } - } -#endif - - pbi->ready_for_new_data = 0; - pbi->last_time_stamp = time_stamp; - -decode_exit: - pbi->common.error.setjmp = 0; - vp8_clear_system_state(); - return retcode; -} -int vp8dx_get_raw_frame(VP8D_COMP *pbi, YV12_BUFFER_CONFIG *sd, int64_t *time_stamp, int64_t *time_end_stamp, vp8_ppflags_t *flags) -{ - int ret = -1; - - if (pbi->ready_for_new_data == 1) - return ret; - - /* ie no raw frame to show!!! */ - if (pbi->common.show_frame == 0) - return ret; - - pbi->ready_for_new_data = 1; - *time_stamp = pbi->last_time_stamp; - *time_end_stamp = 0; - -#if CONFIG_POSTPROC - ret = vp8_post_proc_frame(&pbi->common, sd, flags); -#else - (void)flags; - - if (pbi->common.frame_to_show) - { - *sd = *pbi->common.frame_to_show; - sd->y_width = pbi->common.Width; - sd->y_height = pbi->common.Height; - sd->uv_height = pbi->common.Height / 2; - ret = 0; - } - else - { - ret = -1; - } - -#endif /*!CONFIG_POSTPROC*/ - vp8_clear_system_state(); - return ret; -} - - -/* This function as written isn't decoder specific, but the encoder has - * much faster ways of computing this, so it's ok for it to live in a - * decode specific file. - */ -int vp8dx_references_buffer( VP8_COMMON *oci, int ref_frame ) -{ - const MODE_INFO *mi = oci->mi; - int mb_row, mb_col; - - for (mb_row = 0; mb_row < oci->mb_rows; mb_row++) - { - for (mb_col = 0; mb_col < oci->mb_cols; mb_col++,mi++) - { - if( mi->mbmi.ref_frame == ref_frame) - return 1; - } - mi++; - } - return 0; - -} - -int vp8_create_decoder_instances(struct frame_buffers *fb, VP8D_CONFIG *oxcf) -{ - if(!fb->use_frame_threads) - { - /* decoder instance for single thread mode */ - fb->pbi[0] = create_decompressor(oxcf); - if(!fb->pbi[0]) - return VPX_CODEC_ERROR; - -#if CONFIG_MULTITHREAD - /* enable row-based threading only when use_frame_threads - * is disabled */ - fb->pbi[0]->max_threads = oxcf->max_threads; - vp8_decoder_create_threads(fb->pbi[0]); -#endif - } - else - { - /* TODO : create frame threads and decoder instances for each - * thread here */ - } - - return VPX_CODEC_OK; -} - -int vp8_remove_decoder_instances(struct frame_buffers *fb) -{ - if(!fb->use_frame_threads) - { - VP8D_COMP *pbi = fb->pbi[0]; - - if (!pbi) - return VPX_CODEC_ERROR; -#if CONFIG_MULTITHREAD - if (pbi->b_multithreaded_rd) - vp8mt_de_alloc_temp_buffers(pbi, pbi->common.mb_rows); - vp8_decoder_remove_threads(pbi); -#endif - - /* decoder instance for single thread mode */ - remove_decompressor(pbi); - } - else - { - /* TODO : remove frame threads and decoder instances for each - * thread here */ - } - - return VPX_CODEC_OK; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/onyxd_int.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/onyxd_int.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/onyxd_int.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/onyxd_int.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_DECODER_ONYXD_INT_H_ -#define VP8_DECODER_ONYXD_INT_H_ - -#include "vpx_config.h" -#include "vp8/common/onyxd.h" -#include "treereader.h" -#include "vp8/common/onyxc_int.h" -#include "vp8/common/threading.h" - -#if CONFIG_ERROR_CONCEALMENT -#include "ec_types.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct -{ - int ithread; - void *ptr1; - void *ptr2; -} DECODETHREAD_DATA; - -typedef struct -{ - MACROBLOCKD mbd; -} MB_ROW_DEC; - - -typedef struct -{ - int enabled; - unsigned int count; - const unsigned char *ptrs[MAX_PARTITIONS]; - unsigned int sizes[MAX_PARTITIONS]; -} FRAGMENT_DATA; - -#define MAX_FB_MT_DEC 32 - -struct frame_buffers -{ - /* - * this struct will be populated with frame buffer management - * info in future commits. */ - - /* enable/disable frame-based threading */ - int use_frame_threads; - - /* decoder instances */ - struct VP8D_COMP *pbi[MAX_FB_MT_DEC]; - -}; - -typedef struct VP8D_COMP -{ - DECLARE_ALIGNED(16, MACROBLOCKD, mb); - - YV12_BUFFER_CONFIG *dec_fb_ref[NUM_YV12_BUFFERS]; - - DECLARE_ALIGNED(16, VP8_COMMON, common); - - /* the last partition will be used for the modes/mvs */ - vp8_reader mbc[MAX_PARTITIONS]; - - VP8D_CONFIG oxcf; - - FRAGMENT_DATA fragments; - -#if CONFIG_MULTITHREAD - /* variable for threading */ - - volatile int b_multithreaded_rd; - int max_threads; - int current_mb_col_main; - unsigned int decoding_thread_count; - int allocated_decoding_thread_count; - - int mt_baseline_filter_level[MAX_MB_SEGMENTS]; - int sync_range; - int *mt_current_mb_col; /* Each row remembers its already decoded column. */ - - unsigned char **mt_yabove_row; /* mb_rows x width */ - unsigned char **mt_uabove_row; - unsigned char **mt_vabove_row; - unsigned char **mt_yleft_col; /* mb_rows x 16 */ - unsigned char **mt_uleft_col; /* mb_rows x 8 */ - unsigned char **mt_vleft_col; /* mb_rows x 8 */ - - MB_ROW_DEC *mb_row_di; - DECODETHREAD_DATA *de_thread_data; - - pthread_t *h_decoding_thread; - sem_t *h_event_start_decoding; - sem_t h_event_end_decoding; - /* end of threading data */ -#endif - - int64_t last_time_stamp; - int ready_for_new_data; - - vp8_prob prob_intra; - vp8_prob prob_last; - vp8_prob prob_gf; - vp8_prob prob_skip_false; - -#if CONFIG_ERROR_CONCEALMENT - MB_OVERLAP *overlaps; - /* the mb num from which modes and mvs (first partition) are corrupt */ - unsigned int mvs_corrupt_from_mb; -#endif - int ec_enabled; - int ec_active; - int decoded_key_frame; - int independent_partitions; - int frame_corrupt_residual; - - vpx_decrypt_cb decrypt_cb; - void *decrypt_state; -} VP8D_COMP; - -int vp8_decode_frame(VP8D_COMP *cpi); - -int vp8_create_decoder_instances(struct frame_buffers *fb, VP8D_CONFIG *oxcf); -int vp8_remove_decoder_instances(struct frame_buffers *fb); - -#if CONFIG_DEBUG -#define CHECK_MEM_ERROR(lval,expr) do {\ - lval = (expr); \ - if(!lval) \ - vpx_internal_error(&pbi->common.error, VPX_CODEC_MEM_ERROR,\ - "Failed to allocate "#lval" at %s:%d", \ - __FILE__,__LINE__);\ - } while(0) -#else -#define CHECK_MEM_ERROR(lval,expr) do {\ - lval = (expr); \ - if(!lval) \ - vpx_internal_error(&pbi->common.error, VPX_CODEC_MEM_ERROR,\ - "Failed to allocate "#lval);\ - } while(0) -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_DECODER_ONYXD_INT_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/threading.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/threading.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/threading.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/threading.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,912 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#if !defined(WIN32) && CONFIG_OS_SUPPORT == 1 -# include -#endif -#include "onyxd_int.h" -#include "vpx_mem/vpx_mem.h" -#include "vp8/common/threading.h" - -#include "vp8/common/loopfilter.h" -#include "vp8/common/extend.h" -#include "vpx_ports/vpx_timer.h" -#include "detokenize.h" -#include "vp8/common/reconintra4x4.h" -#include "vp8/common/reconinter.h" -#include "vp8/common/setupintrarecon.h" -#if CONFIG_ERROR_CONCEALMENT -#include "error_concealment.h" -#endif - -#define CALLOC_ARRAY(p, n) CHECK_MEM_ERROR((p), vpx_calloc(sizeof(*(p)), (n))) -#define CALLOC_ARRAY_ALIGNED(p, n, algn) do { \ - CHECK_MEM_ERROR((p), vpx_memalign((algn), sizeof(*(p)) * (n))); \ - memset((p), 0, (n) * sizeof(*(p))); \ -} while (0) - - -void vp8_mb_init_dequantizer(VP8D_COMP *pbi, MACROBLOCKD *xd); - -static void setup_decoding_thread_data(VP8D_COMP *pbi, MACROBLOCKD *xd, MB_ROW_DEC *mbrd, int count) -{ - VP8_COMMON *const pc = & pbi->common; - int i; - - for (i = 0; i < count; i++) - { - MACROBLOCKD *mbd = &mbrd[i].mbd; - mbd->subpixel_predict = xd->subpixel_predict; - mbd->subpixel_predict8x4 = xd->subpixel_predict8x4; - mbd->subpixel_predict8x8 = xd->subpixel_predict8x8; - mbd->subpixel_predict16x16 = xd->subpixel_predict16x16; - - mbd->mode_info_context = pc->mi + pc->mode_info_stride * (i + 1); - mbd->mode_info_stride = pc->mode_info_stride; - - mbd->frame_type = pc->frame_type; - mbd->pre = xd->pre; - mbd->dst = xd->dst; - - mbd->segmentation_enabled = xd->segmentation_enabled; - mbd->mb_segement_abs_delta = xd->mb_segement_abs_delta; - vpx_memcpy(mbd->segment_feature_data, xd->segment_feature_data, sizeof(xd->segment_feature_data)); - - /*signed char ref_lf_deltas[MAX_REF_LF_DELTAS];*/ - vpx_memcpy(mbd->ref_lf_deltas, xd->ref_lf_deltas, sizeof(xd->ref_lf_deltas)); - /*signed char mode_lf_deltas[MAX_MODE_LF_DELTAS];*/ - vpx_memcpy(mbd->mode_lf_deltas, xd->mode_lf_deltas, sizeof(xd->mode_lf_deltas)); - /*unsigned char mode_ref_lf_delta_enabled; - unsigned char mode_ref_lf_delta_update;*/ - mbd->mode_ref_lf_delta_enabled = xd->mode_ref_lf_delta_enabled; - mbd->mode_ref_lf_delta_update = xd->mode_ref_lf_delta_update; - - mbd->current_bc = &pbi->mbc[0]; - - vpx_memcpy(mbd->dequant_y1_dc, xd->dequant_y1_dc, sizeof(xd->dequant_y1_dc)); - vpx_memcpy(mbd->dequant_y1, xd->dequant_y1, sizeof(xd->dequant_y1)); - vpx_memcpy(mbd->dequant_y2, xd->dequant_y2, sizeof(xd->dequant_y2)); - vpx_memcpy(mbd->dequant_uv, xd->dequant_uv, sizeof(xd->dequant_uv)); - - mbd->fullpixel_mask = 0xffffffff; - - if (pc->full_pixel) - mbd->fullpixel_mask = 0xfffffff8; - - } - - for (i = 0; i < pc->mb_rows; i++) - pbi->mt_current_mb_col[i] = -1; -} - -static void mt_decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, - unsigned int mb_idx) -{ - MB_PREDICTION_MODE mode; - int i; -#if CONFIG_ERROR_CONCEALMENT - int corruption_detected = 0; -#else - (void)mb_idx; -#endif - - if (xd->mode_info_context->mbmi.mb_skip_coeff) - { - vp8_reset_mb_tokens_context(xd); - } - else if (!vp8dx_bool_error(xd->current_bc)) - { - int eobtotal; - eobtotal = vp8_decode_mb_tokens(pbi, xd); - - /* Special case: Force the loopfilter to skip when eobtotal is zero */ - xd->mode_info_context->mbmi.mb_skip_coeff = (eobtotal==0); - } - - mode = xd->mode_info_context->mbmi.mode; - - if (xd->segmentation_enabled) - vp8_mb_init_dequantizer(pbi, xd); - - -#if CONFIG_ERROR_CONCEALMENT - - if(pbi->ec_active) - { - int throw_residual; - /* When we have independent partitions we can apply residual even - * though other partitions within the frame are corrupt. - */ - throw_residual = (!pbi->independent_partitions && - pbi->frame_corrupt_residual); - throw_residual = (throw_residual || vp8dx_bool_error(xd->current_bc)); - - if ((mb_idx >= pbi->mvs_corrupt_from_mb || throw_residual)) - { - /* MB with corrupt residuals or corrupt mode/motion vectors. - * Better to use the predictor as reconstruction. - */ - pbi->frame_corrupt_residual = 1; - vpx_memset(xd->qcoeff, 0, sizeof(xd->qcoeff)); - vp8_conceal_corrupt_mb(xd); - - - corruption_detected = 1; - - /* force idct to be skipped for B_PRED and use the - * prediction only for reconstruction - * */ - vpx_memset(xd->eobs, 0, 25); - } - } -#endif - - /* do prediction */ - if (xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME) - { - vp8_build_intra_predictors_mbuv_s(xd, - xd->recon_above[1], - xd->recon_above[2], - xd->recon_left[1], - xd->recon_left[2], - xd->recon_left_stride[1], - xd->dst.u_buffer, xd->dst.v_buffer, - xd->dst.uv_stride); - - if (mode != B_PRED) - { - vp8_build_intra_predictors_mby_s(xd, - xd->recon_above[0], - xd->recon_left[0], - xd->recon_left_stride[0], - xd->dst.y_buffer, - xd->dst.y_stride); - } - else - { - short *DQC = xd->dequant_y1; - int dst_stride = xd->dst.y_stride; - - /* clear out residual eob info */ - if(xd->mode_info_context->mbmi.mb_skip_coeff) - vpx_memset(xd->eobs, 0, 25); - - intra_prediction_down_copy(xd, xd->recon_above[0] + 16); - - for (i = 0; i < 16; i++) - { - BLOCKD *b = &xd->block[i]; - unsigned char *dst = xd->dst.y_buffer + b->offset; - B_PREDICTION_MODE b_mode = - xd->mode_info_context->bmi[i].as_mode; - unsigned char *Above; - unsigned char *yleft; - int left_stride; - unsigned char top_left; - - /*Caution: For some b_mode, it needs 8 pixels (4 above + 4 above-right).*/ - if (i < 4 && pbi->common.filter_level) - Above = xd->recon_above[0] + b->offset; - else - Above = dst - dst_stride; - - if (i%4==0 && pbi->common.filter_level) - { - yleft = xd->recon_left[0] + i; - left_stride = 1; - } - else - { - yleft = dst - 1; - left_stride = dst_stride; - } - - if ((i==4 || i==8 || i==12) && pbi->common.filter_level) - top_left = *(xd->recon_left[0] + i - 1); - else - top_left = Above[-1]; - - vp8_intra4x4_predict(Above, yleft, left_stride, - b_mode, dst, dst_stride, top_left); - - if (xd->eobs[i] ) - { - if (xd->eobs[i] > 1) - { - vp8_dequant_idct_add(b->qcoeff, DQC, dst, dst_stride); - } - else - { - vp8_dc_only_idct_add(b->qcoeff[0] * DQC[0], - dst, dst_stride, dst, dst_stride); - vpx_memset(b->qcoeff, 0, 2 * sizeof(b->qcoeff[0])); - } - } - } - } - } - else - { - vp8_build_inter_predictors_mb(xd); - } - - -#if CONFIG_ERROR_CONCEALMENT - if (corruption_detected) - { - return; - } -#endif - - if(!xd->mode_info_context->mbmi.mb_skip_coeff) - { - /* dequantization and idct */ - if (mode != B_PRED) - { - short *DQC = xd->dequant_y1; - - if (mode != SPLITMV) - { - BLOCKD *b = &xd->block[24]; - - /* do 2nd order transform on the dc block */ - if (xd->eobs[24] > 1) - { - vp8_dequantize_b(b, xd->dequant_y2); - - vp8_short_inv_walsh4x4(&b->dqcoeff[0], - xd->qcoeff); - vpx_memset(b->qcoeff, 0, 16 * sizeof(b->qcoeff[0])); - } - else - { - b->dqcoeff[0] = b->qcoeff[0] * xd->dequant_y2[0]; - vp8_short_inv_walsh4x4_1(&b->dqcoeff[0], - xd->qcoeff); - vpx_memset(b->qcoeff, 0, 2 * sizeof(b->qcoeff[0])); - } - - /* override the dc dequant constant in order to preserve the - * dc components - */ - DQC = xd->dequant_y1_dc; - } - - vp8_dequant_idct_add_y_block - (xd->qcoeff, DQC, - xd->dst.y_buffer, - xd->dst.y_stride, xd->eobs); - } - - vp8_dequant_idct_add_uv_block - (xd->qcoeff+16*16, xd->dequant_uv, - xd->dst.u_buffer, xd->dst.v_buffer, - xd->dst.uv_stride, xd->eobs+16); - } -} - -static void mt_decode_mb_rows(VP8D_COMP *pbi, MACROBLOCKD *xd, int start_mb_row) -{ - volatile const int *last_row_current_mb_col; - volatile int *current_mb_col; - int mb_row; - VP8_COMMON *pc = &pbi->common; - const int nsync = pbi->sync_range; - const int first_row_no_sync_above = pc->mb_cols + nsync; - int num_part = 1 << pbi->common.multi_token_partition; - int last_mb_row = start_mb_row; - - YV12_BUFFER_CONFIG *yv12_fb_new = pbi->dec_fb_ref[INTRA_FRAME]; - YV12_BUFFER_CONFIG *yv12_fb_lst = pbi->dec_fb_ref[LAST_FRAME]; - - int recon_y_stride = yv12_fb_new->y_stride; - int recon_uv_stride = yv12_fb_new->uv_stride; - - unsigned char *ref_buffer[MAX_REF_FRAMES][3]; - unsigned char *dst_buffer[3]; - int i; - int ref_fb_corrupted[MAX_REF_FRAMES]; - - ref_fb_corrupted[INTRA_FRAME] = 0; - - for(i = 1; i < MAX_REF_FRAMES; i++) - { - YV12_BUFFER_CONFIG *this_fb = pbi->dec_fb_ref[i]; - - ref_buffer[i][0] = this_fb->y_buffer; - ref_buffer[i][1] = this_fb->u_buffer; - ref_buffer[i][2] = this_fb->v_buffer; - - ref_fb_corrupted[i] = this_fb->corrupted; - } - - dst_buffer[0] = yv12_fb_new->y_buffer; - dst_buffer[1] = yv12_fb_new->u_buffer; - dst_buffer[2] = yv12_fb_new->v_buffer; - - xd->up_available = (start_mb_row != 0); - - for (mb_row = start_mb_row; mb_row < pc->mb_rows; mb_row += (pbi->decoding_thread_count + 1)) - { - int recon_yoffset, recon_uvoffset; - int mb_col; - int filter_level; - loop_filter_info_n *lfi_n = &pc->lf_info; - - /* save last row processed by this thread */ - last_mb_row = mb_row; - /* select bool coder for current partition */ - xd->current_bc = &pbi->mbc[mb_row%num_part]; - - if (mb_row > 0) - last_row_current_mb_col = &pbi->mt_current_mb_col[mb_row -1]; - else - last_row_current_mb_col = &first_row_no_sync_above; - - current_mb_col = &pbi->mt_current_mb_col[mb_row]; - - recon_yoffset = mb_row * recon_y_stride * 16; - recon_uvoffset = mb_row * recon_uv_stride * 8; - - /* reset contexts */ - xd->above_context = pc->above_context; - vpx_memset(xd->left_context, 0, sizeof(ENTROPY_CONTEXT_PLANES)); - - xd->left_available = 0; - - xd->mb_to_top_edge = -((mb_row * 16)) << 3; - xd->mb_to_bottom_edge = ((pc->mb_rows - 1 - mb_row) * 16) << 3; - - if (pbi->common.filter_level) - { - xd->recon_above[0] = pbi->mt_yabove_row[mb_row] + 0*16 +32; - xd->recon_above[1] = pbi->mt_uabove_row[mb_row] + 0*8 +16; - xd->recon_above[2] = pbi->mt_vabove_row[mb_row] + 0*8 +16; - - xd->recon_left[0] = pbi->mt_yleft_col[mb_row]; - xd->recon_left[1] = pbi->mt_uleft_col[mb_row]; - xd->recon_left[2] = pbi->mt_vleft_col[mb_row]; - - /* TODO: move to outside row loop */ - xd->recon_left_stride[0] = 1; - xd->recon_left_stride[1] = 1; - } - else - { - xd->recon_above[0] = dst_buffer[0] + recon_yoffset; - xd->recon_above[1] = dst_buffer[1] + recon_uvoffset; - xd->recon_above[2] = dst_buffer[2] + recon_uvoffset; - - xd->recon_left[0] = xd->recon_above[0] - 1; - xd->recon_left[1] = xd->recon_above[1] - 1; - xd->recon_left[2] = xd->recon_above[2] - 1; - - xd->recon_above[0] -= xd->dst.y_stride; - xd->recon_above[1] -= xd->dst.uv_stride; - xd->recon_above[2] -= xd->dst.uv_stride; - - /* TODO: move to outside row loop */ - xd->recon_left_stride[0] = xd->dst.y_stride; - xd->recon_left_stride[1] = xd->dst.uv_stride; - - setup_intra_recon_left(xd->recon_left[0], xd->recon_left[1], - xd->recon_left[2], xd->dst.y_stride, - xd->dst.uv_stride); - } - - for (mb_col = 0; mb_col < pc->mb_cols; mb_col++) - { - *current_mb_col = mb_col - 1; - - if ((mb_col & (nsync - 1)) == 0) - { - while (mb_col > (*last_row_current_mb_col - nsync)) - { - x86_pause_hint(); - thread_sleep(0); - } - } - - /* Distance of MB to the various image edges. - * These are specified to 8th pel as they are always - * compared to values that are in 1/8th pel units. - */ - xd->mb_to_left_edge = -((mb_col * 16) << 3); - xd->mb_to_right_edge = ((pc->mb_cols - 1 - mb_col) * 16) << 3; - - #if CONFIG_ERROR_CONCEALMENT - { - int corrupt_residual = - (!pbi->independent_partitions && - pbi->frame_corrupt_residual) || - vp8dx_bool_error(xd->current_bc); - if (pbi->ec_active && - (xd->mode_info_context->mbmi.ref_frame == - INTRA_FRAME) && - corrupt_residual) - { - /* We have an intra block with corrupt - * coefficients, better to conceal with an inter - * block. - * Interpolate MVs from neighboring MBs - * - * Note that for the first mb with corrupt - * residual in a frame, we might not discover - * that before decoding the residual. That - * happens after this check, and therefore no - * inter concealment will be done. - */ - vp8_interpolate_motion(xd, - mb_row, mb_col, - pc->mb_rows, pc->mb_cols, - pc->mode_info_stride); - } - } - #endif - - - xd->dst.y_buffer = dst_buffer[0] + recon_yoffset; - xd->dst.u_buffer = dst_buffer[1] + recon_uvoffset; - xd->dst.v_buffer = dst_buffer[2] + recon_uvoffset; - - xd->pre.y_buffer = ref_buffer[xd->mode_info_context->mbmi.ref_frame][0] + recon_yoffset; - xd->pre.u_buffer = ref_buffer[xd->mode_info_context->mbmi.ref_frame][1] + recon_uvoffset; - xd->pre.v_buffer = ref_buffer[xd->mode_info_context->mbmi.ref_frame][2] + recon_uvoffset; - - /* propagate errors from reference frames */ - xd->corrupted |= ref_fb_corrupted[xd->mode_info_context->mbmi.ref_frame]; - - mt_decode_macroblock(pbi, xd, 0); - - xd->left_available = 1; - - /* check if the boolean decoder has suffered an error */ - xd->corrupted |= vp8dx_bool_error(xd->current_bc); - - xd->recon_above[0] += 16; - xd->recon_above[1] += 8; - xd->recon_above[2] += 8; - - if (!pbi->common.filter_level) - { - xd->recon_left[0] += 16; - xd->recon_left[1] += 8; - xd->recon_left[2] += 8; - } - - if (pbi->common.filter_level) - { - int skip_lf = (xd->mode_info_context->mbmi.mode != B_PRED && - xd->mode_info_context->mbmi.mode != SPLITMV && - xd->mode_info_context->mbmi.mb_skip_coeff); - - const int mode_index = lfi_n->mode_lf_lut[xd->mode_info_context->mbmi.mode]; - const int seg = xd->mode_info_context->mbmi.segment_id; - const int ref_frame = xd->mode_info_context->mbmi.ref_frame; - - filter_level = lfi_n->lvl[seg][ref_frame][mode_index]; - - if( mb_row != pc->mb_rows-1 ) - { - /* Save decoded MB last row data for next-row decoding */ - vpx_memcpy((pbi->mt_yabove_row[mb_row + 1] + 32 + mb_col*16), (xd->dst.y_buffer + 15 * recon_y_stride), 16); - vpx_memcpy((pbi->mt_uabove_row[mb_row + 1] + 16 + mb_col*8), (xd->dst.u_buffer + 7 * recon_uv_stride), 8); - vpx_memcpy((pbi->mt_vabove_row[mb_row + 1] + 16 + mb_col*8), (xd->dst.v_buffer + 7 * recon_uv_stride), 8); - } - - /* save left_col for next MB decoding */ - if(mb_col != pc->mb_cols-1) - { - MODE_INFO *next = xd->mode_info_context +1; - - if (next->mbmi.ref_frame == INTRA_FRAME) - { - for (i = 0; i < 16; i++) - pbi->mt_yleft_col[mb_row][i] = xd->dst.y_buffer [i* recon_y_stride + 15]; - for (i = 0; i < 8; i++) - { - pbi->mt_uleft_col[mb_row][i] = xd->dst.u_buffer [i* recon_uv_stride + 7]; - pbi->mt_vleft_col[mb_row][i] = xd->dst.v_buffer [i* recon_uv_stride + 7]; - } - } - } - - /* loopfilter on this macroblock. */ - if (filter_level) - { - if(pc->filter_type == NORMAL_LOOPFILTER) - { - loop_filter_info lfi; - FRAME_TYPE frame_type = pc->frame_type; - const int hev_index = lfi_n->hev_thr_lut[frame_type][filter_level]; - lfi.mblim = lfi_n->mblim[filter_level]; - lfi.blim = lfi_n->blim[filter_level]; - lfi.lim = lfi_n->lim[filter_level]; - lfi.hev_thr = lfi_n->hev_thr[hev_index]; - - if (mb_col > 0) - vp8_loop_filter_mbv - (xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi); - - if (!skip_lf) - vp8_loop_filter_bv - (xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi); - - /* don't apply across umv border */ - if (mb_row > 0) - vp8_loop_filter_mbh - (xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi); - - if (!skip_lf) - vp8_loop_filter_bh - (xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi); - } - else - { - if (mb_col > 0) - vp8_loop_filter_simple_mbv - (xd->dst.y_buffer, recon_y_stride, lfi_n->mblim[filter_level]); - - if (!skip_lf) - vp8_loop_filter_simple_bv - (xd->dst.y_buffer, recon_y_stride, lfi_n->blim[filter_level]); - - /* don't apply across umv border */ - if (mb_row > 0) - vp8_loop_filter_simple_mbh - (xd->dst.y_buffer, recon_y_stride, lfi_n->mblim[filter_level]); - - if (!skip_lf) - vp8_loop_filter_simple_bh - (xd->dst.y_buffer, recon_y_stride, lfi_n->blim[filter_level]); - } - } - - } - - recon_yoffset += 16; - recon_uvoffset += 8; - - ++xd->mode_info_context; /* next mb */ - - xd->above_context++; - } - - /* adjust to the next row of mbs */ - if (pbi->common.filter_level) - { - if(mb_row != pc->mb_rows-1) - { - int lasty = yv12_fb_lst->y_width + VP8BORDERINPIXELS; - int lastuv = (yv12_fb_lst->y_width>>1) + (VP8BORDERINPIXELS>>1); - - for (i = 0; i < 4; i++) - { - pbi->mt_yabove_row[mb_row +1][lasty + i] = pbi->mt_yabove_row[mb_row +1][lasty -1]; - pbi->mt_uabove_row[mb_row +1][lastuv + i] = pbi->mt_uabove_row[mb_row +1][lastuv -1]; - pbi->mt_vabove_row[mb_row +1][lastuv + i] = pbi->mt_vabove_row[mb_row +1][lastuv -1]; - } - } - } - else - vp8_extend_mb_row(yv12_fb_new, xd->dst.y_buffer + 16, - xd->dst.u_buffer + 8, xd->dst.v_buffer + 8); - - /* last MB of row is ready just after extension is done */ - *current_mb_col = mb_col + nsync; - - ++xd->mode_info_context; /* skip prediction column */ - xd->up_available = 1; - - /* since we have multithread */ - xd->mode_info_context += xd->mode_info_stride * pbi->decoding_thread_count; - } - - /* signal end of frame decoding if this thread processed the last mb_row */ - if (last_mb_row == (pc->mb_rows - 1)) - sem_post(&pbi->h_event_end_decoding); - -} - - -static THREAD_FUNCTION thread_decoding_proc(void *p_data) -{ - int ithread = ((DECODETHREAD_DATA *)p_data)->ithread; - VP8D_COMP *pbi = (VP8D_COMP *)(((DECODETHREAD_DATA *)p_data)->ptr1); - MB_ROW_DEC *mbrd = (MB_ROW_DEC *)(((DECODETHREAD_DATA *)p_data)->ptr2); - ENTROPY_CONTEXT_PLANES mb_row_left_context; - - while (1) - { - if (pbi->b_multithreaded_rd == 0) - break; - - if (sem_wait(&pbi->h_event_start_decoding[ithread]) == 0) - { - if (pbi->b_multithreaded_rd == 0) - break; - else - { - MACROBLOCKD *xd = &mbrd->mbd; - xd->left_context = &mb_row_left_context; - - mt_decode_mb_rows(pbi, xd, ithread+1); - } - } - } - - return 0 ; -} - - -void vp8_decoder_create_threads(VP8D_COMP *pbi) -{ - int core_count = 0; - unsigned int ithread; - - pbi->b_multithreaded_rd = 0; - pbi->allocated_decoding_thread_count = 0; - - /* limit decoding threads to the max number of token partitions */ - core_count = (pbi->max_threads > 8) ? 8 : pbi->max_threads; - - /* limit decoding threads to the available cores */ - if (core_count > pbi->common.processor_core_count) - core_count = pbi->common.processor_core_count; - - if (core_count > 1) - { - pbi->b_multithreaded_rd = 1; - pbi->decoding_thread_count = core_count - 1; - - CALLOC_ARRAY(pbi->h_decoding_thread, pbi->decoding_thread_count); - CALLOC_ARRAY(pbi->h_event_start_decoding, pbi->decoding_thread_count); - CALLOC_ARRAY_ALIGNED(pbi->mb_row_di, pbi->decoding_thread_count, 32); - CALLOC_ARRAY(pbi->de_thread_data, pbi->decoding_thread_count); - - for (ithread = 0; ithread < pbi->decoding_thread_count; ithread++) - { - sem_init(&pbi->h_event_start_decoding[ithread], 0, 0); - - vp8_setup_block_dptrs(&pbi->mb_row_di[ithread].mbd); - - pbi->de_thread_data[ithread].ithread = ithread; - pbi->de_thread_data[ithread].ptr1 = (void *)pbi; - pbi->de_thread_data[ithread].ptr2 = (void *) &pbi->mb_row_di[ithread]; - - pthread_create(&pbi->h_decoding_thread[ithread], 0, thread_decoding_proc, (&pbi->de_thread_data[ithread])); - } - - sem_init(&pbi->h_event_end_decoding, 0, 0); - - pbi->allocated_decoding_thread_count = pbi->decoding_thread_count; - } -} - - -void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows) -{ - int i; - - if (pbi->b_multithreaded_rd) - { - vpx_free(pbi->mt_current_mb_col); - pbi->mt_current_mb_col = NULL ; - - /* Free above_row buffers. */ - if (pbi->mt_yabove_row) - { - for (i=0; i< mb_rows; i++) - { - vpx_free(pbi->mt_yabove_row[i]); - pbi->mt_yabove_row[i] = NULL ; - } - vpx_free(pbi->mt_yabove_row); - pbi->mt_yabove_row = NULL ; - } - - if (pbi->mt_uabove_row) - { - for (i=0; i< mb_rows; i++) - { - vpx_free(pbi->mt_uabove_row[i]); - pbi->mt_uabove_row[i] = NULL ; - } - vpx_free(pbi->mt_uabove_row); - pbi->mt_uabove_row = NULL ; - } - - if (pbi->mt_vabove_row) - { - for (i=0; i< mb_rows; i++) - { - vpx_free(pbi->mt_vabove_row[i]); - pbi->mt_vabove_row[i] = NULL ; - } - vpx_free(pbi->mt_vabove_row); - pbi->mt_vabove_row = NULL ; - } - - /* Free left_col buffers. */ - if (pbi->mt_yleft_col) - { - for (i=0; i< mb_rows; i++) - { - vpx_free(pbi->mt_yleft_col[i]); - pbi->mt_yleft_col[i] = NULL ; - } - vpx_free(pbi->mt_yleft_col); - pbi->mt_yleft_col = NULL ; - } - - if (pbi->mt_uleft_col) - { - for (i=0; i< mb_rows; i++) - { - vpx_free(pbi->mt_uleft_col[i]); - pbi->mt_uleft_col[i] = NULL ; - } - vpx_free(pbi->mt_uleft_col); - pbi->mt_uleft_col = NULL ; - } - - if (pbi->mt_vleft_col) - { - for (i=0; i< mb_rows; i++) - { - vpx_free(pbi->mt_vleft_col[i]); - pbi->mt_vleft_col[i] = NULL ; - } - vpx_free(pbi->mt_vleft_col); - pbi->mt_vleft_col = NULL ; - } - } -} - - -void vp8mt_alloc_temp_buffers(VP8D_COMP *pbi, int width, int prev_mb_rows) -{ - VP8_COMMON *const pc = & pbi->common; - int i; - int uv_width; - - if (pbi->b_multithreaded_rd) - { - vp8mt_de_alloc_temp_buffers(pbi, prev_mb_rows); - - /* our internal buffers are always multiples of 16 */ - if ((width & 0xf) != 0) - width += 16 - (width & 0xf); - - if (width < 640) pbi->sync_range = 1; - else if (width <= 1280) pbi->sync_range = 8; - else if (width <= 2560) pbi->sync_range =16; - else pbi->sync_range = 32; - - uv_width = width >>1; - - /* Allocate an int for each mb row. */ - CALLOC_ARRAY(pbi->mt_current_mb_col, pc->mb_rows); - - /* Allocate memory for above_row buffers. */ - CALLOC_ARRAY(pbi->mt_yabove_row, pc->mb_rows); - for (i = 0; i < pc->mb_rows; i++) - CHECK_MEM_ERROR(pbi->mt_yabove_row[i], vpx_memalign(16,sizeof(unsigned char) * (width + (VP8BORDERINPIXELS<<1)))); - - CALLOC_ARRAY(pbi->mt_uabove_row, pc->mb_rows); - for (i = 0; i < pc->mb_rows; i++) - CHECK_MEM_ERROR(pbi->mt_uabove_row[i], vpx_memalign(16,sizeof(unsigned char) * (uv_width + VP8BORDERINPIXELS))); - - CALLOC_ARRAY(pbi->mt_vabove_row, pc->mb_rows); - for (i = 0; i < pc->mb_rows; i++) - CHECK_MEM_ERROR(pbi->mt_vabove_row[i], vpx_memalign(16,sizeof(unsigned char) * (uv_width + VP8BORDERINPIXELS))); - - /* Allocate memory for left_col buffers. */ - CALLOC_ARRAY(pbi->mt_yleft_col, pc->mb_rows); - for (i = 0; i < pc->mb_rows; i++) - CHECK_MEM_ERROR(pbi->mt_yleft_col[i], vpx_calloc(sizeof(unsigned char) * 16, 1)); - - CALLOC_ARRAY(pbi->mt_uleft_col, pc->mb_rows); - for (i = 0; i < pc->mb_rows; i++) - CHECK_MEM_ERROR(pbi->mt_uleft_col[i], vpx_calloc(sizeof(unsigned char) * 8, 1)); - - CALLOC_ARRAY(pbi->mt_vleft_col, pc->mb_rows); - for (i = 0; i < pc->mb_rows; i++) - CHECK_MEM_ERROR(pbi->mt_vleft_col[i], vpx_calloc(sizeof(unsigned char) * 8, 1)); - } -} - - -void vp8_decoder_remove_threads(VP8D_COMP *pbi) -{ - /* shutdown MB Decoding thread; */ - if (pbi->b_multithreaded_rd) - { - int i; - - pbi->b_multithreaded_rd = 0; - - /* allow all threads to exit */ - for (i = 0; i < pbi->allocated_decoding_thread_count; i++) - { - sem_post(&pbi->h_event_start_decoding[i]); - pthread_join(pbi->h_decoding_thread[i], NULL); - } - - for (i = 0; i < pbi->allocated_decoding_thread_count; i++) - { - sem_destroy(&pbi->h_event_start_decoding[i]); - } - - sem_destroy(&pbi->h_event_end_decoding); - - vpx_free(pbi->h_decoding_thread); - pbi->h_decoding_thread = NULL; - - vpx_free(pbi->h_event_start_decoding); - pbi->h_event_start_decoding = NULL; - - vpx_free(pbi->mb_row_di); - pbi->mb_row_di = NULL ; - - vpx_free(pbi->de_thread_data); - pbi->de_thread_data = NULL; - } -} - -void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd) -{ - VP8_COMMON *pc = &pbi->common; - unsigned int i; - int j; - - int filter_level = pc->filter_level; - YV12_BUFFER_CONFIG *yv12_fb_new = pbi->dec_fb_ref[INTRA_FRAME]; - - if (filter_level) - { - /* Set above_row buffer to 127 for decoding first MB row */ - vpx_memset(pbi->mt_yabove_row[0] + VP8BORDERINPIXELS-1, 127, yv12_fb_new->y_width + 5); - vpx_memset(pbi->mt_uabove_row[0] + (VP8BORDERINPIXELS>>1)-1, 127, (yv12_fb_new->y_width>>1) +5); - vpx_memset(pbi->mt_vabove_row[0] + (VP8BORDERINPIXELS>>1)-1, 127, (yv12_fb_new->y_width>>1) +5); - - for (j=1; jmb_rows; j++) - { - vpx_memset(pbi->mt_yabove_row[j] + VP8BORDERINPIXELS-1, (unsigned char)129, 1); - vpx_memset(pbi->mt_uabove_row[j] + (VP8BORDERINPIXELS>>1)-1, (unsigned char)129, 1); - vpx_memset(pbi->mt_vabove_row[j] + (VP8BORDERINPIXELS>>1)-1, (unsigned char)129, 1); - } - - /* Set left_col to 129 initially */ - for (j=0; jmb_rows; j++) - { - vpx_memset(pbi->mt_yleft_col[j], (unsigned char)129, 16); - vpx_memset(pbi->mt_uleft_col[j], (unsigned char)129, 8); - vpx_memset(pbi->mt_vleft_col[j], (unsigned char)129, 8); - } - - /* Initialize the loop filter for this frame. */ - vp8_loop_filter_frame_init(pc, &pbi->mb, filter_level); - } - else - vp8_setup_intra_recon_top_line(yv12_fb_new); - - setup_decoding_thread_data(pbi, xd, pbi->mb_row_di, pbi->decoding_thread_count); - - for (i = 0; i < pbi->decoding_thread_count; i++) - sem_post(&pbi->h_event_start_decoding[i]); - - mt_decode_mb_rows(pbi, xd, 0); - - sem_wait(&pbi->h_event_end_decoding); /* add back for each frame */ -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/treereader.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/treereader.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/decoder/treereader.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/decoder/treereader.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_DECODER_TREEREADER_H_ -#define VP8_DECODER_TREEREADER_H_ - -#include "vp8/common/treecoder.h" -#include "dboolhuff.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef BOOL_DECODER vp8_reader; - -#define vp8_read vp8dx_decode_bool -#define vp8_read_literal vp8_decode_value -#define vp8_read_bit(R) vp8_read(R, vp8_prob_half) - - -/* Intent of tree data structure is to make decoding trivial. */ - -static int vp8_treed_read( - vp8_reader *const r, /* !!! must return a 0 or 1 !!! */ - vp8_tree t, - const vp8_prob *const p -) -{ - register vp8_tree_index i = 0; - - while ((i = t[ i + vp8_read(r, p[i>>1])]) > 0) ; - - return -i; -} - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_DECODER_TREEREADER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/arm/armv6/vp8_mse16x16_armv6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/arm/armv6/vp8_mse16x16_armv6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/arm/armv6/vp8_mse16x16_armv6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/arm/armv6/vp8_mse16x16_armv6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,138 +0,0 @@ -; -; Copyright (c) 2011 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - EXPORT |vp8_mse16x16_armv6| - - ARM - - AREA ||.text||, CODE, READONLY, ALIGN=2 - -; r0 unsigned char *src_ptr -; r1 int source_stride -; r2 unsigned char *ref_ptr -; r3 int recon_stride -; stack unsigned int *sse -; -;note: Based on vp8_variance16x16_armv6. In this function, sum is never used. -; So, we can remove this part of calculation. - -|vp8_mse16x16_armv6| PROC - - push {r4-r9, lr} - - pld [r0, r1, lsl #0] - pld [r2, r3, lsl #0] - - mov r12, #16 ; set loop counter to 16 (=block height) - mov r4, #0 ; initialize sse = 0 - -loop - ; 1st 4 pixels - ldr r5, [r0, #0x0] ; load 4 src pixels - ldr r6, [r2, #0x0] ; load 4 ref pixels - - mov lr, #0 ; constant zero - - usub8 r8, r5, r6 ; calculate difference - pld [r0, r1, lsl #1] - sel r7, r8, lr ; select bytes with positive difference - usub8 r9, r6, r5 ; calculate difference with reversed operands - pld [r2, r3, lsl #1] - sel r8, r9, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r5, r7, lr ; calculate sum of positive differences - usad8 r6, r8, lr ; calculate sum of negative differences - orr r8, r8, r7 ; differences of all 4 pixels - - ldr r5, [r0, #0x4] ; load 4 src pixels - - ; calculate sse - uxtb16 r6, r8 ; byte (two pixels) to halfwords - uxtb16 r7, r8, ror #8 ; another two pixels to halfwords - smlad r4, r6, r6, r4 ; dual signed multiply, add and accumulate (1) - - ; 2nd 4 pixels - ldr r6, [r2, #0x4] ; load 4 ref pixels - smlad r4, r7, r7, r4 ; dual signed multiply, add and accumulate (2) - - usub8 r8, r5, r6 ; calculate difference - sel r7, r8, lr ; select bytes with positive difference - usub8 r9, r6, r5 ; calculate difference with reversed operands - sel r8, r9, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r5, r7, lr ; calculate sum of positive differences - usad8 r6, r8, lr ; calculate sum of negative differences - orr r8, r8, r7 ; differences of all 4 pixels - ldr r5, [r0, #0x8] ; load 4 src pixels - ; calculate sse - uxtb16 r6, r8 ; byte (two pixels) to halfwords - uxtb16 r7, r8, ror #8 ; another two pixels to halfwords - smlad r4, r6, r6, r4 ; dual signed multiply, add and accumulate (1) - - ; 3rd 4 pixels - ldr r6, [r2, #0x8] ; load 4 ref pixels - smlad r4, r7, r7, r4 ; dual signed multiply, add and accumulate (2) - - usub8 r8, r5, r6 ; calculate difference - sel r7, r8, lr ; select bytes with positive difference - usub8 r9, r6, r5 ; calculate difference with reversed operands - sel r8, r9, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r5, r7, lr ; calculate sum of positive differences - usad8 r6, r8, lr ; calculate sum of negative differences - orr r8, r8, r7 ; differences of all 4 pixels - - ldr r5, [r0, #0xc] ; load 4 src pixels - - ; calculate sse - uxtb16 r6, r8 ; byte (two pixels) to halfwords - uxtb16 r7, r8, ror #8 ; another two pixels to halfwords - smlad r4, r6, r6, r4 ; dual signed multiply, add and accumulate (1) - - ; 4th 4 pixels - ldr r6, [r2, #0xc] ; load 4 ref pixels - smlad r4, r7, r7, r4 ; dual signed multiply, add and accumulate (2) - - usub8 r8, r5, r6 ; calculate difference - add r0, r0, r1 ; set src_ptr to next row - sel r7, r8, lr ; select bytes with positive difference - usub8 r9, r6, r5 ; calculate difference with reversed operands - add r2, r2, r3 ; set dst_ptr to next row - sel r8, r9, lr ; select bytes with negative difference - - ; calculate partial sums - usad8 r5, r7, lr ; calculate sum of positive differences - usad8 r6, r8, lr ; calculate sum of negative differences - orr r8, r8, r7 ; differences of all 4 pixels - - subs r12, r12, #1 ; next row - - ; calculate sse - uxtb16 r6, r8 ; byte (two pixels) to halfwords - uxtb16 r7, r8, ror #8 ; another two pixels to halfwords - smlad r4, r6, r6, r4 ; dual signed multiply, add and accumulate (1) - smlad r4, r7, r7, r4 ; dual signed multiply, add and accumulate (2) - - bne loop - - ; return stuff - ldr r1, [sp, #28] ; get address of sse - mov r0, r4 ; return sse - str r4, [r1] ; store sse - - pop {r4-r9, pc} - - ENDP - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/arm/armv6/vp8_short_fdct4x4_armv6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/arm/armv6/vp8_short_fdct4x4_armv6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/arm/armv6/vp8_short_fdct4x4_armv6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/arm/armv6/vp8_short_fdct4x4_armv6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,262 +0,0 @@ -; -; Copyright (c) 2011 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - EXPORT |vp8_short_fdct4x4_armv6| - - ARM - REQUIRE8 - PRESERVE8 - - AREA |.text|, CODE, READONLY -; void vp8_short_fdct4x4_c(short *input, short *output, int pitch) -|vp8_short_fdct4x4_armv6| PROC - - stmfd sp!, {r4 - r12, lr} - - ; PART 1 - - ; coeffs 0-3 - ldrd r4, r5, [r0] ; [i1 | i0] [i3 | i2] - - ldr r10, c7500 - ldr r11, c14500 - ldr r12, c0x22a453a0 ; [2217*4 | 5352*4] - ldr lr, c0x00080008 - ror r5, r5, #16 ; [i2 | i3] - - qadd16 r6, r4, r5 ; [i1+i2 | i0+i3] = [b1 | a1] without shift - qsub16 r7, r4, r5 ; [i1-i2 | i0-i3] = [c1 | d1] without shift - - add r0, r0, r2 ; update input pointer - - qadd16 r7, r7, r7 ; 2*[c1|d1] --> we can use smlad and smlsd - ; with 2217*4 and 5352*4 without losing the - ; sign bit (overflow) - - smuad r4, r6, lr ; o0 = (i1+i2)*8 + (i0+i3)*8 - smusd r5, r6, lr ; o2 = (i1+i2)*8 - (i0+i3)*8 - - smlad r6, r7, r12, r11 ; o1 = (c1 * 2217 + d1 * 5352 + 14500) - smlsdx r7, r7, r12, r10 ; o3 = (d1 * 2217 - c1 * 5352 + 7500) - - ldrd r8, r9, [r0] ; [i5 | i4] [i7 | i6] - - pkhbt r3, r4, r6, lsl #4 ; [o1 | o0], keep in register for PART 2 - pkhbt r6, r5, r7, lsl #4 ; [o3 | o2] - - str r6, [r1, #4] - - ; coeffs 4-7 - ror r9, r9, #16 ; [i6 | i7] - - qadd16 r6, r8, r9 ; [i5+i6 | i4+i7] = [b1 | a1] without shift - qsub16 r7, r8, r9 ; [i5-i6 | i4-i7] = [c1 | d1] without shift - - add r0, r0, r2 ; update input pointer - - qadd16 r7, r7, r7 ; 2x[c1|d1] --> we can use smlad and smlsd - ; with 2217*4 and 5352*4 without losing the - ; sign bit (overflow) - - smuad r9, r6, lr ; o4 = (i5+i6)*8 + (i4+i7)*8 - smusd r8, r6, lr ; o6 = (i5+i6)*8 - (i4+i7)*8 - - smlad r6, r7, r12, r11 ; o5 = (c1 * 2217 + d1 * 5352 + 14500) - smlsdx r7, r7, r12, r10 ; o7 = (d1 * 2217 - c1 * 5352 + 7500) - - ldrd r4, r5, [r0] ; [i9 | i8] [i11 | i10] - - pkhbt r9, r9, r6, lsl #4 ; [o5 | o4], keep in register for PART 2 - pkhbt r6, r8, r7, lsl #4 ; [o7 | o6] - - str r6, [r1, #12] - - ; coeffs 8-11 - ror r5, r5, #16 ; [i10 | i11] - - qadd16 r6, r4, r5 ; [i9+i10 | i8+i11]=[b1 | a1] without shift - qsub16 r7, r4, r5 ; [i9-i10 | i8-i11]=[c1 | d1] without shift - - add r0, r0, r2 ; update input pointer - - qadd16 r7, r7, r7 ; 2x[c1|d1] --> we can use smlad and smlsd - ; with 2217*4 and 5352*4 without losing the - ; sign bit (overflow) - - smuad r2, r6, lr ; o8 = (i9+i10)*8 + (i8+i11)*8 - smusd r8, r6, lr ; o10 = (i9+i10)*8 - (i8+i11)*8 - - smlad r6, r7, r12, r11 ; o9 = (c1 * 2217 + d1 * 5352 + 14500) - smlsdx r7, r7, r12, r10 ; o11 = (d1 * 2217 - c1 * 5352 + 7500) - - ldrd r4, r5, [r0] ; [i13 | i12] [i15 | i14] - - pkhbt r2, r2, r6, lsl #4 ; [o9 | o8], keep in register for PART 2 - pkhbt r6, r8, r7, lsl #4 ; [o11 | o10] - - str r6, [r1, #20] - - ; coeffs 12-15 - ror r5, r5, #16 ; [i14 | i15] - - qadd16 r6, r4, r5 ; [i13+i14 | i12+i15]=[b1|a1] without shift - qsub16 r7, r4, r5 ; [i13-i14 | i12-i15]=[c1|d1] without shift - - qadd16 r7, r7, r7 ; 2x[c1|d1] --> we can use smlad and smlsd - ; with 2217*4 and 5352*4 without losing the - ; sign bit (overflow) - - smuad r4, r6, lr ; o12 = (i13+i14)*8 + (i12+i15)*8 - smusd r5, r6, lr ; o14 = (i13+i14)*8 - (i12+i15)*8 - - smlad r6, r7, r12, r11 ; o13 = (c1 * 2217 + d1 * 5352 + 14500) - smlsdx r7, r7, r12, r10 ; o15 = (d1 * 2217 - c1 * 5352 + 7500) - - pkhbt r0, r4, r6, lsl #4 ; [o13 | o12], keep in register for PART 2 - pkhbt r6, r5, r7, lsl #4 ; [o15 | o14] - - str r6, [r1, #28] - - - ; PART 2 ------------------------------------------------- - ldr r11, c12000 - ldr r10, c51000 - ldr lr, c0x00070007 - - qadd16 r4, r3, r0 ; a1 = [i1+i13 | i0+i12] - qadd16 r5, r9, r2 ; b1 = [i5+i9 | i4+i8] - qsub16 r6, r9, r2 ; c1 = [i5-i9 | i4-i8] - qsub16 r7, r3, r0 ; d1 = [i1-i13 | i0-i12] - - qadd16 r4, r4, lr ; a1 + 7 - - add r0, r11, #0x10000 ; add (d!=0) - - qadd16 r2, r4, r5 ; a1 + b1 + 7 - qsub16 r3, r4, r5 ; a1 - b1 + 7 - - ldr r12, c0x08a914e8 ; [2217 | 5352] - - lsl r8, r2, #16 ; prepare bottom halfword for scaling - asr r2, r2, #4 ; scale top halfword - lsl r9, r3, #16 ; prepare bottom halfword for scaling - asr r3, r3, #4 ; scale top halfword - pkhtb r4, r2, r8, asr #20 ; pack and scale bottom halfword - pkhtb r5, r3, r9, asr #20 ; pack and scale bottom halfword - - smulbt r2, r6, r12 ; [ ------ | c1*2217] - str r4, [r1, #0] ; [ o1 | o0] - smultt r3, r6, r12 ; [c1*2217 | ------ ] - str r5, [r1, #16] ; [ o9 | o8] - - smlabb r8, r7, r12, r2 ; [ ------ | d1*5352] - smlatb r9, r7, r12, r3 ; [d1*5352 | ------ ] - - smulbb r2, r6, r12 ; [ ------ | c1*5352] - smultb r3, r6, r12 ; [c1*5352 | ------ ] - - lsls r6, r7, #16 ; d1 != 0 ? - addeq r8, r8, r11 ; c1_b*2217+d1_b*5352+12000 + (d==0) - addne r8, r8, r0 ; c1_b*2217+d1_b*5352+12000 + (d!=0) - asrs r6, r7, #16 - addeq r9, r9, r11 ; c1_t*2217+d1_t*5352+12000 + (d==0) - addne r9, r9, r0 ; c1_t*2217+d1_t*5352+12000 + (d!=0) - - smlabt r4, r7, r12, r10 ; [ ------ | d1*2217] + 51000 - smlatt r5, r7, r12, r10 ; [d1*2217 | ------ ] + 51000 - - pkhtb r9, r9, r8, asr #16 - - sub r4, r4, r2 - sub r5, r5, r3 - - ldr r3, [r1, #4] ; [i3 | i2] - - pkhtb r5, r5, r4, asr #16 ; [o13|o12] - - str r9, [r1, #8] ; [o5 | 04] - - ldr r9, [r1, #12] ; [i7 | i6] - ldr r8, [r1, #28] ; [i15|i14] - ldr r2, [r1, #20] ; [i11|i10] - str r5, [r1, #24] ; [o13|o12] - - qadd16 r4, r3, r8 ; a1 = [i3+i15 | i2+i14] - qadd16 r5, r9, r2 ; b1 = [i7+i11 | i6+i10] - - qadd16 r4, r4, lr ; a1 + 7 - - qsub16 r6, r9, r2 ; c1 = [i7-i11 | i6-i10] - qadd16 r2, r4, r5 ; a1 + b1 + 7 - qsub16 r7, r3, r8 ; d1 = [i3-i15 | i2-i14] - qsub16 r3, r4, r5 ; a1 - b1 + 7 - - lsl r8, r2, #16 ; prepare bottom halfword for scaling - asr r2, r2, #4 ; scale top halfword - lsl r9, r3, #16 ; prepare bottom halfword for scaling - asr r3, r3, #4 ; scale top halfword - pkhtb r4, r2, r8, asr #20 ; pack and scale bottom halfword - pkhtb r5, r3, r9, asr #20 ; pack and scale bottom halfword - - smulbt r2, r6, r12 ; [ ------ | c1*2217] - str r4, [r1, #4] ; [ o3 | o2] - smultt r3, r6, r12 ; [c1*2217 | ------ ] - str r5, [r1, #20] ; [ o11 | o10] - - smlabb r8, r7, r12, r2 ; [ ------ | d1*5352] - smlatb r9, r7, r12, r3 ; [d1*5352 | ------ ] - - smulbb r2, r6, r12 ; [ ------ | c1*5352] - smultb r3, r6, r12 ; [c1*5352 | ------ ] - - lsls r6, r7, #16 ; d1 != 0 ? - addeq r8, r8, r11 ; c1_b*2217+d1_b*5352+12000 + (d==0) - addne r8, r8, r0 ; c1_b*2217+d1_b*5352+12000 + (d!=0) - - asrs r6, r7, #16 - addeq r9, r9, r11 ; c1_t*2217+d1_t*5352+12000 + (d==0) - addne r9, r9, r0 ; c1_t*2217+d1_t*5352+12000 + (d!=0) - - smlabt r4, r7, r12, r10 ; [ ------ | d1*2217] + 51000 - smlatt r5, r7, r12, r10 ; [d1*2217 | ------ ] + 51000 - - pkhtb r9, r9, r8, asr #16 - - sub r4, r4, r2 - sub r5, r5, r3 - - str r9, [r1, #12] ; [o7 | o6] - pkhtb r5, r5, r4, asr #16 ; [o15|o14] - - str r5, [r1, #28] ; [o15|o14] - - ldmfd sp!, {r4 - r12, pc} - - ENDP - -; Used constants -c7500 - DCD 7500 -c14500 - DCD 14500 -c0x22a453a0 - DCD 0x22a453a0 -c0x00080008 - DCD 0x00080008 -c12000 - DCD 12000 -c51000 - DCD 51000 -c0x00070007 - DCD 0x00070007 -c0x08a914e8 - DCD 0x08a914e8 - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/arm/armv6/walsh_v6.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/arm/armv6/walsh_v6.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/arm/armv6/walsh_v6.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/arm/armv6/walsh_v6.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,212 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - EXPORT |vp8_short_walsh4x4_armv6| - - ARM - REQUIRE8 - PRESERVE8 - - AREA |.text|, CODE, READONLY ; name this block of code - -;short vp8_short_walsh4x4_armv6(short *input, short *output, int pitch) -; r0 short *input, -; r1 short *output, -; r2 int pitch -|vp8_short_walsh4x4_armv6| PROC - - stmdb sp!, {r4 - r11, lr} - - ldrd r4, r5, [r0], r2 - ldr lr, c00040004 - ldrd r6, r7, [r0], r2 - - ; 0-3 - qadd16 r3, r4, r5 ; [d1|a1] [1+3 | 0+2] - qsub16 r4, r4, r5 ; [c1|b1] [1-3 | 0-2] - - ldrd r8, r9, [r0], r2 - ; 4-7 - qadd16 r5, r6, r7 ; [d1|a1] [5+7 | 4+6] - qsub16 r6, r6, r7 ; [c1|b1] [5-7 | 4-6] - - ldrd r10, r11, [r0] - ; 8-11 - qadd16 r7, r8, r9 ; [d1|a1] [9+11 | 8+10] - qsub16 r8, r8, r9 ; [c1|b1] [9-11 | 8-10] - - ; 12-15 - qadd16 r9, r10, r11 ; [d1|a1] [13+15 | 12+14] - qsub16 r10, r10, r11 ; [c1|b1] [13-15 | 12-14] - - - lsls r2, r3, #16 - smuad r11, r3, lr ; A0 = a1<<2 + d1<<2 - addne r11, r11, #1 ; A0 += (a1!=0) - - lsls r2, r7, #16 - smuad r12, r7, lr ; C0 = a1<<2 + d1<<2 - addne r12, r12, #1 ; C0 += (a1!=0) - - add r0, r11, r12 ; a1_0 = A0 + C0 - sub r11, r11, r12 ; b1_0 = A0 - C0 - - lsls r2, r5, #16 - smuad r12, r5, lr ; B0 = a1<<2 + d1<<2 - addne r12, r12, #1 ; B0 += (a1!=0) - - lsls r2, r9, #16 - smuad r2, r9, lr ; D0 = a1<<2 + d1<<2 - addne r2, r2, #1 ; D0 += (a1!=0) - - add lr, r12, r2 ; d1_0 = B0 + D0 - sub r12, r12, r2 ; c1_0 = B0 - D0 - - ; op[0,4,8,12] - adds r2, r0, lr ; a2 = a1_0 + d1_0 - addmi r2, r2, #1 ; += a2 < 0 - add r2, r2, #3 ; += 3 - subs r0, r0, lr ; d2 = a1_0 - d1_0 - mov r2, r2, asr #3 ; >> 3 - strh r2, [r1] ; op[0] - - addmi r0, r0, #1 ; += a2 < 0 - add r0, r0, #3 ; += 3 - ldr lr, c00040004 - mov r0, r0, asr #3 ; >> 3 - strh r0, [r1, #24] ; op[12] - - adds r2, r11, r12 ; b2 = b1_0 + c1_0 - addmi r2, r2, #1 ; += a2 < 0 - add r2, r2, #3 ; += 3 - subs r0, r11, r12 ; c2 = b1_0 - c1_0 - mov r2, r2, asr #3 ; >> 3 - strh r2, [r1, #8] ; op[4] - - addmi r0, r0, #1 ; += a2 < 0 - add r0, r0, #3 ; += 3 - smusd r3, r3, lr ; A3 = a1<<2 - d1<<2 - smusd r7, r7, lr ; C3 = a1<<2 - d1<<2 - mov r0, r0, asr #3 ; >> 3 - strh r0, [r1, #16] ; op[8] - - - ; op[3,7,11,15] - add r0, r3, r7 ; a1_3 = A3 + C3 - sub r3, r3, r7 ; b1_3 = A3 - C3 - - smusd r5, r5, lr ; B3 = a1<<2 - d1<<2 - smusd r9, r9, lr ; D3 = a1<<2 - d1<<2 - add r7, r5, r9 ; d1_3 = B3 + D3 - sub r5, r5, r9 ; c1_3 = B3 - D3 - - adds r2, r0, r7 ; a2 = a1_3 + d1_3 - addmi r2, r2, #1 ; += a2 < 0 - add r2, r2, #3 ; += 3 - adds r9, r3, r5 ; b2 = b1_3 + c1_3 - mov r2, r2, asr #3 ; >> 3 - strh r2, [r1, #6] ; op[3] - - addmi r9, r9, #1 ; += a2 < 0 - add r9, r9, #3 ; += 3 - subs r2, r3, r5 ; c2 = b1_3 - c1_3 - mov r9, r9, asr #3 ; >> 3 - strh r9, [r1, #14] ; op[7] - - addmi r2, r2, #1 ; += a2 < 0 - add r2, r2, #3 ; += 3 - subs r9, r0, r7 ; d2 = a1_3 - d1_3 - mov r2, r2, asr #3 ; >> 3 - strh r2, [r1, #22] ; op[11] - - addmi r9, r9, #1 ; += a2 < 0 - add r9, r9, #3 ; += 3 - smuad r3, r4, lr ; A1 = b1<<2 + c1<<2 - smuad r5, r8, lr ; C1 = b1<<2 + c1<<2 - mov r9, r9, asr #3 ; >> 3 - strh r9, [r1, #30] ; op[15] - - ; op[1,5,9,13] - add r0, r3, r5 ; a1_1 = A1 + C1 - sub r3, r3, r5 ; b1_1 = A1 - C1 - - smuad r7, r6, lr ; B1 = b1<<2 + c1<<2 - smuad r9, r10, lr ; D1 = b1<<2 + c1<<2 - add r5, r7, r9 ; d1_1 = B1 + D1 - sub r7, r7, r9 ; c1_1 = B1 - D1 - - adds r2, r0, r5 ; a2 = a1_1 + d1_1 - addmi r2, r2, #1 ; += a2 < 0 - add r2, r2, #3 ; += 3 - adds r9, r3, r7 ; b2 = b1_1 + c1_1 - mov r2, r2, asr #3 ; >> 3 - strh r2, [r1, #2] ; op[1] - - addmi r9, r9, #1 ; += a2 < 0 - add r9, r9, #3 ; += 3 - subs r2, r3, r7 ; c2 = b1_1 - c1_1 - mov r9, r9, asr #3 ; >> 3 - strh r9, [r1, #10] ; op[5] - - addmi r2, r2, #1 ; += a2 < 0 - add r2, r2, #3 ; += 3 - subs r9, r0, r5 ; d2 = a1_1 - d1_1 - mov r2, r2, asr #3 ; >> 3 - strh r2, [r1, #18] ; op[9] - - addmi r9, r9, #1 ; += a2 < 0 - add r9, r9, #3 ; += 3 - smusd r4, r4, lr ; A2 = b1<<2 - c1<<2 - smusd r8, r8, lr ; C2 = b1<<2 - c1<<2 - mov r9, r9, asr #3 ; >> 3 - strh r9, [r1, #26] ; op[13] - - - ; op[2,6,10,14] - add r11, r4, r8 ; a1_2 = A2 + C2 - sub r12, r4, r8 ; b1_2 = A2 - C2 - - smusd r6, r6, lr ; B2 = b1<<2 - c1<<2 - smusd r10, r10, lr ; D2 = b1<<2 - c1<<2 - add r4, r6, r10 ; d1_2 = B2 + D2 - sub r8, r6, r10 ; c1_2 = B2 - D2 - - adds r2, r11, r4 ; a2 = a1_2 + d1_2 - addmi r2, r2, #1 ; += a2 < 0 - add r2, r2, #3 ; += 3 - adds r9, r12, r8 ; b2 = b1_2 + c1_2 - mov r2, r2, asr #3 ; >> 3 - strh r2, [r1, #4] ; op[2] - - addmi r9, r9, #1 ; += a2 < 0 - add r9, r9, #3 ; += 3 - subs r2, r12, r8 ; c2 = b1_2 - c1_2 - mov r9, r9, asr #3 ; >> 3 - strh r9, [r1, #12] ; op[6] - - addmi r2, r2, #1 ; += a2 < 0 - add r2, r2, #3 ; += 3 - subs r9, r11, r4 ; d2 = a1_2 - d1_2 - mov r2, r2, asr #3 ; >> 3 - strh r2, [r1, #20] ; op[10] - - addmi r9, r9, #1 ; += a2 < 0 - add r9, r9, #3 ; += 3 - mov r9, r9, asr #3 ; >> 3 - strh r9, [r1, #28] ; op[14] - - - ldmia sp!, {r4 - r11, pc} - ENDP ; |vp8_short_walsh4x4_armv6| - -c00040004 - DCD 0x00040004 - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/arm/dct_arm.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/arm/dct_arm.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/arm/dct_arm.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/arm/dct_arm.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2011 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vpx_config.h" -#include "vp8_rtcd.h" - -#if HAVE_MEDIA - -void vp8_short_fdct8x4_armv6(short *input, short *output, int pitch) -{ - vp8_short_fdct4x4_armv6(input, output, pitch); - vp8_short_fdct4x4_armv6(input + 4, output + 16, pitch); -} - -#endif /* HAVE_MEDIA */ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/arm/neon/denoising_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/arm/neon/denoising_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/arm/neon/denoising_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/arm/neon/denoising_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,478 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "vp8/encoder/denoising.h" -#include "vpx_mem/vpx_mem.h" -#include "./vp8_rtcd.h" - -/* - * The filter function was modified to reduce the computational complexity. - * - * Step 1: - * Instead of applying tap coefficients for each pixel, we calculated the - * pixel adjustments vs. pixel diff value ahead of time. - * adjustment = filtered_value - current_raw - * = (filter_coefficient * diff + 128) >> 8 - * where - * filter_coefficient = (255 << 8) / (256 + ((abs_diff * 330) >> 3)); - * filter_coefficient += filter_coefficient / - * (3 + motion_magnitude_adjustment); - * filter_coefficient is clamped to 0 ~ 255. - * - * Step 2: - * The adjustment vs. diff curve becomes flat very quick when diff increases. - * This allowed us to use only several levels to approximate the curve without - * changing the filtering algorithm too much. - * The adjustments were further corrected by checking the motion magnitude. - * The levels used are: - * diff level adjustment w/o adjustment w/ - * motion correction motion correction - * [-255, -16] 3 -6 -7 - * [-15, -8] 2 -4 -5 - * [-7, -4] 1 -3 -4 - * [-3, 3] 0 diff diff - * [4, 7] 1 3 4 - * [8, 15] 2 4 5 - * [16, 255] 3 6 7 - */ - -int vp8_denoiser_filter_neon(unsigned char *mc_running_avg_y, - int mc_running_avg_y_stride, - unsigned char *running_avg_y, - int running_avg_y_stride, - unsigned char *sig, int sig_stride, - unsigned int motion_magnitude, - int increase_denoising) { - /* If motion_magnitude is small, making the denoiser more aggressive by - * increasing the adjustment for each level, level1 adjustment is - * increased, the deltas stay the same. - */ - int shift_inc = (increase_denoising && - motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD) ? 1 : 0; - const uint8x16_t v_level1_adjustment = vmovq_n_u8( - (motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD) ? 4 + shift_inc : 3); - const uint8x16_t v_delta_level_1_and_2 = vdupq_n_u8(1); - const uint8x16_t v_delta_level_2_and_3 = vdupq_n_u8(2); - const uint8x16_t v_level1_threshold = vmovq_n_u8(4 + shift_inc); - const uint8x16_t v_level2_threshold = vdupq_n_u8(8); - const uint8x16_t v_level3_threshold = vdupq_n_u8(16); - int64x2_t v_sum_diff_total = vdupq_n_s64(0); - - /* Go over lines. */ - int r; - for (r = 0; r < 16; ++r) { - /* Load inputs. */ - const uint8x16_t v_sig = vld1q_u8(sig); - const uint8x16_t v_mc_running_avg_y = vld1q_u8(mc_running_avg_y); - - /* Calculate absolute difference and sign masks. */ - const uint8x16_t v_abs_diff = vabdq_u8(v_sig, v_mc_running_avg_y); - const uint8x16_t v_diff_pos_mask = vcltq_u8(v_sig, v_mc_running_avg_y); - const uint8x16_t v_diff_neg_mask = vcgtq_u8(v_sig, v_mc_running_avg_y); - - /* Figure out which level that put us in. */ - const uint8x16_t v_level1_mask = vcleq_u8(v_level1_threshold, - v_abs_diff); - const uint8x16_t v_level2_mask = vcleq_u8(v_level2_threshold, - v_abs_diff); - const uint8x16_t v_level3_mask = vcleq_u8(v_level3_threshold, - v_abs_diff); - - /* Calculate absolute adjustments for level 1, 2 and 3. */ - const uint8x16_t v_level2_adjustment = vandq_u8(v_level2_mask, - v_delta_level_1_and_2); - const uint8x16_t v_level3_adjustment = vandq_u8(v_level3_mask, - v_delta_level_2_and_3); - const uint8x16_t v_level1and2_adjustment = vaddq_u8(v_level1_adjustment, - v_level2_adjustment); - const uint8x16_t v_level1and2and3_adjustment = vaddq_u8( - v_level1and2_adjustment, v_level3_adjustment); - - /* Figure adjustment absolute value by selecting between the absolute - * difference if in level0 or the value for level 1, 2 and 3. - */ - const uint8x16_t v_abs_adjustment = vbslq_u8(v_level1_mask, - v_level1and2and3_adjustment, v_abs_diff); - - /* Calculate positive and negative adjustments. Apply them to the signal - * and accumulate them. Adjustments are less than eight and the maximum - * sum of them (7 * 16) can fit in a signed char. - */ - const uint8x16_t v_pos_adjustment = vandq_u8(v_diff_pos_mask, - v_abs_adjustment); - const uint8x16_t v_neg_adjustment = vandq_u8(v_diff_neg_mask, - v_abs_adjustment); - - uint8x16_t v_running_avg_y = vqaddq_u8(v_sig, v_pos_adjustment); - v_running_avg_y = vqsubq_u8(v_running_avg_y, v_neg_adjustment); - - /* Store results. */ - vst1q_u8(running_avg_y, v_running_avg_y); - - /* Sum all the accumulators to have the sum of all pixel differences - * for this macroblock. - */ - { - const int8x16_t v_sum_diff = - vqsubq_s8(vreinterpretq_s8_u8(v_pos_adjustment), - vreinterpretq_s8_u8(v_neg_adjustment)); - - const int16x8_t fe_dc_ba_98_76_54_32_10 = vpaddlq_s8(v_sum_diff); - - const int32x4_t fedc_ba98_7654_3210 = - vpaddlq_s16(fe_dc_ba_98_76_54_32_10); - - const int64x2_t fedcba98_76543210 = - vpaddlq_s32(fedc_ba98_7654_3210); - - v_sum_diff_total = vqaddq_s64(v_sum_diff_total, fedcba98_76543210); - } - - /* Update pointers for next iteration. */ - sig += sig_stride; - mc_running_avg_y += mc_running_avg_y_stride; - running_avg_y += running_avg_y_stride; - } - - /* Too much adjustments => copy block. */ - { - int64x1_t x = vqadd_s64(vget_high_s64(v_sum_diff_total), - vget_low_s64(v_sum_diff_total)); - int sum_diff = vget_lane_s32(vabs_s32(vreinterpret_s32_s64(x)), 0); - int sum_diff_thresh = SUM_DIFF_THRESHOLD; - - if (increase_denoising) sum_diff_thresh = SUM_DIFF_THRESHOLD_HIGH; - if (sum_diff > sum_diff_thresh) { - // Before returning to copy the block (i.e., apply no denoising), - // checK if we can still apply some (weaker) temporal filtering to - // this block, that would otherwise not be denoised at all. Simplest - // is to apply an additional adjustment to running_avg_y to bring it - // closer to sig. The adjustment is capped by a maximum delta, and - // chosen such that in most cases the resulting sum_diff will be - // within the accceptable range given by sum_diff_thresh. - - // The delta is set by the excess of absolute pixel diff over the - // threshold. - int delta = ((sum_diff - sum_diff_thresh) >> 8) + 1; - // Only apply the adjustment for max delta up to 3. - if (delta < 4) { - const uint8x16_t k_delta = vmovq_n_u8(delta); - sig -= sig_stride * 16; - mc_running_avg_y -= mc_running_avg_y_stride * 16; - running_avg_y -= running_avg_y_stride * 16; - for (r = 0; r < 16; ++r) { - uint8x16_t v_running_avg_y = vld1q_u8(running_avg_y); - const uint8x16_t v_sig = vld1q_u8(sig); - const uint8x16_t v_mc_running_avg_y = vld1q_u8(mc_running_avg_y); - - /* Calculate absolute difference and sign masks. */ - const uint8x16_t v_abs_diff = vabdq_u8(v_sig, - v_mc_running_avg_y); - const uint8x16_t v_diff_pos_mask = vcltq_u8(v_sig, - v_mc_running_avg_y); - const uint8x16_t v_diff_neg_mask = vcgtq_u8(v_sig, - v_mc_running_avg_y); - // Clamp absolute difference to delta to get the adjustment. - const uint8x16_t v_abs_adjustment = - vminq_u8(v_abs_diff, (k_delta)); - - const uint8x16_t v_pos_adjustment = vandq_u8(v_diff_pos_mask, - v_abs_adjustment); - const uint8x16_t v_neg_adjustment = vandq_u8(v_diff_neg_mask, - v_abs_adjustment); - - v_running_avg_y = vqsubq_u8(v_running_avg_y, v_pos_adjustment); - v_running_avg_y = vqaddq_u8(v_running_avg_y, v_neg_adjustment); - - /* Store results. */ - vst1q_u8(running_avg_y, v_running_avg_y); - - { - const int8x16_t v_sum_diff = - vqsubq_s8(vreinterpretq_s8_u8(v_neg_adjustment), - vreinterpretq_s8_u8(v_pos_adjustment)); - - const int16x8_t fe_dc_ba_98_76_54_32_10 = - vpaddlq_s8(v_sum_diff); - const int32x4_t fedc_ba98_7654_3210 = - vpaddlq_s16(fe_dc_ba_98_76_54_32_10); - const int64x2_t fedcba98_76543210 = - vpaddlq_s32(fedc_ba98_7654_3210); - - v_sum_diff_total = vqaddq_s64(v_sum_diff_total, - fedcba98_76543210); - } - /* Update pointers for next iteration. */ - sig += sig_stride; - mc_running_avg_y += mc_running_avg_y_stride; - running_avg_y += running_avg_y_stride; - } - { - // Update the sum of all pixel differences of this MB. - x = vqadd_s64(vget_high_s64(v_sum_diff_total), - vget_low_s64(v_sum_diff_total)); - sum_diff = vget_lane_s32(vabs_s32(vreinterpret_s32_s64(x)), 0); - - if (sum_diff > sum_diff_thresh) { - return COPY_BLOCK; - } - } - } else { - return COPY_BLOCK; - } - } - } - - /* Tell above level that block was filtered. */ - running_avg_y -= running_avg_y_stride * 16; - sig -= sig_stride * 16; - - vp8_copy_mem16x16(running_avg_y, running_avg_y_stride, sig, sig_stride); - - return FILTER_BLOCK; -} - -int vp8_denoiser_filter_uv_neon(unsigned char *mc_running_avg, - int mc_running_avg_stride, - unsigned char *running_avg, - int running_avg_stride, - unsigned char *sig, int sig_stride, - unsigned int motion_magnitude, - int increase_denoising) { - /* If motion_magnitude is small, making the denoiser more aggressive by - * increasing the adjustment for each level, level1 adjustment is - * increased, the deltas stay the same. - */ - int shift_inc = (increase_denoising && - motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD_UV) ? 1 : 0; - const uint8x16_t v_level1_adjustment = vmovq_n_u8( - (motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD_UV) ? 4 + shift_inc : 3); - - const uint8x16_t v_delta_level_1_and_2 = vdupq_n_u8(1); - const uint8x16_t v_delta_level_2_and_3 = vdupq_n_u8(2); - const uint8x16_t v_level1_threshold = vmovq_n_u8(4 + shift_inc); - const uint8x16_t v_level2_threshold = vdupq_n_u8(8); - const uint8x16_t v_level3_threshold = vdupq_n_u8(16); - int64x2_t v_sum_diff_total = vdupq_n_s64(0); - int r; - - { - uint16x4_t v_sum_block = vdup_n_u16(0); - - // Avoid denoising color signal if its close to average level. - for (r = 0; r < 8; ++r) { - const uint8x8_t v_sig = vld1_u8(sig); - const uint16x4_t _76_54_32_10 = vpaddl_u8(v_sig); - v_sum_block = vqadd_u16(v_sum_block, _76_54_32_10); - sig += sig_stride; - } - sig -= sig_stride * 8; - { - const uint32x2_t _7654_3210 = vpaddl_u16(v_sum_block); - const uint64x1_t _76543210 = vpaddl_u32(_7654_3210); - const int sum_block = - vget_lane_s32(vreinterpret_s32_u64(_76543210), 0); - if (abs(sum_block - (128 * 8 * 8)) < SUM_DIFF_FROM_AVG_THRESH_UV) { - return COPY_BLOCK; - } - } - } - - /* Go over lines. */ - for (r = 0; r < 4; ++r) { - /* Load inputs. */ - const uint8x8_t v_sig_lo = vld1_u8(sig); - const uint8x8_t v_sig_hi = vld1_u8(&sig[sig_stride]); - const uint8x16_t v_sig = vcombine_u8(v_sig_lo, v_sig_hi); - const uint8x8_t v_mc_running_avg_lo = vld1_u8(mc_running_avg); - const uint8x8_t v_mc_running_avg_hi = - vld1_u8(&mc_running_avg[mc_running_avg_stride]); - const uint8x16_t v_mc_running_avg = - vcombine_u8(v_mc_running_avg_lo, v_mc_running_avg_hi); - /* Calculate absolute difference and sign masks. */ - const uint8x16_t v_abs_diff = vabdq_u8(v_sig, v_mc_running_avg); - const uint8x16_t v_diff_pos_mask = vcltq_u8(v_sig, v_mc_running_avg); - const uint8x16_t v_diff_neg_mask = vcgtq_u8(v_sig, v_mc_running_avg); - - /* Figure out which level that put us in. */ - const uint8x16_t v_level1_mask = vcleq_u8(v_level1_threshold, - v_abs_diff); - const uint8x16_t v_level2_mask = vcleq_u8(v_level2_threshold, - v_abs_diff); - const uint8x16_t v_level3_mask = vcleq_u8(v_level3_threshold, - v_abs_diff); - - /* Calculate absolute adjustments for level 1, 2 and 3. */ - const uint8x16_t v_level2_adjustment = vandq_u8(v_level2_mask, - v_delta_level_1_and_2); - const uint8x16_t v_level3_adjustment = vandq_u8(v_level3_mask, - v_delta_level_2_and_3); - const uint8x16_t v_level1and2_adjustment = vaddq_u8(v_level1_adjustment, - v_level2_adjustment); - const uint8x16_t v_level1and2and3_adjustment = vaddq_u8( - v_level1and2_adjustment, v_level3_adjustment); - - /* Figure adjustment absolute value by selecting between the absolute - * difference if in level0 or the value for level 1, 2 and 3. - */ - const uint8x16_t v_abs_adjustment = vbslq_u8(v_level1_mask, - v_level1and2and3_adjustment, v_abs_diff); - - /* Calculate positive and negative adjustments. Apply them to the signal - * and accumulate them. Adjustments are less than eight and the maximum - * sum of them (7 * 16) can fit in a signed char. - */ - const uint8x16_t v_pos_adjustment = vandq_u8(v_diff_pos_mask, - v_abs_adjustment); - const uint8x16_t v_neg_adjustment = vandq_u8(v_diff_neg_mask, - v_abs_adjustment); - - uint8x16_t v_running_avg = vqaddq_u8(v_sig, v_pos_adjustment); - v_running_avg = vqsubq_u8(v_running_avg, v_neg_adjustment); - - /* Store results. */ - vst1_u8(running_avg, vget_low_u8(v_running_avg)); - vst1_u8(&running_avg[running_avg_stride], vget_high_u8(v_running_avg)); - - /* Sum all the accumulators to have the sum of all pixel differences - * for this macroblock. - */ - { - const int8x16_t v_sum_diff = - vqsubq_s8(vreinterpretq_s8_u8(v_pos_adjustment), - vreinterpretq_s8_u8(v_neg_adjustment)); - - const int16x8_t fe_dc_ba_98_76_54_32_10 = vpaddlq_s8(v_sum_diff); - - const int32x4_t fedc_ba98_7654_3210 = - vpaddlq_s16(fe_dc_ba_98_76_54_32_10); - - const int64x2_t fedcba98_76543210 = - vpaddlq_s32(fedc_ba98_7654_3210); - - v_sum_diff_total = vqaddq_s64(v_sum_diff_total, fedcba98_76543210); - } - - /* Update pointers for next iteration. */ - sig += sig_stride * 2; - mc_running_avg += mc_running_avg_stride * 2; - running_avg += running_avg_stride * 2; - } - - - /* Too much adjustments => copy block. */ - { - int64x1_t x = vqadd_s64(vget_high_s64(v_sum_diff_total), - vget_low_s64(v_sum_diff_total)); - int sum_diff = vget_lane_s32(vabs_s32(vreinterpret_s32_s64(x)), 0); - int sum_diff_thresh = SUM_DIFF_THRESHOLD_UV; - if (increase_denoising) sum_diff_thresh = SUM_DIFF_THRESHOLD_HIGH_UV; - if (sum_diff > sum_diff_thresh) { - // Before returning to copy the block (i.e., apply no denoising), - // checK if we can still apply some (weaker) temporal filtering to - // this block, that would otherwise not be denoised at all. Simplest - // is to apply an additional adjustment to running_avg_y to bring it - // closer to sig. The adjustment is capped by a maximum delta, and - // chosen such that in most cases the resulting sum_diff will be - // within the accceptable range given by sum_diff_thresh. - - // The delta is set by the excess of absolute pixel diff over the - // threshold. - int delta = ((sum_diff - sum_diff_thresh) >> 8) + 1; - // Only apply the adjustment for max delta up to 3. - if (delta < 4) { - const uint8x16_t k_delta = vmovq_n_u8(delta); - sig -= sig_stride * 8; - mc_running_avg -= mc_running_avg_stride * 8; - running_avg -= running_avg_stride * 8; - for (r = 0; r < 4; ++r) { - const uint8x8_t v_sig_lo = vld1_u8(sig); - const uint8x8_t v_sig_hi = vld1_u8(&sig[sig_stride]); - const uint8x16_t v_sig = vcombine_u8(v_sig_lo, v_sig_hi); - const uint8x8_t v_mc_running_avg_lo = vld1_u8(mc_running_avg); - const uint8x8_t v_mc_running_avg_hi = - vld1_u8(&mc_running_avg[mc_running_avg_stride]); - const uint8x16_t v_mc_running_avg = - vcombine_u8(v_mc_running_avg_lo, v_mc_running_avg_hi); - /* Calculate absolute difference and sign masks. */ - const uint8x16_t v_abs_diff = vabdq_u8(v_sig, - v_mc_running_avg); - const uint8x16_t v_diff_pos_mask = vcltq_u8(v_sig, - v_mc_running_avg); - const uint8x16_t v_diff_neg_mask = vcgtq_u8(v_sig, - v_mc_running_avg); - // Clamp absolute difference to delta to get the adjustment. - const uint8x16_t v_abs_adjustment = - vminq_u8(v_abs_diff, (k_delta)); - - const uint8x16_t v_pos_adjustment = vandq_u8(v_diff_pos_mask, - v_abs_adjustment); - const uint8x16_t v_neg_adjustment = vandq_u8(v_diff_neg_mask, - v_abs_adjustment); - const uint8x8_t v_running_avg_lo = vld1_u8(running_avg); - const uint8x8_t v_running_avg_hi = - vld1_u8(&running_avg[running_avg_stride]); - uint8x16_t v_running_avg = - vcombine_u8(v_running_avg_lo, v_running_avg_hi); - - v_running_avg = vqsubq_u8(v_running_avg, v_pos_adjustment); - v_running_avg = vqaddq_u8(v_running_avg, v_neg_adjustment); - - /* Store results. */ - vst1_u8(running_avg, vget_low_u8(v_running_avg)); - vst1_u8(&running_avg[running_avg_stride], - vget_high_u8(v_running_avg)); - - { - const int8x16_t v_sum_diff = - vqsubq_s8(vreinterpretq_s8_u8(v_neg_adjustment), - vreinterpretq_s8_u8(v_pos_adjustment)); - - const int16x8_t fe_dc_ba_98_76_54_32_10 = - vpaddlq_s8(v_sum_diff); - const int32x4_t fedc_ba98_7654_3210 = - vpaddlq_s16(fe_dc_ba_98_76_54_32_10); - const int64x2_t fedcba98_76543210 = - vpaddlq_s32(fedc_ba98_7654_3210); - - v_sum_diff_total = vqaddq_s64(v_sum_diff_total, - fedcba98_76543210); - } - /* Update pointers for next iteration. */ - sig += sig_stride * 2; - mc_running_avg += mc_running_avg_stride * 2; - running_avg += running_avg_stride * 2; - } - { - // Update the sum of all pixel differences of this MB. - x = vqadd_s64(vget_high_s64(v_sum_diff_total), - vget_low_s64(v_sum_diff_total)); - sum_diff = vget_lane_s32(vabs_s32(vreinterpret_s32_s64(x)), 0); - - if (sum_diff > sum_diff_thresh) { - return COPY_BLOCK; - } - } - } else { - return COPY_BLOCK; - } - } - } - - /* Tell above level that block was filtered. */ - running_avg -= running_avg_stride * 8; - sig -= sig_stride * 8; - - vp8_copy_mem8x8(running_avg, running_avg_stride, sig, sig_stride); - - return FILTER_BLOCK; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/arm/neon/fastquantizeb_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/arm/neon/fastquantizeb_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/arm/neon/fastquantizeb_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/arm/neon/fastquantizeb_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "vp8/encoder/block.h" - -static const uint16_t inv_zig_zag[16] = { - 1, 2, 6, 7, - 3, 5, 8, 13, - 4, 9, 12, 14, - 10, 11, 15, 16 -}; - -void vp8_fast_quantize_b_neon(BLOCK *b, BLOCKD *d) { - const int16x8_t one_q = vdupq_n_s16(-1), - z0 = vld1q_s16(b->coeff), - z1 = vld1q_s16(b->coeff + 8), - round0 = vld1q_s16(b->round), - round1 = vld1q_s16(b->round + 8), - quant0 = vld1q_s16(b->quant_fast), - quant1 = vld1q_s16(b->quant_fast + 8), - dequant0 = vld1q_s16(d->dequant), - dequant1 = vld1q_s16(d->dequant + 8); - const uint16x8_t zig_zag0 = vld1q_u16(inv_zig_zag), - zig_zag1 = vld1q_u16(inv_zig_zag + 8); - int16x8_t x0, x1, sz0, sz1, y0, y1; - uint16x8_t eob0, eob1; - uint16x4_t eob_d16; - uint32x2_t eob_d32; - uint32x4_t eob_q32; - - /* sign of z: z >> 15 */ - sz0 = vshrq_n_s16(z0, 15); - sz1 = vshrq_n_s16(z1, 15); - - /* x = abs(z) */ - x0 = vabsq_s16(z0); - x1 = vabsq_s16(z1); - - /* x += round */ - x0 = vaddq_s16(x0, round0); - x1 = vaddq_s16(x1, round1); - - /* y = 2 * (x * quant) >> 16 */ - y0 = vqdmulhq_s16(x0, quant0); - y1 = vqdmulhq_s16(x1, quant1); - - /* Compensate for doubling in vqdmulhq */ - y0 = vshrq_n_s16(y0, 1); - y1 = vshrq_n_s16(y1, 1); - - /* Restore sign bit */ - y0 = veorq_s16(y0, sz0); - y1 = veorq_s16(y1, sz1); - x0 = vsubq_s16(y0, sz0); - x1 = vsubq_s16(y1, sz1); - - /* find non-zero elements */ - eob0 = vtstq_s16(x0, one_q); - eob1 = vtstq_s16(x1, one_q); - - /* mask zig zag */ - eob0 = vandq_u16(eob0, zig_zag0); - eob1 = vandq_u16(eob1, zig_zag1); - - /* select the largest value */ - eob0 = vmaxq_u16(eob0, eob1); - eob_d16 = vmax_u16(vget_low_u16(eob0), vget_high_u16(eob0)); - eob_q32 = vmovl_u16(eob_d16); - eob_d32 = vmax_u32(vget_low_u32(eob_q32), vget_high_u32(eob_q32)); - eob_d32 = vpmax_u32(eob_d32, eob_d32); - - /* qcoeff = x */ - vst1q_s16(d->qcoeff, x0); - vst1q_s16(d->qcoeff + 8, x1); - - /* dqcoeff = x * dequant */ - vst1q_s16(d->dqcoeff, vmulq_s16(dequant0, x0)); - vst1q_s16(d->dqcoeff + 8, vmulq_s16(dequant1, x1)); - - vst1_lane_s8((int8_t *)d->eob, vreinterpret_s8_u32(eob_d32), 0); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/arm/neon/shortfdct_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/arm/neon/shortfdct_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/arm/neon/shortfdct_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/arm/neon/shortfdct_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,269 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -void vp8_short_fdct4x4_neon( - int16_t *input, - int16_t *output, - int pitch) { - int16x4_t d0s16, d1s16, d2s16, d3s16, d4s16, d5s16, d6s16, d7s16; - int16x4_t d16s16, d17s16, d26s16, dEmptys16; - uint16x4_t d4u16; - int16x8_t q0s16, q1s16; - int32x4_t q9s32, q10s32, q11s32, q12s32; - int16x4x2_t v2tmp0, v2tmp1; - int32x2x2_t v2tmp2, v2tmp3; - - d16s16 = vdup_n_s16(5352); - d17s16 = vdup_n_s16(2217); - q9s32 = vdupq_n_s32(14500); - q10s32 = vdupq_n_s32(7500); - q11s32 = vdupq_n_s32(12000); - q12s32 = vdupq_n_s32(51000); - - // Part one - pitch >>= 1; - d0s16 = vld1_s16(input); - input += pitch; - d1s16 = vld1_s16(input); - input += pitch; - d2s16 = vld1_s16(input); - input += pitch; - d3s16 = vld1_s16(input); - - v2tmp2 = vtrn_s32(vreinterpret_s32_s16(d0s16), - vreinterpret_s32_s16(d2s16)); - v2tmp3 = vtrn_s32(vreinterpret_s32_s16(d1s16), - vreinterpret_s32_s16(d3s16)); - v2tmp0 = vtrn_s16(vreinterpret_s16_s32(v2tmp2.val[0]), // d0 - vreinterpret_s16_s32(v2tmp3.val[0])); // d1 - v2tmp1 = vtrn_s16(vreinterpret_s16_s32(v2tmp2.val[1]), // d2 - vreinterpret_s16_s32(v2tmp3.val[1])); // d3 - - d4s16 = vadd_s16(v2tmp0.val[0], v2tmp1.val[1]); - d5s16 = vadd_s16(v2tmp0.val[1], v2tmp1.val[0]); - d6s16 = vsub_s16(v2tmp0.val[1], v2tmp1.val[0]); - d7s16 = vsub_s16(v2tmp0.val[0], v2tmp1.val[1]); - - d4s16 = vshl_n_s16(d4s16, 3); - d5s16 = vshl_n_s16(d5s16, 3); - d6s16 = vshl_n_s16(d6s16, 3); - d7s16 = vshl_n_s16(d7s16, 3); - - d0s16 = vadd_s16(d4s16, d5s16); - d2s16 = vsub_s16(d4s16, d5s16); - - q9s32 = vmlal_s16(q9s32, d7s16, d16s16); - q10s32 = vmlal_s16(q10s32, d7s16, d17s16); - q9s32 = vmlal_s16(q9s32, d6s16, d17s16); - q10s32 = vmlsl_s16(q10s32, d6s16, d16s16); - - d1s16 = vshrn_n_s32(q9s32, 12); - d3s16 = vshrn_n_s32(q10s32, 12); - - // Part two - v2tmp2 = vtrn_s32(vreinterpret_s32_s16(d0s16), - vreinterpret_s32_s16(d2s16)); - v2tmp3 = vtrn_s32(vreinterpret_s32_s16(d1s16), - vreinterpret_s32_s16(d3s16)); - v2tmp0 = vtrn_s16(vreinterpret_s16_s32(v2tmp2.val[0]), // d0 - vreinterpret_s16_s32(v2tmp3.val[0])); // d1 - v2tmp1 = vtrn_s16(vreinterpret_s16_s32(v2tmp2.val[1]), // d2 - vreinterpret_s16_s32(v2tmp3.val[1])); // d3 - - d4s16 = vadd_s16(v2tmp0.val[0], v2tmp1.val[1]); - d5s16 = vadd_s16(v2tmp0.val[1], v2tmp1.val[0]); - d6s16 = vsub_s16(v2tmp0.val[1], v2tmp1.val[0]); - d7s16 = vsub_s16(v2tmp0.val[0], v2tmp1.val[1]); - - d26s16 = vdup_n_s16(7); - d4s16 = vadd_s16(d4s16, d26s16); - - d0s16 = vadd_s16(d4s16, d5s16); - d2s16 = vsub_s16(d4s16, d5s16); - - q11s32 = vmlal_s16(q11s32, d7s16, d16s16); - q12s32 = vmlal_s16(q12s32, d7s16, d17s16); - - dEmptys16 = vdup_n_s16(0); - d4u16 = vceq_s16(d7s16, dEmptys16); - - d0s16 = vshr_n_s16(d0s16, 4); - d2s16 = vshr_n_s16(d2s16, 4); - - q11s32 = vmlal_s16(q11s32, d6s16, d17s16); - q12s32 = vmlsl_s16(q12s32, d6s16, d16s16); - - d4u16 = vmvn_u16(d4u16); - d1s16 = vshrn_n_s32(q11s32, 16); - d1s16 = vsub_s16(d1s16, vreinterpret_s16_u16(d4u16)); - d3s16 = vshrn_n_s32(q12s32, 16); - - q0s16 = vcombine_s16(d0s16, d1s16); - q1s16 = vcombine_s16(d2s16, d3s16); - - vst1q_s16(output, q0s16); - vst1q_s16(output + 8, q1s16); - return; -} - -void vp8_short_fdct8x4_neon( - int16_t *input, - int16_t *output, - int pitch) { - int16x4_t d0s16, d1s16, d2s16, d3s16, d4s16, d5s16, d6s16, d7s16; - int16x4_t d16s16, d17s16, d26s16, d27s16, d28s16, d29s16; - uint16x4_t d28u16, d29u16; - uint16x8_t q14u16; - int16x8_t q0s16, q1s16, q2s16, q3s16; - int16x8_t q11s16, q12s16, q13s16, q14s16, q15s16, qEmptys16; - int32x4_t q9s32, q10s32, q11s32, q12s32; - int16x8x2_t v2tmp0, v2tmp1; - int32x4x2_t v2tmp2, v2tmp3; - - d16s16 = vdup_n_s16(5352); - d17s16 = vdup_n_s16(2217); - q9s32 = vdupq_n_s32(14500); - q10s32 = vdupq_n_s32(7500); - - // Part one - pitch >>= 1; - q0s16 = vld1q_s16(input); - input += pitch; - q1s16 = vld1q_s16(input); - input += pitch; - q2s16 = vld1q_s16(input); - input += pitch; - q3s16 = vld1q_s16(input); - - v2tmp2 = vtrnq_s32(vreinterpretq_s32_s16(q0s16), - vreinterpretq_s32_s16(q2s16)); - v2tmp3 = vtrnq_s32(vreinterpretq_s32_s16(q1s16), - vreinterpretq_s32_s16(q3s16)); - v2tmp0 = vtrnq_s16(vreinterpretq_s16_s32(v2tmp2.val[0]), // q0 - vreinterpretq_s16_s32(v2tmp3.val[0])); // q1 - v2tmp1 = vtrnq_s16(vreinterpretq_s16_s32(v2tmp2.val[1]), // q2 - vreinterpretq_s16_s32(v2tmp3.val[1])); // q3 - - q11s16 = vaddq_s16(v2tmp0.val[0], v2tmp1.val[1]); - q12s16 = vaddq_s16(v2tmp0.val[1], v2tmp1.val[0]); - q13s16 = vsubq_s16(v2tmp0.val[1], v2tmp1.val[0]); - q14s16 = vsubq_s16(v2tmp0.val[0], v2tmp1.val[1]); - - q11s16 = vshlq_n_s16(q11s16, 3); - q12s16 = vshlq_n_s16(q12s16, 3); - q13s16 = vshlq_n_s16(q13s16, 3); - q14s16 = vshlq_n_s16(q14s16, 3); - - q0s16 = vaddq_s16(q11s16, q12s16); - q2s16 = vsubq_s16(q11s16, q12s16); - - q11s32 = q9s32; - q12s32 = q10s32; - - d26s16 = vget_low_s16(q13s16); - d27s16 = vget_high_s16(q13s16); - d28s16 = vget_low_s16(q14s16); - d29s16 = vget_high_s16(q14s16); - - q9s32 = vmlal_s16(q9s32, d28s16, d16s16); - q10s32 = vmlal_s16(q10s32, d28s16, d17s16); - q11s32 = vmlal_s16(q11s32, d29s16, d16s16); - q12s32 = vmlal_s16(q12s32, d29s16, d17s16); - - q9s32 = vmlal_s16(q9s32, d26s16, d17s16); - q10s32 = vmlsl_s16(q10s32, d26s16, d16s16); - q11s32 = vmlal_s16(q11s32, d27s16, d17s16); - q12s32 = vmlsl_s16(q12s32, d27s16, d16s16); - - d2s16 = vshrn_n_s32(q9s32, 12); - d6s16 = vshrn_n_s32(q10s32, 12); - d3s16 = vshrn_n_s32(q11s32, 12); - d7s16 = vshrn_n_s32(q12s32, 12); - q1s16 = vcombine_s16(d2s16, d3s16); - q3s16 = vcombine_s16(d6s16, d7s16); - - // Part two - q9s32 = vdupq_n_s32(12000); - q10s32 = vdupq_n_s32(51000); - - v2tmp2 = vtrnq_s32(vreinterpretq_s32_s16(q0s16), - vreinterpretq_s32_s16(q2s16)); - v2tmp3 = vtrnq_s32(vreinterpretq_s32_s16(q1s16), - vreinterpretq_s32_s16(q3s16)); - v2tmp0 = vtrnq_s16(vreinterpretq_s16_s32(v2tmp2.val[0]), // q0 - vreinterpretq_s16_s32(v2tmp3.val[0])); // q1 - v2tmp1 = vtrnq_s16(vreinterpretq_s16_s32(v2tmp2.val[1]), // q2 - vreinterpretq_s16_s32(v2tmp3.val[1])); // q3 - - q11s16 = vaddq_s16(v2tmp0.val[0], v2tmp1.val[1]); - q12s16 = vaddq_s16(v2tmp0.val[1], v2tmp1.val[0]); - q13s16 = vsubq_s16(v2tmp0.val[1], v2tmp1.val[0]); - q14s16 = vsubq_s16(v2tmp0.val[0], v2tmp1.val[1]); - - q15s16 = vdupq_n_s16(7); - q11s16 = vaddq_s16(q11s16, q15s16); - q0s16 = vaddq_s16(q11s16, q12s16); - q1s16 = vsubq_s16(q11s16, q12s16); - - q11s32 = q9s32; - q12s32 = q10s32; - - d0s16 = vget_low_s16(q0s16); - d1s16 = vget_high_s16(q0s16); - d2s16 = vget_low_s16(q1s16); - d3s16 = vget_high_s16(q1s16); - - d0s16 = vshr_n_s16(d0s16, 4); - d4s16 = vshr_n_s16(d1s16, 4); - d2s16 = vshr_n_s16(d2s16, 4); - d6s16 = vshr_n_s16(d3s16, 4); - - d26s16 = vget_low_s16(q13s16); - d27s16 = vget_high_s16(q13s16); - d28s16 = vget_low_s16(q14s16); - d29s16 = vget_high_s16(q14s16); - - q9s32 = vmlal_s16(q9s32, d28s16, d16s16); - q10s32 = vmlal_s16(q10s32, d28s16, d17s16); - q11s32 = vmlal_s16(q11s32, d29s16, d16s16); - q12s32 = vmlal_s16(q12s32, d29s16, d17s16); - - q9s32 = vmlal_s16(q9s32, d26s16, d17s16); - q10s32 = vmlsl_s16(q10s32, d26s16, d16s16); - q11s32 = vmlal_s16(q11s32, d27s16, d17s16); - q12s32 = vmlsl_s16(q12s32, d27s16, d16s16); - - d1s16 = vshrn_n_s32(q9s32, 16); - d3s16 = vshrn_n_s32(q10s32, 16); - d5s16 = vshrn_n_s32(q11s32, 16); - d7s16 = vshrn_n_s32(q12s32, 16); - - qEmptys16 = vdupq_n_s16(0); - q14u16 = vceqq_s16(q14s16, qEmptys16); - q14u16 = vmvnq_u16(q14u16); - - d28u16 = vget_low_u16(q14u16); - d29u16 = vget_high_u16(q14u16); - d1s16 = vsub_s16(d1s16, vreinterpret_s16_u16(d28u16)); - d5s16 = vsub_s16(d5s16, vreinterpret_s16_u16(d29u16)); - - q0s16 = vcombine_s16(d0s16, d1s16); - q1s16 = vcombine_s16(d2s16, d3s16); - q2s16 = vcombine_s16(d4s16, d5s16); - q3s16 = vcombine_s16(d6s16, d7s16); - - vst1q_s16(output, q0s16); - vst1q_s16(output + 8, q1s16); - vst1q_s16(output + 16, q2s16); - vst1q_s16(output + 24, q3s16); - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/arm/neon/subtract_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/arm/neon/subtract_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/arm/neon/subtract_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/arm/neon/subtract_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,154 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "vp8/encoder/block.h" - -void vp8_subtract_b_neon( - BLOCK *be, - BLOCKD *bd, - int pitch) { - unsigned char *src_ptr, *predictor; - int src_stride; - int16_t *src_diff; - uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8, d6u8, d7u8; - uint16x8_t q10u16, q11u16, q12u16, q13u16; - - src_ptr = *be->base_src + be->src; - src_stride = be->src_stride; - predictor = bd->predictor; - - d0u8 = vld1_u8(src_ptr); - src_ptr += src_stride; - d2u8 = vld1_u8(src_ptr); - src_ptr += src_stride; - d4u8 = vld1_u8(src_ptr); - src_ptr += src_stride; - d6u8 = vld1_u8(src_ptr); - - d1u8 = vld1_u8(predictor); - predictor += pitch; - d3u8 = vld1_u8(predictor); - predictor += pitch; - d5u8 = vld1_u8(predictor); - predictor += pitch; - d7u8 = vld1_u8(predictor); - - q10u16 = vsubl_u8(d0u8, d1u8); - q11u16 = vsubl_u8(d2u8, d3u8); - q12u16 = vsubl_u8(d4u8, d5u8); - q13u16 = vsubl_u8(d6u8, d7u8); - - src_diff = be->src_diff; - vst1_u16((uint16_t *)src_diff, vget_low_u16(q10u16)); - src_diff += pitch; - vst1_u16((uint16_t *)src_diff, vget_low_u16(q11u16)); - src_diff += pitch; - vst1_u16((uint16_t *)src_diff, vget_low_u16(q12u16)); - src_diff += pitch; - vst1_u16((uint16_t *)src_diff, vget_low_u16(q13u16)); - return; -} - -void vp8_subtract_mby_neon( - int16_t *diff, - unsigned char *src, - int src_stride, - unsigned char *pred, - int pred_stride) { - int i; - uint8x16_t q0u8, q1u8, q2u8, q3u8; - uint16x8_t q8u16, q9u16, q10u16, q11u16; - - for (i = 0; i < 8; i++) { // subtract_mby_loop - q0u8 = vld1q_u8(src); - src += src_stride; - q2u8 = vld1q_u8(src); - src += src_stride; - q1u8 = vld1q_u8(pred); - pred += pred_stride; - q3u8 = vld1q_u8(pred); - pred += pred_stride; - - q8u16 = vsubl_u8(vget_low_u8(q0u8), vget_low_u8(q1u8)); - q9u16 = vsubl_u8(vget_high_u8(q0u8), vget_high_u8(q1u8)); - q10u16 = vsubl_u8(vget_low_u8(q2u8), vget_low_u8(q3u8)); - q11u16 = vsubl_u8(vget_high_u8(q2u8), vget_high_u8(q3u8)); - - vst1q_u16((uint16_t *)diff, q8u16); - diff += 8; - vst1q_u16((uint16_t *)diff, q9u16); - diff += 8; - vst1q_u16((uint16_t *)diff, q10u16); - diff += 8; - vst1q_u16((uint16_t *)diff, q11u16); - diff += 8; - } - return; -} - -void vp8_subtract_mbuv_neon( - int16_t *diff, - unsigned char *usrc, - unsigned char *vsrc, - int src_stride, - unsigned char *upred, - unsigned char *vpred, - int pred_stride) { - int i, j; - unsigned char *src_ptr, *pred_ptr; - uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8, d6u8, d7u8; - uint16x8_t q8u16, q9u16, q10u16, q11u16; - - diff += 256; - for (i = 0; i < 2; i++) { - if (i == 0) { - src_ptr = usrc; - pred_ptr = upred; - } else if (i == 1) { - src_ptr = vsrc; - pred_ptr = vpred; - } - - for (j = 0; j < 2; j++) { - d0u8 = vld1_u8(src_ptr); - src_ptr += src_stride; - d1u8 = vld1_u8(pred_ptr); - pred_ptr += pred_stride; - d2u8 = vld1_u8(src_ptr); - src_ptr += src_stride; - d3u8 = vld1_u8(pred_ptr); - pred_ptr += pred_stride; - d4u8 = vld1_u8(src_ptr); - src_ptr += src_stride; - d5u8 = vld1_u8(pred_ptr); - pred_ptr += pred_stride; - d6u8 = vld1_u8(src_ptr); - src_ptr += src_stride; - d7u8 = vld1_u8(pred_ptr); - pred_ptr += pred_stride; - - q8u16 = vsubl_u8(d0u8, d1u8); - q9u16 = vsubl_u8(d2u8, d3u8); - q10u16 = vsubl_u8(d4u8, d5u8); - q11u16 = vsubl_u8(d6u8, d7u8); - - vst1q_u16((uint16_t *)diff, q8u16); - diff += 8; - vst1q_u16((uint16_t *)diff, q9u16); - diff += 8; - vst1q_u16((uint16_t *)diff, q10u16); - diff += 8; - vst1q_u16((uint16_t *)diff, q11u16); - diff += 8; - } - } - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/arm/neon/vp8_mse16x16_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/arm/neon/vp8_mse16x16_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/arm/neon/vp8_mse16x16_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/arm/neon/vp8_mse16x16_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -unsigned int vp8_mse16x16_neon( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *sse) { - int i; - int16x4_t d22s16, d23s16, d24s16, d25s16, d26s16, d27s16, d28s16, d29s16; - int64x1_t d0s64; - uint8x16_t q0u8, q1u8, q2u8, q3u8; - int32x4_t q7s32, q8s32, q9s32, q10s32; - uint16x8_t q11u16, q12u16, q13u16, q14u16; - int64x2_t q1s64; - - q7s32 = vdupq_n_s32(0); - q8s32 = vdupq_n_s32(0); - q9s32 = vdupq_n_s32(0); - q10s32 = vdupq_n_s32(0); - - for (i = 0; i < 8; i++) { // mse16x16_neon_loop - q0u8 = vld1q_u8(src_ptr); - src_ptr += source_stride; - q1u8 = vld1q_u8(src_ptr); - src_ptr += source_stride; - q2u8 = vld1q_u8(ref_ptr); - ref_ptr += recon_stride; - q3u8 = vld1q_u8(ref_ptr); - ref_ptr += recon_stride; - - q11u16 = vsubl_u8(vget_low_u8(q0u8), vget_low_u8(q2u8)); - q12u16 = vsubl_u8(vget_high_u8(q0u8), vget_high_u8(q2u8)); - q13u16 = vsubl_u8(vget_low_u8(q1u8), vget_low_u8(q3u8)); - q14u16 = vsubl_u8(vget_high_u8(q1u8), vget_high_u8(q3u8)); - - d22s16 = vreinterpret_s16_u16(vget_low_u16(q11u16)); - d23s16 = vreinterpret_s16_u16(vget_high_u16(q11u16)); - q7s32 = vmlal_s16(q7s32, d22s16, d22s16); - q8s32 = vmlal_s16(q8s32, d23s16, d23s16); - - d24s16 = vreinterpret_s16_u16(vget_low_u16(q12u16)); - d25s16 = vreinterpret_s16_u16(vget_high_u16(q12u16)); - q9s32 = vmlal_s16(q9s32, d24s16, d24s16); - q10s32 = vmlal_s16(q10s32, d25s16, d25s16); - - d26s16 = vreinterpret_s16_u16(vget_low_u16(q13u16)); - d27s16 = vreinterpret_s16_u16(vget_high_u16(q13u16)); - q7s32 = vmlal_s16(q7s32, d26s16, d26s16); - q8s32 = vmlal_s16(q8s32, d27s16, d27s16); - - d28s16 = vreinterpret_s16_u16(vget_low_u16(q14u16)); - d29s16 = vreinterpret_s16_u16(vget_high_u16(q14u16)); - q9s32 = vmlal_s16(q9s32, d28s16, d28s16); - q10s32 = vmlal_s16(q10s32, d29s16, d29s16); - } - - q7s32 = vaddq_s32(q7s32, q8s32); - q9s32 = vaddq_s32(q9s32, q10s32); - q10s32 = vaddq_s32(q7s32, q9s32); - - q1s64 = vpaddlq_s32(q10s32); - d0s64 = vadd_s64(vget_low_s64(q1s64), vget_high_s64(q1s64)); - - vst1_lane_u32((uint32_t *)sse, vreinterpret_u32_s64(d0s64), 0); - return vget_lane_u32(vreinterpret_u32_s64(d0s64), 0); -} - -unsigned int vp8_get4x4sse_cs_neon( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride) { - int16x4_t d22s16, d24s16, d26s16, d28s16; - int64x1_t d0s64; - uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8, d6u8, d7u8; - int32x4_t q7s32, q8s32, q9s32, q10s32; - uint16x8_t q11u16, q12u16, q13u16, q14u16; - int64x2_t q1s64; - - d0u8 = vld1_u8(src_ptr); - src_ptr += source_stride; - d4u8 = vld1_u8(ref_ptr); - ref_ptr += recon_stride; - d1u8 = vld1_u8(src_ptr); - src_ptr += source_stride; - d5u8 = vld1_u8(ref_ptr); - ref_ptr += recon_stride; - d2u8 = vld1_u8(src_ptr); - src_ptr += source_stride; - d6u8 = vld1_u8(ref_ptr); - ref_ptr += recon_stride; - d3u8 = vld1_u8(src_ptr); - src_ptr += source_stride; - d7u8 = vld1_u8(ref_ptr); - ref_ptr += recon_stride; - - q11u16 = vsubl_u8(d0u8, d4u8); - q12u16 = vsubl_u8(d1u8, d5u8); - q13u16 = vsubl_u8(d2u8, d6u8); - q14u16 = vsubl_u8(d3u8, d7u8); - - d22s16 = vget_low_s16(vreinterpretq_s16_u16(q11u16)); - d24s16 = vget_low_s16(vreinterpretq_s16_u16(q12u16)); - d26s16 = vget_low_s16(vreinterpretq_s16_u16(q13u16)); - d28s16 = vget_low_s16(vreinterpretq_s16_u16(q14u16)); - - q7s32 = vmull_s16(d22s16, d22s16); - q8s32 = vmull_s16(d24s16, d24s16); - q9s32 = vmull_s16(d26s16, d26s16); - q10s32 = vmull_s16(d28s16, d28s16); - - q7s32 = vaddq_s32(q7s32, q8s32); - q9s32 = vaddq_s32(q9s32, q10s32); - q9s32 = vaddq_s32(q7s32, q9s32); - - q1s64 = vpaddlq_s32(q9s32); - d0s64 = vadd_s64(vget_low_s64(q1s64), vget_high_s64(q1s64)); - - return vget_lane_u32(vreinterpret_u32_s64(d0s64), 0); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/arm/neon/vp8_shortwalsh4x4_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/arm/neon/vp8_shortwalsh4x4_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/arm/neon/vp8_shortwalsh4x4_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/arm/neon/vp8_shortwalsh4x4_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "vpx_ports/arm.h" - -#ifdef VPX_INCOMPATIBLE_GCC -#include "./vp8_rtcd.h" -void vp8_short_walsh4x4_neon( - int16_t *input, - int16_t *output, - int pitch) { - vp8_short_walsh4x4_c(input, output, pitch); -} -#else -void vp8_short_walsh4x4_neon( - int16_t *input, - int16_t *output, - int pitch) { - uint16x4_t d16u16; - int16x8_t q0s16, q1s16; - int16x4_t dEmptys16, d0s16, d1s16, d2s16, d3s16, d4s16, d5s16, d6s16, d7s16; - int32x4_t qEmptys32, q0s32, q1s32, q2s32, q3s32, q8s32; - int32x4_t q9s32, q10s32, q11s32, q15s32; - uint32x4_t q8u32, q9u32, q10u32, q11u32; - int16x4x2_t v2tmp0, v2tmp1; - int32x2x2_t v2tmp2, v2tmp3; - - dEmptys16 = vdup_n_s16(0); - qEmptys32 = vdupq_n_s32(0); - q15s32 = vdupq_n_s32(3); - - d0s16 = vld1_s16(input); - input += pitch/2; - d1s16 = vld1_s16(input); - input += pitch/2; - d2s16 = vld1_s16(input); - input += pitch/2; - d3s16 = vld1_s16(input); - - v2tmp2 = vtrn_s32(vreinterpret_s32_s16(d0s16), - vreinterpret_s32_s16(d2s16)); - v2tmp3 = vtrn_s32(vreinterpret_s32_s16(d1s16), - vreinterpret_s32_s16(d3s16)); - v2tmp0 = vtrn_s16(vreinterpret_s16_s32(v2tmp2.val[0]), // d0 - vreinterpret_s16_s32(v2tmp3.val[0])); // d1 - v2tmp1 = vtrn_s16(vreinterpret_s16_s32(v2tmp2.val[1]), // d2 - vreinterpret_s16_s32(v2tmp3.val[1])); // d3 - - d4s16 = vadd_s16(v2tmp0.val[0], v2tmp1.val[0]); - d5s16 = vadd_s16(v2tmp0.val[1], v2tmp1.val[1]); - d6s16 = vsub_s16(v2tmp0.val[1], v2tmp1.val[1]); - d7s16 = vsub_s16(v2tmp0.val[0], v2tmp1.val[0]); - - d4s16 = vshl_n_s16(d4s16, 2); - d5s16 = vshl_n_s16(d5s16, 2); - d6s16 = vshl_n_s16(d6s16, 2); - d7s16 = vshl_n_s16(d7s16, 2); - - d16u16 = vceq_s16(d4s16, dEmptys16); - d16u16 = vmvn_u16(d16u16); - - d0s16 = vadd_s16(d4s16, d5s16); - d3s16 = vsub_s16(d4s16, d5s16); - d1s16 = vadd_s16(d7s16, d6s16); - d2s16 = vsub_s16(d7s16, d6s16); - - d0s16 = vsub_s16(d0s16, vreinterpret_s16_u16(d16u16)); - - // Second for-loop - v2tmp2 = vtrn_s32(vreinterpret_s32_s16(d1s16), - vreinterpret_s32_s16(d3s16)); - v2tmp3 = vtrn_s32(vreinterpret_s32_s16(d0s16), - vreinterpret_s32_s16(d2s16)); - v2tmp0 = vtrn_s16(vreinterpret_s16_s32(v2tmp3.val[1]), // d2 - vreinterpret_s16_s32(v2tmp2.val[1])); // d3 - v2tmp1 = vtrn_s16(vreinterpret_s16_s32(v2tmp3.val[0]), // d0 - vreinterpret_s16_s32(v2tmp2.val[0])); // d1 - - q8s32 = vaddl_s16(v2tmp1.val[0], v2tmp0.val[0]); - q9s32 = vaddl_s16(v2tmp1.val[1], v2tmp0.val[1]); - q10s32 = vsubl_s16(v2tmp1.val[1], v2tmp0.val[1]); - q11s32 = vsubl_s16(v2tmp1.val[0], v2tmp0.val[0]); - - q0s32 = vaddq_s32(q8s32, q9s32); - q1s32 = vaddq_s32(q11s32, q10s32); - q2s32 = vsubq_s32(q11s32, q10s32); - q3s32 = vsubq_s32(q8s32, q9s32); - - q8u32 = vcltq_s32(q0s32, qEmptys32); - q9u32 = vcltq_s32(q1s32, qEmptys32); - q10u32 = vcltq_s32(q2s32, qEmptys32); - q11u32 = vcltq_s32(q3s32, qEmptys32); - - q8s32 = vreinterpretq_s32_u32(q8u32); - q9s32 = vreinterpretq_s32_u32(q9u32); - q10s32 = vreinterpretq_s32_u32(q10u32); - q11s32 = vreinterpretq_s32_u32(q11u32); - - q0s32 = vsubq_s32(q0s32, q8s32); - q1s32 = vsubq_s32(q1s32, q9s32); - q2s32 = vsubq_s32(q2s32, q10s32); - q3s32 = vsubq_s32(q3s32, q11s32); - - q8s32 = vaddq_s32(q0s32, q15s32); - q9s32 = vaddq_s32(q1s32, q15s32); - q10s32 = vaddq_s32(q2s32, q15s32); - q11s32 = vaddq_s32(q3s32, q15s32); - - d0s16 = vshrn_n_s32(q8s32, 3); - d1s16 = vshrn_n_s32(q9s32, 3); - d2s16 = vshrn_n_s32(q10s32, 3); - d3s16 = vshrn_n_s32(q11s32, 3); - - q0s16 = vcombine_s16(d0s16, d1s16); - q1s16 = vcombine_s16(d2s16, d3s16); - - vst1q_s16(output, q0s16); - vst1q_s16(output + 8, q1s16); - return; -} -#endif // VPX_INCOMPATIBLE_GCC diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/bitstream.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/bitstream.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/bitstream.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/bitstream.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1737 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vp8/common/header.h" -#include "encodemv.h" -#include "vp8/common/entropymode.h" -#include "vp8/common/findnearmv.h" -#include "mcomp.h" -#include "vp8/common/systemdependent.h" -#include -#include -#include -#include "vpx/vpx_encoder.h" -#include "vpx_mem/vpx_mem.h" -#include "bitstream.h" - -#include "defaultcoefcounts.h" -#include "vp8/common/common.h" - -const int vp8cx_base_skip_false_prob[128] = -{ - 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, - 251, 248, 244, 240, 236, 232, 229, 225, - 221, 217, 213, 208, 204, 199, 194, 190, - 187, 183, 179, 175, 172, 168, 164, 160, - 157, 153, 149, 145, 142, 138, 134, 130, - 127, 124, 120, 117, 114, 110, 107, 104, - 101, 98, 95, 92, 89, 86, 83, 80, - 77, 74, 71, 68, 65, 62, 59, 56, - 53, 50, 47, 44, 41, 38, 35, 32, - 30, 28, 26, 24, 22, 20, 18, 16, -}; - -#if defined(SECTIONBITS_OUTPUT) -unsigned __int64 Sectionbits[500]; -#endif - -#ifdef VP8_ENTROPY_STATS -int intra_mode_stats[10][10][10]; -static unsigned int tree_update_hist [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES] [2]; -extern unsigned int active_section; -#endif - -#ifdef MODE_STATS -int count_mb_seg[4] = { 0, 0, 0, 0 }; -#endif - - -static void update_mode( - vp8_writer *const w, - int n, - vp8_token tok [/* n */], - vp8_tree tree, - vp8_prob Pnew [/* n-1 */], - vp8_prob Pcur [/* n-1 */], - unsigned int bct [/* n-1 */] [2], - const unsigned int num_events[/* n */] -) -{ - unsigned int new_b = 0, old_b = 0; - int i = 0; - - vp8_tree_probs_from_distribution( - n--, tok, tree, - Pnew, bct, num_events, - 256, 1 - ); - - do - { - new_b += vp8_cost_branch(bct[i], Pnew[i]); - old_b += vp8_cost_branch(bct[i], Pcur[i]); - } - while (++i < n); - - if (new_b + (n << 8) < old_b) - { - int j = 0; - - vp8_write_bit(w, 1); - - do - { - const vp8_prob p = Pnew[j]; - - vp8_write_literal(w, Pcur[j] = p ? p : 1, 8); - } - while (++j < n); - } - else - vp8_write_bit(w, 0); -} - -static void update_mbintra_mode_probs(VP8_COMP *cpi) -{ - VP8_COMMON *const x = & cpi->common; - - vp8_writer *const w = cpi->bc; - - { - vp8_prob Pnew [VP8_YMODES-1]; - unsigned int bct [VP8_YMODES-1] [2]; - - update_mode( - w, VP8_YMODES, vp8_ymode_encodings, vp8_ymode_tree, - Pnew, x->fc.ymode_prob, bct, (unsigned int *)cpi->mb.ymode_count - ); - } - { - vp8_prob Pnew [VP8_UV_MODES-1]; - unsigned int bct [VP8_UV_MODES-1] [2]; - - update_mode( - w, VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree, - Pnew, x->fc.uv_mode_prob, bct, (unsigned int *)cpi->mb.uv_mode_count - ); - } -} - -static void write_ymode(vp8_writer *bc, int m, const vp8_prob *p) -{ - vp8_write_token(bc, vp8_ymode_tree, p, vp8_ymode_encodings + m); -} - -static void kfwrite_ymode(vp8_writer *bc, int m, const vp8_prob *p) -{ - vp8_write_token(bc, vp8_kf_ymode_tree, p, vp8_kf_ymode_encodings + m); -} - -static void write_uv_mode(vp8_writer *bc, int m, const vp8_prob *p) -{ - vp8_write_token(bc, vp8_uv_mode_tree, p, vp8_uv_mode_encodings + m); -} - - -static void write_bmode(vp8_writer *bc, int m, const vp8_prob *p) -{ - vp8_write_token(bc, vp8_bmode_tree, p, vp8_bmode_encodings + m); -} - -static void write_split(vp8_writer *bc, int x) -{ - vp8_write_token( - bc, vp8_mbsplit_tree, vp8_mbsplit_probs, vp8_mbsplit_encodings + x - ); -} - -void vp8_pack_tokens(vp8_writer *w, const TOKENEXTRA *p, int xcount) -{ - const TOKENEXTRA *stop = p + xcount; - unsigned int split; - unsigned int shift; - int count = w->count; - unsigned int range = w->range; - unsigned int lowvalue = w->lowvalue; - - while (p < stop) - { - const int t = p->Token; - vp8_token *a = vp8_coef_encodings + t; - const vp8_extra_bit_struct *b = vp8_extra_bits + t; - int i = 0; - const unsigned char *pp = p->context_tree; - int v = a->value; - int n = a->Len; - - if (p->skip_eob_node) - { - n--; - i = 2; - } - - do - { - const int bb = (v >> --n) & 1; - split = 1 + (((range - 1) * pp[i>>1]) >> 8); - i = vp8_coef_tree[i+bb]; - - if (bb) - { - lowvalue += split; - range = range - split; - } - else - { - range = split; - } - - shift = vp8_norm[range]; - range <<= shift; - count += shift; - - if (count >= 0) - { - int offset = shift - count; - - if ((lowvalue << (offset - 1)) & 0x80000000) - { - int x = w->pos - 1; - - while (x >= 0 && w->buffer[x] == 0xff) - { - w->buffer[x] = (unsigned char)0; - x--; - } - - w->buffer[x] += 1; - } - - validate_buffer(w->buffer + w->pos, - 1, - w->buffer_end, - w->error); - - w->buffer[w->pos++] = (lowvalue >> (24 - offset)); - lowvalue <<= offset; - shift = count; - lowvalue &= 0xffffff; - count -= 8 ; - } - - lowvalue <<= shift; - } - while (n); - - - if (b->base_val) - { - const int e = p->Extra, L = b->Len; - - if (L) - { - const unsigned char *proba = b->prob; - const int v2 = e >> 1; - int n2 = L; /* number of bits in v2, assumed nonzero */ - i = 0; - - do - { - const int bb = (v2 >> --n2) & 1; - split = 1 + (((range - 1) * proba[i>>1]) >> 8); - i = b->tree[i+bb]; - - if (bb) - { - lowvalue += split; - range = range - split; - } - else - { - range = split; - } - - shift = vp8_norm[range]; - range <<= shift; - count += shift; - - if (count >= 0) - { - int offset = shift - count; - - if ((lowvalue << (offset - 1)) & 0x80000000) - { - int x = w->pos - 1; - - while (x >= 0 && w->buffer[x] == 0xff) - { - w->buffer[x] = (unsigned char)0; - x--; - } - - w->buffer[x] += 1; - } - - validate_buffer(w->buffer + w->pos, - 1, - w->buffer_end, - w->error); - - w->buffer[w->pos++] = (lowvalue >> (24 - offset)); - lowvalue <<= offset; - shift = count; - lowvalue &= 0xffffff; - count -= 8 ; - } - - lowvalue <<= shift; - } - while (n2); - } - - - { - - split = (range + 1) >> 1; - - if (e & 1) - { - lowvalue += split; - range = range - split; - } - else - { - range = split; - } - - range <<= 1; - - if ((lowvalue & 0x80000000)) - { - int x = w->pos - 1; - - while (x >= 0 && w->buffer[x] == 0xff) - { - w->buffer[x] = (unsigned char)0; - x--; - } - - w->buffer[x] += 1; - - } - - lowvalue <<= 1; - - if (!++count) - { - count = -8; - - validate_buffer(w->buffer + w->pos, - 1, - w->buffer_end, - w->error); - - w->buffer[w->pos++] = (lowvalue >> 24); - lowvalue &= 0xffffff; - } - } - - } - - ++p; - } - - w->count = count; - w->lowvalue = lowvalue; - w->range = range; - -} - -static void write_partition_size(unsigned char *cx_data, int size) -{ - signed char csize; - - csize = size & 0xff; - *cx_data = csize; - csize = (size >> 8) & 0xff; - *(cx_data + 1) = csize; - csize = (size >> 16) & 0xff; - *(cx_data + 2) = csize; - -} - -static void pack_tokens_into_partitions(VP8_COMP *cpi, unsigned char *cx_data, - unsigned char * cx_data_end, - int num_part) -{ - - int i; - unsigned char *ptr = cx_data; - unsigned char *ptr_end = cx_data_end; - vp8_writer * w; - - for (i = 0; i < num_part; i++) - { - int mb_row; - - w = cpi->bc + i + 1; - - vp8_start_encode(w, ptr, ptr_end); - - for (mb_row = i; mb_row < cpi->common.mb_rows; mb_row += num_part) - { - const TOKENEXTRA *p = cpi->tplist[mb_row].start; - const TOKENEXTRA *stop = cpi->tplist[mb_row].stop; - int tokens = (int)(stop - p); - - vp8_pack_tokens(w, p, tokens); - } - - vp8_stop_encode(w); - ptr += w->pos; - } -} - - -static void pack_mb_row_tokens(VP8_COMP *cpi, vp8_writer *w) -{ - int mb_row; - - for (mb_row = 0; mb_row < cpi->common.mb_rows; mb_row++) - { - const TOKENEXTRA *p = cpi->tplist[mb_row].start; - const TOKENEXTRA *stop = cpi->tplist[mb_row].stop; - int tokens = (int)(stop - p); - - vp8_pack_tokens(w, p, tokens); - } - -} - -static void write_mv_ref -( - vp8_writer *w, MB_PREDICTION_MODE m, const vp8_prob *p -) -{ -#if CONFIG_DEBUG - assert(NEARESTMV <= m && m <= SPLITMV); -#endif - vp8_write_token(w, vp8_mv_ref_tree, p, - vp8_mv_ref_encoding_array + (m - NEARESTMV)); -} - -static void write_sub_mv_ref -( - vp8_writer *w, B_PREDICTION_MODE m, const vp8_prob *p -) -{ -#if CONFIG_DEBUG - assert(LEFT4X4 <= m && m <= NEW4X4); -#endif - vp8_write_token(w, vp8_sub_mv_ref_tree, p, - vp8_sub_mv_ref_encoding_array + (m - LEFT4X4)); -} - -static void write_mv -( - vp8_writer *w, const MV *mv, const int_mv *ref, const MV_CONTEXT *mvc -) -{ - MV e; - e.row = mv->row - ref->as_mv.row; - e.col = mv->col - ref->as_mv.col; - - vp8_encode_motion_vector(w, &e, mvc); -} - -static void write_mb_features(vp8_writer *w, const MB_MODE_INFO *mi, const MACROBLOCKD *x) -{ - /* Encode the MB segment id. */ - if (x->segmentation_enabled && x->update_mb_segmentation_map) - { - switch (mi->segment_id) - { - case 0: - vp8_write(w, 0, x->mb_segment_tree_probs[0]); - vp8_write(w, 0, x->mb_segment_tree_probs[1]); - break; - case 1: - vp8_write(w, 0, x->mb_segment_tree_probs[0]); - vp8_write(w, 1, x->mb_segment_tree_probs[1]); - break; - case 2: - vp8_write(w, 1, x->mb_segment_tree_probs[0]); - vp8_write(w, 0, x->mb_segment_tree_probs[2]); - break; - case 3: - vp8_write(w, 1, x->mb_segment_tree_probs[0]); - vp8_write(w, 1, x->mb_segment_tree_probs[2]); - break; - - /* TRAP.. This should not happen */ - default: - vp8_write(w, 0, x->mb_segment_tree_probs[0]); - vp8_write(w, 0, x->mb_segment_tree_probs[1]); - break; - } - } -} -void vp8_convert_rfct_to_prob(VP8_COMP *const cpi) -{ - const int *const rfct = cpi->mb.count_mb_ref_frame_usage; - const int rf_intra = rfct[INTRA_FRAME]; - const int rf_inter = rfct[LAST_FRAME] + rfct[GOLDEN_FRAME] + rfct[ALTREF_FRAME]; - - /* Calculate the probabilities used to code the ref frame based on usage */ - if (!(cpi->prob_intra_coded = rf_intra * 255 / (rf_intra + rf_inter))) - cpi->prob_intra_coded = 1; - - cpi->prob_last_coded = rf_inter ? (rfct[LAST_FRAME] * 255) / rf_inter : 128; - - if (!cpi->prob_last_coded) - cpi->prob_last_coded = 1; - - cpi->prob_gf_coded = (rfct[GOLDEN_FRAME] + rfct[ALTREF_FRAME]) - ? (rfct[GOLDEN_FRAME] * 255) / (rfct[GOLDEN_FRAME] + rfct[ALTREF_FRAME]) : 128; - - if (!cpi->prob_gf_coded) - cpi->prob_gf_coded = 1; - -} - -static void pack_inter_mode_mvs(VP8_COMP *const cpi) -{ - VP8_COMMON *const pc = & cpi->common; - vp8_writer *const w = cpi->bc; - const MV_CONTEXT *mvc = pc->fc.mvc; - - - MODE_INFO *m = pc->mi; - const int mis = pc->mode_info_stride; - int mb_row = -1; - - int prob_skip_false = 0; - - cpi->mb.partition_info = cpi->mb.pi; - - vp8_convert_rfct_to_prob(cpi); - -#ifdef VP8_ENTROPY_STATS - active_section = 1; -#endif - - if (pc->mb_no_coeff_skip) - { - int total_mbs = pc->mb_rows * pc->mb_cols; - - prob_skip_false = (total_mbs - cpi->mb.skip_true_count ) * 256 / total_mbs; - - if (prob_skip_false <= 1) - prob_skip_false = 1; - - if (prob_skip_false > 255) - prob_skip_false = 255; - - cpi->prob_skip_false = prob_skip_false; - vp8_write_literal(w, prob_skip_false, 8); - } - - vp8_write_literal(w, cpi->prob_intra_coded, 8); - vp8_write_literal(w, cpi->prob_last_coded, 8); - vp8_write_literal(w, cpi->prob_gf_coded, 8); - - update_mbintra_mode_probs(cpi); - - vp8_write_mvprobs(cpi); - - while (++mb_row < pc->mb_rows) - { - int mb_col = -1; - - while (++mb_col < pc->mb_cols) - { - const MB_MODE_INFO *const mi = & m->mbmi; - const MV_REFERENCE_FRAME rf = mi->ref_frame; - const MB_PREDICTION_MODE mode = mi->mode; - - MACROBLOCKD *xd = &cpi->mb.e_mbd; - - /* Distance of Mb to the various image edges. - * These specified to 8th pel as they are always compared to MV - * values that are in 1/8th pel units - */ - xd->mb_to_left_edge = -((mb_col * 16) << 3); - xd->mb_to_right_edge = ((pc->mb_cols - 1 - mb_col) * 16) << 3; - xd->mb_to_top_edge = -((mb_row * 16) << 3); - xd->mb_to_bottom_edge = ((pc->mb_rows - 1 - mb_row) * 16) << 3; - -#ifdef VP8_ENTROPY_STATS - active_section = 9; -#endif - - if (cpi->mb.e_mbd.update_mb_segmentation_map) - write_mb_features(w, mi, &cpi->mb.e_mbd); - - if (pc->mb_no_coeff_skip) - vp8_encode_bool(w, m->mbmi.mb_skip_coeff, prob_skip_false); - - if (rf == INTRA_FRAME) - { - vp8_write(w, 0, cpi->prob_intra_coded); -#ifdef VP8_ENTROPY_STATS - active_section = 6; -#endif - write_ymode(w, mode, pc->fc.ymode_prob); - - if (mode == B_PRED) - { - int j = 0; - - do - write_bmode(w, m->bmi[j].as_mode, pc->fc.bmode_prob); - while (++j < 16); - } - - write_uv_mode(w, mi->uv_mode, pc->fc.uv_mode_prob); - } - else /* inter coded */ - { - int_mv best_mv; - vp8_prob mv_ref_p [VP8_MVREFS-1]; - - vp8_write(w, 1, cpi->prob_intra_coded); - - if (rf == LAST_FRAME) - vp8_write(w, 0, cpi->prob_last_coded); - else - { - vp8_write(w, 1, cpi->prob_last_coded); - vp8_write(w, (rf == GOLDEN_FRAME) ? 0 : 1, cpi->prob_gf_coded); - } - - { - int_mv n1, n2; - int ct[4]; - - vp8_find_near_mvs(xd, m, &n1, &n2, &best_mv, ct, rf, cpi->common.ref_frame_sign_bias); - vp8_clamp_mv2(&best_mv, xd); - - vp8_mv_ref_probs(mv_ref_p, ct); - -#ifdef VP8_ENTROPY_STATS - accum_mv_refs(mode, ct); -#endif - - } - -#ifdef VP8_ENTROPY_STATS - active_section = 3; -#endif - - write_mv_ref(w, mode, mv_ref_p); - - switch (mode) /* new, split require MVs */ - { - case NEWMV: - -#ifdef VP8_ENTROPY_STATS - active_section = 5; -#endif - - write_mv(w, &mi->mv.as_mv, &best_mv, mvc); - break; - - case SPLITMV: - { - int j = 0; - -#ifdef MODE_STATS - ++count_mb_seg [mi->partitioning]; -#endif - - write_split(w, mi->partitioning); - - do - { - B_PREDICTION_MODE blockmode; - int_mv blockmv; - const int *const L = vp8_mbsplits [mi->partitioning]; - int k = -1; /* first block in subset j */ - int mv_contz; - int_mv leftmv, abovemv; - - blockmode = cpi->mb.partition_info->bmi[j].mode; - blockmv = cpi->mb.partition_info->bmi[j].mv; -#if CONFIG_DEBUG - while (j != L[++k]) - if (k >= 16) - assert(0); -#else - while (j != L[++k]); -#endif - leftmv.as_int = left_block_mv(m, k); - abovemv.as_int = above_block_mv(m, k, mis); - mv_contz = vp8_mv_cont(&leftmv, &abovemv); - - write_sub_mv_ref(w, blockmode, vp8_sub_mv_ref_prob2 [mv_contz]); - - if (blockmode == NEW4X4) - { -#ifdef VP8_ENTROPY_STATS - active_section = 11; -#endif - write_mv(w, &blockmv.as_mv, &best_mv, (const MV_CONTEXT *) mvc); - } - } - while (++j < cpi->mb.partition_info->count); - } - break; - default: - break; - } - } - - ++m; - cpi->mb.partition_info++; - } - - ++m; /* skip L prediction border */ - cpi->mb.partition_info++; - } -} - - -static void write_kfmodes(VP8_COMP *cpi) -{ - vp8_writer *const bc = cpi->bc; - const VP8_COMMON *const c = & cpi->common; - /* const */ - MODE_INFO *m = c->mi; - - int mb_row = -1; - int prob_skip_false = 0; - - if (c->mb_no_coeff_skip) - { - int total_mbs = c->mb_rows * c->mb_cols; - - prob_skip_false = (total_mbs - cpi->mb.skip_true_count ) * 256 / total_mbs; - - if (prob_skip_false <= 1) - prob_skip_false = 1; - - if (prob_skip_false >= 255) - prob_skip_false = 255; - - cpi->prob_skip_false = prob_skip_false; - vp8_write_literal(bc, prob_skip_false, 8); - } - - while (++mb_row < c->mb_rows) - { - int mb_col = -1; - - while (++mb_col < c->mb_cols) - { - const int ym = m->mbmi.mode; - - if (cpi->mb.e_mbd.update_mb_segmentation_map) - write_mb_features(bc, &m->mbmi, &cpi->mb.e_mbd); - - if (c->mb_no_coeff_skip) - vp8_encode_bool(bc, m->mbmi.mb_skip_coeff, prob_skip_false); - - kfwrite_ymode(bc, ym, vp8_kf_ymode_prob); - - if (ym == B_PRED) - { - const int mis = c->mode_info_stride; - int i = 0; - - do - { - const B_PREDICTION_MODE A = above_block_mode(m, i, mis); - const B_PREDICTION_MODE L = left_block_mode(m, i); - const int bm = m->bmi[i].as_mode; - -#ifdef VP8_ENTROPY_STATS - ++intra_mode_stats [A] [L] [bm]; -#endif - - write_bmode(bc, bm, vp8_kf_bmode_prob [A] [L]); - } - while (++i < 16); - } - - write_uv_mode(bc, (m++)->mbmi.uv_mode, vp8_kf_uv_mode_prob); - } - - m++; /* skip L prediction border */ - } -} - -#if 0 -/* This function is used for debugging probability trees. */ -static void print_prob_tree(vp8_prob - coef_probs[BLOCK_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS][ENTROPY_NODES]) -{ - /* print coef probability tree */ - int i,j,k,l; - FILE* f = fopen("enc_tree_probs.txt", "a"); - fprintf(f, "{\n"); - for (i = 0; i < BLOCK_TYPES; i++) - { - fprintf(f, " {\n"); - for (j = 0; j < COEF_BANDS; j++) - { - fprintf(f, " {\n"); - for (k = 0; k < PREV_COEF_CONTEXTS; k++) - { - fprintf(f, " {"); - for (l = 0; l < ENTROPY_NODES; l++) - { - fprintf(f, "%3u, ", - (unsigned int)(coef_probs [i][j][k][l])); - } - fprintf(f, " }\n"); - } - fprintf(f, " }\n"); - } - fprintf(f, " }\n"); - } - fprintf(f, "}\n"); - fclose(f); -} -#endif - -static void sum_probs_over_prev_coef_context( - const unsigned int probs[PREV_COEF_CONTEXTS][MAX_ENTROPY_TOKENS], - unsigned int* out) -{ - int i, j; - for (i=0; i < MAX_ENTROPY_TOKENS; ++i) - { - for (j=0; j < PREV_COEF_CONTEXTS; ++j) - { - const unsigned int tmp = out[i]; - out[i] += probs[j][i]; - /* check for wrap */ - if (out[i] < tmp) - out[i] = UINT_MAX; - } - } -} - -static int prob_update_savings(const unsigned int *ct, - const vp8_prob oldp, const vp8_prob newp, - const vp8_prob upd) -{ - const int old_b = vp8_cost_branch(ct, oldp); - const int new_b = vp8_cost_branch(ct, newp); - const int update_b = 8 + - ((vp8_cost_one(upd) - vp8_cost_zero(upd)) >> 8); - - return old_b - new_b - update_b; -} - -static int independent_coef_context_savings(VP8_COMP *cpi) -{ - MACROBLOCK *const x = & cpi->mb; - int savings = 0; - int i = 0; - do - { - int j = 0; - do - { - int k = 0; - unsigned int prev_coef_count_sum[MAX_ENTROPY_TOKENS] = {0}; - int prev_coef_savings[MAX_ENTROPY_TOKENS] = {0}; - const unsigned int (*probs)[MAX_ENTROPY_TOKENS]; - /* Calculate new probabilities given the constraint that - * they must be equal over the prev coef contexts - */ - - probs = (const unsigned int (*)[MAX_ENTROPY_TOKENS]) - x->coef_counts[i][j]; - - /* Reset to default probabilities at key frames */ - if (cpi->common.frame_type == KEY_FRAME) - probs = default_coef_counts[i][j]; - - sum_probs_over_prev_coef_context(probs, prev_coef_count_sum); - - do - { - /* at every context */ - - /* calc probs and branch cts for this frame only */ - int t = 0; /* token/prob index */ - - vp8_tree_probs_from_distribution( - MAX_ENTROPY_TOKENS, vp8_coef_encodings, vp8_coef_tree, - cpi->frame_coef_probs[i][j][k], - cpi->frame_branch_ct [i][j][k], - prev_coef_count_sum, - 256, 1); - - do - { - const unsigned int *ct = cpi->frame_branch_ct [i][j][k][t]; - const vp8_prob newp = cpi->frame_coef_probs [i][j][k][t]; - const vp8_prob oldp = cpi->common.fc.coef_probs [i][j][k][t]; - const vp8_prob upd = vp8_coef_update_probs [i][j][k][t]; - const int s = prob_update_savings(ct, oldp, newp, upd); - - if (cpi->common.frame_type != KEY_FRAME || - (cpi->common.frame_type == KEY_FRAME && newp != oldp)) - prev_coef_savings[t] += s; - } - while (++t < ENTROPY_NODES); - } - while (++k < PREV_COEF_CONTEXTS); - k = 0; - do - { - /* We only update probabilities if we can save bits, except - * for key frames where we have to update all probabilities - * to get the equal probabilities across the prev coef - * contexts. - */ - if (prev_coef_savings[k] > 0 || - cpi->common.frame_type == KEY_FRAME) - savings += prev_coef_savings[k]; - } - while (++k < ENTROPY_NODES); - } - while (++j < COEF_BANDS); - } - while (++i < BLOCK_TYPES); - return savings; -} - -static int default_coef_context_savings(VP8_COMP *cpi) -{ - MACROBLOCK *const x = & cpi->mb; - int savings = 0; - int i = 0; - do - { - int j = 0; - do - { - int k = 0; - do - { - /* at every context */ - - /* calc probs and branch cts for this frame only */ - int t = 0; /* token/prob index */ - - vp8_tree_probs_from_distribution( - MAX_ENTROPY_TOKENS, vp8_coef_encodings, vp8_coef_tree, - cpi->frame_coef_probs [i][j][k], - cpi->frame_branch_ct [i][j][k], - x->coef_counts [i][j][k], - 256, 1 - ); - - do - { - const unsigned int *ct = cpi->frame_branch_ct [i][j][k][t]; - const vp8_prob newp = cpi->frame_coef_probs [i][j][k][t]; - const vp8_prob oldp = cpi->common.fc.coef_probs [i][j][k][t]; - const vp8_prob upd = vp8_coef_update_probs [i][j][k][t]; - const int s = prob_update_savings(ct, oldp, newp, upd); - - if (s > 0) - { - savings += s; - } - } - while (++t < ENTROPY_NODES); - } - while (++k < PREV_COEF_CONTEXTS); - } - while (++j < COEF_BANDS); - } - while (++i < BLOCK_TYPES); - return savings; -} - -void vp8_calc_ref_frame_costs(int *ref_frame_cost, - int prob_intra, - int prob_last, - int prob_garf - ) -{ - assert(prob_intra >= 0); - assert(prob_intra <= 255); - assert(prob_last >= 0); - assert(prob_last <= 255); - assert(prob_garf >= 0); - assert(prob_garf <= 255); - ref_frame_cost[INTRA_FRAME] = vp8_cost_zero(prob_intra); - ref_frame_cost[LAST_FRAME] = vp8_cost_one(prob_intra) - + vp8_cost_zero(prob_last); - ref_frame_cost[GOLDEN_FRAME] = vp8_cost_one(prob_intra) - + vp8_cost_one(prob_last) - + vp8_cost_zero(prob_garf); - ref_frame_cost[ALTREF_FRAME] = vp8_cost_one(prob_intra) - + vp8_cost_one(prob_last) - + vp8_cost_one(prob_garf); - -} - -int vp8_estimate_entropy_savings(VP8_COMP *cpi) -{ - int savings = 0; - - const int *const rfct = cpi->mb.count_mb_ref_frame_usage; - const int rf_intra = rfct[INTRA_FRAME]; - const int rf_inter = rfct[LAST_FRAME] + rfct[GOLDEN_FRAME] + rfct[ALTREF_FRAME]; - int new_intra, new_last, new_garf, oldtotal, newtotal; - int ref_frame_cost[MAX_REF_FRAMES]; - - vp8_clear_system_state(); - - if (cpi->common.frame_type != KEY_FRAME) - { - if (!(new_intra = rf_intra * 255 / (rf_intra + rf_inter))) - new_intra = 1; - - new_last = rf_inter ? (rfct[LAST_FRAME] * 255) / rf_inter : 128; - - new_garf = (rfct[GOLDEN_FRAME] + rfct[ALTREF_FRAME]) - ? (rfct[GOLDEN_FRAME] * 255) / (rfct[GOLDEN_FRAME] + rfct[ALTREF_FRAME]) : 128; - - - vp8_calc_ref_frame_costs(ref_frame_cost,new_intra,new_last,new_garf); - - newtotal = - rfct[INTRA_FRAME] * ref_frame_cost[INTRA_FRAME] + - rfct[LAST_FRAME] * ref_frame_cost[LAST_FRAME] + - rfct[GOLDEN_FRAME] * ref_frame_cost[GOLDEN_FRAME] + - rfct[ALTREF_FRAME] * ref_frame_cost[ALTREF_FRAME]; - - - /* old costs */ - vp8_calc_ref_frame_costs(ref_frame_cost,cpi->prob_intra_coded, - cpi->prob_last_coded,cpi->prob_gf_coded); - - oldtotal = - rfct[INTRA_FRAME] * ref_frame_cost[INTRA_FRAME] + - rfct[LAST_FRAME] * ref_frame_cost[LAST_FRAME] + - rfct[GOLDEN_FRAME] * ref_frame_cost[GOLDEN_FRAME] + - rfct[ALTREF_FRAME] * ref_frame_cost[ALTREF_FRAME]; - - savings += (oldtotal - newtotal) / 256; - } - - - if (cpi->oxcf.error_resilient_mode & VPX_ERROR_RESILIENT_PARTITIONS) - savings += independent_coef_context_savings(cpi); - else - savings += default_coef_context_savings(cpi); - - - return savings; -} - -#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING -int vp8_update_coef_context(VP8_COMP *cpi) -{ - int savings = 0; - - - if (cpi->common.frame_type == KEY_FRAME) - { - /* Reset to default counts/probabilities at key frames */ - vp8_copy(cpi->mb.coef_counts, default_coef_counts); - } - - if (cpi->oxcf.error_resilient_mode & VPX_ERROR_RESILIENT_PARTITIONS) - savings += independent_coef_context_savings(cpi); - else - savings += default_coef_context_savings(cpi); - - return savings; -} -#endif - -void vp8_update_coef_probs(VP8_COMP *cpi) -{ - int i = 0; -#if !(CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING) - vp8_writer *const w = cpi->bc; -#endif - int savings = 0; - - vp8_clear_system_state(); - - do - { - int j = 0; - - do - { - int k = 0; - int prev_coef_savings[ENTROPY_NODES] = {0}; - if (cpi->oxcf.error_resilient_mode & VPX_ERROR_RESILIENT_PARTITIONS) - { - for (k = 0; k < PREV_COEF_CONTEXTS; ++k) - { - int t; /* token/prob index */ - for (t = 0; t < ENTROPY_NODES; ++t) - { - const unsigned int *ct = cpi->frame_branch_ct [i][j] - [k][t]; - const vp8_prob newp = cpi->frame_coef_probs[i][j][k][t]; - const vp8_prob oldp = cpi->common.fc.coef_probs[i][j] - [k][t]; - const vp8_prob upd = vp8_coef_update_probs[i][j][k][t]; - - prev_coef_savings[t] += - prob_update_savings(ct, oldp, newp, upd); - } - } - k = 0; - } - do - { - /* note: use result from vp8_estimate_entropy_savings, so no - * need to call vp8_tree_probs_from_distribution here. - */ - - /* at every context */ - - /* calc probs and branch cts for this frame only */ - int t = 0; /* token/prob index */ - - do - { - const vp8_prob newp = cpi->frame_coef_probs [i][j][k][t]; - - vp8_prob *Pold = cpi->common.fc.coef_probs [i][j][k] + t; - const vp8_prob upd = vp8_coef_update_probs [i][j][k][t]; - - int s = prev_coef_savings[t]; - int u = 0; - - if (!(cpi->oxcf.error_resilient_mode & - VPX_ERROR_RESILIENT_PARTITIONS)) - { - s = prob_update_savings( - cpi->frame_branch_ct [i][j][k][t], - *Pold, newp, upd); - } - - if (s > 0) - u = 1; - - /* Force updates on key frames if the new is different, - * so that we can be sure we end up with equal probabilities - * over the prev coef contexts. - */ - if ((cpi->oxcf.error_resilient_mode & - VPX_ERROR_RESILIENT_PARTITIONS) && - cpi->common.frame_type == KEY_FRAME && newp != *Pold) - u = 1; - -#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING - cpi->update_probs[i][j][k][t] = u; -#else - vp8_write(w, u, upd); -#endif - - -#ifdef VP8_ENTROPY_STATS - ++ tree_update_hist [i][j][k][t] [u]; -#endif - - if (u) - { - /* send/use new probability */ - - *Pold = newp; -#if !(CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING) - vp8_write_literal(w, newp, 8); -#endif - - savings += s; - - } - - } - while (++t < ENTROPY_NODES); - - /* Accum token counts for generation of default statistics */ -#ifdef VP8_ENTROPY_STATS - t = 0; - - do - { - context_counters [i][j][k][t] += cpi->coef_counts [i][j][k][t]; - } - while (++t < MAX_ENTROPY_TOKENS); - -#endif - - } - while (++k < PREV_COEF_CONTEXTS); - } - while (++j < COEF_BANDS); - } - while (++i < BLOCK_TYPES); - -} - -#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING -static void pack_coef_probs(VP8_COMP *cpi) -{ - int i = 0; - vp8_writer *const w = cpi->bc; - - do - { - int j = 0; - - do - { - int k = 0; - - do - { - int t = 0; /* token/prob index */ - - do - { - const vp8_prob newp = cpi->common.fc.coef_probs [i][j][k][t]; - const vp8_prob upd = vp8_coef_update_probs [i][j][k][t]; - - const char u = cpi->update_probs[i][j][k][t] ; - - vp8_write(w, u, upd); - - if (u) - { - /* send/use new probability */ - vp8_write_literal(w, newp, 8); - } - } - while (++t < ENTROPY_NODES); - } - while (++k < PREV_COEF_CONTEXTS); - } - while (++j < COEF_BANDS); - } - while (++i < BLOCK_TYPES); -} -#endif - -#ifdef PACKET_TESTING -FILE *vpxlogc = 0; -#endif - -static void put_delta_q(vp8_writer *bc, int delta_q) -{ - if (delta_q != 0) - { - vp8_write_bit(bc, 1); - vp8_write_literal(bc, abs(delta_q), 4); - - if (delta_q < 0) - vp8_write_bit(bc, 1); - else - vp8_write_bit(bc, 0); - } - else - vp8_write_bit(bc, 0); -} - -void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned char * dest_end, unsigned long *size) -{ - int i, j; - VP8_HEADER oh; - VP8_COMMON *const pc = & cpi->common; - vp8_writer *const bc = cpi->bc; - MACROBLOCKD *const xd = & cpi->mb.e_mbd; - int extra_bytes_packed = 0; - - unsigned char *cx_data = dest; - unsigned char *cx_data_end = dest_end; - const int *mb_feature_data_bits; - - oh.show_frame = (int) pc->show_frame; - oh.type = (int)pc->frame_type; - oh.version = pc->version; - oh.first_partition_length_in_bytes = 0; - - mb_feature_data_bits = vp8_mb_feature_data_bits; - - bc[0].error = &pc->error; - - validate_buffer(cx_data, 3, cx_data_end, &cpi->common.error); - cx_data += 3; - -#if defined(SECTIONBITS_OUTPUT) - Sectionbits[active_section = 1] += sizeof(VP8_HEADER) * 8 * 256; -#endif - - /* every keyframe send startcode, width, height, scale factor, clamp - * and color type - */ - if (oh.type == KEY_FRAME) - { - int v; - - validate_buffer(cx_data, 7, cx_data_end, &cpi->common.error); - - /* Start / synch code */ - cx_data[0] = 0x9D; - cx_data[1] = 0x01; - cx_data[2] = 0x2a; - - v = (pc->horiz_scale << 14) | pc->Width; - cx_data[3] = v; - cx_data[4] = v >> 8; - - v = (pc->vert_scale << 14) | pc->Height; - cx_data[5] = v; - cx_data[6] = v >> 8; - - - extra_bytes_packed = 7; - cx_data += extra_bytes_packed ; - - vp8_start_encode(bc, cx_data, cx_data_end); - - /* signal clr type */ - vp8_write_bit(bc, 0); - vp8_write_bit(bc, pc->clamp_type); - - } - else - vp8_start_encode(bc, cx_data, cx_data_end); - - - /* Signal whether or not Segmentation is enabled */ - vp8_write_bit(bc, xd->segmentation_enabled); - - /* Indicate which features are enabled */ - if (xd->segmentation_enabled) - { - /* Signal whether or not the segmentation map is being updated. */ - vp8_write_bit(bc, xd->update_mb_segmentation_map); - vp8_write_bit(bc, xd->update_mb_segmentation_data); - - if (xd->update_mb_segmentation_data) - { - signed char Data; - - vp8_write_bit(bc, xd->mb_segement_abs_delta); - - /* For each segmentation feature (Quant and loop filter level) */ - for (i = 0; i < MB_LVL_MAX; i++) - { - /* For each of the segments */ - for (j = 0; j < MAX_MB_SEGMENTS; j++) - { - Data = xd->segment_feature_data[i][j]; - - /* Frame level data */ - if (Data) - { - vp8_write_bit(bc, 1); - - if (Data < 0) - { - Data = - Data; - vp8_write_literal(bc, Data, mb_feature_data_bits[i]); - vp8_write_bit(bc, 1); - } - else - { - vp8_write_literal(bc, Data, mb_feature_data_bits[i]); - vp8_write_bit(bc, 0); - } - } - else - vp8_write_bit(bc, 0); - } - } - } - - if (xd->update_mb_segmentation_map) - { - /* Write the probs used to decode the segment id for each mb */ - for (i = 0; i < MB_FEATURE_TREE_PROBS; i++) - { - int Data = xd->mb_segment_tree_probs[i]; - - if (Data != 255) - { - vp8_write_bit(bc, 1); - vp8_write_literal(bc, Data, 8); - } - else - vp8_write_bit(bc, 0); - } - } - } - - vp8_write_bit(bc, pc->filter_type); - vp8_write_literal(bc, pc->filter_level, 6); - vp8_write_literal(bc, pc->sharpness_level, 3); - - /* Write out loop filter deltas applied at the MB level based on mode - * or ref frame (if they are enabled). - */ - vp8_write_bit(bc, xd->mode_ref_lf_delta_enabled); - - if (xd->mode_ref_lf_delta_enabled) - { - /* Do the deltas need to be updated */ - int send_update = xd->mode_ref_lf_delta_update - || cpi->oxcf.error_resilient_mode; - - vp8_write_bit(bc, send_update); - if (send_update) - { - int Data; - - /* Send update */ - for (i = 0; i < MAX_REF_LF_DELTAS; i++) - { - Data = xd->ref_lf_deltas[i]; - - /* Frame level data */ - if (xd->ref_lf_deltas[i] != xd->last_ref_lf_deltas[i] - || cpi->oxcf.error_resilient_mode) - { - xd->last_ref_lf_deltas[i] = xd->ref_lf_deltas[i]; - vp8_write_bit(bc, 1); - - if (Data > 0) - { - vp8_write_literal(bc, (Data & 0x3F), 6); - vp8_write_bit(bc, 0); /* sign */ - } - else - { - Data = -Data; - vp8_write_literal(bc, (Data & 0x3F), 6); - vp8_write_bit(bc, 1); /* sign */ - } - } - else - vp8_write_bit(bc, 0); - } - - /* Send update */ - for (i = 0; i < MAX_MODE_LF_DELTAS; i++) - { - Data = xd->mode_lf_deltas[i]; - - if (xd->mode_lf_deltas[i] != xd->last_mode_lf_deltas[i] - || cpi->oxcf.error_resilient_mode) - { - xd->last_mode_lf_deltas[i] = xd->mode_lf_deltas[i]; - vp8_write_bit(bc, 1); - - if (Data > 0) - { - vp8_write_literal(bc, (Data & 0x3F), 6); - vp8_write_bit(bc, 0); /* sign */ - } - else - { - Data = -Data; - vp8_write_literal(bc, (Data & 0x3F), 6); - vp8_write_bit(bc, 1); /* sign */ - } - } - else - vp8_write_bit(bc, 0); - } - } - } - - /* signal here is multi token partition is enabled */ - vp8_write_literal(bc, pc->multi_token_partition, 2); - - /* Frame Qbaseline quantizer index */ - vp8_write_literal(bc, pc->base_qindex, 7); - - /* Transmit Dc, Second order and Uv quantizer delta information */ - put_delta_q(bc, pc->y1dc_delta_q); - put_delta_q(bc, pc->y2dc_delta_q); - put_delta_q(bc, pc->y2ac_delta_q); - put_delta_q(bc, pc->uvdc_delta_q); - put_delta_q(bc, pc->uvac_delta_q); - - /* When there is a key frame all reference buffers are updated using - * the new key frame - */ - if (pc->frame_type != KEY_FRAME) - { - /* Should the GF or ARF be updated using the transmitted frame - * or buffer - */ - vp8_write_bit(bc, pc->refresh_golden_frame); - vp8_write_bit(bc, pc->refresh_alt_ref_frame); - - /* If not being updated from current frame should either GF or ARF - * be updated from another buffer - */ - if (!pc->refresh_golden_frame) - vp8_write_literal(bc, pc->copy_buffer_to_gf, 2); - - if (!pc->refresh_alt_ref_frame) - vp8_write_literal(bc, pc->copy_buffer_to_arf, 2); - - /* Indicate reference frame sign bias for Golden and ARF frames - * (always 0 for last frame buffer) - */ - vp8_write_bit(bc, pc->ref_frame_sign_bias[GOLDEN_FRAME]); - vp8_write_bit(bc, pc->ref_frame_sign_bias[ALTREF_FRAME]); - } - -#if !(CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING) - if (cpi->oxcf.error_resilient_mode & VPX_ERROR_RESILIENT_PARTITIONS) - { - if (pc->frame_type == KEY_FRAME) - pc->refresh_entropy_probs = 1; - else - pc->refresh_entropy_probs = 0; - } -#endif - - vp8_write_bit(bc, pc->refresh_entropy_probs); - - if (pc->frame_type != KEY_FRAME) - vp8_write_bit(bc, pc->refresh_last_frame); - -#ifdef VP8_ENTROPY_STATS - - if (pc->frame_type == INTER_FRAME) - active_section = 0; - else - active_section = 7; - -#endif - - vp8_clear_system_state(); - -#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING - pack_coef_probs(cpi); -#else - if (pc->refresh_entropy_probs == 0) - { - /* save a copy for later refresh */ - vpx_memcpy(&cpi->common.lfc, &cpi->common.fc, sizeof(cpi->common.fc)); - } - - vp8_update_coef_probs(cpi); -#endif - -#ifdef VP8_ENTROPY_STATS - active_section = 2; -#endif - - /* Write out the mb_no_coeff_skip flag */ - vp8_write_bit(bc, pc->mb_no_coeff_skip); - - if (pc->frame_type == KEY_FRAME) - { - write_kfmodes(cpi); - -#ifdef VP8_ENTROPY_STATS - active_section = 8; -#endif - } - else - { - pack_inter_mode_mvs(cpi); - -#ifdef VP8_ENTROPY_STATS - active_section = 1; -#endif - } - - vp8_stop_encode(bc); - - cx_data += bc->pos; - - oh.first_partition_length_in_bytes = cpi->bc->pos; - - /* update frame tag */ - { - int v = (oh.first_partition_length_in_bytes << 5) | - (oh.show_frame << 4) | - (oh.version << 1) | - oh.type; - - dest[0] = v; - dest[1] = v >> 8; - dest[2] = v >> 16; - } - - *size = VP8_HEADER_SIZE + extra_bytes_packed + cpi->bc->pos; - - cpi->partition_sz[0] = *size; - -#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING - { - const int num_part = (1 << pc->multi_token_partition); - unsigned char * dp = cpi->partition_d[0] + cpi->partition_sz[0]; - - if (num_part > 1) - { - /* write token part sizes (all but last) if more than 1 */ - validate_buffer(dp, 3 * (num_part - 1), cpi->partition_d_end[0], - &pc->error); - - cpi->partition_sz[0] += 3*(num_part-1); - - for(i = 1; i < num_part; i++) - { - write_partition_size(dp, cpi->partition_sz[i]); - dp += 3; - } - } - - if (!cpi->output_partition) - { - /* concatenate partition buffers */ - for(i = 0; i < num_part; i++) - { - vpx_memmove(dp, cpi->partition_d[i+1], cpi->partition_sz[i+1]); - cpi->partition_d[i+1] = dp; - dp += cpi->partition_sz[i+1]; - } - } - - /* update total size */ - *size = 0; - for(i = 0; i < num_part+1; i++) - { - *size += cpi->partition_sz[i]; - } - } -#else - if (pc->multi_token_partition != ONE_PARTITION) - { - int num_part = 1 << pc->multi_token_partition; - - /* partition size table at the end of first partition */ - cpi->partition_sz[0] += 3 * (num_part - 1); - *size += 3 * (num_part - 1); - - validate_buffer(cx_data, 3 * (num_part - 1), cx_data_end, - &pc->error); - - for(i = 1; i < num_part + 1; i++) - { - cpi->bc[i].error = &pc->error; - } - - pack_tokens_into_partitions(cpi, cx_data + 3 * (num_part - 1), - cx_data_end, num_part); - - for(i = 1; i < num_part; i++) - { - cpi->partition_sz[i] = cpi->bc[i].pos; - write_partition_size(cx_data, cpi->partition_sz[i]); - cx_data += 3; - *size += cpi->partition_sz[i]; /* add to total */ - } - - /* add last partition to total size */ - cpi->partition_sz[i] = cpi->bc[i].pos; - *size += cpi->partition_sz[i]; - } - else - { - bc[1].error = &pc->error; - - vp8_start_encode(&cpi->bc[1], cx_data, cx_data_end); - -#if CONFIG_MULTITHREAD - if (cpi->b_multi_threaded) - pack_mb_row_tokens(cpi, &cpi->bc[1]); - else -#endif - vp8_pack_tokens(&cpi->bc[1], cpi->tok, cpi->tok_count); - - vp8_stop_encode(&cpi->bc[1]); - - *size += cpi->bc[1].pos; - cpi->partition_sz[1] = cpi->bc[1].pos; - } -#endif -} - -#ifdef VP8_ENTROPY_STATS -void print_tree_update_probs() -{ - int i, j, k, l; - FILE *f = fopen("context.c", "a"); - int Sum; - fprintf(f, "\n/* Update probabilities for token entropy tree. */\n\n"); - fprintf(f, "const vp8_prob tree_update_probs[BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES] = {\n"); - - for (i = 0; i < BLOCK_TYPES; i++) - { - fprintf(f, " { \n"); - - for (j = 0; j < COEF_BANDS; j++) - { - fprintf(f, " {\n"); - - for (k = 0; k < PREV_COEF_CONTEXTS; k++) - { - fprintf(f, " {"); - - for (l = 0; l < ENTROPY_NODES; l++) - { - Sum = tree_update_hist[i][j][k][l][0] + tree_update_hist[i][j][k][l][1]; - - if (Sum > 0) - { - if (((tree_update_hist[i][j][k][l][0] * 255) / Sum) > 0) - fprintf(f, "%3ld, ", (tree_update_hist[i][j][k][l][0] * 255) / Sum); - else - fprintf(f, "%3ld, ", 1); - } - else - fprintf(f, "%3ld, ", 128); - } - - fprintf(f, "},\n"); - } - - fprintf(f, " },\n"); - } - - fprintf(f, " },\n"); - } - - fprintf(f, "};\n"); - fclose(f); -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/bitstream.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/bitstream.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/bitstream.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/bitstream.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_ENCODER_BITSTREAM_H_ -#define VP8_ENCODER_BITSTREAM_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -void vp8_pack_tokens(vp8_writer *w, const TOKENEXTRA *p, int xcount); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_BITSTREAM_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/block.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/block.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/block.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/block.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,175 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_ENCODER_BLOCK_H_ -#define VP8_ENCODER_BLOCK_H_ - -#include "vp8/common/onyx.h" -#include "vp8/common/blockd.h" -#include "vp8/common/entropymv.h" -#include "vp8/common/entropy.h" -#include "vpx_ports/mem.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define MAX_MODES 20 -#define MAX_ERROR_BINS 1024 - -/* motion search site */ -typedef struct -{ - MV mv; - int offset; -} search_site; - -typedef struct block -{ - /* 16 Y blocks, 4 U blocks, 4 V blocks each with 16 entries */ - short *src_diff; - short *coeff; - - /* 16 Y blocks, 4 U blocks, 4 V blocks each with 16 entries */ - short *quant; - short *quant_fast; - short *quant_shift; - short *zbin; - short *zrun_zbin_boost; - short *round; - - /* Zbin Over Quant value */ - short zbin_extra; - - unsigned char **base_src; - int src; - int src_stride; -} BLOCK; - -typedef struct -{ - int count; - struct - { - B_PREDICTION_MODE mode; - int_mv mv; - } bmi[16]; -} PARTITION_INFO; - -typedef struct macroblock -{ - DECLARE_ALIGNED(16, short, src_diff[400]); /* 25 blocks Y,U,V,Y2 */ - DECLARE_ALIGNED(16, short, coeff[400]); /* 25 blocks Y,U,V,Y2 */ - DECLARE_ALIGNED(16, unsigned char, thismb[256]); - - unsigned char *thismb_ptr; - /* 16 Y, 4 U, 4 V, 1 DC 2nd order block */ - BLOCK block[25]; - - YV12_BUFFER_CONFIG src; - - MACROBLOCKD e_mbd; - PARTITION_INFO *partition_info; /* work pointer */ - PARTITION_INFO *pi; /* Corresponds to upper left visible macroblock */ - PARTITION_INFO *pip; /* Base of allocated array */ - - int ref_frame_cost[MAX_REF_FRAMES]; - - search_site *ss; - int ss_count; - int searches_per_step; - - int errorperbit; - int sadperbit16; - int sadperbit4; - int rddiv; - int rdmult; - unsigned int * mb_activity_ptr; - int * mb_norm_activity_ptr; - signed int act_zbin_adj; - signed int last_act_zbin_adj; - - int *mvcost[2]; - int *mvsadcost[2]; - int (*mbmode_cost)[MB_MODE_COUNT]; - int (*intra_uv_mode_cost)[MB_MODE_COUNT]; - int (*bmode_costs)[10][10]; - int *inter_bmode_costs; - int (*token_costs)[COEF_BANDS][PREV_COEF_CONTEXTS] - [MAX_ENTROPY_TOKENS]; - - /* These define limits to motion vector components to prevent - * them from extending outside the UMV borders. - */ - int mv_col_min; - int mv_col_max; - int mv_row_min; - int mv_row_max; - - int skip; - - unsigned int encode_breakout; - - signed char *gf_active_ptr; - - unsigned char *active_ptr; - MV_CONTEXT *mvc; - - int optimize; - int q_index; - int is_skin; - int denoise_zeromv; - -#if CONFIG_TEMPORAL_DENOISING - int increase_denoising; - MB_PREDICTION_MODE best_sse_inter_mode; - int_mv best_sse_mv; - MV_REFERENCE_FRAME best_reference_frame; - MV_REFERENCE_FRAME best_zeromv_reference_frame; - unsigned char need_to_clamp_best_mvs; -#endif - - int skip_true_count; - unsigned int coef_counts [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS]; - unsigned int MVcount [2] [MVvals]; /* (row,col) MV cts this frame */ - int ymode_count [VP8_YMODES]; /* intra MB type cts this frame */ - int uv_mode_count[VP8_UV_MODES]; /* intra MB type cts this frame */ - int64_t prediction_error; - int64_t intra_error; - int count_mb_ref_frame_usage[MAX_REF_FRAMES]; - - int rd_thresh_mult[MAX_MODES]; - int rd_threshes[MAX_MODES]; - unsigned int mbs_tested_so_far; - unsigned int mode_test_hit_counts[MAX_MODES]; - int zbin_mode_boost_enabled; - int zbin_mode_boost; - int last_zbin_mode_boost; - - int last_zbin_over_quant; - int zbin_over_quant; - int error_bins[MAX_ERROR_BINS]; - - void (*short_fdct4x4)(short *input, short *output, int pitch); - void (*short_fdct8x4)(short *input, short *output, int pitch); - void (*short_walsh4x4)(short *input, short *output, int pitch); - void (*quantize_b)(BLOCK *b, BLOCKD *d); - - unsigned int mbs_zero_last_dot_suppress; - int zero_last_dot_suppress; -} MACROBLOCK; - - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_BLOCK_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/boolhuff.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/boolhuff.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/boolhuff.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/boolhuff.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "boolhuff.h" - -#if defined(SECTIONBITS_OUTPUT) -unsigned __int64 Sectionbits[500]; - -#endif - -#ifdef VP8_ENTROPY_STATS -unsigned int active_section = 0; -#endif - -const unsigned int vp8_prob_cost[256] = -{ - 2047, 2047, 1791, 1641, 1535, 1452, 1385, 1328, 1279, 1235, 1196, 1161, 1129, 1099, 1072, 1046, - 1023, 1000, 979, 959, 940, 922, 905, 889, 873, 858, 843, 829, 816, 803, 790, 778, - 767, 755, 744, 733, 723, 713, 703, 693, 684, 675, 666, 657, 649, 641, 633, 625, - 617, 609, 602, 594, 587, 580, 573, 567, 560, 553, 547, 541, 534, 528, 522, 516, - 511, 505, 499, 494, 488, 483, 477, 472, 467, 462, 457, 452, 447, 442, 437, 433, - 428, 424, 419, 415, 410, 406, 401, 397, 393, 389, 385, 381, 377, 373, 369, 365, - 361, 357, 353, 349, 346, 342, 338, 335, 331, 328, 324, 321, 317, 314, 311, 307, - 304, 301, 297, 294, 291, 288, 285, 281, 278, 275, 272, 269, 266, 263, 260, 257, - 255, 252, 249, 246, 243, 240, 238, 235, 232, 229, 227, 224, 221, 219, 216, 214, - 211, 208, 206, 203, 201, 198, 196, 194, 191, 189, 186, 184, 181, 179, 177, 174, - 172, 170, 168, 165, 163, 161, 159, 156, 154, 152, 150, 148, 145, 143, 141, 139, - 137, 135, 133, 131, 129, 127, 125, 123, 121, 119, 117, 115, 113, 111, 109, 107, - 105, 103, 101, 99, 97, 95, 93, 92, 90, 88, 86, 84, 82, 81, 79, 77, - 75, 73, 72, 70, 68, 66, 65, 63, 61, 60, 58, 56, 55, 53, 51, 50, - 48, 46, 45, 43, 41, 40, 38, 37, 35, 33, 32, 30, 29, 27, 25, 24, - 22, 21, 19, 18, 16, 15, 13, 12, 10, 9, 7, 6, 4, 3, 1, 1 -}; - -void vp8_start_encode(BOOL_CODER *br, unsigned char *source, unsigned char *source_end) -{ - - br->lowvalue = 0; - br->range = 255; - br->count = -24; - br->buffer = source; - br->buffer_end = source_end; - br->pos = 0; -} - -void vp8_stop_encode(BOOL_CODER *br) -{ - int i; - - for (i = 0; i < 32; i++) - vp8_encode_bool(br, 0, 128); -} - - -void vp8_encode_value(BOOL_CODER *br, int data, int bits) -{ - int bit; - - for (bit = bits - 1; bit >= 0; bit--) - vp8_encode_bool(br, (1 & (data >> bit)), 0x80); - -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/boolhuff.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/boolhuff.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/boolhuff.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/boolhuff.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/**************************************************************************** -* -* Module Title : boolhuff.h -* -* Description : Bool Coder header file. -* -****************************************************************************/ -#ifndef VP8_ENCODER_BOOLHUFF_H_ -#define VP8_ENCODER_BOOLHUFF_H_ - -#include "vpx_ports/mem.h" -#include "vpx/internal/vpx_codec_internal.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct -{ - unsigned int lowvalue; - unsigned int range; - int count; - unsigned int pos; - unsigned char *buffer; - unsigned char *buffer_end; - struct vpx_internal_error_info *error; -} BOOL_CODER; - -extern void vp8_start_encode(BOOL_CODER *bc, unsigned char *buffer, unsigned char *buffer_end); - -extern void vp8_encode_value(BOOL_CODER *br, int data, int bits); -extern void vp8_stop_encode(BOOL_CODER *bc); -extern const unsigned int vp8_prob_cost[256]; - - -DECLARE_ALIGNED(16, extern const unsigned char, vp8_norm[256]); - -static int validate_buffer(const unsigned char *start, - size_t len, - const unsigned char *end, - struct vpx_internal_error_info *error) -{ - if (start + len > start && start + len < end) - return 1; - else - vpx_internal_error(error, VPX_CODEC_CORRUPT_FRAME, - "Truncated packet or corrupt partition "); - - return 0; -} -static void vp8_encode_bool(BOOL_CODER *br, int bit, int probability) -{ - unsigned int split; - int count = br->count; - unsigned int range = br->range; - unsigned int lowvalue = br->lowvalue; - register unsigned int shift; - -#ifdef VP8_ENTROPY_STATS -#if defined(SECTIONBITS_OUTPUT) - - if (bit) - Sectionbits[active_section] += vp8_prob_cost[255-probability]; - else - Sectionbits[active_section] += vp8_prob_cost[probability]; - -#endif -#endif - - split = 1 + (((range - 1) * probability) >> 8); - - range = split; - - if (bit) - { - lowvalue += split; - range = br->range - split; - } - - shift = vp8_norm[range]; - - range <<= shift; - count += shift; - - if (count >= 0) - { - int offset = shift - count; - - if ((lowvalue << (offset - 1)) & 0x80000000) - { - int x = br->pos - 1; - - while (x >= 0 && br->buffer[x] == 0xff) - { - br->buffer[x] = (unsigned char)0; - x--; - } - - br->buffer[x] += 1; - } - - validate_buffer(br->buffer + br->pos, 1, br->buffer_end, br->error); - br->buffer[br->pos++] = (lowvalue >> (24 - offset)); - - lowvalue <<= offset; - shift = count; - lowvalue &= 0xffffff; - count -= 8 ; - } - - lowvalue <<= shift; - br->count = count; - br->lowvalue = lowvalue; - br->range = range; -} - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_BOOLHUFF_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/dct.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/dct.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/dct.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/dct.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include - -void vp8_short_fdct4x4_c(short *input, short *output, int pitch) -{ - int i; - int a1, b1, c1, d1; - short *ip = input; - short *op = output; - - for (i = 0; i < 4; i++) - { - a1 = ((ip[0] + ip[3]) * 8); - b1 = ((ip[1] + ip[2]) * 8); - c1 = ((ip[1] - ip[2]) * 8); - d1 = ((ip[0] - ip[3]) * 8); - - op[0] = a1 + b1; - op[2] = a1 - b1; - - op[1] = (c1 * 2217 + d1 * 5352 + 14500)>>12; - op[3] = (d1 * 2217 - c1 * 5352 + 7500)>>12; - - ip += pitch / 2; - op += 4; - - } - ip = output; - op = output; - for (i = 0; i < 4; i++) - { - a1 = ip[0] + ip[12]; - b1 = ip[4] + ip[8]; - c1 = ip[4] - ip[8]; - d1 = ip[0] - ip[12]; - - op[0] = ( a1 + b1 + 7)>>4; - op[8] = ( a1 - b1 + 7)>>4; - - op[4] =((c1 * 2217 + d1 * 5352 + 12000)>>16) + (d1!=0); - op[12] = (d1 * 2217 - c1 * 5352 + 51000)>>16; - - ip++; - op++; - } -} - -void vp8_short_fdct8x4_c(short *input, short *output, int pitch) -{ - vp8_short_fdct4x4_c(input, output, pitch); - vp8_short_fdct4x4_c(input + 4, output + 16, pitch); -} - -void vp8_short_walsh4x4_c(short *input, short *output, int pitch) -{ - int i; - int a1, b1, c1, d1; - int a2, b2, c2, d2; - short *ip = input; - short *op = output; - - - for (i = 0; i < 4; i++) - { - a1 = ((ip[0] + ip[2]) * 4); - d1 = ((ip[1] + ip[3]) * 4); - c1 = ((ip[1] - ip[3]) * 4); - b1 = ((ip[0] - ip[2]) * 4); - - op[0] = a1 + d1 + (a1!=0); - op[1] = b1 + c1; - op[2] = b1 - c1; - op[3] = a1 - d1; - ip += pitch / 2; - op += 4; - } - - ip = output; - op = output; - - for (i = 0; i < 4; i++) - { - a1 = ip[0] + ip[8]; - d1 = ip[4] + ip[12]; - c1 = ip[4] - ip[12]; - b1 = ip[0] - ip[8]; - - a2 = a1 + d1; - b2 = b1 + c1; - c2 = b1 - c1; - d2 = a1 - d1; - - a2 += a2<0; - b2 += b2<0; - c2 += c2<0; - d2 += d2<0; - - op[0] = (a2+3) >> 3; - op[4] = (b2+3) >> 3; - op[8] = (c2+3) >> 3; - op[12]= (d2+3) >> 3; - - ip++; - op++; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/dct_value_cost.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/dct_value_cost.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/dct_value_cost.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/dct_value_cost.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,371 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP8_ENCODER_DCT_VALUE_COST_H_ -#define VP8_ENCODER_DCT_VALUE_COST_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Generated file, included by tokenize.c */ -/* Values generated by fill_value_tokens() */ - -static const short dct_value_cost[2048*2] = -{ - 8285, 8277, 8267, 8259, 8253, 8245, 8226, 8218, 8212, 8204, 8194, 8186, - 8180, 8172, 8150, 8142, 8136, 8128, 8118, 8110, 8104, 8096, 8077, 8069, - 8063, 8055, 8045, 8037, 8031, 8023, 7997, 7989, 7983, 7975, 7965, 7957, - 7951, 7943, 7924, 7916, 7910, 7902, 7892, 7884, 7878, 7870, 7848, 7840, - 7834, 7826, 7816, 7808, 7802, 7794, 7775, 7767, 7761, 7753, 7743, 7735, - 7729, 7721, 7923, 7915, 7909, 7901, 7891, 7883, 7877, 7869, 7850, 7842, - 7836, 7828, 7818, 7810, 7804, 7796, 7774, 7766, 7760, 7752, 7742, 7734, - 7728, 7720, 7701, 7693, 7687, 7679, 7669, 7661, 7655, 7647, 7621, 7613, - 7607, 7599, 7589, 7581, 7575, 7567, 7548, 7540, 7534, 7526, 7516, 7508, - 7502, 7494, 7472, 7464, 7458, 7450, 7440, 7432, 7426, 7418, 7399, 7391, - 7385, 7377, 7367, 7359, 7353, 7345, 7479, 7471, 7465, 7457, 7447, 7439, - 7433, 7425, 7406, 7398, 7392, 7384, 7374, 7366, 7360, 7352, 7330, 7322, - 7316, 7308, 7298, 7290, 7284, 7276, 7257, 7249, 7243, 7235, 7225, 7217, - 7211, 7203, 7177, 7169, 7163, 7155, 7145, 7137, 7131, 7123, 7104, 7096, - 7090, 7082, 7072, 7064, 7058, 7050, 7028, 7020, 7014, 7006, 6996, 6988, - 6982, 6974, 6955, 6947, 6941, 6933, 6923, 6915, 6909, 6901, 7632, 7624, - 7618, 7610, 7600, 7592, 7586, 7578, 7559, 7551, 7545, 7537, 7527, 7519, - 7513, 7505, 7483, 7475, 7469, 7461, 7451, 7443, 7437, 7429, 7410, 7402, - 7396, 7388, 7378, 7370, 7364, 7356, 7330, 7322, 7316, 7308, 7298, 7290, - 7284, 7276, 7257, 7249, 7243, 7235, 7225, 7217, 7211, 7203, 7181, 7173, - 7167, 7159, 7149, 7141, 7135, 7127, 7108, 7100, 7094, 7086, 7076, 7068, - 7062, 7054, 7188, 7180, 7174, 7166, 7156, 7148, 7142, 7134, 7115, 7107, - 7101, 7093, 7083, 7075, 7069, 7061, 7039, 7031, 7025, 7017, 7007, 6999, - 6993, 6985, 6966, 6958, 6952, 6944, 6934, 6926, 6920, 6912, 6886, 6878, - 6872, 6864, 6854, 6846, 6840, 6832, 6813, 6805, 6799, 6791, 6781, 6773, - 6767, 6759, 6737, 6729, 6723, 6715, 6705, 6697, 6691, 6683, 6664, 6656, - 6650, 6642, 6632, 6624, 6618, 6610, 6812, 6804, 6798, 6790, 6780, 6772, - 6766, 6758, 6739, 6731, 6725, 6717, 6707, 6699, 6693, 6685, 6663, 6655, - 6649, 6641, 6631, 6623, 6617, 6609, 6590, 6582, 6576, 6568, 6558, 6550, - 6544, 6536, 6510, 6502, 6496, 6488, 6478, 6470, 6464, 6456, 6437, 6429, - 6423, 6415, 6405, 6397, 6391, 6383, 6361, 6353, 6347, 6339, 6329, 6321, - 6315, 6307, 6288, 6280, 6274, 6266, 6256, 6248, 6242, 6234, 6368, 6360, - 6354, 6346, 6336, 6328, 6322, 6314, 6295, 6287, 6281, 6273, 6263, 6255, - 6249, 6241, 6219, 6211, 6205, 6197, 6187, 6179, 6173, 6165, 6146, 6138, - 6132, 6124, 6114, 6106, 6100, 6092, 6066, 6058, 6052, 6044, 6034, 6026, - 6020, 6012, 5993, 5985, 5979, 5971, 5961, 5953, 5947, 5939, 5917, 5909, - 5903, 5895, 5885, 5877, 5871, 5863, 5844, 5836, 5830, 5822, 5812, 5804, - 5798, 5790, 6697, 6689, 6683, 6675, 6665, 6657, 6651, 6643, 6624, 6616, - 6610, 6602, 6592, 6584, 6578, 6570, 6548, 6540, 6534, 6526, 6516, 6508, - 6502, 6494, 6475, 6467, 6461, 6453, 6443, 6435, 6429, 6421, 6395, 6387, - 6381, 6373, 6363, 6355, 6349, 6341, 6322, 6314, 6308, 6300, 6290, 6282, - 6276, 6268, 6246, 6238, 6232, 6224, 6214, 6206, 6200, 6192, 6173, 6165, - 6159, 6151, 6141, 6133, 6127, 6119, 6253, 6245, 6239, 6231, 6221, 6213, - 6207, 6199, 6180, 6172, 6166, 6158, 6148, 6140, 6134, 6126, 6104, 6096, - 6090, 6082, 6072, 6064, 6058, 6050, 6031, 6023, 6017, 6009, 5999, 5991, - 5985, 5977, 5951, 5943, 5937, 5929, 5919, 5911, 5905, 5897, 5878, 5870, - 5864, 5856, 5846, 5838, 5832, 5824, 5802, 5794, 5788, 5780, 5770, 5762, - 5756, 5748, 5729, 5721, 5715, 5707, 5697, 5689, 5683, 5675, 5877, 5869, - 5863, 5855, 5845, 5837, 5831, 5823, 5804, 5796, 5790, 5782, 5772, 5764, - 5758, 5750, 5728, 5720, 5714, 5706, 5696, 5688, 5682, 5674, 5655, 5647, - 5641, 5633, 5623, 5615, 5609, 5601, 5575, 5567, 5561, 5553, 5543, 5535, - 5529, 5521, 5502, 5494, 5488, 5480, 5470, 5462, 5456, 5448, 5426, 5418, - 5412, 5404, 5394, 5386, 5380, 5372, 5353, 5345, 5339, 5331, 5321, 5313, - 5307, 5299, 5433, 5425, 5419, 5411, 5401, 5393, 5387, 5379, 5360, 5352, - 5346, 5338, 5328, 5320, 5314, 5306, 5284, 5276, 5270, 5262, 5252, 5244, - 5238, 5230, 5211, 5203, 5197, 5189, 5179, 5171, 5165, 5157, 5131, 5123, - 5117, 5109, 5099, 5091, 5085, 5077, 5058, 5050, 5044, 5036, 5026, 5018, - 5012, 5004, 4982, 4974, 4968, 4960, 4950, 4942, 4936, 4928, 4909, 4901, - 4895, 4887, 4877, 4869, 4863, 4855, 5586, 5578, 5572, 5564, 5554, 5546, - 5540, 5532, 5513, 5505, 5499, 5491, 5481, 5473, 5467, 5459, 5437, 5429, - 5423, 5415, 5405, 5397, 5391, 5383, 5364, 5356, 5350, 5342, 5332, 5324, - 5318, 5310, 5284, 5276, 5270, 5262, 5252, 5244, 5238, 5230, 5211, 5203, - 5197, 5189, 5179, 5171, 5165, 5157, 5135, 5127, 5121, 5113, 5103, 5095, - 5089, 5081, 5062, 5054, 5048, 5040, 5030, 5022, 5016, 5008, 5142, 5134, - 5128, 5120, 5110, 5102, 5096, 5088, 5069, 5061, 5055, 5047, 5037, 5029, - 5023, 5015, 4993, 4985, 4979, 4971, 4961, 4953, 4947, 4939, 4920, 4912, - 4906, 4898, 4888, 4880, 4874, 4866, 4840, 4832, 4826, 4818, 4808, 4800, - 4794, 4786, 4767, 4759, 4753, 4745, 4735, 4727, 4721, 4713, 4691, 4683, - 4677, 4669, 4659, 4651, 4645, 4637, 4618, 4610, 4604, 4596, 4586, 4578, - 4572, 4564, 4766, 4758, 4752, 4744, 4734, 4726, 4720, 4712, 4693, 4685, - 4679, 4671, 4661, 4653, 4647, 4639, 4617, 4609, 4603, 4595, 4585, 4577, - 4571, 4563, 4544, 4536, 4530, 4522, 4512, 4504, 4498, 4490, 4464, 4456, - 4450, 4442, 4432, 4424, 4418, 4410, 4391, 4383, 4377, 4369, 4359, 4351, - 4345, 4337, 4315, 4307, 4301, 4293, 4283, 4275, 4269, 4261, 4242, 4234, - 4228, 4220, 4210, 4202, 4196, 4188, 4322, 4314, 4308, 4300, 4290, 4282, - 4276, 4268, 4249, 4241, 4235, 4227, 4217, 4209, 4203, 4195, 4173, 4165, - 4159, 4151, 4141, 4133, 4127, 4119, 4100, 4092, 4086, 4078, 4068, 4060, - 4054, 4046, 4020, 4012, 4006, 3998, 3988, 3980, 3974, 3966, 3947, 3939, - 3933, 3925, 3915, 3907, 3901, 3893, 3871, 3863, 3857, 3849, 3839, 3831, - 3825, 3817, 3798, 3790, 3784, 3776, 3766, 3758, 3752, 3744, 6697, 6689, - 6683, 6675, 6665, 6657, 6651, 6643, 6624, 6616, 6610, 6602, 6592, 6584, - 6578, 6570, 6548, 6540, 6534, 6526, 6516, 6508, 6502, 6494, 6475, 6467, - 6461, 6453, 6443, 6435, 6429, 6421, 6395, 6387, 6381, 6373, 6363, 6355, - 6349, 6341, 6322, 6314, 6308, 6300, 6290, 6282, 6276, 6268, 6246, 6238, - 6232, 6224, 6214, 6206, 6200, 6192, 6173, 6165, 6159, 6151, 6141, 6133, - 6127, 6119, 6253, 6245, 6239, 6231, 6221, 6213, 6207, 6199, 6180, 6172, - 6166, 6158, 6148, 6140, 6134, 6126, 6104, 6096, 6090, 6082, 6072, 6064, - 6058, 6050, 6031, 6023, 6017, 6009, 5999, 5991, 5985, 5977, 5951, 5943, - 5937, 5929, 5919, 5911, 5905, 5897, 5878, 5870, 5864, 5856, 5846, 5838, - 5832, 5824, 5802, 5794, 5788, 5780, 5770, 5762, 5756, 5748, 5729, 5721, - 5715, 5707, 5697, 5689, 5683, 5675, 5877, 5869, 5863, 5855, 5845, 5837, - 5831, 5823, 5804, 5796, 5790, 5782, 5772, 5764, 5758, 5750, 5728, 5720, - 5714, 5706, 5696, 5688, 5682, 5674, 5655, 5647, 5641, 5633, 5623, 5615, - 5609, 5601, 5575, 5567, 5561, 5553, 5543, 5535, 5529, 5521, 5502, 5494, - 5488, 5480, 5470, 5462, 5456, 5448, 5426, 5418, 5412, 5404, 5394, 5386, - 5380, 5372, 5353, 5345, 5339, 5331, 5321, 5313, 5307, 5299, 5433, 5425, - 5419, 5411, 5401, 5393, 5387, 5379, 5360, 5352, 5346, 5338, 5328, 5320, - 5314, 5306, 5284, 5276, 5270, 5262, 5252, 5244, 5238, 5230, 5211, 5203, - 5197, 5189, 5179, 5171, 5165, 5157, 5131, 5123, 5117, 5109, 5099, 5091, - 5085, 5077, 5058, 5050, 5044, 5036, 5026, 5018, 5012, 5004, 4982, 4974, - 4968, 4960, 4950, 4942, 4936, 4928, 4909, 4901, 4895, 4887, 4877, 4869, - 4863, 4855, 5586, 5578, 5572, 5564, 5554, 5546, 5540, 5532, 5513, 5505, - 5499, 5491, 5481, 5473, 5467, 5459, 5437, 5429, 5423, 5415, 5405, 5397, - 5391, 5383, 5364, 5356, 5350, 5342, 5332, 5324, 5318, 5310, 5284, 5276, - 5270, 5262, 5252, 5244, 5238, 5230, 5211, 5203, 5197, 5189, 5179, 5171, - 5165, 5157, 5135, 5127, 5121, 5113, 5103, 5095, 5089, 5081, 5062, 5054, - 5048, 5040, 5030, 5022, 5016, 5008, 5142, 5134, 5128, 5120, 5110, 5102, - 5096, 5088, 5069, 5061, 5055, 5047, 5037, 5029, 5023, 5015, 4993, 4985, - 4979, 4971, 4961, 4953, 4947, 4939, 4920, 4912, 4906, 4898, 4888, 4880, - 4874, 4866, 4840, 4832, 4826, 4818, 4808, 4800, 4794, 4786, 4767, 4759, - 4753, 4745, 4735, 4727, 4721, 4713, 4691, 4683, 4677, 4669, 4659, 4651, - 4645, 4637, 4618, 4610, 4604, 4596, 4586, 4578, 4572, 4564, 4766, 4758, - 4752, 4744, 4734, 4726, 4720, 4712, 4693, 4685, 4679, 4671, 4661, 4653, - 4647, 4639, 4617, 4609, 4603, 4595, 4585, 4577, 4571, 4563, 4544, 4536, - 4530, 4522, 4512, 4504, 4498, 4490, 4464, 4456, 4450, 4442, 4432, 4424, - 4418, 4410, 4391, 4383, 4377, 4369, 4359, 4351, 4345, 4337, 4315, 4307, - 4301, 4293, 4283, 4275, 4269, 4261, 4242, 4234, 4228, 4220, 4210, 4202, - 4196, 4188, 4322, 4314, 4308, 4300, 4290, 4282, 4276, 4268, 4249, 4241, - 4235, 4227, 4217, 4209, 4203, 4195, 4173, 4165, 4159, 4151, 4141, 4133, - 4127, 4119, 4100, 4092, 4086, 4078, 4068, 4060, 4054, 4046, 4020, 4012, - 4006, 3998, 3988, 3980, 3974, 3966, 3947, 3939, 3933, 3925, 3915, 3907, - 3901, 3893, 3871, 3863, 3857, 3849, 3839, 3831, 3825, 3817, 3798, 3790, - 3784, 3776, 3766, 3758, 3752, 3744, 4651, 4643, 4637, 4629, 4619, 4611, - 4605, 4597, 4578, 4570, 4564, 4556, 4546, 4538, 4532, 4524, 4502, 4494, - 4488, 4480, 4470, 4462, 4456, 4448, 4429, 4421, 4415, 4407, 4397, 4389, - 4383, 4375, 4349, 4341, 4335, 4327, 4317, 4309, 4303, 4295, 4276, 4268, - 4262, 4254, 4244, 4236, 4230, 4222, 4200, 4192, 4186, 4178, 4168, 4160, - 4154, 4146, 4127, 4119, 4113, 4105, 4095, 4087, 4081, 4073, 4207, 4199, - 4193, 4185, 4175, 4167, 4161, 4153, 4134, 4126, 4120, 4112, 4102, 4094, - 4088, 4080, 4058, 4050, 4044, 4036, 4026, 4018, 4012, 4004, 3985, 3977, - 3971, 3963, 3953, 3945, 3939, 3931, 3905, 3897, 3891, 3883, 3873, 3865, - 3859, 3851, 3832, 3824, 3818, 3810, 3800, 3792, 3786, 3778, 3756, 3748, - 3742, 3734, 3724, 3716, 3710, 3702, 3683, 3675, 3669, 3661, 3651, 3643, - 3637, 3629, 3831, 3823, 3817, 3809, 3799, 3791, 3785, 3777, 3758, 3750, - 3744, 3736, 3726, 3718, 3712, 3704, 3682, 3674, 3668, 3660, 3650, 3642, - 3636, 3628, 3609, 3601, 3595, 3587, 3577, 3569, 3563, 3555, 3529, 3521, - 3515, 3507, 3497, 3489, 3483, 3475, 3456, 3448, 3442, 3434, 3424, 3416, - 3410, 3402, 3380, 3372, 3366, 3358, 3348, 3340, 3334, 3326, 3307, 3299, - 3293, 3285, 3275, 3267, 3261, 3253, 3387, 3379, 3373, 3365, 3355, 3347, - 3341, 3333, 3314, 3306, 3300, 3292, 3282, 3274, 3268, 3260, 3238, 3230, - 3224, 3216, 3206, 3198, 3192, 3184, 3165, 3157, 3151, 3143, 3133, 3125, - 3119, 3111, 3085, 3077, 3071, 3063, 3053, 3045, 3039, 3031, 3012, 3004, - 2998, 2990, 2980, 2972, 2966, 2958, 2936, 2928, 2922, 2914, 2904, 2896, - 2890, 2882, 2863, 2855, 2849, 2841, 2831, 2823, 2817, 2809, 3540, 3532, - 3526, 3518, 3508, 3500, 3494, 3486, 3467, 3459, 3453, 3445, 3435, 3427, - 3421, 3413, 3391, 3383, 3377, 3369, 3359, 3351, 3345, 3337, 3318, 3310, - 3304, 3296, 3286, 3278, 3272, 3264, 3238, 3230, 3224, 3216, 3206, 3198, - 3192, 3184, 3165, 3157, 3151, 3143, 3133, 3125, 3119, 3111, 3089, 3081, - 3075, 3067, 3057, 3049, 3043, 3035, 3016, 3008, 3002, 2994, 2984, 2976, - 2970, 2962, 3096, 3088, 3082, 3074, 3064, 3056, 3050, 3042, 3023, 3015, - 3009, 3001, 2991, 2983, 2977, 2969, 2947, 2939, 2933, 2925, 2915, 2907, - 2901, 2893, 2874, 2866, 2860, 2852, 2842, 2834, 2828, 2820, 2794, 2786, - 2780, 2772, 2762, 2754, 2748, 2740, 2721, 2713, 2707, 2699, 2689, 2681, - 2675, 2667, 2645, 2637, 2631, 2623, 2613, 2605, 2599, 2591, 2572, 2564, - 2558, 2550, 2540, 2532, 2526, 2518, 2720, 2712, 2706, 2698, 2688, 2680, - 2674, 2666, 2647, 2639, 2633, 2625, 2615, 2607, 2601, 2593, 2571, 2563, - 2557, 2549, 2539, 2531, 2525, 2517, 2498, 2490, 2484, 2476, 2466, 2458, - 2452, 2444, 2418, 2410, 2404, 2396, 2386, 2378, 2372, 2364, 2345, 2337, - 2331, 2323, 2313, 2305, 2299, 2291, 2269, 2261, 2255, 2247, 2237, 2229, - 2223, 2215, 2196, 2188, 2182, 2174, 2164, 2156, 2150, 2142, 2276, 2268, - 2262, 2254, 2244, 2236, 2230, 2222, 2203, 2195, 2189, 2181, 2171, 2163, - 2157, 2149, 2127, 2119, 2113, 2105, 2095, 2087, 2081, 2073, 2054, 2046, - 2040, 2032, 2022, 2014, 2008, 2000, 1974, 1966, 1960, 1952, 1942, 1934, - 1928, 1920, 1901, 1893, 1887, 1879, 1869, 1861, 1855, 1847, 1825, 1817, - 1811, 1803, 1793, 1785, 1779, 1771, 1752, 1744, 1738, 1730, 1720, 1712, - 1706, 1698, 1897, 1883, 1860, 1846, 1819, 1805, 1782, 1768, 1723, 1709, - 1686, 1672, 1645, 1631, 1608, 1594, 1574, 1560, 1537, 1523, 1496, 1482, - 1459, 1445, 1400, 1386, 1363, 1349, 1322, 1308, 1285, 1271, 1608, 1565, - 1535, 1492, 1446, 1403, 1373, 1330, 1312, 1269, 1239, 1196, 1150, 1107, - 1077, 1034, 1291, 1218, 1171, 1098, 1015, 942, 895, 822, 953, 850, - 729, 626, 618, 431, 257, 257, 257, 257, 0, 255, 255, 255, - 255, 429, 616, 624, 727, 848, 951, 820, 893, 940, 1013, 1096, - 1169, 1216, 1289, 1032, 1075, 1105, 1148, 1194, 1237, 1267, 1310, 1328, - 1371, 1401, 1444, 1490, 1533, 1563, 1606, 1269, 1283, 1306, 1320, 1347, - 1361, 1384, 1398, 1443, 1457, 1480, 1494, 1521, 1535, 1558, 1572, 1592, - 1606, 1629, 1643, 1670, 1684, 1707, 1721, 1766, 1780, 1803, 1817, 1844, - 1858, 1881, 1895, 1696, 1704, 1710, 1718, 1728, 1736, 1742, 1750, 1769, - 1777, 1783, 1791, 1801, 1809, 1815, 1823, 1845, 1853, 1859, 1867, 1877, - 1885, 1891, 1899, 1918, 1926, 1932, 1940, 1950, 1958, 1964, 1972, 1998, - 2006, 2012, 2020, 2030, 2038, 2044, 2052, 2071, 2079, 2085, 2093, 2103, - 2111, 2117, 2125, 2147, 2155, 2161, 2169, 2179, 2187, 2193, 2201, 2220, - 2228, 2234, 2242, 2252, 2260, 2266, 2274, 2140, 2148, 2154, 2162, 2172, - 2180, 2186, 2194, 2213, 2221, 2227, 2235, 2245, 2253, 2259, 2267, 2289, - 2297, 2303, 2311, 2321, 2329, 2335, 2343, 2362, 2370, 2376, 2384, 2394, - 2402, 2408, 2416, 2442, 2450, 2456, 2464, 2474, 2482, 2488, 2496, 2515, - 2523, 2529, 2537, 2547, 2555, 2561, 2569, 2591, 2599, 2605, 2613, 2623, - 2631, 2637, 2645, 2664, 2672, 2678, 2686, 2696, 2704, 2710, 2718, 2516, - 2524, 2530, 2538, 2548, 2556, 2562, 2570, 2589, 2597, 2603, 2611, 2621, - 2629, 2635, 2643, 2665, 2673, 2679, 2687, 2697, 2705, 2711, 2719, 2738, - 2746, 2752, 2760, 2770, 2778, 2784, 2792, 2818, 2826, 2832, 2840, 2850, - 2858, 2864, 2872, 2891, 2899, 2905, 2913, 2923, 2931, 2937, 2945, 2967, - 2975, 2981, 2989, 2999, 3007, 3013, 3021, 3040, 3048, 3054, 3062, 3072, - 3080, 3086, 3094, 2960, 2968, 2974, 2982, 2992, 3000, 3006, 3014, 3033, - 3041, 3047, 3055, 3065, 3073, 3079, 3087, 3109, 3117, 3123, 3131, 3141, - 3149, 3155, 3163, 3182, 3190, 3196, 3204, 3214, 3222, 3228, 3236, 3262, - 3270, 3276, 3284, 3294, 3302, 3308, 3316, 3335, 3343, 3349, 3357, 3367, - 3375, 3381, 3389, 3411, 3419, 3425, 3433, 3443, 3451, 3457, 3465, 3484, - 3492, 3498, 3506, 3516, 3524, 3530, 3538, 2807, 2815, 2821, 2829, 2839, - 2847, 2853, 2861, 2880, 2888, 2894, 2902, 2912, 2920, 2926, 2934, 2956, - 2964, 2970, 2978, 2988, 2996, 3002, 3010, 3029, 3037, 3043, 3051, 3061, - 3069, 3075, 3083, 3109, 3117, 3123, 3131, 3141, 3149, 3155, 3163, 3182, - 3190, 3196, 3204, 3214, 3222, 3228, 3236, 3258, 3266, 3272, 3280, 3290, - 3298, 3304, 3312, 3331, 3339, 3345, 3353, 3363, 3371, 3377, 3385, 3251, - 3259, 3265, 3273, 3283, 3291, 3297, 3305, 3324, 3332, 3338, 3346, 3356, - 3364, 3370, 3378, 3400, 3408, 3414, 3422, 3432, 3440, 3446, 3454, 3473, - 3481, 3487, 3495, 3505, 3513, 3519, 3527, 3553, 3561, 3567, 3575, 3585, - 3593, 3599, 3607, 3626, 3634, 3640, 3648, 3658, 3666, 3672, 3680, 3702, - 3710, 3716, 3724, 3734, 3742, 3748, 3756, 3775, 3783, 3789, 3797, 3807, - 3815, 3821, 3829, 3627, 3635, 3641, 3649, 3659, 3667, 3673, 3681, 3700, - 3708, 3714, 3722, 3732, 3740, 3746, 3754, 3776, 3784, 3790, 3798, 3808, - 3816, 3822, 3830, 3849, 3857, 3863, 3871, 3881, 3889, 3895, 3903, 3929, - 3937, 3943, 3951, 3961, 3969, 3975, 3983, 4002, 4010, 4016, 4024, 4034, - 4042, 4048, 4056, 4078, 4086, 4092, 4100, 4110, 4118, 4124, 4132, 4151, - 4159, 4165, 4173, 4183, 4191, 4197, 4205, 4071, 4079, 4085, 4093, 4103, - 4111, 4117, 4125, 4144, 4152, 4158, 4166, 4176, 4184, 4190, 4198, 4220, - 4228, 4234, 4242, 4252, 4260, 4266, 4274, 4293, 4301, 4307, 4315, 4325, - 4333, 4339, 4347, 4373, 4381, 4387, 4395, 4405, 4413, 4419, 4427, 4446, - 4454, 4460, 4468, 4478, 4486, 4492, 4500, 4522, 4530, 4536, 4544, 4554, - 4562, 4568, 4576, 4595, 4603, 4609, 4617, 4627, 4635, 4641, 4649, 3742, - 3750, 3756, 3764, 3774, 3782, 3788, 3796, 3815, 3823, 3829, 3837, 3847, - 3855, 3861, 3869, 3891, 3899, 3905, 3913, 3923, 3931, 3937, 3945, 3964, - 3972, 3978, 3986, 3996, 4004, 4010, 4018, 4044, 4052, 4058, 4066, 4076, - 4084, 4090, 4098, 4117, 4125, 4131, 4139, 4149, 4157, 4163, 4171, 4193, - 4201, 4207, 4215, 4225, 4233, 4239, 4247, 4266, 4274, 4280, 4288, 4298, - 4306, 4312, 4320, 4186, 4194, 4200, 4208, 4218, 4226, 4232, 4240, 4259, - 4267, 4273, 4281, 4291, 4299, 4305, 4313, 4335, 4343, 4349, 4357, 4367, - 4375, 4381, 4389, 4408, 4416, 4422, 4430, 4440, 4448, 4454, 4462, 4488, - 4496, 4502, 4510, 4520, 4528, 4534, 4542, 4561, 4569, 4575, 4583, 4593, - 4601, 4607, 4615, 4637, 4645, 4651, 4659, 4669, 4677, 4683, 4691, 4710, - 4718, 4724, 4732, 4742, 4750, 4756, 4764, 4562, 4570, 4576, 4584, 4594, - 4602, 4608, 4616, 4635, 4643, 4649, 4657, 4667, 4675, 4681, 4689, 4711, - 4719, 4725, 4733, 4743, 4751, 4757, 4765, 4784, 4792, 4798, 4806, 4816, - 4824, 4830, 4838, 4864, 4872, 4878, 4886, 4896, 4904, 4910, 4918, 4937, - 4945, 4951, 4959, 4969, 4977, 4983, 4991, 5013, 5021, 5027, 5035, 5045, - 5053, 5059, 5067, 5086, 5094, 5100, 5108, 5118, 5126, 5132, 5140, 5006, - 5014, 5020, 5028, 5038, 5046, 5052, 5060, 5079, 5087, 5093, 5101, 5111, - 5119, 5125, 5133, 5155, 5163, 5169, 5177, 5187, 5195, 5201, 5209, 5228, - 5236, 5242, 5250, 5260, 5268, 5274, 5282, 5308, 5316, 5322, 5330, 5340, - 5348, 5354, 5362, 5381, 5389, 5395, 5403, 5413, 5421, 5427, 5435, 5457, - 5465, 5471, 5479, 5489, 5497, 5503, 5511, 5530, 5538, 5544, 5552, 5562, - 5570, 5576, 5584, 4853, 4861, 4867, 4875, 4885, 4893, 4899, 4907, 4926, - 4934, 4940, 4948, 4958, 4966, 4972, 4980, 5002, 5010, 5016, 5024, 5034, - 5042, 5048, 5056, 5075, 5083, 5089, 5097, 5107, 5115, 5121, 5129, 5155, - 5163, 5169, 5177, 5187, 5195, 5201, 5209, 5228, 5236, 5242, 5250, 5260, - 5268, 5274, 5282, 5304, 5312, 5318, 5326, 5336, 5344, 5350, 5358, 5377, - 5385, 5391, 5399, 5409, 5417, 5423, 5431, 5297, 5305, 5311, 5319, 5329, - 5337, 5343, 5351, 5370, 5378, 5384, 5392, 5402, 5410, 5416, 5424, 5446, - 5454, 5460, 5468, 5478, 5486, 5492, 5500, 5519, 5527, 5533, 5541, 5551, - 5559, 5565, 5573, 5599, 5607, 5613, 5621, 5631, 5639, 5645, 5653, 5672, - 5680, 5686, 5694, 5704, 5712, 5718, 5726, 5748, 5756, 5762, 5770, 5780, - 5788, 5794, 5802, 5821, 5829, 5835, 5843, 5853, 5861, 5867, 5875, 5673, - 5681, 5687, 5695, 5705, 5713, 5719, 5727, 5746, 5754, 5760, 5768, 5778, - 5786, 5792, 5800, 5822, 5830, 5836, 5844, 5854, 5862, 5868, 5876, 5895, - 5903, 5909, 5917, 5927, 5935, 5941, 5949, 5975, 5983, 5989, 5997, 6007, - 6015, 6021, 6029, 6048, 6056, 6062, 6070, 6080, 6088, 6094, 6102, 6124, - 6132, 6138, 6146, 6156, 6164, 6170, 6178, 6197, 6205, 6211, 6219, 6229, - 6237, 6243, 6251, 6117, 6125, 6131, 6139, 6149, 6157, 6163, 6171, 6190, - 6198, 6204, 6212, 6222, 6230, 6236, 6244, 6266, 6274, 6280, 6288, 6298, - 6306, 6312, 6320, 6339, 6347, 6353, 6361, 6371, 6379, 6385, 6393, 6419, - 6427, 6433, 6441, 6451, 6459, 6465, 6473, 6492, 6500, 6506, 6514, 6524, - 6532, 6538, 6546, 6568, 6576, 6582, 6590, 6600, 6608, 6614, 6622, 6641, - 6649, 6655, 6663, 6673, 6681, 6687, 6695, 3742, 3750, 3756, 3764, 3774, - 3782, 3788, 3796, 3815, 3823, 3829, 3837, 3847, 3855, 3861, 3869, 3891, - 3899, 3905, 3913, 3923, 3931, 3937, 3945, 3964, 3972, 3978, 3986, 3996, - 4004, 4010, 4018, 4044, 4052, 4058, 4066, 4076, 4084, 4090, 4098, 4117, - 4125, 4131, 4139, 4149, 4157, 4163, 4171, 4193, 4201, 4207, 4215, 4225, - 4233, 4239, 4247, 4266, 4274, 4280, 4288, 4298, 4306, 4312, 4320, 4186, - 4194, 4200, 4208, 4218, 4226, 4232, 4240, 4259, 4267, 4273, 4281, 4291, - 4299, 4305, 4313, 4335, 4343, 4349, 4357, 4367, 4375, 4381, 4389, 4408, - 4416, 4422, 4430, 4440, 4448, 4454, 4462, 4488, 4496, 4502, 4510, 4520, - 4528, 4534, 4542, 4561, 4569, 4575, 4583, 4593, 4601, 4607, 4615, 4637, - 4645, 4651, 4659, 4669, 4677, 4683, 4691, 4710, 4718, 4724, 4732, 4742, - 4750, 4756, 4764, 4562, 4570, 4576, 4584, 4594, 4602, 4608, 4616, 4635, - 4643, 4649, 4657, 4667, 4675, 4681, 4689, 4711, 4719, 4725, 4733, 4743, - 4751, 4757, 4765, 4784, 4792, 4798, 4806, 4816, 4824, 4830, 4838, 4864, - 4872, 4878, 4886, 4896, 4904, 4910, 4918, 4937, 4945, 4951, 4959, 4969, - 4977, 4983, 4991, 5013, 5021, 5027, 5035, 5045, 5053, 5059, 5067, 5086, - 5094, 5100, 5108, 5118, 5126, 5132, 5140, 5006, 5014, 5020, 5028, 5038, - 5046, 5052, 5060, 5079, 5087, 5093, 5101, 5111, 5119, 5125, 5133, 5155, - 5163, 5169, 5177, 5187, 5195, 5201, 5209, 5228, 5236, 5242, 5250, 5260, - 5268, 5274, 5282, 5308, 5316, 5322, 5330, 5340, 5348, 5354, 5362, 5381, - 5389, 5395, 5403, 5413, 5421, 5427, 5435, 5457, 5465, 5471, 5479, 5489, - 5497, 5503, 5511, 5530, 5538, 5544, 5552, 5562, 5570, 5576, 5584, 4853, - 4861, 4867, 4875, 4885, 4893, 4899, 4907, 4926, 4934, 4940, 4948, 4958, - 4966, 4972, 4980, 5002, 5010, 5016, 5024, 5034, 5042, 5048, 5056, 5075, - 5083, 5089, 5097, 5107, 5115, 5121, 5129, 5155, 5163, 5169, 5177, 5187, - 5195, 5201, 5209, 5228, 5236, 5242, 5250, 5260, 5268, 5274, 5282, 5304, - 5312, 5318, 5326, 5336, 5344, 5350, 5358, 5377, 5385, 5391, 5399, 5409, - 5417, 5423, 5431, 5297, 5305, 5311, 5319, 5329, 5337, 5343, 5351, 5370, - 5378, 5384, 5392, 5402, 5410, 5416, 5424, 5446, 5454, 5460, 5468, 5478, - 5486, 5492, 5500, 5519, 5527, 5533, 5541, 5551, 5559, 5565, 5573, 5599, - 5607, 5613, 5621, 5631, 5639, 5645, 5653, 5672, 5680, 5686, 5694, 5704, - 5712, 5718, 5726, 5748, 5756, 5762, 5770, 5780, 5788, 5794, 5802, 5821, - 5829, 5835, 5843, 5853, 5861, 5867, 5875, 5673, 5681, 5687, 5695, 5705, - 5713, 5719, 5727, 5746, 5754, 5760, 5768, 5778, 5786, 5792, 5800, 5822, - 5830, 5836, 5844, 5854, 5862, 5868, 5876, 5895, 5903, 5909, 5917, 5927, - 5935, 5941, 5949, 5975, 5983, 5989, 5997, 6007, 6015, 6021, 6029, 6048, - 6056, 6062, 6070, 6080, 6088, 6094, 6102, 6124, 6132, 6138, 6146, 6156, - 6164, 6170, 6178, 6197, 6205, 6211, 6219, 6229, 6237, 6243, 6251, 6117, - 6125, 6131, 6139, 6149, 6157, 6163, 6171, 6190, 6198, 6204, 6212, 6222, - 6230, 6236, 6244, 6266, 6274, 6280, 6288, 6298, 6306, 6312, 6320, 6339, - 6347, 6353, 6361, 6371, 6379, 6385, 6393, 6419, 6427, 6433, 6441, 6451, - 6459, 6465, 6473, 6492, 6500, 6506, 6514, 6524, 6532, 6538, 6546, 6568, - 6576, 6582, 6590, 6600, 6608, 6614, 6622, 6641, 6649, 6655, 6663, 6673, - 6681, 6687, 6695, 5788, 5796, 5802, 5810, 5820, 5828, 5834, 5842, 5861, - 5869, 5875, 5883, 5893, 5901, 5907, 5915, 5937, 5945, 5951, 5959, 5969, - 5977, 5983, 5991, 6010, 6018, 6024, 6032, 6042, 6050, 6056, 6064, 6090, - 6098, 6104, 6112, 6122, 6130, 6136, 6144, 6163, 6171, 6177, 6185, 6195, - 6203, 6209, 6217, 6239, 6247, 6253, 6261, 6271, 6279, 6285, 6293, 6312, - 6320, 6326, 6334, 6344, 6352, 6358, 6366, 6232, 6240, 6246, 6254, 6264, - 6272, 6278, 6286, 6305, 6313, 6319, 6327, 6337, 6345, 6351, 6359, 6381, - 6389, 6395, 6403, 6413, 6421, 6427, 6435, 6454, 6462, 6468, 6476, 6486, - 6494, 6500, 6508, 6534, 6542, 6548, 6556, 6566, 6574, 6580, 6588, 6607, - 6615, 6621, 6629, 6639, 6647, 6653, 6661, 6683, 6691, 6697, 6705, 6715, - 6723, 6729, 6737, 6756, 6764, 6770, 6778, 6788, 6796, 6802, 6810, 6608, - 6616, 6622, 6630, 6640, 6648, 6654, 6662, 6681, 6689, 6695, 6703, 6713, - 6721, 6727, 6735, 6757, 6765, 6771, 6779, 6789, 6797, 6803, 6811, 6830, - 6838, 6844, 6852, 6862, 6870, 6876, 6884, 6910, 6918, 6924, 6932, 6942, - 6950, 6956, 6964, 6983, 6991, 6997, 7005, 7015, 7023, 7029, 7037, 7059, - 7067, 7073, 7081, 7091, 7099, 7105, 7113, 7132, 7140, 7146, 7154, 7164, - 7172, 7178, 7186, 7052, 7060, 7066, 7074, 7084, 7092, 7098, 7106, 7125, - 7133, 7139, 7147, 7157, 7165, 7171, 7179, 7201, 7209, 7215, 7223, 7233, - 7241, 7247, 7255, 7274, 7282, 7288, 7296, 7306, 7314, 7320, 7328, 7354, - 7362, 7368, 7376, 7386, 7394, 7400, 7408, 7427, 7435, 7441, 7449, 7459, - 7467, 7473, 7481, 7503, 7511, 7517, 7525, 7535, 7543, 7549, 7557, 7576, - 7584, 7590, 7598, 7608, 7616, 7622, 7630, 6899, 6907, 6913, 6921, 6931, - 6939, 6945, 6953, 6972, 6980, 6986, 6994, 7004, 7012, 7018, 7026, 7048, - 7056, 7062, 7070, 7080, 7088, 7094, 7102, 7121, 7129, 7135, 7143, 7153, - 7161, 7167, 7175, 7201, 7209, 7215, 7223, 7233, 7241, 7247, 7255, 7274, - 7282, 7288, 7296, 7306, 7314, 7320, 7328, 7350, 7358, 7364, 7372, 7382, - 7390, 7396, 7404, 7423, 7431, 7437, 7445, 7455, 7463, 7469, 7477, 7343, - 7351, 7357, 7365, 7375, 7383, 7389, 7397, 7416, 7424, 7430, 7438, 7448, - 7456, 7462, 7470, 7492, 7500, 7506, 7514, 7524, 7532, 7538, 7546, 7565, - 7573, 7579, 7587, 7597, 7605, 7611, 7619, 7645, 7653, 7659, 7667, 7677, - 7685, 7691, 7699, 7718, 7726, 7732, 7740, 7750, 7758, 7764, 7772, 7794, - 7802, 7808, 7816, 7826, 7834, 7840, 7848, 7867, 7875, 7881, 7889, 7899, - 7907, 7913, 7921, 7719, 7727, 7733, 7741, 7751, 7759, 7765, 7773, 7792, - 7800, 7806, 7814, 7824, 7832, 7838, 7846, 7868, 7876, 7882, 7890, 7900, - 7908, 7914, 7922, 7941, 7949, 7955, 7963, 7973, 7981, 7987, 7995, 8021, - 8029, 8035, 8043, 8053, 8061, 8067, 8075, 8094, 8102, 8108, 8116, 8126, - 8134, 8140, 8148, 8170, 8178, 8184, 8192, 8202, 8210, 8216, 8224, 8243, - 8251, 8257, 8265, 8275 -}; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_DCT_VALUE_COST_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/dct_value_tokens.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/dct_value_tokens.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/dct_value_tokens.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/dct_value_tokens.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,712 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP8_ENCODER_DCT_VALUE_TOKENS_H_ -#define VP8_ENCODER_DCT_VALUE_TOKENS_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Generated file, included by tokenize.c */ -/* Values generated by fill_value_tokens() */ - -static const TOKENVALUE dct_value_tokens[2048*2] = -{ - {10, 3963}, {10, 3961}, {10, 3959}, {10, 3957}, {10, 3955}, {10, 3953}, - {10, 3951}, {10, 3949}, {10, 3947}, {10, 3945}, {10, 3943}, {10, 3941}, - {10, 3939}, {10, 3937}, {10, 3935}, {10, 3933}, {10, 3931}, {10, 3929}, - {10, 3927}, {10, 3925}, {10, 3923}, {10, 3921}, {10, 3919}, {10, 3917}, - {10, 3915}, {10, 3913}, {10, 3911}, {10, 3909}, {10, 3907}, {10, 3905}, - {10, 3903}, {10, 3901}, {10, 3899}, {10, 3897}, {10, 3895}, {10, 3893}, - {10, 3891}, {10, 3889}, {10, 3887}, {10, 3885}, {10, 3883}, {10, 3881}, - {10, 3879}, {10, 3877}, {10, 3875}, {10, 3873}, {10, 3871}, {10, 3869}, - {10, 3867}, {10, 3865}, {10, 3863}, {10, 3861}, {10, 3859}, {10, 3857}, - {10, 3855}, {10, 3853}, {10, 3851}, {10, 3849}, {10, 3847}, {10, 3845}, - {10, 3843}, {10, 3841}, {10, 3839}, {10, 3837}, {10, 3835}, {10, 3833}, - {10, 3831}, {10, 3829}, {10, 3827}, {10, 3825}, {10, 3823}, {10, 3821}, - {10, 3819}, {10, 3817}, {10, 3815}, {10, 3813}, {10, 3811}, {10, 3809}, - {10, 3807}, {10, 3805}, {10, 3803}, {10, 3801}, {10, 3799}, {10, 3797}, - {10, 3795}, {10, 3793}, {10, 3791}, {10, 3789}, {10, 3787}, {10, 3785}, - {10, 3783}, {10, 3781}, {10, 3779}, {10, 3777}, {10, 3775}, {10, 3773}, - {10, 3771}, {10, 3769}, {10, 3767}, {10, 3765}, {10, 3763}, {10, 3761}, - {10, 3759}, {10, 3757}, {10, 3755}, {10, 3753}, {10, 3751}, {10, 3749}, - {10, 3747}, {10, 3745}, {10, 3743}, {10, 3741}, {10, 3739}, {10, 3737}, - {10, 3735}, {10, 3733}, {10, 3731}, {10, 3729}, {10, 3727}, {10, 3725}, - {10, 3723}, {10, 3721}, {10, 3719}, {10, 3717}, {10, 3715}, {10, 3713}, - {10, 3711}, {10, 3709}, {10, 3707}, {10, 3705}, {10, 3703}, {10, 3701}, - {10, 3699}, {10, 3697}, {10, 3695}, {10, 3693}, {10, 3691}, {10, 3689}, - {10, 3687}, {10, 3685}, {10, 3683}, {10, 3681}, {10, 3679}, {10, 3677}, - {10, 3675}, {10, 3673}, {10, 3671}, {10, 3669}, {10, 3667}, {10, 3665}, - {10, 3663}, {10, 3661}, {10, 3659}, {10, 3657}, {10, 3655}, {10, 3653}, - {10, 3651}, {10, 3649}, {10, 3647}, {10, 3645}, {10, 3643}, {10, 3641}, - {10, 3639}, {10, 3637}, {10, 3635}, {10, 3633}, {10, 3631}, {10, 3629}, - {10, 3627}, {10, 3625}, {10, 3623}, {10, 3621}, {10, 3619}, {10, 3617}, - {10, 3615}, {10, 3613}, {10, 3611}, {10, 3609}, {10, 3607}, {10, 3605}, - {10, 3603}, {10, 3601}, {10, 3599}, {10, 3597}, {10, 3595}, {10, 3593}, - {10, 3591}, {10, 3589}, {10, 3587}, {10, 3585}, {10, 3583}, {10, 3581}, - {10, 3579}, {10, 3577}, {10, 3575}, {10, 3573}, {10, 3571}, {10, 3569}, - {10, 3567}, {10, 3565}, {10, 3563}, {10, 3561}, {10, 3559}, {10, 3557}, - {10, 3555}, {10, 3553}, {10, 3551}, {10, 3549}, {10, 3547}, {10, 3545}, - {10, 3543}, {10, 3541}, {10, 3539}, {10, 3537}, {10, 3535}, {10, 3533}, - {10, 3531}, {10, 3529}, {10, 3527}, {10, 3525}, {10, 3523}, {10, 3521}, - {10, 3519}, {10, 3517}, {10, 3515}, {10, 3513}, {10, 3511}, {10, 3509}, - {10, 3507}, {10, 3505}, {10, 3503}, {10, 3501}, {10, 3499}, {10, 3497}, - {10, 3495}, {10, 3493}, {10, 3491}, {10, 3489}, {10, 3487}, {10, 3485}, - {10, 3483}, {10, 3481}, {10, 3479}, {10, 3477}, {10, 3475}, {10, 3473}, - {10, 3471}, {10, 3469}, {10, 3467}, {10, 3465}, {10, 3463}, {10, 3461}, - {10, 3459}, {10, 3457}, {10, 3455}, {10, 3453}, {10, 3451}, {10, 3449}, - {10, 3447}, {10, 3445}, {10, 3443}, {10, 3441}, {10, 3439}, {10, 3437}, - {10, 3435}, {10, 3433}, {10, 3431}, {10, 3429}, {10, 3427}, {10, 3425}, - {10, 3423}, {10, 3421}, {10, 3419}, {10, 3417}, {10, 3415}, {10, 3413}, - {10, 3411}, {10, 3409}, {10, 3407}, {10, 3405}, {10, 3403}, {10, 3401}, - {10, 3399}, {10, 3397}, {10, 3395}, {10, 3393}, {10, 3391}, {10, 3389}, - {10, 3387}, {10, 3385}, {10, 3383}, {10, 3381}, {10, 3379}, {10, 3377}, - {10, 3375}, {10, 3373}, {10, 3371}, {10, 3369}, {10, 3367}, {10, 3365}, - {10, 3363}, {10, 3361}, {10, 3359}, {10, 3357}, {10, 3355}, {10, 3353}, - {10, 3351}, {10, 3349}, {10, 3347}, {10, 3345}, {10, 3343}, {10, 3341}, - {10, 3339}, {10, 3337}, {10, 3335}, {10, 3333}, {10, 3331}, {10, 3329}, - {10, 3327}, {10, 3325}, {10, 3323}, {10, 3321}, {10, 3319}, {10, 3317}, - {10, 3315}, {10, 3313}, {10, 3311}, {10, 3309}, {10, 3307}, {10, 3305}, - {10, 3303}, {10, 3301}, {10, 3299}, {10, 3297}, {10, 3295}, {10, 3293}, - {10, 3291}, {10, 3289}, {10, 3287}, {10, 3285}, {10, 3283}, {10, 3281}, - {10, 3279}, {10, 3277}, {10, 3275}, {10, 3273}, {10, 3271}, {10, 3269}, - {10, 3267}, {10, 3265}, {10, 3263}, {10, 3261}, {10, 3259}, {10, 3257}, - {10, 3255}, {10, 3253}, {10, 3251}, {10, 3249}, {10, 3247}, {10, 3245}, - {10, 3243}, {10, 3241}, {10, 3239}, {10, 3237}, {10, 3235}, {10, 3233}, - {10, 3231}, {10, 3229}, {10, 3227}, {10, 3225}, {10, 3223}, {10, 3221}, - {10, 3219}, {10, 3217}, {10, 3215}, {10, 3213}, {10, 3211}, {10, 3209}, - {10, 3207}, {10, 3205}, {10, 3203}, {10, 3201}, {10, 3199}, {10, 3197}, - {10, 3195}, {10, 3193}, {10, 3191}, {10, 3189}, {10, 3187}, {10, 3185}, - {10, 3183}, {10, 3181}, {10, 3179}, {10, 3177}, {10, 3175}, {10, 3173}, - {10, 3171}, {10, 3169}, {10, 3167}, {10, 3165}, {10, 3163}, {10, 3161}, - {10, 3159}, {10, 3157}, {10, 3155}, {10, 3153}, {10, 3151}, {10, 3149}, - {10, 3147}, {10, 3145}, {10, 3143}, {10, 3141}, {10, 3139}, {10, 3137}, - {10, 3135}, {10, 3133}, {10, 3131}, {10, 3129}, {10, 3127}, {10, 3125}, - {10, 3123}, {10, 3121}, {10, 3119}, {10, 3117}, {10, 3115}, {10, 3113}, - {10, 3111}, {10, 3109}, {10, 3107}, {10, 3105}, {10, 3103}, {10, 3101}, - {10, 3099}, {10, 3097}, {10, 3095}, {10, 3093}, {10, 3091}, {10, 3089}, - {10, 3087}, {10, 3085}, {10, 3083}, {10, 3081}, {10, 3079}, {10, 3077}, - {10, 3075}, {10, 3073}, {10, 3071}, {10, 3069}, {10, 3067}, {10, 3065}, - {10, 3063}, {10, 3061}, {10, 3059}, {10, 3057}, {10, 3055}, {10, 3053}, - {10, 3051}, {10, 3049}, {10, 3047}, {10, 3045}, {10, 3043}, {10, 3041}, - {10, 3039}, {10, 3037}, {10, 3035}, {10, 3033}, {10, 3031}, {10, 3029}, - {10, 3027}, {10, 3025}, {10, 3023}, {10, 3021}, {10, 3019}, {10, 3017}, - {10, 3015}, {10, 3013}, {10, 3011}, {10, 3009}, {10, 3007}, {10, 3005}, - {10, 3003}, {10, 3001}, {10, 2999}, {10, 2997}, {10, 2995}, {10, 2993}, - {10, 2991}, {10, 2989}, {10, 2987}, {10, 2985}, {10, 2983}, {10, 2981}, - {10, 2979}, {10, 2977}, {10, 2975}, {10, 2973}, {10, 2971}, {10, 2969}, - {10, 2967}, {10, 2965}, {10, 2963}, {10, 2961}, {10, 2959}, {10, 2957}, - {10, 2955}, {10, 2953}, {10, 2951}, {10, 2949}, {10, 2947}, {10, 2945}, - {10, 2943}, {10, 2941}, {10, 2939}, {10, 2937}, {10, 2935}, {10, 2933}, - {10, 2931}, {10, 2929}, {10, 2927}, {10, 2925}, {10, 2923}, {10, 2921}, - {10, 2919}, {10, 2917}, {10, 2915}, {10, 2913}, {10, 2911}, {10, 2909}, - {10, 2907}, {10, 2905}, {10, 2903}, {10, 2901}, {10, 2899}, {10, 2897}, - {10, 2895}, {10, 2893}, {10, 2891}, {10, 2889}, {10, 2887}, {10, 2885}, - {10, 2883}, {10, 2881}, {10, 2879}, {10, 2877}, {10, 2875}, {10, 2873}, - {10, 2871}, {10, 2869}, {10, 2867}, {10, 2865}, {10, 2863}, {10, 2861}, - {10, 2859}, {10, 2857}, {10, 2855}, {10, 2853}, {10, 2851}, {10, 2849}, - {10, 2847}, {10, 2845}, {10, 2843}, {10, 2841}, {10, 2839}, {10, 2837}, - {10, 2835}, {10, 2833}, {10, 2831}, {10, 2829}, {10, 2827}, {10, 2825}, - {10, 2823}, {10, 2821}, {10, 2819}, {10, 2817}, {10, 2815}, {10, 2813}, - {10, 2811}, {10, 2809}, {10, 2807}, {10, 2805}, {10, 2803}, {10, 2801}, - {10, 2799}, {10, 2797}, {10, 2795}, {10, 2793}, {10, 2791}, {10, 2789}, - {10, 2787}, {10, 2785}, {10, 2783}, {10, 2781}, {10, 2779}, {10, 2777}, - {10, 2775}, {10, 2773}, {10, 2771}, {10, 2769}, {10, 2767}, {10, 2765}, - {10, 2763}, {10, 2761}, {10, 2759}, {10, 2757}, {10, 2755}, {10, 2753}, - {10, 2751}, {10, 2749}, {10, 2747}, {10, 2745}, {10, 2743}, {10, 2741}, - {10, 2739}, {10, 2737}, {10, 2735}, {10, 2733}, {10, 2731}, {10, 2729}, - {10, 2727}, {10, 2725}, {10, 2723}, {10, 2721}, {10, 2719}, {10, 2717}, - {10, 2715}, {10, 2713}, {10, 2711}, {10, 2709}, {10, 2707}, {10, 2705}, - {10, 2703}, {10, 2701}, {10, 2699}, {10, 2697}, {10, 2695}, {10, 2693}, - {10, 2691}, {10, 2689}, {10, 2687}, {10, 2685}, {10, 2683}, {10, 2681}, - {10, 2679}, {10, 2677}, {10, 2675}, {10, 2673}, {10, 2671}, {10, 2669}, - {10, 2667}, {10, 2665}, {10, 2663}, {10, 2661}, {10, 2659}, {10, 2657}, - {10, 2655}, {10, 2653}, {10, 2651}, {10, 2649}, {10, 2647}, {10, 2645}, - {10, 2643}, {10, 2641}, {10, 2639}, {10, 2637}, {10, 2635}, {10, 2633}, - {10, 2631}, {10, 2629}, {10, 2627}, {10, 2625}, {10, 2623}, {10, 2621}, - {10, 2619}, {10, 2617}, {10, 2615}, {10, 2613}, {10, 2611}, {10, 2609}, - {10, 2607}, {10, 2605}, {10, 2603}, {10, 2601}, {10, 2599}, {10, 2597}, - {10, 2595}, {10, 2593}, {10, 2591}, {10, 2589}, {10, 2587}, {10, 2585}, - {10, 2583}, {10, 2581}, {10, 2579}, {10, 2577}, {10, 2575}, {10, 2573}, - {10, 2571}, {10, 2569}, {10, 2567}, {10, 2565}, {10, 2563}, {10, 2561}, - {10, 2559}, {10, 2557}, {10, 2555}, {10, 2553}, {10, 2551}, {10, 2549}, - {10, 2547}, {10, 2545}, {10, 2543}, {10, 2541}, {10, 2539}, {10, 2537}, - {10, 2535}, {10, 2533}, {10, 2531}, {10, 2529}, {10, 2527}, {10, 2525}, - {10, 2523}, {10, 2521}, {10, 2519}, {10, 2517}, {10, 2515}, {10, 2513}, - {10, 2511}, {10, 2509}, {10, 2507}, {10, 2505}, {10, 2503}, {10, 2501}, - {10, 2499}, {10, 2497}, {10, 2495}, {10, 2493}, {10, 2491}, {10, 2489}, - {10, 2487}, {10, 2485}, {10, 2483}, {10, 2481}, {10, 2479}, {10, 2477}, - {10, 2475}, {10, 2473}, {10, 2471}, {10, 2469}, {10, 2467}, {10, 2465}, - {10, 2463}, {10, 2461}, {10, 2459}, {10, 2457}, {10, 2455}, {10, 2453}, - {10, 2451}, {10, 2449}, {10, 2447}, {10, 2445}, {10, 2443}, {10, 2441}, - {10, 2439}, {10, 2437}, {10, 2435}, {10, 2433}, {10, 2431}, {10, 2429}, - {10, 2427}, {10, 2425}, {10, 2423}, {10, 2421}, {10, 2419}, {10, 2417}, - {10, 2415}, {10, 2413}, {10, 2411}, {10, 2409}, {10, 2407}, {10, 2405}, - {10, 2403}, {10, 2401}, {10, 2399}, {10, 2397}, {10, 2395}, {10, 2393}, - {10, 2391}, {10, 2389}, {10, 2387}, {10, 2385}, {10, 2383}, {10, 2381}, - {10, 2379}, {10, 2377}, {10, 2375}, {10, 2373}, {10, 2371}, {10, 2369}, - {10, 2367}, {10, 2365}, {10, 2363}, {10, 2361}, {10, 2359}, {10, 2357}, - {10, 2355}, {10, 2353}, {10, 2351}, {10, 2349}, {10, 2347}, {10, 2345}, - {10, 2343}, {10, 2341}, {10, 2339}, {10, 2337}, {10, 2335}, {10, 2333}, - {10, 2331}, {10, 2329}, {10, 2327}, {10, 2325}, {10, 2323}, {10, 2321}, - {10, 2319}, {10, 2317}, {10, 2315}, {10, 2313}, {10, 2311}, {10, 2309}, - {10, 2307}, {10, 2305}, {10, 2303}, {10, 2301}, {10, 2299}, {10, 2297}, - {10, 2295}, {10, 2293}, {10, 2291}, {10, 2289}, {10, 2287}, {10, 2285}, - {10, 2283}, {10, 2281}, {10, 2279}, {10, 2277}, {10, 2275}, {10, 2273}, - {10, 2271}, {10, 2269}, {10, 2267}, {10, 2265}, {10, 2263}, {10, 2261}, - {10, 2259}, {10, 2257}, {10, 2255}, {10, 2253}, {10, 2251}, {10, 2249}, - {10, 2247}, {10, 2245}, {10, 2243}, {10, 2241}, {10, 2239}, {10, 2237}, - {10, 2235}, {10, 2233}, {10, 2231}, {10, 2229}, {10, 2227}, {10, 2225}, - {10, 2223}, {10, 2221}, {10, 2219}, {10, 2217}, {10, 2215}, {10, 2213}, - {10, 2211}, {10, 2209}, {10, 2207}, {10, 2205}, {10, 2203}, {10, 2201}, - {10, 2199}, {10, 2197}, {10, 2195}, {10, 2193}, {10, 2191}, {10, 2189}, - {10, 2187}, {10, 2185}, {10, 2183}, {10, 2181}, {10, 2179}, {10, 2177}, - {10, 2175}, {10, 2173}, {10, 2171}, {10, 2169}, {10, 2167}, {10, 2165}, - {10, 2163}, {10, 2161}, {10, 2159}, {10, 2157}, {10, 2155}, {10, 2153}, - {10, 2151}, {10, 2149}, {10, 2147}, {10, 2145}, {10, 2143}, {10, 2141}, - {10, 2139}, {10, 2137}, {10, 2135}, {10, 2133}, {10, 2131}, {10, 2129}, - {10, 2127}, {10, 2125}, {10, 2123}, {10, 2121}, {10, 2119}, {10, 2117}, - {10, 2115}, {10, 2113}, {10, 2111}, {10, 2109}, {10, 2107}, {10, 2105}, - {10, 2103}, {10, 2101}, {10, 2099}, {10, 2097}, {10, 2095}, {10, 2093}, - {10, 2091}, {10, 2089}, {10, 2087}, {10, 2085}, {10, 2083}, {10, 2081}, - {10, 2079}, {10, 2077}, {10, 2075}, {10, 2073}, {10, 2071}, {10, 2069}, - {10, 2067}, {10, 2065}, {10, 2063}, {10, 2061}, {10, 2059}, {10, 2057}, - {10, 2055}, {10, 2053}, {10, 2051}, {10, 2049}, {10, 2047}, {10, 2045}, - {10, 2043}, {10, 2041}, {10, 2039}, {10, 2037}, {10, 2035}, {10, 2033}, - {10, 2031}, {10, 2029}, {10, 2027}, {10, 2025}, {10, 2023}, {10, 2021}, - {10, 2019}, {10, 2017}, {10, 2015}, {10, 2013}, {10, 2011}, {10, 2009}, - {10, 2007}, {10, 2005}, {10, 2003}, {10, 2001}, {10, 1999}, {10, 1997}, - {10, 1995}, {10, 1993}, {10, 1991}, {10, 1989}, {10, 1987}, {10, 1985}, - {10, 1983}, {10, 1981}, {10, 1979}, {10, 1977}, {10, 1975}, {10, 1973}, - {10, 1971}, {10, 1969}, {10, 1967}, {10, 1965}, {10, 1963}, {10, 1961}, - {10, 1959}, {10, 1957}, {10, 1955}, {10, 1953}, {10, 1951}, {10, 1949}, - {10, 1947}, {10, 1945}, {10, 1943}, {10, 1941}, {10, 1939}, {10, 1937}, - {10, 1935}, {10, 1933}, {10, 1931}, {10, 1929}, {10, 1927}, {10, 1925}, - {10, 1923}, {10, 1921}, {10, 1919}, {10, 1917}, {10, 1915}, {10, 1913}, - {10, 1911}, {10, 1909}, {10, 1907}, {10, 1905}, {10, 1903}, {10, 1901}, - {10, 1899}, {10, 1897}, {10, 1895}, {10, 1893}, {10, 1891}, {10, 1889}, - {10, 1887}, {10, 1885}, {10, 1883}, {10, 1881}, {10, 1879}, {10, 1877}, - {10, 1875}, {10, 1873}, {10, 1871}, {10, 1869}, {10, 1867}, {10, 1865}, - {10, 1863}, {10, 1861}, {10, 1859}, {10, 1857}, {10, 1855}, {10, 1853}, - {10, 1851}, {10, 1849}, {10, 1847}, {10, 1845}, {10, 1843}, {10, 1841}, - {10, 1839}, {10, 1837}, {10, 1835}, {10, 1833}, {10, 1831}, {10, 1829}, - {10, 1827}, {10, 1825}, {10, 1823}, {10, 1821}, {10, 1819}, {10, 1817}, - {10, 1815}, {10, 1813}, {10, 1811}, {10, 1809}, {10, 1807}, {10, 1805}, - {10, 1803}, {10, 1801}, {10, 1799}, {10, 1797}, {10, 1795}, {10, 1793}, - {10, 1791}, {10, 1789}, {10, 1787}, {10, 1785}, {10, 1783}, {10, 1781}, - {10, 1779}, {10, 1777}, {10, 1775}, {10, 1773}, {10, 1771}, {10, 1769}, - {10, 1767}, {10, 1765}, {10, 1763}, {10, 1761}, {10, 1759}, {10, 1757}, - {10, 1755}, {10, 1753}, {10, 1751}, {10, 1749}, {10, 1747}, {10, 1745}, - {10, 1743}, {10, 1741}, {10, 1739}, {10, 1737}, {10, 1735}, {10, 1733}, - {10, 1731}, {10, 1729}, {10, 1727}, {10, 1725}, {10, 1723}, {10, 1721}, - {10, 1719}, {10, 1717}, {10, 1715}, {10, 1713}, {10, 1711}, {10, 1709}, - {10, 1707}, {10, 1705}, {10, 1703}, {10, 1701}, {10, 1699}, {10, 1697}, - {10, 1695}, {10, 1693}, {10, 1691}, {10, 1689}, {10, 1687}, {10, 1685}, - {10, 1683}, {10, 1681}, {10, 1679}, {10, 1677}, {10, 1675}, {10, 1673}, - {10, 1671}, {10, 1669}, {10, 1667}, {10, 1665}, {10, 1663}, {10, 1661}, - {10, 1659}, {10, 1657}, {10, 1655}, {10, 1653}, {10, 1651}, {10, 1649}, - {10, 1647}, {10, 1645}, {10, 1643}, {10, 1641}, {10, 1639}, {10, 1637}, - {10, 1635}, {10, 1633}, {10, 1631}, {10, 1629}, {10, 1627}, {10, 1625}, - {10, 1623}, {10, 1621}, {10, 1619}, {10, 1617}, {10, 1615}, {10, 1613}, - {10, 1611}, {10, 1609}, {10, 1607}, {10, 1605}, {10, 1603}, {10, 1601}, - {10, 1599}, {10, 1597}, {10, 1595}, {10, 1593}, {10, 1591}, {10, 1589}, - {10, 1587}, {10, 1585}, {10, 1583}, {10, 1581}, {10, 1579}, {10, 1577}, - {10, 1575}, {10, 1573}, {10, 1571}, {10, 1569}, {10, 1567}, {10, 1565}, - {10, 1563}, {10, 1561}, {10, 1559}, {10, 1557}, {10, 1555}, {10, 1553}, - {10, 1551}, {10, 1549}, {10, 1547}, {10, 1545}, {10, 1543}, {10, 1541}, - {10, 1539}, {10, 1537}, {10, 1535}, {10, 1533}, {10, 1531}, {10, 1529}, - {10, 1527}, {10, 1525}, {10, 1523}, {10, 1521}, {10, 1519}, {10, 1517}, - {10, 1515}, {10, 1513}, {10, 1511}, {10, 1509}, {10, 1507}, {10, 1505}, - {10, 1503}, {10, 1501}, {10, 1499}, {10, 1497}, {10, 1495}, {10, 1493}, - {10, 1491}, {10, 1489}, {10, 1487}, {10, 1485}, {10, 1483}, {10, 1481}, - {10, 1479}, {10, 1477}, {10, 1475}, {10, 1473}, {10, 1471}, {10, 1469}, - {10, 1467}, {10, 1465}, {10, 1463}, {10, 1461}, {10, 1459}, {10, 1457}, - {10, 1455}, {10, 1453}, {10, 1451}, {10, 1449}, {10, 1447}, {10, 1445}, - {10, 1443}, {10, 1441}, {10, 1439}, {10, 1437}, {10, 1435}, {10, 1433}, - {10, 1431}, {10, 1429}, {10, 1427}, {10, 1425}, {10, 1423}, {10, 1421}, - {10, 1419}, {10, 1417}, {10, 1415}, {10, 1413}, {10, 1411}, {10, 1409}, - {10, 1407}, {10, 1405}, {10, 1403}, {10, 1401}, {10, 1399}, {10, 1397}, - {10, 1395}, {10, 1393}, {10, 1391}, {10, 1389}, {10, 1387}, {10, 1385}, - {10, 1383}, {10, 1381}, {10, 1379}, {10, 1377}, {10, 1375}, {10, 1373}, - {10, 1371}, {10, 1369}, {10, 1367}, {10, 1365}, {10, 1363}, {10, 1361}, - {10, 1359}, {10, 1357}, {10, 1355}, {10, 1353}, {10, 1351}, {10, 1349}, - {10, 1347}, {10, 1345}, {10, 1343}, {10, 1341}, {10, 1339}, {10, 1337}, - {10, 1335}, {10, 1333}, {10, 1331}, {10, 1329}, {10, 1327}, {10, 1325}, - {10, 1323}, {10, 1321}, {10, 1319}, {10, 1317}, {10, 1315}, {10, 1313}, - {10, 1311}, {10, 1309}, {10, 1307}, {10, 1305}, {10, 1303}, {10, 1301}, - {10, 1299}, {10, 1297}, {10, 1295}, {10, 1293}, {10, 1291}, {10, 1289}, - {10, 1287}, {10, 1285}, {10, 1283}, {10, 1281}, {10, 1279}, {10, 1277}, - {10, 1275}, {10, 1273}, {10, 1271}, {10, 1269}, {10, 1267}, {10, 1265}, - {10, 1263}, {10, 1261}, {10, 1259}, {10, 1257}, {10, 1255}, {10, 1253}, - {10, 1251}, {10, 1249}, {10, 1247}, {10, 1245}, {10, 1243}, {10, 1241}, - {10, 1239}, {10, 1237}, {10, 1235}, {10, 1233}, {10, 1231}, {10, 1229}, - {10, 1227}, {10, 1225}, {10, 1223}, {10, 1221}, {10, 1219}, {10, 1217}, - {10, 1215}, {10, 1213}, {10, 1211}, {10, 1209}, {10, 1207}, {10, 1205}, - {10, 1203}, {10, 1201}, {10, 1199}, {10, 1197}, {10, 1195}, {10, 1193}, - {10, 1191}, {10, 1189}, {10, 1187}, {10, 1185}, {10, 1183}, {10, 1181}, - {10, 1179}, {10, 1177}, {10, 1175}, {10, 1173}, {10, 1171}, {10, 1169}, - {10, 1167}, {10, 1165}, {10, 1163}, {10, 1161}, {10, 1159}, {10, 1157}, - {10, 1155}, {10, 1153}, {10, 1151}, {10, 1149}, {10, 1147}, {10, 1145}, - {10, 1143}, {10, 1141}, {10, 1139}, {10, 1137}, {10, 1135}, {10, 1133}, - {10, 1131}, {10, 1129}, {10, 1127}, {10, 1125}, {10, 1123}, {10, 1121}, - {10, 1119}, {10, 1117}, {10, 1115}, {10, 1113}, {10, 1111}, {10, 1109}, - {10, 1107}, {10, 1105}, {10, 1103}, {10, 1101}, {10, 1099}, {10, 1097}, - {10, 1095}, {10, 1093}, {10, 1091}, {10, 1089}, {10, 1087}, {10, 1085}, - {10, 1083}, {10, 1081}, {10, 1079}, {10, 1077}, {10, 1075}, {10, 1073}, - {10, 1071}, {10, 1069}, {10, 1067}, {10, 1065}, {10, 1063}, {10, 1061}, - {10, 1059}, {10, 1057}, {10, 1055}, {10, 1053}, {10, 1051}, {10, 1049}, - {10, 1047}, {10, 1045}, {10, 1043}, {10, 1041}, {10, 1039}, {10, 1037}, - {10, 1035}, {10, 1033}, {10, 1031}, {10, 1029}, {10, 1027}, {10, 1025}, - {10, 1023}, {10, 1021}, {10, 1019}, {10, 1017}, {10, 1015}, {10, 1013}, - {10, 1011}, {10, 1009}, {10, 1007}, {10, 1005}, {10, 1003}, {10, 1001}, - {10, 999}, {10, 997}, {10, 995}, {10, 993}, {10, 991}, {10, 989}, - {10, 987}, {10, 985}, {10, 983}, {10, 981}, {10, 979}, {10, 977}, - {10, 975}, {10, 973}, {10, 971}, {10, 969}, {10, 967}, {10, 965}, - {10, 963}, {10, 961}, {10, 959}, {10, 957}, {10, 955}, {10, 953}, - {10, 951}, {10, 949}, {10, 947}, {10, 945}, {10, 943}, {10, 941}, - {10, 939}, {10, 937}, {10, 935}, {10, 933}, {10, 931}, {10, 929}, - {10, 927}, {10, 925}, {10, 923}, {10, 921}, {10, 919}, {10, 917}, - {10, 915}, {10, 913}, {10, 911}, {10, 909}, {10, 907}, {10, 905}, - {10, 903}, {10, 901}, {10, 899}, {10, 897}, {10, 895}, {10, 893}, - {10, 891}, {10, 889}, {10, 887}, {10, 885}, {10, 883}, {10, 881}, - {10, 879}, {10, 877}, {10, 875}, {10, 873}, {10, 871}, {10, 869}, - {10, 867}, {10, 865}, {10, 863}, {10, 861}, {10, 859}, {10, 857}, - {10, 855}, {10, 853}, {10, 851}, {10, 849}, {10, 847}, {10, 845}, - {10, 843}, {10, 841}, {10, 839}, {10, 837}, {10, 835}, {10, 833}, - {10, 831}, {10, 829}, {10, 827}, {10, 825}, {10, 823}, {10, 821}, - {10, 819}, {10, 817}, {10, 815}, {10, 813}, {10, 811}, {10, 809}, - {10, 807}, {10, 805}, {10, 803}, {10, 801}, {10, 799}, {10, 797}, - {10, 795}, {10, 793}, {10, 791}, {10, 789}, {10, 787}, {10, 785}, - {10, 783}, {10, 781}, {10, 779}, {10, 777}, {10, 775}, {10, 773}, - {10, 771}, {10, 769}, {10, 767}, {10, 765}, {10, 763}, {10, 761}, - {10, 759}, {10, 757}, {10, 755}, {10, 753}, {10, 751}, {10, 749}, - {10, 747}, {10, 745}, {10, 743}, {10, 741}, {10, 739}, {10, 737}, - {10, 735}, {10, 733}, {10, 731}, {10, 729}, {10, 727}, {10, 725}, - {10, 723}, {10, 721}, {10, 719}, {10, 717}, {10, 715}, {10, 713}, - {10, 711}, {10, 709}, {10, 707}, {10, 705}, {10, 703}, {10, 701}, - {10, 699}, {10, 697}, {10, 695}, {10, 693}, {10, 691}, {10, 689}, - {10, 687}, {10, 685}, {10, 683}, {10, 681}, {10, 679}, {10, 677}, - {10, 675}, {10, 673}, {10, 671}, {10, 669}, {10, 667}, {10, 665}, - {10, 663}, {10, 661}, {10, 659}, {10, 657}, {10, 655}, {10, 653}, - {10, 651}, {10, 649}, {10, 647}, {10, 645}, {10, 643}, {10, 641}, - {10, 639}, {10, 637}, {10, 635}, {10, 633}, {10, 631}, {10, 629}, - {10, 627}, {10, 625}, {10, 623}, {10, 621}, {10, 619}, {10, 617}, - {10, 615}, {10, 613}, {10, 611}, {10, 609}, {10, 607}, {10, 605}, - {10, 603}, {10, 601}, {10, 599}, {10, 597}, {10, 595}, {10, 593}, - {10, 591}, {10, 589}, {10, 587}, {10, 585}, {10, 583}, {10, 581}, - {10, 579}, {10, 577}, {10, 575}, {10, 573}, {10, 571}, {10, 569}, - {10, 567}, {10, 565}, {10, 563}, {10, 561}, {10, 559}, {10, 557}, - {10, 555}, {10, 553}, {10, 551}, {10, 549}, {10, 547}, {10, 545}, - {10, 543}, {10, 541}, {10, 539}, {10, 537}, {10, 535}, {10, 533}, - {10, 531}, {10, 529}, {10, 527}, {10, 525}, {10, 523}, {10, 521}, - {10, 519}, {10, 517}, {10, 515}, {10, 513}, {10, 511}, {10, 509}, - {10, 507}, {10, 505}, {10, 503}, {10, 501}, {10, 499}, {10, 497}, - {10, 495}, {10, 493}, {10, 491}, {10, 489}, {10, 487}, {10, 485}, - {10, 483}, {10, 481}, {10, 479}, {10, 477}, {10, 475}, {10, 473}, - {10, 471}, {10, 469}, {10, 467}, {10, 465}, {10, 463}, {10, 461}, - {10, 459}, {10, 457}, {10, 455}, {10, 453}, {10, 451}, {10, 449}, - {10, 447}, {10, 445}, {10, 443}, {10, 441}, {10, 439}, {10, 437}, - {10, 435}, {10, 433}, {10, 431}, {10, 429}, {10, 427}, {10, 425}, - {10, 423}, {10, 421}, {10, 419}, {10, 417}, {10, 415}, {10, 413}, - {10, 411}, {10, 409}, {10, 407}, {10, 405}, {10, 403}, {10, 401}, - {10, 399}, {10, 397}, {10, 395}, {10, 393}, {10, 391}, {10, 389}, - {10, 387}, {10, 385}, {10, 383}, {10, 381}, {10, 379}, {10, 377}, - {10, 375}, {10, 373}, {10, 371}, {10, 369}, {10, 367}, {10, 365}, - {10, 363}, {10, 361}, {10, 359}, {10, 357}, {10, 355}, {10, 353}, - {10, 351}, {10, 349}, {10, 347}, {10, 345}, {10, 343}, {10, 341}, - {10, 339}, {10, 337}, {10, 335}, {10, 333}, {10, 331}, {10, 329}, - {10, 327}, {10, 325}, {10, 323}, {10, 321}, {10, 319}, {10, 317}, - {10, 315}, {10, 313}, {10, 311}, {10, 309}, {10, 307}, {10, 305}, - {10, 303}, {10, 301}, {10, 299}, {10, 297}, {10, 295}, {10, 293}, - {10, 291}, {10, 289}, {10, 287}, {10, 285}, {10, 283}, {10, 281}, - {10, 279}, {10, 277}, {10, 275}, {10, 273}, {10, 271}, {10, 269}, - {10, 267}, {10, 265}, {10, 263}, {10, 261}, {10, 259}, {10, 257}, - {10, 255}, {10, 253}, {10, 251}, {10, 249}, {10, 247}, {10, 245}, - {10, 243}, {10, 241}, {10, 239}, {10, 237}, {10, 235}, {10, 233}, - {10, 231}, {10, 229}, {10, 227}, {10, 225}, {10, 223}, {10, 221}, - {10, 219}, {10, 217}, {10, 215}, {10, 213}, {10, 211}, {10, 209}, - {10, 207}, {10, 205}, {10, 203}, {10, 201}, {10, 199}, {10, 197}, - {10, 195}, {10, 193}, {10, 191}, {10, 189}, {10, 187}, {10, 185}, - {10, 183}, {10, 181}, {10, 179}, {10, 177}, {10, 175}, {10, 173}, - {10, 171}, {10, 169}, {10, 167}, {10, 165}, {10, 163}, {10, 161}, - {10, 159}, {10, 157}, {10, 155}, {10, 153}, {10, 151}, {10, 149}, - {10, 147}, {10, 145}, {10, 143}, {10, 141}, {10, 139}, {10, 137}, - {10, 135}, {10, 133}, {10, 131}, {10, 129}, {10, 127}, {10, 125}, - {10, 123}, {10, 121}, {10, 119}, {10, 117}, {10, 115}, {10, 113}, - {10, 111}, {10, 109}, {10, 107}, {10, 105}, {10, 103}, {10, 101}, - {10, 99}, {10, 97}, {10, 95}, {10, 93}, {10, 91}, {10, 89}, - {10, 87}, {10, 85}, {10, 83}, {10, 81}, {10, 79}, {10, 77}, - {10, 75}, {10, 73}, {10, 71}, {10, 69}, {10, 67}, {10, 65}, - {10, 63}, {10, 61}, {10, 59}, {10, 57}, {10, 55}, {10, 53}, - {10, 51}, {10, 49}, {10, 47}, {10, 45}, {10, 43}, {10, 41}, - {10, 39}, {10, 37}, {10, 35}, {10, 33}, {10, 31}, {10, 29}, - {10, 27}, {10, 25}, {10, 23}, {10, 21}, {10, 19}, {10, 17}, - {10, 15}, {10, 13}, {10, 11}, {10, 9}, {10, 7}, {10, 5}, - {10, 3}, {10, 1}, {9, 63}, {9, 61}, {9, 59}, {9, 57}, - {9, 55}, {9, 53}, {9, 51}, {9, 49}, {9, 47}, {9, 45}, - {9, 43}, {9, 41}, {9, 39}, {9, 37}, {9, 35}, {9, 33}, - {9, 31}, {9, 29}, {9, 27}, {9, 25}, {9, 23}, {9, 21}, - {9, 19}, {9, 17}, {9, 15}, {9, 13}, {9, 11}, {9, 9}, - {9, 7}, {9, 5}, {9, 3}, {9, 1}, {8, 31}, {8, 29}, - {8, 27}, {8, 25}, {8, 23}, {8, 21}, {8, 19}, {8, 17}, - {8, 15}, {8, 13}, {8, 11}, {8, 9}, {8, 7}, {8, 5}, - {8, 3}, {8, 1}, {7, 15}, {7, 13}, {7, 11}, {7, 9}, - {7, 7}, {7, 5}, {7, 3}, {7, 1}, {6, 7}, {6, 5}, - {6, 3}, {6, 1}, {5, 3}, {5, 1}, {4, 1}, {3, 1}, - {2, 1}, {1, 1}, {0, 0}, {1, 0}, {2, 0}, {3, 0}, - {4, 0}, {5, 0}, {5, 2}, {6, 0}, {6, 2}, {6, 4}, - {6, 6}, {7, 0}, {7, 2}, {7, 4}, {7, 6}, {7, 8}, - {7, 10}, {7, 12}, {7, 14}, {8, 0}, {8, 2}, {8, 4}, - {8, 6}, {8, 8}, {8, 10}, {8, 12}, {8, 14}, {8, 16}, - {8, 18}, {8, 20}, {8, 22}, {8, 24}, {8, 26}, {8, 28}, - {8, 30}, {9, 0}, {9, 2}, {9, 4}, {9, 6}, {9, 8}, - {9, 10}, {9, 12}, {9, 14}, {9, 16}, {9, 18}, {9, 20}, - {9, 22}, {9, 24}, {9, 26}, {9, 28}, {9, 30}, {9, 32}, - {9, 34}, {9, 36}, {9, 38}, {9, 40}, {9, 42}, {9, 44}, - {9, 46}, {9, 48}, {9, 50}, {9, 52}, {9, 54}, {9, 56}, - {9, 58}, {9, 60}, {9, 62}, {10, 0}, {10, 2}, {10, 4}, - {10, 6}, {10, 8}, {10, 10}, {10, 12}, {10, 14}, {10, 16}, - {10, 18}, {10, 20}, {10, 22}, {10, 24}, {10, 26}, {10, 28}, - {10, 30}, {10, 32}, {10, 34}, {10, 36}, {10, 38}, {10, 40}, - {10, 42}, {10, 44}, {10, 46}, {10, 48}, {10, 50}, {10, 52}, - {10, 54}, {10, 56}, {10, 58}, {10, 60}, {10, 62}, {10, 64}, - {10, 66}, {10, 68}, {10, 70}, {10, 72}, {10, 74}, {10, 76}, - {10, 78}, {10, 80}, {10, 82}, {10, 84}, {10, 86}, {10, 88}, - {10, 90}, {10, 92}, {10, 94}, {10, 96}, {10, 98}, {10, 100}, - {10, 102}, {10, 104}, {10, 106}, {10, 108}, {10, 110}, {10, 112}, - {10, 114}, {10, 116}, {10, 118}, {10, 120}, {10, 122}, {10, 124}, - {10, 126}, {10, 128}, {10, 130}, {10, 132}, {10, 134}, {10, 136}, - {10, 138}, {10, 140}, {10, 142}, {10, 144}, {10, 146}, {10, 148}, - {10, 150}, {10, 152}, {10, 154}, {10, 156}, {10, 158}, {10, 160}, - {10, 162}, {10, 164}, {10, 166}, {10, 168}, {10, 170}, {10, 172}, - {10, 174}, {10, 176}, {10, 178}, {10, 180}, {10, 182}, {10, 184}, - {10, 186}, {10, 188}, {10, 190}, {10, 192}, {10, 194}, {10, 196}, - {10, 198}, {10, 200}, {10, 202}, {10, 204}, {10, 206}, {10, 208}, - {10, 210}, {10, 212}, {10, 214}, {10, 216}, {10, 218}, {10, 220}, - {10, 222}, {10, 224}, {10, 226}, {10, 228}, {10, 230}, {10, 232}, - {10, 234}, {10, 236}, {10, 238}, {10, 240}, {10, 242}, {10, 244}, - {10, 246}, {10, 248}, {10, 250}, {10, 252}, {10, 254}, {10, 256}, - {10, 258}, {10, 260}, {10, 262}, {10, 264}, {10, 266}, {10, 268}, - {10, 270}, {10, 272}, {10, 274}, {10, 276}, {10, 278}, {10, 280}, - {10, 282}, {10, 284}, {10, 286}, {10, 288}, {10, 290}, {10, 292}, - {10, 294}, {10, 296}, {10, 298}, {10, 300}, {10, 302}, {10, 304}, - {10, 306}, {10, 308}, {10, 310}, {10, 312}, {10, 314}, {10, 316}, - {10, 318}, {10, 320}, {10, 322}, {10, 324}, {10, 326}, {10, 328}, - {10, 330}, {10, 332}, {10, 334}, {10, 336}, {10, 338}, {10, 340}, - {10, 342}, {10, 344}, {10, 346}, {10, 348}, {10, 350}, {10, 352}, - {10, 354}, {10, 356}, {10, 358}, {10, 360}, {10, 362}, {10, 364}, - {10, 366}, {10, 368}, {10, 370}, {10, 372}, {10, 374}, {10, 376}, - {10, 378}, {10, 380}, {10, 382}, {10, 384}, {10, 386}, {10, 388}, - {10, 390}, {10, 392}, {10, 394}, {10, 396}, {10, 398}, {10, 400}, - {10, 402}, {10, 404}, {10, 406}, {10, 408}, {10, 410}, {10, 412}, - {10, 414}, {10, 416}, {10, 418}, {10, 420}, {10, 422}, {10, 424}, - {10, 426}, {10, 428}, {10, 430}, {10, 432}, {10, 434}, {10, 436}, - {10, 438}, {10, 440}, {10, 442}, {10, 444}, {10, 446}, {10, 448}, - {10, 450}, {10, 452}, {10, 454}, {10, 456}, {10, 458}, {10, 460}, - {10, 462}, {10, 464}, {10, 466}, {10, 468}, {10, 470}, {10, 472}, - {10, 474}, {10, 476}, {10, 478}, {10, 480}, {10, 482}, {10, 484}, - {10, 486}, {10, 488}, {10, 490}, {10, 492}, {10, 494}, {10, 496}, - {10, 498}, {10, 500}, {10, 502}, {10, 504}, {10, 506}, {10, 508}, - {10, 510}, {10, 512}, {10, 514}, {10, 516}, {10, 518}, {10, 520}, - {10, 522}, {10, 524}, {10, 526}, {10, 528}, {10, 530}, {10, 532}, - {10, 534}, {10, 536}, {10, 538}, {10, 540}, {10, 542}, {10, 544}, - {10, 546}, {10, 548}, {10, 550}, {10, 552}, {10, 554}, {10, 556}, - {10, 558}, {10, 560}, {10, 562}, {10, 564}, {10, 566}, {10, 568}, - {10, 570}, {10, 572}, {10, 574}, {10, 576}, {10, 578}, {10, 580}, - {10, 582}, {10, 584}, {10, 586}, {10, 588}, {10, 590}, {10, 592}, - {10, 594}, {10, 596}, {10, 598}, {10, 600}, {10, 602}, {10, 604}, - {10, 606}, {10, 608}, {10, 610}, {10, 612}, {10, 614}, {10, 616}, - {10, 618}, {10, 620}, {10, 622}, {10, 624}, {10, 626}, {10, 628}, - {10, 630}, {10, 632}, {10, 634}, {10, 636}, {10, 638}, {10, 640}, - {10, 642}, {10, 644}, {10, 646}, {10, 648}, {10, 650}, {10, 652}, - {10, 654}, {10, 656}, {10, 658}, {10, 660}, {10, 662}, {10, 664}, - {10, 666}, {10, 668}, {10, 670}, {10, 672}, {10, 674}, {10, 676}, - {10, 678}, {10, 680}, {10, 682}, {10, 684}, {10, 686}, {10, 688}, - {10, 690}, {10, 692}, {10, 694}, {10, 696}, {10, 698}, {10, 700}, - {10, 702}, {10, 704}, {10, 706}, {10, 708}, {10, 710}, {10, 712}, - {10, 714}, {10, 716}, {10, 718}, {10, 720}, {10, 722}, {10, 724}, - {10, 726}, {10, 728}, {10, 730}, {10, 732}, {10, 734}, {10, 736}, - {10, 738}, {10, 740}, {10, 742}, {10, 744}, {10, 746}, {10, 748}, - {10, 750}, {10, 752}, {10, 754}, {10, 756}, {10, 758}, {10, 760}, - {10, 762}, {10, 764}, {10, 766}, {10, 768}, {10, 770}, {10, 772}, - {10, 774}, {10, 776}, {10, 778}, {10, 780}, {10, 782}, {10, 784}, - {10, 786}, {10, 788}, {10, 790}, {10, 792}, {10, 794}, {10, 796}, - {10, 798}, {10, 800}, {10, 802}, {10, 804}, {10, 806}, {10, 808}, - {10, 810}, {10, 812}, {10, 814}, {10, 816}, {10, 818}, {10, 820}, - {10, 822}, {10, 824}, {10, 826}, {10, 828}, {10, 830}, {10, 832}, - {10, 834}, {10, 836}, {10, 838}, {10, 840}, {10, 842}, {10, 844}, - {10, 846}, {10, 848}, {10, 850}, {10, 852}, {10, 854}, {10, 856}, - {10, 858}, {10, 860}, {10, 862}, {10, 864}, {10, 866}, {10, 868}, - {10, 870}, {10, 872}, {10, 874}, {10, 876}, {10, 878}, {10, 880}, - {10, 882}, {10, 884}, {10, 886}, {10, 888}, {10, 890}, {10, 892}, - {10, 894}, {10, 896}, {10, 898}, {10, 900}, {10, 902}, {10, 904}, - {10, 906}, {10, 908}, {10, 910}, {10, 912}, {10, 914}, {10, 916}, - {10, 918}, {10, 920}, {10, 922}, {10, 924}, {10, 926}, {10, 928}, - {10, 930}, {10, 932}, {10, 934}, {10, 936}, {10, 938}, {10, 940}, - {10, 942}, {10, 944}, {10, 946}, {10, 948}, {10, 950}, {10, 952}, - {10, 954}, {10, 956}, {10, 958}, {10, 960}, {10, 962}, {10, 964}, - {10, 966}, {10, 968}, {10, 970}, {10, 972}, {10, 974}, {10, 976}, - {10, 978}, {10, 980}, {10, 982}, {10, 984}, {10, 986}, {10, 988}, - {10, 990}, {10, 992}, {10, 994}, {10, 996}, {10, 998}, {10, 1000}, - {10, 1002}, {10, 1004}, {10, 1006}, {10, 1008}, {10, 1010}, {10, 1012}, - {10, 1014}, {10, 1016}, {10, 1018}, {10, 1020}, {10, 1022}, {10, 1024}, - {10, 1026}, {10, 1028}, {10, 1030}, {10, 1032}, {10, 1034}, {10, 1036}, - {10, 1038}, {10, 1040}, {10, 1042}, {10, 1044}, {10, 1046}, {10, 1048}, - {10, 1050}, {10, 1052}, {10, 1054}, {10, 1056}, {10, 1058}, {10, 1060}, - {10, 1062}, {10, 1064}, {10, 1066}, {10, 1068}, {10, 1070}, {10, 1072}, - {10, 1074}, {10, 1076}, {10, 1078}, {10, 1080}, {10, 1082}, {10, 1084}, - {10, 1086}, {10, 1088}, {10, 1090}, {10, 1092}, {10, 1094}, {10, 1096}, - {10, 1098}, {10, 1100}, {10, 1102}, {10, 1104}, {10, 1106}, {10, 1108}, - {10, 1110}, {10, 1112}, {10, 1114}, {10, 1116}, {10, 1118}, {10, 1120}, - {10, 1122}, {10, 1124}, {10, 1126}, {10, 1128}, {10, 1130}, {10, 1132}, - {10, 1134}, {10, 1136}, {10, 1138}, {10, 1140}, {10, 1142}, {10, 1144}, - {10, 1146}, {10, 1148}, {10, 1150}, {10, 1152}, {10, 1154}, {10, 1156}, - {10, 1158}, {10, 1160}, {10, 1162}, {10, 1164}, {10, 1166}, {10, 1168}, - {10, 1170}, {10, 1172}, {10, 1174}, {10, 1176}, {10, 1178}, {10, 1180}, - {10, 1182}, {10, 1184}, {10, 1186}, {10, 1188}, {10, 1190}, {10, 1192}, - {10, 1194}, {10, 1196}, {10, 1198}, {10, 1200}, {10, 1202}, {10, 1204}, - {10, 1206}, {10, 1208}, {10, 1210}, {10, 1212}, {10, 1214}, {10, 1216}, - {10, 1218}, {10, 1220}, {10, 1222}, {10, 1224}, {10, 1226}, {10, 1228}, - {10, 1230}, {10, 1232}, {10, 1234}, {10, 1236}, {10, 1238}, {10, 1240}, - {10, 1242}, {10, 1244}, {10, 1246}, {10, 1248}, {10, 1250}, {10, 1252}, - {10, 1254}, {10, 1256}, {10, 1258}, {10, 1260}, {10, 1262}, {10, 1264}, - {10, 1266}, {10, 1268}, {10, 1270}, {10, 1272}, {10, 1274}, {10, 1276}, - {10, 1278}, {10, 1280}, {10, 1282}, {10, 1284}, {10, 1286}, {10, 1288}, - {10, 1290}, {10, 1292}, {10, 1294}, {10, 1296}, {10, 1298}, {10, 1300}, - {10, 1302}, {10, 1304}, {10, 1306}, {10, 1308}, {10, 1310}, {10, 1312}, - {10, 1314}, {10, 1316}, {10, 1318}, {10, 1320}, {10, 1322}, {10, 1324}, - {10, 1326}, {10, 1328}, {10, 1330}, {10, 1332}, {10, 1334}, {10, 1336}, - {10, 1338}, {10, 1340}, {10, 1342}, {10, 1344}, {10, 1346}, {10, 1348}, - {10, 1350}, {10, 1352}, {10, 1354}, {10, 1356}, {10, 1358}, {10, 1360}, - {10, 1362}, {10, 1364}, {10, 1366}, {10, 1368}, {10, 1370}, {10, 1372}, - {10, 1374}, {10, 1376}, {10, 1378}, {10, 1380}, {10, 1382}, {10, 1384}, - {10, 1386}, {10, 1388}, {10, 1390}, {10, 1392}, {10, 1394}, {10, 1396}, - {10, 1398}, {10, 1400}, {10, 1402}, {10, 1404}, {10, 1406}, {10, 1408}, - {10, 1410}, {10, 1412}, {10, 1414}, {10, 1416}, {10, 1418}, {10, 1420}, - {10, 1422}, {10, 1424}, {10, 1426}, {10, 1428}, {10, 1430}, {10, 1432}, - {10, 1434}, {10, 1436}, {10, 1438}, {10, 1440}, {10, 1442}, {10, 1444}, - {10, 1446}, {10, 1448}, {10, 1450}, {10, 1452}, {10, 1454}, {10, 1456}, - {10, 1458}, {10, 1460}, {10, 1462}, {10, 1464}, {10, 1466}, {10, 1468}, - {10, 1470}, {10, 1472}, {10, 1474}, {10, 1476}, {10, 1478}, {10, 1480}, - {10, 1482}, {10, 1484}, {10, 1486}, {10, 1488}, {10, 1490}, {10, 1492}, - {10, 1494}, {10, 1496}, {10, 1498}, {10, 1500}, {10, 1502}, {10, 1504}, - {10, 1506}, {10, 1508}, {10, 1510}, {10, 1512}, {10, 1514}, {10, 1516}, - {10, 1518}, {10, 1520}, {10, 1522}, {10, 1524}, {10, 1526}, {10, 1528}, - {10, 1530}, {10, 1532}, {10, 1534}, {10, 1536}, {10, 1538}, {10, 1540}, - {10, 1542}, {10, 1544}, {10, 1546}, {10, 1548}, {10, 1550}, {10, 1552}, - {10, 1554}, {10, 1556}, {10, 1558}, {10, 1560}, {10, 1562}, {10, 1564}, - {10, 1566}, {10, 1568}, {10, 1570}, {10, 1572}, {10, 1574}, {10, 1576}, - {10, 1578}, {10, 1580}, {10, 1582}, {10, 1584}, {10, 1586}, {10, 1588}, - {10, 1590}, {10, 1592}, {10, 1594}, {10, 1596}, {10, 1598}, {10, 1600}, - {10, 1602}, {10, 1604}, {10, 1606}, {10, 1608}, {10, 1610}, {10, 1612}, - {10, 1614}, {10, 1616}, {10, 1618}, {10, 1620}, {10, 1622}, {10, 1624}, - {10, 1626}, {10, 1628}, {10, 1630}, {10, 1632}, {10, 1634}, {10, 1636}, - {10, 1638}, {10, 1640}, {10, 1642}, {10, 1644}, {10, 1646}, {10, 1648}, - {10, 1650}, {10, 1652}, {10, 1654}, {10, 1656}, {10, 1658}, {10, 1660}, - {10, 1662}, {10, 1664}, {10, 1666}, {10, 1668}, {10, 1670}, {10, 1672}, - {10, 1674}, {10, 1676}, {10, 1678}, {10, 1680}, {10, 1682}, {10, 1684}, - {10, 1686}, {10, 1688}, {10, 1690}, {10, 1692}, {10, 1694}, {10, 1696}, - {10, 1698}, {10, 1700}, {10, 1702}, {10, 1704}, {10, 1706}, {10, 1708}, - {10, 1710}, {10, 1712}, {10, 1714}, {10, 1716}, {10, 1718}, {10, 1720}, - {10, 1722}, {10, 1724}, {10, 1726}, {10, 1728}, {10, 1730}, {10, 1732}, - {10, 1734}, {10, 1736}, {10, 1738}, {10, 1740}, {10, 1742}, {10, 1744}, - {10, 1746}, {10, 1748}, {10, 1750}, {10, 1752}, {10, 1754}, {10, 1756}, - {10, 1758}, {10, 1760}, {10, 1762}, {10, 1764}, {10, 1766}, {10, 1768}, - {10, 1770}, {10, 1772}, {10, 1774}, {10, 1776}, {10, 1778}, {10, 1780}, - {10, 1782}, {10, 1784}, {10, 1786}, {10, 1788}, {10, 1790}, {10, 1792}, - {10, 1794}, {10, 1796}, {10, 1798}, {10, 1800}, {10, 1802}, {10, 1804}, - {10, 1806}, {10, 1808}, {10, 1810}, {10, 1812}, {10, 1814}, {10, 1816}, - {10, 1818}, {10, 1820}, {10, 1822}, {10, 1824}, {10, 1826}, {10, 1828}, - {10, 1830}, {10, 1832}, {10, 1834}, {10, 1836}, {10, 1838}, {10, 1840}, - {10, 1842}, {10, 1844}, {10, 1846}, {10, 1848}, {10, 1850}, {10, 1852}, - {10, 1854}, {10, 1856}, {10, 1858}, {10, 1860}, {10, 1862}, {10, 1864}, - {10, 1866}, {10, 1868}, {10, 1870}, {10, 1872}, {10, 1874}, {10, 1876}, - {10, 1878}, {10, 1880}, {10, 1882}, {10, 1884}, {10, 1886}, {10, 1888}, - {10, 1890}, {10, 1892}, {10, 1894}, {10, 1896}, {10, 1898}, {10, 1900}, - {10, 1902}, {10, 1904}, {10, 1906}, {10, 1908}, {10, 1910}, {10, 1912}, - {10, 1914}, {10, 1916}, {10, 1918}, {10, 1920}, {10, 1922}, {10, 1924}, - {10, 1926}, {10, 1928}, {10, 1930}, {10, 1932}, {10, 1934}, {10, 1936}, - {10, 1938}, {10, 1940}, {10, 1942}, {10, 1944}, {10, 1946}, {10, 1948}, - {10, 1950}, {10, 1952}, {10, 1954}, {10, 1956}, {10, 1958}, {10, 1960}, - {10, 1962}, {10, 1964}, {10, 1966}, {10, 1968}, {10, 1970}, {10, 1972}, - {10, 1974}, {10, 1976}, {10, 1978}, {10, 1980}, {10, 1982}, {10, 1984}, - {10, 1986}, {10, 1988}, {10, 1990}, {10, 1992}, {10, 1994}, {10, 1996}, - {10, 1998}, {10, 2000}, {10, 2002}, {10, 2004}, {10, 2006}, {10, 2008}, - {10, 2010}, {10, 2012}, {10, 2014}, {10, 2016}, {10, 2018}, {10, 2020}, - {10, 2022}, {10, 2024}, {10, 2026}, {10, 2028}, {10, 2030}, {10, 2032}, - {10, 2034}, {10, 2036}, {10, 2038}, {10, 2040}, {10, 2042}, {10, 2044}, - {10, 2046}, {10, 2048}, {10, 2050}, {10, 2052}, {10, 2054}, {10, 2056}, - {10, 2058}, {10, 2060}, {10, 2062}, {10, 2064}, {10, 2066}, {10, 2068}, - {10, 2070}, {10, 2072}, {10, 2074}, {10, 2076}, {10, 2078}, {10, 2080}, - {10, 2082}, {10, 2084}, {10, 2086}, {10, 2088}, {10, 2090}, {10, 2092}, - {10, 2094}, {10, 2096}, {10, 2098}, {10, 2100}, {10, 2102}, {10, 2104}, - {10, 2106}, {10, 2108}, {10, 2110}, {10, 2112}, {10, 2114}, {10, 2116}, - {10, 2118}, {10, 2120}, {10, 2122}, {10, 2124}, {10, 2126}, {10, 2128}, - {10, 2130}, {10, 2132}, {10, 2134}, {10, 2136}, {10, 2138}, {10, 2140}, - {10, 2142}, {10, 2144}, {10, 2146}, {10, 2148}, {10, 2150}, {10, 2152}, - {10, 2154}, {10, 2156}, {10, 2158}, {10, 2160}, {10, 2162}, {10, 2164}, - {10, 2166}, {10, 2168}, {10, 2170}, {10, 2172}, {10, 2174}, {10, 2176}, - {10, 2178}, {10, 2180}, {10, 2182}, {10, 2184}, {10, 2186}, {10, 2188}, - {10, 2190}, {10, 2192}, {10, 2194}, {10, 2196}, {10, 2198}, {10, 2200}, - {10, 2202}, {10, 2204}, {10, 2206}, {10, 2208}, {10, 2210}, {10, 2212}, - {10, 2214}, {10, 2216}, {10, 2218}, {10, 2220}, {10, 2222}, {10, 2224}, - {10, 2226}, {10, 2228}, {10, 2230}, {10, 2232}, {10, 2234}, {10, 2236}, - {10, 2238}, {10, 2240}, {10, 2242}, {10, 2244}, {10, 2246}, {10, 2248}, - {10, 2250}, {10, 2252}, {10, 2254}, {10, 2256}, {10, 2258}, {10, 2260}, - {10, 2262}, {10, 2264}, {10, 2266}, {10, 2268}, {10, 2270}, {10, 2272}, - {10, 2274}, {10, 2276}, {10, 2278}, {10, 2280}, {10, 2282}, {10, 2284}, - {10, 2286}, {10, 2288}, {10, 2290}, {10, 2292}, {10, 2294}, {10, 2296}, - {10, 2298}, {10, 2300}, {10, 2302}, {10, 2304}, {10, 2306}, {10, 2308}, - {10, 2310}, {10, 2312}, {10, 2314}, {10, 2316}, {10, 2318}, {10, 2320}, - {10, 2322}, {10, 2324}, {10, 2326}, {10, 2328}, {10, 2330}, {10, 2332}, - {10, 2334}, {10, 2336}, {10, 2338}, {10, 2340}, {10, 2342}, {10, 2344}, - {10, 2346}, {10, 2348}, {10, 2350}, {10, 2352}, {10, 2354}, {10, 2356}, - {10, 2358}, {10, 2360}, {10, 2362}, {10, 2364}, {10, 2366}, {10, 2368}, - {10, 2370}, {10, 2372}, {10, 2374}, {10, 2376}, {10, 2378}, {10, 2380}, - {10, 2382}, {10, 2384}, {10, 2386}, {10, 2388}, {10, 2390}, {10, 2392}, - {10, 2394}, {10, 2396}, {10, 2398}, {10, 2400}, {10, 2402}, {10, 2404}, - {10, 2406}, {10, 2408}, {10, 2410}, {10, 2412}, {10, 2414}, {10, 2416}, - {10, 2418}, {10, 2420}, {10, 2422}, {10, 2424}, {10, 2426}, {10, 2428}, - {10, 2430}, {10, 2432}, {10, 2434}, {10, 2436}, {10, 2438}, {10, 2440}, - {10, 2442}, {10, 2444}, {10, 2446}, {10, 2448}, {10, 2450}, {10, 2452}, - {10, 2454}, {10, 2456}, {10, 2458}, {10, 2460}, {10, 2462}, {10, 2464}, - {10, 2466}, {10, 2468}, {10, 2470}, {10, 2472}, {10, 2474}, {10, 2476}, - {10, 2478}, {10, 2480}, {10, 2482}, {10, 2484}, {10, 2486}, {10, 2488}, - {10, 2490}, {10, 2492}, {10, 2494}, {10, 2496}, {10, 2498}, {10, 2500}, - {10, 2502}, {10, 2504}, {10, 2506}, {10, 2508}, {10, 2510}, {10, 2512}, - {10, 2514}, {10, 2516}, {10, 2518}, {10, 2520}, {10, 2522}, {10, 2524}, - {10, 2526}, {10, 2528}, {10, 2530}, {10, 2532}, {10, 2534}, {10, 2536}, - {10, 2538}, {10, 2540}, {10, 2542}, {10, 2544}, {10, 2546}, {10, 2548}, - {10, 2550}, {10, 2552}, {10, 2554}, {10, 2556}, {10, 2558}, {10, 2560}, - {10, 2562}, {10, 2564}, {10, 2566}, {10, 2568}, {10, 2570}, {10, 2572}, - {10, 2574}, {10, 2576}, {10, 2578}, {10, 2580}, {10, 2582}, {10, 2584}, - {10, 2586}, {10, 2588}, {10, 2590}, {10, 2592}, {10, 2594}, {10, 2596}, - {10, 2598}, {10, 2600}, {10, 2602}, {10, 2604}, {10, 2606}, {10, 2608}, - {10, 2610}, {10, 2612}, {10, 2614}, {10, 2616}, {10, 2618}, {10, 2620}, - {10, 2622}, {10, 2624}, {10, 2626}, {10, 2628}, {10, 2630}, {10, 2632}, - {10, 2634}, {10, 2636}, {10, 2638}, {10, 2640}, {10, 2642}, {10, 2644}, - {10, 2646}, {10, 2648}, {10, 2650}, {10, 2652}, {10, 2654}, {10, 2656}, - {10, 2658}, {10, 2660}, {10, 2662}, {10, 2664}, {10, 2666}, {10, 2668}, - {10, 2670}, {10, 2672}, {10, 2674}, {10, 2676}, {10, 2678}, {10, 2680}, - {10, 2682}, {10, 2684}, {10, 2686}, {10, 2688}, {10, 2690}, {10, 2692}, - {10, 2694}, {10, 2696}, {10, 2698}, {10, 2700}, {10, 2702}, {10, 2704}, - {10, 2706}, {10, 2708}, {10, 2710}, {10, 2712}, {10, 2714}, {10, 2716}, - {10, 2718}, {10, 2720}, {10, 2722}, {10, 2724}, {10, 2726}, {10, 2728}, - {10, 2730}, {10, 2732}, {10, 2734}, {10, 2736}, {10, 2738}, {10, 2740}, - {10, 2742}, {10, 2744}, {10, 2746}, {10, 2748}, {10, 2750}, {10, 2752}, - {10, 2754}, {10, 2756}, {10, 2758}, {10, 2760}, {10, 2762}, {10, 2764}, - {10, 2766}, {10, 2768}, {10, 2770}, {10, 2772}, {10, 2774}, {10, 2776}, - {10, 2778}, {10, 2780}, {10, 2782}, {10, 2784}, {10, 2786}, {10, 2788}, - {10, 2790}, {10, 2792}, {10, 2794}, {10, 2796}, {10, 2798}, {10, 2800}, - {10, 2802}, {10, 2804}, {10, 2806}, {10, 2808}, {10, 2810}, {10, 2812}, - {10, 2814}, {10, 2816}, {10, 2818}, {10, 2820}, {10, 2822}, {10, 2824}, - {10, 2826}, {10, 2828}, {10, 2830}, {10, 2832}, {10, 2834}, {10, 2836}, - {10, 2838}, {10, 2840}, {10, 2842}, {10, 2844}, {10, 2846}, {10, 2848}, - {10, 2850}, {10, 2852}, {10, 2854}, {10, 2856}, {10, 2858}, {10, 2860}, - {10, 2862}, {10, 2864}, {10, 2866}, {10, 2868}, {10, 2870}, {10, 2872}, - {10, 2874}, {10, 2876}, {10, 2878}, {10, 2880}, {10, 2882}, {10, 2884}, - {10, 2886}, {10, 2888}, {10, 2890}, {10, 2892}, {10, 2894}, {10, 2896}, - {10, 2898}, {10, 2900}, {10, 2902}, {10, 2904}, {10, 2906}, {10, 2908}, - {10, 2910}, {10, 2912}, {10, 2914}, {10, 2916}, {10, 2918}, {10, 2920}, - {10, 2922}, {10, 2924}, {10, 2926}, {10, 2928}, {10, 2930}, {10, 2932}, - {10, 2934}, {10, 2936}, {10, 2938}, {10, 2940}, {10, 2942}, {10, 2944}, - {10, 2946}, {10, 2948}, {10, 2950}, {10, 2952}, {10, 2954}, {10, 2956}, - {10, 2958}, {10, 2960}, {10, 2962}, {10, 2964}, {10, 2966}, {10, 2968}, - {10, 2970}, {10, 2972}, {10, 2974}, {10, 2976}, {10, 2978}, {10, 2980}, - {10, 2982}, {10, 2984}, {10, 2986}, {10, 2988}, {10, 2990}, {10, 2992}, - {10, 2994}, {10, 2996}, {10, 2998}, {10, 3000}, {10, 3002}, {10, 3004}, - {10, 3006}, {10, 3008}, {10, 3010}, {10, 3012}, {10, 3014}, {10, 3016}, - {10, 3018}, {10, 3020}, {10, 3022}, {10, 3024}, {10, 3026}, {10, 3028}, - {10, 3030}, {10, 3032}, {10, 3034}, {10, 3036}, {10, 3038}, {10, 3040}, - {10, 3042}, {10, 3044}, {10, 3046}, {10, 3048}, {10, 3050}, {10, 3052}, - {10, 3054}, {10, 3056}, {10, 3058}, {10, 3060}, {10, 3062}, {10, 3064}, - {10, 3066}, {10, 3068}, {10, 3070}, {10, 3072}, {10, 3074}, {10, 3076}, - {10, 3078}, {10, 3080}, {10, 3082}, {10, 3084}, {10, 3086}, {10, 3088}, - {10, 3090}, {10, 3092}, {10, 3094}, {10, 3096}, {10, 3098}, {10, 3100}, - {10, 3102}, {10, 3104}, {10, 3106}, {10, 3108}, {10, 3110}, {10, 3112}, - {10, 3114}, {10, 3116}, {10, 3118}, {10, 3120}, {10, 3122}, {10, 3124}, - {10, 3126}, {10, 3128}, {10, 3130}, {10, 3132}, {10, 3134}, {10, 3136}, - {10, 3138}, {10, 3140}, {10, 3142}, {10, 3144}, {10, 3146}, {10, 3148}, - {10, 3150}, {10, 3152}, {10, 3154}, {10, 3156}, {10, 3158}, {10, 3160}, - {10, 3162}, {10, 3164}, {10, 3166}, {10, 3168}, {10, 3170}, {10, 3172}, - {10, 3174}, {10, 3176}, {10, 3178}, {10, 3180}, {10, 3182}, {10, 3184}, - {10, 3186}, {10, 3188}, {10, 3190}, {10, 3192}, {10, 3194}, {10, 3196}, - {10, 3198}, {10, 3200}, {10, 3202}, {10, 3204}, {10, 3206}, {10, 3208}, - {10, 3210}, {10, 3212}, {10, 3214}, {10, 3216}, {10, 3218}, {10, 3220}, - {10, 3222}, {10, 3224}, {10, 3226}, {10, 3228}, {10, 3230}, {10, 3232}, - {10, 3234}, {10, 3236}, {10, 3238}, {10, 3240}, {10, 3242}, {10, 3244}, - {10, 3246}, {10, 3248}, {10, 3250}, {10, 3252}, {10, 3254}, {10, 3256}, - {10, 3258}, {10, 3260}, {10, 3262}, {10, 3264}, {10, 3266}, {10, 3268}, - {10, 3270}, {10, 3272}, {10, 3274}, {10, 3276}, {10, 3278}, {10, 3280}, - {10, 3282}, {10, 3284}, {10, 3286}, {10, 3288}, {10, 3290}, {10, 3292}, - {10, 3294}, {10, 3296}, {10, 3298}, {10, 3300}, {10, 3302}, {10, 3304}, - {10, 3306}, {10, 3308}, {10, 3310}, {10, 3312}, {10, 3314}, {10, 3316}, - {10, 3318}, {10, 3320}, {10, 3322}, {10, 3324}, {10, 3326}, {10, 3328}, - {10, 3330}, {10, 3332}, {10, 3334}, {10, 3336}, {10, 3338}, {10, 3340}, - {10, 3342}, {10, 3344}, {10, 3346}, {10, 3348}, {10, 3350}, {10, 3352}, - {10, 3354}, {10, 3356}, {10, 3358}, {10, 3360}, {10, 3362}, {10, 3364}, - {10, 3366}, {10, 3368}, {10, 3370}, {10, 3372}, {10, 3374}, {10, 3376}, - {10, 3378}, {10, 3380}, {10, 3382}, {10, 3384}, {10, 3386}, {10, 3388}, - {10, 3390}, {10, 3392}, {10, 3394}, {10, 3396}, {10, 3398}, {10, 3400}, - {10, 3402}, {10, 3404}, {10, 3406}, {10, 3408}, {10, 3410}, {10, 3412}, - {10, 3414}, {10, 3416}, {10, 3418}, {10, 3420}, {10, 3422}, {10, 3424}, - {10, 3426}, {10, 3428}, {10, 3430}, {10, 3432}, {10, 3434}, {10, 3436}, - {10, 3438}, {10, 3440}, {10, 3442}, {10, 3444}, {10, 3446}, {10, 3448}, - {10, 3450}, {10, 3452}, {10, 3454}, {10, 3456}, {10, 3458}, {10, 3460}, - {10, 3462}, {10, 3464}, {10, 3466}, {10, 3468}, {10, 3470}, {10, 3472}, - {10, 3474}, {10, 3476}, {10, 3478}, {10, 3480}, {10, 3482}, {10, 3484}, - {10, 3486}, {10, 3488}, {10, 3490}, {10, 3492}, {10, 3494}, {10, 3496}, - {10, 3498}, {10, 3500}, {10, 3502}, {10, 3504}, {10, 3506}, {10, 3508}, - {10, 3510}, {10, 3512}, {10, 3514}, {10, 3516}, {10, 3518}, {10, 3520}, - {10, 3522}, {10, 3524}, {10, 3526}, {10, 3528}, {10, 3530}, {10, 3532}, - {10, 3534}, {10, 3536}, {10, 3538}, {10, 3540}, {10, 3542}, {10, 3544}, - {10, 3546}, {10, 3548}, {10, 3550}, {10, 3552}, {10, 3554}, {10, 3556}, - {10, 3558}, {10, 3560}, {10, 3562}, {10, 3564}, {10, 3566}, {10, 3568}, - {10, 3570}, {10, 3572}, {10, 3574}, {10, 3576}, {10, 3578}, {10, 3580}, - {10, 3582}, {10, 3584}, {10, 3586}, {10, 3588}, {10, 3590}, {10, 3592}, - {10, 3594}, {10, 3596}, {10, 3598}, {10, 3600}, {10, 3602}, {10, 3604}, - {10, 3606}, {10, 3608}, {10, 3610}, {10, 3612}, {10, 3614}, {10, 3616}, - {10, 3618}, {10, 3620}, {10, 3622}, {10, 3624}, {10, 3626}, {10, 3628}, - {10, 3630}, {10, 3632}, {10, 3634}, {10, 3636}, {10, 3638}, {10, 3640}, - {10, 3642}, {10, 3644}, {10, 3646}, {10, 3648}, {10, 3650}, {10, 3652}, - {10, 3654}, {10, 3656}, {10, 3658}, {10, 3660}, {10, 3662}, {10, 3664}, - {10, 3666}, {10, 3668}, {10, 3670}, {10, 3672}, {10, 3674}, {10, 3676}, - {10, 3678}, {10, 3680}, {10, 3682}, {10, 3684}, {10, 3686}, {10, 3688}, - {10, 3690}, {10, 3692}, {10, 3694}, {10, 3696}, {10, 3698}, {10, 3700}, - {10, 3702}, {10, 3704}, {10, 3706}, {10, 3708}, {10, 3710}, {10, 3712}, - {10, 3714}, {10, 3716}, {10, 3718}, {10, 3720}, {10, 3722}, {10, 3724}, - {10, 3726}, {10, 3728}, {10, 3730}, {10, 3732}, {10, 3734}, {10, 3736}, - {10, 3738}, {10, 3740}, {10, 3742}, {10, 3744}, {10, 3746}, {10, 3748}, - {10, 3750}, {10, 3752}, {10, 3754}, {10, 3756}, {10, 3758}, {10, 3760}, - {10, 3762}, {10, 3764}, {10, 3766}, {10, 3768}, {10, 3770}, {10, 3772}, - {10, 3774}, {10, 3776}, {10, 3778}, {10, 3780}, {10, 3782}, {10, 3784}, - {10, 3786}, {10, 3788}, {10, 3790}, {10, 3792}, {10, 3794}, {10, 3796}, - {10, 3798}, {10, 3800}, {10, 3802}, {10, 3804}, {10, 3806}, {10, 3808}, - {10, 3810}, {10, 3812}, {10, 3814}, {10, 3816}, {10, 3818}, {10, 3820}, - {10, 3822}, {10, 3824}, {10, 3826}, {10, 3828}, {10, 3830}, {10, 3832}, - {10, 3834}, {10, 3836}, {10, 3838}, {10, 3840}, {10, 3842}, {10, 3844}, - {10, 3846}, {10, 3848}, {10, 3850}, {10, 3852}, {10, 3854}, {10, 3856}, - {10, 3858}, {10, 3860}, {10, 3862}, {10, 3864}, {10, 3866}, {10, 3868}, - {10, 3870}, {10, 3872}, {10, 3874}, {10, 3876}, {10, 3878}, {10, 3880}, - {10, 3882}, {10, 3884}, {10, 3886}, {10, 3888}, {10, 3890}, {10, 3892}, - {10, 3894}, {10, 3896}, {10, 3898}, {10, 3900}, {10, 3902}, {10, 3904}, - {10, 3906}, {10, 3908}, {10, 3910}, {10, 3912}, {10, 3914}, {10, 3916}, - {10, 3918}, {10, 3920}, {10, 3922}, {10, 3924}, {10, 3926}, {10, 3928}, - {10, 3930}, {10, 3932}, {10, 3934}, {10, 3936}, {10, 3938}, {10, 3940}, - {10, 3942}, {10, 3944}, {10, 3946}, {10, 3948}, {10, 3950}, {10, 3952}, - {10, 3954}, {10, 3956}, {10, 3958}, {10, 3960} -}; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_DCT_VALUE_TOKENS_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/defaultcoefcounts.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/defaultcoefcounts.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/defaultcoefcounts.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/defaultcoefcounts.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,236 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP8_ENCODER_DEFAULTCOEFCOUNTS_H_ -#define VP8_ENCODER_DEFAULTCOEFCOUNTS_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Generated file, included by entropy.c */ - -static const unsigned int default_coef_counts[BLOCK_TYPES] - [COEF_BANDS] - [PREV_COEF_CONTEXTS] - [MAX_ENTROPY_TOKENS] = -{ - - { - /* Block Type ( 0 ) */ - { - /* Coeff Band ( 0 ) */ - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - }, - { - /* Coeff Band ( 1 ) */ - {30190, 26544, 225, 24, 4, 0, 0, 0, 0, 0, 0, 4171593,}, - {26846, 25157, 1241, 130, 26, 6, 1, 0, 0, 0, 0, 149987,}, - {10484, 9538, 1006, 160, 36, 18, 0, 0, 0, 0, 0, 15104,}, - }, - { - /* Coeff Band ( 2 ) */ - {25842, 40456, 1126, 83, 11, 2, 0, 0, 0, 0, 0, 0,}, - {9338, 8010, 512, 73, 7, 3, 2, 0, 0, 0, 0, 43294,}, - {1047, 751, 149, 31, 13, 6, 1, 0, 0, 0, 0, 879,}, - }, - { - /* Coeff Band ( 3 ) */ - {26136, 9826, 252, 13, 0, 0, 0, 0, 0, 0, 0, 0,}, - {8134, 5574, 191, 14, 2, 0, 0, 0, 0, 0, 0, 35302,}, - { 605, 677, 116, 9, 1, 0, 0, 0, 0, 0, 0, 611,}, - }, - { - /* Coeff Band ( 4 ) */ - {10263, 15463, 283, 17, 0, 0, 0, 0, 0, 0, 0, 0,}, - {2773, 2191, 128, 9, 2, 2, 0, 0, 0, 0, 0, 10073,}, - { 134, 125, 32, 4, 0, 2, 0, 0, 0, 0, 0, 50,}, - }, - { - /* Coeff Band ( 5 ) */ - {10483, 2663, 23, 1, 0, 0, 0, 0, 0, 0, 0, 0,}, - {2137, 1251, 27, 1, 1, 0, 0, 0, 0, 0, 0, 14362,}, - { 116, 156, 14, 2, 1, 0, 0, 0, 0, 0, 0, 190,}, - }, - { - /* Coeff Band ( 6 ) */ - {40977, 27614, 412, 28, 0, 0, 0, 0, 0, 0, 0, 0,}, - {6113, 5213, 261, 22, 3, 0, 0, 0, 0, 0, 0, 26164,}, - { 382, 312, 50, 14, 2, 0, 0, 0, 0, 0, 0, 345,}, - }, - { - /* Coeff Band ( 7 ) */ - { 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 319,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,}, - }, - }, - { - /* Block Type ( 1 ) */ - { - /* Coeff Band ( 0 ) */ - {3268, 19382, 1043, 250, 93, 82, 49, 26, 17, 8, 25, 82289,}, - {8758, 32110, 5436, 1832, 827, 668, 420, 153, 24, 0, 3, 52914,}, - {9337, 23725, 8487, 3954, 2107, 1836, 1069, 399, 59, 0, 0, 18620,}, - }, - { - /* Coeff Band ( 1 ) */ - {12419, 8420, 452, 62, 9, 1, 0, 0, 0, 0, 0, 0,}, - {11715, 8705, 693, 92, 15, 7, 2, 0, 0, 0, 0, 53988,}, - {7603, 8585, 2306, 778, 270, 145, 39, 5, 0, 0, 0, 9136,}, - }, - { - /* Coeff Band ( 2 ) */ - {15938, 14335, 1207, 184, 55, 13, 4, 1, 0, 0, 0, 0,}, - {7415, 6829, 1138, 244, 71, 26, 7, 0, 0, 0, 0, 9980,}, - {1580, 1824, 655, 241, 89, 46, 10, 2, 0, 0, 0, 429,}, - }, - { - /* Coeff Band ( 3 ) */ - {19453, 5260, 201, 19, 0, 0, 0, 0, 0, 0, 0, 0,}, - {9173, 3758, 213, 22, 1, 1, 0, 0, 0, 0, 0, 9820,}, - {1689, 1277, 276, 51, 17, 4, 0, 0, 0, 0, 0, 679,}, - }, - { - /* Coeff Band ( 4 ) */ - {12076, 10667, 620, 85, 19, 9, 5, 0, 0, 0, 0, 0,}, - {4665, 3625, 423, 55, 19, 9, 0, 0, 0, 0, 0, 5127,}, - { 415, 440, 143, 34, 20, 7, 2, 0, 0, 0, 0, 101,}, - }, - { - /* Coeff Band ( 5 ) */ - {12183, 4846, 115, 11, 1, 0, 0, 0, 0, 0, 0, 0,}, - {4226, 3149, 177, 21, 2, 0, 0, 0, 0, 0, 0, 7157,}, - { 375, 621, 189, 51, 11, 4, 1, 0, 0, 0, 0, 198,}, - }, - { - /* Coeff Band ( 6 ) */ - {61658, 37743, 1203, 94, 10, 3, 0, 0, 0, 0, 0, 0,}, - {15514, 11563, 903, 111, 14, 5, 0, 0, 0, 0, 0, 25195,}, - { 929, 1077, 291, 78, 14, 7, 1, 0, 0, 0, 0, 507,}, - }, - { - /* Coeff Band ( 7 ) */ - { 0, 990, 15, 3, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 0, 412, 13, 0, 0, 0, 0, 0, 0, 0, 0, 1641,}, - { 0, 18, 7, 1, 0, 0, 0, 0, 0, 0, 0, 30,}, - }, - }, - { - /* Block Type ( 2 ) */ - { - /* Coeff Band ( 0 ) */ - { 953, 24519, 628, 120, 28, 12, 4, 0, 0, 0, 0, 2248798,}, - {1525, 25654, 2647, 617, 239, 143, 42, 5, 0, 0, 0, 66837,}, - {1180, 11011, 3001, 1237, 532, 448, 239, 54, 5, 0, 0, 7122,}, - }, - { - /* Coeff Band ( 1 ) */ - {1356, 2220, 67, 10, 4, 1, 0, 0, 0, 0, 0, 0,}, - {1450, 2544, 102, 18, 4, 3, 0, 0, 0, 0, 0, 57063,}, - {1182, 2110, 470, 130, 41, 21, 0, 0, 0, 0, 0, 6047,}, - }, - { - /* Coeff Band ( 2 ) */ - { 370, 3378, 200, 30, 5, 4, 1, 0, 0, 0, 0, 0,}, - { 293, 1006, 131, 29, 11, 0, 0, 0, 0, 0, 0, 5404,}, - { 114, 387, 98, 23, 4, 8, 1, 0, 0, 0, 0, 236,}, - }, - { - /* Coeff Band ( 3 ) */ - { 579, 194, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 395, 213, 5, 1, 0, 0, 0, 0, 0, 0, 0, 4157,}, - { 119, 122, 4, 0, 0, 0, 0, 0, 0, 0, 0, 300,}, - }, - { - /* Coeff Band ( 4 ) */ - { 38, 557, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 21, 114, 12, 1, 0, 0, 0, 0, 0, 0, 0, 427,}, - { 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,}, - }, - { - /* Coeff Band ( 5 ) */ - { 52, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 18, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 652,}, - { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30,}, - }, - { - /* Coeff Band ( 6 ) */ - { 640, 569, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 25, 77, 2, 0, 0, 0, 0, 0, 0, 0, 0, 517,}, - { 4, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,}, - }, - { - /* Coeff Band ( 7 ) */ - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - }, - }, - { - /* Block Type ( 3 ) */ - { - /* Coeff Band ( 0 ) */ - {2506, 20161, 2707, 767, 261, 178, 107, 30, 14, 3, 0, 100694,}, - {8806, 36478, 8817, 3268, 1280, 850, 401, 114, 42, 0, 0, 58572,}, - {11003, 27214, 11798, 5716, 2482, 2072, 1048, 175, 32, 0, 0, 19284,}, - }, - { - /* Coeff Band ( 1 ) */ - {9738, 11313, 959, 205, 70, 18, 11, 1, 0, 0, 0, 0,}, - {12628, 15085, 1507, 273, 52, 19, 9, 0, 0, 0, 0, 54280,}, - {10701, 15846, 5561, 1926, 813, 570, 249, 36, 0, 0, 0, 6460,}, - }, - { - /* Coeff Band ( 2 ) */ - {6781, 22539, 2784, 634, 182, 123, 20, 4, 0, 0, 0, 0,}, - {6263, 11544, 2649, 790, 259, 168, 27, 5, 0, 0, 0, 20539,}, - {3109, 4075, 2031, 896, 457, 386, 158, 29, 0, 0, 0, 1138,}, - }, - { - /* Coeff Band ( 3 ) */ - {11515, 4079, 465, 73, 5, 14, 2, 0, 0, 0, 0, 0,}, - {9361, 5834, 650, 96, 24, 8, 4, 0, 0, 0, 0, 22181,}, - {4343, 3974, 1360, 415, 132, 96, 14, 1, 0, 0, 0, 1267,}, - }, - { - /* Coeff Band ( 4 ) */ - {4787, 9297, 823, 168, 44, 12, 4, 0, 0, 0, 0, 0,}, - {3619, 4472, 719, 198, 60, 31, 3, 0, 0, 0, 0, 8401,}, - {1157, 1175, 483, 182, 88, 31, 8, 0, 0, 0, 0, 268,}, - }, - { - /* Coeff Band ( 5 ) */ - {8299, 1226, 32, 5, 1, 0, 0, 0, 0, 0, 0, 0,}, - {3502, 1568, 57, 4, 1, 1, 0, 0, 0, 0, 0, 9811,}, - {1055, 1070, 166, 29, 6, 1, 0, 0, 0, 0, 0, 527,}, - }, - { - /* Coeff Band ( 6 ) */ - {27414, 27927, 1989, 347, 69, 26, 0, 0, 0, 0, 0, 0,}, - {5876, 10074, 1574, 341, 91, 24, 4, 0, 0, 0, 0, 21954,}, - {1571, 2171, 778, 324, 124, 65, 16, 0, 0, 0, 0, 979,}, - }, - { - /* Coeff Band ( 7 ) */ - { 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 459,}, - { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13,}, - }, - }, -}; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_DEFAULTCOEFCOUNTS_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/denoising.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/denoising.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/denoising.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/denoising.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,745 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "denoising.h" - -#include "vp8/common/reconinter.h" -#include "vpx/vpx_integer.h" -#include "vpx_mem/vpx_mem.h" -#include "vp8_rtcd.h" - -static const unsigned int NOISE_MOTION_THRESHOLD = 25 * 25; -/* SSE_DIFF_THRESHOLD is selected as ~95% confidence assuming - * var(noise) ~= 100. - */ -static const unsigned int SSE_DIFF_THRESHOLD = 16 * 16 * 20; -static const unsigned int SSE_THRESHOLD = 16 * 16 * 40; -static const unsigned int SSE_THRESHOLD_HIGH = 16 * 16 * 60; - -/* - * The filter function was modified to reduce the computational complexity. - * Step 1: - * Instead of applying tap coefficients for each pixel, we calculated the - * pixel adjustments vs. pixel diff value ahead of time. - * adjustment = filtered_value - current_raw - * = (filter_coefficient * diff + 128) >> 8 - * where - * filter_coefficient = (255 << 8) / (256 + ((absdiff * 330) >> 3)); - * filter_coefficient += filter_coefficient / - * (3 + motion_magnitude_adjustment); - * filter_coefficient is clamped to 0 ~ 255. - * - * Step 2: - * The adjustment vs. diff curve becomes flat very quick when diff increases. - * This allowed us to use only several levels to approximate the curve without - * changing the filtering algorithm too much. - * The adjustments were further corrected by checking the motion magnitude. - * The levels used are: - * diff adjustment w/o motion correction adjustment w/ motion correction - * [-255, -16] -6 -7 - * [-15, -8] -4 -5 - * [-7, -4] -3 -4 - * [-3, 3] diff diff - * [4, 7] 3 4 - * [8, 15] 4 5 - * [16, 255] 6 7 - */ - -int vp8_denoiser_filter_c(unsigned char *mc_running_avg_y, int mc_avg_y_stride, - unsigned char *running_avg_y, int avg_y_stride, - unsigned char *sig, int sig_stride, - unsigned int motion_magnitude, - int increase_denoising) -{ - unsigned char *running_avg_y_start = running_avg_y; - unsigned char *sig_start = sig; - int sum_diff_thresh; - int r, c; - int sum_diff = 0; - int adj_val[3] = {3, 4, 6}; - int shift_inc1 = 0; - int shift_inc2 = 1; - int col_sum[16] = {0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0}; - /* If motion_magnitude is small, making the denoiser more aggressive by - * increasing the adjustment for each level. Add another increment for - * blocks that are labeled for increase denoising. */ - if (motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD) - { - if (increase_denoising) { - shift_inc1 = 1; - shift_inc2 = 2; - } - adj_val[0] += shift_inc2; - adj_val[1] += shift_inc2; - adj_val[2] += shift_inc2; - } - - for (r = 0; r < 16; ++r) - { - for (c = 0; c < 16; ++c) - { - int diff = 0; - int adjustment = 0; - int absdiff = 0; - - diff = mc_running_avg_y[c] - sig[c]; - absdiff = abs(diff); - - // When |diff| <= |3 + shift_inc1|, use pixel value from - // last denoised raw. - if (absdiff <= 3 + shift_inc1) - { - running_avg_y[c] = mc_running_avg_y[c]; - col_sum[c] += diff; - } - else - { - if (absdiff >= 4 + shift_inc1 && absdiff <= 7) - adjustment = adj_val[0]; - else if (absdiff >= 8 && absdiff <= 15) - adjustment = adj_val[1]; - else - adjustment = adj_val[2]; - - if (diff > 0) - { - if ((sig[c] + adjustment) > 255) - running_avg_y[c] = 255; - else - running_avg_y[c] = sig[c] + adjustment; - - col_sum[c] += adjustment; - } - else - { - if ((sig[c] - adjustment) < 0) - running_avg_y[c] = 0; - else - running_avg_y[c] = sig[c] - adjustment; - - col_sum[c] -= adjustment; - } - } - } - - /* Update pointers for next iteration. */ - sig += sig_stride; - mc_running_avg_y += mc_avg_y_stride; - running_avg_y += avg_y_stride; - } - - for (c = 0; c < 16; ++c) { - // Below we clip the value in the same way which SSE code use. - // When adopting aggressive denoiser, the adj_val for each pixel - // could be at most 8 (this is current max adjustment of the map). - // In SSE code, we calculate the sum of adj_val for - // the columns, so the sum could be upto 128(16 rows). However, - // the range of the value is -128 ~ 127 in SSE code, that's why - // we do this change in C code. - // We don't do this for UV denoiser, since there are only 8 rows, - // and max adjustments <= 8, so the sum of the columns will not - // exceed 64. - if (col_sum[c] >= 128) { - col_sum[c] = 127; - } - sum_diff += col_sum[c]; - } - - sum_diff_thresh= SUM_DIFF_THRESHOLD; - if (increase_denoising) sum_diff_thresh = SUM_DIFF_THRESHOLD_HIGH; - if (abs(sum_diff) > sum_diff_thresh) { - // Before returning to copy the block (i.e., apply no denoising), check - // if we can still apply some (weaker) temporal filtering to this block, - // that would otherwise not be denoised at all. Simplest is to apply - // an additional adjustment to running_avg_y to bring it closer to sig. - // The adjustment is capped by a maximum delta, and chosen such that - // in most cases the resulting sum_diff will be within the - // accceptable range given by sum_diff_thresh. - - // The delta is set by the excess of absolute pixel diff over threshold. - int delta = ((abs(sum_diff) - sum_diff_thresh) >> 8) + 1; - // Only apply the adjustment for max delta up to 3. - if (delta < 4) { - sig -= sig_stride * 16; - mc_running_avg_y -= mc_avg_y_stride * 16; - running_avg_y -= avg_y_stride * 16; - for (r = 0; r < 16; ++r) { - for (c = 0; c < 16; ++c) { - int diff = mc_running_avg_y[c] - sig[c]; - int adjustment = abs(diff); - if (adjustment > delta) - adjustment = delta; - if (diff > 0) { - // Bring denoised signal down. - if (running_avg_y[c] - adjustment < 0) - running_avg_y[c] = 0; - else - running_avg_y[c] = running_avg_y[c] - adjustment; - col_sum[c] -= adjustment; - } else if (diff < 0) { - // Bring denoised signal up. - if (running_avg_y[c] + adjustment > 255) - running_avg_y[c] = 255; - else - running_avg_y[c] = running_avg_y[c] + adjustment; - col_sum[c] += adjustment; - } - } - // TODO(marpan): Check here if abs(sum_diff) has gone below the - // threshold sum_diff_thresh, and if so, we can exit the row loop. - sig += sig_stride; - mc_running_avg_y += mc_avg_y_stride; - running_avg_y += avg_y_stride; - } - - sum_diff = 0; - for (c = 0; c < 16; ++c) { - if (col_sum[c] >= 128) { - col_sum[c] = 127; - } - sum_diff += col_sum[c]; - } - - if (abs(sum_diff) > sum_diff_thresh) - return COPY_BLOCK; - } else { - return COPY_BLOCK; - } - } - - vp8_copy_mem16x16(running_avg_y_start, avg_y_stride, sig_start, sig_stride); - return FILTER_BLOCK; -} - -int vp8_denoiser_filter_uv_c(unsigned char *mc_running_avg_uv, - int mc_avg_uv_stride, - unsigned char *running_avg_uv, - int avg_uv_stride, - unsigned char *sig, - int sig_stride, - unsigned int motion_magnitude, - int increase_denoising) { - unsigned char *running_avg_uv_start = running_avg_uv; - unsigned char *sig_start = sig; - int sum_diff_thresh; - int r, c; - int sum_diff = 0; - int sum_block = 0; - int adj_val[3] = {3, 4, 6}; - int shift_inc1 = 0; - int shift_inc2 = 1; - /* If motion_magnitude is small, making the denoiser more aggressive by - * increasing the adjustment for each level. Add another increment for - * blocks that are labeled for increase denoising. */ - if (motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD_UV) { - if (increase_denoising) { - shift_inc1 = 1; - shift_inc2 = 2; - } - adj_val[0] += shift_inc2; - adj_val[1] += shift_inc2; - adj_val[2] += shift_inc2; - } - - // Avoid denoising color signal if its close to average level. - for (r = 0; r < 8; ++r) { - for (c = 0; c < 8; ++c) { - sum_block += sig[c]; - } - sig += sig_stride; - } - if (abs(sum_block - (128 * 8 * 8)) < SUM_DIFF_FROM_AVG_THRESH_UV) { - return COPY_BLOCK; - } - - sig -= sig_stride * 8; - for (r = 0; r < 8; ++r) { - for (c = 0; c < 8; ++c) { - int diff = 0; - int adjustment = 0; - int absdiff = 0; - - diff = mc_running_avg_uv[c] - sig[c]; - absdiff = abs(diff); - - // When |diff| <= |3 + shift_inc1|, use pixel value from - // last denoised raw. - if (absdiff <= 3 + shift_inc1) { - running_avg_uv[c] = mc_running_avg_uv[c]; - sum_diff += diff; - } else { - if (absdiff >= 4 && absdiff <= 7) - adjustment = adj_val[0]; - else if (absdiff >= 8 && absdiff <= 15) - adjustment = adj_val[1]; - else - adjustment = adj_val[2]; - if (diff > 0) { - if ((sig[c] + adjustment) > 255) - running_avg_uv[c] = 255; - else - running_avg_uv[c] = sig[c] + adjustment; - sum_diff += adjustment; - } else { - if ((sig[c] - adjustment) < 0) - running_avg_uv[c] = 0; - else - running_avg_uv[c] = sig[c] - adjustment; - sum_diff -= adjustment; - } - } - } - /* Update pointers for next iteration. */ - sig += sig_stride; - mc_running_avg_uv += mc_avg_uv_stride; - running_avg_uv += avg_uv_stride; - } - - sum_diff_thresh= SUM_DIFF_THRESHOLD_UV; - if (increase_denoising) sum_diff_thresh = SUM_DIFF_THRESHOLD_HIGH_UV; - if (abs(sum_diff) > sum_diff_thresh) { - // Before returning to copy the block (i.e., apply no denoising), check - // if we can still apply some (weaker) temporal filtering to this block, - // that would otherwise not be denoised at all. Simplest is to apply - // an additional adjustment to running_avg_y to bring it closer to sig. - // The adjustment is capped by a maximum delta, and chosen such that - // in most cases the resulting sum_diff will be within the - // accceptable range given by sum_diff_thresh. - - // The delta is set by the excess of absolute pixel diff over threshold. - int delta = ((abs(sum_diff) - sum_diff_thresh) >> 8) + 1; - // Only apply the adjustment for max delta up to 3. - if (delta < 4) { - sig -= sig_stride * 8; - mc_running_avg_uv -= mc_avg_uv_stride * 8; - running_avg_uv -= avg_uv_stride * 8; - for (r = 0; r < 8; ++r) { - for (c = 0; c < 8; ++c) { - int diff = mc_running_avg_uv[c] - sig[c]; - int adjustment = abs(diff); - if (adjustment > delta) - adjustment = delta; - if (diff > 0) { - // Bring denoised signal down. - if (running_avg_uv[c] - adjustment < 0) - running_avg_uv[c] = 0; - else - running_avg_uv[c] = running_avg_uv[c] - adjustment; - sum_diff -= adjustment; - } else if (diff < 0) { - // Bring denoised signal up. - if (running_avg_uv[c] + adjustment > 255) - running_avg_uv[c] = 255; - else - running_avg_uv[c] = running_avg_uv[c] + adjustment; - sum_diff += adjustment; - } - } - // TODO(marpan): Check here if abs(sum_diff) has gone below the - // threshold sum_diff_thresh, and if so, we can exit the row loop. - sig += sig_stride; - mc_running_avg_uv += mc_avg_uv_stride; - running_avg_uv += avg_uv_stride; - } - if (abs(sum_diff) > sum_diff_thresh) - return COPY_BLOCK; - } else { - return COPY_BLOCK; - } - } - - vp8_copy_mem8x8(running_avg_uv_start, avg_uv_stride, sig_start, - sig_stride); - return FILTER_BLOCK; -} - -void vp8_denoiser_set_parameters(VP8_DENOISER *denoiser, int mode) { - assert(mode > 0); // Denoiser is allocated only if mode > 0. - if (mode == 1) { - denoiser->denoiser_mode = kDenoiserOnYOnly; - } else if (mode == 2) { - denoiser->denoiser_mode = kDenoiserOnYUV; - } else if (mode == 3) { - denoiser->denoiser_mode = kDenoiserOnYUVAggressive; - } else { - denoiser->denoiser_mode = kDenoiserOnYUV; - } - if (denoiser->denoiser_mode != kDenoiserOnYUVAggressive) { - denoiser->denoise_pars.scale_sse_thresh = 1; - denoiser->denoise_pars.scale_motion_thresh = 8; - denoiser->denoise_pars.scale_increase_filter = 0; - denoiser->denoise_pars.denoise_mv_bias = 95; - denoiser->denoise_pars.pickmode_mv_bias = 100; - denoiser->denoise_pars.qp_thresh = 0; - denoiser->denoise_pars.consec_zerolast = UINT_MAX; - denoiser->denoise_pars.spatial_blur = 0; - } else { - denoiser->denoise_pars.scale_sse_thresh = 2; - denoiser->denoise_pars.scale_motion_thresh = 16; - denoiser->denoise_pars.scale_increase_filter = 1; - denoiser->denoise_pars.denoise_mv_bias = 60; - denoiser->denoise_pars.pickmode_mv_bias = 75; - denoiser->denoise_pars.qp_thresh = 80; - denoiser->denoise_pars.consec_zerolast = 15; - denoiser->denoise_pars.spatial_blur = 0; - } -} - -int vp8_denoiser_allocate(VP8_DENOISER *denoiser, int width, int height, - int num_mb_rows, int num_mb_cols, int mode) -{ - int i; - assert(denoiser); - denoiser->num_mb_cols = num_mb_cols; - - for (i = 0; i < MAX_REF_FRAMES; i++) - { - denoiser->yv12_running_avg[i].flags = 0; - - if (vp8_yv12_alloc_frame_buffer(&(denoiser->yv12_running_avg[i]), width, - height, VP8BORDERINPIXELS) - < 0) - { - vp8_denoiser_free(denoiser); - return 1; - } - vpx_memset(denoiser->yv12_running_avg[i].buffer_alloc, 0, - denoiser->yv12_running_avg[i].frame_size); - - } - denoiser->yv12_mc_running_avg.flags = 0; - - if (vp8_yv12_alloc_frame_buffer(&(denoiser->yv12_mc_running_avg), width, - height, VP8BORDERINPIXELS) < 0) - { - vp8_denoiser_free(denoiser); - return 1; - } - - vpx_memset(denoiser->yv12_mc_running_avg.buffer_alloc, 0, - denoiser->yv12_mc_running_avg.frame_size); - - if (vp8_yv12_alloc_frame_buffer(&denoiser->yv12_last_source, width, - height, VP8BORDERINPIXELS) < 0) { - vp8_denoiser_free(denoiser); - return 1; - } - vpx_memset(denoiser->yv12_last_source.buffer_alloc, 0, - denoiser->yv12_last_source.frame_size); - - denoiser->denoise_state = vpx_calloc((num_mb_rows * num_mb_cols), 1); - vpx_memset(denoiser->denoise_state, 0, (num_mb_rows * num_mb_cols)); - vp8_denoiser_set_parameters(denoiser, mode); - denoiser->nmse_source_diff = 0; - denoiser->nmse_source_diff_count = 0; - denoiser->qp_avg = 0; - // QP threshold below which we can go up to aggressive mode. - denoiser->qp_threshold_up = 80; - // QP threshold above which we can go back down to normal mode. - // For now keep this second threshold high, so not used currently. - denoiser->qp_threshold_down = 128; - // Bitrate thresholds and noise metric (nmse) thresholds for switching to - // aggressive mode. - // TODO(marpan): Adjust thresholds, including effect on resolution. - denoiser->bitrate_threshold = 400000; // (bits/sec). - denoiser->threshold_aggressive_mode = 80; - if (width * height > 1280 * 720) { - denoiser->bitrate_threshold = 3000000; - denoiser->threshold_aggressive_mode = 200; - } else if (width * height > 960 * 540) { - denoiser->bitrate_threshold = 1200000; - denoiser->threshold_aggressive_mode = 120; - } else if (width * height > 640 * 480) { - denoiser->bitrate_threshold = 600000; - denoiser->threshold_aggressive_mode = 100; - } - return 0; -} - - -void vp8_denoiser_free(VP8_DENOISER *denoiser) -{ - int i; - assert(denoiser); - - for (i = 0; i < MAX_REF_FRAMES ; i++) - { - vp8_yv12_de_alloc_frame_buffer(&denoiser->yv12_running_avg[i]); - } - vp8_yv12_de_alloc_frame_buffer(&denoiser->yv12_mc_running_avg); - vp8_yv12_de_alloc_frame_buffer(&denoiser->yv12_last_source); - vpx_free(denoiser->denoise_state); -} - -void vp8_denoiser_denoise_mb(VP8_DENOISER *denoiser, - MACROBLOCK *x, - unsigned int best_sse, - unsigned int zero_mv_sse, - int recon_yoffset, - int recon_uvoffset, - loop_filter_info_n *lfi_n, - int mb_row, - int mb_col, - int block_index) - -{ - int mv_row; - int mv_col; - unsigned int motion_threshold; - unsigned int motion_magnitude2; - unsigned int sse_thresh; - int sse_diff_thresh = 0; - // Spatial loop filter: only applied selectively based on - // temporal filter state of block relative to top/left neighbors. - int apply_spatial_loop_filter = 1; - MV_REFERENCE_FRAME frame = x->best_reference_frame; - MV_REFERENCE_FRAME zero_frame = x->best_zeromv_reference_frame; - - enum vp8_denoiser_decision decision = FILTER_BLOCK; - enum vp8_denoiser_decision decision_u = COPY_BLOCK; - enum vp8_denoiser_decision decision_v = COPY_BLOCK; - - if (zero_frame) - { - YV12_BUFFER_CONFIG *src = &denoiser->yv12_running_avg[frame]; - YV12_BUFFER_CONFIG *dst = &denoiser->yv12_mc_running_avg; - YV12_BUFFER_CONFIG saved_pre,saved_dst; - MB_MODE_INFO saved_mbmi; - MACROBLOCKD *filter_xd = &x->e_mbd; - MB_MODE_INFO *mbmi = &filter_xd->mode_info_context->mbmi; - int sse_diff = 0; - // Bias on zero motion vector sse. - const int zero_bias = denoiser->denoise_pars.denoise_mv_bias; - zero_mv_sse = (unsigned int)((int64_t)zero_mv_sse * zero_bias / 100); - sse_diff = zero_mv_sse - best_sse; - - saved_mbmi = *mbmi; - - /* Use the best MV for the compensation. */ - mbmi->ref_frame = x->best_reference_frame; - mbmi->mode = x->best_sse_inter_mode; - mbmi->mv = x->best_sse_mv; - mbmi->need_to_clamp_mvs = x->need_to_clamp_best_mvs; - mv_col = x->best_sse_mv.as_mv.col; - mv_row = x->best_sse_mv.as_mv.row; - // Bias to zero_mv if small amount of motion. - // Note sse_diff_thresh is intialized to zero, so this ensures - // we will always choose zero_mv for denoising if - // zero_mv_see <= best_sse (i.e., sse_diff <= 0). - if ((unsigned int)(mv_row * mv_row + mv_col * mv_col) - <= NOISE_MOTION_THRESHOLD) - sse_diff_thresh = (int)SSE_DIFF_THRESHOLD; - - if (frame == INTRA_FRAME || - sse_diff <= sse_diff_thresh) - { - /* - * Handle intra blocks as referring to last frame with zero motion - * and let the absolute pixel difference affect the filter factor. - * Also consider small amount of motion as being random walk due - * to noise, if it doesn't mean that we get a much bigger error. - * Note that any changes to the mode info only affects the - * denoising. - */ - x->denoise_zeromv = 1; - mbmi->ref_frame = - x->best_zeromv_reference_frame; - - src = &denoiser->yv12_running_avg[zero_frame]; - - mbmi->mode = ZEROMV; - mbmi->mv.as_int = 0; - x->best_sse_inter_mode = ZEROMV; - x->best_sse_mv.as_int = 0; - best_sse = zero_mv_sse; - } - - saved_pre = filter_xd->pre; - saved_dst = filter_xd->dst; - - /* Compensate the running average. */ - filter_xd->pre.y_buffer = src->y_buffer + recon_yoffset; - filter_xd->pre.u_buffer = src->u_buffer + recon_uvoffset; - filter_xd->pre.v_buffer = src->v_buffer + recon_uvoffset; - /* Write the compensated running average to the destination buffer. */ - filter_xd->dst.y_buffer = dst->y_buffer + recon_yoffset; - filter_xd->dst.u_buffer = dst->u_buffer + recon_uvoffset; - filter_xd->dst.v_buffer = dst->v_buffer + recon_uvoffset; - - if (!x->skip) - { - vp8_build_inter_predictors_mb(filter_xd); - } - else - { - vp8_build_inter16x16_predictors_mb(filter_xd, - filter_xd->dst.y_buffer, - filter_xd->dst.u_buffer, - filter_xd->dst.v_buffer, - filter_xd->dst.y_stride, - filter_xd->dst.uv_stride); - } - filter_xd->pre = saved_pre; - filter_xd->dst = saved_dst; - *mbmi = saved_mbmi; - - } - - mv_row = x->best_sse_mv.as_mv.row; - mv_col = x->best_sse_mv.as_mv.col; - motion_magnitude2 = mv_row * mv_row + mv_col * mv_col; - motion_threshold = denoiser->denoise_pars.scale_motion_thresh * - NOISE_MOTION_THRESHOLD; - - // If block is considered to be skin area, lower the motion threshold. - // In current version set threshold = 1, so only denoise very low - // (i.e., zero) mv on skin. - if (x->is_skin) - motion_threshold = 1; - - if (motion_magnitude2 < - denoiser->denoise_pars.scale_increase_filter * NOISE_MOTION_THRESHOLD) - x->increase_denoising = 1; - - sse_thresh = denoiser->denoise_pars.scale_sse_thresh * SSE_THRESHOLD; - if (x->increase_denoising) - sse_thresh = denoiser->denoise_pars.scale_sse_thresh * SSE_THRESHOLD_HIGH; - - if (best_sse > sse_thresh || motion_magnitude2 > motion_threshold) - decision = COPY_BLOCK; - - if (decision == FILTER_BLOCK) - { - unsigned char *mc_running_avg_y = - denoiser->yv12_mc_running_avg.y_buffer + recon_yoffset; - int mc_avg_y_stride = denoiser->yv12_mc_running_avg.y_stride; - unsigned char *running_avg_y = - denoiser->yv12_running_avg[INTRA_FRAME].y_buffer + recon_yoffset; - int avg_y_stride = denoiser->yv12_running_avg[INTRA_FRAME].y_stride; - - /* Filter. */ - decision = vp8_denoiser_filter(mc_running_avg_y, mc_avg_y_stride, - running_avg_y, avg_y_stride, - x->thismb, 16, motion_magnitude2, - x->increase_denoising); - denoiser->denoise_state[block_index] = motion_magnitude2 > 0 ? - kFilterNonZeroMV : kFilterZeroMV; - // Only denoise UV for zero motion, and if y channel was denoised. - if (denoiser->denoiser_mode != kDenoiserOnYOnly && - motion_magnitude2 == 0 && - decision == FILTER_BLOCK) { - unsigned char *mc_running_avg_u = - denoiser->yv12_mc_running_avg.u_buffer + recon_uvoffset; - unsigned char *running_avg_u = - denoiser->yv12_running_avg[INTRA_FRAME].u_buffer + recon_uvoffset; - unsigned char *mc_running_avg_v = - denoiser->yv12_mc_running_avg.v_buffer + recon_uvoffset; - unsigned char *running_avg_v = - denoiser->yv12_running_avg[INTRA_FRAME].v_buffer + recon_uvoffset; - int mc_avg_uv_stride = denoiser->yv12_mc_running_avg.uv_stride; - int avg_uv_stride = denoiser->yv12_running_avg[INTRA_FRAME].uv_stride; - int signal_stride = x->block[16].src_stride; - decision_u = - vp8_denoiser_filter_uv(mc_running_avg_u, mc_avg_uv_stride, - running_avg_u, avg_uv_stride, - x->block[16].src + *x->block[16].base_src, - signal_stride, motion_magnitude2, 0); - decision_v = - vp8_denoiser_filter_uv(mc_running_avg_v, mc_avg_uv_stride, - running_avg_v, avg_uv_stride, - x->block[20].src + *x->block[20].base_src, - signal_stride, motion_magnitude2, 0); - } - } - if (decision == COPY_BLOCK) - { - /* No filtering of this block; it differs too much from the predictor, - * or the motion vector magnitude is considered too big. - */ - x->denoise_zeromv = 0; - vp8_copy_mem16x16( - x->thismb, 16, - denoiser->yv12_running_avg[INTRA_FRAME].y_buffer + recon_yoffset, - denoiser->yv12_running_avg[INTRA_FRAME].y_stride); - denoiser->denoise_state[block_index] = kNoFilter; - } - if (denoiser->denoiser_mode != kDenoiserOnYOnly) { - if (decision_u == COPY_BLOCK) { - vp8_copy_mem8x8( - x->block[16].src + *x->block[16].base_src, x->block[16].src_stride, - denoiser->yv12_running_avg[INTRA_FRAME].u_buffer + recon_uvoffset, - denoiser->yv12_running_avg[INTRA_FRAME].uv_stride); - } - if (decision_v == COPY_BLOCK) { - vp8_copy_mem8x8( - x->block[20].src + *x->block[20].base_src, x->block[16].src_stride, - denoiser->yv12_running_avg[INTRA_FRAME].v_buffer + recon_uvoffset, - denoiser->yv12_running_avg[INTRA_FRAME].uv_stride); - } - } - // Option to selectively deblock the denoised signal, for y channel only. - if (apply_spatial_loop_filter) { - loop_filter_info lfi; - int apply_filter_col = 0; - int apply_filter_row = 0; - int apply_filter = 0; - int y_stride = denoiser->yv12_running_avg[INTRA_FRAME].y_stride; - int uv_stride =denoiser->yv12_running_avg[INTRA_FRAME].uv_stride; - - // Fix filter level to some nominal value for now. - int filter_level = 48; - - int hev_index = lfi_n->hev_thr_lut[INTER_FRAME][filter_level]; - lfi.mblim = lfi_n->mblim[filter_level]; - lfi.blim = lfi_n->blim[filter_level]; - lfi.lim = lfi_n->lim[filter_level]; - lfi.hev_thr = lfi_n->hev_thr[hev_index]; - - // Apply filter if there is a difference in the denoiser filter state - // between the current and left/top block, or if non-zero motion vector - // is used for the motion-compensated filtering. - if (mb_col > 0) { - apply_filter_col = !((denoiser->denoise_state[block_index] == - denoiser->denoise_state[block_index - 1]) && - denoiser->denoise_state[block_index] != kFilterNonZeroMV); - if (apply_filter_col) { - // Filter left vertical edge. - apply_filter = 1; - vp8_loop_filter_mbv( - denoiser->yv12_running_avg[INTRA_FRAME].y_buffer + recon_yoffset, - NULL, NULL, y_stride, uv_stride, &lfi); - } - } - if (mb_row > 0) { - apply_filter_row = !((denoiser->denoise_state[block_index] == - denoiser->denoise_state[block_index - denoiser->num_mb_cols]) && - denoiser->denoise_state[block_index] != kFilterNonZeroMV); - if (apply_filter_row) { - // Filter top horizontal edge. - apply_filter = 1; - vp8_loop_filter_mbh( - denoiser->yv12_running_avg[INTRA_FRAME].y_buffer + recon_yoffset, - NULL, NULL, y_stride, uv_stride, &lfi); - } - } - if (apply_filter) { - // Update the signal block |x|. Pixel changes are only to top and/or - // left boundary pixels: can we avoid full block copy here. - vp8_copy_mem16x16( - denoiser->yv12_running_avg[INTRA_FRAME].y_buffer + recon_yoffset, - y_stride, x->thismb, 16); - } - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/denoising.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/denoising.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/denoising.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/denoising.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP8_ENCODER_DENOISING_H_ -#define VP8_ENCODER_DENOISING_H_ - -#include "block.h" -#include "vp8/common/loopfilter.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define SUM_DIFF_THRESHOLD (16 * 16 * 2) -#define SUM_DIFF_THRESHOLD_HIGH (600) // ~(16 * 16 * 1.5) -#define MOTION_MAGNITUDE_THRESHOLD (8*3) - -#define SUM_DIFF_THRESHOLD_UV (96) // (8 * 8 * 1.5) -#define SUM_DIFF_THRESHOLD_HIGH_UV (8 * 8 * 2) -#define SUM_DIFF_FROM_AVG_THRESH_UV (8 * 8 * 8) -#define MOTION_MAGNITUDE_THRESHOLD_UV (8*3) - -#define MAX_GF_ARF_DENOISE_RANGE (8) - -enum vp8_denoiser_decision -{ - COPY_BLOCK, - FILTER_BLOCK -}; - -enum vp8_denoiser_filter_state { - kNoFilter, - kFilterZeroMV, - kFilterNonZeroMV -}; - -enum vp8_denoiser_mode { - kDenoiserOff, - kDenoiserOnYOnly, - kDenoiserOnYUV, - kDenoiserOnYUVAggressive, - kDenoiserOnAdaptive -}; - -typedef struct { - // Scale factor on sse threshold above which no denoising is done. - unsigned int scale_sse_thresh; - // Scale factor on motion magnitude threshold above which no - // denoising is done. - unsigned int scale_motion_thresh; - // Scale factor on motion magnitude below which we increase the strength of - // the temporal filter (in function vp8_denoiser_filter). - unsigned int scale_increase_filter; - // Scale factor to bias to ZEROMV for denoising. - unsigned int denoise_mv_bias; - // Scale factor to bias to ZEROMV for coding mode selection. - unsigned int pickmode_mv_bias; - // Quantizer threshold below which we use the segmentation map to switch off - // loop filter for blocks that have been coded as ZEROMV-LAST a certain number - // (consec_zerolast) of consecutive frames. Note that the delta-QP is set to - // 0 when segmentation map is used for shutting off loop filter. - unsigned int qp_thresh; - // Threshold for number of consecutive frames for blocks coded as ZEROMV-LAST. - unsigned int consec_zerolast; - // Threshold for amount of spatial blur on Y channel. 0 means no spatial blur. - unsigned int spatial_blur; -} denoise_params; - -typedef struct vp8_denoiser -{ - YV12_BUFFER_CONFIG yv12_running_avg[MAX_REF_FRAMES]; - YV12_BUFFER_CONFIG yv12_mc_running_avg; - // TODO(marpan): Should remove yv12_last_source and use vp8_lookahead_peak. - YV12_BUFFER_CONFIG yv12_last_source; - unsigned char* denoise_state; - int num_mb_cols; - int denoiser_mode; - int threshold_aggressive_mode; - int nmse_source_diff; - int nmse_source_diff_count; - int qp_avg; - int qp_threshold_up; - int qp_threshold_down; - int bitrate_threshold; - denoise_params denoise_pars; -} VP8_DENOISER; - -int vp8_denoiser_allocate(VP8_DENOISER *denoiser, int width, int height, - int num_mb_rows, int num_mb_cols, int mode); - -void vp8_denoiser_free(VP8_DENOISER *denoiser); - -void vp8_denoiser_set_parameters(VP8_DENOISER *denoiser, int mode); - -void vp8_denoiser_denoise_mb(VP8_DENOISER *denoiser, - MACROBLOCK *x, - unsigned int best_sse, - unsigned int zero_mv_sse, - int recon_yoffset, - int recon_uvoffset, - loop_filter_info_n *lfi_n, - int mb_row, - int mb_col, - int block_index); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_DENOISING_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/encodeframe.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/encodeframe.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/encodeframe.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/encodeframe.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1424 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "encodemb.h" -#include "encodemv.h" -#include "vp8/common/common.h" -#include "onyx_int.h" -#include "vp8/common/extend.h" -#include "vp8/common/entropymode.h" -#include "vp8/common/quant_common.h" -#include "segmentation.h" -#include "vp8/common/setupintrarecon.h" -#include "encodeintra.h" -#include "vp8/common/reconinter.h" -#include "rdopt.h" -#include "pickinter.h" -#include "vp8/common/findnearmv.h" -#include -#include -#include "vp8/common/invtrans.h" -#include "vpx_ports/vpx_timer.h" -#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING -#include "bitstream.h" -#endif -#include "encodeframe.h" - -extern void vp8_stuff_mb(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t) ; -extern void vp8_calc_ref_frame_costs(int *ref_frame_cost, - int prob_intra, - int prob_last, - int prob_garf - ); -extern void vp8_convert_rfct_to_prob(VP8_COMP *const cpi); -extern void vp8cx_initialize_me_consts(VP8_COMP *cpi, int QIndex); -extern void vp8_auto_select_speed(VP8_COMP *cpi); -extern void vp8cx_init_mbrthread_data(VP8_COMP *cpi, - MACROBLOCK *x, - MB_ROW_COMP *mbr_ei, - int count); -static void adjust_act_zbin( VP8_COMP *cpi, MACROBLOCK *x ); - -#ifdef MODE_STATS -unsigned int inter_y_modes[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -unsigned int inter_uv_modes[4] = {0, 0, 0, 0}; -unsigned int inter_b_modes[15] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -unsigned int y_modes[5] = {0, 0, 0, 0, 0}; -unsigned int uv_modes[4] = {0, 0, 0, 0}; -unsigned int b_modes[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -#endif - - -/* activity_avg must be positive, or flat regions could get a zero weight - * (infinite lambda), which confounds analysis. - * This also avoids the need for divide by zero checks in - * vp8_activity_masking(). - */ -#define VP8_ACTIVITY_AVG_MIN (64) - -/* This is used as a reference when computing the source variance for the - * purposes of activity masking. - * Eventually this should be replaced by custom no-reference routines, - * which will be faster. - */ -static const unsigned char VP8_VAR_OFFS[16]= -{ - 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 -}; - - -/* Original activity measure from Tim T's code. */ -static unsigned int tt_activity_measure( VP8_COMP *cpi, MACROBLOCK *x ) -{ - unsigned int act; - unsigned int sse; - (void)cpi; - /* TODO: This could also be done over smaller areas (8x8), but that would - * require extensive changes elsewhere, as lambda is assumed to be fixed - * over an entire MB in most of the code. - * Another option is to compute four 8x8 variances, and pick a single - * lambda using a non-linear combination (e.g., the smallest, or second - * smallest, etc.). - */ - act = vp8_variance16x16(x->src.y_buffer, - x->src.y_stride, VP8_VAR_OFFS, 0, &sse); - act = act<<4; - - /* If the region is flat, lower the activity some more. */ - if (act < 8<<12) - act = act < 5<<12 ? act : 5<<12; - - return act; -} - -/* Stub for alternative experimental activity measures. */ -static unsigned int alt_activity_measure( VP8_COMP *cpi, - MACROBLOCK *x, int use_dc_pred ) -{ - return vp8_encode_intra(cpi,x, use_dc_pred); -} - - -/* Measure the activity of the current macroblock - * What we measure here is TBD so abstracted to this function - */ -#define ALT_ACT_MEASURE 1 -static unsigned int mb_activity_measure( VP8_COMP *cpi, MACROBLOCK *x, - int mb_row, int mb_col) -{ - unsigned int mb_activity; - - if ( ALT_ACT_MEASURE ) - { - int use_dc_pred = (mb_col || mb_row) && (!mb_col || !mb_row); - - /* Or use and alternative. */ - mb_activity = alt_activity_measure( cpi, x, use_dc_pred ); - } - else - { - /* Original activity measure from Tim T's code. */ - mb_activity = tt_activity_measure( cpi, x ); - } - - if ( mb_activity < VP8_ACTIVITY_AVG_MIN ) - mb_activity = VP8_ACTIVITY_AVG_MIN; - - return mb_activity; -} - -/* Calculate an "average" mb activity value for the frame */ -#define ACT_MEDIAN 0 -static void calc_av_activity( VP8_COMP *cpi, int64_t activity_sum ) -{ -#if ACT_MEDIAN - /* Find median: Simple n^2 algorithm for experimentation */ - { - unsigned int median; - unsigned int i,j; - unsigned int * sortlist; - unsigned int tmp; - - /* Create a list to sort to */ - CHECK_MEM_ERROR(sortlist, - vpx_calloc(sizeof(unsigned int), - cpi->common.MBs)); - - /* Copy map to sort list */ - vpx_memcpy( sortlist, cpi->mb_activity_map, - sizeof(unsigned int) * cpi->common.MBs ); - - - /* Ripple each value down to its correct position */ - for ( i = 1; i < cpi->common.MBs; i ++ ) - { - for ( j = i; j > 0; j -- ) - { - if ( sortlist[j] < sortlist[j-1] ) - { - /* Swap values */ - tmp = sortlist[j-1]; - sortlist[j-1] = sortlist[j]; - sortlist[j] = tmp; - } - else - break; - } - } - - /* Even number MBs so estimate median as mean of two either side. */ - median = ( 1 + sortlist[cpi->common.MBs >> 1] + - sortlist[(cpi->common.MBs >> 1) + 1] ) >> 1; - - cpi->activity_avg = median; - - vpx_free(sortlist); - } -#else - /* Simple mean for now */ - cpi->activity_avg = (unsigned int)(activity_sum/cpi->common.MBs); -#endif - - if (cpi->activity_avg < VP8_ACTIVITY_AVG_MIN) - cpi->activity_avg = VP8_ACTIVITY_AVG_MIN; - - /* Experimental code: return fixed value normalized for several clips */ - if ( ALT_ACT_MEASURE ) - cpi->activity_avg = 100000; -} - -#define USE_ACT_INDEX 0 -#define OUTPUT_NORM_ACT_STATS 0 - -#if USE_ACT_INDEX -/* Calculate and activity index for each mb */ -static void calc_activity_index( VP8_COMP *cpi, MACROBLOCK *x ) -{ - VP8_COMMON *const cm = & cpi->common; - int mb_row, mb_col; - - int64_t act; - int64_t a; - int64_t b; - -#if OUTPUT_NORM_ACT_STATS - FILE *f = fopen("norm_act.stt", "a"); - fprintf(f, "\n%12d\n", cpi->activity_avg ); -#endif - - /* Reset pointers to start of activity map */ - x->mb_activity_ptr = cpi->mb_activity_map; - - /* Calculate normalized mb activity number. */ - for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) - { - /* for each macroblock col in image */ - for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) - { - /* Read activity from the map */ - act = *(x->mb_activity_ptr); - - /* Calculate a normalized activity number */ - a = act + 4*cpi->activity_avg; - b = 4*act + cpi->activity_avg; - - if ( b >= a ) - *(x->activity_ptr) = (int)((b + (a>>1))/a) - 1; - else - *(x->activity_ptr) = 1 - (int)((a + (b>>1))/b); - -#if OUTPUT_NORM_ACT_STATS - fprintf(f, " %6d", *(x->mb_activity_ptr)); -#endif - /* Increment activity map pointers */ - x->mb_activity_ptr++; - } - -#if OUTPUT_NORM_ACT_STATS - fprintf(f, "\n"); -#endif - - } - -#if OUTPUT_NORM_ACT_STATS - fclose(f); -#endif - -} -#endif - -/* Loop through all MBs. Note activity of each, average activity and - * calculate a normalized activity for each - */ -static void build_activity_map( VP8_COMP *cpi ) -{ - MACROBLOCK *const x = & cpi->mb; - MACROBLOCKD *xd = &x->e_mbd; - VP8_COMMON *const cm = & cpi->common; - -#if ALT_ACT_MEASURE - YV12_BUFFER_CONFIG *new_yv12 = &cm->yv12_fb[cm->new_fb_idx]; - int recon_yoffset; - int recon_y_stride = new_yv12->y_stride; -#endif - - int mb_row, mb_col; - unsigned int mb_activity; - int64_t activity_sum = 0; - - /* for each macroblock row in image */ - for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) - { -#if ALT_ACT_MEASURE - /* reset above block coeffs */ - xd->up_available = (mb_row != 0); - recon_yoffset = (mb_row * recon_y_stride * 16); -#endif - /* for each macroblock col in image */ - for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) - { -#if ALT_ACT_MEASURE - xd->dst.y_buffer = new_yv12->y_buffer + recon_yoffset; - xd->left_available = (mb_col != 0); - recon_yoffset += 16; -#endif - /* Copy current mb to a buffer */ - vp8_copy_mem16x16(x->src.y_buffer, x->src.y_stride, x->thismb, 16); - - /* measure activity */ - mb_activity = mb_activity_measure( cpi, x, mb_row, mb_col ); - - /* Keep frame sum */ - activity_sum += mb_activity; - - /* Store MB level activity details. */ - *x->mb_activity_ptr = mb_activity; - - /* Increment activity map pointer */ - x->mb_activity_ptr++; - - /* adjust to the next column of source macroblocks */ - x->src.y_buffer += 16; - } - - - /* adjust to the next row of mbs */ - x->src.y_buffer += 16 * x->src.y_stride - 16 * cm->mb_cols; - -#if ALT_ACT_MEASURE - /* extend the recon for intra prediction */ - vp8_extend_mb_row(new_yv12, xd->dst.y_buffer + 16, - xd->dst.u_buffer + 8, xd->dst.v_buffer + 8); -#endif - - } - - /* Calculate an "average" MB activity */ - calc_av_activity(cpi, activity_sum); - -#if USE_ACT_INDEX - /* Calculate an activity index number of each mb */ - calc_activity_index( cpi, x ); -#endif - -} - -/* Macroblock activity masking */ -void vp8_activity_masking(VP8_COMP *cpi, MACROBLOCK *x) -{ -#if USE_ACT_INDEX - x->rdmult += *(x->mb_activity_ptr) * (x->rdmult >> 2); - x->errorperbit = x->rdmult * 100 /(110 * x->rddiv); - x->errorperbit += (x->errorperbit==0); -#else - int64_t a; - int64_t b; - int64_t act = *(x->mb_activity_ptr); - - /* Apply the masking to the RD multiplier. */ - a = act + (2*cpi->activity_avg); - b = (2*act) + cpi->activity_avg; - - x->rdmult = (unsigned int)(((int64_t)x->rdmult*b + (a>>1))/a); - x->errorperbit = x->rdmult * 100 /(110 * x->rddiv); - x->errorperbit += (x->errorperbit==0); -#endif - - /* Activity based Zbin adjustment */ - adjust_act_zbin(cpi, x); -} - -static -void encode_mb_row(VP8_COMP *cpi, - VP8_COMMON *cm, - int mb_row, - MACROBLOCK *x, - MACROBLOCKD *xd, - TOKENEXTRA **tp, - int *segment_counts, - int *totalrate) -{ - int recon_yoffset, recon_uvoffset; - int mb_col; - int ref_fb_idx = cm->lst_fb_idx; - int dst_fb_idx = cm->new_fb_idx; - int recon_y_stride = cm->yv12_fb[ref_fb_idx].y_stride; - int recon_uv_stride = cm->yv12_fb[ref_fb_idx].uv_stride; - int map_index = (mb_row * cpi->common.mb_cols); - -#if (CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING) - const int num_part = (1 << cm->multi_token_partition); - TOKENEXTRA * tp_start = cpi->tok; - vp8_writer *w; -#endif - -#if CONFIG_MULTITHREAD - const int nsync = cpi->mt_sync_range; - const int rightmost_col = cm->mb_cols + nsync; - volatile const int *last_row_current_mb_col; - volatile int *current_mb_col = &cpi->mt_current_mb_col[mb_row]; - - if ((cpi->b_multi_threaded != 0) && (mb_row != 0)) - last_row_current_mb_col = &cpi->mt_current_mb_col[mb_row - 1]; - else - last_row_current_mb_col = &rightmost_col; -#endif - -#if (CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING) - if(num_part > 1) - w= &cpi->bc[1 + (mb_row % num_part)]; - else - w = &cpi->bc[1]; -#endif - - /* reset above block coeffs */ - xd->above_context = cm->above_context; - - xd->up_available = (mb_row != 0); - recon_yoffset = (mb_row * recon_y_stride * 16); - recon_uvoffset = (mb_row * recon_uv_stride * 8); - - cpi->tplist[mb_row].start = *tp; - /* printf("Main mb_row = %d\n", mb_row); */ - - /* Distance of Mb to the top & bottom edges, specified in 1/8th pel - * units as they are always compared to values that are in 1/8th pel - */ - xd->mb_to_top_edge = -((mb_row * 16) << 3); - xd->mb_to_bottom_edge = ((cm->mb_rows - 1 - mb_row) * 16) << 3; - - /* Set up limit values for vertical motion vector components - * to prevent them extending beyond the UMV borders - */ - x->mv_row_min = -((mb_row * 16) + (VP8BORDERINPIXELS - 16)); - x->mv_row_max = ((cm->mb_rows - 1 - mb_row) * 16) - + (VP8BORDERINPIXELS - 16); - - /* Set the mb activity pointer to the start of the row. */ - x->mb_activity_ptr = &cpi->mb_activity_map[map_index]; - - /* for each macroblock col in image */ - for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) - { - -#if (CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING) - *tp = cpi->tok; -#endif - /* Distance of Mb to the left & right edges, specified in - * 1/8th pel units as they are always compared to values - * that are in 1/8th pel units - */ - xd->mb_to_left_edge = -((mb_col * 16) << 3); - xd->mb_to_right_edge = ((cm->mb_cols - 1 - mb_col) * 16) << 3; - - /* Set up limit values for horizontal motion vector components - * to prevent them extending beyond the UMV borders - */ - x->mv_col_min = -((mb_col * 16) + (VP8BORDERINPIXELS - 16)); - x->mv_col_max = ((cm->mb_cols - 1 - mb_col) * 16) - + (VP8BORDERINPIXELS - 16); - - xd->dst.y_buffer = cm->yv12_fb[dst_fb_idx].y_buffer + recon_yoffset; - xd->dst.u_buffer = cm->yv12_fb[dst_fb_idx].u_buffer + recon_uvoffset; - xd->dst.v_buffer = cm->yv12_fb[dst_fb_idx].v_buffer + recon_uvoffset; - xd->left_available = (mb_col != 0); - - x->rddiv = cpi->RDDIV; - x->rdmult = cpi->RDMULT; - - /* Copy current mb to a buffer */ - vp8_copy_mem16x16(x->src.y_buffer, x->src.y_stride, x->thismb, 16); - -#if CONFIG_MULTITHREAD - if (cpi->b_multi_threaded != 0) - { - *current_mb_col = mb_col - 1; /* set previous MB done */ - - if ((mb_col & (nsync - 1)) == 0) - { - while (mb_col > (*last_row_current_mb_col - nsync)) - { - x86_pause_hint(); - thread_sleep(0); - } - } - } -#endif - - if(cpi->oxcf.tuning == VP8_TUNE_SSIM) - vp8_activity_masking(cpi, x); - - /* Is segmentation enabled */ - /* MB level adjustment to quantizer */ - if (xd->segmentation_enabled) - { - /* Code to set segment id in xd->mbmi.segment_id for current MB - * (with range checking) - */ - if (cpi->segmentation_map[map_index+mb_col] <= 3) - xd->mode_info_context->mbmi.segment_id = cpi->segmentation_map[map_index+mb_col]; - else - xd->mode_info_context->mbmi.segment_id = 0; - - vp8cx_mb_init_quantizer(cpi, x, 1); - } - else - /* Set to Segment 0 by default */ - xd->mode_info_context->mbmi.segment_id = 0; - - x->active_ptr = cpi->active_map + map_index + mb_col; - - if (cm->frame_type == KEY_FRAME) - { - *totalrate += vp8cx_encode_intra_macroblock(cpi, x, tp); -#ifdef MODE_STATS - y_modes[xd->mbmi.mode] ++; -#endif - } - else - { - *totalrate += vp8cx_encode_inter_macroblock(cpi, x, tp, recon_yoffset, recon_uvoffset, mb_row, mb_col); - -#ifdef MODE_STATS - inter_y_modes[xd->mbmi.mode] ++; - - if (xd->mbmi.mode == SPLITMV) - { - int b; - - for (b = 0; b < xd->mbmi.partition_count; b++) - { - inter_b_modes[x->partition->bmi[b].mode] ++; - } - } - -#endif - - // Keep track of how many (consecutive) times a block is coded - // as ZEROMV_LASTREF, for base layer frames. - // Reset to 0 if its coded as anything else. - if (cpi->current_layer == 0) { - if (xd->mode_info_context->mbmi.mode == ZEROMV && - xd->mode_info_context->mbmi.ref_frame == LAST_FRAME) { - // Increment, check for wrap-around. - if (cpi->consec_zero_last[map_index+mb_col] < 255) - cpi->consec_zero_last[map_index+mb_col] += 1; - if (cpi->consec_zero_last_mvbias[map_index+mb_col] < 255) - cpi->consec_zero_last_mvbias[map_index+mb_col] += 1; - } else { - cpi->consec_zero_last[map_index+mb_col] = 0; - cpi->consec_zero_last_mvbias[map_index+mb_col] = 0; - } - if (x->zero_last_dot_suppress) - cpi->consec_zero_last_mvbias[map_index+mb_col] = 0; - } - - /* Special case code for cyclic refresh - * If cyclic update enabled then copy xd->mbmi.segment_id; (which - * may have been updated based on mode during - * vp8cx_encode_inter_macroblock()) back into the global - * segmentation map - */ - if ((cpi->current_layer == 0) && - (cpi->cyclic_refresh_mode_enabled && - xd->segmentation_enabled)) - { - cpi->segmentation_map[map_index+mb_col] = xd->mode_info_context->mbmi.segment_id; - - /* If the block has been refreshed mark it as clean (the - * magnitude of the -ve influences how long it will be before - * we consider another refresh): - * Else if it was coded (last frame 0,0) and has not already - * been refreshed then mark it as a candidate for cleanup - * next time (marked 0) else mark it as dirty (1). - */ - if (xd->mode_info_context->mbmi.segment_id) - cpi->cyclic_refresh_map[map_index+mb_col] = -1; - else if ((xd->mode_info_context->mbmi.mode == ZEROMV) && (xd->mode_info_context->mbmi.ref_frame == LAST_FRAME)) - { - if (cpi->cyclic_refresh_map[map_index+mb_col] == 1) - cpi->cyclic_refresh_map[map_index+mb_col] = 0; - } - else - cpi->cyclic_refresh_map[map_index+mb_col] = 1; - - } - } - - cpi->tplist[mb_row].stop = *tp; - -#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING - /* pack tokens for this MB */ - { - int tok_count = *tp - tp_start; - vp8_pack_tokens(w, tp_start, tok_count); - } -#endif - /* Increment pointer into gf usage flags structure. */ - x->gf_active_ptr++; - - /* Increment the activity mask pointers. */ - x->mb_activity_ptr++; - - /* adjust to the next column of macroblocks */ - x->src.y_buffer += 16; - x->src.u_buffer += 8; - x->src.v_buffer += 8; - - recon_yoffset += 16; - recon_uvoffset += 8; - - /* Keep track of segment usage */ - segment_counts[xd->mode_info_context->mbmi.segment_id] ++; - - /* skip to next mb */ - xd->mode_info_context++; - x->partition_info++; - xd->above_context++; - } - - /* extend the recon for intra prediction */ - vp8_extend_mb_row( &cm->yv12_fb[dst_fb_idx], - xd->dst.y_buffer + 16, - xd->dst.u_buffer + 8, - xd->dst.v_buffer + 8); - -#if CONFIG_MULTITHREAD - if (cpi->b_multi_threaded != 0) - *current_mb_col = rightmost_col; -#endif - - /* this is to account for the border */ - xd->mode_info_context++; - x->partition_info++; -} - -static void init_encode_frame_mb_context(VP8_COMP *cpi) -{ - MACROBLOCK *const x = & cpi->mb; - VP8_COMMON *const cm = & cpi->common; - MACROBLOCKD *const xd = & x->e_mbd; - - /* GF active flags data structure */ - x->gf_active_ptr = (signed char *)cpi->gf_active_flags; - - /* Activity map pointer */ - x->mb_activity_ptr = cpi->mb_activity_map; - - x->act_zbin_adj = 0; - - x->partition_info = x->pi; - - xd->mode_info_context = cm->mi; - xd->mode_info_stride = cm->mode_info_stride; - - xd->frame_type = cm->frame_type; - - /* reset intra mode contexts */ - if (cm->frame_type == KEY_FRAME) - vp8_init_mbmode_probs(cm); - - /* Copy data over into macro block data structures. */ - x->src = * cpi->Source; - xd->pre = cm->yv12_fb[cm->lst_fb_idx]; - xd->dst = cm->yv12_fb[cm->new_fb_idx]; - - /* set up frame for intra coded blocks */ - vp8_setup_intra_recon(&cm->yv12_fb[cm->new_fb_idx]); - - vp8_build_block_offsets(x); - - xd->mode_info_context->mbmi.mode = DC_PRED; - xd->mode_info_context->mbmi.uv_mode = DC_PRED; - - xd->left_context = &cm->left_context; - - x->mvc = cm->fc.mvc; - - vpx_memset(cm->above_context, 0, - sizeof(ENTROPY_CONTEXT_PLANES) * cm->mb_cols); - - /* Special case treatment when GF and ARF are not sensible options - * for reference - */ - if (cpi->ref_frame_flags == VP8_LAST_FRAME) - vp8_calc_ref_frame_costs(x->ref_frame_cost, - cpi->prob_intra_coded,255,128); - else if ((cpi->oxcf.number_of_layers > 1) && - (cpi->ref_frame_flags == VP8_GOLD_FRAME)) - vp8_calc_ref_frame_costs(x->ref_frame_cost, - cpi->prob_intra_coded,1,255); - else if ((cpi->oxcf.number_of_layers > 1) && - (cpi->ref_frame_flags == VP8_ALTR_FRAME)) - vp8_calc_ref_frame_costs(x->ref_frame_cost, - cpi->prob_intra_coded,1,1); - else - vp8_calc_ref_frame_costs(x->ref_frame_cost, - cpi->prob_intra_coded, - cpi->prob_last_coded, - cpi->prob_gf_coded); - - xd->fullpixel_mask = 0xffffffff; - if(cm->full_pixel) - xd->fullpixel_mask = 0xfffffff8; - - vp8_zero(x->coef_counts); - vp8_zero(x->ymode_count); - vp8_zero(x->uv_mode_count) - x->prediction_error = 0; - x->intra_error = 0; - vp8_zero(x->count_mb_ref_frame_usage); -} - -static void sum_coef_counts(MACROBLOCK *x, MACROBLOCK *x_thread) -{ - int i = 0; - do - { - int j = 0; - do - { - int k = 0; - do - { - /* at every context */ - - /* calc probs and branch cts for this frame only */ - int t = 0; /* token/prob index */ - - do - { - x->coef_counts [i][j][k][t] += - x_thread->coef_counts [i][j][k][t]; - } - while (++t < ENTROPY_NODES); - } - while (++k < PREV_COEF_CONTEXTS); - } - while (++j < COEF_BANDS); - } - while (++i < BLOCK_TYPES); -} - -void vp8_encode_frame(VP8_COMP *cpi) -{ - int mb_row; - MACROBLOCK *const x = & cpi->mb; - VP8_COMMON *const cm = & cpi->common; - MACROBLOCKD *const xd = & x->e_mbd; - TOKENEXTRA *tp = cpi->tok; - int segment_counts[MAX_MB_SEGMENTS]; - int totalrate; -#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING - BOOL_CODER * bc = &cpi->bc[1]; /* bc[0] is for control partition */ - const int num_part = (1 << cm->multi_token_partition); -#endif - - vpx_memset(segment_counts, 0, sizeof(segment_counts)); - totalrate = 0; - - if (cpi->compressor_speed == 2) - { - if (cpi->oxcf.cpu_used < 0) - cpi->Speed = -(cpi->oxcf.cpu_used); - else - vp8_auto_select_speed(cpi); - } - - /* Functions setup for all frame types so we can use MC in AltRef */ - if(!cm->use_bilinear_mc_filter) - { - xd->subpixel_predict = vp8_sixtap_predict4x4; - xd->subpixel_predict8x4 = vp8_sixtap_predict8x4; - xd->subpixel_predict8x8 = vp8_sixtap_predict8x8; - xd->subpixel_predict16x16 = vp8_sixtap_predict16x16; - } - else - { - xd->subpixel_predict = vp8_bilinear_predict4x4; - xd->subpixel_predict8x4 = vp8_bilinear_predict8x4; - xd->subpixel_predict8x8 = vp8_bilinear_predict8x8; - xd->subpixel_predict16x16 = vp8_bilinear_predict16x16; - } - - cpi->mb.skip_true_count = 0; - cpi->tok_count = 0; - -#if 0 - /* Experimental code */ - cpi->frame_distortion = 0; - cpi->last_mb_distortion = 0; -#endif - - xd->mode_info_context = cm->mi; - - vp8_zero(cpi->mb.MVcount); - - vp8cx_frame_init_quantizer(cpi); - - vp8_initialize_rd_consts(cpi, x, - vp8_dc_quant(cm->base_qindex, cm->y1dc_delta_q)); - - vp8cx_initialize_me_consts(cpi, cm->base_qindex); - - if(cpi->oxcf.tuning == VP8_TUNE_SSIM) - { - /* Initialize encode frame context. */ - init_encode_frame_mb_context(cpi); - - /* Build a frame level activity map */ - build_activity_map(cpi); - } - - /* re-init encode frame context. */ - init_encode_frame_mb_context(cpi); - -#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING - { - int i; - for(i = 0; i < num_part; i++) - { - vp8_start_encode(&bc[i], cpi->partition_d[i + 1], - cpi->partition_d_end[i + 1]); - bc[i].error = &cm->error; - } - } - -#endif - - { - struct vpx_usec_timer emr_timer; - vpx_usec_timer_start(&emr_timer); - -#if CONFIG_MULTITHREAD - if (cpi->b_multi_threaded) - { - int i; - - vp8cx_init_mbrthread_data(cpi, x, cpi->mb_row_ei, - cpi->encoding_thread_count); - - for (i = 0; i < cm->mb_rows; i++) - cpi->mt_current_mb_col[i] = -1; - - for (i = 0; i < cpi->encoding_thread_count; i++) - { - sem_post(&cpi->h_event_start_encoding[i]); - } - - for (mb_row = 0; mb_row < cm->mb_rows; mb_row += (cpi->encoding_thread_count + 1)) - { - vp8_zero(cm->left_context) - -#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING - tp = cpi->tok; -#else - tp = cpi->tok + mb_row * (cm->mb_cols * 16 * 24); -#endif - - encode_mb_row(cpi, cm, mb_row, x, xd, &tp, segment_counts, &totalrate); - - /* adjust to the next row of mbs */ - x->src.y_buffer += 16 * x->src.y_stride * (cpi->encoding_thread_count + 1) - 16 * cm->mb_cols; - x->src.u_buffer += 8 * x->src.uv_stride * (cpi->encoding_thread_count + 1) - 8 * cm->mb_cols; - x->src.v_buffer += 8 * x->src.uv_stride * (cpi->encoding_thread_count + 1) - 8 * cm->mb_cols; - - xd->mode_info_context += xd->mode_info_stride * cpi->encoding_thread_count; - x->partition_info += xd->mode_info_stride * cpi->encoding_thread_count; - x->gf_active_ptr += cm->mb_cols * cpi->encoding_thread_count; - - if(mb_row == cm->mb_rows - 1) - { - sem_post(&cpi->h_event_end_encoding); /* signal frame encoding end */ - } - } - - sem_wait(&cpi->h_event_end_encoding); /* wait for other threads to finish */ - - for (mb_row = 0; mb_row < cm->mb_rows; mb_row ++) - { - cpi->tok_count += (unsigned int) - (cpi->tplist[mb_row].stop - cpi->tplist[mb_row].start); - } - - if (xd->segmentation_enabled) - { - int j; - - if (xd->segmentation_enabled) - { - for (i = 0; i < cpi->encoding_thread_count; i++) - { - for (j = 0; j < 4; j++) - segment_counts[j] += cpi->mb_row_ei[i].segment_counts[j]; - } - } - } - - for (i = 0; i < cpi->encoding_thread_count; i++) - { - int mode_count; - int c_idx; - totalrate += cpi->mb_row_ei[i].totalrate; - - cpi->mb.skip_true_count += cpi->mb_row_ei[i].mb.skip_true_count; - - for(mode_count = 0; mode_count < VP8_YMODES; mode_count++) - cpi->mb.ymode_count[mode_count] += - cpi->mb_row_ei[i].mb.ymode_count[mode_count]; - - for(mode_count = 0; mode_count < VP8_UV_MODES; mode_count++) - cpi->mb.uv_mode_count[mode_count] += - cpi->mb_row_ei[i].mb.uv_mode_count[mode_count]; - - for(c_idx = 0; c_idx < MVvals; c_idx++) - { - cpi->mb.MVcount[0][c_idx] += - cpi->mb_row_ei[i].mb.MVcount[0][c_idx]; - cpi->mb.MVcount[1][c_idx] += - cpi->mb_row_ei[i].mb.MVcount[1][c_idx]; - } - - cpi->mb.prediction_error += - cpi->mb_row_ei[i].mb.prediction_error; - cpi->mb.intra_error += cpi->mb_row_ei[i].mb.intra_error; - - for(c_idx = 0; c_idx < MAX_REF_FRAMES; c_idx++) - cpi->mb.count_mb_ref_frame_usage[c_idx] += - cpi->mb_row_ei[i].mb.count_mb_ref_frame_usage[c_idx]; - - for(c_idx = 0; c_idx < MAX_ERROR_BINS; c_idx++) - cpi->mb.error_bins[c_idx] += - cpi->mb_row_ei[i].mb.error_bins[c_idx]; - - /* add up counts for each thread */ - sum_coef_counts(x, &cpi->mb_row_ei[i].mb); - } - - } - else -#endif - { - - /* for each macroblock row in image */ - for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) - { - vp8_zero(cm->left_context) - -#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING - tp = cpi->tok; -#endif - - encode_mb_row(cpi, cm, mb_row, x, xd, &tp, segment_counts, &totalrate); - - /* adjust to the next row of mbs */ - x->src.y_buffer += 16 * x->src.y_stride - 16 * cm->mb_cols; - x->src.u_buffer += 8 * x->src.uv_stride - 8 * cm->mb_cols; - x->src.v_buffer += 8 * x->src.uv_stride - 8 * cm->mb_cols; - } - - cpi->tok_count = (unsigned int)(tp - cpi->tok); - } - -#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING - { - int i; - for(i = 0; i < num_part; i++) - { - vp8_stop_encode(&bc[i]); - cpi->partition_sz[i+1] = bc[i].pos; - } - } -#endif - - vpx_usec_timer_mark(&emr_timer); - cpi->time_encode_mb_row += vpx_usec_timer_elapsed(&emr_timer); - } - - - // Work out the segment probabilities if segmentation is enabled - // and needs to be updated - if (xd->segmentation_enabled && xd->update_mb_segmentation_map) - { - int tot_count; - int i; - - /* Set to defaults */ - vpx_memset(xd->mb_segment_tree_probs, 255 , sizeof(xd->mb_segment_tree_probs)); - - tot_count = segment_counts[0] + segment_counts[1] + segment_counts[2] + segment_counts[3]; - - if (tot_count) - { - xd->mb_segment_tree_probs[0] = ((segment_counts[0] + segment_counts[1]) * 255) / tot_count; - - tot_count = segment_counts[0] + segment_counts[1]; - - if (tot_count > 0) - { - xd->mb_segment_tree_probs[1] = (segment_counts[0] * 255) / tot_count; - } - - tot_count = segment_counts[2] + segment_counts[3]; - - if (tot_count > 0) - xd->mb_segment_tree_probs[2] = (segment_counts[2] * 255) / tot_count; - - /* Zero probabilities not allowed */ - for (i = 0; i < MB_FEATURE_TREE_PROBS; i ++) - { - if (xd->mb_segment_tree_probs[i] == 0) - xd->mb_segment_tree_probs[i] = 1; - } - } - } - - /* projected_frame_size in units of BYTES */ - cpi->projected_frame_size = totalrate >> 8; - - /* Make a note of the percentage MBs coded Intra. */ - if (cm->frame_type == KEY_FRAME) - { - cpi->this_frame_percent_intra = 100; - } - else - { - int tot_modes; - - tot_modes = cpi->mb.count_mb_ref_frame_usage[INTRA_FRAME] - + cpi->mb.count_mb_ref_frame_usage[LAST_FRAME] - + cpi->mb.count_mb_ref_frame_usage[GOLDEN_FRAME] - + cpi->mb.count_mb_ref_frame_usage[ALTREF_FRAME]; - - if (tot_modes) - cpi->this_frame_percent_intra = - cpi->mb.count_mb_ref_frame_usage[INTRA_FRAME] * 100 / tot_modes; - - } - -#if ! CONFIG_REALTIME_ONLY - /* Adjust the projected reference frame usage probability numbers to - * reflect what we have just seen. This may be useful when we make - * multiple iterations of the recode loop rather than continuing to use - * values from the previous frame. - */ - if ((cm->frame_type != KEY_FRAME) && ((cpi->oxcf.number_of_layers > 1) || - (!cm->refresh_alt_ref_frame && !cm->refresh_golden_frame))) - { - vp8_convert_rfct_to_prob(cpi); - } -#endif -} -void vp8_setup_block_ptrs(MACROBLOCK *x) -{ - int r, c; - int i; - - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - x->block[r*4+c].src_diff = x->src_diff + r * 4 * 16 + c * 4; - } - } - - for (r = 0; r < 2; r++) - { - for (c = 0; c < 2; c++) - { - x->block[16 + r*2+c].src_diff = x->src_diff + 256 + r * 4 * 8 + c * 4; - } - } - - - for (r = 0; r < 2; r++) - { - for (c = 0; c < 2; c++) - { - x->block[20 + r*2+c].src_diff = x->src_diff + 320 + r * 4 * 8 + c * 4; - } - } - - x->block[24].src_diff = x->src_diff + 384; - - - for (i = 0; i < 25; i++) - { - x->block[i].coeff = x->coeff + i * 16; - } -} - -void vp8_build_block_offsets(MACROBLOCK *x) -{ - int block = 0; - int br, bc; - - vp8_build_block_doffsets(&x->e_mbd); - - /* y blocks */ - x->thismb_ptr = &x->thismb[0]; - for (br = 0; br < 4; br++) - { - for (bc = 0; bc < 4; bc++) - { - BLOCK *this_block = &x->block[block]; - this_block->base_src = &x->thismb_ptr; - this_block->src_stride = 16; - this_block->src = 4 * br * 16 + 4 * bc; - ++block; - } - } - - /* u blocks */ - for (br = 0; br < 2; br++) - { - for (bc = 0; bc < 2; bc++) - { - BLOCK *this_block = &x->block[block]; - this_block->base_src = &x->src.u_buffer; - this_block->src_stride = x->src.uv_stride; - this_block->src = 4 * br * this_block->src_stride + 4 * bc; - ++block; - } - } - - /* v blocks */ - for (br = 0; br < 2; br++) - { - for (bc = 0; bc < 2; bc++) - { - BLOCK *this_block = &x->block[block]; - this_block->base_src = &x->src.v_buffer; - this_block->src_stride = x->src.uv_stride; - this_block->src = 4 * br * this_block->src_stride + 4 * bc; - ++block; - } - } -} - -static void sum_intra_stats(VP8_COMP *cpi, MACROBLOCK *x) -{ - const MACROBLOCKD *xd = & x->e_mbd; - const MB_PREDICTION_MODE m = xd->mode_info_context->mbmi.mode; - const MB_PREDICTION_MODE uvm = xd->mode_info_context->mbmi.uv_mode; - -#ifdef MODE_STATS - const int is_key = cpi->common.frame_type == KEY_FRAME; - - ++ (is_key ? uv_modes : inter_uv_modes)[uvm]; - - if (m == B_PRED) - { - unsigned int *const bct = is_key ? b_modes : inter_b_modes; - - int b = 0; - - do - { - ++ bct[xd->block[b].bmi.mode]; - } - while (++b < 16); - } - -#else - (void)cpi; -#endif - - ++x->ymode_count[m]; - ++x->uv_mode_count[uvm]; - -} - -/* Experimental stub function to create a per MB zbin adjustment based on - * some previously calculated measure of MB activity. - */ -static void adjust_act_zbin( VP8_COMP *cpi, MACROBLOCK *x ) -{ -#if USE_ACT_INDEX - x->act_zbin_adj = *(x->mb_activity_ptr); -#else - int64_t a; - int64_t b; - int64_t act = *(x->mb_activity_ptr); - - /* Apply the masking to the RD multiplier. */ - a = act + 4*cpi->activity_avg; - b = 4*act + cpi->activity_avg; - - if ( act > cpi->activity_avg ) - x->act_zbin_adj = (int)(((int64_t)b + (a>>1))/a) - 1; - else - x->act_zbin_adj = 1 - (int)(((int64_t)a + (b>>1))/b); -#endif -} - -int vp8cx_encode_intra_macroblock(VP8_COMP *cpi, MACROBLOCK *x, - TOKENEXTRA **t) -{ - MACROBLOCKD *xd = &x->e_mbd; - int rate; - - if (cpi->sf.RD && cpi->compressor_speed != 2) - vp8_rd_pick_intra_mode(x, &rate); - else - vp8_pick_intra_mode(x, &rate); - - if(cpi->oxcf.tuning == VP8_TUNE_SSIM) - { - adjust_act_zbin( cpi, x ); - vp8_update_zbin_extra(cpi, x); - } - - if (x->e_mbd.mode_info_context->mbmi.mode == B_PRED) - vp8_encode_intra4x4mby(x); - else - vp8_encode_intra16x16mby(x); - - vp8_encode_intra16x16mbuv(x); - - sum_intra_stats(cpi, x); - - vp8_tokenize_mb(cpi, x, t); - - if (xd->mode_info_context->mbmi.mode != B_PRED) - vp8_inverse_transform_mby(xd); - - vp8_dequant_idct_add_uv_block - (xd->qcoeff+16*16, xd->dequant_uv, - xd->dst.u_buffer, xd->dst.v_buffer, - xd->dst.uv_stride, xd->eobs+16); - return rate; -} -#ifdef SPEEDSTATS -extern int cnt_pm; -#endif - -extern void vp8_fix_contexts(MACROBLOCKD *x); - -int vp8cx_encode_inter_macroblock -( - VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t, - int recon_yoffset, int recon_uvoffset, - int mb_row, int mb_col -) -{ - MACROBLOCKD *const xd = &x->e_mbd; - int intra_error = 0; - int rate; - int distortion; - - x->skip = 0; - - if (xd->segmentation_enabled) - x->encode_breakout = cpi->segment_encode_breakout[xd->mode_info_context->mbmi.segment_id]; - else - x->encode_breakout = cpi->oxcf.encode_breakout; - -#if CONFIG_TEMPORAL_DENOISING - /* Reset the best sse mode/mv for each macroblock. */ - x->best_reference_frame = INTRA_FRAME; - x->best_zeromv_reference_frame = INTRA_FRAME; - x->best_sse_inter_mode = 0; - x->best_sse_mv.as_int = 0; - x->need_to_clamp_best_mvs = 0; -#endif - - if (cpi->sf.RD) - { - int zbin_mode_boost_enabled = x->zbin_mode_boost_enabled; - - /* Are we using the fast quantizer for the mode selection? */ - if(cpi->sf.use_fastquant_for_pick) - { - x->quantize_b = vp8_fast_quantize_b; - - /* the fast quantizer does not use zbin_extra, so - * do not recalculate */ - x->zbin_mode_boost_enabled = 0; - } - vp8_rd_pick_inter_mode(cpi, x, recon_yoffset, recon_uvoffset, &rate, - &distortion, &intra_error, mb_row, mb_col); - - /* switch back to the regular quantizer for the encode */ - if (cpi->sf.improved_quant) - { - x->quantize_b = vp8_regular_quantize_b; - } - - /* restore cpi->zbin_mode_boost_enabled */ - x->zbin_mode_boost_enabled = zbin_mode_boost_enabled; - - } - else - { - vp8_pick_inter_mode(cpi, x, recon_yoffset, recon_uvoffset, &rate, - &distortion, &intra_error, mb_row, mb_col); - } - - x->prediction_error += distortion; - x->intra_error += intra_error; - - if(cpi->oxcf.tuning == VP8_TUNE_SSIM) - { - /* Adjust the zbin based on this MB rate. */ - adjust_act_zbin( cpi, x ); - } - -#if 0 - /* Experimental RD code */ - cpi->frame_distortion += distortion; - cpi->last_mb_distortion = distortion; -#endif - - /* MB level adjutment to quantizer setup */ - if (xd->segmentation_enabled) - { - /* If cyclic update enabled */ - if (cpi->current_layer == 0 && cpi->cyclic_refresh_mode_enabled) - { - /* Clear segment_id back to 0 if not coded (last frame 0,0) */ - if ((xd->mode_info_context->mbmi.segment_id == 1) && - ((xd->mode_info_context->mbmi.ref_frame != LAST_FRAME) || (xd->mode_info_context->mbmi.mode != ZEROMV))) - { - xd->mode_info_context->mbmi.segment_id = 0; - - /* segment_id changed, so update */ - vp8cx_mb_init_quantizer(cpi, x, 1); - } - } - } - - { - /* Experimental code. - * Special case for gf and arf zeromv modes, for 1 temporal layer. - * Increase zbin size to supress noise. - */ - x->zbin_mode_boost = 0; - if (x->zbin_mode_boost_enabled) - { - if ( xd->mode_info_context->mbmi.ref_frame != INTRA_FRAME ) - { - if (xd->mode_info_context->mbmi.mode == ZEROMV) - { - if (xd->mode_info_context->mbmi.ref_frame != LAST_FRAME && - cpi->oxcf.number_of_layers == 1) - x->zbin_mode_boost = GF_ZEROMV_ZBIN_BOOST; - else - x->zbin_mode_boost = LF_ZEROMV_ZBIN_BOOST; - } - else if (xd->mode_info_context->mbmi.mode == SPLITMV) - x->zbin_mode_boost = 0; - else - x->zbin_mode_boost = MV_ZBIN_BOOST; - } - } - - /* The fast quantizer doesn't use zbin_extra, only do so with - * the regular quantizer. */ - if (cpi->sf.improved_quant) - vp8_update_zbin_extra(cpi, x); - } - - x->count_mb_ref_frame_usage[xd->mode_info_context->mbmi.ref_frame] ++; - - if (xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME) - { - vp8_encode_intra16x16mbuv(x); - - if (xd->mode_info_context->mbmi.mode == B_PRED) - { - vp8_encode_intra4x4mby(x); - } - else - { - vp8_encode_intra16x16mby(x); - } - - sum_intra_stats(cpi, x); - } - else - { - int ref_fb_idx; - - if (xd->mode_info_context->mbmi.ref_frame == LAST_FRAME) - ref_fb_idx = cpi->common.lst_fb_idx; - else if (xd->mode_info_context->mbmi.ref_frame == GOLDEN_FRAME) - ref_fb_idx = cpi->common.gld_fb_idx; - else - ref_fb_idx = cpi->common.alt_fb_idx; - - xd->pre.y_buffer = cpi->common.yv12_fb[ref_fb_idx].y_buffer + recon_yoffset; - xd->pre.u_buffer = cpi->common.yv12_fb[ref_fb_idx].u_buffer + recon_uvoffset; - xd->pre.v_buffer = cpi->common.yv12_fb[ref_fb_idx].v_buffer + recon_uvoffset; - - if (!x->skip) - { - vp8_encode_inter16x16(x); - } - else - vp8_build_inter16x16_predictors_mb(xd, xd->dst.y_buffer, - xd->dst.u_buffer, xd->dst.v_buffer, - xd->dst.y_stride, xd->dst.uv_stride); - - } - - if (!x->skip) - { - vp8_tokenize_mb(cpi, x, t); - - if (xd->mode_info_context->mbmi.mode != B_PRED) - vp8_inverse_transform_mby(xd); - - vp8_dequant_idct_add_uv_block - (xd->qcoeff+16*16, xd->dequant_uv, - xd->dst.u_buffer, xd->dst.v_buffer, - xd->dst.uv_stride, xd->eobs+16); - } - else - { - /* always set mb_skip_coeff as it is needed by the loopfilter */ - xd->mode_info_context->mbmi.mb_skip_coeff = 1; - - if (cpi->common.mb_no_coeff_skip) - { - x->skip_true_count ++; - vp8_fix_contexts(xd); - } - else - { - vp8_stuff_mb(cpi, x, t); - } - } - - return rate; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/encodeframe.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/encodeframe.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/encodeframe.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/encodeframe.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef VP8_ENCODER_ENCODEFRAME_H_ -#define VP8_ENCODER_ENCODEFRAME_H_ - -#ifdef __cplusplus -extern "C" { -#endif -extern void vp8_activity_masking(VP8_COMP *cpi, MACROBLOCK *x); - -extern void vp8_build_block_offsets(MACROBLOCK *x); - -extern void vp8_setup_block_ptrs(MACROBLOCK *x); - -extern void vp8_encode_frame(VP8_COMP *cpi); - -extern int vp8cx_encode_inter_macroblock(VP8_COMP *cpi, MACROBLOCK *x, - TOKENEXTRA **t, - int recon_yoffset, int recon_uvoffset, - int mb_row, int mb_col); - -extern int vp8cx_encode_intra_macroblock(VP8_COMP *cpi, MACROBLOCK *x, - TOKENEXTRA **t); -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_ENCODEFRAME_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/encodeintra.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/encodeintra.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/encodeintra.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/encodeintra.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,138 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "quantize.h" -#include "vp8/common/reconintra4x4.h" -#include "encodemb.h" -#include "vp8/common/invtrans.h" -#include "encodeintra.h" - - -int vp8_encode_intra(VP8_COMP *cpi, MACROBLOCK *x, int use_dc_pred) -{ - - int i; - int intra_pred_var = 0; - (void) cpi; - - if (use_dc_pred) - { - x->e_mbd.mode_info_context->mbmi.mode = DC_PRED; - x->e_mbd.mode_info_context->mbmi.uv_mode = DC_PRED; - x->e_mbd.mode_info_context->mbmi.ref_frame = INTRA_FRAME; - - vp8_encode_intra16x16mby(x); - - vp8_inverse_transform_mby(&x->e_mbd); - } - else - { - for (i = 0; i < 16; i++) - { - x->e_mbd.block[i].bmi.as_mode = B_DC_PRED; - vp8_encode_intra4x4block(x, i); - } - } - - intra_pred_var = vp8_get_mb_ss(x->src_diff); - - return intra_pred_var; -} - -void vp8_encode_intra4x4block(MACROBLOCK *x, int ib) -{ - BLOCKD *b = &x->e_mbd.block[ib]; - BLOCK *be = &x->block[ib]; - int dst_stride = x->e_mbd.dst.y_stride; - unsigned char *dst = x->e_mbd.dst.y_buffer + b->offset; - unsigned char *Above = dst - dst_stride; - unsigned char *yleft = dst - 1; - unsigned char top_left = Above[-1]; - - vp8_intra4x4_predict(Above, yleft, dst_stride, b->bmi.as_mode, - b->predictor, 16, top_left); - - vp8_subtract_b(be, b, 16); - - x->short_fdct4x4(be->src_diff, be->coeff, 32); - - x->quantize_b(be, b); - - if (*b->eob > 1) - { - vp8_short_idct4x4llm(b->dqcoeff, b->predictor, 16, dst, dst_stride); - } - else - { - vp8_dc_only_idct_add(b->dqcoeff[0], b->predictor, 16, dst, dst_stride); - } -} - -void vp8_encode_intra4x4mby(MACROBLOCK *mb) -{ - int i; - - MACROBLOCKD *xd = &mb->e_mbd; - intra_prediction_down_copy(xd, xd->dst.y_buffer - xd->dst.y_stride + 16); - - for (i = 0; i < 16; i++) - vp8_encode_intra4x4block(mb, i); - return; -} - -void vp8_encode_intra16x16mby(MACROBLOCK *x) -{ - BLOCK *b = &x->block[0]; - MACROBLOCKD *xd = &x->e_mbd; - - vp8_build_intra_predictors_mby_s(xd, - xd->dst.y_buffer - xd->dst.y_stride, - xd->dst.y_buffer - 1, - xd->dst.y_stride, - xd->dst.y_buffer, - xd->dst.y_stride); - - vp8_subtract_mby(x->src_diff, *(b->base_src), - b->src_stride, xd->dst.y_buffer, xd->dst.y_stride); - - vp8_transform_intra_mby(x); - - vp8_quantize_mby(x); - - if (x->optimize) - vp8_optimize_mby(x); -} - -void vp8_encode_intra16x16mbuv(MACROBLOCK *x) -{ - MACROBLOCKD *xd = &x->e_mbd; - - vp8_build_intra_predictors_mbuv_s(xd, xd->dst.u_buffer - xd->dst.uv_stride, - xd->dst.v_buffer - xd->dst.uv_stride, - xd->dst.u_buffer - 1, - xd->dst.v_buffer - 1, - xd->dst.uv_stride, - xd->dst.u_buffer, xd->dst.v_buffer, - xd->dst.uv_stride); - - vp8_subtract_mbuv(x->src_diff, x->src.u_buffer, - x->src.v_buffer, x->src.uv_stride, xd->dst.u_buffer, - xd->dst.v_buffer, xd->dst.uv_stride); - - vp8_transform_mbuv(x); - - vp8_quantize_mbuv(x); - - if (x->optimize) - vp8_optimize_mbuv(x); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/encodeintra.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/encodeintra.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/encodeintra.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/encodeintra.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_ENCODER_ENCODEINTRA_H_ -#define VP8_ENCODER_ENCODEINTRA_H_ -#include "onyx_int.h" - -#ifdef __cplusplus -extern "C" { -#endif - -int vp8_encode_intra(VP8_COMP *cpi, MACROBLOCK *x, int use_dc_pred); -void vp8_encode_intra16x16mby(MACROBLOCK *x); -void vp8_encode_intra16x16mbuv(MACROBLOCK *x); -void vp8_encode_intra4x4mby(MACROBLOCK *mb); -void vp8_encode_intra4x4block(MACROBLOCK *x, int ib); -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_ENCODEINTRA_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/encodemb.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/encodemb.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/encodemb.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/encodemb.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,641 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "encodemb.h" -#include "vp8/common/reconinter.h" -#include "quantize.h" -#include "tokenize.h" -#include "vp8/common/invtrans.h" -#include "vpx_mem/vpx_mem.h" -#include "rdopt.h" - -void vp8_subtract_b_c(BLOCK *be, BLOCKD *bd, int pitch) -{ - unsigned char *src_ptr = (*(be->base_src) + be->src); - short *diff_ptr = be->src_diff; - unsigned char *pred_ptr = bd->predictor; - int src_stride = be->src_stride; - - int r, c; - - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - diff_ptr[c] = src_ptr[c] - pred_ptr[c]; - } - - diff_ptr += pitch; - pred_ptr += pitch; - src_ptr += src_stride; - } -} - -void vp8_subtract_mbuv_c(short *diff, unsigned char *usrc, unsigned char *vsrc, - int src_stride, unsigned char *upred, - unsigned char *vpred, int pred_stride) -{ - short *udiff = diff + 256; - short *vdiff = diff + 320; - - int r, c; - - for (r = 0; r < 8; r++) - { - for (c = 0; c < 8; c++) - { - udiff[c] = usrc[c] - upred[c]; - } - - udiff += 8; - upred += pred_stride; - usrc += src_stride; - } - - for (r = 0; r < 8; r++) - { - for (c = 0; c < 8; c++) - { - vdiff[c] = vsrc[c] - vpred[c]; - } - - vdiff += 8; - vpred += pred_stride; - vsrc += src_stride; - } -} - -void vp8_subtract_mby_c(short *diff, unsigned char *src, int src_stride, - unsigned char *pred, int pred_stride) -{ - int r, c; - - for (r = 0; r < 16; r++) - { - for (c = 0; c < 16; c++) - { - diff[c] = src[c] - pred[c]; - } - - diff += 16; - pred += pred_stride; - src += src_stride; - } -} - -static void vp8_subtract_mb(MACROBLOCK *x) -{ - BLOCK *b = &x->block[0]; - - vp8_subtract_mby(x->src_diff, *(b->base_src), - b->src_stride, x->e_mbd.dst.y_buffer, x->e_mbd.dst.y_stride); - vp8_subtract_mbuv(x->src_diff, x->src.u_buffer, - x->src.v_buffer, x->src.uv_stride, x->e_mbd.dst.u_buffer, - x->e_mbd.dst.v_buffer, x->e_mbd.dst.uv_stride); -} - -static void build_dcblock(MACROBLOCK *x) -{ - short *src_diff_ptr = &x->src_diff[384]; - int i; - - for (i = 0; i < 16; i++) - { - src_diff_ptr[i] = x->coeff[i * 16]; - } -} - -void vp8_transform_mbuv(MACROBLOCK *x) -{ - int i; - - for (i = 16; i < 24; i += 2) - { - x->short_fdct8x4(&x->block[i].src_diff[0], - &x->block[i].coeff[0], 16); - } -} - - -void vp8_transform_intra_mby(MACROBLOCK *x) -{ - int i; - - for (i = 0; i < 16; i += 2) - { - x->short_fdct8x4(&x->block[i].src_diff[0], - &x->block[i].coeff[0], 32); - } - - /* build dc block from 16 y dc values */ - build_dcblock(x); - - /* do 2nd order transform on the dc block */ - x->short_walsh4x4(&x->block[24].src_diff[0], - &x->block[24].coeff[0], 8); - -} - - -static void transform_mb(MACROBLOCK *x) -{ - int i; - - for (i = 0; i < 16; i += 2) - { - x->short_fdct8x4(&x->block[i].src_diff[0], - &x->block[i].coeff[0], 32); - } - - /* build dc block from 16 y dc values */ - if (x->e_mbd.mode_info_context->mbmi.mode != SPLITMV) - build_dcblock(x); - - for (i = 16; i < 24; i += 2) - { - x->short_fdct8x4(&x->block[i].src_diff[0], - &x->block[i].coeff[0], 16); - } - - /* do 2nd order transform on the dc block */ - if (x->e_mbd.mode_info_context->mbmi.mode != SPLITMV) - x->short_walsh4x4(&x->block[24].src_diff[0], - &x->block[24].coeff[0], 8); - -} - - -static void transform_mby(MACROBLOCK *x) -{ - int i; - - for (i = 0; i < 16; i += 2) - { - x->short_fdct8x4(&x->block[i].src_diff[0], - &x->block[i].coeff[0], 32); - } - - /* build dc block from 16 y dc values */ - if (x->e_mbd.mode_info_context->mbmi.mode != SPLITMV) - { - build_dcblock(x); - x->short_walsh4x4(&x->block[24].src_diff[0], - &x->block[24].coeff[0], 8); - } -} - - - -#define RDTRUNC(RM,DM,R,D) ( (128+(R)*(RM)) & 0xFF ) - -typedef struct vp8_token_state vp8_token_state; - -struct vp8_token_state{ - int rate; - int error; - signed char next; - signed char token; - short qc; -}; - -/* TODO: experiments to find optimal multiple numbers */ -#define Y1_RD_MULT 4 -#define UV_RD_MULT 2 -#define Y2_RD_MULT 16 - -static const int plane_rd_mult[4]= -{ - Y1_RD_MULT, - Y2_RD_MULT, - UV_RD_MULT, - Y1_RD_MULT -}; - -static void optimize_b(MACROBLOCK *mb, int ib, int type, - ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l) -{ - BLOCK *b; - BLOCKD *d; - vp8_token_state tokens[17][2]; - unsigned best_mask[2]; - const short *dequant_ptr; - const short *coeff_ptr; - short *qcoeff_ptr; - short *dqcoeff_ptr; - int eob; - int i0; - int rc; - int x; - int sz = 0; - int next; - int rdmult; - int rddiv; - int final_eob; - int rd_cost0; - int rd_cost1; - int rate0; - int rate1; - int error0; - int error1; - int t0; - int t1; - int best; - int band; - int pt; - int i; - int err_mult = plane_rd_mult[type]; - - b = &mb->block[ib]; - d = &mb->e_mbd.block[ib]; - - dequant_ptr = d->dequant; - coeff_ptr = b->coeff; - qcoeff_ptr = d->qcoeff; - dqcoeff_ptr = d->dqcoeff; - i0 = !type; - eob = *d->eob; - - /* Now set up a Viterbi trellis to evaluate alternative roundings. */ - rdmult = mb->rdmult * err_mult; - if(mb->e_mbd.mode_info_context->mbmi.ref_frame==INTRA_FRAME) - rdmult = (rdmult * 9)>>4; - - rddiv = mb->rddiv; - best_mask[0] = best_mask[1] = 0; - /* Initialize the sentinel node of the trellis. */ - tokens[eob][0].rate = 0; - tokens[eob][0].error = 0; - tokens[eob][0].next = 16; - tokens[eob][0].token = DCT_EOB_TOKEN; - tokens[eob][0].qc = 0; - *(tokens[eob] + 1) = *(tokens[eob] + 0); - next = eob; - for (i = eob; i-- > i0;) - { - int base_bits; - int d2; - int dx; - - rc = vp8_default_zig_zag1d[i]; - x = qcoeff_ptr[rc]; - /* Only add a trellis state for non-zero coefficients. */ - if (x) - { - int shortcut=0; - error0 = tokens[next][0].error; - error1 = tokens[next][1].error; - /* Evaluate the first possibility for this state. */ - rate0 = tokens[next][0].rate; - rate1 = tokens[next][1].rate; - t0 = (vp8_dct_value_tokens_ptr + x)->Token; - /* Consider both possible successor states. */ - if (next < 16) - { - band = vp8_coef_bands[i + 1]; - pt = vp8_prev_token_class[t0]; - rate0 += - mb->token_costs[type][band][pt][tokens[next][0].token]; - rate1 += - mb->token_costs[type][band][pt][tokens[next][1].token]; - } - rd_cost0 = RDCOST(rdmult, rddiv, rate0, error0); - rd_cost1 = RDCOST(rdmult, rddiv, rate1, error1); - if (rd_cost0 == rd_cost1) - { - rd_cost0 = RDTRUNC(rdmult, rddiv, rate0, error0); - rd_cost1 = RDTRUNC(rdmult, rddiv, rate1, error1); - } - /* And pick the best. */ - best = rd_cost1 < rd_cost0; - base_bits = *(vp8_dct_value_cost_ptr + x); - dx = dqcoeff_ptr[rc] - coeff_ptr[rc]; - d2 = dx*dx; - tokens[i][0].rate = base_bits + (best ? rate1 : rate0); - tokens[i][0].error = d2 + (best ? error1 : error0); - tokens[i][0].next = next; - tokens[i][0].token = t0; - tokens[i][0].qc = x; - best_mask[0] |= best << i; - /* Evaluate the second possibility for this state. */ - rate0 = tokens[next][0].rate; - rate1 = tokens[next][1].rate; - - if((abs(x)*dequant_ptr[rc]>abs(coeff_ptr[rc])) && - (abs(x)*dequant_ptr[rc]Token; - } - if (next < 16) - { - band = vp8_coef_bands[i + 1]; - if(t0!=DCT_EOB_TOKEN) - { - pt = vp8_prev_token_class[t0]; - rate0 += mb->token_costs[type][band][pt][ - tokens[next][0].token]; - } - if(t1!=DCT_EOB_TOKEN) - { - pt = vp8_prev_token_class[t1]; - rate1 += mb->token_costs[type][band][pt][ - tokens[next][1].token]; - } - } - - rd_cost0 = RDCOST(rdmult, rddiv, rate0, error0); - rd_cost1 = RDCOST(rdmult, rddiv, rate1, error1); - if (rd_cost0 == rd_cost1) - { - rd_cost0 = RDTRUNC(rdmult, rddiv, rate0, error0); - rd_cost1 = RDTRUNC(rdmult, rddiv, rate1, error1); - } - /* And pick the best. */ - best = rd_cost1 < rd_cost0; - base_bits = *(vp8_dct_value_cost_ptr + x); - - if(shortcut) - { - dx -= (dequant_ptr[rc] + sz) ^ sz; - d2 = dx*dx; - } - tokens[i][1].rate = base_bits + (best ? rate1 : rate0); - tokens[i][1].error = d2 + (best ? error1 : error0); - tokens[i][1].next = next; - tokens[i][1].token =best?t1:t0; - tokens[i][1].qc = x; - best_mask[1] |= best << i; - /* Finally, make this the new head of the trellis. */ - next = i; - } - /* There's no choice to make for a zero coefficient, so we don't - * add a new trellis node, but we do need to update the costs. - */ - else - { - band = vp8_coef_bands[i + 1]; - t0 = tokens[next][0].token; - t1 = tokens[next][1].token; - /* Update the cost of each path if we're past the EOB token. */ - if (t0 != DCT_EOB_TOKEN) - { - tokens[next][0].rate += mb->token_costs[type][band][0][t0]; - tokens[next][0].token = ZERO_TOKEN; - } - if (t1 != DCT_EOB_TOKEN) - { - tokens[next][1].rate += mb->token_costs[type][band][0][t1]; - tokens[next][1].token = ZERO_TOKEN; - } - /* Don't update next, because we didn't add a new node. */ - } - } - - /* Now pick the best path through the whole trellis. */ - band = vp8_coef_bands[i + 1]; - VP8_COMBINEENTROPYCONTEXTS(pt, *a, *l); - rate0 = tokens[next][0].rate; - rate1 = tokens[next][1].rate; - error0 = tokens[next][0].error; - error1 = tokens[next][1].error; - t0 = tokens[next][0].token; - t1 = tokens[next][1].token; - rate0 += mb->token_costs[type][band][pt][t0]; - rate1 += mb->token_costs[type][band][pt][t1]; - rd_cost0 = RDCOST(rdmult, rddiv, rate0, error0); - rd_cost1 = RDCOST(rdmult, rddiv, rate1, error1); - if (rd_cost0 == rd_cost1) - { - rd_cost0 = RDTRUNC(rdmult, rddiv, rate0, error0); - rd_cost1 = RDTRUNC(rdmult, rddiv, rate1, error1); - } - best = rd_cost1 < rd_cost0; - final_eob = i0 - 1; - for (i = next; i < eob; i = next) - { - x = tokens[i][best].qc; - if (x) - final_eob = i; - rc = vp8_default_zig_zag1d[i]; - qcoeff_ptr[rc] = x; - dqcoeff_ptr[rc] = x * dequant_ptr[rc]; - next = tokens[i][best].next; - best = (best_mask[best] >> i) & 1; - } - final_eob++; - - *a = *l = (final_eob != !type); - *d->eob = (char)final_eob; -} -static void check_reset_2nd_coeffs(MACROBLOCKD *x, int type, - ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l) -{ - int sum=0; - int i; - BLOCKD *bd = &x->block[24]; - - if(bd->dequant[0]>=35 && bd->dequant[1]>=35) - return; - - for(i=0;i<(*bd->eob);i++) - { - int coef = bd->dqcoeff[vp8_default_zig_zag1d[i]]; - sum+= (coef>=0)?coef:-coef; - if(sum>=35) - return; - } - /************************************************************************** - our inverse hadamard transform effectively is weighted sum of all 16 inputs - with weight either 1 or -1. It has a last stage scaling of (sum+3)>>3. And - dc only idct is (dc+4)>>3. So if all the sums are between -35 and 29, the - output after inverse wht and idct will be all zero. A sum of absolute value - smaller than 35 guarantees all 16 different (+1/-1) weighted sums in wht - fall between -35 and +35. - **************************************************************************/ - if(sum < 35) - { - for(i=0;i<(*bd->eob);i++) - { - int rc = vp8_default_zig_zag1d[i]; - bd->qcoeff[rc]=0; - bd->dqcoeff[rc]=0; - } - *bd->eob = 0; - *a = *l = (*bd->eob != !type); - } -} - -static void optimize_mb(MACROBLOCK *x) -{ - int b; - int type; - int has_2nd_order; - - ENTROPY_CONTEXT_PLANES t_above, t_left; - ENTROPY_CONTEXT *ta; - ENTROPY_CONTEXT *tl; - - vpx_memcpy(&t_above, x->e_mbd.above_context, sizeof(ENTROPY_CONTEXT_PLANES)); - vpx_memcpy(&t_left, x->e_mbd.left_context, sizeof(ENTROPY_CONTEXT_PLANES)); - - ta = (ENTROPY_CONTEXT *)&t_above; - tl = (ENTROPY_CONTEXT *)&t_left; - - has_2nd_order = (x->e_mbd.mode_info_context->mbmi.mode != B_PRED - && x->e_mbd.mode_info_context->mbmi.mode != SPLITMV); - type = has_2nd_order ? PLANE_TYPE_Y_NO_DC : PLANE_TYPE_Y_WITH_DC; - - for (b = 0; b < 16; b++) - { - optimize_b(x, b, type, - ta + vp8_block2above[b], tl + vp8_block2left[b]); - } - - for (b = 16; b < 24; b++) - { - optimize_b(x, b, PLANE_TYPE_UV, - ta + vp8_block2above[b], tl + vp8_block2left[b]); - } - - if (has_2nd_order) - { - b=24; - optimize_b(x, b, PLANE_TYPE_Y2, - ta + vp8_block2above[b], tl + vp8_block2left[b]); - check_reset_2nd_coeffs(&x->e_mbd, PLANE_TYPE_Y2, - ta + vp8_block2above[b], tl + vp8_block2left[b]); - } -} - - -void vp8_optimize_mby(MACROBLOCK *x) -{ - int b; - int type; - int has_2nd_order; - - ENTROPY_CONTEXT_PLANES t_above, t_left; - ENTROPY_CONTEXT *ta; - ENTROPY_CONTEXT *tl; - - if (!x->e_mbd.above_context) - return; - - if (!x->e_mbd.left_context) - return; - - vpx_memcpy(&t_above, x->e_mbd.above_context, sizeof(ENTROPY_CONTEXT_PLANES)); - vpx_memcpy(&t_left, x->e_mbd.left_context, sizeof(ENTROPY_CONTEXT_PLANES)); - - ta = (ENTROPY_CONTEXT *)&t_above; - tl = (ENTROPY_CONTEXT *)&t_left; - - has_2nd_order = (x->e_mbd.mode_info_context->mbmi.mode != B_PRED - && x->e_mbd.mode_info_context->mbmi.mode != SPLITMV); - type = has_2nd_order ? PLANE_TYPE_Y_NO_DC : PLANE_TYPE_Y_WITH_DC; - - for (b = 0; b < 16; b++) - { - optimize_b(x, b, type, - ta + vp8_block2above[b], tl + vp8_block2left[b]); - } - - - if (has_2nd_order) - { - b=24; - optimize_b(x, b, PLANE_TYPE_Y2, - ta + vp8_block2above[b], tl + vp8_block2left[b]); - check_reset_2nd_coeffs(&x->e_mbd, PLANE_TYPE_Y2, - ta + vp8_block2above[b], tl + vp8_block2left[b]); - } -} - -void vp8_optimize_mbuv(MACROBLOCK *x) -{ - int b; - ENTROPY_CONTEXT_PLANES t_above, t_left; - ENTROPY_CONTEXT *ta; - ENTROPY_CONTEXT *tl; - - if (!x->e_mbd.above_context) - return; - - if (!x->e_mbd.left_context) - return; - - vpx_memcpy(&t_above, x->e_mbd.above_context, sizeof(ENTROPY_CONTEXT_PLANES)); - vpx_memcpy(&t_left, x->e_mbd.left_context, sizeof(ENTROPY_CONTEXT_PLANES)); - - ta = (ENTROPY_CONTEXT *)&t_above; - tl = (ENTROPY_CONTEXT *)&t_left; - - for (b = 16; b < 24; b++) - { - optimize_b(x, b, PLANE_TYPE_UV, - ta + vp8_block2above[b], tl + vp8_block2left[b]); - } -} - -void vp8_encode_inter16x16(MACROBLOCK *x) -{ - vp8_build_inter_predictors_mb(&x->e_mbd); - - vp8_subtract_mb(x); - - transform_mb(x); - - vp8_quantize_mb(x); - - if (x->optimize) - optimize_mb(x); -} - -/* this funciton is used by first pass only */ -void vp8_encode_inter16x16y(MACROBLOCK *x) -{ - BLOCK *b = &x->block[0]; - - vp8_build_inter16x16_predictors_mby(&x->e_mbd, x->e_mbd.dst.y_buffer, - x->e_mbd.dst.y_stride); - - vp8_subtract_mby(x->src_diff, *(b->base_src), - b->src_stride, x->e_mbd.dst.y_buffer, x->e_mbd.dst.y_stride); - - transform_mby(x); - - vp8_quantize_mby(x); - - vp8_inverse_transform_mby(&x->e_mbd); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/encodemb.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/encodemb.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/encodemb.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/encodemb.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_ENCODER_ENCODEMB_H_ -#define VP8_ENCODER_ENCODEMB_H_ - -#include "onyx_int.h" - -#ifdef __cplusplus -extern "C" { -#endif -void vp8_encode_inter16x16(MACROBLOCK *x); - -void vp8_build_dcblock(MACROBLOCK *b); -void vp8_transform_mb(MACROBLOCK *mb); -void vp8_transform_mbuv(MACROBLOCK *x); -void vp8_transform_intra_mby(MACROBLOCK *x); - -void vp8_optimize_mby(MACROBLOCK *x); -void vp8_optimize_mbuv(MACROBLOCK *x); -void vp8_encode_inter16x16y(MACROBLOCK *x); -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_ENCODEMB_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/encodemv.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/encodemv.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/encodemv.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/encodemv.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,380 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vp8/common/common.h" -#include "encodemv.h" -#include "vp8/common/entropymode.h" -#include "vp8/common/systemdependent.h" - -#include - -#ifdef VP8_ENTROPY_STATS -extern unsigned int active_section; -#endif - -static void encode_mvcomponent( - vp8_writer *const w, - const int v, - const struct mv_context *mvc -) -{ - const vp8_prob *p = mvc->prob; - const int x = v < 0 ? -v : v; - - if (x < mvnum_short) /* Small */ - { - vp8_write(w, 0, p [mvpis_short]); - vp8_treed_write(w, vp8_small_mvtree, p + MVPshort, x, 3); - - if (!x) - return; /* no sign bit */ - } - else /* Large */ - { - int i = 0; - - vp8_write(w, 1, p [mvpis_short]); - - do - vp8_write(w, (x >> i) & 1, p [MVPbits + i]); - - while (++i < 3); - - i = mvlong_width - 1; /* Skip bit 3, which is sometimes implicit */ - - do - vp8_write(w, (x >> i) & 1, p [MVPbits + i]); - - while (--i > 3); - - if (x & 0xFFF0) - vp8_write(w, (x >> 3) & 1, p [MVPbits + 3]); - } - - vp8_write(w, v < 0, p [MVPsign]); -} -#if 0 -static int max_mv_r = 0; -static int max_mv_c = 0; -#endif -void vp8_encode_motion_vector(vp8_writer *w, const MV *mv, const MV_CONTEXT *mvc) -{ - -#if 0 - { - if (abs(mv->row >> 1) > max_mv_r) - { - FILE *f = fopen("maxmv.stt", "a"); - max_mv_r = abs(mv->row >> 1); - fprintf(f, "New Mv Row Max %6d\n", (mv->row >> 1)); - - if ((abs(mv->row) / 2) != max_mv_r) - fprintf(f, "MV Row conversion error %6d\n", abs(mv->row) / 2); - - fclose(f); - } - - if (abs(mv->col >> 1) > max_mv_c) - { - FILE *f = fopen("maxmv.stt", "a"); - fprintf(f, "New Mv Col Max %6d\n", (mv->col >> 1)); - max_mv_c = abs(mv->col >> 1); - fclose(f); - } - } -#endif - - encode_mvcomponent(w, mv->row >> 1, &mvc[0]); - encode_mvcomponent(w, mv->col >> 1, &mvc[1]); -} - - -static unsigned int cost_mvcomponent(const int v, const struct mv_context *mvc) -{ - const vp8_prob *p = mvc->prob; - const int x = v; - unsigned int cost; - - if (x < mvnum_short) - { - cost = vp8_cost_zero(p [mvpis_short]) - + vp8_treed_cost(vp8_small_mvtree, p + MVPshort, x, 3); - - if (!x) - return cost; - } - else - { - int i = 0; - cost = vp8_cost_one(p [mvpis_short]); - - do - cost += vp8_cost_bit(p [MVPbits + i], (x >> i) & 1); - - while (++i < 3); - - i = mvlong_width - 1; /* Skip bit 3, which is sometimes implicit */ - - do - cost += vp8_cost_bit(p [MVPbits + i], (x >> i) & 1); - - while (--i > 3); - - if (x & 0xFFF0) - cost += vp8_cost_bit(p [MVPbits + 3], (x >> 3) & 1); - } - - return cost; /* + vp8_cost_bit( p [MVPsign], v < 0); */ -} - -void vp8_build_component_cost_table(int *mvcost[2], const MV_CONTEXT *mvc, int mvc_flag[2]) -{ - int i = 1; - unsigned int cost0 = 0; - unsigned int cost1 = 0; - - vp8_clear_system_state(); - - i = 1; - - if (mvc_flag[0]) - { - mvcost [0] [0] = cost_mvcomponent(0, &mvc[0]); - - do - { - cost0 = cost_mvcomponent(i, &mvc[0]); - - mvcost [0] [i] = cost0 + vp8_cost_zero(mvc[0].prob[MVPsign]); - mvcost [0] [-i] = cost0 + vp8_cost_one(mvc[0].prob[MVPsign]); - } - while (++i <= mv_max); - } - - i = 1; - - if (mvc_flag[1]) - { - mvcost [1] [0] = cost_mvcomponent(0, &mvc[1]); - - do - { - cost1 = cost_mvcomponent(i, &mvc[1]); - - mvcost [1] [i] = cost1 + vp8_cost_zero(mvc[1].prob[MVPsign]); - mvcost [1] [-i] = cost1 + vp8_cost_one(mvc[1].prob[MVPsign]); - } - while (++i <= mv_max); - } -} - - -/* Motion vector probability table update depends on benefit. - * Small correction allows for the fact that an update to an MV probability - * may have benefit in subsequent frames as well as the current one. - */ -#define MV_PROB_UPDATE_CORRECTION -1 - - -static void calc_prob(vp8_prob *p, const unsigned int ct[2]) -{ - const unsigned int tot = ct[0] + ct[1]; - - if (tot) - { - const vp8_prob x = ((ct[0] * 255) / tot) & -2; - *p = x ? x : 1; - } -} - -static void update( - vp8_writer *const w, - const unsigned int ct[2], - vp8_prob *const cur_p, - const vp8_prob new_p, - const vp8_prob update_p, - int *updated -) -{ - const int cur_b = vp8_cost_branch(ct, *cur_p); - const int new_b = vp8_cost_branch(ct, new_p); - const int cost = 7 + MV_PROB_UPDATE_CORRECTION + ((vp8_cost_one(update_p) - vp8_cost_zero(update_p) + 128) >> 8); - - if (cur_b - new_b > cost) - { - *cur_p = new_p; - vp8_write(w, 1, update_p); - vp8_write_literal(w, new_p >> 1, 7); - *updated = 1; - - } - else - vp8_write(w, 0, update_p); -} - -static void write_component_probs( - vp8_writer *const w, - struct mv_context *cur_mvc, - const struct mv_context *default_mvc_, - const struct mv_context *update_mvc, - const unsigned int events [MVvals], - unsigned int rc, - int *updated -) -{ - vp8_prob *Pcur = cur_mvc->prob; - const vp8_prob *default_mvc = default_mvc_->prob; - const vp8_prob *Pupdate = update_mvc->prob; - unsigned int is_short_ct[2], sign_ct[2]; - - unsigned int bit_ct [mvlong_width] [2]; - - unsigned int short_ct [mvnum_short]; - unsigned int short_bct [mvnum_short-1] [2]; - - vp8_prob Pnew [MVPcount]; - - (void) rc; - vp8_copy_array(Pnew, default_mvc, MVPcount); - - vp8_zero(is_short_ct) - vp8_zero(sign_ct) - vp8_zero(bit_ct) - vp8_zero(short_ct) - vp8_zero(short_bct) - - - /* j=0 */ - { - const int c = events [mv_max]; - - is_short_ct [0] += c; /* Short vector */ - short_ct [0] += c; /* Magnitude distribution */ - } - - /* j: 1 ~ mv_max (1023) */ - { - int j = 1; - - do - { - const int c1 = events [mv_max + j]; /* positive */ - const int c2 = events [mv_max - j]; /* negative */ - const int c = c1 + c2; - int a = j; - - sign_ct [0] += c1; - sign_ct [1] += c2; - - if (a < mvnum_short) - { - is_short_ct [0] += c; /* Short vector */ - short_ct [a] += c; /* Magnitude distribution */ - } - else - { - int k = mvlong_width - 1; - is_short_ct [1] += c; /* Long vector */ - - /* bit 3 not always encoded. */ - do - bit_ct [k] [(a >> k) & 1] += c; - - while (--k >= 0); - } - } - while (++j <= mv_max); - } - - calc_prob(Pnew + mvpis_short, is_short_ct); - - calc_prob(Pnew + MVPsign, sign_ct); - - { - vp8_prob p [mvnum_short - 1]; /* actually only need branch ct */ - int j = 0; - - vp8_tree_probs_from_distribution( - 8, vp8_small_mvencodings, vp8_small_mvtree, - p, short_bct, short_ct, - 256, 1 - ); - - do - calc_prob(Pnew + MVPshort + j, short_bct[j]); - - while (++j < mvnum_short - 1); - } - - { - int j = 0; - - do - calc_prob(Pnew + MVPbits + j, bit_ct[j]); - - while (++j < mvlong_width); - } - - update(w, is_short_ct, Pcur + mvpis_short, Pnew[mvpis_short], *Pupdate++, updated); - - update(w, sign_ct, Pcur + MVPsign, Pnew[MVPsign], *Pupdate++, updated); - - { - const vp8_prob *const new_p = Pnew + MVPshort; - vp8_prob *const cur_p = Pcur + MVPshort; - - int j = 0; - - do - - update(w, short_bct[j], cur_p + j, new_p[j], *Pupdate++, updated); - - while (++j < mvnum_short - 1); - } - - { - const vp8_prob *const new_p = Pnew + MVPbits; - vp8_prob *const cur_p = Pcur + MVPbits; - - int j = 0; - - do - - update(w, bit_ct[j], cur_p + j, new_p[j], *Pupdate++, updated); - - while (++j < mvlong_width); - } -} - -void vp8_write_mvprobs(VP8_COMP *cpi) -{ - vp8_writer *const w = cpi->bc; - MV_CONTEXT *mvc = cpi->common.fc.mvc; - int flags[2] = {0, 0}; -#ifdef VP8_ENTROPY_STATS - active_section = 4; -#endif - write_component_probs( - w, &mvc[0], &vp8_default_mv_context[0], &vp8_mv_update_probs[0], - cpi->mb.MVcount[0], 0, &flags[0] - ); - write_component_probs( - w, &mvc[1], &vp8_default_mv_context[1], &vp8_mv_update_probs[1], - cpi->mb.MVcount[1], 1, &flags[1] - ); - - if (flags[0] || flags[1]) - vp8_build_component_cost_table(cpi->mb.mvcost, (const MV_CONTEXT *) cpi->common.fc.mvc, flags); - -#ifdef VP8_ENTROPY_STATS - active_section = 5; -#endif -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/encodemv.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/encodemv.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/encodemv.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/encodemv.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_ENCODER_ENCODEMV_H_ -#define VP8_ENCODER_ENCODEMV_H_ - -#include "onyx_int.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void vp8_write_mvprobs(VP8_COMP *); -void vp8_encode_motion_vector(vp8_writer *, const MV *, const MV_CONTEXT *); -void vp8_build_component_cost_table(int *mvcost[2], const MV_CONTEXT *mvc, int mvc_flag[2]); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_ENCODEMV_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/ethreading.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/ethreading.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/ethreading.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/ethreading.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,674 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "onyx_int.h" -#include "vp8/common/threading.h" -#include "vp8/common/common.h" -#include "vp8/common/extend.h" -#include "bitstream.h" -#include "encodeframe.h" - -#if CONFIG_MULTITHREAD - -extern void vp8cx_mb_init_quantizer(VP8_COMP *cpi, MACROBLOCK *x, int ok_to_skip); - -extern void vp8_loopfilter_frame(VP8_COMP *cpi, VP8_COMMON *cm); - -static THREAD_FUNCTION thread_loopfilter(void *p_data) -{ - VP8_COMP *cpi = (VP8_COMP *)(((LPFTHREAD_DATA *)p_data)->ptr1); - VP8_COMMON *cm = &cpi->common; - - while (1) - { - if (cpi->b_multi_threaded == 0) - break; - - if (sem_wait(&cpi->h_event_start_lpf) == 0) - { - if (cpi->b_multi_threaded == 0) /* we're shutting down */ - break; - - vp8_loopfilter_frame(cpi, cm); - - sem_post(&cpi->h_event_end_lpf); - } - } - - return 0; -} - -static -THREAD_FUNCTION thread_encoding_proc(void *p_data) -{ - int ithread = ((ENCODETHREAD_DATA *)p_data)->ithread; - VP8_COMP *cpi = (VP8_COMP *)(((ENCODETHREAD_DATA *)p_data)->ptr1); - MB_ROW_COMP *mbri = (MB_ROW_COMP *)(((ENCODETHREAD_DATA *)p_data)->ptr2); - ENTROPY_CONTEXT_PLANES mb_row_left_context; - - while (1) - { - if (cpi->b_multi_threaded == 0) - break; - - if (sem_wait(&cpi->h_event_start_encoding[ithread]) == 0) - { - const int nsync = cpi->mt_sync_range; - VP8_COMMON *cm = &cpi->common; - int mb_row; - MACROBLOCK *x = &mbri->mb; - MACROBLOCKD *xd = &x->e_mbd; - TOKENEXTRA *tp ; -#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING - TOKENEXTRA *tp_start = cpi->tok + (1 + ithread) * (16 * 24); - const int num_part = (1 << cm->multi_token_partition); -#endif - - int *segment_counts = mbri->segment_counts; - int *totalrate = &mbri->totalrate; - - if (cpi->b_multi_threaded == 0) /* we're shutting down */ - break; - - for (mb_row = ithread + 1; mb_row < cm->mb_rows; mb_row += (cpi->encoding_thread_count + 1)) - { - - int recon_yoffset, recon_uvoffset; - int mb_col; - int ref_fb_idx = cm->lst_fb_idx; - int dst_fb_idx = cm->new_fb_idx; - int recon_y_stride = cm->yv12_fb[ref_fb_idx].y_stride; - int recon_uv_stride = cm->yv12_fb[ref_fb_idx].uv_stride; - int map_index = (mb_row * cm->mb_cols); - volatile const int *last_row_current_mb_col; - volatile int *current_mb_col = &cpi->mt_current_mb_col[mb_row]; - -#if (CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING) - vp8_writer *w = &cpi->bc[1 + (mb_row % num_part)]; -#else - tp = cpi->tok + (mb_row * (cm->mb_cols * 16 * 24)); - cpi->tplist[mb_row].start = tp; -#endif - - last_row_current_mb_col = &cpi->mt_current_mb_col[mb_row - 1]; - - /* reset above block coeffs */ - xd->above_context = cm->above_context; - xd->left_context = &mb_row_left_context; - - vp8_zero(mb_row_left_context); - - xd->up_available = (mb_row != 0); - recon_yoffset = (mb_row * recon_y_stride * 16); - recon_uvoffset = (mb_row * recon_uv_stride * 8); - - /* Set the mb activity pointer to the start of the row. */ - x->mb_activity_ptr = &cpi->mb_activity_map[map_index]; - - /* for each macroblock col in image */ - for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) - { - *current_mb_col = mb_col - 1; - - if ((mb_col & (nsync - 1)) == 0) - { - while (mb_col > (*last_row_current_mb_col - nsync)) - { - x86_pause_hint(); - thread_sleep(0); - } - } - -#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING - tp = tp_start; -#endif - - /* Distance of Mb to the various image edges. - * These specified to 8th pel as they are always compared - * to values that are in 1/8th pel units - */ - xd->mb_to_left_edge = -((mb_col * 16) << 3); - xd->mb_to_right_edge = ((cm->mb_cols - 1 - mb_col) * 16) << 3; - xd->mb_to_top_edge = -((mb_row * 16) << 3); - xd->mb_to_bottom_edge = ((cm->mb_rows - 1 - mb_row) * 16) << 3; - - /* Set up limit values for motion vectors used to prevent - * them extending outside the UMV borders - */ - x->mv_col_min = -((mb_col * 16) + (VP8BORDERINPIXELS - 16)); - x->mv_col_max = ((cm->mb_cols - 1 - mb_col) * 16) + (VP8BORDERINPIXELS - 16); - x->mv_row_min = -((mb_row * 16) + (VP8BORDERINPIXELS - 16)); - x->mv_row_max = ((cm->mb_rows - 1 - mb_row) * 16) + (VP8BORDERINPIXELS - 16); - - xd->dst.y_buffer = cm->yv12_fb[dst_fb_idx].y_buffer + recon_yoffset; - xd->dst.u_buffer = cm->yv12_fb[dst_fb_idx].u_buffer + recon_uvoffset; - xd->dst.v_buffer = cm->yv12_fb[dst_fb_idx].v_buffer + recon_uvoffset; - xd->left_available = (mb_col != 0); - - x->rddiv = cpi->RDDIV; - x->rdmult = cpi->RDMULT; - - /* Copy current mb to a buffer */ - vp8_copy_mem16x16(x->src.y_buffer, x->src.y_stride, x->thismb, 16); - - if (cpi->oxcf.tuning == VP8_TUNE_SSIM) - vp8_activity_masking(cpi, x); - - /* Is segmentation enabled */ - /* MB level adjustment to quantizer */ - if (xd->segmentation_enabled) - { - /* Code to set segment id in xd->mbmi.segment_id for - * current MB (with range checking) - */ - if (cpi->segmentation_map[map_index + mb_col] <= 3) - xd->mode_info_context->mbmi.segment_id = cpi->segmentation_map[map_index + mb_col]; - else - xd->mode_info_context->mbmi.segment_id = 0; - - vp8cx_mb_init_quantizer(cpi, x, 1); - } - else - /* Set to Segment 0 by default */ - xd->mode_info_context->mbmi.segment_id = 0; - - x->active_ptr = cpi->active_map + map_index + mb_col; - - if (cm->frame_type == KEY_FRAME) - { - *totalrate += vp8cx_encode_intra_macroblock(cpi, x, &tp); -#ifdef MODE_STATS - y_modes[xd->mbmi.mode] ++; -#endif - } - else - { - *totalrate += vp8cx_encode_inter_macroblock(cpi, x, &tp, recon_yoffset, recon_uvoffset, mb_row, mb_col); - -#ifdef MODE_STATS - inter_y_modes[xd->mbmi.mode] ++; - - if (xd->mbmi.mode == SPLITMV) - { - int b; - - for (b = 0; b < xd->mbmi.partition_count; b++) - { - inter_b_modes[x->partition->bmi[b].mode] ++; - } - } - -#endif - // Keep track of how many (consecutive) times a block - // is coded as ZEROMV_LASTREF, for base layer frames. - // Reset to 0 if its coded as anything else. - if (cpi->current_layer == 0) { - if (xd->mode_info_context->mbmi.mode == ZEROMV && - xd->mode_info_context->mbmi.ref_frame == - LAST_FRAME) { - // Increment, check for wrap-around. - if (cpi->consec_zero_last[map_index+mb_col] < 255) - cpi->consec_zero_last[map_index+mb_col] += 1; - if (cpi->consec_zero_last_mvbias[map_index+mb_col] < 255) - cpi->consec_zero_last_mvbias[map_index+mb_col] += 1; - } else { - cpi->consec_zero_last[map_index+mb_col] = 0; - cpi->consec_zero_last_mvbias[map_index+mb_col] = 0; - } - if (x->zero_last_dot_suppress) - cpi->consec_zero_last_mvbias[map_index+mb_col] = 0; - } - - /* Special case code for cyclic refresh - * If cyclic update enabled then copy - * xd->mbmi.segment_id; (which may have been updated - * based on mode during - * vp8cx_encode_inter_macroblock()) back into the - * global segmentation map - */ - if ((cpi->current_layer == 0) && - (cpi->cyclic_refresh_mode_enabled && - xd->segmentation_enabled)) - { - const MB_MODE_INFO * mbmi = &xd->mode_info_context->mbmi; - cpi->segmentation_map[map_index + mb_col] = mbmi->segment_id; - - /* If the block has been refreshed mark it as clean - * (the magnitude of the -ve influences how long it - * will be before we consider another refresh): - * Else if it was coded (last frame 0,0) and has - * not already been refreshed then mark it as a - * candidate for cleanup next time (marked 0) else - * mark it as dirty (1). - */ - if (mbmi->segment_id) - cpi->cyclic_refresh_map[map_index + mb_col] = -1; - else if ((mbmi->mode == ZEROMV) && (mbmi->ref_frame == LAST_FRAME)) - { - if (cpi->cyclic_refresh_map[map_index + mb_col] == 1) - cpi->cyclic_refresh_map[map_index + mb_col] = 0; - } - else - cpi->cyclic_refresh_map[map_index + mb_col] = 1; - - } - } - -#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING - /* pack tokens for this MB */ - { - int tok_count = tp - tp_start; - vp8_pack_tokens(w, tp_start, tok_count); - } -#else - cpi->tplist[mb_row].stop = tp; -#endif - /* Increment pointer into gf usage flags structure. */ - x->gf_active_ptr++; - - /* Increment the activity mask pointers. */ - x->mb_activity_ptr++; - - /* adjust to the next column of macroblocks */ - x->src.y_buffer += 16; - x->src.u_buffer += 8; - x->src.v_buffer += 8; - - recon_yoffset += 16; - recon_uvoffset += 8; - - /* Keep track of segment usage */ - segment_counts[xd->mode_info_context->mbmi.segment_id]++; - - /* skip to next mb */ - xd->mode_info_context++; - x->partition_info++; - xd->above_context++; - } - - vp8_extend_mb_row( &cm->yv12_fb[dst_fb_idx], - xd->dst.y_buffer + 16, - xd->dst.u_buffer + 8, - xd->dst.v_buffer + 8); - - *current_mb_col = mb_col + nsync; - - /* this is to account for the border */ - xd->mode_info_context++; - x->partition_info++; - - x->src.y_buffer += 16 * x->src.y_stride * (cpi->encoding_thread_count + 1) - 16 * cm->mb_cols; - x->src.u_buffer += 8 * x->src.uv_stride * (cpi->encoding_thread_count + 1) - 8 * cm->mb_cols; - x->src.v_buffer += 8 * x->src.uv_stride * (cpi->encoding_thread_count + 1) - 8 * cm->mb_cols; - - xd->mode_info_context += xd->mode_info_stride * cpi->encoding_thread_count; - x->partition_info += xd->mode_info_stride * cpi->encoding_thread_count; - x->gf_active_ptr += cm->mb_cols * cpi->encoding_thread_count; - - if (mb_row == cm->mb_rows - 1) - { - sem_post(&cpi->h_event_end_encoding); /* signal frame encoding end */ - } - } - } - } - - /* printf("exit thread %d\n", ithread); */ - return 0; -} - -static void setup_mbby_copy(MACROBLOCK *mbdst, MACROBLOCK *mbsrc) -{ - - MACROBLOCK *x = mbsrc; - MACROBLOCK *z = mbdst; - int i; - - z->ss = x->ss; - z->ss_count = x->ss_count; - z->searches_per_step = x->searches_per_step; - z->errorperbit = x->errorperbit; - - z->sadperbit16 = x->sadperbit16; - z->sadperbit4 = x->sadperbit4; - - /* - z->mv_col_min = x->mv_col_min; - z->mv_col_max = x->mv_col_max; - z->mv_row_min = x->mv_row_min; - z->mv_row_max = x->mv_row_max; - */ - - z->short_fdct4x4 = x->short_fdct4x4; - z->short_fdct8x4 = x->short_fdct8x4; - z->short_walsh4x4 = x->short_walsh4x4; - z->quantize_b = x->quantize_b; - z->optimize = x->optimize; - - /* - z->mvc = x->mvc; - z->src.y_buffer = x->src.y_buffer; - z->src.u_buffer = x->src.u_buffer; - z->src.v_buffer = x->src.v_buffer; - */ - - z->mvcost[0] = x->mvcost[0]; - z->mvcost[1] = x->mvcost[1]; - z->mvsadcost[0] = x->mvsadcost[0]; - z->mvsadcost[1] = x->mvsadcost[1]; - - z->token_costs = x->token_costs; - z->inter_bmode_costs = x->inter_bmode_costs; - z->mbmode_cost = x->mbmode_cost; - z->intra_uv_mode_cost = x->intra_uv_mode_cost; - z->bmode_costs = x->bmode_costs; - - for (i = 0; i < 25; i++) - { - z->block[i].quant = x->block[i].quant; - z->block[i].quant_fast = x->block[i].quant_fast; - z->block[i].quant_shift = x->block[i].quant_shift; - z->block[i].zbin = x->block[i].zbin; - z->block[i].zrun_zbin_boost = x->block[i].zrun_zbin_boost; - z->block[i].round = x->block[i].round; - z->block[i].src_stride = x->block[i].src_stride; - } - - z->q_index = x->q_index; - z->act_zbin_adj = x->act_zbin_adj; - z->last_act_zbin_adj = x->last_act_zbin_adj; - - { - MACROBLOCKD *xd = &x->e_mbd; - MACROBLOCKD *zd = &z->e_mbd; - - /* - zd->mode_info_context = xd->mode_info_context; - zd->mode_info = xd->mode_info; - - zd->mode_info_stride = xd->mode_info_stride; - zd->frame_type = xd->frame_type; - zd->up_available = xd->up_available ; - zd->left_available = xd->left_available; - zd->left_context = xd->left_context; - zd->last_frame_dc = xd->last_frame_dc; - zd->last_frame_dccons = xd->last_frame_dccons; - zd->gold_frame_dc = xd->gold_frame_dc; - zd->gold_frame_dccons = xd->gold_frame_dccons; - zd->mb_to_left_edge = xd->mb_to_left_edge; - zd->mb_to_right_edge = xd->mb_to_right_edge; - zd->mb_to_top_edge = xd->mb_to_top_edge ; - zd->mb_to_bottom_edge = xd->mb_to_bottom_edge; - zd->gf_active_ptr = xd->gf_active_ptr; - zd->frames_since_golden = xd->frames_since_golden; - zd->frames_till_alt_ref_frame = xd->frames_till_alt_ref_frame; - */ - zd->subpixel_predict = xd->subpixel_predict; - zd->subpixel_predict8x4 = xd->subpixel_predict8x4; - zd->subpixel_predict8x8 = xd->subpixel_predict8x8; - zd->subpixel_predict16x16 = xd->subpixel_predict16x16; - zd->segmentation_enabled = xd->segmentation_enabled; - zd->mb_segement_abs_delta = xd->mb_segement_abs_delta; - vpx_memcpy(zd->segment_feature_data, xd->segment_feature_data, - sizeof(xd->segment_feature_data)); - - vpx_memcpy(zd->dequant_y1_dc, xd->dequant_y1_dc, - sizeof(xd->dequant_y1_dc)); - vpx_memcpy(zd->dequant_y1, xd->dequant_y1, sizeof(xd->dequant_y1)); - vpx_memcpy(zd->dequant_y2, xd->dequant_y2, sizeof(xd->dequant_y2)); - vpx_memcpy(zd->dequant_uv, xd->dequant_uv, sizeof(xd->dequant_uv)); - -#if 1 - /*TODO: Remove dequant from BLOCKD. This is a temporary solution until - * the quantizer code uses a passed in pointer to the dequant constants. - * This will also require modifications to the x86 and neon assembly. - * */ - for (i = 0; i < 16; i++) - zd->block[i].dequant = zd->dequant_y1; - for (i = 16; i < 24; i++) - zd->block[i].dequant = zd->dequant_uv; - zd->block[24].dequant = zd->dequant_y2; -#endif - - - vpx_memcpy(z->rd_threshes, x->rd_threshes, sizeof(x->rd_threshes)); - vpx_memcpy(z->rd_thresh_mult, x->rd_thresh_mult, - sizeof(x->rd_thresh_mult)); - - z->zbin_over_quant = x->zbin_over_quant; - z->zbin_mode_boost_enabled = x->zbin_mode_boost_enabled; - z->zbin_mode_boost = x->zbin_mode_boost; - - vpx_memset(z->error_bins, 0, sizeof(z->error_bins)); - } -} - -void vp8cx_init_mbrthread_data(VP8_COMP *cpi, - MACROBLOCK *x, - MB_ROW_COMP *mbr_ei, - int count - ) -{ - - VP8_COMMON *const cm = & cpi->common; - MACROBLOCKD *const xd = & x->e_mbd; - int i; - - for (i = 0; i < count; i++) - { - MACROBLOCK *mb = & mbr_ei[i].mb; - MACROBLOCKD *mbd = &mb->e_mbd; - - mbd->subpixel_predict = xd->subpixel_predict; - mbd->subpixel_predict8x4 = xd->subpixel_predict8x4; - mbd->subpixel_predict8x8 = xd->subpixel_predict8x8; - mbd->subpixel_predict16x16 = xd->subpixel_predict16x16; - mb->gf_active_ptr = x->gf_active_ptr; - - vpx_memset(mbr_ei[i].segment_counts, 0, sizeof(mbr_ei[i].segment_counts)); - mbr_ei[i].totalrate = 0; - - mb->partition_info = x->pi + x->e_mbd.mode_info_stride * (i + 1); - - mbd->mode_info_context = cm->mi + x->e_mbd.mode_info_stride * (i + 1); - mbd->mode_info_stride = cm->mode_info_stride; - - mbd->frame_type = cm->frame_type; - - mb->src = * cpi->Source; - mbd->pre = cm->yv12_fb[cm->lst_fb_idx]; - mbd->dst = cm->yv12_fb[cm->new_fb_idx]; - - mb->src.y_buffer += 16 * x->src.y_stride * (i + 1); - mb->src.u_buffer += 8 * x->src.uv_stride * (i + 1); - mb->src.v_buffer += 8 * x->src.uv_stride * (i + 1); - - vp8_build_block_offsets(mb); - - mbd->left_context = &cm->left_context; - mb->mvc = cm->fc.mvc; - - setup_mbby_copy(&mbr_ei[i].mb, x); - - mbd->fullpixel_mask = 0xffffffff; - if(cm->full_pixel) - mbd->fullpixel_mask = 0xfffffff8; - - vp8_zero(mb->coef_counts); - vp8_zero(x->ymode_count); - mb->skip_true_count = 0; - vp8_zero(mb->MVcount); - mb->prediction_error = 0; - mb->intra_error = 0; - vp8_zero(mb->count_mb_ref_frame_usage); - mb->mbs_tested_so_far = 0; - mb->mbs_zero_last_dot_suppress = 0; - } -} - -int vp8cx_create_encoder_threads(VP8_COMP *cpi) -{ - const VP8_COMMON * cm = &cpi->common; - - cpi->b_multi_threaded = 0; - cpi->encoding_thread_count = 0; - cpi->b_lpf_running = 0; - - if (cm->processor_core_count > 1 && cpi->oxcf.multi_threaded > 1) - { - int ithread; - int th_count = cpi->oxcf.multi_threaded - 1; - int rc = 0; - - /* don't allocate more threads than cores available */ - if (cpi->oxcf.multi_threaded > cm->processor_core_count) - th_count = cm->processor_core_count - 1; - - /* we have th_count + 1 (main) threads processing one row each */ - /* no point to have more threads than the sync range allows */ - if(th_count > ((cm->mb_cols / cpi->mt_sync_range) - 1)) - { - th_count = (cm->mb_cols / cpi->mt_sync_range) - 1; - } - - if(th_count == 0) - return 0; - - CHECK_MEM_ERROR(cpi->h_encoding_thread, - vpx_malloc(sizeof(pthread_t) * th_count)); - CHECK_MEM_ERROR(cpi->h_event_start_encoding, - vpx_malloc(sizeof(sem_t) * th_count)); - CHECK_MEM_ERROR(cpi->mb_row_ei, - vpx_memalign(32, sizeof(MB_ROW_COMP) * th_count)); - vpx_memset(cpi->mb_row_ei, 0, sizeof(MB_ROW_COMP) * th_count); - CHECK_MEM_ERROR(cpi->en_thread_data, - vpx_malloc(sizeof(ENCODETHREAD_DATA) * th_count)); - - sem_init(&cpi->h_event_end_encoding, 0, 0); - - cpi->b_multi_threaded = 1; - cpi->encoding_thread_count = th_count; - - /* - printf("[VP8:] multi_threaded encoding is enabled with %d threads\n\n", - (cpi->encoding_thread_count +1)); - */ - - for (ithread = 0; ithread < th_count; ithread++) - { - ENCODETHREAD_DATA *ethd = &cpi->en_thread_data[ithread]; - - /* Setup block ptrs and offsets */ - vp8_setup_block_ptrs(&cpi->mb_row_ei[ithread].mb); - vp8_setup_block_dptrs(&cpi->mb_row_ei[ithread].mb.e_mbd); - - sem_init(&cpi->h_event_start_encoding[ithread], 0, 0); - - ethd->ithread = ithread; - ethd->ptr1 = (void *)cpi; - ethd->ptr2 = (void *)&cpi->mb_row_ei[ithread]; - - rc = pthread_create(&cpi->h_encoding_thread[ithread], 0, - thread_encoding_proc, ethd); - if(rc) - break; - } - - if(rc) - { - /* shutdown other threads */ - cpi->b_multi_threaded = 0; - for(--ithread; ithread >= 0; ithread--) - { - pthread_join(cpi->h_encoding_thread[ithread], 0); - sem_destroy(&cpi->h_event_start_encoding[ithread]); - } - sem_destroy(&cpi->h_event_end_encoding); - - /* free thread related resources */ - vpx_free(cpi->h_event_start_encoding); - vpx_free(cpi->h_encoding_thread); - vpx_free(cpi->mb_row_ei); - vpx_free(cpi->en_thread_data); - - return -1; - } - - - { - LPFTHREAD_DATA * lpfthd = &cpi->lpf_thread_data; - - sem_init(&cpi->h_event_start_lpf, 0, 0); - sem_init(&cpi->h_event_end_lpf, 0, 0); - - lpfthd->ptr1 = (void *)cpi; - rc = pthread_create(&cpi->h_filter_thread, 0, thread_loopfilter, - lpfthd); - - if(rc) - { - /* shutdown other threads */ - cpi->b_multi_threaded = 0; - for(--ithread; ithread >= 0; ithread--) - { - sem_post(&cpi->h_event_start_encoding[ithread]); - pthread_join(cpi->h_encoding_thread[ithread], 0); - sem_destroy(&cpi->h_event_start_encoding[ithread]); - } - sem_destroy(&cpi->h_event_end_encoding); - sem_destroy(&cpi->h_event_end_lpf); - sem_destroy(&cpi->h_event_start_lpf); - - /* free thread related resources */ - vpx_free(cpi->h_event_start_encoding); - vpx_free(cpi->h_encoding_thread); - vpx_free(cpi->mb_row_ei); - vpx_free(cpi->en_thread_data); - - return -2; - } - } - } - return 0; -} - -void vp8cx_remove_encoder_threads(VP8_COMP *cpi) -{ - if (cpi->b_multi_threaded) - { - /* shutdown other threads */ - cpi->b_multi_threaded = 0; - { - int i; - - for (i = 0; i < cpi->encoding_thread_count; i++) - { - sem_post(&cpi->h_event_start_encoding[i]); - pthread_join(cpi->h_encoding_thread[i], 0); - - sem_destroy(&cpi->h_event_start_encoding[i]); - } - - sem_post(&cpi->h_event_start_lpf); - pthread_join(cpi->h_filter_thread, 0); - } - - sem_destroy(&cpi->h_event_end_encoding); - sem_destroy(&cpi->h_event_end_lpf); - sem_destroy(&cpi->h_event_start_lpf); - - /* free thread related resources */ - vpx_free(cpi->h_event_start_encoding); - vpx_free(cpi->h_encoding_thread); - vpx_free(cpi->mb_row_ei); - vpx_free(cpi->en_thread_data); - } -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/firstpass.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/firstpass.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/firstpass.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/firstpass.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,3372 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include - -#include "./vpx_scale_rtcd.h" -#include "block.h" -#include "onyx_int.h" -#include "vp8/common/variance.h" -#include "encodeintra.h" -#include "vp8/common/setupintrarecon.h" -#include "vp8/common/systemdependent.h" -#include "mcomp.h" -#include "firstpass.h" -#include "vpx_scale/vpx_scale.h" -#include "encodemb.h" -#include "vp8/common/extend.h" -#include "vpx_mem/vpx_mem.h" -#include "vp8/common/swapyv12buffer.h" -#include "rdopt.h" -#include "vp8/common/quant_common.h" -#include "encodemv.h" -#include "encodeframe.h" - -/* #define OUTPUT_FPF 1 */ - -extern void vp8cx_frame_init_quantizer(VP8_COMP *cpi); -extern void vp8_set_mbmode_and_mvs(MACROBLOCK *x, MB_PREDICTION_MODE mb, int_mv *mv); -extern void vp8_alloc_compressor_data(VP8_COMP *cpi); - -#define GFQ_ADJUSTMENT vp8_gf_boost_qadjustment[Q] -extern int vp8_kf_boost_qadjustment[QINDEX_RANGE]; - -extern const int vp8_gf_boost_qadjustment[QINDEX_RANGE]; - -#define IIFACTOR 1.5 -#define IIKFACTOR1 1.40 -#define IIKFACTOR2 1.5 -#define RMAX 14.0 -#define GF_RMAX 48.0 - -#define KF_MB_INTRA_MIN 300 -#define GF_MB_INTRA_MIN 200 - -#define DOUBLE_DIVIDE_CHECK(X) ((X)<0?(X)-.000001:(X)+.000001) - -#define POW1 (double)cpi->oxcf.two_pass_vbrbias/100.0 -#define POW2 (double)cpi->oxcf.two_pass_vbrbias/100.0 - -#define NEW_BOOST 1 - -static int vscale_lookup[7] = {0, 1, 1, 2, 2, 3, 3}; -static int hscale_lookup[7] = {0, 0, 1, 1, 2, 2, 3}; - - -static const int cq_level[QINDEX_RANGE] = -{ - 0,0,1,1,2,3,3,4,4,5,6,6,7,8,8,9, - 9,10,11,11,12,13,13,14,15,15,16,17,17,18,19,20, - 20,21,22,22,23,24,24,25,26,27,27,28,29,30,30,31, - 32,33,33,34,35,36,36,37,38,39,39,40,41,42,42,43, - 44,45,46,46,47,48,49,50,50,51,52,53,54,55,55,56, - 57,58,59,60,60,61,62,63,64,65,66,67,67,68,69,70, - 71,72,73,74,75,75,76,77,78,79,80,81,82,83,84,85, - 86,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100 -}; - -static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame); - -/* Resets the first pass file to the given position using a relative seek - * from the current position - */ -static void reset_fpf_position(VP8_COMP *cpi, FIRSTPASS_STATS *Position) -{ - cpi->twopass.stats_in = Position; -} - -static int lookup_next_frame_stats(VP8_COMP *cpi, FIRSTPASS_STATS *next_frame) -{ - if (cpi->twopass.stats_in >= cpi->twopass.stats_in_end) - return EOF; - - *next_frame = *cpi->twopass.stats_in; - return 1; -} - -/* Read frame stats at an offset from the current position */ -static int read_frame_stats( VP8_COMP *cpi, - FIRSTPASS_STATS *frame_stats, - int offset ) -{ - FIRSTPASS_STATS * fps_ptr = cpi->twopass.stats_in; - - /* Check legality of offset */ - if ( offset >= 0 ) - { - if ( &fps_ptr[offset] >= cpi->twopass.stats_in_end ) - return EOF; - } - else if ( offset < 0 ) - { - if ( &fps_ptr[offset] < cpi->twopass.stats_in_start ) - return EOF; - } - - *frame_stats = fps_ptr[offset]; - return 1; -} - -static int input_stats(VP8_COMP *cpi, FIRSTPASS_STATS *fps) -{ - if (cpi->twopass.stats_in >= cpi->twopass.stats_in_end) - return EOF; - - *fps = *cpi->twopass.stats_in; - cpi->twopass.stats_in = - (void*)((char *)cpi->twopass.stats_in + sizeof(FIRSTPASS_STATS)); - return 1; -} - -static void output_stats(const VP8_COMP *cpi, - struct vpx_codec_pkt_list *pktlist, - FIRSTPASS_STATS *stats) -{ - struct vpx_codec_cx_pkt pkt; - (void)cpi; - pkt.kind = VPX_CODEC_STATS_PKT; - pkt.data.twopass_stats.buf = stats; - pkt.data.twopass_stats.sz = sizeof(FIRSTPASS_STATS); - vpx_codec_pkt_list_add(pktlist, &pkt); - -/* TEMP debug code */ -#if OUTPUT_FPF - - { - FILE *fpfile; - fpfile = fopen("firstpass.stt", "a"); - - fprintf(fpfile, "%12.0f %12.0f %12.0f %12.4f %12.4f %12.4f %12.4f" - " %12.4f %12.4f %12.4f %12.4f %12.4f %12.4f %12.4f %12.4f" - " %12.0f %12.0f %12.4f\n", - stats->frame, - stats->intra_error, - stats->coded_error, - stats->ssim_weighted_pred_err, - stats->pcnt_inter, - stats->pcnt_motion, - stats->pcnt_second_ref, - stats->pcnt_neutral, - stats->MVr, - stats->mvr_abs, - stats->MVc, - stats->mvc_abs, - stats->MVrv, - stats->MVcv, - stats->mv_in_out_count, - stats->new_mv_count, - stats->count, - stats->duration); - fclose(fpfile); - } -#endif -} - -static void zero_stats(FIRSTPASS_STATS *section) -{ - section->frame = 0.0; - section->intra_error = 0.0; - section->coded_error = 0.0; - section->ssim_weighted_pred_err = 0.0; - section->pcnt_inter = 0.0; - section->pcnt_motion = 0.0; - section->pcnt_second_ref = 0.0; - section->pcnt_neutral = 0.0; - section->MVr = 0.0; - section->mvr_abs = 0.0; - section->MVc = 0.0; - section->mvc_abs = 0.0; - section->MVrv = 0.0; - section->MVcv = 0.0; - section->mv_in_out_count = 0.0; - section->new_mv_count = 0.0; - section->count = 0.0; - section->duration = 1.0; -} - -static void accumulate_stats(FIRSTPASS_STATS *section, FIRSTPASS_STATS *frame) -{ - section->frame += frame->frame; - section->intra_error += frame->intra_error; - section->coded_error += frame->coded_error; - section->ssim_weighted_pred_err += frame->ssim_weighted_pred_err; - section->pcnt_inter += frame->pcnt_inter; - section->pcnt_motion += frame->pcnt_motion; - section->pcnt_second_ref += frame->pcnt_second_ref; - section->pcnt_neutral += frame->pcnt_neutral; - section->MVr += frame->MVr; - section->mvr_abs += frame->mvr_abs; - section->MVc += frame->MVc; - section->mvc_abs += frame->mvc_abs; - section->MVrv += frame->MVrv; - section->MVcv += frame->MVcv; - section->mv_in_out_count += frame->mv_in_out_count; - section->new_mv_count += frame->new_mv_count; - section->count += frame->count; - section->duration += frame->duration; -} - -static void subtract_stats(FIRSTPASS_STATS *section, FIRSTPASS_STATS *frame) -{ - section->frame -= frame->frame; - section->intra_error -= frame->intra_error; - section->coded_error -= frame->coded_error; - section->ssim_weighted_pred_err -= frame->ssim_weighted_pred_err; - section->pcnt_inter -= frame->pcnt_inter; - section->pcnt_motion -= frame->pcnt_motion; - section->pcnt_second_ref -= frame->pcnt_second_ref; - section->pcnt_neutral -= frame->pcnt_neutral; - section->MVr -= frame->MVr; - section->mvr_abs -= frame->mvr_abs; - section->MVc -= frame->MVc; - section->mvc_abs -= frame->mvc_abs; - section->MVrv -= frame->MVrv; - section->MVcv -= frame->MVcv; - section->mv_in_out_count -= frame->mv_in_out_count; - section->new_mv_count -= frame->new_mv_count; - section->count -= frame->count; - section->duration -= frame->duration; -} - -static void avg_stats(FIRSTPASS_STATS *section) -{ - if (section->count < 1.0) - return; - - section->intra_error /= section->count; - section->coded_error /= section->count; - section->ssim_weighted_pred_err /= section->count; - section->pcnt_inter /= section->count; - section->pcnt_second_ref /= section->count; - section->pcnt_neutral /= section->count; - section->pcnt_motion /= section->count; - section->MVr /= section->count; - section->mvr_abs /= section->count; - section->MVc /= section->count; - section->mvc_abs /= section->count; - section->MVrv /= section->count; - section->MVcv /= section->count; - section->mv_in_out_count /= section->count; - section->duration /= section->count; -} - -/* Calculate a modified Error used in distributing bits between easier - * and harder frames - */ -static double calculate_modified_err(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) -{ - double av_err = ( cpi->twopass.total_stats.ssim_weighted_pred_err / - cpi->twopass.total_stats.count ); - double this_err = this_frame->ssim_weighted_pred_err; - double modified_err; - - if (this_err > av_err) - modified_err = av_err * pow((this_err / DOUBLE_DIVIDE_CHECK(av_err)), POW1); - else - modified_err = av_err * pow((this_err / DOUBLE_DIVIDE_CHECK(av_err)), POW2); - - return modified_err; -} - -static const double weight_table[256] = { -0.020000, 0.020000, 0.020000, 0.020000, 0.020000, 0.020000, 0.020000, 0.020000, -0.020000, 0.020000, 0.020000, 0.020000, 0.020000, 0.020000, 0.020000, 0.020000, -0.020000, 0.020000, 0.020000, 0.020000, 0.020000, 0.020000, 0.020000, 0.020000, -0.020000, 0.020000, 0.020000, 0.020000, 0.020000, 0.020000, 0.020000, 0.020000, -0.020000, 0.031250, 0.062500, 0.093750, 0.125000, 0.156250, 0.187500, 0.218750, -0.250000, 0.281250, 0.312500, 0.343750, 0.375000, 0.406250, 0.437500, 0.468750, -0.500000, 0.531250, 0.562500, 0.593750, 0.625000, 0.656250, 0.687500, 0.718750, -0.750000, 0.781250, 0.812500, 0.843750, 0.875000, 0.906250, 0.937500, 0.968750, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, -1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000 -}; - -static double simple_weight(YV12_BUFFER_CONFIG *source) -{ - int i, j; - - unsigned char *src = source->y_buffer; - double sum_weights = 0.0; - - /* Loop throught the Y plane raw examining levels and creating a weight - * for the image - */ - i = source->y_height; - do - { - j = source->y_width; - do - { - sum_weights += weight_table[ *src]; - src++; - }while(--j); - src -= source->y_width; - src += source->y_stride; - }while(--i); - - sum_weights /= (source->y_height * source->y_width); - - return sum_weights; -} - - -/* This function returns the current per frame maximum bitrate target */ -static int frame_max_bits(VP8_COMP *cpi) -{ - /* Max allocation for a single frame based on the max section guidelines - * passed in and how many bits are left - */ - int max_bits; - - /* For CBR we need to also consider buffer fullness. - * If we are running below the optimal level then we need to gradually - * tighten up on max_bits. - */ - if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) - { - double buffer_fullness_ratio = (double)cpi->buffer_level / DOUBLE_DIVIDE_CHECK((double)cpi->oxcf.optimal_buffer_level); - - /* For CBR base this on the target average bits per frame plus the - * maximum sedction rate passed in by the user - */ - max_bits = (int)(cpi->av_per_frame_bandwidth * ((double)cpi->oxcf.two_pass_vbrmax_section / 100.0)); - - /* If our buffer is below the optimum level */ - if (buffer_fullness_ratio < 1.0) - { - /* The lower of max_bits / 4 or cpi->av_per_frame_bandwidth / 4. */ - int min_max_bits = ((cpi->av_per_frame_bandwidth >> 2) < (max_bits >> 2)) ? cpi->av_per_frame_bandwidth >> 2 : max_bits >> 2; - - max_bits = (int)(max_bits * buffer_fullness_ratio); - - /* Lowest value we will set ... which should allow the buffer to - * refill. - */ - if (max_bits < min_max_bits) - max_bits = min_max_bits; - } - } - /* VBR */ - else - { - /* For VBR base this on the bits and frames left plus the - * two_pass_vbrmax_section rate passed in by the user - */ - max_bits = (int)(((double)cpi->twopass.bits_left / (cpi->twopass.total_stats.count - (double)cpi->common.current_video_frame)) * ((double)cpi->oxcf.two_pass_vbrmax_section / 100.0)); - } - - /* Trap case where we are out of bits */ - if (max_bits < 0) - max_bits = 0; - - return max_bits; -} - -void vp8_init_first_pass(VP8_COMP *cpi) -{ - zero_stats(&cpi->twopass.total_stats); -} - -void vp8_end_first_pass(VP8_COMP *cpi) -{ - output_stats(cpi, cpi->output_pkt_list, &cpi->twopass.total_stats); -} - -static void zz_motion_search( VP8_COMP *cpi, MACROBLOCK * x, - YV12_BUFFER_CONFIG * raw_buffer, - int * raw_motion_err, - YV12_BUFFER_CONFIG * recon_buffer, - int * best_motion_err, int recon_yoffset) -{ - MACROBLOCKD * const xd = & x->e_mbd; - BLOCK *b = &x->block[0]; - BLOCKD *d = &x->e_mbd.block[0]; - - unsigned char *src_ptr = (*(b->base_src) + b->src); - int src_stride = b->src_stride; - unsigned char *raw_ptr; - int raw_stride = raw_buffer->y_stride; - unsigned char *ref_ptr; - int ref_stride = x->e_mbd.pre.y_stride; - (void)cpi; - - /* Set up pointers for this macro block raw buffer */ - raw_ptr = (unsigned char *)(raw_buffer->y_buffer + recon_yoffset - + d->offset); - vp8_mse16x16 ( src_ptr, src_stride, raw_ptr, raw_stride, - (unsigned int *)(raw_motion_err)); - - /* Set up pointers for this macro block recon buffer */ - xd->pre.y_buffer = recon_buffer->y_buffer + recon_yoffset; - ref_ptr = (unsigned char *)(xd->pre.y_buffer + d->offset ); - vp8_mse16x16 ( src_ptr, src_stride, ref_ptr, ref_stride, - (unsigned int *)(best_motion_err)); -} - -static void first_pass_motion_search(VP8_COMP *cpi, MACROBLOCK *x, - int_mv *ref_mv, MV *best_mv, - YV12_BUFFER_CONFIG *recon_buffer, - int *best_motion_err, int recon_yoffset ) -{ - MACROBLOCKD *const xd = & x->e_mbd; - BLOCK *b = &x->block[0]; - BLOCKD *d = &x->e_mbd.block[0]; - int num00; - - int_mv tmp_mv; - int_mv ref_mv_full; - - int tmp_err; - int step_param = 3; /* Dont search over full range for first pass */ - int further_steps = (MAX_MVSEARCH_STEPS - 1) - step_param; - int n; - vp8_variance_fn_ptr_t v_fn_ptr = cpi->fn_ptr[BLOCK_16X16]; - int new_mv_mode_penalty = 256; - - /* override the default variance function to use MSE */ - v_fn_ptr.vf = vp8_mse16x16; - - /* Set up pointers for this macro block recon buffer */ - xd->pre.y_buffer = recon_buffer->y_buffer + recon_yoffset; - - /* Initial step/diamond search centred on best mv */ - tmp_mv.as_int = 0; - ref_mv_full.as_mv.col = ref_mv->as_mv.col>>3; - ref_mv_full.as_mv.row = ref_mv->as_mv.row>>3; - tmp_err = cpi->diamond_search_sad(x, b, d, &ref_mv_full, &tmp_mv, step_param, - x->sadperbit16, &num00, &v_fn_ptr, - x->mvcost, ref_mv); - if ( tmp_err < INT_MAX-new_mv_mode_penalty ) - tmp_err += new_mv_mode_penalty; - - if (tmp_err < *best_motion_err) - { - *best_motion_err = tmp_err; - best_mv->row = tmp_mv.as_mv.row; - best_mv->col = tmp_mv.as_mv.col; - } - - /* Further step/diamond searches as necessary */ - n = num00; - num00 = 0; - - while (n < further_steps) - { - n++; - - if (num00) - num00--; - else - { - tmp_err = cpi->diamond_search_sad(x, b, d, &ref_mv_full, &tmp_mv, - step_param + n, x->sadperbit16, - &num00, &v_fn_ptr, x->mvcost, - ref_mv); - if ( tmp_err < INT_MAX-new_mv_mode_penalty ) - tmp_err += new_mv_mode_penalty; - - if (tmp_err < *best_motion_err) - { - *best_motion_err = tmp_err; - best_mv->row = tmp_mv.as_mv.row; - best_mv->col = tmp_mv.as_mv.col; - } - } - } -} - -void vp8_first_pass(VP8_COMP *cpi) -{ - int mb_row, mb_col; - MACROBLOCK *const x = & cpi->mb; - VP8_COMMON *const cm = & cpi->common; - MACROBLOCKD *const xd = & x->e_mbd; - - int recon_yoffset, recon_uvoffset; - YV12_BUFFER_CONFIG *lst_yv12 = &cm->yv12_fb[cm->lst_fb_idx]; - YV12_BUFFER_CONFIG *new_yv12 = &cm->yv12_fb[cm->new_fb_idx]; - YV12_BUFFER_CONFIG *gld_yv12 = &cm->yv12_fb[cm->gld_fb_idx]; - int recon_y_stride = lst_yv12->y_stride; - int recon_uv_stride = lst_yv12->uv_stride; - int64_t intra_error = 0; - int64_t coded_error = 0; - - int sum_mvr = 0, sum_mvc = 0; - int sum_mvr_abs = 0, sum_mvc_abs = 0; - int sum_mvrs = 0, sum_mvcs = 0; - int mvcount = 0; - int intercount = 0; - int second_ref_count = 0; - int intrapenalty = 256; - int neutral_count = 0; - int new_mv_count = 0; - int sum_in_vectors = 0; - uint32_t lastmv_as_int = 0; - - int_mv zero_ref_mv; - - zero_ref_mv.as_int = 0; - - vp8_clear_system_state(); - - x->src = * cpi->Source; - xd->pre = *lst_yv12; - xd->dst = *new_yv12; - - x->partition_info = x->pi; - - xd->mode_info_context = cm->mi; - - if(!cm->use_bilinear_mc_filter) - { - xd->subpixel_predict = vp8_sixtap_predict4x4; - xd->subpixel_predict8x4 = vp8_sixtap_predict8x4; - xd->subpixel_predict8x8 = vp8_sixtap_predict8x8; - xd->subpixel_predict16x16 = vp8_sixtap_predict16x16; - } - else - { - xd->subpixel_predict = vp8_bilinear_predict4x4; - xd->subpixel_predict8x4 = vp8_bilinear_predict8x4; - xd->subpixel_predict8x8 = vp8_bilinear_predict8x8; - xd->subpixel_predict16x16 = vp8_bilinear_predict16x16; - } - - vp8_build_block_offsets(x); - - /* set up frame new frame for intra coded blocks */ - vp8_setup_intra_recon(new_yv12); - vp8cx_frame_init_quantizer(cpi); - - /* Initialise the MV cost table to the defaults */ - { - int flag[2] = {1, 1}; - vp8_initialize_rd_consts(cpi, x, vp8_dc_quant(cm->base_qindex, cm->y1dc_delta_q)); - vpx_memcpy(cm->fc.mvc, vp8_default_mv_context, sizeof(vp8_default_mv_context)); - vp8_build_component_cost_table(cpi->mb.mvcost, (const MV_CONTEXT *) cm->fc.mvc, flag); - } - - /* for each macroblock row in image */ - for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) - { - int_mv best_ref_mv; - - best_ref_mv.as_int = 0; - - /* reset above block coeffs */ - xd->up_available = (mb_row != 0); - recon_yoffset = (mb_row * recon_y_stride * 16); - recon_uvoffset = (mb_row * recon_uv_stride * 8); - - /* Set up limit values for motion vectors to prevent them extending - * outside the UMV borders - */ - x->mv_row_min = -((mb_row * 16) + (VP8BORDERINPIXELS - 16)); - x->mv_row_max = ((cm->mb_rows - 1 - mb_row) * 16) + (VP8BORDERINPIXELS - 16); - - - /* for each macroblock col in image */ - for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) - { - int this_error; - int gf_motion_error = INT_MAX; - int use_dc_pred = (mb_col || mb_row) && (!mb_col || !mb_row); - - xd->dst.y_buffer = new_yv12->y_buffer + recon_yoffset; - xd->dst.u_buffer = new_yv12->u_buffer + recon_uvoffset; - xd->dst.v_buffer = new_yv12->v_buffer + recon_uvoffset; - xd->left_available = (mb_col != 0); - - /* Copy current mb to a buffer */ - vp8_copy_mem16x16(x->src.y_buffer, x->src.y_stride, x->thismb, 16); - - /* do intra 16x16 prediction */ - this_error = vp8_encode_intra(cpi, x, use_dc_pred); - - /* "intrapenalty" below deals with situations where the intra - * and inter error scores are very low (eg a plain black frame) - * We do not have special cases in first pass for 0,0 and - * nearest etc so all inter modes carry an overhead cost - * estimate fot the mv. When the error score is very low this - * causes us to pick all or lots of INTRA modes and throw lots - * of key frames. This penalty adds a cost matching that of a - * 0,0 mv to the intra case. - */ - this_error += intrapenalty; - - /* Cumulative intra error total */ - intra_error += (int64_t)this_error; - - /* Set up limit values for motion vectors to prevent them - * extending outside the UMV borders - */ - x->mv_col_min = -((mb_col * 16) + (VP8BORDERINPIXELS - 16)); - x->mv_col_max = ((cm->mb_cols - 1 - mb_col) * 16) + (VP8BORDERINPIXELS - 16); - - /* Other than for the first frame do a motion search */ - if (cm->current_video_frame > 0) - { - BLOCKD *d = &x->e_mbd.block[0]; - MV tmp_mv = {0, 0}; - int tmp_err; - int motion_error = INT_MAX; - int raw_motion_error = INT_MAX; - - /* Simple 0,0 motion with no mv overhead */ - zz_motion_search( cpi, x, cpi->last_frame_unscaled_source, - &raw_motion_error, lst_yv12, &motion_error, - recon_yoffset ); - d->bmi.mv.as_mv.row = 0; - d->bmi.mv.as_mv.col = 0; - - if (raw_motion_error < cpi->oxcf.encode_breakout) - goto skip_motion_search; - - /* Test last reference frame using the previous best mv as the - * starting point (best reference) for the search - */ - first_pass_motion_search(cpi, x, &best_ref_mv, - &d->bmi.mv.as_mv, lst_yv12, - &motion_error, recon_yoffset); - - /* If the current best reference mv is not centred on 0,0 - * then do a 0,0 based search as well - */ - if (best_ref_mv.as_int) - { - tmp_err = INT_MAX; - first_pass_motion_search(cpi, x, &zero_ref_mv, &tmp_mv, - lst_yv12, &tmp_err, recon_yoffset); - - if ( tmp_err < motion_error ) - { - motion_error = tmp_err; - d->bmi.mv.as_mv.row = tmp_mv.row; - d->bmi.mv.as_mv.col = tmp_mv.col; - } - } - - /* Experimental search in a second reference frame ((0,0) - * based only) - */ - if (cm->current_video_frame > 1) - { - first_pass_motion_search(cpi, x, &zero_ref_mv, &tmp_mv, gld_yv12, &gf_motion_error, recon_yoffset); - - if ((gf_motion_error < motion_error) && (gf_motion_error < this_error)) - { - second_ref_count++; - } - - /* Reset to last frame as reference buffer */ - xd->pre.y_buffer = lst_yv12->y_buffer + recon_yoffset; - xd->pre.u_buffer = lst_yv12->u_buffer + recon_uvoffset; - xd->pre.v_buffer = lst_yv12->v_buffer + recon_uvoffset; - } - -skip_motion_search: - /* Intra assumed best */ - best_ref_mv.as_int = 0; - - if (motion_error <= this_error) - { - /* Keep a count of cases where the inter and intra were - * very close and very low. This helps with scene cut - * detection for example in cropped clips with black bars - * at the sides or top and bottom. - */ - if( (((this_error-intrapenalty) * 9) <= - (motion_error*10)) && - (this_error < (2*intrapenalty)) ) - { - neutral_count++; - } - - d->bmi.mv.as_mv.row *= 8; - d->bmi.mv.as_mv.col *= 8; - this_error = motion_error; - vp8_set_mbmode_and_mvs(x, NEWMV, &d->bmi.mv); - vp8_encode_inter16x16y(x); - sum_mvr += d->bmi.mv.as_mv.row; - sum_mvr_abs += abs(d->bmi.mv.as_mv.row); - sum_mvc += d->bmi.mv.as_mv.col; - sum_mvc_abs += abs(d->bmi.mv.as_mv.col); - sum_mvrs += d->bmi.mv.as_mv.row * d->bmi.mv.as_mv.row; - sum_mvcs += d->bmi.mv.as_mv.col * d->bmi.mv.as_mv.col; - intercount++; - - best_ref_mv.as_int = d->bmi.mv.as_int; - - /* Was the vector non-zero */ - if (d->bmi.mv.as_int) - { - mvcount++; - - /* Was it different from the last non zero vector */ - if ( d->bmi.mv.as_int != lastmv_as_int ) - new_mv_count++; - lastmv_as_int = d->bmi.mv.as_int; - - /* Does the Row vector point inwards or outwards */ - if (mb_row < cm->mb_rows / 2) - { - if (d->bmi.mv.as_mv.row > 0) - sum_in_vectors--; - else if (d->bmi.mv.as_mv.row < 0) - sum_in_vectors++; - } - else if (mb_row > cm->mb_rows / 2) - { - if (d->bmi.mv.as_mv.row > 0) - sum_in_vectors++; - else if (d->bmi.mv.as_mv.row < 0) - sum_in_vectors--; - } - - /* Does the Row vector point inwards or outwards */ - if (mb_col < cm->mb_cols / 2) - { - if (d->bmi.mv.as_mv.col > 0) - sum_in_vectors--; - else if (d->bmi.mv.as_mv.col < 0) - sum_in_vectors++; - } - else if (mb_col > cm->mb_cols / 2) - { - if (d->bmi.mv.as_mv.col > 0) - sum_in_vectors++; - else if (d->bmi.mv.as_mv.col < 0) - sum_in_vectors--; - } - } - } - } - - coded_error += (int64_t)this_error; - - /* adjust to the next column of macroblocks */ - x->src.y_buffer += 16; - x->src.u_buffer += 8; - x->src.v_buffer += 8; - - recon_yoffset += 16; - recon_uvoffset += 8; - } - - /* adjust to the next row of mbs */ - x->src.y_buffer += 16 * x->src.y_stride - 16 * cm->mb_cols; - x->src.u_buffer += 8 * x->src.uv_stride - 8 * cm->mb_cols; - x->src.v_buffer += 8 * x->src.uv_stride - 8 * cm->mb_cols; - - /* extend the recon for intra prediction */ - vp8_extend_mb_row(new_yv12, xd->dst.y_buffer + 16, xd->dst.u_buffer + 8, xd->dst.v_buffer + 8); - vp8_clear_system_state(); - } - - vp8_clear_system_state(); - { - double weight = 0.0; - - FIRSTPASS_STATS fps; - - fps.frame = cm->current_video_frame ; - fps.intra_error = (double)(intra_error >> 8); - fps.coded_error = (double)(coded_error >> 8); - weight = simple_weight(cpi->Source); - - - if (weight < 0.1) - weight = 0.1; - - fps.ssim_weighted_pred_err = fps.coded_error * weight; - - fps.pcnt_inter = 0.0; - fps.pcnt_motion = 0.0; - fps.MVr = 0.0; - fps.mvr_abs = 0.0; - fps.MVc = 0.0; - fps.mvc_abs = 0.0; - fps.MVrv = 0.0; - fps.MVcv = 0.0; - fps.mv_in_out_count = 0.0; - fps.new_mv_count = 0.0; - fps.count = 1.0; - - fps.pcnt_inter = 1.0 * (double)intercount / cm->MBs; - fps.pcnt_second_ref = 1.0 * (double)second_ref_count / cm->MBs; - fps.pcnt_neutral = 1.0 * (double)neutral_count / cm->MBs; - - if (mvcount > 0) - { - fps.MVr = (double)sum_mvr / (double)mvcount; - fps.mvr_abs = (double)sum_mvr_abs / (double)mvcount; - fps.MVc = (double)sum_mvc / (double)mvcount; - fps.mvc_abs = (double)sum_mvc_abs / (double)mvcount; - fps.MVrv = ((double)sum_mvrs - (fps.MVr * fps.MVr / (double)mvcount)) / (double)mvcount; - fps.MVcv = ((double)sum_mvcs - (fps.MVc * fps.MVc / (double)mvcount)) / (double)mvcount; - fps.mv_in_out_count = (double)sum_in_vectors / (double)(mvcount * 2); - fps.new_mv_count = new_mv_count; - - fps.pcnt_motion = 1.0 * (double)mvcount / cpi->common.MBs; - } - - /* TODO: handle the case when duration is set to 0, or something less - * than the full time between subsequent cpi->source_time_stamps - */ - fps.duration = (double)(cpi->source->ts_end - - cpi->source->ts_start); - - /* don't want to do output stats with a stack variable! */ - memcpy(&cpi->twopass.this_frame_stats, - &fps, - sizeof(FIRSTPASS_STATS)); - output_stats(cpi, cpi->output_pkt_list, &cpi->twopass.this_frame_stats); - accumulate_stats(&cpi->twopass.total_stats, &fps); - } - - /* Copy the previous Last Frame into the GF buffer if specific - * conditions for doing so are met - */ - if ((cm->current_video_frame > 0) && - (cpi->twopass.this_frame_stats.pcnt_inter > 0.20) && - ((cpi->twopass.this_frame_stats.intra_error / - DOUBLE_DIVIDE_CHECK(cpi->twopass.this_frame_stats.coded_error)) > - 2.0)) - { - vp8_yv12_copy_frame(lst_yv12, gld_yv12); - } - - /* swap frame pointers so last frame refers to the frame we just - * compressed - */ - vp8_swap_yv12_buffer(lst_yv12, new_yv12); - vp8_yv12_extend_frame_borders(lst_yv12); - - /* Special case for the first frame. Copy into the GF buffer as a - * second reference. - */ - if (cm->current_video_frame == 0) - { - vp8_yv12_copy_frame(lst_yv12, gld_yv12); - } - - - /* use this to see what the first pass reconstruction looks like */ - if (0) - { - char filename[512]; - FILE *recon_file; - sprintf(filename, "enc%04d.yuv", (int) cm->current_video_frame); - - if (cm->current_video_frame == 0) - recon_file = fopen(filename, "wb"); - else - recon_file = fopen(filename, "ab"); - - (void) fwrite(lst_yv12->buffer_alloc, lst_yv12->frame_size, 1, - recon_file); - fclose(recon_file); - } - - cm->current_video_frame++; - -} -extern const int vp8_bits_per_mb[2][QINDEX_RANGE]; - -/* Estimate a cost per mb attributable to overheads such as the coding of - * modes and motion vectors. - * Currently simplistic in its assumptions for testing. - */ - -static double bitcost( double prob ) -{ - if (prob > 0.000122) - return -log(prob) / log(2.0); - else - return 13.0; -} -static int64_t estimate_modemvcost(VP8_COMP *cpi, - FIRSTPASS_STATS * fpstats) -{ - int mv_cost; - int64_t mode_cost; - - double av_pct_inter = fpstats->pcnt_inter / fpstats->count; - double av_pct_motion = fpstats->pcnt_motion / fpstats->count; - double av_intra = (1.0 - av_pct_inter); - - double zz_cost; - double motion_cost; - double intra_cost; - - zz_cost = bitcost(av_pct_inter - av_pct_motion); - motion_cost = bitcost(av_pct_motion); - intra_cost = bitcost(av_intra); - - /* Estimate of extra bits per mv overhead for mbs - * << 9 is the normalization to the (bits * 512) used in vp8_bits_per_mb - */ - mv_cost = ((int)(fpstats->new_mv_count / fpstats->count) * 8) << 9; - - /* Crude estimate of overhead cost from modes - * << 9 is the normalization to (bits * 512) used in vp8_bits_per_mb - */ - mode_cost = (int64_t)((((av_pct_inter - av_pct_motion) * zz_cost) + - (av_pct_motion * motion_cost) + - (av_intra * intra_cost)) * cpi->common.MBs) * 512; - - return mv_cost + mode_cost; -} - -static double calc_correction_factor( double err_per_mb, - double err_devisor, - double pt_low, - double pt_high, - int Q ) -{ - double power_term; - double error_term = err_per_mb / err_devisor; - double correction_factor; - - /* Adjustment based on Q to power term. */ - power_term = pt_low + (Q * 0.01); - power_term = (power_term > pt_high) ? pt_high : power_term; - - /* Adjustments to error term */ - /* TBD */ - - /* Calculate correction factor */ - correction_factor = pow(error_term, power_term); - - /* Clip range */ - correction_factor = - (correction_factor < 0.05) - ? 0.05 : (correction_factor > 5.0) ? 5.0 : correction_factor; - - return correction_factor; -} - -static int estimate_max_q(VP8_COMP *cpi, - FIRSTPASS_STATS * fpstats, - int section_target_bandwitdh, - int overhead_bits ) -{ - int Q; - int num_mbs = cpi->common.MBs; - int target_norm_bits_per_mb; - - double section_err = (fpstats->coded_error / fpstats->count); - double err_per_mb = section_err / num_mbs; - double err_correction_factor; - double speed_correction = 1.0; - int overhead_bits_per_mb; - - if (section_target_bandwitdh <= 0) - return cpi->twopass.maxq_max_limit; /* Highest value allowed */ - - target_norm_bits_per_mb = - (section_target_bandwitdh < (1 << 20)) - ? (512 * section_target_bandwitdh) / num_mbs - : 512 * (section_target_bandwitdh / num_mbs); - - /* Calculate a corrective factor based on a rolling ratio of bits spent - * vs target bits - */ - if ((cpi->rolling_target_bits > 0) && - (cpi->active_worst_quality < cpi->worst_quality)) - { - double rolling_ratio; - - rolling_ratio = (double)cpi->rolling_actual_bits / - (double)cpi->rolling_target_bits; - - if (rolling_ratio < 0.95) - cpi->twopass.est_max_qcorrection_factor -= 0.005; - else if (rolling_ratio > 1.05) - cpi->twopass.est_max_qcorrection_factor += 0.005; - - cpi->twopass.est_max_qcorrection_factor = - (cpi->twopass.est_max_qcorrection_factor < 0.1) - ? 0.1 - : (cpi->twopass.est_max_qcorrection_factor > 10.0) - ? 10.0 : cpi->twopass.est_max_qcorrection_factor; - } - - /* Corrections for higher compression speed settings - * (reduced compression expected) - */ - if ((cpi->compressor_speed == 3) || (cpi->compressor_speed == 1)) - { - if (cpi->oxcf.cpu_used <= 5) - speed_correction = 1.04 + (cpi->oxcf.cpu_used * 0.04); - else - speed_correction = 1.25; - } - - /* Estimate of overhead bits per mb */ - /* Correction to overhead bits for min allowed Q. */ - overhead_bits_per_mb = overhead_bits / num_mbs; - overhead_bits_per_mb = (int)(overhead_bits_per_mb * - pow( 0.98, (double)cpi->twopass.maxq_min_limit )); - - /* Try and pick a max Q that will be high enough to encode the - * content at the given rate. - */ - for (Q = cpi->twopass.maxq_min_limit; Q < cpi->twopass.maxq_max_limit; Q++) - { - int bits_per_mb_at_this_q; - - /* Error per MB based correction factor */ - err_correction_factor = - calc_correction_factor(err_per_mb, 150.0, 0.40, 0.90, Q); - - bits_per_mb_at_this_q = - vp8_bits_per_mb[INTER_FRAME][Q] + overhead_bits_per_mb; - - bits_per_mb_at_this_q = (int)(.5 + err_correction_factor - * speed_correction * cpi->twopass.est_max_qcorrection_factor - * cpi->twopass.section_max_qfactor - * (double)bits_per_mb_at_this_q); - - /* Mode and motion overhead */ - /* As Q rises in real encode loop rd code will force overhead down - * We make a crude adjustment for this here as *.98 per Q step. - */ - overhead_bits_per_mb = (int)((double)overhead_bits_per_mb * 0.98); - - if (bits_per_mb_at_this_q <= target_norm_bits_per_mb) - break; - } - - /* Restriction on active max q for constrained quality mode. */ - if ( (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) && - (Q < cpi->cq_target_quality) ) - { - Q = cpi->cq_target_quality; - } - - /* Adjust maxq_min_limit and maxq_max_limit limits based on - * average q observed in clip for non kf/gf.arf frames - * Give average a chance to settle though. - */ - if ( (cpi->ni_frames > - ((int)cpi->twopass.total_stats.count >> 8)) && - (cpi->ni_frames > 150) ) - { - cpi->twopass.maxq_max_limit = ((cpi->ni_av_qi + 32) < cpi->worst_quality) - ? (cpi->ni_av_qi + 32) : cpi->worst_quality; - cpi->twopass.maxq_min_limit = ((cpi->ni_av_qi - 32) > cpi->best_quality) - ? (cpi->ni_av_qi - 32) : cpi->best_quality; - } - - return Q; -} - -/* For cq mode estimate a cq level that matches the observed - * complexity and data rate. - */ -static int estimate_cq( VP8_COMP *cpi, - FIRSTPASS_STATS * fpstats, - int section_target_bandwitdh, - int overhead_bits ) -{ - int Q; - int num_mbs = cpi->common.MBs; - int target_norm_bits_per_mb; - - double section_err = (fpstats->coded_error / fpstats->count); - double err_per_mb = section_err / num_mbs; - double err_correction_factor; - double speed_correction = 1.0; - double clip_iiratio; - double clip_iifactor; - int overhead_bits_per_mb; - - if (0) - { - FILE *f = fopen("epmp.stt", "a"); - fprintf(f, "%10.2f\n", err_per_mb ); - fclose(f); - } - - target_norm_bits_per_mb = (section_target_bandwitdh < (1 << 20)) - ? (512 * section_target_bandwitdh) / num_mbs - : 512 * (section_target_bandwitdh / num_mbs); - - /* Estimate of overhead bits per mb */ - overhead_bits_per_mb = overhead_bits / num_mbs; - - /* Corrections for higher compression speed settings - * (reduced compression expected) - */ - if ((cpi->compressor_speed == 3) || (cpi->compressor_speed == 1)) - { - if (cpi->oxcf.cpu_used <= 5) - speed_correction = 1.04 + (cpi->oxcf.cpu_used * 0.04); - else - speed_correction = 1.25; - } - - /* II ratio correction factor for clip as a whole */ - clip_iiratio = cpi->twopass.total_stats.intra_error / - DOUBLE_DIVIDE_CHECK(cpi->twopass.total_stats.coded_error); - clip_iifactor = 1.0 - ((clip_iiratio - 10.0) * 0.025); - if (clip_iifactor < 0.80) - clip_iifactor = 0.80; - - /* Try and pick a Q that can encode the content at the given rate. */ - for (Q = 0; Q < MAXQ; Q++) - { - int bits_per_mb_at_this_q; - - /* Error per MB based correction factor */ - err_correction_factor = - calc_correction_factor(err_per_mb, 100.0, 0.40, 0.90, Q); - - bits_per_mb_at_this_q = - vp8_bits_per_mb[INTER_FRAME][Q] + overhead_bits_per_mb; - - bits_per_mb_at_this_q = - (int)( .5 + err_correction_factor * - speed_correction * - clip_iifactor * - (double)bits_per_mb_at_this_q); - - /* Mode and motion overhead */ - /* As Q rises in real encode loop rd code will force overhead down - * We make a crude adjustment for this here as *.98 per Q step. - */ - overhead_bits_per_mb = (int)((double)overhead_bits_per_mb * 0.98); - - if (bits_per_mb_at_this_q <= target_norm_bits_per_mb) - break; - } - - /* Clip value to range "best allowed to (worst allowed - 1)" */ - Q = cq_level[Q]; - if ( Q >= cpi->worst_quality ) - Q = cpi->worst_quality - 1; - if ( Q < cpi->best_quality ) - Q = cpi->best_quality; - - return Q; -} - -static int estimate_q(VP8_COMP *cpi, double section_err, int section_target_bandwitdh) -{ - int Q; - int num_mbs = cpi->common.MBs; - int target_norm_bits_per_mb; - - double err_per_mb = section_err / num_mbs; - double err_correction_factor; - double speed_correction = 1.0; - - target_norm_bits_per_mb = (section_target_bandwitdh < (1 << 20)) ? (512 * section_target_bandwitdh) / num_mbs : 512 * (section_target_bandwitdh / num_mbs); - - /* Corrections for higher compression speed settings - * (reduced compression expected) - */ - if ((cpi->compressor_speed == 3) || (cpi->compressor_speed == 1)) - { - if (cpi->oxcf.cpu_used <= 5) - speed_correction = 1.04 + (cpi->oxcf.cpu_used * 0.04); - else - speed_correction = 1.25; - } - - /* Try and pick a Q that can encode the content at the given rate. */ - for (Q = 0; Q < MAXQ; Q++) - { - int bits_per_mb_at_this_q; - - /* Error per MB based correction factor */ - err_correction_factor = - calc_correction_factor(err_per_mb, 150.0, 0.40, 0.90, Q); - - bits_per_mb_at_this_q = - (int)( .5 + ( err_correction_factor * - speed_correction * - cpi->twopass.est_max_qcorrection_factor * - (double)vp8_bits_per_mb[INTER_FRAME][Q] / 1.0 ) ); - - if (bits_per_mb_at_this_q <= target_norm_bits_per_mb) - break; - } - - return Q; -} - -/* Estimate a worst case Q for a KF group */ -static int estimate_kf_group_q(VP8_COMP *cpi, double section_err, int section_target_bandwitdh, double group_iiratio) -{ - int Q; - int num_mbs = cpi->common.MBs; - int target_norm_bits_per_mb = (512 * section_target_bandwitdh) / num_mbs; - int bits_per_mb_at_this_q; - - double err_per_mb = section_err / num_mbs; - double err_correction_factor; - double speed_correction = 1.0; - double current_spend_ratio = 1.0; - - double pow_highq = (POW1 < 0.6) ? POW1 + 0.3 : 0.90; - double pow_lowq = (POW1 < 0.7) ? POW1 + 0.1 : 0.80; - - double iiratio_correction_factor = 1.0; - - double combined_correction_factor; - - /* Trap special case where the target is <= 0 */ - if (target_norm_bits_per_mb <= 0) - return MAXQ * 2; - - /* Calculate a corrective factor based on a rolling ratio of bits spent - * vs target bits - * This is clamped to the range 0.1 to 10.0 - */ - if (cpi->long_rolling_target_bits <= 0) - current_spend_ratio = 10.0; - else - { - current_spend_ratio = (double)cpi->long_rolling_actual_bits / (double)cpi->long_rolling_target_bits; - current_spend_ratio = (current_spend_ratio > 10.0) ? 10.0 : (current_spend_ratio < 0.1) ? 0.1 : current_spend_ratio; - } - - /* Calculate a correction factor based on the quality of prediction in - * the sequence as indicated by intra_inter error score ratio (IIRatio) - * The idea here is to favour subsampling in the hardest sections vs - * the easyest. - */ - iiratio_correction_factor = 1.0 - ((group_iiratio - 6.0) * 0.1); - - if (iiratio_correction_factor < 0.5) - iiratio_correction_factor = 0.5; - - /* Corrections for higher compression speed settings - * (reduced compression expected) - */ - if ((cpi->compressor_speed == 3) || (cpi->compressor_speed == 1)) - { - if (cpi->oxcf.cpu_used <= 5) - speed_correction = 1.04 + (cpi->oxcf.cpu_used * 0.04); - else - speed_correction = 1.25; - } - - /* Combine the various factors calculated above */ - combined_correction_factor = speed_correction * iiratio_correction_factor * current_spend_ratio; - - /* Try and pick a Q that should be high enough to encode the content at - * the given rate. - */ - for (Q = 0; Q < MAXQ; Q++) - { - /* Error per MB based correction factor */ - err_correction_factor = - calc_correction_factor(err_per_mb, 150.0, pow_lowq, pow_highq, Q); - - bits_per_mb_at_this_q = - (int)(.5 + ( err_correction_factor * - combined_correction_factor * - (double)vp8_bits_per_mb[INTER_FRAME][Q]) ); - - if (bits_per_mb_at_this_q <= target_norm_bits_per_mb) - break; - } - - /* If we could not hit the target even at Max Q then estimate what Q - * would have been required - */ - while ((bits_per_mb_at_this_q > target_norm_bits_per_mb) && (Q < (MAXQ * 2))) - { - - bits_per_mb_at_this_q = (int)(0.96 * bits_per_mb_at_this_q); - Q++; - } - - if (0) - { - FILE *f = fopen("estkf_q.stt", "a"); - fprintf(f, "%8d %8d %8d %8.2f %8.3f %8.2f %8.3f %8.3f %8.3f %8d\n", cpi->common.current_video_frame, bits_per_mb_at_this_q, - target_norm_bits_per_mb, err_per_mb, err_correction_factor, - current_spend_ratio, group_iiratio, iiratio_correction_factor, - (double)cpi->buffer_level / (double)cpi->oxcf.optimal_buffer_level, Q); - fclose(f); - } - - return Q; -} - -extern void vp8_new_framerate(VP8_COMP *cpi, double framerate); - -void vp8_init_second_pass(VP8_COMP *cpi) -{ - FIRSTPASS_STATS this_frame; - FIRSTPASS_STATS *start_pos; - - double two_pass_min_rate = (double)(cpi->oxcf.target_bandwidth * cpi->oxcf.two_pass_vbrmin_section / 100); - - zero_stats(&cpi->twopass.total_stats); - zero_stats(&cpi->twopass.total_left_stats); - - if (!cpi->twopass.stats_in_end) - return; - - cpi->twopass.total_stats = *cpi->twopass.stats_in_end; - cpi->twopass.total_left_stats = cpi->twopass.total_stats; - - /* each frame can have a different duration, as the frame rate in the - * source isn't guaranteed to be constant. The frame rate prior to - * the first frame encoded in the second pass is a guess. However the - * sum duration is not. Its calculated based on the actual durations of - * all frames from the first pass. - */ - vp8_new_framerate(cpi, 10000000.0 * cpi->twopass.total_stats.count / cpi->twopass.total_stats.duration); - - cpi->output_framerate = cpi->framerate; - cpi->twopass.bits_left = (int64_t)(cpi->twopass.total_stats.duration * cpi->oxcf.target_bandwidth / 10000000.0) ; - cpi->twopass.bits_left -= (int64_t)(cpi->twopass.total_stats.duration * two_pass_min_rate / 10000000.0); - - /* Calculate a minimum intra value to be used in determining the IIratio - * scores used in the second pass. We have this minimum to make sure - * that clips that are static but "low complexity" in the intra domain - * are still boosted appropriately for KF/GF/ARF - */ - cpi->twopass.kf_intra_err_min = KF_MB_INTRA_MIN * cpi->common.MBs; - cpi->twopass.gf_intra_err_min = GF_MB_INTRA_MIN * cpi->common.MBs; - - /* Scan the first pass file and calculate an average Intra / Inter error - * score ratio for the sequence - */ - { - double sum_iiratio = 0.0; - double IIRatio; - - start_pos = cpi->twopass.stats_in; /* Note starting "file" position */ - - while (input_stats(cpi, &this_frame) != EOF) - { - IIRatio = this_frame.intra_error / DOUBLE_DIVIDE_CHECK(this_frame.coded_error); - IIRatio = (IIRatio < 1.0) ? 1.0 : (IIRatio > 20.0) ? 20.0 : IIRatio; - sum_iiratio += IIRatio; - } - - cpi->twopass.avg_iiratio = sum_iiratio / DOUBLE_DIVIDE_CHECK((double)cpi->twopass.total_stats.count); - - /* Reset file position */ - reset_fpf_position(cpi, start_pos); - } - - /* Scan the first pass file and calculate a modified total error based - * upon the bias/power function used to allocate bits - */ - { - start_pos = cpi->twopass.stats_in; /* Note starting "file" position */ - - cpi->twopass.modified_error_total = 0.0; - cpi->twopass.modified_error_used = 0.0; - - while (input_stats(cpi, &this_frame) != EOF) - { - cpi->twopass.modified_error_total += calculate_modified_err(cpi, &this_frame); - } - cpi->twopass.modified_error_left = cpi->twopass.modified_error_total; - - reset_fpf_position(cpi, start_pos); /* Reset file position */ - - } -} - -void vp8_end_second_pass(VP8_COMP *cpi) -{ - (void)cpi; -} - -/* This function gives and estimate of how badly we believe the prediction - * quality is decaying from frame to frame. - */ -static double get_prediction_decay_rate(VP8_COMP *cpi, FIRSTPASS_STATS *next_frame) -{ - double prediction_decay_rate; - double motion_decay; - double motion_pct = next_frame->pcnt_motion; - (void)cpi; - - /* Initial basis is the % mbs inter coded */ - prediction_decay_rate = next_frame->pcnt_inter; - - /* High % motion -> somewhat higher decay rate */ - motion_decay = (1.0 - (motion_pct / 20.0)); - if (motion_decay < prediction_decay_rate) - prediction_decay_rate = motion_decay; - - /* Adjustment to decay rate based on speed of motion */ - { - double this_mv_rabs; - double this_mv_cabs; - double distance_factor; - - this_mv_rabs = fabs(next_frame->mvr_abs * motion_pct); - this_mv_cabs = fabs(next_frame->mvc_abs * motion_pct); - - distance_factor = sqrt((this_mv_rabs * this_mv_rabs) + - (this_mv_cabs * this_mv_cabs)) / 250.0; - distance_factor = ((distance_factor > 1.0) - ? 0.0 : (1.0 - distance_factor)); - if (distance_factor < prediction_decay_rate) - prediction_decay_rate = distance_factor; - } - - return prediction_decay_rate; -} - -/* Function to test for a condition where a complex transition is followed - * by a static section. For example in slide shows where there is a fade - * between slides. This is to help with more optimal kf and gf positioning. - */ -static int detect_transition_to_still( - VP8_COMP *cpi, - int frame_interval, - int still_interval, - double loop_decay_rate, - double decay_accumulator ) -{ - int trans_to_still = 0; - - /* Break clause to detect very still sections after motion - * For example a static image after a fade or other transition - * instead of a clean scene cut. - */ - if ( (frame_interval > MIN_GF_INTERVAL) && - (loop_decay_rate >= 0.999) && - (decay_accumulator < 0.9) ) - { - int j; - FIRSTPASS_STATS * position = cpi->twopass.stats_in; - FIRSTPASS_STATS tmp_next_frame; - double decay_rate; - - /* Look ahead a few frames to see if static condition persists... */ - for ( j = 0; j < still_interval; j++ ) - { - if (EOF == input_stats(cpi, &tmp_next_frame)) - break; - - decay_rate = get_prediction_decay_rate(cpi, &tmp_next_frame); - if ( decay_rate < 0.999 ) - break; - } - /* Reset file position */ - reset_fpf_position(cpi, position); - - /* Only if it does do we signal a transition to still */ - if ( j == still_interval ) - trans_to_still = 1; - } - - return trans_to_still; -} - -/* This function detects a flash through the high relative pcnt_second_ref - * score in the frame following a flash frame. The offset passed in should - * reflect this - */ -static int detect_flash( VP8_COMP *cpi, int offset ) -{ - FIRSTPASS_STATS next_frame; - - int flash_detected = 0; - - /* Read the frame data. */ - /* The return is 0 (no flash detected) if not a valid frame */ - if ( read_frame_stats(cpi, &next_frame, offset) != EOF ) - { - /* What we are looking for here is a situation where there is a - * brief break in prediction (such as a flash) but subsequent frames - * are reasonably well predicted by an earlier (pre flash) frame. - * The recovery after a flash is indicated by a high pcnt_second_ref - * comapred to pcnt_inter. - */ - if ( (next_frame.pcnt_second_ref > next_frame.pcnt_inter) && - (next_frame.pcnt_second_ref >= 0.5 ) ) - { - flash_detected = 1; - - /*if (1) - { - FILE *f = fopen("flash.stt", "a"); - fprintf(f, "%8.0f %6.2f %6.2f\n", - next_frame.frame, - next_frame.pcnt_inter, - next_frame.pcnt_second_ref); - fclose(f); - }*/ - } - } - - return flash_detected; -} - -/* Update the motion related elements to the GF arf boost calculation */ -static void accumulate_frame_motion_stats( - VP8_COMP *cpi, - FIRSTPASS_STATS * this_frame, - double * this_frame_mv_in_out, - double * mv_in_out_accumulator, - double * abs_mv_in_out_accumulator, - double * mv_ratio_accumulator ) -{ - double this_frame_mvr_ratio; - double this_frame_mvc_ratio; - double motion_pct; - (void)cpi; - - /* Accumulate motion stats. */ - motion_pct = this_frame->pcnt_motion; - - /* Accumulate Motion In/Out of frame stats */ - *this_frame_mv_in_out = this_frame->mv_in_out_count * motion_pct; - *mv_in_out_accumulator += this_frame->mv_in_out_count * motion_pct; - *abs_mv_in_out_accumulator += - fabs(this_frame->mv_in_out_count * motion_pct); - - /* Accumulate a measure of how uniform (or conversely how random) - * the motion field is. (A ratio of absmv / mv) - */ - if (motion_pct > 0.05) - { - this_frame_mvr_ratio = fabs(this_frame->mvr_abs) / - DOUBLE_DIVIDE_CHECK(fabs(this_frame->MVr)); - - this_frame_mvc_ratio = fabs(this_frame->mvc_abs) / - DOUBLE_DIVIDE_CHECK(fabs(this_frame->MVc)); - - *mv_ratio_accumulator += - (this_frame_mvr_ratio < this_frame->mvr_abs) - ? (this_frame_mvr_ratio * motion_pct) - : this_frame->mvr_abs * motion_pct; - - *mv_ratio_accumulator += - (this_frame_mvc_ratio < this_frame->mvc_abs) - ? (this_frame_mvc_ratio * motion_pct) - : this_frame->mvc_abs * motion_pct; - - } -} - -/* Calculate a baseline boost number for the current frame. */ -static double calc_frame_boost( - VP8_COMP *cpi, - FIRSTPASS_STATS * this_frame, - double this_frame_mv_in_out ) -{ - double frame_boost; - - /* Underlying boost factor is based on inter intra error ratio */ - if (this_frame->intra_error > cpi->twopass.gf_intra_err_min) - frame_boost = (IIFACTOR * this_frame->intra_error / - DOUBLE_DIVIDE_CHECK(this_frame->coded_error)); - else - frame_boost = (IIFACTOR * cpi->twopass.gf_intra_err_min / - DOUBLE_DIVIDE_CHECK(this_frame->coded_error)); - - /* Increase boost for frames where new data coming into frame - * (eg zoom out). Slightly reduce boost if there is a net balance - * of motion out of the frame (zoom in). - * The range for this_frame_mv_in_out is -1.0 to +1.0 - */ - if (this_frame_mv_in_out > 0.0) - frame_boost += frame_boost * (this_frame_mv_in_out * 2.0); - /* In extreme case boost is halved */ - else - frame_boost += frame_boost * (this_frame_mv_in_out / 2.0); - - /* Clip to maximum */ - if (frame_boost > GF_RMAX) - frame_boost = GF_RMAX; - - return frame_boost; -} - -#if NEW_BOOST -static int calc_arf_boost( - VP8_COMP *cpi, - int offset, - int f_frames, - int b_frames, - int *f_boost, - int *b_boost ) -{ - FIRSTPASS_STATS this_frame; - - int i; - double boost_score = 0.0; - double mv_ratio_accumulator = 0.0; - double decay_accumulator = 1.0; - double this_frame_mv_in_out = 0.0; - double mv_in_out_accumulator = 0.0; - double abs_mv_in_out_accumulator = 0.0; - double r; - int flash_detected = 0; - - /* Search forward from the proposed arf/next gf position */ - for ( i = 0; i < f_frames; i++ ) - { - if ( read_frame_stats(cpi, &this_frame, (i+offset)) == EOF ) - break; - - /* Update the motion related elements to the boost calculation */ - accumulate_frame_motion_stats( cpi, &this_frame, - &this_frame_mv_in_out, &mv_in_out_accumulator, - &abs_mv_in_out_accumulator, &mv_ratio_accumulator ); - - /* Calculate the baseline boost number for this frame */ - r = calc_frame_boost( cpi, &this_frame, this_frame_mv_in_out ); - - /* We want to discount the the flash frame itself and the recovery - * frame that follows as both will have poor scores. - */ - flash_detected = detect_flash(cpi, (i+offset)) || - detect_flash(cpi, (i+offset+1)); - - /* Cumulative effect of prediction quality decay */ - if ( !flash_detected ) - { - decay_accumulator = - decay_accumulator * - get_prediction_decay_rate(cpi, &this_frame); - decay_accumulator = - decay_accumulator < 0.1 ? 0.1 : decay_accumulator; - } - boost_score += (decay_accumulator * r); - - /* Break out conditions. */ - if ( (!flash_detected) && - ((mv_ratio_accumulator > 100.0) || - (abs_mv_in_out_accumulator > 3.0) || - (mv_in_out_accumulator < -2.0) ) ) - { - break; - } - } - - *f_boost = (int)(boost_score * 100.0) >> 4; - - /* Reset for backward looking loop */ - boost_score = 0.0; - mv_ratio_accumulator = 0.0; - decay_accumulator = 1.0; - this_frame_mv_in_out = 0.0; - mv_in_out_accumulator = 0.0; - abs_mv_in_out_accumulator = 0.0; - - /* Search forward from the proposed arf/next gf position */ - for ( i = -1; i >= -b_frames; i-- ) - { - if ( read_frame_stats(cpi, &this_frame, (i+offset)) == EOF ) - break; - - /* Update the motion related elements to the boost calculation */ - accumulate_frame_motion_stats( cpi, &this_frame, - &this_frame_mv_in_out, &mv_in_out_accumulator, - &abs_mv_in_out_accumulator, &mv_ratio_accumulator ); - - /* Calculate the baseline boost number for this frame */ - r = calc_frame_boost( cpi, &this_frame, this_frame_mv_in_out ); - - /* We want to discount the the flash frame itself and the recovery - * frame that follows as both will have poor scores. - */ - flash_detected = detect_flash(cpi, (i+offset)) || - detect_flash(cpi, (i+offset+1)); - - /* Cumulative effect of prediction quality decay */ - if ( !flash_detected ) - { - decay_accumulator = - decay_accumulator * - get_prediction_decay_rate(cpi, &this_frame); - decay_accumulator = - decay_accumulator < 0.1 ? 0.1 : decay_accumulator; - } - - boost_score += (decay_accumulator * r); - - /* Break out conditions. */ - if ( (!flash_detected) && - ((mv_ratio_accumulator > 100.0) || - (abs_mv_in_out_accumulator > 3.0) || - (mv_in_out_accumulator < -2.0) ) ) - { - break; - } - } - *b_boost = (int)(boost_score * 100.0) >> 4; - - return (*f_boost + *b_boost); -} -#endif - -/* Analyse and define a gf/arf group . */ -static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) -{ - FIRSTPASS_STATS next_frame; - FIRSTPASS_STATS *start_pos; - int i; - double r; - double boost_score = 0.0; - double old_boost_score = 0.0; - double gf_group_err = 0.0; - double gf_first_frame_err = 0.0; - double mod_frame_err = 0.0; - - double mv_ratio_accumulator = 0.0; - double decay_accumulator = 1.0; - - double loop_decay_rate = 1.00; /* Starting decay rate */ - - double this_frame_mv_in_out = 0.0; - double mv_in_out_accumulator = 0.0; - double abs_mv_in_out_accumulator = 0.0; - double mod_err_per_mb_accumulator = 0.0; - - int max_bits = frame_max_bits(cpi); /* Max for a single frame */ - - unsigned int allow_alt_ref = - cpi->oxcf.play_alternate && cpi->oxcf.lag_in_frames; - - int alt_boost = 0; - int f_boost = 0; - int b_boost = 0; - int flash_detected; - - cpi->twopass.gf_group_bits = 0; - cpi->twopass.gf_decay_rate = 0; - - vp8_clear_system_state(); - - start_pos = cpi->twopass.stats_in; - - vpx_memset(&next_frame, 0, sizeof(next_frame)); /* assure clean */ - - /* Load stats for the current frame. */ - mod_frame_err = calculate_modified_err(cpi, this_frame); - - /* Note the error of the frame at the start of the group (this will be - * the GF frame error if we code a normal gf - */ - gf_first_frame_err = mod_frame_err; - - /* Special treatment if the current frame is a key frame (which is also - * a gf). If it is then its error score (and hence bit allocation) need - * to be subtracted out from the calculation for the GF group - */ - if (cpi->common.frame_type == KEY_FRAME) - gf_group_err -= gf_first_frame_err; - - /* Scan forward to try and work out how many frames the next gf group - * should contain and what level of boost is appropriate for the GF - * or ARF that will be coded with the group - */ - i = 0; - - while (((i < cpi->twopass.static_scene_max_gf_interval) || - ((cpi->twopass.frames_to_key - i) < MIN_GF_INTERVAL)) && - (i < cpi->twopass.frames_to_key)) - { - i++; - - /* Accumulate error score of frames in this gf group */ - mod_frame_err = calculate_modified_err(cpi, this_frame); - - gf_group_err += mod_frame_err; - - mod_err_per_mb_accumulator += - mod_frame_err / DOUBLE_DIVIDE_CHECK((double)cpi->common.MBs); - - if (EOF == input_stats(cpi, &next_frame)) - break; - - /* Test for the case where there is a brief flash but the prediction - * quality back to an earlier frame is then restored. - */ - flash_detected = detect_flash(cpi, 0); - - /* Update the motion related elements to the boost calculation */ - accumulate_frame_motion_stats( cpi, &next_frame, - &this_frame_mv_in_out, &mv_in_out_accumulator, - &abs_mv_in_out_accumulator, &mv_ratio_accumulator ); - - /* Calculate a baseline boost number for this frame */ - r = calc_frame_boost( cpi, &next_frame, this_frame_mv_in_out ); - - /* Cumulative effect of prediction quality decay */ - if ( !flash_detected ) - { - loop_decay_rate = get_prediction_decay_rate(cpi, &next_frame); - decay_accumulator = decay_accumulator * loop_decay_rate; - decay_accumulator = - decay_accumulator < 0.1 ? 0.1 : decay_accumulator; - } - boost_score += (decay_accumulator * r); - - /* Break clause to detect very still sections after motion - * For example a staic image after a fade or other transition. - */ - if ( detect_transition_to_still( cpi, i, 5, - loop_decay_rate, - decay_accumulator ) ) - { - allow_alt_ref = 0; - boost_score = old_boost_score; - break; - } - - /* Break out conditions. */ - if ( - /* Break at cpi->max_gf_interval unless almost totally static */ - (i >= cpi->max_gf_interval && (decay_accumulator < 0.995)) || - ( - /* Dont break out with a very short interval */ - (i > MIN_GF_INTERVAL) && - /* Dont break out very close to a key frame */ - ((cpi->twopass.frames_to_key - i) >= MIN_GF_INTERVAL) && - ((boost_score > 20.0) || (next_frame.pcnt_inter < 0.75)) && - (!flash_detected) && - ((mv_ratio_accumulator > 100.0) || - (abs_mv_in_out_accumulator > 3.0) || - (mv_in_out_accumulator < -2.0) || - ((boost_score - old_boost_score) < 2.0)) - ) ) - { - boost_score = old_boost_score; - break; - } - - vpx_memcpy(this_frame, &next_frame, sizeof(*this_frame)); - - old_boost_score = boost_score; - } - - cpi->twopass.gf_decay_rate = - (i > 0) ? (int)(100.0 * (1.0 - decay_accumulator)) / i : 0; - - /* When using CBR apply additional buffer related upper limits */ - if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) - { - double max_boost; - - /* For cbr apply buffer related limits */ - if (cpi->drop_frames_allowed) - { - int64_t df_buffer_level = cpi->oxcf.drop_frames_water_mark * - (cpi->oxcf.optimal_buffer_level / 100); - - if (cpi->buffer_level > df_buffer_level) - max_boost = ((double)((cpi->buffer_level - df_buffer_level) * 2 / 3) * 16.0) / DOUBLE_DIVIDE_CHECK((double)cpi->av_per_frame_bandwidth); - else - max_boost = 0.0; - } - else if (cpi->buffer_level > 0) - { - max_boost = ((double)(cpi->buffer_level * 2 / 3) * 16.0) / DOUBLE_DIVIDE_CHECK((double)cpi->av_per_frame_bandwidth); - } - else - { - max_boost = 0.0; - } - - if (boost_score > max_boost) - boost_score = max_boost; - } - - /* Dont allow conventional gf too near the next kf */ - if ((cpi->twopass.frames_to_key - i) < MIN_GF_INTERVAL) - { - while (i < cpi->twopass.frames_to_key) - { - i++; - - if (EOF == input_stats(cpi, this_frame)) - break; - - if (i < cpi->twopass.frames_to_key) - { - mod_frame_err = calculate_modified_err(cpi, this_frame); - gf_group_err += mod_frame_err; - } - } - } - - cpi->gfu_boost = (int)(boost_score * 100.0) >> 4; - -#if NEW_BOOST - /* Alterrnative boost calculation for alt ref */ - alt_boost = calc_arf_boost( cpi, 0, (i-1), (i-1), &f_boost, &b_boost ); -#endif - - /* Should we use the alternate refernce frame */ - if (allow_alt_ref && - (i >= MIN_GF_INTERVAL) && - /* dont use ARF very near next kf */ - (i <= (cpi->twopass.frames_to_key - MIN_GF_INTERVAL)) && -#if NEW_BOOST - ((next_frame.pcnt_inter > 0.75) || - (next_frame.pcnt_second_ref > 0.5)) && - ((mv_in_out_accumulator / (double)i > -0.2) || - (mv_in_out_accumulator > -2.0)) && - (b_boost > 100) && - (f_boost > 100) ) -#else - (next_frame.pcnt_inter > 0.75) && - ((mv_in_out_accumulator / (double)i > -0.2) || - (mv_in_out_accumulator > -2.0)) && - (cpi->gfu_boost > 100) && - (cpi->twopass.gf_decay_rate <= - (ARF_DECAY_THRESH + (cpi->gfu_boost / 200))) ) -#endif - { - int Boost; - int allocation_chunks; - int Q = (cpi->oxcf.fixed_q < 0) - ? cpi->last_q[INTER_FRAME] : cpi->oxcf.fixed_q; - int tmp_q; - int arf_frame_bits = 0; - int group_bits; - -#if NEW_BOOST - cpi->gfu_boost = alt_boost; -#endif - - /* Estimate the bits to be allocated to the group as a whole */ - if ((cpi->twopass.kf_group_bits > 0) && - (cpi->twopass.kf_group_error_left > 0)) - { - group_bits = (int)((double)cpi->twopass.kf_group_bits * - (gf_group_err / (double)cpi->twopass.kf_group_error_left)); - } - else - group_bits = 0; - - /* Boost for arf frame */ -#if NEW_BOOST - Boost = (alt_boost * GFQ_ADJUSTMENT) / 100; -#else - Boost = (cpi->gfu_boost * 3 * GFQ_ADJUSTMENT) / (2 * 100); -#endif - Boost += (i * 50); - - /* Set max and minimum boost and hence minimum allocation */ - if (Boost > ((cpi->baseline_gf_interval + 1) * 200)) - Boost = ((cpi->baseline_gf_interval + 1) * 200); - else if (Boost < 125) - Boost = 125; - - allocation_chunks = (i * 100) + Boost; - - /* Normalize Altboost and allocations chunck down to prevent overflow */ - while (Boost > 1000) - { - Boost /= 2; - allocation_chunks /= 2; - } - - /* Calculate the number of bits to be spent on the arf based on the - * boost number - */ - arf_frame_bits = (int)((double)Boost * (group_bits / - (double)allocation_chunks)); - - /* Estimate if there are enough bits available to make worthwhile use - * of an arf. - */ - tmp_q = estimate_q(cpi, mod_frame_err, (int)arf_frame_bits); - - /* Only use an arf if it is likely we will be able to code - * it at a lower Q than the surrounding frames. - */ - if (tmp_q < cpi->worst_quality) - { - int half_gf_int; - int frames_after_arf; - int frames_bwd = cpi->oxcf.arnr_max_frames - 1; - int frames_fwd = cpi->oxcf.arnr_max_frames - 1; - - cpi->source_alt_ref_pending = 1; - - /* - * For alt ref frames the error score for the end frame of the - * group (the alt ref frame) should not contribute to the group - * total and hence the number of bit allocated to the group. - * Rather it forms part of the next group (it is the GF at the - * start of the next group) - * gf_group_err -= mod_frame_err; - * - * For alt ref frames alt ref frame is technically part of the - * GF frame for the next group but we always base the error - * calculation and bit allocation on the current group of frames. - * - * Set the interval till the next gf or arf. - * For ARFs this is the number of frames to be coded before the - * future frame that is coded as an ARF. - * The future frame itself is part of the next group - */ - cpi->baseline_gf_interval = i; - - /* - * Define the arnr filter width for this group of frames: - * We only filter frames that lie within a distance of half - * the GF interval from the ARF frame. We also have to trap - * cases where the filter extends beyond the end of clip. - * Note: this_frame->frame has been updated in the loop - * so it now points at the ARF frame. - */ - half_gf_int = cpi->baseline_gf_interval >> 1; - frames_after_arf = (int)(cpi->twopass.total_stats.count - - this_frame->frame - 1); - - switch (cpi->oxcf.arnr_type) - { - case 1: /* Backward filter */ - frames_fwd = 0; - if (frames_bwd > half_gf_int) - frames_bwd = half_gf_int; - break; - - case 2: /* Forward filter */ - if (frames_fwd > half_gf_int) - frames_fwd = half_gf_int; - if (frames_fwd > frames_after_arf) - frames_fwd = frames_after_arf; - frames_bwd = 0; - break; - - case 3: /* Centered filter */ - default: - frames_fwd >>= 1; - if (frames_fwd > frames_after_arf) - frames_fwd = frames_after_arf; - if (frames_fwd > half_gf_int) - frames_fwd = half_gf_int; - - frames_bwd = frames_fwd; - - /* For even length filter there is one more frame backward - * than forward: e.g. len=6 ==> bbbAff, len=7 ==> bbbAfff. - */ - if (frames_bwd < half_gf_int) - frames_bwd += (cpi->oxcf.arnr_max_frames+1) & 0x1; - break; - } - - cpi->active_arnr_frames = frames_bwd + 1 + frames_fwd; - } - else - { - cpi->source_alt_ref_pending = 0; - cpi->baseline_gf_interval = i; - } - } - else - { - cpi->source_alt_ref_pending = 0; - cpi->baseline_gf_interval = i; - } - - /* - * Now decide how many bits should be allocated to the GF group as a - * proportion of those remaining in the kf group. - * The final key frame group in the clip is treated as a special case - * where cpi->twopass.kf_group_bits is tied to cpi->twopass.bits_left. - * This is also important for short clips where there may only be one - * key frame. - */ - if (cpi->twopass.frames_to_key >= (int)(cpi->twopass.total_stats.count - - cpi->common.current_video_frame)) - { - cpi->twopass.kf_group_bits = - (cpi->twopass.bits_left > 0) ? cpi->twopass.bits_left : 0; - } - - /* Calculate the bits to be allocated to the group as a whole */ - if ((cpi->twopass.kf_group_bits > 0) && - (cpi->twopass.kf_group_error_left > 0)) - { - cpi->twopass.gf_group_bits = - (int64_t)(cpi->twopass.kf_group_bits * - (gf_group_err / cpi->twopass.kf_group_error_left)); - } - else - cpi->twopass.gf_group_bits = 0; - - cpi->twopass.gf_group_bits = - (cpi->twopass.gf_group_bits < 0) - ? 0 - : (cpi->twopass.gf_group_bits > cpi->twopass.kf_group_bits) - ? cpi->twopass.kf_group_bits : cpi->twopass.gf_group_bits; - - /* Clip cpi->twopass.gf_group_bits based on user supplied data rate - * variability limit (cpi->oxcf.two_pass_vbrmax_section) - */ - if (cpi->twopass.gf_group_bits > - (int64_t)max_bits * cpi->baseline_gf_interval) - cpi->twopass.gf_group_bits = - (int64_t)max_bits * cpi->baseline_gf_interval; - - /* Reset the file position */ - reset_fpf_position(cpi, start_pos); - - /* Update the record of error used so far (only done once per gf group) */ - cpi->twopass.modified_error_used += gf_group_err; - - /* Assign bits to the arf or gf. */ - for (i = 0; i <= (cpi->source_alt_ref_pending && cpi->common.frame_type != KEY_FRAME); i++) { - int Boost; - int allocation_chunks; - int Q = (cpi->oxcf.fixed_q < 0) ? cpi->last_q[INTER_FRAME] : cpi->oxcf.fixed_q; - int gf_bits; - - /* For ARF frames */ - if (cpi->source_alt_ref_pending && i == 0) - { -#if NEW_BOOST - Boost = (alt_boost * GFQ_ADJUSTMENT) / 100; -#else - Boost = (cpi->gfu_boost * 3 * GFQ_ADJUSTMENT) / (2 * 100); -#endif - Boost += (cpi->baseline_gf_interval * 50); - - /* Set max and minimum boost and hence minimum allocation */ - if (Boost > ((cpi->baseline_gf_interval + 1) * 200)) - Boost = ((cpi->baseline_gf_interval + 1) * 200); - else if (Boost < 125) - Boost = 125; - - allocation_chunks = - ((cpi->baseline_gf_interval + 1) * 100) + Boost; - } - /* Else for standard golden frames */ - else - { - /* boost based on inter / intra ratio of subsequent frames */ - Boost = (cpi->gfu_boost * GFQ_ADJUSTMENT) / 100; - - /* Set max and minimum boost and hence minimum allocation */ - if (Boost > (cpi->baseline_gf_interval * 150)) - Boost = (cpi->baseline_gf_interval * 150); - else if (Boost < 125) - Boost = 125; - - allocation_chunks = - (cpi->baseline_gf_interval * 100) + (Boost - 100); - } - - /* Normalize Altboost and allocations chunck down to prevent overflow */ - while (Boost > 1000) - { - Boost /= 2; - allocation_chunks /= 2; - } - - /* Calculate the number of bits to be spent on the gf or arf based on - * the boost number - */ - gf_bits = (int)((double)Boost * - (cpi->twopass.gf_group_bits / - (double)allocation_chunks)); - - /* If the frame that is to be boosted is simpler than the average for - * the gf/arf group then use an alternative calculation - * based on the error score of the frame itself - */ - if (mod_frame_err < gf_group_err / (double)cpi->baseline_gf_interval) - { - double alt_gf_grp_bits; - int alt_gf_bits; - - alt_gf_grp_bits = - (double)cpi->twopass.kf_group_bits * - (mod_frame_err * (double)cpi->baseline_gf_interval) / - DOUBLE_DIVIDE_CHECK((double)cpi->twopass.kf_group_error_left); - - alt_gf_bits = (int)((double)Boost * (alt_gf_grp_bits / - (double)allocation_chunks)); - - if (gf_bits > alt_gf_bits) - { - gf_bits = alt_gf_bits; - } - } - /* Else if it is harder than other frames in the group make sure it at - * least receives an allocation in keeping with its relative error - * score, otherwise it may be worse off than an "un-boosted" frame - */ - else - { - int alt_gf_bits = - (int)((double)cpi->twopass.kf_group_bits * - mod_frame_err / - DOUBLE_DIVIDE_CHECK((double)cpi->twopass.kf_group_error_left)); - - if (alt_gf_bits > gf_bits) - { - gf_bits = alt_gf_bits; - } - } - - /* Apply an additional limit for CBR */ - if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) - { - if (cpi->twopass.gf_bits > (int)(cpi->buffer_level >> 1)) - cpi->twopass.gf_bits = (int)(cpi->buffer_level >> 1); - } - - /* Dont allow a negative value for gf_bits */ - if (gf_bits < 0) - gf_bits = 0; - - /* Add in minimum for a frame */ - gf_bits += cpi->min_frame_bandwidth; - - if (i == 0) - { - cpi->twopass.gf_bits = gf_bits; - } - if (i == 1 || (!cpi->source_alt_ref_pending && (cpi->common.frame_type != KEY_FRAME))) - { - /* Per frame bit target for this frame */ - cpi->per_frame_bandwidth = gf_bits; - } - } - - { - /* Adjust KF group bits and error remainin */ - cpi->twopass.kf_group_error_left -= (int64_t)gf_group_err; - cpi->twopass.kf_group_bits -= cpi->twopass.gf_group_bits; - - if (cpi->twopass.kf_group_bits < 0) - cpi->twopass.kf_group_bits = 0; - - /* Note the error score left in the remaining frames of the group. - * For normal GFs we want to remove the error score for the first - * frame of the group (except in Key frame case where this has - * already happened) - */ - if (!cpi->source_alt_ref_pending && cpi->common.frame_type != KEY_FRAME) - cpi->twopass.gf_group_error_left = (int)(gf_group_err - - gf_first_frame_err); - else - cpi->twopass.gf_group_error_left = (int) gf_group_err; - - cpi->twopass.gf_group_bits -= cpi->twopass.gf_bits - cpi->min_frame_bandwidth; - - if (cpi->twopass.gf_group_bits < 0) - cpi->twopass.gf_group_bits = 0; - - /* This condition could fail if there are two kfs very close together - * despite (MIN_GF_INTERVAL) and would cause a devide by 0 in the - * calculation of cpi->twopass.alt_extra_bits. - */ - if ( cpi->baseline_gf_interval >= 3 ) - { -#if NEW_BOOST - int boost = (cpi->source_alt_ref_pending) - ? b_boost : cpi->gfu_boost; -#else - int boost = cpi->gfu_boost; -#endif - if ( boost >= 150 ) - { - int pct_extra; - - pct_extra = (boost - 100) / 50; - pct_extra = (pct_extra > 20) ? 20 : pct_extra; - - cpi->twopass.alt_extra_bits = - (int)(cpi->twopass.gf_group_bits * pct_extra) / 100; - cpi->twopass.gf_group_bits -= cpi->twopass.alt_extra_bits; - cpi->twopass.alt_extra_bits /= - ((cpi->baseline_gf_interval-1)>>1); - } - else - cpi->twopass.alt_extra_bits = 0; - } - else - cpi->twopass.alt_extra_bits = 0; - } - - /* Adjustments based on a measure of complexity of the section */ - if (cpi->common.frame_type != KEY_FRAME) - { - FIRSTPASS_STATS sectionstats; - double Ratio; - - zero_stats(§ionstats); - reset_fpf_position(cpi, start_pos); - - for (i = 0 ; i < cpi->baseline_gf_interval ; i++) - { - input_stats(cpi, &next_frame); - accumulate_stats(§ionstats, &next_frame); - } - - avg_stats(§ionstats); - - cpi->twopass.section_intra_rating = (unsigned int) - (sectionstats.intra_error / - DOUBLE_DIVIDE_CHECK(sectionstats.coded_error)); - - Ratio = sectionstats.intra_error / DOUBLE_DIVIDE_CHECK(sectionstats.coded_error); - cpi->twopass.section_max_qfactor = 1.0 - ((Ratio - 10.0) * 0.025); - - if (cpi->twopass.section_max_qfactor < 0.80) - cpi->twopass.section_max_qfactor = 0.80; - - reset_fpf_position(cpi, start_pos); - } -} - -/* Allocate bits to a normal frame that is neither a gf an arf or a key frame. */ -static void assign_std_frame_bits(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) -{ - int target_frame_size; - - double modified_err; - double err_fraction; - - int max_bits = frame_max_bits(cpi); /* Max for a single frame */ - - /* Calculate modified prediction error used in bit allocation */ - modified_err = calculate_modified_err(cpi, this_frame); - - /* What portion of the remaining GF group error is used by this frame */ - if (cpi->twopass.gf_group_error_left > 0) - err_fraction = modified_err / cpi->twopass.gf_group_error_left; - else - err_fraction = 0.0; - - /* How many of those bits available for allocation should we give it? */ - target_frame_size = (int)((double)cpi->twopass.gf_group_bits * err_fraction); - - /* Clip to target size to 0 - max_bits (or cpi->twopass.gf_group_bits) - * at the top end. - */ - if (target_frame_size < 0) - target_frame_size = 0; - else - { - if (target_frame_size > max_bits) - target_frame_size = max_bits; - - if (target_frame_size > cpi->twopass.gf_group_bits) - target_frame_size = (int)cpi->twopass.gf_group_bits; - } - - /* Adjust error and bits remaining */ - cpi->twopass.gf_group_error_left -= (int)modified_err; - cpi->twopass.gf_group_bits -= target_frame_size; - - if (cpi->twopass.gf_group_bits < 0) - cpi->twopass.gf_group_bits = 0; - - /* Add in the minimum number of bits that is set aside for every frame. */ - target_frame_size += cpi->min_frame_bandwidth; - - /* Every other frame gets a few extra bits */ - if ( (cpi->frames_since_golden & 0x01) && - (cpi->frames_till_gf_update_due > 0) ) - { - target_frame_size += cpi->twopass.alt_extra_bits; - } - - /* Per frame bit target for this frame */ - cpi->per_frame_bandwidth = target_frame_size; -} - -void vp8_second_pass(VP8_COMP *cpi) -{ - int tmp_q; - int frames_left = (int)(cpi->twopass.total_stats.count - cpi->common.current_video_frame); - - FIRSTPASS_STATS this_frame = {0}; - FIRSTPASS_STATS this_frame_copy; - - double this_frame_intra_error; - double this_frame_coded_error; - - int overhead_bits; - - if (!cpi->twopass.stats_in) - { - return ; - } - - vp8_clear_system_state(); - - if (EOF == input_stats(cpi, &this_frame)) - return; - - this_frame_intra_error = this_frame.intra_error; - this_frame_coded_error = this_frame.coded_error; - - /* keyframe and section processing ! */ - if (cpi->twopass.frames_to_key == 0) - { - /* Define next KF group and assign bits to it */ - vpx_memcpy(&this_frame_copy, &this_frame, sizeof(this_frame)); - find_next_key_frame(cpi, &this_frame_copy); - - /* Special case: Error error_resilient_mode mode does not make much - * sense for two pass but with its current meaning this code is - * designed to stop outlandish behaviour if someone does set it when - * using two pass. It effectively disables GF groups. This is - * temporary code until we decide what should really happen in this - * case. - */ - if (cpi->oxcf.error_resilient_mode) - { - cpi->twopass.gf_group_bits = cpi->twopass.kf_group_bits; - cpi->twopass.gf_group_error_left = - (int)cpi->twopass.kf_group_error_left; - cpi->baseline_gf_interval = cpi->twopass.frames_to_key; - cpi->frames_till_gf_update_due = cpi->baseline_gf_interval; - cpi->source_alt_ref_pending = 0; - } - - } - - /* Is this a GF / ARF (Note that a KF is always also a GF) */ - if (cpi->frames_till_gf_update_due == 0) - { - /* Define next gf group and assign bits to it */ - vpx_memcpy(&this_frame_copy, &this_frame, sizeof(this_frame)); - define_gf_group(cpi, &this_frame_copy); - - /* If we are going to code an altref frame at the end of the group - * and the current frame is not a key frame.... If the previous - * group used an arf this frame has already benefited from that arf - * boost and it should not be given extra bits If the previous - * group was NOT coded using arf we may want to apply some boost to - * this GF as well - */ - if (cpi->source_alt_ref_pending && (cpi->common.frame_type != KEY_FRAME)) - { - /* Assign a standard frames worth of bits from those allocated - * to the GF group - */ - int bak = cpi->per_frame_bandwidth; - vpx_memcpy(&this_frame_copy, &this_frame, sizeof(this_frame)); - assign_std_frame_bits(cpi, &this_frame_copy); - cpi->per_frame_bandwidth = bak; - } - } - - /* Otherwise this is an ordinary frame */ - else - { - /* Special case: Error error_resilient_mode mode does not make much - * sense for two pass but with its current meaning but this code is - * designed to stop outlandish behaviour if someone does set it - * when using two pass. It effectively disables GF groups. This is - * temporary code till we decide what should really happen in this - * case. - */ - if (cpi->oxcf.error_resilient_mode) - { - cpi->frames_till_gf_update_due = cpi->twopass.frames_to_key; - - if (cpi->common.frame_type != KEY_FRAME) - { - /* Assign bits from those allocated to the GF group */ - vpx_memcpy(&this_frame_copy, &this_frame, sizeof(this_frame)); - assign_std_frame_bits(cpi, &this_frame_copy); - } - } - else - { - /* Assign bits from those allocated to the GF group */ - vpx_memcpy(&this_frame_copy, &this_frame, sizeof(this_frame)); - assign_std_frame_bits(cpi, &this_frame_copy); - } - } - - /* Keep a globally available copy of this and the next frame's iiratio. */ - cpi->twopass.this_iiratio = (unsigned int)(this_frame_intra_error / - DOUBLE_DIVIDE_CHECK(this_frame_coded_error)); - { - FIRSTPASS_STATS next_frame; - if ( lookup_next_frame_stats(cpi, &next_frame) != EOF ) - { - cpi->twopass.next_iiratio = (unsigned int)(next_frame.intra_error / - DOUBLE_DIVIDE_CHECK(next_frame.coded_error)); - } - } - - /* Set nominal per second bandwidth for this frame */ - cpi->target_bandwidth = (int) - (cpi->per_frame_bandwidth * cpi->output_framerate); - if (cpi->target_bandwidth < 0) - cpi->target_bandwidth = 0; - - - /* Account for mv, mode and other overheads. */ - overhead_bits = (int)estimate_modemvcost( - cpi, &cpi->twopass.total_left_stats ); - - /* Special case code for first frame. */ - if (cpi->common.current_video_frame == 0) - { - cpi->twopass.est_max_qcorrection_factor = 1.0; - - /* Set a cq_level in constrained quality mode. */ - if ( cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY ) - { - int est_cq; - - est_cq = - estimate_cq( cpi, - &cpi->twopass.total_left_stats, - (int)(cpi->twopass.bits_left / frames_left), - overhead_bits ); - - cpi->cq_target_quality = cpi->oxcf.cq_level; - if ( est_cq > cpi->cq_target_quality ) - cpi->cq_target_quality = est_cq; - } - - /* guess at maxq needed in 2nd pass */ - cpi->twopass.maxq_max_limit = cpi->worst_quality; - cpi->twopass.maxq_min_limit = cpi->best_quality; - - tmp_q = estimate_max_q( - cpi, - &cpi->twopass.total_left_stats, - (int)(cpi->twopass.bits_left / frames_left), - overhead_bits ); - - /* Limit the maxq value returned subsequently. - * This increases the risk of overspend or underspend if the initial - * estimate for the clip is bad, but helps prevent excessive - * variation in Q, especially near the end of a clip - * where for example a small overspend may cause Q to crash - */ - cpi->twopass.maxq_max_limit = ((tmp_q + 32) < cpi->worst_quality) - ? (tmp_q + 32) : cpi->worst_quality; - cpi->twopass.maxq_min_limit = ((tmp_q - 32) > cpi->best_quality) - ? (tmp_q - 32) : cpi->best_quality; - - cpi->active_worst_quality = tmp_q; - cpi->ni_av_qi = tmp_q; - } - - /* The last few frames of a clip almost always have to few or too many - * bits and for the sake of over exact rate control we dont want to make - * radical adjustments to the allowed quantizer range just to use up a - * few surplus bits or get beneath the target rate. - */ - else if ( (cpi->common.current_video_frame < - (((unsigned int)cpi->twopass.total_stats.count * 255)>>8)) && - ((cpi->common.current_video_frame + cpi->baseline_gf_interval) < - (unsigned int)cpi->twopass.total_stats.count) ) - { - if (frames_left < 1) - frames_left = 1; - - tmp_q = estimate_max_q( - cpi, - &cpi->twopass.total_left_stats, - (int)(cpi->twopass.bits_left / frames_left), - overhead_bits ); - - /* Move active_worst_quality but in a damped way */ - if (tmp_q > cpi->active_worst_quality) - cpi->active_worst_quality ++; - else if (tmp_q < cpi->active_worst_quality) - cpi->active_worst_quality --; - - cpi->active_worst_quality = - ((cpi->active_worst_quality * 3) + tmp_q + 2) / 4; - } - - cpi->twopass.frames_to_key --; - - /* Update the total stats remaining sturcture */ - subtract_stats(&cpi->twopass.total_left_stats, &this_frame ); -} - - -static int test_candidate_kf(VP8_COMP *cpi, FIRSTPASS_STATS *last_frame, FIRSTPASS_STATS *this_frame, FIRSTPASS_STATS *next_frame) -{ - int is_viable_kf = 0; - - /* Does the frame satisfy the primary criteria of a key frame - * If so, then examine how well it predicts subsequent frames - */ - if ((this_frame->pcnt_second_ref < 0.10) && - (next_frame->pcnt_second_ref < 0.10) && - ((this_frame->pcnt_inter < 0.05) || - ( - ((this_frame->pcnt_inter - this_frame->pcnt_neutral) < .25) && - ((this_frame->intra_error / DOUBLE_DIVIDE_CHECK(this_frame->coded_error)) < 2.5) && - ((fabs(last_frame->coded_error - this_frame->coded_error) / DOUBLE_DIVIDE_CHECK(this_frame->coded_error) > .40) || - (fabs(last_frame->intra_error - this_frame->intra_error) / DOUBLE_DIVIDE_CHECK(this_frame->intra_error) > .40) || - ((next_frame->intra_error / DOUBLE_DIVIDE_CHECK(next_frame->coded_error)) > 3.5) - ) - ) - ) - ) - { - int i; - FIRSTPASS_STATS *start_pos; - - FIRSTPASS_STATS local_next_frame; - - double boost_score = 0.0; - double old_boost_score = 0.0; - double decay_accumulator = 1.0; - double next_iiratio; - - vpx_memcpy(&local_next_frame, next_frame, sizeof(*next_frame)); - - /* Note the starting file position so we can reset to it */ - start_pos = cpi->twopass.stats_in; - - /* Examine how well the key frame predicts subsequent frames */ - for (i = 0 ; i < 16; i++) - { - next_iiratio = (IIKFACTOR1 * local_next_frame.intra_error / DOUBLE_DIVIDE_CHECK(local_next_frame.coded_error)) ; - - if (next_iiratio > RMAX) - next_iiratio = RMAX; - - /* Cumulative effect of decay in prediction quality */ - if (local_next_frame.pcnt_inter > 0.85) - decay_accumulator = decay_accumulator * local_next_frame.pcnt_inter; - else - decay_accumulator = decay_accumulator * ((0.85 + local_next_frame.pcnt_inter) / 2.0); - - /* Keep a running total */ - boost_score += (decay_accumulator * next_iiratio); - - /* Test various breakout clauses */ - if ((local_next_frame.pcnt_inter < 0.05) || - (next_iiratio < 1.5) || - (((local_next_frame.pcnt_inter - - local_next_frame.pcnt_neutral) < 0.20) && - (next_iiratio < 3.0)) || - ((boost_score - old_boost_score) < 0.5) || - (local_next_frame.intra_error < 200) - ) - { - break; - } - - old_boost_score = boost_score; - - /* Get the next frame details */ - if (EOF == input_stats(cpi, &local_next_frame)) - break; - } - - /* If there is tolerable prediction for at least the next 3 frames - * then break out else discard this pottential key frame and move on - */ - if (boost_score > 5.0 && (i > 3)) - is_viable_kf = 1; - else - { - /* Reset the file position */ - reset_fpf_position(cpi, start_pos); - - is_viable_kf = 0; - } - } - - return is_viable_kf; -} -static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) -{ - int i,j; - FIRSTPASS_STATS last_frame; - FIRSTPASS_STATS first_frame; - FIRSTPASS_STATS next_frame; - FIRSTPASS_STATS *start_position; - - double decay_accumulator = 1.0; - double boost_score = 0; - double old_boost_score = 0.0; - double loop_decay_rate; - - double kf_mod_err = 0.0; - double kf_group_err = 0.0; - double kf_group_intra_err = 0.0; - double kf_group_coded_err = 0.0; - double recent_loop_decay[8] = {1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0}; - - vpx_memset(&next_frame, 0, sizeof(next_frame)); - - vp8_clear_system_state(); - start_position = cpi->twopass.stats_in; - - cpi->common.frame_type = KEY_FRAME; - - /* is this a forced key frame by interval */ - cpi->this_key_frame_forced = cpi->next_key_frame_forced; - - /* Clear the alt ref active flag as this can never be active on a key - * frame - */ - cpi->source_alt_ref_active = 0; - - /* Kf is always a gf so clear frames till next gf counter */ - cpi->frames_till_gf_update_due = 0; - - cpi->twopass.frames_to_key = 1; - - /* Take a copy of the initial frame details */ - vpx_memcpy(&first_frame, this_frame, sizeof(*this_frame)); - - cpi->twopass.kf_group_bits = 0; - cpi->twopass.kf_group_error_left = 0; - - kf_mod_err = calculate_modified_err(cpi, this_frame); - - /* find the next keyframe */ - i = 0; - while (cpi->twopass.stats_in < cpi->twopass.stats_in_end) - { - /* Accumulate kf group error */ - kf_group_err += calculate_modified_err(cpi, this_frame); - - /* These figures keep intra and coded error counts for all frames - * including key frames in the group. The effect of the key frame - * itself can be subtracted out using the first_frame data - * collected above - */ - kf_group_intra_err += this_frame->intra_error; - kf_group_coded_err += this_frame->coded_error; - - /* Load the next frame's stats. */ - vpx_memcpy(&last_frame, this_frame, sizeof(*this_frame)); - input_stats(cpi, this_frame); - - /* Provided that we are not at the end of the file... */ - if (cpi->oxcf.auto_key - && lookup_next_frame_stats(cpi, &next_frame) != EOF) - { - /* Normal scene cut check */ - if ( ( i >= MIN_GF_INTERVAL ) && - test_candidate_kf(cpi, &last_frame, this_frame, &next_frame) ) - { - break; - } - - /* How fast is prediction quality decaying */ - loop_decay_rate = get_prediction_decay_rate(cpi, &next_frame); - - /* We want to know something about the recent past... rather than - * as used elsewhere where we are concened with decay in prediction - * quality since the last GF or KF. - */ - recent_loop_decay[i%8] = loop_decay_rate; - decay_accumulator = 1.0; - for (j = 0; j < 8; j++) - { - decay_accumulator = decay_accumulator * recent_loop_decay[j]; - } - - /* Special check for transition or high motion followed by a - * static scene. - */ - if ( detect_transition_to_still( cpi, i, - (cpi->key_frame_frequency-i), - loop_decay_rate, - decay_accumulator ) ) - { - break; - } - - - /* Step on to the next frame */ - cpi->twopass.frames_to_key ++; - - /* If we don't have a real key frame within the next two - * forcekeyframeevery intervals then break out of the loop. - */ - if (cpi->twopass.frames_to_key >= 2 *(int)cpi->key_frame_frequency) - break; - } else - cpi->twopass.frames_to_key ++; - - i++; - } - - /* If there is a max kf interval set by the user we must obey it. - * We already breakout of the loop above at 2x max. - * This code centers the extra kf if the actual natural - * interval is between 1x and 2x - */ - if (cpi->oxcf.auto_key - && cpi->twopass.frames_to_key > (int)cpi->key_frame_frequency ) - { - FIRSTPASS_STATS *current_pos = cpi->twopass.stats_in; - FIRSTPASS_STATS tmp_frame; - - cpi->twopass.frames_to_key /= 2; - - /* Copy first frame details */ - vpx_memcpy(&tmp_frame, &first_frame, sizeof(first_frame)); - - /* Reset to the start of the group */ - reset_fpf_position(cpi, start_position); - - kf_group_err = 0; - kf_group_intra_err = 0; - kf_group_coded_err = 0; - - /* Rescan to get the correct error data for the forced kf group */ - for( i = 0; i < cpi->twopass.frames_to_key; i++ ) - { - /* Accumulate kf group errors */ - kf_group_err += calculate_modified_err(cpi, &tmp_frame); - kf_group_intra_err += tmp_frame.intra_error; - kf_group_coded_err += tmp_frame.coded_error; - - /* Load a the next frame's stats */ - input_stats(cpi, &tmp_frame); - } - - /* Reset to the start of the group */ - reset_fpf_position(cpi, current_pos); - - cpi->next_key_frame_forced = 1; - } - else - cpi->next_key_frame_forced = 0; - - /* Special case for the last frame of the file */ - if (cpi->twopass.stats_in >= cpi->twopass.stats_in_end) - { - /* Accumulate kf group error */ - kf_group_err += calculate_modified_err(cpi, this_frame); - - /* These figures keep intra and coded error counts for all frames - * including key frames in the group. The effect of the key frame - * itself can be subtracted out using the first_frame data - * collected above - */ - kf_group_intra_err += this_frame->intra_error; - kf_group_coded_err += this_frame->coded_error; - } - - /* Calculate the number of bits that should be assigned to the kf group. */ - if ((cpi->twopass.bits_left > 0) && (cpi->twopass.modified_error_left > 0.0)) - { - /* Max for a single normal frame (not key frame) */ - int max_bits = frame_max_bits(cpi); - - /* Maximum bits for the kf group */ - int64_t max_grp_bits; - - /* Default allocation based on bits left and relative - * complexity of the section - */ - cpi->twopass.kf_group_bits = (int64_t)( cpi->twopass.bits_left * - ( kf_group_err / - cpi->twopass.modified_error_left )); - - /* Clip based on maximum per frame rate defined by the user. */ - max_grp_bits = (int64_t)max_bits * (int64_t)cpi->twopass.frames_to_key; - if (cpi->twopass.kf_group_bits > max_grp_bits) - cpi->twopass.kf_group_bits = max_grp_bits; - - /* Additional special case for CBR if buffer is getting full. */ - if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) - { - int64_t opt_buffer_lvl = cpi->oxcf.optimal_buffer_level; - int64_t buffer_lvl = cpi->buffer_level; - - /* If the buffer is near or above the optimal and this kf group is - * not being allocated much then increase the allocation a bit. - */ - if (buffer_lvl >= opt_buffer_lvl) - { - int64_t high_water_mark = (opt_buffer_lvl + - cpi->oxcf.maximum_buffer_size) >> 1; - - int64_t av_group_bits; - - /* Av bits per frame * number of frames */ - av_group_bits = (int64_t)cpi->av_per_frame_bandwidth * - (int64_t)cpi->twopass.frames_to_key; - - /* We are at or above the maximum. */ - if (cpi->buffer_level >= high_water_mark) - { - int64_t min_group_bits; - - min_group_bits = av_group_bits + - (int64_t)(buffer_lvl - - high_water_mark); - - if (cpi->twopass.kf_group_bits < min_group_bits) - cpi->twopass.kf_group_bits = min_group_bits; - } - /* We are above optimal but below the maximum */ - else if (cpi->twopass.kf_group_bits < av_group_bits) - { - int64_t bits_below_av = av_group_bits - - cpi->twopass.kf_group_bits; - - cpi->twopass.kf_group_bits += - (int64_t)((double)bits_below_av * - (double)(buffer_lvl - opt_buffer_lvl) / - (double)(high_water_mark - opt_buffer_lvl)); - } - } - } - } - else - cpi->twopass.kf_group_bits = 0; - - /* Reset the first pass file position */ - reset_fpf_position(cpi, start_position); - - /* determine how big to make this keyframe based on how well the - * subsequent frames use inter blocks - */ - decay_accumulator = 1.0; - boost_score = 0.0; - loop_decay_rate = 1.00; /* Starting decay rate */ - - for (i = 0 ; i < cpi->twopass.frames_to_key ; i++) - { - double r; - - if (EOF == input_stats(cpi, &next_frame)) - break; - - if (next_frame.intra_error > cpi->twopass.kf_intra_err_min) - r = (IIKFACTOR2 * next_frame.intra_error / - DOUBLE_DIVIDE_CHECK(next_frame.coded_error)); - else - r = (IIKFACTOR2 * cpi->twopass.kf_intra_err_min / - DOUBLE_DIVIDE_CHECK(next_frame.coded_error)); - - if (r > RMAX) - r = RMAX; - - /* How fast is prediction quality decaying */ - loop_decay_rate = get_prediction_decay_rate(cpi, &next_frame); - - decay_accumulator = decay_accumulator * loop_decay_rate; - decay_accumulator = decay_accumulator < 0.1 ? 0.1 : decay_accumulator; - - boost_score += (decay_accumulator * r); - - if ((i > MIN_GF_INTERVAL) && - ((boost_score - old_boost_score) < 1.0)) - { - break; - } - - old_boost_score = boost_score; - } - - if (1) - { - FIRSTPASS_STATS sectionstats; - double Ratio; - - zero_stats(§ionstats); - reset_fpf_position(cpi, start_position); - - for (i = 0 ; i < cpi->twopass.frames_to_key ; i++) - { - input_stats(cpi, &next_frame); - accumulate_stats(§ionstats, &next_frame); - } - - avg_stats(§ionstats); - - cpi->twopass.section_intra_rating = (unsigned int) - (sectionstats.intra_error - / DOUBLE_DIVIDE_CHECK(sectionstats.coded_error)); - - Ratio = sectionstats.intra_error / DOUBLE_DIVIDE_CHECK(sectionstats.coded_error); - cpi->twopass.section_max_qfactor = 1.0 - ((Ratio - 10.0) * 0.025); - - if (cpi->twopass.section_max_qfactor < 0.80) - cpi->twopass.section_max_qfactor = 0.80; - } - - /* When using CBR apply additional buffer fullness related upper limits */ - if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) - { - double max_boost; - - if (cpi->drop_frames_allowed) - { - int df_buffer_level = (int)(cpi->oxcf.drop_frames_water_mark - * (cpi->oxcf.optimal_buffer_level / 100)); - - if (cpi->buffer_level > df_buffer_level) - max_boost = ((double)((cpi->buffer_level - df_buffer_level) * 2 / 3) * 16.0) / DOUBLE_DIVIDE_CHECK((double)cpi->av_per_frame_bandwidth); - else - max_boost = 0.0; - } - else if (cpi->buffer_level > 0) - { - max_boost = ((double)(cpi->buffer_level * 2 / 3) * 16.0) / DOUBLE_DIVIDE_CHECK((double)cpi->av_per_frame_bandwidth); - } - else - { - max_boost = 0.0; - } - - if (boost_score > max_boost) - boost_score = max_boost; - } - - /* Reset the first pass file position */ - reset_fpf_position(cpi, start_position); - - /* Work out how many bits to allocate for the key frame itself */ - if (1) - { - int kf_boost = (int)boost_score; - int allocation_chunks; - int Counter = cpi->twopass.frames_to_key; - int alt_kf_bits; - YV12_BUFFER_CONFIG *lst_yv12 = &cpi->common.yv12_fb[cpi->common.lst_fb_idx]; - /* Min boost based on kf interval */ -#if 0 - - while ((kf_boost < 48) && (Counter > 0)) - { - Counter -= 2; - kf_boost ++; - } - -#endif - - if (kf_boost < 48) - { - kf_boost += ((Counter + 1) >> 1); - - if (kf_boost > 48) kf_boost = 48; - } - - /* bigger frame sizes need larger kf boosts, smaller frames smaller - * boosts... - */ - if ((lst_yv12->y_width * lst_yv12->y_height) > (320 * 240)) - kf_boost += 2 * (lst_yv12->y_width * lst_yv12->y_height) / (320 * 240); - else if ((lst_yv12->y_width * lst_yv12->y_height) < (320 * 240)) - kf_boost -= 4 * (320 * 240) / (lst_yv12->y_width * lst_yv12->y_height); - - /* Min KF boost */ - kf_boost = (int)((double)kf_boost * 100.0) >> 4; /* Scale 16 to 100 */ - if (kf_boost < 250) - kf_boost = 250; - - /* - * We do three calculations for kf size. - * The first is based on the error score for the whole kf group. - * The second (optionaly) on the key frames own error if this is - * smaller than the average for the group. - * The final one insures that the frame receives at least the - * allocation it would have received based on its own error score vs - * the error score remaining - * Special case if the sequence appears almost totaly static - * as measured by the decay accumulator. In this case we want to - * spend almost all of the bits on the key frame. - * cpi->twopass.frames_to_key-1 because key frame itself is taken - * care of by kf_boost. - */ - if ( decay_accumulator >= 0.99 ) - { - allocation_chunks = - ((cpi->twopass.frames_to_key - 1) * 10) + kf_boost; - } - else - { - allocation_chunks = - ((cpi->twopass.frames_to_key - 1) * 100) + kf_boost; - } - - /* Normalize Altboost and allocations chunck down to prevent overflow */ - while (kf_boost > 1000) - { - kf_boost /= 2; - allocation_chunks /= 2; - } - - cpi->twopass.kf_group_bits = (cpi->twopass.kf_group_bits < 0) ? 0 : cpi->twopass.kf_group_bits; - - /* Calculate the number of bits to be spent on the key frame */ - cpi->twopass.kf_bits = (int)((double)kf_boost * ((double)cpi->twopass.kf_group_bits / (double)allocation_chunks)); - - /* Apply an additional limit for CBR */ - if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) - { - if (cpi->twopass.kf_bits > (int)((3 * cpi->buffer_level) >> 2)) - cpi->twopass.kf_bits = (int)((3 * cpi->buffer_level) >> 2); - } - - /* If the key frame is actually easier than the average for the - * kf group (which does sometimes happen... eg a blank intro frame) - * Then use an alternate calculation based on the kf error score - * which should give a smaller key frame. - */ - if (kf_mod_err < kf_group_err / cpi->twopass.frames_to_key) - { - double alt_kf_grp_bits = - ((double)cpi->twopass.bits_left * - (kf_mod_err * (double)cpi->twopass.frames_to_key) / - DOUBLE_DIVIDE_CHECK(cpi->twopass.modified_error_left)); - - alt_kf_bits = (int)((double)kf_boost * - (alt_kf_grp_bits / (double)allocation_chunks)); - - if (cpi->twopass.kf_bits > alt_kf_bits) - { - cpi->twopass.kf_bits = alt_kf_bits; - } - } - /* Else if it is much harder than other frames in the group make sure - * it at least receives an allocation in keeping with its relative - * error score - */ - else - { - alt_kf_bits = - (int)((double)cpi->twopass.bits_left * - (kf_mod_err / - DOUBLE_DIVIDE_CHECK(cpi->twopass.modified_error_left))); - - if (alt_kf_bits > cpi->twopass.kf_bits) - { - cpi->twopass.kf_bits = alt_kf_bits; - } - } - - cpi->twopass.kf_group_bits -= cpi->twopass.kf_bits; - /* Add in the minimum frame allowance */ - cpi->twopass.kf_bits += cpi->min_frame_bandwidth; - - /* Peer frame bit target for this frame */ - cpi->per_frame_bandwidth = cpi->twopass.kf_bits; - - /* Convert to a per second bitrate */ - cpi->target_bandwidth = (int)(cpi->twopass.kf_bits * - cpi->output_framerate); - } - - /* Note the total error score of the kf group minus the key frame itself */ - cpi->twopass.kf_group_error_left = (int)(kf_group_err - kf_mod_err); - - /* Adjust the count of total modified error left. The count of bits left - * is adjusted elsewhere based on real coded frame sizes - */ - cpi->twopass.modified_error_left -= kf_group_err; - - if (cpi->oxcf.allow_spatial_resampling) - { - int resample_trigger = 0; - int last_kf_resampled = 0; - int kf_q; - int scale_val = 0; - int hr, hs, vr, vs; - int new_width = cpi->oxcf.Width; - int new_height = cpi->oxcf.Height; - - int projected_buffer_level = (int)cpi->buffer_level; - int tmp_q; - - double projected_bits_perframe; - double group_iiratio = (kf_group_intra_err - first_frame.intra_error) / (kf_group_coded_err - first_frame.coded_error); - double err_per_frame = kf_group_err / cpi->twopass.frames_to_key; - double bits_per_frame; - double av_bits_per_frame; - double effective_size_ratio; - - if ((cpi->common.Width != cpi->oxcf.Width) || (cpi->common.Height != cpi->oxcf.Height)) - last_kf_resampled = 1; - - /* Set back to unscaled by defaults */ - cpi->common.horiz_scale = NORMAL; - cpi->common.vert_scale = NORMAL; - - /* Calculate Average bits per frame. */ - av_bits_per_frame = cpi->oxcf.target_bandwidth / DOUBLE_DIVIDE_CHECK((double)cpi->framerate); - - /* CBR... Use the clip average as the target for deciding resample */ - if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) - { - bits_per_frame = av_bits_per_frame; - } - - /* In VBR we want to avoid downsampling in easy section unless we - * are under extreme pressure So use the larger of target bitrate - * for this section or average bitrate for sequence - */ - else - { - /* This accounts for how hard the section is... */ - bits_per_frame = (double) - (cpi->twopass.kf_group_bits / cpi->twopass.frames_to_key); - - /* Dont turn to resampling in easy sections just because they - * have been assigned a small number of bits - */ - if (bits_per_frame < av_bits_per_frame) - bits_per_frame = av_bits_per_frame; - } - - /* bits_per_frame should comply with our minimum */ - if (bits_per_frame < (cpi->oxcf.target_bandwidth * cpi->oxcf.two_pass_vbrmin_section / 100)) - bits_per_frame = (cpi->oxcf.target_bandwidth * cpi->oxcf.two_pass_vbrmin_section / 100); - - /* Work out if spatial resampling is necessary */ - kf_q = estimate_kf_group_q(cpi, err_per_frame, - (int)bits_per_frame, group_iiratio); - - /* If we project a required Q higher than the maximum allowed Q then - * make a guess at the actual size of frames in this section - */ - projected_bits_perframe = bits_per_frame; - tmp_q = kf_q; - - while (tmp_q > cpi->worst_quality) - { - projected_bits_perframe *= 1.04; - tmp_q--; - } - - /* Guess at buffer level at the end of the section */ - projected_buffer_level = (int) - (cpi->buffer_level - (int) - ((projected_bits_perframe - av_bits_per_frame) * - cpi->twopass.frames_to_key)); - - if (0) - { - FILE *f = fopen("Subsamle.stt", "a"); - fprintf(f, " %8d %8d %8d %8d %12.0f %8d %8d %8d\n", cpi->common.current_video_frame, kf_q, cpi->common.horiz_scale, cpi->common.vert_scale, kf_group_err / cpi->twopass.frames_to_key, (int)(cpi->twopass.kf_group_bits / cpi->twopass.frames_to_key), new_height, new_width); - fclose(f); - } - - /* The trigger for spatial resampling depends on the various - * parameters such as whether we are streaming (CBR) or VBR. - */ - if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) - { - /* Trigger resample if we are projected to fall below down - * sample level or resampled last time and are projected to - * remain below the up sample level - */ - if ((projected_buffer_level < (cpi->oxcf.resample_down_water_mark * cpi->oxcf.optimal_buffer_level / 100)) || - (last_kf_resampled && (projected_buffer_level < (cpi->oxcf.resample_up_water_mark * cpi->oxcf.optimal_buffer_level / 100)))) - resample_trigger = 1; - else - resample_trigger = 0; - } - else - { - int64_t clip_bits = (int64_t)(cpi->twopass.total_stats.count * cpi->oxcf.target_bandwidth / DOUBLE_DIVIDE_CHECK((double)cpi->framerate)); - int64_t over_spend = cpi->oxcf.starting_buffer_level - cpi->buffer_level; - - /* If triggered last time the threshold for triggering again is - * reduced: - * - * Projected Q higher than allowed and Overspend > 5% of total - * bits - */ - if ((last_kf_resampled && (kf_q > cpi->worst_quality)) || - ((kf_q > cpi->worst_quality) && - (over_spend > clip_bits / 20))) - resample_trigger = 1; - else - resample_trigger = 0; - - } - - if (resample_trigger) - { - while ((kf_q >= cpi->worst_quality) && (scale_val < 6)) - { - scale_val ++; - - cpi->common.vert_scale = vscale_lookup[scale_val]; - cpi->common.horiz_scale = hscale_lookup[scale_val]; - - Scale2Ratio(cpi->common.horiz_scale, &hr, &hs); - Scale2Ratio(cpi->common.vert_scale, &vr, &vs); - - new_width = ((hs - 1) + (cpi->oxcf.Width * hr)) / hs; - new_height = ((vs - 1) + (cpi->oxcf.Height * vr)) / vs; - - /* Reducing the area to 1/4 does not reduce the complexity - * (err_per_frame) to 1/4... effective_sizeratio attempts - * to provide a crude correction for this - */ - effective_size_ratio = (double)(new_width * new_height) / (double)(cpi->oxcf.Width * cpi->oxcf.Height); - effective_size_ratio = (1.0 + (3.0 * effective_size_ratio)) / 4.0; - - /* Now try again and see what Q we get with the smaller - * image size - */ - kf_q = estimate_kf_group_q(cpi, - err_per_frame * effective_size_ratio, - (int)bits_per_frame, group_iiratio); - - if (0) - { - FILE *f = fopen("Subsamle.stt", "a"); - fprintf(f, "******** %8d %8d %8d %12.0f %8d %8d %8d\n", kf_q, cpi->common.horiz_scale, cpi->common.vert_scale, kf_group_err / cpi->twopass.frames_to_key, (int)(cpi->twopass.kf_group_bits / cpi->twopass.frames_to_key), new_height, new_width); - fclose(f); - } - } - } - - if ((cpi->common.Width != new_width) || (cpi->common.Height != new_height)) - { - cpi->common.Width = new_width; - cpi->common.Height = new_height; - vp8_alloc_compressor_data(cpi); - } - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/firstpass.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/firstpass.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/firstpass.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/firstpass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_ENCODER_FIRSTPASS_H_ -#define VP8_ENCODER_FIRSTPASS_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -extern void vp8_init_first_pass(VP8_COMP *cpi); -extern void vp8_first_pass(VP8_COMP *cpi); -extern void vp8_end_first_pass(VP8_COMP *cpi); - -extern void vp8_init_second_pass(VP8_COMP *cpi); -extern void vp8_second_pass(VP8_COMP *cpi); -extern void vp8_end_second_pass(VP8_COMP *cpi); - -extern size_t vp8_firstpass_stats_sz(unsigned int mb_count); -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_FIRSTPASS_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/lookahead.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/lookahead.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/lookahead.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/lookahead.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,230 +0,0 @@ -/* - * Copyright (c) 2011 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#include -#include -#include "vpx_config.h" -#include "lookahead.h" -#include "vp8/common/extend.h" - -#define MAX_LAG_BUFFERS (CONFIG_REALTIME_ONLY? 1 : 25) - -struct lookahead_ctx -{ - unsigned int max_sz; /* Absolute size of the queue */ - unsigned int sz; /* Number of buffers currently in the queue */ - unsigned int read_idx; /* Read index */ - unsigned int write_idx; /* Write index */ - struct lookahead_entry *buf; /* Buffer list */ -}; - - -/* Return the buffer at the given absolute index and increment the index */ -static struct lookahead_entry * -pop(struct lookahead_ctx *ctx, - unsigned int *idx) -{ - unsigned int index = *idx; - struct lookahead_entry *buf = ctx->buf + index; - - assert(index < ctx->max_sz); - if(++index >= ctx->max_sz) - index -= ctx->max_sz; - *idx = index; - return buf; -} - - -void -vp8_lookahead_destroy(struct lookahead_ctx *ctx) -{ - if(ctx) - { - if(ctx->buf) - { - unsigned int i; - - for(i = 0; i < ctx->max_sz; i++) - vp8_yv12_de_alloc_frame_buffer(&ctx->buf[i].img); - free(ctx->buf); - } - free(ctx); - } -} - - -struct lookahead_ctx* -vp8_lookahead_init(unsigned int width, - unsigned int height, - unsigned int depth) -{ - struct lookahead_ctx *ctx = NULL; - unsigned int i; - - /* Clamp the lookahead queue depth */ - if(depth < 1) - depth = 1; - else if(depth > MAX_LAG_BUFFERS) - depth = MAX_LAG_BUFFERS; - - /* Keep last frame in lookahead buffer by increasing depth by 1.*/ - depth += 1; - - /* Align the buffer dimensions */ - width = (width + 15) & ~15; - height = (height + 15) & ~15; - - /* Allocate the lookahead structures */ - ctx = calloc(1, sizeof(*ctx)); - if(ctx) - { - ctx->max_sz = depth; - ctx->buf = calloc(depth, sizeof(*ctx->buf)); - if(!ctx->buf) - goto bail; - for(i=0; ibuf[i].img, - width, height, VP8BORDERINPIXELS)) - goto bail; - } - return ctx; -bail: - vp8_lookahead_destroy(ctx); - return NULL; -} - - -int -vp8_lookahead_push(struct lookahead_ctx *ctx, - YV12_BUFFER_CONFIG *src, - int64_t ts_start, - int64_t ts_end, - unsigned int flags, - unsigned char *active_map) -{ - struct lookahead_entry* buf; - int row, col, active_end; - int mb_rows = (src->y_height + 15) >> 4; - int mb_cols = (src->y_width + 15) >> 4; - - if(ctx->sz + 2 > ctx->max_sz) - return 1; - ctx->sz++; - buf = pop(ctx, &ctx->write_idx); - - /* Only do this partial copy if the following conditions are all met: - * 1. Lookahead queue has has size of 1. - * 2. Active map is provided. - * 3. This is not a key frame, golden nor altref frame. - */ - if (ctx->max_sz == 1 && active_map && !flags) - { - for (row = 0; row < mb_rows; ++row) - { - col = 0; - - while (1) - { - /* Find the first active macroblock in this row. */ - for (; col < mb_cols; ++col) - { - if (active_map[col]) - break; - } - - /* No more active macroblock in this row. */ - if (col == mb_cols) - break; - - /* Find the end of active region in this row. */ - active_end = col; - - for (; active_end < mb_cols; ++active_end) - { - if (!active_map[active_end]) - break; - } - - /* Only copy this active region. */ - vp8_copy_and_extend_frame_with_rect(src, &buf->img, - row << 4, - col << 4, 16, - (active_end - col) << 4); - - /* Start again from the end of this active region. */ - col = active_end; - } - - active_map += mb_cols; - } - } - else - { - vp8_copy_and_extend_frame(src, &buf->img); - } - buf->ts_start = ts_start; - buf->ts_end = ts_end; - buf->flags = flags; - return 0; -} - - -struct lookahead_entry* -vp8_lookahead_pop(struct lookahead_ctx *ctx, - int drain) -{ - struct lookahead_entry* buf = NULL; - - if(ctx->sz && (drain || ctx->sz == ctx->max_sz - 1)) - { - buf = pop(ctx, &ctx->read_idx); - ctx->sz--; - } - return buf; -} - - -struct lookahead_entry* -vp8_lookahead_peek(struct lookahead_ctx *ctx, - unsigned int index, - int direction) -{ - struct lookahead_entry* buf = NULL; - - if (direction == PEEK_FORWARD) - { - assert(index < ctx->max_sz - 1); - if(index < ctx->sz) - { - index += ctx->read_idx; - if(index >= ctx->max_sz) - index -= ctx->max_sz; - buf = ctx->buf + index; - } - } - else if (direction == PEEK_BACKWARD) - { - assert(index == 1); - - if(ctx->read_idx == 0) - index = ctx->max_sz - 1; - else - index = ctx->read_idx - index; - buf = ctx->buf + index; - } - - return buf; -} - - -unsigned int -vp8_lookahead_depth(struct lookahead_ctx *ctx) -{ - return ctx->sz; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/lookahead.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/lookahead.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/lookahead.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/lookahead.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2011 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef VP8_ENCODER_LOOKAHEAD_H_ -#define VP8_ENCODER_LOOKAHEAD_H_ -#include "vpx_scale/yv12config.h" -#include "vpx/vpx_integer.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct lookahead_entry -{ - YV12_BUFFER_CONFIG img; - int64_t ts_start; - int64_t ts_end; - unsigned int flags; -}; - - -struct lookahead_ctx; - -/**\brief Initializes the lookahead stage - * - * The lookahead stage is a queue of frame buffers on which some analysis - * may be done when buffers are enqueued. - * - * - */ -struct lookahead_ctx* vp8_lookahead_init(unsigned int width, - unsigned int height, - unsigned int depth - ); - - -/**\brief Destroys the lookahead stage - * - */ -void vp8_lookahead_destroy(struct lookahead_ctx *ctx); - - -/**\brief Enqueue a source buffer - * - * This function will copy the source image into a new framebuffer with - * the expected stride/border. - * - * If active_map is non-NULL and there is only one frame in the queue, then copy - * only active macroblocks. - * - * \param[in] ctx Pointer to the lookahead context - * \param[in] src Pointer to the image to enqueue - * \param[in] ts_start Timestamp for the start of this frame - * \param[in] ts_end Timestamp for the end of this frame - * \param[in] flags Flags set on this frame - * \param[in] active_map Map that specifies which macroblock is active - */ -int -vp8_lookahead_push(struct lookahead_ctx *ctx, - YV12_BUFFER_CONFIG *src, - int64_t ts_start, - int64_t ts_end, - unsigned int flags, - unsigned char *active_map); - - -/**\brief Get the next source buffer to encode - * - * - * \param[in] ctx Pointer to the lookahead context - * \param[in] drain Flag indicating the buffer should be drained - * (return a buffer regardless of the current queue depth) - * - * \retval NULL, if drain set and queue is empty - * \retval NULL, if drain not set and queue not of the configured depth - * - */ -struct lookahead_entry* -vp8_lookahead_pop(struct lookahead_ctx *ctx, - int drain); - - -#define PEEK_FORWARD 1 -#define PEEK_BACKWARD -1 -/**\brief Get a future source buffer to encode - * - * \param[in] ctx Pointer to the lookahead context - * \param[in] index Index of the frame to be returned, 0 == next frame - * - * \retval NULL, if no buffer exists at the specified index - * - */ -struct lookahead_entry* -vp8_lookahead_peek(struct lookahead_ctx *ctx, - unsigned int index, - int direction); - - -/**\brief Get the number of frames currently in the lookahead queue - * - * \param[in] ctx Pointer to the lookahead context - */ -unsigned int -vp8_lookahead_depth(struct lookahead_ctx *ctx); - - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_LOOKAHEAD_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/mcomp.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/mcomp.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/mcomp.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/mcomp.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2034 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "onyx_int.h" -#include "mcomp.h" -#include "vpx_mem/vpx_mem.h" -#include "vpx_config.h" -#include -#include -#include -#include "vp8/common/findnearmv.h" -#include "vp8/common/common.h" - -#ifdef VP8_ENTROPY_STATS -static int mv_ref_ct [31] [4] [2]; -static int mv_mode_cts [4] [2]; -#endif - -int vp8_mv_bit_cost(int_mv *mv, int_mv *ref, int *mvcost[2], int Weight) -{ - /* MV costing is based on the distribution of vectors in the previous - * frame and as such will tend to over state the cost of vectors. In - * addition coding a new vector can have a knock on effect on the cost - * of subsequent vectors and the quality of prediction from NEAR and - * NEAREST for subsequent blocks. The "Weight" parameter allows, to a - * limited extent, for some account to be taken of these factors. - */ - return ((mvcost[0][(mv->as_mv.row - ref->as_mv.row) >> 1] + mvcost[1][(mv->as_mv.col - ref->as_mv.col) >> 1]) * Weight) >> 7; -} - -static int mv_err_cost(int_mv *mv, int_mv *ref, int *mvcost[2], int error_per_bit) -{ - /* Ignore mv costing if mvcost is NULL */ - if (mvcost) - return ((mvcost[0][(mv->as_mv.row - ref->as_mv.row) >> 1] + - mvcost[1][(mv->as_mv.col - ref->as_mv.col) >> 1]) - * error_per_bit + 128) >> 8; - return 0; -} - -static int mvsad_err_cost(int_mv *mv, int_mv *ref, int *mvsadcost[2], int error_per_bit) -{ - /* Calculate sad error cost on full pixel basis. */ - /* Ignore mv costing if mvsadcost is NULL */ - if (mvsadcost) - return ((mvsadcost[0][(mv->as_mv.row - ref->as_mv.row)] + - mvsadcost[1][(mv->as_mv.col - ref->as_mv.col)]) - * error_per_bit + 128) >> 8; - return 0; -} - -void vp8_init_dsmotion_compensation(MACROBLOCK *x, int stride) -{ - int Len; - int search_site_count = 0; - - - /* Generate offsets for 4 search sites per step. */ - Len = MAX_FIRST_STEP; - x->ss[search_site_count].mv.col = 0; - x->ss[search_site_count].mv.row = 0; - x->ss[search_site_count].offset = 0; - search_site_count++; - - while (Len > 0) - { - - /* Compute offsets for search sites. */ - x->ss[search_site_count].mv.col = 0; - x->ss[search_site_count].mv.row = -Len; - x->ss[search_site_count].offset = -Len * stride; - search_site_count++; - - /* Compute offsets for search sites. */ - x->ss[search_site_count].mv.col = 0; - x->ss[search_site_count].mv.row = Len; - x->ss[search_site_count].offset = Len * stride; - search_site_count++; - - /* Compute offsets for search sites. */ - x->ss[search_site_count].mv.col = -Len; - x->ss[search_site_count].mv.row = 0; - x->ss[search_site_count].offset = -Len; - search_site_count++; - - /* Compute offsets for search sites. */ - x->ss[search_site_count].mv.col = Len; - x->ss[search_site_count].mv.row = 0; - x->ss[search_site_count].offset = Len; - search_site_count++; - - /* Contract. */ - Len /= 2; - } - - x->ss_count = search_site_count; - x->searches_per_step = 4; -} - -void vp8_init3smotion_compensation(MACROBLOCK *x, int stride) -{ - int Len; - int search_site_count = 0; - - /* Generate offsets for 8 search sites per step. */ - Len = MAX_FIRST_STEP; - x->ss[search_site_count].mv.col = 0; - x->ss[search_site_count].mv.row = 0; - x->ss[search_site_count].offset = 0; - search_site_count++; - - while (Len > 0) - { - - /* Compute offsets for search sites. */ - x->ss[search_site_count].mv.col = 0; - x->ss[search_site_count].mv.row = -Len; - x->ss[search_site_count].offset = -Len * stride; - search_site_count++; - - /* Compute offsets for search sites. */ - x->ss[search_site_count].mv.col = 0; - x->ss[search_site_count].mv.row = Len; - x->ss[search_site_count].offset = Len * stride; - search_site_count++; - - /* Compute offsets for search sites. */ - x->ss[search_site_count].mv.col = -Len; - x->ss[search_site_count].mv.row = 0; - x->ss[search_site_count].offset = -Len; - search_site_count++; - - /* Compute offsets for search sites. */ - x->ss[search_site_count].mv.col = Len; - x->ss[search_site_count].mv.row = 0; - x->ss[search_site_count].offset = Len; - search_site_count++; - - /* Compute offsets for search sites. */ - x->ss[search_site_count].mv.col = -Len; - x->ss[search_site_count].mv.row = -Len; - x->ss[search_site_count].offset = -Len * stride - Len; - search_site_count++; - - /* Compute offsets for search sites. */ - x->ss[search_site_count].mv.col = Len; - x->ss[search_site_count].mv.row = -Len; - x->ss[search_site_count].offset = -Len * stride + Len; - search_site_count++; - - /* Compute offsets for search sites. */ - x->ss[search_site_count].mv.col = -Len; - x->ss[search_site_count].mv.row = Len; - x->ss[search_site_count].offset = Len * stride - Len; - search_site_count++; - - /* Compute offsets for search sites. */ - x->ss[search_site_count].mv.col = Len; - x->ss[search_site_count].mv.row = Len; - x->ss[search_site_count].offset = Len * stride + Len; - search_site_count++; - - - /* Contract. */ - Len /= 2; - } - - x->ss_count = search_site_count; - x->searches_per_step = 8; -} - -/* - * To avoid the penalty for crossing cache-line read, preload the reference - * area in a small buffer, which is aligned to make sure there won't be crossing - * cache-line read while reading from this buffer. This reduced the cpu - * cycles spent on reading ref data in sub-pixel filter functions. - * TODO: Currently, since sub-pixel search range here is -3 ~ 3, copy 22 rows x - * 32 cols area that is enough for 16x16 macroblock. Later, for SPLITMV, we - * could reduce the area. - */ - -/* estimated cost of a motion vector (r,c) */ -#define MVC(r,c) (mvcost ? ((mvcost[0][(r)-rr] + mvcost[1][(c) - rc]) * error_per_bit + 128 )>>8 : 0) -/* pointer to predictor base of a motionvector */ -#define PRE(r,c) (y + (((r)>>2) * y_stride + ((c)>>2) -(offset))) -/* convert motion vector component to offset for svf calc */ -#define SP(x) (((x)&3)<<1) -/* returns subpixel variance error function. */ -#define DIST(r,c) vfp->svf( PRE(r,c), y_stride, SP(c),SP(r), z,b->src_stride,&sse) -#define IFMVCV(r,c,s,e) if ( c >= minc && c <= maxc && r >= minr && r <= maxr) s else e; -/* returns distortion + motion vector cost */ -#define ERR(r,c) (MVC(r,c)+DIST(r,c)) -/* checks if (r,c) has better score than previous best */ -#define CHECK_BETTER(v,r,c) IFMVCV(r,c,{thismse = DIST(r,c); if((v = (MVC(r,c)+thismse)) < besterr) { besterr = v; br=r; bc=c; *distortion = thismse; *sse1 = sse; }}, v=UINT_MAX;) - -int vp8_find_best_sub_pixel_step_iteratively(MACROBLOCK *x, BLOCK *b, BLOCKD *d, - int_mv *bestmv, int_mv *ref_mv, - int error_per_bit, - const vp8_variance_fn_ptr_t *vfp, - int *mvcost[2], int *distortion, - unsigned int *sse1) -{ - unsigned char *z = (*(b->base_src) + b->src); - - int rr = ref_mv->as_mv.row >> 1, rc = ref_mv->as_mv.col >> 1; - int br = bestmv->as_mv.row * 4, bc = bestmv->as_mv.col * 4; - int tr = br, tc = bc; - unsigned int besterr; - unsigned int left, right, up, down, diag; - unsigned int sse; - unsigned int whichdir; - unsigned int halfiters = 4; - unsigned int quarteriters = 4; - int thismse; - - int minc = MAX(x->mv_col_min * 4, - (ref_mv->as_mv.col >> 1) - ((1 << mvlong_width) - 1)); - int maxc = MIN(x->mv_col_max * 4, - (ref_mv->as_mv.col >> 1) + ((1 << mvlong_width) - 1)); - int minr = MAX(x->mv_row_min * 4, - (ref_mv->as_mv.row >> 1) - ((1 << mvlong_width) - 1)); - int maxr = MIN(x->mv_row_max * 4, - (ref_mv->as_mv.row >> 1) + ((1 << mvlong_width) - 1)); - - int y_stride; - int offset; - int pre_stride = x->e_mbd.pre.y_stride; - unsigned char *base_pre = x->e_mbd.pre.y_buffer; - - -#if ARCH_X86 || ARCH_X86_64 - MACROBLOCKD *xd = &x->e_mbd; - unsigned char *y_0 = base_pre + d->offset + (bestmv->as_mv.row) * pre_stride + bestmv->as_mv.col; - unsigned char *y; - int buf_r1, buf_r2, buf_c1; - - /* Clamping to avoid out-of-range data access */ - buf_r1 = ((bestmv->as_mv.row - 3) < x->mv_row_min)?(bestmv->as_mv.row - x->mv_row_min):3; - buf_r2 = ((bestmv->as_mv.row + 3) > x->mv_row_max)?(x->mv_row_max - bestmv->as_mv.row):3; - buf_c1 = ((bestmv->as_mv.col - 3) < x->mv_col_min)?(bestmv->as_mv.col - x->mv_col_min):3; - y_stride = 32; - - /* Copy to intermediate buffer before searching. */ - vfp->copymem(y_0 - buf_c1 - pre_stride*buf_r1, pre_stride, xd->y_buf, y_stride, 16+buf_r1+buf_r2); - y = xd->y_buf + y_stride*buf_r1 +buf_c1; -#else - unsigned char *y = base_pre + d->offset + (bestmv->as_mv.row) * pre_stride + bestmv->as_mv.col; - y_stride = pre_stride; -#endif - - offset = (bestmv->as_mv.row) * y_stride + bestmv->as_mv.col; - - /* central mv */ - bestmv->as_mv.row *= 8; - bestmv->as_mv.col *= 8; - - /* calculate central point error */ - besterr = vfp->vf(y, y_stride, z, b->src_stride, sse1); - *distortion = besterr; - besterr += mv_err_cost(bestmv, ref_mv, mvcost, error_per_bit); - - /* TODO: Each subsequent iteration checks at least one point in common - * with the last iteration could be 2 ( if diag selected) - */ - while (--halfiters) - { - /* 1/2 pel */ - CHECK_BETTER(left, tr, tc - 2); - CHECK_BETTER(right, tr, tc + 2); - CHECK_BETTER(up, tr - 2, tc); - CHECK_BETTER(down, tr + 2, tc); - - whichdir = (left < right ? 0 : 1) + (up < down ? 0 : 2); - - switch (whichdir) - { - case 0: - CHECK_BETTER(diag, tr - 2, tc - 2); - break; - case 1: - CHECK_BETTER(diag, tr - 2, tc + 2); - break; - case 2: - CHECK_BETTER(diag, tr + 2, tc - 2); - break; - case 3: - CHECK_BETTER(diag, tr + 2, tc + 2); - break; - } - - /* no reason to check the same one again. */ - if (tr == br && tc == bc) - break; - - tr = br; - tc = bc; - } - - /* TODO: Each subsequent iteration checks at least one point in common - * with the last iteration could be 2 ( if diag selected) - */ - - /* 1/4 pel */ - while (--quarteriters) - { - CHECK_BETTER(left, tr, tc - 1); - CHECK_BETTER(right, tr, tc + 1); - CHECK_BETTER(up, tr - 1, tc); - CHECK_BETTER(down, tr + 1, tc); - - whichdir = (left < right ? 0 : 1) + (up < down ? 0 : 2); - - switch (whichdir) - { - case 0: - CHECK_BETTER(diag, tr - 1, tc - 1); - break; - case 1: - CHECK_BETTER(diag, tr - 1, tc + 1); - break; - case 2: - CHECK_BETTER(diag, tr + 1, tc - 1); - break; - case 3: - CHECK_BETTER(diag, tr + 1, tc + 1); - break; - } - - /* no reason to check the same one again. */ - if (tr == br && tc == bc) - break; - - tr = br; - tc = bc; - } - - bestmv->as_mv.row = br * 2; - bestmv->as_mv.col = bc * 2; - - if ((abs(bestmv->as_mv.col - ref_mv->as_mv.col) > (MAX_FULL_PEL_VAL<<3)) || - (abs(bestmv->as_mv.row - ref_mv->as_mv.row) > (MAX_FULL_PEL_VAL<<3))) - return INT_MAX; - - return besterr; -} -#undef MVC -#undef PRE -#undef SP -#undef DIST -#undef IFMVCV -#undef ERR -#undef CHECK_BETTER - -int vp8_find_best_sub_pixel_step(MACROBLOCK *x, BLOCK *b, BLOCKD *d, - int_mv *bestmv, int_mv *ref_mv, - int error_per_bit, - const vp8_variance_fn_ptr_t *vfp, - int *mvcost[2], int *distortion, - unsigned int *sse1) -{ - int bestmse = INT_MAX; - int_mv startmv; - int_mv this_mv; - unsigned char *z = (*(b->base_src) + b->src); - int left, right, up, down, diag; - unsigned int sse; - int whichdir ; - int thismse; - int y_stride; - int pre_stride = x->e_mbd.pre.y_stride; - unsigned char *base_pre = x->e_mbd.pre.y_buffer; - -#if ARCH_X86 || ARCH_X86_64 - MACROBLOCKD *xd = &x->e_mbd; - unsigned char *y_0 = base_pre + d->offset + (bestmv->as_mv.row) * pre_stride + bestmv->as_mv.col; - unsigned char *y; - - y_stride = 32; - /* Copy 18 rows x 32 cols area to intermediate buffer before searching. */ - vfp->copymem(y_0 - 1 - pre_stride, pre_stride, xd->y_buf, y_stride, 18); - y = xd->y_buf + y_stride + 1; -#else - unsigned char *y = base_pre + d->offset + (bestmv->as_mv.row) * pre_stride + bestmv->as_mv.col; - y_stride = pre_stride; -#endif - - /* central mv */ - bestmv->as_mv.row *= 8; - bestmv->as_mv.col *= 8; - startmv = *bestmv; - - /* calculate central point error */ - bestmse = vfp->vf(y, y_stride, z, b->src_stride, sse1); - *distortion = bestmse; - bestmse += mv_err_cost(bestmv, ref_mv, mvcost, error_per_bit); - - /* go left then right and check error */ - this_mv.as_mv.row = startmv.as_mv.row; - this_mv.as_mv.col = ((startmv.as_mv.col - 8) | 4); - thismse = vfp->svf_halfpix_h(y - 1, y_stride, z, b->src_stride, &sse); - left = thismse + mv_err_cost(&this_mv, ref_mv, mvcost, error_per_bit); - - if (left < bestmse) - { - *bestmv = this_mv; - bestmse = left; - *distortion = thismse; - *sse1 = sse; - } - - this_mv.as_mv.col += 8; - thismse = vfp->svf_halfpix_h(y, y_stride, z, b->src_stride, &sse); - right = thismse + mv_err_cost(&this_mv, ref_mv, mvcost, error_per_bit); - - if (right < bestmse) - { - *bestmv = this_mv; - bestmse = right; - *distortion = thismse; - *sse1 = sse; - } - - /* go up then down and check error */ - this_mv.as_mv.col = startmv.as_mv.col; - this_mv.as_mv.row = ((startmv.as_mv.row - 8) | 4); - thismse = vfp->svf_halfpix_v(y - y_stride, y_stride, z, b->src_stride, &sse); - up = thismse + mv_err_cost(&this_mv, ref_mv, mvcost, error_per_bit); - - if (up < bestmse) - { - *bestmv = this_mv; - bestmse = up; - *distortion = thismse; - *sse1 = sse; - } - - this_mv.as_mv.row += 8; - thismse = vfp->svf_halfpix_v(y, y_stride, z, b->src_stride, &sse); - down = thismse + mv_err_cost(&this_mv, ref_mv, mvcost, error_per_bit); - - if (down < bestmse) - { - *bestmv = this_mv; - bestmse = down; - *distortion = thismse; - *sse1 = sse; - } - - - /* now check 1 more diagonal */ - whichdir = (left < right ? 0 : 1) + (up < down ? 0 : 2); - this_mv = startmv; - - switch (whichdir) - { - case 0: - this_mv.as_mv.col = (this_mv.as_mv.col - 8) | 4; - this_mv.as_mv.row = (this_mv.as_mv.row - 8) | 4; - thismse = vfp->svf_halfpix_hv(y - 1 - y_stride, y_stride, z, b->src_stride, &sse); - break; - case 1: - this_mv.as_mv.col += 4; - this_mv.as_mv.row = (this_mv.as_mv.row - 8) | 4; - thismse = vfp->svf_halfpix_hv(y - y_stride, y_stride, z, b->src_stride, &sse); - break; - case 2: - this_mv.as_mv.col = (this_mv.as_mv.col - 8) | 4; - this_mv.as_mv.row += 4; - thismse = vfp->svf_halfpix_hv(y - 1, y_stride, z, b->src_stride, &sse); - break; - case 3: - default: - this_mv.as_mv.col += 4; - this_mv.as_mv.row += 4; - thismse = vfp->svf_halfpix_hv(y, y_stride, z, b->src_stride, &sse); - break; - } - - diag = thismse + mv_err_cost(&this_mv, ref_mv, mvcost, error_per_bit); - - if (diag < bestmse) - { - *bestmv = this_mv; - bestmse = diag; - *distortion = thismse; - *sse1 = sse; - } - - - /* time to check quarter pels. */ - if (bestmv->as_mv.row < startmv.as_mv.row) - y -= y_stride; - - if (bestmv->as_mv.col < startmv.as_mv.col) - y--; - - startmv = *bestmv; - - - - /* go left then right and check error */ - this_mv.as_mv.row = startmv.as_mv.row; - - if (startmv.as_mv.col & 7) - { - this_mv.as_mv.col = startmv.as_mv.col - 2; - thismse = vfp->svf(y, y_stride, this_mv.as_mv.col & 7, this_mv.as_mv.row & 7, z, b->src_stride, &sse); - } - else - { - this_mv.as_mv.col = (startmv.as_mv.col - 8) | 6; - thismse = vfp->svf(y - 1, y_stride, 6, this_mv.as_mv.row & 7, z, b->src_stride, &sse); - } - - left = thismse + mv_err_cost(&this_mv, ref_mv, mvcost, error_per_bit); - - if (left < bestmse) - { - *bestmv = this_mv; - bestmse = left; - *distortion = thismse; - *sse1 = sse; - } - - this_mv.as_mv.col += 4; - thismse = vfp->svf(y, y_stride, this_mv.as_mv.col & 7, this_mv.as_mv.row & 7, z, b->src_stride, &sse); - right = thismse + mv_err_cost(&this_mv, ref_mv, mvcost, error_per_bit); - - if (right < bestmse) - { - *bestmv = this_mv; - bestmse = right; - *distortion = thismse; - *sse1 = sse; - } - - /* go up then down and check error */ - this_mv.as_mv.col = startmv.as_mv.col; - - if (startmv.as_mv.row & 7) - { - this_mv.as_mv.row = startmv.as_mv.row - 2; - thismse = vfp->svf(y, y_stride, this_mv.as_mv.col & 7, this_mv.as_mv.row & 7, z, b->src_stride, &sse); - } - else - { - this_mv.as_mv.row = (startmv.as_mv.row - 8) | 6; - thismse = vfp->svf(y - y_stride, y_stride, this_mv.as_mv.col & 7, 6, z, b->src_stride, &sse); - } - - up = thismse + mv_err_cost(&this_mv, ref_mv, mvcost, error_per_bit); - - if (up < bestmse) - { - *bestmv = this_mv; - bestmse = up; - *distortion = thismse; - *sse1 = sse; - } - - this_mv.as_mv.row += 4; - thismse = vfp->svf(y, y_stride, this_mv.as_mv.col & 7, this_mv.as_mv.row & 7, z, b->src_stride, &sse); - down = thismse + mv_err_cost(&this_mv, ref_mv, mvcost, error_per_bit); - - if (down < bestmse) - { - *bestmv = this_mv; - bestmse = down; - *distortion = thismse; - *sse1 = sse; - } - - - /* now check 1 more diagonal */ - whichdir = (left < right ? 0 : 1) + (up < down ? 0 : 2); - - this_mv = startmv; - - switch (whichdir) - { - case 0: - - if (startmv.as_mv.row & 7) - { - this_mv.as_mv.row -= 2; - - if (startmv.as_mv.col & 7) - { - this_mv.as_mv.col -= 2; - thismse = vfp->svf(y, y_stride, this_mv.as_mv.col & 7, this_mv.as_mv.row & 7, z, b->src_stride, &sse); - } - else - { - this_mv.as_mv.col = (startmv.as_mv.col - 8) | 6; - thismse = vfp->svf(y - 1, y_stride, 6, this_mv.as_mv.row & 7, z, b->src_stride, &sse);; - } - } - else - { - this_mv.as_mv.row = (startmv.as_mv.row - 8) | 6; - - if (startmv.as_mv.col & 7) - { - this_mv.as_mv.col -= 2; - thismse = vfp->svf(y - y_stride, y_stride, this_mv.as_mv.col & 7, 6, z, b->src_stride, &sse); - } - else - { - this_mv.as_mv.col = (startmv.as_mv.col - 8) | 6; - thismse = vfp->svf(y - y_stride - 1, y_stride, 6, 6, z, b->src_stride, &sse); - } - } - - break; - case 1: - this_mv.as_mv.col += 2; - - if (startmv.as_mv.row & 7) - { - this_mv.as_mv.row -= 2; - thismse = vfp->svf(y, y_stride, this_mv.as_mv.col & 7, this_mv.as_mv.row & 7, z, b->src_stride, &sse); - } - else - { - this_mv.as_mv.row = (startmv.as_mv.row - 8) | 6; - thismse = vfp->svf(y - y_stride, y_stride, this_mv.as_mv.col & 7, 6, z, b->src_stride, &sse); - } - - break; - case 2: - this_mv.as_mv.row += 2; - - if (startmv.as_mv.col & 7) - { - this_mv.as_mv.col -= 2; - thismse = vfp->svf(y, y_stride, this_mv.as_mv.col & 7, this_mv.as_mv.row & 7, z, b->src_stride, &sse); - } - else - { - this_mv.as_mv.col = (startmv.as_mv.col - 8) | 6; - thismse = vfp->svf(y - 1, y_stride, 6, this_mv.as_mv.row & 7, z, b->src_stride, &sse); - } - - break; - case 3: - this_mv.as_mv.col += 2; - this_mv.as_mv.row += 2; - thismse = vfp->svf(y, y_stride, this_mv.as_mv.col & 7, this_mv.as_mv.row & 7, z, b->src_stride, &sse); - break; - } - - diag = thismse + mv_err_cost(&this_mv, ref_mv, mvcost, error_per_bit); - - if (diag < bestmse) - { - *bestmv = this_mv; - bestmse = diag; - *distortion = thismse; - *sse1 = sse; - } - - return bestmse; -} - -int vp8_find_best_half_pixel_step(MACROBLOCK *x, BLOCK *b, BLOCKD *d, - int_mv *bestmv, int_mv *ref_mv, - int error_per_bit, - const vp8_variance_fn_ptr_t *vfp, - int *mvcost[2], int *distortion, - unsigned int *sse1) -{ - int bestmse = INT_MAX; - int_mv startmv; - int_mv this_mv; - unsigned char *z = (*(b->base_src) + b->src); - int left, right, up, down, diag; - unsigned int sse; - int whichdir ; - int thismse; - int y_stride; - int pre_stride = x->e_mbd.pre.y_stride; - unsigned char *base_pre = x->e_mbd.pre.y_buffer; - -#if ARCH_X86 || ARCH_X86_64 - MACROBLOCKD *xd = &x->e_mbd; - unsigned char *y_0 = base_pre + d->offset + (bestmv->as_mv.row) * pre_stride + bestmv->as_mv.col; - unsigned char *y; - - y_stride = 32; - /* Copy 18 rows x 32 cols area to intermediate buffer before searching. */ - vfp->copymem(y_0 - 1 - pre_stride, pre_stride, xd->y_buf, y_stride, 18); - y = xd->y_buf + y_stride + 1; -#else - unsigned char *y = base_pre + d->offset + (bestmv->as_mv.row) * pre_stride + bestmv->as_mv.col; - y_stride = pre_stride; -#endif - - /* central mv */ - bestmv->as_mv.row *= 8; - bestmv->as_mv.col *= 8; - startmv = *bestmv; - - /* calculate central point error */ - bestmse = vfp->vf(y, y_stride, z, b->src_stride, sse1); - *distortion = bestmse; - bestmse += mv_err_cost(bestmv, ref_mv, mvcost, error_per_bit); - - /* go left then right and check error */ - this_mv.as_mv.row = startmv.as_mv.row; - this_mv.as_mv.col = ((startmv.as_mv.col - 8) | 4); - thismse = vfp->svf_halfpix_h(y - 1, y_stride, z, b->src_stride, &sse); - left = thismse + mv_err_cost(&this_mv, ref_mv, mvcost, error_per_bit); - - if (left < bestmse) - { - *bestmv = this_mv; - bestmse = left; - *distortion = thismse; - *sse1 = sse; - } - - this_mv.as_mv.col += 8; - thismse = vfp->svf_halfpix_h(y, y_stride, z, b->src_stride, &sse); - right = thismse + mv_err_cost(&this_mv, ref_mv, mvcost, error_per_bit); - - if (right < bestmse) - { - *bestmv = this_mv; - bestmse = right; - *distortion = thismse; - *sse1 = sse; - } - - /* go up then down and check error */ - this_mv.as_mv.col = startmv.as_mv.col; - this_mv.as_mv.row = ((startmv.as_mv.row - 8) | 4); - thismse = vfp->svf_halfpix_v(y - y_stride, y_stride, z, b->src_stride, &sse); - up = thismse + mv_err_cost(&this_mv, ref_mv, mvcost, error_per_bit); - - if (up < bestmse) - { - *bestmv = this_mv; - bestmse = up; - *distortion = thismse; - *sse1 = sse; - } - - this_mv.as_mv.row += 8; - thismse = vfp->svf_halfpix_v(y, y_stride, z, b->src_stride, &sse); - down = thismse + mv_err_cost(&this_mv, ref_mv, mvcost, error_per_bit); - - if (down < bestmse) - { - *bestmv = this_mv; - bestmse = down; - *distortion = thismse; - *sse1 = sse; - } - - /* now check 1 more diagonal - */ - whichdir = (left < right ? 0 : 1) + (up < down ? 0 : 2); - this_mv = startmv; - - switch (whichdir) - { - case 0: - this_mv.as_mv.col = (this_mv.as_mv.col - 8) | 4; - this_mv.as_mv.row = (this_mv.as_mv.row - 8) | 4; - thismse = vfp->svf_halfpix_hv(y - 1 - y_stride, y_stride, z, b->src_stride, &sse); - break; - case 1: - this_mv.as_mv.col += 4; - this_mv.as_mv.row = (this_mv.as_mv.row - 8) | 4; - thismse = vfp->svf_halfpix_hv(y - y_stride, y_stride, z, b->src_stride, &sse); - break; - case 2: - this_mv.as_mv.col = (this_mv.as_mv.col - 8) | 4; - this_mv.as_mv.row += 4; - thismse = vfp->svf_halfpix_hv(y - 1, y_stride, z, b->src_stride, &sse); - break; - case 3: - default: - this_mv.as_mv.col += 4; - this_mv.as_mv.row += 4; - thismse = vfp->svf_halfpix_hv(y, y_stride, z, b->src_stride, &sse); - break; - } - - diag = thismse + mv_err_cost(&this_mv, ref_mv, mvcost, error_per_bit); - - if (diag < bestmse) - { - *bestmv = this_mv; - bestmse = diag; - *distortion = thismse; - *sse1 = sse; - } - - return bestmse; -} - -#define CHECK_BOUNDS(range) \ -{\ - all_in = 1;\ - all_in &= ((br-range) >= x->mv_row_min);\ - all_in &= ((br+range) <= x->mv_row_max);\ - all_in &= ((bc-range) >= x->mv_col_min);\ - all_in &= ((bc+range) <= x->mv_col_max);\ -} - -#define CHECK_POINT \ -{\ - if (this_mv.as_mv.col < x->mv_col_min) continue;\ - if (this_mv.as_mv.col > x->mv_col_max) continue;\ - if (this_mv.as_mv.row < x->mv_row_min) continue;\ - if (this_mv.as_mv.row > x->mv_row_max) continue;\ -} - -#define CHECK_BETTER \ -{\ - if (thissad < bestsad)\ - {\ - thissad += mvsad_err_cost(&this_mv, &fcenter_mv, mvsadcost, sad_per_bit);\ - if (thissad < bestsad)\ - {\ - bestsad = thissad;\ - best_site = i;\ - }\ - }\ -} - -static const MV next_chkpts[6][3] = -{ - {{ -2, 0}, { -1, -2}, {1, -2}}, - {{ -1, -2}, {1, -2}, {2, 0}}, - {{1, -2}, {2, 0}, {1, 2}}, - {{2, 0}, {1, 2}, { -1, 2}}, - {{1, 2}, { -1, 2}, { -2, 0}}, - {{ -1, 2}, { -2, 0}, { -1, -2}} -}; - -int vp8_hex_search -( - MACROBLOCK *x, - BLOCK *b, - BLOCKD *d, - int_mv *ref_mv, - int_mv *best_mv, - int search_param, - int sad_per_bit, - const vp8_variance_fn_ptr_t *vfp, - int *mvsadcost[2], - int *mvcost[2], - int_mv *center_mv -) -{ - MV hex[6] = { { -1, -2}, {1, -2}, {2, 0}, {1, 2}, { -1, 2}, { -2, 0} } ; - MV neighbors[4] = {{0, -1}, { -1, 0}, {1, 0}, {0, 1}} ; - int i, j; - - unsigned char *what = (*(b->base_src) + b->src); - int what_stride = b->src_stride; - int pre_stride = x->e_mbd.pre.y_stride; - unsigned char *base_pre = x->e_mbd.pre.y_buffer; - - int in_what_stride = pre_stride; - int br, bc; - int_mv this_mv; - unsigned int bestsad; - unsigned int thissad; - unsigned char *base_offset; - unsigned char *this_offset; - int k = -1; - int all_in; - int best_site = -1; - int hex_range = 127; - int dia_range = 8; - - int_mv fcenter_mv; - fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3; - fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3; - - (void)mvcost; - - /* adjust ref_mv to make sure it is within MV range */ - vp8_clamp_mv(ref_mv, x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max); - br = ref_mv->as_mv.row; - bc = ref_mv->as_mv.col; - - /* Work out the start point for the search */ - base_offset = (unsigned char *)(base_pre + d->offset); - this_offset = base_offset + (br * (pre_stride)) + bc; - this_mv.as_mv.row = br; - this_mv.as_mv.col = bc; - bestsad = vfp->sdf(what, what_stride, this_offset, in_what_stride, UINT_MAX) - + mvsad_err_cost(&this_mv, &fcenter_mv, mvsadcost, sad_per_bit); - -#if CONFIG_MULTI_RES_ENCODING - /* Lower search range based on prediction info */ - if (search_param >= 6) goto cal_neighbors; - else if (search_param >= 5) hex_range = 4; - else if (search_param >= 4) hex_range = 6; - else if (search_param >= 3) hex_range = 15; - else if (search_param >= 2) hex_range = 31; - else if (search_param >= 1) hex_range = 63; - - dia_range = 8; -#else - (void)search_param; -#endif - - /* hex search */ - CHECK_BOUNDS(2) - - if(all_in) - { - for (i = 0; i < 6; i++) - { - this_mv.as_mv.row = br + hex[i].row; - this_mv.as_mv.col = bc + hex[i].col; - this_offset = base_offset + (this_mv.as_mv.row * in_what_stride) + this_mv.as_mv.col; - thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride, bestsad); - CHECK_BETTER - } - }else - { - for (i = 0; i < 6; i++) - { - this_mv.as_mv.row = br + hex[i].row; - this_mv.as_mv.col = bc + hex[i].col; - CHECK_POINT - this_offset = base_offset + (this_mv.as_mv.row * in_what_stride) + this_mv.as_mv.col; - thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride, bestsad); - CHECK_BETTER - } - } - - if (best_site == -1) - goto cal_neighbors; - else - { - br += hex[best_site].row; - bc += hex[best_site].col; - k = best_site; - } - - for (j = 1; j < hex_range; j++) - { - best_site = -1; - CHECK_BOUNDS(2) - - if(all_in) - { - for (i = 0; i < 3; i++) - { - this_mv.as_mv.row = br + next_chkpts[k][i].row; - this_mv.as_mv.col = bc + next_chkpts[k][i].col; - this_offset = base_offset + (this_mv.as_mv.row * (in_what_stride)) + this_mv.as_mv.col; - thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride, bestsad); - CHECK_BETTER - } - }else - { - for (i = 0; i < 3; i++) - { - this_mv.as_mv.row = br + next_chkpts[k][i].row; - this_mv.as_mv.col = bc + next_chkpts[k][i].col; - CHECK_POINT - this_offset = base_offset + (this_mv.as_mv.row * (in_what_stride)) + this_mv.as_mv.col; - thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride, bestsad); - CHECK_BETTER - } - } - - if (best_site == -1) - break; - else - { - br += next_chkpts[k][best_site].row; - bc += next_chkpts[k][best_site].col; - k += 5 + best_site; - if (k >= 12) k -= 12; - else if (k >= 6) k -= 6; - } - } - - /* check 4 1-away neighbors */ -cal_neighbors: - for (j = 0; j < dia_range; j++) - { - best_site = -1; - CHECK_BOUNDS(1) - - if(all_in) - { - for (i = 0; i < 4; i++) - { - this_mv.as_mv.row = br + neighbors[i].row; - this_mv.as_mv.col = bc + neighbors[i].col; - this_offset = base_offset + (this_mv.as_mv.row * (in_what_stride)) + this_mv.as_mv.col; - thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride, bestsad); - CHECK_BETTER - } - }else - { - for (i = 0; i < 4; i++) - { - this_mv.as_mv.row = br + neighbors[i].row; - this_mv.as_mv.col = bc + neighbors[i].col; - CHECK_POINT - this_offset = base_offset + (this_mv.as_mv.row * (in_what_stride)) + this_mv.as_mv.col; - thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride, bestsad); - CHECK_BETTER - } - } - - if (best_site == -1) - break; - else - { - br += neighbors[best_site].row; - bc += neighbors[best_site].col; - } - } - - best_mv->as_mv.row = br; - best_mv->as_mv.col = bc; - - return bestsad; -} -#undef CHECK_BOUNDS -#undef CHECK_POINT -#undef CHECK_BETTER - -int vp8_diamond_search_sad_c -( - MACROBLOCK *x, - BLOCK *b, - BLOCKD *d, - int_mv *ref_mv, - int_mv *best_mv, - int search_param, - int sad_per_bit, - int *num00, - vp8_variance_fn_ptr_t *fn_ptr, - int *mvcost[2], - int_mv *center_mv -) -{ - int i, j, step; - - unsigned char *what = (*(b->base_src) + b->src); - int what_stride = b->src_stride; - unsigned char *in_what; - int pre_stride = x->e_mbd.pre.y_stride; - unsigned char *base_pre = x->e_mbd.pre.y_buffer; - int in_what_stride = pre_stride; - unsigned char *best_address; - - int tot_steps; - int_mv this_mv; - - unsigned int bestsad; - unsigned int thissad; - int best_site = 0; - int last_site = 0; - - int ref_row; - int ref_col; - int this_row_offset; - int this_col_offset; - search_site *ss; - - unsigned char *check_here; - - int *mvsadcost[2]; - int_mv fcenter_mv; - - mvsadcost[0] = x->mvsadcost[0]; - mvsadcost[1] = x->mvsadcost[1]; - fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3; - fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3; - - vp8_clamp_mv(ref_mv, x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max); - ref_row = ref_mv->as_mv.row; - ref_col = ref_mv->as_mv.col; - *num00 = 0; - best_mv->as_mv.row = ref_row; - best_mv->as_mv.col = ref_col; - - /* Work out the start point for the search */ - in_what = (unsigned char *)(base_pre + d->offset + (ref_row * pre_stride) + ref_col); - best_address = in_what; - - /* Check the starting position */ - bestsad = fn_ptr->sdf(what, what_stride, in_what, in_what_stride, UINT_MAX) - + mvsad_err_cost(best_mv, &fcenter_mv, mvsadcost, sad_per_bit); - - /* search_param determines the length of the initial step and hence - * the number of iterations 0 = initial step (MAX_FIRST_STEP) pel : - * 1 = (MAX_FIRST_STEP/2) pel, 2 = (MAX_FIRST_STEP/4) pel... etc. - */ - ss = &x->ss[search_param * x->searches_per_step]; - tot_steps = (x->ss_count / x->searches_per_step) - search_param; - - i = 1; - - for (step = 0; step < tot_steps ; step++) - { - for (j = 0 ; j < x->searches_per_step ; j++) - { - /* Trap illegal vectors */ - this_row_offset = best_mv->as_mv.row + ss[i].mv.row; - this_col_offset = best_mv->as_mv.col + ss[i].mv.col; - - if ((this_col_offset > x->mv_col_min) && (this_col_offset < x->mv_col_max) && - (this_row_offset > x->mv_row_min) && (this_row_offset < x->mv_row_max)) - - { - check_here = ss[i].offset + best_address; - thissad = fn_ptr->sdf(what, what_stride, check_here, in_what_stride, bestsad); - - if (thissad < bestsad) - { - this_mv.as_mv.row = this_row_offset; - this_mv.as_mv.col = this_col_offset; - thissad += mvsad_err_cost(&this_mv, &fcenter_mv, - mvsadcost, sad_per_bit); - - if (thissad < bestsad) - { - bestsad = thissad; - best_site = i; - } - } - } - - i++; - } - - if (best_site != last_site) - { - best_mv->as_mv.row += ss[best_site].mv.row; - best_mv->as_mv.col += ss[best_site].mv.col; - best_address += ss[best_site].offset; - last_site = best_site; - } - else if (best_address == in_what) - (*num00)++; - } - - this_mv.as_mv.row = best_mv->as_mv.row << 3; - this_mv.as_mv.col = best_mv->as_mv.col << 3; - - return fn_ptr->vf(what, what_stride, best_address, in_what_stride, &thissad) - + mv_err_cost(&this_mv, center_mv, mvcost, x->errorperbit); -} - -int vp8_diamond_search_sadx4 -( - MACROBLOCK *x, - BLOCK *b, - BLOCKD *d, - int_mv *ref_mv, - int_mv *best_mv, - int search_param, - int sad_per_bit, - int *num00, - vp8_variance_fn_ptr_t *fn_ptr, - int *mvcost[2], - int_mv *center_mv -) -{ - int i, j, step; - - unsigned char *what = (*(b->base_src) + b->src); - int what_stride = b->src_stride; - unsigned char *in_what; - int pre_stride = x->e_mbd.pre.y_stride; - unsigned char *base_pre = x->e_mbd.pre.y_buffer; - int in_what_stride = pre_stride; - unsigned char *best_address; - - int tot_steps; - int_mv this_mv; - - unsigned int bestsad; - unsigned int thissad; - int best_site = 0; - int last_site = 0; - - int ref_row; - int ref_col; - int this_row_offset; - int this_col_offset; - search_site *ss; - - unsigned char *check_here; - - int *mvsadcost[2]; - int_mv fcenter_mv; - - mvsadcost[0] = x->mvsadcost[0]; - mvsadcost[1] = x->mvsadcost[1]; - fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3; - fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3; - - vp8_clamp_mv(ref_mv, x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max); - ref_row = ref_mv->as_mv.row; - ref_col = ref_mv->as_mv.col; - *num00 = 0; - best_mv->as_mv.row = ref_row; - best_mv->as_mv.col = ref_col; - - /* Work out the start point for the search */ - in_what = (unsigned char *)(base_pre + d->offset + (ref_row * pre_stride) + ref_col); - best_address = in_what; - - /* Check the starting position */ - bestsad = fn_ptr->sdf(what, what_stride, in_what, in_what_stride, UINT_MAX) - + mvsad_err_cost(best_mv, &fcenter_mv, mvsadcost, sad_per_bit); - - /* search_param determines the length of the initial step and hence the - * number of iterations 0 = initial step (MAX_FIRST_STEP) pel : 1 = - * (MAX_FIRST_STEP/2) pel, 2 = (MAX_FIRST_STEP/4) pel... etc. - */ - ss = &x->ss[search_param * x->searches_per_step]; - tot_steps = (x->ss_count / x->searches_per_step) - search_param; - - i = 1; - - for (step = 0; step < tot_steps ; step++) - { - int all_in = 1, t; - - /* To know if all neighbor points are within the bounds, 4 bounds - * checking are enough instead of checking 4 bounds for each - * points. - */ - all_in &= ((best_mv->as_mv.row + ss[i].mv.row)> x->mv_row_min); - all_in &= ((best_mv->as_mv.row + ss[i+1].mv.row) < x->mv_row_max); - all_in &= ((best_mv->as_mv.col + ss[i+2].mv.col) > x->mv_col_min); - all_in &= ((best_mv->as_mv.col + ss[i+3].mv.col) < x->mv_col_max); - - if (all_in) - { - unsigned int sad_array[4]; - - for (j = 0 ; j < x->searches_per_step ; j += 4) - { - const unsigned char *block_offset[4]; - - for (t = 0; t < 4; t++) - block_offset[t] = ss[i+t].offset + best_address; - - fn_ptr->sdx4df(what, what_stride, block_offset, in_what_stride, sad_array); - - for (t = 0; t < 4; t++, i++) - { - if (sad_array[t] < bestsad) - { - this_mv.as_mv.row = best_mv->as_mv.row + ss[i].mv.row; - this_mv.as_mv.col = best_mv->as_mv.col + ss[i].mv.col; - sad_array[t] += mvsad_err_cost(&this_mv, &fcenter_mv, - mvsadcost, sad_per_bit); - - if (sad_array[t] < bestsad) - { - bestsad = sad_array[t]; - best_site = i; - } - } - } - } - } - else - { - for (j = 0 ; j < x->searches_per_step ; j++) - { - /* Trap illegal vectors */ - this_row_offset = best_mv->as_mv.row + ss[i].mv.row; - this_col_offset = best_mv->as_mv.col + ss[i].mv.col; - - if ((this_col_offset > x->mv_col_min) && (this_col_offset < x->mv_col_max) && - (this_row_offset > x->mv_row_min) && (this_row_offset < x->mv_row_max)) - { - check_here = ss[i].offset + best_address; - thissad = fn_ptr->sdf(what, what_stride, check_here, in_what_stride, bestsad); - - if (thissad < bestsad) - { - this_mv.as_mv.row = this_row_offset; - this_mv.as_mv.col = this_col_offset; - thissad += mvsad_err_cost(&this_mv, &fcenter_mv, - mvsadcost, sad_per_bit); - - if (thissad < bestsad) - { - bestsad = thissad; - best_site = i; - } - } - } - i++; - } - } - - if (best_site != last_site) - { - best_mv->as_mv.row += ss[best_site].mv.row; - best_mv->as_mv.col += ss[best_site].mv.col; - best_address += ss[best_site].offset; - last_site = best_site; - } - else if (best_address == in_what) - (*num00)++; - } - - this_mv.as_mv.row = best_mv->as_mv.row * 8; - this_mv.as_mv.col = best_mv->as_mv.col * 8; - - return fn_ptr->vf(what, what_stride, best_address, in_what_stride, &thissad) - + mv_err_cost(&this_mv, center_mv, mvcost, x->errorperbit); -} - -int vp8_full_search_sad_c(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv, - int sad_per_bit, int distance, - vp8_variance_fn_ptr_t *fn_ptr, int *mvcost[2], - int_mv *center_mv) -{ - unsigned char *what = (*(b->base_src) + b->src); - int what_stride = b->src_stride; - unsigned char *in_what; - int pre_stride = x->e_mbd.pre.y_stride; - unsigned char *base_pre = x->e_mbd.pre.y_buffer; - int in_what_stride = pre_stride; - int mv_stride = pre_stride; - unsigned char *bestaddress; - int_mv *best_mv = &d->bmi.mv; - int_mv this_mv; - unsigned int bestsad; - unsigned int thissad; - int r, c; - - unsigned char *check_here; - - int ref_row = ref_mv->as_mv.row; - int ref_col = ref_mv->as_mv.col; - - int row_min = ref_row - distance; - int row_max = ref_row + distance; - int col_min = ref_col - distance; - int col_max = ref_col + distance; - - int *mvsadcost[2]; - int_mv fcenter_mv; - - mvsadcost[0] = x->mvsadcost[0]; - mvsadcost[1] = x->mvsadcost[1]; - fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3; - fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3; - - /* Work out the mid point for the search */ - in_what = base_pre + d->offset; - bestaddress = in_what + (ref_row * pre_stride) + ref_col; - - best_mv->as_mv.row = ref_row; - best_mv->as_mv.col = ref_col; - - /* Baseline value at the centre */ - bestsad = fn_ptr->sdf(what, what_stride, bestaddress, - in_what_stride, UINT_MAX) - + mvsad_err_cost(best_mv, &fcenter_mv, mvsadcost, sad_per_bit); - - /* Apply further limits to prevent us looking using vectors that - * stretch beyiond the UMV border - */ - if (col_min < x->mv_col_min) - col_min = x->mv_col_min; - - if (col_max > x->mv_col_max) - col_max = x->mv_col_max; - - if (row_min < x->mv_row_min) - row_min = x->mv_row_min; - - if (row_max > x->mv_row_max) - row_max = x->mv_row_max; - - for (r = row_min; r < row_max ; r++) - { - this_mv.as_mv.row = r; - check_here = r * mv_stride + in_what + col_min; - - for (c = col_min; c < col_max; c++) - { - thissad = fn_ptr->sdf(what, what_stride, check_here, in_what_stride, bestsad); - - this_mv.as_mv.col = c; - thissad += mvsad_err_cost(&this_mv, &fcenter_mv, - mvsadcost, sad_per_bit); - - if (thissad < bestsad) - { - bestsad = thissad; - best_mv->as_mv.row = r; - best_mv->as_mv.col = c; - bestaddress = check_here; - } - - check_here++; - } - } - - this_mv.as_mv.row = best_mv->as_mv.row << 3; - this_mv.as_mv.col = best_mv->as_mv.col << 3; - - return fn_ptr->vf(what, what_stride, bestaddress, in_what_stride, &thissad) - + mv_err_cost(&this_mv, center_mv, mvcost, x->errorperbit); -} - -int vp8_full_search_sadx3(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv, - int sad_per_bit, int distance, - vp8_variance_fn_ptr_t *fn_ptr, int *mvcost[2], - int_mv *center_mv) -{ - unsigned char *what = (*(b->base_src) + b->src); - int what_stride = b->src_stride; - unsigned char *in_what; - int pre_stride = x->e_mbd.pre.y_stride; - unsigned char *base_pre = x->e_mbd.pre.y_buffer; - int in_what_stride = pre_stride; - int mv_stride = pre_stride; - unsigned char *bestaddress; - int_mv *best_mv = &d->bmi.mv; - int_mv this_mv; - unsigned int bestsad; - unsigned int thissad; - int r, c; - - unsigned char *check_here; - - int ref_row = ref_mv->as_mv.row; - int ref_col = ref_mv->as_mv.col; - - int row_min = ref_row - distance; - int row_max = ref_row + distance; - int col_min = ref_col - distance; - int col_max = ref_col + distance; - - unsigned int sad_array[3]; - - int *mvsadcost[2]; - int_mv fcenter_mv; - - mvsadcost[0] = x->mvsadcost[0]; - mvsadcost[1] = x->mvsadcost[1]; - fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3; - fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3; - - /* Work out the mid point for the search */ - in_what = base_pre + d->offset; - bestaddress = in_what + (ref_row * pre_stride) + ref_col; - - best_mv->as_mv.row = ref_row; - best_mv->as_mv.col = ref_col; - - /* Baseline value at the centre */ - bestsad = fn_ptr->sdf(what, what_stride, bestaddress, - in_what_stride, UINT_MAX) - + mvsad_err_cost(best_mv, &fcenter_mv, mvsadcost, sad_per_bit); - - /* Apply further limits to prevent us looking using vectors that stretch - * beyond the UMV border - */ - if (col_min < x->mv_col_min) - col_min = x->mv_col_min; - - if (col_max > x->mv_col_max) - col_max = x->mv_col_max; - - if (row_min < x->mv_row_min) - row_min = x->mv_row_min; - - if (row_max > x->mv_row_max) - row_max = x->mv_row_max; - - for (r = row_min; r < row_max ; r++) - { - this_mv.as_mv.row = r; - check_here = r * mv_stride + in_what + col_min; - c = col_min; - - while ((c + 2) < col_max) - { - int i; - - fn_ptr->sdx3f(what, what_stride, check_here, in_what_stride, sad_array); - - for (i = 0; i < 3; i++) - { - thissad = sad_array[i]; - - if (thissad < bestsad) - { - this_mv.as_mv.col = c; - thissad += mvsad_err_cost(&this_mv, &fcenter_mv, - mvsadcost, sad_per_bit); - - if (thissad < bestsad) - { - bestsad = thissad; - best_mv->as_mv.row = r; - best_mv->as_mv.col = c; - bestaddress = check_here; - } - } - - check_here++; - c++; - } - } - - while (c < col_max) - { - thissad = fn_ptr->sdf(what, what_stride, check_here, in_what_stride, bestsad); - - if (thissad < bestsad) - { - this_mv.as_mv.col = c; - thissad += mvsad_err_cost(&this_mv, &fcenter_mv, - mvsadcost, sad_per_bit); - - if (thissad < bestsad) - { - bestsad = thissad; - best_mv->as_mv.row = r; - best_mv->as_mv.col = c; - bestaddress = check_here; - } - } - - check_here ++; - c ++; - } - - } - - this_mv.as_mv.row = best_mv->as_mv.row << 3; - this_mv.as_mv.col = best_mv->as_mv.col << 3; - - return fn_ptr->vf(what, what_stride, bestaddress, in_what_stride, &thissad) - + mv_err_cost(&this_mv, center_mv, mvcost, x->errorperbit); -} - -int vp8_full_search_sadx8(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv, - int sad_per_bit, int distance, - vp8_variance_fn_ptr_t *fn_ptr, int *mvcost[2], - int_mv *center_mv) -{ - unsigned char *what = (*(b->base_src) + b->src); - int what_stride = b->src_stride; - int pre_stride = x->e_mbd.pre.y_stride; - unsigned char *base_pre = x->e_mbd.pre.y_buffer; - unsigned char *in_what; - int in_what_stride = pre_stride; - int mv_stride = pre_stride; - unsigned char *bestaddress; - int_mv *best_mv = &d->bmi.mv; - int_mv this_mv; - unsigned int bestsad; - unsigned int thissad; - int r, c; - - unsigned char *check_here; - - int ref_row = ref_mv->as_mv.row; - int ref_col = ref_mv->as_mv.col; - - int row_min = ref_row - distance; - int row_max = ref_row + distance; - int col_min = ref_col - distance; - int col_max = ref_col + distance; - - DECLARE_ALIGNED_ARRAY(16, unsigned short, sad_array8, 8); - unsigned int sad_array[3]; - - int *mvsadcost[2]; - int_mv fcenter_mv; - - mvsadcost[0] = x->mvsadcost[0]; - mvsadcost[1] = x->mvsadcost[1]; - fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3; - fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3; - - /* Work out the mid point for the search */ - in_what = base_pre + d->offset; - bestaddress = in_what + (ref_row * pre_stride) + ref_col; - - best_mv->as_mv.row = ref_row; - best_mv->as_mv.col = ref_col; - - /* Baseline value at the centre */ - bestsad = fn_ptr->sdf(what, what_stride, - bestaddress, in_what_stride, UINT_MAX) - + mvsad_err_cost(best_mv, &fcenter_mv, mvsadcost, sad_per_bit); - - /* Apply further limits to prevent us looking using vectors that stretch - * beyond the UMV border - */ - if (col_min < x->mv_col_min) - col_min = x->mv_col_min; - - if (col_max > x->mv_col_max) - col_max = x->mv_col_max; - - if (row_min < x->mv_row_min) - row_min = x->mv_row_min; - - if (row_max > x->mv_row_max) - row_max = x->mv_row_max; - - for (r = row_min; r < row_max ; r++) - { - this_mv.as_mv.row = r; - check_here = r * mv_stride + in_what + col_min; - c = col_min; - - while ((c + 7) < col_max) - { - int i; - - fn_ptr->sdx8f(what, what_stride, check_here, in_what_stride, sad_array8); - - for (i = 0; i < 8; i++) - { - thissad = sad_array8[i]; - - if (thissad < bestsad) - { - this_mv.as_mv.col = c; - thissad += mvsad_err_cost(&this_mv, &fcenter_mv, - mvsadcost, sad_per_bit); - - if (thissad < bestsad) - { - bestsad = thissad; - best_mv->as_mv.row = r; - best_mv->as_mv.col = c; - bestaddress = check_here; - } - } - - check_here++; - c++; - } - } - - while ((c + 2) < col_max) - { - int i; - - fn_ptr->sdx3f(what, what_stride, check_here , in_what_stride, sad_array); - - for (i = 0; i < 3; i++) - { - thissad = sad_array[i]; - - if (thissad < bestsad) - { - this_mv.as_mv.col = c; - thissad += mvsad_err_cost(&this_mv, &fcenter_mv, - mvsadcost, sad_per_bit); - - if (thissad < bestsad) - { - bestsad = thissad; - best_mv->as_mv.row = r; - best_mv->as_mv.col = c; - bestaddress = check_here; - } - } - - check_here++; - c++; - } - } - - while (c < col_max) - { - thissad = fn_ptr->sdf(what, what_stride, check_here , in_what_stride, bestsad); - - if (thissad < bestsad) - { - this_mv.as_mv.col = c; - thissad += mvsad_err_cost(&this_mv, &fcenter_mv, - mvsadcost, sad_per_bit); - - if (thissad < bestsad) - { - bestsad = thissad; - best_mv->as_mv.row = r; - best_mv->as_mv.col = c; - bestaddress = check_here; - } - } - - check_here ++; - c ++; - } - } - - this_mv.as_mv.row = best_mv->as_mv.row * 8; - this_mv.as_mv.col = best_mv->as_mv.col * 8; - - return fn_ptr->vf(what, what_stride, bestaddress, in_what_stride, &thissad) - + mv_err_cost(&this_mv, center_mv, mvcost, x->errorperbit); -} - -int vp8_refining_search_sad_c(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv, - int error_per_bit, int search_range, - vp8_variance_fn_ptr_t *fn_ptr, int *mvcost[2], - int_mv *center_mv) -{ - MV neighbors[4] = {{-1, 0}, {0, -1}, {0, 1}, {1, 0}}; - int i, j; - short this_row_offset, this_col_offset; - - int what_stride = b->src_stride; - int pre_stride = x->e_mbd.pre.y_stride; - unsigned char *base_pre = x->e_mbd.pre.y_buffer; - int in_what_stride = pre_stride; - unsigned char *what = (*(b->base_src) + b->src); - unsigned char *best_address = (unsigned char *)(base_pre + d->offset + - (ref_mv->as_mv.row * pre_stride) + ref_mv->as_mv.col); - unsigned char *check_here; - int_mv this_mv; - unsigned int bestsad; - unsigned int thissad; - - int *mvsadcost[2]; - int_mv fcenter_mv; - - mvsadcost[0] = x->mvsadcost[0]; - mvsadcost[1] = x->mvsadcost[1]; - fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3; - fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3; - - bestsad = fn_ptr->sdf(what, what_stride, best_address, - in_what_stride, UINT_MAX) - + mvsad_err_cost(ref_mv, &fcenter_mv, mvsadcost, error_per_bit); - - for (i=0; ias_mv.row + neighbors[j].row; - this_col_offset = ref_mv->as_mv.col + neighbors[j].col; - - if ((this_col_offset > x->mv_col_min) && (this_col_offset < x->mv_col_max) && - (this_row_offset > x->mv_row_min) && (this_row_offset < x->mv_row_max)) - { - check_here = (neighbors[j].row)*in_what_stride + neighbors[j].col + best_address; - thissad = fn_ptr->sdf(what, what_stride, check_here , in_what_stride, bestsad); - - if (thissad < bestsad) - { - this_mv.as_mv.row = this_row_offset; - this_mv.as_mv.col = this_col_offset; - thissad += mvsad_err_cost(&this_mv, &fcenter_mv, mvsadcost, error_per_bit); - - if (thissad < bestsad) - { - bestsad = thissad; - best_site = j; - } - } - } - } - - if (best_site == -1) - break; - else - { - ref_mv->as_mv.row += neighbors[best_site].row; - ref_mv->as_mv.col += neighbors[best_site].col; - best_address += (neighbors[best_site].row)*in_what_stride + neighbors[best_site].col; - } - } - - this_mv.as_mv.row = ref_mv->as_mv.row << 3; - this_mv.as_mv.col = ref_mv->as_mv.col << 3; - - return fn_ptr->vf(what, what_stride, best_address, in_what_stride, &thissad) - + mv_err_cost(&this_mv, center_mv, mvcost, x->errorperbit); -} - -int vp8_refining_search_sadx4(MACROBLOCK *x, BLOCK *b, BLOCKD *d, - int_mv *ref_mv, int error_per_bit, - int search_range, vp8_variance_fn_ptr_t *fn_ptr, - int *mvcost[2], int_mv *center_mv) -{ - MV neighbors[4] = {{-1, 0}, {0, -1}, {0, 1}, {1, 0}}; - int i, j; - short this_row_offset, this_col_offset; - - int what_stride = b->src_stride; - int pre_stride = x->e_mbd.pre.y_stride; - unsigned char *base_pre = x->e_mbd.pre.y_buffer; - int in_what_stride = pre_stride; - unsigned char *what = (*(b->base_src) + b->src); - unsigned char *best_address = (unsigned char *)(base_pre + d->offset + - (ref_mv->as_mv.row * pre_stride) + ref_mv->as_mv.col); - unsigned char *check_here; - int_mv this_mv; - unsigned int bestsad; - unsigned int thissad; - - int *mvsadcost[2]; - int_mv fcenter_mv; - - mvsadcost[0] = x->mvsadcost[0]; - mvsadcost[1] = x->mvsadcost[1]; - fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3; - fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3; - - bestsad = fn_ptr->sdf(what, what_stride, best_address, - in_what_stride, UINT_MAX) - + mvsad_err_cost(ref_mv, &fcenter_mv, mvsadcost, error_per_bit); - - for (i=0; ias_mv.row - 1) > x->mv_row_min); - all_in &= ((ref_mv->as_mv.row + 1) < x->mv_row_max); - all_in &= ((ref_mv->as_mv.col - 1) > x->mv_col_min); - all_in &= ((ref_mv->as_mv.col + 1) < x->mv_col_max); - - if(all_in) - { - unsigned int sad_array[4]; - const unsigned char *block_offset[4]; - block_offset[0] = best_address - in_what_stride; - block_offset[1] = best_address - 1; - block_offset[2] = best_address + 1; - block_offset[3] = best_address + in_what_stride; - - fn_ptr->sdx4df(what, what_stride, block_offset, in_what_stride, sad_array); - - for (j = 0; j < 4; j++) - { - if (sad_array[j] < bestsad) - { - this_mv.as_mv.row = ref_mv->as_mv.row + neighbors[j].row; - this_mv.as_mv.col = ref_mv->as_mv.col + neighbors[j].col; - sad_array[j] += mvsad_err_cost(&this_mv, &fcenter_mv, mvsadcost, error_per_bit); - - if (sad_array[j] < bestsad) - { - bestsad = sad_array[j]; - best_site = j; - } - } - } - } - else - { - for (j = 0 ; j < 4 ; j++) - { - this_row_offset = ref_mv->as_mv.row + neighbors[j].row; - this_col_offset = ref_mv->as_mv.col + neighbors[j].col; - - if ((this_col_offset > x->mv_col_min) && (this_col_offset < x->mv_col_max) && - (this_row_offset > x->mv_row_min) && (this_row_offset < x->mv_row_max)) - { - check_here = (neighbors[j].row)*in_what_stride + neighbors[j].col + best_address; - thissad = fn_ptr->sdf(what, what_stride, check_here , in_what_stride, bestsad); - - if (thissad < bestsad) - { - this_mv.as_mv.row = this_row_offset; - this_mv.as_mv.col = this_col_offset; - thissad += mvsad_err_cost(&this_mv, &fcenter_mv, mvsadcost, error_per_bit); - - if (thissad < bestsad) - { - bestsad = thissad; - best_site = j; - } - } - } - } - } - - if (best_site == -1) - break; - else - { - ref_mv->as_mv.row += neighbors[best_site].row; - ref_mv->as_mv.col += neighbors[best_site].col; - best_address += (neighbors[best_site].row)*in_what_stride + neighbors[best_site].col; - } - } - - this_mv.as_mv.row = ref_mv->as_mv.row * 8; - this_mv.as_mv.col = ref_mv->as_mv.col * 8; - - return fn_ptr->vf(what, what_stride, best_address, in_what_stride, &thissad) - + mv_err_cost(&this_mv, center_mv, mvcost, x->errorperbit); -} - -#ifdef VP8_ENTROPY_STATS -void print_mode_context(void) -{ - FILE *f = fopen("modecont.c", "w"); - int i, j; - - fprintf(f, "#include \"entropy.h\"\n"); - fprintf(f, "const int vp8_mode_contexts[6][4] =\n"); - fprintf(f, "{\n"); - - for (j = 0; j < 6; j++) - { - fprintf(f, " { /* %d */\n", j); - fprintf(f, " "); - - for (i = 0; i < 4; i++) - { - int overal_prob; - int this_prob; - int count; - - /* Overall probs */ - count = mv_mode_cts[i][0] + mv_mode_cts[i][1]; - - if (count) - overal_prob = 256 * mv_mode_cts[i][0] / count; - else - overal_prob = 128; - - if (overal_prob == 0) - overal_prob = 1; - - /* context probs */ - count = mv_ref_ct[j][i][0] + mv_ref_ct[j][i][1]; - - if (count) - this_prob = 256 * mv_ref_ct[j][i][0] / count; - else - this_prob = 128; - - if (this_prob == 0) - this_prob = 1; - - fprintf(f, "%5d, ", this_prob); - } - - fprintf(f, " },\n"); - } - - fprintf(f, "};\n"); - fclose(f); -} - -/* MV ref count VP8_ENTROPY_STATS stats code */ -#ifdef VP8_ENTROPY_STATS -void init_mv_ref_counts() -{ - vpx_memset(mv_ref_ct, 0, sizeof(mv_ref_ct)); - vpx_memset(mv_mode_cts, 0, sizeof(mv_mode_cts)); -} - -void accum_mv_refs(MB_PREDICTION_MODE m, const int ct[4]) -{ - if (m == ZEROMV) - { - ++mv_ref_ct [ct[0]] [0] [0]; - ++mv_mode_cts[0][0]; - } - else - { - ++mv_ref_ct [ct[0]] [0] [1]; - ++mv_mode_cts[0][1]; - - if (m == NEARESTMV) - { - ++mv_ref_ct [ct[1]] [1] [0]; - ++mv_mode_cts[1][0]; - } - else - { - ++mv_ref_ct [ct[1]] [1] [1]; - ++mv_mode_cts[1][1]; - - if (m == NEARMV) - { - ++mv_ref_ct [ct[2]] [2] [0]; - ++mv_mode_cts[2][0]; - } - else - { - ++mv_ref_ct [ct[2]] [2] [1]; - ++mv_mode_cts[2][1]; - - if (m == NEWMV) - { - ++mv_ref_ct [ct[3]] [3] [0]; - ++mv_mode_cts[3][0]; - } - else - { - ++mv_ref_ct [ct[3]] [3] [1]; - ++mv_mode_cts[3][1]; - } - } - } - } -} - -#endif/* END MV ref count VP8_ENTROPY_STATS stats code */ - -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/mcomp.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/mcomp.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/mcomp.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/mcomp.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_ENCODER_MCOMP_H_ -#define VP8_ENCODER_MCOMP_H_ - -#include "block.h" -#include "vp8/common/variance.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef VP8_ENTROPY_STATS -extern void init_mv_ref_counts(); -extern void accum_mv_refs(MB_PREDICTION_MODE, const int near_mv_ref_cts[4]); -#endif - - -/* The maximum number of steps in a step search given the largest allowed - * initial step - */ -#define MAX_MVSEARCH_STEPS 8 - -/* Max full pel mv specified in 1 pel units */ -#define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS)) - 1) - -/* Maximum size of the first step in full pel units */ -#define MAX_FIRST_STEP (1 << (MAX_MVSEARCH_STEPS-1)) - -extern void print_mode_context(void); -extern int vp8_mv_bit_cost(int_mv *mv, int_mv *ref, int *mvcost[2], int Weight); -extern void vp8_init_dsmotion_compensation(MACROBLOCK *x, int stride); -extern void vp8_init3smotion_compensation(MACROBLOCK *x, int stride); - - -extern int vp8_hex_search -( - MACROBLOCK *x, - BLOCK *b, - BLOCKD *d, - int_mv *ref_mv, - int_mv *best_mv, - int search_param, - int error_per_bit, - const vp8_variance_fn_ptr_t *vf, - int *mvsadcost[2], - int *mvcost[2], - int_mv *center_mv -); - -typedef int (fractional_mv_step_fp) - (MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *bestmv, int_mv *ref_mv, - int error_per_bit, const vp8_variance_fn_ptr_t *vfp, int *mvcost[2], - int *distortion, unsigned int *sse); - -extern fractional_mv_step_fp vp8_find_best_sub_pixel_step_iteratively; -extern fractional_mv_step_fp vp8_find_best_sub_pixel_step; -extern fractional_mv_step_fp vp8_find_best_half_pixel_step; -extern fractional_mv_step_fp vp8_skip_fractional_mv_step; - -typedef int (*vp8_full_search_fn_t) - ( - MACROBLOCK *x, - BLOCK *b, - BLOCKD *d, - int_mv *ref_mv, - int sad_per_bit, - int distance, - vp8_variance_fn_ptr_t *fn_ptr, - int *mvcost[2], - int_mv *center_mv - ); - -typedef int (*vp8_refining_search_fn_t) - ( - MACROBLOCK *x, - BLOCK *b, - BLOCKD *d, - int_mv *ref_mv, - int sad_per_bit, - int distance, - vp8_variance_fn_ptr_t *fn_ptr, - int *mvcost[2], - int_mv *center_mv - ); - -typedef int (*vp8_diamond_search_fn_t) - ( - MACROBLOCK *x, - BLOCK *b, - BLOCKD *d, - int_mv *ref_mv, - int_mv *best_mv, - int search_param, - int sad_per_bit, - int *num00, - vp8_variance_fn_ptr_t *fn_ptr, - int *mvcost[2], - int_mv *center_mv - ); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_MCOMP_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/modecosts.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/modecosts.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/modecosts.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/modecosts.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vp8/common/blockd.h" -#include "onyx_int.h" -#include "treewriter.h" -#include "vp8/common/entropymode.h" - - -void vp8_init_mode_costs(VP8_COMP *c) -{ - VP8_COMMON *x = &c->common; - struct rd_costs_struct *rd_costs = &c->rd_costs; - - { - const vp8_tree_p T = vp8_bmode_tree; - - int i = 0; - - do - { - int j = 0; - - do - { - vp8_cost_tokens(rd_costs->bmode_costs[i][j], - vp8_kf_bmode_prob[i][j], T); - } - while (++j < VP8_BINTRAMODES); - } - while (++i < VP8_BINTRAMODES); - - vp8_cost_tokens(rd_costs->inter_bmode_costs, x->fc.bmode_prob, T); - } - vp8_cost_tokens(rd_costs->inter_bmode_costs, x->fc.sub_mv_ref_prob, - vp8_sub_mv_ref_tree); - - vp8_cost_tokens(rd_costs->mbmode_cost[1], x->fc.ymode_prob, vp8_ymode_tree); - vp8_cost_tokens(rd_costs->mbmode_cost[0], vp8_kf_ymode_prob, - vp8_kf_ymode_tree); - - vp8_cost_tokens(rd_costs->intra_uv_mode_cost[1], x->fc.uv_mode_prob, - vp8_uv_mode_tree); - vp8_cost_tokens(rd_costs->intra_uv_mode_cost[0], vp8_kf_uv_mode_prob, - vp8_uv_mode_tree); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/modecosts.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/modecosts.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/modecosts.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/modecosts.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_ENCODER_MODECOSTS_H_ -#define VP8_ENCODER_MODECOSTS_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -void vp8_init_mode_costs(VP8_COMP *x); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_MODECOSTS_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/mr_dissim.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/mr_dissim.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/mr_dissim.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/mr_dissim.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,237 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include -#include "vpx_config.h" -#include "onyx_int.h" -#include "mr_dissim.h" -#include "vpx_mem/vpx_mem.h" -#include "rdopt.h" -#include "vp8/common/common.h" - -void vp8_cal_low_res_mb_cols(VP8_COMP *cpi) -{ - int low_res_w; - - /* Support arbitrary down-sampling factor */ - unsigned int iw = cpi->oxcf.Width*cpi->oxcf.mr_down_sampling_factor.den - + cpi->oxcf.mr_down_sampling_factor.num - 1; - - low_res_w = iw/cpi->oxcf.mr_down_sampling_factor.num; - cpi->mr_low_res_mb_cols = ((low_res_w + 15) >> 4); -} - -#define GET_MV(x) \ -if(x->mbmi.ref_frame !=INTRA_FRAME) \ -{ \ - mvx[cnt] = x->mbmi.mv.as_mv.row; \ - mvy[cnt] = x->mbmi.mv.as_mv.col; \ - cnt++; \ -} - -#define GET_MV_SIGN(x) \ -if(x->mbmi.ref_frame !=INTRA_FRAME) \ -{ \ - mvx[cnt] = x->mbmi.mv.as_mv.row; \ - mvy[cnt] = x->mbmi.mv.as_mv.col; \ - if (cm->ref_frame_sign_bias[x->mbmi.ref_frame] \ - != cm->ref_frame_sign_bias[tmp->mbmi.ref_frame]) \ - { \ - mvx[cnt] *= -1; \ - mvy[cnt] *= -1; \ - } \ - cnt++; \ -} - -void vp8_cal_dissimilarity(VP8_COMP *cpi) -{ - VP8_COMMON *cm = &cpi->common; - int i; - - /* Note: The first row & first column in mip are outside the frame, which - * were initialized to all 0.(ref_frame, mode, mv...) - * Their ref_frame = 0 means they won't be counted in the following - * calculation. - */ - if (cpi->oxcf.mr_total_resolutions >1 - && cpi->oxcf.mr_encoder_id < (cpi->oxcf.mr_total_resolutions - 1)) - { - /* Store info for show/no-show frames for supporting alt_ref. - * If parent frame is alt_ref, child has one too. - */ - LOWER_RES_FRAME_INFO* store_info - = (LOWER_RES_FRAME_INFO*)cpi->oxcf.mr_low_res_mode_info; - - store_info->frame_type = cm->frame_type; - - if(cm->frame_type != KEY_FRAME) - { - store_info->is_frame_dropped = 0; - for (i = 1; i < MAX_REF_FRAMES; i++) - store_info->low_res_ref_frames[i] = cpi->current_ref_frames[i]; - } - - if(cm->frame_type != KEY_FRAME) - { - int mb_row; - int mb_col; - /* Point to beginning of allocated MODE_INFO arrays. */ - MODE_INFO *tmp = cm->mip + cm->mode_info_stride; - LOWER_RES_MB_INFO* store_mode_info = store_info->mb_info; - - for (mb_row = 0; mb_row < cm->mb_rows; mb_row ++) - { - tmp++; - for (mb_col = 0; mb_col < cm->mb_cols; mb_col ++) - { - int dissim = INT_MAX; - - if(tmp->mbmi.ref_frame !=INTRA_FRAME) - { - int mvx[8]; - int mvy[8]; - int mmvx; - int mmvy; - int cnt=0; - const MODE_INFO *here = tmp; - const MODE_INFO *above = here - cm->mode_info_stride; - const MODE_INFO *left = here - 1; - const MODE_INFO *aboveleft = above - 1; - const MODE_INFO *aboveright = NULL; - const MODE_INFO *right = NULL; - const MODE_INFO *belowleft = NULL; - const MODE_INFO *below = NULL; - const MODE_INFO *belowright = NULL; - - /* If alternate reference frame is used, we have to - * check sign of MV. */ - if(cpi->oxcf.play_alternate) - { - /* Gather mv of neighboring MBs */ - GET_MV_SIGN(above) - GET_MV_SIGN(left) - GET_MV_SIGN(aboveleft) - - if(mb_col < (cm->mb_cols-1)) - { - right = here + 1; - aboveright = above + 1; - GET_MV_SIGN(right) - GET_MV_SIGN(aboveright) - } - - if(mb_row < (cm->mb_rows-1)) - { - below = here + cm->mode_info_stride; - belowleft = below - 1; - GET_MV_SIGN(below) - GET_MV_SIGN(belowleft) - } - - if(mb_col < (cm->mb_cols-1) - && mb_row < (cm->mb_rows-1)) - { - belowright = below + 1; - GET_MV_SIGN(belowright) - } - }else - { - /* No alt_ref and gather mv of neighboring MBs */ - GET_MV(above) - GET_MV(left) - GET_MV(aboveleft) - - if(mb_col < (cm->mb_cols-1)) - { - right = here + 1; - aboveright = above + 1; - GET_MV(right) - GET_MV(aboveright) - } - - if(mb_row < (cm->mb_rows-1)) - { - below = here + cm->mode_info_stride; - belowleft = below - 1; - GET_MV(below) - GET_MV(belowleft) - } - - if(mb_col < (cm->mb_cols-1) - && mb_row < (cm->mb_rows-1)) - { - belowright = below + 1; - GET_MV(belowright) - } - } - - if (cnt > 0) - { - int max_mvx = mvx[0]; - int min_mvx = mvx[0]; - int max_mvy = mvy[0]; - int min_mvy = mvy[0]; - int i; - - if (cnt > 1) - { - for (i=1; i< cnt; i++) - { - if (mvx[i] > max_mvx) max_mvx = mvx[i]; - else if (mvx[i] < min_mvx) min_mvx = mvx[i]; - if (mvy[i] > max_mvy) max_mvy = mvy[i]; - else if (mvy[i] < min_mvy) min_mvy = mvy[i]; - } - } - - mmvx = MAX(abs(min_mvx - here->mbmi.mv.as_mv.row), - abs(max_mvx - here->mbmi.mv.as_mv.row)); - mmvy = MAX(abs(min_mvy - here->mbmi.mv.as_mv.col), - abs(max_mvy - here->mbmi.mv.as_mv.col)); - dissim = MAX(mmvx, mmvy); - } - } - - /* Store mode info for next resolution encoding */ - store_mode_info->mode = tmp->mbmi.mode; - store_mode_info->ref_frame = tmp->mbmi.ref_frame; - store_mode_info->mv.as_int = tmp->mbmi.mv.as_int; - store_mode_info->dissim = dissim; - tmp++; - store_mode_info++; - } - } - } - } -} - -/* This function is called only when this frame is dropped at current - resolution level. */ -void vp8_store_drop_frame_info(VP8_COMP *cpi) -{ - /* If the frame is dropped in lower-resolution encoding, this information - is passed to higher resolution level so that the encoder knows there - is no mode & motion info available. - */ - if (cpi->oxcf.mr_total_resolutions >1 - && cpi->oxcf.mr_encoder_id < (cpi->oxcf.mr_total_resolutions - 1)) - { - /* Store info for show/no-show frames for supporting alt_ref. - * If parent frame is alt_ref, child has one too. - */ - LOWER_RES_FRAME_INFO* store_info - = (LOWER_RES_FRAME_INFO*)cpi->oxcf.mr_low_res_mode_info; - - /* Set frame_type to be INTER_FRAME since we won't drop key frame. */ - store_info->frame_type = INTER_FRAME; - store_info->is_frame_dropped = 1; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/mr_dissim.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/mr_dissim.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/mr_dissim.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/mr_dissim.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_ENCODER_MR_DISSIM_H_ -#define VP8_ENCODER_MR_DISSIM_H_ -#include "vpx_config.h" - -#ifdef __cplusplus -extern "C" { -#endif - -extern void vp8_cal_low_res_mb_cols(VP8_COMP *cpi); -extern void vp8_cal_dissimilarity(VP8_COMP *cpi); -extern void vp8_store_drop_frame_info(VP8_COMP *cpi); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_MR_DISSIM_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/onyx_if.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/onyx_if.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/onyx_if.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/onyx_if.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,5998 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "./vpx_scale_rtcd.h" -#include "./vp8_rtcd.h" -#include "vp8/common/onyxc_int.h" -#include "vp8/common/blockd.h" -#include "onyx_int.h" -#include "vp8/common/systemdependent.h" -#include "quantize.h" -#include "vp8/common/alloccommon.h" -#include "mcomp.h" -#include "firstpass.h" -#include "vpx/internal/vpx_psnr.h" -#include "vpx_scale/vpx_scale.h" -#include "vp8/common/extend.h" -#include "ratectrl.h" -#include "vp8/common/quant_common.h" -#include "segmentation.h" -#if CONFIG_POSTPROC -#include "vp8/common/postproc.h" -#endif -#include "vpx_mem/vpx_mem.h" -#include "vp8/common/swapyv12buffer.h" -#include "vp8/common/threading.h" -#include "vpx_ports/vpx_timer.h" -#if ARCH_ARM -#include "vpx_ports/arm.h" -#endif -#if CONFIG_MULTI_RES_ENCODING -#include "mr_dissim.h" -#endif -#include "encodeframe.h" - -#include -#include -#include - -#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING -extern int vp8_update_coef_context(VP8_COMP *cpi); -extern void vp8_update_coef_probs(VP8_COMP *cpi); -#endif - -extern void vp8cx_pick_filter_level_fast(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi); -extern void vp8cx_set_alt_lf_level(VP8_COMP *cpi, int filt_val); -extern void vp8cx_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi); - -extern void vp8_deblock_frame(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *post, int filt_lvl, int low_var_thresh, int flag); -extern void print_parms(VP8_CONFIG *ocf, char *filenam); -extern unsigned int vp8_get_processor_freq(); -extern void print_tree_update_probs(); -extern int vp8cx_create_encoder_threads(VP8_COMP *cpi); -extern void vp8cx_remove_encoder_threads(VP8_COMP *cpi); - -int vp8_estimate_entropy_savings(VP8_COMP *cpi); - -int vp8_calc_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest); - -extern void vp8_temporal_filter_prepare_c(VP8_COMP *cpi, int distance); - -static void set_default_lf_deltas(VP8_COMP *cpi); - -extern const int vp8_gf_interval_table[101]; - -#if CONFIG_INTERNAL_STATS -#include "math.h" - -extern double vp8_calc_ssim -( - YV12_BUFFER_CONFIG *source, - YV12_BUFFER_CONFIG *dest, - int lumamask, - double *weight -); - - -extern double vp8_calc_ssimg -( - YV12_BUFFER_CONFIG *source, - YV12_BUFFER_CONFIG *dest, - double *ssim_y, - double *ssim_u, - double *ssim_v -); - - -#endif - - -#ifdef OUTPUT_YUV_SRC -FILE *yuv_file; -#endif -#ifdef OUTPUT_YUV_DENOISED -FILE *yuv_denoised_file; -#endif - -#if 0 -FILE *framepsnr; -FILE *kf_list; -FILE *keyfile; -#endif - -#if 0 -extern int skip_true_count; -extern int skip_false_count; -#endif - - -#ifdef VP8_ENTROPY_STATS -extern int intra_mode_stats[10][10][10]; -#endif - -#ifdef SPEEDSTATS -unsigned int frames_at_speed[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -unsigned int tot_pm = 0; -unsigned int cnt_pm = 0; -unsigned int tot_ef = 0; -unsigned int cnt_ef = 0; -#endif - -#ifdef MODE_STATS -extern unsigned __int64 Sectionbits[50]; -extern int y_modes[5] ; -extern int uv_modes[4] ; -extern int b_modes[10] ; - -extern int inter_y_modes[10] ; -extern int inter_uv_modes[4] ; -extern unsigned int inter_b_modes[15]; -#endif - -extern const int vp8_bits_per_mb[2][QINDEX_RANGE]; - -extern const int qrounding_factors[129]; -extern const int qzbin_factors[129]; -extern void vp8cx_init_quantizer(VP8_COMP *cpi); -extern const int vp8cx_base_skip_false_prob[128]; - -/* Tables relating active max Q to active min Q */ -static const unsigned char kf_low_motion_minq[QINDEX_RANGE] = -{ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,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,1,1,1,1,1,1,1,2,2,2,2, - 3,3,3,3,3,3,4,4,4,5,5,5,5,5,6,6, - 6,6,7,7,8,8,8,8,9,9,10,10,10,10,11,11, - 11,11,12,12,13,13,13,13,14,14,15,15,15,15,16,16, - 16,16,17,17,18,18,18,18,19,20,20,21,21,22,23,23 -}; -static const unsigned char kf_high_motion_minq[QINDEX_RANGE] = -{ - 0,0,0,0,0,0,0,0,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,1,1,1,1,1,1,1,2,2,2,2,3,3,3,3, - 3,3,3,3,4,4,4,4,5,5,5,5,5,5,6,6, - 6,6,7,7,8,8,8,8,9,9,10,10,10,10,11,11, - 11,11,12,12,13,13,13,13,14,14,15,15,15,15,16,16, - 16,16,17,17,18,18,18,18,19,19,20,20,20,20,21,21, - 21,21,22,22,23,23,24,25,25,26,26,27,28,28,29,30 -}; -static const unsigned char gf_low_motion_minq[QINDEX_RANGE] = -{ - 0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2, - 3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6, - 7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,10, - 11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18, - 19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26, - 27,27,28,28,29,29,30,30,31,31,32,32,33,33,34,34, - 35,35,36,36,37,37,38,38,39,39,40,40,41,41,42,42, - 43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58 -}; -static const unsigned char gf_mid_motion_minq[QINDEX_RANGE] = -{ - 0,0,0,0,1,1,1,1,1,1,2,2,3,3,3,4, - 4,4,5,5,5,6,6,6,7,7,7,8,8,8,9,9, - 9,10,10,10,10,11,11,11,12,12,12,12,13,13,13,14, - 14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21, - 22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29, - 30,30,31,31,32,32,33,33,34,34,35,35,36,36,37,37, - 38,39,39,40,40,41,41,42,42,43,43,44,45,46,47,48, - 49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64 -}; -static const unsigned char gf_high_motion_minq[QINDEX_RANGE] = -{ - 0,0,0,0,1,1,1,1,1,2,2,2,3,3,3,4, - 4,4,5,5,5,6,6,6,7,7,7,8,8,8,9,9, - 9,10,10,10,11,11,12,12,13,13,14,14,15,15,16,16, - 17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24, - 25,25,26,26,27,27,28,28,29,29,30,30,31,31,32,32, - 33,33,34,34,35,35,36,36,37,37,38,38,39,39,40,40, - 41,41,42,42,43,44,45,46,47,48,49,50,51,52,53,54, - 55,56,57,58,59,60,62,64,66,68,70,72,74,76,78,80 -}; -static const unsigned char inter_minq[QINDEX_RANGE] = -{ - 0,0,1,1,2,3,3,4,4,5,6,6,7,8,8,9, - 9,10,11,11,12,13,13,14,15,15,16,17,17,18,19,20, - 20,21,22,22,23,24,24,25,26,27,27,28,29,30,30,31, - 32,33,33,34,35,36,36,37,38,39,39,40,41,42,42,43, - 44,45,46,46,47,48,49,50,50,51,52,53,54,55,55,56, - 57,58,59,60,60,61,62,63,64,65,66,67,67,68,69,70, - 71,72,73,74,75,75,76,77,78,79,80,81,82,83,84,85, - 86,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100 -}; - -#ifdef PACKET_TESTING -extern FILE *vpxlogc; -#endif - -static void save_layer_context(VP8_COMP *cpi) -{ - LAYER_CONTEXT *lc = &cpi->layer_context[cpi->current_layer]; - - /* Save layer dependent coding state */ - lc->target_bandwidth = cpi->target_bandwidth; - lc->starting_buffer_level = cpi->oxcf.starting_buffer_level; - lc->optimal_buffer_level = cpi->oxcf.optimal_buffer_level; - lc->maximum_buffer_size = cpi->oxcf.maximum_buffer_size; - lc->starting_buffer_level_in_ms = cpi->oxcf.starting_buffer_level_in_ms; - lc->optimal_buffer_level_in_ms = cpi->oxcf.optimal_buffer_level_in_ms; - lc->maximum_buffer_size_in_ms = cpi->oxcf.maximum_buffer_size_in_ms; - lc->buffer_level = cpi->buffer_level; - lc->bits_off_target = cpi->bits_off_target; - lc->total_actual_bits = cpi->total_actual_bits; - lc->worst_quality = cpi->worst_quality; - lc->active_worst_quality = cpi->active_worst_quality; - lc->best_quality = cpi->best_quality; - lc->active_best_quality = cpi->active_best_quality; - lc->ni_av_qi = cpi->ni_av_qi; - lc->ni_tot_qi = cpi->ni_tot_qi; - lc->ni_frames = cpi->ni_frames; - lc->avg_frame_qindex = cpi->avg_frame_qindex; - lc->rate_correction_factor = cpi->rate_correction_factor; - lc->key_frame_rate_correction_factor = cpi->key_frame_rate_correction_factor; - lc->gf_rate_correction_factor = cpi->gf_rate_correction_factor; - lc->zbin_over_quant = cpi->mb.zbin_over_quant; - lc->inter_frame_target = cpi->inter_frame_target; - lc->total_byte_count = cpi->total_byte_count; - lc->filter_level = cpi->common.filter_level; - - lc->last_frame_percent_intra = cpi->last_frame_percent_intra; - - memcpy (lc->count_mb_ref_frame_usage, - cpi->mb.count_mb_ref_frame_usage, - sizeof(cpi->mb.count_mb_ref_frame_usage)); -} - -static void restore_layer_context(VP8_COMP *cpi, const int layer) -{ - LAYER_CONTEXT *lc = &cpi->layer_context[layer]; - - /* Restore layer dependent coding state */ - cpi->current_layer = layer; - cpi->target_bandwidth = lc->target_bandwidth; - cpi->oxcf.target_bandwidth = lc->target_bandwidth; - cpi->oxcf.starting_buffer_level = lc->starting_buffer_level; - cpi->oxcf.optimal_buffer_level = lc->optimal_buffer_level; - cpi->oxcf.maximum_buffer_size = lc->maximum_buffer_size; - cpi->oxcf.starting_buffer_level_in_ms = lc->starting_buffer_level_in_ms; - cpi->oxcf.optimal_buffer_level_in_ms = lc->optimal_buffer_level_in_ms; - cpi->oxcf.maximum_buffer_size_in_ms = lc->maximum_buffer_size_in_ms; - cpi->buffer_level = lc->buffer_level; - cpi->bits_off_target = lc->bits_off_target; - cpi->total_actual_bits = lc->total_actual_bits; - cpi->active_worst_quality = lc->active_worst_quality; - cpi->active_best_quality = lc->active_best_quality; - cpi->ni_av_qi = lc->ni_av_qi; - cpi->ni_tot_qi = lc->ni_tot_qi; - cpi->ni_frames = lc->ni_frames; - cpi->avg_frame_qindex = lc->avg_frame_qindex; - cpi->rate_correction_factor = lc->rate_correction_factor; - cpi->key_frame_rate_correction_factor = lc->key_frame_rate_correction_factor; - cpi->gf_rate_correction_factor = lc->gf_rate_correction_factor; - cpi->mb.zbin_over_quant = lc->zbin_over_quant; - cpi->inter_frame_target = lc->inter_frame_target; - cpi->total_byte_count = lc->total_byte_count; - cpi->common.filter_level = lc->filter_level; - - cpi->last_frame_percent_intra = lc->last_frame_percent_intra; - - memcpy (cpi->mb.count_mb_ref_frame_usage, - lc->count_mb_ref_frame_usage, - sizeof(cpi->mb.count_mb_ref_frame_usage)); -} - -static int rescale(int val, int num, int denom) -{ - int64_t llnum = num; - int64_t llden = denom; - int64_t llval = val; - - return (int)(llval * llnum / llden); -} - -static void init_temporal_layer_context(VP8_COMP *cpi, - VP8_CONFIG *oxcf, - const int layer, - double prev_layer_framerate) -{ - LAYER_CONTEXT *lc = &cpi->layer_context[layer]; - - lc->framerate = cpi->output_framerate / cpi->oxcf.rate_decimator[layer]; - lc->target_bandwidth = cpi->oxcf.target_bitrate[layer] * 1000; - - lc->starting_buffer_level_in_ms = oxcf->starting_buffer_level; - lc->optimal_buffer_level_in_ms = oxcf->optimal_buffer_level; - lc->maximum_buffer_size_in_ms = oxcf->maximum_buffer_size; - - lc->starting_buffer_level = - rescale((int)(oxcf->starting_buffer_level), - lc->target_bandwidth, 1000); - - if (oxcf->optimal_buffer_level == 0) - lc->optimal_buffer_level = lc->target_bandwidth / 8; - else - lc->optimal_buffer_level = - rescale((int)(oxcf->optimal_buffer_level), - lc->target_bandwidth, 1000); - - if (oxcf->maximum_buffer_size == 0) - lc->maximum_buffer_size = lc->target_bandwidth / 8; - else - lc->maximum_buffer_size = - rescale((int)(oxcf->maximum_buffer_size), - lc->target_bandwidth, 1000); - - /* Work out the average size of a frame within this layer */ - if (layer > 0) - lc->avg_frame_size_for_layer = - (int)((cpi->oxcf.target_bitrate[layer] - - cpi->oxcf.target_bitrate[layer-1]) * 1000 / - (lc->framerate - prev_layer_framerate)); - - lc->active_worst_quality = cpi->oxcf.worst_allowed_q; - lc->active_best_quality = cpi->oxcf.best_allowed_q; - lc->avg_frame_qindex = cpi->oxcf.worst_allowed_q; - - lc->buffer_level = lc->starting_buffer_level; - lc->bits_off_target = lc->starting_buffer_level; - - lc->total_actual_bits = 0; - lc->ni_av_qi = 0; - lc->ni_tot_qi = 0; - lc->ni_frames = 0; - lc->rate_correction_factor = 1.0; - lc->key_frame_rate_correction_factor = 1.0; - lc->gf_rate_correction_factor = 1.0; - lc->inter_frame_target = 0; -} - -// Upon a run-time change in temporal layers, reset the layer context parameters -// for any "new" layers. For "existing" layers, let them inherit the parameters -// from the previous layer state (at the same layer #). In future we may want -// to better map the previous layer state(s) to the "new" ones. -static void reset_temporal_layer_change(VP8_COMP *cpi, - VP8_CONFIG *oxcf, - const int prev_num_layers) -{ - int i; - double prev_layer_framerate = 0; - const int curr_num_layers = cpi->oxcf.number_of_layers; - // If the previous state was 1 layer, get current layer context from cpi. - // We need this to set the layer context for the new layers below. - if (prev_num_layers == 1) - { - cpi->current_layer = 0; - save_layer_context(cpi); - } - for (i = 0; i < curr_num_layers; i++) - { - LAYER_CONTEXT *lc = &cpi->layer_context[i]; - if (i >= prev_num_layers) - { - init_temporal_layer_context(cpi, oxcf, i, prev_layer_framerate); - } - // The initial buffer levels are set based on their starting levels. - // We could set the buffer levels based on the previous state (normalized - // properly by the layer bandwidths) but we would need to keep track of - // the previous set of layer bandwidths (i.e., target_bitrate[i]) - // before the layer change. For now, reset to the starting levels. - lc->buffer_level = cpi->oxcf.starting_buffer_level_in_ms * - cpi->oxcf.target_bitrate[i]; - lc->bits_off_target = lc->buffer_level; - // TDOD(marpan): Should we set the rate_correction_factor and - // active_worst/best_quality to values derived from the previous layer - // state (to smooth-out quality dips/rate fluctuation at transition)? - - // We need to treat the 1 layer case separately: oxcf.target_bitrate[i] - // is not set for 1 layer, and the restore_layer_context/save_context() - // are not called in the encoding loop, so we need to call it here to - // pass the layer context state to |cpi|. - if (curr_num_layers == 1) - { - lc->target_bandwidth = cpi->oxcf.target_bandwidth; - lc->buffer_level = cpi->oxcf.starting_buffer_level_in_ms * - lc->target_bandwidth / 1000; - lc->bits_off_target = lc->buffer_level; - restore_layer_context(cpi, 0); - } - prev_layer_framerate = cpi->output_framerate / - cpi->oxcf.rate_decimator[i]; - } -} - -static void setup_features(VP8_COMP *cpi) -{ - // If segmentation enabled set the update flags - if ( cpi->mb.e_mbd.segmentation_enabled ) - { - cpi->mb.e_mbd.update_mb_segmentation_map = 1; - cpi->mb.e_mbd.update_mb_segmentation_data = 1; - } - else - { - cpi->mb.e_mbd.update_mb_segmentation_map = 0; - cpi->mb.e_mbd.update_mb_segmentation_data = 0; - } - - cpi->mb.e_mbd.mode_ref_lf_delta_enabled = 0; - cpi->mb.e_mbd.mode_ref_lf_delta_update = 0; - vpx_memset(cpi->mb.e_mbd.ref_lf_deltas, 0, sizeof(cpi->mb.e_mbd.ref_lf_deltas)); - vpx_memset(cpi->mb.e_mbd.mode_lf_deltas, 0, sizeof(cpi->mb.e_mbd.mode_lf_deltas)); - vpx_memset(cpi->mb.e_mbd.last_ref_lf_deltas, 0, sizeof(cpi->mb.e_mbd.ref_lf_deltas)); - vpx_memset(cpi->mb.e_mbd.last_mode_lf_deltas, 0, sizeof(cpi->mb.e_mbd.mode_lf_deltas)); - - set_default_lf_deltas(cpi); - -} - - -static void dealloc_raw_frame_buffers(VP8_COMP *cpi); - - -static void dealloc_compressor_data(VP8_COMP *cpi) -{ - vpx_free(cpi->tplist); - cpi->tplist = NULL; - - /* Delete last frame MV storage buffers */ - vpx_free(cpi->lfmv); - cpi->lfmv = 0; - - vpx_free(cpi->lf_ref_frame_sign_bias); - cpi->lf_ref_frame_sign_bias = 0; - - vpx_free(cpi->lf_ref_frame); - cpi->lf_ref_frame = 0; - - /* Delete sementation map */ - vpx_free(cpi->segmentation_map); - cpi->segmentation_map = 0; - - vpx_free(cpi->active_map); - cpi->active_map = 0; - - vp8_de_alloc_frame_buffers(&cpi->common); - - vp8_yv12_de_alloc_frame_buffer(&cpi->pick_lf_lvl_frame); - vp8_yv12_de_alloc_frame_buffer(&cpi->scaled_source); - dealloc_raw_frame_buffers(cpi); - - vpx_free(cpi->tok); - cpi->tok = 0; - - /* Structure used to monitor GF usage */ - vpx_free(cpi->gf_active_flags); - cpi->gf_active_flags = 0; - - /* Activity mask based per mb zbin adjustments */ - vpx_free(cpi->mb_activity_map); - cpi->mb_activity_map = 0; - - vpx_free(cpi->mb.pip); - cpi->mb.pip = 0; - -#if CONFIG_MULTITHREAD - vpx_free(cpi->mt_current_mb_col); - cpi->mt_current_mb_col = NULL; -#endif -} - -static void enable_segmentation(VP8_COMP *cpi) -{ - /* Set the appropriate feature bit */ - cpi->mb.e_mbd.segmentation_enabled = 1; - cpi->mb.e_mbd.update_mb_segmentation_map = 1; - cpi->mb.e_mbd.update_mb_segmentation_data = 1; -} -static void disable_segmentation(VP8_COMP *cpi) -{ - /* Clear the appropriate feature bit */ - cpi->mb.e_mbd.segmentation_enabled = 0; -} - -/* Valid values for a segment are 0 to 3 - * Segmentation map is arrange as [Rows][Columns] - */ -static void set_segmentation_map(VP8_COMP *cpi, unsigned char *segmentation_map) -{ - /* Copy in the new segmentation map */ - vpx_memcpy(cpi->segmentation_map, segmentation_map, (cpi->common.mb_rows * cpi->common.mb_cols)); - - /* Signal that the map should be updated. */ - cpi->mb.e_mbd.update_mb_segmentation_map = 1; - cpi->mb.e_mbd.update_mb_segmentation_data = 1; -} - -/* The values given for each segment can be either deltas (from the default - * value chosen for the frame) or absolute values. - * - * Valid range for abs values is: - * (0-127 for MB_LVL_ALT_Q), (0-63 for SEGMENT_ALT_LF) - * Valid range for delta values are: - * (+/-127 for MB_LVL_ALT_Q), (+/-63 for SEGMENT_ALT_LF) - * - * abs_delta = SEGMENT_DELTADATA (deltas) - * abs_delta = SEGMENT_ABSDATA (use the absolute values given). - * - */ -static void set_segment_data(VP8_COMP *cpi, signed char *feature_data, unsigned char abs_delta) -{ - cpi->mb.e_mbd.mb_segement_abs_delta = abs_delta; - vpx_memcpy(cpi->segment_feature_data, feature_data, sizeof(cpi->segment_feature_data)); -} - - -static void segmentation_test_function(VP8_COMP *cpi) -{ - unsigned char *seg_map; - signed char feature_data[MB_LVL_MAX][MAX_MB_SEGMENTS]; - - // Create a temporary map for segmentation data. - CHECK_MEM_ERROR(seg_map, vpx_calloc(cpi->common.mb_rows * cpi->common.mb_cols, 1)); - - // Set the segmentation Map - set_segmentation_map(cpi, seg_map); - - // Activate segmentation. - enable_segmentation(cpi); - - // Set up the quant segment data - feature_data[MB_LVL_ALT_Q][0] = 0; - feature_data[MB_LVL_ALT_Q][1] = 4; - feature_data[MB_LVL_ALT_Q][2] = 0; - feature_data[MB_LVL_ALT_Q][3] = 0; - // Set up the loop segment data - feature_data[MB_LVL_ALT_LF][0] = 0; - feature_data[MB_LVL_ALT_LF][1] = 0; - feature_data[MB_LVL_ALT_LF][2] = 0; - feature_data[MB_LVL_ALT_LF][3] = 0; - - // Initialise the feature data structure - // SEGMENT_DELTADATA 0, SEGMENT_ABSDATA 1 - set_segment_data(cpi, &feature_data[0][0], SEGMENT_DELTADATA); - - // Delete sementation map - vpx_free(seg_map); - - seg_map = 0; -} - -/* A simple function to cyclically refresh the background at a lower Q */ -static void cyclic_background_refresh(VP8_COMP *cpi, int Q, int lf_adjustment) -{ - unsigned char *seg_map = cpi->segmentation_map; - signed char feature_data[MB_LVL_MAX][MAX_MB_SEGMENTS]; - int i; - int block_count = cpi->cyclic_refresh_mode_max_mbs_perframe; - int mbs_in_frame = cpi->common.mb_rows * cpi->common.mb_cols; - - cpi->cyclic_refresh_q = Q / 2; - - if (cpi->oxcf.screen_content_mode) { - // Modify quality ramp-up based on Q. Above some Q level, increase the - // number of blocks to be refreshed, and reduce it below the thredhold. - // Turn-off under certain conditions (i.e., away from key frame, and if - // we are at good quality (low Q) and most of the blocks were skipped-encoded - // in previous frame. - if (Q >= 100) { - cpi->cyclic_refresh_mode_max_mbs_perframe = - (cpi->common.mb_rows * cpi->common.mb_cols) / 10; - } else if (cpi->frames_since_key > 250 && - Q < 20 && - cpi->mb.skip_true_count > (int)(0.95 * mbs_in_frame)) { - cpi->cyclic_refresh_mode_max_mbs_perframe = 0; - } else { - cpi->cyclic_refresh_mode_max_mbs_perframe = - (cpi->common.mb_rows * cpi->common.mb_cols) / 20; - } - block_count = cpi->cyclic_refresh_mode_max_mbs_perframe; - } - - // Set every macroblock to be eligible for update. - // For key frame this will reset seg map to 0. - vpx_memset(cpi->segmentation_map, 0, mbs_in_frame); - - if (cpi->common.frame_type != KEY_FRAME && block_count > 0) - { - /* Cycle through the macro_block rows */ - /* MB loop to set local segmentation map */ - i = cpi->cyclic_refresh_mode_index; - assert(i < mbs_in_frame); - do - { - /* If the MB is as a candidate for clean up then mark it for - * possible boost/refresh (segment 1) The segment id may get - * reset to 0 later if the MB gets coded anything other than - * last frame 0,0 as only (last frame 0,0) MBs are eligable for - * refresh : that is to say Mbs likely to be background blocks. - */ - if (cpi->cyclic_refresh_map[i] == 0) - { - seg_map[i] = 1; - block_count --; - } - else if (cpi->cyclic_refresh_map[i] < 0) - cpi->cyclic_refresh_map[i]++; - - i++; - if (i == mbs_in_frame) - i = 0; - - } - while(block_count && i != cpi->cyclic_refresh_mode_index); - - cpi->cyclic_refresh_mode_index = i; - -#if CONFIG_TEMPORAL_DENOISING - if (cpi->oxcf.noise_sensitivity > 0) { - if (cpi->denoiser.denoiser_mode == kDenoiserOnYUVAggressive && - Q < (int)cpi->denoiser.denoise_pars.qp_thresh && - (cpi->frames_since_key > - 2 * cpi->denoiser.denoise_pars.consec_zerolast)) { - // Under aggressive denoising, use segmentation to turn off loop - // filter below some qp thresh. The filter is reduced for all - // blocks that have been encoded as ZEROMV LAST x frames in a row, - // where x is set by cpi->denoiser.denoise_pars.consec_zerolast. - // This is to avoid "dot" artifacts that can occur from repeated - // loop filtering on noisy input source. - cpi->cyclic_refresh_q = Q; - // lf_adjustment = -MAX_LOOP_FILTER; - lf_adjustment = -40; - for (i = 0; i < mbs_in_frame; ++i) { - seg_map[i] = (cpi->consec_zero_last[i] > - cpi->denoiser.denoise_pars.consec_zerolast) ? 1 : 0; - } - } - } -#endif - } - - /* Activate segmentation. */ - cpi->mb.e_mbd.update_mb_segmentation_map = 1; - cpi->mb.e_mbd.update_mb_segmentation_data = 1; - enable_segmentation(cpi); - - /* Set up the quant segment data */ - feature_data[MB_LVL_ALT_Q][0] = 0; - feature_data[MB_LVL_ALT_Q][1] = (cpi->cyclic_refresh_q - Q); - feature_data[MB_LVL_ALT_Q][2] = 0; - feature_data[MB_LVL_ALT_Q][3] = 0; - - /* Set up the loop segment data */ - feature_data[MB_LVL_ALT_LF][0] = 0; - feature_data[MB_LVL_ALT_LF][1] = lf_adjustment; - feature_data[MB_LVL_ALT_LF][2] = 0; - feature_data[MB_LVL_ALT_LF][3] = 0; - - /* Initialise the feature data structure */ - set_segment_data(cpi, &feature_data[0][0], SEGMENT_DELTADATA); - -} - -static void set_default_lf_deltas(VP8_COMP *cpi) -{ - cpi->mb.e_mbd.mode_ref_lf_delta_enabled = 1; - cpi->mb.e_mbd.mode_ref_lf_delta_update = 1; - - vpx_memset(cpi->mb.e_mbd.ref_lf_deltas, 0, sizeof(cpi->mb.e_mbd.ref_lf_deltas)); - vpx_memset(cpi->mb.e_mbd.mode_lf_deltas, 0, sizeof(cpi->mb.e_mbd.mode_lf_deltas)); - - /* Test of ref frame deltas */ - cpi->mb.e_mbd.ref_lf_deltas[INTRA_FRAME] = 2; - cpi->mb.e_mbd.ref_lf_deltas[LAST_FRAME] = 0; - cpi->mb.e_mbd.ref_lf_deltas[GOLDEN_FRAME] = -2; - cpi->mb.e_mbd.ref_lf_deltas[ALTREF_FRAME] = -2; - - cpi->mb.e_mbd.mode_lf_deltas[0] = 4; /* BPRED */ - - if(cpi->oxcf.Mode == MODE_REALTIME) - cpi->mb.e_mbd.mode_lf_deltas[1] = -12; /* Zero */ - else - cpi->mb.e_mbd.mode_lf_deltas[1] = -2; /* Zero */ - - cpi->mb.e_mbd.mode_lf_deltas[2] = 2; /* New mv */ - cpi->mb.e_mbd.mode_lf_deltas[3] = 4; /* Split mv */ -} - -/* Convenience macros for mapping speed and mode into a continuous - * range - */ -#define GOOD(x) (x+1) -#define RT(x) (x+7) - -static int speed_map(int speed, const int *map) -{ - int res; - - do - { - res = *map++; - } while(speed >= *map++); - return res; -} - -static const int thresh_mult_map_znn[] = { - /* map common to zero, nearest, and near */ - 0, GOOD(2), 1500, GOOD(3), 2000, RT(0), 1000, RT(2), 2000, INT_MAX -}; - -static const int thresh_mult_map_vhpred[] = { - 1000, GOOD(2), 1500, GOOD(3), 2000, RT(0), 1000, RT(1), 2000, - RT(7), INT_MAX, INT_MAX -}; - -static const int thresh_mult_map_bpred[] = { - 2000, GOOD(0), 2500, GOOD(2), 5000, GOOD(3), 7500, RT(0), 2500, RT(1), 5000, - RT(6), INT_MAX, INT_MAX -}; - -static const int thresh_mult_map_tm[] = { - 1000, GOOD(2), 1500, GOOD(3), 2000, RT(0), 0, RT(1), 1000, RT(2), 2000, - RT(7), INT_MAX, INT_MAX -}; - -static const int thresh_mult_map_new1[] = { - 1000, GOOD(2), 2000, RT(0), 2000, INT_MAX -}; - -static const int thresh_mult_map_new2[] = { - 1000, GOOD(2), 2000, GOOD(3), 2500, GOOD(5), 4000, RT(0), 2000, RT(2), 2500, - RT(5), 4000, INT_MAX -}; - -static const int thresh_mult_map_split1[] = { - 2500, GOOD(0), 1700, GOOD(2), 10000, GOOD(3), 25000, GOOD(4), INT_MAX, - RT(0), 5000, RT(1), 10000, RT(2), 25000, RT(3), INT_MAX, INT_MAX -}; - -static const int thresh_mult_map_split2[] = { - 5000, GOOD(0), 4500, GOOD(2), 20000, GOOD(3), 50000, GOOD(4), INT_MAX, - RT(0), 10000, RT(1), 20000, RT(2), 50000, RT(3), INT_MAX, INT_MAX -}; - -static const int mode_check_freq_map_zn2[] = { - /* {zero,nearest}{2,3} */ - 0, RT(10), 1<<1, RT(11), 1<<2, RT(12), 1<<3, INT_MAX -}; - -static const int mode_check_freq_map_vhbpred[] = { - 0, GOOD(5), 2, RT(0), 0, RT(3), 2, RT(5), 4, INT_MAX -}; - -static const int mode_check_freq_map_near2[] = { - 0, GOOD(5), 2, RT(0), 0, RT(3), 2, RT(10), 1<<2, RT(11), 1<<3, RT(12), 1<<4, - INT_MAX -}; - -static const int mode_check_freq_map_new1[] = { - 0, RT(10), 1<<1, RT(11), 1<<2, RT(12), 1<<3, INT_MAX -}; - -static const int mode_check_freq_map_new2[] = { - 0, GOOD(5), 4, RT(0), 0, RT(3), 4, RT(10), 1<<3, RT(11), 1<<4, RT(12), 1<<5, - INT_MAX -}; - -static const int mode_check_freq_map_split1[] = { - 0, GOOD(2), 2, GOOD(3), 7, RT(1), 2, RT(2), 7, INT_MAX -}; - -static const int mode_check_freq_map_split2[] = { - 0, GOOD(1), 2, GOOD(2), 4, GOOD(3), 15, RT(1), 4, RT(2), 15, INT_MAX -}; - -void vp8_set_speed_features(VP8_COMP *cpi) -{ - SPEED_FEATURES *sf = &cpi->sf; - int Mode = cpi->compressor_speed; - int Speed = cpi->Speed; - int i; - VP8_COMMON *cm = &cpi->common; - int last_improved_quant = sf->improved_quant; - int ref_frames; - - /* Initialise default mode frequency sampling variables */ - for (i = 0; i < MAX_MODES; i ++) - { - cpi->mode_check_freq[i] = 0; - } - - cpi->mb.mbs_tested_so_far = 0; - cpi->mb.mbs_zero_last_dot_suppress = 0; - - /* best quality defaults */ - sf->RD = 1; - sf->search_method = NSTEP; - sf->improved_quant = 1; - sf->improved_dct = 1; - sf->auto_filter = 1; - sf->recode_loop = 1; - sf->quarter_pixel_search = 1; - sf->half_pixel_search = 1; - sf->iterative_sub_pixel = 1; - sf->optimize_coefficients = 1; - sf->use_fastquant_for_pick = 0; - sf->no_skip_block4x4_search = 1; - - sf->first_step = 0; - sf->max_step_search_steps = MAX_MVSEARCH_STEPS; - sf->improved_mv_pred = 1; - - /* default thresholds to 0 */ - for (i = 0; i < MAX_MODES; i++) - sf->thresh_mult[i] = 0; - - /* Count enabled references */ - ref_frames = 1; - if (cpi->ref_frame_flags & VP8_LAST_FRAME) - ref_frames++; - if (cpi->ref_frame_flags & VP8_GOLD_FRAME) - ref_frames++; - if (cpi->ref_frame_flags & VP8_ALTR_FRAME) - ref_frames++; - - /* Convert speed to continuous range, with clamping */ - if (Mode == 0) - Speed = 0; - else if (Mode == 2) - Speed = RT(Speed); - else - { - if (Speed > 5) - Speed = 5; - Speed = GOOD(Speed); - } - - sf->thresh_mult[THR_ZERO1] = - sf->thresh_mult[THR_NEAREST1] = - sf->thresh_mult[THR_NEAR1] = - sf->thresh_mult[THR_DC] = 0; /* always */ - - sf->thresh_mult[THR_ZERO2] = - sf->thresh_mult[THR_ZERO3] = - sf->thresh_mult[THR_NEAREST2] = - sf->thresh_mult[THR_NEAREST3] = - sf->thresh_mult[THR_NEAR2] = - sf->thresh_mult[THR_NEAR3] = speed_map(Speed, thresh_mult_map_znn); - - sf->thresh_mult[THR_V_PRED] = - sf->thresh_mult[THR_H_PRED] = speed_map(Speed, thresh_mult_map_vhpred); - sf->thresh_mult[THR_B_PRED] = speed_map(Speed, thresh_mult_map_bpred); - sf->thresh_mult[THR_TM] = speed_map(Speed, thresh_mult_map_tm); - sf->thresh_mult[THR_NEW1] = speed_map(Speed, thresh_mult_map_new1); - sf->thresh_mult[THR_NEW2] = - sf->thresh_mult[THR_NEW3] = speed_map(Speed, thresh_mult_map_new2); - sf->thresh_mult[THR_SPLIT1] = speed_map(Speed, thresh_mult_map_split1); - sf->thresh_mult[THR_SPLIT2] = - sf->thresh_mult[THR_SPLIT3] = speed_map(Speed, thresh_mult_map_split2); - - // Special case for temporal layers. - // Reduce the thresholds for zero/nearest/near for GOLDEN, if GOLDEN is - // used as second reference. We don't modify thresholds for ALTREF case - // since ALTREF is usually used as long-term reference in temporal layers. - if ((cpi->Speed <= 6) && - (cpi->oxcf.number_of_layers > 1) && - (cpi->ref_frame_flags & VP8_LAST_FRAME) && - (cpi->ref_frame_flags & VP8_GOLD_FRAME)) { - if (cpi->closest_reference_frame == GOLDEN_FRAME) { - sf->thresh_mult[THR_ZERO2] = sf->thresh_mult[THR_ZERO2] >> 3; - sf->thresh_mult[THR_NEAREST2] = sf->thresh_mult[THR_NEAREST2] >> 3; - sf->thresh_mult[THR_NEAR2] = sf->thresh_mult[THR_NEAR2] >> 3; - } else { - sf->thresh_mult[THR_ZERO2] = sf->thresh_mult[THR_ZERO2] >> 1; - sf->thresh_mult[THR_NEAREST2] = sf->thresh_mult[THR_NEAREST2] >> 1; - sf->thresh_mult[THR_NEAR2] = sf->thresh_mult[THR_NEAR2] >> 1; - } - } - - cpi->mode_check_freq[THR_ZERO1] = - cpi->mode_check_freq[THR_NEAREST1] = - cpi->mode_check_freq[THR_NEAR1] = - cpi->mode_check_freq[THR_TM] = - cpi->mode_check_freq[THR_DC] = 0; /* always */ - - cpi->mode_check_freq[THR_ZERO2] = - cpi->mode_check_freq[THR_ZERO3] = - cpi->mode_check_freq[THR_NEAREST2] = - cpi->mode_check_freq[THR_NEAREST3] = speed_map(Speed, - mode_check_freq_map_zn2); - - cpi->mode_check_freq[THR_NEAR2] = - cpi->mode_check_freq[THR_NEAR3] = speed_map(Speed, - mode_check_freq_map_near2); - - cpi->mode_check_freq[THR_V_PRED] = - cpi->mode_check_freq[THR_H_PRED] = - cpi->mode_check_freq[THR_B_PRED] = speed_map(Speed, - mode_check_freq_map_vhbpred); - cpi->mode_check_freq[THR_NEW1] = speed_map(Speed, - mode_check_freq_map_new1); - cpi->mode_check_freq[THR_NEW2] = - cpi->mode_check_freq[THR_NEW3] = speed_map(Speed, - mode_check_freq_map_new2); - cpi->mode_check_freq[THR_SPLIT1] = speed_map(Speed, - mode_check_freq_map_split1); - cpi->mode_check_freq[THR_SPLIT2] = - cpi->mode_check_freq[THR_SPLIT3] = speed_map(Speed, - mode_check_freq_map_split2); - Speed = cpi->Speed; - switch (Mode) - { -#if !(CONFIG_REALTIME_ONLY) - case 0: /* best quality mode */ - sf->first_step = 0; - sf->max_step_search_steps = MAX_MVSEARCH_STEPS; - break; - case 1: - case 3: - if (Speed > 0) - { - /* Disable coefficient optimization above speed 0 */ - sf->optimize_coefficients = 0; - sf->use_fastquant_for_pick = 1; - sf->no_skip_block4x4_search = 0; - - sf->first_step = 1; - } - - if (Speed > 2) - { - sf->improved_quant = 0; - sf->improved_dct = 0; - - /* Only do recode loop on key frames, golden frames and - * alt ref frames - */ - sf->recode_loop = 2; - - } - - if (Speed > 3) - { - sf->auto_filter = 1; - sf->recode_loop = 0; /* recode loop off */ - sf->RD = 0; /* Turn rd off */ - - } - - if (Speed > 4) - { - sf->auto_filter = 0; /* Faster selection of loop filter */ - } - - break; -#endif - case 2: - sf->optimize_coefficients = 0; - sf->recode_loop = 0; - sf->auto_filter = 1; - sf->iterative_sub_pixel = 1; - sf->search_method = NSTEP; - - if (Speed > 0) - { - sf->improved_quant = 0; - sf->improved_dct = 0; - - sf->use_fastquant_for_pick = 1; - sf->no_skip_block4x4_search = 0; - sf->first_step = 1; - } - - if (Speed > 2) - sf->auto_filter = 0; /* Faster selection of loop filter */ - - if (Speed > 3) - { - sf->RD = 0; - sf->auto_filter = 1; - } - - if (Speed > 4) - { - sf->auto_filter = 0; /* Faster selection of loop filter */ - sf->search_method = HEX; - sf->iterative_sub_pixel = 0; - } - - if (Speed > 6) - { - unsigned int sum = 0; - unsigned int total_mbs = cm->MBs; - int thresh; - unsigned int total_skip; - - int min = 2000; - - if (cpi->oxcf.encode_breakout > 2000) - min = cpi->oxcf.encode_breakout; - - min >>= 7; - - for (i = 0; i < min; i++) - { - sum += cpi->mb.error_bins[i]; - } - - total_skip = sum; - sum = 0; - - /* i starts from 2 to make sure thresh started from 2048 */ - for (; i < 1024; i++) - { - sum += cpi->mb.error_bins[i]; - - if (10 * sum >= (unsigned int)(cpi->Speed - 6)*(total_mbs - total_skip)) - break; - } - - i--; - thresh = (i << 7); - - if (thresh < 2000) - thresh = 2000; - - if (ref_frames > 1) - { - sf->thresh_mult[THR_NEW1 ] = thresh; - sf->thresh_mult[THR_NEAREST1 ] = thresh >> 1; - sf->thresh_mult[THR_NEAR1 ] = thresh >> 1; - } - - if (ref_frames > 2) - { - sf->thresh_mult[THR_NEW2] = thresh << 1; - sf->thresh_mult[THR_NEAREST2 ] = thresh; - sf->thresh_mult[THR_NEAR2 ] = thresh; - } - - if (ref_frames > 3) - { - sf->thresh_mult[THR_NEW3] = thresh << 1; - sf->thresh_mult[THR_NEAREST3 ] = thresh; - sf->thresh_mult[THR_NEAR3 ] = thresh; - } - - sf->improved_mv_pred = 0; - } - - if (Speed > 8) - sf->quarter_pixel_search = 0; - - if(cm->version == 0) - { - cm->filter_type = NORMAL_LOOPFILTER; - - if (Speed >= 14) - cm->filter_type = SIMPLE_LOOPFILTER; - } - else - { - cm->filter_type = SIMPLE_LOOPFILTER; - } - - /* This has a big hit on quality. Last resort */ - if (Speed >= 15) - sf->half_pixel_search = 0; - - vpx_memset(cpi->mb.error_bins, 0, sizeof(cpi->mb.error_bins)); - - }; /* switch */ - - /* Slow quant, dct and trellis not worthwhile for first pass - * so make sure they are always turned off. - */ - if ( cpi->pass == 1 ) - { - sf->improved_quant = 0; - sf->optimize_coefficients = 0; - sf->improved_dct = 0; - } - - if (cpi->sf.search_method == NSTEP) - { - vp8_init3smotion_compensation(&cpi->mb, cm->yv12_fb[cm->lst_fb_idx].y_stride); - } - else if (cpi->sf.search_method == DIAMOND) - { - vp8_init_dsmotion_compensation(&cpi->mb, cm->yv12_fb[cm->lst_fb_idx].y_stride); - } - - if (cpi->sf.improved_dct) - { - cpi->mb.short_fdct8x4 = vp8_short_fdct8x4; - cpi->mb.short_fdct4x4 = vp8_short_fdct4x4; - } - else - { - /* No fast FDCT defined for any platform at this time. */ - cpi->mb.short_fdct8x4 = vp8_short_fdct8x4; - cpi->mb.short_fdct4x4 = vp8_short_fdct4x4; - } - - cpi->mb.short_walsh4x4 = vp8_short_walsh4x4; - - if (cpi->sf.improved_quant) - { - cpi->mb.quantize_b = vp8_regular_quantize_b; - } - else - { - cpi->mb.quantize_b = vp8_fast_quantize_b; - } - if (cpi->sf.improved_quant != last_improved_quant) - vp8cx_init_quantizer(cpi); - - if (cpi->sf.iterative_sub_pixel == 1) - { - cpi->find_fractional_mv_step = vp8_find_best_sub_pixel_step_iteratively; - } - else if (cpi->sf.quarter_pixel_search) - { - cpi->find_fractional_mv_step = vp8_find_best_sub_pixel_step; - } - else if (cpi->sf.half_pixel_search) - { - cpi->find_fractional_mv_step = vp8_find_best_half_pixel_step; - } - else - { - cpi->find_fractional_mv_step = vp8_skip_fractional_mv_step; - } - - if (cpi->sf.optimize_coefficients == 1 && cpi->pass!=1) - cpi->mb.optimize = 1; - else - cpi->mb.optimize = 0; - - if (cpi->common.full_pixel) - cpi->find_fractional_mv_step = vp8_skip_fractional_mv_step; - -#ifdef SPEEDSTATS - frames_at_speed[cpi->Speed]++; -#endif -} -#undef GOOD -#undef RT - -static void alloc_raw_frame_buffers(VP8_COMP *cpi) -{ -#if VP8_TEMPORAL_ALT_REF - int width = (cpi->oxcf.Width + 15) & ~15; - int height = (cpi->oxcf.Height + 15) & ~15; -#endif - - cpi->lookahead = vp8_lookahead_init(cpi->oxcf.Width, cpi->oxcf.Height, - cpi->oxcf.lag_in_frames); - if(!cpi->lookahead) - vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR, - "Failed to allocate lag buffers"); - -#if VP8_TEMPORAL_ALT_REF - - if (vp8_yv12_alloc_frame_buffer(&cpi->alt_ref_buffer, - width, height, VP8BORDERINPIXELS)) - vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR, - "Failed to allocate altref buffer"); - -#endif -} - - -static void dealloc_raw_frame_buffers(VP8_COMP *cpi) -{ -#if VP8_TEMPORAL_ALT_REF - vp8_yv12_de_alloc_frame_buffer(&cpi->alt_ref_buffer); -#endif - vp8_lookahead_destroy(cpi->lookahead); -} - - -static int vp8_alloc_partition_data(VP8_COMP *cpi) -{ - vpx_free(cpi->mb.pip); - - cpi->mb.pip = vpx_calloc((cpi->common.mb_cols + 1) * - (cpi->common.mb_rows + 1), - sizeof(PARTITION_INFO)); - if(!cpi->mb.pip) - return 1; - - cpi->mb.pi = cpi->mb.pip + cpi->common.mode_info_stride + 1; - - return 0; -} - -void vp8_alloc_compressor_data(VP8_COMP *cpi) -{ - VP8_COMMON *cm = & cpi->common; - - int width = cm->Width; - int height = cm->Height; - - if (vp8_alloc_frame_buffers(cm, width, height)) - vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR, - "Failed to allocate frame buffers"); - - if (vp8_alloc_partition_data(cpi)) - vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR, - "Failed to allocate partition data"); - - - if ((width & 0xf) != 0) - width += 16 - (width & 0xf); - - if ((height & 0xf) != 0) - height += 16 - (height & 0xf); - - - if (vp8_yv12_alloc_frame_buffer(&cpi->pick_lf_lvl_frame, - width, height, VP8BORDERINPIXELS)) - vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR, - "Failed to allocate last frame buffer"); - - if (vp8_yv12_alloc_frame_buffer(&cpi->scaled_source, - width, height, VP8BORDERINPIXELS)) - vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR, - "Failed to allocate scaled source buffer"); - - vpx_free(cpi->tok); - - { -#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING - unsigned int tokens = 8 * 24 * 16; /* one MB for each thread */ -#else - unsigned int tokens = cm->mb_rows * cm->mb_cols * 24 * 16; -#endif - CHECK_MEM_ERROR(cpi->tok, vpx_calloc(tokens, sizeof(*cpi->tok))); - } - - /* Data used for real time vc mode to see if gf needs refreshing */ - cpi->zeromv_count = 0; - - - /* Structures used to monitor GF usage */ - vpx_free(cpi->gf_active_flags); - CHECK_MEM_ERROR(cpi->gf_active_flags, - vpx_calloc(sizeof(*cpi->gf_active_flags), - cm->mb_rows * cm->mb_cols)); - cpi->gf_active_count = cm->mb_rows * cm->mb_cols; - - vpx_free(cpi->mb_activity_map); - CHECK_MEM_ERROR(cpi->mb_activity_map, - vpx_calloc(sizeof(*cpi->mb_activity_map), - cm->mb_rows * cm->mb_cols)); - - /* allocate memory for storing last frame's MVs for MV prediction. */ - vpx_free(cpi->lfmv); - CHECK_MEM_ERROR(cpi->lfmv, vpx_calloc((cm->mb_rows+2) * (cm->mb_cols+2), - sizeof(*cpi->lfmv))); - vpx_free(cpi->lf_ref_frame_sign_bias); - CHECK_MEM_ERROR(cpi->lf_ref_frame_sign_bias, - vpx_calloc((cm->mb_rows+2) * (cm->mb_cols+2), - sizeof(*cpi->lf_ref_frame_sign_bias))); - vpx_free(cpi->lf_ref_frame); - CHECK_MEM_ERROR(cpi->lf_ref_frame, - vpx_calloc((cm->mb_rows+2) * (cm->mb_cols+2), - sizeof(*cpi->lf_ref_frame))); - - /* Create the encoder segmentation map and set all entries to 0 */ - vpx_free(cpi->segmentation_map); - CHECK_MEM_ERROR(cpi->segmentation_map, - vpx_calloc(cm->mb_rows * cm->mb_cols, - sizeof(*cpi->segmentation_map))); - cpi->cyclic_refresh_mode_index = 0; - vpx_free(cpi->active_map); - CHECK_MEM_ERROR(cpi->active_map, - vpx_calloc(cm->mb_rows * cm->mb_cols, - sizeof(*cpi->active_map))); - vpx_memset(cpi->active_map , 1, (cm->mb_rows * cm->mb_cols)); - -#if CONFIG_MULTITHREAD - if (width < 640) - cpi->mt_sync_range = 1; - else if (width <= 1280) - cpi->mt_sync_range = 4; - else if (width <= 2560) - cpi->mt_sync_range = 8; - else - cpi->mt_sync_range = 16; - - if (cpi->oxcf.multi_threaded > 1) - { - vpx_free(cpi->mt_current_mb_col); - CHECK_MEM_ERROR(cpi->mt_current_mb_col, - vpx_malloc(sizeof(*cpi->mt_current_mb_col) * cm->mb_rows)); - } - -#endif - - vpx_free(cpi->tplist); - CHECK_MEM_ERROR(cpi->tplist, vpx_malloc(sizeof(TOKENLIST) * cm->mb_rows)); - -#if CONFIG_TEMPORAL_DENOISING - if (cpi->oxcf.noise_sensitivity > 0) { - vp8_denoiser_free(&cpi->denoiser); - vp8_denoiser_allocate(&cpi->denoiser, width, height, - cm->mb_rows, cm->mb_cols, - cpi->oxcf.noise_sensitivity); - } -#endif -} - - -/* Quant MOD */ -static const int q_trans[] = -{ - 0, 1, 2, 3, 4, 5, 7, 8, - 9, 10, 12, 13, 15, 17, 18, 19, - 20, 21, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 33, 35, 37, 39, 41, - 43, 45, 47, 49, 51, 53, 55, 57, - 59, 61, 64, 67, 70, 73, 76, 79, - 82, 85, 88, 91, 94, 97, 100, 103, - 106, 109, 112, 115, 118, 121, 124, 127, -}; - -int vp8_reverse_trans(int x) -{ - int i; - - for (i = 0; i < 64; i++) - if (q_trans[i] >= x) - return i; - - return 63; -} -void vp8_new_framerate(VP8_COMP *cpi, double framerate) -{ - if(framerate < .1) - framerate = 30; - - cpi->framerate = framerate; - cpi->output_framerate = framerate; - cpi->per_frame_bandwidth = (int)(cpi->oxcf.target_bandwidth / - cpi->output_framerate); - cpi->av_per_frame_bandwidth = cpi->per_frame_bandwidth; - cpi->min_frame_bandwidth = (int)(cpi->av_per_frame_bandwidth * - cpi->oxcf.two_pass_vbrmin_section / 100); - - /* Set Maximum gf/arf interval */ - cpi->max_gf_interval = ((int)(cpi->output_framerate / 2.0) + 2); - - if(cpi->max_gf_interval < 12) - cpi->max_gf_interval = 12; - - /* Extended interval for genuinely static scenes */ - cpi->twopass.static_scene_max_gf_interval = cpi->key_frame_frequency >> 1; - - /* Special conditions when altr ref frame enabled in lagged compress mode */ - if (cpi->oxcf.play_alternate && cpi->oxcf.lag_in_frames) - { - if (cpi->max_gf_interval > cpi->oxcf.lag_in_frames - 1) - cpi->max_gf_interval = cpi->oxcf.lag_in_frames - 1; - - if (cpi->twopass.static_scene_max_gf_interval > cpi->oxcf.lag_in_frames - 1) - cpi->twopass.static_scene_max_gf_interval = cpi->oxcf.lag_in_frames - 1; - } - - if ( cpi->max_gf_interval > cpi->twopass.static_scene_max_gf_interval ) - cpi->max_gf_interval = cpi->twopass.static_scene_max_gf_interval; -} - - -static void init_config(VP8_COMP *cpi, VP8_CONFIG *oxcf) -{ - VP8_COMMON *cm = &cpi->common; - - cpi->oxcf = *oxcf; - - cpi->auto_gold = 1; - cpi->auto_adjust_gold_quantizer = 1; - - cm->version = oxcf->Version; - vp8_setup_version(cm); - - /* Frame rate is not available on the first frame, as it's derived from - * the observed timestamps. The actual value used here doesn't matter - * too much, as it will adapt quickly. - */ - if (oxcf->timebase.num > 0) { - cpi->framerate = (double)(oxcf->timebase.den) / - (double)(oxcf->timebase.num); - } else { - cpi->framerate = 30; - } - - /* If the reciprocal of the timebase seems like a reasonable framerate, - * then use that as a guess, otherwise use 30. - */ - if (cpi->framerate > 180) - cpi->framerate = 30; - - cpi->ref_framerate = cpi->framerate; - - cpi->ref_frame_flags = VP8_ALTR_FRAME | VP8_GOLD_FRAME | VP8_LAST_FRAME; - - cm->refresh_golden_frame = 0; - cm->refresh_last_frame = 1; - cm->refresh_entropy_probs = 1; - - /* change includes all joint functionality */ - vp8_change_config(cpi, oxcf); - - /* Initialize active best and worst q and average q values. */ - cpi->active_worst_quality = cpi->oxcf.worst_allowed_q; - cpi->active_best_quality = cpi->oxcf.best_allowed_q; - cpi->avg_frame_qindex = cpi->oxcf.worst_allowed_q; - - /* Initialise the starting buffer levels */ - cpi->buffer_level = cpi->oxcf.starting_buffer_level; - cpi->bits_off_target = cpi->oxcf.starting_buffer_level; - - cpi->rolling_target_bits = cpi->av_per_frame_bandwidth; - cpi->rolling_actual_bits = cpi->av_per_frame_bandwidth; - cpi->long_rolling_target_bits = cpi->av_per_frame_bandwidth; - cpi->long_rolling_actual_bits = cpi->av_per_frame_bandwidth; - - cpi->total_actual_bits = 0; - cpi->total_target_vs_actual = 0; - - /* Temporal scalabilty */ - if (cpi->oxcf.number_of_layers > 1) - { - unsigned int i; - double prev_layer_framerate=0; - - for (i=0; ioxcf.number_of_layers; i++) - { - init_temporal_layer_context(cpi, oxcf, i, prev_layer_framerate); - prev_layer_framerate = cpi->output_framerate / - cpi->oxcf.rate_decimator[i]; - } - } - -#if VP8_TEMPORAL_ALT_REF - { - int i; - - cpi->fixed_divide[0] = 0; - - for (i = 1; i < 512; i++) - cpi->fixed_divide[i] = 0x80000 / i; - } -#endif -} - -static void update_layer_contexts (VP8_COMP *cpi) -{ - VP8_CONFIG *oxcf = &cpi->oxcf; - - /* Update snapshots of the layer contexts to reflect new parameters */ - if (oxcf->number_of_layers > 1) - { - unsigned int i; - double prev_layer_framerate=0; - - assert(oxcf->number_of_layers <= VPX_TS_MAX_LAYERS); - for (i = 0; i < oxcf->number_of_layers && i < VPX_TS_MAX_LAYERS; ++i) - { - LAYER_CONTEXT *lc = &cpi->layer_context[i]; - - lc->framerate = - cpi->ref_framerate / oxcf->rate_decimator[i]; - lc->target_bandwidth = oxcf->target_bitrate[i] * 1000; - - lc->starting_buffer_level = rescale( - (int)oxcf->starting_buffer_level_in_ms, - lc->target_bandwidth, 1000); - - if (oxcf->optimal_buffer_level == 0) - lc->optimal_buffer_level = lc->target_bandwidth / 8; - else - lc->optimal_buffer_level = rescale( - (int)oxcf->optimal_buffer_level_in_ms, - lc->target_bandwidth, 1000); - - if (oxcf->maximum_buffer_size == 0) - lc->maximum_buffer_size = lc->target_bandwidth / 8; - else - lc->maximum_buffer_size = rescale( - (int)oxcf->maximum_buffer_size_in_ms, - lc->target_bandwidth, 1000); - - /* Work out the average size of a frame within this layer */ - if (i > 0) - lc->avg_frame_size_for_layer = - (int)((oxcf->target_bitrate[i] - - oxcf->target_bitrate[i-1]) * 1000 / - (lc->framerate - prev_layer_framerate)); - - prev_layer_framerate = lc->framerate; - } - } -} - -void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf) -{ - VP8_COMMON *cm = &cpi->common; - int last_w, last_h, prev_number_of_layers; - - if (!cpi) - return; - - if (!oxcf) - return; - -#if CONFIG_MULTITHREAD - /* wait for the last picture loopfilter thread done */ - if (cpi->b_lpf_running) - { - sem_wait(&cpi->h_event_end_lpf); - cpi->b_lpf_running = 0; - } -#endif - - if (cm->version != oxcf->Version) - { - cm->version = oxcf->Version; - vp8_setup_version(cm); - } - - last_w = cpi->oxcf.Width; - last_h = cpi->oxcf.Height; - prev_number_of_layers = cpi->oxcf.number_of_layers; - - cpi->oxcf = *oxcf; - - switch (cpi->oxcf.Mode) - { - - case MODE_REALTIME: - cpi->pass = 0; - cpi->compressor_speed = 2; - - if (cpi->oxcf.cpu_used < -16) - { - cpi->oxcf.cpu_used = -16; - } - - if (cpi->oxcf.cpu_used > 16) - cpi->oxcf.cpu_used = 16; - - break; - - case MODE_GOODQUALITY: - cpi->pass = 0; - cpi->compressor_speed = 1; - - if (cpi->oxcf.cpu_used < -5) - { - cpi->oxcf.cpu_used = -5; - } - - if (cpi->oxcf.cpu_used > 5) - cpi->oxcf.cpu_used = 5; - - break; - - case MODE_BESTQUALITY: - cpi->pass = 0; - cpi->compressor_speed = 0; - break; - - case MODE_FIRSTPASS: - cpi->pass = 1; - cpi->compressor_speed = 1; - break; - case MODE_SECONDPASS: - cpi->pass = 2; - cpi->compressor_speed = 1; - - if (cpi->oxcf.cpu_used < -5) - { - cpi->oxcf.cpu_used = -5; - } - - if (cpi->oxcf.cpu_used > 5) - cpi->oxcf.cpu_used = 5; - - break; - case MODE_SECONDPASS_BEST: - cpi->pass = 2; - cpi->compressor_speed = 0; - break; - } - - if (cpi->pass == 0) - cpi->auto_worst_q = 1; - - cpi->oxcf.worst_allowed_q = q_trans[oxcf->worst_allowed_q]; - cpi->oxcf.best_allowed_q = q_trans[oxcf->best_allowed_q]; - cpi->oxcf.cq_level = q_trans[cpi->oxcf.cq_level]; - - if (oxcf->fixed_q >= 0) - { - if (oxcf->worst_allowed_q < 0) - cpi->oxcf.fixed_q = q_trans[0]; - else - cpi->oxcf.fixed_q = q_trans[oxcf->worst_allowed_q]; - - if (oxcf->alt_q < 0) - cpi->oxcf.alt_q = q_trans[0]; - else - cpi->oxcf.alt_q = q_trans[oxcf->alt_q]; - - if (oxcf->key_q < 0) - cpi->oxcf.key_q = q_trans[0]; - else - cpi->oxcf.key_q = q_trans[oxcf->key_q]; - - if (oxcf->gold_q < 0) - cpi->oxcf.gold_q = q_trans[0]; - else - cpi->oxcf.gold_q = q_trans[oxcf->gold_q]; - - } - - cpi->baseline_gf_interval = - cpi->oxcf.alt_freq ? cpi->oxcf.alt_freq : DEFAULT_GF_INTERVAL; - -#if (CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING) - cpi->oxcf.token_partitions = 3; -#endif - - if (cpi->oxcf.token_partitions >= 0 && cpi->oxcf.token_partitions <= 3) - cm->multi_token_partition = - (TOKEN_PARTITION) cpi->oxcf.token_partitions; - - setup_features(cpi); - - { - int i; - - for (i = 0; i < MAX_MB_SEGMENTS; i++) - cpi->segment_encode_breakout[i] = cpi->oxcf.encode_breakout; - } - - /* At the moment the first order values may not be > MAXQ */ - if (cpi->oxcf.fixed_q > MAXQ) - cpi->oxcf.fixed_q = MAXQ; - - /* local file playback mode == really big buffer */ - if (cpi->oxcf.end_usage == USAGE_LOCAL_FILE_PLAYBACK) - { - cpi->oxcf.starting_buffer_level = 60000; - cpi->oxcf.optimal_buffer_level = 60000; - cpi->oxcf.maximum_buffer_size = 240000; - cpi->oxcf.starting_buffer_level_in_ms = 60000; - cpi->oxcf.optimal_buffer_level_in_ms = 60000; - cpi->oxcf.maximum_buffer_size_in_ms = 240000; - } - - /* Convert target bandwidth from Kbit/s to Bit/s */ - cpi->oxcf.target_bandwidth *= 1000; - - cpi->oxcf.starting_buffer_level = - rescale((int)cpi->oxcf.starting_buffer_level, - cpi->oxcf.target_bandwidth, 1000); - - /* Set or reset optimal and maximum buffer levels. */ - if (cpi->oxcf.optimal_buffer_level == 0) - cpi->oxcf.optimal_buffer_level = cpi->oxcf.target_bandwidth / 8; - else - cpi->oxcf.optimal_buffer_level = - rescale((int)cpi->oxcf.optimal_buffer_level, - cpi->oxcf.target_bandwidth, 1000); - - if (cpi->oxcf.maximum_buffer_size == 0) - cpi->oxcf.maximum_buffer_size = cpi->oxcf.target_bandwidth / 8; - else - cpi->oxcf.maximum_buffer_size = - rescale((int)cpi->oxcf.maximum_buffer_size, - cpi->oxcf.target_bandwidth, 1000); - // Under a configuration change, where maximum_buffer_size may change, - // keep buffer level clipped to the maximum allowed buffer size. - if (cpi->bits_off_target > cpi->oxcf.maximum_buffer_size) { - cpi->bits_off_target = cpi->oxcf.maximum_buffer_size; - cpi->buffer_level = cpi->bits_off_target; - } - - /* Set up frame rate and related parameters rate control values. */ - vp8_new_framerate(cpi, cpi->framerate); - - /* Set absolute upper and lower quality limits */ - cpi->worst_quality = cpi->oxcf.worst_allowed_q; - cpi->best_quality = cpi->oxcf.best_allowed_q; - - /* active values should only be modified if out of new range */ - if (cpi->active_worst_quality > cpi->oxcf.worst_allowed_q) - { - cpi->active_worst_quality = cpi->oxcf.worst_allowed_q; - } - /* less likely */ - else if (cpi->active_worst_quality < cpi->oxcf.best_allowed_q) - { - cpi->active_worst_quality = cpi->oxcf.best_allowed_q; - } - if (cpi->active_best_quality < cpi->oxcf.best_allowed_q) - { - cpi->active_best_quality = cpi->oxcf.best_allowed_q; - } - /* less likely */ - else if (cpi->active_best_quality > cpi->oxcf.worst_allowed_q) - { - cpi->active_best_quality = cpi->oxcf.worst_allowed_q; - } - - cpi->buffered_mode = cpi->oxcf.optimal_buffer_level > 0; - - cpi->cq_target_quality = cpi->oxcf.cq_level; - - /* Only allow dropped frames in buffered mode */ - cpi->drop_frames_allowed = cpi->oxcf.allow_df && cpi->buffered_mode; - - cpi->target_bandwidth = cpi->oxcf.target_bandwidth; - - // Check if the number of temporal layers has changed, and if so reset the - // pattern counter and set/initialize the temporal layer context for the - // new layer configuration. - if (cpi->oxcf.number_of_layers != prev_number_of_layers) - { - // If the number of temporal layers are changed we must start at the - // base of the pattern cycle, so set the layer id to 0 and reset - // the temporal pattern counter. - if (cpi->temporal_layer_id > 0) { - cpi->temporal_layer_id = 0; - } - cpi->temporal_pattern_counter = 0; - reset_temporal_layer_change(cpi, oxcf, prev_number_of_layers); - } - - if (!cpi->initial_width) - { - cpi->initial_width = cpi->oxcf.Width; - cpi->initial_height = cpi->oxcf.Height; - } - - cm->Width = cpi->oxcf.Width; - cm->Height = cpi->oxcf.Height; - assert(cm->Width <= cpi->initial_width); - assert(cm->Height <= cpi->initial_height); - - /* TODO(jkoleszar): if an internal spatial resampling is active, - * and we downsize the input image, maybe we should clear the - * internal scale immediately rather than waiting for it to - * correct. - */ - - /* VP8 sharpness level mapping 0-7 (vs 0-10 in general VPx dialogs) */ - if (cpi->oxcf.Sharpness > 7) - cpi->oxcf.Sharpness = 7; - - cm->sharpness_level = cpi->oxcf.Sharpness; - - if (cm->horiz_scale != NORMAL || cm->vert_scale != NORMAL) - { - int UNINITIALIZED_IS_SAFE(hr), UNINITIALIZED_IS_SAFE(hs); - int UNINITIALIZED_IS_SAFE(vr), UNINITIALIZED_IS_SAFE(vs); - - Scale2Ratio(cm->horiz_scale, &hr, &hs); - Scale2Ratio(cm->vert_scale, &vr, &vs); - - /* always go to the next whole number */ - cm->Width = (hs - 1 + cpi->oxcf.Width * hr) / hs; - cm->Height = (vs - 1 + cpi->oxcf.Height * vr) / vs; - } - - if (last_w != cpi->oxcf.Width || last_h != cpi->oxcf.Height) - cpi->force_next_frame_intra = 1; - - if (((cm->Width + 15) & 0xfffffff0) != - cm->yv12_fb[cm->lst_fb_idx].y_width || - ((cm->Height + 15) & 0xfffffff0) != - cm->yv12_fb[cm->lst_fb_idx].y_height || - cm->yv12_fb[cm->lst_fb_idx].y_width == 0) - { - dealloc_raw_frame_buffers(cpi); - alloc_raw_frame_buffers(cpi); - vp8_alloc_compressor_data(cpi); - } - - if (cpi->oxcf.fixed_q >= 0) - { - cpi->last_q[0] = cpi->oxcf.fixed_q; - cpi->last_q[1] = cpi->oxcf.fixed_q; - } - - cpi->Speed = cpi->oxcf.cpu_used; - - /* force to allowlag to 0 if lag_in_frames is 0; */ - if (cpi->oxcf.lag_in_frames == 0) - { - cpi->oxcf.allow_lag = 0; - } - /* Limit on lag buffers as these are not currently dynamically allocated */ - else if (cpi->oxcf.lag_in_frames > MAX_LAG_BUFFERS) - cpi->oxcf.lag_in_frames = MAX_LAG_BUFFERS; - - /* YX Temp */ - cpi->alt_ref_source = NULL; - cpi->is_src_frame_alt_ref = 0; - -#if CONFIG_TEMPORAL_DENOISING - if (cpi->oxcf.noise_sensitivity) - { - if (!cpi->denoiser.yv12_mc_running_avg.buffer_alloc) - { - int width = (cpi->oxcf.Width + 15) & ~15; - int height = (cpi->oxcf.Height + 15) & ~15; - vp8_denoiser_allocate(&cpi->denoiser, width, height, - cm->mb_rows, cm->mb_cols, - cpi->oxcf.noise_sensitivity); - } - } -#endif - -#if 0 - /* Experimental RD Code */ - cpi->frame_distortion = 0; - cpi->last_frame_distortion = 0; -#endif - -} - -#ifndef M_LOG2_E -#define M_LOG2_E 0.693147180559945309417 -#endif -#define log2f(x) (log (x) / (float) M_LOG2_E) - -static void cal_mvsadcosts(int *mvsadcost[2]) -{ - int i = 1; - - mvsadcost [0] [0] = 300; - mvsadcost [1] [0] = 300; - - do - { - double z = 256 * (2 * (log2f(8 * i) + .6)); - mvsadcost [0][i] = (int) z; - mvsadcost [1][i] = (int) z; - mvsadcost [0][-i] = (int) z; - mvsadcost [1][-i] = (int) z; - } - while (++i <= mvfp_max); -} - -struct VP8_COMP* vp8_create_compressor(VP8_CONFIG *oxcf) -{ - int i; - - VP8_COMP *cpi; - VP8_COMMON *cm; - - cpi = vpx_memalign(32, sizeof(VP8_COMP)); - /* Check that the CPI instance is valid */ - if (!cpi) - return 0; - - cm = &cpi->common; - - vpx_memset(cpi, 0, sizeof(VP8_COMP)); - - if (setjmp(cm->error.jmp)) - { - cpi->common.error.setjmp = 0; - vp8_remove_compressor(&cpi); - return 0; - } - - cpi->common.error.setjmp = 1; - - CHECK_MEM_ERROR(cpi->mb.ss, vpx_calloc(sizeof(search_site), (MAX_MVSEARCH_STEPS * 8) + 1)); - - vp8_create_common(&cpi->common); - - init_config(cpi, oxcf); - - memcpy(cpi->base_skip_false_prob, vp8cx_base_skip_false_prob, sizeof(vp8cx_base_skip_false_prob)); - cpi->common.current_video_frame = 0; - cpi->temporal_pattern_counter = 0; - cpi->temporal_layer_id = -1; - cpi->kf_overspend_bits = 0; - cpi->kf_bitrate_adjustment = 0; - cpi->frames_till_gf_update_due = 0; - cpi->gf_overspend_bits = 0; - cpi->non_gf_bitrate_adjustment = 0; - cpi->prob_last_coded = 128; - cpi->prob_gf_coded = 128; - cpi->prob_intra_coded = 63; - - /* Prime the recent reference frame usage counters. - * Hereafter they will be maintained as a sort of moving average - */ - cpi->recent_ref_frame_usage[INTRA_FRAME] = 1; - cpi->recent_ref_frame_usage[LAST_FRAME] = 1; - cpi->recent_ref_frame_usage[GOLDEN_FRAME] = 1; - cpi->recent_ref_frame_usage[ALTREF_FRAME] = 1; - - /* Set reference frame sign bias for ALTREF frame to 1 (for now) */ - cpi->common.ref_frame_sign_bias[ALTREF_FRAME] = 1; - - cpi->twopass.gf_decay_rate = 0; - cpi->baseline_gf_interval = DEFAULT_GF_INTERVAL; - - cpi->gold_is_last = 0 ; - cpi->alt_is_last = 0 ; - cpi->gold_is_alt = 0 ; - - cpi->active_map_enabled = 0; - -#if 0 - /* Experimental code for lagged and one pass */ - /* Initialise one_pass GF frames stats */ - /* Update stats used for GF selection */ - if (cpi->pass == 0) - { - cpi->one_pass_frame_index = 0; - - for (i = 0; i < MAX_LAG_BUFFERS; i++) - { - cpi->one_pass_frame_stats[i].frames_so_far = 0; - cpi->one_pass_frame_stats[i].frame_intra_error = 0.0; - cpi->one_pass_frame_stats[i].frame_coded_error = 0.0; - cpi->one_pass_frame_stats[i].frame_pcnt_inter = 0.0; - cpi->one_pass_frame_stats[i].frame_pcnt_motion = 0.0; - cpi->one_pass_frame_stats[i].frame_mvr = 0.0; - cpi->one_pass_frame_stats[i].frame_mvr_abs = 0.0; - cpi->one_pass_frame_stats[i].frame_mvc = 0.0; - cpi->one_pass_frame_stats[i].frame_mvc_abs = 0.0; - } - } -#endif - - cpi->mse_source_denoised = 0; - - /* Should we use the cyclic refresh method. - * Currently this is tied to error resilliant mode - */ - cpi->cyclic_refresh_mode_enabled = cpi->oxcf.error_resilient_mode; - cpi->cyclic_refresh_mode_max_mbs_perframe = (cpi->common.mb_rows * cpi->common.mb_cols) / 5; - if (cpi->oxcf.number_of_layers == 1) { - cpi->cyclic_refresh_mode_max_mbs_perframe = - (cpi->common.mb_rows * cpi->common.mb_cols) / 20; - } else if (cpi->oxcf.number_of_layers == 2) { - cpi->cyclic_refresh_mode_max_mbs_perframe = - (cpi->common.mb_rows * cpi->common.mb_cols) / 10; - } - cpi->cyclic_refresh_mode_index = 0; - cpi->cyclic_refresh_q = 32; - - if (cpi->cyclic_refresh_mode_enabled) - { - CHECK_MEM_ERROR(cpi->cyclic_refresh_map, vpx_calloc((cpi->common.mb_rows * cpi->common.mb_cols), 1)); - } - else - cpi->cyclic_refresh_map = (signed char *) NULL; - - CHECK_MEM_ERROR(cpi->consec_zero_last, - vpx_calloc(cm->mb_rows * cm->mb_cols, 1)); - CHECK_MEM_ERROR(cpi->consec_zero_last_mvbias, - vpx_calloc((cpi->common.mb_rows * cpi->common.mb_cols), 1)); - -#ifdef VP8_ENTROPY_STATS - init_context_counters(); -#endif - - /*Initialize the feed-forward activity masking.*/ - cpi->activity_avg = 90<<12; - - /* Give a sensible default for the first frame. */ - cpi->frames_since_key = 8; - cpi->key_frame_frequency = cpi->oxcf.key_freq; - cpi->this_key_frame_forced = 0; - cpi->next_key_frame_forced = 0; - - cpi->source_alt_ref_pending = 0; - cpi->source_alt_ref_active = 0; - cpi->common.refresh_alt_ref_frame = 0; - - cpi->b_calculate_psnr = CONFIG_INTERNAL_STATS; -#if CONFIG_INTERNAL_STATS - cpi->b_calculate_ssimg = 0; - - cpi->count = 0; - cpi->bytes = 0; - - if (cpi->b_calculate_psnr) - { - cpi->total_sq_error = 0.0; - cpi->total_sq_error2 = 0.0; - cpi->total_y = 0.0; - cpi->total_u = 0.0; - cpi->total_v = 0.0; - cpi->total = 0.0; - cpi->totalp_y = 0.0; - cpi->totalp_u = 0.0; - cpi->totalp_v = 0.0; - cpi->totalp = 0.0; - cpi->tot_recode_hits = 0; - cpi->summed_quality = 0; - cpi->summed_weights = 0; - } - - if (cpi->b_calculate_ssimg) - { - cpi->total_ssimg_y = 0; - cpi->total_ssimg_u = 0; - cpi->total_ssimg_v = 0; - cpi->total_ssimg_all = 0; - } - -#endif - - cpi->first_time_stamp_ever = 0x7FFFFFFF; - - cpi->frames_till_gf_update_due = 0; - cpi->key_frame_count = 1; - - cpi->ni_av_qi = cpi->oxcf.worst_allowed_q; - cpi->ni_tot_qi = 0; - cpi->ni_frames = 0; - cpi->total_byte_count = 0; - - cpi->drop_frame = 0; - - cpi->rate_correction_factor = 1.0; - cpi->key_frame_rate_correction_factor = 1.0; - cpi->gf_rate_correction_factor = 1.0; - cpi->twopass.est_max_qcorrection_factor = 1.0; - - for (i = 0; i < KEY_FRAME_CONTEXT; i++) - { - cpi->prior_key_frame_distance[i] = (int)cpi->output_framerate; - } - -#ifdef OUTPUT_YUV_SRC - yuv_file = fopen("bd.yuv", "ab"); -#endif -#ifdef OUTPUT_YUV_DENOISED - yuv_denoised_file = fopen("denoised.yuv", "ab"); -#endif - -#if 0 - framepsnr = fopen("framepsnr.stt", "a"); - kf_list = fopen("kf_list.stt", "w"); -#endif - - cpi->output_pkt_list = oxcf->output_pkt_list; - -#if !(CONFIG_REALTIME_ONLY) - - if (cpi->pass == 1) - { - vp8_init_first_pass(cpi); - } - else if (cpi->pass == 2) - { - size_t packet_sz = sizeof(FIRSTPASS_STATS); - int packets = (int)(oxcf->two_pass_stats_in.sz / packet_sz); - - cpi->twopass.stats_in_start = oxcf->two_pass_stats_in.buf; - cpi->twopass.stats_in = cpi->twopass.stats_in_start; - cpi->twopass.stats_in_end = (void*)((char *)cpi->twopass.stats_in - + (packets - 1) * packet_sz); - vp8_init_second_pass(cpi); - } - -#endif - - if (cpi->compressor_speed == 2) - { - cpi->avg_encode_time = 0; - cpi->avg_pick_mode_time = 0; - } - - vp8_set_speed_features(cpi); - - /* Set starting values of RD threshold multipliers (128 = *1) */ - for (i = 0; i < MAX_MODES; i++) - { - cpi->mb.rd_thresh_mult[i] = 128; - } - -#ifdef VP8_ENTROPY_STATS - init_mv_ref_counts(); -#endif - -#if CONFIG_MULTITHREAD - if(vp8cx_create_encoder_threads(cpi)) - { - vp8_remove_compressor(&cpi); - return 0; - } -#endif - - cpi->fn_ptr[BLOCK_16X16].sdf = vp8_sad16x16; - cpi->fn_ptr[BLOCK_16X16].vf = vp8_variance16x16; - cpi->fn_ptr[BLOCK_16X16].svf = vp8_sub_pixel_variance16x16; - cpi->fn_ptr[BLOCK_16X16].svf_halfpix_h = vp8_variance_halfpixvar16x16_h; - cpi->fn_ptr[BLOCK_16X16].svf_halfpix_v = vp8_variance_halfpixvar16x16_v; - cpi->fn_ptr[BLOCK_16X16].svf_halfpix_hv = vp8_variance_halfpixvar16x16_hv; - cpi->fn_ptr[BLOCK_16X16].sdx3f = vp8_sad16x16x3; - cpi->fn_ptr[BLOCK_16X16].sdx8f = vp8_sad16x16x8; - cpi->fn_ptr[BLOCK_16X16].sdx4df = vp8_sad16x16x4d; - - cpi->fn_ptr[BLOCK_16X8].sdf = vp8_sad16x8; - cpi->fn_ptr[BLOCK_16X8].vf = vp8_variance16x8; - cpi->fn_ptr[BLOCK_16X8].svf = vp8_sub_pixel_variance16x8; - cpi->fn_ptr[BLOCK_16X8].svf_halfpix_h = NULL; - cpi->fn_ptr[BLOCK_16X8].svf_halfpix_v = NULL; - cpi->fn_ptr[BLOCK_16X8].svf_halfpix_hv = NULL; - cpi->fn_ptr[BLOCK_16X8].sdx3f = vp8_sad16x8x3; - cpi->fn_ptr[BLOCK_16X8].sdx8f = vp8_sad16x8x8; - cpi->fn_ptr[BLOCK_16X8].sdx4df = vp8_sad16x8x4d; - - cpi->fn_ptr[BLOCK_8X16].sdf = vp8_sad8x16; - cpi->fn_ptr[BLOCK_8X16].vf = vp8_variance8x16; - cpi->fn_ptr[BLOCK_8X16].svf = vp8_sub_pixel_variance8x16; - cpi->fn_ptr[BLOCK_8X16].svf_halfpix_h = NULL; - cpi->fn_ptr[BLOCK_8X16].svf_halfpix_v = NULL; - cpi->fn_ptr[BLOCK_8X16].svf_halfpix_hv = NULL; - cpi->fn_ptr[BLOCK_8X16].sdx3f = vp8_sad8x16x3; - cpi->fn_ptr[BLOCK_8X16].sdx8f = vp8_sad8x16x8; - cpi->fn_ptr[BLOCK_8X16].sdx4df = vp8_sad8x16x4d; - - cpi->fn_ptr[BLOCK_8X8].sdf = vp8_sad8x8; - cpi->fn_ptr[BLOCK_8X8].vf = vp8_variance8x8; - cpi->fn_ptr[BLOCK_8X8].svf = vp8_sub_pixel_variance8x8; - cpi->fn_ptr[BLOCK_8X8].svf_halfpix_h = NULL; - cpi->fn_ptr[BLOCK_8X8].svf_halfpix_v = NULL; - cpi->fn_ptr[BLOCK_8X8].svf_halfpix_hv = NULL; - cpi->fn_ptr[BLOCK_8X8].sdx3f = vp8_sad8x8x3; - cpi->fn_ptr[BLOCK_8X8].sdx8f = vp8_sad8x8x8; - cpi->fn_ptr[BLOCK_8X8].sdx4df = vp8_sad8x8x4d; - - cpi->fn_ptr[BLOCK_4X4].sdf = vp8_sad4x4; - cpi->fn_ptr[BLOCK_4X4].vf = vp8_variance4x4; - cpi->fn_ptr[BLOCK_4X4].svf = vp8_sub_pixel_variance4x4; - cpi->fn_ptr[BLOCK_4X4].svf_halfpix_h = NULL; - cpi->fn_ptr[BLOCK_4X4].svf_halfpix_v = NULL; - cpi->fn_ptr[BLOCK_4X4].svf_halfpix_hv = NULL; - cpi->fn_ptr[BLOCK_4X4].sdx3f = vp8_sad4x4x3; - cpi->fn_ptr[BLOCK_4X4].sdx8f = vp8_sad4x4x8; - cpi->fn_ptr[BLOCK_4X4].sdx4df = vp8_sad4x4x4d; - -#if ARCH_X86 || ARCH_X86_64 - cpi->fn_ptr[BLOCK_16X16].copymem = vp8_copy32xn; - cpi->fn_ptr[BLOCK_16X8].copymem = vp8_copy32xn; - cpi->fn_ptr[BLOCK_8X16].copymem = vp8_copy32xn; - cpi->fn_ptr[BLOCK_8X8].copymem = vp8_copy32xn; - cpi->fn_ptr[BLOCK_4X4].copymem = vp8_copy32xn; -#endif - - cpi->full_search_sad = vp8_full_search_sad; - cpi->diamond_search_sad = vp8_diamond_search_sad; - cpi->refining_search_sad = vp8_refining_search_sad; - - /* make sure frame 1 is okay */ - cpi->mb.error_bins[0] = cpi->common.MBs; - - /* vp8cx_init_quantizer() is first called here. Add check in - * vp8cx_frame_init_quantizer() so that vp8cx_init_quantizer is only - * called later when needed. This will avoid unnecessary calls of - * vp8cx_init_quantizer() for every frame. - */ - vp8cx_init_quantizer(cpi); - - vp8_loop_filter_init(cm); - - cpi->common.error.setjmp = 0; - -#if CONFIG_MULTI_RES_ENCODING - - /* Calculate # of MBs in a row in lower-resolution level image. */ - if (cpi->oxcf.mr_encoder_id > 0) - vp8_cal_low_res_mb_cols(cpi); - -#endif - - /* setup RD costs to MACROBLOCK struct */ - - cpi->mb.mvcost[0] = &cpi->rd_costs.mvcosts[0][mv_max+1]; - cpi->mb.mvcost[1] = &cpi->rd_costs.mvcosts[1][mv_max+1]; - cpi->mb.mvsadcost[0] = &cpi->rd_costs.mvsadcosts[0][mvfp_max+1]; - cpi->mb.mvsadcost[1] = &cpi->rd_costs.mvsadcosts[1][mvfp_max+1]; - - cal_mvsadcosts(cpi->mb.mvsadcost); - - cpi->mb.mbmode_cost = cpi->rd_costs.mbmode_cost; - cpi->mb.intra_uv_mode_cost = cpi->rd_costs.intra_uv_mode_cost; - cpi->mb.bmode_costs = cpi->rd_costs.bmode_costs; - cpi->mb.inter_bmode_costs = cpi->rd_costs.inter_bmode_costs; - cpi->mb.token_costs = cpi->rd_costs.token_costs; - - /* setup block ptrs & offsets */ - vp8_setup_block_ptrs(&cpi->mb); - vp8_setup_block_dptrs(&cpi->mb.e_mbd); - - return cpi; -} - - -void vp8_remove_compressor(VP8_COMP **ptr) -{ - VP8_COMP *cpi = *ptr; - - if (!cpi) - return; - - if (cpi && (cpi->common.current_video_frame > 0)) - { -#if !(CONFIG_REALTIME_ONLY) - - if (cpi->pass == 2) - { - vp8_end_second_pass(cpi); - } - -#endif - -#ifdef VP8_ENTROPY_STATS - print_context_counters(); - print_tree_update_probs(); - print_mode_context(); -#endif - -#if CONFIG_INTERNAL_STATS - - if (cpi->pass != 1) - { - FILE *f = fopen("opsnr.stt", "a"); - double time_encoded = (cpi->last_end_time_stamp_seen - - cpi->first_time_stamp_ever) / 10000000.000; - double total_encode_time = (cpi->time_receive_data + - cpi->time_compress_data) / 1000.000; - double dr = (double)cpi->bytes * 8.0 / 1000.0 / time_encoded; - - if (cpi->b_calculate_psnr) - { - if (cpi->oxcf.number_of_layers > 1) - { - int i; - - fprintf(f, "Layer\tBitrate\tAVGPsnr\tGLBPsnr\tAVPsnrP\t" - "GLPsnrP\tVPXSSIM\t\n"); - for (i=0; i<(int)cpi->oxcf.number_of_layers; i++) - { - double dr = (double)cpi->bytes_in_layer[i] * - 8.0 / 1000.0 / time_encoded; - double samples = 3.0 / 2 * cpi->frames_in_layer[i] * - cpi->common.Width * cpi->common.Height; - double total_psnr = - vpx_sse_to_psnr(samples, 255.0, - cpi->total_error2[i]); - double total_psnr2 = - vpx_sse_to_psnr(samples, 255.0, - cpi->total_error2_p[i]); - double total_ssim = 100 * pow(cpi->sum_ssim[i] / - cpi->sum_weights[i], 8.0); - - fprintf(f, "%5d\t%7.3f\t%7.3f\t%7.3f\t%7.3f\t" - "%7.3f\t%7.3f\n", - i, dr, - cpi->sum_psnr[i] / cpi->frames_in_layer[i], - total_psnr, - cpi->sum_psnr_p[i] / cpi->frames_in_layer[i], - total_psnr2, total_ssim); - } - } - else - { - double samples = 3.0 / 2 * cpi->count * - cpi->common.Width * cpi->common.Height; - double total_psnr = vpx_sse_to_psnr(samples, 255.0, - cpi->total_sq_error); - double total_psnr2 = vpx_sse_to_psnr(samples, 255.0, - cpi->total_sq_error2); - double total_ssim = 100 * pow(cpi->summed_quality / - cpi->summed_weights, 8.0); - - fprintf(f, "Bitrate\tAVGPsnr\tGLBPsnr\tAVPsnrP\t" - "GLPsnrP\tVPXSSIM\t Time(us)\n"); - fprintf(f, "%7.3f\t%7.3f\t%7.3f\t%7.3f\t%7.3f\t" - "%7.3f\t%8.0f\n", - dr, cpi->total / cpi->count, total_psnr, - cpi->totalp / cpi->count, total_psnr2, - total_ssim, total_encode_time); - } - } - - if (cpi->b_calculate_ssimg) - { - if (cpi->oxcf.number_of_layers > 1) - { - int i; - - fprintf(f, "Layer\tBitRate\tSSIM_Y\tSSIM_U\tSSIM_V\tSSIM_A\t" - "Time(us)\n"); - for (i=0; i<(int)cpi->oxcf.number_of_layers; i++) - { - double dr = (double)cpi->bytes_in_layer[i] * - 8.0 / 1000.0 / time_encoded; - fprintf(f, "%5d\t%7.3f\t%6.4f\t" - "%6.4f\t%6.4f\t%6.4f\t%8.0f\n", - i, dr, - cpi->total_ssimg_y_in_layer[i] / - cpi->frames_in_layer[i], - cpi->total_ssimg_u_in_layer[i] / - cpi->frames_in_layer[i], - cpi->total_ssimg_v_in_layer[i] / - cpi->frames_in_layer[i], - cpi->total_ssimg_all_in_layer[i] / - cpi->frames_in_layer[i], - total_encode_time); - } - } - else - { - fprintf(f, "BitRate\tSSIM_Y\tSSIM_U\tSSIM_V\tSSIM_A\t" - "Time(us)\n"); - fprintf(f, "%7.3f\t%6.4f\t%6.4f\t%6.4f\t%6.4f\t%8.0f\n", dr, - cpi->total_ssimg_y / cpi->count, - cpi->total_ssimg_u / cpi->count, - cpi->total_ssimg_v / cpi->count, - cpi->total_ssimg_all / cpi->count, total_encode_time); - } - } - - fclose(f); -#if 0 - f = fopen("qskip.stt", "a"); - fprintf(f, "minq:%d -maxq:%d skiptrue:skipfalse = %d:%d\n", cpi->oxcf.best_allowed_q, cpi->oxcf.worst_allowed_q, skiptruecount, skipfalsecount); - fclose(f); -#endif - - } - -#endif - - -#ifdef SPEEDSTATS - - if (cpi->compressor_speed == 2) - { - int i; - FILE *f = fopen("cxspeed.stt", "a"); - cnt_pm /= cpi->common.MBs; - - for (i = 0; i < 16; i++) - fprintf(f, "%5d", frames_at_speed[i]); - - fprintf(f, "\n"); - fclose(f); - } - -#endif - - -#ifdef MODE_STATS - { - extern int count_mb_seg[4]; - FILE *f = fopen("modes.stt", "a"); - double dr = (double)cpi->framerate * (double)bytes * (double)8 / (double)count / (double)1000 ; - fprintf(f, "intra_mode in Intra Frames:\n"); - fprintf(f, "Y: %8d, %8d, %8d, %8d, %8d\n", y_modes[0], y_modes[1], y_modes[2], y_modes[3], y_modes[4]); - fprintf(f, "UV:%8d, %8d, %8d, %8d\n", uv_modes[0], uv_modes[1], uv_modes[2], uv_modes[3]); - fprintf(f, "B: "); - { - int i; - - for (i = 0; i < 10; i++) - fprintf(f, "%8d, ", b_modes[i]); - - fprintf(f, "\n"); - - } - - fprintf(f, "Modes in Inter Frames:\n"); - fprintf(f, "Y: %8d, %8d, %8d, %8d, %8d, %8d, %8d, %8d, %8d, %8d\n", - inter_y_modes[0], inter_y_modes[1], inter_y_modes[2], inter_y_modes[3], inter_y_modes[4], - inter_y_modes[5], inter_y_modes[6], inter_y_modes[7], inter_y_modes[8], inter_y_modes[9]); - fprintf(f, "UV:%8d, %8d, %8d, %8d\n", inter_uv_modes[0], inter_uv_modes[1], inter_uv_modes[2], inter_uv_modes[3]); - fprintf(f, "B: "); - { - int i; - - for (i = 0; i < 15; i++) - fprintf(f, "%8d, ", inter_b_modes[i]); - - fprintf(f, "\n"); - - } - fprintf(f, "P:%8d, %8d, %8d, %8d\n", count_mb_seg[0], count_mb_seg[1], count_mb_seg[2], count_mb_seg[3]); - fprintf(f, "PB:%8d, %8d, %8d, %8d\n", inter_b_modes[LEFT4X4], inter_b_modes[ABOVE4X4], inter_b_modes[ZERO4X4], inter_b_modes[NEW4X4]); - - - - fclose(f); - } -#endif - -#ifdef VP8_ENTROPY_STATS - { - int i, j, k; - FILE *fmode = fopen("modecontext.c", "w"); - - fprintf(fmode, "\n#include \"entropymode.h\"\n\n"); - fprintf(fmode, "const unsigned int vp8_kf_default_bmode_counts "); - fprintf(fmode, "[VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES] =\n{\n"); - - for (i = 0; i < 10; i++) - { - - fprintf(fmode, " { /* Above Mode : %d */\n", i); - - for (j = 0; j < 10; j++) - { - - fprintf(fmode, " {"); - - for (k = 0; k < 10; k++) - { - if (!intra_mode_stats[i][j][k]) - fprintf(fmode, " %5d, ", 1); - else - fprintf(fmode, " %5d, ", intra_mode_stats[i][j][k]); - } - - fprintf(fmode, "}, /* left_mode %d */\n", j); - - } - - fprintf(fmode, " },\n"); - - } - - fprintf(fmode, "};\n"); - fclose(fmode); - } -#endif - - -#if defined(SECTIONBITS_OUTPUT) - - if (0) - { - int i; - FILE *f = fopen("tokenbits.stt", "a"); - - for (i = 0; i < 28; i++) - fprintf(f, "%8d", (int)(Sectionbits[i] / 256)); - - fprintf(f, "\n"); - fclose(f); - } - -#endif - -#if 0 - { - printf("\n_pick_loop_filter_level:%d\n", cpi->time_pick_lpf / 1000); - printf("\n_frames recive_data encod_mb_row compress_frame Total\n"); - printf("%6d %10ld %10ld %10ld %10ld\n", cpi->common.current_video_frame, cpi->time_receive_data / 1000, cpi->time_encode_mb_row / 1000, cpi->time_compress_data / 1000, (cpi->time_receive_data + cpi->time_compress_data) / 1000); - } -#endif - - } - -#if CONFIG_MULTITHREAD - vp8cx_remove_encoder_threads(cpi); -#endif - -#if CONFIG_TEMPORAL_DENOISING - vp8_denoiser_free(&cpi->denoiser); -#endif - dealloc_compressor_data(cpi); - vpx_free(cpi->mb.ss); - vpx_free(cpi->tok); - vpx_free(cpi->cyclic_refresh_map); - vpx_free(cpi->consec_zero_last); - vpx_free(cpi->consec_zero_last_mvbias); - - vp8_remove_common(&cpi->common); - vpx_free(cpi); - *ptr = 0; - -#ifdef OUTPUT_YUV_SRC - fclose(yuv_file); -#endif -#ifdef OUTPUT_YUV_DENOISED - fclose(yuv_denoised_file); -#endif - -#if 0 - - if (keyfile) - fclose(keyfile); - - if (framepsnr) - fclose(framepsnr); - - if (kf_list) - fclose(kf_list); - -#endif - -} - - -static uint64_t calc_plane_error(unsigned char *orig, int orig_stride, - unsigned char *recon, int recon_stride, - unsigned int cols, unsigned int rows) -{ - unsigned int row, col; - uint64_t total_sse = 0; - int diff; - - for (row = 0; row + 16 <= rows; row += 16) - { - for (col = 0; col + 16 <= cols; col += 16) - { - unsigned int sse; - - vp8_mse16x16(orig + col, orig_stride, - recon + col, recon_stride, - &sse); - total_sse += sse; - } - - /* Handle odd-sized width */ - if (col < cols) - { - unsigned int border_row, border_col; - unsigned char *border_orig = orig; - unsigned char *border_recon = recon; - - for (border_row = 0; border_row < 16; border_row++) - { - for (border_col = col; border_col < cols; border_col++) - { - diff = border_orig[border_col] - border_recon[border_col]; - total_sse += diff * diff; - } - - border_orig += orig_stride; - border_recon += recon_stride; - } - } - - orig += orig_stride * 16; - recon += recon_stride * 16; - } - - /* Handle odd-sized height */ - for (; row < rows; row++) - { - for (col = 0; col < cols; col++) - { - diff = orig[col] - recon[col]; - total_sse += diff * diff; - } - - orig += orig_stride; - recon += recon_stride; - } - - vp8_clear_system_state(); - return total_sse; -} - - -static void generate_psnr_packet(VP8_COMP *cpi) -{ - YV12_BUFFER_CONFIG *orig = cpi->Source; - YV12_BUFFER_CONFIG *recon = cpi->common.frame_to_show; - struct vpx_codec_cx_pkt pkt; - uint64_t sse; - int i; - unsigned int width = cpi->common.Width; - unsigned int height = cpi->common.Height; - - pkt.kind = VPX_CODEC_PSNR_PKT; - sse = calc_plane_error(orig->y_buffer, orig->y_stride, - recon->y_buffer, recon->y_stride, - width, height); - pkt.data.psnr.sse[0] = sse; - pkt.data.psnr.sse[1] = sse; - pkt.data.psnr.samples[0] = width * height; - pkt.data.psnr.samples[1] = width * height; - - width = (width + 1) / 2; - height = (height + 1) / 2; - - sse = calc_plane_error(orig->u_buffer, orig->uv_stride, - recon->u_buffer, recon->uv_stride, - width, height); - pkt.data.psnr.sse[0] += sse; - pkt.data.psnr.sse[2] = sse; - pkt.data.psnr.samples[0] += width * height; - pkt.data.psnr.samples[2] = width * height; - - sse = calc_plane_error(orig->v_buffer, orig->uv_stride, - recon->v_buffer, recon->uv_stride, - width, height); - pkt.data.psnr.sse[0] += sse; - pkt.data.psnr.sse[3] = sse; - pkt.data.psnr.samples[0] += width * height; - pkt.data.psnr.samples[3] = width * height; - - for (i = 0; i < 4; i++) - pkt.data.psnr.psnr[i] = vpx_sse_to_psnr(pkt.data.psnr.samples[i], 255.0, - (double)(pkt.data.psnr.sse[i])); - - vpx_codec_pkt_list_add(cpi->output_pkt_list, &pkt); -} - - -int vp8_use_as_reference(VP8_COMP *cpi, int ref_frame_flags) -{ - if (ref_frame_flags > 7) - return -1 ; - - cpi->ref_frame_flags = ref_frame_flags; - return 0; -} -int vp8_update_reference(VP8_COMP *cpi, int ref_frame_flags) -{ - if (ref_frame_flags > 7) - return -1 ; - - cpi->common.refresh_golden_frame = 0; - cpi->common.refresh_alt_ref_frame = 0; - cpi->common.refresh_last_frame = 0; - - if (ref_frame_flags & VP8_LAST_FRAME) - cpi->common.refresh_last_frame = 1; - - if (ref_frame_flags & VP8_GOLD_FRAME) - cpi->common.refresh_golden_frame = 1; - - if (ref_frame_flags & VP8_ALTR_FRAME) - cpi->common.refresh_alt_ref_frame = 1; - - return 0; -} - -int vp8_get_reference(VP8_COMP *cpi, enum vpx_ref_frame_type ref_frame_flag, YV12_BUFFER_CONFIG *sd) -{ - VP8_COMMON *cm = &cpi->common; - int ref_fb_idx; - - if (ref_frame_flag == VP8_LAST_FRAME) - ref_fb_idx = cm->lst_fb_idx; - else if (ref_frame_flag == VP8_GOLD_FRAME) - ref_fb_idx = cm->gld_fb_idx; - else if (ref_frame_flag == VP8_ALTR_FRAME) - ref_fb_idx = cm->alt_fb_idx; - else - return -1; - - vp8_yv12_copy_frame(&cm->yv12_fb[ref_fb_idx], sd); - - return 0; -} -int vp8_set_reference(VP8_COMP *cpi, enum vpx_ref_frame_type ref_frame_flag, YV12_BUFFER_CONFIG *sd) -{ - VP8_COMMON *cm = &cpi->common; - - int ref_fb_idx; - - if (ref_frame_flag == VP8_LAST_FRAME) - ref_fb_idx = cm->lst_fb_idx; - else if (ref_frame_flag == VP8_GOLD_FRAME) - ref_fb_idx = cm->gld_fb_idx; - else if (ref_frame_flag == VP8_ALTR_FRAME) - ref_fb_idx = cm->alt_fb_idx; - else - return -1; - - vp8_yv12_copy_frame(sd, &cm->yv12_fb[ref_fb_idx]); - - return 0; -} -int vp8_update_entropy(VP8_COMP *cpi, int update) -{ - VP8_COMMON *cm = &cpi->common; - cm->refresh_entropy_probs = update; - - return 0; -} - - -#if defined(OUTPUT_YUV_SRC) || defined(OUTPUT_YUV_DENOISED) -void vp8_write_yuv_frame(FILE *yuv_file, YV12_BUFFER_CONFIG *s) -{ - unsigned char *src = s->y_buffer; - int h = s->y_height; - - do - { - fwrite(src, s->y_width, 1, yuv_file); - src += s->y_stride; - } - while (--h); - - src = s->u_buffer; - h = s->uv_height; - - do - { - fwrite(src, s->uv_width, 1, yuv_file); - src += s->uv_stride; - } - while (--h); - - src = s->v_buffer; - h = s->uv_height; - - do - { - fwrite(src, s->uv_width, 1, yuv_file); - src += s->uv_stride; - } - while (--h); -} -#endif - -static void scale_and_extend_source(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi) -{ - VP8_COMMON *cm = &cpi->common; - - /* are we resizing the image */ - if (cm->horiz_scale != 0 || cm->vert_scale != 0) - { -#if CONFIG_SPATIAL_RESAMPLING - int UNINITIALIZED_IS_SAFE(hr), UNINITIALIZED_IS_SAFE(hs); - int UNINITIALIZED_IS_SAFE(vr), UNINITIALIZED_IS_SAFE(vs); - int tmp_height; - - if (cm->vert_scale == 3) - tmp_height = 9; - else - tmp_height = 11; - - Scale2Ratio(cm->horiz_scale, &hr, &hs); - Scale2Ratio(cm->vert_scale, &vr, &vs); - - vpx_scale_frame(sd, &cpi->scaled_source, cm->temp_scale_frame.y_buffer, - tmp_height, hs, hr, vs, vr, 0); - - vp8_yv12_extend_frame_borders(&cpi->scaled_source); - cpi->Source = &cpi->scaled_source; -#endif - } - else - cpi->Source = sd; -} - - -static int resize_key_frame(VP8_COMP *cpi) -{ -#if CONFIG_SPATIAL_RESAMPLING - VP8_COMMON *cm = &cpi->common; - - /* Do we need to apply resampling for one pass cbr. - * In one pass this is more limited than in two pass cbr. - * The test and any change is only made once per key frame sequence. - */ - if (cpi->oxcf.allow_spatial_resampling && (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER)) - { - int UNINITIALIZED_IS_SAFE(hr), UNINITIALIZED_IS_SAFE(hs); - int UNINITIALIZED_IS_SAFE(vr), UNINITIALIZED_IS_SAFE(vs); - int new_width, new_height; - - /* If we are below the resample DOWN watermark then scale down a - * notch. - */ - if (cpi->buffer_level < (cpi->oxcf.resample_down_water_mark * cpi->oxcf.optimal_buffer_level / 100)) - { - cm->horiz_scale = (cm->horiz_scale < ONETWO) ? cm->horiz_scale + 1 : ONETWO; - cm->vert_scale = (cm->vert_scale < ONETWO) ? cm->vert_scale + 1 : ONETWO; - } - /* Should we now start scaling back up */ - else if (cpi->buffer_level > (cpi->oxcf.resample_up_water_mark * cpi->oxcf.optimal_buffer_level / 100)) - { - cm->horiz_scale = (cm->horiz_scale > NORMAL) ? cm->horiz_scale - 1 : NORMAL; - cm->vert_scale = (cm->vert_scale > NORMAL) ? cm->vert_scale - 1 : NORMAL; - } - - /* Get the new height and width */ - Scale2Ratio(cm->horiz_scale, &hr, &hs); - Scale2Ratio(cm->vert_scale, &vr, &vs); - new_width = ((hs - 1) + (cpi->oxcf.Width * hr)) / hs; - new_height = ((vs - 1) + (cpi->oxcf.Height * vr)) / vs; - - /* If the image size has changed we need to reallocate the buffers - * and resample the source image - */ - if ((cm->Width != new_width) || (cm->Height != new_height)) - { - cm->Width = new_width; - cm->Height = new_height; - vp8_alloc_compressor_data(cpi); - scale_and_extend_source(cpi->un_scaled_source, cpi); - return 1; - } - } - -#endif - return 0; -} - - -static void update_alt_ref_frame_stats(VP8_COMP *cpi) -{ - VP8_COMMON *cm = &cpi->common; - - /* Select an interval before next GF or altref */ - if (!cpi->auto_gold) - cpi->frames_till_gf_update_due = DEFAULT_GF_INTERVAL; - - if ((cpi->pass != 2) && cpi->frames_till_gf_update_due) - { - cpi->current_gf_interval = cpi->frames_till_gf_update_due; - - /* Set the bits per frame that we should try and recover in - * subsequent inter frames to account for the extra GF spend... - * note that his does not apply for GF updates that occur - * coincident with a key frame as the extra cost of key frames is - * dealt with elsewhere. - */ - cpi->gf_overspend_bits += cpi->projected_frame_size; - cpi->non_gf_bitrate_adjustment = cpi->gf_overspend_bits / cpi->frames_till_gf_update_due; - } - - /* Update data structure that monitors level of reference to last GF */ - vpx_memset(cpi->gf_active_flags, 1, (cm->mb_rows * cm->mb_cols)); - cpi->gf_active_count = cm->mb_rows * cm->mb_cols; - - /* this frame refreshes means next frames don't unless specified by user */ - cpi->frames_since_golden = 0; - - /* Clear the alternate reference update pending flag. */ - cpi->source_alt_ref_pending = 0; - - /* Set the alternate reference frame active flag */ - cpi->source_alt_ref_active = 1; - - -} -static void update_golden_frame_stats(VP8_COMP *cpi) -{ - VP8_COMMON *cm = &cpi->common; - - /* Update the Golden frame usage counts. */ - if (cm->refresh_golden_frame) - { - /* Select an interval before next GF */ - if (!cpi->auto_gold) - cpi->frames_till_gf_update_due = DEFAULT_GF_INTERVAL; - - if ((cpi->pass != 2) && (cpi->frames_till_gf_update_due > 0)) - { - cpi->current_gf_interval = cpi->frames_till_gf_update_due; - - /* Set the bits per frame that we should try and recover in - * subsequent inter frames to account for the extra GF spend... - * note that his does not apply for GF updates that occur - * coincident with a key frame as the extra cost of key frames - * is dealt with elsewhere. - */ - if ((cm->frame_type != KEY_FRAME) && !cpi->source_alt_ref_active) - { - /* Calcluate GF bits to be recovered - * Projected size - av frame bits available for inter - * frames for clip as a whole - */ - cpi->gf_overspend_bits += (cpi->projected_frame_size - cpi->inter_frame_target); - } - - cpi->non_gf_bitrate_adjustment = cpi->gf_overspend_bits / cpi->frames_till_gf_update_due; - - } - - /* Update data structure that monitors level of reference to last GF */ - vpx_memset(cpi->gf_active_flags, 1, (cm->mb_rows * cm->mb_cols)); - cpi->gf_active_count = cm->mb_rows * cm->mb_cols; - - /* this frame refreshes means next frames don't unless specified by - * user - */ - cm->refresh_golden_frame = 0; - cpi->frames_since_golden = 0; - - cpi->recent_ref_frame_usage[INTRA_FRAME] = 1; - cpi->recent_ref_frame_usage[LAST_FRAME] = 1; - cpi->recent_ref_frame_usage[GOLDEN_FRAME] = 1; - cpi->recent_ref_frame_usage[ALTREF_FRAME] = 1; - - /* ******** Fixed Q test code only ************ */ - /* If we are going to use the ALT reference for the next group of - * frames set a flag to say so. - */ - if (cpi->oxcf.fixed_q >= 0 && - cpi->oxcf.play_alternate && !cpi->common.refresh_alt_ref_frame) - { - cpi->source_alt_ref_pending = 1; - cpi->frames_till_gf_update_due = cpi->baseline_gf_interval; - } - - if (!cpi->source_alt_ref_pending) - cpi->source_alt_ref_active = 0; - - /* Decrement count down till next gf */ - if (cpi->frames_till_gf_update_due > 0) - cpi->frames_till_gf_update_due--; - - } - else if (!cpi->common.refresh_alt_ref_frame) - { - /* Decrement count down till next gf */ - if (cpi->frames_till_gf_update_due > 0) - cpi->frames_till_gf_update_due--; - - if (cpi->frames_till_alt_ref_frame) - cpi->frames_till_alt_ref_frame --; - - cpi->frames_since_golden ++; - - if (cpi->frames_since_golden > 1) - { - cpi->recent_ref_frame_usage[INTRA_FRAME] += - cpi->mb.count_mb_ref_frame_usage[INTRA_FRAME]; - cpi->recent_ref_frame_usage[LAST_FRAME] += - cpi->mb.count_mb_ref_frame_usage[LAST_FRAME]; - cpi->recent_ref_frame_usage[GOLDEN_FRAME] += - cpi->mb.count_mb_ref_frame_usage[GOLDEN_FRAME]; - cpi->recent_ref_frame_usage[ALTREF_FRAME] += - cpi->mb.count_mb_ref_frame_usage[ALTREF_FRAME]; - } - } -} - -/* This function updates the reference frame probability estimates that - * will be used during mode selection - */ -static void update_rd_ref_frame_probs(VP8_COMP *cpi) -{ - VP8_COMMON *cm = &cpi->common; - - const int *const rfct = cpi->mb.count_mb_ref_frame_usage; - const int rf_intra = rfct[INTRA_FRAME]; - const int rf_inter = rfct[LAST_FRAME] + rfct[GOLDEN_FRAME] + rfct[ALTREF_FRAME]; - - if (cm->frame_type == KEY_FRAME) - { - cpi->prob_intra_coded = 255; - cpi->prob_last_coded = 128; - cpi->prob_gf_coded = 128; - } - else if (!(rf_intra + rf_inter)) - { - cpi->prob_intra_coded = 63; - cpi->prob_last_coded = 128; - cpi->prob_gf_coded = 128; - } - - /* update reference frame costs since we can do better than what we got - * last frame. - */ - if (cpi->oxcf.number_of_layers == 1) - { - if (cpi->common.refresh_alt_ref_frame) - { - cpi->prob_intra_coded += 40; - if (cpi->prob_intra_coded > 255) - cpi->prob_intra_coded = 255; - cpi->prob_last_coded = 200; - cpi->prob_gf_coded = 1; - } - else if (cpi->frames_since_golden == 0) - { - cpi->prob_last_coded = 214; - } - else if (cpi->frames_since_golden == 1) - { - cpi->prob_last_coded = 192; - cpi->prob_gf_coded = 220; - } - else if (cpi->source_alt_ref_active) - { - cpi->prob_gf_coded -= 20; - - if (cpi->prob_gf_coded < 10) - cpi->prob_gf_coded = 10; - } - if (!cpi->source_alt_ref_active) - cpi->prob_gf_coded = 255; - } -} - - -/* 1 = key, 0 = inter */ -static int decide_key_frame(VP8_COMP *cpi) -{ - VP8_COMMON *cm = &cpi->common; - - int code_key_frame = 0; - - cpi->kf_boost = 0; - - if (cpi->Speed > 11) - return 0; - - /* Clear down mmx registers */ - vp8_clear_system_state(); - - if ((cpi->compressor_speed == 2) && (cpi->Speed >= 5) && (cpi->sf.RD == 0)) - { - double change = 1.0 * abs((int)(cpi->mb.intra_error - - cpi->last_intra_error)) / (1 + cpi->last_intra_error); - double change2 = 1.0 * abs((int)(cpi->mb.prediction_error - - cpi->last_prediction_error)) / (1 + cpi->last_prediction_error); - double minerror = cm->MBs * 256; - - cpi->last_intra_error = cpi->mb.intra_error; - cpi->last_prediction_error = cpi->mb.prediction_error; - - if (10 * cpi->mb.intra_error / (1 + cpi->mb.prediction_error) < 15 - && cpi->mb.prediction_error > minerror - && (change > .25 || change2 > .25)) - { - /*(change > 1.4 || change < .75)&& cpi->this_frame_percent_intra > cpi->last_frame_percent_intra + 3*/ - return 1; - } - - return 0; - - } - - /* If the following are true we might as well code a key frame */ - if (((cpi->this_frame_percent_intra == 100) && - (cpi->this_frame_percent_intra > (cpi->last_frame_percent_intra + 2))) || - ((cpi->this_frame_percent_intra > 95) && - (cpi->this_frame_percent_intra >= (cpi->last_frame_percent_intra + 5)))) - { - code_key_frame = 1; - } - /* in addition if the following are true and this is not a golden frame - * then code a key frame Note that on golden frames there often seems - * to be a pop in intra useage anyway hence this restriction is - * designed to prevent spurious key frames. The Intra pop needs to be - * investigated. - */ - else if (((cpi->this_frame_percent_intra > 60) && - (cpi->this_frame_percent_intra > (cpi->last_frame_percent_intra * 2))) || - ((cpi->this_frame_percent_intra > 75) && - (cpi->this_frame_percent_intra > (cpi->last_frame_percent_intra * 3 / 2))) || - ((cpi->this_frame_percent_intra > 90) && - (cpi->this_frame_percent_intra > (cpi->last_frame_percent_intra + 10)))) - { - if (!cm->refresh_golden_frame) - code_key_frame = 1; - } - - return code_key_frame; - -} - -#if !(CONFIG_REALTIME_ONLY) -static void Pass1Encode(VP8_COMP *cpi, unsigned long *size, unsigned char *dest, unsigned int *frame_flags) -{ - (void) size; - (void) dest; - (void) frame_flags; - vp8_set_quantizer(cpi, 26); - - vp8_first_pass(cpi); -} -#endif - -#if 0 -void write_cx_frame_to_file(YV12_BUFFER_CONFIG *frame, int this_frame) -{ - - /* write the frame */ - FILE *yframe; - int i; - char filename[255]; - - sprintf(filename, "cx\\y%04d.raw", this_frame); - yframe = fopen(filename, "wb"); - - for (i = 0; i < frame->y_height; i++) - fwrite(frame->y_buffer + i * frame->y_stride, frame->y_width, 1, yframe); - - fclose(yframe); - sprintf(filename, "cx\\u%04d.raw", this_frame); - yframe = fopen(filename, "wb"); - - for (i = 0; i < frame->uv_height; i++) - fwrite(frame->u_buffer + i * frame->uv_stride, frame->uv_width, 1, yframe); - - fclose(yframe); - sprintf(filename, "cx\\v%04d.raw", this_frame); - yframe = fopen(filename, "wb"); - - for (i = 0; i < frame->uv_height; i++) - fwrite(frame->v_buffer + i * frame->uv_stride, frame->uv_width, 1, yframe); - - fclose(yframe); -} -#endif -/* return of 0 means drop frame */ - -/* Function to test for conditions that indeicate we should loop - * back and recode a frame. - */ -static int recode_loop_test( VP8_COMP *cpi, - int high_limit, int low_limit, - int q, int maxq, int minq ) -{ - int force_recode = 0; - VP8_COMMON *cm = &cpi->common; - - /* Is frame recode allowed at all - * Yes if either recode mode 1 is selected or mode two is selcted - * and the frame is a key frame. golden frame or alt_ref_frame - */ - if ( (cpi->sf.recode_loop == 1) || - ( (cpi->sf.recode_loop == 2) && - ( (cm->frame_type == KEY_FRAME) || - cm->refresh_golden_frame || - cm->refresh_alt_ref_frame ) ) ) - { - /* General over and under shoot tests */ - if ( ((cpi->projected_frame_size > high_limit) && (q < maxq)) || - ((cpi->projected_frame_size < low_limit) && (q > minq)) ) - { - force_recode = 1; - } - /* Special Constrained quality tests */ - else if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) - { - /* Undershoot and below auto cq level */ - if ( (q > cpi->cq_target_quality) && - (cpi->projected_frame_size < - ((cpi->this_frame_target * 7) >> 3))) - { - force_recode = 1; - } - /* Severe undershoot and between auto and user cq level */ - else if ( (q > cpi->oxcf.cq_level) && - (cpi->projected_frame_size < cpi->min_frame_bandwidth) && - (cpi->active_best_quality > cpi->oxcf.cq_level)) - { - force_recode = 1; - cpi->active_best_quality = cpi->oxcf.cq_level; - } - } - } - - return force_recode; -} - -static void update_reference_frames(VP8_COMP *cpi) -{ - VP8_COMMON *cm = &cpi->common; - YV12_BUFFER_CONFIG *yv12_fb = cm->yv12_fb; - - /* At this point the new frame has been encoded. - * If any buffer copy / swapping is signaled it should be done here. - */ - - if (cm->frame_type == KEY_FRAME) - { - yv12_fb[cm->new_fb_idx].flags |= VP8_GOLD_FRAME | VP8_ALTR_FRAME ; - - yv12_fb[cm->gld_fb_idx].flags &= ~VP8_GOLD_FRAME; - yv12_fb[cm->alt_fb_idx].flags &= ~VP8_ALTR_FRAME; - - cm->alt_fb_idx = cm->gld_fb_idx = cm->new_fb_idx; - - cpi->current_ref_frames[GOLDEN_FRAME] = cm->current_video_frame; - cpi->current_ref_frames[ALTREF_FRAME] = cm->current_video_frame; - } - else /* For non key frames */ - { - if (cm->refresh_alt_ref_frame) - { - assert(!cm->copy_buffer_to_arf); - - cm->yv12_fb[cm->new_fb_idx].flags |= VP8_ALTR_FRAME; - cm->yv12_fb[cm->alt_fb_idx].flags &= ~VP8_ALTR_FRAME; - cm->alt_fb_idx = cm->new_fb_idx; - - cpi->current_ref_frames[ALTREF_FRAME] = cm->current_video_frame; - } - else if (cm->copy_buffer_to_arf) - { - assert(!(cm->copy_buffer_to_arf & ~0x3)); - - if (cm->copy_buffer_to_arf == 1) - { - if(cm->alt_fb_idx != cm->lst_fb_idx) - { - yv12_fb[cm->lst_fb_idx].flags |= VP8_ALTR_FRAME; - yv12_fb[cm->alt_fb_idx].flags &= ~VP8_ALTR_FRAME; - cm->alt_fb_idx = cm->lst_fb_idx; - - cpi->current_ref_frames[ALTREF_FRAME] = - cpi->current_ref_frames[LAST_FRAME]; - } - } - else /* if (cm->copy_buffer_to_arf == 2) */ - { - if(cm->alt_fb_idx != cm->gld_fb_idx) - { - yv12_fb[cm->gld_fb_idx].flags |= VP8_ALTR_FRAME; - yv12_fb[cm->alt_fb_idx].flags &= ~VP8_ALTR_FRAME; - cm->alt_fb_idx = cm->gld_fb_idx; - - cpi->current_ref_frames[ALTREF_FRAME] = - cpi->current_ref_frames[GOLDEN_FRAME]; - } - } - } - - if (cm->refresh_golden_frame) - { - assert(!cm->copy_buffer_to_gf); - - cm->yv12_fb[cm->new_fb_idx].flags |= VP8_GOLD_FRAME; - cm->yv12_fb[cm->gld_fb_idx].flags &= ~VP8_GOLD_FRAME; - cm->gld_fb_idx = cm->new_fb_idx; - - cpi->current_ref_frames[GOLDEN_FRAME] = cm->current_video_frame; - } - else if (cm->copy_buffer_to_gf) - { - assert(!(cm->copy_buffer_to_arf & ~0x3)); - - if (cm->copy_buffer_to_gf == 1) - { - if(cm->gld_fb_idx != cm->lst_fb_idx) - { - yv12_fb[cm->lst_fb_idx].flags |= VP8_GOLD_FRAME; - yv12_fb[cm->gld_fb_idx].flags &= ~VP8_GOLD_FRAME; - cm->gld_fb_idx = cm->lst_fb_idx; - - cpi->current_ref_frames[GOLDEN_FRAME] = - cpi->current_ref_frames[LAST_FRAME]; - } - } - else /* if (cm->copy_buffer_to_gf == 2) */ - { - if(cm->alt_fb_idx != cm->gld_fb_idx) - { - yv12_fb[cm->alt_fb_idx].flags |= VP8_GOLD_FRAME; - yv12_fb[cm->gld_fb_idx].flags &= ~VP8_GOLD_FRAME; - cm->gld_fb_idx = cm->alt_fb_idx; - - cpi->current_ref_frames[GOLDEN_FRAME] = - cpi->current_ref_frames[ALTREF_FRAME]; - } - } - } - } - - if (cm->refresh_last_frame) - { - cm->yv12_fb[cm->new_fb_idx].flags |= VP8_LAST_FRAME; - cm->yv12_fb[cm->lst_fb_idx].flags &= ~VP8_LAST_FRAME; - cm->lst_fb_idx = cm->new_fb_idx; - - cpi->current_ref_frames[LAST_FRAME] = cm->current_video_frame; - } - -#if CONFIG_TEMPORAL_DENOISING - if (cpi->oxcf.noise_sensitivity) - { - /* we shouldn't have to keep multiple copies as we know in advance which - * buffer we should start - for now to get something up and running - * I've chosen to copy the buffers - */ - if (cm->frame_type == KEY_FRAME) - { - int i; - for (i = LAST_FRAME; i < MAX_REF_FRAMES; ++i) - vp8_yv12_copy_frame(cpi->Source, - &cpi->denoiser.yv12_running_avg[i]); - } - else /* For non key frames */ - { - vp8_yv12_extend_frame_borders( - &cpi->denoiser.yv12_running_avg[INTRA_FRAME]); - - if (cm->refresh_alt_ref_frame || cm->copy_buffer_to_arf) - { - vp8_yv12_copy_frame( - &cpi->denoiser.yv12_running_avg[INTRA_FRAME], - &cpi->denoiser.yv12_running_avg[ALTREF_FRAME]); - } - if (cm->refresh_golden_frame || cm->copy_buffer_to_gf) - { - vp8_yv12_copy_frame( - &cpi->denoiser.yv12_running_avg[INTRA_FRAME], - &cpi->denoiser.yv12_running_avg[GOLDEN_FRAME]); - } - if(cm->refresh_last_frame) - { - vp8_yv12_copy_frame( - &cpi->denoiser.yv12_running_avg[INTRA_FRAME], - &cpi->denoiser.yv12_running_avg[LAST_FRAME]); - } - } - if (cpi->oxcf.noise_sensitivity == 4) - vp8_yv12_copy_frame(cpi->Source, &cpi->denoiser.yv12_last_source); - - } -#endif - -} - -static int measure_square_diff_partial(YV12_BUFFER_CONFIG *source, - YV12_BUFFER_CONFIG *dest, - VP8_COMP *cpi) - { - int i, j; - int Total = 0; - int num_blocks = 0; - int skip = 2; - int min_consec_zero_last = 10; - int tot_num_blocks = (source->y_height * source->y_width) >> 8; - unsigned char *src = source->y_buffer; - unsigned char *dst = dest->y_buffer; - - /* Loop through the Y plane, every |skip| blocks along rows and colmumns, - * summing the square differences, and only for blocks that have been - * zero_last mode at least |x| frames in a row. - */ - for (i = 0; i < source->y_height; i += 16 * skip) - { - int block_index_row = (i >> 4) * cpi->common.mb_cols; - for (j = 0; j < source->y_width; j += 16 * skip) - { - int index = block_index_row + (j >> 4); - if (cpi->consec_zero_last[index] >= min_consec_zero_last) { - unsigned int sse; - Total += vp8_mse16x16(src + j, - source->y_stride, - dst + j, dest->y_stride, - &sse); - num_blocks++; - } - } - src += 16 * skip * source->y_stride; - dst += 16 * skip * dest->y_stride; - } - // Only return non-zero if we have at least ~1/16 samples for estimate. - if (num_blocks > (tot_num_blocks >> 4)) { - return (Total / num_blocks); - } else { - return 0; - } - } - -#if CONFIG_TEMPORAL_DENOISING -static void process_denoiser_mode_change(VP8_COMP *cpi) { - const VP8_COMMON *const cm = &cpi->common; - int i, j; - int total = 0; - int num_blocks = 0; - // Number of blocks skipped along row/column in computing the - // nmse (normalized mean square error) of source. - int skip = 2; - // Only select blocks for computing nmse that have been encoded - // as ZERO LAST min_consec_zero_last frames in a row. - // Scale with number of temporal layers. - int min_consec_zero_last = 12 / cpi->oxcf.number_of_layers; - // Decision is tested for changing the denoising mode every - // num_mode_change times this function is called. Note that this - // function called every 8 frames, so (8 * num_mode_change) is number - // of frames where denoising mode change is tested for switch. - int num_mode_change = 20; - // Framerate factor, to compensate for larger mse at lower framerates. - // Use ref_framerate, which is full source framerate for temporal layers. - // TODO(marpan): Adjust this factor. - int fac_framerate = cpi->ref_framerate < 25.0f ? 80 : 100; - int tot_num_blocks = cm->mb_rows * cm->mb_cols; - int ystride = cpi->Source->y_stride; - unsigned char *src = cpi->Source->y_buffer; - unsigned char *dst = cpi->denoiser.yv12_last_source.y_buffer; - static const unsigned char const_source[16] = { - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128}; - int bandwidth = (int)(cpi->target_bandwidth); - // For temporal layers, use full bandwidth (top layer). - if (cpi->oxcf.number_of_layers > 1) { - LAYER_CONTEXT *lc = &cpi->layer_context[cpi->oxcf.number_of_layers - 1]; - bandwidth = (int)(lc->target_bandwidth); - } - // Loop through the Y plane, every skip blocks along rows and columns, - // summing the normalized mean square error, only for blocks that have - // been encoded as ZEROMV LAST at least min_consec_zero_last least frames in - // a row and have small sum difference between current and previous frame. - // Normalization here is by the contrast of the current frame block. - for (i = 0; i < cm->Height; i += 16 * skip) { - int block_index_row = (i >> 4) * cm->mb_cols; - for (j = 0; j < cm->Width; j += 16 * skip) { - int index = block_index_row + (j >> 4); - if (cpi->consec_zero_last[index] >= min_consec_zero_last) { - unsigned int sse; - const unsigned int var = vp8_variance16x16(src + j, - ystride, - dst + j, - ystride, - &sse); - // Only consider this block as valid for noise measurement - // if the sum_diff average of the current and previous frame - // is small (to avoid effects from lighting change). - if ((sse - var) < 128) { - unsigned int sse2; - const unsigned int act = vp8_variance16x16(src + j, - ystride, - const_source, - 0, - &sse2); - if (act > 0) - total += sse / act; - num_blocks++; - } - } - } - src += 16 * skip * ystride; - dst += 16 * skip * ystride; - } - total = total * fac_framerate / 100; - - // Only consider this frame as valid sample if we have computed nmse over - // at least ~1/16 blocks, and Total > 0 (Total == 0 can happen if the - // application inputs duplicate frames, or contrast is all zero). - if (total > 0 && - (num_blocks > (tot_num_blocks >> 4))) { - // Update the recursive mean square source_diff. - total = (total << 8) / num_blocks; - if (cpi->denoiser.nmse_source_diff_count == 0) { - // First sample in new interval. - cpi->denoiser.nmse_source_diff = total; - cpi->denoiser.qp_avg = cm->base_qindex; - } else { - // For subsequent samples, use average with weight ~1/4 for new sample. - cpi->denoiser.nmse_source_diff = (int)((total + - 3 * cpi->denoiser.nmse_source_diff) >> 2); - cpi->denoiser.qp_avg = (int)((cm->base_qindex + - 3 * cpi->denoiser.qp_avg) >> 2); - } - cpi->denoiser.nmse_source_diff_count++; - } - // Check for changing the denoiser mode, when we have obtained #samples = - // num_mode_change. Condition the change also on the bitrate and QP. - if (cpi->denoiser.nmse_source_diff_count == num_mode_change) { - // Check for going up: from normal to aggressive mode. - if ((cpi->denoiser.denoiser_mode == kDenoiserOnYUV) && - (cpi->denoiser.nmse_source_diff > - cpi->denoiser.threshold_aggressive_mode) && - (cpi->denoiser.qp_avg < cpi->denoiser.qp_threshold_up && - bandwidth > cpi->denoiser.bitrate_threshold)) { - vp8_denoiser_set_parameters(&cpi->denoiser, kDenoiserOnYUVAggressive); - } else { - // Check for going down: from aggressive to normal mode. - if (((cpi->denoiser.denoiser_mode == kDenoiserOnYUVAggressive) && - (cpi->denoiser.nmse_source_diff < - cpi->denoiser.threshold_aggressive_mode)) || - ((cpi->denoiser.denoiser_mode == kDenoiserOnYUVAggressive) && - (cpi->denoiser.qp_avg > cpi->denoiser.qp_threshold_down || - bandwidth < cpi->denoiser.bitrate_threshold))) { - vp8_denoiser_set_parameters(&cpi->denoiser, kDenoiserOnYUV); - } - } - // Reset metric and counter for next interval. - cpi->denoiser.nmse_source_diff = 0; - cpi->denoiser.qp_avg = 0; - cpi->denoiser.nmse_source_diff_count = 0; - } -} -#endif - -void vp8_loopfilter_frame(VP8_COMP *cpi, VP8_COMMON *cm) -{ - const FRAME_TYPE frame_type = cm->frame_type; - - int update_any_ref_buffers = 1; - if (cpi->common.refresh_last_frame == 0 && - cpi->common.refresh_golden_frame == 0 && - cpi->common.refresh_alt_ref_frame == 0) { - update_any_ref_buffers = 0; - } - - if (cm->no_lpf) - { - cm->filter_level = 0; - } - else - { - struct vpx_usec_timer timer; - - vp8_clear_system_state(); - - vpx_usec_timer_start(&timer); - if (cpi->sf.auto_filter == 0) { -#if CONFIG_TEMPORAL_DENOISING - if (cpi->oxcf.noise_sensitivity && cm->frame_type != KEY_FRAME) { - // Use the denoised buffer for selecting base loop filter level. - // Denoised signal for current frame is stored in INTRA_FRAME. - // No denoising on key frames. - vp8cx_pick_filter_level_fast( - &cpi->denoiser.yv12_running_avg[INTRA_FRAME], cpi); - } else { - vp8cx_pick_filter_level_fast(cpi->Source, cpi); - } -#else - vp8cx_pick_filter_level_fast(cpi->Source, cpi); -#endif - } else { -#if CONFIG_TEMPORAL_DENOISING - if (cpi->oxcf.noise_sensitivity && cm->frame_type != KEY_FRAME) { - // Use the denoised buffer for selecting base loop filter level. - // Denoised signal for current frame is stored in INTRA_FRAME. - // No denoising on key frames. - vp8cx_pick_filter_level( - &cpi->denoiser.yv12_running_avg[INTRA_FRAME], cpi); - } else { - vp8cx_pick_filter_level(cpi->Source, cpi); - } -#else - vp8cx_pick_filter_level(cpi->Source, cpi); -#endif - } - - - if (cm->filter_level > 0) - { - vp8cx_set_alt_lf_level(cpi, cm->filter_level); - } - - vpx_usec_timer_mark(&timer); - cpi->time_pick_lpf += vpx_usec_timer_elapsed(&timer); - } - -#if CONFIG_MULTITHREAD - if (cpi->b_multi_threaded) - sem_post(&cpi->h_event_end_lpf); /* signal that we have set filter_level */ -#endif - - // No need to apply loop-filter if the encoded frame does not update - // any reference buffers. - if (cm->filter_level > 0 && update_any_ref_buffers) - { - vp8_loop_filter_frame(cm, &cpi->mb.e_mbd, frame_type); - } - - vp8_yv12_extend_frame_borders(cm->frame_to_show); - -} - -static void encode_frame_to_data_rate -( - VP8_COMP *cpi, - unsigned long *size, - unsigned char *dest, - unsigned char* dest_end, - unsigned int *frame_flags -) -{ - int Q; - int frame_over_shoot_limit; - int frame_under_shoot_limit; - - int Loop = 0; - int loop_count; - - VP8_COMMON *cm = &cpi->common; - int active_worst_qchanged = 0; - -#if !(CONFIG_REALTIME_ONLY) - int q_low; - int q_high; - int zbin_oq_high; - int zbin_oq_low = 0; - int top_index; - int bottom_index; - int overshoot_seen = 0; - int undershoot_seen = 0; -#endif - - int drop_mark = (int)(cpi->oxcf.drop_frames_water_mark * - cpi->oxcf.optimal_buffer_level / 100); - int drop_mark75 = drop_mark * 2 / 3; - int drop_mark50 = drop_mark / 4; - int drop_mark25 = drop_mark / 8; - - - /* Clear down mmx registers to allow floating point in what follows */ - vp8_clear_system_state(); - -#if CONFIG_MULTITHREAD - /* wait for the last picture loopfilter thread done */ - if (cpi->b_lpf_running) - { - sem_wait(&cpi->h_event_end_lpf); - cpi->b_lpf_running = 0; - } -#endif - - if(cpi->force_next_frame_intra) - { - cm->frame_type = KEY_FRAME; /* delayed intra frame */ - cpi->force_next_frame_intra = 0; - } - - /* For an alt ref frame in 2 pass we skip the call to the second pass - * function that sets the target bandwidth - */ -#if !(CONFIG_REALTIME_ONLY) - - if (cpi->pass == 2) - { - if (cpi->common.refresh_alt_ref_frame) - { - /* Per frame bit target for the alt ref frame */ - cpi->per_frame_bandwidth = cpi->twopass.gf_bits; - /* per second target bitrate */ - cpi->target_bandwidth = (int)(cpi->twopass.gf_bits * - cpi->output_framerate); - } - } - else -#endif - cpi->per_frame_bandwidth = (int)(cpi->target_bandwidth / cpi->output_framerate); - - /* Default turn off buffer to buffer copying */ - cm->copy_buffer_to_gf = 0; - cm->copy_buffer_to_arf = 0; - - /* Clear zbin over-quant value and mode boost values. */ - cpi->mb.zbin_over_quant = 0; - cpi->mb.zbin_mode_boost = 0; - - /* Enable or disable mode based tweaking of the zbin - * For 2 Pass Only used where GF/ARF prediction quality - * is above a threshold - */ - cpi->mb.zbin_mode_boost_enabled = 1; - if (cpi->pass == 2) - { - if ( cpi->gfu_boost <= 400 ) - { - cpi->mb.zbin_mode_boost_enabled = 0; - } - } - - /* Current default encoder behaviour for the altref sign bias */ - if (cpi->source_alt_ref_active) - cpi->common.ref_frame_sign_bias[ALTREF_FRAME] = 1; - else - cpi->common.ref_frame_sign_bias[ALTREF_FRAME] = 0; - - /* Check to see if a key frame is signaled - * For two pass with auto key frame enabled cm->frame_type may already - * be set, but not for one pass. - */ - if ((cm->current_video_frame == 0) || - (cm->frame_flags & FRAMEFLAGS_KEY) || - (cpi->oxcf.auto_key && (cpi->frames_since_key % cpi->key_frame_frequency == 0))) - { - /* Key frame from VFW/auto-keyframe/first frame */ - cm->frame_type = KEY_FRAME; -#if CONFIG_TEMPORAL_DENOISING - if (cpi->oxcf.noise_sensitivity == 4) { - // For adaptive mode, reset denoiser to normal mode on key frame. - vp8_denoiser_set_parameters(&cpi->denoiser, kDenoiserOnYUV); - } -#endif - } - -#if CONFIG_MULTI_RES_ENCODING - if (cpi->oxcf.mr_total_resolutions > 1) { - LOWER_RES_FRAME_INFO* low_res_frame_info - = (LOWER_RES_FRAME_INFO*)cpi->oxcf.mr_low_res_mode_info; - - if (cpi->oxcf.mr_encoder_id) { - - // TODO(marpan): This constraint shouldn't be needed, as we would like - // to allow for key frame setting (forced or periodic) defined per - // spatial layer. For now, keep this in. - cm->frame_type = low_res_frame_info->frame_type; - - // Check if lower resolution is available for motion vector reuse. - if(cm->frame_type != KEY_FRAME) - { - cpi->mr_low_res_mv_avail = 1; - cpi->mr_low_res_mv_avail &= !(low_res_frame_info->is_frame_dropped); - - if (cpi->ref_frame_flags & VP8_LAST_FRAME) - cpi->mr_low_res_mv_avail &= (cpi->current_ref_frames[LAST_FRAME] - == low_res_frame_info->low_res_ref_frames[LAST_FRAME]); - - if (cpi->ref_frame_flags & VP8_GOLD_FRAME) - cpi->mr_low_res_mv_avail &= (cpi->current_ref_frames[GOLDEN_FRAME] - == low_res_frame_info->low_res_ref_frames[GOLDEN_FRAME]); - - // Don't use altref to determine whether low res is available. - // TODO (marpan): Should we make this type of condition on a - // per-reference frame basis? - /* - if (cpi->ref_frame_flags & VP8_ALTR_FRAME) - cpi->mr_low_res_mv_avail &= (cpi->current_ref_frames[ALTREF_FRAME] - == low_res_frame_info->low_res_ref_frames[ALTREF_FRAME]); - */ - } - } - - // On a key frame: For the lowest resolution, keep track of the key frame - // counter value. For the higher resolutions, reset the current video - // frame counter to that of the lowest resolution. - // This is done to the handle the case where we may stop/start encoding - // higher layer(s). The restart-encoding of higher layer is only signaled - // by a key frame for now. - // TODO (marpan): Add flag to indicate restart-encoding of higher layer. - if (cm->frame_type == KEY_FRAME) { - if (cpi->oxcf.mr_encoder_id) { - // If the initial starting value of the buffer level is zero (this can - // happen because we may have not started encoding this higher stream), - // then reset it to non-zero value based on |starting_buffer_level|. - if (cpi->common.current_video_frame == 0 && cpi->buffer_level == 0) { - unsigned int i; - cpi->bits_off_target = cpi->oxcf.starting_buffer_level; - cpi->buffer_level = cpi->oxcf.starting_buffer_level; - for (i = 0; i < cpi->oxcf.number_of_layers; i++) { - LAYER_CONTEXT *lc = &cpi->layer_context[i]; - lc->bits_off_target = lc->starting_buffer_level; - lc->buffer_level = lc->starting_buffer_level; - } - } - cpi->common.current_video_frame = - low_res_frame_info->key_frame_counter_value; - } else { - low_res_frame_info->key_frame_counter_value = - cpi->common.current_video_frame; - } - } - - } -#endif - - // Find the reference frame closest to the current frame. - cpi->closest_reference_frame = LAST_FRAME; - if(cm->frame_type != KEY_FRAME) { - int i; - MV_REFERENCE_FRAME closest_ref = INTRA_FRAME; - if (cpi->ref_frame_flags & VP8_LAST_FRAME) { - closest_ref = LAST_FRAME; - } else if (cpi->ref_frame_flags & VP8_GOLD_FRAME) { - closest_ref = GOLDEN_FRAME; - } else if (cpi->ref_frame_flags & VP8_ALTR_FRAME) { - closest_ref = ALTREF_FRAME; - } - for(i = 1; i <= 3; i++) { - vpx_ref_frame_type_t ref_frame_type = (vpx_ref_frame_type_t) - ((i == 3) ? 4 : i); - if (cpi->ref_frame_flags & ref_frame_type) { - if ((cm->current_video_frame - cpi->current_ref_frames[i]) < - (cm->current_video_frame - cpi->current_ref_frames[closest_ref])) { - closest_ref = i; - } - } - } - cpi->closest_reference_frame = closest_ref; - } - - /* Set various flags etc to special state if it is a key frame */ - if (cm->frame_type == KEY_FRAME) - { - int i; - - // Set the loop filter deltas and segmentation map update - setup_features(cpi); - - /* The alternate reference frame cannot be active for a key frame */ - cpi->source_alt_ref_active = 0; - - /* Reset the RD threshold multipliers to default of * 1 (128) */ - for (i = 0; i < MAX_MODES; i++) - { - cpi->mb.rd_thresh_mult[i] = 128; - } - - // Reset the zero_last counter to 0 on key frame. - vpx_memset(cpi->consec_zero_last, 0, cm->mb_rows * cm->mb_cols); - vpx_memset(cpi->consec_zero_last_mvbias, 0, - (cpi->common.mb_rows * cpi->common.mb_cols)); - } - -#if 0 - /* Experimental code for lagged compress and one pass - * Initialise one_pass GF frames stats - * Update stats used for GF selection - */ - { - cpi->one_pass_frame_index = cm->current_video_frame % MAX_LAG_BUFFERS; - - cpi->one_pass_frame_stats[cpi->one_pass_frame_index ].frames_so_far = 0; - cpi->one_pass_frame_stats[cpi->one_pass_frame_index ].frame_intra_error = 0.0; - cpi->one_pass_frame_stats[cpi->one_pass_frame_index ].frame_coded_error = 0.0; - cpi->one_pass_frame_stats[cpi->one_pass_frame_index ].frame_pcnt_inter = 0.0; - cpi->one_pass_frame_stats[cpi->one_pass_frame_index ].frame_pcnt_motion = 0.0; - cpi->one_pass_frame_stats[cpi->one_pass_frame_index ].frame_mvr = 0.0; - cpi->one_pass_frame_stats[cpi->one_pass_frame_index ].frame_mvr_abs = 0.0; - cpi->one_pass_frame_stats[cpi->one_pass_frame_index ].frame_mvc = 0.0; - cpi->one_pass_frame_stats[cpi->one_pass_frame_index ].frame_mvc_abs = 0.0; - } -#endif - - update_rd_ref_frame_probs(cpi); - - if (cpi->drop_frames_allowed) - { - /* The reset to decimation 0 is only done here for one pass. - * Once it is set two pass leaves decimation on till the next kf. - */ - if ((cpi->buffer_level > drop_mark) && (cpi->decimation_factor > 0)) - cpi->decimation_factor --; - - if (cpi->buffer_level > drop_mark75 && cpi->decimation_factor > 0) - cpi->decimation_factor = 1; - - else if (cpi->buffer_level < drop_mark25 && (cpi->decimation_factor == 2 || cpi->decimation_factor == 3)) - { - cpi->decimation_factor = 3; - } - else if (cpi->buffer_level < drop_mark50 && (cpi->decimation_factor == 1 || cpi->decimation_factor == 2)) - { - cpi->decimation_factor = 2; - } - else if (cpi->buffer_level < drop_mark75 && (cpi->decimation_factor == 0 || cpi->decimation_factor == 1)) - { - cpi->decimation_factor = 1; - } - } - - /* The following decimates the frame rate according to a regular - * pattern (i.e. to 1/2 or 2/3 frame rate) This can be used to help - * prevent buffer under-run in CBR mode. Alternatively it might be - * desirable in some situations to drop frame rate but throw more bits - * at each frame. - * - * Note that dropping a key frame can be problematic if spatial - * resampling is also active - */ - if (cpi->decimation_factor > 0) - { - switch (cpi->decimation_factor) - { - case 1: - cpi->per_frame_bandwidth = cpi->per_frame_bandwidth * 3 / 2; - break; - case 2: - cpi->per_frame_bandwidth = cpi->per_frame_bandwidth * 5 / 4; - break; - case 3: - cpi->per_frame_bandwidth = cpi->per_frame_bandwidth * 5 / 4; - break; - } - - /* Note that we should not throw out a key frame (especially when - * spatial resampling is enabled). - */ - if (cm->frame_type == KEY_FRAME) - { - cpi->decimation_count = cpi->decimation_factor; - } - else if (cpi->decimation_count > 0) - { - cpi->decimation_count --; - - cpi->bits_off_target += cpi->av_per_frame_bandwidth; - if (cpi->bits_off_target > cpi->oxcf.maximum_buffer_size) - cpi->bits_off_target = cpi->oxcf.maximum_buffer_size; - -#if CONFIG_MULTI_RES_ENCODING - vp8_store_drop_frame_info(cpi); -#endif - - cm->current_video_frame++; - cpi->frames_since_key++; - // We advance the temporal pattern for dropped frames. - cpi->temporal_pattern_counter++; - -#if CONFIG_INTERNAL_STATS - cpi->count ++; -#endif - - cpi->buffer_level = cpi->bits_off_target; - - if (cpi->oxcf.number_of_layers > 1) - { - unsigned int i; - - /* Propagate bits saved by dropping the frame to higher - * layers - */ - for (i=cpi->current_layer+1; ioxcf.number_of_layers; i++) - { - LAYER_CONTEXT *lc = &cpi->layer_context[i]; - lc->bits_off_target += (int)(lc->target_bandwidth / - lc->framerate); - if (lc->bits_off_target > lc->maximum_buffer_size) - lc->bits_off_target = lc->maximum_buffer_size; - lc->buffer_level = lc->bits_off_target; - } - } - - return; - } - else - cpi->decimation_count = cpi->decimation_factor; - } - else - cpi->decimation_count = 0; - - /* Decide how big to make the frame */ - if (!vp8_pick_frame_size(cpi)) - { - /*TODO: 2 drop_frame and return code could be put together. */ -#if CONFIG_MULTI_RES_ENCODING - vp8_store_drop_frame_info(cpi); -#endif - cm->current_video_frame++; - cpi->frames_since_key++; - // We advance the temporal pattern for dropped frames. - cpi->temporal_pattern_counter++; - return; - } - - /* Reduce active_worst_allowed_q for CBR if our buffer is getting too full. - * This has a knock on effect on active best quality as well. - * For CBR if the buffer reaches its maximum level then we can no longer - * save up bits for later frames so we might as well use them up - * on the current frame. - */ - if ((cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) && - (cpi->buffer_level >= cpi->oxcf.optimal_buffer_level) && cpi->buffered_mode) - { - /* Max adjustment is 1/4 */ - int Adjustment = cpi->active_worst_quality / 4; - - if (Adjustment) - { - int buff_lvl_step; - - if (cpi->buffer_level < cpi->oxcf.maximum_buffer_size) - { - buff_lvl_step = (int) - ((cpi->oxcf.maximum_buffer_size - - cpi->oxcf.optimal_buffer_level) / - Adjustment); - - if (buff_lvl_step) - Adjustment = (int) - ((cpi->buffer_level - - cpi->oxcf.optimal_buffer_level) / - buff_lvl_step); - else - Adjustment = 0; - } - - cpi->active_worst_quality -= Adjustment; - - if(cpi->active_worst_quality < cpi->active_best_quality) - cpi->active_worst_quality = cpi->active_best_quality; - } - } - - /* Set an active best quality and if necessary active worst quality - * There is some odd behavior for one pass here that needs attention. - */ - if ( (cpi->pass == 2) || (cpi->ni_frames > 150)) - { - vp8_clear_system_state(); - - Q = cpi->active_worst_quality; - - if ( cm->frame_type == KEY_FRAME ) - { - if ( cpi->pass == 2 ) - { - if (cpi->gfu_boost > 600) - cpi->active_best_quality = kf_low_motion_minq[Q]; - else - cpi->active_best_quality = kf_high_motion_minq[Q]; - - /* Special case for key frames forced because we have reached - * the maximum key frame interval. Here force the Q to a range - * based on the ambient Q to reduce the risk of popping - */ - if ( cpi->this_key_frame_forced ) - { - if ( cpi->active_best_quality > cpi->avg_frame_qindex * 7/8) - cpi->active_best_quality = cpi->avg_frame_qindex * 7/8; - else if ( cpi->active_best_quality < cpi->avg_frame_qindex >> 2 ) - cpi->active_best_quality = cpi->avg_frame_qindex >> 2; - } - } - /* One pass more conservative */ - else - cpi->active_best_quality = kf_high_motion_minq[Q]; - } - - else if (cpi->oxcf.number_of_layers==1 && - (cm->refresh_golden_frame || cpi->common.refresh_alt_ref_frame)) - { - /* Use the lower of cpi->active_worst_quality and recent - * average Q as basis for GF/ARF Q limit unless last frame was - * a key frame. - */ - if ( (cpi->frames_since_key > 1) && - (cpi->avg_frame_qindex < cpi->active_worst_quality) ) - { - Q = cpi->avg_frame_qindex; - } - - /* For constrained quality dont allow Q less than the cq level */ - if ( (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) && - (Q < cpi->cq_target_quality) ) - { - Q = cpi->cq_target_quality; - } - - if ( cpi->pass == 2 ) - { - if ( cpi->gfu_boost > 1000 ) - cpi->active_best_quality = gf_low_motion_minq[Q]; - else if ( cpi->gfu_boost < 400 ) - cpi->active_best_quality = gf_high_motion_minq[Q]; - else - cpi->active_best_quality = gf_mid_motion_minq[Q]; - - /* Constrained quality use slightly lower active best. */ - if ( cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY ) - { - cpi->active_best_quality = - cpi->active_best_quality * 15/16; - } - } - /* One pass more conservative */ - else - cpi->active_best_quality = gf_high_motion_minq[Q]; - } - else - { - cpi->active_best_quality = inter_minq[Q]; - - /* For the constant/constrained quality mode we dont want - * q to fall below the cq level. - */ - if ((cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) && - (cpi->active_best_quality < cpi->cq_target_quality) ) - { - /* If we are strongly undershooting the target rate in the last - * frames then use the user passed in cq value not the auto - * cq value. - */ - if ( cpi->rolling_actual_bits < cpi->min_frame_bandwidth ) - cpi->active_best_quality = cpi->oxcf.cq_level; - else - cpi->active_best_quality = cpi->cq_target_quality; - } - } - - /* If CBR and the buffer is as full then it is reasonable to allow - * higher quality on the frames to prevent bits just going to waste. - */ - if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) - { - /* Note that the use of >= here elliminates the risk of a devide - * by 0 error in the else if clause - */ - if (cpi->buffer_level >= cpi->oxcf.maximum_buffer_size) - cpi->active_best_quality = cpi->best_quality; - - else if (cpi->buffer_level > cpi->oxcf.optimal_buffer_level) - { - int Fraction = (int) - (((cpi->buffer_level - cpi->oxcf.optimal_buffer_level) * 128) - / (cpi->oxcf.maximum_buffer_size - - cpi->oxcf.optimal_buffer_level)); - int min_qadjustment = ((cpi->active_best_quality - - cpi->best_quality) * Fraction) / 128; - - cpi->active_best_quality -= min_qadjustment; - } - } - } - /* Make sure constrained quality mode limits are adhered to for the first - * few frames of one pass encodes - */ - else if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) - { - if ( (cm->frame_type == KEY_FRAME) || - cm->refresh_golden_frame || cpi->common.refresh_alt_ref_frame ) - { - cpi->active_best_quality = cpi->best_quality; - } - else if (cpi->active_best_quality < cpi->cq_target_quality) - { - cpi->active_best_quality = cpi->cq_target_quality; - } - } - - /* Clip the active best and worst quality values to limits */ - if (cpi->active_worst_quality > cpi->worst_quality) - cpi->active_worst_quality = cpi->worst_quality; - - if (cpi->active_best_quality < cpi->best_quality) - cpi->active_best_quality = cpi->best_quality; - - if ( cpi->active_worst_quality < cpi->active_best_quality ) - cpi->active_worst_quality = cpi->active_best_quality; - - /* Determine initial Q to try */ - Q = vp8_regulate_q(cpi, cpi->this_frame_target); - -#if !(CONFIG_REALTIME_ONLY) - - /* Set highest allowed value for Zbin over quant */ - if (cm->frame_type == KEY_FRAME) - zbin_oq_high = 0; - else if ((cpi->oxcf.number_of_layers == 1) && ((cm->refresh_alt_ref_frame || - (cm->refresh_golden_frame && !cpi->source_alt_ref_active)))) - { - zbin_oq_high = 16; - } - else - zbin_oq_high = ZBIN_OQ_MAX; -#endif - - /* Setup background Q adjustment for error resilient mode. - * For multi-layer encodes only enable this for the base layer. - */ - if (cpi->cyclic_refresh_mode_enabled) - { - if (cpi->current_layer==0) - cyclic_background_refresh(cpi, Q, 0); - else - disable_segmentation(cpi); - } - - vp8_compute_frame_size_bounds(cpi, &frame_under_shoot_limit, &frame_over_shoot_limit); - -#if !(CONFIG_REALTIME_ONLY) - /* Limit Q range for the adaptive loop. */ - bottom_index = cpi->active_best_quality; - top_index = cpi->active_worst_quality; - q_low = cpi->active_best_quality; - q_high = cpi->active_worst_quality; -#endif - - vp8_save_coding_context(cpi); - - loop_count = 0; - - scale_and_extend_source(cpi->un_scaled_source, cpi); - -#if CONFIG_TEMPORAL_DENOISING && CONFIG_POSTPROC - // Option to apply spatial blur under the aggressive or adaptive - // (temporal denoising) mode. - if (cpi->oxcf.noise_sensitivity >= 3) { - if (cpi->denoiser.denoise_pars.spatial_blur != 0) { - vp8_de_noise(cm, cpi->Source, cpi->Source, - cpi->denoiser.denoise_pars.spatial_blur, 1, 0, 0); - } - } -#endif - -#if !(CONFIG_REALTIME_ONLY) && CONFIG_POSTPROC && !(CONFIG_TEMPORAL_DENOISING) - - if (cpi->oxcf.noise_sensitivity > 0) - { - unsigned char *src; - int l = 0; - - switch (cpi->oxcf.noise_sensitivity) - { - case 1: - l = 20; - break; - case 2: - l = 40; - break; - case 3: - l = 60; - break; - case 4: - l = 80; - break; - case 5: - l = 100; - break; - case 6: - l = 150; - break; - } - - - if (cm->frame_type == KEY_FRAME) - { - vp8_de_noise(cm, cpi->Source, cpi->Source, l , 1, 0, 1); - } - else - { - vp8_de_noise(cm, cpi->Source, cpi->Source, l , 1, 0, 1); - - src = cpi->Source->y_buffer; - - if (cpi->Source->y_stride < 0) - { - src += cpi->Source->y_stride * (cpi->Source->y_height - 1); - } - } - } - -#endif - - -#ifdef OUTPUT_YUV_SRC - vp8_write_yuv_frame(yuv_file, cpi->Source); -#endif - - do - { - vp8_clear_system_state(); - - vp8_set_quantizer(cpi, Q); - - /* setup skip prob for costing in mode/mv decision */ - if (cpi->common.mb_no_coeff_skip) - { - cpi->prob_skip_false = cpi->base_skip_false_prob[Q]; - - if (cm->frame_type != KEY_FRAME) - { - if (cpi->common.refresh_alt_ref_frame) - { - if (cpi->last_skip_false_probs[2] != 0) - cpi->prob_skip_false = cpi->last_skip_false_probs[2]; - - /* - if(cpi->last_skip_false_probs[2]!=0 && abs(Q- cpi->last_skip_probs_q[2])<=16 ) - cpi->prob_skip_false = cpi->last_skip_false_probs[2]; - else if (cpi->last_skip_false_probs[2]!=0) - cpi->prob_skip_false = (cpi->last_skip_false_probs[2] + cpi->prob_skip_false ) / 2; - */ - } - else if (cpi->common.refresh_golden_frame) - { - if (cpi->last_skip_false_probs[1] != 0) - cpi->prob_skip_false = cpi->last_skip_false_probs[1]; - - /* - if(cpi->last_skip_false_probs[1]!=0 && abs(Q- cpi->last_skip_probs_q[1])<=16 ) - cpi->prob_skip_false = cpi->last_skip_false_probs[1]; - else if (cpi->last_skip_false_probs[1]!=0) - cpi->prob_skip_false = (cpi->last_skip_false_probs[1] + cpi->prob_skip_false ) / 2; - */ - } - else - { - if (cpi->last_skip_false_probs[0] != 0) - cpi->prob_skip_false = cpi->last_skip_false_probs[0]; - - /* - if(cpi->last_skip_false_probs[0]!=0 && abs(Q- cpi->last_skip_probs_q[0])<=16 ) - cpi->prob_skip_false = cpi->last_skip_false_probs[0]; - else if(cpi->last_skip_false_probs[0]!=0) - cpi->prob_skip_false = (cpi->last_skip_false_probs[0] + cpi->prob_skip_false ) / 2; - */ - } - - /* as this is for cost estimate, let's make sure it does not - * go extreme eitehr way - */ - if (cpi->prob_skip_false < 5) - cpi->prob_skip_false = 5; - - if (cpi->prob_skip_false > 250) - cpi->prob_skip_false = 250; - - if (cpi->oxcf.number_of_layers == 1 && cpi->is_src_frame_alt_ref) - cpi->prob_skip_false = 1; - } - -#if 0 - - if (cpi->pass != 1) - { - FILE *f = fopen("skip.stt", "a"); - fprintf(f, "%d, %d, %4d ", cpi->common.refresh_golden_frame, cpi->common.refresh_alt_ref_frame, cpi->prob_skip_false); - fclose(f); - } - -#endif - - } - - if (cm->frame_type == KEY_FRAME) - { - if(resize_key_frame(cpi)) - { - /* If the frame size has changed, need to reset Q, quantizer, - * and background refresh. - */ - Q = vp8_regulate_q(cpi, cpi->this_frame_target); - if (cpi->cyclic_refresh_mode_enabled) - { - if (cpi->current_layer==0) - cyclic_background_refresh(cpi, Q, 0); - else - disable_segmentation(cpi); - } - // Reset the zero_last counter to 0 on key frame. - vpx_memset(cpi->consec_zero_last, 0, cm->mb_rows * cm->mb_cols); - vpx_memset(cpi->consec_zero_last_mvbias, 0, - (cpi->common.mb_rows * cpi->common.mb_cols)); - vp8_set_quantizer(cpi, Q); - } - - vp8_setup_key_frame(cpi); - } - - - -#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING - { - if(cpi->oxcf.error_resilient_mode) - cm->refresh_entropy_probs = 0; - - if (cpi->oxcf.error_resilient_mode & VPX_ERROR_RESILIENT_PARTITIONS) - { - if (cm->frame_type == KEY_FRAME) - cm->refresh_entropy_probs = 1; - } - - if (cm->refresh_entropy_probs == 0) - { - /* save a copy for later refresh */ - vpx_memcpy(&cm->lfc, &cm->fc, sizeof(cm->fc)); - } - - vp8_update_coef_context(cpi); - - vp8_update_coef_probs(cpi); - - /* transform / motion compensation build reconstruction frame - * +pack coef partitions - */ - vp8_encode_frame(cpi); - - /* cpi->projected_frame_size is not needed for RT mode */ - } -#else - /* transform / motion compensation build reconstruction frame */ - vp8_encode_frame(cpi); - - cpi->projected_frame_size -= vp8_estimate_entropy_savings(cpi); - cpi->projected_frame_size = (cpi->projected_frame_size > 0) ? cpi->projected_frame_size : 0; -#endif - vp8_clear_system_state(); - - /* Test to see if the stats generated for this frame indicate that - * we should have coded a key frame (assuming that we didn't)! - */ - - if (cpi->pass != 2 && cpi->oxcf.auto_key && cm->frame_type != KEY_FRAME - && cpi->compressor_speed != 2) - { -#if !(CONFIG_REALTIME_ONLY) - if (decide_key_frame(cpi)) - { - /* Reset all our sizing numbers and recode */ - cm->frame_type = KEY_FRAME; - - vp8_pick_frame_size(cpi); - - /* Clear the Alt reference frame active flag when we have - * a key frame - */ - cpi->source_alt_ref_active = 0; - - // Set the loop filter deltas and segmentation map update - setup_features(cpi); - - vp8_restore_coding_context(cpi); - - Q = vp8_regulate_q(cpi, cpi->this_frame_target); - - vp8_compute_frame_size_bounds(cpi, &frame_under_shoot_limit, &frame_over_shoot_limit); - - /* Limit Q range for the adaptive loop. */ - bottom_index = cpi->active_best_quality; - top_index = cpi->active_worst_quality; - q_low = cpi->active_best_quality; - q_high = cpi->active_worst_quality; - - loop_count++; - Loop = 1; - - continue; - } -#endif - } - - vp8_clear_system_state(); - - if (frame_over_shoot_limit == 0) - frame_over_shoot_limit = 1; - - /* Are we are overshooting and up against the limit of active max Q. */ - if (((cpi->pass != 2) || (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER)) && - (Q == cpi->active_worst_quality) && - (cpi->active_worst_quality < cpi->worst_quality) && - (cpi->projected_frame_size > frame_over_shoot_limit)) - { - int over_size_percent = ((cpi->projected_frame_size - frame_over_shoot_limit) * 100) / frame_over_shoot_limit; - - /* If so is there any scope for relaxing it */ - while ((cpi->active_worst_quality < cpi->worst_quality) && (over_size_percent > 0)) - { - cpi->active_worst_quality++; - /* Assume 1 qstep = about 4% on frame size. */ - over_size_percent = (int)(over_size_percent * 0.96); - } -#if !(CONFIG_REALTIME_ONLY) - top_index = cpi->active_worst_quality; -#endif - /* If we have updated the active max Q do not call - * vp8_update_rate_correction_factors() this loop. - */ - active_worst_qchanged = 1; - } - else - active_worst_qchanged = 0; - -#if !(CONFIG_REALTIME_ONLY) - /* Special case handling for forced key frames */ - if ( (cm->frame_type == KEY_FRAME) && cpi->this_key_frame_forced ) - { - int last_q = Q; - int kf_err = vp8_calc_ss_err(cpi->Source, - &cm->yv12_fb[cm->new_fb_idx]); - - /* The key frame is not good enough */ - if ( kf_err > ((cpi->ambient_err * 7) >> 3) ) - { - /* Lower q_high */ - q_high = (Q > q_low) ? (Q - 1) : q_low; - - /* Adjust Q */ - Q = (q_high + q_low) >> 1; - } - /* The key frame is much better than the previous frame */ - else if ( kf_err < (cpi->ambient_err >> 1) ) - { - /* Raise q_low */ - q_low = (Q < q_high) ? (Q + 1) : q_high; - - /* Adjust Q */ - Q = (q_high + q_low + 1) >> 1; - } - - /* Clamp Q to upper and lower limits: */ - if (Q > q_high) - Q = q_high; - else if (Q < q_low) - Q = q_low; - - Loop = Q != last_q; - } - - /* Is the projected frame size out of range and are we allowed - * to attempt to recode. - */ - else if ( recode_loop_test( cpi, - frame_over_shoot_limit, frame_under_shoot_limit, - Q, top_index, bottom_index ) ) - { - int last_q = Q; - int Retries = 0; - - /* Frame size out of permitted range. Update correction factor - * & compute new Q to try... - */ - - /* Frame is too large */ - if (cpi->projected_frame_size > cpi->this_frame_target) - { - /* Raise Qlow as to at least the current value */ - q_low = (Q < q_high) ? (Q + 1) : q_high; - - /* If we are using over quant do the same for zbin_oq_low */ - if (cpi->mb.zbin_over_quant > 0) - zbin_oq_low = (cpi->mb.zbin_over_quant < zbin_oq_high) ? - (cpi->mb.zbin_over_quant + 1) : zbin_oq_high; - - if (undershoot_seen) - { - /* Update rate_correction_factor unless - * cpi->active_worst_quality has changed. - */ - if (!active_worst_qchanged) - vp8_update_rate_correction_factors(cpi, 1); - - Q = (q_high + q_low + 1) / 2; - - /* Adjust cpi->zbin_over_quant (only allowed when Q - * is max) - */ - if (Q < MAXQ) - cpi->mb.zbin_over_quant = 0; - else - { - zbin_oq_low = (cpi->mb.zbin_over_quant < zbin_oq_high) ? - (cpi->mb.zbin_over_quant + 1) : zbin_oq_high; - cpi->mb.zbin_over_quant = - (zbin_oq_high + zbin_oq_low) / 2; - } - } - else - { - /* Update rate_correction_factor unless - * cpi->active_worst_quality has changed. - */ - if (!active_worst_qchanged) - vp8_update_rate_correction_factors(cpi, 0); - - Q = vp8_regulate_q(cpi, cpi->this_frame_target); - - while (((Q < q_low) || - (cpi->mb.zbin_over_quant < zbin_oq_low)) && - (Retries < 10)) - { - vp8_update_rate_correction_factors(cpi, 0); - Q = vp8_regulate_q(cpi, cpi->this_frame_target); - Retries ++; - } - } - - overshoot_seen = 1; - } - /* Frame is too small */ - else - { - if (cpi->mb.zbin_over_quant == 0) - /* Lower q_high if not using over quant */ - q_high = (Q > q_low) ? (Q - 1) : q_low; - else - /* else lower zbin_oq_high */ - zbin_oq_high = (cpi->mb.zbin_over_quant > zbin_oq_low) ? - (cpi->mb.zbin_over_quant - 1) : zbin_oq_low; - - if (overshoot_seen) - { - /* Update rate_correction_factor unless - * cpi->active_worst_quality has changed. - */ - if (!active_worst_qchanged) - vp8_update_rate_correction_factors(cpi, 1); - - Q = (q_high + q_low) / 2; - - /* Adjust cpi->zbin_over_quant (only allowed when Q - * is max) - */ - if (Q < MAXQ) - cpi->mb.zbin_over_quant = 0; - else - cpi->mb.zbin_over_quant = - (zbin_oq_high + zbin_oq_low) / 2; - } - else - { - /* Update rate_correction_factor unless - * cpi->active_worst_quality has changed. - */ - if (!active_worst_qchanged) - vp8_update_rate_correction_factors(cpi, 0); - - Q = vp8_regulate_q(cpi, cpi->this_frame_target); - - /* Special case reset for qlow for constrained quality. - * This should only trigger where there is very substantial - * undershoot on a frame and the auto cq level is above - * the user passsed in value. - */ - if ( (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) && - (Q < q_low) ) - { - q_low = Q; - } - - while (((Q > q_high) || - (cpi->mb.zbin_over_quant > zbin_oq_high)) && - (Retries < 10)) - { - vp8_update_rate_correction_factors(cpi, 0); - Q = vp8_regulate_q(cpi, cpi->this_frame_target); - Retries ++; - } - } - - undershoot_seen = 1; - } - - /* Clamp Q to upper and lower limits: */ - if (Q > q_high) - Q = q_high; - else if (Q < q_low) - Q = q_low; - - /* Clamp cpi->zbin_over_quant */ - cpi->mb.zbin_over_quant = (cpi->mb.zbin_over_quant < zbin_oq_low) ? - zbin_oq_low : (cpi->mb.zbin_over_quant > zbin_oq_high) ? - zbin_oq_high : cpi->mb.zbin_over_quant; - - Loop = Q != last_q; - } - else -#endif - Loop = 0; - - if (cpi->is_src_frame_alt_ref) - Loop = 0; - - if (Loop == 1) - { - vp8_restore_coding_context(cpi); - loop_count++; -#if CONFIG_INTERNAL_STATS - cpi->tot_recode_hits++; -#endif - } - } - while (Loop == 1); - -#if 0 - /* Experimental code for lagged and one pass - * Update stats used for one pass GF selection - */ - { - cpi->one_pass_frame_stats[cpi->one_pass_frame_index].frame_coded_error = (double)cpi->prediction_error; - cpi->one_pass_frame_stats[cpi->one_pass_frame_index].frame_intra_error = (double)cpi->intra_error; - cpi->one_pass_frame_stats[cpi->one_pass_frame_index].frame_pcnt_inter = (double)(100 - cpi->this_frame_percent_intra) / 100.0; - } -#endif - - /* Special case code to reduce pulsing when key frames are forced at a - * fixed interval. Note the reconstruction error if it is the frame before - * the force key frame - */ - if ( cpi->next_key_frame_forced && (cpi->twopass.frames_to_key == 0) ) - { - cpi->ambient_err = vp8_calc_ss_err(cpi->Source, - &cm->yv12_fb[cm->new_fb_idx]); - } - - /* This frame's MVs are saved and will be used in next frame's MV predictor. - * Last frame has one more line(add to bottom) and one more column(add to - * right) than cm->mip. The edge elements are initialized to 0. - */ -#if CONFIG_MULTI_RES_ENCODING - if(!cpi->oxcf.mr_encoder_id && cm->show_frame) -#else - if(cm->show_frame) /* do not save for altref frame */ -#endif - { - int mb_row; - int mb_col; - /* Point to beginning of allocated MODE_INFO arrays. */ - MODE_INFO *tmp = cm->mip; - - if(cm->frame_type != KEY_FRAME) - { - for (mb_row = 0; mb_row < cm->mb_rows+1; mb_row ++) - { - for (mb_col = 0; mb_col < cm->mb_cols+1; mb_col ++) - { - if(tmp->mbmi.ref_frame != INTRA_FRAME) - cpi->lfmv[mb_col + mb_row*(cm->mode_info_stride+1)].as_int = tmp->mbmi.mv.as_int; - - cpi->lf_ref_frame_sign_bias[mb_col + mb_row*(cm->mode_info_stride+1)] = cm->ref_frame_sign_bias[tmp->mbmi.ref_frame]; - cpi->lf_ref_frame[mb_col + mb_row*(cm->mode_info_stride+1)] = tmp->mbmi.ref_frame; - tmp++; - } - } - } - } - - /* Count last ref frame 0,0 usage on current encoded frame. */ - { - int mb_row; - int mb_col; - /* Point to beginning of MODE_INFO arrays. */ - MODE_INFO *tmp = cm->mi; - - cpi->zeromv_count = 0; - - if(cm->frame_type != KEY_FRAME) - { - for (mb_row = 0; mb_row < cm->mb_rows; mb_row ++) - { - for (mb_col = 0; mb_col < cm->mb_cols; mb_col ++) - { - if (tmp->mbmi.mode == ZEROMV && - tmp->mbmi.ref_frame == LAST_FRAME) - cpi->zeromv_count++; - tmp++; - } - tmp++; - } - } - } - -#if CONFIG_MULTI_RES_ENCODING - vp8_cal_dissimilarity(cpi); -#endif - - /* Update the GF useage maps. - * This is done after completing the compression of a frame when all - * modes etc. are finalized but before loop filter - */ - if (cpi->oxcf.number_of_layers == 1) - vp8_update_gf_useage_maps(cpi, cm, &cpi->mb); - - if (cm->frame_type == KEY_FRAME) - cm->refresh_last_frame = 1; - -#if 0 - { - FILE *f = fopen("gfactive.stt", "a"); - fprintf(f, "%8d %8d %8d %8d %8d\n", cm->current_video_frame, (100 * cpi->gf_active_count) / (cpi->common.mb_rows * cpi->common.mb_cols), cpi->this_iiratio, cpi->next_iiratio, cm->refresh_golden_frame); - fclose(f); - } -#endif - - /* For inter frames the current default behavior is that when - * cm->refresh_golden_frame is set we copy the old GF over to the ARF buffer - * This is purely an encoder decision at present. - */ - if (!cpi->oxcf.error_resilient_mode && cm->refresh_golden_frame) - cm->copy_buffer_to_arf = 2; - else - cm->copy_buffer_to_arf = 0; - - cm->frame_to_show = &cm->yv12_fb[cm->new_fb_idx]; - -#if CONFIG_TEMPORAL_DENOISING - // Get some measure of the amount of noise, by measuring the (partial) mse - // between source and denoised buffer, for y channel. Partial refers to - // computing the sse for a sub-sample of the frame (i.e., skip x blocks along row/column), - // and only for blocks in that set that are consecutive ZEROMV_LAST mode. - // Do this every ~8 frames, to further reduce complexity. - // TODO(marpan): Keep this for now for the case cpi->oxcf.noise_sensitivity < 4, - // should be removed in favor of the process_denoiser_mode_change() function below. - if (cpi->oxcf.noise_sensitivity > 0 && - cpi->oxcf.noise_sensitivity < 4 && - !cpi->oxcf.screen_content_mode && - cpi->frames_since_key%8 == 0 && - cm->frame_type != KEY_FRAME) { - cpi->mse_source_denoised = measure_square_diff_partial( - &cpi->denoiser.yv12_running_avg[INTRA_FRAME], cpi->Source, cpi); - } - - // For the adaptive denoising mode (noise_sensitivity == 4), sample the mse - // of source diff (between current and previous frame), and determine if we - // should switch the denoiser mode. Sampling refers to computing the mse for - // a sub-sample of the frame (i.e., skip x blocks along row/column), and - // only for blocks in that set that have used ZEROMV LAST, along with some - // constraint on the sum diff between blocks. This process is called every - // ~8 frames, to further reduce complexity. - if (cpi->oxcf.noise_sensitivity == 4 && - !cpi->oxcf.screen_content_mode && - cpi->frames_since_key % 8 == 0 && - cm->frame_type != KEY_FRAME) { - process_denoiser_mode_change(cpi); - } -#endif - -#if CONFIG_MULTITHREAD - if (cpi->b_multi_threaded) - { - /* start loopfilter in separate thread */ - sem_post(&cpi->h_event_start_lpf); - cpi->b_lpf_running = 1; - } - else -#endif - { - vp8_loopfilter_frame(cpi, cm); - } - - update_reference_frames(cpi); - -#ifdef OUTPUT_YUV_DENOISED - vp8_write_yuv_frame(yuv_denoised_file, - &cpi->denoiser.yv12_running_avg[INTRA_FRAME]); -#endif - -#if !(CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING) - if (cpi->oxcf.error_resilient_mode) - { - cm->refresh_entropy_probs = 0; - } -#endif - -#if CONFIG_MULTITHREAD - /* wait that filter_level is picked so that we can continue with stream packing */ - if (cpi->b_multi_threaded) - sem_wait(&cpi->h_event_end_lpf); -#endif - - /* build the bitstream */ - vp8_pack_bitstream(cpi, dest, dest_end, size); - -#if CONFIG_MULTITHREAD - /* if PSNR packets are generated we have to wait for the lpf */ - if (cpi->b_lpf_running && cpi->b_calculate_psnr) - { - sem_wait(&cpi->h_event_end_lpf); - cpi->b_lpf_running = 0; - } -#endif - - /* Move storing frame_type out of the above loop since it is also - * needed in motion search besides loopfilter */ - cm->last_frame_type = cm->frame_type; - - /* Update rate control heuristics */ - cpi->total_byte_count += (*size); - cpi->projected_frame_size = (*size) << 3; - - if (cpi->oxcf.number_of_layers > 1) - { - unsigned int i; - for (i=cpi->current_layer+1; ioxcf.number_of_layers; i++) - cpi->layer_context[i].total_byte_count += (*size); - } - - if (!active_worst_qchanged) - vp8_update_rate_correction_factors(cpi, 2); - - cpi->last_q[cm->frame_type] = cm->base_qindex; - - if (cm->frame_type == KEY_FRAME) - { - vp8_adjust_key_frame_context(cpi); - } - - /* Keep a record of ambient average Q. */ - if (cm->frame_type != KEY_FRAME) - cpi->avg_frame_qindex = (2 + 3 * cpi->avg_frame_qindex + cm->base_qindex) >> 2; - - /* Keep a record from which we can calculate the average Q excluding - * GF updates and key frames - */ - if ((cm->frame_type != KEY_FRAME) && ((cpi->oxcf.number_of_layers > 1) || - (!cm->refresh_golden_frame && !cm->refresh_alt_ref_frame))) - { - cpi->ni_frames++; - - /* Calculate the average Q for normal inter frames (not key or GFU - * frames). - */ - if ( cpi->pass == 2 ) - { - cpi->ni_tot_qi += Q; - cpi->ni_av_qi = (cpi->ni_tot_qi / cpi->ni_frames); - } - else - { - /* Damp value for first few frames */ - if (cpi->ni_frames > 150 ) - { - cpi->ni_tot_qi += Q; - cpi->ni_av_qi = (cpi->ni_tot_qi / cpi->ni_frames); - } - /* For one pass, early in the clip ... average the current frame Q - * value with the worstq entered by the user as a dampening measure - */ - else - { - cpi->ni_tot_qi += Q; - cpi->ni_av_qi = ((cpi->ni_tot_qi / cpi->ni_frames) + cpi->worst_quality + 1) / 2; - } - - /* If the average Q is higher than what was used in the last - * frame (after going through the recode loop to keep the frame - * size within range) then use the last frame value - 1. The -1 - * is designed to stop Q and hence the data rate, from - * progressively falling away during difficult sections, but at - * the same time reduce the number of itterations around the - * recode loop. - */ - if (Q > cpi->ni_av_qi) - cpi->ni_av_qi = Q - 1; - } - } - - /* Update the buffer level variable. */ - /* Non-viewable frames are a special case and are treated as pure overhead. */ - if ( !cm->show_frame ) - cpi->bits_off_target -= cpi->projected_frame_size; - else - cpi->bits_off_target += cpi->av_per_frame_bandwidth - cpi->projected_frame_size; - - /* Clip the buffer level to the maximum specified buffer size */ - if (cpi->bits_off_target > cpi->oxcf.maximum_buffer_size) - cpi->bits_off_target = cpi->oxcf.maximum_buffer_size; - - // If the frame dropper is not enabled, don't let the buffer level go below - // some threshold, given here by -|maximum_buffer_size|. For now we only do - // this for screen content input. - if (cpi->drop_frames_allowed == 0 && cpi->oxcf.screen_content_mode && - cpi->bits_off_target < -cpi->oxcf.maximum_buffer_size) - cpi->bits_off_target = -cpi->oxcf.maximum_buffer_size; - - /* Rolling monitors of whether we are over or underspending used to - * help regulate min and Max Q in two pass. - */ - cpi->rolling_target_bits = ((cpi->rolling_target_bits * 3) + cpi->this_frame_target + 2) / 4; - cpi->rolling_actual_bits = ((cpi->rolling_actual_bits * 3) + cpi->projected_frame_size + 2) / 4; - cpi->long_rolling_target_bits = ((cpi->long_rolling_target_bits * 31) + cpi->this_frame_target + 16) / 32; - cpi->long_rolling_actual_bits = ((cpi->long_rolling_actual_bits * 31) + cpi->projected_frame_size + 16) / 32; - - /* Actual bits spent */ - cpi->total_actual_bits += cpi->projected_frame_size; - - /* Debug stats */ - cpi->total_target_vs_actual += (cpi->this_frame_target - cpi->projected_frame_size); - - cpi->buffer_level = cpi->bits_off_target; - - /* Propagate values to higher temporal layers */ - if (cpi->oxcf.number_of_layers > 1) - { - unsigned int i; - - for (i=cpi->current_layer+1; ioxcf.number_of_layers; i++) - { - LAYER_CONTEXT *lc = &cpi->layer_context[i]; - int bits_off_for_this_layer = - (int)(lc->target_bandwidth / lc->framerate - - cpi->projected_frame_size); - - lc->bits_off_target += bits_off_for_this_layer; - - /* Clip buffer level to maximum buffer size for the layer */ - if (lc->bits_off_target > lc->maximum_buffer_size) - lc->bits_off_target = lc->maximum_buffer_size; - - lc->total_actual_bits += cpi->projected_frame_size; - lc->total_target_vs_actual += bits_off_for_this_layer; - lc->buffer_level = lc->bits_off_target; - } - } - - /* Update bits left to the kf and gf groups to account for overshoot - * or undershoot on these frames - */ - if (cm->frame_type == KEY_FRAME) - { - cpi->twopass.kf_group_bits += cpi->this_frame_target - cpi->projected_frame_size; - - if (cpi->twopass.kf_group_bits < 0) - cpi->twopass.kf_group_bits = 0 ; - } - else if (cm->refresh_golden_frame || cm->refresh_alt_ref_frame) - { - cpi->twopass.gf_group_bits += cpi->this_frame_target - cpi->projected_frame_size; - - if (cpi->twopass.gf_group_bits < 0) - cpi->twopass.gf_group_bits = 0 ; - } - - if (cm->frame_type != KEY_FRAME) - { - if (cpi->common.refresh_alt_ref_frame) - { - cpi->last_skip_false_probs[2] = cpi->prob_skip_false; - cpi->last_skip_probs_q[2] = cm->base_qindex; - } - else if (cpi->common.refresh_golden_frame) - { - cpi->last_skip_false_probs[1] = cpi->prob_skip_false; - cpi->last_skip_probs_q[1] = cm->base_qindex; - } - else - { - cpi->last_skip_false_probs[0] = cpi->prob_skip_false; - cpi->last_skip_probs_q[0] = cm->base_qindex; - - /* update the baseline */ - cpi->base_skip_false_prob[cm->base_qindex] = cpi->prob_skip_false; - - } - } - -#if 0 && CONFIG_INTERNAL_STATS - { - FILE *f = fopen("tmp.stt", "a"); - - vp8_clear_system_state(); - - if (cpi->twopass.total_left_stats.coded_error != 0.0) - fprintf(f, "%10d %10d %10d %10d %10d %10"PRId64" %10"PRId64 - "%10"PRId64" %10d %6d %6d %6d %6d %5d %5d %5d %8d " - "%8.2lf %"PRId64" %10.3lf %10"PRId64" %8d\n", - cpi->common.current_video_frame, cpi->this_frame_target, - cpi->projected_frame_size, - (cpi->projected_frame_size - cpi->this_frame_target), - cpi->total_target_vs_actual, - cpi->buffer_level, - (cpi->oxcf.starting_buffer_level-cpi->bits_off_target), - cpi->total_actual_bits, cm->base_qindex, - cpi->active_best_quality, cpi->active_worst_quality, - cpi->ni_av_qi, cpi->cq_target_quality, - cm->refresh_golden_frame, cm->refresh_alt_ref_frame, - cm->frame_type, cpi->gfu_boost, - cpi->twopass.est_max_qcorrection_factor, - cpi->twopass.bits_left, - cpi->twopass.total_left_stats.coded_error, - (double)cpi->twopass.bits_left / - cpi->twopass.total_left_stats.coded_error, - cpi->tot_recode_hits); - else - fprintf(f, "%10d %10d %10d %10d %10d %10"PRId64" %10"PRId64 - "%10"PRId64" %10d %6d %6d %6d %6d %5d %5d %5d %8d " - "%8.2lf %"PRId64" %10.3lf %8d\n", - cpi->common.current_video_frame, cpi->this_frame_target, - cpi->projected_frame_size, - (cpi->projected_frame_size - cpi->this_frame_target), - cpi->total_target_vs_actual, - cpi->buffer_level, - (cpi->oxcf.starting_buffer_level-cpi->bits_off_target), - cpi->total_actual_bits, cm->base_qindex, - cpi->active_best_quality, cpi->active_worst_quality, - cpi->ni_av_qi, cpi->cq_target_quality, - cm->refresh_golden_frame, cm->refresh_alt_ref_frame, - cm->frame_type, cpi->gfu_boost, - cpi->twopass.est_max_qcorrection_factor, - cpi->twopass.bits_left, - cpi->twopass.total_left_stats.coded_error, - cpi->tot_recode_hits); - - fclose(f); - - { - FILE *fmodes = fopen("Modes.stt", "a"); - - fprintf(fmodes, "%6d:%1d:%1d:%1d ", - cpi->common.current_video_frame, - cm->frame_type, cm->refresh_golden_frame, - cm->refresh_alt_ref_frame); - - fprintf(fmodes, "\n"); - - fclose(fmodes); - } - } - -#endif - - if (cm->refresh_golden_frame == 1) - cm->frame_flags = cm->frame_flags | FRAMEFLAGS_GOLDEN; - else - cm->frame_flags = cm->frame_flags&~FRAMEFLAGS_GOLDEN; - - if (cm->refresh_alt_ref_frame == 1) - cm->frame_flags = cm->frame_flags | FRAMEFLAGS_ALTREF; - else - cm->frame_flags = cm->frame_flags&~FRAMEFLAGS_ALTREF; - - - if (cm->refresh_last_frame & cm->refresh_golden_frame) - /* both refreshed */ - cpi->gold_is_last = 1; - else if (cm->refresh_last_frame ^ cm->refresh_golden_frame) - /* 1 refreshed but not the other */ - cpi->gold_is_last = 0; - - if (cm->refresh_last_frame & cm->refresh_alt_ref_frame) - /* both refreshed */ - cpi->alt_is_last = 1; - else if (cm->refresh_last_frame ^ cm->refresh_alt_ref_frame) - /* 1 refreshed but not the other */ - cpi->alt_is_last = 0; - - if (cm->refresh_alt_ref_frame & cm->refresh_golden_frame) - /* both refreshed */ - cpi->gold_is_alt = 1; - else if (cm->refresh_alt_ref_frame ^ cm->refresh_golden_frame) - /* 1 refreshed but not the other */ - cpi->gold_is_alt = 0; - - cpi->ref_frame_flags = VP8_ALTR_FRAME | VP8_GOLD_FRAME | VP8_LAST_FRAME; - - if (cpi->gold_is_last) - cpi->ref_frame_flags &= ~VP8_GOLD_FRAME; - - if (cpi->alt_is_last) - cpi->ref_frame_flags &= ~VP8_ALTR_FRAME; - - if (cpi->gold_is_alt) - cpi->ref_frame_flags &= ~VP8_ALTR_FRAME; - - - if (!cpi->oxcf.error_resilient_mode) - { - if (cpi->oxcf.play_alternate && cm->refresh_alt_ref_frame && (cm->frame_type != KEY_FRAME)) - /* Update the alternate reference frame stats as appropriate. */ - update_alt_ref_frame_stats(cpi); - else - /* Update the Golden frame stats as appropriate. */ - update_golden_frame_stats(cpi); - } - - if (cm->frame_type == KEY_FRAME) - { - /* Tell the caller that the frame was coded as a key frame */ - *frame_flags = cm->frame_flags | FRAMEFLAGS_KEY; - - /* As this frame is a key frame the next defaults to an inter frame. */ - cm->frame_type = INTER_FRAME; - - cpi->last_frame_percent_intra = 100; - } - else - { - *frame_flags = cm->frame_flags&~FRAMEFLAGS_KEY; - - cpi->last_frame_percent_intra = cpi->this_frame_percent_intra; - } - - /* Clear the one shot update flags for segmentation map and mode/ref - * loop filter deltas. - */ - cpi->mb.e_mbd.update_mb_segmentation_map = 0; - cpi->mb.e_mbd.update_mb_segmentation_data = 0; - cpi->mb.e_mbd.mode_ref_lf_delta_update = 0; - - - /* Dont increment frame counters if this was an altref buffer update - * not a real frame - */ - if (cm->show_frame) - { - cm->current_video_frame++; - cpi->frames_since_key++; - cpi->temporal_pattern_counter++; - } - - /* reset to normal state now that we are done. */ - - - -#if 0 - { - char filename[512]; - FILE *recon_file; - sprintf(filename, "enc%04d.yuv", (int) cm->current_video_frame); - recon_file = fopen(filename, "wb"); - fwrite(cm->yv12_fb[cm->lst_fb_idx].buffer_alloc, - cm->yv12_fb[cm->lst_fb_idx].frame_size, 1, recon_file); - fclose(recon_file); - } -#endif - - /* DEBUG */ - /* vp8_write_yuv_frame("encoder_recon.yuv", cm->frame_to_show); */ - - -} -#if !(CONFIG_REALTIME_ONLY) -static void Pass2Encode(VP8_COMP *cpi, unsigned long *size, unsigned char *dest, unsigned char * dest_end, unsigned int *frame_flags) -{ - - if (!cpi->common.refresh_alt_ref_frame) - vp8_second_pass(cpi); - - encode_frame_to_data_rate(cpi, size, dest, dest_end, frame_flags); - cpi->twopass.bits_left -= 8 * *size; - - if (!cpi->common.refresh_alt_ref_frame) - { - double two_pass_min_rate = (double)(cpi->oxcf.target_bandwidth - *cpi->oxcf.two_pass_vbrmin_section / 100); - cpi->twopass.bits_left += (int64_t)(two_pass_min_rate / cpi->framerate); - } -} -#endif - -int vp8_receive_raw_frame(VP8_COMP *cpi, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, int64_t time_stamp, int64_t end_time) -{ - struct vpx_usec_timer timer; - int res = 0; - - vpx_usec_timer_start(&timer); - - /* Reinit the lookahead buffer if the frame size changes */ - if (sd->y_width != cpi->oxcf.Width || sd->y_height != cpi->oxcf.Height) - { - assert(cpi->oxcf.lag_in_frames < 2); - dealloc_raw_frame_buffers(cpi); - alloc_raw_frame_buffers(cpi); - } - - if(vp8_lookahead_push(cpi->lookahead, sd, time_stamp, end_time, - frame_flags, cpi->active_map_enabled ? cpi->active_map : NULL)) - res = -1; - vpx_usec_timer_mark(&timer); - cpi->time_receive_data += vpx_usec_timer_elapsed(&timer); - - return res; -} - - -static int frame_is_reference(const VP8_COMP *cpi) -{ - const VP8_COMMON *cm = &cpi->common; - const MACROBLOCKD *xd = &cpi->mb.e_mbd; - - return cm->frame_type == KEY_FRAME || cm->refresh_last_frame - || cm->refresh_golden_frame || cm->refresh_alt_ref_frame - || cm->copy_buffer_to_gf || cm->copy_buffer_to_arf - || cm->refresh_entropy_probs - || xd->mode_ref_lf_delta_update - || xd->update_mb_segmentation_map || xd->update_mb_segmentation_data; -} - - -int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned long *size, unsigned char *dest, unsigned char *dest_end, int64_t *time_stamp, int64_t *time_end, int flush) -{ - VP8_COMMON *cm; - struct vpx_usec_timer tsctimer; - struct vpx_usec_timer ticktimer; - struct vpx_usec_timer cmptimer; - YV12_BUFFER_CONFIG *force_src_buffer = NULL; - - if (!cpi) - return -1; - - cm = &cpi->common; - - if (setjmp(cpi->common.error.jmp)) - { - cpi->common.error.setjmp = 0; - vp8_clear_system_state(); - return VPX_CODEC_CORRUPT_FRAME; - } - - cpi->common.error.setjmp = 1; - - vpx_usec_timer_start(&cmptimer); - - cpi->source = NULL; - -#if !(CONFIG_REALTIME_ONLY) - /* Should we code an alternate reference frame */ - if (cpi->oxcf.error_resilient_mode == 0 && - cpi->oxcf.play_alternate && - cpi->source_alt_ref_pending) - { - if ((cpi->source = vp8_lookahead_peek(cpi->lookahead, - cpi->frames_till_gf_update_due, - PEEK_FORWARD))) - { - cpi->alt_ref_source = cpi->source; - if (cpi->oxcf.arnr_max_frames > 0) - { - vp8_temporal_filter_prepare_c(cpi, - cpi->frames_till_gf_update_due); - force_src_buffer = &cpi->alt_ref_buffer; - } - cpi->frames_till_alt_ref_frame = cpi->frames_till_gf_update_due; - cm->refresh_alt_ref_frame = 1; - cm->refresh_golden_frame = 0; - cm->refresh_last_frame = 0; - cm->show_frame = 0; - /* Clear Pending alt Ref flag. */ - cpi->source_alt_ref_pending = 0; - cpi->is_src_frame_alt_ref = 0; - } - } -#endif - - if (!cpi->source) - { - /* Read last frame source if we are encoding first pass. */ - if (cpi->pass == 1 && cm->current_video_frame > 0) - { - if((cpi->last_source = vp8_lookahead_peek(cpi->lookahead, 1, - PEEK_BACKWARD)) == NULL) - return -1; - } - - - if ((cpi->source = vp8_lookahead_pop(cpi->lookahead, flush))) - { - cm->show_frame = 1; - - cpi->is_src_frame_alt_ref = cpi->alt_ref_source - && (cpi->source == cpi->alt_ref_source); - - if(cpi->is_src_frame_alt_ref) - cpi->alt_ref_source = NULL; - } - } - - if (cpi->source) - { - cpi->Source = force_src_buffer ? force_src_buffer : &cpi->source->img; - cpi->un_scaled_source = cpi->Source; - *time_stamp = cpi->source->ts_start; - *time_end = cpi->source->ts_end; - *frame_flags = cpi->source->flags; - - if (cpi->pass == 1 && cm->current_video_frame > 0) - { - cpi->last_frame_unscaled_source = &cpi->last_source->img; - } - } - else - { - *size = 0; -#if !(CONFIG_REALTIME_ONLY) - - if (flush && cpi->pass == 1 && !cpi->twopass.first_pass_done) - { - vp8_end_first_pass(cpi); /* get last stats packet */ - cpi->twopass.first_pass_done = 1; - } - -#endif - - return -1; - } - - if (cpi->source->ts_start < cpi->first_time_stamp_ever) - { - cpi->first_time_stamp_ever = cpi->source->ts_start; - cpi->last_end_time_stamp_seen = cpi->source->ts_start; - } - - /* adjust frame rates based on timestamps given */ - if (cm->show_frame) - { - int64_t this_duration; - int step = 0; - - if (cpi->source->ts_start == cpi->first_time_stamp_ever) - { - this_duration = cpi->source->ts_end - cpi->source->ts_start; - step = 1; - } - else - { - int64_t last_duration; - - this_duration = cpi->source->ts_end - cpi->last_end_time_stamp_seen; - last_duration = cpi->last_end_time_stamp_seen - - cpi->last_time_stamp_seen; - /* do a step update if the duration changes by 10% */ - if (last_duration) - step = (int)(((this_duration - last_duration) * - 10 / last_duration)); - } - - if (this_duration) - { - if (step) - cpi->ref_framerate = 10000000.0 / this_duration; - else - { - double avg_duration, interval; - - /* Average this frame's rate into the last second's average - * frame rate. If we haven't seen 1 second yet, then average - * over the whole interval seen. - */ - interval = (double)(cpi->source->ts_end - - cpi->first_time_stamp_ever); - if(interval > 10000000.0) - interval = 10000000; - - avg_duration = 10000000.0 / cpi->ref_framerate; - avg_duration *= (interval - avg_duration + this_duration); - avg_duration /= interval; - - cpi->ref_framerate = 10000000.0 / avg_duration; - } -#if CONFIG_MULTI_RES_ENCODING - if (cpi->oxcf.mr_total_resolutions > 1) { - LOWER_RES_FRAME_INFO* low_res_frame_info = (LOWER_RES_FRAME_INFO*) - cpi->oxcf.mr_low_res_mode_info; - // Frame rate should be the same for all spatial layers in - // multi-res-encoding (simulcast), so we constrain the frame for - // higher layers to be that of lowest resolution. This is needed - // as he application may decide to skip encoding a high layer and - // then start again, in which case a big jump in time-stamps will - // be received for that high layer, which will yield an incorrect - // frame rate (from time-stamp adjustment in above calculation). - if (cpi->oxcf.mr_encoder_id) { - cpi->ref_framerate = low_res_frame_info->low_res_framerate; - } - else { - // Keep track of frame rate for lowest resolution. - low_res_frame_info->low_res_framerate = cpi->ref_framerate; - } - } -#endif - if (cpi->oxcf.number_of_layers > 1) - { - unsigned int i; - - /* Update frame rates for each layer */ - assert(cpi->oxcf.number_of_layers <= VPX_TS_MAX_LAYERS); - for (i = 0; i < cpi->oxcf.number_of_layers && - i < VPX_TS_MAX_LAYERS; ++i) - { - LAYER_CONTEXT *lc = &cpi->layer_context[i]; - lc->framerate = cpi->ref_framerate / - cpi->oxcf.rate_decimator[i]; - } - } - else - vp8_new_framerate(cpi, cpi->ref_framerate); - } - - cpi->last_time_stamp_seen = cpi->source->ts_start; - cpi->last_end_time_stamp_seen = cpi->source->ts_end; - } - - if (cpi->oxcf.number_of_layers > 1) - { - int layer; - - update_layer_contexts (cpi); - - /* Restore layer specific context & set frame rate */ - if (cpi->temporal_layer_id >= 0) { - layer = cpi->temporal_layer_id; - } else { - layer = cpi->oxcf.layer_id[ - cpi->temporal_pattern_counter % cpi->oxcf.periodicity]; - } - restore_layer_context (cpi, layer); - vp8_new_framerate(cpi, cpi->layer_context[layer].framerate); - } - - if (cpi->compressor_speed == 2) - { - vpx_usec_timer_start(&tsctimer); - vpx_usec_timer_start(&ticktimer); - } - - cpi->lf_zeromv_pct = (cpi->zeromv_count * 100)/cm->MBs; - -#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING - { - int i; - const int num_part = (1 << cm->multi_token_partition); - /* the available bytes in dest */ - const unsigned long dest_size = dest_end - dest; - const int tok_part_buff_size = (dest_size * 9) / (10 * num_part); - - unsigned char *dp = dest; - - cpi->partition_d[0] = dp; - dp += dest_size/10; /* reserve 1/10 for control partition */ - cpi->partition_d_end[0] = dp; - - for(i = 0; i < num_part; i++) - { - cpi->partition_d[i + 1] = dp; - dp += tok_part_buff_size; - cpi->partition_d_end[i + 1] = dp; - } - } -#endif - - /* start with a 0 size frame */ - *size = 0; - - /* Clear down mmx registers */ - vp8_clear_system_state(); - - cm->frame_type = INTER_FRAME; - cm->frame_flags = *frame_flags; - -#if 0 - - if (cm->refresh_alt_ref_frame) - { - cm->refresh_golden_frame = 0; - cm->refresh_last_frame = 0; - } - else - { - cm->refresh_golden_frame = 0; - cm->refresh_last_frame = 1; - } - -#endif - /* find a free buffer for the new frame */ - { - int i = 0; - for(; i < NUM_YV12_BUFFERS; i++) - { - if(!cm->yv12_fb[i].flags) - { - cm->new_fb_idx = i; - break; - } - } - - assert(i < NUM_YV12_BUFFERS ); - } -#if !(CONFIG_REALTIME_ONLY) - - if (cpi->pass == 1) - { - Pass1Encode(cpi, size, dest, frame_flags); - } - else if (cpi->pass == 2) - { - Pass2Encode(cpi, size, dest, dest_end, frame_flags); - } - else -#endif - encode_frame_to_data_rate(cpi, size, dest, dest_end, frame_flags); - - if (cpi->compressor_speed == 2) - { - unsigned int duration, duration2; - vpx_usec_timer_mark(&tsctimer); - vpx_usec_timer_mark(&ticktimer); - - duration = (int)(vpx_usec_timer_elapsed(&ticktimer)); - duration2 = (unsigned int)((double)duration / 2); - - if (cm->frame_type != KEY_FRAME) - { - if (cpi->avg_encode_time == 0) - cpi->avg_encode_time = duration; - else - cpi->avg_encode_time = (7 * cpi->avg_encode_time + duration) >> 3; - } - - if (duration2) - { - { - - if (cpi->avg_pick_mode_time == 0) - cpi->avg_pick_mode_time = duration2; - else - cpi->avg_pick_mode_time = (7 * cpi->avg_pick_mode_time + duration2) >> 3; - } - } - - } - - if (cm->refresh_entropy_probs == 0) - { - vpx_memcpy(&cm->fc, &cm->lfc, sizeof(cm->fc)); - } - - /* Save the contexts separately for alt ref, gold and last. */ - /* (TODO jbb -> Optimize this with pointers to avoid extra copies. ) */ - if(cm->refresh_alt_ref_frame) - vpx_memcpy(&cpi->lfc_a, &cm->fc, sizeof(cm->fc)); - - if(cm->refresh_golden_frame) - vpx_memcpy(&cpi->lfc_g, &cm->fc, sizeof(cm->fc)); - - if(cm->refresh_last_frame) - vpx_memcpy(&cpi->lfc_n, &cm->fc, sizeof(cm->fc)); - - /* if its a dropped frame honor the requests on subsequent frames */ - if (*size > 0) - { - cpi->droppable = !frame_is_reference(cpi); - - /* return to normal state */ - cm->refresh_entropy_probs = 1; - cm->refresh_alt_ref_frame = 0; - cm->refresh_golden_frame = 0; - cm->refresh_last_frame = 1; - cm->frame_type = INTER_FRAME; - - } - - /* Save layer specific state */ - if (cpi->oxcf.number_of_layers > 1) - save_layer_context (cpi); - - vpx_usec_timer_mark(&cmptimer); - cpi->time_compress_data += vpx_usec_timer_elapsed(&cmptimer); - - if (cpi->b_calculate_psnr && cpi->pass != 1 && cm->show_frame) - { - generate_psnr_packet(cpi); - } - -#if CONFIG_INTERNAL_STATS - - if (cpi->pass != 1) - { - cpi->bytes += *size; - - if (cm->show_frame) - { - cpi->common.show_frame_mi = cpi->common.mi; - cpi->count ++; - - if (cpi->b_calculate_psnr) - { - uint64_t ye,ue,ve; - double frame_psnr; - YV12_BUFFER_CONFIG *orig = cpi->Source; - YV12_BUFFER_CONFIG *recon = cpi->common.frame_to_show; - unsigned int y_width = cpi->common.Width; - unsigned int y_height = cpi->common.Height; - unsigned int uv_width = (y_width + 1) / 2; - unsigned int uv_height = (y_height + 1) / 2; - int y_samples = y_height * y_width; - int uv_samples = uv_height * uv_width; - int t_samples = y_samples + 2 * uv_samples; - double sq_error; - - ye = calc_plane_error(orig->y_buffer, orig->y_stride, - recon->y_buffer, recon->y_stride, y_width, y_height); - - ue = calc_plane_error(orig->u_buffer, orig->uv_stride, - recon->u_buffer, recon->uv_stride, uv_width, uv_height); - - ve = calc_plane_error(orig->v_buffer, orig->uv_stride, - recon->v_buffer, recon->uv_stride, uv_width, uv_height); - - sq_error = (double)(ye + ue + ve); - - frame_psnr = vpx_sse_to_psnr(t_samples, 255.0, sq_error); - - cpi->total_y += vpx_sse_to_psnr(y_samples, 255.0, (double)ye); - cpi->total_u += vpx_sse_to_psnr(uv_samples, 255.0, (double)ue); - cpi->total_v += vpx_sse_to_psnr(uv_samples, 255.0, (double)ve); - cpi->total_sq_error += sq_error; - cpi->total += frame_psnr; -#if CONFIG_POSTPROC - { - YV12_BUFFER_CONFIG *pp = &cm->post_proc_buffer; - double sq_error2; - double frame_psnr2, frame_ssim2 = 0; - double weight = 0; - - vp8_deblock(cm, cm->frame_to_show, &cm->post_proc_buffer, cm->filter_level * 10 / 6, 1, 0); - vp8_clear_system_state(); - - ye = calc_plane_error(orig->y_buffer, orig->y_stride, - pp->y_buffer, pp->y_stride, y_width, y_height); - - ue = calc_plane_error(orig->u_buffer, orig->uv_stride, - pp->u_buffer, pp->uv_stride, uv_width, uv_height); - - ve = calc_plane_error(orig->v_buffer, orig->uv_stride, - pp->v_buffer, pp->uv_stride, uv_width, uv_height); - - sq_error2 = (double)(ye + ue + ve); - - frame_psnr2 = vpx_sse_to_psnr(t_samples, 255.0, sq_error2); - - cpi->totalp_y += vpx_sse_to_psnr(y_samples, - 255.0, (double)ye); - cpi->totalp_u += vpx_sse_to_psnr(uv_samples, - 255.0, (double)ue); - cpi->totalp_v += vpx_sse_to_psnr(uv_samples, - 255.0, (double)ve); - cpi->total_sq_error2 += sq_error2; - cpi->totalp += frame_psnr2; - - frame_ssim2 = vp8_calc_ssim(cpi->Source, - &cm->post_proc_buffer, 1, &weight); - - cpi->summed_quality += frame_ssim2 * weight; - cpi->summed_weights += weight; - - if (cpi->oxcf.number_of_layers > 1) - { - unsigned int i; - - for (i=cpi->current_layer; - ioxcf.number_of_layers; i++) - { - cpi->frames_in_layer[i]++; - - cpi->bytes_in_layer[i] += *size; - cpi->sum_psnr[i] += frame_psnr; - cpi->sum_psnr_p[i] += frame_psnr2; - cpi->total_error2[i] += sq_error; - cpi->total_error2_p[i] += sq_error2; - cpi->sum_ssim[i] += frame_ssim2 * weight; - cpi->sum_weights[i] += weight; - } - } - } -#endif - } - - if (cpi->b_calculate_ssimg) - { - double y, u, v, frame_all; - frame_all = vp8_calc_ssimg(cpi->Source, cm->frame_to_show, - &y, &u, &v); - - if (cpi->oxcf.number_of_layers > 1) - { - unsigned int i; - - for (i=cpi->current_layer; - ioxcf.number_of_layers; i++) - { - if (!cpi->b_calculate_psnr) - cpi->frames_in_layer[i]++; - - cpi->total_ssimg_y_in_layer[i] += y; - cpi->total_ssimg_u_in_layer[i] += u; - cpi->total_ssimg_v_in_layer[i] += v; - cpi->total_ssimg_all_in_layer[i] += frame_all; - } - } - else - { - cpi->total_ssimg_y += y; - cpi->total_ssimg_u += u; - cpi->total_ssimg_v += v; - cpi->total_ssimg_all += frame_all; - } - } - - } - } - -#if 0 - - if (cpi->common.frame_type != 0 && cpi->common.base_qindex == cpi->oxcf.worst_allowed_q) - { - skiptruecount += cpi->skip_true_count; - skipfalsecount += cpi->skip_false_count; - } - -#endif -#if 0 - - if (cpi->pass != 1) - { - FILE *f = fopen("skip.stt", "a"); - fprintf(f, "frame:%4d flags:%4x Q:%4d P:%4d Size:%5d\n", cpi->common.current_video_frame, *frame_flags, cpi->common.base_qindex, cpi->prob_skip_false, *size); - - if (cpi->is_src_frame_alt_ref == 1) - fprintf(f, "skipcount: %4d framesize: %d\n", cpi->skip_true_count , *size); - - fclose(f); - } - -#endif -#endif - - cpi->common.error.setjmp = 0; - - return 0; -} - -int vp8_get_preview_raw_frame(VP8_COMP *cpi, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *flags) -{ - if (cpi->common.refresh_alt_ref_frame) - return -1; - else - { - int ret; - -#if CONFIG_MULTITHREAD - if(cpi->b_lpf_running) - { - sem_wait(&cpi->h_event_end_lpf); - cpi->b_lpf_running = 0; - } -#endif - -#if CONFIG_POSTPROC - cpi->common.show_frame_mi = cpi->common.mi; - ret = vp8_post_proc_frame(&cpi->common, dest, flags); -#else - (void)flags; - - if (cpi->common.frame_to_show) - { - *dest = *cpi->common.frame_to_show; - dest->y_width = cpi->common.Width; - dest->y_height = cpi->common.Height; - dest->uv_height = cpi->common.Height / 2; - ret = 0; - } - else - { - ret = -1; - } - -#endif - vp8_clear_system_state(); - return ret; - } -} - -int vp8_set_roimap(VP8_COMP *cpi, unsigned char *map, unsigned int rows, unsigned int cols, int delta_q[4], int delta_lf[4], unsigned int threshold[4]) -{ - signed char feature_data[MB_LVL_MAX][MAX_MB_SEGMENTS]; - int internal_delta_q[MAX_MB_SEGMENTS]; - const int range = 63; - int i; - - // This method is currently incompatible with the cyclic refresh method - if ( cpi->cyclic_refresh_mode_enabled ) - return -1; - - // Check number of rows and columns match - if (cpi->common.mb_rows != rows || cpi->common.mb_cols != cols) - return -1; - - // Range check the delta Q values and convert the external Q range values - // to internal ones. - if ( (abs(delta_q[0]) > range) || (abs(delta_q[1]) > range) || - (abs(delta_q[2]) > range) || (abs(delta_q[3]) > range) ) - return -1; - - // Range check the delta lf values - if ( (abs(delta_lf[0]) > range) || (abs(delta_lf[1]) > range) || - (abs(delta_lf[2]) > range) || (abs(delta_lf[3]) > range) ) - return -1; - - if (!map) - { - disable_segmentation(cpi); - return 0; - } - - // Translate the external delta q values to internal values. - for ( i = 0; i < MAX_MB_SEGMENTS; i++ ) - internal_delta_q[i] = - ( delta_q[i] >= 0 ) ? q_trans[delta_q[i]] : -q_trans[-delta_q[i]]; - - /* Set the segmentation Map */ - set_segmentation_map(cpi, map); - - /* Activate segmentation. */ - enable_segmentation(cpi); - - /* Set up the quant segment data */ - feature_data[MB_LVL_ALT_Q][0] = internal_delta_q[0]; - feature_data[MB_LVL_ALT_Q][1] = internal_delta_q[1]; - feature_data[MB_LVL_ALT_Q][2] = internal_delta_q[2]; - feature_data[MB_LVL_ALT_Q][3] = internal_delta_q[3]; - - /* Set up the loop segment data s */ - feature_data[MB_LVL_ALT_LF][0] = delta_lf[0]; - feature_data[MB_LVL_ALT_LF][1] = delta_lf[1]; - feature_data[MB_LVL_ALT_LF][2] = delta_lf[2]; - feature_data[MB_LVL_ALT_LF][3] = delta_lf[3]; - - cpi->segment_encode_breakout[0] = threshold[0]; - cpi->segment_encode_breakout[1] = threshold[1]; - cpi->segment_encode_breakout[2] = threshold[2]; - cpi->segment_encode_breakout[3] = threshold[3]; - - /* Initialise the feature data structure */ - set_segment_data(cpi, &feature_data[0][0], SEGMENT_DELTADATA); - - return 0; -} - -int vp8_set_active_map(VP8_COMP *cpi, unsigned char *map, unsigned int rows, unsigned int cols) -{ - if (rows == cpi->common.mb_rows && cols == cpi->common.mb_cols) - { - if (map) - { - vpx_memcpy(cpi->active_map, map, rows * cols); - cpi->active_map_enabled = 1; - } - else - cpi->active_map_enabled = 0; - - return 0; - } - else - { - return -1 ; - } -} - -int vp8_set_internal_size(VP8_COMP *cpi, VPX_SCALING horiz_mode, VPX_SCALING vert_mode) -{ - if (horiz_mode <= ONETWO) - cpi->common.horiz_scale = horiz_mode; - else - return -1; - - if (vert_mode <= ONETWO) - cpi->common.vert_scale = vert_mode; - else - return -1; - - return 0; -} - - - -int vp8_calc_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest) -{ - int i, j; - int Total = 0; - - unsigned char *src = source->y_buffer; - unsigned char *dst = dest->y_buffer; - - /* Loop through the Y plane raw and reconstruction data summing - * (square differences) - */ - for (i = 0; i < source->y_height; i += 16) - { - for (j = 0; j < source->y_width; j += 16) - { - unsigned int sse; - Total += vp8_mse16x16(src + j, source->y_stride, dst + j, dest->y_stride, &sse); - } - - src += 16 * source->y_stride; - dst += 16 * dest->y_stride; - } - - return Total; -} - - -int vp8_get_quantizer(VP8_COMP *cpi) -{ - return cpi->common.base_qindex; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/onyx_int.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/onyx_int.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/onyx_int.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/onyx_int.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,744 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_ENCODER_ONYX_INT_H_ -#define VP8_ENCODER_ONYX_INT_H_ - -#include -#include "vpx_config.h" -#include "vp8/common/onyx.h" -#include "treewriter.h" -#include "tokenize.h" -#include "vp8/common/onyxc_int.h" -#include "vp8/common/variance.h" -#include "encodemb.h" -#include "quantize.h" -#include "vp8/common/entropy.h" -#include "vp8/common/threading.h" -#include "vpx_ports/mem.h" -#include "vpx/internal/vpx_codec_internal.h" -#include "vpx/vp8.h" -#include "mcomp.h" -#include "vp8/common/findnearmv.h" -#include "lookahead.h" -#if CONFIG_TEMPORAL_DENOISING -#include "vp8/encoder/denoising.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#define MIN_GF_INTERVAL 4 -#define DEFAULT_GF_INTERVAL 7 - -#define KEY_FRAME_CONTEXT 5 - -#define MAX_LAG_BUFFERS (CONFIG_REALTIME_ONLY? 1 : 25) - -#define AF_THRESH 25 -#define AF_THRESH2 100 -#define ARF_DECAY_THRESH 12 - - -#define MIN_THRESHMULT 32 -#define MAX_THRESHMULT 512 - -#define GF_ZEROMV_ZBIN_BOOST 12 -#define LF_ZEROMV_ZBIN_BOOST 6 -#define MV_ZBIN_BOOST 4 -#define ZBIN_OQ_MAX 192 - -#if !(CONFIG_REALTIME_ONLY) -#define VP8_TEMPORAL_ALT_REF 1 -#endif - -typedef struct -{ - int kf_indicated; - unsigned int frames_since_key; - unsigned int frames_since_golden; - int filter_level; - int frames_till_gf_update_due; - int recent_ref_frame_usage[MAX_REF_FRAMES]; - - MV_CONTEXT mvc[2]; - int mvcosts[2][MVvals+1]; - -#ifdef MODE_STATS - int y_modes[5]; - int uv_modes[4]; - int b_modes[10]; - int inter_y_modes[10]; - int inter_uv_modes[4]; - int inter_b_modes[10]; -#endif - - vp8_prob ymode_prob[4], uv_mode_prob[3]; /* interframe intra mode probs */ - vp8_prob kf_ymode_prob[4], kf_uv_mode_prob[3]; /* keyframe "" */ - - int ymode_count[5], uv_mode_count[4]; /* intra MB type cts this frame */ - - int count_mb_ref_frame_usage[MAX_REF_FRAMES]; - - int this_frame_percent_intra; - int last_frame_percent_intra; - - -} CODING_CONTEXT; - -typedef struct -{ - double frame; - double intra_error; - double coded_error; - double ssim_weighted_pred_err; - double pcnt_inter; - double pcnt_motion; - double pcnt_second_ref; - double pcnt_neutral; - double MVr; - double mvr_abs; - double MVc; - double mvc_abs; - double MVrv; - double MVcv; - double mv_in_out_count; - double new_mv_count; - double duration; - double count; -} -FIRSTPASS_STATS; - -typedef struct -{ - int frames_so_far; - double frame_intra_error; - double frame_coded_error; - double frame_pcnt_inter; - double frame_pcnt_motion; - double frame_mvr; - double frame_mvr_abs; - double frame_mvc; - double frame_mvc_abs; - -} ONEPASS_FRAMESTATS; - - -typedef enum -{ - THR_ZERO1 = 0, - THR_DC = 1, - - THR_NEAREST1 = 2, - THR_NEAR1 = 3, - - THR_ZERO2 = 4, - THR_NEAREST2 = 5, - - THR_ZERO3 = 6, - THR_NEAREST3 = 7, - - THR_NEAR2 = 8, - THR_NEAR3 = 9, - - THR_V_PRED = 10, - THR_H_PRED = 11, - THR_TM = 12, - - THR_NEW1 = 13, - THR_NEW2 = 14, - THR_NEW3 = 15, - - THR_SPLIT1 = 16, - THR_SPLIT2 = 17, - THR_SPLIT3 = 18, - - THR_B_PRED = 19 -} -THR_MODES; - -typedef enum -{ - DIAMOND = 0, - NSTEP = 1, - HEX = 2 -} SEARCH_METHODS; - -typedef struct -{ - int RD; - SEARCH_METHODS search_method; - int improved_quant; - int improved_dct; - int auto_filter; - int recode_loop; - int iterative_sub_pixel; - int half_pixel_search; - int quarter_pixel_search; - int thresh_mult[MAX_MODES]; - int max_step_search_steps; - int first_step; - int optimize_coefficients; - - int use_fastquant_for_pick; - int no_skip_block4x4_search; - int improved_mv_pred; - -} SPEED_FEATURES; - -typedef struct -{ - MACROBLOCK mb; - int segment_counts[MAX_MB_SEGMENTS]; - int totalrate; -} MB_ROW_COMP; - -typedef struct -{ - TOKENEXTRA *start; - TOKENEXTRA *stop; -} TOKENLIST; - -typedef struct -{ - int ithread; - void *ptr1; - void *ptr2; -} ENCODETHREAD_DATA; -typedef struct -{ - int ithread; - void *ptr1; -} LPFTHREAD_DATA; - -enum -{ - BLOCK_16X8, - BLOCK_8X16, - BLOCK_8X8, - BLOCK_4X4, - BLOCK_16X16, - BLOCK_MAX_SEGMENTS -}; - -typedef struct -{ - /* Layer configuration */ - double framerate; - int target_bandwidth; - - /* Layer specific coding parameters */ - int64_t starting_buffer_level; - int64_t optimal_buffer_level; - int64_t maximum_buffer_size; - int64_t starting_buffer_level_in_ms; - int64_t optimal_buffer_level_in_ms; - int64_t maximum_buffer_size_in_ms; - - int avg_frame_size_for_layer; - - int64_t buffer_level; - int64_t bits_off_target; - - int64_t total_actual_bits; - int total_target_vs_actual; - - int worst_quality; - int active_worst_quality; - int best_quality; - int active_best_quality; - - int ni_av_qi; - int ni_tot_qi; - int ni_frames; - int avg_frame_qindex; - - double rate_correction_factor; - double key_frame_rate_correction_factor; - double gf_rate_correction_factor; - - int zbin_over_quant; - - int inter_frame_target; - int64_t total_byte_count; - - int filter_level; - - int last_frame_percent_intra; - - int count_mb_ref_frame_usage[MAX_REF_FRAMES]; - -} LAYER_CONTEXT; - -typedef struct VP8_COMP -{ - - DECLARE_ALIGNED(16, short, Y1quant[QINDEX_RANGE][16]); - DECLARE_ALIGNED(16, short, Y1quant_shift[QINDEX_RANGE][16]); - DECLARE_ALIGNED(16, short, Y1zbin[QINDEX_RANGE][16]); - DECLARE_ALIGNED(16, short, Y1round[QINDEX_RANGE][16]); - - DECLARE_ALIGNED(16, short, Y2quant[QINDEX_RANGE][16]); - DECLARE_ALIGNED(16, short, Y2quant_shift[QINDEX_RANGE][16]); - DECLARE_ALIGNED(16, short, Y2zbin[QINDEX_RANGE][16]); - DECLARE_ALIGNED(16, short, Y2round[QINDEX_RANGE][16]); - - DECLARE_ALIGNED(16, short, UVquant[QINDEX_RANGE][16]); - DECLARE_ALIGNED(16, short, UVquant_shift[QINDEX_RANGE][16]); - DECLARE_ALIGNED(16, short, UVzbin[QINDEX_RANGE][16]); - DECLARE_ALIGNED(16, short, UVround[QINDEX_RANGE][16]); - - DECLARE_ALIGNED(16, short, zrun_zbin_boost_y1[QINDEX_RANGE][16]); - DECLARE_ALIGNED(16, short, zrun_zbin_boost_y2[QINDEX_RANGE][16]); - DECLARE_ALIGNED(16, short, zrun_zbin_boost_uv[QINDEX_RANGE][16]); - DECLARE_ALIGNED(16, short, Y1quant_fast[QINDEX_RANGE][16]); - DECLARE_ALIGNED(16, short, Y2quant_fast[QINDEX_RANGE][16]); - DECLARE_ALIGNED(16, short, UVquant_fast[QINDEX_RANGE][16]); - - - MACROBLOCK mb; - VP8_COMMON common; - vp8_writer bc[9]; /* one boolcoder for each partition */ - - VP8_CONFIG oxcf; - - struct lookahead_ctx *lookahead; - struct lookahead_entry *source; - struct lookahead_entry *alt_ref_source; - struct lookahead_entry *last_source; - - YV12_BUFFER_CONFIG *Source; - YV12_BUFFER_CONFIG *un_scaled_source; - YV12_BUFFER_CONFIG scaled_source; - YV12_BUFFER_CONFIG *last_frame_unscaled_source; - - unsigned int frames_till_alt_ref_frame; - /* frame in src_buffers has been identified to be encoded as an alt ref */ - int source_alt_ref_pending; - /* an alt ref frame has been encoded and is usable */ - int source_alt_ref_active; - /* source of frame to encode is an exact copy of an alt ref frame */ - int is_src_frame_alt_ref; - - /* golden frame same as last frame ( short circuit gold searches) */ - int gold_is_last; - /* Alt reference frame same as last ( short circuit altref search) */ - int alt_is_last; - /* don't do both alt and gold search ( just do gold). */ - int gold_is_alt; - - YV12_BUFFER_CONFIG pick_lf_lvl_frame; - - TOKENEXTRA *tok; - unsigned int tok_count; - - - unsigned int frames_since_key; - unsigned int key_frame_frequency; - unsigned int this_key_frame_forced; - unsigned int next_key_frame_forced; - - /* Ambient reconstruction err target for force key frames */ - int ambient_err; - - unsigned int mode_check_freq[MAX_MODES]; - - int rd_baseline_thresh[MAX_MODES]; - - int RDMULT; - int RDDIV ; - - CODING_CONTEXT coding_context; - - /* Rate targetting variables */ - int64_t last_prediction_error; - int64_t last_intra_error; - - int this_frame_target; - int projected_frame_size; - int last_q[2]; /* Separate values for Intra/Inter */ - - double rate_correction_factor; - double key_frame_rate_correction_factor; - double gf_rate_correction_factor; - - unsigned int frames_since_golden; - /* Count down till next GF */ - int frames_till_gf_update_due; - - /* GF interval chosen when we coded the last GF */ - int current_gf_interval; - - /* Total bits overspent becasue of GF boost (cumulative) */ - int gf_overspend_bits; - - /* Used in the few frames following a GF to recover the extra bits - * spent in that GF - */ - int non_gf_bitrate_adjustment; - - /* Extra bits spent on key frames that need to be recovered */ - int kf_overspend_bits; - - /* Current number of bit s to try and recover on each inter frame. */ - int kf_bitrate_adjustment; - int max_gf_interval; - int baseline_gf_interval; - int active_arnr_frames; - - int64_t key_frame_count; - int prior_key_frame_distance[KEY_FRAME_CONTEXT]; - /* Current section per frame bandwidth target */ - int per_frame_bandwidth; - /* Average frame size target for clip */ - int av_per_frame_bandwidth; - /* Minimum allocation that should be used for any frame */ - int min_frame_bandwidth; - int inter_frame_target; - double output_framerate; - int64_t last_time_stamp_seen; - int64_t last_end_time_stamp_seen; - int64_t first_time_stamp_ever; - - int ni_av_qi; - int ni_tot_qi; - int ni_frames; - int avg_frame_qindex; - - int64_t total_byte_count; - - int buffered_mode; - - double framerate; - double ref_framerate; - int64_t buffer_level; - int64_t bits_off_target; - - int rolling_target_bits; - int rolling_actual_bits; - - int long_rolling_target_bits; - int long_rolling_actual_bits; - - int64_t total_actual_bits; - int total_target_vs_actual; /* debug stats */ - - int worst_quality; - int active_worst_quality; - int best_quality; - int active_best_quality; - - int cq_target_quality; - - int drop_frames_allowed; /* Are we permitted to drop frames? */ - int drop_frame; /* Drop this frame? */ - - vp8_prob frame_coef_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES]; - char update_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES]; - - unsigned int frame_branch_ct [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES][2]; - - int gfu_boost; - int kf_boost; - int last_boost; - - int target_bandwidth; - struct vpx_codec_pkt_list *output_pkt_list; - -#if 0 - /* Experimental code for lagged and one pass */ - ONEPASS_FRAMESTATS one_pass_frame_stats[MAX_LAG_BUFFERS]; - int one_pass_frame_index; -#endif - - int decimation_factor; - int decimation_count; - - /* for real time encoding */ - int avg_encode_time; /* microsecond */ - int avg_pick_mode_time; /* microsecond */ - int Speed; - int compressor_speed; - - int auto_gold; - int auto_adjust_gold_quantizer; - int auto_worst_q; - int cpu_used; - int pass; - - - int prob_intra_coded; - int prob_last_coded; - int prob_gf_coded; - int prob_skip_false; - int last_skip_false_probs[3]; - int last_skip_probs_q[3]; - int recent_ref_frame_usage[MAX_REF_FRAMES]; - - int this_frame_percent_intra; - int last_frame_percent_intra; - - int ref_frame_flags; - - SPEED_FEATURES sf; - - /* Count ZEROMV on all reference frames. */ - int zeromv_count; - int lf_zeromv_pct; - - unsigned char *segmentation_map; - signed char segment_feature_data[MB_LVL_MAX][MAX_MB_SEGMENTS]; - int segment_encode_breakout[MAX_MB_SEGMENTS]; - - unsigned char *active_map; - unsigned int active_map_enabled; - - /* Video conferencing cyclic refresh mode flags. This is a mode - * designed to clean up the background over time in live encoding - * scenarious. It uses segmentation. - */ - int cyclic_refresh_mode_enabled; - int cyclic_refresh_mode_max_mbs_perframe; - int cyclic_refresh_mode_index; - int cyclic_refresh_q; - signed char *cyclic_refresh_map; - // Count on how many (consecutive) times a macroblock uses ZER0MV_LAST. - unsigned char *consec_zero_last; - // Counter that is reset when a block is checked for a mode-bias against - // ZEROMV_LASTREF. - unsigned char *consec_zero_last_mvbias; - - // Frame counter for the temporal pattern. Counter is rest when the temporal - // layers are changed dynamically (run-time change). - unsigned int temporal_pattern_counter; - // Temporal layer id. - int temporal_layer_id; - - // Measure of average squared difference between source and denoised signal. - int mse_source_denoised; - -#if CONFIG_MULTITHREAD - /* multithread data */ - int * mt_current_mb_col; - int mt_sync_range; - int b_multi_threaded; - int encoding_thread_count; - int b_lpf_running; - - pthread_t *h_encoding_thread; - pthread_t h_filter_thread; - - MB_ROW_COMP *mb_row_ei; - ENCODETHREAD_DATA *en_thread_data; - LPFTHREAD_DATA lpf_thread_data; - - /* events */ - sem_t *h_event_start_encoding; - sem_t h_event_end_encoding; - sem_t h_event_start_lpf; - sem_t h_event_end_lpf; -#endif - - TOKENLIST *tplist; - unsigned int partition_sz[MAX_PARTITIONS]; - unsigned char *partition_d[MAX_PARTITIONS]; - unsigned char *partition_d_end[MAX_PARTITIONS]; - - - fractional_mv_step_fp *find_fractional_mv_step; - vp8_full_search_fn_t full_search_sad; - vp8_refining_search_fn_t refining_search_sad; - vp8_diamond_search_fn_t diamond_search_sad; - vp8_variance_fn_ptr_t fn_ptr[BLOCK_MAX_SEGMENTS]; - uint64_t time_receive_data; - uint64_t time_compress_data; - uint64_t time_pick_lpf; - uint64_t time_encode_mb_row; - - int base_skip_false_prob[128]; - - FRAME_CONTEXT lfc_n; /* last frame entropy */ - FRAME_CONTEXT lfc_a; /* last alt ref entropy */ - FRAME_CONTEXT lfc_g; /* last gold ref entropy */ - - - struct twopass_rc - { - unsigned int section_intra_rating; - double section_max_qfactor; - unsigned int next_iiratio; - unsigned int this_iiratio; - FIRSTPASS_STATS total_stats; - FIRSTPASS_STATS this_frame_stats; - FIRSTPASS_STATS *stats_in, *stats_in_end, *stats_in_start; - FIRSTPASS_STATS total_left_stats; - int first_pass_done; - int64_t bits_left; - int64_t clip_bits_total; - double avg_iiratio; - double modified_error_total; - double modified_error_used; - double modified_error_left; - double kf_intra_err_min; - double gf_intra_err_min; - int frames_to_key; - int maxq_max_limit; - int maxq_min_limit; - int gf_decay_rate; - int static_scene_max_gf_interval; - int kf_bits; - /* Remaining error from uncoded frames in a gf group. */ - int gf_group_error_left; - /* Projected total bits available for a key frame group of frames */ - int64_t kf_group_bits; - /* Error score of frames still to be coded in kf group */ - int64_t kf_group_error_left; - /* Projected Bits available for a group including 1 GF or ARF */ - int64_t gf_group_bits; - /* Bits for the golden frame or ARF */ - int gf_bits; - int alt_extra_bits; - double est_max_qcorrection_factor; - } twopass; - -#if VP8_TEMPORAL_ALT_REF - YV12_BUFFER_CONFIG alt_ref_buffer; - YV12_BUFFER_CONFIG *frames[MAX_LAG_BUFFERS]; - int fixed_divide[512]; -#endif - -#if CONFIG_INTERNAL_STATS - int count; - double total_y; - double total_u; - double total_v; - double total ; - double total_sq_error; - double totalp_y; - double totalp_u; - double totalp_v; - double totalp; - double total_sq_error2; - int bytes; - double summed_quality; - double summed_weights; - unsigned int tot_recode_hits; - - - double total_ssimg_y; - double total_ssimg_u; - double total_ssimg_v; - double total_ssimg_all; - - int b_calculate_ssimg; -#endif - int b_calculate_psnr; - - /* Per MB activity measurement */ - unsigned int activity_avg; - unsigned int * mb_activity_map; - - /* Record of which MBs still refer to last golden frame either - * directly or through 0,0 - */ - unsigned char *gf_active_flags; - int gf_active_count; - - int output_partition; - - /* Store last frame's MV info for next frame MV prediction */ - int_mv *lfmv; - int *lf_ref_frame_sign_bias; - int *lf_ref_frame; - - /* force next frame to intra when kf_auto says so */ - int force_next_frame_intra; - - int droppable; - - int initial_width; - int initial_height; - -#if CONFIG_TEMPORAL_DENOISING - VP8_DENOISER denoiser; -#endif - - /* Coding layer state variables */ - unsigned int current_layer; - LAYER_CONTEXT layer_context[VPX_TS_MAX_LAYERS]; - - int64_t frames_in_layer[VPX_TS_MAX_LAYERS]; - int64_t bytes_in_layer[VPX_TS_MAX_LAYERS]; - double sum_psnr[VPX_TS_MAX_LAYERS]; - double sum_psnr_p[VPX_TS_MAX_LAYERS]; - double total_error2[VPX_TS_MAX_LAYERS]; - double total_error2_p[VPX_TS_MAX_LAYERS]; - double sum_ssim[VPX_TS_MAX_LAYERS]; - double sum_weights[VPX_TS_MAX_LAYERS]; - - double total_ssimg_y_in_layer[VPX_TS_MAX_LAYERS]; - double total_ssimg_u_in_layer[VPX_TS_MAX_LAYERS]; - double total_ssimg_v_in_layer[VPX_TS_MAX_LAYERS]; - double total_ssimg_all_in_layer[VPX_TS_MAX_LAYERS]; - -#if CONFIG_MULTI_RES_ENCODING - /* Number of MBs per row at lower-resolution level */ - int mr_low_res_mb_cols; - /* Indicate if lower-res mv info is available */ - unsigned char mr_low_res_mv_avail; -#endif - /* The frame number of each reference frames */ - unsigned int current_ref_frames[MAX_REF_FRAMES]; - // Closest reference frame to current frame. - MV_REFERENCE_FRAME closest_reference_frame; - - struct rd_costs_struct - { - int mvcosts[2][MVvals+1]; - int mvsadcosts[2][MVfpvals+1]; - int mbmode_cost[2][MB_MODE_COUNT]; - int intra_uv_mode_cost[2][MB_MODE_COUNT]; - int bmode_costs[10][10][10]; - int inter_bmode_costs[B_MODE_COUNT]; - int token_costs[BLOCK_TYPES][COEF_BANDS] - [PREV_COEF_CONTEXTS][MAX_ENTROPY_TOKENS]; - } rd_costs; -} VP8_COMP; - -void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, - unsigned char *dest_end, unsigned long *size); - -void vp8_tokenize_mb(VP8_COMP *, MACROBLOCK *, TOKENEXTRA **); - -void vp8_set_speed_features(VP8_COMP *cpi); - -#if CONFIG_DEBUG -#define CHECK_MEM_ERROR(lval,expr) do {\ - lval = (expr); \ - if(!lval) \ - vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,\ - "Failed to allocate "#lval" at %s:%d", \ - __FILE__,__LINE__);\ - } while(0) -#else -#define CHECK_MEM_ERROR(lval,expr) do {\ - lval = (expr); \ - if(!lval) \ - vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,\ - "Failed to allocate "#lval);\ - } while(0) -#endif -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_ONYX_INT_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/pickinter.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/pickinter.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/pickinter.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/pickinter.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1578 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include -#include "vpx_config.h" -#include "onyx_int.h" -#include "modecosts.h" -#include "encodeintra.h" -#include "vp8/common/common.h" -#include "vp8/common/entropymode.h" -#include "pickinter.h" -#include "vp8/common/findnearmv.h" -#include "encodemb.h" -#include "vp8/common/reconinter.h" -#include "vp8/common/reconintra4x4.h" -#include "vp8/common/variance.h" -#include "mcomp.h" -#include "rdopt.h" -#include "vpx_mem/vpx_mem.h" -#if CONFIG_TEMPORAL_DENOISING -#include "denoising.h" -#endif - -extern int VP8_UVSSE(MACROBLOCK *x); - -#ifdef SPEEDSTATS -extern unsigned int cnt_pm; -#endif - -extern const int vp8_ref_frame_order[MAX_MODES]; -extern const MB_PREDICTION_MODE vp8_mode_order[MAX_MODES]; - -extern int vp8_cost_mv_ref(MB_PREDICTION_MODE m, const int near_mv_ref_ct[4]); - -// Fixed point implementation of a skin color classifier. Skin color -// is model by a Gaussian distribution in the CbCr color space. -// See ../../test/skin_color_detector_test.cc where the reference -// skin color classifier is defined. - -// Fixed-point skin color model parameters. -static const int skin_mean[2] = {7463, 9614}; // q6 -static const int skin_inv_cov[4] = {4107, 1663, 1663, 2157}; // q16 -static const int skin_threshold = 1570636; // q18 - -// Evaluates the Mahalanobis distance measure for the input CbCr values. -static int evaluate_skin_color_difference(int cb, int cr) -{ - const int cb_q6 = cb << 6; - const int cr_q6 = cr << 6; - const int cb_diff_q12 = (cb_q6 - skin_mean[0]) * (cb_q6 - skin_mean[0]); - const int cbcr_diff_q12 = (cb_q6 - skin_mean[0]) * (cr_q6 - skin_mean[1]); - const int cr_diff_q12 = (cr_q6 - skin_mean[1]) * (cr_q6 - skin_mean[1]); - const int cb_diff_q2 = (cb_diff_q12 + (1 << 9)) >> 10; - const int cbcr_diff_q2 = (cbcr_diff_q12 + (1 << 9)) >> 10; - const int cr_diff_q2 = (cr_diff_q12 + (1 << 9)) >> 10; - const int skin_diff = skin_inv_cov[0] * cb_diff_q2 + - skin_inv_cov[1] * cbcr_diff_q2 + - skin_inv_cov[2] * cbcr_diff_q2 + - skin_inv_cov[3] * cr_diff_q2; - return skin_diff; -} - -static int macroblock_corner_grad(unsigned char* signal, int stride, - int offsetx, int offsety, int sgnx, int sgny) -{ - int y1 = signal[offsetx * stride + offsety]; - int y2 = signal[offsetx * stride + offsety + sgny]; - int y3 = signal[(offsetx + sgnx) * stride + offsety]; - int y4 = signal[(offsetx + sgnx) * stride + offsety + sgny]; - return MAX(MAX(abs(y1 - y2), abs(y1 - y3)), abs(y1 - y4)); -} - -static int check_dot_artifact_candidate(VP8_COMP *cpi, - MACROBLOCK *x, - unsigned char *target_last, - int stride, - unsigned char* last_ref, - int mb_row, - int mb_col, - int channel) -{ - int threshold1 = 6; - int threshold2 = 3; - unsigned int max_num = (cpi->common.MBs) / 10; - int grad_last = 0; - int grad_source = 0; - int index = mb_row * cpi->common.mb_cols + mb_col; - // Threshold for #consecutive (base layer) frames using zero_last mode. - int num_frames = 30; - int shift = 15; - if (channel > 0) { - shift = 7; - } - if (cpi->oxcf.number_of_layers > 1) - { - num_frames = 20; - } - x->zero_last_dot_suppress = 0; - // Blocks on base layer frames that have been using ZEROMV_LAST repeatedly - // (i.e, at least |x| consecutive frames are candidates for increasing the - // rd adjustment for zero_last mode. - // Only allow this for at most |max_num| blocks per frame. - // Don't allow this for screen content input. - if (cpi->current_layer == 0 && - cpi->consec_zero_last_mvbias[index] > num_frames && - x->mbs_zero_last_dot_suppress < max_num && - !cpi->oxcf.screen_content_mode) - { - // If this block is checked here, label it so we don't check it again until - // ~|x| framaes later. - x->zero_last_dot_suppress = 1; - // Dot artifact is noticeable as strong gradient at corners of macroblock, - // for flat areas. As a simple detector for now, we look for a high - // corner gradient on last ref, and a smaller gradient on source. - // Check 4 corners, return if any satisfy condition. - // Top-left: - grad_last = macroblock_corner_grad(last_ref, stride, 0, 0, 1, 1); - grad_source = macroblock_corner_grad(target_last, stride, 0, 0, 1, 1); - if (grad_last >= threshold1 && grad_source <= threshold2) - { - x->mbs_zero_last_dot_suppress++; - return 1; - } - // Top-right: - grad_last = macroblock_corner_grad(last_ref, stride, 0, shift, 1, -1); - grad_source = macroblock_corner_grad(target_last, stride, 0, shift, 1, -1); - if (grad_last >= threshold1 && grad_source <= threshold2) - { - x->mbs_zero_last_dot_suppress++; - return 1; - } - // Bottom-left: - grad_last = macroblock_corner_grad(last_ref, stride, shift, 0, -1, 1); - grad_source = macroblock_corner_grad(target_last, stride, shift, 0, -1, 1); - if (grad_last >= threshold1 && grad_source <= threshold2) - { - x->mbs_zero_last_dot_suppress++; - return 1; - } - // Bottom-right: - grad_last = macroblock_corner_grad(last_ref, stride, shift, shift, -1, -1); - grad_source = macroblock_corner_grad(target_last, stride, shift, shift, -1, -1); - if (grad_last >= threshold1 && grad_source <= threshold2) - { - x->mbs_zero_last_dot_suppress++; - return 1; - } - return 0; - } - return 0; -} - -// Checks if the input yCbCr values corresponds to skin color. -static int is_skin_color(int y, int cb, int cr) -{ - if (y < 40 || y > 220) - { - return 0; - } - return (evaluate_skin_color_difference(cb, cr) < skin_threshold); -} - -int vp8_skip_fractional_mv_step(MACROBLOCK *mb, BLOCK *b, BLOCKD *d, - int_mv *bestmv, int_mv *ref_mv, - int error_per_bit, - const vp8_variance_fn_ptr_t *vfp, - int *mvcost[2], int *distortion, - unsigned int *sse) -{ - (void) b; - (void) d; - (void) ref_mv; - (void) error_per_bit; - (void) vfp; - (void) mb; - (void) mvcost; - (void) distortion; - (void) sse; - bestmv->as_mv.row <<= 3; - bestmv->as_mv.col <<= 3; - return 0; -} - - -int vp8_get_inter_mbpred_error(MACROBLOCK *mb, - const vp8_variance_fn_ptr_t *vfp, - unsigned int *sse, - int_mv this_mv) -{ - - BLOCK *b = &mb->block[0]; - BLOCKD *d = &mb->e_mbd.block[0]; - unsigned char *what = (*(b->base_src) + b->src); - int what_stride = b->src_stride; - int pre_stride = mb->e_mbd.pre.y_stride; - unsigned char *in_what = mb->e_mbd.pre.y_buffer + d->offset ; - int in_what_stride = pre_stride; - int xoffset = this_mv.as_mv.col & 7; - int yoffset = this_mv.as_mv.row & 7; - - in_what += (this_mv.as_mv.row >> 3) * pre_stride + (this_mv.as_mv.col >> 3); - - if (xoffset | yoffset) - { - return vfp->svf(in_what, in_what_stride, xoffset, yoffset, what, what_stride, sse); - } - else - { - return vfp->vf(what, what_stride, in_what, in_what_stride, sse); - } - -} - - -unsigned int vp8_get4x4sse_cs_c -( - const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride -) -{ - int distortion = 0; - int r, c; - - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - int diff = src_ptr[c] - ref_ptr[c]; - distortion += diff * diff; - } - - src_ptr += source_stride; - ref_ptr += recon_stride; - } - - return distortion; -} - -static int get_prediction_error(BLOCK *be, BLOCKD *b) -{ - unsigned char *sptr; - unsigned char *dptr; - sptr = (*(be->base_src) + be->src); - dptr = b->predictor; - - return vp8_get4x4sse_cs(sptr, be->src_stride, dptr, 16); - -} - -static int pick_intra4x4block( - MACROBLOCK *x, - int ib, - B_PREDICTION_MODE *best_mode, - const int *mode_costs, - - int *bestrate, - int *bestdistortion) -{ - - BLOCKD *b = &x->e_mbd.block[ib]; - BLOCK *be = &x->block[ib]; - int dst_stride = x->e_mbd.dst.y_stride; - unsigned char *dst = x->e_mbd.dst.y_buffer + b->offset; - B_PREDICTION_MODE mode; - int best_rd = INT_MAX; - int rate; - int distortion; - - unsigned char *Above = dst - dst_stride; - unsigned char *yleft = dst - 1; - unsigned char top_left = Above[-1]; - - for (mode = B_DC_PRED; mode <= B_HE_PRED; mode++) - { - int this_rd; - - rate = mode_costs[mode]; - - vp8_intra4x4_predict(Above, yleft, dst_stride, mode, - b->predictor, 16, top_left); - distortion = get_prediction_error(be, b); - this_rd = RDCOST(x->rdmult, x->rddiv, rate, distortion); - - if (this_rd < best_rd) - { - *bestrate = rate; - *bestdistortion = distortion; - best_rd = this_rd; - *best_mode = mode; - } - } - - b->bmi.as_mode = *best_mode; - vp8_encode_intra4x4block(x, ib); - return best_rd; -} - - -static int pick_intra4x4mby_modes -( - MACROBLOCK *mb, - int *Rate, - int *best_dist -) -{ - MACROBLOCKD *const xd = &mb->e_mbd; - int i; - int cost = mb->mbmode_cost [xd->frame_type] [B_PRED]; - int error; - int distortion = 0; - const int *bmode_costs; - - intra_prediction_down_copy(xd, xd->dst.y_buffer - xd->dst.y_stride + 16); - - bmode_costs = mb->inter_bmode_costs; - - for (i = 0; i < 16; i++) - { - MODE_INFO *const mic = xd->mode_info_context; - const int mis = xd->mode_info_stride; - - B_PREDICTION_MODE UNINITIALIZED_IS_SAFE(best_mode); - int UNINITIALIZED_IS_SAFE(r), UNINITIALIZED_IS_SAFE(d); - - if (mb->e_mbd.frame_type == KEY_FRAME) - { - const B_PREDICTION_MODE A = above_block_mode(mic, i, mis); - const B_PREDICTION_MODE L = left_block_mode(mic, i); - - bmode_costs = mb->bmode_costs[A][L]; - } - - - pick_intra4x4block(mb, i, &best_mode, bmode_costs, &r, &d); - - cost += r; - distortion += d; - mic->bmi[i].as_mode = best_mode; - - /* Break out case where we have already exceeded best so far value - * that was passed in - */ - if (distortion > *best_dist) - break; - } - - *Rate = cost; - - if (i == 16) - { - *best_dist = distortion; - error = RDCOST(mb->rdmult, mb->rddiv, cost, distortion); - } - else - { - *best_dist = INT_MAX; - error = INT_MAX; - } - - return error; -} - -static void pick_intra_mbuv_mode(MACROBLOCK *mb) -{ - - MACROBLOCKD *x = &mb->e_mbd; - unsigned char *uabove_row = x->dst.u_buffer - x->dst.uv_stride; - unsigned char *vabove_row = x->dst.v_buffer - x->dst.uv_stride; - unsigned char *usrc_ptr = (mb->block[16].src + *mb->block[16].base_src); - unsigned char *vsrc_ptr = (mb->block[20].src + *mb->block[20].base_src); - int uvsrc_stride = mb->block[16].src_stride; - unsigned char uleft_col[8]; - unsigned char vleft_col[8]; - unsigned char utop_left = uabove_row[-1]; - unsigned char vtop_left = vabove_row[-1]; - int i, j; - int expected_udc; - int expected_vdc; - int shift; - int Uaverage = 0; - int Vaverage = 0; - int diff; - int pred_error[4] = {0, 0, 0, 0}, best_error = INT_MAX; - MB_PREDICTION_MODE UNINITIALIZED_IS_SAFE(best_mode); - - - for (i = 0; i < 8; i++) - { - uleft_col[i] = x->dst.u_buffer [i* x->dst.uv_stride -1]; - vleft_col[i] = x->dst.v_buffer [i* x->dst.uv_stride -1]; - } - - if (!x->up_available && !x->left_available) - { - expected_udc = 128; - expected_vdc = 128; - } - else - { - shift = 2; - - if (x->up_available) - { - - for (i = 0; i < 8; i++) - { - Uaverage += uabove_row[i]; - Vaverage += vabove_row[i]; - } - - shift ++; - - } - - if (x->left_available) - { - for (i = 0; i < 8; i++) - { - Uaverage += uleft_col[i]; - Vaverage += vleft_col[i]; - } - - shift ++; - - } - - expected_udc = (Uaverage + (1 << (shift - 1))) >> shift; - expected_vdc = (Vaverage + (1 << (shift - 1))) >> shift; - } - - - for (i = 0; i < 8; i++) - { - for (j = 0; j < 8; j++) - { - - int predu = uleft_col[i] + uabove_row[j] - utop_left; - int predv = vleft_col[i] + vabove_row[j] - vtop_left; - int u_p, v_p; - - u_p = usrc_ptr[j]; - v_p = vsrc_ptr[j]; - - if (predu < 0) - predu = 0; - - if (predu > 255) - predu = 255; - - if (predv < 0) - predv = 0; - - if (predv > 255) - predv = 255; - - - diff = u_p - expected_udc; - pred_error[DC_PRED] += diff * diff; - diff = v_p - expected_vdc; - pred_error[DC_PRED] += diff * diff; - - - diff = u_p - uabove_row[j]; - pred_error[V_PRED] += diff * diff; - diff = v_p - vabove_row[j]; - pred_error[V_PRED] += diff * diff; - - - diff = u_p - uleft_col[i]; - pred_error[H_PRED] += diff * diff; - diff = v_p - vleft_col[i]; - pred_error[H_PRED] += diff * diff; - - - diff = u_p - predu; - pred_error[TM_PRED] += diff * diff; - diff = v_p - predv; - pred_error[TM_PRED] += diff * diff; - - - } - - usrc_ptr += uvsrc_stride; - vsrc_ptr += uvsrc_stride; - - if (i == 3) - { - usrc_ptr = (mb->block[18].src + *mb->block[18].base_src); - vsrc_ptr = (mb->block[22].src + *mb->block[22].base_src); - } - - - - } - - - for (i = DC_PRED; i <= TM_PRED; i++) - { - if (best_error > pred_error[i]) - { - best_error = pred_error[i]; - best_mode = (MB_PREDICTION_MODE)i; - } - } - - - mb->e_mbd.mode_info_context->mbmi.uv_mode = best_mode; - -} - -static void update_mvcount(MACROBLOCK *x, int_mv *best_ref_mv) -{ - MACROBLOCKD *xd = &x->e_mbd; - /* Split MV modes currently not supported when RD is nopt enabled, - * therefore, only need to modify MVcount in NEWMV mode. */ - if (xd->mode_info_context->mbmi.mode == NEWMV) - { - x->MVcount[0][mv_max+((xd->mode_info_context->mbmi.mv.as_mv.row - - best_ref_mv->as_mv.row) >> 1)]++; - x->MVcount[1][mv_max+((xd->mode_info_context->mbmi.mv.as_mv.col - - best_ref_mv->as_mv.col) >> 1)]++; - } -} - - -#if CONFIG_MULTI_RES_ENCODING -static -void get_lower_res_motion_info(VP8_COMP *cpi, MACROBLOCKD *xd, int *dissim, - int *parent_ref_frame, - MB_PREDICTION_MODE *parent_mode, - int_mv *parent_ref_mv, int mb_row, int mb_col) -{ - LOWER_RES_MB_INFO* store_mode_info - = ((LOWER_RES_FRAME_INFO*)cpi->oxcf.mr_low_res_mode_info)->mb_info; - unsigned int parent_mb_index; - - /* Consider different down_sampling_factor. */ - { - /* TODO: Removed the loop that supports special down_sampling_factor - * such as 2, 4, 8. Will revisit it if needed. - * Should also try using a look-up table to see if it helps - * performance. */ - int parent_mb_row, parent_mb_col; - - parent_mb_row = mb_row*cpi->oxcf.mr_down_sampling_factor.den - /cpi->oxcf.mr_down_sampling_factor.num; - parent_mb_col = mb_col*cpi->oxcf.mr_down_sampling_factor.den - /cpi->oxcf.mr_down_sampling_factor.num; - parent_mb_index = parent_mb_row*cpi->mr_low_res_mb_cols + parent_mb_col; - } - - /* Read lower-resolution mode & motion result from memory.*/ - *parent_ref_frame = store_mode_info[parent_mb_index].ref_frame; - *parent_mode = store_mode_info[parent_mb_index].mode; - *dissim = store_mode_info[parent_mb_index].dissim; - - /* For highest-resolution encoder, adjust dissim value. Lower its quality - * for good performance. */ - if (cpi->oxcf.mr_encoder_id == (cpi->oxcf.mr_total_resolutions - 1)) - *dissim>>=1; - - if(*parent_ref_frame != INTRA_FRAME) - { - /* Consider different down_sampling_factor. - * The result can be rounded to be more precise, but it takes more time. - */ - (*parent_ref_mv).as_mv.row = store_mode_info[parent_mb_index].mv.as_mv.row - *cpi->oxcf.mr_down_sampling_factor.num - /cpi->oxcf.mr_down_sampling_factor.den; - (*parent_ref_mv).as_mv.col = store_mode_info[parent_mb_index].mv.as_mv.col - *cpi->oxcf.mr_down_sampling_factor.num - /cpi->oxcf.mr_down_sampling_factor.den; - - vp8_clamp_mv2(parent_ref_mv, xd); - } -} -#endif - -static void check_for_encode_breakout(unsigned int sse, MACROBLOCK* x) -{ - MACROBLOCKD *xd = &x->e_mbd; - - unsigned int threshold = (xd->block[0].dequant[1] - * xd->block[0].dequant[1] >>4); - - if(threshold < x->encode_breakout) - threshold = x->encode_breakout; - - if (sse < threshold ) - { - /* Check u and v to make sure skip is ok */ - unsigned int sse2 = 0; - - sse2 = VP8_UVSSE(x); - - if (sse2 * 2 < x->encode_breakout) - x->skip = 1; - else - x->skip = 0; - } -} - -static int evaluate_inter_mode(unsigned int* sse, int rate2, int* distortion2, - VP8_COMP *cpi, MACROBLOCK *x, int rd_adj) -{ - MB_PREDICTION_MODE this_mode = x->e_mbd.mode_info_context->mbmi.mode; - int_mv mv = x->e_mbd.mode_info_context->mbmi.mv; - int this_rd; - int denoise_aggressive = 0; - /* Exit early and don't compute the distortion if this macroblock - * is marked inactive. */ - if (cpi->active_map_enabled && x->active_ptr[0] == 0) - { - *sse = 0; - *distortion2 = 0; - x->skip = 1; - return INT_MAX; - } - - if((this_mode != NEWMV) || - !(cpi->sf.half_pixel_search) || cpi->common.full_pixel==1) - *distortion2 = vp8_get_inter_mbpred_error(x, - &cpi->fn_ptr[BLOCK_16X16], - sse, mv); - - this_rd = RDCOST(x->rdmult, x->rddiv, rate2, *distortion2); - -#if CONFIG_TEMPORAL_DENOISING - if (cpi->oxcf.noise_sensitivity > 0) { - denoise_aggressive = - (cpi->denoiser.denoiser_mode == kDenoiserOnYUVAggressive) ? 1 : 0; - } -#endif - - // Adjust rd for ZEROMV and LAST, if LAST is the closest reference frame. - // TODO: We should also add condition on distance of closest to current. - if(!cpi->oxcf.screen_content_mode && - this_mode == ZEROMV && - x->e_mbd.mode_info_context->mbmi.ref_frame == LAST_FRAME && - (denoise_aggressive || (cpi->closest_reference_frame == LAST_FRAME))) - { - // No adjustment if block is considered to be skin area. - if(x->is_skin) - rd_adj = 100; - - this_rd = ((int64_t)this_rd) * rd_adj / 100; - } - - check_for_encode_breakout(*sse, x); - return this_rd; -} - -static void calculate_zeromv_rd_adjustment(VP8_COMP *cpi, MACROBLOCK *x, - int *rd_adjustment) -{ - MODE_INFO *mic = x->e_mbd.mode_info_context; - int_mv mv_l, mv_a, mv_al; - int local_motion_check = 0; - - if (cpi->lf_zeromv_pct > 40) - { - /* left mb */ - mic -= 1; - mv_l = mic->mbmi.mv; - - if (mic->mbmi.ref_frame != INTRA_FRAME) - if( abs(mv_l.as_mv.row) < 8 && abs(mv_l.as_mv.col) < 8) - local_motion_check++; - - /* above-left mb */ - mic -= x->e_mbd.mode_info_stride; - mv_al = mic->mbmi.mv; - - if (mic->mbmi.ref_frame != INTRA_FRAME) - if( abs(mv_al.as_mv.row) < 8 && abs(mv_al.as_mv.col) < 8) - local_motion_check++; - - /* above mb */ - mic += 1; - mv_a = mic->mbmi.mv; - - if (mic->mbmi.ref_frame != INTRA_FRAME) - if( abs(mv_a.as_mv.row) < 8 && abs(mv_a.as_mv.col) < 8) - local_motion_check++; - - if (((!x->e_mbd.mb_to_top_edge || !x->e_mbd.mb_to_left_edge) - && local_motion_check >0) || local_motion_check >2 ) - *rd_adjustment = 80; - else if (local_motion_check > 0) - *rd_adjustment = 90; - } -} - -void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, - int recon_uvoffset, int *returnrate, - int *returndistortion, int *returnintra, int mb_row, - int mb_col) -{ - BLOCK *b = &x->block[0]; - BLOCKD *d = &x->e_mbd.block[0]; - MACROBLOCKD *xd = &x->e_mbd; - MB_MODE_INFO best_mbmode; - - int_mv best_ref_mv_sb[2]; - int_mv mode_mv_sb[2][MB_MODE_COUNT]; - int_mv best_ref_mv; - int_mv *mode_mv; - MB_PREDICTION_MODE this_mode; - int num00; - int mdcounts[4]; - int best_rd = INT_MAX; - int rd_adjustment = 100; - int best_intra_rd = INT_MAX; - int mode_index; - int rate; - int rate2; - int distortion2; - int bestsme = INT_MAX; - int best_mode_index = 0; - unsigned int sse = UINT_MAX, best_rd_sse = UINT_MAX; -#if CONFIG_TEMPORAL_DENOISING - unsigned int zero_mv_sse = UINT_MAX, best_sse = UINT_MAX; -#endif - - int sf_improved_mv_pred = cpi->sf.improved_mv_pred; - -#if CONFIG_MULTI_RES_ENCODING - int dissim = INT_MAX; - int parent_ref_frame = 0; - int_mv parent_ref_mv; - MB_PREDICTION_MODE parent_mode = 0; - int parent_ref_valid = 0; -#endif - - int_mv mvp; - - int near_sadidx[8] = {0, 1, 2, 3, 4, 5, 6, 7}; - int saddone=0; - /* search range got from mv_pred(). It uses step_param levels. (0-7) */ - int sr=0; - - unsigned char *plane[4][3]; - int ref_frame_map[4]; - int sign_bias = 0; - int dot_artifact_candidate = 0; - get_predictor_pointers(cpi, plane, recon_yoffset, recon_uvoffset); - - // If the current frame is using LAST as a reference, check for - // biasing the mode selection for dot artifacts. - if (cpi->ref_frame_flags & VP8_LAST_FRAME) { - unsigned char* target_y = x->src.y_buffer; - unsigned char* target_u = x->block[16].src + *x->block[16].base_src; - unsigned char* target_v = x->block[20].src + *x->block[20].base_src; - int stride = x->src.y_stride; - int stride_uv = x->block[16].src_stride; -#if CONFIG_TEMPORAL_DENOISING - if (cpi->oxcf.noise_sensitivity) { - const int uv_denoise = (cpi->oxcf.noise_sensitivity >= 2) ? 1 : 0; - target_y = - cpi->denoiser.yv12_running_avg[LAST_FRAME].y_buffer + recon_yoffset; - stride = cpi->denoiser.yv12_running_avg[LAST_FRAME].y_stride; - if (uv_denoise) { - target_u = - cpi->denoiser.yv12_running_avg[LAST_FRAME].u_buffer + - recon_uvoffset; - target_v = - cpi->denoiser.yv12_running_avg[LAST_FRAME].v_buffer + - recon_uvoffset; - stride_uv = cpi->denoiser.yv12_running_avg[LAST_FRAME].uv_stride; - } - } -#endif - dot_artifact_candidate = - check_dot_artifact_candidate(cpi, x, target_y, stride, - plane[LAST_FRAME][0], mb_row, mb_col, 0); - // If not found in Y channel, check UV channel. - if (!dot_artifact_candidate) { - dot_artifact_candidate = - check_dot_artifact_candidate(cpi, x, target_u, stride_uv, - plane[LAST_FRAME][1], mb_row, mb_col, 1); - if (!dot_artifact_candidate) { - dot_artifact_candidate = - check_dot_artifact_candidate(cpi, x, target_v, stride_uv, - plane[LAST_FRAME][2], mb_row, mb_col, 2); - } - } - } - -#if CONFIG_MULTI_RES_ENCODING - // |parent_ref_valid| will be set here if potentially we can do mv resue for - // this higher resol (|cpi->oxcf.mr_encoder_id| > 0) frame. - // |parent_ref_valid| may be reset depending on |parent_ref_frame| for - // the current macroblock below. - parent_ref_valid = cpi->oxcf.mr_encoder_id && cpi->mr_low_res_mv_avail; - if (parent_ref_valid) - { - int parent_ref_flag; - - get_lower_res_motion_info(cpi, xd, &dissim, &parent_ref_frame, - &parent_mode, &parent_ref_mv, mb_row, mb_col); - - /* TODO(jkoleszar): The references available (ref_frame_flags) to the - * lower res encoder should match those available to this encoder, but - * there seems to be a situation where this mismatch can happen in the - * case of frame dropping and temporal layers. For example, - * GOLD being disallowed in ref_frame_flags, but being returned as - * parent_ref_frame. - * - * In this event, take the conservative approach of disabling the - * lower res info for this MB. - */ - - parent_ref_flag = 0; - // Note availability for mv reuse is only based on last and golden. - if (parent_ref_frame == LAST_FRAME) - parent_ref_flag = (cpi->ref_frame_flags & VP8_LAST_FRAME); - else if (parent_ref_frame == GOLDEN_FRAME) - parent_ref_flag = (cpi->ref_frame_flags & VP8_GOLD_FRAME); - - //assert(!parent_ref_frame || parent_ref_flag); - - // If |parent_ref_frame| did not match either last or golden then - // shut off mv reuse. - if (parent_ref_frame && !parent_ref_flag) - parent_ref_valid = 0; - - // Don't do mv reuse since we want to allow for another mode besides - // ZEROMV_LAST to remove dot artifact. - if (dot_artifact_candidate) - parent_ref_valid = 0; - } -#endif - - // Check if current macroblock is in skin area. - { - const int y = x->src.y_buffer[7 * x->src.y_stride + 7]; - const int cb = x->src.u_buffer[3 * x->src.uv_stride + 3]; - const int cr = x->src.v_buffer[3 * x->src.uv_stride + 3]; - x->is_skin = 0; - if (!cpi->oxcf.screen_content_mode) - x->is_skin = is_skin_color(y, cb, cr); - } -#if CONFIG_TEMPORAL_DENOISING - if (cpi->oxcf.noise_sensitivity) { - // Under aggressive denoising mode, should we use skin map to reduce denoiser - // and ZEROMV bias? Will need to revisit the accuracy of this detection for - // very noisy input. For now keep this as is (i.e., don't turn it off). - // if (cpi->denoiser.denoiser_mode == kDenoiserOnYUVAggressive) - // x->is_skin = 0; - } -#endif - - mode_mv = mode_mv_sb[sign_bias]; - best_ref_mv.as_int = 0; - vpx_memset(mode_mv_sb, 0, sizeof(mode_mv_sb)); - vpx_memset(&best_mbmode, 0, sizeof(best_mbmode)); - - /* Setup search priorities */ -#if CONFIG_MULTI_RES_ENCODING - if (parent_ref_valid && parent_ref_frame && dissim < 8) - { - ref_frame_map[0] = -1; - ref_frame_map[1] = parent_ref_frame; - ref_frame_map[2] = -1; - ref_frame_map[3] = -1; - } else -#endif - get_reference_search_order(cpi, ref_frame_map); - - /* Check to see if there is at least 1 valid reference frame that we need - * to calculate near_mvs. - */ - if (ref_frame_map[1] > 0) - { - sign_bias = vp8_find_near_mvs_bias(&x->e_mbd, - x->e_mbd.mode_info_context, - mode_mv_sb, - best_ref_mv_sb, - mdcounts, - ref_frame_map[1], - cpi->common.ref_frame_sign_bias); - - mode_mv = mode_mv_sb[sign_bias]; - best_ref_mv.as_int = best_ref_mv_sb[sign_bias].as_int; - } - - /* Count of the number of MBs tested so far this frame */ - x->mbs_tested_so_far++; - - *returnintra = INT_MAX; - x->skip = 0; - - x->e_mbd.mode_info_context->mbmi.ref_frame = INTRA_FRAME; - - /* If the frame has big static background and current MB is in low - * motion area, its mode decision is biased to ZEROMV mode. - * No adjustment if cpu_used is <= -12 (i.e., cpi->Speed >= 12). - * At such speed settings, ZEROMV is already heavily favored. - */ - if (cpi->Speed < 12) { - calculate_zeromv_rd_adjustment(cpi, x, &rd_adjustment); - } - -#if CONFIG_TEMPORAL_DENOISING - if (cpi->oxcf.noise_sensitivity) { - rd_adjustment = (int)(rd_adjustment * - cpi->denoiser.denoise_pars.pickmode_mv_bias / 100); - } -#endif - - if (dot_artifact_candidate) - { - // Bias against ZEROMV_LAST mode. - rd_adjustment = 150; - } - - - /* if we encode a new mv this is important - * find the best new motion vector - */ - for (mode_index = 0; mode_index < MAX_MODES; mode_index++) - { - int frame_cost; - int this_rd = INT_MAX; - int this_ref_frame = ref_frame_map[vp8_ref_frame_order[mode_index]]; - - if (best_rd <= x->rd_threshes[mode_index]) - continue; - - if (this_ref_frame < 0) - continue; - - x->e_mbd.mode_info_context->mbmi.ref_frame = this_ref_frame; - - /* everything but intra */ - if (x->e_mbd.mode_info_context->mbmi.ref_frame) - { - x->e_mbd.pre.y_buffer = plane[this_ref_frame][0]; - x->e_mbd.pre.u_buffer = plane[this_ref_frame][1]; - x->e_mbd.pre.v_buffer = plane[this_ref_frame][2]; - - if (sign_bias != cpi->common.ref_frame_sign_bias[this_ref_frame]) - { - sign_bias = cpi->common.ref_frame_sign_bias[this_ref_frame]; - mode_mv = mode_mv_sb[sign_bias]; - best_ref_mv.as_int = best_ref_mv_sb[sign_bias].as_int; - } - -#if CONFIG_MULTI_RES_ENCODING - if (parent_ref_valid) - { - if (vp8_mode_order[mode_index] == NEARESTMV && - mode_mv[NEARESTMV].as_int ==0) - continue; - if (vp8_mode_order[mode_index] == NEARMV && - mode_mv[NEARMV].as_int ==0) - continue; - - if (vp8_mode_order[mode_index] == NEWMV && parent_mode == ZEROMV - && best_ref_mv.as_int==0) - continue; - else if(vp8_mode_order[mode_index] == NEWMV && dissim==0 - && best_ref_mv.as_int==parent_ref_mv.as_int) - continue; - } -#endif - } - - /* Check to see if the testing frequency for this mode is at its max - * If so then prevent it from being tested and increase the threshold - * for its testing */ - if (x->mode_test_hit_counts[mode_index] && - (cpi->mode_check_freq[mode_index] > 1)) - { - if (x->mbs_tested_so_far <= (cpi->mode_check_freq[mode_index] * - x->mode_test_hit_counts[mode_index])) - { - /* Increase the threshold for coding this mode to make it less - * likely to be chosen */ - x->rd_thresh_mult[mode_index] += 4; - - if (x->rd_thresh_mult[mode_index] > MAX_THRESHMULT) - x->rd_thresh_mult[mode_index] = MAX_THRESHMULT; - - x->rd_threshes[mode_index] = - (cpi->rd_baseline_thresh[mode_index] >> 7) * - x->rd_thresh_mult[mode_index]; - continue; - } - } - - /* We have now reached the point where we are going to test the current - * mode so increment the counter for the number of times it has been - * tested */ - x->mode_test_hit_counts[mode_index] ++; - - rate2 = 0; - distortion2 = 0; - - this_mode = vp8_mode_order[mode_index]; - - x->e_mbd.mode_info_context->mbmi.mode = this_mode; - x->e_mbd.mode_info_context->mbmi.uv_mode = DC_PRED; - - /* Work out the cost assosciated with selecting the reference frame */ - frame_cost = - x->ref_frame_cost[x->e_mbd.mode_info_context->mbmi.ref_frame]; - rate2 += frame_cost; - - /* Only consider ZEROMV/ALTREF_FRAME for alt ref frame, - * unless ARNR filtering is enabled in which case we want - * an unfiltered alternative */ - if (cpi->is_src_frame_alt_ref && (cpi->oxcf.arnr_max_frames == 0)) - { - if (this_mode != ZEROMV || - x->e_mbd.mode_info_context->mbmi.ref_frame != ALTREF_FRAME) - continue; - } - - switch (this_mode) - { - case B_PRED: - /* Pass best so far to pick_intra4x4mby_modes to use as breakout */ - distortion2 = best_rd_sse; - pick_intra4x4mby_modes(x, &rate, &distortion2); - - if (distortion2 == INT_MAX) - { - this_rd = INT_MAX; - } - else - { - rate2 += rate; - distortion2 = vp8_variance16x16( - *(b->base_src), b->src_stride, - x->e_mbd.predictor, 16, &sse); - this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2); - - if (this_rd < best_intra_rd) - { - best_intra_rd = this_rd; - *returnintra = distortion2; - } - } - - break; - - case SPLITMV: - - /* Split MV modes currently not supported when RD is not enabled. */ - break; - - case DC_PRED: - case V_PRED: - case H_PRED: - case TM_PRED: - vp8_build_intra_predictors_mby_s(xd, - xd->dst.y_buffer - xd->dst.y_stride, - xd->dst.y_buffer - 1, - xd->dst.y_stride, - xd->predictor, - 16); - distortion2 = vp8_variance16x16 - (*(b->base_src), b->src_stride, - x->e_mbd.predictor, 16, &sse); - rate2 += x->mbmode_cost[x->e_mbd.frame_type][x->e_mbd.mode_info_context->mbmi.mode]; - this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2); - - if (this_rd < best_intra_rd) - { - best_intra_rd = this_rd; - *returnintra = distortion2; - } - break; - - case NEWMV: - { - int thissme; - int step_param; - int further_steps; - int n = 0; - int sadpb = x->sadperbit16; - int_mv mvp_full; - - int col_min = ((best_ref_mv.as_mv.col+7)>>3) - MAX_FULL_PEL_VAL; - int row_min = ((best_ref_mv.as_mv.row+7)>>3) - MAX_FULL_PEL_VAL; - int col_max = (best_ref_mv.as_mv.col>>3) - + MAX_FULL_PEL_VAL; - int row_max = (best_ref_mv.as_mv.row>>3) - + MAX_FULL_PEL_VAL; - - int tmp_col_min = x->mv_col_min; - int tmp_col_max = x->mv_col_max; - int tmp_row_min = x->mv_row_min; - int tmp_row_max = x->mv_row_max; - - int speed_adjust = (cpi->Speed > 5) ? ((cpi->Speed >= 8)? 3 : 2) : 1; - - /* Further step/diamond searches as necessary */ - step_param = cpi->sf.first_step + speed_adjust; - -#if CONFIG_MULTI_RES_ENCODING - /* If lower-res frame is not available for mv reuse (because of - frame dropping or different temporal layer pattern), then higher - resol encoder does motion search without any previous knowledge. - Also, since last frame motion info is not stored, then we can not - use improved_mv_pred. */ - if (cpi->oxcf.mr_encoder_id) - sf_improved_mv_pred = 0; - - // Only use parent MV as predictor if this candidate reference frame - // (|this_ref_frame|) is equal to |parent_ref_frame|. - if (parent_ref_valid && (parent_ref_frame == this_ref_frame)) - { - /* Use parent MV as predictor. Adjust search range - * accordingly. - */ - mvp.as_int = parent_ref_mv.as_int; - mvp_full.as_mv.col = parent_ref_mv.as_mv.col>>3; - mvp_full.as_mv.row = parent_ref_mv.as_mv.row>>3; - - if(dissim <=32) step_param += 3; - else if(dissim <=128) step_param += 2; - else step_param += 1; - }else -#endif - { - if(sf_improved_mv_pred) - { - if(!saddone) - { - vp8_cal_sad(cpi,xd,x, recon_yoffset ,&near_sadidx[0] ); - saddone = 1; - } - - vp8_mv_pred(cpi, &x->e_mbd, x->e_mbd.mode_info_context, - &mvp,x->e_mbd.mode_info_context->mbmi.ref_frame, - cpi->common.ref_frame_sign_bias, &sr, - &near_sadidx[0]); - - sr += speed_adjust; - /* adjust search range according to sr from mv prediction */ - if(sr > step_param) - step_param = sr; - - mvp_full.as_mv.col = mvp.as_mv.col>>3; - mvp_full.as_mv.row = mvp.as_mv.row>>3; - }else - { - mvp.as_int = best_ref_mv.as_int; - mvp_full.as_mv.col = best_ref_mv.as_mv.col>>3; - mvp_full.as_mv.row = best_ref_mv.as_mv.row>>3; - } - } - -#if CONFIG_MULTI_RES_ENCODING - if (parent_ref_valid && (parent_ref_frame == this_ref_frame) && - dissim <= 2 && - MAX(abs(best_ref_mv.as_mv.row - parent_ref_mv.as_mv.row), - abs(best_ref_mv.as_mv.col - parent_ref_mv.as_mv.col)) <= 4) - { - d->bmi.mv.as_int = mvp_full.as_int; - mode_mv[NEWMV].as_int = mvp_full.as_int; - - cpi->find_fractional_mv_step(x, b, d, &d->bmi.mv, &best_ref_mv, - x->errorperbit, - &cpi->fn_ptr[BLOCK_16X16], - cpi->mb.mvcost, - &distortion2,&sse); - }else -#endif - { - /* Get intersection of UMV window and valid MV window to - * reduce # of checks in diamond search. */ - if (x->mv_col_min < col_min ) - x->mv_col_min = col_min; - if (x->mv_col_max > col_max ) - x->mv_col_max = col_max; - if (x->mv_row_min < row_min ) - x->mv_row_min = row_min; - if (x->mv_row_max > row_max ) - x->mv_row_max = row_max; - - further_steps = (cpi->Speed >= 8)? - 0: (cpi->sf.max_step_search_steps - 1 - step_param); - - if (cpi->sf.search_method == HEX) - { -#if CONFIG_MULTI_RES_ENCODING - /* TODO: In higher-res pick_inter_mode, step_param is used to - * modify hex search range. Here, set step_param to 0 not to - * change the behavior in lowest-resolution encoder. - * Will improve it later. - */ - /* Set step_param to 0 to ensure large-range motion search - * when mv reuse if not valid (i.e. |parent_ref_valid| = 0), - * or if this candidate reference frame (|this_ref_frame|) is - * not equal to |parent_ref_frame|. - */ - if (!parent_ref_valid || (parent_ref_frame != this_ref_frame)) - step_param = 0; -#endif - bestsme = vp8_hex_search(x, b, d, &mvp_full, &d->bmi.mv, - step_param, sadpb, - &cpi->fn_ptr[BLOCK_16X16], - x->mvsadcost, x->mvcost, &best_ref_mv); - mode_mv[NEWMV].as_int = d->bmi.mv.as_int; - } - else - { - bestsme = cpi->diamond_search_sad(x, b, d, &mvp_full, - &d->bmi.mv, step_param, sadpb, &num00, - &cpi->fn_ptr[BLOCK_16X16], - x->mvcost, &best_ref_mv); - mode_mv[NEWMV].as_int = d->bmi.mv.as_int; - - /* Further step/diamond searches as necessary */ - n = num00; - num00 = 0; - - while (n < further_steps) - { - n++; - - if (num00) - num00--; - else - { - thissme = - cpi->diamond_search_sad(x, b, d, &mvp_full, - &d->bmi.mv, - step_param + n, - sadpb, &num00, - &cpi->fn_ptr[BLOCK_16X16], - x->mvcost, &best_ref_mv); - if (thissme < bestsme) - { - bestsme = thissme; - mode_mv[NEWMV].as_int = d->bmi.mv.as_int; - } - else - { - d->bmi.mv.as_int = mode_mv[NEWMV].as_int; - } - } - } - } - - x->mv_col_min = tmp_col_min; - x->mv_col_max = tmp_col_max; - x->mv_row_min = tmp_row_min; - x->mv_row_max = tmp_row_max; - - if (bestsme < INT_MAX) - cpi->find_fractional_mv_step(x, b, d, &d->bmi.mv, - &best_ref_mv, x->errorperbit, - &cpi->fn_ptr[BLOCK_16X16], - cpi->mb.mvcost, - &distortion2,&sse); - } - - mode_mv[NEWMV].as_int = d->bmi.mv.as_int; - - /* mv cost; */ - rate2 += vp8_mv_bit_cost(&mode_mv[NEWMV], &best_ref_mv, - cpi->mb.mvcost, 128); - } - - case NEARESTMV: - case NEARMV: - - if (mode_mv[this_mode].as_int == 0) - continue; - - case ZEROMV: - - /* Trap vectors that reach beyond the UMV borders - * Note that ALL New MV, Nearest MV Near MV and Zero MV code drops - * through to this point because of the lack of break statements - * in the previous two cases. - */ - if (((mode_mv[this_mode].as_mv.row >> 3) < x->mv_row_min) || - ((mode_mv[this_mode].as_mv.row >> 3) > x->mv_row_max) || - ((mode_mv[this_mode].as_mv.col >> 3) < x->mv_col_min) || - ((mode_mv[this_mode].as_mv.col >> 3) > x->mv_col_max)) - continue; - - rate2 += vp8_cost_mv_ref(this_mode, mdcounts); - x->e_mbd.mode_info_context->mbmi.mv.as_int = - mode_mv[this_mode].as_int; - this_rd = evaluate_inter_mode(&sse, rate2, &distortion2, cpi, x, - rd_adjustment); - - break; - default: - break; - } - -#if CONFIG_TEMPORAL_DENOISING - if (cpi->oxcf.noise_sensitivity) - { - /* Store for later use by denoiser. */ - // Dont' denoise with GOLDEN OR ALTREF is they are old reference - // frames (greater than MAX_GF_ARF_DENOISE_RANGE frames in past). - int skip_old_reference = ((this_ref_frame != LAST_FRAME) && - (cpi->common.current_video_frame - - cpi->current_ref_frames[this_ref_frame] > - MAX_GF_ARF_DENOISE_RANGE)) ? 1 : 0; - if (this_mode == ZEROMV && sse < zero_mv_sse && - !skip_old_reference) - { - zero_mv_sse = sse; - x->best_zeromv_reference_frame = - x->e_mbd.mode_info_context->mbmi.ref_frame; - } - - // Store the best NEWMV in x for later use in the denoiser. - if (x->e_mbd.mode_info_context->mbmi.mode == NEWMV && - sse < best_sse && !skip_old_reference) - { - best_sse = sse; - x->best_sse_inter_mode = NEWMV; - x->best_sse_mv = x->e_mbd.mode_info_context->mbmi.mv; - x->need_to_clamp_best_mvs = - x->e_mbd.mode_info_context->mbmi.need_to_clamp_mvs; - x->best_reference_frame = - x->e_mbd.mode_info_context->mbmi.ref_frame; - } - } -#endif - - if (this_rd < best_rd || x->skip) - { - /* Note index of best mode */ - best_mode_index = mode_index; - - *returnrate = rate2; - *returndistortion = distortion2; - best_rd_sse = sse; - best_rd = this_rd; - vpx_memcpy(&best_mbmode, &x->e_mbd.mode_info_context->mbmi, - sizeof(MB_MODE_INFO)); - - /* Testing this mode gave rise to an improvement in best error - * score. Lower threshold a bit for next time - */ - x->rd_thresh_mult[mode_index] = - (x->rd_thresh_mult[mode_index] >= (MIN_THRESHMULT + 2)) ? - x->rd_thresh_mult[mode_index] - 2 : MIN_THRESHMULT; - x->rd_threshes[mode_index] = - (cpi->rd_baseline_thresh[mode_index] >> 7) * - x->rd_thresh_mult[mode_index]; - } - - /* If the mode did not help improve the best error case then raise the - * threshold for testing that mode next time around. - */ - else - { - x->rd_thresh_mult[mode_index] += 4; - - if (x->rd_thresh_mult[mode_index] > MAX_THRESHMULT) - x->rd_thresh_mult[mode_index] = MAX_THRESHMULT; - - x->rd_threshes[mode_index] = - (cpi->rd_baseline_thresh[mode_index] >> 7) * - x->rd_thresh_mult[mode_index]; - } - - if (x->skip) - break; - } - - /* Reduce the activation RD thresholds for the best choice mode */ - if ((cpi->rd_baseline_thresh[best_mode_index] > 0) && (cpi->rd_baseline_thresh[best_mode_index] < (INT_MAX >> 2))) - { - int best_adjustment = (x->rd_thresh_mult[best_mode_index] >> 3); - - x->rd_thresh_mult[best_mode_index] = - (x->rd_thresh_mult[best_mode_index] - >= (MIN_THRESHMULT + best_adjustment)) ? - x->rd_thresh_mult[best_mode_index] - best_adjustment : - MIN_THRESHMULT; - x->rd_threshes[best_mode_index] = - (cpi->rd_baseline_thresh[best_mode_index] >> 7) * - x->rd_thresh_mult[best_mode_index]; - } - - - { - int this_rdbin = (*returndistortion >> 7); - - if (this_rdbin >= 1024) - { - this_rdbin = 1023; - } - - x->error_bins[this_rdbin] ++; - } - -#if CONFIG_TEMPORAL_DENOISING - if (cpi->oxcf.noise_sensitivity) - { - int block_index = mb_row * cpi->common.mb_cols + mb_col; - int reevaluate = 0; - int is_noisy = 0; - if (x->best_sse_inter_mode == DC_PRED) - { - /* No best MV found. */ - x->best_sse_inter_mode = best_mbmode.mode; - x->best_sse_mv = best_mbmode.mv; - x->need_to_clamp_best_mvs = best_mbmode.need_to_clamp_mvs; - x->best_reference_frame = best_mbmode.ref_frame; - best_sse = best_rd_sse; - } - // For non-skin blocks that have selected ZEROMV for this current frame, - // and have been selecting ZEROMV_LAST (on the base layer frame) at - // least |x~20| consecutive past frames in a row, label the block for - // possible increase in denoising strength. We also condition this - // labeling on there being significant denoising in the scene - if (cpi->oxcf.noise_sensitivity == 4) { - if (cpi->denoiser.nmse_source_diff > - 70 * cpi->denoiser.threshold_aggressive_mode / 100) - is_noisy = 1; - } else { - if (cpi->mse_source_denoised > 1000) - is_noisy = 1; - } - x->increase_denoising = 0; - if (!x->is_skin && - x->best_sse_inter_mode == ZEROMV && - (x->best_reference_frame == LAST_FRAME || - x->best_reference_frame == cpi->closest_reference_frame) && - cpi->consec_zero_last[block_index] >= 20 && - is_noisy) { - x->increase_denoising = 1; - } - x->denoise_zeromv = 0; - vp8_denoiser_denoise_mb(&cpi->denoiser, x, best_sse, zero_mv_sse, - recon_yoffset, recon_uvoffset, - &cpi->common.lf_info, mb_row, mb_col, - block_index); - - // Reevaluate ZEROMV after denoising: for large noise content - // (i.e., cpi->mse_source_denoised is above threshold), do this for all - // blocks that did not pick ZEROMV as best mode but are using ZEROMV - // for denoising. Otherwise, always re-evaluate for blocks that picked - // INTRA mode as best mode. - // Avoid blocks that have been biased against ZERO_LAST - // (i.e., dot artifact candidate blocks). - reevaluate = (best_mbmode.ref_frame == INTRA_FRAME) || - (best_mbmode.mode != ZEROMV && - x->denoise_zeromv && - cpi->mse_source_denoised > 2000); - if (!dot_artifact_candidate && - reevaluate && - x->best_zeromv_reference_frame != INTRA_FRAME) - { - int this_rd = 0; - int this_ref_frame = x->best_zeromv_reference_frame; - rd_adjustment = 100; - rate2 = x->ref_frame_cost[this_ref_frame] + - vp8_cost_mv_ref(ZEROMV, mdcounts); - distortion2 = 0; - - /* set up the proper prediction buffers for the frame */ - x->e_mbd.mode_info_context->mbmi.ref_frame = this_ref_frame; - x->e_mbd.pre.y_buffer = plane[this_ref_frame][0]; - x->e_mbd.pre.u_buffer = plane[this_ref_frame][1]; - x->e_mbd.pre.v_buffer = plane[this_ref_frame][2]; - - x->e_mbd.mode_info_context->mbmi.mode = ZEROMV; - x->e_mbd.mode_info_context->mbmi.uv_mode = DC_PRED; - x->e_mbd.mode_info_context->mbmi.mv.as_int = 0; - this_rd = evaluate_inter_mode(&sse, rate2, &distortion2, cpi, x, - rd_adjustment); - - if (this_rd < best_rd) - { - vpx_memcpy(&best_mbmode, &x->e_mbd.mode_info_context->mbmi, - sizeof(MB_MODE_INFO)); - } - } - - } -#endif - - if (cpi->is_src_frame_alt_ref && - (best_mbmode.mode != ZEROMV || best_mbmode.ref_frame != ALTREF_FRAME)) - { - x->e_mbd.mode_info_context->mbmi.mode = ZEROMV; - x->e_mbd.mode_info_context->mbmi.ref_frame = ALTREF_FRAME; - x->e_mbd.mode_info_context->mbmi.mv.as_int = 0; - x->e_mbd.mode_info_context->mbmi.uv_mode = DC_PRED; - x->e_mbd.mode_info_context->mbmi.mb_skip_coeff = - (cpi->common.mb_no_coeff_skip); - x->e_mbd.mode_info_context->mbmi.partitioning = 0; - - return; - } - - /* set to the best mb mode, this copy can be skip if x->skip since it - * already has the right content */ - if (!x->skip) - vpx_memcpy(&x->e_mbd.mode_info_context->mbmi, &best_mbmode, - sizeof(MB_MODE_INFO)); - - if (best_mbmode.mode <= B_PRED) - { - /* set mode_info_context->mbmi.uv_mode */ - pick_intra_mbuv_mode(x); - } - - if (sign_bias - != cpi->common.ref_frame_sign_bias[xd->mode_info_context->mbmi.ref_frame]) - best_ref_mv.as_int = best_ref_mv_sb[!sign_bias].as_int; - - update_mvcount(x, &best_ref_mv); -} - -void vp8_pick_intra_mode(MACROBLOCK *x, int *rate_) -{ - int error4x4, error16x16 = INT_MAX; - int rate, best_rate = 0, distortion, best_sse; - MB_PREDICTION_MODE mode, best_mode = DC_PRED; - int this_rd; - unsigned int sse; - BLOCK *b = &x->block[0]; - MACROBLOCKD *xd = &x->e_mbd; - - xd->mode_info_context->mbmi.ref_frame = INTRA_FRAME; - - pick_intra_mbuv_mode(x); - - for (mode = DC_PRED; mode <= TM_PRED; mode ++) - { - xd->mode_info_context->mbmi.mode = mode; - vp8_build_intra_predictors_mby_s(xd, - xd->dst.y_buffer - xd->dst.y_stride, - xd->dst.y_buffer - 1, - xd->dst.y_stride, - xd->predictor, - 16); - distortion = vp8_variance16x16 - (*(b->base_src), b->src_stride, xd->predictor, 16, &sse); - rate = x->mbmode_cost[xd->frame_type][mode]; - this_rd = RDCOST(x->rdmult, x->rddiv, rate, distortion); - - if (error16x16 > this_rd) - { - error16x16 = this_rd; - best_mode = mode; - best_sse = sse; - best_rate = rate; - } - } - xd->mode_info_context->mbmi.mode = best_mode; - - error4x4 = pick_intra4x4mby_modes(x, &rate, - &best_sse); - if (error4x4 < error16x16) - { - xd->mode_info_context->mbmi.mode = B_PRED; - best_rate = rate; - } - - *rate_ = best_rate; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/pickinter.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/pickinter.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/pickinter.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/pickinter.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_ENCODER_PICKINTER_H_ -#define VP8_ENCODER_PICKINTER_H_ -#include "vpx_config.h" -#include "vp8/common/onyxc_int.h" - -#ifdef __cplusplus -extern "C" { -#endif - -extern void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, - int recon_uvoffset, int *returnrate, - int *returndistortion, int *returnintra, - int mb_row, int mb_col); -extern void vp8_pick_intra_mode(MACROBLOCK *x, int *rate); - -extern int vp8_get_inter_mbpred_error(MACROBLOCK *mb, - const vp8_variance_fn_ptr_t *vfp, - unsigned int *sse, - int_mv this_mv); -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_PICKINTER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/picklpf.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/picklpf.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/picklpf.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/picklpf.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,407 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "./vpx_scale_rtcd.h" -#include "vp8/common/onyxc_int.h" -#include "onyx_int.h" -#include "quantize.h" -#include "vpx_mem/vpx_mem.h" -#include "vpx_scale/vpx_scale.h" -#include "vp8/common/alloccommon.h" -#include "vp8/common/loopfilter.h" -#if ARCH_ARM -#include "vpx_ports/arm.h" -#endif - -extern int vp8_calc_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest); - -static void yv12_copy_partial_frame(YV12_BUFFER_CONFIG *src_ybc, - YV12_BUFFER_CONFIG *dst_ybc) -{ - unsigned char *src_y, *dst_y; - int yheight; - int ystride; - int yoffset; - int linestocopy; - - yheight = src_ybc->y_height; - ystride = src_ybc->y_stride; - - /* number of MB rows to use in partial filtering */ - linestocopy = (yheight >> 4) / PARTIAL_FRAME_FRACTION; - linestocopy = linestocopy ? linestocopy << 4 : 16; /* 16 lines per MB */ - - /* Copy extra 4 so that full filter context is available if filtering done - * on the copied partial frame and not original. Partial filter does mb - * filtering for top row also, which can modify3 pixels above. - */ - linestocopy += 4; - /* partial image starts at ~middle of frame (macroblock border)*/ - yoffset = ystride * (((yheight >> 5) * 16) - 4); - src_y = src_ybc->y_buffer + yoffset; - dst_y = dst_ybc->y_buffer + yoffset; - - vpx_memcpy(dst_y, src_y, ystride * linestocopy); -} - -static int calc_partial_ssl_err(YV12_BUFFER_CONFIG *source, - YV12_BUFFER_CONFIG *dest) -{ - int i, j; - int Total = 0; - int srcoffset, dstoffset; - unsigned char *src = source->y_buffer; - unsigned char *dst = dest->y_buffer; - - int linestocopy; - - /* number of MB rows to use in partial filtering */ - linestocopy = (source->y_height >> 4) / PARTIAL_FRAME_FRACTION; - linestocopy = linestocopy ? linestocopy << 4 : 16; /* 16 lines per MB */ - - - /* partial image starts at ~middle of frame (macroblock border)*/ - srcoffset = source->y_stride * ((dest->y_height >> 5) * 16); - dstoffset = dest->y_stride * ((dest->y_height >> 5) * 16); - - src += srcoffset; - dst += dstoffset; - - /* Loop through the Y plane raw and reconstruction data summing - * (square differences) - */ - for (i = 0; i < linestocopy; i += 16) - { - for (j = 0; j < source->y_width; j += 16) - { - unsigned int sse; - Total += vp8_mse16x16(src + j, source->y_stride, - dst + j, dest->y_stride, - &sse); - } - - src += 16 * source->y_stride; - dst += 16 * dest->y_stride; - } - - return Total; -} - -/* Enforce a minimum filter level based upon baseline Q */ -static int get_min_filter_level(VP8_COMP *cpi, int base_qindex) -{ - int min_filter_level; - - if (cpi->source_alt_ref_active && cpi->common.refresh_golden_frame && - !cpi->common.refresh_alt_ref_frame) - min_filter_level = 0; - else - { - if (base_qindex <= 6) - min_filter_level = 0; - else if (base_qindex <= 16) - min_filter_level = 1; - else - min_filter_level = (base_qindex / 8); - } - - return min_filter_level; -} - -/* Enforce a maximum filter level based upon baseline Q */ -static int get_max_filter_level(VP8_COMP *cpi, int base_qindex) -{ - /* PGW August 2006: Highest filter values almost always a bad idea */ - - /* jbb chg: 20100118 - not so any more with this overquant stuff allow - * high values with lots of intra coming in. - */ - int max_filter_level = MAX_LOOP_FILTER; - (void)base_qindex; - - if (cpi->twopass.section_intra_rating > 8) - max_filter_level = MAX_LOOP_FILTER * 3 / 4; - - return max_filter_level; -} - -void vp8cx_pick_filter_level_fast(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi) -{ - VP8_COMMON *cm = &cpi->common; - - int best_err = 0; - int filt_err = 0; - int min_filter_level = get_min_filter_level(cpi, cm->base_qindex); - int max_filter_level = get_max_filter_level(cpi, cm->base_qindex); - int filt_val; - int best_filt_val = cm->filter_level; - YV12_BUFFER_CONFIG * saved_frame = cm->frame_to_show; - - /* Replace unfiltered frame buffer with a new one */ - cm->frame_to_show = &cpi->pick_lf_lvl_frame; - - if (cm->frame_type == KEY_FRAME) - cm->sharpness_level = 0; - else - cm->sharpness_level = cpi->oxcf.Sharpness; - - if (cm->sharpness_level != cm->last_sharpness_level) - { - vp8_loop_filter_update_sharpness(&cm->lf_info, cm->sharpness_level); - cm->last_sharpness_level = cm->sharpness_level; - } - - /* Start the search at the previous frame filter level unless it is - * now out of range. - */ - if (cm->filter_level < min_filter_level) - cm->filter_level = min_filter_level; - else if (cm->filter_level > max_filter_level) - cm->filter_level = max_filter_level; - - filt_val = cm->filter_level; - best_filt_val = filt_val; - - /* Get the err using the previous frame's filter value. */ - - /* Copy the unfiltered / processed recon buffer to the new buffer */ - yv12_copy_partial_frame(saved_frame, cm->frame_to_show); - vp8_loop_filter_partial_frame(cm, &cpi->mb.e_mbd, filt_val); - - best_err = calc_partial_ssl_err(sd, cm->frame_to_show); - - filt_val -= 1 + (filt_val > 10); - - /* Search lower filter levels */ - while (filt_val >= min_filter_level) - { - /* Apply the loop filter */ - yv12_copy_partial_frame(saved_frame, cm->frame_to_show); - vp8_loop_filter_partial_frame(cm, &cpi->mb.e_mbd, filt_val); - - /* Get the err for filtered frame */ - filt_err = calc_partial_ssl_err(sd, cm->frame_to_show); - - /* Update the best case record or exit loop. */ - if (filt_err < best_err) - { - best_err = filt_err; - best_filt_val = filt_val; - } - else - break; - - /* Adjust filter level */ - filt_val -= 1 + (filt_val > 10); - } - - /* Search up (note that we have already done filt_val = cm->filter_level) */ - filt_val = cm->filter_level + 1 + (filt_val > 10); - - if (best_filt_val == cm->filter_level) - { - /* Resist raising filter level for very small gains */ - best_err -= (best_err >> 10); - - while (filt_val < max_filter_level) - { - /* Apply the loop filter */ - yv12_copy_partial_frame(saved_frame, cm->frame_to_show); - - vp8_loop_filter_partial_frame(cm, &cpi->mb.e_mbd, filt_val); - - /* Get the err for filtered frame */ - filt_err = calc_partial_ssl_err(sd, cm->frame_to_show); - - /* Update the best case record or exit loop. */ - if (filt_err < best_err) - { - /* Do not raise filter level if improvement is < 1 part - * in 4096 - */ - best_err = filt_err - (filt_err >> 10); - - best_filt_val = filt_val; - } - else - break; - - /* Adjust filter level */ - filt_val += 1 + (filt_val > 10); - } - } - - cm->filter_level = best_filt_val; - - if (cm->filter_level < min_filter_level) - cm->filter_level = min_filter_level; - - if (cm->filter_level > max_filter_level) - cm->filter_level = max_filter_level; - - /* restore unfiltered frame pointer */ - cm->frame_to_show = saved_frame; -} - -/* Stub function for now Alt LF not used */ -void vp8cx_set_alt_lf_level(VP8_COMP *cpi, int filt_val) -{ - MACROBLOCKD *mbd = &cpi->mb.e_mbd; - (void) filt_val; - - mbd->segment_feature_data[MB_LVL_ALT_LF][0] = cpi->segment_feature_data[MB_LVL_ALT_LF][0]; - mbd->segment_feature_data[MB_LVL_ALT_LF][1] = cpi->segment_feature_data[MB_LVL_ALT_LF][1]; - mbd->segment_feature_data[MB_LVL_ALT_LF][2] = cpi->segment_feature_data[MB_LVL_ALT_LF][2]; - mbd->segment_feature_data[MB_LVL_ALT_LF][3] = cpi->segment_feature_data[MB_LVL_ALT_LF][3]; -} - -void vp8cx_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi) -{ - VP8_COMMON *cm = &cpi->common; - - int best_err = 0; - int filt_err = 0; - int min_filter_level = get_min_filter_level(cpi, cm->base_qindex); - int max_filter_level = get_max_filter_level(cpi, cm->base_qindex); - - int filter_step; - int filt_high = 0; - /* Start search at previous frame filter level */ - int filt_mid = cm->filter_level; - int filt_low = 0; - int filt_best; - int filt_direction = 0; - - /* Bias against raising loop filter and in favor of lowering it */ - int Bias = 0; - - int ss_err[MAX_LOOP_FILTER + 1]; - - YV12_BUFFER_CONFIG * saved_frame = cm->frame_to_show; - - vpx_memset(ss_err, 0, sizeof(ss_err)); - - /* Replace unfiltered frame buffer with a new one */ - cm->frame_to_show = &cpi->pick_lf_lvl_frame; - - if (cm->frame_type == KEY_FRAME) - cm->sharpness_level = 0; - else - cm->sharpness_level = cpi->oxcf.Sharpness; - - /* Start the search at the previous frame filter level unless it is - * now out of range. - */ - filt_mid = cm->filter_level; - - if (filt_mid < min_filter_level) - filt_mid = min_filter_level; - else if (filt_mid > max_filter_level) - filt_mid = max_filter_level; - - /* Define the initial step size */ - filter_step = (filt_mid < 16) ? 4 : filt_mid / 4; - - /* Get baseline error score */ - - /* Copy the unfiltered / processed recon buffer to the new buffer */ - vpx_yv12_copy_y(saved_frame, cm->frame_to_show); - - vp8cx_set_alt_lf_level(cpi, filt_mid); - vp8_loop_filter_frame_yonly(cm, &cpi->mb.e_mbd, filt_mid); - - best_err = vp8_calc_ss_err(sd, cm->frame_to_show); - - ss_err[filt_mid] = best_err; - - filt_best = filt_mid; - - while (filter_step > 0) - { - Bias = (best_err >> (15 - (filt_mid / 8))) * filter_step; - - if (cpi->twopass.section_intra_rating < 20) - Bias = Bias * cpi->twopass.section_intra_rating / 20; - - filt_high = ((filt_mid + filter_step) > max_filter_level) ? max_filter_level : (filt_mid + filter_step); - filt_low = ((filt_mid - filter_step) < min_filter_level) ? min_filter_level : (filt_mid - filter_step); - - if ((filt_direction <= 0) && (filt_low != filt_mid)) - { - if(ss_err[filt_low] == 0) - { - /* Get Low filter error score */ - vpx_yv12_copy_y(saved_frame, cm->frame_to_show); - vp8cx_set_alt_lf_level(cpi, filt_low); - vp8_loop_filter_frame_yonly(cm, &cpi->mb.e_mbd, filt_low); - - filt_err = vp8_calc_ss_err(sd, cm->frame_to_show); - ss_err[filt_low] = filt_err; - } - else - filt_err = ss_err[filt_low]; - - /* If value is close to the best so far then bias towards a - * lower loop filter value. - */ - if ((filt_err - Bias) < best_err) - { - /* Was it actually better than the previous best? */ - if (filt_err < best_err) - best_err = filt_err; - - filt_best = filt_low; - } - } - - /* Now look at filt_high */ - if ((filt_direction >= 0) && (filt_high != filt_mid)) - { - if(ss_err[filt_high] == 0) - { - vpx_yv12_copy_y(saved_frame, cm->frame_to_show); - vp8cx_set_alt_lf_level(cpi, filt_high); - vp8_loop_filter_frame_yonly(cm, &cpi->mb.e_mbd, filt_high); - - filt_err = vp8_calc_ss_err(sd, cm->frame_to_show); - ss_err[filt_high] = filt_err; - } - else - filt_err = ss_err[filt_high]; - - /* Was it better than the previous best? */ - if (filt_err < (best_err - Bias)) - { - best_err = filt_err; - filt_best = filt_high; - } - } - - /* Half the step distance if the best filter value was the same - * as last time - */ - if (filt_best == filt_mid) - { - filter_step = filter_step / 2; - filt_direction = 0; - } - else - { - filt_direction = (filt_best < filt_mid) ? -1 : 1; - filt_mid = filt_best; - } - } - - cm->filter_level = filt_best; - - /* restore unfiltered frame pointer */ - cm->frame_to_show = saved_frame; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/ppc/csystemdependent.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/ppc/csystemdependent.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/ppc/csystemdependent.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/ppc/csystemdependent.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,160 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vp8/encoder/variance.h" -#include "vp8/encoder/onyx_int.h" - -SADFunction *vp8_sad16x16; -SADFunction *vp8_sad16x8; -SADFunction *vp8_sad8x16; -SADFunction *vp8_sad8x8; -SADFunction *vp8_sad4x4; - -variance_function *vp8_variance4x4; -variance_function *vp8_variance8x8; -variance_function *vp8_variance8x16; -variance_function *vp8_variance16x8; -variance_function *vp8_variance16x16; - -variance_function *vp8_mse16x16; - -sub_pixel_variance_function *vp8_sub_pixel_variance4x4; -sub_pixel_variance_function *vp8_sub_pixel_variance8x8; -sub_pixel_variance_function *vp8_sub_pixel_variance8x16; -sub_pixel_variance_function *vp8_sub_pixel_variance16x8; -sub_pixel_variance_function *vp8_sub_pixel_variance16x16; - -int (*vp8_block_error)(short *coeff, short *dqcoeff); -int (*vp8_mbblock_error)(MACROBLOCK *mb, int dc); - -int (*vp8_mbuverror)(MACROBLOCK *mb); -unsigned int (*vp8_get_mb_ss)(short *); -void (*vp8_short_fdct4x4)(short *input, short *output, int pitch); -void (*vp8_short_fdct8x4)(short *input, short *output, int pitch); -void (*vp8_fast_fdct4x4)(short *input, short *output, int pitch); -void (*vp8_fast_fdct8x4)(short *input, short *output, int pitch); -void (*short_walsh4x4)(short *input, short *output, int pitch); - -void (*vp8_subtract_b)(BLOCK *be, BLOCKD *bd, int pitch); -void (*vp8_subtract_mby)(short *diff, unsigned char *src, unsigned char *pred, int stride); -void (*vp8_subtract_mbuv)(short *diff, unsigned char *usrc, unsigned char *vsrc, unsigned char *pred, int stride); -void (*vp8_fast_quantize_b)(BLOCK *b, BLOCKD *d); - -unsigned int (*vp8_get4x4sse_cs)(unsigned char *src_ptr, int source_stride, unsigned char *ref_ptr, int recon_stride); - -// c imports -extern int block_error_c(short *coeff, short *dqcoeff); -extern int vp8_mbblock_error_c(MACROBLOCK *mb, int dc); - -extern int vp8_mbuverror_c(MACROBLOCK *mb); -extern unsigned int vp8_get8x8var_c(unsigned char *src_ptr, int source_stride, unsigned char *ref_ptr, int recon_stride, unsigned int *SSE, int *Sum); -extern void short_fdct4x4_c(short *input, short *output, int pitch); -extern void short_fdct8x4_c(short *input, short *output, int pitch); -extern void vp8_short_walsh4x4_c(short *input, short *output, int pitch); - -extern void vp8_subtract_b_c(BLOCK *be, BLOCKD *bd, int pitch); -extern void subtract_mby_c(short *diff, unsigned char *src, unsigned char *pred, int stride); -extern void subtract_mbuv_c(short *diff, unsigned char *usrc, unsigned char *vsrc, unsigned char *pred, int stride); -extern void vp8_fast_quantize_b_c(BLOCK *b, BLOCKD *d); - -extern SADFunction sad16x16_c; -extern SADFunction sad16x8_c; -extern SADFunction sad8x16_c; -extern SADFunction sad8x8_c; -extern SADFunction sad4x4_c; - -extern variance_function variance16x16_c; -extern variance_function variance8x16_c; -extern variance_function variance16x8_c; -extern variance_function variance8x8_c; -extern variance_function variance4x4_c; -extern variance_function mse16x16_c; - -extern sub_pixel_variance_function sub_pixel_variance4x4_c; -extern sub_pixel_variance_function sub_pixel_variance8x8_c; -extern sub_pixel_variance_function sub_pixel_variance8x16_c; -extern sub_pixel_variance_function sub_pixel_variance16x8_c; -extern sub_pixel_variance_function sub_pixel_variance16x16_c; - -extern unsigned int vp8_get_mb_ss_c(short *); -extern unsigned int vp8_get4x4sse_cs_c(unsigned char *src_ptr, int source_stride, unsigned char *ref_ptr, int recon_stride); - -// ppc -extern int vp8_block_error_ppc(short *coeff, short *dqcoeff); - -extern void vp8_short_fdct4x4_ppc(short *input, short *output, int pitch); -extern void vp8_short_fdct8x4_ppc(short *input, short *output, int pitch); - -extern void vp8_subtract_mby_ppc(short *diff, unsigned char *src, unsigned char *pred, int stride); -extern void vp8_subtract_mbuv_ppc(short *diff, unsigned char *usrc, unsigned char *vsrc, unsigned char *pred, int stride); - -extern SADFunction vp8_sad16x16_ppc; -extern SADFunction vp8_sad16x8_ppc; -extern SADFunction vp8_sad8x16_ppc; -extern SADFunction vp8_sad8x8_ppc; -extern SADFunction vp8_sad4x4_ppc; - -extern variance_function vp8_variance16x16_ppc; -extern variance_function vp8_variance8x16_ppc; -extern variance_function vp8_variance16x8_ppc; -extern variance_function vp8_variance8x8_ppc; -extern variance_function vp8_variance4x4_ppc; -extern variance_function vp8_mse16x16_ppc; - -extern sub_pixel_variance_function vp8_sub_pixel_variance4x4_ppc; -extern sub_pixel_variance_function vp8_sub_pixel_variance8x8_ppc; -extern sub_pixel_variance_function vp8_sub_pixel_variance8x16_ppc; -extern sub_pixel_variance_function vp8_sub_pixel_variance16x8_ppc; -extern sub_pixel_variance_function vp8_sub_pixel_variance16x16_ppc; - -extern unsigned int vp8_get8x8var_ppc(unsigned char *src_ptr, int source_stride, unsigned char *ref_ptr, int recon_stride, unsigned int *SSE, int *Sum); -extern unsigned int vp8_get16x16var_ppc(unsigned char *src_ptr, int source_stride, unsigned char *ref_ptr, int recon_stride, unsigned int *SSE, int *Sum); - -void vp8_cmachine_specific_config(void) -{ - // Pure C: - vp8_mbuverror = vp8_mbuverror_c; - vp8_fast_quantize_b = vp8_fast_quantize_b_c; - vp8_short_fdct4x4 = vp8_short_fdct4x4_ppc; - vp8_short_fdct8x4 = vp8_short_fdct8x4_ppc; - vp8_fast_fdct4x4 = vp8_short_fdct4x4_ppc; - vp8_fast_fdct8x4 = vp8_short_fdct8x4_ppc; - short_walsh4x4 = vp8_short_walsh4x4_c; - - vp8_variance4x4 = vp8_variance4x4_ppc; - vp8_variance8x8 = vp8_variance8x8_ppc; - vp8_variance8x16 = vp8_variance8x16_ppc; - vp8_variance16x8 = vp8_variance16x8_ppc; - vp8_variance16x16 = vp8_variance16x16_ppc; - vp8_mse16x16 = vp8_mse16x16_ppc; - - vp8_sub_pixel_variance4x4 = vp8_sub_pixel_variance4x4_ppc; - vp8_sub_pixel_variance8x8 = vp8_sub_pixel_variance8x8_ppc; - vp8_sub_pixel_variance8x16 = vp8_sub_pixel_variance8x16_ppc; - vp8_sub_pixel_variance16x8 = vp8_sub_pixel_variance16x8_ppc; - vp8_sub_pixel_variance16x16 = vp8_sub_pixel_variance16x16_ppc; - - vp8_get_mb_ss = vp8_get_mb_ss_c; - vp8_get4x4sse_cs = vp8_get4x4sse_cs_c; - - vp8_sad16x16 = vp8_sad16x16_ppc; - vp8_sad16x8 = vp8_sad16x8_ppc; - vp8_sad8x16 = vp8_sad8x16_ppc; - vp8_sad8x8 = vp8_sad8x8_ppc; - vp8_sad4x4 = vp8_sad4x4_ppc; - - vp8_block_error = vp8_block_error_ppc; - vp8_mbblock_error = vp8_mbblock_error_c; - - vp8_subtract_b = vp8_subtract_b_c; - vp8_subtract_mby = vp8_subtract_mby_ppc; - vp8_subtract_mbuv = vp8_subtract_mbuv_ppc; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/ppc/encodemb_altivec.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/ppc/encodemb_altivec.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/ppc/encodemb_altivec.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/ppc/encodemb_altivec.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,153 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - .globl vp8_subtract_mbuv_ppc - .globl vp8_subtract_mby_ppc - -;# r3 short *diff -;# r4 unsigned char *usrc -;# r5 unsigned char *vsrc -;# r6 unsigned char *pred -;# r7 int stride -vp8_subtract_mbuv_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xf000 - mtspr 256, r12 ;# set VRSAVE - - li r9, 256 - add r3, r3, r9 - add r3, r3, r9 - add r6, r6, r9 - - li r10, 16 - li r9, 4 - mtctr r9 - - vspltisw v0, 0 - -mbu_loop: - lvsl v5, 0, r4 ;# permutate value for alignment - lvx v1, 0, r4 ;# src - lvx v2, 0, r6 ;# pred - - add r4, r4, r7 - addi r6, r6, 16 - - vperm v1, v1, v0, v5 - - vmrghb v3, v0, v1 ;# unpack high src to short - vmrghb v4, v0, v2 ;# unpack high pred to short - - lvsl v5, 0, r4 ;# permutate value for alignment - lvx v1, 0, r4 ;# src - - add r4, r4, r7 - - vsubshs v3, v3, v4 - - stvx v3, 0, r3 ;# store out diff - - vperm v1, v1, v0, v5 - - vmrghb v3, v0, v1 ;# unpack high src to short - vmrglb v4, v0, v2 ;# unpack high pred to short - - vsubshs v3, v3, v4 - - stvx v3, r10, r3 ;# store out diff - - addi r3, r3, 32 - - bdnz mbu_loop - - mtctr r9 - -mbv_loop: - lvsl v5, 0, r5 ;# permutate value for alignment - lvx v1, 0, r5 ;# src - lvx v2, 0, r6 ;# pred - - add r5, r5, r7 - addi r6, r6, 16 - - vperm v1, v1, v0, v5 - - vmrghb v3, v0, v1 ;# unpack high src to short - vmrghb v4, v0, v2 ;# unpack high pred to short - - lvsl v5, 0, r5 ;# permutate value for alignment - lvx v1, 0, r5 ;# src - - add r5, r5, r7 - - vsubshs v3, v3, v4 - - stvx v3, 0, r3 ;# store out diff - - vperm v1, v1, v0, v5 - - vmrghb v3, v0, v1 ;# unpack high src to short - vmrglb v4, v0, v2 ;# unpack high pred to short - - vsubshs v3, v3, v4 - - stvx v3, r10, r3 ;# store out diff - - addi r3, r3, 32 - - bdnz mbv_loop - - mtspr 256, r11 ;# reset old VRSAVE - - blr - -;# r3 short *diff -;# r4 unsigned char *src -;# r5 unsigned char *pred -;# r6 int stride -vp8_subtract_mby_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xf800 - mtspr 256, r12 ;# set VRSAVE - - li r10, 16 - mtctr r10 - - vspltisw v0, 0 - -mby_loop: - lvx v1, 0, r4 ;# src - lvx v2, 0, r5 ;# pred - - add r4, r4, r6 - addi r5, r5, 16 - - vmrghb v3, v0, v1 ;# unpack high src to short - vmrghb v4, v0, v2 ;# unpack high pred to short - - vsubshs v3, v3, v4 - - stvx v3, 0, r3 ;# store out diff - - vmrglb v3, v0, v1 ;# unpack low src to short - vmrglb v4, v0, v2 ;# unpack low pred to short - - vsubshs v3, v3, v4 - - stvx v3, r10, r3 ;# store out diff - - addi r3, r3, 32 - - bdnz mby_loop - - mtspr 256, r11 ;# reset old VRSAVE - - blr diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/ppc/fdct_altivec.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/ppc/fdct_altivec.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/ppc/fdct_altivec.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/ppc/fdct_altivec.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,205 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - .globl vp8_short_fdct4x4_ppc - .globl vp8_short_fdct8x4_ppc - -.macro load_c V, LABEL, OFF, R0, R1 - lis \R0, \LABEL@ha - la \R1, \LABEL@l(\R0) - lvx \V, \OFF, \R1 -.endm - -;# Forward and inverse DCTs are nearly identical; only differences are -;# in normalization (fwd is twice unitary, inv is half unitary) -;# and that they are of course transposes of each other. -;# -;# The following three accomplish most of implementation and -;# are used only by ppc_idct.c and ppc_fdct.c. -.macro prologue - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xfffc - mtspr 256, r12 ;# set VRSAVE - - stwu r1,-32(r1) ;# create space on the stack - - li r6, 16 - - load_c v0, dct_tab, 0, r9, r10 - lvx v1, r6, r10 - addi r10, r10, 32 - lvx v2, 0, r10 - lvx v3, r6, r10 - - load_c v4, ppc_dctperm_tab, 0, r9, r10 - load_c v5, ppc_dctperm_tab, r6, r9, r10 - - load_c v6, round_tab, 0, r10, r9 -.endm - -.macro epilogue - addi r1, r1, 32 ;# recover stack - - mtspr 256, r11 ;# reset old VRSAVE -.endm - -;# Do horiz xf on two rows of coeffs v8 = a0 a1 a2 a3 b0 b1 b2 b3. -;# a/A are the even rows 0,2 b/B are the odd rows 1,3 -;# For fwd transform, indices are horizontal positions, then frequencies. -;# For inverse transform, frequencies then positions. -;# The two resulting A0..A3 B0..B3 are later combined -;# and vertically transformed. - -.macro two_rows_horiz Dst - vperm v9, v8, v8, v4 ;# v9 = a2 a3 a0 a1 b2 b3 b0 b1 - - vmsumshm v10, v0, v8, v6 - vmsumshm v10, v1, v9, v10 - vsraw v10, v10, v7 ;# v10 = A0 A1 B0 B1 - - vmsumshm v11, v2, v8, v6 - vmsumshm v11, v3, v9, v11 - vsraw v11, v11, v7 ;# v11 = A2 A3 B2 B3 - - vpkuwum v10, v10, v11 ;# v10 = A0 A1 B0 B1 A2 A3 B2 B3 - vperm \Dst, v10, v10, v5 ;# Dest = A0 B0 A1 B1 A2 B2 A3 B3 -.endm - -;# Vertical xf on two rows. DCT values in comments are for inverse transform; -;# forward transform uses transpose. - -.macro two_rows_vert Ceven, Codd - vspltw v8, \Ceven, 0 ;# v8 = c00 c10 or c02 c12 four times - vspltw v9, \Codd, 0 ;# v9 = c20 c30 or c22 c32 "" - vmsumshm v8, v8, v12, v6 - vmsumshm v8, v9, v13, v8 - vsraw v10, v8, v7 - - vspltw v8, \Codd, 1 ;# v8 = c01 c11 or c03 c13 - vspltw v9, \Ceven, 1 ;# v9 = c21 c31 or c23 c33 - vmsumshm v8, v8, v12, v6 - vmsumshm v8, v9, v13, v8 - vsraw v8, v8, v7 - - vpkuwum v8, v10, v8 ;# v8 = rows 0,1 or 2,3 -.endm - -.macro two_rows_h Dest - stw r0, 0(r8) - lwz r0, 4(r3) - stw r0, 4(r8) - lwzux r0, r3,r5 - stw r0, 8(r8) - lwz r0, 4(r3) - stw r0, 12(r8) - lvx v8, 0,r8 - two_rows_horiz \Dest -.endm - - .align 2 -;# r3 short *input -;# r4 short *output -;# r5 int pitch -vp8_short_fdct4x4_ppc: - - prologue - - vspltisw v7, 14 ;# == 14, fits in 5 signed bits - addi r8, r1, 0 - - - lwz r0, 0(r3) - two_rows_h v12 ;# v12 = H00 H10 H01 H11 H02 H12 H03 H13 - - lwzux r0, r3, r5 - two_rows_h v13 ;# v13 = H20 H30 H21 H31 H22 H32 H23 H33 - - lvx v6, r6, r9 ;# v6 = Vround - vspltisw v7, -16 ;# == 16 == -16, only low 5 bits matter - - two_rows_vert v0, v1 - stvx v8, 0, r4 - two_rows_vert v2, v3 - stvx v8, r6, r4 - - epilogue - - blr - - .align 2 -;# r3 short *input -;# r4 short *output -;# r5 int pitch -vp8_short_fdct8x4_ppc: - prologue - - vspltisw v7, 14 ;# == 14, fits in 5 signed bits - addi r8, r1, 0 - addi r10, r3, 0 - - lwz r0, 0(r3) - two_rows_h v12 ;# v12 = H00 H10 H01 H11 H02 H12 H03 H13 - - lwzux r0, r3, r5 - two_rows_h v13 ;# v13 = H20 H30 H21 H31 H22 H32 H23 H33 - - lvx v6, r6, r9 ;# v6 = Vround - vspltisw v7, -16 ;# == 16 == -16, only low 5 bits matter - - two_rows_vert v0, v1 - stvx v8, 0, r4 - two_rows_vert v2, v3 - stvx v8, r6, r4 - - ;# Next block - addi r3, r10, 8 - addi r4, r4, 32 - lvx v6, 0, r9 ;# v6 = Hround - - vspltisw v7, 14 ;# == 14, fits in 5 signed bits - addi r8, r1, 0 - - lwz r0, 0(r3) - two_rows_h v12 ;# v12 = H00 H10 H01 H11 H02 H12 H03 H13 - - lwzux r0, r3, r5 - two_rows_h v13 ;# v13 = H20 H30 H21 H31 H22 H32 H23 H33 - - lvx v6, r6, r9 ;# v6 = Vround - vspltisw v7, -16 ;# == 16 == -16, only low 5 bits matter - - two_rows_vert v0, v1 - stvx v8, 0, r4 - two_rows_vert v2, v3 - stvx v8, r6, r4 - - epilogue - - blr - - .data - .align 4 -ppc_dctperm_tab: - .byte 4,5,6,7, 0,1,2,3, 12,13,14,15, 8,9,10,11 - .byte 0,1,4,5, 2,3,6,7, 8,9,12,13, 10,11,14,15 - - .align 4 -dct_tab: - .short 23170, 23170,-12540,-30274, 23170, 23170,-12540,-30274 - .short 23170, 23170, 30274, 12540, 23170, 23170, 30274, 12540 - - .short 23170,-23170, 30274,-12540, 23170,-23170, 30274,-12540 - .short -23170, 23170, 12540,-30274,-23170, 23170, 12540,-30274 - - .align 4 -round_tab: - .long (1 << (14-1)), (1 << (14-1)), (1 << (14-1)), (1 << (14-1)) - .long (1 << (16-1)), (1 << (16-1)), (1 << (16-1)), (1 << (16-1)) diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/ppc/rdopt_altivec.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/ppc/rdopt_altivec.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/ppc/rdopt_altivec.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/ppc/rdopt_altivec.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - .globl vp8_block_error_ppc - - .align 2 -;# r3 short *Coeff -;# r4 short *dqcoeff -vp8_block_error_ppc: - mfspr r11, 256 ;# get old VRSAVE - oris r12, r11, 0xf800 - mtspr 256, r12 ;# set VRSAVE - - stwu r1,-32(r1) ;# create space on the stack - - stw r5, 12(r1) ;# tranfer dc to vector register - - lvx v0, 0, r3 ;# Coeff - lvx v1, 0, r4 ;# dqcoeff - - li r10, 16 - - vspltisw v3, 0 - - vsubshs v0, v0, v1 - - vmsumshm v2, v0, v0, v3 ;# multiply differences - - lvx v0, r10, r3 ;# Coeff - lvx v1, r10, r4 ;# dqcoeff - - vsubshs v0, v0, v1 - - vmsumshm v1, v0, v0, v2 ;# multiply differences - vsumsws v1, v1, v3 ;# sum up - - stvx v1, 0, r1 - lwz r3, 12(r1) ;# return value - - addi r1, r1, 32 ;# recover stack - mtspr 256, r11 ;# reset old VRSAVE - - blr diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/quantize.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/quantize.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/quantize.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/quantize.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,583 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include -#include "vpx_mem/vpx_mem.h" - -#include "onyx_int.h" -#include "quantize.h" -#include "vp8/common/quant_common.h" - -void vp8_fast_quantize_b_c(BLOCK *b, BLOCKD *d) -{ - int i, rc, eob; - int x, y, z, sz; - short *coeff_ptr = b->coeff; - short *round_ptr = b->round; - short *quant_ptr = b->quant_fast; - short *qcoeff_ptr = d->qcoeff; - short *dqcoeff_ptr = d->dqcoeff; - short *dequant_ptr = d->dequant; - - eob = -1; - for (i = 0; i < 16; i++) - { - rc = vp8_default_zig_zag1d[i]; - z = coeff_ptr[rc]; - - sz = (z >> 31); /* sign of z */ - x = (z ^ sz) - sz; /* x = abs(z) */ - - y = ((x + round_ptr[rc]) * quant_ptr[rc]) >> 16; /* quantize (x) */ - x = (y ^ sz) - sz; /* get the sign back */ - qcoeff_ptr[rc] = x; /* write to destination */ - dqcoeff_ptr[rc] = x * dequant_ptr[rc]; /* dequantized value */ - - if (y) - { - eob = i; /* last nonzero coeffs */ - } - } - *d->eob = (char)(eob + 1); -} - -void vp8_regular_quantize_b_c(BLOCK *b, BLOCKD *d) -{ - int i, rc, eob; - int zbin; - int x, y, z, sz; - short *zbin_boost_ptr = b->zrun_zbin_boost; - short *coeff_ptr = b->coeff; - short *zbin_ptr = b->zbin; - short *round_ptr = b->round; - short *quant_ptr = b->quant; - short *quant_shift_ptr = b->quant_shift; - short *qcoeff_ptr = d->qcoeff; - short *dqcoeff_ptr = d->dqcoeff; - short *dequant_ptr = d->dequant; - short zbin_oq_value = b->zbin_extra; - - vpx_memset(qcoeff_ptr, 0, 32); - vpx_memset(dqcoeff_ptr, 0, 32); - - eob = -1; - - for (i = 0; i < 16; i++) - { - rc = vp8_default_zig_zag1d[i]; - z = coeff_ptr[rc]; - - zbin = zbin_ptr[rc] + *zbin_boost_ptr + zbin_oq_value; - - zbin_boost_ptr ++; - sz = (z >> 31); /* sign of z */ - x = (z ^ sz) - sz; /* x = abs(z) */ - - if (x >= zbin) - { - x += round_ptr[rc]; - y = ((((x * quant_ptr[rc]) >> 16) + x) - * quant_shift_ptr[rc]) >> 16; /* quantize (x) */ - x = (y ^ sz) - sz; /* get the sign back */ - qcoeff_ptr[rc] = x; /* write to destination */ - dqcoeff_ptr[rc] = x * dequant_ptr[rc]; /* dequantized value */ - - if (y) - { - eob = i; /* last nonzero coeffs */ - zbin_boost_ptr = b->zrun_zbin_boost; /* reset zero runlength */ - } - } - } - - *d->eob = (char)(eob + 1); -} - -void vp8_quantize_mby(MACROBLOCK *x) -{ - int i; - int has_2nd_order = (x->e_mbd.mode_info_context->mbmi.mode != B_PRED - && x->e_mbd.mode_info_context->mbmi.mode != SPLITMV); - - for (i = 0; i < 16; i++) - x->quantize_b(&x->block[i], &x->e_mbd.block[i]); - - if(has_2nd_order) - x->quantize_b(&x->block[24], &x->e_mbd.block[24]); -} - -void vp8_quantize_mb(MACROBLOCK *x) -{ - int i; - int has_2nd_order=(x->e_mbd.mode_info_context->mbmi.mode != B_PRED - && x->e_mbd.mode_info_context->mbmi.mode != SPLITMV); - - for (i = 0; i < 24+has_2nd_order; i++) - x->quantize_b(&x->block[i], &x->e_mbd.block[i]); -} - - -void vp8_quantize_mbuv(MACROBLOCK *x) -{ - int i; - - for (i = 16; i < 24; i++) - x->quantize_b(&x->block[i], &x->e_mbd.block[i]); -} - -static const int qrounding_factors[129] = -{ - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48 -}; - - -static const int qzbin_factors[129] = -{ - 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, - 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, - 80 -}; - - -static const int qrounding_factors_y2[129] = -{ - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48 -}; - - -static const int qzbin_factors_y2[129] = -{ - 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, - 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, - 80 -}; - - -static void invert_quant(int improved_quant, short *quant, - short *shift, short d) -{ - if(improved_quant) - { - unsigned t; - int l; - t = d; - for(l = 0; t > 1; l++) - t>>=1; - t = 1 + (1<<(16+l))/d; - *quant = (short)(t - (1<<16)); - *shift = l; - /* use multiplication and constant shift by 16 */ - *shift = 1 << (16 - *shift); - } - else - { - *quant = (1 << 16) / d; - *shift = 0; - /* use multiplication and constant shift by 16 */ - *shift = 1 << (16 - *shift); - } -} - - -void vp8cx_init_quantizer(VP8_COMP *cpi) -{ - int i; - int quant_val; - int Q; - - int zbin_boost[16] = {0, 0, 8, 10, 12, 14, 16, 20, 24, 28, 32, 36, 40, 44, - 44, 44}; - - for (Q = 0; Q < QINDEX_RANGE; Q++) - { - /* dc values */ - quant_val = vp8_dc_quant(Q, cpi->common.y1dc_delta_q); - cpi->Y1quant_fast[Q][0] = (1 << 16) / quant_val; - invert_quant(cpi->sf.improved_quant, cpi->Y1quant[Q] + 0, - cpi->Y1quant_shift[Q] + 0, quant_val); - cpi->Y1zbin[Q][0] = ((qzbin_factors[Q] * quant_val) + 64) >> 7; - cpi->Y1round[Q][0] = (qrounding_factors[Q] * quant_val) >> 7; - cpi->common.Y1dequant[Q][0] = quant_val; - cpi->zrun_zbin_boost_y1[Q][0] = (quant_val * zbin_boost[0]) >> 7; - - quant_val = vp8_dc2quant(Q, cpi->common.y2dc_delta_q); - cpi->Y2quant_fast[Q][0] = (1 << 16) / quant_val; - invert_quant(cpi->sf.improved_quant, cpi->Y2quant[Q] + 0, - cpi->Y2quant_shift[Q] + 0, quant_val); - cpi->Y2zbin[Q][0] = ((qzbin_factors_y2[Q] * quant_val) + 64) >> 7; - cpi->Y2round[Q][0] = (qrounding_factors_y2[Q] * quant_val) >> 7; - cpi->common.Y2dequant[Q][0] = quant_val; - cpi->zrun_zbin_boost_y2[Q][0] = (quant_val * zbin_boost[0]) >> 7; - - quant_val = vp8_dc_uv_quant(Q, cpi->common.uvdc_delta_q); - cpi->UVquant_fast[Q][0] = (1 << 16) / quant_val; - invert_quant(cpi->sf.improved_quant, cpi->UVquant[Q] + 0, - cpi->UVquant_shift[Q] + 0, quant_val); - cpi->UVzbin[Q][0] = ((qzbin_factors[Q] * quant_val) + 64) >> 7;; - cpi->UVround[Q][0] = (qrounding_factors[Q] * quant_val) >> 7; - cpi->common.UVdequant[Q][0] = quant_val; - cpi->zrun_zbin_boost_uv[Q][0] = (quant_val * zbin_boost[0]) >> 7; - - /* all the ac values = ; */ - quant_val = vp8_ac_yquant(Q); - cpi->Y1quant_fast[Q][1] = (1 << 16) / quant_val; - invert_quant(cpi->sf.improved_quant, cpi->Y1quant[Q] + 1, - cpi->Y1quant_shift[Q] + 1, quant_val); - cpi->Y1zbin[Q][1] = ((qzbin_factors[Q] * quant_val) + 64) >> 7; - cpi->Y1round[Q][1] = (qrounding_factors[Q] * quant_val) >> 7; - cpi->common.Y1dequant[Q][1] = quant_val; - cpi->zrun_zbin_boost_y1[Q][1] = (quant_val * zbin_boost[1]) >> 7; - - quant_val = vp8_ac2quant(Q, cpi->common.y2ac_delta_q); - cpi->Y2quant_fast[Q][1] = (1 << 16) / quant_val; - invert_quant(cpi->sf.improved_quant, cpi->Y2quant[Q] + 1, - cpi->Y2quant_shift[Q] + 1, quant_val); - cpi->Y2zbin[Q][1] = ((qzbin_factors_y2[Q] * quant_val) + 64) >> 7; - cpi->Y2round[Q][1] = (qrounding_factors_y2[Q] * quant_val) >> 7; - cpi->common.Y2dequant[Q][1] = quant_val; - cpi->zrun_zbin_boost_y2[Q][1] = (quant_val * zbin_boost[1]) >> 7; - - quant_val = vp8_ac_uv_quant(Q, cpi->common.uvac_delta_q); - cpi->UVquant_fast[Q][1] = (1 << 16) / quant_val; - invert_quant(cpi->sf.improved_quant, cpi->UVquant[Q] + 1, - cpi->UVquant_shift[Q] + 1, quant_val); - cpi->UVzbin[Q][1] = ((qzbin_factors[Q] * quant_val) + 64) >> 7; - cpi->UVround[Q][1] = (qrounding_factors[Q] * quant_val) >> 7; - cpi->common.UVdequant[Q][1] = quant_val; - cpi->zrun_zbin_boost_uv[Q][1] = (quant_val * zbin_boost[1]) >> 7; - - for (i = 2; i < 16; i++) - { - cpi->Y1quant_fast[Q][i] = cpi->Y1quant_fast[Q][1]; - cpi->Y1quant[Q][i] = cpi->Y1quant[Q][1]; - cpi->Y1quant_shift[Q][i] = cpi->Y1quant_shift[Q][1]; - cpi->Y1zbin[Q][i] = cpi->Y1zbin[Q][1]; - cpi->Y1round[Q][i] = cpi->Y1round[Q][1]; - cpi->zrun_zbin_boost_y1[Q][i] = (cpi->common.Y1dequant[Q][1] * - zbin_boost[i]) >> 7; - - cpi->Y2quant_fast[Q][i] = cpi->Y2quant_fast[Q][1]; - cpi->Y2quant[Q][i] = cpi->Y2quant[Q][1]; - cpi->Y2quant_shift[Q][i] = cpi->Y2quant_shift[Q][1]; - cpi->Y2zbin[Q][i] = cpi->Y2zbin[Q][1]; - cpi->Y2round[Q][i] = cpi->Y2round[Q][1]; - cpi->zrun_zbin_boost_y2[Q][i] = (cpi->common.Y2dequant[Q][1] * - zbin_boost[i]) >> 7; - - cpi->UVquant_fast[Q][i] = cpi->UVquant_fast[Q][1]; - cpi->UVquant[Q][i] = cpi->UVquant[Q][1]; - cpi->UVquant_shift[Q][i] = cpi->UVquant_shift[Q][1]; - cpi->UVzbin[Q][i] = cpi->UVzbin[Q][1]; - cpi->UVround[Q][i] = cpi->UVround[Q][1]; - cpi->zrun_zbin_boost_uv[Q][i] = (cpi->common.UVdequant[Q][1] * - zbin_boost[i]) >> 7; - } - } -} - -#define ZBIN_EXTRA_Y \ - (( cpi->common.Y1dequant[QIndex][1] * \ - ( x->zbin_over_quant + \ - x->zbin_mode_boost + \ - x->act_zbin_adj ) ) >> 7) - -#define ZBIN_EXTRA_UV \ - (( cpi->common.UVdequant[QIndex][1] * \ - ( x->zbin_over_quant + \ - x->zbin_mode_boost + \ - x->act_zbin_adj ) ) >> 7) - -#define ZBIN_EXTRA_Y2 \ - (( cpi->common.Y2dequant[QIndex][1] * \ - ( (x->zbin_over_quant / 2) + \ - x->zbin_mode_boost + \ - x->act_zbin_adj ) ) >> 7) - -void vp8cx_mb_init_quantizer(VP8_COMP *cpi, MACROBLOCK *x, int ok_to_skip) -{ - int i; - int QIndex; - MACROBLOCKD *xd = &x->e_mbd; - int zbin_extra; - - /* Select the baseline MB Q index. */ - if (xd->segmentation_enabled) - { - /* Abs Value */ - if (xd->mb_segement_abs_delta == SEGMENT_ABSDATA) - QIndex = xd->segment_feature_data[MB_LVL_ALT_Q][xd->mode_info_context->mbmi.segment_id]; - /* Delta Value */ - else - { - QIndex = cpi->common.base_qindex + xd->segment_feature_data[MB_LVL_ALT_Q][xd->mode_info_context->mbmi.segment_id]; - /* Clamp to valid range */ - QIndex = (QIndex >= 0) ? ((QIndex <= MAXQ) ? QIndex : MAXQ) : 0; - } - } - else - QIndex = cpi->common.base_qindex; - - /* This initialization should be called at least once. Use ok_to_skip to - * decide if it is ok to skip. - * Before encoding a frame, this function is always called with ok_to_skip - * =0, which means no skiping of calculations. The "last" values are - * initialized at that time. - */ - if (!ok_to_skip || QIndex != x->q_index) - { - - xd->dequant_y1_dc[0] = 1; - xd->dequant_y1[0] = cpi->common.Y1dequant[QIndex][0]; - xd->dequant_y2[0] = cpi->common.Y2dequant[QIndex][0]; - xd->dequant_uv[0] = cpi->common.UVdequant[QIndex][0]; - - for (i = 1; i < 16; i++) - { - xd->dequant_y1_dc[i] = - xd->dequant_y1[i] = cpi->common.Y1dequant[QIndex][1]; - xd->dequant_y2[i] = cpi->common.Y2dequant[QIndex][1]; - xd->dequant_uv[i] = cpi->common.UVdequant[QIndex][1]; - } -#if 1 - /*TODO: Remove dequant from BLOCKD. This is a temporary solution until - * the quantizer code uses a passed in pointer to the dequant constants. - * This will also require modifications to the x86 and neon assembly. - * */ - for (i = 0; i < 16; i++) - x->e_mbd.block[i].dequant = xd->dequant_y1; - for (i = 16; i < 24; i++) - x->e_mbd.block[i].dequant = xd->dequant_uv; - x->e_mbd.block[24].dequant = xd->dequant_y2; -#endif - - /* Y */ - zbin_extra = ZBIN_EXTRA_Y; - - for (i = 0; i < 16; i++) - { - x->block[i].quant = cpi->Y1quant[QIndex]; - x->block[i].quant_fast = cpi->Y1quant_fast[QIndex]; - x->block[i].quant_shift = cpi->Y1quant_shift[QIndex]; - x->block[i].zbin = cpi->Y1zbin[QIndex]; - x->block[i].round = cpi->Y1round[QIndex]; - x->block[i].zrun_zbin_boost = cpi->zrun_zbin_boost_y1[QIndex]; - x->block[i].zbin_extra = (short)zbin_extra; - } - - /* UV */ - zbin_extra = ZBIN_EXTRA_UV; - - for (i = 16; i < 24; i++) - { - x->block[i].quant = cpi->UVquant[QIndex]; - x->block[i].quant_fast = cpi->UVquant_fast[QIndex]; - x->block[i].quant_shift = cpi->UVquant_shift[QIndex]; - x->block[i].zbin = cpi->UVzbin[QIndex]; - x->block[i].round = cpi->UVround[QIndex]; - x->block[i].zrun_zbin_boost = cpi->zrun_zbin_boost_uv[QIndex]; - x->block[i].zbin_extra = (short)zbin_extra; - } - - /* Y2 */ - zbin_extra = ZBIN_EXTRA_Y2; - - x->block[24].quant_fast = cpi->Y2quant_fast[QIndex]; - x->block[24].quant = cpi->Y2quant[QIndex]; - x->block[24].quant_shift = cpi->Y2quant_shift[QIndex]; - x->block[24].zbin = cpi->Y2zbin[QIndex]; - x->block[24].round = cpi->Y2round[QIndex]; - x->block[24].zrun_zbin_boost = cpi->zrun_zbin_boost_y2[QIndex]; - x->block[24].zbin_extra = (short)zbin_extra; - - /* save this macroblock QIndex for vp8_update_zbin_extra() */ - x->q_index = QIndex; - - x->last_zbin_over_quant = x->zbin_over_quant; - x->last_zbin_mode_boost = x->zbin_mode_boost; - x->last_act_zbin_adj = x->act_zbin_adj; - - - - } - else if(x->last_zbin_over_quant != x->zbin_over_quant - || x->last_zbin_mode_boost != x->zbin_mode_boost - || x->last_act_zbin_adj != x->act_zbin_adj) - { - /* Y */ - zbin_extra = ZBIN_EXTRA_Y; - - for (i = 0; i < 16; i++) - x->block[i].zbin_extra = (short)zbin_extra; - - /* UV */ - zbin_extra = ZBIN_EXTRA_UV; - - for (i = 16; i < 24; i++) - x->block[i].zbin_extra = (short)zbin_extra; - - /* Y2 */ - zbin_extra = ZBIN_EXTRA_Y2; - x->block[24].zbin_extra = (short)zbin_extra; - - x->last_zbin_over_quant = x->zbin_over_quant; - x->last_zbin_mode_boost = x->zbin_mode_boost; - x->last_act_zbin_adj = x->act_zbin_adj; - } -} - -void vp8_update_zbin_extra(VP8_COMP *cpi, MACROBLOCK *x) -{ - int i; - int QIndex = x->q_index; - int zbin_extra; - - /* Y */ - zbin_extra = ZBIN_EXTRA_Y; - - for (i = 0; i < 16; i++) - x->block[i].zbin_extra = (short)zbin_extra; - - /* UV */ - zbin_extra = ZBIN_EXTRA_UV; - - for (i = 16; i < 24; i++) - x->block[i].zbin_extra = (short)zbin_extra; - - /* Y2 */ - zbin_extra = ZBIN_EXTRA_Y2; - x->block[24].zbin_extra = (short)zbin_extra; -} -#undef ZBIN_EXTRA_Y -#undef ZBIN_EXTRA_UV -#undef ZBIN_EXTRA_Y2 - -void vp8cx_frame_init_quantizer(VP8_COMP *cpi) -{ - /* Clear Zbin mode boost for default case */ - cpi->mb.zbin_mode_boost = 0; - - /* MB level quantizer setup */ - vp8cx_mb_init_quantizer(cpi, &cpi->mb, 0); -} - - -void vp8_set_quantizer(struct VP8_COMP *cpi, int Q) -{ - VP8_COMMON *cm = &cpi->common; - MACROBLOCKD *mbd = &cpi->mb.e_mbd; - int update = 0; - int new_delta_q; - int new_uv_delta_q; - cm->base_qindex = Q; - - /* if any of the delta_q values are changing update flag has to be set */ - /* currently only y2dc_delta_q may change */ - - cm->y1dc_delta_q = 0; - cm->y2ac_delta_q = 0; - - if (Q < 4) - { - new_delta_q = 4-Q; - } - else - new_delta_q = 0; - - update |= cm->y2dc_delta_q != new_delta_q; - cm->y2dc_delta_q = new_delta_q; - - new_uv_delta_q = 0; - // For screen content, lower the q value for UV channel. For now, select - // conservative delta; same delta for dc and ac, and decrease it with lower - // Q, and set to 0 below some threshold. May want to condition this in - // future on the variance/energy in UV channel. - if (cpi->oxcf.screen_content_mode && Q > 40) { - new_uv_delta_q = -(int)(0.15 * Q); - // Check range: magnitude of delta is 4 bits. - if (new_uv_delta_q < -15) { - new_uv_delta_q = -15; - } - } - update |= cm->uvdc_delta_q != new_uv_delta_q; - cm->uvdc_delta_q = new_uv_delta_q; - cm->uvac_delta_q = new_uv_delta_q; - - /* Set Segment specific quatizers */ - mbd->segment_feature_data[MB_LVL_ALT_Q][0] = cpi->segment_feature_data[MB_LVL_ALT_Q][0]; - mbd->segment_feature_data[MB_LVL_ALT_Q][1] = cpi->segment_feature_data[MB_LVL_ALT_Q][1]; - mbd->segment_feature_data[MB_LVL_ALT_Q][2] = cpi->segment_feature_data[MB_LVL_ALT_Q][2]; - mbd->segment_feature_data[MB_LVL_ALT_Q][3] = cpi->segment_feature_data[MB_LVL_ALT_Q][3]; - - /* quantizer has to be reinitialized for any delta_q changes */ - if(update) - vp8cx_init_quantizer(cpi); - -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/quantize.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/quantize.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/quantize.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/quantize.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_ENCODER_QUANTIZE_H_ -#define VP8_ENCODER_QUANTIZE_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -struct VP8_COMP; -struct macroblock; -extern void vp8_quantize_mb(struct macroblock *x); -extern void vp8_quantize_mby(struct macroblock *x); -extern void vp8_quantize_mbuv(struct macroblock *x); -extern void vp8_set_quantizer(struct VP8_COMP *cpi, int Q); -extern void vp8cx_frame_init_quantizer(struct VP8_COMP *cpi); -extern void vp8_update_zbin_extra(struct VP8_COMP *cpi, struct macroblock *x); -extern void vp8cx_mb_init_quantizer(struct VP8_COMP *cpi, struct macroblock *x, int ok_to_skip); -extern void vp8cx_init_quantizer(struct VP8_COMP *cpi); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_QUANTIZE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/ratectrl.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/ratectrl.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/ratectrl.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/ratectrl.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1561 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include -#include -#include -#include -#include - -#include "math.h" -#include "vp8/common/common.h" -#include "ratectrl.h" -#include "vp8/common/entropymode.h" -#include "vpx_mem/vpx_mem.h" -#include "vp8/common/systemdependent.h" -#include "encodemv.h" - - -#define MIN_BPB_FACTOR 0.01 -#define MAX_BPB_FACTOR 50 - -extern const MB_PREDICTION_MODE vp8_mode_order[MAX_MODES]; - - - -#ifdef MODE_STATS -extern int y_modes[5]; -extern int uv_modes[4]; -extern int b_modes[10]; - -extern int inter_y_modes[10]; -extern int inter_uv_modes[4]; -extern int inter_b_modes[10]; -#endif - -/* Bits Per MB at different Q (Multiplied by 512) */ -#define BPER_MB_NORMBITS 9 - -/* Work in progress recalibration of baseline rate tables based on - * the assumption that bits per mb is inversely proportional to the - * quantizer value. - */ -const int vp8_bits_per_mb[2][QINDEX_RANGE] = -{ - /* Intra case 450000/Qintra */ - { - 1125000,900000, 750000, 642857, 562500, 500000, 450000, 450000, - 409090, 375000, 346153, 321428, 300000, 281250, 264705, 264705, - 250000, 236842, 225000, 225000, 214285, 214285, 204545, 204545, - 195652, 195652, 187500, 180000, 180000, 173076, 166666, 160714, - 155172, 150000, 145161, 140625, 136363, 132352, 128571, 125000, - 121621, 121621, 118421, 115384, 112500, 109756, 107142, 104651, - 102272, 100000, 97826, 97826, 95744, 93750, 91836, 90000, - 88235, 86538, 84905, 83333, 81818, 80357, 78947, 77586, - 76271, 75000, 73770, 72580, 71428, 70312, 69230, 68181, - 67164, 66176, 65217, 64285, 63380, 62500, 61643, 60810, - 60000, 59210, 59210, 58441, 57692, 56962, 56250, 55555, - 54878, 54216, 53571, 52941, 52325, 51724, 51136, 50561, - 49450, 48387, 47368, 46875, 45918, 45000, 44554, 44117, - 43269, 42452, 41666, 40909, 40178, 39473, 38793, 38135, - 36885, 36290, 35714, 35156, 34615, 34090, 33582, 33088, - 32608, 32142, 31468, 31034, 30405, 29801, 29220, 28662, - }, - /* Inter case 285000/Qinter */ - { - 712500, 570000, 475000, 407142, 356250, 316666, 285000, 259090, - 237500, 219230, 203571, 190000, 178125, 167647, 158333, 150000, - 142500, 135714, 129545, 123913, 118750, 114000, 109615, 105555, - 101785, 98275, 95000, 91935, 89062, 86363, 83823, 81428, - 79166, 77027, 75000, 73076, 71250, 69512, 67857, 66279, - 64772, 63333, 61956, 60638, 59375, 58163, 57000, 55882, - 54807, 53773, 52777, 51818, 50892, 50000, 49137, 47500, - 45967, 44531, 43181, 41911, 40714, 39583, 38513, 37500, - 36538, 35625, 34756, 33928, 33139, 32386, 31666, 30978, - 30319, 29687, 29081, 28500, 27941, 27403, 26886, 26388, - 25909, 25446, 25000, 24568, 23949, 23360, 22800, 22265, - 21755, 21268, 20802, 20357, 19930, 19520, 19127, 18750, - 18387, 18037, 17701, 17378, 17065, 16764, 16473, 16101, - 15745, 15405, 15079, 14766, 14467, 14179, 13902, 13636, - 13380, 13133, 12895, 12666, 12445, 12179, 11924, 11632, - 11445, 11220, 11003, 10795, 10594, 10401, 10215, 10035, - } -}; - -static const int kf_boost_qadjustment[QINDEX_RANGE] = -{ - 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, 200, 201, 201, 202, 203, 203, 203, - 204, 204, 205, 205, 206, 206, 207, 207, - 208, 208, 209, 209, 210, 210, 211, 211, - 212, 212, 213, 213, 214, 214, 215, 215, - 216, 216, 217, 217, 218, 218, 219, 219, - 220, 220, 220, 220, 220, 220, 220, 220, - 220, 220, 220, 220, 220, 220, 220, 220, -}; - -/* #define GFQ_ADJUSTMENT (Q+100) */ -#define GFQ_ADJUSTMENT vp8_gf_boost_qadjustment[Q] -const int vp8_gf_boost_qadjustment[QINDEX_RANGE] = -{ - 80, 82, 84, 86, 88, 90, 92, 94, - 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, 184, 185, 185, 186, 186, 187, 187, - 188, 188, 189, 189, 190, 190, 191, 191, - 192, 192, 193, 193, 194, 194, 194, 194, - 195, 195, 196, 196, 197, 197, 198, 198 -}; - -/* -const int vp8_gf_boost_qadjustment[QINDEX_RANGE] = -{ - 100,101,102,103,104,105,105,106, - 106,107,107,108,109,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,170,171,171,172,172, - 173,173,173,174,174,174,175,175, - 175,176,176,176,177,177,177,177, - 178,178,179,179,180,180,181,181, - 182,182,183,183,184,184,185,185, - 186,186,187,187,188,188,189,189, - 190,190,191,191,192,192,193,193, -}; -*/ - -static const int kf_gf_boost_qlimits[QINDEX_RANGE] = -{ - 150, 155, 160, 165, 170, 175, 180, 185, - 190, 195, 200, 205, 210, 215, 220, 225, - 230, 235, 240, 245, 250, 255, 260, 265, - 270, 275, 280, 285, 290, 295, 300, 305, - 310, 320, 330, 340, 350, 360, 370, 380, - 390, 400, 410, 420, 430, 440, 450, 460, - 470, 480, 490, 500, 510, 520, 530, 540, - 550, 560, 570, 580, 590, 600, 600, 600, - 600, 600, 600, 600, 600, 600, 600, 600, - 600, 600, 600, 600, 600, 600, 600, 600, - 600, 600, 600, 600, 600, 600, 600, 600, - 600, 600, 600, 600, 600, 600, 600, 600, - 600, 600, 600, 600, 600, 600, 600, 600, - 600, 600, 600, 600, 600, 600, 600, 600, - 600, 600, 600, 600, 600, 600, 600, 600, - 600, 600, 600, 600, 600, 600, 600, 600, -}; - -static const int gf_adjust_table[101] = -{ - 100, - 115, 130, 145, 160, 175, 190, 200, 210, 220, 230, - 240, 260, 270, 280, 290, 300, 310, 320, 330, 340, - 350, 360, 370, 380, 390, 400, 400, 400, 400, 400, - 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, - 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, - 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, - 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, - 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, - 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, - 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, -}; - -static const int gf_intra_usage_adjustment[20] = -{ - 125, 120, 115, 110, 105, 100, 95, 85, 80, 75, - 70, 65, 60, 55, 50, 50, 50, 50, 50, 50, -}; - -static const int gf_interval_table[101] = -{ - 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 8, 8, 8, 8, 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, 9, 9, 9, 9, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, -}; - -static const unsigned int prior_key_frame_weight[KEY_FRAME_CONTEXT] = { 1, 2, 3, 4, 5 }; - - -void vp8_save_coding_context(VP8_COMP *cpi) -{ - CODING_CONTEXT *const cc = & cpi->coding_context; - - /* Stores a snapshot of key state variables which can subsequently be - * restored with a call to vp8_restore_coding_context. These functions are - * intended for use in a re-code loop in vp8_compress_frame where the - * quantizer value is adjusted between loop iterations. - */ - - cc->frames_since_key = cpi->frames_since_key; - cc->filter_level = cpi->common.filter_level; - cc->frames_till_gf_update_due = cpi->frames_till_gf_update_due; - cc->frames_since_golden = cpi->frames_since_golden; - - vp8_copy(cc->mvc, cpi->common.fc.mvc); - vp8_copy(cc->mvcosts, cpi->rd_costs.mvcosts); - - vp8_copy(cc->ymode_prob, cpi->common.fc.ymode_prob); - vp8_copy(cc->uv_mode_prob, cpi->common.fc.uv_mode_prob); - - vp8_copy(cc->ymode_count, cpi->mb.ymode_count); - vp8_copy(cc->uv_mode_count, cpi->mb.uv_mode_count); - - - /* Stats */ -#ifdef MODE_STATS - vp8_copy(cc->y_modes, y_modes); - vp8_copy(cc->uv_modes, uv_modes); - vp8_copy(cc->b_modes, b_modes); - vp8_copy(cc->inter_y_modes, inter_y_modes); - vp8_copy(cc->inter_uv_modes, inter_uv_modes); - vp8_copy(cc->inter_b_modes, inter_b_modes); -#endif - - cc->this_frame_percent_intra = cpi->this_frame_percent_intra; -} - - -void vp8_restore_coding_context(VP8_COMP *cpi) -{ - CODING_CONTEXT *const cc = & cpi->coding_context; - - /* Restore key state variables to the snapshot state stored in the - * previous call to vp8_save_coding_context. - */ - - cpi->frames_since_key = cc->frames_since_key; - cpi->common.filter_level = cc->filter_level; - cpi->frames_till_gf_update_due = cc->frames_till_gf_update_due; - cpi->frames_since_golden = cc->frames_since_golden; - - vp8_copy(cpi->common.fc.mvc, cc->mvc); - - vp8_copy(cpi->rd_costs.mvcosts, cc->mvcosts); - - vp8_copy(cpi->common.fc.ymode_prob, cc->ymode_prob); - vp8_copy(cpi->common.fc.uv_mode_prob, cc->uv_mode_prob); - - vp8_copy(cpi->mb.ymode_count, cc->ymode_count); - vp8_copy(cpi->mb.uv_mode_count, cc->uv_mode_count); - - /* Stats */ -#ifdef MODE_STATS - vp8_copy(y_modes, cc->y_modes); - vp8_copy(uv_modes, cc->uv_modes); - vp8_copy(b_modes, cc->b_modes); - vp8_copy(inter_y_modes, cc->inter_y_modes); - vp8_copy(inter_uv_modes, cc->inter_uv_modes); - vp8_copy(inter_b_modes, cc->inter_b_modes); -#endif - - - cpi->this_frame_percent_intra = cc->this_frame_percent_intra; -} - - -void vp8_setup_key_frame(VP8_COMP *cpi) -{ - /* Setup for Key frame: */ - - vp8_default_coef_probs(& cpi->common); - - vpx_memcpy(cpi->common.fc.mvc, vp8_default_mv_context, sizeof(vp8_default_mv_context)); - { - int flag[2] = {1, 1}; - vp8_build_component_cost_table(cpi->mb.mvcost, (const MV_CONTEXT *) cpi->common.fc.mvc, flag); - } - - /* Make sure we initialize separate contexts for altref,gold, and normal. - * TODO shouldn't need 3 different copies of structure to do this! - */ - vpx_memcpy(&cpi->lfc_a, &cpi->common.fc, sizeof(cpi->common.fc)); - vpx_memcpy(&cpi->lfc_g, &cpi->common.fc, sizeof(cpi->common.fc)); - vpx_memcpy(&cpi->lfc_n, &cpi->common.fc, sizeof(cpi->common.fc)); - - cpi->common.filter_level = cpi->common.base_qindex * 3 / 8 ; - - /* Provisional interval before next GF */ - if (cpi->auto_gold) - cpi->frames_till_gf_update_due = cpi->baseline_gf_interval; - else - cpi->frames_till_gf_update_due = DEFAULT_GF_INTERVAL; - - cpi->common.refresh_golden_frame = 1; - cpi->common.refresh_alt_ref_frame = 1; -} - - -static int estimate_bits_at_q(int frame_kind, int Q, int MBs, - double correction_factor) -{ - int Bpm = (int)(.5 + correction_factor * vp8_bits_per_mb[frame_kind][Q]); - - /* Attempt to retain reasonable accuracy without overflow. The cutoff is - * chosen such that the maximum product of Bpm and MBs fits 31 bits. The - * largest Bpm takes 20 bits. - */ - if (MBs > (1 << 11)) - return (Bpm >> BPER_MB_NORMBITS) * MBs; - else - return (Bpm * MBs) >> BPER_MB_NORMBITS; -} - - -static void calc_iframe_target_size(VP8_COMP *cpi) -{ - /* boost defaults to half second */ - int kf_boost; - uint64_t target; - - /* Clear down mmx registers to allow floating point in what follows */ - vp8_clear_system_state(); - - if (cpi->oxcf.fixed_q >= 0) - { - int Q = cpi->oxcf.key_q; - - target = estimate_bits_at_q(INTRA_FRAME, Q, cpi->common.MBs, - cpi->key_frame_rate_correction_factor); - } - else if (cpi->pass == 2) - { - /* New Two pass RC */ - target = cpi->per_frame_bandwidth; - } - /* First Frame is a special case */ - else if (cpi->common.current_video_frame == 0) - { - /* 1 Pass there is no information on which to base size so use - * bandwidth per second * fraction of the initial buffer - * level - */ - target = cpi->oxcf.starting_buffer_level / 2; - - if(target > cpi->oxcf.target_bandwidth * 3 / 2) - target = cpi->oxcf.target_bandwidth * 3 / 2; - } - else - { - /* if this keyframe was forced, use a more recent Q estimate */ - int Q = (cpi->common.frame_flags & FRAMEFLAGS_KEY) - ? cpi->avg_frame_qindex : cpi->ni_av_qi; - - int initial_boost = 32; /* |3.0 * per_frame_bandwidth| */ - /* Boost depends somewhat on frame rate: only used for 1 layer case. */ - if (cpi->oxcf.number_of_layers == 1) { - kf_boost = MAX(initial_boost, (int)(2 * cpi->output_framerate - 16)); - } - else { - /* Initial factor: set target size to: |3.0 * per_frame_bandwidth|. */ - kf_boost = initial_boost; - } - - /* adjustment up based on q: this factor ranges from ~1.2 to 2.2. */ - kf_boost = kf_boost * kf_boost_qadjustment[Q] / 100; - - /* frame separation adjustment ( down) */ - if (cpi->frames_since_key < cpi->output_framerate / 2) - kf_boost = (int)(kf_boost - * cpi->frames_since_key / (cpi->output_framerate / 2)); - - /* Minimal target size is |2* per_frame_bandwidth|. */ - if (kf_boost < 16) - kf_boost = 16; - - target = ((16 + kf_boost) * cpi->per_frame_bandwidth) >> 4; - } - - - if (cpi->oxcf.rc_max_intra_bitrate_pct) - { - unsigned int max_rate = cpi->per_frame_bandwidth - * cpi->oxcf.rc_max_intra_bitrate_pct / 100; - - if (target > max_rate) - target = max_rate; - } - - cpi->this_frame_target = (int)target; - - /* TODO: if we separate rate targeting from Q targetting, move this. - * Reset the active worst quality to the baseline value for key frames. - */ - if (cpi->pass != 2) - cpi->active_worst_quality = cpi->worst_quality; - -#if 0 - { - FILE *f; - - f = fopen("kf_boost.stt", "a"); - fprintf(f, " %8u %10d %10d %10d\n", - cpi->common.current_video_frame, cpi->gfu_boost, cpi->baseline_gf_interval, cpi->source_alt_ref_pending); - - fclose(f); - } -#endif -} - - -/* Do the best we can to define the parameters for the next GF based on what - * information we have available. - */ -static void calc_gf_params(VP8_COMP *cpi) -{ - int Q = (cpi->oxcf.fixed_q < 0) ? cpi->last_q[INTER_FRAME] : cpi->oxcf.fixed_q; - int Boost = 0; - - int gf_frame_useage = 0; /* Golden frame useage since last GF */ - int tot_mbs = cpi->recent_ref_frame_usage[INTRA_FRAME] + - cpi->recent_ref_frame_usage[LAST_FRAME] + - cpi->recent_ref_frame_usage[GOLDEN_FRAME] + - cpi->recent_ref_frame_usage[ALTREF_FRAME]; - - int pct_gf_active = (100 * cpi->gf_active_count) / (cpi->common.mb_rows * cpi->common.mb_cols); - - if (tot_mbs) - gf_frame_useage = (cpi->recent_ref_frame_usage[GOLDEN_FRAME] + cpi->recent_ref_frame_usage[ALTREF_FRAME]) * 100 / tot_mbs; - - if (pct_gf_active > gf_frame_useage) - gf_frame_useage = pct_gf_active; - - /* Not two pass */ - if (cpi->pass != 2) - { - /* Single Pass lagged mode: TBD */ - if (0) - { - } - - /* Single Pass compression: Has to use current and historical data */ - else - { -#if 0 - /* Experimental code */ - int index = cpi->one_pass_frame_index; - int frames_to_scan = (cpi->max_gf_interval <= MAX_LAG_BUFFERS) ? cpi->max_gf_interval : MAX_LAG_BUFFERS; - - /* ************** Experimental code - incomplete */ - /* - double decay_val = 1.0; - double IIAccumulator = 0.0; - double last_iiaccumulator = 0.0; - double IIRatio; - - cpi->one_pass_frame_index = cpi->common.current_video_frame%MAX_LAG_BUFFERS; - - for ( i = 0; i < (frames_to_scan - 1); i++ ) - { - if ( index < 0 ) - index = MAX_LAG_BUFFERS; - index --; - - if ( cpi->one_pass_frame_stats[index].frame_coded_error > 0.0 ) - { - IIRatio = cpi->one_pass_frame_stats[index].frame_intra_error / cpi->one_pass_frame_stats[index].frame_coded_error; - - if ( IIRatio > 30.0 ) - IIRatio = 30.0; - } - else - IIRatio = 30.0; - - IIAccumulator += IIRatio * decay_val; - - decay_val = decay_val * cpi->one_pass_frame_stats[index].frame_pcnt_inter; - - if ( (i > MIN_GF_INTERVAL) && - ((IIAccumulator - last_iiaccumulator) < 2.0) ) - { - break; - } - last_iiaccumulator = IIAccumulator; - } - - Boost = IIAccumulator*100.0/16.0; - cpi->baseline_gf_interval = i; - - */ -#else - - /*************************************************************/ - /* OLD code */ - - /* Adjust boost based upon ambient Q */ - Boost = GFQ_ADJUSTMENT; - - /* Adjust based upon most recently measure intra useage */ - Boost = Boost * gf_intra_usage_adjustment[(cpi->this_frame_percent_intra < 15) ? cpi->this_frame_percent_intra : 14] / 100; - - /* Adjust gf boost based upon GF usage since last GF */ - Boost = Boost * gf_adjust_table[gf_frame_useage] / 100; -#endif - } - - /* golden frame boost without recode loop often goes awry. be - * safe by keeping numbers down. - */ - if (!cpi->sf.recode_loop) - { - if (cpi->compressor_speed == 2) - Boost = Boost / 2; - } - - /* Apply an upper limit based on Q for 1 pass encodes */ - if (Boost > kf_gf_boost_qlimits[Q] && (cpi->pass == 0)) - Boost = kf_gf_boost_qlimits[Q]; - - /* Apply lower limits to boost. */ - else if (Boost < 110) - Boost = 110; - - /* Note the boost used */ - cpi->last_boost = Boost; - - } - - /* Estimate next interval - * This is updated once the real frame size/boost is known. - */ - if (cpi->oxcf.fixed_q == -1) - { - if (cpi->pass == 2) /* 2 Pass */ - { - cpi->frames_till_gf_update_due = cpi->baseline_gf_interval; - } - else /* 1 Pass */ - { - cpi->frames_till_gf_update_due = cpi->baseline_gf_interval; - - if (cpi->last_boost > 750) - cpi->frames_till_gf_update_due++; - - if (cpi->last_boost > 1000) - cpi->frames_till_gf_update_due++; - - if (cpi->last_boost > 1250) - cpi->frames_till_gf_update_due++; - - if (cpi->last_boost >= 1500) - cpi->frames_till_gf_update_due ++; - - if (gf_interval_table[gf_frame_useage] > cpi->frames_till_gf_update_due) - cpi->frames_till_gf_update_due = gf_interval_table[gf_frame_useage]; - - if (cpi->frames_till_gf_update_due > cpi->max_gf_interval) - cpi->frames_till_gf_update_due = cpi->max_gf_interval; - } - } - else - cpi->frames_till_gf_update_due = cpi->baseline_gf_interval; - - /* ARF on or off */ - if (cpi->pass != 2) - { - /* For now Alt ref is not allowed except in 2 pass modes. */ - cpi->source_alt_ref_pending = 0; - - /*if ( cpi->oxcf.fixed_q == -1) - { - if ( cpi->oxcf.play_alternate && (cpi->last_boost > (100 + (AF_THRESH*cpi->frames_till_gf_update_due)) ) ) - cpi->source_alt_ref_pending = 1; - else - cpi->source_alt_ref_pending = 0; - }*/ - } -} - - -static void calc_pframe_target_size(VP8_COMP *cpi) -{ - int min_frame_target; - int old_per_frame_bandwidth = cpi->per_frame_bandwidth; - - if ( cpi->current_layer > 0) - cpi->per_frame_bandwidth = - cpi->layer_context[cpi->current_layer].avg_frame_size_for_layer; - - min_frame_target = 0; - - if (cpi->pass == 2) - { - min_frame_target = cpi->min_frame_bandwidth; - - if (min_frame_target < (cpi->av_per_frame_bandwidth >> 5)) - min_frame_target = cpi->av_per_frame_bandwidth >> 5; - } - else if (min_frame_target < cpi->per_frame_bandwidth / 4) - min_frame_target = cpi->per_frame_bandwidth / 4; - - - /* Special alt reference frame case */ - if((cpi->common.refresh_alt_ref_frame) && (cpi->oxcf.number_of_layers == 1)) - { - if (cpi->pass == 2) - { - /* Per frame bit target for the alt ref frame */ - cpi->per_frame_bandwidth = cpi->twopass.gf_bits; - cpi->this_frame_target = cpi->per_frame_bandwidth; - } - - /* One Pass ??? TBD */ - } - - /* Normal frames (gf,and inter) */ - else - { - /* 2 pass */ - if (cpi->pass == 2) - { - cpi->this_frame_target = cpi->per_frame_bandwidth; - } - /* 1 pass */ - else - { - int Adjustment; - /* Make rate adjustment to recover bits spent in key frame - * Test to see if the key frame inter data rate correction - * should still be in force - */ - if (cpi->kf_overspend_bits > 0) - { - Adjustment = (cpi->kf_bitrate_adjustment <= cpi->kf_overspend_bits) ? cpi->kf_bitrate_adjustment : cpi->kf_overspend_bits; - - if (Adjustment > (cpi->per_frame_bandwidth - min_frame_target)) - Adjustment = (cpi->per_frame_bandwidth - min_frame_target); - - cpi->kf_overspend_bits -= Adjustment; - - /* Calculate an inter frame bandwidth target for the next - * few frames designed to recover any extra bits spent on - * the key frame. - */ - cpi->this_frame_target = cpi->per_frame_bandwidth - Adjustment; - - if (cpi->this_frame_target < min_frame_target) - cpi->this_frame_target = min_frame_target; - } - else - cpi->this_frame_target = cpi->per_frame_bandwidth; - - /* If appropriate make an adjustment to recover bits spent on a - * recent GF - */ - if ((cpi->gf_overspend_bits > 0) && (cpi->this_frame_target > min_frame_target)) - { - Adjustment = (cpi->non_gf_bitrate_adjustment <= cpi->gf_overspend_bits) ? cpi->non_gf_bitrate_adjustment : cpi->gf_overspend_bits; - - if (Adjustment > (cpi->this_frame_target - min_frame_target)) - Adjustment = (cpi->this_frame_target - min_frame_target); - - cpi->gf_overspend_bits -= Adjustment; - cpi->this_frame_target -= Adjustment; - } - - /* Apply small + and - boosts for non gf frames */ - if ((cpi->last_boost > 150) && (cpi->frames_till_gf_update_due > 0) && - (cpi->current_gf_interval >= (MIN_GF_INTERVAL << 1))) - { - /* % Adjustment limited to the range 1% to 10% */ - Adjustment = (cpi->last_boost - 100) >> 5; - - if (Adjustment < 1) - Adjustment = 1; - else if (Adjustment > 10) - Adjustment = 10; - - /* Convert to bits */ - Adjustment = (cpi->this_frame_target * Adjustment) / 100; - - if (Adjustment > (cpi->this_frame_target - min_frame_target)) - Adjustment = (cpi->this_frame_target - min_frame_target); - - if (cpi->frames_since_golden == (cpi->current_gf_interval >> 1)) - { - Adjustment = (cpi->current_gf_interval - 1) * Adjustment; - // Limit adjustment to 10% of current target. - if (Adjustment > (10 * cpi->this_frame_target) / 100) - Adjustment = (10 * cpi->this_frame_target) / 100; - cpi->this_frame_target += Adjustment; - } - else - cpi->this_frame_target -= Adjustment; - } - } - } - - /* Sanity check that the total sum of adjustments is not above the - * maximum allowed That is that having allowed for KF and GF penalties - * we have not pushed the current interframe target to low. If the - * adjustment we apply here is not capable of recovering all the extra - * bits we have spent in the KF or GF then the remainder will have to - * be recovered over a longer time span via other buffer / rate control - * mechanisms. - */ - if (cpi->this_frame_target < min_frame_target) - cpi->this_frame_target = min_frame_target; - - if (!cpi->common.refresh_alt_ref_frame) - /* Note the baseline target data rate for this inter frame. */ - cpi->inter_frame_target = cpi->this_frame_target; - - /* One Pass specific code */ - if (cpi->pass == 0) - { - /* Adapt target frame size with respect to any buffering constraints: */ - if (cpi->buffered_mode) - { - int one_percent_bits = (int) - (1 + cpi->oxcf.optimal_buffer_level / 100); - - if ((cpi->buffer_level < cpi->oxcf.optimal_buffer_level) || - (cpi->bits_off_target < cpi->oxcf.optimal_buffer_level)) - { - int percent_low = 0; - - /* Decide whether or not we need to adjust the frame data - * rate target. - * - * If we are are below the optimal buffer fullness level - * and adherence to buffering constraints is important to - * the end usage then adjust the per frame target. - */ - if ((cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) && - (cpi->buffer_level < cpi->oxcf.optimal_buffer_level)) - { - percent_low = (int) - ((cpi->oxcf.optimal_buffer_level - cpi->buffer_level) / - one_percent_bits); - } - /* Are we overshooting the long term clip data rate... */ - else if (cpi->bits_off_target < 0) - { - /* Adjust per frame data target downwards to compensate. */ - percent_low = (int)(100 * -cpi->bits_off_target / - (cpi->total_byte_count * 8)); - } - - if (percent_low > cpi->oxcf.under_shoot_pct) - percent_low = cpi->oxcf.under_shoot_pct; - else if (percent_low < 0) - percent_low = 0; - - /* lower the target bandwidth for this frame. */ - cpi->this_frame_target -= - (cpi->this_frame_target * percent_low) / 200; - - /* Are we using allowing control of active_worst_allowed_q - * according to buffer level. - */ - if (cpi->auto_worst_q && cpi->ni_frames > 150) - { - int64_t critical_buffer_level; - - /* For streaming applications the most important factor is - * cpi->buffer_level as this takes into account the - * specified short term buffering constraints. However, - * hitting the long term clip data rate target is also - * important. - */ - if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) - { - /* Take the smaller of cpi->buffer_level and - * cpi->bits_off_target - */ - critical_buffer_level = - (cpi->buffer_level < cpi->bits_off_target) - ? cpi->buffer_level : cpi->bits_off_target; - } - /* For local file playback short term buffering constraints - * are less of an issue - */ - else - { - /* Consider only how we are doing for the clip as a - * whole - */ - critical_buffer_level = cpi->bits_off_target; - } - - /* Set the active worst quality based upon the selected - * buffer fullness number. - */ - if (critical_buffer_level < cpi->oxcf.optimal_buffer_level) - { - if ( critical_buffer_level > - (cpi->oxcf.optimal_buffer_level >> 2) ) - { - int64_t qadjustment_range = - cpi->worst_quality - cpi->ni_av_qi; - int64_t above_base = - (critical_buffer_level - - (cpi->oxcf.optimal_buffer_level >> 2)); - - /* Step active worst quality down from - * cpi->ni_av_qi when (critical_buffer_level == - * cpi->optimal_buffer_level) to - * cpi->worst_quality when - * (critical_buffer_level == - * cpi->optimal_buffer_level >> 2) - */ - cpi->active_worst_quality = - cpi->worst_quality - - (int)((qadjustment_range * above_base) / - (cpi->oxcf.optimal_buffer_level*3>>2)); - } - else - { - cpi->active_worst_quality = cpi->worst_quality; - } - } - else - { - cpi->active_worst_quality = cpi->ni_av_qi; - } - } - else - { - cpi->active_worst_quality = cpi->worst_quality; - } - } - else - { - int percent_high = 0; - - if ((cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) - && (cpi->buffer_level > cpi->oxcf.optimal_buffer_level)) - { - percent_high = (int)((cpi->buffer_level - - cpi->oxcf.optimal_buffer_level) - / one_percent_bits); - } - else if (cpi->bits_off_target > cpi->oxcf.optimal_buffer_level) - { - percent_high = (int)((100 * cpi->bits_off_target) - / (cpi->total_byte_count * 8)); - } - - if (percent_high > cpi->oxcf.over_shoot_pct) - percent_high = cpi->oxcf.over_shoot_pct; - else if (percent_high < 0) - percent_high = 0; - - cpi->this_frame_target += (cpi->this_frame_target * - percent_high) / 200; - - /* Are we allowing control of active_worst_allowed_q according - * to buffer level. - */ - if (cpi->auto_worst_q && cpi->ni_frames > 150) - { - /* When using the relaxed buffer model stick to the - * user specified value - */ - cpi->active_worst_quality = cpi->ni_av_qi; - } - else - { - cpi->active_worst_quality = cpi->worst_quality; - } - } - - /* Set active_best_quality to prevent quality rising too high */ - cpi->active_best_quality = cpi->best_quality; - - /* Worst quality obviously must not be better than best quality */ - if (cpi->active_worst_quality <= cpi->active_best_quality) - cpi->active_worst_quality = cpi->active_best_quality + 1; - - if(cpi->active_worst_quality > 127) - cpi->active_worst_quality = 127; - } - /* Unbuffered mode (eg. video conferencing) */ - else - { - /* Set the active worst quality */ - cpi->active_worst_quality = cpi->worst_quality; - } - - /* Special trap for constrained quality mode - * "active_worst_quality" may never drop below cq level - * for any frame type. - */ - if ( cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY && - cpi->active_worst_quality < cpi->cq_target_quality) - { - cpi->active_worst_quality = cpi->cq_target_quality; - } - } - - /* Test to see if we have to drop a frame - * The auto-drop frame code is only used in buffered mode. - * In unbufferd mode (eg vide conferencing) the descision to - * code or drop a frame is made outside the codec in response to real - * world comms or buffer considerations. - */ - if (cpi->drop_frames_allowed && - (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) && - ((cpi->common.frame_type != KEY_FRAME))) - { - /* Check for a buffer underun-crisis in which case we have to drop - * a frame - */ - if ((cpi->buffer_level < 0)) - { -#if 0 - FILE *f = fopen("dec.stt", "a"); - fprintf(f, "%10d %10d %10d %10d ***** BUFFER EMPTY\n", - (int) cpi->common.current_video_frame, - cpi->decimation_factor, cpi->common.horiz_scale, - (cpi->buffer_level * 100) / cpi->oxcf.optimal_buffer_level); - fclose(f); -#endif - cpi->drop_frame = 1; - - /* Update the buffer level variable. */ - cpi->bits_off_target += cpi->av_per_frame_bandwidth; - if (cpi->bits_off_target > cpi->oxcf.maximum_buffer_size) - cpi->bits_off_target = (int)cpi->oxcf.maximum_buffer_size; - cpi->buffer_level = cpi->bits_off_target; - - if (cpi->oxcf.number_of_layers > 1) { - unsigned int i; - - // Propagate bits saved by dropping the frame to higher layers. - for (i = cpi->current_layer + 1; i < cpi->oxcf.number_of_layers; - i++) { - LAYER_CONTEXT *lc = &cpi->layer_context[i]; - lc->bits_off_target += (int)(lc->target_bandwidth / - lc->framerate); - if (lc->bits_off_target > lc->maximum_buffer_size) - lc->bits_off_target = lc->maximum_buffer_size; - lc->buffer_level = lc->bits_off_target; - } - } - } - } - - /* Adjust target frame size for Golden Frames: */ - if (cpi->oxcf.error_resilient_mode == 0 && - (cpi->frames_till_gf_update_due == 0) && !cpi->drop_frame) - { - int Q = (cpi->oxcf.fixed_q < 0) ? cpi->last_q[INTER_FRAME] : cpi->oxcf.fixed_q; - - int gf_frame_useage = 0; /* Golden frame useage since last GF */ - int tot_mbs = cpi->recent_ref_frame_usage[INTRA_FRAME] + - cpi->recent_ref_frame_usage[LAST_FRAME] + - cpi->recent_ref_frame_usage[GOLDEN_FRAME] + - cpi->recent_ref_frame_usage[ALTREF_FRAME]; - - int pct_gf_active = (100 * cpi->gf_active_count) / (cpi->common.mb_rows * cpi->common.mb_cols); - - if (tot_mbs) - gf_frame_useage = (cpi->recent_ref_frame_usage[GOLDEN_FRAME] + cpi->recent_ref_frame_usage[ALTREF_FRAME]) * 100 / tot_mbs; - - if (pct_gf_active > gf_frame_useage) - gf_frame_useage = pct_gf_active; - - /* Is a fixed manual GF frequency being used */ - if (cpi->auto_gold) - { - /* For one pass throw a GF if recent frame intra useage is - * low or the GF useage is high - */ - if ((cpi->pass == 0) && (cpi->this_frame_percent_intra < 15 || gf_frame_useage >= 5)) - cpi->common.refresh_golden_frame = 1; - - /* Two pass GF descision */ - else if (cpi->pass == 2) - cpi->common.refresh_golden_frame = 1; - } - -#if 0 - - /* Debug stats */ - if (0) - { - FILE *f; - - f = fopen("gf_useaget.stt", "a"); - fprintf(f, " %8ld %10ld %10ld %10ld %10ld\n", - cpi->common.current_video_frame, cpi->gfu_boost, GFQ_ADJUSTMENT, cpi->gfu_boost, gf_frame_useage); - fclose(f); - } - -#endif - - if (cpi->common.refresh_golden_frame == 1) - { -#if 0 - - if (0) - { - FILE *f; - - f = fopen("GFexit.stt", "a"); - fprintf(f, "%8ld GF coded\n", cpi->common.current_video_frame); - fclose(f); - } - -#endif - - if (cpi->auto_adjust_gold_quantizer) - { - calc_gf_params(cpi); - } - - /* If we are using alternate ref instead of gf then do not apply the - * boost It will instead be applied to the altref update Jims - * modified boost - */ - if (!cpi->source_alt_ref_active) - { - if (cpi->oxcf.fixed_q < 0) - { - if (cpi->pass == 2) - { - /* The spend on the GF is defined in the two pass - * code for two pass encodes - */ - cpi->this_frame_target = cpi->per_frame_bandwidth; - } - else - { - int Boost = cpi->last_boost; - int frames_in_section = cpi->frames_till_gf_update_due + 1; - int allocation_chunks = (frames_in_section * 100) + (Boost - 100); - int bits_in_section = cpi->inter_frame_target * frames_in_section; - - /* Normalize Altboost and allocations chunck down to - * prevent overflow - */ - while (Boost > 1000) - { - Boost /= 2; - allocation_chunks /= 2; - } - - /* Avoid loss of precision but avoid overflow */ - if ((bits_in_section >> 7) > allocation_chunks) - cpi->this_frame_target = Boost * (bits_in_section / allocation_chunks); - else - cpi->this_frame_target = (Boost * bits_in_section) / allocation_chunks; - } - } - else - cpi->this_frame_target = - (estimate_bits_at_q(1, Q, cpi->common.MBs, 1.0) - * cpi->last_boost) / 100; - - } - /* If there is an active ARF at this location use the minimum - * bits on this frame even if it is a contructed arf. - * The active maximum quantizer insures that an appropriate - * number of bits will be spent if needed for contstructed ARFs. - */ - else - { - cpi->this_frame_target = 0; - } - - cpi->current_gf_interval = cpi->frames_till_gf_update_due; - - } - } - - cpi->per_frame_bandwidth = old_per_frame_bandwidth; -} - - -void vp8_update_rate_correction_factors(VP8_COMP *cpi, int damp_var) -{ - int Q = cpi->common.base_qindex; - int correction_factor = 100; - double rate_correction_factor; - double adjustment_limit; - - int projected_size_based_on_q = 0; - - /* Clear down mmx registers to allow floating point in what follows */ - vp8_clear_system_state(); - - if (cpi->common.frame_type == KEY_FRAME) - { - rate_correction_factor = cpi->key_frame_rate_correction_factor; - } - else - { - if (cpi->oxcf.number_of_layers == 1 && - (cpi->common.refresh_alt_ref_frame || - cpi->common.refresh_golden_frame)) - rate_correction_factor = cpi->gf_rate_correction_factor; - else - rate_correction_factor = cpi->rate_correction_factor; - } - - /* Work out how big we would have expected the frame to be at this Q - * given the current correction factor. Stay in double to avoid int - * overflow when values are large - */ - projected_size_based_on_q = (int)(((.5 + rate_correction_factor * vp8_bits_per_mb[cpi->common.frame_type][Q]) * cpi->common.MBs) / (1 << BPER_MB_NORMBITS)); - - /* Make some allowance for cpi->zbin_over_quant */ - if (cpi->mb.zbin_over_quant > 0) - { - int Z = cpi->mb.zbin_over_quant; - double Factor = 0.99; - double factor_adjustment = 0.01 / 256.0; - - while (Z > 0) - { - Z --; - projected_size_based_on_q = - (int)(Factor * projected_size_based_on_q); - Factor += factor_adjustment; - - if (Factor >= 0.999) - Factor = 0.999; - } - } - - /* Work out a size correction factor. */ - if (projected_size_based_on_q > 0) - correction_factor = (100 * cpi->projected_frame_size) / projected_size_based_on_q; - - /* More heavily damped adjustment used if we have been oscillating - * either side of target - */ - switch (damp_var) - { - case 0: - adjustment_limit = 0.75; - break; - case 1: - adjustment_limit = 0.375; - break; - case 2: - default: - adjustment_limit = 0.25; - break; - } - - if (correction_factor > 102) - { - /* We are not already at the worst allowable quality */ - correction_factor = (int)(100.5 + ((correction_factor - 100) * adjustment_limit)); - rate_correction_factor = ((rate_correction_factor * correction_factor) / 100); - - /* Keep rate_correction_factor within limits */ - if (rate_correction_factor > MAX_BPB_FACTOR) - rate_correction_factor = MAX_BPB_FACTOR; - } - else if (correction_factor < 99) - { - /* We are not already at the best allowable quality */ - correction_factor = (int)(100.5 - ((100 - correction_factor) * adjustment_limit)); - rate_correction_factor = ((rate_correction_factor * correction_factor) / 100); - - /* Keep rate_correction_factor within limits */ - if (rate_correction_factor < MIN_BPB_FACTOR) - rate_correction_factor = MIN_BPB_FACTOR; - } - - if (cpi->common.frame_type == KEY_FRAME) - cpi->key_frame_rate_correction_factor = rate_correction_factor; - else - { - if (cpi->oxcf.number_of_layers == 1 && - (cpi->common.refresh_alt_ref_frame || - cpi->common.refresh_golden_frame)) - cpi->gf_rate_correction_factor = rate_correction_factor; - else - cpi->rate_correction_factor = rate_correction_factor; - } -} - - -int vp8_regulate_q(VP8_COMP *cpi, int target_bits_per_frame) -{ - int Q = cpi->active_worst_quality; - - /* Reset Zbin OQ value */ - cpi->mb.zbin_over_quant = 0; - - if (cpi->oxcf.fixed_q >= 0) - { - Q = cpi->oxcf.fixed_q; - - if (cpi->common.frame_type == KEY_FRAME) - { - Q = cpi->oxcf.key_q; - } - else if (cpi->oxcf.number_of_layers == 1 && - cpi->common.refresh_alt_ref_frame) - { - Q = cpi->oxcf.alt_q; - } - else if (cpi->oxcf.number_of_layers == 1 && - cpi->common.refresh_golden_frame) - { - Q = cpi->oxcf.gold_q; - } - } - else - { - int i; - int last_error = INT_MAX; - int target_bits_per_mb; - int bits_per_mb_at_this_q; - double correction_factor; - - /* Select the appropriate correction factor based upon type of frame. */ - if (cpi->common.frame_type == KEY_FRAME) - correction_factor = cpi->key_frame_rate_correction_factor; - else - { - if (cpi->oxcf.number_of_layers == 1 && - (cpi->common.refresh_alt_ref_frame || - cpi->common.refresh_golden_frame)) - correction_factor = cpi->gf_rate_correction_factor; - else - correction_factor = cpi->rate_correction_factor; - } - - /* Calculate required scaling factor based on target frame size and - * size of frame produced using previous Q - */ - if (target_bits_per_frame >= (INT_MAX >> BPER_MB_NORMBITS)) - /* Case where we would overflow int */ - target_bits_per_mb = (target_bits_per_frame / cpi->common.MBs) << BPER_MB_NORMBITS; - else - target_bits_per_mb = (target_bits_per_frame << BPER_MB_NORMBITS) / cpi->common.MBs; - - i = cpi->active_best_quality; - - do - { - bits_per_mb_at_this_q = (int)(.5 + correction_factor * vp8_bits_per_mb[cpi->common.frame_type][i]); - - if (bits_per_mb_at_this_q <= target_bits_per_mb) - { - if ((target_bits_per_mb - bits_per_mb_at_this_q) <= last_error) - Q = i; - else - Q = i - 1; - - break; - } - else - last_error = bits_per_mb_at_this_q - target_bits_per_mb; - } - while (++i <= cpi->active_worst_quality); - - - /* If we are at MAXQ then enable Q over-run which seeks to claw - * back additional bits through things like the RD multiplier - * and zero bin size. - */ - if (Q >= MAXQ) - { - int zbin_oqmax; - - double Factor = 0.99; - double factor_adjustment = 0.01 / 256.0; - - if (cpi->common.frame_type == KEY_FRAME) - zbin_oqmax = 0; - else if (cpi->oxcf.number_of_layers == 1 && - (cpi->common.refresh_alt_ref_frame || - (cpi->common.refresh_golden_frame && - !cpi->source_alt_ref_active))) - zbin_oqmax = 16; - else - zbin_oqmax = ZBIN_OQ_MAX; - - /*{ - double Factor = (double)target_bits_per_mb/(double)bits_per_mb_at_this_q; - double Oq; - - Factor = Factor/1.2683; - - Oq = pow( Factor, (1.0/-0.165) ); - - if ( Oq > zbin_oqmax ) - Oq = zbin_oqmax; - - cpi->zbin_over_quant = (int)Oq; - }*/ - - /* Each incrment in the zbin is assumed to have a fixed effect - * on bitrate. This is not of course true. The effect will be - * highly clip dependent and may well have sudden steps. The - * idea here is to acheive higher effective quantizers than the - * normal maximum by expanding the zero bin and hence - * decreasing the number of low magnitude non zero coefficients. - */ - while (cpi->mb.zbin_over_quant < zbin_oqmax) - { - cpi->mb.zbin_over_quant ++; - - if (cpi->mb.zbin_over_quant > zbin_oqmax) - cpi->mb.zbin_over_quant = zbin_oqmax; - - /* Adjust bits_per_mb_at_this_q estimate */ - bits_per_mb_at_this_q = (int)(Factor * bits_per_mb_at_this_q); - Factor += factor_adjustment; - - if (Factor >= 0.999) - Factor = 0.999; - - /* Break out if we get down to the target rate */ - if (bits_per_mb_at_this_q <= target_bits_per_mb) - break; - } - - } - } - - return Q; -} - - -static int estimate_keyframe_frequency(VP8_COMP *cpi) -{ - int i; - - /* Average key frame frequency */ - int av_key_frame_frequency = 0; - - /* First key frame at start of sequence is a special case. We have no - * frequency data. - */ - if (cpi->key_frame_count == 1) - { - /* Assume a default of 1 kf every 2 seconds, or the max kf interval, - * whichever is smaller. - */ - int key_freq = cpi->oxcf.key_freq>0 ? cpi->oxcf.key_freq : 1; - av_key_frame_frequency = 1 + (int)cpi->output_framerate * 2; - - if (cpi->oxcf.auto_key && av_key_frame_frequency > key_freq) - av_key_frame_frequency = key_freq; - - cpi->prior_key_frame_distance[KEY_FRAME_CONTEXT - 1] - = av_key_frame_frequency; - } - else - { - unsigned int total_weight = 0; - int last_kf_interval = - (cpi->frames_since_key > 0) ? cpi->frames_since_key : 1; - - /* reset keyframe context and calculate weighted average of last - * KEY_FRAME_CONTEXT keyframes - */ - for (i = 0; i < KEY_FRAME_CONTEXT; i++) - { - if (i < KEY_FRAME_CONTEXT - 1) - cpi->prior_key_frame_distance[i] - = cpi->prior_key_frame_distance[i+1]; - else - cpi->prior_key_frame_distance[i] = last_kf_interval; - - av_key_frame_frequency += prior_key_frame_weight[i] - * cpi->prior_key_frame_distance[i]; - total_weight += prior_key_frame_weight[i]; - } - - av_key_frame_frequency /= total_weight; - - } - // TODO (marpan): Given the checks above, |av_key_frame_frequency| - // should always be above 0. But for now we keep the sanity check in. - if (av_key_frame_frequency == 0) - av_key_frame_frequency = 1; - return av_key_frame_frequency; -} - - -void vp8_adjust_key_frame_context(VP8_COMP *cpi) -{ - /* Clear down mmx registers to allow floating point in what follows */ - vp8_clear_system_state(); - - /* Do we have any key frame overspend to recover? */ - /* Two-pass overspend handled elsewhere. */ - if ((cpi->pass != 2) - && (cpi->projected_frame_size > cpi->per_frame_bandwidth)) - { - int overspend; - - /* Update the count of key frame overspend to be recovered in - * subsequent frames. A portion of the KF overspend is treated as gf - * overspend (and hence recovered more quickly) as the kf is also a - * gf. Otherwise the few frames following each kf tend to get more - * bits allocated than those following other gfs. - */ - overspend = (cpi->projected_frame_size - cpi->per_frame_bandwidth); - - if (cpi->oxcf.number_of_layers > 1) - cpi->kf_overspend_bits += overspend; - else - { - cpi->kf_overspend_bits += overspend * 7 / 8; - cpi->gf_overspend_bits += overspend * 1 / 8; - } - - /* Work out how much to try and recover per frame. */ - cpi->kf_bitrate_adjustment = cpi->kf_overspend_bits - / estimate_keyframe_frequency(cpi); - } - - cpi->frames_since_key = 0; - cpi->key_frame_count++; -} - - -void vp8_compute_frame_size_bounds(VP8_COMP *cpi, int *frame_under_shoot_limit, int *frame_over_shoot_limit) -{ - /* Set-up bounds on acceptable frame size: */ - if (cpi->oxcf.fixed_q >= 0) - { - /* Fixed Q scenario: frame size never outranges target - * (there is no target!) - */ - *frame_under_shoot_limit = 0; - *frame_over_shoot_limit = INT_MAX; - } - else - { - if (cpi->common.frame_type == KEY_FRAME) - { - *frame_over_shoot_limit = cpi->this_frame_target * 9 / 8; - *frame_under_shoot_limit = cpi->this_frame_target * 7 / 8; - } - else - { - if (cpi->oxcf.number_of_layers > 1 || - cpi->common.refresh_alt_ref_frame || - cpi->common.refresh_golden_frame) - { - *frame_over_shoot_limit = cpi->this_frame_target * 9 / 8; - *frame_under_shoot_limit = cpi->this_frame_target * 7 / 8; - } - else - { - /* For CBR take buffer fullness into account */ - if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) - { - if (cpi->buffer_level >= ((cpi->oxcf.optimal_buffer_level + cpi->oxcf.maximum_buffer_size) >> 1)) - { - /* Buffer is too full so relax overshoot and tighten - * undershoot - */ - *frame_over_shoot_limit = cpi->this_frame_target * 12 / 8; - *frame_under_shoot_limit = cpi->this_frame_target * 6 / 8; - } - else if (cpi->buffer_level <= (cpi->oxcf.optimal_buffer_level >> 1)) - { - /* Buffer is too low so relax undershoot and tighten - * overshoot - */ - *frame_over_shoot_limit = cpi->this_frame_target * 10 / 8; - *frame_under_shoot_limit = cpi->this_frame_target * 4 / 8; - } - else - { - *frame_over_shoot_limit = cpi->this_frame_target * 11 / 8; - *frame_under_shoot_limit = cpi->this_frame_target * 5 / 8; - } - } - /* VBR and CQ mode */ - /* Note that tighter restrictions here can help quality - * but hurt encode speed - */ - else - { - /* Stron overshoot limit for constrained quality */ - if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) - { - *frame_over_shoot_limit = cpi->this_frame_target * 11 / 8; - *frame_under_shoot_limit = cpi->this_frame_target * 2 / 8; - } - else - { - *frame_over_shoot_limit = cpi->this_frame_target * 11 / 8; - *frame_under_shoot_limit = cpi->this_frame_target * 5 / 8; - } - } - } - } - - /* For very small rate targets where the fractional adjustment - * (eg * 7/8) may be tiny make sure there is at least a minimum - * range. - */ - *frame_over_shoot_limit += 200; - *frame_under_shoot_limit -= 200; - if ( *frame_under_shoot_limit < 0 ) - *frame_under_shoot_limit = 0; - - } -} - - -/* return of 0 means drop frame */ -int vp8_pick_frame_size(VP8_COMP *cpi) -{ - VP8_COMMON *cm = &cpi->common; - - if (cm->frame_type == KEY_FRAME) - calc_iframe_target_size(cpi); - else - { - calc_pframe_target_size(cpi); - - /* Check if we're dropping the frame: */ - if (cpi->drop_frame) - { - cpi->drop_frame = 0; - return 0; - } - } - return 1; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/ratectrl.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/ratectrl.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/ratectrl.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/ratectrl.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_ENCODER_RATECTRL_H_ -#define VP8_ENCODER_RATECTRL_H_ - -#include "onyx_int.h" - -#ifdef __cplusplus -extern "C" { -#endif - -extern void vp8_save_coding_context(VP8_COMP *cpi); -extern void vp8_restore_coding_context(VP8_COMP *cpi); - -extern void vp8_setup_key_frame(VP8_COMP *cpi); -extern void vp8_update_rate_correction_factors(VP8_COMP *cpi, int damp_var); -extern int vp8_regulate_q(VP8_COMP *cpi, int target_bits_per_frame); -extern void vp8_adjust_key_frame_context(VP8_COMP *cpi); -extern void vp8_compute_frame_size_bounds(VP8_COMP *cpi, int *frame_under_shoot_limit, int *frame_over_shoot_limit); - -/* return of 0 means drop frame */ -extern int vp8_pick_frame_size(VP8_COMP *cpi); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_RATECTRL_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/rdopt.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/rdopt.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/rdopt.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/rdopt.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2647 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include -#include -#include -#include -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "tokenize.h" -#include "treewriter.h" -#include "onyx_int.h" -#include "modecosts.h" -#include "encodeintra.h" -#include "pickinter.h" -#include "vp8/common/entropymode.h" -#include "vp8/common/reconinter.h" -#include "vp8/common/reconintra4x4.h" -#include "vp8/common/findnearmv.h" -#include "vp8/common/quant_common.h" -#include "encodemb.h" -#include "quantize.h" -#include "vp8/common/variance.h" -#include "mcomp.h" -#include "rdopt.h" -#include "vpx_mem/vpx_mem.h" -#include "vp8/common/systemdependent.h" -#if CONFIG_TEMPORAL_DENOISING -#include "denoising.h" -#endif -extern void vp8_update_zbin_extra(VP8_COMP *cpi, MACROBLOCK *x); - -#define MAXF(a,b) (((a) > (b)) ? (a) : (b)) - -typedef struct rate_distortion_struct -{ - int rate2; - int rate_y; - int rate_uv; - int distortion2; - int distortion_uv; -} RATE_DISTORTION; - -typedef struct best_mode_struct -{ - int yrd; - int rd; - int intra_rd; - MB_MODE_INFO mbmode; - union b_mode_info bmodes[16]; - PARTITION_INFO partition; -} BEST_MODE; - -static const int auto_speed_thresh[17] = -{ - 1000, - 200, - 150, - 130, - 150, - 125, - 120, - 115, - 115, - 115, - 115, - 115, - 115, - 115, - 115, - 115, - 105 -}; - -const MB_PREDICTION_MODE vp8_mode_order[MAX_MODES] = -{ - ZEROMV, - DC_PRED, - - NEARESTMV, - NEARMV, - - ZEROMV, - NEARESTMV, - - ZEROMV, - NEARESTMV, - - NEARMV, - NEARMV, - - V_PRED, - H_PRED, - TM_PRED, - - NEWMV, - NEWMV, - NEWMV, - - SPLITMV, - SPLITMV, - SPLITMV, - - B_PRED, -}; - -/* This table determines the search order in reference frame priority order, - * which may not necessarily match INTRA,LAST,GOLDEN,ARF - */ -const int vp8_ref_frame_order[MAX_MODES] = -{ - 1, - 0, - - 1, - 1, - - 2, - 2, - - 3, - 3, - - 2, - 3, - - 0, - 0, - 0, - - 1, - 2, - 3, - - 1, - 2, - 3, - - 0, -}; - -static void fill_token_costs( - int c[BLOCK_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS][MAX_ENTROPY_TOKENS], - const vp8_prob p[BLOCK_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS][ENTROPY_NODES] -) -{ - int i, j, k; - - - for (i = 0; i < BLOCK_TYPES; i++) - for (j = 0; j < COEF_BANDS; j++) - for (k = 0; k < PREV_COEF_CONTEXTS; k++) - - /* check for pt=0 and band > 1 if block type 0 - * and 0 if blocktype 1 - */ - if (k == 0 && j > (i == 0)) - vp8_cost_tokens2(c[i][j][k], p [i][j][k], vp8_coef_tree, 2); - else - vp8_cost_tokens(c[i][j][k], p [i][j][k], vp8_coef_tree); -} - -static const int rd_iifactor[32] = -{ - 4, 4, 3, 2, 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 -}; - -/* values are now correlated to quantizer */ -static const int sad_per_bit16lut[QINDEX_RANGE] = -{ - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 10, 10, - 10, 10, 10, 10, 10, 10, 11, 11, - 11, 11, 11, 11, 12, 12, 12, 12, - 12, 12, 13, 13, 13, 13, 14, 14 -}; -static const int sad_per_bit4lut[QINDEX_RANGE] = -{ - 2, 2, 2, 2, 2, 2, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 5, 5, - 5, 5, 5, 5, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 8, 8, 8, - 8, 8, 9, 9, 9, 9, 9, 9, - 10, 10, 10, 10, 10, 10, 10, 10, - 11, 11, 11, 11, 11, 11, 11, 11, - 12, 12, 12, 12, 12, 12, 12, 12, - 13, 13, 13, 13, 13, 13, 13, 14, - 14, 14, 14, 14, 15, 15, 15, 15, - 16, 16, 16, 16, 17, 17, 17, 18, - 18, 18, 19, 19, 19, 20, 20, 20, -}; - -void vp8cx_initialize_me_consts(VP8_COMP *cpi, int QIndex) -{ - cpi->mb.sadperbit16 = sad_per_bit16lut[QIndex]; - cpi->mb.sadperbit4 = sad_per_bit4lut[QIndex]; -} - -void vp8_initialize_rd_consts(VP8_COMP *cpi, MACROBLOCK *x, int Qvalue) -{ - int q; - int i; - double capped_q = (Qvalue < 160) ? (double)Qvalue : 160.0; - double rdconst = 2.80; - - vp8_clear_system_state(); - - /* Further tests required to see if optimum is different - * for key frames, golden frames and arf frames. - */ - cpi->RDMULT = (int)(rdconst * (capped_q * capped_q)); - - /* Extend rate multiplier along side quantizer zbin increases */ - if (cpi->mb.zbin_over_quant > 0) - { - double oq_factor; - double modq; - - /* Experimental code using the same basic equation as used for Q above - * The units of cpi->mb.zbin_over_quant are 1/128 of Q bin size - */ - oq_factor = 1.0 + ((double)0.0015625 * cpi->mb.zbin_over_quant); - modq = (int)((double)capped_q * oq_factor); - cpi->RDMULT = (int)(rdconst * (modq * modq)); - } - - if (cpi->pass == 2 && (cpi->common.frame_type != KEY_FRAME)) - { - if (cpi->twopass.next_iiratio > 31) - cpi->RDMULT += (cpi->RDMULT * rd_iifactor[31]) >> 4; - else - cpi->RDMULT += - (cpi->RDMULT * rd_iifactor[cpi->twopass.next_iiratio]) >> 4; - } - - cpi->mb.errorperbit = (cpi->RDMULT / 110); - cpi->mb.errorperbit += (cpi->mb.errorperbit==0); - - vp8_set_speed_features(cpi); - - for (i = 0; i < MAX_MODES; i++) - { - x->mode_test_hit_counts[i] = 0; - } - - q = (int)pow(Qvalue, 1.25); - - if (q < 8) - q = 8; - - if (cpi->RDMULT > 1000) - { - cpi->RDDIV = 1; - cpi->RDMULT /= 100; - - for (i = 0; i < MAX_MODES; i++) - { - if (cpi->sf.thresh_mult[i] < INT_MAX) - { - x->rd_threshes[i] = cpi->sf.thresh_mult[i] * q / 100; - } - else - { - x->rd_threshes[i] = INT_MAX; - } - - cpi->rd_baseline_thresh[i] = x->rd_threshes[i]; - } - } - else - { - cpi->RDDIV = 100; - - for (i = 0; i < MAX_MODES; i++) - { - if (cpi->sf.thresh_mult[i] < (INT_MAX / q)) - { - x->rd_threshes[i] = cpi->sf.thresh_mult[i] * q; - } - else - { - x->rd_threshes[i] = INT_MAX; - } - - cpi->rd_baseline_thresh[i] = x->rd_threshes[i]; - } - } - - { - /* build token cost array for the type of frame we have now */ - FRAME_CONTEXT *l = &cpi->lfc_n; - - if(cpi->common.refresh_alt_ref_frame) - l = &cpi->lfc_a; - else if(cpi->common.refresh_golden_frame) - l = &cpi->lfc_g; - - fill_token_costs( - cpi->mb.token_costs, - (const vp8_prob( *)[8][3][11]) l->coef_probs - ); - /* - fill_token_costs( - cpi->mb.token_costs, - (const vp8_prob( *)[8][3][11]) cpi->common.fc.coef_probs); - */ - - - /* TODO make these mode costs depend on last,alt or gold too. (jbb) */ - vp8_init_mode_costs(cpi); - } - -} - -void vp8_auto_select_speed(VP8_COMP *cpi) -{ - int milliseconds_for_compress = (int)(1000000 / cpi->framerate); - - milliseconds_for_compress = milliseconds_for_compress * (16 - cpi->oxcf.cpu_used) / 16; - -#if 0 - - if (0) - { - FILE *f; - - f = fopen("speed.stt", "a"); - fprintf(f, " %8ld %10ld %10ld %10ld\n", - cpi->common.current_video_frame, cpi->Speed, milliseconds_for_compress, cpi->avg_pick_mode_time); - fclose(f); - } - -#endif - - if (cpi->avg_pick_mode_time < milliseconds_for_compress && (cpi->avg_encode_time - cpi->avg_pick_mode_time) < milliseconds_for_compress) - { - if (cpi->avg_pick_mode_time == 0) - { - cpi->Speed = 4; - } - else - { - if (milliseconds_for_compress * 100 < cpi->avg_encode_time * 95) - { - cpi->Speed += 2; - cpi->avg_pick_mode_time = 0; - cpi->avg_encode_time = 0; - - if (cpi->Speed > 16) - { - cpi->Speed = 16; - } - } - - if (milliseconds_for_compress * 100 > cpi->avg_encode_time * auto_speed_thresh[cpi->Speed]) - { - cpi->Speed -= 1; - cpi->avg_pick_mode_time = 0; - cpi->avg_encode_time = 0; - - /* In real-time mode, cpi->speed is in [4, 16]. */ - if (cpi->Speed < 4) - { - cpi->Speed = 4; - } - } - } - } - else - { - cpi->Speed += 4; - - if (cpi->Speed > 16) - cpi->Speed = 16; - - - cpi->avg_pick_mode_time = 0; - cpi->avg_encode_time = 0; - } -} - -int vp8_block_error_c(short *coeff, short *dqcoeff) -{ - int i; - int error = 0; - - for (i = 0; i < 16; i++) - { - int this_diff = coeff[i] - dqcoeff[i]; - error += this_diff * this_diff; - } - - return error; -} - -int vp8_mbblock_error_c(MACROBLOCK *mb, int dc) -{ - BLOCK *be; - BLOCKD *bd; - int i, j; - int berror, error = 0; - - for (i = 0; i < 16; i++) - { - be = &mb->block[i]; - bd = &mb->e_mbd.block[i]; - - berror = 0; - - for (j = dc; j < 16; j++) - { - int this_diff = be->coeff[j] - bd->dqcoeff[j]; - berror += this_diff * this_diff; - } - - error += berror; - } - - return error; -} - -int vp8_mbuverror_c(MACROBLOCK *mb) -{ - - BLOCK *be; - BLOCKD *bd; - - - int i; - int error = 0; - - for (i = 16; i < 24; i++) - { - be = &mb->block[i]; - bd = &mb->e_mbd.block[i]; - - error += vp8_block_error_c(be->coeff, bd->dqcoeff); - } - - return error; -} - -int VP8_UVSSE(MACROBLOCK *x) -{ - unsigned char *uptr, *vptr; - unsigned char *upred_ptr = (*(x->block[16].base_src) + x->block[16].src); - unsigned char *vpred_ptr = (*(x->block[20].base_src) + x->block[20].src); - int uv_stride = x->block[16].src_stride; - - unsigned int sse1 = 0; - unsigned int sse2 = 0; - int mv_row = x->e_mbd.mode_info_context->mbmi.mv.as_mv.row; - int mv_col = x->e_mbd.mode_info_context->mbmi.mv.as_mv.col; - int offset; - int pre_stride = x->e_mbd.pre.uv_stride; - - if (mv_row < 0) - mv_row -= 1; - else - mv_row += 1; - - if (mv_col < 0) - mv_col -= 1; - else - mv_col += 1; - - mv_row /= 2; - mv_col /= 2; - - offset = (mv_row >> 3) * pre_stride + (mv_col >> 3); - uptr = x->e_mbd.pre.u_buffer + offset; - vptr = x->e_mbd.pre.v_buffer + offset; - - if ((mv_row | mv_col) & 7) - { - vp8_sub_pixel_variance8x8(uptr, pre_stride, - mv_col & 7, mv_row & 7, upred_ptr, uv_stride, &sse2); - vp8_sub_pixel_variance8x8(vptr, pre_stride, - mv_col & 7, mv_row & 7, vpred_ptr, uv_stride, &sse1); - sse2 += sse1; - } - else - { - vp8_variance8x8(uptr, pre_stride, - upred_ptr, uv_stride, &sse2); - vp8_variance8x8(vptr, pre_stride, - vpred_ptr, uv_stride, &sse1); - sse2 += sse1; - } - return sse2; - -} - -static int cost_coeffs(MACROBLOCK *mb, BLOCKD *b, int type, ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l) -{ - int c = !type; /* start at coef 0, unless Y with Y2 */ - int eob = (int)(*b->eob); - int pt ; /* surrounding block/prev coef predictor */ - int cost = 0; - short *qcoeff_ptr = b->qcoeff; - - VP8_COMBINEENTROPYCONTEXTS(pt, *a, *l); - - assert(eob <= 16); - for (; c < eob; c++) - { - const int v = qcoeff_ptr[vp8_default_zig_zag1d[c]]; - const int t = vp8_dct_value_tokens_ptr[v].Token; - cost += mb->token_costs [type] [vp8_coef_bands[c]] [pt] [t]; - cost += vp8_dct_value_cost_ptr[v]; - pt = vp8_prev_token_class[t]; - } - - if (c < 16) - cost += mb->token_costs [type] [vp8_coef_bands[c]] [pt] [DCT_EOB_TOKEN]; - - pt = (c != !type); /* is eob first coefficient; */ - *a = *l = pt; - - return cost; -} - -static int vp8_rdcost_mby(MACROBLOCK *mb) -{ - int cost = 0; - int b; - MACROBLOCKD *x = &mb->e_mbd; - ENTROPY_CONTEXT_PLANES t_above, t_left; - ENTROPY_CONTEXT *ta; - ENTROPY_CONTEXT *tl; - - vpx_memcpy(&t_above, mb->e_mbd.above_context, sizeof(ENTROPY_CONTEXT_PLANES)); - vpx_memcpy(&t_left, mb->e_mbd.left_context, sizeof(ENTROPY_CONTEXT_PLANES)); - - ta = (ENTROPY_CONTEXT *)&t_above; - tl = (ENTROPY_CONTEXT *)&t_left; - - for (b = 0; b < 16; b++) - cost += cost_coeffs(mb, x->block + b, PLANE_TYPE_Y_NO_DC, - ta + vp8_block2above[b], tl + vp8_block2left[b]); - - cost += cost_coeffs(mb, x->block + 24, PLANE_TYPE_Y2, - ta + vp8_block2above[24], tl + vp8_block2left[24]); - - return cost; -} - -static void macro_block_yrd( MACROBLOCK *mb, - int *Rate, - int *Distortion) -{ - int b; - MACROBLOCKD *const x = &mb->e_mbd; - BLOCK *const mb_y2 = mb->block + 24; - BLOCKD *const x_y2 = x->block + 24; - short *Y2DCPtr = mb_y2->src_diff; - BLOCK *beptr; - int d; - - vp8_subtract_mby( mb->src_diff, *(mb->block[0].base_src), - mb->block[0].src_stride, mb->e_mbd.predictor, 16); - - /* Fdct and building the 2nd order block */ - for (beptr = mb->block; beptr < mb->block + 16; beptr += 2) - { - mb->short_fdct8x4(beptr->src_diff, beptr->coeff, 32); - *Y2DCPtr++ = beptr->coeff[0]; - *Y2DCPtr++ = beptr->coeff[16]; - } - - /* 2nd order fdct */ - mb->short_walsh4x4(mb_y2->src_diff, mb_y2->coeff, 8); - - /* Quantization */ - for (b = 0; b < 16; b++) - { - mb->quantize_b(&mb->block[b], &mb->e_mbd.block[b]); - } - - /* DC predication and Quantization of 2nd Order block */ - mb->quantize_b(mb_y2, x_y2); - - /* Distortion */ - d = vp8_mbblock_error(mb, 1) << 2; - d += vp8_block_error(mb_y2->coeff, x_y2->dqcoeff); - - *Distortion = (d >> 4); - - /* rate */ - *Rate = vp8_rdcost_mby(mb); -} - -static void copy_predictor(unsigned char *dst, const unsigned char *predictor) -{ - const unsigned int *p = (const unsigned int *)predictor; - unsigned int *d = (unsigned int *)dst; - d[0] = p[0]; - d[4] = p[4]; - d[8] = p[8]; - d[12] = p[12]; -} -static int rd_pick_intra4x4block( - MACROBLOCK *x, - BLOCK *be, - BLOCKD *b, - B_PREDICTION_MODE *best_mode, - const int *bmode_costs, - ENTROPY_CONTEXT *a, - ENTROPY_CONTEXT *l, - - int *bestrate, - int *bestratey, - int *bestdistortion) -{ - B_PREDICTION_MODE mode; - int best_rd = INT_MAX; - int rate = 0; - int distortion; - - ENTROPY_CONTEXT ta = *a, tempa = *a; - ENTROPY_CONTEXT tl = *l, templ = *l; - /* - * The predictor buffer is a 2d buffer with a stride of 16. Create - * a temp buffer that meets the stride requirements, but we are only - * interested in the left 4x4 block - * */ - DECLARE_ALIGNED_ARRAY(16, unsigned char, best_predictor, 16*4); - DECLARE_ALIGNED_ARRAY(16, short, best_dqcoeff, 16); - int dst_stride = x->e_mbd.dst.y_stride; - unsigned char *dst = x->e_mbd.dst.y_buffer + b->offset; - - unsigned char *Above = dst - dst_stride; - unsigned char *yleft = dst - 1; - unsigned char top_left = Above[-1]; - - for (mode = B_DC_PRED; mode <= B_HU_PRED; mode++) - { - int this_rd; - int ratey; - - rate = bmode_costs[mode]; - - vp8_intra4x4_predict(Above, yleft, dst_stride, mode, - b->predictor, 16, top_left); - vp8_subtract_b(be, b, 16); - x->short_fdct4x4(be->src_diff, be->coeff, 32); - x->quantize_b(be, b); - - tempa = ta; - templ = tl; - - ratey = cost_coeffs(x, b, PLANE_TYPE_Y_WITH_DC, &tempa, &templ); - rate += ratey; - distortion = vp8_block_error(be->coeff, b->dqcoeff) >> 2; - - this_rd = RDCOST(x->rdmult, x->rddiv, rate, distortion); - - if (this_rd < best_rd) - { - *bestrate = rate; - *bestratey = ratey; - *bestdistortion = distortion; - best_rd = this_rd; - *best_mode = mode; - *a = tempa; - *l = templ; - copy_predictor(best_predictor, b->predictor); - vpx_memcpy(best_dqcoeff, b->dqcoeff, 32); - } - } - b->bmi.as_mode = *best_mode; - - vp8_short_idct4x4llm(best_dqcoeff, best_predictor, 16, dst, dst_stride); - - return best_rd; -} - -static int rd_pick_intra4x4mby_modes(MACROBLOCK *mb, int *Rate, - int *rate_y, int *Distortion, int best_rd) -{ - MACROBLOCKD *const xd = &mb->e_mbd; - int i; - int cost = mb->mbmode_cost [xd->frame_type] [B_PRED]; - int distortion = 0; - int tot_rate_y = 0; - int64_t total_rd = 0; - ENTROPY_CONTEXT_PLANES t_above, t_left; - ENTROPY_CONTEXT *ta; - ENTROPY_CONTEXT *tl; - const int *bmode_costs; - - vpx_memcpy(&t_above, mb->e_mbd.above_context, sizeof(ENTROPY_CONTEXT_PLANES)); - vpx_memcpy(&t_left, mb->e_mbd.left_context, sizeof(ENTROPY_CONTEXT_PLANES)); - - ta = (ENTROPY_CONTEXT *)&t_above; - tl = (ENTROPY_CONTEXT *)&t_left; - - intra_prediction_down_copy(xd, xd->dst.y_buffer - xd->dst.y_stride + 16); - - bmode_costs = mb->inter_bmode_costs; - - for (i = 0; i < 16; i++) - { - MODE_INFO *const mic = xd->mode_info_context; - const int mis = xd->mode_info_stride; - B_PREDICTION_MODE UNINITIALIZED_IS_SAFE(best_mode); - int UNINITIALIZED_IS_SAFE(r), UNINITIALIZED_IS_SAFE(ry), UNINITIALIZED_IS_SAFE(d); - - if (mb->e_mbd.frame_type == KEY_FRAME) - { - const B_PREDICTION_MODE A = above_block_mode(mic, i, mis); - const B_PREDICTION_MODE L = left_block_mode(mic, i); - - bmode_costs = mb->bmode_costs[A][L]; - } - - total_rd += rd_pick_intra4x4block( - mb, mb->block + i, xd->block + i, &best_mode, bmode_costs, - ta + vp8_block2above[i], - tl + vp8_block2left[i], &r, &ry, &d); - - cost += r; - distortion += d; - tot_rate_y += ry; - - mic->bmi[i].as_mode = best_mode; - - if(total_rd >= (int64_t)best_rd) - break; - } - - if(total_rd >= (int64_t)best_rd) - return INT_MAX; - - *Rate = cost; - *rate_y = tot_rate_y; - *Distortion = distortion; - - return RDCOST(mb->rdmult, mb->rddiv, cost, distortion); -} - - -static int rd_pick_intra16x16mby_mode(MACROBLOCK *x, - int *Rate, - int *rate_y, - int *Distortion) -{ - MB_PREDICTION_MODE mode; - MB_PREDICTION_MODE UNINITIALIZED_IS_SAFE(mode_selected); - int rate, ratey; - int distortion; - int best_rd = INT_MAX; - int this_rd; - MACROBLOCKD *xd = &x->e_mbd; - - /* Y Search for 16x16 intra prediction mode */ - for (mode = DC_PRED; mode <= TM_PRED; mode++) - { - xd->mode_info_context->mbmi.mode = mode; - - vp8_build_intra_predictors_mby_s(xd, - xd->dst.y_buffer - xd->dst.y_stride, - xd->dst.y_buffer - 1, - xd->dst.y_stride, - xd->predictor, - 16); - - macro_block_yrd(x, &ratey, &distortion); - rate = ratey + x->mbmode_cost[xd->frame_type] - [xd->mode_info_context->mbmi.mode]; - - this_rd = RDCOST(x->rdmult, x->rddiv, rate, distortion); - - if (this_rd < best_rd) - { - mode_selected = mode; - best_rd = this_rd; - *Rate = rate; - *rate_y = ratey; - *Distortion = distortion; - } - } - - xd->mode_info_context->mbmi.mode = mode_selected; - return best_rd; -} - -static int rd_cost_mbuv(MACROBLOCK *mb) -{ - int b; - int cost = 0; - MACROBLOCKD *x = &mb->e_mbd; - ENTROPY_CONTEXT_PLANES t_above, t_left; - ENTROPY_CONTEXT *ta; - ENTROPY_CONTEXT *tl; - - vpx_memcpy(&t_above, mb->e_mbd.above_context, sizeof(ENTROPY_CONTEXT_PLANES)); - vpx_memcpy(&t_left, mb->e_mbd.left_context, sizeof(ENTROPY_CONTEXT_PLANES)); - - ta = (ENTROPY_CONTEXT *)&t_above; - tl = (ENTROPY_CONTEXT *)&t_left; - - for (b = 16; b < 24; b++) - cost += cost_coeffs(mb, x->block + b, PLANE_TYPE_UV, - ta + vp8_block2above[b], tl + vp8_block2left[b]); - - return cost; -} - - -static int rd_inter16x16_uv(VP8_COMP *cpi, MACROBLOCK *x, int *rate, - int *distortion, int fullpixel) -{ - (void)cpi; - (void)fullpixel; - - vp8_build_inter16x16_predictors_mbuv(&x->e_mbd); - vp8_subtract_mbuv(x->src_diff, - x->src.u_buffer, x->src.v_buffer, x->src.uv_stride, - &x->e_mbd.predictor[256], &x->e_mbd.predictor[320], 8); - - vp8_transform_mbuv(x); - vp8_quantize_mbuv(x); - - *rate = rd_cost_mbuv(x); - *distortion = vp8_mbuverror(x) / 4; - - return RDCOST(x->rdmult, x->rddiv, *rate, *distortion); -} - -static int rd_inter4x4_uv(VP8_COMP *cpi, MACROBLOCK *x, int *rate, - int *distortion, int fullpixel) -{ - (void)cpi; - (void)fullpixel; - - vp8_build_inter4x4_predictors_mbuv(&x->e_mbd); - vp8_subtract_mbuv(x->src_diff, - x->src.u_buffer, x->src.v_buffer, x->src.uv_stride, - &x->e_mbd.predictor[256], &x->e_mbd.predictor[320], 8); - - vp8_transform_mbuv(x); - vp8_quantize_mbuv(x); - - *rate = rd_cost_mbuv(x); - *distortion = vp8_mbuverror(x) / 4; - - return RDCOST(x->rdmult, x->rddiv, *rate, *distortion); -} - -static void rd_pick_intra_mbuv_mode(MACROBLOCK *x, int *rate, - int *rate_tokenonly, int *distortion) -{ - MB_PREDICTION_MODE mode; - MB_PREDICTION_MODE UNINITIALIZED_IS_SAFE(mode_selected); - int best_rd = INT_MAX; - int UNINITIALIZED_IS_SAFE(d), UNINITIALIZED_IS_SAFE(r); - int rate_to; - MACROBLOCKD *xd = &x->e_mbd; - - for (mode = DC_PRED; mode <= TM_PRED; mode++) - { - int this_rate; - int this_distortion; - int this_rd; - - xd->mode_info_context->mbmi.uv_mode = mode; - - vp8_build_intra_predictors_mbuv_s(xd, - xd->dst.u_buffer - xd->dst.uv_stride, - xd->dst.v_buffer - xd->dst.uv_stride, - xd->dst.u_buffer - 1, - xd->dst.v_buffer - 1, - xd->dst.uv_stride, - &xd->predictor[256], &xd->predictor[320], - 8); - - - vp8_subtract_mbuv(x->src_diff, - x->src.u_buffer, x->src.v_buffer, x->src.uv_stride, - &xd->predictor[256], &xd->predictor[320], 8); - vp8_transform_mbuv(x); - vp8_quantize_mbuv(x); - - rate_to = rd_cost_mbuv(x); - this_rate = rate_to + x->intra_uv_mode_cost[xd->frame_type][xd->mode_info_context->mbmi.uv_mode]; - - this_distortion = vp8_mbuverror(x) / 4; - - this_rd = RDCOST(x->rdmult, x->rddiv, this_rate, this_distortion); - - if (this_rd < best_rd) - { - best_rd = this_rd; - d = this_distortion; - r = this_rate; - *rate_tokenonly = rate_to; - mode_selected = mode; - } - } - - *rate = r; - *distortion = d; - - xd->mode_info_context->mbmi.uv_mode = mode_selected; -} - -int vp8_cost_mv_ref(MB_PREDICTION_MODE m, const int near_mv_ref_ct[4]) -{ - vp8_prob p [VP8_MVREFS-1]; - assert(NEARESTMV <= m && m <= SPLITMV); - vp8_mv_ref_probs(p, near_mv_ref_ct); - return vp8_cost_token(vp8_mv_ref_tree, p, - vp8_mv_ref_encoding_array + (m - NEARESTMV)); -} - -void vp8_set_mbmode_and_mvs(MACROBLOCK *x, MB_PREDICTION_MODE mb, int_mv *mv) -{ - x->e_mbd.mode_info_context->mbmi.mode = mb; - x->e_mbd.mode_info_context->mbmi.mv.as_int = mv->as_int; -} - -static int labels2mode( - MACROBLOCK *x, - int const *labelings, int which_label, - B_PREDICTION_MODE this_mode, - int_mv *this_mv, int_mv *best_ref_mv, - int *mvcost[2] -) -{ - MACROBLOCKD *const xd = & x->e_mbd; - MODE_INFO *const mic = xd->mode_info_context; - const int mis = xd->mode_info_stride; - - int cost = 0; - int thismvcost = 0; - - /* We have to be careful retrieving previously-encoded motion vectors. - Ones from this macroblock have to be pulled from the BLOCKD array - as they have not yet made it to the bmi array in our MB_MODE_INFO. */ - - int i = 0; - - do - { - BLOCKD *const d = xd->block + i; - const int row = i >> 2, col = i & 3; - - B_PREDICTION_MODE m; - - if (labelings[i] != which_label) - continue; - - if (col && labelings[i] == labelings[i-1]) - m = LEFT4X4; - else if (row && labelings[i] == labelings[i-4]) - m = ABOVE4X4; - else - { - /* the only time we should do costing for new motion vector - * or mode is when we are on a new label (jbb May 08, 2007) - */ - switch (m = this_mode) - { - case NEW4X4 : - thismvcost = vp8_mv_bit_cost(this_mv, best_ref_mv, mvcost, 102); - break; - case LEFT4X4: - this_mv->as_int = col ? d[-1].bmi.mv.as_int : left_block_mv(mic, i); - break; - case ABOVE4X4: - this_mv->as_int = row ? d[-4].bmi.mv.as_int : above_block_mv(mic, i, mis); - break; - case ZERO4X4: - this_mv->as_int = 0; - break; - default: - break; - } - - if (m == ABOVE4X4) /* replace above with left if same */ - { - int_mv left_mv; - - left_mv.as_int = col ? d[-1].bmi.mv.as_int : - left_block_mv(mic, i); - - if (left_mv.as_int == this_mv->as_int) - m = LEFT4X4; - } - - cost = x->inter_bmode_costs[ m]; - } - - d->bmi.mv.as_int = this_mv->as_int; - - x->partition_info->bmi[i].mode = m; - x->partition_info->bmi[i].mv.as_int = this_mv->as_int; - - } - while (++i < 16); - - cost += thismvcost ; - return cost; -} - -static int rdcost_mbsegment_y(MACROBLOCK *mb, const int *labels, - int which_label, ENTROPY_CONTEXT *ta, - ENTROPY_CONTEXT *tl) -{ - int cost = 0; - int b; - MACROBLOCKD *x = &mb->e_mbd; - - for (b = 0; b < 16; b++) - if (labels[ b] == which_label) - cost += cost_coeffs(mb, x->block + b, PLANE_TYPE_Y_WITH_DC, - ta + vp8_block2above[b], - tl + vp8_block2left[b]); - - return cost; - -} -static unsigned int vp8_encode_inter_mb_segment(MACROBLOCK *x, int const *labels, int which_label) -{ - int i; - unsigned int distortion = 0; - int pre_stride = x->e_mbd.pre.y_stride; - unsigned char *base_pre = x->e_mbd.pre.y_buffer; - - - for (i = 0; i < 16; i++) - { - if (labels[i] == which_label) - { - BLOCKD *bd = &x->e_mbd.block[i]; - BLOCK *be = &x->block[i]; - - vp8_build_inter_predictors_b(bd, 16, base_pre, pre_stride, x->e_mbd.subpixel_predict); - vp8_subtract_b(be, bd, 16); - x->short_fdct4x4(be->src_diff, be->coeff, 32); - x->quantize_b(be, bd); - - distortion += vp8_block_error(be->coeff, bd->dqcoeff); - } - } - - return distortion; -} - - -static const unsigned int segmentation_to_sseshift[4] = {3, 3, 2, 0}; - - -typedef struct -{ - int_mv *ref_mv; - int_mv mvp; - - int segment_rd; - int segment_num; - int r; - int d; - int segment_yrate; - B_PREDICTION_MODE modes[16]; - int_mv mvs[16]; - unsigned char eobs[16]; - - int mvthresh; - int *mdcounts; - - int_mv sv_mvp[4]; /* save 4 mvp from 8x8 */ - int sv_istep[2]; /* save 2 initial step_param for 16x8/8x16 */ - -} BEST_SEG_INFO; - - -static void rd_check_segment(VP8_COMP *cpi, MACROBLOCK *x, - BEST_SEG_INFO *bsi, unsigned int segmentation) -{ - int i; - int const *labels; - int br = 0; - int bd = 0; - B_PREDICTION_MODE this_mode; - - - int label_count; - int this_segment_rd = 0; - int label_mv_thresh; - int rate = 0; - int sbr = 0; - int sbd = 0; - int segmentyrate = 0; - - vp8_variance_fn_ptr_t *v_fn_ptr; - - ENTROPY_CONTEXT_PLANES t_above, t_left; - ENTROPY_CONTEXT *ta; - ENTROPY_CONTEXT *tl; - ENTROPY_CONTEXT_PLANES t_above_b, t_left_b; - ENTROPY_CONTEXT *ta_b; - ENTROPY_CONTEXT *tl_b; - - vpx_memcpy(&t_above, x->e_mbd.above_context, sizeof(ENTROPY_CONTEXT_PLANES)); - vpx_memcpy(&t_left, x->e_mbd.left_context, sizeof(ENTROPY_CONTEXT_PLANES)); - - ta = (ENTROPY_CONTEXT *)&t_above; - tl = (ENTROPY_CONTEXT *)&t_left; - ta_b = (ENTROPY_CONTEXT *)&t_above_b; - tl_b = (ENTROPY_CONTEXT *)&t_left_b; - - br = 0; - bd = 0; - - v_fn_ptr = &cpi->fn_ptr[segmentation]; - labels = vp8_mbsplits[segmentation]; - label_count = vp8_mbsplit_count[segmentation]; - - /* 64 makes this threshold really big effectively making it so that we - * very rarely check mvs on segments. setting this to 1 would make mv - * thresh roughly equal to what it is for macroblocks - */ - label_mv_thresh = 1 * bsi->mvthresh / label_count ; - - /* Segmentation method overheads */ - rate = vp8_cost_token(vp8_mbsplit_tree, vp8_mbsplit_probs, vp8_mbsplit_encodings + segmentation); - rate += vp8_cost_mv_ref(SPLITMV, bsi->mdcounts); - this_segment_rd += RDCOST(x->rdmult, x->rddiv, rate, 0); - br += rate; - - for (i = 0; i < label_count; i++) - { - int_mv mode_mv[B_MODE_COUNT]; - int best_label_rd = INT_MAX; - B_PREDICTION_MODE mode_selected = ZERO4X4; - int bestlabelyrate = 0; - - /* search for the best motion vector on this segment */ - for (this_mode = LEFT4X4; this_mode <= NEW4X4 ; this_mode ++) - { - int this_rd; - int distortion; - int labelyrate; - ENTROPY_CONTEXT_PLANES t_above_s, t_left_s; - ENTROPY_CONTEXT *ta_s; - ENTROPY_CONTEXT *tl_s; - - vpx_memcpy(&t_above_s, &t_above, sizeof(ENTROPY_CONTEXT_PLANES)); - vpx_memcpy(&t_left_s, &t_left, sizeof(ENTROPY_CONTEXT_PLANES)); - - ta_s = (ENTROPY_CONTEXT *)&t_above_s; - tl_s = (ENTROPY_CONTEXT *)&t_left_s; - - if (this_mode == NEW4X4) - { - int sseshift; - int num00; - int step_param = 0; - int further_steps; - int n; - int thissme; - int bestsme = INT_MAX; - int_mv temp_mv; - BLOCK *c; - BLOCKD *e; - - /* Is the best so far sufficiently good that we cant justify - * doing a new motion search. - */ - if (best_label_rd < label_mv_thresh) - break; - - if(cpi->compressor_speed) - { - if (segmentation == BLOCK_8X16 || segmentation == BLOCK_16X8) - { - bsi->mvp.as_int = bsi->sv_mvp[i].as_int; - if (i==1 && segmentation == BLOCK_16X8) - bsi->mvp.as_int = bsi->sv_mvp[2].as_int; - - step_param = bsi->sv_istep[i]; - } - - /* use previous block's result as next block's MV - * predictor. - */ - if (segmentation == BLOCK_4X4 && i>0) - { - bsi->mvp.as_int = x->e_mbd.block[i-1].bmi.mv.as_int; - if (i==4 || i==8 || i==12) - bsi->mvp.as_int = x->e_mbd.block[i-4].bmi.mv.as_int; - step_param = 2; - } - } - - further_steps = (MAX_MVSEARCH_STEPS - 1) - step_param; - - { - int sadpb = x->sadperbit4; - int_mv mvp_full; - - mvp_full.as_mv.row = bsi->mvp.as_mv.row >>3; - mvp_full.as_mv.col = bsi->mvp.as_mv.col >>3; - - /* find first label */ - n = vp8_mbsplit_offset[segmentation][i]; - - c = &x->block[n]; - e = &x->e_mbd.block[n]; - - { - bestsme = cpi->diamond_search_sad(x, c, e, &mvp_full, - &mode_mv[NEW4X4], step_param, - sadpb, &num00, v_fn_ptr, - x->mvcost, bsi->ref_mv); - - n = num00; - num00 = 0; - - while (n < further_steps) - { - n++; - - if (num00) - num00--; - else - { - thissme = cpi->diamond_search_sad(x, c, e, - &mvp_full, &temp_mv, - step_param + n, sadpb, - &num00, v_fn_ptr, - x->mvcost, bsi->ref_mv); - - if (thissme < bestsme) - { - bestsme = thissme; - mode_mv[NEW4X4].as_int = temp_mv.as_int; - } - } - } - } - - sseshift = segmentation_to_sseshift[segmentation]; - - /* Should we do a full search (best quality only) */ - if ((cpi->compressor_speed == 0) && (bestsme >> sseshift) > 4000) - { - /* Check if mvp_full is within the range. */ - vp8_clamp_mv(&mvp_full, x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max); - - thissme = cpi->full_search_sad(x, c, e, &mvp_full, - sadpb, 16, v_fn_ptr, - x->mvcost, bsi->ref_mv); - - if (thissme < bestsme) - { - bestsme = thissme; - mode_mv[NEW4X4].as_int = e->bmi.mv.as_int; - } - else - { - /* The full search result is actually worse so - * re-instate the previous best vector - */ - e->bmi.mv.as_int = mode_mv[NEW4X4].as_int; - } - } - } - - if (bestsme < INT_MAX) - { - int disto; - unsigned int sse; - cpi->find_fractional_mv_step(x, c, e, &mode_mv[NEW4X4], - bsi->ref_mv, x->errorperbit, v_fn_ptr, x->mvcost, - &disto, &sse); - } - } /* NEW4X4 */ - - rate = labels2mode(x, labels, i, this_mode, &mode_mv[this_mode], - bsi->ref_mv, x->mvcost); - - /* Trap vectors that reach beyond the UMV borders */ - if (((mode_mv[this_mode].as_mv.row >> 3) < x->mv_row_min) || ((mode_mv[this_mode].as_mv.row >> 3) > x->mv_row_max) || - ((mode_mv[this_mode].as_mv.col >> 3) < x->mv_col_min) || ((mode_mv[this_mode].as_mv.col >> 3) > x->mv_col_max)) - { - continue; - } - - distortion = vp8_encode_inter_mb_segment(x, labels, i) / 4; - - labelyrate = rdcost_mbsegment_y(x, labels, i, ta_s, tl_s); - rate += labelyrate; - - this_rd = RDCOST(x->rdmult, x->rddiv, rate, distortion); - - if (this_rd < best_label_rd) - { - sbr = rate; - sbd = distortion; - bestlabelyrate = labelyrate; - mode_selected = this_mode; - best_label_rd = this_rd; - - vpx_memcpy(ta_b, ta_s, sizeof(ENTROPY_CONTEXT_PLANES)); - vpx_memcpy(tl_b, tl_s, sizeof(ENTROPY_CONTEXT_PLANES)); - - } - } /*for each 4x4 mode*/ - - vpx_memcpy(ta, ta_b, sizeof(ENTROPY_CONTEXT_PLANES)); - vpx_memcpy(tl, tl_b, sizeof(ENTROPY_CONTEXT_PLANES)); - - labels2mode(x, labels, i, mode_selected, &mode_mv[mode_selected], - bsi->ref_mv, x->mvcost); - - br += sbr; - bd += sbd; - segmentyrate += bestlabelyrate; - this_segment_rd += best_label_rd; - - if (this_segment_rd >= bsi->segment_rd) - break; - - } /* for each label */ - - if (this_segment_rd < bsi->segment_rd) - { - bsi->r = br; - bsi->d = bd; - bsi->segment_yrate = segmentyrate; - bsi->segment_rd = this_segment_rd; - bsi->segment_num = segmentation; - - /* store everything needed to come back to this!! */ - for (i = 0; i < 16; i++) - { - bsi->mvs[i].as_mv = x->partition_info->bmi[i].mv.as_mv; - bsi->modes[i] = x->partition_info->bmi[i].mode; - bsi->eobs[i] = x->e_mbd.eobs[i]; - } - } -} - -static -void vp8_cal_step_param(int sr, int *sp) -{ - int step = 0; - - if (sr > MAX_FIRST_STEP) sr = MAX_FIRST_STEP; - else if (sr < 1) sr = 1; - - while (sr>>=1) - step++; - - *sp = MAX_MVSEARCH_STEPS - 1 - step; -} - -static int vp8_rd_pick_best_mbsegmentation(VP8_COMP *cpi, MACROBLOCK *x, - int_mv *best_ref_mv, int best_rd, - int *mdcounts, int *returntotrate, - int *returnyrate, int *returndistortion, - int mvthresh) -{ - int i; - BEST_SEG_INFO bsi; - - vpx_memset(&bsi, 0, sizeof(bsi)); - - bsi.segment_rd = best_rd; - bsi.ref_mv = best_ref_mv; - bsi.mvp.as_int = best_ref_mv->as_int; - bsi.mvthresh = mvthresh; - bsi.mdcounts = mdcounts; - - for(i = 0; i < 16; i++) - { - bsi.modes[i] = ZERO4X4; - } - - if(cpi->compressor_speed == 0) - { - /* for now, we will keep the original segmentation order - when in best quality mode */ - rd_check_segment(cpi, x, &bsi, BLOCK_16X8); - rd_check_segment(cpi, x, &bsi, BLOCK_8X16); - rd_check_segment(cpi, x, &bsi, BLOCK_8X8); - rd_check_segment(cpi, x, &bsi, BLOCK_4X4); - } - else - { - int sr; - - rd_check_segment(cpi, x, &bsi, BLOCK_8X8); - - if (bsi.segment_rd < best_rd) - { - int col_min = ((best_ref_mv->as_mv.col+7)>>3) - MAX_FULL_PEL_VAL; - int row_min = ((best_ref_mv->as_mv.row+7)>>3) - MAX_FULL_PEL_VAL; - int col_max = (best_ref_mv->as_mv.col>>3) + MAX_FULL_PEL_VAL; - int row_max = (best_ref_mv->as_mv.row>>3) + MAX_FULL_PEL_VAL; - - int tmp_col_min = x->mv_col_min; - int tmp_col_max = x->mv_col_max; - int tmp_row_min = x->mv_row_min; - int tmp_row_max = x->mv_row_max; - - /* Get intersection of UMV window and valid MV window to reduce # of checks in diamond search. */ - if (x->mv_col_min < col_min ) - x->mv_col_min = col_min; - if (x->mv_col_max > col_max ) - x->mv_col_max = col_max; - if (x->mv_row_min < row_min ) - x->mv_row_min = row_min; - if (x->mv_row_max > row_max ) - x->mv_row_max = row_max; - - /* Get 8x8 result */ - bsi.sv_mvp[0].as_int = bsi.mvs[0].as_int; - bsi.sv_mvp[1].as_int = bsi.mvs[2].as_int; - bsi.sv_mvp[2].as_int = bsi.mvs[8].as_int; - bsi.sv_mvp[3].as_int = bsi.mvs[10].as_int; - - /* Use 8x8 result as 16x8/8x16's predictor MV. Adjust search range according to the closeness of 2 MV. */ - /* block 8X16 */ - { - sr = MAXF((abs(bsi.sv_mvp[0].as_mv.row - bsi.sv_mvp[2].as_mv.row))>>3, (abs(bsi.sv_mvp[0].as_mv.col - bsi.sv_mvp[2].as_mv.col))>>3); - vp8_cal_step_param(sr, &bsi.sv_istep[0]); - - sr = MAXF((abs(bsi.sv_mvp[1].as_mv.row - bsi.sv_mvp[3].as_mv.row))>>3, (abs(bsi.sv_mvp[1].as_mv.col - bsi.sv_mvp[3].as_mv.col))>>3); - vp8_cal_step_param(sr, &bsi.sv_istep[1]); - - rd_check_segment(cpi, x, &bsi, BLOCK_8X16); - } - - /* block 16X8 */ - { - sr = MAXF((abs(bsi.sv_mvp[0].as_mv.row - bsi.sv_mvp[1].as_mv.row))>>3, (abs(bsi.sv_mvp[0].as_mv.col - bsi.sv_mvp[1].as_mv.col))>>3); - vp8_cal_step_param(sr, &bsi.sv_istep[0]); - - sr = MAXF((abs(bsi.sv_mvp[2].as_mv.row - bsi.sv_mvp[3].as_mv.row))>>3, (abs(bsi.sv_mvp[2].as_mv.col - bsi.sv_mvp[3].as_mv.col))>>3); - vp8_cal_step_param(sr, &bsi.sv_istep[1]); - - rd_check_segment(cpi, x, &bsi, BLOCK_16X8); - } - - /* If 8x8 is better than 16x8/8x16, then do 4x4 search */ - /* Not skip 4x4 if speed=0 (good quality) */ - if (cpi->sf.no_skip_block4x4_search || bsi.segment_num == BLOCK_8X8) /* || (sv_segment_rd8x8-bsi.segment_rd) < sv_segment_rd8x8>>5) */ - { - bsi.mvp.as_int = bsi.sv_mvp[0].as_int; - rd_check_segment(cpi, x, &bsi, BLOCK_4X4); - } - - /* restore UMV window */ - x->mv_col_min = tmp_col_min; - x->mv_col_max = tmp_col_max; - x->mv_row_min = tmp_row_min; - x->mv_row_max = tmp_row_max; - } - } - - /* set it to the best */ - for (i = 0; i < 16; i++) - { - BLOCKD *bd = &x->e_mbd.block[i]; - - bd->bmi.mv.as_int = bsi.mvs[i].as_int; - *bd->eob = bsi.eobs[i]; - } - - *returntotrate = bsi.r; - *returndistortion = bsi.d; - *returnyrate = bsi.segment_yrate; - - /* save partitions */ - x->e_mbd.mode_info_context->mbmi.partitioning = bsi.segment_num; - x->partition_info->count = vp8_mbsplit_count[bsi.segment_num]; - - for (i = 0; i < x->partition_info->count; i++) - { - int j; - - j = vp8_mbsplit_offset[bsi.segment_num][i]; - - x->partition_info->bmi[i].mode = bsi.modes[j]; - x->partition_info->bmi[i].mv.as_mv = bsi.mvs[j].as_mv; - } - /* - * used to set x->e_mbd.mode_info_context->mbmi.mv.as_int - */ - x->partition_info->bmi[15].mv.as_int = bsi.mvs[15].as_int; - - return bsi.segment_rd; -} - -/* The improved MV prediction */ -void vp8_mv_pred -( - VP8_COMP *cpi, - MACROBLOCKD *xd, - const MODE_INFO *here, - int_mv *mvp, - int refframe, - int *ref_frame_sign_bias, - int *sr, - int near_sadidx[] -) -{ - const MODE_INFO *above = here - xd->mode_info_stride; - const MODE_INFO *left = here - 1; - const MODE_INFO *aboveleft = above - 1; - int_mv near_mvs[8]; - int near_ref[8]; - int_mv mv; - int vcnt=0; - int find=0; - int mb_offset; - - int mvx[8]; - int mvy[8]; - int i; - - mv.as_int = 0; - - if(here->mbmi.ref_frame != INTRA_FRAME) - { - near_mvs[0].as_int = near_mvs[1].as_int = near_mvs[2].as_int = near_mvs[3].as_int = near_mvs[4].as_int = near_mvs[5].as_int = near_mvs[6].as_int = near_mvs[7].as_int = 0; - near_ref[0] = near_ref[1] = near_ref[2] = near_ref[3] = near_ref[4] = near_ref[5] = near_ref[6] = near_ref[7] = 0; - - /* read in 3 nearby block's MVs from current frame as prediction - * candidates. - */ - if (above->mbmi.ref_frame != INTRA_FRAME) - { - near_mvs[vcnt].as_int = above->mbmi.mv.as_int; - mv_bias(ref_frame_sign_bias[above->mbmi.ref_frame], refframe, &near_mvs[vcnt], ref_frame_sign_bias); - near_ref[vcnt] = above->mbmi.ref_frame; - } - vcnt++; - if (left->mbmi.ref_frame != INTRA_FRAME) - { - near_mvs[vcnt].as_int = left->mbmi.mv.as_int; - mv_bias(ref_frame_sign_bias[left->mbmi.ref_frame], refframe, &near_mvs[vcnt], ref_frame_sign_bias); - near_ref[vcnt] = left->mbmi.ref_frame; - } - vcnt++; - if (aboveleft->mbmi.ref_frame != INTRA_FRAME) - { - near_mvs[vcnt].as_int = aboveleft->mbmi.mv.as_int; - mv_bias(ref_frame_sign_bias[aboveleft->mbmi.ref_frame], refframe, &near_mvs[vcnt], ref_frame_sign_bias); - near_ref[vcnt] = aboveleft->mbmi.ref_frame; - } - vcnt++; - - /* read in 5 nearby block's MVs from last frame. */ - if(cpi->common.last_frame_type != KEY_FRAME) - { - mb_offset = (-xd->mb_to_top_edge/128 + 1) * (xd->mode_info_stride +1) + (-xd->mb_to_left_edge/128 +1) ; - - /* current in last frame */ - if (cpi->lf_ref_frame[mb_offset] != INTRA_FRAME) - { - near_mvs[vcnt].as_int = cpi->lfmv[mb_offset].as_int; - mv_bias(cpi->lf_ref_frame_sign_bias[mb_offset], refframe, &near_mvs[vcnt], ref_frame_sign_bias); - near_ref[vcnt] = cpi->lf_ref_frame[mb_offset]; - } - vcnt++; - - /* above in last frame */ - if (cpi->lf_ref_frame[mb_offset - xd->mode_info_stride-1] != INTRA_FRAME) - { - near_mvs[vcnt].as_int = cpi->lfmv[mb_offset - xd->mode_info_stride-1].as_int; - mv_bias(cpi->lf_ref_frame_sign_bias[mb_offset - xd->mode_info_stride-1], refframe, &near_mvs[vcnt], ref_frame_sign_bias); - near_ref[vcnt] = cpi->lf_ref_frame[mb_offset - xd->mode_info_stride-1]; - } - vcnt++; - - /* left in last frame */ - if (cpi->lf_ref_frame[mb_offset-1] != INTRA_FRAME) - { - near_mvs[vcnt].as_int = cpi->lfmv[mb_offset -1].as_int; - mv_bias(cpi->lf_ref_frame_sign_bias[mb_offset -1], refframe, &near_mvs[vcnt], ref_frame_sign_bias); - near_ref[vcnt] = cpi->lf_ref_frame[mb_offset - 1]; - } - vcnt++; - - /* right in last frame */ - if (cpi->lf_ref_frame[mb_offset +1] != INTRA_FRAME) - { - near_mvs[vcnt].as_int = cpi->lfmv[mb_offset +1].as_int; - mv_bias(cpi->lf_ref_frame_sign_bias[mb_offset +1], refframe, &near_mvs[vcnt], ref_frame_sign_bias); - near_ref[vcnt] = cpi->lf_ref_frame[mb_offset +1]; - } - vcnt++; - - /* below in last frame */ - if (cpi->lf_ref_frame[mb_offset + xd->mode_info_stride +1] != INTRA_FRAME) - { - near_mvs[vcnt].as_int = cpi->lfmv[mb_offset + xd->mode_info_stride +1].as_int; - mv_bias(cpi->lf_ref_frame_sign_bias[mb_offset + xd->mode_info_stride +1], refframe, &near_mvs[vcnt], ref_frame_sign_bias); - near_ref[vcnt] = cpi->lf_ref_frame[mb_offset + xd->mode_info_stride +1]; - } - vcnt++; - } - - for(i=0; i< vcnt; i++) - { - if(near_ref[near_sadidx[i]] != INTRA_FRAME) - { - if(here->mbmi.ref_frame == near_ref[near_sadidx[i]]) - { - mv.as_int = near_mvs[near_sadidx[i]].as_int; - find = 1; - if (i < 3) - *sr = 3; - else - *sr = 2; - break; - } - } - } - - if(!find) - { - for(i=0; ias_int = mv.as_int; - vp8_clamp_mv2(mvp, xd); -} - -void vp8_cal_sad(VP8_COMP *cpi, MACROBLOCKD *xd, MACROBLOCK *x, int recon_yoffset, int near_sadidx[]) -{ - /* near_sad indexes: - * 0-cf above, 1-cf left, 2-cf aboveleft, - * 3-lf current, 4-lf above, 5-lf left, 6-lf right, 7-lf below - */ - int near_sad[8] = {0}; - BLOCK *b = &x->block[0]; - unsigned char *src_y_ptr = *(b->base_src); - - /* calculate sad for current frame 3 nearby MBs. */ - if( xd->mb_to_top_edge==0 && xd->mb_to_left_edge ==0) - { - near_sad[0] = near_sad[1] = near_sad[2] = INT_MAX; - }else if(xd->mb_to_top_edge==0) - { /* only has left MB for sad calculation. */ - near_sad[0] = near_sad[2] = INT_MAX; - near_sad[1] = cpi->fn_ptr[BLOCK_16X16].sdf(src_y_ptr, b->src_stride, xd->dst.y_buffer - 16,xd->dst.y_stride, UINT_MAX); - }else if(xd->mb_to_left_edge ==0) - { /* only has left MB for sad calculation. */ - near_sad[1] = near_sad[2] = INT_MAX; - near_sad[0] = cpi->fn_ptr[BLOCK_16X16].sdf(src_y_ptr, b->src_stride, xd->dst.y_buffer - xd->dst.y_stride *16,xd->dst.y_stride, UINT_MAX); - }else - { - near_sad[0] = cpi->fn_ptr[BLOCK_16X16].sdf(src_y_ptr, b->src_stride, xd->dst.y_buffer - xd->dst.y_stride *16,xd->dst.y_stride, UINT_MAX); - near_sad[1] = cpi->fn_ptr[BLOCK_16X16].sdf(src_y_ptr, b->src_stride, xd->dst.y_buffer - 16,xd->dst.y_stride, UINT_MAX); - near_sad[2] = cpi->fn_ptr[BLOCK_16X16].sdf(src_y_ptr, b->src_stride, xd->dst.y_buffer - xd->dst.y_stride *16 -16,xd->dst.y_stride, UINT_MAX); - } - - if(cpi->common.last_frame_type != KEY_FRAME) - { - /* calculate sad for last frame 5 nearby MBs. */ - unsigned char *pre_y_buffer = cpi->common.yv12_fb[cpi->common.lst_fb_idx].y_buffer + recon_yoffset; - int pre_y_stride = cpi->common.yv12_fb[cpi->common.lst_fb_idx].y_stride; - - if(xd->mb_to_top_edge==0) near_sad[4] = INT_MAX; - if(xd->mb_to_left_edge ==0) near_sad[5] = INT_MAX; - if(xd->mb_to_right_edge ==0) near_sad[6] = INT_MAX; - if(xd->mb_to_bottom_edge==0) near_sad[7] = INT_MAX; - - if(near_sad[4] != INT_MAX) - near_sad[4] = cpi->fn_ptr[BLOCK_16X16].sdf(src_y_ptr, b->src_stride, pre_y_buffer - pre_y_stride *16, pre_y_stride, UINT_MAX); - if(near_sad[5] != INT_MAX) - near_sad[5] = cpi->fn_ptr[BLOCK_16X16].sdf(src_y_ptr, b->src_stride, pre_y_buffer - 16, pre_y_stride, UINT_MAX); - near_sad[3] = cpi->fn_ptr[BLOCK_16X16].sdf(src_y_ptr, b->src_stride, pre_y_buffer, pre_y_stride, UINT_MAX); - if(near_sad[6] != INT_MAX) - near_sad[6] = cpi->fn_ptr[BLOCK_16X16].sdf(src_y_ptr, b->src_stride, pre_y_buffer + 16, pre_y_stride, UINT_MAX); - if(near_sad[7] != INT_MAX) - near_sad[7] = cpi->fn_ptr[BLOCK_16X16].sdf(src_y_ptr, b->src_stride, pre_y_buffer + pre_y_stride *16, pre_y_stride, UINT_MAX); - } - - if(cpi->common.last_frame_type != KEY_FRAME) - { - insertsortsad(near_sad, near_sadidx, 8); - }else - { - insertsortsad(near_sad, near_sadidx, 3); - } -} - -static void rd_update_mvcount(MACROBLOCK *x, int_mv *best_ref_mv) -{ - if (x->e_mbd.mode_info_context->mbmi.mode == SPLITMV) - { - int i; - - for (i = 0; i < x->partition_info->count; i++) - { - if (x->partition_info->bmi[i].mode == NEW4X4) - { - x->MVcount[0][mv_max+((x->partition_info->bmi[i].mv.as_mv.row - - best_ref_mv->as_mv.row) >> 1)]++; - x->MVcount[1][mv_max+((x->partition_info->bmi[i].mv.as_mv.col - - best_ref_mv->as_mv.col) >> 1)]++; - } - } - } - else if (x->e_mbd.mode_info_context->mbmi.mode == NEWMV) - { - x->MVcount[0][mv_max+((x->e_mbd.mode_info_context->mbmi.mv.as_mv.row - - best_ref_mv->as_mv.row) >> 1)]++; - x->MVcount[1][mv_max+((x->e_mbd.mode_info_context->mbmi.mv.as_mv.col - - best_ref_mv->as_mv.col) >> 1)]++; - } -} - -static int evaluate_inter_mode_rd(int mdcounts[4], - RATE_DISTORTION* rd, - int* disable_skip, - VP8_COMP *cpi, MACROBLOCK *x) -{ - MB_PREDICTION_MODE this_mode = x->e_mbd.mode_info_context->mbmi.mode; - BLOCK *b = &x->block[0]; - MACROBLOCKD *xd = &x->e_mbd; - int distortion; - vp8_build_inter16x16_predictors_mby(&x->e_mbd, x->e_mbd.predictor, 16); - - if (cpi->active_map_enabled && x->active_ptr[0] == 0) { - x->skip = 1; - } - else if (x->encode_breakout) - { - unsigned int sse; - unsigned int var; - unsigned int threshold = (xd->block[0].dequant[1] - * xd->block[0].dequant[1] >>4); - - if(threshold < x->encode_breakout) - threshold = x->encode_breakout; - - var = vp8_variance16x16 - (*(b->base_src), b->src_stride, - x->e_mbd.predictor, 16, &sse); - - if (sse < threshold) - { - unsigned int q2dc = xd->block[24].dequant[0]; - /* If theres is no codeable 2nd order dc - or a very small uniform pixel change change */ - if ((sse - var < q2dc * q2dc >>4) || - (sse /2 > var && sse-var < 64)) - { - /* Check u and v to make sure skip is ok */ - unsigned int sse2 = VP8_UVSSE(x); - if (sse2 * 2 < threshold) - { - x->skip = 1; - rd->distortion2 = sse + sse2; - rd->rate2 = 500; - - /* for best_yrd calculation */ - rd->rate_uv = 0; - rd->distortion_uv = sse2; - - *disable_skip = 1; - return RDCOST(x->rdmult, x->rddiv, rd->rate2, - rd->distortion2); - } - } - } - } - - - /* Add in the Mv/mode cost */ - rd->rate2 += vp8_cost_mv_ref(this_mode, mdcounts); - - /* Y cost and distortion */ - macro_block_yrd(x, &rd->rate_y, &distortion); - rd->rate2 += rd->rate_y; - rd->distortion2 += distortion; - - /* UV cost and distortion */ - rd_inter16x16_uv(cpi, x, &rd->rate_uv, &rd->distortion_uv, - cpi->common.full_pixel); - rd->rate2 += rd->rate_uv; - rd->distortion2 += rd->distortion_uv; - return INT_MAX; -} - -static int calculate_final_rd_costs(int this_rd, - RATE_DISTORTION* rd, - int* other_cost, - int disable_skip, - int uv_intra_tteob, - int intra_rd_penalty, - VP8_COMP *cpi, MACROBLOCK *x) -{ - MB_PREDICTION_MODE this_mode = x->e_mbd.mode_info_context->mbmi.mode; - - /* Where skip is allowable add in the default per mb cost for the no - * skip case. where we then decide to skip we have to delete this and - * replace it with the cost of signalling a skip - */ - if (cpi->common.mb_no_coeff_skip) - { - *other_cost += vp8_cost_bit(cpi->prob_skip_false, 0); - rd->rate2 += *other_cost; - } - - /* Estimate the reference frame signaling cost and add it - * to the rolling cost variable. - */ - rd->rate2 += - x->ref_frame_cost[x->e_mbd.mode_info_context->mbmi.ref_frame]; - - if (!disable_skip) - { - /* Test for the condition where skip block will be activated - * because there are no non zero coefficients and make any - * necessary adjustment for rate - */ - if (cpi->common.mb_no_coeff_skip) - { - int i; - int tteob; - int has_y2_block = (this_mode!=SPLITMV && this_mode!=B_PRED); - - tteob = 0; - if(has_y2_block) - tteob += x->e_mbd.eobs[24]; - - for (i = 0; i < 16; i++) - tteob += (x->e_mbd.eobs[i] > has_y2_block); - - if (x->e_mbd.mode_info_context->mbmi.ref_frame) - { - for (i = 16; i < 24; i++) - tteob += x->e_mbd.eobs[i]; - } - else - tteob += uv_intra_tteob; - - if (tteob == 0) - { - rd->rate2 -= (rd->rate_y + rd->rate_uv); - /* for best_yrd calculation */ - rd->rate_uv = 0; - - /* Back out no skip flag costing and add in skip flag costing */ - if (cpi->prob_skip_false) - { - int prob_skip_cost; - - prob_skip_cost = vp8_cost_bit(cpi->prob_skip_false, 1); - prob_skip_cost -= vp8_cost_bit(cpi->prob_skip_false, 0); - rd->rate2 += prob_skip_cost; - *other_cost += prob_skip_cost; - } - } - } - /* Calculate the final RD estimate for this mode */ - this_rd = RDCOST(x->rdmult, x->rddiv, rd->rate2, rd->distortion2); - if (this_rd < INT_MAX && x->e_mbd.mode_info_context->mbmi.ref_frame - == INTRA_FRAME) - this_rd += intra_rd_penalty; - } - return this_rd; -} - -static void update_best_mode(BEST_MODE* best_mode, int this_rd, - RATE_DISTORTION* rd, int other_cost, MACROBLOCK *x) -{ - MB_PREDICTION_MODE this_mode = x->e_mbd.mode_info_context->mbmi.mode; - - other_cost += - x->ref_frame_cost[x->e_mbd.mode_info_context->mbmi.ref_frame]; - - /* Calculate the final y RD estimate for this mode */ - best_mode->yrd = RDCOST(x->rdmult, x->rddiv, (rd->rate2-rd->rate_uv-other_cost), - (rd->distortion2-rd->distortion_uv)); - - best_mode->rd = this_rd; - vpx_memcpy(&best_mode->mbmode, &x->e_mbd.mode_info_context->mbmi, sizeof(MB_MODE_INFO)); - vpx_memcpy(&best_mode->partition, x->partition_info, sizeof(PARTITION_INFO)); - - if ((this_mode == B_PRED) || (this_mode == SPLITMV)) - { - int i; - for (i = 0; i < 16; i++) - { - best_mode->bmodes[i] = x->e_mbd.block[i].bmi; - } - } -} - -void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, - int recon_uvoffset, int *returnrate, - int *returndistortion, int *returnintra, - int mb_row, int mb_col) -{ - BLOCK *b = &x->block[0]; - BLOCKD *d = &x->e_mbd.block[0]; - MACROBLOCKD *xd = &x->e_mbd; - int_mv best_ref_mv_sb[2]; - int_mv mode_mv_sb[2][MB_MODE_COUNT]; - int_mv best_ref_mv; - int_mv *mode_mv; - MB_PREDICTION_MODE this_mode; - int num00; - int best_mode_index = 0; - BEST_MODE best_mode; - - int i; - int mode_index; - int mdcounts[4]; - int rate; - RATE_DISTORTION rd; - int uv_intra_rate, uv_intra_distortion, uv_intra_rate_tokenonly; - int uv_intra_tteob = 0; - int uv_intra_done = 0; - - MB_PREDICTION_MODE uv_intra_mode = 0; - int_mv mvp; - int near_sadidx[8] = {0, 1, 2, 3, 4, 5, 6, 7}; - int saddone=0; - /* search range got from mv_pred(). It uses step_param levels. (0-7) */ - int sr=0; - - unsigned char *plane[4][3]; - int ref_frame_map[4]; - int sign_bias = 0; - - int intra_rd_penalty = 10* vp8_dc_quant(cpi->common.base_qindex, - cpi->common.y1dc_delta_q); - -#if CONFIG_TEMPORAL_DENOISING - unsigned int zero_mv_sse = UINT_MAX, best_sse = UINT_MAX, - best_rd_sse = UINT_MAX; -#endif - - mode_mv = mode_mv_sb[sign_bias]; - best_ref_mv.as_int = 0; - best_mode.rd = INT_MAX; - best_mode.yrd = INT_MAX; - best_mode.intra_rd = INT_MAX; - vpx_memset(mode_mv_sb, 0, sizeof(mode_mv_sb)); - vpx_memset(&best_mode.mbmode, 0, sizeof(best_mode.mbmode)); - vpx_memset(&best_mode.bmodes, 0, sizeof(best_mode.bmodes)); - - /* Setup search priorities */ - get_reference_search_order(cpi, ref_frame_map); - - /* Check to see if there is at least 1 valid reference frame that we need - * to calculate near_mvs. - */ - if (ref_frame_map[1] > 0) - { - sign_bias = vp8_find_near_mvs_bias(&x->e_mbd, - x->e_mbd.mode_info_context, - mode_mv_sb, - best_ref_mv_sb, - mdcounts, - ref_frame_map[1], - cpi->common.ref_frame_sign_bias); - - mode_mv = mode_mv_sb[sign_bias]; - best_ref_mv.as_int = best_ref_mv_sb[sign_bias].as_int; - } - - get_predictor_pointers(cpi, plane, recon_yoffset, recon_uvoffset); - - *returnintra = INT_MAX; - /* Count of the number of MBs tested so far this frame */ - x->mbs_tested_so_far++; - - x->skip = 0; - - for (mode_index = 0; mode_index < MAX_MODES; mode_index++) - { - int this_rd = INT_MAX; - int disable_skip = 0; - int other_cost = 0; - int this_ref_frame = ref_frame_map[vp8_ref_frame_order[mode_index]]; - - /* Test best rd so far against threshold for trying this mode. */ - if (best_mode.rd <= x->rd_threshes[mode_index]) - continue; - - if (this_ref_frame < 0) - continue; - - /* These variables hold are rolling total cost and distortion for - * this mode - */ - rd.rate2 = 0; - rd.distortion2 = 0; - - this_mode = vp8_mode_order[mode_index]; - - x->e_mbd.mode_info_context->mbmi.mode = this_mode; - x->e_mbd.mode_info_context->mbmi.ref_frame = this_ref_frame; - - /* Only consider ZEROMV/ALTREF_FRAME for alt ref frame, - * unless ARNR filtering is enabled in which case we want - * an unfiltered alternative - */ - if (cpi->is_src_frame_alt_ref && (cpi->oxcf.arnr_max_frames == 0)) - { - if (this_mode != ZEROMV || x->e_mbd.mode_info_context->mbmi.ref_frame != ALTREF_FRAME) - continue; - } - - /* everything but intra */ - if (x->e_mbd.mode_info_context->mbmi.ref_frame) - { - x->e_mbd.pre.y_buffer = plane[this_ref_frame][0]; - x->e_mbd.pre.u_buffer = plane[this_ref_frame][1]; - x->e_mbd.pre.v_buffer = plane[this_ref_frame][2]; - - if (sign_bias != cpi->common.ref_frame_sign_bias[this_ref_frame]) - { - sign_bias = cpi->common.ref_frame_sign_bias[this_ref_frame]; - mode_mv = mode_mv_sb[sign_bias]; - best_ref_mv.as_int = best_ref_mv_sb[sign_bias].as_int; - } - } - - /* Check to see if the testing frequency for this mode is at its - * max If so then prevent it from being tested and increase the - * threshold for its testing - */ - if (x->mode_test_hit_counts[mode_index] && (cpi->mode_check_freq[mode_index] > 1)) - { - if (x->mbs_tested_so_far <= cpi->mode_check_freq[mode_index] * x->mode_test_hit_counts[mode_index]) - { - /* Increase the threshold for coding this mode to make it - * less likely to be chosen - */ - x->rd_thresh_mult[mode_index] += 4; - - if (x->rd_thresh_mult[mode_index] > MAX_THRESHMULT) - x->rd_thresh_mult[mode_index] = MAX_THRESHMULT; - - x->rd_threshes[mode_index] = - (cpi->rd_baseline_thresh[mode_index] >> 7) * - x->rd_thresh_mult[mode_index]; - - continue; - } - } - - /* We have now reached the point where we are going to test the - * current mode so increment the counter for the number of times - * it has been tested - */ - x->mode_test_hit_counts[mode_index] ++; - - /* Experimental code. Special case for gf and arf zeromv modes. - * Increase zbin size to supress noise - */ - if (x->zbin_mode_boost_enabled) - { - if ( this_ref_frame == INTRA_FRAME ) - x->zbin_mode_boost = 0; - else - { - if (vp8_mode_order[mode_index] == ZEROMV) - { - if (this_ref_frame != LAST_FRAME) - x->zbin_mode_boost = GF_ZEROMV_ZBIN_BOOST; - else - x->zbin_mode_boost = LF_ZEROMV_ZBIN_BOOST; - } - else if (vp8_mode_order[mode_index] == SPLITMV) - x->zbin_mode_boost = 0; - else - x->zbin_mode_boost = MV_ZBIN_BOOST; - } - - vp8_update_zbin_extra(cpi, x); - } - - if(!uv_intra_done && this_ref_frame == INTRA_FRAME) - { - rd_pick_intra_mbuv_mode(x, &uv_intra_rate, - &uv_intra_rate_tokenonly, - &uv_intra_distortion); - uv_intra_mode = x->e_mbd.mode_info_context->mbmi.uv_mode; - - /* - * Total of the eobs is used later to further adjust rate2. Since uv - * block's intra eobs will be overwritten when we check inter modes, - * we need to save uv_intra_tteob here. - */ - for (i = 16; i < 24; i++) - uv_intra_tteob += x->e_mbd.eobs[i]; - - uv_intra_done = 1; - } - - switch (this_mode) - { - case B_PRED: - { - int tmp_rd; - - /* Note the rate value returned here includes the cost of - * coding the BPRED mode: x->mbmode_cost[x->e_mbd.frame_type][BPRED] - */ - int distortion; - tmp_rd = rd_pick_intra4x4mby_modes(x, &rate, &rd.rate_y, &distortion, best_mode.yrd); - rd.rate2 += rate; - rd.distortion2 += distortion; - - if(tmp_rd < best_mode.yrd) - { - rd.rate2 += uv_intra_rate; - rd.rate_uv = uv_intra_rate_tokenonly; - rd.distortion2 += uv_intra_distortion; - rd.distortion_uv = uv_intra_distortion; - } - else - { - this_rd = INT_MAX; - disable_skip = 1; - } - } - break; - - case SPLITMV: - { - int tmp_rd; - int this_rd_thresh; - int distortion; - - this_rd_thresh = (vp8_ref_frame_order[mode_index] == 1) ? - x->rd_threshes[THR_NEW1] : x->rd_threshes[THR_NEW3]; - this_rd_thresh = (vp8_ref_frame_order[mode_index] == 2) ? - x->rd_threshes[THR_NEW2] : this_rd_thresh; - - tmp_rd = vp8_rd_pick_best_mbsegmentation(cpi, x, &best_ref_mv, - best_mode.yrd, mdcounts, - &rate, &rd.rate_y, &distortion, this_rd_thresh) ; - - rd.rate2 += rate; - rd.distortion2 += distortion; - - /* If even the 'Y' rd value of split is higher than best so far - * then dont bother looking at UV - */ - if (tmp_rd < best_mode.yrd) - { - /* Now work out UV cost and add it in */ - rd_inter4x4_uv(cpi, x, &rd.rate_uv, &rd.distortion_uv, cpi->common.full_pixel); - rd.rate2 += rd.rate_uv; - rd.distortion2 += rd.distortion_uv; - } - else - { - this_rd = INT_MAX; - disable_skip = 1; - } - } - break; - case DC_PRED: - case V_PRED: - case H_PRED: - case TM_PRED: - { - int distortion; - x->e_mbd.mode_info_context->mbmi.ref_frame = INTRA_FRAME; - - vp8_build_intra_predictors_mby_s(xd, - xd->dst.y_buffer - xd->dst.y_stride, - xd->dst.y_buffer - 1, - xd->dst.y_stride, - xd->predictor, - 16); - macro_block_yrd(x, &rd.rate_y, &distortion) ; - rd.rate2 += rd.rate_y; - rd.distortion2 += distortion; - rd.rate2 += x->mbmode_cost[x->e_mbd.frame_type][x->e_mbd.mode_info_context->mbmi.mode]; - rd.rate2 += uv_intra_rate; - rd.rate_uv = uv_intra_rate_tokenonly; - rd.distortion2 += uv_intra_distortion; - rd.distortion_uv = uv_intra_distortion; - } - break; - - case NEWMV: - { - int thissme; - int bestsme = INT_MAX; - int step_param = cpi->sf.first_step; - int further_steps; - int n; - int do_refine=1; /* If last step (1-away) of n-step search doesn't pick the center point as the best match, - we will do a final 1-away diamond refining search */ - - int sadpb = x->sadperbit16; - int_mv mvp_full; - - int col_min = ((best_ref_mv.as_mv.col+7)>>3) - MAX_FULL_PEL_VAL; - int row_min = ((best_ref_mv.as_mv.row+7)>>3) - MAX_FULL_PEL_VAL; - int col_max = (best_ref_mv.as_mv.col>>3) + MAX_FULL_PEL_VAL; - int row_max = (best_ref_mv.as_mv.row>>3) + MAX_FULL_PEL_VAL; - - int tmp_col_min = x->mv_col_min; - int tmp_col_max = x->mv_col_max; - int tmp_row_min = x->mv_row_min; - int tmp_row_max = x->mv_row_max; - - if(!saddone) - { - vp8_cal_sad(cpi,xd,x, recon_yoffset ,&near_sadidx[0] ); - saddone = 1; - } - - vp8_mv_pred(cpi, &x->e_mbd, x->e_mbd.mode_info_context, &mvp, - x->e_mbd.mode_info_context->mbmi.ref_frame, cpi->common.ref_frame_sign_bias, &sr, &near_sadidx[0]); - - mvp_full.as_mv.col = mvp.as_mv.col>>3; - mvp_full.as_mv.row = mvp.as_mv.row>>3; - - /* Get intersection of UMV window and valid MV window to - * reduce # of checks in diamond search. - */ - if (x->mv_col_min < col_min ) - x->mv_col_min = col_min; - if (x->mv_col_max > col_max ) - x->mv_col_max = col_max; - if (x->mv_row_min < row_min ) - x->mv_row_min = row_min; - if (x->mv_row_max > row_max ) - x->mv_row_max = row_max; - - /* adjust search range according to sr from mv prediction */ - if(sr > step_param) - step_param = sr; - - /* Initial step/diamond search */ - { - bestsme = cpi->diamond_search_sad(x, b, d, &mvp_full, &d->bmi.mv, - step_param, sadpb, &num00, - &cpi->fn_ptr[BLOCK_16X16], - x->mvcost, &best_ref_mv); - mode_mv[NEWMV].as_int = d->bmi.mv.as_int; - - /* Further step/diamond searches as necessary */ - n = 0; - further_steps = (cpi->sf.max_step_search_steps - 1) - step_param; - - n = num00; - num00 = 0; - - /* If there won't be more n-step search, check to see if refining search is needed. */ - if (n > further_steps) - do_refine = 0; - - while (n < further_steps) - { - n++; - - if (num00) - num00--; - else - { - thissme = cpi->diamond_search_sad(x, b, d, &mvp_full, - &d->bmi.mv, step_param + n, sadpb, &num00, - &cpi->fn_ptr[BLOCK_16X16], x->mvcost, - &best_ref_mv); - - /* check to see if refining search is needed. */ - if (num00 > (further_steps-n)) - do_refine = 0; - - if (thissme < bestsme) - { - bestsme = thissme; - mode_mv[NEWMV].as_int = d->bmi.mv.as_int; - } - else - { - d->bmi.mv.as_int = mode_mv[NEWMV].as_int; - } - } - } - } - - /* final 1-away diamond refining search */ - if (do_refine == 1) - { - int search_range; - - search_range = 8; - - thissme = cpi->refining_search_sad(x, b, d, &d->bmi.mv, sadpb, - search_range, &cpi->fn_ptr[BLOCK_16X16], - x->mvcost, &best_ref_mv); - - if (thissme < bestsme) - { - bestsme = thissme; - mode_mv[NEWMV].as_int = d->bmi.mv.as_int; - } - else - { - d->bmi.mv.as_int = mode_mv[NEWMV].as_int; - } - } - - x->mv_col_min = tmp_col_min; - x->mv_col_max = tmp_col_max; - x->mv_row_min = tmp_row_min; - x->mv_row_max = tmp_row_max; - - if (bestsme < INT_MAX) - { - int dis; /* TODO: use dis in distortion calculation later. */ - unsigned int sse; - cpi->find_fractional_mv_step(x, b, d, &d->bmi.mv, &best_ref_mv, - x->errorperbit, - &cpi->fn_ptr[BLOCK_16X16], - x->mvcost, &dis, &sse); - } - - mode_mv[NEWMV].as_int = d->bmi.mv.as_int; - - /* Add the new motion vector cost to our rolling cost variable */ - rd.rate2 += vp8_mv_bit_cost(&mode_mv[NEWMV], &best_ref_mv, x->mvcost, 96); - } - - case NEARESTMV: - case NEARMV: - /* Clip "next_nearest" so that it does not extend to far out - * of image - */ - vp8_clamp_mv2(&mode_mv[this_mode], xd); - - /* Do not bother proceeding if the vector (from newmv, nearest - * or near) is 0,0 as this should then be coded using the zeromv - * mode. - */ - if (((this_mode == NEARMV) || (this_mode == NEARESTMV)) && (mode_mv[this_mode].as_int == 0)) - continue; - - case ZEROMV: - - /* Trap vectors that reach beyond the UMV borders - * Note that ALL New MV, Nearest MV Near MV and Zero MV code - * drops through to this point because of the lack of break - * statements in the previous two cases. - */ - if (((mode_mv[this_mode].as_mv.row >> 3) < x->mv_row_min) || ((mode_mv[this_mode].as_mv.row >> 3) > x->mv_row_max) || - ((mode_mv[this_mode].as_mv.col >> 3) < x->mv_col_min) || ((mode_mv[this_mode].as_mv.col >> 3) > x->mv_col_max)) - continue; - - vp8_set_mbmode_and_mvs(x, this_mode, &mode_mv[this_mode]); - this_rd = evaluate_inter_mode_rd(mdcounts, &rd, - &disable_skip, cpi, x); - break; - - default: - break; - } - - this_rd = calculate_final_rd_costs(this_rd, &rd, &other_cost, - disable_skip, uv_intra_tteob, - intra_rd_penalty, cpi, x); - - /* Keep record of best intra distortion */ - if ((x->e_mbd.mode_info_context->mbmi.ref_frame == INTRA_FRAME) && - (this_rd < best_mode.intra_rd) ) - { - best_mode.intra_rd = this_rd; - *returnintra = rd.distortion2 ; - } -#if CONFIG_TEMPORAL_DENOISING - if (cpi->oxcf.noise_sensitivity) - { - unsigned int sse; - vp8_get_inter_mbpred_error(x,&cpi->fn_ptr[BLOCK_16X16],&sse, - mode_mv[this_mode]); - - if (sse < best_rd_sse) - best_rd_sse = sse; - - /* Store for later use by denoiser. */ - if (this_mode == ZEROMV && sse < zero_mv_sse ) - { - zero_mv_sse = sse; - x->best_zeromv_reference_frame = - x->e_mbd.mode_info_context->mbmi.ref_frame; - } - - /* Store the best NEWMV in x for later use in the denoiser. */ - if (x->e_mbd.mode_info_context->mbmi.mode == NEWMV && - sse < best_sse) - { - best_sse = sse; - vp8_get_inter_mbpred_error(x,&cpi->fn_ptr[BLOCK_16X16],&best_sse, - mode_mv[this_mode]); - x->best_sse_inter_mode = NEWMV; - x->best_sse_mv = x->e_mbd.mode_info_context->mbmi.mv; - x->need_to_clamp_best_mvs = - x->e_mbd.mode_info_context->mbmi.need_to_clamp_mvs; - x->best_reference_frame = - x->e_mbd.mode_info_context->mbmi.ref_frame; - } - } -#endif - - /* Did this mode help.. i.i is it the new best mode */ - if (this_rd < best_mode.rd || x->skip) - { - /* Note index of best mode so far */ - best_mode_index = mode_index; - *returnrate = rd.rate2; - *returndistortion = rd.distortion2; - if (this_mode <= B_PRED) - { - x->e_mbd.mode_info_context->mbmi.uv_mode = uv_intra_mode; - /* required for left and above block mv */ - x->e_mbd.mode_info_context->mbmi.mv.as_int = 0; - } - update_best_mode(&best_mode, this_rd, &rd, other_cost, x); - - - /* Testing this mode gave rise to an improvement in best error - * score. Lower threshold a bit for next time - */ - x->rd_thresh_mult[mode_index] = - (x->rd_thresh_mult[mode_index] >= (MIN_THRESHMULT + 2)) ? - x->rd_thresh_mult[mode_index] - 2 : MIN_THRESHMULT; - } - - /* If the mode did not help improve the best error case then raise - * the threshold for testing that mode next time around. - */ - else - { - x->rd_thresh_mult[mode_index] += 4; - - if (x->rd_thresh_mult[mode_index] > MAX_THRESHMULT) - x->rd_thresh_mult[mode_index] = MAX_THRESHMULT; - } - x->rd_threshes[mode_index] = - (cpi->rd_baseline_thresh[mode_index] >> 7) * - x->rd_thresh_mult[mode_index]; - - if (x->skip) - break; - - } - - /* Reduce the activation RD thresholds for the best choice mode */ - if ((cpi->rd_baseline_thresh[best_mode_index] > 0) && (cpi->rd_baseline_thresh[best_mode_index] < (INT_MAX >> 2))) - { - int best_adjustment = (x->rd_thresh_mult[best_mode_index] >> 2); - - x->rd_thresh_mult[best_mode_index] = - (x->rd_thresh_mult[best_mode_index] >= - (MIN_THRESHMULT + best_adjustment)) ? - x->rd_thresh_mult[best_mode_index] - best_adjustment : - MIN_THRESHMULT; - x->rd_threshes[best_mode_index] = - (cpi->rd_baseline_thresh[best_mode_index] >> 7) * - x->rd_thresh_mult[best_mode_index]; - } - -#if CONFIG_TEMPORAL_DENOISING - if (cpi->oxcf.noise_sensitivity) - { - int block_index = mb_row * cpi->common.mb_cols + mb_col; - if (x->best_sse_inter_mode == DC_PRED) - { - /* No best MV found. */ - x->best_sse_inter_mode = best_mode.mbmode.mode; - x->best_sse_mv = best_mode.mbmode.mv; - x->need_to_clamp_best_mvs = best_mode.mbmode.need_to_clamp_mvs; - x->best_reference_frame = best_mode.mbmode.ref_frame; - best_sse = best_rd_sse; - } - vp8_denoiser_denoise_mb(&cpi->denoiser, x, best_sse, zero_mv_sse, - recon_yoffset, recon_uvoffset, - &cpi->common.lf_info, mb_row, mb_col, - block_index); - - /* Reevaluate ZEROMV after denoising. */ - if (best_mode.mbmode.ref_frame == INTRA_FRAME && - x->best_zeromv_reference_frame != INTRA_FRAME) - { - int this_rd = INT_MAX; - int disable_skip = 0; - int other_cost = 0; - int this_ref_frame = x->best_zeromv_reference_frame; - rd.rate2 = x->ref_frame_cost[this_ref_frame] + - vp8_cost_mv_ref(ZEROMV, mdcounts); - rd.distortion2 = 0; - - /* set up the proper prediction buffers for the frame */ - x->e_mbd.mode_info_context->mbmi.ref_frame = this_ref_frame; - x->e_mbd.pre.y_buffer = plane[this_ref_frame][0]; - x->e_mbd.pre.u_buffer = plane[this_ref_frame][1]; - x->e_mbd.pre.v_buffer = plane[this_ref_frame][2]; - - x->e_mbd.mode_info_context->mbmi.mode = ZEROMV; - x->e_mbd.mode_info_context->mbmi.uv_mode = DC_PRED; - x->e_mbd.mode_info_context->mbmi.mv.as_int = 0; - - this_rd = evaluate_inter_mode_rd(mdcounts, &rd, &disable_skip, cpi, x); - this_rd = calculate_final_rd_costs(this_rd, &rd, &other_cost, - disable_skip, uv_intra_tteob, - intra_rd_penalty, cpi, x); - if (this_rd < best_mode.rd || x->skip) - { - /* Note index of best mode so far */ - best_mode_index = mode_index; - *returnrate = rd.rate2; - *returndistortion = rd.distortion2; - update_best_mode(&best_mode, this_rd, &rd, other_cost, x); - } - } - - } -#endif - - if (cpi->is_src_frame_alt_ref && - (best_mode.mbmode.mode != ZEROMV || best_mode.mbmode.ref_frame != ALTREF_FRAME)) - { - x->e_mbd.mode_info_context->mbmi.mode = ZEROMV; - x->e_mbd.mode_info_context->mbmi.ref_frame = ALTREF_FRAME; - x->e_mbd.mode_info_context->mbmi.mv.as_int = 0; - x->e_mbd.mode_info_context->mbmi.uv_mode = DC_PRED; - x->e_mbd.mode_info_context->mbmi.mb_skip_coeff = - (cpi->common.mb_no_coeff_skip); - x->e_mbd.mode_info_context->mbmi.partitioning = 0; - return; - } - - - /* macroblock modes */ - vpx_memcpy(&x->e_mbd.mode_info_context->mbmi, &best_mode.mbmode, sizeof(MB_MODE_INFO)); - - if (best_mode.mbmode.mode == B_PRED) - { - for (i = 0; i < 16; i++) - xd->mode_info_context->bmi[i].as_mode = best_mode.bmodes[i].as_mode; - } - - if (best_mode.mbmode.mode == SPLITMV) - { - for (i = 0; i < 16; i++) - xd->mode_info_context->bmi[i].mv.as_int = best_mode.bmodes[i].mv.as_int; - - vpx_memcpy(x->partition_info, &best_mode.partition, sizeof(PARTITION_INFO)); - - x->e_mbd.mode_info_context->mbmi.mv.as_int = - x->partition_info->bmi[15].mv.as_int; - } - - if (sign_bias - != cpi->common.ref_frame_sign_bias[xd->mode_info_context->mbmi.ref_frame]) - best_ref_mv.as_int = best_ref_mv_sb[!sign_bias].as_int; - - rd_update_mvcount(x, &best_ref_mv); -} - -void vp8_rd_pick_intra_mode(MACROBLOCK *x, int *rate_) -{ - int error4x4, error16x16; - int rate4x4, rate16x16 = 0, rateuv; - int dist4x4, dist16x16, distuv; - int rate; - int rate4x4_tokenonly = 0; - int rate16x16_tokenonly = 0; - int rateuv_tokenonly = 0; - - x->e_mbd.mode_info_context->mbmi.ref_frame = INTRA_FRAME; - - rd_pick_intra_mbuv_mode(x, &rateuv, &rateuv_tokenonly, &distuv); - rate = rateuv; - - error16x16 = rd_pick_intra16x16mby_mode(x, &rate16x16, &rate16x16_tokenonly, - &dist16x16); - - error4x4 = rd_pick_intra4x4mby_modes(x, &rate4x4, &rate4x4_tokenonly, - &dist4x4, error16x16); - - if (error4x4 < error16x16) - { - x->e_mbd.mode_info_context->mbmi.mode = B_PRED; - rate += rate4x4; - } - else - { - rate += rate16x16; - } - - *rate_ = rate; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/rdopt.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/rdopt.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/rdopt.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/rdopt.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,144 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_ENCODER_RDOPT_H_ -#define VP8_ENCODER_RDOPT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#define RDCOST(RM,DM,R,D) ( ((128+(R)*(RM)) >> 8) + (DM)*(D) ) - -static void insertsortmv(int arr[], int len) -{ - int i, j, k; - - for ( i = 1 ; i <= len-1 ; i++ ) - { - for ( j = 0 ; j < i ; j++ ) - { - if ( arr[j] > arr[i] ) - { - int temp; - - temp = arr[i]; - - for ( k = i; k >j; k--) - arr[k] = arr[k - 1] ; - - arr[j] = temp ; - } - } - } -} - -static void insertsortsad(int arr[],int idx[], int len) -{ - int i, j, k; - - for ( i = 1 ; i <= len-1 ; i++ ) - { - for ( j = 0 ; j < i ; j++ ) - { - if ( arr[j] > arr[i] ) - { - int temp, tempi; - - temp = arr[i]; - tempi = idx[i]; - - for ( k = i; k >j; k--) - { - arr[k] = arr[k - 1] ; - idx[k] = idx[k - 1]; - } - - arr[j] = temp ; - idx[j] = tempi; - } - } - } -} - -extern void vp8_initialize_rd_consts(VP8_COMP *cpi, MACROBLOCK *x, int Qvalue); -extern void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, - int recon_yoffset, int recon_uvoffset, - int *returnrate, int *returndistortion, - int *returnintra, int mb_row, int mb_col); -extern void vp8_rd_pick_intra_mode(MACROBLOCK *x, int *rate); - - -static void get_plane_pointers(const YV12_BUFFER_CONFIG *fb, - unsigned char *plane[3], - unsigned int recon_yoffset, - unsigned int recon_uvoffset) -{ - plane[0] = fb->y_buffer + recon_yoffset; - plane[1] = fb->u_buffer + recon_uvoffset; - plane[2] = fb->v_buffer + recon_uvoffset; -} - - -static void get_predictor_pointers(const VP8_COMP *cpi, - unsigned char *plane[4][3], - unsigned int recon_yoffset, - unsigned int recon_uvoffset) -{ - if (cpi->ref_frame_flags & VP8_LAST_FRAME) - get_plane_pointers(&cpi->common.yv12_fb[cpi->common.lst_fb_idx], - plane[LAST_FRAME], recon_yoffset, recon_uvoffset); - - if (cpi->ref_frame_flags & VP8_GOLD_FRAME) - get_plane_pointers(&cpi->common.yv12_fb[cpi->common.gld_fb_idx], - plane[GOLDEN_FRAME], recon_yoffset, recon_uvoffset); - - if (cpi->ref_frame_flags & VP8_ALTR_FRAME) - get_plane_pointers(&cpi->common.yv12_fb[cpi->common.alt_fb_idx], - plane[ALTREF_FRAME], recon_yoffset, recon_uvoffset); -} - - -static void get_reference_search_order(const VP8_COMP *cpi, - int ref_frame_map[4]) -{ - int i=0; - - ref_frame_map[i++] = INTRA_FRAME; - if (cpi->ref_frame_flags & VP8_LAST_FRAME) - ref_frame_map[i++] = LAST_FRAME; - if (cpi->ref_frame_flags & VP8_GOLD_FRAME) - ref_frame_map[i++] = GOLDEN_FRAME; - if (cpi->ref_frame_flags & VP8_ALTR_FRAME) - ref_frame_map[i++] = ALTREF_FRAME; - for(; i<4; i++) - ref_frame_map[i] = -1; -} - - -extern void vp8_mv_pred -( - VP8_COMP *cpi, - MACROBLOCKD *xd, - const MODE_INFO *here, - int_mv *mvp, - int refframe, - int *ref_frame_sign_bias, - int *sr, - int near_sadidx[] -); -void vp8_cal_sad(VP8_COMP *cpi, MACROBLOCKD *xd, MACROBLOCK *x, int recon_yoffset, int near_sadidx[]); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_RDOPT_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/segmentation.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/segmentation.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/segmentation.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/segmentation.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "segmentation.h" -#include "vpx_mem/vpx_mem.h" - -void vp8_update_gf_useage_maps(VP8_COMP *cpi, VP8_COMMON *cm, MACROBLOCK *x) -{ - int mb_row, mb_col; - - MODE_INFO *this_mb_mode_info = cm->mi; - - x->gf_active_ptr = (signed char *)cpi->gf_active_flags; - - if ((cm->frame_type == KEY_FRAME) || (cm->refresh_golden_frame)) - { - /* Reset Gf useage monitors */ - vpx_memset(cpi->gf_active_flags, 1, (cm->mb_rows * cm->mb_cols)); - cpi->gf_active_count = cm->mb_rows * cm->mb_cols; - } - else - { - /* for each macroblock row in image */ - for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) - { - /* for each macroblock col in image */ - for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) - { - - /* If using golden then set GF active flag if not already set. - * If using last frame 0,0 mode then leave flag as it is - * else if using non 0,0 motion or intra modes then clear - * flag if it is currently set - */ - if ((this_mb_mode_info->mbmi.ref_frame == GOLDEN_FRAME) || (this_mb_mode_info->mbmi.ref_frame == ALTREF_FRAME)) - { - if (*(x->gf_active_ptr) == 0) - { - *(x->gf_active_ptr) = 1; - cpi->gf_active_count ++; - } - } - else if ((this_mb_mode_info->mbmi.mode != ZEROMV) && *(x->gf_active_ptr)) - { - *(x->gf_active_ptr) = 0; - cpi->gf_active_count--; - } - - x->gf_active_ptr++; /* Step onto next entry */ - this_mb_mode_info++; /* skip to next mb */ - - } - - /* this is to account for the border */ - this_mb_mode_info++; - } - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/segmentation.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/segmentation.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/segmentation.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/segmentation.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP8_ENCODER_SEGMENTATION_H_ -#define VP8_ENCODER_SEGMENTATION_H_ - -#include "string.h" -#include "vp8/common/blockd.h" -#include "onyx_int.h" - -#ifdef __cplusplus -extern "C" { -#endif - -extern void vp8_update_gf_useage_maps(VP8_COMP *cpi, VP8_COMMON *cm, MACROBLOCK *x); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_SEGMENTATION_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/ssim.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/ssim.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/ssim.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/ssim.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,233 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "onyx_int.h" - -void vp8_ssim_parms_16x16_c -( - unsigned char *s, - int sp, - unsigned char *r, - int rp, - unsigned long *sum_s, - unsigned long *sum_r, - unsigned long *sum_sq_s, - unsigned long *sum_sq_r, - unsigned long *sum_sxr -) -{ - int i,j; - for(i=0;i<16;i++,s+=sp,r+=rp) - { - for(j=0;j<16;j++) - { - *sum_s += s[j]; - *sum_r += r[j]; - *sum_sq_s += s[j] * s[j]; - *sum_sq_r += r[j] * r[j]; - *sum_sxr += s[j] * r[j]; - } - } -} -void vp8_ssim_parms_8x8_c -( - unsigned char *s, - int sp, - unsigned char *r, - int rp, - unsigned long *sum_s, - unsigned long *sum_r, - unsigned long *sum_sq_s, - unsigned long *sum_sq_r, - unsigned long *sum_sxr -) -{ - int i,j; - for(i=0;i<8;i++,s+=sp,r+=rp) - { - for(j=0;j<8;j++) - { - *sum_s += s[j]; - *sum_r += r[j]; - *sum_sq_s += s[j] * s[j]; - *sum_sq_r += r[j] * r[j]; - *sum_sxr += s[j] * r[j]; - } - } -} - -const static int64_t cc1 = 26634; // (64^2*(.01*255)^2 -const static int64_t cc2 = 239708; // (64^2*(.03*255)^2 - -static double similarity -( - unsigned long sum_s, - unsigned long sum_r, - unsigned long sum_sq_s, - unsigned long sum_sq_r, - unsigned long sum_sxr, - int count -) -{ - int64_t ssim_n, ssim_d; - int64_t c1, c2; - - //scale the constants by number of pixels - c1 = (cc1*count*count)>>12; - c2 = (cc2*count*count)>>12; - - ssim_n = (2*sum_s*sum_r+ c1)*((int64_t) 2*count*sum_sxr- - (int64_t) 2*sum_s*sum_r+c2); - - ssim_d = (sum_s*sum_s +sum_r*sum_r+c1)* - ((int64_t)count*sum_sq_s-(int64_t)sum_s*sum_s + - (int64_t)count*sum_sq_r-(int64_t) sum_r*sum_r +c2) ; - - return ssim_n * 1.0 / ssim_d; -} - -static double ssim_16x16(unsigned char *s,int sp, unsigned char *r,int rp) -{ - unsigned long sum_s=0,sum_r=0,sum_sq_s=0,sum_sq_r=0,sum_sxr=0; - vp8_ssim_parms_16x16(s, sp, r, rp, &sum_s, &sum_r, &sum_sq_s, &sum_sq_r, &sum_sxr); - return similarity(sum_s, sum_r, sum_sq_s, sum_sq_r, sum_sxr, 256); -} -static double ssim_8x8(unsigned char *s,int sp, unsigned char *r,int rp) -{ - unsigned long sum_s=0,sum_r=0,sum_sq_s=0,sum_sq_r=0,sum_sxr=0; - vp8_ssim_parms_8x8(s, sp, r, rp, &sum_s, &sum_r, &sum_sq_s, &sum_sq_r, &sum_sxr); - return similarity(sum_s, sum_r, sum_sq_s, sum_sq_r, sum_sxr, 64); -} - -// TODO: (jbb) tried to scale this function such that we may be able to use it -// for distortion metric in mode selection code ( provided we do a reconstruction) -long dssim(unsigned char *s,int sp, unsigned char *r,int rp) -{ - unsigned long sum_s=0,sum_r=0,sum_sq_s=0,sum_sq_r=0,sum_sxr=0; - int64_t ssim3; - int64_t ssim_n1,ssim_n2; - int64_t ssim_d1,ssim_d2; - int64_t ssim_t1,ssim_t2; - int64_t c1, c2; - - // normalize by 256/64 - c1 = cc1*16; - c2 = cc2*16; - - vp8_ssim_parms_16x16(s, sp, r, rp, &sum_s, &sum_r, &sum_sq_s, &sum_sq_r, &sum_sxr); - ssim_n1 = (2*sum_s*sum_r+ c1); - - ssim_n2 =((int64_t) 2*256*sum_sxr-(int64_t) 2*sum_s*sum_r+c2); - - ssim_d1 =((int64_t)sum_s*sum_s +(int64_t)sum_r*sum_r+c1); - - ssim_d2 = (256 * (int64_t) sum_sq_s-(int64_t) sum_s*sum_s + - (int64_t) 256*sum_sq_r-(int64_t) sum_r*sum_r +c2) ; - - ssim_t1 = 256 - 256 * ssim_n1 / ssim_d1; - ssim_t2 = 256 - 256 * ssim_n2 / ssim_d2; - - ssim3 = 256 *ssim_t1 * ssim_t2; - if(ssim3 <0 ) - ssim3=0; - return (long)( ssim3 ); -} - -// We are using a 8x8 moving window with starting location of each 8x8 window -// on the 4x4 pixel grid. Such arrangement allows the windows to overlap -// block boundaries to penalize blocking artifacts. -double vp8_ssim2 -( - unsigned char *img1, - unsigned char *img2, - int stride_img1, - int stride_img2, - int width, - int height -) -{ - int i,j; - int samples =0; - double ssim_total=0; - - // sample point start with each 4x4 location - for(i=0; i < height-8; i+=4, img1 += stride_img1*4, img2 += stride_img2*4) - { - for(j=0; j < width-8; j+=4 ) - { - double v = ssim_8x8(img1+j, stride_img1, img2+j, stride_img2); - ssim_total += v; - samples++; - } - } - ssim_total /= samples; - return ssim_total; -} -double vp8_calc_ssim -( - YV12_BUFFER_CONFIG *source, - YV12_BUFFER_CONFIG *dest, - int lumamask, - double *weight -) -{ - double a, b, c; - double ssimv; - - a = vp8_ssim2(source->y_buffer, dest->y_buffer, - source->y_stride, dest->y_stride, source->y_width, - source->y_height); - - b = vp8_ssim2(source->u_buffer, dest->u_buffer, - source->uv_stride, dest->uv_stride, source->uv_width, - source->uv_height); - - c = vp8_ssim2(source->v_buffer, dest->v_buffer, - source->uv_stride, dest->uv_stride, source->uv_width, - source->uv_height); - - ssimv = a * .8 + .1 * (b + c); - - *weight = 1; - - return ssimv; -} - -double vp8_calc_ssimg -( - YV12_BUFFER_CONFIG *source, - YV12_BUFFER_CONFIG *dest, - double *ssim_y, - double *ssim_u, - double *ssim_v -) -{ - double ssim_all = 0; - double a, b, c; - - a = vp8_ssim2(source->y_buffer, dest->y_buffer, - source->y_stride, dest->y_stride, source->y_width, - source->y_height); - - b = vp8_ssim2(source->u_buffer, dest->u_buffer, - source->uv_stride, dest->uv_stride, source->uv_width, - source->uv_height); - - c = vp8_ssim2(source->v_buffer, dest->v_buffer, - source->uv_stride, dest->uv_stride, source->uv_width, - source->uv_height); - *ssim_y = a; - *ssim_u = b; - *ssim_v = c; - ssim_all = (a * 4 + b + c) /6; - - return ssim_all; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/temporal_filter.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/temporal_filter.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/temporal_filter.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/temporal_filter.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,521 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vp8/common/onyxc_int.h" -#include "onyx_int.h" -#include "vp8/common/systemdependent.h" -#include "quantize.h" -#include "vp8/common/alloccommon.h" -#include "mcomp.h" -#include "firstpass.h" -#include "vpx_scale/vpx_scale.h" -#include "vp8/common/extend.h" -#include "ratectrl.h" -#include "vp8/common/quant_common.h" -#include "segmentation.h" -#include "vpx_mem/vpx_mem.h" -#include "vp8/common/swapyv12buffer.h" -#include "vp8/common/threading.h" -#include "vpx_ports/vpx_timer.h" - -#include -#include - -#define ALT_REF_MC_ENABLED 1 /* dis/enable MC in AltRef filtering */ -#define ALT_REF_SUBPEL_ENABLED 1 /* dis/enable subpel in MC AltRef filtering */ - -#if VP8_TEMPORAL_ALT_REF - -static void vp8_temporal_filter_predictors_mb_c -( - MACROBLOCKD *x, - unsigned char *y_mb_ptr, - unsigned char *u_mb_ptr, - unsigned char *v_mb_ptr, - int stride, - int mv_row, - int mv_col, - unsigned char *pred -) -{ - int offset; - unsigned char *yptr, *uptr, *vptr; - - /* Y */ - yptr = y_mb_ptr + (mv_row >> 3) * stride + (mv_col >> 3); - - if ((mv_row | mv_col) & 7) - { - x->subpixel_predict16x16(yptr, stride, - mv_col & 7, mv_row & 7, &pred[0], 16); - } - else - { - vp8_copy_mem16x16(yptr, stride, &pred[0], 16); - } - - /* U & V */ - mv_row >>= 1; - mv_col >>= 1; - stride = (stride + 1) >> 1; - offset = (mv_row >> 3) * stride + (mv_col >> 3); - uptr = u_mb_ptr + offset; - vptr = v_mb_ptr + offset; - - if ((mv_row | mv_col) & 7) - { - x->subpixel_predict8x8(uptr, stride, - mv_col & 7, mv_row & 7, &pred[256], 8); - x->subpixel_predict8x8(vptr, stride, - mv_col & 7, mv_row & 7, &pred[320], 8); - } - else - { - vp8_copy_mem8x8(uptr, stride, &pred[256], 8); - vp8_copy_mem8x8(vptr, stride, &pred[320], 8); - } -} -void vp8_temporal_filter_apply_c -( - unsigned char *frame1, - unsigned int stride, - unsigned char *frame2, - unsigned int block_size, - int strength, - int filter_weight, - unsigned int *accumulator, - unsigned short *count -) -{ - unsigned int i, j, k; - int modifier; - int byte = 0; - const int rounding = strength > 0 ? 1 << (strength - 1) : 0; - - for (i = 0,k = 0; i < block_size; i++) - { - for (j = 0; j < block_size; j++, k++) - { - - int src_byte = frame1[byte]; - int pixel_value = *frame2++; - - modifier = src_byte - pixel_value; - /* This is an integer approximation of: - * float coeff = (3.0 * modifer * modifier) / pow(2, strength); - * modifier = (int)roundf(coeff > 16 ? 0 : 16-coeff); - */ - modifier *= modifier; - modifier *= 3; - modifier += rounding; - modifier >>= strength; - - if (modifier > 16) - modifier = 16; - - modifier = 16 - modifier; - modifier *= filter_weight; - - count[k] += modifier; - accumulator[k] += modifier * pixel_value; - - byte++; - } - - byte += stride - block_size; - } -} - -#if ALT_REF_MC_ENABLED - -static int vp8_temporal_filter_find_matching_mb_c -( - VP8_COMP *cpi, - YV12_BUFFER_CONFIG *arf_frame, - YV12_BUFFER_CONFIG *frame_ptr, - int mb_offset, - int error_thresh -) -{ - MACROBLOCK *x = &cpi->mb; - int step_param; - int sadpb = x->sadperbit16; - int bestsme = INT_MAX; - - BLOCK *b = &x->block[0]; - BLOCKD *d = &x->e_mbd.block[0]; - int_mv best_ref_mv1; - int_mv best_ref_mv1_full; /* full-pixel value of best_ref_mv1 */ - - /* Save input state */ - unsigned char **base_src = b->base_src; - int src = b->src; - int src_stride = b->src_stride; - unsigned char *base_pre = x->e_mbd.pre.y_buffer; - int pre = d->offset; - int pre_stride = x->e_mbd.pre.y_stride; - - (void)error_thresh; - - best_ref_mv1.as_int = 0; - best_ref_mv1_full.as_mv.col = best_ref_mv1.as_mv.col >>3; - best_ref_mv1_full.as_mv.row = best_ref_mv1.as_mv.row >>3; - - /* Setup frame pointers */ - b->base_src = &arf_frame->y_buffer; - b->src_stride = arf_frame->y_stride; - b->src = mb_offset; - - x->e_mbd.pre.y_buffer = frame_ptr->y_buffer; - x->e_mbd.pre.y_stride = frame_ptr->y_stride; - d->offset = mb_offset; - - /* Further step/diamond searches as necessary */ - if (cpi->Speed < 8) - { - step_param = cpi->sf.first_step + (cpi->Speed > 5); - } - else - { - step_param = cpi->sf.first_step + 2; - } - - /* TODO Check that the 16x16 vf & sdf are selected here */ - /* Ignore mv costing by sending NULL cost arrays */ - bestsme = vp8_hex_search(x, b, d, &best_ref_mv1_full, &d->bmi.mv, - step_param, sadpb, - &cpi->fn_ptr[BLOCK_16X16], - NULL, NULL, &best_ref_mv1); - -#if ALT_REF_SUBPEL_ENABLED - /* Try sub-pixel MC? */ - { - int distortion; - unsigned int sse; - /* Ignore mv costing by sending NULL cost array */ - bestsme = cpi->find_fractional_mv_step(x, b, d, - &d->bmi.mv, - &best_ref_mv1, - x->errorperbit, - &cpi->fn_ptr[BLOCK_16X16], - NULL, &distortion, &sse); - } -#endif - - /* Save input state */ - b->base_src = base_src; - b->src = src; - b->src_stride = src_stride; - x->e_mbd.pre.y_buffer = base_pre; - d->offset = pre; - x->e_mbd.pre.y_stride = pre_stride; - - return bestsme; -} -#endif - -static void vp8_temporal_filter_iterate_c -( - VP8_COMP *cpi, - int frame_count, - int alt_ref_index, - int strength -) -{ - int byte; - int frame; - int mb_col, mb_row; - unsigned int filter_weight; - int mb_cols = cpi->common.mb_cols; - int mb_rows = cpi->common.mb_rows; - int mb_y_offset = 0; - int mb_uv_offset = 0; - DECLARE_ALIGNED_ARRAY(16, unsigned int, accumulator, 16*16 + 8*8 + 8*8); - DECLARE_ALIGNED_ARRAY(16, unsigned short, count, 16*16 + 8*8 + 8*8); - MACROBLOCKD *mbd = &cpi->mb.e_mbd; - YV12_BUFFER_CONFIG *f = cpi->frames[alt_ref_index]; - unsigned char *dst1, *dst2; - DECLARE_ALIGNED_ARRAY(16, unsigned char, predictor, 16*16 + 8*8 + 8*8); - - /* Save input state */ - unsigned char *y_buffer = mbd->pre.y_buffer; - unsigned char *u_buffer = mbd->pre.u_buffer; - unsigned char *v_buffer = mbd->pre.v_buffer; - - for (mb_row = 0; mb_row < mb_rows; mb_row++) - { -#if ALT_REF_MC_ENABLED - /* Source frames are extended to 16 pixels. This is different than - * L/A/G reference frames that have a border of 32 (VP8BORDERINPIXELS) - * A 6 tap filter is used for motion search. This requires 2 pixels - * before and 3 pixels after. So the largest Y mv on a border would - * then be 16 - 3. The UV blocks are half the size of the Y and - * therefore only extended by 8. The largest mv that a UV block - * can support is 8 - 3. A UV mv is half of a Y mv. - * (16 - 3) >> 1 == 6 which is greater than 8 - 3. - * To keep the mv in play for both Y and UV planes the max that it - * can be on a border is therefore 16 - 5. - */ - cpi->mb.mv_row_min = -((mb_row * 16) + (16 - 5)); - cpi->mb.mv_row_max = ((cpi->common.mb_rows - 1 - mb_row) * 16) - + (16 - 5); -#endif - - for (mb_col = 0; mb_col < mb_cols; mb_col++) - { - int i, j, k; - int stride; - - vpx_memset(accumulator, 0, 384*sizeof(unsigned int)); - vpx_memset(count, 0, 384*sizeof(unsigned short)); - -#if ALT_REF_MC_ENABLED - cpi->mb.mv_col_min = -((mb_col * 16) + (16 - 5)); - cpi->mb.mv_col_max = ((cpi->common.mb_cols - 1 - mb_col) * 16) - + (16 - 5); -#endif - - for (frame = 0; frame < frame_count; frame++) - { - if (cpi->frames[frame] == NULL) - continue; - - mbd->block[0].bmi.mv.as_mv.row = 0; - mbd->block[0].bmi.mv.as_mv.col = 0; - - if (frame == alt_ref_index) - { - filter_weight = 2; - } - else - { - int err = 0; -#if ALT_REF_MC_ENABLED -#define THRESH_LOW 10000 -#define THRESH_HIGH 20000 - /* Find best match in this frame by MC */ - err = vp8_temporal_filter_find_matching_mb_c - (cpi, - cpi->frames[alt_ref_index], - cpi->frames[frame], - mb_y_offset, - THRESH_LOW); -#endif - /* Assign higher weight to matching MB if it's error - * score is lower. If not applying MC default behavior - * is to weight all MBs equal. - */ - filter_weight = errframes[frame]->y_buffer + mb_y_offset, - cpi->frames[frame]->u_buffer + mb_uv_offset, - cpi->frames[frame]->v_buffer + mb_uv_offset, - cpi->frames[frame]->y_stride, - mbd->block[0].bmi.mv.as_mv.row, - mbd->block[0].bmi.mv.as_mv.col, - predictor); - - /* Apply the filter (YUV) */ - vp8_temporal_filter_apply - (f->y_buffer + mb_y_offset, - f->y_stride, - predictor, - 16, - strength, - filter_weight, - accumulator, - count); - - vp8_temporal_filter_apply - (f->u_buffer + mb_uv_offset, - f->uv_stride, - predictor + 256, - 8, - strength, - filter_weight, - accumulator + 256, - count + 256); - - vp8_temporal_filter_apply - (f->v_buffer + mb_uv_offset, - f->uv_stride, - predictor + 320, - 8, - strength, - filter_weight, - accumulator + 320, - count + 320); - } - } - - /* Normalize filter output to produce AltRef frame */ - dst1 = cpi->alt_ref_buffer.y_buffer; - stride = cpi->alt_ref_buffer.y_stride; - byte = mb_y_offset; - for (i = 0,k = 0; i < 16; i++) - { - for (j = 0; j < 16; j++, k++) - { - unsigned int pval = accumulator[k] + (count[k] >> 1); - pval *= cpi->fixed_divide[count[k]]; - pval >>= 19; - - dst1[byte] = (unsigned char)pval; - - /* move to next pixel */ - byte++; - } - - byte += stride - 16; - } - - dst1 = cpi->alt_ref_buffer.u_buffer; - dst2 = cpi->alt_ref_buffer.v_buffer; - stride = cpi->alt_ref_buffer.uv_stride; - byte = mb_uv_offset; - for (i = 0,k = 256; i < 8; i++) - { - for (j = 0; j < 8; j++, k++) - { - int m=k+64; - - /* U */ - unsigned int pval = accumulator[k] + (count[k] >> 1); - pval *= cpi->fixed_divide[count[k]]; - pval >>= 19; - dst1[byte] = (unsigned char)pval; - - /* V */ - pval = accumulator[m] + (count[m] >> 1); - pval *= cpi->fixed_divide[count[m]]; - pval >>= 19; - dst2[byte] = (unsigned char)pval; - - /* move to next pixel */ - byte++; - } - - byte += stride - 8; - } - - mb_y_offset += 16; - mb_uv_offset += 8; - } - - mb_y_offset += 16*(f->y_stride-mb_cols); - mb_uv_offset += 8*(f->uv_stride-mb_cols); - } - - /* Restore input state */ - mbd->pre.y_buffer = y_buffer; - mbd->pre.u_buffer = u_buffer; - mbd->pre.v_buffer = v_buffer; -} - -void vp8_temporal_filter_prepare_c -( - VP8_COMP *cpi, - int distance -) -{ - int frame = 0; - - int num_frames_backward = 0; - int num_frames_forward = 0; - int frames_to_blur_backward = 0; - int frames_to_blur_forward = 0; - int frames_to_blur = 0; - int start_frame = 0; - - int strength = cpi->oxcf.arnr_strength; - - int blur_type = cpi->oxcf.arnr_type; - - int max_frames = cpi->active_arnr_frames; - - num_frames_backward = distance; - num_frames_forward = vp8_lookahead_depth(cpi->lookahead) - - (num_frames_backward + 1); - - switch (blur_type) - { - case 1: - /* Backward Blur */ - - frames_to_blur_backward = num_frames_backward; - - if (frames_to_blur_backward >= max_frames) - frames_to_blur_backward = max_frames - 1; - - frames_to_blur = frames_to_blur_backward + 1; - break; - - case 2: - /* Forward Blur */ - - frames_to_blur_forward = num_frames_forward; - - if (frames_to_blur_forward >= max_frames) - frames_to_blur_forward = max_frames - 1; - - frames_to_blur = frames_to_blur_forward + 1; - break; - - case 3: - default: - /* Center Blur */ - frames_to_blur_forward = num_frames_forward; - frames_to_blur_backward = num_frames_backward; - - if (frames_to_blur_forward > frames_to_blur_backward) - frames_to_blur_forward = frames_to_blur_backward; - - if (frames_to_blur_backward > frames_to_blur_forward) - frames_to_blur_backward = frames_to_blur_forward; - - /* When max_frames is even we have 1 more frame backward than forward */ - if (frames_to_blur_forward > (max_frames - 1) / 2) - frames_to_blur_forward = ((max_frames - 1) / 2); - - if (frames_to_blur_backward > (max_frames / 2)) - frames_to_blur_backward = (max_frames / 2); - - frames_to_blur = frames_to_blur_backward + frames_to_blur_forward + 1; - break; - } - - start_frame = distance + frames_to_blur_forward; - - /* Setup frame pointers, NULL indicates frame not included in filter */ - vpx_memset(cpi->frames, 0, max_frames*sizeof(YV12_BUFFER_CONFIG *)); - for (frame = 0; frame < frames_to_blur; frame++) - { - int which_buffer = start_frame - frame; - struct lookahead_entry* buf = vp8_lookahead_peek(cpi->lookahead, - which_buffer, - PEEK_FORWARD); - cpi->frames[frames_to_blur-1-frame] = &buf->img; - } - - vp8_temporal_filter_iterate_c ( - cpi, - frames_to_blur, - frames_to_blur_backward, - strength ); -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/tokenize.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/tokenize.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/tokenize.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/tokenize.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,608 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include -#include -#include -#include -#include "onyx_int.h" -#include "tokenize.h" -#include "vpx_mem/vpx_mem.h" - -/* Global event counters used for accumulating statistics across several - compressions, then generating context.c = initial stats. */ - -#ifdef VP8_ENTROPY_STATS -_int64 context_counters[BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS]; -#endif -void vp8_stuff_mb(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t) ; -void vp8_fix_contexts(MACROBLOCKD *x); - -#include "dct_value_tokens.h" -#include "dct_value_cost.h" - -const TOKENVALUE *const vp8_dct_value_tokens_ptr = dct_value_tokens + - DCT_MAX_VALUE; -const short *const vp8_dct_value_cost_ptr = dct_value_cost + DCT_MAX_VALUE; - -#if 0 -int skip_true_count = 0; -int skip_false_count = 0; -#endif - -/* function used to generate dct_value_tokens and dct_value_cost tables */ -/* -static void fill_value_tokens() -{ - - TOKENVALUE *t = dct_value_tokens + DCT_MAX_VALUE; - const vp8_extra_bit_struct *e = vp8_extra_bits; - - int i = -DCT_MAX_VALUE; - int sign = 1; - - do - { - if (!i) - sign = 0; - - { - const int a = sign ? -i : i; - int eb = sign; - - if (a > 4) - { - int j = 4; - - while (++j < 11 && e[j].base_val <= a) {} - - t[i].Token = --j; - eb |= (a - e[j].base_val) << 1; - } - else - t[i].Token = a; - - t[i].Extra = eb; - } - - // initialize the cost for extra bits for all possible coefficient value. - { - int cost = 0; - const vp8_extra_bit_struct *p = vp8_extra_bits + t[i].Token; - - if (p->base_val) - { - const int extra = t[i].Extra; - const int Length = p->Len; - - if (Length) - cost += vp8_treed_cost(p->tree, p->prob, extra >> 1, Length); - - cost += vp8_cost_bit(vp8_prob_half, extra & 1); // sign - dct_value_cost[i + DCT_MAX_VALUE] = cost; - } - - } - - } - while (++i < DCT_MAX_VALUE); - - vp8_dct_value_tokens_ptr = dct_value_tokens + DCT_MAX_VALUE; - vp8_dct_value_cost_ptr = dct_value_cost + DCT_MAX_VALUE; -} -*/ - -static void tokenize2nd_order_b -( - MACROBLOCK *x, - TOKENEXTRA **tp, - VP8_COMP *cpi -) -{ - MACROBLOCKD *xd = &x->e_mbd; - int pt; /* near block/prev token context index */ - int c; /* start at DC */ - TOKENEXTRA *t = *tp;/* store tokens starting here */ - const BLOCKD *b; - const short *qcoeff_ptr; - ENTROPY_CONTEXT * a; - ENTROPY_CONTEXT * l; - int band, rc, v, token; - int eob; - - b = xd->block + 24; - qcoeff_ptr = b->qcoeff; - a = (ENTROPY_CONTEXT *)xd->above_context + 8; - l = (ENTROPY_CONTEXT *)xd->left_context + 8; - eob = xd->eobs[24]; - VP8_COMBINEENTROPYCONTEXTS(pt, *a, *l); - - if(!eob) - { - /* c = band for this case */ - t->Token = DCT_EOB_TOKEN; - t->context_tree = cpi->common.fc.coef_probs [1] [0] [pt]; - t->skip_eob_node = 0; - - ++x->coef_counts [1] [0] [pt] [DCT_EOB_TOKEN]; - t++; - *tp = t; - *a = *l = 0; - return; - } - - v = qcoeff_ptr[0]; - t->Extra = vp8_dct_value_tokens_ptr[v].Extra; - token = vp8_dct_value_tokens_ptr[v].Token; - t->Token = token; - - t->context_tree = cpi->common.fc.coef_probs [1] [0] [pt]; - t->skip_eob_node = 0; - ++x->coef_counts [1] [0] [pt] [token]; - pt = vp8_prev_token_class[token]; - t++; - c = 1; - - for (; c < eob; c++) - { - rc = vp8_default_zig_zag1d[c]; - band = vp8_coef_bands[c]; - v = qcoeff_ptr[rc]; - - t->Extra = vp8_dct_value_tokens_ptr[v].Extra; - token = vp8_dct_value_tokens_ptr[v].Token; - - t->Token = token; - t->context_tree = cpi->common.fc.coef_probs [1] [band] [pt]; - - t->skip_eob_node = ((pt == 0)); - - ++x->coef_counts [1] [band] [pt] [token]; - - pt = vp8_prev_token_class[token]; - t++; - } - if (c < 16) - { - band = vp8_coef_bands[c]; - t->Token = DCT_EOB_TOKEN; - t->context_tree = cpi->common.fc.coef_probs [1] [band] [pt]; - - t->skip_eob_node = 0; - - ++x->coef_counts [1] [band] [pt] [DCT_EOB_TOKEN]; - - t++; - } - - *tp = t; - *a = *l = 1; - -} - -static void tokenize1st_order_b -( - MACROBLOCK *x, - TOKENEXTRA **tp, - int type, /* which plane: 0=Y no DC, 1=Y2, 2=UV, 3=Y with DC */ - VP8_COMP *cpi -) -{ - MACROBLOCKD *xd = &x->e_mbd; - unsigned int block; - const BLOCKD *b; - int pt; /* near block/prev token context index */ - int c; - int token; - TOKENEXTRA *t = *tp;/* store tokens starting here */ - const short *qcoeff_ptr; - ENTROPY_CONTEXT * a; - ENTROPY_CONTEXT * l; - int band, rc, v; - int tmp1, tmp2; - - b = xd->block; - /* Luma */ - for (block = 0; block < 16; block++, b++) - { - const int eob = *b->eob; - tmp1 = vp8_block2above[block]; - tmp2 = vp8_block2left[block]; - qcoeff_ptr = b->qcoeff; - a = (ENTROPY_CONTEXT *)xd->above_context + tmp1; - l = (ENTROPY_CONTEXT *)xd->left_context + tmp2; - - VP8_COMBINEENTROPYCONTEXTS(pt, *a, *l); - - c = type ? 0 : 1; - - if(c >= eob) - { - /* c = band for this case */ - t->Token = DCT_EOB_TOKEN; - t->context_tree = cpi->common.fc.coef_probs [type] [c] [pt]; - t->skip_eob_node = 0; - - ++x->coef_counts [type] [c] [pt] [DCT_EOB_TOKEN]; - t++; - *tp = t; - *a = *l = 0; - continue; - } - - v = qcoeff_ptr[c]; - - t->Extra = vp8_dct_value_tokens_ptr[v].Extra; - token = vp8_dct_value_tokens_ptr[v].Token; - t->Token = token; - - t->context_tree = cpi->common.fc.coef_probs [type] [c] [pt]; - t->skip_eob_node = 0; - ++x->coef_counts [type] [c] [pt] [token]; - pt = vp8_prev_token_class[token]; - t++; - c++; - - assert(eob <= 16); - for (; c < eob; c++) - { - rc = vp8_default_zig_zag1d[c]; - band = vp8_coef_bands[c]; - v = qcoeff_ptr[rc]; - - t->Extra = vp8_dct_value_tokens_ptr[v].Extra; - token = vp8_dct_value_tokens_ptr[v].Token; - - t->Token = token; - t->context_tree = cpi->common.fc.coef_probs [type] [band] [pt]; - - t->skip_eob_node = (pt == 0); - ++x->coef_counts [type] [band] [pt] [token]; - - pt = vp8_prev_token_class[token]; - t++; - } - if (c < 16) - { - band = vp8_coef_bands[c]; - t->Token = DCT_EOB_TOKEN; - t->context_tree = cpi->common.fc.coef_probs [type] [band] [pt]; - - t->skip_eob_node = 0; - ++x->coef_counts [type] [band] [pt] [DCT_EOB_TOKEN]; - - t++; - } - *tp = t; - *a = *l = 1; - } - - /* Chroma */ - for (block = 16; block < 24; block++, b++) - { - const int eob = *b->eob; - tmp1 = vp8_block2above[block]; - tmp2 = vp8_block2left[block]; - qcoeff_ptr = b->qcoeff; - a = (ENTROPY_CONTEXT *)xd->above_context + tmp1; - l = (ENTROPY_CONTEXT *)xd->left_context + tmp2; - - VP8_COMBINEENTROPYCONTEXTS(pt, *a, *l); - - if(!eob) - { - /* c = band for this case */ - t->Token = DCT_EOB_TOKEN; - t->context_tree = cpi->common.fc.coef_probs [2] [0] [pt]; - t->skip_eob_node = 0; - - ++x->coef_counts [2] [0] [pt] [DCT_EOB_TOKEN]; - t++; - *tp = t; - *a = *l = 0; - continue; - } - - v = qcoeff_ptr[0]; - - t->Extra = vp8_dct_value_tokens_ptr[v].Extra; - token = vp8_dct_value_tokens_ptr[v].Token; - t->Token = token; - - t->context_tree = cpi->common.fc.coef_probs [2] [0] [pt]; - t->skip_eob_node = 0; - ++x->coef_counts [2] [0] [pt] [token]; - pt = vp8_prev_token_class[token]; - t++; - c = 1; - - assert(eob <= 16); - for (; c < eob; c++) - { - rc = vp8_default_zig_zag1d[c]; - band = vp8_coef_bands[c]; - v = qcoeff_ptr[rc]; - - t->Extra = vp8_dct_value_tokens_ptr[v].Extra; - token = vp8_dct_value_tokens_ptr[v].Token; - - t->Token = token; - t->context_tree = cpi->common.fc.coef_probs [2] [band] [pt]; - - t->skip_eob_node = (pt == 0); - - ++x->coef_counts [2] [band] [pt] [token]; - - pt = vp8_prev_token_class[token]; - t++; - } - if (c < 16) - { - band = vp8_coef_bands[c]; - t->Token = DCT_EOB_TOKEN; - t->context_tree = cpi->common.fc.coef_probs [2] [band] [pt]; - - t->skip_eob_node = 0; - - ++x->coef_counts [2] [band] [pt] [DCT_EOB_TOKEN]; - - t++; - } - *tp = t; - *a = *l = 1; - } -} - - -static int mb_is_skippable(MACROBLOCKD *x, int has_y2_block) -{ - int skip = 1; - int i = 0; - - if (has_y2_block) - { - for (i = 0; i < 16; i++) - skip &= (x->eobs[i] < 2); - } - - for (; i < 24 + has_y2_block; i++) - skip &= (!x->eobs[i]); - - return skip; -} - - -void vp8_tokenize_mb(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t) -{ - MACROBLOCKD *xd = &x->e_mbd; - int plane_type; - int has_y2_block; - - has_y2_block = (xd->mode_info_context->mbmi.mode != B_PRED - && xd->mode_info_context->mbmi.mode != SPLITMV); - - xd->mode_info_context->mbmi.mb_skip_coeff = - mb_is_skippable(xd, has_y2_block); - if (xd->mode_info_context->mbmi.mb_skip_coeff) - { - if (!cpi->common.mb_no_coeff_skip) - { - vp8_stuff_mb(cpi, x, t); - } - else - { - vp8_fix_contexts(xd); - x->skip_true_count++; - } - - return; - } - - plane_type = 3; - if(has_y2_block) - { - tokenize2nd_order_b(x, t, cpi); - plane_type = 0; - } - - tokenize1st_order_b(x, t, plane_type, cpi); -} - - -#ifdef VP8_ENTROPY_STATS - -void init_context_counters(void) -{ - vpx_memset(context_counters, 0, sizeof(context_counters)); -} - -void print_context_counters() -{ - - int type, band, pt, t; - - FILE *const f = fopen("context.c", "w"); - - fprintf(f, "#include \"entropy.h\"\n"); - - fprintf(f, "\n/* *** GENERATED FILE: DO NOT EDIT *** */\n\n"); - - fprintf(f, "int Contexts[BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS];\n\n"); - - fprintf(f, "const int default_contexts[BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS] = {"); - -# define Comma( X) (X? ",":"") - - type = 0; - - do - { - fprintf(f, "%s\n { /* block Type %d */", Comma(type), type); - - band = 0; - - do - { - fprintf(f, "%s\n { /* Coeff Band %d */", Comma(band), band); - - pt = 0; - - do - { - fprintf(f, "%s\n {", Comma(pt)); - - t = 0; - - do - { - const _int64 x = context_counters [type] [band] [pt] [t]; - const int y = (int) x; - - assert(x == (_int64) y); /* no overflow handling yet */ - fprintf(f, "%s %d", Comma(t), y); - - } - while (++t < MAX_ENTROPY_TOKENS); - - fprintf(f, "}"); - } - while (++pt < PREV_COEF_CONTEXTS); - - fprintf(f, "\n }"); - - } - while (++band < COEF_BANDS); - - fprintf(f, "\n }"); - } - while (++type < BLOCK_TYPES); - - fprintf(f, "\n};\n"); - fclose(f); -} -#endif - - -static void stuff2nd_order_b -( - TOKENEXTRA **tp, - ENTROPY_CONTEXT *a, - ENTROPY_CONTEXT *l, - VP8_COMP *cpi, - MACROBLOCK *x -) -{ - int pt; /* near block/prev token context index */ - TOKENEXTRA *t = *tp; /* store tokens starting here */ - VP8_COMBINEENTROPYCONTEXTS(pt, *a, *l); - - t->Token = DCT_EOB_TOKEN; - t->context_tree = cpi->common.fc.coef_probs [1] [0] [pt]; - t->skip_eob_node = 0; - ++x->coef_counts [1] [0] [pt] [DCT_EOB_TOKEN]; - ++t; - - *tp = t; - pt = 0; - *a = *l = pt; -} - -static void stuff1st_order_b -( - TOKENEXTRA **tp, - ENTROPY_CONTEXT *a, - ENTROPY_CONTEXT *l, - int type, - VP8_COMP *cpi, - MACROBLOCK *x -) -{ - int pt; /* near block/prev token context index */ - int band; - TOKENEXTRA *t = *tp; /* store tokens starting here */ - VP8_COMBINEENTROPYCONTEXTS(pt, *a, *l); - band = type ? 0 : 1; - t->Token = DCT_EOB_TOKEN; - t->context_tree = cpi->common.fc.coef_probs [type] [band] [pt]; - t->skip_eob_node = 0; - ++x->coef_counts [type] [band] [pt] [DCT_EOB_TOKEN]; - ++t; - *tp = t; - pt = 0; /* 0 <-> all coeff data is zero */ - *a = *l = pt; -} - -static -void stuff1st_order_buv -( - TOKENEXTRA **tp, - ENTROPY_CONTEXT *a, - ENTROPY_CONTEXT *l, - VP8_COMP *cpi, - MACROBLOCK *x -) -{ - int pt; /* near block/prev token context index */ - TOKENEXTRA *t = *tp; /* store tokens starting here */ - VP8_COMBINEENTROPYCONTEXTS(pt, *a, *l); - - t->Token = DCT_EOB_TOKEN; - t->context_tree = cpi->common.fc.coef_probs [2] [0] [pt]; - t->skip_eob_node = 0; - ++x->coef_counts[2] [0] [pt] [DCT_EOB_TOKEN]; - ++t; - *tp = t; - pt = 0; /* 0 <-> all coeff data is zero */ - *a = *l = pt; -} - -void vp8_stuff_mb(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t) -{ - MACROBLOCKD *xd = &x->e_mbd; - ENTROPY_CONTEXT * A = (ENTROPY_CONTEXT *)xd->above_context; - ENTROPY_CONTEXT * L = (ENTROPY_CONTEXT *)xd->left_context; - int plane_type; - int b; - plane_type = 3; - if((xd->mode_info_context->mbmi.mode != B_PRED - && xd->mode_info_context->mbmi.mode != SPLITMV)) - { - stuff2nd_order_b(t, - A + vp8_block2above[24], L + vp8_block2left[24], cpi, x); - plane_type = 0; - } - - for (b = 0; b < 16; b++) - stuff1st_order_b(t, - A + vp8_block2above[b], - L + vp8_block2left[b], plane_type, cpi, x); - - for (b = 16; b < 24; b++) - stuff1st_order_buv(t, - A + vp8_block2above[b], - L + vp8_block2left[b], cpi, x); - -} -void vp8_fix_contexts(MACROBLOCKD *x) -{ - /* Clear entropy contexts for Y2 blocks */ - if (x->mode_info_context->mbmi.mode != B_PRED && x->mode_info_context->mbmi.mode != SPLITMV) - { - vpx_memset(x->above_context, 0, sizeof(ENTROPY_CONTEXT_PLANES)); - vpx_memset(x->left_context, 0, sizeof(ENTROPY_CONTEXT_PLANES)); - } - else - { - vpx_memset(x->above_context, 0, sizeof(ENTROPY_CONTEXT_PLANES)-1); - vpx_memset(x->left_context, 0, sizeof(ENTROPY_CONTEXT_PLANES)-1); - } - -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/tokenize.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/tokenize.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/tokenize.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/tokenize.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_ENCODER_TOKENIZE_H_ -#define VP8_ENCODER_TOKENIZE_H_ - -#include "vp8/common/entropy.h" -#include "block.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void vp8_tokenize_initialize(); - -typedef struct -{ - short Token; - short Extra; -} TOKENVALUE; - -typedef struct -{ - const vp8_prob *context_tree; - short Extra; - unsigned char Token; - unsigned char skip_eob_node; -} TOKENEXTRA; - -int rd_cost_mby(MACROBLOCKD *); - -#ifdef VP8_ENTROPY_STATS -void init_context_counters(); -void print_context_counters(); - -extern _int64 context_counters[BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS]; -#endif - -extern const short *const vp8_dct_value_cost_ptr; -/* TODO: The Token field should be broken out into a separate char array to - * improve cache locality, since it's needed for costing when the rest of the - * fields are not. - */ -extern const TOKENVALUE *const vp8_dct_value_tokens_ptr; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_TOKENIZE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/treewriter.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/treewriter.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/treewriter.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/treewriter.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "treewriter.h" - -static void cost( - int *const C, - vp8_tree T, - const vp8_prob *const P, - int i, - int c -) -{ - const vp8_prob p = P [i>>1]; - - do - { - const vp8_tree_index j = T[i]; - const int d = c + vp8_cost_bit(p, i & 1); - - if (j <= 0) - C[-j] = d; - else - cost(C, T, P, j, d); - } - while (++i & 1); -} -void vp8_cost_tokens(int *c, const vp8_prob *p, vp8_tree t) -{ - cost(c, t, p, 0, 0); -} -void vp8_cost_tokens2(int *c, const vp8_prob *p, vp8_tree t,int start) -{ - cost(c, t, p, start, 0); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/treewriter.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/treewriter.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/treewriter.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/treewriter.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP8_ENCODER_TREEWRITER_H_ -#define VP8_ENCODER_TREEWRITER_H_ - -/* Trees map alphabets into huffman-like codes suitable for an arithmetic - bit coder. Timothy S Murphy 11 October 2004 */ - -#include "vp8/common/treecoder.h" - -#include "boolhuff.h" /* for now */ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef BOOL_CODER vp8_writer; - -#define vp8_write vp8_encode_bool -#define vp8_write_literal vp8_encode_value -#define vp8_write_bit( W, V) vp8_write( W, V, vp8_prob_half) - -#define vp8bc_write vp8bc_write_bool -#define vp8bc_write_literal vp8bc_write_bits -#define vp8bc_write_bit( W, V) vp8bc_write_bits( W, V, 1) - - -/* Approximate length of an encoded bool in 256ths of a bit at given prob */ - -#define vp8_cost_zero( x) ( vp8_prob_cost[x]) -#define vp8_cost_one( x) vp8_cost_zero( vp8_complement(x)) - -#define vp8_cost_bit( x, b) vp8_cost_zero( (b)? vp8_complement(x) : (x) ) - -/* VP8BC version is scaled by 2^20 rather than 2^8; see bool_coder.h */ - - -/* Both of these return bits, not scaled bits. */ - -static unsigned int vp8_cost_branch(const unsigned int ct[2], vp8_prob p) -{ - /* Imitate existing calculation */ - - return ((ct[0] * vp8_cost_zero(p)) - + (ct[1] * vp8_cost_one(p))) >> 8; -} - -/* Small functions to write explicit values and tokens, as well as - estimate their lengths. */ - -static void vp8_treed_write -( - vp8_writer *const w, - vp8_tree t, - const vp8_prob *const p, - int v, - int n /* number of bits in v, assumed nonzero */ -) -{ - vp8_tree_index i = 0; - - do - { - const int b = (v >> --n) & 1; - vp8_write(w, b, p[i>>1]); - i = t[i+b]; - } - while (n); -} -static void vp8_write_token -( - vp8_writer *const w, - vp8_tree t, - const vp8_prob *const p, - vp8_token *const x -) -{ - vp8_treed_write(w, t, p, x->value, x->Len); -} - -static int vp8_treed_cost( - vp8_tree t, - const vp8_prob *const p, - int v, - int n /* number of bits in v, assumed nonzero */ -) -{ - int c = 0; - vp8_tree_index i = 0; - - do - { - const int b = (v >> --n) & 1; - c += vp8_cost_bit(p[i>>1], b); - i = t[i+b]; - } - while (n); - - return c; -} -static int vp8_cost_token -( - vp8_tree t, - const vp8_prob *const p, - vp8_token *const x -) -{ - return vp8_treed_cost(t, p, x->value, x->Len); -} - -/* Fill array of costs for all possible token values. */ - -void vp8_cost_tokens( - int *Costs, const vp8_prob *, vp8_tree -); - -void vp8_cost_tokens2( - int *Costs, const vp8_prob *, vp8_tree, int -); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP8_ENCODER_TREEWRITER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/dct_mmx.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/dct_mmx.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/dct_mmx.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/dct_mmx.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,241 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -;void vp8_short_fdct4x4_mmx(short *input, short *output, int pitch) -global sym(vp8_short_fdct4x4_mmx) PRIVATE -sym(vp8_short_fdct4x4_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 3 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ; input - mov rdi, arg(1) ; output - - movsxd rax, dword ptr arg(2) ;pitch - - lea rcx, [rsi + rax*2] - ; read the input data - movq mm0, [rsi] - movq mm1, [rsi + rax] - - movq mm2, [rcx] - movq mm4, [rcx + rax] - - ; transpose for the first stage - movq mm3, mm0 ; 00 01 02 03 - movq mm5, mm2 ; 20 21 22 23 - - punpcklwd mm0, mm1 ; 00 10 01 11 - punpckhwd mm3, mm1 ; 02 12 03 13 - - punpcklwd mm2, mm4 ; 20 30 21 31 - punpckhwd mm5, mm4 ; 22 32 23 33 - - movq mm1, mm0 ; 00 10 01 11 - punpckldq mm0, mm2 ; 00 10 20 30 - - punpckhdq mm1, mm2 ; 01 11 21 31 - - movq mm2, mm3 ; 02 12 03 13 - punpckldq mm2, mm5 ; 02 12 22 32 - - punpckhdq mm3, mm5 ; 03 13 23 33 - - ; mm0 0 - ; mm1 1 - ; mm2 2 - ; mm3 3 - - ; first stage - movq mm5, mm0 - movq mm4, mm1 - - paddw mm0, mm3 ; a1 = 0 + 3 - paddw mm1, mm2 ; b1 = 1 + 2 - - psubw mm4, mm2 ; c1 = 1 - 2 - psubw mm5, mm3 ; d1 = 0 - 3 - - psllw mm5, 3 - psllw mm4, 3 - - psllw mm0, 3 - psllw mm1, 3 - - ; output 0 and 2 - movq mm2, mm0 ; a1 - - paddw mm0, mm1 ; op[0] = a1 + b1 - psubw mm2, mm1 ; op[2] = a1 - b1 - - ; output 1 and 3 - ; interleave c1, d1 - movq mm1, mm5 ; d1 - punpcklwd mm1, mm4 ; c1 d1 - punpckhwd mm5, mm4 ; c1 d1 - - movq mm3, mm1 - movq mm4, mm5 - - pmaddwd mm1, MMWORD PTR[GLOBAL (_5352_2217)] ; c1*2217 + d1*5352 - pmaddwd mm4, MMWORD PTR[GLOBAL (_5352_2217)] ; c1*2217 + d1*5352 - - pmaddwd mm3, MMWORD PTR[GLOBAL(_2217_neg5352)] ; d1*2217 - c1*5352 - pmaddwd mm5, MMWORD PTR[GLOBAL(_2217_neg5352)] ; d1*2217 - c1*5352 - - paddd mm1, MMWORD PTR[GLOBAL(_14500)] - paddd mm4, MMWORD PTR[GLOBAL(_14500)] - paddd mm3, MMWORD PTR[GLOBAL(_7500)] - paddd mm5, MMWORD PTR[GLOBAL(_7500)] - - psrad mm1, 12 ; (c1 * 2217 + d1 * 5352 + 14500)>>12 - psrad mm4, 12 ; (c1 * 2217 + d1 * 5352 + 14500)>>12 - psrad mm3, 12 ; (d1 * 2217 - c1 * 5352 + 7500)>>12 - psrad mm5, 12 ; (d1 * 2217 - c1 * 5352 + 7500)>>12 - - packssdw mm1, mm4 ; op[1] - packssdw mm3, mm5 ; op[3] - - ; done with vertical - ; transpose for the second stage - movq mm4, mm0 ; 00 10 20 30 - movq mm5, mm2 ; 02 12 22 32 - - punpcklwd mm0, mm1 ; 00 01 10 11 - punpckhwd mm4, mm1 ; 20 21 30 31 - - punpcklwd mm2, mm3 ; 02 03 12 13 - punpckhwd mm5, mm3 ; 22 23 32 33 - - movq mm1, mm0 ; 00 01 10 11 - punpckldq mm0, mm2 ; 00 01 02 03 - - punpckhdq mm1, mm2 ; 01 22 12 13 - - movq mm2, mm4 ; 20 31 30 31 - punpckldq mm2, mm5 ; 20 21 22 23 - - punpckhdq mm4, mm5 ; 30 31 32 33 - - ; mm0 0 - ; mm1 1 - ; mm2 2 - ; mm3 4 - - movq mm5, mm0 - movq mm3, mm1 - - paddw mm0, mm4 ; a1 = 0 + 3 - paddw mm1, mm2 ; b1 = 1 + 2 - - psubw mm3, mm2 ; c1 = 1 - 2 - psubw mm5, mm4 ; d1 = 0 - 3 - - pxor mm6, mm6 ; zero out for compare - - pcmpeqw mm6, mm5 ; d1 != 0 - - pandn mm6, MMWORD PTR[GLOBAL(_cmp_mask)] ; clear upper, - ; and keep bit 0 of lower - - ; output 0 and 2 - movq mm2, mm0 ; a1 - - paddw mm0, mm1 ; a1 + b1 - psubw mm2, mm1 ; a1 - b1 - - paddw mm0, MMWORD PTR[GLOBAL(_7w)] - paddw mm2, MMWORD PTR[GLOBAL(_7w)] - - psraw mm0, 4 ; op[0] = (a1 + b1 + 7)>>4 - psraw mm2, 4 ; op[8] = (a1 - b1 + 7)>>4 - - movq MMWORD PTR[rdi + 0 ], mm0 - movq MMWORD PTR[rdi + 16], mm2 - - ; output 1 and 3 - ; interleave c1, d1 - movq mm1, mm5 ; d1 - punpcklwd mm1, mm3 ; c1 d1 - punpckhwd mm5, mm3 ; c1 d1 - - movq mm3, mm1 - movq mm4, mm5 - - pmaddwd mm1, MMWORD PTR[GLOBAL (_5352_2217)] ; c1*2217 + d1*5352 - pmaddwd mm4, MMWORD PTR[GLOBAL (_5352_2217)] ; c1*2217 + d1*5352 - - pmaddwd mm3, MMWORD PTR[GLOBAL(_2217_neg5352)] ; d1*2217 - c1*5352 - pmaddwd mm5, MMWORD PTR[GLOBAL(_2217_neg5352)] ; d1*2217 - c1*5352 - - paddd mm1, MMWORD PTR[GLOBAL(_12000)] - paddd mm4, MMWORD PTR[GLOBAL(_12000)] - paddd mm3, MMWORD PTR[GLOBAL(_51000)] - paddd mm5, MMWORD PTR[GLOBAL(_51000)] - - psrad mm1, 16 ; (c1 * 2217 + d1 * 5352 + 14500)>>16 - psrad mm4, 16 ; (c1 * 2217 + d1 * 5352 + 14500)>>16 - psrad mm3, 16 ; (d1 * 2217 - c1 * 5352 + 7500)>>16 - psrad mm5, 16 ; (d1 * 2217 - c1 * 5352 + 7500)>>16 - - packssdw mm1, mm4 ; op[4] - packssdw mm3, mm5 ; op[12] - - paddw mm1, mm6 ; op[4] += (d1!=0) - - movq MMWORD PTR[rdi + 8 ], mm1 - movq MMWORD PTR[rdi + 24], mm3 - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - -SECTION_RODATA -align 8 -_5352_2217: - dw 5352 - dw 2217 - dw 5352 - dw 2217 -align 8 -_2217_neg5352: - dw 2217 - dw -5352 - dw 2217 - dw -5352 -align 8 -_cmp_mask: - times 4 dw 1 -align 8 -_7w: - times 4 dw 7 -align 8 -_14500: - times 2 dd 14500 -align 8 -_7500: - times 2 dd 7500 -align 8 -_12000: - times 2 dd 12000 -align 8 -_51000: - times 2 dd 51000 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/dct_sse2.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/dct_sse2.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/dct_sse2.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/dct_sse2.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,432 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -%macro STACK_FRAME_CREATE 0 -%if ABI_IS_32BIT - %define input rsi - %define output rdi - %define pitch rax - push rbp - mov rbp, rsp - GET_GOT rbx - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) - mov rdi, arg(1) - - movsxd rax, dword ptr arg(2) - lea rcx, [rsi + rax*2] -%else - %if LIBVPX_YASM_WIN64 - %define input rcx - %define output rdx - %define pitch r8 - SAVE_XMM 7, u - %else - %define input rdi - %define output rsi - %define pitch rdx - %endif -%endif -%endmacro - -%macro STACK_FRAME_DESTROY 0 - %define input - %define output - %define pitch - -%if ABI_IS_32BIT - pop rdi - pop rsi - RESTORE_GOT - pop rbp -%else - %if LIBVPX_YASM_WIN64 - RESTORE_XMM - %endif -%endif - ret -%endmacro - -;void vp8_short_fdct4x4_sse2(short *input, short *output, int pitch) -global sym(vp8_short_fdct4x4_sse2) PRIVATE -sym(vp8_short_fdct4x4_sse2): - - STACK_FRAME_CREATE - - movq xmm0, MMWORD PTR[input ] ;03 02 01 00 - movq xmm2, MMWORD PTR[input+ pitch] ;13 12 11 10 - lea input, [input+2*pitch] - movq xmm1, MMWORD PTR[input ] ;23 22 21 20 - movq xmm3, MMWORD PTR[input+ pitch] ;33 32 31 30 - - punpcklqdq xmm0, xmm2 ;13 12 11 10 03 02 01 00 - punpcklqdq xmm1, xmm3 ;33 32 31 30 23 22 21 20 - - movdqa xmm2, xmm0 - punpckldq xmm0, xmm1 ;23 22 03 02 21 20 01 00 - punpckhdq xmm2, xmm1 ;33 32 13 12 31 30 11 10 - movdqa xmm1, xmm0 - punpckldq xmm0, xmm2 ;31 21 30 20 11 10 01 00 - pshufhw xmm1, xmm1, 0b1h ;22 23 02 03 xx xx xx xx - pshufhw xmm2, xmm2, 0b1h ;32 33 12 13 xx xx xx xx - - punpckhdq xmm1, xmm2 ;32 33 22 23 12 13 02 03 - movdqa xmm3, xmm0 - paddw xmm0, xmm1 ;b1 a1 b1 a1 b1 a1 b1 a1 - psubw xmm3, xmm1 ;c1 d1 c1 d1 c1 d1 c1 d1 - psllw xmm0, 3 ;b1 <<= 3 a1 <<= 3 - psllw xmm3, 3 ;c1 <<= 3 d1 <<= 3 - - movdqa xmm1, xmm0 - pmaddwd xmm0, XMMWORD PTR[GLOBAL(_mult_add)] ;a1 + b1 - pmaddwd xmm1, XMMWORD PTR[GLOBAL(_mult_sub)] ;a1 - b1 - movdqa xmm4, xmm3 - pmaddwd xmm3, XMMWORD PTR[GLOBAL(_5352_2217)] ;c1*2217 + d1*5352 - pmaddwd xmm4, XMMWORD PTR[GLOBAL(_2217_neg5352)];d1*2217 - c1*5352 - - paddd xmm3, XMMWORD PTR[GLOBAL(_14500)] - paddd xmm4, XMMWORD PTR[GLOBAL(_7500)] - psrad xmm3, 12 ;(c1 * 2217 + d1 * 5352 + 14500)>>12 - psrad xmm4, 12 ;(d1 * 2217 - c1 * 5352 + 7500)>>12 - - packssdw xmm0, xmm1 ;op[2] op[0] - packssdw xmm3, xmm4 ;op[3] op[1] - ; 23 22 21 20 03 02 01 00 - ; - ; 33 32 31 30 13 12 11 10 - ; - movdqa xmm2, xmm0 - punpcklqdq xmm0, xmm3 ;13 12 11 10 03 02 01 00 - punpckhqdq xmm2, xmm3 ;23 22 21 20 33 32 31 30 - - movdqa xmm3, xmm0 - punpcklwd xmm0, xmm2 ;32 30 22 20 12 10 02 00 - punpckhwd xmm3, xmm2 ;33 31 23 21 13 11 03 01 - movdqa xmm2, xmm0 - punpcklwd xmm0, xmm3 ;13 12 11 10 03 02 01 00 - punpckhwd xmm2, xmm3 ;33 32 31 30 23 22 21 20 - - movdqa xmm5, XMMWORD PTR[GLOBAL(_7)] - pshufd xmm2, xmm2, 04eh - movdqa xmm3, xmm0 - paddw xmm0, xmm2 ;b1 b1 b1 b1 a1 a1 a1 a1 - psubw xmm3, xmm2 ;c1 c1 c1 c1 d1 d1 d1 d1 - - pshufd xmm0, xmm0, 0d8h ;b1 b1 a1 a1 b1 b1 a1 a1 - movdqa xmm2, xmm3 ;save d1 for compare - pshufd xmm3, xmm3, 0d8h ;c1 c1 d1 d1 c1 c1 d1 d1 - pshuflw xmm0, xmm0, 0d8h ;b1 b1 a1 a1 b1 a1 b1 a1 - pshuflw xmm3, xmm3, 0d8h ;c1 c1 d1 d1 c1 d1 c1 d1 - pshufhw xmm0, xmm0, 0d8h ;b1 a1 b1 a1 b1 a1 b1 a1 - pshufhw xmm3, xmm3, 0d8h ;c1 d1 c1 d1 c1 d1 c1 d1 - movdqa xmm1, xmm0 - pmaddwd xmm0, XMMWORD PTR[GLOBAL(_mult_add)] ;a1 + b1 - pmaddwd xmm1, XMMWORD PTR[GLOBAL(_mult_sub)] ;a1 - b1 - - pxor xmm4, xmm4 ;zero out for compare - paddd xmm0, xmm5 - paddd xmm1, xmm5 - pcmpeqw xmm2, xmm4 - psrad xmm0, 4 ;(a1 + b1 + 7)>>4 - psrad xmm1, 4 ;(a1 - b1 + 7)>>4 - pandn xmm2, XMMWORD PTR[GLOBAL(_cmp_mask)] ;clear upper, - ;and keep bit 0 of lower - - movdqa xmm4, xmm3 - pmaddwd xmm3, XMMWORD PTR[GLOBAL(_5352_2217)] ;c1*2217 + d1*5352 - pmaddwd xmm4, XMMWORD PTR[GLOBAL(_2217_neg5352)] ;d1*2217 - c1*5352 - paddd xmm3, XMMWORD PTR[GLOBAL(_12000)] - paddd xmm4, XMMWORD PTR[GLOBAL(_51000)] - packssdw xmm0, xmm1 ;op[8] op[0] - psrad xmm3, 16 ;(c1 * 2217 + d1 * 5352 + 12000)>>16 - psrad xmm4, 16 ;(d1 * 2217 - c1 * 5352 + 51000)>>16 - - packssdw xmm3, xmm4 ;op[12] op[4] - movdqa xmm1, xmm0 - paddw xmm3, xmm2 ;op[4] += (d1!=0) - punpcklqdq xmm0, xmm3 ;op[4] op[0] - punpckhqdq xmm1, xmm3 ;op[12] op[8] - - movdqa XMMWORD PTR[output + 0], xmm0 - movdqa XMMWORD PTR[output + 16], xmm1 - - STACK_FRAME_DESTROY - -;void vp8_short_fdct8x4_sse2(short *input, short *output, int pitch) -global sym(vp8_short_fdct8x4_sse2) PRIVATE -sym(vp8_short_fdct8x4_sse2): - - STACK_FRAME_CREATE - - ; read the input data - movdqa xmm0, [input ] - movdqa xmm2, [input+ pitch] - lea input, [input+2*pitch] - movdqa xmm4, [input ] - movdqa xmm3, [input+ pitch] - - ; transpose for the first stage - movdqa xmm1, xmm0 ; 00 01 02 03 04 05 06 07 - movdqa xmm5, xmm4 ; 20 21 22 23 24 25 26 27 - - punpcklwd xmm0, xmm2 ; 00 10 01 11 02 12 03 13 - punpckhwd xmm1, xmm2 ; 04 14 05 15 06 16 07 17 - - punpcklwd xmm4, xmm3 ; 20 30 21 31 22 32 23 33 - punpckhwd xmm5, xmm3 ; 24 34 25 35 26 36 27 37 - - movdqa xmm2, xmm0 ; 00 10 01 11 02 12 03 13 - punpckldq xmm0, xmm4 ; 00 10 20 30 01 11 21 31 - - punpckhdq xmm2, xmm4 ; 02 12 22 32 03 13 23 33 - - movdqa xmm4, xmm1 ; 04 14 05 15 06 16 07 17 - punpckldq xmm4, xmm5 ; 04 14 24 34 05 15 25 35 - - punpckhdq xmm1, xmm5 ; 06 16 26 36 07 17 27 37 - movdqa xmm3, xmm2 ; 02 12 22 32 03 13 23 33 - - punpckhqdq xmm3, xmm1 ; 03 13 23 33 07 17 27 37 - punpcklqdq xmm2, xmm1 ; 02 12 22 32 06 16 26 36 - - movdqa xmm1, xmm0 ; 00 10 20 30 01 11 21 31 - punpcklqdq xmm0, xmm4 ; 00 10 20 30 04 14 24 34 - - punpckhqdq xmm1, xmm4 ; 01 11 21 32 05 15 25 35 - - ; xmm0 0 - ; xmm1 1 - ; xmm2 2 - ; xmm3 3 - - ; first stage - movdqa xmm5, xmm0 - movdqa xmm4, xmm1 - - paddw xmm0, xmm3 ; a1 = 0 + 3 - paddw xmm1, xmm2 ; b1 = 1 + 2 - - psubw xmm4, xmm2 ; c1 = 1 - 2 - psubw xmm5, xmm3 ; d1 = 0 - 3 - - psllw xmm5, 3 - psllw xmm4, 3 - - psllw xmm0, 3 - psllw xmm1, 3 - - ; output 0 and 2 - movdqa xmm2, xmm0 ; a1 - - paddw xmm0, xmm1 ; op[0] = a1 + b1 - psubw xmm2, xmm1 ; op[2] = a1 - b1 - - ; output 1 and 3 - ; interleave c1, d1 - movdqa xmm1, xmm5 ; d1 - punpcklwd xmm1, xmm4 ; c1 d1 - punpckhwd xmm5, xmm4 ; c1 d1 - - movdqa xmm3, xmm1 - movdqa xmm4, xmm5 - - pmaddwd xmm1, XMMWORD PTR[GLOBAL (_5352_2217)] ; c1*2217 + d1*5352 - pmaddwd xmm4, XMMWORD PTR[GLOBAL (_5352_2217)] ; c1*2217 + d1*5352 - - pmaddwd xmm3, XMMWORD PTR[GLOBAL(_2217_neg5352)] ; d1*2217 - c1*5352 - pmaddwd xmm5, XMMWORD PTR[GLOBAL(_2217_neg5352)] ; d1*2217 - c1*5352 - - paddd xmm1, XMMWORD PTR[GLOBAL(_14500)] - paddd xmm4, XMMWORD PTR[GLOBAL(_14500)] - paddd xmm3, XMMWORD PTR[GLOBAL(_7500)] - paddd xmm5, XMMWORD PTR[GLOBAL(_7500)] - - psrad xmm1, 12 ; (c1 * 2217 + d1 * 5352 + 14500)>>12 - psrad xmm4, 12 ; (c1 * 2217 + d1 * 5352 + 14500)>>12 - psrad xmm3, 12 ; (d1 * 2217 - c1 * 5352 + 7500)>>12 - psrad xmm5, 12 ; (d1 * 2217 - c1 * 5352 + 7500)>>12 - - packssdw xmm1, xmm4 ; op[1] - packssdw xmm3, xmm5 ; op[3] - - ; done with vertical - ; transpose for the second stage - movdqa xmm4, xmm0 ; 00 10 20 30 04 14 24 34 - movdqa xmm5, xmm2 ; 02 12 22 32 06 16 26 36 - - punpcklwd xmm0, xmm1 ; 00 01 10 11 20 21 30 31 - punpckhwd xmm4, xmm1 ; 04 05 14 15 24 25 34 35 - - punpcklwd xmm2, xmm3 ; 02 03 12 13 22 23 32 33 - punpckhwd xmm5, xmm3 ; 06 07 16 17 26 27 36 37 - - movdqa xmm1, xmm0 ; 00 01 10 11 20 21 30 31 - punpckldq xmm0, xmm2 ; 00 01 02 03 10 11 12 13 - - punpckhdq xmm1, xmm2 ; 20 21 22 23 30 31 32 33 - - movdqa xmm2, xmm4 ; 04 05 14 15 24 25 34 35 - punpckldq xmm2, xmm5 ; 04 05 06 07 14 15 16 17 - - punpckhdq xmm4, xmm5 ; 24 25 26 27 34 35 36 37 - movdqa xmm3, xmm1 ; 20 21 22 23 30 31 32 33 - - punpckhqdq xmm3, xmm4 ; 30 31 32 33 34 35 36 37 - punpcklqdq xmm1, xmm4 ; 20 21 22 23 24 25 26 27 - - movdqa xmm4, xmm0 ; 00 01 02 03 10 11 12 13 - punpcklqdq xmm0, xmm2 ; 00 01 02 03 04 05 06 07 - - punpckhqdq xmm4, xmm2 ; 10 11 12 13 14 15 16 17 - - ; xmm0 0 - ; xmm1 4 - ; xmm2 1 - ; xmm3 3 - - movdqa xmm5, xmm0 - movdqa xmm2, xmm1 - - paddw xmm0, xmm3 ; a1 = 0 + 3 - paddw xmm1, xmm4 ; b1 = 1 + 2 - - psubw xmm4, xmm2 ; c1 = 1 - 2 - psubw xmm5, xmm3 ; d1 = 0 - 3 - - pxor xmm6, xmm6 ; zero out for compare - - pcmpeqw xmm6, xmm5 ; d1 != 0 - - pandn xmm6, XMMWORD PTR[GLOBAL(_cmp_mask8x4)] ; clear upper, - ; and keep bit 0 of lower - - ; output 0 and 2 - movdqa xmm2, xmm0 ; a1 - - paddw xmm0, xmm1 ; a1 + b1 - psubw xmm2, xmm1 ; a1 - b1 - - paddw xmm0, XMMWORD PTR[GLOBAL(_7w)] - paddw xmm2, XMMWORD PTR[GLOBAL(_7w)] - - psraw xmm0, 4 ; op[0] = (a1 + b1 + 7)>>4 - psraw xmm2, 4 ; op[8] = (a1 - b1 + 7)>>4 - - ; output 1 and 3 - ; interleave c1, d1 - movdqa xmm1, xmm5 ; d1 - punpcklwd xmm1, xmm4 ; c1 d1 - punpckhwd xmm5, xmm4 ; c1 d1 - - movdqa xmm3, xmm1 - movdqa xmm4, xmm5 - - pmaddwd xmm1, XMMWORD PTR[GLOBAL (_5352_2217)] ; c1*2217 + d1*5352 - pmaddwd xmm4, XMMWORD PTR[GLOBAL (_5352_2217)] ; c1*2217 + d1*5352 - - pmaddwd xmm3, XMMWORD PTR[GLOBAL(_2217_neg5352)] ; d1*2217 - c1*5352 - pmaddwd xmm5, XMMWORD PTR[GLOBAL(_2217_neg5352)] ; d1*2217 - c1*5352 - - paddd xmm1, XMMWORD PTR[GLOBAL(_12000)] - paddd xmm4, XMMWORD PTR[GLOBAL(_12000)] - paddd xmm3, XMMWORD PTR[GLOBAL(_51000)] - paddd xmm5, XMMWORD PTR[GLOBAL(_51000)] - - psrad xmm1, 16 ; (c1 * 2217 + d1 * 5352 + 14500)>>16 - psrad xmm4, 16 ; (c1 * 2217 + d1 * 5352 + 14500)>>16 - psrad xmm3, 16 ; (d1 * 2217 - c1 * 5352 + 7500)>>16 - psrad xmm5, 16 ; (d1 * 2217 - c1 * 5352 + 7500)>>16 - - packssdw xmm1, xmm4 ; op[4] - packssdw xmm3, xmm5 ; op[12] - - paddw xmm1, xmm6 ; op[4] += (d1!=0) - - movdqa xmm4, xmm0 - movdqa xmm5, xmm2 - - punpcklqdq xmm0, xmm1 - punpckhqdq xmm4, xmm1 - - punpcklqdq xmm2, xmm3 - punpckhqdq xmm5, xmm3 - - movdqa XMMWORD PTR[output + 0 ], xmm0 - movdqa XMMWORD PTR[output + 16], xmm2 - movdqa XMMWORD PTR[output + 32], xmm4 - movdqa XMMWORD PTR[output + 48], xmm5 - - STACK_FRAME_DESTROY - -SECTION_RODATA -align 16 -_5352_2217: - dw 5352 - dw 2217 - dw 5352 - dw 2217 - dw 5352 - dw 2217 - dw 5352 - dw 2217 -align 16 -_2217_neg5352: - dw 2217 - dw -5352 - dw 2217 - dw -5352 - dw 2217 - dw -5352 - dw 2217 - dw -5352 -align 16 -_mult_add: - times 8 dw 1 -align 16 -_cmp_mask: - times 4 dw 1 - times 4 dw 0 -align 16 -_cmp_mask8x4: - times 8 dw 1 -align 16 -_mult_sub: - dw 1 - dw -1 - dw 1 - dw -1 - dw 1 - dw -1 - dw 1 - dw -1 -align 16 -_7: - times 4 dd 7 -align 16 -_7w: - times 8 dw 7 -align 16 -_14500: - times 4 dd 14500 -align 16 -_7500: - times 4 dd 7500 -align 16 -_12000: - times 4 dd 12000 -align 16 -_51000: - times 4 dd 51000 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/denoising_sse2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/denoising_sse2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/denoising_sse2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/denoising_sse2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,379 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vp8/encoder/denoising.h" -#include "vp8/common/reconinter.h" -#include "vpx/vpx_integer.h" -#include "vpx_mem/vpx_mem.h" -#include "vp8_rtcd.h" - -#include -#include "vpx_ports/emmintrin_compat.h" - -/* Compute the sum of all pixel differences of this MB. */ -static INLINE unsigned int abs_sum_diff_16x1(__m128i acc_diff) { - const __m128i k_1 = _mm_set1_epi16(1); - const __m128i acc_diff_lo = _mm_srai_epi16( - _mm_unpacklo_epi8(acc_diff, acc_diff), 8); - const __m128i acc_diff_hi = _mm_srai_epi16( - _mm_unpackhi_epi8(acc_diff, acc_diff), 8); - const __m128i acc_diff_16 = _mm_add_epi16(acc_diff_lo, acc_diff_hi); - const __m128i hg_fe_dc_ba = _mm_madd_epi16(acc_diff_16, k_1); - const __m128i hgfe_dcba = _mm_add_epi32(hg_fe_dc_ba, - _mm_srli_si128(hg_fe_dc_ba, 8)); - const __m128i hgfedcba = _mm_add_epi32(hgfe_dcba, - _mm_srli_si128(hgfe_dcba, 4)); - unsigned int sum_diff = abs(_mm_cvtsi128_si32(hgfedcba)); - - return sum_diff; -} - -int vp8_denoiser_filter_sse2(unsigned char *mc_running_avg_y, - int mc_avg_y_stride, - unsigned char *running_avg_y, int avg_y_stride, - unsigned char *sig, int sig_stride, - unsigned int motion_magnitude, - int increase_denoising) -{ - unsigned char *running_avg_y_start = running_avg_y; - unsigned char *sig_start = sig; - unsigned int sum_diff_thresh; - int r; - int shift_inc = (increase_denoising && - motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD) ? 1 : 0; - __m128i acc_diff = _mm_setzero_si128(); - const __m128i k_0 = _mm_setzero_si128(); - const __m128i k_4 = _mm_set1_epi8(4 + shift_inc); - const __m128i k_8 = _mm_set1_epi8(8); - const __m128i k_16 = _mm_set1_epi8(16); - /* Modify each level's adjustment according to motion_magnitude. */ - const __m128i l3 = _mm_set1_epi8( - (motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD) ? - 7 + shift_inc : 6); - /* Difference between level 3 and level 2 is 2. */ - const __m128i l32 = _mm_set1_epi8(2); - /* Difference between level 2 and level 1 is 1. */ - const __m128i l21 = _mm_set1_epi8(1); - - for (r = 0; r < 16; ++r) - { - /* Calculate differences */ - const __m128i v_sig = _mm_loadu_si128((__m128i *)(&sig[0])); - const __m128i v_mc_running_avg_y = _mm_loadu_si128( - (__m128i *)(&mc_running_avg_y[0])); - __m128i v_running_avg_y; - const __m128i pdiff = _mm_subs_epu8(v_mc_running_avg_y, v_sig); - const __m128i ndiff = _mm_subs_epu8(v_sig, v_mc_running_avg_y); - /* Obtain the sign. FF if diff is negative. */ - const __m128i diff_sign = _mm_cmpeq_epi8(pdiff, k_0); - /* Clamp absolute difference to 16 to be used to get mask. Doing this - * allows us to use _mm_cmpgt_epi8, which operates on signed byte. */ - const __m128i clamped_absdiff = _mm_min_epu8( - _mm_or_si128(pdiff, ndiff), k_16); - /* Get masks for l2 l1 and l0 adjustments */ - const __m128i mask2 = _mm_cmpgt_epi8(k_16, clamped_absdiff); - const __m128i mask1 = _mm_cmpgt_epi8(k_8, clamped_absdiff); - const __m128i mask0 = _mm_cmpgt_epi8(k_4, clamped_absdiff); - /* Get adjustments for l2, l1, and l0 */ - __m128i adj2 = _mm_and_si128(mask2, l32); - const __m128i adj1 = _mm_and_si128(mask1, l21); - const __m128i adj0 = _mm_and_si128(mask0, clamped_absdiff); - __m128i adj, padj, nadj; - - /* Combine the adjustments and get absolute adjustments. */ - adj2 = _mm_add_epi8(adj2, adj1); - adj = _mm_sub_epi8(l3, adj2); - adj = _mm_andnot_si128(mask0, adj); - adj = _mm_or_si128(adj, adj0); - - /* Restore the sign and get positive and negative adjustments. */ - padj = _mm_andnot_si128(diff_sign, adj); - nadj = _mm_and_si128(diff_sign, adj); - - /* Calculate filtered value. */ - v_running_avg_y = _mm_adds_epu8(v_sig, padj); - v_running_avg_y = _mm_subs_epu8(v_running_avg_y, nadj); - _mm_storeu_si128((__m128i *)running_avg_y, v_running_avg_y); - - /* Adjustments <=7, and each element in acc_diff can fit in signed - * char. - */ - acc_diff = _mm_adds_epi8(acc_diff, padj); - acc_diff = _mm_subs_epi8(acc_diff, nadj); - - /* Update pointers for next iteration. */ - sig += sig_stride; - mc_running_avg_y += mc_avg_y_stride; - running_avg_y += avg_y_stride; - } - - { - /* Compute the sum of all pixel differences of this MB. */ - unsigned int abs_sum_diff = abs_sum_diff_16x1(acc_diff); - sum_diff_thresh = SUM_DIFF_THRESHOLD; - if (increase_denoising) sum_diff_thresh = SUM_DIFF_THRESHOLD_HIGH; - if (abs_sum_diff > sum_diff_thresh) { - // Before returning to copy the block (i.e., apply no denoising), - // check if we can still apply some (weaker) temporal filtering to - // this block, that would otherwise not be denoised at all. Simplest - // is to apply an additional adjustment to running_avg_y to bring it - // closer to sig. The adjustment is capped by a maximum delta, and - // chosen such that in most cases the resulting sum_diff will be - // within the acceptable range given by sum_diff_thresh. - - // The delta is set by the excess of absolute pixel diff over the - // threshold. - int delta = ((abs_sum_diff - sum_diff_thresh) >> 8) + 1; - // Only apply the adjustment for max delta up to 3. - if (delta < 4) { - const __m128i k_delta = _mm_set1_epi8(delta); - sig -= sig_stride * 16; - mc_running_avg_y -= mc_avg_y_stride * 16; - running_avg_y -= avg_y_stride * 16; - for (r = 0; r < 16; ++r) { - __m128i v_running_avg_y = - _mm_loadu_si128((__m128i *)(&running_avg_y[0])); - // Calculate differences. - const __m128i v_sig = _mm_loadu_si128((__m128i *)(&sig[0])); - const __m128i v_mc_running_avg_y = - _mm_loadu_si128((__m128i *)(&mc_running_avg_y[0])); - const __m128i pdiff = _mm_subs_epu8(v_mc_running_avg_y, v_sig); - const __m128i ndiff = _mm_subs_epu8(v_sig, v_mc_running_avg_y); - // Obtain the sign. FF if diff is negative. - const __m128i diff_sign = _mm_cmpeq_epi8(pdiff, k_0); - // Clamp absolute difference to delta to get the adjustment. - const __m128i adj = - _mm_min_epu8(_mm_or_si128(pdiff, ndiff), k_delta); - // Restore the sign and get positive and negative adjustments. - __m128i padj, nadj; - padj = _mm_andnot_si128(diff_sign, adj); - nadj = _mm_and_si128(diff_sign, adj); - // Calculate filtered value. - v_running_avg_y = _mm_subs_epu8(v_running_avg_y, padj); - v_running_avg_y = _mm_adds_epu8(v_running_avg_y, nadj); - _mm_storeu_si128((__m128i *)running_avg_y, v_running_avg_y); - - // Accumulate the adjustments. - acc_diff = _mm_subs_epi8(acc_diff, padj); - acc_diff = _mm_adds_epi8(acc_diff, nadj); - - // Update pointers for next iteration. - sig += sig_stride; - mc_running_avg_y += mc_avg_y_stride; - running_avg_y += avg_y_stride; - } - abs_sum_diff = abs_sum_diff_16x1(acc_diff); - if (abs_sum_diff > sum_diff_thresh) { - return COPY_BLOCK; - } - } else { - return COPY_BLOCK; - } - } - } - - vp8_copy_mem16x16(running_avg_y_start, avg_y_stride, sig_start, sig_stride); - return FILTER_BLOCK; -} - -int vp8_denoiser_filter_uv_sse2(unsigned char *mc_running_avg, - int mc_avg_stride, - unsigned char *running_avg, int avg_stride, - unsigned char *sig, int sig_stride, - unsigned int motion_magnitude, - int increase_denoising) { - unsigned char *running_avg_start = running_avg; - unsigned char *sig_start = sig; - unsigned int sum_diff_thresh; - int r; - int shift_inc = (increase_denoising && - motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD_UV) ? 1 : 0; - __m128i acc_diff = _mm_setzero_si128(); - const __m128i k_0 = _mm_setzero_si128(); - const __m128i k_4 = _mm_set1_epi8(4 + shift_inc); - const __m128i k_8 = _mm_set1_epi8(8); - const __m128i k_16 = _mm_set1_epi8(16); - /* Modify each level's adjustment according to motion_magnitude. */ - const __m128i l3 = _mm_set1_epi8( - (motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD_UV) ? - 7 + shift_inc : 6); - /* Difference between level 3 and level 2 is 2. */ - const __m128i l32 = _mm_set1_epi8(2); - /* Difference between level 2 and level 1 is 1. */ - const __m128i l21 = _mm_set1_epi8(1); - - { - const __m128i k_1 = _mm_set1_epi16(1); - __m128i vec_sum_block = _mm_setzero_si128(); - - // Avoid denoising color signal if its close to average level. - for (r = 0; r < 8; ++r) { - const __m128i v_sig = _mm_loadl_epi64((__m128i *)(&sig[0])); - const __m128i v_sig_unpack = _mm_unpacklo_epi8(v_sig, k_0); - vec_sum_block = _mm_add_epi16(vec_sum_block, v_sig_unpack); - sig += sig_stride; - } - sig -= sig_stride * 8; - { - const __m128i hg_fe_dc_ba = _mm_madd_epi16(vec_sum_block, k_1); - const __m128i hgfe_dcba = _mm_add_epi32(hg_fe_dc_ba, - _mm_srli_si128(hg_fe_dc_ba, 8)); - const __m128i hgfedcba = _mm_add_epi32(hgfe_dcba, - _mm_srli_si128(hgfe_dcba, 4)); - const int sum_block = _mm_cvtsi128_si32(hgfedcba); - if (abs(sum_block - (128 * 8 * 8)) < SUM_DIFF_FROM_AVG_THRESH_UV) { - return COPY_BLOCK; - } - } - } - - for (r = 0; r < 4; ++r) { - /* Calculate differences */ - const __m128i v_sig_low = _mm_castpd_si128( - _mm_load_sd((double *)(&sig[0]))); - const __m128i v_sig = _mm_castpd_si128( - _mm_loadh_pd(_mm_castsi128_pd(v_sig_low), - (double *)(&sig[sig_stride]))); - const __m128i v_mc_running_avg_low = _mm_castpd_si128( - _mm_load_sd((double *)(&mc_running_avg[0]))); - const __m128i v_mc_running_avg = _mm_castpd_si128( - _mm_loadh_pd(_mm_castsi128_pd(v_mc_running_avg_low), - (double *)(&mc_running_avg[mc_avg_stride]))); - const __m128i pdiff = _mm_subs_epu8(v_mc_running_avg, v_sig); - const __m128i ndiff = _mm_subs_epu8(v_sig, v_mc_running_avg); - /* Obtain the sign. FF if diff is negative. */ - const __m128i diff_sign = _mm_cmpeq_epi8(pdiff, k_0); - /* Clamp absolute difference to 16 to be used to get mask. Doing this - * allows us to use _mm_cmpgt_epi8, which operates on signed byte. */ - const __m128i clamped_absdiff = _mm_min_epu8( - _mm_or_si128(pdiff, ndiff), k_16); - /* Get masks for l2 l1 and l0 adjustments */ - const __m128i mask2 = _mm_cmpgt_epi8(k_16, clamped_absdiff); - const __m128i mask1 = _mm_cmpgt_epi8(k_8, clamped_absdiff); - const __m128i mask0 = _mm_cmpgt_epi8(k_4, clamped_absdiff); - /* Get adjustments for l2, l1, and l0 */ - __m128i adj2 = _mm_and_si128(mask2, l32); - const __m128i adj1 = _mm_and_si128(mask1, l21); - const __m128i adj0 = _mm_and_si128(mask0, clamped_absdiff); - __m128i adj, padj, nadj; - __m128i v_running_avg; - - /* Combine the adjustments and get absolute adjustments. */ - adj2 = _mm_add_epi8(adj2, adj1); - adj = _mm_sub_epi8(l3, adj2); - adj = _mm_andnot_si128(mask0, adj); - adj = _mm_or_si128(adj, adj0); - - /* Restore the sign and get positive and negative adjustments. */ - padj = _mm_andnot_si128(diff_sign, adj); - nadj = _mm_and_si128(diff_sign, adj); - - /* Calculate filtered value. */ - v_running_avg = _mm_adds_epu8(v_sig, padj); - v_running_avg = _mm_subs_epu8(v_running_avg, nadj); - - _mm_storel_pd((double *)&running_avg[0], - _mm_castsi128_pd(v_running_avg)); - _mm_storeh_pd((double *)&running_avg[avg_stride], - _mm_castsi128_pd(v_running_avg)); - - /* Adjustments <=7, and each element in acc_diff can fit in signed - * char. - */ - acc_diff = _mm_adds_epi8(acc_diff, padj); - acc_diff = _mm_subs_epi8(acc_diff, nadj); - - /* Update pointers for next iteration. */ - sig += sig_stride * 2; - mc_running_avg += mc_avg_stride * 2; - running_avg += avg_stride * 2; - } - - { - unsigned int abs_sum_diff = abs_sum_diff_16x1(acc_diff); - sum_diff_thresh = SUM_DIFF_THRESHOLD_UV; - if (increase_denoising) sum_diff_thresh = SUM_DIFF_THRESHOLD_HIGH_UV; - if (abs_sum_diff > sum_diff_thresh) { - // Before returning to copy the block (i.e., apply no denoising), - // check if we can still apply some (weaker) temporal filtering to - // this block, that would otherwise not be denoised at all. Simplest - // is to apply an additional adjustment to running_avg_y to bring it - // closer to sig. The adjustment is capped by a maximum delta, and - // chosen such that in most cases the resulting sum_diff will be - // within the acceptable range given by sum_diff_thresh. - - // The delta is set by the excess of absolute pixel diff over the - // threshold. - int delta = ((abs_sum_diff - sum_diff_thresh) >> 8) + 1; - // Only apply the adjustment for max delta up to 3. - if (delta < 4) { - const __m128i k_delta = _mm_set1_epi8(delta); - sig -= sig_stride * 8; - mc_running_avg -= mc_avg_stride * 8; - running_avg -= avg_stride * 8; - for (r = 0; r < 4; ++r) { - // Calculate differences. - const __m128i v_sig_low = _mm_castpd_si128( - _mm_load_sd((double *)(&sig[0]))); - const __m128i v_sig = _mm_castpd_si128( - _mm_loadh_pd(_mm_castsi128_pd(v_sig_low), - (double *)(&sig[sig_stride]))); - const __m128i v_mc_running_avg_low = _mm_castpd_si128( - _mm_load_sd((double *)(&mc_running_avg[0]))); - const __m128i v_mc_running_avg = _mm_castpd_si128( - _mm_loadh_pd(_mm_castsi128_pd(v_mc_running_avg_low), - (double *)(&mc_running_avg[mc_avg_stride]))); - const __m128i pdiff = _mm_subs_epu8(v_mc_running_avg, v_sig); - const __m128i ndiff = _mm_subs_epu8(v_sig, v_mc_running_avg); - // Obtain the sign. FF if diff is negative. - const __m128i diff_sign = _mm_cmpeq_epi8(pdiff, k_0); - // Clamp absolute difference to delta to get the adjustment. - const __m128i adj = - _mm_min_epu8(_mm_or_si128(pdiff, ndiff), k_delta); - // Restore the sign and get positive and negative adjustments. - __m128i padj, nadj; - const __m128i v_running_avg_low = _mm_castpd_si128( - _mm_load_sd((double *)(&running_avg[0]))); - __m128i v_running_avg = _mm_castpd_si128( - _mm_loadh_pd(_mm_castsi128_pd(v_running_avg_low), - (double *)(&running_avg[avg_stride]))); - padj = _mm_andnot_si128(diff_sign, adj); - nadj = _mm_and_si128(diff_sign, adj); - // Calculate filtered value. - v_running_avg = _mm_subs_epu8(v_running_avg, padj); - v_running_avg = _mm_adds_epu8(v_running_avg, nadj); - - _mm_storel_pd((double *)&running_avg[0], - _mm_castsi128_pd(v_running_avg)); - _mm_storeh_pd((double *)&running_avg[avg_stride], - _mm_castsi128_pd(v_running_avg)); - - // Accumulate the adjustments. - acc_diff = _mm_subs_epi8(acc_diff, padj); - acc_diff = _mm_adds_epi8(acc_diff, nadj); - - // Update pointers for next iteration. - sig += sig_stride * 2; - mc_running_avg += mc_avg_stride * 2; - running_avg += avg_stride * 2; - } - abs_sum_diff = abs_sum_diff_16x1(acc_diff); - if (abs_sum_diff > sum_diff_thresh) { - return COPY_BLOCK; - } - } else { - return COPY_BLOCK; - } - } - } - - vp8_copy_mem8x8(running_avg_start, avg_stride, sig_start, sig_stride); - return FILTER_BLOCK; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/encodeopt.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/encodeopt.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/encodeopt.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/encodeopt.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,386 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -;int vp8_block_error_xmm(short *coeff_ptr, short *dcoef_ptr) -global sym(vp8_block_error_xmm) PRIVATE -sym(vp8_block_error_xmm): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 2 - push rsi - push rdi - ; end prologue - - mov rsi, arg(0) ;coeff_ptr - mov rdi, arg(1) ;dcoef_ptr - - movdqa xmm0, [rsi] - movdqa xmm1, [rdi] - - movdqa xmm2, [rsi+16] - movdqa xmm3, [rdi+16] - - psubw xmm0, xmm1 - psubw xmm2, xmm3 - - pmaddwd xmm0, xmm0 - pmaddwd xmm2, xmm2 - - paddd xmm0, xmm2 - - pxor xmm5, xmm5 - movdqa xmm1, xmm0 - - punpckldq xmm0, xmm5 - punpckhdq xmm1, xmm5 - - paddd xmm0, xmm1 - movdqa xmm1, xmm0 - - psrldq xmm0, 8 - paddd xmm0, xmm1 - - movq rax, xmm0 - - pop rdi - pop rsi - ; begin epilog - UNSHADOW_ARGS - pop rbp - ret - -;int vp8_block_error_mmx(short *coeff_ptr, short *dcoef_ptr) -global sym(vp8_block_error_mmx) PRIVATE -sym(vp8_block_error_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 2 - push rsi - push rdi - ; end prolog - - - mov rsi, arg(0) ;coeff_ptr - pxor mm7, mm7 - - mov rdi, arg(1) ;dcoef_ptr - movq mm3, [rsi] - - movq mm4, [rdi] - movq mm5, [rsi+8] - - movq mm6, [rdi+8] - pxor mm1, mm1 ; from movd mm1, dc ; dc =0 - - movq mm2, mm7 - psubw mm5, mm6 - - por mm1, mm2 - pmaddwd mm5, mm5 - - pcmpeqw mm1, mm7 - psubw mm3, mm4 - - pand mm1, mm3 - pmaddwd mm1, mm1 - - paddd mm1, mm5 - movq mm3, [rsi+16] - - movq mm4, [rdi+16] - movq mm5, [rsi+24] - - movq mm6, [rdi+24] - psubw mm5, mm6 - - pmaddwd mm5, mm5 - psubw mm3, mm4 - - pmaddwd mm3, mm3 - paddd mm3, mm5 - - paddd mm1, mm3 - movq mm0, mm1 - - psrlq mm1, 32 - paddd mm0, mm1 - - movq rax, mm0 - - pop rdi - pop rsi - ; begin epilog - UNSHADOW_ARGS - pop rbp - ret - - -;int vp8_mbblock_error_mmx_impl(short *coeff_ptr, short *dcoef_ptr, int dc); -global sym(vp8_mbblock_error_mmx_impl) PRIVATE -sym(vp8_mbblock_error_mmx_impl): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 3 - push rsi - push rdi - ; end prolog - - - mov rsi, arg(0) ;coeff_ptr - pxor mm7, mm7 - - mov rdi, arg(1) ;dcoef_ptr - pxor mm2, mm2 - - movd mm1, dword ptr arg(2) ;dc - por mm1, mm2 - - pcmpeqw mm1, mm7 - mov rcx, 16 - -.mberror_loop_mmx: - movq mm3, [rsi] - movq mm4, [rdi] - - movq mm5, [rsi+8] - movq mm6, [rdi+8] - - - psubw mm5, mm6 - pmaddwd mm5, mm5 - - psubw mm3, mm4 - pand mm3, mm1 - - pmaddwd mm3, mm3 - paddd mm2, mm5 - - paddd mm2, mm3 - movq mm3, [rsi+16] - - movq mm4, [rdi+16] - movq mm5, [rsi+24] - - movq mm6, [rdi+24] - psubw mm5, mm6 - - pmaddwd mm5, mm5 - psubw mm3, mm4 - - pmaddwd mm3, mm3 - paddd mm2, mm5 - - paddd mm2, mm3 - add rsi, 32 - - add rdi, 32 - sub rcx, 1 - - jnz .mberror_loop_mmx - - movq mm0, mm2 - psrlq mm2, 32 - - paddd mm0, mm2 - movq rax, mm0 - - pop rdi - pop rsi - ; begin epilog - UNSHADOW_ARGS - pop rbp - ret - - -;int vp8_mbblock_error_xmm_impl(short *coeff_ptr, short *dcoef_ptr, int dc); -global sym(vp8_mbblock_error_xmm_impl) PRIVATE -sym(vp8_mbblock_error_xmm_impl): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 3 - SAVE_XMM 6 - push rsi - push rdi - ; end prolog - - - mov rsi, arg(0) ;coeff_ptr - pxor xmm6, xmm6 - - mov rdi, arg(1) ;dcoef_ptr - pxor xmm4, xmm4 - - movd xmm5, dword ptr arg(2) ;dc - por xmm5, xmm4 - - pcmpeqw xmm5, xmm6 - mov rcx, 16 - -.mberror_loop: - movdqa xmm0, [rsi] - movdqa xmm1, [rdi] - - movdqa xmm2, [rsi+16] - movdqa xmm3, [rdi+16] - - - psubw xmm2, xmm3 - pmaddwd xmm2, xmm2 - - psubw xmm0, xmm1 - pand xmm0, xmm5 - - pmaddwd xmm0, xmm0 - add rsi, 32 - - add rdi, 32 - - sub rcx, 1 - paddd xmm4, xmm2 - - paddd xmm4, xmm0 - jnz .mberror_loop - - movdqa xmm0, xmm4 - punpckldq xmm0, xmm6 - - punpckhdq xmm4, xmm6 - paddd xmm0, xmm4 - - movdqa xmm1, xmm0 - psrldq xmm0, 8 - - paddd xmm0, xmm1 - movq rax, xmm0 - - pop rdi - pop rsi - ; begin epilog - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - - -;int vp8_mbuverror_mmx_impl(short *s_ptr, short *d_ptr); -global sym(vp8_mbuverror_mmx_impl) PRIVATE -sym(vp8_mbuverror_mmx_impl): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 2 - push rsi - push rdi - ; end prolog - - - mov rsi, arg(0) ;s_ptr - mov rdi, arg(1) ;d_ptr - - mov rcx, 16 - pxor mm7, mm7 - -.mbuverror_loop_mmx: - - movq mm1, [rsi] - movq mm2, [rdi] - - psubw mm1, mm2 - pmaddwd mm1, mm1 - - - movq mm3, [rsi+8] - movq mm4, [rdi+8] - - psubw mm3, mm4 - pmaddwd mm3, mm3 - - - paddd mm7, mm1 - paddd mm7, mm3 - - - add rsi, 16 - add rdi, 16 - - dec rcx - jnz .mbuverror_loop_mmx - - movq mm0, mm7 - psrlq mm7, 32 - - paddd mm0, mm7 - movq rax, mm0 - - pop rdi - pop rsi - ; begin epilog - UNSHADOW_ARGS - pop rbp - ret - - -;int vp8_mbuverror_xmm_impl(short *s_ptr, short *d_ptr); -global sym(vp8_mbuverror_xmm_impl) PRIVATE -sym(vp8_mbuverror_xmm_impl): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 2 - push rsi - push rdi - ; end prolog - - - mov rsi, arg(0) ;s_ptr - mov rdi, arg(1) ;d_ptr - - mov rcx, 16 - pxor xmm3, xmm3 - -.mbuverror_loop: - - movdqa xmm1, [rsi] - movdqa xmm2, [rdi] - - psubw xmm1, xmm2 - pmaddwd xmm1, xmm1 - - paddd xmm3, xmm1 - - add rsi, 16 - add rdi, 16 - - dec rcx - jnz .mbuverror_loop - - pxor xmm0, xmm0 - movdqa xmm1, xmm3 - - movdqa xmm2, xmm1 - punpckldq xmm1, xmm0 - - punpckhdq xmm2, xmm0 - paddd xmm1, xmm2 - - movdqa xmm2, xmm1 - - psrldq xmm1, 8 - paddd xmm1, xmm2 - - movq rax, xmm1 - - pop rdi - pop rsi - ; begin epilog - UNSHADOW_ARGS - pop rbp - ret diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/fwalsh_sse2.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/fwalsh_sse2.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/fwalsh_sse2.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/fwalsh_sse2.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,164 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -;void vp8_short_walsh4x4_sse2(short *input, short *output, int pitch) -global sym(vp8_short_walsh4x4_sse2) PRIVATE -sym(vp8_short_walsh4x4_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 3 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ; input - mov rdi, arg(1) ; output - movsxd rdx, dword ptr arg(2) ; pitch - - ; first for loop - movq xmm0, MMWORD PTR [rsi] ; load input - movq xmm1, MMWORD PTR [rsi + rdx] - lea rsi, [rsi + rdx*2] - movq xmm2, MMWORD PTR [rsi] - movq xmm3, MMWORD PTR [rsi + rdx] - - punpcklwd xmm0, xmm1 - punpcklwd xmm2, xmm3 - - movdqa xmm1, xmm0 - punpckldq xmm0, xmm2 ; ip[1] ip[0] - punpckhdq xmm1, xmm2 ; ip[3] ip[2] - - movdqa xmm2, xmm0 - paddw xmm0, xmm1 - psubw xmm2, xmm1 - - psllw xmm0, 2 ; d1 a1 - psllw xmm2, 2 ; c1 b1 - - movdqa xmm1, xmm0 - punpcklqdq xmm0, xmm2 ; b1 a1 - punpckhqdq xmm1, xmm2 ; c1 d1 - - pxor xmm6, xmm6 - movq xmm6, xmm0 - pxor xmm7, xmm7 - pcmpeqw xmm7, xmm6 - paddw xmm7, [GLOBAL(c1)] - - movdqa xmm2, xmm0 - paddw xmm0, xmm1 ; b1+c1 a1+d1 - psubw xmm2, xmm1 ; b1-c1 a1-d1 - paddw xmm0, xmm7 ; b1+c1 a1+d1+(a1!=0) - - ; second for loop - ; input: 13 9 5 1 12 8 4 0 (xmm0) - ; 14 10 6 2 15 11 7 3 (xmm2) - ; after shuffle: - ; 13 5 9 1 12 4 8 0 (xmm0) - ; 14 6 10 2 15 7 11 3 (xmm1) - pshuflw xmm3, xmm0, 0xd8 - pshufhw xmm0, xmm3, 0xd8 - pshuflw xmm3, xmm2, 0xd8 - pshufhw xmm1, xmm3, 0xd8 - - movdqa xmm2, xmm0 - pmaddwd xmm0, [GLOBAL(c1)] ; d11 a11 d10 a10 - pmaddwd xmm2, [GLOBAL(cn1)] ; c11 b11 c10 b10 - movdqa xmm3, xmm1 - pmaddwd xmm1, [GLOBAL(c1)] ; d12 a12 d13 a13 - pmaddwd xmm3, [GLOBAL(cn1)] ; c12 b12 c13 b13 - - pshufd xmm4, xmm0, 0xd8 ; d11 d10 a11 a10 - pshufd xmm5, xmm2, 0xd8 ; c11 c10 b11 b10 - pshufd xmm6, xmm1, 0x72 ; d13 d12 a13 a12 - pshufd xmm7, xmm3, 0x72 ; c13 c12 b13 b12 - - movdqa xmm0, xmm4 - punpcklqdq xmm0, xmm5 ; b11 b10 a11 a10 - punpckhqdq xmm4, xmm5 ; c11 c10 d11 d10 - movdqa xmm1, xmm6 - punpcklqdq xmm1, xmm7 ; b13 b12 a13 a12 - punpckhqdq xmm6, xmm7 ; c13 c12 d13 d12 - - movdqa xmm2, xmm0 - paddd xmm0, xmm4 ; b21 b20 a21 a20 - psubd xmm2, xmm4 ; c21 c20 d21 d20 - movdqa xmm3, xmm1 - paddd xmm1, xmm6 ; b23 b22 a23 a22 - psubd xmm3, xmm6 ; c23 c22 d23 d22 - - pxor xmm4, xmm4 - movdqa xmm5, xmm4 - pcmpgtd xmm4, xmm0 - pcmpgtd xmm5, xmm2 - pand xmm4, [GLOBAL(cd1)] - pand xmm5, [GLOBAL(cd1)] - - pxor xmm6, xmm6 - movdqa xmm7, xmm6 - pcmpgtd xmm6, xmm1 - pcmpgtd xmm7, xmm3 - pand xmm6, [GLOBAL(cd1)] - pand xmm7, [GLOBAL(cd1)] - - paddd xmm0, xmm4 - paddd xmm2, xmm5 - paddd xmm0, [GLOBAL(cd3)] - paddd xmm2, [GLOBAL(cd3)] - paddd xmm1, xmm6 - paddd xmm3, xmm7 - paddd xmm1, [GLOBAL(cd3)] - paddd xmm3, [GLOBAL(cd3)] - - psrad xmm0, 3 - psrad xmm1, 3 - psrad xmm2, 3 - psrad xmm3, 3 - movdqa xmm4, xmm0 - punpcklqdq xmm0, xmm1 ; a23 a22 a21 a20 - punpckhqdq xmm4, xmm1 ; b23 b22 b21 b20 - movdqa xmm5, xmm2 - punpckhqdq xmm2, xmm3 ; c23 c22 c21 c20 - punpcklqdq xmm5, xmm3 ; d23 d22 d21 d20 - - packssdw xmm0, xmm4 ; b23 b22 b21 b20 a23 a22 a21 a20 - packssdw xmm2, xmm5 ; d23 d22 d21 d20 c23 c22 c21 c20 - - movdqa XMMWORD PTR [rdi], xmm0 - movdqa XMMWORD PTR [rdi + 16], xmm2 - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -SECTION_RODATA -align 16 -c1: - dw 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001 -align 16 -cn1: - dw 0x0001, 0xffff, 0x0001, 0xffff, 0x0001, 0xffff, 0x0001, 0xffff -align 16 -cd1: - dd 0x00000001, 0x00000001, 0x00000001, 0x00000001 -align 16 -cd3: - dd 0x00000003, 0x00000003, 0x00000003, 0x00000003 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/quantize_mmx.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/quantize_mmx.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/quantize_mmx.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/quantize_mmx.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,286 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -;int vp8_fast_quantize_b_impl_mmx(short *coeff_ptr, short *zbin_ptr, -; short *qcoeff_ptr,short *dequant_ptr, -; short *scan_mask, short *round_ptr, -; short *quant_ptr, short *dqcoeff_ptr); -global sym(vp8_fast_quantize_b_impl_mmx) PRIVATE -sym(vp8_fast_quantize_b_impl_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 8 - push rsi - push rdi - ; end prolog - - - mov rsi, arg(0) ;coeff_ptr - movq mm0, [rsi] - - mov rax, arg(1) ;zbin_ptr - movq mm1, [rax] - - movq mm3, mm0 - psraw mm0, 15 - - pxor mm3, mm0 - psubw mm3, mm0 ; abs - - movq mm2, mm3 - pcmpgtw mm1, mm2 - - pandn mm1, mm2 - movq mm3, mm1 - - mov rdx, arg(6) ;quant_ptr - movq mm1, [rdx] - - mov rcx, arg(5) ;round_ptr - movq mm2, [rcx] - - paddw mm3, mm2 - pmulhuw mm3, mm1 - - pxor mm3, mm0 - psubw mm3, mm0 ;gain the sign back - - mov rdi, arg(2) ;qcoeff_ptr - movq mm0, mm3 - - movq [rdi], mm3 - - mov rax, arg(3) ;dequant_ptr - movq mm2, [rax] - - pmullw mm3, mm2 - mov rax, arg(7) ;dqcoeff_ptr - - movq [rax], mm3 - - ; next 8 - movq mm4, [rsi+8] - - mov rax, arg(1) ;zbin_ptr - movq mm5, [rax+8] - - movq mm7, mm4 - psraw mm4, 15 - - pxor mm7, mm4 - psubw mm7, mm4 ; abs - - movq mm6, mm7 - pcmpgtw mm5, mm6 - - pandn mm5, mm6 - movq mm7, mm5 - - movq mm5, [rdx+8] - movq mm6, [rcx+8] - - paddw mm7, mm6 - pmulhuw mm7, mm5 - - pxor mm7, mm4 - psubw mm7, mm4;gain the sign back - - mov rdi, arg(2) ;qcoeff_ptr - - movq mm1, mm7 - movq [rdi+8], mm7 - - mov rax, arg(3) ;dequant_ptr - movq mm6, [rax+8] - - pmullw mm7, mm6 - mov rax, arg(7) ;dqcoeff_ptr - - movq [rax+8], mm7 - - - ; next 8 - movq mm4, [rsi+16] - - mov rax, arg(1) ;zbin_ptr - movq mm5, [rax+16] - - movq mm7, mm4 - psraw mm4, 15 - - pxor mm7, mm4 - psubw mm7, mm4 ; abs - - movq mm6, mm7 - pcmpgtw mm5, mm6 - - pandn mm5, mm6 - movq mm7, mm5 - - movq mm5, [rdx+16] - movq mm6, [rcx+16] - - paddw mm7, mm6 - pmulhuw mm7, mm5 - - pxor mm7, mm4 - psubw mm7, mm4;gain the sign back - - mov rdi, arg(2) ;qcoeff_ptr - - movq mm1, mm7 - movq [rdi+16], mm7 - - mov rax, arg(3) ;dequant_ptr - movq mm6, [rax+16] - - pmullw mm7, mm6 - mov rax, arg(7) ;dqcoeff_ptr - - movq [rax+16], mm7 - - - ; next 8 - movq mm4, [rsi+24] - - mov rax, arg(1) ;zbin_ptr - movq mm5, [rax+24] - - movq mm7, mm4 - psraw mm4, 15 - - pxor mm7, mm4 - psubw mm7, mm4 ; abs - - movq mm6, mm7 - pcmpgtw mm5, mm6 - - pandn mm5, mm6 - movq mm7, mm5 - - movq mm5, [rdx+24] - movq mm6, [rcx+24] - - paddw mm7, mm6 - pmulhuw mm7, mm5 - - pxor mm7, mm4 - psubw mm7, mm4;gain the sign back - - mov rdi, arg(2) ;qcoeff_ptr - - movq mm1, mm7 - movq [rdi+24], mm7 - - mov rax, arg(3) ;dequant_ptr - movq mm6, [rax+24] - - pmullw mm7, mm6 - mov rax, arg(7) ;dqcoeff_ptr - - movq [rax+24], mm7 - - - - mov rdi, arg(4) ;scan_mask - mov rsi, arg(2) ;qcoeff_ptr - - pxor mm5, mm5 - pxor mm7, mm7 - - movq mm0, [rsi] - movq mm1, [rsi+8] - - movq mm2, [rdi] - movq mm3, [rdi+8]; - - pcmpeqw mm0, mm7 - pcmpeqw mm1, mm7 - - pcmpeqw mm6, mm6 - pxor mm0, mm6 - - pxor mm1, mm6 - psrlw mm0, 15 - - psrlw mm1, 15 - pmaddwd mm0, mm2 - - pmaddwd mm1, mm3 - movq mm5, mm0 - - paddd mm5, mm1 - - movq mm0, [rsi+16] - movq mm1, [rsi+24] - - movq mm2, [rdi+16] - movq mm3, [rdi+24]; - - pcmpeqw mm0, mm7 - pcmpeqw mm1, mm7 - - pcmpeqw mm6, mm6 - pxor mm0, mm6 - - pxor mm1, mm6 - psrlw mm0, 15 - - psrlw mm1, 15 - pmaddwd mm0, mm2 - - pmaddwd mm1, mm3 - paddd mm5, mm0 - - paddd mm5, mm1 - movq mm0, mm5 - - psrlq mm5, 32 - paddd mm0, mm5 - - ; eob adjustment begins here - movq rcx, mm0 - and rcx, 0xffff - - xor rdx, rdx - sub rdx, rcx ; rdx=-rcx - - bsr rax, rcx - inc rax - - sar rdx, 31 - and rax, rdx - ; Substitute the sse assembly for the old mmx mixed assembly/C. The - ; following is kept as reference - ; movq rcx, mm0 - ; bsr rax, rcx - ; - ; mov eob, rax - ; mov eee, rcx - ; - ;if(eee==0) - ;{ - ; eob=-1; - ;} - ;else if(eee<0) - ;{ - ; eob=15; - ;} - ;d->eob = eob+1; - - ; begin epilog - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/quantize_sse2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/quantize_sse2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/quantize_sse2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/quantize_sse2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,228 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "vpx_ports/x86.h" -#include "vpx_mem/vpx_mem.h" -#include "vp8/encoder/block.h" -#include "vp8/common/entropy.h" /* vp8_default_inv_zig_zag */ - -#include /* MMX */ -#include /* SSE */ -#include /* SSE2 */ - -#define SELECT_EOB(i, z) \ - do { \ - short boost = *zbin_boost_ptr; \ - int cmp = (x[z] < boost) | (y[z] == 0); \ - zbin_boost_ptr++; \ - if (cmp) \ - break; \ - qcoeff_ptr[z] = y[z]; \ - eob = i; \ - zbin_boost_ptr = b->zrun_zbin_boost; \ - } while (0) - -void vp8_regular_quantize_b_sse2(BLOCK *b, BLOCKD *d) -{ - char eob = 0; - short *zbin_boost_ptr = b->zrun_zbin_boost; - short *qcoeff_ptr = d->qcoeff; - DECLARE_ALIGNED_ARRAY(16, short, x, 16); - DECLARE_ALIGNED_ARRAY(16, short, y, 16); - - __m128i sz0, x0, sz1, x1, y0, y1, x_minus_zbin0, x_minus_zbin1; - __m128i quant_shift0 = _mm_load_si128((__m128i *)(b->quant_shift)); - __m128i quant_shift1 = _mm_load_si128((__m128i *)(b->quant_shift + 8)); - __m128i z0 = _mm_load_si128((__m128i *)(b->coeff)); - __m128i z1 = _mm_load_si128((__m128i *)(b->coeff+8)); - __m128i zbin_extra = _mm_cvtsi32_si128(b->zbin_extra); - __m128i zbin0 = _mm_load_si128((__m128i *)(b->zbin)); - __m128i zbin1 = _mm_load_si128((__m128i *)(b->zbin + 8)); - __m128i round0 = _mm_load_si128((__m128i *)(b->round)); - __m128i round1 = _mm_load_si128((__m128i *)(b->round + 8)); - __m128i quant0 = _mm_load_si128((__m128i *)(b->quant)); - __m128i quant1 = _mm_load_si128((__m128i *)(b->quant + 8)); - __m128i dequant0 = _mm_load_si128((__m128i *)(d->dequant)); - __m128i dequant1 = _mm_load_si128((__m128i *)(d->dequant + 8)); - - vpx_memset(qcoeff_ptr, 0, 32); - - /* Duplicate to all lanes. */ - zbin_extra = _mm_shufflelo_epi16(zbin_extra, 0); - zbin_extra = _mm_unpacklo_epi16(zbin_extra, zbin_extra); - - /* Sign of z: z >> 15 */ - sz0 = _mm_srai_epi16(z0, 15); - sz1 = _mm_srai_epi16(z1, 15); - - /* x = abs(z): (z ^ sz) - sz */ - x0 = _mm_xor_si128(z0, sz0); - x1 = _mm_xor_si128(z1, sz1); - x0 = _mm_sub_epi16(x0, sz0); - x1 = _mm_sub_epi16(x1, sz1); - - /* zbin[] + zbin_extra */ - zbin0 = _mm_add_epi16(zbin0, zbin_extra); - zbin1 = _mm_add_epi16(zbin1, zbin_extra); - - /* In C x is compared to zbin where zbin = zbin[] + boost + extra. Rebalance - * the equation because boost is the only value which can change: - * x - (zbin[] + extra) >= boost */ - x_minus_zbin0 = _mm_sub_epi16(x0, zbin0); - x_minus_zbin1 = _mm_sub_epi16(x1, zbin1); - - _mm_store_si128((__m128i *)(x), x_minus_zbin0); - _mm_store_si128((__m128i *)(x + 8), x_minus_zbin1); - - /* All the remaining calculations are valid whether they are done now with - * simd or later inside the loop one at a time. */ - x0 = _mm_add_epi16(x0, round0); - x1 = _mm_add_epi16(x1, round1); - - y0 = _mm_mulhi_epi16(x0, quant0); - y1 = _mm_mulhi_epi16(x1, quant1); - - y0 = _mm_add_epi16(y0, x0); - y1 = _mm_add_epi16(y1, x1); - - /* Instead of shifting each value independently we convert the scaling - * factor with 1 << (16 - shift) so we can use multiply/return high half. */ - y0 = _mm_mulhi_epi16(y0, quant_shift0); - y1 = _mm_mulhi_epi16(y1, quant_shift1); - - /* Return the sign: (y ^ sz) - sz */ - y0 = _mm_xor_si128(y0, sz0); - y1 = _mm_xor_si128(y1, sz1); - y0 = _mm_sub_epi16(y0, sz0); - y1 = _mm_sub_epi16(y1, sz1); - - _mm_store_si128((__m128i *)(y), y0); - _mm_store_si128((__m128i *)(y + 8), y1); - - zbin_boost_ptr = b->zrun_zbin_boost; - - /* The loop gets unrolled anyway. Avoid the vp8_default_zig_zag1d lookup. */ - SELECT_EOB(1, 0); - SELECT_EOB(2, 1); - SELECT_EOB(3, 4); - SELECT_EOB(4, 8); - SELECT_EOB(5, 5); - SELECT_EOB(6, 2); - SELECT_EOB(7, 3); - SELECT_EOB(8, 6); - SELECT_EOB(9, 9); - SELECT_EOB(10, 12); - SELECT_EOB(11, 13); - SELECT_EOB(12, 10); - SELECT_EOB(13, 7); - SELECT_EOB(14, 11); - SELECT_EOB(15, 14); - SELECT_EOB(16, 15); - - y0 = _mm_load_si128((__m128i *)(d->qcoeff)); - y1 = _mm_load_si128((__m128i *)(d->qcoeff + 8)); - - /* dqcoeff = qcoeff * dequant */ - y0 = _mm_mullo_epi16(y0, dequant0); - y1 = _mm_mullo_epi16(y1, dequant1); - - _mm_store_si128((__m128i *)(d->dqcoeff), y0); - _mm_store_si128((__m128i *)(d->dqcoeff + 8), y1); - - *d->eob = eob; -} - -void vp8_fast_quantize_b_sse2(BLOCK *b, BLOCKD *d) -{ - __m128i z0 = _mm_load_si128((__m128i *)(b->coeff)); - __m128i z1 = _mm_load_si128((__m128i *)(b->coeff + 8)); - __m128i round0 = _mm_load_si128((__m128i *)(b->round)); - __m128i round1 = _mm_load_si128((__m128i *)(b->round + 8)); - __m128i quant_fast0 = _mm_load_si128((__m128i *)(b->quant_fast)); - __m128i quant_fast1 = _mm_load_si128((__m128i *)(b->quant_fast + 8)); - __m128i dequant0 = _mm_load_si128((__m128i *)(d->dequant)); - __m128i dequant1 = _mm_load_si128((__m128i *)(d->dequant + 8)); - __m128i inv_zig_zag0 = _mm_load_si128((const __m128i *)(vp8_default_inv_zig_zag)); - __m128i inv_zig_zag1 = _mm_load_si128((const __m128i *)(vp8_default_inv_zig_zag + 8)); - - __m128i sz0, sz1, x0, x1, y0, y1, xdq0, xdq1, zeros, ones; - - /* sign of z: z >> 15 */ - sz0 = _mm_srai_epi16(z0, 15); - sz1 = _mm_srai_epi16(z1, 15); - - /* x = abs(z): (z ^ sz) - sz */ - x0 = _mm_xor_si128(z0, sz0); - x1 = _mm_xor_si128(z1, sz1); - x0 = _mm_sub_epi16(x0, sz0); - x1 = _mm_sub_epi16(x1, sz1); - - /* x += round */ - x0 = _mm_add_epi16(x0, round0); - x1 = _mm_add_epi16(x1, round1); - - /* y = (x * quant) >> 16 */ - y0 = _mm_mulhi_epi16(x0, quant_fast0); - y1 = _mm_mulhi_epi16(x1, quant_fast1); - - /* x = abs(y) = (y ^ sz) - sz */ - y0 = _mm_xor_si128(y0, sz0); - y1 = _mm_xor_si128(y1, sz1); - x0 = _mm_sub_epi16(y0, sz0); - x1 = _mm_sub_epi16(y1, sz1); - - /* qcoeff = x */ - _mm_store_si128((__m128i *)(d->qcoeff), x0); - _mm_store_si128((__m128i *)(d->qcoeff + 8), x1); - - /* x * dequant */ - xdq0 = _mm_mullo_epi16(x0, dequant0); - xdq1 = _mm_mullo_epi16(x1, dequant1); - - /* dqcoeff = x * dequant */ - _mm_store_si128((__m128i *)(d->dqcoeff), xdq0); - _mm_store_si128((__m128i *)(d->dqcoeff + 8), xdq1); - - /* build a mask for the zig zag */ - zeros = _mm_setzero_si128(); - - x0 = _mm_cmpeq_epi16(x0, zeros); - x1 = _mm_cmpeq_epi16(x1, zeros); - - ones = _mm_cmpeq_epi16(zeros, zeros); - - x0 = _mm_xor_si128(x0, ones); - x1 = _mm_xor_si128(x1, ones); - - x0 = _mm_and_si128(x0, inv_zig_zag0); - x1 = _mm_and_si128(x1, inv_zig_zag1); - - x0 = _mm_max_epi16(x0, x1); - - /* now down to 8 */ - x1 = _mm_shuffle_epi32(x0, 0xE); // 0b00001110 - - x0 = _mm_max_epi16(x0, x1); - - /* only 4 left */ - x1 = _mm_shufflelo_epi16(x0, 0xE); // 0b00001110 - - x0 = _mm_max_epi16(x0, x1); - - /* okay, just 2! */ - x1 = _mm_shufflelo_epi16(x0, 0x1); // 0b00000001 - - x0 = _mm_max_epi16(x0, x1); - - *d->eob = 0xFF & _mm_cvtsi128_si32(x0); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/quantize_sse4.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/quantize_sse4.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/quantize_sse4.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/quantize_sse4.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include /* SSE4.1 */ - -#include "./vp8_rtcd.h" -#include "vp8/encoder/block.h" -#include "vp8/common/entropy.h" /* vp8_default_inv_zig_zag */ - -#define SELECT_EOB(i, z, x, y, q) \ - do { \ - short boost = *zbin_boost_ptr; \ - short x_z = _mm_extract_epi16(x, z); \ - short y_z = _mm_extract_epi16(y, z); \ - int cmp = (x_z < boost) | (y_z == 0); \ - zbin_boost_ptr++; \ - if (cmp) \ - break; \ - q = _mm_insert_epi16(q, y_z, z); \ - eob = i; \ - zbin_boost_ptr = b->zrun_zbin_boost; \ - } while (0) - -void vp8_regular_quantize_b_sse4_1(BLOCK *b, BLOCKD *d) { - char eob = 0; - short *zbin_boost_ptr = b->zrun_zbin_boost; - - __m128i sz0, x0, sz1, x1, y0, y1, x_minus_zbin0, x_minus_zbin1, - dqcoeff0, dqcoeff1; - __m128i quant_shift0 = _mm_load_si128((__m128i *)(b->quant_shift)); - __m128i quant_shift1 = _mm_load_si128((__m128i *)(b->quant_shift + 8)); - __m128i z0 = _mm_load_si128((__m128i *)(b->coeff)); - __m128i z1 = _mm_load_si128((__m128i *)(b->coeff+8)); - __m128i zbin_extra = _mm_cvtsi32_si128(b->zbin_extra); - __m128i zbin0 = _mm_load_si128((__m128i *)(b->zbin)); - __m128i zbin1 = _mm_load_si128((__m128i *)(b->zbin + 8)); - __m128i round0 = _mm_load_si128((__m128i *)(b->round)); - __m128i round1 = _mm_load_si128((__m128i *)(b->round + 8)); - __m128i quant0 = _mm_load_si128((__m128i *)(b->quant)); - __m128i quant1 = _mm_load_si128((__m128i *)(b->quant + 8)); - __m128i dequant0 = _mm_load_si128((__m128i *)(d->dequant)); - __m128i dequant1 = _mm_load_si128((__m128i *)(d->dequant + 8)); - __m128i qcoeff0 = _mm_setzero_si128(); - __m128i qcoeff1 = _mm_setzero_si128(); - - /* Duplicate to all lanes. */ - zbin_extra = _mm_shufflelo_epi16(zbin_extra, 0); - zbin_extra = _mm_unpacklo_epi16(zbin_extra, zbin_extra); - - /* Sign of z: z >> 15 */ - sz0 = _mm_srai_epi16(z0, 15); - sz1 = _mm_srai_epi16(z1, 15); - - /* x = abs(z): (z ^ sz) - sz */ - x0 = _mm_xor_si128(z0, sz0); - x1 = _mm_xor_si128(z1, sz1); - x0 = _mm_sub_epi16(x0, sz0); - x1 = _mm_sub_epi16(x1, sz1); - - /* zbin[] + zbin_extra */ - zbin0 = _mm_add_epi16(zbin0, zbin_extra); - zbin1 = _mm_add_epi16(zbin1, zbin_extra); - - /* In C x is compared to zbin where zbin = zbin[] + boost + extra. Rebalance - * the equation because boost is the only value which can change: - * x - (zbin[] + extra) >= boost */ - x_minus_zbin0 = _mm_sub_epi16(x0, zbin0); - x_minus_zbin1 = _mm_sub_epi16(x1, zbin1); - - /* All the remaining calculations are valid whether they are done now with - * simd or later inside the loop one at a time. */ - x0 = _mm_add_epi16(x0, round0); - x1 = _mm_add_epi16(x1, round1); - - y0 = _mm_mulhi_epi16(x0, quant0); - y1 = _mm_mulhi_epi16(x1, quant1); - - y0 = _mm_add_epi16(y0, x0); - y1 = _mm_add_epi16(y1, x1); - - /* Instead of shifting each value independently we convert the scaling - * factor with 1 << (16 - shift) so we can use multiply/return high half. */ - y0 = _mm_mulhi_epi16(y0, quant_shift0); - y1 = _mm_mulhi_epi16(y1, quant_shift1); - - /* Return the sign: (y ^ sz) - sz */ - y0 = _mm_xor_si128(y0, sz0); - y1 = _mm_xor_si128(y1, sz1); - y0 = _mm_sub_epi16(y0, sz0); - y1 = _mm_sub_epi16(y1, sz1); - - /* The loop gets unrolled anyway. Avoid the vp8_default_zig_zag1d lookup. */ - SELECT_EOB(1, 0, x_minus_zbin0, y0, qcoeff0); - SELECT_EOB(2, 1, x_minus_zbin0, y0, qcoeff0); - SELECT_EOB(3, 4, x_minus_zbin0, y0, qcoeff0); - SELECT_EOB(4, 0, x_minus_zbin1, y1, qcoeff1); - SELECT_EOB(5, 5, x_minus_zbin0, y0, qcoeff0); - SELECT_EOB(6, 2, x_minus_zbin0, y0, qcoeff0); - SELECT_EOB(7, 3, x_minus_zbin0, y0, qcoeff0); - SELECT_EOB(8, 6, x_minus_zbin0, y0, qcoeff0); - SELECT_EOB(9, 1, x_minus_zbin1, y1, qcoeff1); - SELECT_EOB(10, 4, x_minus_zbin1, y1, qcoeff1); - SELECT_EOB(11, 5, x_minus_zbin1, y1, qcoeff1); - SELECT_EOB(12, 2, x_minus_zbin1, y1, qcoeff1); - SELECT_EOB(13, 7, x_minus_zbin0, y0, qcoeff0); - SELECT_EOB(14, 3, x_minus_zbin1, y1, qcoeff1); - SELECT_EOB(15, 6, x_minus_zbin1, y1, qcoeff1); - SELECT_EOB(16, 7, x_minus_zbin1, y1, qcoeff1); - - _mm_store_si128((__m128i *)(d->qcoeff), qcoeff0); - _mm_store_si128((__m128i *)(d->qcoeff + 8), qcoeff1); - - dqcoeff0 = _mm_mullo_epi16(qcoeff0, dequant0); - dqcoeff1 = _mm_mullo_epi16(qcoeff1, dequant1); - - _mm_store_si128((__m128i *)(d->dqcoeff), dqcoeff0); - _mm_store_si128((__m128i *)(d->dqcoeff + 8), dqcoeff1); - - *d->eob = eob; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/quantize_ssse3.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/quantize_ssse3.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/quantize_ssse3.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/quantize_ssse3.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,114 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include /* SSSE3 */ - -#include "vp8/encoder/block.h" - -/* bitscan reverse (bsr) */ -#if defined(_MSC_VER) -#include -#pragma intrinsic(_BitScanReverse) -static int bsr(int mask) { - int eob; - _BitScanReverse(&eob, mask); - eob++; - if (mask == 0) - eob = 0; - return eob; -} -#else -static int bsr(int mask) { - int eob; -#if defined(__GNUC__) && __GNUC__ - __asm__ __volatile__("bsr %1, %0" : "=r" (eob) : "r" (mask) : "flags"); -#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) - asm volatile("bsr %1, %0" : "=r" (eob) : "r" (mask) : "flags"); -#endif - eob++; - if (mask == 0) - eob = 0; - return eob; -} -#endif - -void vp8_fast_quantize_b_ssse3(BLOCK *b, BLOCKD *d) { - int eob, mask; - - __m128i z0 = _mm_load_si128((__m128i *)(b->coeff)); - __m128i z1 = _mm_load_si128((__m128i *)(b->coeff + 8)); - __m128i round0 = _mm_load_si128((__m128i *)(b->round)); - __m128i round1 = _mm_load_si128((__m128i *)(b->round + 8)); - __m128i quant_fast0 = _mm_load_si128((__m128i *)(b->quant_fast)); - __m128i quant_fast1 = _mm_load_si128((__m128i *)(b->quant_fast + 8)); - __m128i dequant0 = _mm_load_si128((__m128i *)(d->dequant)); - __m128i dequant1 = _mm_load_si128((__m128i *)(d->dequant + 8)); - - __m128i sz0, sz1, x, x0, x1, y0, y1, zeros, abs0, abs1; - - DECLARE_ALIGNED(16, const uint8_t, pshufb_zig_zag_mask[16]) = - { 0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15 }; - __m128i zig_zag = _mm_load_si128((const __m128i *)pshufb_zig_zag_mask); - - /* sign of z: z >> 15 */ - sz0 = _mm_srai_epi16(z0, 15); - sz1 = _mm_srai_epi16(z1, 15); - - /* x = abs(z) */ - x0 = _mm_abs_epi16(z0); - x1 = _mm_abs_epi16(z1); - - /* x += round */ - x0 = _mm_add_epi16(x0, round0); - x1 = _mm_add_epi16(x1, round1); - - /* y = (x * quant) >> 16 */ - y0 = _mm_mulhi_epi16(x0, quant_fast0); - y1 = _mm_mulhi_epi16(x1, quant_fast1); - - /* ASM saves Y for EOB */ - /* I think we can ignore that because adding the sign doesn't change anything - * and multiplying 0 by dequant is OK as well */ - abs0 = y0; - abs1 = y1; - - /* Restore the sign bit. */ - y0 = _mm_xor_si128(y0, sz0); - y1 = _mm_xor_si128(y1, sz1); - x0 = _mm_sub_epi16(y0, sz0); - x1 = _mm_sub_epi16(y1, sz1); - - /* qcoeff = x */ - _mm_store_si128((__m128i *)(d->qcoeff), x0); - _mm_store_si128((__m128i *)(d->qcoeff + 8), x1); - - /* x * dequant */ - x0 = _mm_mullo_epi16(x0, dequant0); - x1 = _mm_mullo_epi16(x1, dequant1); - - /* dqcoeff = x * dequant */ - _mm_store_si128((__m128i *)(d->dqcoeff), x0); - _mm_store_si128((__m128i *)(d->dqcoeff + 8), x1); - - zeros = _mm_setzero_si128(); - - x0 = _mm_cmpgt_epi16(abs0, zeros); - x1 = _mm_cmpgt_epi16(abs1, zeros); - - x = _mm_packs_epi16(x0, x1); - - x = _mm_shuffle_epi8(x, zig_zag); - - mask = _mm_movemask_epi8(x); - - eob = bsr(mask); - - *d->eob = 0xFF & eob; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/ssim_opt_x86_64.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/ssim_opt_x86_64.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/ssim_opt_x86_64.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/ssim_opt_x86_64.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,216 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - -%include "vpx_ports/x86_abi_support.asm" - -; tabulate_ssim - sums sum_s,sum_r,sum_sq_s,sum_sq_r, sum_sxr -%macro TABULATE_SSIM 0 - paddusw xmm15, xmm3 ; sum_s - paddusw xmm14, xmm4 ; sum_r - movdqa xmm1, xmm3 - pmaddwd xmm1, xmm1 - paddd xmm13, xmm1 ; sum_sq_s - movdqa xmm2, xmm4 - pmaddwd xmm2, xmm2 - paddd xmm12, xmm2 ; sum_sq_r - pmaddwd xmm3, xmm4 - paddd xmm11, xmm3 ; sum_sxr -%endmacro - -; Sum across the register %1 starting with q words -%macro SUM_ACROSS_Q 1 - movdqa xmm2,%1 - punpckldq %1,xmm0 - punpckhdq xmm2,xmm0 - paddq %1,xmm2 - movdqa xmm2,%1 - punpcklqdq %1,xmm0 - punpckhqdq xmm2,xmm0 - paddq %1,xmm2 -%endmacro - -; Sum across the register %1 starting with q words -%macro SUM_ACROSS_W 1 - movdqa xmm1, %1 - punpcklwd %1,xmm0 - punpckhwd xmm1,xmm0 - paddd %1, xmm1 - SUM_ACROSS_Q %1 -%endmacro -;void ssim_parms_sse2( -; unsigned char *s, -; int sp, -; unsigned char *r, -; int rp -; unsigned long *sum_s, -; unsigned long *sum_r, -; unsigned long *sum_sq_s, -; unsigned long *sum_sq_r, -; unsigned long *sum_sxr); -; -; TODO: Use parm passing through structure, probably don't need the pxors -; ( calling app will initialize to 0 ) could easily fit everything in sse2 -; without too much hastle, and can probably do better estimates with psadw -; or pavgb At this point this is just meant to be first pass for calculating -; all the parms needed for 16x16 ssim so we can play with dssim as distortion -; in mode selection code. -global sym(vp8_ssim_parms_16x16_sse2) PRIVATE -sym(vp8_ssim_parms_16x16_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 9 - SAVE_XMM 15 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;s - mov rcx, arg(1) ;sp - mov rdi, arg(2) ;r - mov rax, arg(3) ;rp - - pxor xmm0, xmm0 - pxor xmm15,xmm15 ;sum_s - pxor xmm14,xmm14 ;sum_r - pxor xmm13,xmm13 ;sum_sq_s - pxor xmm12,xmm12 ;sum_sq_r - pxor xmm11,xmm11 ;sum_sxr - - mov rdx, 16 ;row counter -.NextRow: - - ;grab source and reference pixels - movdqu xmm5, [rsi] - movdqu xmm6, [rdi] - movdqa xmm3, xmm5 - movdqa xmm4, xmm6 - punpckhbw xmm3, xmm0 ; high_s - punpckhbw xmm4, xmm0 ; high_r - - TABULATE_SSIM - - movdqa xmm3, xmm5 - movdqa xmm4, xmm6 - punpcklbw xmm3, xmm0 ; low_s - punpcklbw xmm4, xmm0 ; low_r - - TABULATE_SSIM - - add rsi, rcx ; next s row - add rdi, rax ; next r row - - dec rdx ; counter - jnz .NextRow - - SUM_ACROSS_W xmm15 - SUM_ACROSS_W xmm14 - SUM_ACROSS_Q xmm13 - SUM_ACROSS_Q xmm12 - SUM_ACROSS_Q xmm11 - - mov rdi,arg(4) - movd [rdi], xmm15; - mov rdi,arg(5) - movd [rdi], xmm14; - mov rdi,arg(6) - movd [rdi], xmm13; - mov rdi,arg(7) - movd [rdi], xmm12; - mov rdi,arg(8) - movd [rdi], xmm11; - - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -;void ssim_parms_sse2( -; unsigned char *s, -; int sp, -; unsigned char *r, -; int rp -; unsigned long *sum_s, -; unsigned long *sum_r, -; unsigned long *sum_sq_s, -; unsigned long *sum_sq_r, -; unsigned long *sum_sxr); -; -; TODO: Use parm passing through structure, probably don't need the pxors -; ( calling app will initialize to 0 ) could easily fit everything in sse2 -; without too much hastle, and can probably do better estimates with psadw -; or pavgb At this point this is just meant to be first pass for calculating -; all the parms needed for 16x16 ssim so we can play with dssim as distortion -; in mode selection code. -global sym(vp8_ssim_parms_8x8_sse2) PRIVATE -sym(vp8_ssim_parms_8x8_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 9 - SAVE_XMM 15 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;s - mov rcx, arg(1) ;sp - mov rdi, arg(2) ;r - mov rax, arg(3) ;rp - - pxor xmm0, xmm0 - pxor xmm15,xmm15 ;sum_s - pxor xmm14,xmm14 ;sum_r - pxor xmm13,xmm13 ;sum_sq_s - pxor xmm12,xmm12 ;sum_sq_r - pxor xmm11,xmm11 ;sum_sxr - - mov rdx, 8 ;row counter -.NextRow: - - ;grab source and reference pixels - movq xmm3, [rsi] - movq xmm4, [rdi] - punpcklbw xmm3, xmm0 ; low_s - punpcklbw xmm4, xmm0 ; low_r - - TABULATE_SSIM - - add rsi, rcx ; next s row - add rdi, rax ; next r row - - dec rdx ; counter - jnz .NextRow - - SUM_ACROSS_W xmm15 - SUM_ACROSS_W xmm14 - SUM_ACROSS_Q xmm13 - SUM_ACROSS_Q xmm12 - SUM_ACROSS_Q xmm11 - - mov rdi,arg(4) - movd [rdi], xmm15; - mov rdi,arg(5) - movd [rdi], xmm14; - mov rdi,arg(6) - movd [rdi], xmm13; - mov rdi,arg(7) - movd [rdi], xmm12; - mov rdi,arg(8) - movd [rdi], xmm11; - - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/subtract_mmx.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/subtract_mmx.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/subtract_mmx.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/subtract_mmx.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,223 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -;void vp8_subtract_b_mmx_impl(unsigned char *z, int src_stride, -; short *diff, unsigned char *Predictor, -; int pitch); -global sym(vp8_subtract_b_mmx_impl) PRIVATE -sym(vp8_subtract_b_mmx_impl): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - push rsi - push rdi - ; end prolog - - - mov rdi, arg(2) ;diff - mov rax, arg(3) ;Predictor - mov rsi, arg(0) ;z - movsxd rdx, dword ptr arg(1);src_stride; - movsxd rcx, dword ptr arg(4);pitch - pxor mm7, mm7 - - movd mm0, [rsi] - movd mm1, [rax] - punpcklbw mm0, mm7 - punpcklbw mm1, mm7 - psubw mm0, mm1 - movq [rdi], mm0 - - - movd mm0, [rsi+rdx] - movd mm1, [rax+rcx] - punpcklbw mm0, mm7 - punpcklbw mm1, mm7 - psubw mm0, mm1 - movq [rdi+rcx*2],mm0 - - - movd mm0, [rsi+rdx*2] - movd mm1, [rax+rcx*2] - punpcklbw mm0, mm7 - punpcklbw mm1, mm7 - psubw mm0, mm1 - movq [rdi+rcx*4], mm0 - - lea rsi, [rsi+rdx*2] - lea rcx, [rcx+rcx*2] - - - - movd mm0, [rsi+rdx] - movd mm1, [rax+rcx] - punpcklbw mm0, mm7 - punpcklbw mm1, mm7 - psubw mm0, mm1 - movq [rdi+rcx*2], mm0 - - ; begin epilog - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret - -;void vp8_subtract_mby_mmx(short *diff, unsigned char *src, int src_stride, -;unsigned char *pred, int pred_stride) -global sym(vp8_subtract_mby_mmx) PRIVATE -sym(vp8_subtract_mby_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - push rsi - push rdi - ; end prolog - - mov rdi, arg(0) ;diff - mov rsi, arg(1) ;src - movsxd rdx, dword ptr arg(2);src_stride - mov rax, arg(3) ;pred - push rbx - movsxd rbx, dword ptr arg(4);pred_stride - - pxor mm0, mm0 - mov rcx, 16 - - -.submby_loop: - movq mm1, [rsi] - movq mm3, [rax] - - movq mm2, mm1 - movq mm4, mm3 - - punpcklbw mm1, mm0 - punpcklbw mm3, mm0 - - punpckhbw mm2, mm0 - punpckhbw mm4, mm0 - - psubw mm1, mm3 - psubw mm2, mm4 - - movq [rdi], mm1 - movq [rdi+8], mm2 - - movq mm1, [rsi+8] - movq mm3, [rax+8] - - movq mm2, mm1 - movq mm4, mm3 - - punpcklbw mm1, mm0 - punpcklbw mm3, mm0 - - punpckhbw mm2, mm0 - punpckhbw mm4, mm0 - - psubw mm1, mm3 - psubw mm2, mm4 - - movq [rdi+16], mm1 - movq [rdi+24], mm2 - add rdi, 32 - lea rax, [rax+rbx] - lea rsi, [rsi+rdx] - dec rcx - jnz .submby_loop - - pop rbx - pop rdi - pop rsi - ; begin epilog - UNSHADOW_ARGS - pop rbp - ret - - -;vp8_subtract_mbuv_mmx(short *diff, unsigned char *usrc, unsigned char *vsrc, -; int src_stride, unsigned char *upred, -; unsigned char *vpred, int pred_stride) - -global sym(vp8_subtract_mbuv_mmx) PRIVATE -sym(vp8_subtract_mbuv_mmx): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - push rsi - push rdi - ; end prolog - - mov rdi, arg(0) ;diff - mov rsi, arg(1) ;usrc - movsxd rdx, dword ptr arg(3);src_stride; - mov rax, arg(4) ;upred - add rdi, 256*2 ;diff = diff + 256 (shorts) - mov rcx, 8 - push rbx - movsxd rbx, dword ptr arg(6);pred_stride - - pxor mm7, mm7 - -.submbu_loop: - movq mm0, [rsi] - movq mm1, [rax] - movq mm3, mm0 - movq mm4, mm1 - punpcklbw mm0, mm7 - punpcklbw mm1, mm7 - punpckhbw mm3, mm7 - punpckhbw mm4, mm7 - psubw mm0, mm1 - psubw mm3, mm4 - movq [rdi], mm0 - movq [rdi+8], mm3 - add rdi, 16 - add rsi, rdx - add rax, rbx - - dec rcx - jnz .submbu_loop - - mov rsi, arg(2) ;vsrc - mov rax, arg(5) ;vpred - mov rcx, 8 - -.submbv_loop: - movq mm0, [rsi] - movq mm1, [rax] - movq mm3, mm0 - movq mm4, mm1 - punpcklbw mm0, mm7 - punpcklbw mm1, mm7 - punpckhbw mm3, mm7 - punpckhbw mm4, mm7 - psubw mm0, mm1 - psubw mm3, mm4 - movq [rdi], mm0 - movq [rdi+8], mm3 - add rdi, 16 - add rsi, rdx - add rax, rbx - - dec rcx - jnz .submbv_loop - - pop rbx - ; begin epilog - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/subtract_sse2.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/subtract_sse2.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/subtract_sse2.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/subtract_sse2.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,245 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -;void vp8_subtract_b_sse2_impl(unsigned char *z, int src_stride, -; short *diff, unsigned char *Predictor, -; int pitch); -global sym(vp8_subtract_b_sse2_impl) PRIVATE -sym(vp8_subtract_b_sse2_impl): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - mov rdi, arg(2) ;diff - mov rax, arg(3) ;Predictor - mov rsi, arg(0) ;z - movsxd rdx, dword ptr arg(1);src_stride; - movsxd rcx, dword ptr arg(4);pitch - pxor mm7, mm7 - - movd mm0, [rsi] - movd mm1, [rax] - punpcklbw mm0, mm7 - punpcklbw mm1, mm7 - psubw mm0, mm1 - movq MMWORD PTR [rdi], mm0 - - movd mm0, [rsi+rdx] - movd mm1, [rax+rcx] - punpcklbw mm0, mm7 - punpcklbw mm1, mm7 - psubw mm0, mm1 - movq MMWORD PTR [rdi+rcx*2], mm0 - - movd mm0, [rsi+rdx*2] - movd mm1, [rax+rcx*2] - punpcklbw mm0, mm7 - punpcklbw mm1, mm7 - psubw mm0, mm1 - movq MMWORD PTR [rdi+rcx*4], mm0 - - lea rsi, [rsi+rdx*2] - lea rcx, [rcx+rcx*2] - - movd mm0, [rsi+rdx] - movd mm1, [rax+rcx] - punpcklbw mm0, mm7 - punpcklbw mm1, mm7 - psubw mm0, mm1 - movq MMWORD PTR [rdi+rcx*2], mm0 - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - - -;void vp8_subtract_mby_sse2(short *diff, unsigned char *src, int src_stride, -;unsigned char *pred, int pred_stride) -global sym(vp8_subtract_mby_sse2) PRIVATE -sym(vp8_subtract_mby_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - mov rdi, arg(0) ;diff - mov rsi, arg(1) ;src - movsxd rdx, dword ptr arg(2);src_stride - mov rax, arg(3) ;pred - movdqa xmm4, [GLOBAL(t80)] - push rbx - mov rcx, 8 ; do two lines at one time - movsxd rbx, dword ptr arg(4);pred_stride - -.submby_loop: - movdqa xmm0, [rsi] ; src - movdqa xmm1, [rax] ; pred - - movdqa xmm2, xmm0 - psubb xmm0, xmm1 - - pxor xmm1, xmm4 ;convert to signed values - pxor xmm2, xmm4 - pcmpgtb xmm1, xmm2 ; obtain sign information - - movdqa xmm2, xmm0 - punpcklbw xmm0, xmm1 ; put sign back to subtraction - punpckhbw xmm2, xmm1 ; put sign back to subtraction - - movdqa xmm3, [rsi + rdx] - movdqa xmm5, [rax + rbx] - - lea rsi, [rsi+rdx*2] - lea rax, [rax+rbx*2] - - movdqa [rdi], xmm0 - movdqa [rdi +16], xmm2 - - movdqa xmm1, xmm3 - psubb xmm3, xmm5 - - pxor xmm5, xmm4 ;convert to signed values - pxor xmm1, xmm4 - pcmpgtb xmm5, xmm1 ; obtain sign information - - movdqa xmm1, xmm3 - punpcklbw xmm3, xmm5 ; put sign back to subtraction - punpckhbw xmm1, xmm5 ; put sign back to subtraction - - movdqa [rdi +32], xmm3 - movdqa [rdi +48], xmm1 - - add rdi, 64 - dec rcx - jnz .submby_loop - - pop rbx - pop rdi - pop rsi - ; begin epilog - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - -;vp8_subtract_mbuv_sse2(short *diff, unsigned char *usrc, unsigned char *vsrc, -; int src_stride, unsigned char *upred, -; unsigned char *vpred, int pred_stride) -global sym(vp8_subtract_mbuv_sse2) PRIVATE -sym(vp8_subtract_mbuv_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - GET_GOT rbx - push rsi - push rdi - ; end prolog - - movdqa xmm4, [GLOBAL(t80)] - mov rdi, arg(0) ;diff - mov rsi, arg(1) ;usrc - movsxd rdx, dword ptr arg(3);src_stride; - mov rax, arg(4) ;upred - add rdi, 256*2 ;diff = diff + 256 (shorts) - mov rcx, 4 - push rbx - movsxd rbx, dword ptr arg(6);pred_stride - - ;u -.submbu_loop: - movq xmm0, [rsi] ; src - movq xmm2, [rsi+rdx] ; src -- next line - movq xmm1, [rax] ; pred - movq xmm3, [rax+rbx] ; pred -- next line - lea rsi, [rsi + rdx*2] - lea rax, [rax + rbx*2] - - punpcklqdq xmm0, xmm2 - punpcklqdq xmm1, xmm3 - - movdqa xmm2, xmm0 - psubb xmm0, xmm1 ; subtraction with sign missed - - pxor xmm1, xmm4 ;convert to signed values - pxor xmm2, xmm4 - pcmpgtb xmm1, xmm2 ; obtain sign information - - movdqa xmm2, xmm0 - movdqa xmm3, xmm1 - punpcklbw xmm0, xmm1 ; put sign back to subtraction - punpckhbw xmm2, xmm3 ; put sign back to subtraction - - movdqa [rdi], xmm0 ; store difference - movdqa [rdi +16], xmm2 ; store difference - add rdi, 32 - sub rcx, 1 - jnz .submbu_loop - - mov rsi, arg(2) ;vsrc - mov rax, arg(5) ;vpred - mov rcx, 4 - - ;v -.submbv_loop: - movq xmm0, [rsi] ; src - movq xmm2, [rsi+rdx] ; src -- next line - movq xmm1, [rax] ; pred - movq xmm3, [rax+rbx] ; pred -- next line - lea rsi, [rsi + rdx*2] - lea rax, [rax + rbx*2] - - punpcklqdq xmm0, xmm2 - punpcklqdq xmm1, xmm3 - - movdqa xmm2, xmm0 - psubb xmm0, xmm1 ; subtraction with sign missed - - pxor xmm1, xmm4 ;convert to signed values - pxor xmm2, xmm4 - pcmpgtb xmm1, xmm2 ; obtain sign information - - movdqa xmm2, xmm0 - movdqa xmm3, xmm1 - punpcklbw xmm0, xmm1 ; put sign back to subtraction - punpckhbw xmm2, xmm3 ; put sign back to subtraction - - movdqa [rdi], xmm0 ; store difference - movdqa [rdi +16], xmm2 ; store difference - add rdi, 32 - sub rcx, 1 - jnz .submbv_loop - - pop rbx - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - -SECTION_RODATA -align 16 -t80: - times 16 db 0x80 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/temporal_filter_apply_sse2.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/temporal_filter_apply_sse2.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/temporal_filter_apply_sse2.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/temporal_filter_apply_sse2.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,207 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -; void vp8_temporal_filter_apply_sse2 | arg -; (unsigned char *frame1, | 0 -; unsigned int stride, | 1 -; unsigned char *frame2, | 2 -; unsigned int block_size, | 3 -; int strength, | 4 -; int filter_weight, | 5 -; unsigned int *accumulator, | 6 -; unsigned short *count) | 7 -global sym(vp8_temporal_filter_apply_sse2) PRIVATE -sym(vp8_temporal_filter_apply_sse2): - - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 8 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ALIGN_STACK 16, rax - %define block_size 0 - %define strength 16 - %define filter_weight 32 - %define rounding_bit 48 - %define rbp_backup 64 - %define stack_size 80 - sub rsp, stack_size - mov [rsp + rbp_backup], rbp - ; end prolog - - mov rdx, arg(3) - mov [rsp + block_size], rdx - movd xmm6, arg(4) - movdqa [rsp + strength], xmm6 ; where strength is used, all 16 bytes are read - - ; calculate the rounding bit outside the loop - ; 0x8000 >> (16 - strength) - mov rdx, 16 - sub rdx, arg(4) ; 16 - strength - movq xmm4, rdx ; can't use rdx w/ shift - movdqa xmm5, [GLOBAL(_const_top_bit)] - psrlw xmm5, xmm4 - movdqa [rsp + rounding_bit], xmm5 - - mov rsi, arg(0) ; src/frame1 - mov rdx, arg(2) ; predictor frame - mov rdi, arg(6) ; accumulator - mov rax, arg(7) ; count - - ; dup the filter weight and store for later - movd xmm0, arg(5) ; filter_weight - pshuflw xmm0, xmm0, 0 - punpcklwd xmm0, xmm0 - movdqa [rsp + filter_weight], xmm0 - - mov rbp, arg(1) ; stride - pxor xmm7, xmm7 ; zero for extraction - - lea rcx, [rdx + 16*16*1] - cmp dword ptr [rsp + block_size], 8 - jne .temporal_filter_apply_load_16 - lea rcx, [rdx + 8*8*1] - -.temporal_filter_apply_load_8: - movq xmm0, [rsi] ; first row - lea rsi, [rsi + rbp] ; += stride - punpcklbw xmm0, xmm7 ; src[ 0- 7] - movq xmm1, [rsi] ; second row - lea rsi, [rsi + rbp] ; += stride - punpcklbw xmm1, xmm7 ; src[ 8-15] - jmp .temporal_filter_apply_load_finished - -.temporal_filter_apply_load_16: - movdqa xmm0, [rsi] ; src (frame1) - lea rsi, [rsi + rbp] ; += stride - movdqa xmm1, xmm0 - punpcklbw xmm0, xmm7 ; src[ 0- 7] - punpckhbw xmm1, xmm7 ; src[ 8-15] - -.temporal_filter_apply_load_finished: - movdqa xmm2, [rdx] ; predictor (frame2) - movdqa xmm3, xmm2 - punpcklbw xmm2, xmm7 ; pred[ 0- 7] - punpckhbw xmm3, xmm7 ; pred[ 8-15] - - ; modifier = src_byte - pixel_value - psubw xmm0, xmm2 ; src - pred[ 0- 7] - psubw xmm1, xmm3 ; src - pred[ 8-15] - - ; modifier *= modifier - pmullw xmm0, xmm0 ; modifer[ 0- 7]^2 - pmullw xmm1, xmm1 ; modifer[ 8-15]^2 - - ; modifier *= 3 - pmullw xmm0, [GLOBAL(_const_3w)] - pmullw xmm1, [GLOBAL(_const_3w)] - - ; modifer += 0x8000 >> (16 - strength) - paddw xmm0, [rsp + rounding_bit] - paddw xmm1, [rsp + rounding_bit] - - ; modifier >>= strength - psrlw xmm0, [rsp + strength] - psrlw xmm1, [rsp + strength] - - ; modifier = 16 - modifier - ; saturation takes care of modifier > 16 - movdqa xmm3, [GLOBAL(_const_16w)] - movdqa xmm2, [GLOBAL(_const_16w)] - psubusw xmm3, xmm1 - psubusw xmm2, xmm0 - - ; modifier *= filter_weight - pmullw xmm2, [rsp + filter_weight] - pmullw xmm3, [rsp + filter_weight] - - ; count - movdqa xmm4, [rax] - movdqa xmm5, [rax+16] - ; += modifier - paddw xmm4, xmm2 - paddw xmm5, xmm3 - ; write back - movdqa [rax], xmm4 - movdqa [rax+16], xmm5 - lea rax, [rax + 16*2] ; count += 16*(sizeof(short)) - - ; load and extract the predictor up to shorts - pxor xmm7, xmm7 - movdqa xmm0, [rdx] - lea rdx, [rdx + 16*1] ; pred += 16*(sizeof(char)) - movdqa xmm1, xmm0 - punpcklbw xmm0, xmm7 ; pred[ 0- 7] - punpckhbw xmm1, xmm7 ; pred[ 8-15] - - ; modifier *= pixel_value - pmullw xmm0, xmm2 - pmullw xmm1, xmm3 - - ; expand to double words - movdqa xmm2, xmm0 - punpcklwd xmm0, xmm7 ; [ 0- 3] - punpckhwd xmm2, xmm7 ; [ 4- 7] - movdqa xmm3, xmm1 - punpcklwd xmm1, xmm7 ; [ 8-11] - punpckhwd xmm3, xmm7 ; [12-15] - - ; accumulator - movdqa xmm4, [rdi] - movdqa xmm5, [rdi+16] - movdqa xmm6, [rdi+32] - movdqa xmm7, [rdi+48] - ; += modifier - paddd xmm4, xmm0 - paddd xmm5, xmm2 - paddd xmm6, xmm1 - paddd xmm7, xmm3 - ; write back - movdqa [rdi], xmm4 - movdqa [rdi+16], xmm5 - movdqa [rdi+32], xmm6 - movdqa [rdi+48], xmm7 - lea rdi, [rdi + 16*4] ; accumulator += 16*(sizeof(int)) - - cmp rdx, rcx - je .temporal_filter_apply_epilog - pxor xmm7, xmm7 ; zero for extraction - cmp dword ptr [rsp + block_size], 16 - je .temporal_filter_apply_load_16 - jmp .temporal_filter_apply_load_8 - -.temporal_filter_apply_epilog: - ; begin epilog - mov rbp, [rsp + rbp_backup] - add rsp, stack_size - pop rsp - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -SECTION_RODATA -align 16 -_const_3w: - times 8 dw 3 -align 16 -_const_top_bit: - times 8 dw 1<<15 -align 16 -_const_16w - times 8 dw 16 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/vp8_enc_stubs_mmx.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/vp8_enc_stubs_mmx.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/vp8_enc_stubs_mmx.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/vp8_enc_stubs_mmx.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "vpx_ports/x86.h" -#include "vp8/encoder/block.h" - -void vp8_short_fdct4x4_mmx(short *input, short *output, int pitch); -void vp8_short_fdct8x4_mmx(short *input, short *output, int pitch) -{ - vp8_short_fdct4x4_mmx(input, output, pitch); - vp8_short_fdct4x4_mmx(input + 4, output + 16, pitch); -} - -int vp8_fast_quantize_b_impl_mmx(short *coeff_ptr, short *zbin_ptr, - short *qcoeff_ptr, short *dequant_ptr, - const short *scan_mask, short *round_ptr, - short *quant_ptr, short *dqcoeff_ptr); -void vp8_fast_quantize_b_mmx(BLOCK *b, BLOCKD *d) -{ - const short *scan_mask = vp8_default_zig_zag_mask; - short *coeff_ptr = b->coeff; - short *zbin_ptr = b->zbin; - short *round_ptr = b->round; - short *quant_ptr = b->quant_fast; - short *qcoeff_ptr = d->qcoeff; - short *dqcoeff_ptr = d->dqcoeff; - short *dequant_ptr = d->dequant; - - *d->eob = (char)vp8_fast_quantize_b_impl_mmx( - coeff_ptr, - zbin_ptr, - qcoeff_ptr, - dequant_ptr, - scan_mask, - - round_ptr, - quant_ptr, - dqcoeff_ptr - ); -} - -int vp8_mbblock_error_mmx_impl(short *coeff_ptr, short *dcoef_ptr, int dc); -int vp8_mbblock_error_mmx(MACROBLOCK *mb, int dc) -{ - short *coeff_ptr = mb->block[0].coeff; - short *dcoef_ptr = mb->e_mbd.block[0].dqcoeff; - return vp8_mbblock_error_mmx_impl(coeff_ptr, dcoef_ptr, dc); -} - -int vp8_mbuverror_mmx_impl(short *s_ptr, short *d_ptr); -int vp8_mbuverror_mmx(MACROBLOCK *mb) -{ - short *s_ptr = &mb->coeff[256]; - short *d_ptr = &mb->e_mbd.dqcoeff[256]; - return vp8_mbuverror_mmx_impl(s_ptr, d_ptr); -} - -void vp8_subtract_b_mmx_impl(unsigned char *z, int src_stride, - short *diff, unsigned char *predictor, - int pitch); -void vp8_subtract_b_mmx(BLOCK *be, BLOCKD *bd, int pitch) -{ - unsigned char *z = *(be->base_src) + be->src; - unsigned int src_stride = be->src_stride; - short *diff = &be->src_diff[0]; - unsigned char *predictor = &bd->predictor[0]; - vp8_subtract_b_mmx_impl(z, src_stride, diff, predictor, pitch); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/vp8_enc_stubs_sse2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/vp8_enc_stubs_sse2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/encoder/x86/vp8_enc_stubs_sse2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/encoder/x86/vp8_enc_stubs_sse2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "vpx_config.h" -#include "vp8_rtcd.h" -#include "vpx_ports/x86.h" -#include "vp8/encoder/block.h" - -int vp8_mbblock_error_xmm_impl(short *coeff_ptr, short *dcoef_ptr, int dc); -int vp8_mbblock_error_xmm(MACROBLOCK *mb, int dc) -{ - short *coeff_ptr = mb->block[0].coeff; - short *dcoef_ptr = mb->e_mbd.block[0].dqcoeff; - return vp8_mbblock_error_xmm_impl(coeff_ptr, dcoef_ptr, dc); -} - -int vp8_mbuverror_xmm_impl(short *s_ptr, short *d_ptr); -int vp8_mbuverror_xmm(MACROBLOCK *mb) -{ - short *s_ptr = &mb->coeff[256]; - short *d_ptr = &mb->e_mbd.dqcoeff[256]; - return vp8_mbuverror_xmm_impl(s_ptr, d_ptr); -} - -void vp8_subtract_b_sse2_impl(unsigned char *z, int src_stride, - short *diff, unsigned char *predictor, - int pitch); -void vp8_subtract_b_sse2(BLOCK *be, BLOCKD *bd, int pitch) -{ - unsigned char *z = *(be->base_src) + be->src; - unsigned int src_stride = be->src_stride; - short *diff = &be->src_diff[0]; - unsigned char *predictor = &bd->predictor[0]; - vp8_subtract_b_sse2_impl(z, src_stride, diff, predictor, pitch); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/vp8_common.mk gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/vp8_common.mk --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/vp8_common.mk 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/vp8_common.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,179 +0,0 @@ -## -## Copyright (c) 2010 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - -VP8_COMMON_SRCS-yes += vp8_common.mk -VP8_COMMON_SRCS-yes += common/ppflags.h -VP8_COMMON_SRCS-yes += common/onyx.h -VP8_COMMON_SRCS-yes += common/onyxd.h -VP8_COMMON_SRCS-yes += common/alloccommon.c -VP8_COMMON_SRCS-yes += common/blockd.c -VP8_COMMON_SRCS-yes += common/coefupdateprobs.h -VP8_COMMON_SRCS-yes += common/debugmodes.c -VP8_COMMON_SRCS-yes += common/default_coef_probs.h -VP8_COMMON_SRCS-yes += common/dequantize.c -VP8_COMMON_SRCS-yes += common/entropy.c -VP8_COMMON_SRCS-yes += common/entropymode.c -VP8_COMMON_SRCS-yes += common/entropymv.c -VP8_COMMON_SRCS-yes += common/extend.c -VP8_COMMON_SRCS-yes += common/filter.c -VP8_COMMON_SRCS-yes += common/filter.h -VP8_COMMON_SRCS-yes += common/findnearmv.c -VP8_COMMON_SRCS-yes += common/generic/systemdependent.c -VP8_COMMON_SRCS-yes += common/idct_blk.c -VP8_COMMON_SRCS-yes += common/idctllm.c -VP8_COMMON_SRCS-yes += common/alloccommon.h -VP8_COMMON_SRCS-yes += common/blockd.h -VP8_COMMON_SRCS-yes += common/common.h -VP8_COMMON_SRCS-yes += common/entropy.h -VP8_COMMON_SRCS-yes += common/entropymode.h -VP8_COMMON_SRCS-yes += common/entropymv.h -VP8_COMMON_SRCS-yes += common/extend.h -VP8_COMMON_SRCS-yes += common/findnearmv.h -VP8_COMMON_SRCS-yes += common/header.h -VP8_COMMON_SRCS-yes += common/invtrans.h -VP8_COMMON_SRCS-yes += common/loopfilter.h -VP8_COMMON_SRCS-yes += common/modecont.h -VP8_COMMON_SRCS-yes += common/mv.h -VP8_COMMON_SRCS-yes += common/onyxc_int.h -VP8_COMMON_SRCS-yes += common/quant_common.h -VP8_COMMON_SRCS-yes += common/reconinter.h -VP8_COMMON_SRCS-yes += common/reconintra4x4.h -VP8_COMMON_SRCS-yes += common/rtcd.c -VP8_COMMON_SRCS-yes += common/rtcd_defs.pl -VP8_COMMON_SRCS-yes += common/setupintrarecon.h -VP8_COMMON_SRCS-yes += common/swapyv12buffer.h -VP8_COMMON_SRCS-yes += common/systemdependent.h -VP8_COMMON_SRCS-yes += common/threading.h -VP8_COMMON_SRCS-yes += common/treecoder.h -VP8_COMMON_SRCS-yes += common/loopfilter.c -VP8_COMMON_SRCS-yes += common/loopfilter_filters.c -VP8_COMMON_SRCS-yes += common/mbpitch.c -VP8_COMMON_SRCS-yes += common/modecont.c -VP8_COMMON_SRCS-yes += common/quant_common.c -VP8_COMMON_SRCS-yes += common/reconinter.c -VP8_COMMON_SRCS-yes += common/reconintra.c -VP8_COMMON_SRCS-yes += common/reconintra4x4.c -VP8_COMMON_SRCS-yes += common/sad_c.c -VP8_COMMON_SRCS-yes += common/setupintrarecon.c -VP8_COMMON_SRCS-yes += common/swapyv12buffer.c -VP8_COMMON_SRCS-yes += common/variance_c.c -VP8_COMMON_SRCS-yes += common/variance.h -VP8_COMMON_SRCS-yes += common/vp8_entropymodedata.h - - - -VP8_COMMON_SRCS-$(CONFIG_POSTPROC_VISUALIZER) += common/textblit.c -VP8_COMMON_SRCS-yes += common/treecoder.c - -VP8_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/filter_x86.c -VP8_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/filter_x86.h -VP8_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/vp8_asm_stubs.c -VP8_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/loopfilter_x86.c -VP8_COMMON_SRCS-$(CONFIG_POSTPROC) += common/mfqe.c -VP8_COMMON_SRCS-$(CONFIG_POSTPROC) += common/postproc.h -VP8_COMMON_SRCS-$(CONFIG_POSTPROC) += common/postproc.c -VP8_COMMON_SRCS-$(HAVE_MMX) += common/x86/dequantize_mmx.asm -VP8_COMMON_SRCS-$(HAVE_MMX) += common/x86/idct_blk_mmx.c -VP8_COMMON_SRCS-$(HAVE_MMX) += common/x86/idctllm_mmx.asm -VP8_COMMON_SRCS-$(HAVE_MMX) += common/x86/iwalsh_mmx.asm -VP8_COMMON_SRCS-$(HAVE_MMX) += common/x86/loopfilter_mmx.asm -VP8_COMMON_SRCS-$(HAVE_MMX) += common/x86/recon_mmx.asm -VP8_COMMON_SRCS-$(HAVE_MMX) += common/x86/sad_mmx.asm -VP8_COMMON_SRCS-$(HAVE_MMX) += common/x86/subpixel_mmx.asm -VP8_COMMON_SRCS-$(HAVE_MMX) += common/x86/variance_mmx.c -VP8_COMMON_SRCS-$(HAVE_MMX) += common/x86/variance_impl_mmx.asm -VP8_COMMON_SRCS-$(HAVE_SSE2) += common/x86/idct_blk_sse2.c -VP8_COMMON_SRCS-$(HAVE_SSE2) += common/x86/idctllm_sse2.asm -VP8_COMMON_SRCS-$(HAVE_SSE2) += common/x86/recon_sse2.asm -VP8_COMMON_SRCS-$(HAVE_SSE2) += common/x86/recon_wrapper_sse2.c -VP8_COMMON_SRCS-$(HAVE_SSE2) += common/x86/sad_sse2.asm -VP8_COMMON_SRCS-$(HAVE_SSE2) += common/x86/subpixel_sse2.asm -VP8_COMMON_SRCS-$(HAVE_SSE2) += common/x86/loopfilter_sse2.asm -VP8_COMMON_SRCS-$(HAVE_SSE2) += common/x86/iwalsh_sse2.asm -VP8_COMMON_SRCS-$(HAVE_SSE2) += common/x86/variance_sse2.c -VP8_COMMON_SRCS-$(HAVE_SSE2) += common/x86/variance_impl_sse2.asm -VP8_COMMON_SRCS-$(HAVE_SSE3) += common/x86/sad_sse3.asm -VP8_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/sad_ssse3.asm -VP8_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/subpixel_ssse3.asm -VP8_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/variance_ssse3.c -VP8_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/variance_impl_ssse3.asm -VP8_COMMON_SRCS-$(HAVE_SSE4_1) += common/x86/sad_sse4.asm - -ifeq ($(CONFIG_POSTPROC),yes) -VP8_COMMON_SRCS-$(HAVE_MMX) += common/x86/postproc_mmx.asm -VP8_COMMON_SRCS-$(HAVE_SSE2) += common/x86/mfqe_sse2.asm -VP8_COMMON_SRCS-$(HAVE_SSE2) += common/x86/postproc_sse2.asm -endif - -ifeq ($(ARCH_X86_64),yes) -VP8_COMMON_SRCS-$(HAVE_SSE2) += common/x86/loopfilter_block_sse2_x86_64.asm -endif - -# common (c) -VP8_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/idctllm_dspr2.c -VP8_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/filter_dspr2.c -VP8_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/loopfilter_filters_dspr2.c -VP8_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/reconinter_dspr2.c -VP8_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/idct_blk_dspr2.c -VP8_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/dequantize_dspr2.c - -# common (c) -VP8_COMMON_SRCS-$(ARCH_ARM) += common/arm/filter_arm.c -VP8_COMMON_SRCS-$(ARCH_ARM) += common/arm/loopfilter_arm.c -VP8_COMMON_SRCS-$(ARCH_ARM) += common/arm/dequantize_arm.c -VP8_COMMON_SRCS-$(ARCH_ARM) += common/arm/variance_arm.c - -# common (media) -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/bilinearfilter_arm.c -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/bilinearfilter_arm.h -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/bilinearfilter_v6$(ASM) -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/copymem8x4_v6$(ASM) -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/copymem8x8_v6$(ASM) -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/copymem16x16_v6$(ASM) -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/dc_only_idct_add_v6$(ASM) -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/iwalsh_v6$(ASM) -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/filter_v6$(ASM) -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/idct_v6$(ASM) -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/loopfilter_v6$(ASM) -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/simpleloopfilter_v6$(ASM) -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/sixtappredict8x4_v6$(ASM) -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/intra4x4_predict_v6$(ASM) -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/dequant_idct_v6$(ASM) -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/dequantize_v6$(ASM) -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/idct_blk_v6.c -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/vp8_sad16x16_armv6$(ASM) -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/vp8_variance8x8_armv6$(ASM) -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/vp8_variance16x16_armv6$(ASM) -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6$(ASM) -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6$(ASM) -VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6$(ASM) - -# common (neon intrinsics) -VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/bilinearpredict_neon.c -VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/copymem_neon.c -VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/dc_only_idct_add_neon.c -VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/dequant_idct_neon.c -VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/dequantizeb_neon.c -VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/idct_blk_neon.c -VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/idct_dequant_0_2x_neon.c -VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/idct_dequant_full_2x_neon.c -VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/iwalsh_neon.c -VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/loopfilter_neon.c -VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/loopfiltersimplehorizontaledge_neon.c -VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/loopfiltersimpleverticaledge_neon.c -VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/mbloopfilter_neon.c -VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/reconintra_neon.c -VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/sad_neon.c -VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/shortidct4x4llm_neon.c -VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/sixtappredict_neon.c -VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/variance_neon.c -VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp8_subpixelvariance_neon.c - -$(eval $(call rtcd_h_template,vp8_rtcd,vp8/common/rtcd_defs.pl)) diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/vp8cx_arm.mk gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/vp8cx_arm.mk --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/vp8cx_arm.mk 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/vp8cx_arm.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -## -## Copyright (c) 2010 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - - -VP8_CX_SRCS-$(ARCH_ARM) += vp8cx_arm.mk - -#File list for arm -# encoder -VP8_CX_SRCS-$(ARCH_ARM) += encoder/arm/dct_arm.c - -#File list for media -# encoder -VP8_CX_SRCS-$(HAVE_MEDIA) += encoder/arm/armv6/vp8_short_fdct4x4_armv6$(ASM) -VP8_CX_SRCS-$(HAVE_MEDIA) += encoder/arm/armv6/vp8_mse16x16_armv6$(ASM) -VP8_CX_SRCS-$(HAVE_MEDIA) += encoder/arm/armv6/walsh_v6$(ASM) - -#File list for neon -# encoder -VP8_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/denoising_neon.c -VP8_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/fastquantizeb_neon.c -VP8_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/shortfdct_neon.c -VP8_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/subtract_neon.c -VP8_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/vp8_mse16x16_neon.c -VP8_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/vp8_shortwalsh4x4_neon.c diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/vp8_cx_iface.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/vp8_cx_iface.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/vp8_cx_iface.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/vp8_cx_iface.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1396 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "./vpx_config.h" -#include "vp8_rtcd.h" -#include "vpx/vpx_codec.h" -#include "vpx/internal/vpx_codec_internal.h" -#include "vpx_version.h" -#include "vpx_mem/vpx_mem.h" -#include "vp8/encoder/onyx_int.h" -#include "vpx/vp8cx.h" -#include "vp8/encoder/firstpass.h" -#include "vp8/common/onyx.h" -#include -#include - -struct vp8_extracfg -{ - struct vpx_codec_pkt_list *pkt_list; - int cpu_used; /** available cpu percentage in 1/16*/ - unsigned int enable_auto_alt_ref; /** if encoder decides to uses alternate reference frame */ - unsigned int noise_sensitivity; - unsigned int Sharpness; - unsigned int static_thresh; - unsigned int token_partitions; - unsigned int arnr_max_frames; /* alt_ref Noise Reduction Max Frame Count */ - unsigned int arnr_strength; /* alt_ref Noise Reduction Strength */ - unsigned int arnr_type; /* alt_ref filter type */ - vp8e_tuning tuning; - unsigned int cq_level; /* constrained quality level */ - unsigned int rc_max_intra_bitrate_pct; - unsigned int screen_content_mode; - -}; - -static struct vp8_extracfg default_extracfg = { - NULL, -#if !(CONFIG_REALTIME_ONLY) - 0, /* cpu_used */ -#else - 4, /* cpu_used */ -#endif - 0, /* enable_auto_alt_ref */ - 0, /* noise_sensitivity */ - 0, /* Sharpness */ - 0, /* static_thresh */ -#if (CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING) - VP8_EIGHT_TOKENPARTITION, -#else - VP8_ONE_TOKENPARTITION, /* token_partitions */ -#endif - 0, /* arnr_max_frames */ - 3, /* arnr_strength */ - 3, /* arnr_type*/ - 0, /* tuning*/ - 10, /* cq_level */ - 0, /* rc_max_intra_bitrate_pct */ - 0, /* screen_content_mode */ -}; - -struct vpx_codec_alg_priv -{ - vpx_codec_priv_t base; - vpx_codec_enc_cfg_t cfg; - struct vp8_extracfg vp8_cfg; - VP8_CONFIG oxcf; - struct VP8_COMP *cpi; - unsigned char *cx_data; - unsigned int cx_data_sz; - vpx_image_t preview_img; - unsigned int next_frame_flag; - vp8_postproc_cfg_t preview_ppcfg; - /* pkt_list size depends on the maximum number of lagged frames allowed. */ - vpx_codec_pkt_list_decl(64) pkt_list; - unsigned int fixed_kf_cntr; - vpx_enc_frame_flags_t control_frame_flags; -}; - - -static vpx_codec_err_t -update_error_state(vpx_codec_alg_priv_t *ctx, - const struct vpx_internal_error_info *error) -{ - vpx_codec_err_t res; - - if ((res = error->error_code)) - ctx->base.err_detail = error->has_detail - ? error->detail - : NULL; - - return res; -} - - -#undef ERROR -#define ERROR(str) do {\ - ctx->base.err_detail = str;\ - return VPX_CODEC_INVALID_PARAM;\ - } while(0) - -#define RANGE_CHECK(p,memb,lo,hi) do {\ - if(!(((p)->memb == lo || (p)->memb > (lo)) && (p)->memb <= hi)) \ - ERROR(#memb " out of range ["#lo".."#hi"]");\ - } while(0) - -#define RANGE_CHECK_HI(p,memb,hi) do {\ - if(!((p)->memb <= (hi))) \ - ERROR(#memb " out of range [.."#hi"]");\ - } while(0) - -#define RANGE_CHECK_LO(p,memb,lo) do {\ - if(!((p)->memb >= (lo))) \ - ERROR(#memb " out of range ["#lo"..]");\ - } while(0) - -#define RANGE_CHECK_BOOL(p,memb) do {\ - if(!!((p)->memb) != (p)->memb) ERROR(#memb " expected boolean");\ - } while(0) - -static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx, - const vpx_codec_enc_cfg_t *cfg, - const struct vp8_extracfg *vp8_cfg, - int finalize) -{ - RANGE_CHECK(cfg, g_w, 1, 16383); /* 14 bits available */ - RANGE_CHECK(cfg, g_h, 1, 16383); /* 14 bits available */ - RANGE_CHECK(cfg, g_timebase.den, 1, 1000000000); - RANGE_CHECK(cfg, g_timebase.num, 1, cfg->g_timebase.den); - RANGE_CHECK_HI(cfg, g_profile, 3); - RANGE_CHECK_HI(cfg, rc_max_quantizer, 63); - RANGE_CHECK_HI(cfg, rc_min_quantizer, cfg->rc_max_quantizer); - RANGE_CHECK_HI(cfg, g_threads, 64); -#if CONFIG_REALTIME_ONLY - RANGE_CHECK_HI(cfg, g_lag_in_frames, 0); -#elif CONFIG_MULTI_RES_ENCODING - if (ctx->base.enc.total_encoders > 1) - RANGE_CHECK_HI(cfg, g_lag_in_frames, 0); -#else - RANGE_CHECK_HI(cfg, g_lag_in_frames, 25); -#endif - RANGE_CHECK(cfg, rc_end_usage, VPX_VBR, VPX_Q); - RANGE_CHECK_HI(cfg, rc_undershoot_pct, 1000); - RANGE_CHECK_HI(cfg, rc_overshoot_pct, 1000); - RANGE_CHECK_HI(cfg, rc_2pass_vbr_bias_pct, 100); - RANGE_CHECK(cfg, kf_mode, VPX_KF_DISABLED, VPX_KF_AUTO); - -/* TODO: add spatial re-sampling support and frame dropping in - * multi-res-encoder.*/ -#if CONFIG_MULTI_RES_ENCODING - if (ctx->base.enc.total_encoders > 1) - RANGE_CHECK_HI(cfg, rc_resize_allowed, 0); -#else - RANGE_CHECK_BOOL(cfg, rc_resize_allowed); -#endif - RANGE_CHECK_HI(cfg, rc_dropframe_thresh, 100); - RANGE_CHECK_HI(cfg, rc_resize_up_thresh, 100); - RANGE_CHECK_HI(cfg, rc_resize_down_thresh, 100); - -#if CONFIG_REALTIME_ONLY - RANGE_CHECK(cfg, g_pass, VPX_RC_ONE_PASS, VPX_RC_ONE_PASS); -#elif CONFIG_MULTI_RES_ENCODING - if (ctx->base.enc.total_encoders > 1) - RANGE_CHECK(cfg, g_pass, VPX_RC_ONE_PASS, VPX_RC_ONE_PASS); -#else - RANGE_CHECK(cfg, g_pass, VPX_RC_ONE_PASS, VPX_RC_LAST_PASS); -#endif - - /* VP8 does not support a lower bound on the keyframe interval in - * automatic keyframe placement mode. - */ - if (cfg->kf_mode != VPX_KF_DISABLED && cfg->kf_min_dist != cfg->kf_max_dist - && cfg->kf_min_dist > 0) - ERROR("kf_min_dist not supported in auto mode, use 0 " - "or kf_max_dist instead."); - - RANGE_CHECK_BOOL(vp8_cfg, enable_auto_alt_ref); - RANGE_CHECK(vp8_cfg, cpu_used, -16, 16); - -#if CONFIG_REALTIME_ONLY && !CONFIG_TEMPORAL_DENOISING - RANGE_CHECK(vp8_cfg, noise_sensitivity, 0, 0); -#else - RANGE_CHECK_HI(vp8_cfg, noise_sensitivity, 6); -#endif - - RANGE_CHECK(vp8_cfg, token_partitions, VP8_ONE_TOKENPARTITION, - VP8_EIGHT_TOKENPARTITION); - RANGE_CHECK_HI(vp8_cfg, Sharpness, 7); - RANGE_CHECK(vp8_cfg, arnr_max_frames, 0, 15); - RANGE_CHECK_HI(vp8_cfg, arnr_strength, 6); - RANGE_CHECK(vp8_cfg, arnr_type, 1, 3); - RANGE_CHECK(vp8_cfg, cq_level, 0, 63); - RANGE_CHECK_BOOL(vp8_cfg, screen_content_mode); - if (finalize && (cfg->rc_end_usage == VPX_CQ || cfg->rc_end_usage == VPX_Q)) - RANGE_CHECK(vp8_cfg, cq_level, - cfg->rc_min_quantizer, cfg->rc_max_quantizer); - -#if !(CONFIG_REALTIME_ONLY) - if (cfg->g_pass == VPX_RC_LAST_PASS) - { - size_t packet_sz = sizeof(FIRSTPASS_STATS); - int n_packets = (int)(cfg->rc_twopass_stats_in.sz / - packet_sz); - FIRSTPASS_STATS *stats; - - if (!cfg->rc_twopass_stats_in.buf) - ERROR("rc_twopass_stats_in.buf not set."); - - if (cfg->rc_twopass_stats_in.sz % packet_sz) - ERROR("rc_twopass_stats_in.sz indicates truncated packet."); - - if (cfg->rc_twopass_stats_in.sz < 2 * packet_sz) - ERROR("rc_twopass_stats_in requires at least two packets."); - - stats = (void*)((char *)cfg->rc_twopass_stats_in.buf - + (n_packets - 1) * packet_sz); - - if ((int)(stats->count + 0.5) != n_packets - 1) - ERROR("rc_twopass_stats_in missing EOS stats packet"); - } -#endif - - RANGE_CHECK(cfg, ts_number_layers, 1, 5); - - if (cfg->ts_number_layers > 1) - { - unsigned int i; - RANGE_CHECK_HI(cfg, ts_periodicity, 16); - - for (i=1; its_number_layers; i++) - if (cfg->ts_target_bitrate[i] <= cfg->ts_target_bitrate[i-1] && - cfg->rc_target_bitrate > 0) - ERROR("ts_target_bitrate entries are not strictly increasing"); - - RANGE_CHECK(cfg, ts_rate_decimator[cfg->ts_number_layers-1], 1, 1); - for (i=cfg->ts_number_layers-2; i>0; i--) - if (cfg->ts_rate_decimator[i-1] != 2*cfg->ts_rate_decimator[i]) - ERROR("ts_rate_decimator factors are not powers of 2"); - - RANGE_CHECK_HI(cfg, ts_layer_id[i], cfg->ts_number_layers-1); - } - -#if (CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING) - if(cfg->g_threads > (1 << vp8_cfg->token_partitions)) - ERROR("g_threads cannot be bigger than number of token partitions"); -#endif - - return VPX_CODEC_OK; -} - - -static vpx_codec_err_t validate_img(vpx_codec_alg_priv_t *ctx, - const vpx_image_t *img) -{ - switch (img->fmt) - { - case VPX_IMG_FMT_YV12: - case VPX_IMG_FMT_I420: - case VPX_IMG_FMT_VPXI420: - case VPX_IMG_FMT_VPXYV12: - break; - default: - ERROR("Invalid image format. Only YV12 and I420 images are supported"); - } - - if ((img->d_w != ctx->cfg.g_w) || (img->d_h != ctx->cfg.g_h)) - ERROR("Image size must match encoder init configuration size"); - - return VPX_CODEC_OK; -} - - -static vpx_codec_err_t set_vp8e_config(VP8_CONFIG *oxcf, - vpx_codec_enc_cfg_t cfg, - struct vp8_extracfg vp8_cfg, - vpx_codec_priv_enc_mr_cfg_t *mr_cfg) -{ - oxcf->multi_threaded = cfg.g_threads; - oxcf->Version = cfg.g_profile; - - oxcf->Width = cfg.g_w; - oxcf->Height = cfg.g_h; - oxcf->timebase = cfg.g_timebase; - - oxcf->error_resilient_mode = cfg.g_error_resilient; - - switch (cfg.g_pass) - { - case VPX_RC_ONE_PASS: - oxcf->Mode = MODE_BESTQUALITY; - break; - case VPX_RC_FIRST_PASS: - oxcf->Mode = MODE_FIRSTPASS; - break; - case VPX_RC_LAST_PASS: - oxcf->Mode = MODE_SECONDPASS_BEST; - break; - } - - if (cfg.g_pass == VPX_RC_FIRST_PASS || cfg.g_pass == VPX_RC_ONE_PASS) - { - oxcf->allow_lag = 0; - oxcf->lag_in_frames = 0; - } - else - { - oxcf->allow_lag = (cfg.g_lag_in_frames) > 0; - oxcf->lag_in_frames = cfg.g_lag_in_frames; - } - - oxcf->allow_df = (cfg.rc_dropframe_thresh > 0); - oxcf->drop_frames_water_mark = cfg.rc_dropframe_thresh; - - oxcf->allow_spatial_resampling = cfg.rc_resize_allowed; - oxcf->resample_up_water_mark = cfg.rc_resize_up_thresh; - oxcf->resample_down_water_mark = cfg.rc_resize_down_thresh; - - if (cfg.rc_end_usage == VPX_VBR) { - oxcf->end_usage = USAGE_LOCAL_FILE_PLAYBACK; - } else if (cfg.rc_end_usage == VPX_CBR) { - oxcf->end_usage = USAGE_STREAM_FROM_SERVER; - } else if (cfg.rc_end_usage == VPX_CQ) { - oxcf->end_usage = USAGE_CONSTRAINED_QUALITY; - } else if (cfg.rc_end_usage == VPX_Q) { - oxcf->end_usage = USAGE_CONSTANT_QUALITY; - } - - oxcf->target_bandwidth = cfg.rc_target_bitrate; - oxcf->rc_max_intra_bitrate_pct = vp8_cfg.rc_max_intra_bitrate_pct; - - oxcf->best_allowed_q = cfg.rc_min_quantizer; - oxcf->worst_allowed_q = cfg.rc_max_quantizer; - oxcf->cq_level = vp8_cfg.cq_level; - oxcf->fixed_q = -1; - - oxcf->under_shoot_pct = cfg.rc_undershoot_pct; - oxcf->over_shoot_pct = cfg.rc_overshoot_pct; - - oxcf->maximum_buffer_size_in_ms = cfg.rc_buf_sz; - oxcf->starting_buffer_level_in_ms = cfg.rc_buf_initial_sz; - oxcf->optimal_buffer_level_in_ms = cfg.rc_buf_optimal_sz; - - oxcf->maximum_buffer_size = cfg.rc_buf_sz; - oxcf->starting_buffer_level = cfg.rc_buf_initial_sz; - oxcf->optimal_buffer_level = cfg.rc_buf_optimal_sz; - - oxcf->two_pass_vbrbias = cfg.rc_2pass_vbr_bias_pct; - oxcf->two_pass_vbrmin_section = cfg.rc_2pass_vbr_minsection_pct; - oxcf->two_pass_vbrmax_section = cfg.rc_2pass_vbr_maxsection_pct; - - oxcf->auto_key = cfg.kf_mode == VPX_KF_AUTO - && cfg.kf_min_dist != cfg.kf_max_dist; - oxcf->key_freq = cfg.kf_max_dist; - - oxcf->number_of_layers = cfg.ts_number_layers; - oxcf->periodicity = cfg.ts_periodicity; - - if (oxcf->number_of_layers > 1) - { - memcpy (oxcf->target_bitrate, cfg.ts_target_bitrate, - sizeof(cfg.ts_target_bitrate)); - memcpy (oxcf->rate_decimator, cfg.ts_rate_decimator, - sizeof(cfg.ts_rate_decimator)); - memcpy (oxcf->layer_id, cfg.ts_layer_id, sizeof(cfg.ts_layer_id)); - } - -#if CONFIG_MULTI_RES_ENCODING - /* When mr_cfg is NULL, oxcf->mr_total_resolutions and oxcf->mr_encoder_id - * are both memset to 0, which ensures the correct logic under this - * situation. - */ - if(mr_cfg) - { - oxcf->mr_total_resolutions = mr_cfg->mr_total_resolutions; - oxcf->mr_encoder_id = mr_cfg->mr_encoder_id; - oxcf->mr_down_sampling_factor.num = mr_cfg->mr_down_sampling_factor.num; - oxcf->mr_down_sampling_factor.den = mr_cfg->mr_down_sampling_factor.den; - oxcf->mr_low_res_mode_info = mr_cfg->mr_low_res_mode_info; - } -#else - (void)mr_cfg; -#endif - - oxcf->cpu_used = vp8_cfg.cpu_used; - oxcf->encode_breakout = vp8_cfg.static_thresh; - oxcf->play_alternate = vp8_cfg.enable_auto_alt_ref; - oxcf->noise_sensitivity = vp8_cfg.noise_sensitivity; - oxcf->Sharpness = vp8_cfg.Sharpness; - oxcf->token_partitions = vp8_cfg.token_partitions; - - oxcf->two_pass_stats_in = cfg.rc_twopass_stats_in; - oxcf->output_pkt_list = vp8_cfg.pkt_list; - - oxcf->arnr_max_frames = vp8_cfg.arnr_max_frames; - oxcf->arnr_strength = vp8_cfg.arnr_strength; - oxcf->arnr_type = vp8_cfg.arnr_type; - - oxcf->tuning = vp8_cfg.tuning; - - oxcf->screen_content_mode = vp8_cfg.screen_content_mode; - - /* - printf("Current VP8 Settings: \n"); - printf("target_bandwidth: %d\n", oxcf->target_bandwidth); - printf("noise_sensitivity: %d\n", oxcf->noise_sensitivity); - printf("Sharpness: %d\n", oxcf->Sharpness); - printf("cpu_used: %d\n", oxcf->cpu_used); - printf("Mode: %d\n", oxcf->Mode); - printf("auto_key: %d\n", oxcf->auto_key); - printf("key_freq: %d\n", oxcf->key_freq); - printf("end_usage: %d\n", oxcf->end_usage); - printf("under_shoot_pct: %d\n", oxcf->under_shoot_pct); - printf("over_shoot_pct: %d\n", oxcf->over_shoot_pct); - printf("starting_buffer_level: %d\n", oxcf->starting_buffer_level); - printf("optimal_buffer_level: %d\n", oxcf->optimal_buffer_level); - printf("maximum_buffer_size: %d\n", oxcf->maximum_buffer_size); - printf("fixed_q: %d\n", oxcf->fixed_q); - printf("worst_allowed_q: %d\n", oxcf->worst_allowed_q); - printf("best_allowed_q: %d\n", oxcf->best_allowed_q); - printf("allow_spatial_resampling: %d\n", oxcf->allow_spatial_resampling); - printf("resample_down_water_mark: %d\n", oxcf->resample_down_water_mark); - printf("resample_up_water_mark: %d\n", oxcf->resample_up_water_mark); - printf("allow_df: %d\n", oxcf->allow_df); - printf("drop_frames_water_mark: %d\n", oxcf->drop_frames_water_mark); - printf("two_pass_vbrbias: %d\n", oxcf->two_pass_vbrbias); - printf("two_pass_vbrmin_section: %d\n", oxcf->two_pass_vbrmin_section); - printf("two_pass_vbrmax_section: %d\n", oxcf->two_pass_vbrmax_section); - printf("allow_lag: %d\n", oxcf->allow_lag); - printf("lag_in_frames: %d\n", oxcf->lag_in_frames); - printf("play_alternate: %d\n", oxcf->play_alternate); - printf("Version: %d\n", oxcf->Version); - printf("multi_threaded: %d\n", oxcf->multi_threaded); - printf("encode_breakout: %d\n", oxcf->encode_breakout); - */ - return VPX_CODEC_OK; -} - -static vpx_codec_err_t vp8e_set_config(vpx_codec_alg_priv_t *ctx, - const vpx_codec_enc_cfg_t *cfg) -{ - vpx_codec_err_t res; - - if (cfg->g_w != ctx->cfg.g_w || cfg->g_h != ctx->cfg.g_h) - { - if (cfg->g_lag_in_frames > 1 || cfg->g_pass != VPX_RC_ONE_PASS) - ERROR("Cannot change width or height after initialization"); - if ((ctx->cpi->initial_width && (int)cfg->g_w > ctx->cpi->initial_width) || - (ctx->cpi->initial_height && (int)cfg->g_h > ctx->cpi->initial_height)) - ERROR("Cannot increast width or height larger than their initial values"); - } - - /* Prevent increasing lag_in_frames. This check is stricter than it needs - * to be -- the limit is not increasing past the first lag_in_frames - * value, but we don't track the initial config, only the last successful - * config. - */ - if ((cfg->g_lag_in_frames > ctx->cfg.g_lag_in_frames)) - ERROR("Cannot increase lag_in_frames"); - - res = validate_config(ctx, cfg, &ctx->vp8_cfg, 0); - - if (!res) - { - ctx->cfg = *cfg; - set_vp8e_config(&ctx->oxcf, ctx->cfg, ctx->vp8_cfg, NULL); - vp8_change_config(ctx->cpi, &ctx->oxcf); - } - - return res; -} - -int vp8_reverse_trans(int); - -static vpx_codec_err_t get_quantizer(vpx_codec_alg_priv_t *ctx, va_list args) -{ - int *const arg = va_arg(args, int *); - if (arg == NULL) - return VPX_CODEC_INVALID_PARAM; - *arg = vp8_get_quantizer(ctx->cpi); - return VPX_CODEC_OK; -} - -static vpx_codec_err_t get_quantizer64(vpx_codec_alg_priv_t *ctx, va_list args) -{ - int *const arg = va_arg(args, int *); - if (arg == NULL) - return VPX_CODEC_INVALID_PARAM; - *arg = vp8_reverse_trans(vp8_get_quantizer(ctx->cpi)); - return VPX_CODEC_OK; -} - -static vpx_codec_err_t update_extracfg(vpx_codec_alg_priv_t *ctx, - const struct vp8_extracfg *extra_cfg) -{ - const vpx_codec_err_t res = validate_config(ctx, &ctx->cfg, extra_cfg, 0); - if (res == VPX_CODEC_OK) { - ctx->vp8_cfg = *extra_cfg; - set_vp8e_config(&ctx->oxcf, ctx->cfg, ctx->vp8_cfg, NULL); - vp8_change_config(ctx->cpi, &ctx->oxcf); - } - return res; -} - -static vpx_codec_err_t set_cpu_used(vpx_codec_alg_priv_t *ctx, va_list args) -{ - struct vp8_extracfg extra_cfg = ctx->vp8_cfg; - extra_cfg.cpu_used = CAST(VP8E_SET_CPUUSED, args); - return update_extracfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t set_enable_auto_alt_ref(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - struct vp8_extracfg extra_cfg = ctx->vp8_cfg; - extra_cfg.enable_auto_alt_ref = CAST(VP8E_SET_ENABLEAUTOALTREF, args); - return update_extracfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t set_noise_sensitivity(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - struct vp8_extracfg extra_cfg = ctx->vp8_cfg; - extra_cfg.noise_sensitivity = CAST(VP8E_SET_NOISE_SENSITIVITY, args); - return update_extracfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t set_sharpness(vpx_codec_alg_priv_t *ctx, va_list args) -{ - struct vp8_extracfg extra_cfg = ctx->vp8_cfg; - extra_cfg.Sharpness = CAST(VP8E_SET_SHARPNESS, args); - return update_extracfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t set_static_thresh(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - struct vp8_extracfg extra_cfg = ctx->vp8_cfg; - extra_cfg.static_thresh = CAST(VP8E_SET_STATIC_THRESHOLD, args); - return update_extracfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t set_token_partitions(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - struct vp8_extracfg extra_cfg = ctx->vp8_cfg; - extra_cfg.token_partitions = CAST(VP8E_SET_TOKEN_PARTITIONS, args); - return update_extracfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t set_arnr_max_frames(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - struct vp8_extracfg extra_cfg = ctx->vp8_cfg; - extra_cfg.arnr_max_frames = CAST(VP8E_SET_ARNR_MAXFRAMES, args); - return update_extracfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t set_arnr_strength(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - struct vp8_extracfg extra_cfg = ctx->vp8_cfg; - extra_cfg.arnr_strength = CAST(VP8E_SET_ARNR_STRENGTH, args); - return update_extracfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t set_arnr_type(vpx_codec_alg_priv_t *ctx, va_list args) -{ - struct vp8_extracfg extra_cfg = ctx->vp8_cfg; - extra_cfg.arnr_type = CAST(VP8E_SET_ARNR_TYPE, args); - return update_extracfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t set_tuning(vpx_codec_alg_priv_t *ctx, va_list args) -{ - struct vp8_extracfg extra_cfg = ctx->vp8_cfg; - extra_cfg.tuning = CAST(VP8E_SET_TUNING, args); - return update_extracfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t set_cq_level(vpx_codec_alg_priv_t *ctx, va_list args) -{ - struct vp8_extracfg extra_cfg = ctx->vp8_cfg; - extra_cfg.cq_level = CAST(VP8E_SET_CQ_LEVEL, args); - return update_extracfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t set_rc_max_intra_bitrate_pct(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - struct vp8_extracfg extra_cfg = ctx->vp8_cfg; - extra_cfg.rc_max_intra_bitrate_pct = - CAST(VP8E_SET_MAX_INTRA_BITRATE_PCT, args); - return update_extracfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t set_screen_content_mode(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - struct vp8_extracfg extra_cfg = ctx->vp8_cfg; - extra_cfg.screen_content_mode = - CAST(VP8E_SET_SCREEN_CONTENT_MODE, args); - return update_extracfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t vp8e_mr_alloc_mem(const vpx_codec_enc_cfg_t *cfg, - void **mem_loc) -{ - vpx_codec_err_t res = 0; - -#if CONFIG_MULTI_RES_ENCODING - LOWER_RES_FRAME_INFO *shared_mem_loc; - int mb_rows = ((cfg->g_w + 15) >>4); - int mb_cols = ((cfg->g_h + 15) >>4); - - shared_mem_loc = calloc(1, sizeof(LOWER_RES_FRAME_INFO)); - if(!shared_mem_loc) - { - res = VPX_CODEC_MEM_ERROR; - } - - shared_mem_loc->mb_info = calloc(mb_rows*mb_cols, sizeof(LOWER_RES_MB_INFO)); - if(!(shared_mem_loc->mb_info)) - { - res = VPX_CODEC_MEM_ERROR; - } - else - { - *mem_loc = (void *)shared_mem_loc; - res = VPX_CODEC_OK; - } -#else - (void)cfg; - (void)mem_loc; -#endif - return res; -} - -static vpx_codec_err_t vp8e_init(vpx_codec_ctx_t *ctx, - vpx_codec_priv_enc_mr_cfg_t *mr_cfg) -{ - vpx_codec_err_t res = VPX_CODEC_OK; - - - vp8_rtcd(); - - if (!ctx->priv) - { - struct vpx_codec_alg_priv *priv = - (struct vpx_codec_alg_priv *)vpx_calloc(1, sizeof(*priv)); - - if (!priv) - { - return VPX_CODEC_MEM_ERROR; - } - - ctx->priv = (vpx_codec_priv_t *)priv; - ctx->priv->init_flags = ctx->init_flags; - - if (ctx->config.enc) - { - /* Update the reference to the config structure to an - * internal copy. - */ - priv->cfg = *ctx->config.enc; - ctx->config.enc = &priv->cfg; - } - - priv->vp8_cfg = default_extracfg; - priv->vp8_cfg.pkt_list = &priv->pkt_list.head; - - priv->cx_data_sz = priv->cfg.g_w * priv->cfg.g_h * 3 / 2 * 2; - - if (priv->cx_data_sz < 32768) priv->cx_data_sz = 32768; - - priv->cx_data = malloc(priv->cx_data_sz); - - if (!priv->cx_data) - { - return VPX_CODEC_MEM_ERROR; - } - - if(mr_cfg) - ctx->priv->enc.total_encoders = mr_cfg->mr_total_resolutions; - else - ctx->priv->enc.total_encoders = 1; - - res = validate_config(priv, &priv->cfg, &priv->vp8_cfg, 0); - - if (!res) - { - set_vp8e_config(&priv->oxcf, priv->cfg, priv->vp8_cfg, mr_cfg); - priv->cpi = vp8_create_compressor(&priv->oxcf); - if (!priv->cpi) - res = VPX_CODEC_MEM_ERROR; - } - } - - return res; -} - -static vpx_codec_err_t vp8e_destroy(vpx_codec_alg_priv_t *ctx) -{ -#if CONFIG_MULTI_RES_ENCODING - /* Free multi-encoder shared memory */ - if (ctx->oxcf.mr_total_resolutions > 0 && (ctx->oxcf.mr_encoder_id == ctx->oxcf.mr_total_resolutions-1)) - { - LOWER_RES_FRAME_INFO *shared_mem_loc = (LOWER_RES_FRAME_INFO *)ctx->oxcf.mr_low_res_mode_info; - free(shared_mem_loc->mb_info); - free(ctx->oxcf.mr_low_res_mode_info); - } -#endif - - free(ctx->cx_data); - vp8_remove_compressor(&ctx->cpi); - vpx_free(ctx); - return VPX_CODEC_OK; -} - -static vpx_codec_err_t image2yuvconfig(const vpx_image_t *img, - YV12_BUFFER_CONFIG *yv12) -{ - const int y_w = img->d_w; - const int y_h = img->d_h; - const int uv_w = (img->d_w + 1) / 2; - const int uv_h = (img->d_h + 1) / 2; - vpx_codec_err_t res = VPX_CODEC_OK; - yv12->y_buffer = img->planes[VPX_PLANE_Y]; - yv12->u_buffer = img->planes[VPX_PLANE_U]; - yv12->v_buffer = img->planes[VPX_PLANE_V]; - - yv12->y_crop_width = y_w; - yv12->y_crop_height = y_h; - yv12->y_width = y_w; - yv12->y_height = y_h; - yv12->uv_crop_width = uv_w; - yv12->uv_crop_height = uv_h; - yv12->uv_width = uv_w; - yv12->uv_height = uv_h; - - yv12->y_stride = img->stride[VPX_PLANE_Y]; - yv12->uv_stride = img->stride[VPX_PLANE_U]; - - yv12->border = (img->stride[VPX_PLANE_Y] - img->w) / 2; - return res; -} - -static void pick_quickcompress_mode(vpx_codec_alg_priv_t *ctx, - unsigned long duration, - unsigned long deadline) -{ - unsigned int new_qc; - -#if !(CONFIG_REALTIME_ONLY) - /* Use best quality mode if no deadline is given. */ - new_qc = MODE_BESTQUALITY; - - if (deadline) - { - uint64_t duration_us; - - /* Convert duration parameter from stream timebase to microseconds */ - duration_us = (uint64_t)duration * 1000000 - * (uint64_t)ctx->cfg.g_timebase.num - / (uint64_t)ctx->cfg.g_timebase.den; - - /* If the deadline is more that the duration this frame is to be shown, - * use good quality mode. Otherwise use realtime mode. - */ - new_qc = (deadline > duration_us) ? MODE_GOODQUALITY : MODE_REALTIME; - } - -#else - new_qc = MODE_REALTIME; -#endif - - if (ctx->cfg.g_pass == VPX_RC_FIRST_PASS) - new_qc = MODE_FIRSTPASS; - else if (ctx->cfg.g_pass == VPX_RC_LAST_PASS) - new_qc = (new_qc == MODE_BESTQUALITY) - ? MODE_SECONDPASS_BEST - : MODE_SECONDPASS; - - if (ctx->oxcf.Mode != new_qc) - { - ctx->oxcf.Mode = new_qc; - vp8_change_config(ctx->cpi, &ctx->oxcf); - } -} - -static vpx_codec_err_t set_reference_and_update(vpx_codec_alg_priv_t *ctx, - int flags) -{ - - /* Handle Flags */ - if (((flags & VP8_EFLAG_NO_UPD_GF) && (flags & VP8_EFLAG_FORCE_GF)) - || ((flags & VP8_EFLAG_NO_UPD_ARF) && (flags & VP8_EFLAG_FORCE_ARF))) - { - ctx->base.err_detail = "Conflicting flags."; - return VPX_CODEC_INVALID_PARAM; - } - - if (flags & (VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_REF_GF - | VP8_EFLAG_NO_REF_ARF)) - { - int ref = 7; - - if (flags & VP8_EFLAG_NO_REF_LAST) - ref ^= VP8_LAST_FRAME; - - if (flags & VP8_EFLAG_NO_REF_GF) - ref ^= VP8_GOLD_FRAME; - - if (flags & VP8_EFLAG_NO_REF_ARF) - ref ^= VP8_ALTR_FRAME; - - vp8_use_as_reference(ctx->cpi, ref); - } - - if (flags & (VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF - | VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_FORCE_GF - | VP8_EFLAG_FORCE_ARF)) - { - int upd = 7; - - if (flags & VP8_EFLAG_NO_UPD_LAST) - upd ^= VP8_LAST_FRAME; - - if (flags & VP8_EFLAG_NO_UPD_GF) - upd ^= VP8_GOLD_FRAME; - - if (flags & VP8_EFLAG_NO_UPD_ARF) - upd ^= VP8_ALTR_FRAME; - - vp8_update_reference(ctx->cpi, upd); - } - - if (flags & VP8_EFLAG_NO_UPD_ENTROPY) - { - vp8_update_entropy(ctx->cpi, 0); - } - - return VPX_CODEC_OK; -} - -static vpx_codec_err_t vp8e_encode(vpx_codec_alg_priv_t *ctx, - const vpx_image_t *img, - vpx_codec_pts_t pts, - unsigned long duration, - vpx_enc_frame_flags_t flags, - unsigned long deadline) -{ - vpx_codec_err_t res = VPX_CODEC_OK; - - if (!ctx->cfg.rc_target_bitrate) - return res; - - if (!ctx->cfg.rc_target_bitrate) - return res; - - if (img) - res = validate_img(ctx, img); - - if (!res) - res = validate_config(ctx, &ctx->cfg, &ctx->vp8_cfg, 1); - - pick_quickcompress_mode(ctx, duration, deadline); - vpx_codec_pkt_list_init(&ctx->pkt_list); - - // If no flags are set in the encode call, then use the frame flags as - // defined via the control function: vp8e_set_frame_flags. - if (!flags) { - flags = ctx->control_frame_flags; - } - ctx->control_frame_flags = 0; - - res = set_reference_and_update(ctx, flags); - - /* Handle fixed keyframe intervals */ - if (ctx->cfg.kf_mode == VPX_KF_AUTO - && ctx->cfg.kf_min_dist == ctx->cfg.kf_max_dist) - { - if (++ctx->fixed_kf_cntr > ctx->cfg.kf_min_dist) - { - flags |= VPX_EFLAG_FORCE_KF; - ctx->fixed_kf_cntr = 1; - } - } - - /* Initialize the encoder instance on the first frame*/ - if (!res && ctx->cpi) - { - unsigned int lib_flags; - YV12_BUFFER_CONFIG sd; - int64_t dst_time_stamp, dst_end_time_stamp; - unsigned long size, cx_data_sz; - unsigned char *cx_data; - unsigned char *cx_data_end; - int comp_data_state = 0; - - /* Set up internal flags */ - if (ctx->base.init_flags & VPX_CODEC_USE_PSNR) - ((VP8_COMP *)ctx->cpi)->b_calculate_psnr = 1; - - if (ctx->base.init_flags & VPX_CODEC_USE_OUTPUT_PARTITION) - ((VP8_COMP *)ctx->cpi)->output_partition = 1; - - /* Convert API flags to internal codec lib flags */ - lib_flags = (flags & VPX_EFLAG_FORCE_KF) ? FRAMEFLAGS_KEY : 0; - - /* vp8 use 10,000,000 ticks/second as time stamp */ - dst_time_stamp = pts * 10000000 * ctx->cfg.g_timebase.num / ctx->cfg.g_timebase.den; - dst_end_time_stamp = (pts + duration) * 10000000 * ctx->cfg.g_timebase.num / ctx->cfg.g_timebase.den; - - if (img != NULL) - { - res = image2yuvconfig(img, &sd); - - if (vp8_receive_raw_frame(ctx->cpi, ctx->next_frame_flag | lib_flags, - &sd, dst_time_stamp, dst_end_time_stamp)) - { - VP8_COMP *cpi = (VP8_COMP *)ctx->cpi; - res = update_error_state(ctx, &cpi->common.error); - } - - /* reset for next frame */ - ctx->next_frame_flag = 0; - } - - cx_data = ctx->cx_data; - cx_data_sz = ctx->cx_data_sz; - cx_data_end = ctx->cx_data + cx_data_sz; - lib_flags = 0; - - while (cx_data_sz >= ctx->cx_data_sz / 2) - { - comp_data_state = vp8_get_compressed_data(ctx->cpi, - &lib_flags, - &size, - cx_data, - cx_data_end, - &dst_time_stamp, - &dst_end_time_stamp, - !img); - - if(comp_data_state == VPX_CODEC_CORRUPT_FRAME) - return VPX_CODEC_CORRUPT_FRAME; - else if(comp_data_state == -1) - break; - - if (size) - { - vpx_codec_pts_t round, delta; - vpx_codec_cx_pkt_t pkt; - VP8_COMP *cpi = (VP8_COMP *)ctx->cpi; - - /* Add the frame packet to the list of returned packets. */ - round = (vpx_codec_pts_t)10000000 - * ctx->cfg.g_timebase.num / 2 - 1; - delta = (dst_end_time_stamp - dst_time_stamp); - pkt.kind = VPX_CODEC_CX_FRAME_PKT; - pkt.data.frame.pts = - (dst_time_stamp * ctx->cfg.g_timebase.den + round) - / ctx->cfg.g_timebase.num / 10000000; - pkt.data.frame.duration = (unsigned long) - ((delta * ctx->cfg.g_timebase.den + round) - / ctx->cfg.g_timebase.num / 10000000); - pkt.data.frame.flags = lib_flags << 16; - - if (lib_flags & FRAMEFLAGS_KEY) - pkt.data.frame.flags |= VPX_FRAME_IS_KEY; - - if (!cpi->common.show_frame) - { - pkt.data.frame.flags |= VPX_FRAME_IS_INVISIBLE; - - /* This timestamp should be as close as possible to the - * prior PTS so that if a decoder uses pts to schedule when - * to do this, we start right after last frame was decoded. - * Invisible frames have no duration. - */ - pkt.data.frame.pts = ((cpi->last_time_stamp_seen - * ctx->cfg.g_timebase.den + round) - / ctx->cfg.g_timebase.num / 10000000) + 1; - pkt.data.frame.duration = 0; - } - - if (cpi->droppable) - pkt.data.frame.flags |= VPX_FRAME_IS_DROPPABLE; - - if (cpi->output_partition) - { - int i; - const int num_partitions = - (1 << cpi->common.multi_token_partition) + 1; - - pkt.data.frame.flags |= VPX_FRAME_IS_FRAGMENT; - - for (i = 0; i < num_partitions; ++i) - { -#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING - pkt.data.frame.buf = cpi->partition_d[i]; -#else - pkt.data.frame.buf = cx_data; - cx_data += cpi->partition_sz[i]; - cx_data_sz -= cpi->partition_sz[i]; -#endif - pkt.data.frame.sz = cpi->partition_sz[i]; - pkt.data.frame.partition_id = i; - /* don't set the fragment bit for the last partition */ - if (i == (num_partitions - 1)) - pkt.data.frame.flags &= ~VPX_FRAME_IS_FRAGMENT; - vpx_codec_pkt_list_add(&ctx->pkt_list.head, &pkt); - } -#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING - /* In lagged mode the encoder can buffer multiple frames. - * We don't want this in partitioned output because - * partitions are spread all over the output buffer. - * So, force an exit! - */ - cx_data_sz -= ctx->cx_data_sz / 2; -#endif - } - else - { - pkt.data.frame.buf = cx_data; - pkt.data.frame.sz = size; - pkt.data.frame.partition_id = -1; - vpx_codec_pkt_list_add(&ctx->pkt_list.head, &pkt); - cx_data += size; - cx_data_sz -= size; - } - } - } - } - - return res; -} - - -static const vpx_codec_cx_pkt_t *vp8e_get_cxdata(vpx_codec_alg_priv_t *ctx, - vpx_codec_iter_t *iter) -{ - return vpx_codec_pkt_list_get(&ctx->pkt_list.head, iter); -} - -static vpx_codec_err_t vp8e_set_reference(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *); - - if (data) - { - vpx_ref_frame_t *frame = (vpx_ref_frame_t *)data; - YV12_BUFFER_CONFIG sd; - - image2yuvconfig(&frame->img, &sd); - vp8_set_reference(ctx->cpi, frame->frame_type, &sd); - return VPX_CODEC_OK; - } - else - return VPX_CODEC_INVALID_PARAM; - -} - -static vpx_codec_err_t vp8e_get_reference(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - - vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *); - - if (data) - { - vpx_ref_frame_t *frame = (vpx_ref_frame_t *)data; - YV12_BUFFER_CONFIG sd; - - image2yuvconfig(&frame->img, &sd); - vp8_get_reference(ctx->cpi, frame->frame_type, &sd); - return VPX_CODEC_OK; - } - else - return VPX_CODEC_INVALID_PARAM; -} - -static vpx_codec_err_t vp8e_set_previewpp(vpx_codec_alg_priv_t *ctx, - va_list args) -{ -#if CONFIG_POSTPROC - vp8_postproc_cfg_t *data = va_arg(args, vp8_postproc_cfg_t *); - - if (data) - { - ctx->preview_ppcfg = *((vp8_postproc_cfg_t *)data); - return VPX_CODEC_OK; - } - else - return VPX_CODEC_INVALID_PARAM; -#else - (void)ctx; - (void)args; - return VPX_CODEC_INCAPABLE; -#endif -} - - -static vpx_image_t *vp8e_get_preview(vpx_codec_alg_priv_t *ctx) -{ - - YV12_BUFFER_CONFIG sd; - vp8_ppflags_t flags = {0}; - - if (ctx->preview_ppcfg.post_proc_flag) - { - flags.post_proc_flag = ctx->preview_ppcfg.post_proc_flag; - flags.deblocking_level = ctx->preview_ppcfg.deblocking_level; - flags.noise_level = ctx->preview_ppcfg.noise_level; - } - - if (0 == vp8_get_preview_raw_frame(ctx->cpi, &sd, &flags)) - { - - /* - vpx_img_wrap(&ctx->preview_img, VPX_IMG_FMT_YV12, - sd.y_width + 2*VP8BORDERINPIXELS, - sd.y_height + 2*VP8BORDERINPIXELS, - 1, - sd.buffer_alloc); - vpx_img_set_rect(&ctx->preview_img, - VP8BORDERINPIXELS, VP8BORDERINPIXELS, - sd.y_width, sd.y_height); - */ - - ctx->preview_img.bps = 12; - ctx->preview_img.planes[VPX_PLANE_Y] = sd.y_buffer; - ctx->preview_img.planes[VPX_PLANE_U] = sd.u_buffer; - ctx->preview_img.planes[VPX_PLANE_V] = sd.v_buffer; - - ctx->preview_img.fmt = VPX_IMG_FMT_I420; - ctx->preview_img.x_chroma_shift = 1; - ctx->preview_img.y_chroma_shift = 1; - - ctx->preview_img.d_w = sd.y_width; - ctx->preview_img.d_h = sd.y_height; - ctx->preview_img.stride[VPX_PLANE_Y] = sd.y_stride; - ctx->preview_img.stride[VPX_PLANE_U] = sd.uv_stride; - ctx->preview_img.stride[VPX_PLANE_V] = sd.uv_stride; - ctx->preview_img.w = sd.y_width; - ctx->preview_img.h = sd.y_height; - - return &ctx->preview_img; - } - else - return NULL; -} - -static vpx_codec_err_t vp8e_update_entropy(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - int update = va_arg(args, int); - vp8_update_entropy(ctx->cpi, update); - return VPX_CODEC_OK; - -} - -static vpx_codec_err_t vp8e_update_reference(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - int update = va_arg(args, int); - vp8_update_reference(ctx->cpi, update); - return VPX_CODEC_OK; -} - -static vpx_codec_err_t vp8e_use_reference(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - int reference_flag = va_arg(args, int); - vp8_use_as_reference(ctx->cpi, reference_flag); - return VPX_CODEC_OK; -} - -static vpx_codec_err_t vp8e_set_frame_flags(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - int frame_flags = va_arg(args, int); - ctx->control_frame_flags = frame_flags; - return set_reference_and_update(ctx, frame_flags); -} - -static vpx_codec_err_t vp8e_set_temporal_layer_id(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - int layer_id = va_arg(args, int); - if (layer_id < 0 || layer_id >= (int)ctx->cfg.ts_number_layers) { - return VPX_CODEC_INVALID_PARAM; - } - ctx->cpi->temporal_layer_id = layer_id; - return VPX_CODEC_OK; -} - -static vpx_codec_err_t vp8e_set_roi_map(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - vpx_roi_map_t *data = va_arg(args, vpx_roi_map_t *); - - if (data) - { - vpx_roi_map_t *roi = (vpx_roi_map_t *)data; - - if (!vp8_set_roimap(ctx->cpi, roi->roi_map, roi->rows, roi->cols, roi->delta_q, roi->delta_lf, roi->static_threshold)) - return VPX_CODEC_OK; - else - return VPX_CODEC_INVALID_PARAM; - } - else - return VPX_CODEC_INVALID_PARAM; -} - - -static vpx_codec_err_t vp8e_set_activemap(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - vpx_active_map_t *data = va_arg(args, vpx_active_map_t *); - - if (data) - { - - vpx_active_map_t *map = (vpx_active_map_t *)data; - - if (!vp8_set_active_map(ctx->cpi, map->active_map, map->rows, map->cols)) - return VPX_CODEC_OK; - else - return VPX_CODEC_INVALID_PARAM; - } - else - return VPX_CODEC_INVALID_PARAM; -} - -static vpx_codec_err_t vp8e_set_scalemode(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - - vpx_scaling_mode_t *data = va_arg(args, vpx_scaling_mode_t *); - - if (data) - { - int res; - vpx_scaling_mode_t scalemode = *(vpx_scaling_mode_t *)data ; - res = vp8_set_internal_size(ctx->cpi, - (VPX_SCALING)scalemode.h_scaling_mode, - (VPX_SCALING)scalemode.v_scaling_mode); - - if (!res) - { - /*force next frame a key frame to effect scaling mode */ - ctx->next_frame_flag |= FRAMEFLAGS_KEY; - return VPX_CODEC_OK; - } - else - return VPX_CODEC_INVALID_PARAM; - } - else - return VPX_CODEC_INVALID_PARAM; -} - - -static vpx_codec_ctrl_fn_map_t vp8e_ctf_maps[] = -{ - {VP8_SET_REFERENCE, vp8e_set_reference}, - {VP8_COPY_REFERENCE, vp8e_get_reference}, - {VP8_SET_POSTPROC, vp8e_set_previewpp}, - {VP8E_UPD_ENTROPY, vp8e_update_entropy}, - {VP8E_UPD_REFERENCE, vp8e_update_reference}, - {VP8E_USE_REFERENCE, vp8e_use_reference}, - {VP8E_SET_FRAME_FLAGS, vp8e_set_frame_flags}, - {VP8E_SET_TEMPORAL_LAYER_ID, vp8e_set_temporal_layer_id}, - {VP8E_SET_ROI_MAP, vp8e_set_roi_map}, - {VP8E_SET_ACTIVEMAP, vp8e_set_activemap}, - {VP8E_SET_SCALEMODE, vp8e_set_scalemode}, - {VP8E_SET_CPUUSED, set_cpu_used}, - {VP8E_SET_NOISE_SENSITIVITY, set_noise_sensitivity}, - {VP8E_SET_ENABLEAUTOALTREF, set_enable_auto_alt_ref}, - {VP8E_SET_SHARPNESS, set_sharpness}, - {VP8E_SET_STATIC_THRESHOLD, set_static_thresh}, - {VP8E_SET_TOKEN_PARTITIONS, set_token_partitions}, - {VP8E_GET_LAST_QUANTIZER, get_quantizer}, - {VP8E_GET_LAST_QUANTIZER_64, get_quantizer64}, - {VP8E_SET_ARNR_MAXFRAMES, set_arnr_max_frames}, - {VP8E_SET_ARNR_STRENGTH , set_arnr_strength}, - {VP8E_SET_ARNR_TYPE , set_arnr_type}, - {VP8E_SET_TUNING, set_tuning}, - {VP8E_SET_CQ_LEVEL, set_cq_level}, - {VP8E_SET_MAX_INTRA_BITRATE_PCT, set_rc_max_intra_bitrate_pct}, - {VP8E_SET_SCREEN_CONTENT_MODE, set_screen_content_mode}, - { -1, NULL}, -}; - -static vpx_codec_enc_cfg_map_t vp8e_usage_cfg_map[] = -{ - { - 0, - { - 0, /* g_usage */ - 0, /* g_threads */ - 0, /* g_profile */ - - 320, /* g_width */ - 240, /* g_height */ - VPX_BITS_8, /* g_bit_depth */ - 8, /* g_input_bit_depth */ - - {1, 30}, /* g_timebase */ - - 0, /* g_error_resilient */ - - VPX_RC_ONE_PASS, /* g_pass */ - - 0, /* g_lag_in_frames */ - - 0, /* rc_dropframe_thresh */ - 0, /* rc_resize_allowed */ - 1, /* rc_scaled_width */ - 1, /* rc_scaled_height */ - 60, /* rc_resize_down_thresold */ - 30, /* rc_resize_up_thresold */ - - VPX_VBR, /* rc_end_usage */ - {0}, /* rc_twopass_stats_in */ - {0}, /* rc_firstpass_mb_stats_in */ - 256, /* rc_target_bandwidth */ - 4, /* rc_min_quantizer */ - 63, /* rc_max_quantizer */ - 100, /* rc_undershoot_pct */ - 100, /* rc_overshoot_pct */ - - 6000, /* rc_max_buffer_size */ - 4000, /* rc_buffer_initial_size; */ - 5000, /* rc_buffer_optimal_size; */ - - 50, /* rc_two_pass_vbrbias */ - 0, /* rc_two_pass_vbrmin_section */ - 400, /* rc_two_pass_vbrmax_section */ - - /* keyframing settings (kf) */ - VPX_KF_AUTO, /* g_kfmode*/ - 0, /* kf_min_dist */ - 128, /* kf_max_dist */ - - VPX_SS_DEFAULT_LAYERS, /* ss_number_layers */ - {0}, - {0}, /* ss_target_bitrate */ - 1, /* ts_number_layers */ - {0}, /* ts_target_bitrate */ - {0}, /* ts_rate_decimator */ - 0, /* ts_periodicity */ - {0}, /* ts_layer_id */ - }}, -}; - - -#ifndef VERSION_STRING -#define VERSION_STRING -#endif -CODEC_INTERFACE(vpx_codec_vp8_cx) = -{ - "WebM Project VP8 Encoder" VERSION_STRING, - VPX_CODEC_INTERNAL_ABI_VERSION, - VPX_CODEC_CAP_ENCODER | VPX_CODEC_CAP_PSNR | - VPX_CODEC_CAP_OUTPUT_PARTITION, - /* vpx_codec_caps_t caps; */ - vp8e_init, /* vpx_codec_init_fn_t init; */ - vp8e_destroy, /* vpx_codec_destroy_fn_t destroy; */ - vp8e_ctf_maps, /* vpx_codec_ctrl_fn_map_t *ctrl_maps; */ - { - NULL, /* vpx_codec_peek_si_fn_t peek_si; */ - NULL, /* vpx_codec_get_si_fn_t get_si; */ - NULL, /* vpx_codec_decode_fn_t decode; */ - NULL, /* vpx_codec_frame_get_fn_t frame_get; */ - NULL, /* vpx_codec_set_fb_fn_t set_fb_fn; */ - }, - { - 1, /* 1 cfg map */ - vp8e_usage_cfg_map, /* vpx_codec_enc_cfg_map_t cfg_maps; */ - vp8e_encode, /* vpx_codec_encode_fn_t encode; */ - vp8e_get_cxdata, /* vpx_codec_get_cx_data_fn_t get_cx_data; */ - vp8e_set_config, - NULL, - vp8e_get_preview, - vp8e_mr_alloc_mem, - } /* encoder functions */ -}; diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/vp8cx.mk gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/vp8cx.mk --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/vp8cx.mk 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/vp8cx.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,108 +0,0 @@ -## -## Copyright (c) 2010 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - - -VP8_CX_EXPORTS += exports_enc - -VP8_CX_SRCS-yes += $(VP8_COMMON_SRCS-yes) -VP8_CX_SRCS-no += $(VP8_COMMON_SRCS-no) -VP8_CX_SRCS_REMOVE-yes += $(VP8_COMMON_SRCS_REMOVE-yes) -VP8_CX_SRCS_REMOVE-no += $(VP8_COMMON_SRCS_REMOVE-no) - -ifeq ($(ARCH_ARM),yes) - include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8cx_arm.mk -endif - -VP8_CX_SRCS-yes += vp8cx.mk - -VP8_CX_SRCS-yes += vp8_cx_iface.c - -VP8_CX_SRCS-yes += encoder/defaultcoefcounts.h -VP8_CX_SRCS-yes += encoder/bitstream.c -VP8_CX_SRCS-yes += encoder/boolhuff.c -VP8_CX_SRCS-yes += encoder/dct.c -VP8_CX_SRCS-yes += encoder/encodeframe.c -VP8_CX_SRCS-yes += encoder/encodeframe.h -VP8_CX_SRCS-yes += encoder/encodeintra.c -VP8_CX_SRCS-yes += encoder/encodemb.c -VP8_CX_SRCS-yes += encoder/encodemv.c -VP8_CX_SRCS-$(CONFIG_MULTITHREAD) += encoder/ethreading.c -VP8_CX_SRCS-yes += encoder/firstpass.c -VP8_CX_SRCS-yes += encoder/block.h -VP8_CX_SRCS-yes += encoder/boolhuff.h -VP8_CX_SRCS-yes += encoder/bitstream.h -VP8_CX_SRCS-$(CONFIG_TEMPORAL_DENOISING) += encoder/denoising.h -VP8_CX_SRCS-$(CONFIG_TEMPORAL_DENOISING) += encoder/denoising.c -VP8_CX_SRCS-yes += encoder/encodeintra.h -VP8_CX_SRCS-yes += encoder/encodemb.h -VP8_CX_SRCS-yes += encoder/encodemv.h -VP8_CX_SRCS-yes += encoder/firstpass.h -VP8_CX_SRCS-yes += encoder/lookahead.c -VP8_CX_SRCS-yes += encoder/lookahead.h -VP8_CX_SRCS-yes += encoder/mcomp.h -VP8_CX_SRCS-yes += encoder/modecosts.h -VP8_CX_SRCS-yes += encoder/onyx_int.h -VP8_CX_SRCS-yes += encoder/pickinter.h -VP8_CX_SRCS-yes += encoder/quantize.h -VP8_CX_SRCS-yes += encoder/ratectrl.h -VP8_CX_SRCS-yes += encoder/rdopt.h -VP8_CX_SRCS-yes += encoder/tokenize.h -VP8_CX_SRCS-yes += encoder/treewriter.h -VP8_CX_SRCS-yes += encoder/mcomp.c -VP8_CX_SRCS-yes += encoder/modecosts.c -VP8_CX_SRCS-yes += encoder/onyx_if.c -VP8_CX_SRCS-yes += encoder/pickinter.c -VP8_CX_SRCS-yes += encoder/picklpf.c -VP8_CX_SRCS-yes += encoder/quantize.c -VP8_CX_SRCS-yes += encoder/ratectrl.c -VP8_CX_SRCS-yes += encoder/rdopt.c -VP8_CX_SRCS-yes += encoder/segmentation.c -VP8_CX_SRCS-yes += encoder/segmentation.h -VP8_CX_SRCS-$(CONFIG_INTERNAL_STATS) += encoder/ssim.c -VP8_CX_SRCS-yes += encoder/tokenize.c -VP8_CX_SRCS-yes += encoder/dct_value_cost.h -VP8_CX_SRCS-yes += encoder/dct_value_tokens.h -VP8_CX_SRCS-yes += encoder/treewriter.c -VP8_CX_SRCS-$(CONFIG_INTERNAL_STATS) += common/postproc.h -VP8_CX_SRCS-$(CONFIG_INTERNAL_STATS) += common/postproc.c -VP8_CX_SRCS-yes += encoder/temporal_filter.c -VP8_CX_SRCS-$(CONFIG_MULTI_RES_ENCODING) += encoder/mr_dissim.c -VP8_CX_SRCS-$(CONFIG_MULTI_RES_ENCODING) += encoder/mr_dissim.h - -ifeq ($(CONFIG_REALTIME_ONLY),yes) -VP8_CX_SRCS_REMOVE-yes += encoder/firstpass.c -VP8_CX_SRCS_REMOVE-yes += encoder/temporal_filter.c -endif - -VP8_CX_SRCS-$(HAVE_MMX) += encoder/x86/dct_mmx.asm -VP8_CX_SRCS-$(HAVE_MMX) += encoder/x86/subtract_mmx.asm -VP8_CX_SRCS-$(HAVE_MMX) += encoder/x86/vp8_enc_stubs_mmx.c -VP8_CX_SRCS-$(HAVE_SSE2) += encoder/x86/dct_sse2.asm -VP8_CX_SRCS-$(HAVE_SSE2) += encoder/x86/fwalsh_sse2.asm -VP8_CX_SRCS-$(HAVE_SSE2) += encoder/x86/quantize_sse2.c -VP8_CX_SRCS-$(HAVE_SSSE3) += encoder/x86/quantize_ssse3.c -VP8_CX_SRCS-$(HAVE_SSE4_1) += encoder/x86/quantize_sse4.c - -ifeq ($(CONFIG_TEMPORAL_DENOISING),yes) -VP8_CX_SRCS-$(HAVE_SSE2) += encoder/x86/denoising_sse2.c -endif - -VP8_CX_SRCS-$(HAVE_SSE2) += encoder/x86/subtract_sse2.asm -VP8_CX_SRCS-$(HAVE_SSE2) += encoder/x86/temporal_filter_apply_sse2.asm -VP8_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp8_enc_stubs_sse2.c -VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/quantize_mmx.asm -VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/encodeopt.asm -VP8_CX_SRCS-$(ARCH_X86_64) += encoder/x86/ssim_opt_x86_64.asm - -ifeq ($(CONFIG_REALTIME_ONLY),yes) -VP8_CX_SRCS_REMOVE-$(HAVE_SSE2) += encoder/x86/temporal_filter_apply_sse2.asm -endif - -VP8_CX_SRCS-yes := $(filter-out $(VP8_CX_SRCS_REMOVE-yes),$(VP8_CX_SRCS-yes)) diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/vp8_dx_iface.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/vp8_dx_iface.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/vp8_dx_iface.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/vp8_dx_iface.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,829 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include -#include -#include "vp8_rtcd.h" -#include "vpx/vpx_decoder.h" -#include "vpx/vp8dx.h" -#include "vpx/internal/vpx_codec_internal.h" -#include "vpx_version.h" -#include "common/alloccommon.h" -#include "common/common.h" -#include "common/onyxd.h" -#include "decoder/onyxd_int.h" -#include "vpx_mem/vpx_mem.h" -#if CONFIG_ERROR_CONCEALMENT -#include "decoder/error_concealment.h" -#endif -#include "decoder/decoderthreading.h" - -#define VP8_CAP_POSTPROC (CONFIG_POSTPROC ? VPX_CODEC_CAP_POSTPROC : 0) -#define VP8_CAP_ERROR_CONCEALMENT (CONFIG_ERROR_CONCEALMENT ? \ - VPX_CODEC_CAP_ERROR_CONCEALMENT : 0) - -typedef vpx_codec_stream_info_t vp8_stream_info_t; - -/* Structures for handling memory allocations */ -typedef enum -{ - VP8_SEG_ALG_PRIV = 256, - VP8_SEG_MAX -} mem_seg_id_t; -#define NELEMENTS(x) ((int)(sizeof(x)/sizeof(x[0]))) - -static unsigned long vp8_priv_sz(const vpx_codec_dec_cfg_t *si, vpx_codec_flags_t); - -struct vpx_codec_alg_priv -{ - vpx_codec_priv_t base; - vpx_codec_dec_cfg_t cfg; - vp8_stream_info_t si; - int decoder_init; - int postproc_cfg_set; - vp8_postproc_cfg_t postproc_cfg; -#if CONFIG_POSTPROC_VISUALIZER - unsigned int dbg_postproc_flag; - int dbg_color_ref_frame_flag; - int dbg_color_mb_modes_flag; - int dbg_color_b_modes_flag; - int dbg_display_mv_flag; -#endif - vpx_decrypt_cb decrypt_cb; - void *decrypt_state; - vpx_image_t img; - int img_setup; - struct frame_buffers yv12_frame_buffers; - void *user_priv; - FRAGMENT_DATA fragments; -}; - -static unsigned long vp8_priv_sz(const vpx_codec_dec_cfg_t *si, vpx_codec_flags_t flags) -{ - /* Although this declaration is constant, we can't use it in the requested - * segments list because we want to define the requested segments list - * before defining the private type (so that the number of memory maps is - * known) - */ - (void)si; - (void)flags; - return sizeof(vpx_codec_alg_priv_t); -} - -static void vp8_init_ctx(vpx_codec_ctx_t *ctx) -{ - vpx_codec_alg_priv_t *priv = - (vpx_codec_alg_priv_t *)vpx_calloc(1, sizeof(*priv)); - - ctx->priv = (vpx_codec_priv_t *)priv; - ctx->priv->init_flags = ctx->init_flags; - - priv->si.sz = sizeof(priv->si); - priv->decrypt_cb = NULL; - priv->decrypt_state = NULL; - - if (ctx->config.dec) - { - /* Update the reference to the config structure to an internal copy. */ - priv->cfg = *ctx->config.dec; - ctx->config.dec = &priv->cfg; - } -} - -static vpx_codec_err_t vp8_init(vpx_codec_ctx_t *ctx, - vpx_codec_priv_enc_mr_cfg_t *data) -{ - vpx_codec_err_t res = VPX_CODEC_OK; - vpx_codec_alg_priv_t *priv = NULL; - (void) data; - - vp8_rtcd(); - - /* This function only allocates space for the vpx_codec_alg_priv_t - * structure. More memory may be required at the time the stream - * information becomes known. - */ - if (!ctx->priv) { - vp8_init_ctx(ctx); - priv = (vpx_codec_alg_priv_t *)ctx->priv; - - /* initialize number of fragments to zero */ - priv->fragments.count = 0; - /* is input fragments enabled? */ - priv->fragments.enabled = - (priv->base.init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS); - - /*post processing level initialized to do nothing */ - } else { - priv = (vpx_codec_alg_priv_t *)ctx->priv; - } - - priv->yv12_frame_buffers.use_frame_threads = - (ctx->priv->init_flags & VPX_CODEC_USE_FRAME_THREADING); - - /* for now, disable frame threading */ - priv->yv12_frame_buffers.use_frame_threads = 0; - - if (priv->yv12_frame_buffers.use_frame_threads && - ((ctx->priv->init_flags & VPX_CODEC_USE_ERROR_CONCEALMENT) || - (ctx->priv->init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS))) { - /* row-based threading, error concealment, and input fragments will - * not be supported when using frame-based threading */ - res = VPX_CODEC_INVALID_PARAM; - } - - return res; -} - -static vpx_codec_err_t vp8_destroy(vpx_codec_alg_priv_t *ctx) -{ - vp8_remove_decoder_instances(&ctx->yv12_frame_buffers); - - vpx_free(ctx); - - return VPX_CODEC_OK; -} - -static vpx_codec_err_t vp8_peek_si_internal(const uint8_t *data, - unsigned int data_sz, - vpx_codec_stream_info_t *si, - vpx_decrypt_cb decrypt_cb, - void *decrypt_state) -{ - vpx_codec_err_t res = VPX_CODEC_OK; - - if(data + data_sz <= data) - { - res = VPX_CODEC_INVALID_PARAM; - } - else - { - /* Parse uncompresssed part of key frame header. - * 3 bytes:- including version, frame type and an offset - * 3 bytes:- sync code (0x9d, 0x01, 0x2a) - * 4 bytes:- including image width and height in the lowest 14 bits - * of each 2-byte value. - */ - uint8_t clear_buffer[10]; - const uint8_t *clear = data; - if (decrypt_cb) - { - int n = MIN(sizeof(clear_buffer), data_sz); - decrypt_cb(decrypt_state, data, clear_buffer, n); - clear = clear_buffer; - } - si->is_kf = 0; - - if (data_sz >= 10 && !(clear[0] & 0x01)) /* I-Frame */ - { - si->is_kf = 1; - - /* vet via sync code */ - if (clear[3] != 0x9d || clear[4] != 0x01 || clear[5] != 0x2a) - return VPX_CODEC_UNSUP_BITSTREAM; - - si->w = (clear[6] | (clear[7] << 8)) & 0x3fff; - si->h = (clear[8] | (clear[9] << 8)) & 0x3fff; - - /*printf("w=%d, h=%d\n", si->w, si->h);*/ - if (!(si->h | si->w)) - res = VPX_CODEC_UNSUP_BITSTREAM; - } - else - { - res = VPX_CODEC_UNSUP_BITSTREAM; - } - } - - return res; -} - -static vpx_codec_err_t vp8_peek_si(const uint8_t *data, - unsigned int data_sz, - vpx_codec_stream_info_t *si) { - return vp8_peek_si_internal(data, data_sz, si, NULL, NULL); -} - -static vpx_codec_err_t vp8_get_si(vpx_codec_alg_priv_t *ctx, - vpx_codec_stream_info_t *si) -{ - - unsigned int sz; - - if (si->sz >= sizeof(vp8_stream_info_t)) - sz = sizeof(vp8_stream_info_t); - else - sz = sizeof(vpx_codec_stream_info_t); - - memcpy(si, &ctx->si, sz); - si->sz = sz; - - return VPX_CODEC_OK; -} - - -static vpx_codec_err_t -update_error_state(vpx_codec_alg_priv_t *ctx, - const struct vpx_internal_error_info *error) -{ - vpx_codec_err_t res; - - if ((res = error->error_code)) - ctx->base.err_detail = error->has_detail - ? error->detail - : NULL; - - return res; -} - -static void yuvconfig2image(vpx_image_t *img, - const YV12_BUFFER_CONFIG *yv12, - void *user_priv) -{ - /** vpx_img_wrap() doesn't allow specifying independent strides for - * the Y, U, and V planes, nor other alignment adjustments that - * might be representable by a YV12_BUFFER_CONFIG, so we just - * initialize all the fields.*/ - img->fmt = VPX_IMG_FMT_I420; - img->w = yv12->y_stride; - img->h = (yv12->y_height + 2 * VP8BORDERINPIXELS + 15) & ~15; - img->d_w = yv12->y_width; - img->d_h = yv12->y_height; - img->x_chroma_shift = 1; - img->y_chroma_shift = 1; - img->planes[VPX_PLANE_Y] = yv12->y_buffer; - img->planes[VPX_PLANE_U] = yv12->u_buffer; - img->planes[VPX_PLANE_V] = yv12->v_buffer; - img->planes[VPX_PLANE_ALPHA] = NULL; - img->stride[VPX_PLANE_Y] = yv12->y_stride; - img->stride[VPX_PLANE_U] = yv12->uv_stride; - img->stride[VPX_PLANE_V] = yv12->uv_stride; - img->stride[VPX_PLANE_ALPHA] = yv12->y_stride; - img->bit_depth = 8; - img->bps = 12; - img->user_priv = user_priv; - img->img_data = yv12->buffer_alloc; - img->img_data_owner = 0; - img->self_allocd = 0; -} - -static int -update_fragments(vpx_codec_alg_priv_t *ctx, - const uint8_t *data, - unsigned int data_sz, - vpx_codec_err_t *res) -{ - *res = VPX_CODEC_OK; - - if (ctx->fragments.count == 0) - { - /* New frame, reset fragment pointers and sizes */ - vpx_memset((void*)ctx->fragments.ptrs, 0, sizeof(ctx->fragments.ptrs)); - vpx_memset(ctx->fragments.sizes, 0, sizeof(ctx->fragments.sizes)); - } - if (ctx->fragments.enabled && !(data == NULL && data_sz == 0)) - { - /* Store a pointer to this fragment and return. We haven't - * received the complete frame yet, so we will wait with decoding. - */ - ctx->fragments.ptrs[ctx->fragments.count] = data; - ctx->fragments.sizes[ctx->fragments.count] = data_sz; - ctx->fragments.count++; - if (ctx->fragments.count > (1 << EIGHT_PARTITION) + 1) - { - ctx->fragments.count = 0; - *res = VPX_CODEC_INVALID_PARAM; - return -1; - } - return 0; - } - - if (!ctx->fragments.enabled && (data == NULL && data_sz == 0)) - { - return 0; - } - - if (!ctx->fragments.enabled) - { - ctx->fragments.ptrs[0] = data; - ctx->fragments.sizes[0] = data_sz; - ctx->fragments.count = 1; - } - - return 1; -} - -static vpx_codec_err_t vp8_decode(vpx_codec_alg_priv_t *ctx, - const uint8_t *data, - unsigned int data_sz, - void *user_priv, - long deadline) -{ - vpx_codec_err_t res = VPX_CODEC_OK; - unsigned int resolution_change = 0; - unsigned int w, h; - - if (!ctx->fragments.enabled && (data == NULL && data_sz == 0)) - { - return 0; - } - - /* Update the input fragment data */ - if(update_fragments(ctx, data, data_sz, &res) <= 0) - return res; - - /* Determine the stream parameters. Note that we rely on peek_si to - * validate that we have a buffer that does not wrap around the top - * of the heap. - */ - w = ctx->si.w; - h = ctx->si.h; - - res = vp8_peek_si_internal(ctx->fragments.ptrs[0], ctx->fragments.sizes[0], - &ctx->si, ctx->decrypt_cb, ctx->decrypt_state); - - if((res == VPX_CODEC_UNSUP_BITSTREAM) && !ctx->si.is_kf) - { - /* the peek function returns an error for non keyframes, however for - * this case, it is not an error */ - res = VPX_CODEC_OK; - } - - if(!ctx->decoder_init && !ctx->si.is_kf) - res = VPX_CODEC_UNSUP_BITSTREAM; - - if ((ctx->si.h != h) || (ctx->si.w != w)) - resolution_change = 1; - - /* Initialize the decoder instance on the first frame*/ - if (!res && !ctx->decoder_init) - { - VP8D_CONFIG oxcf; - - oxcf.Width = ctx->si.w; - oxcf.Height = ctx->si.h; - oxcf.Version = 9; - oxcf.postprocess = 0; - oxcf.max_threads = ctx->cfg.threads; - oxcf.error_concealment = - (ctx->base.init_flags & VPX_CODEC_USE_ERROR_CONCEALMENT); - - /* If postprocessing was enabled by the application and a - * configuration has not been provided, default it. - */ - if (!ctx->postproc_cfg_set - && (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC)) { - ctx->postproc_cfg.post_proc_flag = - VP8_DEBLOCK | VP8_DEMACROBLOCK | VP8_MFQE; - ctx->postproc_cfg.deblocking_level = 4; - ctx->postproc_cfg.noise_level = 0; - } - - res = vp8_create_decoder_instances(&ctx->yv12_frame_buffers, &oxcf); - ctx->decoder_init = 1; - } - - /* Set these even if already initialized. The caller may have changed the - * decrypt config between frames. - */ - if (ctx->decoder_init) { - ctx->yv12_frame_buffers.pbi[0]->decrypt_cb = ctx->decrypt_cb; - ctx->yv12_frame_buffers.pbi[0]->decrypt_state = ctx->decrypt_state; - } - - if (!res) - { - VP8D_COMP *pbi = ctx->yv12_frame_buffers.pbi[0]; - if (resolution_change) - { - VP8_COMMON *const pc = & pbi->common; - MACROBLOCKD *const xd = & pbi->mb; -#if CONFIG_MULTITHREAD - int i; -#endif - pc->Width = ctx->si.w; - pc->Height = ctx->si.h; - { - int prev_mb_rows = pc->mb_rows; - - if (setjmp(pbi->common.error.jmp)) - { - pbi->common.error.setjmp = 0; - vp8_clear_system_state(); - /* same return value as used in vp8dx_receive_compressed_data */ - return -1; - } - - pbi->common.error.setjmp = 1; - - if (pc->Width <= 0) - { - pc->Width = w; - vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME, - "Invalid frame width"); - } - - if (pc->Height <= 0) - { - pc->Height = h; - vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME, - "Invalid frame height"); - } - - if (vp8_alloc_frame_buffers(pc, pc->Width, pc->Height)) - vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR, - "Failed to allocate frame buffers"); - - xd->pre = pc->yv12_fb[pc->lst_fb_idx]; - xd->dst = pc->yv12_fb[pc->new_fb_idx]; - -#if CONFIG_MULTITHREAD - for (i = 0; i < pbi->allocated_decoding_thread_count; i++) - { - pbi->mb_row_di[i].mbd.dst = pc->yv12_fb[pc->new_fb_idx]; - vp8_build_block_doffsets(&pbi->mb_row_di[i].mbd); - } -#endif - vp8_build_block_doffsets(&pbi->mb); - - /* allocate memory for last frame MODE_INFO array */ -#if CONFIG_ERROR_CONCEALMENT - - if (pbi->ec_enabled) - { - /* old prev_mip was released by vp8_de_alloc_frame_buffers() - * called in vp8_alloc_frame_buffers() */ - pc->prev_mip = vpx_calloc( - (pc->mb_cols + 1) * (pc->mb_rows + 1), - sizeof(MODE_INFO)); - - if (!pc->prev_mip) - { - vp8_de_alloc_frame_buffers(pc); - vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR, - "Failed to allocate" - "last frame MODE_INFO array"); - } - - pc->prev_mi = pc->prev_mip + pc->mode_info_stride + 1; - - if (vp8_alloc_overlap_lists(pbi)) - vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR, - "Failed to allocate overlap lists " - "for error concealment"); - } - -#endif - -#if CONFIG_MULTITHREAD - if (pbi->b_multithreaded_rd) - vp8mt_alloc_temp_buffers(pbi, pc->Width, prev_mb_rows); -#else - (void)prev_mb_rows; -#endif - } - - pbi->common.error.setjmp = 0; - - /* required to get past the first get_free_fb() call */ - pbi->common.fb_idx_ref_cnt[0] = 0; - } - - /* update the pbi fragment data */ - pbi->fragments = ctx->fragments; - - ctx->user_priv = user_priv; - if (vp8dx_receive_compressed_data(pbi, data_sz, data, deadline)) - { - res = update_error_state(ctx, &pbi->common.error); - } - - /* get ready for the next series of fragments */ - ctx->fragments.count = 0; - } - - return res; -} - -static vpx_image_t *vp8_get_frame(vpx_codec_alg_priv_t *ctx, - vpx_codec_iter_t *iter) -{ - vpx_image_t *img = NULL; - - /* iter acts as a flip flop, so an image is only returned on the first - * call to get_frame. - */ - if (!(*iter) && ctx->yv12_frame_buffers.pbi[0]) - { - YV12_BUFFER_CONFIG sd; - int64_t time_stamp = 0, time_end_stamp = 0; - vp8_ppflags_t flags = {0}; - - if (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC) - { - flags.post_proc_flag= ctx->postproc_cfg.post_proc_flag -#if CONFIG_POSTPROC_VISUALIZER - - | ((ctx->dbg_color_ref_frame_flag != 0) ? VP8D_DEBUG_CLR_FRM_REF_BLKS : 0) - | ((ctx->dbg_color_mb_modes_flag != 0) ? VP8D_DEBUG_CLR_BLK_MODES : 0) - | ((ctx->dbg_color_b_modes_flag != 0) ? VP8D_DEBUG_CLR_BLK_MODES : 0) - | ((ctx->dbg_display_mv_flag != 0) ? VP8D_DEBUG_DRAW_MV : 0) -#endif - ; - flags.deblocking_level = ctx->postproc_cfg.deblocking_level; - flags.noise_level = ctx->postproc_cfg.noise_level; -#if CONFIG_POSTPROC_VISUALIZER - flags.display_ref_frame_flag= ctx->dbg_color_ref_frame_flag; - flags.display_mb_modes_flag = ctx->dbg_color_mb_modes_flag; - flags.display_b_modes_flag = ctx->dbg_color_b_modes_flag; - flags.display_mv_flag = ctx->dbg_display_mv_flag; -#endif - } - - if (0 == vp8dx_get_raw_frame(ctx->yv12_frame_buffers.pbi[0], &sd, - &time_stamp, &time_end_stamp, &flags)) - { - yuvconfig2image(&ctx->img, &sd, ctx->user_priv); - - img = &ctx->img; - *iter = img; - } - } - - return img; -} - -static vpx_codec_err_t image2yuvconfig(const vpx_image_t *img, - YV12_BUFFER_CONFIG *yv12) -{ - const int y_w = img->d_w; - const int y_h = img->d_h; - const int uv_w = (img->d_w + 1) / 2; - const int uv_h = (img->d_h + 1) / 2; - vpx_codec_err_t res = VPX_CODEC_OK; - yv12->y_buffer = img->planes[VPX_PLANE_Y]; - yv12->u_buffer = img->planes[VPX_PLANE_U]; - yv12->v_buffer = img->planes[VPX_PLANE_V]; - - yv12->y_crop_width = y_w; - yv12->y_crop_height = y_h; - yv12->y_width = y_w; - yv12->y_height = y_h; - yv12->uv_crop_width = uv_w; - yv12->uv_crop_height = uv_h; - yv12->uv_width = uv_w; - yv12->uv_height = uv_h; - - yv12->y_stride = img->stride[VPX_PLANE_Y]; - yv12->uv_stride = img->stride[VPX_PLANE_U]; - - yv12->border = (img->stride[VPX_PLANE_Y] - img->d_w) / 2; - return res; -} - - -static vpx_codec_err_t vp8_set_reference(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - - vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *); - - if (data && !ctx->yv12_frame_buffers.use_frame_threads) - { - vpx_ref_frame_t *frame = (vpx_ref_frame_t *)data; - YV12_BUFFER_CONFIG sd; - - image2yuvconfig(&frame->img, &sd); - - return vp8dx_set_reference(ctx->yv12_frame_buffers.pbi[0], - frame->frame_type, &sd); - } - else - return VPX_CODEC_INVALID_PARAM; - -} - -static vpx_codec_err_t vp8_get_reference(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - - vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *); - - if (data && !ctx->yv12_frame_buffers.use_frame_threads) - { - vpx_ref_frame_t *frame = (vpx_ref_frame_t *)data; - YV12_BUFFER_CONFIG sd; - - image2yuvconfig(&frame->img, &sd); - - return vp8dx_get_reference(ctx->yv12_frame_buffers.pbi[0], - frame->frame_type, &sd); - } - else - return VPX_CODEC_INVALID_PARAM; - -} - -static vpx_codec_err_t vp8_set_postproc(vpx_codec_alg_priv_t *ctx, - va_list args) -{ -#if CONFIG_POSTPROC - vp8_postproc_cfg_t *data = va_arg(args, vp8_postproc_cfg_t *); - - if (data) - { - ctx->postproc_cfg_set = 1; - ctx->postproc_cfg = *((vp8_postproc_cfg_t *)data); - return VPX_CODEC_OK; - } - else - return VPX_CODEC_INVALID_PARAM; - -#else - (void)ctx; - (void)args; - return VPX_CODEC_INCAPABLE; -#endif -} - - -static vpx_codec_err_t vp8_set_dbg_color_ref_frame(vpx_codec_alg_priv_t *ctx, - va_list args) { -#if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC - ctx->dbg_color_ref_frame_flag = va_arg(args, int); - return VPX_CODEC_OK; -#else - (void)ctx; - (void)args; - return VPX_CODEC_INCAPABLE; -#endif -} - -static vpx_codec_err_t vp8_set_dbg_color_mb_modes(vpx_codec_alg_priv_t *ctx, - va_list args) { -#if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC - ctx->dbg_color_mb_modes_flag = va_arg(args, int); - return VPX_CODEC_OK; -#else - (void)ctx; - (void)args; - return VPX_CODEC_INCAPABLE; -#endif -} - -static vpx_codec_err_t vp8_set_dbg_color_b_modes(vpx_codec_alg_priv_t *ctx, - va_list args) { -#if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC - ctx->dbg_color_b_modes_flag = va_arg(args, int); - return VPX_CODEC_OK; -#else - (void)ctx; - (void)args; - return VPX_CODEC_INCAPABLE; -#endif -} - -static vpx_codec_err_t vp8_set_dbg_display_mv(vpx_codec_alg_priv_t *ctx, - va_list args) { -#if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC - ctx->dbg_display_mv_flag = va_arg(args, int); - return VPX_CODEC_OK; -#else - (void)ctx; - (void)args; - return VPX_CODEC_INCAPABLE; -#endif -} - -static vpx_codec_err_t vp8_get_last_ref_updates(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - int *update_info = va_arg(args, int *); - - if (update_info && !ctx->yv12_frame_buffers.use_frame_threads) - { - VP8D_COMP *pbi = (VP8D_COMP *)ctx->yv12_frame_buffers.pbi[0]; - - *update_info = pbi->common.refresh_alt_ref_frame * (int) VP8_ALTR_FRAME - + pbi->common.refresh_golden_frame * (int) VP8_GOLD_FRAME - + pbi->common.refresh_last_frame * (int) VP8_LAST_FRAME; - - return VPX_CODEC_OK; - } - else - return VPX_CODEC_INVALID_PARAM; -} - -extern int vp8dx_references_buffer( VP8_COMMON *oci, int ref_frame ); -static vpx_codec_err_t vp8_get_last_ref_frame(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - int *ref_info = va_arg(args, int *); - - if (ref_info && !ctx->yv12_frame_buffers.use_frame_threads) - { - VP8D_COMP *pbi = (VP8D_COMP *)ctx->yv12_frame_buffers.pbi[0]; - VP8_COMMON *oci = &pbi->common; - *ref_info = - (vp8dx_references_buffer( oci, ALTREF_FRAME )?VP8_ALTR_FRAME:0) | - (vp8dx_references_buffer( oci, GOLDEN_FRAME )?VP8_GOLD_FRAME:0) | - (vp8dx_references_buffer( oci, LAST_FRAME )?VP8_LAST_FRAME:0); - - return VPX_CODEC_OK; - } - else - return VPX_CODEC_INVALID_PARAM; -} - -static vpx_codec_err_t vp8_get_frame_corrupted(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - - int *corrupted = va_arg(args, int *); - VP8D_COMP *pbi = (VP8D_COMP *)ctx->yv12_frame_buffers.pbi[0]; - - if (corrupted && pbi) - { - const YV12_BUFFER_CONFIG *const frame = pbi->common.frame_to_show; - if (frame == NULL) return VPX_CODEC_ERROR; - *corrupted = frame->corrupted; - return VPX_CODEC_OK; - } - else - return VPX_CODEC_INVALID_PARAM; - -} - -static vpx_codec_err_t vp8_set_decryptor(vpx_codec_alg_priv_t *ctx, - va_list args) -{ - vpx_decrypt_init *init = va_arg(args, vpx_decrypt_init *); - - if (init) - { - ctx->decrypt_cb = init->decrypt_cb; - ctx->decrypt_state = init->decrypt_state; - } - else - { - ctx->decrypt_cb = NULL; - ctx->decrypt_state = NULL; - } - return VPX_CODEC_OK; -} - -vpx_codec_ctrl_fn_map_t vp8_ctf_maps[] = -{ - {VP8_SET_REFERENCE, vp8_set_reference}, - {VP8_COPY_REFERENCE, vp8_get_reference}, - {VP8_SET_POSTPROC, vp8_set_postproc}, - {VP8_SET_DBG_COLOR_REF_FRAME, vp8_set_dbg_color_ref_frame}, - {VP8_SET_DBG_COLOR_MB_MODES, vp8_set_dbg_color_mb_modes}, - {VP8_SET_DBG_COLOR_B_MODES, vp8_set_dbg_color_b_modes}, - {VP8_SET_DBG_DISPLAY_MV, vp8_set_dbg_display_mv}, - {VP8D_GET_LAST_REF_UPDATES, vp8_get_last_ref_updates}, - {VP8D_GET_FRAME_CORRUPTED, vp8_get_frame_corrupted}, - {VP8D_GET_LAST_REF_USED, vp8_get_last_ref_frame}, - {VPXD_SET_DECRYPTOR, vp8_set_decryptor}, - { -1, NULL}, -}; - - -#ifndef VERSION_STRING -#define VERSION_STRING -#endif -CODEC_INTERFACE(vpx_codec_vp8_dx) = -{ - "WebM Project VP8 Decoder" VERSION_STRING, - VPX_CODEC_INTERNAL_ABI_VERSION, - VPX_CODEC_CAP_DECODER | VP8_CAP_POSTPROC | VP8_CAP_ERROR_CONCEALMENT | - VPX_CODEC_CAP_INPUT_FRAGMENTS, - /* vpx_codec_caps_t caps; */ - vp8_init, /* vpx_codec_init_fn_t init; */ - vp8_destroy, /* vpx_codec_destroy_fn_t destroy; */ - vp8_ctf_maps, /* vpx_codec_ctrl_fn_map_t *ctrl_maps; */ - { - vp8_peek_si, /* vpx_codec_peek_si_fn_t peek_si; */ - vp8_get_si, /* vpx_codec_get_si_fn_t get_si; */ - vp8_decode, /* vpx_codec_decode_fn_t decode; */ - vp8_get_frame, /* vpx_codec_frame_get_fn_t frame_get; */ - NULL, - }, - { /* encoder functions */ - 0, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL - } -}; diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/vp8dx.mk gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/vp8dx.mk --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8/vp8dx.mk 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8/vp8dx.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -## -## Copyright (c) 2010 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - - -VP8_DX_EXPORTS += exports_dec - -VP8_DX_SRCS-yes += $(VP8_COMMON_SRCS-yes) -VP8_DX_SRCS-no += $(VP8_COMMON_SRCS-no) -VP8_DX_SRCS_REMOVE-yes += $(VP8_COMMON_SRCS_REMOVE-yes) -VP8_DX_SRCS_REMOVE-no += $(VP8_COMMON_SRCS_REMOVE-no) - -VP8_DX_SRCS-yes += vp8dx.mk - -VP8_DX_SRCS-yes += vp8_dx_iface.c - -VP8_DX_SRCS-yes += decoder/dboolhuff.c -VP8_DX_SRCS-yes += decoder/decodemv.c -VP8_DX_SRCS-yes += decoder/decodeframe.c -VP8_DX_SRCS-yes += decoder/detokenize.c -VP8_DX_SRCS-$(CONFIG_ERROR_CONCEALMENT) += decoder/ec_types.h -VP8_DX_SRCS-$(CONFIG_ERROR_CONCEALMENT) += decoder/error_concealment.h -VP8_DX_SRCS-$(CONFIG_ERROR_CONCEALMENT) += decoder/error_concealment.c -VP8_DX_SRCS-yes += decoder/dboolhuff.h -VP8_DX_SRCS-yes += decoder/decodemv.h -VP8_DX_SRCS-yes += decoder/decoderthreading.h -VP8_DX_SRCS-yes += decoder/detokenize.h -VP8_DX_SRCS-yes += decoder/onyxd_int.h -VP8_DX_SRCS-yes += decoder/treereader.h -VP8_DX_SRCS-yes += decoder/onyxd_if.c -VP8_DX_SRCS-$(CONFIG_MULTITHREAD) += decoder/threading.c - -VP8_DX_SRCS-yes := $(filter-out $(VP8_DX_SRCS_REMOVE-yes),$(VP8_DX_SRCS-yes)) diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8_rtcd.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8_rtcd.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp8_rtcd.h 2015-12-07 10:55:38.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp8_rtcd.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,440 +0,0 @@ -#ifndef VP8_RTCD_H_ -#define VP8_RTCD_H_ - -#ifdef RTCD_C -#define RTCD_EXTERN -#else -#define RTCD_EXTERN extern -#endif - -/* - * VP8 - */ - -struct blockd; -struct macroblockd; -struct loop_filter_info; - -/* Encoder forward decls */ -struct block; -struct macroblock; -struct variance_vtable; -union int_mv; -struct yv12_buffer_config; - -#ifdef __cplusplus -extern "C" { -#endif - -void vp8_bilinear_predict16x16_c(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -void vp8_bilinear_predict16x16_mmx(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -void vp8_bilinear_predict16x16_sse2(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -void vp8_bilinear_predict16x16_ssse3(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -RTCD_EXTERN void (*vp8_bilinear_predict16x16)(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); - -void vp8_bilinear_predict4x4_c(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -void vp8_bilinear_predict4x4_mmx(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -#define vp8_bilinear_predict4x4 vp8_bilinear_predict4x4_mmx - -void vp8_bilinear_predict8x4_c(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -void vp8_bilinear_predict8x4_mmx(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -#define vp8_bilinear_predict8x4 vp8_bilinear_predict8x4_mmx - -void vp8_bilinear_predict8x8_c(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -void vp8_bilinear_predict8x8_mmx(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -void vp8_bilinear_predict8x8_sse2(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -void vp8_bilinear_predict8x8_ssse3(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -RTCD_EXTERN void (*vp8_bilinear_predict8x8)(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); - -void vp8_blend_b_c(unsigned char *y, unsigned char *u, unsigned char *v, int y1, int u1, int v1, int alpha, int stride); -#define vp8_blend_b vp8_blend_b_c - -void vp8_blend_mb_inner_c(unsigned char *y, unsigned char *u, unsigned char *v, int y1, int u1, int v1, int alpha, int stride); -#define vp8_blend_mb_inner vp8_blend_mb_inner_c - -void vp8_blend_mb_outer_c(unsigned char *y, unsigned char *u, unsigned char *v, int y1, int u1, int v1, int alpha, int stride); -#define vp8_blend_mb_outer vp8_blend_mb_outer_c - -void vp8_build_intra_predictors_mbuv_s_c(struct macroblockd *x, unsigned char * uabove_row, unsigned char * vabove_row, unsigned char *uleft, unsigned char *vleft, int left_stride, unsigned char * upred_ptr, unsigned char * vpred_ptr, int pred_stride); -void vp8_build_intra_predictors_mbuv_s_sse2(struct macroblockd *x, unsigned char * uabove_row, unsigned char * vabove_row, unsigned char *uleft, unsigned char *vleft, int left_stride, unsigned char * upred_ptr, unsigned char * vpred_ptr, int pred_stride); -void vp8_build_intra_predictors_mbuv_s_ssse3(struct macroblockd *x, unsigned char * uabove_row, unsigned char * vabove_row, unsigned char *uleft, unsigned char *vleft, int left_stride, unsigned char * upred_ptr, unsigned char * vpred_ptr, int pred_stride); -RTCD_EXTERN void (*vp8_build_intra_predictors_mbuv_s)(struct macroblockd *x, unsigned char * uabove_row, unsigned char * vabove_row, unsigned char *uleft, unsigned char *vleft, int left_stride, unsigned char * upred_ptr, unsigned char * vpred_ptr, int pred_stride); - -void vp8_build_intra_predictors_mby_s_c(struct macroblockd *x, unsigned char * yabove_row, unsigned char * yleft, int left_stride, unsigned char * ypred_ptr, int y_stride); -void vp8_build_intra_predictors_mby_s_sse2(struct macroblockd *x, unsigned char * yabove_row, unsigned char * yleft, int left_stride, unsigned char * ypred_ptr, int y_stride); -void vp8_build_intra_predictors_mby_s_ssse3(struct macroblockd *x, unsigned char * yabove_row, unsigned char * yleft, int left_stride, unsigned char * ypred_ptr, int y_stride); -RTCD_EXTERN void (*vp8_build_intra_predictors_mby_s)(struct macroblockd *x, unsigned char * yabove_row, unsigned char * yleft, int left_stride, unsigned char * ypred_ptr, int y_stride); - -void vp8_clear_system_state_c(); -void vpx_reset_mmx_state(); -#define vp8_clear_system_state vpx_reset_mmx_state - -void vp8_copy_mem16x16_c(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch); -void vp8_copy_mem16x16_mmx(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch); -void vp8_copy_mem16x16_sse2(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch); -#define vp8_copy_mem16x16 vp8_copy_mem16x16_sse2 - -void vp8_copy_mem8x4_c(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch); -void vp8_copy_mem8x4_mmx(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch); -#define vp8_copy_mem8x4 vp8_copy_mem8x4_mmx - -void vp8_copy_mem8x8_c(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch); -void vp8_copy_mem8x8_mmx(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch); -#define vp8_copy_mem8x8 vp8_copy_mem8x8_mmx - -void vp8_dc_only_idct_add_c(short input, unsigned char *pred, int pred_stride, unsigned char *dst, int dst_stride); -void vp8_dc_only_idct_add_mmx(short input, unsigned char *pred, int pred_stride, unsigned char *dst, int dst_stride); -#define vp8_dc_only_idct_add vp8_dc_only_idct_add_mmx - -void vp8_dequant_idct_add_c(short *input, short *dq, unsigned char *output, int stride); -void vp8_dequant_idct_add_mmx(short *input, short *dq, unsigned char *output, int stride); -#define vp8_dequant_idct_add vp8_dequant_idct_add_mmx - -void vp8_dequant_idct_add_uv_block_c(short *q, short *dq, unsigned char *dst_u, unsigned char *dst_v, int stride, char *eobs); -void vp8_dequant_idct_add_uv_block_mmx(short *q, short *dq, unsigned char *dst_u, unsigned char *dst_v, int stride, char *eobs); -void vp8_dequant_idct_add_uv_block_sse2(short *q, short *dq, unsigned char *dst_u, unsigned char *dst_v, int stride, char *eobs); -#define vp8_dequant_idct_add_uv_block vp8_dequant_idct_add_uv_block_sse2 - -void vp8_dequant_idct_add_y_block_c(short *q, short *dq, unsigned char *dst, int stride, char *eobs); -void vp8_dequant_idct_add_y_block_mmx(short *q, short *dq, unsigned char *dst, int stride, char *eobs); -void vp8_dequant_idct_add_y_block_sse2(short *q, short *dq, unsigned char *dst, int stride, char *eobs); -#define vp8_dequant_idct_add_y_block vp8_dequant_idct_add_y_block_sse2 - -void vp8_dequantize_b_c(struct blockd*, short *dqc); -void vp8_dequantize_b_mmx(struct blockd*, short *dqc); -#define vp8_dequantize_b vp8_dequantize_b_mmx - -void vp8_filter_by_weight16x16_c(unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, int src_weight); -void vp8_filter_by_weight16x16_sse2(unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, int src_weight); -#define vp8_filter_by_weight16x16 vp8_filter_by_weight16x16_sse2 - -void vp8_filter_by_weight4x4_c(unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, int src_weight); -#define vp8_filter_by_weight4x4 vp8_filter_by_weight4x4_c - -void vp8_filter_by_weight8x8_c(unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, int src_weight); -void vp8_filter_by_weight8x8_sse2(unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, int src_weight); -#define vp8_filter_by_weight8x8 vp8_filter_by_weight8x8_sse2 - -void vp8_intra4x4_predict_c(unsigned char *Above, unsigned char *yleft, int left_stride, int b_mode, unsigned char *dst, int dst_stride, unsigned char top_left); -#define vp8_intra4x4_predict vp8_intra4x4_predict_c - -void vp8_loop_filter_bh_c(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi); -void vp8_loop_filter_bh_mmx(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi); -void vp8_loop_filter_bh_sse2(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi); -#define vp8_loop_filter_bh vp8_loop_filter_bh_sse2 - -void vp8_loop_filter_bv_c(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi); -void vp8_loop_filter_bv_mmx(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi); -void vp8_loop_filter_bv_sse2(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi); -#define vp8_loop_filter_bv vp8_loop_filter_bv_sse2 - -void vp8_loop_filter_mbh_c(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi); -void vp8_loop_filter_mbh_mmx(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi); -void vp8_loop_filter_mbh_sse2(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi); -#define vp8_loop_filter_mbh vp8_loop_filter_mbh_sse2 - -void vp8_loop_filter_mbv_c(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi); -void vp8_loop_filter_mbv_mmx(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi); -void vp8_loop_filter_mbv_sse2(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi); -#define vp8_loop_filter_mbv vp8_loop_filter_mbv_sse2 - -void vp8_loop_filter_bhs_c(unsigned char *y, int ystride, const unsigned char *blimit); -void vp8_loop_filter_bhs_mmx(unsigned char *y, int ystride, const unsigned char *blimit); -void vp8_loop_filter_bhs_sse2(unsigned char *y, int ystride, const unsigned char *blimit); -#define vp8_loop_filter_simple_bh vp8_loop_filter_bhs_sse2 - -void vp8_loop_filter_bvs_c(unsigned char *y, int ystride, const unsigned char *blimit); -void vp8_loop_filter_bvs_mmx(unsigned char *y, int ystride, const unsigned char *blimit); -void vp8_loop_filter_bvs_sse2(unsigned char *y, int ystride, const unsigned char *blimit); -#define vp8_loop_filter_simple_bv vp8_loop_filter_bvs_sse2 - -void vp8_loop_filter_simple_horizontal_edge_c(unsigned char *y, int ystride, const unsigned char *blimit); -void vp8_loop_filter_simple_horizontal_edge_mmx(unsigned char *y, int ystride, const unsigned char *blimit); -void vp8_loop_filter_simple_horizontal_edge_sse2(unsigned char *y, int ystride, const unsigned char *blimit); -#define vp8_loop_filter_simple_mbh vp8_loop_filter_simple_horizontal_edge_sse2 - -void vp8_loop_filter_simple_vertical_edge_c(unsigned char *y, int ystride, const unsigned char *blimit); -void vp8_loop_filter_simple_vertical_edge_mmx(unsigned char *y, int ystride, const unsigned char *blimit); -void vp8_loop_filter_simple_vertical_edge_sse2(unsigned char *y, int ystride, const unsigned char *blimit); -#define vp8_loop_filter_simple_mbv vp8_loop_filter_simple_vertical_edge_sse2 - -void vp8_mbpost_proc_across_ip_c(unsigned char *dst, int pitch, int rows, int cols,int flimit); -void vp8_mbpost_proc_across_ip_xmm(unsigned char *dst, int pitch, int rows, int cols,int flimit); -#define vp8_mbpost_proc_across_ip vp8_mbpost_proc_across_ip_xmm - -void vp8_mbpost_proc_down_c(unsigned char *dst, int pitch, int rows, int cols,int flimit); -void vp8_mbpost_proc_down_mmx(unsigned char *dst, int pitch, int rows, int cols,int flimit); -void vp8_mbpost_proc_down_xmm(unsigned char *dst, int pitch, int rows, int cols,int flimit); -#define vp8_mbpost_proc_down vp8_mbpost_proc_down_xmm - -void vp8_plane_add_noise_c(unsigned char *s, char *noise, char blackclamp[16], char whiteclamp[16], char bothclamp[16], unsigned int w, unsigned int h, int pitch); -void vp8_plane_add_noise_mmx(unsigned char *s, char *noise, char blackclamp[16], char whiteclamp[16], char bothclamp[16], unsigned int w, unsigned int h, int pitch); -void vp8_plane_add_noise_wmt(unsigned char *s, char *noise, char blackclamp[16], char whiteclamp[16], char bothclamp[16], unsigned int w, unsigned int h, int pitch); -#define vp8_plane_add_noise vp8_plane_add_noise_wmt - -void vp8_post_proc_down_and_across_mb_row_c(unsigned char *src, unsigned char *dst, int src_pitch, int dst_pitch, int cols, unsigned char *flimits, int size); -void vp8_post_proc_down_and_across_mb_row_sse2(unsigned char *src, unsigned char *dst, int src_pitch, int dst_pitch, int cols, unsigned char *flimits, int size); -#define vp8_post_proc_down_and_across_mb_row vp8_post_proc_down_and_across_mb_row_sse2 - -unsigned int vp8_sad16x16_c(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad); -unsigned int vp8_sad16x16_mmx(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad); -unsigned int vp8_sad16x16_wmt(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad); -unsigned int vp8_sad16x16_sse3(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad); -RTCD_EXTERN unsigned int (*vp8_sad16x16)(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad); - -void vp8_sad16x16x3_c(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array); -void vp8_sad16x16x3_sse3(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array); -void vp8_sad16x16x3_ssse3(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array); -RTCD_EXTERN void (*vp8_sad16x16x3)(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array); - -void vp8_sad16x16x4d_c(const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array); -void vp8_sad16x16x4d_sse3(const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array); -RTCD_EXTERN void (*vp8_sad16x16x4d)(const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array); - -void vp8_sad16x16x8_c(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array); -void vp8_sad16x16x8_sse4(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array); -RTCD_EXTERN void (*vp8_sad16x16x8)(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array); - -unsigned int vp8_sad16x8_c(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad); -unsigned int vp8_sad16x8_mmx(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad); -unsigned int vp8_sad16x8_wmt(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad); -#define vp8_sad16x8 vp8_sad16x8_wmt - -void vp8_sad16x8x3_c(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array); -void vp8_sad16x8x3_sse3(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array); -void vp8_sad16x8x3_ssse3(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array); -RTCD_EXTERN void (*vp8_sad16x8x3)(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array); - -void vp8_sad16x8x4d_c(const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array); -void vp8_sad16x8x4d_sse3(const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array); -RTCD_EXTERN void (*vp8_sad16x8x4d)(const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array); - -void vp8_sad16x8x8_c(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array); -void vp8_sad16x8x8_sse4(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array); -RTCD_EXTERN void (*vp8_sad16x8x8)(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array); - -unsigned int vp8_sad4x4_c(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad); -unsigned int vp8_sad4x4_mmx(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad); -unsigned int vp8_sad4x4_wmt(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad); -#define vp8_sad4x4 vp8_sad4x4_wmt - -void vp8_sad4x4x3_c(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array); -void vp8_sad4x4x3_sse3(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array); -RTCD_EXTERN void (*vp8_sad4x4x3)(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array); - -void vp8_sad4x4x4d_c(const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array); -void vp8_sad4x4x4d_sse3(const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array); -RTCD_EXTERN void (*vp8_sad4x4x4d)(const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array); - -void vp8_sad4x4x8_c(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array); -void vp8_sad4x4x8_sse4(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array); -RTCD_EXTERN void (*vp8_sad4x4x8)(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array); - -unsigned int vp8_sad8x16_c(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad); -unsigned int vp8_sad8x16_mmx(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad); -unsigned int vp8_sad8x16_wmt(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad); -#define vp8_sad8x16 vp8_sad8x16_wmt - -void vp8_sad8x16x3_c(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array); -void vp8_sad8x16x3_sse3(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array); -RTCD_EXTERN void (*vp8_sad8x16x3)(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array); - -void vp8_sad8x16x4d_c(const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array); -void vp8_sad8x16x4d_sse3(const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array); -RTCD_EXTERN void (*vp8_sad8x16x4d)(const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array); - -void vp8_sad8x16x8_c(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array); -void vp8_sad8x16x8_sse4(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array); -RTCD_EXTERN void (*vp8_sad8x16x8)(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array); - -unsigned int vp8_sad8x8_c(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad); -unsigned int vp8_sad8x8_mmx(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad); -unsigned int vp8_sad8x8_wmt(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad); -#define vp8_sad8x8 vp8_sad8x8_wmt - -void vp8_sad8x8x3_c(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array); -void vp8_sad8x8x3_sse3(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array); -RTCD_EXTERN void (*vp8_sad8x8x3)(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array); - -void vp8_sad8x8x4d_c(const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array); -void vp8_sad8x8x4d_sse3(const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array); -RTCD_EXTERN void (*vp8_sad8x8x4d)(const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array); - -void vp8_sad8x8x8_c(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array); -void vp8_sad8x8x8_sse4(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array); -RTCD_EXTERN void (*vp8_sad8x8x8)(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array); - -void vp8_short_idct4x4llm_c(short *input, unsigned char *pred, int pitch, unsigned char *dst, int dst_stride); -void vp8_short_idct4x4llm_mmx(short *input, unsigned char *pred, int pitch, unsigned char *dst, int dst_stride); -#define vp8_short_idct4x4llm vp8_short_idct4x4llm_mmx - -void vp8_short_inv_walsh4x4_c(short *input, short *output); -void vp8_short_inv_walsh4x4_mmx(short *input, short *output); -void vp8_short_inv_walsh4x4_sse2(short *input, short *output); -#define vp8_short_inv_walsh4x4 vp8_short_inv_walsh4x4_sse2 - -void vp8_short_inv_walsh4x4_1_c(short *input, short *output); -#define vp8_short_inv_walsh4x4_1 vp8_short_inv_walsh4x4_1_c - -void vp8_sixtap_predict16x16_c(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -void vp8_sixtap_predict16x16_mmx(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -void vp8_sixtap_predict16x16_sse2(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -void vp8_sixtap_predict16x16_ssse3(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -RTCD_EXTERN void (*vp8_sixtap_predict16x16)(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); - -void vp8_sixtap_predict4x4_c(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -void vp8_sixtap_predict4x4_mmx(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -void vp8_sixtap_predict4x4_ssse3(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -RTCD_EXTERN void (*vp8_sixtap_predict4x4)(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); - -void vp8_sixtap_predict8x4_c(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -void vp8_sixtap_predict8x4_mmx(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -void vp8_sixtap_predict8x4_sse2(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -void vp8_sixtap_predict8x4_ssse3(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -RTCD_EXTERN void (*vp8_sixtap_predict8x4)(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); - -void vp8_sixtap_predict8x8_c(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -void vp8_sixtap_predict8x8_mmx(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -void vp8_sixtap_predict8x8_sse2(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -void vp8_sixtap_predict8x8_ssse3(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); -RTCD_EXTERN void (*vp8_sixtap_predict8x8)(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); - -unsigned int vp8_sub_pixel_variance16x16_c(const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse); -unsigned int vp8_sub_pixel_variance16x16_mmx(const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse); -unsigned int vp8_sub_pixel_variance16x16_wmt(const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse); -unsigned int vp8_sub_pixel_variance16x16_ssse3(const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse); -RTCD_EXTERN unsigned int (*vp8_sub_pixel_variance16x16)(const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse); - -unsigned int vp8_sub_pixel_variance16x8_c(const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse); -unsigned int vp8_sub_pixel_variance16x8_mmx(const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse); -unsigned int vp8_sub_pixel_variance16x8_wmt(const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse); -unsigned int vp8_sub_pixel_variance16x8_ssse3(const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse); -RTCD_EXTERN unsigned int (*vp8_sub_pixel_variance16x8)(const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse); - -unsigned int vp8_sub_pixel_variance4x4_c(const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse); -unsigned int vp8_sub_pixel_variance4x4_mmx(const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse); -unsigned int vp8_sub_pixel_variance4x4_wmt(const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse); -#define vp8_sub_pixel_variance4x4 vp8_sub_pixel_variance4x4_wmt - -unsigned int vp8_sub_pixel_variance8x16_c(const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse); -unsigned int vp8_sub_pixel_variance8x16_mmx(const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse); -unsigned int vp8_sub_pixel_variance8x16_wmt(const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse); -#define vp8_sub_pixel_variance8x16 vp8_sub_pixel_variance8x16_wmt - -unsigned int vp8_sub_pixel_variance8x8_c(const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse); -unsigned int vp8_sub_pixel_variance8x8_mmx(const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse); -unsigned int vp8_sub_pixel_variance8x8_wmt(const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse); -#define vp8_sub_pixel_variance8x8 vp8_sub_pixel_variance8x8_wmt - -unsigned int vp8_variance16x16_c(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -unsigned int vp8_variance16x16_mmx(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -unsigned int vp8_variance16x16_wmt(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -#define vp8_variance16x16 vp8_variance16x16_wmt - -unsigned int vp8_variance16x8_c(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -unsigned int vp8_variance16x8_mmx(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -unsigned int vp8_variance16x8_wmt(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -#define vp8_variance16x8 vp8_variance16x8_wmt - -unsigned int vp8_variance4x4_c(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -unsigned int vp8_variance4x4_mmx(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -unsigned int vp8_variance4x4_wmt(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -#define vp8_variance4x4 vp8_variance4x4_wmt - -unsigned int vp8_variance8x16_c(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -unsigned int vp8_variance8x16_mmx(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -unsigned int vp8_variance8x16_wmt(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -#define vp8_variance8x16 vp8_variance8x16_wmt - -unsigned int vp8_variance8x8_c(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -unsigned int vp8_variance8x8_mmx(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -unsigned int vp8_variance8x8_wmt(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -#define vp8_variance8x8 vp8_variance8x8_wmt - -unsigned int vp8_variance_halfpixvar16x16_h_c(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -unsigned int vp8_variance_halfpixvar16x16_h_mmx(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -unsigned int vp8_variance_halfpixvar16x16_h_wmt(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -#define vp8_variance_halfpixvar16x16_h vp8_variance_halfpixvar16x16_h_wmt - -unsigned int vp8_variance_halfpixvar16x16_hv_c(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -unsigned int vp8_variance_halfpixvar16x16_hv_mmx(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -unsigned int vp8_variance_halfpixvar16x16_hv_wmt(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -#define vp8_variance_halfpixvar16x16_hv vp8_variance_halfpixvar16x16_hv_wmt - -unsigned int vp8_variance_halfpixvar16x16_v_c(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -unsigned int vp8_variance_halfpixvar16x16_v_mmx(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -unsigned int vp8_variance_halfpixvar16x16_v_wmt(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse); -#define vp8_variance_halfpixvar16x16_v vp8_variance_halfpixvar16x16_v_wmt - -void vp8_rtcd(void); - -#ifdef RTCD_C -#include "vpx_ports/x86.h" -static void setup_rtcd_internal(void) -{ - int flags = x86_simd_caps(); - - (void)flags; - - vp8_bilinear_predict16x16 = vp8_bilinear_predict16x16_sse2; - if (flags & HAS_SSSE3) vp8_bilinear_predict16x16 = vp8_bilinear_predict16x16_ssse3; - vp8_bilinear_predict8x8 = vp8_bilinear_predict8x8_sse2; - if (flags & HAS_SSSE3) vp8_bilinear_predict8x8 = vp8_bilinear_predict8x8_ssse3; - vp8_build_intra_predictors_mbuv_s = vp8_build_intra_predictors_mbuv_s_sse2; - if (flags & HAS_SSSE3) vp8_build_intra_predictors_mbuv_s = vp8_build_intra_predictors_mbuv_s_ssse3; - vp8_build_intra_predictors_mby_s = vp8_build_intra_predictors_mby_s_sse2; - if (flags & HAS_SSSE3) vp8_build_intra_predictors_mby_s = vp8_build_intra_predictors_mby_s_ssse3; - vp8_sad16x16 = vp8_sad16x16_wmt; - if (flags & HAS_SSE3) vp8_sad16x16 = vp8_sad16x16_sse3; - vp8_sad16x16x3 = vp8_sad16x16x3_c; - if (flags & HAS_SSE3) vp8_sad16x16x3 = vp8_sad16x16x3_sse3; - if (flags & HAS_SSSE3) vp8_sad16x16x3 = vp8_sad16x16x3_ssse3; - vp8_sad16x16x4d = vp8_sad16x16x4d_c; - if (flags & HAS_SSE3) vp8_sad16x16x4d = vp8_sad16x16x4d_sse3; - vp8_sad16x16x8 = vp8_sad16x16x8_c; - if (flags & HAS_SSE4_1) vp8_sad16x16x8 = vp8_sad16x16x8_sse4; - vp8_sad16x8x3 = vp8_sad16x8x3_c; - if (flags & HAS_SSE3) vp8_sad16x8x3 = vp8_sad16x8x3_sse3; - if (flags & HAS_SSSE3) vp8_sad16x8x3 = vp8_sad16x8x3_ssse3; - vp8_sad16x8x4d = vp8_sad16x8x4d_c; - if (flags & HAS_SSE3) vp8_sad16x8x4d = vp8_sad16x8x4d_sse3; - vp8_sad16x8x8 = vp8_sad16x8x8_c; - if (flags & HAS_SSE4_1) vp8_sad16x8x8 = vp8_sad16x8x8_sse4; - vp8_sad4x4x3 = vp8_sad4x4x3_c; - if (flags & HAS_SSE3) vp8_sad4x4x3 = vp8_sad4x4x3_sse3; - vp8_sad4x4x4d = vp8_sad4x4x4d_c; - if (flags & HAS_SSE3) vp8_sad4x4x4d = vp8_sad4x4x4d_sse3; - vp8_sad4x4x8 = vp8_sad4x4x8_c; - if (flags & HAS_SSE4_1) vp8_sad4x4x8 = vp8_sad4x4x8_sse4; - vp8_sad8x16x3 = vp8_sad8x16x3_c; - if (flags & HAS_SSE3) vp8_sad8x16x3 = vp8_sad8x16x3_sse3; - vp8_sad8x16x4d = vp8_sad8x16x4d_c; - if (flags & HAS_SSE3) vp8_sad8x16x4d = vp8_sad8x16x4d_sse3; - vp8_sad8x16x8 = vp8_sad8x16x8_c; - if (flags & HAS_SSE4_1) vp8_sad8x16x8 = vp8_sad8x16x8_sse4; - vp8_sad8x8x3 = vp8_sad8x8x3_c; - if (flags & HAS_SSE3) vp8_sad8x8x3 = vp8_sad8x8x3_sse3; - vp8_sad8x8x4d = vp8_sad8x8x4d_c; - if (flags & HAS_SSE3) vp8_sad8x8x4d = vp8_sad8x8x4d_sse3; - vp8_sad8x8x8 = vp8_sad8x8x8_c; - if (flags & HAS_SSE4_1) vp8_sad8x8x8 = vp8_sad8x8x8_sse4; - vp8_sixtap_predict16x16 = vp8_sixtap_predict16x16_sse2; - if (flags & HAS_SSSE3) vp8_sixtap_predict16x16 = vp8_sixtap_predict16x16_ssse3; - vp8_sixtap_predict4x4 = vp8_sixtap_predict4x4_mmx; - if (flags & HAS_SSSE3) vp8_sixtap_predict4x4 = vp8_sixtap_predict4x4_ssse3; - vp8_sixtap_predict8x4 = vp8_sixtap_predict8x4_sse2; - if (flags & HAS_SSSE3) vp8_sixtap_predict8x4 = vp8_sixtap_predict8x4_ssse3; - vp8_sixtap_predict8x8 = vp8_sixtap_predict8x8_sse2; - if (flags & HAS_SSSE3) vp8_sixtap_predict8x8 = vp8_sixtap_predict8x8_ssse3; - vp8_sub_pixel_variance16x16 = vp8_sub_pixel_variance16x16_wmt; - if (flags & HAS_SSSE3) vp8_sub_pixel_variance16x16 = vp8_sub_pixel_variance16x16_ssse3; - vp8_sub_pixel_variance16x8 = vp8_sub_pixel_variance16x8_wmt; - if (flags & HAS_SSSE3) vp8_sub_pixel_variance16x8 = vp8_sub_pixel_variance16x8_ssse3; -} -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_avg_neon_asm.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_avg_neon_asm.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_avg_neon_asm.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_avg_neon_asm.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,116 +0,0 @@ -; -; Copyright (c) 2013 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - EXPORT |vp9_convolve_avg_neon| - ARM - REQUIRE8 - PRESERVE8 - - AREA ||.text||, CODE, READONLY, ALIGN=2 - -|vp9_convolve_avg_neon| PROC - push {r4-r6, lr} - ldrd r4, r5, [sp, #32] - mov r6, r2 - - cmp r4, #32 - bgt avg64 - beq avg32 - cmp r4, #8 - bgt avg16 - beq avg8 - b avg4 - -avg64 - sub lr, r1, #32 - sub r4, r3, #32 -avg64_h - pld [r0, r1, lsl #1] - vld1.8 {q0-q1}, [r0]! - vld1.8 {q2-q3}, [r0], lr - pld [r2, r3] - vld1.8 {q8-q9}, [r6@128]! - vld1.8 {q10-q11}, [r6@128], r4 - vrhadd.u8 q0, q0, q8 - vrhadd.u8 q1, q1, q9 - vrhadd.u8 q2, q2, q10 - vrhadd.u8 q3, q3, q11 - vst1.8 {q0-q1}, [r2@128]! - vst1.8 {q2-q3}, [r2@128], r4 - subs r5, r5, #1 - bgt avg64_h - pop {r4-r6, pc} - -avg32 - vld1.8 {q0-q1}, [r0], r1 - vld1.8 {q2-q3}, [r0], r1 - vld1.8 {q8-q9}, [r6@128], r3 - vld1.8 {q10-q11}, [r6@128], r3 - pld [r0] - vrhadd.u8 q0, q0, q8 - pld [r0, r1] - vrhadd.u8 q1, q1, q9 - pld [r6] - vrhadd.u8 q2, q2, q10 - pld [r6, r3] - vrhadd.u8 q3, q3, q11 - vst1.8 {q0-q1}, [r2@128], r3 - vst1.8 {q2-q3}, [r2@128], r3 - subs r5, r5, #2 - bgt avg32 - pop {r4-r6, pc} - -avg16 - vld1.8 {q0}, [r0], r1 - vld1.8 {q1}, [r0], r1 - vld1.8 {q2}, [r6@128], r3 - vld1.8 {q3}, [r6@128], r3 - pld [r0] - pld [r0, r1] - vrhadd.u8 q0, q0, q2 - pld [r6] - pld [r6, r3] - vrhadd.u8 q1, q1, q3 - vst1.8 {q0}, [r2@128], r3 - vst1.8 {q1}, [r2@128], r3 - subs r5, r5, #2 - bgt avg16 - pop {r4-r6, pc} - -avg8 - vld1.8 {d0}, [r0], r1 - vld1.8 {d1}, [r0], r1 - vld1.8 {d2}, [r6@64], r3 - vld1.8 {d3}, [r6@64], r3 - pld [r0] - pld [r0, r1] - vrhadd.u8 q0, q0, q1 - pld [r6] - pld [r6, r3] - vst1.8 {d0}, [r2@64], r3 - vst1.8 {d1}, [r2@64], r3 - subs r5, r5, #2 - bgt avg8 - pop {r4-r6, pc} - -avg4 - vld1.32 {d0[0]}, [r0], r1 - vld1.32 {d0[1]}, [r0], r1 - vld1.32 {d2[0]}, [r6@32], r3 - vld1.32 {d2[1]}, [r6@32], r3 - vrhadd.u8 d0, d0, d2 - vst1.32 {d0[0]}, [r2@32], r3 - vst1.32 {d0[1]}, [r2@32], r3 - subs r5, r5, #2 - bgt avg4 - pop {r4-r6, pc} - ENDP - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_avg_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_avg_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_avg_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_avg_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,145 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -void vp9_convolve_avg_neon( - const uint8_t *src, // r0 - ptrdiff_t src_stride, // r1 - uint8_t *dst, // r2 - ptrdiff_t dst_stride, // r3 - const int16_t *filter_x, - int filter_x_stride, - const int16_t *filter_y, - int filter_y_stride, - int w, - int h) { - uint8_t *d; - uint8x8_t d0u8, d1u8, d2u8, d3u8; - uint32x2_t d0u32, d2u32; - uint8x16_t q0u8, q1u8, q2u8, q3u8, q8u8, q9u8, q10u8, q11u8; - (void)filter_x; (void)filter_x_stride; - (void)filter_y; (void)filter_y_stride; - - d = dst; - if (w > 32) { // avg64 - for (; h > 0; h -= 1) { - q0u8 = vld1q_u8(src); - q1u8 = vld1q_u8(src + 16); - q2u8 = vld1q_u8(src + 32); - q3u8 = vld1q_u8(src + 48); - src += src_stride; - q8u8 = vld1q_u8(d); - q9u8 = vld1q_u8(d + 16); - q10u8 = vld1q_u8(d + 32); - q11u8 = vld1q_u8(d + 48); - d += dst_stride; - - q0u8 = vrhaddq_u8(q0u8, q8u8); - q1u8 = vrhaddq_u8(q1u8, q9u8); - q2u8 = vrhaddq_u8(q2u8, q10u8); - q3u8 = vrhaddq_u8(q3u8, q11u8); - - vst1q_u8(dst, q0u8); - vst1q_u8(dst + 16, q1u8); - vst1q_u8(dst + 32, q2u8); - vst1q_u8(dst + 48, q3u8); - dst += dst_stride; - } - } else if (w == 32) { // avg32 - for (; h > 0; h -= 2) { - q0u8 = vld1q_u8(src); - q1u8 = vld1q_u8(src + 16); - src += src_stride; - q2u8 = vld1q_u8(src); - q3u8 = vld1q_u8(src + 16); - src += src_stride; - q8u8 = vld1q_u8(d); - q9u8 = vld1q_u8(d + 16); - d += dst_stride; - q10u8 = vld1q_u8(d); - q11u8 = vld1q_u8(d + 16); - d += dst_stride; - - q0u8 = vrhaddq_u8(q0u8, q8u8); - q1u8 = vrhaddq_u8(q1u8, q9u8); - q2u8 = vrhaddq_u8(q2u8, q10u8); - q3u8 = vrhaddq_u8(q3u8, q11u8); - - vst1q_u8(dst, q0u8); - vst1q_u8(dst + 16, q1u8); - dst += dst_stride; - vst1q_u8(dst, q2u8); - vst1q_u8(dst + 16, q3u8); - dst += dst_stride; - } - } else if (w > 8) { // avg16 - for (; h > 0; h -= 2) { - q0u8 = vld1q_u8(src); - src += src_stride; - q1u8 = vld1q_u8(src); - src += src_stride; - q2u8 = vld1q_u8(d); - d += dst_stride; - q3u8 = vld1q_u8(d); - d += dst_stride; - - q0u8 = vrhaddq_u8(q0u8, q2u8); - q1u8 = vrhaddq_u8(q1u8, q3u8); - - vst1q_u8(dst, q0u8); - dst += dst_stride; - vst1q_u8(dst, q1u8); - dst += dst_stride; - } - } else if (w == 8) { // avg8 - for (; h > 0; h -= 2) { - d0u8 = vld1_u8(src); - src += src_stride; - d1u8 = vld1_u8(src); - src += src_stride; - d2u8 = vld1_u8(d); - d += dst_stride; - d3u8 = vld1_u8(d); - d += dst_stride; - - q0u8 = vcombine_u8(d0u8, d1u8); - q1u8 = vcombine_u8(d2u8, d3u8); - q0u8 = vrhaddq_u8(q0u8, q1u8); - - vst1_u8(dst, vget_low_u8(q0u8)); - dst += dst_stride; - vst1_u8(dst, vget_high_u8(q0u8)); - dst += dst_stride; - } - } else { // avg4 - for (; h > 0; h -= 2) { - d0u32 = vld1_lane_u32((const uint32_t *)src, d0u32, 0); - src += src_stride; - d0u32 = vld1_lane_u32((const uint32_t *)src, d0u32, 1); - src += src_stride; - d2u32 = vld1_lane_u32((const uint32_t *)d, d2u32, 0); - d += dst_stride; - d2u32 = vld1_lane_u32((const uint32_t *)d, d2u32, 1); - d += dst_stride; - - d0u8 = vrhadd_u8(vreinterpret_u8_u32(d0u32), - vreinterpret_u8_u32(d2u32)); - - d0u32 = vreinterpret_u32_u8(d0u8); - vst1_lane_u32((uint32_t *)dst, d0u32, 0); - dst += dst_stride; - vst1_lane_u32((uint32_t *)dst, d0u32, 1); - dst += dst_stride; - } - } - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_convolve8_avg_neon_asm.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_convolve8_avg_neon_asm.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_convolve8_avg_neon_asm.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_convolve8_avg_neon_asm.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,302 +0,0 @@ -; -; Copyright (c) 2013 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - ; These functions are only valid when: - ; x_step_q4 == 16 - ; w%4 == 0 - ; h%4 == 0 - ; taps == 8 - ; VP9_FILTER_WEIGHT == 128 - ; VP9_FILTER_SHIFT == 7 - - EXPORT |vp9_convolve8_avg_horiz_neon| - EXPORT |vp9_convolve8_avg_vert_neon| - IMPORT |vp9_convolve8_avg_horiz_c| - IMPORT |vp9_convolve8_avg_vert_c| - ARM - REQUIRE8 - PRESERVE8 - - AREA ||.text||, CODE, READONLY, ALIGN=2 - - ; Multiply and accumulate by q0 - MACRO - MULTIPLY_BY_Q0 $dst, $src0, $src1, $src2, $src3, $src4, $src5, $src6, $src7 - vmull.s16 $dst, $src0, d0[0] - vmlal.s16 $dst, $src1, d0[1] - vmlal.s16 $dst, $src2, d0[2] - vmlal.s16 $dst, $src3, d0[3] - vmlal.s16 $dst, $src4, d1[0] - vmlal.s16 $dst, $src5, d1[1] - vmlal.s16 $dst, $src6, d1[2] - vmlal.s16 $dst, $src7, d1[3] - MEND - -; r0 const uint8_t *src -; r1 int src_stride -; r2 uint8_t *dst -; r3 int dst_stride -; sp[]const int16_t *filter_x -; sp[]int x_step_q4 -; sp[]const int16_t *filter_y ; unused -; sp[]int y_step_q4 ; unused -; sp[]int w -; sp[]int h - -|vp9_convolve8_avg_horiz_neon| PROC - ldr r12, [sp, #4] ; x_step_q4 - cmp r12, #16 - bne vp9_convolve8_avg_horiz_c - - push {r4-r10, lr} - - sub r0, r0, #3 ; adjust for taps - - ldr r5, [sp, #32] ; filter_x - ldr r6, [sp, #48] ; w - ldr r7, [sp, #52] ; h - - vld1.s16 {q0}, [r5] ; filter_x - - sub r8, r1, r1, lsl #2 ; -src_stride * 3 - add r8, r8, #4 ; -src_stride * 3 + 4 - - sub r4, r3, r3, lsl #2 ; -dst_stride * 3 - add r4, r4, #4 ; -dst_stride * 3 + 4 - - rsb r9, r6, r1, lsl #2 ; reset src for outer loop - sub r9, r9, #7 - rsb r12, r6, r3, lsl #2 ; reset dst for outer loop - - mov r10, r6 ; w loop counter - -vp9_convolve8_avg_loop_horiz_v - vld1.8 {d24}, [r0], r1 - vld1.8 {d25}, [r0], r1 - vld1.8 {d26}, [r0], r1 - vld1.8 {d27}, [r0], r8 - - vtrn.16 q12, q13 - vtrn.8 d24, d25 - vtrn.8 d26, d27 - - pld [r0, r1, lsl #2] - - vmovl.u8 q8, d24 - vmovl.u8 q9, d25 - vmovl.u8 q10, d26 - vmovl.u8 q11, d27 - - ; save a few instructions in the inner loop - vswp d17, d18 - vmov d23, d21 - - add r0, r0, #3 - -vp9_convolve8_avg_loop_horiz - add r5, r0, #64 - - vld1.32 {d28[]}, [r0], r1 - vld1.32 {d29[]}, [r0], r1 - vld1.32 {d31[]}, [r0], r1 - vld1.32 {d30[]}, [r0], r8 - - pld [r5] - - vtrn.16 d28, d31 - vtrn.16 d29, d30 - vtrn.8 d28, d29 - vtrn.8 d31, d30 - - pld [r5, r1] - - ; extract to s16 - vtrn.32 q14, q15 - vmovl.u8 q12, d28 - vmovl.u8 q13, d29 - - pld [r5, r1, lsl #1] - - ; slightly out of order load to match the existing data - vld1.u32 {d6[0]}, [r2], r3 - vld1.u32 {d7[0]}, [r2], r3 - vld1.u32 {d6[1]}, [r2], r3 - vld1.u32 {d7[1]}, [r2], r3 - - sub r2, r2, r3, lsl #2 ; reset for store - - ; src[] * filter_x - MULTIPLY_BY_Q0 q1, d16, d17, d20, d22, d18, d19, d23, d24 - MULTIPLY_BY_Q0 q2, d17, d20, d22, d18, d19, d23, d24, d26 - MULTIPLY_BY_Q0 q14, d20, d22, d18, d19, d23, d24, d26, d27 - MULTIPLY_BY_Q0 q15, d22, d18, d19, d23, d24, d26, d27, d25 - - pld [r5, -r8] - - ; += 64 >> 7 - vqrshrun.s32 d2, q1, #7 - vqrshrun.s32 d3, q2, #7 - vqrshrun.s32 d4, q14, #7 - vqrshrun.s32 d5, q15, #7 - - ; saturate - vqmovn.u16 d2, q1 - vqmovn.u16 d3, q2 - - ; transpose - vtrn.16 d2, d3 - vtrn.32 d2, d3 - vtrn.8 d2, d3 - - ; average the new value and the dst value - vrhadd.u8 q1, q1, q3 - - vst1.u32 {d2[0]}, [r2@32], r3 - vst1.u32 {d3[0]}, [r2@32], r3 - vst1.u32 {d2[1]}, [r2@32], r3 - vst1.u32 {d3[1]}, [r2@32], r4 - - vmov q8, q9 - vmov d20, d23 - vmov q11, q12 - vmov q9, q13 - - subs r6, r6, #4 ; w -= 4 - bgt vp9_convolve8_avg_loop_horiz - - ; outer loop - mov r6, r10 ; restore w counter - add r0, r0, r9 ; src += src_stride * 4 - w - add r2, r2, r12 ; dst += dst_stride * 4 - w - subs r7, r7, #4 ; h -= 4 - bgt vp9_convolve8_avg_loop_horiz_v - - pop {r4-r10, pc} - - ENDP - -|vp9_convolve8_avg_vert_neon| PROC - ldr r12, [sp, #12] - cmp r12, #16 - bne vp9_convolve8_avg_vert_c - - push {r4-r8, lr} - - ; adjust for taps - sub r0, r0, r1 - sub r0, r0, r1, lsl #1 - - ldr r4, [sp, #32] ; filter_y - ldr r6, [sp, #40] ; w - ldr lr, [sp, #44] ; h - - vld1.s16 {q0}, [r4] ; filter_y - - lsl r1, r1, #1 - lsl r3, r3, #1 - -vp9_convolve8_avg_loop_vert_h - mov r4, r0 - add r7, r0, r1, asr #1 - mov r5, r2 - add r8, r2, r3, asr #1 - mov r12, lr ; h loop counter - - vld1.u32 {d16[0]}, [r4], r1 - vld1.u32 {d16[1]}, [r7], r1 - vld1.u32 {d18[0]}, [r4], r1 - vld1.u32 {d18[1]}, [r7], r1 - vld1.u32 {d20[0]}, [r4], r1 - vld1.u32 {d20[1]}, [r7], r1 - vld1.u32 {d22[0]}, [r4], r1 - - vmovl.u8 q8, d16 - vmovl.u8 q9, d18 - vmovl.u8 q10, d20 - vmovl.u8 q11, d22 - -vp9_convolve8_avg_loop_vert - ; always process a 4x4 block at a time - vld1.u32 {d24[0]}, [r7], r1 - vld1.u32 {d26[0]}, [r4], r1 - vld1.u32 {d26[1]}, [r7], r1 - vld1.u32 {d24[1]}, [r4], r1 - - ; extract to s16 - vmovl.u8 q12, d24 - vmovl.u8 q13, d26 - - vld1.u32 {d6[0]}, [r5@32], r3 - vld1.u32 {d6[1]}, [r8@32], r3 - vld1.u32 {d7[0]}, [r5@32], r3 - vld1.u32 {d7[1]}, [r8@32], r3 - - pld [r7] - pld [r4] - - ; src[] * filter_y - MULTIPLY_BY_Q0 q1, d16, d17, d18, d19, d20, d21, d22, d24 - - pld [r7, r1] - pld [r4, r1] - - MULTIPLY_BY_Q0 q2, d17, d18, d19, d20, d21, d22, d24, d26 - - pld [r5] - pld [r8] - - MULTIPLY_BY_Q0 q14, d18, d19, d20, d21, d22, d24, d26, d27 - - pld [r5, r3] - pld [r8, r3] - - MULTIPLY_BY_Q0 q15, d19, d20, d21, d22, d24, d26, d27, d25 - - ; += 64 >> 7 - vqrshrun.s32 d2, q1, #7 - vqrshrun.s32 d3, q2, #7 - vqrshrun.s32 d4, q14, #7 - vqrshrun.s32 d5, q15, #7 - - ; saturate - vqmovn.u16 d2, q1 - vqmovn.u16 d3, q2 - - ; average the new value and the dst value - vrhadd.u8 q1, q1, q3 - - sub r5, r5, r3, lsl #1 ; reset for store - sub r8, r8, r3, lsl #1 - - vst1.u32 {d2[0]}, [r5@32], r3 - vst1.u32 {d2[1]}, [r8@32], r3 - vst1.u32 {d3[0]}, [r5@32], r3 - vst1.u32 {d3[1]}, [r8@32], r3 - - vmov q8, q10 - vmov d18, d22 - vmov d19, d24 - vmov q10, q13 - vmov d22, d25 - - subs r12, r12, #4 ; h -= 4 - bgt vp9_convolve8_avg_loop_vert - - ; outer loop - add r0, r0, #4 - add r2, r2, #4 - subs r6, r6, #4 ; w -= 4 - bgt vp9_convolve8_avg_loop_vert_h - - pop {r4-r8, pc} - - ENDP - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_convolve8_avg_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_convolve8_avg_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_convolve8_avg_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_convolve8_avg_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,390 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vpx_config.h" -#include "vpx_ports/mem.h" - -void vp9_convolve8_avg_horiz_c(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h); -void vp9_convolve8_avg_vert_c(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h); - -static INLINE int32x4_t MULTIPLY_BY_Q0( - int16x4_t dsrc0, - int16x4_t dsrc1, - int16x4_t dsrc2, - int16x4_t dsrc3, - int16x4_t dsrc4, - int16x4_t dsrc5, - int16x4_t dsrc6, - int16x4_t dsrc7, - int16x8_t q0s16) { - int32x4_t qdst; - int16x4_t d0s16, d1s16; - - d0s16 = vget_low_s16(q0s16); - d1s16 = vget_high_s16(q0s16); - - qdst = vmull_lane_s16(dsrc0, d0s16, 0); - qdst = vmlal_lane_s16(qdst, dsrc1, d0s16, 1); - qdst = vmlal_lane_s16(qdst, dsrc2, d0s16, 2); - qdst = vmlal_lane_s16(qdst, dsrc3, d0s16, 3); - qdst = vmlal_lane_s16(qdst, dsrc4, d1s16, 0); - qdst = vmlal_lane_s16(qdst, dsrc5, d1s16, 1); - qdst = vmlal_lane_s16(qdst, dsrc6, d1s16, 2); - qdst = vmlal_lane_s16(qdst, dsrc7, d1s16, 3); - return qdst; -} - -void vp9_convolve8_avg_horiz_neon( - uint8_t *src, - ptrdiff_t src_stride, - uint8_t *dst, - ptrdiff_t dst_stride, - const int16_t *filter_x, - int x_step_q4, - const int16_t *filter_y, // unused - int y_step_q4, // unused - int w, - int h) { - int width; - uint8_t *s, *d; - uint8x8_t d2u8, d3u8, d24u8, d25u8, d26u8, d27u8, d28u8, d29u8; - uint32x2_t d2u32, d3u32, d6u32, d7u32, d28u32, d29u32, d30u32, d31u32; - uint8x16_t q1u8, q3u8, q12u8, q13u8, q14u8, q15u8; - int16x4_t d16s16, d17s16, d18s16, d19s16, d20s16, d22s16, d23s16; - int16x4_t d24s16, d25s16, d26s16, d27s16; - uint16x4_t d2u16, d3u16, d4u16, d5u16, d16u16, d17u16, d18u16, d19u16; - int16x8_t q0s16; - uint16x8_t q1u16, q2u16, q8u16, q9u16, q10u16, q11u16, q12u16, q13u16; - int32x4_t q1s32, q2s32, q14s32, q15s32; - uint16x8x2_t q0x2u16; - uint8x8x2_t d0x2u8, d1x2u8; - uint32x2x2_t d0x2u32; - uint16x4x2_t d0x2u16, d1x2u16; - uint32x4x2_t q0x2u32; - - if (x_step_q4 != 16) { - vp9_convolve8_avg_horiz_c(src, src_stride, dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, w, h); - return; - } - - q0s16 = vld1q_s16(filter_x); - - src -= 3; // adjust for taps - for (; h > 0; h -= 4) { // loop_horiz_v - s = src; - d24u8 = vld1_u8(s); - s += src_stride; - d25u8 = vld1_u8(s); - s += src_stride; - d26u8 = vld1_u8(s); - s += src_stride; - d27u8 = vld1_u8(s); - - q12u8 = vcombine_u8(d24u8, d25u8); - q13u8 = vcombine_u8(d26u8, d27u8); - - q0x2u16 = vtrnq_u16(vreinterpretq_u16_u8(q12u8), - vreinterpretq_u16_u8(q13u8)); - d24u8 = vreinterpret_u8_u16(vget_low_u16(q0x2u16.val[0])); - d25u8 = vreinterpret_u8_u16(vget_high_u16(q0x2u16.val[0])); - d26u8 = vreinterpret_u8_u16(vget_low_u16(q0x2u16.val[1])); - d27u8 = vreinterpret_u8_u16(vget_high_u16(q0x2u16.val[1])); - d0x2u8 = vtrn_u8(d24u8, d25u8); - d1x2u8 = vtrn_u8(d26u8, d27u8); - - __builtin_prefetch(src + src_stride * 4); - __builtin_prefetch(src + src_stride * 5); - - q8u16 = vmovl_u8(d0x2u8.val[0]); - q9u16 = vmovl_u8(d0x2u8.val[1]); - q10u16 = vmovl_u8(d1x2u8.val[0]); - q11u16 = vmovl_u8(d1x2u8.val[1]); - - src += 7; - d16u16 = vget_low_u16(q8u16); - d17u16 = vget_high_u16(q8u16); - d18u16 = vget_low_u16(q9u16); - d19u16 = vget_high_u16(q9u16); - q8u16 = vcombine_u16(d16u16, d18u16); // vswp 17 18 - q9u16 = vcombine_u16(d17u16, d19u16); - - d20s16 = vreinterpret_s16_u16(vget_low_u16(q10u16)); - d23s16 = vreinterpret_s16_u16(vget_high_u16(q10u16)); // vmov 23 21 - for (width = w; - width > 0; - width -= 4, src += 4, dst += 4) { // loop_horiz - s = src; - d28u32 = vld1_dup_u32((const uint32_t *)s); - s += src_stride; - d29u32 = vld1_dup_u32((const uint32_t *)s); - s += src_stride; - d31u32 = vld1_dup_u32((const uint32_t *)s); - s += src_stride; - d30u32 = vld1_dup_u32((const uint32_t *)s); - - __builtin_prefetch(src + 64); - - d0x2u16 = vtrn_u16(vreinterpret_u16_u32(d28u32), - vreinterpret_u16_u32(d31u32)); - d1x2u16 = vtrn_u16(vreinterpret_u16_u32(d29u32), - vreinterpret_u16_u32(d30u32)); - d0x2u8 = vtrn_u8(vreinterpret_u8_u16(d0x2u16.val[0]), // d28 - vreinterpret_u8_u16(d1x2u16.val[0])); // d29 - d1x2u8 = vtrn_u8(vreinterpret_u8_u16(d0x2u16.val[1]), // d31 - vreinterpret_u8_u16(d1x2u16.val[1])); // d30 - - __builtin_prefetch(src + 64 + src_stride); - - q14u8 = vcombine_u8(d0x2u8.val[0], d0x2u8.val[1]); - q15u8 = vcombine_u8(d1x2u8.val[1], d1x2u8.val[0]); - q0x2u32 = vtrnq_u32(vreinterpretq_u32_u8(q14u8), - vreinterpretq_u32_u8(q15u8)); - - d28u8 = vreinterpret_u8_u32(vget_low_u32(q0x2u32.val[0])); - d29u8 = vreinterpret_u8_u32(vget_high_u32(q0x2u32.val[0])); - q12u16 = vmovl_u8(d28u8); - q13u16 = vmovl_u8(d29u8); - - __builtin_prefetch(src + 64 + src_stride * 2); - - d = dst; - d6u32 = vld1_lane_u32((const uint32_t *)d, d6u32, 0); - d += dst_stride; - d7u32 = vld1_lane_u32((const uint32_t *)d, d7u32, 0); - d += dst_stride; - d6u32 = vld1_lane_u32((const uint32_t *)d, d6u32, 1); - d += dst_stride; - d7u32 = vld1_lane_u32((const uint32_t *)d, d7u32, 1); - - d16s16 = vreinterpret_s16_u16(vget_low_u16(q8u16)); - d17s16 = vreinterpret_s16_u16(vget_high_u16(q8u16)); - d18s16 = vreinterpret_s16_u16(vget_low_u16(q9u16)); - d19s16 = vreinterpret_s16_u16(vget_high_u16(q9u16)); - d22s16 = vreinterpret_s16_u16(vget_low_u16(q11u16)); - d24s16 = vreinterpret_s16_u16(vget_low_u16(q12u16)); - d25s16 = vreinterpret_s16_u16(vget_high_u16(q12u16)); - d26s16 = vreinterpret_s16_u16(vget_low_u16(q13u16)); - d27s16 = vreinterpret_s16_u16(vget_high_u16(q13u16)); - - q1s32 = MULTIPLY_BY_Q0(d16s16, d17s16, d20s16, d22s16, - d18s16, d19s16, d23s16, d24s16, q0s16); - q2s32 = MULTIPLY_BY_Q0(d17s16, d20s16, d22s16, d18s16, - d19s16, d23s16, d24s16, d26s16, q0s16); - q14s32 = MULTIPLY_BY_Q0(d20s16, d22s16, d18s16, d19s16, - d23s16, d24s16, d26s16, d27s16, q0s16); - q15s32 = MULTIPLY_BY_Q0(d22s16, d18s16, d19s16, d23s16, - d24s16, d26s16, d27s16, d25s16, q0s16); - - __builtin_prefetch(src + 64 + src_stride * 3); - - d2u16 = vqrshrun_n_s32(q1s32, 7); - d3u16 = vqrshrun_n_s32(q2s32, 7); - d4u16 = vqrshrun_n_s32(q14s32, 7); - d5u16 = vqrshrun_n_s32(q15s32, 7); - - q1u16 = vcombine_u16(d2u16, d3u16); - q2u16 = vcombine_u16(d4u16, d5u16); - - d2u8 = vqmovn_u16(q1u16); - d3u8 = vqmovn_u16(q2u16); - - d0x2u16 = vtrn_u16(vreinterpret_u16_u8(d2u8), - vreinterpret_u16_u8(d3u8)); - d0x2u32 = vtrn_u32(vreinterpret_u32_u16(d0x2u16.val[0]), - vreinterpret_u32_u16(d0x2u16.val[1])); - d0x2u8 = vtrn_u8(vreinterpret_u8_u32(d0x2u32.val[0]), - vreinterpret_u8_u32(d0x2u32.val[1])); - - q1u8 = vcombine_u8(d0x2u8.val[0], d0x2u8.val[1]); - q3u8 = vreinterpretq_u8_u32(vcombine_u32(d6u32, d7u32)); - - q1u8 = vrhaddq_u8(q1u8, q3u8); - - d2u32 = vreinterpret_u32_u8(vget_low_u8(q1u8)); - d3u32 = vreinterpret_u32_u8(vget_high_u8(q1u8)); - - d = dst; - vst1_lane_u32((uint32_t *)d, d2u32, 0); - d += dst_stride; - vst1_lane_u32((uint32_t *)d, d3u32, 0); - d += dst_stride; - vst1_lane_u32((uint32_t *)d, d2u32, 1); - d += dst_stride; - vst1_lane_u32((uint32_t *)d, d3u32, 1); - - q8u16 = q9u16; - d20s16 = d23s16; - q11u16 = q12u16; - q9u16 = q13u16; - d23s16 = vreinterpret_s16_u16(vget_high_u16(q11u16)); - } - src += src_stride * 4 - w - 7; - dst += dst_stride * 4 - w; - } - return; -} - -void vp9_convolve8_avg_vert_neon( - uint8_t *src, - ptrdiff_t src_stride, - uint8_t *dst, - ptrdiff_t dst_stride, - const int16_t *filter_x, // unused - int x_step_q4, // unused - const int16_t *filter_y, - int y_step_q4, - int w, - int h) { - int height; - uint8_t *s, *d; - uint8x8_t d2u8, d3u8; - uint32x2_t d2u32, d3u32, d6u32, d7u32; - uint32x2_t d16u32, d18u32, d20u32, d22u32, d24u32, d26u32; - uint8x16_t q1u8, q3u8; - int16x4_t d16s16, d17s16, d18s16, d19s16, d20s16, d21s16, d22s16; - int16x4_t d24s16, d25s16, d26s16, d27s16; - uint16x4_t d2u16, d3u16, d4u16, d5u16; - int16x8_t q0s16; - uint16x8_t q1u16, q2u16, q8u16, q9u16, q10u16, q11u16, q12u16, q13u16; - int32x4_t q1s32, q2s32, q14s32, q15s32; - - if (y_step_q4 != 16) { - vp9_convolve8_avg_vert_c(src, src_stride, dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, w, h); - return; - } - - src -= src_stride * 3; - q0s16 = vld1q_s16(filter_y); - for (; w > 0; w -= 4, src += 4, dst += 4) { // loop_vert_h - s = src; - d16u32 = vld1_lane_u32((const uint32_t *)s, d16u32, 0); - s += src_stride; - d16u32 = vld1_lane_u32((const uint32_t *)s, d16u32, 1); - s += src_stride; - d18u32 = vld1_lane_u32((const uint32_t *)s, d18u32, 0); - s += src_stride; - d18u32 = vld1_lane_u32((const uint32_t *)s, d18u32, 1); - s += src_stride; - d20u32 = vld1_lane_u32((const uint32_t *)s, d20u32, 0); - s += src_stride; - d20u32 = vld1_lane_u32((const uint32_t *)s, d20u32, 1); - s += src_stride; - d22u32 = vld1_lane_u32((const uint32_t *)s, d22u32, 0); - s += src_stride; - - q8u16 = vmovl_u8(vreinterpret_u8_u32(d16u32)); - q9u16 = vmovl_u8(vreinterpret_u8_u32(d18u32)); - q10u16 = vmovl_u8(vreinterpret_u8_u32(d20u32)); - q11u16 = vmovl_u8(vreinterpret_u8_u32(d22u32)); - - d18s16 = vreinterpret_s16_u16(vget_low_u16(q9u16)); - d19s16 = vreinterpret_s16_u16(vget_high_u16(q9u16)); - d22s16 = vreinterpret_s16_u16(vget_low_u16(q11u16)); - d = dst; - for (height = h; height > 0; height -= 4) { // loop_vert - d24u32 = vld1_lane_u32((const uint32_t *)s, d24u32, 0); - s += src_stride; - d26u32 = vld1_lane_u32((const uint32_t *)s, d26u32, 0); - s += src_stride; - d26u32 = vld1_lane_u32((const uint32_t *)s, d26u32, 1); - s += src_stride; - d24u32 = vld1_lane_u32((const uint32_t *)s, d24u32, 1); - s += src_stride; - - q12u16 = vmovl_u8(vreinterpret_u8_u32(d24u32)); - q13u16 = vmovl_u8(vreinterpret_u8_u32(d26u32)); - - d6u32 = vld1_lane_u32((const uint32_t *)d, d6u32, 0); - d += dst_stride; - d6u32 = vld1_lane_u32((const uint32_t *)d, d6u32, 1); - d += dst_stride; - d7u32 = vld1_lane_u32((const uint32_t *)d, d7u32, 0); - d += dst_stride; - d7u32 = vld1_lane_u32((const uint32_t *)d, d7u32, 1); - d -= dst_stride * 3; - - d16s16 = vreinterpret_s16_u16(vget_low_u16(q8u16)); - d17s16 = vreinterpret_s16_u16(vget_high_u16(q8u16)); - d20s16 = vreinterpret_s16_u16(vget_low_u16(q10u16)); - d21s16 = vreinterpret_s16_u16(vget_high_u16(q10u16)); - d24s16 = vreinterpret_s16_u16(vget_low_u16(q12u16)); - d25s16 = vreinterpret_s16_u16(vget_high_u16(q12u16)); - d26s16 = vreinterpret_s16_u16(vget_low_u16(q13u16)); - d27s16 = vreinterpret_s16_u16(vget_high_u16(q13u16)); - - __builtin_prefetch(s); - __builtin_prefetch(s + src_stride); - q1s32 = MULTIPLY_BY_Q0(d16s16, d17s16, d18s16, d19s16, - d20s16, d21s16, d22s16, d24s16, q0s16); - __builtin_prefetch(s + src_stride * 2); - __builtin_prefetch(s + src_stride * 3); - q2s32 = MULTIPLY_BY_Q0(d17s16, d18s16, d19s16, d20s16, - d21s16, d22s16, d24s16, d26s16, q0s16); - __builtin_prefetch(d); - __builtin_prefetch(d + dst_stride); - q14s32 = MULTIPLY_BY_Q0(d18s16, d19s16, d20s16, d21s16, - d22s16, d24s16, d26s16, d27s16, q0s16); - __builtin_prefetch(d + dst_stride * 2); - __builtin_prefetch(d + dst_stride * 3); - q15s32 = MULTIPLY_BY_Q0(d19s16, d20s16, d21s16, d22s16, - d24s16, d26s16, d27s16, d25s16, q0s16); - - d2u16 = vqrshrun_n_s32(q1s32, 7); - d3u16 = vqrshrun_n_s32(q2s32, 7); - d4u16 = vqrshrun_n_s32(q14s32, 7); - d5u16 = vqrshrun_n_s32(q15s32, 7); - - q1u16 = vcombine_u16(d2u16, d3u16); - q2u16 = vcombine_u16(d4u16, d5u16); - - d2u8 = vqmovn_u16(q1u16); - d3u8 = vqmovn_u16(q2u16); - - q1u8 = vcombine_u8(d2u8, d3u8); - q3u8 = vreinterpretq_u8_u32(vcombine_u32(d6u32, d7u32)); - - q1u8 = vrhaddq_u8(q1u8, q3u8); - - d2u32 = vreinterpret_u32_u8(vget_low_u8(q1u8)); - d3u32 = vreinterpret_u32_u8(vget_high_u8(q1u8)); - - vst1_lane_u32((uint32_t *)d, d2u32, 0); - d += dst_stride; - vst1_lane_u32((uint32_t *)d, d2u32, 1); - d += dst_stride; - vst1_lane_u32((uint32_t *)d, d3u32, 0); - d += dst_stride; - vst1_lane_u32((uint32_t *)d, d3u32, 1); - d += dst_stride; - - q8u16 = q10u16; - d18s16 = d22s16; - d19s16 = d24s16; - q10u16 = q13u16; - d22s16 = d25s16; - } - } - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_convolve8_neon_asm.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_convolve8_neon_asm.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_convolve8_neon_asm.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_convolve8_neon_asm.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,280 +0,0 @@ -; -; Copyright (c) 2013 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - ; These functions are only valid when: - ; x_step_q4 == 16 - ; w%4 == 0 - ; h%4 == 0 - ; taps == 8 - ; VP9_FILTER_WEIGHT == 128 - ; VP9_FILTER_SHIFT == 7 - - EXPORT |vp9_convolve8_horiz_neon| - EXPORT |vp9_convolve8_vert_neon| - IMPORT |vp9_convolve8_horiz_c| - IMPORT |vp9_convolve8_vert_c| - ARM - REQUIRE8 - PRESERVE8 - - AREA ||.text||, CODE, READONLY, ALIGN=2 - - ; Multiply and accumulate by q0 - MACRO - MULTIPLY_BY_Q0 $dst, $src0, $src1, $src2, $src3, $src4, $src5, $src6, $src7 - vmull.s16 $dst, $src0, d0[0] - vmlal.s16 $dst, $src1, d0[1] - vmlal.s16 $dst, $src2, d0[2] - vmlal.s16 $dst, $src3, d0[3] - vmlal.s16 $dst, $src4, d1[0] - vmlal.s16 $dst, $src5, d1[1] - vmlal.s16 $dst, $src6, d1[2] - vmlal.s16 $dst, $src7, d1[3] - MEND - -; r0 const uint8_t *src -; r1 int src_stride -; r2 uint8_t *dst -; r3 int dst_stride -; sp[]const int16_t *filter_x -; sp[]int x_step_q4 -; sp[]const int16_t *filter_y ; unused -; sp[]int y_step_q4 ; unused -; sp[]int w -; sp[]int h - -|vp9_convolve8_horiz_neon| PROC - ldr r12, [sp, #4] ; x_step_q4 - cmp r12, #16 - bne vp9_convolve8_horiz_c - - push {r4-r10, lr} - - sub r0, r0, #3 ; adjust for taps - - ldr r5, [sp, #32] ; filter_x - ldr r6, [sp, #48] ; w - ldr r7, [sp, #52] ; h - - vld1.s16 {q0}, [r5] ; filter_x - - sub r8, r1, r1, lsl #2 ; -src_stride * 3 - add r8, r8, #4 ; -src_stride * 3 + 4 - - sub r4, r3, r3, lsl #2 ; -dst_stride * 3 - add r4, r4, #4 ; -dst_stride * 3 + 4 - - rsb r9, r6, r1, lsl #2 ; reset src for outer loop - sub r9, r9, #7 - rsb r12, r6, r3, lsl #2 ; reset dst for outer loop - - mov r10, r6 ; w loop counter - -vp9_convolve8_loop_horiz_v - vld1.8 {d24}, [r0], r1 - vld1.8 {d25}, [r0], r1 - vld1.8 {d26}, [r0], r1 - vld1.8 {d27}, [r0], r8 - - vtrn.16 q12, q13 - vtrn.8 d24, d25 - vtrn.8 d26, d27 - - pld [r0, r1, lsl #2] - - vmovl.u8 q8, d24 - vmovl.u8 q9, d25 - vmovl.u8 q10, d26 - vmovl.u8 q11, d27 - - ; save a few instructions in the inner loop - vswp d17, d18 - vmov d23, d21 - - add r0, r0, #3 - -vp9_convolve8_loop_horiz - add r5, r0, #64 - - vld1.32 {d28[]}, [r0], r1 - vld1.32 {d29[]}, [r0], r1 - vld1.32 {d31[]}, [r0], r1 - vld1.32 {d30[]}, [r0], r8 - - pld [r5] - - vtrn.16 d28, d31 - vtrn.16 d29, d30 - vtrn.8 d28, d29 - vtrn.8 d31, d30 - - pld [r5, r1] - - ; extract to s16 - vtrn.32 q14, q15 - vmovl.u8 q12, d28 - vmovl.u8 q13, d29 - - pld [r5, r1, lsl #1] - - ; src[] * filter_x - MULTIPLY_BY_Q0 q1, d16, d17, d20, d22, d18, d19, d23, d24 - MULTIPLY_BY_Q0 q2, d17, d20, d22, d18, d19, d23, d24, d26 - MULTIPLY_BY_Q0 q14, d20, d22, d18, d19, d23, d24, d26, d27 - MULTIPLY_BY_Q0 q15, d22, d18, d19, d23, d24, d26, d27, d25 - - pld [r5, -r8] - - ; += 64 >> 7 - vqrshrun.s32 d2, q1, #7 - vqrshrun.s32 d3, q2, #7 - vqrshrun.s32 d4, q14, #7 - vqrshrun.s32 d5, q15, #7 - - ; saturate - vqmovn.u16 d2, q1 - vqmovn.u16 d3, q2 - - ; transpose - vtrn.16 d2, d3 - vtrn.32 d2, d3 - vtrn.8 d2, d3 - - vst1.u32 {d2[0]}, [r2@32], r3 - vst1.u32 {d3[0]}, [r2@32], r3 - vst1.u32 {d2[1]}, [r2@32], r3 - vst1.u32 {d3[1]}, [r2@32], r4 - - vmov q8, q9 - vmov d20, d23 - vmov q11, q12 - vmov q9, q13 - - subs r6, r6, #4 ; w -= 4 - bgt vp9_convolve8_loop_horiz - - ; outer loop - mov r6, r10 ; restore w counter - add r0, r0, r9 ; src += src_stride * 4 - w - add r2, r2, r12 ; dst += dst_stride * 4 - w - subs r7, r7, #4 ; h -= 4 - bgt vp9_convolve8_loop_horiz_v - - pop {r4-r10, pc} - - ENDP - -|vp9_convolve8_vert_neon| PROC - ldr r12, [sp, #12] - cmp r12, #16 - bne vp9_convolve8_vert_c - - push {r4-r8, lr} - - ; adjust for taps - sub r0, r0, r1 - sub r0, r0, r1, lsl #1 - - ldr r4, [sp, #32] ; filter_y - ldr r6, [sp, #40] ; w - ldr lr, [sp, #44] ; h - - vld1.s16 {q0}, [r4] ; filter_y - - lsl r1, r1, #1 - lsl r3, r3, #1 - -vp9_convolve8_loop_vert_h - mov r4, r0 - add r7, r0, r1, asr #1 - mov r5, r2 - add r8, r2, r3, asr #1 - mov r12, lr ; h loop counter - - vld1.u32 {d16[0]}, [r4], r1 - vld1.u32 {d16[1]}, [r7], r1 - vld1.u32 {d18[0]}, [r4], r1 - vld1.u32 {d18[1]}, [r7], r1 - vld1.u32 {d20[0]}, [r4], r1 - vld1.u32 {d20[1]}, [r7], r1 - vld1.u32 {d22[0]}, [r4], r1 - - vmovl.u8 q8, d16 - vmovl.u8 q9, d18 - vmovl.u8 q10, d20 - vmovl.u8 q11, d22 - -vp9_convolve8_loop_vert - ; always process a 4x4 block at a time - vld1.u32 {d24[0]}, [r7], r1 - vld1.u32 {d26[0]}, [r4], r1 - vld1.u32 {d26[1]}, [r7], r1 - vld1.u32 {d24[1]}, [r4], r1 - - ; extract to s16 - vmovl.u8 q12, d24 - vmovl.u8 q13, d26 - - pld [r5] - pld [r8] - - ; src[] * filter_y - MULTIPLY_BY_Q0 q1, d16, d17, d18, d19, d20, d21, d22, d24 - - pld [r5, r3] - pld [r8, r3] - - MULTIPLY_BY_Q0 q2, d17, d18, d19, d20, d21, d22, d24, d26 - - pld [r7] - pld [r4] - - MULTIPLY_BY_Q0 q14, d18, d19, d20, d21, d22, d24, d26, d27 - - pld [r7, r1] - pld [r4, r1] - - MULTIPLY_BY_Q0 q15, d19, d20, d21, d22, d24, d26, d27, d25 - - ; += 64 >> 7 - vqrshrun.s32 d2, q1, #7 - vqrshrun.s32 d3, q2, #7 - vqrshrun.s32 d4, q14, #7 - vqrshrun.s32 d5, q15, #7 - - ; saturate - vqmovn.u16 d2, q1 - vqmovn.u16 d3, q2 - - vst1.u32 {d2[0]}, [r5@32], r3 - vst1.u32 {d2[1]}, [r8@32], r3 - vst1.u32 {d3[0]}, [r5@32], r3 - vst1.u32 {d3[1]}, [r8@32], r3 - - vmov q8, q10 - vmov d18, d22 - vmov d19, d24 - vmov q10, q13 - vmov d22, d25 - - subs r12, r12, #4 ; h -= 4 - bgt vp9_convolve8_loop_vert - - ; outer loop - add r0, r0, #4 - add r2, r2, #4 - subs r6, r6, #4 ; w -= 4 - bgt vp9_convolve8_loop_vert_h - - pop {r4-r8, pc} - - ENDP - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_convolve8_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_convolve8_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_convolve8_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_convolve8_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,357 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vpx_config.h" -#include "vpx_ports/mem.h" - -void vp9_convolve8_horiz_c(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h); -void vp9_convolve8_vert_c(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h); - -static INLINE int32x4_t MULTIPLY_BY_Q0( - int16x4_t dsrc0, - int16x4_t dsrc1, - int16x4_t dsrc2, - int16x4_t dsrc3, - int16x4_t dsrc4, - int16x4_t dsrc5, - int16x4_t dsrc6, - int16x4_t dsrc7, - int16x8_t q0s16) { - int32x4_t qdst; - int16x4_t d0s16, d1s16; - - d0s16 = vget_low_s16(q0s16); - d1s16 = vget_high_s16(q0s16); - - qdst = vmull_lane_s16(dsrc0, d0s16, 0); - qdst = vmlal_lane_s16(qdst, dsrc1, d0s16, 1); - qdst = vmlal_lane_s16(qdst, dsrc2, d0s16, 2); - qdst = vmlal_lane_s16(qdst, dsrc3, d0s16, 3); - qdst = vmlal_lane_s16(qdst, dsrc4, d1s16, 0); - qdst = vmlal_lane_s16(qdst, dsrc5, d1s16, 1); - qdst = vmlal_lane_s16(qdst, dsrc6, d1s16, 2); - qdst = vmlal_lane_s16(qdst, dsrc7, d1s16, 3); - return qdst; -} - -void vp9_convolve8_horiz_neon( - uint8_t *src, - ptrdiff_t src_stride, - uint8_t *dst, - ptrdiff_t dst_stride, - const int16_t *filter_x, - int x_step_q4, - const int16_t *filter_y, // unused - int y_step_q4, // unused - int w, - int h) { - int width; - uint8_t *s, *d, *psrc, *pdst; - uint8x8_t d2u8, d3u8, d24u8, d25u8, d26u8, d27u8, d28u8, d29u8; - uint32x2_t d2u32, d3u32, d28u32, d29u32, d30u32, d31u32; - uint8x16_t q12u8, q13u8, q14u8, q15u8; - int16x4_t d16s16, d17s16, d18s16, d19s16, d20s16, d22s16, d23s16; - int16x4_t d24s16, d25s16, d26s16, d27s16; - uint16x4_t d2u16, d3u16, d4u16, d5u16, d16u16, d17u16, d18u16, d19u16; - int16x8_t q0s16; - uint16x8_t q1u16, q2u16, q8u16, q9u16, q10u16, q11u16, q12u16, q13u16; - int32x4_t q1s32, q2s32, q14s32, q15s32; - uint16x8x2_t q0x2u16; - uint8x8x2_t d0x2u8, d1x2u8; - uint32x2x2_t d0x2u32; - uint16x4x2_t d0x2u16, d1x2u16; - uint32x4x2_t q0x2u32; - - if (x_step_q4 != 16) { - vp9_convolve8_horiz_c(src, src_stride, dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, w, h); - return; - } - - q0s16 = vld1q_s16(filter_x); - - src -= 3; // adjust for taps - for (; h > 0; h -= 4, - src += src_stride * 4, - dst += dst_stride * 4) { // loop_horiz_v - s = src; - d24u8 = vld1_u8(s); - s += src_stride; - d25u8 = vld1_u8(s); - s += src_stride; - d26u8 = vld1_u8(s); - s += src_stride; - d27u8 = vld1_u8(s); - - q12u8 = vcombine_u8(d24u8, d25u8); - q13u8 = vcombine_u8(d26u8, d27u8); - - q0x2u16 = vtrnq_u16(vreinterpretq_u16_u8(q12u8), - vreinterpretq_u16_u8(q13u8)); - d24u8 = vreinterpret_u8_u16(vget_low_u16(q0x2u16.val[0])); - d25u8 = vreinterpret_u8_u16(vget_high_u16(q0x2u16.val[0])); - d26u8 = vreinterpret_u8_u16(vget_low_u16(q0x2u16.val[1])); - d27u8 = vreinterpret_u8_u16(vget_high_u16(q0x2u16.val[1])); - d0x2u8 = vtrn_u8(d24u8, d25u8); - d1x2u8 = vtrn_u8(d26u8, d27u8); - - __builtin_prefetch(src + src_stride * 4); - __builtin_prefetch(src + src_stride * 5); - __builtin_prefetch(src + src_stride * 6); - - q8u16 = vmovl_u8(d0x2u8.val[0]); - q9u16 = vmovl_u8(d0x2u8.val[1]); - q10u16 = vmovl_u8(d1x2u8.val[0]); - q11u16 = vmovl_u8(d1x2u8.val[1]); - - d16u16 = vget_low_u16(q8u16); - d17u16 = vget_high_u16(q8u16); - d18u16 = vget_low_u16(q9u16); - d19u16 = vget_high_u16(q9u16); - q8u16 = vcombine_u16(d16u16, d18u16); // vswp 17 18 - q9u16 = vcombine_u16(d17u16, d19u16); - - d20s16 = vreinterpret_s16_u16(vget_low_u16(q10u16)); - d23s16 = vreinterpret_s16_u16(vget_high_u16(q10u16)); // vmov 23 21 - for (width = w, psrc = src + 7, pdst = dst; - width > 0; - width -= 4, psrc += 4, pdst += 4) { // loop_horiz - s = psrc; - d28u32 = vld1_dup_u32((const uint32_t *)s); - s += src_stride; - d29u32 = vld1_dup_u32((const uint32_t *)s); - s += src_stride; - d31u32 = vld1_dup_u32((const uint32_t *)s); - s += src_stride; - d30u32 = vld1_dup_u32((const uint32_t *)s); - - __builtin_prefetch(psrc + 64); - - d0x2u16 = vtrn_u16(vreinterpret_u16_u32(d28u32), - vreinterpret_u16_u32(d31u32)); - d1x2u16 = vtrn_u16(vreinterpret_u16_u32(d29u32), - vreinterpret_u16_u32(d30u32)); - d0x2u8 = vtrn_u8(vreinterpret_u8_u16(d0x2u16.val[0]), // d28 - vreinterpret_u8_u16(d1x2u16.val[0])); // d29 - d1x2u8 = vtrn_u8(vreinterpret_u8_u16(d0x2u16.val[1]), // d31 - vreinterpret_u8_u16(d1x2u16.val[1])); // d30 - - __builtin_prefetch(psrc + 64 + src_stride); - - q14u8 = vcombine_u8(d0x2u8.val[0], d0x2u8.val[1]); - q15u8 = vcombine_u8(d1x2u8.val[1], d1x2u8.val[0]); - q0x2u32 = vtrnq_u32(vreinterpretq_u32_u8(q14u8), - vreinterpretq_u32_u8(q15u8)); - - d28u8 = vreinterpret_u8_u32(vget_low_u32(q0x2u32.val[0])); - d29u8 = vreinterpret_u8_u32(vget_high_u32(q0x2u32.val[0])); - q12u16 = vmovl_u8(d28u8); - q13u16 = vmovl_u8(d29u8); - - __builtin_prefetch(psrc + 64 + src_stride * 2); - - d16s16 = vreinterpret_s16_u16(vget_low_u16(q8u16)); - d17s16 = vreinterpret_s16_u16(vget_high_u16(q8u16)); - d18s16 = vreinterpret_s16_u16(vget_low_u16(q9u16)); - d19s16 = vreinterpret_s16_u16(vget_high_u16(q9u16)); - d22s16 = vreinterpret_s16_u16(vget_low_u16(q11u16)); - d24s16 = vreinterpret_s16_u16(vget_low_u16(q12u16)); - d25s16 = vreinterpret_s16_u16(vget_high_u16(q12u16)); - d26s16 = vreinterpret_s16_u16(vget_low_u16(q13u16)); - d27s16 = vreinterpret_s16_u16(vget_high_u16(q13u16)); - - q1s32 = MULTIPLY_BY_Q0(d16s16, d17s16, d20s16, d22s16, - d18s16, d19s16, d23s16, d24s16, q0s16); - q2s32 = MULTIPLY_BY_Q0(d17s16, d20s16, d22s16, d18s16, - d19s16, d23s16, d24s16, d26s16, q0s16); - q14s32 = MULTIPLY_BY_Q0(d20s16, d22s16, d18s16, d19s16, - d23s16, d24s16, d26s16, d27s16, q0s16); - q15s32 = MULTIPLY_BY_Q0(d22s16, d18s16, d19s16, d23s16, - d24s16, d26s16, d27s16, d25s16, q0s16); - - __builtin_prefetch(psrc + 60 + src_stride * 3); - - d2u16 = vqrshrun_n_s32(q1s32, 7); - d3u16 = vqrshrun_n_s32(q2s32, 7); - d4u16 = vqrshrun_n_s32(q14s32, 7); - d5u16 = vqrshrun_n_s32(q15s32, 7); - - q1u16 = vcombine_u16(d2u16, d3u16); - q2u16 = vcombine_u16(d4u16, d5u16); - - d2u8 = vqmovn_u16(q1u16); - d3u8 = vqmovn_u16(q2u16); - - d0x2u16 = vtrn_u16(vreinterpret_u16_u8(d2u8), - vreinterpret_u16_u8(d3u8)); - d0x2u32 = vtrn_u32(vreinterpret_u32_u16(d0x2u16.val[0]), - vreinterpret_u32_u16(d0x2u16.val[1])); - d0x2u8 = vtrn_u8(vreinterpret_u8_u32(d0x2u32.val[0]), - vreinterpret_u8_u32(d0x2u32.val[1])); - - d2u32 = vreinterpret_u32_u8(d0x2u8.val[0]); - d3u32 = vreinterpret_u32_u8(d0x2u8.val[1]); - - d = pdst; - vst1_lane_u32((uint32_t *)d, d2u32, 0); - d += dst_stride; - vst1_lane_u32((uint32_t *)d, d3u32, 0); - d += dst_stride; - vst1_lane_u32((uint32_t *)d, d2u32, 1); - d += dst_stride; - vst1_lane_u32((uint32_t *)d, d3u32, 1); - - q8u16 = q9u16; - d20s16 = d23s16; - q11u16 = q12u16; - q9u16 = q13u16; - d23s16 = vreinterpret_s16_u16(vget_high_u16(q11u16)); - } - } - return; -} - -void vp9_convolve8_vert_neon( - uint8_t *src, - ptrdiff_t src_stride, - uint8_t *dst, - ptrdiff_t dst_stride, - const int16_t *filter_x, // unused - int x_step_q4, // unused - const int16_t *filter_y, - int y_step_q4, - int w, - int h) { - int height; - uint8_t *s, *d; - uint32x2_t d2u32, d3u32; - uint32x2_t d16u32, d18u32, d20u32, d22u32, d24u32, d26u32; - int16x4_t d16s16, d17s16, d18s16, d19s16, d20s16, d21s16, d22s16; - int16x4_t d24s16, d25s16, d26s16, d27s16; - uint16x4_t d2u16, d3u16, d4u16, d5u16; - int16x8_t q0s16; - uint16x8_t q1u16, q2u16, q8u16, q9u16, q10u16, q11u16, q12u16, q13u16; - int32x4_t q1s32, q2s32, q14s32, q15s32; - - if (y_step_q4 != 16) { - vp9_convolve8_vert_c(src, src_stride, dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, w, h); - return; - } - - src -= src_stride * 3; - q0s16 = vld1q_s16(filter_y); - for (; w > 0; w -= 4, src += 4, dst += 4) { // loop_vert_h - s = src; - d16u32 = vld1_lane_u32((const uint32_t *)s, d16u32, 0); - s += src_stride; - d16u32 = vld1_lane_u32((const uint32_t *)s, d16u32, 1); - s += src_stride; - d18u32 = vld1_lane_u32((const uint32_t *)s, d18u32, 0); - s += src_stride; - d18u32 = vld1_lane_u32((const uint32_t *)s, d18u32, 1); - s += src_stride; - d20u32 = vld1_lane_u32((const uint32_t *)s, d20u32, 0); - s += src_stride; - d20u32 = vld1_lane_u32((const uint32_t *)s, d20u32, 1); - s += src_stride; - d22u32 = vld1_lane_u32((const uint32_t *)s, d22u32, 0); - s += src_stride; - - q8u16 = vmovl_u8(vreinterpret_u8_u32(d16u32)); - q9u16 = vmovl_u8(vreinterpret_u8_u32(d18u32)); - q10u16 = vmovl_u8(vreinterpret_u8_u32(d20u32)); - q11u16 = vmovl_u8(vreinterpret_u8_u32(d22u32)); - - d18s16 = vreinterpret_s16_u16(vget_low_u16(q9u16)); - d19s16 = vreinterpret_s16_u16(vget_high_u16(q9u16)); - d22s16 = vreinterpret_s16_u16(vget_low_u16(q11u16)); - d = dst; - for (height = h; height > 0; height -= 4) { // loop_vert - d24u32 = vld1_lane_u32((const uint32_t *)s, d24u32, 0); - s += src_stride; - d26u32 = vld1_lane_u32((const uint32_t *)s, d26u32, 0); - s += src_stride; - d26u32 = vld1_lane_u32((const uint32_t *)s, d26u32, 1); - s += src_stride; - d24u32 = vld1_lane_u32((const uint32_t *)s, d24u32, 1); - s += src_stride; - - q12u16 = vmovl_u8(vreinterpret_u8_u32(d24u32)); - q13u16 = vmovl_u8(vreinterpret_u8_u32(d26u32)); - - d16s16 = vreinterpret_s16_u16(vget_low_u16(q8u16)); - d17s16 = vreinterpret_s16_u16(vget_high_u16(q8u16)); - d20s16 = vreinterpret_s16_u16(vget_low_u16(q10u16)); - d21s16 = vreinterpret_s16_u16(vget_high_u16(q10u16)); - d24s16 = vreinterpret_s16_u16(vget_low_u16(q12u16)); - d25s16 = vreinterpret_s16_u16(vget_high_u16(q12u16)); - d26s16 = vreinterpret_s16_u16(vget_low_u16(q13u16)); - d27s16 = vreinterpret_s16_u16(vget_high_u16(q13u16)); - - __builtin_prefetch(d); - __builtin_prefetch(d + dst_stride); - q1s32 = MULTIPLY_BY_Q0(d16s16, d17s16, d18s16, d19s16, - d20s16, d21s16, d22s16, d24s16, q0s16); - __builtin_prefetch(d + dst_stride * 2); - __builtin_prefetch(d + dst_stride * 3); - q2s32 = MULTIPLY_BY_Q0(d17s16, d18s16, d19s16, d20s16, - d21s16, d22s16, d24s16, d26s16, q0s16); - __builtin_prefetch(s); - __builtin_prefetch(s + src_stride); - q14s32 = MULTIPLY_BY_Q0(d18s16, d19s16, d20s16, d21s16, - d22s16, d24s16, d26s16, d27s16, q0s16); - __builtin_prefetch(s + src_stride * 2); - __builtin_prefetch(s + src_stride * 3); - q15s32 = MULTIPLY_BY_Q0(d19s16, d20s16, d21s16, d22s16, - d24s16, d26s16, d27s16, d25s16, q0s16); - - d2u16 = vqrshrun_n_s32(q1s32, 7); - d3u16 = vqrshrun_n_s32(q2s32, 7); - d4u16 = vqrshrun_n_s32(q14s32, 7); - d5u16 = vqrshrun_n_s32(q15s32, 7); - - q1u16 = vcombine_u16(d2u16, d3u16); - q2u16 = vcombine_u16(d4u16, d5u16); - - d2u32 = vreinterpret_u32_u8(vqmovn_u16(q1u16)); - d3u32 = vreinterpret_u32_u8(vqmovn_u16(q2u16)); - - vst1_lane_u32((uint32_t *)d, d2u32, 0); - d += dst_stride; - vst1_lane_u32((uint32_t *)d, d2u32, 1); - d += dst_stride; - vst1_lane_u32((uint32_t *)d, d3u32, 0); - d += dst_stride; - vst1_lane_u32((uint32_t *)d, d3u32, 1); - d += dst_stride; - - q8u16 = q10u16; - d18s16 = d22s16; - d19s16 = d24s16; - q10u16 = q13u16; - d22s16 = d25s16; - } - } - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_convolve_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_convolve_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_convolve_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_convolve_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vpx_ports/mem.h" - -void vp9_convolve8_neon(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h) { - /* Given our constraints: w <= 64, h <= 64, taps == 8 we can reduce the - * maximum buffer size to 64 * 64 + 7 (+ 1 to make it divisible by 4). - */ - DECLARE_ALIGNED_ARRAY(8, uint8_t, temp, 64 * 72); - - // Account for the vertical phase needing 3 lines prior and 4 lines post - int intermediate_height = h + 7; - - if (x_step_q4 != 16 || y_step_q4 != 16) { - vp9_convolve8_c(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - return; - } - - /* Filter starting 3 lines back. The neon implementation will ignore the - * given height and filter a multiple of 4 lines. Since this goes in to - * the temp buffer which has lots of extra room and is subsequently discarded - * this is safe if somewhat less than ideal. - */ - vp9_convolve8_horiz_neon(src - src_stride * 3, src_stride, - temp, 64, - filter_x, x_step_q4, filter_y, y_step_q4, - w, intermediate_height); - - /* Step into the temp buffer 3 lines to get the actual frame data */ - vp9_convolve8_vert_neon(temp + 64 * 3, 64, - dst, dst_stride, - filter_x, x_step_q4, filter_y, y_step_q4, - w, h); -} - -void vp9_convolve8_avg_neon(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h) { - DECLARE_ALIGNED_ARRAY(8, uint8_t, temp, 64 * 72); - int intermediate_height = h + 7; - - if (x_step_q4 != 16 || y_step_q4 != 16) { - vp9_convolve8_avg_c(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - return; - } - - /* This implementation has the same issues as above. In addition, we only want - * to average the values after both passes. - */ - vp9_convolve8_horiz_neon(src - src_stride * 3, src_stride, - temp, 64, - filter_x, x_step_q4, filter_y, y_step_q4, - w, intermediate_height); - vp9_convolve8_avg_vert_neon(temp + 64 * 3, - 64, dst, dst_stride, - filter_x, x_step_q4, filter_y, y_step_q4, - w, h); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_copy_neon_asm.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_copy_neon_asm.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_copy_neon_asm.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_copy_neon_asm.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,84 +0,0 @@ -; -; Copyright (c) 2013 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - EXPORT |vp9_convolve_copy_neon| - ARM - REQUIRE8 - PRESERVE8 - - AREA ||.text||, CODE, READONLY, ALIGN=2 - -|vp9_convolve_copy_neon| PROC - push {r4-r5, lr} - ldrd r4, r5, [sp, #28] - - cmp r4, #32 - bgt copy64 - beq copy32 - cmp r4, #8 - bgt copy16 - beq copy8 - b copy4 - -copy64 - sub lr, r1, #32 - sub r3, r3, #32 -copy64_h - pld [r0, r1, lsl #1] - vld1.8 {q0-q1}, [r0]! - vld1.8 {q2-q3}, [r0], lr - vst1.8 {q0-q1}, [r2@128]! - vst1.8 {q2-q3}, [r2@128], r3 - subs r5, r5, #1 - bgt copy64_h - pop {r4-r5, pc} - -copy32 - pld [r0, r1, lsl #1] - vld1.8 {q0-q1}, [r0], r1 - pld [r0, r1, lsl #1] - vld1.8 {q2-q3}, [r0], r1 - vst1.8 {q0-q1}, [r2@128], r3 - vst1.8 {q2-q3}, [r2@128], r3 - subs r5, r5, #2 - bgt copy32 - pop {r4-r5, pc} - -copy16 - pld [r0, r1, lsl #1] - vld1.8 {q0}, [r0], r1 - pld [r0, r1, lsl #1] - vld1.8 {q1}, [r0], r1 - vst1.8 {q0}, [r2@128], r3 - vst1.8 {q1}, [r2@128], r3 - subs r5, r5, #2 - bgt copy16 - pop {r4-r5, pc} - -copy8 - pld [r0, r1, lsl #1] - vld1.8 {d0}, [r0], r1 - pld [r0, r1, lsl #1] - vld1.8 {d2}, [r0], r1 - vst1.8 {d0}, [r2@64], r3 - vst1.8 {d2}, [r2@64], r3 - subs r5, r5, #2 - bgt copy8 - pop {r4-r5, pc} - -copy4 - ldr r12, [r0], r1 - str r12, [r2], r3 - subs r5, r5, #1 - bgt copy4 - pop {r4-r5, pc} - ENDP - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_copy_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_copy_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_copy_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_copy_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -void vp9_convolve_copy_neon( - const uint8_t *src, // r0 - ptrdiff_t src_stride, // r1 - uint8_t *dst, // r2 - ptrdiff_t dst_stride, // r3 - const int16_t *filter_x, - int filter_x_stride, - const int16_t *filter_y, - int filter_y_stride, - int w, - int h) { - uint8x8_t d0u8, d2u8; - uint8x16_t q0u8, q1u8, q2u8, q3u8; - (void)filter_x; (void)filter_x_stride; - (void)filter_y; (void)filter_y_stride; - - if (w > 32) { // copy64 - for (; h > 0; h--) { - q0u8 = vld1q_u8(src); - q1u8 = vld1q_u8(src + 16); - q2u8 = vld1q_u8(src + 32); - q3u8 = vld1q_u8(src + 48); - src += src_stride; - - vst1q_u8(dst, q0u8); - vst1q_u8(dst + 16, q1u8); - vst1q_u8(dst + 32, q2u8); - vst1q_u8(dst + 48, q3u8); - dst += dst_stride; - } - } else if (w == 32) { // copy32 - for (; h > 0; h -= 2) { - q0u8 = vld1q_u8(src); - q1u8 = vld1q_u8(src + 16); - src += src_stride; - q2u8 = vld1q_u8(src); - q3u8 = vld1q_u8(src + 16); - src += src_stride; - - vst1q_u8(dst, q0u8); - vst1q_u8(dst + 16, q1u8); - dst += dst_stride; - vst1q_u8(dst, q2u8); - vst1q_u8(dst + 16, q3u8); - dst += dst_stride; - } - } else if (w > 8) { // copy16 - for (; h > 0; h -= 2) { - q0u8 = vld1q_u8(src); - src += src_stride; - q1u8 = vld1q_u8(src); - src += src_stride; - - vst1q_u8(dst, q0u8); - dst += dst_stride; - vst1q_u8(dst, q1u8); - dst += dst_stride; - } - } else if (w == 8) { // copy8 - for (; h > 0; h -= 2) { - d0u8 = vld1_u8(src); - src += src_stride; - d2u8 = vld1_u8(src); - src += src_stride; - - vst1_u8(dst, d0u8); - dst += dst_stride; - vst1_u8(dst, d2u8); - dst += dst_stride; - } - } else { // copy4 - for (; h > 0; h--) { - *(uint32_t *)dst = *(const uint32_t *)src; - src += src_stride; - dst += dst_stride; - } - } - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct16x16_1_add_neon_asm.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct16x16_1_add_neon_asm.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct16x16_1_add_neon_asm.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct16x16_1_add_neon_asm.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,198 +0,0 @@ -; -; Copyright (c) 2013 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license and patent -; grant that can be found in the LICENSE file in the root of the source -; tree. All contributing project authors may be found in the AUTHORS -; file in the root of the source tree. -; - - - EXPORT |vp9_idct16x16_1_add_neon| - ARM - REQUIRE8 - PRESERVE8 - - AREA ||.text||, CODE, READONLY, ALIGN=2 - -;void vp9_idct16x16_1_add_neon(int16_t *input, uint8_t *dest, -; int dest_stride) -; -; r0 int16_t input -; r1 uint8_t *dest -; r2 int dest_stride) - -|vp9_idct16x16_1_add_neon| PROC - ldrsh r0, [r0] - - ; generate cospi_16_64 = 11585 - mov r12, #0x2d00 - add r12, #0x41 - - ; out = dct_const_round_shift(input[0] * cospi_16_64) - mul r0, r0, r12 ; input[0] * cospi_16_64 - add r0, r0, #0x2000 ; +(1 << ((DCT_CONST_BITS) - 1)) - asr r0, r0, #14 ; >> DCT_CONST_BITS - - ; out = dct_const_round_shift(out * cospi_16_64) - mul r0, r0, r12 ; out * cospi_16_64 - mov r12, r1 ; save dest - add r0, r0, #0x2000 ; +(1 << ((DCT_CONST_BITS) - 1)) - asr r0, r0, #14 ; >> DCT_CONST_BITS - - ; a1 = ROUND_POWER_OF_TWO(out, 6) - add r0, r0, #32 ; + (1 <<((6) - 1)) - asr r0, r0, #6 ; >> 6 - - vdup.s16 q0, r0 ; duplicate a1 - mov r0, #8 - sub r2, #8 - - ; load destination data row0 - row3 - vld1.64 {d2}, [r1], r0 - vld1.64 {d3}, [r1], r2 - vld1.64 {d4}, [r1], r0 - vld1.64 {d5}, [r1], r2 - vld1.64 {d6}, [r1], r0 - vld1.64 {d7}, [r1], r2 - vld1.64 {d16}, [r1], r0 - vld1.64 {d17}, [r1], r2 - - vaddw.u8 q9, q0, d2 ; dest[x] + a1 - vaddw.u8 q10, q0, d3 ; dest[x] + a1 - vaddw.u8 q11, q0, d4 ; dest[x] + a1 - vaddw.u8 q12, q0, d5 ; dest[x] + a1 - vqmovun.s16 d2, q9 ; clip_pixel - vqmovun.s16 d3, q10 ; clip_pixel - vqmovun.s16 d30, q11 ; clip_pixel - vqmovun.s16 d31, q12 ; clip_pixel - vst1.64 {d2}, [r12], r0 - vst1.64 {d3}, [r12], r2 - vst1.64 {d30}, [r12], r0 - vst1.64 {d31}, [r12], r2 - - vaddw.u8 q9, q0, d6 ; dest[x] + a1 - vaddw.u8 q10, q0, d7 ; dest[x] + a1 - vaddw.u8 q11, q0, d16 ; dest[x] + a1 - vaddw.u8 q12, q0, d17 ; dest[x] + a1 - vqmovun.s16 d2, q9 ; clip_pixel - vqmovun.s16 d3, q10 ; clip_pixel - vqmovun.s16 d30, q11 ; clip_pixel - vqmovun.s16 d31, q12 ; clip_pixel - vst1.64 {d2}, [r12], r0 - vst1.64 {d3}, [r12], r2 - vst1.64 {d30}, [r12], r0 - vst1.64 {d31}, [r12], r2 - - ; load destination data row4 - row7 - vld1.64 {d2}, [r1], r0 - vld1.64 {d3}, [r1], r2 - vld1.64 {d4}, [r1], r0 - vld1.64 {d5}, [r1], r2 - vld1.64 {d6}, [r1], r0 - vld1.64 {d7}, [r1], r2 - vld1.64 {d16}, [r1], r0 - vld1.64 {d17}, [r1], r2 - - vaddw.u8 q9, q0, d2 ; dest[x] + a1 - vaddw.u8 q10, q0, d3 ; dest[x] + a1 - vaddw.u8 q11, q0, d4 ; dest[x] + a1 - vaddw.u8 q12, q0, d5 ; dest[x] + a1 - vqmovun.s16 d2, q9 ; clip_pixel - vqmovun.s16 d3, q10 ; clip_pixel - vqmovun.s16 d30, q11 ; clip_pixel - vqmovun.s16 d31, q12 ; clip_pixel - vst1.64 {d2}, [r12], r0 - vst1.64 {d3}, [r12], r2 - vst1.64 {d30}, [r12], r0 - vst1.64 {d31}, [r12], r2 - - vaddw.u8 q9, q0, d6 ; dest[x] + a1 - vaddw.u8 q10, q0, d7 ; dest[x] + a1 - vaddw.u8 q11, q0, d16 ; dest[x] + a1 - vaddw.u8 q12, q0, d17 ; dest[x] + a1 - vqmovun.s16 d2, q9 ; clip_pixel - vqmovun.s16 d3, q10 ; clip_pixel - vqmovun.s16 d30, q11 ; clip_pixel - vqmovun.s16 d31, q12 ; clip_pixel - vst1.64 {d2}, [r12], r0 - vst1.64 {d3}, [r12], r2 - vst1.64 {d30}, [r12], r0 - vst1.64 {d31}, [r12], r2 - - ; load destination data row8 - row11 - vld1.64 {d2}, [r1], r0 - vld1.64 {d3}, [r1], r2 - vld1.64 {d4}, [r1], r0 - vld1.64 {d5}, [r1], r2 - vld1.64 {d6}, [r1], r0 - vld1.64 {d7}, [r1], r2 - vld1.64 {d16}, [r1], r0 - vld1.64 {d17}, [r1], r2 - - vaddw.u8 q9, q0, d2 ; dest[x] + a1 - vaddw.u8 q10, q0, d3 ; dest[x] + a1 - vaddw.u8 q11, q0, d4 ; dest[x] + a1 - vaddw.u8 q12, q0, d5 ; dest[x] + a1 - vqmovun.s16 d2, q9 ; clip_pixel - vqmovun.s16 d3, q10 ; clip_pixel - vqmovun.s16 d30, q11 ; clip_pixel - vqmovun.s16 d31, q12 ; clip_pixel - vst1.64 {d2}, [r12], r0 - vst1.64 {d3}, [r12], r2 - vst1.64 {d30}, [r12], r0 - vst1.64 {d31}, [r12], r2 - - vaddw.u8 q9, q0, d6 ; dest[x] + a1 - vaddw.u8 q10, q0, d7 ; dest[x] + a1 - vaddw.u8 q11, q0, d16 ; dest[x] + a1 - vaddw.u8 q12, q0, d17 ; dest[x] + a1 - vqmovun.s16 d2, q9 ; clip_pixel - vqmovun.s16 d3, q10 ; clip_pixel - vqmovun.s16 d30, q11 ; clip_pixel - vqmovun.s16 d31, q12 ; clip_pixel - vst1.64 {d2}, [r12], r0 - vst1.64 {d3}, [r12], r2 - vst1.64 {d30}, [r12], r0 - vst1.64 {d31}, [r12], r2 - - ; load destination data row12 - row15 - vld1.64 {d2}, [r1], r0 - vld1.64 {d3}, [r1], r2 - vld1.64 {d4}, [r1], r0 - vld1.64 {d5}, [r1], r2 - vld1.64 {d6}, [r1], r0 - vld1.64 {d7}, [r1], r2 - vld1.64 {d16}, [r1], r0 - vld1.64 {d17}, [r1], r2 - - vaddw.u8 q9, q0, d2 ; dest[x] + a1 - vaddw.u8 q10, q0, d3 ; dest[x] + a1 - vaddw.u8 q11, q0, d4 ; dest[x] + a1 - vaddw.u8 q12, q0, d5 ; dest[x] + a1 - vqmovun.s16 d2, q9 ; clip_pixel - vqmovun.s16 d3, q10 ; clip_pixel - vqmovun.s16 d30, q11 ; clip_pixel - vqmovun.s16 d31, q12 ; clip_pixel - vst1.64 {d2}, [r12], r0 - vst1.64 {d3}, [r12], r2 - vst1.64 {d30}, [r12], r0 - vst1.64 {d31}, [r12], r2 - - vaddw.u8 q9, q0, d6 ; dest[x] + a1 - vaddw.u8 q10, q0, d7 ; dest[x] + a1 - vaddw.u8 q11, q0, d16 ; dest[x] + a1 - vaddw.u8 q12, q0, d17 ; dest[x] + a1 - vqmovun.s16 d2, q9 ; clip_pixel - vqmovun.s16 d3, q10 ; clip_pixel - vqmovun.s16 d30, q11 ; clip_pixel - vqmovun.s16 d31, q12 ; clip_pixel - vst1.64 {d2}, [r12], r0 - vst1.64 {d3}, [r12], r2 - vst1.64 {d30}, [r12], r0 - vst1.64 {d31}, [r12], r2 - - bx lr - ENDP ; |vp9_idct16x16_1_add_neon| - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct16x16_1_add_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct16x16_1_add_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct16x16_1_add_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct16x16_1_add_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "vp9/common/vp9_idct.h" - -void vp9_idct16x16_1_add_neon( - int16_t *input, - uint8_t *dest, - int dest_stride) { - uint8x8_t d2u8, d3u8, d30u8, d31u8; - uint64x1_t d2u64, d3u64, d4u64, d5u64; - uint16x8_t q0u16, q9u16, q10u16, q11u16, q12u16; - int16x8_t q0s16; - uint8_t *d1, *d2; - int16_t i, j, a1, cospi_16_64 = 11585; - int16_t out = dct_const_round_shift(input[0] * cospi_16_64); - out = dct_const_round_shift(out * cospi_16_64); - a1 = ROUND_POWER_OF_TWO(out, 6); - - q0s16 = vdupq_n_s16(a1); - q0u16 = vreinterpretq_u16_s16(q0s16); - - for (d1 = d2 = dest, i = 0; i < 4; i++) { - for (j = 0; j < 2; j++) { - d2u64 = vld1_u64((const uint64_t *)d1); - d3u64 = vld1_u64((const uint64_t *)(d1 + 8)); - d1 += dest_stride; - d4u64 = vld1_u64((const uint64_t *)d1); - d5u64 = vld1_u64((const uint64_t *)(d1 + 8)); - d1 += dest_stride; - - q9u16 = vaddw_u8(q0u16, vreinterpret_u8_u64(d2u64)); - q10u16 = vaddw_u8(q0u16, vreinterpret_u8_u64(d3u64)); - q11u16 = vaddw_u8(q0u16, vreinterpret_u8_u64(d4u64)); - q12u16 = vaddw_u8(q0u16, vreinterpret_u8_u64(d5u64)); - - d2u8 = vqmovun_s16(vreinterpretq_s16_u16(q9u16)); - d3u8 = vqmovun_s16(vreinterpretq_s16_u16(q10u16)); - d30u8 = vqmovun_s16(vreinterpretq_s16_u16(q11u16)); - d31u8 = vqmovun_s16(vreinterpretq_s16_u16(q12u16)); - - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d2u8)); - vst1_u64((uint64_t *)(d2 + 8), vreinterpret_u64_u8(d3u8)); - d2 += dest_stride; - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d30u8)); - vst1_u64((uint64_t *)(d2 + 8), vreinterpret_u64_u8(d31u8)); - d2 += dest_stride; - } - } - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct16x16_add_neon_asm.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct16x16_add_neon_asm.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct16x16_add_neon_asm.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct16x16_add_neon_asm.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,1179 +0,0 @@ -; -; Copyright (c) 2013 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - EXPORT |vp9_idct16x16_256_add_neon_pass1| - EXPORT |vp9_idct16x16_256_add_neon_pass2| - EXPORT |vp9_idct16x16_10_add_neon_pass1| - EXPORT |vp9_idct16x16_10_add_neon_pass2| - ARM - REQUIRE8 - PRESERVE8 - - AREA ||.text||, CODE, READONLY, ALIGN=2 - - ; Transpose a 8x8 16bit data matrix. Datas are loaded in q8-q15. - MACRO - TRANSPOSE8X8 - vswp d17, d24 - vswp d23, d30 - vswp d21, d28 - vswp d19, d26 - vtrn.32 q8, q10 - vtrn.32 q9, q11 - vtrn.32 q12, q14 - vtrn.32 q13, q15 - vtrn.16 q8, q9 - vtrn.16 q10, q11 - vtrn.16 q12, q13 - vtrn.16 q14, q15 - MEND - - AREA Block, CODE, READONLY ; name this block of code -;void |vp9_idct16x16_256_add_neon_pass1|(int16_t *input, -; int16_t *output, int output_stride) -; -; r0 int16_t input -; r1 int16_t *output -; r2 int output_stride) - -; idct16 stage1 - stage6 on all the elements loaded in q8-q15. The output -; will be stored back into q8-q15 registers. This function will touch q0-q7 -; registers and use them as buffer during calculation. -|vp9_idct16x16_256_add_neon_pass1| PROC - - ; TODO(hkuang): Find a better way to load the elements. - ; load elements of 0, 2, 4, 6, 8, 10, 12, 14 into q8 - q15 - vld2.s16 {q8,q9}, [r0]! - vld2.s16 {q9,q10}, [r0]! - vld2.s16 {q10,q11}, [r0]! - vld2.s16 {q11,q12}, [r0]! - vld2.s16 {q12,q13}, [r0]! - vld2.s16 {q13,q14}, [r0]! - vld2.s16 {q14,q15}, [r0]! - vld2.s16 {q1,q2}, [r0]! - vmov.s16 q15, q1 - - ; generate cospi_28_64 = 3196 - mov r3, #0xc00 - add r3, #0x7c - - ; generate cospi_4_64 = 16069 - mov r12, #0x3e00 - add r12, #0xc5 - - ; transpose the input data - TRANSPOSE8X8 - - ; stage 3 - vdup.16 d0, r3 ; duplicate cospi_28_64 - vdup.16 d1, r12 ; duplicate cospi_4_64 - - ; preloading to avoid stall - ; generate cospi_12_64 = 13623 - mov r3, #0x3500 - add r3, #0x37 - - ; generate cospi_20_64 = 9102 - mov r12, #0x2300 - add r12, #0x8e - - ; step2[4] * cospi_28_64 - vmull.s16 q2, d18, d0 - vmull.s16 q3, d19, d0 - - ; step2[4] * cospi_4_64 - vmull.s16 q5, d18, d1 - vmull.s16 q6, d19, d1 - - ; temp1 = step2[4] * cospi_28_64 - step2[7] * cospi_4_64 - vmlsl.s16 q2, d30, d1 - vmlsl.s16 q3, d31, d1 - - ; temp2 = step2[4] * cospi_4_64 + step2[7] * cospi_28_64 - vmlal.s16 q5, d30, d0 - vmlal.s16 q6, d31, d0 - - vdup.16 d2, r3 ; duplicate cospi_12_64 - vdup.16 d3, r12 ; duplicate cospi_20_64 - - ; dct_const_round_shift(temp1) - vqrshrn.s32 d8, q2, #14 ; >> 14 - vqrshrn.s32 d9, q3, #14 ; >> 14 - - ; dct_const_round_shift(temp2) - vqrshrn.s32 d14, q5, #14 ; >> 14 - vqrshrn.s32 d15, q6, #14 ; >> 14 - - ; preloading to avoid stall - ; generate cospi_16_64 = 11585 - mov r3, #0x2d00 - add r3, #0x41 - - ; generate cospi_24_64 = 6270 - mov r12, #0x1800 - add r12, #0x7e - - ; step2[5] * cospi_12_64 - vmull.s16 q2, d26, d2 - vmull.s16 q3, d27, d2 - - ; step2[5] * cospi_20_64 - vmull.s16 q9, d26, d3 - vmull.s16 q15, d27, d3 - - ; temp1 = input[5] * cospi_12_64 - input[3] * cospi_20_64 - vmlsl.s16 q2, d22, d3 - vmlsl.s16 q3, d23, d3 - - ; temp2 = step2[5] * cospi_20_64 + step2[6] * cospi_12_64 - vmlal.s16 q9, d22, d2 - vmlal.s16 q15, d23, d2 - - ; dct_const_round_shift(temp1) - vqrshrn.s32 d10, q2, #14 ; >> 14 - vqrshrn.s32 d11, q3, #14 ; >> 14 - - ; dct_const_round_shift(temp2) - vqrshrn.s32 d12, q9, #14 ; >> 14 - vqrshrn.s32 d13, q15, #14 ; >> 14 - - ; stage 4 - vdup.16 d30, r3 ; cospi_16_64 - - ; step1[0] * cospi_16_64 - vmull.s16 q2, d16, d30 - vmull.s16 q11, d17, d30 - - ; step1[1] * cospi_16_64 - vmull.s16 q0, d24, d30 - vmull.s16 q1, d25, d30 - - ; generate cospi_8_64 = 15137 - mov r3, #0x3b00 - add r3, #0x21 - - vdup.16 d30, r12 ; duplicate cospi_24_64 - vdup.16 d31, r3 ; duplicate cospi_8_64 - - ; temp1 = (step1[0] + step1[1]) * cospi_16_64 - vadd.s32 q3, q2, q0 - vadd.s32 q12, q11, q1 - - ; temp2 = (step1[0] - step1[1]) * cospi_16_64 - vsub.s32 q13, q2, q0 - vsub.s32 q1, q11, q1 - - ; dct_const_round_shift(temp1) - vqrshrn.s32 d16, q3, #14 ; >> 14 - vqrshrn.s32 d17, q12, #14 ; >> 14 - - ; dct_const_round_shift(temp2) - vqrshrn.s32 d18, q13, #14 ; >> 14 - vqrshrn.s32 d19, q1, #14 ; >> 14 - - ; step1[2] * cospi_24_64 - step1[3] * cospi_8_64; - ; step1[2] * cospi_8_64 - vmull.s16 q0, d20, d31 - vmull.s16 q1, d21, d31 - - ; step1[2] * cospi_24_64 - vmull.s16 q12, d20, d30 - vmull.s16 q13, d21, d30 - - ; temp2 = input[1] * cospi_8_64 + input[3] * cospi_24_64 - vmlal.s16 q0, d28, d30 - vmlal.s16 q1, d29, d30 - - ; temp1 = input[1] * cospi_24_64 - input[3] * cospi_8_64 - vmlsl.s16 q12, d28, d31 - vmlsl.s16 q13, d29, d31 - - ; dct_const_round_shift(temp2) - vqrshrn.s32 d22, q0, #14 ; >> 14 - vqrshrn.s32 d23, q1, #14 ; >> 14 - - ; dct_const_round_shift(temp1) - vqrshrn.s32 d20, q12, #14 ; >> 14 - vqrshrn.s32 d21, q13, #14 ; >> 14 - - vsub.s16 q13, q4, q5 ; step2[5] = step1[4] - step1[5]; - vadd.s16 q4, q4, q5 ; step2[4] = step1[4] + step1[5]; - vsub.s16 q14, q7, q6 ; step2[6] = -step1[6] + step1[7]; - vadd.s16 q15, q6, q7 ; step2[7] = step1[6] + step1[7]; - - ; generate cospi_16_64 = 11585 - mov r3, #0x2d00 - add r3, #0x41 - - ; stage 5 - vadd.s16 q0, q8, q11 ; step1[0] = step2[0] + step2[3]; - vadd.s16 q1, q9, q10 ; step1[1] = step2[1] + step2[2]; - vsub.s16 q2, q9, q10 ; step1[2] = step2[1] - step2[2]; - vsub.s16 q3, q8, q11 ; step1[3] = step2[0] - step2[3]; - - vdup.16 d16, r3; ; duplicate cospi_16_64 - - ; step2[5] * cospi_16_64 - vmull.s16 q11, d26, d16 - vmull.s16 q12, d27, d16 - - ; step2[6] * cospi_16_64 - vmull.s16 q9, d28, d16 - vmull.s16 q10, d29, d16 - - ; temp1 = (step2[6] - step2[5]) * cospi_16_64 - vsub.s32 q6, q9, q11 - vsub.s32 q13, q10, q12 - - ; temp2 = (step2[5] + step2[6]) * cospi_16_64 - vadd.s32 q9, q9, q11 - vadd.s32 q10, q10, q12 - - ; dct_const_round_shift(temp1) - vqrshrn.s32 d10, q6, #14 ; >> 14 - vqrshrn.s32 d11, q13, #14 ; >> 14 - - ; dct_const_round_shift(temp2) - vqrshrn.s32 d12, q9, #14 ; >> 14 - vqrshrn.s32 d13, q10, #14 ; >> 14 - - ; stage 6 - vadd.s16 q8, q0, q15 ; step2[0] = step1[0] + step1[7]; - vadd.s16 q9, q1, q6 ; step2[1] = step1[1] + step1[6]; - vadd.s16 q10, q2, q5 ; step2[2] = step1[2] + step1[5]; - vadd.s16 q11, q3, q4 ; step2[3] = step1[3] + step1[4]; - vsub.s16 q12, q3, q4 ; step2[4] = step1[3] - step1[4]; - vsub.s16 q13, q2, q5 ; step2[5] = step1[2] - step1[5]; - vsub.s16 q14, q1, q6 ; step2[6] = step1[1] - step1[6]; - vsub.s16 q15, q0, q15 ; step2[7] = step1[0] - step1[7]; - - ; store the data - vst1.64 {d16}, [r1], r2 - vst1.64 {d17}, [r1], r2 - vst1.64 {d18}, [r1], r2 - vst1.64 {d19}, [r1], r2 - vst1.64 {d20}, [r1], r2 - vst1.64 {d21}, [r1], r2 - vst1.64 {d22}, [r1], r2 - vst1.64 {d23}, [r1], r2 - vst1.64 {d24}, [r1], r2 - vst1.64 {d25}, [r1], r2 - vst1.64 {d26}, [r1], r2 - vst1.64 {d27}, [r1], r2 - vst1.64 {d28}, [r1], r2 - vst1.64 {d29}, [r1], r2 - vst1.64 {d30}, [r1], r2 - vst1.64 {d31}, [r1], r2 - - bx lr - ENDP ; |vp9_idct16x16_256_add_neon_pass1| - -;void vp9_idct16x16_256_add_neon_pass2(int16_t *src, -; int16_t *output, -; int16_t *pass1Output, -; int16_t skip_adding, -; uint8_t *dest, -; int dest_stride) -; -; r0 int16_t *src -; r1 int16_t *output, -; r2 int16_t *pass1Output, -; r3 int16_t skip_adding, -; r4 uint8_t *dest, -; r5 int dest_stride) - -; idct16 stage1 - stage7 on all the elements loaded in q8-q15. The output -; will be stored back into q8-q15 registers. This function will touch q0-q7 -; registers and use them as buffer during calculation. -|vp9_idct16x16_256_add_neon_pass2| PROC - push {r3-r9} - - ; TODO(hkuang): Find a better way to load the elements. - ; load elements of 1, 3, 5, 7, 9, 11, 13, 15 into q8 - q15 - vld2.s16 {q8,q9}, [r0]! - vld2.s16 {q9,q10}, [r0]! - vld2.s16 {q10,q11}, [r0]! - vld2.s16 {q11,q12}, [r0]! - vld2.s16 {q12,q13}, [r0]! - vld2.s16 {q13,q14}, [r0]! - vld2.s16 {q14,q15}, [r0]! - vld2.s16 {q0,q1}, [r0]! - vmov.s16 q15, q0; - - ; generate cospi_30_64 = 1606 - mov r3, #0x0600 - add r3, #0x46 - - ; generate cospi_2_64 = 16305 - mov r12, #0x3f00 - add r12, #0xb1 - - ; transpose the input data - TRANSPOSE8X8 - - ; stage 3 - vdup.16 d12, r3 ; duplicate cospi_30_64 - vdup.16 d13, r12 ; duplicate cospi_2_64 - - ; preloading to avoid stall - ; generate cospi_14_64 = 12665 - mov r3, #0x3100 - add r3, #0x79 - - ; generate cospi_18_64 = 10394 - mov r12, #0x2800 - add r12, #0x9a - - ; step1[8] * cospi_30_64 - vmull.s16 q2, d16, d12 - vmull.s16 q3, d17, d12 - - ; step1[8] * cospi_2_64 - vmull.s16 q1, d16, d13 - vmull.s16 q4, d17, d13 - - ; temp1 = step1[8] * cospi_30_64 - step1[15] * cospi_2_64 - vmlsl.s16 q2, d30, d13 - vmlsl.s16 q3, d31, d13 - - ; temp2 = step1[8] * cospi_2_64 + step1[15] * cospi_30_64 - vmlal.s16 q1, d30, d12 - vmlal.s16 q4, d31, d12 - - vdup.16 d30, r3 ; duplicate cospi_14_64 - vdup.16 d31, r12 ; duplicate cospi_18_64 - - ; dct_const_round_shift(temp1) - vqrshrn.s32 d0, q2, #14 ; >> 14 - vqrshrn.s32 d1, q3, #14 ; >> 14 - - ; dct_const_round_shift(temp2) - vqrshrn.s32 d14, q1, #14 ; >> 14 - vqrshrn.s32 d15, q4, #14 ; >> 14 - - ; preloading to avoid stall - ; generate cospi_22_64 = 7723 - mov r3, #0x1e00 - add r3, #0x2b - - ; generate cospi_10_64 = 14449 - mov r12, #0x3800 - add r12, #0x71 - - ; step1[9] * cospi_14_64 - vmull.s16 q2, d24, d30 - vmull.s16 q3, d25, d30 - - ; step1[9] * cospi_18_64 - vmull.s16 q4, d24, d31 - vmull.s16 q5, d25, d31 - - ; temp1 = step1[9] * cospi_14_64 - step1[14] * cospi_18_64 - vmlsl.s16 q2, d22, d31 - vmlsl.s16 q3, d23, d31 - - ; temp2 = step1[9] * cospi_18_64 + step1[14] * cospi_14_64 - vmlal.s16 q4, d22, d30 - vmlal.s16 q5, d23, d30 - - vdup.16 d30, r3 ; duplicate cospi_22_64 - vdup.16 d31, r12 ; duplicate cospi_10_64 - - ; dct_const_round_shift(temp1) - vqrshrn.s32 d2, q2, #14 ; >> 14 - vqrshrn.s32 d3, q3, #14 ; >> 14 - - ; dct_const_round_shift(temp2) - vqrshrn.s32 d12, q4, #14 ; >> 14 - vqrshrn.s32 d13, q5, #14 ; >> 14 - - ; step1[10] * cospi_22_64 - vmull.s16 q11, d20, d30 - vmull.s16 q12, d21, d30 - - ; step1[10] * cospi_10_64 - vmull.s16 q4, d20, d31 - vmull.s16 q5, d21, d31 - - ; temp1 = step1[10] * cospi_22_64 - step1[13] * cospi_10_64 - vmlsl.s16 q11, d26, d31 - vmlsl.s16 q12, d27, d31 - - ; temp2 = step1[10] * cospi_10_64 + step1[13] * cospi_22_64 - vmlal.s16 q4, d26, d30 - vmlal.s16 q5, d27, d30 - - ; preloading to avoid stall - ; generate cospi_6_64 = 15679 - mov r3, #0x3d00 - add r3, #0x3f - - ; generate cospi_26_64 = 4756 - mov r12, #0x1200 - add r12, #0x94 - - vdup.16 d30, r3 ; duplicate cospi_6_64 - vdup.16 d31, r12 ; duplicate cospi_26_64 - - ; dct_const_round_shift(temp1) - vqrshrn.s32 d4, q11, #14 ; >> 14 - vqrshrn.s32 d5, q12, #14 ; >> 14 - - ; dct_const_round_shift(temp2) - vqrshrn.s32 d11, q5, #14 ; >> 14 - vqrshrn.s32 d10, q4, #14 ; >> 14 - - ; step1[11] * cospi_6_64 - vmull.s16 q10, d28, d30 - vmull.s16 q11, d29, d30 - - ; step1[11] * cospi_26_64 - vmull.s16 q12, d28, d31 - vmull.s16 q13, d29, d31 - - ; temp1 = step1[11] * cospi_6_64 - step1[12] * cospi_26_64 - vmlsl.s16 q10, d18, d31 - vmlsl.s16 q11, d19, d31 - - ; temp2 = step1[11] * cospi_26_64 + step1[12] * cospi_6_64 - vmlal.s16 q12, d18, d30 - vmlal.s16 q13, d19, d30 - - vsub.s16 q9, q0, q1 ; step1[9]=step2[8]-step2[9] - vadd.s16 q0, q0, q1 ; step1[8]=step2[8]+step2[9] - - ; dct_const_round_shift(temp1) - vqrshrn.s32 d6, q10, #14 ; >> 14 - vqrshrn.s32 d7, q11, #14 ; >> 14 - - ; dct_const_round_shift(temp2) - vqrshrn.s32 d8, q12, #14 ; >> 14 - vqrshrn.s32 d9, q13, #14 ; >> 14 - - ; stage 3 - vsub.s16 q10, q3, q2 ; step1[10]=-step2[10]+step2[11] - vadd.s16 q11, q2, q3 ; step1[11]=step2[10]+step2[11] - vadd.s16 q12, q4, q5 ; step1[12]=step2[12]+step2[13] - vsub.s16 q13, q4, q5 ; step1[13]=step2[12]-step2[13] - vsub.s16 q14, q7, q6 ; step1[14]=-step2[14]+tep2[15] - vadd.s16 q7, q6, q7 ; step1[15]=step2[14]+step2[15] - - ; stage 4 - ; generate cospi_24_64 = 6270 - mov r3, #0x1800 - add r3, #0x7e - - ; generate cospi_8_64 = 15137 - mov r12, #0x3b00 - add r12, #0x21 - - ; -step1[9] * cospi_8_64 + step1[14] * cospi_24_64 - vdup.16 d30, r12 ; duplicate cospi_8_64 - vdup.16 d31, r3 ; duplicate cospi_24_64 - - ; step1[9] * cospi_24_64 - vmull.s16 q2, d18, d31 - vmull.s16 q3, d19, d31 - - ; step1[14] * cospi_24_64 - vmull.s16 q4, d28, d31 - vmull.s16 q5, d29, d31 - - ; temp2 = step1[9] * cospi_24_64 + step1[14] * cospi_8_64 - vmlal.s16 q2, d28, d30 - vmlal.s16 q3, d29, d30 - - ; temp1 = -step1[9] * cospi_8_64 + step1[14] * cospi_24_64 - vmlsl.s16 q4, d18, d30 - vmlsl.s16 q5, d19, d30 - - rsb r12, #0 - vdup.16 d30, r12 ; duplicate -cospi_8_64 - - ; dct_const_round_shift(temp2) - vqrshrn.s32 d12, q2, #14 ; >> 14 - vqrshrn.s32 d13, q3, #14 ; >> 14 - - ; dct_const_round_shift(temp1) - vqrshrn.s32 d2, q4, #14 ; >> 14 - vqrshrn.s32 d3, q5, #14 ; >> 14 - - vmov.s16 q3, q11 - vmov.s16 q4, q12 - - ; - step1[13] * cospi_8_64 - vmull.s16 q11, d26, d30 - vmull.s16 q12, d27, d30 - - ; -step1[10] * cospi_8_64 - vmull.s16 q8, d20, d30 - vmull.s16 q9, d21, d30 - - ; temp2 = -step1[10] * cospi_8_64 + step1[13] * cospi_24_64 - vmlsl.s16 q11, d20, d31 - vmlsl.s16 q12, d21, d31 - - ; temp1 = -step1[10] * cospi_8_64 + step1[13] * cospi_24_64 - vmlal.s16 q8, d26, d31 - vmlal.s16 q9, d27, d31 - - ; dct_const_round_shift(temp2) - vqrshrn.s32 d4, q11, #14 ; >> 14 - vqrshrn.s32 d5, q12, #14 ; >> 14 - - ; dct_const_round_shift(temp1) - vqrshrn.s32 d10, q8, #14 ; >> 14 - vqrshrn.s32 d11, q9, #14 ; >> 14 - - ; stage 5 - vadd.s16 q8, q0, q3 ; step1[8] = step2[8]+step2[11]; - vadd.s16 q9, q1, q2 ; step1[9] = step2[9]+step2[10]; - vsub.s16 q10, q1, q2 ; step1[10] = step2[9]-step2[10]; - vsub.s16 q11, q0, q3 ; step1[11] = step2[8]-step2[11]; - vsub.s16 q12, q7, q4 ; step1[12] =-step2[12]+step2[15]; - vsub.s16 q13, q6, q5 ; step1[13] =-step2[13]+step2[14]; - vadd.s16 q14, q6, q5 ; step1[14] =step2[13]+step2[14]; - vadd.s16 q15, q7, q4 ; step1[15] =step2[12]+step2[15]; - - ; stage 6. - ; generate cospi_16_64 = 11585 - mov r12, #0x2d00 - add r12, #0x41 - - vdup.16 d14, r12 ; duplicate cospi_16_64 - - ; step1[13] * cospi_16_64 - vmull.s16 q3, d26, d14 - vmull.s16 q4, d27, d14 - - ; step1[10] * cospi_16_64 - vmull.s16 q0, d20, d14 - vmull.s16 q1, d21, d14 - - ; temp1 = (-step1[10] + step1[13]) * cospi_16_64 - vsub.s32 q5, q3, q0 - vsub.s32 q6, q4, q1 - - ; temp2 = (step1[10] + step1[13]) * cospi_16_64 - vadd.s32 q10, q3, q0 - vadd.s32 q4, q4, q1 - - ; dct_const_round_shift(temp1) - vqrshrn.s32 d4, q5, #14 ; >> 14 - vqrshrn.s32 d5, q6, #14 ; >> 14 - - ; dct_const_round_shift(temp2) - vqrshrn.s32 d10, q10, #14 ; >> 14 - vqrshrn.s32 d11, q4, #14 ; >> 14 - - ; step1[11] * cospi_16_64 - vmull.s16 q0, d22, d14 - vmull.s16 q1, d23, d14 - - ; step1[12] * cospi_16_64 - vmull.s16 q13, d24, d14 - vmull.s16 q6, d25, d14 - - ; temp1 = (-step1[11] + step1[12]) * cospi_16_64 - vsub.s32 q10, q13, q0 - vsub.s32 q4, q6, q1 - - ; temp2 = (step1[11] + step1[12]) * cospi_16_64 - vadd.s32 q13, q13, q0 - vadd.s32 q6, q6, q1 - - ; dct_const_round_shift(temp1) - vqrshrn.s32 d6, q10, #14 ; >> 14 - vqrshrn.s32 d7, q4, #14 ; >> 14 - - ; dct_const_round_shift(temp2) - vqrshrn.s32 d8, q13, #14 ; >> 14 - vqrshrn.s32 d9, q6, #14 ; >> 14 - - mov r4, #16 ; pass1Output stride - ldr r3, [sp] ; load skip_adding - cmp r3, #0 ; check if need adding dest data - beq skip_adding_dest - - ldr r7, [sp, #28] ; dest used to save element 0-7 - mov r9, r7 ; save dest pointer for later use - ldr r8, [sp, #32] ; load dest_stride - - ; stage 7 - ; load the data in pass1 - vld1.s16 {q0}, [r2], r4 ; load data step2[0] - vld1.s16 {q1}, [r2], r4 ; load data step2[1] - vld1.s16 {q10}, [r2], r4 ; load data step2[2] - vld1.s16 {q11}, [r2], r4 ; load data step2[3] - vld1.64 {d12}, [r7], r8 ; load destinatoin data - vld1.64 {d13}, [r7], r8 ; load destinatoin data - vadd.s16 q12, q0, q15 ; step2[0] + step2[15] - vadd.s16 q13, q1, q14 ; step2[1] + step2[14] - vrshr.s16 q12, q12, #6 ; ROUND_POWER_OF_TWO - vrshr.s16 q13, q13, #6 ; ROUND_POWER_OF_TWO - vaddw.u8 q12, q12, d12 ; + dest[j * dest_stride + i] - vaddw.u8 q13, q13, d13 ; + dest[j * dest_stride + i] - vqmovun.s16 d12, q12 ; clip pixel - vqmovun.s16 d13, q13 ; clip pixel - vst1.64 {d12}, [r9], r8 ; store the data - vst1.64 {d13}, [r9], r8 ; store the data - vsub.s16 q14, q1, q14 ; step2[1] - step2[14] - vsub.s16 q15, q0, q15 ; step2[0] - step2[15] - vld1.64 {d12}, [r7], r8 ; load destinatoin data - vld1.64 {d13}, [r7], r8 ; load destinatoin data - vadd.s16 q12, q10, q5 ; step2[2] + step2[13] - vadd.s16 q13, q11, q4 ; step2[3] + step2[12] - vrshr.s16 q12, q12, #6 ; ROUND_POWER_OF_TWO - vrshr.s16 q13, q13, #6 ; ROUND_POWER_OF_TWO - vaddw.u8 q12, q12, d12 ; + dest[j * dest_stride + i] - vaddw.u8 q13, q13, d13 ; + dest[j * dest_stride + i] - vqmovun.s16 d12, q12 ; clip pixel - vqmovun.s16 d13, q13 ; clip pixel - vst1.64 {d12}, [r9], r8 ; store the data - vst1.64 {d13}, [r9], r8 ; store the data - vsub.s16 q4, q11, q4 ; step2[3] - step2[12] - vsub.s16 q5, q10, q5 ; step2[2] - step2[13] - vld1.s16 {q0}, [r2], r4 ; load data step2[4] - vld1.s16 {q1}, [r2], r4 ; load data step2[5] - vld1.s16 {q10}, [r2], r4 ; load data step2[6] - vld1.s16 {q11}, [r2], r4 ; load data step2[7] - vld1.64 {d12}, [r7], r8 ; load destinatoin data - vld1.64 {d13}, [r7], r8 ; load destinatoin data - vadd.s16 q12, q0, q3 ; step2[4] + step2[11] - vadd.s16 q13, q1, q2 ; step2[5] + step2[10] - vrshr.s16 q12, q12, #6 ; ROUND_POWER_OF_TWO - vrshr.s16 q13, q13, #6 ; ROUND_POWER_OF_TWO - vaddw.u8 q12, q12, d12 ; + dest[j * dest_stride + i] - vaddw.u8 q13, q13, d13 ; + dest[j * dest_stride + i] - vqmovun.s16 d12, q12 ; clip pixel - vqmovun.s16 d13, q13 ; clip pixel - vst1.64 {d12}, [r9], r8 ; store the data - vst1.64 {d13}, [r9], r8 ; store the data - vsub.s16 q2, q1, q2 ; step2[5] - step2[10] - vsub.s16 q3, q0, q3 ; step2[4] - step2[11] - vld1.64 {d12}, [r7], r8 ; load destinatoin data - vld1.64 {d13}, [r7], r8 ; load destinatoin data - vadd.s16 q12, q10, q9 ; step2[6] + step2[9] - vadd.s16 q13, q11, q8 ; step2[7] + step2[8] - vrshr.s16 q12, q12, #6 ; ROUND_POWER_OF_TWO - vrshr.s16 q13, q13, #6 ; ROUND_POWER_OF_TWO - vaddw.u8 q12, q12, d12 ; + dest[j * dest_stride + i] - vaddw.u8 q13, q13, d13 ; + dest[j * dest_stride + i] - vqmovun.s16 d12, q12 ; clip pixel - vqmovun.s16 d13, q13 ; clip pixel - vst1.64 {d12}, [r9], r8 ; store the data - vst1.64 {d13}, [r9], r8 ; store the data - vld1.64 {d12}, [r7], r8 ; load destinatoin data - vld1.64 {d13}, [r7], r8 ; load destinatoin data - vsub.s16 q8, q11, q8 ; step2[7] - step2[8] - vsub.s16 q9, q10, q9 ; step2[6] - step2[9] - - ; store the data output 8,9,10,11,12,13,14,15 - vrshr.s16 q8, q8, #6 ; ROUND_POWER_OF_TWO - vaddw.u8 q8, q8, d12 ; + dest[j * dest_stride + i] - vqmovun.s16 d12, q8 ; clip pixel - vst1.64 {d12}, [r9], r8 ; store the data - vld1.64 {d12}, [r7], r8 ; load destinatoin data - vrshr.s16 q9, q9, #6 - vaddw.u8 q9, q9, d13 ; + dest[j * dest_stride + i] - vqmovun.s16 d13, q9 ; clip pixel - vst1.64 {d13}, [r9], r8 ; store the data - vld1.64 {d13}, [r7], r8 ; load destinatoin data - vrshr.s16 q2, q2, #6 - vaddw.u8 q2, q2, d12 ; + dest[j * dest_stride + i] - vqmovun.s16 d12, q2 ; clip pixel - vst1.64 {d12}, [r9], r8 ; store the data - vld1.64 {d12}, [r7], r8 ; load destinatoin data - vrshr.s16 q3, q3, #6 - vaddw.u8 q3, q3, d13 ; + dest[j * dest_stride + i] - vqmovun.s16 d13, q3 ; clip pixel - vst1.64 {d13}, [r9], r8 ; store the data - vld1.64 {d13}, [r7], r8 ; load destinatoin data - vrshr.s16 q4, q4, #6 - vaddw.u8 q4, q4, d12 ; + dest[j * dest_stride + i] - vqmovun.s16 d12, q4 ; clip pixel - vst1.64 {d12}, [r9], r8 ; store the data - vld1.64 {d12}, [r7], r8 ; load destinatoin data - vrshr.s16 q5, q5, #6 - vaddw.u8 q5, q5, d13 ; + dest[j * dest_stride + i] - vqmovun.s16 d13, q5 ; clip pixel - vst1.64 {d13}, [r9], r8 ; store the data - vld1.64 {d13}, [r7], r8 ; load destinatoin data - vrshr.s16 q14, q14, #6 - vaddw.u8 q14, q14, d12 ; + dest[j * dest_stride + i] - vqmovun.s16 d12, q14 ; clip pixel - vst1.64 {d12}, [r9], r8 ; store the data - vld1.64 {d12}, [r7], r8 ; load destinatoin data - vrshr.s16 q15, q15, #6 - vaddw.u8 q15, q15, d13 ; + dest[j * dest_stride + i] - vqmovun.s16 d13, q15 ; clip pixel - vst1.64 {d13}, [r9], r8 ; store the data - b end_idct16x16_pass2 - -skip_adding_dest - ; stage 7 - ; load the data in pass1 - mov r5, #24 - mov r3, #8 - - vld1.s16 {q0}, [r2], r4 ; load data step2[0] - vld1.s16 {q1}, [r2], r4 ; load data step2[1] - vadd.s16 q12, q0, q15 ; step2[0] + step2[15] - vadd.s16 q13, q1, q14 ; step2[1] + step2[14] - vld1.s16 {q10}, [r2], r4 ; load data step2[2] - vld1.s16 {q11}, [r2], r4 ; load data step2[3] - vst1.64 {d24}, [r1], r3 ; store output[0] - vst1.64 {d25}, [r1], r5 - vst1.64 {d26}, [r1], r3 ; store output[1] - vst1.64 {d27}, [r1], r5 - vadd.s16 q12, q10, q5 ; step2[2] + step2[13] - vadd.s16 q13, q11, q4 ; step2[3] + step2[12] - vsub.s16 q14, q1, q14 ; step2[1] - step2[14] - vsub.s16 q15, q0, q15 ; step2[0] - step2[15] - vst1.64 {d24}, [r1], r3 ; store output[2] - vst1.64 {d25}, [r1], r5 - vst1.64 {d26}, [r1], r3 ; store output[3] - vst1.64 {d27}, [r1], r5 - vsub.s16 q4, q11, q4 ; step2[3] - step2[12] - vsub.s16 q5, q10, q5 ; step2[2] - step2[13] - vld1.s16 {q0}, [r2], r4 ; load data step2[4] - vld1.s16 {q1}, [r2], r4 ; load data step2[5] - vadd.s16 q12, q0, q3 ; step2[4] + step2[11] - vadd.s16 q13, q1, q2 ; step2[5] + step2[10] - vld1.s16 {q10}, [r2], r4 ; load data step2[6] - vld1.s16 {q11}, [r2], r4 ; load data step2[7] - vst1.64 {d24}, [r1], r3 ; store output[4] - vst1.64 {d25}, [r1], r5 - vst1.64 {d26}, [r1], r3 ; store output[5] - vst1.64 {d27}, [r1], r5 - vadd.s16 q12, q10, q9 ; step2[6] + step2[9] - vadd.s16 q13, q11, q8 ; step2[7] + step2[8] - vsub.s16 q2, q1, q2 ; step2[5] - step2[10] - vsub.s16 q3, q0, q3 ; step2[4] - step2[11] - vsub.s16 q8, q11, q8 ; step2[7] - step2[8] - vsub.s16 q9, q10, q9 ; step2[6] - step2[9] - vst1.64 {d24}, [r1], r3 ; store output[6] - vst1.64 {d25}, [r1], r5 - vst1.64 {d26}, [r1], r3 ; store output[7] - vst1.64 {d27}, [r1], r5 - - ; store the data output 8,9,10,11,12,13,14,15 - vst1.64 {d16}, [r1], r3 - vst1.64 {d17}, [r1], r5 - vst1.64 {d18}, [r1], r3 - vst1.64 {d19}, [r1], r5 - vst1.64 {d4}, [r1], r3 - vst1.64 {d5}, [r1], r5 - vst1.64 {d6}, [r1], r3 - vst1.64 {d7}, [r1], r5 - vst1.64 {d8}, [r1], r3 - vst1.64 {d9}, [r1], r5 - vst1.64 {d10}, [r1], r3 - vst1.64 {d11}, [r1], r5 - vst1.64 {d28}, [r1], r3 - vst1.64 {d29}, [r1], r5 - vst1.64 {d30}, [r1], r3 - vst1.64 {d31}, [r1], r5 -end_idct16x16_pass2 - pop {r3-r9} - bx lr - ENDP ; |vp9_idct16x16_256_add_neon_pass2| - -;void |vp9_idct16x16_10_add_neon_pass1|(int16_t *input, -; int16_t *output, int output_stride) -; -; r0 int16_t input -; r1 int16_t *output -; r2 int output_stride) - -; idct16 stage1 - stage6 on all the elements loaded in q8-q15. The output -; will be stored back into q8-q15 registers. This function will touch q0-q7 -; registers and use them as buffer during calculation. -|vp9_idct16x16_10_add_neon_pass1| PROC - - ; TODO(hkuang): Find a better way to load the elements. - ; load elements of 0, 2, 4, 6, 8, 10, 12, 14 into q8 - q15 - vld2.s16 {q8,q9}, [r0]! - vld2.s16 {q9,q10}, [r0]! - vld2.s16 {q10,q11}, [r0]! - vld2.s16 {q11,q12}, [r0]! - vld2.s16 {q12,q13}, [r0]! - vld2.s16 {q13,q14}, [r0]! - vld2.s16 {q14,q15}, [r0]! - vld2.s16 {q1,q2}, [r0]! - vmov.s16 q15, q1 - - ; generate cospi_28_64*2 = 6392 - mov r3, #0x1800 - add r3, #0xf8 - - ; generate cospi_4_64*2 = 32138 - mov r12, #0x7d00 - add r12, #0x8a - - ; transpose the input data - TRANSPOSE8X8 - - ; stage 3 - vdup.16 q0, r3 ; duplicate cospi_28_64*2 - vdup.16 q1, r12 ; duplicate cospi_4_64*2 - - ; The following instructions use vqrdmulh to do the - ; dct_const_round_shift(step2[4] * cospi_28_64). vvqrdmulh will multiply, - ; double, and return the high 16 bits, effectively giving >> 15. Doubling - ; the constant will change this to >> 14. - ; dct_const_round_shift(step2[4] * cospi_28_64); - vqrdmulh.s16 q4, q9, q0 - - ; preloading to avoid stall - ; generate cospi_16_64*2 = 23170 - mov r3, #0x5a00 - add r3, #0x82 - - ; dct_const_round_shift(step2[4] * cospi_4_64); - vqrdmulh.s16 q7, q9, q1 - - ; stage 4 - vdup.16 q1, r3 ; cospi_16_64*2 - - ; generate cospi_16_64 = 11585 - mov r3, #0x2d00 - add r3, #0x41 - - vdup.16 d4, r3; ; duplicate cospi_16_64 - - ; dct_const_round_shift(step1[0] * cospi_16_64) - vqrdmulh.s16 q8, q8, q1 - - ; step2[6] * cospi_16_64 - vmull.s16 q9, d14, d4 - vmull.s16 q10, d15, d4 - - ; step2[5] * cospi_16_64 - vmull.s16 q12, d9, d4 - vmull.s16 q11, d8, d4 - - ; temp1 = (step2[6] - step2[5]) * cospi_16_64 - vsub.s32 q15, q10, q12 - vsub.s32 q6, q9, q11 - - ; temp2 = (step2[5] + step2[6]) * cospi_16_64 - vadd.s32 q9, q9, q11 - vadd.s32 q10, q10, q12 - - ; dct_const_round_shift(temp1) - vqrshrn.s32 d11, q15, #14 ; >> 14 - vqrshrn.s32 d10, q6, #14 ; >> 14 - - ; dct_const_round_shift(temp2) - vqrshrn.s32 d12, q9, #14 ; >> 14 - vqrshrn.s32 d13, q10, #14 ; >> 14 - - ; stage 6 - vadd.s16 q2, q8, q7 ; step2[0] = step1[0] + step1[7]; - vadd.s16 q10, q8, q5 ; step2[2] = step1[2] + step1[5]; - vadd.s16 q11, q8, q4 ; step2[3] = step1[3] + step1[4]; - vadd.s16 q9, q8, q6 ; step2[1] = step1[1] + step1[6]; - vsub.s16 q12, q8, q4 ; step2[4] = step1[3] - step1[4]; - vsub.s16 q13, q8, q5 ; step2[5] = step1[2] - step1[5]; - vsub.s16 q14, q8, q6 ; step2[6] = step1[1] - step1[6]; - vsub.s16 q15, q8, q7 ; step2[7] = step1[0] - step1[7]; - - ; store the data - vst1.64 {d4}, [r1], r2 - vst1.64 {d5}, [r1], r2 - vst1.64 {d18}, [r1], r2 - vst1.64 {d19}, [r1], r2 - vst1.64 {d20}, [r1], r2 - vst1.64 {d21}, [r1], r2 - vst1.64 {d22}, [r1], r2 - vst1.64 {d23}, [r1], r2 - vst1.64 {d24}, [r1], r2 - vst1.64 {d25}, [r1], r2 - vst1.64 {d26}, [r1], r2 - vst1.64 {d27}, [r1], r2 - vst1.64 {d28}, [r1], r2 - vst1.64 {d29}, [r1], r2 - vst1.64 {d30}, [r1], r2 - vst1.64 {d31}, [r1], r2 - - bx lr - ENDP ; |vp9_idct16x16_10_add_neon_pass1| - -;void vp9_idct16x16_10_add_neon_pass2(int16_t *src, -; int16_t *output, -; int16_t *pass1Output, -; int16_t skip_adding, -; uint8_t *dest, -; int dest_stride) -; -; r0 int16_t *src -; r1 int16_t *output, -; r2 int16_t *pass1Output, -; r3 int16_t skip_adding, -; r4 uint8_t *dest, -; r5 int dest_stride) - -; idct16 stage1 - stage7 on all the elements loaded in q8-q15. The output -; will be stored back into q8-q15 registers. This function will touch q0-q7 -; registers and use them as buffer during calculation. -|vp9_idct16x16_10_add_neon_pass2| PROC - push {r3-r9} - - ; TODO(hkuang): Find a better way to load the elements. - ; load elements of 1, 3, 5, 7, 9, 11, 13, 15 into q8 - q15 - vld2.s16 {q8,q9}, [r0]! - vld2.s16 {q9,q10}, [r0]! - vld2.s16 {q10,q11}, [r0]! - vld2.s16 {q11,q12}, [r0]! - vld2.s16 {q12,q13}, [r0]! - vld2.s16 {q13,q14}, [r0]! - vld2.s16 {q14,q15}, [r0]! - vld2.s16 {q0,q1}, [r0]! - vmov.s16 q15, q0; - - ; generate 2*cospi_30_64 = 3212 - mov r3, #0xc00 - add r3, #0x8c - - ; generate 2*cospi_2_64 = 32610 - mov r12, #0x7f00 - add r12, #0x62 - - ; transpose the input data - TRANSPOSE8X8 - - ; stage 3 - vdup.16 q6, r3 ; duplicate 2*cospi_30_64 - - ; dct_const_round_shift(step1[8] * cospi_30_64) - vqrdmulh.s16 q0, q8, q6 - - vdup.16 q6, r12 ; duplicate 2*cospi_2_64 - - ; dct_const_round_shift(step1[8] * cospi_2_64) - vqrdmulh.s16 q7, q8, q6 - - ; preloading to avoid stall - ; generate 2*cospi_26_64 = 9512 - mov r12, #0x2500 - add r12, #0x28 - rsb r12, #0 - vdup.16 q15, r12 ; duplicate -2*cospi_26_64 - - ; generate 2*cospi_6_64 = 31358 - mov r3, #0x7a00 - add r3, #0x7e - vdup.16 q14, r3 ; duplicate 2*cospi_6_64 - - ; dct_const_round_shift(- step1[12] * cospi_26_64) - vqrdmulh.s16 q3, q9, q15 - - ; dct_const_round_shift(step1[12] * cospi_6_64) - vqrdmulh.s16 q4, q9, q14 - - ; stage 4 - ; generate cospi_24_64 = 6270 - mov r3, #0x1800 - add r3, #0x7e - vdup.16 d31, r3 ; duplicate cospi_24_64 - - ; generate cospi_8_64 = 15137 - mov r12, #0x3b00 - add r12, #0x21 - vdup.16 d30, r12 ; duplicate cospi_8_64 - - ; step1[14] * cospi_24_64 - vmull.s16 q12, d14, d31 - vmull.s16 q5, d15, d31 - - ; step1[9] * cospi_24_64 - vmull.s16 q2, d0, d31 - vmull.s16 q11, d1, d31 - - ; temp1 = -step1[9] * cospi_8_64 + step1[14] * cospi_24_64 - vmlsl.s16 q12, d0, d30 - vmlsl.s16 q5, d1, d30 - - ; temp2 = step1[9] * cospi_24_64 + step1[14] * cospi_8_64 - vmlal.s16 q2, d14, d30 - vmlal.s16 q11, d15, d30 - - rsb r12, #0 - vdup.16 d30, r12 ; duplicate -cospi_8_64 - - ; dct_const_round_shift(temp1) - vqrshrn.s32 d2, q12, #14 ; >> 14 - vqrshrn.s32 d3, q5, #14 ; >> 14 - - ; dct_const_round_shift(temp2) - vqrshrn.s32 d12, q2, #14 ; >> 14 - vqrshrn.s32 d13, q11, #14 ; >> 14 - - ; - step1[13] * cospi_8_64 - vmull.s16 q10, d8, d30 - vmull.s16 q13, d9, d30 - - ; -step1[10] * cospi_8_64 - vmull.s16 q8, d6, d30 - vmull.s16 q9, d7, d30 - - ; temp1 = -step1[10] * cospi_24_64 - step1[13] * cospi_8_64 - vmlsl.s16 q10, d6, d31 - vmlsl.s16 q13, d7, d31 - - ; temp2 = -step1[10] * cospi_8_64 + step1[13] * cospi_24_64 - vmlal.s16 q8, d8, d31 - vmlal.s16 q9, d9, d31 - - ; dct_const_round_shift(temp1) - vqrshrn.s32 d4, q10, #14 ; >> 14 - vqrshrn.s32 d5, q13, #14 ; >> 14 - - ; dct_const_round_shift(temp2) - vqrshrn.s32 d10, q8, #14 ; >> 14 - vqrshrn.s32 d11, q9, #14 ; >> 14 - - ; stage 5 - vadd.s16 q8, q0, q3 ; step1[8] = step2[8]+step2[11]; - vadd.s16 q9, q1, q2 ; step1[9] = step2[9]+step2[10]; - vsub.s16 q10, q1, q2 ; step1[10] = step2[9]-step2[10]; - vsub.s16 q11, q0, q3 ; step1[11] = step2[8]-step2[11]; - vsub.s16 q12, q7, q4 ; step1[12] =-step2[12]+step2[15]; - vsub.s16 q13, q6, q5 ; step1[13] =-step2[13]+step2[14]; - vadd.s16 q14, q6, q5 ; step1[14] =step2[13]+step2[14]; - vadd.s16 q15, q7, q4 ; step1[15] =step2[12]+step2[15]; - - ; stage 6. - ; generate cospi_16_64 = 11585 - mov r12, #0x2d00 - add r12, #0x41 - - vdup.16 d14, r12 ; duplicate cospi_16_64 - - ; step1[13] * cospi_16_64 - vmull.s16 q3, d26, d14 - vmull.s16 q4, d27, d14 - - ; step1[10] * cospi_16_64 - vmull.s16 q0, d20, d14 - vmull.s16 q1, d21, d14 - - ; temp1 = (-step1[10] + step1[13]) * cospi_16_64 - vsub.s32 q5, q3, q0 - vsub.s32 q6, q4, q1 - - ; temp2 = (step1[10] + step1[13]) * cospi_16_64 - vadd.s32 q0, q3, q0 - vadd.s32 q1, q4, q1 - - ; dct_const_round_shift(temp1) - vqrshrn.s32 d4, q5, #14 ; >> 14 - vqrshrn.s32 d5, q6, #14 ; >> 14 - - ; dct_const_round_shift(temp2) - vqrshrn.s32 d10, q0, #14 ; >> 14 - vqrshrn.s32 d11, q1, #14 ; >> 14 - - ; step1[11] * cospi_16_64 - vmull.s16 q0, d22, d14 - vmull.s16 q1, d23, d14 - - ; step1[12] * cospi_16_64 - vmull.s16 q13, d24, d14 - vmull.s16 q6, d25, d14 - - ; temp1 = (-step1[11] + step1[12]) * cospi_16_64 - vsub.s32 q10, q13, q0 - vsub.s32 q4, q6, q1 - - ; temp2 = (step1[11] + step1[12]) * cospi_16_64 - vadd.s32 q13, q13, q0 - vadd.s32 q6, q6, q1 - - ; dct_const_round_shift(input_dc * cospi_16_64) - vqrshrn.s32 d6, q10, #14 ; >> 14 - vqrshrn.s32 d7, q4, #14 ; >> 14 - - ; dct_const_round_shift((step1[11] + step1[12]) * cospi_16_64); - vqrshrn.s32 d8, q13, #14 ; >> 14 - vqrshrn.s32 d9, q6, #14 ; >> 14 - - mov r4, #16 ; pass1Output stride - ldr r3, [sp] ; load skip_adding - - ; stage 7 - ; load the data in pass1 - mov r5, #24 - mov r3, #8 - - vld1.s16 {q0}, [r2], r4 ; load data step2[0] - vld1.s16 {q1}, [r2], r4 ; load data step2[1] - vadd.s16 q12, q0, q15 ; step2[0] + step2[15] - vadd.s16 q13, q1, q14 ; step2[1] + step2[14] - vld1.s16 {q10}, [r2], r4 ; load data step2[2] - vld1.s16 {q11}, [r2], r4 ; load data step2[3] - vst1.64 {d24}, [r1], r3 ; store output[0] - vst1.64 {d25}, [r1], r5 - vst1.64 {d26}, [r1], r3 ; store output[1] - vst1.64 {d27}, [r1], r5 - vadd.s16 q12, q10, q5 ; step2[2] + step2[13] - vadd.s16 q13, q11, q4 ; step2[3] + step2[12] - vsub.s16 q14, q1, q14 ; step2[1] - step2[14] - vsub.s16 q15, q0, q15 ; step2[0] - step2[15] - vst1.64 {d24}, [r1], r3 ; store output[2] - vst1.64 {d25}, [r1], r5 - vst1.64 {d26}, [r1], r3 ; store output[3] - vst1.64 {d27}, [r1], r5 - vsub.s16 q4, q11, q4 ; step2[3] - step2[12] - vsub.s16 q5, q10, q5 ; step2[2] - step2[13] - vld1.s16 {q0}, [r2], r4 ; load data step2[4] - vld1.s16 {q1}, [r2], r4 ; load data step2[5] - vadd.s16 q12, q0, q3 ; step2[4] + step2[11] - vadd.s16 q13, q1, q2 ; step2[5] + step2[10] - vld1.s16 {q10}, [r2], r4 ; load data step2[6] - vld1.s16 {q11}, [r2], r4 ; load data step2[7] - vst1.64 {d24}, [r1], r3 ; store output[4] - vst1.64 {d25}, [r1], r5 - vst1.64 {d26}, [r1], r3 ; store output[5] - vst1.64 {d27}, [r1], r5 - vadd.s16 q12, q10, q9 ; step2[6] + step2[9] - vadd.s16 q13, q11, q8 ; step2[7] + step2[8] - vsub.s16 q2, q1, q2 ; step2[5] - step2[10] - vsub.s16 q3, q0, q3 ; step2[4] - step2[11] - vsub.s16 q8, q11, q8 ; step2[7] - step2[8] - vsub.s16 q9, q10, q9 ; step2[6] - step2[9] - vst1.64 {d24}, [r1], r3 ; store output[6] - vst1.64 {d25}, [r1], r5 - vst1.64 {d26}, [r1], r3 ; store output[7] - vst1.64 {d27}, [r1], r5 - - ; store the data output 8,9,10,11,12,13,14,15 - vst1.64 {d16}, [r1], r3 - vst1.64 {d17}, [r1], r5 - vst1.64 {d18}, [r1], r3 - vst1.64 {d19}, [r1], r5 - vst1.64 {d4}, [r1], r3 - vst1.64 {d5}, [r1], r5 - vst1.64 {d6}, [r1], r3 - vst1.64 {d7}, [r1], r5 - vst1.64 {d8}, [r1], r3 - vst1.64 {d9}, [r1], r5 - vst1.64 {d10}, [r1], r3 - vst1.64 {d11}, [r1], r5 - vst1.64 {d28}, [r1], r3 - vst1.64 {d29}, [r1], r5 - vst1.64 {d30}, [r1], r3 - vst1.64 {d31}, [r1], r5 -end_idct10_16x16_pass2 - pop {r3-r9} - bx lr - ENDP ; |vp9_idct16x16_10_add_neon_pass2| - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct16x16_add_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct16x16_add_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct16x16_add_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct16x16_add_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1332 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "./vpx_config.h" - -static int16_t cospi_2_64 = 16305; -static int16_t cospi_4_64 = 16069; -static int16_t cospi_6_64 = 15679; -static int16_t cospi_8_64 = 15137; -static int16_t cospi_10_64 = 14449; -static int16_t cospi_12_64 = 13623; -static int16_t cospi_14_64 = 12665; -static int16_t cospi_16_64 = 11585; -static int16_t cospi_18_64 = 10394; -static int16_t cospi_20_64 = 9102; -static int16_t cospi_22_64 = 7723; -static int16_t cospi_24_64 = 6270; -static int16_t cospi_26_64 = 4756; -static int16_t cospi_28_64 = 3196; -static int16_t cospi_30_64 = 1606; - -static INLINE void TRANSPOSE8X8( - int16x8_t *q8s16, - int16x8_t *q9s16, - int16x8_t *q10s16, - int16x8_t *q11s16, - int16x8_t *q12s16, - int16x8_t *q13s16, - int16x8_t *q14s16, - int16x8_t *q15s16) { - int16x4_t d16s16, d17s16, d18s16, d19s16, d20s16, d21s16, d22s16, d23s16; - int16x4_t d24s16, d25s16, d26s16, d27s16, d28s16, d29s16, d30s16, d31s16; - int32x4x2_t q0x2s32, q1x2s32, q2x2s32, q3x2s32; - int16x8x2_t q0x2s16, q1x2s16, q2x2s16, q3x2s16; - - d16s16 = vget_low_s16(*q8s16); - d17s16 = vget_high_s16(*q8s16); - d18s16 = vget_low_s16(*q9s16); - d19s16 = vget_high_s16(*q9s16); - d20s16 = vget_low_s16(*q10s16); - d21s16 = vget_high_s16(*q10s16); - d22s16 = vget_low_s16(*q11s16); - d23s16 = vget_high_s16(*q11s16); - d24s16 = vget_low_s16(*q12s16); - d25s16 = vget_high_s16(*q12s16); - d26s16 = vget_low_s16(*q13s16); - d27s16 = vget_high_s16(*q13s16); - d28s16 = vget_low_s16(*q14s16); - d29s16 = vget_high_s16(*q14s16); - d30s16 = vget_low_s16(*q15s16); - d31s16 = vget_high_s16(*q15s16); - - *q8s16 = vcombine_s16(d16s16, d24s16); // vswp d17, d24 - *q9s16 = vcombine_s16(d18s16, d26s16); // vswp d19, d26 - *q10s16 = vcombine_s16(d20s16, d28s16); // vswp d21, d28 - *q11s16 = vcombine_s16(d22s16, d30s16); // vswp d23, d30 - *q12s16 = vcombine_s16(d17s16, d25s16); - *q13s16 = vcombine_s16(d19s16, d27s16); - *q14s16 = vcombine_s16(d21s16, d29s16); - *q15s16 = vcombine_s16(d23s16, d31s16); - - q0x2s32 = vtrnq_s32(vreinterpretq_s32_s16(*q8s16), - vreinterpretq_s32_s16(*q10s16)); - q1x2s32 = vtrnq_s32(vreinterpretq_s32_s16(*q9s16), - vreinterpretq_s32_s16(*q11s16)); - q2x2s32 = vtrnq_s32(vreinterpretq_s32_s16(*q12s16), - vreinterpretq_s32_s16(*q14s16)); - q3x2s32 = vtrnq_s32(vreinterpretq_s32_s16(*q13s16), - vreinterpretq_s32_s16(*q15s16)); - - q0x2s16 = vtrnq_s16(vreinterpretq_s16_s32(q0x2s32.val[0]), // q8 - vreinterpretq_s16_s32(q1x2s32.val[0])); // q9 - q1x2s16 = vtrnq_s16(vreinterpretq_s16_s32(q0x2s32.val[1]), // q10 - vreinterpretq_s16_s32(q1x2s32.val[1])); // q11 - q2x2s16 = vtrnq_s16(vreinterpretq_s16_s32(q2x2s32.val[0]), // q12 - vreinterpretq_s16_s32(q3x2s32.val[0])); // q13 - q3x2s16 = vtrnq_s16(vreinterpretq_s16_s32(q2x2s32.val[1]), // q14 - vreinterpretq_s16_s32(q3x2s32.val[1])); // q15 - - *q8s16 = q0x2s16.val[0]; - *q9s16 = q0x2s16.val[1]; - *q10s16 = q1x2s16.val[0]; - *q11s16 = q1x2s16.val[1]; - *q12s16 = q2x2s16.val[0]; - *q13s16 = q2x2s16.val[1]; - *q14s16 = q3x2s16.val[0]; - *q15s16 = q3x2s16.val[1]; - return; -} - -void vp9_idct16x16_256_add_neon_pass1( - int16_t *in, - int16_t *out, - int output_stride) { - int16x4_t d0s16, d1s16, d2s16, d3s16; - int16x4_t d8s16, d9s16, d10s16, d11s16, d12s16, d13s16, d14s16, d15s16; - int16x4_t d16s16, d17s16, d18s16, d19s16, d20s16, d21s16, d22s16, d23s16; - int16x4_t d24s16, d25s16, d26s16, d27s16, d28s16, d29s16, d30s16, d31s16; - uint64x1_t d16u64, d17u64, d18u64, d19u64, d20u64, d21u64, d22u64, d23u64; - uint64x1_t d24u64, d25u64, d26u64, d27u64, d28u64, d29u64, d30u64, d31u64; - int16x8_t q0s16, q1s16, q2s16, q3s16, q4s16, q5s16, q6s16, q7s16; - int16x8_t q8s16, q9s16, q10s16, q11s16, q12s16, q13s16, q14s16, q15s16; - int32x4_t q0s32, q1s32, q2s32, q3s32, q5s32, q6s32, q9s32; - int32x4_t q10s32, q11s32, q12s32, q13s32, q15s32; - int16x8x2_t q0x2s16; - - q0x2s16 = vld2q_s16(in); - q8s16 = q0x2s16.val[0]; - in += 16; - q0x2s16 = vld2q_s16(in); - q9s16 = q0x2s16.val[0]; - in += 16; - q0x2s16 = vld2q_s16(in); - q10s16 = q0x2s16.val[0]; - in += 16; - q0x2s16 = vld2q_s16(in); - q11s16 = q0x2s16.val[0]; - in += 16; - q0x2s16 = vld2q_s16(in); - q12s16 = q0x2s16.val[0]; - in += 16; - q0x2s16 = vld2q_s16(in); - q13s16 = q0x2s16.val[0]; - in += 16; - q0x2s16 = vld2q_s16(in); - q14s16 = q0x2s16.val[0]; - in += 16; - q0x2s16 = vld2q_s16(in); - q15s16 = q0x2s16.val[0]; - - TRANSPOSE8X8(&q8s16, &q9s16, &q10s16, &q11s16, - &q12s16, &q13s16, &q14s16, &q15s16); - - d16s16 = vget_low_s16(q8s16); - d17s16 = vget_high_s16(q8s16); - d18s16 = vget_low_s16(q9s16); - d19s16 = vget_high_s16(q9s16); - d20s16 = vget_low_s16(q10s16); - d21s16 = vget_high_s16(q10s16); - d22s16 = vget_low_s16(q11s16); - d23s16 = vget_high_s16(q11s16); - d24s16 = vget_low_s16(q12s16); - d25s16 = vget_high_s16(q12s16); - d26s16 = vget_low_s16(q13s16); - d27s16 = vget_high_s16(q13s16); - d28s16 = vget_low_s16(q14s16); - d29s16 = vget_high_s16(q14s16); - d30s16 = vget_low_s16(q15s16); - d31s16 = vget_high_s16(q15s16); - - // stage 3 - d0s16 = vdup_n_s16(cospi_28_64); - d1s16 = vdup_n_s16(cospi_4_64); - - q2s32 = vmull_s16(d18s16, d0s16); - q3s32 = vmull_s16(d19s16, d0s16); - q5s32 = vmull_s16(d18s16, d1s16); - q6s32 = vmull_s16(d19s16, d1s16); - - q2s32 = vmlsl_s16(q2s32, d30s16, d1s16); - q3s32 = vmlsl_s16(q3s32, d31s16, d1s16); - q5s32 = vmlal_s16(q5s32, d30s16, d0s16); - q6s32 = vmlal_s16(q6s32, d31s16, d0s16); - - d2s16 = vdup_n_s16(cospi_12_64); - d3s16 = vdup_n_s16(cospi_20_64); - - d8s16 = vqrshrn_n_s32(q2s32, 14); - d9s16 = vqrshrn_n_s32(q3s32, 14); - d14s16 = vqrshrn_n_s32(q5s32, 14); - d15s16 = vqrshrn_n_s32(q6s32, 14); - q4s16 = vcombine_s16(d8s16, d9s16); - q7s16 = vcombine_s16(d14s16, d15s16); - - q2s32 = vmull_s16(d26s16, d2s16); - q3s32 = vmull_s16(d27s16, d2s16); - q9s32 = vmull_s16(d26s16, d3s16); - q15s32 = vmull_s16(d27s16, d3s16); - - q2s32 = vmlsl_s16(q2s32, d22s16, d3s16); - q3s32 = vmlsl_s16(q3s32, d23s16, d3s16); - q9s32 = vmlal_s16(q9s32, d22s16, d2s16); - q15s32 = vmlal_s16(q15s32, d23s16, d2s16); - - d10s16 = vqrshrn_n_s32(q2s32, 14); - d11s16 = vqrshrn_n_s32(q3s32, 14); - d12s16 = vqrshrn_n_s32(q9s32, 14); - d13s16 = vqrshrn_n_s32(q15s32, 14); - q5s16 = vcombine_s16(d10s16, d11s16); - q6s16 = vcombine_s16(d12s16, d13s16); - - // stage 4 - d30s16 = vdup_n_s16(cospi_16_64); - - q2s32 = vmull_s16(d16s16, d30s16); - q11s32 = vmull_s16(d17s16, d30s16); - q0s32 = vmull_s16(d24s16, d30s16); - q1s32 = vmull_s16(d25s16, d30s16); - - d30s16 = vdup_n_s16(cospi_24_64); - d31s16 = vdup_n_s16(cospi_8_64); - - q3s32 = vaddq_s32(q2s32, q0s32); - q12s32 = vaddq_s32(q11s32, q1s32); - q13s32 = vsubq_s32(q2s32, q0s32); - q1s32 = vsubq_s32(q11s32, q1s32); - - d16s16 = vqrshrn_n_s32(q3s32, 14); - d17s16 = vqrshrn_n_s32(q12s32, 14); - d18s16 = vqrshrn_n_s32(q13s32, 14); - d19s16 = vqrshrn_n_s32(q1s32, 14); - q8s16 = vcombine_s16(d16s16, d17s16); - q9s16 = vcombine_s16(d18s16, d19s16); - - q0s32 = vmull_s16(d20s16, d31s16); - q1s32 = vmull_s16(d21s16, d31s16); - q12s32 = vmull_s16(d20s16, d30s16); - q13s32 = vmull_s16(d21s16, d30s16); - - q0s32 = vmlal_s16(q0s32, d28s16, d30s16); - q1s32 = vmlal_s16(q1s32, d29s16, d30s16); - q12s32 = vmlsl_s16(q12s32, d28s16, d31s16); - q13s32 = vmlsl_s16(q13s32, d29s16, d31s16); - - d22s16 = vqrshrn_n_s32(q0s32, 14); - d23s16 = vqrshrn_n_s32(q1s32, 14); - d20s16 = vqrshrn_n_s32(q12s32, 14); - d21s16 = vqrshrn_n_s32(q13s32, 14); - q10s16 = vcombine_s16(d20s16, d21s16); - q11s16 = vcombine_s16(d22s16, d23s16); - - q13s16 = vsubq_s16(q4s16, q5s16); - q4s16 = vaddq_s16(q4s16, q5s16); - q14s16 = vsubq_s16(q7s16, q6s16); - q15s16 = vaddq_s16(q6s16, q7s16); - d26s16 = vget_low_s16(q13s16); - d27s16 = vget_high_s16(q13s16); - d28s16 = vget_low_s16(q14s16); - d29s16 = vget_high_s16(q14s16); - - // stage 5 - q0s16 = vaddq_s16(q8s16, q11s16); - q1s16 = vaddq_s16(q9s16, q10s16); - q2s16 = vsubq_s16(q9s16, q10s16); - q3s16 = vsubq_s16(q8s16, q11s16); - - d16s16 = vdup_n_s16(cospi_16_64); - - q11s32 = vmull_s16(d26s16, d16s16); - q12s32 = vmull_s16(d27s16, d16s16); - q9s32 = vmull_s16(d28s16, d16s16); - q10s32 = vmull_s16(d29s16, d16s16); - - q6s32 = vsubq_s32(q9s32, q11s32); - q13s32 = vsubq_s32(q10s32, q12s32); - q9s32 = vaddq_s32(q9s32, q11s32); - q10s32 = vaddq_s32(q10s32, q12s32); - - d10s16 = vqrshrn_n_s32(q6s32, 14); - d11s16 = vqrshrn_n_s32(q13s32, 14); - d12s16 = vqrshrn_n_s32(q9s32, 14); - d13s16 = vqrshrn_n_s32(q10s32, 14); - q5s16 = vcombine_s16(d10s16, d11s16); - q6s16 = vcombine_s16(d12s16, d13s16); - - // stage 6 - q8s16 = vaddq_s16(q0s16, q15s16); - q9s16 = vaddq_s16(q1s16, q6s16); - q10s16 = vaddq_s16(q2s16, q5s16); - q11s16 = vaddq_s16(q3s16, q4s16); - q12s16 = vsubq_s16(q3s16, q4s16); - q13s16 = vsubq_s16(q2s16, q5s16); - q14s16 = vsubq_s16(q1s16, q6s16); - q15s16 = vsubq_s16(q0s16, q15s16); - - d16u64 = vreinterpret_u64_s16(vget_low_s16(q8s16)); - d17u64 = vreinterpret_u64_s16(vget_high_s16(q8s16)); - d18u64 = vreinterpret_u64_s16(vget_low_s16(q9s16)); - d19u64 = vreinterpret_u64_s16(vget_high_s16(q9s16)); - d20u64 = vreinterpret_u64_s16(vget_low_s16(q10s16)); - d21u64 = vreinterpret_u64_s16(vget_high_s16(q10s16)); - d22u64 = vreinterpret_u64_s16(vget_low_s16(q11s16)); - d23u64 = vreinterpret_u64_s16(vget_high_s16(q11s16)); - d24u64 = vreinterpret_u64_s16(vget_low_s16(q12s16)); - d25u64 = vreinterpret_u64_s16(vget_high_s16(q12s16)); - d26u64 = vreinterpret_u64_s16(vget_low_s16(q13s16)); - d27u64 = vreinterpret_u64_s16(vget_high_s16(q13s16)); - d28u64 = vreinterpret_u64_s16(vget_low_s16(q14s16)); - d29u64 = vreinterpret_u64_s16(vget_high_s16(q14s16)); - d30u64 = vreinterpret_u64_s16(vget_low_s16(q15s16)); - d31u64 = vreinterpret_u64_s16(vget_high_s16(q15s16)); - - // store the data - output_stride >>= 1; // output_stride / 2, out is int16_t - vst1_u64((uint64_t *)out, d16u64); - out += output_stride; - vst1_u64((uint64_t *)out, d17u64); - out += output_stride; - vst1_u64((uint64_t *)out, d18u64); - out += output_stride; - vst1_u64((uint64_t *)out, d19u64); - out += output_stride; - vst1_u64((uint64_t *)out, d20u64); - out += output_stride; - vst1_u64((uint64_t *)out, d21u64); - out += output_stride; - vst1_u64((uint64_t *)out, d22u64); - out += output_stride; - vst1_u64((uint64_t *)out, d23u64); - out += output_stride; - vst1_u64((uint64_t *)out, d24u64); - out += output_stride; - vst1_u64((uint64_t *)out, d25u64); - out += output_stride; - vst1_u64((uint64_t *)out, d26u64); - out += output_stride; - vst1_u64((uint64_t *)out, d27u64); - out += output_stride; - vst1_u64((uint64_t *)out, d28u64); - out += output_stride; - vst1_u64((uint64_t *)out, d29u64); - out += output_stride; - vst1_u64((uint64_t *)out, d30u64); - out += output_stride; - vst1_u64((uint64_t *)out, d31u64); - return; -} - -void vp9_idct16x16_256_add_neon_pass2( - int16_t *src, - int16_t *out, - int16_t *pass1Output, - int16_t skip_adding, - uint8_t *dest, - int dest_stride) { - uint8_t *d; - uint8x8_t d12u8, d13u8; - int16x4_t d0s16, d1s16, d2s16, d3s16, d4s16, d5s16, d6s16, d7s16; - int16x4_t d8s16, d9s16, d10s16, d11s16, d12s16, d13s16, d14s16, d15s16; - int16x4_t d16s16, d17s16, d18s16, d19s16, d20s16, d21s16, d22s16, d23s16; - int16x4_t d24s16, d25s16, d26s16, d27s16, d28s16, d29s16, d30s16, d31s16; - uint64x1_t d24u64, d25u64, d26u64, d27u64; - int64x1_t d12s64, d13s64; - uint16x8_t q2u16, q3u16, q4u16, q5u16, q8u16; - uint16x8_t q9u16, q12u16, q13u16, q14u16, q15u16; - int16x8_t q0s16, q1s16, q2s16, q3s16, q4s16, q5s16, q6s16, q7s16; - int16x8_t q8s16, q9s16, q10s16, q11s16, q12s16, q13s16, q14s16, q15s16; - int32x4_t q0s32, q1s32, q2s32, q3s32, q4s32, q5s32, q6s32, q8s32, q9s32; - int32x4_t q10s32, q11s32, q12s32, q13s32; - int16x8x2_t q0x2s16; - - q0x2s16 = vld2q_s16(src); - q8s16 = q0x2s16.val[0]; - src += 16; - q0x2s16 = vld2q_s16(src); - q9s16 = q0x2s16.val[0]; - src += 16; - q0x2s16 = vld2q_s16(src); - q10s16 = q0x2s16.val[0]; - src += 16; - q0x2s16 = vld2q_s16(src); - q11s16 = q0x2s16.val[0]; - src += 16; - q0x2s16 = vld2q_s16(src); - q12s16 = q0x2s16.val[0]; - src += 16; - q0x2s16 = vld2q_s16(src); - q13s16 = q0x2s16.val[0]; - src += 16; - q0x2s16 = vld2q_s16(src); - q14s16 = q0x2s16.val[0]; - src += 16; - q0x2s16 = vld2q_s16(src); - q15s16 = q0x2s16.val[0]; - - TRANSPOSE8X8(&q8s16, &q9s16, &q10s16, &q11s16, - &q12s16, &q13s16, &q14s16, &q15s16); - - d16s16 = vget_low_s16(q8s16); - d17s16 = vget_high_s16(q8s16); - d18s16 = vget_low_s16(q9s16); - d19s16 = vget_high_s16(q9s16); - d20s16 = vget_low_s16(q10s16); - d21s16 = vget_high_s16(q10s16); - d22s16 = vget_low_s16(q11s16); - d23s16 = vget_high_s16(q11s16); - d24s16 = vget_low_s16(q12s16); - d25s16 = vget_high_s16(q12s16); - d26s16 = vget_low_s16(q13s16); - d27s16 = vget_high_s16(q13s16); - d28s16 = vget_low_s16(q14s16); - d29s16 = vget_high_s16(q14s16); - d30s16 = vget_low_s16(q15s16); - d31s16 = vget_high_s16(q15s16); - - // stage 3 - d12s16 = vdup_n_s16(cospi_30_64); - d13s16 = vdup_n_s16(cospi_2_64); - - q2s32 = vmull_s16(d16s16, d12s16); - q3s32 = vmull_s16(d17s16, d12s16); - q1s32 = vmull_s16(d16s16, d13s16); - q4s32 = vmull_s16(d17s16, d13s16); - - q2s32 = vmlsl_s16(q2s32, d30s16, d13s16); - q3s32 = vmlsl_s16(q3s32, d31s16, d13s16); - q1s32 = vmlal_s16(q1s32, d30s16, d12s16); - q4s32 = vmlal_s16(q4s32, d31s16, d12s16); - - d0s16 = vqrshrn_n_s32(q2s32, 14); - d1s16 = vqrshrn_n_s32(q3s32, 14); - d14s16 = vqrshrn_n_s32(q1s32, 14); - d15s16 = vqrshrn_n_s32(q4s32, 14); - q0s16 = vcombine_s16(d0s16, d1s16); - q7s16 = vcombine_s16(d14s16, d15s16); - - d30s16 = vdup_n_s16(cospi_14_64); - d31s16 = vdup_n_s16(cospi_18_64); - - q2s32 = vmull_s16(d24s16, d30s16); - q3s32 = vmull_s16(d25s16, d30s16); - q4s32 = vmull_s16(d24s16, d31s16); - q5s32 = vmull_s16(d25s16, d31s16); - - q2s32 = vmlsl_s16(q2s32, d22s16, d31s16); - q3s32 = vmlsl_s16(q3s32, d23s16, d31s16); - q4s32 = vmlal_s16(q4s32, d22s16, d30s16); - q5s32 = vmlal_s16(q5s32, d23s16, d30s16); - - d2s16 = vqrshrn_n_s32(q2s32, 14); - d3s16 = vqrshrn_n_s32(q3s32, 14); - d12s16 = vqrshrn_n_s32(q4s32, 14); - d13s16 = vqrshrn_n_s32(q5s32, 14); - q1s16 = vcombine_s16(d2s16, d3s16); - q6s16 = vcombine_s16(d12s16, d13s16); - - d30s16 = vdup_n_s16(cospi_22_64); - d31s16 = vdup_n_s16(cospi_10_64); - - q11s32 = vmull_s16(d20s16, d30s16); - q12s32 = vmull_s16(d21s16, d30s16); - q4s32 = vmull_s16(d20s16, d31s16); - q5s32 = vmull_s16(d21s16, d31s16); - - q11s32 = vmlsl_s16(q11s32, d26s16, d31s16); - q12s32 = vmlsl_s16(q12s32, d27s16, d31s16); - q4s32 = vmlal_s16(q4s32, d26s16, d30s16); - q5s32 = vmlal_s16(q5s32, d27s16, d30s16); - - d4s16 = vqrshrn_n_s32(q11s32, 14); - d5s16 = vqrshrn_n_s32(q12s32, 14); - d11s16 = vqrshrn_n_s32(q5s32, 14); - d10s16 = vqrshrn_n_s32(q4s32, 14); - q2s16 = vcombine_s16(d4s16, d5s16); - q5s16 = vcombine_s16(d10s16, d11s16); - - d30s16 = vdup_n_s16(cospi_6_64); - d31s16 = vdup_n_s16(cospi_26_64); - - q10s32 = vmull_s16(d28s16, d30s16); - q11s32 = vmull_s16(d29s16, d30s16); - q12s32 = vmull_s16(d28s16, d31s16); - q13s32 = vmull_s16(d29s16, d31s16); - - q10s32 = vmlsl_s16(q10s32, d18s16, d31s16); - q11s32 = vmlsl_s16(q11s32, d19s16, d31s16); - q12s32 = vmlal_s16(q12s32, d18s16, d30s16); - q13s32 = vmlal_s16(q13s32, d19s16, d30s16); - - d6s16 = vqrshrn_n_s32(q10s32, 14); - d7s16 = vqrshrn_n_s32(q11s32, 14); - d8s16 = vqrshrn_n_s32(q12s32, 14); - d9s16 = vqrshrn_n_s32(q13s32, 14); - q3s16 = vcombine_s16(d6s16, d7s16); - q4s16 = vcombine_s16(d8s16, d9s16); - - // stage 3 - q9s16 = vsubq_s16(q0s16, q1s16); - q0s16 = vaddq_s16(q0s16, q1s16); - q10s16 = vsubq_s16(q3s16, q2s16); - q11s16 = vaddq_s16(q2s16, q3s16); - q12s16 = vaddq_s16(q4s16, q5s16); - q13s16 = vsubq_s16(q4s16, q5s16); - q14s16 = vsubq_s16(q7s16, q6s16); - q7s16 = vaddq_s16(q6s16, q7s16); - - // stage 4 - d18s16 = vget_low_s16(q9s16); - d19s16 = vget_high_s16(q9s16); - d20s16 = vget_low_s16(q10s16); - d21s16 = vget_high_s16(q10s16); - d26s16 = vget_low_s16(q13s16); - d27s16 = vget_high_s16(q13s16); - d28s16 = vget_low_s16(q14s16); - d29s16 = vget_high_s16(q14s16); - - d30s16 = vdup_n_s16(cospi_8_64); - d31s16 = vdup_n_s16(cospi_24_64); - - q2s32 = vmull_s16(d18s16, d31s16); - q3s32 = vmull_s16(d19s16, d31s16); - q4s32 = vmull_s16(d28s16, d31s16); - q5s32 = vmull_s16(d29s16, d31s16); - - q2s32 = vmlal_s16(q2s32, d28s16, d30s16); - q3s32 = vmlal_s16(q3s32, d29s16, d30s16); - q4s32 = vmlsl_s16(q4s32, d18s16, d30s16); - q5s32 = vmlsl_s16(q5s32, d19s16, d30s16); - - d12s16 = vqrshrn_n_s32(q2s32, 14); - d13s16 = vqrshrn_n_s32(q3s32, 14); - d2s16 = vqrshrn_n_s32(q4s32, 14); - d3s16 = vqrshrn_n_s32(q5s32, 14); - q1s16 = vcombine_s16(d2s16, d3s16); - q6s16 = vcombine_s16(d12s16, d13s16); - - q3s16 = q11s16; - q4s16 = q12s16; - - d30s16 = vdup_n_s16(-cospi_8_64); - q11s32 = vmull_s16(d26s16, d30s16); - q12s32 = vmull_s16(d27s16, d30s16); - q8s32 = vmull_s16(d20s16, d30s16); - q9s32 = vmull_s16(d21s16, d30s16); - - q11s32 = vmlsl_s16(q11s32, d20s16, d31s16); - q12s32 = vmlsl_s16(q12s32, d21s16, d31s16); - q8s32 = vmlal_s16(q8s32, d26s16, d31s16); - q9s32 = vmlal_s16(q9s32, d27s16, d31s16); - - d4s16 = vqrshrn_n_s32(q11s32, 14); - d5s16 = vqrshrn_n_s32(q12s32, 14); - d10s16 = vqrshrn_n_s32(q8s32, 14); - d11s16 = vqrshrn_n_s32(q9s32, 14); - q2s16 = vcombine_s16(d4s16, d5s16); - q5s16 = vcombine_s16(d10s16, d11s16); - - // stage 5 - q8s16 = vaddq_s16(q0s16, q3s16); - q9s16 = vaddq_s16(q1s16, q2s16); - q10s16 = vsubq_s16(q1s16, q2s16); - q11s16 = vsubq_s16(q0s16, q3s16); - q12s16 = vsubq_s16(q7s16, q4s16); - q13s16 = vsubq_s16(q6s16, q5s16); - q14s16 = vaddq_s16(q6s16, q5s16); - q15s16 = vaddq_s16(q7s16, q4s16); - - // stage 6 - d20s16 = vget_low_s16(q10s16); - d21s16 = vget_high_s16(q10s16); - d22s16 = vget_low_s16(q11s16); - d23s16 = vget_high_s16(q11s16); - d24s16 = vget_low_s16(q12s16); - d25s16 = vget_high_s16(q12s16); - d26s16 = vget_low_s16(q13s16); - d27s16 = vget_high_s16(q13s16); - - d14s16 = vdup_n_s16(cospi_16_64); - - q3s32 = vmull_s16(d26s16, d14s16); - q4s32 = vmull_s16(d27s16, d14s16); - q0s32 = vmull_s16(d20s16, d14s16); - q1s32 = vmull_s16(d21s16, d14s16); - - q5s32 = vsubq_s32(q3s32, q0s32); - q6s32 = vsubq_s32(q4s32, q1s32); - q10s32 = vaddq_s32(q3s32, q0s32); - q4s32 = vaddq_s32(q4s32, q1s32); - - d4s16 = vqrshrn_n_s32(q5s32, 14); - d5s16 = vqrshrn_n_s32(q6s32, 14); - d10s16 = vqrshrn_n_s32(q10s32, 14); - d11s16 = vqrshrn_n_s32(q4s32, 14); - q2s16 = vcombine_s16(d4s16, d5s16); - q5s16 = vcombine_s16(d10s16, d11s16); - - q0s32 = vmull_s16(d22s16, d14s16); - q1s32 = vmull_s16(d23s16, d14s16); - q13s32 = vmull_s16(d24s16, d14s16); - q6s32 = vmull_s16(d25s16, d14s16); - - q10s32 = vsubq_s32(q13s32, q0s32); - q4s32 = vsubq_s32(q6s32, q1s32); - q13s32 = vaddq_s32(q13s32, q0s32); - q6s32 = vaddq_s32(q6s32, q1s32); - - d6s16 = vqrshrn_n_s32(q10s32, 14); - d7s16 = vqrshrn_n_s32(q4s32, 14); - d8s16 = vqrshrn_n_s32(q13s32, 14); - d9s16 = vqrshrn_n_s32(q6s32, 14); - q3s16 = vcombine_s16(d6s16, d7s16); - q4s16 = vcombine_s16(d8s16, d9s16); - - // stage 7 - if (skip_adding != 0) { - d = dest; - // load the data in pass1 - q0s16 = vld1q_s16(pass1Output); - pass1Output += 8; - q1s16 = vld1q_s16(pass1Output); - pass1Output += 8; - d12s64 = vld1_s64((int64_t *)dest); - dest += dest_stride; - d13s64 = vld1_s64((int64_t *)dest); - dest += dest_stride; - - q12s16 = vaddq_s16(q0s16, q15s16); - q13s16 = vaddq_s16(q1s16, q14s16); - q12s16 = vrshrq_n_s16(q12s16, 6); - q13s16 = vrshrq_n_s16(q13s16, 6); - q12u16 = vaddw_u8(vreinterpretq_u16_s16(q12s16), - vreinterpret_u8_s64(d12s64)); - q13u16 = vaddw_u8(vreinterpretq_u16_s16(q13s16), - vreinterpret_u8_s64(d13s64)); - d12u8 = vqmovun_s16(vreinterpretq_s16_u16(q12u16)); - d13u8 = vqmovun_s16(vreinterpretq_s16_u16(q13u16)); - vst1_u64((uint64_t *)d, vreinterpret_u64_u8(d12u8)); - d += dest_stride; - vst1_u64((uint64_t *)d, vreinterpret_u64_u8(d13u8)); - d += dest_stride; - q14s16 = vsubq_s16(q1s16, q14s16); - q15s16 = vsubq_s16(q0s16, q15s16); - - q10s16 = vld1q_s16(pass1Output); - pass1Output += 8; - q11s16 = vld1q_s16(pass1Output); - pass1Output += 8; - d12s64 = vld1_s64((int64_t *)dest); - dest += dest_stride; - d13s64 = vld1_s64((int64_t *)dest); - dest += dest_stride; - q12s16 = vaddq_s16(q10s16, q5s16); - q13s16 = vaddq_s16(q11s16, q4s16); - q12s16 = vrshrq_n_s16(q12s16, 6); - q13s16 = vrshrq_n_s16(q13s16, 6); - q12u16 = vaddw_u8(vreinterpretq_u16_s16(q12s16), - vreinterpret_u8_s64(d12s64)); - q13u16 = vaddw_u8(vreinterpretq_u16_s16(q13s16), - vreinterpret_u8_s64(d13s64)); - d12u8 = vqmovun_s16(vreinterpretq_s16_u16(q12u16)); - d13u8 = vqmovun_s16(vreinterpretq_s16_u16(q13u16)); - vst1_u64((uint64_t *)d, vreinterpret_u64_u8(d12u8)); - d += dest_stride; - vst1_u64((uint64_t *)d, vreinterpret_u64_u8(d13u8)); - d += dest_stride; - q4s16 = vsubq_s16(q11s16, q4s16); - q5s16 = vsubq_s16(q10s16, q5s16); - - q0s16 = vld1q_s16(pass1Output); - pass1Output += 8; - q1s16 = vld1q_s16(pass1Output); - pass1Output += 8; - d12s64 = vld1_s64((int64_t *)dest); - dest += dest_stride; - d13s64 = vld1_s64((int64_t *)dest); - dest += dest_stride; - q12s16 = vaddq_s16(q0s16, q3s16); - q13s16 = vaddq_s16(q1s16, q2s16); - q12s16 = vrshrq_n_s16(q12s16, 6); - q13s16 = vrshrq_n_s16(q13s16, 6); - q12u16 = vaddw_u8(vreinterpretq_u16_s16(q12s16), - vreinterpret_u8_s64(d12s64)); - q13u16 = vaddw_u8(vreinterpretq_u16_s16(q13s16), - vreinterpret_u8_s64(d13s64)); - d12u8 = vqmovun_s16(vreinterpretq_s16_u16(q12u16)); - d13u8 = vqmovun_s16(vreinterpretq_s16_u16(q13u16)); - vst1_u64((uint64_t *)d, vreinterpret_u64_u8(d12u8)); - d += dest_stride; - vst1_u64((uint64_t *)d, vreinterpret_u64_u8(d13u8)); - d += dest_stride; - q2s16 = vsubq_s16(q1s16, q2s16); - q3s16 = vsubq_s16(q0s16, q3s16); - - q10s16 = vld1q_s16(pass1Output); - pass1Output += 8; - q11s16 = vld1q_s16(pass1Output); - d12s64 = vld1_s64((int64_t *)dest); - dest += dest_stride; - d13s64 = vld1_s64((int64_t *)dest); - dest += dest_stride; - q12s16 = vaddq_s16(q10s16, q9s16); - q13s16 = vaddq_s16(q11s16, q8s16); - q12s16 = vrshrq_n_s16(q12s16, 6); - q13s16 = vrshrq_n_s16(q13s16, 6); - q12u16 = vaddw_u8(vreinterpretq_u16_s16(q12s16), - vreinterpret_u8_s64(d12s64)); - q13u16 = vaddw_u8(vreinterpretq_u16_s16(q13s16), - vreinterpret_u8_s64(d13s64)); - d12u8 = vqmovun_s16(vreinterpretq_s16_u16(q12u16)); - d13u8 = vqmovun_s16(vreinterpretq_s16_u16(q13u16)); - vst1_u64((uint64_t *)d, vreinterpret_u64_u8(d12u8)); - d += dest_stride; - vst1_u64((uint64_t *)d, vreinterpret_u64_u8(d13u8)); - d += dest_stride; - q8s16 = vsubq_s16(q11s16, q8s16); - q9s16 = vsubq_s16(q10s16, q9s16); - - // store the data out 8,9,10,11,12,13,14,15 - d12s64 = vld1_s64((int64_t *)dest); - dest += dest_stride; - q8s16 = vrshrq_n_s16(q8s16, 6); - q8u16 = vaddw_u8(vreinterpretq_u16_s16(q8s16), - vreinterpret_u8_s64(d12s64)); - d12u8 = vqmovun_s16(vreinterpretq_s16_u16(q8u16)); - vst1_u64((uint64_t *)d, vreinterpret_u64_u8(d12u8)); - d += dest_stride; - - d12s64 = vld1_s64((int64_t *)dest); - dest += dest_stride; - q9s16 = vrshrq_n_s16(q9s16, 6); - q9u16 = vaddw_u8(vreinterpretq_u16_s16(q9s16), - vreinterpret_u8_s64(d12s64)); - d12u8 = vqmovun_s16(vreinterpretq_s16_u16(q9u16)); - vst1_u64((uint64_t *)d, vreinterpret_u64_u8(d12u8)); - d += dest_stride; - - d12s64 = vld1_s64((int64_t *)dest); - dest += dest_stride; - q2s16 = vrshrq_n_s16(q2s16, 6); - q2u16 = vaddw_u8(vreinterpretq_u16_s16(q2s16), - vreinterpret_u8_s64(d12s64)); - d12u8 = vqmovun_s16(vreinterpretq_s16_u16(q2u16)); - vst1_u64((uint64_t *)d, vreinterpret_u64_u8(d12u8)); - d += dest_stride; - - d12s64 = vld1_s64((int64_t *)dest); - dest += dest_stride; - q3s16 = vrshrq_n_s16(q3s16, 6); - q3u16 = vaddw_u8(vreinterpretq_u16_s16(q3s16), - vreinterpret_u8_s64(d12s64)); - d12u8 = vqmovun_s16(vreinterpretq_s16_u16(q3u16)); - vst1_u64((uint64_t *)d, vreinterpret_u64_u8(d12u8)); - d += dest_stride; - - d12s64 = vld1_s64((int64_t *)dest); - dest += dest_stride; - q4s16 = vrshrq_n_s16(q4s16, 6); - q4u16 = vaddw_u8(vreinterpretq_u16_s16(q4s16), - vreinterpret_u8_s64(d12s64)); - d12u8 = vqmovun_s16(vreinterpretq_s16_u16(q4u16)); - vst1_u64((uint64_t *)d, vreinterpret_u64_u8(d12u8)); - d += dest_stride; - - d12s64 = vld1_s64((int64_t *)dest); - dest += dest_stride; - q5s16 = vrshrq_n_s16(q5s16, 6); - q5u16 = vaddw_u8(vreinterpretq_u16_s16(q5s16), - vreinterpret_u8_s64(d12s64)); - d12u8 = vqmovun_s16(vreinterpretq_s16_u16(q5u16)); - vst1_u64((uint64_t *)d, vreinterpret_u64_u8(d12u8)); - d += dest_stride; - - d12s64 = vld1_s64((int64_t *)dest); - dest += dest_stride; - q14s16 = vrshrq_n_s16(q14s16, 6); - q14u16 = vaddw_u8(vreinterpretq_u16_s16(q14s16), - vreinterpret_u8_s64(d12s64)); - d12u8 = vqmovun_s16(vreinterpretq_s16_u16(q14u16)); - vst1_u64((uint64_t *)d, vreinterpret_u64_u8(d12u8)); - d += dest_stride; - - d12s64 = vld1_s64((int64_t *)dest); - q15s16 = vrshrq_n_s16(q15s16, 6); - q15u16 = vaddw_u8(vreinterpretq_u16_s16(q15s16), - vreinterpret_u8_s64(d12s64)); - d12u8 = vqmovun_s16(vreinterpretq_s16_u16(q15u16)); - vst1_u64((uint64_t *)d, vreinterpret_u64_u8(d12u8)); - } else { // skip_adding_dest - q0s16 = vld1q_s16(pass1Output); - pass1Output += 8; - q1s16 = vld1q_s16(pass1Output); - pass1Output += 8; - q12s16 = vaddq_s16(q0s16, q15s16); - q13s16 = vaddq_s16(q1s16, q14s16); - d24u64 = vreinterpret_u64_s16(vget_low_s16(q12s16)); - d25u64 = vreinterpret_u64_s16(vget_high_s16(q12s16)); - d26u64 = vreinterpret_u64_s16(vget_low_s16(q13s16)); - d27u64 = vreinterpret_u64_s16(vget_high_s16(q13s16)); - vst1_u64((uint64_t *)out, d24u64); - out += 4; - vst1_u64((uint64_t *)out, d25u64); - out += 12; - vst1_u64((uint64_t *)out, d26u64); - out += 4; - vst1_u64((uint64_t *)out, d27u64); - out += 12; - q14s16 = vsubq_s16(q1s16, q14s16); - q15s16 = vsubq_s16(q0s16, q15s16); - - q10s16 = vld1q_s16(pass1Output); - pass1Output += 8; - q11s16 = vld1q_s16(pass1Output); - pass1Output += 8; - q12s16 = vaddq_s16(q10s16, q5s16); - q13s16 = vaddq_s16(q11s16, q4s16); - d24u64 = vreinterpret_u64_s16(vget_low_s16(q12s16)); - d25u64 = vreinterpret_u64_s16(vget_high_s16(q12s16)); - d26u64 = vreinterpret_u64_s16(vget_low_s16(q13s16)); - d27u64 = vreinterpret_u64_s16(vget_high_s16(q13s16)); - vst1_u64((uint64_t *)out, d24u64); - out += 4; - vst1_u64((uint64_t *)out, d25u64); - out += 12; - vst1_u64((uint64_t *)out, d26u64); - out += 4; - vst1_u64((uint64_t *)out, d27u64); - out += 12; - q4s16 = vsubq_s16(q11s16, q4s16); - q5s16 = vsubq_s16(q10s16, q5s16); - - q0s16 = vld1q_s16(pass1Output); - pass1Output += 8; - q1s16 = vld1q_s16(pass1Output); - pass1Output += 8; - q12s16 = vaddq_s16(q0s16, q3s16); - q13s16 = vaddq_s16(q1s16, q2s16); - d24u64 = vreinterpret_u64_s16(vget_low_s16(q12s16)); - d25u64 = vreinterpret_u64_s16(vget_high_s16(q12s16)); - d26u64 = vreinterpret_u64_s16(vget_low_s16(q13s16)); - d27u64 = vreinterpret_u64_s16(vget_high_s16(q13s16)); - vst1_u64((uint64_t *)out, d24u64); - out += 4; - vst1_u64((uint64_t *)out, d25u64); - out += 12; - vst1_u64((uint64_t *)out, d26u64); - out += 4; - vst1_u64((uint64_t *)out, d27u64); - out += 12; - q2s16 = vsubq_s16(q1s16, q2s16); - q3s16 = vsubq_s16(q0s16, q3s16); - - q10s16 = vld1q_s16(pass1Output); - pass1Output += 8; - q11s16 = vld1q_s16(pass1Output); - pass1Output += 8; - q12s16 = vaddq_s16(q10s16, q9s16); - q13s16 = vaddq_s16(q11s16, q8s16); - d24u64 = vreinterpret_u64_s16(vget_low_s16(q12s16)); - d25u64 = vreinterpret_u64_s16(vget_high_s16(q12s16)); - d26u64 = vreinterpret_u64_s16(vget_low_s16(q13s16)); - d27u64 = vreinterpret_u64_s16(vget_high_s16(q13s16)); - vst1_u64((uint64_t *)out, d24u64); - out += 4; - vst1_u64((uint64_t *)out, d25u64); - out += 12; - vst1_u64((uint64_t *)out, d26u64); - out += 4; - vst1_u64((uint64_t *)out, d27u64); - out += 12; - q8s16 = vsubq_s16(q11s16, q8s16); - q9s16 = vsubq_s16(q10s16, q9s16); - - vst1_u64((uint64_t *)out, vreinterpret_u64_s16(vget_low_s16(q8s16))); - out += 4; - vst1_u64((uint64_t *)out, vreinterpret_u64_s16(vget_high_s16(q8s16))); - out += 12; - vst1_u64((uint64_t *)out, vreinterpret_u64_s16(vget_low_s16(q9s16))); - out += 4; - vst1_u64((uint64_t *)out, vreinterpret_u64_s16(vget_high_s16(q9s16))); - out += 12; - vst1_u64((uint64_t *)out, vreinterpret_u64_s16(vget_low_s16(q2s16))); - out += 4; - vst1_u64((uint64_t *)out, vreinterpret_u64_s16(vget_high_s16(q2s16))); - out += 12; - vst1_u64((uint64_t *)out, vreinterpret_u64_s16(vget_low_s16(q3s16))); - out += 4; - vst1_u64((uint64_t *)out, vreinterpret_u64_s16(vget_high_s16(q3s16))); - out += 12; - vst1_u64((uint64_t *)out, vreinterpret_u64_s16(vget_low_s16(q4s16))); - out += 4; - vst1_u64((uint64_t *)out, vreinterpret_u64_s16(vget_high_s16(q4s16))); - out += 12; - vst1_u64((uint64_t *)out, vreinterpret_u64_s16(vget_low_s16(q5s16))); - out += 4; - vst1_u64((uint64_t *)out, vreinterpret_u64_s16(vget_high_s16(q5s16))); - out += 12; - vst1_u64((uint64_t *)out, vreinterpret_u64_s16(vget_low_s16(q14s16))); - out += 4; - vst1_u64((uint64_t *)out, vreinterpret_u64_s16(vget_high_s16(q14s16))); - out += 12; - vst1_u64((uint64_t *)out, vreinterpret_u64_s16(vget_low_s16(q15s16))); - out += 4; - vst1_u64((uint64_t *)out, vreinterpret_u64_s16(vget_high_s16(q15s16))); - } - return; -} - -void vp9_idct16x16_10_add_neon_pass1( - int16_t *in, - int16_t *out, - int output_stride) { - int16x4_t d4s16; - int16x4_t d8s16, d9s16, d10s16, d11s16, d12s16, d13s16, d14s16, d15s16; - uint64x1_t d4u64, d5u64, d18u64, d19u64, d20u64, d21u64, d22u64, d23u64; - uint64x1_t d24u64, d25u64, d26u64, d27u64, d28u64, d29u64, d30u64, d31u64; - int16x8_t q0s16, q1s16, q2s16, q4s16, q5s16, q6s16, q7s16; - int16x8_t q8s16, q9s16, q10s16, q11s16, q12s16, q13s16, q14s16, q15s16; - int32x4_t q6s32, q9s32; - int32x4_t q10s32, q11s32, q12s32, q15s32; - int16x8x2_t q0x2s16; - - q0x2s16 = vld2q_s16(in); - q8s16 = q0x2s16.val[0]; - in += 16; - q0x2s16 = vld2q_s16(in); - q9s16 = q0x2s16.val[0]; - in += 16; - q0x2s16 = vld2q_s16(in); - q10s16 = q0x2s16.val[0]; - in += 16; - q0x2s16 = vld2q_s16(in); - q11s16 = q0x2s16.val[0]; - in += 16; - q0x2s16 = vld2q_s16(in); - q12s16 = q0x2s16.val[0]; - in += 16; - q0x2s16 = vld2q_s16(in); - q13s16 = q0x2s16.val[0]; - in += 16; - q0x2s16 = vld2q_s16(in); - q14s16 = q0x2s16.val[0]; - in += 16; - q0x2s16 = vld2q_s16(in); - q15s16 = q0x2s16.val[0]; - - TRANSPOSE8X8(&q8s16, &q9s16, &q10s16, &q11s16, - &q12s16, &q13s16, &q14s16, &q15s16); - - // stage 3 - q0s16 = vdupq_n_s16(cospi_28_64 * 2); - q1s16 = vdupq_n_s16(cospi_4_64 * 2); - - q4s16 = vqrdmulhq_s16(q9s16, q0s16); - q7s16 = vqrdmulhq_s16(q9s16, q1s16); - - // stage 4 - q1s16 = vdupq_n_s16(cospi_16_64 * 2); - d4s16 = vdup_n_s16(cospi_16_64); - - q8s16 = vqrdmulhq_s16(q8s16, q1s16); - - d8s16 = vget_low_s16(q4s16); - d9s16 = vget_high_s16(q4s16); - d14s16 = vget_low_s16(q7s16); - d15s16 = vget_high_s16(q7s16); - q9s32 = vmull_s16(d14s16, d4s16); - q10s32 = vmull_s16(d15s16, d4s16); - q12s32 = vmull_s16(d9s16, d4s16); - q11s32 = vmull_s16(d8s16, d4s16); - - q15s32 = vsubq_s32(q10s32, q12s32); - q6s32 = vsubq_s32(q9s32, q11s32); - q9s32 = vaddq_s32(q9s32, q11s32); - q10s32 = vaddq_s32(q10s32, q12s32); - - d11s16 = vqrshrn_n_s32(q15s32, 14); - d10s16 = vqrshrn_n_s32(q6s32, 14); - d12s16 = vqrshrn_n_s32(q9s32, 14); - d13s16 = vqrshrn_n_s32(q10s32, 14); - q5s16 = vcombine_s16(d10s16, d11s16); - q6s16 = vcombine_s16(d12s16, d13s16); - - // stage 6 - q2s16 = vaddq_s16(q8s16, q7s16); - q9s16 = vaddq_s16(q8s16, q6s16); - q10s16 = vaddq_s16(q8s16, q5s16); - q11s16 = vaddq_s16(q8s16, q4s16); - q12s16 = vsubq_s16(q8s16, q4s16); - q13s16 = vsubq_s16(q8s16, q5s16); - q14s16 = vsubq_s16(q8s16, q6s16); - q15s16 = vsubq_s16(q8s16, q7s16); - - d4u64 = vreinterpret_u64_s16(vget_low_s16(q2s16)); - d5u64 = vreinterpret_u64_s16(vget_high_s16(q2s16)); - d18u64 = vreinterpret_u64_s16(vget_low_s16(q9s16)); - d19u64 = vreinterpret_u64_s16(vget_high_s16(q9s16)); - d20u64 = vreinterpret_u64_s16(vget_low_s16(q10s16)); - d21u64 = vreinterpret_u64_s16(vget_high_s16(q10s16)); - d22u64 = vreinterpret_u64_s16(vget_low_s16(q11s16)); - d23u64 = vreinterpret_u64_s16(vget_high_s16(q11s16)); - d24u64 = vreinterpret_u64_s16(vget_low_s16(q12s16)); - d25u64 = vreinterpret_u64_s16(vget_high_s16(q12s16)); - d26u64 = vreinterpret_u64_s16(vget_low_s16(q13s16)); - d27u64 = vreinterpret_u64_s16(vget_high_s16(q13s16)); - d28u64 = vreinterpret_u64_s16(vget_low_s16(q14s16)); - d29u64 = vreinterpret_u64_s16(vget_high_s16(q14s16)); - d30u64 = vreinterpret_u64_s16(vget_low_s16(q15s16)); - d31u64 = vreinterpret_u64_s16(vget_high_s16(q15s16)); - - // store the data - output_stride >>= 1; // output_stride / 2, out is int16_t - vst1_u64((uint64_t *)out, d4u64); - out += output_stride; - vst1_u64((uint64_t *)out, d5u64); - out += output_stride; - vst1_u64((uint64_t *)out, d18u64); - out += output_stride; - vst1_u64((uint64_t *)out, d19u64); - out += output_stride; - vst1_u64((uint64_t *)out, d20u64); - out += output_stride; - vst1_u64((uint64_t *)out, d21u64); - out += output_stride; - vst1_u64((uint64_t *)out, d22u64); - out += output_stride; - vst1_u64((uint64_t *)out, d23u64); - out += output_stride; - vst1_u64((uint64_t *)out, d24u64); - out += output_stride; - vst1_u64((uint64_t *)out, d25u64); - out += output_stride; - vst1_u64((uint64_t *)out, d26u64); - out += output_stride; - vst1_u64((uint64_t *)out, d27u64); - out += output_stride; - vst1_u64((uint64_t *)out, d28u64); - out += output_stride; - vst1_u64((uint64_t *)out, d29u64); - out += output_stride; - vst1_u64((uint64_t *)out, d30u64); - out += output_stride; - vst1_u64((uint64_t *)out, d31u64); - return; -} - -void vp9_idct16x16_10_add_neon_pass2( - int16_t *src, - int16_t *out, - int16_t *pass1Output, - int16_t skip_adding, - uint8_t *dest, - int dest_stride) { - int16x4_t d0s16, d1s16, d2s16, d3s16, d4s16, d5s16, d6s16, d7s16; - int16x4_t d8s16, d9s16, d10s16, d11s16, d12s16, d13s16, d14s16, d15s16; - int16x4_t d20s16, d21s16, d22s16, d23s16; - int16x4_t d24s16, d25s16, d26s16, d27s16, d30s16, d31s16; - uint64x1_t d4u64, d5u64, d6u64, d7u64, d8u64, d9u64, d10u64, d11u64; - uint64x1_t d16u64, d17u64, d18u64, d19u64; - uint64x1_t d24u64, d25u64, d26u64, d27u64, d28u64, d29u64, d30u64, d31u64; - int16x8_t q0s16, q1s16, q2s16, q3s16, q4s16, q5s16, q6s16, q7s16; - int16x8_t q8s16, q9s16, q10s16, q11s16, q12s16, q13s16, q14s16, q15s16; - int32x4_t q0s32, q1s32, q2s32, q3s32, q4s32, q5s32, q6s32, q8s32, q9s32; - int32x4_t q10s32, q11s32, q12s32, q13s32; - int16x8x2_t q0x2s16; - (void)skip_adding; - (void)dest; - (void)dest_stride; - - q0x2s16 = vld2q_s16(src); - q8s16 = q0x2s16.val[0]; - src += 16; - q0x2s16 = vld2q_s16(src); - q9s16 = q0x2s16.val[0]; - src += 16; - q0x2s16 = vld2q_s16(src); - q10s16 = q0x2s16.val[0]; - src += 16; - q0x2s16 = vld2q_s16(src); - q11s16 = q0x2s16.val[0]; - src += 16; - q0x2s16 = vld2q_s16(src); - q12s16 = q0x2s16.val[0]; - src += 16; - q0x2s16 = vld2q_s16(src); - q13s16 = q0x2s16.val[0]; - src += 16; - q0x2s16 = vld2q_s16(src); - q14s16 = q0x2s16.val[0]; - src += 16; - q0x2s16 = vld2q_s16(src); - q15s16 = q0x2s16.val[0]; - - TRANSPOSE8X8(&q8s16, &q9s16, &q10s16, &q11s16, - &q12s16, &q13s16, &q14s16, &q15s16); - - // stage 3 - q6s16 = vdupq_n_s16(cospi_30_64 * 2); - q0s16 = vqrdmulhq_s16(q8s16, q6s16); - q6s16 = vdupq_n_s16(cospi_2_64 * 2); - q7s16 = vqrdmulhq_s16(q8s16, q6s16); - - q15s16 = vdupq_n_s16(-cospi_26_64 * 2); - q14s16 = vdupq_n_s16(cospi_6_64 * 2); - q3s16 = vqrdmulhq_s16(q9s16, q15s16); - q4s16 = vqrdmulhq_s16(q9s16, q14s16); - - // stage 4 - d0s16 = vget_low_s16(q0s16); - d1s16 = vget_high_s16(q0s16); - d6s16 = vget_low_s16(q3s16); - d7s16 = vget_high_s16(q3s16); - d8s16 = vget_low_s16(q4s16); - d9s16 = vget_high_s16(q4s16); - d14s16 = vget_low_s16(q7s16); - d15s16 = vget_high_s16(q7s16); - - d30s16 = vdup_n_s16(cospi_8_64); - d31s16 = vdup_n_s16(cospi_24_64); - - q12s32 = vmull_s16(d14s16, d31s16); - q5s32 = vmull_s16(d15s16, d31s16); - q2s32 = vmull_s16(d0s16, d31s16); - q11s32 = vmull_s16(d1s16, d31s16); - - q12s32 = vmlsl_s16(q12s32, d0s16, d30s16); - q5s32 = vmlsl_s16(q5s32, d1s16, d30s16); - q2s32 = vmlal_s16(q2s32, d14s16, d30s16); - q11s32 = vmlal_s16(q11s32, d15s16, d30s16); - - d2s16 = vqrshrn_n_s32(q12s32, 14); - d3s16 = vqrshrn_n_s32(q5s32, 14); - d12s16 = vqrshrn_n_s32(q2s32, 14); - d13s16 = vqrshrn_n_s32(q11s32, 14); - q1s16 = vcombine_s16(d2s16, d3s16); - q6s16 = vcombine_s16(d12s16, d13s16); - - d30s16 = vdup_n_s16(-cospi_8_64); - q10s32 = vmull_s16(d8s16, d30s16); - q13s32 = vmull_s16(d9s16, d30s16); - q8s32 = vmull_s16(d6s16, d30s16); - q9s32 = vmull_s16(d7s16, d30s16); - - q10s32 = vmlsl_s16(q10s32, d6s16, d31s16); - q13s32 = vmlsl_s16(q13s32, d7s16, d31s16); - q8s32 = vmlal_s16(q8s32, d8s16, d31s16); - q9s32 = vmlal_s16(q9s32, d9s16, d31s16); - - d4s16 = vqrshrn_n_s32(q10s32, 14); - d5s16 = vqrshrn_n_s32(q13s32, 14); - d10s16 = vqrshrn_n_s32(q8s32, 14); - d11s16 = vqrshrn_n_s32(q9s32, 14); - q2s16 = vcombine_s16(d4s16, d5s16); - q5s16 = vcombine_s16(d10s16, d11s16); - - // stage 5 - q8s16 = vaddq_s16(q0s16, q3s16); - q9s16 = vaddq_s16(q1s16, q2s16); - q10s16 = vsubq_s16(q1s16, q2s16); - q11s16 = vsubq_s16(q0s16, q3s16); - q12s16 = vsubq_s16(q7s16, q4s16); - q13s16 = vsubq_s16(q6s16, q5s16); - q14s16 = vaddq_s16(q6s16, q5s16); - q15s16 = vaddq_s16(q7s16, q4s16); - - // stage 6 - d20s16 = vget_low_s16(q10s16); - d21s16 = vget_high_s16(q10s16); - d22s16 = vget_low_s16(q11s16); - d23s16 = vget_high_s16(q11s16); - d24s16 = vget_low_s16(q12s16); - d25s16 = vget_high_s16(q12s16); - d26s16 = vget_low_s16(q13s16); - d27s16 = vget_high_s16(q13s16); - - d14s16 = vdup_n_s16(cospi_16_64); - q3s32 = vmull_s16(d26s16, d14s16); - q4s32 = vmull_s16(d27s16, d14s16); - q0s32 = vmull_s16(d20s16, d14s16); - q1s32 = vmull_s16(d21s16, d14s16); - - q5s32 = vsubq_s32(q3s32, q0s32); - q6s32 = vsubq_s32(q4s32, q1s32); - q0s32 = vaddq_s32(q3s32, q0s32); - q4s32 = vaddq_s32(q4s32, q1s32); - - d4s16 = vqrshrn_n_s32(q5s32, 14); - d5s16 = vqrshrn_n_s32(q6s32, 14); - d10s16 = vqrshrn_n_s32(q0s32, 14); - d11s16 = vqrshrn_n_s32(q4s32, 14); - q2s16 = vcombine_s16(d4s16, d5s16); - q5s16 = vcombine_s16(d10s16, d11s16); - - q0s32 = vmull_s16(d22s16, d14s16); - q1s32 = vmull_s16(d23s16, d14s16); - q13s32 = vmull_s16(d24s16, d14s16); - q6s32 = vmull_s16(d25s16, d14s16); - - q10s32 = vsubq_s32(q13s32, q0s32); - q4s32 = vsubq_s32(q6s32, q1s32); - q13s32 = vaddq_s32(q13s32, q0s32); - q6s32 = vaddq_s32(q6s32, q1s32); - - d6s16 = vqrshrn_n_s32(q10s32, 14); - d7s16 = vqrshrn_n_s32(q4s32, 14); - d8s16 = vqrshrn_n_s32(q13s32, 14); - d9s16 = vqrshrn_n_s32(q6s32, 14); - q3s16 = vcombine_s16(d6s16, d7s16); - q4s16 = vcombine_s16(d8s16, d9s16); - - // stage 7 - q0s16 = vld1q_s16(pass1Output); - pass1Output += 8; - q1s16 = vld1q_s16(pass1Output); - pass1Output += 8; - q12s16 = vaddq_s16(q0s16, q15s16); - q13s16 = vaddq_s16(q1s16, q14s16); - d24u64 = vreinterpret_u64_s16(vget_low_s16(q12s16)); - d25u64 = vreinterpret_u64_s16(vget_high_s16(q12s16)); - d26u64 = vreinterpret_u64_s16(vget_low_s16(q13s16)); - d27u64 = vreinterpret_u64_s16(vget_high_s16(q13s16)); - vst1_u64((uint64_t *)out, d24u64); - out += 4; - vst1_u64((uint64_t *)out, d25u64); - out += 12; - vst1_u64((uint64_t *)out, d26u64); - out += 4; - vst1_u64((uint64_t *)out, d27u64); - out += 12; - q14s16 = vsubq_s16(q1s16, q14s16); - q15s16 = vsubq_s16(q0s16, q15s16); - - q10s16 = vld1q_s16(pass1Output); - pass1Output += 8; - q11s16 = vld1q_s16(pass1Output); - pass1Output += 8; - q12s16 = vaddq_s16(q10s16, q5s16); - q13s16 = vaddq_s16(q11s16, q4s16); - d24u64 = vreinterpret_u64_s16(vget_low_s16(q12s16)); - d25u64 = vreinterpret_u64_s16(vget_high_s16(q12s16)); - d26u64 = vreinterpret_u64_s16(vget_low_s16(q13s16)); - d27u64 = vreinterpret_u64_s16(vget_high_s16(q13s16)); - vst1_u64((uint64_t *)out, d24u64); - out += 4; - vst1_u64((uint64_t *)out, d25u64); - out += 12; - vst1_u64((uint64_t *)out, d26u64); - out += 4; - vst1_u64((uint64_t *)out, d27u64); - out += 12; - q4s16 = vsubq_s16(q11s16, q4s16); - q5s16 = vsubq_s16(q10s16, q5s16); - - q0s16 = vld1q_s16(pass1Output); - pass1Output += 8; - q1s16 = vld1q_s16(pass1Output); - pass1Output += 8; - q12s16 = vaddq_s16(q0s16, q3s16); - q13s16 = vaddq_s16(q1s16, q2s16); - d24u64 = vreinterpret_u64_s16(vget_low_s16(q12s16)); - d25u64 = vreinterpret_u64_s16(vget_high_s16(q12s16)); - d26u64 = vreinterpret_u64_s16(vget_low_s16(q13s16)); - d27u64 = vreinterpret_u64_s16(vget_high_s16(q13s16)); - vst1_u64((uint64_t *)out, d24u64); - out += 4; - vst1_u64((uint64_t *)out, d25u64); - out += 12; - vst1_u64((uint64_t *)out, d26u64); - out += 4; - vst1_u64((uint64_t *)out, d27u64); - out += 12; - q2s16 = vsubq_s16(q1s16, q2s16); - q3s16 = vsubq_s16(q0s16, q3s16); - - q10s16 = vld1q_s16(pass1Output); - pass1Output += 8; - q11s16 = vld1q_s16(pass1Output); - q12s16 = vaddq_s16(q10s16, q9s16); - q13s16 = vaddq_s16(q11s16, q8s16); - d24u64 = vreinterpret_u64_s16(vget_low_s16(q12s16)); - d25u64 = vreinterpret_u64_s16(vget_high_s16(q12s16)); - d26u64 = vreinterpret_u64_s16(vget_low_s16(q13s16)); - d27u64 = vreinterpret_u64_s16(vget_high_s16(q13s16)); - vst1_u64((uint64_t *)out, d24u64); - out += 4; - vst1_u64((uint64_t *)out, d25u64); - out += 12; - vst1_u64((uint64_t *)out, d26u64); - out += 4; - vst1_u64((uint64_t *)out, d27u64); - out += 12; - q8s16 = vsubq_s16(q11s16, q8s16); - q9s16 = vsubq_s16(q10s16, q9s16); - - d4u64 = vreinterpret_u64_s16(vget_low_s16(q2s16)); - d5u64 = vreinterpret_u64_s16(vget_high_s16(q2s16)); - d6u64 = vreinterpret_u64_s16(vget_low_s16(q3s16)); - d7u64 = vreinterpret_u64_s16(vget_high_s16(q3s16)); - d8u64 = vreinterpret_u64_s16(vget_low_s16(q4s16)); - d9u64 = vreinterpret_u64_s16(vget_high_s16(q4s16)); - d10u64 = vreinterpret_u64_s16(vget_low_s16(q5s16)); - d11u64 = vreinterpret_u64_s16(vget_high_s16(q5s16)); - d16u64 = vreinterpret_u64_s16(vget_low_s16(q8s16)); - d17u64 = vreinterpret_u64_s16(vget_high_s16(q8s16)); - d18u64 = vreinterpret_u64_s16(vget_low_s16(q9s16)); - d19u64 = vreinterpret_u64_s16(vget_high_s16(q9s16)); - d28u64 = vreinterpret_u64_s16(vget_low_s16(q14s16)); - d29u64 = vreinterpret_u64_s16(vget_high_s16(q14s16)); - d30u64 = vreinterpret_u64_s16(vget_low_s16(q15s16)); - d31u64 = vreinterpret_u64_s16(vget_high_s16(q15s16)); - - vst1_u64((uint64_t *)out, d16u64); - out += 4; - vst1_u64((uint64_t *)out, d17u64); - out += 12; - vst1_u64((uint64_t *)out, d18u64); - out += 4; - vst1_u64((uint64_t *)out, d19u64); - out += 12; - vst1_u64((uint64_t *)out, d4u64); - out += 4; - vst1_u64((uint64_t *)out, d5u64); - out += 12; - vst1_u64((uint64_t *)out, d6u64); - out += 4; - vst1_u64((uint64_t *)out, d7u64); - out += 12; - vst1_u64((uint64_t *)out, d8u64); - out += 4; - vst1_u64((uint64_t *)out, d9u64); - out += 12; - vst1_u64((uint64_t *)out, d10u64); - out += 4; - vst1_u64((uint64_t *)out, d11u64); - out += 12; - vst1_u64((uint64_t *)out, d28u64); - out += 4; - vst1_u64((uint64_t *)out, d29u64); - out += 12; - vst1_u64((uint64_t *)out, d30u64); - out += 4; - vst1_u64((uint64_t *)out, d31u64); - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct16x16_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct16x16_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct16x16_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct16x16_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,186 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" - -void vp9_idct16x16_256_add_neon_pass1(const int16_t *input, - int16_t *output, - int output_stride); -void vp9_idct16x16_256_add_neon_pass2(const int16_t *src, - int16_t *output, - int16_t *pass1Output, - int16_t skip_adding, - uint8_t *dest, - int dest_stride); -void vp9_idct16x16_10_add_neon_pass1(const int16_t *input, - int16_t *output, - int output_stride); -void vp9_idct16x16_10_add_neon_pass2(const int16_t *src, - int16_t *output, - int16_t *pass1Output, - int16_t skip_adding, - uint8_t *dest, - int dest_stride); - -#if HAVE_NEON_ASM -/* For ARM NEON, d8-d15 are callee-saved registers, and need to be saved. */ -extern void vp9_push_neon(int64_t *store); -extern void vp9_pop_neon(int64_t *store); -#endif // HAVE_NEON_ASM - -void vp9_idct16x16_256_add_neon(const int16_t *input, - uint8_t *dest, int dest_stride) { -#if HAVE_NEON_ASM - int64_t store_reg[8]; -#endif - int16_t pass1_output[16*16] = {0}; - int16_t row_idct_output[16*16] = {0}; - -#if HAVE_NEON_ASM - // save d8-d15 register values. - vp9_push_neon(store_reg); -#endif - - /* Parallel idct on the upper 8 rows */ - // First pass processes even elements 0, 2, 4, 6, 8, 10, 12, 14 and save the - // stage 6 result in pass1_output. - vp9_idct16x16_256_add_neon_pass1(input, pass1_output, 8); - - // Second pass processes odd elements 1, 3, 5, 7, 9, 11, 13, 15 and combines - // with result in pass1(pass1_output) to calculate final result in stage 7 - // which will be saved into row_idct_output. - vp9_idct16x16_256_add_neon_pass2(input+1, - row_idct_output, - pass1_output, - 0, - dest, - dest_stride); - - /* Parallel idct on the lower 8 rows */ - // First pass processes even elements 0, 2, 4, 6, 8, 10, 12, 14 and save the - // stage 6 result in pass1_output. - vp9_idct16x16_256_add_neon_pass1(input+8*16, pass1_output, 8); - - // Second pass processes odd elements 1, 3, 5, 7, 9, 11, 13, 15 and combines - // with result in pass1(pass1_output) to calculate final result in stage 7 - // which will be saved into row_idct_output. - vp9_idct16x16_256_add_neon_pass2(input+8*16+1, - row_idct_output+8, - pass1_output, - 0, - dest, - dest_stride); - - /* Parallel idct on the left 8 columns */ - // First pass processes even elements 0, 2, 4, 6, 8, 10, 12, 14 and save the - // stage 6 result in pass1_output. - vp9_idct16x16_256_add_neon_pass1(row_idct_output, pass1_output, 8); - - // Second pass processes odd elements 1, 3, 5, 7, 9, 11, 13, 15 and combines - // with result in pass1(pass1_output) to calculate final result in stage 7. - // Then add the result to the destination data. - vp9_idct16x16_256_add_neon_pass2(row_idct_output+1, - row_idct_output, - pass1_output, - 1, - dest, - dest_stride); - - /* Parallel idct on the right 8 columns */ - // First pass processes even elements 0, 2, 4, 6, 8, 10, 12, 14 and save the - // stage 6 result in pass1_output. - vp9_idct16x16_256_add_neon_pass1(row_idct_output+8*16, pass1_output, 8); - - // Second pass processes odd elements 1, 3, 5, 7, 9, 11, 13, 15 and combines - // with result in pass1(pass1_output) to calculate final result in stage 7. - // Then add the result to the destination data. - vp9_idct16x16_256_add_neon_pass2(row_idct_output+8*16+1, - row_idct_output+8, - pass1_output, - 1, - dest+8, - dest_stride); - -#if HAVE_NEON_ASM - // restore d8-d15 register values. - vp9_pop_neon(store_reg); -#endif - - return; -} - -void vp9_idct16x16_10_add_neon(const int16_t *input, - uint8_t *dest, int dest_stride) { -#if HAVE_NEON_ASM - int64_t store_reg[8]; -#endif - int16_t pass1_output[16*16] = {0}; - int16_t row_idct_output[16*16] = {0}; - -#if HAVE_NEON_ASM - // save d8-d15 register values. - vp9_push_neon(store_reg); -#endif - - /* Parallel idct on the upper 8 rows */ - // First pass processes even elements 0, 2, 4, 6, 8, 10, 12, 14 and save the - // stage 6 result in pass1_output. - vp9_idct16x16_10_add_neon_pass1(input, pass1_output, 8); - - // Second pass processes odd elements 1, 3, 5, 7, 9, 11, 13, 15 and combines - // with result in pass1(pass1_output) to calculate final result in stage 7 - // which will be saved into row_idct_output. - vp9_idct16x16_10_add_neon_pass2(input+1, - row_idct_output, - pass1_output, - 0, - dest, - dest_stride); - - /* Skip Parallel idct on the lower 8 rows as they are all 0s */ - - /* Parallel idct on the left 8 columns */ - // First pass processes even elements 0, 2, 4, 6, 8, 10, 12, 14 and save the - // stage 6 result in pass1_output. - vp9_idct16x16_256_add_neon_pass1(row_idct_output, pass1_output, 8); - - // Second pass processes odd elements 1, 3, 5, 7, 9, 11, 13, 15 and combines - // with result in pass1(pass1_output) to calculate final result in stage 7. - // Then add the result to the destination data. - vp9_idct16x16_256_add_neon_pass2(row_idct_output+1, - row_idct_output, - pass1_output, - 1, - dest, - dest_stride); - - /* Parallel idct on the right 8 columns */ - // First pass processes even elements 0, 2, 4, 6, 8, 10, 12, 14 and save the - // stage 6 result in pass1_output. - vp9_idct16x16_256_add_neon_pass1(row_idct_output+8*16, pass1_output, 8); - - // Second pass processes odd elements 1, 3, 5, 7, 9, 11, 13, 15 and combines - // with result in pass1(pass1_output) to calculate final result in stage 7. - // Then add the result to the destination data. - vp9_idct16x16_256_add_neon_pass2(row_idct_output+8*16+1, - row_idct_output+8, - pass1_output, - 1, - dest+8, - dest_stride); - -#if HAVE_NEON_ASM - // restore d8-d15 register values. - vp9_pop_neon(store_reg); -#endif - - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct32x32_1_add_neon_asm.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct32x32_1_add_neon_asm.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct32x32_1_add_neon_asm.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct32x32_1_add_neon_asm.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,144 +0,0 @@ -; -; Copyright (c) 2013 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license and patent -; grant that can be found in the LICENSE file in the root of the source -; tree. All contributing project authors may be found in the AUTHORS -; file in the root of the source tree. -; - - EXPORT |vp9_idct32x32_1_add_neon| - ARM - REQUIRE8 - PRESERVE8 - - AREA ||.text||, CODE, READONLY, ALIGN=2 - - ;TODO(hkuang): put the following macros in a seperate - ;file so other idct function could also use them. - MACRO - LD_16x8 $src, $stride - vld1.8 {q8}, [$src], $stride - vld1.8 {q9}, [$src], $stride - vld1.8 {q10}, [$src], $stride - vld1.8 {q11}, [$src], $stride - vld1.8 {q12}, [$src], $stride - vld1.8 {q13}, [$src], $stride - vld1.8 {q14}, [$src], $stride - vld1.8 {q15}, [$src], $stride - MEND - - MACRO - ADD_DIFF_16x8 $diff - vqadd.u8 q8, q8, $diff - vqadd.u8 q9, q9, $diff - vqadd.u8 q10, q10, $diff - vqadd.u8 q11, q11, $diff - vqadd.u8 q12, q12, $diff - vqadd.u8 q13, q13, $diff - vqadd.u8 q14, q14, $diff - vqadd.u8 q15, q15, $diff - MEND - - MACRO - SUB_DIFF_16x8 $diff - vqsub.u8 q8, q8, $diff - vqsub.u8 q9, q9, $diff - vqsub.u8 q10, q10, $diff - vqsub.u8 q11, q11, $diff - vqsub.u8 q12, q12, $diff - vqsub.u8 q13, q13, $diff - vqsub.u8 q14, q14, $diff - vqsub.u8 q15, q15, $diff - MEND - - MACRO - ST_16x8 $dst, $stride - vst1.8 {q8}, [$dst], $stride - vst1.8 {q9}, [$dst], $stride - vst1.8 {q10},[$dst], $stride - vst1.8 {q11},[$dst], $stride - vst1.8 {q12},[$dst], $stride - vst1.8 {q13},[$dst], $stride - vst1.8 {q14},[$dst], $stride - vst1.8 {q15},[$dst], $stride - MEND - -;void vp9_idct32x32_1_add_neon(int16_t *input, uint8_t *dest, -; int dest_stride) -; -; r0 int16_t input -; r1 uint8_t *dest -; r2 int dest_stride - -|vp9_idct32x32_1_add_neon| PROC - push {lr} - pld [r1] - add r3, r1, #16 ; r3 dest + 16 for second loop - ldrsh r0, [r0] - - ; generate cospi_16_64 = 11585 - mov r12, #0x2d00 - add r12, #0x41 - - ; out = dct_const_round_shift(input[0] * cospi_16_64) - mul r0, r0, r12 ; input[0] * cospi_16_64 - add r0, r0, #0x2000 ; +(1 << ((DCT_CONST_BITS) - 1)) - asr r0, r0, #14 ; >> DCT_CONST_BITS - - ; out = dct_const_round_shift(out * cospi_16_64) - mul r0, r0, r12 ; out * cospi_16_64 - mov r12, r1 ; save dest - add r0, r0, #0x2000 ; +(1 << ((DCT_CONST_BITS) - 1)) - asr r0, r0, #14 ; >> DCT_CONST_BITS - - ; a1 = ROUND_POWER_OF_TWO(out, 6) - add r0, r0, #32 ; + (1 <<((6) - 1)) - asrs r0, r0, #6 ; >> 6 - bge diff_positive_32_32 - -diff_negative_32_32 - neg r0, r0 - usat r0, #8, r0 - vdup.u8 q0, r0 - mov r0, #4 - -diff_negative_32_32_loop - sub r0, #1 - LD_16x8 r1, r2 - SUB_DIFF_16x8 q0 - ST_16x8 r12, r2 - - LD_16x8 r1, r2 - SUB_DIFF_16x8 q0 - ST_16x8 r12, r2 - cmp r0, #2 - moveq r1, r3 - moveq r12, r3 - cmp r0, #0 - bne diff_negative_32_32_loop - pop {pc} - -diff_positive_32_32 - usat r0, #8, r0 - vdup.u8 q0, r0 - mov r0, #4 - -diff_positive_32_32_loop - sub r0, #1 - LD_16x8 r1, r2 - ADD_DIFF_16x8 q0 - ST_16x8 r12, r2 - - LD_16x8 r1, r2 - ADD_DIFF_16x8 q0 - ST_16x8 r12, r2 - cmp r0, #2 - moveq r1, r3 - moveq r12, r3 - cmp r0, #0 - bne diff_positive_32_32_loop - pop {pc} - - ENDP ; |vp9_idct32x32_1_add_neon| - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct32x32_1_add_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct32x32_1_add_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct32x32_1_add_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct32x32_1_add_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,163 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "vp9/common/vp9_idct.h" - -#include "./vpx_config.h" - -static INLINE void LD_16x8( - uint8_t *d, - int d_stride, - uint8x16_t *q8u8, - uint8x16_t *q9u8, - uint8x16_t *q10u8, - uint8x16_t *q11u8, - uint8x16_t *q12u8, - uint8x16_t *q13u8, - uint8x16_t *q14u8, - uint8x16_t *q15u8) { - *q8u8 = vld1q_u8(d); - d += d_stride; - *q9u8 = vld1q_u8(d); - d += d_stride; - *q10u8 = vld1q_u8(d); - d += d_stride; - *q11u8 = vld1q_u8(d); - d += d_stride; - *q12u8 = vld1q_u8(d); - d += d_stride; - *q13u8 = vld1q_u8(d); - d += d_stride; - *q14u8 = vld1q_u8(d); - d += d_stride; - *q15u8 = vld1q_u8(d); - return; -} - -static INLINE void ADD_DIFF_16x8( - uint8x16_t qdiffu8, - uint8x16_t *q8u8, - uint8x16_t *q9u8, - uint8x16_t *q10u8, - uint8x16_t *q11u8, - uint8x16_t *q12u8, - uint8x16_t *q13u8, - uint8x16_t *q14u8, - uint8x16_t *q15u8) { - *q8u8 = vqaddq_u8(*q8u8, qdiffu8); - *q9u8 = vqaddq_u8(*q9u8, qdiffu8); - *q10u8 = vqaddq_u8(*q10u8, qdiffu8); - *q11u8 = vqaddq_u8(*q11u8, qdiffu8); - *q12u8 = vqaddq_u8(*q12u8, qdiffu8); - *q13u8 = vqaddq_u8(*q13u8, qdiffu8); - *q14u8 = vqaddq_u8(*q14u8, qdiffu8); - *q15u8 = vqaddq_u8(*q15u8, qdiffu8); - return; -} - -static INLINE void SUB_DIFF_16x8( - uint8x16_t qdiffu8, - uint8x16_t *q8u8, - uint8x16_t *q9u8, - uint8x16_t *q10u8, - uint8x16_t *q11u8, - uint8x16_t *q12u8, - uint8x16_t *q13u8, - uint8x16_t *q14u8, - uint8x16_t *q15u8) { - *q8u8 = vqsubq_u8(*q8u8, qdiffu8); - *q9u8 = vqsubq_u8(*q9u8, qdiffu8); - *q10u8 = vqsubq_u8(*q10u8, qdiffu8); - *q11u8 = vqsubq_u8(*q11u8, qdiffu8); - *q12u8 = vqsubq_u8(*q12u8, qdiffu8); - *q13u8 = vqsubq_u8(*q13u8, qdiffu8); - *q14u8 = vqsubq_u8(*q14u8, qdiffu8); - *q15u8 = vqsubq_u8(*q15u8, qdiffu8); - return; -} - -static INLINE void ST_16x8( - uint8_t *d, - int d_stride, - uint8x16_t *q8u8, - uint8x16_t *q9u8, - uint8x16_t *q10u8, - uint8x16_t *q11u8, - uint8x16_t *q12u8, - uint8x16_t *q13u8, - uint8x16_t *q14u8, - uint8x16_t *q15u8) { - vst1q_u8(d, *q8u8); - d += d_stride; - vst1q_u8(d, *q9u8); - d += d_stride; - vst1q_u8(d, *q10u8); - d += d_stride; - vst1q_u8(d, *q11u8); - d += d_stride; - vst1q_u8(d, *q12u8); - d += d_stride; - vst1q_u8(d, *q13u8); - d += d_stride; - vst1q_u8(d, *q14u8); - d += d_stride; - vst1q_u8(d, *q15u8); - return; -} - -void vp9_idct32x32_1_add_neon( - int16_t *input, - uint8_t *dest, - int dest_stride) { - uint8x16_t q0u8, q8u8, q9u8, q10u8, q11u8, q12u8, q13u8, q14u8, q15u8; - int i, j, dest_stride8; - uint8_t *d; - int16_t a1, cospi_16_64 = 11585; - int16_t out = dct_const_round_shift(input[0] * cospi_16_64); - - out = dct_const_round_shift(out * cospi_16_64); - a1 = ROUND_POWER_OF_TWO(out, 6); - - dest_stride8 = dest_stride * 8; - if (a1 >= 0) { // diff_positive_32_32 - a1 = a1 < 0 ? 0 : a1 > 255 ? 255 : a1; - q0u8 = vdupq_n_u8(a1); - for (i = 0; i < 2; i++, dest += 16) { // diff_positive_32_32_loop - d = dest; - for (j = 0; j < 4; j++) { - LD_16x8(d, dest_stride, &q8u8, &q9u8, &q10u8, &q11u8, - &q12u8, &q13u8, &q14u8, &q15u8); - ADD_DIFF_16x8(q0u8, &q8u8, &q9u8, &q10u8, &q11u8, - &q12u8, &q13u8, &q14u8, &q15u8); - ST_16x8(d, dest_stride, &q8u8, &q9u8, &q10u8, &q11u8, - &q12u8, &q13u8, &q14u8, &q15u8); - d += dest_stride8; - } - } - } else { // diff_negative_32_32 - a1 = -a1; - a1 = a1 < 0 ? 0 : a1 > 255 ? 255 : a1; - q0u8 = vdupq_n_u8(a1); - for (i = 0; i < 2; i++, dest += 16) { // diff_negative_32_32_loop - d = dest; - for (j = 0; j < 4; j++) { - LD_16x8(d, dest_stride, &q8u8, &q9u8, &q10u8, &q11u8, - &q12u8, &q13u8, &q14u8, &q15u8); - SUB_DIFF_16x8(q0u8, &q8u8, &q9u8, &q10u8, &q11u8, - &q12u8, &q13u8, &q14u8, &q15u8); - ST_16x8(d, dest_stride, &q8u8, &q9u8, &q10u8, &q11u8, - &q12u8, &q13u8, &q14u8, &q15u8); - d += dest_stride8; - } - } - } - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct32x32_add_neon_asm.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct32x32_add_neon_asm.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct32x32_add_neon_asm.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct32x32_add_neon_asm.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,1299 +0,0 @@ -; -; Copyright (c) 2013 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - -;TODO(cd): adjust these constant to be able to use vqdmulh for faster -; dct_const_round_shift(a * b) within butterfly calculations. -cospi_1_64 EQU 16364 -cospi_2_64 EQU 16305 -cospi_3_64 EQU 16207 -cospi_4_64 EQU 16069 -cospi_5_64 EQU 15893 -cospi_6_64 EQU 15679 -cospi_7_64 EQU 15426 -cospi_8_64 EQU 15137 -cospi_9_64 EQU 14811 -cospi_10_64 EQU 14449 -cospi_11_64 EQU 14053 -cospi_12_64 EQU 13623 -cospi_13_64 EQU 13160 -cospi_14_64 EQU 12665 -cospi_15_64 EQU 12140 -cospi_16_64 EQU 11585 -cospi_17_64 EQU 11003 -cospi_18_64 EQU 10394 -cospi_19_64 EQU 9760 -cospi_20_64 EQU 9102 -cospi_21_64 EQU 8423 -cospi_22_64 EQU 7723 -cospi_23_64 EQU 7005 -cospi_24_64 EQU 6270 -cospi_25_64 EQU 5520 -cospi_26_64 EQU 4756 -cospi_27_64 EQU 3981 -cospi_28_64 EQU 3196 -cospi_29_64 EQU 2404 -cospi_30_64 EQU 1606 -cospi_31_64 EQU 804 - - - EXPORT |vp9_idct32x32_1024_add_neon| - ARM - REQUIRE8 - PRESERVE8 - - AREA ||.text||, CODE, READONLY, ALIGN=2 - - AREA Block, CODE, READONLY - - ; -------------------------------------------------------------------------- - ; Load from transposed_buffer - ; q13 = transposed_buffer[first_offset] - ; q14 = transposed_buffer[second_offset] - ; for proper address calculation, the last offset used when manipulating - ; transposed_buffer must be passed in. use 0 for first use. - MACRO - LOAD_FROM_TRANSPOSED $prev_offset, $first_offset, $second_offset - ; address calculation with proper stride and loading - add r0, #($first_offset - $prev_offset )*8*2 - vld1.s16 {q14}, [r0] - add r0, #($second_offset - $first_offset)*8*2 - vld1.s16 {q13}, [r0] - ; (used) two registers (q14, q13) - MEND - ; -------------------------------------------------------------------------- - ; Load from output (used as temporary storage) - ; reg1 = output[first_offset] - ; reg2 = output[second_offset] - ; for proper address calculation, the last offset used when manipulating - ; output, whether reading or storing) must be passed in. use 0 for first - ; use. - MACRO - LOAD_FROM_OUTPUT $prev_offset, $first_offset, $second_offset, $reg1, $reg2 - ; address calculation with proper stride and loading - add r1, #($first_offset - $prev_offset )*32*2 - vld1.s16 {$reg1}, [r1] - add r1, #($second_offset - $first_offset)*32*2 - vld1.s16 {$reg2}, [r1] - ; (used) two registers ($reg1, $reg2) - MEND - ; -------------------------------------------------------------------------- - ; Store into output (sometimes as as temporary storage) - ; output[first_offset] = reg1 - ; output[second_offset] = reg2 - ; for proper address calculation, the last offset used when manipulating - ; output, whether reading or storing) must be passed in. use 0 for first - ; use. - MACRO - STORE_IN_OUTPUT $prev_offset, $first_offset, $second_offset, $reg1, $reg2 - ; address calculation with proper stride and storing - add r1, #($first_offset - $prev_offset )*32*2 - vst1.16 {$reg1}, [r1] - add r1, #($second_offset - $first_offset)*32*2 - vst1.16 {$reg2}, [r1] - MEND - ; -------------------------------------------------------------------------- - ; Combine-add results with current destination content - ; q6-q9 contain the results (out[j * 32 + 0-31]) - MACRO - STORE_COMBINE_CENTER_RESULTS - ; load dest[j * dest_stride + 0-31] - vld1.s16 {d8}, [r10], r2 - vld1.s16 {d11}, [r9], r11 - vld1.s16 {d9}, [r10] - vld1.s16 {d10}, [r9] - ; ROUND_POWER_OF_TWO - vrshr.s16 q7, q7, #6 - vrshr.s16 q8, q8, #6 - vrshr.s16 q9, q9, #6 - vrshr.s16 q6, q6, #6 - ; add to dest[j * dest_stride + 0-31] - vaddw.u8 q7, q7, d9 - vaddw.u8 q8, q8, d10 - vaddw.u8 q9, q9, d11 - vaddw.u8 q6, q6, d8 - ; clip pixel - vqmovun.s16 d9, q7 - vqmovun.s16 d10, q8 - vqmovun.s16 d11, q9 - vqmovun.s16 d8, q6 - ; store back into dest[j * dest_stride + 0-31] - vst1.16 {d9}, [r10], r11 - vst1.16 {d10}, [r9], r2 - vst1.16 {d8}, [r10] - vst1.16 {d11}, [r9] - ; update pointers (by dest_stride * 2) - sub r9, r9, r2, lsl #1 - add r10, r10, r2, lsl #1 - MEND - ; -------------------------------------------------------------------------- - ; Combine-add results with current destination content - ; q6-q9 contain the results (out[j * 32 + 0-31]) - MACRO - STORE_COMBINE_CENTER_RESULTS_LAST - ; load dest[j * dest_stride + 0-31] - vld1.s16 {d8}, [r10], r2 - vld1.s16 {d11}, [r9], r11 - vld1.s16 {d9}, [r10] - vld1.s16 {d10}, [r9] - ; ROUND_POWER_OF_TWO - vrshr.s16 q7, q7, #6 - vrshr.s16 q8, q8, #6 - vrshr.s16 q9, q9, #6 - vrshr.s16 q6, q6, #6 - ; add to dest[j * dest_stride + 0-31] - vaddw.u8 q7, q7, d9 - vaddw.u8 q8, q8, d10 - vaddw.u8 q9, q9, d11 - vaddw.u8 q6, q6, d8 - ; clip pixel - vqmovun.s16 d9, q7 - vqmovun.s16 d10, q8 - vqmovun.s16 d11, q9 - vqmovun.s16 d8, q6 - ; store back into dest[j * dest_stride + 0-31] - vst1.16 {d9}, [r10], r11 - vst1.16 {d10}, [r9], r2 - vst1.16 {d8}, [r10]! - vst1.16 {d11}, [r9]! - ; update pointers (by dest_stride * 2) - sub r9, r9, r2, lsl #1 - add r10, r10, r2, lsl #1 - MEND - ; -------------------------------------------------------------------------- - ; Combine-add results with current destination content - ; q4-q7 contain the results (out[j * 32 + 0-31]) - MACRO - STORE_COMBINE_EXTREME_RESULTS - ; load dest[j * dest_stride + 0-31] - vld1.s16 {d4}, [r7], r2 - vld1.s16 {d7}, [r6], r11 - vld1.s16 {d5}, [r7] - vld1.s16 {d6}, [r6] - ; ROUND_POWER_OF_TWO - vrshr.s16 q5, q5, #6 - vrshr.s16 q6, q6, #6 - vrshr.s16 q7, q7, #6 - vrshr.s16 q4, q4, #6 - ; add to dest[j * dest_stride + 0-31] - vaddw.u8 q5, q5, d5 - vaddw.u8 q6, q6, d6 - vaddw.u8 q7, q7, d7 - vaddw.u8 q4, q4, d4 - ; clip pixel - vqmovun.s16 d5, q5 - vqmovun.s16 d6, q6 - vqmovun.s16 d7, q7 - vqmovun.s16 d4, q4 - ; store back into dest[j * dest_stride + 0-31] - vst1.16 {d5}, [r7], r11 - vst1.16 {d6}, [r6], r2 - vst1.16 {d7}, [r6] - vst1.16 {d4}, [r7] - ; update pointers (by dest_stride * 2) - sub r6, r6, r2, lsl #1 - add r7, r7, r2, lsl #1 - MEND - ; -------------------------------------------------------------------------- - ; Combine-add results with current destination content - ; q4-q7 contain the results (out[j * 32 + 0-31]) - MACRO - STORE_COMBINE_EXTREME_RESULTS_LAST - ; load dest[j * dest_stride + 0-31] - vld1.s16 {d4}, [r7], r2 - vld1.s16 {d7}, [r6], r11 - vld1.s16 {d5}, [r7] - vld1.s16 {d6}, [r6] - ; ROUND_POWER_OF_TWO - vrshr.s16 q5, q5, #6 - vrshr.s16 q6, q6, #6 - vrshr.s16 q7, q7, #6 - vrshr.s16 q4, q4, #6 - ; add to dest[j * dest_stride + 0-31] - vaddw.u8 q5, q5, d5 - vaddw.u8 q6, q6, d6 - vaddw.u8 q7, q7, d7 - vaddw.u8 q4, q4, d4 - ; clip pixel - vqmovun.s16 d5, q5 - vqmovun.s16 d6, q6 - vqmovun.s16 d7, q7 - vqmovun.s16 d4, q4 - ; store back into dest[j * dest_stride + 0-31] - vst1.16 {d5}, [r7], r11 - vst1.16 {d6}, [r6], r2 - vst1.16 {d7}, [r6]! - vst1.16 {d4}, [r7]! - ; update pointers (by dest_stride * 2) - sub r6, r6, r2, lsl #1 - add r7, r7, r2, lsl #1 - MEND - ; -------------------------------------------------------------------------- - ; Touches q8-q12, q15 (q13-q14 are preserved) - ; valid output registers are anything but q8-q11 - MACRO - DO_BUTTERFLY $regC, $regD, $regA, $regB, $first_constant, $second_constant, $reg1, $reg2, $reg3, $reg4 - ; TODO(cd): have special case to re-use constants when they are similar for - ; consecutive butterflies - ; TODO(cd): have special case when both constants are the same, do the - ; additions/subtractions before the multiplies. - ; generate the constants - ; generate scalar constants - mov r8, #$first_constant & 0xFF00 - mov r12, #$second_constant & 0xFF00 - add r8, #$first_constant & 0x00FF - add r12, #$second_constant & 0x00FF - ; generate vector constants - vdup.16 d30, r8 - vdup.16 d31, r12 - ; (used) two for inputs (regA-regD), one for constants (q15) - ; do some multiplications (ordered for maximum latency hiding) - vmull.s16 q8, $regC, d30 - vmull.s16 q10, $regA, d31 - vmull.s16 q9, $regD, d30 - vmull.s16 q11, $regB, d31 - vmull.s16 q12, $regC, d31 - ; (used) five for intermediate (q8-q12), one for constants (q15) - ; do some addition/subtractions (to get back two register) - vsub.s32 q8, q8, q10 - vsub.s32 q9, q9, q11 - ; do more multiplications (ordered for maximum latency hiding) - vmull.s16 q10, $regD, d31 - vmull.s16 q11, $regA, d30 - vmull.s16 q15, $regB, d30 - ; (used) six for intermediate (q8-q12, q15) - ; do more addition/subtractions - vadd.s32 q11, q12, q11 - vadd.s32 q10, q10, q15 - ; (used) four for intermediate (q8-q11) - ; dct_const_round_shift - vqrshrn.s32 $reg1, q8, #14 - vqrshrn.s32 $reg2, q9, #14 - vqrshrn.s32 $reg3, q11, #14 - vqrshrn.s32 $reg4, q10, #14 - ; (used) two for results, well four d registers - MEND - ; -------------------------------------------------------------------------- - ; Touches q8-q12, q15 (q13-q14 are preserved) - ; valid output registers are anything but q8-q11 - MACRO - DO_BUTTERFLY_STD $first_constant, $second_constant, $reg1, $reg2, $reg3, $reg4 - DO_BUTTERFLY d28, d29, d26, d27, $first_constant, $second_constant, $reg1, $reg2, $reg3, $reg4 - MEND - ; -------------------------------------------------------------------------- - -;void vp9_idct32x32_1024_add_neon(int16_t *input, uint8_t *dest, int dest_stride); -; -; r0 int16_t *input, -; r1 uint8_t *dest, -; r2 int dest_stride) -; loop counters -; r4 bands loop counter -; r5 pass loop counter -; r8 transpose loop counter -; combine-add pointers -; r6 dest + 31 * dest_stride, descending (30, 29, 28, ...) -; r7 dest + 0 * dest_stride, ascending (1, 2, 3, ...) -; r9 dest + 15 * dest_stride, descending (14, 13, 12, ...) -; r10 dest + 16 * dest_stride, ascending (17, 18, 19, ...) - -|vp9_idct32x32_1024_add_neon| PROC - ; This function does one pass of idct32x32 transform. - ; - ; This is done by transposing the input and then doing a 1d transform on - ; columns. In the first pass, the transposed columns are the original - ; rows. In the second pass, after the transposition, the colums are the - ; original columns. - ; The 1d transform is done by looping over bands of eight columns (the - ; idct32_bands loop). For each band, the transform input transposition - ; is done on demand, one band of four 8x8 matrices at a time. The four - ; matrices are transposed by pairs (the idct32_transpose_pair loop). - push {r4-r11} - vpush {d8-d15} - ; stack operation - ; internal buffer used to transpose 8 lines into before transforming them - ; int16_t transpose_buffer[32 * 8]; - ; at sp + [4096, 4607] - ; results of the first pass (transpose and transform rows) - ; int16_t pass1[32 * 32]; - ; at sp + [0, 2047] - ; results of the second pass (transpose and transform columns) - ; int16_t pass2[32 * 32]; - ; at sp + [2048, 4095] - sub sp, sp, #512+2048+2048 - - ; r6 = dest + 31 * dest_stride - ; r7 = dest + 0 * dest_stride - ; r9 = dest + 15 * dest_stride - ; r10 = dest + 16 * dest_stride - rsb r6, r2, r2, lsl #5 - rsb r9, r2, r2, lsl #4 - add r10, r1, r2, lsl #4 - mov r7, r1 - add r6, r6, r1 - add r9, r9, r1 - ; r11 = -dest_stride - neg r11, r2 - ; r3 = input - mov r3, r0 - ; parameters for first pass - ; r0 = transpose_buffer[32 * 8] - add r0, sp, #4096 - ; r1 = pass1[32 * 32] - mov r1, sp - - mov r5, #0 ; initialize pass loop counter -idct32_pass_loop - mov r4, #4 ; initialize bands loop counter -idct32_bands_loop - mov r8, #2 ; initialize transpose loop counter -idct32_transpose_pair_loop - ; Load two horizontally consecutive 8x8 16bit data matrices. The first one - ; into q0-q7 and the second one into q8-q15. There is a stride of 64, - ; adjusted to 32 because of the two post-increments. - vld1.s16 {q8}, [r3]! - vld1.s16 {q0}, [r3]! - add r3, #32 - vld1.s16 {q9}, [r3]! - vld1.s16 {q1}, [r3]! - add r3, #32 - vld1.s16 {q10}, [r3]! - vld1.s16 {q2}, [r3]! - add r3, #32 - vld1.s16 {q11}, [r3]! - vld1.s16 {q3}, [r3]! - add r3, #32 - vld1.s16 {q12}, [r3]! - vld1.s16 {q4}, [r3]! - add r3, #32 - vld1.s16 {q13}, [r3]! - vld1.s16 {q5}, [r3]! - add r3, #32 - vld1.s16 {q14}, [r3]! - vld1.s16 {q6}, [r3]! - add r3, #32 - vld1.s16 {q15}, [r3]! - vld1.s16 {q7}, [r3]! - - ; Transpose the two 8x8 16bit data matrices. - vswp d17, d24 - vswp d23, d30 - vswp d21, d28 - vswp d19, d26 - vswp d1, d8 - vswp d7, d14 - vswp d5, d12 - vswp d3, d10 - vtrn.32 q8, q10 - vtrn.32 q9, q11 - vtrn.32 q12, q14 - vtrn.32 q13, q15 - vtrn.32 q0, q2 - vtrn.32 q1, q3 - vtrn.32 q4, q6 - vtrn.32 q5, q7 - vtrn.16 q8, q9 - vtrn.16 q10, q11 - vtrn.16 q12, q13 - vtrn.16 q14, q15 - vtrn.16 q0, q1 - vtrn.16 q2, q3 - vtrn.16 q4, q5 - vtrn.16 q6, q7 - - ; Store both matrices after each other. There is a stride of 32, which - ; adjusts to nothing because of the post-increments. - vst1.16 {q8}, [r0]! - vst1.16 {q9}, [r0]! - vst1.16 {q10}, [r0]! - vst1.16 {q11}, [r0]! - vst1.16 {q12}, [r0]! - vst1.16 {q13}, [r0]! - vst1.16 {q14}, [r0]! - vst1.16 {q15}, [r0]! - vst1.16 {q0}, [r0]! - vst1.16 {q1}, [r0]! - vst1.16 {q2}, [r0]! - vst1.16 {q3}, [r0]! - vst1.16 {q4}, [r0]! - vst1.16 {q5}, [r0]! - vst1.16 {q6}, [r0]! - vst1.16 {q7}, [r0]! - - ; increment pointers by adjusted stride (not necessary for r0/out) - ; go back by 7*32 for the seven lines moved fully by read and add - ; go back by 32 for the eigth line only read - ; advance by 16*2 to go the next pair - sub r3, r3, #7*32*2 + 32 - 16*2 - ; transpose pair loop processing - subs r8, r8, #1 - bne idct32_transpose_pair_loop - - ; restore r0/input to its original value - sub r0, r0, #32*8*2 - - ; Instead of doing the transforms stage by stage, it is done by loading - ; some input values and doing as many stages as possible to minimize the - ; storing/loading of intermediate results. To fit within registers, the - ; final coefficients are cut into four blocks: - ; BLOCK A: 16-19,28-31 - ; BLOCK B: 20-23,24-27 - ; BLOCK C: 8-10,11-15 - ; BLOCK D: 0-3,4-7 - ; Blocks A and C are straight calculation through the various stages. In - ; block B, further calculations are performed using the results from - ; block A. In block D, further calculations are performed using the results - ; from block C and then the final calculations are done using results from - ; block A and B which have been combined at the end of block B. - - ; -------------------------------------------------------------------------- - ; BLOCK A: 16-19,28-31 - ; -------------------------------------------------------------------------- - ; generate 16,17,30,31 - ; -------------------------------------------------------------------------- - ; part of stage 1 - ;temp1 = input[1 * 32] * cospi_31_64 - input[31 * 32] * cospi_1_64; - ;temp2 = input[1 * 32] * cospi_1_64 + input[31 * 32] * cospi_31_64; - ;step1b[16][i] = dct_const_round_shift(temp1); - ;step1b[31][i] = dct_const_round_shift(temp2); - LOAD_FROM_TRANSPOSED 0, 1, 31 - DO_BUTTERFLY_STD cospi_31_64, cospi_1_64, d0, d1, d4, d5 - ; -------------------------------------------------------------------------- - ; part of stage 1 - ;temp1 = input[17 * 32] * cospi_15_64 - input[15 * 32] * cospi_17_64; - ;temp2 = input[17 * 32] * cospi_17_64 + input[15 * 32] * cospi_15_64; - ;step1b[17][i] = dct_const_round_shift(temp1); - ;step1b[30][i] = dct_const_round_shift(temp2); - LOAD_FROM_TRANSPOSED 31, 17, 15 - DO_BUTTERFLY_STD cospi_15_64, cospi_17_64, d2, d3, d6, d7 - ; -------------------------------------------------------------------------- - ; part of stage 2 - ;step2[16] = step1b[16][i] + step1b[17][i]; - ;step2[17] = step1b[16][i] - step1b[17][i]; - ;step2[30] = -step1b[30][i] + step1b[31][i]; - ;step2[31] = step1b[30][i] + step1b[31][i]; - vadd.s16 q4, q0, q1 - vsub.s16 q13, q0, q1 - vadd.s16 q6, q2, q3 - vsub.s16 q14, q2, q3 - ; -------------------------------------------------------------------------- - ; part of stage 3 - ;temp1 = step1b[30][i] * cospi_28_64 - step1b[17][i] * cospi_4_64; - ;temp2 = step1b[30][i] * cospi_4_64 - step1b[17][i] * cospi_28_64; - ;step3[17] = dct_const_round_shift(temp1); - ;step3[30] = dct_const_round_shift(temp2); - DO_BUTTERFLY_STD cospi_28_64, cospi_4_64, d10, d11, d14, d15 - ; -------------------------------------------------------------------------- - ; generate 18,19,28,29 - ; -------------------------------------------------------------------------- - ; part of stage 1 - ;temp1 = input[9 * 32] * cospi_23_64 - input[23 * 32] * cospi_9_64; - ;temp2 = input[9 * 32] * cospi_9_64 + input[23 * 32] * cospi_23_64; - ;step1b[18][i] = dct_const_round_shift(temp1); - ;step1b[29][i] = dct_const_round_shift(temp2); - LOAD_FROM_TRANSPOSED 15, 9, 23 - DO_BUTTERFLY_STD cospi_23_64, cospi_9_64, d0, d1, d4, d5 - ; -------------------------------------------------------------------------- - ; part of stage 1 - ;temp1 = input[25 * 32] * cospi_7_64 - input[7 * 32] * cospi_25_64; - ;temp2 = input[25 * 32] * cospi_25_64 + input[7 * 32] * cospi_7_64; - ;step1b[19][i] = dct_const_round_shift(temp1); - ;step1b[28][i] = dct_const_round_shift(temp2); - LOAD_FROM_TRANSPOSED 23, 25, 7 - DO_BUTTERFLY_STD cospi_7_64, cospi_25_64, d2, d3, d6, d7 - ; -------------------------------------------------------------------------- - ; part of stage 2 - ;step2[18] = -step1b[18][i] + step1b[19][i]; - ;step2[19] = step1b[18][i] + step1b[19][i]; - ;step2[28] = step1b[28][i] + step1b[29][i]; - ;step2[29] = step1b[28][i] - step1b[29][i]; - vsub.s16 q13, q3, q2 - vadd.s16 q3, q3, q2 - vsub.s16 q14, q1, q0 - vadd.s16 q2, q1, q0 - ; -------------------------------------------------------------------------- - ; part of stage 3 - ;temp1 = step1b[18][i] * (-cospi_4_64) - step1b[29][i] * (-cospi_28_64); - ;temp2 = step1b[18][i] * (-cospi_28_64) + step1b[29][i] * (-cospi_4_64); - ;step3[29] = dct_const_round_shift(temp1); - ;step3[18] = dct_const_round_shift(temp2); - DO_BUTTERFLY_STD (-cospi_4_64), (-cospi_28_64), d2, d3, d0, d1 - ; -------------------------------------------------------------------------- - ; combine 16-19,28-31 - ; -------------------------------------------------------------------------- - ; part of stage 4 - ;step1[16] = step1b[16][i] + step1b[19][i]; - ;step1[17] = step1b[17][i] + step1b[18][i]; - ;step1[18] = step1b[17][i] - step1b[18][i]; - ;step1[29] = step1b[30][i] - step1b[29][i]; - ;step1[30] = step1b[30][i] + step1b[29][i]; - ;step1[31] = step1b[31][i] + step1b[28][i]; - vadd.s16 q8, q4, q2 - vadd.s16 q9, q5, q0 - vadd.s16 q10, q7, q1 - vadd.s16 q15, q6, q3 - vsub.s16 q13, q5, q0 - vsub.s16 q14, q7, q1 - STORE_IN_OUTPUT 0, 16, 31, q8, q15 - STORE_IN_OUTPUT 31, 17, 30, q9, q10 - ; -------------------------------------------------------------------------- - ; part of stage 5 - ;temp1 = step1b[29][i] * cospi_24_64 - step1b[18][i] * cospi_8_64; - ;temp2 = step1b[29][i] * cospi_8_64 + step1b[18][i] * cospi_24_64; - ;step2[18] = dct_const_round_shift(temp1); - ;step2[29] = dct_const_round_shift(temp2); - DO_BUTTERFLY_STD cospi_24_64, cospi_8_64, d0, d1, d2, d3 - STORE_IN_OUTPUT 30, 29, 18, q1, q0 - ; -------------------------------------------------------------------------- - ; part of stage 4 - ;step1[19] = step1b[16][i] - step1b[19][i]; - ;step1[28] = step1b[31][i] - step1b[28][i]; - vsub.s16 q13, q4, q2 - vsub.s16 q14, q6, q3 - ; -------------------------------------------------------------------------- - ; part of stage 5 - ;temp1 = step1b[28][i] * cospi_24_64 - step1b[19][i] * cospi_8_64; - ;temp2 = step1b[28][i] * cospi_8_64 + step1b[19][i] * cospi_24_64; - ;step2[19] = dct_const_round_shift(temp1); - ;step2[28] = dct_const_round_shift(temp2); - DO_BUTTERFLY_STD cospi_24_64, cospi_8_64, d8, d9, d12, d13 - STORE_IN_OUTPUT 18, 19, 28, q4, q6 - ; -------------------------------------------------------------------------- - - - ; -------------------------------------------------------------------------- - ; BLOCK B: 20-23,24-27 - ; -------------------------------------------------------------------------- - ; generate 20,21,26,27 - ; -------------------------------------------------------------------------- - ; part of stage 1 - ;temp1 = input[5 * 32] * cospi_27_64 - input[27 * 32] * cospi_5_64; - ;temp2 = input[5 * 32] * cospi_5_64 + input[27 * 32] * cospi_27_64; - ;step1b[20][i] = dct_const_round_shift(temp1); - ;step1b[27][i] = dct_const_round_shift(temp2); - LOAD_FROM_TRANSPOSED 7, 5, 27 - DO_BUTTERFLY_STD cospi_27_64, cospi_5_64, d0, d1, d4, d5 - ; -------------------------------------------------------------------------- - ; part of stage 1 - ;temp1 = input[21 * 32] * cospi_11_64 - input[11 * 32] * cospi_21_64; - ;temp2 = input[21 * 32] * cospi_21_64 + input[11 * 32] * cospi_11_64; - ;step1b[21][i] = dct_const_round_shift(temp1); - ;step1b[26][i] = dct_const_round_shift(temp2); - LOAD_FROM_TRANSPOSED 27, 21, 11 - DO_BUTTERFLY_STD cospi_11_64, cospi_21_64, d2, d3, d6, d7 - ; -------------------------------------------------------------------------- - ; part of stage 2 - ;step2[20] = step1b[20][i] + step1b[21][i]; - ;step2[21] = step1b[20][i] - step1b[21][i]; - ;step2[26] = -step1b[26][i] + step1b[27][i]; - ;step2[27] = step1b[26][i] + step1b[27][i]; - vsub.s16 q13, q0, q1 - vadd.s16 q0, q0, q1 - vsub.s16 q14, q2, q3 - vadd.s16 q2, q2, q3 - ; -------------------------------------------------------------------------- - ; part of stage 3 - ;temp1 = step1b[26][i] * cospi_12_64 - step1b[21][i] * cospi_20_64; - ;temp2 = step1b[26][i] * cospi_20_64 + step1b[21][i] * cospi_12_64; - ;step3[21] = dct_const_round_shift(temp1); - ;step3[26] = dct_const_round_shift(temp2); - DO_BUTTERFLY_STD cospi_12_64, cospi_20_64, d2, d3, d6, d7 - ; -------------------------------------------------------------------------- - ; generate 22,23,24,25 - ; -------------------------------------------------------------------------- - ; part of stage 1 - ;temp1 = input[13 * 32] * cospi_19_64 - input[19 * 32] * cospi_13_64; - ;temp2 = input[13 * 32] * cospi_13_64 + input[19 * 32] * cospi_19_64; - ;step1b[22][i] = dct_const_round_shift(temp1); - ;step1b[25][i] = dct_const_round_shift(temp2); - LOAD_FROM_TRANSPOSED 11, 13, 19 - DO_BUTTERFLY_STD cospi_19_64, cospi_13_64, d10, d11, d14, d15 - ; -------------------------------------------------------------------------- - ; part of stage 1 - ;temp1 = input[29 * 32] * cospi_3_64 - input[3 * 32] * cospi_29_64; - ;temp2 = input[29 * 32] * cospi_29_64 + input[3 * 32] * cospi_3_64; - ;step1b[23][i] = dct_const_round_shift(temp1); - ;step1b[24][i] = dct_const_round_shift(temp2); - LOAD_FROM_TRANSPOSED 19, 29, 3 - DO_BUTTERFLY_STD cospi_3_64, cospi_29_64, d8, d9, d12, d13 - ; -------------------------------------------------------------------------- - ; part of stage 2 - ;step2[22] = -step1b[22][i] + step1b[23][i]; - ;step2[23] = step1b[22][i] + step1b[23][i]; - ;step2[24] = step1b[24][i] + step1b[25][i]; - ;step2[25] = step1b[24][i] - step1b[25][i]; - vsub.s16 q14, q4, q5 - vadd.s16 q5, q4, q5 - vsub.s16 q13, q6, q7 - vadd.s16 q6, q6, q7 - ; -------------------------------------------------------------------------- - ; part of stage 3 - ;temp1 = step1b[22][i] * (-cospi_20_64) - step1b[25][i] * (-cospi_12_64); - ;temp2 = step1b[22][i] * (-cospi_12_64) + step1b[25][i] * (-cospi_20_64); - ;step3[25] = dct_const_round_shift(temp1); - ;step3[22] = dct_const_round_shift(temp2); - DO_BUTTERFLY_STD (-cospi_20_64), (-cospi_12_64), d8, d9, d14, d15 - ; -------------------------------------------------------------------------- - ; combine 20-23,24-27 - ; -------------------------------------------------------------------------- - ; part of stage 4 - ;step1[22] = step1b[22][i] + step1b[21][i]; - ;step1[23] = step1b[23][i] + step1b[20][i]; - vadd.s16 q10, q7, q1 - vadd.s16 q11, q5, q0 - ;step1[24] = step1b[24][i] + step1b[27][i]; - ;step1[25] = step1b[25][i] + step1b[26][i]; - vadd.s16 q12, q6, q2 - vadd.s16 q15, q4, q3 - ; -------------------------------------------------------------------------- - ; part of stage 6 - ;step3[16] = step1b[16][i] + step1b[23][i]; - ;step3[17] = step1b[17][i] + step1b[22][i]; - ;step3[22] = step1b[17][i] - step1b[22][i]; - ;step3[23] = step1b[16][i] - step1b[23][i]; - LOAD_FROM_OUTPUT 28, 16, 17, q14, q13 - vadd.s16 q8, q14, q11 - vadd.s16 q9, q13, q10 - vsub.s16 q13, q13, q10 - vsub.s16 q11, q14, q11 - STORE_IN_OUTPUT 17, 17, 16, q9, q8 - ; -------------------------------------------------------------------------- - ; part of stage 6 - ;step3[24] = step1b[31][i] - step1b[24][i]; - ;step3[25] = step1b[30][i] - step1b[25][i]; - ;step3[30] = step1b[30][i] + step1b[25][i]; - ;step3[31] = step1b[31][i] + step1b[24][i]; - LOAD_FROM_OUTPUT 16, 30, 31, q14, q9 - vsub.s16 q8, q9, q12 - vadd.s16 q10, q14, q15 - vsub.s16 q14, q14, q15 - vadd.s16 q12, q9, q12 - STORE_IN_OUTPUT 31, 30, 31, q10, q12 - ; -------------------------------------------------------------------------- - ; TODO(cd) do some register allocation change to remove these push/pop - vpush {q8} ; [24] - vpush {q11} ; [23] - ; -------------------------------------------------------------------------- - ; part of stage 7 - ;temp1 = (step1b[25][i] - step1b[22][i]) * cospi_16_64; - ;temp2 = (step1b[25][i] + step1b[22][i]) * cospi_16_64; - ;step1[22] = dct_const_round_shift(temp1); - ;step1[25] = dct_const_round_shift(temp2); - DO_BUTTERFLY_STD cospi_16_64, cospi_16_64, d26, d27, d28, d29 - STORE_IN_OUTPUT 31, 25, 22, q14, q13 - ; -------------------------------------------------------------------------- - ; part of stage 7 - ;temp1 = (step1b[24][i] - step1b[23][i]) * cospi_16_64; - ;temp2 = (step1b[24][i] + step1b[23][i]) * cospi_16_64; - ;step1[23] = dct_const_round_shift(temp1); - ;step1[24] = dct_const_round_shift(temp2); - ; TODO(cd) do some register allocation change to remove these push/pop - vpop {q13} ; [23] - vpop {q14} ; [24] - DO_BUTTERFLY_STD cospi_16_64, cospi_16_64, d26, d27, d28, d29 - STORE_IN_OUTPUT 22, 24, 23, q14, q13 - ; -------------------------------------------------------------------------- - ; part of stage 4 - ;step1[20] = step1b[23][i] - step1b[20][i]; - ;step1[27] = step1b[24][i] - step1b[27][i]; - vsub.s16 q14, q5, q0 - vsub.s16 q13, q6, q2 - ; -------------------------------------------------------------------------- - ; part of stage 5 - ;temp1 = step1b[20][i] * (-cospi_8_64) - step1b[27][i] * (-cospi_24_64); - ;temp2 = step1b[20][i] * (-cospi_24_64) + step1b[27][i] * (-cospi_8_64); - ;step2[27] = dct_const_round_shift(temp1); - ;step2[20] = dct_const_round_shift(temp2); - DO_BUTTERFLY_STD (-cospi_8_64), (-cospi_24_64), d10, d11, d12, d13 - ; -------------------------------------------------------------------------- - ; part of stage 4 - ;step1[21] = step1b[22][i] - step1b[21][i]; - ;step1[26] = step1b[25][i] - step1b[26][i]; - vsub.s16 q14, q7, q1 - vsub.s16 q13, q4, q3 - ; -------------------------------------------------------------------------- - ; part of stage 5 - ;temp1 = step1b[21][i] * (-cospi_8_64) - step1b[26][i] * (-cospi_24_64); - ;temp2 = step1b[21][i] * (-cospi_24_64) + step1b[26][i] * (-cospi_8_64); - ;step2[26] = dct_const_round_shift(temp1); - ;step2[21] = dct_const_round_shift(temp2); - DO_BUTTERFLY_STD (-cospi_8_64), (-cospi_24_64), d0, d1, d2, d3 - ; -------------------------------------------------------------------------- - ; part of stage 6 - ;step3[18] = step1b[18][i] + step1b[21][i]; - ;step3[19] = step1b[19][i] + step1b[20][i]; - ;step3[20] = step1b[19][i] - step1b[20][i]; - ;step3[21] = step1b[18][i] - step1b[21][i]; - LOAD_FROM_OUTPUT 23, 18, 19, q14, q13 - vadd.s16 q8, q14, q1 - vadd.s16 q9, q13, q6 - vsub.s16 q13, q13, q6 - vsub.s16 q1, q14, q1 - STORE_IN_OUTPUT 19, 18, 19, q8, q9 - ; -------------------------------------------------------------------------- - ; part of stage 6 - ;step3[27] = step1b[28][i] - step1b[27][i]; - ;step3[28] = step1b[28][i] + step1b[27][i]; - ;step3[29] = step1b[29][i] + step1b[26][i]; - ;step3[26] = step1b[29][i] - step1b[26][i]; - LOAD_FROM_OUTPUT 19, 28, 29, q8, q9 - vsub.s16 q14, q8, q5 - vadd.s16 q10, q8, q5 - vadd.s16 q11, q9, q0 - vsub.s16 q0, q9, q0 - STORE_IN_OUTPUT 29, 28, 29, q10, q11 - ; -------------------------------------------------------------------------- - ; part of stage 7 - ;temp1 = (step1b[27][i] - step1b[20][i]) * cospi_16_64; - ;temp2 = (step1b[27][i] + step1b[20][i]) * cospi_16_64; - ;step1[20] = dct_const_round_shift(temp1); - ;step1[27] = dct_const_round_shift(temp2); - DO_BUTTERFLY_STD cospi_16_64, cospi_16_64, d26, d27, d28, d29 - STORE_IN_OUTPUT 29, 20, 27, q13, q14 - ; -------------------------------------------------------------------------- - ; part of stage 7 - ;temp1 = (step1b[26][i] - step1b[21][i]) * cospi_16_64; - ;temp2 = (step1b[26][i] + step1b[21][i]) * cospi_16_64; - ;step1[21] = dct_const_round_shift(temp1); - ;step1[26] = dct_const_round_shift(temp2); - DO_BUTTERFLY d0, d1, d2, d3, cospi_16_64, cospi_16_64, d2, d3, d0, d1 - STORE_IN_OUTPUT 27, 21, 26, q1, q0 - ; -------------------------------------------------------------------------- - - - ; -------------------------------------------------------------------------- - ; BLOCK C: 8-10,11-15 - ; -------------------------------------------------------------------------- - ; generate 8,9,14,15 - ; -------------------------------------------------------------------------- - ; part of stage 2 - ;temp1 = input[2 * 32] * cospi_30_64 - input[30 * 32] * cospi_2_64; - ;temp2 = input[2 * 32] * cospi_2_64 + input[30 * 32] * cospi_30_64; - ;step2[8] = dct_const_round_shift(temp1); - ;step2[15] = dct_const_round_shift(temp2); - LOAD_FROM_TRANSPOSED 3, 2, 30 - DO_BUTTERFLY_STD cospi_30_64, cospi_2_64, d0, d1, d4, d5 - ; -------------------------------------------------------------------------- - ; part of stage 2 - ;temp1 = input[18 * 32] * cospi_14_64 - input[14 * 32] * cospi_18_64; - ;temp2 = input[18 * 32] * cospi_18_64 + input[14 * 32] * cospi_14_64; - ;step2[9] = dct_const_round_shift(temp1); - ;step2[14] = dct_const_round_shift(temp2); - LOAD_FROM_TRANSPOSED 30, 18, 14 - DO_BUTTERFLY_STD cospi_14_64, cospi_18_64, d2, d3, d6, d7 - ; -------------------------------------------------------------------------- - ; part of stage 3 - ;step3[8] = step1b[8][i] + step1b[9][i]; - ;step3[9] = step1b[8][i] - step1b[9][i]; - ;step3[14] = step1b[15][i] - step1b[14][i]; - ;step3[15] = step1b[15][i] + step1b[14][i]; - vsub.s16 q13, q0, q1 - vadd.s16 q0, q0, q1 - vsub.s16 q14, q2, q3 - vadd.s16 q2, q2, q3 - ; -------------------------------------------------------------------------- - ; part of stage 4 - ;temp1 = step1b[14][i] * cospi_24_64 - step1b[9][i] * cospi_8_64; - ;temp2 = step1b[14][i] * cospi_8_64 + step1b[9][i] * cospi_24_64; - ;step1[9] = dct_const_round_shift(temp1); - ;step1[14] = dct_const_round_shift(temp2); - DO_BUTTERFLY_STD cospi_24_64, cospi_8_64, d2, d3, d6, d7 - ; -------------------------------------------------------------------------- - ; generate 10,11,12,13 - ; -------------------------------------------------------------------------- - ; part of stage 2 - ;temp1 = input[10 * 32] * cospi_22_64 - input[22 * 32] * cospi_10_64; - ;temp2 = input[10 * 32] * cospi_10_64 + input[22 * 32] * cospi_22_64; - ;step2[10] = dct_const_round_shift(temp1); - ;step2[13] = dct_const_round_shift(temp2); - LOAD_FROM_TRANSPOSED 14, 10, 22 - DO_BUTTERFLY_STD cospi_22_64, cospi_10_64, d10, d11, d14, d15 - ; -------------------------------------------------------------------------- - ; part of stage 2 - ;temp1 = input[26 * 32] * cospi_6_64 - input[6 * 32] * cospi_26_64; - ;temp2 = input[26 * 32] * cospi_26_64 + input[6 * 32] * cospi_6_64; - ;step2[11] = dct_const_round_shift(temp1); - ;step2[12] = dct_const_round_shift(temp2); - LOAD_FROM_TRANSPOSED 22, 26, 6 - DO_BUTTERFLY_STD cospi_6_64, cospi_26_64, d8, d9, d12, d13 - ; -------------------------------------------------------------------------- - ; part of stage 3 - ;step3[10] = step1b[11][i] - step1b[10][i]; - ;step3[11] = step1b[11][i] + step1b[10][i]; - ;step3[12] = step1b[12][i] + step1b[13][i]; - ;step3[13] = step1b[12][i] - step1b[13][i]; - vsub.s16 q14, q4, q5 - vadd.s16 q5, q4, q5 - vsub.s16 q13, q6, q7 - vadd.s16 q6, q6, q7 - ; -------------------------------------------------------------------------- - ; part of stage 4 - ;temp1 = step1b[10][i] * (-cospi_8_64) - step1b[13][i] * (-cospi_24_64); - ;temp2 = step1b[10][i] * (-cospi_24_64) + step1b[13][i] * (-cospi_8_64); - ;step1[13] = dct_const_round_shift(temp1); - ;step1[10] = dct_const_round_shift(temp2); - DO_BUTTERFLY_STD (-cospi_8_64), (-cospi_24_64), d8, d9, d14, d15 - ; -------------------------------------------------------------------------- - ; combine 8-10,11-15 - ; -------------------------------------------------------------------------- - ; part of stage 5 - ;step2[8] = step1b[8][i] + step1b[11][i]; - ;step2[9] = step1b[9][i] + step1b[10][i]; - ;step2[10] = step1b[9][i] - step1b[10][i]; - vadd.s16 q8, q0, q5 - vadd.s16 q9, q1, q7 - vsub.s16 q13, q1, q7 - ;step2[13] = step1b[14][i] - step1b[13][i]; - ;step2[14] = step1b[14][i] + step1b[13][i]; - ;step2[15] = step1b[15][i] + step1b[12][i]; - vsub.s16 q14, q3, q4 - vadd.s16 q10, q3, q4 - vadd.s16 q15, q2, q6 - STORE_IN_OUTPUT 26, 8, 15, q8, q15 - STORE_IN_OUTPUT 15, 9, 14, q9, q10 - ; -------------------------------------------------------------------------- - ; part of stage 6 - ;temp1 = (step1b[13][i] - step1b[10][i]) * cospi_16_64; - ;temp2 = (step1b[13][i] + step1b[10][i]) * cospi_16_64; - ;step3[10] = dct_const_round_shift(temp1); - ;step3[13] = dct_const_round_shift(temp2); - DO_BUTTERFLY_STD cospi_16_64, cospi_16_64, d2, d3, d6, d7 - STORE_IN_OUTPUT 14, 13, 10, q3, q1 - ; -------------------------------------------------------------------------- - ; part of stage 5 - ;step2[11] = step1b[8][i] - step1b[11][i]; - ;step2[12] = step1b[15][i] - step1b[12][i]; - vsub.s16 q13, q0, q5 - vsub.s16 q14, q2, q6 - ; -------------------------------------------------------------------------- - ; part of stage 6 - ;temp1 = (step1b[12][i] - step1b[11][i]) * cospi_16_64; - ;temp2 = (step1b[12][i] + step1b[11][i]) * cospi_16_64; - ;step3[11] = dct_const_round_shift(temp1); - ;step3[12] = dct_const_round_shift(temp2); - DO_BUTTERFLY_STD cospi_16_64, cospi_16_64, d2, d3, d6, d7 - STORE_IN_OUTPUT 10, 11, 12, q1, q3 - ; -------------------------------------------------------------------------- - - - ; -------------------------------------------------------------------------- - ; BLOCK D: 0-3,4-7 - ; -------------------------------------------------------------------------- - ; generate 4,5,6,7 - ; -------------------------------------------------------------------------- - ; part of stage 3 - ;temp1 = input[4 * 32] * cospi_28_64 - input[28 * 32] * cospi_4_64; - ;temp2 = input[4 * 32] * cospi_4_64 + input[28 * 32] * cospi_28_64; - ;step3[4] = dct_const_round_shift(temp1); - ;step3[7] = dct_const_round_shift(temp2); - LOAD_FROM_TRANSPOSED 6, 4, 28 - DO_BUTTERFLY_STD cospi_28_64, cospi_4_64, d0, d1, d4, d5 - ; -------------------------------------------------------------------------- - ; part of stage 3 - ;temp1 = input[20 * 32] * cospi_12_64 - input[12 * 32] * cospi_20_64; - ;temp2 = input[20 * 32] * cospi_20_64 + input[12 * 32] * cospi_12_64; - ;step3[5] = dct_const_round_shift(temp1); - ;step3[6] = dct_const_round_shift(temp2); - LOAD_FROM_TRANSPOSED 28, 20, 12 - DO_BUTTERFLY_STD cospi_12_64, cospi_20_64, d2, d3, d6, d7 - ; -------------------------------------------------------------------------- - ; part of stage 4 - ;step1[4] = step1b[4][i] + step1b[5][i]; - ;step1[5] = step1b[4][i] - step1b[5][i]; - ;step1[6] = step1b[7][i] - step1b[6][i]; - ;step1[7] = step1b[7][i] + step1b[6][i]; - vsub.s16 q13, q0, q1 - vadd.s16 q0, q0, q1 - vsub.s16 q14, q2, q3 - vadd.s16 q2, q2, q3 - ; -------------------------------------------------------------------------- - ; part of stage 5 - ;temp1 = (step1b[6][i] - step1b[5][i]) * cospi_16_64; - ;temp2 = (step1b[5][i] + step1b[6][i]) * cospi_16_64; - ;step2[5] = dct_const_round_shift(temp1); - ;step2[6] = dct_const_round_shift(temp2); - DO_BUTTERFLY_STD cospi_16_64, cospi_16_64, d2, d3, d6, d7 - ; -------------------------------------------------------------------------- - ; generate 0,1,2,3 - ; -------------------------------------------------------------------------- - ; part of stage 4 - ;temp1 = (input[0 * 32] - input[16 * 32]) * cospi_16_64; - ;temp2 = (input[0 * 32] + input[16 * 32]) * cospi_16_64; - ;step1[1] = dct_const_round_shift(temp1); - ;step1[0] = dct_const_round_shift(temp2); - LOAD_FROM_TRANSPOSED 12, 0, 16 - DO_BUTTERFLY_STD cospi_16_64, cospi_16_64, d10, d11, d14, d15 - ; -------------------------------------------------------------------------- - ; part of stage 4 - ;temp1 = input[8 * 32] * cospi_24_64 - input[24 * 32] * cospi_8_64; - ;temp2 = input[8 * 32] * cospi_8_64 + input[24 * 32] * cospi_24_64; - ;step1[2] = dct_const_round_shift(temp1); - ;step1[3] = dct_const_round_shift(temp2); - LOAD_FROM_TRANSPOSED 16, 8, 24 - DO_BUTTERFLY_STD cospi_24_64, cospi_8_64, d28, d29, d12, d13 - ; -------------------------------------------------------------------------- - ; part of stage 5 - ;step2[0] = step1b[0][i] + step1b[3][i]; - ;step2[1] = step1b[1][i] + step1b[2][i]; - ;step2[2] = step1b[1][i] - step1b[2][i]; - ;step2[3] = step1b[0][i] - step1b[3][i]; - vadd.s16 q4, q7, q6 - vsub.s16 q7, q7, q6 - vsub.s16 q6, q5, q14 - vadd.s16 q5, q5, q14 - ; -------------------------------------------------------------------------- - ; combine 0-3,4-7 - ; -------------------------------------------------------------------------- - ; part of stage 6 - ;step3[0] = step1b[0][i] + step1b[7][i]; - ;step3[1] = step1b[1][i] + step1b[6][i]; - ;step3[2] = step1b[2][i] + step1b[5][i]; - ;step3[3] = step1b[3][i] + step1b[4][i]; - vadd.s16 q8, q4, q2 - vadd.s16 q9, q5, q3 - vadd.s16 q10, q6, q1 - vadd.s16 q11, q7, q0 - ;step3[4] = step1b[3][i] - step1b[4][i]; - ;step3[5] = step1b[2][i] - step1b[5][i]; - ;step3[6] = step1b[1][i] - step1b[6][i]; - ;step3[7] = step1b[0][i] - step1b[7][i]; - vsub.s16 q12, q7, q0 - vsub.s16 q13, q6, q1 - vsub.s16 q14, q5, q3 - vsub.s16 q15, q4, q2 - ; -------------------------------------------------------------------------- - ; part of stage 7 - ;step1[0] = step1b[0][i] + step1b[15][i]; - ;step1[1] = step1b[1][i] + step1b[14][i]; - ;step1[14] = step1b[1][i] - step1b[14][i]; - ;step1[15] = step1b[0][i] - step1b[15][i]; - LOAD_FROM_OUTPUT 12, 14, 15, q0, q1 - vadd.s16 q2, q8, q1 - vadd.s16 q3, q9, q0 - vsub.s16 q4, q9, q0 - vsub.s16 q5, q8, q1 - ; -------------------------------------------------------------------------- - ; part of final stage - ;output[14 * 32] = step1b[14][i] + step1b[17][i]; - ;output[15 * 32] = step1b[15][i] + step1b[16][i]; - ;output[16 * 32] = step1b[15][i] - step1b[16][i]; - ;output[17 * 32] = step1b[14][i] - step1b[17][i]; - LOAD_FROM_OUTPUT 15, 16, 17, q0, q1 - vadd.s16 q8, q4, q1 - vadd.s16 q9, q5, q0 - vsub.s16 q6, q5, q0 - vsub.s16 q7, q4, q1 - - cmp r5, #0 - bgt idct32_bands_end_2nd_pass - -idct32_bands_end_1st_pass - STORE_IN_OUTPUT 17, 16, 17, q6, q7 - STORE_IN_OUTPUT 17, 14, 15, q8, q9 - ; -------------------------------------------------------------------------- - ; part of final stage - ;output[ 0 * 32] = step1b[0][i] + step1b[31][i]; - ;output[ 1 * 32] = step1b[1][i] + step1b[30][i]; - ;output[30 * 32] = step1b[1][i] - step1b[30][i]; - ;output[31 * 32] = step1b[0][i] - step1b[31][i]; - LOAD_FROM_OUTPUT 15, 30, 31, q0, q1 - vadd.s16 q4, q2, q1 - vadd.s16 q5, q3, q0 - vsub.s16 q6, q3, q0 - vsub.s16 q7, q2, q1 - STORE_IN_OUTPUT 31, 30, 31, q6, q7 - STORE_IN_OUTPUT 31, 0, 1, q4, q5 - ; -------------------------------------------------------------------------- - ; part of stage 7 - ;step1[2] = step1b[2][i] + step1b[13][i]; - ;step1[3] = step1b[3][i] + step1b[12][i]; - ;step1[12] = step1b[3][i] - step1b[12][i]; - ;step1[13] = step1b[2][i] - step1b[13][i]; - LOAD_FROM_OUTPUT 1, 12, 13, q0, q1 - vadd.s16 q2, q10, q1 - vadd.s16 q3, q11, q0 - vsub.s16 q4, q11, q0 - vsub.s16 q5, q10, q1 - ; -------------------------------------------------------------------------- - ; part of final stage - ;output[12 * 32] = step1b[12][i] + step1b[19][i]; - ;output[13 * 32] = step1b[13][i] + step1b[18][i]; - ;output[18 * 32] = step1b[13][i] - step1b[18][i]; - ;output[19 * 32] = step1b[12][i] - step1b[19][i]; - LOAD_FROM_OUTPUT 13, 18, 19, q0, q1 - vadd.s16 q8, q4, q1 - vadd.s16 q9, q5, q0 - vsub.s16 q6, q5, q0 - vsub.s16 q7, q4, q1 - STORE_IN_OUTPUT 19, 18, 19, q6, q7 - STORE_IN_OUTPUT 19, 12, 13, q8, q9 - ; -------------------------------------------------------------------------- - ; part of final stage - ;output[ 2 * 32] = step1b[2][i] + step1b[29][i]; - ;output[ 3 * 32] = step1b[3][i] + step1b[28][i]; - ;output[28 * 32] = step1b[3][i] - step1b[28][i]; - ;output[29 * 32] = step1b[2][i] - step1b[29][i]; - LOAD_FROM_OUTPUT 13, 28, 29, q0, q1 - vadd.s16 q4, q2, q1 - vadd.s16 q5, q3, q0 - vsub.s16 q6, q3, q0 - vsub.s16 q7, q2, q1 - STORE_IN_OUTPUT 29, 28, 29, q6, q7 - STORE_IN_OUTPUT 29, 2, 3, q4, q5 - ; -------------------------------------------------------------------------- - ; part of stage 7 - ;step1[4] = step1b[4][i] + step1b[11][i]; - ;step1[5] = step1b[5][i] + step1b[10][i]; - ;step1[10] = step1b[5][i] - step1b[10][i]; - ;step1[11] = step1b[4][i] - step1b[11][i]; - LOAD_FROM_OUTPUT 3, 10, 11, q0, q1 - vadd.s16 q2, q12, q1 - vadd.s16 q3, q13, q0 - vsub.s16 q4, q13, q0 - vsub.s16 q5, q12, q1 - ; -------------------------------------------------------------------------- - ; part of final stage - ;output[10 * 32] = step1b[10][i] + step1b[21][i]; - ;output[11 * 32] = step1b[11][i] + step1b[20][i]; - ;output[20 * 32] = step1b[11][i] - step1b[20][i]; - ;output[21 * 32] = step1b[10][i] - step1b[21][i]; - LOAD_FROM_OUTPUT 11, 20, 21, q0, q1 - vadd.s16 q8, q4, q1 - vadd.s16 q9, q5, q0 - vsub.s16 q6, q5, q0 - vsub.s16 q7, q4, q1 - STORE_IN_OUTPUT 21, 20, 21, q6, q7 - STORE_IN_OUTPUT 21, 10, 11, q8, q9 - ; -------------------------------------------------------------------------- - ; part of final stage - ;output[ 4 * 32] = step1b[4][i] + step1b[27][i]; - ;output[ 5 * 32] = step1b[5][i] + step1b[26][i]; - ;output[26 * 32] = step1b[5][i] - step1b[26][i]; - ;output[27 * 32] = step1b[4][i] - step1b[27][i]; - LOAD_FROM_OUTPUT 11, 26, 27, q0, q1 - vadd.s16 q4, q2, q1 - vadd.s16 q5, q3, q0 - vsub.s16 q6, q3, q0 - vsub.s16 q7, q2, q1 - STORE_IN_OUTPUT 27, 26, 27, q6, q7 - STORE_IN_OUTPUT 27, 4, 5, q4, q5 - ; -------------------------------------------------------------------------- - ; part of stage 7 - ;step1[6] = step1b[6][i] + step1b[9][i]; - ;step1[7] = step1b[7][i] + step1b[8][i]; - ;step1[8] = step1b[7][i] - step1b[8][i]; - ;step1[9] = step1b[6][i] - step1b[9][i]; - LOAD_FROM_OUTPUT 5, 8, 9, q0, q1 - vadd.s16 q2, q14, q1 - vadd.s16 q3, q15, q0 - vsub.s16 q4, q15, q0 - vsub.s16 q5, q14, q1 - ; -------------------------------------------------------------------------- - ; part of final stage - ;output[ 8 * 32] = step1b[8][i] + step1b[23][i]; - ;output[ 9 * 32] = step1b[9][i] + step1b[22][i]; - ;output[22 * 32] = step1b[9][i] - step1b[22][i]; - ;output[23 * 32] = step1b[8][i] - step1b[23][i]; - LOAD_FROM_OUTPUT 9, 22, 23, q0, q1 - vadd.s16 q8, q4, q1 - vadd.s16 q9, q5, q0 - vsub.s16 q6, q5, q0 - vsub.s16 q7, q4, q1 - STORE_IN_OUTPUT 23, 22, 23, q6, q7 - STORE_IN_OUTPUT 23, 8, 9, q8, q9 - ; -------------------------------------------------------------------------- - ; part of final stage - ;output[ 6 * 32] = step1b[6][i] + step1b[25][i]; - ;output[ 7 * 32] = step1b[7][i] + step1b[24][i]; - ;output[24 * 32] = step1b[7][i] - step1b[24][i]; - ;output[25 * 32] = step1b[6][i] - step1b[25][i]; - LOAD_FROM_OUTPUT 9, 24, 25, q0, q1 - vadd.s16 q4, q2, q1 - vadd.s16 q5, q3, q0 - vsub.s16 q6, q3, q0 - vsub.s16 q7, q2, q1 - STORE_IN_OUTPUT 25, 24, 25, q6, q7 - STORE_IN_OUTPUT 25, 6, 7, q4, q5 - - ; restore r0 by removing the last offset from the last - ; operation (LOAD_FROM_TRANSPOSED 16, 8, 24) => 24*8*2 - sub r0, r0, #24*8*2 - ; restore r1 by removing the last offset from the last - ; operation (STORE_IN_OUTPUT 24, 6, 7) => 7*32*2 - ; advance by 8 columns => 8*2 - sub r1, r1, #7*32*2 - 8*2 - ; advance by 8 lines (8*32*2) - ; go back by the two pairs from the loop (32*2) - add r3, r3, #8*32*2 - 32*2 - - ; bands loop processing - subs r4, r4, #1 - bne idct32_bands_loop - - ; parameters for second pass - ; the input of pass2 is the result of pass1. we have to remove the offset - ; of 32 columns induced by the above idct32_bands_loop - sub r3, r1, #32*2 - ; r1 = pass2[32 * 32] - add r1, sp, #2048 - - ; pass loop processing - add r5, r5, #1 - b idct32_pass_loop - -idct32_bands_end_2nd_pass - STORE_COMBINE_CENTER_RESULTS - ; -------------------------------------------------------------------------- - ; part of final stage - ;output[ 0 * 32] = step1b[0][i] + step1b[31][i]; - ;output[ 1 * 32] = step1b[1][i] + step1b[30][i]; - ;output[30 * 32] = step1b[1][i] - step1b[30][i]; - ;output[31 * 32] = step1b[0][i] - step1b[31][i]; - LOAD_FROM_OUTPUT 17, 30, 31, q0, q1 - vadd.s16 q4, q2, q1 - vadd.s16 q5, q3, q0 - vsub.s16 q6, q3, q0 - vsub.s16 q7, q2, q1 - STORE_COMBINE_EXTREME_RESULTS - ; -------------------------------------------------------------------------- - ; part of stage 7 - ;step1[2] = step1b[2][i] + step1b[13][i]; - ;step1[3] = step1b[3][i] + step1b[12][i]; - ;step1[12] = step1b[3][i] - step1b[12][i]; - ;step1[13] = step1b[2][i] - step1b[13][i]; - LOAD_FROM_OUTPUT 31, 12, 13, q0, q1 - vadd.s16 q2, q10, q1 - vadd.s16 q3, q11, q0 - vsub.s16 q4, q11, q0 - vsub.s16 q5, q10, q1 - ; -------------------------------------------------------------------------- - ; part of final stage - ;output[12 * 32] = step1b[12][i] + step1b[19][i]; - ;output[13 * 32] = step1b[13][i] + step1b[18][i]; - ;output[18 * 32] = step1b[13][i] - step1b[18][i]; - ;output[19 * 32] = step1b[12][i] - step1b[19][i]; - LOAD_FROM_OUTPUT 13, 18, 19, q0, q1 - vadd.s16 q8, q4, q1 - vadd.s16 q9, q5, q0 - vsub.s16 q6, q5, q0 - vsub.s16 q7, q4, q1 - STORE_COMBINE_CENTER_RESULTS - ; -------------------------------------------------------------------------- - ; part of final stage - ;output[ 2 * 32] = step1b[2][i] + step1b[29][i]; - ;output[ 3 * 32] = step1b[3][i] + step1b[28][i]; - ;output[28 * 32] = step1b[3][i] - step1b[28][i]; - ;output[29 * 32] = step1b[2][i] - step1b[29][i]; - LOAD_FROM_OUTPUT 19, 28, 29, q0, q1 - vadd.s16 q4, q2, q1 - vadd.s16 q5, q3, q0 - vsub.s16 q6, q3, q0 - vsub.s16 q7, q2, q1 - STORE_COMBINE_EXTREME_RESULTS - ; -------------------------------------------------------------------------- - ; part of stage 7 - ;step1[4] = step1b[4][i] + step1b[11][i]; - ;step1[5] = step1b[5][i] + step1b[10][i]; - ;step1[10] = step1b[5][i] - step1b[10][i]; - ;step1[11] = step1b[4][i] - step1b[11][i]; - LOAD_FROM_OUTPUT 29, 10, 11, q0, q1 - vadd.s16 q2, q12, q1 - vadd.s16 q3, q13, q0 - vsub.s16 q4, q13, q0 - vsub.s16 q5, q12, q1 - ; -------------------------------------------------------------------------- - ; part of final stage - ;output[10 * 32] = step1b[10][i] + step1b[21][i]; - ;output[11 * 32] = step1b[11][i] + step1b[20][i]; - ;output[20 * 32] = step1b[11][i] - step1b[20][i]; - ;output[21 * 32] = step1b[10][i] - step1b[21][i]; - LOAD_FROM_OUTPUT 11, 20, 21, q0, q1 - vadd.s16 q8, q4, q1 - vadd.s16 q9, q5, q0 - vsub.s16 q6, q5, q0 - vsub.s16 q7, q4, q1 - STORE_COMBINE_CENTER_RESULTS - ; -------------------------------------------------------------------------- - ; part of final stage - ;output[ 4 * 32] = step1b[4][i] + step1b[27][i]; - ;output[ 5 * 32] = step1b[5][i] + step1b[26][i]; - ;output[26 * 32] = step1b[5][i] - step1b[26][i]; - ;output[27 * 32] = step1b[4][i] - step1b[27][i]; - LOAD_FROM_OUTPUT 21, 26, 27, q0, q1 - vadd.s16 q4, q2, q1 - vadd.s16 q5, q3, q0 - vsub.s16 q6, q3, q0 - vsub.s16 q7, q2, q1 - STORE_COMBINE_EXTREME_RESULTS - ; -------------------------------------------------------------------------- - ; part of stage 7 - ;step1[6] = step1b[6][i] + step1b[9][i]; - ;step1[7] = step1b[7][i] + step1b[8][i]; - ;step1[8] = step1b[7][i] - step1b[8][i]; - ;step1[9] = step1b[6][i] - step1b[9][i]; - LOAD_FROM_OUTPUT 27, 8, 9, q0, q1 - vadd.s16 q2, q14, q1 - vadd.s16 q3, q15, q0 - vsub.s16 q4, q15, q0 - vsub.s16 q5, q14, q1 - ; -------------------------------------------------------------------------- - ; part of final stage - ;output[ 8 * 32] = step1b[8][i] + step1b[23][i]; - ;output[ 9 * 32] = step1b[9][i] + step1b[22][i]; - ;output[22 * 32] = step1b[9][i] - step1b[22][i]; - ;output[23 * 32] = step1b[8][i] - step1b[23][i]; - LOAD_FROM_OUTPUT 9, 22, 23, q0, q1 - vadd.s16 q8, q4, q1 - vadd.s16 q9, q5, q0 - vsub.s16 q6, q5, q0 - vsub.s16 q7, q4, q1 - STORE_COMBINE_CENTER_RESULTS_LAST - ; -------------------------------------------------------------------------- - ; part of final stage - ;output[ 6 * 32] = step1b[6][i] + step1b[25][i]; - ;output[ 7 * 32] = step1b[7][i] + step1b[24][i]; - ;output[24 * 32] = step1b[7][i] - step1b[24][i]; - ;output[25 * 32] = step1b[6][i] - step1b[25][i]; - LOAD_FROM_OUTPUT 23, 24, 25, q0, q1 - vadd.s16 q4, q2, q1 - vadd.s16 q5, q3, q0 - vsub.s16 q6, q3, q0 - vsub.s16 q7, q2, q1 - STORE_COMBINE_EXTREME_RESULTS_LAST - ; -------------------------------------------------------------------------- - ; restore pointers to their initial indices for next band pass by - ; removing/adding dest_stride * 8. The actual increment by eight - ; is taken care of within the _LAST macros. - add r6, r6, r2, lsl #3 - add r9, r9, r2, lsl #3 - sub r7, r7, r2, lsl #3 - sub r10, r10, r2, lsl #3 - - ; restore r0 by removing the last offset from the last - ; operation (LOAD_FROM_TRANSPOSED 16, 8, 24) => 24*8*2 - sub r0, r0, #24*8*2 - ; restore r1 by removing the last offset from the last - ; operation (LOAD_FROM_OUTPUT 23, 24, 25) => 25*32*2 - ; advance by 8 columns => 8*2 - sub r1, r1, #25*32*2 - 8*2 - ; advance by 8 lines (8*32*2) - ; go back by the two pairs from the loop (32*2) - add r3, r3, #8*32*2 - 32*2 - - ; bands loop processing - subs r4, r4, #1 - bne idct32_bands_loop - - ; stack operation - add sp, sp, #512+2048+2048 - vpop {d8-d15} - pop {r4-r11} - bx lr - ENDP ; |vp9_idct32x32_1024_add_neon| - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct32x32_add_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct32x32_add_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct32x32_add_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct32x32_add_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,750 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "./vpx_config.h" - -static int16_t cospi_1_64 = 16364; -static int16_t cospi_2_64 = 16305; -static int16_t cospi_3_64 = 16207; -static int16_t cospi_4_64 = 16069; -static int16_t cospi_5_64 = 15893; -static int16_t cospi_6_64 = 15679; -static int16_t cospi_7_64 = 15426; -static int16_t cospi_8_64 = 15137; -static int16_t cospi_9_64 = 14811; -static int16_t cospi_10_64 = 14449; -static int16_t cospi_11_64 = 14053; -static int16_t cospi_12_64 = 13623; -static int16_t cospi_13_64 = 13160; -static int16_t cospi_14_64 = 12665; -static int16_t cospi_15_64 = 12140; -static int16_t cospi_16_64 = 11585; -static int16_t cospi_17_64 = 11003; -static int16_t cospi_18_64 = 10394; -static int16_t cospi_19_64 = 9760; -static int16_t cospi_20_64 = 9102; -static int16_t cospi_21_64 = 8423; -static int16_t cospi_22_64 = 7723; -static int16_t cospi_23_64 = 7005; -static int16_t cospi_24_64 = 6270; -static int16_t cospi_25_64 = 5520; -static int16_t cospi_26_64 = 4756; -static int16_t cospi_27_64 = 3981; -static int16_t cospi_28_64 = 3196; -static int16_t cospi_29_64 = 2404; -static int16_t cospi_30_64 = 1606; -static int16_t cospi_31_64 = 804; - -#define LOAD_FROM_TRANSPOSED(prev, first, second) \ - q14s16 = vld1q_s16(trans_buf + first * 8); \ - q13s16 = vld1q_s16(trans_buf + second * 8); - -#define LOAD_FROM_OUTPUT(prev, first, second, qA, qB) \ - qA = vld1q_s16(out + first * 32); \ - qB = vld1q_s16(out + second * 32); - -#define STORE_IN_OUTPUT(prev, first, second, qA, qB) \ - vst1q_s16(out + first * 32, qA); \ - vst1q_s16(out + second * 32, qB); - -#define STORE_COMBINE_CENTER_RESULTS(r10, r9) \ - __STORE_COMBINE_CENTER_RESULTS(r10, r9, stride, \ - q6s16, q7s16, q8s16, q9s16); -static INLINE void __STORE_COMBINE_CENTER_RESULTS( - uint8_t *p1, - uint8_t *p2, - int stride, - int16x8_t q6s16, - int16x8_t q7s16, - int16x8_t q8s16, - int16x8_t q9s16) { - int16x4_t d8s16, d9s16, d10s16, d11s16; - - d8s16 = vld1_s16((int16_t *)p1); - p1 += stride; - d11s16 = vld1_s16((int16_t *)p2); - p2 -= stride; - d9s16 = vld1_s16((int16_t *)p1); - d10s16 = vld1_s16((int16_t *)p2); - - q7s16 = vrshrq_n_s16(q7s16, 6); - q8s16 = vrshrq_n_s16(q8s16, 6); - q9s16 = vrshrq_n_s16(q9s16, 6); - q6s16 = vrshrq_n_s16(q6s16, 6); - - q7s16 = vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(q7s16), - vreinterpret_u8_s16(d9s16))); - q8s16 = vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(q8s16), - vreinterpret_u8_s16(d10s16))); - q9s16 = vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(q9s16), - vreinterpret_u8_s16(d11s16))); - q6s16 = vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(q6s16), - vreinterpret_u8_s16(d8s16))); - - d9s16 = vreinterpret_s16_u8(vqmovun_s16(q7s16)); - d10s16 = vreinterpret_s16_u8(vqmovun_s16(q8s16)); - d11s16 = vreinterpret_s16_u8(vqmovun_s16(q9s16)); - d8s16 = vreinterpret_s16_u8(vqmovun_s16(q6s16)); - - vst1_s16((int16_t *)p1, d9s16); - p1 -= stride; - vst1_s16((int16_t *)p2, d10s16); - p2 += stride; - vst1_s16((int16_t *)p1, d8s16); - vst1_s16((int16_t *)p2, d11s16); - return; -} - -#define STORE_COMBINE_EXTREME_RESULTS(r7, r6); \ - __STORE_COMBINE_EXTREME_RESULTS(r7, r6, stride, \ - q4s16, q5s16, q6s16, q7s16); -static INLINE void __STORE_COMBINE_EXTREME_RESULTS( - uint8_t *p1, - uint8_t *p2, - int stride, - int16x8_t q4s16, - int16x8_t q5s16, - int16x8_t q6s16, - int16x8_t q7s16) { - int16x4_t d4s16, d5s16, d6s16, d7s16; - - d4s16 = vld1_s16((int16_t *)p1); - p1 += stride; - d7s16 = vld1_s16((int16_t *)p2); - p2 -= stride; - d5s16 = vld1_s16((int16_t *)p1); - d6s16 = vld1_s16((int16_t *)p2); - - q5s16 = vrshrq_n_s16(q5s16, 6); - q6s16 = vrshrq_n_s16(q6s16, 6); - q7s16 = vrshrq_n_s16(q7s16, 6); - q4s16 = vrshrq_n_s16(q4s16, 6); - - q5s16 = vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(q5s16), - vreinterpret_u8_s16(d5s16))); - q6s16 = vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(q6s16), - vreinterpret_u8_s16(d6s16))); - q7s16 = vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(q7s16), - vreinterpret_u8_s16(d7s16))); - q4s16 = vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(q4s16), - vreinterpret_u8_s16(d4s16))); - - d5s16 = vreinterpret_s16_u8(vqmovun_s16(q5s16)); - d6s16 = vreinterpret_s16_u8(vqmovun_s16(q6s16)); - d7s16 = vreinterpret_s16_u8(vqmovun_s16(q7s16)); - d4s16 = vreinterpret_s16_u8(vqmovun_s16(q4s16)); - - vst1_s16((int16_t *)p1, d5s16); - p1 -= stride; - vst1_s16((int16_t *)p2, d6s16); - p2 += stride; - vst1_s16((int16_t *)p2, d7s16); - vst1_s16((int16_t *)p1, d4s16); - return; -} - -#define DO_BUTTERFLY_STD(const_1, const_2, qA, qB) \ - DO_BUTTERFLY(q14s16, q13s16, const_1, const_2, qA, qB); -static INLINE void DO_BUTTERFLY( - int16x8_t q14s16, - int16x8_t q13s16, - int16_t first_const, - int16_t second_const, - int16x8_t *qAs16, - int16x8_t *qBs16) { - int16x4_t d30s16, d31s16; - int32x4_t q8s32, q9s32, q10s32, q11s32, q12s32, q15s32; - int16x4_t dCs16, dDs16, dAs16, dBs16; - - dCs16 = vget_low_s16(q14s16); - dDs16 = vget_high_s16(q14s16); - dAs16 = vget_low_s16(q13s16); - dBs16 = vget_high_s16(q13s16); - - d30s16 = vdup_n_s16(first_const); - d31s16 = vdup_n_s16(second_const); - - q8s32 = vmull_s16(dCs16, d30s16); - q10s32 = vmull_s16(dAs16, d31s16); - q9s32 = vmull_s16(dDs16, d30s16); - q11s32 = vmull_s16(dBs16, d31s16); - q12s32 = vmull_s16(dCs16, d31s16); - - q8s32 = vsubq_s32(q8s32, q10s32); - q9s32 = vsubq_s32(q9s32, q11s32); - - q10s32 = vmull_s16(dDs16, d31s16); - q11s32 = vmull_s16(dAs16, d30s16); - q15s32 = vmull_s16(dBs16, d30s16); - - q11s32 = vaddq_s32(q12s32, q11s32); - q10s32 = vaddq_s32(q10s32, q15s32); - - *qAs16 = vcombine_s16(vqrshrn_n_s32(q8s32, 14), - vqrshrn_n_s32(q9s32, 14)); - *qBs16 = vcombine_s16(vqrshrn_n_s32(q11s32, 14), - vqrshrn_n_s32(q10s32, 14)); - return; -} - -static INLINE void idct32_transpose_pair( - int16_t *input, - int16_t *t_buf) { - int16_t *in; - int i; - const int stride = 32; - int16x4_t d16s16, d17s16, d18s16, d19s16, d20s16, d21s16, d22s16, d23s16; - int16x4_t d24s16, d25s16, d26s16, d27s16, d28s16, d29s16, d30s16, d31s16; - int16x8_t q8s16, q9s16, q10s16, q11s16, q12s16, q13s16, q14s16, q15s16; - int32x4x2_t q0x2s32, q1x2s32, q2x2s32, q3x2s32; - int16x8x2_t q0x2s16, q1x2s16, q2x2s16, q3x2s16; - - for (i = 0; i < 4; i++, input += 8) { - in = input; - q8s16 = vld1q_s16(in); - in += stride; - q9s16 = vld1q_s16(in); - in += stride; - q10s16 = vld1q_s16(in); - in += stride; - q11s16 = vld1q_s16(in); - in += stride; - q12s16 = vld1q_s16(in); - in += stride; - q13s16 = vld1q_s16(in); - in += stride; - q14s16 = vld1q_s16(in); - in += stride; - q15s16 = vld1q_s16(in); - - d16s16 = vget_low_s16(q8s16); - d17s16 = vget_high_s16(q8s16); - d18s16 = vget_low_s16(q9s16); - d19s16 = vget_high_s16(q9s16); - d20s16 = vget_low_s16(q10s16); - d21s16 = vget_high_s16(q10s16); - d22s16 = vget_low_s16(q11s16); - d23s16 = vget_high_s16(q11s16); - d24s16 = vget_low_s16(q12s16); - d25s16 = vget_high_s16(q12s16); - d26s16 = vget_low_s16(q13s16); - d27s16 = vget_high_s16(q13s16); - d28s16 = vget_low_s16(q14s16); - d29s16 = vget_high_s16(q14s16); - d30s16 = vget_low_s16(q15s16); - d31s16 = vget_high_s16(q15s16); - - q8s16 = vcombine_s16(d16s16, d24s16); // vswp d17, d24 - q9s16 = vcombine_s16(d18s16, d26s16); // vswp d19, d26 - q10s16 = vcombine_s16(d20s16, d28s16); // vswp d21, d28 - q11s16 = vcombine_s16(d22s16, d30s16); // vswp d23, d30 - q12s16 = vcombine_s16(d17s16, d25s16); - q13s16 = vcombine_s16(d19s16, d27s16); - q14s16 = vcombine_s16(d21s16, d29s16); - q15s16 = vcombine_s16(d23s16, d31s16); - - q0x2s32 = vtrnq_s32(vreinterpretq_s32_s16(q8s16), - vreinterpretq_s32_s16(q10s16)); - q1x2s32 = vtrnq_s32(vreinterpretq_s32_s16(q9s16), - vreinterpretq_s32_s16(q11s16)); - q2x2s32 = vtrnq_s32(vreinterpretq_s32_s16(q12s16), - vreinterpretq_s32_s16(q14s16)); - q3x2s32 = vtrnq_s32(vreinterpretq_s32_s16(q13s16), - vreinterpretq_s32_s16(q15s16)); - - q0x2s16 = vtrnq_s16(vreinterpretq_s16_s32(q0x2s32.val[0]), // q8 - vreinterpretq_s16_s32(q1x2s32.val[0])); // q9 - q1x2s16 = vtrnq_s16(vreinterpretq_s16_s32(q0x2s32.val[1]), // q10 - vreinterpretq_s16_s32(q1x2s32.val[1])); // q11 - q2x2s16 = vtrnq_s16(vreinterpretq_s16_s32(q2x2s32.val[0]), // q12 - vreinterpretq_s16_s32(q3x2s32.val[0])); // q13 - q3x2s16 = vtrnq_s16(vreinterpretq_s16_s32(q2x2s32.val[1]), // q14 - vreinterpretq_s16_s32(q3x2s32.val[1])); // q15 - - vst1q_s16(t_buf, q0x2s16.val[0]); - t_buf += 8; - vst1q_s16(t_buf, q0x2s16.val[1]); - t_buf += 8; - vst1q_s16(t_buf, q1x2s16.val[0]); - t_buf += 8; - vst1q_s16(t_buf, q1x2s16.val[1]); - t_buf += 8; - vst1q_s16(t_buf, q2x2s16.val[0]); - t_buf += 8; - vst1q_s16(t_buf, q2x2s16.val[1]); - t_buf += 8; - vst1q_s16(t_buf, q3x2s16.val[0]); - t_buf += 8; - vst1q_s16(t_buf, q3x2s16.val[1]); - t_buf += 8; - } - return; -} - -static INLINE void idct32_bands_end_1st_pass( - int16_t *out, - int16x8_t q2s16, - int16x8_t q3s16, - int16x8_t q6s16, - int16x8_t q7s16, - int16x8_t q8s16, - int16x8_t q9s16, - int16x8_t q10s16, - int16x8_t q11s16, - int16x8_t q12s16, - int16x8_t q13s16, - int16x8_t q14s16, - int16x8_t q15s16) { - int16x8_t q0s16, q1s16, q4s16, q5s16; - - STORE_IN_OUTPUT(17, 16, 17, q6s16, q7s16); - STORE_IN_OUTPUT(17, 14, 15, q8s16, q9s16); - - LOAD_FROM_OUTPUT(15, 30, 31, q0s16, q1s16); - q4s16 = vaddq_s16(q2s16, q1s16); - q5s16 = vaddq_s16(q3s16, q0s16); - q6s16 = vsubq_s16(q3s16, q0s16); - q7s16 = vsubq_s16(q2s16, q1s16); - STORE_IN_OUTPUT(31, 30, 31, q6s16, q7s16); - STORE_IN_OUTPUT(31, 0, 1, q4s16, q5s16); - - LOAD_FROM_OUTPUT(1, 12, 13, q0s16, q1s16); - q2s16 = vaddq_s16(q10s16, q1s16); - q3s16 = vaddq_s16(q11s16, q0s16); - q4s16 = vsubq_s16(q11s16, q0s16); - q5s16 = vsubq_s16(q10s16, q1s16); - - LOAD_FROM_OUTPUT(13, 18, 19, q0s16, q1s16); - q8s16 = vaddq_s16(q4s16, q1s16); - q9s16 = vaddq_s16(q5s16, q0s16); - q6s16 = vsubq_s16(q5s16, q0s16); - q7s16 = vsubq_s16(q4s16, q1s16); - STORE_IN_OUTPUT(19, 18, 19, q6s16, q7s16); - STORE_IN_OUTPUT(19, 12, 13, q8s16, q9s16); - - LOAD_FROM_OUTPUT(13, 28, 29, q0s16, q1s16); - q4s16 = vaddq_s16(q2s16, q1s16); - q5s16 = vaddq_s16(q3s16, q0s16); - q6s16 = vsubq_s16(q3s16, q0s16); - q7s16 = vsubq_s16(q2s16, q1s16); - STORE_IN_OUTPUT(29, 28, 29, q6s16, q7s16); - STORE_IN_OUTPUT(29, 2, 3, q4s16, q5s16); - - LOAD_FROM_OUTPUT(3, 10, 11, q0s16, q1s16); - q2s16 = vaddq_s16(q12s16, q1s16); - q3s16 = vaddq_s16(q13s16, q0s16); - q4s16 = vsubq_s16(q13s16, q0s16); - q5s16 = vsubq_s16(q12s16, q1s16); - - LOAD_FROM_OUTPUT(11, 20, 21, q0s16, q1s16); - q8s16 = vaddq_s16(q4s16, q1s16); - q9s16 = vaddq_s16(q5s16, q0s16); - q6s16 = vsubq_s16(q5s16, q0s16); - q7s16 = vsubq_s16(q4s16, q1s16); - STORE_IN_OUTPUT(21, 20, 21, q6s16, q7s16); - STORE_IN_OUTPUT(21, 10, 11, q8s16, q9s16); - - LOAD_FROM_OUTPUT(11, 26, 27, q0s16, q1s16); - q4s16 = vaddq_s16(q2s16, q1s16); - q5s16 = vaddq_s16(q3s16, q0s16); - q6s16 = vsubq_s16(q3s16, q0s16); - q7s16 = vsubq_s16(q2s16, q1s16); - STORE_IN_OUTPUT(27, 26, 27, q6s16, q7s16); - STORE_IN_OUTPUT(27, 4, 5, q4s16, q5s16); - - LOAD_FROM_OUTPUT(5, 8, 9, q0s16, q1s16); - q2s16 = vaddq_s16(q14s16, q1s16); - q3s16 = vaddq_s16(q15s16, q0s16); - q4s16 = vsubq_s16(q15s16, q0s16); - q5s16 = vsubq_s16(q14s16, q1s16); - - LOAD_FROM_OUTPUT(9, 22, 23, q0s16, q1s16); - q8s16 = vaddq_s16(q4s16, q1s16); - q9s16 = vaddq_s16(q5s16, q0s16); - q6s16 = vsubq_s16(q5s16, q0s16); - q7s16 = vsubq_s16(q4s16, q1s16); - STORE_IN_OUTPUT(23, 22, 23, q6s16, q7s16); - STORE_IN_OUTPUT(23, 8, 9, q8s16, q9s16); - - LOAD_FROM_OUTPUT(9, 24, 25, q0s16, q1s16); - q4s16 = vaddq_s16(q2s16, q1s16); - q5s16 = vaddq_s16(q3s16, q0s16); - q6s16 = vsubq_s16(q3s16, q0s16); - q7s16 = vsubq_s16(q2s16, q1s16); - STORE_IN_OUTPUT(25, 24, 25, q6s16, q7s16); - STORE_IN_OUTPUT(25, 6, 7, q4s16, q5s16); - return; -} - -static INLINE void idct32_bands_end_2nd_pass( - int16_t *out, - uint8_t *dest, - int stride, - int16x8_t q2s16, - int16x8_t q3s16, - int16x8_t q6s16, - int16x8_t q7s16, - int16x8_t q8s16, - int16x8_t q9s16, - int16x8_t q10s16, - int16x8_t q11s16, - int16x8_t q12s16, - int16x8_t q13s16, - int16x8_t q14s16, - int16x8_t q15s16) { - uint8_t *r6 = dest + 31 * stride; - uint8_t *r7 = dest/* + 0 * stride*/; - uint8_t *r9 = dest + 15 * stride; - uint8_t *r10 = dest + 16 * stride; - int str2 = stride << 1; - int16x8_t q0s16, q1s16, q4s16, q5s16; - - STORE_COMBINE_CENTER_RESULTS(r10, r9); - r10 += str2; r9 -= str2; - - LOAD_FROM_OUTPUT(17, 30, 31, q0s16, q1s16) - q4s16 = vaddq_s16(q2s16, q1s16); - q5s16 = vaddq_s16(q3s16, q0s16); - q6s16 = vsubq_s16(q3s16, q0s16); - q7s16 = vsubq_s16(q2s16, q1s16); - STORE_COMBINE_EXTREME_RESULTS(r7, r6); - r7 += str2; r6 -= str2; - - LOAD_FROM_OUTPUT(31, 12, 13, q0s16, q1s16) - q2s16 = vaddq_s16(q10s16, q1s16); - q3s16 = vaddq_s16(q11s16, q0s16); - q4s16 = vsubq_s16(q11s16, q0s16); - q5s16 = vsubq_s16(q10s16, q1s16); - - LOAD_FROM_OUTPUT(13, 18, 19, q0s16, q1s16) - q8s16 = vaddq_s16(q4s16, q1s16); - q9s16 = vaddq_s16(q5s16, q0s16); - q6s16 = vsubq_s16(q5s16, q0s16); - q7s16 = vsubq_s16(q4s16, q1s16); - STORE_COMBINE_CENTER_RESULTS(r10, r9); - r10 += str2; r9 -= str2; - - LOAD_FROM_OUTPUT(19, 28, 29, q0s16, q1s16) - q4s16 = vaddq_s16(q2s16, q1s16); - q5s16 = vaddq_s16(q3s16, q0s16); - q6s16 = vsubq_s16(q3s16, q0s16); - q7s16 = vsubq_s16(q2s16, q1s16); - STORE_COMBINE_EXTREME_RESULTS(r7, r6); - r7 += str2; r6 -= str2; - - LOAD_FROM_OUTPUT(29, 10, 11, q0s16, q1s16) - q2s16 = vaddq_s16(q12s16, q1s16); - q3s16 = vaddq_s16(q13s16, q0s16); - q4s16 = vsubq_s16(q13s16, q0s16); - q5s16 = vsubq_s16(q12s16, q1s16); - - LOAD_FROM_OUTPUT(11, 20, 21, q0s16, q1s16) - q8s16 = vaddq_s16(q4s16, q1s16); - q9s16 = vaddq_s16(q5s16, q0s16); - q6s16 = vsubq_s16(q5s16, q0s16); - q7s16 = vsubq_s16(q4s16, q1s16); - STORE_COMBINE_CENTER_RESULTS(r10, r9); - r10 += str2; r9 -= str2; - - LOAD_FROM_OUTPUT(21, 26, 27, q0s16, q1s16) - q4s16 = vaddq_s16(q2s16, q1s16); - q5s16 = vaddq_s16(q3s16, q0s16); - q6s16 = vsubq_s16(q3s16, q0s16); - q7s16 = vsubq_s16(q2s16, q1s16); - STORE_COMBINE_EXTREME_RESULTS(r7, r6); - r7 += str2; r6 -= str2; - - LOAD_FROM_OUTPUT(27, 8, 9, q0s16, q1s16) - q2s16 = vaddq_s16(q14s16, q1s16); - q3s16 = vaddq_s16(q15s16, q0s16); - q4s16 = vsubq_s16(q15s16, q0s16); - q5s16 = vsubq_s16(q14s16, q1s16); - - LOAD_FROM_OUTPUT(9, 22, 23, q0s16, q1s16) - q8s16 = vaddq_s16(q4s16, q1s16); - q9s16 = vaddq_s16(q5s16, q0s16); - q6s16 = vsubq_s16(q5s16, q0s16); - q7s16 = vsubq_s16(q4s16, q1s16); - STORE_COMBINE_CENTER_RESULTS(r10, r9); - - LOAD_FROM_OUTPUT(23, 24, 25, q0s16, q1s16) - q4s16 = vaddq_s16(q2s16, q1s16); - q5s16 = vaddq_s16(q3s16, q0s16); - q6s16 = vsubq_s16(q3s16, q0s16); - q7s16 = vsubq_s16(q2s16, q1s16); - STORE_COMBINE_EXTREME_RESULTS(r7, r6); - return; -} - -void vp9_idct32x32_1024_add_neon( - int16_t *input, - uint8_t *dest, - int stride) { - int i, idct32_pass_loop; - int16_t trans_buf[32 * 8]; - int16_t pass1[32 * 32]; - int16_t pass2[32 * 32]; - int16_t *out; - int16x8_t q0s16, q1s16, q2s16, q3s16, q4s16, q5s16, q6s16, q7s16; - int16x8_t q8s16, q9s16, q10s16, q11s16, q12s16, q13s16, q14s16, q15s16; - - for (idct32_pass_loop = 0, out = pass1; - idct32_pass_loop < 2; - idct32_pass_loop++, - input = pass1, // the input of pass2 is the result of pass1 - out = pass2) { - for (i = 0; - i < 4; i++, - input += 32 * 8, out += 8) { // idct32_bands_loop - idct32_transpose_pair(input, trans_buf); - - // ----------------------------------------- - // BLOCK A: 16-19,28-31 - // ----------------------------------------- - // generate 16,17,30,31 - // part of stage 1 - LOAD_FROM_TRANSPOSED(0, 1, 31) - DO_BUTTERFLY_STD(cospi_31_64, cospi_1_64, &q0s16, &q2s16) - LOAD_FROM_TRANSPOSED(31, 17, 15) - DO_BUTTERFLY_STD(cospi_15_64, cospi_17_64, &q1s16, &q3s16) - // part of stage 2 - q4s16 = vaddq_s16(q0s16, q1s16); - q13s16 = vsubq_s16(q0s16, q1s16); - q6s16 = vaddq_s16(q2s16, q3s16); - q14s16 = vsubq_s16(q2s16, q3s16); - // part of stage 3 - DO_BUTTERFLY_STD(cospi_28_64, cospi_4_64, &q5s16, &q7s16) - - // generate 18,19,28,29 - // part of stage 1 - LOAD_FROM_TRANSPOSED(15, 9, 23) - DO_BUTTERFLY_STD(cospi_23_64, cospi_9_64, &q0s16, &q2s16) - LOAD_FROM_TRANSPOSED(23, 25, 7) - DO_BUTTERFLY_STD(cospi_7_64, cospi_25_64, &q1s16, &q3s16) - // part of stage 2 - q13s16 = vsubq_s16(q3s16, q2s16); - q3s16 = vaddq_s16(q3s16, q2s16); - q14s16 = vsubq_s16(q1s16, q0s16); - q2s16 = vaddq_s16(q1s16, q0s16); - // part of stage 3 - DO_BUTTERFLY_STD(-cospi_4_64, -cospi_28_64, &q1s16, &q0s16) - // part of stage 4 - q8s16 = vaddq_s16(q4s16, q2s16); - q9s16 = vaddq_s16(q5s16, q0s16); - q10s16 = vaddq_s16(q7s16, q1s16); - q15s16 = vaddq_s16(q6s16, q3s16); - q13s16 = vsubq_s16(q5s16, q0s16); - q14s16 = vsubq_s16(q7s16, q1s16); - STORE_IN_OUTPUT(0, 16, 31, q8s16, q15s16) - STORE_IN_OUTPUT(31, 17, 30, q9s16, q10s16) - // part of stage 5 - DO_BUTTERFLY_STD(cospi_24_64, cospi_8_64, &q0s16, &q1s16) - STORE_IN_OUTPUT(30, 29, 18, q1s16, q0s16) - // part of stage 4 - q13s16 = vsubq_s16(q4s16, q2s16); - q14s16 = vsubq_s16(q6s16, q3s16); - // part of stage 5 - DO_BUTTERFLY_STD(cospi_24_64, cospi_8_64, &q4s16, &q6s16) - STORE_IN_OUTPUT(18, 19, 28, q4s16, q6s16) - - // ----------------------------------------- - // BLOCK B: 20-23,24-27 - // ----------------------------------------- - // generate 20,21,26,27 - // part of stage 1 - LOAD_FROM_TRANSPOSED(7, 5, 27) - DO_BUTTERFLY_STD(cospi_27_64, cospi_5_64, &q0s16, &q2s16) - LOAD_FROM_TRANSPOSED(27, 21, 11) - DO_BUTTERFLY_STD(cospi_11_64, cospi_21_64, &q1s16, &q3s16) - // part of stage 2 - q13s16 = vsubq_s16(q0s16, q1s16); - q0s16 = vaddq_s16(q0s16, q1s16); - q14s16 = vsubq_s16(q2s16, q3s16); - q2s16 = vaddq_s16(q2s16, q3s16); - // part of stage 3 - DO_BUTTERFLY_STD(cospi_12_64, cospi_20_64, &q1s16, &q3s16) - - // generate 22,23,24,25 - // part of stage 1 - LOAD_FROM_TRANSPOSED(11, 13, 19) - DO_BUTTERFLY_STD(cospi_19_64, cospi_13_64, &q5s16, &q7s16) - LOAD_FROM_TRANSPOSED(19, 29, 3) - DO_BUTTERFLY_STD(cospi_3_64, cospi_29_64, &q4s16, &q6s16) - // part of stage 2 - q14s16 = vsubq_s16(q4s16, q5s16); - q5s16 = vaddq_s16(q4s16, q5s16); - q13s16 = vsubq_s16(q6s16, q7s16); - q6s16 = vaddq_s16(q6s16, q7s16); - // part of stage 3 - DO_BUTTERFLY_STD(-cospi_20_64, -cospi_12_64, &q4s16, &q7s16) - // part of stage 4 - q10s16 = vaddq_s16(q7s16, q1s16); - q11s16 = vaddq_s16(q5s16, q0s16); - q12s16 = vaddq_s16(q6s16, q2s16); - q15s16 = vaddq_s16(q4s16, q3s16); - // part of stage 6 - LOAD_FROM_OUTPUT(28, 16, 17, q14s16, q13s16) - q8s16 = vaddq_s16(q14s16, q11s16); - q9s16 = vaddq_s16(q13s16, q10s16); - q13s16 = vsubq_s16(q13s16, q10s16); - q11s16 = vsubq_s16(q14s16, q11s16); - STORE_IN_OUTPUT(17, 17, 16, q9s16, q8s16) - LOAD_FROM_OUTPUT(16, 30, 31, q14s16, q9s16) - q8s16 = vsubq_s16(q9s16, q12s16); - q10s16 = vaddq_s16(q14s16, q15s16); - q14s16 = vsubq_s16(q14s16, q15s16); - q12s16 = vaddq_s16(q9s16, q12s16); - STORE_IN_OUTPUT(31, 30, 31, q10s16, q12s16) - // part of stage 7 - DO_BUTTERFLY_STD(cospi_16_64, cospi_16_64, &q13s16, &q14s16) - STORE_IN_OUTPUT(31, 25, 22, q14s16, q13s16) - q13s16 = q11s16; - q14s16 = q8s16; - DO_BUTTERFLY_STD(cospi_16_64, cospi_16_64, &q13s16, &q14s16) - STORE_IN_OUTPUT(22, 24, 23, q14s16, q13s16) - // part of stage 4 - q14s16 = vsubq_s16(q5s16, q0s16); - q13s16 = vsubq_s16(q6s16, q2s16); - DO_BUTTERFLY_STD(-cospi_8_64, -cospi_24_64, &q5s16, &q6s16); - q14s16 = vsubq_s16(q7s16, q1s16); - q13s16 = vsubq_s16(q4s16, q3s16); - DO_BUTTERFLY_STD(-cospi_8_64, -cospi_24_64, &q0s16, &q1s16); - // part of stage 6 - LOAD_FROM_OUTPUT(23, 18, 19, q14s16, q13s16) - q8s16 = vaddq_s16(q14s16, q1s16); - q9s16 = vaddq_s16(q13s16, q6s16); - q13s16 = vsubq_s16(q13s16, q6s16); - q1s16 = vsubq_s16(q14s16, q1s16); - STORE_IN_OUTPUT(19, 18, 19, q8s16, q9s16) - LOAD_FROM_OUTPUT(19, 28, 29, q8s16, q9s16) - q14s16 = vsubq_s16(q8s16, q5s16); - q10s16 = vaddq_s16(q8s16, q5s16); - q11s16 = vaddq_s16(q9s16, q0s16); - q0s16 = vsubq_s16(q9s16, q0s16); - STORE_IN_OUTPUT(29, 28, 29, q10s16, q11s16) - // part of stage 7 - DO_BUTTERFLY_STD(cospi_16_64, cospi_16_64, &q13s16, &q14s16) - STORE_IN_OUTPUT(29, 20, 27, q13s16, q14s16) - DO_BUTTERFLY(q0s16, q1s16, cospi_16_64, cospi_16_64, - &q1s16, &q0s16); - STORE_IN_OUTPUT(27, 21, 26, q1s16, q0s16) - - // ----------------------------------------- - // BLOCK C: 8-10,11-15 - // ----------------------------------------- - // generate 8,9,14,15 - // part of stage 2 - LOAD_FROM_TRANSPOSED(3, 2, 30) - DO_BUTTERFLY_STD(cospi_30_64, cospi_2_64, &q0s16, &q2s16) - LOAD_FROM_TRANSPOSED(30, 18, 14) - DO_BUTTERFLY_STD(cospi_14_64, cospi_18_64, &q1s16, &q3s16) - // part of stage 3 - q13s16 = vsubq_s16(q0s16, q1s16); - q0s16 = vaddq_s16(q0s16, q1s16); - q14s16 = vsubq_s16(q2s16, q3s16); - q2s16 = vaddq_s16(q2s16, q3s16); - // part of stage 4 - DO_BUTTERFLY_STD(cospi_24_64, cospi_8_64, &q1s16, &q3s16) - - // generate 10,11,12,13 - // part of stage 2 - LOAD_FROM_TRANSPOSED(14, 10, 22) - DO_BUTTERFLY_STD(cospi_22_64, cospi_10_64, &q5s16, &q7s16) - LOAD_FROM_TRANSPOSED(22, 26, 6) - DO_BUTTERFLY_STD(cospi_6_64, cospi_26_64, &q4s16, &q6s16) - // part of stage 3 - q14s16 = vsubq_s16(q4s16, q5s16); - q5s16 = vaddq_s16(q4s16, q5s16); - q13s16 = vsubq_s16(q6s16, q7s16); - q6s16 = vaddq_s16(q6s16, q7s16); - // part of stage 4 - DO_BUTTERFLY_STD(-cospi_8_64, -cospi_24_64, &q4s16, &q7s16) - // part of stage 5 - q8s16 = vaddq_s16(q0s16, q5s16); - q9s16 = vaddq_s16(q1s16, q7s16); - q13s16 = vsubq_s16(q1s16, q7s16); - q14s16 = vsubq_s16(q3s16, q4s16); - q10s16 = vaddq_s16(q3s16, q4s16); - q15s16 = vaddq_s16(q2s16, q6s16); - STORE_IN_OUTPUT(26, 8, 15, q8s16, q15s16) - STORE_IN_OUTPUT(15, 9, 14, q9s16, q10s16) - // part of stage 6 - DO_BUTTERFLY_STD(cospi_16_64, cospi_16_64, &q1s16, &q3s16) - STORE_IN_OUTPUT(14, 13, 10, q3s16, q1s16) - q13s16 = vsubq_s16(q0s16, q5s16); - q14s16 = vsubq_s16(q2s16, q6s16); - DO_BUTTERFLY_STD(cospi_16_64, cospi_16_64, &q1s16, &q3s16) - STORE_IN_OUTPUT(10, 11, 12, q1s16, q3s16) - - // ----------------------------------------- - // BLOCK D: 0-3,4-7 - // ----------------------------------------- - // generate 4,5,6,7 - // part of stage 3 - LOAD_FROM_TRANSPOSED(6, 4, 28) - DO_BUTTERFLY_STD(cospi_28_64, cospi_4_64, &q0s16, &q2s16) - LOAD_FROM_TRANSPOSED(28, 20, 12) - DO_BUTTERFLY_STD(cospi_12_64, cospi_20_64, &q1s16, &q3s16) - // part of stage 4 - q13s16 = vsubq_s16(q0s16, q1s16); - q0s16 = vaddq_s16(q0s16, q1s16); - q14s16 = vsubq_s16(q2s16, q3s16); - q2s16 = vaddq_s16(q2s16, q3s16); - // part of stage 5 - DO_BUTTERFLY_STD(cospi_16_64, cospi_16_64, &q1s16, &q3s16) - - // generate 0,1,2,3 - // part of stage 4 - LOAD_FROM_TRANSPOSED(12, 0, 16) - DO_BUTTERFLY_STD(cospi_16_64, cospi_16_64, &q5s16, &q7s16) - LOAD_FROM_TRANSPOSED(16, 8, 24) - DO_BUTTERFLY_STD(cospi_24_64, cospi_8_64, &q14s16, &q6s16) - // part of stage 5 - q4s16 = vaddq_s16(q7s16, q6s16); - q7s16 = vsubq_s16(q7s16, q6s16); - q6s16 = vsubq_s16(q5s16, q14s16); - q5s16 = vaddq_s16(q5s16, q14s16); - // part of stage 6 - q8s16 = vaddq_s16(q4s16, q2s16); - q9s16 = vaddq_s16(q5s16, q3s16); - q10s16 = vaddq_s16(q6s16, q1s16); - q11s16 = vaddq_s16(q7s16, q0s16); - q12s16 = vsubq_s16(q7s16, q0s16); - q13s16 = vsubq_s16(q6s16, q1s16); - q14s16 = vsubq_s16(q5s16, q3s16); - q15s16 = vsubq_s16(q4s16, q2s16); - // part of stage 7 - LOAD_FROM_OUTPUT(12, 14, 15, q0s16, q1s16) - q2s16 = vaddq_s16(q8s16, q1s16); - q3s16 = vaddq_s16(q9s16, q0s16); - q4s16 = vsubq_s16(q9s16, q0s16); - q5s16 = vsubq_s16(q8s16, q1s16); - LOAD_FROM_OUTPUT(15, 16, 17, q0s16, q1s16) - q8s16 = vaddq_s16(q4s16, q1s16); - q9s16 = vaddq_s16(q5s16, q0s16); - q6s16 = vsubq_s16(q5s16, q0s16); - q7s16 = vsubq_s16(q4s16, q1s16); - - if (idct32_pass_loop == 0) { - idct32_bands_end_1st_pass(out, - q2s16, q3s16, q6s16, q7s16, q8s16, q9s16, - q10s16, q11s16, q12s16, q13s16, q14s16, q15s16); - } else { - idct32_bands_end_2nd_pass(out, dest, stride, - q2s16, q3s16, q6s16, q7s16, q8s16, q9s16, - q10s16, q11s16, q12s16, q13s16, q14s16, q15s16); - dest += 8; - } - } - } - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct4x4_1_add_neon_asm.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct4x4_1_add_neon_asm.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct4x4_1_add_neon_asm.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct4x4_1_add_neon_asm.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -; -; Copyright (c) 2013 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license and patent -; grant that can be found in the LICENSE file in the root of the source -; tree. All contributing project authors may be found in the AUTHORS -; file in the root of the source tree. -; - - - EXPORT |vp9_idct4x4_1_add_neon| - ARM - REQUIRE8 - PRESERVE8 - - AREA ||.text||, CODE, READONLY, ALIGN=2 - -;void vp9_idct4x4_1_add_neon(int16_t *input, uint8_t *dest, -; int dest_stride) -; -; r0 int16_t input -; r1 uint8_t *dest -; r2 int dest_stride) - -|vp9_idct4x4_1_add_neon| PROC - ldrsh r0, [r0] - - ; generate cospi_16_64 = 11585 - mov r12, #0x2d00 - add r12, #0x41 - - ; out = dct_const_round_shift(input[0] * cospi_16_64) - mul r0, r0, r12 ; input[0] * cospi_16_64 - add r0, r0, #0x2000 ; +(1 << ((DCT_CONST_BITS) - 1)) - asr r0, r0, #14 ; >> DCT_CONST_BITS - - ; out = dct_const_round_shift(out * cospi_16_64) - mul r0, r0, r12 ; out * cospi_16_64 - mov r12, r1 ; save dest - add r0, r0, #0x2000 ; +(1 << ((DCT_CONST_BITS) - 1)) - asr r0, r0, #14 ; >> DCT_CONST_BITS - - ; a1 = ROUND_POWER_OF_TWO(out, 4) - add r0, r0, #8 ; + (1 <<((4) - 1)) - asr r0, r0, #4 ; >> 4 - - vdup.s16 q0, r0 ; duplicate a1 - - vld1.32 {d2[0]}, [r1], r2 - vld1.32 {d2[1]}, [r1], r2 - vld1.32 {d4[0]}, [r1], r2 - vld1.32 {d4[1]}, [r1] - - vaddw.u8 q8, q0, d2 ; dest[x] + a1 - vaddw.u8 q9, q0, d4 - - vqmovun.s16 d6, q8 ; clip_pixel - vqmovun.s16 d7, q9 - - vst1.32 {d6[0]}, [r12], r2 - vst1.32 {d6[1]}, [r12], r2 - vst1.32 {d7[0]}, [r12], r2 - vst1.32 {d7[1]}, [r12] - - bx lr - ENDP ; |vp9_idct4x4_1_add_neon| - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct4x4_1_add_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct4x4_1_add_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct4x4_1_add_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct4x4_1_add_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "vp9/common/vp9_idct.h" - -void vp9_idct4x4_1_add_neon( - int16_t *input, - uint8_t *dest, - int dest_stride) { - uint8x8_t d6u8; - uint32x2_t d2u32 = vdup_n_u32(0); - uint16x8_t q8u16; - int16x8_t q0s16; - uint8_t *d1, *d2; - int16_t i, a1, cospi_16_64 = 11585; - int16_t out = dct_const_round_shift(input[0] * cospi_16_64); - out = dct_const_round_shift(out * cospi_16_64); - a1 = ROUND_POWER_OF_TWO(out, 4); - - q0s16 = vdupq_n_s16(a1); - - // dc_only_idct_add - d1 = d2 = dest; - for (i = 0; i < 2; i++) { - d2u32 = vld1_lane_u32((const uint32_t *)d1, d2u32, 0); - d1 += dest_stride; - d2u32 = vld1_lane_u32((const uint32_t *)d1, d2u32, 1); - d1 += dest_stride; - - q8u16 = vaddw_u8(vreinterpretq_u16_s16(q0s16), - vreinterpret_u8_u32(d2u32)); - d6u8 = vqmovun_s16(vreinterpretq_s16_u16(q8u16)); - - vst1_lane_u32((uint32_t *)d2, vreinterpret_u32_u8(d6u8), 0); - d2 += dest_stride; - vst1_lane_u32((uint32_t *)d2, vreinterpret_u32_u8(d6u8), 1); - d2 += dest_stride; - } - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct4x4_add_neon_asm.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct4x4_add_neon_asm.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct4x4_add_neon_asm.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct4x4_add_neon_asm.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,190 +0,0 @@ -; -; Copyright (c) 2013 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - EXPORT |vp9_idct4x4_16_add_neon| - ARM - REQUIRE8 - PRESERVE8 - - AREA ||.text||, CODE, READONLY, ALIGN=2 - - AREA Block, CODE, READONLY ; name this block of code -;void vp9_idct4x4_16_add_neon(int16_t *input, uint8_t *dest, int dest_stride) -; -; r0 int16_t input -; r1 uint8_t *dest -; r2 int dest_stride) - -|vp9_idct4x4_16_add_neon| PROC - - ; The 2D transform is done with two passes which are actually pretty - ; similar. We first transform the rows. This is done by transposing - ; the inputs, doing an SIMD column transform (the columns are the - ; transposed rows) and then transpose the results (so that it goes back - ; in normal/row positions). Then, we transform the columns by doing - ; another SIMD column transform. - ; So, two passes of a transpose followed by a column transform. - - ; load the inputs into q8-q9, d16-d19 - vld1.s16 {q8,q9}, [r0]! - - ; generate scalar constants - ; cospi_8_64 = 15137 = 0x3b21 - mov r0, #0x3b00 - add r0, #0x21 - ; cospi_16_64 = 11585 = 0x2d41 - mov r3, #0x2d00 - add r3, #0x41 - ; cospi_24_64 = 6270 = 0x 187e - mov r12, #0x1800 - add r12, #0x7e - - ; transpose the input data - ; 00 01 02 03 d16 - ; 10 11 12 13 d17 - ; 20 21 22 23 d18 - ; 30 31 32 33 d19 - vtrn.16 d16, d17 - vtrn.16 d18, d19 - - ; generate constant vectors - vdup.16 d20, r0 ; replicate cospi_8_64 - vdup.16 d21, r3 ; replicate cospi_16_64 - - ; 00 10 02 12 d16 - ; 01 11 03 13 d17 - ; 20 30 22 32 d18 - ; 21 31 23 33 d19 - vtrn.32 q8, q9 - ; 00 10 20 30 d16 - ; 01 11 21 31 d17 - ; 02 12 22 32 d18 - ; 03 13 23 33 d19 - - vdup.16 d22, r12 ; replicate cospi_24_64 - - ; do the transform on transposed rows - - ; stage 1 - vadd.s16 d23, d16, d18 ; (input[0] + input[2]) - vsub.s16 d24, d16, d18 ; (input[0] - input[2]) - - vmull.s16 q15, d17, d22 ; input[1] * cospi_24_64 - vmull.s16 q1, d17, d20 ; input[1] * cospi_8_64 - - ; (input[0] + input[2]) * cospi_16_64; - ; (input[0] - input[2]) * cospi_16_64; - vmull.s16 q13, d23, d21 - vmull.s16 q14, d24, d21 - - ; input[1] * cospi_24_64 - input[3] * cospi_8_64; - ; input[1] * cospi_8_64 + input[3] * cospi_24_64; - vmlsl.s16 q15, d19, d20 - vmlal.s16 q1, d19, d22 - - ; dct_const_round_shift - vqrshrn.s32 d26, q13, #14 - vqrshrn.s32 d27, q14, #14 - vqrshrn.s32 d29, q15, #14 - vqrshrn.s32 d28, q1, #14 - - ; stage 2 - ; output[0] = step[0] + step[3]; - ; output[1] = step[1] + step[2]; - ; output[3] = step[0] - step[3]; - ; output[2] = step[1] - step[2]; - vadd.s16 q8, q13, q14 - vsub.s16 q9, q13, q14 - vswp d18, d19 - - ; transpose the results - ; 00 01 02 03 d16 - ; 10 11 12 13 d17 - ; 20 21 22 23 d18 - ; 30 31 32 33 d19 - vtrn.16 d16, d17 - vtrn.16 d18, d19 - ; 00 10 02 12 d16 - ; 01 11 03 13 d17 - ; 20 30 22 32 d18 - ; 21 31 23 33 d19 - vtrn.32 q8, q9 - ; 00 10 20 30 d16 - ; 01 11 21 31 d17 - ; 02 12 22 32 d18 - ; 03 13 23 33 d19 - - ; do the transform on columns - - ; stage 1 - vadd.s16 d23, d16, d18 ; (input[0] + input[2]) - vsub.s16 d24, d16, d18 ; (input[0] - input[2]) - - vmull.s16 q15, d17, d22 ; input[1] * cospi_24_64 - vmull.s16 q1, d17, d20 ; input[1] * cospi_8_64 - - ; (input[0] + input[2]) * cospi_16_64; - ; (input[0] - input[2]) * cospi_16_64; - vmull.s16 q13, d23, d21 - vmull.s16 q14, d24, d21 - - ; input[1] * cospi_24_64 - input[3] * cospi_8_64; - ; input[1] * cospi_8_64 + input[3] * cospi_24_64; - vmlsl.s16 q15, d19, d20 - vmlal.s16 q1, d19, d22 - - ; dct_const_round_shift - vqrshrn.s32 d26, q13, #14 - vqrshrn.s32 d27, q14, #14 - vqrshrn.s32 d29, q15, #14 - vqrshrn.s32 d28, q1, #14 - - ; stage 2 - ; output[0] = step[0] + step[3]; - ; output[1] = step[1] + step[2]; - ; output[3] = step[0] - step[3]; - ; output[2] = step[1] - step[2]; - vadd.s16 q8, q13, q14 - vsub.s16 q9, q13, q14 - - ; The results are in two registers, one of them being swapped. This will - ; be taken care of by loading the 'dest' value in a swapped fashion and - ; also storing them in the same swapped fashion. - ; temp_out[0, 1] = d16, d17 = q8 - ; temp_out[2, 3] = d19, d18 = q9 swapped - - ; ROUND_POWER_OF_TWO(temp_out[j], 4) - vrshr.s16 q8, q8, #4 - vrshr.s16 q9, q9, #4 - - vld1.32 {d26[0]}, [r1], r2 - vld1.32 {d26[1]}, [r1], r2 - vld1.32 {d27[1]}, [r1], r2 - vld1.32 {d27[0]}, [r1] ; no post-increment - - ; ROUND_POWER_OF_TWO(temp_out[j], 4) + dest[j * dest_stride + i] - vaddw.u8 q8, q8, d26 - vaddw.u8 q9, q9, d27 - - ; clip_pixel - vqmovun.s16 d26, q8 - vqmovun.s16 d27, q9 - - ; do the stores in reverse order with negative post-increment, by changing - ; the sign of the stride - rsb r2, r2, #0 - vst1.32 {d27[0]}, [r1], r2 - vst1.32 {d27[1]}, [r1], r2 - vst1.32 {d26[1]}, [r1], r2 - vst1.32 {d26[0]}, [r1] ; no post-increment - bx lr - ENDP ; |vp9_idct4x4_16_add_neon| - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct4x4_add_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct4x4_add_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct4x4_add_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct4x4_add_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,151 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -void vp9_idct4x4_16_add_neon( - int16_t *input, - uint8_t *dest, - int dest_stride) { - uint8x8_t d26u8, d27u8; - uint32x2_t d26u32, d27u32; - uint16x8_t q8u16, q9u16; - int16x4_t d16s16, d17s16, d18s16, d19s16, d20s16, d21s16; - int16x4_t d22s16, d23s16, d24s16, d26s16, d27s16, d28s16, d29s16; - int16x8_t q8s16, q9s16, q13s16, q14s16; - int32x4_t q1s32, q13s32, q14s32, q15s32; - int16x4x2_t d0x2s16, d1x2s16; - int32x4x2_t q0x2s32; - uint8_t *d; - int16_t cospi_8_64 = 15137; - int16_t cospi_16_64 = 11585; - int16_t cospi_24_64 = 6270; - - d26u32 = d27u32 = vdup_n_u32(0); - - q8s16 = vld1q_s16(input); - q9s16 = vld1q_s16(input + 8); - - d16s16 = vget_low_s16(q8s16); - d17s16 = vget_high_s16(q8s16); - d18s16 = vget_low_s16(q9s16); - d19s16 = vget_high_s16(q9s16); - - d0x2s16 = vtrn_s16(d16s16, d17s16); - d1x2s16 = vtrn_s16(d18s16, d19s16); - q8s16 = vcombine_s16(d0x2s16.val[0], d0x2s16.val[1]); - q9s16 = vcombine_s16(d1x2s16.val[0], d1x2s16.val[1]); - - d20s16 = vdup_n_s16(cospi_8_64); - d21s16 = vdup_n_s16(cospi_16_64); - - q0x2s32 = vtrnq_s32(vreinterpretq_s32_s16(q8s16), - vreinterpretq_s32_s16(q9s16)); - d16s16 = vget_low_s16(vreinterpretq_s16_s32(q0x2s32.val[0])); - d17s16 = vget_high_s16(vreinterpretq_s16_s32(q0x2s32.val[0])); - d18s16 = vget_low_s16(vreinterpretq_s16_s32(q0x2s32.val[1])); - d19s16 = vget_high_s16(vreinterpretq_s16_s32(q0x2s32.val[1])); - - d22s16 = vdup_n_s16(cospi_24_64); - - // stage 1 - d23s16 = vadd_s16(d16s16, d18s16); - d24s16 = vsub_s16(d16s16, d18s16); - - q15s32 = vmull_s16(d17s16, d22s16); - q1s32 = vmull_s16(d17s16, d20s16); - q13s32 = vmull_s16(d23s16, d21s16); - q14s32 = vmull_s16(d24s16, d21s16); - - q15s32 = vmlsl_s16(q15s32, d19s16, d20s16); - q1s32 = vmlal_s16(q1s32, d19s16, d22s16); - - d26s16 = vqrshrn_n_s32(q13s32, 14); - d27s16 = vqrshrn_n_s32(q14s32, 14); - d29s16 = vqrshrn_n_s32(q15s32, 14); - d28s16 = vqrshrn_n_s32(q1s32, 14); - q13s16 = vcombine_s16(d26s16, d27s16); - q14s16 = vcombine_s16(d28s16, d29s16); - - // stage 2 - q8s16 = vaddq_s16(q13s16, q14s16); - q9s16 = vsubq_s16(q13s16, q14s16); - - d16s16 = vget_low_s16(q8s16); - d17s16 = vget_high_s16(q8s16); - d18s16 = vget_high_s16(q9s16); // vswp d18 d19 - d19s16 = vget_low_s16(q9s16); - - d0x2s16 = vtrn_s16(d16s16, d17s16); - d1x2s16 = vtrn_s16(d18s16, d19s16); - q8s16 = vcombine_s16(d0x2s16.val[0], d0x2s16.val[1]); - q9s16 = vcombine_s16(d1x2s16.val[0], d1x2s16.val[1]); - - q0x2s32 = vtrnq_s32(vreinterpretq_s32_s16(q8s16), - vreinterpretq_s32_s16(q9s16)); - d16s16 = vget_low_s16(vreinterpretq_s16_s32(q0x2s32.val[0])); - d17s16 = vget_high_s16(vreinterpretq_s16_s32(q0x2s32.val[0])); - d18s16 = vget_low_s16(vreinterpretq_s16_s32(q0x2s32.val[1])); - d19s16 = vget_high_s16(vreinterpretq_s16_s32(q0x2s32.val[1])); - - // do the transform on columns - // stage 1 - d23s16 = vadd_s16(d16s16, d18s16); - d24s16 = vsub_s16(d16s16, d18s16); - - q15s32 = vmull_s16(d17s16, d22s16); - q1s32 = vmull_s16(d17s16, d20s16); - q13s32 = vmull_s16(d23s16, d21s16); - q14s32 = vmull_s16(d24s16, d21s16); - - q15s32 = vmlsl_s16(q15s32, d19s16, d20s16); - q1s32 = vmlal_s16(q1s32, d19s16, d22s16); - - d26s16 = vqrshrn_n_s32(q13s32, 14); - d27s16 = vqrshrn_n_s32(q14s32, 14); - d29s16 = vqrshrn_n_s32(q15s32, 14); - d28s16 = vqrshrn_n_s32(q1s32, 14); - q13s16 = vcombine_s16(d26s16, d27s16); - q14s16 = vcombine_s16(d28s16, d29s16); - - // stage 2 - q8s16 = vaddq_s16(q13s16, q14s16); - q9s16 = vsubq_s16(q13s16, q14s16); - - q8s16 = vrshrq_n_s16(q8s16, 4); - q9s16 = vrshrq_n_s16(q9s16, 4); - - d = dest; - d26u32 = vld1_lane_u32((const uint32_t *)d, d26u32, 0); - d += dest_stride; - d26u32 = vld1_lane_u32((const uint32_t *)d, d26u32, 1); - d += dest_stride; - d27u32 = vld1_lane_u32((const uint32_t *)d, d27u32, 1); - d += dest_stride; - d27u32 = vld1_lane_u32((const uint32_t *)d, d27u32, 0); - - q8u16 = vaddw_u8(vreinterpretq_u16_s16(q8s16), - vreinterpret_u8_u32(d26u32)); - q9u16 = vaddw_u8(vreinterpretq_u16_s16(q9s16), - vreinterpret_u8_u32(d27u32)); - - d26u8 = vqmovun_s16(vreinterpretq_s16_u16(q8u16)); - d27u8 = vqmovun_s16(vreinterpretq_s16_u16(q9u16)); - - d = dest; - vst1_lane_u32((uint32_t *)d, vreinterpret_u32_u8(d26u8), 0); - d += dest_stride; - vst1_lane_u32((uint32_t *)d, vreinterpret_u32_u8(d26u8), 1); - d += dest_stride; - vst1_lane_u32((uint32_t *)d, vreinterpret_u32_u8(d27u8), 1); - d += dest_stride; - vst1_lane_u32((uint32_t *)d, vreinterpret_u32_u8(d27u8), 0); - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct8x8_1_add_neon_asm.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct8x8_1_add_neon_asm.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct8x8_1_add_neon_asm.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct8x8_1_add_neon_asm.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -; -; Copyright (c) 2013 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license and patent -; grant that can be found in the LICENSE file in the root of the source -; tree. All contributing project authors may be found in the AUTHORS -; file in the root of the source tree. -; - - - EXPORT |vp9_idct8x8_1_add_neon| - ARM - REQUIRE8 - PRESERVE8 - - AREA ||.text||, CODE, READONLY, ALIGN=2 - -;void vp9_idct8x8_1_add_neon(int16_t *input, uint8_t *dest, -; int dest_stride) -; -; r0 int16_t input -; r1 uint8_t *dest -; r2 int dest_stride) - -|vp9_idct8x8_1_add_neon| PROC - ldrsh r0, [r0] - - ; generate cospi_16_64 = 11585 - mov r12, #0x2d00 - add r12, #0x41 - - ; out = dct_const_round_shift(input[0] * cospi_16_64) - mul r0, r0, r12 ; input[0] * cospi_16_64 - add r0, r0, #0x2000 ; +(1 << ((DCT_CONST_BITS) - 1)) - asr r0, r0, #14 ; >> DCT_CONST_BITS - - ; out = dct_const_round_shift(out * cospi_16_64) - mul r0, r0, r12 ; out * cospi_16_64 - mov r12, r1 ; save dest - add r0, r0, #0x2000 ; +(1 << ((DCT_CONST_BITS) - 1)) - asr r0, r0, #14 ; >> DCT_CONST_BITS - - ; a1 = ROUND_POWER_OF_TWO(out, 5) - add r0, r0, #16 ; + (1 <<((5) - 1)) - asr r0, r0, #5 ; >> 5 - - vdup.s16 q0, r0 ; duplicate a1 - - ; load destination data - vld1.64 {d2}, [r1], r2 - vld1.64 {d3}, [r1], r2 - vld1.64 {d4}, [r1], r2 - vld1.64 {d5}, [r1], r2 - vld1.64 {d6}, [r1], r2 - vld1.64 {d7}, [r1], r2 - vld1.64 {d16}, [r1], r2 - vld1.64 {d17}, [r1] - - vaddw.u8 q9, q0, d2 ; dest[x] + a1 - vaddw.u8 q10, q0, d3 ; dest[x] + a1 - vaddw.u8 q11, q0, d4 ; dest[x] + a1 - vaddw.u8 q12, q0, d5 ; dest[x] + a1 - vqmovun.s16 d2, q9 ; clip_pixel - vqmovun.s16 d3, q10 ; clip_pixel - vqmovun.s16 d30, q11 ; clip_pixel - vqmovun.s16 d31, q12 ; clip_pixel - vst1.64 {d2}, [r12], r2 - vst1.64 {d3}, [r12], r2 - vst1.64 {d30}, [r12], r2 - vst1.64 {d31}, [r12], r2 - - vaddw.u8 q9, q0, d6 ; dest[x] + a1 - vaddw.u8 q10, q0, d7 ; dest[x] + a1 - vaddw.u8 q11, q0, d16 ; dest[x] + a1 - vaddw.u8 q12, q0, d17 ; dest[x] + a1 - vqmovun.s16 d2, q9 ; clip_pixel - vqmovun.s16 d3, q10 ; clip_pixel - vqmovun.s16 d30, q11 ; clip_pixel - vqmovun.s16 d31, q12 ; clip_pixel - vst1.64 {d2}, [r12], r2 - vst1.64 {d3}, [r12], r2 - vst1.64 {d30}, [r12], r2 - vst1.64 {d31}, [r12], r2 - - bx lr - ENDP ; |vp9_idct8x8_1_add_neon| - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct8x8_1_add_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct8x8_1_add_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct8x8_1_add_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct8x8_1_add_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "vp9/common/vp9_idct.h" - -void vp9_idct8x8_1_add_neon( - int16_t *input, - uint8_t *dest, - int dest_stride) { - uint8x8_t d2u8, d3u8, d30u8, d31u8; - uint64x1_t d2u64, d3u64, d4u64, d5u64; - uint16x8_t q0u16, q9u16, q10u16, q11u16, q12u16; - int16x8_t q0s16; - uint8_t *d1, *d2; - int16_t i, a1, cospi_16_64 = 11585; - int16_t out = dct_const_round_shift(input[0] * cospi_16_64); - out = dct_const_round_shift(out * cospi_16_64); - a1 = ROUND_POWER_OF_TWO(out, 5); - - q0s16 = vdupq_n_s16(a1); - q0u16 = vreinterpretq_u16_s16(q0s16); - - d1 = d2 = dest; - for (i = 0; i < 2; i++) { - d2u64 = vld1_u64((const uint64_t *)d1); - d1 += dest_stride; - d3u64 = vld1_u64((const uint64_t *)d1); - d1 += dest_stride; - d4u64 = vld1_u64((const uint64_t *)d1); - d1 += dest_stride; - d5u64 = vld1_u64((const uint64_t *)d1); - d1 += dest_stride; - - q9u16 = vaddw_u8(q0u16, vreinterpret_u8_u64(d2u64)); - q10u16 = vaddw_u8(q0u16, vreinterpret_u8_u64(d3u64)); - q11u16 = vaddw_u8(q0u16, vreinterpret_u8_u64(d4u64)); - q12u16 = vaddw_u8(q0u16, vreinterpret_u8_u64(d5u64)); - - d2u8 = vqmovun_s16(vreinterpretq_s16_u16(q9u16)); - d3u8 = vqmovun_s16(vreinterpretq_s16_u16(q10u16)); - d30u8 = vqmovun_s16(vreinterpretq_s16_u16(q11u16)); - d31u8 = vqmovun_s16(vreinterpretq_s16_u16(q12u16)); - - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d2u8)); - d2 += dest_stride; - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d3u8)); - d2 += dest_stride; - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d30u8)); - d2 += dest_stride; - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d31u8)); - d2 += dest_stride; - } - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct8x8_add_neon_asm.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct8x8_add_neon_asm.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct8x8_add_neon_asm.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct8x8_add_neon_asm.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,519 +0,0 @@ -; -; Copyright (c) 2013 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - EXPORT |vp9_idct8x8_64_add_neon| - EXPORT |vp9_idct8x8_12_add_neon| - ARM - REQUIRE8 - PRESERVE8 - - AREA ||.text||, CODE, READONLY, ALIGN=2 - - ; Parallel 1D IDCT on all the columns of a 8x8 16bit data matrix which are - ; loaded in q8-q15. The output will be stored back into q8-q15 registers. - ; This macro will touch q0-q7 registers and use them as buffer during - ; calculation. - MACRO - IDCT8x8_1D - ; stage 1 - vdup.16 d0, r3 ; duplicate cospi_28_64 - vdup.16 d1, r4 ; duplicate cospi_4_64 - vdup.16 d2, r5 ; duplicate cospi_12_64 - vdup.16 d3, r6 ; duplicate cospi_20_64 - - ; input[1] * cospi_28_64 - vmull.s16 q2, d18, d0 - vmull.s16 q3, d19, d0 - - ; input[5] * cospi_12_64 - vmull.s16 q5, d26, d2 - vmull.s16 q6, d27, d2 - - ; input[1]*cospi_28_64-input[7]*cospi_4_64 - vmlsl.s16 q2, d30, d1 - vmlsl.s16 q3, d31, d1 - - ; input[5] * cospi_12_64 - input[3] * cospi_20_64 - vmlsl.s16 q5, d22, d3 - vmlsl.s16 q6, d23, d3 - - ; dct_const_round_shift(input_dc * cospi_16_64) - vqrshrn.s32 d8, q2, #14 ; >> 14 - vqrshrn.s32 d9, q3, #14 ; >> 14 - - ; dct_const_round_shift(input_dc * cospi_16_64) - vqrshrn.s32 d10, q5, #14 ; >> 14 - vqrshrn.s32 d11, q6, #14 ; >> 14 - - ; input[1] * cospi_4_64 - vmull.s16 q2, d18, d1 - vmull.s16 q3, d19, d1 - - ; input[5] * cospi_20_64 - vmull.s16 q9, d26, d3 - vmull.s16 q13, d27, d3 - - ; input[1]*cospi_4_64+input[7]*cospi_28_64 - vmlal.s16 q2, d30, d0 - vmlal.s16 q3, d31, d0 - - ; input[5] * cospi_20_64 + input[3] * cospi_12_64 - vmlal.s16 q9, d22, d2 - vmlal.s16 q13, d23, d2 - - ; dct_const_round_shift(input_dc * cospi_16_64) - vqrshrn.s32 d14, q2, #14 ; >> 14 - vqrshrn.s32 d15, q3, #14 ; >> 14 - - ; stage 2 & stage 3 - even half - vdup.16 d0, r7 ; duplicate cospi_16_64 - - ; dct_const_round_shift(input_dc * cospi_16_64) - vqrshrn.s32 d12, q9, #14 ; >> 14 - vqrshrn.s32 d13, q13, #14 ; >> 14 - - ; input[0] * cospi_16_64 - vmull.s16 q2, d16, d0 - vmull.s16 q3, d17, d0 - - ; input[0] * cospi_16_64 - vmull.s16 q13, d16, d0 - vmull.s16 q15, d17, d0 - - ; (input[0] + input[2]) * cospi_16_64 - vmlal.s16 q2, d24, d0 - vmlal.s16 q3, d25, d0 - - ; (input[0] - input[2]) * cospi_16_64 - vmlsl.s16 q13, d24, d0 - vmlsl.s16 q15, d25, d0 - - vdup.16 d0, r8 ; duplicate cospi_24_64 - vdup.16 d1, r9 ; duplicate cospi_8_64 - - ; dct_const_round_shift(input_dc * cospi_16_64) - vqrshrn.s32 d18, q2, #14 ; >> 14 - vqrshrn.s32 d19, q3, #14 ; >> 14 - - ; dct_const_round_shift(input_dc * cospi_16_64) - vqrshrn.s32 d22, q13, #14 ; >> 14 - vqrshrn.s32 d23, q15, #14 ; >> 14 - - ; input[1] * cospi_24_64 - input[3] * cospi_8_64 - ; input[1] * cospi_24_64 - vmull.s16 q2, d20, d0 - vmull.s16 q3, d21, d0 - - ; input[1] * cospi_8_64 - vmull.s16 q8, d20, d1 - vmull.s16 q12, d21, d1 - - ; input[1] * cospi_24_64 - input[3] * cospi_8_64 - vmlsl.s16 q2, d28, d1 - vmlsl.s16 q3, d29, d1 - - ; input[1] * cospi_8_64 + input[3] * cospi_24_64 - vmlal.s16 q8, d28, d0 - vmlal.s16 q12, d29, d0 - - ; dct_const_round_shift(input_dc * cospi_16_64) - vqrshrn.s32 d26, q2, #14 ; >> 14 - vqrshrn.s32 d27, q3, #14 ; >> 14 - - ; dct_const_round_shift(input_dc * cospi_16_64) - vqrshrn.s32 d30, q8, #14 ; >> 14 - vqrshrn.s32 d31, q12, #14 ; >> 14 - - vadd.s16 q0, q9, q15 ; output[0] = step[0] + step[3] - vadd.s16 q1, q11, q13 ; output[1] = step[1] + step[2] - vsub.s16 q2, q11, q13 ; output[2] = step[1] - step[2] - vsub.s16 q3, q9, q15 ; output[3] = step[0] - step[3] - - ; stage 3 -odd half - vdup.16 d16, r7 ; duplicate cospi_16_64 - - ; stage 2 - odd half - vsub.s16 q13, q4, q5 ; step2[5] = step1[4] - step1[5] - vadd.s16 q4, q4, q5 ; step2[4] = step1[4] + step1[5] - vsub.s16 q14, q7, q6 ; step2[6] = -step1[6] + step1[7] - vadd.s16 q7, q7, q6 ; step2[7] = step1[6] + step1[7] - - ; step2[6] * cospi_16_64 - vmull.s16 q9, d28, d16 - vmull.s16 q10, d29, d16 - - ; step2[6] * cospi_16_64 - vmull.s16 q11, d28, d16 - vmull.s16 q12, d29, d16 - - ; (step2[6] - step2[5]) * cospi_16_64 - vmlsl.s16 q9, d26, d16 - vmlsl.s16 q10, d27, d16 - - ; (step2[5] + step2[6]) * cospi_16_64 - vmlal.s16 q11, d26, d16 - vmlal.s16 q12, d27, d16 - - ; dct_const_round_shift(input_dc * cospi_16_64) - vqrshrn.s32 d10, q9, #14 ; >> 14 - vqrshrn.s32 d11, q10, #14 ; >> 14 - - ; dct_const_round_shift(input_dc * cospi_16_64) - vqrshrn.s32 d12, q11, #14 ; >> 14 - vqrshrn.s32 d13, q12, #14 ; >> 14 - - ; stage 4 - vadd.s16 q8, q0, q7 ; output[0] = step1[0] + step1[7]; - vadd.s16 q9, q1, q6 ; output[1] = step1[1] + step1[6]; - vadd.s16 q10, q2, q5 ; output[2] = step1[2] + step1[5]; - vadd.s16 q11, q3, q4 ; output[3] = step1[3] + step1[4]; - vsub.s16 q12, q3, q4 ; output[4] = step1[3] - step1[4]; - vsub.s16 q13, q2, q5 ; output[5] = step1[2] - step1[5]; - vsub.s16 q14, q1, q6 ; output[6] = step1[1] - step1[6]; - vsub.s16 q15, q0, q7 ; output[7] = step1[0] - step1[7]; - MEND - - ; Transpose a 8x8 16bit data matrix. Datas are loaded in q8-q15. - MACRO - TRANSPOSE8X8 - vswp d17, d24 - vswp d23, d30 - vswp d21, d28 - vswp d19, d26 - vtrn.32 q8, q10 - vtrn.32 q9, q11 - vtrn.32 q12, q14 - vtrn.32 q13, q15 - vtrn.16 q8, q9 - vtrn.16 q10, q11 - vtrn.16 q12, q13 - vtrn.16 q14, q15 - MEND - - AREA Block, CODE, READONLY ; name this block of code -;void vp9_idct8x8_64_add_neon(int16_t *input, uint8_t *dest, int dest_stride) -; -; r0 int16_t input -; r1 uint8_t *dest -; r2 int dest_stride) - -|vp9_idct8x8_64_add_neon| PROC - push {r4-r9} - vpush {d8-d15} - vld1.s16 {q8,q9}, [r0]! - vld1.s16 {q10,q11}, [r0]! - vld1.s16 {q12,q13}, [r0]! - vld1.s16 {q14,q15}, [r0]! - - ; transpose the input data - TRANSPOSE8X8 - - ; generate cospi_28_64 = 3196 - mov r3, #0x0c00 - add r3, #0x7c - - ; generate cospi_4_64 = 16069 - mov r4, #0x3e00 - add r4, #0xc5 - - ; generate cospi_12_64 = 13623 - mov r5, #0x3500 - add r5, #0x37 - - ; generate cospi_20_64 = 9102 - mov r6, #0x2300 - add r6, #0x8e - - ; generate cospi_16_64 = 11585 - mov r7, #0x2d00 - add r7, #0x41 - - ; generate cospi_24_64 = 6270 - mov r8, #0x1800 - add r8, #0x7e - - ; generate cospi_8_64 = 15137 - mov r9, #0x3b00 - add r9, #0x21 - - ; First transform rows - IDCT8x8_1D - - ; Transpose the matrix - TRANSPOSE8X8 - - ; Then transform columns - IDCT8x8_1D - - ; ROUND_POWER_OF_TWO(temp_out[j], 5) - vrshr.s16 q8, q8, #5 - vrshr.s16 q9, q9, #5 - vrshr.s16 q10, q10, #5 - vrshr.s16 q11, q11, #5 - vrshr.s16 q12, q12, #5 - vrshr.s16 q13, q13, #5 - vrshr.s16 q14, q14, #5 - vrshr.s16 q15, q15, #5 - - ; save dest pointer - mov r0, r1 - - ; load destination data - vld1.64 {d0}, [r1], r2 - vld1.64 {d1}, [r1], r2 - vld1.64 {d2}, [r1], r2 - vld1.64 {d3}, [r1], r2 - vld1.64 {d4}, [r1], r2 - vld1.64 {d5}, [r1], r2 - vld1.64 {d6}, [r1], r2 - vld1.64 {d7}, [r1] - - ; ROUND_POWER_OF_TWO(temp_out[j], 5) + dest[j * dest_stride + i] - vaddw.u8 q8, q8, d0 - vaddw.u8 q9, q9, d1 - vaddw.u8 q10, q10, d2 - vaddw.u8 q11, q11, d3 - vaddw.u8 q12, q12, d4 - vaddw.u8 q13, q13, d5 - vaddw.u8 q14, q14, d6 - vaddw.u8 q15, q15, d7 - - ; clip_pixel - vqmovun.s16 d0, q8 - vqmovun.s16 d1, q9 - vqmovun.s16 d2, q10 - vqmovun.s16 d3, q11 - vqmovun.s16 d4, q12 - vqmovun.s16 d5, q13 - vqmovun.s16 d6, q14 - vqmovun.s16 d7, q15 - - ; store the data - vst1.64 {d0}, [r0], r2 - vst1.64 {d1}, [r0], r2 - vst1.64 {d2}, [r0], r2 - vst1.64 {d3}, [r0], r2 - vst1.64 {d4}, [r0], r2 - vst1.64 {d5}, [r0], r2 - vst1.64 {d6}, [r0], r2 - vst1.64 {d7}, [r0], r2 - - vpop {d8-d15} - pop {r4-r9} - bx lr - ENDP ; |vp9_idct8x8_64_add_neon| - -;void vp9_idct8x8_12_add_neon(int16_t *input, uint8_t *dest, int dest_stride) -; -; r0 int16_t input -; r1 uint8_t *dest -; r2 int dest_stride) - -|vp9_idct8x8_12_add_neon| PROC - push {r4-r9} - vpush {d8-d15} - vld1.s16 {q8,q9}, [r0]! - vld1.s16 {q10,q11}, [r0]! - vld1.s16 {q12,q13}, [r0]! - vld1.s16 {q14,q15}, [r0]! - - ; transpose the input data - TRANSPOSE8X8 - - ; generate cospi_28_64 = 3196 - mov r3, #0x0c00 - add r3, #0x7c - - ; generate cospi_4_64 = 16069 - mov r4, #0x3e00 - add r4, #0xc5 - - ; generate cospi_12_64 = 13623 - mov r5, #0x3500 - add r5, #0x37 - - ; generate cospi_20_64 = 9102 - mov r6, #0x2300 - add r6, #0x8e - - ; generate cospi_16_64 = 11585 - mov r7, #0x2d00 - add r7, #0x41 - - ; generate cospi_24_64 = 6270 - mov r8, #0x1800 - add r8, #0x7e - - ; generate cospi_8_64 = 15137 - mov r9, #0x3b00 - add r9, #0x21 - - ; First transform rows - ; stage 1 - ; The following instructions use vqrdmulh to do the - ; dct_const_round_shift(input[1] * cospi_28_64). vqrdmulh will do doubling - ; multiply and shift the result by 16 bits instead of 14 bits. So we need - ; to double the constants before multiplying to compensate this. - mov r12, r3, lsl #1 - vdup.16 q0, r12 ; duplicate cospi_28_64*2 - mov r12, r4, lsl #1 - vdup.16 q1, r12 ; duplicate cospi_4_64*2 - - ; dct_const_round_shift(input[1] * cospi_28_64) - vqrdmulh.s16 q4, q9, q0 - - mov r12, r6, lsl #1 - rsb r12, #0 - vdup.16 q0, r12 ; duplicate -cospi_20_64*2 - - ; dct_const_round_shift(input[1] * cospi_4_64) - vqrdmulh.s16 q7, q9, q1 - - mov r12, r5, lsl #1 - vdup.16 q1, r12 ; duplicate cospi_12_64*2 - - ; dct_const_round_shift(- input[3] * cospi_20_64) - vqrdmulh.s16 q5, q11, q0 - - mov r12, r7, lsl #1 - vdup.16 q0, r12 ; duplicate cospi_16_64*2 - - ; dct_const_round_shift(input[3] * cospi_12_64) - vqrdmulh.s16 q6, q11, q1 - - ; stage 2 & stage 3 - even half - mov r12, r8, lsl #1 - vdup.16 q1, r12 ; duplicate cospi_24_64*2 - - ; dct_const_round_shift(input_dc * cospi_16_64) - vqrdmulh.s16 q9, q8, q0 - - mov r12, r9, lsl #1 - vdup.16 q0, r12 ; duplicate cospi_8_64*2 - - ; dct_const_round_shift(input[1] * cospi_24_64) - vqrdmulh.s16 q13, q10, q1 - - ; dct_const_round_shift(input[1] * cospi_8_64) - vqrdmulh.s16 q15, q10, q0 - - ; stage 3 -odd half - vdup.16 d16, r7 ; duplicate cospi_16_64 - - vadd.s16 q0, q9, q15 ; output[0] = step[0] + step[3] - vadd.s16 q1, q9, q13 ; output[1] = step[1] + step[2] - vsub.s16 q2, q9, q13 ; output[2] = step[1] - step[2] - vsub.s16 q3, q9, q15 ; output[3] = step[0] - step[3] - - ; stage 2 - odd half - vsub.s16 q13, q4, q5 ; step2[5] = step1[4] - step1[5] - vadd.s16 q4, q4, q5 ; step2[4] = step1[4] + step1[5] - vsub.s16 q14, q7, q6 ; step2[6] = -step1[6] + step1[7] - vadd.s16 q7, q7, q6 ; step2[7] = step1[6] + step1[7] - - ; step2[6] * cospi_16_64 - vmull.s16 q9, d28, d16 - vmull.s16 q10, d29, d16 - - ; step2[6] * cospi_16_64 - vmull.s16 q11, d28, d16 - vmull.s16 q12, d29, d16 - - ; (step2[6] - step2[5]) * cospi_16_64 - vmlsl.s16 q9, d26, d16 - vmlsl.s16 q10, d27, d16 - - ; (step2[5] + step2[6]) * cospi_16_64 - vmlal.s16 q11, d26, d16 - vmlal.s16 q12, d27, d16 - - ; dct_const_round_shift(input_dc * cospi_16_64) - vqrshrn.s32 d10, q9, #14 ; >> 14 - vqrshrn.s32 d11, q10, #14 ; >> 14 - - ; dct_const_round_shift(input_dc * cospi_16_64) - vqrshrn.s32 d12, q11, #14 ; >> 14 - vqrshrn.s32 d13, q12, #14 ; >> 14 - - ; stage 4 - vadd.s16 q8, q0, q7 ; output[0] = step1[0] + step1[7]; - vadd.s16 q9, q1, q6 ; output[1] = step1[1] + step1[6]; - vadd.s16 q10, q2, q5 ; output[2] = step1[2] + step1[5]; - vadd.s16 q11, q3, q4 ; output[3] = step1[3] + step1[4]; - vsub.s16 q12, q3, q4 ; output[4] = step1[3] - step1[4]; - vsub.s16 q13, q2, q5 ; output[5] = step1[2] - step1[5]; - vsub.s16 q14, q1, q6 ; output[6] = step1[1] - step1[6]; - vsub.s16 q15, q0, q7 ; output[7] = step1[0] - step1[7]; - - ; Transpose the matrix - TRANSPOSE8X8 - - ; Then transform columns - IDCT8x8_1D - - ; ROUND_POWER_OF_TWO(temp_out[j], 5) - vrshr.s16 q8, q8, #5 - vrshr.s16 q9, q9, #5 - vrshr.s16 q10, q10, #5 - vrshr.s16 q11, q11, #5 - vrshr.s16 q12, q12, #5 - vrshr.s16 q13, q13, #5 - vrshr.s16 q14, q14, #5 - vrshr.s16 q15, q15, #5 - - ; save dest pointer - mov r0, r1 - - ; load destination data - vld1.64 {d0}, [r1], r2 - vld1.64 {d1}, [r1], r2 - vld1.64 {d2}, [r1], r2 - vld1.64 {d3}, [r1], r2 - vld1.64 {d4}, [r1], r2 - vld1.64 {d5}, [r1], r2 - vld1.64 {d6}, [r1], r2 - vld1.64 {d7}, [r1] - - ; ROUND_POWER_OF_TWO(temp_out[j], 5) + dest[j * dest_stride + i] - vaddw.u8 q8, q8, d0 - vaddw.u8 q9, q9, d1 - vaddw.u8 q10, q10, d2 - vaddw.u8 q11, q11, d3 - vaddw.u8 q12, q12, d4 - vaddw.u8 q13, q13, d5 - vaddw.u8 q14, q14, d6 - vaddw.u8 q15, q15, d7 - - ; clip_pixel - vqmovun.s16 d0, q8 - vqmovun.s16 d1, q9 - vqmovun.s16 d2, q10 - vqmovun.s16 d3, q11 - vqmovun.s16 d4, q12 - vqmovun.s16 d5, q13 - vqmovun.s16 d6, q14 - vqmovun.s16 d7, q15 - - ; store the data - vst1.64 {d0}, [r0], r2 - vst1.64 {d1}, [r0], r2 - vst1.64 {d2}, [r0], r2 - vst1.64 {d3}, [r0], r2 - vst1.64 {d4}, [r0], r2 - vst1.64 {d5}, [r0], r2 - vst1.64 {d6}, [r0], r2 - vst1.64 {d7}, [r0], r2 - - vpop {d8-d15} - pop {r4-r9} - bx lr - ENDP ; |vp9_idct8x8_12_add_neon| - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct8x8_add_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct8x8_add_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct8x8_add_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_idct8x8_add_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,547 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "./vpx_config.h" - -static int16_t cospi_4_64 = 16069; -static int16_t cospi_8_64 = 15137; -static int16_t cospi_12_64 = 13623; -static int16_t cospi_16_64 = 11585; -static int16_t cospi_20_64 = 9102; -static int16_t cospi_24_64 = 6270; -static int16_t cospi_28_64 = 3196; - -static INLINE void TRANSPOSE8X8( - int16x8_t *q8s16, - int16x8_t *q9s16, - int16x8_t *q10s16, - int16x8_t *q11s16, - int16x8_t *q12s16, - int16x8_t *q13s16, - int16x8_t *q14s16, - int16x8_t *q15s16) { - int16x4_t d16s16, d17s16, d18s16, d19s16, d20s16, d21s16, d22s16, d23s16; - int16x4_t d24s16, d25s16, d26s16, d27s16, d28s16, d29s16, d30s16, d31s16; - int32x4x2_t q0x2s32, q1x2s32, q2x2s32, q3x2s32; - int16x8x2_t q0x2s16, q1x2s16, q2x2s16, q3x2s16; - - d16s16 = vget_low_s16(*q8s16); - d17s16 = vget_high_s16(*q8s16); - d18s16 = vget_low_s16(*q9s16); - d19s16 = vget_high_s16(*q9s16); - d20s16 = vget_low_s16(*q10s16); - d21s16 = vget_high_s16(*q10s16); - d22s16 = vget_low_s16(*q11s16); - d23s16 = vget_high_s16(*q11s16); - d24s16 = vget_low_s16(*q12s16); - d25s16 = vget_high_s16(*q12s16); - d26s16 = vget_low_s16(*q13s16); - d27s16 = vget_high_s16(*q13s16); - d28s16 = vget_low_s16(*q14s16); - d29s16 = vget_high_s16(*q14s16); - d30s16 = vget_low_s16(*q15s16); - d31s16 = vget_high_s16(*q15s16); - - *q8s16 = vcombine_s16(d16s16, d24s16); // vswp d17, d24 - *q9s16 = vcombine_s16(d18s16, d26s16); // vswp d19, d26 - *q10s16 = vcombine_s16(d20s16, d28s16); // vswp d21, d28 - *q11s16 = vcombine_s16(d22s16, d30s16); // vswp d23, d30 - *q12s16 = vcombine_s16(d17s16, d25s16); - *q13s16 = vcombine_s16(d19s16, d27s16); - *q14s16 = vcombine_s16(d21s16, d29s16); - *q15s16 = vcombine_s16(d23s16, d31s16); - - q0x2s32 = vtrnq_s32(vreinterpretq_s32_s16(*q8s16), - vreinterpretq_s32_s16(*q10s16)); - q1x2s32 = vtrnq_s32(vreinterpretq_s32_s16(*q9s16), - vreinterpretq_s32_s16(*q11s16)); - q2x2s32 = vtrnq_s32(vreinterpretq_s32_s16(*q12s16), - vreinterpretq_s32_s16(*q14s16)); - q3x2s32 = vtrnq_s32(vreinterpretq_s32_s16(*q13s16), - vreinterpretq_s32_s16(*q15s16)); - - q0x2s16 = vtrnq_s16(vreinterpretq_s16_s32(q0x2s32.val[0]), // q8 - vreinterpretq_s16_s32(q1x2s32.val[0])); // q9 - q1x2s16 = vtrnq_s16(vreinterpretq_s16_s32(q0x2s32.val[1]), // q10 - vreinterpretq_s16_s32(q1x2s32.val[1])); // q11 - q2x2s16 = vtrnq_s16(vreinterpretq_s16_s32(q2x2s32.val[0]), // q12 - vreinterpretq_s16_s32(q3x2s32.val[0])); // q13 - q3x2s16 = vtrnq_s16(vreinterpretq_s16_s32(q2x2s32.val[1]), // q14 - vreinterpretq_s16_s32(q3x2s32.val[1])); // q15 - - *q8s16 = q0x2s16.val[0]; - *q9s16 = q0x2s16.val[1]; - *q10s16 = q1x2s16.val[0]; - *q11s16 = q1x2s16.val[1]; - *q12s16 = q2x2s16.val[0]; - *q13s16 = q2x2s16.val[1]; - *q14s16 = q3x2s16.val[0]; - *q15s16 = q3x2s16.val[1]; - return; -} - -static INLINE void IDCT8x8_1D( - int16x8_t *q8s16, - int16x8_t *q9s16, - int16x8_t *q10s16, - int16x8_t *q11s16, - int16x8_t *q12s16, - int16x8_t *q13s16, - int16x8_t *q14s16, - int16x8_t *q15s16) { - int16x4_t d0s16, d1s16, d2s16, d3s16; - int16x4_t d8s16, d9s16, d10s16, d11s16, d12s16, d13s16, d14s16, d15s16; - int16x4_t d16s16, d17s16, d18s16, d19s16, d20s16, d21s16, d22s16, d23s16; - int16x4_t d24s16, d25s16, d26s16, d27s16, d28s16, d29s16, d30s16, d31s16; - int16x8_t q0s16, q1s16, q2s16, q3s16, q4s16, q5s16, q6s16, q7s16; - int32x4_t q2s32, q3s32, q5s32, q6s32, q8s32, q9s32; - int32x4_t q10s32, q11s32, q12s32, q13s32, q15s32; - - d0s16 = vdup_n_s16(cospi_28_64); - d1s16 = vdup_n_s16(cospi_4_64); - d2s16 = vdup_n_s16(cospi_12_64); - d3s16 = vdup_n_s16(cospi_20_64); - - d16s16 = vget_low_s16(*q8s16); - d17s16 = vget_high_s16(*q8s16); - d18s16 = vget_low_s16(*q9s16); - d19s16 = vget_high_s16(*q9s16); - d20s16 = vget_low_s16(*q10s16); - d21s16 = vget_high_s16(*q10s16); - d22s16 = vget_low_s16(*q11s16); - d23s16 = vget_high_s16(*q11s16); - d24s16 = vget_low_s16(*q12s16); - d25s16 = vget_high_s16(*q12s16); - d26s16 = vget_low_s16(*q13s16); - d27s16 = vget_high_s16(*q13s16); - d28s16 = vget_low_s16(*q14s16); - d29s16 = vget_high_s16(*q14s16); - d30s16 = vget_low_s16(*q15s16); - d31s16 = vget_high_s16(*q15s16); - - q2s32 = vmull_s16(d18s16, d0s16); - q3s32 = vmull_s16(d19s16, d0s16); - q5s32 = vmull_s16(d26s16, d2s16); - q6s32 = vmull_s16(d27s16, d2s16); - - q2s32 = vmlsl_s16(q2s32, d30s16, d1s16); - q3s32 = vmlsl_s16(q3s32, d31s16, d1s16); - q5s32 = vmlsl_s16(q5s32, d22s16, d3s16); - q6s32 = vmlsl_s16(q6s32, d23s16, d3s16); - - d8s16 = vqrshrn_n_s32(q2s32, 14); - d9s16 = vqrshrn_n_s32(q3s32, 14); - d10s16 = vqrshrn_n_s32(q5s32, 14); - d11s16 = vqrshrn_n_s32(q6s32, 14); - q4s16 = vcombine_s16(d8s16, d9s16); - q5s16 = vcombine_s16(d10s16, d11s16); - - q2s32 = vmull_s16(d18s16, d1s16); - q3s32 = vmull_s16(d19s16, d1s16); - q9s32 = vmull_s16(d26s16, d3s16); - q13s32 = vmull_s16(d27s16, d3s16); - - q2s32 = vmlal_s16(q2s32, d30s16, d0s16); - q3s32 = vmlal_s16(q3s32, d31s16, d0s16); - q9s32 = vmlal_s16(q9s32, d22s16, d2s16); - q13s32 = vmlal_s16(q13s32, d23s16, d2s16); - - d14s16 = vqrshrn_n_s32(q2s32, 14); - d15s16 = vqrshrn_n_s32(q3s32, 14); - d12s16 = vqrshrn_n_s32(q9s32, 14); - d13s16 = vqrshrn_n_s32(q13s32, 14); - q6s16 = vcombine_s16(d12s16, d13s16); - q7s16 = vcombine_s16(d14s16, d15s16); - - d0s16 = vdup_n_s16(cospi_16_64); - - q2s32 = vmull_s16(d16s16, d0s16); - q3s32 = vmull_s16(d17s16, d0s16); - q13s32 = vmull_s16(d16s16, d0s16); - q15s32 = vmull_s16(d17s16, d0s16); - - q2s32 = vmlal_s16(q2s32, d24s16, d0s16); - q3s32 = vmlal_s16(q3s32, d25s16, d0s16); - q13s32 = vmlsl_s16(q13s32, d24s16, d0s16); - q15s32 = vmlsl_s16(q15s32, d25s16, d0s16); - - d0s16 = vdup_n_s16(cospi_24_64); - d1s16 = vdup_n_s16(cospi_8_64); - - d18s16 = vqrshrn_n_s32(q2s32, 14); - d19s16 = vqrshrn_n_s32(q3s32, 14); - d22s16 = vqrshrn_n_s32(q13s32, 14); - d23s16 = vqrshrn_n_s32(q15s32, 14); - *q9s16 = vcombine_s16(d18s16, d19s16); - *q11s16 = vcombine_s16(d22s16, d23s16); - - q2s32 = vmull_s16(d20s16, d0s16); - q3s32 = vmull_s16(d21s16, d0s16); - q8s32 = vmull_s16(d20s16, d1s16); - q12s32 = vmull_s16(d21s16, d1s16); - - q2s32 = vmlsl_s16(q2s32, d28s16, d1s16); - q3s32 = vmlsl_s16(q3s32, d29s16, d1s16); - q8s32 = vmlal_s16(q8s32, d28s16, d0s16); - q12s32 = vmlal_s16(q12s32, d29s16, d0s16); - - d26s16 = vqrshrn_n_s32(q2s32, 14); - d27s16 = vqrshrn_n_s32(q3s32, 14); - d30s16 = vqrshrn_n_s32(q8s32, 14); - d31s16 = vqrshrn_n_s32(q12s32, 14); - *q13s16 = vcombine_s16(d26s16, d27s16); - *q15s16 = vcombine_s16(d30s16, d31s16); - - q0s16 = vaddq_s16(*q9s16, *q15s16); - q1s16 = vaddq_s16(*q11s16, *q13s16); - q2s16 = vsubq_s16(*q11s16, *q13s16); - q3s16 = vsubq_s16(*q9s16, *q15s16); - - *q13s16 = vsubq_s16(q4s16, q5s16); - q4s16 = vaddq_s16(q4s16, q5s16); - *q14s16 = vsubq_s16(q7s16, q6s16); - q7s16 = vaddq_s16(q7s16, q6s16); - d26s16 = vget_low_s16(*q13s16); - d27s16 = vget_high_s16(*q13s16); - d28s16 = vget_low_s16(*q14s16); - d29s16 = vget_high_s16(*q14s16); - - d16s16 = vdup_n_s16(cospi_16_64); - - q9s32 = vmull_s16(d28s16, d16s16); - q10s32 = vmull_s16(d29s16, d16s16); - q11s32 = vmull_s16(d28s16, d16s16); - q12s32 = vmull_s16(d29s16, d16s16); - - q9s32 = vmlsl_s16(q9s32, d26s16, d16s16); - q10s32 = vmlsl_s16(q10s32, d27s16, d16s16); - q11s32 = vmlal_s16(q11s32, d26s16, d16s16); - q12s32 = vmlal_s16(q12s32, d27s16, d16s16); - - d10s16 = vqrshrn_n_s32(q9s32, 14); - d11s16 = vqrshrn_n_s32(q10s32, 14); - d12s16 = vqrshrn_n_s32(q11s32, 14); - d13s16 = vqrshrn_n_s32(q12s32, 14); - q5s16 = vcombine_s16(d10s16, d11s16); - q6s16 = vcombine_s16(d12s16, d13s16); - - *q8s16 = vaddq_s16(q0s16, q7s16); - *q9s16 = vaddq_s16(q1s16, q6s16); - *q10s16 = vaddq_s16(q2s16, q5s16); - *q11s16 = vaddq_s16(q3s16, q4s16); - *q12s16 = vsubq_s16(q3s16, q4s16); - *q13s16 = vsubq_s16(q2s16, q5s16); - *q14s16 = vsubq_s16(q1s16, q6s16); - *q15s16 = vsubq_s16(q0s16, q7s16); - return; -} - -void vp9_idct8x8_64_add_neon( - int16_t *input, - uint8_t *dest, - int dest_stride) { - uint8_t *d1, *d2; - uint8x8_t d0u8, d1u8, d2u8, d3u8; - uint64x1_t d0u64, d1u64, d2u64, d3u64; - int16x8_t q8s16, q9s16, q10s16, q11s16, q12s16, q13s16, q14s16, q15s16; - uint16x8_t q8u16, q9u16, q10u16, q11u16; - - q8s16 = vld1q_s16(input); - q9s16 = vld1q_s16(input + 8); - q10s16 = vld1q_s16(input + 16); - q11s16 = vld1q_s16(input + 24); - q12s16 = vld1q_s16(input + 32); - q13s16 = vld1q_s16(input + 40); - q14s16 = vld1q_s16(input + 48); - q15s16 = vld1q_s16(input + 56); - - TRANSPOSE8X8(&q8s16, &q9s16, &q10s16, &q11s16, - &q12s16, &q13s16, &q14s16, &q15s16); - - IDCT8x8_1D(&q8s16, &q9s16, &q10s16, &q11s16, - &q12s16, &q13s16, &q14s16, &q15s16); - - TRANSPOSE8X8(&q8s16, &q9s16, &q10s16, &q11s16, - &q12s16, &q13s16, &q14s16, &q15s16); - - IDCT8x8_1D(&q8s16, &q9s16, &q10s16, &q11s16, - &q12s16, &q13s16, &q14s16, &q15s16); - - q8s16 = vrshrq_n_s16(q8s16, 5); - q9s16 = vrshrq_n_s16(q9s16, 5); - q10s16 = vrshrq_n_s16(q10s16, 5); - q11s16 = vrshrq_n_s16(q11s16, 5); - q12s16 = vrshrq_n_s16(q12s16, 5); - q13s16 = vrshrq_n_s16(q13s16, 5); - q14s16 = vrshrq_n_s16(q14s16, 5); - q15s16 = vrshrq_n_s16(q15s16, 5); - - d1 = d2 = dest; - - d0u64 = vld1_u64((uint64_t *)d1); - d1 += dest_stride; - d1u64 = vld1_u64((uint64_t *)d1); - d1 += dest_stride; - d2u64 = vld1_u64((uint64_t *)d1); - d1 += dest_stride; - d3u64 = vld1_u64((uint64_t *)d1); - d1 += dest_stride; - - q8u16 = vaddw_u8(vreinterpretq_u16_s16(q8s16), - vreinterpret_u8_u64(d0u64)); - q9u16 = vaddw_u8(vreinterpretq_u16_s16(q9s16), - vreinterpret_u8_u64(d1u64)); - q10u16 = vaddw_u8(vreinterpretq_u16_s16(q10s16), - vreinterpret_u8_u64(d2u64)); - q11u16 = vaddw_u8(vreinterpretq_u16_s16(q11s16), - vreinterpret_u8_u64(d3u64)); - - d0u8 = vqmovun_s16(vreinterpretq_s16_u16(q8u16)); - d1u8 = vqmovun_s16(vreinterpretq_s16_u16(q9u16)); - d2u8 = vqmovun_s16(vreinterpretq_s16_u16(q10u16)); - d3u8 = vqmovun_s16(vreinterpretq_s16_u16(q11u16)); - - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d0u8)); - d2 += dest_stride; - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d1u8)); - d2 += dest_stride; - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d2u8)); - d2 += dest_stride; - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d3u8)); - d2 += dest_stride; - - q8s16 = q12s16; - q9s16 = q13s16; - q10s16 = q14s16; - q11s16 = q15s16; - - d0u64 = vld1_u64((uint64_t *)d1); - d1 += dest_stride; - d1u64 = vld1_u64((uint64_t *)d1); - d1 += dest_stride; - d2u64 = vld1_u64((uint64_t *)d1); - d1 += dest_stride; - d3u64 = vld1_u64((uint64_t *)d1); - d1 += dest_stride; - - q8u16 = vaddw_u8(vreinterpretq_u16_s16(q8s16), - vreinterpret_u8_u64(d0u64)); - q9u16 = vaddw_u8(vreinterpretq_u16_s16(q9s16), - vreinterpret_u8_u64(d1u64)); - q10u16 = vaddw_u8(vreinterpretq_u16_s16(q10s16), - vreinterpret_u8_u64(d2u64)); - q11u16 = vaddw_u8(vreinterpretq_u16_s16(q11s16), - vreinterpret_u8_u64(d3u64)); - - d0u8 = vqmovun_s16(vreinterpretq_s16_u16(q8u16)); - d1u8 = vqmovun_s16(vreinterpretq_s16_u16(q9u16)); - d2u8 = vqmovun_s16(vreinterpretq_s16_u16(q10u16)); - d3u8 = vqmovun_s16(vreinterpretq_s16_u16(q11u16)); - - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d0u8)); - d2 += dest_stride; - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d1u8)); - d2 += dest_stride; - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d2u8)); - d2 += dest_stride; - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d3u8)); - d2 += dest_stride; - return; -} - -void vp9_idct8x8_12_add_neon( - int16_t *input, - uint8_t *dest, - int dest_stride) { - uint8_t *d1, *d2; - uint8x8_t d0u8, d1u8, d2u8, d3u8; - int16x4_t d10s16, d11s16, d12s16, d13s16, d16s16; - int16x4_t d26s16, d27s16, d28s16, d29s16; - uint64x1_t d0u64, d1u64, d2u64, d3u64; - int16x8_t q0s16, q1s16, q2s16, q3s16, q4s16, q5s16, q6s16, q7s16; - int16x8_t q8s16, q9s16, q10s16, q11s16, q12s16, q13s16, q14s16, q15s16; - uint16x8_t q8u16, q9u16, q10u16, q11u16; - int32x4_t q9s32, q10s32, q11s32, q12s32; - - q8s16 = vld1q_s16(input); - q9s16 = vld1q_s16(input + 8); - q10s16 = vld1q_s16(input + 16); - q11s16 = vld1q_s16(input + 24); - q12s16 = vld1q_s16(input + 32); - q13s16 = vld1q_s16(input + 40); - q14s16 = vld1q_s16(input + 48); - q15s16 = vld1q_s16(input + 56); - - TRANSPOSE8X8(&q8s16, &q9s16, &q10s16, &q11s16, - &q12s16, &q13s16, &q14s16, &q15s16); - - // First transform rows - // stage 1 - q0s16 = vdupq_n_s16(cospi_28_64 * 2); - q1s16 = vdupq_n_s16(cospi_4_64 * 2); - - q4s16 = vqrdmulhq_s16(q9s16, q0s16); - - q0s16 = vdupq_n_s16(-cospi_20_64 * 2); - - q7s16 = vqrdmulhq_s16(q9s16, q1s16); - - q1s16 = vdupq_n_s16(cospi_12_64 * 2); - - q5s16 = vqrdmulhq_s16(q11s16, q0s16); - - q0s16 = vdupq_n_s16(cospi_16_64 * 2); - - q6s16 = vqrdmulhq_s16(q11s16, q1s16); - - // stage 2 & stage 3 - even half - q1s16 = vdupq_n_s16(cospi_24_64 * 2); - - q9s16 = vqrdmulhq_s16(q8s16, q0s16); - - q0s16 = vdupq_n_s16(cospi_8_64 * 2); - - q13s16 = vqrdmulhq_s16(q10s16, q1s16); - - q15s16 = vqrdmulhq_s16(q10s16, q0s16); - - // stage 3 -odd half - q0s16 = vaddq_s16(q9s16, q15s16); - q1s16 = vaddq_s16(q9s16, q13s16); - q2s16 = vsubq_s16(q9s16, q13s16); - q3s16 = vsubq_s16(q9s16, q15s16); - - // stage 2 - odd half - q13s16 = vsubq_s16(q4s16, q5s16); - q4s16 = vaddq_s16(q4s16, q5s16); - q14s16 = vsubq_s16(q7s16, q6s16); - q7s16 = vaddq_s16(q7s16, q6s16); - d26s16 = vget_low_s16(q13s16); - d27s16 = vget_high_s16(q13s16); - d28s16 = vget_low_s16(q14s16); - d29s16 = vget_high_s16(q14s16); - - d16s16 = vdup_n_s16(cospi_16_64); - q9s32 = vmull_s16(d28s16, d16s16); - q10s32 = vmull_s16(d29s16, d16s16); - q11s32 = vmull_s16(d28s16, d16s16); - q12s32 = vmull_s16(d29s16, d16s16); - - q9s32 = vmlsl_s16(q9s32, d26s16, d16s16); - q10s32 = vmlsl_s16(q10s32, d27s16, d16s16); - q11s32 = vmlal_s16(q11s32, d26s16, d16s16); - q12s32 = vmlal_s16(q12s32, d27s16, d16s16); - - d10s16 = vqrshrn_n_s32(q9s32, 14); - d11s16 = vqrshrn_n_s32(q10s32, 14); - d12s16 = vqrshrn_n_s32(q11s32, 14); - d13s16 = vqrshrn_n_s32(q12s32, 14); - q5s16 = vcombine_s16(d10s16, d11s16); - q6s16 = vcombine_s16(d12s16, d13s16); - - // stage 4 - q8s16 = vaddq_s16(q0s16, q7s16); - q9s16 = vaddq_s16(q1s16, q6s16); - q10s16 = vaddq_s16(q2s16, q5s16); - q11s16 = vaddq_s16(q3s16, q4s16); - q12s16 = vsubq_s16(q3s16, q4s16); - q13s16 = vsubq_s16(q2s16, q5s16); - q14s16 = vsubq_s16(q1s16, q6s16); - q15s16 = vsubq_s16(q0s16, q7s16); - - TRANSPOSE8X8(&q8s16, &q9s16, &q10s16, &q11s16, - &q12s16, &q13s16, &q14s16, &q15s16); - - IDCT8x8_1D(&q8s16, &q9s16, &q10s16, &q11s16, - &q12s16, &q13s16, &q14s16, &q15s16); - - q8s16 = vrshrq_n_s16(q8s16, 5); - q9s16 = vrshrq_n_s16(q9s16, 5); - q10s16 = vrshrq_n_s16(q10s16, 5); - q11s16 = vrshrq_n_s16(q11s16, 5); - q12s16 = vrshrq_n_s16(q12s16, 5); - q13s16 = vrshrq_n_s16(q13s16, 5); - q14s16 = vrshrq_n_s16(q14s16, 5); - q15s16 = vrshrq_n_s16(q15s16, 5); - - d1 = d2 = dest; - - d0u64 = vld1_u64((uint64_t *)d1); - d1 += dest_stride; - d1u64 = vld1_u64((uint64_t *)d1); - d1 += dest_stride; - d2u64 = vld1_u64((uint64_t *)d1); - d1 += dest_stride; - d3u64 = vld1_u64((uint64_t *)d1); - d1 += dest_stride; - - q8u16 = vaddw_u8(vreinterpretq_u16_s16(q8s16), - vreinterpret_u8_u64(d0u64)); - q9u16 = vaddw_u8(vreinterpretq_u16_s16(q9s16), - vreinterpret_u8_u64(d1u64)); - q10u16 = vaddw_u8(vreinterpretq_u16_s16(q10s16), - vreinterpret_u8_u64(d2u64)); - q11u16 = vaddw_u8(vreinterpretq_u16_s16(q11s16), - vreinterpret_u8_u64(d3u64)); - - d0u8 = vqmovun_s16(vreinterpretq_s16_u16(q8u16)); - d1u8 = vqmovun_s16(vreinterpretq_s16_u16(q9u16)); - d2u8 = vqmovun_s16(vreinterpretq_s16_u16(q10u16)); - d3u8 = vqmovun_s16(vreinterpretq_s16_u16(q11u16)); - - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d0u8)); - d2 += dest_stride; - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d1u8)); - d2 += dest_stride; - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d2u8)); - d2 += dest_stride; - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d3u8)); - d2 += dest_stride; - - q8s16 = q12s16; - q9s16 = q13s16; - q10s16 = q14s16; - q11s16 = q15s16; - - d0u64 = vld1_u64((uint64_t *)d1); - d1 += dest_stride; - d1u64 = vld1_u64((uint64_t *)d1); - d1 += dest_stride; - d2u64 = vld1_u64((uint64_t *)d1); - d1 += dest_stride; - d3u64 = vld1_u64((uint64_t *)d1); - d1 += dest_stride; - - q8u16 = vaddw_u8(vreinterpretq_u16_s16(q8s16), - vreinterpret_u8_u64(d0u64)); - q9u16 = vaddw_u8(vreinterpretq_u16_s16(q9s16), - vreinterpret_u8_u64(d1u64)); - q10u16 = vaddw_u8(vreinterpretq_u16_s16(q10s16), - vreinterpret_u8_u64(d2u64)); - q11u16 = vaddw_u8(vreinterpretq_u16_s16(q11s16), - vreinterpret_u8_u64(d3u64)); - - d0u8 = vqmovun_s16(vreinterpretq_s16_u16(q8u16)); - d1u8 = vqmovun_s16(vreinterpretq_s16_u16(q9u16)); - d2u8 = vqmovun_s16(vreinterpretq_s16_u16(q10u16)); - d3u8 = vqmovun_s16(vreinterpretq_s16_u16(q11u16)); - - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d0u8)); - d2 += dest_stride; - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d1u8)); - d2 += dest_stride; - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d2u8)); - d2 += dest_stride; - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d3u8)); - d2 += dest_stride; - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_iht4x4_add_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_iht4x4_add_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_iht4x4_add_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_iht4x4_add_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,248 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vp9_rtcd.h" -#include "./vpx_config.h" -#include "vp9/common/vp9_common.h" - -static int16_t sinpi_1_9 = 0x14a3; -static int16_t sinpi_2_9 = 0x26c9; -static int16_t sinpi_3_9 = 0x3441; -static int16_t sinpi_4_9 = 0x3b6c; -static int16_t cospi_8_64 = 0x3b21; -static int16_t cospi_16_64 = 0x2d41; -static int16_t cospi_24_64 = 0x187e; - -static INLINE void TRANSPOSE4X4( - int16x8_t *q8s16, - int16x8_t *q9s16) { - int32x4_t q8s32, q9s32; - int16x4x2_t d0x2s16, d1x2s16; - int32x4x2_t q0x2s32; - - d0x2s16 = vtrn_s16(vget_low_s16(*q8s16), vget_high_s16(*q8s16)); - d1x2s16 = vtrn_s16(vget_low_s16(*q9s16), vget_high_s16(*q9s16)); - - q8s32 = vreinterpretq_s32_s16(vcombine_s16(d0x2s16.val[0], d0x2s16.val[1])); - q9s32 = vreinterpretq_s32_s16(vcombine_s16(d1x2s16.val[0], d1x2s16.val[1])); - q0x2s32 = vtrnq_s32(q8s32, q9s32); - - *q8s16 = vreinterpretq_s16_s32(q0x2s32.val[0]); - *q9s16 = vreinterpretq_s16_s32(q0x2s32.val[1]); - return; -} - -static INLINE void GENERATE_COSINE_CONSTANTS( - int16x4_t *d0s16, - int16x4_t *d1s16, - int16x4_t *d2s16) { - *d0s16 = vdup_n_s16(cospi_8_64); - *d1s16 = vdup_n_s16(cospi_16_64); - *d2s16 = vdup_n_s16(cospi_24_64); - return; -} - -static INLINE void GENERATE_SINE_CONSTANTS( - int16x4_t *d3s16, - int16x4_t *d4s16, - int16x4_t *d5s16, - int16x8_t *q3s16) { - *d3s16 = vdup_n_s16(sinpi_1_9); - *d4s16 = vdup_n_s16(sinpi_2_9); - *q3s16 = vdupq_n_s16(sinpi_3_9); - *d5s16 = vdup_n_s16(sinpi_4_9); - return; -} - -static INLINE void IDCT4x4_1D( - int16x4_t *d0s16, - int16x4_t *d1s16, - int16x4_t *d2s16, - int16x8_t *q8s16, - int16x8_t *q9s16) { - int16x4_t d16s16, d17s16, d18s16, d19s16, d23s16, d24s16; - int16x4_t d26s16, d27s16, d28s16, d29s16; - int32x4_t q10s32, q13s32, q14s32, q15s32; - int16x8_t q13s16, q14s16; - - d16s16 = vget_low_s16(*q8s16); - d17s16 = vget_high_s16(*q8s16); - d18s16 = vget_low_s16(*q9s16); - d19s16 = vget_high_s16(*q9s16); - - d23s16 = vadd_s16(d16s16, d18s16); - d24s16 = vsub_s16(d16s16, d18s16); - - q15s32 = vmull_s16(d17s16, *d2s16); - q10s32 = vmull_s16(d17s16, *d0s16); - q13s32 = vmull_s16(d23s16, *d1s16); - q14s32 = vmull_s16(d24s16, *d1s16); - q15s32 = vmlsl_s16(q15s32, d19s16, *d0s16); - q10s32 = vmlal_s16(q10s32, d19s16, *d2s16); - - d26s16 = vqrshrn_n_s32(q13s32, 14); - d27s16 = vqrshrn_n_s32(q14s32, 14); - d29s16 = vqrshrn_n_s32(q15s32, 14); - d28s16 = vqrshrn_n_s32(q10s32, 14); - - q13s16 = vcombine_s16(d26s16, d27s16); - q14s16 = vcombine_s16(d28s16, d29s16); - *q8s16 = vaddq_s16(q13s16, q14s16); - *q9s16 = vsubq_s16(q13s16, q14s16); - *q9s16 = vcombine_s16(vget_high_s16(*q9s16), - vget_low_s16(*q9s16)); // vswp - return; -} - -static INLINE void IADST4x4_1D( - int16x4_t *d3s16, - int16x4_t *d4s16, - int16x4_t *d5s16, - int16x8_t *q3s16, - int16x8_t *q8s16, - int16x8_t *q9s16) { - int16x4_t d6s16, d16s16, d17s16, d18s16, d19s16; - int32x4_t q8s32, q9s32, q10s32, q11s32, q12s32, q13s32, q14s32, q15s32; - - d6s16 = vget_low_s16(*q3s16); - - d16s16 = vget_low_s16(*q8s16); - d17s16 = vget_high_s16(*q8s16); - d18s16 = vget_low_s16(*q9s16); - d19s16 = vget_high_s16(*q9s16); - - q10s32 = vmull_s16(*d3s16, d16s16); - q11s32 = vmull_s16(*d4s16, d16s16); - q12s32 = vmull_s16(d6s16, d17s16); - q13s32 = vmull_s16(*d5s16, d18s16); - q14s32 = vmull_s16(*d3s16, d18s16); - q15s32 = vmovl_s16(d16s16); - q15s32 = vaddw_s16(q15s32, d19s16); - q8s32 = vmull_s16(*d4s16, d19s16); - q15s32 = vsubw_s16(q15s32, d18s16); - q9s32 = vmull_s16(*d5s16, d19s16); - - q10s32 = vaddq_s32(q10s32, q13s32); - q10s32 = vaddq_s32(q10s32, q8s32); - q11s32 = vsubq_s32(q11s32, q14s32); - q8s32 = vdupq_n_s32(sinpi_3_9); - q11s32 = vsubq_s32(q11s32, q9s32); - q15s32 = vmulq_s32(q15s32, q8s32); - - q13s32 = vaddq_s32(q10s32, q12s32); - q10s32 = vaddq_s32(q10s32, q11s32); - q14s32 = vaddq_s32(q11s32, q12s32); - q10s32 = vsubq_s32(q10s32, q12s32); - - d16s16 = vqrshrn_n_s32(q13s32, 14); - d17s16 = vqrshrn_n_s32(q14s32, 14); - d18s16 = vqrshrn_n_s32(q15s32, 14); - d19s16 = vqrshrn_n_s32(q10s32, 14); - - *q8s16 = vcombine_s16(d16s16, d17s16); - *q9s16 = vcombine_s16(d18s16, d19s16); - return; -} - -void vp9_iht4x4_16_add_neon(const tran_low_t *input, uint8_t *dest, - int dest_stride, int tx_type) { - uint8x8_t d26u8, d27u8; - int16x4_t d0s16, d1s16, d2s16, d3s16, d4s16, d5s16; - uint32x2_t d26u32, d27u32; - int16x8_t q3s16, q8s16, q9s16; - uint16x8_t q8u16, q9u16; - - d26u32 = d27u32 = vdup_n_u32(0); - - q8s16 = vld1q_s16(input); - q9s16 = vld1q_s16(input + 8); - - TRANSPOSE4X4(&q8s16, &q9s16); - - switch (tx_type) { - case 0: // idct_idct is not supported. Fall back to C - vp9_iht4x4_16_add_c(input, dest, dest_stride, tx_type); - return; - break; - case 1: // iadst_idct - // generate constants - GENERATE_COSINE_CONSTANTS(&d0s16, &d1s16, &d2s16); - GENERATE_SINE_CONSTANTS(&d3s16, &d4s16, &d5s16, &q3s16); - - // first transform rows - IDCT4x4_1D(&d0s16, &d1s16, &d2s16, &q8s16, &q9s16); - - // transpose the matrix - TRANSPOSE4X4(&q8s16, &q9s16); - - // then transform columns - IADST4x4_1D(&d3s16, &d4s16, &d5s16, &q3s16, &q8s16, &q9s16); - break; - case 2: // idct_iadst - // generate constantsyy - GENERATE_COSINE_CONSTANTS(&d0s16, &d1s16, &d2s16); - GENERATE_SINE_CONSTANTS(&d3s16, &d4s16, &d5s16, &q3s16); - - // first transform rows - IADST4x4_1D(&d3s16, &d4s16, &d5s16, &q3s16, &q8s16, &q9s16); - - // transpose the matrix - TRANSPOSE4X4(&q8s16, &q9s16); - - // then transform columns - IDCT4x4_1D(&d0s16, &d1s16, &d2s16, &q8s16, &q9s16); - break; - case 3: // iadst_iadst - // generate constants - GENERATE_SINE_CONSTANTS(&d3s16, &d4s16, &d5s16, &q3s16); - - // first transform rows - IADST4x4_1D(&d3s16, &d4s16, &d5s16, &q3s16, &q8s16, &q9s16); - - // transpose the matrix - TRANSPOSE4X4(&q8s16, &q9s16); - - // then transform columns - IADST4x4_1D(&d3s16, &d4s16, &d5s16, &q3s16, &q8s16, &q9s16); - break; - default: // iadst_idct - assert(0); - break; - } - - q8s16 = vrshrq_n_s16(q8s16, 4); - q9s16 = vrshrq_n_s16(q9s16, 4); - - d26u32 = vld1_lane_u32((const uint32_t *)dest, d26u32, 0); - dest += dest_stride; - d26u32 = vld1_lane_u32((const uint32_t *)dest, d26u32, 1); - dest += dest_stride; - d27u32 = vld1_lane_u32((const uint32_t *)dest, d27u32, 0); - dest += dest_stride; - d27u32 = vld1_lane_u32((const uint32_t *)dest, d27u32, 1); - - q8u16 = vaddw_u8(vreinterpretq_u16_s16(q8s16), vreinterpret_u8_u32(d26u32)); - q9u16 = vaddw_u8(vreinterpretq_u16_s16(q9s16), vreinterpret_u8_u32(d27u32)); - - d26u8 = vqmovun_s16(vreinterpretq_s16_u16(q8u16)); - d27u8 = vqmovun_s16(vreinterpretq_s16_u16(q9u16)); - - vst1_lane_u32((uint32_t *)dest, vreinterpret_u32_u8(d27u8), 1); - dest -= dest_stride; - vst1_lane_u32((uint32_t *)dest, vreinterpret_u32_u8(d27u8), 0); - dest -= dest_stride; - vst1_lane_u32((uint32_t *)dest, vreinterpret_u32_u8(d26u8), 1); - dest -= dest_stride; - vst1_lane_u32((uint32_t *)dest, vreinterpret_u32_u8(d26u8), 0); - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_iht8x8_add_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_iht8x8_add_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_iht8x8_add_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_iht8x8_add_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,624 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vp9_rtcd.h" -#include "./vpx_config.h" -#include "vp9/common/vp9_common.h" - -static int16_t cospi_2_64 = 16305; -static int16_t cospi_4_64 = 16069; -static int16_t cospi_6_64 = 15679; -static int16_t cospi_8_64 = 15137; -static int16_t cospi_10_64 = 14449; -static int16_t cospi_12_64 = 13623; -static int16_t cospi_14_64 = 12665; -static int16_t cospi_16_64 = 11585; -static int16_t cospi_18_64 = 10394; -static int16_t cospi_20_64 = 9102; -static int16_t cospi_22_64 = 7723; -static int16_t cospi_24_64 = 6270; -static int16_t cospi_26_64 = 4756; -static int16_t cospi_28_64 = 3196; -static int16_t cospi_30_64 = 1606; - -static INLINE void TRANSPOSE8X8( - int16x8_t *q8s16, - int16x8_t *q9s16, - int16x8_t *q10s16, - int16x8_t *q11s16, - int16x8_t *q12s16, - int16x8_t *q13s16, - int16x8_t *q14s16, - int16x8_t *q15s16) { - int16x4_t d16s16, d17s16, d18s16, d19s16, d20s16, d21s16, d22s16, d23s16; - int16x4_t d24s16, d25s16, d26s16, d27s16, d28s16, d29s16, d30s16, d31s16; - int32x4x2_t q0x2s32, q1x2s32, q2x2s32, q3x2s32; - int16x8x2_t q0x2s16, q1x2s16, q2x2s16, q3x2s16; - - d16s16 = vget_low_s16(*q8s16); - d17s16 = vget_high_s16(*q8s16); - d18s16 = vget_low_s16(*q9s16); - d19s16 = vget_high_s16(*q9s16); - d20s16 = vget_low_s16(*q10s16); - d21s16 = vget_high_s16(*q10s16); - d22s16 = vget_low_s16(*q11s16); - d23s16 = vget_high_s16(*q11s16); - d24s16 = vget_low_s16(*q12s16); - d25s16 = vget_high_s16(*q12s16); - d26s16 = vget_low_s16(*q13s16); - d27s16 = vget_high_s16(*q13s16); - d28s16 = vget_low_s16(*q14s16); - d29s16 = vget_high_s16(*q14s16); - d30s16 = vget_low_s16(*q15s16); - d31s16 = vget_high_s16(*q15s16); - - *q8s16 = vcombine_s16(d16s16, d24s16); // vswp d17, d24 - *q9s16 = vcombine_s16(d18s16, d26s16); // vswp d19, d26 - *q10s16 = vcombine_s16(d20s16, d28s16); // vswp d21, d28 - *q11s16 = vcombine_s16(d22s16, d30s16); // vswp d23, d30 - *q12s16 = vcombine_s16(d17s16, d25s16); - *q13s16 = vcombine_s16(d19s16, d27s16); - *q14s16 = vcombine_s16(d21s16, d29s16); - *q15s16 = vcombine_s16(d23s16, d31s16); - - q0x2s32 = vtrnq_s32(vreinterpretq_s32_s16(*q8s16), - vreinterpretq_s32_s16(*q10s16)); - q1x2s32 = vtrnq_s32(vreinterpretq_s32_s16(*q9s16), - vreinterpretq_s32_s16(*q11s16)); - q2x2s32 = vtrnq_s32(vreinterpretq_s32_s16(*q12s16), - vreinterpretq_s32_s16(*q14s16)); - q3x2s32 = vtrnq_s32(vreinterpretq_s32_s16(*q13s16), - vreinterpretq_s32_s16(*q15s16)); - - q0x2s16 = vtrnq_s16(vreinterpretq_s16_s32(q0x2s32.val[0]), // q8 - vreinterpretq_s16_s32(q1x2s32.val[0])); // q9 - q1x2s16 = vtrnq_s16(vreinterpretq_s16_s32(q0x2s32.val[1]), // q10 - vreinterpretq_s16_s32(q1x2s32.val[1])); // q11 - q2x2s16 = vtrnq_s16(vreinterpretq_s16_s32(q2x2s32.val[0]), // q12 - vreinterpretq_s16_s32(q3x2s32.val[0])); // q13 - q3x2s16 = vtrnq_s16(vreinterpretq_s16_s32(q2x2s32.val[1]), // q14 - vreinterpretq_s16_s32(q3x2s32.val[1])); // q15 - - *q8s16 = q0x2s16.val[0]; - *q9s16 = q0x2s16.val[1]; - *q10s16 = q1x2s16.val[0]; - *q11s16 = q1x2s16.val[1]; - *q12s16 = q2x2s16.val[0]; - *q13s16 = q2x2s16.val[1]; - *q14s16 = q3x2s16.val[0]; - *q15s16 = q3x2s16.val[1]; - return; -} - -static INLINE void IDCT8x8_1D( - int16x8_t *q8s16, - int16x8_t *q9s16, - int16x8_t *q10s16, - int16x8_t *q11s16, - int16x8_t *q12s16, - int16x8_t *q13s16, - int16x8_t *q14s16, - int16x8_t *q15s16) { - int16x4_t d0s16, d1s16, d2s16, d3s16; - int16x4_t d8s16, d9s16, d10s16, d11s16, d12s16, d13s16, d14s16, d15s16; - int16x4_t d16s16, d17s16, d18s16, d19s16, d20s16, d21s16, d22s16, d23s16; - int16x4_t d24s16, d25s16, d26s16, d27s16, d28s16, d29s16, d30s16, d31s16; - int16x8_t q0s16, q1s16, q2s16, q3s16, q4s16, q5s16, q6s16, q7s16; - int32x4_t q2s32, q3s32, q5s32, q6s32, q8s32, q9s32; - int32x4_t q10s32, q11s32, q12s32, q13s32, q15s32; - - d0s16 = vdup_n_s16(cospi_28_64); - d1s16 = vdup_n_s16(cospi_4_64); - d2s16 = vdup_n_s16(cospi_12_64); - d3s16 = vdup_n_s16(cospi_20_64); - - d16s16 = vget_low_s16(*q8s16); - d17s16 = vget_high_s16(*q8s16); - d18s16 = vget_low_s16(*q9s16); - d19s16 = vget_high_s16(*q9s16); - d20s16 = vget_low_s16(*q10s16); - d21s16 = vget_high_s16(*q10s16); - d22s16 = vget_low_s16(*q11s16); - d23s16 = vget_high_s16(*q11s16); - d24s16 = vget_low_s16(*q12s16); - d25s16 = vget_high_s16(*q12s16); - d26s16 = vget_low_s16(*q13s16); - d27s16 = vget_high_s16(*q13s16); - d28s16 = vget_low_s16(*q14s16); - d29s16 = vget_high_s16(*q14s16); - d30s16 = vget_low_s16(*q15s16); - d31s16 = vget_high_s16(*q15s16); - - q2s32 = vmull_s16(d18s16, d0s16); - q3s32 = vmull_s16(d19s16, d0s16); - q5s32 = vmull_s16(d26s16, d2s16); - q6s32 = vmull_s16(d27s16, d2s16); - - q2s32 = vmlsl_s16(q2s32, d30s16, d1s16); - q3s32 = vmlsl_s16(q3s32, d31s16, d1s16); - q5s32 = vmlsl_s16(q5s32, d22s16, d3s16); - q6s32 = vmlsl_s16(q6s32, d23s16, d3s16); - - d8s16 = vqrshrn_n_s32(q2s32, 14); - d9s16 = vqrshrn_n_s32(q3s32, 14); - d10s16 = vqrshrn_n_s32(q5s32, 14); - d11s16 = vqrshrn_n_s32(q6s32, 14); - q4s16 = vcombine_s16(d8s16, d9s16); - q5s16 = vcombine_s16(d10s16, d11s16); - - q2s32 = vmull_s16(d18s16, d1s16); - q3s32 = vmull_s16(d19s16, d1s16); - q9s32 = vmull_s16(d26s16, d3s16); - q13s32 = vmull_s16(d27s16, d3s16); - - q2s32 = vmlal_s16(q2s32, d30s16, d0s16); - q3s32 = vmlal_s16(q3s32, d31s16, d0s16); - q9s32 = vmlal_s16(q9s32, d22s16, d2s16); - q13s32 = vmlal_s16(q13s32, d23s16, d2s16); - - d14s16 = vqrshrn_n_s32(q2s32, 14); - d15s16 = vqrshrn_n_s32(q3s32, 14); - d12s16 = vqrshrn_n_s32(q9s32, 14); - d13s16 = vqrshrn_n_s32(q13s32, 14); - q6s16 = vcombine_s16(d12s16, d13s16); - q7s16 = vcombine_s16(d14s16, d15s16); - - d0s16 = vdup_n_s16(cospi_16_64); - - q2s32 = vmull_s16(d16s16, d0s16); - q3s32 = vmull_s16(d17s16, d0s16); - q13s32 = vmull_s16(d16s16, d0s16); - q15s32 = vmull_s16(d17s16, d0s16); - - q2s32 = vmlal_s16(q2s32, d24s16, d0s16); - q3s32 = vmlal_s16(q3s32, d25s16, d0s16); - q13s32 = vmlsl_s16(q13s32, d24s16, d0s16); - q15s32 = vmlsl_s16(q15s32, d25s16, d0s16); - - d0s16 = vdup_n_s16(cospi_24_64); - d1s16 = vdup_n_s16(cospi_8_64); - - d18s16 = vqrshrn_n_s32(q2s32, 14); - d19s16 = vqrshrn_n_s32(q3s32, 14); - d22s16 = vqrshrn_n_s32(q13s32, 14); - d23s16 = vqrshrn_n_s32(q15s32, 14); - *q9s16 = vcombine_s16(d18s16, d19s16); - *q11s16 = vcombine_s16(d22s16, d23s16); - - q2s32 = vmull_s16(d20s16, d0s16); - q3s32 = vmull_s16(d21s16, d0s16); - q8s32 = vmull_s16(d20s16, d1s16); - q12s32 = vmull_s16(d21s16, d1s16); - - q2s32 = vmlsl_s16(q2s32, d28s16, d1s16); - q3s32 = vmlsl_s16(q3s32, d29s16, d1s16); - q8s32 = vmlal_s16(q8s32, d28s16, d0s16); - q12s32 = vmlal_s16(q12s32, d29s16, d0s16); - - d26s16 = vqrshrn_n_s32(q2s32, 14); - d27s16 = vqrshrn_n_s32(q3s32, 14); - d30s16 = vqrshrn_n_s32(q8s32, 14); - d31s16 = vqrshrn_n_s32(q12s32, 14); - *q13s16 = vcombine_s16(d26s16, d27s16); - *q15s16 = vcombine_s16(d30s16, d31s16); - - q0s16 = vaddq_s16(*q9s16, *q15s16); - q1s16 = vaddq_s16(*q11s16, *q13s16); - q2s16 = vsubq_s16(*q11s16, *q13s16); - q3s16 = vsubq_s16(*q9s16, *q15s16); - - *q13s16 = vsubq_s16(q4s16, q5s16); - q4s16 = vaddq_s16(q4s16, q5s16); - *q14s16 = vsubq_s16(q7s16, q6s16); - q7s16 = vaddq_s16(q7s16, q6s16); - d26s16 = vget_low_s16(*q13s16); - d27s16 = vget_high_s16(*q13s16); - d28s16 = vget_low_s16(*q14s16); - d29s16 = vget_high_s16(*q14s16); - - d16s16 = vdup_n_s16(cospi_16_64); - - q9s32 = vmull_s16(d28s16, d16s16); - q10s32 = vmull_s16(d29s16, d16s16); - q11s32 = vmull_s16(d28s16, d16s16); - q12s32 = vmull_s16(d29s16, d16s16); - - q9s32 = vmlsl_s16(q9s32, d26s16, d16s16); - q10s32 = vmlsl_s16(q10s32, d27s16, d16s16); - q11s32 = vmlal_s16(q11s32, d26s16, d16s16); - q12s32 = vmlal_s16(q12s32, d27s16, d16s16); - - d10s16 = vqrshrn_n_s32(q9s32, 14); - d11s16 = vqrshrn_n_s32(q10s32, 14); - d12s16 = vqrshrn_n_s32(q11s32, 14); - d13s16 = vqrshrn_n_s32(q12s32, 14); - q5s16 = vcombine_s16(d10s16, d11s16); - q6s16 = vcombine_s16(d12s16, d13s16); - - *q8s16 = vaddq_s16(q0s16, q7s16); - *q9s16 = vaddq_s16(q1s16, q6s16); - *q10s16 = vaddq_s16(q2s16, q5s16); - *q11s16 = vaddq_s16(q3s16, q4s16); - *q12s16 = vsubq_s16(q3s16, q4s16); - *q13s16 = vsubq_s16(q2s16, q5s16); - *q14s16 = vsubq_s16(q1s16, q6s16); - *q15s16 = vsubq_s16(q0s16, q7s16); - return; -} - -static INLINE void IADST8X8_1D( - int16x8_t *q8s16, - int16x8_t *q9s16, - int16x8_t *q10s16, - int16x8_t *q11s16, - int16x8_t *q12s16, - int16x8_t *q13s16, - int16x8_t *q14s16, - int16x8_t *q15s16) { - int16x4_t d0s16, d1s16, d2s16, d3s16, d4s16, d5s16, d6s16, d7s16; - int16x4_t d8s16, d9s16, d10s16, d11s16, d12s16, d13s16, d14s16, d15s16; - int16x4_t d16s16, d17s16, d18s16, d19s16, d20s16, d21s16, d22s16, d23s16; - int16x4_t d24s16, d25s16, d26s16, d27s16, d28s16, d29s16, d30s16, d31s16; - int16x8_t q2s16, q4s16, q5s16, q6s16; - int32x4_t q0s32, q1s32, q2s32, q3s32, q4s32, q5s32, q6s32, q7s32, q8s32; - int32x4_t q9s32, q10s32, q11s32, q12s32, q13s32, q14s32, q15s32; - - d16s16 = vget_low_s16(*q8s16); - d17s16 = vget_high_s16(*q8s16); - d18s16 = vget_low_s16(*q9s16); - d19s16 = vget_high_s16(*q9s16); - d20s16 = vget_low_s16(*q10s16); - d21s16 = vget_high_s16(*q10s16); - d22s16 = vget_low_s16(*q11s16); - d23s16 = vget_high_s16(*q11s16); - d24s16 = vget_low_s16(*q12s16); - d25s16 = vget_high_s16(*q12s16); - d26s16 = vget_low_s16(*q13s16); - d27s16 = vget_high_s16(*q13s16); - d28s16 = vget_low_s16(*q14s16); - d29s16 = vget_high_s16(*q14s16); - d30s16 = vget_low_s16(*q15s16); - d31s16 = vget_high_s16(*q15s16); - - d14s16 = vdup_n_s16(cospi_2_64); - d15s16 = vdup_n_s16(cospi_30_64); - - q1s32 = vmull_s16(d30s16, d14s16); - q2s32 = vmull_s16(d31s16, d14s16); - q3s32 = vmull_s16(d30s16, d15s16); - q4s32 = vmull_s16(d31s16, d15s16); - - d30s16 = vdup_n_s16(cospi_18_64); - d31s16 = vdup_n_s16(cospi_14_64); - - q1s32 = vmlal_s16(q1s32, d16s16, d15s16); - q2s32 = vmlal_s16(q2s32, d17s16, d15s16); - q3s32 = vmlsl_s16(q3s32, d16s16, d14s16); - q4s32 = vmlsl_s16(q4s32, d17s16, d14s16); - - q5s32 = vmull_s16(d22s16, d30s16); - q6s32 = vmull_s16(d23s16, d30s16); - q7s32 = vmull_s16(d22s16, d31s16); - q8s32 = vmull_s16(d23s16, d31s16); - - q5s32 = vmlal_s16(q5s32, d24s16, d31s16); - q6s32 = vmlal_s16(q6s32, d25s16, d31s16); - q7s32 = vmlsl_s16(q7s32, d24s16, d30s16); - q8s32 = vmlsl_s16(q8s32, d25s16, d30s16); - - q11s32 = vaddq_s32(q1s32, q5s32); - q12s32 = vaddq_s32(q2s32, q6s32); - q1s32 = vsubq_s32(q1s32, q5s32); - q2s32 = vsubq_s32(q2s32, q6s32); - - d22s16 = vqrshrn_n_s32(q11s32, 14); - d23s16 = vqrshrn_n_s32(q12s32, 14); - *q11s16 = vcombine_s16(d22s16, d23s16); - - q12s32 = vaddq_s32(q3s32, q7s32); - q15s32 = vaddq_s32(q4s32, q8s32); - q3s32 = vsubq_s32(q3s32, q7s32); - q4s32 = vsubq_s32(q4s32, q8s32); - - d2s16 = vqrshrn_n_s32(q1s32, 14); - d3s16 = vqrshrn_n_s32(q2s32, 14); - d24s16 = vqrshrn_n_s32(q12s32, 14); - d25s16 = vqrshrn_n_s32(q15s32, 14); - d6s16 = vqrshrn_n_s32(q3s32, 14); - d7s16 = vqrshrn_n_s32(q4s32, 14); - *q12s16 = vcombine_s16(d24s16, d25s16); - - d0s16 = vdup_n_s16(cospi_10_64); - d1s16 = vdup_n_s16(cospi_22_64); - q4s32 = vmull_s16(d26s16, d0s16); - q5s32 = vmull_s16(d27s16, d0s16); - q2s32 = vmull_s16(d26s16, d1s16); - q6s32 = vmull_s16(d27s16, d1s16); - - d30s16 = vdup_n_s16(cospi_26_64); - d31s16 = vdup_n_s16(cospi_6_64); - - q4s32 = vmlal_s16(q4s32, d20s16, d1s16); - q5s32 = vmlal_s16(q5s32, d21s16, d1s16); - q2s32 = vmlsl_s16(q2s32, d20s16, d0s16); - q6s32 = vmlsl_s16(q6s32, d21s16, d0s16); - - q0s32 = vmull_s16(d18s16, d30s16); - q13s32 = vmull_s16(d19s16, d30s16); - - q0s32 = vmlal_s16(q0s32, d28s16, d31s16); - q13s32 = vmlal_s16(q13s32, d29s16, d31s16); - - q10s32 = vmull_s16(d18s16, d31s16); - q9s32 = vmull_s16(d19s16, d31s16); - - q10s32 = vmlsl_s16(q10s32, d28s16, d30s16); - q9s32 = vmlsl_s16(q9s32, d29s16, d30s16); - - q14s32 = vaddq_s32(q2s32, q10s32); - q15s32 = vaddq_s32(q6s32, q9s32); - q2s32 = vsubq_s32(q2s32, q10s32); - q6s32 = vsubq_s32(q6s32, q9s32); - - d28s16 = vqrshrn_n_s32(q14s32, 14); - d29s16 = vqrshrn_n_s32(q15s32, 14); - d4s16 = vqrshrn_n_s32(q2s32, 14); - d5s16 = vqrshrn_n_s32(q6s32, 14); - *q14s16 = vcombine_s16(d28s16, d29s16); - - q9s32 = vaddq_s32(q4s32, q0s32); - q10s32 = vaddq_s32(q5s32, q13s32); - q4s32 = vsubq_s32(q4s32, q0s32); - q5s32 = vsubq_s32(q5s32, q13s32); - - d30s16 = vdup_n_s16(cospi_8_64); - d31s16 = vdup_n_s16(cospi_24_64); - - d18s16 = vqrshrn_n_s32(q9s32, 14); - d19s16 = vqrshrn_n_s32(q10s32, 14); - d8s16 = vqrshrn_n_s32(q4s32, 14); - d9s16 = vqrshrn_n_s32(q5s32, 14); - *q9s16 = vcombine_s16(d18s16, d19s16); - - q5s32 = vmull_s16(d2s16, d30s16); - q6s32 = vmull_s16(d3s16, d30s16); - q7s32 = vmull_s16(d2s16, d31s16); - q0s32 = vmull_s16(d3s16, d31s16); - - q5s32 = vmlal_s16(q5s32, d6s16, d31s16); - q6s32 = vmlal_s16(q6s32, d7s16, d31s16); - q7s32 = vmlsl_s16(q7s32, d6s16, d30s16); - q0s32 = vmlsl_s16(q0s32, d7s16, d30s16); - - q1s32 = vmull_s16(d4s16, d30s16); - q3s32 = vmull_s16(d5s16, d30s16); - q10s32 = vmull_s16(d4s16, d31s16); - q2s32 = vmull_s16(d5s16, d31s16); - - q1s32 = vmlsl_s16(q1s32, d8s16, d31s16); - q3s32 = vmlsl_s16(q3s32, d9s16, d31s16); - q10s32 = vmlal_s16(q10s32, d8s16, d30s16); - q2s32 = vmlal_s16(q2s32, d9s16, d30s16); - - *q8s16 = vaddq_s16(*q11s16, *q9s16); - *q11s16 = vsubq_s16(*q11s16, *q9s16); - q4s16 = vaddq_s16(*q12s16, *q14s16); - *q12s16 = vsubq_s16(*q12s16, *q14s16); - - q14s32 = vaddq_s32(q5s32, q1s32); - q15s32 = vaddq_s32(q6s32, q3s32); - q5s32 = vsubq_s32(q5s32, q1s32); - q6s32 = vsubq_s32(q6s32, q3s32); - - d18s16 = vqrshrn_n_s32(q14s32, 14); - d19s16 = vqrshrn_n_s32(q15s32, 14); - d10s16 = vqrshrn_n_s32(q5s32, 14); - d11s16 = vqrshrn_n_s32(q6s32, 14); - *q9s16 = vcombine_s16(d18s16, d19s16); - - q1s32 = vaddq_s32(q7s32, q10s32); - q3s32 = vaddq_s32(q0s32, q2s32); - q7s32 = vsubq_s32(q7s32, q10s32); - q0s32 = vsubq_s32(q0s32, q2s32); - - d28s16 = vqrshrn_n_s32(q1s32, 14); - d29s16 = vqrshrn_n_s32(q3s32, 14); - d14s16 = vqrshrn_n_s32(q7s32, 14); - d15s16 = vqrshrn_n_s32(q0s32, 14); - *q14s16 = vcombine_s16(d28s16, d29s16); - - d30s16 = vdup_n_s16(cospi_16_64); - - d22s16 = vget_low_s16(*q11s16); - d23s16 = vget_high_s16(*q11s16); - q2s32 = vmull_s16(d22s16, d30s16); - q3s32 = vmull_s16(d23s16, d30s16); - q13s32 = vmull_s16(d22s16, d30s16); - q1s32 = vmull_s16(d23s16, d30s16); - - d24s16 = vget_low_s16(*q12s16); - d25s16 = vget_high_s16(*q12s16); - q2s32 = vmlal_s16(q2s32, d24s16, d30s16); - q3s32 = vmlal_s16(q3s32, d25s16, d30s16); - q13s32 = vmlsl_s16(q13s32, d24s16, d30s16); - q1s32 = vmlsl_s16(q1s32, d25s16, d30s16); - - d4s16 = vqrshrn_n_s32(q2s32, 14); - d5s16 = vqrshrn_n_s32(q3s32, 14); - d24s16 = vqrshrn_n_s32(q13s32, 14); - d25s16 = vqrshrn_n_s32(q1s32, 14); - q2s16 = vcombine_s16(d4s16, d5s16); - *q12s16 = vcombine_s16(d24s16, d25s16); - - q13s32 = vmull_s16(d10s16, d30s16); - q1s32 = vmull_s16(d11s16, d30s16); - q11s32 = vmull_s16(d10s16, d30s16); - q0s32 = vmull_s16(d11s16, d30s16); - - q13s32 = vmlal_s16(q13s32, d14s16, d30s16); - q1s32 = vmlal_s16(q1s32, d15s16, d30s16); - q11s32 = vmlsl_s16(q11s32, d14s16, d30s16); - q0s32 = vmlsl_s16(q0s32, d15s16, d30s16); - - d20s16 = vqrshrn_n_s32(q13s32, 14); - d21s16 = vqrshrn_n_s32(q1s32, 14); - d12s16 = vqrshrn_n_s32(q11s32, 14); - d13s16 = vqrshrn_n_s32(q0s32, 14); - *q10s16 = vcombine_s16(d20s16, d21s16); - q6s16 = vcombine_s16(d12s16, d13s16); - - q5s16 = vdupq_n_s16(0); - - *q9s16 = vsubq_s16(q5s16, *q9s16); - *q11s16 = vsubq_s16(q5s16, q2s16); - *q13s16 = vsubq_s16(q5s16, q6s16); - *q15s16 = vsubq_s16(q5s16, q4s16); - return; -} - -void vp9_iht8x8_64_add_neon(const tran_low_t *input, uint8_t *dest, - int dest_stride, int tx_type) { - int i; - uint8_t *d1, *d2; - uint8x8_t d0u8, d1u8, d2u8, d3u8; - uint64x1_t d0u64, d1u64, d2u64, d3u64; - int16x8_t q8s16, q9s16, q10s16, q11s16, q12s16, q13s16, q14s16, q15s16; - uint16x8_t q8u16, q9u16, q10u16, q11u16; - - q8s16 = vld1q_s16(input); - q9s16 = vld1q_s16(input + 8); - q10s16 = vld1q_s16(input + 8 * 2); - q11s16 = vld1q_s16(input + 8 * 3); - q12s16 = vld1q_s16(input + 8 * 4); - q13s16 = vld1q_s16(input + 8 * 5); - q14s16 = vld1q_s16(input + 8 * 6); - q15s16 = vld1q_s16(input + 8 * 7); - - TRANSPOSE8X8(&q8s16, &q9s16, &q10s16, &q11s16, - &q12s16, &q13s16, &q14s16, &q15s16); - - switch (tx_type) { - case 0: // idct_idct is not supported. Fall back to C - vp9_iht8x8_64_add_c(input, dest, dest_stride, tx_type); - return; - break; - case 1: // iadst_idct - // generate IDCT constants - // GENERATE_IDCT_CONSTANTS - - // first transform rows - IDCT8x8_1D(&q8s16, &q9s16, &q10s16, &q11s16, - &q12s16, &q13s16, &q14s16, &q15s16); - - // transpose the matrix - TRANSPOSE8X8(&q8s16, &q9s16, &q10s16, &q11s16, - &q12s16, &q13s16, &q14s16, &q15s16); - - // generate IADST constants - // GENERATE_IADST_CONSTANTS - - // then transform columns - IADST8X8_1D(&q8s16, &q9s16, &q10s16, &q11s16, - &q12s16, &q13s16, &q14s16, &q15s16); - break; - case 2: // idct_iadst - // generate IADST constants - // GENERATE_IADST_CONSTANTS - - // first transform rows - IADST8X8_1D(&q8s16, &q9s16, &q10s16, &q11s16, - &q12s16, &q13s16, &q14s16, &q15s16); - - // transpose the matrix - TRANSPOSE8X8(&q8s16, &q9s16, &q10s16, &q11s16, - &q12s16, &q13s16, &q14s16, &q15s16); - - // generate IDCT constants - // GENERATE_IDCT_CONSTANTS - - // then transform columns - IDCT8x8_1D(&q8s16, &q9s16, &q10s16, &q11s16, - &q12s16, &q13s16, &q14s16, &q15s16); - break; - case 3: // iadst_iadst - // generate IADST constants - // GENERATE_IADST_CONSTANTS - - // first transform rows - IADST8X8_1D(&q8s16, &q9s16, &q10s16, &q11s16, - &q12s16, &q13s16, &q14s16, &q15s16); - - // transpose the matrix - TRANSPOSE8X8(&q8s16, &q9s16, &q10s16, &q11s16, - &q12s16, &q13s16, &q14s16, &q15s16); - - // then transform columns - IADST8X8_1D(&q8s16, &q9s16, &q10s16, &q11s16, - &q12s16, &q13s16, &q14s16, &q15s16); - break; - default: // iadst_idct - assert(0); - break; - } - - q8s16 = vrshrq_n_s16(q8s16, 5); - q9s16 = vrshrq_n_s16(q9s16, 5); - q10s16 = vrshrq_n_s16(q10s16, 5); - q11s16 = vrshrq_n_s16(q11s16, 5); - q12s16 = vrshrq_n_s16(q12s16, 5); - q13s16 = vrshrq_n_s16(q13s16, 5); - q14s16 = vrshrq_n_s16(q14s16, 5); - q15s16 = vrshrq_n_s16(q15s16, 5); - - for (d1 = d2 = dest, i = 0; i < 2; i++) { - if (i != 0) { - q8s16 = q12s16; - q9s16 = q13s16; - q10s16 = q14s16; - q11s16 = q15s16; - } - - d0u64 = vld1_u64((uint64_t *)d1); - d1 += dest_stride; - d1u64 = vld1_u64((uint64_t *)d1); - d1 += dest_stride; - d2u64 = vld1_u64((uint64_t *)d1); - d1 += dest_stride; - d3u64 = vld1_u64((uint64_t *)d1); - d1 += dest_stride; - - q8u16 = vaddw_u8(vreinterpretq_u16_s16(q8s16), - vreinterpret_u8_u64(d0u64)); - q9u16 = vaddw_u8(vreinterpretq_u16_s16(q9s16), - vreinterpret_u8_u64(d1u64)); - q10u16 = vaddw_u8(vreinterpretq_u16_s16(q10s16), - vreinterpret_u8_u64(d2u64)); - q11u16 = vaddw_u8(vreinterpretq_u16_s16(q11s16), - vreinterpret_u8_u64(d3u64)); - - d0u8 = vqmovun_s16(vreinterpretq_s16_u16(q8u16)); - d1u8 = vqmovun_s16(vreinterpretq_s16_u16(q9u16)); - d2u8 = vqmovun_s16(vreinterpretq_s16_u16(q10u16)); - d3u8 = vqmovun_s16(vreinterpretq_s16_u16(q11u16)); - - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d0u8)); - d2 += dest_stride; - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d1u8)); - d2 += dest_stride; - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d2u8)); - d2 += dest_stride; - vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d3u8)); - d2 += dest_stride; - } - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_16_neon_asm.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_16_neon_asm.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_16_neon_asm.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_16_neon_asm.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,199 +0,0 @@ -; -; Copyright (c) 2013 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - EXPORT |vp9_lpf_horizontal_4_dual_neon| - ARM - - AREA ||.text||, CODE, READONLY, ALIGN=2 - -;void vp9_lpf_horizontal_4_dual_neon(uint8_t *s, int p, -; const uint8_t *blimit0, -; const uint8_t *limit0, -; const uint8_t *thresh0, -; const uint8_t *blimit1, -; const uint8_t *limit1, -; const uint8_t *thresh1) -; r0 uint8_t *s, -; r1 int p, -; r2 const uint8_t *blimit0, -; r3 const uint8_t *limit0, -; sp const uint8_t *thresh0, -; sp+4 const uint8_t *blimit1, -; sp+8 const uint8_t *limit1, -; sp+12 const uint8_t *thresh1, - -|vp9_lpf_horizontal_4_dual_neon| PROC - push {lr} - - ldr r12, [sp, #4] ; load thresh0 - vld1.8 {d0}, [r2] ; load blimit0 to first half q - vld1.8 {d2}, [r3] ; load limit0 to first half q - - add r1, r1, r1 ; double pitch - ldr r2, [sp, #8] ; load blimit1 - - vld1.8 {d4}, [r12] ; load thresh0 to first half q - - ldr r3, [sp, #12] ; load limit1 - ldr r12, [sp, #16] ; load thresh1 - vld1.8 {d1}, [r2] ; load blimit1 to 2nd half q - - sub r2, r0, r1, lsl #1 ; s[-4 * p] - - vld1.8 {d3}, [r3] ; load limit1 to 2nd half q - vld1.8 {d5}, [r12] ; load thresh1 to 2nd half q - - vpush {d8-d15} ; save neon registers - - add r3, r2, r1, lsr #1 ; s[-3 * p] - - vld1.u8 {q3}, [r2@64], r1 ; p3 - vld1.u8 {q4}, [r3@64], r1 ; p2 - vld1.u8 {q5}, [r2@64], r1 ; p1 - vld1.u8 {q6}, [r3@64], r1 ; p0 - vld1.u8 {q7}, [r2@64], r1 ; q0 - vld1.u8 {q8}, [r3@64], r1 ; q1 - vld1.u8 {q9}, [r2@64] ; q2 - vld1.u8 {q10}, [r3@64] ; q3 - - sub r2, r2, r1, lsl #1 - sub r3, r3, r1, lsl #1 - - bl vp9_loop_filter_neon_16 - - vst1.u8 {q5}, [r2@64], r1 ; store op1 - vst1.u8 {q6}, [r3@64], r1 ; store op0 - vst1.u8 {q7}, [r2@64], r1 ; store oq0 - vst1.u8 {q8}, [r3@64], r1 ; store oq1 - - vpop {d8-d15} ; restore neon registers - - pop {pc} - ENDP ; |vp9_lpf_horizontal_4_dual_neon| - -; void vp9_loop_filter_neon_16(); -; This is a helper function for the loopfilters. The invidual functions do the -; necessary load, transpose (if necessary) and store. This function uses -; registers d8-d15, so the calling function must save those registers. -; -; r0-r3, r12 PRESERVE -; q0 blimit -; q1 limit -; q2 thresh -; q3 p3 -; q4 p2 -; q5 p1 -; q6 p0 -; q7 q0 -; q8 q1 -; q9 q2 -; q10 q3 -; -; Outputs: -; q5 op1 -; q6 op0 -; q7 oq0 -; q8 oq1 -|vp9_loop_filter_neon_16| PROC - - ; filter_mask - vabd.u8 q11, q3, q4 ; m1 = abs(p3 - p2) - vabd.u8 q12, q4, q5 ; m2 = abs(p2 - p1) - vabd.u8 q13, q5, q6 ; m3 = abs(p1 - p0) - vabd.u8 q14, q8, q7 ; m4 = abs(q1 - q0) - vabd.u8 q3, q9, q8 ; m5 = abs(q2 - q1) - vabd.u8 q4, q10, q9 ; m6 = abs(q3 - q2) - - ; only compare the largest value to limit - vmax.u8 q11, q11, q12 ; m7 = max(m1, m2) - vmax.u8 q12, q13, q14 ; m8 = max(m3, m4) - - vabd.u8 q9, q6, q7 ; abs(p0 - q0) - - vmax.u8 q3, q3, q4 ; m9 = max(m5, m6) - - vmov.u8 q10, #0x80 - - vmax.u8 q15, q11, q12 ; m10 = max(m7, m8) - - vcgt.u8 q13, q13, q2 ; (abs(p1 - p0) > thresh)*-1 - vcgt.u8 q14, q14, q2 ; (abs(q1 - q0) > thresh)*-1 - vmax.u8 q15, q15, q3 ; m11 = max(m10, m9) - - vabd.u8 q2, q5, q8 ; a = abs(p1 - q1) - vqadd.u8 q9, q9, q9 ; b = abs(p0 - q0) * 2 - - veor q7, q7, q10 ; qs0 - - vcge.u8 q15, q1, q15 ; abs(m11) > limit - - vshr.u8 q2, q2, #1 ; a = a / 2 - veor q6, q6, q10 ; ps0 - - veor q5, q5, q10 ; ps1 - vqadd.u8 q9, q9, q2 ; a = b + a - - veor q8, q8, q10 ; qs1 - - vmov.u16 q4, #3 - - vsubl.s8 q2, d14, d12 ; ( qs0 - ps0) - vsubl.s8 q11, d15, d13 - - vcge.u8 q9, q0, q9 ; a > blimit - - vqsub.s8 q1, q5, q8 ; filter = clamp(ps1-qs1) - vorr q14, q13, q14 ; hev - - vmul.i16 q2, q2, q4 ; 3 * ( qs0 - ps0) - vmul.i16 q11, q11, q4 - - vand q1, q1, q14 ; filter &= hev - vand q15, q15, q9 ; mask - - vmov.u8 q4, #3 - - vaddw.s8 q2, q2, d2 ; filter + 3 * (qs0 - ps0) - vaddw.s8 q11, q11, d3 - - vmov.u8 q9, #4 - - ; filter = clamp(filter + 3 * ( qs0 - ps0)) - vqmovn.s16 d2, q2 - vqmovn.s16 d3, q11 - vand q1, q1, q15 ; filter &= mask - - vqadd.s8 q2, q1, q4 ; filter2 = clamp(filter+3) - vqadd.s8 q1, q1, q9 ; filter1 = clamp(filter+4) - vshr.s8 q2, q2, #3 ; filter2 >>= 3 - vshr.s8 q1, q1, #3 ; filter1 >>= 3 - - - vqadd.s8 q11, q6, q2 ; u = clamp(ps0 + filter2) - vqsub.s8 q0, q7, q1 ; u = clamp(qs0 - filter1) - - ; outer tap adjustments - vrshr.s8 q1, q1, #1 ; filter = ++filter1 >> 1 - - veor q7, q0, q10 ; *oq0 = u^0x80 - - vbic q1, q1, q14 ; filter &= ~hev - - vqadd.s8 q13, q5, q1 ; u = clamp(ps1 + filter) - vqsub.s8 q12, q8, q1 ; u = clamp(qs1 - filter) - - veor q6, q11, q10 ; *op0 = u^0x80 - veor q5, q13, q10 ; *op1 = u^0x80 - veor q8, q12, q10 ; *oq1 = u^0x80 - - bx lr - ENDP ; |vp9_loop_filter_neon_16| - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_16_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_16_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_16_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_16_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,179 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "./vp9_rtcd.h" -#include "./vpx_config.h" -#include "vpx/vpx_integer.h" - -static INLINE void vp9_loop_filter_neon_16( - uint8x16_t qblimit, // blimit - uint8x16_t qlimit, // limit - uint8x16_t qthresh, // thresh - uint8x16_t q3, // p3 - uint8x16_t q4, // p2 - uint8x16_t q5, // p1 - uint8x16_t q6, // p0 - uint8x16_t q7, // q0 - uint8x16_t q8, // q1 - uint8x16_t q9, // q2 - uint8x16_t q10, // q3 - uint8x16_t *q5r, // p1 - uint8x16_t *q6r, // p0 - uint8x16_t *q7r, // q0 - uint8x16_t *q8r) { // q1 - uint8x16_t q1u8, q2u8, q11u8, q12u8, q13u8, q14u8, q15u8; - int16x8_t q2s16, q11s16; - uint16x8_t q4u16; - int8x16_t q0s8, q1s8, q2s8, q11s8, q12s8, q13s8; - int8x8_t d2s8, d3s8; - - q11u8 = vabdq_u8(q3, q4); - q12u8 = vabdq_u8(q4, q5); - q13u8 = vabdq_u8(q5, q6); - q14u8 = vabdq_u8(q8, q7); - q3 = vabdq_u8(q9, q8); - q4 = vabdq_u8(q10, q9); - - q11u8 = vmaxq_u8(q11u8, q12u8); - q12u8 = vmaxq_u8(q13u8, q14u8); - q3 = vmaxq_u8(q3, q4); - q15u8 = vmaxq_u8(q11u8, q12u8); - - q9 = vabdq_u8(q6, q7); - - // vp8_hevmask - q13u8 = vcgtq_u8(q13u8, qthresh); - q14u8 = vcgtq_u8(q14u8, qthresh); - q15u8 = vmaxq_u8(q15u8, q3); - - q2u8 = vabdq_u8(q5, q8); - q9 = vqaddq_u8(q9, q9); - - q15u8 = vcgeq_u8(qlimit, q15u8); - - // vp8_filter() function - // convert to signed - q10 = vdupq_n_u8(0x80); - q8 = veorq_u8(q8, q10); - q7 = veorq_u8(q7, q10); - q6 = veorq_u8(q6, q10); - q5 = veorq_u8(q5, q10); - - q2u8 = vshrq_n_u8(q2u8, 1); - q9 = vqaddq_u8(q9, q2u8); - - q2s16 = vsubl_s8(vget_low_s8(vreinterpretq_s8_u8(q7)), - vget_low_s8(vreinterpretq_s8_u8(q6))); - q11s16 = vsubl_s8(vget_high_s8(vreinterpretq_s8_u8(q7)), - vget_high_s8(vreinterpretq_s8_u8(q6))); - - q9 = vcgeq_u8(qblimit, q9); - - q1s8 = vqsubq_s8(vreinterpretq_s8_u8(q5), - vreinterpretq_s8_u8(q8)); - - q14u8 = vorrq_u8(q13u8, q14u8); - - q4u16 = vdupq_n_u16(3); - q2s16 = vmulq_s16(q2s16, vreinterpretq_s16_u16(q4u16)); - q11s16 = vmulq_s16(q11s16, vreinterpretq_s16_u16(q4u16)); - - q1u8 = vandq_u8(vreinterpretq_u8_s8(q1s8), q14u8); - q15u8 = vandq_u8(q15u8, q9); - - q1s8 = vreinterpretq_s8_u8(q1u8); - q2s16 = vaddw_s8(q2s16, vget_low_s8(q1s8)); - q11s16 = vaddw_s8(q11s16, vget_high_s8(q1s8)); - - q4 = vdupq_n_u8(3); - q9 = vdupq_n_u8(4); - // vp8_filter = clamp(vp8_filter + 3 * ( qs0 - ps0)) - d2s8 = vqmovn_s16(q2s16); - d3s8 = vqmovn_s16(q11s16); - q1s8 = vcombine_s8(d2s8, d3s8); - q1u8 = vandq_u8(vreinterpretq_u8_s8(q1s8), q15u8); - q1s8 = vreinterpretq_s8_u8(q1u8); - - q2s8 = vqaddq_s8(q1s8, vreinterpretq_s8_u8(q4)); - q1s8 = vqaddq_s8(q1s8, vreinterpretq_s8_u8(q9)); - q2s8 = vshrq_n_s8(q2s8, 3); - q1s8 = vshrq_n_s8(q1s8, 3); - - q11s8 = vqaddq_s8(vreinterpretq_s8_u8(q6), q2s8); - q0s8 = vqsubq_s8(vreinterpretq_s8_u8(q7), q1s8); - - q1s8 = vrshrq_n_s8(q1s8, 1); - q1s8 = vbicq_s8(q1s8, vreinterpretq_s8_u8(q14u8)); - - q13s8 = vqaddq_s8(vreinterpretq_s8_u8(q5), q1s8); - q12s8 = vqsubq_s8(vreinterpretq_s8_u8(q8), q1s8); - - *q8r = veorq_u8(vreinterpretq_u8_s8(q12s8), q10); - *q7r = veorq_u8(vreinterpretq_u8_s8(q0s8), q10); - *q6r = veorq_u8(vreinterpretq_u8_s8(q11s8), q10); - *q5r = veorq_u8(vreinterpretq_u8_s8(q13s8), q10); - return; -} - -void vp9_lpf_horizontal_4_dual_neon(uint8_t *s, int p /* pitch */, - const uint8_t *blimit0, - const uint8_t *limit0, - const uint8_t *thresh0, - const uint8_t *blimit1, - const uint8_t *limit1, - const uint8_t *thresh1) { - uint8x8_t dblimit0, dlimit0, dthresh0, dblimit1, dlimit1, dthresh1; - uint8x16_t qblimit, qlimit, qthresh; - uint8x16_t q3u8, q4u8, q5u8, q6u8, q7u8, q8u8, q9u8, q10u8; - - dblimit0 = vld1_u8(blimit0); - dlimit0 = vld1_u8(limit0); - dthresh0 = vld1_u8(thresh0); - dblimit1 = vld1_u8(blimit1); - dlimit1 = vld1_u8(limit1); - dthresh1 = vld1_u8(thresh1); - qblimit = vcombine_u8(dblimit0, dblimit1); - qlimit = vcombine_u8(dlimit0, dlimit1); - qthresh = vcombine_u8(dthresh0, dthresh1); - - s -= (p << 2); - - q3u8 = vld1q_u8(s); - s += p; - q4u8 = vld1q_u8(s); - s += p; - q5u8 = vld1q_u8(s); - s += p; - q6u8 = vld1q_u8(s); - s += p; - q7u8 = vld1q_u8(s); - s += p; - q8u8 = vld1q_u8(s); - s += p; - q9u8 = vld1q_u8(s); - s += p; - q10u8 = vld1q_u8(s); - - vp9_loop_filter_neon_16(qblimit, qlimit, qthresh, - q3u8, q4u8, q5u8, q6u8, q7u8, q8u8, q9u8, q10u8, - &q5u8, &q6u8, &q7u8, &q8u8); - - s -= (p * 5); - vst1q_u8(s, q5u8); - s += p; - vst1q_u8(s, q6u8); - s += p; - vst1q_u8(s, q7u8); - s += p; - vst1q_u8(s, q8u8); - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_4_neon_asm.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_4_neon_asm.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_4_neon_asm.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_4_neon_asm.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,277 +0,0 @@ -; -; Copyright (c) 2013 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - EXPORT |vp9_lpf_horizontal_4_neon| - EXPORT |vp9_lpf_vertical_4_neon| - ARM - - AREA ||.text||, CODE, READONLY, ALIGN=2 - -; Currently vp9 only works on iterations 8 at a time. The vp8 loop filter -; works on 16 iterations at a time. -; TODO(fgalligan): See about removing the count code as this function is only -; called with a count of 1. -; -; void vp9_lpf_horizontal_4_neon(uint8_t *s, -; int p /* pitch */, -; const uint8_t *blimit, -; const uint8_t *limit, -; const uint8_t *thresh, -; int count) -; -; r0 uint8_t *s, -; r1 int p, /* pitch */ -; r2 const uint8_t *blimit, -; r3 const uint8_t *limit, -; sp const uint8_t *thresh, -; sp+4 int count -|vp9_lpf_horizontal_4_neon| PROC - push {lr} - - vld1.8 {d0[]}, [r2] ; duplicate *blimit - ldr r12, [sp, #8] ; load count - ldr r2, [sp, #4] ; load thresh - add r1, r1, r1 ; double pitch - - cmp r12, #0 - beq end_vp9_lf_h_edge - - vld1.8 {d1[]}, [r3] ; duplicate *limit - vld1.8 {d2[]}, [r2] ; duplicate *thresh - -count_lf_h_loop - sub r2, r0, r1, lsl #1 ; move src pointer down by 4 lines - add r3, r2, r1, lsr #1 ; set to 3 lines down - - vld1.u8 {d3}, [r2@64], r1 ; p3 - vld1.u8 {d4}, [r3@64], r1 ; p2 - vld1.u8 {d5}, [r2@64], r1 ; p1 - vld1.u8 {d6}, [r3@64], r1 ; p0 - vld1.u8 {d7}, [r2@64], r1 ; q0 - vld1.u8 {d16}, [r3@64], r1 ; q1 - vld1.u8 {d17}, [r2@64] ; q2 - vld1.u8 {d18}, [r3@64] ; q3 - - sub r2, r2, r1, lsl #1 - sub r3, r3, r1, lsl #1 - - bl vp9_loop_filter_neon - - vst1.u8 {d4}, [r2@64], r1 ; store op1 - vst1.u8 {d5}, [r3@64], r1 ; store op0 - vst1.u8 {d6}, [r2@64], r1 ; store oq0 - vst1.u8 {d7}, [r3@64], r1 ; store oq1 - - add r0, r0, #8 - subs r12, r12, #1 - bne count_lf_h_loop - -end_vp9_lf_h_edge - pop {pc} - ENDP ; |vp9_lpf_horizontal_4_neon| - -; Currently vp9 only works on iterations 8 at a time. The vp8 loop filter -; works on 16 iterations at a time. -; TODO(fgalligan): See about removing the count code as this function is only -; called with a count of 1. -; -; void vp9_lpf_vertical_4_neon(uint8_t *s, -; int p /* pitch */, -; const uint8_t *blimit, -; const uint8_t *limit, -; const uint8_t *thresh, -; int count) -; -; r0 uint8_t *s, -; r1 int p, /* pitch */ -; r2 const uint8_t *blimit, -; r3 const uint8_t *limit, -; sp const uint8_t *thresh, -; sp+4 int count -|vp9_lpf_vertical_4_neon| PROC - push {lr} - - vld1.8 {d0[]}, [r2] ; duplicate *blimit - ldr r12, [sp, #8] ; load count - vld1.8 {d1[]}, [r3] ; duplicate *limit - - ldr r3, [sp, #4] ; load thresh - sub r2, r0, #4 ; move s pointer down by 4 columns - cmp r12, #0 - beq end_vp9_lf_v_edge - - vld1.8 {d2[]}, [r3] ; duplicate *thresh - -count_lf_v_loop - vld1.u8 {d3}, [r2], r1 ; load s data - vld1.u8 {d4}, [r2], r1 - vld1.u8 {d5}, [r2], r1 - vld1.u8 {d6}, [r2], r1 - vld1.u8 {d7}, [r2], r1 - vld1.u8 {d16}, [r2], r1 - vld1.u8 {d17}, [r2], r1 - vld1.u8 {d18}, [r2] - - ;transpose to 8x16 matrix - vtrn.32 d3, d7 - vtrn.32 d4, d16 - vtrn.32 d5, d17 - vtrn.32 d6, d18 - - vtrn.16 d3, d5 - vtrn.16 d4, d6 - vtrn.16 d7, d17 - vtrn.16 d16, d18 - - vtrn.8 d3, d4 - vtrn.8 d5, d6 - vtrn.8 d7, d16 - vtrn.8 d17, d18 - - bl vp9_loop_filter_neon - - sub r0, r0, #2 - - ;store op1, op0, oq0, oq1 - vst4.8 {d4[0], d5[0], d6[0], d7[0]}, [r0], r1 - vst4.8 {d4[1], d5[1], d6[1], d7[1]}, [r0], r1 - vst4.8 {d4[2], d5[2], d6[2], d7[2]}, [r0], r1 - vst4.8 {d4[3], d5[3], d6[3], d7[3]}, [r0], r1 - vst4.8 {d4[4], d5[4], d6[4], d7[4]}, [r0], r1 - vst4.8 {d4[5], d5[5], d6[5], d7[5]}, [r0], r1 - vst4.8 {d4[6], d5[6], d6[6], d7[6]}, [r0], r1 - vst4.8 {d4[7], d5[7], d6[7], d7[7]}, [r0] - - add r0, r0, r1, lsl #3 ; s += pitch * 8 - subs r12, r12, #1 - subne r2, r0, #4 ; move s pointer down by 4 columns - bne count_lf_v_loop - -end_vp9_lf_v_edge - pop {pc} - ENDP ; |vp9_lpf_vertical_4_neon| - -; void vp9_loop_filter_neon(); -; This is a helper function for the loopfilters. The invidual functions do the -; necessary load, transpose (if necessary) and store. The function does not use -; registers d8-d15. -; -; Inputs: -; r0-r3, r12 PRESERVE -; d0 blimit -; d1 limit -; d2 thresh -; d3 p3 -; d4 p2 -; d5 p1 -; d6 p0 -; d7 q0 -; d16 q1 -; d17 q2 -; d18 q3 -; -; Outputs: -; d4 op1 -; d5 op0 -; d6 oq0 -; d7 oq1 -|vp9_loop_filter_neon| PROC - ; filter_mask - vabd.u8 d19, d3, d4 ; m1 = abs(p3 - p2) - vabd.u8 d20, d4, d5 ; m2 = abs(p2 - p1) - vabd.u8 d21, d5, d6 ; m3 = abs(p1 - p0) - vabd.u8 d22, d16, d7 ; m4 = abs(q1 - q0) - vabd.u8 d3, d17, d16 ; m5 = abs(q2 - q1) - vabd.u8 d4, d18, d17 ; m6 = abs(q3 - q2) - - ; only compare the largest value to limit - vmax.u8 d19, d19, d20 ; m1 = max(m1, m2) - vmax.u8 d20, d21, d22 ; m2 = max(m3, m4) - - vabd.u8 d17, d6, d7 ; abs(p0 - q0) - - vmax.u8 d3, d3, d4 ; m3 = max(m5, m6) - - vmov.u8 d18, #0x80 - - vmax.u8 d23, d19, d20 ; m1 = max(m1, m2) - - ; hevmask - vcgt.u8 d21, d21, d2 ; (abs(p1 - p0) > thresh)*-1 - vcgt.u8 d22, d22, d2 ; (abs(q1 - q0) > thresh)*-1 - vmax.u8 d23, d23, d3 ; m1 = max(m1, m3) - - vabd.u8 d28, d5, d16 ; a = abs(p1 - q1) - vqadd.u8 d17, d17, d17 ; b = abs(p0 - q0) * 2 - - veor d7, d7, d18 ; qs0 - - vcge.u8 d23, d1, d23 ; abs(m1) > limit - - ; filter() function - ; convert to signed - - vshr.u8 d28, d28, #1 ; a = a / 2 - veor d6, d6, d18 ; ps0 - - veor d5, d5, d18 ; ps1 - vqadd.u8 d17, d17, d28 ; a = b + a - - veor d16, d16, d18 ; qs1 - - vmov.u8 d19, #3 - - vsub.s8 d28, d7, d6 ; ( qs0 - ps0) - - vcge.u8 d17, d0, d17 ; a > blimit - - vqsub.s8 d27, d5, d16 ; filter = clamp(ps1-qs1) - vorr d22, d21, d22 ; hevmask - - vmull.s8 q12, d28, d19 ; 3 * ( qs0 - ps0) - - vand d27, d27, d22 ; filter &= hev - vand d23, d23, d17 ; filter_mask - - vaddw.s8 q12, q12, d27 ; filter + 3 * (qs0 - ps0) - - vmov.u8 d17, #4 - - ; filter = clamp(filter + 3 * ( qs0 - ps0)) - vqmovn.s16 d27, q12 - - vand d27, d27, d23 ; filter &= mask - - vqadd.s8 d28, d27, d19 ; filter2 = clamp(filter+3) - vqadd.s8 d27, d27, d17 ; filter1 = clamp(filter+4) - vshr.s8 d28, d28, #3 ; filter2 >>= 3 - vshr.s8 d27, d27, #3 ; filter1 >>= 3 - - vqadd.s8 d19, d6, d28 ; u = clamp(ps0 + filter2) - vqsub.s8 d26, d7, d27 ; u = clamp(qs0 - filter1) - - ; outer tap adjustments - vrshr.s8 d27, d27, #1 ; filter = ++filter1 >> 1 - - veor d6, d26, d18 ; *oq0 = u^0x80 - - vbic d27, d27, d22 ; filter &= ~hev - - vqadd.s8 d21, d5, d27 ; u = clamp(ps1 + filter) - vqsub.s8 d20, d16, d27 ; u = clamp(qs1 - filter) - - veor d5, d19, d18 ; *op0 = u^0x80 - veor d4, d21, d18 ; *op1 = u^0x80 - veor d7, d20, d18 ; *oq1 = u^0x80 - - bx lr - ENDP ; |vp9_loop_filter_neon| - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_4_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_4_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_4_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_4_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,274 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "./vpx_config.h" - -static INLINE void vp9_loop_filter_neon( - uint8x8_t dblimit, // flimit - uint8x8_t dlimit, // limit - uint8x8_t dthresh, // thresh - uint8x8_t d3u8, // p3 - uint8x8_t d4u8, // p2 - uint8x8_t d5u8, // p1 - uint8x8_t d6u8, // p0 - uint8x8_t d7u8, // q0 - uint8x8_t d16u8, // q1 - uint8x8_t d17u8, // q2 - uint8x8_t d18u8, // q3 - uint8x8_t *d4ru8, // p1 - uint8x8_t *d5ru8, // p0 - uint8x8_t *d6ru8, // q0 - uint8x8_t *d7ru8) { // q1 - uint8x8_t d19u8, d20u8, d21u8, d22u8, d23u8, d27u8, d28u8; - int16x8_t q12s16; - int8x8_t d19s8, d20s8, d21s8, d26s8, d27s8, d28s8; - - d19u8 = vabd_u8(d3u8, d4u8); - d20u8 = vabd_u8(d4u8, d5u8); - d21u8 = vabd_u8(d5u8, d6u8); - d22u8 = vabd_u8(d16u8, d7u8); - d3u8 = vabd_u8(d17u8, d16u8); - d4u8 = vabd_u8(d18u8, d17u8); - - d19u8 = vmax_u8(d19u8, d20u8); - d20u8 = vmax_u8(d21u8, d22u8); - d3u8 = vmax_u8(d3u8, d4u8); - d23u8 = vmax_u8(d19u8, d20u8); - - d17u8 = vabd_u8(d6u8, d7u8); - - d21u8 = vcgt_u8(d21u8, dthresh); - d22u8 = vcgt_u8(d22u8, dthresh); - d23u8 = vmax_u8(d23u8, d3u8); - - d28u8 = vabd_u8(d5u8, d16u8); - d17u8 = vqadd_u8(d17u8, d17u8); - - d23u8 = vcge_u8(dlimit, d23u8); - - d18u8 = vdup_n_u8(0x80); - d5u8 = veor_u8(d5u8, d18u8); - d6u8 = veor_u8(d6u8, d18u8); - d7u8 = veor_u8(d7u8, d18u8); - d16u8 = veor_u8(d16u8, d18u8); - - d28u8 = vshr_n_u8(d28u8, 1); - d17u8 = vqadd_u8(d17u8, d28u8); - - d19u8 = vdup_n_u8(3); - - d28s8 = vsub_s8(vreinterpret_s8_u8(d7u8), - vreinterpret_s8_u8(d6u8)); - - d17u8 = vcge_u8(dblimit, d17u8); - - d27s8 = vqsub_s8(vreinterpret_s8_u8(d5u8), - vreinterpret_s8_u8(d16u8)); - - d22u8 = vorr_u8(d21u8, d22u8); - - q12s16 = vmull_s8(d28s8, vreinterpret_s8_u8(d19u8)); - - d27u8 = vand_u8(vreinterpret_u8_s8(d27s8), d22u8); - d23u8 = vand_u8(d23u8, d17u8); - - q12s16 = vaddw_s8(q12s16, vreinterpret_s8_u8(d27u8)); - - d17u8 = vdup_n_u8(4); - - d27s8 = vqmovn_s16(q12s16); - d27u8 = vand_u8(vreinterpret_u8_s8(d27s8), d23u8); - d27s8 = vreinterpret_s8_u8(d27u8); - - d28s8 = vqadd_s8(d27s8, vreinterpret_s8_u8(d19u8)); - d27s8 = vqadd_s8(d27s8, vreinterpret_s8_u8(d17u8)); - d28s8 = vshr_n_s8(d28s8, 3); - d27s8 = vshr_n_s8(d27s8, 3); - - d19s8 = vqadd_s8(vreinterpret_s8_u8(d6u8), d28s8); - d26s8 = vqsub_s8(vreinterpret_s8_u8(d7u8), d27s8); - - d27s8 = vrshr_n_s8(d27s8, 1); - d27s8 = vbic_s8(d27s8, vreinterpret_s8_u8(d22u8)); - - d21s8 = vqadd_s8(vreinterpret_s8_u8(d5u8), d27s8); - d20s8 = vqsub_s8(vreinterpret_s8_u8(d16u8), d27s8); - - *d4ru8 = veor_u8(vreinterpret_u8_s8(d21s8), d18u8); - *d5ru8 = veor_u8(vreinterpret_u8_s8(d19s8), d18u8); - *d6ru8 = veor_u8(vreinterpret_u8_s8(d26s8), d18u8); - *d7ru8 = veor_u8(vreinterpret_u8_s8(d20s8), d18u8); - return; -} - -void vp9_lpf_horizontal_4_neon( - unsigned char *src, - int pitch, - unsigned char *blimit, - unsigned char *limit, - unsigned char *thresh, - int count) { - int i; - uint8_t *s, *psrc; - uint8x8_t dblimit, dlimit, dthresh; - uint8x8_t d3u8, d4u8, d5u8, d6u8, d7u8, d16u8, d17u8, d18u8; - - if (count == 0) // end_vp9_lf_h_edge - return; - - dblimit = vld1_u8(blimit); - dlimit = vld1_u8(limit); - dthresh = vld1_u8(thresh); - - psrc = src - (pitch << 2); - for (i = 0; i < count; i++) { - s = psrc + i * 8; - - d3u8 = vld1_u8(s); - s += pitch; - d4u8 = vld1_u8(s); - s += pitch; - d5u8 = vld1_u8(s); - s += pitch; - d6u8 = vld1_u8(s); - s += pitch; - d7u8 = vld1_u8(s); - s += pitch; - d16u8 = vld1_u8(s); - s += pitch; - d17u8 = vld1_u8(s); - s += pitch; - d18u8 = vld1_u8(s); - - vp9_loop_filter_neon(dblimit, dlimit, dthresh, - d3u8, d4u8, d5u8, d6u8, d7u8, d16u8, d17u8, d18u8, - &d4u8, &d5u8, &d6u8, &d7u8); - - s -= (pitch * 5); - vst1_u8(s, d4u8); - s += pitch; - vst1_u8(s, d5u8); - s += pitch; - vst1_u8(s, d6u8); - s += pitch; - vst1_u8(s, d7u8); - } - return; -} - -void vp9_lpf_vertical_4_neon( - unsigned char *src, - int pitch, - unsigned char *blimit, - unsigned char *limit, - unsigned char *thresh, - int count) { - int i, pitch8; - uint8_t *s; - uint8x8_t dblimit, dlimit, dthresh; - uint8x8_t d3u8, d4u8, d5u8, d6u8, d7u8, d16u8, d17u8, d18u8; - uint32x2x2_t d2tmp0, d2tmp1, d2tmp2, d2tmp3; - uint16x4x2_t d2tmp4, d2tmp5, d2tmp6, d2tmp7; - uint8x8x2_t d2tmp8, d2tmp9, d2tmp10, d2tmp11; - uint8x8x4_t d4Result; - - if (count == 0) // end_vp9_lf_h_edge - return; - - dblimit = vld1_u8(blimit); - dlimit = vld1_u8(limit); - dthresh = vld1_u8(thresh); - - pitch8 = pitch * 8; - for (i = 0; i < count; i++, src += pitch8) { - s = src - (i + 1) * 4; - - d3u8 = vld1_u8(s); - s += pitch; - d4u8 = vld1_u8(s); - s += pitch; - d5u8 = vld1_u8(s); - s += pitch; - d6u8 = vld1_u8(s); - s += pitch; - d7u8 = vld1_u8(s); - s += pitch; - d16u8 = vld1_u8(s); - s += pitch; - d17u8 = vld1_u8(s); - s += pitch; - d18u8 = vld1_u8(s); - - d2tmp0 = vtrn_u32(vreinterpret_u32_u8(d3u8), - vreinterpret_u32_u8(d7u8)); - d2tmp1 = vtrn_u32(vreinterpret_u32_u8(d4u8), - vreinterpret_u32_u8(d16u8)); - d2tmp2 = vtrn_u32(vreinterpret_u32_u8(d5u8), - vreinterpret_u32_u8(d17u8)); - d2tmp3 = vtrn_u32(vreinterpret_u32_u8(d6u8), - vreinterpret_u32_u8(d18u8)); - - d2tmp4 = vtrn_u16(vreinterpret_u16_u32(d2tmp0.val[0]), - vreinterpret_u16_u32(d2tmp2.val[0])); - d2tmp5 = vtrn_u16(vreinterpret_u16_u32(d2tmp1.val[0]), - vreinterpret_u16_u32(d2tmp3.val[0])); - d2tmp6 = vtrn_u16(vreinterpret_u16_u32(d2tmp0.val[1]), - vreinterpret_u16_u32(d2tmp2.val[1])); - d2tmp7 = vtrn_u16(vreinterpret_u16_u32(d2tmp1.val[1]), - vreinterpret_u16_u32(d2tmp3.val[1])); - - d2tmp8 = vtrn_u8(vreinterpret_u8_u16(d2tmp4.val[0]), - vreinterpret_u8_u16(d2tmp5.val[0])); - d2tmp9 = vtrn_u8(vreinterpret_u8_u16(d2tmp4.val[1]), - vreinterpret_u8_u16(d2tmp5.val[1])); - d2tmp10 = vtrn_u8(vreinterpret_u8_u16(d2tmp6.val[0]), - vreinterpret_u8_u16(d2tmp7.val[0])); - d2tmp11 = vtrn_u8(vreinterpret_u8_u16(d2tmp6.val[1]), - vreinterpret_u8_u16(d2tmp7.val[1])); - - d3u8 = d2tmp8.val[0]; - d4u8 = d2tmp8.val[1]; - d5u8 = d2tmp9.val[0]; - d6u8 = d2tmp9.val[1]; - d7u8 = d2tmp10.val[0]; - d16u8 = d2tmp10.val[1]; - d17u8 = d2tmp11.val[0]; - d18u8 = d2tmp11.val[1]; - - vp9_loop_filter_neon(dblimit, dlimit, dthresh, - d3u8, d4u8, d5u8, d6u8, d7u8, d16u8, d17u8, d18u8, - &d4u8, &d5u8, &d6u8, &d7u8); - - d4Result.val[0] = d4u8; - d4Result.val[1] = d5u8; - d4Result.val[2] = d6u8; - d4Result.val[3] = d7u8; - - src -= 2; - vst4_lane_u8(src, d4Result, 0); - src += pitch; - vst4_lane_u8(src, d4Result, 1); - src += pitch; - vst4_lane_u8(src, d4Result, 2); - src += pitch; - vst4_lane_u8(src, d4Result, 3); - src += pitch; - vst4_lane_u8(src, d4Result, 4); - src += pitch; - vst4_lane_u8(src, d4Result, 5); - src += pitch; - vst4_lane_u8(src, d4Result, 6); - src += pitch; - vst4_lane_u8(src, d4Result, 7); - } - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_8_neon_asm.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_8_neon_asm.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_8_neon_asm.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_8_neon_asm.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,451 +0,0 @@ -; -; Copyright (c) 2013 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - EXPORT |vp9_lpf_horizontal_8_neon| - EXPORT |vp9_lpf_vertical_8_neon| - ARM - - AREA ||.text||, CODE, READONLY, ALIGN=2 - -; Currently vp9 only works on iterations 8 at a time. The vp8 loop filter -; works on 16 iterations at a time. -; TODO(fgalligan): See about removing the count code as this function is only -; called with a count of 1. -; -; void vp9_lpf_horizontal_8_neon(uint8_t *s, int p, -; const uint8_t *blimit, -; const uint8_t *limit, -; const uint8_t *thresh, -; int count) -; r0 uint8_t *s, -; r1 int p, /* pitch */ -; r2 const uint8_t *blimit, -; r3 const uint8_t *limit, -; sp const uint8_t *thresh, -; sp+4 int count -|vp9_lpf_horizontal_8_neon| PROC - push {r4-r5, lr} - - vld1.8 {d0[]}, [r2] ; duplicate *blimit - ldr r12, [sp, #16] ; load count - ldr r2, [sp, #12] ; load thresh - add r1, r1, r1 ; double pitch - - cmp r12, #0 - beq end_vp9_mblf_h_edge - - vld1.8 {d1[]}, [r3] ; duplicate *limit - vld1.8 {d2[]}, [r2] ; duplicate *thresh - -count_mblf_h_loop - sub r3, r0, r1, lsl #1 ; move src pointer down by 4 lines - add r2, r3, r1, lsr #1 ; set to 3 lines down - - vld1.u8 {d3}, [r3@64], r1 ; p3 - vld1.u8 {d4}, [r2@64], r1 ; p2 - vld1.u8 {d5}, [r3@64], r1 ; p1 - vld1.u8 {d6}, [r2@64], r1 ; p0 - vld1.u8 {d7}, [r3@64], r1 ; q0 - vld1.u8 {d16}, [r2@64], r1 ; q1 - vld1.u8 {d17}, [r3@64] ; q2 - vld1.u8 {d18}, [r2@64], r1 ; q3 - - sub r3, r3, r1, lsl #1 - sub r2, r2, r1, lsl #2 - - bl vp9_mbloop_filter_neon - - vst1.u8 {d0}, [r2@64], r1 ; store op2 - vst1.u8 {d1}, [r3@64], r1 ; store op1 - vst1.u8 {d2}, [r2@64], r1 ; store op0 - vst1.u8 {d3}, [r3@64], r1 ; store oq0 - vst1.u8 {d4}, [r2@64], r1 ; store oq1 - vst1.u8 {d5}, [r3@64], r1 ; store oq2 - - add r0, r0, #8 - subs r12, r12, #1 - bne count_mblf_h_loop - -end_vp9_mblf_h_edge - pop {r4-r5, pc} - - ENDP ; |vp9_lpf_horizontal_8_neon| - -; void vp9_lpf_vertical_8_neon(uint8_t *s, -; int pitch, -; const uint8_t *blimit, -; const uint8_t *limit, -; const uint8_t *thresh, -; int count) -; -; r0 uint8_t *s, -; r1 int pitch, -; r2 const uint8_t *blimit, -; r3 const uint8_t *limit, -; sp const uint8_t *thresh, -; sp+4 int count -|vp9_lpf_vertical_8_neon| PROC - push {r4-r5, lr} - - vld1.8 {d0[]}, [r2] ; duplicate *blimit - ldr r12, [sp, #16] ; load count - vld1.8 {d1[]}, [r3] ; duplicate *limit - - ldr r3, [sp, #12] ; load thresh - sub r2, r0, #4 ; move s pointer down by 4 columns - cmp r12, #0 - beq end_vp9_mblf_v_edge - - vld1.8 {d2[]}, [r3] ; duplicate *thresh - -count_mblf_v_loop - vld1.u8 {d3}, [r2], r1 ; load s data - vld1.u8 {d4}, [r2], r1 - vld1.u8 {d5}, [r2], r1 - vld1.u8 {d6}, [r2], r1 - vld1.u8 {d7}, [r2], r1 - vld1.u8 {d16}, [r2], r1 - vld1.u8 {d17}, [r2], r1 - vld1.u8 {d18}, [r2] - - ;transpose to 8x16 matrix - vtrn.32 d3, d7 - vtrn.32 d4, d16 - vtrn.32 d5, d17 - vtrn.32 d6, d18 - - vtrn.16 d3, d5 - vtrn.16 d4, d6 - vtrn.16 d7, d17 - vtrn.16 d16, d18 - - vtrn.8 d3, d4 - vtrn.8 d5, d6 - vtrn.8 d7, d16 - vtrn.8 d17, d18 - - sub r2, r0, #3 - add r3, r0, #1 - - bl vp9_mbloop_filter_neon - - ;store op2, op1, op0, oq0 - vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r2], r1 - vst4.8 {d0[1], d1[1], d2[1], d3[1]}, [r2], r1 - vst4.8 {d0[2], d1[2], d2[2], d3[2]}, [r2], r1 - vst4.8 {d0[3], d1[3], d2[3], d3[3]}, [r2], r1 - vst4.8 {d0[4], d1[4], d2[4], d3[4]}, [r2], r1 - vst4.8 {d0[5], d1[5], d2[5], d3[5]}, [r2], r1 - vst4.8 {d0[6], d1[6], d2[6], d3[6]}, [r2], r1 - vst4.8 {d0[7], d1[7], d2[7], d3[7]}, [r2] - - ;store oq1, oq2 - vst2.8 {d4[0], d5[0]}, [r3], r1 - vst2.8 {d4[1], d5[1]}, [r3], r1 - vst2.8 {d4[2], d5[2]}, [r3], r1 - vst2.8 {d4[3], d5[3]}, [r3], r1 - vst2.8 {d4[4], d5[4]}, [r3], r1 - vst2.8 {d4[5], d5[5]}, [r3], r1 - vst2.8 {d4[6], d5[6]}, [r3], r1 - vst2.8 {d4[7], d5[7]}, [r3] - - add r0, r0, r1, lsl #3 ; s += pitch * 8 - subs r12, r12, #1 - subne r2, r0, #4 ; move s pointer down by 4 columns - bne count_mblf_v_loop - -end_vp9_mblf_v_edge - pop {r4-r5, pc} - ENDP ; |vp9_lpf_vertical_8_neon| - -; void vp9_mbloop_filter_neon(); -; This is a helper function for the loopfilters. The invidual functions do the -; necessary load, transpose (if necessary) and store. The function does not use -; registers d8-d15. -; -; Inputs: -; r0-r3, r12 PRESERVE -; d0 blimit -; d1 limit -; d2 thresh -; d3 p3 -; d4 p2 -; d5 p1 -; d6 p0 -; d7 q0 -; d16 q1 -; d17 q2 -; d18 q3 -; -; Outputs: -; d0 op2 -; d1 op1 -; d2 op0 -; d3 oq0 -; d4 oq1 -; d5 oq2 -|vp9_mbloop_filter_neon| PROC - ; filter_mask - vabd.u8 d19, d3, d4 ; m1 = abs(p3 - p2) - vabd.u8 d20, d4, d5 ; m2 = abs(p2 - p1) - vabd.u8 d21, d5, d6 ; m3 = abs(p1 - p0) - vabd.u8 d22, d16, d7 ; m4 = abs(q1 - q0) - vabd.u8 d23, d17, d16 ; m5 = abs(q2 - q1) - vabd.u8 d24, d18, d17 ; m6 = abs(q3 - q2) - - ; only compare the largest value to limit - vmax.u8 d19, d19, d20 ; m1 = max(m1, m2) - vmax.u8 d20, d21, d22 ; m2 = max(m3, m4) - - vabd.u8 d25, d6, d4 ; m7 = abs(p0 - p2) - - vmax.u8 d23, d23, d24 ; m3 = max(m5, m6) - - vabd.u8 d26, d7, d17 ; m8 = abs(q0 - q2) - - vmax.u8 d19, d19, d20 - - vabd.u8 d24, d6, d7 ; m9 = abs(p0 - q0) - vabd.u8 d27, d3, d6 ; m10 = abs(p3 - p0) - vabd.u8 d28, d18, d7 ; m11 = abs(q3 - q0) - - vmax.u8 d19, d19, d23 - - vabd.u8 d23, d5, d16 ; a = abs(p1 - q1) - vqadd.u8 d24, d24, d24 ; b = abs(p0 - q0) * 2 - - ; abs () > limit - vcge.u8 d19, d1, d19 - - ; only compare the largest value to thresh - vmax.u8 d25, d25, d26 ; m4 = max(m7, m8) - vmax.u8 d26, d27, d28 ; m5 = max(m10, m11) - - vshr.u8 d23, d23, #1 ; a = a / 2 - - vmax.u8 d25, d25, d26 ; m4 = max(m4, m5) - - vqadd.u8 d24, d24, d23 ; a = b + a - - vmax.u8 d20, d20, d25 ; m2 = max(m2, m4) - - vmov.u8 d23, #1 - vcge.u8 d24, d0, d24 ; a > blimit - - vcgt.u8 d21, d21, d2 ; (abs(p1 - p0) > thresh)*-1 - - vcge.u8 d20, d23, d20 ; flat - - vand d19, d19, d24 ; mask - - vcgt.u8 d23, d22, d2 ; (abs(q1 - q0) > thresh)*-1 - - vand d20, d20, d19 ; flat & mask - - vmov.u8 d22, #0x80 - - vorr d23, d21, d23 ; hev - - ; This instruction will truncate the "flat & mask" masks down to 4 bits - ; each to fit into one 32 bit arm register. The values are stored in - ; q10.64[0]. - vshrn.u16 d30, q10, #4 - vmov.u32 r4, d30[0] ; flat & mask 4bits - - adds r5, r4, #1 ; Check for all 1's - - ; If mask and flat are 1's for all vectors, then we only need to execute - ; the power branch for all vectors. - beq power_branch_only - - cmp r4, #0 ; Check for 0, set flag for later - - ; mbfilter() function - ; filter() function - ; convert to signed - veor d21, d7, d22 ; qs0 - veor d24, d6, d22 ; ps0 - veor d25, d5, d22 ; ps1 - veor d26, d16, d22 ; qs1 - - vmov.u8 d27, #3 - - vsub.s8 d28, d21, d24 ; ( qs0 - ps0) - - vqsub.s8 d29, d25, d26 ; filter = clamp(ps1-qs1) - - vmull.s8 q15, d28, d27 ; 3 * ( qs0 - ps0) - - vand d29, d29, d23 ; filter &= hev - - vaddw.s8 q15, q15, d29 ; filter + 3 * (qs0 - ps0) - - vmov.u8 d29, #4 - - ; filter = clamp(filter + 3 * ( qs0 - ps0)) - vqmovn.s16 d28, q15 - - vand d28, d28, d19 ; filter &= mask - - vqadd.s8 d30, d28, d27 ; filter2 = clamp(filter+3) - vqadd.s8 d29, d28, d29 ; filter1 = clamp(filter+4) - vshr.s8 d30, d30, #3 ; filter2 >>= 3 - vshr.s8 d29, d29, #3 ; filter1 >>= 3 - - vqadd.s8 d24, d24, d30 ; op0 = clamp(ps0 + filter2) - vqsub.s8 d21, d21, d29 ; oq0 = clamp(qs0 - filter1) - - ; outer tap adjustments: ++filter1 >> 1 - vrshr.s8 d29, d29, #1 - vbic d29, d29, d23 ; filter &= ~hev - - vqadd.s8 d25, d25, d29 ; op1 = clamp(ps1 + filter) - vqsub.s8 d26, d26, d29 ; oq1 = clamp(qs1 - filter) - - ; If mask and flat are 0's for all vectors, then we only need to execute - ; the filter branch for all vectors. - beq filter_branch_only - - ; If mask and flat are mixed then we must perform both branches and - ; combine the data. - veor d24, d24, d22 ; *f_op0 = u^0x80 - veor d21, d21, d22 ; *f_oq0 = u^0x80 - veor d25, d25, d22 ; *f_op1 = u^0x80 - veor d26, d26, d22 ; *f_oq1 = u^0x80 - - ; At this point we have already executed the filter branch. The filter - ; branch does not set op2 or oq2, so use p2 and q2. Execute the power - ; branch and combine the data. - vmov.u8 d23, #2 - vaddl.u8 q14, d6, d7 ; r_op2 = p0 + q0 - vmlal.u8 q14, d3, d27 ; r_op2 += p3 * 3 - vmlal.u8 q14, d4, d23 ; r_op2 += p2 * 2 - - vbif d0, d4, d20 ; op2 |= p2 & ~(flat & mask) - - vaddw.u8 q14, d5 ; r_op2 += p1 - - vbif d1, d25, d20 ; op1 |= f_op1 & ~(flat & mask) - - vqrshrn.u16 d30, q14, #3 ; r_op2 - - vsubw.u8 q14, d3 ; r_op1 = r_op2 - p3 - vsubw.u8 q14, d4 ; r_op1 -= p2 - vaddw.u8 q14, d5 ; r_op1 += p1 - vaddw.u8 q14, d16 ; r_op1 += q1 - - vbif d2, d24, d20 ; op0 |= f_op0 & ~(flat & mask) - - vqrshrn.u16 d31, q14, #3 ; r_op1 - - vsubw.u8 q14, d3 ; r_op0 = r_op1 - p3 - vsubw.u8 q14, d5 ; r_op0 -= p1 - vaddw.u8 q14, d6 ; r_op0 += p0 - vaddw.u8 q14, d17 ; r_op0 += q2 - - vbit d0, d30, d20 ; op2 |= r_op2 & (flat & mask) - - vqrshrn.u16 d23, q14, #3 ; r_op0 - - vsubw.u8 q14, d3 ; r_oq0 = r_op0 - p3 - vsubw.u8 q14, d6 ; r_oq0 -= p0 - vaddw.u8 q14, d7 ; r_oq0 += q0 - - vbit d1, d31, d20 ; op1 |= r_op1 & (flat & mask) - - vaddw.u8 q14, d18 ; oq0 += q3 - - vbit d2, d23, d20 ; op0 |= r_op0 & (flat & mask) - - vqrshrn.u16 d22, q14, #3 ; r_oq0 - - vsubw.u8 q14, d4 ; r_oq1 = r_oq0 - p2 - vsubw.u8 q14, d7 ; r_oq1 -= q0 - vaddw.u8 q14, d16 ; r_oq1 += q1 - - vbif d3, d21, d20 ; oq0 |= f_oq0 & ~(flat & mask) - - vaddw.u8 q14, d18 ; r_oq1 += q3 - - vbif d4, d26, d20 ; oq1 |= f_oq1 & ~(flat & mask) - - vqrshrn.u16 d6, q14, #3 ; r_oq1 - - vsubw.u8 q14, d5 ; r_oq2 = r_oq1 - p1 - vsubw.u8 q14, d16 ; r_oq2 -= q1 - vaddw.u8 q14, d17 ; r_oq2 += q2 - vaddw.u8 q14, d18 ; r_oq2 += q3 - - vbif d5, d17, d20 ; oq2 |= q2 & ~(flat & mask) - - vqrshrn.u16 d7, q14, #3 ; r_oq2 - - vbit d3, d22, d20 ; oq0 |= r_oq0 & (flat & mask) - vbit d4, d6, d20 ; oq1 |= r_oq1 & (flat & mask) - vbit d5, d7, d20 ; oq2 |= r_oq2 & (flat & mask) - - bx lr - -power_branch_only - vmov.u8 d27, #3 - vmov.u8 d21, #2 - vaddl.u8 q14, d6, d7 ; op2 = p0 + q0 - vmlal.u8 q14, d3, d27 ; op2 += p3 * 3 - vmlal.u8 q14, d4, d21 ; op2 += p2 * 2 - vaddw.u8 q14, d5 ; op2 += p1 - vqrshrn.u16 d0, q14, #3 ; op2 - - vsubw.u8 q14, d3 ; op1 = op2 - p3 - vsubw.u8 q14, d4 ; op1 -= p2 - vaddw.u8 q14, d5 ; op1 += p1 - vaddw.u8 q14, d16 ; op1 += q1 - vqrshrn.u16 d1, q14, #3 ; op1 - - vsubw.u8 q14, d3 ; op0 = op1 - p3 - vsubw.u8 q14, d5 ; op0 -= p1 - vaddw.u8 q14, d6 ; op0 += p0 - vaddw.u8 q14, d17 ; op0 += q2 - vqrshrn.u16 d2, q14, #3 ; op0 - - vsubw.u8 q14, d3 ; oq0 = op0 - p3 - vsubw.u8 q14, d6 ; oq0 -= p0 - vaddw.u8 q14, d7 ; oq0 += q0 - vaddw.u8 q14, d18 ; oq0 += q3 - vqrshrn.u16 d3, q14, #3 ; oq0 - - vsubw.u8 q14, d4 ; oq1 = oq0 - p2 - vsubw.u8 q14, d7 ; oq1 -= q0 - vaddw.u8 q14, d16 ; oq1 += q1 - vaddw.u8 q14, d18 ; oq1 += q3 - vqrshrn.u16 d4, q14, #3 ; oq1 - - vsubw.u8 q14, d5 ; oq2 = oq1 - p1 - vsubw.u8 q14, d16 ; oq2 -= q1 - vaddw.u8 q14, d17 ; oq2 += q2 - vaddw.u8 q14, d18 ; oq2 += q3 - vqrshrn.u16 d5, q14, #3 ; oq2 - - bx lr - -filter_branch_only - ; TODO(fgalligan): See if we can rearange registers so we do not need to - ; do the 2 vswp. - vswp d0, d4 ; op2 - vswp d5, d17 ; oq2 - veor d2, d24, d22 ; *op0 = u^0x80 - veor d3, d21, d22 ; *oq0 = u^0x80 - veor d1, d25, d22 ; *op1 = u^0x80 - veor d4, d26, d22 ; *oq1 = u^0x80 - - bx lr - - ENDP ; |vp9_mbloop_filter_neon| - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_8_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_8_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_8_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_8_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,453 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "./vpx_config.h" - -static INLINE void vp9_mbloop_filter_neon( - uint8x8_t dblimit, // mblimit - uint8x8_t dlimit, // limit - uint8x8_t dthresh, // thresh - uint8x8_t d3u8, // p2 - uint8x8_t d4u8, // p2 - uint8x8_t d5u8, // p1 - uint8x8_t d6u8, // p0 - uint8x8_t d7u8, // q0 - uint8x8_t d16u8, // q1 - uint8x8_t d17u8, // q2 - uint8x8_t d18u8, // q3 - uint8x8_t *d0ru8, // p1 - uint8x8_t *d1ru8, // p1 - uint8x8_t *d2ru8, // p0 - uint8x8_t *d3ru8, // q0 - uint8x8_t *d4ru8, // q1 - uint8x8_t *d5ru8) { // q1 - uint32_t flat; - uint8x8_t d0u8, d1u8, d2u8, d19u8, d20u8, d21u8, d22u8, d23u8, d24u8; - uint8x8_t d25u8, d26u8, d27u8, d28u8, d29u8, d30u8, d31u8; - int16x8_t q15s16; - uint16x8_t q10u16, q14u16; - int8x8_t d21s8, d24s8, d25s8, d26s8, d28s8, d29s8, d30s8; - - d19u8 = vabd_u8(d3u8, d4u8); - d20u8 = vabd_u8(d4u8, d5u8); - d21u8 = vabd_u8(d5u8, d6u8); - d22u8 = vabd_u8(d16u8, d7u8); - d23u8 = vabd_u8(d17u8, d16u8); - d24u8 = vabd_u8(d18u8, d17u8); - - d19u8 = vmax_u8(d19u8, d20u8); - d20u8 = vmax_u8(d21u8, d22u8); - - d25u8 = vabd_u8(d6u8, d4u8); - - d23u8 = vmax_u8(d23u8, d24u8); - - d26u8 = vabd_u8(d7u8, d17u8); - - d19u8 = vmax_u8(d19u8, d20u8); - - d24u8 = vabd_u8(d6u8, d7u8); - d27u8 = vabd_u8(d3u8, d6u8); - d28u8 = vabd_u8(d18u8, d7u8); - - d19u8 = vmax_u8(d19u8, d23u8); - - d23u8 = vabd_u8(d5u8, d16u8); - d24u8 = vqadd_u8(d24u8, d24u8); - - - d19u8 = vcge_u8(dlimit, d19u8); - - - d25u8 = vmax_u8(d25u8, d26u8); - d26u8 = vmax_u8(d27u8, d28u8); - - d23u8 = vshr_n_u8(d23u8, 1); - - d25u8 = vmax_u8(d25u8, d26u8); - - d24u8 = vqadd_u8(d24u8, d23u8); - - d20u8 = vmax_u8(d20u8, d25u8); - - d23u8 = vdup_n_u8(1); - d24u8 = vcge_u8(dblimit, d24u8); - - d21u8 = vcgt_u8(d21u8, dthresh); - - d20u8 = vcge_u8(d23u8, d20u8); - - d19u8 = vand_u8(d19u8, d24u8); - - d23u8 = vcgt_u8(d22u8, dthresh); - - d20u8 = vand_u8(d20u8, d19u8); - - d22u8 = vdup_n_u8(0x80); - - d23u8 = vorr_u8(d21u8, d23u8); - - q10u16 = vcombine_u16(vreinterpret_u16_u8(d20u8), - vreinterpret_u16_u8(d21u8)); - - d30u8 = vshrn_n_u16(q10u16, 4); - flat = vget_lane_u32(vreinterpret_u32_u8(d30u8), 0); - - if (flat == 0xffffffff) { // Check for all 1's, power_branch_only - d27u8 = vdup_n_u8(3); - d21u8 = vdup_n_u8(2); - q14u16 = vaddl_u8(d6u8, d7u8); - q14u16 = vmlal_u8(q14u16, d3u8, d27u8); - q14u16 = vmlal_u8(q14u16, d4u8, d21u8); - q14u16 = vaddw_u8(q14u16, d5u8); - *d0ru8 = vqrshrn_n_u16(q14u16, 3); - - q14u16 = vsubw_u8(q14u16, d3u8); - q14u16 = vsubw_u8(q14u16, d4u8); - q14u16 = vaddw_u8(q14u16, d5u8); - q14u16 = vaddw_u8(q14u16, d16u8); - *d1ru8 = vqrshrn_n_u16(q14u16, 3); - - q14u16 = vsubw_u8(q14u16, d3u8); - q14u16 = vsubw_u8(q14u16, d5u8); - q14u16 = vaddw_u8(q14u16, d6u8); - q14u16 = vaddw_u8(q14u16, d17u8); - *d2ru8 = vqrshrn_n_u16(q14u16, 3); - - q14u16 = vsubw_u8(q14u16, d3u8); - q14u16 = vsubw_u8(q14u16, d6u8); - q14u16 = vaddw_u8(q14u16, d7u8); - q14u16 = vaddw_u8(q14u16, d18u8); - *d3ru8 = vqrshrn_n_u16(q14u16, 3); - - q14u16 = vsubw_u8(q14u16, d4u8); - q14u16 = vsubw_u8(q14u16, d7u8); - q14u16 = vaddw_u8(q14u16, d16u8); - q14u16 = vaddw_u8(q14u16, d18u8); - *d4ru8 = vqrshrn_n_u16(q14u16, 3); - - q14u16 = vsubw_u8(q14u16, d5u8); - q14u16 = vsubw_u8(q14u16, d16u8); - q14u16 = vaddw_u8(q14u16, d17u8); - q14u16 = vaddw_u8(q14u16, d18u8); - *d5ru8 = vqrshrn_n_u16(q14u16, 3); - } else { - d21u8 = veor_u8(d7u8, d22u8); - d24u8 = veor_u8(d6u8, d22u8); - d25u8 = veor_u8(d5u8, d22u8); - d26u8 = veor_u8(d16u8, d22u8); - - d27u8 = vdup_n_u8(3); - - d28s8 = vsub_s8(vreinterpret_s8_u8(d21u8), vreinterpret_s8_u8(d24u8)); - d29s8 = vqsub_s8(vreinterpret_s8_u8(d25u8), vreinterpret_s8_u8(d26u8)); - - q15s16 = vmull_s8(d28s8, vreinterpret_s8_u8(d27u8)); - - d29s8 = vand_s8(d29s8, vreinterpret_s8_u8(d23u8)); - - q15s16 = vaddw_s8(q15s16, d29s8); - - d29u8 = vdup_n_u8(4); - - d28s8 = vqmovn_s16(q15s16); - - d28s8 = vand_s8(d28s8, vreinterpret_s8_u8(d19u8)); - - d30s8 = vqadd_s8(d28s8, vreinterpret_s8_u8(d27u8)); - d29s8 = vqadd_s8(d28s8, vreinterpret_s8_u8(d29u8)); - d30s8 = vshr_n_s8(d30s8, 3); - d29s8 = vshr_n_s8(d29s8, 3); - - d24s8 = vqadd_s8(vreinterpret_s8_u8(d24u8), d30s8); - d21s8 = vqsub_s8(vreinterpret_s8_u8(d21u8), d29s8); - - d29s8 = vrshr_n_s8(d29s8, 1); - d29s8 = vbic_s8(d29s8, vreinterpret_s8_u8(d23u8)); - - d25s8 = vqadd_s8(vreinterpret_s8_u8(d25u8), d29s8); - d26s8 = vqsub_s8(vreinterpret_s8_u8(d26u8), d29s8); - - if (flat == 0) { // filter_branch_only - *d0ru8 = d4u8; - *d1ru8 = veor_u8(vreinterpret_u8_s8(d25s8), d22u8); - *d2ru8 = veor_u8(vreinterpret_u8_s8(d24s8), d22u8); - *d3ru8 = veor_u8(vreinterpret_u8_s8(d21s8), d22u8); - *d4ru8 = veor_u8(vreinterpret_u8_s8(d26s8), d22u8); - *d5ru8 = d17u8; - return; - } - - d21u8 = veor_u8(vreinterpret_u8_s8(d21s8), d22u8); - d24u8 = veor_u8(vreinterpret_u8_s8(d24s8), d22u8); - d25u8 = veor_u8(vreinterpret_u8_s8(d25s8), d22u8); - d26u8 = veor_u8(vreinterpret_u8_s8(d26s8), d22u8); - - d23u8 = vdup_n_u8(2); - q14u16 = vaddl_u8(d6u8, d7u8); - q14u16 = vmlal_u8(q14u16, d3u8, d27u8); - q14u16 = vmlal_u8(q14u16, d4u8, d23u8); - - d0u8 = vbsl_u8(d20u8, dblimit, d4u8); - - q14u16 = vaddw_u8(q14u16, d5u8); - - d1u8 = vbsl_u8(d20u8, dlimit, d25u8); - - d30u8 = vqrshrn_n_u16(q14u16, 3); - - q14u16 = vsubw_u8(q14u16, d3u8); - q14u16 = vsubw_u8(q14u16, d4u8); - q14u16 = vaddw_u8(q14u16, d5u8); - q14u16 = vaddw_u8(q14u16, d16u8); - - d2u8 = vbsl_u8(d20u8, dthresh, d24u8); - - d31u8 = vqrshrn_n_u16(q14u16, 3); - - q14u16 = vsubw_u8(q14u16, d3u8); - q14u16 = vsubw_u8(q14u16, d5u8); - q14u16 = vaddw_u8(q14u16, d6u8); - q14u16 = vaddw_u8(q14u16, d17u8); - - *d0ru8 = vbsl_u8(d20u8, d30u8, d0u8); - - d23u8 = vqrshrn_n_u16(q14u16, 3); - - q14u16 = vsubw_u8(q14u16, d3u8); - q14u16 = vsubw_u8(q14u16, d6u8); - q14u16 = vaddw_u8(q14u16, d7u8); - - *d1ru8 = vbsl_u8(d20u8, d31u8, d1u8); - - q14u16 = vaddw_u8(q14u16, d18u8); - - *d2ru8 = vbsl_u8(d20u8, d23u8, d2u8); - - d22u8 = vqrshrn_n_u16(q14u16, 3); - - q14u16 = vsubw_u8(q14u16, d4u8); - q14u16 = vsubw_u8(q14u16, d7u8); - q14u16 = vaddw_u8(q14u16, d16u8); - - d3u8 = vbsl_u8(d20u8, d3u8, d21u8); - - q14u16 = vaddw_u8(q14u16, d18u8); - - d4u8 = vbsl_u8(d20u8, d4u8, d26u8); - - d6u8 = vqrshrn_n_u16(q14u16, 3); - - q14u16 = vsubw_u8(q14u16, d5u8); - q14u16 = vsubw_u8(q14u16, d16u8); - q14u16 = vaddw_u8(q14u16, d17u8); - q14u16 = vaddw_u8(q14u16, d18u8); - - d5u8 = vbsl_u8(d20u8, d5u8, d17u8); - - d7u8 = vqrshrn_n_u16(q14u16, 3); - - *d3ru8 = vbsl_u8(d20u8, d22u8, d3u8); - *d4ru8 = vbsl_u8(d20u8, d6u8, d4u8); - *d5ru8 = vbsl_u8(d20u8, d7u8, d5u8); - } - return; -} - -void vp9_lpf_horizontal_8_neon( - unsigned char *src, - int pitch, - unsigned char *blimit, - unsigned char *limit, - unsigned char *thresh, - int count) { - int i; - uint8_t *s, *psrc; - uint8x8_t dblimit, dlimit, dthresh; - uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8, d6u8, d7u8; - uint8x8_t d16u8, d17u8, d18u8; - - if (count == 0) // end_vp9_mblf_h_edge - return; - - dblimit = vld1_u8(blimit); - dlimit = vld1_u8(limit); - dthresh = vld1_u8(thresh); - - psrc = src - (pitch << 2); - for (i = 0; i < count; i++) { - s = psrc + i * 8; - - d3u8 = vld1_u8(s); - s += pitch; - d4u8 = vld1_u8(s); - s += pitch; - d5u8 = vld1_u8(s); - s += pitch; - d6u8 = vld1_u8(s); - s += pitch; - d7u8 = vld1_u8(s); - s += pitch; - d16u8 = vld1_u8(s); - s += pitch; - d17u8 = vld1_u8(s); - s += pitch; - d18u8 = vld1_u8(s); - - vp9_mbloop_filter_neon(dblimit, dlimit, dthresh, - d3u8, d4u8, d5u8, d6u8, d7u8, d16u8, d17u8, d18u8, - &d0u8, &d1u8, &d2u8, &d3u8, &d4u8, &d5u8); - - s -= (pitch * 6); - vst1_u8(s, d0u8); - s += pitch; - vst1_u8(s, d1u8); - s += pitch; - vst1_u8(s, d2u8); - s += pitch; - vst1_u8(s, d3u8); - s += pitch; - vst1_u8(s, d4u8); - s += pitch; - vst1_u8(s, d5u8); - } - return; -} - -void vp9_lpf_vertical_8_neon( - unsigned char *src, - int pitch, - unsigned char *blimit, - unsigned char *limit, - unsigned char *thresh, - int count) { - int i; - uint8_t *s; - uint8x8_t dblimit, dlimit, dthresh; - uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8, d6u8, d7u8; - uint8x8_t d16u8, d17u8, d18u8; - uint32x2x2_t d2tmp0, d2tmp1, d2tmp2, d2tmp3; - uint16x4x2_t d2tmp4, d2tmp5, d2tmp6, d2tmp7; - uint8x8x2_t d2tmp8, d2tmp9, d2tmp10, d2tmp11; - uint8x8x4_t d4Result; - uint8x8x2_t d2Result; - - if (count == 0) - return; - - dblimit = vld1_u8(blimit); - dlimit = vld1_u8(limit); - dthresh = vld1_u8(thresh); - - for (i = 0; i < count; i++) { - s = src + (i * (pitch << 3)) - 4; - - d3u8 = vld1_u8(s); - s += pitch; - d4u8 = vld1_u8(s); - s += pitch; - d5u8 = vld1_u8(s); - s += pitch; - d6u8 = vld1_u8(s); - s += pitch; - d7u8 = vld1_u8(s); - s += pitch; - d16u8 = vld1_u8(s); - s += pitch; - d17u8 = vld1_u8(s); - s += pitch; - d18u8 = vld1_u8(s); - - d2tmp0 = vtrn_u32(vreinterpret_u32_u8(d3u8), - vreinterpret_u32_u8(d7u8)); - d2tmp1 = vtrn_u32(vreinterpret_u32_u8(d4u8), - vreinterpret_u32_u8(d16u8)); - d2tmp2 = vtrn_u32(vreinterpret_u32_u8(d5u8), - vreinterpret_u32_u8(d17u8)); - d2tmp3 = vtrn_u32(vreinterpret_u32_u8(d6u8), - vreinterpret_u32_u8(d18u8)); - - d2tmp4 = vtrn_u16(vreinterpret_u16_u32(d2tmp0.val[0]), - vreinterpret_u16_u32(d2tmp2.val[0])); - d2tmp5 = vtrn_u16(vreinterpret_u16_u32(d2tmp1.val[0]), - vreinterpret_u16_u32(d2tmp3.val[0])); - d2tmp6 = vtrn_u16(vreinterpret_u16_u32(d2tmp0.val[1]), - vreinterpret_u16_u32(d2tmp2.val[1])); - d2tmp7 = vtrn_u16(vreinterpret_u16_u32(d2tmp1.val[1]), - vreinterpret_u16_u32(d2tmp3.val[1])); - - d2tmp8 = vtrn_u8(vreinterpret_u8_u16(d2tmp4.val[0]), - vreinterpret_u8_u16(d2tmp5.val[0])); - d2tmp9 = vtrn_u8(vreinterpret_u8_u16(d2tmp4.val[1]), - vreinterpret_u8_u16(d2tmp5.val[1])); - d2tmp10 = vtrn_u8(vreinterpret_u8_u16(d2tmp6.val[0]), - vreinterpret_u8_u16(d2tmp7.val[0])); - d2tmp11 = vtrn_u8(vreinterpret_u8_u16(d2tmp6.val[1]), - vreinterpret_u8_u16(d2tmp7.val[1])); - - d3u8 = d2tmp8.val[0]; - d4u8 = d2tmp8.val[1]; - d5u8 = d2tmp9.val[0]; - d6u8 = d2tmp9.val[1]; - d7u8 = d2tmp10.val[0]; - d16u8 = d2tmp10.val[1]; - d17u8 = d2tmp11.val[0]; - d18u8 = d2tmp11.val[1]; - - vp9_mbloop_filter_neon(dblimit, dlimit, dthresh, - d3u8, d4u8, d5u8, d6u8, d7u8, d16u8, d17u8, d18u8, - &d0u8, &d1u8, &d2u8, &d3u8, &d4u8, &d5u8); - - d4Result.val[0] = d0u8; - d4Result.val[1] = d1u8; - d4Result.val[2] = d2u8; - d4Result.val[3] = d3u8; - - d2Result.val[0] = d4u8; - d2Result.val[1] = d5u8; - - s = src - 3; - vst4_lane_u8(s, d4Result, 0); - s += pitch; - vst4_lane_u8(s, d4Result, 1); - s += pitch; - vst4_lane_u8(s, d4Result, 2); - s += pitch; - vst4_lane_u8(s, d4Result, 3); - s += pitch; - vst4_lane_u8(s, d4Result, 4); - s += pitch; - vst4_lane_u8(s, d4Result, 5); - s += pitch; - vst4_lane_u8(s, d4Result, 6); - s += pitch; - vst4_lane_u8(s, d4Result, 7); - - s = src + 1; - vst2_lane_u8(s, d2Result, 0); - s += pitch; - vst2_lane_u8(s, d2Result, 1); - s += pitch; - vst2_lane_u8(s, d2Result, 2); - s += pitch; - vst2_lane_u8(s, d2Result, 3); - s += pitch; - vst2_lane_u8(s, d2Result, 4); - s += pitch; - vst2_lane_u8(s, d2Result, 5); - s += pitch; - vst2_lane_u8(s, d2Result, 6); - s += pitch; - vst2_lane_u8(s, d2Result, 7); - } - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_loopfilter_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "./vp9_rtcd.h" -#include "./vpx_config.h" -#include "vpx/vpx_integer.h" - -void vp9_lpf_vertical_4_dual_neon(uint8_t *s, int p, - const uint8_t *blimit0, - const uint8_t *limit0, - const uint8_t *thresh0, - const uint8_t *blimit1, - const uint8_t *limit1, - const uint8_t *thresh1) { - vp9_lpf_vertical_4_neon(s, p, blimit0, limit0, thresh0, 1); - vp9_lpf_vertical_4_neon(s + 8 * p, p, blimit1, limit1, thresh1, 1); -} - -#if HAVE_NEON_ASM -void vp9_lpf_horizontal_8_dual_neon(uint8_t *s, int p /* pitch */, - const uint8_t *blimit0, - const uint8_t *limit0, - const uint8_t *thresh0, - const uint8_t *blimit1, - const uint8_t *limit1, - const uint8_t *thresh1) { - vp9_lpf_horizontal_8_neon(s, p, blimit0, limit0, thresh0, 1); - vp9_lpf_horizontal_8_neon(s + 8, p, blimit1, limit1, thresh1, 1); -} - -void vp9_lpf_vertical_8_dual_neon(uint8_t *s, int p, - const uint8_t *blimit0, - const uint8_t *limit0, - const uint8_t *thresh0, - const uint8_t *blimit1, - const uint8_t *limit1, - const uint8_t *thresh1) { - vp9_lpf_vertical_8_neon(s, p, blimit0, limit0, thresh0, 1); - vp9_lpf_vertical_8_neon(s + 8 * p, p, blimit1, limit1, thresh1, 1); -} - -void vp9_lpf_vertical_16_dual_neon(uint8_t *s, int p, - const uint8_t *blimit, - const uint8_t *limit, - const uint8_t *thresh) { - vp9_lpf_vertical_16_neon(s, p, blimit, limit, thresh); - vp9_lpf_vertical_16_neon(s + 8 * p, p, blimit, limit, thresh); -} -#endif // HAVE_NEON_ASM diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_mb_lpf_neon.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_mb_lpf_neon.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_mb_lpf_neon.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_mb_lpf_neon.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,606 +0,0 @@ -; -; Copyright (c) 2013 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - EXPORT |vp9_lpf_horizontal_16_neon| - EXPORT |vp9_lpf_vertical_16_neon| - ARM - - AREA ||.text||, CODE, READONLY, ALIGN=2 - -; void vp9_lpf_horizontal_16_neon(uint8_t *s, int p, -; const uint8_t *blimit, -; const uint8_t *limit, -; const uint8_t *thresh -; int count) -; r0 uint8_t *s, -; r1 int p, /* pitch */ -; r2 const uint8_t *blimit, -; r3 const uint8_t *limit, -; sp const uint8_t *thresh, -|vp9_lpf_horizontal_16_neon| PROC - push {r4-r8, lr} - vpush {d8-d15} - ldr r4, [sp, #88] ; load thresh - ldr r12, [sp, #92] ; load count - -h_count - vld1.8 {d16[]}, [r2] ; load *blimit - vld1.8 {d17[]}, [r3] ; load *limit - vld1.8 {d18[]}, [r4] ; load *thresh - - sub r8, r0, r1, lsl #3 ; move src pointer down by 8 lines - - vld1.u8 {d0}, [r8@64], r1 ; p7 - vld1.u8 {d1}, [r8@64], r1 ; p6 - vld1.u8 {d2}, [r8@64], r1 ; p5 - vld1.u8 {d3}, [r8@64], r1 ; p4 - vld1.u8 {d4}, [r8@64], r1 ; p3 - vld1.u8 {d5}, [r8@64], r1 ; p2 - vld1.u8 {d6}, [r8@64], r1 ; p1 - vld1.u8 {d7}, [r8@64], r1 ; p0 - vld1.u8 {d8}, [r8@64], r1 ; q0 - vld1.u8 {d9}, [r8@64], r1 ; q1 - vld1.u8 {d10}, [r8@64], r1 ; q2 - vld1.u8 {d11}, [r8@64], r1 ; q3 - vld1.u8 {d12}, [r8@64], r1 ; q4 - vld1.u8 {d13}, [r8@64], r1 ; q5 - vld1.u8 {d14}, [r8@64], r1 ; q6 - vld1.u8 {d15}, [r8@64], r1 ; q7 - - bl vp9_wide_mbfilter_neon - - tst r7, #1 - beq h_mbfilter - - ; flat && mask were not set for any of the channels. Just store the values - ; from filter. - sub r8, r0, r1, lsl #1 - - vst1.u8 {d25}, [r8@64], r1 ; store op1 - vst1.u8 {d24}, [r8@64], r1 ; store op0 - vst1.u8 {d23}, [r8@64], r1 ; store oq0 - vst1.u8 {d26}, [r8@64], r1 ; store oq1 - - b h_next - -h_mbfilter - tst r7, #2 - beq h_wide_mbfilter - - ; flat2 was not set for any of the channels. Just store the values from - ; mbfilter. - sub r8, r0, r1, lsl #1 - sub r8, r8, r1 - - vst1.u8 {d18}, [r8@64], r1 ; store op2 - vst1.u8 {d19}, [r8@64], r1 ; store op1 - vst1.u8 {d20}, [r8@64], r1 ; store op0 - vst1.u8 {d21}, [r8@64], r1 ; store oq0 - vst1.u8 {d22}, [r8@64], r1 ; store oq1 - vst1.u8 {d23}, [r8@64], r1 ; store oq2 - - b h_next - -h_wide_mbfilter - sub r8, r0, r1, lsl #3 - add r8, r8, r1 - - vst1.u8 {d16}, [r8@64], r1 ; store op6 - vst1.u8 {d24}, [r8@64], r1 ; store op5 - vst1.u8 {d25}, [r8@64], r1 ; store op4 - vst1.u8 {d26}, [r8@64], r1 ; store op3 - vst1.u8 {d27}, [r8@64], r1 ; store op2 - vst1.u8 {d18}, [r8@64], r1 ; store op1 - vst1.u8 {d19}, [r8@64], r1 ; store op0 - vst1.u8 {d20}, [r8@64], r1 ; store oq0 - vst1.u8 {d21}, [r8@64], r1 ; store oq1 - vst1.u8 {d22}, [r8@64], r1 ; store oq2 - vst1.u8 {d23}, [r8@64], r1 ; store oq3 - vst1.u8 {d1}, [r8@64], r1 ; store oq4 - vst1.u8 {d2}, [r8@64], r1 ; store oq5 - vst1.u8 {d3}, [r8@64], r1 ; store oq6 - -h_next - add r0, r0, #8 - subs r12, r12, #1 - bne h_count - - vpop {d8-d15} - pop {r4-r8, pc} - - ENDP ; |vp9_lpf_horizontal_16_neon| - -; void vp9_lpf_vertical_16_neon(uint8_t *s, int p, -; const uint8_t *blimit, -; const uint8_t *limit, -; const uint8_t *thresh) -; r0 uint8_t *s, -; r1 int p, /* pitch */ -; r2 const uint8_t *blimit, -; r3 const uint8_t *limit, -; sp const uint8_t *thresh, -|vp9_lpf_vertical_16_neon| PROC - push {r4-r8, lr} - vpush {d8-d15} - ldr r4, [sp, #88] ; load thresh - - vld1.8 {d16[]}, [r2] ; load *blimit - vld1.8 {d17[]}, [r3] ; load *limit - vld1.8 {d18[]}, [r4] ; load *thresh - - sub r8, r0, #8 - - vld1.8 {d0}, [r8@64], r1 - vld1.8 {d8}, [r0@64], r1 - vld1.8 {d1}, [r8@64], r1 - vld1.8 {d9}, [r0@64], r1 - vld1.8 {d2}, [r8@64], r1 - vld1.8 {d10}, [r0@64], r1 - vld1.8 {d3}, [r8@64], r1 - vld1.8 {d11}, [r0@64], r1 - vld1.8 {d4}, [r8@64], r1 - vld1.8 {d12}, [r0@64], r1 - vld1.8 {d5}, [r8@64], r1 - vld1.8 {d13}, [r0@64], r1 - vld1.8 {d6}, [r8@64], r1 - vld1.8 {d14}, [r0@64], r1 - vld1.8 {d7}, [r8@64], r1 - vld1.8 {d15}, [r0@64], r1 - - sub r0, r0, r1, lsl #3 - - vtrn.32 q0, q2 - vtrn.32 q1, q3 - vtrn.32 q4, q6 - vtrn.32 q5, q7 - - vtrn.16 q0, q1 - vtrn.16 q2, q3 - vtrn.16 q4, q5 - vtrn.16 q6, q7 - - vtrn.8 d0, d1 - vtrn.8 d2, d3 - vtrn.8 d4, d5 - vtrn.8 d6, d7 - - vtrn.8 d8, d9 - vtrn.8 d10, d11 - vtrn.8 d12, d13 - vtrn.8 d14, d15 - - bl vp9_wide_mbfilter_neon - - tst r7, #1 - beq v_mbfilter - - ; flat && mask were not set for any of the channels. Just store the values - ; from filter. - sub r8, r0, #2 - - vswp d23, d25 - - vst4.8 {d23[0], d24[0], d25[0], d26[0]}, [r8], r1 - vst4.8 {d23[1], d24[1], d25[1], d26[1]}, [r8], r1 - vst4.8 {d23[2], d24[2], d25[2], d26[2]}, [r8], r1 - vst4.8 {d23[3], d24[3], d25[3], d26[3]}, [r8], r1 - vst4.8 {d23[4], d24[4], d25[4], d26[4]}, [r8], r1 - vst4.8 {d23[5], d24[5], d25[5], d26[5]}, [r8], r1 - vst4.8 {d23[6], d24[6], d25[6], d26[6]}, [r8], r1 - vst4.8 {d23[7], d24[7], d25[7], d26[7]}, [r8], r1 - - b v_end - -v_mbfilter - tst r7, #2 - beq v_wide_mbfilter - - ; flat2 was not set for any of the channels. Just store the values from - ; mbfilter. - sub r8, r0, #3 - - vst3.8 {d18[0], d19[0], d20[0]}, [r8], r1 - vst3.8 {d21[0], d22[0], d23[0]}, [r0], r1 - vst3.8 {d18[1], d19[1], d20[1]}, [r8], r1 - vst3.8 {d21[1], d22[1], d23[1]}, [r0], r1 - vst3.8 {d18[2], d19[2], d20[2]}, [r8], r1 - vst3.8 {d21[2], d22[2], d23[2]}, [r0], r1 - vst3.8 {d18[3], d19[3], d20[3]}, [r8], r1 - vst3.8 {d21[3], d22[3], d23[3]}, [r0], r1 - vst3.8 {d18[4], d19[4], d20[4]}, [r8], r1 - vst3.8 {d21[4], d22[4], d23[4]}, [r0], r1 - vst3.8 {d18[5], d19[5], d20[5]}, [r8], r1 - vst3.8 {d21[5], d22[5], d23[5]}, [r0], r1 - vst3.8 {d18[6], d19[6], d20[6]}, [r8], r1 - vst3.8 {d21[6], d22[6], d23[6]}, [r0], r1 - vst3.8 {d18[7], d19[7], d20[7]}, [r8], r1 - vst3.8 {d21[7], d22[7], d23[7]}, [r0], r1 - - b v_end - -v_wide_mbfilter - sub r8, r0, #8 - - vtrn.32 d0, d26 - vtrn.32 d16, d27 - vtrn.32 d24, d18 - vtrn.32 d25, d19 - - vtrn.16 d0, d24 - vtrn.16 d16, d25 - vtrn.16 d26, d18 - vtrn.16 d27, d19 - - vtrn.8 d0, d16 - vtrn.8 d24, d25 - vtrn.8 d26, d27 - vtrn.8 d18, d19 - - vtrn.32 d20, d1 - vtrn.32 d21, d2 - vtrn.32 d22, d3 - vtrn.32 d23, d15 - - vtrn.16 d20, d22 - vtrn.16 d21, d23 - vtrn.16 d1, d3 - vtrn.16 d2, d15 - - vtrn.8 d20, d21 - vtrn.8 d22, d23 - vtrn.8 d1, d2 - vtrn.8 d3, d15 - - vst1.8 {d0}, [r8@64], r1 - vst1.8 {d20}, [r0@64], r1 - vst1.8 {d16}, [r8@64], r1 - vst1.8 {d21}, [r0@64], r1 - vst1.8 {d24}, [r8@64], r1 - vst1.8 {d22}, [r0@64], r1 - vst1.8 {d25}, [r8@64], r1 - vst1.8 {d23}, [r0@64], r1 - vst1.8 {d26}, [r8@64], r1 - vst1.8 {d1}, [r0@64], r1 - vst1.8 {d27}, [r8@64], r1 - vst1.8 {d2}, [r0@64], r1 - vst1.8 {d18}, [r8@64], r1 - vst1.8 {d3}, [r0@64], r1 - vst1.8 {d19}, [r8@64], r1 - vst1.8 {d15}, [r0@64], r1 - -v_end - vpop {d8-d15} - pop {r4-r8, pc} - - ENDP ; |vp9_lpf_vertical_16_neon| - -; void vp9_wide_mbfilter_neon(); -; This is a helper function for the loopfilters. The invidual functions do the -; necessary load, transpose (if necessary) and store. -; -; r0-r3 PRESERVE -; d16 blimit -; d17 limit -; d18 thresh -; d0 p7 -; d1 p6 -; d2 p5 -; d3 p4 -; d4 p3 -; d5 p2 -; d6 p1 -; d7 p0 -; d8 q0 -; d9 q1 -; d10 q2 -; d11 q3 -; d12 q4 -; d13 q5 -; d14 q6 -; d15 q7 -|vp9_wide_mbfilter_neon| PROC - mov r7, #0 - - ; filter_mask - vabd.u8 d19, d4, d5 ; abs(p3 - p2) - vabd.u8 d20, d5, d6 ; abs(p2 - p1) - vabd.u8 d21, d6, d7 ; abs(p1 - p0) - vabd.u8 d22, d9, d8 ; abs(q1 - q0) - vabd.u8 d23, d10, d9 ; abs(q2 - q1) - vabd.u8 d24, d11, d10 ; abs(q3 - q2) - - ; only compare the largest value to limit - vmax.u8 d19, d19, d20 ; max(abs(p3 - p2), abs(p2 - p1)) - vmax.u8 d20, d21, d22 ; max(abs(p1 - p0), abs(q1 - q0)) - vmax.u8 d23, d23, d24 ; max(abs(q2 - q1), abs(q3 - q2)) - vmax.u8 d19, d19, d20 - - vabd.u8 d24, d7, d8 ; abs(p0 - q0) - - vmax.u8 d19, d19, d23 - - vabd.u8 d23, d6, d9 ; a = abs(p1 - q1) - vqadd.u8 d24, d24, d24 ; b = abs(p0 - q0) * 2 - - ; abs () > limit - vcge.u8 d19, d17, d19 - - ; flatmask4 - vabd.u8 d25, d7, d5 ; abs(p0 - p2) - vabd.u8 d26, d8, d10 ; abs(q0 - q2) - vabd.u8 d27, d4, d7 ; abs(p3 - p0) - vabd.u8 d28, d11, d8 ; abs(q3 - q0) - - ; only compare the largest value to thresh - vmax.u8 d25, d25, d26 ; max(abs(p0 - p2), abs(q0 - q2)) - vmax.u8 d26, d27, d28 ; max(abs(p3 - p0), abs(q3 - q0)) - vmax.u8 d25, d25, d26 - vmax.u8 d20, d20, d25 - - vshr.u8 d23, d23, #1 ; a = a / 2 - vqadd.u8 d24, d24, d23 ; a = b + a - - vmov.u8 d30, #1 - vcge.u8 d24, d16, d24 ; (a > blimit * 2 + limit) * -1 - - vcge.u8 d20, d30, d20 ; flat - - vand d19, d19, d24 ; mask - - ; hevmask - vcgt.u8 d21, d21, d18 ; (abs(p1 - p0) > thresh)*-1 - vcgt.u8 d22, d22, d18 ; (abs(q1 - q0) > thresh)*-1 - vorr d21, d21, d22 ; hev - - vand d16, d20, d19 ; flat && mask - vmov r5, r6, d16 - - ; flatmask5(1, p7, p6, p5, p4, p0, q0, q4, q5, q6, q7) - vabd.u8 d22, d3, d7 ; abs(p4 - p0) - vabd.u8 d23, d12, d8 ; abs(q4 - q0) - vabd.u8 d24, d7, d2 ; abs(p0 - p5) - vabd.u8 d25, d8, d13 ; abs(q0 - q5) - vabd.u8 d26, d1, d7 ; abs(p6 - p0) - vabd.u8 d27, d14, d8 ; abs(q6 - q0) - vabd.u8 d28, d0, d7 ; abs(p7 - p0) - vabd.u8 d29, d15, d8 ; abs(q7 - q0) - - ; only compare the largest value to thresh - vmax.u8 d22, d22, d23 ; max(abs(p4 - p0), abs(q4 - q0)) - vmax.u8 d23, d24, d25 ; max(abs(p0 - p5), abs(q0 - q5)) - vmax.u8 d24, d26, d27 ; max(abs(p6 - p0), abs(q6 - q0)) - vmax.u8 d25, d28, d29 ; max(abs(p7 - p0), abs(q7 - q0)) - - vmax.u8 d26, d22, d23 - vmax.u8 d27, d24, d25 - vmax.u8 d23, d26, d27 - - vcge.u8 d18, d30, d23 ; flat2 - - vmov.u8 d22, #0x80 - - orrs r5, r5, r6 ; Check for 0 - orreq r7, r7, #1 ; Only do filter branch - - vand d17, d18, d16 ; flat2 && flat && mask - vmov r5, r6, d17 - - ; mbfilter() function - - ; filter() function - ; convert to signed - veor d23, d8, d22 ; qs0 - veor d24, d7, d22 ; ps0 - veor d25, d6, d22 ; ps1 - veor d26, d9, d22 ; qs1 - - vmov.u8 d27, #3 - - vsub.s8 d28, d23, d24 ; ( qs0 - ps0) - vqsub.s8 d29, d25, d26 ; filter = clamp(ps1-qs1) - vmull.s8 q15, d28, d27 ; 3 * ( qs0 - ps0) - vand d29, d29, d21 ; filter &= hev - vaddw.s8 q15, q15, d29 ; filter + 3 * (qs0 - ps0) - vmov.u8 d29, #4 - - ; filter = clamp(filter + 3 * ( qs0 - ps0)) - vqmovn.s16 d28, q15 - - vand d28, d28, d19 ; filter &= mask - - vqadd.s8 d30, d28, d27 ; filter2 = clamp(filter+3) - vqadd.s8 d29, d28, d29 ; filter1 = clamp(filter+4) - vshr.s8 d30, d30, #3 ; filter2 >>= 3 - vshr.s8 d29, d29, #3 ; filter1 >>= 3 - - - vqadd.s8 d24, d24, d30 ; op0 = clamp(ps0 + filter2) - vqsub.s8 d23, d23, d29 ; oq0 = clamp(qs0 - filter1) - - ; outer tap adjustments: ++filter1 >> 1 - vrshr.s8 d29, d29, #1 - vbic d29, d29, d21 ; filter &= ~hev - - vqadd.s8 d25, d25, d29 ; op1 = clamp(ps1 + filter) - vqsub.s8 d26, d26, d29 ; oq1 = clamp(qs1 - filter) - - veor d24, d24, d22 ; *f_op0 = u^0x80 - veor d23, d23, d22 ; *f_oq0 = u^0x80 - veor d25, d25, d22 ; *f_op1 = u^0x80 - veor d26, d26, d22 ; *f_oq1 = u^0x80 - - tst r7, #1 - bxne lr - - orrs r5, r5, r6 ; Check for 0 - orreq r7, r7, #2 ; Only do mbfilter branch - - ; mbfilter flat && mask branch - ; TODO(fgalligan): Can I decrease the cycles shifting to consective d's - ; and using vibt on the q's? - vmov.u8 d29, #2 - vaddl.u8 q15, d7, d8 ; op2 = p0 + q0 - vmlal.u8 q15, d4, d27 ; op2 = p0 + q0 + p3 * 3 - vmlal.u8 q15, d5, d29 ; op2 = p0 + q0 + p3 * 3 + p2 * 2 - vaddl.u8 q10, d4, d5 - vaddw.u8 q15, d6 ; op2=p1 + p0 + q0 + p3 * 3 + p2 *2 - vaddl.u8 q14, d6, d9 - vqrshrn.u16 d18, q15, #3 ; r_op2 - - vsub.i16 q15, q10 - vaddl.u8 q10, d4, d6 - vadd.i16 q15, q14 - vaddl.u8 q14, d7, d10 - vqrshrn.u16 d19, q15, #3 ; r_op1 - - vsub.i16 q15, q10 - vadd.i16 q15, q14 - vaddl.u8 q14, d8, d11 - vqrshrn.u16 d20, q15, #3 ; r_op0 - - vsubw.u8 q15, d4 ; oq0 = op0 - p3 - vsubw.u8 q15, d7 ; oq0 -= p0 - vadd.i16 q15, q14 - vaddl.u8 q14, d9, d11 - vqrshrn.u16 d21, q15, #3 ; r_oq0 - - vsubw.u8 q15, d5 ; oq1 = oq0 - p2 - vsubw.u8 q15, d8 ; oq1 -= q0 - vadd.i16 q15, q14 - vaddl.u8 q14, d10, d11 - vqrshrn.u16 d22, q15, #3 ; r_oq1 - - vsubw.u8 q15, d6 ; oq2 = oq0 - p1 - vsubw.u8 q15, d9 ; oq2 -= q1 - vadd.i16 q15, q14 - vqrshrn.u16 d27, q15, #3 ; r_oq2 - - ; Filter does not set op2 or oq2, so use p2 and q2. - vbif d18, d5, d16 ; t_op2 |= p2 & ~(flat & mask) - vbif d19, d25, d16 ; t_op1 |= f_op1 & ~(flat & mask) - vbif d20, d24, d16 ; t_op0 |= f_op0 & ~(flat & mask) - vbif d21, d23, d16 ; t_oq0 |= f_oq0 & ~(flat & mask) - vbif d22, d26, d16 ; t_oq1 |= f_oq1 & ~(flat & mask) - - vbit d23, d27, d16 ; t_oq2 |= r_oq2 & (flat & mask) - vbif d23, d10, d16 ; t_oq2 |= q2 & ~(flat & mask) - - tst r7, #2 - bxne lr - - ; wide_mbfilter flat2 && flat && mask branch - vmov.u8 d16, #7 - vaddl.u8 q15, d7, d8 ; op6 = p0 + q0 - vaddl.u8 q12, d2, d3 - vaddl.u8 q13, d4, d5 - vaddl.u8 q14, d1, d6 - vmlal.u8 q15, d0, d16 ; op6 += p7 * 3 - vadd.i16 q12, q13 - vadd.i16 q15, q14 - vaddl.u8 q14, d2, d9 - vadd.i16 q15, q12 - vaddl.u8 q12, d0, d1 - vaddw.u8 q15, d1 - vaddl.u8 q13, d0, d2 - vadd.i16 q14, q15, q14 - vqrshrn.u16 d16, q15, #4 ; w_op6 - - vsub.i16 q15, q14, q12 - vaddl.u8 q14, d3, d10 - vqrshrn.u16 d24, q15, #4 ; w_op5 - - vsub.i16 q15, q13 - vaddl.u8 q13, d0, d3 - vadd.i16 q15, q14 - vaddl.u8 q14, d4, d11 - vqrshrn.u16 d25, q15, #4 ; w_op4 - - vadd.i16 q15, q14 - vaddl.u8 q14, d0, d4 - vsub.i16 q15, q13 - vsub.i16 q14, q15, q14 - vqrshrn.u16 d26, q15, #4 ; w_op3 - - vaddw.u8 q15, q14, d5 ; op2 += p2 - vaddl.u8 q14, d0, d5 - vaddw.u8 q15, d12 ; op2 += q4 - vbif d26, d4, d17 ; op3 |= p3 & ~(f2 & f & m) - vqrshrn.u16 d27, q15, #4 ; w_op2 - - vsub.i16 q15, q14 - vaddl.u8 q14, d0, d6 - vaddw.u8 q15, d6 ; op1 += p1 - vaddw.u8 q15, d13 ; op1 += q5 - vbif d27, d18, d17 ; op2 |= t_op2 & ~(f2 & f & m) - vqrshrn.u16 d18, q15, #4 ; w_op1 - - vsub.i16 q15, q14 - vaddl.u8 q14, d0, d7 - vaddw.u8 q15, d7 ; op0 += p0 - vaddw.u8 q15, d14 ; op0 += q6 - vbif d18, d19, d17 ; op1 |= t_op1 & ~(f2 & f & m) - vqrshrn.u16 d19, q15, #4 ; w_op0 - - vsub.i16 q15, q14 - vaddl.u8 q14, d1, d8 - vaddw.u8 q15, d8 ; oq0 += q0 - vaddw.u8 q15, d15 ; oq0 += q7 - vbif d19, d20, d17 ; op0 |= t_op0 & ~(f2 & f & m) - vqrshrn.u16 d20, q15, #4 ; w_oq0 - - vsub.i16 q15, q14 - vaddl.u8 q14, d2, d9 - vaddw.u8 q15, d9 ; oq1 += q1 - vaddl.u8 q4, d10, d15 - vaddw.u8 q15, d15 ; oq1 += q7 - vbif d20, d21, d17 ; oq0 |= t_oq0 & ~(f2 & f & m) - vqrshrn.u16 d21, q15, #4 ; w_oq1 - - vsub.i16 q15, q14 - vaddl.u8 q14, d3, d10 - vadd.i16 q15, q4 - vaddl.u8 q4, d11, d15 - vbif d21, d22, d17 ; oq1 |= t_oq1 & ~(f2 & f & m) - vqrshrn.u16 d22, q15, #4 ; w_oq2 - - vsub.i16 q15, q14 - vaddl.u8 q14, d4, d11 - vadd.i16 q15, q4 - vaddl.u8 q4, d12, d15 - vbif d22, d23, d17 ; oq2 |= t_oq2 & ~(f2 & f & m) - vqrshrn.u16 d23, q15, #4 ; w_oq3 - - vsub.i16 q15, q14 - vaddl.u8 q14, d5, d12 - vadd.i16 q15, q4 - vaddl.u8 q4, d13, d15 - vbif d16, d1, d17 ; op6 |= p6 & ~(f2 & f & m) - vqrshrn.u16 d1, q15, #4 ; w_oq4 - - vsub.i16 q15, q14 - vaddl.u8 q14, d6, d13 - vadd.i16 q15, q4 - vaddl.u8 q4, d14, d15 - vbif d24, d2, d17 ; op5 |= p5 & ~(f2 & f & m) - vqrshrn.u16 d2, q15, #4 ; w_oq5 - - vsub.i16 q15, q14 - vbif d25, d3, d17 ; op4 |= p4 & ~(f2 & f & m) - vadd.i16 q15, q4 - vbif d23, d11, d17 ; oq3 |= q3 & ~(f2 & f & m) - vqrshrn.u16 d3, q15, #4 ; w_oq6 - vbif d1, d12, d17 ; oq4 |= q4 & ~(f2 & f & m) - vbif d2, d13, d17 ; oq5 |= q5 & ~(f2 & f & m) - vbif d3, d14, d17 ; oq6 |= q6 & ~(f2 & f & m) - - bx lr - ENDP ; |vp9_wide_mbfilter_neon| - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_reconintra_neon_asm.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_reconintra_neon_asm.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_reconintra_neon_asm.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_reconintra_neon_asm.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,634 +0,0 @@ -; -; Copyright (c) 2014 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - EXPORT |vp9_v_predictor_4x4_neon| - EXPORT |vp9_v_predictor_8x8_neon| - EXPORT |vp9_v_predictor_16x16_neon| - EXPORT |vp9_v_predictor_32x32_neon| - EXPORT |vp9_h_predictor_4x4_neon| - EXPORT |vp9_h_predictor_8x8_neon| - EXPORT |vp9_h_predictor_16x16_neon| - EXPORT |vp9_h_predictor_32x32_neon| - EXPORT |vp9_tm_predictor_4x4_neon| - EXPORT |vp9_tm_predictor_8x8_neon| - EXPORT |vp9_tm_predictor_16x16_neon| - EXPORT |vp9_tm_predictor_32x32_neon| - ARM - REQUIRE8 - PRESERVE8 - - AREA ||.text||, CODE, READONLY, ALIGN=2 - -;void vp9_v_predictor_4x4_neon(uint8_t *dst, ptrdiff_t y_stride, -; const uint8_t *above, -; const uint8_t *left) -; r0 uint8_t *dst -; r1 ptrdiff_t y_stride -; r2 const uint8_t *above -; r3 const uint8_t *left - -|vp9_v_predictor_4x4_neon| PROC - vld1.32 {d0[0]}, [r2] - vst1.32 {d0[0]}, [r0], r1 - vst1.32 {d0[0]}, [r0], r1 - vst1.32 {d0[0]}, [r0], r1 - vst1.32 {d0[0]}, [r0], r1 - bx lr - ENDP ; |vp9_v_predictor_4x4_neon| - -;void vp9_v_predictor_8x8_neon(uint8_t *dst, ptrdiff_t y_stride, -; const uint8_t *above, -; const uint8_t *left) -; r0 uint8_t *dst -; r1 ptrdiff_t y_stride -; r2 const uint8_t *above -; r3 const uint8_t *left - -|vp9_v_predictor_8x8_neon| PROC - vld1.8 {d0}, [r2] - vst1.8 {d0}, [r0], r1 - vst1.8 {d0}, [r0], r1 - vst1.8 {d0}, [r0], r1 - vst1.8 {d0}, [r0], r1 - vst1.8 {d0}, [r0], r1 - vst1.8 {d0}, [r0], r1 - vst1.8 {d0}, [r0], r1 - vst1.8 {d0}, [r0], r1 - bx lr - ENDP ; |vp9_v_predictor_8x8_neon| - -;void vp9_v_predictor_16x16_neon(uint8_t *dst, ptrdiff_t y_stride, -; const uint8_t *above, -; const uint8_t *left) -; r0 uint8_t *dst -; r1 ptrdiff_t y_stride -; r2 const uint8_t *above -; r3 const uint8_t *left - -|vp9_v_predictor_16x16_neon| PROC - vld1.8 {q0}, [r2] - vst1.8 {q0}, [r0], r1 - vst1.8 {q0}, [r0], r1 - vst1.8 {q0}, [r0], r1 - vst1.8 {q0}, [r0], r1 - vst1.8 {q0}, [r0], r1 - vst1.8 {q0}, [r0], r1 - vst1.8 {q0}, [r0], r1 - vst1.8 {q0}, [r0], r1 - vst1.8 {q0}, [r0], r1 - vst1.8 {q0}, [r0], r1 - vst1.8 {q0}, [r0], r1 - vst1.8 {q0}, [r0], r1 - vst1.8 {q0}, [r0], r1 - vst1.8 {q0}, [r0], r1 - vst1.8 {q0}, [r0], r1 - vst1.8 {q0}, [r0], r1 - bx lr - ENDP ; |vp9_v_predictor_16x16_neon| - -;void vp9_v_predictor_32x32_neon(uint8_t *dst, ptrdiff_t y_stride, -; const uint8_t *above, -; const uint8_t *left) -; r0 uint8_t *dst -; r1 ptrdiff_t y_stride -; r2 const uint8_t *above -; r3 const uint8_t *left - -|vp9_v_predictor_32x32_neon| PROC - vld1.8 {q0, q1}, [r2] - mov r2, #2 -loop_v - vst1.8 {q0, q1}, [r0], r1 - vst1.8 {q0, q1}, [r0], r1 - vst1.8 {q0, q1}, [r0], r1 - vst1.8 {q0, q1}, [r0], r1 - vst1.8 {q0, q1}, [r0], r1 - vst1.8 {q0, q1}, [r0], r1 - vst1.8 {q0, q1}, [r0], r1 - vst1.8 {q0, q1}, [r0], r1 - vst1.8 {q0, q1}, [r0], r1 - vst1.8 {q0, q1}, [r0], r1 - vst1.8 {q0, q1}, [r0], r1 - vst1.8 {q0, q1}, [r0], r1 - vst1.8 {q0, q1}, [r0], r1 - vst1.8 {q0, q1}, [r0], r1 - vst1.8 {q0, q1}, [r0], r1 - vst1.8 {q0, q1}, [r0], r1 - subs r2, r2, #1 - bgt loop_v - bx lr - ENDP ; |vp9_v_predictor_32x32_neon| - -;void vp9_h_predictor_4x4_neon(uint8_t *dst, ptrdiff_t y_stride, -; const uint8_t *above, -; const uint8_t *left) -; r0 uint8_t *dst -; r1 ptrdiff_t y_stride -; r2 const uint8_t *above -; r3 const uint8_t *left - -|vp9_h_predictor_4x4_neon| PROC - vld1.32 {d1[0]}, [r3] - vdup.8 d0, d1[0] - vst1.32 {d0[0]}, [r0], r1 - vdup.8 d0, d1[1] - vst1.32 {d0[0]}, [r0], r1 - vdup.8 d0, d1[2] - vst1.32 {d0[0]}, [r0], r1 - vdup.8 d0, d1[3] - vst1.32 {d0[0]}, [r0], r1 - bx lr - ENDP ; |vp9_h_predictor_4x4_neon| - -;void vp9_h_predictor_8x8_neon(uint8_t *dst, ptrdiff_t y_stride, -; const uint8_t *above, -; const uint8_t *left) -; r0 uint8_t *dst -; r1 ptrdiff_t y_stride -; r2 const uint8_t *above -; r3 const uint8_t *left - -|vp9_h_predictor_8x8_neon| PROC - vld1.64 {d1}, [r3] - vdup.8 d0, d1[0] - vst1.64 {d0}, [r0], r1 - vdup.8 d0, d1[1] - vst1.64 {d0}, [r0], r1 - vdup.8 d0, d1[2] - vst1.64 {d0}, [r0], r1 - vdup.8 d0, d1[3] - vst1.64 {d0}, [r0], r1 - vdup.8 d0, d1[4] - vst1.64 {d0}, [r0], r1 - vdup.8 d0, d1[5] - vst1.64 {d0}, [r0], r1 - vdup.8 d0, d1[6] - vst1.64 {d0}, [r0], r1 - vdup.8 d0, d1[7] - vst1.64 {d0}, [r0], r1 - bx lr - ENDP ; |vp9_h_predictor_8x8_neon| - -;void vp9_h_predictor_16x16_neon(uint8_t *dst, ptrdiff_t y_stride, -; const uint8_t *above, -; const uint8_t *left) -; r0 uint8_t *dst -; r1 ptrdiff_t y_stride -; r2 const uint8_t *above -; r3 const uint8_t *left - -|vp9_h_predictor_16x16_neon| PROC - vld1.8 {q1}, [r3] - vdup.8 q0, d2[0] - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d2[1] - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d2[2] - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d2[3] - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d2[4] - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d2[5] - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d2[6] - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d2[7] - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d3[0] - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d3[1] - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d3[2] - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d3[3] - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d3[4] - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d3[5] - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d3[6] - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d3[7] - vst1.8 {q0}, [r0], r1 - bx lr - ENDP ; |vp9_h_predictor_16x16_neon| - -;void vp9_h_predictor_32x32_neon(uint8_t *dst, ptrdiff_t y_stride, -; const uint8_t *above, -; const uint8_t *left) -; r0 uint8_t *dst -; r1 ptrdiff_t y_stride -; r2 const uint8_t *above -; r3 const uint8_t *left - -|vp9_h_predictor_32x32_neon| PROC - sub r1, r1, #16 - mov r2, #2 -loop_h - vld1.8 {q1}, [r3]! - vdup.8 q0, d2[0] - vst1.8 {q0}, [r0]! - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d2[1] - vst1.8 {q0}, [r0]! - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d2[2] - vst1.8 {q0}, [r0]! - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d2[3] - vst1.8 {q0}, [r0]! - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d2[4] - vst1.8 {q0}, [r0]! - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d2[5] - vst1.8 {q0}, [r0]! - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d2[6] - vst1.8 {q0}, [r0]! - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d2[7] - vst1.8 {q0}, [r0]! - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d3[0] - vst1.8 {q0}, [r0]! - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d3[1] - vst1.8 {q0}, [r0]! - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d3[2] - vst1.8 {q0}, [r0]! - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d3[3] - vst1.8 {q0}, [r0]! - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d3[4] - vst1.8 {q0}, [r0]! - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d3[5] - vst1.8 {q0}, [r0]! - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d3[6] - vst1.8 {q0}, [r0]! - vst1.8 {q0}, [r0], r1 - vdup.8 q0, d3[7] - vst1.8 {q0}, [r0]! - vst1.8 {q0}, [r0], r1 - subs r2, r2, #1 - bgt loop_h - bx lr - ENDP ; |vp9_h_predictor_32x32_neon| - -;void vp9_tm_predictor_4x4_neon (uint8_t *dst, ptrdiff_t y_stride, -; const uint8_t *above, -; const uint8_t *left) -; r0 uint8_t *dst -; r1 ptrdiff_t y_stride -; r2 const uint8_t *above -; r3 const uint8_t *left - -|vp9_tm_predictor_4x4_neon| PROC - ; Load ytop_left = above[-1]; - sub r12, r2, #1 - ldrb r12, [r12] - vdup.u8 d0, r12 - - ; Load above 4 pixels - vld1.32 {d2[0]}, [r2] - - ; Compute above - ytop_left - vsubl.u8 q3, d2, d0 - - ; Load left row by row and compute left + (above - ytop_left) - ; 1st row and 2nd row - ldrb r12, [r3], #1 - ldrb r2, [r3], #1 - vdup.u16 q1, r12 - vdup.u16 q2, r2 - vadd.s16 q1, q1, q3 - vadd.s16 q2, q2, q3 - vqmovun.s16 d0, q1 - vqmovun.s16 d1, q2 - vst1.32 {d0[0]}, [r0], r1 - vst1.32 {d1[0]}, [r0], r1 - - ; 3rd row and 4th row - ldrb r12, [r3], #1 - ldrb r2, [r3], #1 - vdup.u16 q1, r12 - vdup.u16 q2, r2 - vadd.s16 q1, q1, q3 - vadd.s16 q2, q2, q3 - vqmovun.s16 d0, q1 - vqmovun.s16 d1, q2 - vst1.32 {d0[0]}, [r0], r1 - vst1.32 {d1[0]}, [r0], r1 - bx lr - ENDP ; |vp9_tm_predictor_4x4_neon| - -;void vp9_tm_predictor_8x8_neon (uint8_t *dst, ptrdiff_t y_stride, -; const uint8_t *above, -; const uint8_t *left) -; r0 uint8_t *dst -; r1 ptrdiff_t y_stride -; r2 const uint8_t *above -; r3 const uint8_t *left - -|vp9_tm_predictor_8x8_neon| PROC - ; Load ytop_left = above[-1]; - sub r12, r2, #1 - ldrb r12, [r12] - vdup.u8 d0, r12 - - ; preload 8 left - vld1.8 {d30}, [r3] - - ; Load above 8 pixels - vld1.64 {d2}, [r2] - - vmovl.u8 q10, d30 - - ; Compute above - ytop_left - vsubl.u8 q3, d2, d0 - - ; Load left row by row and compute left + (above - ytop_left) - ; 1st row and 2nd row - vdup.16 q0, d20[0] - vdup.16 q1, d20[1] - vadd.s16 q0, q3, q0 - vadd.s16 q1, q3, q1 - - ; 3rd row and 4th row - vdup.16 q8, d20[2] - vdup.16 q9, d20[3] - vadd.s16 q8, q3, q8 - vadd.s16 q9, q3, q9 - - vqmovun.s16 d0, q0 - vqmovun.s16 d1, q1 - vqmovun.s16 d2, q8 - vqmovun.s16 d3, q9 - - vst1.64 {d0}, [r0], r1 - vst1.64 {d1}, [r0], r1 - vst1.64 {d2}, [r0], r1 - vst1.64 {d3}, [r0], r1 - - ; 5th row and 6th row - vdup.16 q0, d21[0] - vdup.16 q1, d21[1] - vadd.s16 q0, q3, q0 - vadd.s16 q1, q3, q1 - - ; 7th row and 8th row - vdup.16 q8, d21[2] - vdup.16 q9, d21[3] - vadd.s16 q8, q3, q8 - vadd.s16 q9, q3, q9 - - vqmovun.s16 d0, q0 - vqmovun.s16 d1, q1 - vqmovun.s16 d2, q8 - vqmovun.s16 d3, q9 - - vst1.64 {d0}, [r0], r1 - vst1.64 {d1}, [r0], r1 - vst1.64 {d2}, [r0], r1 - vst1.64 {d3}, [r0], r1 - - bx lr - ENDP ; |vp9_tm_predictor_8x8_neon| - -;void vp9_tm_predictor_16x16_neon (uint8_t *dst, ptrdiff_t y_stride, -; const uint8_t *above, -; const uint8_t *left) -; r0 uint8_t *dst -; r1 ptrdiff_t y_stride -; r2 const uint8_t *above -; r3 const uint8_t *left - -|vp9_tm_predictor_16x16_neon| PROC - ; Load ytop_left = above[-1]; - sub r12, r2, #1 - ldrb r12, [r12] - vdup.u8 q0, r12 - - ; Load above 8 pixels - vld1.8 {q1}, [r2] - - ; preload 8 left into r12 - vld1.8 {d18}, [r3]! - - ; Compute above - ytop_left - vsubl.u8 q2, d2, d0 - vsubl.u8 q3, d3, d1 - - vmovl.u8 q10, d18 - - ; Load left row by row and compute left + (above - ytop_left) - ; Process 8 rows in each single loop and loop 2 times to process 16 rows. - mov r2, #2 - -loop_16x16_neon - ; Process two rows. - vdup.16 q0, d20[0] - vdup.16 q8, d20[1] - vadd.s16 q1, q0, q2 - vadd.s16 q0, q0, q3 - vadd.s16 q11, q8, q2 - vadd.s16 q8, q8, q3 - vqmovun.s16 d2, q1 - vqmovun.s16 d3, q0 - vqmovun.s16 d22, q11 - vqmovun.s16 d23, q8 - vdup.16 q0, d20[2] ; proload next 2 rows data - vdup.16 q8, d20[3] - vst1.64 {d2,d3}, [r0], r1 - vst1.64 {d22,d23}, [r0], r1 - - ; Process two rows. - vadd.s16 q1, q0, q2 - vadd.s16 q0, q0, q3 - vadd.s16 q11, q8, q2 - vadd.s16 q8, q8, q3 - vqmovun.s16 d2, q1 - vqmovun.s16 d3, q0 - vqmovun.s16 d22, q11 - vqmovun.s16 d23, q8 - vdup.16 q0, d21[0] ; proload next 2 rows data - vdup.16 q8, d21[1] - vst1.64 {d2,d3}, [r0], r1 - vst1.64 {d22,d23}, [r0], r1 - - vadd.s16 q1, q0, q2 - vadd.s16 q0, q0, q3 - vadd.s16 q11, q8, q2 - vadd.s16 q8, q8, q3 - vqmovun.s16 d2, q1 - vqmovun.s16 d3, q0 - vqmovun.s16 d22, q11 - vqmovun.s16 d23, q8 - vdup.16 q0, d21[2] ; proload next 2 rows data - vdup.16 q8, d21[3] - vst1.64 {d2,d3}, [r0], r1 - vst1.64 {d22,d23}, [r0], r1 - - - vadd.s16 q1, q0, q2 - vadd.s16 q0, q0, q3 - vadd.s16 q11, q8, q2 - vadd.s16 q8, q8, q3 - vqmovun.s16 d2, q1 - vqmovun.s16 d3, q0 - vqmovun.s16 d22, q11 - vqmovun.s16 d23, q8 - vld1.8 {d18}, [r3]! ; preload 8 left into r12 - vmovl.u8 q10, d18 - vst1.64 {d2,d3}, [r0], r1 - vst1.64 {d22,d23}, [r0], r1 - - subs r2, r2, #1 - bgt loop_16x16_neon - - bx lr - ENDP ; |vp9_tm_predictor_16x16_neon| - -;void vp9_tm_predictor_32x32_neon (uint8_t *dst, ptrdiff_t y_stride, -; const uint8_t *above, -; const uint8_t *left) -; r0 uint8_t *dst -; r1 ptrdiff_t y_stride -; r2 const uint8_t *above -; r3 const uint8_t *left - -|vp9_tm_predictor_32x32_neon| PROC - ; Load ytop_left = above[-1]; - sub r12, r2, #1 - ldrb r12, [r12] - vdup.u8 q0, r12 - - ; Load above 32 pixels - vld1.8 {q1}, [r2]! - vld1.8 {q2}, [r2] - - ; preload 8 left pixels - vld1.8 {d26}, [r3]! - - ; Compute above - ytop_left - vsubl.u8 q8, d2, d0 - vsubl.u8 q9, d3, d1 - vsubl.u8 q10, d4, d0 - vsubl.u8 q11, d5, d1 - - vmovl.u8 q3, d26 - - ; Load left row by row and compute left + (above - ytop_left) - ; Process 8 rows in each single loop and loop 4 times to process 32 rows. - mov r2, #4 - -loop_32x32_neon - ; Process two rows. - vdup.16 q0, d6[0] - vdup.16 q2, d6[1] - vadd.s16 q12, q0, q8 - vadd.s16 q13, q0, q9 - vadd.s16 q14, q0, q10 - vadd.s16 q15, q0, q11 - vqmovun.s16 d0, q12 - vqmovun.s16 d1, q13 - vadd.s16 q12, q2, q8 - vadd.s16 q13, q2, q9 - vqmovun.s16 d2, q14 - vqmovun.s16 d3, q15 - vadd.s16 q14, q2, q10 - vadd.s16 q15, q2, q11 - vst1.64 {d0-d3}, [r0], r1 - vqmovun.s16 d24, q12 - vqmovun.s16 d25, q13 - vqmovun.s16 d26, q14 - vqmovun.s16 d27, q15 - vdup.16 q1, d6[2] - vdup.16 q2, d6[3] - vst1.64 {d24-d27}, [r0], r1 - - ; Process two rows. - vadd.s16 q12, q1, q8 - vadd.s16 q13, q1, q9 - vadd.s16 q14, q1, q10 - vadd.s16 q15, q1, q11 - vqmovun.s16 d0, q12 - vqmovun.s16 d1, q13 - vadd.s16 q12, q2, q8 - vadd.s16 q13, q2, q9 - vqmovun.s16 d2, q14 - vqmovun.s16 d3, q15 - vadd.s16 q14, q2, q10 - vadd.s16 q15, q2, q11 - vst1.64 {d0-d3}, [r0], r1 - vqmovun.s16 d24, q12 - vqmovun.s16 d25, q13 - vqmovun.s16 d26, q14 - vqmovun.s16 d27, q15 - vdup.16 q0, d7[0] - vdup.16 q2, d7[1] - vst1.64 {d24-d27}, [r0], r1 - - ; Process two rows. - vadd.s16 q12, q0, q8 - vadd.s16 q13, q0, q9 - vadd.s16 q14, q0, q10 - vadd.s16 q15, q0, q11 - vqmovun.s16 d0, q12 - vqmovun.s16 d1, q13 - vadd.s16 q12, q2, q8 - vadd.s16 q13, q2, q9 - vqmovun.s16 d2, q14 - vqmovun.s16 d3, q15 - vadd.s16 q14, q2, q10 - vadd.s16 q15, q2, q11 - vst1.64 {d0-d3}, [r0], r1 - vqmovun.s16 d24, q12 - vqmovun.s16 d25, q13 - vqmovun.s16 d26, q14 - vqmovun.s16 d27, q15 - vdup.16 q0, d7[2] - vdup.16 q2, d7[3] - vst1.64 {d24-d27}, [r0], r1 - - ; Process two rows. - vadd.s16 q12, q0, q8 - vadd.s16 q13, q0, q9 - vadd.s16 q14, q0, q10 - vadd.s16 q15, q0, q11 - vqmovun.s16 d0, q12 - vqmovun.s16 d1, q13 - vadd.s16 q12, q2, q8 - vadd.s16 q13, q2, q9 - vqmovun.s16 d2, q14 - vqmovun.s16 d3, q15 - vadd.s16 q14, q2, q10 - vadd.s16 q15, q2, q11 - vst1.64 {d0-d3}, [r0], r1 - vqmovun.s16 d24, q12 - vqmovun.s16 d25, q13 - vld1.8 {d0}, [r3]! ; preload 8 left pixels - vqmovun.s16 d26, q14 - vqmovun.s16 d27, q15 - vmovl.u8 q3, d0 - vst1.64 {d24-d27}, [r0], r1 - - subs r2, r2, #1 - bgt loop_32x32_neon - - bx lr - ENDP ; |vp9_tm_predictor_32x32_neon| - - END diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_reconintra_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_reconintra_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_reconintra_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_reconintra_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,473 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -void vp9_v_predictor_4x4_neon( - uint8_t *dst, - ptrdiff_t y_stride, - const uint8_t *above, - const uint8_t *left) { - int i; - uint32x2_t d0u32 = vdup_n_u32(0); - (void)left; - - d0u32 = vld1_lane_u32((const uint32_t *)above, d0u32, 0); - for (i = 0; i < 4; i++, dst += y_stride) - vst1_lane_u32((uint32_t *)dst, d0u32, 0); - return; -} - -void vp9_v_predictor_8x8_neon( - uint8_t *dst, - ptrdiff_t y_stride, - const uint8_t *above, - const uint8_t *left) { - int i; - uint8x8_t d0u8 = vdup_n_u8(0); - (void)left; - - d0u8 = vld1_u8(above); - for (i = 0; i < 8; i++, dst += y_stride) - vst1_u8(dst, d0u8); - return; -} - -void vp9_v_predictor_16x16_neon( - uint8_t *dst, - ptrdiff_t y_stride, - const uint8_t *above, - const uint8_t *left) { - int i; - uint8x16_t q0u8 = vdupq_n_u8(0); - (void)left; - - q0u8 = vld1q_u8(above); - for (i = 0; i < 16; i++, dst += y_stride) - vst1q_u8(dst, q0u8); - return; -} - -void vp9_v_predictor_32x32_neon( - uint8_t *dst, - ptrdiff_t y_stride, - const uint8_t *above, - const uint8_t *left) { - int i; - uint8x16_t q0u8 = vdupq_n_u8(0); - uint8x16_t q1u8 = vdupq_n_u8(0); - (void)left; - - q0u8 = vld1q_u8(above); - q1u8 = vld1q_u8(above + 16); - for (i = 0; i < 32; i++, dst += y_stride) { - vst1q_u8(dst, q0u8); - vst1q_u8(dst + 16, q1u8); - } - return; -} - -void vp9_h_predictor_4x4_neon( - uint8_t *dst, - ptrdiff_t y_stride, - const uint8_t *above, - const uint8_t *left) { - uint8x8_t d0u8 = vdup_n_u8(0); - uint32x2_t d1u32 = vdup_n_u32(0); - (void)above; - - d1u32 = vld1_lane_u32((const uint32_t *)left, d1u32, 0); - - d0u8 = vdup_lane_u8(vreinterpret_u8_u32(d1u32), 0); - vst1_lane_u32((uint32_t *)dst, vreinterpret_u32_u8(d0u8), 0); - dst += y_stride; - d0u8 = vdup_lane_u8(vreinterpret_u8_u32(d1u32), 1); - vst1_lane_u32((uint32_t *)dst, vreinterpret_u32_u8(d0u8), 0); - dst += y_stride; - d0u8 = vdup_lane_u8(vreinterpret_u8_u32(d1u32), 2); - vst1_lane_u32((uint32_t *)dst, vreinterpret_u32_u8(d0u8), 0); - dst += y_stride; - d0u8 = vdup_lane_u8(vreinterpret_u8_u32(d1u32), 3); - vst1_lane_u32((uint32_t *)dst, vreinterpret_u32_u8(d0u8), 0); - return; -} - -void vp9_h_predictor_8x8_neon( - uint8_t *dst, - ptrdiff_t y_stride, - const uint8_t *above, - const uint8_t *left) { - uint8x8_t d0u8 = vdup_n_u8(0); - uint64x1_t d1u64 = vdup_n_u64(0); - (void)above; - - d1u64 = vld1_u64((const uint64_t *)left); - - d0u8 = vdup_lane_u8(vreinterpret_u8_u64(d1u64), 0); - vst1_u8(dst, d0u8); - dst += y_stride; - d0u8 = vdup_lane_u8(vreinterpret_u8_u64(d1u64), 1); - vst1_u8(dst, d0u8); - dst += y_stride; - d0u8 = vdup_lane_u8(vreinterpret_u8_u64(d1u64), 2); - vst1_u8(dst, d0u8); - dst += y_stride; - d0u8 = vdup_lane_u8(vreinterpret_u8_u64(d1u64), 3); - vst1_u8(dst, d0u8); - dst += y_stride; - d0u8 = vdup_lane_u8(vreinterpret_u8_u64(d1u64), 4); - vst1_u8(dst, d0u8); - dst += y_stride; - d0u8 = vdup_lane_u8(vreinterpret_u8_u64(d1u64), 5); - vst1_u8(dst, d0u8); - dst += y_stride; - d0u8 = vdup_lane_u8(vreinterpret_u8_u64(d1u64), 6); - vst1_u8(dst, d0u8); - dst += y_stride; - d0u8 = vdup_lane_u8(vreinterpret_u8_u64(d1u64), 7); - vst1_u8(dst, d0u8); - return; -} - -void vp9_h_predictor_16x16_neon( - uint8_t *dst, - ptrdiff_t y_stride, - const uint8_t *above, - const uint8_t *left) { - int j; - uint8x8_t d2u8 = vdup_n_u8(0); - uint8x16_t q0u8 = vdupq_n_u8(0); - uint8x16_t q1u8 = vdupq_n_u8(0); - (void)above; - - q1u8 = vld1q_u8(left); - d2u8 = vget_low_u8(q1u8); - for (j = 0; j < 2; j++, d2u8 = vget_high_u8(q1u8)) { - q0u8 = vdupq_lane_u8(d2u8, 0); - vst1q_u8(dst, q0u8); - dst += y_stride; - q0u8 = vdupq_lane_u8(d2u8, 1); - vst1q_u8(dst, q0u8); - dst += y_stride; - q0u8 = vdupq_lane_u8(d2u8, 2); - vst1q_u8(dst, q0u8); - dst += y_stride; - q0u8 = vdupq_lane_u8(d2u8, 3); - vst1q_u8(dst, q0u8); - dst += y_stride; - q0u8 = vdupq_lane_u8(d2u8, 4); - vst1q_u8(dst, q0u8); - dst += y_stride; - q0u8 = vdupq_lane_u8(d2u8, 5); - vst1q_u8(dst, q0u8); - dst += y_stride; - q0u8 = vdupq_lane_u8(d2u8, 6); - vst1q_u8(dst, q0u8); - dst += y_stride; - q0u8 = vdupq_lane_u8(d2u8, 7); - vst1q_u8(dst, q0u8); - dst += y_stride; - } - return; -} - -void vp9_h_predictor_32x32_neon( - uint8_t *dst, - ptrdiff_t y_stride, - const uint8_t *above, - const uint8_t *left) { - int j, k; - uint8x8_t d2u8 = vdup_n_u8(0); - uint8x16_t q0u8 = vdupq_n_u8(0); - uint8x16_t q1u8 = vdupq_n_u8(0); - (void)above; - - for (k = 0; k < 2; k++, left += 16) { - q1u8 = vld1q_u8(left); - d2u8 = vget_low_u8(q1u8); - for (j = 0; j < 2; j++, d2u8 = vget_high_u8(q1u8)) { - q0u8 = vdupq_lane_u8(d2u8, 0); - vst1q_u8(dst, q0u8); - vst1q_u8(dst + 16, q0u8); - dst += y_stride; - q0u8 = vdupq_lane_u8(d2u8, 1); - vst1q_u8(dst, q0u8); - vst1q_u8(dst + 16, q0u8); - dst += y_stride; - q0u8 = vdupq_lane_u8(d2u8, 2); - vst1q_u8(dst, q0u8); - vst1q_u8(dst + 16, q0u8); - dst += y_stride; - q0u8 = vdupq_lane_u8(d2u8, 3); - vst1q_u8(dst, q0u8); - vst1q_u8(dst + 16, q0u8); - dst += y_stride; - q0u8 = vdupq_lane_u8(d2u8, 4); - vst1q_u8(dst, q0u8); - vst1q_u8(dst + 16, q0u8); - dst += y_stride; - q0u8 = vdupq_lane_u8(d2u8, 5); - vst1q_u8(dst, q0u8); - vst1q_u8(dst + 16, q0u8); - dst += y_stride; - q0u8 = vdupq_lane_u8(d2u8, 6); - vst1q_u8(dst, q0u8); - vst1q_u8(dst + 16, q0u8); - dst += y_stride; - q0u8 = vdupq_lane_u8(d2u8, 7); - vst1q_u8(dst, q0u8); - vst1q_u8(dst + 16, q0u8); - dst += y_stride; - } - } - return; -} - -void vp9_tm_predictor_4x4_neon( - uint8_t *dst, - ptrdiff_t y_stride, - const uint8_t *above, - const uint8_t *left) { - int i; - uint16x8_t q1u16, q3u16; - int16x8_t q1s16; - uint8x8_t d0u8 = vdup_n_u8(0); - uint32x2_t d2u32 = vdup_n_u32(0); - - d0u8 = vdup_n_u8(above[-1]); - d2u32 = vld1_lane_u32((const uint32_t *)above, d2u32, 0); - q3u16 = vsubl_u8(vreinterpret_u8_u32(d2u32), d0u8); - for (i = 0; i < 4; i++, dst += y_stride) { - q1u16 = vdupq_n_u16((uint16_t)left[i]); - q1s16 = vaddq_s16(vreinterpretq_s16_u16(q1u16), - vreinterpretq_s16_u16(q3u16)); - d0u8 = vqmovun_s16(q1s16); - vst1_lane_u32((uint32_t *)dst, vreinterpret_u32_u8(d0u8), 0); - } - return; -} - -void vp9_tm_predictor_8x8_neon( - uint8_t *dst, - ptrdiff_t y_stride, - const uint8_t *above, - const uint8_t *left) { - int j; - uint16x8_t q0u16, q3u16, q10u16; - int16x8_t q0s16; - uint16x4_t d20u16; - uint8x8_t d0u8, d2u8, d30u8; - - d0u8 = vdup_n_u8(above[-1]); - d30u8 = vld1_u8(left); - d2u8 = vld1_u8(above); - q10u16 = vmovl_u8(d30u8); - q3u16 = vsubl_u8(d2u8, d0u8); - d20u16 = vget_low_u16(q10u16); - for (j = 0; j < 2; j++, d20u16 = vget_high_u16(q10u16)) { - q0u16 = vdupq_lane_u16(d20u16, 0); - q0s16 = vaddq_s16(vreinterpretq_s16_u16(q3u16), - vreinterpretq_s16_u16(q0u16)); - d0u8 = vqmovun_s16(q0s16); - vst1_u64((uint64_t *)dst, vreinterpret_u64_u8(d0u8)); - dst += y_stride; - q0u16 = vdupq_lane_u16(d20u16, 1); - q0s16 = vaddq_s16(vreinterpretq_s16_u16(q3u16), - vreinterpretq_s16_u16(q0u16)); - d0u8 = vqmovun_s16(q0s16); - vst1_u64((uint64_t *)dst, vreinterpret_u64_u8(d0u8)); - dst += y_stride; - q0u16 = vdupq_lane_u16(d20u16, 2); - q0s16 = vaddq_s16(vreinterpretq_s16_u16(q3u16), - vreinterpretq_s16_u16(q0u16)); - d0u8 = vqmovun_s16(q0s16); - vst1_u64((uint64_t *)dst, vreinterpret_u64_u8(d0u8)); - dst += y_stride; - q0u16 = vdupq_lane_u16(d20u16, 3); - q0s16 = vaddq_s16(vreinterpretq_s16_u16(q3u16), - vreinterpretq_s16_u16(q0u16)); - d0u8 = vqmovun_s16(q0s16); - vst1_u64((uint64_t *)dst, vreinterpret_u64_u8(d0u8)); - dst += y_stride; - } - return; -} - -void vp9_tm_predictor_16x16_neon( - uint8_t *dst, - ptrdiff_t y_stride, - const uint8_t *above, - const uint8_t *left) { - int j, k; - uint16x8_t q0u16, q2u16, q3u16, q8u16, q10u16; - uint8x16_t q0u8, q1u8; - int16x8_t q0s16, q1s16, q8s16, q11s16; - uint16x4_t d20u16; - uint8x8_t d2u8, d3u8, d18u8, d22u8, d23u8; - - q0u8 = vdupq_n_u8(above[-1]); - q1u8 = vld1q_u8(above); - q2u16 = vsubl_u8(vget_low_u8(q1u8), vget_low_u8(q0u8)); - q3u16 = vsubl_u8(vget_high_u8(q1u8), vget_high_u8(q0u8)); - for (k = 0; k < 2; k++, left += 8) { - d18u8 = vld1_u8(left); - q10u16 = vmovl_u8(d18u8); - d20u16 = vget_low_u16(q10u16); - for (j = 0; j < 2; j++, d20u16 = vget_high_u16(q10u16)) { - q0u16 = vdupq_lane_u16(d20u16, 0); - q8u16 = vdupq_lane_u16(d20u16, 1); - q1s16 = vaddq_s16(vreinterpretq_s16_u16(q0u16), - vreinterpretq_s16_u16(q2u16)); - q0s16 = vaddq_s16(vreinterpretq_s16_u16(q0u16), - vreinterpretq_s16_u16(q3u16)); - q11s16 = vaddq_s16(vreinterpretq_s16_u16(q8u16), - vreinterpretq_s16_u16(q2u16)); - q8s16 = vaddq_s16(vreinterpretq_s16_u16(q8u16), - vreinterpretq_s16_u16(q3u16)); - d2u8 = vqmovun_s16(q1s16); - d3u8 = vqmovun_s16(q0s16); - d22u8 = vqmovun_s16(q11s16); - d23u8 = vqmovun_s16(q8s16); - vst1_u64((uint64_t *)dst, vreinterpret_u64_u8(d2u8)); - vst1_u64((uint64_t *)(dst + 8), vreinterpret_u64_u8(d3u8)); - dst += y_stride; - vst1_u64((uint64_t *)dst, vreinterpret_u64_u8(d22u8)); - vst1_u64((uint64_t *)(dst + 8), vreinterpret_u64_u8(d23u8)); - dst += y_stride; - - q0u16 = vdupq_lane_u16(d20u16, 2); - q8u16 = vdupq_lane_u16(d20u16, 3); - q1s16 = vaddq_s16(vreinterpretq_s16_u16(q0u16), - vreinterpretq_s16_u16(q2u16)); - q0s16 = vaddq_s16(vreinterpretq_s16_u16(q0u16), - vreinterpretq_s16_u16(q3u16)); - q11s16 = vaddq_s16(vreinterpretq_s16_u16(q8u16), - vreinterpretq_s16_u16(q2u16)); - q8s16 = vaddq_s16(vreinterpretq_s16_u16(q8u16), - vreinterpretq_s16_u16(q3u16)); - d2u8 = vqmovun_s16(q1s16); - d3u8 = vqmovun_s16(q0s16); - d22u8 = vqmovun_s16(q11s16); - d23u8 = vqmovun_s16(q8s16); - vst1_u64((uint64_t *)dst, vreinterpret_u64_u8(d2u8)); - vst1_u64((uint64_t *)(dst + 8), vreinterpret_u64_u8(d3u8)); - dst += y_stride; - vst1_u64((uint64_t *)dst, vreinterpret_u64_u8(d22u8)); - vst1_u64((uint64_t *)(dst + 8), vreinterpret_u64_u8(d23u8)); - dst += y_stride; - } - } - return; -} - -void vp9_tm_predictor_32x32_neon( - uint8_t *dst, - ptrdiff_t y_stride, - const uint8_t *above, - const uint8_t *left) { - int j, k; - uint16x8_t q0u16, q3u16, q8u16, q9u16, q10u16, q11u16; - uint8x16_t q0u8, q1u8, q2u8; - int16x8_t q12s16, q13s16, q14s16, q15s16; - uint16x4_t d6u16; - uint8x8_t d0u8, d1u8, d2u8, d3u8, d26u8; - - q0u8 = vdupq_n_u8(above[-1]); - q1u8 = vld1q_u8(above); - q2u8 = vld1q_u8(above + 16); - q8u16 = vsubl_u8(vget_low_u8(q1u8), vget_low_u8(q0u8)); - q9u16 = vsubl_u8(vget_high_u8(q1u8), vget_high_u8(q0u8)); - q10u16 = vsubl_u8(vget_low_u8(q2u8), vget_low_u8(q0u8)); - q11u16 = vsubl_u8(vget_high_u8(q2u8), vget_high_u8(q0u8)); - for (k = 0; k < 4; k++, left += 8) { - d26u8 = vld1_u8(left); - q3u16 = vmovl_u8(d26u8); - d6u16 = vget_low_u16(q3u16); - for (j = 0; j < 2; j++, d6u16 = vget_high_u16(q3u16)) { - q0u16 = vdupq_lane_u16(d6u16, 0); - q12s16 = vaddq_s16(vreinterpretq_s16_u16(q0u16), - vreinterpretq_s16_u16(q8u16)); - q13s16 = vaddq_s16(vreinterpretq_s16_u16(q0u16), - vreinterpretq_s16_u16(q9u16)); - q14s16 = vaddq_s16(vreinterpretq_s16_u16(q0u16), - vreinterpretq_s16_u16(q10u16)); - q15s16 = vaddq_s16(vreinterpretq_s16_u16(q0u16), - vreinterpretq_s16_u16(q11u16)); - d0u8 = vqmovun_s16(q12s16); - d1u8 = vqmovun_s16(q13s16); - d2u8 = vqmovun_s16(q14s16); - d3u8 = vqmovun_s16(q15s16); - q0u8 = vcombine_u8(d0u8, d1u8); - q1u8 = vcombine_u8(d2u8, d3u8); - vst1q_u64((uint64_t *)dst, vreinterpretq_u64_u8(q0u8)); - vst1q_u64((uint64_t *)(dst + 16), vreinterpretq_u64_u8(q1u8)); - dst += y_stride; - - q0u16 = vdupq_lane_u16(d6u16, 1); - q12s16 = vaddq_s16(vreinterpretq_s16_u16(q0u16), - vreinterpretq_s16_u16(q8u16)); - q13s16 = vaddq_s16(vreinterpretq_s16_u16(q0u16), - vreinterpretq_s16_u16(q9u16)); - q14s16 = vaddq_s16(vreinterpretq_s16_u16(q0u16), - vreinterpretq_s16_u16(q10u16)); - q15s16 = vaddq_s16(vreinterpretq_s16_u16(q0u16), - vreinterpretq_s16_u16(q11u16)); - d0u8 = vqmovun_s16(q12s16); - d1u8 = vqmovun_s16(q13s16); - d2u8 = vqmovun_s16(q14s16); - d3u8 = vqmovun_s16(q15s16); - q0u8 = vcombine_u8(d0u8, d1u8); - q1u8 = vcombine_u8(d2u8, d3u8); - vst1q_u64((uint64_t *)dst, vreinterpretq_u64_u8(q0u8)); - vst1q_u64((uint64_t *)(dst + 16), vreinterpretq_u64_u8(q1u8)); - dst += y_stride; - - q0u16 = vdupq_lane_u16(d6u16, 2); - q12s16 = vaddq_s16(vreinterpretq_s16_u16(q0u16), - vreinterpretq_s16_u16(q8u16)); - q13s16 = vaddq_s16(vreinterpretq_s16_u16(q0u16), - vreinterpretq_s16_u16(q9u16)); - q14s16 = vaddq_s16(vreinterpretq_s16_u16(q0u16), - vreinterpretq_s16_u16(q10u16)); - q15s16 = vaddq_s16(vreinterpretq_s16_u16(q0u16), - vreinterpretq_s16_u16(q11u16)); - d0u8 = vqmovun_s16(q12s16); - d1u8 = vqmovun_s16(q13s16); - d2u8 = vqmovun_s16(q14s16); - d3u8 = vqmovun_s16(q15s16); - q0u8 = vcombine_u8(d0u8, d1u8); - q1u8 = vcombine_u8(d2u8, d3u8); - vst1q_u64((uint64_t *)dst, vreinterpretq_u64_u8(q0u8)); - vst1q_u64((uint64_t *)(dst + 16), vreinterpretq_u64_u8(q1u8)); - dst += y_stride; - - q0u16 = vdupq_lane_u16(d6u16, 3); - q12s16 = vaddq_s16(vreinterpretq_s16_u16(q0u16), - vreinterpretq_s16_u16(q8u16)); - q13s16 = vaddq_s16(vreinterpretq_s16_u16(q0u16), - vreinterpretq_s16_u16(q9u16)); - q14s16 = vaddq_s16(vreinterpretq_s16_u16(q0u16), - vreinterpretq_s16_u16(q10u16)); - q15s16 = vaddq_s16(vreinterpretq_s16_u16(q0u16), - vreinterpretq_s16_u16(q11u16)); - d0u8 = vqmovun_s16(q12s16); - d1u8 = vqmovun_s16(q13s16); - d2u8 = vqmovun_s16(q14s16); - d3u8 = vqmovun_s16(q15s16); - q0u8 = vcombine_u8(d0u8, d1u8); - q1u8 = vcombine_u8(d2u8, d3u8); - vst1q_u64((uint64_t *)dst, vreinterpretq_u64_u8(q0u8)); - vst1q_u64((uint64_t *)(dst + 16), vreinterpretq_u64_u8(q1u8)); - dst += y_stride; - } - } - return; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_save_reg_neon.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_save_reg_neon.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/arm/neon/vp9_save_reg_neon.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/arm/neon/vp9_save_reg_neon.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - - EXPORT |vp9_push_neon| - EXPORT |vp9_pop_neon| - - ARM - REQUIRE8 - PRESERVE8 - - AREA ||.text||, CODE, READONLY, ALIGN=2 - -|vp9_push_neon| PROC - vst1.i64 {d8, d9, d10, d11}, [r0]! - vst1.i64 {d12, d13, d14, d15}, [r0]! - bx lr - - ENDP - -|vp9_pop_neon| PROC - vld1.i64 {d8, d9, d10, d11}, [r0]! - vld1.i64 {d12, d13, d14, d15}, [r0]! - bx lr - - ENDP - - END - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_common_dspr2.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_common_dspr2.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_common_dspr2.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_common_dspr2.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_MIPS_DSPR2_VP9_COMMON_DSPR2_H_ -#define VP9_COMMON_MIPS_DSPR2_VP9_COMMON_DSPR2_H_ - -#include - -#include "./vpx_config.h" -#include "vpx/vpx_integer.h" -#include "vp9/common/vp9_common.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if HAVE_DSPR2 -#define CROP_WIDTH 512 -extern uint8_t *vp9_ff_cropTbl; - -#define DCT_CONST_ROUND_SHIFT_TWICE_COSPI_16_64(input) ({ \ - \ - int32_t tmp, out; \ - int dct_cost_rounding = DCT_CONST_ROUNDING; \ - int in = input; \ - \ - __asm__ __volatile__ ( \ - /* out = dct_const_round_shift(input_dc * cospi_16_64); */ \ - "mtlo %[dct_cost_rounding], $ac1 \n\t"\ - "mthi $zero, $ac1 \n\t"\ - "madd $ac1, %[in], %[cospi_16_64] \n\t"\ - "extp %[tmp], $ac1, 31 \n\t"\ - \ - /* out = dct_const_round_shift(out * cospi_16_64); */ \ - "mtlo %[dct_cost_rounding], $ac2 \n\t"\ - "mthi $zero, $ac2 \n\t"\ - "madd $ac2, %[tmp], %[cospi_16_64] \n\t"\ - "extp %[out], $ac2, 31 \n\t"\ - \ - : [tmp] "=&r" (tmp), [out] "=r" (out) \ - : [in] "r" (in), \ - [dct_cost_rounding] "r" (dct_cost_rounding), \ - [cospi_16_64] "r" (cospi_16_64) \ - ); \ - out; }) - -static INLINE void vp9_prefetch_load(const unsigned char *src) { - __asm__ __volatile__ ( - "pref 0, 0(%[src]) \n\t" - : - : [src] "r" (src) - ); -} - -/* prefetch data for store */ -static INLINE void vp9_prefetch_store(unsigned char *dst) { - __asm__ __volatile__ ( - "pref 1, 0(%[dst]) \n\t" - : - : [dst] "r" (dst) - ); -} - -static INLINE void vp9_prefetch_load_streamed(const unsigned char *src) { - __asm__ __volatile__ ( - "pref 4, 0(%[src]) \n\t" - : - : [src] "r" (src) - ); -} - -/* prefetch data for store */ -static INLINE void vp9_prefetch_store_streamed(unsigned char *dst) { - __asm__ __volatile__ ( - "pref 5, 0(%[dst]) \n\t" - : - : [dst] "r" (dst) - ); -} - -void vp9_idct32_cols_add_blk_dspr2(int16_t *input, uint8_t *dest, - int dest_stride); - -void vp9_convolve2_horiz_dspr2(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h); - -void vp9_convolve2_avg_horiz_dspr2(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h); - -void vp9_convolve2_avg_vert_dspr2(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h); - -void vp9_convolve2_dspr2(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter, - int w, int h); - -void vp9_convolve2_vert_dspr2(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h); - -#endif // #if HAVE_DSPR2 -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_MIPS_DSPR2_VP9_COMMON_DSPR2_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve2_avg_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve2_avg_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve2_avg_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve2_avg_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vpx_config.h" -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vpx/vpx_integer.h" -#include "vpx_ports/mem.h" -#include "vp9/common/vp9_convolve.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" - -#if HAVE_DSPR2 -static void convolve_bi_avg_vert_4_dspr2(const uint8_t *src, - int32_t src_stride, - uint8_t *dst, - int32_t dst_stride, - const int16_t *filter_y, - int32_t w, - int32_t h) { - int32_t x, y; - const uint8_t *src_ptr; - uint8_t *dst_ptr; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector4a = 64; - uint32_t load1, load2; - uint32_t p1, p2; - uint32_t scratch1, scratch2; - uint32_t store1, store2; - int32_t Temp1, Temp2; - const int16_t *filter = &filter_y[3]; - uint32_t filter45; - - filter45 = ((const int32_t *)filter)[0]; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_store(dst + dst_stride); - - for (x = 0; x < w; x += 4) { - src_ptr = src + x; - dst_ptr = dst + x; - - __asm__ __volatile__ ( - "ulw %[load1], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load2], 0(%[src_ptr]) \n\t" - - "mtlo %[vector4a], $ac0 \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac0 \n\t" - "mthi $zero, $ac1 \n\t" - "mthi $zero, $ac2 \n\t" - "mthi $zero, $ac3 \n\t" - - "preceu.ph.qbr %[scratch1], %[load1] \n\t" - "preceu.ph.qbr %[p1], %[load2] \n\t" - "precrq.ph.w %[p2], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - - "dpa.w.ph $ac0, %[p1], %[filter45] \n\t" - "dpa.w.ph $ac1, %[p2], %[filter45] \n\t" - - "preceu.ph.qbl %[scratch1], %[load1] \n\t" - "preceu.ph.qbl %[p1], %[load2] \n\t" - "precrq.ph.w %[p2], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - - "dpa.w.ph $ac2, %[p1], %[filter45] \n\t" - "dpa.w.ph $ac3, %[p2], %[filter45] \n\t" - - "extp %[Temp1], $ac0, 31 \n\t" - "extp %[Temp2], $ac1, 31 \n\t" - - "lbu %[scratch1], 0(%[dst_ptr]) \n\t" - "lbu %[scratch2], 1(%[dst_ptr]) \n\t" - - "lbux %[store1], %[Temp1](%[cm]) \n\t" - "addqh_r.w %[store1], %[store1], %[scratch1] \n\t" /* pixel 1 */ - "extp %[Temp1], $ac2, 31 \n\t" - - "lbux %[store2], %[Temp2](%[cm]) \n\t" - "addqh_r.w %[store2], %[store2], %[scratch2] \n\t" /* pixel 2 */ - "extp %[Temp2], $ac3, 31 \n\t" - "lbu %[scratch1], 2(%[dst_ptr]) \n\t" - - "sb %[store1], 0(%[dst_ptr]) \n\t" - "sb %[store2], 1(%[dst_ptr]) \n\t" - "lbu %[scratch2], 3(%[dst_ptr]) \n\t" - - "lbux %[store1], %[Temp1](%[cm]) \n\t" - "lbux %[store2], %[Temp2](%[cm]) \n\t" - "addqh_r.w %[store1], %[store1], %[scratch1] \n\t" /* pixel 3 */ - "addqh_r.w %[store2], %[store2], %[scratch2] \n\t" /* pixel 4 */ - - "sb %[store1], 2(%[dst_ptr]) \n\t" - "sb %[store2], 3(%[dst_ptr]) \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [p1] "=&r" (p1), [p2] "=&r" (p2), - [scratch1] "=&r" (scratch1), [scratch2] "=&r" (scratch2), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [store1] "=&r" (store1), [store2] "=&r" (store2), - [src_ptr] "+r" (src_ptr) - : [filter45] "r" (filter45), [vector4a] "r" (vector4a), - [src_stride] "r" (src_stride), [cm] "r" (cm), - [dst_ptr] "r" (dst_ptr) - ); - } - - /* Next row... */ - src += src_stride; - dst += dst_stride; - } -} - -static void convolve_bi_avg_vert_64_dspr2(const uint8_t *src, - int32_t src_stride, - uint8_t *dst, - int32_t dst_stride, - const int16_t *filter_y, - int32_t h) { - int32_t x, y; - const uint8_t *src_ptr; - uint8_t *dst_ptr; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector4a = 64; - uint32_t load1, load2; - uint32_t p1, p2; - uint32_t scratch1, scratch2; - uint32_t store1, store2; - int32_t Temp1, Temp2; - const int16_t *filter = &filter_y[3]; - uint32_t filter45;; - - filter45 = ((const int32_t *)filter)[0]; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_store(dst + dst_stride); - vp9_prefetch_store(dst + dst_stride + 32); - - for (x = 0; x < 64; x += 4) { - src_ptr = src + x; - dst_ptr = dst + x; - - __asm__ __volatile__ ( - "ulw %[load1], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load2], 0(%[src_ptr]) \n\t" - - "mtlo %[vector4a], $ac0 \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac0 \n\t" - "mthi $zero, $ac1 \n\t" - "mthi $zero, $ac2 \n\t" - "mthi $zero, $ac3 \n\t" - - "preceu.ph.qbr %[scratch1], %[load1] \n\t" - "preceu.ph.qbr %[p1], %[load2] \n\t" - "precrq.ph.w %[p2], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - - "dpa.w.ph $ac0, %[p1], %[filter45] \n\t" - "dpa.w.ph $ac1, %[p2], %[filter45] \n\t" - - "preceu.ph.qbl %[scratch1], %[load1] \n\t" - "preceu.ph.qbl %[p1], %[load2] \n\t" - "precrq.ph.w %[p2], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - - "dpa.w.ph $ac2, %[p1], %[filter45] \n\t" - "dpa.w.ph $ac3, %[p2], %[filter45] \n\t" - - "extp %[Temp1], $ac0, 31 \n\t" - "extp %[Temp2], $ac1, 31 \n\t" - - "lbu %[scratch1], 0(%[dst_ptr]) \n\t" - "lbu %[scratch2], 1(%[dst_ptr]) \n\t" - - "lbux %[store1], %[Temp1](%[cm]) \n\t" - "addqh_r.w %[store1], %[store1], %[scratch1] \n\t" /* pixel 1 */ - "extp %[Temp1], $ac2, 31 \n\t" - - "lbux %[store2], %[Temp2](%[cm]) \n\t" - "addqh_r.w %[store2], %[store2], %[scratch2] \n\t" /* pixel 2 */ - "extp %[Temp2], $ac3, 31 \n\t" - "lbu %[scratch1], 2(%[dst_ptr]) \n\t" - - "sb %[store1], 0(%[dst_ptr]) \n\t" - "sb %[store2], 1(%[dst_ptr]) \n\t" - "lbu %[scratch2], 3(%[dst_ptr]) \n\t" - - "lbux %[store1], %[Temp1](%[cm]) \n\t" - "lbux %[store2], %[Temp2](%[cm]) \n\t" - "addqh_r.w %[store1], %[store1], %[scratch1] \n\t" /* pixel 3 */ - "addqh_r.w %[store2], %[store2], %[scratch2] \n\t" /* pixel 4 */ - - "sb %[store1], 2(%[dst_ptr]) \n\t" - "sb %[store2], 3(%[dst_ptr]) \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [p1] "=&r" (p1), [p2] "=&r" (p2), - [scratch1] "=&r" (scratch1), [scratch2] "=&r" (scratch2), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [store1] "=&r" (store1), [store2] "=&r" (store2), - [src_ptr] "+r" (src_ptr) - : [filter45] "r" (filter45), [vector4a] "r" (vector4a), - [src_stride] "r" (src_stride), [cm] "r" (cm), - [dst_ptr] "r" (dst_ptr) - ); - } - - /* Next row... */ - src += src_stride; - dst += dst_stride; - } -} - -void vp9_convolve2_avg_vert_dspr2(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h) { - if (16 == y_step_q4) { - uint32_t pos = 38; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - vp9_prefetch_store(dst); - - switch (w) { - case 4: - case 8: - case 16: - case 32: - convolve_bi_avg_vert_4_dspr2(src, src_stride, - dst, dst_stride, - filter_y, w, h); - break; - case 64: - vp9_prefetch_store(dst + 32); - convolve_bi_avg_vert_64_dspr2(src, src_stride, - dst, dst_stride, - filter_y, h); - break; - default: - vp9_convolve8_avg_vert_c(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - break; - } - } else { - vp9_convolve8_avg_vert_c(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - } -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve2_avg_horiz_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve2_avg_horiz_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve2_avg_horiz_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve2_avg_horiz_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,833 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vpx_config.h" -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vpx/vpx_integer.h" -#include "vpx_ports/mem.h" -#include "vp9/common/vp9_convolve.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" - -#if HAVE_DSPR2 -static void convolve_bi_avg_horiz_4_dspr2(const uint8_t *src, - int32_t src_stride, - uint8_t *dst, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h) { - int32_t y; - uint8_t *cm = vp9_ff_cropTbl; - int32_t Temp1, Temp2, Temp3, Temp4; - uint32_t vector4a = 64; - uint32_t tp1, tp2; - uint32_t p1, p2, p3; - uint32_t tn1, tn2; - const int16_t *filter = &filter_x0[3]; - uint32_t filter45; - - filter45 = ((const int32_t *)filter)[0]; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - vp9_prefetch_store(dst + dst_stride); - - __asm__ __volatile__ ( - "ulw %[tp1], 0(%[src]) \n\t" - "ulw %[tp2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[tp1] \n\t" - "preceu.ph.qbl %[p2], %[tp1] \n\t" - "dpa.w.ph $ac3, %[p1], %[filter45] \n\t" - "extp %[Temp1], $ac3, 31 \n\t" - - /* even 2. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "balign %[tp2], %[tp1], 3 \n\t" - "dpa.w.ph $ac2, %[p2], %[filter45] \n\t" - "extp %[Temp3], $ac2, 31 \n\t" - - "lbu %[p2], 3(%[dst]) \n\t" /* load odd 2 */ - - /* odd 1. pixel */ - "lbux %[tp1], %[Temp1](%[cm]) \n\t" /* even 1 */ - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "lbu %[Temp1], 1(%[dst]) \n\t" /* load odd 1 */ - "preceu.ph.qbr %[p1], %[tp2] \n\t" - "preceu.ph.qbl %[p3], %[tp2] \n\t" - "dpa.w.ph $ac3, %[p1], %[filter45] \n\t" - "extp %[Temp2], $ac3, 31 \n\t" - - "lbu %[tn2], 0(%[dst]) \n\t" /* load even 1 */ - - /* odd 2. pixel */ - "lbux %[tp2], %[Temp3](%[cm]) \n\t" /* even 2 */ - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "lbux %[tn1], %[Temp2](%[cm]) \n\t" /* odd 1 */ - "addqh_r.w %[tn2], %[tn2], %[tp1] \n\t" /* average even 1 */ - "dpa.w.ph $ac2, %[p3], %[filter45] \n\t" - "extp %[Temp4], $ac2, 31 \n\t" - - "lbu %[tp1], 2(%[dst]) \n\t" /* load even 2 */ - "sb %[tn2], 0(%[dst]) \n\t" /* store even 1 */ - - /* clamp */ - "addqh_r.w %[Temp1], %[Temp1], %[tn1] \n\t" /* average odd 1 */ - "lbux %[p3], %[Temp4](%[cm]) \n\t" /* odd 2 */ - "sb %[Temp1], 1(%[dst]) \n\t" /* store odd 1 */ - - "addqh_r.w %[tp1], %[tp1], %[tp2] \n\t" /* average even 2 */ - "sb %[tp1], 2(%[dst]) \n\t" /* store even 2 */ - - "addqh_r.w %[p2], %[p2], %[p3] \n\t" /* average odd 2 */ - "sb %[p2], 3(%[dst]) \n\t" /* store odd 2 */ - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), - [tn1] "=&r" (tn1), [tn2] "=&r" (tn2), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=&r" (Temp4) - : [filter45] "r" (filter45), [vector4a] "r" (vector4a), - [cm] "r" (cm), [dst] "r" (dst), [src] "r" (src) - ); - - /* Next row... */ - src += src_stride; - dst += dst_stride; - } -} - -static void convolve_bi_avg_horiz_8_dspr2(const uint8_t *src, - int32_t src_stride, - uint8_t *dst, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h) { - int32_t y; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector4a = 64; - int32_t Temp1, Temp2, Temp3; - uint32_t tp1, tp2, tp3, tp4; - uint32_t p1, p2, p3, p4, n1; - uint32_t st0, st1; - const int16_t *filter = &filter_x0[3]; - uint32_t filter45;; - - filter45 = ((const int32_t *)filter)[0]; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - vp9_prefetch_store(dst + dst_stride); - - __asm__ __volatile__ ( - "ulw %[tp1], 0(%[src]) \n\t" - "ulw %[tp2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[tp1] \n\t" - "preceu.ph.qbl %[p2], %[tp1] \n\t" - "preceu.ph.qbr %[p3], %[tp2] \n\t" - "preceu.ph.qbl %[p4], %[tp2] \n\t" - "ulw %[tp3], 8(%[src]) \n\t" - "dpa.w.ph $ac3, %[p1], %[filter45] \n\t" - "extp %[Temp1], $ac3, 31 \n\t" - "lbu %[Temp2], 0(%[dst]) \n\t" - "lbu %[tp4], 2(%[dst]) \n\t" - - /* even 2. pixel */ - "dpa.w.ph $ac2, %[p2], %[filter45] \n\t" - "extp %[Temp3], $ac2, 31 \n\t" - - /* even 3. pixel */ - "lbux %[st0], %[Temp1](%[cm]) \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "lbux %[st1], %[Temp3](%[cm]) \n\t" - "dpa.w.ph $ac1, %[p3], %[filter45] \n\t" - "extp %[Temp1], $ac1, 31 \n\t" - - "addqh_r.w %[Temp2], %[Temp2], %[st0] \n\t" - "addqh_r.w %[tp4], %[tp4], %[st1] \n\t" - "sb %[Temp2], 0(%[dst]) \n\t" - "sb %[tp4], 2(%[dst]) \n\t" - - /* even 4. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "balign %[tp3], %[tp2], 3 \n\t" - "balign %[tp2], %[tp1], 3 \n\t" - - "lbux %[st0], %[Temp1](%[cm]) \n\t" - "lbu %[Temp2], 4(%[dst]) \n\t" - "addqh_r.w %[Temp2], %[Temp2], %[st0] \n\t" - - "dpa.w.ph $ac2, %[p4], %[filter45] \n\t" - "extp %[Temp3], $ac2, 31 \n\t" - - /* odd 1. pixel */ - "mtlo %[vector4a], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "sb %[Temp2], 4(%[dst]) \n\t" - "preceu.ph.qbr %[p1], %[tp2] \n\t" - "preceu.ph.qbl %[p2], %[tp2] \n\t" - "preceu.ph.qbr %[p3], %[tp3] \n\t" - "preceu.ph.qbl %[p4], %[tp3] \n\t" - "dpa.w.ph $ac3, %[p1], %[filter45] \n\t" - "extp %[Temp2], $ac3, 31 \n\t" - - "lbu %[tp1], 6(%[dst]) \n\t" - - /* odd 2. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "lbux %[st0], %[Temp3](%[cm]) \n\t" - "dpa.w.ph $ac1, %[p2], %[filter45] \n\t" - "extp %[Temp3], $ac1, 31 \n\t" - - "lbu %[tp2], 1(%[dst]) \n\t" - "lbu %[tp3], 3(%[dst]) \n\t" - "addqh_r.w %[tp1], %[tp1], %[st0] \n\t" - - /* odd 3. pixel */ - "lbux %[st1], %[Temp2](%[cm]) \n\t" - "dpa.w.ph $ac3, %[p3], %[filter45] \n\t" - "addqh_r.w %[tp2], %[tp2], %[st1] \n\t" - "extp %[Temp2], $ac3, 31 \n\t" - - "lbu %[tp4], 5(%[dst]) \n\t" - - /* odd 4. pixel */ - "sb %[tp2], 1(%[dst]) \n\t" - "sb %[tp1], 6(%[dst]) \n\t" - "dpa.w.ph $ac2, %[p4], %[filter45] \n\t" - "extp %[Temp1], $ac2, 31 \n\t" - - "lbu %[tp1], 7(%[dst]) \n\t" - - /* clamp */ - "lbux %[p4], %[Temp3](%[cm]) \n\t" - "addqh_r.w %[tp3], %[tp3], %[p4] \n\t" - - "lbux %[p2], %[Temp2](%[cm]) \n\t" - "addqh_r.w %[tp4], %[tp4], %[p2] \n\t" - - "lbux %[p1], %[Temp1](%[cm]) \n\t" - "addqh_r.w %[tp1], %[tp1], %[p1] \n\t" - - /* store bytes */ - "sb %[tp3], 3(%[dst]) \n\t" - "sb %[tp4], 5(%[dst]) \n\t" - "sb %[tp1], 7(%[dst]) \n\t" - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), - [tp3] "=&r" (tp3), [tp4] "=&r" (tp4), - [st0] "=&r" (st0), [st1] "=&r" (st1), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4), - [n1] "=&r" (n1), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3) - : [filter45] "r" (filter45), [vector4a] "r" (vector4a), - [cm] "r" (cm), [dst] "r" (dst), [src] "r" (src) - ); - - /* Next row... */ - src += src_stride; - dst += dst_stride; - } -} - -static void convolve_bi_avg_horiz_16_dspr2(const uint8_t *src_ptr, - int32_t src_stride, - uint8_t *dst_ptr, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h, - int32_t count) { - int32_t y, c; - const uint8_t *src; - uint8_t *dst; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector_64 = 64; - int32_t Temp1, Temp2, Temp3; - uint32_t qload1, qload2, qload3; - uint32_t p1, p2, p3, p4, p5; - uint32_t st1, st2, st3; - const int16_t *filter = &filter_x0[3]; - uint32_t filter45;; - - filter45 = ((const int32_t *)filter)[0]; - - for (y = h; y--;) { - src = src_ptr; - dst = dst_ptr; - - /* prefetch data to cache memory */ - vp9_prefetch_load(src_ptr + src_stride); - vp9_prefetch_load(src_ptr + src_stride + 32); - vp9_prefetch_store(dst_ptr + dst_stride); - - for (c = 0; c < count; c++) { - __asm__ __volatile__ ( - "ulw %[qload1], 0(%[src]) \n\t" - "ulw %[qload2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 1 */ - "mthi $zero, $ac1 \n\t" - "mtlo %[vector_64], $ac2 \n\t" /* even 2 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "ulw %[qload3], 8(%[src]) \n\t" - "dpa.w.ph $ac1, %[p1], %[filter45] \n\t" /* even 1 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 1 */ - "lbu %[st2], 0(%[dst]) \n\t" /* load even 1 from dst */ - - /* even 2. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 3 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[qload3] \n\t" - "preceu.ph.qbl %[p5], %[qload3] \n\t" - "ulw %[qload1], 12(%[src]) \n\t" - "dpa.w.ph $ac2, %[p2], %[filter45] \n\t" /* even 1 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 1 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 1 */ - - "lbu %[qload3], 2(%[dst]) \n\t" /* load even 2 from dst */ - - /* even 3. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 4 */ - "mthi $zero, $ac1 \n\t" - "addqh_r.w %[st2], %[st2], %[st1] \n\t" /* average even 1 */ - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "sb %[st2], 0(%[dst]) \n\t" /* store even 1 to dst */ - "dpa.w.ph $ac3, %[p3], %[filter45] \n\t" /* even 3 */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 3 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 1 */ - - /* even 4. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 5 */ - "mthi $zero, $ac2 \n\t" - "addqh_r.w %[qload3], %[qload3], %[st2] \n\t" /* average even 2 */ - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[qload3], 2(%[dst]) \n\t" /* store even 2 to dst */ - "lbu %[qload3], 4(%[dst]) \n\t" /* load even 3 from dst */ - "lbu %[qload1], 6(%[dst]) \n\t" /* load even 4 from dst */ - "dpa.w.ph $ac1, %[p4], %[filter45] \n\t" /* even 4 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 4 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 3 */ - - /* even 5. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 6 */ - "mthi $zero, $ac3 \n\t" - "addqh_r.w %[qload3], %[qload3], %[st3] \n\t" /* average even 3 */ - "sb %[qload3], 4(%[dst]) \n\t" /* store even 3 to dst */ - "dpa.w.ph $ac2, %[p1], %[filter45] \n\t" /* even 5 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 5 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 4 */ - - /* even 6. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 7 */ - "mthi $zero, $ac1 \n\t" - "addqh_r.w %[qload1], %[qload1], %[st1] \n\t" /* average even 4 */ - "sb %[qload1], 6(%[dst]) \n\t" /* store even 4 to dst */ - "dpa.w.ph $ac3, %[p5], %[filter45] \n\t" /* even 6 */ - "lbu %[qload2], 8(%[dst]) \n\t" /* load even 5 from dst */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 6 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 5 */ - - /* even 7. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 8 */ - "mthi $zero, $ac2 \n\t" - "addqh_r.w %[qload2], %[qload2], %[st2] \n\t" /* average even 5 */ - "sb %[qload2], 8(%[dst]) \n\t" /* store even 5 to dst */ - "dpa.w.ph $ac1, %[p2], %[filter45] \n\t" /* even 7 */ - "lbu %[qload3], 10(%[dst]) \n\t" /* load even 6 from dst */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 7 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 6 */ - - "lbu %[st2], 12(%[dst]) \n\t" /* load even 7 from dst */ - - /* even 8. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 1 */ - "mthi $zero, $ac3 \n\t" - "addqh_r.w %[qload3], %[qload3], %[st3] \n\t" /* average even 6 */ - "dpa.w.ph $ac2, %[p3], %[filter45] \n\t" /* even 8 */ - "sb %[qload3], 10(%[dst]) \n\t" /* store even 6 to dst */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 8 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 7 */ - - /* ODD pixels */ - "ulw %[qload1], 1(%[src]) \n\t" - "ulw %[qload2], 5(%[src]) \n\t" - - "addqh_r.w %[st2], %[st2], %[st1] \n\t" /* average even 7 */ - - /* odd 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 2 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "sb %[st2], 12(%[dst]) \n\t" /* store even 7 to dst */ - "ulw %[qload3], 9(%[src]) \n\t" - "dpa.w.ph $ac3, %[p1], %[filter45] \n\t" /* odd 1 */ - "lbu %[qload2], 14(%[dst]) \n\t" /* load even 8 from dst */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 1 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 8 */ - - "lbu %[st1], 1(%[dst]) \n\t" /* load odd 1 from dst */ - - /* odd 2. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 3 */ - "mthi $zero, $ac2 \n\t" - "addqh_r.w %[qload2], %[qload2], %[st2] \n\t" /* average even 8 */ - "preceu.ph.qbr %[p1], %[qload3] \n\t" - "preceu.ph.qbl %[p5], %[qload3] \n\t" - "sb %[qload2], 14(%[dst]) \n\t" /* store even 8 to dst */ - "ulw %[qload1], 13(%[src]) \n\t" - "dpa.w.ph $ac1, %[p2], %[filter45] \n\t" /* odd 2 */ - "lbu %[qload3], 3(%[dst]) \n\t" /* load odd 2 from dst */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 2 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 1 */ - - /* odd 3. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 4 */ - "mthi $zero, $ac3 \n\t" - "addqh_r.w %[st3], %[st3], %[st1] \n\t" /* average odd 1 */ - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "dpa.w.ph $ac2, %[p3], %[filter45] \n\t" /* odd 3 */ - "sb %[st3], 1(%[dst]) \n\t" /* store odd 1 to dst */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 3 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 2 */ - - /* odd 4. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 5 */ - "mthi $zero, $ac1 \n\t" - "addqh_r.w %[qload3], %[qload3], %[st1] \n\t" /* average odd 2 */ - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[qload3], 3(%[dst]) \n\t" /* store odd 2 to dst */ - "lbu %[qload1], 5(%[dst]) \n\t" /* load odd 3 from dst */ - "dpa.w.ph $ac3, %[p4], %[filter45] \n\t" /* odd 4 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 4 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 3 */ - - "lbu %[st1], 7(%[dst]) \n\t" /* load odd 4 from dst */ - - /* odd 5. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 6 */ - "mthi $zero, $ac2 \n\t" - "addqh_r.w %[qload1], %[qload1], %[st2] \n\t" /* average odd 3 */ - "sb %[qload1], 5(%[dst]) \n\t" /* store odd 3 to dst */ - "dpa.w.ph $ac1, %[p1], %[filter45] \n\t" /* odd 5 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 5 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 4 */ - - "lbu %[qload1], 9(%[dst]) \n\t" /* load odd 5 from dst */ - - /* odd 6. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 7 */ - "mthi $zero, $ac3 \n\t" - "addqh_r.w %[st1], %[st1], %[st3] \n\t" /* average odd 4 */ - "sb %[st1], 7(%[dst]) \n\t" /* store odd 4 to dst */ - "dpa.w.ph $ac2, %[p5], %[filter45] \n\t" /* odd 6 */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 6 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 5 */ - - /* odd 7. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 8 */ - "mthi $zero, $ac1 \n\t" - "addqh_r.w %[qload1], %[qload1], %[st1] \n\t" /* average odd 5 */ - "sb %[qload1], 9(%[dst]) \n\t" /* store odd 5 to dst */ - "lbu %[qload2], 11(%[dst]) \n\t" /* load odd 6 from dst */ - "dpa.w.ph $ac3, %[p2], %[filter45] \n\t" /* odd 7 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 7 */ - - "lbu %[qload3], 13(%[dst]) \n\t" /* load odd 7 from dst */ - - /* odd 8. pixel */ - "dpa.w.ph $ac1, %[p3], %[filter45] \n\t" /* odd 8 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 8 */ - - "lbu %[qload1], 15(%[dst]) \n\t" /* load odd 8 from dst */ - - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 6 */ - "addqh_r.w %[qload2], %[qload2], %[st2] \n\t" /* average odd 6 */ - - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 7 */ - "addqh_r.w %[qload3], %[qload3], %[st3] \n\t" /* average odd 7 */ - - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 8 */ - "addqh_r.w %[qload1], %[qload1], %[st1] \n\t" /* average odd 8 */ - - "sb %[qload2], 11(%[dst]) \n\t" /* store odd 6 to dst */ - "sb %[qload3], 13(%[dst]) \n\t" /* store odd 7 to dst */ - "sb %[qload1], 15(%[dst]) \n\t" /* store odd 8 to dst */ - - : [qload1] "=&r" (qload1), [qload2] "=&r" (qload2), - [st1] "=&r" (st1), [st2] "=&r" (st2), [st3] "=&r" (st3), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4), - [qload3] "=&r" (qload3), [p5] "=&r" (p5), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3) - : [filter45] "r" (filter45), [vector_64] "r" (vector_64), - [cm] "r" (cm), [dst] "r" (dst), [src] "r" (src) - ); - - src += 16; - dst += 16; - } - - /* Next row... */ - src_ptr += src_stride; - dst_ptr += dst_stride; - } -} - -static void convolve_bi_avg_horiz_64_dspr2(const uint8_t *src_ptr, - int32_t src_stride, - uint8_t *dst_ptr, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h) { - int32_t y, c; - const uint8_t *src; - uint8_t *dst; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector_64 = 64; - int32_t Temp1, Temp2, Temp3; - uint32_t qload1, qload2, qload3; - uint32_t p1, p2, p3, p4, p5; - uint32_t st1, st2, st3; - const int16_t *filter = &filter_x0[3]; - uint32_t filter45;; - - filter45 = ((const int32_t *)filter)[0]; - - for (y = h; y--;) { - src = src_ptr; - dst = dst_ptr; - - /* prefetch data to cache memory */ - vp9_prefetch_load(src_ptr + src_stride); - vp9_prefetch_load(src_ptr + src_stride + 32); - vp9_prefetch_load(src_ptr + src_stride + 64); - vp9_prefetch_store(dst_ptr + dst_stride); - vp9_prefetch_store(dst_ptr + dst_stride + 32); - - for (c = 0; c < 4; c++) { - __asm__ __volatile__ ( - "ulw %[qload1], 0(%[src]) \n\t" - "ulw %[qload2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 1 */ - "mthi $zero, $ac1 \n\t" - "mtlo %[vector_64], $ac2 \n\t" /* even 2 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "ulw %[qload3], 8(%[src]) \n\t" - "dpa.w.ph $ac1, %[p1], %[filter45] \n\t" /* even 1 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 1 */ - "lbu %[st2], 0(%[dst]) \n\t" /* load even 1 from dst */ - - /* even 2. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 3 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[qload3] \n\t" - "preceu.ph.qbl %[p5], %[qload3] \n\t" - "ulw %[qload1], 12(%[src]) \n\t" - "dpa.w.ph $ac2, %[p2], %[filter45] \n\t" /* even 1 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 1 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 1 */ - - "lbu %[qload3], 2(%[dst]) \n\t" /* load even 2 from dst */ - - /* even 3. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 4 */ - "mthi $zero, $ac1 \n\t" - "addqh_r.w %[st2], %[st2], %[st1] \n\t" /* average even 1 */ - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "sb %[st2], 0(%[dst]) \n\t" /* store even 1 to dst */ - "dpa.w.ph $ac3, %[p3], %[filter45] \n\t" /* even 3 */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 3 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 1 */ - - /* even 4. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 5 */ - "mthi $zero, $ac2 \n\t" - "addqh_r.w %[qload3], %[qload3], %[st2] \n\t" /* average even 2 */ - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[qload3], 2(%[dst]) \n\t" /* store even 2 to dst */ - "lbu %[qload3], 4(%[dst]) \n\t" /* load even 3 from dst */ - "lbu %[qload1], 6(%[dst]) \n\t" /* load even 4 from dst */ - "dpa.w.ph $ac1, %[p4], %[filter45] \n\t" /* even 4 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 4 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 3 */ - - /* even 5. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 6 */ - "mthi $zero, $ac3 \n\t" - "addqh_r.w %[qload3], %[qload3], %[st3] \n\t" /* average even 3 */ - "sb %[qload3], 4(%[dst]) \n\t" /* store even 3 to dst */ - "dpa.w.ph $ac2, %[p1], %[filter45] \n\t" /* even 5 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 5 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 4 */ - - /* even 6. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 7 */ - "mthi $zero, $ac1 \n\t" - "addqh_r.w %[qload1], %[qload1], %[st1] \n\t" /* average even 4 */ - "sb %[qload1], 6(%[dst]) \n\t" /* store even 4 to dst */ - "dpa.w.ph $ac3, %[p5], %[filter45] \n\t" /* even 6 */ - "lbu %[qload2], 8(%[dst]) \n\t" /* load even 5 from dst */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 6 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 5 */ - - /* even 7. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 8 */ - "mthi $zero, $ac2 \n\t" - "addqh_r.w %[qload2], %[qload2], %[st2] \n\t" /* average even 5 */ - "sb %[qload2], 8(%[dst]) \n\t" /* store even 5 to dst */ - "dpa.w.ph $ac1, %[p2], %[filter45] \n\t" /* even 7 */ - "lbu %[qload3], 10(%[dst]) \n\t" /* load even 6 from dst */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 7 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 6 */ - - "lbu %[st2], 12(%[dst]) \n\t" /* load even 7 from dst */ - - /* even 8. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 1 */ - "mthi $zero, $ac3 \n\t" - "addqh_r.w %[qload3], %[qload3], %[st3] \n\t" /* average even 6 */ - "dpa.w.ph $ac2, %[p3], %[filter45] \n\t" /* even 8 */ - "sb %[qload3], 10(%[dst]) \n\t" /* store even 6 to dst */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 8 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 7 */ - - /* ODD pixels */ - "ulw %[qload1], 1(%[src]) \n\t" - "ulw %[qload2], 5(%[src]) \n\t" - - "addqh_r.w %[st2], %[st2], %[st1] \n\t" /* average even 7 */ - - /* odd 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 2 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "sb %[st2], 12(%[dst]) \n\t" /* store even 7 to dst */ - "ulw %[qload3], 9(%[src]) \n\t" - "dpa.w.ph $ac3, %[p1], %[filter45] \n\t" /* odd 1 */ - "lbu %[qload2], 14(%[dst]) \n\t" /* load even 8 from dst */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 1 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 8 */ - - "lbu %[st1], 1(%[dst]) \n\t" /* load odd 1 from dst */ - - /* odd 2. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 3 */ - "mthi $zero, $ac2 \n\t" - "addqh_r.w %[qload2], %[qload2], %[st2] \n\t" /* average even 8 */ - "preceu.ph.qbr %[p1], %[qload3] \n\t" - "preceu.ph.qbl %[p5], %[qload3] \n\t" - "sb %[qload2], 14(%[dst]) \n\t" /* store even 8 to dst */ - "ulw %[qload1], 13(%[src]) \n\t" - "dpa.w.ph $ac1, %[p2], %[filter45] \n\t" /* odd 2 */ - "lbu %[qload3], 3(%[dst]) \n\t" /* load odd 2 from dst */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 2 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 1 */ - - /* odd 3. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 4 */ - "mthi $zero, $ac3 \n\t" - "addqh_r.w %[st3], %[st3], %[st1] \n\t" /* average odd 1 */ - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "dpa.w.ph $ac2, %[p3], %[filter45] \n\t" /* odd 3 */ - "sb %[st3], 1(%[dst]) \n\t" /* store odd 1 to dst */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 3 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 2 */ - - /* odd 4. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 5 */ - "mthi $zero, $ac1 \n\t" - "addqh_r.w %[qload3], %[qload3], %[st1] \n\t" /* average odd 2 */ - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[qload3], 3(%[dst]) \n\t" /* store odd 2 to dst */ - "lbu %[qload1], 5(%[dst]) \n\t" /* load odd 3 from dst */ - "dpa.w.ph $ac3, %[p4], %[filter45] \n\t" /* odd 4 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 4 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 3 */ - - "lbu %[st1], 7(%[dst]) \n\t" /* load odd 4 from dst */ - - /* odd 5. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 6 */ - "mthi $zero, $ac2 \n\t" - "addqh_r.w %[qload1], %[qload1], %[st2] \n\t" /* average odd 3 */ - "sb %[qload1], 5(%[dst]) \n\t" /* store odd 3 to dst */ - "dpa.w.ph $ac1, %[p1], %[filter45] \n\t" /* odd 5 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 5 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 4 */ - - "lbu %[qload1], 9(%[dst]) \n\t" /* load odd 5 from dst */ - - /* odd 6. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 7 */ - "mthi $zero, $ac3 \n\t" - "addqh_r.w %[st1], %[st1], %[st3] \n\t" /* average odd 4 */ - "sb %[st1], 7(%[dst]) \n\t" /* store odd 4 to dst */ - "dpa.w.ph $ac2, %[p5], %[filter45] \n\t" /* odd 6 */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 6 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 5 */ - - /* odd 7. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 8 */ - "mthi $zero, $ac1 \n\t" - "addqh_r.w %[qload1], %[qload1], %[st1] \n\t" /* average odd 5 */ - "sb %[qload1], 9(%[dst]) \n\t" /* store odd 5 to dst */ - "lbu %[qload2], 11(%[dst]) \n\t" /* load odd 6 from dst */ - "dpa.w.ph $ac3, %[p2], %[filter45] \n\t" /* odd 7 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 7 */ - - "lbu %[qload3], 13(%[dst]) \n\t" /* load odd 7 from dst */ - - /* odd 8. pixel */ - "dpa.w.ph $ac1, %[p3], %[filter45] \n\t" /* odd 8 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 8 */ - - "lbu %[qload1], 15(%[dst]) \n\t" /* load odd 8 from dst */ - - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 6 */ - "addqh_r.w %[qload2], %[qload2], %[st2] \n\t" /* average odd 6 */ - - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 7 */ - "addqh_r.w %[qload3], %[qload3], %[st3] \n\t" /* average odd 7 */ - - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 8 */ - "addqh_r.w %[qload1], %[qload1], %[st1] \n\t" /* average odd 8 */ - - "sb %[qload2], 11(%[dst]) \n\t" /* store odd 6 to dst */ - "sb %[qload3], 13(%[dst]) \n\t" /* store odd 7 to dst */ - "sb %[qload1], 15(%[dst]) \n\t" /* store odd 8 to dst */ - - : [qload1] "=&r" (qload1), [qload2] "=&r" (qload2), - [st1] "=&r" (st1), [st2] "=&r" (st2), [st3] "=&r" (st3), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4), - [qload3] "=&r" (qload3), [p5] "=&r" (p5), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3) - : [filter45] "r" (filter45), [vector_64] "r" (vector_64), - [cm] "r" (cm), [dst] "r" (dst), [src] "r" (src) - ); - - src += 16; - dst += 16; - } - - /* Next row... */ - src_ptr += src_stride; - dst_ptr += dst_stride; - } -} - -void vp9_convolve2_avg_horiz_dspr2(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h) { - if (16 == x_step_q4) { - uint32_t pos = 38; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - /* prefetch data to cache memory */ - vp9_prefetch_load(src); - vp9_prefetch_load(src + 32); - vp9_prefetch_store(dst); - - switch (w) { - case 4: - convolve_bi_avg_horiz_4_dspr2(src, src_stride, - dst, dst_stride, - filter_x, h); - break; - case 8: - convolve_bi_avg_horiz_8_dspr2(src, src_stride, - dst, dst_stride, - filter_x, h); - break; - case 16: - convolve_bi_avg_horiz_16_dspr2(src, src_stride, - dst, dst_stride, - filter_x, h, 1); - break; - case 32: - convolve_bi_avg_horiz_16_dspr2(src, src_stride, - dst, dst_stride, - filter_x, h, 2); - break; - case 64: - vp9_prefetch_load(src + 64); - vp9_prefetch_store(dst + 32); - - convolve_bi_avg_horiz_64_dspr2(src, src_stride, - dst, dst_stride, - filter_x, h); - break; - default: - vp9_convolve8_avg_horiz_c(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - break; - } - } else { - vp9_convolve8_avg_horiz_c(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - } -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve2_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve2_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve2_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve2_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,784 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vpx_config.h" -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vpx/vpx_integer.h" -#include "vpx_ports/mem.h" -#include "vp9/common/vp9_filter.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" - -#if HAVE_DSPR2 -static void convolve_bi_horiz_4_transposed_dspr2(const uint8_t *src, - int32_t src_stride, - uint8_t *dst, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h) { - int32_t y; - uint8_t *cm = vp9_ff_cropTbl; - uint8_t *dst_ptr; - int32_t Temp1, Temp2; - uint32_t vector4a = 64; - uint32_t tp1, tp2; - uint32_t p1, p2; - const int16_t *filter = &filter_x0[3]; - uint32_t filter45; - - filter45 = ((const int32_t *)filter)[0]; - - for (y = h; y--;) { - dst_ptr = dst; - /* prefetch data to cache memory */ - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - - __asm__ __volatile__ ( - "ulw %[tp1], 0(%[src]) \n\t" - "ulw %[tp2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[tp1] \n\t" - "preceu.ph.qbl %[p2], %[tp1] \n\t" - "dpa.w.ph $ac3, %[p1], %[filter45] \n\t" - "extp %[Temp1], $ac3, 31 \n\t" - - /* even 2. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "balign %[tp2], %[tp1], 3 \n\t" - "dpa.w.ph $ac2, %[p2], %[filter45] \n\t" - "extp %[Temp2], $ac2, 31 \n\t" - - /* odd 1. pixel */ - "lbux %[tp1], %[Temp1](%[cm]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[tp2] \n\t" - "preceu.ph.qbl %[p2], %[tp2] \n\t" - "dpa.w.ph $ac3, %[p1], %[filter45] \n\t" - "extp %[Temp1], $ac3, 31 \n\t" - - /* odd 2. pixel */ - "lbux %[tp2], %[Temp2](%[cm]) \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "dpa.w.ph $ac2, %[p2], %[filter45] \n\t" - "extp %[Temp2], $ac2, 31 \n\t" - - /* clamp */ - "lbux %[p1], %[Temp1](%[cm]) \n\t" - "lbux %[p2], %[Temp2](%[cm]) \n\t" - - /* store bytes */ - "sb %[tp1], 0(%[dst_ptr]) \n\t" - "addu %[dst_ptr], %[dst_ptr], %[dst_stride] \n\t" - - "sb %[p1], 0(%[dst_ptr]) \n\t" - "addu %[dst_ptr], %[dst_ptr], %[dst_stride] \n\t" - - "sb %[tp2], 0(%[dst_ptr]) \n\t" - "addu %[dst_ptr], %[dst_ptr], %[dst_stride] \n\t" - - "sb %[p2], 0(%[dst_ptr]) \n\t" - "addu %[dst_ptr], %[dst_ptr], %[dst_stride] \n\t" - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), - [p1] "=&r" (p1), [p2] "=&r" (p2), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [dst_ptr] "+r" (dst_ptr) - : [filter45] "r" (filter45),[vector4a] "r" (vector4a), - [cm] "r" (cm), [src] "r" (src), [dst_stride] "r" (dst_stride) - ); - - /* Next row... */ - src += src_stride; - dst += 1; - } -} - -static void convolve_bi_horiz_8_transposed_dspr2(const uint8_t *src, - int32_t src_stride, - uint8_t *dst, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h) { - int32_t y; - uint8_t *cm = vp9_ff_cropTbl; - uint8_t *dst_ptr; - uint32_t vector4a = 64; - int32_t Temp1, Temp2, Temp3; - uint32_t tp1, tp2, tp3; - uint32_t p1, p2, p3, p4; - uint8_t *odd_dst; - uint32_t dst_pitch_2 = (dst_stride << 1); - const int16_t *filter = &filter_x0[3]; - uint32_t filter45; - - filter45 = ((const int32_t *)filter)[0]; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - - dst_ptr = dst; - odd_dst = (dst_ptr + dst_stride); - - __asm__ __volatile__ ( - "ulw %[tp1], 0(%[src]) \n\t" - "ulw %[tp2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[tp1] \n\t" - "preceu.ph.qbl %[p2], %[tp1] \n\t" - "preceu.ph.qbr %[p3], %[tp2] \n\t" - "preceu.ph.qbl %[p4], %[tp2] \n\t" - "ulw %[tp3], 8(%[src]) \n\t" - "dpa.w.ph $ac3, %[p1], %[filter45] \n\t" - "extp %[Temp1], $ac3, 31 \n\t" - - /* even 2. pixel */ - "dpa.w.ph $ac2, %[p2], %[filter45] \n\t" - "extp %[Temp3], $ac2, 31 \n\t" - - /* even 3. pixel */ - "lbux %[Temp2], %[Temp1](%[cm]) \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "balign %[tp3], %[tp2], 3 \n\t" - "balign %[tp2], %[tp1], 3 \n\t" - "dpa.w.ph $ac1, %[p3], %[filter45] \n\t" - "lbux %[tp1], %[Temp3](%[cm]) \n\t" - "extp %[p3], $ac1, 31 \n\t" - - /* even 4. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "sb %[Temp2], 0(%[dst_ptr]) \n\t" - "addu %[dst_ptr], %[dst_ptr], %[dst_pitch_2] \n\t" - "sb %[tp1], 0(%[dst_ptr]) \n\t" - "addu %[dst_ptr], %[dst_ptr], %[dst_pitch_2] \n\t" - - "dpa.w.ph $ac2, %[p4], %[filter45] \n\t" - "extp %[Temp3], $ac2, 31 \n\t" - - "lbux %[Temp1], %[p3](%[cm]) \n\t" - - /* odd 1. pixel */ - "mtlo %[vector4a], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p1], %[tp2] \n\t" - "preceu.ph.qbl %[p2], %[tp2] \n\t" - "preceu.ph.qbr %[p3], %[tp3] \n\t" - "preceu.ph.qbl %[p4], %[tp3] \n\t" - "sb %[Temp1], 0(%[dst_ptr]) \n\t" - "addu %[dst_ptr], %[dst_ptr], %[dst_pitch_2] \n\t" - - "dpa.w.ph $ac3, %[p1], %[filter45] \n\t" - "extp %[Temp2], $ac3, 31 \n\t" - - /* odd 2. pixel */ - "lbux %[tp1], %[Temp3](%[cm]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "dpa.w.ph $ac1, %[p2], %[filter45] \n\t" - "sb %[tp1], 0(%[dst_ptr]) \n\t" - "addu %[dst_ptr], %[dst_ptr], %[dst_pitch_2] \n\t" - "extp %[Temp3], $ac1, 31 \n\t" - - /* odd 3. pixel */ - "lbux %[tp3], %[Temp2](%[cm]) \n\t" - "dpa.w.ph $ac3, %[p3], %[filter45] \n\t" - "extp %[Temp2], $ac3, 31 \n\t" - - /* odd 4. pixel */ - "sb %[tp3], 0(%[odd_dst]) \n\t" - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac2, %[p4], %[filter45] \n\t" - "extp %[Temp1], $ac2, 31 \n\t" - - /* clamp */ - "lbux %[p4], %[Temp3](%[cm]) \n\t" - "lbux %[p2], %[Temp2](%[cm]) \n\t" - "lbux %[p1], %[Temp1](%[cm]) \n\t" - - /* store bytes */ - "sb %[p4], 0(%[odd_dst]) \n\t" - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - - "sb %[p2], 0(%[odd_dst]) \n\t" - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - - "sb %[p1], 0(%[odd_dst]) \n\t" - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), [tp3] "=&r" (tp3), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3), - [dst_ptr] "+r" (dst_ptr), [odd_dst] "+r" (odd_dst) - : [filter45] "r" (filter45),[vector4a] "r" (vector4a), [cm] "r" (cm), - [src] "r" (src), [dst_pitch_2] "r" (dst_pitch_2) - ); - - /* Next row... */ - src += src_stride; - dst += 1; - } -} - -static void convolve_bi_horiz_16_transposed_dspr2(const uint8_t *src_ptr, - int32_t src_stride, - uint8_t *dst_ptr, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h, - int32_t count) { - int32_t c, y; - const uint8_t *src; - uint8_t *dst; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector_64 = 64; - int32_t Temp1, Temp2, Temp3; - uint32_t qload1, qload2; - uint32_t p1, p2, p3, p4, p5; - uint32_t st1, st2, st3; - uint32_t dst_pitch_2 = (dst_stride << 1); - uint8_t *odd_dst; - const int16_t *filter = &filter_x0[3]; - uint32_t filter45; - - filter45 = ((const int32_t *)filter)[0]; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_load(src_ptr + src_stride); - vp9_prefetch_load(src_ptr + src_stride + 32); - - src = src_ptr; - dst = dst_ptr; - - odd_dst = (dst + dst_stride); - - for (c = 0; c < count; c++) { - __asm__ __volatile__ ( - "ulw %[qload1], 0(%[src]) \n\t" - "ulw %[qload2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 1 */ - "mthi $zero, $ac1 \n\t" - "mtlo %[vector_64], $ac2 \n\t" /* even 2 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "ulw %[qload1], 8(%[src]) \n\t" - "dpa.w.ph $ac1, %[p1], %[filter45] \n\t" /* even 1 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 1 */ - - /* even 2. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 3 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p5], %[qload1] \n\t" - "ulw %[qload2], 12(%[src]) \n\t" - "dpa.w.ph $ac2, %[p2], %[filter45] \n\t" /* even 1 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 1 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 1 */ - - /* even 3. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 4 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p2], %[qload2] \n\t" - "sb %[st1], 0(%[dst]) \n\t" /* even 1 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac3, %[p3], %[filter45] \n\t" /* even 3 */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 3 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 1 */ - - /* even 4. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 5 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbl %[p3], %[qload2] \n\t" - "sb %[st2], 0(%[dst]) \n\t" /* even 2 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac1, %[p4], %[filter45] \n\t" /* even 4 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 4 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 3 */ - - /* even 5. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 6 */ - "mthi $zero, $ac3 \n\t" - "sb %[st3], 0(%[dst]) \n\t" /* even 3 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac2, %[p1], %[filter45] \n\t" /* even 5 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 5 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 4 */ - - /* even 6. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 7 */ - "mthi $zero, $ac1 \n\t" - "sb %[st1], 0(%[dst]) \n\t" /* even 4 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "ulw %[qload1], 20(%[src]) \n\t" - "dpa.w.ph $ac3, %[p5], %[filter45] \n\t" /* even 6 */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 6 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 5 */ - - /* even 7. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 8 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p5], %[qload1] \n\t" - "sb %[st2], 0(%[dst]) \n\t" /* even 5 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac1, %[p2], %[filter45] \n\t" /* even 7 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 7 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 6 */ - - /* even 8. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 1 */ - "mthi $zero, $ac3 \n\t" - "dpa.w.ph $ac2, %[p3], %[filter45] \n\t" /* even 8 */ - "sb %[st3], 0(%[dst]) \n\t" /* even 6 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "extp %[Temp2], $ac2, 31 \n\t" /* even 8 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 7 */ - - /* ODD pixels */ - "ulw %[qload1], 1(%[src]) \n\t" - "ulw %[qload2], 5(%[src]) \n\t" - - /* odd 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 2 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "sb %[st1], 0(%[dst]) \n\t" /* even 7 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "ulw %[qload2], 9(%[src]) \n\t" - "dpa.w.ph $ac3, %[p1], %[filter45] \n\t" /* odd 1 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 1 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 8 */ - - /* odd 2. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 3 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[qload2] \n\t" - "preceu.ph.qbl %[p5], %[qload2] \n\t" - "sb %[st2], 0(%[dst]) \n\t" /* even 8 */ - "ulw %[qload1], 13(%[src]) \n\t" - "dpa.w.ph $ac1, %[p2], %[filter45] \n\t" /* odd 2 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 2 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 1 */ - - /* odd 3. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 4 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "sb %[st3], 0(%[odd_dst]) \n\t" /* odd 1 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac2, %[p3], %[filter45] \n\t" /* odd 3 */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 3 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 2 */ - - /* odd 4. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 5 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[st1], 0(%[odd_dst]) \n\t" /* odd 2 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac3, %[p4], %[filter45] \n\t" /* odd 4 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 4 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 3 */ - - /* odd 5. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 6 */ - "mthi $zero, $ac2 \n\t" - "sb %[st2], 0(%[odd_dst]) \n\t" /* odd 3 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac1, %[p1], %[filter45] \n\t" /* odd 5 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 5 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 4 */ - - /* odd 6. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 7 */ - "mthi $zero, $ac3 \n\t" - "sb %[st3], 0(%[odd_dst]) \n\t" /* odd 4 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "ulw %[qload1], 21(%[src]) \n\t" - "dpa.w.ph $ac2, %[p5], %[filter45] \n\t" /* odd 6 */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 6 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 5 */ - - /* odd 7. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 8 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p5], %[qload1] \n\t" - "sb %[st1], 0(%[odd_dst]) \n\t" /* odd 5 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac3, %[p2], %[filter45] \n\t" /* odd 7 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 7 */ - - /* odd 8. pixel */ - "dpa.w.ph $ac1, %[p3], %[filter45] \n\t" /* odd 8 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 8 */ - - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 6 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 7 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 8 */ - - "sb %[st2], 0(%[odd_dst]) \n\t" /* odd 6 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - - "sb %[st3], 0(%[odd_dst]) \n\t" /* odd 7 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - - "sb %[st1], 0(%[odd_dst]) \n\t" /* odd 8 */ - - : [qload1] "=&r" (qload1), [qload2] "=&r" (qload2), [p5] "=&r" (p5), - [st1] "=&r" (st1), [st2] "=&r" (st2), [st3] "=&r" (st3), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3), - [dst] "+r" (dst), [odd_dst] "+r" (odd_dst) - : [filter45] "r" (filter45), [vector_64] "r" (vector_64), - [cm] "r" (cm), - [src] "r" (src), [dst_pitch_2] "r" (dst_pitch_2) - ); - - src += 16; - dst = (dst_ptr + ((c + 1) * 16 * dst_stride)); - odd_dst = (dst + dst_stride); - } - - /* Next row... */ - src_ptr += src_stride; - dst_ptr += 1; - } -} - -static void convolve_bi_horiz_64_transposed_dspr2(const uint8_t *src_ptr, - int32_t src_stride, - uint8_t *dst_ptr, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h) { - int32_t c, y; - const uint8_t *src; - uint8_t *dst; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector_64 = 64; - int32_t Temp1, Temp2, Temp3; - uint32_t qload1, qload2; - uint32_t p1, p2, p3, p4, p5; - uint32_t st1, st2, st3; - uint32_t dst_pitch_2 = (dst_stride << 1); - uint8_t *odd_dst; - const int16_t *filter = &filter_x0[3]; - uint32_t filter45; - - filter45 = ((const int32_t *)filter)[0]; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_load(src_ptr + src_stride); - vp9_prefetch_load(src_ptr + src_stride + 32); - vp9_prefetch_load(src_ptr + src_stride + 64); - - src = src_ptr; - dst = dst_ptr; - - odd_dst = (dst + dst_stride); - - for (c = 0; c < 4; c++) { - __asm__ __volatile__ ( - "ulw %[qload1], 0(%[src]) \n\t" - "ulw %[qload2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 1 */ - "mthi $zero, $ac1 \n\t" - "mtlo %[vector_64], $ac2 \n\t" /* even 2 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "ulw %[qload1], 8(%[src]) \n\t" - "dpa.w.ph $ac1, %[p1], %[filter45] \n\t" /* even 1 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 1 */ - - /* even 2. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 3 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p5], %[qload1] \n\t" - "ulw %[qload2], 12(%[src]) \n\t" - "dpa.w.ph $ac2, %[p2], %[filter45] \n\t" /* even 1 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 1 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 1 */ - - /* even 3. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 4 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p2], %[qload2] \n\t" - "sb %[st1], 0(%[dst]) \n\t" /* even 1 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac3, %[p3], %[filter45] \n\t" /* even 3 */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 3 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 1 */ - - /* even 4. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 5 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbl %[p3], %[qload2] \n\t" - "sb %[st2], 0(%[dst]) \n\t" /* even 2 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac1, %[p4], %[filter45] \n\t" /* even 4 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 4 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 3 */ - - /* even 5. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 6 */ - "mthi $zero, $ac3 \n\t" - "sb %[st3], 0(%[dst]) \n\t" /* even 3 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac2, %[p1], %[filter45] \n\t" /* even 5 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 5 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 4 */ - - /* even 6. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 7 */ - "mthi $zero, $ac1 \n\t" - "sb %[st1], 0(%[dst]) \n\t" /* even 4 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "ulw %[qload1], 20(%[src]) \n\t" - "dpa.w.ph $ac3, %[p5], %[filter45] \n\t" /* even 6 */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 6 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 5 */ - - /* even 7. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 8 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p5], %[qload1] \n\t" - "sb %[st2], 0(%[dst]) \n\t" /* even 5 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac1, %[p2], %[filter45] \n\t" /* even 7 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 7 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 6 */ - - /* even 8. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 1 */ - "mthi $zero, $ac3 \n\t" - "dpa.w.ph $ac2, %[p3], %[filter45] \n\t" /* even 8 */ - "sb %[st3], 0(%[dst]) \n\t" /* even 6 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "extp %[Temp2], $ac2, 31 \n\t" /* even 8 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 7 */ - - /* ODD pixels */ - "ulw %[qload1], 1(%[src]) \n\t" - "ulw %[qload2], 5(%[src]) \n\t" - - /* odd 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 2 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "sb %[st1], 0(%[dst]) \n\t" /* even 7 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "ulw %[qload2], 9(%[src]) \n\t" - "dpa.w.ph $ac3, %[p1], %[filter45] \n\t" /* odd 1 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 1 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 8 */ - - /* odd 2. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 3 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[qload2] \n\t" - "preceu.ph.qbl %[p5], %[qload2] \n\t" - "sb %[st2], 0(%[dst]) \n\t" /* even 8 */ - "ulw %[qload1], 13(%[src]) \n\t" - "dpa.w.ph $ac1, %[p2], %[filter45] \n\t" /* odd 2 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 2 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 1 */ - - /* odd 3. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 4 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "sb %[st3], 0(%[odd_dst]) \n\t" /* odd 1 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac2, %[p3], %[filter45] \n\t" /* odd 3 */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 3 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 2 */ - - /* odd 4. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 5 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[st1], 0(%[odd_dst]) \n\t" /* odd 2 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac3, %[p4], %[filter45] \n\t" /* odd 4 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 4 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 3 */ - - /* odd 5. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 6 */ - "mthi $zero, $ac2 \n\t" - "sb %[st2], 0(%[odd_dst]) \n\t" /* odd 3 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac1, %[p1], %[filter45] \n\t" /* odd 5 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 5 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 4 */ - - /* odd 6. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 7 */ - "mthi $zero, $ac3 \n\t" - "sb %[st3], 0(%[odd_dst]) \n\t" /* odd 4 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "ulw %[qload1], 21(%[src]) \n\t" - "dpa.w.ph $ac2, %[p5], %[filter45] \n\t" /* odd 6 */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 6 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 5 */ - - /* odd 7. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 8 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p5], %[qload1] \n\t" - "sb %[st1], 0(%[odd_dst]) \n\t" /* odd 5 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac3, %[p2], %[filter45] \n\t" /* odd 7 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 7 */ - - /* odd 8. pixel */ - "dpa.w.ph $ac1, %[p3], %[filter45] \n\t" /* odd 8 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 8 */ - - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 6 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 7 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 8 */ - - "sb %[st2], 0(%[odd_dst]) \n\t" /* odd 6 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - - "sb %[st3], 0(%[odd_dst]) \n\t" /* odd 7 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - - "sb %[st1], 0(%[odd_dst]) \n\t" /* odd 8 */ - - : [qload1] "=&r" (qload1), [qload2] "=&r" (qload2), [p5] "=&r" (p5), - [st1] "=&r" (st1), [st2] "=&r" (st2), [st3] "=&r" (st3), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3), - [dst] "+r" (dst), [odd_dst] "+r" (odd_dst) - : [filter45] "r" (filter45), [vector_64] "r" (vector_64), - [cm] "r" (cm), - [src] "r" (src), [dst_pitch_2] "r" (dst_pitch_2) - ); - - src += 16; - dst = (dst_ptr + ((c + 1) * 16 * dst_stride)); - odd_dst = (dst + dst_stride); - } - - /* Next row... */ - src_ptr += src_stride; - dst_ptr += 1; - } -} - -void convolve_bi_horiz_transposed(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter, int w, int h) { - int x, y; - - for (y = 0; y < h; ++y) { - for (x = 0; x < w; ++x) { - int sum = 0; - - sum += src[x] * filter[3]; - sum += src[x + 1] * filter[4]; - - dst[x * dst_stride] = clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS)); - } - - src += src_stride; - dst += 1; - } -} - -void vp9_convolve2_dspr2(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter, - int w, int h) { - uint32_t pos = 38; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - /* prefetch data to cache memory */ - vp9_prefetch_load(src); - vp9_prefetch_load(src + 32); - - switch (w) { - case 4: - convolve_bi_horiz_4_transposed_dspr2(src, src_stride, - dst, dst_stride, - filter, h); - break; - case 8: - convolve_bi_horiz_8_transposed_dspr2(src, src_stride, - dst, dst_stride, - filter, h); - break; - case 16: - case 32: - convolve_bi_horiz_16_transposed_dspr2(src, src_stride, - dst, dst_stride, - filter, h, - (w/16)); - break; - case 64: - vp9_prefetch_load(src + 32); - convolve_bi_horiz_64_transposed_dspr2(src, src_stride, - dst, dst_stride, - filter, h); - break; - default: - convolve_bi_horiz_transposed(src, src_stride, - dst, dst_stride, - filter, w, h); - break; - } -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve2_horiz_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve2_horiz_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve2_horiz_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve2_horiz_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,713 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vpx_config.h" -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vpx/vpx_integer.h" -#include "vpx_ports/mem.h" -#include "vp9/common/vp9_convolve.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" - -#if HAVE_DSPR2 -static void convolve_bi_horiz_4_dspr2(const uint8_t *src, - int32_t src_stride, - uint8_t *dst, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h) { - int32_t y; - uint8_t *cm = vp9_ff_cropTbl; - int32_t Temp1, Temp2, Temp3, Temp4; - uint32_t vector4a = 64; - uint32_t tp1, tp2; - uint32_t p1, p2; - const int16_t *filter = &filter_x0[3]; - uint32_t filter45;; - - filter45 = ((const int32_t *)filter)[0]; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - vp9_prefetch_store(dst + dst_stride); - - __asm__ __volatile__ ( - "ulw %[tp1], 0(%[src]) \n\t" - "ulw %[tp2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[tp1] \n\t" - "preceu.ph.qbl %[p2], %[tp1] \n\t" - "dpa.w.ph $ac3, %[p1], %[filter45] \n\t" - "extp %[Temp1], $ac3, 31 \n\t" - - /* even 2. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "balign %[tp2], %[tp1], 3 \n\t" - "dpa.w.ph $ac2, %[p2], %[filter45] \n\t" - "extp %[Temp3], $ac2, 31 \n\t" - - /* odd 1. pixel */ - "lbux %[tp1], %[Temp1](%[cm]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[tp2] \n\t" - "preceu.ph.qbl %[p2], %[tp2] \n\t" - "dpa.w.ph $ac3, %[p1], %[filter45] \n\t" - "extp %[Temp2], $ac3, 31 \n\t" - - /* odd 2. pixel */ - "lbux %[tp2], %[Temp3](%[cm]) \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "dpa.w.ph $ac2, %[p2], %[filter45] \n\t" - "extp %[Temp4], $ac2, 31 \n\t" - - /* clamp */ - "lbux %[p1], %[Temp2](%[cm]) \n\t" - "lbux %[p2], %[Temp4](%[cm]) \n\t" - - /* store bytes */ - "sb %[tp1], 0(%[dst]) \n\t" - "sb %[p1], 1(%[dst]) \n\t" - "sb %[tp2], 2(%[dst]) \n\t" - "sb %[p2], 3(%[dst]) \n\t" - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), - [p1] "=&r" (p1), [p2] "=&r" (p2), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=&r" (Temp4) - : [filter45] "r" (filter45), [vector4a] "r" (vector4a), - [cm] "r" (cm), [dst] "r" (dst), [src] "r" (src) - ); - - /* Next row... */ - src += src_stride; - dst += dst_stride; - } -} - -static void convolve_bi_horiz_8_dspr2(const uint8_t *src, - int32_t src_stride, - uint8_t *dst, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h) { - int32_t y; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector4a = 64; - int32_t Temp1, Temp2, Temp3; - uint32_t tp1, tp2, tp3; - uint32_t p1, p2, p3, p4; - uint32_t st0, st1; - const int16_t *filter = &filter_x0[3]; - uint32_t filter45;; - - filter45 = ((const int32_t *)filter)[0]; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - vp9_prefetch_store(dst + dst_stride); - - __asm__ __volatile__ ( - "ulw %[tp1], 0(%[src]) \n\t" - "ulw %[tp2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[tp1] \n\t" - "preceu.ph.qbl %[p2], %[tp1] \n\t" - "preceu.ph.qbr %[p3], %[tp2] \n\t" - "preceu.ph.qbl %[p4], %[tp2] \n\t" - "ulw %[tp3], 8(%[src]) \n\t" - "dpa.w.ph $ac3, %[p1], %[filter45] \n\t" - "extp %[Temp1], $ac3, 31 \n\t" - - /* even 2. pixel */ - "dpa.w.ph $ac2, %[p2], %[filter45] \n\t" - "extp %[Temp3], $ac2, 31 \n\t" - - /* even 3. pixel */ - "lbux %[st0], %[Temp1](%[cm]) \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "dpa.w.ph $ac1, %[p3], %[filter45] \n\t" - "extp %[Temp1], $ac1, 31 \n\t" - - /* even 4. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "sb %[st0], 0(%[dst]) \n\t" - "lbux %[st1], %[Temp3](%[cm]) \n\t" - - "balign %[tp3], %[tp2], 3 \n\t" - "balign %[tp2], %[tp1], 3 \n\t" - - "dpa.w.ph $ac2, %[p4], %[filter45] \n\t" - "extp %[Temp3], $ac2, 31 \n\t" - - "lbux %[st0], %[Temp1](%[cm]) \n\t" - - /* odd 1. pixel */ - "mtlo %[vector4a], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "sb %[st1], 2(%[dst]) \n\t" - "preceu.ph.qbr %[p1], %[tp2] \n\t" - "preceu.ph.qbl %[p2], %[tp2] \n\t" - "preceu.ph.qbr %[p3], %[tp3] \n\t" - "preceu.ph.qbl %[p4], %[tp3] \n\t" - "sb %[st0], 4(%[dst]) \n\t" - "dpa.w.ph $ac3, %[p1], %[filter45] \n\t" - "extp %[Temp2], $ac3, 31 \n\t" - - /* odd 2. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "lbux %[st0], %[Temp3](%[cm]) \n\t" - "dpa.w.ph $ac1, %[p2], %[filter45] \n\t" - "extp %[Temp3], $ac1, 31 \n\t" - - /* odd 3. pixel */ - "lbux %[st1], %[Temp2](%[cm]) \n\t" - "dpa.w.ph $ac3, %[p3], %[filter45] \n\t" - "extp %[Temp2], $ac3, 31 \n\t" - - /* odd 4. pixel */ - "sb %[st1], 1(%[dst]) \n\t" - "sb %[st0], 6(%[dst]) \n\t" - "dpa.w.ph $ac2, %[p4], %[filter45] \n\t" - "extp %[Temp1], $ac2, 31 \n\t" - - /* clamp */ - "lbux %[p4], %[Temp3](%[cm]) \n\t" - "lbux %[p2], %[Temp2](%[cm]) \n\t" - "lbux %[p1], %[Temp1](%[cm]) \n\t" - - /* store bytes */ - "sb %[p4], 3(%[dst]) \n\t" - "sb %[p2], 5(%[dst]) \n\t" - "sb %[p1], 7(%[dst]) \n\t" - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), [tp3] "=&r" (tp3), - [st0] "=&r" (st0), [st1] "=&r" (st1), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3) - : [filter45] "r" (filter45), [vector4a] "r" (vector4a), - [cm] "r" (cm), [dst] "r" (dst), [src] "r" (src) - ); - - /* Next row... */ - src += src_stride; - dst += dst_stride; - } -} - -static void convolve_bi_horiz_16_dspr2(const uint8_t *src_ptr, - int32_t src_stride, - uint8_t *dst_ptr, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h, - int32_t count) { - int32_t y, c; - const uint8_t *src; - uint8_t *dst; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector_64 = 64; - int32_t Temp1, Temp2, Temp3; - uint32_t qload1, qload2, qload3; - uint32_t p1, p2, p3, p4, p5; - uint32_t st1, st2, st3; - const int16_t *filter = &filter_x0[3]; - uint32_t filter45;; - - filter45 = ((const int32_t *)filter)[0]; - - for (y = h; y--;) { - src = src_ptr; - dst = dst_ptr; - - /* prefetch data to cache memory */ - vp9_prefetch_load(src_ptr + src_stride); - vp9_prefetch_load(src_ptr + src_stride + 32); - vp9_prefetch_store(dst_ptr + dst_stride); - - for (c = 0; c < count; c++) { - __asm__ __volatile__ ( - "ulw %[qload1], 0(%[src]) \n\t" - "ulw %[qload2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 1 */ - "mthi $zero, $ac1 \n\t" - "mtlo %[vector_64], $ac2 \n\t" /* even 2 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "ulw %[qload3], 8(%[src]) \n\t" - "dpa.w.ph $ac1, %[p1], %[filter45] \n\t" /* even 1 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 1 */ - - /* even 2. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 3 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[qload3] \n\t" - "preceu.ph.qbl %[p5], %[qload3] \n\t" - "ulw %[qload1], 12(%[src]) \n\t" - "dpa.w.ph $ac2, %[p2], %[filter45] \n\t" /* even 1 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 1 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 1 */ - - /* even 3. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 4 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "sb %[st1], 0(%[dst]) \n\t" /* even 1 */ - "dpa.w.ph $ac3, %[p3], %[filter45] \n\t" /* even 3 */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 3 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 1 */ - - /* even 4. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 5 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[st2], 2(%[dst]) \n\t" /* even 1 */ - "dpa.w.ph $ac1, %[p4], %[filter45] \n\t" /* even 4 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 4 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 3 */ - - /* even 5. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 6 */ - "mthi $zero, $ac3 \n\t" - "sb %[st3], 4(%[dst]) \n\t" /* even 3 */ - "dpa.w.ph $ac2, %[p1], %[filter45] \n\t" /* even 5 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 5 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 4 */ - - /* even 6. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 7 */ - "mthi $zero, $ac1 \n\t" - "sb %[st1], 6(%[dst]) \n\t" /* even 4 */ - "dpa.w.ph $ac3, %[p5], %[filter45] \n\t" /* even 6 */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 6 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 5 */ - - /* even 7. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 8 */ - "mthi $zero, $ac2 \n\t" - "sb %[st2], 8(%[dst]) \n\t" /* even 5 */ - "dpa.w.ph $ac1, %[p2], %[filter45] \n\t" /* even 7 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 7 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 6 */ - - /* even 8. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 1 */ - "mthi $zero, $ac3 \n\t" - "dpa.w.ph $ac2, %[p3], %[filter45] \n\t" /* even 8 */ - "sb %[st3], 10(%[dst]) \n\t" /* even 6 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 8 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 7 */ - - /* ODD pixels */ - "ulw %[qload1], 1(%[src]) \n\t" - "ulw %[qload2], 5(%[src]) \n\t" - - /* odd 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 2 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "sb %[st1], 12(%[dst]) \n\t" /* even 7 */ - "ulw %[qload3], 9(%[src]) \n\t" - "dpa.w.ph $ac3, %[p1], %[filter45] \n\t" /* odd 1 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 1 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 8 */ - - /* odd 2. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 3 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[qload3] \n\t" - "preceu.ph.qbl %[p5], %[qload3] \n\t" - "sb %[st2], 14(%[dst]) \n\t" /* even 8 */ - "ulw %[qload1], 13(%[src]) \n\t" - "dpa.w.ph $ac1, %[p2], %[filter45] \n\t" /* odd 2 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 2 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 1 */ - - /* odd 3. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 4 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "sb %[st3], 1(%[dst]) \n\t" /* odd 1 */ - "dpa.w.ph $ac2, %[p3], %[filter45] \n\t" /* odd 3 */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 3 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 2 */ - - /* odd 4. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 5 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[st1], 3(%[dst]) \n\t" /* odd 2 */ - "dpa.w.ph $ac3, %[p4], %[filter45] \n\t" /* odd 4 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 4 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 3 */ - - /* odd 5. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 6 */ - "mthi $zero, $ac2 \n\t" - "sb %[st2], 5(%[dst]) \n\t" /* odd 3 */ - "dpa.w.ph $ac1, %[p1], %[filter45] \n\t" /* odd 5 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 5 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 4 */ - - /* odd 6. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 7 */ - "mthi $zero, $ac3 \n\t" - "sb %[st3], 7(%[dst]) \n\t" /* odd 4 */ - "dpa.w.ph $ac2, %[p5], %[filter45] \n\t" /* odd 6 */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 6 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 5 */ - - /* odd 7. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 8 */ - "mthi $zero, $ac1 \n\t" - "sb %[st1], 9(%[dst]) \n\t" /* odd 5 */ - "dpa.w.ph $ac3, %[p2], %[filter45] \n\t" /* odd 7 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 7 */ - - /* odd 8. pixel */ - "dpa.w.ph $ac1, %[p3], %[filter45] \n\t" /* odd 8 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 8 */ - - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 6 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 7 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 8 */ - - "sb %[st2], 11(%[dst]) \n\t" /* odd 6 */ - "sb %[st3], 13(%[dst]) \n\t" /* odd 7 */ - "sb %[st1], 15(%[dst]) \n\t" /* odd 8 */ - - : [qload1] "=&r" (qload1), [qload2] "=&r" (qload2), [qload3] "=&r" (qload3), - [st1] "=&r" (st1), [st2] "=&r" (st2), [st3] "=&r" (st3), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4), - [p5] "=&r" (p5), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3) - : [filter45] "r" (filter45), [vector_64] "r" (vector_64), - [cm] "r" (cm), [dst] "r" (dst), [src] "r" (src) - ); - - src += 16; - dst += 16; - } - - /* Next row... */ - src_ptr += src_stride; - dst_ptr += dst_stride; - } -} - -static void convolve_bi_horiz_64_dspr2(const uint8_t *src_ptr, - int32_t src_stride, - uint8_t *dst_ptr, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h) { - int32_t y, c; - const uint8_t *src; - uint8_t *dst; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector_64 = 64; - int32_t Temp1, Temp2, Temp3; - uint32_t qload1, qload2, qload3; - uint32_t p1, p2, p3, p4, p5; - uint32_t st1, st2, st3; - const int16_t *filter = &filter_x0[3]; - uint32_t filter45;; - - filter45 = ((const int32_t *)filter)[0]; - - for (y = h; y--;) { - src = src_ptr; - dst = dst_ptr; - - /* prefetch data to cache memory */ - vp9_prefetch_load(src_ptr + src_stride); - vp9_prefetch_load(src_ptr + src_stride + 32); - vp9_prefetch_load(src_ptr + src_stride + 64); - vp9_prefetch_store(dst_ptr + dst_stride); - vp9_prefetch_store(dst_ptr + dst_stride + 32); - - for (c = 0; c < 4; c++) { - __asm__ __volatile__ ( - "ulw %[qload1], 0(%[src]) \n\t" - "ulw %[qload2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 1 */ - "mthi $zero, $ac1 \n\t" - "mtlo %[vector_64], $ac2 \n\t" /* even 2 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "ulw %[qload3], 8(%[src]) \n\t" - "dpa.w.ph $ac1, %[p1], %[filter45] \n\t" /* even 1 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 1 */ - - /* even 2. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 3 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[qload3] \n\t" - "preceu.ph.qbl %[p5], %[qload3] \n\t" - "ulw %[qload1], 12(%[src]) \n\t" - "dpa.w.ph $ac2, %[p2], %[filter45] \n\t" /* even 1 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 1 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 1 */ - - /* even 3. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 4 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "sb %[st1], 0(%[dst]) \n\t" /* even 1 */ - "dpa.w.ph $ac3, %[p3], %[filter45] \n\t" /* even 3 */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 3 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 1 */ - - /* even 4. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 5 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[st2], 2(%[dst]) \n\t" /* even 1 */ - "dpa.w.ph $ac1, %[p4], %[filter45] \n\t" /* even 4 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 4 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 3 */ - - /* even 5. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 6 */ - "mthi $zero, $ac3 \n\t" - "sb %[st3], 4(%[dst]) \n\t" /* even 3 */ - "dpa.w.ph $ac2, %[p1], %[filter45] \n\t" /* even 5 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 5 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 4 */ - - /* even 6. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 7 */ - "mthi $zero, $ac1 \n\t" - "sb %[st1], 6(%[dst]) \n\t" /* even 4 */ - "dpa.w.ph $ac3, %[p5], %[filter45] \n\t" /* even 6 */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 6 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 5 */ - - /* even 7. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 8 */ - "mthi $zero, $ac2 \n\t" - "sb %[st2], 8(%[dst]) \n\t" /* even 5 */ - "dpa.w.ph $ac1, %[p2], %[filter45] \n\t" /* even 7 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 7 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 6 */ - - /* even 8. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 1 */ - "mthi $zero, $ac3 \n\t" - "dpa.w.ph $ac2, %[p3], %[filter45] \n\t" /* even 8 */ - "sb %[st3], 10(%[dst]) \n\t" /* even 6 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 8 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 7 */ - - /* ODD pixels */ - "ulw %[qload1], 1(%[src]) \n\t" - "ulw %[qload2], 5(%[src]) \n\t" - - /* odd 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 2 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "sb %[st1], 12(%[dst]) \n\t" /* even 7 */ - "ulw %[qload3], 9(%[src]) \n\t" - "dpa.w.ph $ac3, %[p1], %[filter45] \n\t" /* odd 1 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 1 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 8 */ - - /* odd 2. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 3 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[qload3] \n\t" - "preceu.ph.qbl %[p5], %[qload3] \n\t" - "sb %[st2], 14(%[dst]) \n\t" /* even 8 */ - "ulw %[qload1], 13(%[src]) \n\t" - "dpa.w.ph $ac1, %[p2], %[filter45] \n\t" /* odd 2 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 2 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 1 */ - - /* odd 3. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 4 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "sb %[st3], 1(%[dst]) \n\t" /* odd 1 */ - "dpa.w.ph $ac2, %[p3], %[filter45] \n\t" /* odd 3 */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 3 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 2 */ - - /* odd 4. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 5 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[st1], 3(%[dst]) \n\t" /* odd 2 */ - "dpa.w.ph $ac3, %[p4], %[filter45] \n\t" /* odd 4 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 4 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 3 */ - - /* odd 5. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 6 */ - "mthi $zero, $ac2 \n\t" - "sb %[st2], 5(%[dst]) \n\t" /* odd 3 */ - "dpa.w.ph $ac1, %[p1], %[filter45] \n\t" /* odd 5 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 5 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 4 */ - - /* odd 6. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 7 */ - "mthi $zero, $ac3 \n\t" - "sb %[st3], 7(%[dst]) \n\t" /* odd 4 */ - "dpa.w.ph $ac2, %[p5], %[filter45] \n\t" /* odd 6 */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 6 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 5 */ - - /* odd 7. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 8 */ - "mthi $zero, $ac1 \n\t" - "sb %[st1], 9(%[dst]) \n\t" /* odd 5 */ - "dpa.w.ph $ac3, %[p2], %[filter45] \n\t" /* odd 7 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 7 */ - - /* odd 8. pixel */ - "dpa.w.ph $ac1, %[p3], %[filter45] \n\t" /* odd 8 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 8 */ - - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 6 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 7 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 8 */ - - "sb %[st2], 11(%[dst]) \n\t" /* odd 6 */ - "sb %[st3], 13(%[dst]) \n\t" /* odd 7 */ - "sb %[st1], 15(%[dst]) \n\t" /* odd 8 */ - - : [qload1] "=&r" (qload1), [qload2] "=&r" (qload2), [qload3] "=&r" (qload3), - [st1] "=&r" (st1), [st2] "=&r" (st2), [st3] "=&r" (st3), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4), - [p5] "=&r" (p5), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3) - : [filter45] "r" (filter45), [vector_64] "r" (vector_64), - [cm] "r" (cm), [dst] "r" (dst), [src] "r" (src) - ); - - src += 16; - dst += 16; - } - - /* Next row... */ - src_ptr += src_stride; - dst_ptr += dst_stride; - } -} - -void vp9_convolve2_horiz_dspr2(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h) { - if (16 == x_step_q4) { - uint32_t pos = 38; - - vp9_prefetch_load((const uint8_t *)filter_x); - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - /* prefetch data to cache memory */ - vp9_prefetch_load(src); - vp9_prefetch_load(src + 32); - vp9_prefetch_store(dst); - - switch (w) { - case 4: - convolve_bi_horiz_4_dspr2(src, (int32_t)src_stride, - dst, (int32_t)dst_stride, - filter_x, (int32_t)h); - break; - case 8: - convolve_bi_horiz_8_dspr2(src, (int32_t)src_stride, - dst, (int32_t)dst_stride, - filter_x, (int32_t)h); - break; - case 16: - convolve_bi_horiz_16_dspr2(src, (int32_t)src_stride, - dst, (int32_t)dst_stride, - filter_x, (int32_t)h, 1); - break; - case 32: - convolve_bi_horiz_16_dspr2(src, (int32_t)src_stride, - dst, (int32_t)dst_stride, - filter_x, (int32_t)h, 2); - break; - case 64: - vp9_prefetch_load(src + 64); - vp9_prefetch_store(dst + 32); - - convolve_bi_horiz_64_dspr2(src, (int32_t)src_stride, - dst, (int32_t)dst_stride, - filter_x, (int32_t)h); - break; - default: - vp9_convolve8_horiz_c(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - break; - } - } else { - vp9_convolve8_horiz_c(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - } -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve2_vert_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve2_vert_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve2_vert_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve2_vert_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,266 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vpx_config.h" -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vpx/vpx_integer.h" -#include "vpx_ports/mem.h" -#include "vp9/common/vp9_convolve.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" - -#if HAVE_DSPR2 -static void convolve_bi_vert_4_dspr2(const uint8_t *src, - int32_t src_stride, - uint8_t *dst, - int32_t dst_stride, - const int16_t *filter_y, - int32_t w, - int32_t h) { - int32_t x, y; - const uint8_t *src_ptr; - uint8_t *dst_ptr; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector4a = 64; - uint32_t load1, load2; - uint32_t p1, p2; - uint32_t scratch1; - uint32_t store1, store2; - int32_t Temp1, Temp2; - const int16_t *filter = &filter_y[3]; - uint32_t filter45; - - filter45 = ((const int32_t *)filter)[0]; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_store(dst + dst_stride); - - for (x = 0; x < w; x += 4) { - src_ptr = src + x; - dst_ptr = dst + x; - - __asm__ __volatile__ ( - "ulw %[load1], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load2], 0(%[src_ptr]) \n\t" - - "mtlo %[vector4a], $ac0 \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac0 \n\t" - "mthi $zero, $ac1 \n\t" - "mthi $zero, $ac2 \n\t" - "mthi $zero, $ac3 \n\t" - - "preceu.ph.qbr %[scratch1], %[load1] \n\t" - "preceu.ph.qbr %[p1], %[load2] \n\t" - - "precrq.ph.w %[p2], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - - "dpa.w.ph $ac0, %[p1], %[filter45] \n\t" - "dpa.w.ph $ac1, %[p2], %[filter45] \n\t" - - "preceu.ph.qbl %[scratch1], %[load1] \n\t" - "preceu.ph.qbl %[p1], %[load2] \n\t" - - "precrq.ph.w %[p2], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - - "dpa.w.ph $ac2, %[p1], %[filter45] \n\t" - "dpa.w.ph $ac3, %[p2], %[filter45] \n\t" - - "extp %[Temp1], $ac0, 31 \n\t" - "extp %[Temp2], $ac1, 31 \n\t" - - "lbux %[store1], %[Temp1](%[cm]) \n\t" - "extp %[Temp1], $ac2, 31 \n\t" - - "lbux %[store2], %[Temp2](%[cm]) \n\t" - "extp %[Temp2], $ac3, 31 \n\t" - - "sb %[store1], 0(%[dst_ptr]) \n\t" - "sb %[store2], 1(%[dst_ptr]) \n\t" - - "lbux %[store1], %[Temp1](%[cm]) \n\t" - "lbux %[store2], %[Temp2](%[cm]) \n\t" - - "sb %[store1], 2(%[dst_ptr]) \n\t" - "sb %[store2], 3(%[dst_ptr]) \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [p1] "=&r" (p1), [p2] "=&r" (p2), - [scratch1] "=&r" (scratch1), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [store1] "=&r" (store1), [store2] "=&r" (store2), - [src_ptr] "+r" (src_ptr) - : [filter45] "r" (filter45),[vector4a] "r" (vector4a), - [src_stride] "r" (src_stride), - [cm] "r" (cm), [dst_ptr] "r" (dst_ptr) - ); - } - - /* Next row... */ - src += src_stride; - dst += dst_stride; - } -} - -static void convolve_bi_vert_64_dspr2(const uint8_t *src, - int32_t src_stride, - uint8_t *dst, - int32_t dst_stride, - const int16_t *filter_y, - int32_t h) { - int32_t x, y; - const uint8_t *src_ptr; - uint8_t *dst_ptr; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector4a = 64; - uint32_t load1, load2; - uint32_t p1, p2; - uint32_t scratch1; - uint32_t store1, store2; - int32_t Temp1, Temp2; - const int16_t *filter = &filter_y[3]; - uint32_t filter45; - - filter45 = ((const int32_t *)filter)[0]; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_store(dst + dst_stride); - - for (x = 0; x < 64; x += 4) { - src_ptr = src + x; - dst_ptr = dst + x; - - __asm__ __volatile__ ( - "ulw %[load1], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load2], 0(%[src_ptr]) \n\t" - - "mtlo %[vector4a], $ac0 \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac0 \n\t" - "mthi $zero, $ac1 \n\t" - "mthi $zero, $ac2 \n\t" - "mthi $zero, $ac3 \n\t" - - "preceu.ph.qbr %[scratch1], %[load1] \n\t" - "preceu.ph.qbr %[p1], %[load2] \n\t" - - "precrq.ph.w %[p2], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - - "dpa.w.ph $ac0, %[p1], %[filter45] \n\t" - "dpa.w.ph $ac1, %[p2], %[filter45] \n\t" - - "preceu.ph.qbl %[scratch1], %[load1] \n\t" - "preceu.ph.qbl %[p1], %[load2] \n\t" - - "precrq.ph.w %[p2], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - - "dpa.w.ph $ac2, %[p1], %[filter45] \n\t" - "dpa.w.ph $ac3, %[p2], %[filter45] \n\t" - - "extp %[Temp1], $ac0, 31 \n\t" - "extp %[Temp2], $ac1, 31 \n\t" - - "lbux %[store1], %[Temp1](%[cm]) \n\t" - "extp %[Temp1], $ac2, 31 \n\t" - - "lbux %[store2], %[Temp2](%[cm]) \n\t" - "extp %[Temp2], $ac3, 31 \n\t" - - "sb %[store1], 0(%[dst_ptr]) \n\t" - "sb %[store2], 1(%[dst_ptr]) \n\t" - - "lbux %[store1], %[Temp1](%[cm]) \n\t" - "lbux %[store2], %[Temp2](%[cm]) \n\t" - - "sb %[store1], 2(%[dst_ptr]) \n\t" - "sb %[store2], 3(%[dst_ptr]) \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [p1] "=&r" (p1), [p2] "=&r" (p2), - [scratch1] "=&r" (scratch1), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [store1] "=&r" (store1), [store2] "=&r" (store2), - [src_ptr] "+r" (src_ptr) - : [filter45] "r" (filter45),[vector4a] "r" (vector4a), - [src_stride] "r" (src_stride), - [cm] "r" (cm), [dst_ptr] "r" (dst_ptr) - ); - } - - /* Next row... */ - src += src_stride; - dst += dst_stride; - } -} - -void vp9_convolve2_vert_dspr2(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h) { - if (16 == y_step_q4) { - uint32_t pos = 38; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - vp9_prefetch_store(dst); - - switch (w) { - case 4 : - case 8 : - case 16 : - case 32 : - convolve_bi_vert_4_dspr2(src, src_stride, - dst, dst_stride, - filter_y, w, h); - break; - case 64 : - vp9_prefetch_store(dst + 32); - convolve_bi_vert_64_dspr2(src, src_stride, - dst, dst_stride, - filter_y, h); - break; - default: - vp9_convolve8_vert_c(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - break; - } - } else { - vp9_convolve8_vert_c(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - } -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve8_avg_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve8_avg_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve8_avg_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve8_avg_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,695 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vpx_config.h" -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vpx/vpx_integer.h" -#include "vpx_ports/mem.h" -#include "vp9/common/vp9_convolve.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" - -#if HAVE_DSPR2 -static void convolve_avg_vert_4_dspr2(const uint8_t *src, - int32_t src_stride, - uint8_t *dst, - int32_t dst_stride, - const int16_t *filter_y, - int32_t w, - int32_t h) { - int32_t x, y; - const uint8_t *src_ptr; - uint8_t *dst_ptr; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector4a = 64; - uint32_t load1, load2, load3, load4; - uint32_t p1, p2; - uint32_t n1, n2; - uint32_t scratch1, scratch2; - uint32_t store1, store2; - int32_t vector1b, vector2b, vector3b, vector4b; - int32_t Temp1, Temp2; - - vector1b = ((const int32_t *)filter_y)[0]; - vector2b = ((const int32_t *)filter_y)[1]; - vector3b = ((const int32_t *)filter_y)[2]; - vector4b = ((const int32_t *)filter_y)[3]; - - src -= 3 * src_stride; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_store(dst + dst_stride); - - for (x = 0; x < w; x += 4) { - src_ptr = src + x; - dst_ptr = dst + x; - - __asm__ __volatile__ ( - "ulw %[load1], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load2], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load3], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load4], 0(%[src_ptr]) \n\t" - - "mtlo %[vector4a], $ac0 \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac0 \n\t" - "mthi $zero, $ac1 \n\t" - "mthi $zero, $ac2 \n\t" - "mthi $zero, $ac3 \n\t" - - "preceu.ph.qbr %[scratch1], %[load1] \n\t" - "preceu.ph.qbr %[p1], %[load2] \n\t" - "precrq.ph.w %[n1], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - "preceu.ph.qbr %[scratch2], %[load3] \n\t" - "preceu.ph.qbr %[p2], %[load4] \n\t" - "precrq.ph.w %[n2], %[p2], %[scratch2] \n\t" /* pixel 2 */ - "append %[p2], %[scratch2], 16 \n\t" /* pixel 1 */ - - "dpa.w.ph $ac0, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac0, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac1, %[n1], %[vector1b] \n\t" - "dpa.w.ph $ac1, %[n2], %[vector2b] \n\t" - - "preceu.ph.qbl %[scratch1], %[load1] \n\t" - "preceu.ph.qbl %[p1], %[load2] \n\t" - "precrq.ph.w %[n1], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - "preceu.ph.qbl %[scratch2], %[load3] \n\t" - "preceu.ph.qbl %[p2], %[load4] \n\t" - "precrq.ph.w %[n2], %[p2], %[scratch2] \n\t" /* pixel 2 */ - "append %[p2], %[scratch2], 16 \n\t" /* pixel 1 */ - - "dpa.w.ph $ac2, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[n1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[n2], %[vector2b] \n\t" - - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load1], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load2], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load3], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load4], 0(%[src_ptr]) \n\t" - - "preceu.ph.qbr %[scratch1], %[load1] \n\t" - "preceu.ph.qbr %[p1], %[load2] \n\t" - "precrq.ph.w %[n1], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - "preceu.ph.qbr %[scratch2], %[load3] \n\t" - "preceu.ph.qbr %[p2], %[load4] \n\t" - "precrq.ph.w %[n2], %[p2], %[scratch2] \n\t" /* pixel 2 */ - "append %[p2], %[scratch2], 16 \n\t" /* pixel 1 */ - - "dpa.w.ph $ac0, %[p1], %[vector3b] \n\t" - "dpa.w.ph $ac0, %[p2], %[vector4b] \n\t" - "extp %[Temp1], $ac0, 31 \n\t" - "dpa.w.ph $ac1, %[n1], %[vector3b] \n\t" - "dpa.w.ph $ac1, %[n2], %[vector4b] \n\t" - "extp %[Temp2], $ac1, 31 \n\t" - - "preceu.ph.qbl %[scratch1], %[load1] \n\t" - "preceu.ph.qbl %[p1], %[load2] \n\t" - "precrq.ph.w %[n1], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - "lbu %[scratch1], 0(%[dst_ptr]) \n\t" - "preceu.ph.qbl %[scratch2], %[load3] \n\t" - "preceu.ph.qbl %[p2], %[load4] \n\t" - "precrq.ph.w %[n2], %[p2], %[scratch2] \n\t" /* pixel 2 */ - "append %[p2], %[scratch2], 16 \n\t" /* pixel 1 */ - "lbu %[scratch2], 1(%[dst_ptr]) \n\t" - - "lbux %[store1], %[Temp1](%[cm]) \n\t" - "dpa.w.ph $ac2, %[p1], %[vector3b] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector4b] \n\t" - "addqh_r.w %[store1], %[store1], %[scratch1] \n\t" /* pixel 1 */ - "extp %[Temp1], $ac2, 31 \n\t" - - "lbux %[store2], %[Temp2](%[cm]) \n\t" - "dpa.w.ph $ac3, %[n1], %[vector3b] \n\t" - "dpa.w.ph $ac3, %[n2], %[vector4b] \n\t" - "addqh_r.w %[store2], %[store2], %[scratch2] \n\t" /* pixel 2 */ - "extp %[Temp2], $ac3, 31 \n\t" - "lbu %[scratch1], 2(%[dst_ptr]) \n\t" - - "sb %[store1], 0(%[dst_ptr]) \n\t" - "sb %[store2], 1(%[dst_ptr]) \n\t" - "lbu %[scratch2], 3(%[dst_ptr]) \n\t" - - "lbux %[store1], %[Temp1](%[cm]) \n\t" - "lbux %[store2], %[Temp2](%[cm]) \n\t" - "addqh_r.w %[store1], %[store1], %[scratch1] \n\t" /* pixel 3 */ - "addqh_r.w %[store2], %[store2], %[scratch2] \n\t" /* pixel 4 */ - - "sb %[store1], 2(%[dst_ptr]) \n\t" - "sb %[store2], 3(%[dst_ptr]) \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [load3] "=&r" (load3), [load4] "=&r" (load4), - [p1] "=&r" (p1), [p2] "=&r" (p2), [n1] "=&r" (n1), [n2] "=&r" (n2), - [scratch1] "=&r" (scratch1), [scratch2] "=&r" (scratch2), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [store1] "=&r" (store1), [store2] "=&r" (store2), - [src_ptr] "+r" (src_ptr) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector3b] "r" (vector3b), [vector4b] "r" (vector4b), - [vector4a] "r" (vector4a), - [src_stride] "r" (src_stride), [cm] "r" (cm), [dst_ptr] "r" (dst_ptr) - ); - } - - /* Next row... */ - src += src_stride; - dst += dst_stride; - } -} - -static void convolve_avg_vert_64_dspr2(const uint8_t *src, - int32_t src_stride, - uint8_t *dst, - int32_t dst_stride, - const int16_t *filter_y, - int32_t h) { - int32_t x, y; - const uint8_t *src_ptr; - uint8_t *dst_ptr; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector4a = 64; - uint32_t load1, load2, load3, load4; - uint32_t p1, p2; - uint32_t n1, n2; - uint32_t scratch1, scratch2; - uint32_t store1, store2; - int32_t vector1b, vector2b, vector3b, vector4b; - int32_t Temp1, Temp2; - - vector1b = ((const int32_t *)filter_y)[0]; - vector2b = ((const int32_t *)filter_y)[1]; - vector3b = ((const int32_t *)filter_y)[2]; - vector4b = ((const int32_t *)filter_y)[3]; - - src -= 3 * src_stride; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_store(dst + dst_stride); - vp9_prefetch_store(dst + dst_stride + 32); - - for (x = 0; x < 64; x += 4) { - src_ptr = src + x; - dst_ptr = dst + x; - - __asm__ __volatile__ ( - "ulw %[load1], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load2], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load3], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load4], 0(%[src_ptr]) \n\t" - - "mtlo %[vector4a], $ac0 \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac0 \n\t" - "mthi $zero, $ac1 \n\t" - "mthi $zero, $ac2 \n\t" - "mthi $zero, $ac3 \n\t" - - "preceu.ph.qbr %[scratch1], %[load1] \n\t" - "preceu.ph.qbr %[p1], %[load2] \n\t" - "precrq.ph.w %[n1], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - "preceu.ph.qbr %[scratch2], %[load3] \n\t" - "preceu.ph.qbr %[p2], %[load4] \n\t" - "precrq.ph.w %[n2], %[p2], %[scratch2] \n\t" /* pixel 2 */ - "append %[p2], %[scratch2], 16 \n\t" /* pixel 1 */ - - "dpa.w.ph $ac0, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac0, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac1, %[n1], %[vector1b] \n\t" - "dpa.w.ph $ac1, %[n2], %[vector2b] \n\t" - - "preceu.ph.qbl %[scratch1], %[load1] \n\t" - "preceu.ph.qbl %[p1], %[load2] \n\t" - "precrq.ph.w %[n1], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - "preceu.ph.qbl %[scratch2], %[load3] \n\t" - "preceu.ph.qbl %[p2], %[load4] \n\t" - "precrq.ph.w %[n2], %[p2], %[scratch2] \n\t" /* pixel 2 */ - "append %[p2], %[scratch2], 16 \n\t" /* pixel 1 */ - - "dpa.w.ph $ac2, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[n1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[n2], %[vector2b] \n\t" - - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load1], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load2], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load3], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load4], 0(%[src_ptr]) \n\t" - - "preceu.ph.qbr %[scratch1], %[load1] \n\t" - "preceu.ph.qbr %[p1], %[load2] \n\t" - "precrq.ph.w %[n1], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - "preceu.ph.qbr %[scratch2], %[load3] \n\t" - "preceu.ph.qbr %[p2], %[load4] \n\t" - "precrq.ph.w %[n2], %[p2], %[scratch2] \n\t" /* pixel 2 */ - "append %[p2], %[scratch2], 16 \n\t" /* pixel 1 */ - - "dpa.w.ph $ac0, %[p1], %[vector3b] \n\t" - "dpa.w.ph $ac0, %[p2], %[vector4b] \n\t" - "extp %[Temp1], $ac0, 31 \n\t" - "dpa.w.ph $ac1, %[n1], %[vector3b] \n\t" - "dpa.w.ph $ac1, %[n2], %[vector4b] \n\t" - "extp %[Temp2], $ac1, 31 \n\t" - - "preceu.ph.qbl %[scratch1], %[load1] \n\t" - "preceu.ph.qbl %[p1], %[load2] \n\t" - "precrq.ph.w %[n1], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - "lbu %[scratch1], 0(%[dst_ptr]) \n\t" - "preceu.ph.qbl %[scratch2], %[load3] \n\t" - "preceu.ph.qbl %[p2], %[load4] \n\t" - "precrq.ph.w %[n2], %[p2], %[scratch2] \n\t" /* pixel 2 */ - "append %[p2], %[scratch2], 16 \n\t" /* pixel 1 */ - "lbu %[scratch2], 1(%[dst_ptr]) \n\t" - - "lbux %[store1], %[Temp1](%[cm]) \n\t" - "dpa.w.ph $ac2, %[p1], %[vector3b] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector4b] \n\t" - "addqh_r.w %[store1], %[store1], %[scratch1] \n\t" /* pixel 1 */ - "extp %[Temp1], $ac2, 31 \n\t" - - "lbux %[store2], %[Temp2](%[cm]) \n\t" - "dpa.w.ph $ac3, %[n1], %[vector3b] \n\t" - "dpa.w.ph $ac3, %[n2], %[vector4b] \n\t" - "addqh_r.w %[store2], %[store2], %[scratch2] \n\t" /* pixel 2 */ - "extp %[Temp2], $ac3, 31 \n\t" - "lbu %[scratch1], 2(%[dst_ptr]) \n\t" - - "sb %[store1], 0(%[dst_ptr]) \n\t" - "sb %[store2], 1(%[dst_ptr]) \n\t" - "lbu %[scratch2], 3(%[dst_ptr]) \n\t" - - "lbux %[store1], %[Temp1](%[cm]) \n\t" - "lbux %[store2], %[Temp2](%[cm]) \n\t" - "addqh_r.w %[store1], %[store1], %[scratch1] \n\t" /* pixel 3 */ - "addqh_r.w %[store2], %[store2], %[scratch2] \n\t" /* pixel 4 */ - - "sb %[store1], 2(%[dst_ptr]) \n\t" - "sb %[store2], 3(%[dst_ptr]) \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [load3] "=&r" (load3), [load4] "=&r" (load4), - [p1] "=&r" (p1), [p2] "=&r" (p2), [n1] "=&r" (n1), [n2] "=&r" (n2), - [scratch1] "=&r" (scratch1), [scratch2] "=&r" (scratch2), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [store1] "=&r" (store1), [store2] "=&r" (store2), - [src_ptr] "+r" (src_ptr) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector3b] "r" (vector3b), [vector4b] "r" (vector4b), - [vector4a] "r" (vector4a), - [src_stride] "r" (src_stride), [cm] "r" (cm), [dst_ptr] "r" (dst_ptr) - ); - } - - /* Next row... */ - src += src_stride; - dst += dst_stride; - } -} - -void vp9_convolve8_avg_vert_dspr2(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h) { - if (((const int32_t *)filter_y)[1] == 0x800000) { - vp9_convolve_avg(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - } else if (((const int32_t *)filter_y)[0] == 0) { - vp9_convolve2_avg_vert_dspr2(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - } else { - if (16 == y_step_q4) { - uint32_t pos = 38; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - vp9_prefetch_store(dst); - - switch (w) { - case 4: - case 8: - case 16: - case 32: - convolve_avg_vert_4_dspr2(src, src_stride, - dst, dst_stride, - filter_y, w, h); - break; - case 64: - vp9_prefetch_store(dst + 32); - convolve_avg_vert_64_dspr2(src, src_stride, - dst, dst_stride, - filter_y, h); - break; - default: - vp9_convolve8_avg_vert_c(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - break; - } - } else { - vp9_convolve8_avg_vert_c(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - } - } -} - -void vp9_convolve8_avg_dspr2(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h) { - /* Fixed size intermediate buffer places limits on parameters. */ - DECLARE_ALIGNED_ARRAY(32, uint8_t, temp, 64 * 135); - int32_t intermediate_height = ((h * y_step_q4) >> 4) + 7; - - assert(w <= 64); - assert(h <= 64); - - if (intermediate_height < h) - intermediate_height = h; - - if (x_step_q4 != 16 || y_step_q4 != 16) - return vp9_convolve8_avg_c(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - - vp9_convolve8_horiz(src - (src_stride * 3), src_stride, - temp, 64, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, intermediate_height); - - vp9_convolve8_avg_vert(temp + 64 * 3, 64, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); -} - -void vp9_convolve_avg_dspr2(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int filter_x_stride, - const int16_t *filter_y, int filter_y_stride, - int w, int h) { - int x, y; - uint32_t tp1, tp2, tn1; - uint32_t tp3, tp4, tn2; - - /* prefetch data to cache memory */ - vp9_prefetch_load(src); - vp9_prefetch_load(src + 32); - vp9_prefetch_store(dst); - - switch (w) { - case 4: - /* 1 word storage */ - for (y = h; y--; ) { - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - vp9_prefetch_store(dst + dst_stride); - - __asm__ __volatile__ ( - "ulw %[tp1], 0(%[src]) \n\t" - "ulw %[tp2], 0(%[dst]) \n\t" - "adduh_r.qb %[tn1], %[tp2], %[tp1] \n\t" /* average */ - "sw %[tn1], 0(%[dst]) \n\t" /* store */ - - : [tn1] "=&r" (tn1), [tp1] "=&r" (tp1), - [tp2] "=&r" (tp2) - : [src] "r" (src), [dst] "r" (dst) - ); - - src += src_stride; - dst += dst_stride; - } - break; - case 8: - /* 2 word storage */ - for (y = h; y--; ) { - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - vp9_prefetch_store(dst + dst_stride); - - __asm__ __volatile__ ( - "ulw %[tp1], 0(%[src]) \n\t" - "ulw %[tp2], 0(%[dst]) \n\t" - "ulw %[tp3], 4(%[src]) \n\t" - "ulw %[tp4], 4(%[dst]) \n\t" - "adduh_r.qb %[tn1], %[tp2], %[tp1] \n\t" /* average */ - "sw %[tn1], 0(%[dst]) \n\t" /* store */ - "adduh_r.qb %[tn2], %[tp3], %[tp4] \n\t" /* average */ - "sw %[tn2], 4(%[dst]) \n\t" /* store */ - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), - [tp3] "=&r" (tp3), [tp4] "=&r" (tp4), - [tn1] "=&r" (tn1), [tn2] "=&r" (tn2) - : [src] "r" (src), [dst] "r" (dst) - ); - - src += src_stride; - dst += dst_stride; - } - break; - case 16: - /* 4 word storage */ - for (y = h; y--; ) { - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - vp9_prefetch_store(dst + dst_stride); - - __asm__ __volatile__ ( - "ulw %[tp1], 0(%[src]) \n\t" - "ulw %[tp2], 0(%[dst]) \n\t" - "ulw %[tp3], 4(%[src]) \n\t" - "ulw %[tp4], 4(%[dst]) \n\t" - "adduh_r.qb %[tn1], %[tp2], %[tp1] \n\t" /* average */ - "ulw %[tp1], 8(%[src]) \n\t" - "ulw %[tp2], 8(%[dst]) \n\t" - "sw %[tn1], 0(%[dst]) \n\t" /* store */ - "adduh_r.qb %[tn2], %[tp3], %[tp4] \n\t" /* average */ - "sw %[tn2], 4(%[dst]) \n\t" /* store */ - "ulw %[tp3], 12(%[src]) \n\t" - "ulw %[tp4], 12(%[dst]) \n\t" - "adduh_r.qb %[tn1], %[tp2], %[tp1] \n\t" /* average */ - "sw %[tn1], 8(%[dst]) \n\t" /* store */ - "adduh_r.qb %[tn2], %[tp3], %[tp4] \n\t" /* average */ - "sw %[tn2], 12(%[dst]) \n\t" /* store */ - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), - [tp3] "=&r" (tp3), [tp4] "=&r" (tp4), - [tn1] "=&r" (tn1), [tn2] "=&r" (tn2) - : [src] "r" (src), [dst] "r" (dst) - ); - - src += src_stride; - dst += dst_stride; - } - break; - case 32: - /* 8 word storage */ - for (y = h; y--; ) { - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - vp9_prefetch_store(dst + dst_stride); - - __asm__ __volatile__ ( - "ulw %[tp1], 0(%[src]) \n\t" - "ulw %[tp2], 0(%[dst]) \n\t" - "ulw %[tp3], 4(%[src]) \n\t" - "ulw %[tp4], 4(%[dst]) \n\t" - "adduh_r.qb %[tn1], %[tp2], %[tp1] \n\t" /* average */ - "ulw %[tp1], 8(%[src]) \n\t" - "ulw %[tp2], 8(%[dst]) \n\t" - "sw %[tn1], 0(%[dst]) \n\t" /* store */ - "adduh_r.qb %[tn2], %[tp3], %[tp4] \n\t" /* average */ - "sw %[tn2], 4(%[dst]) \n\t" /* store */ - "ulw %[tp3], 12(%[src]) \n\t" - "ulw %[tp4], 12(%[dst]) \n\t" - "adduh_r.qb %[tn1], %[tp2], %[tp1] \n\t" /* average */ - "ulw %[tp1], 16(%[src]) \n\t" - "ulw %[tp2], 16(%[dst]) \n\t" - "sw %[tn1], 8(%[dst]) \n\t" /* store */ - "adduh_r.qb %[tn2], %[tp3], %[tp4] \n\t" /* average */ - "sw %[tn2], 12(%[dst]) \n\t" /* store */ - "ulw %[tp3], 20(%[src]) \n\t" - "ulw %[tp4], 20(%[dst]) \n\t" - "adduh_r.qb %[tn1], %[tp2], %[tp1] \n\t" /* average */ - "ulw %[tp1], 24(%[src]) \n\t" - "ulw %[tp2], 24(%[dst]) \n\t" - "sw %[tn1], 16(%[dst]) \n\t" /* store */ - "adduh_r.qb %[tn2], %[tp3], %[tp4] \n\t" /* average */ - "sw %[tn2], 20(%[dst]) \n\t" /* store */ - "ulw %[tp3], 28(%[src]) \n\t" - "ulw %[tp4], 28(%[dst]) \n\t" - "adduh_r.qb %[tn1], %[tp2], %[tp1] \n\t" /* average */ - "sw %[tn1], 24(%[dst]) \n\t" /* store */ - "adduh_r.qb %[tn2], %[tp3], %[tp4] \n\t" /* average */ - "sw %[tn2], 28(%[dst]) \n\t" /* store */ - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), - [tp3] "=&r" (tp3), [tp4] "=&r" (tp4), - [tn1] "=&r" (tn1), [tn2] "=&r" (tn2) - : [src] "r" (src), [dst] "r" (dst) - ); - - src += src_stride; - dst += dst_stride; - } - break; - case 64: - vp9_prefetch_load(src + 64); - vp9_prefetch_store(dst + 32); - - /* 16 word storage */ - for (y = h; y--; ) { - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - vp9_prefetch_load(src + src_stride + 64); - vp9_prefetch_store(dst + dst_stride); - vp9_prefetch_store(dst + dst_stride + 32); - - __asm__ __volatile__ ( - "ulw %[tp1], 0(%[src]) \n\t" - "ulw %[tp2], 0(%[dst]) \n\t" - "ulw %[tp3], 4(%[src]) \n\t" - "ulw %[tp4], 4(%[dst]) \n\t" - "adduh_r.qb %[tn1], %[tp2], %[tp1] \n\t" /* average */ - "ulw %[tp1], 8(%[src]) \n\t" - "ulw %[tp2], 8(%[dst]) \n\t" - "sw %[tn1], 0(%[dst]) \n\t" /* store */ - "adduh_r.qb %[tn2], %[tp3], %[tp4] \n\t" /* average */ - "sw %[tn2], 4(%[dst]) \n\t" /* store */ - "ulw %[tp3], 12(%[src]) \n\t" - "ulw %[tp4], 12(%[dst]) \n\t" - "adduh_r.qb %[tn1], %[tp2], %[tp1] \n\t" /* average */ - "ulw %[tp1], 16(%[src]) \n\t" - "ulw %[tp2], 16(%[dst]) \n\t" - "sw %[tn1], 8(%[dst]) \n\t" /* store */ - "adduh_r.qb %[tn2], %[tp3], %[tp4] \n\t" /* average */ - "sw %[tn2], 12(%[dst]) \n\t" /* store */ - "ulw %[tp3], 20(%[src]) \n\t" - "ulw %[tp4], 20(%[dst]) \n\t" - "adduh_r.qb %[tn1], %[tp2], %[tp1] \n\t" /* average */ - "ulw %[tp1], 24(%[src]) \n\t" - "ulw %[tp2], 24(%[dst]) \n\t" - "sw %[tn1], 16(%[dst]) \n\t" /* store */ - "adduh_r.qb %[tn2], %[tp3], %[tp4] \n\t" /* average */ - "sw %[tn2], 20(%[dst]) \n\t" /* store */ - "ulw %[tp3], 28(%[src]) \n\t" - "ulw %[tp4], 28(%[dst]) \n\t" - "adduh_r.qb %[tn1], %[tp2], %[tp1] \n\t" /* average */ - "ulw %[tp1], 32(%[src]) \n\t" - "ulw %[tp2], 32(%[dst]) \n\t" - "sw %[tn1], 24(%[dst]) \n\t" /* store */ - "adduh_r.qb %[tn2], %[tp3], %[tp4] \n\t" /* average */ - "sw %[tn2], 28(%[dst]) \n\t" /* store */ - "ulw %[tp3], 36(%[src]) \n\t" - "ulw %[tp4], 36(%[dst]) \n\t" - "adduh_r.qb %[tn1], %[tp2], %[tp1] \n\t" /* average */ - "ulw %[tp1], 40(%[src]) \n\t" - "ulw %[tp2], 40(%[dst]) \n\t" - "sw %[tn1], 32(%[dst]) \n\t" /* store */ - "adduh_r.qb %[tn2], %[tp3], %[tp4] \n\t" /* average */ - "sw %[tn2], 36(%[dst]) \n\t" /* store */ - "ulw %[tp3], 44(%[src]) \n\t" - "ulw %[tp4], 44(%[dst]) \n\t" - "adduh_r.qb %[tn1], %[tp2], %[tp1] \n\t" /* average */ - "ulw %[tp1], 48(%[src]) \n\t" - "ulw %[tp2], 48(%[dst]) \n\t" - "sw %[tn1], 40(%[dst]) \n\t" /* store */ - "adduh_r.qb %[tn2], %[tp3], %[tp4] \n\t" /* average */ - "sw %[tn2], 44(%[dst]) \n\t" /* store */ - "ulw %[tp3], 52(%[src]) \n\t" - "ulw %[tp4], 52(%[dst]) \n\t" - "adduh_r.qb %[tn1], %[tp2], %[tp1] \n\t" /* average */ - "ulw %[tp1], 56(%[src]) \n\t" - "ulw %[tp2], 56(%[dst]) \n\t" - "sw %[tn1], 48(%[dst]) \n\t" /* store */ - "adduh_r.qb %[tn2], %[tp3], %[tp4] \n\t" /* average */ - "sw %[tn2], 52(%[dst]) \n\t" /* store */ - "ulw %[tp3], 60(%[src]) \n\t" - "ulw %[tp4], 60(%[dst]) \n\t" - "adduh_r.qb %[tn1], %[tp2], %[tp1] \n\t" /* average */ - "sw %[tn1], 56(%[dst]) \n\t" /* store */ - "adduh_r.qb %[tn2], %[tp3], %[tp4] \n\t" /* average */ - "sw %[tn2], 60(%[dst]) \n\t" /* store */ - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), - [tp3] "=&r" (tp3), [tp4] "=&r" (tp4), - [tn1] "=&r" (tn1), [tn2] "=&r" (tn2) - : [src] "r" (src), [dst] "r" (dst) - ); - - src += src_stride; - dst += dst_stride; - } - break; - default: - for (y = h; y > 0; --y) { - for (x = 0; x < w; ++x) { - dst[x] = (dst[x] + src[x] + 1) >> 1; - } - - src += src_stride; - dst += dst_stride; - } - break; - } -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve8_avg_horiz_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve8_avg_horiz_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve8_avg_horiz_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve8_avg_horiz_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1038 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vpx_config.h" -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vpx/vpx_integer.h" -#include "vpx_ports/mem.h" -#include "vp9/common/vp9_convolve.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" - -#if HAVE_DSPR2 -static void convolve_avg_horiz_4_dspr2(const uint8_t *src, - int32_t src_stride, - uint8_t *dst, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h) { - int32_t y; - uint8_t *cm = vp9_ff_cropTbl; - int32_t vector1b, vector2b, vector3b, vector4b; - int32_t Temp1, Temp2, Temp3, Temp4; - uint32_t vector4a = 64; - uint32_t tp1, tp2; - uint32_t p1, p2, p3, p4; - uint32_t n1, n2, n3, n4; - uint32_t tn1, tn2; - - vector1b = ((const int32_t *)filter_x0)[0]; - vector2b = ((const int32_t *)filter_x0)[1]; - vector3b = ((const int32_t *)filter_x0)[2]; - vector4b = ((const int32_t *)filter_x0)[3]; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - vp9_prefetch_store(dst + dst_stride); - - __asm__ __volatile__ ( - "ulw %[tp1], 0(%[src]) \n\t" - "ulw %[tp2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[tp1] \n\t" - "preceu.ph.qbl %[p2], %[tp1] \n\t" - "preceu.ph.qbr %[p3], %[tp2] \n\t" - "preceu.ph.qbl %[p4], %[tp2] \n\t" - "dpa.w.ph $ac3, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[p3], %[vector3b] \n\t" - "ulw %[tn2], 8(%[src]) \n\t" - "dpa.w.ph $ac3, %[p4], %[vector4b] \n\t" - "extp %[Temp1], $ac3, 31 \n\t" - - /* even 2. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[tn2] \n\t" - "balign %[tn1], %[tn2], 3 \n\t" - "balign %[tn2], %[tp2], 3 \n\t" - "balign %[tp2], %[tp1], 3 \n\t" - "dpa.w.ph $ac2, %[p2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p3], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[p4], %[vector3b] \n\t" - "dpa.w.ph $ac2, %[p1], %[vector4b] \n\t" - "extp %[Temp3], $ac2, 31 \n\t" - - "lbu %[p2], 3(%[dst]) \n\t" /* load odd 2 */ - - /* odd 1. pixel */ - "lbux %[tp1], %[Temp1](%[cm]) \n\t" /* even 1 */ - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "lbu %[Temp1], 1(%[dst]) \n\t" /* load odd 1 */ - "preceu.ph.qbr %[n1], %[tp2] \n\t" - "preceu.ph.qbl %[n2], %[tp2] \n\t" - "preceu.ph.qbr %[n3], %[tn2] \n\t" - "preceu.ph.qbl %[n4], %[tn2] \n\t" - "dpa.w.ph $ac3, %[n1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[n2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[n3], %[vector3b] \n\t" - "dpa.w.ph $ac3, %[n4], %[vector4b] \n\t" - "extp %[Temp2], $ac3, 31 \n\t" - - "lbu %[tn2], 0(%[dst]) \n\t" /* load even 1 */ - - /* odd 2. pixel */ - "lbux %[tp2], %[Temp3](%[cm]) \n\t" /* even 2 */ - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[n1], %[tn1] \n\t" - "lbux %[tn1], %[Temp2](%[cm]) \n\t" /* odd 1 */ - "addqh_r.w %[tn2], %[tn2], %[tp1] \n\t" /* average even 1 */ - "dpa.w.ph $ac2, %[n2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[n3], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[n4], %[vector3b] \n\t" - "dpa.w.ph $ac2, %[n1], %[vector4b] \n\t" - "extp %[Temp4], $ac2, 31 \n\t" - - "lbu %[tp1], 2(%[dst]) \n\t" /* load even 2 */ - "sb %[tn2], 0(%[dst]) \n\t" /* store even 1 */ - - /* clamp */ - "addqh_r.w %[Temp1], %[Temp1], %[tn1] \n\t" /* average odd 1 */ - "lbux %[n2], %[Temp4](%[cm]) \n\t" /* odd 2 */ - "sb %[Temp1], 1(%[dst]) \n\t" /* store odd 1 */ - - "addqh_r.w %[tp1], %[tp1], %[tp2] \n\t" /* average even 2 */ - "sb %[tp1], 2(%[dst]) \n\t" /* store even 2 */ - - "addqh_r.w %[p2], %[p2], %[n2] \n\t" /* average odd 2 */ - "sb %[p2], 3(%[dst]) \n\t" /* store odd 2 */ - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), - [tn1] "=&r" (tn1), [tn2] "=&r" (tn2), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4), - [n1] "=&r" (n1), [n2] "=&r" (n2), [n3] "=&r" (n3), [n4] "=&r" (n4), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=&r" (Temp4) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector3b] "r" (vector3b), [vector4b] "r" (vector4b), - [vector4a] "r" (vector4a), - [cm] "r" (cm), [dst] "r" (dst), [src] "r" (src) - ); - - /* Next row... */ - src += src_stride; - dst += dst_stride; - } -} - -static void convolve_avg_horiz_8_dspr2(const uint8_t *src, - int32_t src_stride, - uint8_t *dst, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h) { - int32_t y; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector4a = 64; - int32_t vector1b, vector2b, vector3b, vector4b; - int32_t Temp1, Temp2, Temp3; - uint32_t tp1, tp2; - uint32_t p1, p2, p3, p4, n1; - uint32_t tn1, tn2, tn3; - uint32_t st0, st1; - - vector1b = ((const int32_t *)filter_x0)[0]; - vector2b = ((const int32_t *)filter_x0)[1]; - vector3b = ((const int32_t *)filter_x0)[2]; - vector4b = ((const int32_t *)filter_x0)[3]; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - vp9_prefetch_store(dst + dst_stride); - - __asm__ __volatile__ ( - "ulw %[tp1], 0(%[src]) \n\t" - "ulw %[tp2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[tp1] \n\t" - "preceu.ph.qbl %[p2], %[tp1] \n\t" - "preceu.ph.qbr %[p3], %[tp2] \n\t" - "preceu.ph.qbl %[p4], %[tp2] \n\t" - "ulw %[tn2], 8(%[src]) \n\t" - "dpa.w.ph $ac3, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[p3], %[vector3b] \n\t" - "dpa.w.ph $ac3, %[p4], %[vector4b] \n\t" - "extp %[Temp1], $ac3, 31 \n\t" - "lbu %[Temp2], 0(%[dst]) \n\t" - "lbu %[tn3], 2(%[dst]) \n\t" - - /* even 2. pixel */ - "preceu.ph.qbr %[p1], %[tn2] \n\t" - "preceu.ph.qbl %[n1], %[tn2] \n\t" - "ulw %[tn1], 12(%[src]) \n\t" - "dpa.w.ph $ac2, %[p2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p3], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[p4], %[vector3b] \n\t" - "dpa.w.ph $ac2, %[p1], %[vector4b] \n\t" - "extp %[Temp3], $ac2, 31 \n\t" - - /* even 3. pixel */ - "lbux %[st0], %[Temp1](%[cm]) \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p2], %[tn1] \n\t" - "lbux %[st1], %[Temp3](%[cm]) \n\t" - "dpa.w.ph $ac1, %[p3], %[vector1b] \n\t" - "dpa.w.ph $ac1, %[p4], %[vector2b] \n\t" - "dpa.w.ph $ac1, %[p1], %[vector3b] \n\t" - "dpa.w.ph $ac1, %[n1], %[vector4b] \n\t" - "extp %[Temp1], $ac1, 31 \n\t" - - "addqh_r.w %[Temp2], %[Temp2], %[st0] \n\t" - "addqh_r.w %[tn3], %[tn3], %[st1] \n\t" - "sb %[Temp2], 0(%[dst]) \n\t" - "sb %[tn3], 2(%[dst]) \n\t" - - /* even 4. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "balign %[tn3], %[tn1], 3 \n\t" - "balign %[tn1], %[tn2], 3 \n\t" - "balign %[tn2], %[tp2], 3 \n\t" - "balign %[tp2], %[tp1], 3 \n\t" - - "lbux %[st0], %[Temp1](%[cm]) \n\t" - "lbu %[Temp2], 4(%[dst]) \n\t" - "addqh_r.w %[Temp2], %[Temp2], %[st0] \n\t" - - "dpa.w.ph $ac2, %[p4], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p1], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[n1], %[vector3b] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector4b] \n\t" - "extp %[Temp3], $ac2, 31 \n\t" - - /* odd 1. pixel */ - "mtlo %[vector4a], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "sb %[Temp2], 4(%[dst]) \n\t" - "preceu.ph.qbr %[p1], %[tp2] \n\t" - "preceu.ph.qbl %[p2], %[tp2] \n\t" - "preceu.ph.qbr %[p3], %[tn2] \n\t" - "preceu.ph.qbl %[p4], %[tn2] \n\t" - "dpa.w.ph $ac3, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[p3], %[vector3b] \n\t" - "dpa.w.ph $ac3, %[p4], %[vector4b] \n\t" - "extp %[Temp2], $ac3, 31 \n\t" - - "lbu %[tp1], 6(%[dst]) \n\t" - - /* odd 2. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[tn1] \n\t" - "preceu.ph.qbl %[n1], %[tn1] \n\t" - "lbux %[st0], %[Temp3](%[cm]) \n\t" - "dpa.w.ph $ac1, %[p2], %[vector1b] \n\t" - "dpa.w.ph $ac1, %[p3], %[vector2b] \n\t" - "dpa.w.ph $ac1, %[p4], %[vector3b] \n\t" - "dpa.w.ph $ac1, %[p1], %[vector4b] \n\t" - "extp %[Temp3], $ac1, 31 \n\t" - - "lbu %[tp2], 1(%[dst]) \n\t" - "lbu %[tn2], 3(%[dst]) \n\t" - "addqh_r.w %[tp1], %[tp1], %[st0] \n\t" - - /* odd 3. pixel */ - "lbux %[st1], %[Temp2](%[cm]) \n\t" - "preceu.ph.qbr %[p2], %[tn3] \n\t" - "dpa.w.ph $ac3, %[p3], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p4], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[p1], %[vector3b] \n\t" - "dpa.w.ph $ac3, %[n1], %[vector4b] \n\t" - "addqh_r.w %[tp2], %[tp2], %[st1] \n\t" - "extp %[Temp2], $ac3, 31 \n\t" - - "lbu %[tn3], 5(%[dst]) \n\t" - - /* odd 4. pixel */ - "sb %[tp2], 1(%[dst]) \n\t" - "sb %[tp1], 6(%[dst]) \n\t" - "dpa.w.ph $ac2, %[p4], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p1], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[n1], %[vector3b] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector4b] \n\t" - "extp %[Temp1], $ac2, 31 \n\t" - - "lbu %[tn1], 7(%[dst]) \n\t" - - /* clamp */ - "lbux %[p4], %[Temp3](%[cm]) \n\t" - "addqh_r.w %[tn2], %[tn2], %[p4] \n\t" - - "lbux %[p2], %[Temp2](%[cm]) \n\t" - "addqh_r.w %[tn3], %[tn3], %[p2] \n\t" - - "lbux %[n1], %[Temp1](%[cm]) \n\t" - "addqh_r.w %[tn1], %[tn1], %[n1] \n\t" - - /* store bytes */ - "sb %[tn2], 3(%[dst]) \n\t" - "sb %[tn3], 5(%[dst]) \n\t" - "sb %[tn1], 7(%[dst]) \n\t" - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), - [tn1] "=&r" (tn1), [tn2] "=&r" (tn2), [tn3] "=&r" (tn3), - [st0] "=&r" (st0), [st1] "=&r" (st1), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4), - [n1] "=&r" (n1), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector3b] "r" (vector3b), [vector4b] "r" (vector4b), - [vector4a] "r" (vector4a), - [cm] "r" (cm), [dst] "r" (dst), [src] "r" (src) - ); - - /* Next row... */ - src += src_stride; - dst += dst_stride; - } -} - -static void convolve_avg_horiz_16_dspr2(const uint8_t *src_ptr, - int32_t src_stride, - uint8_t *dst_ptr, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h, - int32_t count) { - int32_t y, c; - const uint8_t *src; - uint8_t *dst; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector_64 = 64; - int32_t filter12, filter34, filter56, filter78; - int32_t Temp1, Temp2, Temp3; - uint32_t qload1, qload2, qload3; - uint32_t p1, p2, p3, p4, p5; - uint32_t st1, st2, st3; - - filter12 = ((const int32_t *)filter_x0)[0]; - filter34 = ((const int32_t *)filter_x0)[1]; - filter56 = ((const int32_t *)filter_x0)[2]; - filter78 = ((const int32_t *)filter_x0)[3]; - - for (y = h; y--;) { - src = src_ptr; - dst = dst_ptr; - - /* prefetch data to cache memory */ - vp9_prefetch_load(src_ptr + src_stride); - vp9_prefetch_load(src_ptr + src_stride + 32); - vp9_prefetch_store(dst_ptr + dst_stride); - - for (c = 0; c < count; c++) { - __asm__ __volatile__ ( - "ulw %[qload1], 0(%[src]) \n\t" - "ulw %[qload2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 1 */ - "mthi $zero, $ac1 \n\t" - "mtlo %[vector_64], $ac2 \n\t" /* even 2 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "ulw %[qload3], 8(%[src]) \n\t" - "dpa.w.ph $ac1, %[p1], %[filter12] \n\t" /* even 1 */ - "dpa.w.ph $ac1, %[p2], %[filter34] \n\t" /* even 1 */ - "dpa.w.ph $ac1, %[p3], %[filter56] \n\t" /* even 1 */ - "dpa.w.ph $ac1, %[p4], %[filter78] \n\t" /* even 1 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 1 */ - "lbu %[st2], 0(%[dst]) \n\t" /* load even 1 from dst */ - - /* even 2. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 3 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[qload3] \n\t" - "preceu.ph.qbl %[p5], %[qload3] \n\t" - "ulw %[qload1], 12(%[src]) \n\t" - "dpa.w.ph $ac2, %[p2], %[filter12] \n\t" /* even 1 */ - "dpa.w.ph $ac2, %[p3], %[filter34] \n\t" /* even 1 */ - "dpa.w.ph $ac2, %[p4], %[filter56] \n\t" /* even 1 */ - "dpa.w.ph $ac2, %[p1], %[filter78] \n\t" /* even 1 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 1 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 1 */ - - "lbu %[qload3], 2(%[dst]) \n\t" /* load even 2 from dst */ - - /* even 3. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 4 */ - "mthi $zero, $ac1 \n\t" - "addqh_r.w %[st2], %[st2], %[st1] \n\t" /* average even 1 */ - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "sb %[st2], 0(%[dst]) \n\t" /* store even 1 to dst */ - "dpa.w.ph $ac3, %[p3], %[filter12] \n\t" /* even 3 */ - "dpa.w.ph $ac3, %[p4], %[filter34] \n\t" /* even 3 */ - "dpa.w.ph $ac3, %[p1], %[filter56] \n\t" /* even 3 */ - "dpa.w.ph $ac3, %[p5], %[filter78] \n\t" /* even 3 */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 3 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 1 */ - - /* even 4. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 5 */ - "mthi $zero, $ac2 \n\t" - "addqh_r.w %[qload3], %[qload3], %[st2] \n\t" /* average even 2 */ - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[qload3], 2(%[dst]) \n\t" /* store even 2 to dst */ - "ulw %[qload2], 16(%[src]) \n\t" - "lbu %[qload3], 4(%[dst]) \n\t" /* load even 3 from dst */ - "lbu %[qload1], 6(%[dst]) \n\t" /* load even 4 from dst */ - "dpa.w.ph $ac1, %[p4], %[filter12] \n\t" /* even 4 */ - "dpa.w.ph $ac1, %[p1], %[filter34] \n\t" /* even 4 */ - "dpa.w.ph $ac1, %[p5], %[filter56] \n\t" /* even 4 */ - "dpa.w.ph $ac1, %[p2], %[filter78] \n\t" /* even 4 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 4 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 3 */ - - /* even 5. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 6 */ - "mthi $zero, $ac3 \n\t" - "addqh_r.w %[qload3], %[qload3], %[st3] \n\t" /* average even 3 */ - "preceu.ph.qbr %[p4], %[qload2] \n\t" - "sb %[qload3], 4(%[dst]) \n\t" /* store even 3 to dst */ - "dpa.w.ph $ac2, %[p1], %[filter12] \n\t" /* even 5 */ - "dpa.w.ph $ac2, %[p5], %[filter34] \n\t" /* even 5 */ - "dpa.w.ph $ac2, %[p2], %[filter56] \n\t" /* even 5 */ - "dpa.w.ph $ac2, %[p3], %[filter78] \n\t" /* even 5 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 5 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 4 */ - - /* even 6. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 7 */ - "mthi $zero, $ac1 \n\t" - "addqh_r.w %[qload1], %[qload1], %[st1] \n\t" /* average even 4 */ - "preceu.ph.qbl %[p1], %[qload2] \n\t" - "sb %[qload1], 6(%[dst]) \n\t" /* store even 4 to dst */ - "ulw %[qload3], 20(%[src]) \n\t" - "dpa.w.ph $ac3, %[p5], %[filter12] \n\t" /* even 6 */ - "dpa.w.ph $ac3, %[p2], %[filter34] \n\t" /* even 6 */ - "dpa.w.ph $ac3, %[p3], %[filter56] \n\t" /* even 6 */ - "dpa.w.ph $ac3, %[p4], %[filter78] \n\t" /* even 6 */ - "lbu %[qload2], 8(%[dst]) \n\t" /* load even 5 from dst */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 6 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 5 */ - - /* even 7. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 8 */ - "mthi $zero, $ac2 \n\t" - "addqh_r.w %[qload2], %[qload2], %[st2] \n\t" /* average even 5 */ - "preceu.ph.qbr %[p5], %[qload3] \n\t" - "sb %[qload2], 8(%[dst]) \n\t" /* store even 5 to dst */ - "dpa.w.ph $ac1, %[p2], %[filter12] \n\t" /* even 7 */ - "dpa.w.ph $ac1, %[p3], %[filter34] \n\t" /* even 7 */ - "dpa.w.ph $ac1, %[p4], %[filter56] \n\t" /* even 7 */ - "dpa.w.ph $ac1, %[p1], %[filter78] \n\t" /* even 7 */ - "lbu %[qload3], 10(%[dst]) \n\t" /* load even 6 from dst */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 7 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 6 */ - - "lbu %[st2], 12(%[dst]) \n\t" /* load even 7 from dst */ - - /* even 8. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 1 */ - "mthi $zero, $ac3 \n\t" - "addqh_r.w %[qload3], %[qload3], %[st3] \n\t" /* average even 6 */ - "dpa.w.ph $ac2, %[p3], %[filter12] \n\t" /* even 8 */ - "dpa.w.ph $ac2, %[p4], %[filter34] \n\t" /* even 8 */ - "sb %[qload3], 10(%[dst]) \n\t" /* store even 6 to dst */ - "dpa.w.ph $ac2, %[p1], %[filter56] \n\t" /* even 8 */ - "dpa.w.ph $ac2, %[p5], %[filter78] \n\t" /* even 8 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 8 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 7 */ - - /* ODD pixels */ - "ulw %[qload1], 1(%[src]) \n\t" - "ulw %[qload2], 5(%[src]) \n\t" - - "addqh_r.w %[st2], %[st2], %[st1] \n\t" /* average even 7 */ - - /* odd 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 2 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "sb %[st2], 12(%[dst]) \n\t" /* store even 7 to dst */ - "ulw %[qload3], 9(%[src]) \n\t" - "dpa.w.ph $ac3, %[p1], %[filter12] \n\t" /* odd 1 */ - "dpa.w.ph $ac3, %[p2], %[filter34] \n\t" /* odd 1 */ - "lbu %[qload2], 14(%[dst]) \n\t" /* load even 8 from dst */ - "dpa.w.ph $ac3, %[p3], %[filter56] \n\t" /* odd 1 */ - "dpa.w.ph $ac3, %[p4], %[filter78] \n\t" /* odd 1 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 1 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 8 */ - - "lbu %[st1], 1(%[dst]) \n\t" /* load odd 1 from dst */ - - /* odd 2. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 3 */ - "mthi $zero, $ac2 \n\t" - "addqh_r.w %[qload2], %[qload2], %[st2] \n\t" /* average even 8 */ - "preceu.ph.qbr %[p1], %[qload3] \n\t" - "preceu.ph.qbl %[p5], %[qload3] \n\t" - "sb %[qload2], 14(%[dst]) \n\t" /* store even 8 to dst */ - "ulw %[qload1], 13(%[src]) \n\t" - "dpa.w.ph $ac1, %[p2], %[filter12] \n\t" /* odd 2 */ - "dpa.w.ph $ac1, %[p3], %[filter34] \n\t" /* odd 2 */ - "dpa.w.ph $ac1, %[p4], %[filter56] \n\t" /* odd 2 */ - "dpa.w.ph $ac1, %[p1], %[filter78] \n\t" /* odd 2 */ - "lbu %[qload3], 3(%[dst]) \n\t" /* load odd 2 from dst */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 2 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 1 */ - - /* odd 3. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 4 */ - "mthi $zero, $ac3 \n\t" - "addqh_r.w %[st3], %[st3], %[st1] \n\t" /* average odd 1 */ - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "dpa.w.ph $ac2, %[p3], %[filter12] \n\t" /* odd 3 */ - "dpa.w.ph $ac2, %[p4], %[filter34] \n\t" /* odd 3 */ - "dpa.w.ph $ac2, %[p1], %[filter56] \n\t" /* odd 3 */ - "dpa.w.ph $ac2, %[p5], %[filter78] \n\t" /* odd 3 */ - "sb %[st3], 1(%[dst]) \n\t" /* store odd 1 to dst */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 3 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 2 */ - - /* odd 4. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 5 */ - "mthi $zero, $ac1 \n\t" - "addqh_r.w %[qload3], %[qload3], %[st1] \n\t" /* average odd 2 */ - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[qload3], 3(%[dst]) \n\t" /* store odd 2 to dst */ - "lbu %[qload1], 5(%[dst]) \n\t" /* load odd 3 from dst */ - "ulw %[qload2], 17(%[src]) \n\t" - "dpa.w.ph $ac3, %[p4], %[filter12] \n\t" /* odd 4 */ - "dpa.w.ph $ac3, %[p1], %[filter34] \n\t" /* odd 4 */ - "dpa.w.ph $ac3, %[p5], %[filter56] \n\t" /* odd 4 */ - "dpa.w.ph $ac3, %[p2], %[filter78] \n\t" /* odd 4 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 4 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 3 */ - - "lbu %[st1], 7(%[dst]) \n\t" /* load odd 4 from dst */ - - /* odd 5. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 6 */ - "mthi $zero, $ac2 \n\t" - "addqh_r.w %[qload1], %[qload1], %[st2] \n\t" /* average odd 3 */ - "preceu.ph.qbr %[p4], %[qload2] \n\t" - "sb %[qload1], 5(%[dst]) \n\t" /* store odd 3 to dst */ - "dpa.w.ph $ac1, %[p1], %[filter12] \n\t" /* odd 5 */ - "dpa.w.ph $ac1, %[p5], %[filter34] \n\t" /* odd 5 */ - "dpa.w.ph $ac1, %[p2], %[filter56] \n\t" /* odd 5 */ - "dpa.w.ph $ac1, %[p3], %[filter78] \n\t" /* odd 5 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 5 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 4 */ - - "lbu %[qload1], 9(%[dst]) \n\t" /* load odd 5 from dst */ - - /* odd 6. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 7 */ - "mthi $zero, $ac3 \n\t" - "addqh_r.w %[st1], %[st1], %[st3] \n\t" /* average odd 4 */ - "preceu.ph.qbl %[p1], %[qload2] \n\t" - "sb %[st1], 7(%[dst]) \n\t" /* store odd 4 to dst */ - "ulw %[qload3], 21(%[src]) \n\t" - "dpa.w.ph $ac2, %[p5], %[filter12] \n\t" /* odd 6 */ - "dpa.w.ph $ac2, %[p2], %[filter34] \n\t" /* odd 6 */ - "dpa.w.ph $ac2, %[p3], %[filter56] \n\t" /* odd 6 */ - "dpa.w.ph $ac2, %[p4], %[filter78] \n\t" /* odd 6 */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 6 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 5 */ - - /* odd 7. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 8 */ - "mthi $zero, $ac1 \n\t" - "addqh_r.w %[qload1], %[qload1], %[st1] \n\t" /* average odd 5 */ - "preceu.ph.qbr %[p5], %[qload3] \n\t" - "sb %[qload1], 9(%[dst]) \n\t" /* store odd 5 to dst */ - "lbu %[qload2], 11(%[dst]) \n\t" /* load odd 6 from dst */ - "dpa.w.ph $ac3, %[p2], %[filter12] \n\t" /* odd 7 */ - "dpa.w.ph $ac3, %[p3], %[filter34] \n\t" /* odd 7 */ - "dpa.w.ph $ac3, %[p4], %[filter56] \n\t" /* odd 7 */ - "dpa.w.ph $ac3, %[p1], %[filter78] \n\t" /* odd 7 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 7 */ - - "lbu %[qload3], 13(%[dst]) \n\t" /* load odd 7 from dst */ - - /* odd 8. pixel */ - "dpa.w.ph $ac1, %[p3], %[filter12] \n\t" /* odd 8 */ - "dpa.w.ph $ac1, %[p4], %[filter34] \n\t" /* odd 8 */ - "dpa.w.ph $ac1, %[p1], %[filter56] \n\t" /* odd 8 */ - "dpa.w.ph $ac1, %[p5], %[filter78] \n\t" /* odd 8 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 8 */ - - "lbu %[qload1], 15(%[dst]) \n\t" /* load odd 8 from dst */ - - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 6 */ - "addqh_r.w %[qload2], %[qload2], %[st2] \n\t" /* average odd 6 */ - - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 7 */ - "addqh_r.w %[qload3], %[qload3], %[st3] \n\t" /* average odd 7 */ - - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 8 */ - "addqh_r.w %[qload1], %[qload1], %[st1] \n\t" /* average odd 8 */ - - "sb %[qload2], 11(%[dst]) \n\t" /* store odd 6 to dst */ - "sb %[qload3], 13(%[dst]) \n\t" /* store odd 7 to dst */ - "sb %[qload1], 15(%[dst]) \n\t" /* store odd 8 to dst */ - - : [qload1] "=&r" (qload1), [qload2] "=&r" (qload2), - [st1] "=&r" (st1), [st2] "=&r" (st2), [st3] "=&r" (st3), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4), - [qload3] "=&r" (qload3), [p5] "=&r" (p5), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3) - : [filter12] "r" (filter12), [filter34] "r" (filter34), - [filter56] "r" (filter56), [filter78] "r" (filter78), - [vector_64] "r" (vector_64), - [cm] "r" (cm), [dst] "r" (dst), [src] "r" (src) - ); - - src += 16; - dst += 16; - } - - /* Next row... */ - src_ptr += src_stride; - dst_ptr += dst_stride; - } -} - -static void convolve_avg_horiz_64_dspr2(const uint8_t *src_ptr, - int32_t src_stride, - uint8_t *dst_ptr, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h) { - int32_t y, c; - const uint8_t *src; - uint8_t *dst; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector_64 = 64; - int32_t filter12, filter34, filter56, filter78; - int32_t Temp1, Temp2, Temp3; - uint32_t qload1, qload2, qload3; - uint32_t p1, p2, p3, p4, p5; - uint32_t st1, st2, st3; - - filter12 = ((const int32_t *)filter_x0)[0]; - filter34 = ((const int32_t *)filter_x0)[1]; - filter56 = ((const int32_t *)filter_x0)[2]; - filter78 = ((const int32_t *)filter_x0)[3]; - - for (y = h; y--;) { - src = src_ptr; - dst = dst_ptr; - - /* prefetch data to cache memory */ - vp9_prefetch_load(src_ptr + src_stride); - vp9_prefetch_load(src_ptr + src_stride + 32); - vp9_prefetch_load(src_ptr + src_stride + 64); - vp9_prefetch_store(dst_ptr + dst_stride); - vp9_prefetch_store(dst_ptr + dst_stride + 32); - - for (c = 0; c < 4; c++) { - __asm__ __volatile__ ( - "ulw %[qload1], 0(%[src]) \n\t" - "ulw %[qload2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 1 */ - "mthi $zero, $ac1 \n\t" - "mtlo %[vector_64], $ac2 \n\t" /* even 2 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "ulw %[qload3], 8(%[src]) \n\t" - "dpa.w.ph $ac1, %[p1], %[filter12] \n\t" /* even 1 */ - "dpa.w.ph $ac1, %[p2], %[filter34] \n\t" /* even 1 */ - "dpa.w.ph $ac1, %[p3], %[filter56] \n\t" /* even 1 */ - "dpa.w.ph $ac1, %[p4], %[filter78] \n\t" /* even 1 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 1 */ - "lbu %[st2], 0(%[dst]) \n\t" /* load even 1 from dst */ - - /* even 2. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 3 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[qload3] \n\t" - "preceu.ph.qbl %[p5], %[qload3] \n\t" - "ulw %[qload1], 12(%[src]) \n\t" - "dpa.w.ph $ac2, %[p2], %[filter12] \n\t" /* even 1 */ - "dpa.w.ph $ac2, %[p3], %[filter34] \n\t" /* even 1 */ - "dpa.w.ph $ac2, %[p4], %[filter56] \n\t" /* even 1 */ - "dpa.w.ph $ac2, %[p1], %[filter78] \n\t" /* even 1 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 1 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 1 */ - - "lbu %[qload3], 2(%[dst]) \n\t" /* load even 2 from dst */ - - /* even 3. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 4 */ - "mthi $zero, $ac1 \n\t" - "addqh_r.w %[st2], %[st2], %[st1] \n\t" /* average even 1 */ - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "sb %[st2], 0(%[dst]) \n\t" /* store even 1 to dst */ - "dpa.w.ph $ac3, %[p3], %[filter12] \n\t" /* even 3 */ - "dpa.w.ph $ac3, %[p4], %[filter34] \n\t" /* even 3 */ - "dpa.w.ph $ac3, %[p1], %[filter56] \n\t" /* even 3 */ - "dpa.w.ph $ac3, %[p5], %[filter78] \n\t" /* even 3 */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 3 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 1 */ - - /* even 4. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 5 */ - "mthi $zero, $ac2 \n\t" - "addqh_r.w %[qload3], %[qload3], %[st2] \n\t" /* average even 2 */ - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[qload3], 2(%[dst]) \n\t" /* store even 2 to dst */ - "ulw %[qload2], 16(%[src]) \n\t" - "lbu %[qload3], 4(%[dst]) \n\t" /* load even 3 from dst */ - "lbu %[qload1], 6(%[dst]) \n\t" /* load even 4 from dst */ - "dpa.w.ph $ac1, %[p4], %[filter12] \n\t" /* even 4 */ - "dpa.w.ph $ac1, %[p1], %[filter34] \n\t" /* even 4 */ - "dpa.w.ph $ac1, %[p5], %[filter56] \n\t" /* even 4 */ - "dpa.w.ph $ac1, %[p2], %[filter78] \n\t" /* even 4 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 4 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 3 */ - - /* even 5. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 6 */ - "mthi $zero, $ac3 \n\t" - "addqh_r.w %[qload3], %[qload3], %[st3] \n\t" /* average even 3 */ - "preceu.ph.qbr %[p4], %[qload2] \n\t" - "sb %[qload3], 4(%[dst]) \n\t" /* store even 3 to dst */ - "dpa.w.ph $ac2, %[p1], %[filter12] \n\t" /* even 5 */ - "dpa.w.ph $ac2, %[p5], %[filter34] \n\t" /* even 5 */ - "dpa.w.ph $ac2, %[p2], %[filter56] \n\t" /* even 5 */ - "dpa.w.ph $ac2, %[p3], %[filter78] \n\t" /* even 5 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 5 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 4 */ - - /* even 6. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 7 */ - "mthi $zero, $ac1 \n\t" - "addqh_r.w %[qload1], %[qload1], %[st1] \n\t" /* average even 4 */ - "preceu.ph.qbl %[p1], %[qload2] \n\t" - "sb %[qload1], 6(%[dst]) \n\t" /* store even 4 to dst */ - "ulw %[qload3], 20(%[src]) \n\t" - "dpa.w.ph $ac3, %[p5], %[filter12] \n\t" /* even 6 */ - "dpa.w.ph $ac3, %[p2], %[filter34] \n\t" /* even 6 */ - "dpa.w.ph $ac3, %[p3], %[filter56] \n\t" /* even 6 */ - "dpa.w.ph $ac3, %[p4], %[filter78] \n\t" /* even 6 */ - "lbu %[qload2], 8(%[dst]) \n\t" /* load even 5 from dst */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 6 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 5 */ - - /* even 7. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 8 */ - "mthi $zero, $ac2 \n\t" - "addqh_r.w %[qload2], %[qload2], %[st2] \n\t" /* average even 5 */ - "preceu.ph.qbr %[p5], %[qload3] \n\t" - "sb %[qload2], 8(%[dst]) \n\t" /* store even 5 to dst */ - "dpa.w.ph $ac1, %[p2], %[filter12] \n\t" /* even 7 */ - "dpa.w.ph $ac1, %[p3], %[filter34] \n\t" /* even 7 */ - "dpa.w.ph $ac1, %[p4], %[filter56] \n\t" /* even 7 */ - "dpa.w.ph $ac1, %[p1], %[filter78] \n\t" /* even 7 */ - "lbu %[qload3], 10(%[dst]) \n\t" /* load even 6 from dst */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 7 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 6 */ - - "lbu %[st2], 12(%[dst]) \n\t" /* load even 7 from dst */ - - /* even 8. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 1 */ - "mthi $zero, $ac3 \n\t" - "addqh_r.w %[qload3], %[qload3], %[st3] \n\t" /* average even 6 */ - "dpa.w.ph $ac2, %[p3], %[filter12] \n\t" /* even 8 */ - "dpa.w.ph $ac2, %[p4], %[filter34] \n\t" /* even 8 */ - "sb %[qload3], 10(%[dst]) \n\t" /* store even 6 to dst */ - "dpa.w.ph $ac2, %[p1], %[filter56] \n\t" /* even 8 */ - "dpa.w.ph $ac2, %[p5], %[filter78] \n\t" /* even 8 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 8 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 7 */ - - /* ODD pixels */ - "ulw %[qload1], 1(%[src]) \n\t" - "ulw %[qload2], 5(%[src]) \n\t" - - "addqh_r.w %[st2], %[st2], %[st1] \n\t" /* average even 7 */ - - /* odd 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 2 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "sb %[st2], 12(%[dst]) \n\t" /* store even 7 to dst */ - "ulw %[qload3], 9(%[src]) \n\t" - "dpa.w.ph $ac3, %[p1], %[filter12] \n\t" /* odd 1 */ - "dpa.w.ph $ac3, %[p2], %[filter34] \n\t" /* odd 1 */ - "lbu %[qload2], 14(%[dst]) \n\t" /* load even 8 from dst */ - "dpa.w.ph $ac3, %[p3], %[filter56] \n\t" /* odd 1 */ - "dpa.w.ph $ac3, %[p4], %[filter78] \n\t" /* odd 1 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 1 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 8 */ - - "lbu %[st1], 1(%[dst]) \n\t" /* load odd 1 from dst */ - - /* odd 2. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 3 */ - "mthi $zero, $ac2 \n\t" - "addqh_r.w %[qload2], %[qload2], %[st2] \n\t" /* average even 8 */ - "preceu.ph.qbr %[p1], %[qload3] \n\t" - "preceu.ph.qbl %[p5], %[qload3] \n\t" - "sb %[qload2], 14(%[dst]) \n\t" /* store even 8 to dst */ - "ulw %[qload1], 13(%[src]) \n\t" - "dpa.w.ph $ac1, %[p2], %[filter12] \n\t" /* odd 2 */ - "dpa.w.ph $ac1, %[p3], %[filter34] \n\t" /* odd 2 */ - "dpa.w.ph $ac1, %[p4], %[filter56] \n\t" /* odd 2 */ - "dpa.w.ph $ac1, %[p1], %[filter78] \n\t" /* odd 2 */ - "lbu %[qload3], 3(%[dst]) \n\t" /* load odd 2 from dst */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 2 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 1 */ - - /* odd 3. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 4 */ - "mthi $zero, $ac3 \n\t" - "addqh_r.w %[st3], %[st3], %[st1] \n\t" /* average odd 1 */ - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "dpa.w.ph $ac2, %[p3], %[filter12] \n\t" /* odd 3 */ - "dpa.w.ph $ac2, %[p4], %[filter34] \n\t" /* odd 3 */ - "dpa.w.ph $ac2, %[p1], %[filter56] \n\t" /* odd 3 */ - "dpa.w.ph $ac2, %[p5], %[filter78] \n\t" /* odd 3 */ - "sb %[st3], 1(%[dst]) \n\t" /* store odd 1 to dst */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 3 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 2 */ - - /* odd 4. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 5 */ - "mthi $zero, $ac1 \n\t" - "addqh_r.w %[qload3], %[qload3], %[st1] \n\t" /* average odd 2 */ - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[qload3], 3(%[dst]) \n\t" /* store odd 2 to dst */ - "lbu %[qload1], 5(%[dst]) \n\t" /* load odd 3 from dst */ - "ulw %[qload2], 17(%[src]) \n\t" - "dpa.w.ph $ac3, %[p4], %[filter12] \n\t" /* odd 4 */ - "dpa.w.ph $ac3, %[p1], %[filter34] \n\t" /* odd 4 */ - "dpa.w.ph $ac3, %[p5], %[filter56] \n\t" /* odd 4 */ - "dpa.w.ph $ac3, %[p2], %[filter78] \n\t" /* odd 4 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 4 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 3 */ - - "lbu %[st1], 7(%[dst]) \n\t" /* load odd 4 from dst */ - - /* odd 5. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 6 */ - "mthi $zero, $ac2 \n\t" - "addqh_r.w %[qload1], %[qload1], %[st2] \n\t" /* average odd 3 */ - "preceu.ph.qbr %[p4], %[qload2] \n\t" - "sb %[qload1], 5(%[dst]) \n\t" /* store odd 3 to dst */ - "dpa.w.ph $ac1, %[p1], %[filter12] \n\t" /* odd 5 */ - "dpa.w.ph $ac1, %[p5], %[filter34] \n\t" /* odd 5 */ - "dpa.w.ph $ac1, %[p2], %[filter56] \n\t" /* odd 5 */ - "dpa.w.ph $ac1, %[p3], %[filter78] \n\t" /* odd 5 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 5 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 4 */ - - "lbu %[qload1], 9(%[dst]) \n\t" /* load odd 5 from dst */ - - /* odd 6. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 7 */ - "mthi $zero, $ac3 \n\t" - "addqh_r.w %[st1], %[st1], %[st3] \n\t" /* average odd 4 */ - "preceu.ph.qbl %[p1], %[qload2] \n\t" - "sb %[st1], 7(%[dst]) \n\t" /* store odd 4 to dst */ - "ulw %[qload3], 21(%[src]) \n\t" - "dpa.w.ph $ac2, %[p5], %[filter12] \n\t" /* odd 6 */ - "dpa.w.ph $ac2, %[p2], %[filter34] \n\t" /* odd 6 */ - "dpa.w.ph $ac2, %[p3], %[filter56] \n\t" /* odd 6 */ - "dpa.w.ph $ac2, %[p4], %[filter78] \n\t" /* odd 6 */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 6 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 5 */ - - /* odd 7. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 8 */ - "mthi $zero, $ac1 \n\t" - "addqh_r.w %[qload1], %[qload1], %[st1] \n\t" /* average odd 5 */ - "preceu.ph.qbr %[p5], %[qload3] \n\t" - "sb %[qload1], 9(%[dst]) \n\t" /* store odd 5 to dst */ - "lbu %[qload2], 11(%[dst]) \n\t" /* load odd 6 from dst */ - "dpa.w.ph $ac3, %[p2], %[filter12] \n\t" /* odd 7 */ - "dpa.w.ph $ac3, %[p3], %[filter34] \n\t" /* odd 7 */ - "dpa.w.ph $ac3, %[p4], %[filter56] \n\t" /* odd 7 */ - "dpa.w.ph $ac3, %[p1], %[filter78] \n\t" /* odd 7 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 7 */ - - "lbu %[qload3], 13(%[dst]) \n\t" /* load odd 7 from dst */ - - /* odd 8. pixel */ - "dpa.w.ph $ac1, %[p3], %[filter12] \n\t" /* odd 8 */ - "dpa.w.ph $ac1, %[p4], %[filter34] \n\t" /* odd 8 */ - "dpa.w.ph $ac1, %[p1], %[filter56] \n\t" /* odd 8 */ - "dpa.w.ph $ac1, %[p5], %[filter78] \n\t" /* odd 8 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 8 */ - - "lbu %[qload1], 15(%[dst]) \n\t" /* load odd 8 from dst */ - - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 6 */ - "addqh_r.w %[qload2], %[qload2], %[st2] \n\t" /* average odd 6 */ - - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 7 */ - "addqh_r.w %[qload3], %[qload3], %[st3] \n\t" /* average odd 7 */ - - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 8 */ - "addqh_r.w %[qload1], %[qload1], %[st1] \n\t" /* average odd 8 */ - - "sb %[qload2], 11(%[dst]) \n\t" /* store odd 6 to dst */ - "sb %[qload3], 13(%[dst]) \n\t" /* store odd 7 to dst */ - "sb %[qload1], 15(%[dst]) \n\t" /* store odd 8 to dst */ - - : [qload1] "=&r" (qload1), [qload2] "=&r" (qload2), - [st1] "=&r" (st1), [st2] "=&r" (st2), [st3] "=&r" (st3), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4), - [qload3] "=&r" (qload3), [p5] "=&r" (p5), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3) - : [filter12] "r" (filter12), [filter34] "r" (filter34), - [filter56] "r" (filter56), [filter78] "r" (filter78), - [vector_64] "r" (vector_64), - [cm] "r" (cm), [dst] "r" (dst), [src] "r" (src) - ); - - src += 16; - dst += 16; - } - - /* Next row... */ - src_ptr += src_stride; - dst_ptr += dst_stride; - } -} - -void vp9_convolve8_avg_horiz_dspr2(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h) { - if (((const int32_t *)filter_x)[1] == 0x800000) { - vp9_convolve_avg(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - } else if (((const int32_t *)filter_x)[0] == 0) { - vp9_convolve2_avg_horiz_dspr2(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - } else { - if (16 == x_step_q4) { - uint32_t pos = 38; - - src -= 3; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - /* prefetch data to cache memory */ - vp9_prefetch_load(src); - vp9_prefetch_load(src + 32); - vp9_prefetch_store(dst); - - switch (w) { - case 4: - convolve_avg_horiz_4_dspr2(src, src_stride, - dst, dst_stride, - filter_x, h); - break; - case 8: - convolve_avg_horiz_8_dspr2(src, src_stride, - dst, dst_stride, - filter_x, h); - break; - case 16: - convolve_avg_horiz_16_dspr2(src, src_stride, - dst, dst_stride, - filter_x, h, 1); - break; - case 32: - convolve_avg_horiz_16_dspr2(src, src_stride, - dst, dst_stride, - filter_x, h, 2); - break; - case 64: - vp9_prefetch_load(src + 64); - vp9_prefetch_store(dst + 32); - - convolve_avg_horiz_64_dspr2(src, src_stride, - dst, dst_stride, - filter_x, h); - break; - default: - vp9_convolve8_avg_horiz_c(src + 3, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - break; - } - } else { - vp9_convolve8_avg_horiz_c(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - } - } -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve8_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve8_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve8_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve8_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1284 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vpx_config.h" -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vpx/vpx_integer.h" -#include "vpx_ports/mem.h" -#include "vp9/common/vp9_filter.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" - -#if HAVE_DSPR2 -uint8_t vp9_ff_cropTbl_a[256 + 2 * CROP_WIDTH]; -uint8_t *vp9_ff_cropTbl; - -void vp9_dsputil_static_init(void) { - int i; - - for (i = 0; i < 256; i++) vp9_ff_cropTbl_a[i + CROP_WIDTH] = i; - - for (i = 0; i < CROP_WIDTH; i++) { - vp9_ff_cropTbl_a[i] = 0; - vp9_ff_cropTbl_a[i + CROP_WIDTH + 256] = 255; - } - - vp9_ff_cropTbl = &vp9_ff_cropTbl_a[CROP_WIDTH]; -} - -static void convolve_horiz_4_transposed_dspr2(const uint8_t *src, - int32_t src_stride, - uint8_t *dst, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h) { - int32_t y; - uint8_t *cm = vp9_ff_cropTbl; - uint8_t *dst_ptr; - int32_t vector1b, vector2b, vector3b, vector4b; - int32_t Temp1, Temp2, Temp3, Temp4; - uint32_t vector4a = 64; - uint32_t tp1, tp2; - uint32_t p1, p2, p3, p4; - uint32_t tn1, tn2; - - vector1b = ((const int32_t *)filter_x0)[0]; - vector2b = ((const int32_t *)filter_x0)[1]; - vector3b = ((const int32_t *)filter_x0)[2]; - vector4b = ((const int32_t *)filter_x0)[3]; - - for (y = h; y--;) { - dst_ptr = dst; - /* prefetch data to cache memory */ - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - - __asm__ __volatile__ ( - "ulw %[tp1], 0(%[src]) \n\t" - "ulw %[tp2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[tp1] \n\t" - "preceu.ph.qbl %[p2], %[tp1] \n\t" - "preceu.ph.qbr %[p3], %[tp2] \n\t" - "preceu.ph.qbl %[p4], %[tp2] \n\t" - "dpa.w.ph $ac3, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[p3], %[vector3b] \n\t" - "ulw %[tn2], 8(%[src]) \n\t" - "dpa.w.ph $ac3, %[p4], %[vector4b] \n\t" - "extp %[Temp1], $ac3, 31 \n\t" - - /* even 2. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[tn2] \n\t" - "balign %[tn1], %[tn2], 3 \n\t" - "balign %[tn2], %[tp2], 3 \n\t" - "balign %[tp2], %[tp1], 3 \n\t" - "dpa.w.ph $ac2, %[p2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p3], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[p4], %[vector3b] \n\t" - "dpa.w.ph $ac2, %[p1], %[vector4b] \n\t" - "extp %[Temp3], $ac2, 31 \n\t" - - /* odd 1. pixel */ - "lbux %[tp1], %[Temp1](%[cm]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[tp2] \n\t" - "preceu.ph.qbl %[p2], %[tp2] \n\t" - "preceu.ph.qbr %[p3], %[tn2] \n\t" - "preceu.ph.qbl %[p4], %[tn2] \n\t" - "dpa.w.ph $ac3, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[p3], %[vector3b] \n\t" - "dpa.w.ph $ac3, %[p4], %[vector4b] \n\t" - "extp %[Temp2], $ac3, 31 \n\t" - - /* odd 2. pixel */ - "lbux %[tp2], %[Temp3](%[cm]) \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[tn1] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p3], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[p4], %[vector3b] \n\t" - "dpa.w.ph $ac2, %[p1], %[vector4b] \n\t" - "extp %[Temp4], $ac2, 31 \n\t" - - /* clamp */ - "lbux %[tn1], %[Temp2](%[cm]) \n\t" - "lbux %[p2], %[Temp4](%[cm]) \n\t" - - /* store bytes */ - "sb %[tp1], 0(%[dst_ptr]) \n\t" - "addu %[dst_ptr], %[dst_ptr], %[dst_stride] \n\t" - - "sb %[tn1], 0(%[dst_ptr]) \n\t" - "addu %[dst_ptr], %[dst_ptr], %[dst_stride] \n\t" - - "sb %[tp2], 0(%[dst_ptr]) \n\t" - "addu %[dst_ptr], %[dst_ptr], %[dst_stride] \n\t" - - "sb %[p2], 0(%[dst_ptr]) \n\t" - "addu %[dst_ptr], %[dst_ptr], %[dst_stride] \n\t" - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), [tn1] "=&r" (tn1), [tn2] "=&r" (tn2), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3), [Temp4] "=&r" (Temp4), - [dst_ptr] "+r" (dst_ptr) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector3b] "r" (vector3b), [vector4b] "r" (vector4b), - [vector4a] "r" (vector4a), - [cm] "r" (cm), [src] "r" (src), [dst_stride] "r" (dst_stride) - ); - - /* Next row... */ - src += src_stride; - dst += 1; - } -} - -static void convolve_horiz_8_transposed_dspr2(const uint8_t *src, - int32_t src_stride, - uint8_t *dst, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h) { - int32_t y; - uint8_t *cm = vp9_ff_cropTbl; - uint8_t *dst_ptr; - uint32_t vector4a = 64; - int32_t vector1b, vector2b, vector3b, vector4b; - int32_t Temp1, Temp2, Temp3; - uint32_t tp1, tp2, tp3; - uint32_t p1, p2, p3, p4, n1; - uint8_t *odd_dst; - uint32_t dst_pitch_2 = (dst_stride << 1); - - vector1b = ((const int32_t *)filter_x0)[0]; - vector2b = ((const int32_t *)filter_x0)[1]; - vector3b = ((const int32_t *)filter_x0)[2]; - vector4b = ((const int32_t *)filter_x0)[3]; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - - dst_ptr = dst; - odd_dst = (dst_ptr + dst_stride); - - __asm__ __volatile__ ( - "ulw %[tp2], 0(%[src]) \n\t" - "ulw %[tp1], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[tp2] \n\t" - "preceu.ph.qbl %[p2], %[tp2] \n\t" - "preceu.ph.qbr %[p3], %[tp1] \n\t" - "preceu.ph.qbl %[p4], %[tp1] \n\t" - "ulw %[tp3], 8(%[src]) \n\t" - "dpa.w.ph $ac3, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[p3], %[vector3b] \n\t" - "dpa.w.ph $ac3, %[p4], %[vector4b] \n\t" - "extp %[Temp1], $ac3, 31 \n\t" - - /* even 2. pixel */ - "preceu.ph.qbr %[p1], %[tp3] \n\t" - "preceu.ph.qbl %[n1], %[tp3] \n\t" - "ulw %[tp2], 12(%[src]) \n\t" - "dpa.w.ph $ac2, %[p2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p3], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[p4], %[vector3b] \n\t" - "dpa.w.ph $ac2, %[p1], %[vector4b] \n\t" - "extp %[Temp3], $ac2, 31 \n\t" - - /* even 3. pixel */ - "lbux %[Temp2], %[Temp1](%[cm]) \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p2], %[tp2] \n\t" - "dpa.w.ph $ac1, %[p3], %[vector1b] \n\t" - "dpa.w.ph $ac1, %[p4], %[vector2b] \n\t" - "dpa.w.ph $ac1, %[p1], %[vector3b] \n\t" - "lbux %[tp3], %[Temp3](%[cm]) \n\t" - "dpa.w.ph $ac1, %[n1], %[vector4b] \n\t" - "extp %[p3], $ac1, 31 \n\t" - - /* even 4. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "sb %[Temp2], 0(%[dst_ptr]) \n\t" - "addu %[dst_ptr], %[dst_ptr], %[dst_pitch_2] \n\t" - "sb %[tp3], 0(%[dst_ptr]) \n\t" - "addu %[dst_ptr], %[dst_ptr], %[dst_pitch_2] \n\t" - - "ulw %[tp1], 1(%[src]) \n\t" - "ulw %[tp3], 5(%[src]) \n\t" - - "dpa.w.ph $ac2, %[p4], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p1], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[n1], %[vector3b] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector4b] \n\t" - "extp %[Temp3], $ac2, 31 \n\t" - - "lbux %[tp2], %[p3](%[cm]) \n\t" - - /* odd 1. pixel */ - "mtlo %[vector4a], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p1], %[tp1] \n\t" - "preceu.ph.qbl %[p2], %[tp1] \n\t" - "preceu.ph.qbr %[p3], %[tp3] \n\t" - "preceu.ph.qbl %[p4], %[tp3] \n\t" - "sb %[tp2], 0(%[dst_ptr]) \n\t" - "addu %[dst_ptr], %[dst_ptr], %[dst_pitch_2] \n\t" - "ulw %[tp2], 9(%[src]) \n\t" - - "dpa.w.ph $ac3, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[p3], %[vector3b] \n\t" - "dpa.w.ph $ac3, %[p4], %[vector4b] \n\t" - "extp %[Temp2], $ac3, 31 \n\t" - - /* odd 2. pixel */ - "lbux %[tp1], %[Temp3](%[cm]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[tp2] \n\t" - "preceu.ph.qbl %[n1], %[tp2] \n\t" - "ulw %[Temp1], 13(%[src]) \n\t" - "dpa.w.ph $ac1, %[p2], %[vector1b] \n\t" - "sb %[tp1], 0(%[dst_ptr]) \n\t" - "addu %[dst_ptr], %[dst_ptr], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac1, %[p3], %[vector2b] \n\t" - "dpa.w.ph $ac1, %[p4], %[vector3b] \n\t" - "dpa.w.ph $ac1, %[p1], %[vector4b] \n\t" - "extp %[Temp3], $ac1, 31 \n\t" - - /* odd 3. pixel */ - "lbux %[tp3], %[Temp2](%[cm]) \n\t" - "preceu.ph.qbr %[p2], %[Temp1] \n\t" - "dpa.w.ph $ac3, %[p3], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p4], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[p1], %[vector3b] \n\t" - "dpa.w.ph $ac3, %[n1], %[vector4b] \n\t" - "extp %[Temp2], $ac3, 31 \n\t" - - /* odd 4. pixel */ - "sb %[tp3], 0(%[odd_dst]) \n\t" - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac2, %[p4], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p1], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[n1], %[vector3b] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector4b] \n\t" - "extp %[Temp1], $ac2, 31 \n\t" - - /* clamp */ - "lbux %[p4], %[Temp3](%[cm]) \n\t" - "lbux %[p2], %[Temp2](%[cm]) \n\t" - "lbux %[n1], %[Temp1](%[cm]) \n\t" - - /* store bytes */ - "sb %[p4], 0(%[odd_dst]) \n\t" - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - - "sb %[p2], 0(%[odd_dst]) \n\t" - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - - "sb %[n1], 0(%[odd_dst]) \n\t" - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), [tp3] "=&r" (tp3), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4), - [n1] "=&r" (n1), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3), - [dst_ptr] "+r" (dst_ptr), [odd_dst] "+r" (odd_dst) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector3b] "r" (vector3b), [vector4b] "r" (vector4b), - [vector4a] "r" (vector4a), [cm] "r" (cm), - [src] "r" (src), [dst_pitch_2] "r" (dst_pitch_2) - ); - - /* Next row... */ - src += src_stride; - dst += 1; - } -} - -static void convolve_horiz_16_transposed_dspr2(const uint8_t *src_ptr, - int32_t src_stride, - uint8_t *dst_ptr, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h, - int32_t count) { - int32_t c, y; - const uint8_t *src; - uint8_t *dst; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector_64 = 64; - int32_t filter12, filter34, filter56, filter78; - int32_t Temp1, Temp2, Temp3; - uint32_t qload1, qload2; - uint32_t p1, p2, p3, p4, p5; - uint32_t st1, st2, st3; - uint32_t dst_pitch_2 = (dst_stride << 1); - uint8_t *odd_dst; - - filter12 = ((const int32_t *)filter_x0)[0]; - filter34 = ((const int32_t *)filter_x0)[1]; - filter56 = ((const int32_t *)filter_x0)[2]; - filter78 = ((const int32_t *)filter_x0)[3]; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_load(src_ptr + src_stride); - vp9_prefetch_load(src_ptr + src_stride + 32); - - src = src_ptr; - dst = dst_ptr; - - odd_dst = (dst + dst_stride); - - for (c = 0; c < count; c++) { - __asm__ __volatile__ ( - "ulw %[qload1], 0(%[src]) \n\t" - "ulw %[qload2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 1 */ - "mthi $zero, $ac1 \n\t" - "mtlo %[vector_64], $ac2 \n\t" /* even 2 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "ulw %[qload2], 8(%[src]) \n\t" - "dpa.w.ph $ac1, %[p1], %[filter12] \n\t" /* even 1 */ - "dpa.w.ph $ac1, %[p2], %[filter34] \n\t" /* even 1 */ - "dpa.w.ph $ac1, %[p3], %[filter56] \n\t" /* even 1 */ - "dpa.w.ph $ac1, %[p4], %[filter78] \n\t" /* even 1 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 1 */ - - /* even 2. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 3 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[qload2] \n\t" - "preceu.ph.qbl %[p5], %[qload2] \n\t" - "ulw %[qload1], 12(%[src]) \n\t" - "dpa.w.ph $ac2, %[p2], %[filter12] \n\t" /* even 1 */ - "dpa.w.ph $ac2, %[p3], %[filter34] \n\t" /* even 1 */ - "dpa.w.ph $ac2, %[p4], %[filter56] \n\t" /* even 1 */ - "dpa.w.ph $ac2, %[p1], %[filter78] \n\t" /* even 1 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 1 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 1 */ - - /* even 3. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 4 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "sb %[st1], 0(%[dst]) \n\t" /* even 1 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac3, %[p3], %[filter12] \n\t" /* even 3 */ - "dpa.w.ph $ac3, %[p4], %[filter34] \n\t" /* even 3 */ - "dpa.w.ph $ac3, %[p1], %[filter56] \n\t" /* even 3 */ - "dpa.w.ph $ac3, %[p5], %[filter78] \n\t" /* even 3 */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 3 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 1 */ - - /* even 4. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 5 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[st2], 0(%[dst]) \n\t" /* even 2 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "ulw %[qload2], 16(%[src]) \n\t" - "dpa.w.ph $ac1, %[p4], %[filter12] \n\t" /* even 4 */ - "dpa.w.ph $ac1, %[p1], %[filter34] \n\t" /* even 4 */ - "dpa.w.ph $ac1, %[p5], %[filter56] \n\t" /* even 4 */ - "dpa.w.ph $ac1, %[p2], %[filter78] \n\t" /* even 4 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 4 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 3 */ - - /* even 5. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 6 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p4], %[qload2] \n\t" - "sb %[st3], 0(%[dst]) \n\t" /* even 3 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac2, %[p1], %[filter12] \n\t" /* even 5 */ - "dpa.w.ph $ac2, %[p5], %[filter34] \n\t" /* even 5 */ - "dpa.w.ph $ac2, %[p2], %[filter56] \n\t" /* even 5 */ - "dpa.w.ph $ac2, %[p3], %[filter78] \n\t" /* even 5 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 5 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 4 */ - - /* even 6. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 7 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbl %[p1], %[qload2] \n\t" - "sb %[st1], 0(%[dst]) \n\t" /* even 4 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "ulw %[qload1], 20(%[src]) \n\t" - "dpa.w.ph $ac3, %[p5], %[filter12] \n\t" /* even 6 */ - "dpa.w.ph $ac3, %[p2], %[filter34] \n\t" /* even 6 */ - "dpa.w.ph $ac3, %[p3], %[filter56] \n\t" /* even 6 */ - "dpa.w.ph $ac3, %[p4], %[filter78] \n\t" /* even 6 */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 6 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 5 */ - - /* even 7. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 8 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p5], %[qload1] \n\t" - "sb %[st2], 0(%[dst]) \n\t" /* even 5 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac1, %[p2], %[filter12] \n\t" /* even 7 */ - "dpa.w.ph $ac1, %[p3], %[filter34] \n\t" /* even 7 */ - "dpa.w.ph $ac1, %[p4], %[filter56] \n\t" /* even 7 */ - "dpa.w.ph $ac1, %[p1], %[filter78] \n\t" /* even 7 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 7 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 6 */ - - /* even 8. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 1 */ - "mthi $zero, $ac3 \n\t" - "dpa.w.ph $ac2, %[p3], %[filter12] \n\t" /* even 8 */ - "dpa.w.ph $ac2, %[p4], %[filter34] \n\t" /* even 8 */ - "sb %[st3], 0(%[dst]) \n\t" /* even 6 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac2, %[p1], %[filter56] \n\t" /* even 8 */ - "dpa.w.ph $ac2, %[p5], %[filter78] \n\t" /* even 8 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 8 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 7 */ - - /* ODD pixels */ - "ulw %[qload1], 1(%[src]) \n\t" - "ulw %[qload2], 5(%[src]) \n\t" - - /* odd 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 2 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "sb %[st1], 0(%[dst]) \n\t" /* even 7 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "ulw %[qload2], 9(%[src]) \n\t" - "dpa.w.ph $ac3, %[p1], %[filter12] \n\t" /* odd 1 */ - "dpa.w.ph $ac3, %[p2], %[filter34] \n\t" /* odd 1 */ - "dpa.w.ph $ac3, %[p3], %[filter56] \n\t" /* odd 1 */ - "dpa.w.ph $ac3, %[p4], %[filter78] \n\t" /* odd 1 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 1 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 8 */ - - /* odd 2. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 3 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[qload2] \n\t" - "preceu.ph.qbl %[p5], %[qload2] \n\t" - "sb %[st2], 0(%[dst]) \n\t" /* even 8 */ - "ulw %[qload1], 13(%[src]) \n\t" - "dpa.w.ph $ac1, %[p2], %[filter12] \n\t" /* odd 2 */ - "dpa.w.ph $ac1, %[p3], %[filter34] \n\t" /* odd 2 */ - "dpa.w.ph $ac1, %[p4], %[filter56] \n\t" /* odd 2 */ - "dpa.w.ph $ac1, %[p1], %[filter78] \n\t" /* odd 2 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 2 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 1 */ - - /* odd 3. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 4 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "sb %[st3], 0(%[odd_dst]) \n\t" /* odd 1 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac2, %[p3], %[filter12] \n\t" /* odd 3 */ - "dpa.w.ph $ac2, %[p4], %[filter34] \n\t" /* odd 3 */ - "dpa.w.ph $ac2, %[p1], %[filter56] \n\t" /* odd 3 */ - "dpa.w.ph $ac2, %[p5], %[filter78] \n\t" /* odd 3 */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 3 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 2 */ - - /* odd 4. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 5 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[st1], 0(%[odd_dst]) \n\t" /* odd 2 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "ulw %[qload2], 17(%[src]) \n\t" - "dpa.w.ph $ac3, %[p4], %[filter12] \n\t" /* odd 4 */ - "dpa.w.ph $ac3, %[p1], %[filter34] \n\t" /* odd 4 */ - "dpa.w.ph $ac3, %[p5], %[filter56] \n\t" /* odd 4 */ - "dpa.w.ph $ac3, %[p2], %[filter78] \n\t" /* odd 4 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 4 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 3 */ - - /* odd 5. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 6 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p4], %[qload2] \n\t" - "sb %[st2], 0(%[odd_dst]) \n\t" /* odd 3 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac1, %[p1], %[filter12] \n\t" /* odd 5 */ - "dpa.w.ph $ac1, %[p5], %[filter34] \n\t" /* odd 5 */ - "dpa.w.ph $ac1, %[p2], %[filter56] \n\t" /* odd 5 */ - "dpa.w.ph $ac1, %[p3], %[filter78] \n\t" /* odd 5 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 5 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 4 */ - - /* odd 6. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 7 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbl %[p1], %[qload2] \n\t" - "sb %[st3], 0(%[odd_dst]) \n\t" /* odd 4 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "ulw %[qload1], 21(%[src]) \n\t" - "dpa.w.ph $ac2, %[p5], %[filter12] \n\t" /* odd 6 */ - "dpa.w.ph $ac2, %[p2], %[filter34] \n\t" /* odd 6 */ - "dpa.w.ph $ac2, %[p3], %[filter56] \n\t" /* odd 6 */ - "dpa.w.ph $ac2, %[p4], %[filter78] \n\t" /* odd 6 */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 6 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 5 */ - - /* odd 7. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 8 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p5], %[qload1] \n\t" - "sb %[st1], 0(%[odd_dst]) \n\t" /* odd 5 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac3, %[p2], %[filter12] \n\t" /* odd 7 */ - "dpa.w.ph $ac3, %[p3], %[filter34] \n\t" /* odd 7 */ - "dpa.w.ph $ac3, %[p4], %[filter56] \n\t" /* odd 7 */ - "dpa.w.ph $ac3, %[p1], %[filter78] \n\t" /* odd 7 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 7 */ - - /* odd 8. pixel */ - "dpa.w.ph $ac1, %[p3], %[filter12] \n\t" /* odd 8 */ - "dpa.w.ph $ac1, %[p4], %[filter34] \n\t" /* odd 8 */ - "dpa.w.ph $ac1, %[p1], %[filter56] \n\t" /* odd 8 */ - "dpa.w.ph $ac1, %[p5], %[filter78] \n\t" /* odd 8 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 8 */ - - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 6 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 7 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 8 */ - - "sb %[st2], 0(%[odd_dst]) \n\t" /* odd 6 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - - "sb %[st3], 0(%[odd_dst]) \n\t" /* odd 7 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - - "sb %[st1], 0(%[odd_dst]) \n\t" /* odd 8 */ - - : [qload1] "=&r" (qload1), [qload2] "=&r" (qload2), [p5] "=&r" (p5), - [st1] "=&r" (st1), [st2] "=&r" (st2), [st3] "=&r" (st3), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3), - [dst] "+r" (dst), [odd_dst] "+r" (odd_dst) - : [filter12] "r" (filter12), [filter34] "r" (filter34), - [filter56] "r" (filter56), [filter78] "r" (filter78), - [vector_64] "r" (vector_64), [cm] "r" (cm), - [src] "r" (src), [dst_pitch_2] "r" (dst_pitch_2) - ); - - src += 16; - dst = (dst_ptr + ((c + 1) * 16 * dst_stride)); - odd_dst = (dst + dst_stride); - } - - /* Next row... */ - src_ptr += src_stride; - - dst_ptr += 1; - } -} - -static void convolve_horiz_64_transposed_dspr2(const uint8_t *src_ptr, - int32_t src_stride, - uint8_t *dst_ptr, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h) { - int32_t c, y; - const uint8_t *src; - uint8_t *dst; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector_64 = 64; - int32_t filter12, filter34, filter56, filter78; - int32_t Temp1, Temp2, Temp3; - uint32_t qload1, qload2; - uint32_t p1, p2, p3, p4, p5; - uint32_t st1, st2, st3; - uint32_t dst_pitch_2 = (dst_stride << 1); - uint8_t *odd_dst; - - filter12 = ((const int32_t *)filter_x0)[0]; - filter34 = ((const int32_t *)filter_x0)[1]; - filter56 = ((const int32_t *)filter_x0)[2]; - filter78 = ((const int32_t *)filter_x0)[3]; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_load(src_ptr + src_stride); - vp9_prefetch_load(src_ptr + src_stride + 32); - vp9_prefetch_load(src_ptr + src_stride + 64); - - src = src_ptr; - dst = dst_ptr; - - odd_dst = (dst + dst_stride); - - for (c = 0; c < 4; c++) { - __asm__ __volatile__ ( - "ulw %[qload1], 0(%[src]) \n\t" - "ulw %[qload2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 1 */ - "mthi $zero, $ac1 \n\t" - "mtlo %[vector_64], $ac2 \n\t" /* even 2 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "ulw %[qload2], 8(%[src]) \n\t" - "dpa.w.ph $ac1, %[p1], %[filter12] \n\t" /* even 1 */ - "dpa.w.ph $ac1, %[p2], %[filter34] \n\t" /* even 1 */ - "dpa.w.ph $ac1, %[p3], %[filter56] \n\t" /* even 1 */ - "dpa.w.ph $ac1, %[p4], %[filter78] \n\t" /* even 1 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 1 */ - - /* even 2. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 3 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[qload2] \n\t" - "preceu.ph.qbl %[p5], %[qload2] \n\t" - "ulw %[qload1], 12(%[src]) \n\t" - "dpa.w.ph $ac2, %[p2], %[filter12] \n\t" /* even 1 */ - "dpa.w.ph $ac2, %[p3], %[filter34] \n\t" /* even 1 */ - "dpa.w.ph $ac2, %[p4], %[filter56] \n\t" /* even 1 */ - "dpa.w.ph $ac2, %[p1], %[filter78] \n\t" /* even 1 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 1 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 1 */ - - /* even 3. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 4 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "sb %[st1], 0(%[dst]) \n\t" /* even 1 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac3, %[p3], %[filter12] \n\t" /* even 3 */ - "dpa.w.ph $ac3, %[p4], %[filter34] \n\t" /* even 3 */ - "dpa.w.ph $ac3, %[p1], %[filter56] \n\t" /* even 3 */ - "dpa.w.ph $ac3, %[p5], %[filter78] \n\t" /* even 3 */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 3 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 1 */ - - /* even 4. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 5 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[st2], 0(%[dst]) \n\t" /* even 2 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "ulw %[qload2], 16(%[src]) \n\t" - "dpa.w.ph $ac1, %[p4], %[filter12] \n\t" /* even 4 */ - "dpa.w.ph $ac1, %[p1], %[filter34] \n\t" /* even 4 */ - "dpa.w.ph $ac1, %[p5], %[filter56] \n\t" /* even 4 */ - "dpa.w.ph $ac1, %[p2], %[filter78] \n\t" /* even 4 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 4 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 3 */ - - /* even 5. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 6 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p4], %[qload2] \n\t" - "sb %[st3], 0(%[dst]) \n\t" /* even 3 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac2, %[p1], %[filter12] \n\t" /* even 5 */ - "dpa.w.ph $ac2, %[p5], %[filter34] \n\t" /* even 5 */ - "dpa.w.ph $ac2, %[p2], %[filter56] \n\t" /* even 5 */ - "dpa.w.ph $ac2, %[p3], %[filter78] \n\t" /* even 5 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 5 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 4 */ - - /* even 6. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 7 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbl %[p1], %[qload2] \n\t" - "sb %[st1], 0(%[dst]) \n\t" /* even 4 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "ulw %[qload1], 20(%[src]) \n\t" - "dpa.w.ph $ac3, %[p5], %[filter12] \n\t" /* even 6 */ - "dpa.w.ph $ac3, %[p2], %[filter34] \n\t" /* even 6 */ - "dpa.w.ph $ac3, %[p3], %[filter56] \n\t" /* even 6 */ - "dpa.w.ph $ac3, %[p4], %[filter78] \n\t" /* even 6 */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 6 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 5 */ - - /* even 7. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 8 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p5], %[qload1] \n\t" - "sb %[st2], 0(%[dst]) \n\t" /* even 5 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac1, %[p2], %[filter12] \n\t" /* even 7 */ - "dpa.w.ph $ac1, %[p3], %[filter34] \n\t" /* even 7 */ - "dpa.w.ph $ac1, %[p4], %[filter56] \n\t" /* even 7 */ - "dpa.w.ph $ac1, %[p1], %[filter78] \n\t" /* even 7 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 7 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 6 */ - - /* even 8. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 1 */ - "mthi $zero, $ac3 \n\t" - "dpa.w.ph $ac2, %[p3], %[filter12] \n\t" /* even 8 */ - "dpa.w.ph $ac2, %[p4], %[filter34] \n\t" /* even 8 */ - "sb %[st3], 0(%[dst]) \n\t" /* even 6 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac2, %[p1], %[filter56] \n\t" /* even 8 */ - "dpa.w.ph $ac2, %[p5], %[filter78] \n\t" /* even 8 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 8 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 7 */ - - /* ODD pixels */ - "ulw %[qload1], 1(%[src]) \n\t" - "ulw %[qload2], 5(%[src]) \n\t" - - /* odd 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 2 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "sb %[st1], 0(%[dst]) \n\t" /* even 7 */ - "addu %[dst], %[dst], %[dst_pitch_2] \n\t" - "ulw %[qload2], 9(%[src]) \n\t" - "dpa.w.ph $ac3, %[p1], %[filter12] \n\t" /* odd 1 */ - "dpa.w.ph $ac3, %[p2], %[filter34] \n\t" /* odd 1 */ - "dpa.w.ph $ac3, %[p3], %[filter56] \n\t" /* odd 1 */ - "dpa.w.ph $ac3, %[p4], %[filter78] \n\t" /* odd 1 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 1 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 8 */ - - /* odd 2. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 3 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[qload2] \n\t" - "preceu.ph.qbl %[p5], %[qload2] \n\t" - "sb %[st2], 0(%[dst]) \n\t" /* even 8 */ - "ulw %[qload1], 13(%[src]) \n\t" - "dpa.w.ph $ac1, %[p2], %[filter12] \n\t" /* odd 2 */ - "dpa.w.ph $ac1, %[p3], %[filter34] \n\t" /* odd 2 */ - "dpa.w.ph $ac1, %[p4], %[filter56] \n\t" /* odd 2 */ - "dpa.w.ph $ac1, %[p1], %[filter78] \n\t" /* odd 2 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 2 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 1 */ - - /* odd 3. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 4 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "sb %[st3], 0(%[odd_dst]) \n\t" /* odd 1 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac2, %[p3], %[filter12] \n\t" /* odd 3 */ - "dpa.w.ph $ac2, %[p4], %[filter34] \n\t" /* odd 3 */ - "dpa.w.ph $ac2, %[p1], %[filter56] \n\t" /* odd 3 */ - "dpa.w.ph $ac2, %[p5], %[filter78] \n\t" /* odd 3 */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 3 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 2 */ - - /* odd 4. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 5 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[st1], 0(%[odd_dst]) \n\t" /* odd 2 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "ulw %[qload2], 17(%[src]) \n\t" - "dpa.w.ph $ac3, %[p4], %[filter12] \n\t" /* odd 4 */ - "dpa.w.ph $ac3, %[p1], %[filter34] \n\t" /* odd 4 */ - "dpa.w.ph $ac3, %[p5], %[filter56] \n\t" /* odd 4 */ - "dpa.w.ph $ac3, %[p2], %[filter78] \n\t" /* odd 4 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 4 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 3 */ - - /* odd 5. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 6 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p4], %[qload2] \n\t" - "sb %[st2], 0(%[odd_dst]) \n\t" /* odd 3 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac1, %[p1], %[filter12] \n\t" /* odd 5 */ - "dpa.w.ph $ac1, %[p5], %[filter34] \n\t" /* odd 5 */ - "dpa.w.ph $ac1, %[p2], %[filter56] \n\t" /* odd 5 */ - "dpa.w.ph $ac1, %[p3], %[filter78] \n\t" /* odd 5 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 5 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 4 */ - - /* odd 6. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 7 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbl %[p1], %[qload2] \n\t" - "sb %[st3], 0(%[odd_dst]) \n\t" /* odd 4 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "ulw %[qload1], 21(%[src]) \n\t" - "dpa.w.ph $ac2, %[p5], %[filter12] \n\t" /* odd 6 */ - "dpa.w.ph $ac2, %[p2], %[filter34] \n\t" /* odd 6 */ - "dpa.w.ph $ac2, %[p3], %[filter56] \n\t" /* odd 6 */ - "dpa.w.ph $ac2, %[p4], %[filter78] \n\t" /* odd 6 */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 6 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 5 */ - - /* odd 7. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 8 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p5], %[qload1] \n\t" - "sb %[st1], 0(%[odd_dst]) \n\t" /* odd 5 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - "dpa.w.ph $ac3, %[p2], %[filter12] \n\t" /* odd 7 */ - "dpa.w.ph $ac3, %[p3], %[filter34] \n\t" /* odd 7 */ - "dpa.w.ph $ac3, %[p4], %[filter56] \n\t" /* odd 7 */ - "dpa.w.ph $ac3, %[p1], %[filter78] \n\t" /* odd 7 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 7 */ - - /* odd 8. pixel */ - "dpa.w.ph $ac1, %[p3], %[filter12] \n\t" /* odd 8 */ - "dpa.w.ph $ac1, %[p4], %[filter34] \n\t" /* odd 8 */ - "dpa.w.ph $ac1, %[p1], %[filter56] \n\t" /* odd 8 */ - "dpa.w.ph $ac1, %[p5], %[filter78] \n\t" /* odd 8 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 8 */ - - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 6 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 7 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 8 */ - - "sb %[st2], 0(%[odd_dst]) \n\t" /* odd 6 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - - "sb %[st3], 0(%[odd_dst]) \n\t" /* odd 7 */ - "addu %[odd_dst], %[odd_dst], %[dst_pitch_2] \n\t" - - "sb %[st1], 0(%[odd_dst]) \n\t" /* odd 8 */ - - : [qload1] "=&r" (qload1), [qload2] "=&r" (qload2), [p5] "=&r" (p5), - [st1] "=&r" (st1), [st2] "=&r" (st2), [st3] "=&r" (st3), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3), - [dst] "+r" (dst), [odd_dst] "+r" (odd_dst) - : [filter12] "r" (filter12), [filter34] "r" (filter34), - [filter56] "r" (filter56), [filter78] "r" (filter78), - [vector_64] "r" (vector_64), [cm] "r" (cm), - [src] "r" (src), [dst_pitch_2] "r" (dst_pitch_2) - ); - - src += 16; - dst = (dst_ptr + ((c + 1) * 16 * dst_stride)); - odd_dst = (dst + dst_stride); - } - - /* Next row... */ - src_ptr += src_stride; - - dst_ptr += 1; - } -} - -void convolve_horiz_transposed(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter, int w, int h) { - int x, y, k; - - for (y = 0; y < h; ++y) { - for (x = 0; x < w; ++x) { - int sum = 0; - - for (k = 0; k < 8; ++k) - sum += src[x + k] * filter[k]; - - dst[x * dst_stride] = clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS)); - } - - src += src_stride; - dst += 1; - } -} - -void copy_horiz_transposed(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - int w, int h) { - int x, y; - - for (y = 0; y < h; ++y) { - for (x = 0; x < w; ++x) { - dst[x * dst_stride] = src[x]; - } - - src += src_stride; - dst += 1; - } -} - -void vp9_convolve8_dspr2(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h) { - DECLARE_ALIGNED_ARRAY(32, uint8_t, temp, 64 * 135); - int32_t intermediate_height = ((h * y_step_q4) >> 4) + 7; - uint32_t pos = 38; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - if (intermediate_height < h) - intermediate_height = h; - - if (x_step_q4 != 16 || y_step_q4 != 16) - return vp9_convolve8_c(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - - if ((((const int32_t *)filter_x)[1] == 0x800000) - && (((const int32_t *)filter_y)[1] == 0x800000)) - return vp9_convolve_copy(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - - /* copy the src to dst */ - if (filter_x[3] == 0x80) { - copy_horiz_transposed(src - src_stride * 3, src_stride, - temp, intermediate_height, - w, intermediate_height); - } else if (((const int32_t *)filter_x)[0] == 0) { - vp9_convolve2_dspr2(src - src_stride * 3, src_stride, - temp, intermediate_height, - filter_x, - w, intermediate_height); - } else { - src -= (src_stride * 3 + 3); - - /* prefetch data to cache memory */ - vp9_prefetch_load(src); - vp9_prefetch_load(src + 32); - - switch (w) { - case 4: - convolve_horiz_4_transposed_dspr2(src, src_stride, - temp, intermediate_height, - filter_x, intermediate_height); - break; - case 8: - convolve_horiz_8_transposed_dspr2(src, src_stride, - temp, intermediate_height, - filter_x, intermediate_height); - break; - case 16: - case 32: - convolve_horiz_16_transposed_dspr2(src, src_stride, - temp, intermediate_height, - filter_x, intermediate_height, - (w/16)); - break; - case 64: - vp9_prefetch_load(src + 32); - convolve_horiz_64_transposed_dspr2(src, src_stride, - temp, intermediate_height, - filter_x, intermediate_height); - break; - default: - convolve_horiz_transposed(src, src_stride, - temp, intermediate_height, - filter_x, w, intermediate_height); - break; - } - } - - /* copy the src to dst */ - if (filter_y[3] == 0x80) { - copy_horiz_transposed(temp + 3, intermediate_height, - dst, dst_stride, - h, w); - } else if (((const int32_t *)filter_y)[0] == 0) { - vp9_convolve2_dspr2(temp + 3, intermediate_height, - dst, dst_stride, - filter_y, - h, w); - } else { - switch (h) { - case 4: - convolve_horiz_4_transposed_dspr2(temp, intermediate_height, - dst, dst_stride, - filter_y, w); - break; - case 8: - convolve_horiz_8_transposed_dspr2(temp, intermediate_height, - dst, dst_stride, - filter_y, w); - break; - case 16: - case 32: - convolve_horiz_16_transposed_dspr2(temp, intermediate_height, - dst, dst_stride, - filter_y, w, (h/16)); - break; - case 64: - convolve_horiz_64_transposed_dspr2(temp, intermediate_height, - dst, dst_stride, - filter_y, w); - break; - default: - convolve_horiz_transposed(temp, intermediate_height, - dst, dst_stride, - filter_y, h, w); - break; - } - } -} - -void vp9_convolve_copy_dspr2(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int filter_x_stride, - const int16_t *filter_y, int filter_y_stride, - int w, int h) { - int x, y; - - /* prefetch data to cache memory */ - vp9_prefetch_load(src); - vp9_prefetch_load(src + 32); - vp9_prefetch_store(dst); - - switch (w) { - case 4: - { - uint32_t tp1; - - /* 1 word storage */ - for (y = h; y--; ) { - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - vp9_prefetch_store(dst + dst_stride); - - __asm__ __volatile__ ( - "ulw %[tp1], (%[src]) \n\t" - "sw %[tp1], (%[dst]) \n\t" /* store */ - - : [tp1] "=&r" (tp1) - : [src] "r" (src), [dst] "r" (dst) - ); - - src += src_stride; - dst += dst_stride; - } - } - break; - case 8: - { - uint32_t tp1, tp2; - - /* 2 word storage */ - for (y = h; y--; ) { - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - vp9_prefetch_store(dst + dst_stride); - - __asm__ __volatile__ ( - "ulw %[tp1], 0(%[src]) \n\t" - "ulw %[tp2], 4(%[src]) \n\t" - "sw %[tp1], 0(%[dst]) \n\t" /* store */ - "sw %[tp2], 4(%[dst]) \n\t" /* store */ - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2) - : [src] "r" (src), [dst] "r" (dst) - ); - - src += src_stride; - dst += dst_stride; - } - } - break; - case 16: - { - uint32_t tp1, tp2, tp3, tp4; - - /* 4 word storage */ - for (y = h; y--; ) { - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - vp9_prefetch_store(dst + dst_stride); - - __asm__ __volatile__ ( - "ulw %[tp1], 0(%[src]) \n\t" - "ulw %[tp2], 4(%[src]) \n\t" - "ulw %[tp3], 8(%[src]) \n\t" - "ulw %[tp4], 12(%[src]) \n\t" - - "sw %[tp1], 0(%[dst]) \n\t" /* store */ - "sw %[tp2], 4(%[dst]) \n\t" /* store */ - "sw %[tp3], 8(%[dst]) \n\t" /* store */ - "sw %[tp4], 12(%[dst]) \n\t" /* store */ - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), - [tp3] "=&r" (tp3), [tp4] "=&r" (tp4) - : [src] "r" (src), [dst] "r" (dst) - ); - - src += src_stride; - dst += dst_stride; - } - } - break; - case 32: - { - uint32_t tp1, tp2, tp3, tp4; - uint32_t tp5, tp6, tp7, tp8; - - /* 8 word storage */ - for (y = h; y--; ) { - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - vp9_prefetch_store(dst + dst_stride); - - __asm__ __volatile__ ( - "ulw %[tp1], 0(%[src]) \n\t" - "ulw %[tp2], 4(%[src]) \n\t" - "ulw %[tp3], 8(%[src]) \n\t" - "ulw %[tp4], 12(%[src]) \n\t" - "ulw %[tp5], 16(%[src]) \n\t" - "ulw %[tp6], 20(%[src]) \n\t" - "ulw %[tp7], 24(%[src]) \n\t" - "ulw %[tp8], 28(%[src]) \n\t" - - "sw %[tp1], 0(%[dst]) \n\t" /* store */ - "sw %[tp2], 4(%[dst]) \n\t" /* store */ - "sw %[tp3], 8(%[dst]) \n\t" /* store */ - "sw %[tp4], 12(%[dst]) \n\t" /* store */ - "sw %[tp5], 16(%[dst]) \n\t" /* store */ - "sw %[tp6], 20(%[dst]) \n\t" /* store */ - "sw %[tp7], 24(%[dst]) \n\t" /* store */ - "sw %[tp8], 28(%[dst]) \n\t" /* store */ - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), - [tp3] "=&r" (tp3), [tp4] "=&r" (tp4), - [tp5] "=&r" (tp5), [tp6] "=&r" (tp6), - [tp7] "=&r" (tp7), [tp8] "=&r" (tp8) - : [src] "r" (src), [dst] "r" (dst) - ); - - src += src_stride; - dst += dst_stride; - } - } - break; - case 64: - { - uint32_t tp1, tp2, tp3, tp4; - uint32_t tp5, tp6, tp7, tp8; - - vp9_prefetch_load(src + 64); - vp9_prefetch_store(dst + 32); - - /* 16 word storage */ - for (y = h; y--; ) { - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - vp9_prefetch_load(src + src_stride + 64); - vp9_prefetch_store(dst + dst_stride); - vp9_prefetch_store(dst + dst_stride + 32); - - __asm__ __volatile__ ( - "ulw %[tp1], 0(%[src]) \n\t" - "ulw %[tp2], 4(%[src]) \n\t" - "ulw %[tp3], 8(%[src]) \n\t" - "ulw %[tp4], 12(%[src]) \n\t" - "ulw %[tp5], 16(%[src]) \n\t" - "ulw %[tp6], 20(%[src]) \n\t" - "ulw %[tp7], 24(%[src]) \n\t" - "ulw %[tp8], 28(%[src]) \n\t" - - "sw %[tp1], 0(%[dst]) \n\t" /* store */ - "sw %[tp2], 4(%[dst]) \n\t" /* store */ - "sw %[tp3], 8(%[dst]) \n\t" /* store */ - "sw %[tp4], 12(%[dst]) \n\t" /* store */ - "sw %[tp5], 16(%[dst]) \n\t" /* store */ - "sw %[tp6], 20(%[dst]) \n\t" /* store */ - "sw %[tp7], 24(%[dst]) \n\t" /* store */ - "sw %[tp8], 28(%[dst]) \n\t" /* store */ - - "ulw %[tp1], 32(%[src]) \n\t" - "ulw %[tp2], 36(%[src]) \n\t" - "ulw %[tp3], 40(%[src]) \n\t" - "ulw %[tp4], 44(%[src]) \n\t" - "ulw %[tp5], 48(%[src]) \n\t" - "ulw %[tp6], 52(%[src]) \n\t" - "ulw %[tp7], 56(%[src]) \n\t" - "ulw %[tp8], 60(%[src]) \n\t" - - "sw %[tp1], 32(%[dst]) \n\t" /* store */ - "sw %[tp2], 36(%[dst]) \n\t" /* store */ - "sw %[tp3], 40(%[dst]) \n\t" /* store */ - "sw %[tp4], 44(%[dst]) \n\t" /* store */ - "sw %[tp5], 48(%[dst]) \n\t" /* store */ - "sw %[tp6], 52(%[dst]) \n\t" /* store */ - "sw %[tp7], 56(%[dst]) \n\t" /* store */ - "sw %[tp8], 60(%[dst]) \n\t" /* store */ - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), - [tp3] "=&r" (tp3), [tp4] "=&r" (tp4), - [tp5] "=&r" (tp5), [tp6] "=&r" (tp6), - [tp7] "=&r" (tp7), [tp8] "=&r" (tp8) - : [src] "r" (src), [dst] "r" (dst) - ); - - src += src_stride; - dst += dst_stride; - } - } - break; - default: - for (y = h; y--; ) { - for (x = 0; x < w; ++x) { - dst[x] = src[x]; - } - - src += src_stride; - dst += dst_stride; - } - break; - } -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve8_horiz_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve8_horiz_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve8_horiz_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve8_horiz_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,923 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vpx_config.h" -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vpx/vpx_integer.h" -#include "vpx_ports/mem.h" -#include "vp9/common/vp9_convolve.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" - -#if HAVE_DSPR2 -static void convolve_horiz_4_dspr2(const uint8_t *src, - int32_t src_stride, - uint8_t *dst, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h) { - int32_t y; - uint8_t *cm = vp9_ff_cropTbl; - int32_t vector1b, vector2b, vector3b, vector4b; - int32_t Temp1, Temp2, Temp3, Temp4; - uint32_t vector4a = 64; - uint32_t tp1, tp2; - uint32_t p1, p2, p3, p4; - uint32_t n1, n2, n3, n4; - uint32_t tn1, tn2; - - vector1b = ((const int32_t *)filter_x0)[0]; - vector2b = ((const int32_t *)filter_x0)[1]; - vector3b = ((const int32_t *)filter_x0)[2]; - vector4b = ((const int32_t *)filter_x0)[3]; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - vp9_prefetch_store(dst + dst_stride); - - __asm__ __volatile__ ( - "ulw %[tp1], 0(%[src]) \n\t" - "ulw %[tp2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[tp1] \n\t" - "preceu.ph.qbl %[p2], %[tp1] \n\t" - "preceu.ph.qbr %[p3], %[tp2] \n\t" - "preceu.ph.qbl %[p4], %[tp2] \n\t" - "dpa.w.ph $ac3, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[p3], %[vector3b] \n\t" - "ulw %[tn2], 8(%[src]) \n\t" - "dpa.w.ph $ac3, %[p4], %[vector4b] \n\t" - "extp %[Temp1], $ac3, 31 \n\t" - - /* even 2. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[tn2] \n\t" - "balign %[tn1], %[tn2], 3 \n\t" - "balign %[tn2], %[tp2], 3 \n\t" - "balign %[tp2], %[tp1], 3 \n\t" - "dpa.w.ph $ac2, %[p2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p3], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[p4], %[vector3b] \n\t" - "dpa.w.ph $ac2, %[p1], %[vector4b] \n\t" - "extp %[Temp3], $ac2, 31 \n\t" - - /* odd 1. pixel */ - "lbux %[tp1], %[Temp1](%[cm]) \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[n1], %[tp2] \n\t" - "preceu.ph.qbl %[n2], %[tp2] \n\t" - "preceu.ph.qbr %[n3], %[tn2] \n\t" - "preceu.ph.qbl %[n4], %[tn2] \n\t" - "dpa.w.ph $ac3, %[n1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[n2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[n3], %[vector3b] \n\t" - "dpa.w.ph $ac3, %[n4], %[vector4b] \n\t" - "extp %[Temp2], $ac3, 31 \n\t" - - /* odd 2. pixel */ - "lbux %[tp2], %[Temp3](%[cm]) \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[n1], %[tn1] \n\t" - "dpa.w.ph $ac2, %[n2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[n3], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[n4], %[vector3b] \n\t" - "dpa.w.ph $ac2, %[n1], %[vector4b] \n\t" - "extp %[Temp4], $ac2, 31 \n\t" - - /* clamp */ - "lbux %[tn1], %[Temp2](%[cm]) \n\t" - "lbux %[n2], %[Temp4](%[cm]) \n\t" - - /* store bytes */ - "sb %[tp1], 0(%[dst]) \n\t" - "sb %[tn1], 1(%[dst]) \n\t" - "sb %[tp2], 2(%[dst]) \n\t" - "sb %[n2], 3(%[dst]) \n\t" - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), - [tn1] "=&r" (tn1), [tn2] "=&r" (tn2), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4), - [n1] "=&r" (n1), [n2] "=&r" (n2), [n3] "=&r" (n3), [n4] "=&r" (n4), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [Temp3] "=&r" (Temp3), [Temp4] "=&r" (Temp4) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector3b] "r" (vector3b), [vector4b] "r" (vector4b), - [vector4a] "r" (vector4a), - [cm] "r" (cm), [dst] "r" (dst), [src] "r" (src) - ); - - /* Next row... */ - src += src_stride; - dst += dst_stride; - } -} - -static void convolve_horiz_8_dspr2(const uint8_t *src, - int32_t src_stride, - uint8_t *dst, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h) { - int32_t y; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector4a = 64; - int32_t vector1b, vector2b, vector3b, vector4b; - int32_t Temp1, Temp2, Temp3; - uint32_t tp1, tp2; - uint32_t p1, p2, p3, p4, n1; - uint32_t tn1, tn2, tn3; - uint32_t st0, st1; - - vector1b = ((const int32_t *)filter_x0)[0]; - vector2b = ((const int32_t *)filter_x0)[1]; - vector3b = ((const int32_t *)filter_x0)[2]; - vector4b = ((const int32_t *)filter_x0)[3]; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_load(src + src_stride); - vp9_prefetch_load(src + src_stride + 32); - vp9_prefetch_store(dst + dst_stride); - - __asm__ __volatile__ ( - "ulw %[tp1], 0(%[src]) \n\t" - "ulw %[tp2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[tp1] \n\t" - "preceu.ph.qbl %[p2], %[tp1] \n\t" - "preceu.ph.qbr %[p3], %[tp2] \n\t" - "preceu.ph.qbl %[p4], %[tp2] \n\t" - "ulw %[tn2], 8(%[src]) \n\t" - "dpa.w.ph $ac3, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[p3], %[vector3b] \n\t" - "dpa.w.ph $ac3, %[p4], %[vector4b] \n\t" - "extp %[Temp1], $ac3, 31 \n\t" - - /* even 2. pixel */ - "preceu.ph.qbr %[p1], %[tn2] \n\t" - "preceu.ph.qbl %[n1], %[tn2] \n\t" - "ulw %[tn1], 12(%[src]) \n\t" - "dpa.w.ph $ac2, %[p2], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p3], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[p4], %[vector3b] \n\t" - "dpa.w.ph $ac2, %[p1], %[vector4b] \n\t" - "extp %[Temp3], $ac2, 31 \n\t" - - /* even 3. pixel */ - "lbux %[st0], %[Temp1](%[cm]) \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p2], %[tn1] \n\t" - "dpa.w.ph $ac1, %[p3], %[vector1b] \n\t" - "dpa.w.ph $ac1, %[p4], %[vector2b] \n\t" - "dpa.w.ph $ac1, %[p1], %[vector3b] \n\t" - "dpa.w.ph $ac1, %[n1], %[vector4b] \n\t" - "extp %[Temp1], $ac1, 31 \n\t" - - /* even 4. pixel */ - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "sb %[st0], 0(%[dst]) \n\t" - "lbux %[st1], %[Temp3](%[cm]) \n\t" - - "balign %[tn3], %[tn1], 3 \n\t" - "balign %[tn1], %[tn2], 3 \n\t" - "balign %[tn2], %[tp2], 3 \n\t" - "balign %[tp2], %[tp1], 3 \n\t" - - "dpa.w.ph $ac2, %[p4], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p1], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[n1], %[vector3b] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector4b] \n\t" - "extp %[Temp3], $ac2, 31 \n\t" - - "lbux %[st0], %[Temp1](%[cm]) \n\t" - - /* odd 1. pixel */ - "mtlo %[vector4a], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "sb %[st1], 2(%[dst]) \n\t" - "preceu.ph.qbr %[p1], %[tp2] \n\t" - "preceu.ph.qbl %[p2], %[tp2] \n\t" - "preceu.ph.qbr %[p3], %[tn2] \n\t" - "preceu.ph.qbl %[p4], %[tn2] \n\t" - "sb %[st0], 4(%[dst]) \n\t" - "dpa.w.ph $ac3, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[p3], %[vector3b] \n\t" - "dpa.w.ph $ac3, %[p4], %[vector4b] \n\t" - "extp %[Temp2], $ac3, 31 \n\t" - - /* odd 2. pixel */ - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[tn1] \n\t" - "preceu.ph.qbl %[n1], %[tn1] \n\t" - "lbux %[st0], %[Temp3](%[cm]) \n\t" - "dpa.w.ph $ac1, %[p2], %[vector1b] \n\t" - "dpa.w.ph $ac1, %[p3], %[vector2b] \n\t" - "dpa.w.ph $ac1, %[p4], %[vector3b] \n\t" - "dpa.w.ph $ac1, %[p1], %[vector4b] \n\t" - "extp %[Temp3], $ac1, 31 \n\t" - - /* odd 3. pixel */ - "lbux %[st1], %[Temp2](%[cm]) \n\t" - "preceu.ph.qbr %[p2], %[tn3] \n\t" - "dpa.w.ph $ac3, %[p3], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[p4], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[p1], %[vector3b] \n\t" - "dpa.w.ph $ac3, %[n1], %[vector4b] \n\t" - "extp %[Temp2], $ac3, 31 \n\t" - - /* odd 4. pixel */ - "sb %[st1], 1(%[dst]) \n\t" - "sb %[st0], 6(%[dst]) \n\t" - "dpa.w.ph $ac2, %[p4], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p1], %[vector2b] \n\t" - "dpa.w.ph $ac2, %[n1], %[vector3b] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector4b] \n\t" - "extp %[Temp1], $ac2, 31 \n\t" - - /* clamp */ - "lbux %[p4], %[Temp3](%[cm]) \n\t" - "lbux %[p2], %[Temp2](%[cm]) \n\t" - "lbux %[n1], %[Temp1](%[cm]) \n\t" - - /* store bytes */ - "sb %[p4], 3(%[dst]) \n\t" - "sb %[p2], 5(%[dst]) \n\t" - "sb %[n1], 7(%[dst]) \n\t" - - : [tp1] "=&r" (tp1), [tp2] "=&r" (tp2), - [tn1] "=&r" (tn1), [tn2] "=&r" (tn2), [tn3] "=&r" (tn3), - [st0] "=&r" (st0), [st1] "=&r" (st1), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4), - [n1] "=&r" (n1), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector3b] "r" (vector3b), [vector4b] "r" (vector4b), - [vector4a] "r" (vector4a), - [cm] "r" (cm), [dst] "r" (dst), [src] "r" (src) - ); - - /* Next row... */ - src += src_stride; - dst += dst_stride; - } -} - -static void convolve_horiz_16_dspr2(const uint8_t *src_ptr, - int32_t src_stride, - uint8_t *dst_ptr, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h, - int32_t count) { - int32_t y, c; - const uint8_t *src; - uint8_t *dst; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector_64 = 64; - int32_t filter12, filter34, filter56, filter78; - int32_t Temp1, Temp2, Temp3; - uint32_t qload1, qload2, qload3; - uint32_t p1, p2, p3, p4, p5; - uint32_t st1, st2, st3; - - filter12 = ((const int32_t *)filter_x0)[0]; - filter34 = ((const int32_t *)filter_x0)[1]; - filter56 = ((const int32_t *)filter_x0)[2]; - filter78 = ((const int32_t *)filter_x0)[3]; - - for (y = h; y--;) { - src = src_ptr; - dst = dst_ptr; - - /* prefetch data to cache memory */ - vp9_prefetch_load(src_ptr + src_stride); - vp9_prefetch_load(src_ptr + src_stride + 32); - vp9_prefetch_store(dst_ptr + dst_stride); - - for (c = 0; c < count; c++) { - __asm__ __volatile__ ( - "ulw %[qload1], 0(%[src]) \n\t" - "ulw %[qload2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 1 */ - "mthi $zero, $ac1 \n\t" - "mtlo %[vector_64], $ac2 \n\t" /* even 2 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "ulw %[qload3], 8(%[src]) \n\t" - "dpa.w.ph $ac1, %[p1], %[filter12] \n\t" /* even 1 */ - "dpa.w.ph $ac1, %[p2], %[filter34] \n\t" /* even 1 */ - "dpa.w.ph $ac1, %[p3], %[filter56] \n\t" /* even 1 */ - "dpa.w.ph $ac1, %[p4], %[filter78] \n\t" /* even 1 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 1 */ - - /* even 2. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 3 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[qload3] \n\t" - "preceu.ph.qbl %[p5], %[qload3] \n\t" - "ulw %[qload1], 12(%[src]) \n\t" - "dpa.w.ph $ac2, %[p2], %[filter12] \n\t" /* even 1 */ - "dpa.w.ph $ac2, %[p3], %[filter34] \n\t" /* even 1 */ - "dpa.w.ph $ac2, %[p4], %[filter56] \n\t" /* even 1 */ - "dpa.w.ph $ac2, %[p1], %[filter78] \n\t" /* even 1 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 1 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 1 */ - - /* even 3. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 4 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "sb %[st1], 0(%[dst]) \n\t" /* even 1 */ - "dpa.w.ph $ac3, %[p3], %[filter12] \n\t" /* even 3 */ - "dpa.w.ph $ac3, %[p4], %[filter34] \n\t" /* even 3 */ - "dpa.w.ph $ac3, %[p1], %[filter56] \n\t" /* even 3 */ - "dpa.w.ph $ac3, %[p5], %[filter78] \n\t" /* even 3 */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 3 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 1 */ - - /* even 4. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 5 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[st2], 2(%[dst]) \n\t" /* even 1 */ - "ulw %[qload2], 16(%[src]) \n\t" - "dpa.w.ph $ac1, %[p4], %[filter12] \n\t" /* even 4 */ - "dpa.w.ph $ac1, %[p1], %[filter34] \n\t" /* even 4 */ - "dpa.w.ph $ac1, %[p5], %[filter56] \n\t" /* even 4 */ - "dpa.w.ph $ac1, %[p2], %[filter78] \n\t" /* even 4 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 4 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 3 */ - - /* even 5. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 6 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p4], %[qload2] \n\t" - "sb %[st3], 4(%[dst]) \n\t" /* even 3 */ - "dpa.w.ph $ac2, %[p1], %[filter12] \n\t" /* even 5 */ - "dpa.w.ph $ac2, %[p5], %[filter34] \n\t" /* even 5 */ - "dpa.w.ph $ac2, %[p2], %[filter56] \n\t" /* even 5 */ - "dpa.w.ph $ac2, %[p3], %[filter78] \n\t" /* even 5 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 5 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 4 */ - - /* even 6. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 7 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbl %[p1], %[qload2] \n\t" - "sb %[st1], 6(%[dst]) \n\t" /* even 4 */ - "ulw %[qload3], 20(%[src]) \n\t" - "dpa.w.ph $ac3, %[p5], %[filter12] \n\t" /* even 6 */ - "dpa.w.ph $ac3, %[p2], %[filter34] \n\t" /* even 6 */ - "dpa.w.ph $ac3, %[p3], %[filter56] \n\t" /* even 6 */ - "dpa.w.ph $ac3, %[p4], %[filter78] \n\t" /* even 6 */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 6 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 5 */ - - /* even 7. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 8 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p5], %[qload3] \n\t" - "sb %[st2], 8(%[dst]) \n\t" /* even 5 */ - "dpa.w.ph $ac1, %[p2], %[filter12] \n\t" /* even 7 */ - "dpa.w.ph $ac1, %[p3], %[filter34] \n\t" /* even 7 */ - "dpa.w.ph $ac1, %[p4], %[filter56] \n\t" /* even 7 */ - "dpa.w.ph $ac1, %[p1], %[filter78] \n\t" /* even 7 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 7 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 6 */ - - /* even 8. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 1 */ - "mthi $zero, $ac3 \n\t" - "dpa.w.ph $ac2, %[p3], %[filter12] \n\t" /* even 8 */ - "dpa.w.ph $ac2, %[p4], %[filter34] \n\t" /* even 8 */ - "sb %[st3], 10(%[dst]) \n\t" /* even 6 */ - "dpa.w.ph $ac2, %[p1], %[filter56] \n\t" /* even 8 */ - "dpa.w.ph $ac2, %[p5], %[filter78] \n\t" /* even 8 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 8 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 7 */ - - /* ODD pixels */ - "ulw %[qload1], 1(%[src]) \n\t" - "ulw %[qload2], 5(%[src]) \n\t" - - /* odd 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 2 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "sb %[st1], 12(%[dst]) \n\t" /* even 7 */ - "ulw %[qload3], 9(%[src]) \n\t" - "dpa.w.ph $ac3, %[p1], %[filter12] \n\t" /* odd 1 */ - "dpa.w.ph $ac3, %[p2], %[filter34] \n\t" /* odd 1 */ - "dpa.w.ph $ac3, %[p3], %[filter56] \n\t" /* odd 1 */ - "dpa.w.ph $ac3, %[p4], %[filter78] \n\t" /* odd 1 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 1 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 8 */ - - /* odd 2. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 3 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[qload3] \n\t" - "preceu.ph.qbl %[p5], %[qload3] \n\t" - "sb %[st2], 14(%[dst]) \n\t" /* even 8 */ - "ulw %[qload1], 13(%[src]) \n\t" - "dpa.w.ph $ac1, %[p2], %[filter12] \n\t" /* odd 2 */ - "dpa.w.ph $ac1, %[p3], %[filter34] \n\t" /* odd 2 */ - "dpa.w.ph $ac1, %[p4], %[filter56] \n\t" /* odd 2 */ - "dpa.w.ph $ac1, %[p1], %[filter78] \n\t" /* odd 2 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 2 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 1 */ - - /* odd 3. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 4 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "sb %[st3], 1(%[dst]) \n\t" /* odd 1 */ - "dpa.w.ph $ac2, %[p3], %[filter12] \n\t" /* odd 3 */ - "dpa.w.ph $ac2, %[p4], %[filter34] \n\t" /* odd 3 */ - "dpa.w.ph $ac2, %[p1], %[filter56] \n\t" /* odd 3 */ - "dpa.w.ph $ac2, %[p5], %[filter78] \n\t" /* odd 3 */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 3 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 2 */ - - /* odd 4. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 5 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[st1], 3(%[dst]) \n\t" /* odd 2 */ - "ulw %[qload2], 17(%[src]) \n\t" - "dpa.w.ph $ac3, %[p4], %[filter12] \n\t" /* odd 4 */ - "dpa.w.ph $ac3, %[p1], %[filter34] \n\t" /* odd 4 */ - "dpa.w.ph $ac3, %[p5], %[filter56] \n\t" /* odd 4 */ - "dpa.w.ph $ac3, %[p2], %[filter78] \n\t" /* odd 4 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 4 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 3 */ - - /* odd 5. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 6 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p4], %[qload2] \n\t" - "sb %[st2], 5(%[dst]) \n\t" /* odd 3 */ - "dpa.w.ph $ac1, %[p1], %[filter12] \n\t" /* odd 5 */ - "dpa.w.ph $ac1, %[p5], %[filter34] \n\t" /* odd 5 */ - "dpa.w.ph $ac1, %[p2], %[filter56] \n\t" /* odd 5 */ - "dpa.w.ph $ac1, %[p3], %[filter78] \n\t" /* odd 5 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 5 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 4 */ - - /* odd 6. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 7 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbl %[p1], %[qload2] \n\t" - "sb %[st3], 7(%[dst]) \n\t" /* odd 4 */ - "ulw %[qload3], 21(%[src]) \n\t" - "dpa.w.ph $ac2, %[p5], %[filter12] \n\t" /* odd 6 */ - "dpa.w.ph $ac2, %[p2], %[filter34] \n\t" /* odd 6 */ - "dpa.w.ph $ac2, %[p3], %[filter56] \n\t" /* odd 6 */ - "dpa.w.ph $ac2, %[p4], %[filter78] \n\t" /* odd 6 */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 6 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 5 */ - - /* odd 7. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 8 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p5], %[qload3] \n\t" - "sb %[st1], 9(%[dst]) \n\t" /* odd 5 */ - "dpa.w.ph $ac3, %[p2], %[filter12] \n\t" /* odd 7 */ - "dpa.w.ph $ac3, %[p3], %[filter34] \n\t" /* odd 7 */ - "dpa.w.ph $ac3, %[p4], %[filter56] \n\t" /* odd 7 */ - "dpa.w.ph $ac3, %[p1], %[filter78] \n\t" /* odd 7 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 7 */ - - /* odd 8. pixel */ - "dpa.w.ph $ac1, %[p3], %[filter12] \n\t" /* odd 8 */ - "dpa.w.ph $ac1, %[p4], %[filter34] \n\t" /* odd 8 */ - "dpa.w.ph $ac1, %[p1], %[filter56] \n\t" /* odd 8 */ - "dpa.w.ph $ac1, %[p5], %[filter78] \n\t" /* odd 8 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 8 */ - - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 6 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 7 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 8 */ - - "sb %[st2], 11(%[dst]) \n\t" /* odd 6 */ - "sb %[st3], 13(%[dst]) \n\t" /* odd 7 */ - "sb %[st1], 15(%[dst]) \n\t" /* odd 8 */ - - : [qload1] "=&r" (qload1), [qload2] "=&r" (qload2), [qload3] "=&r" (qload3), - [st1] "=&r" (st1), [st2] "=&r" (st2), [st3] "=&r" (st3), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4), - [p5] "=&r" (p5), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3) - : [filter12] "r" (filter12), [filter34] "r" (filter34), - [filter56] "r" (filter56), [filter78] "r" (filter78), - [vector_64] "r" (vector_64), - [cm] "r" (cm), [dst] "r" (dst), - [src] "r" (src) - ); - - src += 16; - dst += 16; - } - - /* Next row... */ - src_ptr += src_stride; - dst_ptr += dst_stride; - } -} - -static void convolve_horiz_64_dspr2(const uint8_t *src_ptr, - int32_t src_stride, - uint8_t *dst_ptr, - int32_t dst_stride, - const int16_t *filter_x0, - int32_t h) { - int32_t y, c; - const uint8_t *src; - uint8_t *dst; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector_64 = 64; - int32_t filter12, filter34, filter56, filter78; - int32_t Temp1, Temp2, Temp3; - uint32_t qload1, qload2, qload3; - uint32_t p1, p2, p3, p4, p5; - uint32_t st1, st2, st3; - - filter12 = ((const int32_t *)filter_x0)[0]; - filter34 = ((const int32_t *)filter_x0)[1]; - filter56 = ((const int32_t *)filter_x0)[2]; - filter78 = ((const int32_t *)filter_x0)[3]; - - for (y = h; y--;) { - src = src_ptr; - dst = dst_ptr; - - /* prefetch data to cache memory */ - vp9_prefetch_load(src_ptr + src_stride); - vp9_prefetch_load(src_ptr + src_stride + 32); - vp9_prefetch_load(src_ptr + src_stride + 64); - vp9_prefetch_store(dst_ptr + dst_stride); - vp9_prefetch_store(dst_ptr + dst_stride + 32); - - for (c = 0; c < 4; c++) { - __asm__ __volatile__ ( - "ulw %[qload1], 0(%[src]) \n\t" - "ulw %[qload2], 4(%[src]) \n\t" - - /* even 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 1 */ - "mthi $zero, $ac1 \n\t" - "mtlo %[vector_64], $ac2 \n\t" /* even 2 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "ulw %[qload3], 8(%[src]) \n\t" - "dpa.w.ph $ac1, %[p1], %[filter12] \n\t" /* even 1 */ - "dpa.w.ph $ac1, %[p2], %[filter34] \n\t" /* even 1 */ - "dpa.w.ph $ac1, %[p3], %[filter56] \n\t" /* even 1 */ - "dpa.w.ph $ac1, %[p4], %[filter78] \n\t" /* even 1 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 1 */ - - /* even 2. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 3 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p1], %[qload3] \n\t" - "preceu.ph.qbl %[p5], %[qload3] \n\t" - "ulw %[qload1], 12(%[src]) \n\t" - "dpa.w.ph $ac2, %[p2], %[filter12] \n\t" /* even 1 */ - "dpa.w.ph $ac2, %[p3], %[filter34] \n\t" /* even 1 */ - "dpa.w.ph $ac2, %[p4], %[filter56] \n\t" /* even 1 */ - "dpa.w.ph $ac2, %[p1], %[filter78] \n\t" /* even 1 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 1 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 1 */ - - /* even 3. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 4 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "sb %[st1], 0(%[dst]) \n\t" /* even 1 */ - "dpa.w.ph $ac3, %[p3], %[filter12] \n\t" /* even 3 */ - "dpa.w.ph $ac3, %[p4], %[filter34] \n\t" /* even 3 */ - "dpa.w.ph $ac3, %[p1], %[filter56] \n\t" /* even 3 */ - "dpa.w.ph $ac3, %[p5], %[filter78] \n\t" /* even 3 */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 3 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 1 */ - - /* even 4. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 5 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[st2], 2(%[dst]) \n\t" /* even 1 */ - "ulw %[qload2], 16(%[src]) \n\t" - "dpa.w.ph $ac1, %[p4], %[filter12] \n\t" /* even 4 */ - "dpa.w.ph $ac1, %[p1], %[filter34] \n\t" /* even 4 */ - "dpa.w.ph $ac1, %[p5], %[filter56] \n\t" /* even 4 */ - "dpa.w.ph $ac1, %[p2], %[filter78] \n\t" /* even 4 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 4 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 3 */ - - /* even 5. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* even 6 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p4], %[qload2] \n\t" - "sb %[st3], 4(%[dst]) \n\t" /* even 3 */ - "dpa.w.ph $ac2, %[p1], %[filter12] \n\t" /* even 5 */ - "dpa.w.ph $ac2, %[p5], %[filter34] \n\t" /* even 5 */ - "dpa.w.ph $ac2, %[p2], %[filter56] \n\t" /* even 5 */ - "dpa.w.ph $ac2, %[p3], %[filter78] \n\t" /* even 5 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 5 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 4 */ - - /* even 6. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* even 7 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbl %[p1], %[qload2] \n\t" - "sb %[st1], 6(%[dst]) \n\t" /* even 4 */ - "ulw %[qload3], 20(%[src]) \n\t" - "dpa.w.ph $ac3, %[p5], %[filter12] \n\t" /* even 6 */ - "dpa.w.ph $ac3, %[p2], %[filter34] \n\t" /* even 6 */ - "dpa.w.ph $ac3, %[p3], %[filter56] \n\t" /* even 6 */ - "dpa.w.ph $ac3, %[p4], %[filter78] \n\t" /* even 6 */ - "extp %[Temp3], $ac3, 31 \n\t" /* even 6 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 5 */ - - /* even 7. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* even 8 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p5], %[qload3] \n\t" - "sb %[st2], 8(%[dst]) \n\t" /* even 5 */ - "dpa.w.ph $ac1, %[p2], %[filter12] \n\t" /* even 7 */ - "dpa.w.ph $ac1, %[p3], %[filter34] \n\t" /* even 7 */ - "dpa.w.ph $ac1, %[p4], %[filter56] \n\t" /* even 7 */ - "dpa.w.ph $ac1, %[p1], %[filter78] \n\t" /* even 7 */ - "extp %[Temp1], $ac1, 31 \n\t" /* even 7 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* even 6 */ - - /* even 8. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 1 */ - "mthi $zero, $ac3 \n\t" - "dpa.w.ph $ac2, %[p3], %[filter12] \n\t" /* even 8 */ - "dpa.w.ph $ac2, %[p4], %[filter34] \n\t" /* even 8 */ - "sb %[st3], 10(%[dst]) \n\t" /* even 6 */ - "dpa.w.ph $ac2, %[p1], %[filter56] \n\t" /* even 8 */ - "dpa.w.ph $ac2, %[p5], %[filter78] \n\t" /* even 8 */ - "extp %[Temp2], $ac2, 31 \n\t" /* even 8 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* even 7 */ - - /* ODD pixels */ - "ulw %[qload1], 1(%[src]) \n\t" - "ulw %[qload2], 5(%[src]) \n\t" - - /* odd 1. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 2 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p1], %[qload1] \n\t" - "preceu.ph.qbl %[p2], %[qload1] \n\t" - "preceu.ph.qbr %[p3], %[qload2] \n\t" - "preceu.ph.qbl %[p4], %[qload2] \n\t" - "sb %[st1], 12(%[dst]) \n\t" /* even 7 */ - "ulw %[qload3], 9(%[src]) \n\t" - "dpa.w.ph $ac3, %[p1], %[filter12] \n\t" /* odd 1 */ - "dpa.w.ph $ac3, %[p2], %[filter34] \n\t" /* odd 1 */ - "dpa.w.ph $ac3, %[p3], %[filter56] \n\t" /* odd 1 */ - "dpa.w.ph $ac3, %[p4], %[filter78] \n\t" /* odd 1 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 1 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* even 8 */ - - /* odd 2. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 3 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p1], %[qload3] \n\t" - "preceu.ph.qbl %[p5], %[qload3] \n\t" - "sb %[st2], 14(%[dst]) \n\t" /* even 8 */ - "ulw %[qload1], 13(%[src]) \n\t" - "dpa.w.ph $ac1, %[p2], %[filter12] \n\t" /* odd 2 */ - "dpa.w.ph $ac1, %[p3], %[filter34] \n\t" /* odd 2 */ - "dpa.w.ph $ac1, %[p4], %[filter56] \n\t" /* odd 2 */ - "dpa.w.ph $ac1, %[p1], %[filter78] \n\t" /* odd 2 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 2 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 1 */ - - /* odd 3. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 4 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbr %[p2], %[qload1] \n\t" - "sb %[st3], 1(%[dst]) \n\t" /* odd 1 */ - "dpa.w.ph $ac2, %[p3], %[filter12] \n\t" /* odd 3 */ - "dpa.w.ph $ac2, %[p4], %[filter34] \n\t" /* odd 3 */ - "dpa.w.ph $ac2, %[p1], %[filter56] \n\t" /* odd 3 */ - "dpa.w.ph $ac2, %[p5], %[filter78] \n\t" /* odd 3 */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 3 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 2 */ - - /* odd 4. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 5 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbl %[p3], %[qload1] \n\t" - "sb %[st1], 3(%[dst]) \n\t" /* odd 2 */ - "ulw %[qload2], 17(%[src]) \n\t" - "dpa.w.ph $ac3, %[p4], %[filter12] \n\t" /* odd 4 */ - "dpa.w.ph $ac3, %[p1], %[filter34] \n\t" /* odd 4 */ - "dpa.w.ph $ac3, %[p5], %[filter56] \n\t" /* odd 4 */ - "dpa.w.ph $ac3, %[p2], %[filter78] \n\t" /* odd 4 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 4 */ - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 3 */ - - /* odd 5. pixel */ - "mtlo %[vector_64], $ac2 \n\t" /* odd 6 */ - "mthi $zero, $ac2 \n\t" - "preceu.ph.qbr %[p4], %[qload2] \n\t" - "sb %[st2], 5(%[dst]) \n\t" /* odd 3 */ - "dpa.w.ph $ac1, %[p1], %[filter12] \n\t" /* odd 5 */ - "dpa.w.ph $ac1, %[p5], %[filter34] \n\t" /* odd 5 */ - "dpa.w.ph $ac1, %[p2], %[filter56] \n\t" /* odd 5 */ - "dpa.w.ph $ac1, %[p3], %[filter78] \n\t" /* odd 5 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 5 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 4 */ - - /* odd 6. pixel */ - "mtlo %[vector_64], $ac3 \n\t" /* odd 7 */ - "mthi $zero, $ac3 \n\t" - "preceu.ph.qbl %[p1], %[qload2] \n\t" - "sb %[st3], 7(%[dst]) \n\t" /* odd 4 */ - "ulw %[qload3], 21(%[src]) \n\t" - "dpa.w.ph $ac2, %[p5], %[filter12] \n\t" /* odd 6 */ - "dpa.w.ph $ac2, %[p2], %[filter34] \n\t" /* odd 6 */ - "dpa.w.ph $ac2, %[p3], %[filter56] \n\t" /* odd 6 */ - "dpa.w.ph $ac2, %[p4], %[filter78] \n\t" /* odd 6 */ - "extp %[Temp2], $ac2, 31 \n\t" /* odd 6 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 5 */ - - /* odd 7. pixel */ - "mtlo %[vector_64], $ac1 \n\t" /* odd 8 */ - "mthi $zero, $ac1 \n\t" - "preceu.ph.qbr %[p5], %[qload3] \n\t" - "sb %[st1], 9(%[dst]) \n\t" /* odd 5 */ - "dpa.w.ph $ac3, %[p2], %[filter12] \n\t" /* odd 7 */ - "dpa.w.ph $ac3, %[p3], %[filter34] \n\t" /* odd 7 */ - "dpa.w.ph $ac3, %[p4], %[filter56] \n\t" /* odd 7 */ - "dpa.w.ph $ac3, %[p1], %[filter78] \n\t" /* odd 7 */ - "extp %[Temp3], $ac3, 31 \n\t" /* odd 7 */ - - /* odd 8. pixel */ - "dpa.w.ph $ac1, %[p3], %[filter12] \n\t" /* odd 8 */ - "dpa.w.ph $ac1, %[p4], %[filter34] \n\t" /* odd 8 */ - "dpa.w.ph $ac1, %[p1], %[filter56] \n\t" /* odd 8 */ - "dpa.w.ph $ac1, %[p5], %[filter78] \n\t" /* odd 8 */ - "extp %[Temp1], $ac1, 31 \n\t" /* odd 8 */ - - "lbux %[st2], %[Temp2](%[cm]) \n\t" /* odd 6 */ - "lbux %[st3], %[Temp3](%[cm]) \n\t" /* odd 7 */ - "lbux %[st1], %[Temp1](%[cm]) \n\t" /* odd 8 */ - - "sb %[st2], 11(%[dst]) \n\t" /* odd 6 */ - "sb %[st3], 13(%[dst]) \n\t" /* odd 7 */ - "sb %[st1], 15(%[dst]) \n\t" /* odd 8 */ - - : [qload1] "=&r" (qload1), [qload2] "=&r" (qload2), [qload3] "=&r" (qload3), - [st1] "=&r" (st1), [st2] "=&r" (st2), [st3] "=&r" (st3), - [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4), - [p5] "=&r" (p5), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3) - : [filter12] "r" (filter12), [filter34] "r" (filter34), - [filter56] "r" (filter56), [filter78] "r" (filter78), - [vector_64] "r" (vector_64), - [cm] "r" (cm), [dst] "r" (dst), - [src] "r" (src) - ); - - src += 16; - dst += 16; - } - - /* Next row... */ - src_ptr += src_stride; - dst_ptr += dst_stride; - } -} - -void vp9_convolve8_horiz_dspr2(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h) { - if (((const int32_t *)filter_x)[1] == 0x800000) { - vp9_convolve_copy(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - } else if (((const int32_t *)filter_x)[0] == 0) { - vp9_convolve2_horiz_dspr2(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - } else { - if (16 == x_step_q4) { - uint32_t pos = 38; - - vp9_prefetch_load((const uint8_t *)filter_x); - src -= 3; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - /* prefetch data to cache memory */ - vp9_prefetch_load(src); - vp9_prefetch_load(src + 32); - vp9_prefetch_store(dst); - - switch (w) { - case 4: - convolve_horiz_4_dspr2(src, (int32_t)src_stride, - dst, (int32_t)dst_stride, - filter_x, (int32_t)h); - break; - case 8: - convolve_horiz_8_dspr2(src, (int32_t)src_stride, - dst, (int32_t)dst_stride, - filter_x, (int32_t)h); - break; - case 16: - convolve_horiz_16_dspr2(src, (int32_t)src_stride, - dst, (int32_t)dst_stride, - filter_x, (int32_t)h, 1); - break; - case 32: - convolve_horiz_16_dspr2(src, (int32_t)src_stride, - dst, (int32_t)dst_stride, - filter_x, (int32_t)h, 2); - break; - case 64: - vp9_prefetch_load(src + 64); - vp9_prefetch_store(dst + 32); - - convolve_horiz_64_dspr2(src, (int32_t)src_stride, - dst, (int32_t)dst_stride, - filter_x, (int32_t)h); - break; - default: - vp9_convolve8_horiz_c(src + 3, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - break; - } - } else { - vp9_convolve8_horiz_c(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - } - } -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve8_vert_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve8_vert_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve8_vert_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_convolve8_vert_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,396 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vpx_config.h" -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vpx/vpx_integer.h" -#include "vpx_ports/mem.h" -#include "vp9/common/vp9_convolve.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" - -#if HAVE_DSPR2 -static void convolve_vert_4_dspr2(const uint8_t *src, - int32_t src_stride, - uint8_t *dst, - int32_t dst_stride, - const int16_t *filter_y, - int32_t w, - int32_t h) { - int32_t x, y; - const uint8_t *src_ptr; - uint8_t *dst_ptr; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector4a = 64; - uint32_t load1, load2, load3, load4; - uint32_t p1, p2; - uint32_t n1, n2; - uint32_t scratch1, scratch2; - uint32_t store1, store2; - int32_t vector1b, vector2b, vector3b, vector4b; - int32_t Temp1, Temp2; - - vector1b = ((const int32_t *)filter_y)[0]; - vector2b = ((const int32_t *)filter_y)[1]; - vector3b = ((const int32_t *)filter_y)[2]; - vector4b = ((const int32_t *)filter_y)[3]; - - src -= 3 * src_stride; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_store(dst + dst_stride); - - for (x = 0; x < w; x += 4) { - src_ptr = src + x; - dst_ptr = dst + x; - - __asm__ __volatile__ ( - "ulw %[load1], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load2], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load3], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load4], 0(%[src_ptr]) \n\t" - - "mtlo %[vector4a], $ac0 \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac0 \n\t" - "mthi $zero, $ac1 \n\t" - "mthi $zero, $ac2 \n\t" - "mthi $zero, $ac3 \n\t" - - "preceu.ph.qbr %[scratch1], %[load1] \n\t" - "preceu.ph.qbr %[p1], %[load2] \n\t" - "precrq.ph.w %[n1], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - "preceu.ph.qbr %[scratch2], %[load3] \n\t" - "preceu.ph.qbr %[p2], %[load4] \n\t" - "precrq.ph.w %[n2], %[p2], %[scratch2] \n\t" /* pixel 2 */ - "append %[p2], %[scratch2], 16 \n\t" /* pixel 1 */ - - "dpa.w.ph $ac0, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac0, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac1, %[n1], %[vector1b] \n\t" - "dpa.w.ph $ac1, %[n2], %[vector2b] \n\t" - - "preceu.ph.qbl %[scratch1], %[load1] \n\t" - "preceu.ph.qbl %[p1], %[load2] \n\t" - "precrq.ph.w %[n1], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - "preceu.ph.qbl %[scratch2], %[load3] \n\t" - "preceu.ph.qbl %[p2], %[load4] \n\t" - "precrq.ph.w %[n2], %[p2], %[scratch2] \n\t" /* pixel 2 */ - "append %[p2], %[scratch2], 16 \n\t" /* pixel 1 */ - - "dpa.w.ph $ac2, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[n1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[n2], %[vector2b] \n\t" - - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load1], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load2], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load3], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load4], 0(%[src_ptr]) \n\t" - - "preceu.ph.qbr %[scratch1], %[load1] \n\t" - "preceu.ph.qbr %[p1], %[load2] \n\t" - "precrq.ph.w %[n1], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - "preceu.ph.qbr %[scratch2], %[load3] \n\t" - "preceu.ph.qbr %[p2], %[load4] \n\t" - "precrq.ph.w %[n2], %[p2], %[scratch2] \n\t" /* pixel 2 */ - "append %[p2], %[scratch2], 16 \n\t" /* pixel 1 */ - - "dpa.w.ph $ac0, %[p1], %[vector3b] \n\t" - "dpa.w.ph $ac0, %[p2], %[vector4b] \n\t" - "extp %[Temp1], $ac0, 31 \n\t" - "dpa.w.ph $ac1, %[n1], %[vector3b] \n\t" - "dpa.w.ph $ac1, %[n2], %[vector4b] \n\t" - "extp %[Temp2], $ac1, 31 \n\t" - - "preceu.ph.qbl %[scratch1], %[load1] \n\t" - "preceu.ph.qbl %[p1], %[load2] \n\t" - "precrq.ph.w %[n1], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - "preceu.ph.qbl %[scratch2], %[load3] \n\t" - "preceu.ph.qbl %[p2], %[load4] \n\t" - "precrq.ph.w %[n2], %[p2], %[scratch2] \n\t" /* pixel 2 */ - "append %[p2], %[scratch2], 16 \n\t" /* pixel 1 */ - - "lbux %[store1], %[Temp1](%[cm]) \n\t" - "dpa.w.ph $ac2, %[p1], %[vector3b] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector4b] \n\t" - "extp %[Temp1], $ac2, 31 \n\t" - - "lbux %[store2], %[Temp2](%[cm]) \n\t" - "dpa.w.ph $ac3, %[n1], %[vector3b] \n\t" - "dpa.w.ph $ac3, %[n2], %[vector4b] \n\t" - "extp %[Temp2], $ac3, 31 \n\t" - - "sb %[store1], 0(%[dst_ptr]) \n\t" - "sb %[store2], 1(%[dst_ptr]) \n\t" - - "lbux %[store1], %[Temp1](%[cm]) \n\t" - "lbux %[store2], %[Temp2](%[cm]) \n\t" - - "sb %[store1], 2(%[dst_ptr]) \n\t" - "sb %[store2], 3(%[dst_ptr]) \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [load3] "=&r" (load3), [load4] "=&r" (load4), - [p1] "=&r" (p1), [p2] "=&r" (p2), - [n1] "=&r" (n1), [n2] "=&r" (n2), - [scratch1] "=&r" (scratch1), [scratch2] "=&r" (scratch2), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [store1] "=&r" (store1), [store2] "=&r" (store2), - [src_ptr] "+r" (src_ptr) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector3b] "r" (vector3b), [vector4b] "r" (vector4b), - [vector4a] "r" (vector4a), [src_stride] "r" (src_stride), - [cm] "r" (cm), [dst_ptr] "r" (dst_ptr) - ); - } - - /* Next row... */ - src += src_stride; - dst += dst_stride; - } -} - -static void convolve_vert_64_dspr2(const uint8_t *src, - int32_t src_stride, - uint8_t *dst, - int32_t dst_stride, - const int16_t *filter_y, - int32_t h) { - int32_t x, y; - const uint8_t *src_ptr; - uint8_t *dst_ptr; - uint8_t *cm = vp9_ff_cropTbl; - uint32_t vector4a = 64; - uint32_t load1, load2, load3, load4; - uint32_t p1, p2; - uint32_t n1, n2; - uint32_t scratch1, scratch2; - uint32_t store1, store2; - int32_t vector1b, vector2b, vector3b, vector4b; - int32_t Temp1, Temp2; - - vector1b = ((const int32_t *)filter_y)[0]; - vector2b = ((const int32_t *)filter_y)[1]; - vector3b = ((const int32_t *)filter_y)[2]; - vector4b = ((const int32_t *)filter_y)[3]; - - src -= 3 * src_stride; - - for (y = h; y--;) { - /* prefetch data to cache memory */ - vp9_prefetch_store(dst + dst_stride); - vp9_prefetch_store(dst + dst_stride + 32); - - for (x = 0; x < 64; x += 4) { - src_ptr = src + x; - dst_ptr = dst + x; - - __asm__ __volatile__ ( - "ulw %[load1], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load2], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load3], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load4], 0(%[src_ptr]) \n\t" - - "mtlo %[vector4a], $ac0 \n\t" - "mtlo %[vector4a], $ac1 \n\t" - "mtlo %[vector4a], $ac2 \n\t" - "mtlo %[vector4a], $ac3 \n\t" - "mthi $zero, $ac0 \n\t" - "mthi $zero, $ac1 \n\t" - "mthi $zero, $ac2 \n\t" - "mthi $zero, $ac3 \n\t" - - "preceu.ph.qbr %[scratch1], %[load1] \n\t" - "preceu.ph.qbr %[p1], %[load2] \n\t" - "precrq.ph.w %[n1], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - "preceu.ph.qbr %[scratch2], %[load3] \n\t" - "preceu.ph.qbr %[p2], %[load4] \n\t" - "precrq.ph.w %[n2], %[p2], %[scratch2] \n\t" /* pixel 2 */ - "append %[p2], %[scratch2], 16 \n\t" /* pixel 1 */ - - "dpa.w.ph $ac0, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac0, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac1, %[n1], %[vector1b] \n\t" - "dpa.w.ph $ac1, %[n2], %[vector2b] \n\t" - - "preceu.ph.qbl %[scratch1], %[load1] \n\t" - "preceu.ph.qbl %[p1], %[load2] \n\t" - "precrq.ph.w %[n1], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - "preceu.ph.qbl %[scratch2], %[load3] \n\t" - "preceu.ph.qbl %[p2], %[load4] \n\t" - "precrq.ph.w %[n2], %[p2], %[scratch2] \n\t" /* pixel 2 */ - "append %[p2], %[scratch2], 16 \n\t" /* pixel 1 */ - - "dpa.w.ph $ac2, %[p1], %[vector1b] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector2b] \n\t" - "dpa.w.ph $ac3, %[n1], %[vector1b] \n\t" - "dpa.w.ph $ac3, %[n2], %[vector2b] \n\t" - - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load1], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load2], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load3], 0(%[src_ptr]) \n\t" - "add %[src_ptr], %[src_ptr], %[src_stride] \n\t" - "ulw %[load4], 0(%[src_ptr]) \n\t" - - "preceu.ph.qbr %[scratch1], %[load1] \n\t" - "preceu.ph.qbr %[p1], %[load2] \n\t" - "precrq.ph.w %[n1], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - "preceu.ph.qbr %[scratch2], %[load3] \n\t" - "preceu.ph.qbr %[p2], %[load4] \n\t" - "precrq.ph.w %[n2], %[p2], %[scratch2] \n\t" /* pixel 2 */ - "append %[p2], %[scratch2], 16 \n\t" /* pixel 1 */ - - "dpa.w.ph $ac0, %[p1], %[vector3b] \n\t" - "dpa.w.ph $ac0, %[p2], %[vector4b] \n\t" - "extp %[Temp1], $ac0, 31 \n\t" - "dpa.w.ph $ac1, %[n1], %[vector3b] \n\t" - "dpa.w.ph $ac1, %[n2], %[vector4b] \n\t" - "extp %[Temp2], $ac1, 31 \n\t" - - "preceu.ph.qbl %[scratch1], %[load1] \n\t" - "preceu.ph.qbl %[p1], %[load2] \n\t" - "precrq.ph.w %[n1], %[p1], %[scratch1] \n\t" /* pixel 2 */ - "append %[p1], %[scratch1], 16 \n\t" /* pixel 1 */ - "preceu.ph.qbl %[scratch2], %[load3] \n\t" - "preceu.ph.qbl %[p2], %[load4] \n\t" - "precrq.ph.w %[n2], %[p2], %[scratch2] \n\t" /* pixel 2 */ - "append %[p2], %[scratch2], 16 \n\t" /* pixel 1 */ - - "lbux %[store1], %[Temp1](%[cm]) \n\t" - "dpa.w.ph $ac2, %[p1], %[vector3b] \n\t" - "dpa.w.ph $ac2, %[p2], %[vector4b] \n\t" - "extp %[Temp1], $ac2, 31 \n\t" - - "lbux %[store2], %[Temp2](%[cm]) \n\t" - "dpa.w.ph $ac3, %[n1], %[vector3b] \n\t" - "dpa.w.ph $ac3, %[n2], %[vector4b] \n\t" - "extp %[Temp2], $ac3, 31 \n\t" - - "sb %[store1], 0(%[dst_ptr]) \n\t" - "sb %[store2], 1(%[dst_ptr]) \n\t" - - "lbux %[store1], %[Temp1](%[cm]) \n\t" - "lbux %[store2], %[Temp2](%[cm]) \n\t" - - "sb %[store1], 2(%[dst_ptr]) \n\t" - "sb %[store2], 3(%[dst_ptr]) \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [load3] "=&r" (load3), [load4] "=&r" (load4), - [p1] "=&r" (p1), [p2] "=&r" (p2), - [n1] "=&r" (n1), [n2] "=&r" (n2), - [scratch1] "=&r" (scratch1), [scratch2] "=&r" (scratch2), - [Temp1] "=&r" (Temp1), [Temp2] "=&r" (Temp2), - [store1] "=&r" (store1), [store2] "=&r" (store2), - [src_ptr] "+r" (src_ptr) - : [vector1b] "r" (vector1b), [vector2b] "r" (vector2b), - [vector3b] "r" (vector3b), [vector4b] "r" (vector4b), - [vector4a] "r" (vector4a), [src_stride] "r" (src_stride), - [cm] "r" (cm), [dst_ptr] "r" (dst_ptr) - ); - } - - /* Next row... */ - src += src_stride; - dst += dst_stride; - } -} - -void vp9_convolve8_vert_dspr2(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h) { - if (((const int32_t *)filter_y)[1] == 0x800000) { - vp9_convolve_copy(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - } else if (((const int32_t *)filter_y)[0] == 0) { - vp9_convolve2_vert_dspr2(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - } else { - if (16 == y_step_q4) { - uint32_t pos = 38; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - vp9_prefetch_store(dst); - - switch (w) { - case 4 : - case 8 : - case 16 : - case 32 : - convolve_vert_4_dspr2(src, src_stride, - dst, dst_stride, - filter_y, w, h); - break; - case 64 : - vp9_prefetch_store(dst + 32); - convolve_vert_64_dspr2(src, src_stride, - dst, dst_stride, - filter_y, h); - break; - default: - vp9_convolve8_vert_c(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - break; - } - } else { - vp9_convolve8_vert_c(src, src_stride, - dst, dst_stride, - filter_x, x_step_q4, - filter_y, y_step_q4, - w, h); - } - } -} - -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_intrapred16_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_intrapred16_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_intrapred16_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_intrapred16_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,332 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#include - -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" - -#if HAVE_DSPR2 -void vp9_h_predictor_16x16_dspr2(uint8_t *dst, ptrdiff_t stride, - const uint8_t *above, const uint8_t *left) { - int32_t tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8; - int32_t tmp9, tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16; - - __asm__ __volatile__ ( - "lb %[tmp1], (%[left]) \n\t" - "lb %[tmp2], 1(%[left]) \n\t" - "lb %[tmp3], 2(%[left]) \n\t" - "lb %[tmp4], 3(%[left]) \n\t" - "lb %[tmp5], 4(%[left]) \n\t" - "lb %[tmp6], 5(%[left]) \n\t" - "lb %[tmp7], 6(%[left]) \n\t" - "lb %[tmp8], 7(%[left]) \n\t" - "lb %[tmp9], 8(%[left]) \n\t" - "lb %[tmp10], 9(%[left]) \n\t" - "lb %[tmp11], 10(%[left]) \n\t" - "lb %[tmp12], 11(%[left]) \n\t" - "lb %[tmp13], 12(%[left]) \n\t" - "lb %[tmp14], 13(%[left]) \n\t" - "lb %[tmp15], 14(%[left]) \n\t" - "lb %[tmp16], 15(%[left]) \n\t" - - "replv.qb %[tmp1], %[tmp1] \n\t" - "replv.qb %[tmp2], %[tmp2] \n\t" - "replv.qb %[tmp3], %[tmp3] \n\t" - "replv.qb %[tmp4], %[tmp4] \n\t" - "replv.qb %[tmp5], %[tmp5] \n\t" - "replv.qb %[tmp6], %[tmp6] \n\t" - "replv.qb %[tmp7], %[tmp7] \n\t" - "replv.qb %[tmp8], %[tmp8] \n\t" - "replv.qb %[tmp9], %[tmp9] \n\t" - "replv.qb %[tmp10], %[tmp10] \n\t" - "replv.qb %[tmp11], %[tmp11] \n\t" - "replv.qb %[tmp12], %[tmp12] \n\t" - "replv.qb %[tmp13], %[tmp13] \n\t" - "replv.qb %[tmp14], %[tmp14] \n\t" - "replv.qb %[tmp15], %[tmp15] \n\t" - "replv.qb %[tmp16], %[tmp16] \n\t" - - "sw %[tmp1], (%[dst]) \n\t" - "sw %[tmp1], 4(%[dst]) \n\t" - "sw %[tmp1], 8(%[dst]) \n\t" - "sw %[tmp1], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp2], (%[dst]) \n\t" - "sw %[tmp2], 4(%[dst]) \n\t" - "sw %[tmp2], 8(%[dst]) \n\t" - "sw %[tmp2], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp3], (%[dst]) \n\t" - "sw %[tmp3], 4(%[dst]) \n\t" - "sw %[tmp3], 8(%[dst]) \n\t" - "sw %[tmp3], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp4], (%[dst]) \n\t" - "sw %[tmp4], 4(%[dst]) \n\t" - "sw %[tmp4], 8(%[dst]) \n\t" - "sw %[tmp4], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp5], (%[dst]) \n\t" - "sw %[tmp5], 4(%[dst]) \n\t" - "sw %[tmp5], 8(%[dst]) \n\t" - "sw %[tmp5], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp6], (%[dst]) \n\t" - "sw %[tmp6], 4(%[dst]) \n\t" - "sw %[tmp6], 8(%[dst]) \n\t" - "sw %[tmp6], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp7], (%[dst]) \n\t" - "sw %[tmp7], 4(%[dst]) \n\t" - "sw %[tmp7], 8(%[dst]) \n\t" - "sw %[tmp7], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp8], (%[dst]) \n\t" - "sw %[tmp8], 4(%[dst]) \n\t" - "sw %[tmp8], 8(%[dst]) \n\t" - "sw %[tmp8], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp9], (%[dst]) \n\t" - "sw %[tmp9], 4(%[dst]) \n\t" - "sw %[tmp9], 8(%[dst]) \n\t" - "sw %[tmp9], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp10], (%[dst]) \n\t" - "sw %[tmp10], 4(%[dst]) \n\t" - "sw %[tmp10], 8(%[dst]) \n\t" - "sw %[tmp10], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp11], (%[dst]) \n\t" - "sw %[tmp11], 4(%[dst]) \n\t" - "sw %[tmp11], 8(%[dst]) \n\t" - "sw %[tmp11], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp12], (%[dst]) \n\t" - "sw %[tmp12], 4(%[dst]) \n\t" - "sw %[tmp12], 8(%[dst]) \n\t" - "sw %[tmp12], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp13], (%[dst]) \n\t" - "sw %[tmp13], 4(%[dst]) \n\t" - "sw %[tmp13], 8(%[dst]) \n\t" - "sw %[tmp13], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp14], (%[dst]) \n\t" - "sw %[tmp14], 4(%[dst]) \n\t" - "sw %[tmp14], 8(%[dst]) \n\t" - "sw %[tmp14], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp15], (%[dst]) \n\t" - "sw %[tmp15], 4(%[dst]) \n\t" - "sw %[tmp15], 8(%[dst]) \n\t" - "sw %[tmp15], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp16], (%[dst]) \n\t" - "sw %[tmp16], 4(%[dst]) \n\t" - "sw %[tmp16], 8(%[dst]) \n\t" - "sw %[tmp16], 12(%[dst]) \n\t" - - : [tmp1] "=&r" (tmp1), [tmp2] "=&r" (tmp2), - [tmp3] "=&r" (tmp3), [tmp4] "=&r" (tmp4), - [tmp5] "=&r" (tmp5), [tmp7] "=&r" (tmp7), - [tmp6] "=&r" (tmp6), [tmp8] "=&r" (tmp8), - [tmp9] "=&r" (tmp9), [tmp10] "=&r" (tmp10), - [tmp11] "=&r" (tmp11), [tmp12] "=&r" (tmp12), - [tmp13] "=&r" (tmp13), [tmp14] "=&r" (tmp14), - [tmp15] "=&r" (tmp15), [tmp16] "=&r" (tmp16) - : [left] "r" (left), [dst] "r" (dst), [stride] "r" (stride) - ); -} - -void vp9_dc_predictor_16x16_dspr2(uint8_t *dst, ptrdiff_t stride, - const uint8_t *above, const uint8_t *left) { - int32_t expected_dc; - int32_t average; - int32_t tmp, above1, above_l1, above_r1, left1, left_r1, left_l1; - int32_t above2, left2; - - __asm__ __volatile__ ( - "lw %[above1], (%[above]) \n\t" - "lw %[above2], 4(%[above]) \n\t" - "lw %[left1], (%[left]) \n\t" - "lw %[left2], 4(%[left]) \n\t" - - "preceu.ph.qbl %[above_l1], %[above1] \n\t" - "preceu.ph.qbr %[above_r1], %[above1] \n\t" - "preceu.ph.qbl %[left_l1], %[left1] \n\t" - "preceu.ph.qbr %[left_r1], %[left1] \n\t" - - "addu.ph %[average], %[above_r1], %[above_l1] \n\t" - "addu.ph %[average], %[average], %[left_l1] \n\t" - "addu.ph %[average], %[average], %[left_r1] \n\t" - - "preceu.ph.qbl %[above_l1], %[above2] \n\t" - "preceu.ph.qbr %[above_r1], %[above2] \n\t" - "preceu.ph.qbl %[left_l1], %[left2] \n\t" - "preceu.ph.qbr %[left_r1], %[left2] \n\t" - - "addu.ph %[average], %[average], %[above_l1] \n\t" - "addu.ph %[average], %[average], %[above_r1] \n\t" - "addu.ph %[average], %[average], %[left_l1] \n\t" - "addu.ph %[average], %[average], %[left_r1] \n\t" - - "lw %[above1], 8(%[above]) \n\t" - "lw %[above2], 12(%[above]) \n\t" - "lw %[left1], 8(%[left]) \n\t" - "lw %[left2], 12(%[left]) \n\t" - - "preceu.ph.qbl %[above_l1], %[above1] \n\t" - "preceu.ph.qbr %[above_r1], %[above1] \n\t" - "preceu.ph.qbl %[left_l1], %[left1] \n\t" - "preceu.ph.qbr %[left_r1], %[left1] \n\t" - - "addu.ph %[average], %[average], %[above_l1] \n\t" - "addu.ph %[average], %[average], %[above_r1] \n\t" - "addu.ph %[average], %[average], %[left_l1] \n\t" - "addu.ph %[average], %[average], %[left_r1] \n\t" - - "preceu.ph.qbl %[above_l1], %[above2] \n\t" - "preceu.ph.qbr %[above_r1], %[above2] \n\t" - "preceu.ph.qbl %[left_l1], %[left2] \n\t" - "preceu.ph.qbr %[left_r1], %[left2] \n\t" - - "addu.ph %[average], %[average], %[above_l1] \n\t" - "addu.ph %[average], %[average], %[above_r1] \n\t" - "addu.ph %[average], %[average], %[left_l1] \n\t" - "addu.ph %[average], %[average], %[left_r1] \n\t" - - "addiu %[average], %[average], 16 \n\t" - "srl %[tmp], %[average], 16 \n\t" - "addu.ph %[average], %[tmp], %[average] \n\t" - "srl %[expected_dc], %[average], 5 \n\t" - "replv.qb %[expected_dc], %[expected_dc] \n\t" - - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - "sw %[expected_dc], 8(%[dst]) \n\t" - "sw %[expected_dc], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - "sw %[expected_dc], 8(%[dst]) \n\t" - "sw %[expected_dc], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - "sw %[expected_dc], 8(%[dst]) \n\t" - "sw %[expected_dc], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - "sw %[expected_dc], 8(%[dst]) \n\t" - "sw %[expected_dc], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - "sw %[expected_dc], 8(%[dst]) \n\t" - "sw %[expected_dc], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - "sw %[expected_dc], 8(%[dst]) \n\t" - "sw %[expected_dc], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - "sw %[expected_dc], 8(%[dst]) \n\t" - "sw %[expected_dc], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - "sw %[expected_dc], 8(%[dst]) \n\t" - "sw %[expected_dc], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - "sw %[expected_dc], 8(%[dst]) \n\t" - "sw %[expected_dc], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - "sw %[expected_dc], 8(%[dst]) \n\t" - "sw %[expected_dc], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - "sw %[expected_dc], 8(%[dst]) \n\t" - "sw %[expected_dc], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - "sw %[expected_dc], 8(%[dst]) \n\t" - "sw %[expected_dc], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - "sw %[expected_dc], 8(%[dst]) \n\t" - "sw %[expected_dc], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - "sw %[expected_dc], 8(%[dst]) \n\t" - "sw %[expected_dc], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - "sw %[expected_dc], 8(%[dst]) \n\t" - "sw %[expected_dc], 12(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - "sw %[expected_dc], 8(%[dst]) \n\t" - "sw %[expected_dc], 12(%[dst]) \n\t" - - : [left1] "=&r" (left1), [above1] "=&r" (above1), - [left_l1] "=&r" (left_l1), [above_l1] "=&r" (above_l1), - [left_r1] "=&r" (left_r1), [above_r1] "=&r" (above_r1), - [above2] "=&r" (above2), [left2] "=&r" (left2), - [average] "=&r" (average), [tmp] "=&r" (tmp), - [expected_dc] "=&r" (expected_dc) - : [above] "r" (above), [left] "r" (left), - [dst] "r" (dst), [stride] "r" (stride) - ); -} -#endif // #if HAVE_DSPR2 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_intrapred4_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_intrapred4_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_intrapred4_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_intrapred4_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,232 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#include - -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" - -#if HAVE_DSPR2 -void vp9_h_predictor_4x4_dspr2(uint8_t *dst, ptrdiff_t stride, - const uint8_t *above, const uint8_t *left) { - int32_t tmp1, tmp2, tmp3, tmp4; - - __asm__ __volatile__ ( - "lb %[tmp1], (%[left]) \n\t" - "lb %[tmp2], 1(%[left]) \n\t" - "lb %[tmp3], 2(%[left]) \n\t" - "lb %[tmp4], 3(%[left]) \n\t" - "replv.qb %[tmp1], %[tmp1] \n\t" - "replv.qb %[tmp2], %[tmp2] \n\t" - "replv.qb %[tmp3], %[tmp3] \n\t" - "replv.qb %[tmp4], %[tmp4] \n\t" - "sw %[tmp1], (%[dst]) \n\t" - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp2], (%[dst]) \n\t" - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp3], (%[dst]) \n\t" - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp4], (%[dst]) \n\t" - - : [tmp1] "=&r" (tmp1), [tmp2] "=&r" (tmp2), - [tmp3] "=&r" (tmp3), [tmp4] "=&r" (tmp4) - : [left] "r" (left), [dst] "r" (dst), [stride] "r" (stride) - ); -} - -void vp9_dc_predictor_4x4_dspr2(uint8_t *dst, ptrdiff_t stride, - const uint8_t *above, const uint8_t *left) { - int32_t expected_dc; - int32_t average; - int32_t tmp, above_c, above_l, above_r, left_c, left_r, left_l; - - __asm__ __volatile__ ( - "lw %[above_c], (%[above]) \n\t" - "lw %[left_c], (%[left]) \n\t" - - "preceu.ph.qbl %[above_l], %[above_c] \n\t" - "preceu.ph.qbr %[above_r], %[above_c] \n\t" - "preceu.ph.qbl %[left_l], %[left_c] \n\t" - "preceu.ph.qbr %[left_r], %[left_c] \n\t" - - "addu.ph %[average], %[above_r], %[above_l] \n\t" - "addu.ph %[average], %[average], %[left_l] \n\t" - "addu.ph %[average], %[average], %[left_r] \n\t" - "addiu %[average], %[average], 4 \n\t" - "srl %[tmp], %[average], 16 \n\t" - "addu.ph %[average], %[tmp], %[average] \n\t" - "srl %[expected_dc], %[average], 3 \n\t" - "replv.qb %[expected_dc], %[expected_dc] \n\t" - - "sw %[expected_dc], (%[dst]) \n\t" - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - - : [above_c] "=&r" (above_c), [above_l] "=&r" (above_l), - [above_r] "=&r" (above_r), [left_c] "=&r" (left_c), - [left_l] "=&r" (left_l), [left_r] "=&r" (left_r), - [average] "=&r" (average), [tmp] "=&r" (tmp), - [expected_dc] "=&r" (expected_dc) - : [above] "r" (above), [left] "r" (left), - [dst] "r" (dst), [stride] "r" (stride) - ); -} - -void vp9_tm_predictor_4x4_dspr2(uint8_t *dst, ptrdiff_t stride, - const uint8_t *above, const uint8_t *left) { - int32_t abovel, abover; - int32_t left0, left1, left2, left3; - int32_t res0, res1; - int32_t resl; - int32_t resr; - int32_t top_left; - uint8_t *cm = vp9_ff_cropTbl; - - __asm__ __volatile__ ( - "ulw %[resl], (%[above]) \n\t" - - "lbu %[left0], (%[left]) \n\t" - "lbu %[left1], 1(%[left]) \n\t" - "lbu %[left2], 2(%[left]) \n\t" - "lbu %[left3], 3(%[left]) \n\t" - - "lbu %[top_left], -1(%[above]) \n\t" - - "preceu.ph.qbl %[abovel], %[resl] \n\t" - "preceu.ph.qbr %[abover], %[resl] \n\t" - - "replv.ph %[left0], %[left0] \n\t" - "replv.ph %[left1], %[left1] \n\t" - "replv.ph %[left2], %[left2] \n\t" - "replv.ph %[left3], %[left3] \n\t" - - "replv.ph %[top_left], %[top_left] \n\t" - - "addu.ph %[resl], %[abovel], %[left0] \n\t" - "subu.ph %[resl], %[resl], %[top_left] \n\t" - - "addu.ph %[resr], %[abover], %[left0] \n\t" - "subu.ph %[resr], %[resr], %[top_left] \n\t" - - "sll %[res0], %[resr], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "lbux %[res0], %[res0](%[cm]) \n\t" - - "sra %[res1], %[resr], 16 \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - "sb %[res0], (%[dst]) \n\t" - - "sll %[res0], %[resl], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "lbux %[res0], %[res0](%[cm]) \n\t" - "sb %[res1], 1(%[dst]) \n\t" - - "sra %[res1], %[resl], 16 \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - - "addu.ph %[resl], %[abovel], %[left1] \n\t" - "subu.ph %[resl], %[resl], %[top_left] \n\t" - - "addu.ph %[resr], %[abover], %[left1] \n\t" - "subu.ph %[resr], %[resr], %[top_left] \n\t" - - "sb %[res0], 2(%[dst]) \n\t" - "sb %[res1], 3(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - - "sll %[res0], %[resr], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "lbux %[res0], %[res0](%[cm]) \n\t" - - "sra %[res1], %[resr], 16 \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - "sb %[res0], (%[dst]) \n\t" - - "sll %[res0], %[resl], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "lbux %[res0], %[res0](%[cm]) \n\t" - - "sb %[res1], 1(%[dst]) \n\t" - "sra %[res1], %[resl], 16 \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - - "addu.ph %[resl], %[abovel], %[left2] \n\t" - "subu.ph %[resl], %[resl], %[top_left] \n\t" - - "addu.ph %[resr], %[abover], %[left2] \n\t" - "subu.ph %[resr], %[resr], %[top_left] \n\t" - - "sb %[res0], 2(%[dst]) \n\t" - "sb %[res1], 3(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - - "sll %[res0], %[resr], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "lbux %[res0], %[res0](%[cm]) \n\t" - - - "sra %[res1], %[resr], 16 \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - "sb %[res0], (%[dst]) \n\t" - - "sll %[res0], %[resl], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "lbux %[res0], %[res0](%[cm]) \n\t" - - - "sb %[res1], 1(%[dst]) \n\t" - "sra %[res1], %[resl], 16 \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - - "addu.ph %[resl], %[abovel], %[left3] \n\t" - "subu.ph %[resl], %[resl], %[top_left] \n\t" - - "addu.ph %[resr], %[abover], %[left3] \n\t" - "subu.ph %[resr], %[resr], %[top_left] \n\t" - - "sb %[res0], 2(%[dst]) \n\t" - "sb %[res1], 3(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - - "sll %[res0], %[resr], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "lbux %[res0], %[res0](%[cm]) \n\t" - - "sra %[res1], %[resr], 16 \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - "sb %[res0], (%[dst]) \n\t" - - "sll %[res0], %[resl], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "lbux %[res0], %[res0](%[cm]) \n\t" - "sb %[res1], 1(%[dst]) \n\t" - - "sra %[res1], %[resl], 16 \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - - "sb %[res0], 2(%[dst]) \n\t" - "sb %[res1], 3(%[dst]) \n\t" - - : [abovel] "=&r" (abovel), [abover] "=&r" (abover), - [left0] "=&r" (left0), [left1] "=&r" (left1), [left2] "=&r" (left2), - [res0] "=&r" (res0), [res1] "=&r" (res1), [left3] "=&r" (left3), - [resl] "=&r" (resl), [resr] "=&r" (resr), [top_left] "=&r" (top_left) - : [above] "r" (above), [left] "r" (left), - [dst] "r" (dst), [stride] "r" (stride), [cm] "r" (cm) - ); -} -#endif // #if HAVE_DSPR2 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_intrapred8_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_intrapred8_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_intrapred8_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_intrapred8_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,610 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#include - -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" - -#if HAVE_DSPR2 -void vp9_h_predictor_8x8_dspr2(uint8_t *dst, ptrdiff_t stride, - const uint8_t *above, const uint8_t *left) { - int32_t tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8; - - __asm__ __volatile__ ( - "lb %[tmp1], (%[left]) \n\t" - "lb %[tmp2], 1(%[left]) \n\t" - "lb %[tmp3], 2(%[left]) \n\t" - "lb %[tmp4], 3(%[left]) \n\t" - "lb %[tmp5], 4(%[left]) \n\t" - "lb %[tmp6], 5(%[left]) \n\t" - "lb %[tmp7], 6(%[left]) \n\t" - "lb %[tmp8], 7(%[left]) \n\t" - - "replv.qb %[tmp1], %[tmp1] \n\t" - "replv.qb %[tmp2], %[tmp2] \n\t" - "replv.qb %[tmp3], %[tmp3] \n\t" - "replv.qb %[tmp4], %[tmp4] \n\t" - "replv.qb %[tmp5], %[tmp5] \n\t" - "replv.qb %[tmp6], %[tmp6] \n\t" - "replv.qb %[tmp7], %[tmp7] \n\t" - "replv.qb %[tmp8], %[tmp8] \n\t" - - "sw %[tmp1], (%[dst]) \n\t" - "sw %[tmp1], 4(%[dst]) \n\t" - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp2], (%[dst]) \n\t" - "sw %[tmp2], 4(%[dst]) \n\t" - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp3], (%[dst]) \n\t" - "sw %[tmp3], 4(%[dst]) \n\t" - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp4], (%[dst]) \n\t" - "sw %[tmp4], 4(%[dst]) \n\t" - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp5], (%[dst]) \n\t" - "sw %[tmp5], 4(%[dst]) \n\t" - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp6], (%[dst]) \n\t" - "sw %[tmp6], 4(%[dst]) \n\t" - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp7], (%[dst]) \n\t" - "sw %[tmp7], 4(%[dst]) \n\t" - "add %[dst], %[dst], %[stride] \n\t" - "sw %[tmp8], (%[dst]) \n\t" - "sw %[tmp8], 4(%[dst]) \n\t" - - : [tmp1] "=&r" (tmp1), [tmp2] "=&r" (tmp2), - [tmp3] "=&r" (tmp3), [tmp4] "=&r" (tmp4), - [tmp5] "=&r" (tmp5), [tmp7] "=&r" (tmp7), - [tmp6] "=&r" (tmp6), [tmp8] "=&r" (tmp8) - : [left] "r" (left), [dst] "r" (dst), - [stride] "r" (stride) - ); -} - -void vp9_dc_predictor_8x8_dspr2(uint8_t *dst, ptrdiff_t stride, - const uint8_t *above, const uint8_t *left) { - int32_t expected_dc; - int32_t average; - int32_t tmp, above1, above_l1, above_r1, left1, left_r1, left_l1; - int32_t above2, above_l2, above_r2, left2, left_r2, left_l2; - - __asm__ __volatile__ ( - "lw %[above1], (%[above]) \n\t" - "lw %[above2], 4(%[above]) \n\t" - "lw %[left1], (%[left]) \n\t" - "lw %[left2], 4(%[left]) \n\t" - - "preceu.ph.qbl %[above_l1], %[above1] \n\t" - "preceu.ph.qbr %[above_r1], %[above1] \n\t" - "preceu.ph.qbl %[left_l1], %[left1] \n\t" - "preceu.ph.qbr %[left_r1], %[left1] \n\t" - - "preceu.ph.qbl %[above_l2], %[above2] \n\t" - "preceu.ph.qbr %[above_r2], %[above2] \n\t" - "preceu.ph.qbl %[left_l2], %[left2] \n\t" - "preceu.ph.qbr %[left_r2], %[left2] \n\t" - - "addu.ph %[average], %[above_r1], %[above_l1] \n\t" - "addu.ph %[average], %[average], %[left_l1] \n\t" - "addu.ph %[average], %[average], %[left_r1] \n\t" - - "addu.ph %[average], %[average], %[above_l2] \n\t" - "addu.ph %[average], %[average], %[above_r2] \n\t" - "addu.ph %[average], %[average], %[left_l2] \n\t" - "addu.ph %[average], %[average], %[left_r2] \n\t" - - "addiu %[average], %[average], 8 \n\t" - - "srl %[tmp], %[average], 16 \n\t" - "addu.ph %[average], %[tmp], %[average] \n\t" - "srl %[expected_dc], %[average], 4 \n\t" - "replv.qb %[expected_dc], %[expected_dc] \n\t" - - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - - "add %[dst], %[dst], %[stride] \n\t" - "sw %[expected_dc], (%[dst]) \n\t" - "sw %[expected_dc], 4(%[dst]) \n\t" - - : [above1] "=&r" (above1), [above_l1] "=&r" (above_l1), - [above_r1] "=&r" (above_r1), [left1] "=&r" (left1), - [left_l1] "=&r" (left_l1), [left_r1] "=&r" (left_r1), - [above2] "=&r" (above2), [above_l2] "=&r" (above_l2), - [above_r2] "=&r" (above_r2), [left2] "=&r" (left2), - [left_l2] "=&r" (left_l2), [left_r2] "=&r" (left_r2), - [average] "=&r" (average), [tmp] "=&r" (tmp), - [expected_dc] "=&r" (expected_dc) - : [above] "r" (above), [left] "r" (left), [dst] "r" (dst), - [stride] "r" (stride) - ); -} - -void vp9_tm_predictor_8x8_dspr2(uint8_t *dst, ptrdiff_t stride, - const uint8_t *above, const uint8_t *left) { - int32_t abovel, abover; - int32_t abovel_1, abover_1; - int32_t left0; - int32_t res0, res1, res2, res3; - int32_t reshw; - int32_t top_left; - uint8_t *cm = vp9_ff_cropTbl; - - __asm__ __volatile__ ( - "ulw %[reshw], (%[above]) \n\t" - "ulw %[top_left], 4(%[above]) \n\t" - - "lbu %[left0], (%[left]) \n\t" - - "preceu.ph.qbl %[abovel], %[reshw] \n\t" - "preceu.ph.qbr %[abover], %[reshw] \n\t" - "preceu.ph.qbl %[abovel_1], %[top_left] \n\t" - "preceu.ph.qbr %[abover_1], %[top_left] \n\t" - - "lbu %[top_left], -1(%[above]) \n\t" - "replv.ph %[left0], %[left0] \n\t" - - "replv.ph %[top_left], %[top_left] \n\t" - - "addu.ph %[reshw], %[abovel], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res2], %[reshw], 16 \n\t" - "sra %[res2], %[res2], 16 \n\t" - "sra %[res3], %[reshw], 16 \n\t" - - "addu.ph %[reshw], %[abover], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res0], %[reshw], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "sra %[res1], %[reshw], 16 \n\t" - - "lbux %[res0], %[res0](%[cm]) \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - "lbux %[res2], %[res2](%[cm]) \n\t" - "lbux %[res3], %[res3](%[cm]) \n\t" - - "sb %[res0], (%[dst]) \n\t" - "sb %[res1], 1(%[dst]) \n\t" - "sb %[res2], 2(%[dst]) \n\t" - "sb %[res3], 3(%[dst]) \n\t" - - "addu.ph %[reshw], %[abovel_1], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res2], %[reshw], 16 \n\t" - "sra %[res2], %[res2], 16 \n\t" - "sra %[res3], %[reshw], 16 \n\t" - - "addu.ph %[reshw], %[abover_1], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res0], %[reshw], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "sra %[res1], %[reshw], 16 \n\t" - - "lbu %[left0], 1(%[left]) \n\t" - - "lbux %[res0], %[res0](%[cm]) \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - "lbux %[res2], %[res2](%[cm]) \n\t" - "lbux %[res3], %[res3](%[cm]) \n\t" - - "sb %[res0], 4(%[dst]) \n\t" - "sb %[res1], 5(%[dst]) \n\t" - "sb %[res2], 6(%[dst]) \n\t" - "sb %[res3], 7(%[dst]) \n\t" - - "replv.ph %[left0], %[left0] \n\t" - "add %[dst], %[dst], %[stride] \n\t" - - "addu.ph %[reshw], %[abovel], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res2], %[reshw], 16 \n\t" - "sra %[res2], %[res2], 16 \n\t" - "sra %[res3], %[reshw], 16 \n\t" - - "addu.ph %[reshw], %[abover], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res0], %[reshw], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "sra %[res1], %[reshw], 16 \n\t" - - "lbux %[res0], %[res0](%[cm]) \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - "lbux %[res2], %[res2](%[cm]) \n\t" - "lbux %[res3], %[res3](%[cm]) \n\t" - - "sb %[res0], (%[dst]) \n\t" - "sb %[res1], 1(%[dst]) \n\t" - "sb %[res2], 2(%[dst]) \n\t" - "sb %[res3], 3(%[dst]) \n\t" - - "addu.ph %[reshw], %[abovel_1], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res2], %[reshw], 16 \n\t" - "sra %[res2], %[res2], 16 \n\t" - "sra %[res3], %[reshw], 16 \n\t" - - "addu.ph %[reshw], %[abover_1], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res0], %[reshw], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "sra %[res1], %[reshw], 16 \n\t" - - "lbu %[left0], 2(%[left]) \n\t" - - "lbux %[res0], %[res0](%[cm]) \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - "lbux %[res2], %[res2](%[cm]) \n\t" - "lbux %[res3], %[res3](%[cm]) \n\t" - - "sb %[res0], 4(%[dst]) \n\t" - "sb %[res1], 5(%[dst]) \n\t" - "sb %[res2], 6(%[dst]) \n\t" - "sb %[res3], 7(%[dst]) \n\t" - - "replv.ph %[left0], %[left0] \n\t" - "add %[dst], %[dst], %[stride] \n\t" - - "addu.ph %[reshw], %[abovel], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res2], %[reshw], 16 \n\t" - "sra %[res2], %[res2], 16 \n\t" - "sra %[res3], %[reshw], 16 \n\t" - - "addu.ph %[reshw], %[abover], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res0], %[reshw], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "sra %[res1], %[reshw], 16 \n\t" - - "lbux %[res0], %[res0](%[cm]) \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - "lbux %[res2], %[res2](%[cm]) \n\t" - "lbux %[res3], %[res3](%[cm]) \n\t" - - "sb %[res0], (%[dst]) \n\t" - "sb %[res1], 1(%[dst]) \n\t" - "sb %[res2], 2(%[dst]) \n\t" - "sb %[res3], 3(%[dst]) \n\t" - - "addu.ph %[reshw], %[abovel_1], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res2], %[reshw], 16 \n\t" - "sra %[res2], %[res2], 16 \n\t" - "sra %[res3], %[reshw], 16 \n\t" - - "addu.ph %[reshw], %[abover_1], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res0], %[reshw], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "sra %[res1], %[reshw], 16 \n\t" - - "lbu %[left0], 3(%[left]) \n\t" - - "lbux %[res0], %[res0](%[cm]) \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - "lbux %[res2], %[res2](%[cm]) \n\t" - "lbux %[res3], %[res3](%[cm]) \n\t" - - "sb %[res0], 4(%[dst]) \n\t" - "sb %[res1], 5(%[dst]) \n\t" - "sb %[res2], 6(%[dst]) \n\t" - "sb %[res3], 7(%[dst]) \n\t" - - "replv.ph %[left0], %[left0] \n\t" - "add %[dst], %[dst], %[stride] \n\t" - - "addu.ph %[reshw], %[abovel], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res2], %[reshw], 16 \n\t" - "sra %[res2], %[res2], 16 \n\t" - "sra %[res3], %[reshw], 16 \n\t" - - "addu.ph %[reshw], %[abover], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res0], %[reshw], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "sra %[res1], %[reshw], 16 \n\t" - - "lbux %[res0], %[res0](%[cm]) \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - "lbux %[res2], %[res2](%[cm]) \n\t" - "lbux %[res3], %[res3](%[cm]) \n\t" - - "sb %[res0], (%[dst]) \n\t" - "sb %[res1], 1(%[dst]) \n\t" - "sb %[res2], 2(%[dst]) \n\t" - "sb %[res3], 3(%[dst]) \n\t" - - "addu.ph %[reshw], %[abovel_1], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res2], %[reshw], 16 \n\t" - "sra %[res2], %[res2], 16 \n\t" - "sra %[res3], %[reshw], 16 \n\t" - - "addu.ph %[reshw], %[abover_1], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res0], %[reshw], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "sra %[res1], %[reshw], 16 \n\t" - - "lbu %[left0], 4(%[left]) \n\t" - - "lbux %[res0], %[res0](%[cm]) \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - "lbux %[res2], %[res2](%[cm]) \n\t" - "lbux %[res3], %[res3](%[cm]) \n\t" - - "sb %[res0], 4(%[dst]) \n\t" - "sb %[res1], 5(%[dst]) \n\t" - "sb %[res2], 6(%[dst]) \n\t" - "sb %[res3], 7(%[dst]) \n\t" - - "replv.ph %[left0], %[left0] \n\t" - "add %[dst], %[dst], %[stride] \n\t" - - "addu.ph %[reshw], %[abovel], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res2], %[reshw], 16 \n\t" - "sra %[res2], %[res2], 16 \n\t" - "sra %[res3], %[reshw], 16 \n\t" - - "addu.ph %[reshw], %[abover], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res0], %[reshw], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "sra %[res1], %[reshw], 16 \n\t" - - "lbux %[res0], %[res0](%[cm]) \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - "lbux %[res2], %[res2](%[cm]) \n\t" - "lbux %[res3], %[res3](%[cm]) \n\t" - - "sb %[res0], (%[dst]) \n\t" - "sb %[res1], 1(%[dst]) \n\t" - "sb %[res2], 2(%[dst]) \n\t" - "sb %[res3], 3(%[dst]) \n\t" - - "addu.ph %[reshw], %[abovel_1], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res2], %[reshw], 16 \n\t" - "sra %[res2], %[res2], 16 \n\t" - "sra %[res3], %[reshw], 16 \n\t" - - "addu.ph %[reshw], %[abover_1], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res0], %[reshw], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "sra %[res1], %[reshw], 16 \n\t" - - "lbu %[left0], 5(%[left]) \n\t" - - "lbux %[res0], %[res0](%[cm]) \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - "lbux %[res2], %[res2](%[cm]) \n\t" - "lbux %[res3], %[res3](%[cm]) \n\t" - - "sb %[res0], 4(%[dst]) \n\t" - "sb %[res1], 5(%[dst]) \n\t" - "sb %[res2], 6(%[dst]) \n\t" - "sb %[res3], 7(%[dst]) \n\t" - - "replv.ph %[left0], %[left0] \n\t" - "add %[dst], %[dst], %[stride] \n\t" - - "addu.ph %[reshw], %[abovel], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res2], %[reshw], 16 \n\t" - "sra %[res2], %[res2], 16 \n\t" - "sra %[res3], %[reshw], 16 \n\t" - - "addu.ph %[reshw], %[abover], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res0], %[reshw], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "sra %[res1], %[reshw], 16 \n\t" - - "lbux %[res0], %[res0](%[cm]) \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - "lbux %[res2], %[res2](%[cm]) \n\t" - "lbux %[res3], %[res3](%[cm]) \n\t" - - "sb %[res0], (%[dst]) \n\t" - "sb %[res1], 1(%[dst]) \n\t" - "sb %[res2], 2(%[dst]) \n\t" - "sb %[res3], 3(%[dst]) \n\t" - - "addu.ph %[reshw], %[abovel_1], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res2], %[reshw], 16 \n\t" - "sra %[res2], %[res2], 16 \n\t" - "sra %[res3], %[reshw], 16 \n\t" - - "addu.ph %[reshw], %[abover_1], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res0], %[reshw], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "sra %[res1], %[reshw], 16 \n\t" - - "lbu %[left0], 6(%[left]) \n\t" - - "lbux %[res0], %[res0](%[cm]) \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - "lbux %[res2], %[res2](%[cm]) \n\t" - "lbux %[res3], %[res3](%[cm]) \n\t" - - "sb %[res0], 4(%[dst]) \n\t" - "sb %[res1], 5(%[dst]) \n\t" - "sb %[res2], 6(%[dst]) \n\t" - "sb %[res3], 7(%[dst]) \n\t" - - "replv.ph %[left0], %[left0] \n\t" - "add %[dst], %[dst], %[stride] \n\t" - - "addu.ph %[reshw], %[abovel], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res2], %[reshw], 16 \n\t" - "sra %[res2], %[res2], 16 \n\t" - "sra %[res3], %[reshw], 16 \n\t" - - "addu.ph %[reshw], %[abover], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res0], %[reshw], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "sra %[res1], %[reshw], 16 \n\t" - - "lbux %[res0], %[res0](%[cm]) \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - "lbux %[res2], %[res2](%[cm]) \n\t" - "lbux %[res3], %[res3](%[cm]) \n\t" - - "sb %[res0], (%[dst]) \n\t" - "sb %[res1], 1(%[dst]) \n\t" - "sb %[res2], 2(%[dst]) \n\t" - "sb %[res3], 3(%[dst]) \n\t" - - "addu.ph %[reshw], %[abovel_1], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res2], %[reshw], 16 \n\t" - "sra %[res2], %[res2], 16 \n\t" - "sra %[res3], %[reshw], 16 \n\t" - - "addu.ph %[reshw], %[abover_1], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res0], %[reshw], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "sra %[res1], %[reshw], 16 \n\t" - - "lbu %[left0], 7(%[left]) \n\t" - - "lbux %[res0], %[res0](%[cm]) \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - "lbux %[res2], %[res2](%[cm]) \n\t" - "lbux %[res3], %[res3](%[cm]) \n\t" - - "sb %[res0], 4(%[dst]) \n\t" - "sb %[res1], 5(%[dst]) \n\t" - "sb %[res2], 6(%[dst]) \n\t" - "sb %[res3], 7(%[dst]) \n\t" - - "replv.ph %[left0], %[left0] \n\t" - "add %[dst], %[dst], %[stride] \n\t" - - "addu.ph %[reshw], %[abovel], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res2], %[reshw], 16 \n\t" - "sra %[res2], %[res2], 16 \n\t" - "sra %[res3], %[reshw], 16 \n\t" - - "addu.ph %[reshw], %[abover], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res0], %[reshw], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "sra %[res1], %[reshw], 16 \n\t" - - "lbux %[res0], %[res0](%[cm]) \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - "lbux %[res2], %[res2](%[cm]) \n\t" - "lbux %[res3], %[res3](%[cm]) \n\t" - - "sb %[res0], (%[dst]) \n\t" - "sb %[res1], 1(%[dst]) \n\t" - "sb %[res2], 2(%[dst]) \n\t" - "sb %[res3], 3(%[dst]) \n\t" - - "addu.ph %[reshw], %[abovel_1], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res2], %[reshw], 16 \n\t" - "sra %[res2], %[res2], 16 \n\t" - "sra %[res3], %[reshw], 16 \n\t" - - "addu.ph %[reshw], %[abover_1], %[left0] \n\t" - "subu.ph %[reshw], %[reshw], %[top_left] \n\t" - - "sll %[res0], %[reshw], 16 \n\t" - "sra %[res0], %[res0], 16 \n\t" - "sra %[res1], %[reshw], 16 \n\t" - - "lbux %[res0], %[res0](%[cm]) \n\t" - "lbux %[res1], %[res1](%[cm]) \n\t" - "lbux %[res2], %[res2](%[cm]) \n\t" - "lbux %[res3], %[res3](%[cm]) \n\t" - - "sb %[res0], 4(%[dst]) \n\t" - "sb %[res1], 5(%[dst]) \n\t" - "sb %[res2], 6(%[dst]) \n\t" - "sb %[res3], 7(%[dst]) \n\t" - - : [abovel] "=&r" (abovel), [abover] "=&r" (abover), - [abovel_1] "=&r" (abovel_1), [abover_1] "=&r" (abover_1), - [left0] "=&r" (left0), [res2] "=&r" (res2), [res3] "=&r" (res3), - [res0] "=&r" (res0), [res1] "=&r" (res1), - [reshw] "=&r" (reshw), [top_left] "=&r" (top_left) - : [above] "r" (above), [left] "r" (left), - [dst] "r" (dst), [stride] "r" (stride), [cm] "r" (cm) - ); -} -#endif // #if HAVE_DSPR2 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_itrans16_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_itrans16_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_itrans16_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_itrans16_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1315 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vpx_config.h" -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_blockd.h" -#include "vp9/common/vp9_idct.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" - -#if HAVE_DSPR2 -static void idct16_rows_dspr2(const int16_t *input, int16_t *output, - uint32_t no_rows) { - int i; - int step1_0, step1_1, step1_2, step1_3, step1_4, step1_5, step1_6, step1_7; - int step1_10, step1_11, step1_12, step1_13; - int step2_0, step2_1, step2_2, step2_3; - int step2_8, step2_9, step2_10, step2_11; - int step2_12, step2_13, step2_14, step2_15; - int load1, load2, load3, load4, load5, load6, load7, load8; - int result1, result2, result3, result4; - const int const_2_power_13 = 8192; - - for (i = no_rows; i--; ) { - /* prefetch row */ - vp9_prefetch_load((const uint8_t *)(input + 16)); - - __asm__ __volatile__ ( - "lh %[load1], 0(%[input]) \n\t" - "lh %[load2], 16(%[input]) \n\t" - "lh %[load3], 8(%[input]) \n\t" - "lh %[load4], 24(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "add %[result1], %[load1], %[load2] \n\t" - "sub %[result2], %[load1], %[load2] \n\t" - "madd $ac1, %[result1], %[cospi_16_64] \n\t" - "madd $ac2, %[result2], %[cospi_16_64] \n\t" - "extp %[step2_0], $ac1, 31 \n\t" - "extp %[step2_1], $ac2, 31 \n\t" - - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "madd $ac3, %[load3], %[cospi_24_64] \n\t" - "msub $ac3, %[load4], %[cospi_8_64] \n\t" - "extp %[step2_2], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "madd $ac1, %[load3], %[cospi_8_64] \n\t" - "madd $ac1, %[load4], %[cospi_24_64] \n\t" - "extp %[step2_3], $ac1, 31 \n\t" - - "add %[step1_0], %[step2_0], %[step2_3] \n\t" - "add %[step1_1], %[step2_1], %[step2_2] \n\t" - "sub %[step1_2], %[step2_1], %[step2_2] \n\t" - "sub %[step1_3], %[step2_0], %[step2_3] \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [load3] "=&r" (load3), [load4] "=&r" (load4), - [result1] "=&r" (result1), [result2] "=&r" (result2), - [step2_0] "=&r" (step2_0), [step2_1] "=&r" (step2_1), - [step2_2] "=&r" (step2_2), [step2_3] "=&r" (step2_3), - [step1_0] "=r" (step1_0), [step1_1] "=r" (step1_1), - [step1_2] "=r" (step1_2), [step1_3] "=r" (step1_3) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_24_64] "r" (cospi_24_64), [cospi_8_64] "r" (cospi_8_64), - [cospi_16_64] "r" (cospi_16_64) - ); - - __asm__ __volatile__ ( - "lh %[load5], 2(%[input]) \n\t" - "lh %[load6], 30(%[input]) \n\t" - "lh %[load7], 18(%[input]) \n\t" - "lh %[load8], 14(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load5], %[cospi_30_64] \n\t" - "msub $ac1, %[load6], %[cospi_2_64] \n\t" - "extp %[result1], $ac1, 31 \n\t" - - "madd $ac3, %[load7], %[cospi_14_64] \n\t" - "msub $ac3, %[load8], %[cospi_18_64] \n\t" - "extp %[result2], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - - "madd $ac1, %[load7], %[cospi_18_64] \n\t" - "madd $ac1, %[load8], %[cospi_14_64] \n\t" - "extp %[result3], $ac1, 31 \n\t" - - "madd $ac2, %[load5], %[cospi_2_64] \n\t" - "madd $ac2, %[load6], %[cospi_30_64] \n\t" - "extp %[result4], $ac2, 31 \n\t" - - "sub %[load5], %[result1], %[result2] \n\t" - "sub %[load6], %[result4], %[result3] \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load6], %[cospi_24_64] \n\t" - "msub $ac1, %[load5], %[cospi_8_64] \n\t" - "madd $ac3, %[load5], %[cospi_24_64] \n\t" - "madd $ac3, %[load6], %[cospi_8_64] \n\t" - - "extp %[step2_9], $ac1, 31 \n\t" - "extp %[step2_14], $ac3, 31 \n\t" - "add %[step2_8], %[result1], %[result2] \n\t" - "add %[step2_15], %[result4], %[result3] \n\t" - - : [load5] "=&r" (load5), [load6] "=&r" (load6), - [load7] "=&r" (load7), [load8] "=&r" (load8), - [result1] "=&r" (result1), [result2] "=&r" (result2), - [result3] "=&r" (result3), [result4] "=&r" (result4), - [step2_8] "=r" (step2_8), [step2_15] "=r" (step2_15), - [step2_9] "=r" (step2_9), [step2_14] "=r" (step2_14) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_30_64] "r" (cospi_30_64), [cospi_2_64] "r" (cospi_2_64), - [cospi_14_64] "r" (cospi_14_64), [cospi_18_64] "r" (cospi_18_64), - [cospi_24_64] "r" (cospi_24_64), [cospi_8_64] "r" (cospi_8_64) - ); - - __asm__ __volatile__ ( - "lh %[load1], 10(%[input]) \n\t" - "lh %[load2], 22(%[input]) \n\t" - "lh %[load3], 26(%[input]) \n\t" - "lh %[load4], 6(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load1], %[cospi_22_64] \n\t" - "msub $ac1, %[load2], %[cospi_10_64] \n\t" - "extp %[result1], $ac1, 31 \n\t" - - "madd $ac3, %[load3], %[cospi_6_64] \n\t" - "msub $ac3, %[load4], %[cospi_26_64] \n\t" - "extp %[result2], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - - "madd $ac1, %[load1], %[cospi_10_64] \n\t" - "madd $ac1, %[load2], %[cospi_22_64] \n\t" - "extp %[result3], $ac1, 31 \n\t" - - "madd $ac2, %[load3], %[cospi_26_64] \n\t" - "madd $ac2, %[load4], %[cospi_6_64] \n\t" - "extp %[result4], $ac2, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "sub %[load1], %[result2], %[result1] \n\t" - "sub %[load2], %[result4], %[result3] \n\t" - - "msub $ac1, %[load1], %[cospi_24_64] \n\t" - "msub $ac1, %[load2], %[cospi_8_64] \n\t" - "madd $ac3, %[load2], %[cospi_24_64] \n\t" - "msub $ac3, %[load1], %[cospi_8_64] \n\t" - - "extp %[step2_10], $ac1, 31 \n\t" - "extp %[step2_13], $ac3, 31 \n\t" - "add %[step2_11], %[result1], %[result2] \n\t" - "add %[step2_12], %[result4], %[result3] \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [load3] "=&r" (load3), [load4] "=&r" (load4), - [result1] "=&r" (result1), [result2] "=&r" (result2), - [result3] "=&r" (result3), [result4] "=&r" (result4), - [step2_10] "=r" (step2_10), [step2_11] "=r" (step2_11), - [step2_12] "=r" (step2_12), [step2_13] "=r" (step2_13) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_22_64] "r" (cospi_22_64), [cospi_10_64] "r" (cospi_10_64), - [cospi_6_64] "r" (cospi_6_64), [cospi_26_64] "r" (cospi_26_64), - [cospi_24_64] "r" (cospi_24_64), [cospi_8_64] "r" (cospi_8_64) - ); - - __asm__ __volatile__ ( - "lh %[load5], 4(%[input]) \n\t" - "lh %[load6], 28(%[input]) \n\t" - "lh %[load7], 20(%[input]) \n\t" - "lh %[load8], 12(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load5], %[cospi_28_64] \n\t" - "msub $ac1, %[load6], %[cospi_4_64] \n\t" - "extp %[result1], $ac1, 31 \n\t" - - "madd $ac3, %[load7], %[cospi_12_64] \n\t" - "msub $ac3, %[load8], %[cospi_20_64] \n\t" - "extp %[result2], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - - "madd $ac1, %[load7], %[cospi_20_64] \n\t" - "madd $ac1, %[load8], %[cospi_12_64] \n\t" - "extp %[result3], $ac1, 31 \n\t" - - "madd $ac2, %[load5], %[cospi_4_64] \n\t" - "madd $ac2, %[load6], %[cospi_28_64] \n\t" - "extp %[result4], $ac2, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "sub %[load5], %[result4], %[result3] \n\t" - "sub %[load5], %[load5], %[result1] \n\t" - "add %[load5], %[load5], %[result2] \n\t" - - "sub %[load6], %[result1], %[result2] \n\t" - "sub %[load6], %[load6], %[result3] \n\t" - "add %[load6], %[load6], %[result4] \n\t" - - "madd $ac1, %[load5], %[cospi_16_64] \n\t" - "madd $ac3, %[load6], %[cospi_16_64] \n\t" - - "extp %[step1_5], $ac1, 31 \n\t" - "extp %[step1_6], $ac3, 31 \n\t" - "add %[step1_4], %[result1], %[result2] \n\t" - "add %[step1_7], %[result4], %[result3] \n\t" - - : [load5] "=&r" (load5), [load6] "=&r" (load6), - [load7] "=&r" (load7), [load8] "=&r" (load8), - [result1] "=&r" (result1), [result2] "=&r" (result2), - [result3] "=&r" (result3), [result4] "=&r" (result4), - [step1_4] "=r" (step1_4), [step1_5] "=r" (step1_5), - [step1_6] "=r" (step1_6), [step1_7] "=r" (step1_7) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_20_64] "r" (cospi_20_64), [cospi_12_64] "r" (cospi_12_64), - [cospi_4_64] "r" (cospi_4_64), [cospi_28_64] "r" (cospi_28_64), - [cospi_16_64] "r" (cospi_16_64) - ); - - __asm__ __volatile__ ( - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - - "sub %[load5], %[step2_14], %[step2_13] \n\t" - "sub %[load5], %[load5], %[step2_9] \n\t" - "add %[load5], %[load5], %[step2_10] \n\t" - - "madd $ac0, %[load5], %[cospi_16_64] \n\t" - - "sub %[load6], %[step2_14], %[step2_13] \n\t" - "sub %[load6], %[load6], %[step2_10] \n\t" - "add %[load6], %[load6], %[step2_9] \n\t" - - "madd $ac1, %[load6], %[cospi_16_64] \n\t" - - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "sub %[load5], %[step2_15], %[step2_12] \n\t" - "sub %[load5], %[load5], %[step2_8] \n\t" - "add %[load5], %[load5], %[step2_11] \n\t" - - "madd $ac2, %[load5], %[cospi_16_64] \n\t" - - "sub %[load6], %[step2_15], %[step2_12] \n\t" - "sub %[load6], %[load6], %[step2_11] \n\t" - "add %[load6], %[load6], %[step2_8] \n\t" - - "madd $ac3, %[load6], %[cospi_16_64] \n\t" - - "extp %[step1_10], $ac0, 31 \n\t" - "extp %[step1_13], $ac1, 31 \n\t" - "extp %[step1_11], $ac2, 31 \n\t" - "extp %[step1_12], $ac3, 31 \n\t" - - : [load5] "=&r" (load5), [load6] "=&r" (load6), - [step1_10] "=r" (step1_10), [step1_11] "=r" (step1_11), - [step1_12] "=r" (step1_12), [step1_13] "=r" (step1_13) - : [const_2_power_13] "r" (const_2_power_13), - [step2_14] "r" (step2_14), [step2_13] "r" (step2_13), - [step2_9] "r" (step2_9), [step2_10] "r" (step2_10), - [step2_15] "r" (step2_15), [step2_12] "r" (step2_12), - [step2_8] "r" (step2_8), [step2_11] "r" (step2_11), - [cospi_16_64] "r" (cospi_16_64) - ); - - __asm__ __volatile__ ( - "add %[load5], %[step1_0], %[step1_7] \n\t" - "add %[load5], %[load5], %[step2_12] \n\t" - "add %[load5], %[load5], %[step2_15] \n\t" - "add %[load6], %[step1_1], %[step1_6] \n\t" - "add %[load6], %[load6], %[step2_13] \n\t" - "add %[load6], %[load6], %[step2_14] \n\t" - "sh %[load5], 0(%[output]) \n\t" - "sh %[load6], 32(%[output]) \n\t" - "sub %[load5], %[step1_1], %[step1_6] \n\t" - "add %[load5], %[load5], %[step2_9] \n\t" - "add %[load5], %[load5], %[step2_10] \n\t" - "sub %[load6], %[step1_0], %[step1_7] \n\t" - "add %[load6], %[load6], %[step2_8] \n\t" - "add %[load6], %[load6], %[step2_11] \n\t" - "sh %[load5], 192(%[output]) \n\t" - "sh %[load6], 224(%[output]) \n\t" - "sub %[load5], %[step1_0], %[step1_7] \n\t" - "sub %[load5], %[load5], %[step2_8] \n\t" - "sub %[load5], %[load5], %[step2_11] \n\t" - "sub %[load6], %[step1_1], %[step1_6] \n\t" - "sub %[load6], %[load6], %[step2_9] \n\t" - "sub %[load6], %[load6], %[step2_10] \n\t" - "sh %[load5], 256(%[output]) \n\t" - "sh %[load6], 288(%[output]) \n\t" - "add %[load5], %[step1_1], %[step1_6] \n\t" - "sub %[load5], %[load5], %[step2_13] \n\t" - "sub %[load5], %[load5], %[step2_14] \n\t" - "add %[load6], %[step1_0], %[step1_7] \n\t" - "sub %[load6], %[load6], %[step2_12] \n\t" - "sub %[load6], %[load6], %[step2_15] \n\t" - "sh %[load5], 448(%[output]) \n\t" - "sh %[load6], 480(%[output]) \n\t" - - : [load5] "=&r" (load5), [load6] "=&r" (load6) - : [output] "r" (output), - [step1_0] "r" (step1_0), [step1_1] "r" (step1_1), - [step1_6] "r" (step1_6), [step1_7] "r" (step1_7), - [step2_8] "r" (step2_8), [step2_9] "r" (step2_9), - [step2_10] "r" (step2_10), [step2_11] "r" (step2_11), - [step2_12] "r" (step2_12), [step2_13] "r" (step2_13), - [step2_14] "r" (step2_14), [step2_15] "r" (step2_15) - ); - - __asm__ __volatile__ ( - "add %[load5], %[step1_2], %[step1_5] \n\t" - "add %[load5], %[load5], %[step1_13] \n\t" - "add %[load6], %[step1_3], %[step1_4] \n\t" - "add %[load6], %[load6], %[step1_12] \n\t" - "sh %[load5], 64(%[output]) \n\t" - "sh %[load6], 96(%[output]) \n\t" - "sub %[load5], %[step1_3], %[step1_4] \n\t" - "add %[load5], %[load5], %[step1_11] \n\t" - "sub %[load6], %[step1_2], %[step1_5] \n\t" - "add %[load6], %[load6], %[step1_10] \n\t" - "sh %[load5], 128(%[output]) \n\t" - "sh %[load6], 160(%[output]) \n\t" - "sub %[load5], %[step1_2], %[step1_5] \n\t" - "sub %[load5], %[load5], %[step1_10] \n\t" - "sub %[load6], %[step1_3], %[step1_4] \n\t" - "sub %[load6], %[load6], %[step1_11] \n\t" - "sh %[load5], 320(%[output]) \n\t" - "sh %[load6], 352(%[output]) \n\t" - "add %[load5], %[step1_3], %[step1_4] \n\t" - "sub %[load5], %[load5], %[step1_12] \n\t" - "add %[load6], %[step1_2], %[step1_5] \n\t" - "sub %[load6], %[load6], %[step1_13] \n\t" - "sh %[load5], 384(%[output]) \n\t" - "sh %[load6], 416(%[output]) \n\t" - - : [load5] "=&r" (load5), [load6] "=&r" (load6) - : [output] "r" (output), - [step1_2] "r" (step1_2), [step1_3] "r" (step1_3), - [step1_4] "r" (step1_4), [step1_5] "r" (step1_5), - [step1_10] "r" (step1_10), [step1_11] "r" (step1_11), - [step1_12] "r" (step1_12), [step1_13] "r" (step1_13) - ); - - input += 16; - output += 1; - } -} - -static void idct16_cols_add_blk_dspr2(int16_t *input, uint8_t *dest, - int dest_stride) { - int i; - int step1_0, step1_1, step1_2, step1_3, step1_4, step1_5, step1_6, step1_7; - int step1_8, step1_9, step1_10, step1_11; - int step1_12, step1_13, step1_14, step1_15; - int step2_0, step2_1, step2_2, step2_3; - int step2_8, step2_9, step2_10, step2_11; - int step2_12, step2_13, step2_14, step2_15; - int load1, load2, load3, load4, load5, load6, load7, load8; - int result1, result2, result3, result4; - const int const_2_power_13 = 8192; - uint8_t *dest_pix; - uint8_t *cm = vp9_ff_cropTbl; - - /* prefetch vp9_ff_cropTbl */ - vp9_prefetch_load(vp9_ff_cropTbl); - vp9_prefetch_load(vp9_ff_cropTbl + 32); - vp9_prefetch_load(vp9_ff_cropTbl + 64); - vp9_prefetch_load(vp9_ff_cropTbl + 96); - vp9_prefetch_load(vp9_ff_cropTbl + 128); - vp9_prefetch_load(vp9_ff_cropTbl + 160); - vp9_prefetch_load(vp9_ff_cropTbl + 192); - vp9_prefetch_load(vp9_ff_cropTbl + 224); - - for (i = 0; i < 16; ++i) { - dest_pix = (dest + i); - __asm__ __volatile__ ( - "lh %[load1], 0(%[input]) \n\t" - "lh %[load2], 16(%[input]) \n\t" - "lh %[load3], 8(%[input]) \n\t" - "lh %[load4], 24(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "add %[result1], %[load1], %[load2] \n\t" - "sub %[result2], %[load1], %[load2] \n\t" - "madd $ac1, %[result1], %[cospi_16_64] \n\t" - "madd $ac2, %[result2], %[cospi_16_64] \n\t" - "extp %[step2_0], $ac1, 31 \n\t" - "extp %[step2_1], $ac2, 31 \n\t" - - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "madd $ac3, %[load3], %[cospi_24_64] \n\t" - "msub $ac3, %[load4], %[cospi_8_64] \n\t" - "extp %[step2_2], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "madd $ac1, %[load3], %[cospi_8_64] \n\t" - "madd $ac1, %[load4], %[cospi_24_64] \n\t" - "extp %[step2_3], $ac1, 31 \n\t" - - "add %[step1_0], %[step2_0], %[step2_3] \n\t" - "add %[step1_1], %[step2_1], %[step2_2] \n\t" - "sub %[step1_2], %[step2_1], %[step2_2] \n\t" - "sub %[step1_3], %[step2_0], %[step2_3] \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [load3] "=&r" (load3), [load4] "=&r" (load4), - [result1] "=&r" (result1), [result2] "=&r" (result2), - [step2_0] "=&r" (step2_0), [step2_1] "=&r" (step2_1), - [step2_2] "=&r" (step2_2), [step2_3] "=&r" (step2_3), - [step1_0] "=r" (step1_0), [step1_1] "=r" (step1_1), - [step1_2] "=r" (step1_2), [step1_3] "=r" (step1_3) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_24_64] "r" (cospi_24_64), [cospi_8_64] "r" (cospi_8_64), - [cospi_16_64] "r" (cospi_16_64) - ); - - __asm__ __volatile__ ( - "lh %[load5], 2(%[input]) \n\t" - "lh %[load6], 30(%[input]) \n\t" - "lh %[load7], 18(%[input]) \n\t" - "lh %[load8], 14(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load5], %[cospi_30_64] \n\t" - "msub $ac1, %[load6], %[cospi_2_64] \n\t" - "extp %[result1], $ac1, 31 \n\t" - - "madd $ac3, %[load7], %[cospi_14_64] \n\t" - "msub $ac3, %[load8], %[cospi_18_64] \n\t" - "extp %[result2], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - - "madd $ac1, %[load7], %[cospi_18_64] \n\t" - "madd $ac1, %[load8], %[cospi_14_64] \n\t" - "extp %[result3], $ac1, 31 \n\t" - - "madd $ac2, %[load5], %[cospi_2_64] \n\t" - "madd $ac2, %[load6], %[cospi_30_64] \n\t" - "extp %[result4], $ac2, 31 \n\t" - - "sub %[load5], %[result1], %[result2] \n\t" - "sub %[load6], %[result4], %[result3] \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load6], %[cospi_24_64] \n\t" - "msub $ac1, %[load5], %[cospi_8_64] \n\t" - "madd $ac3, %[load5], %[cospi_24_64] \n\t" - "madd $ac3, %[load6], %[cospi_8_64] \n\t" - - "extp %[step2_9], $ac1, 31 \n\t" - "extp %[step2_14], $ac3, 31 \n\t" - "add %[step2_8], %[result1], %[result2] \n\t" - "add %[step2_15], %[result4], %[result3] \n\t" - - : [load5] "=&r" (load5), [load6] "=&r" (load6), - [load7] "=&r" (load7), [load8] "=&r" (load8), - [result1] "=&r" (result1), [result2] "=&r" (result2), - [result3] "=&r" (result3), [result4] "=&r" (result4), - [step2_8] "=r" (step2_8), [step2_15] "=r" (step2_15), - [step2_9] "=r" (step2_9), [step2_14] "=r" (step2_14) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_30_64] "r" (cospi_30_64), [cospi_2_64] "r" (cospi_2_64), - [cospi_14_64] "r" (cospi_14_64), [cospi_18_64] "r" (cospi_18_64), - [cospi_24_64] "r" (cospi_24_64), [cospi_8_64] "r" (cospi_8_64) - ); - - __asm__ __volatile__ ( - "lh %[load1], 10(%[input]) \n\t" - "lh %[load2], 22(%[input]) \n\t" - "lh %[load3], 26(%[input]) \n\t" - "lh %[load4], 6(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load1], %[cospi_22_64] \n\t" - "msub $ac1, %[load2], %[cospi_10_64] \n\t" - "extp %[result1], $ac1, 31 \n\t" - - "madd $ac3, %[load3], %[cospi_6_64] \n\t" - "msub $ac3, %[load4], %[cospi_26_64] \n\t" - "extp %[result2], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - - "madd $ac1, %[load1], %[cospi_10_64] \n\t" - "madd $ac1, %[load2], %[cospi_22_64] \n\t" - "extp %[result3], $ac1, 31 \n\t" - - "madd $ac2, %[load3], %[cospi_26_64] \n\t" - "madd $ac2, %[load4], %[cospi_6_64] \n\t" - "extp %[result4], $ac2, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "sub %[load1], %[result2], %[result1] \n\t" - "sub %[load2], %[result4], %[result3] \n\t" - - "msub $ac1, %[load1], %[cospi_24_64] \n\t" - "msub $ac1, %[load2], %[cospi_8_64] \n\t" - "madd $ac3, %[load2], %[cospi_24_64] \n\t" - "msub $ac3, %[load1], %[cospi_8_64] \n\t" - - "extp %[step2_10], $ac1, 31 \n\t" - "extp %[step2_13], $ac3, 31 \n\t" - "add %[step2_11], %[result1], %[result2] \n\t" - "add %[step2_12], %[result4], %[result3] \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [load3] "=&r" (load3), [load4] "=&r" (load4), - [result1] "=&r" (result1), [result2] "=&r" (result2), - [result3] "=&r" (result3), [result4] "=&r" (result4), - [step2_10] "=r" (step2_10), [step2_11] "=r" (step2_11), - [step2_12] "=r" (step2_12), [step2_13] "=r" (step2_13) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_22_64] "r" (cospi_22_64), [cospi_10_64] "r" (cospi_10_64), - [cospi_6_64] "r" (cospi_6_64), [cospi_26_64] "r" (cospi_26_64), - [cospi_24_64] "r" (cospi_24_64), [cospi_8_64] "r" (cospi_8_64) - ); - - __asm__ __volatile__ ( - "lh %[load5], 4(%[input]) \n\t" - "lh %[load6], 28(%[input]) \n\t" - "lh %[load7], 20(%[input]) \n\t" - "lh %[load8], 12(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load5], %[cospi_28_64] \n\t" - "msub $ac1, %[load6], %[cospi_4_64] \n\t" - "extp %[result1], $ac1, 31 \n\t" - - "madd $ac3, %[load7], %[cospi_12_64] \n\t" - "msub $ac3, %[load8], %[cospi_20_64] \n\t" - "extp %[result2], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - - "madd $ac1, %[load7], %[cospi_20_64] \n\t" - "madd $ac1, %[load8], %[cospi_12_64] \n\t" - "extp %[result3], $ac1, 31 \n\t" - - "madd $ac2, %[load5], %[cospi_4_64] \n\t" - "madd $ac2, %[load6], %[cospi_28_64] \n\t" - "extp %[result4], $ac2, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "sub %[load5], %[result4], %[result3] \n\t" - "sub %[load5], %[load5], %[result1] \n\t" - "add %[load5], %[load5], %[result2] \n\t" - - "sub %[load6], %[result1], %[result2] \n\t" - "sub %[load6], %[load6], %[result3] \n\t" - "add %[load6], %[load6], %[result4] \n\t" - - "madd $ac1, %[load5], %[cospi_16_64] \n\t" - "madd $ac3, %[load6], %[cospi_16_64] \n\t" - - "extp %[step1_5], $ac1, 31 \n\t" - "extp %[step1_6], $ac3, 31 \n\t" - - "add %[step1_4], %[result1], %[result2] \n\t" - "add %[step1_7], %[result4], %[result3] \n\t" - - : [load5] "=&r" (load5), [load6] "=&r" (load6), - [load7] "=&r" (load7), [load8] "=&r" (load8), - [result1] "=&r" (result1), [result2] "=&r" (result2), - [result3] "=&r" (result3), [result4] "=&r" (result4), - [step1_4] "=r" (step1_4), [step1_5] "=r" (step1_5), - [step1_6] "=r" (step1_6), [step1_7] "=r" (step1_7) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_20_64] "r" (cospi_20_64), [cospi_12_64] "r" (cospi_12_64), - [cospi_4_64] "r" (cospi_4_64), [cospi_28_64] "r" (cospi_28_64), - [cospi_16_64] "r" (cospi_16_64) - ); - - __asm__ __volatile__ ( - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - - "sub %[load5], %[step2_14], %[step2_13] \n\t" - "sub %[load5], %[load5], %[step2_9] \n\t" - "add %[load5], %[load5], %[step2_10] \n\t" - - "madd $ac0, %[load5], %[cospi_16_64] \n\t" - - "sub %[load6], %[step2_14], %[step2_13] \n\t" - "sub %[load6], %[load6], %[step2_10] \n\t" - "add %[load6], %[load6], %[step2_9] \n\t" - - "madd $ac1, %[load6], %[cospi_16_64] \n\t" - - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "sub %[load5], %[step2_15], %[step2_12] \n\t" - "sub %[load5], %[load5], %[step2_8] \n\t" - "add %[load5], %[load5], %[step2_11] \n\t" - - "madd $ac2, %[load5], %[cospi_16_64] \n\t" - - "sub %[load6], %[step2_15], %[step2_12] \n\t" - "sub %[load6], %[load6], %[step2_11] \n\t" - "add %[load6], %[load6], %[step2_8] \n\t" - - "madd $ac3, %[load6], %[cospi_16_64] \n\t" - - "extp %[step1_10], $ac0, 31 \n\t" - "extp %[step1_13], $ac1, 31 \n\t" - "extp %[step1_11], $ac2, 31 \n\t" - "extp %[step1_12], $ac3, 31 \n\t" - - : [load5] "=&r" (load5), [load6] "=&r" (load6), - [step1_10] "=r" (step1_10), [step1_11] "=r" (step1_11), - [step1_12] "=r" (step1_12), [step1_13] "=r" (step1_13) - : [const_2_power_13] "r" (const_2_power_13), - [step2_14] "r" (step2_14), [step2_13] "r" (step2_13), - [step2_9] "r" (step2_9), [step2_10] "r" (step2_10), - [step2_15] "r" (step2_15), [step2_12] "r" (step2_12), - [step2_8] "r" (step2_8), [step2_11] "r" (step2_11), - [cospi_16_64] "r" (cospi_16_64) - ); - - step1_8 = step2_8 + step2_11; - step1_9 = step2_9 + step2_10; - step1_14 = step2_13 + step2_14; - step1_15 = step2_12 + step2_15; - - __asm__ __volatile__ ( - "lbu %[load7], 0(%[dest_pix]) \n\t" - "add %[load5], %[step1_0], %[step1_7] \n\t" - "add %[load5], %[load5], %[step1_15] \n\t" - "addi %[load5], %[load5], 32 \n\t" - "sra %[load5], %[load5], 6 \n\t" - "add %[load7], %[load7], %[load5] \n\t" - "lbux %[load5], %[load7](%[cm]) \n\t" - "add %[load6], %[step1_1], %[step1_6] \n\t" - "add %[load6], %[load6], %[step1_14] \n\t" - "sb %[load5], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - "lbu %[load8], 0(%[dest_pix]) \n\t" - "addi %[load6], %[load6], 32 \n\t" - "sra %[load6], %[load6], 6 \n\t" - "add %[load8], %[load8], %[load6] \n\t" - "lbux %[load6], %[load8](%[cm]) \n\t" - "sb %[load6], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - "lbu %[load7], 0(%[dest_pix]) \n\t" - "add %[load5], %[step1_2], %[step1_5] \n\t" - "add %[load5], %[load5], %[step1_13] \n\t" - "addi %[load5], %[load5], 32 \n\t" - "sra %[load5], %[load5], 6 \n\t" - "add %[load7], %[load7], %[load5] \n\t" - "lbux %[load5], %[load7](%[cm]) \n\t" - "add %[load6], %[step1_3], %[step1_4] \n\t" - "add %[load6], %[load6], %[step1_12] \n\t" - "sb %[load5], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - "lbu %[load8], 0(%[dest_pix]) \n\t" - "addi %[load6], %[load6], 32 \n\t" - "sra %[load6], %[load6], 6 \n\t" - "add %[load8], %[load8], %[load6] \n\t" - "lbux %[load6], %[load8](%[cm]) \n\t" - "sb %[load6], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - "lbu %[load7], 0(%[dest_pix]) \n\t" - "sub %[load5], %[step1_3], %[step1_4] \n\t" - "add %[load5], %[load5], %[step1_11] \n\t" - "addi %[load5], %[load5], 32 \n\t" - "sra %[load5], %[load5], 6 \n\t" - "add %[load7], %[load7], %[load5] \n\t" - "lbux %[load5], %[load7](%[cm]) \n\t" - "sub %[load6], %[step1_2], %[step1_5] \n\t" - "add %[load6], %[load6], %[step1_10] \n\t" - "sb %[load5], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - "lbu %[load8], 0(%[dest_pix]) \n\t" - "addi %[load6], %[load6], 32 \n\t" - "sra %[load6], %[load6], 6 \n\t" - "add %[load8], %[load8], %[load6] \n\t" - "lbux %[load6], %[load8](%[cm]) \n\t" - "sb %[load6], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - "sub %[load5], %[step1_1], %[step1_6] \n\t" - "lbu %[load7], 0(%[dest_pix]) \n\t" - "add %[load5], %[load5], %[step1_9] \n\t" - "addi %[load5], %[load5], 32 \n\t" - "sra %[load5], %[load5], 6 \n\t" - "add %[load7], %[load7], %[load5] \n\t" - "lbux %[load5], %[load7](%[cm]) \n\t" - "sub %[load6], %[step1_0], %[step1_7] \n\t" - "add %[load6], %[load6], %[step1_8] \n\t" - "sb %[load5], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - "lbu %[load8], 0(%[dest_pix]) \n\t" - "addi %[load6], %[load6], 32 \n\t" - "sra %[load6], %[load6], 6 \n\t" - "add %[load8], %[load8], %[load6] \n\t" - "lbux %[load6], %[load8](%[cm]) \n\t" - "sb %[load6], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - "lbu %[load7], 0(%[dest_pix]) \n\t" - "sub %[load5], %[step1_0], %[step1_7] \n\t" - "sub %[load5], %[load5], %[step1_8] \n\t" - "addi %[load5], %[load5], 32 \n\t" - "sra %[load5], %[load5], 6 \n\t" - "add %[load7], %[load7], %[load5] \n\t" - "lbux %[load5], %[load7](%[cm]) \n\t" - "sub %[load6], %[step1_1], %[step1_6] \n\t" - "sub %[load6], %[load6], %[step1_9] \n\t" - "sb %[load5], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - "lbu %[load8], 0(%[dest_pix]) \n\t" - "addi %[load6], %[load6], 32 \n\t" - "sra %[load6], %[load6], 6 \n\t" - "add %[load8], %[load8], %[load6] \n\t" - "lbux %[load6], %[load8](%[cm]) \n\t" - "sb %[load6], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - "lbu %[load7], 0(%[dest_pix]) \n\t" - "sub %[load5], %[step1_2], %[step1_5] \n\t" - "sub %[load5], %[load5], %[step1_10] \n\t" - "addi %[load5], %[load5], 32 \n\t" - "sra %[load5], %[load5], 6 \n\t" - "add %[load7], %[load7], %[load5] \n\t" - "lbux %[load5], %[load7](%[cm]) \n\t" - "sub %[load6], %[step1_3], %[step1_4] \n\t" - "sub %[load6], %[load6], %[step1_11] \n\t" - "sb %[load5], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - "lbu %[load8], 0(%[dest_pix]) \n\t" - "addi %[load6], %[load6], 32 \n\t" - "sra %[load6], %[load6], 6 \n\t" - "add %[load8], %[load8], %[load6] \n\t" - "lbux %[load6], %[load8](%[cm]) \n\t" - "sb %[load6], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - "lbu %[load7], 0(%[dest_pix]) \n\t" - "add %[load5], %[step1_3], %[step1_4] \n\t" - "sub %[load5], %[load5], %[step1_12] \n\t" - "addi %[load5], %[load5], 32 \n\t" - "sra %[load5], %[load5], 6 \n\t" - "add %[load7], %[load7], %[load5] \n\t" - "lbux %[load5], %[load7](%[cm]) \n\t" - "add %[load6], %[step1_2], %[step1_5] \n\t" - "sub %[load6], %[load6], %[step1_13] \n\t" - "sb %[load5], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - "lbu %[load8], 0(%[dest_pix]) \n\t" - "addi %[load6], %[load6], 32 \n\t" - "sra %[load6], %[load6], 6 \n\t" - "add %[load8], %[load8], %[load6] \n\t" - "lbux %[load6], %[load8](%[cm]) \n\t" - "sb %[load6], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - "lbu %[load7], 0(%[dest_pix]) \n\t" - "add %[load5], %[step1_1], %[step1_6] \n\t" - "sub %[load5], %[load5], %[step1_14] \n\t" - "addi %[load5], %[load5], 32 \n\t" - "sra %[load5], %[load5], 6 \n\t" - "add %[load7], %[load7], %[load5] \n\t" - "lbux %[load5], %[load7](%[cm]) \n\t" - "add %[load6], %[step1_0], %[step1_7] \n\t" - "sub %[load6], %[load6], %[step1_15] \n\t" - "sb %[load5], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - "lbu %[load8], 0(%[dest_pix]) \n\t" - "addi %[load6], %[load6], 32 \n\t" - "sra %[load6], %[load6], 6 \n\t" - "add %[load8], %[load8], %[load6] \n\t" - "lbux %[load6], %[load8](%[cm]) \n\t" - "sb %[load6], 0(%[dest_pix]) \n\t" - - : [load5] "=&r" (load5), [load6] "=&r" (load6), [load7] "=&r" (load7), - [load8] "=&r" (load8), [dest_pix] "+r" (dest_pix) - : [cm] "r" (cm), [dest_stride] "r" (dest_stride), - [step1_0] "r" (step1_0), [step1_1] "r" (step1_1), - [step1_2] "r" (step1_2), [step1_3] "r" (step1_3), - [step1_4] "r" (step1_4), [step1_5] "r" (step1_5), - [step1_6] "r" (step1_6), [step1_7] "r" (step1_7), - [step1_8] "r" (step1_8), [step1_9] "r" (step1_9), - [step1_10] "r" (step1_10), [step1_11] "r" (step1_11), - [step1_12] "r" (step1_12), [step1_13] "r" (step1_13), - [step1_14] "r" (step1_14), [step1_15] "r" (step1_15) - ); - - input += 16; - } -} - -void vp9_idct16x16_256_add_dspr2(const int16_t *input, uint8_t *dest, - int dest_stride) { - DECLARE_ALIGNED(32, int16_t, out[16 * 16]); - uint32_t pos = 45; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - // First transform rows - idct16_rows_dspr2(input, out, 16); - - // Then transform columns and add to dest - idct16_cols_add_blk_dspr2(out, dest, dest_stride); -} - -static void iadst16(const int16_t *input, int16_t *output) { - int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15; - - int x0 = input[15]; - int x1 = input[0]; - int x2 = input[13]; - int x3 = input[2]; - int x4 = input[11]; - int x5 = input[4]; - int x6 = input[9]; - int x7 = input[6]; - int x8 = input[7]; - int x9 = input[8]; - int x10 = input[5]; - int x11 = input[10]; - int x12 = input[3]; - int x13 = input[12]; - int x14 = input[1]; - int x15 = input[14]; - - if (!(x0 | x1 | x2 | x3 | x4 | x5 | x6 | x7 | x8 - | x9 | x10 | x11 | x12 | x13 | x14 | x15)) { - output[0] = output[1] = output[2] = output[3] = output[4] - = output[5] = output[6] = output[7] = output[8] - = output[9] = output[10] = output[11] = output[12] - = output[13] = output[14] = output[15] = 0; - return; - } - - // stage 1 - s0 = x0 * cospi_1_64 + x1 * cospi_31_64; - s1 = x0 * cospi_31_64 - x1 * cospi_1_64; - s2 = x2 * cospi_5_64 + x3 * cospi_27_64; - s3 = x2 * cospi_27_64 - x3 * cospi_5_64; - s4 = x4 * cospi_9_64 + x5 * cospi_23_64; - s5 = x4 * cospi_23_64 - x5 * cospi_9_64; - s6 = x6 * cospi_13_64 + x7 * cospi_19_64; - s7 = x6 * cospi_19_64 - x7 * cospi_13_64; - s8 = x8 * cospi_17_64 + x9 * cospi_15_64; - s9 = x8 * cospi_15_64 - x9 * cospi_17_64; - s10 = x10 * cospi_21_64 + x11 * cospi_11_64; - s11 = x10 * cospi_11_64 - x11 * cospi_21_64; - s12 = x12 * cospi_25_64 + x13 * cospi_7_64; - s13 = x12 * cospi_7_64 - x13 * cospi_25_64; - s14 = x14 * cospi_29_64 + x15 * cospi_3_64; - s15 = x14 * cospi_3_64 - x15 * cospi_29_64; - - x0 = dct_const_round_shift(s0 + s8); - x1 = dct_const_round_shift(s1 + s9); - x2 = dct_const_round_shift(s2 + s10); - x3 = dct_const_round_shift(s3 + s11); - x4 = dct_const_round_shift(s4 + s12); - x5 = dct_const_round_shift(s5 + s13); - x6 = dct_const_round_shift(s6 + s14); - x7 = dct_const_round_shift(s7 + s15); - x8 = dct_const_round_shift(s0 - s8); - x9 = dct_const_round_shift(s1 - s9); - x10 = dct_const_round_shift(s2 - s10); - x11 = dct_const_round_shift(s3 - s11); - x12 = dct_const_round_shift(s4 - s12); - x13 = dct_const_round_shift(s5 - s13); - x14 = dct_const_round_shift(s6 - s14); - x15 = dct_const_round_shift(s7 - s15); - - // stage 2 - s0 = x0; - s1 = x1; - s2 = x2; - s3 = x3; - s4 = x4; - s5 = x5; - s6 = x6; - s7 = x7; - s8 = x8 * cospi_4_64 + x9 * cospi_28_64; - s9 = x8 * cospi_28_64 - x9 * cospi_4_64; - s10 = x10 * cospi_20_64 + x11 * cospi_12_64; - s11 = x10 * cospi_12_64 - x11 * cospi_20_64; - s12 = - x12 * cospi_28_64 + x13 * cospi_4_64; - s13 = x12 * cospi_4_64 + x13 * cospi_28_64; - s14 = - x14 * cospi_12_64 + x15 * cospi_20_64; - s15 = x14 * cospi_20_64 + x15 * cospi_12_64; - - x0 = s0 + s4; - x1 = s1 + s5; - x2 = s2 + s6; - x3 = s3 + s7; - x4 = s0 - s4; - x5 = s1 - s5; - x6 = s2 - s6; - x7 = s3 - s7; - x8 = dct_const_round_shift(s8 + s12); - x9 = dct_const_round_shift(s9 + s13); - x10 = dct_const_round_shift(s10 + s14); - x11 = dct_const_round_shift(s11 + s15); - x12 = dct_const_round_shift(s8 - s12); - x13 = dct_const_round_shift(s9 - s13); - x14 = dct_const_round_shift(s10 - s14); - x15 = dct_const_round_shift(s11 - s15); - - // stage 3 - s0 = x0; - s1 = x1; - s2 = x2; - s3 = x3; - s4 = x4 * cospi_8_64 + x5 * cospi_24_64; - s5 = x4 * cospi_24_64 - x5 * cospi_8_64; - s6 = - x6 * cospi_24_64 + x7 * cospi_8_64; - s7 = x6 * cospi_8_64 + x7 * cospi_24_64; - s8 = x8; - s9 = x9; - s10 = x10; - s11 = x11; - s12 = x12 * cospi_8_64 + x13 * cospi_24_64; - s13 = x12 * cospi_24_64 - x13 * cospi_8_64; - s14 = - x14 * cospi_24_64 + x15 * cospi_8_64; - s15 = x14 * cospi_8_64 + x15 * cospi_24_64; - - x0 = s0 + s2; - x1 = s1 + s3; - x2 = s0 - s2; - x3 = s1 - s3; - x4 = dct_const_round_shift(s4 + s6); - x5 = dct_const_round_shift(s5 + s7); - x6 = dct_const_round_shift(s4 - s6); - x7 = dct_const_round_shift(s5 - s7); - x8 = s8 + s10; - x9 = s9 + s11; - x10 = s8 - s10; - x11 = s9 - s11; - x12 = dct_const_round_shift(s12 + s14); - x13 = dct_const_round_shift(s13 + s15); - x14 = dct_const_round_shift(s12 - s14); - x15 = dct_const_round_shift(s13 - s15); - - // stage 4 - s2 = (- cospi_16_64) * (x2 + x3); - s3 = cospi_16_64 * (x2 - x3); - s6 = cospi_16_64 * (x6 + x7); - s7 = cospi_16_64 * (- x6 + x7); - s10 = cospi_16_64 * (x10 + x11); - s11 = cospi_16_64 * (- x10 + x11); - s14 = (- cospi_16_64) * (x14 + x15); - s15 = cospi_16_64 * (x14 - x15); - - x2 = dct_const_round_shift(s2); - x3 = dct_const_round_shift(s3); - x6 = dct_const_round_shift(s6); - x7 = dct_const_round_shift(s7); - x10 = dct_const_round_shift(s10); - x11 = dct_const_round_shift(s11); - x14 = dct_const_round_shift(s14); - x15 = dct_const_round_shift(s15); - - output[0] = x0; - output[1] = -x8; - output[2] = x12; - output[3] = -x4; - output[4] = x6; - output[5] = x14; - output[6] = x10; - output[7] = x2; - output[8] = x3; - output[9] = x11; - output[10] = x15; - output[11] = x7; - output[12] = x5; - output[13] = -x13; - output[14] = x9; - output[15] = -x1; -} - -void vp9_iht16x16_256_add_dspr2(const int16_t *input, uint8_t *dest, - int pitch, int tx_type) { - int i, j; - DECLARE_ALIGNED(32, int16_t, out[16 * 16]); - int16_t *outptr = out; - int16_t temp_out[16]; - uint32_t pos = 45; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - switch (tx_type) { - case DCT_DCT: // DCT in both horizontal and vertical - idct16_rows_dspr2(input, outptr, 16); - idct16_cols_add_blk_dspr2(out, dest, pitch); - break; - case ADST_DCT: // ADST in vertical, DCT in horizontal - idct16_rows_dspr2(input, outptr, 16); - - outptr = out; - - for (i = 0; i < 16; ++i) { - iadst16(outptr, temp_out); - - for (j = 0; j < 16; ++j) - dest[j * pitch + i] = - clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 6) - + dest[j * pitch + i]); - outptr += 16; - } - break; - case DCT_ADST: // DCT in vertical, ADST in horizontal - { - int16_t temp_in[16 * 16]; - - for (i = 0; i < 16; ++i) { - /* prefetch row */ - vp9_prefetch_load((const uint8_t *)(input + 16)); - - iadst16(input, outptr); - input += 16; - outptr += 16; - } - - for (i = 0; i < 16; ++i) - for (j = 0; j < 16; ++j) - temp_in[j * 16 + i] = out[i * 16 + j]; - - idct16_cols_add_blk_dspr2(temp_in, dest, pitch); - } - break; - case ADST_ADST: // ADST in both directions - { - int16_t temp_in[16]; - - for (i = 0; i < 16; ++i) { - /* prefetch row */ - vp9_prefetch_load((const uint8_t *)(input + 16)); - - iadst16(input, outptr); - input += 16; - outptr += 16; - } - - for (i = 0; i < 16; ++i) { - for (j = 0; j < 16; ++j) - temp_in[j] = out[j * 16 + i]; - iadst16(temp_in, temp_out); - for (j = 0; j < 16; ++j) - dest[j * pitch + i] = - clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 6) - + dest[j * pitch + i]); - } - } - break; - default: - printf("vp9_short_iht16x16_add_dspr2 : Invalid tx_type\n"); - break; - } -} - -void vp9_idct16x16_10_add_dspr2(const int16_t *input, uint8_t *dest, - int dest_stride) { - DECLARE_ALIGNED(32, int16_t, out[16 * 16]); - int16_t *outptr = out; - uint32_t i; - uint32_t pos = 45; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - // First transform rows. Since all non-zero dct coefficients are in - // upper-left 4x4 area, we only need to calculate first 4 rows here. - idct16_rows_dspr2(input, outptr, 4); - - outptr += 4; - for (i = 0; i < 6; ++i) { - __asm__ __volatile__ ( - "sw $zero, 0(%[outptr]) \n\t" - "sw $zero, 32(%[outptr]) \n\t" - "sw $zero, 64(%[outptr]) \n\t" - "sw $zero, 96(%[outptr]) \n\t" - "sw $zero, 128(%[outptr]) \n\t" - "sw $zero, 160(%[outptr]) \n\t" - "sw $zero, 192(%[outptr]) \n\t" - "sw $zero, 224(%[outptr]) \n\t" - "sw $zero, 256(%[outptr]) \n\t" - "sw $zero, 288(%[outptr]) \n\t" - "sw $zero, 320(%[outptr]) \n\t" - "sw $zero, 352(%[outptr]) \n\t" - "sw $zero, 384(%[outptr]) \n\t" - "sw $zero, 416(%[outptr]) \n\t" - "sw $zero, 448(%[outptr]) \n\t" - "sw $zero, 480(%[outptr]) \n\t" - - : - : [outptr] "r" (outptr) - ); - - outptr += 2; - } - - // Then transform columns - idct16_cols_add_blk_dspr2(out, dest, dest_stride); -} - -void vp9_idct16x16_1_add_dspr2(const int16_t *input, uint8_t *dest, - int dest_stride) { - uint32_t pos = 45; - int32_t out; - int32_t r; - int32_t a1, absa1; - int32_t vector_a1; - int32_t t1, t2, t3, t4; - int32_t vector_1, vector_2, vector_3, vector_4; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - - : - : [pos] "r" (pos) - ); - - out = DCT_CONST_ROUND_SHIFT_TWICE_COSPI_16_64(input[0]); - __asm__ __volatile__ ( - "addi %[out], %[out], 32 \n\t" - "sra %[a1], %[out], 6 \n\t" - - : [out] "+r" (out), [a1] "=r" (a1) - : - ); - - if (a1 < 0) { - /* use quad-byte - * input and output memory are four byte aligned */ - __asm__ __volatile__ ( - "abs %[absa1], %[a1] \n\t" - "replv.qb %[vector_a1], %[absa1] \n\t" - - : [absa1] "=r" (absa1), [vector_a1] "=r" (vector_a1) - : [a1] "r" (a1) - ); - - for (r = 16; r--;) { - __asm__ __volatile__ ( - "lw %[t1], 0(%[dest]) \n\t" - "lw %[t2], 4(%[dest]) \n\t" - "lw %[t3], 8(%[dest]) \n\t" - "lw %[t4], 12(%[dest]) \n\t" - "subu_s.qb %[vector_1], %[t1], %[vector_a1] \n\t" - "subu_s.qb %[vector_2], %[t2], %[vector_a1] \n\t" - "subu_s.qb %[vector_3], %[t3], %[vector_a1] \n\t" - "subu_s.qb %[vector_4], %[t4], %[vector_a1] \n\t" - "sw %[vector_1], 0(%[dest]) \n\t" - "sw %[vector_2], 4(%[dest]) \n\t" - "sw %[vector_3], 8(%[dest]) \n\t" - "sw %[vector_4], 12(%[dest]) \n\t" - "add %[dest], %[dest], %[dest_stride] \n\t" - - : [t1] "=&r" (t1), [t2] "=&r" (t2), [t3] "=&r" (t3), [t4] "=&r" (t4), - [vector_1] "=&r" (vector_1), [vector_2] "=&r" (vector_2), - [vector_3] "=&r" (vector_3), [vector_4] "=&r" (vector_4), - [dest] "+&r" (dest) - : [dest_stride] "r" (dest_stride), [vector_a1] "r" (vector_a1) - ); - } - } else { - /* use quad-byte - * input and output memory are four byte aligned */ - __asm__ __volatile__ ( - "replv.qb %[vector_a1], %[a1] \n\t" - - : [vector_a1] "=r" (vector_a1) - : [a1] "r" (a1) - ); - - for (r = 16; r--;) { - __asm__ __volatile__ ( - "lw %[t1], 0(%[dest]) \n\t" - "lw %[t2], 4(%[dest]) \n\t" - "lw %[t3], 8(%[dest]) \n\t" - "lw %[t4], 12(%[dest]) \n\t" - "addu_s.qb %[vector_1], %[t1], %[vector_a1] \n\t" - "addu_s.qb %[vector_2], %[t2], %[vector_a1] \n\t" - "addu_s.qb %[vector_3], %[t3], %[vector_a1] \n\t" - "addu_s.qb %[vector_4], %[t4], %[vector_a1] \n\t" - "sw %[vector_1], 0(%[dest]) \n\t" - "sw %[vector_2], 4(%[dest]) \n\t" - "sw %[vector_3], 8(%[dest]) \n\t" - "sw %[vector_4], 12(%[dest]) \n\t" - "add %[dest], %[dest], %[dest_stride] \n\t" - - : [t1] "=&r" (t1), [t2] "=&r" (t2), [t3] "=&r" (t3), [t4] "=&r" (t4), - [vector_1] "=&r" (vector_1), [vector_2] "=&r" (vector_2), - [vector_3] "=&r" (vector_3), [vector_4] "=&r" (vector_4), - [dest] "+&r" (dest) - : [dest_stride] "r" (dest_stride), [vector_a1] "r" (vector_a1) - ); - } - } -} -#endif // #if HAVE_DSPR2 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_itrans32_cols_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_itrans32_cols_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_itrans32_cols_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_itrans32_cols_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1073 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "./vpx_config.h" -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_blockd.h" -#include "vp9/common/vp9_idct.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" - -#if HAVE_DSPR2 -void vp9_idct32_cols_add_blk_dspr2(int16_t *input, uint8_t *dest, - int dest_stride) { - int16_t step1_0, step1_1, step1_2, step1_3, step1_4, step1_5, step1_6; - int16_t step1_7, step1_8, step1_9, step1_10, step1_11, step1_12, step1_13; - int16_t step1_14, step1_15, step1_16, step1_17, step1_18, step1_19; - int16_t step1_20, step1_21, step1_22, step1_23, step1_24, step1_25, step1_26; - int16_t step1_27, step1_28, step1_29, step1_30, step1_31; - int16_t step2_0, step2_1, step2_2, step2_3, step2_4, step2_5, step2_6; - int16_t step2_7, step2_8, step2_9, step2_10, step2_11, step2_12, step2_13; - int16_t step2_14, step2_15, step2_16, step2_17, step2_18, step2_19, step2_20; - int16_t step2_21, step2_22, step2_23, step2_24, step2_25, step2_26, step2_27; - int16_t step2_28, step2_29, step2_30, step2_31; - int16_t step3_8, step3_9, step3_10, step3_11, step3_12, step3_13, step3_14; - int16_t step3_15, step3_16, step3_17, step3_18, step3_19, step3_20, step3_21; - int16_t step3_22, step3_23, step3_24, step3_25, step3_26, step3_27; - int16_t step3_28, step3_29, step3_30, step3_31; - int temp0, temp1, temp2, temp3; - int load1, load2, load3, load4; - int result1, result2; - int i, temp21; - uint8_t *dest_pix, *dest_pix1; - const int const_2_power_13 = 8192; - uint8_t *cm = vp9_ff_cropTbl; - - /* prefetch vp9_ff_cropTbl */ - vp9_prefetch_load(vp9_ff_cropTbl); - vp9_prefetch_load(vp9_ff_cropTbl + 32); - vp9_prefetch_load(vp9_ff_cropTbl + 64); - vp9_prefetch_load(vp9_ff_cropTbl + 96); - vp9_prefetch_load(vp9_ff_cropTbl + 128); - vp9_prefetch_load(vp9_ff_cropTbl + 160); - vp9_prefetch_load(vp9_ff_cropTbl + 192); - vp9_prefetch_load(vp9_ff_cropTbl + 224); - - for (i = 0; i < 32; ++i) { - dest_pix = dest + i; - dest_pix1 = dest + i + 31 * dest_stride; - - __asm__ __volatile__ ( - "lh %[load1], 2(%[input]) \n\t" - "lh %[load2], 62(%[input]) \n\t" - "lh %[load3], 34(%[input]) \n\t" - "lh %[load4], 30(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load1], %[cospi_31_64] \n\t" - "msub $ac1, %[load2], %[cospi_1_64] \n\t" - "extp %[temp0], $ac1, 31 \n\t" - - "madd $ac3, %[load1], %[cospi_1_64] \n\t" - "madd $ac3, %[load2], %[cospi_31_64] \n\t" - "extp %[temp3], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - - "madd $ac2, %[load3], %[cospi_15_64] \n\t" - "msub $ac2, %[load4], %[cospi_17_64] \n\t" - "extp %[temp1], $ac2, 31 \n\t" - - "madd $ac1, %[load3], %[cospi_17_64] \n\t" - "madd $ac1, %[load4], %[cospi_15_64] \n\t" - "extp %[temp2], $ac1, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "sub %[load1], %[temp3], %[temp2] \n\t" - "sub %[load2], %[temp0], %[temp1] \n\t" - - "madd $ac1, %[load1], %[cospi_28_64] \n\t" - "msub $ac1, %[load2], %[cospi_4_64] \n\t" - "madd $ac3, %[load1], %[cospi_4_64] \n\t" - "madd $ac3, %[load2], %[cospi_28_64] \n\t" - - "extp %[step1_17], $ac1, 31 \n\t" - "extp %[step1_30], $ac3, 31 \n\t" - "add %[step1_16], %[temp0], %[temp1] \n\t" - "add %[step1_31], %[temp2], %[temp3] \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), [load3] "=&r" (load3), - [load4] "=&r" (load4), [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), - [temp2] "=&r" (temp2), [temp3] "=&r" (temp3), - [step1_16] "=r" (step1_16), [step1_17] "=r" (step1_17), - [step1_30] "=r" (step1_30), [step1_31] "=r" (step1_31) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_31_64] "r" (cospi_31_64), [cospi_1_64] "r" (cospi_1_64), - [cospi_4_64] "r" (cospi_4_64), [cospi_17_64] "r" (cospi_17_64), - [cospi_15_64] "r" (cospi_15_64), [cospi_28_64] "r" (cospi_28_64) - ); - - __asm__ __volatile__ ( - "lh %[load1], 18(%[input]) \n\t" - "lh %[load2], 46(%[input]) \n\t" - "lh %[load3], 50(%[input]) \n\t" - "lh %[load4], 14(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load1], %[cospi_23_64] \n\t" - "msub $ac1, %[load2], %[cospi_9_64] \n\t" - "extp %[temp0], $ac1, 31 \n\t" - - "madd $ac3, %[load1], %[cospi_9_64] \n\t" - "madd $ac3, %[load2], %[cospi_23_64] \n\t" - "extp %[temp3], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - - "madd $ac2, %[load3], %[cospi_7_64] \n\t" - "msub $ac2, %[load4], %[cospi_25_64] \n\t" - "extp %[temp1], $ac2, 31 \n\t" - - "madd $ac1, %[load3], %[cospi_25_64] \n\t" - "madd $ac1, %[load4], %[cospi_7_64] \n\t" - "extp %[temp2], $ac1, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "sub %[load1], %[temp1], %[temp0] \n\t" - "sub %[load2], %[temp2], %[temp3] \n\t" - - "msub $ac1, %[load1], %[cospi_28_64] \n\t" - "msub $ac1, %[load2], %[cospi_4_64] \n\t" - "msub $ac3, %[load1], %[cospi_4_64] \n\t" - "madd $ac3, %[load2], %[cospi_28_64] \n\t" - - "extp %[step1_18], $ac1, 31 \n\t" - "extp %[step1_29], $ac3, 31 \n\t" - "add %[step1_19], %[temp0], %[temp1] \n\t" - "add %[step1_28], %[temp2], %[temp3] \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), [load3] "=&r" (load3), - [load4] "=&r" (load4), [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), - [temp2] "=&r" (temp2), [temp3] "=&r" (temp3), - [step1_18] "=r" (step1_18), [step1_19] "=r" (step1_19), - [step1_28] "=r" (step1_28), [step1_29] "=r" (step1_29) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_23_64] "r" (cospi_23_64), [cospi_9_64] "r" (cospi_9_64), - [cospi_4_64] "r" (cospi_4_64), [cospi_7_64] "r" (cospi_7_64), - [cospi_25_64] "r" (cospi_25_64), [cospi_28_64] "r" (cospi_28_64) - ); - - __asm__ __volatile__ ( - "lh %[load1], 10(%[input]) \n\t" - "lh %[load2], 54(%[input]) \n\t" - "lh %[load3], 42(%[input]) \n\t" - "lh %[load4], 22(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load1], %[cospi_27_64] \n\t" - "msub $ac1, %[load2], %[cospi_5_64] \n\t" - "extp %[temp0], $ac1, 31 \n\t" - - "madd $ac3, %[load1], %[cospi_5_64] \n\t" - "madd $ac3, %[load2], %[cospi_27_64] \n\t" - "extp %[temp3], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - - "madd $ac2, %[load3], %[cospi_11_64] \n\t" - "msub $ac2, %[load4], %[cospi_21_64] \n\t" - "extp %[temp1], $ac2, 31 \n\t" - - "madd $ac1, %[load3], %[cospi_21_64] \n\t" - "madd $ac1, %[load4], %[cospi_11_64] \n\t" - "extp %[temp2], $ac1, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "sub %[load1], %[temp0], %[temp1] \n\t" - "sub %[load2], %[temp3], %[temp2] \n\t" - - "madd $ac1, %[load2], %[cospi_12_64] \n\t" - "msub $ac1, %[load1], %[cospi_20_64] \n\t" - "madd $ac3, %[load1], %[cospi_12_64] \n\t" - "madd $ac3, %[load2], %[cospi_20_64] \n\t" - - "extp %[step1_21], $ac1, 31 \n\t" - "extp %[step1_26], $ac3, 31 \n\t" - "add %[step1_20], %[temp0], %[temp1] \n\t" - "add %[step1_27], %[temp2], %[temp3] \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), [load3] "=&r" (load3), - [load4] "=&r" (load4), [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), - [temp2] "=&r" (temp2), [temp3] "=&r" (temp3), - [step1_20] "=r" (step1_20), [step1_21] "=r" (step1_21), - [step1_26] "=r" (step1_26), [step1_27] "=r" (step1_27) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_27_64] "r" (cospi_27_64), [cospi_5_64] "r" (cospi_5_64), - [cospi_11_64] "r" (cospi_11_64), [cospi_21_64] "r" (cospi_21_64), - [cospi_12_64] "r" (cospi_12_64), [cospi_20_64] "r" (cospi_20_64) - ); - - __asm__ __volatile__ ( - "lh %[load1], 26(%[input]) \n\t" - "lh %[load2], 38(%[input]) \n\t" - "lh %[load3], 58(%[input]) \n\t" - "lh %[load4], 6(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load1], %[cospi_19_64] \n\t" - "msub $ac1, %[load2], %[cospi_13_64] \n\t" - "extp %[temp0], $ac1, 31 \n\t" - "madd $ac3, %[load1], %[cospi_13_64] \n\t" - "madd $ac3, %[load2], %[cospi_19_64] \n\t" - "extp %[temp3], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - - "madd $ac2, %[load3], %[cospi_3_64] \n\t" - "msub $ac2, %[load4], %[cospi_29_64] \n\t" - "extp %[temp1], $ac2, 31 \n\t" - "madd $ac1, %[load3], %[cospi_29_64] \n\t" - "madd $ac1, %[load4], %[cospi_3_64] \n\t" - "extp %[temp2], $ac1, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "sub %[load1], %[temp1], %[temp0] \n\t" - "sub %[load2], %[temp2], %[temp3] \n\t" - "msub $ac1, %[load1], %[cospi_12_64] \n\t" - "msub $ac1, %[load2], %[cospi_20_64] \n\t" - "msub $ac3, %[load1], %[cospi_20_64] \n\t" - "madd $ac3, %[load2], %[cospi_12_64] \n\t" - "extp %[step1_22], $ac1, 31 \n\t" - "extp %[step1_25], $ac3, 31 \n\t" - "add %[step1_23], %[temp0], %[temp1] \n\t" - "add %[step1_24], %[temp2], %[temp3] \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), [load3] "=&r" (load3), - [load4] "=&r" (load4), [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), - [temp2] "=&r" (temp2), [temp3] "=&r" (temp3), - [step1_22] "=r" (step1_22), [step1_23] "=r" (step1_23), - [step1_24] "=r" (step1_24), [step1_25] "=r" (step1_25) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_19_64] "r" (cospi_19_64), [cospi_13_64] "r" (cospi_13_64), - [cospi_3_64] "r" (cospi_3_64), [cospi_29_64] "r" (cospi_29_64), - [cospi_12_64] "r" (cospi_12_64), [cospi_20_64] "r" (cospi_20_64) - ); - - __asm__ __volatile__ ( - "lh %[load1], 4(%[input]) \n\t" - "lh %[load2], 60(%[input]) \n\t" - "lh %[load3], 36(%[input]) \n\t" - "lh %[load4], 28(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load1], %[cospi_30_64] \n\t" - "msub $ac1, %[load2], %[cospi_2_64] \n\t" - "extp %[temp0], $ac1, 31 \n\t" - "madd $ac3, %[load1], %[cospi_2_64] \n\t" - "madd $ac3, %[load2], %[cospi_30_64] \n\t" - "extp %[temp3], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - - "madd $ac2, %[load3], %[cospi_14_64] \n\t" - "msub $ac2, %[load4], %[cospi_18_64] \n\t" - "extp %[temp1], $ac2, 31 \n\t" - "madd $ac1, %[load3], %[cospi_18_64] \n\t" - "madd $ac1, %[load4], %[cospi_14_64] \n\t" - "extp %[temp2], $ac1, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "sub %[load1], %[temp0], %[temp1] \n\t" - "sub %[load2], %[temp3], %[temp2] \n\t" - "msub $ac1, %[load1], %[cospi_8_64] \n\t" - "madd $ac1, %[load2], %[cospi_24_64] \n\t" - "madd $ac3, %[load1], %[cospi_24_64] \n\t" - "madd $ac3, %[load2], %[cospi_8_64] \n\t" - "extp %[step2_9], $ac1, 31 \n\t" - "extp %[step2_14], $ac3, 31 \n\t" - "add %[step2_8], %[temp0], %[temp1] \n\t" - "add %[step2_15], %[temp2], %[temp3] \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), [load3] "=&r" (load3), - [load4] "=&r" (load4), [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), - [temp2] "=&r" (temp2), [temp3] "=&r" (temp3), - [step2_8] "=r" (step2_8), [step2_9] "=r" (step2_9), - [step2_14] "=r" (step2_14), [step2_15] "=r" (step2_15) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_30_64] "r" (cospi_30_64), [cospi_2_64] "r" (cospi_2_64), - [cospi_14_64] "r" (cospi_14_64), [cospi_18_64] "r" (cospi_18_64), - [cospi_8_64] "r" (cospi_8_64), [cospi_24_64] "r" (cospi_24_64) - ); - - __asm__ __volatile__ ( - "lh %[load1], 20(%[input]) \n\t" - "lh %[load2], 44(%[input]) \n\t" - "lh %[load3], 52(%[input]) \n\t" - "lh %[load4], 12(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load1], %[cospi_22_64] \n\t" - "msub $ac1, %[load2], %[cospi_10_64] \n\t" - "extp %[temp0], $ac1, 31 \n\t" - "madd $ac3, %[load1], %[cospi_10_64] \n\t" - "madd $ac3, %[load2], %[cospi_22_64] \n\t" - "extp %[temp3], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - - "madd $ac2, %[load3], %[cospi_6_64] \n\t" - "msub $ac2, %[load4], %[cospi_26_64] \n\t" - "extp %[temp1], $ac2, 31 \n\t" - "madd $ac1, %[load3], %[cospi_26_64] \n\t" - "madd $ac1, %[load4], %[cospi_6_64] \n\t" - "extp %[temp2], $ac1, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "sub %[load1], %[temp1], %[temp0] \n\t" - "sub %[load2], %[temp2], %[temp3] \n\t" - "msub $ac1, %[load1], %[cospi_24_64] \n\t" - "msub $ac1, %[load2], %[cospi_8_64] \n\t" - "madd $ac3, %[load2], %[cospi_24_64] \n\t" - "msub $ac3, %[load1], %[cospi_8_64] \n\t" - "extp %[step2_10], $ac1, 31 \n\t" - "extp %[step2_13], $ac3, 31 \n\t" - "add %[step2_11], %[temp0], %[temp1] \n\t" - "add %[step2_12], %[temp2], %[temp3] \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), [load3] "=&r" (load3), - [load4] "=&r" (load4), [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), - [temp2] "=&r" (temp2), [temp3] "=&r" (temp3), - [step2_10] "=r" (step2_10), [step2_11] "=r" (step2_11), - [step2_12] "=r" (step2_12), [step2_13] "=r" (step2_13) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_22_64] "r" (cospi_22_64), [cospi_10_64] "r" (cospi_10_64), - [cospi_6_64] "r" (cospi_6_64), [cospi_26_64] "r" (cospi_26_64), - [cospi_8_64] "r" (cospi_8_64), [cospi_24_64] "r" (cospi_24_64) - ); - - __asm__ __volatile__ ( - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "sub %[temp0], %[step2_14], %[step2_13] \n\t" - "sub %[temp0], %[temp0], %[step2_9] \n\t" - "add %[temp0], %[temp0], %[step2_10] \n\t" - "madd $ac0, %[temp0], %[cospi_16_64] \n\t" - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "sub %[temp1], %[step2_14], %[step2_13] \n\t" - "add %[temp1], %[temp1], %[step2_9] \n\t" - "sub %[temp1], %[temp1], %[step2_10] \n\t" - "madd $ac1, %[temp1], %[cospi_16_64] \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "sub %[temp0], %[step2_15], %[step2_12] \n\t" - "sub %[temp0], %[temp0], %[step2_8] \n\t" - "add %[temp0], %[temp0], %[step2_11] \n\t" - "madd $ac2, %[temp0], %[cospi_16_64] \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "sub %[temp1], %[step2_15], %[step2_12] \n\t" - "add %[temp1], %[temp1], %[step2_8] \n\t" - "sub %[temp1], %[temp1], %[step2_11] \n\t" - "madd $ac3, %[temp1], %[cospi_16_64] \n\t" - - "add %[step3_8], %[step2_8], %[step2_11] \n\t" - "add %[step3_9], %[step2_9], %[step2_10] \n\t" - "add %[step3_14], %[step2_13], %[step2_14] \n\t" - "add %[step3_15], %[step2_12], %[step2_15] \n\t" - "extp %[step3_10], $ac0, 31 \n\t" - "extp %[step3_13], $ac1, 31 \n\t" - "extp %[step3_11], $ac2, 31 \n\t" - "extp %[step3_12], $ac3, 31 \n\t" - - : [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), - [step3_8] "=r" (step3_8), [step3_9] "=r" (step3_9), - [step3_10] "=r" (step3_10), [step3_11] "=r" (step3_11), - [step3_12] "=r" (step3_12), [step3_13] "=r" (step3_13), - [step3_14] "=r" (step3_14), [step3_15] "=r" (step3_15) - : [const_2_power_13] "r" (const_2_power_13), [step2_8] "r" (step2_8), - [step2_9] "r" (step2_9), [step2_10] "r" (step2_10), - [step2_11] "r" (step2_11), [step2_12] "r" (step2_12), - [step2_13] "r" (step2_13), [step2_14] "r" (step2_14), - [step2_15] "r" (step2_15), [cospi_16_64] "r" (cospi_16_64) - ); - - step2_18 = step1_17 - step1_18; - step2_29 = step1_30 - step1_29; - - __asm__ __volatile__ ( - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "msub $ac0, %[step2_18], %[cospi_8_64] \n\t" - "madd $ac0, %[step2_29], %[cospi_24_64] \n\t" - "extp %[step3_18], $ac0, 31 \n\t" - - : [step3_18] "=r" (step3_18) - : [const_2_power_13] "r" (const_2_power_13), - [step2_18] "r" (step2_18), [step2_29] "r" (step2_29), - [cospi_24_64] "r" (cospi_24_64), [cospi_8_64] "r" (cospi_8_64) - ); - - temp21 = step2_18 * cospi_24_64 + step2_29 * cospi_8_64; - step3_29 = (temp21 + DCT_CONST_ROUNDING) >> DCT_CONST_BITS; - - step2_19 = step1_16 - step1_19; - step2_28 = step1_31 - step1_28; - - __asm__ __volatile__ ( - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "msub $ac0, %[step2_19], %[cospi_8_64] \n\t" - "madd $ac0, %[step2_28], %[cospi_24_64] \n\t" - "extp %[step3_19], $ac0, 31 \n\t" - - : [step3_19] "=r" (step3_19) - : [const_2_power_13] "r" (const_2_power_13), - [step2_19] "r" (step2_19), [step2_28] "r" (step2_28), - [cospi_24_64] "r" (cospi_24_64), [cospi_8_64] "r" (cospi_8_64) - ); - - temp21 = step2_19 * cospi_24_64 + step2_28 * cospi_8_64; - step3_28 = (temp21 + DCT_CONST_ROUNDING) >> DCT_CONST_BITS; - - step3_16 = step1_16 + step1_19; - step3_17 = step1_17 + step1_18; - step3_30 = step1_29 + step1_30; - step3_31 = step1_28 + step1_31; - - step2_20 = step1_23 - step1_20; - step2_27 = step1_24 - step1_27; - - __asm__ __volatile__ ( - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "msub $ac0, %[step2_20], %[cospi_24_64] \n\t" - "msub $ac0, %[step2_27], %[cospi_8_64] \n\t" - "extp %[step3_20], $ac0, 31 \n\t" - - : [step3_20] "=r" (step3_20) - : [const_2_power_13] "r" (const_2_power_13), - [step2_20] "r" (step2_20), [step2_27] "r" (step2_27), - [cospi_24_64] "r" (cospi_24_64), [cospi_8_64] "r" (cospi_8_64) - ); - - temp21 = -step2_20 * cospi_8_64 + step2_27 * cospi_24_64; - step3_27 = (temp21 + DCT_CONST_ROUNDING) >> DCT_CONST_BITS; - - step2_21 = step1_22 - step1_21; - step2_26 = step1_25 - step1_26; - - __asm__ __volatile__ ( - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "msub $ac1, %[step2_21], %[cospi_24_64] \n\t" - "msub $ac1, %[step2_26], %[cospi_8_64] \n\t" - "extp %[step3_21], $ac1, 31 \n\t" - - : [step3_21] "=r" (step3_21) - : [const_2_power_13] "r" (const_2_power_13), - [step2_21] "r" (step2_21), [step2_26] "r" (step2_26), - [cospi_24_64] "r" (cospi_24_64), [cospi_8_64] "r" (cospi_8_64) - ); - - temp21 = -step2_21 * cospi_8_64 + step2_26 * cospi_24_64; - step3_26 = (temp21 + DCT_CONST_ROUNDING) >> DCT_CONST_BITS; - - step3_22 = step1_21 + step1_22; - step3_23 = step1_20 + step1_23; - step3_24 = step1_24 + step1_27; - step3_25 = step1_25 + step1_26; - - step2_16 = step3_16 + step3_23; - step2_17 = step3_17 + step3_22; - step2_18 = step3_18 + step3_21; - step2_19 = step3_19 + step3_20; - step2_20 = step3_19 - step3_20; - step2_21 = step3_18 - step3_21; - step2_22 = step3_17 - step3_22; - step2_23 = step3_16 - step3_23; - - step2_24 = step3_31 - step3_24; - step2_25 = step3_30 - step3_25; - step2_26 = step3_29 - step3_26; - step2_27 = step3_28 - step3_27; - step2_28 = step3_28 + step3_27; - step2_29 = step3_29 + step3_26; - step2_30 = step3_30 + step3_25; - step2_31 = step3_31 + step3_24; - - __asm__ __volatile__ ( - "lh %[load1], 0(%[input]) \n\t" - "lh %[load2], 32(%[input]) \n\t" - "lh %[load3], 16(%[input]) \n\t" - "lh %[load4], 48(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "add %[result1], %[load1], %[load2] \n\t" - "sub %[result2], %[load1], %[load2] \n\t" - "madd $ac1, %[result1], %[cospi_16_64] \n\t" - "madd $ac2, %[result2], %[cospi_16_64] \n\t" - "extp %[temp0], $ac1, 31 \n\t" - "extp %[temp1], $ac2, 31 \n\t" - - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "madd $ac3, %[load3], %[cospi_24_64] \n\t" - "msub $ac3, %[load4], %[cospi_8_64] \n\t" - "extp %[temp2], $ac3, 31 \n\t" - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "madd $ac1, %[load3], %[cospi_8_64] \n\t" - "madd $ac1, %[load4], %[cospi_24_64] \n\t" - "extp %[temp3], $ac1, 31 \n\t" - "add %[step1_0], %[temp0], %[temp3] \n\t" - "add %[step1_1], %[temp1], %[temp2] \n\t" - "sub %[step1_2], %[temp1], %[temp2] \n\t" - "sub %[step1_3], %[temp0], %[temp3] \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [load3] "=&r" (load3), [load4] "=&r" (load4), - [result1] "=&r" (result1), [result2] "=&r" (result2), - [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), - [temp2] "=&r" (temp2), [temp3] "=&r" (temp3), - [step1_0] "=r" (step1_0), [step1_1] "=r" (step1_1), - [step1_2] "=r" (step1_2), [step1_3] "=r" (step1_3) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_24_64] "r" (cospi_24_64), [cospi_8_64] "r" (cospi_8_64), - [cospi_16_64] "r" (cospi_16_64) - ); - - __asm__ __volatile__ ( - "lh %[load1], 8(%[input]) \n\t" - "lh %[load2], 56(%[input]) \n\t" - "lh %[load3], 40(%[input]) \n\t" - "lh %[load4], 24(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load1], %[cospi_28_64] \n\t" - "msub $ac1, %[load2], %[cospi_4_64] \n\t" - "extp %[temp0], $ac1, 31 \n\t" - "madd $ac3, %[load1], %[cospi_4_64] \n\t" - "madd $ac3, %[load2], %[cospi_28_64] \n\t" - "extp %[temp3], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - - "madd $ac2, %[load3], %[cospi_12_64] \n\t" - "msub $ac2, %[load4], %[cospi_20_64] \n\t" - "extp %[temp1], $ac2, 31 \n\t" - "madd $ac1, %[load3], %[cospi_20_64] \n\t" - "madd $ac1, %[load4], %[cospi_12_64] \n\t" - "extp %[temp2], $ac1, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "sub %[load1], %[temp3], %[temp2] \n\t" - "sub %[load1], %[load1], %[temp0] \n\t" - "add %[load1], %[load1], %[temp1] \n\t" - "sub %[load2], %[temp0], %[temp1] \n\t" - "sub %[load2], %[load2], %[temp2] \n\t" - "add %[load2], %[load2], %[temp3] \n\t" - "madd $ac1, %[load1], %[cospi_16_64] \n\t" - "madd $ac3, %[load2], %[cospi_16_64] \n\t" - - "extp %[step1_5], $ac1, 31 \n\t" - "extp %[step1_6], $ac3, 31 \n\t" - "add %[step1_4], %[temp0], %[temp1] \n\t" - "add %[step1_7], %[temp3], %[temp2] \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [load3] "=&r" (load3), [load4] "=&r" (load4), - [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), - [temp2] "=&r" (temp2), [temp3] "=&r" (temp3), - [step1_4] "=r" (step1_4), [step1_5] "=r" (step1_5), - [step1_6] "=r" (step1_6), [step1_7] "=r" (step1_7) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_20_64] "r" (cospi_20_64), [cospi_12_64] "r" (cospi_12_64), - [cospi_4_64] "r" (cospi_4_64), [cospi_28_64] "r" (cospi_28_64), - [cospi_16_64] "r" (cospi_16_64) - ); - - step2_0 = step1_0 + step1_7; - step2_1 = step1_1 + step1_6; - step2_2 = step1_2 + step1_5; - step2_3 = step1_3 + step1_4; - step2_4 = step1_3 - step1_4; - step2_5 = step1_2 - step1_5; - step2_6 = step1_1 - step1_6; - step2_7 = step1_0 - step1_7; - - // stage 7 - step1_0 = step2_0 + step3_15; - step1_1 = step2_1 + step3_14; - step1_2 = step2_2 + step3_13; - step1_3 = step2_3 + step3_12; - step1_4 = step2_4 + step3_11; - step1_5 = step2_5 + step3_10; - step1_6 = step2_6 + step3_9; - step1_7 = step2_7 + step3_8; - step1_8 = step2_7 - step3_8; - step1_9 = step2_6 - step3_9; - step1_10 = step2_5 - step3_10; - step1_11 = step2_4 - step3_11; - step1_12 = step2_3 - step3_12; - step1_13 = step2_2 - step3_13; - step1_14 = step2_1 - step3_14; - step1_15 = step2_0 - step3_15; - - __asm__ __volatile__ ( - "sub %[temp0], %[step2_27], %[step2_20] \n\t" - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "madd $ac0, %[temp0], %[cospi_16_64] \n\t" - "extp %[step1_20], $ac0, 31 \n\t" - - : [temp0] "=&r" (temp0), [step1_20] "=r" (step1_20) - : [const_2_power_13] "r" (const_2_power_13), [step2_20] "r" (step2_20), - [step2_27] "r" (step2_27), [cospi_16_64] "r" (cospi_16_64) - ); - - temp21 = (step2_20 + step2_27) * cospi_16_64; - step1_27 = (temp21 + DCT_CONST_ROUNDING) >> DCT_CONST_BITS; - - __asm__ __volatile__ ( - "sub %[temp0], %[step2_26], %[step2_21] \n\t" - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "madd $ac0, %[temp0], %[cospi_16_64] \n\t" - "extp %[step1_21], $ac0, 31 \n\t" - - : [temp0] "=&r" (temp0), [step1_21] "=r" (step1_21) - : [const_2_power_13] "r" (const_2_power_13), [step2_26] "r" (step2_26), - [step2_21] "r" (step2_21), [cospi_16_64] "r" (cospi_16_64) - ); - - temp21 = (step2_21 + step2_26) * cospi_16_64; - step1_26 = (temp21 + DCT_CONST_ROUNDING) >> DCT_CONST_BITS; - - __asm__ __volatile__ ( - "sub %[temp0], %[step2_25], %[step2_22] \n\t" - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "madd $ac0, %[temp0], %[cospi_16_64] \n\t" - "extp %[step1_22], $ac0, 31 \n\t" - - : [temp0] "=&r" (temp0), [step1_22] "=r" (step1_22) - : [const_2_power_13] "r" (const_2_power_13), [step2_25] "r" (step2_25), - [step2_22] "r" (step2_22), [cospi_16_64] "r" (cospi_16_64) - ); - - temp21 = (step2_22 + step2_25) * cospi_16_64; - step1_25 = (temp21 + DCT_CONST_ROUNDING) >> DCT_CONST_BITS; - - __asm__ __volatile__ ( - "sub %[temp0], %[step2_24], %[step2_23] \n\t" - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "madd $ac0, %[temp0], %[cospi_16_64] \n\t" - "extp %[step1_23], $ac0, 31 \n\t" - - : [temp0] "=&r" (temp0), [step1_23] "=r" (step1_23) - : [const_2_power_13] "r" (const_2_power_13), [step2_24] "r" (step2_24), - [step2_23] "r" (step2_23), [cospi_16_64] "r" (cospi_16_64) - ); - - temp21 = (step2_23 + step2_24) * cospi_16_64; - step1_24 = (temp21 + DCT_CONST_ROUNDING) >> DCT_CONST_BITS; - - __asm__ __volatile__ ( - "lbu %[temp2], 0(%[dest_pix]) \n\t" - "add %[temp0], %[step1_0], %[step2_31] \n\t" - "addi %[temp0], %[temp0], 32 \n\t" - "sra %[temp0], %[temp0], 6 \n\t" - "add %[temp2], %[temp2], %[temp0] \n\t" - "lbux %[temp0], %[temp2](%[cm]) \n\t" - "add %[temp1], %[step1_1], %[step2_30] \n\t" - "sb %[temp0], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - "lbu %[temp3], 0(%[dest_pix]) \n\t" - "addi %[temp1], %[temp1], 32 \n\t" - "sra %[temp1], %[temp1], 6 \n\t" - "add %[temp3], %[temp3], %[temp1] \n\t" - "lbux %[temp1], %[temp3](%[cm]) \n\t" - "sb %[temp1], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - "lbu %[temp2], 0(%[dest_pix]) \n\t" - "add %[temp0], %[step1_2], %[step2_29] \n\t" - "addi %[temp0], %[temp0], 32 \n\t" - "sra %[temp0], %[temp0], 6 \n\t" - "add %[temp2], %[temp2], %[temp0] \n\t" - "lbux %[temp0], %[temp2](%[cm]) \n\t" - "add %[temp1], %[step1_3], %[step2_28] \n\t" - "sb %[temp0], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - "lbu %[temp3], 0(%[dest_pix]) \n\t" - "addi %[temp1], %[temp1], 32 \n\t" - "sra %[temp1], %[temp1], 6 \n\t" - "add %[temp3], %[temp3], %[temp1] \n\t" - "lbux %[temp1], %[temp3](%[cm]) \n\t" - "sb %[temp1], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - : [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), [temp2] "=&r" (temp2), - [temp3] "=&r" (temp3), [dest_pix] "+r" (dest_pix) - : [cm] "r" (cm), [dest_stride] "r" (dest_stride), - [step1_0] "r" (step1_0), [step1_1] "r" (step1_1), - [step1_2] "r" (step1_2), [step1_3] "r" (step1_3), - [step2_28] "r" (step2_28), [step2_29] "r" (step2_29), - [step2_30] "r" (step2_30), [step2_31] "r" (step2_31) - ); - - step3_12 = ROUND_POWER_OF_TWO((step1_3 - step2_28), 6); - step3_13 = ROUND_POWER_OF_TWO((step1_2 - step2_29), 6); - step3_14 = ROUND_POWER_OF_TWO((step1_1 - step2_30), 6); - step3_15 = ROUND_POWER_OF_TWO((step1_0 - step2_31), 6); - - __asm__ __volatile__ ( - "lbu %[temp2], 0(%[dest_pix1]) \n\t" - "add %[temp2], %[temp2], %[step3_15] \n\t" - "lbux %[temp0], %[temp2](%[cm]) \n\t" - "sb %[temp0], 0(%[dest_pix1]) \n\t" - "subu %[dest_pix1], %[dest_pix1], %[dest_stride] \n\t" - "lbu %[temp3], 0(%[dest_pix1]) \n\t" - "add %[temp3], %[temp3], %[step3_14] \n\t" - "lbux %[temp1], %[temp3](%[cm]) \n\t" - "sb %[temp1], 0(%[dest_pix1]) \n\t" - "subu %[dest_pix1], %[dest_pix1], %[dest_stride] \n\t" - - "lbu %[temp2], 0(%[dest_pix1]) \n\t" - "add %[temp2], %[temp2], %[step3_13] \n\t" - "lbux %[temp0], %[temp2](%[cm]) \n\t" - "sb %[temp0], 0(%[dest_pix1]) \n\t" - "subu %[dest_pix1], %[dest_pix1], %[dest_stride] \n\t" - "lbu %[temp3], 0(%[dest_pix1]) \n\t" - "add %[temp3], %[temp3], %[step3_12] \n\t" - "lbux %[temp1], %[temp3](%[cm]) \n\t" - "sb %[temp1], 0(%[dest_pix1]) \n\t" - "subu %[dest_pix1], %[dest_pix1], %[dest_stride] \n\t" - - : [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), [temp2] "=&r" (temp2), - [temp3] "=&r" (temp3), [dest_pix1] "+r" (dest_pix1) - : [cm] "r" (cm), [dest_stride] "r" (dest_stride), - [step3_12] "r" (step3_12), [step3_13] "r" (step3_13), - [step3_14] "r" (step3_14), [step3_15] "r" (step3_15) - ); - - __asm__ __volatile__ ( - "lbu %[temp2], 0(%[dest_pix]) \n\t" - "add %[temp0], %[step1_4], %[step1_27] \n\t" - "addi %[temp0], %[temp0], 32 \n\t" - "sra %[temp0], %[temp0], 6 \n\t" - "add %[temp2], %[temp2], %[temp0] \n\t" - "lbux %[temp0], %[temp2](%[cm]) \n\t" - "add %[temp1], %[step1_5], %[step1_26] \n\t" - "sb %[temp0], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - "lbu %[temp3], 0(%[dest_pix]) \n\t" - "addi %[temp1], %[temp1], 32 \n\t" - "sra %[temp1], %[temp1], 6 \n\t" - "add %[temp3], %[temp3], %[temp1] \n\t" - "lbux %[temp1], %[temp3](%[cm]) \n\t" - "sb %[temp1], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - "lbu %[temp2], 0(%[dest_pix]) \n\t" - "add %[temp0], %[step1_6], %[step1_25] \n\t" - "addi %[temp0], %[temp0], 32 \n\t" - "sra %[temp0], %[temp0], 6 \n\t" - "add %[temp2], %[temp2], %[temp0] \n\t" - "lbux %[temp0], %[temp2](%[cm]) \n\t" - "add %[temp1], %[step1_7], %[step1_24] \n\t" - "sb %[temp0], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - "lbu %[temp3], 0(%[dest_pix]) \n\t" - "addi %[temp1], %[temp1], 32 \n\t" - "sra %[temp1], %[temp1], 6 \n\t" - "add %[temp3], %[temp3], %[temp1] \n\t" - "lbux %[temp1], %[temp3](%[cm]) \n\t" - "sb %[temp1], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - : [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), [temp2] "=&r" (temp2), - [temp3] "=&r" (temp3), [dest_pix] "+r" (dest_pix) - : [cm] "r" (cm), [dest_stride] "r" (dest_stride), - [step1_4] "r" (step1_4), [step1_5] "r" (step1_5), - [step1_6] "r" (step1_6), [step1_7] "r" (step1_7), - [step1_24] "r" (step1_24), [step1_25] "r" (step1_25), - [step1_26] "r" (step1_26), [step1_27] "r" (step1_27) - ); - - step3_12 = ROUND_POWER_OF_TWO((step1_7 - step1_24), 6); - step3_13 = ROUND_POWER_OF_TWO((step1_6 - step1_25), 6); - step3_14 = ROUND_POWER_OF_TWO((step1_5 - step1_26), 6); - step3_15 = ROUND_POWER_OF_TWO((step1_4 - step1_27), 6); - - __asm__ __volatile__ ( - "lbu %[temp2], 0(%[dest_pix1]) \n\t" - "add %[temp2], %[temp2], %[step3_15] \n\t" - "lbux %[temp0], %[temp2](%[cm]) \n\t" - "sb %[temp0], 0(%[dest_pix1]) \n\t" - "subu %[dest_pix1], %[dest_pix1], %[dest_stride] \n\t" - "lbu %[temp3], 0(%[dest_pix1]) \n\t" - "add %[temp3], %[temp3], %[step3_14] \n\t" - "lbux %[temp1], %[temp3](%[cm]) \n\t" - "sb %[temp1], 0(%[dest_pix1]) \n\t" - "subu %[dest_pix1], %[dest_pix1], %[dest_stride] \n\t" - - "lbu %[temp2], 0(%[dest_pix1]) \n\t" - "add %[temp2], %[temp2], %[step3_13] \n\t" - "lbux %[temp0], %[temp2](%[cm]) \n\t" - "sb %[temp0], 0(%[dest_pix1]) \n\t" - "subu %[dest_pix1], %[dest_pix1], %[dest_stride] \n\t" - "lbu %[temp3], 0(%[dest_pix1]) \n\t" - "add %[temp3], %[temp3], %[step3_12] \n\t" - "lbux %[temp1], %[temp3](%[cm]) \n\t" - "sb %[temp1], 0(%[dest_pix1]) \n\t" - "subu %[dest_pix1], %[dest_pix1], %[dest_stride] \n\t" - - : [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), [temp2] "=&r" (temp2), - [temp3] "=&r" (temp3), [dest_pix1] "+r" (dest_pix1) - : [cm] "r" (cm), [dest_stride] "r" (dest_stride), - [step3_12] "r" (step3_12), [step3_13] "r" (step3_13), - [step3_14] "r" (step3_14), [step3_15] "r" (step3_15) - ); - - __asm__ __volatile__ ( - "lbu %[temp2], 0(%[dest_pix]) \n\t" - "add %[temp0], %[step1_8], %[step1_23] \n\t" - "addi %[temp0], %[temp0], 32 \n\t" - "sra %[temp0], %[temp0], 6 \n\t" - "add %[temp2], %[temp2], %[temp0] \n\t" - "lbux %[temp0], %[temp2](%[cm]) \n\t" - "add %[temp1], %[step1_9], %[step1_22] \n\t" - "sb %[temp0], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - "lbu %[temp3], 0(%[dest_pix]) \n\t" - "addi %[temp1], %[temp1], 32 \n\t" - "sra %[temp1], %[temp1], 6 \n\t" - "add %[temp3], %[temp3], %[temp1] \n\t" - "lbux %[temp1], %[temp3](%[cm]) \n\t" - "sb %[temp1], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - "lbu %[temp2], 0(%[dest_pix]) \n\t" - "add %[temp0], %[step1_10], %[step1_21] \n\t" - "addi %[temp0], %[temp0], 32 \n\t" - "sra %[temp0], %[temp0], 6 \n\t" - "add %[temp2], %[temp2], %[temp0] \n\t" - "lbux %[temp0], %[temp2](%[cm]) \n\t" - "add %[temp1], %[step1_11], %[step1_20] \n\t" - "sb %[temp0], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - "lbu %[temp3], 0(%[dest_pix]) \n\t" - "addi %[temp1], %[temp1], 32 \n\t" - "sra %[temp1], %[temp1], 6 \n\t" - "add %[temp3], %[temp3], %[temp1] \n\t" - "lbux %[temp1], %[temp3](%[cm]) \n\t" - "sb %[temp1], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - : [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), [temp2] "=&r" (temp2), - [temp3] "=&r" (temp3), [dest_pix] "+r" (dest_pix) - : [cm] "r" (cm), [dest_stride] "r" (dest_stride), - [step1_8] "r" (step1_8), [step1_9] "r" (step1_9), - [step1_10] "r" (step1_10), [step1_11] "r" (step1_11), - [step1_20] "r" (step1_20), [step1_21] "r" (step1_21), - [step1_22] "r" (step1_22), [step1_23] "r" (step1_23) - ); - - step3_12 = ROUND_POWER_OF_TWO((step1_11 - step1_20), 6); - step3_13 = ROUND_POWER_OF_TWO((step1_10 - step1_21), 6); - step3_14 = ROUND_POWER_OF_TWO((step1_9 - step1_22), 6); - step3_15 = ROUND_POWER_OF_TWO((step1_8 - step1_23), 6); - - __asm__ __volatile__ ( - "lbu %[temp2], 0(%[dest_pix1]) \n\t" - "add %[temp2], %[temp2], %[step3_15] \n\t" - "lbux %[temp0], %[temp2](%[cm]) \n\t" - "sb %[temp0], 0(%[dest_pix1]) \n\t" - "subu %[dest_pix1], %[dest_pix1], %[dest_stride] \n\t" - "lbu %[temp3], 0(%[dest_pix1]) \n\t" - "add %[temp3], %[temp3], %[step3_14] \n\t" - "lbux %[temp1], %[temp3](%[cm]) \n\t" - "sb %[temp1], 0(%[dest_pix1]) \n\t" - "subu %[dest_pix1], %[dest_pix1], %[dest_stride] \n\t" - - "lbu %[temp2], 0(%[dest_pix1]) \n\t" - "add %[temp2], %[temp2], %[step3_13] \n\t" - "lbux %[temp0], %[temp2](%[cm]) \n\t" - "sb %[temp0], 0(%[dest_pix1]) \n\t" - "subu %[dest_pix1], %[dest_pix1], %[dest_stride] \n\t" - "lbu %[temp3], 0(%[dest_pix1]) \n\t" - "add %[temp3], %[temp3], %[step3_12] \n\t" - "lbux %[temp1], %[temp3](%[cm]) \n\t" - "sb %[temp1], 0(%[dest_pix1]) \n\t" - "subu %[dest_pix1], %[dest_pix1], %[dest_stride] \n\t" - - : [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), [temp2] "=&r" (temp2), - [temp3] "=&r" (temp3), [dest_pix1] "+r" (dest_pix1) - : [cm] "r" (cm), [dest_stride] "r" (dest_stride), - [step3_12] "r" (step3_12), [step3_13] "r" (step3_13), - [step3_14] "r" (step3_14), [step3_15] "r" (step3_15) - ); - - __asm__ __volatile__ ( - "lbu %[temp2], 0(%[dest_pix]) \n\t" - "add %[temp0], %[step1_12], %[step2_19] \n\t" - "addi %[temp0], %[temp0], 32 \n\t" - "sra %[temp0], %[temp0], 6 \n\t" - "add %[temp2], %[temp2], %[temp0] \n\t" - "lbux %[temp0], %[temp2](%[cm]) \n\t" - "add %[temp1], %[step1_13], %[step2_18] \n\t" - "sb %[temp0], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - "lbu %[temp3], 0(%[dest_pix]) \n\t" - "addi %[temp1], %[temp1], 32 \n\t" - "sra %[temp1], %[temp1], 6 \n\t" - "add %[temp3], %[temp3], %[temp1] \n\t" - "lbux %[temp1], %[temp3](%[cm]) \n\t" - "sb %[temp1], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - "lbu %[temp2], 0(%[dest_pix]) \n\t" - "add %[temp0], %[step1_14], %[step2_17] \n\t" - "addi %[temp0], %[temp0], 32 \n\t" - "sra %[temp0], %[temp0], 6 \n\t" - "add %[temp2], %[temp2], %[temp0] \n\t" - "lbux %[temp0], %[temp2](%[cm]) \n\t" - "add %[temp1], %[step1_15], %[step2_16] \n\t" - "sb %[temp0], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - "lbu %[temp3], 0(%[dest_pix]) \n\t" - "addi %[temp1], %[temp1], 32 \n\t" - "sra %[temp1], %[temp1], 6 \n\t" - "add %[temp3], %[temp3], %[temp1] \n\t" - "lbux %[temp1], %[temp3](%[cm]) \n\t" - "sb %[temp1], 0(%[dest_pix]) \n\t" - - : [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), [temp2] "=&r" (temp2), - [temp3] "=&r" (temp3), [dest_pix] "+r" (dest_pix) - : [cm] "r" (cm), [dest_stride] "r" (dest_stride), - [step1_12] "r" (step1_12), [step1_13] "r" (step1_13), - [step1_14] "r" (step1_14), [step1_15] "r" (step1_15), - [step2_16] "r" (step2_16), [step2_17] "r" (step2_17), - [step2_18] "r" (step2_18), [step2_19] "r" (step2_19) - ); - - step3_12 = ROUND_POWER_OF_TWO((step1_15 - step2_16), 6); - step3_13 = ROUND_POWER_OF_TWO((step1_14 - step2_17), 6); - step3_14 = ROUND_POWER_OF_TWO((step1_13 - step2_18), 6); - step3_15 = ROUND_POWER_OF_TWO((step1_12 - step2_19), 6); - - __asm__ __volatile__ ( - "lbu %[temp2], 0(%[dest_pix1]) \n\t" - "add %[temp2], %[temp2], %[step3_15] \n\t" - "lbux %[temp0], %[temp2](%[cm]) \n\t" - "sb %[temp0], 0(%[dest_pix1]) \n\t" - "subu %[dest_pix1], %[dest_pix1], %[dest_stride] \n\t" - "lbu %[temp3], 0(%[dest_pix1]) \n\t" - "add %[temp3], %[temp3], %[step3_14] \n\t" - "lbux %[temp1], %[temp3](%[cm]) \n\t" - "sb %[temp1], 0(%[dest_pix1]) \n\t" - "subu %[dest_pix1], %[dest_pix1], %[dest_stride] \n\t" - - "lbu %[temp2], 0(%[dest_pix1]) \n\t" - "add %[temp2], %[temp2], %[step3_13] \n\t" - "lbux %[temp0], %[temp2](%[cm]) \n\t" - "sb %[temp0], 0(%[dest_pix1]) \n\t" - "subu %[dest_pix1], %[dest_pix1], %[dest_stride] \n\t" - "lbu %[temp3], 0(%[dest_pix1]) \n\t" - "add %[temp3], %[temp3], %[step3_12] \n\t" - "lbux %[temp1], %[temp3](%[cm]) \n\t" - "sb %[temp1], 0(%[dest_pix1]) \n\t" - - : [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), [temp2] "=&r" (temp2), - [temp3] "=&r" (temp3), [dest_pix1] "+r" (dest_pix1) - : [cm] "r" (cm), [dest_stride] "r" (dest_stride), - [step3_12] "r" (step3_12), [step3_13] "r" (step3_13), - [step3_14] "r" (step3_14), [step3_15] "r" (step3_15) - ); - - input += 32; - } -} -#endif // #if HAVE_DSPR2 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_itrans32_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_itrans32_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_itrans32_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_itrans32_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1076 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vpx_config.h" -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_blockd.h" -#include "vp9/common/vp9_idct.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" - -#if HAVE_DSPR2 -static void idct32_rows_dspr2(const int16_t *input, int16_t *output, - uint32_t no_rows) { - int16_t step1_0, step1_1, step1_2, step1_3, step1_4, step1_5, step1_6; - int16_t step1_7, step1_8, step1_9, step1_10, step1_11, step1_12, step1_13; - int16_t step1_14, step1_15, step1_16, step1_17, step1_18, step1_19, step1_20; - int16_t step1_21, step1_22, step1_23, step1_24, step1_25, step1_26, step1_27; - int16_t step1_28, step1_29, step1_30, step1_31; - int16_t step2_0, step2_1, step2_2, step2_3, step2_4, step2_5, step2_6; - int16_t step2_7, step2_8, step2_9, step2_10, step2_11, step2_12, step2_13; - int16_t step2_14, step2_15, step2_16, step2_17, step2_18, step2_19, step2_20; - int16_t step2_21, step2_22, step2_23, step2_24, step2_25, step2_26, step2_27; - int16_t step2_28, step2_29, step2_30, step2_31; - int16_t step3_8, step3_9, step3_10, step3_11, step3_12, step3_13, step3_14; - int16_t step3_15, step3_16, step3_17, step3_18, step3_19, step3_20, step3_21; - int16_t step3_22, step3_23, step3_24, step3_25, step3_26, step3_27, step3_28; - int16_t step3_29, step3_30, step3_31; - int temp0, temp1, temp2, temp3; - int load1, load2, load3, load4; - int result1, result2; - int temp21; - int i; - const int const_2_power_13 = 8192; - const int32_t *input_int; - - for (i = no_rows; i--; ) { - input_int = (const int32_t *)input; - - if (!(input_int[0] | input_int[1] | input_int[2] | input_int[3] | - input_int[4] | input_int[5] | input_int[6] | input_int[7] | - input_int[8] | input_int[9] | input_int[10] | input_int[11] | - input_int[12] | input_int[13] | input_int[14] | input_int[15])) { - input += 32; - - __asm__ __volatile__ ( - "sh $zero, 0(%[output]) \n\t" - "sh $zero, 64(%[output]) \n\t" - "sh $zero, 128(%[output]) \n\t" - "sh $zero, 192(%[output]) \n\t" - "sh $zero, 256(%[output]) \n\t" - "sh $zero, 320(%[output]) \n\t" - "sh $zero, 384(%[output]) \n\t" - "sh $zero, 448(%[output]) \n\t" - "sh $zero, 512(%[output]) \n\t" - "sh $zero, 576(%[output]) \n\t" - "sh $zero, 640(%[output]) \n\t" - "sh $zero, 704(%[output]) \n\t" - "sh $zero, 768(%[output]) \n\t" - "sh $zero, 832(%[output]) \n\t" - "sh $zero, 896(%[output]) \n\t" - "sh $zero, 960(%[output]) \n\t" - "sh $zero, 1024(%[output]) \n\t" - "sh $zero, 1088(%[output]) \n\t" - "sh $zero, 1152(%[output]) \n\t" - "sh $zero, 1216(%[output]) \n\t" - "sh $zero, 1280(%[output]) \n\t" - "sh $zero, 1344(%[output]) \n\t" - "sh $zero, 1408(%[output]) \n\t" - "sh $zero, 1472(%[output]) \n\t" - "sh $zero, 1536(%[output]) \n\t" - "sh $zero, 1600(%[output]) \n\t" - "sh $zero, 1664(%[output]) \n\t" - "sh $zero, 1728(%[output]) \n\t" - "sh $zero, 1792(%[output]) \n\t" - "sh $zero, 1856(%[output]) \n\t" - "sh $zero, 1920(%[output]) \n\t" - "sh $zero, 1984(%[output]) \n\t" - - : - : [output] "r" (output) - ); - - output += 1; - - continue; - } - - /* prefetch row */ - vp9_prefetch_load((const uint8_t *)(input + 32)); - vp9_prefetch_load((const uint8_t *)(input + 48)); - - __asm__ __volatile__ ( - "lh %[load1], 2(%[input]) \n\t" - "lh %[load2], 62(%[input]) \n\t" - "lh %[load3], 34(%[input]) \n\t" - "lh %[load4], 30(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load1], %[cospi_31_64] \n\t" - "msub $ac1, %[load2], %[cospi_1_64] \n\t" - "extp %[temp0], $ac1, 31 \n\t" - - "madd $ac3, %[load1], %[cospi_1_64] \n\t" - "madd $ac3, %[load2], %[cospi_31_64] \n\t" - "extp %[temp3], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - - "madd $ac2, %[load3], %[cospi_15_64] \n\t" - "msub $ac2, %[load4], %[cospi_17_64] \n\t" - "extp %[temp1], $ac2, 31 \n\t" - - "madd $ac1, %[load3], %[cospi_17_64] \n\t" - "madd $ac1, %[load4], %[cospi_15_64] \n\t" - "extp %[temp2], $ac1, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "sub %[load1], %[temp3], %[temp2] \n\t" - "sub %[load2], %[temp0], %[temp1] \n\t" - - "madd $ac1, %[load1], %[cospi_28_64] \n\t" - "msub $ac1, %[load2], %[cospi_4_64] \n\t" - "madd $ac3, %[load1], %[cospi_4_64] \n\t" - "madd $ac3, %[load2], %[cospi_28_64] \n\t" - - "extp %[step1_17], $ac1, 31 \n\t" - "extp %[step1_30], $ac3, 31 \n\t" - "add %[step1_16], %[temp0], %[temp1] \n\t" - "add %[step1_31], %[temp2], %[temp3] \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [load3] "=&r" (load3), [load4] "=&r" (load4), - [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), - [temp2] "=&r" (temp2), [temp3] "=&r" (temp3), - [step1_16] "=r" (step1_16), [step1_17] "=r" (step1_17), - [step1_30] "=r" (step1_30), [step1_31] "=r" (step1_31) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_31_64] "r" (cospi_31_64), [cospi_1_64] "r" (cospi_1_64), - [cospi_4_64] "r" (cospi_4_64), [cospi_17_64] "r" (cospi_17_64), - [cospi_15_64] "r" (cospi_15_64), [cospi_28_64] "r" (cospi_28_64) - ); - - __asm__ __volatile__ ( - "lh %[load1], 18(%[input]) \n\t" - "lh %[load2], 46(%[input]) \n\t" - "lh %[load3], 50(%[input]) \n\t" - "lh %[load4], 14(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load1], %[cospi_23_64] \n\t" - "msub $ac1, %[load2], %[cospi_9_64] \n\t" - "extp %[temp0], $ac1, 31 \n\t" - - "madd $ac3, %[load1], %[cospi_9_64] \n\t" - "madd $ac3, %[load2], %[cospi_23_64] \n\t" - "extp %[temp3], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - - "madd $ac2, %[load3], %[cospi_7_64] \n\t" - "msub $ac2, %[load4], %[cospi_25_64] \n\t" - "extp %[temp1], $ac2, 31 \n\t" - - "madd $ac1, %[load3], %[cospi_25_64] \n\t" - "madd $ac1, %[load4], %[cospi_7_64] \n\t" - "extp %[temp2], $ac1, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "sub %[load1], %[temp1], %[temp0] \n\t" - "sub %[load2], %[temp2], %[temp3] \n\t" - - "msub $ac1, %[load1], %[cospi_28_64] \n\t" - "msub $ac1, %[load2], %[cospi_4_64] \n\t" - "msub $ac3, %[load1], %[cospi_4_64] \n\t" - "madd $ac3, %[load2], %[cospi_28_64] \n\t" - - "extp %[step1_18], $ac1, 31 \n\t" - "extp %[step1_29], $ac3, 31 \n\t" - "add %[step1_19], %[temp0], %[temp1] \n\t" - "add %[step1_28], %[temp2], %[temp3] \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [load3] "=&r" (load3), [load4] "=&r" (load4), - [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), - [temp2] "=&r" (temp2), [temp3] "=&r" (temp3), - [step1_18] "=r" (step1_18), [step1_19] "=r" (step1_19), - [step1_28] "=r" (step1_28), [step1_29] "=r" (step1_29) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_23_64] "r" (cospi_23_64), [cospi_9_64] "r" (cospi_9_64), - [cospi_4_64] "r" (cospi_4_64), [cospi_7_64] "r" (cospi_7_64), - [cospi_25_64] "r" (cospi_25_64), [cospi_28_64] "r" (cospi_28_64) - ); - - __asm__ __volatile__ ( - "lh %[load1], 10(%[input]) \n\t" - "lh %[load2], 54(%[input]) \n\t" - "lh %[load3], 42(%[input]) \n\t" - "lh %[load4], 22(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load1], %[cospi_27_64] \n\t" - "msub $ac1, %[load2], %[cospi_5_64] \n\t" - "extp %[temp0], $ac1, 31 \n\t" - - "madd $ac3, %[load1], %[cospi_5_64] \n\t" - "madd $ac3, %[load2], %[cospi_27_64] \n\t" - "extp %[temp3], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - - "madd $ac2, %[load3], %[cospi_11_64] \n\t" - "msub $ac2, %[load4], %[cospi_21_64] \n\t" - "extp %[temp1], $ac2, 31 \n\t" - - "madd $ac1, %[load3], %[cospi_21_64] \n\t" - "madd $ac1, %[load4], %[cospi_11_64] \n\t" - "extp %[temp2], $ac1, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "sub %[load1], %[temp0], %[temp1] \n\t" - "sub %[load2], %[temp3], %[temp2] \n\t" - - "madd $ac1, %[load2], %[cospi_12_64] \n\t" - "msub $ac1, %[load1], %[cospi_20_64] \n\t" - "madd $ac3, %[load1], %[cospi_12_64] \n\t" - "madd $ac3, %[load2], %[cospi_20_64] \n\t" - - "extp %[step1_21], $ac1, 31 \n\t" - "extp %[step1_26], $ac3, 31 \n\t" - "add %[step1_20], %[temp0], %[temp1] \n\t" - "add %[step1_27], %[temp2], %[temp3] \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [load3] "=&r" (load3), [load4] "=&r" (load4), - [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), - [temp2] "=&r" (temp2), [temp3] "=&r" (temp3), - [step1_20] "=r" (step1_20), [step1_21] "=r" (step1_21), - [step1_26] "=r" (step1_26), [step1_27] "=r" (step1_27) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_27_64] "r" (cospi_27_64), [cospi_5_64] "r" (cospi_5_64), - [cospi_11_64] "r" (cospi_11_64), [cospi_21_64] "r" (cospi_21_64), - [cospi_12_64] "r" (cospi_12_64), [cospi_20_64] "r" (cospi_20_64) - ); - - __asm__ __volatile__ ( - "lh %[load1], 26(%[input]) \n\t" - "lh %[load2], 38(%[input]) \n\t" - "lh %[load3], 58(%[input]) \n\t" - "lh %[load4], 6(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load1], %[cospi_19_64] \n\t" - "msub $ac1, %[load2], %[cospi_13_64] \n\t" - "extp %[temp0], $ac1, 31 \n\t" - - "madd $ac3, %[load1], %[cospi_13_64] \n\t" - "madd $ac3, %[load2], %[cospi_19_64] \n\t" - "extp %[temp3], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - - "madd $ac2, %[load3], %[cospi_3_64] \n\t" - "msub $ac2, %[load4], %[cospi_29_64] \n\t" - "extp %[temp1], $ac2, 31 \n\t" - - "madd $ac1, %[load3], %[cospi_29_64] \n\t" - "madd $ac1, %[load4], %[cospi_3_64] \n\t" - "extp %[temp2], $ac1, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "sub %[load1], %[temp1], %[temp0] \n\t" - "sub %[load2], %[temp2], %[temp3] \n\t" - - "msub $ac1, %[load1], %[cospi_12_64] \n\t" - "msub $ac1, %[load2], %[cospi_20_64] \n\t" - "msub $ac3, %[load1], %[cospi_20_64] \n\t" - "madd $ac3, %[load2], %[cospi_12_64] \n\t" - - "extp %[step1_22], $ac1, 31 \n\t" - "extp %[step1_25], $ac3, 31 \n\t" - "add %[step1_23], %[temp0], %[temp1] \n\t" - "add %[step1_24], %[temp2], %[temp3] \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [load3] "=&r" (load3), [load4] "=&r" (load4), - [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), - [temp2] "=&r" (temp2), [temp3] "=&r" (temp3), - [step1_22] "=r" (step1_22), [step1_23] "=r" (step1_23), - [step1_24] "=r" (step1_24), [step1_25] "=r" (step1_25) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_19_64] "r" (cospi_19_64), [cospi_13_64] "r" (cospi_13_64), - [cospi_3_64] "r" (cospi_3_64), [cospi_29_64] "r" (cospi_29_64), - [cospi_12_64] "r" (cospi_12_64), [cospi_20_64] "r" (cospi_20_64) - ); - - __asm__ __volatile__ ( - "lh %[load1], 4(%[input]) \n\t" - "lh %[load2], 60(%[input]) \n\t" - "lh %[load3], 36(%[input]) \n\t" - "lh %[load4], 28(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load1], %[cospi_30_64] \n\t" - "msub $ac1, %[load2], %[cospi_2_64] \n\t" - "extp %[temp0], $ac1, 31 \n\t" - - "madd $ac3, %[load1], %[cospi_2_64] \n\t" - "madd $ac3, %[load2], %[cospi_30_64] \n\t" - "extp %[temp3], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - - "madd $ac2, %[load3], %[cospi_14_64] \n\t" - "msub $ac2, %[load4], %[cospi_18_64] \n\t" - "extp %[temp1], $ac2, 31 \n\t" - - "madd $ac1, %[load3], %[cospi_18_64] \n\t" - "madd $ac1, %[load4], %[cospi_14_64] \n\t" - "extp %[temp2], $ac1, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "sub %[load1], %[temp0], %[temp1] \n\t" - "sub %[load2], %[temp3], %[temp2] \n\t" - - "msub $ac1, %[load1], %[cospi_8_64] \n\t" - "madd $ac1, %[load2], %[cospi_24_64] \n\t" - "madd $ac3, %[load1], %[cospi_24_64] \n\t" - "madd $ac3, %[load2], %[cospi_8_64] \n\t" - - "extp %[step2_9], $ac1, 31 \n\t" - "extp %[step2_14], $ac3, 31 \n\t" - "add %[step2_8], %[temp0], %[temp1] \n\t" - "add %[step2_15], %[temp2], %[temp3] \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [load3] "=&r" (load3), [load4] "=&r" (load4), - [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), - [temp2] "=&r" (temp2), [temp3] "=&r" (temp3), - [step2_8] "=r" (step2_8), [step2_9] "=r" (step2_9), - [step2_14] "=r" (step2_14), [step2_15] "=r" (step2_15) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_30_64] "r" (cospi_30_64), [cospi_2_64] "r" (cospi_2_64), - [cospi_14_64] "r" (cospi_14_64), [cospi_18_64] "r" (cospi_18_64), - [cospi_8_64] "r" (cospi_8_64), [cospi_24_64] "r" (cospi_24_64) - ); - - __asm__ __volatile__ ( - "lh %[load1], 20(%[input]) \n\t" - "lh %[load2], 44(%[input]) \n\t" - "lh %[load3], 52(%[input]) \n\t" - "lh %[load4], 12(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load1], %[cospi_22_64] \n\t" - "msub $ac1, %[load2], %[cospi_10_64] \n\t" - "extp %[temp0], $ac1, 31 \n\t" - - "madd $ac3, %[load1], %[cospi_10_64] \n\t" - "madd $ac3, %[load2], %[cospi_22_64] \n\t" - "extp %[temp3], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - - "madd $ac2, %[load3], %[cospi_6_64] \n\t" - "msub $ac2, %[load4], %[cospi_26_64] \n\t" - "extp %[temp1], $ac2, 31 \n\t" - - "madd $ac1, %[load3], %[cospi_26_64] \n\t" - "madd $ac1, %[load4], %[cospi_6_64] \n\t" - "extp %[temp2], $ac1, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "sub %[load1], %[temp1], %[temp0] \n\t" - "sub %[load2], %[temp2], %[temp3] \n\t" - - "msub $ac1, %[load1], %[cospi_24_64] \n\t" - "msub $ac1, %[load2], %[cospi_8_64] \n\t" - "madd $ac3, %[load2], %[cospi_24_64] \n\t" - "msub $ac3, %[load1], %[cospi_8_64] \n\t" - - "extp %[step2_10], $ac1, 31 \n\t" - "extp %[step2_13], $ac3, 31 \n\t" - "add %[step2_11], %[temp0], %[temp1] \n\t" - "add %[step2_12], %[temp2], %[temp3] \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [load3] "=&r" (load3), [load4] "=&r" (load4), - [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), - [temp2] "=&r" (temp2), [temp3] "=&r" (temp3), - [step2_10] "=r" (step2_10), [step2_11] "=r" (step2_11), - [step2_12] "=r" (step2_12), [step2_13] "=r" (step2_13) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_22_64] "r" (cospi_22_64), [cospi_10_64] "r" (cospi_10_64), - [cospi_6_64] "r" (cospi_6_64), [cospi_26_64] "r" (cospi_26_64), - [cospi_8_64] "r" (cospi_8_64), [cospi_24_64] "r" (cospi_24_64) - ); - - __asm__ __volatile__ ( - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "sub %[temp0], %[step2_14], %[step2_13] \n\t" - "sub %[temp0], %[temp0], %[step2_9] \n\t" - "add %[temp0], %[temp0], %[step2_10] \n\t" - "madd $ac0, %[temp0], %[cospi_16_64] \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "sub %[temp1], %[step2_14], %[step2_13] \n\t" - "add %[temp1], %[temp1], %[step2_9] \n\t" - "sub %[temp1], %[temp1], %[step2_10] \n\t" - "madd $ac1, %[temp1], %[cospi_16_64] \n\t" - - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "sub %[temp0], %[step2_15], %[step2_12] \n\t" - "sub %[temp0], %[temp0], %[step2_8] \n\t" - "add %[temp0], %[temp0], %[step2_11] \n\t" - "madd $ac2, %[temp0], %[cospi_16_64] \n\t" - - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "sub %[temp1], %[step2_15], %[step2_12] \n\t" - "add %[temp1], %[temp1], %[step2_8] \n\t" - "sub %[temp1], %[temp1], %[step2_11] \n\t" - "madd $ac3, %[temp1], %[cospi_16_64] \n\t" - - "add %[step3_8], %[step2_8], %[step2_11] \n\t" - "add %[step3_9], %[step2_9], %[step2_10] \n\t" - "add %[step3_14], %[step2_13], %[step2_14] \n\t" - "add %[step3_15], %[step2_12], %[step2_15] \n\t" - - "extp %[step3_10], $ac0, 31 \n\t" - "extp %[step3_13], $ac1, 31 \n\t" - "extp %[step3_11], $ac2, 31 \n\t" - "extp %[step3_12], $ac3, 31 \n\t" - - : [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), - [step3_8] "=r" (step3_8), [step3_9] "=r" (step3_9), - [step3_10] "=r" (step3_10), [step3_11] "=r" (step3_11), - [step3_12] "=r" (step3_12), [step3_13] "=r" (step3_13), - [step3_14] "=r" (step3_14), [step3_15] "=r" (step3_15) - : [const_2_power_13] "r" (const_2_power_13), - [step2_8] "r" (step2_8), [step2_9] "r" (step2_9), - [step2_10] "r" (step2_10), [step2_11] "r" (step2_11), - [step2_12] "r" (step2_12), [step2_13] "r" (step2_13), - [step2_14] "r" (step2_14), [step2_15] "r" (step2_15), - [cospi_16_64] "r" (cospi_16_64) - ); - - step2_18 = step1_17 - step1_18; - step2_29 = step1_30 - step1_29; - - __asm__ __volatile__ ( - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "msub $ac0, %[step2_18], %[cospi_8_64] \n\t" - "madd $ac0, %[step2_29], %[cospi_24_64] \n\t" - "extp %[step3_18], $ac0, 31 \n\t" - - : [step3_18] "=r" (step3_18) - : [const_2_power_13] "r" (const_2_power_13), - [step2_18] "r" (step2_18), [step2_29] "r" (step2_29), - [cospi_24_64] "r" (cospi_24_64), [cospi_8_64] "r" (cospi_8_64) - ); - - temp21 = step2_18 * cospi_24_64 + step2_29 * cospi_8_64; - step3_29 = (temp21 + DCT_CONST_ROUNDING) >> DCT_CONST_BITS; - - step2_19 = step1_16 - step1_19; - step2_28 = step1_31 - step1_28; - - __asm__ __volatile__ ( - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "msub $ac0, %[step2_19], %[cospi_8_64] \n\t" - "madd $ac0, %[step2_28], %[cospi_24_64] \n\t" - "extp %[step3_19], $ac0, 31 \n\t" - - : [step3_19] "=r" (step3_19) - : [const_2_power_13] "r" (const_2_power_13), - [step2_19] "r" (step2_19), [step2_28] "r" (step2_28), - [cospi_24_64] "r" (cospi_24_64), [cospi_8_64] "r" (cospi_8_64) - ); - - temp21 = step2_19 * cospi_24_64 + step2_28 * cospi_8_64; - step3_28 = (temp21 + DCT_CONST_ROUNDING) >> DCT_CONST_BITS; - - step3_16 = step1_16 + step1_19; - step3_17 = step1_17 + step1_18; - step3_30 = step1_29 + step1_30; - step3_31 = step1_28 + step1_31; - - step2_20 = step1_23 - step1_20; - step2_27 = step1_24 - step1_27; - - __asm__ __volatile__ ( - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "msub $ac0, %[step2_20], %[cospi_24_64] \n\t" - "msub $ac0, %[step2_27], %[cospi_8_64] \n\t" - "extp %[step3_20], $ac0, 31 \n\t" - - : [step3_20] "=r" (step3_20) - : [const_2_power_13] "r" (const_2_power_13), - [step2_20] "r" (step2_20), [step2_27] "r" (step2_27), - [cospi_24_64] "r" (cospi_24_64), [cospi_8_64] "r" (cospi_8_64) - ); - - temp21 = -step2_20 * cospi_8_64 + step2_27 * cospi_24_64; - step3_27 = (temp21 + DCT_CONST_ROUNDING) >> DCT_CONST_BITS; - - step2_21 = step1_22 - step1_21; - step2_26 = step1_25 - step1_26; - - __asm__ __volatile__ ( - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "msub $ac1, %[step2_21], %[cospi_24_64] \n\t" - "msub $ac1, %[step2_26], %[cospi_8_64] \n\t" - "extp %[step3_21], $ac1, 31 \n\t" - - : [step3_21] "=r" (step3_21) - : [const_2_power_13] "r" (const_2_power_13), - [step2_21] "r" (step2_21), [step2_26] "r" (step2_26), - [cospi_24_64] "r" (cospi_24_64), [cospi_8_64] "r" (cospi_8_64) - ); - - temp21 = -step2_21 * cospi_8_64 + step2_26 * cospi_24_64; - step3_26 = (temp21 + DCT_CONST_ROUNDING) >> DCT_CONST_BITS; - - step3_22 = step1_21 + step1_22; - step3_23 = step1_20 + step1_23; - step3_24 = step1_24 + step1_27; - step3_25 = step1_25 + step1_26; - - step2_16 = step3_16 + step3_23; - step2_17 = step3_17 + step3_22; - step2_18 = step3_18 + step3_21; - step2_19 = step3_19 + step3_20; - step2_20 = step3_19 - step3_20; - step2_21 = step3_18 - step3_21; - step2_22 = step3_17 - step3_22; - step2_23 = step3_16 - step3_23; - - step2_24 = step3_31 - step3_24; - step2_25 = step3_30 - step3_25; - step2_26 = step3_29 - step3_26; - step2_27 = step3_28 - step3_27; - step2_28 = step3_28 + step3_27; - step2_29 = step3_29 + step3_26; - step2_30 = step3_30 + step3_25; - step2_31 = step3_31 + step3_24; - - __asm__ __volatile__ ( - "lh %[load1], 0(%[input]) \n\t" - "lh %[load2], 32(%[input]) \n\t" - "lh %[load3], 16(%[input]) \n\t" - "lh %[load4], 48(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - "add %[result1], %[load1], %[load2] \n\t" - "sub %[result2], %[load1], %[load2] \n\t" - "madd $ac1, %[result1], %[cospi_16_64] \n\t" - "madd $ac2, %[result2], %[cospi_16_64] \n\t" - "extp %[temp0], $ac1, 31 \n\t" - "extp %[temp1], $ac2, 31 \n\t" - - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - "madd $ac3, %[load3], %[cospi_24_64] \n\t" - "msub $ac3, %[load4], %[cospi_8_64] \n\t" - "extp %[temp2], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "madd $ac1, %[load3], %[cospi_8_64] \n\t" - "madd $ac1, %[load4], %[cospi_24_64] \n\t" - "extp %[temp3], $ac1, 31 \n\t" - - "add %[step1_0], %[temp0], %[temp3] \n\t" - "add %[step1_1], %[temp1], %[temp2] \n\t" - "sub %[step1_2], %[temp1], %[temp2] \n\t" - "sub %[step1_3], %[temp0], %[temp3] \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [load3] "=&r" (load3), [load4] "=&r" (load4), - [result1] "=&r" (result1), [result2] "=&r" (result2), - [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), - [temp2] "=&r" (temp2), [temp3] "=&r" (temp3), - [step1_0] "=r" (step1_0), [step1_1] "=r" (step1_1), - [step1_2] "=r" (step1_2), [step1_3] "=r" (step1_3) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_16_64] "r" (cospi_16_64), - [cospi_24_64] "r" (cospi_24_64), [cospi_8_64] "r" (cospi_8_64) - - ); - - __asm__ __volatile__ ( - "lh %[load1], 8(%[input]) \n\t" - "lh %[load2], 56(%[input]) \n\t" - "lh %[load3], 40(%[input]) \n\t" - "lh %[load4], 24(%[input]) \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "madd $ac1, %[load1], %[cospi_28_64] \n\t" - "msub $ac1, %[load2], %[cospi_4_64] \n\t" - "extp %[temp0], $ac1, 31 \n\t" - - "madd $ac3, %[load1], %[cospi_4_64] \n\t" - "madd $ac3, %[load2], %[cospi_28_64] \n\t" - "extp %[temp3], $ac3, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac2 \n\t" - "mthi $zero, $ac2 \n\t" - - "madd $ac2, %[load3], %[cospi_12_64] \n\t" - "msub $ac2, %[load4], %[cospi_20_64] \n\t" - "extp %[temp1], $ac2, 31 \n\t" - - "madd $ac1, %[load3], %[cospi_20_64] \n\t" - "madd $ac1, %[load4], %[cospi_12_64] \n\t" - "extp %[temp2], $ac1, 31 \n\t" - - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "mtlo %[const_2_power_13], $ac3 \n\t" - "mthi $zero, $ac3 \n\t" - - "sub %[load1], %[temp3], %[temp2] \n\t" - "sub %[load1], %[load1], %[temp0] \n\t" - "add %[load1], %[load1], %[temp1] \n\t" - - "sub %[load2], %[temp0], %[temp1] \n\t" - "sub %[load2], %[load2], %[temp2] \n\t" - "add %[load2], %[load2], %[temp3] \n\t" - - "madd $ac1, %[load1], %[cospi_16_64] \n\t" - "madd $ac3, %[load2], %[cospi_16_64] \n\t" - - "extp %[step1_5], $ac1, 31 \n\t" - "extp %[step1_6], $ac3, 31 \n\t" - "add %[step1_4], %[temp0], %[temp1] \n\t" - "add %[step1_7], %[temp3], %[temp2] \n\t" - - : [load1] "=&r" (load1), [load2] "=&r" (load2), - [load3] "=&r" (load3), [load4] "=&r" (load4), - [temp0] "=&r" (temp0), [temp1] "=&r" (temp1), - [temp2] "=&r" (temp2), [temp3] "=&r" (temp3), - [step1_4] "=r" (step1_4), [step1_5] "=r" (step1_5), - [step1_6] "=r" (step1_6), [step1_7] "=r" (step1_7) - : [const_2_power_13] "r" (const_2_power_13), [input] "r" (input), - [cospi_20_64] "r" (cospi_20_64), [cospi_12_64] "r" (cospi_12_64), - [cospi_4_64] "r" (cospi_4_64), [cospi_28_64] "r" (cospi_28_64), - [cospi_16_64] "r" (cospi_16_64) - ); - - step2_0 = step1_0 + step1_7; - step2_1 = step1_1 + step1_6; - step2_2 = step1_2 + step1_5; - step2_3 = step1_3 + step1_4; - step2_4 = step1_3 - step1_4; - step2_5 = step1_2 - step1_5; - step2_6 = step1_1 - step1_6; - step2_7 = step1_0 - step1_7; - - step1_0 = step2_0 + step3_15; - step1_1 = step2_1 + step3_14; - step1_2 = step2_2 + step3_13; - step1_3 = step2_3 + step3_12; - step1_4 = step2_4 + step3_11; - step1_5 = step2_5 + step3_10; - step1_6 = step2_6 + step3_9; - step1_7 = step2_7 + step3_8; - step1_8 = step2_7 - step3_8; - step1_9 = step2_6 - step3_9; - step1_10 = step2_5 - step3_10; - step1_11 = step2_4 - step3_11; - step1_12 = step2_3 - step3_12; - step1_13 = step2_2 - step3_13; - step1_14 = step2_1 - step3_14; - step1_15 = step2_0 - step3_15; - - __asm__ __volatile__ ( - "sub %[temp0], %[step2_27], %[step2_20] \n\t" - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "madd $ac0, %[temp0], %[cospi_16_64] \n\t" - "extp %[step1_20], $ac0, 31 \n\t" - - : [temp0] "=&r" (temp0), [step1_20] "=r" (step1_20) - : [const_2_power_13] "r" (const_2_power_13), - [step2_20] "r" (step2_20), [step2_27] "r" (step2_27), - [cospi_16_64] "r" (cospi_16_64) - ); - - temp21 = (step2_20 + step2_27) * cospi_16_64; - step1_27 = (temp21 + DCT_CONST_ROUNDING) >> DCT_CONST_BITS; - - __asm__ __volatile__ ( - "sub %[temp0], %[step2_26], %[step2_21] \n\t" - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "madd $ac0, %[temp0], %[cospi_16_64] \n\t" - "extp %[step1_21], $ac0, 31 \n\t" - - : [temp0] "=&r" (temp0), [step1_21] "=r" (step1_21) - : [const_2_power_13] "r" (const_2_power_13), - [step2_26] "r" (step2_26), [step2_21] "r" (step2_21), - [cospi_16_64] "r" (cospi_16_64) - ); - - temp21 = (step2_21 + step2_26) * cospi_16_64; - step1_26 = (temp21 + DCT_CONST_ROUNDING) >> DCT_CONST_BITS; - - __asm__ __volatile__ ( - "sub %[temp0], %[step2_25], %[step2_22] \n\t" - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "madd $ac0, %[temp0], %[cospi_16_64] \n\t" - "extp %[step1_22], $ac0, 31 \n\t" - - : [temp0] "=&r" (temp0), [step1_22] "=r" (step1_22) - : [const_2_power_13] "r" (const_2_power_13), - [step2_25] "r" (step2_25), [step2_22] "r" (step2_22), - [cospi_16_64] "r" (cospi_16_64) - ); - - temp21 = (step2_22 + step2_25) * cospi_16_64; - step1_25 = (temp21 + DCT_CONST_ROUNDING) >> DCT_CONST_BITS; - - __asm__ __volatile__ ( - "sub %[temp0], %[step2_24], %[step2_23] \n\t" - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "madd $ac0, %[temp0], %[cospi_16_64] \n\t" - "extp %[step1_23], $ac0, 31 \n\t" - - : [temp0] "=&r" (temp0), [step1_23] "=r" (step1_23) - : [const_2_power_13] "r" (const_2_power_13), - [step2_24] "r" (step2_24), [step2_23] "r" (step2_23), - [cospi_16_64] "r" (cospi_16_64) - ); - - temp21 = (step2_23 + step2_24) * cospi_16_64; - step1_24 = (temp21 + DCT_CONST_ROUNDING) >> DCT_CONST_BITS; - - // final stage - output[0 * 32] = step1_0 + step2_31; - output[1 * 32] = step1_1 + step2_30; - output[2 * 32] = step1_2 + step2_29; - output[3 * 32] = step1_3 + step2_28; - output[4 * 32] = step1_4 + step1_27; - output[5 * 32] = step1_5 + step1_26; - output[6 * 32] = step1_6 + step1_25; - output[7 * 32] = step1_7 + step1_24; - output[8 * 32] = step1_8 + step1_23; - output[9 * 32] = step1_9 + step1_22; - output[10 * 32] = step1_10 + step1_21; - output[11 * 32] = step1_11 + step1_20; - output[12 * 32] = step1_12 + step2_19; - output[13 * 32] = step1_13 + step2_18; - output[14 * 32] = step1_14 + step2_17; - output[15 * 32] = step1_15 + step2_16; - output[16 * 32] = step1_15 - step2_16; - output[17 * 32] = step1_14 - step2_17; - output[18 * 32] = step1_13 - step2_18; - output[19 * 32] = step1_12 - step2_19; - output[20 * 32] = step1_11 - step1_20; - output[21 * 32] = step1_10 - step1_21; - output[22 * 32] = step1_9 - step1_22; - output[23 * 32] = step1_8 - step1_23; - output[24 * 32] = step1_7 - step1_24; - output[25 * 32] = step1_6 - step1_25; - output[26 * 32] = step1_5 - step1_26; - output[27 * 32] = step1_4 - step1_27; - output[28 * 32] = step1_3 - step2_28; - output[29 * 32] = step1_2 - step2_29; - output[30 * 32] = step1_1 - step2_30; - output[31 * 32] = step1_0 - step2_31; - - input += 32; - output += 1; - } -} - -void vp9_idct32x32_1024_add_dspr2(const int16_t *input, uint8_t *dest, - int dest_stride) { - DECLARE_ALIGNED(32, int16_t, out[32 * 32]); - int16_t *outptr = out; - uint32_t pos = 45; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - // Rows - idct32_rows_dspr2(input, outptr, 32); - - // Columns - vp9_idct32_cols_add_blk_dspr2(out, dest, dest_stride); -} - -void vp9_idct32x32_34_add_dspr2(const int16_t *input, uint8_t *dest, - int stride) { - DECLARE_ALIGNED(32, int16_t, out[32 * 32]); - int16_t *outptr = out; - uint32_t i; - uint32_t pos = 45; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - // Rows - idct32_rows_dspr2(input, outptr, 8); - - outptr += 8; - __asm__ __volatile__ ( - "sw $zero, 0(%[outptr]) \n\t" - "sw $zero, 4(%[outptr]) \n\t" - "sw $zero, 8(%[outptr]) \n\t" - "sw $zero, 12(%[outptr]) \n\t" - "sw $zero, 16(%[outptr]) \n\t" - "sw $zero, 20(%[outptr]) \n\t" - "sw $zero, 24(%[outptr]) \n\t" - "sw $zero, 28(%[outptr]) \n\t" - "sw $zero, 32(%[outptr]) \n\t" - "sw $zero, 36(%[outptr]) \n\t" - "sw $zero, 40(%[outptr]) \n\t" - "sw $zero, 44(%[outptr]) \n\t" - - : - : [outptr] "r" (outptr) - ); - - for (i = 0; i < 31; ++i) { - outptr += 32; - - __asm__ __volatile__ ( - "sw $zero, 0(%[outptr]) \n\t" - "sw $zero, 4(%[outptr]) \n\t" - "sw $zero, 8(%[outptr]) \n\t" - "sw $zero, 12(%[outptr]) \n\t" - "sw $zero, 16(%[outptr]) \n\t" - "sw $zero, 20(%[outptr]) \n\t" - "sw $zero, 24(%[outptr]) \n\t" - "sw $zero, 28(%[outptr]) \n\t" - "sw $zero, 32(%[outptr]) \n\t" - "sw $zero, 36(%[outptr]) \n\t" - "sw $zero, 40(%[outptr]) \n\t" - "sw $zero, 44(%[outptr]) \n\t" - - : - : [outptr] "r" (outptr) - ); - } - - // Columns - vp9_idct32_cols_add_blk_dspr2(out, dest, stride); -} - -void vp9_idct32x32_1_add_dspr2(const int16_t *input, uint8_t *dest, - int stride) { - int r, out; - int32_t a1, absa1; - int32_t vector_a1; - int32_t t1, t2, t3, t4; - int32_t vector_1, vector_2, vector_3, vector_4; - uint32_t pos = 45; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - - : - : [pos] "r" (pos) - ); - - out = DCT_CONST_ROUND_SHIFT_TWICE_COSPI_16_64(input[0]); - __asm__ __volatile__ ( - "addi %[out], %[out], 32 \n\t" - "sra %[a1], %[out], 6 \n\t" - - : [out] "+r" (out), [a1] "=r" (a1) - : - ); - - if (a1 < 0) { - /* use quad-byte - * input and output memory are four byte aligned */ - __asm__ __volatile__ ( - "abs %[absa1], %[a1] \n\t" - "replv.qb %[vector_a1], %[absa1] \n\t" - - : [absa1] "=r" (absa1), [vector_a1] "=r" (vector_a1) - : [a1] "r" (a1) - ); - - for (r = 32; r--;) { - __asm__ __volatile__ ( - "lw %[t1], 0(%[dest]) \n\t" - "lw %[t2], 4(%[dest]) \n\t" - "lw %[t3], 8(%[dest]) \n\t" - "lw %[t4], 12(%[dest]) \n\t" - "subu_s.qb %[vector_1], %[t1], %[vector_a1] \n\t" - "subu_s.qb %[vector_2], %[t2], %[vector_a1] \n\t" - "subu_s.qb %[vector_3], %[t3], %[vector_a1] \n\t" - "subu_s.qb %[vector_4], %[t4], %[vector_a1] \n\t" - "sw %[vector_1], 0(%[dest]) \n\t" - "sw %[vector_2], 4(%[dest]) \n\t" - "sw %[vector_3], 8(%[dest]) \n\t" - "sw %[vector_4], 12(%[dest]) \n\t" - - "lw %[t1], 16(%[dest]) \n\t" - "lw %[t2], 20(%[dest]) \n\t" - "lw %[t3], 24(%[dest]) \n\t" - "lw %[t4], 28(%[dest]) \n\t" - "subu_s.qb %[vector_1], %[t1], %[vector_a1] \n\t" - "subu_s.qb %[vector_2], %[t2], %[vector_a1] \n\t" - "subu_s.qb %[vector_3], %[t3], %[vector_a1] \n\t" - "subu_s.qb %[vector_4], %[t4], %[vector_a1] \n\t" - "sw %[vector_1], 16(%[dest]) \n\t" - "sw %[vector_2], 20(%[dest]) \n\t" - "sw %[vector_3], 24(%[dest]) \n\t" - "sw %[vector_4], 28(%[dest]) \n\t" - - "add %[dest], %[dest], %[stride] \n\t" - - : [t1] "=&r" (t1), [t2] "=&r" (t2), [t3] "=&r" (t3), [t4] "=&r" (t4), - [vector_1] "=&r" (vector_1), [vector_2] "=&r" (vector_2), - [vector_3] "=&r" (vector_3), [vector_4] "=&r" (vector_4), - [dest] "+&r" (dest) - : [stride] "r" (stride), [vector_a1] "r" (vector_a1) - ); - } - } else { - /* use quad-byte - * input and output memory are four byte aligned */ - __asm__ __volatile__ ( - "replv.qb %[vector_a1], %[a1] \n\t" - - : [vector_a1] "=r" (vector_a1) - : [a1] "r" (a1) - ); - - for (r = 32; r--;) { - __asm__ __volatile__ ( - "lw %[t1], 0(%[dest]) \n\t" - "lw %[t2], 4(%[dest]) \n\t" - "lw %[t3], 8(%[dest]) \n\t" - "lw %[t4], 12(%[dest]) \n\t" - "addu_s.qb %[vector_1], %[t1], %[vector_a1] \n\t" - "addu_s.qb %[vector_2], %[t2], %[vector_a1] \n\t" - "addu_s.qb %[vector_3], %[t3], %[vector_a1] \n\t" - "addu_s.qb %[vector_4], %[t4], %[vector_a1] \n\t" - "sw %[vector_1], 0(%[dest]) \n\t" - "sw %[vector_2], 4(%[dest]) \n\t" - "sw %[vector_3], 8(%[dest]) \n\t" - "sw %[vector_4], 12(%[dest]) \n\t" - - "lw %[t1], 16(%[dest]) \n\t" - "lw %[t2], 20(%[dest]) \n\t" - "lw %[t3], 24(%[dest]) \n\t" - "lw %[t4], 28(%[dest]) \n\t" - "addu_s.qb %[vector_1], %[t1], %[vector_a1] \n\t" - "addu_s.qb %[vector_2], %[t2], %[vector_a1] \n\t" - "addu_s.qb %[vector_3], %[t3], %[vector_a1] \n\t" - "addu_s.qb %[vector_4], %[t4], %[vector_a1] \n\t" - "sw %[vector_1], 16(%[dest]) \n\t" - "sw %[vector_2], 20(%[dest]) \n\t" - "sw %[vector_3], 24(%[dest]) \n\t" - "sw %[vector_4], 28(%[dest]) \n\t" - - "add %[dest], %[dest], %[stride] \n\t" - - : [t1] "=&r" (t1), [t2] "=&r" (t2), [t3] "=&r" (t3), [t4] "=&r" (t4), - [vector_1] "=&r" (vector_1), [vector_2] "=&r" (vector_2), - [vector_3] "=&r" (vector_3), [vector_4] "=&r" (vector_4), - [dest] "+&r" (dest) - : [stride] "r" (stride), [vector_a1] "r" (vector_a1) - ); - } - } -} -#endif // #if HAVE_DSPR2 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_itrans4_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_itrans4_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_itrans4_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_itrans4_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,438 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vpx_config.h" -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_blockd.h" -#include "vp9/common/vp9_idct.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" - -#if HAVE_DSPR2 -static void vp9_idct4_rows_dspr2(const int16_t *input, int16_t *output) { - int16_t step_0, step_1, step_2, step_3; - int Temp0, Temp1, Temp2, Temp3; - const int const_2_power_13 = 8192; - int i; - - for (i = 4; i--; ) { - __asm__ __volatile__ ( - /* - temp_1 = (input[0] + input[2]) * cospi_16_64; - step_0 = dct_const_round_shift(temp_1); - - temp_2 = (input[0] - input[2]) * cospi_16_64; - step_1 = dct_const_round_shift(temp_2); - */ - "lh %[Temp0], 0(%[input]) \n\t" - "lh %[Temp1], 4(%[input]) \n\t" - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "add %[Temp2], %[Temp0], %[Temp1] \n\t" - "sub %[Temp3], %[Temp0], %[Temp1] \n\t" - "madd $ac0, %[Temp2], %[cospi_16_64] \n\t" - "lh %[Temp0], 2(%[input]) \n\t" - "lh %[Temp1], 6(%[input]) \n\t" - "extp %[step_0], $ac0, 31 \n\t" - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - - "madd $ac1, %[Temp3], %[cospi_16_64] \n\t" - "extp %[step_1], $ac1, 31 \n\t" - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - - /* - temp1 = input[1] * cospi_24_64 - input[3] * cospi_8_64; - step_2 = dct_const_round_shift(temp1); - */ - "madd $ac0, %[Temp0], %[cospi_24_64] \n\t" - "msub $ac0, %[Temp1], %[cospi_8_64] \n\t" - "extp %[step_2], $ac0, 31 \n\t" - - /* - temp2 = input[1] * cospi_8_64 + input[3] * cospi_24_64; - step_3 = dct_const_round_shift(temp2); - */ - "madd $ac1, %[Temp0], %[cospi_8_64] \n\t" - "madd $ac1, %[Temp1], %[cospi_24_64] \n\t" - "extp %[step_3], $ac1, 31 \n\t" - - /* - output[0] = step_0 + step_3; - output[4] = step_1 + step_2; - output[8] = step_1 - step_2; - output[12] = step_0 - step_3; - */ - "add %[Temp0], %[step_0], %[step_3] \n\t" - "sh %[Temp0], 0(%[output]) \n\t" - - "add %[Temp1], %[step_1], %[step_2] \n\t" - "sh %[Temp1], 8(%[output]) \n\t" - - "sub %[Temp2], %[step_1], %[step_2] \n\t" - "sh %[Temp2], 16(%[output]) \n\t" - - "sub %[Temp3], %[step_0], %[step_3] \n\t" - "sh %[Temp3], 24(%[output]) \n\t" - - : [Temp0] "=&r" (Temp0), [Temp1] "=&r" (Temp1), - [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3), - [step_0] "=&r" (step_0), [step_1] "=&r" (step_1), - [step_2] "=&r" (step_2), [step_3] "=&r" (step_3), - [output] "+r" (output) - : [const_2_power_13] "r" (const_2_power_13), - [cospi_8_64] "r" (cospi_8_64), [cospi_16_64] "r" (cospi_16_64), - [cospi_24_64] "r" (cospi_24_64), - [input] "r" (input) - ); - - input += 4; - output += 1; - } -} - -static void vp9_idct4_columns_add_blk_dspr2(int16_t *input, uint8_t *dest, - int dest_stride) { - int16_t step_0, step_1, step_2, step_3; - int Temp0, Temp1, Temp2, Temp3; - const int const_2_power_13 = 8192; - int i; - uint8_t *dest_pix; - uint8_t *cm = vp9_ff_cropTbl; - - /* prefetch vp9_ff_cropTbl */ - vp9_prefetch_load(vp9_ff_cropTbl); - vp9_prefetch_load(vp9_ff_cropTbl + 32); - vp9_prefetch_load(vp9_ff_cropTbl + 64); - vp9_prefetch_load(vp9_ff_cropTbl + 96); - vp9_prefetch_load(vp9_ff_cropTbl + 128); - vp9_prefetch_load(vp9_ff_cropTbl + 160); - vp9_prefetch_load(vp9_ff_cropTbl + 192); - vp9_prefetch_load(vp9_ff_cropTbl + 224); - - for (i = 0; i < 4; ++i) { - dest_pix = (dest + i); - - __asm__ __volatile__ ( - /* - temp_1 = (input[0] + input[2]) * cospi_16_64; - step_0 = dct_const_round_shift(temp_1); - - temp_2 = (input[0] - input[2]) * cospi_16_64; - step_1 = dct_const_round_shift(temp_2); - */ - "lh %[Temp0], 0(%[input]) \n\t" - "lh %[Temp1], 4(%[input]) \n\t" - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "add %[Temp2], %[Temp0], %[Temp1] \n\t" - "sub %[Temp3], %[Temp0], %[Temp1] \n\t" - "madd $ac0, %[Temp2], %[cospi_16_64] \n\t" - "lh %[Temp0], 2(%[input]) \n\t" - "lh %[Temp1], 6(%[input]) \n\t" - "extp %[step_0], $ac0, 31 \n\t" - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - - "madd $ac1, %[Temp3], %[cospi_16_64] \n\t" - "extp %[step_1], $ac1, 31 \n\t" - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - - /* - temp1 = input[1] * cospi_24_64 - input[3] * cospi_8_64; - step_2 = dct_const_round_shift(temp1); - */ - "madd $ac0, %[Temp0], %[cospi_24_64] \n\t" - "msub $ac0, %[Temp1], %[cospi_8_64] \n\t" - "extp %[step_2], $ac0, 31 \n\t" - - /* - temp2 = input[1] * cospi_8_64 + input[3] * cospi_24_64; - step_3 = dct_const_round_shift(temp2); - */ - "madd $ac1, %[Temp0], %[cospi_8_64] \n\t" - "madd $ac1, %[Temp1], %[cospi_24_64] \n\t" - "extp %[step_3], $ac1, 31 \n\t" - - /* - output[0] = step_0 + step_3; - output[4] = step_1 + step_2; - output[8] = step_1 - step_2; - output[12] = step_0 - step_3; - */ - "add %[Temp0], %[step_0], %[step_3] \n\t" - "addi %[Temp0], %[Temp0], 8 \n\t" - "sra %[Temp0], %[Temp0], 4 \n\t" - "lbu %[Temp1], 0(%[dest_pix]) \n\t" - "add %[Temp1], %[Temp1], %[Temp0] \n\t" - "add %[Temp0], %[step_1], %[step_2] \n\t" - "lbux %[Temp2], %[Temp1](%[cm]) \n\t" - "sb %[Temp2], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - "addi %[Temp0], %[Temp0], 8 \n\t" - "sra %[Temp0], %[Temp0], 4 \n\t" - "lbu %[Temp1], 0(%[dest_pix]) \n\t" - "add %[Temp1], %[Temp1], %[Temp0] \n\t" - "sub %[Temp0], %[step_1], %[step_2] \n\t" - "lbux %[Temp2], %[Temp1](%[cm]) \n\t" - "sb %[Temp2], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - "addi %[Temp0], %[Temp0], 8 \n\t" - "sra %[Temp0], %[Temp0], 4 \n\t" - "lbu %[Temp1], 0(%[dest_pix]) \n\t" - "add %[Temp1], %[Temp1], %[Temp0] \n\t" - "sub %[Temp0], %[step_0], %[step_3] \n\t" - "lbux %[Temp2], %[Temp1](%[cm]) \n\t" - "sb %[Temp2], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - "addi %[Temp0], %[Temp0], 8 \n\t" - "sra %[Temp0], %[Temp0], 4 \n\t" - "lbu %[Temp1], 0(%[dest_pix]) \n\t" - "add %[Temp1], %[Temp1], %[Temp0] \n\t" - "lbux %[Temp2], %[Temp1](%[cm]) \n\t" - "sb %[Temp2], 0(%[dest_pix]) \n\t" - - : [Temp0] "=&r" (Temp0), [Temp1] "=&r" (Temp1), - [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3), - [step_0] "=&r" (step_0), [step_1] "=&r" (step_1), - [step_2] "=&r" (step_2), [step_3] "=&r" (step_3), - [dest_pix] "+r" (dest_pix) - : [const_2_power_13] "r" (const_2_power_13), - [cospi_8_64] "r" (cospi_8_64), [cospi_16_64] "r" (cospi_16_64), - [cospi_24_64] "r" (cospi_24_64), - [input] "r" (input), [cm] "r" (cm), [dest_stride] "r" (dest_stride) - ); - - input += 4; - } -} - -void vp9_idct4x4_16_add_dspr2(const int16_t *input, uint8_t *dest, - int dest_stride) { - DECLARE_ALIGNED(32, int16_t, out[4 * 4]); - int16_t *outptr = out; - uint32_t pos = 45; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - // Rows - vp9_idct4_rows_dspr2(input, outptr); - - // Columns - vp9_idct4_columns_add_blk_dspr2(&out[0], dest, dest_stride); -} - -void vp9_idct4x4_1_add_dspr2(const int16_t *input, uint8_t *dest, - int dest_stride) { - int a1, absa1; - int r; - int32_t out; - int t2, vector_a1, vector_a; - uint32_t pos = 45; - int16_t input_dc = input[0]; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - - : - : [pos] "r" (pos) - ); - - out = DCT_CONST_ROUND_SHIFT_TWICE_COSPI_16_64(input_dc); - __asm__ __volatile__ ( - "addi %[out], %[out], 8 \n\t" - "sra %[a1], %[out], 4 \n\t" - - : [out] "+r" (out), [a1] "=r" (a1) - : - ); - - if (a1 < 0) { - /* use quad-byte - * input and output memory are four byte aligned */ - __asm__ __volatile__ ( - "abs %[absa1], %[a1] \n\t" - "replv.qb %[vector_a1], %[absa1] \n\t" - - : [absa1] "=r" (absa1), [vector_a1] "=r" (vector_a1) - : [a1] "r" (a1) - ); - - for (r = 4; r--;) { - __asm__ __volatile__ ( - "lw %[t2], 0(%[dest]) \n\t" - "subu_s.qb %[vector_a], %[t2], %[vector_a1] \n\t" - "sw %[vector_a], 0(%[dest]) \n\t" - "add %[dest], %[dest], %[dest_stride] \n\t" - - : [t2] "=&r" (t2), [vector_a] "=&r" (vector_a), - [dest] "+&r" (dest) - : [dest_stride] "r" (dest_stride), [vector_a1] "r" (vector_a1) - ); - } - } else { - /* use quad-byte - * input and output memory are four byte aligned */ - __asm__ __volatile__ ( - "replv.qb %[vector_a1], %[a1] \n\t" - : [vector_a1] "=r" (vector_a1) - : [a1] "r" (a1) - ); - - for (r = 4; r--;) { - __asm__ __volatile__ ( - "lw %[t2], 0(%[dest]) \n\t" - "addu_s.qb %[vector_a], %[t2], %[vector_a1] \n\t" - "sw %[vector_a], 0(%[dest]) \n\t" - "add %[dest], %[dest], %[dest_stride] \n\t" - - : [t2] "=&r" (t2), [vector_a] "=&r" (vector_a), - [dest] "+&r" (dest) - : [dest_stride] "r" (dest_stride), [vector_a1] "r" (vector_a1) - ); - } - } -} - -static void iadst4_dspr2(const int16_t *input, int16_t *output) { - int s0, s1, s2, s3, s4, s5, s6, s7; - int x0, x1, x2, x3; - - x0 = input[0]; - x1 = input[1]; - x2 = input[2]; - x3 = input[3]; - - if (!(x0 | x1 | x2 | x3)) { - output[0] = output[1] = output[2] = output[3] = 0; - return; - } - - s0 = sinpi_1_9 * x0; - s1 = sinpi_2_9 * x0; - s2 = sinpi_3_9 * x1; - s3 = sinpi_4_9 * x2; - s4 = sinpi_1_9 * x2; - s5 = sinpi_2_9 * x3; - s6 = sinpi_4_9 * x3; - s7 = x0 - x2 + x3; - - x0 = s0 + s3 + s5; - x1 = s1 - s4 - s6; - x2 = sinpi_3_9 * s7; - x3 = s2; - - s0 = x0 + x3; - s1 = x1 + x3; - s2 = x2; - s3 = x0 + x1 - x3; - - // 1-D transform scaling factor is sqrt(2). - // The overall dynamic range is 14b (input) + 14b (multiplication scaling) - // + 1b (addition) = 29b. - // Hence the output bit depth is 15b. - output[0] = dct_const_round_shift(s0); - output[1] = dct_const_round_shift(s1); - output[2] = dct_const_round_shift(s2); - output[3] = dct_const_round_shift(s3); -} - -void vp9_iht4x4_16_add_dspr2(const int16_t *input, uint8_t *dest, - int dest_stride, int tx_type) { - int i, j; - DECLARE_ALIGNED(32, int16_t, out[4 * 4]); - int16_t *outptr = out; - int16_t temp_in[4 * 4], temp_out[4]; - uint32_t pos = 45; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - switch (tx_type) { - case DCT_DCT: // DCT in both horizontal and vertical - vp9_idct4_rows_dspr2(input, outptr); - vp9_idct4_columns_add_blk_dspr2(&out[0], dest, dest_stride); - break; - case ADST_DCT: // ADST in vertical, DCT in horizontal - vp9_idct4_rows_dspr2(input, outptr); - - outptr = out; - - for (i = 0; i < 4; ++i) { - iadst4_dspr2(outptr, temp_out); - - for (j = 0; j < 4; ++j) - dest[j * dest_stride + i] = - clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 4) - + dest[j * dest_stride + i]); - - outptr += 4; - } - break; - case DCT_ADST: // DCT in vertical, ADST in horizontal - for (i = 0; i < 4; ++i) { - iadst4_dspr2(input, outptr); - input += 4; - outptr += 4; - } - - for (i = 0; i < 4; ++i) { - for (j = 0; j < 4; ++j) { - temp_in[i * 4 + j] = out[j * 4 + i]; - } - } - vp9_idct4_columns_add_blk_dspr2(&temp_in[0], dest, dest_stride); - break; - case ADST_ADST: // ADST in both directions - for (i = 0; i < 4; ++i) { - iadst4_dspr2(input, outptr); - input += 4; - outptr += 4; - } - - for (i = 0; i < 4; ++i) { - for (j = 0; j < 4; ++j) - temp_in[j] = out[j * 4 + i]; - iadst4_dspr2(temp_in, temp_out); - - for (j = 0; j < 4; ++j) - dest[j * dest_stride + i] = - clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 4) - + dest[j * dest_stride + i]); - } - break; - default: - printf("vp9_short_iht4x4_add_dspr2 : Invalid tx_type\n"); - break; - } -} -#endif // #if HAVE_DSPR2 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_itrans8_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_itrans8_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_itrans8_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_itrans8_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,745 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vpx_config.h" -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_blockd.h" -#include "vp9/common/vp9_idct.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" - -#if HAVE_DSPR2 -static void idct8_rows_dspr2(const int16_t *input, int16_t *output, - uint32_t no_rows) { - int step1_0, step1_1, step1_2, step1_3, step1_4, step1_5, step1_6, step1_7; - const int const_2_power_13 = 8192; - int Temp0, Temp1, Temp2, Temp3, Temp4; - int i; - - for (i = no_rows; i--; ) { - __asm__ __volatile__ ( - /* - temp_1 = (input[0] + input[4]) * cospi_16_64; - step2_0 = dct_const_round_shift(temp_1); - - temp_2 = (input[0] - input[4]) * cospi_16_64; - step2_1 = dct_const_round_shift(temp_2); - */ - "lh %[Temp0], 0(%[input]) \n\t" - "lh %[Temp1], 8(%[input]) \n\t" - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "add %[Temp2], %[Temp0], %[Temp1] \n\t" - "madd $ac0, %[Temp2], %[cospi_16_64] \n\t" - "extp %[Temp4], $ac0, 31 \n\t" - - "sub %[Temp3], %[Temp0], %[Temp1] \n\t" - "madd $ac1, %[Temp3], %[cospi_16_64] \n\t" - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "extp %[Temp2], $ac1, 31 \n\t" - - /* - temp_1 = input[2] * cospi_24_64 - input[6] * cospi_8_64; - step2_2 = dct_const_round_shift(temp_1); - */ - "lh %[Temp0], 4(%[input]) \n\t" - "lh %[Temp1], 12(%[input]) \n\t" - "madd $ac0, %[Temp0], %[cospi_24_64] \n\t" - "msub $ac0, %[Temp1], %[cospi_8_64] \n\t" - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "extp %[Temp3], $ac0, 31 \n\t" - - /* - step1_1 = step2_1 + step2_2; - step1_2 = step2_1 - step2_2; - */ - "add %[step1_1], %[Temp2], %[Temp3] \n\t" - "sub %[step1_2], %[Temp2], %[Temp3] \n\t" - - /* - temp_2 = input[2] * cospi_8_64 + input[6] * cospi_24_64; - step2_3 = dct_const_round_shift(temp_2); - */ - "madd $ac1, %[Temp0], %[cospi_8_64] \n\t" - "madd $ac1, %[Temp1], %[cospi_24_64] \n\t" - "extp %[Temp1], $ac1, 31 \n\t" - - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - - /* - step1_0 = step2_0 + step2_3; - step1_3 = step2_0 - step2_3; - */ - "add %[step1_0], %[Temp4], %[Temp1] \n\t" - "sub %[step1_3], %[Temp4], %[Temp1] \n\t" - - /* - temp_1 = input[1] * cospi_28_64 - input[7] * cospi_4_64; - step1_4 = dct_const_round_shift(temp_1); - */ - "lh %[Temp0], 2(%[input]) \n\t" - "madd $ac0, %[Temp0], %[cospi_28_64] \n\t" - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "lh %[Temp1], 14(%[input]) \n\t" - "lh %[Temp0], 2(%[input]) \n\t" - "msub $ac0, %[Temp1], %[cospi_4_64] \n\t" - "extp %[step1_4], $ac0, 31 \n\t" - - /* - temp_2 = input[1] * cospi_4_64 + input[7] * cospi_28_64; - step1_7 = dct_const_round_shift(temp_2); - */ - "madd $ac1, %[Temp0], %[cospi_4_64] \n\t" - "madd $ac1, %[Temp1], %[cospi_28_64] \n\t" - "extp %[step1_7], $ac1, 31 \n\t" - - /* - temp_1 = input[5] * cospi_12_64 - input[3] * cospi_20_64; - step1_5 = dct_const_round_shift(temp_1); - */ - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "lh %[Temp0], 10(%[input]) \n\t" - "madd $ac0, %[Temp0], %[cospi_12_64] \n\t" - "lh %[Temp1], 6(%[input]) \n\t" - "msub $ac0, %[Temp1], %[cospi_20_64] \n\t" - "extp %[step1_5], $ac0, 31 \n\t" - - /* - temp_2 = input[5] * cospi_20_64 + input[3] * cospi_12_64; - step1_6 = dct_const_round_shift(temp_2); - */ - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "lh %[Temp0], 10(%[input]) \n\t" - "madd $ac1, %[Temp0], %[cospi_20_64] \n\t" - "lh %[Temp1], 6(%[input]) \n\t" - "madd $ac1, %[Temp1], %[cospi_12_64] \n\t" - "extp %[step1_6], $ac1, 31 \n\t" - - /* - temp_1 = (step1_7 - step1_6 - step1_4 + step1_5) * cospi_16_64; - temp_2 = (step1_4 - step1_5 - step1_6 + step1_7) * cospi_16_64; - */ - "sub %[Temp0], %[step1_7], %[step1_6] \n\t" - "sub %[Temp0], %[Temp0], %[step1_4] \n\t" - "add %[Temp0], %[Temp0], %[step1_5] \n\t" - "sub %[Temp1], %[step1_4], %[step1_5] \n\t" - "sub %[Temp1], %[Temp1], %[step1_6] \n\t" - "add %[Temp1], %[Temp1], %[step1_7] \n\t" - - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - - "madd $ac0, %[Temp0], %[cospi_16_64] \n\t" - "madd $ac1, %[Temp1], %[cospi_16_64] \n\t" - - /* - step1_4 = step1_4 + step1_5; - step1_7 = step1_6 + step1_7; - */ - "add %[step1_4], %[step1_4], %[step1_5] \n\t" - "add %[step1_7], %[step1_7], %[step1_6] \n\t" - - "extp %[step1_5], $ac0, 31 \n\t" - "extp %[step1_6], $ac1, 31 \n\t" - - "add %[Temp0], %[step1_0], %[step1_7] \n\t" - "sh %[Temp0], 0(%[output]) \n\t" - "add %[Temp1], %[step1_1], %[step1_6] \n\t" - "sh %[Temp1], 16(%[output]) \n\t" - "add %[Temp0], %[step1_2], %[step1_5] \n\t" - "sh %[Temp0], 32(%[output]) \n\t" - "add %[Temp1], %[step1_3], %[step1_4] \n\t" - "sh %[Temp1], 48(%[output]) \n\t" - - "sub %[Temp0], %[step1_3], %[step1_4] \n\t" - "sh %[Temp0], 64(%[output]) \n\t" - "sub %[Temp1], %[step1_2], %[step1_5] \n\t" - "sh %[Temp1], 80(%[output]) \n\t" - "sub %[Temp0], %[step1_1], %[step1_6] \n\t" - "sh %[Temp0], 96(%[output]) \n\t" - "sub %[Temp1], %[step1_0], %[step1_7] \n\t" - "sh %[Temp1], 112(%[output]) \n\t" - - : [step1_0] "=&r" (step1_0), [step1_1] "=&r" (step1_1), - [step1_2] "=&r" (step1_2), [step1_3] "=&r" (step1_3), - [step1_4] "=&r" (step1_4), [step1_5] "=&r" (step1_5), - [step1_6] "=&r" (step1_6), [step1_7] "=&r" (step1_7), - [Temp0] "=&r" (Temp0), [Temp1] "=&r" (Temp1), - [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3), - [Temp4] "=&r" (Temp4) - : [const_2_power_13] "r" (const_2_power_13), - [cospi_16_64] "r" (cospi_16_64), [cospi_28_64] "r" (cospi_28_64), - [cospi_4_64] "r" (cospi_4_64), [cospi_12_64] "r" (cospi_12_64), - [cospi_20_64] "r" (cospi_20_64), [cospi_8_64] "r" (cospi_8_64), - [cospi_24_64] "r" (cospi_24_64), - [output] "r" (output), [input] "r" (input) - ); - - input += 8; - output += 1; - } -} - -static void idct8_columns_add_blk_dspr2(int16_t *input, uint8_t *dest, - int dest_stride) { - int step1_0, step1_1, step1_2, step1_3, step1_4, step1_5, step1_6, step1_7; - int Temp0, Temp1, Temp2, Temp3; - int i; - const int const_2_power_13 = 8192; - uint8_t *dest_pix; - uint8_t *cm = vp9_ff_cropTbl; - - /* prefetch vp9_ff_cropTbl */ - vp9_prefetch_load(vp9_ff_cropTbl); - vp9_prefetch_load(vp9_ff_cropTbl + 32); - vp9_prefetch_load(vp9_ff_cropTbl + 64); - vp9_prefetch_load(vp9_ff_cropTbl + 96); - vp9_prefetch_load(vp9_ff_cropTbl + 128); - vp9_prefetch_load(vp9_ff_cropTbl + 160); - vp9_prefetch_load(vp9_ff_cropTbl + 192); - vp9_prefetch_load(vp9_ff_cropTbl + 224); - - for (i = 0; i < 8; ++i) { - dest_pix = (dest + i); - - __asm__ __volatile__ ( - /* - temp_1 = (input[0] + input[4]) * cospi_16_64; - step2_0 = dct_const_round_shift(temp_1); - - temp_2 = (input[0] - input[4]) * cospi_16_64; - step2_1 = dct_const_round_shift(temp_2); - */ - "lh %[Temp0], 0(%[input]) \n\t" - "lh %[Temp1], 8(%[input]) \n\t" - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "add %[Temp2], %[Temp0], %[Temp1] \n\t" - "madd $ac0, %[Temp2], %[cospi_16_64] \n\t" - "extp %[step1_6], $ac0, 31 \n\t" - - "sub %[Temp3], %[Temp0], %[Temp1] \n\t" - "madd $ac1, %[Temp3], %[cospi_16_64] \n\t" - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "extp %[Temp2], $ac1, 31 \n\t" - - /* - temp_1 = input[2] * cospi_24_64 - input[6] * cospi_8_64; - step2_2 = dct_const_round_shift(temp_1); - */ - "lh %[Temp0], 4(%[input]) \n\t" - "lh %[Temp1], 12(%[input]) \n\t" - "madd $ac0, %[Temp0], %[cospi_24_64] \n\t" - "msub $ac0, %[Temp1], %[cospi_8_64] \n\t" - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "extp %[Temp3], $ac0, 31 \n\t" - - /* - step1_1 = step2_1 + step2_2; - step1_2 = step2_1 - step2_2; - */ - "add %[step1_1], %[Temp2], %[Temp3] \n\t" - "sub %[step1_2], %[Temp2], %[Temp3] \n\t" - - /* - temp_2 = input[2] * cospi_8_64 + input[6] * cospi_24_64; - step2_3 = dct_const_round_shift(temp_2); - */ - "madd $ac1, %[Temp0], %[cospi_8_64] \n\t" - "madd $ac1, %[Temp1], %[cospi_24_64] \n\t" - "extp %[Temp1], $ac1, 31 \n\t" - - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - - /* - step1_0 = step2_0 + step2_3; - step1_3 = step2_0 - step2_3; - */ - "add %[step1_0], %[step1_6], %[Temp1] \n\t" - "sub %[step1_3], %[step1_6], %[Temp1] \n\t" - - /* - temp_1 = input[1] * cospi_28_64 - input[7] * cospi_4_64; - step1_4 = dct_const_round_shift(temp_1); - */ - "lh %[Temp0], 2(%[input]) \n\t" - "madd $ac0, %[Temp0], %[cospi_28_64] \n\t" - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "lh %[Temp1], 14(%[input]) \n\t" - "lh %[Temp0], 2(%[input]) \n\t" - "msub $ac0, %[Temp1], %[cospi_4_64] \n\t" - "extp %[step1_4], $ac0, 31 \n\t" - - /* - temp_2 = input[1] * cospi_4_64 + input[7] * cospi_28_64; - step1_7 = dct_const_round_shift(temp_2); - */ - "madd $ac1, %[Temp0], %[cospi_4_64] \n\t" - "madd $ac1, %[Temp1], %[cospi_28_64] \n\t" - "extp %[step1_7], $ac1, 31 \n\t" - - /* - temp_1 = input[5] * cospi_12_64 - input[3] * cospi_20_64; - step1_5 = dct_const_round_shift(temp_1); - */ - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "lh %[Temp0], 10(%[input]) \n\t" - "madd $ac0, %[Temp0], %[cospi_12_64] \n\t" - "lh %[Temp1], 6(%[input]) \n\t" - "msub $ac0, %[Temp1], %[cospi_20_64] \n\t" - "extp %[step1_5], $ac0, 31 \n\t" - - /* - temp_2 = input[5] * cospi_20_64 + input[3] * cospi_12_64; - step1_6 = dct_const_round_shift(temp_2); - */ - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - "lh %[Temp0], 10(%[input]) \n\t" - "madd $ac1, %[Temp0], %[cospi_20_64] \n\t" - "lh %[Temp1], 6(%[input]) \n\t" - "madd $ac1, %[Temp1], %[cospi_12_64] \n\t" - "extp %[step1_6], $ac1, 31 \n\t" - - /* - temp_1 = (step1_7 - step1_6 - step1_4 + step1_5) * cospi_16_64; - temp_2 = (step1_4 - step1_5 - step1_6 + step1_7) * cospi_16_64; - */ - "sub %[Temp0], %[step1_7], %[step1_6] \n\t" - "sub %[Temp0], %[Temp0], %[step1_4] \n\t" - "add %[Temp0], %[Temp0], %[step1_5] \n\t" - "sub %[Temp1], %[step1_4], %[step1_5] \n\t" - "sub %[Temp1], %[Temp1], %[step1_6] \n\t" - "add %[Temp1], %[Temp1], %[step1_7] \n\t" - - "mtlo %[const_2_power_13], $ac0 \n\t" - "mthi $zero, $ac0 \n\t" - "mtlo %[const_2_power_13], $ac1 \n\t" - "mthi $zero, $ac1 \n\t" - - "madd $ac0, %[Temp0], %[cospi_16_64] \n\t" - "madd $ac1, %[Temp1], %[cospi_16_64] \n\t" - - /* - step1_4 = step1_4 + step1_5; - step1_7 = step1_6 + step1_7; - */ - "add %[step1_4], %[step1_4], %[step1_5] \n\t" - "add %[step1_7], %[step1_7], %[step1_6] \n\t" - - "extp %[step1_5], $ac0, 31 \n\t" - "extp %[step1_6], $ac1, 31 \n\t" - - /* add block */ - "lbu %[Temp1], 0(%[dest_pix]) \n\t" - "add %[Temp0], %[step1_0], %[step1_7] \n\t" - "addi %[Temp0], %[Temp0], 16 \n\t" - "sra %[Temp0], %[Temp0], 5 \n\t" - "add %[Temp1], %[Temp1], %[Temp0] \n\t" - "add %[Temp0], %[step1_1], %[step1_6] \n\t" - "lbux %[Temp2], %[Temp1](%[cm]) \n\t" - "sb %[Temp2], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - "lbu %[Temp1], 0(%[dest_pix]) \n\t" - "addi %[Temp0], %[Temp0], 16 \n\t" - "sra %[Temp0], %[Temp0], 5 \n\t" - "add %[Temp1], %[Temp1], %[Temp0] \n\t" - "add %[Temp0], %[step1_2], %[step1_5] \n\t" - "lbux %[Temp2], %[Temp1](%[cm]) \n\t" - "sb %[Temp2], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - "lbu %[Temp1], 0(%[dest_pix]) \n\t" - "addi %[Temp0], %[Temp0], 16 \n\t" - "sra %[Temp0], %[Temp0], 5 \n\t" - "add %[Temp1], %[Temp1], %[Temp0] \n\t" - "add %[Temp0], %[step1_3], %[step1_4] \n\t" - "lbux %[Temp2], %[Temp1](%[cm]) \n\t" - "sb %[Temp2], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - "lbu %[Temp1], 0(%[dest_pix]) \n\t" - "addi %[Temp0], %[Temp0], 16 \n\t" - "sra %[Temp0], %[Temp0], 5 \n\t" - "add %[Temp1], %[Temp1], %[Temp0] \n\t" - "sub %[Temp0], %[step1_3], %[step1_4] \n\t" - "lbux %[Temp2], %[Temp1](%[cm]) \n\t" - "sb %[Temp2], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - "lbu %[Temp1], 0(%[dest_pix]) \n\t" - "addi %[Temp0], %[Temp0], 16 \n\t" - "sra %[Temp0], %[Temp0], 5 \n\t" - "add %[Temp1], %[Temp1], %[Temp0] \n\t" - "sub %[Temp0], %[step1_2], %[step1_5] \n\t" - "lbux %[Temp2], %[Temp1](%[cm]) \n\t" - "sb %[Temp2], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - "lbu %[Temp1], 0(%[dest_pix]) \n\t" - "addi %[Temp0], %[Temp0], 16 \n\t" - "sra %[Temp0], %[Temp0], 5 \n\t" - "add %[Temp1], %[Temp1], %[Temp0] \n\t" - "sub %[Temp0], %[step1_1], %[step1_6] \n\t" - "lbux %[Temp2], %[Temp1](%[cm]) \n\t" - "sb %[Temp2], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - "lbu %[Temp1], 0(%[dest_pix]) \n\t" - "addi %[Temp0], %[Temp0], 16 \n\t" - "sra %[Temp0], %[Temp0], 5 \n\t" - "add %[Temp1], %[Temp1], %[Temp0] \n\t" - "sub %[Temp0], %[step1_0], %[step1_7] \n\t" - "lbux %[Temp2], %[Temp1](%[cm]) \n\t" - "sb %[Temp2], 0(%[dest_pix]) \n\t" - "addu %[dest_pix], %[dest_pix], %[dest_stride] \n\t" - - "lbu %[Temp1], 0(%[dest_pix]) \n\t" - "addi %[Temp0], %[Temp0], 16 \n\t" - "sra %[Temp0], %[Temp0], 5 \n\t" - "add %[Temp1], %[Temp1], %[Temp0] \n\t" - "lbux %[Temp2], %[Temp1](%[cm]) \n\t" - "sb %[Temp2], 0(%[dest_pix]) \n\t" - - : [step1_0] "=&r" (step1_0), [step1_1] "=&r" (step1_1), - [step1_2] "=&r" (step1_2), [step1_3] "=&r" (step1_3), - [step1_4] "=&r" (step1_4), [step1_5] "=&r" (step1_5), - [step1_6] "=&r" (step1_6), [step1_7] "=&r" (step1_7), - [Temp0] "=&r" (Temp0), [Temp1] "=&r" (Temp1), - [Temp2] "=&r" (Temp2), [Temp3] "=&r" (Temp3), - [dest_pix] "+r" (dest_pix) - : [const_2_power_13] "r" (const_2_power_13), - [cospi_16_64] "r" (cospi_16_64), [cospi_28_64] "r" (cospi_28_64), - [cospi_4_64] "r" (cospi_4_64), [cospi_12_64] "r" (cospi_12_64), - [cospi_20_64] "r" (cospi_20_64), [cospi_8_64] "r" (cospi_8_64), - [cospi_24_64] "r" (cospi_24_64), - [input] "r" (input), [cm] "r" (cm), [dest_stride] "r" (dest_stride) - ); - - input += 8; - } -} - -void vp9_idct8x8_64_add_dspr2(const int16_t *input, uint8_t *dest, - int dest_stride) { - DECLARE_ALIGNED(32, int16_t, out[8 * 8]); - int16_t *outptr = out; - uint32_t pos = 45; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - // First transform rows - idct8_rows_dspr2(input, outptr, 8); - - // Then transform columns and add to dest - idct8_columns_add_blk_dspr2(&out[0], dest, dest_stride); -} - -static void iadst8_dspr2(const int16_t *input, int16_t *output) { - int s0, s1, s2, s3, s4, s5, s6, s7; - int x0, x1, x2, x3, x4, x5, x6, x7; - - x0 = input[7]; - x1 = input[0]; - x2 = input[5]; - x3 = input[2]; - x4 = input[3]; - x5 = input[4]; - x6 = input[1]; - x7 = input[6]; - - if (!(x0 | x1 | x2 | x3 | x4 | x5 | x6 | x7)) { - output[0] = output[1] = output[2] = output[3] = output[4] - = output[5] = output[6] = output[7] = 0; - return; - } - - // stage 1 - s0 = cospi_2_64 * x0 + cospi_30_64 * x1; - s1 = cospi_30_64 * x0 - cospi_2_64 * x1; - s2 = cospi_10_64 * x2 + cospi_22_64 * x3; - s3 = cospi_22_64 * x2 - cospi_10_64 * x3; - s4 = cospi_18_64 * x4 + cospi_14_64 * x5; - s5 = cospi_14_64 * x4 - cospi_18_64 * x5; - s6 = cospi_26_64 * x6 + cospi_6_64 * x7; - s7 = cospi_6_64 * x6 - cospi_26_64 * x7; - - x0 = ROUND_POWER_OF_TWO((s0 + s4), DCT_CONST_BITS); - x1 = ROUND_POWER_OF_TWO((s1 + s5), DCT_CONST_BITS); - x2 = ROUND_POWER_OF_TWO((s2 + s6), DCT_CONST_BITS); - x3 = ROUND_POWER_OF_TWO((s3 + s7), DCT_CONST_BITS); - x4 = ROUND_POWER_OF_TWO((s0 - s4), DCT_CONST_BITS); - x5 = ROUND_POWER_OF_TWO((s1 - s5), DCT_CONST_BITS); - x6 = ROUND_POWER_OF_TWO((s2 - s6), DCT_CONST_BITS); - x7 = ROUND_POWER_OF_TWO((s3 - s7), DCT_CONST_BITS); - - // stage 2 - s0 = x0; - s1 = x1; - s2 = x2; - s3 = x3; - s4 = cospi_8_64 * x4 + cospi_24_64 * x5; - s5 = cospi_24_64 * x4 - cospi_8_64 * x5; - s6 = -cospi_24_64 * x6 + cospi_8_64 * x7; - s7 = cospi_8_64 * x6 + cospi_24_64 * x7; - - x0 = s0 + s2; - x1 = s1 + s3; - x2 = s0 - s2; - x3 = s1 - s3; - x4 = ROUND_POWER_OF_TWO((s4 + s6), DCT_CONST_BITS); - x5 = ROUND_POWER_OF_TWO((s5 + s7), DCT_CONST_BITS); - x6 = ROUND_POWER_OF_TWO((s4 - s6), DCT_CONST_BITS); - x7 = ROUND_POWER_OF_TWO((s5 - s7), DCT_CONST_BITS); - - // stage 3 - s2 = cospi_16_64 * (x2 + x3); - s3 = cospi_16_64 * (x2 - x3); - s6 = cospi_16_64 * (x6 + x7); - s7 = cospi_16_64 * (x6 - x7); - - x2 = ROUND_POWER_OF_TWO((s2), DCT_CONST_BITS); - x3 = ROUND_POWER_OF_TWO((s3), DCT_CONST_BITS); - x6 = ROUND_POWER_OF_TWO((s6), DCT_CONST_BITS); - x7 = ROUND_POWER_OF_TWO((s7), DCT_CONST_BITS); - - output[0] = x0; - output[1] = -x4; - output[2] = x6; - output[3] = -x2; - output[4] = x3; - output[5] = -x7; - output[6] = x5; - output[7] = -x1; -} - -void vp9_iht8x8_64_add_dspr2(const int16_t *input, uint8_t *dest, - int dest_stride, int tx_type) { - int i, j; - DECLARE_ALIGNED(32, int16_t, out[8 * 8]); - int16_t *outptr = out; - int16_t temp_in[8 * 8], temp_out[8]; - uint32_t pos = 45; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - switch (tx_type) { - case DCT_DCT: // DCT in both horizontal and vertical - idct8_rows_dspr2(input, outptr, 8); - idct8_columns_add_blk_dspr2(&out[0], dest, dest_stride); - break; - case ADST_DCT: // ADST in vertical, DCT in horizontal - idct8_rows_dspr2(input, outptr, 8); - - for (i = 0; i < 8; ++i) { - iadst8_dspr2(&out[i * 8], temp_out); - - for (j = 0; j < 8; ++j) - dest[j * dest_stride + i] = - clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 5) - + dest[j * dest_stride + i]); - } - break; - case DCT_ADST: // DCT in vertical, ADST in horizontal - for (i = 0; i < 8; ++i) { - iadst8_dspr2(input, outptr); - input += 8; - outptr += 8; - } - - for (i = 0; i < 8; ++i) { - for (j = 0; j < 8; ++j) { - temp_in[i * 8 + j] = out[j * 8 + i]; - } - } - idct8_columns_add_blk_dspr2(&temp_in[0], dest, dest_stride); - break; - case ADST_ADST: // ADST in both directions - for (i = 0; i < 8; ++i) { - iadst8_dspr2(input, outptr); - input += 8; - outptr += 8; - } - - for (i = 0; i < 8; ++i) { - for (j = 0; j < 8; ++j) - temp_in[j] = out[j * 8 + i]; - - iadst8_dspr2(temp_in, temp_out); - - for (j = 0; j < 8; ++j) - dest[j * dest_stride + i] = - clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 5) - + dest[j * dest_stride + i]); - } - break; - default: - printf("vp9_short_iht8x8_add_dspr2 : Invalid tx_type\n"); - break; - } -} - -void vp9_idct8x8_12_add_dspr2(const int16_t *input, uint8_t *dest, - int dest_stride) { - DECLARE_ALIGNED(32, int16_t, out[8 * 8]); - int16_t *outptr = out; - uint32_t pos = 45; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - : - : [pos] "r" (pos) - ); - - // First transform rows - idct8_rows_dspr2(input, outptr, 4); - - outptr += 4; - - __asm__ __volatile__ ( - "sw $zero, 0(%[outptr]) \n\t" - "sw $zero, 4(%[outptr]) \n\t" - "sw $zero, 16(%[outptr]) \n\t" - "sw $zero, 20(%[outptr]) \n\t" - "sw $zero, 32(%[outptr]) \n\t" - "sw $zero, 36(%[outptr]) \n\t" - "sw $zero, 48(%[outptr]) \n\t" - "sw $zero, 52(%[outptr]) \n\t" - "sw $zero, 64(%[outptr]) \n\t" - "sw $zero, 68(%[outptr]) \n\t" - "sw $zero, 80(%[outptr]) \n\t" - "sw $zero, 84(%[outptr]) \n\t" - "sw $zero, 96(%[outptr]) \n\t" - "sw $zero, 100(%[outptr]) \n\t" - "sw $zero, 112(%[outptr]) \n\t" - "sw $zero, 116(%[outptr]) \n\t" - - : - : [outptr] "r" (outptr) - ); - - - // Then transform columns and add to dest - idct8_columns_add_blk_dspr2(&out[0], dest, dest_stride); -} - -void vp9_idct8x8_1_add_dspr2(const int16_t *input, uint8_t *dest, - int dest_stride) { - uint32_t pos = 45; - int32_t out; - int32_t r; - int32_t a1, absa1; - int32_t t1, t2, vector_a1, vector_1, vector_2; - - /* bit positon for extract from acc */ - __asm__ __volatile__ ( - "wrdsp %[pos], 1 \n\t" - - : - : [pos] "r" (pos) - ); - - out = DCT_CONST_ROUND_SHIFT_TWICE_COSPI_16_64(input[0]); - __asm__ __volatile__ ( - "addi %[out], %[out], 16 \n\t" - "sra %[a1], %[out], 5 \n\t" - - : [out] "+r" (out), [a1] "=r" (a1) - : - ); - - if (a1 < 0) { - /* use quad-byte - * input and output memory are four byte aligned */ - __asm__ __volatile__ ( - "abs %[absa1], %[a1] \n\t" - "replv.qb %[vector_a1], %[absa1] \n\t" - - : [absa1] "=r" (absa1), [vector_a1] "=r" (vector_a1) - : [a1] "r" (a1) - ); - - for (r = 8; r--;) { - __asm__ __volatile__ ( - "lw %[t1], 0(%[dest]) \n\t" - "lw %[t2], 4(%[dest]) \n\t" - "subu_s.qb %[vector_1], %[t1], %[vector_a1] \n\t" - "subu_s.qb %[vector_2], %[t2], %[vector_a1] \n\t" - "sw %[vector_1], 0(%[dest]) \n\t" - "sw %[vector_2], 4(%[dest]) \n\t" - "add %[dest], %[dest], %[dest_stride] \n\t" - - : [t1] "=&r" (t1), [t2] "=&r" (t2), - [vector_1] "=&r" (vector_1), [vector_2] "=&r" (vector_2), - [dest] "+&r" (dest) - : [dest_stride] "r" (dest_stride), [vector_a1] "r" (vector_a1) - ); - } - } else { - /* use quad-byte - * input and output memory are four byte aligned */ - __asm__ __volatile__ ( - "replv.qb %[vector_a1], %[a1] \n\t" - - : [vector_a1] "=r" (vector_a1) - : [a1] "r" (a1) - ); - - for (r = 8; r--;) { - __asm__ __volatile__ ( - "lw %[t1], 0(%[dest]) \n\t" - "lw %[t2], 4(%[dest]) \n\t" - "addu_s.qb %[vector_1], %[t1], %[vector_a1] \n\t" - "addu_s.qb %[vector_2], %[t2], %[vector_a1] \n\t" - "sw %[vector_1], 0(%[dest]) \n\t" - "sw %[vector_2], 4(%[dest]) \n\t" - "add %[dest], %[dest], %[dest_stride] \n\t" - - : [t1] "=&r" (t1), [t2] "=&r" (t2), - [vector_1] "=&r" (vector_1), [vector_2] "=&r" (vector_2), - [dest] "+r" (dest) - : [dest_stride] "r" (dest_stride), [vector_a1] "r" (vector_a1) - ); - } - } -} -#endif // #if HAVE_DSPR2 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,362 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_loopfilter.h" -#include "vp9/common/vp9_onyxc_int.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" -#include "vp9/common/mips/dspr2/vp9_loopfilter_macros_dspr2.h" -#include "vp9/common/mips/dspr2/vp9_loopfilter_masks_dspr2.h" -#include "vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.h" - -#if HAVE_DSPR2 -void vp9_lpf_horizontal_4_dspr2(unsigned char *s, - int pitch, - const uint8_t *blimit, - const uint8_t *limit, - const uint8_t *thresh, - int count) { - uint8_t i; - uint32_t mask; - uint32_t hev; - uint32_t pm1, p0, p1, p2, p3, p4, p5, p6; - uint8_t *sm1, *s0, *s1, *s2, *s3, *s4, *s5, *s6; - uint32_t thresh_vec, flimit_vec, limit_vec; - uint32_t uflimit, ulimit, uthresh; - - uflimit = *blimit; - ulimit = *limit; - uthresh = *thresh; - - /* create quad-byte */ - __asm__ __volatile__ ( - "replv.qb %[thresh_vec], %[uthresh] \n\t" - "replv.qb %[flimit_vec], %[uflimit] \n\t" - "replv.qb %[limit_vec], %[ulimit] \n\t" - - : [thresh_vec] "=&r" (thresh_vec), [flimit_vec] "=&r" (flimit_vec), - [limit_vec] "=r" (limit_vec) - : [uthresh] "r" (uthresh), [uflimit] "r" (uflimit), [ulimit] "r" (ulimit) - ); - - /* prefetch data for store */ - vp9_prefetch_store(s); - - /* loop filter designed to work using chars so that we can make maximum use - of 8 bit simd instructions. */ - for (i = 0; i < 2; i++) { - sm1 = s - (pitch << 2); - s0 = sm1 + pitch; - s1 = s0 + pitch; - s2 = s - pitch; - s3 = s; - s4 = s + pitch; - s5 = s4 + pitch; - s6 = s5 + pitch; - - __asm__ __volatile__ ( - "lw %[p1], (%[s1]) \n\t" - "lw %[p2], (%[s2]) \n\t" - "lw %[p3], (%[s3]) \n\t" - "lw %[p4], (%[s4]) \n\t" - - : [p1] "=&r" (p1), [p2] "=&r" (p2), [p3] "=&r" (p3), [p4] "=&r" (p4) - : [s1] "r" (s1), [s2] "r" (s2), [s3] "r" (s3), [s4] "r" (s4) - ); - - /* if (p1 - p4 == 0) and (p2 - p3 == 0) - mask will be zero and filtering is not needed */ - if (!(((p1 - p4) == 0) && ((p2 - p3) == 0))) { - __asm__ __volatile__ ( - "lw %[pm1], (%[sm1]) \n\t" - "lw %[p0], (%[s0]) \n\t" - "lw %[p5], (%[s5]) \n\t" - "lw %[p6], (%[s6]) \n\t" - - : [pm1] "=&r" (pm1), [p0] "=&r" (p0), [p5] "=&r" (p5), - [p6] "=&r" (p6) - : [sm1] "r" (sm1), [s0] "r" (s0), [s5] "r" (s5), [s6] "r" (s6) - ); - - vp9_filter_hev_mask_dspr2(limit_vec, flimit_vec, p1, p2, - pm1, p0, p3, p4, p5, p6, - thresh_vec, &hev, &mask); - - /* if mask == 0 do filtering is not needed */ - if (mask) { - /* filtering */ - vp9_filter_dspr2(mask, hev, &p1, &p2, &p3, &p4); - - __asm__ __volatile__ ( - "sw %[p1], (%[s1]) \n\t" - "sw %[p2], (%[s2]) \n\t" - "sw %[p3], (%[s3]) \n\t" - "sw %[p4], (%[s4]) \n\t" - - : - : [p1] "r" (p1), [p2] "r" (p2), [p3] "r" (p3), [p4] "r" (p4), - [s1] "r" (s1), [s2] "r" (s2), [s3] "r" (s3), [s4] "r" (s4) - ); - } - } - - s = s + 4; - } -} - -void vp9_lpf_vertical_4_dspr2(unsigned char *s, - int pitch, - const uint8_t *blimit, - const uint8_t *limit, - const uint8_t *thresh, - int count) { - uint8_t i; - uint32_t mask, hev; - uint32_t pm1, p0, p1, p2, p3, p4, p5, p6; - uint8_t *s1, *s2, *s3, *s4; - uint32_t prim1, prim2, sec3, sec4, prim3, prim4; - uint32_t thresh_vec, flimit_vec, limit_vec; - uint32_t uflimit, ulimit, uthresh; - - uflimit = *blimit; - ulimit = *limit; - uthresh = *thresh; - - /* create quad-byte */ - __asm__ __volatile__ ( - "replv.qb %[thresh_vec], %[uthresh] \n\t" - "replv.qb %[flimit_vec], %[uflimit] \n\t" - "replv.qb %[limit_vec], %[ulimit] \n\t" - - : [thresh_vec] "=&r" (thresh_vec), [flimit_vec] "=&r" (flimit_vec), - [limit_vec] "=r" (limit_vec) - : [uthresh] "r" (uthresh), [uflimit] "r" (uflimit), [ulimit] "r" (ulimit) - ); - - /* prefetch data for store */ - vp9_prefetch_store(s + pitch); - - for (i = 0; i < 2; i++) { - s1 = s; - s2 = s + pitch; - s3 = s2 + pitch; - s4 = s3 + pitch; - s = s4 + pitch; - - /* load quad-byte vectors - * memory is 4 byte aligned - */ - p2 = *((uint32_t *)(s1 - 4)); - p6 = *((uint32_t *)(s1)); - p1 = *((uint32_t *)(s2 - 4)); - p5 = *((uint32_t *)(s2)); - p0 = *((uint32_t *)(s3 - 4)); - p4 = *((uint32_t *)(s3)); - pm1 = *((uint32_t *)(s4 - 4)); - p3 = *((uint32_t *)(s4)); - - /* transpose pm1, p0, p1, p2 */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[p2], %[p1] \n\t" - "precr.qb.ph %[prim2], %[p2], %[p1] \n\t" - "precrq.qb.ph %[prim3], %[p0], %[pm1] \n\t" - "precr.qb.ph %[prim4], %[p0], %[pm1] \n\t" - - "precrq.qb.ph %[p1], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[pm1], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[p2], %[p1], %[sec3] \n\t" - "precrq.ph.w %[p0], %[pm1], %[sec4] \n\t" - "append %[p1], %[sec3], 16 \n\t" - "append %[pm1], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [p2] "+r" (p2), [p1] "+r" (p1), [p0] "+r" (p0), [pm1] "+r" (pm1), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - /* transpose p3, p4, p5, p6 */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[p6], %[p5] \n\t" - "precr.qb.ph %[prim2], %[p6], %[p5] \n\t" - "precrq.qb.ph %[prim3], %[p4], %[p3] \n\t" - "precr.qb.ph %[prim4], %[p4], %[p3] \n\t" - - "precrq.qb.ph %[p5], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[p3], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[p6], %[p5], %[sec3] \n\t" - "precrq.ph.w %[p4], %[p3], %[sec4] \n\t" - "append %[p5], %[sec3], 16 \n\t" - "append %[p3], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [p6] "+r" (p6), [p5] "+r" (p5), [p4] "+r" (p4), [p3] "+r" (p3), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - /* if (p1 - p4 == 0) and (p2 - p3 == 0) - * mask will be zero and filtering is not needed - */ - if (!(((p1 - p4) == 0) && ((p2 - p3) == 0))) { - vp9_filter_hev_mask_dspr2(limit_vec, flimit_vec, p1, p2, pm1, - p0, p3, p4, p5, p6, thresh_vec, - &hev, &mask); - - /* if mask == 0 do filtering is not needed */ - if (mask) { - /* filtering */ - vp9_filter_dspr2(mask, hev, &p1, &p2, &p3, &p4); - - /* unpack processed 4x4 neighborhood - * don't use transpose on output data - * because memory isn't aligned - */ - __asm__ __volatile__ ( - "sb %[p4], 1(%[s4]) \n\t" - "sb %[p3], 0(%[s4]) \n\t" - "sb %[p2], -1(%[s4]) \n\t" - "sb %[p1], -2(%[s4]) \n\t" - - : - : [p4] "r" (p4), [p3] "r" (p3), [p2] "r" (p2), [p1] "r" (p1), - [s4] "r" (s4) - ); - - __asm__ __volatile__ ( - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - - : [p4] "+r" (p4), [p3] "+r" (p3), [p2] "+r" (p2), [p1] "+r" (p1) - : - ); - - __asm__ __volatile__ ( - "sb %[p4], 1(%[s3]) \n\t" - "sb %[p3], 0(%[s3]) \n\t" - "sb %[p2], -1(%[s3]) \n\t" - "sb %[p1], -2(%[s3]) \n\t" - - : [p1] "+r" (p1) - : [p4] "r" (p4), [p3] "r" (p3), [p2] "r" (p2), [s3] "r" (s3) - ); - - __asm__ __volatile__ ( - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - - : [p4] "+r" (p4), [p3] "+r" (p3), [p2] "+r" (p2), [p1] "+r" (p1) - : - ); - - __asm__ __volatile__ ( - "sb %[p4], 1(%[s2]) \n\t" - "sb %[p3], 0(%[s2]) \n\t" - "sb %[p2], -1(%[s2]) \n\t" - "sb %[p1], -2(%[s2]) \n\t" - - : - : [p4] "r" (p4), [p3] "r" (p3), [p2] "r" (p2), [p1] "r" (p1), - [s2] "r" (s2) - ); - - __asm__ __volatile__ ( - "srl %[p4], %[p4], 8 \n\t" - "srl %[p3], %[p3], 8 \n\t" - "srl %[p2], %[p2], 8 \n\t" - "srl %[p1], %[p1], 8 \n\t" - - : [p4] "+r" (p4), [p3] "+r" (p3), [p2] "+r" (p2), [p1] "+r" (p1) - : - ); - - __asm__ __volatile__ ( - "sb %[p4], 1(%[s1]) \n\t" - "sb %[p3], 0(%[s1]) \n\t" - "sb %[p2], -1(%[s1]) \n\t" - "sb %[p1], -2(%[s1]) \n\t" - - : - : [p4] "r" (p4), [p3] "r" (p3), [p2] "r" (p2), [p1] "r" (p1), - [s1] "r" (s1) - ); - } - } - } -} - -void vp9_lpf_horizontal_4_dual_dspr2(uint8_t *s, int p /* pitch */, - const uint8_t *blimit0, - const uint8_t *limit0, - const uint8_t *thresh0, - const uint8_t *blimit1, - const uint8_t *limit1, - const uint8_t *thresh1) { - vp9_lpf_horizontal_4_dspr2(s, p, blimit0, limit0, thresh0, 1); - vp9_lpf_horizontal_4_dspr2(s + 8, p, blimit1, limit1, thresh1, 1); -} - -void vp9_lpf_horizontal_8_dual_dspr2(uint8_t *s, int p /* pitch */, - const uint8_t *blimit0, - const uint8_t *limit0, - const uint8_t *thresh0, - const uint8_t *blimit1, - const uint8_t *limit1, - const uint8_t *thresh1) { - vp9_lpf_horizontal_8_dspr2(s, p, blimit0, limit0, thresh0, 1); - vp9_lpf_horizontal_8_dspr2(s + 8, p, blimit1, limit1, thresh1, 1); -} - -void vp9_lpf_vertical_4_dual_dspr2(uint8_t *s, int p, - const uint8_t *blimit0, - const uint8_t *limit0, - const uint8_t *thresh0, - const uint8_t *blimit1, - const uint8_t *limit1, - const uint8_t *thresh1) { - vp9_lpf_vertical_4_dspr2(s, p, blimit0, limit0, thresh0, 1); - vp9_lpf_vertical_4_dspr2(s + 8 * p, p, blimit1, limit1, thresh1, 1); -} - -void vp9_lpf_vertical_8_dual_dspr2(uint8_t *s, int p, - const uint8_t *blimit0, - const uint8_t *limit0, - const uint8_t *thresh0, - const uint8_t *blimit1, - const uint8_t *limit1, - const uint8_t *thresh1) { - vp9_lpf_vertical_8_dspr2(s, p, blimit0, limit0, thresh0, 1); - vp9_lpf_vertical_8_dspr2(s + 8 * p, p, blimit1, limit1, thresh1, - 1); -} - -void vp9_lpf_vertical_16_dual_dspr2(uint8_t *s, int p, - const uint8_t *blimit, - const uint8_t *limit, - const uint8_t *thresh) { - vp9_lpf_vertical_16_dspr2(s, p, blimit, limit, thresh); - vp9_lpf_vertical_16_dspr2(s + 8 * p, p, blimit, limit, thresh); -} -#endif // #if HAVE_DSPR2 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,763 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_MIPS_DSPR2_VP9_LOOPFILTER_FILTERS_DSPR2_H_ -#define VP9_COMMON_MIPS_DSPR2_VP9_LOOPFILTER_FILTERS_DSPR2_H_ - -#include - -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_onyxc_int.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if HAVE_DSPR2 -/* inputs & outputs are quad-byte vectors */ -static INLINE void vp9_filter_dspr2(uint32_t mask, uint32_t hev, - uint32_t *ps1, uint32_t *ps0, - uint32_t *qs0, uint32_t *qs1) { - int32_t vp9_filter_l, vp9_filter_r; - int32_t Filter1_l, Filter1_r, Filter2_l, Filter2_r; - int32_t subr_r, subr_l; - uint32_t t1, t2, HWM, t3; - uint32_t hev_l, hev_r, mask_l, mask_r, invhev_l, invhev_r; - int32_t vps1, vps0, vqs0, vqs1; - int32_t vps1_l, vps1_r, vps0_l, vps0_r, vqs0_l, vqs0_r, vqs1_l, vqs1_r; - uint32_t N128; - - N128 = 0x80808080; - t1 = 0x03000300; - t2 = 0x04000400; - t3 = 0x01000100; - HWM = 0xFF00FF00; - - vps0 = (*ps0) ^ N128; - vps1 = (*ps1) ^ N128; - vqs0 = (*qs0) ^ N128; - vqs1 = (*qs1) ^ N128; - - /* use halfword pairs instead quad-bytes because of accuracy */ - vps0_l = vps0 & HWM; - vps0_r = vps0 << 8; - vps0_r = vps0_r & HWM; - - vps1_l = vps1 & HWM; - vps1_r = vps1 << 8; - vps1_r = vps1_r & HWM; - - vqs0_l = vqs0 & HWM; - vqs0_r = vqs0 << 8; - vqs0_r = vqs0_r & HWM; - - vqs1_l = vqs1 & HWM; - vqs1_r = vqs1 << 8; - vqs1_r = vqs1_r & HWM; - - mask_l = mask & HWM; - mask_r = mask << 8; - mask_r = mask_r & HWM; - - hev_l = hev & HWM; - hev_r = hev << 8; - hev_r = hev_r & HWM; - - __asm__ __volatile__ ( - /* vp9_filter = vp8_signed_char_clamp(ps1 - qs1); */ - "subq_s.ph %[vp9_filter_l], %[vps1_l], %[vqs1_l] \n\t" - "subq_s.ph %[vp9_filter_r], %[vps1_r], %[vqs1_r] \n\t" - - /* qs0 - ps0 */ - "subq_s.ph %[subr_l], %[vqs0_l], %[vps0_l] \n\t" - "subq_s.ph %[subr_r], %[vqs0_r], %[vps0_r] \n\t" - - /* vp9_filter &= hev; */ - "and %[vp9_filter_l], %[vp9_filter_l], %[hev_l] \n\t" - "and %[vp9_filter_r], %[vp9_filter_r], %[hev_r] \n\t" - - /* vp9_filter = vp8_signed_char_clamp(vp9_filter + 3 * (qs0 - ps0)); */ - "addq_s.ph %[vp9_filter_l], %[vp9_filter_l], %[subr_l] \n\t" - "addq_s.ph %[vp9_filter_r], %[vp9_filter_r], %[subr_r] \n\t" - "xor %[invhev_l], %[hev_l], %[HWM] \n\t" - "addq_s.ph %[vp9_filter_l], %[vp9_filter_l], %[subr_l] \n\t" - "addq_s.ph %[vp9_filter_r], %[vp9_filter_r], %[subr_r] \n\t" - "xor %[invhev_r], %[hev_r], %[HWM] \n\t" - "addq_s.ph %[vp9_filter_l], %[vp9_filter_l], %[subr_l] \n\t" - "addq_s.ph %[vp9_filter_r], %[vp9_filter_r], %[subr_r] \n\t" - - /* vp9_filter &= mask; */ - "and %[vp9_filter_l], %[vp9_filter_l], %[mask_l] \n\t" - "and %[vp9_filter_r], %[vp9_filter_r], %[mask_r] \n\t" - - : [vp9_filter_l] "=&r" (vp9_filter_l), - [vp9_filter_r] "=&r" (vp9_filter_r), - [subr_l] "=&r" (subr_l), [subr_r] "=&r" (subr_r), - [invhev_l] "=&r" (invhev_l), [invhev_r] "=&r" (invhev_r) - : [vps0_l] "r" (vps0_l), [vps0_r] "r" (vps0_r), [vps1_l] "r" (vps1_l), - [vps1_r] "r" (vps1_r), [vqs0_l] "r" (vqs0_l), [vqs0_r] "r" (vqs0_r), - [vqs1_l] "r" (vqs1_l), [vqs1_r] "r" (vqs1_r), - [mask_l] "r" (mask_l), [mask_r] "r" (mask_r), - [hev_l] "r" (hev_l), [hev_r] "r" (hev_r), - [HWM] "r" (HWM) - ); - - /* save bottom 3 bits so that we round one side +4 and the other +3 */ - __asm__ __volatile__ ( - /* Filter2 = vp8_signed_char_clamp(vp9_filter + 3) >>= 3; */ - "addq_s.ph %[Filter1_l], %[vp9_filter_l], %[t2] \n\t" - "addq_s.ph %[Filter1_r], %[vp9_filter_r], %[t2] \n\t" - - /* Filter1 = vp8_signed_char_clamp(vp9_filter + 4) >>= 3; */ - "addq_s.ph %[Filter2_l], %[vp9_filter_l], %[t1] \n\t" - "addq_s.ph %[Filter2_r], %[vp9_filter_r], %[t1] \n\t" - "shra.ph %[Filter1_r], %[Filter1_r], 3 \n\t" - "shra.ph %[Filter1_l], %[Filter1_l], 3 \n\t" - - "shra.ph %[Filter2_l], %[Filter2_l], 3 \n\t" - "shra.ph %[Filter2_r], %[Filter2_r], 3 \n\t" - - "and %[Filter1_l], %[Filter1_l], %[HWM] \n\t" - "and %[Filter1_r], %[Filter1_r], %[HWM] \n\t" - - /* vps0 = vp8_signed_char_clamp(ps0 + Filter2); */ - "addq_s.ph %[vps0_l], %[vps0_l], %[Filter2_l] \n\t" - "addq_s.ph %[vps0_r], %[vps0_r], %[Filter2_r] \n\t" - - /* vqs0 = vp8_signed_char_clamp(qs0 - Filter1); */ - "subq_s.ph %[vqs0_l], %[vqs0_l], %[Filter1_l] \n\t" - "subq_s.ph %[vqs0_r], %[vqs0_r], %[Filter1_r] \n\t" - - : [Filter1_l] "=&r" (Filter1_l), [Filter1_r] "=&r" (Filter1_r), - [Filter2_l] "=&r" (Filter2_l), [Filter2_r] "=&r" (Filter2_r), - [vps0_l] "+r" (vps0_l), [vps0_r] "+r" (vps0_r), - [vqs0_l] "+r" (vqs0_l), [vqs0_r] "+r" (vqs0_r) - : [t1] "r" (t1), [t2] "r" (t2), [HWM] "r" (HWM), - [vp9_filter_l] "r" (vp9_filter_l), [vp9_filter_r] "r" (vp9_filter_r) - ); - - __asm__ __volatile__ ( - /* (vp9_filter += 1) >>= 1 */ - "addqh.ph %[Filter1_l], %[Filter1_l], %[t3] \n\t" - "addqh.ph %[Filter1_r], %[Filter1_r], %[t3] \n\t" - - /* vp9_filter &= ~hev; */ - "and %[Filter1_l], %[Filter1_l], %[invhev_l] \n\t" - "and %[Filter1_r], %[Filter1_r], %[invhev_r] \n\t" - - /* vps1 = vp8_signed_char_clamp(ps1 + vp9_filter); */ - "addq_s.ph %[vps1_l], %[vps1_l], %[Filter1_l] \n\t" - "addq_s.ph %[vps1_r], %[vps1_r], %[Filter1_r] \n\t" - - /* vqs1 = vp8_signed_char_clamp(qs1 - vp9_filter); */ - "subq_s.ph %[vqs1_l], %[vqs1_l], %[Filter1_l] \n\t" - "subq_s.ph %[vqs1_r], %[vqs1_r], %[Filter1_r] \n\t" - - : [Filter1_l] "+r" (Filter1_l), [Filter1_r] "+r" (Filter1_r), - [vps1_l] "+r" (vps1_l), [vps1_r] "+r" (vps1_r), - [vqs1_l] "+r" (vqs1_l), [vqs1_r] "+r" (vqs1_r) - : [t3] "r" (t3), [invhev_l] "r" (invhev_l), [invhev_r] "r" (invhev_r) - ); - - /* Create quad-bytes from halfword pairs */ - vqs0_l = vqs0_l & HWM; - vqs1_l = vqs1_l & HWM; - vps0_l = vps0_l & HWM; - vps1_l = vps1_l & HWM; - - __asm__ __volatile__ ( - "shrl.ph %[vqs0_r], %[vqs0_r], 8 \n\t" - "shrl.ph %[vps0_r], %[vps0_r], 8 \n\t" - "shrl.ph %[vqs1_r], %[vqs1_r], 8 \n\t" - "shrl.ph %[vps1_r], %[vps1_r], 8 \n\t" - - : [vps1_r] "+r" (vps1_r), [vqs1_r] "+r" (vqs1_r), - [vps0_r] "+r" (vps0_r), [vqs0_r] "+r" (vqs0_r) - : - ); - - vqs0 = vqs0_l | vqs0_r; - vqs1 = vqs1_l | vqs1_r; - vps0 = vps0_l | vps0_r; - vps1 = vps1_l | vps1_r; - - *ps0 = vps0 ^ N128; - *ps1 = vps1 ^ N128; - *qs0 = vqs0 ^ N128; - *qs1 = vqs1 ^ N128; -} - -static INLINE void vp9_filter1_dspr2(uint32_t mask, uint32_t hev, - uint32_t ps1, uint32_t ps0, - uint32_t qs0, uint32_t qs1, - uint32_t *p1_f0, uint32_t *p0_f0, - uint32_t *q0_f0, uint32_t *q1_f0) { - int32_t vp9_filter_l, vp9_filter_r; - int32_t Filter1_l, Filter1_r, Filter2_l, Filter2_r; - int32_t subr_r, subr_l; - uint32_t t1, t2, HWM, t3; - uint32_t hev_l, hev_r, mask_l, mask_r, invhev_l, invhev_r; - int32_t vps1, vps0, vqs0, vqs1; - int32_t vps1_l, vps1_r, vps0_l, vps0_r, vqs0_l, vqs0_r, vqs1_l, vqs1_r; - uint32_t N128; - - N128 = 0x80808080; - t1 = 0x03000300; - t2 = 0x04000400; - t3 = 0x01000100; - HWM = 0xFF00FF00; - - vps0 = (ps0) ^ N128; - vps1 = (ps1) ^ N128; - vqs0 = (qs0) ^ N128; - vqs1 = (qs1) ^ N128; - - /* use halfword pairs instead quad-bytes because of accuracy */ - vps0_l = vps0 & HWM; - vps0_r = vps0 << 8; - vps0_r = vps0_r & HWM; - - vps1_l = vps1 & HWM; - vps1_r = vps1 << 8; - vps1_r = vps1_r & HWM; - - vqs0_l = vqs0 & HWM; - vqs0_r = vqs0 << 8; - vqs0_r = vqs0_r & HWM; - - vqs1_l = vqs1 & HWM; - vqs1_r = vqs1 << 8; - vqs1_r = vqs1_r & HWM; - - mask_l = mask & HWM; - mask_r = mask << 8; - mask_r = mask_r & HWM; - - hev_l = hev & HWM; - hev_r = hev << 8; - hev_r = hev_r & HWM; - - __asm__ __volatile__ ( - /* vp9_filter = vp8_signed_char_clamp(ps1 - qs1); */ - "subq_s.ph %[vp9_filter_l], %[vps1_l], %[vqs1_l] \n\t" - "subq_s.ph %[vp9_filter_r], %[vps1_r], %[vqs1_r] \n\t" - - /* qs0 - ps0 */ - "subq_s.ph %[subr_l], %[vqs0_l], %[vps0_l] \n\t" - "subq_s.ph %[subr_r], %[vqs0_r], %[vps0_r] \n\t" - - /* vp9_filter &= hev; */ - "and %[vp9_filter_l], %[vp9_filter_l], %[hev_l] \n\t" - "and %[vp9_filter_r], %[vp9_filter_r], %[hev_r] \n\t" - - /* vp9_filter = vp8_signed_char_clamp(vp9_filter + 3 * (qs0 - ps0)); */ - "addq_s.ph %[vp9_filter_l], %[vp9_filter_l], %[subr_l] \n\t" - "addq_s.ph %[vp9_filter_r], %[vp9_filter_r], %[subr_r] \n\t" - "xor %[invhev_l], %[hev_l], %[HWM] \n\t" - "addq_s.ph %[vp9_filter_l], %[vp9_filter_l], %[subr_l] \n\t" - "addq_s.ph %[vp9_filter_r], %[vp9_filter_r], %[subr_r] \n\t" - "xor %[invhev_r], %[hev_r], %[HWM] \n\t" - "addq_s.ph %[vp9_filter_l], %[vp9_filter_l], %[subr_l] \n\t" - "addq_s.ph %[vp9_filter_r], %[vp9_filter_r], %[subr_r] \n\t" - - /* vp9_filter &= mask; */ - "and %[vp9_filter_l], %[vp9_filter_l], %[mask_l] \n\t" - "and %[vp9_filter_r], %[vp9_filter_r], %[mask_r] \n\t" - - : [vp9_filter_l] "=&r" (vp9_filter_l), - [vp9_filter_r] "=&r" (vp9_filter_r), - [subr_l] "=&r" (subr_l), [subr_r] "=&r" (subr_r), - [invhev_l] "=&r" (invhev_l), [invhev_r] "=&r" (invhev_r) - : [vps0_l] "r" (vps0_l), [vps0_r] "r" (vps0_r), [vps1_l] "r" (vps1_l), - [vps1_r] "r" (vps1_r), [vqs0_l] "r" (vqs0_l), [vqs0_r] "r" (vqs0_r), - [vqs1_l] "r" (vqs1_l), [vqs1_r] "r" (vqs1_r), - [mask_l] "r" (mask_l), [mask_r] "r" (mask_r), - [hev_l] "r" (hev_l), [hev_r] "r" (hev_r), [HWM] "r" (HWM) - ); - - /* save bottom 3 bits so that we round one side +4 and the other +3 */ - __asm__ __volatile__ ( - /* Filter2 = vp8_signed_char_clamp(vp9_filter + 3) >>= 3; */ - "addq_s.ph %[Filter1_l], %[vp9_filter_l], %[t2] \n\t" - "addq_s.ph %[Filter1_r], %[vp9_filter_r], %[t2] \n\t" - - /* Filter1 = vp8_signed_char_clamp(vp9_filter + 4) >>= 3; */ - "addq_s.ph %[Filter2_l], %[vp9_filter_l], %[t1] \n\t" - "addq_s.ph %[Filter2_r], %[vp9_filter_r], %[t1] \n\t" - "shra.ph %[Filter1_r], %[Filter1_r], 3 \n\t" - "shra.ph %[Filter1_l], %[Filter1_l], 3 \n\t" - - "shra.ph %[Filter2_l], %[Filter2_l], 3 \n\t" - "shra.ph %[Filter2_r], %[Filter2_r], 3 \n\t" - - "and %[Filter1_l], %[Filter1_l], %[HWM] \n\t" - "and %[Filter1_r], %[Filter1_r], %[HWM] \n\t" - - /* vps0 = vp8_signed_char_clamp(ps0 + Filter2); */ - "addq_s.ph %[vps0_l], %[vps0_l], %[Filter2_l] \n\t" - "addq_s.ph %[vps0_r], %[vps0_r], %[Filter2_r] \n\t" - - /* vqs0 = vp8_signed_char_clamp(qs0 - Filter1); */ - "subq_s.ph %[vqs0_l], %[vqs0_l], %[Filter1_l] \n\t" - "subq_s.ph %[vqs0_r], %[vqs0_r], %[Filter1_r] \n\t" - - : [Filter1_l] "=&r" (Filter1_l), [Filter1_r] "=&r" (Filter1_r), - [Filter2_l] "=&r" (Filter2_l), [Filter2_r] "=&r" (Filter2_r), - [vps0_l] "+r" (vps0_l), [vps0_r] "+r" (vps0_r), - [vqs0_l] "+r" (vqs0_l), [vqs0_r] "+r" (vqs0_r) - : [t1] "r" (t1), [t2] "r" (t2), [HWM] "r" (HWM), - [vp9_filter_l] "r" (vp9_filter_l), [vp9_filter_r] "r" (vp9_filter_r) - ); - - __asm__ __volatile__ ( - /* (vp9_filter += 1) >>= 1 */ - "addqh.ph %[Filter1_l], %[Filter1_l], %[t3] \n\t" - "addqh.ph %[Filter1_r], %[Filter1_r], %[t3] \n\t" - - /* vp9_filter &= ~hev; */ - "and %[Filter1_l], %[Filter1_l], %[invhev_l] \n\t" - "and %[Filter1_r], %[Filter1_r], %[invhev_r] \n\t" - - /* vps1 = vp8_signed_char_clamp(ps1 + vp9_filter); */ - "addq_s.ph %[vps1_l], %[vps1_l], %[Filter1_l] \n\t" - "addq_s.ph %[vps1_r], %[vps1_r], %[Filter1_r] \n\t" - - /* vqs1 = vp8_signed_char_clamp(qs1 - vp9_filter); */ - "subq_s.ph %[vqs1_l], %[vqs1_l], %[Filter1_l] \n\t" - "subq_s.ph %[vqs1_r], %[vqs1_r], %[Filter1_r] \n\t" - - : [Filter1_l] "+r" (Filter1_l), [Filter1_r] "+r" (Filter1_r), - [vps1_l] "+r" (vps1_l), [vps1_r] "+r" (vps1_r), - [vqs1_l] "+r" (vqs1_l), [vqs1_r] "+r" (vqs1_r) - : [t3] "r" (t3), [invhev_l] "r" (invhev_l), [invhev_r] "r" (invhev_r) - ); - - /* Create quad-bytes from halfword pairs */ - vqs0_l = vqs0_l & HWM; - vqs1_l = vqs1_l & HWM; - vps0_l = vps0_l & HWM; - vps1_l = vps1_l & HWM; - - __asm__ __volatile__ ( - "shrl.ph %[vqs0_r], %[vqs0_r], 8 \n\t" - "shrl.ph %[vps0_r], %[vps0_r], 8 \n\t" - "shrl.ph %[vqs1_r], %[vqs1_r], 8 \n\t" - "shrl.ph %[vps1_r], %[vps1_r], 8 \n\t" - - : [vps1_r] "+r" (vps1_r), [vqs1_r] "+r" (vqs1_r), - [vps0_r] "+r" (vps0_r), [vqs0_r] "+r" (vqs0_r) - : - ); - - vqs0 = vqs0_l | vqs0_r; - vqs1 = vqs1_l | vqs1_r; - vps0 = vps0_l | vps0_r; - vps1 = vps1_l | vps1_r; - - *p0_f0 = vps0 ^ N128; - *p1_f0 = vps1 ^ N128; - *q0_f0 = vqs0 ^ N128; - *q1_f0 = vqs1 ^ N128; -} - -static INLINE void vp9_mbfilter_dspr2(uint32_t *op3, uint32_t *op2, - uint32_t *op1, uint32_t *op0, - uint32_t *oq0, uint32_t *oq1, - uint32_t *oq2, uint32_t *oq3) { - /* use a 7 tap filter [1, 1, 1, 2, 1, 1, 1] for flat line */ - const uint32_t p3 = *op3, p2 = *op2, p1 = *op1, p0 = *op0; - const uint32_t q0 = *oq0, q1 = *oq1, q2 = *oq2, q3 = *oq3; - uint32_t res_op2, res_op1, res_op0; - uint32_t res_oq0, res_oq1, res_oq2; - uint32_t tmp; - uint32_t add_p210_q012; - uint32_t u32Four = 0x00040004; - - /* *op2 = ROUND_POWER_OF_TWO(p3 + p3 + p3 + p2 + p2 + p1 + p0 + q0, 3) 1 */ - /* *op1 = ROUND_POWER_OF_TWO(p3 + p3 + p2 + p1 + p1 + p0 + q0 + q1, 3) 2 */ - /* *op0 = ROUND_POWER_OF_TWO(p3 + p2 + p1 + p0 + p0 + q0 + q1 + q2, 3) 3 */ - /* *oq0 = ROUND_POWER_OF_TWO(p2 + p1 + p0 + q0 + q0 + q1 + q2 + q3, 3) 4 */ - /* *oq1 = ROUND_POWER_OF_TWO(p1 + p0 + q0 + q1 + q1 + q2 + q3 + q3, 3) 5 */ - /* *oq2 = ROUND_POWER_OF_TWO(p0 + q0 + q1 + q2 + q2 + q3 + q3 + q3, 3) 6 */ - - __asm__ __volatile__ ( - "addu.ph %[add_p210_q012], %[p2], %[p1] \n\t" - "addu.ph %[add_p210_q012], %[add_p210_q012], %[p0] \n\t" - "addu.ph %[add_p210_q012], %[add_p210_q012], %[q0] \n\t" - "addu.ph %[add_p210_q012], %[add_p210_q012], %[q1] \n\t" - "addu.ph %[add_p210_q012], %[add_p210_q012], %[q2] \n\t" - "addu.ph %[add_p210_q012], %[add_p210_q012], %[u32Four] \n\t" - - "shll.ph %[tmp], %[p3], 1 \n\t" - "addu.ph %[res_op2], %[tmp], %[p3] \n\t" - "addu.ph %[res_op1], %[p3], %[p3] \n\t" - "addu.ph %[res_op2], %[res_op2], %[p2] \n\t" - "addu.ph %[res_op1], %[res_op1], %[p1] \n\t" - "addu.ph %[res_op2], %[res_op2], %[add_p210_q012] \n\t" - "addu.ph %[res_op1], %[res_op1], %[add_p210_q012] \n\t" - "subu.ph %[res_op2], %[res_op2], %[q1] \n\t" - "subu.ph %[res_op1], %[res_op1], %[q2] \n\t" - "subu.ph %[res_op2], %[res_op2], %[q2] \n\t" - "shrl.ph %[res_op1], %[res_op1], 3 \n\t" - "shrl.ph %[res_op2], %[res_op2], 3 \n\t" - "addu.ph %[res_op0], %[p3], %[p0] \n\t" - "addu.ph %[res_oq0], %[q0], %[q3] \n\t" - "addu.ph %[res_op0], %[res_op0], %[add_p210_q012] \n\t" - "addu.ph %[res_oq0], %[res_oq0], %[add_p210_q012] \n\t" - "addu.ph %[res_oq1], %[q3], %[q3] \n\t" - "shll.ph %[tmp], %[q3], 1 \n\t" - "addu.ph %[res_oq1], %[res_oq1], %[q1] \n\t" - "addu.ph %[res_oq2], %[tmp], %[q3] \n\t" - "addu.ph %[res_oq1], %[res_oq1], %[add_p210_q012] \n\t" - "addu.ph %[res_oq2], %[res_oq2], %[add_p210_q012] \n\t" - "subu.ph %[res_oq1], %[res_oq1], %[p2] \n\t" - "addu.ph %[res_oq2], %[res_oq2], %[q2] \n\t" - "shrl.ph %[res_oq1], %[res_oq1], 3 \n\t" - "subu.ph %[res_oq2], %[res_oq2], %[p2] \n\t" - "shrl.ph %[res_oq0], %[res_oq0], 3 \n\t" - "subu.ph %[res_oq2], %[res_oq2], %[p1] \n\t" - "shrl.ph %[res_op0], %[res_op0], 3 \n\t" - "shrl.ph %[res_oq2], %[res_oq2], 3 \n\t" - - : [add_p210_q012] "=&r" (add_p210_q012), - [tmp] "=&r" (tmp), [res_op2] "=&r" (res_op2), - [res_op1] "=&r" (res_op1), [res_op0] "=&r" (res_op0), - [res_oq0] "=&r" (res_oq0), [res_oq1] "=&r" (res_oq1), - [res_oq2] "=&r" (res_oq2) - : [p0] "r" (p0), [q0] "r" (q0), [p1] "r" (p1), [q1] "r" (q1), - [p2] "r" (p2), [q2] "r" (q2), [p3] "r" (p3), [q3] "r" (q3), - [u32Four] "r" (u32Four) - ); - - *op2 = res_op2; - *op1 = res_op1; - *op0 = res_op0; - *oq0 = res_oq0; - *oq1 = res_oq1; - *oq2 = res_oq2; -} - -static INLINE void vp9_mbfilter1_dspr2(uint32_t p3, uint32_t p2, - uint32_t p1, uint32_t p0, - uint32_t q0, uint32_t q1, - uint32_t q2, uint32_t q3, - uint32_t *op2_f1, - uint32_t *op1_f1, uint32_t *op0_f1, - uint32_t *oq0_f1, uint32_t *oq1_f1, - uint32_t *oq2_f1) { - /* use a 7 tap filter [1, 1, 1, 2, 1, 1, 1] for flat line */ - uint32_t res_op2, res_op1, res_op0; - uint32_t res_oq0, res_oq1, res_oq2; - uint32_t tmp; - uint32_t add_p210_q012; - uint32_t u32Four = 0x00040004; - - /* *op2 = ROUND_POWER_OF_TWO(p3 + p3 + p3 + p2 + p2 + p1 + p0 + q0, 3) 1 */ - /* *op1 = ROUND_POWER_OF_TWO(p3 + p3 + p2 + p1 + p1 + p0 + q0 + q1, 3) 2 */ - /* *op0 = ROUND_POWER_OF_TWO(p3 + p2 + p1 + p0 + p0 + q0 + q1 + q2, 3) 3 */ - /* *oq0 = ROUND_POWER_OF_TWO(p2 + p1 + p0 + q0 + q0 + q1 + q2 + q3, 3) 4 */ - /* *oq1 = ROUND_POWER_OF_TWO(p1 + p0 + q0 + q1 + q1 + q2 + q3 + q3, 3) 5 */ - /* *oq2 = ROUND_POWER_OF_TWO(p0 + q0 + q1 + q2 + q2 + q3 + q3 + q3, 3) 6 */ - - __asm__ __volatile__ ( - "addu.ph %[add_p210_q012], %[p2], %[p1] \n\t" - "addu.ph %[add_p210_q012], %[add_p210_q012], %[p0] \n\t" - "addu.ph %[add_p210_q012], %[add_p210_q012], %[q0] \n\t" - "addu.ph %[add_p210_q012], %[add_p210_q012], %[q1] \n\t" - "addu.ph %[add_p210_q012], %[add_p210_q012], %[q2] \n\t" - "addu.ph %[add_p210_q012], %[add_p210_q012], %[u32Four] \n\t" - - "shll.ph %[tmp], %[p3], 1 \n\t" - "addu.ph %[res_op2], %[tmp], %[p3] \n\t" - "addu.ph %[res_op1], %[p3], %[p3] \n\t" - "addu.ph %[res_op2], %[res_op2], %[p2] \n\t" - "addu.ph %[res_op1], %[res_op1], %[p1] \n\t" - "addu.ph %[res_op2], %[res_op2], %[add_p210_q012] \n\t" - "addu.ph %[res_op1], %[res_op1], %[add_p210_q012] \n\t" - "subu.ph %[res_op2], %[res_op2], %[q1] \n\t" - "subu.ph %[res_op1], %[res_op1], %[q2] \n\t" - "subu.ph %[res_op2], %[res_op2], %[q2] \n\t" - "shrl.ph %[res_op1], %[res_op1], 3 \n\t" - "shrl.ph %[res_op2], %[res_op2], 3 \n\t" - "addu.ph %[res_op0], %[p3], %[p0] \n\t" - "addu.ph %[res_oq0], %[q0], %[q3] \n\t" - "addu.ph %[res_op0], %[res_op0], %[add_p210_q012] \n\t" - "addu.ph %[res_oq0], %[res_oq0], %[add_p210_q012] \n\t" - "addu.ph %[res_oq1], %[q3], %[q3] \n\t" - "shll.ph %[tmp], %[q3], 1 \n\t" - "addu.ph %[res_oq1], %[res_oq1], %[q1] \n\t" - "addu.ph %[res_oq2], %[tmp], %[q3] \n\t" - "addu.ph %[res_oq1], %[res_oq1], %[add_p210_q012] \n\t" - "addu.ph %[res_oq2], %[res_oq2], %[add_p210_q012] \n\t" - "subu.ph %[res_oq1], %[res_oq1], %[p2] \n\t" - "addu.ph %[res_oq2], %[res_oq2], %[q2] \n\t" - "shrl.ph %[res_oq1], %[res_oq1], 3 \n\t" - "subu.ph %[res_oq2], %[res_oq2], %[p2] \n\t" - "shrl.ph %[res_oq0], %[res_oq0], 3 \n\t" - "subu.ph %[res_oq2], %[res_oq2], %[p1] \n\t" - "shrl.ph %[res_op0], %[res_op0], 3 \n\t" - "shrl.ph %[res_oq2], %[res_oq2], 3 \n\t" - - : [add_p210_q012] "=&r" (add_p210_q012), [tmp] "=&r" (tmp), - [res_op2] "=&r" (res_op2), [res_op1] "=&r" (res_op1), - [res_op0] "=&r" (res_op0), [res_oq0] "=&r" (res_oq0), - [res_oq1] "=&r" (res_oq1), [res_oq2] "=&r" (res_oq2) - : [p0] "r" (p0), [q0] "r" (q0), [p1] "r" (p1), [q1] "r" (q1), - [p2] "r" (p2), [q2] "r" (q2), [p3] "r" (p3), [q3] "r" (q3), - [u32Four] "r" (u32Four) - ); - - *op2_f1 = res_op2; - *op1_f1 = res_op1; - *op0_f1 = res_op0; - *oq0_f1 = res_oq0; - *oq1_f1 = res_oq1; - *oq2_f1 = res_oq2; -} - -static INLINE void vp9_wide_mbfilter_dspr2(uint32_t *op7, uint32_t *op6, - uint32_t *op5, uint32_t *op4, - uint32_t *op3, uint32_t *op2, - uint32_t *op1, uint32_t *op0, - uint32_t *oq0, uint32_t *oq1, - uint32_t *oq2, uint32_t *oq3, - uint32_t *oq4, uint32_t *oq5, - uint32_t *oq6, uint32_t *oq7) { - const uint32_t p7 = *op7, p6 = *op6, p5 = *op5, p4 = *op4; - const uint32_t p3 = *op3, p2 = *op2, p1 = *op1, p0 = *op0; - const uint32_t q0 = *oq0, q1 = *oq1, q2 = *oq2, q3 = *oq3; - const uint32_t q4 = *oq4, q5 = *oq5, q6 = *oq6, q7 = *oq7; - uint32_t res_op6, res_op5, res_op4, res_op3, res_op2, res_op1, res_op0; - uint32_t res_oq0, res_oq1, res_oq2, res_oq3, res_oq4, res_oq5, res_oq6; - uint32_t tmp; - uint32_t add_p6toq6; - uint32_t u32Eight = 0x00080008; - - __asm__ __volatile__ ( - /* addition of p6,p5,p4,p3,p2,p1,p0,q0,q1,q2,q3,q4,q5,q6 - which is used most of the time */ - "addu.ph %[add_p6toq6], %[p6], %[p5] \n\t" - "addu.ph %[add_p6toq6], %[add_p6toq6], %[p4] \n\t" - "addu.ph %[add_p6toq6], %[add_p6toq6], %[p3] \n\t" - "addu.ph %[add_p6toq6], %[add_p6toq6], %[p2] \n\t" - "addu.ph %[add_p6toq6], %[add_p6toq6], %[p1] \n\t" - "addu.ph %[add_p6toq6], %[add_p6toq6], %[p0] \n\t" - "addu.ph %[add_p6toq6], %[add_p6toq6], %[q0] \n\t" - "addu.ph %[add_p6toq6], %[add_p6toq6], %[q1] \n\t" - "addu.ph %[add_p6toq6], %[add_p6toq6], %[q2] \n\t" - "addu.ph %[add_p6toq6], %[add_p6toq6], %[q3] \n\t" - "addu.ph %[add_p6toq6], %[add_p6toq6], %[q4] \n\t" - "addu.ph %[add_p6toq6], %[add_p6toq6], %[q5] \n\t" - "addu.ph %[add_p6toq6], %[add_p6toq6], %[q6] \n\t" - "addu.ph %[add_p6toq6], %[add_p6toq6], %[u32Eight] \n\t" - - : [add_p6toq6] "=&r" (add_p6toq6) - : [p6] "r" (p6), [p5] "r" (p5), [p4] "r" (p4), - [p3] "r" (p3), [p2] "r" (p2), [p1] "r" (p1), [p0] "r" (p0), - [q0] "r" (q0), [q1] "r" (q1), [q2] "r" (q2), [q3] "r" (q3), - [q4] "r" (q4), [q5] "r" (q5), [q6] "r" (q6), - [u32Eight] "r" (u32Eight) - ); - - __asm__ __volatile__ ( - /* *op6 = ROUND_POWER_OF_TWO(p7 * 7 + p6 * 2 + p5 + p4 + - p3 + p2 + p1 + p0 + q0, 4) */ - "shll.ph %[tmp], %[p7], 3 \n\t" - "subu.ph %[res_op6], %[tmp], %[p7] \n\t" - "addu.ph %[res_op6], %[res_op6], %[p6] \n\t" - "addu.ph %[res_op6], %[res_op6], %[add_p6toq6] \n\t" - "subu.ph %[res_op6], %[res_op6], %[q1] \n\t" - "subu.ph %[res_op6], %[res_op6], %[q2] \n\t" - "subu.ph %[res_op6], %[res_op6], %[q3] \n\t" - "subu.ph %[res_op6], %[res_op6], %[q4] \n\t" - "subu.ph %[res_op6], %[res_op6], %[q5] \n\t" - "subu.ph %[res_op6], %[res_op6], %[q6] \n\t" - "shrl.ph %[res_op6], %[res_op6], 4 \n\t" - - /* *op5 = ROUND_POWER_OF_TWO(p7 * 6 + p6 + p5 * 2 + p4 + p3 + - p2 + p1 + p0 + q0 + q1, 4) */ - "shll.ph %[tmp], %[p7], 2 \n\t" - "addu.ph %[res_op5], %[tmp], %[p7] \n\t" - "addu.ph %[res_op5], %[res_op5], %[p7] \n\t" - "addu.ph %[res_op5], %[res_op5], %[p5] \n\t" - "addu.ph %[res_op5], %[res_op5], %[add_p6toq6] \n\t" - "subu.ph %[res_op5], %[res_op5], %[q2] \n\t" - "subu.ph %[res_op5], %[res_op5], %[q3] \n\t" - "subu.ph %[res_op5], %[res_op5], %[q4] \n\t" - "subu.ph %[res_op5], %[res_op5], %[q5] \n\t" - "subu.ph %[res_op5], %[res_op5], %[q6] \n\t" - "shrl.ph %[res_op5], %[res_op5], 4 \n\t" - - /* *op4 = ROUND_POWER_OF_TWO(p7 * 5 + p6 + p5 + p4 * 2 + p3 + p2 + - p1 + p0 + q0 + q1 + q2, 4) */ - "shll.ph %[tmp], %[p7], 2 \n\t" - "addu.ph %[res_op4], %[tmp], %[p7] \n\t" - "addu.ph %[res_op4], %[res_op4], %[p4] \n\t" - "addu.ph %[res_op4], %[res_op4], %[add_p6toq6] \n\t" - "subu.ph %[res_op4], %[res_op4], %[q3] \n\t" - "subu.ph %[res_op4], %[res_op4], %[q4] \n\t" - "subu.ph %[res_op4], %[res_op4], %[q5] \n\t" - "subu.ph %[res_op4], %[res_op4], %[q6] \n\t" - "shrl.ph %[res_op4], %[res_op4], 4 \n\t" - - /* *op3 = ROUND_POWER_OF_TWO(p7 * 4 + p6 + p5 + p4 + p3 * 2 + p2 + - p1 + p0 + q0 + q1 + q2 + q3, 4) */ - "shll.ph %[tmp], %[p7], 2 \n\t" - "addu.ph %[res_op3], %[tmp], %[p3] \n\t" - "addu.ph %[res_op3], %[res_op3], %[add_p6toq6] \n\t" - "subu.ph %[res_op3], %[res_op3], %[q4] \n\t" - "subu.ph %[res_op3], %[res_op3], %[q5] \n\t" - "subu.ph %[res_op3], %[res_op3], %[q6] \n\t" - "shrl.ph %[res_op3], %[res_op3], 4 \n\t" - - /* *op2 = ROUND_POWER_OF_TWO(p7 * 3 + p6 + p5 + p4 + p3 + p2 * 2 + p1 + - p0 + q0 + q1 + q2 + q3 + q4, 4) */ - "shll.ph %[tmp], %[p7], 1 \n\t" - "addu.ph %[res_op2], %[tmp], %[p7] \n\t" - "addu.ph %[res_op2], %[res_op2], %[p2] \n\t" - "addu.ph %[res_op2], %[res_op2], %[add_p6toq6] \n\t" - "subu.ph %[res_op2], %[res_op2], %[q5] \n\t" - "subu.ph %[res_op2], %[res_op2], %[q6] \n\t" - "shrl.ph %[res_op2], %[res_op2], 4 \n\t" - - /* *op1 = ROUND_POWER_OF_TWO(p7 * 2 + p6 + p5 + p4 + p3 + p2 + p1 * 2 + - p0 + q0 + q1 + q2 + q3 + q4 + q5, 4); */ - "shll.ph %[tmp], %[p7], 1 \n\t" - "addu.ph %[res_op1], %[tmp], %[p1] \n\t" - "addu.ph %[res_op1], %[res_op1], %[add_p6toq6] \n\t" - "subu.ph %[res_op1], %[res_op1], %[q6] \n\t" - "shrl.ph %[res_op1], %[res_op1], 4 \n\t" - - /* *op0 = ROUND_POWER_OF_TWO(p7 + p6 + p5 + p4 + p3 + p2 + p1 + p0 * 2 + - q0 + q1 + q2 + q3 + q4 + q5 + q6, 4) */ - "addu.ph %[res_op0], %[p7], %[p0] \n\t" - "addu.ph %[res_op0], %[res_op0], %[add_p6toq6] \n\t" - "shrl.ph %[res_op0], %[res_op0], 4 \n\t" - - : [res_op6] "=&r" (res_op6), [res_op5] "=&r" (res_op5), - [res_op4] "=&r" (res_op4), [res_op3] "=&r" (res_op3), - [res_op2] "=&r" (res_op2), [res_op1] "=&r" (res_op1), - [res_op0] "=&r" (res_op0), [tmp] "=&r" (tmp) - : [p7] "r" (p7), [p6] "r" (p6), [p5] "r" (p5), [p4] "r" (p4), - [p3] "r" (p3), [p2] "r" (p2), [p1] "r" (p1), [p0] "r" (p0), - [q2] "r" (q2), [q1] "r" (q1), - [q3] "r" (q3), [q4] "r" (q4), [q5] "r" (q5), [q6] "r" (q6), - [add_p6toq6] "r" (add_p6toq6) - ); - - *op6 = res_op6; - *op5 = res_op5; - *op4 = res_op4; - *op3 = res_op3; - *op2 = res_op2; - *op1 = res_op1; - *op0 = res_op0; - - __asm__ __volatile__ ( - /* *oq0 = ROUND_POWER_OF_TWO(p6 + p5 + p4 + p3 + p2 + p1 + p0 + q0 * 2 + - q1 + q2 + q3 + q4 + q5 + q6 + q7, 4); */ - "addu.ph %[res_oq0], %[q7], %[q0] \n\t" - "addu.ph %[res_oq0], %[res_oq0], %[add_p6toq6] \n\t" - "shrl.ph %[res_oq0], %[res_oq0], 4 \n\t" - - /* *oq1 = ROUND_POWER_OF_TWO(p5 + p4 + p3 + p2 + p1 + p0 + q0 + q1 * 2 + - q2 + q3 + q4 + q5 + q6 + q7 * 2, 4) */ - "shll.ph %[tmp], %[q7], 1 \n\t" - "addu.ph %[res_oq1], %[tmp], %[q1] \n\t" - "addu.ph %[res_oq1], %[res_oq1], %[add_p6toq6] \n\t" - "subu.ph %[res_oq1], %[res_oq1], %[p6] \n\t" - "shrl.ph %[res_oq1], %[res_oq1], 4 \n\t" - - /* *oq2 = ROUND_POWER_OF_TWO(p4 + p3 + p2 + p1 + p0 + q0 + q1 + q2 * 2 + - q3 + q4 + q5 + q6 + q7 * 3, 4) */ - "shll.ph %[tmp], %[q7], 1 \n\t" - "addu.ph %[res_oq2], %[tmp], %[q7] \n\t" - "addu.ph %[res_oq2], %[res_oq2], %[q2] \n\t" - "addu.ph %[res_oq2], %[res_oq2], %[add_p6toq6] \n\t" - "subu.ph %[res_oq2], %[res_oq2], %[p5] \n\t" - "subu.ph %[res_oq2], %[res_oq2], %[p6] \n\t" - "shrl.ph %[res_oq2], %[res_oq2], 4 \n\t" - - /* *oq3 = ROUND_POWER_OF_TWO(p3 + p2 + p1 + p0 + q0 + q1 + q2 + - q3 * 2 + q4 + q5 + q6 + q7 * 4, 4) */ - "shll.ph %[tmp], %[q7], 2 \n\t" - "addu.ph %[res_oq3], %[tmp], %[q3] \n\t" - "addu.ph %[res_oq3], %[res_oq3], %[add_p6toq6] \n\t" - "subu.ph %[res_oq3], %[res_oq3], %[p4] \n\t" - "subu.ph %[res_oq3], %[res_oq3], %[p5] \n\t" - "subu.ph %[res_oq3], %[res_oq3], %[p6] \n\t" - "shrl.ph %[res_oq3], %[res_oq3], 4 \n\t" - - /* *oq4 = ROUND_POWER_OF_TWO(p2 + p1 + p0 + q0 + q1 + q2 + q3 + - q4 * 2 + q5 + q6 + q7 * 5, 4) */ - "shll.ph %[tmp], %[q7], 2 \n\t" - "addu.ph %[res_oq4], %[tmp], %[q7] \n\t" - "addu.ph %[res_oq4], %[res_oq4], %[q4] \n\t" - "addu.ph %[res_oq4], %[res_oq4], %[add_p6toq6] \n\t" - "subu.ph %[res_oq4], %[res_oq4], %[p3] \n\t" - "subu.ph %[res_oq4], %[res_oq4], %[p4] \n\t" - "subu.ph %[res_oq4], %[res_oq4], %[p5] \n\t" - "subu.ph %[res_oq4], %[res_oq4], %[p6] \n\t" - "shrl.ph %[res_oq4], %[res_oq4], 4 \n\t" - - /* *oq5 = ROUND_POWER_OF_TWO(p1 + p0 + q0 + q1 + q2 + q3 + q4 + - q5 * 2 + q6 + q7 * 6, 4) */ - "shll.ph %[tmp], %[q7], 2 \n\t" - "addu.ph %[res_oq5], %[tmp], %[q7] \n\t" - "addu.ph %[res_oq5], %[res_oq5], %[q7] \n\t" - "addu.ph %[res_oq5], %[res_oq5], %[q5] \n\t" - "addu.ph %[res_oq5], %[res_oq5], %[add_p6toq6] \n\t" - "subu.ph %[res_oq5], %[res_oq5], %[p2] \n\t" - "subu.ph %[res_oq5], %[res_oq5], %[p3] \n\t" - "subu.ph %[res_oq5], %[res_oq5], %[p4] \n\t" - "subu.ph %[res_oq5], %[res_oq5], %[p5] \n\t" - "subu.ph %[res_oq5], %[res_oq5], %[p6] \n\t" - "shrl.ph %[res_oq5], %[res_oq5], 4 \n\t" - - /* *oq6 = ROUND_POWER_OF_TWO(p0 + q0 + q1 + q2 + q3 + - q4 + q5 + q6 * 2 + q7 * 7, 4) */ - "shll.ph %[tmp], %[q7], 3 \n\t" - "subu.ph %[res_oq6], %[tmp], %[q7] \n\t" - "addu.ph %[res_oq6], %[res_oq6], %[q6] \n\t" - "addu.ph %[res_oq6], %[res_oq6], %[add_p6toq6] \n\t" - "subu.ph %[res_oq6], %[res_oq6], %[p1] \n\t" - "subu.ph %[res_oq6], %[res_oq6], %[p2] \n\t" - "subu.ph %[res_oq6], %[res_oq6], %[p3] \n\t" - "subu.ph %[res_oq6], %[res_oq6], %[p4] \n\t" - "subu.ph %[res_oq6], %[res_oq6], %[p5] \n\t" - "subu.ph %[res_oq6], %[res_oq6], %[p6] \n\t" - "shrl.ph %[res_oq6], %[res_oq6], 4 \n\t" - - : [res_oq6] "=&r" (res_oq6), [res_oq5] "=&r" (res_oq5), - [res_oq4] "=&r" (res_oq4), [res_oq3] "=&r" (res_oq3), - [res_oq2] "=&r" (res_oq2), [res_oq1] "=&r" (res_oq1), - [res_oq0] "=&r" (res_oq0), [tmp] "=&r" (tmp) - : [q7] "r" (q7), [q6] "r" (q6), [q5] "r" (q5), [q4] "r" (q4), - [q3] "r" (q3), [q2] "r" (q2), [q1] "r" (q1), [q0] "r" (q0), - [p1] "r" (p1), [p2] "r" (p2), - [p3] "r" (p3), [p4] "r" (p4), [p5] "r" (p5), [p6] "r" (p6), - [add_p6toq6] "r" (add_p6toq6) - ); - - *oq0 = res_oq0; - *oq1 = res_oq1; - *oq2 = res_oq2; - *oq3 = res_oq3; - *oq4 = res_oq4; - *oq5 = res_oq5; - *oq6 = res_oq6; -} -#endif // #if HAVE_DSPR2 -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_MIPS_DSPR2_VP9_LOOPFILTER_FILTERS_DSPR2_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_loopfilter_macros_dspr2.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_loopfilter_macros_dspr2.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_loopfilter_macros_dspr2.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_loopfilter_macros_dspr2.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,478 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_MIPS_DSPR2_VP9_LOOPFILTER_MACROS_DSPR2_H_ -#define VP9_COMMON_MIPS_DSPR2_VP9_LOOPFILTER_MACROS_DSPR2_H_ - -#include - -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_onyxc_int.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if HAVE_DSPR2 -#define STORE_F0() { \ - __asm__ __volatile__ ( \ - "sb %[q1_f0], 1(%[s4]) \n\t" \ - "sb %[q0_f0], 0(%[s4]) \n\t" \ - "sb %[p0_f0], -1(%[s4]) \n\t" \ - "sb %[p1_f0], -2(%[s4]) \n\t" \ - \ - : \ - : [q1_f0] "r" (q1_f0), [q0_f0] "r" (q0_f0), \ - [p0_f0] "r" (p0_f0), [p1_f0] "r" (p1_f0), \ - [s4] "r" (s4) \ - ); \ - \ - __asm__ __volatile__ ( \ - "srl %[q1_f0], %[q1_f0], 8 \n\t" \ - "srl %[q0_f0], %[q0_f0], 8 \n\t" \ - "srl %[p0_f0], %[p0_f0], 8 \n\t" \ - "srl %[p1_f0], %[p1_f0], 8 \n\t" \ - \ - : [q1_f0] "+r" (q1_f0), [q0_f0] "+r" (q0_f0), \ - [p0_f0] "+r" (p0_f0), [p1_f0] "+r" (p1_f0) \ - : \ - ); \ - \ - __asm__ __volatile__ ( \ - "sb %[q1_f0], 1(%[s3]) \n\t" \ - "sb %[q0_f0], 0(%[s3]) \n\t" \ - "sb %[p0_f0], -1(%[s3]) \n\t" \ - "sb %[p1_f0], -2(%[s3]) \n\t" \ - \ - : [p1_f0] "+r" (p1_f0) \ - : [q1_f0] "r" (q1_f0), [q0_f0] "r" (q0_f0), \ - [s3] "r" (s3), [p0_f0] "r" (p0_f0) \ - ); \ - \ - __asm__ __volatile__ ( \ - "srl %[q1_f0], %[q1_f0], 8 \n\t" \ - "srl %[q0_f0], %[q0_f0], 8 \n\t" \ - "srl %[p0_f0], %[p0_f0], 8 \n\t" \ - "srl %[p1_f0], %[p1_f0], 8 \n\t" \ - \ - : [q1_f0] "+r" (q1_f0), [q0_f0] "+r" (q0_f0), \ - [p0_f0] "+r" (p0_f0), [p1_f0] "+r" (p1_f0) \ - : \ - ); \ - \ - __asm__ __volatile__ ( \ - "sb %[q1_f0], 1(%[s2]) \n\t" \ - "sb %[q0_f0], 0(%[s2]) \n\t" \ - "sb %[p0_f0], -1(%[s2]) \n\t" \ - "sb %[p1_f0], -2(%[s2]) \n\t" \ - \ - : \ - : [q1_f0] "r" (q1_f0), [q0_f0] "r" (q0_f0), \ - [p0_f0] "r" (p0_f0), [p1_f0] "r" (p1_f0), \ - [s2] "r" (s2) \ - ); \ - \ - __asm__ __volatile__ ( \ - "srl %[q1_f0], %[q1_f0], 8 \n\t" \ - "srl %[q0_f0], %[q0_f0], 8 \n\t" \ - "srl %[p0_f0], %[p0_f0], 8 \n\t" \ - "srl %[p1_f0], %[p1_f0], 8 \n\t" \ - \ - : [q1_f0] "+r" (q1_f0), [q0_f0] "+r" (q0_f0), \ - [p0_f0] "+r" (p0_f0), [p1_f0] "+r" (p1_f0) \ - : \ - ); \ - \ - __asm__ __volatile__ ( \ - "sb %[q1_f0], 1(%[s1]) \n\t" \ - "sb %[q0_f0], 0(%[s1]) \n\t" \ - "sb %[p0_f0], -1(%[s1]) \n\t" \ - "sb %[p1_f0], -2(%[s1]) \n\t" \ - \ - : \ - : [q1_f0] "r" (q1_f0), [q0_f0] "r" (q0_f0), \ - [p0_f0] "r" (p0_f0), [p1_f0] "r" (p1_f0), \ - [s1] "r" (s1) \ - ); \ -} - -#define STORE_F1() { \ - __asm__ __volatile__ ( \ - "sb %[q2_r], 2(%[s4]) \n\t" \ - "sb %[q1_r], 1(%[s4]) \n\t" \ - "sb %[q0_r], 0(%[s4]) \n\t" \ - "sb %[p0_r], -1(%[s4]) \n\t" \ - "sb %[p1_r], -2(%[s4]) \n\t" \ - "sb %[p2_r], -3(%[s4]) \n\t" \ - \ - : \ - : [q2_r] "r" (q2_r), [q1_r] "r" (q1_r), [q0_r] "r" (q0_r), \ - [p0_r] "r" (p0_r), [p1_r] "r" (p1_r), [p2_r] "r" (p2_r), \ - [s4] "r" (s4) \ - ); \ - \ - __asm__ __volatile__ ( \ - "srl %[q2_r], %[q2_r], 16 \n\t" \ - "srl %[q1_r], %[q1_r], 16 \n\t" \ - "srl %[q0_r], %[q0_r], 16 \n\t" \ - "srl %[p0_r], %[p0_r], 16 \n\t" \ - "srl %[p1_r], %[p1_r], 16 \n\t" \ - "srl %[p2_r], %[p2_r], 16 \n\t" \ - \ - : [q2_r] "+r" (q2_r), [q1_r] "+r" (q1_r), [q0_r] "+r" (q0_r), \ - [p0_r] "+r" (p0_r), [p1_r] "+r" (p1_r), [p2_r] "+r" (p2_r) \ - : \ - ); \ - \ - __asm__ __volatile__ ( \ - "sb %[q2_r], 2(%[s3]) \n\t" \ - "sb %[q1_r], 1(%[s3]) \n\t" \ - "sb %[q0_r], 0(%[s3]) \n\t" \ - "sb %[p0_r], -1(%[s3]) \n\t" \ - "sb %[p1_r], -2(%[s3]) \n\t" \ - "sb %[p2_r], -3(%[s3]) \n\t" \ - \ - : \ - : [q2_r] "r" (q2_r), [q1_r] "r" (q1_r), [q0_r] "r" (q0_r), \ - [p0_r] "r" (p0_r), [p1_r] "r" (p1_r), [p2_r] "r" (p2_r), \ - [s3] "r" (s3) \ - ); \ - \ - __asm__ __volatile__ ( \ - "sb %[q2_l], 2(%[s2]) \n\t" \ - "sb %[q1_l], 1(%[s2]) \n\t" \ - "sb %[q0_l], 0(%[s2]) \n\t" \ - "sb %[p0_l], -1(%[s2]) \n\t" \ - "sb %[p1_l], -2(%[s2]) \n\t" \ - "sb %[p2_l], -3(%[s2]) \n\t" \ - \ - : \ - : [q2_l] "r" (q2_l), [q1_l] "r" (q1_l), [q0_l] "r" (q0_l), \ - [p0_l] "r" (p0_l), [p1_l] "r" (p1_l), [p2_l] "r" (p2_l), \ - [s2] "r" (s2) \ - ); \ - \ - __asm__ __volatile__ ( \ - "srl %[q2_l], %[q2_l], 16 \n\t" \ - "srl %[q1_l], %[q1_l], 16 \n\t" \ - "srl %[q0_l], %[q0_l], 16 \n\t" \ - "srl %[p0_l], %[p0_l], 16 \n\t" \ - "srl %[p1_l], %[p1_l], 16 \n\t" \ - "srl %[p2_l], %[p2_l], 16 \n\t" \ - \ - : [q2_l] "+r" (q2_l), [q1_l] "+r" (q1_l), [q0_l] "+r" (q0_l), \ - [p0_l] "+r" (p0_l), [p1_l] "+r" (p1_l), [p2_l] "+r" (p2_l) \ - : \ - ); \ - \ - __asm__ __volatile__ ( \ - "sb %[q2_l], 2(%[s1]) \n\t" \ - "sb %[q1_l], 1(%[s1]) \n\t" \ - "sb %[q0_l], 0(%[s1]) \n\t" \ - "sb %[p0_l], -1(%[s1]) \n\t" \ - "sb %[p1_l], -2(%[s1]) \n\t" \ - "sb %[p2_l], -3(%[s1]) \n\t" \ - \ - : \ - : [q2_l] "r" (q2_l), [q1_l] "r" (q1_l), [q0_l] "r" (q0_l), \ - [p0_l] "r" (p0_l), [p1_l] "r" (p1_l), [p2_l] "r" (p2_l), \ - [s1] "r" (s1) \ - ); \ -} - -#define STORE_F2() { \ - __asm__ __volatile__ ( \ - "sb %[q6_r], 6(%[s4]) \n\t" \ - "sb %[q5_r], 5(%[s4]) \n\t" \ - "sb %[q4_r], 4(%[s4]) \n\t" \ - "sb %[q3_r], 3(%[s4]) \n\t" \ - "sb %[q2_r], 2(%[s4]) \n\t" \ - "sb %[q1_r], 1(%[s4]) \n\t" \ - "sb %[q0_r], 0(%[s4]) \n\t" \ - "sb %[p0_r], -1(%[s4]) \n\t" \ - "sb %[p1_r], -2(%[s4]) \n\t" \ - "sb %[p2_r], -3(%[s4]) \n\t" \ - "sb %[p3_r], -4(%[s4]) \n\t" \ - "sb %[p4_r], -5(%[s4]) \n\t" \ - "sb %[p5_r], -6(%[s4]) \n\t" \ - "sb %[p6_r], -7(%[s4]) \n\t" \ - \ - : \ - : [q6_r] "r" (q6_r), [q5_r] "r" (q5_r), [q4_r] "r" (q4_r), \ - [q3_r] "r" (q3_r), [q2_r] "r" (q2_r), [q1_r] "r" (q1_r), \ - [q0_r] "r" (q0_r), \ - [p0_r] "r" (p0_r), [p1_r] "r" (p1_r), [p2_r] "r" (p2_r), \ - [p3_r] "r" (p3_r), [p4_r] "r" (p4_r), [p5_r] "r" (p5_r), \ - [p6_r] "r" (p6_r), \ - [s4] "r" (s4) \ - ); \ - \ - __asm__ __volatile__ ( \ - "srl %[q6_r], %[q6_r], 16 \n\t" \ - "srl %[q5_r], %[q5_r], 16 \n\t" \ - "srl %[q4_r], %[q4_r], 16 \n\t" \ - "srl %[q3_r], %[q3_r], 16 \n\t" \ - "srl %[q2_r], %[q2_r], 16 \n\t" \ - "srl %[q1_r], %[q1_r], 16 \n\t" \ - "srl %[q0_r], %[q0_r], 16 \n\t" \ - "srl %[p0_r], %[p0_r], 16 \n\t" \ - "srl %[p1_r], %[p1_r], 16 \n\t" \ - "srl %[p2_r], %[p2_r], 16 \n\t" \ - "srl %[p3_r], %[p3_r], 16 \n\t" \ - "srl %[p4_r], %[p4_r], 16 \n\t" \ - "srl %[p5_r], %[p5_r], 16 \n\t" \ - "srl %[p6_r], %[p6_r], 16 \n\t" \ - \ - : [q6_r] "+r" (q6_r), [q5_r] "+r" (q5_r), [q4_r] "+r" (q4_r), \ - [q3_r] "+r" (q3_r), [q2_r] "+r" (q2_r), [q1_r] "+r" (q1_r), \ - [q0_r] "+r" (q0_r), \ - [p0_r] "+r" (p0_r), [p1_r] "+r" (p1_r), [p2_r] "+r" (p2_r), \ - [p3_r] "+r" (p3_r), [p4_r] "+r" (p4_r), [p5_r] "+r" (p5_r), \ - [p6_r] "+r" (p6_r) \ - : \ - ); \ - \ - __asm__ __volatile__ ( \ - "sb %[q6_r], 6(%[s3]) \n\t" \ - "sb %[q5_r], 5(%[s3]) \n\t" \ - "sb %[q4_r], 4(%[s3]) \n\t" \ - "sb %[q3_r], 3(%[s3]) \n\t" \ - "sb %[q2_r], 2(%[s3]) \n\t" \ - "sb %[q1_r], 1(%[s3]) \n\t" \ - "sb %[q0_r], 0(%[s3]) \n\t" \ - "sb %[p0_r], -1(%[s3]) \n\t" \ - "sb %[p1_r], -2(%[s3]) \n\t" \ - "sb %[p2_r], -3(%[s3]) \n\t" \ - "sb %[p3_r], -4(%[s3]) \n\t" \ - "sb %[p4_r], -5(%[s3]) \n\t" \ - "sb %[p5_r], -6(%[s3]) \n\t" \ - "sb %[p6_r], -7(%[s3]) \n\t" \ - \ - : \ - : [q6_r] "r" (q6_r), [q5_r] "r" (q5_r), [q4_r] "r" (q4_r), \ - [q3_r] "r" (q3_r), [q2_r] "r" (q2_r), [q1_r] "r" (q1_r), \ - [q0_r] "r" (q0_r), \ - [p0_r] "r" (p0_r), [p1_r] "r" (p1_r), [p2_r] "r" (p2_r), \ - [p3_r] "r" (p3_r), [p4_r] "r" (p4_r), [p5_r] "r" (p5_r), \ - [p6_r] "r" (p6_r), \ - [s3] "r" (s3) \ - ); \ - \ - __asm__ __volatile__ ( \ - "sb %[q6_l], 6(%[s2]) \n\t" \ - "sb %[q5_l], 5(%[s2]) \n\t" \ - "sb %[q4_l], 4(%[s2]) \n\t" \ - "sb %[q3_l], 3(%[s2]) \n\t" \ - "sb %[q2_l], 2(%[s2]) \n\t" \ - "sb %[q1_l], 1(%[s2]) \n\t" \ - "sb %[q0_l], 0(%[s2]) \n\t" \ - "sb %[p0_l], -1(%[s2]) \n\t" \ - "sb %[p1_l], -2(%[s2]) \n\t" \ - "sb %[p2_l], -3(%[s2]) \n\t" \ - "sb %[p3_l], -4(%[s2]) \n\t" \ - "sb %[p4_l], -5(%[s2]) \n\t" \ - "sb %[p5_l], -6(%[s2]) \n\t" \ - "sb %[p6_l], -7(%[s2]) \n\t" \ - \ - : \ - : [q6_l] "r" (q6_l), [q5_l] "r" (q5_l), [q4_l] "r" (q4_l), \ - [q3_l] "r" (q3_l), [q2_l] "r" (q2_l), [q1_l] "r" (q1_l), \ - [q0_l] "r" (q0_l), \ - [p0_l] "r" (p0_l), [p1_l] "r" (p1_l), [p2_l] "r" (p2_l), \ - [p3_l] "r" (p3_l), [p4_l] "r" (p4_l), [p5_l] "r" (p5_l), \ - [p6_l] "r" (p6_l), \ - [s2] "r" (s2) \ - ); \ - \ - __asm__ __volatile__ ( \ - "srl %[q6_l], %[q6_l], 16 \n\t" \ - "srl %[q5_l], %[q5_l], 16 \n\t" \ - "srl %[q4_l], %[q4_l], 16 \n\t" \ - "srl %[q3_l], %[q3_l], 16 \n\t" \ - "srl %[q2_l], %[q2_l], 16 \n\t" \ - "srl %[q1_l], %[q1_l], 16 \n\t" \ - "srl %[q0_l], %[q0_l], 16 \n\t" \ - "srl %[p0_l], %[p0_l], 16 \n\t" \ - "srl %[p1_l], %[p1_l], 16 \n\t" \ - "srl %[p2_l], %[p2_l], 16 \n\t" \ - "srl %[p3_l], %[p3_l], 16 \n\t" \ - "srl %[p4_l], %[p4_l], 16 \n\t" \ - "srl %[p5_l], %[p5_l], 16 \n\t" \ - "srl %[p6_l], %[p6_l], 16 \n\t" \ - \ - : [q6_l] "+r" (q6_l), [q5_l] "+r" (q5_l), [q4_l] "+r" (q4_l), \ - [q3_l] "+r" (q3_l), [q2_l] "+r" (q2_l), [q1_l] "+r" (q1_l), \ - [q0_l] "+r" (q0_l), \ - [p0_l] "+r" (p0_l), [p1_l] "+r" (p1_l), [p2_l] "+r" (p2_l), \ - [p3_l] "+r" (p3_l), [p4_l] "+r" (p4_l), [p5_l] "+r" (p5_l), \ - [p6_l] "+r" (p6_l) \ - : \ - ); \ - \ - __asm__ __volatile__ ( \ - "sb %[q6_l], 6(%[s1]) \n\t" \ - "sb %[q5_l], 5(%[s1]) \n\t" \ - "sb %[q4_l], 4(%[s1]) \n\t" \ - "sb %[q3_l], 3(%[s1]) \n\t" \ - "sb %[q2_l], 2(%[s1]) \n\t" \ - "sb %[q1_l], 1(%[s1]) \n\t" \ - "sb %[q0_l], 0(%[s1]) \n\t" \ - "sb %[p0_l], -1(%[s1]) \n\t" \ - "sb %[p1_l], -2(%[s1]) \n\t" \ - "sb %[p2_l], -3(%[s1]) \n\t" \ - "sb %[p3_l], -4(%[s1]) \n\t" \ - "sb %[p4_l], -5(%[s1]) \n\t" \ - "sb %[p5_l], -6(%[s1]) \n\t" \ - "sb %[p6_l], -7(%[s1]) \n\t" \ - \ - : \ - : [q6_l] "r" (q6_l), [q5_l] "r" (q5_l), [q4_l] "r" (q4_l), \ - [q3_l] "r" (q3_l), [q2_l] "r" (q2_l), [q1_l] "r" (q1_l), \ - [q0_l] "r" (q0_l), \ - [p0_l] "r" (p0_l), [p1_l] "r" (p1_l), [p2_l] "r" (p2_l), \ - [p3_l] "r" (p3_l), [p4_l] "r" (p4_l), [p5_l] "r" (p5_l), \ - [p6_l] "r" (p6_l), \ - [s1] "r" (s1) \ - ); \ -} - -#define PACK_LEFT_0TO3() { \ - __asm__ __volatile__ ( \ - "preceu.ph.qbl %[p3_l], %[p3] \n\t" \ - "preceu.ph.qbl %[p2_l], %[p2] \n\t" \ - "preceu.ph.qbl %[p1_l], %[p1] \n\t" \ - "preceu.ph.qbl %[p0_l], %[p0] \n\t" \ - "preceu.ph.qbl %[q0_l], %[q0] \n\t" \ - "preceu.ph.qbl %[q1_l], %[q1] \n\t" \ - "preceu.ph.qbl %[q2_l], %[q2] \n\t" \ - "preceu.ph.qbl %[q3_l], %[q3] \n\t" \ - \ - : [p3_l] "=&r" (p3_l), [p2_l] "=&r" (p2_l), \ - [p1_l] "=&r" (p1_l), [p0_l] "=&r" (p0_l), \ - [q0_l] "=&r" (q0_l), [q1_l] "=&r" (q1_l), \ - [q2_l] "=&r" (q2_l), [q3_l] "=&r" (q3_l) \ - : [p3] "r" (p3), [p2] "r" (p2), [p1] "r" (p1), [p0] "r" (p0), \ - [q0] "r" (q0), [q1] "r" (q1), [q2] "r" (q2), [q3] "r" (q3) \ - ); \ -} - -#define PACK_LEFT_4TO7() { \ - __asm__ __volatile__ ( \ - "preceu.ph.qbl %[p7_l], %[p7] \n\t" \ - "preceu.ph.qbl %[p6_l], %[p6] \n\t" \ - "preceu.ph.qbl %[p5_l], %[p5] \n\t" \ - "preceu.ph.qbl %[p4_l], %[p4] \n\t" \ - "preceu.ph.qbl %[q4_l], %[q4] \n\t" \ - "preceu.ph.qbl %[q5_l], %[q5] \n\t" \ - "preceu.ph.qbl %[q6_l], %[q6] \n\t" \ - "preceu.ph.qbl %[q7_l], %[q7] \n\t" \ - \ - : [p7_l] "=&r" (p7_l), [p6_l] "=&r" (p6_l), \ - [p5_l] "=&r" (p5_l), [p4_l] "=&r" (p4_l), \ - [q4_l] "=&r" (q4_l), [q5_l] "=&r" (q5_l), \ - [q6_l] "=&r" (q6_l), [q7_l] "=&r" (q7_l) \ - : [p7] "r" (p7), [p6] "r" (p6), [p5] "r" (p5), [p4] "r" (p4), \ - [q4] "r" (q4), [q5] "r" (q5), [q6] "r" (q6), [q7] "r" (q7) \ - ); \ -} - -#define PACK_RIGHT_0TO3() { \ - __asm__ __volatile__ ( \ - "preceu.ph.qbr %[p3_r], %[p3] \n\t" \ - "preceu.ph.qbr %[p2_r], %[p2] \n\t" \ - "preceu.ph.qbr %[p1_r], %[p1] \n\t" \ - "preceu.ph.qbr %[p0_r], %[p0] \n\t" \ - "preceu.ph.qbr %[q0_r], %[q0] \n\t" \ - "preceu.ph.qbr %[q1_r], %[q1] \n\t" \ - "preceu.ph.qbr %[q2_r], %[q2] \n\t" \ - "preceu.ph.qbr %[q3_r], %[q3] \n\t" \ - \ - : [p3_r] "=&r" (p3_r), [p2_r] "=&r" (p2_r), \ - [p1_r] "=&r" (p1_r), [p0_r] "=&r" (p0_r), \ - [q0_r] "=&r" (q0_r), [q1_r] "=&r" (q1_r), \ - [q2_r] "=&r" (q2_r), [q3_r] "=&r" (q3_r) \ - : [p3] "r" (p3), [p2] "r" (p2), [p1] "r" (p1), [p0] "r" (p0), \ - [q0] "r" (q0), [q1] "r" (q1), [q2] "r" (q2), [q3] "r" (q3) \ - ); \ -} - -#define PACK_RIGHT_4TO7() { \ - __asm__ __volatile__ ( \ - "preceu.ph.qbr %[p7_r], %[p7] \n\t" \ - "preceu.ph.qbr %[p6_r], %[p6] \n\t" \ - "preceu.ph.qbr %[p5_r], %[p5] \n\t" \ - "preceu.ph.qbr %[p4_r], %[p4] \n\t" \ - "preceu.ph.qbr %[q4_r], %[q4] \n\t" \ - "preceu.ph.qbr %[q5_r], %[q5] \n\t" \ - "preceu.ph.qbr %[q6_r], %[q6] \n\t" \ - "preceu.ph.qbr %[q7_r], %[q7] \n\t" \ - \ - : [p7_r] "=&r" (p7_r), [p6_r] "=&r" (p6_r), \ - [p5_r] "=&r" (p5_r), [p4_r] "=&r" (p4_r), \ - [q4_r] "=&r" (q4_r), [q5_r] "=&r" (q5_r), \ - [q6_r] "=&r" (q6_r), [q7_r] "=&r" (q7_r) \ - : [p7] "r" (p7), [p6] "r" (p6), [p5] "r" (p5), [p4] "r" (p4), \ - [q4] "r" (q4), [q5] "r" (q5), [q6] "r" (q6), [q7] "r" (q7) \ - ); \ -} - -#define COMBINE_LEFT_RIGHT_0TO2() { \ - __asm__ __volatile__ ( \ - "precr.qb.ph %[p2], %[p2_l], %[p2_r] \n\t" \ - "precr.qb.ph %[p1], %[p1_l], %[p1_r] \n\t" \ - "precr.qb.ph %[p0], %[p0_l], %[p0_r] \n\t" \ - "precr.qb.ph %[q0], %[q0_l], %[q0_r] \n\t" \ - "precr.qb.ph %[q1], %[q1_l], %[q1_r] \n\t" \ - "precr.qb.ph %[q2], %[q2_l], %[q2_r] \n\t" \ - \ - : [p2] "=&r" (p2), [p1] "=&r" (p1), [p0] "=&r" (p0), \ - [q0] "=&r" (q0), [q1] "=&r" (q1), [q2] "=&r" (q2) \ - : [p2_l] "r" (p2_l), [p2_r] "r" (p2_r), \ - [p1_l] "r" (p1_l), [p1_r] "r" (p1_r), \ - [p0_l] "r" (p0_l), [p0_r] "r" (p0_r), \ - [q0_l] "r" (q0_l), [q0_r] "r" (q0_r), \ - [q1_l] "r" (q1_l), [q1_r] "r" (q1_r), \ - [q2_l] "r" (q2_l), [q2_r] "r" (q2_r) \ - ); \ -} - -#define COMBINE_LEFT_RIGHT_3TO6() { \ - __asm__ __volatile__ ( \ - "precr.qb.ph %[p6], %[p6_l], %[p6_r] \n\t" \ - "precr.qb.ph %[p5], %[p5_l], %[p5_r] \n\t" \ - "precr.qb.ph %[p4], %[p4_l], %[p4_r] \n\t" \ - "precr.qb.ph %[p3], %[p3_l], %[p3_r] \n\t" \ - "precr.qb.ph %[q3], %[q3_l], %[q3_r] \n\t" \ - "precr.qb.ph %[q4], %[q4_l], %[q4_r] \n\t" \ - "precr.qb.ph %[q5], %[q5_l], %[q5_r] \n\t" \ - "precr.qb.ph %[q6], %[q6_l], %[q6_r] \n\t" \ - \ - : [p6] "=&r" (p6),[p5] "=&r" (p5), \ - [p4] "=&r" (p4),[p3] "=&r" (p3), \ - [q3] "=&r" (q3),[q4] "=&r" (q4), \ - [q5] "=&r" (q5),[q6] "=&r" (q6) \ - : [p6_l] "r" (p6_l), [p5_l] "r" (p5_l), \ - [p4_l] "r" (p4_l), [p3_l] "r" (p3_l), \ - [p6_r] "r" (p6_r), [p5_r] "r" (p5_r), \ - [p4_r] "r" (p4_r), [p3_r] "r" (p3_r), \ - [q3_l] "r" (q3_l), [q4_l] "r" (q4_l), \ - [q5_l] "r" (q5_l), [q6_l] "r" (q6_l), \ - [q3_r] "r" (q3_r), [q4_r] "r" (q4_r), \ - [q5_r] "r" (q5_r), [q6_r] "r" (q6_r) \ - ); \ -} - -#endif // #if HAVE_DSPR2 -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_MIPS_DSPR2_VP9_LOOPFILTER_MACROS_DSPR2_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_loopfilter_masks_dspr2.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_loopfilter_masks_dspr2.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_loopfilter_masks_dspr2.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_loopfilter_masks_dspr2.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,373 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_MIPS_DSPR2_VP9_LOOPFILTER_MASKS_DSPR2_H_ -#define VP9_COMMON_MIPS_DSPR2_VP9_LOOPFILTER_MASKS_DSPR2_H_ - -#include - -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_onyxc_int.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if HAVE_DSPR2 -/* processing 4 pixels at the same time - * compute hev and mask in the same function */ -static INLINE void vp9_filter_hev_mask_dspr2(uint32_t limit, uint32_t flimit, - uint32_t p1, uint32_t p0, - uint32_t p3, uint32_t p2, - uint32_t q0, uint32_t q1, - uint32_t q2, uint32_t q3, - uint32_t thresh, uint32_t *hev, - uint32_t *mask) { - uint32_t c, r, r3, r_k; - uint32_t s1, s2, s3; - uint32_t ones = 0xFFFFFFFF; - uint32_t hev1; - - __asm__ __volatile__ ( - /* mask |= (abs(p3 - p2) > limit) */ - "subu_s.qb %[c], %[p3], %[p2] \n\t" - "subu_s.qb %[r_k], %[p2], %[p3] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[limit], %[r_k] \n\t" - "or %[r], $0, %[c] \n\t" - - /* mask |= (abs(p2 - p1) > limit) */ - "subu_s.qb %[c], %[p2], %[p1] \n\t" - "subu_s.qb %[r_k], %[p1], %[p2] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[limit], %[r_k] \n\t" - "or %[r], %[r], %[c] \n\t" - - /* mask |= (abs(p1 - p0) > limit) - * hev |= (abs(p1 - p0) > thresh) - */ - "subu_s.qb %[c], %[p1], %[p0] \n\t" - "subu_s.qb %[r_k], %[p0], %[p1] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[thresh], %[r_k] \n\t" - "or %[r3], $0, %[c] \n\t" - "cmpgu.lt.qb %[c], %[limit], %[r_k] \n\t" - "or %[r], %[r], %[c] \n\t" - - /* mask |= (abs(q1 - q0) > limit) - * hev |= (abs(q1 - q0) > thresh) - */ - "subu_s.qb %[c], %[q1], %[q0] \n\t" - "subu_s.qb %[r_k], %[q0], %[q1] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[thresh], %[r_k] \n\t" - "or %[r3], %[r3], %[c] \n\t" - "cmpgu.lt.qb %[c], %[limit], %[r_k] \n\t" - "or %[r], %[r], %[c] \n\t" - - /* mask |= (abs(q2 - q1) > limit) */ - "subu_s.qb %[c], %[q2], %[q1] \n\t" - "subu_s.qb %[r_k], %[q1], %[q2] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[limit], %[r_k] \n\t" - "or %[r], %[r], %[c] \n\t" - "sll %[r3], %[r3], 24 \n\t" - - /* mask |= (abs(q3 - q2) > limit) */ - "subu_s.qb %[c], %[q3], %[q2] \n\t" - "subu_s.qb %[r_k], %[q2], %[q3] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[limit], %[r_k] \n\t" - "or %[r], %[r], %[c] \n\t" - - : [c] "=&r" (c), [r_k] "=&r" (r_k), - [r] "=&r" (r), [r3] "=&r" (r3) - : [limit] "r" (limit), [p3] "r" (p3), [p2] "r" (p2), - [p1] "r" (p1), [p0] "r" (p0), [q1] "r" (q1), [q0] "r" (q0), - [q2] "r" (q2), [q3] "r" (q3), [thresh] "r" (thresh) - ); - - __asm__ __volatile__ ( - /* abs(p0 - q0) */ - "subu_s.qb %[c], %[p0], %[q0] \n\t" - "subu_s.qb %[r_k], %[q0], %[p0] \n\t" - "wrdsp %[r3] \n\t" - "or %[s1], %[r_k], %[c] \n\t" - - /* abs(p1 - q1) */ - "subu_s.qb %[c], %[p1], %[q1] \n\t" - "addu_s.qb %[s3], %[s1], %[s1] \n\t" - "pick.qb %[hev1], %[ones], $0 \n\t" - "subu_s.qb %[r_k], %[q1], %[p1] \n\t" - "or %[s2], %[r_k], %[c] \n\t" - - /* abs(p0 - q0) * 2 + abs(p1 - q1) / 2 > flimit * 2 + limit */ - "shrl.qb %[s2], %[s2], 1 \n\t" - "addu_s.qb %[s1], %[s2], %[s3] \n\t" - "cmpgu.lt.qb %[c], %[flimit], %[s1] \n\t" - "or %[r], %[r], %[c] \n\t" - "sll %[r], %[r], 24 \n\t" - - "wrdsp %[r] \n\t" - "pick.qb %[s2], $0, %[ones] \n\t" - - : [c] "=&r" (c), [r_k] "=&r" (r_k), [s1] "=&r" (s1), [hev1] "=&r" (hev1), - [s2] "=&r" (s2), [r] "+r" (r), [s3] "=&r" (s3) - : [p0] "r" (p0), [q0] "r" (q0), [p1] "r" (p1), [r3] "r" (r3), - [q1] "r" (q1), [ones] "r" (ones), [flimit] "r" (flimit) - ); - - *hev = hev1; - *mask = s2; -} - -static INLINE void vp9_filter_hev_mask_flatmask4_dspr2(uint32_t limit, - uint32_t flimit, - uint32_t thresh, - uint32_t p1, uint32_t p0, - uint32_t p3, uint32_t p2, - uint32_t q0, uint32_t q1, - uint32_t q2, uint32_t q3, - uint32_t *hev, - uint32_t *mask, - uint32_t *flat) { - uint32_t c, r, r3, r_k, r_flat; - uint32_t s1, s2, s3; - uint32_t ones = 0xFFFFFFFF; - uint32_t flat_thresh = 0x01010101; - uint32_t hev1; - uint32_t flat1; - - __asm__ __volatile__ ( - /* mask |= (abs(p3 - p2) > limit) */ - "subu_s.qb %[c], %[p3], %[p2] \n\t" - "subu_s.qb %[r_k], %[p2], %[p3] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[limit], %[r_k] \n\t" - "or %[r], $0, %[c] \n\t" - - /* mask |= (abs(p2 - p1) > limit) */ - "subu_s.qb %[c], %[p2], %[p1] \n\t" - "subu_s.qb %[r_k], %[p1], %[p2] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[limit], %[r_k] \n\t" - "or %[r], %[r], %[c] \n\t" - - /* mask |= (abs(p1 - p0) > limit) - * hev |= (abs(p1 - p0) > thresh) - * flat |= (abs(p1 - p0) > thresh) - */ - "subu_s.qb %[c], %[p1], %[p0] \n\t" - "subu_s.qb %[r_k], %[p0], %[p1] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[thresh], %[r_k] \n\t" - "or %[r3], $0, %[c] \n\t" - "cmpgu.lt.qb %[c], %[limit], %[r_k] \n\t" - "or %[r], %[r], %[c] \n\t" - "cmpgu.lt.qb %[c], %[flat_thresh], %[r_k] \n\t" - "or %[r_flat], $0, %[c] \n\t" - - /* mask |= (abs(q1 - q0) > limit) - * hev |= (abs(q1 - q0) > thresh) - * flat |= (abs(q1 - q0) > thresh) - */ - "subu_s.qb %[c], %[q1], %[q0] \n\t" - "subu_s.qb %[r_k], %[q0], %[q1] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[thresh], %[r_k] \n\t" - "or %[r3], %[r3], %[c] \n\t" - "cmpgu.lt.qb %[c], %[limit], %[r_k] \n\t" - "or %[r], %[r], %[c] \n\t" - "cmpgu.lt.qb %[c], %[flat_thresh], %[r_k] \n\t" - "or %[r_flat], %[r_flat], %[c] \n\t" - - /* flat |= (abs(p0 - p2) > thresh) */ - "subu_s.qb %[c], %[p0], %[p2] \n\t" - "subu_s.qb %[r_k], %[p2], %[p0] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[flat_thresh], %[r_k] \n\t" - "or %[r_flat], %[r_flat], %[c] \n\t" - - /* flat |= (abs(q0 - q2) > thresh) */ - "subu_s.qb %[c], %[q0], %[q2] \n\t" - "subu_s.qb %[r_k], %[q2], %[q0] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[flat_thresh], %[r_k] \n\t" - "or %[r_flat], %[r_flat], %[c] \n\t" - - /* flat |= (abs(p3 - p0) > thresh) */ - "subu_s.qb %[c], %[p3], %[p0] \n\t" - "subu_s.qb %[r_k], %[p0], %[p3] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[flat_thresh], %[r_k] \n\t" - "or %[r_flat], %[r_flat], %[c] \n\t" - - /* flat |= (abs(q3 - q0) > thresh) */ - "subu_s.qb %[c], %[q3], %[q0] \n\t" - "subu_s.qb %[r_k], %[q0], %[q3] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[flat_thresh], %[r_k] \n\t" - "or %[r_flat], %[r_flat], %[c] \n\t" - "sll %[r_flat], %[r_flat], 24 \n\t" - /* look at stall here */ - "wrdsp %[r_flat] \n\t" - "pick.qb %[flat1], $0, %[ones] \n\t" - - /* mask |= (abs(q2 - q1) > limit) */ - "subu_s.qb %[c], %[q2], %[q1] \n\t" - "subu_s.qb %[r_k], %[q1], %[q2] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[limit], %[r_k] \n\t" - "or %[r], %[r], %[c] \n\t" - "sll %[r3], %[r3], 24 \n\t" - - /* mask |= (abs(q3 - q2) > limit) */ - "subu_s.qb %[c], %[q3], %[q2] \n\t" - "subu_s.qb %[r_k], %[q2], %[q3] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[limit], %[r_k] \n\t" - "or %[r], %[r], %[c] \n\t" - - : [c] "=&r" (c), [r_k] "=&r" (r_k), [r] "=&r" (r), [r3] "=&r" (r3), - [r_flat] "=&r" (r_flat), [flat1] "=&r" (flat1) - : [limit] "r" (limit), [p3] "r" (p3), [p2] "r" (p2), - [p1] "r" (p1), [p0] "r" (p0), [q1] "r" (q1), [q0] "r" (q0), - [q2] "r" (q2), [q3] "r" (q3), [thresh] "r" (thresh), - [flat_thresh] "r" (flat_thresh), [ones] "r" (ones) - ); - - __asm__ __volatile__ ( - /* abs(p0 - q0) */ - "subu_s.qb %[c], %[p0], %[q0] \n\t" - "subu_s.qb %[r_k], %[q0], %[p0] \n\t" - "wrdsp %[r3] \n\t" - "or %[s1], %[r_k], %[c] \n\t" - - /* abs(p1 - q1) */ - "subu_s.qb %[c], %[p1], %[q1] \n\t" - "addu_s.qb %[s3], %[s1], %[s1] \n\t" - "pick.qb %[hev1], %[ones], $0 \n\t" - "subu_s.qb %[r_k], %[q1], %[p1] \n\t" - "or %[s2], %[r_k], %[c] \n\t" - - /* abs(p0 - q0) * 2 + abs(p1 - q1) / 2 > flimit * 2 + limit */ - "shrl.qb %[s2], %[s2], 1 \n\t" - "addu_s.qb %[s1], %[s2], %[s3] \n\t" - "cmpgu.lt.qb %[c], %[flimit], %[s1] \n\t" - "or %[r], %[r], %[c] \n\t" - "sll %[r], %[r], 24 \n\t" - - "wrdsp %[r] \n\t" - "pick.qb %[s2], $0, %[ones] \n\t" - - : [c] "=&r" (c), [r_k] "=&r" (r_k), [s1] "=&r" (s1), [hev1] "=&r" (hev1), - [s2] "=&r" (s2), [r] "+r" (r), [s3] "=&r" (s3) - : [p0] "r" (p0), [q0] "r" (q0), [p1] "r" (p1), [r3] "r" (r3), - [q1] "r" (q1), [ones] "r" (ones), [flimit] "r" (flimit) - ); - - *hev = hev1; - *mask = s2; - *flat = flat1; -} - -static INLINE void vp9_flatmask5(uint32_t p4, uint32_t p3, - uint32_t p2, uint32_t p1, - uint32_t p0, uint32_t q0, - uint32_t q1, uint32_t q2, - uint32_t q3, uint32_t q4, - uint32_t *flat2) { - uint32_t c, r, r_k, r_flat; - uint32_t ones = 0xFFFFFFFF; - uint32_t flat_thresh = 0x01010101; - uint32_t flat1, flat3; - - __asm__ __volatile__ ( - /* flat |= (abs(p4 - p0) > thresh) */ - "subu_s.qb %[c], %[p4], %[p0] \n\t" - "subu_s.qb %[r_k], %[p0], %[p4] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[flat_thresh], %[r_k] \n\t" - "or %[r], $0, %[c] \n\t" - - /* flat |= (abs(q4 - q0) > thresh) */ - "subu_s.qb %[c], %[q4], %[q0] \n\t" - "subu_s.qb %[r_k], %[q0], %[q4] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[flat_thresh], %[r_k] \n\t" - "or %[r], %[r], %[c] \n\t" - "sll %[r], %[r], 24 \n\t" - "wrdsp %[r] \n\t" - "pick.qb %[flat3], $0, %[ones] \n\t" - - /* flat |= (abs(p1 - p0) > thresh) */ - "subu_s.qb %[c], %[p1], %[p0] \n\t" - "subu_s.qb %[r_k], %[p0], %[p1] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[flat_thresh], %[r_k] \n\t" - "or %[r_flat], $0, %[c] \n\t" - - /* flat |= (abs(q1 - q0) > thresh) */ - "subu_s.qb %[c], %[q1], %[q0] \n\t" - "subu_s.qb %[r_k], %[q0], %[q1] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[flat_thresh], %[r_k] \n\t" - "or %[r_flat], %[r_flat], %[c] \n\t" - - /* flat |= (abs(p0 - p2) > thresh) */ - "subu_s.qb %[c], %[p0], %[p2] \n\t" - "subu_s.qb %[r_k], %[p2], %[p0] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[flat_thresh], %[r_k] \n\t" - "or %[r_flat], %[r_flat], %[c] \n\t" - - /* flat |= (abs(q0 - q2) > thresh) */ - "subu_s.qb %[c], %[q0], %[q2] \n\t" - "subu_s.qb %[r_k], %[q2], %[q0] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[flat_thresh], %[r_k] \n\t" - "or %[r_flat], %[r_flat], %[c] \n\t" - - /* flat |= (abs(p3 - p0) > thresh) */ - "subu_s.qb %[c], %[p3], %[p0] \n\t" - "subu_s.qb %[r_k], %[p0], %[p3] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[flat_thresh], %[r_k] \n\t" - "or %[r_flat], %[r_flat], %[c] \n\t" - - /* flat |= (abs(q3 - q0) > thresh) */ - "subu_s.qb %[c], %[q3], %[q0] \n\t" - "subu_s.qb %[r_k], %[q0], %[q3] \n\t" - "or %[r_k], %[r_k], %[c] \n\t" - "cmpgu.lt.qb %[c], %[flat_thresh], %[r_k] \n\t" - "or %[r_flat], %[r_flat], %[c] \n\t" - "sll %[r_flat], %[r_flat], 24 \n\t" - "wrdsp %[r_flat] \n\t" - "pick.qb %[flat1], $0, %[ones] \n\t" - /* flat & flatmask4(thresh, p3, p2, p1, p0, q0, q1, q2, q3) */ - "and %[flat1], %[flat3], %[flat1] \n\t" - - : [c] "=&r" (c), [r_k] "=&r" (r_k), [r] "=&r" (r), - [r_flat] "=&r" (r_flat), [flat1] "=&r" (flat1), [flat3] "=&r" (flat3) - : [p4] "r" (p4), [p3] "r" (p3), [p2] "r" (p2), - [p1] "r" (p1), [p0] "r" (p0), [q0] "r" (q0), [q1] "r" (q1), - [q2] "r" (q2), [q3] "r" (q3), [q4] "r" (q4), - [flat_thresh] "r" (flat_thresh), [ones] "r" (ones) - ); - - *flat2 = flat1; -} -#endif // #if HAVE_DSPR2 -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_MIPS_DSPR2_VP9_LOOPFILTER_MASKS_DSPR2_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_mbloop_loopfilter_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_mbloop_loopfilter_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_mbloop_loopfilter_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_mbloop_loopfilter_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,652 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_loopfilter.h" -#include "vp9/common/vp9_onyxc_int.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" -#include "vp9/common/mips/dspr2/vp9_loopfilter_macros_dspr2.h" -#include "vp9/common/mips/dspr2/vp9_loopfilter_masks_dspr2.h" -#include "vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.h" - -#if HAVE_DSPR2 -void vp9_lpf_horizontal_8_dspr2(unsigned char *s, - int pitch, - const uint8_t *blimit, - const uint8_t *limit, - const uint8_t *thresh, - int count) { - uint32_t mask; - uint32_t hev, flat; - uint8_t i; - uint8_t *sp3, *sp2, *sp1, *sp0, *sq0, *sq1, *sq2, *sq3; - uint32_t thresh_vec, flimit_vec, limit_vec; - uint32_t uflimit, ulimit, uthresh; - uint32_t p1_f0, p0_f0, q0_f0, q1_f0; - uint32_t p3, p2, p1, p0, q0, q1, q2, q3; - uint32_t p0_l, p1_l, p2_l, p3_l, q0_l, q1_l, q2_l, q3_l; - uint32_t p0_r, p1_r, p2_r, p3_r, q0_r, q1_r, q2_r, q3_r; - - uflimit = *blimit; - ulimit = *limit; - uthresh = *thresh; - - /* create quad-byte */ - __asm__ __volatile__ ( - "replv.qb %[thresh_vec], %[uthresh] \n\t" - "replv.qb %[flimit_vec], %[uflimit] \n\t" - "replv.qb %[limit_vec], %[ulimit] \n\t" - - : [thresh_vec] "=&r" (thresh_vec), [flimit_vec] "=&r" (flimit_vec), - [limit_vec] "=r" (limit_vec) - : [uthresh] "r" (uthresh), [uflimit] "r" (uflimit), [ulimit] "r" (ulimit) - ); - - /* prefetch data for store */ - vp9_prefetch_store(s); - - for (i = 0; i < 2; i++) { - sp3 = s - (pitch << 2); - sp2 = sp3 + pitch; - sp1 = sp2 + pitch; - sp0 = sp1 + pitch; - sq0 = s; - sq1 = s + pitch; - sq2 = sq1 + pitch; - sq3 = sq2 + pitch; - - __asm__ __volatile__ ( - "lw %[p3], (%[sp3]) \n\t" - "lw %[p2], (%[sp2]) \n\t" - "lw %[p1], (%[sp1]) \n\t" - "lw %[p0], (%[sp0]) \n\t" - "lw %[q0], (%[sq0]) \n\t" - "lw %[q1], (%[sq1]) \n\t" - "lw %[q2], (%[sq2]) \n\t" - "lw %[q3], (%[sq3]) \n\t" - - : [p3] "=&r" (p3), [p2] "=&r" (p2), [p1] "=&r" (p1), [p0] "=&r" (p0), - [q3] "=&r" (q3), [q2] "=&r" (q2), [q1] "=&r" (q1), [q0] "=&r" (q0) - : [sp3] "r" (sp3), [sp2] "r" (sp2), [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq3] "r" (sq3), [sq2] "r" (sq2), [sq1] "r" (sq1), [sq0] "r" (sq0) - ); - - vp9_filter_hev_mask_flatmask4_dspr2(limit_vec, flimit_vec, thresh_vec, - p1, p0, p3, p2, q0, q1, q2, q3, - &hev, &mask, &flat); - - if ((flat == 0) && (mask != 0)) { - vp9_filter1_dspr2(mask, hev, p1, p0, q0, q1, - &p1_f0, &p0_f0, &q0_f0, &q1_f0); - - __asm__ __volatile__ ( - "sw %[p1_f0], (%[sp1]) \n\t" - "sw %[p0_f0], (%[sp0]) \n\t" - "sw %[q0_f0], (%[sq0]) \n\t" - "sw %[q1_f0], (%[sq1]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1) - ); - } else if ((mask & flat) == 0xFFFFFFFF) { - /* left 2 element operation */ - PACK_LEFT_0TO3() - vp9_mbfilter_dspr2(&p3_l, &p2_l, &p1_l, &p0_l, - &q0_l, &q1_l, &q2_l, &q3_l); - - /* right 2 element operation */ - PACK_RIGHT_0TO3() - vp9_mbfilter_dspr2(&p3_r, &p2_r, &p1_r, &p0_r, - &q0_r, &q1_r, &q2_r, &q3_r); - - COMBINE_LEFT_RIGHT_0TO2() - - __asm__ __volatile__ ( - "sw %[p2], (%[sp2]) \n\t" - "sw %[p1], (%[sp1]) \n\t" - "sw %[p0], (%[sp0]) \n\t" - "sw %[q0], (%[sq0]) \n\t" - "sw %[q1], (%[sq1]) \n\t" - "sw %[q2], (%[sq2]) \n\t" - - : - : [p2] "r" (p2), [p1] "r" (p1), [p0] "r" (p0), - [q0] "r" (q0), [q1] "r" (q1), [q2] "r" (q2), - [sp2] "r" (sp2), [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1), [sq2] "r" (sq2) - ); - } else if ((flat != 0) && (mask != 0)) { - /* filtering */ - vp9_filter1_dspr2(mask, hev, p1, p0, q0, q1, - &p1_f0, &p0_f0, &q0_f0, &q1_f0); - - /* left 2 element operation */ - PACK_LEFT_0TO3() - vp9_mbfilter_dspr2(&p3_l, &p2_l, &p1_l, &p0_l, - &q0_l, &q1_l, &q2_l, &q3_l); - - /* right 2 element operation */ - PACK_RIGHT_0TO3() - vp9_mbfilter_dspr2(&p3_r, &p2_r, &p1_r, &p0_r, - &q0_r, &q1_r, &q2_r, &q3_r); - - if (mask & flat & 0x000000FF) { - __asm__ __volatile__ ( - "sb %[p2_r], (%[sp2]) \n\t" - "sb %[p1_r], (%[sp1]) \n\t" - "sb %[p0_r], (%[sp0]) \n\t" - "sb %[q0_r], (%[sq0]) \n\t" - "sb %[q1_r], (%[sq1]) \n\t" - "sb %[q2_r], (%[sq2]) \n\t" - - : - : [p2_r] "r" (p2_r), [p1_r] "r" (p1_r), [p0_r] "r" (p0_r), - [q0_r] "r" (q0_r), [q1_r] "r" (q1_r), [q2_r] "r" (q2_r), - [sp2] "r" (sp2), [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1), [sq2] "r" (sq2) - ); - } else if (mask & 0x000000FF) { - __asm__ __volatile__ ( - "sb %[p1_f0], (%[sp1]) \n\t" - "sb %[p0_f0], (%[sp0]) \n\t" - "sb %[q0_f0], (%[sq0]) \n\t" - "sb %[q1_f0], (%[sq1]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1) - ); - } - - __asm__ __volatile__ ( - "srl %[p2_r], %[p2_r], 16 \n\t" - "srl %[p1_r], %[p1_r], 16 \n\t" - "srl %[p0_r], %[p0_r], 16 \n\t" - "srl %[q0_r], %[q0_r], 16 \n\t" - "srl %[q1_r], %[q1_r], 16 \n\t" - "srl %[q2_r], %[q2_r], 16 \n\t" - "srl %[p1_f0], %[p1_f0], 8 \n\t" - "srl %[p0_f0], %[p0_f0], 8 \n\t" - "srl %[q0_f0], %[q0_f0], 8 \n\t" - "srl %[q1_f0], %[q1_f0], 8 \n\t" - - : [p2_r] "+r" (p2_r), [p1_r] "+r" (p1_r), [p0_r] "+r" (p0_r), - [q0_r] "+r" (q0_r), [q1_r] "+r" (q1_r), [q2_r] "+r" (q2_r), - [p1_f0] "+r" (p1_f0), [p0_f0] "+r" (p0_f0), - [q0_f0] "+r" (q0_f0), [q1_f0] "+r" (q1_f0) - : - ); - - if (mask & flat & 0x0000FF00) { - __asm__ __volatile__ ( - "sb %[p2_r], +1(%[sp2]) \n\t" - "sb %[p1_r], +1(%[sp1]) \n\t" - "sb %[p0_r], +1(%[sp0]) \n\t" - "sb %[q0_r], +1(%[sq0]) \n\t" - "sb %[q1_r], +1(%[sq1]) \n\t" - "sb %[q2_r], +1(%[sq2]) \n\t" - - : - : [p2_r] "r" (p2_r), [p1_r] "r" (p1_r), [p0_r] "r" (p0_r), - [q0_r] "r" (q0_r), [q1_r] "r" (q1_r), [q2_r] "r" (q2_r), - [sp2] "r" (sp2), [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1), [sq2] "r" (sq2) - ); - } else if (mask & 0x0000FF00) { - __asm__ __volatile__ ( - "sb %[p1_f0], +1(%[sp1]) \n\t" - "sb %[p0_f0], +1(%[sp0]) \n\t" - "sb %[q0_f0], +1(%[sq0]) \n\t" - "sb %[q1_f0], +1(%[sq1]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1) - ); - } - - __asm__ __volatile__ ( - "srl %[p1_f0], %[p1_f0], 8 \n\t" - "srl %[p0_f0], %[p0_f0], 8 \n\t" - "srl %[q0_f0], %[q0_f0], 8 \n\t" - "srl %[q1_f0], %[q1_f0], 8 \n\t" - - : [p2] "+r" (p2), [p1] "+r" (p1), [p0] "+r" (p0), - [q0] "+r" (q0), [q1] "+r" (q1), [q2] "+r" (q2), - [p1_f0] "+r" (p1_f0), [p0_f0] "+r" (p0_f0), - [q0_f0] "+r" (q0_f0), [q1_f0] "+r" (q1_f0) - : - ); - - if (mask & flat & 0x00FF0000) { - __asm__ __volatile__ ( - "sb %[p2_l], +2(%[sp2]) \n\t" - "sb %[p1_l], +2(%[sp1]) \n\t" - "sb %[p0_l], +2(%[sp0]) \n\t" - "sb %[q0_l], +2(%[sq0]) \n\t" - "sb %[q1_l], +2(%[sq1]) \n\t" - "sb %[q2_l], +2(%[sq2]) \n\t" - - : - : [p2_l] "r" (p2_l), [p1_l] "r" (p1_l), [p0_l] "r" (p0_l), - [q0_l] "r" (q0_l), [q1_l] "r" (q1_l), [q2_l] "r" (q2_l), - [sp2] "r" (sp2), [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1), [sq2] "r" (sq2) - ); - } else if (mask & 0x00FF0000) { - __asm__ __volatile__ ( - "sb %[p1_f0], +2(%[sp1]) \n\t" - "sb %[p0_f0], +2(%[sp0]) \n\t" - "sb %[q0_f0], +2(%[sq0]) \n\t" - "sb %[q1_f0], +2(%[sq1]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1) - ); - } - - __asm__ __volatile__ ( - "srl %[p2_l], %[p2_l], 16 \n\t" - "srl %[p1_l], %[p1_l], 16 \n\t" - "srl %[p0_l], %[p0_l], 16 \n\t" - "srl %[q0_l], %[q0_l], 16 \n\t" - "srl %[q1_l], %[q1_l], 16 \n\t" - "srl %[q2_l], %[q2_l], 16 \n\t" - "srl %[p1_f0], %[p1_f0], 8 \n\t" - "srl %[p0_f0], %[p0_f0], 8 \n\t" - "srl %[q0_f0], %[q0_f0], 8 \n\t" - "srl %[q1_f0], %[q1_f0], 8 \n\t" - - : [p2_l] "+r" (p2_l), [p1_l] "+r" (p1_l), [p0_l] "+r" (p0_l), - [q0_l] "+r" (q0_l), [q1_l] "+r" (q1_l), [q2_l] "+r" (q2_l), - [p1_f0] "+r" (p1_f0), [p0_f0] "+r" (p0_f0), - [q0_f0] "+r" (q0_f0), [q1_f0] "+r" (q1_f0) - : - ); - - if (mask & flat & 0xFF000000) { - __asm__ __volatile__ ( - "sb %[p2_l], +3(%[sp2]) \n\t" - "sb %[p1_l], +3(%[sp1]) \n\t" - "sb %[p0_l], +3(%[sp0]) \n\t" - "sb %[q0_l], +3(%[sq0]) \n\t" - "sb %[q1_l], +3(%[sq1]) \n\t" - "sb %[q2_l], +3(%[sq2]) \n\t" - - : - : [p2_l] "r" (p2_l), [p1_l] "r" (p1_l), [p0_l] "r" (p0_l), - [q0_l] "r" (q0_l), [q1_l] "r" (q1_l), [q2_l] "r" (q2_l), - [sp2] "r" (sp2), [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1), [sq2] "r" (sq2) - ); - } else if (mask & 0xFF000000) { - __asm__ __volatile__ ( - "sb %[p1_f0], +3(%[sp1]) \n\t" - "sb %[p0_f0], +3(%[sp0]) \n\t" - "sb %[q0_f0], +3(%[sq0]) \n\t" - "sb %[q1_f0], +3(%[sq1]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1) - ); - } - } - - s = s + 4; - } -} - -void vp9_lpf_vertical_8_dspr2(unsigned char *s, - int pitch, - const uint8_t *blimit, - const uint8_t *limit, - const uint8_t *thresh, - int count) { - uint8_t i; - uint32_t mask, hev, flat; - uint8_t *s1, *s2, *s3, *s4; - uint32_t prim1, prim2, sec3, sec4, prim3, prim4; - uint32_t thresh_vec, flimit_vec, limit_vec; - uint32_t uflimit, ulimit, uthresh; - uint32_t p3, p2, p1, p0, q3, q2, q1, q0; - uint32_t p1_f0, p0_f0, q0_f0, q1_f0; - uint32_t p0_l, p1_l, p2_l, p3_l, q0_l, q1_l, q2_l, q3_l; - uint32_t p0_r, p1_r, p2_r, p3_r, q0_r, q1_r, q2_r, q3_r; - - uflimit = *blimit; - ulimit = *limit; - uthresh = *thresh; - - /* create quad-byte */ - __asm__ __volatile__ ( - "replv.qb %[thresh_vec], %[uthresh] \n\t" - "replv.qb %[flimit_vec], %[uflimit] \n\t" - "replv.qb %[limit_vec], %[ulimit] \n\t" - - : [thresh_vec] "=&r" (thresh_vec), [flimit_vec] "=&r" (flimit_vec), - [limit_vec] "=r" (limit_vec) - : [uthresh] "r" (uthresh), [uflimit] "r" (uflimit), [ulimit] "r" (ulimit) - ); - - vp9_prefetch_store(s + pitch); - - for (i = 0; i < 2; i++) { - s1 = s; - s2 = s + pitch; - s3 = s2 + pitch; - s4 = s3 + pitch; - s = s4 + pitch; - - __asm__ __volatile__ ( - "lw %[p0], -4(%[s1]) \n\t" - "lw %[p1], -4(%[s2]) \n\t" - "lw %[p2], -4(%[s3]) \n\t" - "lw %[p3], -4(%[s4]) \n\t" - "lw %[q3], (%[s1]) \n\t" - "lw %[q2], (%[s2]) \n\t" - "lw %[q1], (%[s3]) \n\t" - "lw %[q0], (%[s4]) \n\t" - - : [p3] "=&r" (p3), [p2] "=&r" (p2), [p1] "=&r" (p1), [p0] "=&r" (p0), - [q0] "=&r" (q0), [q1] "=&r" (q1), [q2] "=&r" (q2), [q3] "=&r" (q3) - : [s1] "r" (s1), [s2] "r" (s2), [s3] "r" (s3), [s4] "r" (s4) - ); - - /* transpose p3, p2, p1, p0 - original (when loaded from memory) - register -4 -3 -2 -1 - p0 p0_0 p0_1 p0_2 p0_3 - p1 p1_0 p1_1 p1_2 p1_3 - p2 p2_0 p2_1 p2_2 p2_3 - p3 p3_0 p3_1 p3_2 p3_3 - - after transpose - register - p0 p3_3 p2_3 p1_3 p0_3 - p1 p3_2 p2_2 p1_2 p0_2 - p2 p3_1 p2_1 p1_1 p0_1 - p3 p3_0 p2_0 p1_0 p0_0 - */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[p0], %[p1] \n\t" - "precr.qb.ph %[prim2], %[p0], %[p1] \n\t" - "precrq.qb.ph %[prim3], %[p2], %[p3] \n\t" - "precr.qb.ph %[prim4], %[p2], %[p3] \n\t" - - "precrq.qb.ph %[p1], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[p3], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[p0], %[p1], %[sec3] \n\t" - "precrq.ph.w %[p2], %[p3], %[sec4] \n\t" - "append %[p1], %[sec3], 16 \n\t" - "append %[p3], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [p0] "+r" (p0), [p1] "+r" (p1), [p2] "+r" (p2), [p3] "+r" (p3), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - /* transpose q0, q1, q2, q3 - original (when loaded from memory) - register +1 +2 +3 +4 - q3 q3_0 q3_1 q3_2 q3_3 - q2 q2_0 q2_1 q2_2 q2_3 - q1 q1_0 q1_1 q1_2 q1_3 - q0 q0_0 q0_1 q0_2 q0_3 - - after transpose - register - q3 q0_3 q1_3 q2_3 q3_3 - q2 q0_2 q1_2 q2_2 q3_2 - q1 q0_1 q1_1 q2_1 q3_1 - q0 q0_0 q1_0 q2_0 q3_0 - */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[q3], %[q2] \n\t" - "precr.qb.ph %[prim2], %[q3], %[q2] \n\t" - "precrq.qb.ph %[prim3], %[q1], %[q0] \n\t" - "precr.qb.ph %[prim4], %[q1], %[q0] \n\t" - - "precrq.qb.ph %[q2], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[q0], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[q3], %[q2], %[sec3] \n\t" - "precrq.ph.w %[q1], %[q0], %[sec4] \n\t" - "append %[q2], %[sec3], 16 \n\t" - "append %[q0], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [q3] "+r" (q3), [q2] "+r" (q2), [q1] "+r" (q1), [q0] "+r" (q0), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - vp9_filter_hev_mask_flatmask4_dspr2(limit_vec, flimit_vec, thresh_vec, - p1, p0, p3, p2, q0, q1, q2, q3, - &hev, &mask, &flat); - - if ((flat == 0) && (mask != 0)) { - vp9_filter1_dspr2(mask, hev, p1, p0, q0, q1, - &p1_f0, &p0_f0, &q0_f0, &q1_f0); - STORE_F0() - } else if ((mask & flat) == 0xFFFFFFFF) { - /* left 2 element operation */ - PACK_LEFT_0TO3() - vp9_mbfilter_dspr2(&p3_l, &p2_l, &p1_l, &p0_l, - &q0_l, &q1_l, &q2_l, &q3_l); - - /* right 2 element operation */ - PACK_RIGHT_0TO3() - vp9_mbfilter_dspr2(&p3_r, &p2_r, &p1_r, &p0_r, - &q0_r, &q1_r, &q2_r, &q3_r); - - STORE_F1() - } else if ((flat != 0) && (mask != 0)) { - vp9_filter1_dspr2(mask, hev, p1, p0, q0, q1, - &p1_f0, &p0_f0, &q0_f0, &q1_f0); - - /* left 2 element operation */ - PACK_LEFT_0TO3() - vp9_mbfilter_dspr2(&p3_l, &p2_l, &p1_l, &p0_l, - &q0_l, &q1_l, &q2_l, &q3_l); - - /* right 2 element operation */ - PACK_RIGHT_0TO3() - vp9_mbfilter_dspr2(&p3_r, &p2_r, &p1_r, &p0_r, - &q0_r, &q1_r, &q2_r, &q3_r); - - if (mask & flat & 0x000000FF) { - __asm__ __volatile__ ( - "sb %[p2_r], -3(%[s4]) \n\t" - "sb %[p1_r], -2(%[s4]) \n\t" - "sb %[p0_r], -1(%[s4]) \n\t" - "sb %[q0_r], (%[s4]) \n\t" - "sb %[q1_r], +1(%[s4]) \n\t" - "sb %[q2_r], +2(%[s4]) \n\t" - - : - : [p2_r] "r" (p2_r), [p1_r] "r" (p1_r), [p0_r] "r" (p0_r), - [q0_r] "r" (q0_r), [q1_r] "r" (q1_r), [q2_r] "r" (q2_r), - [s4] "r" (s4) - ); - } else if (mask & 0x000000FF) { - __asm__ __volatile__ ( - "sb %[p1_f0], -2(%[s4]) \n\t" - "sb %[p0_f0], -1(%[s4]) \n\t" - "sb %[q0_f0], (%[s4]) \n\t" - "sb %[q1_f0], +1(%[s4]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [s4] "r" (s4) - ); - } - - __asm__ __volatile__ ( - "srl %[p2_r], %[p2_r], 16 \n\t" - "srl %[p1_r], %[p1_r], 16 \n\t" - "srl %[p0_r], %[p0_r], 16 \n\t" - "srl %[q0_r], %[q0_r], 16 \n\t" - "srl %[q1_r], %[q1_r], 16 \n\t" - "srl %[q2_r], %[q2_r], 16 \n\t" - "srl %[p1_f0], %[p1_f0], 8 \n\t" - "srl %[p0_f0], %[p0_f0], 8 \n\t" - "srl %[q0_f0], %[q0_f0], 8 \n\t" - "srl %[q1_f0], %[q1_f0], 8 \n\t" - - : [p2_r] "+r" (p2_r), [p1_r] "+r" (p1_r), [p0_r] "+r" (p0_r), - [q0_r] "+r" (q0_r), [q1_r] "+r" (q1_r), [q2_r] "+r" (q2_r), - [p1_f0] "+r" (p1_f0), [p0_f0] "+r" (p0_f0), - [q0_f0] "+r" (q0_f0), [q1_f0] "+r" (q1_f0) - : - ); - - if (mask & flat & 0x0000FF00) { - __asm__ __volatile__ ( - "sb %[p2_r], -3(%[s3]) \n\t" - "sb %[p1_r], -2(%[s3]) \n\t" - "sb %[p0_r], -1(%[s3]) \n\t" - "sb %[q0_r], (%[s3]) \n\t" - "sb %[q1_r], +1(%[s3]) \n\t" - "sb %[q2_r], +2(%[s3]) \n\t" - - : - : [p2_r] "r" (p2_r), [p1_r] "r" (p1_r), [p0_r] "r" (p0_r), - [q0_r] "r" (q0_r), [q1_r] "r" (q1_r), [q2_r] "r" (q2_r), - [s3] "r" (s3) - ); - } else if (mask & 0x0000FF00) { - __asm__ __volatile__ ( - "sb %[p1_f0], -2(%[s3]) \n\t" - "sb %[p0_f0], -1(%[s3]) \n\t" - "sb %[q0_f0], (%[s3]) \n\t" - "sb %[q1_f0], +1(%[s3]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [s3] "r" (s3) - ); - } - - __asm__ __volatile__ ( - "srl %[p1_f0], %[p1_f0], 8 \n\t" - "srl %[p0_f0], %[p0_f0], 8 \n\t" - "srl %[q0_f0], %[q0_f0], 8 \n\t" - "srl %[q1_f0], %[q1_f0], 8 \n\t" - - : [p2] "+r" (p2), [p1] "+r" (p1), [p0] "+r" (p0), - [q0] "+r" (q0), [q1] "+r" (q1), [q2] "+r" (q2), - [p1_f0] "+r" (p1_f0), [p0_f0] "+r" (p0_f0), - [q0_f0] "+r" (q0_f0), [q1_f0] "+r" (q1_f0) - : - ); - - if (mask & flat & 0x00FF0000) { - __asm__ __volatile__ ( - "sb %[p2_l], -3(%[s2]) \n\t" - "sb %[p1_l], -2(%[s2]) \n\t" - "sb %[p0_l], -1(%[s2]) \n\t" - "sb %[q0_l], (%[s2]) \n\t" - "sb %[q1_l], +1(%[s2]) \n\t" - "sb %[q2_l], +2(%[s2]) \n\t" - - : - : [p2_l] "r" (p2_l), [p1_l] "r" (p1_l), [p0_l] "r" (p0_l), - [q0_l] "r" (q0_l), [q1_l] "r" (q1_l), [q2_l] "r" (q2_l), - [s2] "r" (s2) - ); - } else if (mask & 0x00FF0000) { - __asm__ __volatile__ ( - "sb %[p1_f0], -2(%[s2]) \n\t" - "sb %[p0_f0], -1(%[s2]) \n\t" - "sb %[q0_f0], (%[s2]) \n\t" - "sb %[q1_f0], +1(%[s2]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [s2] "r" (s2) - ); - } - - __asm__ __volatile__ ( - "srl %[p2_l], %[p2_l], 16 \n\t" - "srl %[p1_l], %[p1_l], 16 \n\t" - "srl %[p0_l], %[p0_l], 16 \n\t" - "srl %[q0_l], %[q0_l], 16 \n\t" - "srl %[q1_l], %[q1_l], 16 \n\t" - "srl %[q2_l], %[q2_l], 16 \n\t" - "srl %[p1_f0], %[p1_f0], 8 \n\t" - "srl %[p0_f0], %[p0_f0], 8 \n\t" - "srl %[q0_f0], %[q0_f0], 8 \n\t" - "srl %[q1_f0], %[q1_f0], 8 \n\t" - - : [p2_l] "+r" (p2_l), [p1_l] "+r" (p1_l), [p0_l] "+r" (p0_l), - [q0_l] "+r" (q0_l), [q1_l] "+r" (q1_l), [q2_l] "+r" (q2_l), - [p1_f0] "+r" (p1_f0), [p0_f0] "+r" (p0_f0), - [q0_f0] "+r" (q0_f0), [q1_f0] "+r" (q1_f0) - : - ); - - if (mask & flat & 0xFF000000) { - __asm__ __volatile__ ( - "sb %[p2_l], -3(%[s1]) \n\t" - "sb %[p1_l], -2(%[s1]) \n\t" - "sb %[p0_l], -1(%[s1]) \n\t" - "sb %[q0_l], (%[s1]) \n\t" - "sb %[q1_l], +1(%[s1]) \n\t" - "sb %[q2_l], +2(%[s1]) \n\t" - - : - : [p2_l] "r" (p2_l), [p1_l] "r" (p1_l), [p0_l] "r" (p0_l), - [q0_l] "r" (q0_l), [q1_l] "r" (q1_l), [q2_l] "r" (q2_l), - [s1] "r" (s1) - ); - } else if (mask & 0xFF000000) { - __asm__ __volatile__ ( - "sb %[p1_f0], -2(%[s1]) \n\t" - "sb %[p0_f0], -1(%[s1]) \n\t" - "sb %[q0_f0], (%[s1]) \n\t" - "sb %[q1_f0], +1(%[s1]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), [q0_f0] "r" (q0_f0), - [q1_f0] "r" (q1_f0), [s1] "r" (s1) - ); - } - } - } -} -#endif // #if HAVE_DSPR2 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_mblpf_horiz_loopfilter_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_mblpf_horiz_loopfilter_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_mblpf_horiz_loopfilter_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_mblpf_horiz_loopfilter_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,795 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_loopfilter.h" -#include "vp9/common/vp9_onyxc_int.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" -#include "vp9/common/mips/dspr2/vp9_loopfilter_macros_dspr2.h" -#include "vp9/common/mips/dspr2/vp9_loopfilter_masks_dspr2.h" -#include "vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.h" - -#if HAVE_DSPR2 -void vp9_lpf_horizontal_16_dspr2(unsigned char *s, - int pitch, - const uint8_t *blimit, - const uint8_t *limit, - const uint8_t *thresh, - int count) { - uint32_t mask; - uint32_t hev, flat, flat2; - uint8_t i; - uint8_t *sp7, *sp6, *sp5, *sp4, *sp3, *sp2, *sp1, *sp0; - uint8_t *sq0, *sq1, *sq2, *sq3, *sq4, *sq5, *sq6, *sq7; - uint32_t thresh_vec, flimit_vec, limit_vec; - uint32_t uflimit, ulimit, uthresh; - uint32_t p7, p6, p5, p4, p3, p2, p1, p0, q0, q1, q2, q3, q4, q5, q6, q7; - uint32_t p1_f0, p0_f0, q0_f0, q1_f0; - uint32_t p7_l, p6_l, p5_l, p4_l, p3_l, p2_l, p1_l, p0_l; - uint32_t q0_l, q1_l, q2_l, q3_l, q4_l, q5_l, q6_l, q7_l; - uint32_t p7_r, p6_r, p5_r, p4_r, p3_r, p2_r, p1_r, p0_r; - uint32_t q0_r, q1_r, q2_r, q3_r, q4_r, q5_r, q6_r, q7_r; - uint32_t p2_l_f1, p1_l_f1, p0_l_f1, p2_r_f1, p1_r_f1, p0_r_f1; - uint32_t q0_l_f1, q1_l_f1, q2_l_f1, q0_r_f1, q1_r_f1, q2_r_f1; - - uflimit = *blimit; - ulimit = *limit; - uthresh = *thresh; - - /* create quad-byte */ - __asm__ __volatile__ ( - "replv.qb %[thresh_vec], %[uthresh] \n\t" - "replv.qb %[flimit_vec], %[uflimit] \n\t" - "replv.qb %[limit_vec], %[ulimit] \n\t" - - : [thresh_vec] "=&r" (thresh_vec), [flimit_vec] "=&r" (flimit_vec), - [limit_vec] "=r" (limit_vec) - : [uthresh] "r" (uthresh), [uflimit] "r" (uflimit), [ulimit] "r" (ulimit) - ); - - /* prefetch data for store */ - vp9_prefetch_store(s); - - for (i = 0; i < (2 * count); i++) { - sp7 = s - (pitch << 3); - sp6 = sp7 + pitch; - sp5 = sp6 + pitch; - sp4 = sp5 + pitch; - sp3 = sp4 + pitch; - sp2 = sp3 + pitch; - sp1 = sp2 + pitch; - sp0 = sp1 + pitch; - sq0 = s; - sq1 = s + pitch; - sq2 = sq1 + pitch; - sq3 = sq2 + pitch; - sq4 = sq3 + pitch; - sq5 = sq4 + pitch; - sq6 = sq5 + pitch; - sq7 = sq6 + pitch; - - __asm__ __volatile__ ( - "lw %[p7], (%[sp7]) \n\t" - "lw %[p6], (%[sp6]) \n\t" - "lw %[p5], (%[sp5]) \n\t" - "lw %[p4], (%[sp4]) \n\t" - "lw %[p3], (%[sp3]) \n\t" - "lw %[p2], (%[sp2]) \n\t" - "lw %[p1], (%[sp1]) \n\t" - "lw %[p0], (%[sp0]) \n\t" - - : [p3] "=&r" (p3), [p2] "=&r" (p2), [p1] "=&r" (p1), [p0] "=&r" (p0), - [p7] "=&r" (p7), [p6] "=&r" (p6), [p5] "=&r" (p5), [p4] "=&r" (p4) - : [sp3] "r" (sp3), [sp2] "r" (sp2), [sp1] "r" (sp1), [sp0] "r" (sp0), - [sp4] "r" (sp4), [sp5] "r" (sp5), [sp6] "r" (sp6), [sp7] "r" (sp7) - ); - - __asm__ __volatile__ ( - "lw %[q0], (%[sq0]) \n\t" - "lw %[q1], (%[sq1]) \n\t" - "lw %[q2], (%[sq2]) \n\t" - "lw %[q3], (%[sq3]) \n\t" - "lw %[q4], (%[sq4]) \n\t" - "lw %[q5], (%[sq5]) \n\t" - "lw %[q6], (%[sq6]) \n\t" - "lw %[q7], (%[sq7]) \n\t" - - : [q3] "=&r" (q3), [q2] "=&r" (q2), [q1] "=&r" (q1), [q0] "=&r" (q0), - [q7] "=&r" (q7), [q6] "=&r" (q6), [q5] "=&r" (q5), [q4] "=&r" (q4) - : [sq3] "r" (sq3), [sq2] "r" (sq2), [sq1] "r" (sq1), [sq0] "r" (sq0), - [sq4] "r" (sq4), [sq5] "r" (sq5), [sq6] "r" (sq6), [sq7] "r" (sq7) - ); - - vp9_filter_hev_mask_flatmask4_dspr2(limit_vec, flimit_vec, thresh_vec, - p1, p0, p3, p2, q0, q1, q2, q3, - &hev, &mask, &flat); - - vp9_flatmask5(p7, p6, p5, p4, p0, q0, q4, q5, q6, q7, &flat2); - - /* f0 */ - if (((flat2 == 0) && (flat == 0) && (mask != 0)) || - ((flat2 != 0) && (flat == 0) && (mask != 0))) { - vp9_filter1_dspr2(mask, hev, p1, p0, q0, q1, - &p1_f0, &p0_f0, &q0_f0, &q1_f0); - - __asm__ __volatile__ ( - "sw %[p1_f0], (%[sp1]) \n\t" - "sw %[p0_f0], (%[sp0]) \n\t" - "sw %[q0_f0], (%[sq0]) \n\t" - "sw %[q1_f0], (%[sq1]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1) - ); - } else if ((flat2 == 0XFFFFFFFF) && (flat == 0xFFFFFFFF) && - (mask == 0xFFFFFFFF)) { - /* f2 */ - PACK_LEFT_0TO3() - PACK_LEFT_4TO7() - vp9_wide_mbfilter_dspr2(&p7_l, &p6_l, &p5_l, &p4_l, - &p3_l, &p2_l, &p1_l, &p0_l, - &q0_l, &q1_l, &q2_l, &q3_l, - &q4_l, &q5_l, &q6_l, &q7_l); - - PACK_RIGHT_0TO3() - PACK_RIGHT_4TO7() - vp9_wide_mbfilter_dspr2(&p7_r, &p6_r, &p5_r, &p4_r, - &p3_r, &p2_r, &p1_r, &p0_r, - &q0_r, &q1_r, &q2_r, &q3_r, - &q4_r, &q5_r, &q6_r, &q7_r); - - COMBINE_LEFT_RIGHT_0TO2() - COMBINE_LEFT_RIGHT_3TO6() - - __asm__ __volatile__ ( - "sw %[p6], (%[sp6]) \n\t" - "sw %[p5], (%[sp5]) \n\t" - "sw %[p4], (%[sp4]) \n\t" - "sw %[p3], (%[sp3]) \n\t" - "sw %[p2], (%[sp2]) \n\t" - "sw %[p1], (%[sp1]) \n\t" - "sw %[p0], (%[sp0]) \n\t" - - : - : [p6] "r" (p6), [p5] "r" (p5), [p4] "r" (p4), [p3] "r" (p3), - [p2] "r" (p2), [p1] "r" (p1), [p0] "r" (p0), - [sp6] "r" (sp6), [sp5] "r" (sp5), [sp4] "r" (sp4), [sp3] "r" (sp3), - [sp2] "r" (sp2), [sp1] "r" (sp1), [sp0] "r" (sp0) - ); - - __asm__ __volatile__ ( - "sw %[q6], (%[sq6]) \n\t" - "sw %[q5], (%[sq5]) \n\t" - "sw %[q4], (%[sq4]) \n\t" - "sw %[q3], (%[sq3]) \n\t" - "sw %[q2], (%[sq2]) \n\t" - "sw %[q1], (%[sq1]) \n\t" - "sw %[q0], (%[sq0]) \n\t" - - : - : [q6] "r" (q6), [q5] "r" (q5), [q4] "r" (q4), [q3] "r" (q3), - [q2] "r" (q2), [q1] "r" (q1), [q0] "r" (q0), - [sq6] "r" (sq6), [sq5] "r" (sq5), [sq4] "r" (sq4), [sq3] "r" (sq3), - [sq2] "r" (sq2), [sq1] "r" (sq1), [sq0] "r" (sq0) - ); - } else if ((flat2 == 0) && (flat == 0xFFFFFFFF) && (mask == 0xFFFFFFFF)) { - /* f1 */ - /* left 2 element operation */ - PACK_LEFT_0TO3() - vp9_mbfilter_dspr2(&p3_l, &p2_l, &p1_l, &p0_l, - &q0_l, &q1_l, &q2_l, &q3_l); - - /* right 2 element operation */ - PACK_RIGHT_0TO3() - vp9_mbfilter_dspr2(&p3_r, &p2_r, &p1_r, &p0_r, - &q0_r, &q1_r, &q2_r, &q3_r); - - COMBINE_LEFT_RIGHT_0TO2() - - __asm__ __volatile__ ( - "sw %[p2], (%[sp2]) \n\t" - "sw %[p1], (%[sp1]) \n\t" - "sw %[p0], (%[sp0]) \n\t" - "sw %[q0], (%[sq0]) \n\t" - "sw %[q1], (%[sq1]) \n\t" - "sw %[q2], (%[sq2]) \n\t" - - : - : [p2] "r" (p2), [p1] "r" (p1), [p0] "r" (p0), - [q0] "r" (q0), [q1] "r" (q1), [q2] "r" (q2), - [sp2] "r" (sp2), [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1), [sq2] "r" (sq2) - ); - } else if ((flat2 == 0) && (flat != 0) && (mask != 0)) { - /* f0+f1 */ - vp9_filter1_dspr2(mask, hev, p1, p0, q0, q1, - &p1_f0, &p0_f0, &q0_f0, &q1_f0); - - /* left 2 element operation */ - PACK_LEFT_0TO3() - vp9_mbfilter_dspr2(&p3_l, &p2_l, &p1_l, &p0_l, - &q0_l, &q1_l, &q2_l, &q3_l); - - /* right 2 element operation */ - PACK_RIGHT_0TO3() - vp9_mbfilter_dspr2(&p3_r, &p2_r, &p1_r, &p0_r, - &q0_r, &q1_r, &q2_r, &q3_r); - - if (mask & flat & 0x000000FF) { - __asm__ __volatile__ ( - "sb %[p2_r], (%[sp2]) \n\t" - "sb %[p1_r], (%[sp1]) \n\t" - "sb %[p0_r], (%[sp0]) \n\t" - "sb %[q0_r], (%[sq0]) \n\t" - "sb %[q1_r], (%[sq1]) \n\t" - "sb %[q2_r], (%[sq2]) \n\t" - - : - : [p2_r] "r" (p2_r), [p1_r] "r" (p1_r), [p0_r] "r" (p0_r), - [q0_r] "r" (q0_r), [q1_r] "r" (q1_r), [q2_r] "r" (q2_r), - [sp2] "r" (sp2), [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1), [sq2] "r" (sq2) - ); - } else if (mask & 0x000000FF) { - __asm__ __volatile__ ( - "sb %[p1_f0], (%[sp1]) \n\t" - "sb %[p0_f0], (%[sp0]) \n\t" - "sb %[q0_f0], (%[sq0]) \n\t" - "sb %[q1_f0], (%[sq1]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1) - ); - } - - __asm__ __volatile__ ( - "srl %[p2_r], %[p2_r], 16 \n\t" - "srl %[p1_r], %[p1_r], 16 \n\t" - "srl %[p0_r], %[p0_r], 16 \n\t" - "srl %[q0_r], %[q0_r], 16 \n\t" - "srl %[q1_r], %[q1_r], 16 \n\t" - "srl %[q2_r], %[q2_r], 16 \n\t" - "srl %[p1_f0], %[p1_f0], 8 \n\t" - "srl %[p0_f0], %[p0_f0], 8 \n\t" - "srl %[q0_f0], %[q0_f0], 8 \n\t" - "srl %[q1_f0], %[q1_f0], 8 \n\t" - - : [p2_r] "+r" (p2_r), [p1_r] "+r" (p1_r), [p0_r] "+r" (p0_r), - [q0_r] "+r" (q0_r), [q1_r] "+r" (q1_r), [q2_r] "+r" (q2_r), - [p1_f0] "+r" (p1_f0), [p0_f0] "+r" (p0_f0), - [q0_f0] "+r" (q0_f0), [q1_f0] "+r" (q1_f0) - : - ); - - if (mask & flat & 0x0000FF00) { - __asm__ __volatile__ ( - "sb %[p2_r], +1(%[sp2]) \n\t" - "sb %[p1_r], +1(%[sp1]) \n\t" - "sb %[p0_r], +1(%[sp0]) \n\t" - "sb %[q0_r], +1(%[sq0]) \n\t" - "sb %[q1_r], +1(%[sq1]) \n\t" - "sb %[q2_r], +1(%[sq2]) \n\t" - - : - : [p2_r] "r" (p2_r), [p1_r] "r" (p1_r), [p0_r] "r" (p0_r), - [q0_r] "r" (q0_r), [q1_r] "r" (q1_r), [q2_r] "r" (q2_r), - [sp2] "r" (sp2), [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1), [sq2] "r" (sq2) - ); - } else if (mask & 0x0000FF00) { - __asm__ __volatile__ ( - "sb %[p1_f0], +1(%[sp1]) \n\t" - "sb %[p0_f0], +1(%[sp0]) \n\t" - "sb %[q0_f0], +1(%[sq0]) \n\t" - "sb %[q1_f0], +1(%[sq1]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1) - ); - } - - __asm__ __volatile__ ( - "srl %[p1_f0], %[p1_f0], 8 \n\t" - "srl %[p0_f0], %[p0_f0], 8 \n\t" - "srl %[q0_f0], %[q0_f0], 8 \n\t" - "srl %[q1_f0], %[q1_f0], 8 \n\t" - - : [p1_f0] "+r" (p1_f0), [p0_f0] "+r" (p0_f0), - [q0_f0] "+r" (q0_f0), [q1_f0] "+r" (q1_f0) - : - ); - - if (mask & flat & 0x00FF0000) { - __asm__ __volatile__ ( - "sb %[p2_l], +2(%[sp2]) \n\t" - "sb %[p1_l], +2(%[sp1]) \n\t" - "sb %[p0_l], +2(%[sp0]) \n\t" - "sb %[q0_l], +2(%[sq0]) \n\t" - "sb %[q1_l], +2(%[sq1]) \n\t" - "sb %[q2_l], +2(%[sq2]) \n\t" - - : - : [p2_l] "r" (p2_l), [p1_l] "r" (p1_l), [p0_l] "r" (p0_l), - [q0_l] "r" (q0_l), [q1_l] "r" (q1_l), [q2_l] "r" (q2_l), - [sp2] "r" (sp2), [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1), [sq2] "r" (sq2) - ); - } else if (mask & 0x00FF0000) { - __asm__ __volatile__ ( - "sb %[p1_f0], +2(%[sp1]) \n\t" - "sb %[p0_f0], +2(%[sp0]) \n\t" - "sb %[q0_f0], +2(%[sq0]) \n\t" - "sb %[q1_f0], +2(%[sq1]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1) - ); - } - - __asm__ __volatile__ ( - "srl %[p2_l], %[p2_l], 16 \n\t" - "srl %[p1_l], %[p1_l], 16 \n\t" - "srl %[p0_l], %[p0_l], 16 \n\t" - "srl %[q0_l], %[q0_l], 16 \n\t" - "srl %[q1_l], %[q1_l], 16 \n\t" - "srl %[q2_l], %[q2_l], 16 \n\t" - "srl %[p1_f0], %[p1_f0], 8 \n\t" - "srl %[p0_f0], %[p0_f0], 8 \n\t" - "srl %[q0_f0], %[q0_f0], 8 \n\t" - "srl %[q1_f0], %[q1_f0], 8 \n\t" - - : [p2_l] "+r" (p2_l), [p1_l] "+r" (p1_l), [p0_l] "+r" (p0_l), - [q0_l] "+r" (q0_l), [q1_l] "+r" (q1_l), [q2_l] "+r" (q2_l), - [p1_f0] "+r" (p1_f0), [p0_f0] "+r" (p0_f0), - [q0_f0] "+r" (q0_f0), [q1_f0] "+r" (q1_f0) - : - ); - - if (mask & flat & 0xFF000000) { - __asm__ __volatile__ ( - "sb %[p2_l], +3(%[sp2]) \n\t" - "sb %[p1_l], +3(%[sp1]) \n\t" - "sb %[p0_l], +3(%[sp0]) \n\t" - "sb %[q0_l], +3(%[sq0]) \n\t" - "sb %[q1_l], +3(%[sq1]) \n\t" - "sb %[q2_l], +3(%[sq2]) \n\t" - - : - : [p2_l] "r" (p2_l), [p1_l] "r" (p1_l), [p0_l] "r" (p0_l), - [q0_l] "r" (q0_l), [q1_l] "r" (q1_l), [q2_l] "r" (q2_l), - [sp2] "r" (sp2), [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1), [sq2] "r" (sq2) - ); - } else if (mask & 0xFF000000) { - __asm__ __volatile__ ( - "sb %[p1_f0], +3(%[sp1]) \n\t" - "sb %[p0_f0], +3(%[sp0]) \n\t" - "sb %[q0_f0], +3(%[sq0]) \n\t" - "sb %[q1_f0], +3(%[sq1]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1) - ); - } - } else if ((flat2 != 0) && (flat != 0) && (mask != 0)) { - /* f0 + f1 + f2 */ - /* f0 function */ - vp9_filter1_dspr2(mask, hev, p1, p0, q0, q1, - &p1_f0, &p0_f0, &q0_f0, &q1_f0); - - /* f1 function */ - /* left 2 element operation */ - PACK_LEFT_0TO3() - vp9_mbfilter1_dspr2(p3_l, p2_l, p1_l, p0_l, - q0_l, q1_l, q2_l, q3_l, - &p2_l_f1, &p1_l_f1, &p0_l_f1, - &q0_l_f1, &q1_l_f1, &q2_l_f1); - - /* right 2 element operation */ - PACK_RIGHT_0TO3() - vp9_mbfilter1_dspr2(p3_r, p2_r, p1_r, p0_r, - q0_r, q1_r, q2_r, q3_r, - &p2_r_f1, &p1_r_f1, &p0_r_f1, - &q0_r_f1, &q1_r_f1, &q2_r_f1); - - /* f2 function */ - PACK_LEFT_4TO7() - vp9_wide_mbfilter_dspr2(&p7_l, &p6_l, &p5_l, &p4_l, - &p3_l, &p2_l, &p1_l, &p0_l, - &q0_l, &q1_l, &q2_l, &q3_l, - &q4_l, &q5_l, &q6_l, &q7_l); - - PACK_RIGHT_4TO7() - vp9_wide_mbfilter_dspr2(&p7_r, &p6_r, &p5_r, &p4_r, - &p3_r, &p2_r, &p1_r, &p0_r, - &q0_r, &q1_r, &q2_r, &q3_r, - &q4_r, &q5_r, &q6_r, &q7_r); - - if (mask & flat & flat2 & 0x000000FF) { - __asm__ __volatile__ ( - "sb %[p6_r], (%[sp6]) \n\t" - "sb %[p5_r], (%[sp5]) \n\t" - "sb %[p4_r], (%[sp4]) \n\t" - "sb %[p3_r], (%[sp3]) \n\t" - "sb %[p2_r], (%[sp2]) \n\t" - "sb %[p1_r], (%[sp1]) \n\t" - "sb %[p0_r], (%[sp0]) \n\t" - - : - : [p6_r] "r" (p6_r), [p5_r] "r" (p5_r), [p4_r] "r" (p4_r), - [p3_r] "r" (p3_r), [p2_r] "r" (p2_r), [p1_r] "r" (p1_r), - [sp6] "r" (sp6), [sp5] "r" (sp5), [sp4] "r" (sp4), - [sp3] "r" (sp3), [sp2] "r" (sp2), [sp1] "r" (sp1), - [p0_r] "r" (p0_r), [sp0] "r" (sp0) - ); - - __asm__ __volatile__ ( - "sb %[q0_r], (%[sq0]) \n\t" - "sb %[q1_r], (%[sq1]) \n\t" - "sb %[q2_r], (%[sq2]) \n\t" - "sb %[q3_r], (%[sq3]) \n\t" - "sb %[q4_r], (%[sq4]) \n\t" - "sb %[q5_r], (%[sq5]) \n\t" - "sb %[q6_r], (%[sq6]) \n\t" - - : - : [q0_r] "r" (q0_r), [q1_r] "r" (q1_r), [q2_r] "r" (q2_r), - [q3_r] "r" (q3_r), [q4_r] "r" (q4_r), [q5_r] "r" (q5_r), - [q6_r] "r" (q6_r), - [sq0] "r" (sq0), [sq1] "r" (sq1), [sq2] "r" (sq2), - [sq3] "r" (sq3), [sq4] "r" (sq4), [sq5] "r" (sq5), - [sq6] "r" (sq6) - ); - } else if (mask & flat & 0x000000FF) { - __asm__ __volatile__ ( - "sb %[p2_r_f1], (%[sp2]) \n\t" - "sb %[p1_r_f1], (%[sp1]) \n\t" - "sb %[p0_r_f1], (%[sp0]) \n\t" - "sb %[q0_r_f1], (%[sq0]) \n\t" - "sb %[q1_r_f1], (%[sq1]) \n\t" - "sb %[q2_r_f1], (%[sq2]) \n\t" - - : - : [p2_r_f1] "r" (p2_r_f1), [p1_r_f1] "r" (p1_r_f1), - [p0_r_f1] "r" (p0_r_f1), [q0_r_f1] "r" (q0_r_f1), - [q1_r_f1] "r" (q1_r_f1), [q2_r_f1] "r" (q2_r_f1), - [sp2] "r" (sp2), [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1), [sq2] "r" (sq2) - ); - } else if (mask & 0x000000FF) { - __asm__ __volatile__ ( - "sb %[p1_f0], (%[sp1]) \n\t" - "sb %[p0_f0], (%[sp0]) \n\t" - "sb %[q0_f0], (%[sq0]) \n\t" - "sb %[q1_f0], (%[sq1]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), [q0_f0] "r" (q0_f0), - [q1_f0] "r" (q1_f0), [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1) - ); - } - - __asm__ __volatile__ ( - "srl %[p6_r], %[p6_r], 16 \n\t" - "srl %[p5_r], %[p5_r], 16 \n\t" - "srl %[p4_r], %[p4_r], 16 \n\t" - "srl %[p3_r], %[p3_r], 16 \n\t" - "srl %[p2_r], %[p2_r], 16 \n\t" - "srl %[p1_r], %[p1_r], 16 \n\t" - "srl %[p0_r], %[p0_r], 16 \n\t" - "srl %[q0_r], %[q0_r], 16 \n\t" - "srl %[q1_r], %[q1_r], 16 \n\t" - "srl %[q2_r], %[q2_r], 16 \n\t" - "srl %[q3_r], %[q3_r], 16 \n\t" - "srl %[q4_r], %[q4_r], 16 \n\t" - "srl %[q5_r], %[q5_r], 16 \n\t" - "srl %[q6_r], %[q6_r], 16 \n\t" - - : [q0_r] "+r" (q0_r), [q1_r] "+r" (q1_r), [q2_r] "+r" (q2_r), - [q3_r] "+r" (q3_r), [q4_r] "+r" (q4_r), [q5_r] "+r" (q5_r), - [p6_r] "+r" (p6_r), [p5_r] "+r" (p5_r), [p4_r] "+r" (p4_r), - [p3_r] "+r" (p3_r), [p2_r] "+r" (p2_r), [p1_r] "+r" (p1_r), - [q6_r] "+r" (q6_r), [p0_r] "+r" (p0_r) - : - ); - - __asm__ __volatile__ ( - "srl %[p2_r_f1], %[p2_r_f1], 16 \n\t" - "srl %[p1_r_f1], %[p1_r_f1], 16 \n\t" - "srl %[p0_r_f1], %[p0_r_f1], 16 \n\t" - "srl %[q0_r_f1], %[q0_r_f1], 16 \n\t" - "srl %[q1_r_f1], %[q1_r_f1], 16 \n\t" - "srl %[q2_r_f1], %[q2_r_f1], 16 \n\t" - "srl %[p1_f0], %[p1_f0], 8 \n\t" - "srl %[p0_f0], %[p0_f0], 8 \n\t" - "srl %[q0_f0], %[q0_f0], 8 \n\t" - "srl %[q1_f0], %[q1_f0], 8 \n\t" - - : [p2_r_f1] "+r" (p2_r_f1), [p1_r_f1] "+r" (p1_r_f1), - [p0_r_f1] "+r" (p0_r_f1), [q0_r_f1] "+r" (q0_r_f1), - [q1_r_f1] "+r" (q1_r_f1), [q2_r_f1] "+r" (q2_r_f1), - [p1_f0] "+r" (p1_f0), [p0_f0] "+r" (p0_f0), - [q0_f0] "+r" (q0_f0), [q1_f0] "+r" (q1_f0) - : - ); - - if (mask & flat & flat2 & 0x0000FF00) { - __asm__ __volatile__ ( - "sb %[p6_r], +1(%[sp6]) \n\t" - "sb %[p5_r], +1(%[sp5]) \n\t" - "sb %[p4_r], +1(%[sp4]) \n\t" - "sb %[p3_r], +1(%[sp3]) \n\t" - "sb %[p2_r], +1(%[sp2]) \n\t" - "sb %[p1_r], +1(%[sp1]) \n\t" - "sb %[p0_r], +1(%[sp0]) \n\t" - - : - : [p6_r] "r" (p6_r), [p5_r] "r" (p5_r), [p4_r] "r" (p4_r), - [p3_r] "r" (p3_r), [p2_r] "r" (p2_r), [p1_r] "r" (p1_r), - [p0_r] "r" (p0_r), [sp6] "r" (sp6), [sp5] "r" (sp5), - [sp4] "r" (sp4), [sp3] "r" (sp3), - [sp2] "r" (sp2), [sp1] "r" (sp1), [sp0] "r" (sp0) - ); - - __asm__ __volatile__ ( - "sb %[q0_r], +1(%[sq0]) \n\t" - "sb %[q1_r], +1(%[sq1]) \n\t" - "sb %[q2_r], +1(%[sq2]) \n\t" - "sb %[q3_r], +1(%[sq3]) \n\t" - "sb %[q4_r], +1(%[sq4]) \n\t" - "sb %[q5_r], +1(%[sq5]) \n\t" - "sb %[q6_r], +1(%[sq6]) \n\t" - - : - : [q0_r] "r" (q0_r), [q1_r] "r" (q1_r), [q2_r] "r" (q2_r), - [q3_r] "r" (q3_r), [q4_r] "r" (q4_r), [q5_r] "r" (q5_r), - [q6_r] "r" (q6_r), [sq0] "r" (sq0), [sq1] "r" (sq1), - [sq2] "r" (sq2), [sq3] "r" (sq3), - [sq4] "r" (sq4), [sq5] "r" (sq5), [sq6] "r" (sq6) - ); - } else if (mask & flat & 0x0000FF00) { - __asm__ __volatile__ ( - "sb %[p2_r_f1], +1(%[sp2]) \n\t" - "sb %[p1_r_f1], +1(%[sp1]) \n\t" - "sb %[p0_r_f1], +1(%[sp0]) \n\t" - "sb %[q0_r_f1], +1(%[sq0]) \n\t" - "sb %[q1_r_f1], +1(%[sq1]) \n\t" - "sb %[q2_r_f1], +1(%[sq2]) \n\t" - - : - : [p2_r_f1] "r" (p2_r_f1), [p1_r_f1] "r" (p1_r_f1), - [p0_r_f1] "r" (p0_r_f1), [q0_r_f1] "r" (q0_r_f1), - [q1_r_f1] "r" (q1_r_f1), [q2_r_f1] "r" (q2_r_f1), - [sp2] "r" (sp2), [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1), [sq2] "r" (sq2) - ); - } else if (mask & 0x0000FF00) { - __asm__ __volatile__ ( - "sb %[p1_f0], +1(%[sp1]) \n\t" - "sb %[p0_f0], +1(%[sp0]) \n\t" - "sb %[q0_f0], +1(%[sq0]) \n\t" - "sb %[q1_f0], +1(%[sq1]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), [q0_f0] "r" (q0_f0), - [q1_f0] "r" (q1_f0), [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1) - ); - } - - __asm__ __volatile__ ( - "srl %[p1_f0], %[p1_f0], 8 \n\t" - "srl %[p0_f0], %[p0_f0], 8 \n\t" - "srl %[q0_f0], %[q0_f0], 8 \n\t" - "srl %[q1_f0], %[q1_f0], 8 \n\t" - - : [p1_f0] "+r" (p1_f0), [p0_f0] "+r" (p0_f0), - [q0_f0] "+r" (q0_f0), [q1_f0] "+r" (q1_f0) - : - ); - - if (mask & flat & flat2 & 0x00FF0000) { - __asm__ __volatile__ ( - "sb %[p6_l], +2(%[sp6]) \n\t" - "sb %[p5_l], +2(%[sp5]) \n\t" - "sb %[p4_l], +2(%[sp4]) \n\t" - "sb %[p3_l], +2(%[sp3]) \n\t" - "sb %[p2_l], +2(%[sp2]) \n\t" - "sb %[p1_l], +2(%[sp1]) \n\t" - "sb %[p0_l], +2(%[sp0]) \n\t" - - : - : [p6_l] "r" (p6_l), [p5_l] "r" (p5_l), [p4_l] "r" (p4_l), - [p3_l] "r" (p3_l), [p2_l] "r" (p2_l), [p1_l] "r" (p1_l), - [p0_l] "r" (p0_l), [sp6] "r" (sp6), [sp5] "r" (sp5), - [sp4] "r" (sp4), [sp3] "r" (sp3), - [sp2] "r" (sp2), [sp1] "r" (sp1), [sp0] "r" (sp0) - ); - - __asm__ __volatile__ ( - "sb %[q0_l], +2(%[sq0]) \n\t" - "sb %[q1_l], +2(%[sq1]) \n\t" - "sb %[q2_l], +2(%[sq2]) \n\t" - "sb %[q3_l], +2(%[sq3]) \n\t" - "sb %[q4_l], +2(%[sq4]) \n\t" - "sb %[q5_l], +2(%[sq5]) \n\t" - "sb %[q6_l], +2(%[sq6]) \n\t" - - : - : [q0_l] "r" (q0_l), [q1_l] "r" (q1_l), [q2_l] "r" (q2_l), - [q3_l] "r" (q3_l), [q4_l] "r" (q4_l), [q5_l] "r" (q5_l), - [q6_l] "r" (q6_l), [sq0] "r" (sq0), [sq1] "r" (sq1), - [sq2] "r" (sq2), [sq3] "r" (sq3), - [sq4] "r" (sq4), [sq5] "r" (sq5), [sq6] "r" (sq6) - ); - } else if (mask & flat & 0x00FF0000) { - __asm__ __volatile__ ( - "sb %[p2_l_f1], +2(%[sp2]) \n\t" - "sb %[p1_l_f1], +2(%[sp1]) \n\t" - "sb %[p0_l_f1], +2(%[sp0]) \n\t" - "sb %[q0_l_f1], +2(%[sq0]) \n\t" - "sb %[q1_l_f1], +2(%[sq1]) \n\t" - "sb %[q2_l_f1], +2(%[sq2]) \n\t" - - : - : [p2_l_f1] "r" (p2_l_f1), [p1_l_f1] "r" (p1_l_f1), - [p0_l_f1] "r" (p0_l_f1), [q0_l_f1] "r" (q0_l_f1), - [q1_l_f1] "r" (q1_l_f1), [q2_l_f1] "r" (q2_l_f1), - [sp2] "r" (sp2), [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1), [sq2] "r" (sq2) - ); - } else if (mask & 0x00FF0000) { - __asm__ __volatile__ ( - "sb %[p1_f0], +2(%[sp1]) \n\t" - "sb %[p0_f0], +2(%[sp0]) \n\t" - "sb %[q0_f0], +2(%[sq0]) \n\t" - "sb %[q1_f0], +2(%[sq1]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), [q0_f0] "r" (q0_f0), - [q1_f0] "r" (q1_f0), [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1) - ); - } - - __asm__ __volatile__ ( - "srl %[p6_l], %[p6_l], 16 \n\t" - "srl %[p5_l], %[p5_l], 16 \n\t" - "srl %[p4_l], %[p4_l], 16 \n\t" - "srl %[p3_l], %[p3_l], 16 \n\t" - "srl %[p2_l], %[p2_l], 16 \n\t" - "srl %[p1_l], %[p1_l], 16 \n\t" - "srl %[p0_l], %[p0_l], 16 \n\t" - "srl %[q0_l], %[q0_l], 16 \n\t" - "srl %[q1_l], %[q1_l], 16 \n\t" - "srl %[q2_l], %[q2_l], 16 \n\t" - "srl %[q3_l], %[q3_l], 16 \n\t" - "srl %[q4_l], %[q4_l], 16 \n\t" - "srl %[q5_l], %[q5_l], 16 \n\t" - "srl %[q6_l], %[q6_l], 16 \n\t" - - : [q0_l] "+r" (q0_l), [q1_l] "+r" (q1_l), [q2_l] "+r" (q2_l), - [q3_l] "+r" (q3_l), [q4_l] "+r" (q4_l), [q5_l] "+r" (q5_l), - [q6_l] "+r" (q6_l), [p6_l] "+r" (p6_l), [p5_l] "+r" (p5_l), - [p4_l] "+r" (p4_l), [p3_l] "+r" (p3_l), [p2_l] "+r" (p2_l), - [p1_l] "+r" (p1_l), [p0_l] "+r" (p0_l) - : - ); - - __asm__ __volatile__ ( - "srl %[p2_l_f1], %[p2_l_f1], 16 \n\t" - "srl %[p1_l_f1], %[p1_l_f1], 16 \n\t" - "srl %[p0_l_f1], %[p0_l_f1], 16 \n\t" - "srl %[q0_l_f1], %[q0_l_f1], 16 \n\t" - "srl %[q1_l_f1], %[q1_l_f1], 16 \n\t" - "srl %[q2_l_f1], %[q2_l_f1], 16 \n\t" - "srl %[p1_f0], %[p1_f0], 8 \n\t" - "srl %[p0_f0], %[p0_f0], 8 \n\t" - "srl %[q0_f0], %[q0_f0], 8 \n\t" - "srl %[q1_f0], %[q1_f0], 8 \n\t" - - : [p2_l_f1] "+r" (p2_l_f1), [p1_l_f1] "+r" (p1_l_f1), - [p0_l_f1] "+r" (p0_l_f1), [q0_l_f1] "+r" (q0_l_f1), - [q1_l_f1] "+r" (q1_l_f1), [q2_l_f1] "+r" (q2_l_f1), - [p1_f0] "+r" (p1_f0), [p0_f0] "+r" (p0_f0), - [q0_f0] "+r" (q0_f0), [q1_f0] "+r" (q1_f0) - : - ); - - if (mask & flat & flat2 & 0xFF000000) { - __asm__ __volatile__ ( - "sb %[p6_l], +3(%[sp6]) \n\t" - "sb %[p5_l], +3(%[sp5]) \n\t" - "sb %[p4_l], +3(%[sp4]) \n\t" - "sb %[p3_l], +3(%[sp3]) \n\t" - "sb %[p2_l], +3(%[sp2]) \n\t" - "sb %[p1_l], +3(%[sp1]) \n\t" - "sb %[p0_l], +3(%[sp0]) \n\t" - - : - : [p6_l] "r" (p6_l), [p5_l] "r" (p5_l), [p4_l] "r" (p4_l), - [p3_l] "r" (p3_l), [p2_l] "r" (p2_l), [p1_l] "r" (p1_l), - [p0_l] "r" (p0_l), [sp6] "r" (sp6), [sp5] "r" (sp5), - [sp4] "r" (sp4), [sp3] "r" (sp3), [sp2] "r" (sp2), - [sp1] "r" (sp1), [sp0] "r" (sp0) - ); - - __asm__ __volatile__ ( - "sb %[q0_l], +3(%[sq0]) \n\t" - "sb %[q1_l], +3(%[sq1]) \n\t" - "sb %[q2_l], +3(%[sq2]) \n\t" - "sb %[q3_l], +3(%[sq3]) \n\t" - "sb %[q4_l], +3(%[sq4]) \n\t" - "sb %[q5_l], +3(%[sq5]) \n\t" - "sb %[q6_l], +3(%[sq6]) \n\t" - - : - : [q0_l] "r" (q0_l), [q1_l] "r" (q1_l), - [q2_l] "r" (q2_l), [q3_l] "r" (q3_l), - [q4_l] "r" (q4_l), [q5_l] "r" (q5_l), - [sq0] "r" (sq0), [sq1] "r" (sq1), [sq2] "r" (sq2), - [sq3] "r" (sq3), [sq4] "r" (sq4), [sq5] "r" (sq5), - [q6_l] "r" (q6_l), [sq6] "r" (sq6) - ); - } else if (mask & flat & 0xFF000000) { - __asm__ __volatile__ ( - "sb %[p2_l_f1], +3(%[sp2]) \n\t" - "sb %[p1_l_f1], +3(%[sp1]) \n\t" - "sb %[p0_l_f1], +3(%[sp0]) \n\t" - "sb %[q0_l_f1], +3(%[sq0]) \n\t" - "sb %[q1_l_f1], +3(%[sq1]) \n\t" - "sb %[q2_l_f1], +3(%[sq2]) \n\t" - - : - : [p2_l_f1] "r" (p2_l_f1), [p1_l_f1] "r" (p1_l_f1), - [p0_l_f1] "r" (p0_l_f1), [q0_l_f1] "r" (q0_l_f1), - [q1_l_f1] "r" (q1_l_f1), [q2_l_f1] "r" (q2_l_f1), - [sp2] "r" (sp2), [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1), [sq2] "r" (sq2) - ); - } else if (mask & 0xFF000000) { - __asm__ __volatile__ ( - "sb %[p1_f0], +3(%[sp1]) \n\t" - "sb %[p0_f0], +3(%[sp0]) \n\t" - "sb %[q0_f0], +3(%[sq0]) \n\t" - "sb %[q1_f0], +3(%[sq1]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [sp1] "r" (sp1), [sp0] "r" (sp0), - [sq0] "r" (sq0), [sq1] "r" (sq1) - ); - } - } - - s = s + 4; - } -} -#endif // #if HAVE_DSPR2 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_mblpf_vert_loopfilter_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_mblpf_vert_loopfilter_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_mblpf_vert_loopfilter_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/mips/dspr2/vp9_mblpf_vert_loopfilter_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,840 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_loopfilter.h" -#include "vp9/common/vp9_onyxc_int.h" -#include "vp9/common/mips/dspr2/vp9_common_dspr2.h" -#include "vp9/common/mips/dspr2/vp9_loopfilter_macros_dspr2.h" -#include "vp9/common/mips/dspr2/vp9_loopfilter_masks_dspr2.h" -#include "vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.h" - -#if HAVE_DSPR2 -void vp9_lpf_vertical_16_dspr2(uint8_t *s, - int pitch, - const uint8_t *blimit, - const uint8_t *limit, - const uint8_t *thresh) { - uint8_t i; - uint32_t mask, hev, flat, flat2; - uint8_t *s1, *s2, *s3, *s4; - uint32_t prim1, prim2, sec3, sec4, prim3, prim4; - uint32_t thresh_vec, flimit_vec, limit_vec; - uint32_t uflimit, ulimit, uthresh; - uint32_t p7, p6, p5, p4, p3, p2, p1, p0, q0, q1, q2, q3, q4, q5, q6, q7; - uint32_t p1_f0, p0_f0, q0_f0, q1_f0; - uint32_t p7_l, p6_l, p5_l, p4_l, p3_l, p2_l, p1_l, p0_l; - uint32_t q0_l, q1_l, q2_l, q3_l, q4_l, q5_l, q6_l, q7_l; - uint32_t p7_r, p6_r, p5_r, p4_r, p3_r, p2_r, p1_r, p0_r; - uint32_t q0_r, q1_r, q2_r, q3_r, q4_r, q5_r, q6_r, q7_r; - uint32_t p2_l_f1, p1_l_f1, p0_l_f1, p2_r_f1, p1_r_f1, p0_r_f1; - uint32_t q0_l_f1, q1_l_f1, q2_l_f1, q0_r_f1, q1_r_f1, q2_r_f1; - - uflimit = *blimit; - ulimit = *limit; - uthresh = *thresh; - - /* create quad-byte */ - __asm__ __volatile__ ( - "replv.qb %[thresh_vec], %[uthresh] \n\t" - "replv.qb %[flimit_vec], %[uflimit] \n\t" - "replv.qb %[limit_vec], %[ulimit] \n\t" - - : [thresh_vec] "=&r" (thresh_vec), [flimit_vec] "=&r" (flimit_vec), - [limit_vec] "=r" (limit_vec) - : [uthresh] "r" (uthresh), [uflimit] "r" (uflimit), [ulimit] "r" (ulimit) - ); - - vp9_prefetch_store(s + pitch); - - for (i = 0; i < 2; i++) { - s1 = s; - s2 = s + pitch; - s3 = s2 + pitch; - s4 = s3 + pitch; - s = s4 + pitch; - - __asm__ __volatile__ ( - "lw %[p0], -4(%[s1]) \n\t" - "lw %[p1], -4(%[s2]) \n\t" - "lw %[p2], -4(%[s3]) \n\t" - "lw %[p3], -4(%[s4]) \n\t" - "lw %[p4], -8(%[s1]) \n\t" - "lw %[p5], -8(%[s2]) \n\t" - "lw %[p6], -8(%[s3]) \n\t" - "lw %[p7], -8(%[s4]) \n\t" - - : [p3] "=&r" (p3), [p2] "=&r" (p2), [p1] "=&r" (p1), - [p0] "=&r" (p0), [p7] "=&r" (p7), [p6] "=&r" (p6), - [p5] "=&r" (p5), [p4] "=&r" (p4) - : [s1] "r" (s1), [s2] "r" (s2), [s3] "r" (s3), [s4] "r" (s4) - ); - - __asm__ __volatile__ ( - "lw %[q3], (%[s1]) \n\t" - "lw %[q2], (%[s2]) \n\t" - "lw %[q1], (%[s3]) \n\t" - "lw %[q0], (%[s4]) \n\t" - "lw %[q7], +4(%[s1]) \n\t" - "lw %[q6], +4(%[s2]) \n\t" - "lw %[q5], +4(%[s3]) \n\t" - "lw %[q4], +4(%[s4]) \n\t" - - : [q3] "=&r" (q3), [q2] "=&r" (q2), [q1] "=&r" (q1), - [q0] "=&r" (q0), [q7] "=&r" (q7), [q6] "=&r" (q6), - [q5] "=&r" (q5), [q4] "=&r" (q4) - : [s1] "r" (s1), [s2] "r" (s2), [s3] "r" (s3), [s4] "r" (s4) - ); - - /* transpose p3, p2, p1, p0 - original (when loaded from memory) - register -4 -3 -2 -1 - p0 p0_0 p0_1 p0_2 p0_3 - p1 p1_0 p1_1 p1_2 p1_3 - p2 p2_0 p2_1 p2_2 p2_3 - p3 p3_0 p3_1 p3_2 p3_3 - - after transpose - register - p0 p3_3 p2_3 p1_3 p0_3 - p1 p3_2 p2_2 p1_2 p0_2 - p2 p3_1 p2_1 p1_1 p0_1 - p3 p3_0 p2_0 p1_0 p0_0 - */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[p0], %[p1] \n\t" - "precr.qb.ph %[prim2], %[p0], %[p1] \n\t" - "precrq.qb.ph %[prim3], %[p2], %[p3] \n\t" - "precr.qb.ph %[prim4], %[p2], %[p3] \n\t" - - "precrq.qb.ph %[p1], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[p3], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[p0], %[p1], %[sec3] \n\t" - "precrq.ph.w %[p2], %[p3], %[sec4] \n\t" - "append %[p1], %[sec3], 16 \n\t" - "append %[p3], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [p0] "+r" (p0), [p1] "+r" (p1), [p2] "+r" (p2), [p3] "+r" (p3), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - /* transpose q0, q1, q2, q3 - original (when loaded from memory) - register +1 +2 +3 +4 - q3 q3_0 q3_1 q3_2 q3_3 - q2 q2_0 q2_1 q2_2 q2_3 - q1 q1_0 q1_1 q1_2 q1_3 - q0 q0_0 q0_1 q0_2 q0_3 - - after transpose - register - q3 q0_3 q1_3 q2_3 q3_3 - q2 q0_2 q1_2 q2_2 q3_2 - q1 q0_1 q1_1 q2_1 q3_1 - q0 q0_0 q1_0 q2_0 q3_0 - */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[q3], %[q2] \n\t" - "precr.qb.ph %[prim2], %[q3], %[q2] \n\t" - "precrq.qb.ph %[prim3], %[q1], %[q0] \n\t" - "precr.qb.ph %[prim4], %[q1], %[q0] \n\t" - - "precrq.qb.ph %[q2], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[q0], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[q3], %[q2], %[sec3] \n\t" - "precrq.ph.w %[q1], %[q0], %[sec4] \n\t" - "append %[q2], %[sec3], 16 \n\t" - "append %[q0], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [q3] "+r" (q3), [q2] "+r" (q2), [q1] "+r" (q1), [q0] "+r" (q0), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - /* transpose p7, p6, p5, p4 - original (when loaded from memory) - register -8 -7 -6 -5 - p4 p4_0 p4_1 p4_2 p4_3 - p5 p5_0 p5_1 p5_2 p5_3 - p6 p6_0 p6_1 p6_2 p6_3 - p7 p7_0 p7_1 p7_2 p7_3 - - after transpose - register - p4 p7_3 p6_3 p5_3 p4_3 - p5 p7_2 p6_2 p5_2 p4_2 - p6 p7_1 p6_1 p5_1 p4_1 - p7 p7_0 p6_0 p5_0 p4_0 - */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[p4], %[p5] \n\t" - "precr.qb.ph %[prim2], %[p4], %[p5] \n\t" - "precrq.qb.ph %[prim3], %[p6], %[p7] \n\t" - "precr.qb.ph %[prim4], %[p6], %[p7] \n\t" - - "precrq.qb.ph %[p5], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[p7], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[p4], %[p5], %[sec3] \n\t" - "precrq.ph.w %[p6], %[p7], %[sec4] \n\t" - "append %[p5], %[sec3], 16 \n\t" - "append %[p7], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [p4] "+r" (p4), [p5] "+r" (p5), [p6] "+r" (p6), [p7] "+r" (p7), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - /* transpose q4, q5, q6, q7 - original (when loaded from memory) - register +5 +6 +7 +8 - q7 q7_0 q7_1 q7_2 q7_3 - q6 q6_0 q6_1 q6_2 q6_3 - q5 q5_0 q5_1 q5_2 q5_3 - q4 q4_0 q4_1 q4_2 q4_3 - - after transpose - register - q7 q4_3 q5_3 q26_3 q7_3 - q6 q4_2 q5_2 q26_2 q7_2 - q5 q4_1 q5_1 q26_1 q7_1 - q4 q4_0 q5_0 q26_0 q7_0 - */ - __asm__ __volatile__ ( - "precrq.qb.ph %[prim1], %[q7], %[q6] \n\t" - "precr.qb.ph %[prim2], %[q7], %[q6] \n\t" - "precrq.qb.ph %[prim3], %[q5], %[q4] \n\t" - "precr.qb.ph %[prim4], %[q5], %[q4] \n\t" - - "precrq.qb.ph %[q6], %[prim1], %[prim2] \n\t" - "precr.qb.ph %[q4], %[prim1], %[prim2] \n\t" - "precrq.qb.ph %[sec3], %[prim3], %[prim4] \n\t" - "precr.qb.ph %[sec4], %[prim3], %[prim4] \n\t" - - "precrq.ph.w %[q7], %[q6], %[sec3] \n\t" - "precrq.ph.w %[q5], %[q4], %[sec4] \n\t" - "append %[q6], %[sec3], 16 \n\t" - "append %[q4], %[sec4], 16 \n\t" - - : [prim1] "=&r" (prim1), [prim2] "=&r" (prim2), - [prim3] "=&r" (prim3), [prim4] "=&r" (prim4), - [q7] "+r" (q7), [q6] "+r" (q6), [q5] "+r" (q5), [q4] "+r" (q4), - [sec3] "=&r" (sec3), [sec4] "=&r" (sec4) - : - ); - - vp9_filter_hev_mask_flatmask4_dspr2(limit_vec, flimit_vec, thresh_vec, - p1, p0, p3, p2, q0, q1, q2, q3, - &hev, &mask, &flat); - - vp9_flatmask5(p7, p6, p5, p4, p0, q0, q4, q5, q6, q7, &flat2); - - /* f0 */ - if (((flat2 == 0) && (flat == 0) && (mask != 0)) || - ((flat2 != 0) && (flat == 0) && (mask != 0))) { - vp9_filter1_dspr2(mask, hev, p1, p0, q0, q1, - &p1_f0, &p0_f0, &q0_f0, &q1_f0); - STORE_F0() - } else if ((flat2 == 0XFFFFFFFF) && (flat == 0xFFFFFFFF) && - (mask == 0xFFFFFFFF)) { - /* f2 */ - PACK_LEFT_0TO3() - PACK_LEFT_4TO7() - vp9_wide_mbfilter_dspr2(&p7_l, &p6_l, &p5_l, &p4_l, - &p3_l, &p2_l, &p1_l, &p0_l, - &q0_l, &q1_l, &q2_l, &q3_l, - &q4_l, &q5_l, &q6_l, &q7_l); - - PACK_RIGHT_0TO3() - PACK_RIGHT_4TO7() - vp9_wide_mbfilter_dspr2(&p7_r, &p6_r, &p5_r, &p4_r, - &p3_r, &p2_r, &p1_r, &p0_r, - &q0_r, &q1_r, &q2_r, &q3_r, - &q4_r, &q5_r, &q6_r, &q7_r); - - STORE_F2() - } else if ((flat2 == 0) && (flat == 0xFFFFFFFF) && (mask == 0xFFFFFFFF)) { - /* f1 */ - PACK_LEFT_0TO3() - vp9_mbfilter_dspr2(&p3_l, &p2_l, &p1_l, &p0_l, - &q0_l, &q1_l, &q2_l, &q3_l); - - PACK_RIGHT_0TO3() - vp9_mbfilter_dspr2(&p3_r, &p2_r, &p1_r, &p0_r, - &q0_r, &q1_r, &q2_r, &q3_r); - - STORE_F1() - } else if ((flat2 == 0) && (flat != 0) && (mask != 0)) { - /* f0 + f1 */ - vp9_filter1_dspr2(mask, hev, p1, p0, q0, q1, - &p1_f0, &p0_f0, &q0_f0, &q1_f0); - - /* left 2 element operation */ - PACK_LEFT_0TO3() - vp9_mbfilter_dspr2(&p3_l, &p2_l, &p1_l, &p0_l, - &q0_l, &q1_l, &q2_l, &q3_l); - - /* right 2 element operation */ - PACK_RIGHT_0TO3() - vp9_mbfilter_dspr2(&p3_r, &p2_r, &p1_r, &p0_r, - &q0_r, &q1_r, &q2_r, &q3_r); - - if (mask & flat & 0x000000FF) { - __asm__ __volatile__ ( - "sb %[p2_r], -3(%[s4]) \n\t" - "sb %[p1_r], -2(%[s4]) \n\t" - "sb %[p0_r], -1(%[s4]) \n\t" - "sb %[q0_r], (%[s4]) \n\t" - "sb %[q1_r], +1(%[s4]) \n\t" - "sb %[q2_r], +2(%[s4]) \n\t" - - : - : [p2_r] "r" (p2_r), [p1_r] "r" (p1_r), [p0_r] "r" (p0_r), - [q0_r] "r" (q0_r), [q1_r] "r" (q1_r), [q2_r] "r" (q2_r), - [s4] "r" (s4) - ); - } else if (mask & 0x000000FF) { - __asm__ __volatile__ ( - "sb %[p1_f0], -2(%[s4]) \n\t" - "sb %[p0_f0], -1(%[s4]) \n\t" - "sb %[q0_f0], (%[s4]) \n\t" - "sb %[q1_f0], +1(%[s4]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [s4] "r" (s4) - ); - } - - __asm__ __volatile__ ( - "srl %[p2_r], %[p2_r], 16 \n\t" - "srl %[p1_r], %[p1_r], 16 \n\t" - "srl %[p0_r], %[p0_r], 16 \n\t" - "srl %[q0_r], %[q0_r], 16 \n\t" - "srl %[q1_r], %[q1_r], 16 \n\t" - "srl %[q2_r], %[q2_r], 16 \n\t" - "srl %[p1_f0], %[p1_f0], 8 \n\t" - "srl %[p0_f0], %[p0_f0], 8 \n\t" - "srl %[q0_f0], %[q0_f0], 8 \n\t" - "srl %[q1_f0], %[q1_f0], 8 \n\t" - - : [p2_r] "+r" (p2_r), [p1_r] "+r" (p1_r), [p0_r] "+r" (p0_r), - [q0_r] "+r" (q0_r), [q1_r] "+r" (q1_r), [q2_r] "+r" (q2_r), - [p1_f0] "+r" (p1_f0), [p0_f0] "+r" (p0_f0), - [q0_f0] "+r" (q0_f0), [q1_f0] "+r" (q1_f0) - : - ); - - if (mask & flat & 0x0000FF00) { - __asm__ __volatile__ ( - "sb %[p2_r], -3(%[s3]) \n\t" - "sb %[p1_r], -2(%[s3]) \n\t" - "sb %[p0_r], -1(%[s3]) \n\t" - "sb %[q0_r], (%[s3]) \n\t" - "sb %[q1_r], +1(%[s3]) \n\t" - "sb %[q2_r], +2(%[s3]) \n\t" - - : - : [p2_r] "r" (p2_r), [p1_r] "r" (p1_r), [p0_r] "r" (p0_r), - [q0_r] "r" (q0_r), [q1_r] "r" (q1_r), [q2_r] "r" (q2_r), - [s3] "r" (s3) - ); - } else if (mask & 0x0000FF00) { - __asm__ __volatile__ ( - "sb %[p1_f0], -2(%[s3]) \n\t" - "sb %[p0_f0], -1(%[s3]) \n\t" - "sb %[q0_f0], (%[s3]) \n\t" - "sb %[q1_f0], +1(%[s3]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [s3] "r" (s3) - ); - } - - __asm__ __volatile__ ( - "srl %[p1_f0], %[p1_f0], 8 \n\t" - "srl %[p0_f0], %[p0_f0], 8 \n\t" - "srl %[q0_f0], %[q0_f0], 8 \n\t" - "srl %[q1_f0], %[q1_f0], 8 \n\t" - - : [p1_f0] "+r" (p1_f0), [p0_f0] "+r" (p0_f0), - [q0_f0] "+r" (q0_f0), [q1_f0] "+r" (q1_f0) - : - ); - - if (mask & flat & 0x00FF0000) { - __asm__ __volatile__ ( - "sb %[p2_l], -3(%[s2]) \n\t" - "sb %[p1_l], -2(%[s2]) \n\t" - "sb %[p0_l], -1(%[s2]) \n\t" - "sb %[q0_l], (%[s2]) \n\t" - "sb %[q1_l], +1(%[s2]) \n\t" - "sb %[q2_l], +2(%[s2]) \n\t" - - : - : [p2_l] "r" (p2_l), [p1_l] "r" (p1_l), [p0_l] "r" (p0_l), - [q0_l] "r" (q0_l), [q1_l] "r" (q1_l), [q2_l] "r" (q2_l), - [s2] "r" (s2) - ); - } else if (mask & 0x00FF0000) { - __asm__ __volatile__ ( - "sb %[p1_f0], -2(%[s2]) \n\t" - "sb %[p0_f0], -1(%[s2]) \n\t" - "sb %[q0_f0], (%[s2]) \n\t" - "sb %[q1_f0], +1(%[s2]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [s2] "r" (s2) - ); - } - - __asm__ __volatile__ ( - "srl %[p2_l], %[p2_l], 16 \n\t" - "srl %[p1_l], %[p1_l], 16 \n\t" - "srl %[p0_l], %[p0_l], 16 \n\t" - "srl %[q0_l], %[q0_l], 16 \n\t" - "srl %[q1_l], %[q1_l], 16 \n\t" - "srl %[q2_l], %[q2_l], 16 \n\t" - "srl %[p1_f0], %[p1_f0], 8 \n\t" - "srl %[p0_f0], %[p0_f0], 8 \n\t" - "srl %[q0_f0], %[q0_f0], 8 \n\t" - "srl %[q1_f0], %[q1_f0], 8 \n\t" - - : [p2_l] "+r" (p2_l), [p1_l] "+r" (p1_l), [p0_l] "+r" (p0_l), - [q0_l] "+r" (q0_l), [q1_l] "+r" (q1_l), [q2_l] "+r" (q2_l), - [p1_f0] "+r" (p1_f0), [p0_f0] "+r" (p0_f0), - [q0_f0] "+r" (q0_f0), [q1_f0] "+r" (q1_f0) - : - ); - - if (mask & flat & 0xFF000000) { - __asm__ __volatile__ ( - "sb %[p2_l], -3(%[s1]) \n\t" - "sb %[p1_l], -2(%[s1]) \n\t" - "sb %[p0_l], -1(%[s1]) \n\t" - "sb %[q0_l], (%[s1]) \n\t" - "sb %[q1_l], +1(%[s1]) \n\t" - "sb %[q2_l], +2(%[s1]) \n\t" - - : - : [p2_l] "r" (p2_l), [p1_l] "r" (p1_l), [p0_l] "r" (p0_l), - [q0_l] "r" (q0_l), [q1_l] "r" (q1_l), [q2_l] "r" (q2_l), - [s1] "r" (s1) - ); - } else if (mask & 0xFF000000) { - __asm__ __volatile__ ( - "sb %[p1_f0], -2(%[s1]) \n\t" - "sb %[p0_f0], -1(%[s1]) \n\t" - "sb %[q0_f0], (%[s1]) \n\t" - "sb %[q1_f0], +1(%[s1]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [s1] "r" (s1) - ); - } - } else if ((flat2 != 0) && (flat != 0) && (mask != 0)) { - /* f0+f1+f2 */ - vp9_filter1_dspr2(mask, hev, p1, p0, q0, q1, - &p1_f0, &p0_f0, &q0_f0, &q1_f0); - - PACK_LEFT_0TO3() - vp9_mbfilter1_dspr2(p3_l, p2_l, p1_l, p0_l, - q0_l, q1_l, q2_l, q3_l, - &p2_l_f1, &p1_l_f1, &p0_l_f1, - &q0_l_f1, &q1_l_f1, &q2_l_f1); - - PACK_RIGHT_0TO3() - vp9_mbfilter1_dspr2(p3_r, p2_r, p1_r, p0_r, - q0_r, q1_r, q2_r, q3_r, - &p2_r_f1, &p1_r_f1, &p0_r_f1, - &q0_r_f1, &q1_r_f1, &q2_r_f1); - - PACK_LEFT_4TO7() - vp9_wide_mbfilter_dspr2(&p7_l, &p6_l, &p5_l, &p4_l, - &p3_l, &p2_l, &p1_l, &p0_l, - &q0_l, &q1_l, &q2_l, &q3_l, - &q4_l, &q5_l, &q6_l, &q7_l); - - PACK_RIGHT_4TO7() - vp9_wide_mbfilter_dspr2(&p7_r, &p6_r, &p5_r, &p4_r, - &p3_r, &p2_r, &p1_r, &p0_r, - &q0_r, &q1_r, &q2_r, &q3_r, - &q4_r, &q5_r, &q6_r, &q7_r); - - if (mask & flat & flat2 & 0x000000FF) { - __asm__ __volatile__ ( - "sb %[p6_r], -7(%[s4]) \n\t" - "sb %[p5_r], -6(%[s4]) \n\t" - "sb %[p4_r], -5(%[s4]) \n\t" - "sb %[p3_r], -4(%[s4]) \n\t" - "sb %[p2_r], -3(%[s4]) \n\t" - "sb %[p1_r], -2(%[s4]) \n\t" - "sb %[p0_r], -1(%[s4]) \n\t" - - : - : [p6_r] "r" (p6_r), [p5_r] "r" (p5_r), - [p4_r] "r" (p4_r), [p3_r] "r" (p3_r), - [p2_r] "r" (p2_r), [p1_r] "r" (p1_r), - [p0_r] "r" (p0_r), [s4] "r" (s4) - ); - - __asm__ __volatile__ ( - "sb %[q0_r], (%[s4]) \n\t" - "sb %[q1_r], +1(%[s4]) \n\t" - "sb %[q2_r], +2(%[s4]) \n\t" - "sb %[q3_r], +3(%[s4]) \n\t" - "sb %[q4_r], +4(%[s4]) \n\t" - "sb %[q5_r], +5(%[s4]) \n\t" - "sb %[q6_r], +6(%[s4]) \n\t" - - : - : [q0_r] "r" (q0_r), [q1_r] "r" (q1_r), - [q2_r] "r" (q2_r), [q3_r] "r" (q3_r), - [q4_r] "r" (q4_r), [q5_r] "r" (q5_r), - [q6_r] "r" (q6_r), [s4] "r" (s4) - ); - } else if (mask & flat & 0x000000FF) { - __asm__ __volatile__ ( - "sb %[p2_r_f1], -3(%[s4]) \n\t" - "sb %[p1_r_f1], -2(%[s4]) \n\t" - "sb %[p0_r_f1], -1(%[s4]) \n\t" - "sb %[q0_r_f1], (%[s4]) \n\t" - "sb %[q1_r_f1], +1(%[s4]) \n\t" - "sb %[q2_r_f1], +2(%[s4]) \n\t" - - : - : [p2_r_f1] "r" (p2_r_f1), [p1_r_f1] "r" (p1_r_f1), - [p0_r_f1] "r" (p0_r_f1), [q0_r_f1] "r" (q0_r_f1), - [q1_r_f1] "r" (q1_r_f1), [q2_r_f1] "r" (q2_r_f1), - [s4] "r" (s4) - ); - } else if (mask & 0x000000FF) { - __asm__ __volatile__ ( - "sb %[p1_f0], -2(%[s4]) \n\t" - "sb %[p0_f0], -1(%[s4]) \n\t" - "sb %[q0_f0], (%[s4]) \n\t" - "sb %[q1_f0], +1(%[s4]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [s4] "r" (s4) - ); - } - - __asm__ __volatile__ ( - "srl %[p6_r], %[p6_r], 16 \n\t" - "srl %[p5_r], %[p5_r], 16 \n\t" - "srl %[p4_r], %[p4_r], 16 \n\t" - "srl %[p3_r], %[p3_r], 16 \n\t" - "srl %[p2_r], %[p2_r], 16 \n\t" - "srl %[p1_r], %[p1_r], 16 \n\t" - "srl %[p0_r], %[p0_r], 16 \n\t" - "srl %[q0_r], %[q0_r], 16 \n\t" - "srl %[q1_r], %[q1_r], 16 \n\t" - "srl %[q2_r], %[q2_r], 16 \n\t" - "srl %[q3_r], %[q3_r], 16 \n\t" - "srl %[q4_r], %[q4_r], 16 \n\t" - "srl %[q5_r], %[q5_r], 16 \n\t" - "srl %[q6_r], %[q6_r], 16 \n\t" - - : [q0_r] "+r" (q0_r), [q1_r] "+r" (q1_r), - [q2_r] "+r" (q2_r), [q3_r] "+r" (q3_r), - [q4_r] "+r" (q4_r), [q5_r] "+r" (q5_r), - [q6_r] "+r" (q6_r), [p6_r] "+r" (p6_r), - [p5_r] "+r" (p5_r), [p4_r] "+r" (p4_r), - [p3_r] "+r" (p3_r), [p2_r] "+r" (p2_r), - [p1_r] "+r" (p1_r), [p0_r] "+r" (p0_r) - : - ); - - __asm__ __volatile__ ( - "srl %[p2_r_f1], %[p2_r_f1], 16 \n\t" - "srl %[p1_r_f1], %[p1_r_f1], 16 \n\t" - "srl %[p0_r_f1], %[p0_r_f1], 16 \n\t" - "srl %[q0_r_f1], %[q0_r_f1], 16 \n\t" - "srl %[q1_r_f1], %[q1_r_f1], 16 \n\t" - "srl %[q2_r_f1], %[q2_r_f1], 16 \n\t" - "srl %[p1_f0], %[p1_f0], 8 \n\t" - "srl %[p0_f0], %[p0_f0], 8 \n\t" - "srl %[q0_f0], %[q0_f0], 8 \n\t" - "srl %[q1_f0], %[q1_f0], 8 \n\t" - - : [p2_r_f1] "+r" (p2_r_f1), [p1_r_f1] "+r" (p1_r_f1), - [p0_r_f1] "+r" (p0_r_f1), [q0_r_f1] "+r" (q0_r_f1), - [q1_r_f1] "+r" (q1_r_f1), [q2_r_f1] "+r" (q2_r_f1), - [p1_f0] "+r" (p1_f0), [p0_f0] "+r" (p0_f0), - [q0_f0] "+r" (q0_f0), [q1_f0] "+r" (q1_f0) - : - ); - - if (mask & flat & flat2 & 0x0000FF00) { - __asm__ __volatile__ ( - "sb %[p6_r], -7(%[s3]) \n\t" - "sb %[p5_r], -6(%[s3]) \n\t" - "sb %[p4_r], -5(%[s3]) \n\t" - "sb %[p3_r], -4(%[s3]) \n\t" - "sb %[p2_r], -3(%[s3]) \n\t" - "sb %[p1_r], -2(%[s3]) \n\t" - "sb %[p0_r], -1(%[s3]) \n\t" - - : - : [p6_r] "r" (p6_r), [p5_r] "r" (p5_r), [p4_r] "r" (p4_r), - [p3_r] "r" (p3_r), [p2_r] "r" (p2_r), [p1_r] "r" (p1_r), - [p0_r] "r" (p0_r), [s3] "r" (s3) - ); - - __asm__ __volatile__ ( - "sb %[q0_r], (%[s3]) \n\t" - "sb %[q1_r], +1(%[s3]) \n\t" - "sb %[q2_r], +2(%[s3]) \n\t" - "sb %[q3_r], +3(%[s3]) \n\t" - "sb %[q4_r], +4(%[s3]) \n\t" - "sb %[q5_r], +5(%[s3]) \n\t" - "sb %[q6_r], +6(%[s3]) \n\t" - - : - : [q0_r] "r" (q0_r), [q1_r] "r" (q1_r), - [q2_r] "r" (q2_r), [q3_r] "r" (q3_r), - [q4_r] "r" (q4_r), [q5_r] "r" (q5_r), - [q6_r] "r" (q6_r), [s3] "r" (s3) - ); - } else if (mask & flat & 0x0000FF00) { - __asm__ __volatile__ ( - "sb %[p2_r_f1], -3(%[s3]) \n\t" - "sb %[p1_r_f1], -2(%[s3]) \n\t" - "sb %[p0_r_f1], -1(%[s3]) \n\t" - "sb %[q0_r_f1], (%[s3]) \n\t" - "sb %[q1_r_f1], +1(%[s3]) \n\t" - "sb %[q2_r_f1], +2(%[s3]) \n\t" - - : - : [p2_r_f1] "r" (p2_r_f1), [p1_r_f1] "r" (p1_r_f1), - [p0_r_f1] "r" (p0_r_f1), [q0_r_f1] "r" (q0_r_f1), - [q1_r_f1] "r" (q1_r_f1), [q2_r_f1] "r" (q2_r_f1), - [s3] "r" (s3) - ); - } else if (mask & 0x0000FF00) { - __asm__ __volatile__ ( - "sb %[p1_f0], -2(%[s3]) \n\t" - "sb %[p0_f0], -1(%[s3]) \n\t" - "sb %[q0_f0], (%[s3]) \n\t" - "sb %[q1_f0], +1(%[s3]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [s3] "r" (s3) - ); - } - - __asm__ __volatile__ ( - "srl %[p1_f0], %[p1_f0], 8 \n\t" - "srl %[p0_f0], %[p0_f0], 8 \n\t" - "srl %[q0_f0], %[q0_f0], 8 \n\t" - "srl %[q1_f0], %[q1_f0], 8 \n\t" - - : [p1_f0] "+r" (p1_f0), [p0_f0] "+r" (p0_f0), - [q0_f0] "+r" (q0_f0), [q1_f0] "+r" (q1_f0) - : - ); - - if (mask & flat & flat2 & 0x00FF0000) { - __asm__ __volatile__ ( - "sb %[p6_l], -7(%[s2]) \n\t" - "sb %[p5_l], -6(%[s2]) \n\t" - "sb %[p4_l], -5(%[s2]) \n\t" - "sb %[p3_l], -4(%[s2]) \n\t" - "sb %[p2_l], -3(%[s2]) \n\t" - "sb %[p1_l], -2(%[s2]) \n\t" - "sb %[p0_l], -1(%[s2]) \n\t" - - : - : [p6_l] "r" (p6_l), [p5_l] "r" (p5_l), [p4_l] "r" (p4_l), - [p3_l] "r" (p3_l), [p2_l] "r" (p2_l), [p1_l] "r" (p1_l), - [p0_l] "r" (p0_l), [s2] "r" (s2) - ); - - __asm__ __volatile__ ( - "sb %[q0_l], (%[s2]) \n\t" - "sb %[q1_l], +1(%[s2]) \n\t" - "sb %[q2_l], +2(%[s2]) \n\t" - "sb %[q3_l], +3(%[s2]) \n\t" - "sb %[q4_l], +4(%[s2]) \n\t" - "sb %[q5_l], +5(%[s2]) \n\t" - "sb %[q6_l], +6(%[s2]) \n\t" - - : - : [q0_l] "r" (q0_l), [q1_l] "r" (q1_l), [q2_l] "r" (q2_l), - [q3_l] "r" (q3_l), [q4_l] "r" (q4_l), [q5_l] "r" (q5_l), - [q6_l] "r" (q6_l), [s2] "r" (s2) - ); - } else if (mask & flat & 0x00FF0000) { - __asm__ __volatile__ ( - "sb %[p2_l_f1], -3(%[s2]) \n\t" - "sb %[p1_l_f1], -2(%[s2]) \n\t" - "sb %[p0_l_f1], -1(%[s2]) \n\t" - "sb %[q0_l_f1], (%[s2]) \n\t" - "sb %[q1_l_f1], +1(%[s2]) \n\t" - "sb %[q2_l_f1], +2(%[s2]) \n\t" - - : - : [p2_l_f1] "r" (p2_l_f1), [p1_l_f1] "r" (p1_l_f1), - [p0_l_f1] "r" (p0_l_f1), [q0_l_f1] "r" (q0_l_f1), - [q1_l_f1] "r" (q1_l_f1), [q2_l_f1] "r" (q2_l_f1), - [s2] "r" (s2) - ); - } else if (mask & 0x00FF0000) { - __asm__ __volatile__ ( - "sb %[p1_f0], -2(%[s2]) \n\t" - "sb %[p0_f0], -1(%[s2]) \n\t" - "sb %[q0_f0], (%[s2]) \n\t" - "sb %[q1_f0], +1(%[s2]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [s2] "r" (s2) - ); - } - - __asm__ __volatile__ ( - "srl %[p6_l], %[p6_l], 16 \n\t" - "srl %[p5_l], %[p5_l], 16 \n\t" - "srl %[p4_l], %[p4_l], 16 \n\t" - "srl %[p3_l], %[p3_l], 16 \n\t" - "srl %[p2_l], %[p2_l], 16 \n\t" - "srl %[p1_l], %[p1_l], 16 \n\t" - "srl %[p0_l], %[p0_l], 16 \n\t" - "srl %[q0_l], %[q0_l], 16 \n\t" - "srl %[q1_l], %[q1_l], 16 \n\t" - "srl %[q2_l], %[q2_l], 16 \n\t" - "srl %[q3_l], %[q3_l], 16 \n\t" - "srl %[q4_l], %[q4_l], 16 \n\t" - "srl %[q5_l], %[q5_l], 16 \n\t" - "srl %[q6_l], %[q6_l], 16 \n\t" - - : [q0_l] "+r" (q0_l), [q1_l] "+r" (q1_l), [q2_l] "+r" (q2_l), - [q3_l] "+r" (q3_l), [q4_l] "+r" (q4_l), [q5_l] "+r" (q5_l), - [q6_l] "+r" (q6_l), [p6_l] "+r" (p6_l), [p5_l] "+r" (p5_l), - [p4_l] "+r" (p4_l), [p3_l] "+r" (p3_l), [p2_l] "+r" (p2_l), - [p1_l] "+r" (p1_l), [p0_l] "+r" (p0_l) - : - ); - - __asm__ __volatile__ ( - "srl %[p2_l_f1], %[p2_l_f1], 16 \n\t" - "srl %[p1_l_f1], %[p1_l_f1], 16 \n\t" - "srl %[p0_l_f1], %[p0_l_f1], 16 \n\t" - "srl %[q0_l_f1], %[q0_l_f1], 16 \n\t" - "srl %[q1_l_f1], %[q1_l_f1], 16 \n\t" - "srl %[q2_l_f1], %[q2_l_f1], 16 \n\t" - "srl %[p1_f0], %[p1_f0], 8 \n\t" - "srl %[p0_f0], %[p0_f0], 8 \n\t" - "srl %[q0_f0], %[q0_f0], 8 \n\t" - "srl %[q1_f0], %[q1_f0], 8 \n\t" - - : [p2_l_f1] "+r" (p2_l_f1), [p1_l_f1] "+r" (p1_l_f1), - [p0_l_f1] "+r" (p0_l_f1), [q0_l_f1] "+r" (q0_l_f1), - [q1_l_f1] "+r" (q1_l_f1), [q2_l_f1] "+r" (q2_l_f1), - [p1_f0] "+r" (p1_f0), [p0_f0] "+r" (p0_f0), - [q0_f0] "+r" (q0_f0), [q1_f0] "+r" (q1_f0) - : - ); - - if (mask & flat & flat2 & 0xFF000000) { - __asm__ __volatile__ ( - "sb %[p6_l], -7(%[s1]) \n\t" - "sb %[p5_l], -6(%[s1]) \n\t" - "sb %[p4_l], -5(%[s1]) \n\t" - "sb %[p3_l], -4(%[s1]) \n\t" - "sb %[p2_l], -3(%[s1]) \n\t" - "sb %[p1_l], -2(%[s1]) \n\t" - "sb %[p0_l], -1(%[s1]) \n\t" - - : - : [p6_l] "r" (p6_l), [p5_l] "r" (p5_l), [p4_l] "r" (p4_l), - [p3_l] "r" (p3_l), [p2_l] "r" (p2_l), [p1_l] "r" (p1_l), - [p0_l] "r" (p0_l), - [s1] "r" (s1) - ); - - __asm__ __volatile__ ( - "sb %[q0_l], (%[s1]) \n\t" - "sb %[q1_l], 1(%[s1]) \n\t" - "sb %[q2_l], 2(%[s1]) \n\t" - "sb %[q3_l], 3(%[s1]) \n\t" - "sb %[q4_l], 4(%[s1]) \n\t" - "sb %[q5_l], 5(%[s1]) \n\t" - "sb %[q6_l], 6(%[s1]) \n\t" - - : - : [q0_l] "r" (q0_l), [q1_l] "r" (q1_l), [q2_l] "r" (q2_l), - [q3_l] "r" (q3_l), [q4_l] "r" (q4_l), [q5_l] "r" (q5_l), - [q6_l] "r" (q6_l), - [s1] "r" (s1) - ); - } else if (mask & flat & 0xFF000000) { - __asm__ __volatile__ ( - "sb %[p2_l_f1], -3(%[s1]) \n\t" - "sb %[p1_l_f1], -2(%[s1]) \n\t" - "sb %[p0_l_f1], -1(%[s1]) \n\t" - "sb %[q0_l_f1], (%[s1]) \n\t" - "sb %[q1_l_f1], +1(%[s1]) \n\t" - "sb %[q2_l_f1], +2(%[s1]) \n\t" - - : - : [p2_l_f1] "r" (p2_l_f1), [p1_l_f1] "r" (p1_l_f1), - [p0_l_f1] "r" (p0_l_f1), [q0_l_f1] "r" (q0_l_f1), - [q1_l_f1] "r" (q1_l_f1), [q2_l_f1] "r" (q2_l_f1), - [s1] "r" (s1) - ); - } else if (mask & 0xFF000000) { - __asm__ __volatile__ ( - "sb %[p1_f0], -2(%[s1]) \n\t" - "sb %[p0_f0], -1(%[s1]) \n\t" - "sb %[q0_f0], (%[s1]) \n\t" - "sb %[q1_f0], +1(%[s1]) \n\t" - - : - : [p1_f0] "r" (p1_f0), [p0_f0] "r" (p0_f0), - [q0_f0] "r" (q0_f0), [q1_f0] "r" (q1_f0), - [s1] "r" (s1) - ); - } - } - } -} -#endif // #if HAVE_DSPR2 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_alloccommon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_alloccommon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_alloccommon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_alloccommon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,168 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "./vpx_config.h" -#include "vpx_mem/vpx_mem.h" - -#include "vp9/common/vp9_blockd.h" -#include "vp9/common/vp9_entropymode.h" -#include "vp9/common/vp9_entropymv.h" -#include "vp9/common/vp9_onyxc_int.h" -#include "vp9/common/vp9_systemdependent.h" - -// TODO(hkuang): Don't need to lock the whole pool after implementing atomic -// frame reference count. -void lock_buffer_pool(BufferPool *const pool) { -#if CONFIG_MULTITHREAD - pthread_mutex_lock(&pool->pool_mutex); -#else - (void)pool; -#endif -} - -void unlock_buffer_pool(BufferPool *const pool) { -#if CONFIG_MULTITHREAD - pthread_mutex_unlock(&pool->pool_mutex); -#else - (void)pool; -#endif -} - -void vp9_set_mb_mi(VP9_COMMON *cm, int width, int height) { - const int aligned_width = ALIGN_POWER_OF_TWO(width, MI_SIZE_LOG2); - const int aligned_height = ALIGN_POWER_OF_TWO(height, MI_SIZE_LOG2); - - cm->mi_cols = aligned_width >> MI_SIZE_LOG2; - cm->mi_rows = aligned_height >> MI_SIZE_LOG2; - cm->mi_stride = calc_mi_size(cm->mi_cols); - - cm->mb_cols = (cm->mi_cols + 1) >> 1; - cm->mb_rows = (cm->mi_rows + 1) >> 1; - cm->MBs = cm->mb_rows * cm->mb_cols; -} - -static int alloc_seg_map(VP9_COMMON *cm, int seg_map_size) { - int i; - - for (i = 0; i < NUM_PING_PONG_BUFFERS; ++i) { - cm->seg_map_array[i] = (uint8_t *)vpx_calloc(seg_map_size, 1); - if (cm->seg_map_array[i] == NULL) - return 1; - } - - // Init the index. - cm->seg_map_idx = 0; - cm->prev_seg_map_idx = 1; - - cm->current_frame_seg_map = cm->seg_map_array[cm->seg_map_idx]; - if (!cm->frame_parallel_decode) - cm->last_frame_seg_map = cm->seg_map_array[cm->prev_seg_map_idx]; - - return 0; -} - -static void free_seg_map(VP9_COMMON *cm) { - int i; - - for (i = 0; i < NUM_PING_PONG_BUFFERS; ++i) { - vpx_free(cm->seg_map_array[i]); - cm->seg_map_array[i] = NULL; - } - - cm->current_frame_seg_map = NULL; - - if (!cm->frame_parallel_decode) { - cm->last_frame_seg_map = NULL; - } -} - -void vp9_free_ref_frame_buffers(VP9_COMMON *cm) { - BufferPool *const pool = cm->buffer_pool; - int i; - - for (i = 0; i < FRAME_BUFFERS; ++i) { - if (pool->frame_bufs[i].ref_count > 0 && - pool->frame_bufs[i].raw_frame_buffer.data != NULL) { - pool->release_fb_cb(pool->cb_priv, &pool->frame_bufs[i].raw_frame_buffer); - pool->frame_bufs[i].ref_count = 0; - } - vpx_free(pool->frame_bufs[i].mvs); - pool->frame_bufs[i].mvs = NULL; - vp9_free_frame_buffer(&pool->frame_bufs[i].buf); - } - -#if CONFIG_VP9_POSTPROC - vp9_free_frame_buffer(&cm->post_proc_buffer); - vp9_free_frame_buffer(&cm->post_proc_buffer_int); -#endif -} - -void vp9_free_context_buffers(VP9_COMMON *cm) { - cm->free_mi(cm); - free_seg_map(cm); - vpx_free(cm->above_context); - cm->above_context = NULL; - vpx_free(cm->above_seg_context); - cm->above_seg_context = NULL; -} - -int vp9_alloc_context_buffers(VP9_COMMON *cm, int width, int height) { - vp9_free_context_buffers(cm); - - vp9_set_mb_mi(cm, width, height); - if (cm->alloc_mi(cm, cm->mi_stride * calc_mi_size(cm->mi_rows))) - goto fail; - - // Create the segmentation map structure and set to 0. - free_seg_map(cm); - if (alloc_seg_map(cm, cm->mi_rows * cm->mi_cols)) - goto fail; - - cm->above_context = (ENTROPY_CONTEXT *)vpx_calloc( - 2 * mi_cols_aligned_to_sb(cm->mi_cols) * MAX_MB_PLANE, - sizeof(*cm->above_context)); - if (!cm->above_context) goto fail; - - cm->above_seg_context = (PARTITION_CONTEXT *)vpx_calloc( - mi_cols_aligned_to_sb(cm->mi_cols), sizeof(*cm->above_seg_context)); - if (!cm->above_seg_context) goto fail; - - return 0; - - fail: - vp9_free_context_buffers(cm); - return 1; -} - -void vp9_remove_common(VP9_COMMON *cm) { - vp9_free_ref_frame_buffers(cm); - vp9_free_context_buffers(cm); - - vpx_free(cm->fc); - cm->fc = NULL; - vpx_free(cm->frame_contexts); - cm->frame_contexts = NULL; -} - -void vp9_init_context_buffers(VP9_COMMON *cm) { - cm->setup_mi(cm); - if (cm->last_frame_seg_map && !cm->frame_parallel_decode) - vpx_memset(cm->last_frame_seg_map, 0, cm->mi_rows * cm->mi_cols); -} - -void vp9_swap_current_and_last_seg_map(VP9_COMMON *cm) { - // Swap indices. - const int tmp = cm->seg_map_idx; - cm->seg_map_idx = cm->prev_seg_map_idx; - cm->prev_seg_map_idx = tmp; - - cm->current_frame_seg_map = cm->seg_map_array[cm->seg_map_idx]; - cm->last_frame_seg_map = cm->seg_map_array[cm->prev_seg_map_idx]; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_alloccommon.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_alloccommon.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_alloccommon.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_alloccommon.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP9_COMMON_VP9_ALLOCCOMMON_H_ -#define VP9_COMMON_VP9_ALLOCCOMMON_H_ - -#define INVALID_IDX -1 // Invalid buffer index. - -#ifdef __cplusplus -extern "C" { -#endif - -struct VP9Common; - -void vp9_remove_common(struct VP9Common *cm); - -int vp9_alloc_context_buffers(struct VP9Common *cm, int width, int height); -void vp9_init_context_buffers(struct VP9Common *cm); -void vp9_free_context_buffers(struct VP9Common *cm); - -void vp9_free_ref_frame_buffers(struct VP9Common *cm); - -int vp9_alloc_state_buffers(struct VP9Common *cm, int width, int height); -void vp9_free_state_buffers(struct VP9Common *cm); - -void vp9_set_mb_mi(struct VP9Common *cm, int width, int height); - -void vp9_swap_current_and_last_seg_map(struct VP9Common *cm); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_ALLOCCOMMON_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_blockd.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_blockd.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_blockd.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_blockd.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vp9/common/vp9_blockd.h" - -PREDICTION_MODE vp9_left_block_mode(const MODE_INFO *cur_mi, - const MODE_INFO *left_mi, int b) { - if (b == 0 || b == 2) { - if (!left_mi || is_inter_block(&left_mi->mbmi)) - return DC_PRED; - - return get_y_mode(left_mi, b + 1); - } else { - assert(b == 1 || b == 3); - return cur_mi->bmi[b - 1].as_mode; - } -} - -PREDICTION_MODE vp9_above_block_mode(const MODE_INFO *cur_mi, - const MODE_INFO *above_mi, int b) { - if (b == 0 || b == 1) { - if (!above_mi || is_inter_block(&above_mi->mbmi)) - return DC_PRED; - - return get_y_mode(above_mi, b + 2); - } else { - assert(b == 2 || b == 3); - return cur_mi->bmi[b - 2].as_mode; - } -} - -void vp9_foreach_transformed_block_in_plane( - const MACROBLOCKD *const xd, BLOCK_SIZE bsize, int plane, - foreach_transformed_block_visitor visit, void *arg) { - const struct macroblockd_plane *const pd = &xd->plane[plane]; - const MB_MODE_INFO* mbmi = &xd->mi[0].src_mi->mbmi; - // block and transform sizes, in number of 4x4 blocks log 2 ("*_b") - // 4x4=0, 8x8=2, 16x16=4, 32x32=6, 64x64=8 - // transform size varies per plane, look it up in a common way. - const TX_SIZE tx_size = plane ? get_uv_tx_size(mbmi, pd) - : mbmi->tx_size; - const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd); - const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize]; - const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize]; - const int step = 1 << (tx_size << 1); - int i = 0, r, c; - - // If mb_to_right_edge is < 0 we are in a situation in which - // the current block size extends into the UMV and we won't - // visit the sub blocks that are wholly within the UMV. - const int max_blocks_wide = num_4x4_w + (xd->mb_to_right_edge >= 0 ? 0 : - xd->mb_to_right_edge >> (5 + pd->subsampling_x)); - const int max_blocks_high = num_4x4_h + (xd->mb_to_bottom_edge >= 0 ? 0 : - xd->mb_to_bottom_edge >> (5 + pd->subsampling_y)); - - // Keep track of the row and column of the blocks we use so that we know - // if we are in the unrestricted motion border. - for (r = 0; r < max_blocks_high; r += (1 << tx_size)) { - for (c = 0; c < num_4x4_w; c += (1 << tx_size)) { - // Skip visiting the sub blocks that are wholly within the UMV. - if (c < max_blocks_wide) - visit(plane, i, plane_bsize, tx_size, arg); - i += step; - } - } -} - -void vp9_foreach_transformed_block(const MACROBLOCKD* const xd, - BLOCK_SIZE bsize, - foreach_transformed_block_visitor visit, - void *arg) { - int plane; - - for (plane = 0; plane < MAX_MB_PLANE; ++plane) - vp9_foreach_transformed_block_in_plane(xd, bsize, plane, visit, arg); -} - -void vp9_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd, - BLOCK_SIZE plane_bsize, TX_SIZE tx_size, int has_eob, - int aoff, int loff) { - ENTROPY_CONTEXT *const a = pd->above_context + aoff; - ENTROPY_CONTEXT *const l = pd->left_context + loff; - const int tx_size_in_blocks = 1 << tx_size; - - // above - if (has_eob && xd->mb_to_right_edge < 0) { - int i; - const int blocks_wide = num_4x4_blocks_wide_lookup[plane_bsize] + - (xd->mb_to_right_edge >> (5 + pd->subsampling_x)); - int above_contexts = tx_size_in_blocks; - if (above_contexts + aoff > blocks_wide) - above_contexts = blocks_wide - aoff; - - for (i = 0; i < above_contexts; ++i) - a[i] = has_eob; - for (i = above_contexts; i < tx_size_in_blocks; ++i) - a[i] = 0; - } else { - vpx_memset(a, has_eob, sizeof(ENTROPY_CONTEXT) * tx_size_in_blocks); - } - - // left - if (has_eob && xd->mb_to_bottom_edge < 0) { - int i; - const int blocks_high = num_4x4_blocks_high_lookup[plane_bsize] + - (xd->mb_to_bottom_edge >> (5 + pd->subsampling_y)); - int left_contexts = tx_size_in_blocks; - if (left_contexts + loff > blocks_high) - left_contexts = blocks_high - loff; - - for (i = 0; i < left_contexts; ++i) - l[i] = has_eob; - for (i = left_contexts; i < tx_size_in_blocks; ++i) - l[i] = 0; - } else { - vpx_memset(l, has_eob, sizeof(ENTROPY_CONTEXT) * tx_size_in_blocks); - } -} - -void vp9_setup_block_planes(MACROBLOCKD *xd, int ss_x, int ss_y) { - int i; - - for (i = 0; i < MAX_MB_PLANE; i++) { - xd->plane[i].plane_type = i ? PLANE_TYPE_UV : PLANE_TYPE_Y; - xd->plane[i].subsampling_x = i ? ss_x : 0; - xd->plane[i].subsampling_y = i ? ss_y : 0; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_blockd.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_blockd.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_blockd.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_blockd.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,322 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP9_COMMON_VP9_BLOCKD_H_ -#define VP9_COMMON_VP9_BLOCKD_H_ - -#include "./vpx_config.h" - -#include "vpx_ports/mem.h" -#include "vpx_scale/yv12config.h" - -#include "vp9/common/vp9_common_data.h" -#include "vp9/common/vp9_filter.h" -#include "vp9/common/vp9_mv.h" -#include "vp9/common/vp9_scale.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define BLOCK_SIZE_GROUPS 4 -#define SKIP_CONTEXTS 3 -#define INTER_MODE_CONTEXTS 7 - -/* Segment Feature Masks */ -#define MAX_MV_REF_CANDIDATES 2 - -#define INTRA_INTER_CONTEXTS 4 -#define COMP_INTER_CONTEXTS 5 -#define REF_CONTEXTS 5 - -typedef enum { - PLANE_TYPE_Y = 0, - PLANE_TYPE_UV = 1, - PLANE_TYPES -} PLANE_TYPE; - -#define MAX_MB_PLANE 3 - -typedef char ENTROPY_CONTEXT; - -static INLINE int combine_entropy_contexts(ENTROPY_CONTEXT a, - ENTROPY_CONTEXT b) { - return (a != 0) + (b != 0); -} - -typedef enum { - KEY_FRAME = 0, - INTER_FRAME = 1, - FRAME_TYPES, -} FRAME_TYPE; - -typedef enum { - DC_PRED, // Average of above and left pixels - V_PRED, // Vertical - H_PRED, // Horizontal - D45_PRED, // Directional 45 deg = round(arctan(1/1) * 180/pi) - D135_PRED, // Directional 135 deg = 180 - 45 - D117_PRED, // Directional 117 deg = 180 - 63 - D153_PRED, // Directional 153 deg = 180 - 27 - D207_PRED, // Directional 207 deg = 180 + 27 - D63_PRED, // Directional 63 deg = round(arctan(2/1) * 180/pi) - TM_PRED, // True-motion - NEARESTMV, - NEARMV, - ZEROMV, - NEWMV, - MB_MODE_COUNT -} PREDICTION_MODE; - -static INLINE int is_inter_mode(PREDICTION_MODE mode) { - return mode >= NEARESTMV && mode <= NEWMV; -} - -#define INTRA_MODES (TM_PRED + 1) - -#define INTER_MODES (1 + NEWMV - NEARESTMV) - -#define INTER_OFFSET(mode) ((mode) - NEARESTMV) - -/* For keyframes, intra block modes are predicted by the (already decoded) - modes for the Y blocks to the left and above us; for interframes, there - is a single probability table. */ - -typedef struct { - PREDICTION_MODE as_mode; - int_mv as_mv[2]; // first, second inter predictor motion vectors -} b_mode_info; - -// Note that the rate-distortion optimization loop, bit-stream writer, and -// decoder implementation modules critically rely on the enum entry values -// specified herein. They should be refactored concurrently. -typedef enum { - NONE = -1, - INTRA_FRAME = 0, - LAST_FRAME = 1, - GOLDEN_FRAME = 2, - ALTREF_FRAME = 3, - MAX_REF_FRAMES = 4 -} MV_REFERENCE_FRAME; - -// This structure now relates to 8x8 block regions. -typedef struct { - // Common for both INTER and INTRA blocks - BLOCK_SIZE sb_type; - PREDICTION_MODE mode; - TX_SIZE tx_size; - int8_t skip; - int8_t segment_id; - int8_t seg_id_predicted; // valid only when temporal_update is enabled - - // Only for INTRA blocks - PREDICTION_MODE uv_mode; - - // Only for INTER blocks - MV_REFERENCE_FRAME ref_frame[2]; - int_mv mv[2]; - int_mv ref_mvs[MAX_REF_FRAMES][MAX_MV_REF_CANDIDATES]; - uint8_t mode_context[MAX_REF_FRAMES]; - INTERP_FILTER interp_filter; - -} MB_MODE_INFO; - -typedef struct MODE_INFO { - struct MODE_INFO *src_mi; - MB_MODE_INFO mbmi; - b_mode_info bmi[4]; -} MODE_INFO; - -static INLINE PREDICTION_MODE get_y_mode(const MODE_INFO *mi, int block) { - return mi->mbmi.sb_type < BLOCK_8X8 ? mi->bmi[block].as_mode - : mi->mbmi.mode; -} - -static INLINE int is_inter_block(const MB_MODE_INFO *mbmi) { - return mbmi->ref_frame[0] > INTRA_FRAME; -} - -static INLINE int has_second_ref(const MB_MODE_INFO *mbmi) { - return mbmi->ref_frame[1] > INTRA_FRAME; -} - -PREDICTION_MODE vp9_left_block_mode(const MODE_INFO *cur_mi, - const MODE_INFO *left_mi, int b); - -PREDICTION_MODE vp9_above_block_mode(const MODE_INFO *cur_mi, - const MODE_INFO *above_mi, int b); - -enum mv_precision { - MV_PRECISION_Q3, - MV_PRECISION_Q4 -}; - -struct buf_2d { - uint8_t *buf; - int stride; -}; - -struct macroblockd_plane { - tran_low_t *dqcoeff; - PLANE_TYPE plane_type; - int subsampling_x; - int subsampling_y; - struct buf_2d dst; - struct buf_2d pre[2]; - const int16_t *dequant; - ENTROPY_CONTEXT *above_context; - ENTROPY_CONTEXT *left_context; -}; - -#define BLOCK_OFFSET(x, i) ((x) + (i) * 16) - -typedef struct RefBuffer { - // TODO(dkovalev): idx is not really required and should be removed, now it - // is used in vp9_onyxd_if.c - int idx; - YV12_BUFFER_CONFIG *buf; - struct scale_factors sf; -} RefBuffer; - -typedef struct macroblockd { - struct macroblockd_plane plane[MAX_MB_PLANE]; - - int mi_stride; - - MODE_INFO *mi; - MODE_INFO *left_mi; - MODE_INFO *above_mi; - MB_MODE_INFO *left_mbmi; - MB_MODE_INFO *above_mbmi; - - int up_available; - int left_available; - - /* Distance of MB away from frame edges */ - int mb_to_left_edge; - int mb_to_right_edge; - int mb_to_top_edge; - int mb_to_bottom_edge; - - /* pointers to reference frames */ - RefBuffer *block_refs[2]; - - /* pointer to current frame */ - const YV12_BUFFER_CONFIG *cur_buf; - - ENTROPY_CONTEXT *above_context[MAX_MB_PLANE]; - ENTROPY_CONTEXT left_context[MAX_MB_PLANE][16]; - - PARTITION_CONTEXT *above_seg_context; - PARTITION_CONTEXT left_seg_context[8]; - - /* mc buffer */ - DECLARE_ALIGNED(16, uint8_t, mc_buf[80 * 2 * 80 * 2]); - -#if CONFIG_VP9_HIGHBITDEPTH - /* Bit depth: 8, 10, 12 */ - int bd; - DECLARE_ALIGNED(16, uint16_t, mc_buf_high[80 * 2 * 80 * 2]); -#endif - - /* dqcoeff are shared by all the planes. So planes must be decoded serially */ - DECLARE_ALIGNED(16, tran_low_t, dqcoeff[64 * 64]); - - int lossless; - int corrupted; - - struct vpx_internal_error_info *error_info; -} MACROBLOCKD; - -static INLINE BLOCK_SIZE get_subsize(BLOCK_SIZE bsize, - PARTITION_TYPE partition) { - return subsize_lookup[partition][bsize]; -} - -extern const TX_TYPE intra_mode_to_tx_type_lookup[INTRA_MODES]; - -static INLINE TX_TYPE get_tx_type(PLANE_TYPE plane_type, - const MACROBLOCKD *xd) { - const MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi; - - if (plane_type != PLANE_TYPE_Y || xd->lossless || is_inter_block(mbmi)) - return DCT_DCT; - - return intra_mode_to_tx_type_lookup[mbmi->mode]; -} - -static INLINE TX_TYPE get_tx_type_4x4(PLANE_TYPE plane_type, - const MACROBLOCKD *xd, int ib) { - const MODE_INFO *const mi = xd->mi[0].src_mi; - - if (plane_type != PLANE_TYPE_Y || xd->lossless || is_inter_block(&mi->mbmi)) - return DCT_DCT; - - return intra_mode_to_tx_type_lookup[get_y_mode(mi, ib)]; -} - -void vp9_setup_block_planes(MACROBLOCKD *xd, int ss_x, int ss_y); - -static INLINE TX_SIZE get_uv_tx_size_impl(TX_SIZE y_tx_size, BLOCK_SIZE bsize, - int xss, int yss) { - if (bsize < BLOCK_8X8) { - return TX_4X4; - } else { - const BLOCK_SIZE plane_bsize = ss_size_lookup[bsize][xss][yss]; - return MIN(y_tx_size, max_txsize_lookup[plane_bsize]); - } -} - -static INLINE TX_SIZE get_uv_tx_size(const MB_MODE_INFO *mbmi, - const struct macroblockd_plane *pd) { - return get_uv_tx_size_impl(mbmi->tx_size, mbmi->sb_type, pd->subsampling_x, - pd->subsampling_y); -} - -static INLINE BLOCK_SIZE get_plane_block_size(BLOCK_SIZE bsize, - const struct macroblockd_plane *pd) { - return ss_size_lookup[bsize][pd->subsampling_x][pd->subsampling_y]; -} - -typedef void (*foreach_transformed_block_visitor)(int plane, int block, - BLOCK_SIZE plane_bsize, - TX_SIZE tx_size, - void *arg); - -void vp9_foreach_transformed_block_in_plane( - const MACROBLOCKD *const xd, BLOCK_SIZE bsize, int plane, - foreach_transformed_block_visitor visit, void *arg); - - -void vp9_foreach_transformed_block( - const MACROBLOCKD* const xd, BLOCK_SIZE bsize, - foreach_transformed_block_visitor visit, void *arg); - -static INLINE void txfrm_block_to_raster_xy(BLOCK_SIZE plane_bsize, - TX_SIZE tx_size, int block, - int *x, int *y) { - const int bwl = b_width_log2_lookup[plane_bsize]; - const int tx_cols_log2 = bwl - tx_size; - const int tx_cols = 1 << tx_cols_log2; - const int raster_mb = block >> (tx_size << 1); - *x = (raster_mb & (tx_cols - 1)) << tx_size; - *y = (raster_mb >> tx_cols_log2) << tx_size; -} - -void vp9_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd, - BLOCK_SIZE plane_bsize, TX_SIZE tx_size, int has_eob, - int aoff, int loff); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_BLOCKD_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_common_data.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_common_data.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_common_data.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_common_data.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,160 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vp9/common/vp9_common_data.h" - -// Log 2 conversion lookup tables for block width and height -const int b_width_log2_lookup[BLOCK_SIZES] = - {0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4}; -const int b_height_log2_lookup[BLOCK_SIZES] = - {0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4}; -const int num_4x4_blocks_wide_lookup[BLOCK_SIZES] = - {1, 1, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16}; -const int num_4x4_blocks_high_lookup[BLOCK_SIZES] = - {1, 2, 1, 2, 4, 2, 4, 8, 4, 8, 16, 8, 16}; -// Log 2 conversion lookup tables for modeinfo width and height -const int mi_width_log2_lookup[BLOCK_SIZES] = - {0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3}; -const int num_8x8_blocks_wide_lookup[BLOCK_SIZES] = - {1, 1, 1, 1, 1, 2, 2, 2, 4, 4, 4, 8, 8}; -const int num_8x8_blocks_high_lookup[BLOCK_SIZES] = - {1, 1, 1, 1, 2, 1, 2, 4, 2, 4, 8, 4, 8}; - -// MIN(3, MIN(b_width_log2(bsize), b_height_log2(bsize))) -const int size_group_lookup[BLOCK_SIZES] = - {0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3}; - -const int num_pels_log2_lookup[BLOCK_SIZES] = - {4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11, 11, 12}; - -const PARTITION_TYPE partition_lookup[][BLOCK_SIZES] = { - { // 4X4 - // 4X4, 4X8,8X4,8X8,8X16,16X8,16X16,16X32,32X16,32X32,32X64,64X32,64X64 - PARTITION_NONE, PARTITION_INVALID, PARTITION_INVALID, - PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, - PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, - PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, - PARTITION_INVALID - }, { // 8X8 - // 4X4, 4X8,8X4,8X8,8X16,16X8,16X16,16X32,32X16,32X32,32X64,64X32,64X64 - PARTITION_SPLIT, PARTITION_VERT, PARTITION_HORZ, PARTITION_NONE, - PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, - PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, - PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID - }, { // 16X16 - // 4X4, 4X8,8X4,8X8,8X16,16X8,16X16,16X32,32X16,32X32,32X64,64X32,64X64 - PARTITION_SPLIT, PARTITION_SPLIT, PARTITION_SPLIT, PARTITION_SPLIT, - PARTITION_VERT, PARTITION_HORZ, PARTITION_NONE, PARTITION_INVALID, - PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, - PARTITION_INVALID, PARTITION_INVALID - }, { // 32X32 - // 4X4, 4X8,8X4,8X8,8X16,16X8,16X16,16X32,32X16,32X32,32X64,64X32,64X64 - PARTITION_SPLIT, PARTITION_SPLIT, PARTITION_SPLIT, PARTITION_SPLIT, - PARTITION_SPLIT, PARTITION_SPLIT, PARTITION_SPLIT, PARTITION_VERT, - PARTITION_HORZ, PARTITION_NONE, PARTITION_INVALID, - PARTITION_INVALID, PARTITION_INVALID - }, { // 64X64 - // 4X4, 4X8,8X4,8X8,8X16,16X8,16X16,16X32,32X16,32X32,32X64,64X32,64X64 - PARTITION_SPLIT, PARTITION_SPLIT, PARTITION_SPLIT, PARTITION_SPLIT, - PARTITION_SPLIT, PARTITION_SPLIT, PARTITION_SPLIT, PARTITION_SPLIT, - PARTITION_SPLIT, PARTITION_SPLIT, PARTITION_VERT, PARTITION_HORZ, - PARTITION_NONE - } -}; - -const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] = { - { // PARTITION_NONE - BLOCK_4X4, BLOCK_4X8, BLOCK_8X4, - BLOCK_8X8, BLOCK_8X16, BLOCK_16X8, - BLOCK_16X16, BLOCK_16X32, BLOCK_32X16, - BLOCK_32X32, BLOCK_32X64, BLOCK_64X32, - BLOCK_64X64, - }, { // PARTITION_HORZ - BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, - BLOCK_8X4, BLOCK_INVALID, BLOCK_INVALID, - BLOCK_16X8, BLOCK_INVALID, BLOCK_INVALID, - BLOCK_32X16, BLOCK_INVALID, BLOCK_INVALID, - BLOCK_64X32, - }, { // PARTITION_VERT - BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, - BLOCK_4X8, BLOCK_INVALID, BLOCK_INVALID, - BLOCK_8X16, BLOCK_INVALID, BLOCK_INVALID, - BLOCK_16X32, BLOCK_INVALID, BLOCK_INVALID, - BLOCK_32X64, - }, { // PARTITION_SPLIT - BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, - BLOCK_4X4, BLOCK_INVALID, BLOCK_INVALID, - BLOCK_8X8, BLOCK_INVALID, BLOCK_INVALID, - BLOCK_16X16, BLOCK_INVALID, BLOCK_INVALID, - BLOCK_32X32, - } -}; - -const TX_SIZE max_txsize_lookup[BLOCK_SIZES] = { - TX_4X4, TX_4X4, TX_4X4, - TX_8X8, TX_8X8, TX_8X8, - TX_16X16, TX_16X16, TX_16X16, - TX_32X32, TX_32X32, TX_32X32, TX_32X32 -}; - -const BLOCK_SIZE txsize_to_bsize[TX_SIZES] = { - BLOCK_4X4, // TX_4X4 - BLOCK_8X8, // TX_8X8 - BLOCK_16X16, // TX_16X16 - BLOCK_32X32, // TX_32X32 -}; - -const TX_SIZE tx_mode_to_biggest_tx_size[TX_MODES] = { - TX_4X4, // ONLY_4X4 - TX_8X8, // ALLOW_8X8 - TX_16X16, // ALLOW_16X16 - TX_32X32, // ALLOW_32X32 - TX_32X32, // TX_MODE_SELECT -}; - -const BLOCK_SIZE ss_size_lookup[BLOCK_SIZES][2][2] = { -// ss_x == 0 ss_x == 0 ss_x == 1 ss_x == 1 -// ss_y == 0 ss_y == 1 ss_y == 0 ss_y == 1 - {{BLOCK_4X4, BLOCK_INVALID}, {BLOCK_INVALID, BLOCK_INVALID}}, - {{BLOCK_4X8, BLOCK_4X4}, {BLOCK_INVALID, BLOCK_INVALID}}, - {{BLOCK_8X4, BLOCK_INVALID}, {BLOCK_4X4, BLOCK_INVALID}}, - {{BLOCK_8X8, BLOCK_8X4}, {BLOCK_4X8, BLOCK_4X4}}, - {{BLOCK_8X16, BLOCK_8X8}, {BLOCK_INVALID, BLOCK_4X8}}, - {{BLOCK_16X8, BLOCK_INVALID}, {BLOCK_8X8, BLOCK_8X4}}, - {{BLOCK_16X16, BLOCK_16X8}, {BLOCK_8X16, BLOCK_8X8}}, - {{BLOCK_16X32, BLOCK_16X16}, {BLOCK_INVALID, BLOCK_8X16}}, - {{BLOCK_32X16, BLOCK_INVALID}, {BLOCK_16X16, BLOCK_16X8}}, - {{BLOCK_32X32, BLOCK_32X16}, {BLOCK_16X32, BLOCK_16X16}}, - {{BLOCK_32X64, BLOCK_32X32}, {BLOCK_INVALID, BLOCK_16X32}}, - {{BLOCK_64X32, BLOCK_INVALID}, {BLOCK_32X32, BLOCK_32X16}}, - {{BLOCK_64X64, BLOCK_64X32}, {BLOCK_32X64, BLOCK_32X32}}, -}; - -// Generates 4 bit field in which each bit set to 1 represents -// a blocksize partition 1111 means we split 64x64, 32x32, 16x16 -// and 8x8. 1000 means we just split the 64x64 to 32x32 -const struct { - PARTITION_CONTEXT above; - PARTITION_CONTEXT left; -} partition_context_lookup[BLOCK_SIZES]= { - {15, 15}, // 4X4 - {0b1111, 0b1111} - {15, 14}, // 4X8 - {0b1111, 0b1110} - {14, 15}, // 8X4 - {0b1110, 0b1111} - {14, 14}, // 8X8 - {0b1110, 0b1110} - {14, 12}, // 8X16 - {0b1110, 0b1100} - {12, 14}, // 16X8 - {0b1100, 0b1110} - {12, 12}, // 16X16 - {0b1100, 0b1100} - {12, 8 }, // 16X32 - {0b1100, 0b1000} - {8, 12}, // 32X16 - {0b1000, 0b1100} - {8, 8 }, // 32X32 - {0b1000, 0b1000} - {8, 0 }, // 32X64 - {0b1000, 0b0000} - {0, 8 }, // 64X32 - {0b0000, 0b1000} - {0, 0 }, // 64X64 - {0b0000, 0b0000} -}; diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_common_data.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_common_data.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_common_data.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_common_data.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_COMMON_DATA_H_ -#define VP9_COMMON_VP9_COMMON_DATA_H_ - -#include "vp9/common/vp9_enums.h" - -#ifdef __cplusplus -extern "C" { -#endif - -extern const int b_width_log2_lookup[BLOCK_SIZES]; -extern const int b_height_log2_lookup[BLOCK_SIZES]; -extern const int mi_width_log2_lookup[BLOCK_SIZES]; -extern const int num_8x8_blocks_wide_lookup[BLOCK_SIZES]; -extern const int num_8x8_blocks_high_lookup[BLOCK_SIZES]; -extern const int num_4x4_blocks_high_lookup[BLOCK_SIZES]; -extern const int num_4x4_blocks_wide_lookup[BLOCK_SIZES]; -extern const int size_group_lookup[BLOCK_SIZES]; -extern const int num_pels_log2_lookup[BLOCK_SIZES]; -extern const PARTITION_TYPE partition_lookup[][BLOCK_SIZES]; -extern const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES]; -extern const TX_SIZE max_txsize_lookup[BLOCK_SIZES]; -extern const BLOCK_SIZE txsize_to_bsize[TX_SIZES]; -extern const TX_SIZE tx_mode_to_biggest_tx_size[TX_MODES]; -extern const BLOCK_SIZE ss_size_lookup[BLOCK_SIZES][2][2]; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_COMMON_DATA_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_common.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_common.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_common.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_common.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,126 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_COMMON_H_ -#define VP9_COMMON_VP9_COMMON_H_ - -/* Interface header for common constant data structures and lookup tables */ - -#include - -#include "./vpx_config.h" -#include "vpx_mem/vpx_mem.h" -#include "vpx/vpx_integer.h" -#include "vp9/common/vp9_systemdependent.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define MIN(x, y) (((x) < (y)) ? (x) : (y)) -#define MAX(x, y) (((x) > (y)) ? (x) : (y)) - -#define ROUND_POWER_OF_TWO(value, n) \ - (((value) + (1 << ((n) - 1))) >> (n)) - -#define ALIGN_POWER_OF_TWO(value, n) \ - (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1)) - -// Only need this for fixed-size arrays, for structs just assign. -#define vp9_copy(dest, src) { \ - assert(sizeof(dest) == sizeof(src)); \ - vpx_memcpy(dest, src, sizeof(src)); \ - } - -// Use this for variably-sized arrays. -#define vp9_copy_array(dest, src, n) { \ - assert(sizeof(*dest) == sizeof(*src)); \ - vpx_memcpy(dest, src, n * sizeof(*src)); \ - } - -#define vp9_zero(dest) vpx_memset(&(dest), 0, sizeof(dest)) -#define vp9_zero_array(dest, n) vpx_memset(dest, 0, n * sizeof(*dest)) - -static INLINE uint8_t clip_pixel(int val) { - return (val > 255) ? 255 : (val < 0) ? 0 : val; -} - -static INLINE int clamp(int value, int low, int high) { - return value < low ? low : (value > high ? high : value); -} - -static INLINE double fclamp(double value, double low, double high) { - return value < low ? low : (value > high ? high : value); -} - -static INLINE int get_unsigned_bits(unsigned int num_values) { - return num_values > 0 ? get_msb(num_values) + 1 : 0; -} - -#if CONFIG_VP9_HIGHBITDEPTH -static INLINE uint16_t clip_pixel_highbd(int val, int bd) { - switch (bd) { - case 8: - default: - return (uint16_t)clamp(val, 0, 255); - case 10: - return (uint16_t)clamp(val, 0, 1023); - case 12: - return (uint16_t)clamp(val, 0, 4095); - } -} - -// Note: -// tran_low_t is the datatype used for final transform coefficients. -// tran_high_t is the datatype used for intermediate transform stages. -typedef int64_t tran_high_t; -typedef int32_t tran_low_t; - -#define CONVERT_TO_SHORTPTR(x) ((uint16_t*)(((uintptr_t)x) << 1)) -#define CONVERT_TO_BYTEPTR(x) ((uint8_t*)(((uintptr_t)x) >> 1 )) - -#else - -// Note: -// tran_low_t is the datatype used for final transform coefficients. -// tran_high_t is the datatype used for intermediate transform stages. -typedef int32_t tran_high_t; -typedef int16_t tran_low_t; -#endif // CONFIG_VP9_HIGHBITDEPTH - -#if CONFIG_DEBUG -#define CHECK_MEM_ERROR(cm, lval, expr) do { \ - lval = (expr); \ - if (!lval) \ - vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR, \ - "Failed to allocate "#lval" at %s:%d", \ - __FILE__, __LINE__); \ - } while (0) -#else -#define CHECK_MEM_ERROR(cm, lval, expr) do { \ - lval = (expr); \ - if (!lval) \ - vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR, \ - "Failed to allocate "#lval); \ - } while (0) -#endif - -#define VP9_SYNC_CODE_0 0x49 -#define VP9_SYNC_CODE_1 0x83 -#define VP9_SYNC_CODE_2 0x42 - -#define VP9_FRAME_MARKER 0x2 - - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_COMMON_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_convolve.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_convolve.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_convolve.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_convolve.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,557 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "./vpx_config.h" -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_convolve.h" -#include "vp9/common/vp9_filter.h" -#include "vpx/vpx_integer.h" -#include "vpx_ports/mem.h" - -static void convolve_horiz(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const InterpKernel *x_filters, - int x0_q4, int x_step_q4, int w, int h) { - int x, y; - src -= SUBPEL_TAPS / 2 - 1; - for (y = 0; y < h; ++y) { - int x_q4 = x0_q4; - for (x = 0; x < w; ++x) { - const uint8_t *const src_x = &src[x_q4 >> SUBPEL_BITS]; - const int16_t *const x_filter = x_filters[x_q4 & SUBPEL_MASK]; - int k, sum = 0; - for (k = 0; k < SUBPEL_TAPS; ++k) - sum += src_x[k] * x_filter[k]; - dst[x] = clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS)); - x_q4 += x_step_q4; - } - src += src_stride; - dst += dst_stride; - } -} - -static void convolve_avg_horiz(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const InterpKernel *x_filters, - int x0_q4, int x_step_q4, int w, int h) { - int x, y; - src -= SUBPEL_TAPS / 2 - 1; - for (y = 0; y < h; ++y) { - int x_q4 = x0_q4; - for (x = 0; x < w; ++x) { - const uint8_t *const src_x = &src[x_q4 >> SUBPEL_BITS]; - const int16_t *const x_filter = x_filters[x_q4 & SUBPEL_MASK]; - int k, sum = 0; - for (k = 0; k < SUBPEL_TAPS; ++k) - sum += src_x[k] * x_filter[k]; - dst[x] = ROUND_POWER_OF_TWO(dst[x] + - clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS)), 1); - x_q4 += x_step_q4; - } - src += src_stride; - dst += dst_stride; - } -} - -static void convolve_vert(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const InterpKernel *y_filters, - int y0_q4, int y_step_q4, int w, int h) { - int x, y; - src -= src_stride * (SUBPEL_TAPS / 2 - 1); - - for (x = 0; x < w; ++x) { - int y_q4 = y0_q4; - for (y = 0; y < h; ++y) { - const unsigned char *src_y = &src[(y_q4 >> SUBPEL_BITS) * src_stride]; - const int16_t *const y_filter = y_filters[y_q4 & SUBPEL_MASK]; - int k, sum = 0; - for (k = 0; k < SUBPEL_TAPS; ++k) - sum += src_y[k * src_stride] * y_filter[k]; - dst[y * dst_stride] = clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS)); - y_q4 += y_step_q4; - } - ++src; - ++dst; - } -} - -static void convolve_avg_vert(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const InterpKernel *y_filters, - int y0_q4, int y_step_q4, int w, int h) { - int x, y; - src -= src_stride * (SUBPEL_TAPS / 2 - 1); - - for (x = 0; x < w; ++x) { - int y_q4 = y0_q4; - for (y = 0; y < h; ++y) { - const unsigned char *src_y = &src[(y_q4 >> SUBPEL_BITS) * src_stride]; - const int16_t *const y_filter = y_filters[y_q4 & SUBPEL_MASK]; - int k, sum = 0; - for (k = 0; k < SUBPEL_TAPS; ++k) - sum += src_y[k * src_stride] * y_filter[k]; - dst[y * dst_stride] = ROUND_POWER_OF_TWO(dst[y * dst_stride] + - clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS)), 1); - y_q4 += y_step_q4; - } - ++src; - ++dst; - } -} - -static void convolve(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const InterpKernel *const x_filters, - int x0_q4, int x_step_q4, - const InterpKernel *const y_filters, - int y0_q4, int y_step_q4, - int w, int h) { - // Note: Fixed size intermediate buffer, temp, places limits on parameters. - // 2d filtering proceeds in 2 steps: - // (1) Interpolate horizontally into an intermediate buffer, temp. - // (2) Interpolate temp vertically to derive the sub-pixel result. - // Deriving the maximum number of rows in the temp buffer (135): - // --Smallest scaling factor is x1/2 ==> y_step_q4 = 32 (Normative). - // --Largest block size is 64x64 pixels. - // --64 rows in the downscaled frame span a distance of (64 - 1) * 32 in the - // original frame (in 1/16th pixel units). - // --Must round-up because block may be located at sub-pixel position. - // --Require an additional SUBPEL_TAPS rows for the 8-tap filter tails. - // --((64 - 1) * 32 + 15) >> 4 + 8 = 135. - uint8_t temp[135 * 64]; - int intermediate_height = - (((h - 1) * y_step_q4 + y0_q4) >> SUBPEL_BITS) + SUBPEL_TAPS; - - assert(w <= 64); - assert(h <= 64); - assert(y_step_q4 <= 32); - assert(x_step_q4 <= 32); - - convolve_horiz(src - src_stride * (SUBPEL_TAPS / 2 - 1), src_stride, temp, 64, - x_filters, x0_q4, x_step_q4, w, intermediate_height); - convolve_vert(temp + 64 * (SUBPEL_TAPS / 2 - 1), 64, dst, dst_stride, - y_filters, y0_q4, y_step_q4, w, h); -} - -static const InterpKernel *get_filter_base(const int16_t *filter) { - // NOTE: This assumes that the filter table is 256-byte aligned. - // TODO(agrange) Modify to make independent of table alignment. - return (const InterpKernel *)(((intptr_t)filter) & ~((intptr_t)0xFF)); -} - -static int get_filter_offset(const int16_t *f, const InterpKernel *base) { - return (int)((const InterpKernel *)(intptr_t)f - base); -} - -void vp9_convolve8_horiz_c(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h) { - const InterpKernel *const filters_x = get_filter_base(filter_x); - const int x0_q4 = get_filter_offset(filter_x, filters_x); - - (void)filter_y; - (void)y_step_q4; - - convolve_horiz(src, src_stride, dst, dst_stride, filters_x, - x0_q4, x_step_q4, w, h); -} - -void vp9_convolve8_avg_horiz_c(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h) { - const InterpKernel *const filters_x = get_filter_base(filter_x); - const int x0_q4 = get_filter_offset(filter_x, filters_x); - - (void)filter_y; - (void)y_step_q4; - - convolve_avg_horiz(src, src_stride, dst, dst_stride, filters_x, - x0_q4, x_step_q4, w, h); -} - -void vp9_convolve8_vert_c(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h) { - const InterpKernel *const filters_y = get_filter_base(filter_y); - const int y0_q4 = get_filter_offset(filter_y, filters_y); - - (void)filter_x; - (void)x_step_q4; - - convolve_vert(src, src_stride, dst, dst_stride, filters_y, - y0_q4, y_step_q4, w, h); -} - -void vp9_convolve8_avg_vert_c(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h) { - const InterpKernel *const filters_y = get_filter_base(filter_y); - const int y0_q4 = get_filter_offset(filter_y, filters_y); - - (void)filter_x; - (void)x_step_q4; - - convolve_avg_vert(src, src_stride, dst, dst_stride, filters_y, - y0_q4, y_step_q4, w, h); -} - -void vp9_convolve8_c(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h) { - const InterpKernel *const filters_x = get_filter_base(filter_x); - const int x0_q4 = get_filter_offset(filter_x, filters_x); - - const InterpKernel *const filters_y = get_filter_base(filter_y); - const int y0_q4 = get_filter_offset(filter_y, filters_y); - - convolve(src, src_stride, dst, dst_stride, - filters_x, x0_q4, x_step_q4, - filters_y, y0_q4, y_step_q4, w, h); -} - -void vp9_convolve8_avg_c(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h) { - /* Fixed size intermediate buffer places limits on parameters. */ - DECLARE_ALIGNED_ARRAY(16, uint8_t, temp, 64 * 64); - assert(w <= 64); - assert(h <= 64); - - vp9_convolve8_c(src, src_stride, temp, 64, - filter_x, x_step_q4, filter_y, y_step_q4, w, h); - vp9_convolve_avg_c(temp, 64, dst, dst_stride, NULL, 0, NULL, 0, w, h); -} - -void vp9_convolve_copy_c(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int filter_x_stride, - const int16_t *filter_y, int filter_y_stride, - int w, int h) { - int r; - - (void)filter_x; (void)filter_x_stride; - (void)filter_y; (void)filter_y_stride; - - for (r = h; r > 0; --r) { - vpx_memcpy(dst, src, w); - src += src_stride; - dst += dst_stride; - } -} - -void vp9_convolve_avg_c(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int filter_x_stride, - const int16_t *filter_y, int filter_y_stride, - int w, int h) { - int x, y; - - (void)filter_x; (void)filter_x_stride; - (void)filter_y; (void)filter_y_stride; - - for (y = 0; y < h; ++y) { - for (x = 0; x < w; ++x) - dst[x] = ROUND_POWER_OF_TWO(dst[x] + src[x], 1); - - src += src_stride; - dst += dst_stride; - } -} - -#if CONFIG_VP9_HIGHBITDEPTH -static void highbd_convolve_horiz(const uint8_t *src8, ptrdiff_t src_stride, - uint8_t *dst8, ptrdiff_t dst_stride, - const InterpKernel *x_filters, - int x0_q4, int x_step_q4, - int w, int h, int bd) { - int x, y; - uint16_t *src = CONVERT_TO_SHORTPTR(src8); - uint16_t *dst = CONVERT_TO_SHORTPTR(dst8); - src -= SUBPEL_TAPS / 2 - 1; - for (y = 0; y < h; ++y) { - int x_q4 = x0_q4; - for (x = 0; x < w; ++x) { - const uint16_t *const src_x = &src[x_q4 >> SUBPEL_BITS]; - const int16_t *const x_filter = x_filters[x_q4 & SUBPEL_MASK]; - int k, sum = 0; - for (k = 0; k < SUBPEL_TAPS; ++k) - sum += src_x[k] * x_filter[k]; - dst[x] = clip_pixel_highbd(ROUND_POWER_OF_TWO(sum, FILTER_BITS), bd); - x_q4 += x_step_q4; - } - src += src_stride; - dst += dst_stride; - } -} - -static void highbd_convolve_avg_horiz(const uint8_t *src8, ptrdiff_t src_stride, - uint8_t *dst8, ptrdiff_t dst_stride, - const InterpKernel *x_filters, - int x0_q4, int x_step_q4, - int w, int h, int bd) { - int x, y; - uint16_t *src = CONVERT_TO_SHORTPTR(src8); - uint16_t *dst = CONVERT_TO_SHORTPTR(dst8); - src -= SUBPEL_TAPS / 2 - 1; - for (y = 0; y < h; ++y) { - int x_q4 = x0_q4; - for (x = 0; x < w; ++x) { - const uint16_t *const src_x = &src[x_q4 >> SUBPEL_BITS]; - const int16_t *const x_filter = x_filters[x_q4 & SUBPEL_MASK]; - int k, sum = 0; - for (k = 0; k < SUBPEL_TAPS; ++k) - sum += src_x[k] * x_filter[k]; - dst[x] = ROUND_POWER_OF_TWO(dst[x] + - clip_pixel_highbd(ROUND_POWER_OF_TWO(sum, FILTER_BITS), bd), 1); - x_q4 += x_step_q4; - } - src += src_stride; - dst += dst_stride; - } -} - -static void highbd_convolve_vert(const uint8_t *src8, ptrdiff_t src_stride, - uint8_t *dst8, ptrdiff_t dst_stride, - const InterpKernel *y_filters, - int y0_q4, int y_step_q4, int w, int h, - int bd) { - int x, y; - uint16_t *src = CONVERT_TO_SHORTPTR(src8); - uint16_t *dst = CONVERT_TO_SHORTPTR(dst8); - src -= src_stride * (SUBPEL_TAPS / 2 - 1); - for (x = 0; x < w; ++x) { - int y_q4 = y0_q4; - for (y = 0; y < h; ++y) { - const uint16_t *src_y = &src[(y_q4 >> SUBPEL_BITS) * src_stride]; - const int16_t *const y_filter = y_filters[y_q4 & SUBPEL_MASK]; - int k, sum = 0; - for (k = 0; k < SUBPEL_TAPS; ++k) - sum += src_y[k * src_stride] * y_filter[k]; - dst[y * dst_stride] = clip_pixel_highbd( - ROUND_POWER_OF_TWO(sum, FILTER_BITS), bd); - y_q4 += y_step_q4; - } - ++src; - ++dst; - } -} - -static void highbd_convolve_avg_vert(const uint8_t *src8, ptrdiff_t src_stride, - uint8_t *dst8, ptrdiff_t dst_stride, - const InterpKernel *y_filters, - int y0_q4, int y_step_q4, int w, int h, - int bd) { - int x, y; - uint16_t *src = CONVERT_TO_SHORTPTR(src8); - uint16_t *dst = CONVERT_TO_SHORTPTR(dst8); - src -= src_stride * (SUBPEL_TAPS / 2 - 1); - for (x = 0; x < w; ++x) { - int y_q4 = y0_q4; - for (y = 0; y < h; ++y) { - const uint16_t *src_y = &src[(y_q4 >> SUBPEL_BITS) * src_stride]; - const int16_t *const y_filter = y_filters[y_q4 & SUBPEL_MASK]; - int k, sum = 0; - for (k = 0; k < SUBPEL_TAPS; ++k) - sum += src_y[k * src_stride] * y_filter[k]; - dst[y * dst_stride] = ROUND_POWER_OF_TWO(dst[y * dst_stride] + - clip_pixel_highbd(ROUND_POWER_OF_TWO(sum, FILTER_BITS), bd), 1); - y_q4 += y_step_q4; - } - ++src; - ++dst; - } -} - -static void highbd_convolve(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const InterpKernel *const x_filters, - int x0_q4, int x_step_q4, - const InterpKernel *const y_filters, - int y0_q4, int y_step_q4, - int w, int h, int bd) { - // Note: Fixed size intermediate buffer, temp, places limits on parameters. - // 2d filtering proceeds in 2 steps: - // (1) Interpolate horizontally into an intermediate buffer, temp. - // (2) Interpolate temp vertically to derive the sub-pixel result. - // Deriving the maximum number of rows in the temp buffer (135): - // --Smallest scaling factor is x1/2 ==> y_step_q4 = 32 (Normative). - // --Largest block size is 64x64 pixels. - // --64 rows in the downscaled frame span a distance of (64 - 1) * 32 in the - // original frame (in 1/16th pixel units). - // --Must round-up because block may be located at sub-pixel position. - // --Require an additional SUBPEL_TAPS rows for the 8-tap filter tails. - // --((64 - 1) * 32 + 15) >> 4 + 8 = 135. - uint16_t temp[64 * 135]; - int intermediate_height = - (((h - 1) * y_step_q4 + y0_q4) >> SUBPEL_BITS) + SUBPEL_TAPS; - - assert(w <= 64); - assert(h <= 64); - assert(y_step_q4 <= 32); - assert(x_step_q4 <= 32); - - highbd_convolve_horiz(src - src_stride * (SUBPEL_TAPS / 2 - 1), - src_stride, CONVERT_TO_BYTEPTR(temp), 64, - x_filters, x0_q4, x_step_q4, w, - intermediate_height, bd); - highbd_convolve_vert(CONVERT_TO_BYTEPTR(temp) + 64 * (SUBPEL_TAPS / 2 - 1), - 64, dst, dst_stride, y_filters, y0_q4, y_step_q4, - w, h, bd); -} - - -void vp9_highbd_convolve8_horiz_c(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h, int bd) { - const InterpKernel *const filters_x = get_filter_base(filter_x); - const int x0_q4 = get_filter_offset(filter_x, filters_x); - (void)filter_y; - (void)y_step_q4; - - highbd_convolve_horiz(src, src_stride, dst, dst_stride, filters_x, - x0_q4, x_step_q4, w, h, bd); -} - -void vp9_highbd_convolve8_avg_horiz_c(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h, int bd) { - const InterpKernel *const filters_x = get_filter_base(filter_x); - const int x0_q4 = get_filter_offset(filter_x, filters_x); - (void)filter_y; - (void)y_step_q4; - - highbd_convolve_avg_horiz(src, src_stride, dst, dst_stride, filters_x, - x0_q4, x_step_q4, w, h, bd); -} - -void vp9_highbd_convolve8_vert_c(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h, int bd) { - const InterpKernel *const filters_y = get_filter_base(filter_y); - const int y0_q4 = get_filter_offset(filter_y, filters_y); - (void)filter_x; - (void)x_step_q4; - - highbd_convolve_vert(src, src_stride, dst, dst_stride, filters_y, - y0_q4, y_step_q4, w, h, bd); -} - -void vp9_highbd_convolve8_avg_vert_c(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h, int bd) { - const InterpKernel *const filters_y = get_filter_base(filter_y); - const int y0_q4 = get_filter_offset(filter_y, filters_y); - (void)filter_x; - (void)x_step_q4; - - highbd_convolve_avg_vert(src, src_stride, dst, dst_stride, filters_y, - y0_q4, y_step_q4, w, h, bd); -} - -void vp9_highbd_convolve8_c(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h, int bd) { - const InterpKernel *const filters_x = get_filter_base(filter_x); - const int x0_q4 = get_filter_offset(filter_x, filters_x); - - const InterpKernel *const filters_y = get_filter_base(filter_y); - const int y0_q4 = get_filter_offset(filter_y, filters_y); - - highbd_convolve(src, src_stride, dst, dst_stride, - filters_x, x0_q4, x_step_q4, - filters_y, y0_q4, y_step_q4, w, h, bd); -} - -void vp9_highbd_convolve8_avg_c(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h, int bd) { - // Fixed size intermediate buffer places limits on parameters. - DECLARE_ALIGNED_ARRAY(16, uint16_t, temp, 64 * 64); - assert(w <= 64); - assert(h <= 64); - - vp9_highbd_convolve8_c(src, src_stride, CONVERT_TO_BYTEPTR(temp), 64, - filter_x, x_step_q4, filter_y, y_step_q4, w, h, bd); - vp9_highbd_convolve_avg_c(CONVERT_TO_BYTEPTR(temp), 64, dst, dst_stride, - NULL, 0, NULL, 0, w, h, bd); -} - -void vp9_highbd_convolve_copy_c(const uint8_t *src8, ptrdiff_t src_stride, - uint8_t *dst8, ptrdiff_t dst_stride, - const int16_t *filter_x, int filter_x_stride, - const int16_t *filter_y, int filter_y_stride, - int w, int h, int bd) { - int r; - uint16_t *src = CONVERT_TO_SHORTPTR(src8); - uint16_t *dst = CONVERT_TO_SHORTPTR(dst8); - (void)filter_x; - (void)filter_y; - (void)filter_x_stride; - (void)filter_y_stride; - (void)bd; - - for (r = h; r > 0; --r) { - vpx_memcpy(dst, src, w * sizeof(uint16_t)); - src += src_stride; - dst += dst_stride; - } -} - -void vp9_highbd_convolve_avg_c(const uint8_t *src8, ptrdiff_t src_stride, - uint8_t *dst8, ptrdiff_t dst_stride, - const int16_t *filter_x, int filter_x_stride, - const int16_t *filter_y, int filter_y_stride, - int w, int h, int bd) { - int x, y; - uint16_t *src = CONVERT_TO_SHORTPTR(src8); - uint16_t *dst = CONVERT_TO_SHORTPTR(dst8); - (void)filter_x; - (void)filter_y; - (void)filter_x_stride; - (void)filter_y_stride; - (void)bd; - - for (y = 0; y < h; ++y) { - for (x = 0; x < w; ++x) { - dst[x] = ROUND_POWER_OF_TWO(dst[x] + src[x], 1); - } - src += src_stride; - dst += dst_stride; - } -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_convolve.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_convolve.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_convolve.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_convolve.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef VP9_COMMON_VP9_CONVOLVE_H_ -#define VP9_COMMON_VP9_CONVOLVE_H_ - -#include "./vpx_config.h" -#include "vpx/vpx_integer.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void (*convolve_fn_t)(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h); - -#if CONFIG_VP9_HIGHBITDEPTH -typedef void (*highbd_convolve_fn_t)(const uint8_t *src, ptrdiff_t src_stride, - uint8_t *dst, ptrdiff_t dst_stride, - const int16_t *filter_x, int x_step_q4, - const int16_t *filter_y, int y_step_q4, - int w, int h, int bd); -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_CONVOLVE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_debugmodes.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_debugmodes.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_debugmodes.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_debugmodes.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "vp9/common/vp9_blockd.h" -#include "vp9/common/vp9_onyxc_int.h" - -static void log_frame_info(VP9_COMMON *cm, const char *str, FILE *f) { - fprintf(f, "%s", str); - fprintf(f, "(Frame %d, Show:%d, Q:%d): \n", cm->current_video_frame, - cm->show_frame, cm->base_qindex); -} -/* This function dereferences a pointer to the mbmi structure - * and uses the passed in member offset to print out the value of an integer - * for each mbmi member value in the mi structure. - */ -static void print_mi_data(VP9_COMMON *cm, FILE *file, const char *descriptor, - size_t member_offset) { - int mi_row, mi_col; - MODE_INFO *mi = cm->mi; - int rows = cm->mi_rows; - int cols = cm->mi_cols; - char prefix = descriptor[0]; - - log_frame_info(cm, descriptor, file); - for (mi_row = 0; mi_row < rows; mi_row++) { - fprintf(file, "%c ", prefix); - for (mi_col = 0; mi_col < cols; mi_col++) { - fprintf(file, "%2d ", - *((int*) ((char *) (&mi->src_mi->mbmi) + - member_offset))); - mi++; - } - fprintf(file, "\n"); - mi += 8; - } - fprintf(file, "\n"); -} - -void vp9_print_modes_and_motion_vectors(VP9_COMMON *cm, const char *file) { - int mi_row; - int mi_col; - FILE *mvs = fopen(file, "a"); - MODE_INFO *mi = cm->mi; - int rows = cm->mi_rows; - int cols = cm->mi_cols; - - print_mi_data(cm, mvs, "Partitions:", offsetof(MB_MODE_INFO, sb_type)); - print_mi_data(cm, mvs, "Modes:", offsetof(MB_MODE_INFO, mode)); - print_mi_data(cm, mvs, "Ref frame:", offsetof(MB_MODE_INFO, ref_frame[0])); - print_mi_data(cm, mvs, "Transform:", offsetof(MB_MODE_INFO, tx_size)); - print_mi_data(cm, mvs, "UV Modes:", offsetof(MB_MODE_INFO, uv_mode)); - - // output skip infomation. - log_frame_info(cm, "Skips:", mvs); - for (mi_row = 0; mi_row < rows; mi_row++) { - fprintf(mvs, "S "); - for (mi_col = 0; mi_col < cols; mi_col++) { - fprintf(mvs, "%2d ", mi->src_mi->mbmi.skip); - mi++; - } - fprintf(mvs, "\n"); - mi += 8; - } - fprintf(mvs, "\n"); - - // output motion vectors. - log_frame_info(cm, "Vectors ", mvs); - mi = cm->mi; - for (mi_row = 0; mi_row < rows; mi_row++) { - fprintf(mvs, "V "); - for (mi_col = 0; mi_col < cols; mi_col++) { - fprintf(mvs, "%4d:%4d ", mi->src_mi->mbmi.mv[0].as_mv.row, - mi->src_mi->mbmi.mv[0].as_mv.col); - mi++; - } - fprintf(mvs, "\n"); - mi += 8; - } - fprintf(mvs, "\n"); - - fclose(mvs); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_entropy.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_entropy.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_entropy.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_entropy.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,811 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vp9/common/vp9_entropy.h" -#include "vp9/common/vp9_blockd.h" -#include "vp9/common/vp9_onyxc_int.h" -#include "vp9/common/vp9_entropymode.h" -#include "vpx_mem/vpx_mem.h" -#include "vpx/vpx_integer.h" - -const vp9_prob vp9_cat1_prob[] = { 159 }; -const vp9_prob vp9_cat2_prob[] = { 165, 145 }; -const vp9_prob vp9_cat3_prob[] = { 173, 148, 140 }; -const vp9_prob vp9_cat4_prob[] = { 176, 155, 140, 135 }; -const vp9_prob vp9_cat5_prob[] = { 180, 157, 141, 134, 130 }; -const vp9_prob vp9_cat6_prob[] = { - 254, 254, 254, 252, 249, 243, 230, 196, 177, 153, 140, 133, 130, 129 -}; -#if CONFIG_VP9_HIGHBITDEPTH -const vp9_prob vp9_cat1_prob_high10[] = { 159 }; -const vp9_prob vp9_cat2_prob_high10[] = { 165, 145 }; -const vp9_prob vp9_cat3_prob_high10[] = { 173, 148, 140 }; -const vp9_prob vp9_cat4_prob_high10[] = { 176, 155, 140, 135 }; -const vp9_prob vp9_cat5_prob_high10[] = { 180, 157, 141, 134, 130 }; -const vp9_prob vp9_cat6_prob_high10[] = { - 255, 255, 254, 254, 254, 252, 249, 243, - 230, 196, 177, 153, 140, 133, 130, 129 -}; -const vp9_prob vp9_cat1_prob_high12[] = { 159 }; -const vp9_prob vp9_cat2_prob_high12[] = { 165, 145 }; -const vp9_prob vp9_cat3_prob_high12[] = { 173, 148, 140 }; -const vp9_prob vp9_cat4_prob_high12[] = { 176, 155, 140, 135 }; -const vp9_prob vp9_cat5_prob_high12[] = { 180, 157, 141, 134, 130 }; -const vp9_prob vp9_cat6_prob_high12[] = { - 255, 255, 255, 255, 254, 254, 254, 252, 249, - 243, 230, 196, 177, 153, 140, 133, 130, 129 -}; -#endif - -const uint8_t vp9_coefband_trans_8x8plus[1024] = { - 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 5, - // beyond MAXBAND_INDEX+1 all values are filled as 5 - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -}; - -const uint8_t vp9_coefband_trans_4x4[16] = { - 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, -}; - -const uint8_t vp9_pt_energy_class[ENTROPY_TOKENS] = { - 0, 1, 2, 3, 3, 4, 4, 5, 5, 5, 5, 5 -}; - -const vp9_tree_index vp9_coefmodel_tree[TREE_SIZE(UNCONSTRAINED_NODES + 1)] = { - -EOB_MODEL_TOKEN, 2, - -ZERO_TOKEN, 4, - -ONE_TOKEN, -TWO_TOKEN, -}; - -// Model obtained from a 2-sided zero-centerd distribuition derived -// from a Pareto distribution. The cdf of the distribution is: -// cdf(x) = 0.5 + 0.5 * sgn(x) * [1 - {alpha/(alpha + |x|)} ^ beta] -// -// For a given beta and a given probablity of the 1-node, the alpha -// is first solved, and then the {alpha, beta} pair is used to generate -// the probabilities for the rest of the nodes. - -// beta = 8 - -// Every odd line in this table can be generated from the even lines -// by averaging : -// vp9_pareto8_full[l][node] = (vp9_pareto8_full[l-1][node] + -// vp9_pareto8_full[l+1][node] ) >> 1; -const vp9_prob vp9_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES] = { - { 3, 86, 128, 6, 86, 23, 88, 29}, - { 6, 86, 128, 11, 87, 42, 91, 52}, - { 9, 86, 129, 17, 88, 61, 94, 76}, - { 12, 86, 129, 22, 88, 77, 97, 93}, - { 15, 87, 129, 28, 89, 93, 100, 110}, - { 17, 87, 129, 33, 90, 105, 103, 123}, - { 20, 88, 130, 38, 91, 118, 106, 136}, - { 23, 88, 130, 43, 91, 128, 108, 146}, - { 26, 89, 131, 48, 92, 139, 111, 156}, - { 28, 89, 131, 53, 93, 147, 114, 163}, - { 31, 90, 131, 58, 94, 156, 117, 171}, - { 34, 90, 131, 62, 94, 163, 119, 177}, - { 37, 90, 132, 66, 95, 171, 122, 184}, - { 39, 90, 132, 70, 96, 177, 124, 189}, - { 42, 91, 132, 75, 97, 183, 127, 194}, - { 44, 91, 132, 79, 97, 188, 129, 198}, - { 47, 92, 133, 83, 98, 193, 132, 202}, - { 49, 92, 133, 86, 99, 197, 134, 205}, - { 52, 93, 133, 90, 100, 201, 137, 208}, - { 54, 93, 133, 94, 100, 204, 139, 211}, - { 57, 94, 134, 98, 101, 208, 142, 214}, - { 59, 94, 134, 101, 102, 211, 144, 216}, - { 62, 94, 135, 105, 103, 214, 146, 218}, - { 64, 94, 135, 108, 103, 216, 148, 220}, - { 66, 95, 135, 111, 104, 219, 151, 222}, - { 68, 95, 135, 114, 105, 221, 153, 223}, - { 71, 96, 136, 117, 106, 224, 155, 225}, - { 73, 96, 136, 120, 106, 225, 157, 226}, - { 76, 97, 136, 123, 107, 227, 159, 228}, - { 78, 97, 136, 126, 108, 229, 160, 229}, - { 80, 98, 137, 129, 109, 231, 162, 231}, - { 82, 98, 137, 131, 109, 232, 164, 232}, - { 84, 98, 138, 134, 110, 234, 166, 233}, - { 86, 98, 138, 137, 111, 235, 168, 234}, - { 89, 99, 138, 140, 112, 236, 170, 235}, - { 91, 99, 138, 142, 112, 237, 171, 235}, - { 93, 100, 139, 145, 113, 238, 173, 236}, - { 95, 100, 139, 147, 114, 239, 174, 237}, - { 97, 101, 140, 149, 115, 240, 176, 238}, - { 99, 101, 140, 151, 115, 241, 177, 238}, - {101, 102, 140, 154, 116, 242, 179, 239}, - {103, 102, 140, 156, 117, 242, 180, 239}, - {105, 103, 141, 158, 118, 243, 182, 240}, - {107, 103, 141, 160, 118, 243, 183, 240}, - {109, 104, 141, 162, 119, 244, 185, 241}, - {111, 104, 141, 164, 119, 244, 186, 241}, - {113, 104, 142, 166, 120, 245, 187, 242}, - {114, 104, 142, 168, 121, 245, 188, 242}, - {116, 105, 143, 170, 122, 246, 190, 243}, - {118, 105, 143, 171, 122, 246, 191, 243}, - {120, 106, 143, 173, 123, 247, 192, 244}, - {121, 106, 143, 175, 124, 247, 193, 244}, - {123, 107, 144, 177, 125, 248, 195, 244}, - {125, 107, 144, 178, 125, 248, 196, 244}, - {127, 108, 145, 180, 126, 249, 197, 245}, - {128, 108, 145, 181, 127, 249, 198, 245}, - {130, 109, 145, 183, 128, 249, 199, 245}, - {132, 109, 145, 184, 128, 249, 200, 245}, - {134, 110, 146, 186, 129, 250, 201, 246}, - {135, 110, 146, 187, 130, 250, 202, 246}, - {137, 111, 147, 189, 131, 251, 203, 246}, - {138, 111, 147, 190, 131, 251, 204, 246}, - {140, 112, 147, 192, 132, 251, 205, 247}, - {141, 112, 147, 193, 132, 251, 206, 247}, - {143, 113, 148, 194, 133, 251, 207, 247}, - {144, 113, 148, 195, 134, 251, 207, 247}, - {146, 114, 149, 197, 135, 252, 208, 248}, - {147, 114, 149, 198, 135, 252, 209, 248}, - {149, 115, 149, 199, 136, 252, 210, 248}, - {150, 115, 149, 200, 137, 252, 210, 248}, - {152, 115, 150, 201, 138, 252, 211, 248}, - {153, 115, 150, 202, 138, 252, 212, 248}, - {155, 116, 151, 204, 139, 253, 213, 249}, - {156, 116, 151, 205, 139, 253, 213, 249}, - {158, 117, 151, 206, 140, 253, 214, 249}, - {159, 117, 151, 207, 141, 253, 215, 249}, - {161, 118, 152, 208, 142, 253, 216, 249}, - {162, 118, 152, 209, 142, 253, 216, 249}, - {163, 119, 153, 210, 143, 253, 217, 249}, - {164, 119, 153, 211, 143, 253, 217, 249}, - {166, 120, 153, 212, 144, 254, 218, 250}, - {167, 120, 153, 212, 145, 254, 219, 250}, - {168, 121, 154, 213, 146, 254, 220, 250}, - {169, 121, 154, 214, 146, 254, 220, 250}, - {171, 122, 155, 215, 147, 254, 221, 250}, - {172, 122, 155, 216, 147, 254, 221, 250}, - {173, 123, 155, 217, 148, 254, 222, 250}, - {174, 123, 155, 217, 149, 254, 222, 250}, - {176, 124, 156, 218, 150, 254, 223, 250}, - {177, 124, 156, 219, 150, 254, 223, 250}, - {178, 125, 157, 220, 151, 254, 224, 251}, - {179, 125, 157, 220, 151, 254, 224, 251}, - {180, 126, 157, 221, 152, 254, 225, 251}, - {181, 126, 157, 221, 152, 254, 225, 251}, - {183, 127, 158, 222, 153, 254, 226, 251}, - {184, 127, 158, 223, 154, 254, 226, 251}, - {185, 128, 159, 224, 155, 255, 227, 251}, - {186, 128, 159, 224, 155, 255, 227, 251}, - {187, 129, 160, 225, 156, 255, 228, 251}, - {188, 130, 160, 225, 156, 255, 228, 251}, - {189, 131, 160, 226, 157, 255, 228, 251}, - {190, 131, 160, 226, 158, 255, 228, 251}, - {191, 132, 161, 227, 159, 255, 229, 251}, - {192, 132, 161, 227, 159, 255, 229, 251}, - {193, 133, 162, 228, 160, 255, 230, 252}, - {194, 133, 162, 229, 160, 255, 230, 252}, - {195, 134, 163, 230, 161, 255, 231, 252}, - {196, 134, 163, 230, 161, 255, 231, 252}, - {197, 135, 163, 231, 162, 255, 231, 252}, - {198, 135, 163, 231, 162, 255, 231, 252}, - {199, 136, 164, 232, 163, 255, 232, 252}, - {200, 136, 164, 232, 164, 255, 232, 252}, - {201, 137, 165, 233, 165, 255, 233, 252}, - {201, 137, 165, 233, 165, 255, 233, 252}, - {202, 138, 166, 233, 166, 255, 233, 252}, - {203, 138, 166, 233, 166, 255, 233, 252}, - {204, 139, 166, 234, 167, 255, 234, 252}, - {205, 139, 166, 234, 167, 255, 234, 252}, - {206, 140, 167, 235, 168, 255, 235, 252}, - {206, 140, 167, 235, 168, 255, 235, 252}, - {207, 141, 168, 236, 169, 255, 235, 252}, - {208, 141, 168, 236, 170, 255, 235, 252}, - {209, 142, 169, 237, 171, 255, 236, 252}, - {209, 143, 169, 237, 171, 255, 236, 252}, - {210, 144, 169, 237, 172, 255, 236, 252}, - {211, 144, 169, 237, 172, 255, 236, 252}, - {212, 145, 170, 238, 173, 255, 237, 252}, - {213, 145, 170, 238, 173, 255, 237, 252}, - {214, 146, 171, 239, 174, 255, 237, 253}, - {214, 146, 171, 239, 174, 255, 237, 253}, - {215, 147, 172, 240, 175, 255, 238, 253}, - {215, 147, 172, 240, 175, 255, 238, 253}, - {216, 148, 173, 240, 176, 255, 238, 253}, - {217, 148, 173, 240, 176, 255, 238, 253}, - {218, 149, 173, 241, 177, 255, 239, 253}, - {218, 149, 173, 241, 178, 255, 239, 253}, - {219, 150, 174, 241, 179, 255, 239, 253}, - {219, 151, 174, 241, 179, 255, 239, 253}, - {220, 152, 175, 242, 180, 255, 240, 253}, - {221, 152, 175, 242, 180, 255, 240, 253}, - {222, 153, 176, 242, 181, 255, 240, 253}, - {222, 153, 176, 242, 181, 255, 240, 253}, - {223, 154, 177, 243, 182, 255, 240, 253}, - {223, 154, 177, 243, 182, 255, 240, 253}, - {224, 155, 178, 244, 183, 255, 241, 253}, - {224, 155, 178, 244, 183, 255, 241, 253}, - {225, 156, 178, 244, 184, 255, 241, 253}, - {225, 157, 178, 244, 184, 255, 241, 253}, - {226, 158, 179, 244, 185, 255, 242, 253}, - {227, 158, 179, 244, 185, 255, 242, 253}, - {228, 159, 180, 245, 186, 255, 242, 253}, - {228, 159, 180, 245, 186, 255, 242, 253}, - {229, 160, 181, 245, 187, 255, 242, 253}, - {229, 160, 181, 245, 187, 255, 242, 253}, - {230, 161, 182, 246, 188, 255, 243, 253}, - {230, 162, 182, 246, 188, 255, 243, 253}, - {231, 163, 183, 246, 189, 255, 243, 253}, - {231, 163, 183, 246, 189, 255, 243, 253}, - {232, 164, 184, 247, 190, 255, 243, 253}, - {232, 164, 184, 247, 190, 255, 243, 253}, - {233, 165, 185, 247, 191, 255, 244, 253}, - {233, 165, 185, 247, 191, 255, 244, 253}, - {234, 166, 185, 247, 192, 255, 244, 253}, - {234, 167, 185, 247, 192, 255, 244, 253}, - {235, 168, 186, 248, 193, 255, 244, 253}, - {235, 168, 186, 248, 193, 255, 244, 253}, - {236, 169, 187, 248, 194, 255, 244, 253}, - {236, 169, 187, 248, 194, 255, 244, 253}, - {236, 170, 188, 248, 195, 255, 245, 253}, - {236, 170, 188, 248, 195, 255, 245, 253}, - {237, 171, 189, 249, 196, 255, 245, 254}, - {237, 172, 189, 249, 196, 255, 245, 254}, - {238, 173, 190, 249, 197, 255, 245, 254}, - {238, 173, 190, 249, 197, 255, 245, 254}, - {239, 174, 191, 249, 198, 255, 245, 254}, - {239, 174, 191, 249, 198, 255, 245, 254}, - {240, 175, 192, 249, 199, 255, 246, 254}, - {240, 176, 192, 249, 199, 255, 246, 254}, - {240, 177, 193, 250, 200, 255, 246, 254}, - {240, 177, 193, 250, 200, 255, 246, 254}, - {241, 178, 194, 250, 201, 255, 246, 254}, - {241, 178, 194, 250, 201, 255, 246, 254}, - {242, 179, 195, 250, 202, 255, 246, 254}, - {242, 180, 195, 250, 202, 255, 246, 254}, - {242, 181, 196, 250, 203, 255, 247, 254}, - {242, 181, 196, 250, 203, 255, 247, 254}, - {243, 182, 197, 251, 204, 255, 247, 254}, - {243, 183, 197, 251, 204, 255, 247, 254}, - {244, 184, 198, 251, 205, 255, 247, 254}, - {244, 184, 198, 251, 205, 255, 247, 254}, - {244, 185, 199, 251, 206, 255, 247, 254}, - {244, 185, 199, 251, 206, 255, 247, 254}, - {245, 186, 200, 251, 207, 255, 247, 254}, - {245, 187, 200, 251, 207, 255, 247, 254}, - {246, 188, 201, 252, 207, 255, 248, 254}, - {246, 188, 201, 252, 207, 255, 248, 254}, - {246, 189, 202, 252, 208, 255, 248, 254}, - {246, 190, 202, 252, 208, 255, 248, 254}, - {247, 191, 203, 252, 209, 255, 248, 254}, - {247, 191, 203, 252, 209, 255, 248, 254}, - {247, 192, 204, 252, 210, 255, 248, 254}, - {247, 193, 204, 252, 210, 255, 248, 254}, - {248, 194, 205, 252, 211, 255, 248, 254}, - {248, 194, 205, 252, 211, 255, 248, 254}, - {248, 195, 206, 252, 212, 255, 249, 254}, - {248, 196, 206, 252, 212, 255, 249, 254}, - {249, 197, 207, 253, 213, 255, 249, 254}, - {249, 197, 207, 253, 213, 255, 249, 254}, - {249, 198, 208, 253, 214, 255, 249, 254}, - {249, 199, 209, 253, 214, 255, 249, 254}, - {250, 200, 210, 253, 215, 255, 249, 254}, - {250, 200, 210, 253, 215, 255, 249, 254}, - {250, 201, 211, 253, 215, 255, 249, 254}, - {250, 202, 211, 253, 215, 255, 249, 254}, - {250, 203, 212, 253, 216, 255, 249, 254}, - {250, 203, 212, 253, 216, 255, 249, 254}, - {251, 204, 213, 253, 217, 255, 250, 254}, - {251, 205, 213, 253, 217, 255, 250, 254}, - {251, 206, 214, 254, 218, 255, 250, 254}, - {251, 206, 215, 254, 218, 255, 250, 254}, - {252, 207, 216, 254, 219, 255, 250, 254}, - {252, 208, 216, 254, 219, 255, 250, 254}, - {252, 209, 217, 254, 220, 255, 250, 254}, - {252, 210, 217, 254, 220, 255, 250, 254}, - {252, 211, 218, 254, 221, 255, 250, 254}, - {252, 212, 218, 254, 221, 255, 250, 254}, - {253, 213, 219, 254, 222, 255, 250, 254}, - {253, 213, 220, 254, 222, 255, 250, 254}, - {253, 214, 221, 254, 223, 255, 250, 254}, - {253, 215, 221, 254, 223, 255, 250, 254}, - {253, 216, 222, 254, 224, 255, 251, 254}, - {253, 217, 223, 254, 224, 255, 251, 254}, - {253, 218, 224, 254, 225, 255, 251, 254}, - {253, 219, 224, 254, 225, 255, 251, 254}, - {254, 220, 225, 254, 225, 255, 251, 254}, - {254, 221, 226, 254, 225, 255, 251, 254}, - {254, 222, 227, 255, 226, 255, 251, 254}, - {254, 223, 227, 255, 226, 255, 251, 254}, - {254, 224, 228, 255, 227, 255, 251, 254}, - {254, 225, 229, 255, 227, 255, 251, 254}, - {254, 226, 230, 255, 228, 255, 251, 254}, - {254, 227, 230, 255, 229, 255, 251, 254}, - {255, 228, 231, 255, 230, 255, 251, 254}, - {255, 229, 232, 255, 230, 255, 251, 254}, - {255, 230, 233, 255, 231, 255, 252, 254}, - {255, 231, 234, 255, 231, 255, 252, 254}, - {255, 232, 235, 255, 232, 255, 252, 254}, - {255, 233, 236, 255, 232, 255, 252, 254}, - {255, 235, 237, 255, 233, 255, 252, 254}, - {255, 236, 238, 255, 234, 255, 252, 254}, - {255, 238, 240, 255, 235, 255, 252, 255}, - {255, 239, 241, 255, 235, 255, 252, 254}, - {255, 241, 243, 255, 236, 255, 252, 254}, - {255, 243, 245, 255, 237, 255, 252, 254}, - {255, 246, 247, 255, 239, 255, 253, 255}, - {255, 246, 247, 255, 239, 255, 253, 255}, -}; - -static const vp9_coeff_probs_model default_coef_probs_4x4[PLANE_TYPES] = { - { // Y plane - { // Intra - { // Band 0 - { 195, 29, 183 }, { 84, 49, 136 }, { 8, 42, 71 } - }, { // Band 1 - { 31, 107, 169 }, { 35, 99, 159 }, { 17, 82, 140 }, - { 8, 66, 114 }, { 2, 44, 76 }, { 1, 19, 32 } - }, { // Band 2 - { 40, 132, 201 }, { 29, 114, 187 }, { 13, 91, 157 }, - { 7, 75, 127 }, { 3, 58, 95 }, { 1, 28, 47 } - }, { // Band 3 - { 69, 142, 221 }, { 42, 122, 201 }, { 15, 91, 159 }, - { 6, 67, 121 }, { 1, 42, 77 }, { 1, 17, 31 } - }, { // Band 4 - { 102, 148, 228 }, { 67, 117, 204 }, { 17, 82, 154 }, - { 6, 59, 114 }, { 2, 39, 75 }, { 1, 15, 29 } - }, { // Band 5 - { 156, 57, 233 }, { 119, 57, 212 }, { 58, 48, 163 }, - { 29, 40, 124 }, { 12, 30, 81 }, { 3, 12, 31 } - } - }, { // Inter - { // Band 0 - { 191, 107, 226 }, { 124, 117, 204 }, { 25, 99, 155 } - }, { // Band 1 - { 29, 148, 210 }, { 37, 126, 194 }, { 8, 93, 157 }, - { 2, 68, 118 }, { 1, 39, 69 }, { 1, 17, 33 } - }, { // Band 2 - { 41, 151, 213 }, { 27, 123, 193 }, { 3, 82, 144 }, - { 1, 58, 105 }, { 1, 32, 60 }, { 1, 13, 26 } - }, { // Band 3 - { 59, 159, 220 }, { 23, 126, 198 }, { 4, 88, 151 }, - { 1, 66, 114 }, { 1, 38, 71 }, { 1, 18, 34 } - }, { // Band 4 - { 114, 136, 232 }, { 51, 114, 207 }, { 11, 83, 155 }, - { 3, 56, 105 }, { 1, 33, 65 }, { 1, 17, 34 } - }, { // Band 5 - { 149, 65, 234 }, { 121, 57, 215 }, { 61, 49, 166 }, - { 28, 36, 114 }, { 12, 25, 76 }, { 3, 16, 42 } - } - } - }, { // UV plane - { // Intra - { // Band 0 - { 214, 49, 220 }, { 132, 63, 188 }, { 42, 65, 137 } - }, { // Band 1 - { 85, 137, 221 }, { 104, 131, 216 }, { 49, 111, 192 }, - { 21, 87, 155 }, { 2, 49, 87 }, { 1, 16, 28 } - }, { // Band 2 - { 89, 163, 230 }, { 90, 137, 220 }, { 29, 100, 183 }, - { 10, 70, 135 }, { 2, 42, 81 }, { 1, 17, 33 } - }, { // Band 3 - { 108, 167, 237 }, { 55, 133, 222 }, { 15, 97, 179 }, - { 4, 72, 135 }, { 1, 45, 85 }, { 1, 19, 38 } - }, { // Band 4 - { 124, 146, 240 }, { 66, 124, 224 }, { 17, 88, 175 }, - { 4, 58, 122 }, { 1, 36, 75 }, { 1, 18, 37 } - }, { // Band 5 - { 141, 79, 241 }, { 126, 70, 227 }, { 66, 58, 182 }, - { 30, 44, 136 }, { 12, 34, 96 }, { 2, 20, 47 } - } - }, { // Inter - { // Band 0 - { 229, 99, 249 }, { 143, 111, 235 }, { 46, 109, 192 } - }, { // Band 1 - { 82, 158, 236 }, { 94, 146, 224 }, { 25, 117, 191 }, - { 9, 87, 149 }, { 3, 56, 99 }, { 1, 33, 57 } - }, { // Band 2 - { 83, 167, 237 }, { 68, 145, 222 }, { 10, 103, 177 }, - { 2, 72, 131 }, { 1, 41, 79 }, { 1, 20, 39 } - }, { // Band 3 - { 99, 167, 239 }, { 47, 141, 224 }, { 10, 104, 178 }, - { 2, 73, 133 }, { 1, 44, 85 }, { 1, 22, 47 } - }, { // Band 4 - { 127, 145, 243 }, { 71, 129, 228 }, { 17, 93, 177 }, - { 3, 61, 124 }, { 1, 41, 84 }, { 1, 21, 52 } - }, { // Band 5 - { 157, 78, 244 }, { 140, 72, 231 }, { 69, 58, 184 }, - { 31, 44, 137 }, { 14, 38, 105 }, { 8, 23, 61 } - } - } - } -}; - -static const vp9_coeff_probs_model default_coef_probs_8x8[PLANE_TYPES] = { - { // Y plane - { // Intra - { // Band 0 - { 125, 34, 187 }, { 52, 41, 133 }, { 6, 31, 56 } - }, { // Band 1 - { 37, 109, 153 }, { 51, 102, 147 }, { 23, 87, 128 }, - { 8, 67, 101 }, { 1, 41, 63 }, { 1, 19, 29 } - }, { // Band 2 - { 31, 154, 185 }, { 17, 127, 175 }, { 6, 96, 145 }, - { 2, 73, 114 }, { 1, 51, 82 }, { 1, 28, 45 } - }, { // Band 3 - { 23, 163, 200 }, { 10, 131, 185 }, { 2, 93, 148 }, - { 1, 67, 111 }, { 1, 41, 69 }, { 1, 14, 24 } - }, { // Band 4 - { 29, 176, 217 }, { 12, 145, 201 }, { 3, 101, 156 }, - { 1, 69, 111 }, { 1, 39, 63 }, { 1, 14, 23 } - }, { // Band 5 - { 57, 192, 233 }, { 25, 154, 215 }, { 6, 109, 167 }, - { 3, 78, 118 }, { 1, 48, 69 }, { 1, 21, 29 } - } - }, { // Inter - { // Band 0 - { 202, 105, 245 }, { 108, 106, 216 }, { 18, 90, 144 } - }, { // Band 1 - { 33, 172, 219 }, { 64, 149, 206 }, { 14, 117, 177 }, - { 5, 90, 141 }, { 2, 61, 95 }, { 1, 37, 57 } - }, { // Band 2 - { 33, 179, 220 }, { 11, 140, 198 }, { 1, 89, 148 }, - { 1, 60, 104 }, { 1, 33, 57 }, { 1, 12, 21 } - }, { // Band 3 - { 30, 181, 221 }, { 8, 141, 198 }, { 1, 87, 145 }, - { 1, 58, 100 }, { 1, 31, 55 }, { 1, 12, 20 } - }, { // Band 4 - { 32, 186, 224 }, { 7, 142, 198 }, { 1, 86, 143 }, - { 1, 58, 100 }, { 1, 31, 55 }, { 1, 12, 22 } - }, { // Band 5 - { 57, 192, 227 }, { 20, 143, 204 }, { 3, 96, 154 }, - { 1, 68, 112 }, { 1, 42, 69 }, { 1, 19, 32 } - } - } - }, { // UV plane - { // Intra - { // Band 0 - { 212, 35, 215 }, { 113, 47, 169 }, { 29, 48, 105 } - }, { // Band 1 - { 74, 129, 203 }, { 106, 120, 203 }, { 49, 107, 178 }, - { 19, 84, 144 }, { 4, 50, 84 }, { 1, 15, 25 } - }, { // Band 2 - { 71, 172, 217 }, { 44, 141, 209 }, { 15, 102, 173 }, - { 6, 76, 133 }, { 2, 51, 89 }, { 1, 24, 42 } - }, { // Band 3 - { 64, 185, 231 }, { 31, 148, 216 }, { 8, 103, 175 }, - { 3, 74, 131 }, { 1, 46, 81 }, { 1, 18, 30 } - }, { // Band 4 - { 65, 196, 235 }, { 25, 157, 221 }, { 5, 105, 174 }, - { 1, 67, 120 }, { 1, 38, 69 }, { 1, 15, 30 } - }, { // Band 5 - { 65, 204, 238 }, { 30, 156, 224 }, { 7, 107, 177 }, - { 2, 70, 124 }, { 1, 42, 73 }, { 1, 18, 34 } - } - }, { // Inter - { // Band 0 - { 225, 86, 251 }, { 144, 104, 235 }, { 42, 99, 181 } - }, { // Band 1 - { 85, 175, 239 }, { 112, 165, 229 }, { 29, 136, 200 }, - { 12, 103, 162 }, { 6, 77, 123 }, { 2, 53, 84 } - }, { // Band 2 - { 75, 183, 239 }, { 30, 155, 221 }, { 3, 106, 171 }, - { 1, 74, 128 }, { 1, 44, 76 }, { 1, 17, 28 } - }, { // Band 3 - { 73, 185, 240 }, { 27, 159, 222 }, { 2, 107, 172 }, - { 1, 75, 127 }, { 1, 42, 73 }, { 1, 17, 29 } - }, { // Band 4 - { 62, 190, 238 }, { 21, 159, 222 }, { 2, 107, 172 }, - { 1, 72, 122 }, { 1, 40, 71 }, { 1, 18, 32 } - }, { // Band 5 - { 61, 199, 240 }, { 27, 161, 226 }, { 4, 113, 180 }, - { 1, 76, 129 }, { 1, 46, 80 }, { 1, 23, 41 } - } - } - } -}; - -static const vp9_coeff_probs_model default_coef_probs_16x16[PLANE_TYPES] = { - { // Y plane - { // Intra - { // Band 0 - { 7, 27, 153 }, { 5, 30, 95 }, { 1, 16, 30 } - }, { // Band 1 - { 50, 75, 127 }, { 57, 75, 124 }, { 27, 67, 108 }, - { 10, 54, 86 }, { 1, 33, 52 }, { 1, 12, 18 } - }, { // Band 2 - { 43, 125, 151 }, { 26, 108, 148 }, { 7, 83, 122 }, - { 2, 59, 89 }, { 1, 38, 60 }, { 1, 17, 27 } - }, { // Band 3 - { 23, 144, 163 }, { 13, 112, 154 }, { 2, 75, 117 }, - { 1, 50, 81 }, { 1, 31, 51 }, { 1, 14, 23 } - }, { // Band 4 - { 18, 162, 185 }, { 6, 123, 171 }, { 1, 78, 125 }, - { 1, 51, 86 }, { 1, 31, 54 }, { 1, 14, 23 } - }, { // Band 5 - { 15, 199, 227 }, { 3, 150, 204 }, { 1, 91, 146 }, - { 1, 55, 95 }, { 1, 30, 53 }, { 1, 11, 20 } - } - }, { // Inter - { // Band 0 - { 19, 55, 240 }, { 19, 59, 196 }, { 3, 52, 105 } - }, { // Band 1 - { 41, 166, 207 }, { 104, 153, 199 }, { 31, 123, 181 }, - { 14, 101, 152 }, { 5, 72, 106 }, { 1, 36, 52 } - }, { // Band 2 - { 35, 176, 211 }, { 12, 131, 190 }, { 2, 88, 144 }, - { 1, 60, 101 }, { 1, 36, 60 }, { 1, 16, 28 } - }, { // Band 3 - { 28, 183, 213 }, { 8, 134, 191 }, { 1, 86, 142 }, - { 1, 56, 96 }, { 1, 30, 53 }, { 1, 12, 20 } - }, { // Band 4 - { 20, 190, 215 }, { 4, 135, 192 }, { 1, 84, 139 }, - { 1, 53, 91 }, { 1, 28, 49 }, { 1, 11, 20 } - }, { // Band 5 - { 13, 196, 216 }, { 2, 137, 192 }, { 1, 86, 143 }, - { 1, 57, 99 }, { 1, 32, 56 }, { 1, 13, 24 } - } - } - }, { // UV plane - { // Intra - { // Band 0 - { 211, 29, 217 }, { 96, 47, 156 }, { 22, 43, 87 } - }, { // Band 1 - { 78, 120, 193 }, { 111, 116, 186 }, { 46, 102, 164 }, - { 15, 80, 128 }, { 2, 49, 76 }, { 1, 18, 28 } - }, { // Band 2 - { 71, 161, 203 }, { 42, 132, 192 }, { 10, 98, 150 }, - { 3, 69, 109 }, { 1, 44, 70 }, { 1, 18, 29 } - }, { // Band 3 - { 57, 186, 211 }, { 30, 140, 196 }, { 4, 93, 146 }, - { 1, 62, 102 }, { 1, 38, 65 }, { 1, 16, 27 } - }, { // Band 4 - { 47, 199, 217 }, { 14, 145, 196 }, { 1, 88, 142 }, - { 1, 57, 98 }, { 1, 36, 62 }, { 1, 15, 26 } - }, { // Band 5 - { 26, 219, 229 }, { 5, 155, 207 }, { 1, 94, 151 }, - { 1, 60, 104 }, { 1, 36, 62 }, { 1, 16, 28 } - } - }, { // Inter - { // Band 0 - { 233, 29, 248 }, { 146, 47, 220 }, { 43, 52, 140 } - }, { // Band 1 - { 100, 163, 232 }, { 179, 161, 222 }, { 63, 142, 204 }, - { 37, 113, 174 }, { 26, 89, 137 }, { 18, 68, 97 } - }, { // Band 2 - { 85, 181, 230 }, { 32, 146, 209 }, { 7, 100, 164 }, - { 3, 71, 121 }, { 1, 45, 77 }, { 1, 18, 30 } - }, { // Band 3 - { 65, 187, 230 }, { 20, 148, 207 }, { 2, 97, 159 }, - { 1, 68, 116 }, { 1, 40, 70 }, { 1, 14, 29 } - }, { // Band 4 - { 40, 194, 227 }, { 8, 147, 204 }, { 1, 94, 155 }, - { 1, 65, 112 }, { 1, 39, 66 }, { 1, 14, 26 } - }, { // Band 5 - { 16, 208, 228 }, { 3, 151, 207 }, { 1, 98, 160 }, - { 1, 67, 117 }, { 1, 41, 74 }, { 1, 17, 31 } - } - } - } -}; - -static const vp9_coeff_probs_model default_coef_probs_32x32[PLANE_TYPES] = { - { // Y plane - { // Intra - { // Band 0 - { 17, 38, 140 }, { 7, 34, 80 }, { 1, 17, 29 } - }, { // Band 1 - { 37, 75, 128 }, { 41, 76, 128 }, { 26, 66, 116 }, - { 12, 52, 94 }, { 2, 32, 55 }, { 1, 10, 16 } - }, { // Band 2 - { 50, 127, 154 }, { 37, 109, 152 }, { 16, 82, 121 }, - { 5, 59, 85 }, { 1, 35, 54 }, { 1, 13, 20 } - }, { // Band 3 - { 40, 142, 167 }, { 17, 110, 157 }, { 2, 71, 112 }, - { 1, 44, 72 }, { 1, 27, 45 }, { 1, 11, 17 } - }, { // Band 4 - { 30, 175, 188 }, { 9, 124, 169 }, { 1, 74, 116 }, - { 1, 48, 78 }, { 1, 30, 49 }, { 1, 11, 18 } - }, { // Band 5 - { 10, 222, 223 }, { 2, 150, 194 }, { 1, 83, 128 }, - { 1, 48, 79 }, { 1, 27, 45 }, { 1, 11, 17 } - } - }, { // Inter - { // Band 0 - { 36, 41, 235 }, { 29, 36, 193 }, { 10, 27, 111 } - }, { // Band 1 - { 85, 165, 222 }, { 177, 162, 215 }, { 110, 135, 195 }, - { 57, 113, 168 }, { 23, 83, 120 }, { 10, 49, 61 } - }, { // Band 2 - { 85, 190, 223 }, { 36, 139, 200 }, { 5, 90, 146 }, - { 1, 60, 103 }, { 1, 38, 65 }, { 1, 18, 30 } - }, { // Band 3 - { 72, 202, 223 }, { 23, 141, 199 }, { 2, 86, 140 }, - { 1, 56, 97 }, { 1, 36, 61 }, { 1, 16, 27 } - }, { // Band 4 - { 55, 218, 225 }, { 13, 145, 200 }, { 1, 86, 141 }, - { 1, 57, 99 }, { 1, 35, 61 }, { 1, 13, 22 } - }, { // Band 5 - { 15, 235, 212 }, { 1, 132, 184 }, { 1, 84, 139 }, - { 1, 57, 97 }, { 1, 34, 56 }, { 1, 14, 23 } - } - } - }, { // UV plane - { // Intra - { // Band 0 - { 181, 21, 201 }, { 61, 37, 123 }, { 10, 38, 71 } - }, { // Band 1 - { 47, 106, 172 }, { 95, 104, 173 }, { 42, 93, 159 }, - { 18, 77, 131 }, { 4, 50, 81 }, { 1, 17, 23 } - }, { // Band 2 - { 62, 147, 199 }, { 44, 130, 189 }, { 28, 102, 154 }, - { 18, 75, 115 }, { 2, 44, 65 }, { 1, 12, 19 } - }, { // Band 3 - { 55, 153, 210 }, { 24, 130, 194 }, { 3, 93, 146 }, - { 1, 61, 97 }, { 1, 31, 50 }, { 1, 10, 16 } - }, { // Band 4 - { 49, 186, 223 }, { 17, 148, 204 }, { 1, 96, 142 }, - { 1, 53, 83 }, { 1, 26, 44 }, { 1, 11, 17 } - }, { // Band 5 - { 13, 217, 212 }, { 2, 136, 180 }, { 1, 78, 124 }, - { 1, 50, 83 }, { 1, 29, 49 }, { 1, 14, 23 } - } - }, { // Inter - { // Band 0 - { 197, 13, 247 }, { 82, 17, 222 }, { 25, 17, 162 } - }, { // Band 1 - { 126, 186, 247 }, { 234, 191, 243 }, { 176, 177, 234 }, - { 104, 158, 220 }, { 66, 128, 186 }, { 55, 90, 137 } - }, { // Band 2 - { 111, 197, 242 }, { 46, 158, 219 }, { 9, 104, 171 }, - { 2, 65, 125 }, { 1, 44, 80 }, { 1, 17, 91 } - }, { // Band 3 - { 104, 208, 245 }, { 39, 168, 224 }, { 3, 109, 162 }, - { 1, 79, 124 }, { 1, 50, 102 }, { 1, 43, 102 } - }, { // Band 4 - { 84, 220, 246 }, { 31, 177, 231 }, { 2, 115, 180 }, - { 1, 79, 134 }, { 1, 55, 77 }, { 1, 60, 79 } - }, { // Band 5 - { 43, 243, 240 }, { 8, 180, 217 }, { 1, 115, 166 }, - { 1, 84, 121 }, { 1, 51, 67 }, { 1, 16, 6 } - } - } - } -}; - -static void extend_to_full_distribution(vp9_prob *probs, vp9_prob p) { - vpx_memcpy(probs, vp9_pareto8_full[p = 0 ? 0 : p - 1], - MODEL_NODES * sizeof(vp9_prob)); -} - -void vp9_model_to_full_probs(const vp9_prob *model, vp9_prob *full) { - if (full != model) - vpx_memcpy(full, model, sizeof(vp9_prob) * UNCONSTRAINED_NODES); - extend_to_full_distribution(&full[UNCONSTRAINED_NODES], model[PIVOT_NODE]); -} - -void vp9_default_coef_probs(VP9_COMMON *cm) { - vp9_copy(cm->fc->coef_probs[TX_4X4], default_coef_probs_4x4); - vp9_copy(cm->fc->coef_probs[TX_8X8], default_coef_probs_8x8); - vp9_copy(cm->fc->coef_probs[TX_16X16], default_coef_probs_16x16); - vp9_copy(cm->fc->coef_probs[TX_32X32], default_coef_probs_32x32); -} - -#define COEF_COUNT_SAT 24 -#define COEF_MAX_UPDATE_FACTOR 112 -#define COEF_COUNT_SAT_KEY 24 -#define COEF_MAX_UPDATE_FACTOR_KEY 112 -#define COEF_COUNT_SAT_AFTER_KEY 24 -#define COEF_MAX_UPDATE_FACTOR_AFTER_KEY 128 - -static void adapt_coef_probs(VP9_COMMON *cm, TX_SIZE tx_size, - unsigned int count_sat, - unsigned int update_factor) { - const FRAME_CONTEXT *pre_fc = &cm->frame_contexts[cm->frame_context_idx]; - vp9_coeff_probs_model *const probs = cm->fc->coef_probs[tx_size]; - const vp9_coeff_probs_model *const pre_probs = pre_fc->coef_probs[tx_size]; - vp9_coeff_count_model *counts = cm->counts.coef[tx_size]; - unsigned int (*eob_counts)[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS] = - cm->counts.eob_branch[tx_size]; - int i, j, k, l, m; - - for (i = 0; i < PLANE_TYPES; ++i) - for (j = 0; j < REF_TYPES; ++j) - for (k = 0; k < COEF_BANDS; ++k) - for (l = 0; l < BAND_COEFF_CONTEXTS(k); ++l) { - const int n0 = counts[i][j][k][l][ZERO_TOKEN]; - const int n1 = counts[i][j][k][l][ONE_TOKEN]; - const int n2 = counts[i][j][k][l][TWO_TOKEN]; - const int neob = counts[i][j][k][l][EOB_MODEL_TOKEN]; - const unsigned int branch_ct[UNCONSTRAINED_NODES][2] = { - { neob, eob_counts[i][j][k][l] - neob }, - { n0, n1 + n2 }, - { n1, n2 } - }; - for (m = 0; m < UNCONSTRAINED_NODES; ++m) - probs[i][j][k][l][m] = merge_probs(pre_probs[i][j][k][l][m], - branch_ct[m], - count_sat, update_factor); - } -} - -void vp9_adapt_coef_probs(VP9_COMMON *cm) { - TX_SIZE t; - unsigned int count_sat, update_factor; - - if (frame_is_intra_only(cm)) { - update_factor = COEF_MAX_UPDATE_FACTOR_KEY; - count_sat = COEF_COUNT_SAT_KEY; - } else if (cm->last_frame_type == KEY_FRAME) { - update_factor = COEF_MAX_UPDATE_FACTOR_AFTER_KEY; /* adapt quickly */ - count_sat = COEF_COUNT_SAT_AFTER_KEY; - } else { - update_factor = COEF_MAX_UPDATE_FACTOR; - count_sat = COEF_COUNT_SAT; - } - for (t = TX_4X4; t <= TX_32X32; t++) - adapt_coef_probs(cm, t, count_sat, update_factor); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_entropy.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_entropy.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_entropy.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_entropy.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,232 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_ENTROPY_H_ -#define VP9_COMMON_VP9_ENTROPY_H_ - -#include "vpx/vpx_integer.h" - -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_prob.h" -#include "vp9/common/vp9_scan.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define DIFF_UPDATE_PROB 252 - -// Coefficient token alphabet -#define ZERO_TOKEN 0 // 0 Extra Bits 0+0 -#define ONE_TOKEN 1 // 1 Extra Bits 0+1 -#define TWO_TOKEN 2 // 2 Extra Bits 0+1 -#define THREE_TOKEN 3 // 3 Extra Bits 0+1 -#define FOUR_TOKEN 4 // 4 Extra Bits 0+1 -#define CATEGORY1_TOKEN 5 // 5-6 Extra Bits 1+1 -#define CATEGORY2_TOKEN 6 // 7-10 Extra Bits 2+1 -#define CATEGORY3_TOKEN 7 // 11-18 Extra Bits 3+1 -#define CATEGORY4_TOKEN 8 // 19-34 Extra Bits 4+1 -#define CATEGORY5_TOKEN 9 // 35-66 Extra Bits 5+1 -#define CATEGORY6_TOKEN 10 // 67+ Extra Bits 14+1 -#define EOB_TOKEN 11 // EOB Extra Bits 0+0 - -#define ENTROPY_TOKENS 12 - -#define ENTROPY_NODES 11 - -DECLARE_ALIGNED(16, extern const uint8_t, vp9_pt_energy_class[ENTROPY_TOKENS]); - -#define CAT1_MIN_VAL 5 -#define CAT2_MIN_VAL 7 -#define CAT3_MIN_VAL 11 -#define CAT4_MIN_VAL 19 -#define CAT5_MIN_VAL 35 -#define CAT6_MIN_VAL 67 - -// Extra bit probabilities. -DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat1_prob[1]); -DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat2_prob[2]); -DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat3_prob[3]); -DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat4_prob[4]); -DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat5_prob[5]); -DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat6_prob[14]); - -#if CONFIG_VP9_HIGHBITDEPTH -DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat1_prob_high10[1]); -DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat2_prob_high10[2]); -DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat3_prob_high10[3]); -DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat4_prob_high10[4]); -DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat5_prob_high10[5]); -DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat6_prob_high10[16]); -DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat1_prob_high12[1]); -DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat2_prob_high12[2]); -DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat3_prob_high12[3]); -DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat4_prob_high12[4]); -DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat5_prob_high12[5]); -DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat6_prob_high12[18]); -#endif // CONFIG_VP9_HIGHBITDEPTH - -#define EOB_MODEL_TOKEN 3 -extern const vp9_tree_index vp9_coefmodel_tree[]; - -typedef struct { - const vp9_tree_index *tree; - const vp9_prob *prob; - int len; - int base_val; - const int16_t *cost; -} vp9_extra_bit; - -// indexed by token value -extern const vp9_extra_bit vp9_extra_bits[ENTROPY_TOKENS]; -#if CONFIG_VP9_HIGHBITDEPTH -extern const vp9_extra_bit vp9_extra_bits_high10[ENTROPY_TOKENS]; -extern const vp9_extra_bit vp9_extra_bits_high12[ENTROPY_TOKENS]; -#endif // CONFIG_VP9_HIGHBITDEPTH - -#define DCT_MAX_VALUE 16384 -#if CONFIG_VP9_HIGHBITDEPTH -#define DCT_MAX_VALUE_HIGH10 65536 -#define DCT_MAX_VALUE_HIGH12 262144 -#endif // CONFIG_VP9_HIGHBITDEPTH - -/* Coefficients are predicted via a 3-dimensional probability table. */ - -#define REF_TYPES 2 // intra=0, inter=1 - -/* Middle dimension reflects the coefficient position within the transform. */ -#define COEF_BANDS 6 - -/* Inside dimension is measure of nearby complexity, that reflects the energy - of nearby coefficients are nonzero. For the first coefficient (DC, unless - block type is 0), we look at the (already encoded) blocks above and to the - left of the current block. The context index is then the number (0,1,or 2) - of these blocks having nonzero coefficients. - After decoding a coefficient, the measure is determined by the size of the - most recently decoded coefficient. - Note that the intuitive meaning of this measure changes as coefficients - are decoded, e.g., prior to the first token, a zero means that my neighbors - are empty while, after the first token, because of the use of end-of-block, - a zero means we just decoded a zero and hence guarantees that a non-zero - coefficient will appear later in this block. However, this shift - in meaning is perfectly OK because our context depends also on the - coefficient band (and since zigzag positions 0, 1, and 2 are in - distinct bands). */ - -#define COEFF_CONTEXTS 6 -#define BAND_COEFF_CONTEXTS(band) ((band) == 0 ? 3 : COEFF_CONTEXTS) - -// #define ENTROPY_STATS - -typedef unsigned int vp9_coeff_count[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS] - [ENTROPY_TOKENS]; -typedef unsigned int vp9_coeff_stats[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS] - [ENTROPY_NODES][2]; - -#define SUBEXP_PARAM 4 /* Subexponential code parameter */ -#define MODULUS_PARAM 13 /* Modulus parameter */ - -struct VP9Common; -void vp9_default_coef_probs(struct VP9Common *cm); -void vp9_adapt_coef_probs(struct VP9Common *cm); - -static INLINE void reset_skip_context(MACROBLOCKD *xd, BLOCK_SIZE bsize) { - int i; - for (i = 0; i < MAX_MB_PLANE; i++) { - struct macroblockd_plane *const pd = &xd->plane[i]; - const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd); - vpx_memset(pd->above_context, 0, sizeof(ENTROPY_CONTEXT) * - num_4x4_blocks_wide_lookup[plane_bsize]); - vpx_memset(pd->left_context, 0, sizeof(ENTROPY_CONTEXT) * - num_4x4_blocks_high_lookup[plane_bsize]); - } -} - -// This is the index in the scan order beyond which all coefficients for -// 8x8 transform and above are in the top band. -// This macro is currently unused but may be used by certain implementations -#define MAXBAND_INDEX 21 - -DECLARE_ALIGNED(16, extern const uint8_t, vp9_coefband_trans_8x8plus[1024]); -DECLARE_ALIGNED(16, extern const uint8_t, vp9_coefband_trans_4x4[16]); - -static INLINE const uint8_t *get_band_translate(TX_SIZE tx_size) { - return tx_size == TX_4X4 ? vp9_coefband_trans_4x4 - : vp9_coefband_trans_8x8plus; -} - -// 128 lists of probabilities are stored for the following ONE node probs: -// 1, 3, 5, 7, ..., 253, 255 -// In between probabilities are interpolated linearly - -#define COEFF_PROB_MODELS 256 - -#define UNCONSTRAINED_NODES 3 - -#define PIVOT_NODE 2 // which node is pivot - -#define MODEL_NODES (ENTROPY_NODES - UNCONSTRAINED_NODES) -extern const vp9_prob vp9_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES]; - -typedef vp9_prob vp9_coeff_probs_model[REF_TYPES][COEF_BANDS] - [COEFF_CONTEXTS][UNCONSTRAINED_NODES]; - -typedef unsigned int vp9_coeff_count_model[REF_TYPES][COEF_BANDS] - [COEFF_CONTEXTS] - [UNCONSTRAINED_NODES + 1]; - -void vp9_model_to_full_probs(const vp9_prob *model, vp9_prob *full); - -static INLINE int get_entropy_context(TX_SIZE tx_size, const ENTROPY_CONTEXT *a, - const ENTROPY_CONTEXT *l) { - ENTROPY_CONTEXT above_ec = 0, left_ec = 0; - - switch (tx_size) { - case TX_4X4: - above_ec = a[0] != 0; - left_ec = l[0] != 0; - break; - case TX_8X8: - above_ec = !!*(const uint16_t *)a; - left_ec = !!*(const uint16_t *)l; - break; - case TX_16X16: - above_ec = !!*(const uint32_t *)a; - left_ec = !!*(const uint32_t *)l; - break; - case TX_32X32: - above_ec = !!*(const uint64_t *)a; - left_ec = !!*(const uint64_t *)l; - break; - default: - assert(0 && "Invalid transform size."); - break; - } - - return combine_entropy_contexts(above_ec, left_ec); -} - -static INLINE const scan_order *get_scan(const MACROBLOCKD *xd, TX_SIZE tx_size, - PLANE_TYPE type, int block_idx) { - const MODE_INFO *const mi = xd->mi[0].src_mi; - - if (is_inter_block(&mi->mbmi) || type != PLANE_TYPE_Y || xd->lossless) { - return &vp9_default_scan_orders[tx_size]; - } else { - const PREDICTION_MODE mode = get_y_mode(mi, block_idx); - return &vp9_scan_orders[tx_size][intra_mode_to_tx_type_lookup[mode]]; - } -} - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_ENTROPY_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_entropymode.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_entropymode.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_entropymode.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_entropymode.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,469 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vpx_mem/vpx_mem.h" - -#include "vp9/common/vp9_onyxc_int.h" -#include "vp9/common/vp9_seg_common.h" - -const vp9_prob vp9_kf_y_mode_prob[INTRA_MODES][INTRA_MODES][INTRA_MODES - 1] = { - { // above = dc - { 137, 30, 42, 148, 151, 207, 70, 52, 91 }, // left = dc - { 92, 45, 102, 136, 116, 180, 74, 90, 100 }, // left = v - { 73, 32, 19, 187, 222, 215, 46, 34, 100 }, // left = h - { 91, 30, 32, 116, 121, 186, 93, 86, 94 }, // left = d45 - { 72, 35, 36, 149, 68, 206, 68, 63, 105 }, // left = d135 - { 73, 31, 28, 138, 57, 124, 55, 122, 151 }, // left = d117 - { 67, 23, 21, 140, 126, 197, 40, 37, 171 }, // left = d153 - { 86, 27, 28, 128, 154, 212, 45, 43, 53 }, // left = d207 - { 74, 32, 27, 107, 86, 160, 63, 134, 102 }, // left = d63 - { 59, 67, 44, 140, 161, 202, 78, 67, 119 } // left = tm - }, { // above = v - { 63, 36, 126, 146, 123, 158, 60, 90, 96 }, // left = dc - { 43, 46, 168, 134, 107, 128, 69, 142, 92 }, // left = v - { 44, 29, 68, 159, 201, 177, 50, 57, 77 }, // left = h - { 58, 38, 76, 114, 97, 172, 78, 133, 92 }, // left = d45 - { 46, 41, 76, 140, 63, 184, 69, 112, 57 }, // left = d135 - { 38, 32, 85, 140, 46, 112, 54, 151, 133 }, // left = d117 - { 39, 27, 61, 131, 110, 175, 44, 75, 136 }, // left = d153 - { 52, 30, 74, 113, 130, 175, 51, 64, 58 }, // left = d207 - { 47, 35, 80, 100, 74, 143, 64, 163, 74 }, // left = d63 - { 36, 61, 116, 114, 128, 162, 80, 125, 82 } // left = tm - }, { // above = h - { 82, 26, 26, 171, 208, 204, 44, 32, 105 }, // left = dc - { 55, 44, 68, 166, 179, 192, 57, 57, 108 }, // left = v - { 42, 26, 11, 199, 241, 228, 23, 15, 85 }, // left = h - { 68, 42, 19, 131, 160, 199, 55, 52, 83 }, // left = d45 - { 58, 50, 25, 139, 115, 232, 39, 52, 118 }, // left = d135 - { 50, 35, 33, 153, 104, 162, 64, 59, 131 }, // left = d117 - { 44, 24, 16, 150, 177, 202, 33, 19, 156 }, // left = d153 - { 55, 27, 12, 153, 203, 218, 26, 27, 49 }, // left = d207 - { 53, 49, 21, 110, 116, 168, 59, 80, 76 }, // left = d63 - { 38, 72, 19, 168, 203, 212, 50, 50, 107 } // left = tm - }, { // above = d45 - { 103, 26, 36, 129, 132, 201, 83, 80, 93 }, // left = dc - { 59, 38, 83, 112, 103, 162, 98, 136, 90 }, // left = v - { 62, 30, 23, 158, 200, 207, 59, 57, 50 }, // left = h - { 67, 30, 29, 84, 86, 191, 102, 91, 59 }, // left = d45 - { 60, 32, 33, 112, 71, 220, 64, 89, 104 }, // left = d135 - { 53, 26, 34, 130, 56, 149, 84, 120, 103 }, // left = d117 - { 53, 21, 23, 133, 109, 210, 56, 77, 172 }, // left = d153 - { 77, 19, 29, 112, 142, 228, 55, 66, 36 }, // left = d207 - { 61, 29, 29, 93, 97, 165, 83, 175, 162 }, // left = d63 - { 47, 47, 43, 114, 137, 181, 100, 99, 95 } // left = tm - }, { // above = d135 - { 69, 23, 29, 128, 83, 199, 46, 44, 101 }, // left = dc - { 53, 40, 55, 139, 69, 183, 61, 80, 110 }, // left = v - { 40, 29, 19, 161, 180, 207, 43, 24, 91 }, // left = h - { 60, 34, 19, 105, 61, 198, 53, 64, 89 }, // left = d45 - { 52, 31, 22, 158, 40, 209, 58, 62, 89 }, // left = d135 - { 44, 31, 29, 147, 46, 158, 56, 102, 198 }, // left = d117 - { 35, 19, 12, 135, 87, 209, 41, 45, 167 }, // left = d153 - { 55, 25, 21, 118, 95, 215, 38, 39, 66 }, // left = d207 - { 51, 38, 25, 113, 58, 164, 70, 93, 97 }, // left = d63 - { 47, 54, 34, 146, 108, 203, 72, 103, 151 } // left = tm - }, { // above = d117 - { 64, 19, 37, 156, 66, 138, 49, 95, 133 }, // left = dc - { 46, 27, 80, 150, 55, 124, 55, 121, 135 }, // left = v - { 36, 23, 27, 165, 149, 166, 54, 64, 118 }, // left = h - { 53, 21, 36, 131, 63, 163, 60, 109, 81 }, // left = d45 - { 40, 26, 35, 154, 40, 185, 51, 97, 123 }, // left = d135 - { 35, 19, 34, 179, 19, 97, 48, 129, 124 }, // left = d117 - { 36, 20, 26, 136, 62, 164, 33, 77, 154 }, // left = d153 - { 45, 18, 32, 130, 90, 157, 40, 79, 91 }, // left = d207 - { 45, 26, 28, 129, 45, 129, 49, 147, 123 }, // left = d63 - { 38, 44, 51, 136, 74, 162, 57, 97, 121 } // left = tm - }, { // above = d153 - { 75, 17, 22, 136, 138, 185, 32, 34, 166 }, // left = dc - { 56, 39, 58, 133, 117, 173, 48, 53, 187 }, // left = v - { 35, 21, 12, 161, 212, 207, 20, 23, 145 }, // left = h - { 56, 29, 19, 117, 109, 181, 55, 68, 112 }, // left = d45 - { 47, 29, 17, 153, 64, 220, 59, 51, 114 }, // left = d135 - { 46, 16, 24, 136, 76, 147, 41, 64, 172 }, // left = d117 - { 34, 17, 11, 108, 152, 187, 13, 15, 209 }, // left = d153 - { 51, 24, 14, 115, 133, 209, 32, 26, 104 }, // left = d207 - { 55, 30, 18, 122, 79, 179, 44, 88, 116 }, // left = d63 - { 37, 49, 25, 129, 168, 164, 41, 54, 148 } // left = tm - }, { // above = d207 - { 82, 22, 32, 127, 143, 213, 39, 41, 70 }, // left = dc - { 62, 44, 61, 123, 105, 189, 48, 57, 64 }, // left = v - { 47, 25, 17, 175, 222, 220, 24, 30, 86 }, // left = h - { 68, 36, 17, 106, 102, 206, 59, 74, 74 }, // left = d45 - { 57, 39, 23, 151, 68, 216, 55, 63, 58 }, // left = d135 - { 49, 30, 35, 141, 70, 168, 82, 40, 115 }, // left = d117 - { 51, 25, 15, 136, 129, 202, 38, 35, 139 }, // left = d153 - { 68, 26, 16, 111, 141, 215, 29, 28, 28 }, // left = d207 - { 59, 39, 19, 114, 75, 180, 77, 104, 42 }, // left = d63 - { 40, 61, 26, 126, 152, 206, 61, 59, 93 } // left = tm - }, { // above = d63 - { 78, 23, 39, 111, 117, 170, 74, 124, 94 }, // left = dc - { 48, 34, 86, 101, 92, 146, 78, 179, 134 }, // left = v - { 47, 22, 24, 138, 187, 178, 68, 69, 59 }, // left = h - { 56, 25, 33, 105, 112, 187, 95, 177, 129 }, // left = d45 - { 48, 31, 27, 114, 63, 183, 82, 116, 56 }, // left = d135 - { 43, 28, 37, 121, 63, 123, 61, 192, 169 }, // left = d117 - { 42, 17, 24, 109, 97, 177, 56, 76, 122 }, // left = d153 - { 58, 18, 28, 105, 139, 182, 70, 92, 63 }, // left = d207 - { 46, 23, 32, 74, 86, 150, 67, 183, 88 }, // left = d63 - { 36, 38, 48, 92, 122, 165, 88, 137, 91 } // left = tm - }, { // above = tm - { 65, 70, 60, 155, 159, 199, 61, 60, 81 }, // left = dc - { 44, 78, 115, 132, 119, 173, 71, 112, 93 }, // left = v - { 39, 38, 21, 184, 227, 206, 42, 32, 64 }, // left = h - { 58, 47, 36, 124, 137, 193, 80, 82, 78 }, // left = d45 - { 49, 50, 35, 144, 95, 205, 63, 78, 59 }, // left = d135 - { 41, 53, 52, 148, 71, 142, 65, 128, 51 }, // left = d117 - { 40, 36, 28, 143, 143, 202, 40, 55, 137 }, // left = d153 - { 52, 34, 29, 129, 183, 227, 42, 35, 43 }, // left = d207 - { 42, 44, 44, 104, 105, 164, 64, 130, 80 }, // left = d63 - { 43, 81, 53, 140, 169, 204, 68, 84, 72 } // left = tm - } -}; - -const vp9_prob vp9_kf_uv_mode_prob[INTRA_MODES][INTRA_MODES - 1] = { - { 144, 11, 54, 157, 195, 130, 46, 58, 108 }, // y = dc - { 118, 15, 123, 148, 131, 101, 44, 93, 131 }, // y = v - { 113, 12, 23, 188, 226, 142, 26, 32, 125 }, // y = h - { 120, 11, 50, 123, 163, 135, 64, 77, 103 }, // y = d45 - { 113, 9, 36, 155, 111, 157, 32, 44, 161 }, // y = d135 - { 116, 9, 55, 176, 76, 96, 37, 61, 149 }, // y = d117 - { 115, 9, 28, 141, 161, 167, 21, 25, 193 }, // y = d153 - { 120, 12, 32, 145, 195, 142, 32, 38, 86 }, // y = d207 - { 116, 12, 64, 120, 140, 125, 49, 115, 121 }, // y = d63 - { 102, 19, 66, 162, 182, 122, 35, 59, 128 } // y = tm -}; - -static const vp9_prob default_if_y_probs[BLOCK_SIZE_GROUPS][INTRA_MODES - 1] = { - { 65, 32, 18, 144, 162, 194, 41, 51, 98 }, // block_size < 8x8 - { 132, 68, 18, 165, 217, 196, 45, 40, 78 }, // block_size < 16x16 - { 173, 80, 19, 176, 240, 193, 64, 35, 46 }, // block_size < 32x32 - { 221, 135, 38, 194, 248, 121, 96, 85, 29 } // block_size >= 32x32 -}; - -static const vp9_prob default_if_uv_probs[INTRA_MODES][INTRA_MODES - 1] = { - { 120, 7, 76, 176, 208, 126, 28, 54, 103 }, // y = dc - { 48, 12, 154, 155, 139, 90, 34, 117, 119 }, // y = v - { 67, 6, 25, 204, 243, 158, 13, 21, 96 }, // y = h - { 97, 5, 44, 131, 176, 139, 48, 68, 97 }, // y = d45 - { 83, 5, 42, 156, 111, 152, 26, 49, 152 }, // y = d135 - { 80, 5, 58, 178, 74, 83, 33, 62, 145 }, // y = d117 - { 86, 5, 32, 154, 192, 168, 14, 22, 163 }, // y = d153 - { 85, 5, 32, 156, 216, 148, 19, 29, 73 }, // y = d207 - { 77, 7, 64, 116, 132, 122, 37, 126, 120 }, // y = d63 - { 101, 21, 107, 181, 192, 103, 19, 67, 125 } // y = tm -}; - -const vp9_prob vp9_kf_partition_probs[PARTITION_CONTEXTS] - [PARTITION_TYPES - 1] = { - // 8x8 -> 4x4 - { 158, 97, 94 }, // a/l both not split - { 93, 24, 99 }, // a split, l not split - { 85, 119, 44 }, // l split, a not split - { 62, 59, 67 }, // a/l both split - // 16x16 -> 8x8 - { 149, 53, 53 }, // a/l both not split - { 94, 20, 48 }, // a split, l not split - { 83, 53, 24 }, // l split, a not split - { 52, 18, 18 }, // a/l both split - // 32x32 -> 16x16 - { 150, 40, 39 }, // a/l both not split - { 78, 12, 26 }, // a split, l not split - { 67, 33, 11 }, // l split, a not split - { 24, 7, 5 }, // a/l both split - // 64x64 -> 32x32 - { 174, 35, 49 }, // a/l both not split - { 68, 11, 27 }, // a split, l not split - { 57, 15, 9 }, // l split, a not split - { 12, 3, 3 }, // a/l both split -}; - -static const vp9_prob default_partition_probs[PARTITION_CONTEXTS] - [PARTITION_TYPES - 1] = { - // 8x8 -> 4x4 - { 199, 122, 141 }, // a/l both not split - { 147, 63, 159 }, // a split, l not split - { 148, 133, 118 }, // l split, a not split - { 121, 104, 114 }, // a/l both split - // 16x16 -> 8x8 - { 174, 73, 87 }, // a/l both not split - { 92, 41, 83 }, // a split, l not split - { 82, 99, 50 }, // l split, a not split - { 53, 39, 39 }, // a/l both split - // 32x32 -> 16x16 - { 177, 58, 59 }, // a/l both not split - { 68, 26, 63 }, // a split, l not split - { 52, 79, 25 }, // l split, a not split - { 17, 14, 12 }, // a/l both split - // 64x64 -> 32x32 - { 222, 34, 30 }, // a/l both not split - { 72, 16, 44 }, // a split, l not split - { 58, 32, 12 }, // l split, a not split - { 10, 7, 6 }, // a/l both split -}; - -static const vp9_prob default_inter_mode_probs[INTER_MODE_CONTEXTS] - [INTER_MODES - 1] = { - {2, 173, 34}, // 0 = both zero mv - {7, 145, 85}, // 1 = one zero mv + one a predicted mv - {7, 166, 63}, // 2 = two predicted mvs - {7, 94, 66}, // 3 = one predicted/zero and one new mv - {8, 64, 46}, // 4 = two new mvs - {17, 81, 31}, // 5 = one intra neighbour + x - {25, 29, 30}, // 6 = two intra neighbours -}; - -/* Array indices are identical to previously-existing INTRAMODECONTEXTNODES. */ -const vp9_tree_index vp9_intra_mode_tree[TREE_SIZE(INTRA_MODES)] = { - -DC_PRED, 2, /* 0 = DC_NODE */ - -TM_PRED, 4, /* 1 = TM_NODE */ - -V_PRED, 6, /* 2 = V_NODE */ - 8, 12, /* 3 = COM_NODE */ - -H_PRED, 10, /* 4 = H_NODE */ - -D135_PRED, -D117_PRED, /* 5 = D135_NODE */ - -D45_PRED, 14, /* 6 = D45_NODE */ - -D63_PRED, 16, /* 7 = D63_NODE */ - -D153_PRED, -D207_PRED /* 8 = D153_NODE */ -}; - -const vp9_tree_index vp9_inter_mode_tree[TREE_SIZE(INTER_MODES)] = { - -INTER_OFFSET(ZEROMV), 2, - -INTER_OFFSET(NEARESTMV), 4, - -INTER_OFFSET(NEARMV), -INTER_OFFSET(NEWMV) -}; - -const vp9_tree_index vp9_partition_tree[TREE_SIZE(PARTITION_TYPES)] = { - -PARTITION_NONE, 2, - -PARTITION_HORZ, 4, - -PARTITION_VERT, -PARTITION_SPLIT -}; - -static const vp9_prob default_intra_inter_p[INTRA_INTER_CONTEXTS] = { - 9, 102, 187, 225 -}; - -static const vp9_prob default_comp_inter_p[COMP_INTER_CONTEXTS] = { - 239, 183, 119, 96, 41 -}; - -static const vp9_prob default_comp_ref_p[REF_CONTEXTS] = { - 50, 126, 123, 221, 226 -}; - -static const vp9_prob default_single_ref_p[REF_CONTEXTS][2] = { - { 33, 16 }, - { 77, 74 }, - { 142, 142 }, - { 172, 170 }, - { 238, 247 } -}; - -static const struct tx_probs default_tx_probs = { - { { 3, 136, 37 }, - { 5, 52, 13 } }, - - { { 20, 152 }, - { 15, 101 } }, - - { { 100 }, - { 66 } } -}; - -void tx_counts_to_branch_counts_32x32(const unsigned int *tx_count_32x32p, - unsigned int (*ct_32x32p)[2]) { - ct_32x32p[0][0] = tx_count_32x32p[TX_4X4]; - ct_32x32p[0][1] = tx_count_32x32p[TX_8X8] + - tx_count_32x32p[TX_16X16] + - tx_count_32x32p[TX_32X32]; - ct_32x32p[1][0] = tx_count_32x32p[TX_8X8]; - ct_32x32p[1][1] = tx_count_32x32p[TX_16X16] + - tx_count_32x32p[TX_32X32]; - ct_32x32p[2][0] = tx_count_32x32p[TX_16X16]; - ct_32x32p[2][1] = tx_count_32x32p[TX_32X32]; -} - -void tx_counts_to_branch_counts_16x16(const unsigned int *tx_count_16x16p, - unsigned int (*ct_16x16p)[2]) { - ct_16x16p[0][0] = tx_count_16x16p[TX_4X4]; - ct_16x16p[0][1] = tx_count_16x16p[TX_8X8] + tx_count_16x16p[TX_16X16]; - ct_16x16p[1][0] = tx_count_16x16p[TX_8X8]; - ct_16x16p[1][1] = tx_count_16x16p[TX_16X16]; -} - -void tx_counts_to_branch_counts_8x8(const unsigned int *tx_count_8x8p, - unsigned int (*ct_8x8p)[2]) { - ct_8x8p[0][0] = tx_count_8x8p[TX_4X4]; - ct_8x8p[0][1] = tx_count_8x8p[TX_8X8]; -} - -static const vp9_prob default_skip_probs[SKIP_CONTEXTS] = { - 192, 128, 64 -}; - -static const vp9_prob default_switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS] - [SWITCHABLE_FILTERS - 1] = { - { 235, 162, }, - { 36, 255, }, - { 34, 3, }, - { 149, 144, }, -}; - -void vp9_init_mode_probs(FRAME_CONTEXT *fc) { - vp9_copy(fc->uv_mode_prob, default_if_uv_probs); - vp9_copy(fc->y_mode_prob, default_if_y_probs); - vp9_copy(fc->switchable_interp_prob, default_switchable_interp_prob); - vp9_copy(fc->partition_prob, default_partition_probs); - vp9_copy(fc->intra_inter_prob, default_intra_inter_p); - vp9_copy(fc->comp_inter_prob, default_comp_inter_p); - vp9_copy(fc->comp_ref_prob, default_comp_ref_p); - vp9_copy(fc->single_ref_prob, default_single_ref_p); - fc->tx_probs = default_tx_probs; - vp9_copy(fc->skip_probs, default_skip_probs); - vp9_copy(fc->inter_mode_probs, default_inter_mode_probs); -} - -const vp9_tree_index vp9_switchable_interp_tree - [TREE_SIZE(SWITCHABLE_FILTERS)] = { - -EIGHTTAP, 2, - -EIGHTTAP_SMOOTH, -EIGHTTAP_SHARP -}; - -void vp9_adapt_mode_probs(VP9_COMMON *cm) { - int i, j; - FRAME_CONTEXT *fc = cm->fc; - const FRAME_CONTEXT *pre_fc = &cm->frame_contexts[cm->frame_context_idx]; - const FRAME_COUNTS *counts = &cm->counts; - - for (i = 0; i < INTRA_INTER_CONTEXTS; i++) - fc->intra_inter_prob[i] = mode_mv_merge_probs(pre_fc->intra_inter_prob[i], - counts->intra_inter[i]); - for (i = 0; i < COMP_INTER_CONTEXTS; i++) - fc->comp_inter_prob[i] = mode_mv_merge_probs(pre_fc->comp_inter_prob[i], - counts->comp_inter[i]); - for (i = 0; i < REF_CONTEXTS; i++) - fc->comp_ref_prob[i] = mode_mv_merge_probs(pre_fc->comp_ref_prob[i], - counts->comp_ref[i]); - for (i = 0; i < REF_CONTEXTS; i++) - for (j = 0; j < 2; j++) - fc->single_ref_prob[i][j] = mode_mv_merge_probs( - pre_fc->single_ref_prob[i][j], counts->single_ref[i][j]); - - for (i = 0; i < INTER_MODE_CONTEXTS; i++) - vp9_tree_merge_probs(vp9_inter_mode_tree, pre_fc->inter_mode_probs[i], - counts->inter_mode[i], fc->inter_mode_probs[i]); - - for (i = 0; i < BLOCK_SIZE_GROUPS; i++) - vp9_tree_merge_probs(vp9_intra_mode_tree, pre_fc->y_mode_prob[i], - counts->y_mode[i], fc->y_mode_prob[i]); - - for (i = 0; i < INTRA_MODES; ++i) - vp9_tree_merge_probs(vp9_intra_mode_tree, pre_fc->uv_mode_prob[i], - counts->uv_mode[i], fc->uv_mode_prob[i]); - - for (i = 0; i < PARTITION_CONTEXTS; i++) - vp9_tree_merge_probs(vp9_partition_tree, pre_fc->partition_prob[i], - counts->partition[i], fc->partition_prob[i]); - - if (cm->interp_filter == SWITCHABLE) { - for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) - vp9_tree_merge_probs(vp9_switchable_interp_tree, - pre_fc->switchable_interp_prob[i], - counts->switchable_interp[i], - fc->switchable_interp_prob[i]); - } - - if (cm->tx_mode == TX_MODE_SELECT) { - int j; - unsigned int branch_ct_8x8p[TX_SIZES - 3][2]; - unsigned int branch_ct_16x16p[TX_SIZES - 2][2]; - unsigned int branch_ct_32x32p[TX_SIZES - 1][2]; - - for (i = 0; i < TX_SIZE_CONTEXTS; ++i) { - tx_counts_to_branch_counts_8x8(counts->tx.p8x8[i], branch_ct_8x8p); - for (j = 0; j < TX_SIZES - 3; ++j) - fc->tx_probs.p8x8[i][j] = mode_mv_merge_probs( - pre_fc->tx_probs.p8x8[i][j], branch_ct_8x8p[j]); - - tx_counts_to_branch_counts_16x16(counts->tx.p16x16[i], branch_ct_16x16p); - for (j = 0; j < TX_SIZES - 2; ++j) - fc->tx_probs.p16x16[i][j] = mode_mv_merge_probs( - pre_fc->tx_probs.p16x16[i][j], branch_ct_16x16p[j]); - - tx_counts_to_branch_counts_32x32(counts->tx.p32x32[i], branch_ct_32x32p); - for (j = 0; j < TX_SIZES - 1; ++j) - fc->tx_probs.p32x32[i][j] = mode_mv_merge_probs( - pre_fc->tx_probs.p32x32[i][j], branch_ct_32x32p[j]); - } - } - - for (i = 0; i < SKIP_CONTEXTS; ++i) - fc->skip_probs[i] = mode_mv_merge_probs( - pre_fc->skip_probs[i], counts->skip[i]); -} - -static void set_default_lf_deltas(struct loopfilter *lf) { - lf->mode_ref_delta_enabled = 1; - lf->mode_ref_delta_update = 1; - - lf->ref_deltas[INTRA_FRAME] = 1; - lf->ref_deltas[LAST_FRAME] = 0; - lf->ref_deltas[GOLDEN_FRAME] = -1; - lf->ref_deltas[ALTREF_FRAME] = -1; - - lf->mode_deltas[0] = 0; - lf->mode_deltas[1] = 0; -} - -void vp9_setup_past_independence(VP9_COMMON *cm) { - // Reset the segment feature data to the default stats: - // Features disabled, 0, with delta coding (Default state). - struct loopfilter *const lf = &cm->lf; - - int i; - vp9_clearall_segfeatures(&cm->seg); - cm->seg.abs_delta = SEGMENT_DELTADATA; - - if (cm->last_frame_seg_map && !cm->frame_parallel_decode) - vpx_memset(cm->last_frame_seg_map, 0, (cm->mi_rows * cm->mi_cols)); - - if (cm->current_frame_seg_map) - vpx_memset(cm->current_frame_seg_map, 0, (cm->mi_rows * cm->mi_cols)); - - // Reset the mode ref deltas for loop filter - vp9_zero(lf->last_ref_deltas); - vp9_zero(lf->last_mode_deltas); - set_default_lf_deltas(lf); - - // To force update of the sharpness - lf->last_sharpness_level = -1; - - vp9_default_coef_probs(cm); - vp9_init_mode_probs(cm->fc); - vp9_init_mv_probs(cm); - cm->fc->initialized = 1; - - if (cm->frame_type == KEY_FRAME || - cm->error_resilient_mode || cm->reset_frame_context == 3) { - // Reset all frame contexts. - for (i = 0; i < FRAME_CONTEXTS; ++i) - cm->frame_contexts[i] = *cm->fc; - } else if (cm->reset_frame_context == 2) { - // Reset only the frame context specified in the frame header. - cm->frame_contexts[cm->frame_context_idx] = *cm->fc; - } - - // prev_mip will only be allocated in encoder. - if (frame_is_intra_only(cm) && cm->prev_mip && !cm->frame_parallel_decode) - vpx_memset(cm->prev_mip, 0, cm->mi_stride * (cm->mi_rows + 1) * - sizeof(*cm->prev_mip)); - - vp9_zero(cm->ref_frame_sign_bias); - - cm->frame_context_idx = 0; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_entropymode.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_entropymode.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_entropymode.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_entropymode.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_ENTROPYMODE_H_ -#define VP9_COMMON_VP9_ENTROPYMODE_H_ - -#include "vp9/common/vp9_blockd.h" -#include "vp9/common/vp9_entropy.h" -#include "vp9/common/vp9_entropymv.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define TX_SIZE_CONTEXTS 2 - -struct VP9Common; - -struct tx_probs { - vp9_prob p32x32[TX_SIZE_CONTEXTS][TX_SIZES - 1]; - vp9_prob p16x16[TX_SIZE_CONTEXTS][TX_SIZES - 2]; - vp9_prob p8x8[TX_SIZE_CONTEXTS][TX_SIZES - 3]; -}; - -struct tx_counts { - unsigned int p32x32[TX_SIZE_CONTEXTS][TX_SIZES]; - unsigned int p16x16[TX_SIZE_CONTEXTS][TX_SIZES - 1]; - unsigned int p8x8[TX_SIZE_CONTEXTS][TX_SIZES - 2]; - unsigned int tx_totals[TX_SIZES]; -}; - -typedef struct frame_contexts { - vp9_prob y_mode_prob[BLOCK_SIZE_GROUPS][INTRA_MODES - 1]; - vp9_prob uv_mode_prob[INTRA_MODES][INTRA_MODES - 1]; - vp9_prob partition_prob[PARTITION_CONTEXTS][PARTITION_TYPES - 1]; - vp9_coeff_probs_model coef_probs[TX_SIZES][PLANE_TYPES]; - vp9_prob switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS] - [SWITCHABLE_FILTERS - 1]; - vp9_prob inter_mode_probs[INTER_MODE_CONTEXTS][INTER_MODES - 1]; - vp9_prob intra_inter_prob[INTRA_INTER_CONTEXTS]; - vp9_prob comp_inter_prob[COMP_INTER_CONTEXTS]; - vp9_prob single_ref_prob[REF_CONTEXTS][2]; - vp9_prob comp_ref_prob[REF_CONTEXTS]; - struct tx_probs tx_probs; - vp9_prob skip_probs[SKIP_CONTEXTS]; - nmv_context nmvc; - int initialized; -} FRAME_CONTEXT; - -typedef struct FRAME_COUNTS { - unsigned int y_mode[BLOCK_SIZE_GROUPS][INTRA_MODES]; - unsigned int uv_mode[INTRA_MODES][INTRA_MODES]; - unsigned int partition[PARTITION_CONTEXTS][PARTITION_TYPES]; - vp9_coeff_count_model coef[TX_SIZES][PLANE_TYPES]; - unsigned int eob_branch[TX_SIZES][PLANE_TYPES][REF_TYPES] - [COEF_BANDS][COEFF_CONTEXTS]; - unsigned int switchable_interp[SWITCHABLE_FILTER_CONTEXTS] - [SWITCHABLE_FILTERS]; - unsigned int inter_mode[INTER_MODE_CONTEXTS][INTER_MODES]; - unsigned int intra_inter[INTRA_INTER_CONTEXTS][2]; - unsigned int comp_inter[COMP_INTER_CONTEXTS][2]; - unsigned int single_ref[REF_CONTEXTS][2][2]; - unsigned int comp_ref[REF_CONTEXTS][2]; - struct tx_counts tx; - unsigned int skip[SKIP_CONTEXTS][2]; - nmv_context_counts mv; -} FRAME_COUNTS; - -extern const vp9_prob vp9_kf_uv_mode_prob[INTRA_MODES][INTRA_MODES - 1]; -extern const vp9_prob vp9_kf_y_mode_prob[INTRA_MODES][INTRA_MODES] - [INTRA_MODES - 1]; -extern const vp9_prob vp9_kf_partition_probs[PARTITION_CONTEXTS] - [PARTITION_TYPES - 1]; -extern const vp9_tree_index vp9_intra_mode_tree[TREE_SIZE(INTRA_MODES)]; -extern const vp9_tree_index vp9_inter_mode_tree[TREE_SIZE(INTER_MODES)]; -extern const vp9_tree_index vp9_partition_tree[TREE_SIZE(PARTITION_TYPES)]; -extern const vp9_tree_index vp9_switchable_interp_tree - [TREE_SIZE(SWITCHABLE_FILTERS)]; - -void vp9_setup_past_independence(struct VP9Common *cm); - -void vp9_init_mode_probs(FRAME_CONTEXT *fc); - -void vp9_adapt_mode_probs(struct VP9Common *cm); - -void tx_counts_to_branch_counts_32x32(const unsigned int *tx_count_32x32p, - unsigned int (*ct_32x32p)[2]); -void tx_counts_to_branch_counts_16x16(const unsigned int *tx_count_16x16p, - unsigned int (*ct_16x16p)[2]); -void tx_counts_to_branch_counts_8x8(const unsigned int *tx_count_8x8p, - unsigned int (*ct_8x8p)[2]); - -static INLINE const vp9_prob *get_y_mode_probs(const MODE_INFO *mi, - const MODE_INFO *above_mi, - const MODE_INFO *left_mi, - int block) { - const PREDICTION_MODE above = vp9_above_block_mode(mi, above_mi, block); - const PREDICTION_MODE left = vp9_left_block_mode(mi, left_mi, block); - return vp9_kf_y_mode_prob[above][left]; -} - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_ENTROPYMODE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_entropymv.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_entropymv.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_entropymv.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_entropymv.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,222 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vp9/common/vp9_onyxc_int.h" -#include "vp9/common/vp9_entropymv.h" - -// Integer pel reference mv threshold for use of high-precision 1/8 mv -#define COMPANDED_MVREF_THRESH 8 - -const vp9_tree_index vp9_mv_joint_tree[TREE_SIZE(MV_JOINTS)] = { - -MV_JOINT_ZERO, 2, - -MV_JOINT_HNZVZ, 4, - -MV_JOINT_HZVNZ, -MV_JOINT_HNZVNZ -}; - -const vp9_tree_index vp9_mv_class_tree[TREE_SIZE(MV_CLASSES)] = { - -MV_CLASS_0, 2, - -MV_CLASS_1, 4, - 6, 8, - -MV_CLASS_2, -MV_CLASS_3, - 10, 12, - -MV_CLASS_4, -MV_CLASS_5, - -MV_CLASS_6, 14, - 16, 18, - -MV_CLASS_7, -MV_CLASS_8, - -MV_CLASS_9, -MV_CLASS_10, -}; - -const vp9_tree_index vp9_mv_class0_tree[TREE_SIZE(CLASS0_SIZE)] = { - -0, -1, -}; - -const vp9_tree_index vp9_mv_fp_tree[TREE_SIZE(MV_FP_SIZE)] = { - -0, 2, - -1, 4, - -2, -3 -}; - -static const nmv_context default_nmv_context = { - {32, 64, 96}, - { - { // Vertical component - 128, // sign - {224, 144, 192, 168, 192, 176, 192, 198, 198, 245}, // class - {216}, // class0 - {136, 140, 148, 160, 176, 192, 224, 234, 234, 240}, // bits - {{128, 128, 64}, {96, 112, 64}}, // class0_fp - {64, 96, 64}, // fp - 160, // class0_hp bit - 128, // hp - }, - { // Horizontal component - 128, // sign - {216, 128, 176, 160, 176, 176, 192, 198, 198, 208}, // class - {208}, // class0 - {136, 140, 148, 160, 176, 192, 224, 234, 234, 240}, // bits - {{128, 128, 64}, {96, 112, 64}}, // class0_fp - {64, 96, 64}, // fp - 160, // class0_hp bit - 128, // hp - } - }, -}; - -static const uint8_t log_in_base_2[] = { - 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 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, - 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 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, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10 -}; - -static INLINE int mv_class_base(MV_CLASS_TYPE c) { - return c ? CLASS0_SIZE << (c + 2) : 0; -} - -MV_CLASS_TYPE vp9_get_mv_class(int z, int *offset) { - const MV_CLASS_TYPE c = (z >= CLASS0_SIZE * 4096) ? - MV_CLASS_10 : (MV_CLASS_TYPE)log_in_base_2[z >> 3]; - if (offset) - *offset = z - mv_class_base(c); - return c; -} - -int vp9_use_mv_hp(const MV *ref) { - return (abs(ref->row) >> 3) < COMPANDED_MVREF_THRESH && - (abs(ref->col) >> 3) < COMPANDED_MVREF_THRESH; -} - -int vp9_get_mv_mag(MV_CLASS_TYPE c, int offset) { - return mv_class_base(c) + offset; -} - -static void inc_mv_component(int v, nmv_component_counts *comp_counts, - int incr, int usehp) { - int s, z, c, o, d, e, f; - assert(v != 0); /* should not be zero */ - s = v < 0; - comp_counts->sign[s] += incr; - z = (s ? -v : v) - 1; /* magnitude - 1 */ - - c = vp9_get_mv_class(z, &o); - comp_counts->classes[c] += incr; - - d = (o >> 3); /* int mv data */ - f = (o >> 1) & 3; /* fractional pel mv data */ - e = (o & 1); /* high precision mv data */ - - if (c == MV_CLASS_0) { - comp_counts->class0[d] += incr; - comp_counts->class0_fp[d][f] += incr; - comp_counts->class0_hp[e] += usehp * incr; - } else { - int i; - int b = c + CLASS0_BITS - 1; // number of bits - for (i = 0; i < b; ++i) - comp_counts->bits[i][((d >> i) & 1)] += incr; - comp_counts->fp[f] += incr; - comp_counts->hp[e] += usehp * incr; - } -} - -void vp9_inc_mv(const MV *mv, nmv_context_counts *counts) { - if (counts != NULL) { - const MV_JOINT_TYPE j = vp9_get_mv_joint(mv); - ++counts->joints[j]; - - if (mv_joint_vertical(j)) { - inc_mv_component(mv->row, &counts->comps[0], 1, 1); - } - - if (mv_joint_horizontal(j)) { - inc_mv_component(mv->col, &counts->comps[1], 1, 1); - } - } -} - -void vp9_adapt_mv_probs(VP9_COMMON *cm, int allow_hp) { - int i, j; - - nmv_context *fc = &cm->fc->nmvc; - const nmv_context *pre_fc = &cm->frame_contexts[cm->frame_context_idx].nmvc; - const nmv_context_counts *counts = &cm->counts.mv; - - vp9_tree_merge_probs(vp9_mv_joint_tree, pre_fc->joints, counts->joints, - fc->joints); - - for (i = 0; i < 2; ++i) { - nmv_component *comp = &fc->comps[i]; - const nmv_component *pre_comp = &pre_fc->comps[i]; - const nmv_component_counts *c = &counts->comps[i]; - - comp->sign = mode_mv_merge_probs(pre_comp->sign, c->sign); - vp9_tree_merge_probs(vp9_mv_class_tree, pre_comp->classes, c->classes, - comp->classes); - vp9_tree_merge_probs(vp9_mv_class0_tree, pre_comp->class0, c->class0, - comp->class0); - - for (j = 0; j < MV_OFFSET_BITS; ++j) - comp->bits[j] = mode_mv_merge_probs(pre_comp->bits[j], c->bits[j]); - - for (j = 0; j < CLASS0_SIZE; ++j) - vp9_tree_merge_probs(vp9_mv_fp_tree, pre_comp->class0_fp[j], - c->class0_fp[j], comp->class0_fp[j]); - - vp9_tree_merge_probs(vp9_mv_fp_tree, pre_comp->fp, c->fp, comp->fp); - - if (allow_hp) { - comp->class0_hp = mode_mv_merge_probs(pre_comp->class0_hp, c->class0_hp); - comp->hp = mode_mv_merge_probs(pre_comp->hp, c->hp); - } - } -} - -void vp9_init_mv_probs(VP9_COMMON *cm) { - cm->fc->nmvc = default_nmv_context; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_entropymv.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_entropymv.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_entropymv.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_entropymv.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP9_COMMON_VP9_ENTROPYMV_H_ -#define VP9_COMMON_VP9_ENTROPYMV_H_ - -#include "./vpx_config.h" - -#include "vp9/common/vp9_mv.h" -#include "vp9/common/vp9_prob.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct VP9Common; - -void vp9_init_mv_probs(struct VP9Common *cm); - -void vp9_adapt_mv_probs(struct VP9Common *cm, int usehp); -int vp9_use_mv_hp(const MV *ref); - -#define MV_UPDATE_PROB 252 - -/* Symbols for coding which components are zero jointly */ -#define MV_JOINTS 4 -typedef enum { - MV_JOINT_ZERO = 0, /* Zero vector */ - MV_JOINT_HNZVZ = 1, /* Vert zero, hor nonzero */ - MV_JOINT_HZVNZ = 2, /* Hor zero, vert nonzero */ - MV_JOINT_HNZVNZ = 3, /* Both components nonzero */ -} MV_JOINT_TYPE; - -static INLINE int mv_joint_vertical(MV_JOINT_TYPE type) { - return type == MV_JOINT_HZVNZ || type == MV_JOINT_HNZVNZ; -} - -static INLINE int mv_joint_horizontal(MV_JOINT_TYPE type) { - return type == MV_JOINT_HNZVZ || type == MV_JOINT_HNZVNZ; -} - -/* Symbols for coding magnitude class of nonzero components */ -#define MV_CLASSES 11 -typedef enum { - MV_CLASS_0 = 0, /* (0, 2] integer pel */ - MV_CLASS_1 = 1, /* (2, 4] integer pel */ - MV_CLASS_2 = 2, /* (4, 8] integer pel */ - MV_CLASS_3 = 3, /* (8, 16] integer pel */ - MV_CLASS_4 = 4, /* (16, 32] integer pel */ - MV_CLASS_5 = 5, /* (32, 64] integer pel */ - MV_CLASS_6 = 6, /* (64, 128] integer pel */ - MV_CLASS_7 = 7, /* (128, 256] integer pel */ - MV_CLASS_8 = 8, /* (256, 512] integer pel */ - MV_CLASS_9 = 9, /* (512, 1024] integer pel */ - MV_CLASS_10 = 10, /* (1024,2048] integer pel */ -} MV_CLASS_TYPE; - -#define CLASS0_BITS 1 /* bits at integer precision for class 0 */ -#define CLASS0_SIZE (1 << CLASS0_BITS) -#define MV_OFFSET_BITS (MV_CLASSES + CLASS0_BITS - 2) -#define MV_FP_SIZE 4 - -#define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2) -#define MV_MAX ((1 << MV_MAX_BITS) - 1) -#define MV_VALS ((MV_MAX << 1) + 1) - -#define MV_IN_USE_BITS 14 -#define MV_UPP ((1 << MV_IN_USE_BITS) - 1) -#define MV_LOW (-(1 << MV_IN_USE_BITS)) - -extern const vp9_tree_index vp9_mv_joint_tree[]; -extern const vp9_tree_index vp9_mv_class_tree[]; -extern const vp9_tree_index vp9_mv_class0_tree[]; -extern const vp9_tree_index vp9_mv_fp_tree[]; - -typedef struct { - vp9_prob sign; - vp9_prob classes[MV_CLASSES - 1]; - vp9_prob class0[CLASS0_SIZE - 1]; - vp9_prob bits[MV_OFFSET_BITS]; - vp9_prob class0_fp[CLASS0_SIZE][MV_FP_SIZE - 1]; - vp9_prob fp[MV_FP_SIZE - 1]; - vp9_prob class0_hp; - vp9_prob hp; -} nmv_component; - -typedef struct { - vp9_prob joints[MV_JOINTS - 1]; - nmv_component comps[2]; -} nmv_context; - -static INLINE MV_JOINT_TYPE vp9_get_mv_joint(const MV *mv) { - if (mv->row == 0) { - return mv->col == 0 ? MV_JOINT_ZERO : MV_JOINT_HNZVZ; - } else { - return mv->col == 0 ? MV_JOINT_HZVNZ : MV_JOINT_HNZVNZ; - } -} - -MV_CLASS_TYPE vp9_get_mv_class(int z, int *offset); -int vp9_get_mv_mag(MV_CLASS_TYPE c, int offset); - - -typedef struct { - unsigned int sign[2]; - unsigned int classes[MV_CLASSES]; - unsigned int class0[CLASS0_SIZE]; - unsigned int bits[MV_OFFSET_BITS][2]; - unsigned int class0_fp[CLASS0_SIZE][MV_FP_SIZE]; - unsigned int fp[MV_FP_SIZE]; - unsigned int class0_hp[2]; - unsigned int hp[2]; -} nmv_component_counts; - -typedef struct { - unsigned int joints[MV_JOINTS]; - nmv_component_counts comps[2]; -} nmv_context_counts; - -void vp9_inc_mv(const MV *mv, nmv_context_counts *mvctx); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_ENTROPYMV_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_enums.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_enums.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_enums.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_enums.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_ENUMS_H_ -#define VP9_COMMON_VP9_ENUMS_H_ - -#include "./vpx_config.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define MI_SIZE_LOG2 3 -#define MI_BLOCK_SIZE_LOG2 (6 - MI_SIZE_LOG2) // 64 = 2^6 - -#define MI_SIZE (1 << MI_SIZE_LOG2) // pixels per mi-unit -#define MI_BLOCK_SIZE (1 << MI_BLOCK_SIZE_LOG2) // mi-units per max block - -#define MI_MASK (MI_BLOCK_SIZE - 1) - -// Bitstream profiles indicated by 2-3 bits in the uncompressed header. -// 00: Profile 0. 8-bit 4:2:0 only. -// 10: Profile 1. 8-bit 4:4:4, 4:2:2, and 4:4:0. -// 01: Profile 2. 10-bit and 12-bit color only, with 4:2:0 sampling. -// 110: Profile 3. 10-bit and 12-bit color only, with 4:2:2/4:4:4/4:4:0 -// sampling. -// 111: Undefined profile. -typedef enum BITSTREAM_PROFILE { - PROFILE_0, - PROFILE_1, - PROFILE_2, - PROFILE_3, - MAX_PROFILES -} BITSTREAM_PROFILE; - -typedef enum BLOCK_SIZE { - BLOCK_4X4, - BLOCK_4X8, - BLOCK_8X4, - BLOCK_8X8, - BLOCK_8X16, - BLOCK_16X8, - BLOCK_16X16, - BLOCK_16X32, - BLOCK_32X16, - BLOCK_32X32, - BLOCK_32X64, - BLOCK_64X32, - BLOCK_64X64, - BLOCK_SIZES, - BLOCK_INVALID = BLOCK_SIZES -} BLOCK_SIZE; - -typedef enum PARTITION_TYPE { - PARTITION_NONE, - PARTITION_HORZ, - PARTITION_VERT, - PARTITION_SPLIT, - PARTITION_TYPES, - PARTITION_INVALID = PARTITION_TYPES -} PARTITION_TYPE; - -typedef char PARTITION_CONTEXT; -#define PARTITION_PLOFFSET 4 // number of probability models per block size -#define PARTITION_CONTEXTS (4 * PARTITION_PLOFFSET) - -// block transform size -typedef enum { - TX_4X4 = 0, // 4x4 transform - TX_8X8 = 1, // 8x8 transform - TX_16X16 = 2, // 16x16 transform - TX_32X32 = 3, // 32x32 transform - TX_SIZES -} TX_SIZE; - -// frame transform mode -typedef enum { - ONLY_4X4 = 0, // only 4x4 transform used - ALLOW_8X8 = 1, // allow block transform size up to 8x8 - ALLOW_16X16 = 2, // allow block transform size up to 16x16 - ALLOW_32X32 = 3, // allow block transform size up to 32x32 - TX_MODE_SELECT = 4, // transform specified for each block - TX_MODES = 5, -} TX_MODE; - -typedef enum { - DCT_DCT = 0, // DCT in both horizontal and vertical - ADST_DCT = 1, // ADST in vertical, DCT in horizontal - DCT_ADST = 2, // DCT in vertical, ADST in horizontal - ADST_ADST = 3, // ADST in both directions - TX_TYPES = 4 -} TX_TYPE; - -typedef enum { - VP9_LAST_FLAG = 1 << 0, - VP9_GOLD_FLAG = 1 << 1, - VP9_ALT_FLAG = 1 << 2, -} VP9_REFFRAME; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_ENUMS_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_filter.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_filter.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_filter.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_filter.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "vp9/common/vp9_filter.h" - -const InterpKernel vp9_bilinear_filters[SUBPEL_SHIFTS] = { - { 0, 0, 0, 128, 0, 0, 0, 0 }, - { 0, 0, 0, 120, 8, 0, 0, 0 }, - { 0, 0, 0, 112, 16, 0, 0, 0 }, - { 0, 0, 0, 104, 24, 0, 0, 0 }, - { 0, 0, 0, 96, 32, 0, 0, 0 }, - { 0, 0, 0, 88, 40, 0, 0, 0 }, - { 0, 0, 0, 80, 48, 0, 0, 0 }, - { 0, 0, 0, 72, 56, 0, 0, 0 }, - { 0, 0, 0, 64, 64, 0, 0, 0 }, - { 0, 0, 0, 56, 72, 0, 0, 0 }, - { 0, 0, 0, 48, 80, 0, 0, 0 }, - { 0, 0, 0, 40, 88, 0, 0, 0 }, - { 0, 0, 0, 32, 96, 0, 0, 0 }, - { 0, 0, 0, 24, 104, 0, 0, 0 }, - { 0, 0, 0, 16, 112, 0, 0, 0 }, - { 0, 0, 0, 8, 120, 0, 0, 0 } -}; - -// Lagrangian interpolation filter -DECLARE_ALIGNED(256, const InterpKernel, - vp9_sub_pel_filters_8[SUBPEL_SHIFTS]) = { - { 0, 0, 0, 128, 0, 0, 0, 0}, - { 0, 1, -5, 126, 8, -3, 1, 0}, - { -1, 3, -10, 122, 18, -6, 2, 0}, - { -1, 4, -13, 118, 27, -9, 3, -1}, - { -1, 4, -16, 112, 37, -11, 4, -1}, - { -1, 5, -18, 105, 48, -14, 4, -1}, - { -1, 5, -19, 97, 58, -16, 5, -1}, - { -1, 6, -19, 88, 68, -18, 5, -1}, - { -1, 6, -19, 78, 78, -19, 6, -1}, - { -1, 5, -18, 68, 88, -19, 6, -1}, - { -1, 5, -16, 58, 97, -19, 5, -1}, - { -1, 4, -14, 48, 105, -18, 5, -1}, - { -1, 4, -11, 37, 112, -16, 4, -1}, - { -1, 3, -9, 27, 118, -13, 4, -1}, - { 0, 2, -6, 18, 122, -10, 3, -1}, - { 0, 1, -3, 8, 126, -5, 1, 0} -}; - -// DCT based filter -DECLARE_ALIGNED(256, const InterpKernel, - vp9_sub_pel_filters_8s[SUBPEL_SHIFTS]) = { - {0, 0, 0, 128, 0, 0, 0, 0}, - {-1, 3, -7, 127, 8, -3, 1, 0}, - {-2, 5, -13, 125, 17, -6, 3, -1}, - {-3, 7, -17, 121, 27, -10, 5, -2}, - {-4, 9, -20, 115, 37, -13, 6, -2}, - {-4, 10, -23, 108, 48, -16, 8, -3}, - {-4, 10, -24, 100, 59, -19, 9, -3}, - {-4, 11, -24, 90, 70, -21, 10, -4}, - {-4, 11, -23, 80, 80, -23, 11, -4}, - {-4, 10, -21, 70, 90, -24, 11, -4}, - {-3, 9, -19, 59, 100, -24, 10, -4}, - {-3, 8, -16, 48, 108, -23, 10, -4}, - {-2, 6, -13, 37, 115, -20, 9, -4}, - {-2, 5, -10, 27, 121, -17, 7, -3}, - {-1, 3, -6, 17, 125, -13, 5, -2}, - {0, 1, -3, 8, 127, -7, 3, -1} -}; - -// freqmultiplier = 0.5 -DECLARE_ALIGNED(256, const InterpKernel, - vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS]) = { - { 0, 0, 0, 128, 0, 0, 0, 0}, - {-3, -1, 32, 64, 38, 1, -3, 0}, - {-2, -2, 29, 63, 41, 2, -3, 0}, - {-2, -2, 26, 63, 43, 4, -4, 0}, - {-2, -3, 24, 62, 46, 5, -4, 0}, - {-2, -3, 21, 60, 49, 7, -4, 0}, - {-1, -4, 18, 59, 51, 9, -4, 0}, - {-1, -4, 16, 57, 53, 12, -4, -1}, - {-1, -4, 14, 55, 55, 14, -4, -1}, - {-1, -4, 12, 53, 57, 16, -4, -1}, - { 0, -4, 9, 51, 59, 18, -4, -1}, - { 0, -4, 7, 49, 60, 21, -3, -2}, - { 0, -4, 5, 46, 62, 24, -3, -2}, - { 0, -4, 4, 43, 63, 26, -2, -2}, - { 0, -3, 2, 41, 63, 29, -2, -2}, - { 0, -3, 1, 38, 64, 32, -1, -3} -}; - - -static const InterpKernel* vp9_filter_kernels[4] = { - vp9_sub_pel_filters_8, - vp9_sub_pel_filters_8lp, - vp9_sub_pel_filters_8s, - vp9_bilinear_filters -}; - -const InterpKernel *vp9_get_interp_kernel(INTERP_FILTER filter) { - assert(filter != SWITCHABLE); - return vp9_filter_kernels[filter]; -} - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_filter.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_filter.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_filter.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_filter.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2011 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_FILTER_H_ -#define VP9_COMMON_VP9_FILTER_H_ - -#include "./vpx_config.h" -#include "vpx/vpx_integer.h" -#include "vpx_ports/mem.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -#define FILTER_BITS 7 - -#define SUBPEL_BITS 4 -#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1) -#define SUBPEL_SHIFTS (1 << SUBPEL_BITS) -#define SUBPEL_TAPS 8 - -typedef enum { - EIGHTTAP = 0, - EIGHTTAP_SMOOTH = 1, - EIGHTTAP_SHARP = 2, - SWITCHABLE_FILTERS = 3, /* Number of switchable filters */ - BILINEAR = 3, - // The codec can operate in four possible inter prediction filter mode: - // 8-tap, 8-tap-smooth, 8-tap-sharp, and switching between the three. - SWITCHABLE_FILTER_CONTEXTS = SWITCHABLE_FILTERS + 1, - SWITCHABLE = 4 /* should be the last one */ -} INTERP_FILTER; - -typedef int16_t InterpKernel[SUBPEL_TAPS]; - -const InterpKernel *vp9_get_interp_kernel(INTERP_FILTER filter); - -DECLARE_ALIGNED(256, extern const InterpKernel, - vp9_bilinear_filters[SUBPEL_SHIFTS]); - -// The VP9_BILINEAR_FILTERS_2TAP macro returns a pointer to the bilinear -// filter kernel as a 2 tap filter. -#define BILINEAR_FILTERS_2TAP(x) \ - (vp9_bilinear_filters[(x)] + SUBPEL_TAPS/2 - 1) - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_FILTER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_frame_buffers.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_frame_buffers.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_frame_buffers.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_frame_buffers.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "vp9/common/vp9_frame_buffers.h" -#include "vpx_mem/vpx_mem.h" - -int vp9_alloc_internal_frame_buffers(InternalFrameBufferList *list) { - assert(list != NULL); - vp9_free_internal_frame_buffers(list); - - list->num_internal_frame_buffers = - VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS; - list->int_fb = - (InternalFrameBuffer *)vpx_calloc(list->num_internal_frame_buffers, - sizeof(*list->int_fb)); - return (list->int_fb == NULL); -} - -void vp9_free_internal_frame_buffers(InternalFrameBufferList *list) { - int i; - - assert(list != NULL); - - for (i = 0; i < list->num_internal_frame_buffers; ++i) { - vpx_free(list->int_fb[i].data); - list->int_fb[i].data = NULL; - } - vpx_free(list->int_fb); - list->int_fb = NULL; -} - -int vp9_get_frame_buffer(void *cb_priv, size_t min_size, - vpx_codec_frame_buffer_t *fb) { - int i; - InternalFrameBufferList *const int_fb_list = - (InternalFrameBufferList *)cb_priv; - if (int_fb_list == NULL) - return -1; - - // Find a free frame buffer. - for (i = 0; i < int_fb_list->num_internal_frame_buffers; ++i) { - if (!int_fb_list->int_fb[i].in_use) - break; - } - - if (i == int_fb_list->num_internal_frame_buffers) - return -1; - - if (int_fb_list->int_fb[i].size < min_size) { - int_fb_list->int_fb[i].data = - (uint8_t *)vpx_realloc(int_fb_list->int_fb[i].data, min_size); - if (!int_fb_list->int_fb[i].data) - return -1; - - // This memset is needed for fixing valgrind error from C loop filter - // due to access uninitialized memory in frame border. It could be - // removed if border is totally removed. - vpx_memset(int_fb_list->int_fb[i].data, 0, min_size); - int_fb_list->int_fb[i].size = min_size; - } - - fb->data = int_fb_list->int_fb[i].data; - fb->size = int_fb_list->int_fb[i].size; - int_fb_list->int_fb[i].in_use = 1; - - // Set the frame buffer's private data to point at the internal frame buffer. - fb->priv = &int_fb_list->int_fb[i]; - return 0; -} - -int vp9_release_frame_buffer(void *cb_priv, vpx_codec_frame_buffer_t *fb) { - InternalFrameBuffer *const int_fb = (InternalFrameBuffer *)fb->priv; - (void)cb_priv; - if (int_fb) - int_fb->in_use = 0; - return 0; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_frame_buffers.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_frame_buffers.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_frame_buffers.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_frame_buffers.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_FRAME_BUFFERS_H_ -#define VP9_COMMON_VP9_FRAME_BUFFERS_H_ - -#include "vpx/vpx_frame_buffer.h" -#include "vpx/vpx_integer.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct InternalFrameBuffer { - uint8_t *data; - size_t size; - int in_use; -} InternalFrameBuffer; - -typedef struct InternalFrameBufferList { - int num_internal_frame_buffers; - InternalFrameBuffer *int_fb; -} InternalFrameBufferList; - -// Initializes |list|. Returns 0 on success. -int vp9_alloc_internal_frame_buffers(InternalFrameBufferList *list); - -// Free any data allocated to the frame buffers. -void vp9_free_internal_frame_buffers(InternalFrameBufferList *list); - -// Callback used by libvpx to request an external frame buffer. |cb_priv| -// Callback private data, which points to an InternalFrameBufferList. -// |min_size| is the minimum size in bytes needed to decode the next frame. -// |fb| pointer to the frame buffer. -int vp9_get_frame_buffer(void *cb_priv, size_t min_size, - vpx_codec_frame_buffer_t *fb); - -// Callback used by libvpx when there are no references to the frame buffer. -// |cb_priv| is not used. |fb| pointer to the frame buffer. -int vp9_release_frame_buffer(void *cb_priv, vpx_codec_frame_buffer_t *fb); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_FRAME_BUFFERS_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_idct.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_idct.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_idct.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_idct.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2866 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_blockd.h" -#include "vp9/common/vp9_idct.h" -#include "vp9/common/vp9_systemdependent.h" - -static INLINE uint8_t clip_pixel_add(uint8_t dest, tran_high_t trans) { - trans = WRAPLOW(trans, 8); - return clip_pixel(WRAPLOW(dest + trans, 8)); -} - -void vp9_iwht4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int stride) { -/* 4-point reversible, orthonormal inverse Walsh-Hadamard in 3.5 adds, - 0.5 shifts per pixel. */ - int i; - tran_low_t output[16]; - tran_high_t a1, b1, c1, d1, e1; - const tran_low_t *ip = input; - tran_low_t *op = output; - - for (i = 0; i < 4; i++) { - a1 = ip[0] >> UNIT_QUANT_SHIFT; - c1 = ip[1] >> UNIT_QUANT_SHIFT; - d1 = ip[2] >> UNIT_QUANT_SHIFT; - b1 = ip[3] >> UNIT_QUANT_SHIFT; - a1 += c1; - d1 -= b1; - e1 = (a1 - d1) >> 1; - b1 = e1 - b1; - c1 = e1 - c1; - a1 -= b1; - d1 += c1; - op[0] = WRAPLOW(a1, 8); - op[1] = WRAPLOW(b1, 8); - op[2] = WRAPLOW(c1, 8); - op[3] = WRAPLOW(d1, 8); - ip += 4; - op += 4; - } - - ip = output; - for (i = 0; i < 4; i++) { - a1 = ip[4 * 0]; - c1 = ip[4 * 1]; - d1 = ip[4 * 2]; - b1 = ip[4 * 3]; - a1 += c1; - d1 -= b1; - e1 = (a1 - d1) >> 1; - b1 = e1 - b1; - c1 = e1 - c1; - a1 -= b1; - d1 += c1; - dest[stride * 0] = clip_pixel_add(dest[stride * 0], a1); - dest[stride * 1] = clip_pixel_add(dest[stride * 1], b1); - dest[stride * 2] = clip_pixel_add(dest[stride * 2], c1); - dest[stride * 3] = clip_pixel_add(dest[stride * 3], d1); - - ip++; - dest++; - } -} - -void vp9_iwht4x4_1_add_c(const tran_low_t *in, uint8_t *dest, int dest_stride) { - int i; - tran_high_t a1, e1; - tran_low_t tmp[4]; - const tran_low_t *ip = in; - tran_low_t *op = tmp; - - a1 = ip[0] >> UNIT_QUANT_SHIFT; - e1 = a1 >> 1; - a1 -= e1; - op[0] = WRAPLOW(a1, 8); - op[1] = op[2] = op[3] = WRAPLOW(e1, 8); - - ip = tmp; - for (i = 0; i < 4; i++) { - e1 = ip[0] >> 1; - a1 = ip[0] - e1; - dest[dest_stride * 0] = clip_pixel_add(dest[dest_stride * 0], a1); - dest[dest_stride * 1] = clip_pixel_add(dest[dest_stride * 1], e1); - dest[dest_stride * 2] = clip_pixel_add(dest[dest_stride * 2], e1); - dest[dest_stride * 3] = clip_pixel_add(dest[dest_stride * 3], e1); - ip++; - dest++; - } -} - -static void idct4(const tran_low_t *input, tran_low_t *output) { - tran_low_t step[4]; - tran_high_t temp1, temp2; - // stage 1 - temp1 = (input[0] + input[2]) * cospi_16_64; - temp2 = (input[0] - input[2]) * cospi_16_64; - step[0] = WRAPLOW(dct_const_round_shift(temp1), 8); - step[1] = WRAPLOW(dct_const_round_shift(temp2), 8); - temp1 = input[1] * cospi_24_64 - input[3] * cospi_8_64; - temp2 = input[1] * cospi_8_64 + input[3] * cospi_24_64; - step[2] = WRAPLOW(dct_const_round_shift(temp1), 8); - step[3] = WRAPLOW(dct_const_round_shift(temp2), 8); - - // stage 2 - output[0] = WRAPLOW(step[0] + step[3], 8); - output[1] = WRAPLOW(step[1] + step[2], 8); - output[2] = WRAPLOW(step[1] - step[2], 8); - output[3] = WRAPLOW(step[0] - step[3], 8); -} - -void vp9_idct4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int stride) { - tran_low_t out[4 * 4]; - tran_low_t *outptr = out; - int i, j; - tran_low_t temp_in[4], temp_out[4]; - - // Rows - for (i = 0; i < 4; ++i) { - idct4(input, outptr); - input += 4; - outptr += 4; - } - - // Columns - for (i = 0; i < 4; ++i) { - for (j = 0; j < 4; ++j) - temp_in[j] = out[j * 4 + i]; - idct4(temp_in, temp_out); - for (j = 0; j < 4; ++j) { - dest[j * stride + i] = clip_pixel_add(dest[j * stride + i], - ROUND_POWER_OF_TWO(temp_out[j], 4)); - } - } -} - -void vp9_idct4x4_1_add_c(const tran_low_t *input, uint8_t *dest, - int dest_stride) { - int i; - tran_high_t a1; - tran_low_t out = WRAPLOW(dct_const_round_shift(input[0] * cospi_16_64), 8); - out = WRAPLOW(dct_const_round_shift(out * cospi_16_64), 8); - a1 = ROUND_POWER_OF_TWO(out, 4); - - for (i = 0; i < 4; i++) { - dest[0] = clip_pixel_add(dest[0], a1); - dest[1] = clip_pixel_add(dest[1], a1); - dest[2] = clip_pixel_add(dest[2], a1); - dest[3] = clip_pixel_add(dest[3], a1); - dest += dest_stride; - } -} - -static void idct8(const tran_low_t *input, tran_low_t *output) { - tran_low_t step1[8], step2[8]; - tran_high_t temp1, temp2; - // stage 1 - step1[0] = input[0]; - step1[2] = input[4]; - step1[1] = input[2]; - step1[3] = input[6]; - temp1 = input[1] * cospi_28_64 - input[7] * cospi_4_64; - temp2 = input[1] * cospi_4_64 + input[7] * cospi_28_64; - step1[4] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[7] = WRAPLOW(dct_const_round_shift(temp2), 8); - temp1 = input[5] * cospi_12_64 - input[3] * cospi_20_64; - temp2 = input[5] * cospi_20_64 + input[3] * cospi_12_64; - step1[5] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[6] = WRAPLOW(dct_const_round_shift(temp2), 8); - - // stage 2 & stage 3 - even half - idct4(step1, step1); - - // stage 2 - odd half - step2[4] = WRAPLOW(step1[4] + step1[5], 8); - step2[5] = WRAPLOW(step1[4] - step1[5], 8); - step2[6] = WRAPLOW(-step1[6] + step1[7], 8); - step2[7] = WRAPLOW(step1[6] + step1[7], 8); - - // stage 3 -odd half - step1[4] = step2[4]; - temp1 = (step2[6] - step2[5]) * cospi_16_64; - temp2 = (step2[5] + step2[6]) * cospi_16_64; - step1[5] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[6] = WRAPLOW(dct_const_round_shift(temp2), 8); - step1[7] = step2[7]; - - // stage 4 - output[0] = WRAPLOW(step1[0] + step1[7], 8); - output[1] = WRAPLOW(step1[1] + step1[6], 8); - output[2] = WRAPLOW(step1[2] + step1[5], 8); - output[3] = WRAPLOW(step1[3] + step1[4], 8); - output[4] = WRAPLOW(step1[3] - step1[4], 8); - output[5] = WRAPLOW(step1[2] - step1[5], 8); - output[6] = WRAPLOW(step1[1] - step1[6], 8); - output[7] = WRAPLOW(step1[0] - step1[7], 8); -} - -void vp9_idct8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride) { - tran_low_t out[8 * 8]; - tran_low_t *outptr = out; - int i, j; - tran_low_t temp_in[8], temp_out[8]; - - // First transform rows - for (i = 0; i < 8; ++i) { - idct8(input, outptr); - input += 8; - outptr += 8; - } - - // Then transform columns - for (i = 0; i < 8; ++i) { - for (j = 0; j < 8; ++j) - temp_in[j] = out[j * 8 + i]; - idct8(temp_in, temp_out); - for (j = 0; j < 8; ++j) { - dest[j * stride + i] = clip_pixel_add(dest[j * stride + i], - ROUND_POWER_OF_TWO(temp_out[j], 5)); - } - } -} - -void vp9_idct8x8_1_add_c(const tran_low_t *input, uint8_t *dest, int stride) { - int i, j; - tran_high_t a1; - tran_low_t out = WRAPLOW(dct_const_round_shift(input[0] * cospi_16_64), 8); - out = WRAPLOW(dct_const_round_shift(out * cospi_16_64), 8); - a1 = ROUND_POWER_OF_TWO(out, 5); - for (j = 0; j < 8; ++j) { - for (i = 0; i < 8; ++i) - dest[i] = clip_pixel_add(dest[i], a1); - dest += stride; - } -} - -static void iadst4(const tran_low_t *input, tran_low_t *output) { - tran_high_t s0, s1, s2, s3, s4, s5, s6, s7; - - tran_low_t x0 = input[0]; - tran_low_t x1 = input[1]; - tran_low_t x2 = input[2]; - tran_low_t x3 = input[3]; - - if (!(x0 | x1 | x2 | x3)) { - output[0] = output[1] = output[2] = output[3] = 0; - return; - } - - s0 = sinpi_1_9 * x0; - s1 = sinpi_2_9 * x0; - s2 = sinpi_3_9 * x1; - s3 = sinpi_4_9 * x2; - s4 = sinpi_1_9 * x2; - s5 = sinpi_2_9 * x3; - s6 = sinpi_4_9 * x3; - s7 = x0 - x2 + x3; - - s0 = s0 + s3 + s5; - s1 = s1 - s4 - s6; - s3 = s2; - s2 = sinpi_3_9 * s7; - - // 1-D transform scaling factor is sqrt(2). - // The overall dynamic range is 14b (input) + 14b (multiplication scaling) - // + 1b (addition) = 29b. - // Hence the output bit depth is 15b. - output[0] = WRAPLOW(dct_const_round_shift(s0 + s3), 8); - output[1] = WRAPLOW(dct_const_round_shift(s1 + s3), 8); - output[2] = WRAPLOW(dct_const_round_shift(s2), 8); - output[3] = WRAPLOW(dct_const_round_shift(s0 + s1 - s3), 8); -} - -void vp9_iht4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int stride, - int tx_type) { - const transform_2d IHT_4[] = { - { idct4, idct4 }, // DCT_DCT = 0 - { iadst4, idct4 }, // ADST_DCT = 1 - { idct4, iadst4 }, // DCT_ADST = 2 - { iadst4, iadst4 } // ADST_ADST = 3 - }; - - int i, j; - tran_low_t out[4 * 4]; - tran_low_t *outptr = out; - tran_low_t temp_in[4], temp_out[4]; - - // inverse transform row vectors - for (i = 0; i < 4; ++i) { - IHT_4[tx_type].rows(input, outptr); - input += 4; - outptr += 4; - } - - // inverse transform column vectors - for (i = 0; i < 4; ++i) { - for (j = 0; j < 4; ++j) - temp_in[j] = out[j * 4 + i]; - IHT_4[tx_type].cols(temp_in, temp_out); - for (j = 0; j < 4; ++j) { - dest[j * stride + i] = clip_pixel_add(dest[j * stride + i], - ROUND_POWER_OF_TWO(temp_out[j], 4)); - } - } -} - -static void iadst8(const tran_low_t *input, tran_low_t *output) { - int s0, s1, s2, s3, s4, s5, s6, s7; - - tran_high_t x0 = input[7]; - tran_high_t x1 = input[0]; - tran_high_t x2 = input[5]; - tran_high_t x3 = input[2]; - tran_high_t x4 = input[3]; - tran_high_t x5 = input[4]; - tran_high_t x6 = input[1]; - tran_high_t x7 = input[6]; - - if (!(x0 | x1 | x2 | x3 | x4 | x5 | x6 | x7)) { - output[0] = output[1] = output[2] = output[3] = output[4] - = output[5] = output[6] = output[7] = 0; - return; - } - - // stage 1 - s0 = (int)(cospi_2_64 * x0 + cospi_30_64 * x1); - s1 = (int)(cospi_30_64 * x0 - cospi_2_64 * x1); - s2 = (int)(cospi_10_64 * x2 + cospi_22_64 * x3); - s3 = (int)(cospi_22_64 * x2 - cospi_10_64 * x3); - s4 = (int)(cospi_18_64 * x4 + cospi_14_64 * x5); - s5 = (int)(cospi_14_64 * x4 - cospi_18_64 * x5); - s6 = (int)(cospi_26_64 * x6 + cospi_6_64 * x7); - s7 = (int)(cospi_6_64 * x6 - cospi_26_64 * x7); - - x0 = WRAPLOW(dct_const_round_shift(s0 + s4), 8); - x1 = WRAPLOW(dct_const_round_shift(s1 + s5), 8); - x2 = WRAPLOW(dct_const_round_shift(s2 + s6), 8); - x3 = WRAPLOW(dct_const_round_shift(s3 + s7), 8); - x4 = WRAPLOW(dct_const_round_shift(s0 - s4), 8); - x5 = WRAPLOW(dct_const_round_shift(s1 - s5), 8); - x6 = WRAPLOW(dct_const_round_shift(s2 - s6), 8); - x7 = WRAPLOW(dct_const_round_shift(s3 - s7), 8); - - // stage 2 - s0 = (int)x0; - s1 = (int)x1; - s2 = (int)x2; - s3 = (int)x3; - s4 = (int)(cospi_8_64 * x4 + cospi_24_64 * x5); - s5 = (int)(cospi_24_64 * x4 - cospi_8_64 * x5); - s6 = (int)(-cospi_24_64 * x6 + cospi_8_64 * x7); - s7 = (int)(cospi_8_64 * x6 + cospi_24_64 * x7); - - x0 = WRAPLOW(s0 + s2, 8); - x1 = WRAPLOW(s1 + s3, 8); - x2 = WRAPLOW(s0 - s2, 8); - x3 = WRAPLOW(s1 - s3, 8); - x4 = WRAPLOW(dct_const_round_shift(s4 + s6), 8); - x5 = WRAPLOW(dct_const_round_shift(s5 + s7), 8); - x6 = WRAPLOW(dct_const_round_shift(s4 - s6), 8); - x7 = WRAPLOW(dct_const_round_shift(s5 - s7), 8); - - // stage 3 - s2 = (int)(cospi_16_64 * (x2 + x3)); - s3 = (int)(cospi_16_64 * (x2 - x3)); - s6 = (int)(cospi_16_64 * (x6 + x7)); - s7 = (int)(cospi_16_64 * (x6 - x7)); - - x2 = WRAPLOW(dct_const_round_shift(s2), 8); - x3 = WRAPLOW(dct_const_round_shift(s3), 8); - x6 = WRAPLOW(dct_const_round_shift(s6), 8); - x7 = WRAPLOW(dct_const_round_shift(s7), 8); - - output[0] = WRAPLOW(x0, 8); - output[1] = WRAPLOW(-x4, 8); - output[2] = WRAPLOW(x6, 8); - output[3] = WRAPLOW(-x2, 8); - output[4] = WRAPLOW(x3, 8); - output[5] = WRAPLOW(-x7, 8); - output[6] = WRAPLOW(x5, 8); - output[7] = WRAPLOW(-x1, 8); -} - -static const transform_2d IHT_8[] = { - { idct8, idct8 }, // DCT_DCT = 0 - { iadst8, idct8 }, // ADST_DCT = 1 - { idct8, iadst8 }, // DCT_ADST = 2 - { iadst8, iadst8 } // ADST_ADST = 3 -}; - -void vp9_iht8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride, - int tx_type) { - int i, j; - tran_low_t out[8 * 8]; - tran_low_t *outptr = out; - tran_low_t temp_in[8], temp_out[8]; - const transform_2d ht = IHT_8[tx_type]; - - // inverse transform row vectors - for (i = 0; i < 8; ++i) { - ht.rows(input, outptr); - input += 8; - outptr += 8; - } - - // inverse transform column vectors - for (i = 0; i < 8; ++i) { - for (j = 0; j < 8; ++j) - temp_in[j] = out[j * 8 + i]; - ht.cols(temp_in, temp_out); - for (j = 0; j < 8; ++j) { - dest[j * stride + i] = clip_pixel_add(dest[j * stride + i], - ROUND_POWER_OF_TWO(temp_out[j], 5)); - } - } -} - -void vp9_idct8x8_12_add_c(const tran_low_t *input, uint8_t *dest, int stride) { - tran_low_t out[8 * 8] = { 0 }; - tran_low_t *outptr = out; - int i, j; - tran_low_t temp_in[8], temp_out[8]; - - // First transform rows - // only first 4 row has non-zero coefs - for (i = 0; i < 4; ++i) { - idct8(input, outptr); - input += 8; - outptr += 8; - } - - // Then transform columns - for (i = 0; i < 8; ++i) { - for (j = 0; j < 8; ++j) - temp_in[j] = out[j * 8 + i]; - idct8(temp_in, temp_out); - for (j = 0; j < 8; ++j) { - dest[j * stride + i] = clip_pixel_add(dest[j * stride + i], - ROUND_POWER_OF_TWO(temp_out[j], 5)); - } - } -} - -static void idct16(const tran_low_t *input, tran_low_t *output) { - tran_low_t step1[16], step2[16]; - tran_high_t temp1, temp2; - - // stage 1 - step1[0] = input[0/2]; - step1[1] = input[16/2]; - step1[2] = input[8/2]; - step1[3] = input[24/2]; - step1[4] = input[4/2]; - step1[5] = input[20/2]; - step1[6] = input[12/2]; - step1[7] = input[28/2]; - step1[8] = input[2/2]; - step1[9] = input[18/2]; - step1[10] = input[10/2]; - step1[11] = input[26/2]; - step1[12] = input[6/2]; - step1[13] = input[22/2]; - step1[14] = input[14/2]; - step1[15] = input[30/2]; - - // stage 2 - step2[0] = step1[0]; - step2[1] = step1[1]; - step2[2] = step1[2]; - step2[3] = step1[3]; - step2[4] = step1[4]; - step2[5] = step1[5]; - step2[6] = step1[6]; - step2[7] = step1[7]; - - temp1 = step1[8] * cospi_30_64 - step1[15] * cospi_2_64; - temp2 = step1[8] * cospi_2_64 + step1[15] * cospi_30_64; - step2[8] = WRAPLOW(dct_const_round_shift(temp1), 8); - step2[15] = WRAPLOW(dct_const_round_shift(temp2), 8); - - temp1 = step1[9] * cospi_14_64 - step1[14] * cospi_18_64; - temp2 = step1[9] * cospi_18_64 + step1[14] * cospi_14_64; - step2[9] = WRAPLOW(dct_const_round_shift(temp1), 8); - step2[14] = WRAPLOW(dct_const_round_shift(temp2), 8); - - temp1 = step1[10] * cospi_22_64 - step1[13] * cospi_10_64; - temp2 = step1[10] * cospi_10_64 + step1[13] * cospi_22_64; - step2[10] = WRAPLOW(dct_const_round_shift(temp1), 8); - step2[13] = WRAPLOW(dct_const_round_shift(temp2), 8); - - temp1 = step1[11] * cospi_6_64 - step1[12] * cospi_26_64; - temp2 = step1[11] * cospi_26_64 + step1[12] * cospi_6_64; - step2[11] = WRAPLOW(dct_const_round_shift(temp1), 8); - step2[12] = WRAPLOW(dct_const_round_shift(temp2), 8); - - // stage 3 - step1[0] = step2[0]; - step1[1] = step2[1]; - step1[2] = step2[2]; - step1[3] = step2[3]; - - temp1 = step2[4] * cospi_28_64 - step2[7] * cospi_4_64; - temp2 = step2[4] * cospi_4_64 + step2[7] * cospi_28_64; - step1[4] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[7] = WRAPLOW(dct_const_round_shift(temp2), 8); - temp1 = step2[5] * cospi_12_64 - step2[6] * cospi_20_64; - temp2 = step2[5] * cospi_20_64 + step2[6] * cospi_12_64; - step1[5] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[6] = WRAPLOW(dct_const_round_shift(temp2), 8); - - step1[8] = WRAPLOW(step2[8] + step2[9], 8); - step1[9] = WRAPLOW(step2[8] - step2[9], 8); - step1[10] = WRAPLOW(-step2[10] + step2[11], 8); - step1[11] = WRAPLOW(step2[10] + step2[11], 8); - step1[12] = WRAPLOW(step2[12] + step2[13], 8); - step1[13] = WRAPLOW(step2[12] - step2[13], 8); - step1[14] = WRAPLOW(-step2[14] + step2[15], 8); - step1[15] = WRAPLOW(step2[14] + step2[15], 8); - - // stage 4 - temp1 = (step1[0] + step1[1]) * cospi_16_64; - temp2 = (step1[0] - step1[1]) * cospi_16_64; - step2[0] = WRAPLOW(dct_const_round_shift(temp1), 8); - step2[1] = WRAPLOW(dct_const_round_shift(temp2), 8); - temp1 = step1[2] * cospi_24_64 - step1[3] * cospi_8_64; - temp2 = step1[2] * cospi_8_64 + step1[3] * cospi_24_64; - step2[2] = WRAPLOW(dct_const_round_shift(temp1), 8); - step2[3] = WRAPLOW(dct_const_round_shift(temp2), 8); - step2[4] = WRAPLOW(step1[4] + step1[5], 8); - step2[5] = WRAPLOW(step1[4] - step1[5], 8); - step2[6] = WRAPLOW(-step1[6] + step1[7], 8); - step2[7] = WRAPLOW(step1[6] + step1[7], 8); - - step2[8] = step1[8]; - step2[15] = step1[15]; - temp1 = -step1[9] * cospi_8_64 + step1[14] * cospi_24_64; - temp2 = step1[9] * cospi_24_64 + step1[14] * cospi_8_64; - step2[9] = WRAPLOW(dct_const_round_shift(temp1), 8); - step2[14] = WRAPLOW(dct_const_round_shift(temp2), 8); - temp1 = -step1[10] * cospi_24_64 - step1[13] * cospi_8_64; - temp2 = -step1[10] * cospi_8_64 + step1[13] * cospi_24_64; - step2[10] = WRAPLOW(dct_const_round_shift(temp1), 8); - step2[13] = WRAPLOW(dct_const_round_shift(temp2), 8); - step2[11] = step1[11]; - step2[12] = step1[12]; - - // stage 5 - step1[0] = WRAPLOW(step2[0] + step2[3], 8); - step1[1] = WRAPLOW(step2[1] + step2[2], 8); - step1[2] = WRAPLOW(step2[1] - step2[2], 8); - step1[3] = WRAPLOW(step2[0] - step2[3], 8); - step1[4] = step2[4]; - temp1 = (step2[6] - step2[5]) * cospi_16_64; - temp2 = (step2[5] + step2[6]) * cospi_16_64; - step1[5] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[6] = WRAPLOW(dct_const_round_shift(temp2), 8); - step1[7] = step2[7]; - - step1[8] = WRAPLOW(step2[8] + step2[11], 8); - step1[9] = WRAPLOW(step2[9] + step2[10], 8); - step1[10] = WRAPLOW(step2[9] - step2[10], 8); - step1[11] = WRAPLOW(step2[8] - step2[11], 8); - step1[12] = WRAPLOW(-step2[12] + step2[15], 8); - step1[13] = WRAPLOW(-step2[13] + step2[14], 8); - step1[14] = WRAPLOW(step2[13] + step2[14], 8); - step1[15] = WRAPLOW(step2[12] + step2[15], 8); - - // stage 6 - step2[0] = WRAPLOW(step1[0] + step1[7], 8); - step2[1] = WRAPLOW(step1[1] + step1[6], 8); - step2[2] = WRAPLOW(step1[2] + step1[5], 8); - step2[3] = WRAPLOW(step1[3] + step1[4], 8); - step2[4] = WRAPLOW(step1[3] - step1[4], 8); - step2[5] = WRAPLOW(step1[2] - step1[5], 8); - step2[6] = WRAPLOW(step1[1] - step1[6], 8); - step2[7] = WRAPLOW(step1[0] - step1[7], 8); - step2[8] = step1[8]; - step2[9] = step1[9]; - temp1 = (-step1[10] + step1[13]) * cospi_16_64; - temp2 = (step1[10] + step1[13]) * cospi_16_64; - step2[10] = WRAPLOW(dct_const_round_shift(temp1), 8); - step2[13] = WRAPLOW(dct_const_round_shift(temp2), 8); - temp1 = (-step1[11] + step1[12]) * cospi_16_64; - temp2 = (step1[11] + step1[12]) * cospi_16_64; - step2[11] = WRAPLOW(dct_const_round_shift(temp1), 8); - step2[12] = WRAPLOW(dct_const_round_shift(temp2), 8); - step2[14] = step1[14]; - step2[15] = step1[15]; - - // stage 7 - output[0] = WRAPLOW(step2[0] + step2[15], 8); - output[1] = WRAPLOW(step2[1] + step2[14], 8); - output[2] = WRAPLOW(step2[2] + step2[13], 8); - output[3] = WRAPLOW(step2[3] + step2[12], 8); - output[4] = WRAPLOW(step2[4] + step2[11], 8); - output[5] = WRAPLOW(step2[5] + step2[10], 8); - output[6] = WRAPLOW(step2[6] + step2[9], 8); - output[7] = WRAPLOW(step2[7] + step2[8], 8); - output[8] = WRAPLOW(step2[7] - step2[8], 8); - output[9] = WRAPLOW(step2[6] - step2[9], 8); - output[10] = WRAPLOW(step2[5] - step2[10], 8); - output[11] = WRAPLOW(step2[4] - step2[11], 8); - output[12] = WRAPLOW(step2[3] - step2[12], 8); - output[13] = WRAPLOW(step2[2] - step2[13], 8); - output[14] = WRAPLOW(step2[1] - step2[14], 8); - output[15] = WRAPLOW(step2[0] - step2[15], 8); -} - -void vp9_idct16x16_256_add_c(const tran_low_t *input, uint8_t *dest, - int stride) { - tran_low_t out[16 * 16]; - tran_low_t *outptr = out; - int i, j; - tran_low_t temp_in[16], temp_out[16]; - - // First transform rows - for (i = 0; i < 16; ++i) { - idct16(input, outptr); - input += 16; - outptr += 16; - } - - // Then transform columns - for (i = 0; i < 16; ++i) { - for (j = 0; j < 16; ++j) - temp_in[j] = out[j * 16 + i]; - idct16(temp_in, temp_out); - for (j = 0; j < 16; ++j) { - dest[j * stride + i] = clip_pixel_add(dest[j * stride + i], - ROUND_POWER_OF_TWO(temp_out[j], 6)); - } - } -} - -static void iadst16(const tran_low_t *input, tran_low_t *output) { - tran_high_t s0, s1, s2, s3, s4, s5, s6, s7, s8; - tran_high_t s9, s10, s11, s12, s13, s14, s15; - - tran_high_t x0 = input[15]; - tran_high_t x1 = input[0]; - tran_high_t x2 = input[13]; - tran_high_t x3 = input[2]; - tran_high_t x4 = input[11]; - tran_high_t x5 = input[4]; - tran_high_t x6 = input[9]; - tran_high_t x7 = input[6]; - tran_high_t x8 = input[7]; - tran_high_t x9 = input[8]; - tran_high_t x10 = input[5]; - tran_high_t x11 = input[10]; - tran_high_t x12 = input[3]; - tran_high_t x13 = input[12]; - tran_high_t x14 = input[1]; - tran_high_t x15 = input[14]; - - if (!(x0 | x1 | x2 | x3 | x4 | x5 | x6 | x7 | x8 - | x9 | x10 | x11 | x12 | x13 | x14 | x15)) { - output[0] = output[1] = output[2] = output[3] = output[4] - = output[5] = output[6] = output[7] = output[8] - = output[9] = output[10] = output[11] = output[12] - = output[13] = output[14] = output[15] = 0; - return; - } - - // stage 1 - s0 = x0 * cospi_1_64 + x1 * cospi_31_64; - s1 = x0 * cospi_31_64 - x1 * cospi_1_64; - s2 = x2 * cospi_5_64 + x3 * cospi_27_64; - s3 = x2 * cospi_27_64 - x3 * cospi_5_64; - s4 = x4 * cospi_9_64 + x5 * cospi_23_64; - s5 = x4 * cospi_23_64 - x5 * cospi_9_64; - s6 = x6 * cospi_13_64 + x7 * cospi_19_64; - s7 = x6 * cospi_19_64 - x7 * cospi_13_64; - s8 = x8 * cospi_17_64 + x9 * cospi_15_64; - s9 = x8 * cospi_15_64 - x9 * cospi_17_64; - s10 = x10 * cospi_21_64 + x11 * cospi_11_64; - s11 = x10 * cospi_11_64 - x11 * cospi_21_64; - s12 = x12 * cospi_25_64 + x13 * cospi_7_64; - s13 = x12 * cospi_7_64 - x13 * cospi_25_64; - s14 = x14 * cospi_29_64 + x15 * cospi_3_64; - s15 = x14 * cospi_3_64 - x15 * cospi_29_64; - - x0 = WRAPLOW(dct_const_round_shift(s0 + s8), 8); - x1 = WRAPLOW(dct_const_round_shift(s1 + s9), 8); - x2 = WRAPLOW(dct_const_round_shift(s2 + s10), 8); - x3 = WRAPLOW(dct_const_round_shift(s3 + s11), 8); - x4 = WRAPLOW(dct_const_round_shift(s4 + s12), 8); - x5 = WRAPLOW(dct_const_round_shift(s5 + s13), 8); - x6 = WRAPLOW(dct_const_round_shift(s6 + s14), 8); - x7 = WRAPLOW(dct_const_round_shift(s7 + s15), 8); - x8 = WRAPLOW(dct_const_round_shift(s0 - s8), 8); - x9 = WRAPLOW(dct_const_round_shift(s1 - s9), 8); - x10 = WRAPLOW(dct_const_round_shift(s2 - s10), 8); - x11 = WRAPLOW(dct_const_round_shift(s3 - s11), 8); - x12 = WRAPLOW(dct_const_round_shift(s4 - s12), 8); - x13 = WRAPLOW(dct_const_round_shift(s5 - s13), 8); - x14 = WRAPLOW(dct_const_round_shift(s6 - s14), 8); - x15 = WRAPLOW(dct_const_round_shift(s7 - s15), 8); - - // stage 2 - s0 = x0; - s1 = x1; - s2 = x2; - s3 = x3; - s4 = x4; - s5 = x5; - s6 = x6; - s7 = x7; - s8 = x8 * cospi_4_64 + x9 * cospi_28_64; - s9 = x8 * cospi_28_64 - x9 * cospi_4_64; - s10 = x10 * cospi_20_64 + x11 * cospi_12_64; - s11 = x10 * cospi_12_64 - x11 * cospi_20_64; - s12 = - x12 * cospi_28_64 + x13 * cospi_4_64; - s13 = x12 * cospi_4_64 + x13 * cospi_28_64; - s14 = - x14 * cospi_12_64 + x15 * cospi_20_64; - s15 = x14 * cospi_20_64 + x15 * cospi_12_64; - - x0 = WRAPLOW(s0 + s4, 8); - x1 = WRAPLOW(s1 + s5, 8); - x2 = WRAPLOW(s2 + s6, 8); - x3 = WRAPLOW(s3 + s7, 8); - x4 = WRAPLOW(s0 - s4, 8); - x5 = WRAPLOW(s1 - s5, 8); - x6 = WRAPLOW(s2 - s6, 8); - x7 = WRAPLOW(s3 - s7, 8); - x8 = WRAPLOW(dct_const_round_shift(s8 + s12), 8); - x9 = WRAPLOW(dct_const_round_shift(s9 + s13), 8); - x10 = WRAPLOW(dct_const_round_shift(s10 + s14), 8); - x11 = WRAPLOW(dct_const_round_shift(s11 + s15), 8); - x12 = WRAPLOW(dct_const_round_shift(s8 - s12), 8); - x13 = WRAPLOW(dct_const_round_shift(s9 - s13), 8); - x14 = WRAPLOW(dct_const_round_shift(s10 - s14), 8); - x15 = WRAPLOW(dct_const_round_shift(s11 - s15), 8); - - // stage 3 - s0 = x0; - s1 = x1; - s2 = x2; - s3 = x3; - s4 = x4 * cospi_8_64 + x5 * cospi_24_64; - s5 = x4 * cospi_24_64 - x5 * cospi_8_64; - s6 = - x6 * cospi_24_64 + x7 * cospi_8_64; - s7 = x6 * cospi_8_64 + x7 * cospi_24_64; - s8 = x8; - s9 = x9; - s10 = x10; - s11 = x11; - s12 = x12 * cospi_8_64 + x13 * cospi_24_64; - s13 = x12 * cospi_24_64 - x13 * cospi_8_64; - s14 = - x14 * cospi_24_64 + x15 * cospi_8_64; - s15 = x14 * cospi_8_64 + x15 * cospi_24_64; - - x0 = WRAPLOW(check_range(s0 + s2), 8); - x1 = WRAPLOW(check_range(s1 + s3), 8); - x2 = WRAPLOW(check_range(s0 - s2), 8); - x3 = WRAPLOW(check_range(s1 - s3), 8); - x4 = WRAPLOW(dct_const_round_shift(s4 + s6), 8); - x5 = WRAPLOW(dct_const_round_shift(s5 + s7), 8); - x6 = WRAPLOW(dct_const_round_shift(s4 - s6), 8); - x7 = WRAPLOW(dct_const_round_shift(s5 - s7), 8); - x8 = WRAPLOW(check_range(s8 + s10), 8); - x9 = WRAPLOW(check_range(s9 + s11), 8); - x10 = WRAPLOW(check_range(s8 - s10), 8); - x11 = WRAPLOW(check_range(s9 - s11), 8); - x12 = WRAPLOW(dct_const_round_shift(s12 + s14), 8); - x13 = WRAPLOW(dct_const_round_shift(s13 + s15), 8); - x14 = WRAPLOW(dct_const_round_shift(s12 - s14), 8); - x15 = WRAPLOW(dct_const_round_shift(s13 - s15), 8); - - // stage 4 - s2 = (- cospi_16_64) * (x2 + x3); - s3 = cospi_16_64 * (x2 - x3); - s6 = cospi_16_64 * (x6 + x7); - s7 = cospi_16_64 * (- x6 + x7); - s10 = cospi_16_64 * (x10 + x11); - s11 = cospi_16_64 * (- x10 + x11); - s14 = (- cospi_16_64) * (x14 + x15); - s15 = cospi_16_64 * (x14 - x15); - - x2 = WRAPLOW(dct_const_round_shift(s2), 8); - x3 = WRAPLOW(dct_const_round_shift(s3), 8); - x6 = WRAPLOW(dct_const_round_shift(s6), 8); - x7 = WRAPLOW(dct_const_round_shift(s7), 8); - x10 = WRAPLOW(dct_const_round_shift(s10), 8); - x11 = WRAPLOW(dct_const_round_shift(s11), 8); - x14 = WRAPLOW(dct_const_round_shift(s14), 8); - x15 = WRAPLOW(dct_const_round_shift(s15), 8); - - output[0] = WRAPLOW(x0, 8); - output[1] = WRAPLOW(-x8, 8); - output[2] = WRAPLOW(x12, 8); - output[3] = WRAPLOW(-x4, 8); - output[4] = WRAPLOW(x6, 8); - output[5] = WRAPLOW(x14, 8); - output[6] = WRAPLOW(x10, 8); - output[7] = WRAPLOW(x2, 8); - output[8] = WRAPLOW(x3, 8); - output[9] = WRAPLOW(x11, 8); - output[10] = WRAPLOW(x15, 8); - output[11] = WRAPLOW(x7, 8); - output[12] = WRAPLOW(x5, 8); - output[13] = WRAPLOW(-x13, 8); - output[14] = WRAPLOW(x9, 8); - output[15] = WRAPLOW(-x1, 8); -} - -static const transform_2d IHT_16[] = { - { idct16, idct16 }, // DCT_DCT = 0 - { iadst16, idct16 }, // ADST_DCT = 1 - { idct16, iadst16 }, // DCT_ADST = 2 - { iadst16, iadst16 } // ADST_ADST = 3 -}; - -void vp9_iht16x16_256_add_c(const tran_low_t *input, uint8_t *dest, int stride, - int tx_type) { - int i, j; - tran_low_t out[16 * 16]; - tran_low_t *outptr = out; - tran_low_t temp_in[16], temp_out[16]; - const transform_2d ht = IHT_16[tx_type]; - - // Rows - for (i = 0; i < 16; ++i) { - ht.rows(input, outptr); - input += 16; - outptr += 16; - } - - // Columns - for (i = 0; i < 16; ++i) { - for (j = 0; j < 16; ++j) - temp_in[j] = out[j * 16 + i]; - ht.cols(temp_in, temp_out); - for (j = 0; j < 16; ++j) { - dest[j * stride + i] = clip_pixel_add(dest[j * stride + i], - ROUND_POWER_OF_TWO(temp_out[j], 6)); - } - } -} - -void vp9_idct16x16_10_add_c(const tran_low_t *input, uint8_t *dest, - int stride) { - tran_low_t out[16 * 16] = { 0 }; - tran_low_t *outptr = out; - int i, j; - tran_low_t temp_in[16], temp_out[16]; - - // First transform rows. Since all non-zero dct coefficients are in - // upper-left 4x4 area, we only need to calculate first 4 rows here. - for (i = 0; i < 4; ++i) { - idct16(input, outptr); - input += 16; - outptr += 16; - } - - // Then transform columns - for (i = 0; i < 16; ++i) { - for (j = 0; j < 16; ++j) - temp_in[j] = out[j*16 + i]; - idct16(temp_in, temp_out); - for (j = 0; j < 16; ++j) { - dest[j * stride + i] = clip_pixel_add(dest[j * stride + i], - ROUND_POWER_OF_TWO(temp_out[j], 6)); - } - } -} - -void vp9_idct16x16_1_add_c(const tran_low_t *input, uint8_t *dest, int stride) { - int i, j; - tran_high_t a1; - tran_low_t out = WRAPLOW(dct_const_round_shift(input[0] * cospi_16_64), 8); - out = WRAPLOW(dct_const_round_shift(out * cospi_16_64), 8); - a1 = ROUND_POWER_OF_TWO(out, 6); - for (j = 0; j < 16; ++j) { - for (i = 0; i < 16; ++i) - dest[i] = clip_pixel_add(dest[i], a1); - dest += stride; - } -} - -static void idct32(const tran_low_t *input, tran_low_t *output) { - tran_low_t step1[32], step2[32]; - tran_high_t temp1, temp2; - - // stage 1 - step1[0] = input[0]; - step1[1] = input[16]; - step1[2] = input[8]; - step1[3] = input[24]; - step1[4] = input[4]; - step1[5] = input[20]; - step1[6] = input[12]; - step1[7] = input[28]; - step1[8] = input[2]; - step1[9] = input[18]; - step1[10] = input[10]; - step1[11] = input[26]; - step1[12] = input[6]; - step1[13] = input[22]; - step1[14] = input[14]; - step1[15] = input[30]; - - temp1 = input[1] * cospi_31_64 - input[31] * cospi_1_64; - temp2 = input[1] * cospi_1_64 + input[31] * cospi_31_64; - step1[16] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[31] = WRAPLOW(dct_const_round_shift(temp2), 8); - - temp1 = input[17] * cospi_15_64 - input[15] * cospi_17_64; - temp2 = input[17] * cospi_17_64 + input[15] * cospi_15_64; - step1[17] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[30] = WRAPLOW(dct_const_round_shift(temp2), 8); - - temp1 = input[9] * cospi_23_64 - input[23] * cospi_9_64; - temp2 = input[9] * cospi_9_64 + input[23] * cospi_23_64; - step1[18] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[29] = WRAPLOW(dct_const_round_shift(temp2), 8); - - temp1 = input[25] * cospi_7_64 - input[7] * cospi_25_64; - temp2 = input[25] * cospi_25_64 + input[7] * cospi_7_64; - step1[19] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[28] = WRAPLOW(dct_const_round_shift(temp2), 8); - - temp1 = input[5] * cospi_27_64 - input[27] * cospi_5_64; - temp2 = input[5] * cospi_5_64 + input[27] * cospi_27_64; - step1[20] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[27] = WRAPLOW(dct_const_round_shift(temp2), 8); - - temp1 = input[21] * cospi_11_64 - input[11] * cospi_21_64; - temp2 = input[21] * cospi_21_64 + input[11] * cospi_11_64; - step1[21] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[26] = WRAPLOW(dct_const_round_shift(temp2), 8); - - temp1 = input[13] * cospi_19_64 - input[19] * cospi_13_64; - temp2 = input[13] * cospi_13_64 + input[19] * cospi_19_64; - step1[22] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[25] = WRAPLOW(dct_const_round_shift(temp2), 8); - - temp1 = input[29] * cospi_3_64 - input[3] * cospi_29_64; - temp2 = input[29] * cospi_29_64 + input[3] * cospi_3_64; - step1[23] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[24] = WRAPLOW(dct_const_round_shift(temp2), 8); - - // stage 2 - step2[0] = step1[0]; - step2[1] = step1[1]; - step2[2] = step1[2]; - step2[3] = step1[3]; - step2[4] = step1[4]; - step2[5] = step1[5]; - step2[6] = step1[6]; - step2[7] = step1[7]; - - temp1 = step1[8] * cospi_30_64 - step1[15] * cospi_2_64; - temp2 = step1[8] * cospi_2_64 + step1[15] * cospi_30_64; - step2[8] = WRAPLOW(dct_const_round_shift(temp1), 8); - step2[15] = WRAPLOW(dct_const_round_shift(temp2), 8); - - temp1 = step1[9] * cospi_14_64 - step1[14] * cospi_18_64; - temp2 = step1[9] * cospi_18_64 + step1[14] * cospi_14_64; - step2[9] = WRAPLOW(dct_const_round_shift(temp1), 8); - step2[14] = WRAPLOW(dct_const_round_shift(temp2), 8); - - temp1 = step1[10] * cospi_22_64 - step1[13] * cospi_10_64; - temp2 = step1[10] * cospi_10_64 + step1[13] * cospi_22_64; - step2[10] = WRAPLOW(dct_const_round_shift(temp1), 8); - step2[13] = WRAPLOW(dct_const_round_shift(temp2), 8); - - temp1 = step1[11] * cospi_6_64 - step1[12] * cospi_26_64; - temp2 = step1[11] * cospi_26_64 + step1[12] * cospi_6_64; - step2[11] = WRAPLOW(dct_const_round_shift(temp1), 8); - step2[12] = WRAPLOW(dct_const_round_shift(temp2), 8); - - step2[16] = WRAPLOW(step1[16] + step1[17], 8); - step2[17] = WRAPLOW(step1[16] - step1[17], 8); - step2[18] = WRAPLOW(-step1[18] + step1[19], 8); - step2[19] = WRAPLOW(step1[18] + step1[19], 8); - step2[20] = WRAPLOW(step1[20] + step1[21], 8); - step2[21] = WRAPLOW(step1[20] - step1[21], 8); - step2[22] = WRAPLOW(-step1[22] + step1[23], 8); - step2[23] = WRAPLOW(step1[22] + step1[23], 8); - step2[24] = WRAPLOW(step1[24] + step1[25], 8); - step2[25] = WRAPLOW(step1[24] - step1[25], 8); - step2[26] = WRAPLOW(-step1[26] + step1[27], 8); - step2[27] = WRAPLOW(step1[26] + step1[27], 8); - step2[28] = WRAPLOW(step1[28] + step1[29], 8); - step2[29] = WRAPLOW(step1[28] - step1[29], 8); - step2[30] = WRAPLOW(-step1[30] + step1[31], 8); - step2[31] = WRAPLOW(step1[30] + step1[31], 8); - - // stage 3 - step1[0] = step2[0]; - step1[1] = step2[1]; - step1[2] = step2[2]; - step1[3] = step2[3]; - - temp1 = step2[4] * cospi_28_64 - step2[7] * cospi_4_64; - temp2 = step2[4] * cospi_4_64 + step2[7] * cospi_28_64; - step1[4] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[7] = WRAPLOW(dct_const_round_shift(temp2), 8); - temp1 = step2[5] * cospi_12_64 - step2[6] * cospi_20_64; - temp2 = step2[5] * cospi_20_64 + step2[6] * cospi_12_64; - step1[5] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[6] = WRAPLOW(dct_const_round_shift(temp2), 8); - - step1[8] = WRAPLOW(step2[8] + step2[9], 8); - step1[9] = WRAPLOW(step2[8] - step2[9], 8); - step1[10] = WRAPLOW(-step2[10] + step2[11], 8); - step1[11] = WRAPLOW(step2[10] + step2[11], 8); - step1[12] = WRAPLOW(step2[12] + step2[13], 8); - step1[13] = WRAPLOW(step2[12] - step2[13], 8); - step1[14] = WRAPLOW(-step2[14] + step2[15], 8); - step1[15] = WRAPLOW(step2[14] + step2[15], 8); - - step1[16] = step2[16]; - step1[31] = step2[31]; - temp1 = -step2[17] * cospi_4_64 + step2[30] * cospi_28_64; - temp2 = step2[17] * cospi_28_64 + step2[30] * cospi_4_64; - step1[17] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[30] = WRAPLOW(dct_const_round_shift(temp2), 8); - temp1 = -step2[18] * cospi_28_64 - step2[29] * cospi_4_64; - temp2 = -step2[18] * cospi_4_64 + step2[29] * cospi_28_64; - step1[18] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[29] = WRAPLOW(dct_const_round_shift(temp2), 8); - step1[19] = step2[19]; - step1[20] = step2[20]; - temp1 = -step2[21] * cospi_20_64 + step2[26] * cospi_12_64; - temp2 = step2[21] * cospi_12_64 + step2[26] * cospi_20_64; - step1[21] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[26] = WRAPLOW(dct_const_round_shift(temp2), 8); - temp1 = -step2[22] * cospi_12_64 - step2[25] * cospi_20_64; - temp2 = -step2[22] * cospi_20_64 + step2[25] * cospi_12_64; - step1[22] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[25] = WRAPLOW(dct_const_round_shift(temp2), 8); - step1[23] = step2[23]; - step1[24] = step2[24]; - step1[27] = step2[27]; - step1[28] = step2[28]; - - // stage 4 - temp1 = (step1[0] + step1[1]) * cospi_16_64; - temp2 = (step1[0] - step1[1]) * cospi_16_64; - step2[0] = WRAPLOW(dct_const_round_shift(temp1), 8); - step2[1] = WRAPLOW(dct_const_round_shift(temp2), 8); - temp1 = step1[2] * cospi_24_64 - step1[3] * cospi_8_64; - temp2 = step1[2] * cospi_8_64 + step1[3] * cospi_24_64; - step2[2] = WRAPLOW(dct_const_round_shift(temp1), 8); - step2[3] = WRAPLOW(dct_const_round_shift(temp2), 8); - step2[4] = WRAPLOW(step1[4] + step1[5], 8); - step2[5] = WRAPLOW(step1[4] - step1[5], 8); - step2[6] = WRAPLOW(-step1[6] + step1[7], 8); - step2[7] = WRAPLOW(step1[6] + step1[7], 8); - - step2[8] = step1[8]; - step2[15] = step1[15]; - temp1 = -step1[9] * cospi_8_64 + step1[14] * cospi_24_64; - temp2 = step1[9] * cospi_24_64 + step1[14] * cospi_8_64; - step2[9] = WRAPLOW(dct_const_round_shift(temp1), 8); - step2[14] = WRAPLOW(dct_const_round_shift(temp2), 8); - temp1 = -step1[10] * cospi_24_64 - step1[13] * cospi_8_64; - temp2 = -step1[10] * cospi_8_64 + step1[13] * cospi_24_64; - step2[10] = WRAPLOW(dct_const_round_shift(temp1), 8); - step2[13] = WRAPLOW(dct_const_round_shift(temp2), 8); - step2[11] = step1[11]; - step2[12] = step1[12]; - - step2[16] = WRAPLOW(step1[16] + step1[19], 8); - step2[17] = WRAPLOW(step1[17] + step1[18], 8); - step2[18] = WRAPLOW(step1[17] - step1[18], 8); - step2[19] = WRAPLOW(step1[16] - step1[19], 8); - step2[20] = WRAPLOW(-step1[20] + step1[23], 8); - step2[21] = WRAPLOW(-step1[21] + step1[22], 8); - step2[22] = WRAPLOW(step1[21] + step1[22], 8); - step2[23] = WRAPLOW(step1[20] + step1[23], 8); - - step2[24] = WRAPLOW(step1[24] + step1[27], 8); - step2[25] = WRAPLOW(step1[25] + step1[26], 8); - step2[26] = WRAPLOW(step1[25] - step1[26], 8); - step2[27] = WRAPLOW(step1[24] - step1[27], 8); - step2[28] = WRAPLOW(-step1[28] + step1[31], 8); - step2[29] = WRAPLOW(-step1[29] + step1[30], 8); - step2[30] = WRAPLOW(step1[29] + step1[30], 8); - step2[31] = WRAPLOW(step1[28] + step1[31], 8); - - // stage 5 - step1[0] = WRAPLOW(step2[0] + step2[3], 8); - step1[1] = WRAPLOW(step2[1] + step2[2], 8); - step1[2] = WRAPLOW(step2[1] - step2[2], 8); - step1[3] = WRAPLOW(step2[0] - step2[3], 8); - step1[4] = step2[4]; - temp1 = (step2[6] - step2[5]) * cospi_16_64; - temp2 = (step2[5] + step2[6]) * cospi_16_64; - step1[5] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[6] = WRAPLOW(dct_const_round_shift(temp2), 8); - step1[7] = step2[7]; - - step1[8] = WRAPLOW(step2[8] + step2[11], 8); - step1[9] = WRAPLOW(step2[9] + step2[10], 8); - step1[10] = WRAPLOW(step2[9] - step2[10], 8); - step1[11] = WRAPLOW(step2[8] - step2[11], 8); - step1[12] = WRAPLOW(-step2[12] + step2[15], 8); - step1[13] = WRAPLOW(-step2[13] + step2[14], 8); - step1[14] = WRAPLOW(step2[13] + step2[14], 8); - step1[15] = WRAPLOW(step2[12] + step2[15], 8); - - step1[16] = step2[16]; - step1[17] = step2[17]; - temp1 = -step2[18] * cospi_8_64 + step2[29] * cospi_24_64; - temp2 = step2[18] * cospi_24_64 + step2[29] * cospi_8_64; - step1[18] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[29] = WRAPLOW(dct_const_round_shift(temp2), 8); - temp1 = -step2[19] * cospi_8_64 + step2[28] * cospi_24_64; - temp2 = step2[19] * cospi_24_64 + step2[28] * cospi_8_64; - step1[19] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[28] = WRAPLOW(dct_const_round_shift(temp2), 8); - temp1 = -step2[20] * cospi_24_64 - step2[27] * cospi_8_64; - temp2 = -step2[20] * cospi_8_64 + step2[27] * cospi_24_64; - step1[20] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[27] = WRAPLOW(dct_const_round_shift(temp2), 8); - temp1 = -step2[21] * cospi_24_64 - step2[26] * cospi_8_64; - temp2 = -step2[21] * cospi_8_64 + step2[26] * cospi_24_64; - step1[21] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[26] = WRAPLOW(dct_const_round_shift(temp2), 8); - step1[22] = step2[22]; - step1[23] = step2[23]; - step1[24] = step2[24]; - step1[25] = step2[25]; - step1[30] = step2[30]; - step1[31] = step2[31]; - - // stage 6 - step2[0] = WRAPLOW(step1[0] + step1[7], 8); - step2[1] = WRAPLOW(step1[1] + step1[6], 8); - step2[2] = WRAPLOW(step1[2] + step1[5], 8); - step2[3] = WRAPLOW(step1[3] + step1[4], 8); - step2[4] = WRAPLOW(step1[3] - step1[4], 8); - step2[5] = WRAPLOW(step1[2] - step1[5], 8); - step2[6] = WRAPLOW(step1[1] - step1[6], 8); - step2[7] = WRAPLOW(step1[0] - step1[7], 8); - step2[8] = step1[8]; - step2[9] = step1[9]; - temp1 = (-step1[10] + step1[13]) * cospi_16_64; - temp2 = (step1[10] + step1[13]) * cospi_16_64; - step2[10] = WRAPLOW(dct_const_round_shift(temp1), 8); - step2[13] = WRAPLOW(dct_const_round_shift(temp2), 8); - temp1 = (-step1[11] + step1[12]) * cospi_16_64; - temp2 = (step1[11] + step1[12]) * cospi_16_64; - step2[11] = WRAPLOW(dct_const_round_shift(temp1), 8); - step2[12] = WRAPLOW(dct_const_round_shift(temp2), 8); - step2[14] = step1[14]; - step2[15] = step1[15]; - - step2[16] = WRAPLOW(step1[16] + step1[23], 8); - step2[17] = WRAPLOW(step1[17] + step1[22], 8); - step2[18] = WRAPLOW(step1[18] + step1[21], 8); - step2[19] = WRAPLOW(step1[19] + step1[20], 8); - step2[20] = WRAPLOW(step1[19] - step1[20], 8); - step2[21] = WRAPLOW(step1[18] - step1[21], 8); - step2[22] = WRAPLOW(step1[17] - step1[22], 8); - step2[23] = WRAPLOW(step1[16] - step1[23], 8); - - step2[24] = WRAPLOW(-step1[24] + step1[31], 8); - step2[25] = WRAPLOW(-step1[25] + step1[30], 8); - step2[26] = WRAPLOW(-step1[26] + step1[29], 8); - step2[27] = WRAPLOW(-step1[27] + step1[28], 8); - step2[28] = WRAPLOW(step1[27] + step1[28], 8); - step2[29] = WRAPLOW(step1[26] + step1[29], 8); - step2[30] = WRAPLOW(step1[25] + step1[30], 8); - step2[31] = WRAPLOW(step1[24] + step1[31], 8); - - // stage 7 - step1[0] = WRAPLOW(step2[0] + step2[15], 8); - step1[1] = WRAPLOW(step2[1] + step2[14], 8); - step1[2] = WRAPLOW(step2[2] + step2[13], 8); - step1[3] = WRAPLOW(step2[3] + step2[12], 8); - step1[4] = WRAPLOW(step2[4] + step2[11], 8); - step1[5] = WRAPLOW(step2[5] + step2[10], 8); - step1[6] = WRAPLOW(step2[6] + step2[9], 8); - step1[7] = WRAPLOW(step2[7] + step2[8], 8); - step1[8] = WRAPLOW(step2[7] - step2[8], 8); - step1[9] = WRAPLOW(step2[6] - step2[9], 8); - step1[10] = WRAPLOW(step2[5] - step2[10], 8); - step1[11] = WRAPLOW(step2[4] - step2[11], 8); - step1[12] = WRAPLOW(step2[3] - step2[12], 8); - step1[13] = WRAPLOW(step2[2] - step2[13], 8); - step1[14] = WRAPLOW(step2[1] - step2[14], 8); - step1[15] = WRAPLOW(step2[0] - step2[15], 8); - - step1[16] = step2[16]; - step1[17] = step2[17]; - step1[18] = step2[18]; - step1[19] = step2[19]; - temp1 = (-step2[20] + step2[27]) * cospi_16_64; - temp2 = (step2[20] + step2[27]) * cospi_16_64; - step1[20] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[27] = WRAPLOW(dct_const_round_shift(temp2), 8); - temp1 = (-step2[21] + step2[26]) * cospi_16_64; - temp2 = (step2[21] + step2[26]) * cospi_16_64; - step1[21] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[26] = WRAPLOW(dct_const_round_shift(temp2), 8); - temp1 = (-step2[22] + step2[25]) * cospi_16_64; - temp2 = (step2[22] + step2[25]) * cospi_16_64; - step1[22] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[25] = WRAPLOW(dct_const_round_shift(temp2), 8); - temp1 = (-step2[23] + step2[24]) * cospi_16_64; - temp2 = (step2[23] + step2[24]) * cospi_16_64; - step1[23] = WRAPLOW(dct_const_round_shift(temp1), 8); - step1[24] = WRAPLOW(dct_const_round_shift(temp2), 8); - step1[28] = step2[28]; - step1[29] = step2[29]; - step1[30] = step2[30]; - step1[31] = step2[31]; - - // final stage - output[0] = WRAPLOW(step1[0] + step1[31], 8); - output[1] = WRAPLOW(step1[1] + step1[30], 8); - output[2] = WRAPLOW(step1[2] + step1[29], 8); - output[3] = WRAPLOW(step1[3] + step1[28], 8); - output[4] = WRAPLOW(step1[4] + step1[27], 8); - output[5] = WRAPLOW(step1[5] + step1[26], 8); - output[6] = WRAPLOW(step1[6] + step1[25], 8); - output[7] = WRAPLOW(step1[7] + step1[24], 8); - output[8] = WRAPLOW(step1[8] + step1[23], 8); - output[9] = WRAPLOW(step1[9] + step1[22], 8); - output[10] = WRAPLOW(step1[10] + step1[21], 8); - output[11] = WRAPLOW(step1[11] + step1[20], 8); - output[12] = WRAPLOW(step1[12] + step1[19], 8); - output[13] = WRAPLOW(step1[13] + step1[18], 8); - output[14] = WRAPLOW(step1[14] + step1[17], 8); - output[15] = WRAPLOW(step1[15] + step1[16], 8); - output[16] = WRAPLOW(step1[15] - step1[16], 8); - output[17] = WRAPLOW(step1[14] - step1[17], 8); - output[18] = WRAPLOW(step1[13] - step1[18], 8); - output[19] = WRAPLOW(step1[12] - step1[19], 8); - output[20] = WRAPLOW(step1[11] - step1[20], 8); - output[21] = WRAPLOW(step1[10] - step1[21], 8); - output[22] = WRAPLOW(step1[9] - step1[22], 8); - output[23] = WRAPLOW(step1[8] - step1[23], 8); - output[24] = WRAPLOW(step1[7] - step1[24], 8); - output[25] = WRAPLOW(step1[6] - step1[25], 8); - output[26] = WRAPLOW(step1[5] - step1[26], 8); - output[27] = WRAPLOW(step1[4] - step1[27], 8); - output[28] = WRAPLOW(step1[3] - step1[28], 8); - output[29] = WRAPLOW(step1[2] - step1[29], 8); - output[30] = WRAPLOW(step1[1] - step1[30], 8); - output[31] = WRAPLOW(step1[0] - step1[31], 8); -} - -void vp9_idct32x32_1024_add_c(const tran_low_t *input, uint8_t *dest, - int stride) { - tran_low_t out[32 * 32]; - tran_low_t *outptr = out; - int i, j; - tran_low_t temp_in[32], temp_out[32]; - - // Rows - for (i = 0; i < 32; ++i) { - int16_t zero_coeff[16]; - for (j = 0; j < 16; ++j) - zero_coeff[j] = input[2 * j] | input[2 * j + 1]; - for (j = 0; j < 8; ++j) - zero_coeff[j] = zero_coeff[2 * j] | zero_coeff[2 * j + 1]; - for (j = 0; j < 4; ++j) - zero_coeff[j] = zero_coeff[2 * j] | zero_coeff[2 * j + 1]; - for (j = 0; j < 2; ++j) - zero_coeff[j] = zero_coeff[2 * j] | zero_coeff[2 * j + 1]; - - if (zero_coeff[0] | zero_coeff[1]) - idct32(input, outptr); - else - vpx_memset(outptr, 0, sizeof(tran_low_t) * 32); - input += 32; - outptr += 32; - } - - // Columns - for (i = 0; i < 32; ++i) { - for (j = 0; j < 32; ++j) - temp_in[j] = out[j * 32 + i]; - idct32(temp_in, temp_out); - for (j = 0; j < 32; ++j) { - dest[j * stride + i] = clip_pixel_add(dest[j * stride + i], - ROUND_POWER_OF_TWO(temp_out[j], 6)); - } - } -} - -void vp9_idct32x32_34_add_c(const tran_low_t *input, uint8_t *dest, - int stride) { - tran_low_t out[32 * 32] = {0}; - tran_low_t *outptr = out; - int i, j; - tran_low_t temp_in[32], temp_out[32]; - - // Rows - // only upper-left 8x8 has non-zero coeff - for (i = 0; i < 8; ++i) { - idct32(input, outptr); - input += 32; - outptr += 32; - } - - // Columns - for (i = 0; i < 32; ++i) { - for (j = 0; j < 32; ++j) - temp_in[j] = out[j * 32 + i]; - idct32(temp_in, temp_out); - for (j = 0; j < 32; ++j) { - dest[j * stride + i] = clip_pixel_add(dest[j * stride + i], - ROUND_POWER_OF_TWO(temp_out[j], 6)); - } - } -} - -void vp9_idct32x32_1_add_c(const tran_low_t *input, uint8_t *dest, int stride) { - int i, j; - tran_high_t a1; - - tran_low_t out = WRAPLOW(dct_const_round_shift(input[0] * cospi_16_64), 8); - out = WRAPLOW(dct_const_round_shift(out * cospi_16_64), 8); - a1 = ROUND_POWER_OF_TWO(out, 6); - - for (j = 0; j < 32; ++j) { - for (i = 0; i < 32; ++i) - dest[i] = clip_pixel_add(dest[i], a1); - dest += stride; - } -} - -// idct -void vp9_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride, - int eob) { - if (eob > 1) - vp9_idct4x4_16_add(input, dest, stride); - else - vp9_idct4x4_1_add(input, dest, stride); -} - - -void vp9_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride, - int eob) { - if (eob > 1) - vp9_iwht4x4_16_add(input, dest, stride); - else - vp9_iwht4x4_1_add(input, dest, stride); -} - -void vp9_idct8x8_add(const tran_low_t *input, uint8_t *dest, int stride, - int eob) { - // If dc is 1, then input[0] is the reconstructed value, do not need - // dequantization. Also, when dc is 1, dc is counted in eobs, namely eobs >=1. - - // The calculation can be simplified if there are not many non-zero dct - // coefficients. Use eobs to decide what to do. - // TODO(yunqingwang): "eobs = 1" case is also handled in vp9_short_idct8x8_c. - // Combine that with code here. - if (eob == 1) - // DC only DCT coefficient - vp9_idct8x8_1_add(input, dest, stride); - else if (eob <= 12) - vp9_idct8x8_12_add(input, dest, stride); - else - vp9_idct8x8_64_add(input, dest, stride); -} - -void vp9_idct16x16_add(const tran_low_t *input, uint8_t *dest, int stride, - int eob) { - /* The calculation can be simplified if there are not many non-zero dct - * coefficients. Use eobs to separate different cases. */ - if (eob == 1) - /* DC only DCT coefficient. */ - vp9_idct16x16_1_add(input, dest, stride); - else if (eob <= 10) - vp9_idct16x16_10_add(input, dest, stride); - else - vp9_idct16x16_256_add(input, dest, stride); -} - -void vp9_idct32x32_add(const tran_low_t *input, uint8_t *dest, int stride, - int eob) { - if (eob == 1) - vp9_idct32x32_1_add(input, dest, stride); - else if (eob <= 34) - // non-zero coeff only in upper-left 8x8 - vp9_idct32x32_34_add(input, dest, stride); - else - vp9_idct32x32_1024_add(input, dest, stride); -} - -// iht -void vp9_iht4x4_add(TX_TYPE tx_type, const tran_low_t *input, uint8_t *dest, - int stride, int eob) { - if (tx_type == DCT_DCT) - vp9_idct4x4_add(input, dest, stride, eob); - else - vp9_iht4x4_16_add(input, dest, stride, tx_type); -} - -void vp9_iht8x8_add(TX_TYPE tx_type, const tran_low_t *input, uint8_t *dest, - int stride, int eob) { - if (tx_type == DCT_DCT) { - vp9_idct8x8_add(input, dest, stride, eob); - } else { - vp9_iht8x8_64_add(input, dest, stride, tx_type); - } -} - -void vp9_iht16x16_add(TX_TYPE tx_type, const tran_low_t *input, uint8_t *dest, - int stride, int eob) { - if (tx_type == DCT_DCT) { - vp9_idct16x16_add(input, dest, stride, eob); - } else { - vp9_iht16x16_256_add(input, dest, stride, tx_type); - } -} - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_highbd_iwht4x4_16_add_c(const tran_low_t *input, uint8_t *dest8, - int stride, int bd) { - /* 4-point reversible, orthonormal inverse Walsh-Hadamard in 3.5 adds, - 0.5 shifts per pixel. */ - int i; - tran_low_t output[16]; - tran_high_t a1, b1, c1, d1, e1; - const tran_low_t *ip = input; - tran_low_t *op = output; - uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); - - for (i = 0; i < 4; i++) { - a1 = ip[0] >> UNIT_QUANT_SHIFT; - c1 = ip[1] >> UNIT_QUANT_SHIFT; - d1 = ip[2] >> UNIT_QUANT_SHIFT; - b1 = ip[3] >> UNIT_QUANT_SHIFT; - a1 += c1; - d1 -= b1; - e1 = (a1 - d1) >> 1; - b1 = e1 - b1; - c1 = e1 - c1; - a1 -= b1; - d1 += c1; - op[0] = WRAPLOW(a1, bd); - op[1] = WRAPLOW(b1, bd); - op[2] = WRAPLOW(c1, bd); - op[3] = WRAPLOW(d1, bd); - ip += 4; - op += 4; - } - - ip = output; - for (i = 0; i < 4; i++) { - a1 = ip[4 * 0]; - c1 = ip[4 * 1]; - d1 = ip[4 * 2]; - b1 = ip[4 * 3]; - a1 += c1; - d1 -= b1; - e1 = (a1 - d1) >> 1; - b1 = e1 - b1; - c1 = e1 - c1; - a1 -= b1; - d1 += c1; - dest[stride * 0] = highbd_clip_pixel_add(dest[stride * 0], a1, bd); - dest[stride * 1] = highbd_clip_pixel_add(dest[stride * 1], b1, bd); - dest[stride * 2] = highbd_clip_pixel_add(dest[stride * 2], c1, bd); - dest[stride * 3] = highbd_clip_pixel_add(dest[stride * 3], d1, bd); - - ip++; - dest++; - } -} - -void vp9_highbd_iwht4x4_1_add_c(const tran_low_t *in, uint8_t *dest8, - int dest_stride, int bd) { - int i; - tran_high_t a1, e1; - tran_low_t tmp[4]; - const tran_low_t *ip = in; - tran_low_t *op = tmp; - uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); - (void) bd; - - a1 = ip[0] >> UNIT_QUANT_SHIFT; - e1 = a1 >> 1; - a1 -= e1; - op[0] = WRAPLOW(a1, bd); - op[1] = op[2] = op[3] = WRAPLOW(e1, bd); - - ip = tmp; - for (i = 0; i < 4; i++) { - e1 = ip[0] >> 1; - a1 = ip[0] - e1; - dest[dest_stride * 0] = highbd_clip_pixel_add( - dest[dest_stride * 0], a1, bd); - dest[dest_stride * 1] = highbd_clip_pixel_add( - dest[dest_stride * 1], e1, bd); - dest[dest_stride * 2] = highbd_clip_pixel_add( - dest[dest_stride * 2], e1, bd); - dest[dest_stride * 3] = highbd_clip_pixel_add( - dest[dest_stride * 3], e1, bd); - ip++; - dest++; - } -} - -void vp9_highbd_idct4(const tran_low_t *input, tran_low_t *output, int bd) { - tran_low_t step[4]; - tran_high_t temp1, temp2; - (void) bd; - // stage 1 - temp1 = (input[0] + input[2]) * cospi_16_64; - temp2 = (input[0] - input[2]) * cospi_16_64; - step[0] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step[1] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - temp1 = input[1] * cospi_24_64 - input[3] * cospi_8_64; - temp2 = input[1] * cospi_8_64 + input[3] * cospi_24_64; - step[2] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step[3] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - - // stage 2 - output[0] = WRAPLOW(step[0] + step[3], bd); - output[1] = WRAPLOW(step[1] + step[2], bd); - output[2] = WRAPLOW(step[1] - step[2], bd); - output[3] = WRAPLOW(step[0] - step[3], bd); -} - -void vp9_highbd_idct4x4_16_add_c(const tran_low_t *input, uint8_t *dest8, - int stride, int bd) { - tran_low_t out[4 * 4]; - tran_low_t *outptr = out; - int i, j; - tran_low_t temp_in[4], temp_out[4]; - uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); - - // Rows - for (i = 0; i < 4; ++i) { - vp9_highbd_idct4(input, outptr, bd); - input += 4; - outptr += 4; - } - - // Columns - for (i = 0; i < 4; ++i) { - for (j = 0; j < 4; ++j) - temp_in[j] = out[j * 4 + i]; - vp9_highbd_idct4(temp_in, temp_out, bd); - for (j = 0; j < 4; ++j) { - dest[j * stride + i] = highbd_clip_pixel_add( - dest[j * stride + i], ROUND_POWER_OF_TWO(temp_out[j], 4), bd); - } - } -} - -void vp9_highbd_idct4x4_1_add_c(const tran_low_t *input, uint8_t *dest8, - int dest_stride, int bd) { - int i; - tran_high_t a1; - tran_low_t out = WRAPLOW( - highbd_dct_const_round_shift(input[0] * cospi_16_64, bd), bd); - uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); - - out = WRAPLOW(highbd_dct_const_round_shift(out * cospi_16_64, bd), bd); - a1 = ROUND_POWER_OF_TWO(out, 4); - - for (i = 0; i < 4; i++) { - dest[0] = highbd_clip_pixel_add(dest[0], a1, bd); - dest[1] = highbd_clip_pixel_add(dest[1], a1, bd); - dest[2] = highbd_clip_pixel_add(dest[2], a1, bd); - dest[3] = highbd_clip_pixel_add(dest[3], a1, bd); - dest += dest_stride; - } -} - -void vp9_highbd_idct8(const tran_low_t *input, tran_low_t *output, int bd) { - tran_low_t step1[8], step2[8]; - tran_high_t temp1, temp2; - // stage 1 - step1[0] = input[0]; - step1[2] = input[4]; - step1[1] = input[2]; - step1[3] = input[6]; - temp1 = input[1] * cospi_28_64 - input[7] * cospi_4_64; - temp2 = input[1] * cospi_4_64 + input[7] * cospi_28_64; - step1[4] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[7] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - temp1 = input[5] * cospi_12_64 - input[3] * cospi_20_64; - temp2 = input[5] * cospi_20_64 + input[3] * cospi_12_64; - step1[5] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[6] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - - // stage 2 & stage 3 - even half - vp9_highbd_idct4(step1, step1, bd); - - // stage 2 - odd half - step2[4] = WRAPLOW(step1[4] + step1[5], bd); - step2[5] = WRAPLOW(step1[4] - step1[5], bd); - step2[6] = WRAPLOW(-step1[6] + step1[7], bd); - step2[7] = WRAPLOW(step1[6] + step1[7], bd); - - // stage 3 - odd half - step1[4] = step2[4]; - temp1 = (step2[6] - step2[5]) * cospi_16_64; - temp2 = (step2[5] + step2[6]) * cospi_16_64; - step1[5] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[6] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - step1[7] = step2[7]; - - // stage 4 - output[0] = WRAPLOW(step1[0] + step1[7], bd); - output[1] = WRAPLOW(step1[1] + step1[6], bd); - output[2] = WRAPLOW(step1[2] + step1[5], bd); - output[3] = WRAPLOW(step1[3] + step1[4], bd); - output[4] = WRAPLOW(step1[3] - step1[4], bd); - output[5] = WRAPLOW(step1[2] - step1[5], bd); - output[6] = WRAPLOW(step1[1] - step1[6], bd); - output[7] = WRAPLOW(step1[0] - step1[7], bd); -} - -void vp9_highbd_idct8x8_64_add_c(const tran_low_t *input, uint8_t *dest8, - int stride, int bd) { - tran_low_t out[8 * 8]; - tran_low_t *outptr = out; - int i, j; - tran_low_t temp_in[8], temp_out[8]; - uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); - - // First transform rows. - for (i = 0; i < 8; ++i) { - vp9_highbd_idct8(input, outptr, bd); - input += 8; - outptr += 8; - } - - // Then transform columns. - for (i = 0; i < 8; ++i) { - for (j = 0; j < 8; ++j) - temp_in[j] = out[j * 8 + i]; - vp9_highbd_idct8(temp_in, temp_out, bd); - for (j = 0; j < 8; ++j) { - dest[j * stride + i] = highbd_clip_pixel_add( - dest[j * stride + i], ROUND_POWER_OF_TWO(temp_out[j], 5), bd); - } - } -} - -void vp9_highbd_idct8x8_1_add_c(const tran_low_t *input, uint8_t *dest8, - int stride, int bd) { - int i, j; - tran_high_t a1; - tran_low_t out = WRAPLOW( - highbd_dct_const_round_shift(input[0] * cospi_16_64, bd), bd); - uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); - out = WRAPLOW(highbd_dct_const_round_shift(out * cospi_16_64, bd), bd); - a1 = ROUND_POWER_OF_TWO(out, 5); - for (j = 0; j < 8; ++j) { - for (i = 0; i < 8; ++i) - dest[i] = highbd_clip_pixel_add(dest[i], a1, bd); - dest += stride; - } -} - -static void highbd_iadst4(const tran_low_t *input, tran_low_t *output, int bd) { - tran_high_t s0, s1, s2, s3, s4, s5, s6, s7; - - tran_low_t x0 = input[0]; - tran_low_t x1 = input[1]; - tran_low_t x2 = input[2]; - tran_low_t x3 = input[3]; - (void) bd; - - if (!(x0 | x1 | x2 | x3)) { - vpx_memset(output, 0, 4 * sizeof(*output)); - return; - } - - s0 = sinpi_1_9 * x0; - s1 = sinpi_2_9 * x0; - s2 = sinpi_3_9 * x1; - s3 = sinpi_4_9 * x2; - s4 = sinpi_1_9 * x2; - s5 = sinpi_2_9 * x3; - s6 = sinpi_4_9 * x3; - s7 = (tran_high_t)(x0 - x2 + x3); - - s0 = s0 + s3 + s5; - s1 = s1 - s4 - s6; - s3 = s2; - s2 = sinpi_3_9 * s7; - - // 1-D transform scaling factor is sqrt(2). - // The overall dynamic range is 14b (input) + 14b (multiplication scaling) - // + 1b (addition) = 29b. - // Hence the output bit depth is 15b. - output[0] = WRAPLOW(highbd_dct_const_round_shift(s0 + s3, bd), bd); - output[1] = WRAPLOW(highbd_dct_const_round_shift(s1 + s3, bd), bd); - output[2] = WRAPLOW(highbd_dct_const_round_shift(s2, bd), bd); - output[3] = WRAPLOW(highbd_dct_const_round_shift(s0 + s1 - s3, bd), bd); -} - -void vp9_highbd_iht4x4_16_add_c(const tran_low_t *input, uint8_t *dest8, - int stride, int tx_type, int bd) { - const highbd_transform_2d IHT_4[] = { - { vp9_highbd_idct4, vp9_highbd_idct4 }, // DCT_DCT = 0 - { highbd_iadst4, vp9_highbd_idct4 }, // ADST_DCT = 1 - { vp9_highbd_idct4, highbd_iadst4 }, // DCT_ADST = 2 - { highbd_iadst4, highbd_iadst4 } // ADST_ADST = 3 - }; - uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); - - int i, j; - tran_low_t out[4 * 4]; - tran_low_t *outptr = out; - tran_low_t temp_in[4], temp_out[4]; - - // Inverse transform row vectors. - for (i = 0; i < 4; ++i) { - IHT_4[tx_type].rows(input, outptr, bd); - input += 4; - outptr += 4; - } - - // Inverse transform column vectors. - for (i = 0; i < 4; ++i) { - for (j = 0; j < 4; ++j) - temp_in[j] = out[j * 4 + i]; - IHT_4[tx_type].cols(temp_in, temp_out, bd); - for (j = 0; j < 4; ++j) { - dest[j * stride + i] = highbd_clip_pixel_add( - dest[j * stride + i], ROUND_POWER_OF_TWO(temp_out[j], 4), bd); - } - } -} - -static void highbd_iadst8(const tran_low_t *input, tran_low_t *output, int bd) { - tran_high_t s0, s1, s2, s3, s4, s5, s6, s7; - - tran_low_t x0 = input[7]; - tran_low_t x1 = input[0]; - tran_low_t x2 = input[5]; - tran_low_t x3 = input[2]; - tran_low_t x4 = input[3]; - tran_low_t x5 = input[4]; - tran_low_t x6 = input[1]; - tran_low_t x7 = input[6]; - (void) bd; - - if (!(x0 | x1 | x2 | x3 | x4 | x5 | x6 | x7)) { - vpx_memset(output, 0, 8 * sizeof(*output)); - return; - } - - // stage 1 - s0 = cospi_2_64 * x0 + cospi_30_64 * x1; - s1 = cospi_30_64 * x0 - cospi_2_64 * x1; - s2 = cospi_10_64 * x2 + cospi_22_64 * x3; - s3 = cospi_22_64 * x2 - cospi_10_64 * x3; - s4 = cospi_18_64 * x4 + cospi_14_64 * x5; - s5 = cospi_14_64 * x4 - cospi_18_64 * x5; - s6 = cospi_26_64 * x6 + cospi_6_64 * x7; - s7 = cospi_6_64 * x6 - cospi_26_64 * x7; - - x0 = WRAPLOW(highbd_dct_const_round_shift(s0 + s4, bd), bd); - x1 = WRAPLOW(highbd_dct_const_round_shift(s1 + s5, bd), bd); - x2 = WRAPLOW(highbd_dct_const_round_shift(s2 + s6, bd), bd); - x3 = WRAPLOW(highbd_dct_const_round_shift(s3 + s7, bd), bd); - x4 = WRAPLOW(highbd_dct_const_round_shift(s0 - s4, bd), bd); - x5 = WRAPLOW(highbd_dct_const_round_shift(s1 - s5, bd), bd); - x6 = WRAPLOW(highbd_dct_const_round_shift(s2 - s6, bd), bd); - x7 = WRAPLOW(highbd_dct_const_round_shift(s3 - s7, bd), bd); - - // stage 2 - s0 = x0; - s1 = x1; - s2 = x2; - s3 = x3; - s4 = cospi_8_64 * x4 + cospi_24_64 * x5; - s5 = cospi_24_64 * x4 - cospi_8_64 * x5; - s6 = -cospi_24_64 * x6 + cospi_8_64 * x7; - s7 = cospi_8_64 * x6 + cospi_24_64 * x7; - - x0 = WRAPLOW(s0 + s2, bd); - x1 = WRAPLOW(s1 + s3, bd); - x2 = WRAPLOW(s0 - s2, bd); - x3 = WRAPLOW(s1 - s3, bd); - x4 = WRAPLOW(highbd_dct_const_round_shift(s4 + s6, bd), bd); - x5 = WRAPLOW(highbd_dct_const_round_shift(s5 + s7, bd), bd); - x6 = WRAPLOW(highbd_dct_const_round_shift(s4 - s6, bd), bd); - x7 = WRAPLOW(highbd_dct_const_round_shift(s5 - s7, bd), bd); - - // stage 3 - s2 = cospi_16_64 * (x2 + x3); - s3 = cospi_16_64 * (x2 - x3); - s6 = cospi_16_64 * (x6 + x7); - s7 = cospi_16_64 * (x6 - x7); - - x2 = WRAPLOW(highbd_dct_const_round_shift(s2, bd), bd); - x3 = WRAPLOW(highbd_dct_const_round_shift(s3, bd), bd); - x6 = WRAPLOW(highbd_dct_const_round_shift(s6, bd), bd); - x7 = WRAPLOW(highbd_dct_const_round_shift(s7, bd), bd); - - output[0] = WRAPLOW(x0, bd); - output[1] = WRAPLOW(-x4, bd); - output[2] = WRAPLOW(x6, bd); - output[3] = WRAPLOW(-x2, bd); - output[4] = WRAPLOW(x3, bd); - output[5] = WRAPLOW(-x7, bd); - output[6] = WRAPLOW(x5, bd); - output[7] = WRAPLOW(-x1, bd); -} - -static const highbd_transform_2d HIGH_IHT_8[] = { - { vp9_highbd_idct8, vp9_highbd_idct8 }, // DCT_DCT = 0 - { highbd_iadst8, vp9_highbd_idct8 }, // ADST_DCT = 1 - { vp9_highbd_idct8, highbd_iadst8 }, // DCT_ADST = 2 - { highbd_iadst8, highbd_iadst8 } // ADST_ADST = 3 -}; - -void vp9_highbd_iht8x8_64_add_c(const tran_low_t *input, uint8_t *dest8, - int stride, int tx_type, int bd) { - int i, j; - tran_low_t out[8 * 8]; - tran_low_t *outptr = out; - tran_low_t temp_in[8], temp_out[8]; - const highbd_transform_2d ht = HIGH_IHT_8[tx_type]; - uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); - - // Inverse transform row vectors. - for (i = 0; i < 8; ++i) { - ht.rows(input, outptr, bd); - input += 8; - outptr += 8; - } - - // Inverse transform column vectors. - for (i = 0; i < 8; ++i) { - for (j = 0; j < 8; ++j) - temp_in[j] = out[j * 8 + i]; - ht.cols(temp_in, temp_out, bd); - for (j = 0; j < 8; ++j) { - dest[j * stride + i] = highbd_clip_pixel_add( - dest[j * stride + i], ROUND_POWER_OF_TWO(temp_out[j], 5), bd); - } - } -} - -void vp9_highbd_idct8x8_10_add_c(const tran_low_t *input, uint8_t *dest8, - int stride, int bd) { - tran_low_t out[8 * 8] = { 0 }; - tran_low_t *outptr = out; - int i, j; - tran_low_t temp_in[8], temp_out[8]; - uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); - - // First transform rows. - // Only first 4 row has non-zero coefs. - for (i = 0; i < 4; ++i) { - vp9_highbd_idct8(input, outptr, bd); - input += 8; - outptr += 8; - } - // Then transform columns. - for (i = 0; i < 8; ++i) { - for (j = 0; j < 8; ++j) - temp_in[j] = out[j * 8 + i]; - vp9_highbd_idct8(temp_in, temp_out, bd); - for (j = 0; j < 8; ++j) { - dest[j * stride + i] = highbd_clip_pixel_add( - dest[j * stride + i], ROUND_POWER_OF_TWO(temp_out[j], 5), bd); - } - } -} - -void vp9_highbd_idct16(const tran_low_t *input, tran_low_t *output, int bd) { - tran_low_t step1[16], step2[16]; - tran_high_t temp1, temp2; - (void) bd; - - // stage 1 - step1[0] = input[0/2]; - step1[1] = input[16/2]; - step1[2] = input[8/2]; - step1[3] = input[24/2]; - step1[4] = input[4/2]; - step1[5] = input[20/2]; - step1[6] = input[12/2]; - step1[7] = input[28/2]; - step1[8] = input[2/2]; - step1[9] = input[18/2]; - step1[10] = input[10/2]; - step1[11] = input[26/2]; - step1[12] = input[6/2]; - step1[13] = input[22/2]; - step1[14] = input[14/2]; - step1[15] = input[30/2]; - - // stage 2 - step2[0] = step1[0]; - step2[1] = step1[1]; - step2[2] = step1[2]; - step2[3] = step1[3]; - step2[4] = step1[4]; - step2[5] = step1[5]; - step2[6] = step1[6]; - step2[7] = step1[7]; - - temp1 = step1[8] * cospi_30_64 - step1[15] * cospi_2_64; - temp2 = step1[8] * cospi_2_64 + step1[15] * cospi_30_64; - step2[8] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step2[15] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - - temp1 = step1[9] * cospi_14_64 - step1[14] * cospi_18_64; - temp2 = step1[9] * cospi_18_64 + step1[14] * cospi_14_64; - step2[9] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step2[14] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - - temp1 = step1[10] * cospi_22_64 - step1[13] * cospi_10_64; - temp2 = step1[10] * cospi_10_64 + step1[13] * cospi_22_64; - step2[10] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step2[13] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - - temp1 = step1[11] * cospi_6_64 - step1[12] * cospi_26_64; - temp2 = step1[11] * cospi_26_64 + step1[12] * cospi_6_64; - step2[11] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step2[12] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - - // stage 3 - step1[0] = step2[0]; - step1[1] = step2[1]; - step1[2] = step2[2]; - step1[3] = step2[3]; - - temp1 = step2[4] * cospi_28_64 - step2[7] * cospi_4_64; - temp2 = step2[4] * cospi_4_64 + step2[7] * cospi_28_64; - step1[4] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[7] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - temp1 = step2[5] * cospi_12_64 - step2[6] * cospi_20_64; - temp2 = step2[5] * cospi_20_64 + step2[6] * cospi_12_64; - step1[5] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[6] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - - step1[8] = WRAPLOW(step2[8] + step2[9], bd); - step1[9] = WRAPLOW(step2[8] - step2[9], bd); - step1[10] = WRAPLOW(-step2[10] + step2[11], bd); - step1[11] = WRAPLOW(step2[10] + step2[11], bd); - step1[12] = WRAPLOW(step2[12] + step2[13], bd); - step1[13] = WRAPLOW(step2[12] - step2[13], bd); - step1[14] = WRAPLOW(-step2[14] + step2[15], bd); - step1[15] = WRAPLOW(step2[14] + step2[15], bd); - - // stage 4 - temp1 = (step1[0] + step1[1]) * cospi_16_64; - temp2 = (step1[0] - step1[1]) * cospi_16_64; - step2[0] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step2[1] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - temp1 = step1[2] * cospi_24_64 - step1[3] * cospi_8_64; - temp2 = step1[2] * cospi_8_64 + step1[3] * cospi_24_64; - step2[2] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step2[3] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - step2[4] = WRAPLOW(step1[4] + step1[5], bd); - step2[5] = WRAPLOW(step1[4] - step1[5], bd); - step2[6] = WRAPLOW(-step1[6] + step1[7], bd); - step2[7] = WRAPLOW(step1[6] + step1[7], bd); - - step2[8] = step1[8]; - step2[15] = step1[15]; - temp1 = -step1[9] * cospi_8_64 + step1[14] * cospi_24_64; - temp2 = step1[9] * cospi_24_64 + step1[14] * cospi_8_64; - step2[9] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step2[14] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - temp1 = -step1[10] * cospi_24_64 - step1[13] * cospi_8_64; - temp2 = -step1[10] * cospi_8_64 + step1[13] * cospi_24_64; - step2[10] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step2[13] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - step2[11] = step1[11]; - step2[12] = step1[12]; - - // stage 5 - step1[0] = WRAPLOW(step2[0] + step2[3], bd); - step1[1] = WRAPLOW(step2[1] + step2[2], bd); - step1[2] = WRAPLOW(step2[1] - step2[2], bd); - step1[3] = WRAPLOW(step2[0] - step2[3], bd); - step1[4] = step2[4]; - temp1 = (step2[6] - step2[5]) * cospi_16_64; - temp2 = (step2[5] + step2[6]) * cospi_16_64; - step1[5] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[6] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - step1[7] = step2[7]; - - step1[8] = WRAPLOW(step2[8] + step2[11], bd); - step1[9] = WRAPLOW(step2[9] + step2[10], bd); - step1[10] = WRAPLOW(step2[9] - step2[10], bd); - step1[11] = WRAPLOW(step2[8] - step2[11], bd); - step1[12] = WRAPLOW(-step2[12] + step2[15], bd); - step1[13] = WRAPLOW(-step2[13] + step2[14], bd); - step1[14] = WRAPLOW(step2[13] + step2[14], bd); - step1[15] = WRAPLOW(step2[12] + step2[15], bd); - - // stage 6 - step2[0] = WRAPLOW(step1[0] + step1[7], bd); - step2[1] = WRAPLOW(step1[1] + step1[6], bd); - step2[2] = WRAPLOW(step1[2] + step1[5], bd); - step2[3] = WRAPLOW(step1[3] + step1[4], bd); - step2[4] = WRAPLOW(step1[3] - step1[4], bd); - step2[5] = WRAPLOW(step1[2] - step1[5], bd); - step2[6] = WRAPLOW(step1[1] - step1[6], bd); - step2[7] = WRAPLOW(step1[0] - step1[7], bd); - step2[8] = step1[8]; - step2[9] = step1[9]; - temp1 = (-step1[10] + step1[13]) * cospi_16_64; - temp2 = (step1[10] + step1[13]) * cospi_16_64; - step2[10] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step2[13] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - temp1 = (-step1[11] + step1[12]) * cospi_16_64; - temp2 = (step1[11] + step1[12]) * cospi_16_64; - step2[11] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step2[12] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - step2[14] = step1[14]; - step2[15] = step1[15]; - - // stage 7 - output[0] = WRAPLOW(step2[0] + step2[15], bd); - output[1] = WRAPLOW(step2[1] + step2[14], bd); - output[2] = WRAPLOW(step2[2] + step2[13], bd); - output[3] = WRAPLOW(step2[3] + step2[12], bd); - output[4] = WRAPLOW(step2[4] + step2[11], bd); - output[5] = WRAPLOW(step2[5] + step2[10], bd); - output[6] = WRAPLOW(step2[6] + step2[9], bd); - output[7] = WRAPLOW(step2[7] + step2[8], bd); - output[8] = WRAPLOW(step2[7] - step2[8], bd); - output[9] = WRAPLOW(step2[6] - step2[9], bd); - output[10] = WRAPLOW(step2[5] - step2[10], bd); - output[11] = WRAPLOW(step2[4] - step2[11], bd); - output[12] = WRAPLOW(step2[3] - step2[12], bd); - output[13] = WRAPLOW(step2[2] - step2[13], bd); - output[14] = WRAPLOW(step2[1] - step2[14], bd); - output[15] = WRAPLOW(step2[0] - step2[15], bd); -} - -void vp9_highbd_idct16x16_256_add_c(const tran_low_t *input, uint8_t *dest8, - int stride, int bd) { - tran_low_t out[16 * 16]; - tran_low_t *outptr = out; - int i, j; - tran_low_t temp_in[16], temp_out[16]; - uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); - - // First transform rows. - for (i = 0; i < 16; ++i) { - vp9_highbd_idct16(input, outptr, bd); - input += 16; - outptr += 16; - } - - // Then transform columns. - for (i = 0; i < 16; ++i) { - for (j = 0; j < 16; ++j) - temp_in[j] = out[j * 16 + i]; - vp9_highbd_idct16(temp_in, temp_out, bd); - for (j = 0; j < 16; ++j) { - dest[j * stride + i] = highbd_clip_pixel_add( - dest[j * stride + i], ROUND_POWER_OF_TWO(temp_out[j], 6), bd); - } - } -} - -static void highbd_iadst16(const tran_low_t *input, tran_low_t *output, - int bd) { - tran_high_t s0, s1, s2, s3, s4, s5, s6, s7, s8; - tran_high_t s9, s10, s11, s12, s13, s14, s15; - - tran_low_t x0 = input[15]; - tran_low_t x1 = input[0]; - tran_low_t x2 = input[13]; - tran_low_t x3 = input[2]; - tran_low_t x4 = input[11]; - tran_low_t x5 = input[4]; - tran_low_t x6 = input[9]; - tran_low_t x7 = input[6]; - tran_low_t x8 = input[7]; - tran_low_t x9 = input[8]; - tran_low_t x10 = input[5]; - tran_low_t x11 = input[10]; - tran_low_t x12 = input[3]; - tran_low_t x13 = input[12]; - tran_low_t x14 = input[1]; - tran_low_t x15 = input[14]; - (void) bd; - - if (!(x0 | x1 | x2 | x3 | x4 | x5 | x6 | x7 | x8 - | x9 | x10 | x11 | x12 | x13 | x14 | x15)) { - vpx_memset(output, 0, 16 * sizeof(*output)); - return; - } - - // stage 1 - s0 = x0 * cospi_1_64 + x1 * cospi_31_64; - s1 = x0 * cospi_31_64 - x1 * cospi_1_64; - s2 = x2 * cospi_5_64 + x3 * cospi_27_64; - s3 = x2 * cospi_27_64 - x3 * cospi_5_64; - s4 = x4 * cospi_9_64 + x5 * cospi_23_64; - s5 = x4 * cospi_23_64 - x5 * cospi_9_64; - s6 = x6 * cospi_13_64 + x7 * cospi_19_64; - s7 = x6 * cospi_19_64 - x7 * cospi_13_64; - s8 = x8 * cospi_17_64 + x9 * cospi_15_64; - s9 = x8 * cospi_15_64 - x9 * cospi_17_64; - s10 = x10 * cospi_21_64 + x11 * cospi_11_64; - s11 = x10 * cospi_11_64 - x11 * cospi_21_64; - s12 = x12 * cospi_25_64 + x13 * cospi_7_64; - s13 = x12 * cospi_7_64 - x13 * cospi_25_64; - s14 = x14 * cospi_29_64 + x15 * cospi_3_64; - s15 = x14 * cospi_3_64 - x15 * cospi_29_64; - - x0 = WRAPLOW(highbd_dct_const_round_shift(s0 + s8, bd), bd); - x1 = WRAPLOW(highbd_dct_const_round_shift(s1 + s9, bd), bd); - x2 = WRAPLOW(highbd_dct_const_round_shift(s2 + s10, bd), bd); - x3 = WRAPLOW(highbd_dct_const_round_shift(s3 + s11, bd), bd); - x4 = WRAPLOW(highbd_dct_const_round_shift(s4 + s12, bd), bd); - x5 = WRAPLOW(highbd_dct_const_round_shift(s5 + s13, bd), bd); - x6 = WRAPLOW(highbd_dct_const_round_shift(s6 + s14, bd), bd); - x7 = WRAPLOW(highbd_dct_const_round_shift(s7 + s15, bd), bd); - x8 = WRAPLOW(highbd_dct_const_round_shift(s0 - s8, bd), bd); - x9 = WRAPLOW(highbd_dct_const_round_shift(s1 - s9, bd), bd); - x10 = WRAPLOW(highbd_dct_const_round_shift(s2 - s10, bd), bd); - x11 = WRAPLOW(highbd_dct_const_round_shift(s3 - s11, bd), bd); - x12 = WRAPLOW(highbd_dct_const_round_shift(s4 - s12, bd), bd); - x13 = WRAPLOW(highbd_dct_const_round_shift(s5 - s13, bd), bd); - x14 = WRAPLOW(highbd_dct_const_round_shift(s6 - s14, bd), bd); - x15 = WRAPLOW(highbd_dct_const_round_shift(s7 - s15, bd), bd); - - // stage 2 - s0 = x0; - s1 = x1; - s2 = x2; - s3 = x3; - s4 = x4; - s5 = x5; - s6 = x6; - s7 = x7; - s8 = x8 * cospi_4_64 + x9 * cospi_28_64; - s9 = x8 * cospi_28_64 - x9 * cospi_4_64; - s10 = x10 * cospi_20_64 + x11 * cospi_12_64; - s11 = x10 * cospi_12_64 - x11 * cospi_20_64; - s12 = -x12 * cospi_28_64 + x13 * cospi_4_64; - s13 = x12 * cospi_4_64 + x13 * cospi_28_64; - s14 = -x14 * cospi_12_64 + x15 * cospi_20_64; - s15 = x14 * cospi_20_64 + x15 * cospi_12_64; - - x0 = WRAPLOW(s0 + s4, bd); - x1 = WRAPLOW(s1 + s5, bd); - x2 = WRAPLOW(s2 + s6, bd); - x3 = WRAPLOW(s3 + s7, bd); - x4 = WRAPLOW(s0 - s4, bd); - x5 = WRAPLOW(s1 - s5, bd); - x6 = WRAPLOW(s2 - s6, bd); - x7 = WRAPLOW(s3 - s7, bd); - x8 = WRAPLOW(highbd_dct_const_round_shift(s8 + s12, bd), bd); - x9 = WRAPLOW(highbd_dct_const_round_shift(s9 + s13, bd), bd); - x10 = WRAPLOW(highbd_dct_const_round_shift(s10 + s14, bd), bd); - x11 = WRAPLOW(highbd_dct_const_round_shift(s11 + s15, bd), bd); - x12 = WRAPLOW(highbd_dct_const_round_shift(s8 - s12, bd), bd); - x13 = WRAPLOW(highbd_dct_const_round_shift(s9 - s13, bd), bd); - x14 = WRAPLOW(highbd_dct_const_round_shift(s10 - s14, bd), bd); - x15 = WRAPLOW(highbd_dct_const_round_shift(s11 - s15, bd), bd); - - // stage 3 - s0 = x0; - s1 = x1; - s2 = x2; - s3 = x3; - s4 = x4 * cospi_8_64 + x5 * cospi_24_64; - s5 = x4 * cospi_24_64 - x5 * cospi_8_64; - s6 = -x6 * cospi_24_64 + x7 * cospi_8_64; - s7 = x6 * cospi_8_64 + x7 * cospi_24_64; - s8 = x8; - s9 = x9; - s10 = x10; - s11 = x11; - s12 = x12 * cospi_8_64 + x13 * cospi_24_64; - s13 = x12 * cospi_24_64 - x13 * cospi_8_64; - s14 = -x14 * cospi_24_64 + x15 * cospi_8_64; - s15 = x14 * cospi_8_64 + x15 * cospi_24_64; - - x0 = WRAPLOW(s0 + s2, bd); - x1 = WRAPLOW(s1 + s3, bd); - x2 = WRAPLOW(s0 - s2, bd); - x3 = WRAPLOW(s1 - s3, bd); - x4 = WRAPLOW(highbd_dct_const_round_shift(s4 + s6, bd), bd); - x5 = WRAPLOW(highbd_dct_const_round_shift(s5 + s7, bd), bd); - x6 = WRAPLOW(highbd_dct_const_round_shift(s4 - s6, bd), bd); - x7 = WRAPLOW(highbd_dct_const_round_shift(s5 - s7, bd), bd); - x8 = WRAPLOW(s8 + s10, bd); - x9 = WRAPLOW(s9 + s11, bd); - x10 = WRAPLOW(s8 - s10, bd); - x11 = WRAPLOW(s9 - s11, bd); - x12 = WRAPLOW(highbd_dct_const_round_shift(s12 + s14, bd), bd); - x13 = WRAPLOW(highbd_dct_const_round_shift(s13 + s15, bd), bd); - x14 = WRAPLOW(highbd_dct_const_round_shift(s12 - s14, bd), bd); - x15 = WRAPLOW(highbd_dct_const_round_shift(s13 - s15, bd), bd); - - // stage 4 - s2 = (- cospi_16_64) * (x2 + x3); - s3 = cospi_16_64 * (x2 - x3); - s6 = cospi_16_64 * (x6 + x7); - s7 = cospi_16_64 * (-x6 + x7); - s10 = cospi_16_64 * (x10 + x11); - s11 = cospi_16_64 * (-x10 + x11); - s14 = (- cospi_16_64) * (x14 + x15); - s15 = cospi_16_64 * (x14 - x15); - - x2 = WRAPLOW(highbd_dct_const_round_shift(s2, bd), bd); - x3 = WRAPLOW(highbd_dct_const_round_shift(s3, bd), bd); - x6 = WRAPLOW(highbd_dct_const_round_shift(s6, bd), bd); - x7 = WRAPLOW(highbd_dct_const_round_shift(s7, bd), bd); - x10 = WRAPLOW(highbd_dct_const_round_shift(s10, bd), bd); - x11 = WRAPLOW(highbd_dct_const_round_shift(s11, bd), bd); - x14 = WRAPLOW(highbd_dct_const_round_shift(s14, bd), bd); - x15 = WRAPLOW(highbd_dct_const_round_shift(s15, bd), bd); - - output[0] = WRAPLOW(x0, bd); - output[1] = WRAPLOW(-x8, bd); - output[2] = WRAPLOW(x12, bd); - output[3] = WRAPLOW(-x4, bd); - output[4] = WRAPLOW(x6, bd); - output[5] = WRAPLOW(x14, bd); - output[6] = WRAPLOW(x10, bd); - output[7] = WRAPLOW(x2, bd); - output[8] = WRAPLOW(x3, bd); - output[9] = WRAPLOW(x11, bd); - output[10] = WRAPLOW(x15, bd); - output[11] = WRAPLOW(x7, bd); - output[12] = WRAPLOW(x5, bd); - output[13] = WRAPLOW(-x13, bd); - output[14] = WRAPLOW(x9, bd); - output[15] = WRAPLOW(-x1, bd); -} - -static const highbd_transform_2d HIGH_IHT_16[] = { - { vp9_highbd_idct16, vp9_highbd_idct16 }, // DCT_DCT = 0 - { highbd_iadst16, vp9_highbd_idct16 }, // ADST_DCT = 1 - { vp9_highbd_idct16, highbd_iadst16 }, // DCT_ADST = 2 - { highbd_iadst16, highbd_iadst16 } // ADST_ADST = 3 -}; - -void vp9_highbd_iht16x16_256_add_c(const tran_low_t *input, uint8_t *dest8, - int stride, int tx_type, int bd) { - int i, j; - tran_low_t out[16 * 16]; - tran_low_t *outptr = out; - tran_low_t temp_in[16], temp_out[16]; - const highbd_transform_2d ht = HIGH_IHT_16[tx_type]; - uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); - - // Rows - for (i = 0; i < 16; ++i) { - ht.rows(input, outptr, bd); - input += 16; - outptr += 16; - } - - // Columns - for (i = 0; i < 16; ++i) { - for (j = 0; j < 16; ++j) - temp_in[j] = out[j * 16 + i]; - ht.cols(temp_in, temp_out, bd); - for (j = 0; j < 16; ++j) { - dest[j * stride + i] = highbd_clip_pixel_add( - dest[j * stride + i], ROUND_POWER_OF_TWO(temp_out[j], 6), bd); - } - } -} - -void vp9_highbd_idct16x16_10_add_c(const tran_low_t *input, uint8_t *dest8, - int stride, int bd) { - tran_low_t out[16 * 16] = { 0 }; - tran_low_t *outptr = out; - int i, j; - tran_low_t temp_in[16], temp_out[16]; - uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); - - // First transform rows. Since all non-zero dct coefficients are in - // upper-left 4x4 area, we only need to calculate first 4 rows here. - for (i = 0; i < 4; ++i) { - vp9_highbd_idct16(input, outptr, bd); - input += 16; - outptr += 16; - } - - // Then transform columns. - for (i = 0; i < 16; ++i) { - for (j = 0; j < 16; ++j) - temp_in[j] = out[j*16 + i]; - vp9_highbd_idct16(temp_in, temp_out, bd); - for (j = 0; j < 16; ++j) { - dest[j * stride + i] = highbd_clip_pixel_add( - dest[j * stride + i], ROUND_POWER_OF_TWO(temp_out[j], 6), bd); - } - } -} - -void vp9_highbd_idct16x16_1_add_c(const tran_low_t *input, uint8_t *dest8, - int stride, int bd) { - int i, j; - tran_high_t a1; - tran_low_t out = WRAPLOW( - highbd_dct_const_round_shift(input[0] * cospi_16_64, bd), bd); - uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); - - out = WRAPLOW(highbd_dct_const_round_shift(out * cospi_16_64, bd), bd); - a1 = ROUND_POWER_OF_TWO(out, 6); - for (j = 0; j < 16; ++j) { - for (i = 0; i < 16; ++i) - dest[i] = highbd_clip_pixel_add(dest[i], a1, bd); - dest += stride; - } -} - -static void highbd_idct32(const tran_low_t *input, tran_low_t *output, int bd) { - tran_low_t step1[32], step2[32]; - tran_high_t temp1, temp2; - (void) bd; - - // stage 1 - step1[0] = input[0]; - step1[1] = input[16]; - step1[2] = input[8]; - step1[3] = input[24]; - step1[4] = input[4]; - step1[5] = input[20]; - step1[6] = input[12]; - step1[7] = input[28]; - step1[8] = input[2]; - step1[9] = input[18]; - step1[10] = input[10]; - step1[11] = input[26]; - step1[12] = input[6]; - step1[13] = input[22]; - step1[14] = input[14]; - step1[15] = input[30]; - - temp1 = input[1] * cospi_31_64 - input[31] * cospi_1_64; - temp2 = input[1] * cospi_1_64 + input[31] * cospi_31_64; - step1[16] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[31] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - - temp1 = input[17] * cospi_15_64 - input[15] * cospi_17_64; - temp2 = input[17] * cospi_17_64 + input[15] * cospi_15_64; - step1[17] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[30] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - - temp1 = input[9] * cospi_23_64 - input[23] * cospi_9_64; - temp2 = input[9] * cospi_9_64 + input[23] * cospi_23_64; - step1[18] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[29] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - - temp1 = input[25] * cospi_7_64 - input[7] * cospi_25_64; - temp2 = input[25] * cospi_25_64 + input[7] * cospi_7_64; - step1[19] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[28] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - - temp1 = input[5] * cospi_27_64 - input[27] * cospi_5_64; - temp2 = input[5] * cospi_5_64 + input[27] * cospi_27_64; - step1[20] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[27] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - - temp1 = input[21] * cospi_11_64 - input[11] * cospi_21_64; - temp2 = input[21] * cospi_21_64 + input[11] * cospi_11_64; - step1[21] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[26] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - - temp1 = input[13] * cospi_19_64 - input[19] * cospi_13_64; - temp2 = input[13] * cospi_13_64 + input[19] * cospi_19_64; - step1[22] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[25] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - - temp1 = input[29] * cospi_3_64 - input[3] * cospi_29_64; - temp2 = input[29] * cospi_29_64 + input[3] * cospi_3_64; - step1[23] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[24] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - - // stage 2 - step2[0] = step1[0]; - step2[1] = step1[1]; - step2[2] = step1[2]; - step2[3] = step1[3]; - step2[4] = step1[4]; - step2[5] = step1[5]; - step2[6] = step1[6]; - step2[7] = step1[7]; - - temp1 = step1[8] * cospi_30_64 - step1[15] * cospi_2_64; - temp2 = step1[8] * cospi_2_64 + step1[15] * cospi_30_64; - step2[8] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step2[15] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - - temp1 = step1[9] * cospi_14_64 - step1[14] * cospi_18_64; - temp2 = step1[9] * cospi_18_64 + step1[14] * cospi_14_64; - step2[9] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step2[14] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - - temp1 = step1[10] * cospi_22_64 - step1[13] * cospi_10_64; - temp2 = step1[10] * cospi_10_64 + step1[13] * cospi_22_64; - step2[10] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step2[13] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - - temp1 = step1[11] * cospi_6_64 - step1[12] * cospi_26_64; - temp2 = step1[11] * cospi_26_64 + step1[12] * cospi_6_64; - step2[11] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step2[12] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - - step2[16] = WRAPLOW(step1[16] + step1[17], bd); - step2[17] = WRAPLOW(step1[16] - step1[17], bd); - step2[18] = WRAPLOW(-step1[18] + step1[19], bd); - step2[19] = WRAPLOW(step1[18] + step1[19], bd); - step2[20] = WRAPLOW(step1[20] + step1[21], bd); - step2[21] = WRAPLOW(step1[20] - step1[21], bd); - step2[22] = WRAPLOW(-step1[22] + step1[23], bd); - step2[23] = WRAPLOW(step1[22] + step1[23], bd); - step2[24] = WRAPLOW(step1[24] + step1[25], bd); - step2[25] = WRAPLOW(step1[24] - step1[25], bd); - step2[26] = WRAPLOW(-step1[26] + step1[27], bd); - step2[27] = WRAPLOW(step1[26] + step1[27], bd); - step2[28] = WRAPLOW(step1[28] + step1[29], bd); - step2[29] = WRAPLOW(step1[28] - step1[29], bd); - step2[30] = WRAPLOW(-step1[30] + step1[31], bd); - step2[31] = WRAPLOW(step1[30] + step1[31], bd); - - // stage 3 - step1[0] = step2[0]; - step1[1] = step2[1]; - step1[2] = step2[2]; - step1[3] = step2[3]; - - temp1 = step2[4] * cospi_28_64 - step2[7] * cospi_4_64; - temp2 = step2[4] * cospi_4_64 + step2[7] * cospi_28_64; - step1[4] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[7] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - temp1 = step2[5] * cospi_12_64 - step2[6] * cospi_20_64; - temp2 = step2[5] * cospi_20_64 + step2[6] * cospi_12_64; - step1[5] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[6] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - - step1[8] = WRAPLOW(step2[8] + step2[9], bd); - step1[9] = WRAPLOW(step2[8] - step2[9], bd); - step1[10] = WRAPLOW(-step2[10] + step2[11], bd); - step1[11] = WRAPLOW(step2[10] + step2[11], bd); - step1[12] = WRAPLOW(step2[12] + step2[13], bd); - step1[13] = WRAPLOW(step2[12] - step2[13], bd); - step1[14] = WRAPLOW(-step2[14] + step2[15], bd); - step1[15] = WRAPLOW(step2[14] + step2[15], bd); - - step1[16] = step2[16]; - step1[31] = step2[31]; - temp1 = -step2[17] * cospi_4_64 + step2[30] * cospi_28_64; - temp2 = step2[17] * cospi_28_64 + step2[30] * cospi_4_64; - step1[17] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[30] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - temp1 = -step2[18] * cospi_28_64 - step2[29] * cospi_4_64; - temp2 = -step2[18] * cospi_4_64 + step2[29] * cospi_28_64; - step1[18] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[29] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - step1[19] = step2[19]; - step1[20] = step2[20]; - temp1 = -step2[21] * cospi_20_64 + step2[26] * cospi_12_64; - temp2 = step2[21] * cospi_12_64 + step2[26] * cospi_20_64; - step1[21] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[26] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - temp1 = -step2[22] * cospi_12_64 - step2[25] * cospi_20_64; - temp2 = -step2[22] * cospi_20_64 + step2[25] * cospi_12_64; - step1[22] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[25] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - step1[23] = step2[23]; - step1[24] = step2[24]; - step1[27] = step2[27]; - step1[28] = step2[28]; - - // stage 4 - temp1 = (step1[0] + step1[1]) * cospi_16_64; - temp2 = (step1[0] - step1[1]) * cospi_16_64; - step2[0] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step2[1] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - temp1 = step1[2] * cospi_24_64 - step1[3] * cospi_8_64; - temp2 = step1[2] * cospi_8_64 + step1[3] * cospi_24_64; - step2[2] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step2[3] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - step2[4] = WRAPLOW(step1[4] + step1[5], bd); - step2[5] = WRAPLOW(step1[4] - step1[5], bd); - step2[6] = WRAPLOW(-step1[6] + step1[7], bd); - step2[7] = WRAPLOW(step1[6] + step1[7], bd); - - step2[8] = step1[8]; - step2[15] = step1[15]; - temp1 = -step1[9] * cospi_8_64 + step1[14] * cospi_24_64; - temp2 = step1[9] * cospi_24_64 + step1[14] * cospi_8_64; - step2[9] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step2[14] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - temp1 = -step1[10] * cospi_24_64 - step1[13] * cospi_8_64; - temp2 = -step1[10] * cospi_8_64 + step1[13] * cospi_24_64; - step2[10] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step2[13] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - step2[11] = step1[11]; - step2[12] = step1[12]; - - step2[16] = WRAPLOW(step1[16] + step1[19], bd); - step2[17] = WRAPLOW(step1[17] + step1[18], bd); - step2[18] = WRAPLOW(step1[17] - step1[18], bd); - step2[19] = WRAPLOW(step1[16] - step1[19], bd); - step2[20] = WRAPLOW(-step1[20] + step1[23], bd); - step2[21] = WRAPLOW(-step1[21] + step1[22], bd); - step2[22] = WRAPLOW(step1[21] + step1[22], bd); - step2[23] = WRAPLOW(step1[20] + step1[23], bd); - - step2[24] = WRAPLOW(step1[24] + step1[27], bd); - step2[25] = WRAPLOW(step1[25] + step1[26], bd); - step2[26] = WRAPLOW(step1[25] - step1[26], bd); - step2[27] = WRAPLOW(step1[24] - step1[27], bd); - step2[28] = WRAPLOW(-step1[28] + step1[31], bd); - step2[29] = WRAPLOW(-step1[29] + step1[30], bd); - step2[30] = WRAPLOW(step1[29] + step1[30], bd); - step2[31] = WRAPLOW(step1[28] + step1[31], bd); - - // stage 5 - step1[0] = WRAPLOW(step2[0] + step2[3], bd); - step1[1] = WRAPLOW(step2[1] + step2[2], bd); - step1[2] = WRAPLOW(step2[1] - step2[2], bd); - step1[3] = WRAPLOW(step2[0] - step2[3], bd); - step1[4] = step2[4]; - temp1 = (step2[6] - step2[5]) * cospi_16_64; - temp2 = (step2[5] + step2[6]) * cospi_16_64; - step1[5] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[6] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - step1[7] = step2[7]; - - step1[8] = WRAPLOW(step2[8] + step2[11], bd); - step1[9] = WRAPLOW(step2[9] + step2[10], bd); - step1[10] = WRAPLOW(step2[9] - step2[10], bd); - step1[11] = WRAPLOW(step2[8] - step2[11], bd); - step1[12] = WRAPLOW(-step2[12] + step2[15], bd); - step1[13] = WRAPLOW(-step2[13] + step2[14], bd); - step1[14] = WRAPLOW(step2[13] + step2[14], bd); - step1[15] = WRAPLOW(step2[12] + step2[15], bd); - - step1[16] = step2[16]; - step1[17] = step2[17]; - temp1 = -step2[18] * cospi_8_64 + step2[29] * cospi_24_64; - temp2 = step2[18] * cospi_24_64 + step2[29] * cospi_8_64; - step1[18] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[29] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - temp1 = -step2[19] * cospi_8_64 + step2[28] * cospi_24_64; - temp2 = step2[19] * cospi_24_64 + step2[28] * cospi_8_64; - step1[19] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[28] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - temp1 = -step2[20] * cospi_24_64 - step2[27] * cospi_8_64; - temp2 = -step2[20] * cospi_8_64 + step2[27] * cospi_24_64; - step1[20] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[27] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - temp1 = -step2[21] * cospi_24_64 - step2[26] * cospi_8_64; - temp2 = -step2[21] * cospi_8_64 + step2[26] * cospi_24_64; - step1[21] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[26] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - step1[22] = step2[22]; - step1[23] = step2[23]; - step1[24] = step2[24]; - step1[25] = step2[25]; - step1[30] = step2[30]; - step1[31] = step2[31]; - - // stage 6 - step2[0] = WRAPLOW(step1[0] + step1[7], bd); - step2[1] = WRAPLOW(step1[1] + step1[6], bd); - step2[2] = WRAPLOW(step1[2] + step1[5], bd); - step2[3] = WRAPLOW(step1[3] + step1[4], bd); - step2[4] = WRAPLOW(step1[3] - step1[4], bd); - step2[5] = WRAPLOW(step1[2] - step1[5], bd); - step2[6] = WRAPLOW(step1[1] - step1[6], bd); - step2[7] = WRAPLOW(step1[0] - step1[7], bd); - step2[8] = step1[8]; - step2[9] = step1[9]; - temp1 = (-step1[10] + step1[13]) * cospi_16_64; - temp2 = (step1[10] + step1[13]) * cospi_16_64; - step2[10] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step2[13] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - temp1 = (-step1[11] + step1[12]) * cospi_16_64; - temp2 = (step1[11] + step1[12]) * cospi_16_64; - step2[11] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step2[12] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - step2[14] = step1[14]; - step2[15] = step1[15]; - - step2[16] = WRAPLOW(step1[16] + step1[23], bd); - step2[17] = WRAPLOW(step1[17] + step1[22], bd); - step2[18] = WRAPLOW(step1[18] + step1[21], bd); - step2[19] = WRAPLOW(step1[19] + step1[20], bd); - step2[20] = WRAPLOW(step1[19] - step1[20], bd); - step2[21] = WRAPLOW(step1[18] - step1[21], bd); - step2[22] = WRAPLOW(step1[17] - step1[22], bd); - step2[23] = WRAPLOW(step1[16] - step1[23], bd); - - step2[24] = WRAPLOW(-step1[24] + step1[31], bd); - step2[25] = WRAPLOW(-step1[25] + step1[30], bd); - step2[26] = WRAPLOW(-step1[26] + step1[29], bd); - step2[27] = WRAPLOW(-step1[27] + step1[28], bd); - step2[28] = WRAPLOW(step1[27] + step1[28], bd); - step2[29] = WRAPLOW(step1[26] + step1[29], bd); - step2[30] = WRAPLOW(step1[25] + step1[30], bd); - step2[31] = WRAPLOW(step1[24] + step1[31], bd); - - // stage 7 - step1[0] = WRAPLOW(step2[0] + step2[15], bd); - step1[1] = WRAPLOW(step2[1] + step2[14], bd); - step1[2] = WRAPLOW(step2[2] + step2[13], bd); - step1[3] = WRAPLOW(step2[3] + step2[12], bd); - step1[4] = WRAPLOW(step2[4] + step2[11], bd); - step1[5] = WRAPLOW(step2[5] + step2[10], bd); - step1[6] = WRAPLOW(step2[6] + step2[9], bd); - step1[7] = WRAPLOW(step2[7] + step2[8], bd); - step1[8] = WRAPLOW(step2[7] - step2[8], bd); - step1[9] = WRAPLOW(step2[6] - step2[9], bd); - step1[10] = WRAPLOW(step2[5] - step2[10], bd); - step1[11] = WRAPLOW(step2[4] - step2[11], bd); - step1[12] = WRAPLOW(step2[3] - step2[12], bd); - step1[13] = WRAPLOW(step2[2] - step2[13], bd); - step1[14] = WRAPLOW(step2[1] - step2[14], bd); - step1[15] = WRAPLOW(step2[0] - step2[15], bd); - - step1[16] = step2[16]; - step1[17] = step2[17]; - step1[18] = step2[18]; - step1[19] = step2[19]; - temp1 = (-step2[20] + step2[27]) * cospi_16_64; - temp2 = (step2[20] + step2[27]) * cospi_16_64; - step1[20] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[27] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - temp1 = (-step2[21] + step2[26]) * cospi_16_64; - temp2 = (step2[21] + step2[26]) * cospi_16_64; - step1[21] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[26] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - temp1 = (-step2[22] + step2[25]) * cospi_16_64; - temp2 = (step2[22] + step2[25]) * cospi_16_64; - step1[22] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[25] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - temp1 = (-step2[23] + step2[24]) * cospi_16_64; - temp2 = (step2[23] + step2[24]) * cospi_16_64; - step1[23] = WRAPLOW(highbd_dct_const_round_shift(temp1, bd), bd); - step1[24] = WRAPLOW(highbd_dct_const_round_shift(temp2, bd), bd); - step1[28] = step2[28]; - step1[29] = step2[29]; - step1[30] = step2[30]; - step1[31] = step2[31]; - - // final stage - output[0] = WRAPLOW(step1[0] + step1[31], bd); - output[1] = WRAPLOW(step1[1] + step1[30], bd); - output[2] = WRAPLOW(step1[2] + step1[29], bd); - output[3] = WRAPLOW(step1[3] + step1[28], bd); - output[4] = WRAPLOW(step1[4] + step1[27], bd); - output[5] = WRAPLOW(step1[5] + step1[26], bd); - output[6] = WRAPLOW(step1[6] + step1[25], bd); - output[7] = WRAPLOW(step1[7] + step1[24], bd); - output[8] = WRAPLOW(step1[8] + step1[23], bd); - output[9] = WRAPLOW(step1[9] + step1[22], bd); - output[10] = WRAPLOW(step1[10] + step1[21], bd); - output[11] = WRAPLOW(step1[11] + step1[20], bd); - output[12] = WRAPLOW(step1[12] + step1[19], bd); - output[13] = WRAPLOW(step1[13] + step1[18], bd); - output[14] = WRAPLOW(step1[14] + step1[17], bd); - output[15] = WRAPLOW(step1[15] + step1[16], bd); - output[16] = WRAPLOW(step1[15] - step1[16], bd); - output[17] = WRAPLOW(step1[14] - step1[17], bd); - output[18] = WRAPLOW(step1[13] - step1[18], bd); - output[19] = WRAPLOW(step1[12] - step1[19], bd); - output[20] = WRAPLOW(step1[11] - step1[20], bd); - output[21] = WRAPLOW(step1[10] - step1[21], bd); - output[22] = WRAPLOW(step1[9] - step1[22], bd); - output[23] = WRAPLOW(step1[8] - step1[23], bd); - output[24] = WRAPLOW(step1[7] - step1[24], bd); - output[25] = WRAPLOW(step1[6] - step1[25], bd); - output[26] = WRAPLOW(step1[5] - step1[26], bd); - output[27] = WRAPLOW(step1[4] - step1[27], bd); - output[28] = WRAPLOW(step1[3] - step1[28], bd); - output[29] = WRAPLOW(step1[2] - step1[29], bd); - output[30] = WRAPLOW(step1[1] - step1[30], bd); - output[31] = WRAPLOW(step1[0] - step1[31], bd); -} - -void vp9_highbd_idct32x32_1024_add_c(const tran_low_t *input, uint8_t *dest8, - int stride, int bd) { - tran_low_t out[32 * 32]; - tran_low_t *outptr = out; - int i, j; - tran_low_t temp_in[32], temp_out[32]; - uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); - - // Rows - for (i = 0; i < 32; ++i) { - tran_low_t zero_coeff[16]; - for (j = 0; j < 16; ++j) - zero_coeff[j] = input[2 * j] | input[2 * j + 1]; - for (j = 0; j < 8; ++j) - zero_coeff[j] = zero_coeff[2 * j] | zero_coeff[2 * j + 1]; - for (j = 0; j < 4; ++j) - zero_coeff[j] = zero_coeff[2 * j] | zero_coeff[2 * j + 1]; - for (j = 0; j < 2; ++j) - zero_coeff[j] = zero_coeff[2 * j] | zero_coeff[2 * j + 1]; - - if (zero_coeff[0] | zero_coeff[1]) - highbd_idct32(input, outptr, bd); - else - vpx_memset(outptr, 0, sizeof(tran_low_t) * 32); - input += 32; - outptr += 32; - } - - // Columns - for (i = 0; i < 32; ++i) { - for (j = 0; j < 32; ++j) - temp_in[j] = out[j * 32 + i]; - highbd_idct32(temp_in, temp_out, bd); - for (j = 0; j < 32; ++j) { - dest[j * stride + i] = highbd_clip_pixel_add( - dest[j * stride + i], ROUND_POWER_OF_TWO(temp_out[j], 6), bd); - } - } -} - -void vp9_highbd_idct32x32_34_add_c(const tran_low_t *input, uint8_t *dest8, - int stride, int bd) { - tran_low_t out[32 * 32] = {0}; - tran_low_t *outptr = out; - int i, j; - tran_low_t temp_in[32], temp_out[32]; - uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); - - // Rows - // Only upper-left 8x8 has non-zero coeff. - for (i = 0; i < 8; ++i) { - highbd_idct32(input, outptr, bd); - input += 32; - outptr += 32; - } - // Columns - for (i = 0; i < 32; ++i) { - for (j = 0; j < 32; ++j) - temp_in[j] = out[j * 32 + i]; - highbd_idct32(temp_in, temp_out, bd); - for (j = 0; j < 32; ++j) { - dest[j * stride + i] = highbd_clip_pixel_add( - dest[j * stride + i], ROUND_POWER_OF_TWO(temp_out[j], 6), bd); - } - } -} - -void vp9_highbd_idct32x32_1_add_c(const tran_low_t *input, uint8_t *dest8, - int stride, int bd) { - int i, j; - int a1; - uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); - - tran_low_t out = WRAPLOW( - highbd_dct_const_round_shift(input[0] * cospi_16_64, bd), bd); - out = WRAPLOW(highbd_dct_const_round_shift(out * cospi_16_64, bd), bd); - a1 = ROUND_POWER_OF_TWO(out, 6); - - for (j = 0; j < 32; ++j) { - for (i = 0; i < 32; ++i) - dest[i] = highbd_clip_pixel_add(dest[i], a1, bd); - dest += stride; - } -} - -// idct -void vp9_highbd_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride, - int eob, int bd) { - if (eob > 1) - vp9_highbd_idct4x4_16_add(input, dest, stride, bd); - else - vp9_highbd_idct4x4_1_add(input, dest, stride, bd); -} - - -void vp9_highbd_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride, - int eob, int bd) { - if (eob > 1) - vp9_highbd_iwht4x4_16_add(input, dest, stride, bd); - else - vp9_highbd_iwht4x4_1_add(input, dest, stride, bd); -} - -void vp9_highbd_idct8x8_add(const tran_low_t *input, uint8_t *dest, int stride, - int eob, int bd) { - // If dc is 1, then input[0] is the reconstructed value, do not need - // dequantization. Also, when dc is 1, dc is counted in eobs, namely eobs >=1. - - // The calculation can be simplified if there are not many non-zero dct - // coefficients. Use eobs to decide what to do. - // TODO(yunqingwang): "eobs = 1" case is also handled in vp9_short_idct8x8_c. - // Combine that with code here. - // DC only DCT coefficient - if (eob == 1) { - vp9_highbd_idct8x8_1_add(input, dest, stride, bd); - } else if (eob <= 10) { - vp9_highbd_idct8x8_10_add(input, dest, stride, bd); - } else { - vp9_highbd_idct8x8_64_add(input, dest, stride, bd); - } -} - -void vp9_highbd_idct16x16_add(const tran_low_t *input, uint8_t *dest, - int stride, int eob, int bd) { - // The calculation can be simplified if there are not many non-zero dct - // coefficients. Use eobs to separate different cases. - // DC only DCT coefficient. - if (eob == 1) { - vp9_highbd_idct16x16_1_add(input, dest, stride, bd); - } else if (eob <= 10) { - vp9_highbd_idct16x16_10_add(input, dest, stride, bd); - } else { - vp9_highbd_idct16x16_256_add(input, dest, stride, bd); - } -} - -void vp9_highbd_idct32x32_add(const tran_low_t *input, uint8_t *dest, - int stride, int eob, int bd) { - // Non-zero coeff only in upper-left 8x8 - if (eob == 1) { - vp9_highbd_idct32x32_1_add(input, dest, stride, bd); - } else if (eob <= 34) { - vp9_highbd_idct32x32_34_add(input, dest, stride, bd); - } else { - vp9_highbd_idct32x32_1024_add(input, dest, stride, bd); - } -} - -// iht -void vp9_highbd_iht4x4_add(TX_TYPE tx_type, const tran_low_t *input, - uint8_t *dest, int stride, int eob, int bd) { - if (tx_type == DCT_DCT) - vp9_highbd_idct4x4_add(input, dest, stride, eob, bd); - else - vp9_highbd_iht4x4_16_add(input, dest, stride, tx_type, bd); -} - -void vp9_highbd_iht8x8_add(TX_TYPE tx_type, const tran_low_t *input, - uint8_t *dest, int stride, int eob, int bd) { - if (tx_type == DCT_DCT) { - vp9_highbd_idct8x8_add(input, dest, stride, eob, bd); - } else { - vp9_highbd_iht8x8_64_add(input, dest, stride, tx_type, bd); - } -} - -void vp9_highbd_iht16x16_add(TX_TYPE tx_type, const tran_low_t *input, - uint8_t *dest, int stride, int eob, int bd) { - if (tx_type == DCT_DCT) { - vp9_highbd_idct16x16_add(input, dest, stride, eob, bd); - } else { - vp9_highbd_iht16x16_256_add(input, dest, stride, tx_type, bd); - } -} -#endif // CONFIG_VP9_HIGHBITDEPTH diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_idct.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_idct.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_idct.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_idct.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,211 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_IDCT_H_ -#define VP9_COMMON_VP9_IDCT_H_ - -#include - -#include "./vpx_config.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_enums.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// Constants and Macros used by all idct/dct functions -#define DCT_CONST_BITS 14 -#define DCT_CONST_ROUNDING (1 << (DCT_CONST_BITS - 1)) - -#define UNIT_QUANT_SHIFT 2 -#define UNIT_QUANT_FACTOR (1 << UNIT_QUANT_SHIFT) - -#define pair_set_epi16(a, b) \ - _mm_set_epi16((int16_t)(b), (int16_t)(a), (int16_t)(b), (int16_t)(a), \ - (int16_t)(b), (int16_t)(a), (int16_t)(b), (int16_t)(a)) - -#define dual_set_epi16(a, b) \ - _mm_set_epi16((int16_t)(b), (int16_t)(b), (int16_t)(b), (int16_t)(b), \ - (int16_t)(a), (int16_t)(a), (int16_t)(a), (int16_t)(a)) - -// Constants: -// for (int i = 1; i< 32; ++i) -// printf("static const int cospi_%d_64 = %.0f;\n", i, -// round(16384 * cos(i*M_PI/64))); -// Note: sin(k*Pi/64) = cos((32-k)*Pi/64) -static const tran_high_t cospi_1_64 = 16364; -static const tran_high_t cospi_2_64 = 16305; -static const tran_high_t cospi_3_64 = 16207; -static const tran_high_t cospi_4_64 = 16069; -static const tran_high_t cospi_5_64 = 15893; -static const tran_high_t cospi_6_64 = 15679; -static const tran_high_t cospi_7_64 = 15426; -static const tran_high_t cospi_8_64 = 15137; -static const tran_high_t cospi_9_64 = 14811; -static const tran_high_t cospi_10_64 = 14449; -static const tran_high_t cospi_11_64 = 14053; -static const tran_high_t cospi_12_64 = 13623; -static const tran_high_t cospi_13_64 = 13160; -static const tran_high_t cospi_14_64 = 12665; -static const tran_high_t cospi_15_64 = 12140; -static const tran_high_t cospi_16_64 = 11585; -static const tran_high_t cospi_17_64 = 11003; -static const tran_high_t cospi_18_64 = 10394; -static const tran_high_t cospi_19_64 = 9760; -static const tran_high_t cospi_20_64 = 9102; -static const tran_high_t cospi_21_64 = 8423; -static const tran_high_t cospi_22_64 = 7723; -static const tran_high_t cospi_23_64 = 7005; -static const tran_high_t cospi_24_64 = 6270; -static const tran_high_t cospi_25_64 = 5520; -static const tran_high_t cospi_26_64 = 4756; -static const tran_high_t cospi_27_64 = 3981; -static const tran_high_t cospi_28_64 = 3196; -static const tran_high_t cospi_29_64 = 2404; -static const tran_high_t cospi_30_64 = 1606; -static const tran_high_t cospi_31_64 = 804; - -// 16384 * sqrt(2) * sin(kPi/9) * 2 / 3 -static const tran_high_t sinpi_1_9 = 5283; -static const tran_high_t sinpi_2_9 = 9929; -static const tran_high_t sinpi_3_9 = 13377; -static const tran_high_t sinpi_4_9 = 15212; - -static INLINE tran_low_t check_range(tran_high_t input) { -#if CONFIG_COEFFICIENT_RANGE_CHECKING - // For valid VP9 input streams, intermediate stage coefficients should always - // stay within the range of a signed 16 bit integer. Coefficients can go out - // of this range for invalid/corrupt VP9 streams. However, strictly checking - // this range for every intermediate coefficient can burdensome for a decoder, - // therefore the following assertion is only enabled when configured with - // --enable-coefficient-range-checking. - assert(INT16_MIN <= input); - assert(input <= INT16_MAX); -#endif // CONFIG_COEFFICIENT_RANGE_CHECKING - return (tran_low_t)input; -} - -static INLINE tran_low_t dct_const_round_shift(tran_high_t input) { - tran_high_t rv = ROUND_POWER_OF_TWO(input, DCT_CONST_BITS); - return check_range(rv); -} - -#if CONFIG_VP9_HIGHBITDEPTH -static INLINE tran_low_t highbd_check_range(tran_high_t input, - int bd) { -#if CONFIG_COEFFICIENT_RANGE_CHECKING - // For valid highbitdepth VP9 streams, intermediate stage coefficients will - // stay within the ranges: - // - 8 bit: signed 16 bit integer - // - 10 bit: signed 18 bit integer - // - 12 bit: signed 20 bit integer - const int32_t int_max = (1 << (7 + bd)) - 1; - const int32_t int_min = -int_max - 1; - assert(int_min <= input); - assert(input <= int_max); - (void) int_min; -#endif // CONFIG_COEFFICIENT_RANGE_CHECKING - (void) bd; - return (tran_low_t)input; -} - -static INLINE tran_low_t highbd_dct_const_round_shift(tran_high_t input, - int bd) { - tran_high_t rv = ROUND_POWER_OF_TWO(input, DCT_CONST_BITS); - return highbd_check_range(rv, bd); -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -typedef void (*transform_1d)(const tran_low_t*, tran_low_t*); - -typedef struct { - transform_1d cols, rows; // vertical and horizontal -} transform_2d; - -#if CONFIG_VP9_HIGHBITDEPTH -typedef void (*highbd_transform_1d)(const tran_low_t*, tran_low_t*, int bd); - -typedef struct { - highbd_transform_1d cols, rows; // vertical and horizontal -} highbd_transform_2d; -#endif // CONFIG_VP9_HIGHBITDEPTH - -#if CONFIG_EMULATE_HARDWARE -// When CONFIG_EMULATE_HARDWARE is 1 the transform performs a -// non-normative method to handle overflows. A stream that causes -// overflows in the inverse transform is considered invalid in VP9, -// and a hardware implementer is free to choose any reasonable -// method to handle overflows. However to aid in hardware -// verification they can use a specific implementation of the -// WRAPLOW() macro below that is identical to their intended -// hardware implementation (and also use configure options to trigger -// the C-implementation of the transform). -// -// The particular WRAPLOW implementation below performs strict -// overflow wrapping to match common hardware implementations. -// bd of 8 uses trans_low with 16bits, need to remove 16bits -// bd of 10 uses trans_low with 18bits, need to remove 14bits -// bd of 12 uses trans_low with 20bits, need to remove 12bits -// bd of x uses trans_low with 8+x bits, need to remove 24-x bits -#define WRAPLOW(x, bd) ((((int32_t)(x)) << (24 - bd)) >> (24 - bd)) -#else -#define WRAPLOW(x, bd) (x) -#endif // CONFIG_EMULATE_HARDWARE - -void vp9_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride, - int eob); -void vp9_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride, - int eob); -void vp9_idct8x8_add(const tran_low_t *input, uint8_t *dest, int stride, - int eob); -void vp9_idct16x16_add(const tran_low_t *input, uint8_t *dest, int stride, int - eob); -void vp9_idct32x32_add(const tran_low_t *input, uint8_t *dest, int stride, - int eob); - -void vp9_iht4x4_add(TX_TYPE tx_type, const tran_low_t *input, uint8_t *dest, - int stride, int eob); -void vp9_iht8x8_add(TX_TYPE tx_type, const tran_low_t *input, uint8_t *dest, - int stride, int eob); -void vp9_iht16x16_add(TX_TYPE tx_type, const tran_low_t *input, uint8_t *dest, - int stride, int eob); - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_highbd_idct4(const tran_low_t *input, tran_low_t *output, int bd); -void vp9_highbd_idct8(const tran_low_t *input, tran_low_t *output, int bd); -void vp9_highbd_idct16(const tran_low_t *input, tran_low_t *output, int bd); -void vp9_highbd_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride, - int eob, int bd); -void vp9_highbd_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride, - int eob, int bd); -void vp9_highbd_idct8x8_add(const tran_low_t *input, uint8_t *dest, int stride, - int eob, int bd); -void vp9_highbd_idct16x16_add(const tran_low_t *input, uint8_t *dest, - int stride, int eob, int bd); -void vp9_highbd_idct32x32_add(const tran_low_t *input, uint8_t *dest, - int stride, int eob, int bd); -void vp9_highbd_iht4x4_add(TX_TYPE tx_type, const tran_low_t *input, - uint8_t *dest, int stride, int eob, int bd); -void vp9_highbd_iht8x8_add(TX_TYPE tx_type, const tran_low_t *input, - uint8_t *dest, int stride, int eob, int bd); -void vp9_highbd_iht16x16_add(TX_TYPE tx_type, const tran_low_t *input, - uint8_t *dest, int stride, int eob, int bd); -static INLINE uint16_t highbd_clip_pixel_add(uint16_t dest, tran_high_t trans, - int bd) { - trans = WRAPLOW(trans, bd); - return clip_pixel_highbd(WRAPLOW(dest + trans, bd), bd); -} -#endif // CONFIG_VP9_HIGHBITDEPTH -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_IDCT_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_loopfilter.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_loopfilter.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_loopfilter.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_loopfilter.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1644 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "./vpx_config.h" -#include "vp9/common/vp9_loopfilter.h" -#include "vp9/common/vp9_onyxc_int.h" -#include "vp9/common/vp9_reconinter.h" -#include "vpx_mem/vpx_mem.h" - -#include "vp9/common/vp9_seg_common.h" - -// 64 bit masks for left transform size. Each 1 represents a position where -// we should apply a loop filter across the left border of an 8x8 block -// boundary. -// -// In the case of TX_16X16-> ( in low order byte first we end up with -// a mask that looks like this -// -// 10101010 -// 10101010 -// 10101010 -// 10101010 -// 10101010 -// 10101010 -// 10101010 -// 10101010 -// -// A loopfilter should be applied to every other 8x8 horizontally. -static const uint64_t left_64x64_txform_mask[TX_SIZES]= { - 0xffffffffffffffffULL, // TX_4X4 - 0xffffffffffffffffULL, // TX_8x8 - 0x5555555555555555ULL, // TX_16x16 - 0x1111111111111111ULL, // TX_32x32 -}; - -// 64 bit masks for above transform size. Each 1 represents a position where -// we should apply a loop filter across the top border of an 8x8 block -// boundary. -// -// In the case of TX_32x32 -> ( in low order byte first we end up with -// a mask that looks like this -// -// 11111111 -// 00000000 -// 00000000 -// 00000000 -// 11111111 -// 00000000 -// 00000000 -// 00000000 -// -// A loopfilter should be applied to every other 4 the row vertically. -static const uint64_t above_64x64_txform_mask[TX_SIZES]= { - 0xffffffffffffffffULL, // TX_4X4 - 0xffffffffffffffffULL, // TX_8x8 - 0x00ff00ff00ff00ffULL, // TX_16x16 - 0x000000ff000000ffULL, // TX_32x32 -}; - -// 64 bit masks for prediction sizes (left). Each 1 represents a position -// where left border of an 8x8 block. These are aligned to the right most -// appropriate bit, and then shifted into place. -// -// In the case of TX_16x32 -> ( low order byte first ) we end up with -// a mask that looks like this : -// -// 10000000 -// 10000000 -// 10000000 -// 10000000 -// 00000000 -// 00000000 -// 00000000 -// 00000000 -static const uint64_t left_prediction_mask[BLOCK_SIZES] = { - 0x0000000000000001ULL, // BLOCK_4X4, - 0x0000000000000001ULL, // BLOCK_4X8, - 0x0000000000000001ULL, // BLOCK_8X4, - 0x0000000000000001ULL, // BLOCK_8X8, - 0x0000000000000101ULL, // BLOCK_8X16, - 0x0000000000000001ULL, // BLOCK_16X8, - 0x0000000000000101ULL, // BLOCK_16X16, - 0x0000000001010101ULL, // BLOCK_16X32, - 0x0000000000000101ULL, // BLOCK_32X16, - 0x0000000001010101ULL, // BLOCK_32X32, - 0x0101010101010101ULL, // BLOCK_32X64, - 0x0000000001010101ULL, // BLOCK_64X32, - 0x0101010101010101ULL, // BLOCK_64X64 -}; - -// 64 bit mask to shift and set for each prediction size. -static const uint64_t above_prediction_mask[BLOCK_SIZES] = { - 0x0000000000000001ULL, // BLOCK_4X4 - 0x0000000000000001ULL, // BLOCK_4X8 - 0x0000000000000001ULL, // BLOCK_8X4 - 0x0000000000000001ULL, // BLOCK_8X8 - 0x0000000000000001ULL, // BLOCK_8X16, - 0x0000000000000003ULL, // BLOCK_16X8 - 0x0000000000000003ULL, // BLOCK_16X16 - 0x0000000000000003ULL, // BLOCK_16X32, - 0x000000000000000fULL, // BLOCK_32X16, - 0x000000000000000fULL, // BLOCK_32X32, - 0x000000000000000fULL, // BLOCK_32X64, - 0x00000000000000ffULL, // BLOCK_64X32, - 0x00000000000000ffULL, // BLOCK_64X64 -}; -// 64 bit mask to shift and set for each prediction size. A bit is set for -// each 8x8 block that would be in the left most block of the given block -// size in the 64x64 block. -static const uint64_t size_mask[BLOCK_SIZES] = { - 0x0000000000000001ULL, // BLOCK_4X4 - 0x0000000000000001ULL, // BLOCK_4X8 - 0x0000000000000001ULL, // BLOCK_8X4 - 0x0000000000000001ULL, // BLOCK_8X8 - 0x0000000000000101ULL, // BLOCK_8X16, - 0x0000000000000003ULL, // BLOCK_16X8 - 0x0000000000000303ULL, // BLOCK_16X16 - 0x0000000003030303ULL, // BLOCK_16X32, - 0x0000000000000f0fULL, // BLOCK_32X16, - 0x000000000f0f0f0fULL, // BLOCK_32X32, - 0x0f0f0f0f0f0f0f0fULL, // BLOCK_32X64, - 0x00000000ffffffffULL, // BLOCK_64X32, - 0xffffffffffffffffULL, // BLOCK_64X64 -}; - -// These are used for masking the left and above borders. -static const uint64_t left_border = 0x1111111111111111ULL; -static const uint64_t above_border = 0x000000ff000000ffULL; - -// 16 bit masks for uv transform sizes. -static const uint16_t left_64x64_txform_mask_uv[TX_SIZES]= { - 0xffff, // TX_4X4 - 0xffff, // TX_8x8 - 0x5555, // TX_16x16 - 0x1111, // TX_32x32 -}; - -static const uint16_t above_64x64_txform_mask_uv[TX_SIZES]= { - 0xffff, // TX_4X4 - 0xffff, // TX_8x8 - 0x0f0f, // TX_16x16 - 0x000f, // TX_32x32 -}; - -// 16 bit left mask to shift and set for each uv prediction size. -static const uint16_t left_prediction_mask_uv[BLOCK_SIZES] = { - 0x0001, // BLOCK_4X4, - 0x0001, // BLOCK_4X8, - 0x0001, // BLOCK_8X4, - 0x0001, // BLOCK_8X8, - 0x0001, // BLOCK_8X16, - 0x0001, // BLOCK_16X8, - 0x0001, // BLOCK_16X16, - 0x0011, // BLOCK_16X32, - 0x0001, // BLOCK_32X16, - 0x0011, // BLOCK_32X32, - 0x1111, // BLOCK_32X64 - 0x0011, // BLOCK_64X32, - 0x1111, // BLOCK_64X64 -}; -// 16 bit above mask to shift and set for uv each prediction size. -static const uint16_t above_prediction_mask_uv[BLOCK_SIZES] = { - 0x0001, // BLOCK_4X4 - 0x0001, // BLOCK_4X8 - 0x0001, // BLOCK_8X4 - 0x0001, // BLOCK_8X8 - 0x0001, // BLOCK_8X16, - 0x0001, // BLOCK_16X8 - 0x0001, // BLOCK_16X16 - 0x0001, // BLOCK_16X32, - 0x0003, // BLOCK_32X16, - 0x0003, // BLOCK_32X32, - 0x0003, // BLOCK_32X64, - 0x000f, // BLOCK_64X32, - 0x000f, // BLOCK_64X64 -}; - -// 64 bit mask to shift and set for each uv prediction size -static const uint16_t size_mask_uv[BLOCK_SIZES] = { - 0x0001, // BLOCK_4X4 - 0x0001, // BLOCK_4X8 - 0x0001, // BLOCK_8X4 - 0x0001, // BLOCK_8X8 - 0x0001, // BLOCK_8X16, - 0x0001, // BLOCK_16X8 - 0x0001, // BLOCK_16X16 - 0x0011, // BLOCK_16X32, - 0x0003, // BLOCK_32X16, - 0x0033, // BLOCK_32X32, - 0x3333, // BLOCK_32X64, - 0x00ff, // BLOCK_64X32, - 0xffff, // BLOCK_64X64 -}; -static const uint16_t left_border_uv = 0x1111; -static const uint16_t above_border_uv = 0x000f; - -static const int mode_lf_lut[MB_MODE_COUNT] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // INTRA_MODES - 1, 1, 0, 1 // INTER_MODES (ZEROMV == 0) -}; - -static void update_sharpness(loop_filter_info_n *lfi, int sharpness_lvl) { - int lvl; - - // For each possible value for the loop filter fill out limits - for (lvl = 0; lvl <= MAX_LOOP_FILTER; lvl++) { - // Set loop filter parameters that control sharpness. - int block_inside_limit = lvl >> ((sharpness_lvl > 0) + (sharpness_lvl > 4)); - - if (sharpness_lvl > 0) { - if (block_inside_limit > (9 - sharpness_lvl)) - block_inside_limit = (9 - sharpness_lvl); - } - - if (block_inside_limit < 1) - block_inside_limit = 1; - - vpx_memset(lfi->lfthr[lvl].lim, block_inside_limit, SIMD_WIDTH); - vpx_memset(lfi->lfthr[lvl].mblim, (2 * (lvl + 2) + block_inside_limit), - SIMD_WIDTH); - } -} - -static uint8_t get_filter_level(const loop_filter_info_n *lfi_n, - const MB_MODE_INFO *mbmi) { - return lfi_n->lvl[mbmi->segment_id][mbmi->ref_frame[0]] - [mode_lf_lut[mbmi->mode]]; -} - -void vp9_loop_filter_init(VP9_COMMON *cm) { - loop_filter_info_n *lfi = &cm->lf_info; - struct loopfilter *lf = &cm->lf; - int lvl; - - // init limits for given sharpness - update_sharpness(lfi, lf->sharpness_level); - lf->last_sharpness_level = lf->sharpness_level; - - // init hev threshold const vectors - for (lvl = 0; lvl <= MAX_LOOP_FILTER; lvl++) - vpx_memset(lfi->lfthr[lvl].hev_thr, (lvl >> 4), SIMD_WIDTH); -} - -void vp9_loop_filter_frame_init(VP9_COMMON *cm, int default_filt_lvl) { - int seg_id; - // n_shift is the multiplier for lf_deltas - // the multiplier is 1 for when filter_lvl is between 0 and 31; - // 2 when filter_lvl is between 32 and 63 - const int scale = 1 << (default_filt_lvl >> 5); - loop_filter_info_n *const lfi = &cm->lf_info; - struct loopfilter *const lf = &cm->lf; - const struct segmentation *const seg = &cm->seg; - - // update limits if sharpness has changed - if (lf->last_sharpness_level != lf->sharpness_level) { - update_sharpness(lfi, lf->sharpness_level); - lf->last_sharpness_level = lf->sharpness_level; - } - - for (seg_id = 0; seg_id < MAX_SEGMENTS; seg_id++) { - int lvl_seg = default_filt_lvl; - if (vp9_segfeature_active(seg, seg_id, SEG_LVL_ALT_LF)) { - const int data = vp9_get_segdata(seg, seg_id, SEG_LVL_ALT_LF); - lvl_seg = clamp(seg->abs_delta == SEGMENT_ABSDATA ? - data : default_filt_lvl + data, - 0, MAX_LOOP_FILTER); - } - - if (!lf->mode_ref_delta_enabled) { - // we could get rid of this if we assume that deltas are set to - // zero when not in use; encoder always uses deltas - vpx_memset(lfi->lvl[seg_id], lvl_seg, sizeof(lfi->lvl[seg_id])); - } else { - int ref, mode; - const int intra_lvl = lvl_seg + lf->ref_deltas[INTRA_FRAME] * scale; - lfi->lvl[seg_id][INTRA_FRAME][0] = clamp(intra_lvl, 0, MAX_LOOP_FILTER); - - for (ref = LAST_FRAME; ref < MAX_REF_FRAMES; ++ref) { - for (mode = 0; mode < MAX_MODE_LF_DELTAS; ++mode) { - const int inter_lvl = lvl_seg + lf->ref_deltas[ref] * scale - + lf->mode_deltas[mode] * scale; - lfi->lvl[seg_id][ref][mode] = clamp(inter_lvl, 0, MAX_LOOP_FILTER); - } - } - } - } -} - -static void filter_selectively_vert_row2(PLANE_TYPE plane_type, - uint8_t *s, int pitch, - unsigned int mask_16x16_l, - unsigned int mask_8x8_l, - unsigned int mask_4x4_l, - unsigned int mask_4x4_int_l, - const loop_filter_info_n *lfi_n, - const uint8_t *lfl) { - const int mask_shift = plane_type ? 4 : 8; - const int mask_cutoff = plane_type ? 0xf : 0xff; - const int lfl_forward = plane_type ? 4 : 8; - - unsigned int mask_16x16_0 = mask_16x16_l & mask_cutoff; - unsigned int mask_8x8_0 = mask_8x8_l & mask_cutoff; - unsigned int mask_4x4_0 = mask_4x4_l & mask_cutoff; - unsigned int mask_4x4_int_0 = mask_4x4_int_l & mask_cutoff; - unsigned int mask_16x16_1 = (mask_16x16_l >> mask_shift) & mask_cutoff; - unsigned int mask_8x8_1 = (mask_8x8_l >> mask_shift) & mask_cutoff; - unsigned int mask_4x4_1 = (mask_4x4_l >> mask_shift) & mask_cutoff; - unsigned int mask_4x4_int_1 = (mask_4x4_int_l >> mask_shift) & mask_cutoff; - unsigned int mask; - - for (mask = mask_16x16_0 | mask_8x8_0 | mask_4x4_0 | mask_4x4_int_0 | - mask_16x16_1 | mask_8x8_1 | mask_4x4_1 | mask_4x4_int_1; - mask; mask >>= 1) { - const loop_filter_thresh *lfi0 = lfi_n->lfthr + *lfl; - const loop_filter_thresh *lfi1 = lfi_n->lfthr + *(lfl + lfl_forward); - - // TODO(yunqingwang): count in loopfilter functions should be removed. - if (mask & 1) { - if ((mask_16x16_0 | mask_16x16_1) & 1) { - if ((mask_16x16_0 & mask_16x16_1) & 1) { - vp9_lpf_vertical_16_dual(s, pitch, lfi0->mblim, lfi0->lim, - lfi0->hev_thr); - } else if (mask_16x16_0 & 1) { - vp9_lpf_vertical_16(s, pitch, lfi0->mblim, lfi0->lim, - lfi0->hev_thr); - } else { - vp9_lpf_vertical_16(s + 8 *pitch, pitch, lfi1->mblim, - lfi1->lim, lfi1->hev_thr); - } - } - - if ((mask_8x8_0 | mask_8x8_1) & 1) { - if ((mask_8x8_0 & mask_8x8_1) & 1) { - vp9_lpf_vertical_8_dual(s, pitch, lfi0->mblim, lfi0->lim, - lfi0->hev_thr, lfi1->mblim, lfi1->lim, - lfi1->hev_thr); - } else if (mask_8x8_0 & 1) { - vp9_lpf_vertical_8(s, pitch, lfi0->mblim, lfi0->lim, lfi0->hev_thr, - 1); - } else { - vp9_lpf_vertical_8(s + 8 * pitch, pitch, lfi1->mblim, lfi1->lim, - lfi1->hev_thr, 1); - } - } - - if ((mask_4x4_0 | mask_4x4_1) & 1) { - if ((mask_4x4_0 & mask_4x4_1) & 1) { - vp9_lpf_vertical_4_dual(s, pitch, lfi0->mblim, lfi0->lim, - lfi0->hev_thr, lfi1->mblim, lfi1->lim, - lfi1->hev_thr); - } else if (mask_4x4_0 & 1) { - vp9_lpf_vertical_4(s, pitch, lfi0->mblim, lfi0->lim, lfi0->hev_thr, - 1); - } else { - vp9_lpf_vertical_4(s + 8 * pitch, pitch, lfi1->mblim, lfi1->lim, - lfi1->hev_thr, 1); - } - } - - if ((mask_4x4_int_0 | mask_4x4_int_1) & 1) { - if ((mask_4x4_int_0 & mask_4x4_int_1) & 1) { - vp9_lpf_vertical_4_dual(s + 4, pitch, lfi0->mblim, lfi0->lim, - lfi0->hev_thr, lfi1->mblim, lfi1->lim, - lfi1->hev_thr); - } else if (mask_4x4_int_0 & 1) { - vp9_lpf_vertical_4(s + 4, pitch, lfi0->mblim, lfi0->lim, - lfi0->hev_thr, 1); - } else { - vp9_lpf_vertical_4(s + 8 * pitch + 4, pitch, lfi1->mblim, lfi1->lim, - lfi1->hev_thr, 1); - } - } - } - - s += 8; - lfl += 1; - mask_16x16_0 >>= 1; - mask_8x8_0 >>= 1; - mask_4x4_0 >>= 1; - mask_4x4_int_0 >>= 1; - mask_16x16_1 >>= 1; - mask_8x8_1 >>= 1; - mask_4x4_1 >>= 1; - mask_4x4_int_1 >>= 1; - } -} - -#if CONFIG_VP9_HIGHBITDEPTH -static void highbd_filter_selectively_vert_row2(PLANE_TYPE plane_type, - uint16_t *s, int pitch, - unsigned int mask_16x16_l, - unsigned int mask_8x8_l, - unsigned int mask_4x4_l, - unsigned int mask_4x4_int_l, - const loop_filter_info_n *lfi_n, - const uint8_t *lfl, int bd) { - const int mask_shift = plane_type ? 4 : 8; - const int mask_cutoff = plane_type ? 0xf : 0xff; - const int lfl_forward = plane_type ? 4 : 8; - - unsigned int mask_16x16_0 = mask_16x16_l & mask_cutoff; - unsigned int mask_8x8_0 = mask_8x8_l & mask_cutoff; - unsigned int mask_4x4_0 = mask_4x4_l & mask_cutoff; - unsigned int mask_4x4_int_0 = mask_4x4_int_l & mask_cutoff; - unsigned int mask_16x16_1 = (mask_16x16_l >> mask_shift) & mask_cutoff; - unsigned int mask_8x8_1 = (mask_8x8_l >> mask_shift) & mask_cutoff; - unsigned int mask_4x4_1 = (mask_4x4_l >> mask_shift) & mask_cutoff; - unsigned int mask_4x4_int_1 = (mask_4x4_int_l >> mask_shift) & mask_cutoff; - unsigned int mask; - - for (mask = mask_16x16_0 | mask_8x8_0 | mask_4x4_0 | mask_4x4_int_0 | - mask_16x16_1 | mask_8x8_1 | mask_4x4_1 | mask_4x4_int_1; - mask; mask >>= 1) { - const loop_filter_thresh *lfi0 = lfi_n->lfthr + *lfl; - const loop_filter_thresh *lfi1 = lfi_n->lfthr + *(lfl + lfl_forward); - - // TODO(yunqingwang): count in loopfilter functions should be removed. - if (mask & 1) { - if ((mask_16x16_0 | mask_16x16_1) & 1) { - if ((mask_16x16_0 & mask_16x16_1) & 1) { - vp9_highbd_lpf_vertical_16_dual(s, pitch, lfi0->mblim, lfi0->lim, - lfi0->hev_thr, bd); - } else if (mask_16x16_0 & 1) { - vp9_highbd_lpf_vertical_16(s, pitch, lfi0->mblim, lfi0->lim, - lfi0->hev_thr, bd); - } else { - vp9_highbd_lpf_vertical_16(s + 8 *pitch, pitch, lfi1->mblim, - lfi1->lim, lfi1->hev_thr, bd); - } - } - - if ((mask_8x8_0 | mask_8x8_1) & 1) { - if ((mask_8x8_0 & mask_8x8_1) & 1) { - vp9_highbd_lpf_vertical_8_dual(s, pitch, lfi0->mblim, lfi0->lim, - lfi0->hev_thr, lfi1->mblim, lfi1->lim, - lfi1->hev_thr, bd); - } else if (mask_8x8_0 & 1) { - vp9_highbd_lpf_vertical_8(s, pitch, lfi0->mblim, lfi0->lim, - lfi0->hev_thr, 1, bd); - } else { - vp9_highbd_lpf_vertical_8(s + 8 * pitch, pitch, lfi1->mblim, - lfi1->lim, lfi1->hev_thr, 1, bd); - } - } - - if ((mask_4x4_0 | mask_4x4_1) & 1) { - if ((mask_4x4_0 & mask_4x4_1) & 1) { - vp9_highbd_lpf_vertical_4_dual(s, pitch, lfi0->mblim, lfi0->lim, - lfi0->hev_thr, lfi1->mblim, lfi1->lim, - lfi1->hev_thr, bd); - } else if (mask_4x4_0 & 1) { - vp9_highbd_lpf_vertical_4(s, pitch, lfi0->mblim, lfi0->lim, - lfi0->hev_thr, 1, bd); - } else { - vp9_highbd_lpf_vertical_4(s + 8 * pitch, pitch, lfi1->mblim, - lfi1->lim, lfi1->hev_thr, 1, bd); - } - } - - if ((mask_4x4_int_0 | mask_4x4_int_1) & 1) { - if ((mask_4x4_int_0 & mask_4x4_int_1) & 1) { - vp9_highbd_lpf_vertical_4_dual(s + 4, pitch, lfi0->mblim, lfi0->lim, - lfi0->hev_thr, lfi1->mblim, lfi1->lim, - lfi1->hev_thr, bd); - } else if (mask_4x4_int_0 & 1) { - vp9_highbd_lpf_vertical_4(s + 4, pitch, lfi0->mblim, lfi0->lim, - lfi0->hev_thr, 1, bd); - } else { - vp9_highbd_lpf_vertical_4(s + 8 * pitch + 4, pitch, lfi1->mblim, - lfi1->lim, lfi1->hev_thr, 1, bd); - } - } - } - - s += 8; - lfl += 1; - mask_16x16_0 >>= 1; - mask_8x8_0 >>= 1; - mask_4x4_0 >>= 1; - mask_4x4_int_0 >>= 1; - mask_16x16_1 >>= 1; - mask_8x8_1 >>= 1; - mask_4x4_1 >>= 1; - mask_4x4_int_1 >>= 1; - } -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -static void filter_selectively_horiz(uint8_t *s, int pitch, - unsigned int mask_16x16, - unsigned int mask_8x8, - unsigned int mask_4x4, - unsigned int mask_4x4_int, - const loop_filter_info_n *lfi_n, - const uint8_t *lfl) { - unsigned int mask; - int count; - - for (mask = mask_16x16 | mask_8x8 | mask_4x4 | mask_4x4_int; - mask; mask >>= count) { - const loop_filter_thresh *lfi = lfi_n->lfthr + *lfl; - - count = 1; - if (mask & 1) { - if (mask_16x16 & 1) { - if ((mask_16x16 & 3) == 3) { - vp9_lpf_horizontal_16(s, pitch, lfi->mblim, lfi->lim, - lfi->hev_thr, 2); - count = 2; - } else { - vp9_lpf_horizontal_16(s, pitch, lfi->mblim, lfi->lim, - lfi->hev_thr, 1); - } - } else if (mask_8x8 & 1) { - if ((mask_8x8 & 3) == 3) { - // Next block's thresholds. - const loop_filter_thresh *lfin = lfi_n->lfthr + *(lfl + 1); - - vp9_lpf_horizontal_8_dual(s, pitch, lfi->mblim, lfi->lim, - lfi->hev_thr, lfin->mblim, lfin->lim, - lfin->hev_thr); - - if ((mask_4x4_int & 3) == 3) { - vp9_lpf_horizontal_4_dual(s + 4 * pitch, pitch, lfi->mblim, - lfi->lim, lfi->hev_thr, lfin->mblim, - lfin->lim, lfin->hev_thr); - } else { - if (mask_4x4_int & 1) - vp9_lpf_horizontal_4(s + 4 * pitch, pitch, lfi->mblim, lfi->lim, - lfi->hev_thr, 1); - else if (mask_4x4_int & 2) - vp9_lpf_horizontal_4(s + 8 + 4 * pitch, pitch, lfin->mblim, - lfin->lim, lfin->hev_thr, 1); - } - count = 2; - } else { - vp9_lpf_horizontal_8(s, pitch, lfi->mblim, lfi->lim, lfi->hev_thr, 1); - - if (mask_4x4_int & 1) - vp9_lpf_horizontal_4(s + 4 * pitch, pitch, lfi->mblim, lfi->lim, - lfi->hev_thr, 1); - } - } else if (mask_4x4 & 1) { - if ((mask_4x4 & 3) == 3) { - // Next block's thresholds. - const loop_filter_thresh *lfin = lfi_n->lfthr + *(lfl + 1); - - vp9_lpf_horizontal_4_dual(s, pitch, lfi->mblim, lfi->lim, - lfi->hev_thr, lfin->mblim, lfin->lim, - lfin->hev_thr); - if ((mask_4x4_int & 3) == 3) { - vp9_lpf_horizontal_4_dual(s + 4 * pitch, pitch, lfi->mblim, - lfi->lim, lfi->hev_thr, lfin->mblim, - lfin->lim, lfin->hev_thr); - } else { - if (mask_4x4_int & 1) - vp9_lpf_horizontal_4(s + 4 * pitch, pitch, lfi->mblim, lfi->lim, - lfi->hev_thr, 1); - else if (mask_4x4_int & 2) - vp9_lpf_horizontal_4(s + 8 + 4 * pitch, pitch, lfin->mblim, - lfin->lim, lfin->hev_thr, 1); - } - count = 2; - } else { - vp9_lpf_horizontal_4(s, pitch, lfi->mblim, lfi->lim, lfi->hev_thr, 1); - - if (mask_4x4_int & 1) - vp9_lpf_horizontal_4(s + 4 * pitch, pitch, lfi->mblim, lfi->lim, - lfi->hev_thr, 1); - } - } else if (mask_4x4_int & 1) { - vp9_lpf_horizontal_4(s + 4 * pitch, pitch, lfi->mblim, lfi->lim, - lfi->hev_thr, 1); - } - } - s += 8 * count; - lfl += count; - mask_16x16 >>= count; - mask_8x8 >>= count; - mask_4x4 >>= count; - mask_4x4_int >>= count; - } -} - -#if CONFIG_VP9_HIGHBITDEPTH -static void highbd_filter_selectively_horiz(uint16_t *s, int pitch, - unsigned int mask_16x16, - unsigned int mask_8x8, - unsigned int mask_4x4, - unsigned int mask_4x4_int, - const loop_filter_info_n *lfi_n, - const uint8_t *lfl, int bd) { - unsigned int mask; - int count; - - for (mask = mask_16x16 | mask_8x8 | mask_4x4 | mask_4x4_int; - mask; mask >>= count) { - const loop_filter_thresh *lfi = lfi_n->lfthr + *lfl; - - count = 1; - if (mask & 1) { - if (mask_16x16 & 1) { - if ((mask_16x16 & 3) == 3) { - vp9_highbd_lpf_horizontal_16(s, pitch, lfi->mblim, lfi->lim, - lfi->hev_thr, 2, bd); - count = 2; - } else { - vp9_highbd_lpf_horizontal_16(s, pitch, lfi->mblim, lfi->lim, - lfi->hev_thr, 1, bd); - } - } else if (mask_8x8 & 1) { - if ((mask_8x8 & 3) == 3) { - // Next block's thresholds. - const loop_filter_thresh *lfin = lfi_n->lfthr + *(lfl + 1); - - vp9_highbd_lpf_horizontal_8_dual(s, pitch, lfi->mblim, lfi->lim, - lfi->hev_thr, lfin->mblim, lfin->lim, - lfin->hev_thr, bd); - - if ((mask_4x4_int & 3) == 3) { - vp9_highbd_lpf_horizontal_4_dual(s + 4 * pitch, pitch, lfi->mblim, - lfi->lim, lfi->hev_thr, - lfin->mblim, lfin->lim, - lfin->hev_thr, bd); - } else { - if (mask_4x4_int & 1) { - vp9_highbd_lpf_horizontal_4(s + 4 * pitch, pitch, lfi->mblim, - lfi->lim, lfi->hev_thr, 1, bd); - } else if (mask_4x4_int & 2) { - vp9_highbd_lpf_horizontal_4(s + 8 + 4 * pitch, pitch, lfin->mblim, - lfin->lim, lfin->hev_thr, 1, bd); - } - } - count = 2; - } else { - vp9_highbd_lpf_horizontal_8(s, pitch, lfi->mblim, lfi->lim, - lfi->hev_thr, 1, bd); - - if (mask_4x4_int & 1) { - vp9_highbd_lpf_horizontal_4(s + 4 * pitch, pitch, lfi->mblim, - lfi->lim, lfi->hev_thr, 1, bd); - } - } - } else if (mask_4x4 & 1) { - if ((mask_4x4 & 3) == 3) { - // Next block's thresholds. - const loop_filter_thresh *lfin = lfi_n->lfthr + *(lfl + 1); - - vp9_highbd_lpf_horizontal_4_dual(s, pitch, lfi->mblim, lfi->lim, - lfi->hev_thr, lfin->mblim, lfin->lim, - lfin->hev_thr, bd); - if ((mask_4x4_int & 3) == 3) { - vp9_highbd_lpf_horizontal_4_dual(s + 4 * pitch, pitch, lfi->mblim, - lfi->lim, lfi->hev_thr, - lfin->mblim, lfin->lim, - lfin->hev_thr, bd); - } else { - if (mask_4x4_int & 1) { - vp9_highbd_lpf_horizontal_4(s + 4 * pitch, pitch, lfi->mblim, - lfi->lim, lfi->hev_thr, 1, bd); - } else if (mask_4x4_int & 2) { - vp9_highbd_lpf_horizontal_4(s + 8 + 4 * pitch, pitch, lfin->mblim, - lfin->lim, lfin->hev_thr, 1, bd); - } - } - count = 2; - } else { - vp9_highbd_lpf_horizontal_4(s, pitch, lfi->mblim, lfi->lim, - lfi->hev_thr, 1, bd); - - if (mask_4x4_int & 1) { - vp9_highbd_lpf_horizontal_4(s + 4 * pitch, pitch, lfi->mblim, - lfi->lim, lfi->hev_thr, 1, bd); - } - } - } else if (mask_4x4_int & 1) { - vp9_highbd_lpf_horizontal_4(s + 4 * pitch, pitch, lfi->mblim, lfi->lim, - lfi->hev_thr, 1, bd); - } - } - s += 8 * count; - lfl += count; - mask_16x16 >>= count; - mask_8x8 >>= count; - mask_4x4 >>= count; - mask_4x4_int >>= count; - } -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -// This function ors into the current lfm structure, where to do loop -// filters for the specific mi we are looking at. It uses information -// including the block_size_type (32x16, 32x32, etc.), the transform size, -// whether there were any coefficients encoded, and the loop filter strength -// block we are currently looking at. Shift is used to position the -// 1's we produce. -// TODO(JBB) Need another function for different resolution color.. -static void build_masks(const loop_filter_info_n *const lfi_n, - const MODE_INFO *mi, const int shift_y, - const int shift_uv, - LOOP_FILTER_MASK *lfm) { - const MB_MODE_INFO *mbmi = &mi->mbmi; - const BLOCK_SIZE block_size = mbmi->sb_type; - const TX_SIZE tx_size_y = mbmi->tx_size; - const TX_SIZE tx_size_uv = get_uv_tx_size_impl(tx_size_y, block_size, 1, 1); - const int filter_level = get_filter_level(lfi_n, mbmi); - uint64_t *const left_y = &lfm->left_y[tx_size_y]; - uint64_t *const above_y = &lfm->above_y[tx_size_y]; - uint64_t *const int_4x4_y = &lfm->int_4x4_y; - uint16_t *const left_uv = &lfm->left_uv[tx_size_uv]; - uint16_t *const above_uv = &lfm->above_uv[tx_size_uv]; - uint16_t *const int_4x4_uv = &lfm->int_4x4_uv; - int i; - - // If filter level is 0 we don't loop filter. - if (!filter_level) { - return; - } else { - const int w = num_8x8_blocks_wide_lookup[block_size]; - const int h = num_8x8_blocks_high_lookup[block_size]; - int index = shift_y; - for (i = 0; i < h; i++) { - vpx_memset(&lfm->lfl_y[index], filter_level, w); - index += 8; - } - } - - // These set 1 in the current block size for the block size edges. - // For instance if the block size is 32x16, we'll set: - // above = 1111 - // 0000 - // and - // left = 1000 - // = 1000 - // NOTE : In this example the low bit is left most ( 1000 ) is stored as - // 1, not 8... - // - // U and V set things on a 16 bit scale. - // - *above_y |= above_prediction_mask[block_size] << shift_y; - *above_uv |= above_prediction_mask_uv[block_size] << shift_uv; - *left_y |= left_prediction_mask[block_size] << shift_y; - *left_uv |= left_prediction_mask_uv[block_size] << shift_uv; - - // If the block has no coefficients and is not intra we skip applying - // the loop filter on block edges. - if (mbmi->skip && is_inter_block(mbmi)) - return; - - // Here we are adding a mask for the transform size. The transform - // size mask is set to be correct for a 64x64 prediction block size. We - // mask to match the size of the block we are working on and then shift it - // into place.. - *above_y |= (size_mask[block_size] & - above_64x64_txform_mask[tx_size_y]) << shift_y; - *above_uv |= (size_mask_uv[block_size] & - above_64x64_txform_mask_uv[tx_size_uv]) << shift_uv; - - *left_y |= (size_mask[block_size] & - left_64x64_txform_mask[tx_size_y]) << shift_y; - *left_uv |= (size_mask_uv[block_size] & - left_64x64_txform_mask_uv[tx_size_uv]) << shift_uv; - - // Here we are trying to determine what to do with the internal 4x4 block - // boundaries. These differ from the 4x4 boundaries on the outside edge of - // an 8x8 in that the internal ones can be skipped and don't depend on - // the prediction block size. - if (tx_size_y == TX_4X4) - *int_4x4_y |= (size_mask[block_size] & 0xffffffffffffffffULL) << shift_y; - - if (tx_size_uv == TX_4X4) - *int_4x4_uv |= (size_mask_uv[block_size] & 0xffff) << shift_uv; -} - -// This function does the same thing as the one above with the exception that -// it only affects the y masks. It exists because for blocks < 16x16 in size, -// we only update u and v masks on the first block. -static void build_y_mask(const loop_filter_info_n *const lfi_n, - const MODE_INFO *mi, const int shift_y, - LOOP_FILTER_MASK *lfm) { - const MB_MODE_INFO *mbmi = &mi->mbmi; - const BLOCK_SIZE block_size = mbmi->sb_type; - const TX_SIZE tx_size_y = mbmi->tx_size; - const int filter_level = get_filter_level(lfi_n, mbmi); - uint64_t *const left_y = &lfm->left_y[tx_size_y]; - uint64_t *const above_y = &lfm->above_y[tx_size_y]; - uint64_t *const int_4x4_y = &lfm->int_4x4_y; - int i; - - if (!filter_level) { - return; - } else { - const int w = num_8x8_blocks_wide_lookup[block_size]; - const int h = num_8x8_blocks_high_lookup[block_size]; - int index = shift_y; - for (i = 0; i < h; i++) { - vpx_memset(&lfm->lfl_y[index], filter_level, w); - index += 8; - } - } - - *above_y |= above_prediction_mask[block_size] << shift_y; - *left_y |= left_prediction_mask[block_size] << shift_y; - - if (mbmi->skip && is_inter_block(mbmi)) - return; - - *above_y |= (size_mask[block_size] & - above_64x64_txform_mask[tx_size_y]) << shift_y; - - *left_y |= (size_mask[block_size] & - left_64x64_txform_mask[tx_size_y]) << shift_y; - - if (tx_size_y == TX_4X4) - *int_4x4_y |= (size_mask[block_size] & 0xffffffffffffffffULL) << shift_y; -} - -// This function sets up the bit masks for the entire 64x64 region represented -// by mi_row, mi_col. -// TODO(JBB): This function only works for yv12. -void vp9_setup_mask(VP9_COMMON *const cm, const int mi_row, const int mi_col, - MODE_INFO *mi, const int mode_info_stride, - LOOP_FILTER_MASK *lfm) { - int idx_32, idx_16, idx_8; - const loop_filter_info_n *const lfi_n = &cm->lf_info; - MODE_INFO *mip = mi; - MODE_INFO *mip2 = mi; - - // These are offsets to the next mi in the 64x64 block. It is what gets - // added to the mi ptr as we go through each loop. It helps us to avoid - // setting up special row and column counters for each index. The last step - // brings us out back to the starting position. - const int offset_32[] = {4, (mode_info_stride << 2) - 4, 4, - -(mode_info_stride << 2) - 4}; - const int offset_16[] = {2, (mode_info_stride << 1) - 2, 2, - -(mode_info_stride << 1) - 2}; - const int offset[] = {1, mode_info_stride - 1, 1, -mode_info_stride - 1}; - - // Following variables represent shifts to position the current block - // mask over the appropriate block. A shift of 36 to the left will move - // the bits for the final 32 by 32 block in the 64x64 up 4 rows and left - // 4 rows to the appropriate spot. - const int shift_32_y[] = {0, 4, 32, 36}; - const int shift_16_y[] = {0, 2, 16, 18}; - const int shift_8_y[] = {0, 1, 8, 9}; - const int shift_32_uv[] = {0, 2, 8, 10}; - const int shift_16_uv[] = {0, 1, 4, 5}; - int i; - const int max_rows = (mi_row + MI_BLOCK_SIZE > cm->mi_rows ? - cm->mi_rows - mi_row : MI_BLOCK_SIZE); - const int max_cols = (mi_col + MI_BLOCK_SIZE > cm->mi_cols ? - cm->mi_cols - mi_col : MI_BLOCK_SIZE); - - vp9_zero(*lfm); - assert(mip != NULL); - - // TODO(jimbankoski): Try moving most of the following code into decode - // loop and storing lfm in the mbmi structure so that we don't have to go - // through the recursive loop structure multiple times. - switch (mip->mbmi.sb_type) { - case BLOCK_64X64: - build_masks(lfi_n, mip , 0, 0, lfm); - break; - case BLOCK_64X32: - build_masks(lfi_n, mip, 0, 0, lfm); - mip2 = mip + mode_info_stride * 4; - if (4 >= max_rows) - break; - build_masks(lfi_n, mip2, 32, 8, lfm); - break; - case BLOCK_32X64: - build_masks(lfi_n, mip, 0, 0, lfm); - mip2 = mip + 4; - if (4 >= max_cols) - break; - build_masks(lfi_n, mip2, 4, 2, lfm); - break; - default: - for (idx_32 = 0; idx_32 < 4; mip += offset_32[idx_32], ++idx_32) { - const int shift_y = shift_32_y[idx_32]; - const int shift_uv = shift_32_uv[idx_32]; - const int mi_32_col_offset = ((idx_32 & 1) << 2); - const int mi_32_row_offset = ((idx_32 >> 1) << 2); - if (mi_32_col_offset >= max_cols || mi_32_row_offset >= max_rows) - continue; - switch (mip->mbmi.sb_type) { - case BLOCK_32X32: - build_masks(lfi_n, mip, shift_y, shift_uv, lfm); - break; - case BLOCK_32X16: - build_masks(lfi_n, mip, shift_y, shift_uv, lfm); - if (mi_32_row_offset + 2 >= max_rows) - continue; - mip2 = mip + mode_info_stride * 2; - build_masks(lfi_n, mip2, shift_y + 16, shift_uv + 4, lfm); - break; - case BLOCK_16X32: - build_masks(lfi_n, mip, shift_y, shift_uv, lfm); - if (mi_32_col_offset + 2 >= max_cols) - continue; - mip2 = mip + 2; - build_masks(lfi_n, mip2, shift_y + 2, shift_uv + 1, lfm); - break; - default: - for (idx_16 = 0; idx_16 < 4; mip += offset_16[idx_16], ++idx_16) { - const int shift_y = shift_32_y[idx_32] + shift_16_y[idx_16]; - const int shift_uv = shift_32_uv[idx_32] + shift_16_uv[idx_16]; - const int mi_16_col_offset = mi_32_col_offset + - ((idx_16 & 1) << 1); - const int mi_16_row_offset = mi_32_row_offset + - ((idx_16 >> 1) << 1); - - if (mi_16_col_offset >= max_cols || mi_16_row_offset >= max_rows) - continue; - - switch (mip->mbmi.sb_type) { - case BLOCK_16X16: - build_masks(lfi_n, mip, shift_y, shift_uv, lfm); - break; - case BLOCK_16X8: - build_masks(lfi_n, mip, shift_y, shift_uv, lfm); - if (mi_16_row_offset + 1 >= max_rows) - continue; - mip2 = mip + mode_info_stride; - build_y_mask(lfi_n, mip2, shift_y+8, lfm); - break; - case BLOCK_8X16: - build_masks(lfi_n, mip, shift_y, shift_uv, lfm); - if (mi_16_col_offset +1 >= max_cols) - continue; - mip2 = mip + 1; - build_y_mask(lfi_n, mip2, shift_y+1, lfm); - break; - default: { - const int shift_y = shift_32_y[idx_32] + - shift_16_y[idx_16] + - shift_8_y[0]; - build_masks(lfi_n, mip, shift_y, shift_uv, lfm); - mip += offset[0]; - for (idx_8 = 1; idx_8 < 4; mip += offset[idx_8], ++idx_8) { - const int shift_y = shift_32_y[idx_32] + - shift_16_y[idx_16] + - shift_8_y[idx_8]; - const int mi_8_col_offset = mi_16_col_offset + - ((idx_8 & 1)); - const int mi_8_row_offset = mi_16_row_offset + - ((idx_8 >> 1)); - - if (mi_8_col_offset >= max_cols || - mi_8_row_offset >= max_rows) - continue; - build_y_mask(lfi_n, mip, shift_y, lfm); - } - break; - } - } - } - break; - } - } - break; - } - // The largest loopfilter we have is 16x16 so we use the 16x16 mask - // for 32x32 transforms also. - lfm->left_y[TX_16X16] |= lfm->left_y[TX_32X32]; - lfm->above_y[TX_16X16] |= lfm->above_y[TX_32X32]; - lfm->left_uv[TX_16X16] |= lfm->left_uv[TX_32X32]; - lfm->above_uv[TX_16X16] |= lfm->above_uv[TX_32X32]; - - // We do at least 8 tap filter on every 32x32 even if the transform size - // is 4x4. So if the 4x4 is set on a border pixel add it to the 8x8 and - // remove it from the 4x4. - lfm->left_y[TX_8X8] |= lfm->left_y[TX_4X4] & left_border; - lfm->left_y[TX_4X4] &= ~left_border; - lfm->above_y[TX_8X8] |= lfm->above_y[TX_4X4] & above_border; - lfm->above_y[TX_4X4] &= ~above_border; - lfm->left_uv[TX_8X8] |= lfm->left_uv[TX_4X4] & left_border_uv; - lfm->left_uv[TX_4X4] &= ~left_border_uv; - lfm->above_uv[TX_8X8] |= lfm->above_uv[TX_4X4] & above_border_uv; - lfm->above_uv[TX_4X4] &= ~above_border_uv; - - // We do some special edge handling. - if (mi_row + MI_BLOCK_SIZE > cm->mi_rows) { - const uint64_t rows = cm->mi_rows - mi_row; - - // Each pixel inside the border gets a 1, - const uint64_t mask_y = (((uint64_t) 1 << (rows << 3)) - 1); - const uint16_t mask_uv = (((uint16_t) 1 << (((rows + 1) >> 1) << 2)) - 1); - - // Remove values completely outside our border. - for (i = 0; i < TX_32X32; i++) { - lfm->left_y[i] &= mask_y; - lfm->above_y[i] &= mask_y; - lfm->left_uv[i] &= mask_uv; - lfm->above_uv[i] &= mask_uv; - } - lfm->int_4x4_y &= mask_y; - lfm->int_4x4_uv &= mask_uv; - - // We don't apply a wide loop filter on the last uv block row. If set - // apply the shorter one instead. - if (rows == 1) { - lfm->above_uv[TX_8X8] |= lfm->above_uv[TX_16X16]; - lfm->above_uv[TX_16X16] = 0; - } - if (rows == 5) { - lfm->above_uv[TX_8X8] |= lfm->above_uv[TX_16X16] & 0xff00; - lfm->above_uv[TX_16X16] &= ~(lfm->above_uv[TX_16X16] & 0xff00); - } - } - - if (mi_col + MI_BLOCK_SIZE > cm->mi_cols) { - const uint64_t columns = cm->mi_cols - mi_col; - - // Each pixel inside the border gets a 1, the multiply copies the border - // to where we need it. - const uint64_t mask_y = (((1 << columns) - 1)) * 0x0101010101010101ULL; - const uint16_t mask_uv = ((1 << ((columns + 1) >> 1)) - 1) * 0x1111; - - // Internal edges are not applied on the last column of the image so - // we mask 1 more for the internal edges - const uint16_t mask_uv_int = ((1 << (columns >> 1)) - 1) * 0x1111; - - // Remove the bits outside the image edge. - for (i = 0; i < TX_32X32; i++) { - lfm->left_y[i] &= mask_y; - lfm->above_y[i] &= mask_y; - lfm->left_uv[i] &= mask_uv; - lfm->above_uv[i] &= mask_uv; - } - lfm->int_4x4_y &= mask_y; - lfm->int_4x4_uv &= mask_uv_int; - - // We don't apply a wide loop filter on the last uv column. If set - // apply the shorter one instead. - if (columns == 1) { - lfm->left_uv[TX_8X8] |= lfm->left_uv[TX_16X16]; - lfm->left_uv[TX_16X16] = 0; - } - if (columns == 5) { - lfm->left_uv[TX_8X8] |= (lfm->left_uv[TX_16X16] & 0xcccc); - lfm->left_uv[TX_16X16] &= ~(lfm->left_uv[TX_16X16] & 0xcccc); - } - } - // We don't apply a loop filter on the first column in the image, mask that - // out. - if (mi_col == 0) { - for (i = 0; i < TX_32X32; i++) { - lfm->left_y[i] &= 0xfefefefefefefefeULL; - lfm->left_uv[i] &= 0xeeee; - } - } - - // Assert if we try to apply 2 different loop filters at the same position. - assert(!(lfm->left_y[TX_16X16] & lfm->left_y[TX_8X8])); - assert(!(lfm->left_y[TX_16X16] & lfm->left_y[TX_4X4])); - assert(!(lfm->left_y[TX_8X8] & lfm->left_y[TX_4X4])); - assert(!(lfm->int_4x4_y & lfm->left_y[TX_16X16])); - assert(!(lfm->left_uv[TX_16X16]&lfm->left_uv[TX_8X8])); - assert(!(lfm->left_uv[TX_16X16] & lfm->left_uv[TX_4X4])); - assert(!(lfm->left_uv[TX_8X8] & lfm->left_uv[TX_4X4])); - assert(!(lfm->int_4x4_uv & lfm->left_uv[TX_16X16])); - assert(!(lfm->above_y[TX_16X16] & lfm->above_y[TX_8X8])); - assert(!(lfm->above_y[TX_16X16] & lfm->above_y[TX_4X4])); - assert(!(lfm->above_y[TX_8X8] & lfm->above_y[TX_4X4])); - assert(!(lfm->int_4x4_y & lfm->above_y[TX_16X16])); - assert(!(lfm->above_uv[TX_16X16] & lfm->above_uv[TX_8X8])); - assert(!(lfm->above_uv[TX_16X16] & lfm->above_uv[TX_4X4])); - assert(!(lfm->above_uv[TX_8X8] & lfm->above_uv[TX_4X4])); - assert(!(lfm->int_4x4_uv & lfm->above_uv[TX_16X16])); -} - -static void filter_selectively_vert(uint8_t *s, int pitch, - unsigned int mask_16x16, - unsigned int mask_8x8, - unsigned int mask_4x4, - unsigned int mask_4x4_int, - const loop_filter_info_n *lfi_n, - const uint8_t *lfl) { - unsigned int mask; - - for (mask = mask_16x16 | mask_8x8 | mask_4x4 | mask_4x4_int; - mask; mask >>= 1) { - const loop_filter_thresh *lfi = lfi_n->lfthr + *lfl; - - if (mask & 1) { - if (mask_16x16 & 1) { - vp9_lpf_vertical_16(s, pitch, lfi->mblim, lfi->lim, lfi->hev_thr); - } else if (mask_8x8 & 1) { - vp9_lpf_vertical_8(s, pitch, lfi->mblim, lfi->lim, lfi->hev_thr, 1); - } else if (mask_4x4 & 1) { - vp9_lpf_vertical_4(s, pitch, lfi->mblim, lfi->lim, lfi->hev_thr, 1); - } - } - if (mask_4x4_int & 1) - vp9_lpf_vertical_4(s + 4, pitch, lfi->mblim, lfi->lim, lfi->hev_thr, 1); - s += 8; - lfl += 1; - mask_16x16 >>= 1; - mask_8x8 >>= 1; - mask_4x4 >>= 1; - mask_4x4_int >>= 1; - } -} - -#if CONFIG_VP9_HIGHBITDEPTH -static void highbd_filter_selectively_vert(uint16_t *s, int pitch, - unsigned int mask_16x16, - unsigned int mask_8x8, - unsigned int mask_4x4, - unsigned int mask_4x4_int, - const loop_filter_info_n *lfi_n, - const uint8_t *lfl, int bd) { - unsigned int mask; - - for (mask = mask_16x16 | mask_8x8 | mask_4x4 | mask_4x4_int; - mask; mask >>= 1) { - const loop_filter_thresh *lfi = lfi_n->lfthr + *lfl; - - if (mask & 1) { - if (mask_16x16 & 1) { - vp9_highbd_lpf_vertical_16(s, pitch, lfi->mblim, lfi->lim, - lfi->hev_thr, bd); - } else if (mask_8x8 & 1) { - vp9_highbd_lpf_vertical_8(s, pitch, lfi->mblim, lfi->lim, - lfi->hev_thr, 1, bd); - } else if (mask_4x4 & 1) { - vp9_highbd_lpf_vertical_4(s, pitch, lfi->mblim, lfi->lim, - lfi->hev_thr, 1, bd); - } - } - if (mask_4x4_int & 1) - vp9_highbd_lpf_vertical_4(s + 4, pitch, lfi->mblim, lfi->lim, - lfi->hev_thr, 1, bd); - s += 8; - lfl += 1; - mask_16x16 >>= 1; - mask_8x8 >>= 1; - mask_4x4 >>= 1; - mask_4x4_int >>= 1; - } -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -void vp9_filter_block_plane_non420(VP9_COMMON *cm, - struct macroblockd_plane *plane, - MODE_INFO *mi_8x8, - int mi_row, int mi_col) { - const int ss_x = plane->subsampling_x; - const int ss_y = plane->subsampling_y; - const int row_step = 1 << ss_y; - const int col_step = 1 << ss_x; - const int row_step_stride = cm->mi_stride * row_step; - struct buf_2d *const dst = &plane->dst; - uint8_t* const dst0 = dst->buf; - unsigned int mask_16x16[MI_BLOCK_SIZE] = {0}; - unsigned int mask_8x8[MI_BLOCK_SIZE] = {0}; - unsigned int mask_4x4[MI_BLOCK_SIZE] = {0}; - unsigned int mask_4x4_int[MI_BLOCK_SIZE] = {0}; - uint8_t lfl[MI_BLOCK_SIZE * MI_BLOCK_SIZE]; - int r, c; - - for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r += row_step) { - unsigned int mask_16x16_c = 0; - unsigned int mask_8x8_c = 0; - unsigned int mask_4x4_c = 0; - unsigned int border_mask; - - // Determine the vertical edges that need filtering - for (c = 0; c < MI_BLOCK_SIZE && mi_col + c < cm->mi_cols; c += col_step) { - const MODE_INFO *mi = mi_8x8[c].src_mi; - const BLOCK_SIZE sb_type = mi[0].mbmi.sb_type; - const int skip_this = mi[0].mbmi.skip && is_inter_block(&mi[0].mbmi); - // left edge of current unit is block/partition edge -> no skip - const int block_edge_left = (num_4x4_blocks_wide_lookup[sb_type] > 1) ? - !(c & (num_8x8_blocks_wide_lookup[sb_type] - 1)) : 1; - const int skip_this_c = skip_this && !block_edge_left; - // top edge of current unit is block/partition edge -> no skip - const int block_edge_above = (num_4x4_blocks_high_lookup[sb_type] > 1) ? - !(r & (num_8x8_blocks_high_lookup[sb_type] - 1)) : 1; - const int skip_this_r = skip_this && !block_edge_above; - const TX_SIZE tx_size = (plane->plane_type == PLANE_TYPE_UV) - ? get_uv_tx_size(&mi[0].mbmi, plane) - : mi[0].mbmi.tx_size; - const int skip_border_4x4_c = ss_x && mi_col + c == cm->mi_cols - 1; - const int skip_border_4x4_r = ss_y && mi_row + r == cm->mi_rows - 1; - - // Filter level can vary per MI - if (!(lfl[(r << 3) + (c >> ss_x)] = - get_filter_level(&cm->lf_info, &mi[0].mbmi))) - continue; - - // Build masks based on the transform size of each block - if (tx_size == TX_32X32) { - if (!skip_this_c && ((c >> ss_x) & 3) == 0) { - if (!skip_border_4x4_c) - mask_16x16_c |= 1 << (c >> ss_x); - else - mask_8x8_c |= 1 << (c >> ss_x); - } - if (!skip_this_r && ((r >> ss_y) & 3) == 0) { - if (!skip_border_4x4_r) - mask_16x16[r] |= 1 << (c >> ss_x); - else - mask_8x8[r] |= 1 << (c >> ss_x); - } - } else if (tx_size == TX_16X16) { - if (!skip_this_c && ((c >> ss_x) & 1) == 0) { - if (!skip_border_4x4_c) - mask_16x16_c |= 1 << (c >> ss_x); - else - mask_8x8_c |= 1 << (c >> ss_x); - } - if (!skip_this_r && ((r >> ss_y) & 1) == 0) { - if (!skip_border_4x4_r) - mask_16x16[r] |= 1 << (c >> ss_x); - else - mask_8x8[r] |= 1 << (c >> ss_x); - } - } else { - // force 8x8 filtering on 32x32 boundaries - if (!skip_this_c) { - if (tx_size == TX_8X8 || ((c >> ss_x) & 3) == 0) - mask_8x8_c |= 1 << (c >> ss_x); - else - mask_4x4_c |= 1 << (c >> ss_x); - } - - if (!skip_this_r) { - if (tx_size == TX_8X8 || ((r >> ss_y) & 3) == 0) - mask_8x8[r] |= 1 << (c >> ss_x); - else - mask_4x4[r] |= 1 << (c >> ss_x); - } - - if (!skip_this && tx_size < TX_8X8 && !skip_border_4x4_c) - mask_4x4_int[r] |= 1 << (c >> ss_x); - } - } - - // Disable filtering on the leftmost column - border_mask = ~(mi_col == 0); -#if CONFIG_VP9_HIGHBITDEPTH - if (cm->use_highbitdepth) { - highbd_filter_selectively_vert(CONVERT_TO_SHORTPTR(dst->buf), - dst->stride, - mask_16x16_c & border_mask, - mask_8x8_c & border_mask, - mask_4x4_c & border_mask, - mask_4x4_int[r], - &cm->lf_info, &lfl[r << 3], - (int)cm->bit_depth); - } else { - filter_selectively_vert(dst->buf, dst->stride, - mask_16x16_c & border_mask, - mask_8x8_c & border_mask, - mask_4x4_c & border_mask, - mask_4x4_int[r], - &cm->lf_info, &lfl[r << 3]); - } -#else - filter_selectively_vert(dst->buf, dst->stride, - mask_16x16_c & border_mask, - mask_8x8_c & border_mask, - mask_4x4_c & border_mask, - mask_4x4_int[r], - &cm->lf_info, &lfl[r << 3]); -#endif // CONFIG_VP9_HIGHBITDEPTH - dst->buf += 8 * dst->stride; - mi_8x8 += row_step_stride; - } - - // Now do horizontal pass - dst->buf = dst0; - for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r += row_step) { - const int skip_border_4x4_r = ss_y && mi_row + r == cm->mi_rows - 1; - const unsigned int mask_4x4_int_r = skip_border_4x4_r ? 0 : mask_4x4_int[r]; - - unsigned int mask_16x16_r; - unsigned int mask_8x8_r; - unsigned int mask_4x4_r; - - if (mi_row + r == 0) { - mask_16x16_r = 0; - mask_8x8_r = 0; - mask_4x4_r = 0; - } else { - mask_16x16_r = mask_16x16[r]; - mask_8x8_r = mask_8x8[r]; - mask_4x4_r = mask_4x4[r]; - } -#if CONFIG_VP9_HIGHBITDEPTH - if (cm->use_highbitdepth) { - highbd_filter_selectively_horiz(CONVERT_TO_SHORTPTR(dst->buf), - dst->stride, - mask_16x16_r, - mask_8x8_r, - mask_4x4_r, - mask_4x4_int_r, - &cm->lf_info, &lfl[r << 3], - (int)cm->bit_depth); - } else { - filter_selectively_horiz(dst->buf, dst->stride, - mask_16x16_r, - mask_8x8_r, - mask_4x4_r, - mask_4x4_int_r, - &cm->lf_info, &lfl[r << 3]); - } -#else - filter_selectively_horiz(dst->buf, dst->stride, - mask_16x16_r, - mask_8x8_r, - mask_4x4_r, - mask_4x4_int_r, - &cm->lf_info, &lfl[r << 3]); -#endif // CONFIG_VP9_HIGHBITDEPTH - dst->buf += 8 * dst->stride; - } -} - -void vp9_filter_block_plane(VP9_COMMON *const cm, - struct macroblockd_plane *const plane, - int mi_row, - LOOP_FILTER_MASK *lfm) { - struct buf_2d *const dst = &plane->dst; - uint8_t* const dst0 = dst->buf; - int r, c; - - if (!plane->plane_type) { - uint64_t mask_16x16 = lfm->left_y[TX_16X16]; - uint64_t mask_8x8 = lfm->left_y[TX_8X8]; - uint64_t mask_4x4 = lfm->left_y[TX_4X4]; - uint64_t mask_4x4_int = lfm->int_4x4_y; - - // Vertical pass: do 2 rows at one time - for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r += 2) { - unsigned int mask_16x16_l = mask_16x16 & 0xffff; - unsigned int mask_8x8_l = mask_8x8 & 0xffff; - unsigned int mask_4x4_l = mask_4x4 & 0xffff; - unsigned int mask_4x4_int_l = mask_4x4_int & 0xffff; - - // Disable filtering on the leftmost column. -#if CONFIG_VP9_HIGHBITDEPTH - if (cm->use_highbitdepth) { - highbd_filter_selectively_vert_row2(plane->plane_type, - CONVERT_TO_SHORTPTR(dst->buf), - dst->stride, - mask_16x16_l, - mask_8x8_l, - mask_4x4_l, - mask_4x4_int_l, - &cm->lf_info, &lfm->lfl_y[r << 3], - (int)cm->bit_depth); - } else { - filter_selectively_vert_row2(plane->plane_type, - dst->buf, dst->stride, - mask_16x16_l, - mask_8x8_l, - mask_4x4_l, - mask_4x4_int_l, - &cm->lf_info, - &lfm->lfl_y[r << 3]); - } -#else - filter_selectively_vert_row2(plane->plane_type, - dst->buf, dst->stride, - mask_16x16_l, - mask_8x8_l, - mask_4x4_l, - mask_4x4_int_l, - &cm->lf_info, &lfm->lfl_y[r << 3]); -#endif // CONFIG_VP9_HIGHBITDEPTH - dst->buf += 16 * dst->stride; - mask_16x16 >>= 16; - mask_8x8 >>= 16; - mask_4x4 >>= 16; - mask_4x4_int >>= 16; - } - - // Horizontal pass - dst->buf = dst0; - mask_16x16 = lfm->above_y[TX_16X16]; - mask_8x8 = lfm->above_y[TX_8X8]; - mask_4x4 = lfm->above_y[TX_4X4]; - mask_4x4_int = lfm->int_4x4_y; - - for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r++) { - unsigned int mask_16x16_r; - unsigned int mask_8x8_r; - unsigned int mask_4x4_r; - - if (mi_row + r == 0) { - mask_16x16_r = 0; - mask_8x8_r = 0; - mask_4x4_r = 0; - } else { - mask_16x16_r = mask_16x16 & 0xff; - mask_8x8_r = mask_8x8 & 0xff; - mask_4x4_r = mask_4x4 & 0xff; - } - -#if CONFIG_VP9_HIGHBITDEPTH - if (cm->use_highbitdepth) { - highbd_filter_selectively_horiz(CONVERT_TO_SHORTPTR(dst->buf), - dst->stride, - mask_16x16_r, - mask_8x8_r, - mask_4x4_r, - mask_4x4_int & 0xff, - &cm->lf_info, - &lfm->lfl_y[r << 3], - (int)cm->bit_depth); - } else { - filter_selectively_horiz(dst->buf, dst->stride, - mask_16x16_r, - mask_8x8_r, - mask_4x4_r, - mask_4x4_int & 0xff, - &cm->lf_info, - &lfm->lfl_y[r << 3]); - } -#else - filter_selectively_horiz(dst->buf, dst->stride, - mask_16x16_r, - mask_8x8_r, - mask_4x4_r, - mask_4x4_int & 0xff, - &cm->lf_info, - &lfm->lfl_y[r << 3]); -#endif // CONFIG_VP9_HIGHBITDEPTH - - dst->buf += 8 * dst->stride; - mask_16x16 >>= 8; - mask_8x8 >>= 8; - mask_4x4 >>= 8; - mask_4x4_int >>= 8; - } - } else { - uint16_t mask_16x16 = lfm->left_uv[TX_16X16]; - uint16_t mask_8x8 = lfm->left_uv[TX_8X8]; - uint16_t mask_4x4 = lfm->left_uv[TX_4X4]; - uint16_t mask_4x4_int = lfm->int_4x4_uv; - - // Vertical pass: do 2 rows at one time - for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r += 4) { - if (plane->plane_type == 1) { - for (c = 0; c < (MI_BLOCK_SIZE >> 1); c++) { - lfm->lfl_uv[(r << 1) + c] = lfm->lfl_y[(r << 3) + (c << 1)]; - lfm->lfl_uv[((r + 2) << 1) + c] = lfm->lfl_y[((r + 2) << 3) + - (c << 1)]; - } - } - - { - unsigned int mask_16x16_l = mask_16x16 & 0xff; - unsigned int mask_8x8_l = mask_8x8 & 0xff; - unsigned int mask_4x4_l = mask_4x4 & 0xff; - unsigned int mask_4x4_int_l = mask_4x4_int & 0xff; - - // Disable filtering on the leftmost column. -#if CONFIG_VP9_HIGHBITDEPTH - if (cm->use_highbitdepth) { - highbd_filter_selectively_vert_row2(plane->plane_type, - CONVERT_TO_SHORTPTR(dst->buf), - dst->stride, - mask_16x16_l, - mask_8x8_l, - mask_4x4_l, - mask_4x4_int_l, - &cm->lf_info, - &lfm->lfl_uv[r << 1], - (int)cm->bit_depth); - } else { - filter_selectively_vert_row2(plane->plane_type, - dst->buf, dst->stride, - mask_16x16_l, - mask_8x8_l, - mask_4x4_l, - mask_4x4_int_l, - &cm->lf_info, - &lfm->lfl_uv[r << 1]); - } -#else - filter_selectively_vert_row2(plane->plane_type, - dst->buf, dst->stride, - mask_16x16_l, - mask_8x8_l, - mask_4x4_l, - mask_4x4_int_l, - &cm->lf_info, - &lfm->lfl_uv[r << 1]); -#endif // CONFIG_VP9_HIGHBITDEPTH - - dst->buf += 16 * dst->stride; - mask_16x16 >>= 8; - mask_8x8 >>= 8; - mask_4x4 >>= 8; - mask_4x4_int >>= 8; - } - } - - // Horizontal pass - dst->buf = dst0; - mask_16x16 = lfm->above_uv[TX_16X16]; - mask_8x8 = lfm->above_uv[TX_8X8]; - mask_4x4 = lfm->above_uv[TX_4X4]; - mask_4x4_int = lfm->int_4x4_uv; - - for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r += 2) { - const int skip_border_4x4_r = mi_row + r == cm->mi_rows - 1; - const unsigned int mask_4x4_int_r = skip_border_4x4_r ? - 0 : (mask_4x4_int & 0xf); - unsigned int mask_16x16_r; - unsigned int mask_8x8_r; - unsigned int mask_4x4_r; - - if (mi_row + r == 0) { - mask_16x16_r = 0; - mask_8x8_r = 0; - mask_4x4_r = 0; - } else { - mask_16x16_r = mask_16x16 & 0xf; - mask_8x8_r = mask_8x8 & 0xf; - mask_4x4_r = mask_4x4 & 0xf; - } - -#if CONFIG_VP9_HIGHBITDEPTH - if (cm->use_highbitdepth) { - highbd_filter_selectively_horiz(CONVERT_TO_SHORTPTR(dst->buf), - dst->stride, - mask_16x16_r, - mask_8x8_r, - mask_4x4_r, - mask_4x4_int_r, - &cm->lf_info, - &lfm->lfl_uv[r << 1], - (int)cm->bit_depth); - } else { - filter_selectively_horiz(dst->buf, dst->stride, - mask_16x16_r, - mask_8x8_r, - mask_4x4_r, - mask_4x4_int_r, - &cm->lf_info, - &lfm->lfl_uv[r << 1]); - } -#else - filter_selectively_horiz(dst->buf, dst->stride, - mask_16x16_r, - mask_8x8_r, - mask_4x4_r, - mask_4x4_int_r, - &cm->lf_info, - &lfm->lfl_uv[r << 1]); -#endif // CONFIG_VP9_HIGHBITDEPTH - - dst->buf += 8 * dst->stride; - mask_16x16 >>= 4; - mask_8x8 >>= 4; - mask_4x4 >>= 4; - mask_4x4_int >>= 4; - } - } -} - -void vp9_loop_filter_rows(YV12_BUFFER_CONFIG *frame_buffer, - VP9_COMMON *cm, - struct macroblockd_plane planes[MAX_MB_PLANE], - int start, int stop, int y_only) { - const int num_planes = y_only ? 1 : MAX_MB_PLANE; - const int use_420 = y_only || (planes[1].subsampling_y == 1 && - planes[1].subsampling_x == 1); - LOOP_FILTER_MASK lfm; - int mi_row, mi_col; - - for (mi_row = start; mi_row < stop; mi_row += MI_BLOCK_SIZE) { - MODE_INFO *mi = cm->mi + mi_row * cm->mi_stride; - - for (mi_col = 0; mi_col < cm->mi_cols; mi_col += MI_BLOCK_SIZE) { - int plane; - - vp9_setup_dst_planes(planes, frame_buffer, mi_row, mi_col); - - // TODO(JBB): Make setup_mask work for non 420. - if (use_420) - vp9_setup_mask(cm, mi_row, mi_col, mi + mi_col, cm->mi_stride, - &lfm); - - for (plane = 0; plane < num_planes; ++plane) { - if (use_420) - vp9_filter_block_plane(cm, &planes[plane], mi_row, &lfm); - else - vp9_filter_block_plane_non420(cm, &planes[plane], mi + mi_col, - mi_row, mi_col); - } - } - } -} - -void vp9_loop_filter_frame(YV12_BUFFER_CONFIG *frame, - VP9_COMMON *cm, MACROBLOCKD *xd, - int frame_filter_level, - int y_only, int partial_frame) { - int start_mi_row, end_mi_row, mi_rows_to_filter; - if (!frame_filter_level) return; - start_mi_row = 0; - mi_rows_to_filter = cm->mi_rows; - if (partial_frame && cm->mi_rows > 8) { - start_mi_row = cm->mi_rows >> 1; - start_mi_row &= 0xfffffff8; - mi_rows_to_filter = MAX(cm->mi_rows / 8, 8); - } - end_mi_row = start_mi_row + mi_rows_to_filter; - vp9_loop_filter_frame_init(cm, frame_filter_level); - vp9_loop_filter_rows(frame, cm, xd->plane, - start_mi_row, end_mi_row, - y_only); -} - -void vp9_loop_filter_data_reset( - LFWorkerData *lf_data, YV12_BUFFER_CONFIG *frame_buffer, - struct VP9Common *cm, const struct macroblockd_plane planes[MAX_MB_PLANE]) { - lf_data->frame_buffer = frame_buffer; - lf_data->cm = cm; - lf_data->start = 0; - lf_data->stop = 0; - lf_data->y_only = 0; - vpx_memcpy(lf_data->planes, planes, sizeof(lf_data->planes)); -} - -int vp9_loop_filter_worker(LFWorkerData *const lf_data, void *unused) { - (void)unused; - vp9_loop_filter_rows(lf_data->frame_buffer, lf_data->cm, lf_data->planes, - lf_data->start, lf_data->stop, lf_data->y_only); - return 1; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_loopfilter_filters.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_loopfilter_filters.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_loopfilter_filters.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_loopfilter_filters.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,744 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "./vpx_config.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_loopfilter.h" -#include "vp9/common/vp9_onyxc_int.h" - -static INLINE int8_t signed_char_clamp(int t) { - return (int8_t)clamp(t, -128, 127); -} - -#if CONFIG_VP9_HIGHBITDEPTH -static INLINE int16_t signed_char_clamp_high(int t, int bd) { - switch (bd) { - case 10: - return (int16_t)clamp(t, -128*4, 128*4-1); - case 12: - return (int16_t)clamp(t, -128*16, 128*16-1); - case 8: - default: - return (int16_t)clamp(t, -128, 128-1); - } -} -#endif - -// should we apply any filter at all: 11111111 yes, 00000000 no -static INLINE int8_t filter_mask(uint8_t limit, uint8_t blimit, - uint8_t p3, uint8_t p2, - uint8_t p1, uint8_t p0, - uint8_t q0, uint8_t q1, - uint8_t q2, uint8_t q3) { - int8_t mask = 0; - mask |= (abs(p3 - p2) > limit) * -1; - mask |= (abs(p2 - p1) > limit) * -1; - mask |= (abs(p1 - p0) > limit) * -1; - mask |= (abs(q1 - q0) > limit) * -1; - mask |= (abs(q2 - q1) > limit) * -1; - mask |= (abs(q3 - q2) > limit) * -1; - mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 > blimit) * -1; - return ~mask; -} - -static INLINE int8_t flat_mask4(uint8_t thresh, - uint8_t p3, uint8_t p2, - uint8_t p1, uint8_t p0, - uint8_t q0, uint8_t q1, - uint8_t q2, uint8_t q3) { - int8_t mask = 0; - mask |= (abs(p1 - p0) > thresh) * -1; - mask |= (abs(q1 - q0) > thresh) * -1; - mask |= (abs(p2 - p0) > thresh) * -1; - mask |= (abs(q2 - q0) > thresh) * -1; - mask |= (abs(p3 - p0) > thresh) * -1; - mask |= (abs(q3 - q0) > thresh) * -1; - return ~mask; -} - -static INLINE int8_t flat_mask5(uint8_t thresh, - uint8_t p4, uint8_t p3, - uint8_t p2, uint8_t p1, - uint8_t p0, uint8_t q0, - uint8_t q1, uint8_t q2, - uint8_t q3, uint8_t q4) { - int8_t mask = ~flat_mask4(thresh, p3, p2, p1, p0, q0, q1, q2, q3); - mask |= (abs(p4 - p0) > thresh) * -1; - mask |= (abs(q4 - q0) > thresh) * -1; - return ~mask; -} - -// is there high edge variance internal edge: 11111111 yes, 00000000 no -static INLINE int8_t hev_mask(uint8_t thresh, uint8_t p1, uint8_t p0, - uint8_t q0, uint8_t q1) { - int8_t hev = 0; - hev |= (abs(p1 - p0) > thresh) * -1; - hev |= (abs(q1 - q0) > thresh) * -1; - return hev; -} - -static INLINE void filter4(int8_t mask, uint8_t thresh, uint8_t *op1, - uint8_t *op0, uint8_t *oq0, uint8_t *oq1) { - int8_t filter1, filter2; - - const int8_t ps1 = (int8_t) *op1 ^ 0x80; - const int8_t ps0 = (int8_t) *op0 ^ 0x80; - const int8_t qs0 = (int8_t) *oq0 ^ 0x80; - const int8_t qs1 = (int8_t) *oq1 ^ 0x80; - const uint8_t hev = hev_mask(thresh, *op1, *op0, *oq0, *oq1); - - // add outer taps if we have high edge variance - int8_t filter = signed_char_clamp(ps1 - qs1) & hev; - - // inner taps - filter = signed_char_clamp(filter + 3 * (qs0 - ps0)) & mask; - - // save bottom 3 bits so that we round one side +4 and the other +3 - // if it equals 4 we'll set to adjust by -1 to account for the fact - // we'd round 3 the other way - filter1 = signed_char_clamp(filter + 4) >> 3; - filter2 = signed_char_clamp(filter + 3) >> 3; - - *oq0 = signed_char_clamp(qs0 - filter1) ^ 0x80; - *op0 = signed_char_clamp(ps0 + filter2) ^ 0x80; - - // outer tap adjustments - filter = ROUND_POWER_OF_TWO(filter1, 1) & ~hev; - - *oq1 = signed_char_clamp(qs1 - filter) ^ 0x80; - *op1 = signed_char_clamp(ps1 + filter) ^ 0x80; -} - -void vp9_lpf_horizontal_4_c(uint8_t *s, int p /* pitch */, - const uint8_t *blimit, const uint8_t *limit, - const uint8_t *thresh, int count) { - int i; - - // loop filter designed to work using chars so that we can make maximum use - // of 8 bit simd instructions. - for (i = 0; i < 8 * count; ++i) { - const uint8_t p3 = s[-4 * p], p2 = s[-3 * p], p1 = s[-2 * p], p0 = s[-p]; - const uint8_t q0 = s[0 * p], q1 = s[1 * p], q2 = s[2 * p], q3 = s[3 * p]; - const int8_t mask = filter_mask(*limit, *blimit, - p3, p2, p1, p0, q0, q1, q2, q3); - filter4(mask, *thresh, s - 2 * p, s - 1 * p, s, s + 1 * p); - ++s; - } -} - -void vp9_lpf_horizontal_4_dual_c(uint8_t *s, int p, const uint8_t *blimit0, - const uint8_t *limit0, const uint8_t *thresh0, - const uint8_t *blimit1, const uint8_t *limit1, - const uint8_t *thresh1) { - vp9_lpf_horizontal_4_c(s, p, blimit0, limit0, thresh0, 1); - vp9_lpf_horizontal_4_c(s + 8, p, blimit1, limit1, thresh1, 1); -} - -void vp9_lpf_vertical_4_c(uint8_t *s, int pitch, const uint8_t *blimit, - const uint8_t *limit, const uint8_t *thresh, - int count) { - int i; - - // loop filter designed to work using chars so that we can make maximum use - // of 8 bit simd instructions. - for (i = 0; i < 8 * count; ++i) { - const uint8_t p3 = s[-4], p2 = s[-3], p1 = s[-2], p0 = s[-1]; - const uint8_t q0 = s[0], q1 = s[1], q2 = s[2], q3 = s[3]; - const int8_t mask = filter_mask(*limit, *blimit, - p3, p2, p1, p0, q0, q1, q2, q3); - filter4(mask, *thresh, s - 2, s - 1, s, s + 1); - s += pitch; - } -} - -void vp9_lpf_vertical_4_dual_c(uint8_t *s, int pitch, const uint8_t *blimit0, - const uint8_t *limit0, const uint8_t *thresh0, - const uint8_t *blimit1, const uint8_t *limit1, - const uint8_t *thresh1) { - vp9_lpf_vertical_4_c(s, pitch, blimit0, limit0, thresh0, 1); - vp9_lpf_vertical_4_c(s + 8 * pitch, pitch, blimit1, limit1, - thresh1, 1); -} - -static INLINE void filter8(int8_t mask, uint8_t thresh, uint8_t flat, - uint8_t *op3, uint8_t *op2, - uint8_t *op1, uint8_t *op0, - uint8_t *oq0, uint8_t *oq1, - uint8_t *oq2, uint8_t *oq3) { - if (flat && mask) { - const uint8_t p3 = *op3, p2 = *op2, p1 = *op1, p0 = *op0; - const uint8_t q0 = *oq0, q1 = *oq1, q2 = *oq2, q3 = *oq3; - - // 7-tap filter [1, 1, 1, 2, 1, 1, 1] - *op2 = ROUND_POWER_OF_TWO(p3 + p3 + p3 + 2 * p2 + p1 + p0 + q0, 3); - *op1 = ROUND_POWER_OF_TWO(p3 + p3 + p2 + 2 * p1 + p0 + q0 + q1, 3); - *op0 = ROUND_POWER_OF_TWO(p3 + p2 + p1 + 2 * p0 + q0 + q1 + q2, 3); - *oq0 = ROUND_POWER_OF_TWO(p2 + p1 + p0 + 2 * q0 + q1 + q2 + q3, 3); - *oq1 = ROUND_POWER_OF_TWO(p1 + p0 + q0 + 2 * q1 + q2 + q3 + q3, 3); - *oq2 = ROUND_POWER_OF_TWO(p0 + q0 + q1 + 2 * q2 + q3 + q3 + q3, 3); - } else { - filter4(mask, thresh, op1, op0, oq0, oq1); - } -} - -void vp9_lpf_horizontal_8_c(uint8_t *s, int p, const uint8_t *blimit, - const uint8_t *limit, const uint8_t *thresh, - int count) { - int i; - - // loop filter designed to work using chars so that we can make maximum use - // of 8 bit simd instructions. - for (i = 0; i < 8 * count; ++i) { - const uint8_t p3 = s[-4 * p], p2 = s[-3 * p], p1 = s[-2 * p], p0 = s[-p]; - const uint8_t q0 = s[0 * p], q1 = s[1 * p], q2 = s[2 * p], q3 = s[3 * p]; - - const int8_t mask = filter_mask(*limit, *blimit, - p3, p2, p1, p0, q0, q1, q2, q3); - const int8_t flat = flat_mask4(1, p3, p2, p1, p0, q0, q1, q2, q3); - filter8(mask, *thresh, flat, s - 4 * p, s - 3 * p, s - 2 * p, s - 1 * p, - s, s + 1 * p, s + 2 * p, s + 3 * p); - ++s; - } -} - -void vp9_lpf_horizontal_8_dual_c(uint8_t *s, int p, const uint8_t *blimit0, - const uint8_t *limit0, const uint8_t *thresh0, - const uint8_t *blimit1, const uint8_t *limit1, - const uint8_t *thresh1) { - vp9_lpf_horizontal_8_c(s, p, blimit0, limit0, thresh0, 1); - vp9_lpf_horizontal_8_c(s + 8, p, blimit1, limit1, thresh1, 1); -} - -void vp9_lpf_vertical_8_c(uint8_t *s, int pitch, const uint8_t *blimit, - const uint8_t *limit, const uint8_t *thresh, - int count) { - int i; - - for (i = 0; i < 8 * count; ++i) { - const uint8_t p3 = s[-4], p2 = s[-3], p1 = s[-2], p0 = s[-1]; - const uint8_t q0 = s[0], q1 = s[1], q2 = s[2], q3 = s[3]; - const int8_t mask = filter_mask(*limit, *blimit, - p3, p2, p1, p0, q0, q1, q2, q3); - const int8_t flat = flat_mask4(1, p3, p2, p1, p0, q0, q1, q2, q3); - filter8(mask, *thresh, flat, s - 4, s - 3, s - 2, s - 1, - s, s + 1, s + 2, s + 3); - s += pitch; - } -} - -void vp9_lpf_vertical_8_dual_c(uint8_t *s, int pitch, const uint8_t *blimit0, - const uint8_t *limit0, const uint8_t *thresh0, - const uint8_t *blimit1, const uint8_t *limit1, - const uint8_t *thresh1) { - vp9_lpf_vertical_8_c(s, pitch, blimit0, limit0, thresh0, 1); - vp9_lpf_vertical_8_c(s + 8 * pitch, pitch, blimit1, limit1, - thresh1, 1); -} - -static INLINE void filter16(int8_t mask, uint8_t thresh, - uint8_t flat, uint8_t flat2, - uint8_t *op7, uint8_t *op6, - uint8_t *op5, uint8_t *op4, - uint8_t *op3, uint8_t *op2, - uint8_t *op1, uint8_t *op0, - uint8_t *oq0, uint8_t *oq1, - uint8_t *oq2, uint8_t *oq3, - uint8_t *oq4, uint8_t *oq5, - uint8_t *oq6, uint8_t *oq7) { - if (flat2 && flat && mask) { - const uint8_t p7 = *op7, p6 = *op6, p5 = *op5, p4 = *op4, - p3 = *op3, p2 = *op2, p1 = *op1, p0 = *op0; - - const uint8_t q0 = *oq0, q1 = *oq1, q2 = *oq2, q3 = *oq3, - q4 = *oq4, q5 = *oq5, q6 = *oq6, q7 = *oq7; - - // 15-tap filter [1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1] - *op6 = ROUND_POWER_OF_TWO(p7 * 7 + p6 * 2 + p5 + p4 + p3 + p2 + p1 + p0 + - q0, 4); - *op5 = ROUND_POWER_OF_TWO(p7 * 6 + p6 + p5 * 2 + p4 + p3 + p2 + p1 + p0 + - q0 + q1, 4); - *op4 = ROUND_POWER_OF_TWO(p7 * 5 + p6 + p5 + p4 * 2 + p3 + p2 + p1 + p0 + - q0 + q1 + q2, 4); - *op3 = ROUND_POWER_OF_TWO(p7 * 4 + p6 + p5 + p4 + p3 * 2 + p2 + p1 + p0 + - q0 + q1 + q2 + q3, 4); - *op2 = ROUND_POWER_OF_TWO(p7 * 3 + p6 + p5 + p4 + p3 + p2 * 2 + p1 + p0 + - q0 + q1 + q2 + q3 + q4, 4); - *op1 = ROUND_POWER_OF_TWO(p7 * 2 + p6 + p5 + p4 + p3 + p2 + p1 * 2 + p0 + - q0 + q1 + q2 + q3 + q4 + q5, 4); - *op0 = ROUND_POWER_OF_TWO(p7 + p6 + p5 + p4 + p3 + p2 + p1 + p0 * 2 + - q0 + q1 + q2 + q3 + q4 + q5 + q6, 4); - *oq0 = ROUND_POWER_OF_TWO(p6 + p5 + p4 + p3 + p2 + p1 + p0 + - q0 * 2 + q1 + q2 + q3 + q4 + q5 + q6 + q7, 4); - *oq1 = ROUND_POWER_OF_TWO(p5 + p4 + p3 + p2 + p1 + p0 + - q0 + q1 * 2 + q2 + q3 + q4 + q5 + q6 + q7 * 2, 4); - *oq2 = ROUND_POWER_OF_TWO(p4 + p3 + p2 + p1 + p0 + - q0 + q1 + q2 * 2 + q3 + q4 + q5 + q6 + q7 * 3, 4); - *oq3 = ROUND_POWER_OF_TWO(p3 + p2 + p1 + p0 + - q0 + q1 + q2 + q3 * 2 + q4 + q5 + q6 + q7 * 4, 4); - *oq4 = ROUND_POWER_OF_TWO(p2 + p1 + p0 + - q0 + q1 + q2 + q3 + q4 * 2 + q5 + q6 + q7 * 5, 4); - *oq5 = ROUND_POWER_OF_TWO(p1 + p0 + - q0 + q1 + q2 + q3 + q4 + q5 * 2 + q6 + q7 * 6, 4); - *oq6 = ROUND_POWER_OF_TWO(p0 + - q0 + q1 + q2 + q3 + q4 + q5 + q6 * 2 + q7 * 7, 4); - } else { - filter8(mask, thresh, flat, op3, op2, op1, op0, oq0, oq1, oq2, oq3); - } -} - -void vp9_lpf_horizontal_16_c(uint8_t *s, int p, const uint8_t *blimit, - const uint8_t *limit, const uint8_t *thresh, - int count) { - int i; - - // loop filter designed to work using chars so that we can make maximum use - // of 8 bit simd instructions. - for (i = 0; i < 8 * count; ++i) { - const uint8_t p3 = s[-4 * p], p2 = s[-3 * p], p1 = s[-2 * p], p0 = s[-p]; - const uint8_t q0 = s[0 * p], q1 = s[1 * p], q2 = s[2 * p], q3 = s[3 * p]; - const int8_t mask = filter_mask(*limit, *blimit, - p3, p2, p1, p0, q0, q1, q2, q3); - const int8_t flat = flat_mask4(1, p3, p2, p1, p0, q0, q1, q2, q3); - const int8_t flat2 = flat_mask5(1, - s[-8 * p], s[-7 * p], s[-6 * p], s[-5 * p], p0, - q0, s[4 * p], s[5 * p], s[6 * p], s[7 * p]); - - filter16(mask, *thresh, flat, flat2, - s - 8 * p, s - 7 * p, s - 6 * p, s - 5 * p, - s - 4 * p, s - 3 * p, s - 2 * p, s - 1 * p, - s, s + 1 * p, s + 2 * p, s + 3 * p, - s + 4 * p, s + 5 * p, s + 6 * p, s + 7 * p); - ++s; - } -} - -static void mb_lpf_vertical_edge_w(uint8_t *s, int p, - const uint8_t *blimit, - const uint8_t *limit, - const uint8_t *thresh, - int count) { - int i; - - for (i = 0; i < count; ++i) { - const uint8_t p3 = s[-4], p2 = s[-3], p1 = s[-2], p0 = s[-1]; - const uint8_t q0 = s[0], q1 = s[1], q2 = s[2], q3 = s[3]; - const int8_t mask = filter_mask(*limit, *blimit, - p3, p2, p1, p0, q0, q1, q2, q3); - const int8_t flat = flat_mask4(1, p3, p2, p1, p0, q0, q1, q2, q3); - const int8_t flat2 = flat_mask5(1, s[-8], s[-7], s[-6], s[-5], p0, - q0, s[4], s[5], s[6], s[7]); - - filter16(mask, *thresh, flat, flat2, - s - 8, s - 7, s - 6, s - 5, s - 4, s - 3, s - 2, s - 1, - s, s + 1, s + 2, s + 3, s + 4, s + 5, s + 6, s + 7); - s += p; - } -} - -void vp9_lpf_vertical_16_c(uint8_t *s, int p, const uint8_t *blimit, - const uint8_t *limit, const uint8_t *thresh) { - mb_lpf_vertical_edge_w(s, p, blimit, limit, thresh, 8); -} - -void vp9_lpf_vertical_16_dual_c(uint8_t *s, int p, const uint8_t *blimit, - const uint8_t *limit, const uint8_t *thresh) { - mb_lpf_vertical_edge_w(s, p, blimit, limit, thresh, 16); -} - -#if CONFIG_VP9_HIGHBITDEPTH -// Should we apply any filter at all: 11111111 yes, 00000000 no ? -static INLINE int8_t highbd_filter_mask(uint8_t limit, uint8_t blimit, - uint16_t p3, uint16_t p2, - uint16_t p1, uint16_t p0, - uint16_t q0, uint16_t q1, - uint16_t q2, uint16_t q3, int bd) { - int8_t mask = 0; - int16_t limit16 = (uint16_t)limit << (bd - 8); - int16_t blimit16 = (uint16_t)blimit << (bd - 8); - mask |= (abs(p3 - p2) > limit16) * -1; - mask |= (abs(p2 - p1) > limit16) * -1; - mask |= (abs(p1 - p0) > limit16) * -1; - mask |= (abs(q1 - q0) > limit16) * -1; - mask |= (abs(q2 - q1) > limit16) * -1; - mask |= (abs(q3 - q2) > limit16) * -1; - mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 > blimit16) * -1; - return ~mask; -} - -static INLINE int8_t highbd_flat_mask4(uint8_t thresh, - uint16_t p3, uint16_t p2, - uint16_t p1, uint16_t p0, - uint16_t q0, uint16_t q1, - uint16_t q2, uint16_t q3, int bd) { - int8_t mask = 0; - int16_t thresh16 = (uint16_t)thresh << (bd - 8); - mask |= (abs(p1 - p0) > thresh16) * -1; - mask |= (abs(q1 - q0) > thresh16) * -1; - mask |= (abs(p2 - p0) > thresh16) * -1; - mask |= (abs(q2 - q0) > thresh16) * -1; - mask |= (abs(p3 - p0) > thresh16) * -1; - mask |= (abs(q3 - q0) > thresh16) * -1; - return ~mask; -} - -static INLINE int8_t highbd_flat_mask5(uint8_t thresh, - uint16_t p4, uint16_t p3, - uint16_t p2, uint16_t p1, - uint16_t p0, uint16_t q0, - uint16_t q1, uint16_t q2, - uint16_t q3, uint16_t q4, int bd) { - int8_t mask = ~highbd_flat_mask4(thresh, p3, p2, p1, p0, q0, q1, q2, q3, bd); - int16_t thresh16 = (uint16_t)thresh << (bd - 8); - mask |= (abs(p4 - p0) > thresh16) * -1; - mask |= (abs(q4 - q0) > thresh16) * -1; - return ~mask; -} - -// Is there high edge variance internal edge: -// 11111111_11111111 yes, 00000000_00000000 no ? -static INLINE int16_t highbd_hev_mask(uint8_t thresh, uint16_t p1, uint16_t p0, - uint16_t q0, uint16_t q1, int bd) { - int16_t hev = 0; - int16_t thresh16 = (uint16_t)thresh << (bd - 8); - hev |= (abs(p1 - p0) > thresh16) * -1; - hev |= (abs(q1 - q0) > thresh16) * -1; - return hev; -} - -static INLINE void highbd_filter4(int8_t mask, uint8_t thresh, uint16_t *op1, - uint16_t *op0, uint16_t *oq0, uint16_t *oq1, - int bd) { - int16_t filter1, filter2; - // ^0x80 equivalent to subtracting 0x80 from the values to turn them - // into -128 to +127 instead of 0 to 255. - int shift = bd - 8; - const int16_t ps1 = (int16_t)*op1 - (0x80 << shift); - const int16_t ps0 = (int16_t)*op0 - (0x80 << shift); - const int16_t qs0 = (int16_t)*oq0 - (0x80 << shift); - const int16_t qs1 = (int16_t)*oq1 - (0x80 << shift); - const uint16_t hev = highbd_hev_mask(thresh, *op1, *op0, *oq0, *oq1, bd); - - // Add outer taps if we have high edge variance. - int16_t filter = signed_char_clamp_high(ps1 - qs1, bd) & hev; - - // Inner taps. - filter = signed_char_clamp_high(filter + 3 * (qs0 - ps0), bd) & mask; - - // Save bottom 3 bits so that we round one side +4 and the other +3 - // if it equals 4 we'll set to adjust by -1 to account for the fact - // we'd round 3 the other way. - filter1 = signed_char_clamp_high(filter + 4, bd) >> 3; - filter2 = signed_char_clamp_high(filter + 3, bd) >> 3; - - *oq0 = signed_char_clamp_high(qs0 - filter1, bd) + (0x80 << shift); - *op0 = signed_char_clamp_high(ps0 + filter2, bd) + (0x80 << shift); - - // Outer tap adjustments. - filter = ROUND_POWER_OF_TWO(filter1, 1) & ~hev; - - *oq1 = signed_char_clamp_high(qs1 - filter, bd) + (0x80 << shift); - *op1 = signed_char_clamp_high(ps1 + filter, bd) + (0x80 << shift); -} - -void vp9_highbd_lpf_horizontal_4_c(uint16_t *s, int p /* pitch */, - const uint8_t *blimit, const uint8_t *limit, - const uint8_t *thresh, int count, int bd) { - int i; - - // loop filter designed to work using chars so that we can make maximum use - // of 8 bit simd instructions. - for (i = 0; i < 8 * count; ++i) { - const uint16_t p3 = s[-4 * p]; - const uint16_t p2 = s[-3 * p]; - const uint16_t p1 = s[-2 * p]; - const uint16_t p0 = s[-p]; - const uint16_t q0 = s[0 * p]; - const uint16_t q1 = s[1 * p]; - const uint16_t q2 = s[2 * p]; - const uint16_t q3 = s[3 * p]; - const int8_t mask = highbd_filter_mask(*limit, *blimit, - p3, p2, p1, p0, q0, q1, q2, q3, bd); - highbd_filter4(mask, *thresh, s - 2 * p, s - 1 * p, s, s + 1 * p, bd); - ++s; - } -} - -void vp9_highbd_lpf_horizontal_4_dual_c(uint16_t *s, int p, - const uint8_t *blimit0, - const uint8_t *limit0, - const uint8_t *thresh0, - const uint8_t *blimit1, - const uint8_t *limit1, - const uint8_t *thresh1, - int bd) { - vp9_highbd_lpf_horizontal_4_c(s, p, blimit0, limit0, thresh0, 1, bd); - vp9_highbd_lpf_horizontal_4_c(s + 8, p, blimit1, limit1, thresh1, 1, bd); -} - -void vp9_highbd_lpf_vertical_4_c(uint16_t *s, int pitch, const uint8_t *blimit, - const uint8_t *limit, const uint8_t *thresh, - int count, int bd) { - int i; - - // loop filter designed to work using chars so that we can make maximum use - // of 8 bit simd instructions. - for (i = 0; i < 8 * count; ++i) { - const uint16_t p3 = s[-4], p2 = s[-3], p1 = s[-2], p0 = s[-1]; - const uint16_t q0 = s[0], q1 = s[1], q2 = s[2], q3 = s[3]; - const int8_t mask = highbd_filter_mask(*limit, *blimit, - p3, p2, p1, p0, q0, q1, q2, q3, bd); - highbd_filter4(mask, *thresh, s - 2, s - 1, s, s + 1, bd); - s += pitch; - } -} - -void vp9_highbd_lpf_vertical_4_dual_c(uint16_t *s, int pitch, - const uint8_t *blimit0, - const uint8_t *limit0, - const uint8_t *thresh0, - const uint8_t *blimit1, - const uint8_t *limit1, - const uint8_t *thresh1, - int bd) { - vp9_highbd_lpf_vertical_4_c(s, pitch, blimit0, limit0, thresh0, 1, bd); - vp9_highbd_lpf_vertical_4_c(s + 8 * pitch, pitch, blimit1, limit1, - thresh1, 1, bd); -} - -static INLINE void highbd_filter8(int8_t mask, uint8_t thresh, uint8_t flat, - uint16_t *op3, uint16_t *op2, - uint16_t *op1, uint16_t *op0, - uint16_t *oq0, uint16_t *oq1, - uint16_t *oq2, uint16_t *oq3, int bd) { - if (flat && mask) { - const uint16_t p3 = *op3, p2 = *op2, p1 = *op1, p0 = *op0; - const uint16_t q0 = *oq0, q1 = *oq1, q2 = *oq2, q3 = *oq3; - - // 7-tap filter [1, 1, 1, 2, 1, 1, 1] - *op2 = ROUND_POWER_OF_TWO(p3 + p3 + p3 + 2 * p2 + p1 + p0 + q0, 3); - *op1 = ROUND_POWER_OF_TWO(p3 + p3 + p2 + 2 * p1 + p0 + q0 + q1, 3); - *op0 = ROUND_POWER_OF_TWO(p3 + p2 + p1 + 2 * p0 + q0 + q1 + q2, 3); - *oq0 = ROUND_POWER_OF_TWO(p2 + p1 + p0 + 2 * q0 + q1 + q2 + q3, 3); - *oq1 = ROUND_POWER_OF_TWO(p1 + p0 + q0 + 2 * q1 + q2 + q3 + q3, 3); - *oq2 = ROUND_POWER_OF_TWO(p0 + q0 + q1 + 2 * q2 + q3 + q3 + q3, 3); - } else { - highbd_filter4(mask, thresh, op1, op0, oq0, oq1, bd); - } -} - -void vp9_highbd_lpf_horizontal_8_c(uint16_t *s, int p, const uint8_t *blimit, - const uint8_t *limit, const uint8_t *thresh, - int count, int bd) { - int i; - - // loop filter designed to work using chars so that we can make maximum use - // of 8 bit simd instructions. - for (i = 0; i < 8 * count; ++i) { - const uint16_t p3 = s[-4 * p], p2 = s[-3 * p], p1 = s[-2 * p], p0 = s[-p]; - const uint16_t q0 = s[0 * p], q1 = s[1 * p], q2 = s[2 * p], q3 = s[3 * p]; - - const int8_t mask = highbd_filter_mask(*limit, *blimit, - p3, p2, p1, p0, q0, q1, q2, q3, bd); - const int8_t flat = highbd_flat_mask4(1, p3, p2, p1, p0, q0, q1, q2, q3, - bd); - highbd_filter8(mask, *thresh, flat, - s - 4 * p, s - 3 * p, s - 2 * p, s - 1 * p, - s, s + 1 * p, s + 2 * p, s + 3 * p, bd); - ++s; - } -} - -void vp9_highbd_lpf_horizontal_8_dual_c(uint16_t *s, int p, - const uint8_t *blimit0, - const uint8_t *limit0, - const uint8_t *thresh0, - const uint8_t *blimit1, - const uint8_t *limit1, - const uint8_t *thresh1, - int bd) { - vp9_highbd_lpf_horizontal_8_c(s, p, blimit0, limit0, thresh0, 1, bd); - vp9_highbd_lpf_horizontal_8_c(s + 8, p, blimit1, limit1, thresh1, 1, bd); -} - -void vp9_highbd_lpf_vertical_8_c(uint16_t *s, int pitch, const uint8_t *blimit, - const uint8_t *limit, const uint8_t *thresh, - int count, int bd) { - int i; - - for (i = 0; i < 8 * count; ++i) { - const uint16_t p3 = s[-4], p2 = s[-3], p1 = s[-2], p0 = s[-1]; - const uint16_t q0 = s[0], q1 = s[1], q2 = s[2], q3 = s[3]; - const int8_t mask = highbd_filter_mask(*limit, *blimit, - p3, p2, p1, p0, q0, q1, q2, q3, bd); - const int8_t flat = highbd_flat_mask4(1, p3, p2, p1, p0, q0, q1, q2, q3, - bd); - highbd_filter8(mask, *thresh, flat, - s - 4, s - 3, s - 2, s - 1, - s, s + 1, s + 2, s + 3, - bd); - s += pitch; - } -} - -void vp9_highbd_lpf_vertical_8_dual_c(uint16_t *s, int pitch, - const uint8_t *blimit0, - const uint8_t *limit0, - const uint8_t *thresh0, - const uint8_t *blimit1, - const uint8_t *limit1, - const uint8_t *thresh1, - int bd) { - vp9_highbd_lpf_vertical_8_c(s, pitch, blimit0, limit0, thresh0, 1, bd); - vp9_highbd_lpf_vertical_8_c(s + 8 * pitch, pitch, blimit1, limit1, - thresh1, 1, bd); -} - -static INLINE void highbd_filter16(int8_t mask, uint8_t thresh, - uint8_t flat, uint8_t flat2, - uint16_t *op7, uint16_t *op6, - uint16_t *op5, uint16_t *op4, - uint16_t *op3, uint16_t *op2, - uint16_t *op1, uint16_t *op0, - uint16_t *oq0, uint16_t *oq1, - uint16_t *oq2, uint16_t *oq3, - uint16_t *oq4, uint16_t *oq5, - uint16_t *oq6, uint16_t *oq7, int bd) { - if (flat2 && flat && mask) { - const uint16_t p7 = *op7; - const uint16_t p6 = *op6; - const uint16_t p5 = *op5; - const uint16_t p4 = *op4; - const uint16_t p3 = *op3; - const uint16_t p2 = *op2; - const uint16_t p1 = *op1; - const uint16_t p0 = *op0; - const uint16_t q0 = *oq0; - const uint16_t q1 = *oq1; - const uint16_t q2 = *oq2; - const uint16_t q3 = *oq3; - const uint16_t q4 = *oq4; - const uint16_t q5 = *oq5; - const uint16_t q6 = *oq6; - const uint16_t q7 = *oq7; - - // 15-tap filter [1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1] - *op6 = ROUND_POWER_OF_TWO(p7 * 7 + p6 * 2 + p5 + p4 + p3 + p2 + p1 + p0 + - q0, 4); - *op5 = ROUND_POWER_OF_TWO(p7 * 6 + p6 + p5 * 2 + p4 + p3 + p2 + p1 + p0 + - q0 + q1, 4); - *op4 = ROUND_POWER_OF_TWO(p7 * 5 + p6 + p5 + p4 * 2 + p3 + p2 + p1 + p0 + - q0 + q1 + q2, 4); - *op3 = ROUND_POWER_OF_TWO(p7 * 4 + p6 + p5 + p4 + p3 * 2 + p2 + p1 + p0 + - q0 + q1 + q2 + q3, 4); - *op2 = ROUND_POWER_OF_TWO(p7 * 3 + p6 + p5 + p4 + p3 + p2 * 2 + p1 + p0 + - q0 + q1 + q2 + q3 + q4, 4); - *op1 = ROUND_POWER_OF_TWO(p7 * 2 + p6 + p5 + p4 + p3 + p2 + p1 * 2 + p0 + - q0 + q1 + q2 + q3 + q4 + q5, 4); - *op0 = ROUND_POWER_OF_TWO(p7 + p6 + p5 + p4 + p3 + p2 + p1 + p0 * 2 + - q0 + q1 + q2 + q3 + q4 + q5 + q6, 4); - *oq0 = ROUND_POWER_OF_TWO(p6 + p5 + p4 + p3 + p2 + p1 + p0 + - q0 * 2 + q1 + q2 + q3 + q4 + q5 + q6 + q7, 4); - *oq1 = ROUND_POWER_OF_TWO(p5 + p4 + p3 + p2 + p1 + p0 + - q0 + q1 * 2 + q2 + q3 + q4 + q5 + q6 + q7 * 2, 4); - *oq2 = ROUND_POWER_OF_TWO(p4 + p3 + p2 + p1 + p0 + - q0 + q1 + q2 * 2 + q3 + q4 + q5 + q6 + q7 * 3, 4); - *oq3 = ROUND_POWER_OF_TWO(p3 + p2 + p1 + p0 + - q0 + q1 + q2 + q3 * 2 + q4 + q5 + q6 + q7 * 4, 4); - *oq4 = ROUND_POWER_OF_TWO(p2 + p1 + p0 + - q0 + q1 + q2 + q3 + q4 * 2 + q5 + q6 + q7 * 5, 4); - *oq5 = ROUND_POWER_OF_TWO(p1 + p0 + - q0 + q1 + q2 + q3 + q4 + q5 * 2 + q6 + q7 * 6, 4); - *oq6 = ROUND_POWER_OF_TWO(p0 + - q0 + q1 + q2 + q3 + q4 + q5 + q6 * 2 + q7 * 7, 4); - } else { - highbd_filter8(mask, thresh, flat, op3, op2, op1, op0, oq0, oq1, oq2, oq3, - bd); - } -} - -void vp9_highbd_lpf_horizontal_16_c(uint16_t *s, int p, const uint8_t *blimit, - const uint8_t *limit, const uint8_t *thresh, - int count, int bd) { - int i; - - // loop filter designed to work using chars so that we can make maximum use - // of 8 bit simd instructions. - for (i = 0; i < 8 * count; ++i) { - const uint16_t p3 = s[-4 * p]; - const uint16_t p2 = s[-3 * p]; - const uint16_t p1 = s[-2 * p]; - const uint16_t p0 = s[-p]; - const uint16_t q0 = s[0 * p]; - const uint16_t q1 = s[1 * p]; - const uint16_t q2 = s[2 * p]; - const uint16_t q3 = s[3 * p]; - const int8_t mask = highbd_filter_mask(*limit, *blimit, - p3, p2, p1, p0, q0, q1, q2, q3, bd); - const int8_t flat = highbd_flat_mask4(1, p3, p2, p1, p0, q0, q1, q2, q3, - bd); - const int8_t flat2 = highbd_flat_mask5( - 1, s[-8 * p], s[-7 * p], s[-6 * p], s[-5 * p], p0, - q0, s[4 * p], s[5 * p], s[6 * p], s[7 * p], bd); - - highbd_filter16(mask, *thresh, flat, flat2, - s - 8 * p, s - 7 * p, s - 6 * p, s - 5 * p, - s - 4 * p, s - 3 * p, s - 2 * p, s - 1 * p, - s, s + 1 * p, s + 2 * p, s + 3 * p, - s + 4 * p, s + 5 * p, s + 6 * p, s + 7 * p, - bd); - ++s; - } -} - -static void highbd_mb_lpf_vertical_edge_w(uint16_t *s, int p, - const uint8_t *blimit, - const uint8_t *limit, - const uint8_t *thresh, - int count, int bd) { - int i; - - for (i = 0; i < count; ++i) { - const uint16_t p3 = s[-4]; - const uint16_t p2 = s[-3]; - const uint16_t p1 = s[-2]; - const uint16_t p0 = s[-1]; - const uint16_t q0 = s[0]; - const uint16_t q1 = s[1]; - const uint16_t q2 = s[2]; - const uint16_t q3 = s[3]; - const int8_t mask = highbd_filter_mask(*limit, *blimit, - p3, p2, p1, p0, q0, q1, q2, q3, bd); - const int8_t flat = highbd_flat_mask4(1, p3, p2, p1, p0, q0, q1, q2, q3, - bd); - const int8_t flat2 = highbd_flat_mask5(1, s[-8], s[-7], s[-6], s[-5], p0, - q0, s[4], s[5], s[6], s[7], bd); - - highbd_filter16(mask, *thresh, flat, flat2, - s - 8, s - 7, s - 6, s - 5, s - 4, s - 3, s - 2, s - 1, - s, s + 1, s + 2, s + 3, s + 4, s + 5, s + 6, s + 7, - bd); - s += p; - } -} - -void vp9_highbd_lpf_vertical_16_c(uint16_t *s, int p, const uint8_t *blimit, - const uint8_t *limit, const uint8_t *thresh, - int bd) { - highbd_mb_lpf_vertical_edge_w(s, p, blimit, limit, thresh, 8, bd); -} - -void vp9_highbd_lpf_vertical_16_dual_c(uint16_t *s, int p, - const uint8_t *blimit, - const uint8_t *limit, - const uint8_t *thresh, - int bd) { - highbd_mb_lpf_vertical_edge_w(s, p, blimit, limit, thresh, 16, bd); -} -#endif // CONFIG_VP9_HIGHBITDEPTH diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_loopfilter.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_loopfilter.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_loopfilter.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_loopfilter.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,144 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_LOOPFILTER_H_ -#define VP9_COMMON_VP9_LOOPFILTER_H_ - -#include "vpx_ports/mem.h" -#include "./vpx_config.h" - -#include "vp9/common/vp9_blockd.h" -#include "vp9/common/vp9_seg_common.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define MAX_LOOP_FILTER 63 -#define MAX_SHARPNESS 7 - -#define SIMD_WIDTH 16 - -#define MAX_REF_LF_DELTAS 4 -#define MAX_MODE_LF_DELTAS 2 - -struct loopfilter { - int filter_level; - - int sharpness_level; - int last_sharpness_level; - - uint8_t mode_ref_delta_enabled; - uint8_t mode_ref_delta_update; - - // 0 = Intra, Last, GF, ARF - signed char ref_deltas[MAX_REF_LF_DELTAS]; - signed char last_ref_deltas[MAX_REF_LF_DELTAS]; - - // 0 = ZERO_MV, MV - signed char mode_deltas[MAX_MODE_LF_DELTAS]; - signed char last_mode_deltas[MAX_MODE_LF_DELTAS]; -}; - -// Need to align this structure so when it is declared and -// passed it can be loaded into vector registers. -typedef struct { - DECLARE_ALIGNED(SIMD_WIDTH, uint8_t, mblim[SIMD_WIDTH]); - DECLARE_ALIGNED(SIMD_WIDTH, uint8_t, lim[SIMD_WIDTH]); - DECLARE_ALIGNED(SIMD_WIDTH, uint8_t, hev_thr[SIMD_WIDTH]); -} loop_filter_thresh; - -typedef struct { - loop_filter_thresh lfthr[MAX_LOOP_FILTER + 1]; - uint8_t lvl[MAX_SEGMENTS][MAX_REF_FRAMES][MAX_MODE_LF_DELTAS]; -} loop_filter_info_n; - -// This structure holds bit masks for all 8x8 blocks in a 64x64 region. -// Each 1 bit represents a position in which we want to apply the loop filter. -// Left_ entries refer to whether we apply a filter on the border to the -// left of the block. Above_ entries refer to whether or not to apply a -// filter on the above border. Int_ entries refer to whether or not to -// apply borders on the 4x4 edges within the 8x8 block that each bit -// represents. -// Since each transform is accompanied by a potentially different type of -// loop filter there is a different entry in the array for each transform size. -typedef struct { - uint64_t left_y[TX_SIZES]; - uint64_t above_y[TX_SIZES]; - uint64_t int_4x4_y; - uint16_t left_uv[TX_SIZES]; - uint16_t above_uv[TX_SIZES]; - uint16_t int_4x4_uv; - uint8_t lfl_y[64]; - uint8_t lfl_uv[16]; -} LOOP_FILTER_MASK; - -/* assorted loopfilter functions which get used elsewhere */ -struct VP9Common; -struct macroblockd; -struct VP9LfSyncData; - -// This function sets up the bit masks for the entire 64x64 region represented -// by mi_row, mi_col. -void vp9_setup_mask(struct VP9Common *const cm, - const int mi_row, const int mi_col, - MODE_INFO *mi_8x8, const int mode_info_stride, - LOOP_FILTER_MASK *lfm); - -void vp9_filter_block_plane(struct VP9Common *const cm, - struct macroblockd_plane *const plane, - int mi_row, - LOOP_FILTER_MASK *lfm); - -void vp9_filter_block_plane_non420(struct VP9Common *cm, - struct macroblockd_plane *plane, - MODE_INFO *mi_8x8, - int mi_row, int mi_col); - -void vp9_loop_filter_init(struct VP9Common *cm); - -// Update the loop filter for the current frame. -// This should be called before vp9_loop_filter_rows(), vp9_loop_filter_frame() -// calls this function directly. -void vp9_loop_filter_frame_init(struct VP9Common *cm, int default_filt_lvl); - -void vp9_loop_filter_frame(YV12_BUFFER_CONFIG *frame, - struct VP9Common *cm, - struct macroblockd *mbd, - int filter_level, - int y_only, int partial_frame); - -// Apply the loop filter to [start, stop) macro block rows in frame_buffer. -void vp9_loop_filter_rows(YV12_BUFFER_CONFIG *frame_buffer, - struct VP9Common *cm, - struct macroblockd_plane planes[MAX_MB_PLANE], - int start, int stop, int y_only); - -typedef struct LoopFilterWorkerData { - YV12_BUFFER_CONFIG *frame_buffer; - struct VP9Common *cm; - struct macroblockd_plane planes[MAX_MB_PLANE]; - - int start; - int stop; - int y_only; -} LFWorkerData; - -void vp9_loop_filter_data_reset( - LFWorkerData *lf_data, YV12_BUFFER_CONFIG *frame_buffer, - struct VP9Common *cm, const struct macroblockd_plane planes[MAX_MB_PLANE]); - -// Operates on the rows described by 'lf_data'. -int vp9_loop_filter_worker(LFWorkerData *const lf_data, void *unused); -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_LOOPFILTER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_mfqe.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_mfqe.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_mfqe.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_mfqe.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,393 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "./vpx_config.h" -#include "./vpx_scale_rtcd.h" -#include "./vp9_rtcd.h" - -#include "vp9/common/vp9_onyxc_int.h" -#include "vp9/common/vp9_postproc.h" - -// TODO(jackychen): Replace this function with SSE2 code. There is -// one SSE2 implementation in vp8, so will consider how to share it -// between vp8 and vp9. -static void filter_by_weight(const uint8_t *src, int src_stride, - uint8_t *dst, int dst_stride, - int block_size, int src_weight) { - const int dst_weight = (1 << MFQE_PRECISION) - src_weight; - const int rounding_bit = 1 << (MFQE_PRECISION - 1); - int r, c; - - for (r = 0; r < block_size; r++) { - for (c = 0; c < block_size; c++) { - dst[c] = (src[c] * src_weight + dst[c] * dst_weight + rounding_bit) - >> MFQE_PRECISION; - } - src += src_stride; - dst += dst_stride; - } -} - -void vp9_filter_by_weight8x8_c(const uint8_t *src, int src_stride, - uint8_t *dst, int dst_stride, int src_weight) { - filter_by_weight(src, src_stride, dst, dst_stride, 8, src_weight); -} - -void vp9_filter_by_weight16x16_c(const uint8_t *src, int src_stride, - uint8_t *dst, int dst_stride, - int src_weight) { - filter_by_weight(src, src_stride, dst, dst_stride, 16, src_weight); -} - -static void filter_by_weight32x32(const uint8_t *src, int src_stride, - uint8_t *dst, int dst_stride, int weight) { - vp9_filter_by_weight16x16(src, src_stride, dst, dst_stride, weight); - vp9_filter_by_weight16x16(src + 16, src_stride, dst + 16, dst_stride, - weight); - vp9_filter_by_weight16x16(src + src_stride * 16, src_stride, - dst + dst_stride * 16, dst_stride, weight); - vp9_filter_by_weight16x16(src + src_stride * 16 + 16, src_stride, - dst + dst_stride * 16 + 16, dst_stride, weight); -} - -static void filter_by_weight64x64(const uint8_t *src, int src_stride, - uint8_t *dst, int dst_stride, int weight) { - filter_by_weight32x32(src, src_stride, dst, dst_stride, weight); - filter_by_weight32x32(src + 32, src_stride, dst + 32, - dst_stride, weight); - filter_by_weight32x32(src + src_stride * 32, src_stride, - dst + dst_stride * 32, dst_stride, weight); - filter_by_weight32x32(src + src_stride * 32 + 32, src_stride, - dst + dst_stride * 32 + 32, dst_stride, weight); -} - -static void apply_ifactor(const uint8_t *y, int y_stride, uint8_t *yd, - int yd_stride, const uint8_t *u, const uint8_t *v, - int uv_stride, uint8_t *ud, uint8_t *vd, - int uvd_stride, BLOCK_SIZE block_size, - int weight) { - if (block_size == BLOCK_16X16) { - vp9_filter_by_weight16x16(y, y_stride, yd, yd_stride, weight); - vp9_filter_by_weight8x8(u, uv_stride, ud, uvd_stride, weight); - vp9_filter_by_weight8x8(v, uv_stride, vd, uvd_stride, weight); - } else if (block_size == BLOCK_32X32) { - filter_by_weight32x32(y, y_stride, yd, yd_stride, weight); - vp9_filter_by_weight16x16(u, uv_stride, ud, uvd_stride, weight); - vp9_filter_by_weight16x16(v, uv_stride, vd, uvd_stride, weight); - } else if (block_size == BLOCK_64X64) { - filter_by_weight64x64(y, y_stride, yd, yd_stride, weight); - filter_by_weight32x32(u, uv_stride, ud, uvd_stride, weight); - filter_by_weight32x32(v, uv_stride, vd, uvd_stride, weight); - } -} - -// TODO(jackychen): Determine whether replace it with assembly code. -static void copy_mem8x8(const uint8_t *src, int src_stride, - uint8_t *dst, int dst_stride) { - int r; - for (r = 0; r < 8; r++) { - memcpy(dst, src, 8); - src += src_stride; - dst += dst_stride; - } -} - -static void copy_mem16x16(const uint8_t *src, int src_stride, - uint8_t *dst, int dst_stride) { - int r; - for (r = 0; r < 16; r++) { - memcpy(dst, src, 16); - src += src_stride; - dst += dst_stride; - } -} - -static void copy_mem32x32(const uint8_t *src, int src_stride, - uint8_t *dst, int dst_stride) { - copy_mem16x16(src, src_stride, dst, dst_stride); - copy_mem16x16(src + 16, src_stride, dst + 16, dst_stride); - copy_mem16x16(src + src_stride * 16, src_stride, - dst + dst_stride * 16, dst_stride); - copy_mem16x16(src + src_stride * 16 + 16, src_stride, - dst + dst_stride * 16 + 16, dst_stride); -} - -void copy_mem64x64(const uint8_t *src, int src_stride, - uint8_t *dst, int dst_stride) { - copy_mem32x32(src, src_stride, dst, dst_stride); - copy_mem32x32(src + 32, src_stride, dst + 32, dst_stride); - copy_mem32x32(src + src_stride * 32, src_stride, - dst + src_stride * 32, dst_stride); - copy_mem32x32(src + src_stride * 32 + 32, src_stride, - dst + src_stride * 32 + 32, dst_stride); -} - -static void copy_block(const uint8_t *y, const uint8_t *u, const uint8_t *v, - int y_stride, int uv_stride, uint8_t *yd, uint8_t *ud, - uint8_t *vd, int yd_stride, int uvd_stride, - BLOCK_SIZE bs) { - if (bs == BLOCK_16X16) { - copy_mem16x16(y, y_stride, yd, yd_stride); - copy_mem8x8(u, uv_stride, ud, uvd_stride); - copy_mem8x8(v, uv_stride, vd, uvd_stride); - } else if (bs == BLOCK_32X32) { - copy_mem32x32(y, y_stride, yd, yd_stride); - copy_mem16x16(u, uv_stride, ud, uvd_stride); - copy_mem16x16(v, uv_stride, vd, uvd_stride); - } else { - copy_mem64x64(y, y_stride, yd, yd_stride); - copy_mem32x32(u, uv_stride, ud, uvd_stride); - copy_mem32x32(v, uv_stride, vd, uvd_stride); - } -} - -static void get_thr(BLOCK_SIZE bs, int qdiff, int *sad_thr, int *vdiff_thr) { - const int adj = qdiff >> MFQE_PRECISION; - if (bs == BLOCK_16X16) { - *sad_thr = 7 + adj; - } else if (bs == BLOCK_32X32) { - *sad_thr = 6 + adj; - } else { // BLOCK_64X64 - *sad_thr = 5 + adj; - } - *vdiff_thr = 125 + qdiff; -} - -static void mfqe_block(BLOCK_SIZE bs, const uint8_t *y, const uint8_t *u, - const uint8_t *v, int y_stride, int uv_stride, - uint8_t *yd, uint8_t *ud, uint8_t *vd, int yd_stride, - int uvd_stride, int qdiff) { - int sad, sad_thr, vdiff, vdiff_thr; - uint32_t sse; - - get_thr(bs, qdiff, &sad_thr, &vdiff_thr); - - if (bs == BLOCK_16X16) { - vdiff = (vp9_variance16x16(y, y_stride, yd, yd_stride, &sse) + 128) >> 8; - sad = (vp9_sad16x16(y, y_stride, yd, yd_stride) + 128) >> 8; - } else if (bs == BLOCK_32X32) { - vdiff = (vp9_variance32x32(y, y_stride, yd, yd_stride, &sse) + 512) >> 10; - sad = (vp9_sad32x32(y, y_stride, yd, yd_stride) + 512) >> 10; - } else /* if (bs == BLOCK_64X64) */ { - vdiff = (vp9_variance64x64(y, y_stride, yd, yd_stride, &sse) + 2048) >> 12; - sad = (vp9_sad64x64(y, y_stride, yd, yd_stride) + 2048) >> 12; - } - - // vdiff > sad * 3 means vdiff should not be too small, otherwise, - // it might be a lighting change in smooth area. When there is a - // lighting change in smooth area, it is dangerous to do MFQE. - if (sad > 1 && vdiff > sad * 3) { - const int weight = 1 << MFQE_PRECISION; - int ifactor = weight * sad * vdiff / (sad_thr * vdiff_thr); - // When ifactor equals weight, no MFQE is done. - if (ifactor > weight) { - ifactor = weight; - } - apply_ifactor(y, y_stride, yd, yd_stride, u, v, uv_stride, ud, vd, - uvd_stride, bs, ifactor); - } else { - // Copy the block from current frame (i.e., no mfqe is done). - copy_block(y, u, v, y_stride, uv_stride, yd, ud, vd, - yd_stride, uvd_stride, bs); - } -} - -static int mfqe_decision(MODE_INFO *mi, BLOCK_SIZE cur_bs) { - // Check the motion in current block(for inter frame), - // or check the motion in the correlated block in last frame (for keyframe). - const int mv_len_square = mi->mbmi.mv[0].as_mv.row * - mi->mbmi.mv[0].as_mv.row + - mi->mbmi.mv[0].as_mv.col * - mi->mbmi.mv[0].as_mv.col; - const int mv_threshold = 100; - return mi->mbmi.mode >= NEARESTMV && // Not an intra block - cur_bs >= BLOCK_16X16 && - mv_len_square <= mv_threshold; -} - -// Process each partiton in a super block, recursively. -static void mfqe_partition(VP9_COMMON *cm, MODE_INFO *mi, BLOCK_SIZE bs, - const uint8_t *y, const uint8_t *u, - const uint8_t *v, int y_stride, int uv_stride, - uint8_t *yd, uint8_t *ud, uint8_t *vd, - int yd_stride, int uvd_stride) { - int mi_offset, y_offset, uv_offset; - const BLOCK_SIZE cur_bs = mi->mbmi.sb_type; - const int qdiff = cm->base_qindex - cm->postproc_state.last_base_qindex; - const int bsl = b_width_log2_lookup[bs]; - PARTITION_TYPE partition = partition_lookup[bsl][cur_bs]; - const BLOCK_SIZE subsize = get_subsize(bs, partition); - - if (cur_bs < BLOCK_8X8) { - // If there are blocks smaller than 8x8, it must be on the boundary. - return; - } - // No MFQE on blocks smaller than 16x16 - if (bs == BLOCK_16X16) { - partition = PARTITION_NONE; - } - if (bs == BLOCK_64X64) { - mi_offset = 4; - y_offset = 32; - uv_offset = 16; - } else { - mi_offset = 2; - y_offset = 16; - uv_offset = 8; - } - switch (partition) { - BLOCK_SIZE mfqe_bs, bs_tmp; - case PARTITION_HORZ: - if (bs == BLOCK_64X64) { - mfqe_bs = BLOCK_64X32; - bs_tmp = BLOCK_32X32; - } else { - mfqe_bs = BLOCK_32X16; - bs_tmp = BLOCK_16X16; - } - if (mfqe_decision(mi, mfqe_bs)) { - // Do mfqe on the first square partition. - mfqe_block(bs_tmp, y, u, v, y_stride, uv_stride, - yd, ud, vd, yd_stride, uvd_stride, qdiff); - // Do mfqe on the second square partition. - mfqe_block(bs_tmp, y + y_offset, u + uv_offset, v + uv_offset, - y_stride, uv_stride, yd + y_offset, ud + uv_offset, - vd + uv_offset, yd_stride, uvd_stride, qdiff); - } - if (mfqe_decision(mi + mi_offset * cm->mi_stride, mfqe_bs)) { - // Do mfqe on the first square partition. - mfqe_block(bs_tmp, y + y_offset * y_stride, u + uv_offset * uv_stride, - v + uv_offset * uv_stride, y_stride, uv_stride, - yd + y_offset * yd_stride, ud + uv_offset * uvd_stride, - vd + uv_offset * uvd_stride, yd_stride, uvd_stride, qdiff); - // Do mfqe on the second square partition. - mfqe_block(bs_tmp, y + y_offset * y_stride + y_offset, - u + uv_offset * uv_stride + uv_offset, - v + uv_offset * uv_stride + uv_offset, y_stride, - uv_stride, yd + y_offset * yd_stride + y_offset, - ud + uv_offset * uvd_stride + uv_offset, - vd + uv_offset * uvd_stride + uv_offset, - yd_stride, uvd_stride, qdiff); - } - break; - case PARTITION_VERT: - if (bs == BLOCK_64X64) { - mfqe_bs = BLOCK_32X64; - bs_tmp = BLOCK_32X32; - } else { - mfqe_bs = BLOCK_16X32; - bs_tmp = BLOCK_16X16; - } - if (mfqe_decision(mi, mfqe_bs)) { - // Do mfqe on the first square partition. - mfqe_block(bs_tmp, y, u, v, y_stride, uv_stride, - yd, ud, vd, yd_stride, uvd_stride, qdiff); - // Do mfqe on the second square partition. - mfqe_block(bs_tmp, y + y_offset * y_stride, u + uv_offset * uv_stride, - v + uv_offset * uv_stride, y_stride, uv_stride, - yd + y_offset * yd_stride, ud + uv_offset * uvd_stride, - vd + uv_offset * uvd_stride, yd_stride, uvd_stride, qdiff); - } - if (mfqe_decision(mi + mi_offset, mfqe_bs)) { - // Do mfqe on the first square partition. - mfqe_block(bs_tmp, y + y_offset, u + uv_offset, v + uv_offset, - y_stride, uv_stride, yd + y_offset, ud + uv_offset, - vd + uv_offset, yd_stride, uvd_stride, qdiff); - // Do mfqe on the second square partition. - mfqe_block(bs_tmp, y + y_offset * y_stride + y_offset, - u + uv_offset * uv_stride + uv_offset, - v + uv_offset * uv_stride + uv_offset, y_stride, - uv_stride, yd + y_offset * yd_stride + y_offset, - ud + uv_offset * uvd_stride + uv_offset, - vd + uv_offset * uvd_stride + uv_offset, - yd_stride, uvd_stride, qdiff); - } - break; - case PARTITION_NONE: - if (mfqe_decision(mi, cur_bs)) { - // Do mfqe on this partition. - mfqe_block(cur_bs, y, u, v, y_stride, uv_stride, - yd, ud, vd, yd_stride, uvd_stride, qdiff); - } else { - // Copy the block from current frame(i.e., no mfqe is done). - copy_block(y, u, v, y_stride, uv_stride, yd, ud, vd, - yd_stride, uvd_stride, bs); - } - break; - case PARTITION_SPLIT: - // Recursion on four square partitions, e.g. if bs is 64X64, - // then look into four 32X32 blocks in it. - mfqe_partition(cm, mi, subsize, y, u, v, y_stride, uv_stride, yd, ud, vd, - yd_stride, uvd_stride); - mfqe_partition(cm, mi + mi_offset, subsize, y + y_offset, u + uv_offset, - v + uv_offset, y_stride, uv_stride, yd + y_offset, - ud + uv_offset, vd + uv_offset, yd_stride, uvd_stride); - mfqe_partition(cm, mi + mi_offset * cm->mi_stride, subsize, - y + y_offset * y_stride, u + uv_offset * uv_stride, - v + uv_offset * uv_stride, y_stride, uv_stride, - yd + y_offset * yd_stride, ud + uv_offset * uvd_stride, - vd + uv_offset * uvd_stride, yd_stride, uvd_stride); - mfqe_partition(cm, mi + mi_offset * cm->mi_stride + mi_offset, - subsize, y + y_offset * y_stride + y_offset, - u + uv_offset * uv_stride + uv_offset, - v + uv_offset * uv_stride + uv_offset, y_stride, - uv_stride, yd + y_offset * yd_stride + y_offset, - ud + uv_offset * uvd_stride + uv_offset, - vd + uv_offset * uvd_stride + uv_offset, - yd_stride, uvd_stride); - break; - default: - assert(0); - } -} - -void vp9_mfqe(VP9_COMMON *cm) { - int mi_row, mi_col; - // Current decoded frame. - const YV12_BUFFER_CONFIG *show = cm->frame_to_show; - // Last decoded frame and will store the MFQE result. - YV12_BUFFER_CONFIG *dest = &cm->post_proc_buffer; - // Loop through each super block. - for (mi_row = 0; mi_row < cm->mi_rows; mi_row += MI_BLOCK_SIZE) { - for (mi_col = 0; mi_col < cm->mi_cols; mi_col += MI_BLOCK_SIZE) { - MODE_INFO *mi; - MODE_INFO *mi_local = cm->mi + (mi_row * cm->mi_stride + mi_col); - // Motion Info in last frame. - MODE_INFO *mi_prev = cm->postproc_state.prev_mi + - (mi_row * cm->mi_stride + mi_col); - const uint32_t y_stride = show->y_stride; - const uint32_t uv_stride = show->uv_stride; - const uint32_t yd_stride = dest->y_stride; - const uint32_t uvd_stride = dest->uv_stride; - const uint32_t row_offset_y = mi_row << 3; - const uint32_t row_offset_uv = mi_row << 2; - const uint32_t col_offset_y = mi_col << 3; - const uint32_t col_offset_uv = mi_col << 2; - const uint8_t *y = show->y_buffer + row_offset_y * y_stride + - col_offset_y; - const uint8_t *u = show->u_buffer + row_offset_uv * uv_stride + - col_offset_uv; - const uint8_t *v = show->v_buffer + row_offset_uv * uv_stride + - col_offset_uv; - uint8_t *yd = dest->y_buffer + row_offset_y * yd_stride + col_offset_y; - uint8_t *ud = dest->u_buffer + row_offset_uv * uvd_stride + - col_offset_uv; - uint8_t *vd = dest->v_buffer + row_offset_uv * uvd_stride + - col_offset_uv; - if (frame_is_intra_only(cm)) { - mi = mi_prev; - } else { - mi = mi_local; - } - mfqe_partition(cm, mi, BLOCK_64X64, y, u, v, y_stride, uv_stride, yd, ud, - vd, yd_stride, uvd_stride); - } - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_mfqe.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_mfqe.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_mfqe.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_mfqe.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_MFQE_H_ -#define VP9_COMMON_VP9_MFQE_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -// Multiframe Quality Enhancement. -// The aim for MFQE is to replace pixel blocks in the current frame with -// the correlated pixel blocks (with higher quality) in the last frame. -// The replacement can only be taken in stationary blocks by checking -// the motion of the blocks and other conditions such as the SAD of -// the current block and correlated block, the variance of the block -// difference, etc. -void vp9_mfqe(struct VP9Common *cm); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_MFQE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_mv.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_mv.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_mv.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_mv.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_MV_H_ -#define VP9_COMMON_VP9_MV_H_ - -#include "vpx/vpx_integer.h" - -#include "vp9/common/vp9_common.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct mv { - int16_t row; - int16_t col; -} MV; - -typedef union int_mv { - uint32_t as_int; - MV as_mv; -} int_mv; /* facilitates faster equality tests and copies */ - -typedef struct mv32 { - int32_t row; - int32_t col; -} MV32; - -static INLINE int is_zero_mv(const MV *mv) { - return *((const uint32_t *)mv) == 0; -} - -static INLINE int is_equal_mv(const MV *a, const MV *b) { - return *((const uint32_t *)a) == *((const uint32_t *)b); -} - -static INLINE void clamp_mv(MV *mv, int min_col, int max_col, - int min_row, int max_row) { - mv->col = clamp(mv->col, min_col, max_col); - mv->row = clamp(mv->row, min_row, max_row); -} - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_MV_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_mvref_common.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_mvref_common.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_mvref_common.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_mvref_common.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,228 +0,0 @@ - -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vp9/common/vp9_mvref_common.h" - -// This function searches the neighbourhood of a given MB/SB -// to try and find candidate reference vectors. -static void find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd, - const TileInfo *const tile, - MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame, - int_mv *mv_ref_list, - int block, int mi_row, int mi_col, - find_mv_refs_sync sync, void *const data) { - const int *ref_sign_bias = cm->ref_frame_sign_bias; - int i, refmv_count = 0; - const POSITION *const mv_ref_search = mv_ref_blocks[mi->mbmi.sb_type]; - int different_ref_found = 0; - int context_counter = 0; - const MV_REF *const prev_frame_mvs = cm->use_prev_frame_mvs ? - cm->prev_frame->mvs + mi_row * cm->mi_cols + mi_col : NULL; - - // Blank the reference vector list - vpx_memset(mv_ref_list, 0, sizeof(*mv_ref_list) * MAX_MV_REF_CANDIDATES); - - // The nearest 2 blocks are treated differently - // if the size < 8x8 we get the mv from the bmi substructure, - // and we also need to keep a mode count. - for (i = 0; i < 2; ++i) { - const POSITION *const mv_ref = &mv_ref_search[i]; - if (is_inside(tile, mi_col, mi_row, cm->mi_rows, mv_ref)) { - const MODE_INFO *const candidate_mi = xd->mi[mv_ref->col + mv_ref->row * - xd->mi_stride].src_mi; - const MB_MODE_INFO *const candidate = &candidate_mi->mbmi; - // Keep counts for entropy encoding. - context_counter += mode_2_counter[candidate->mode]; - different_ref_found = 1; - - if (candidate->ref_frame[0] == ref_frame) - ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, 0, mv_ref->col, block), - refmv_count, mv_ref_list, Done); - else if (candidate->ref_frame[1] == ref_frame) - ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, 1, mv_ref->col, block), - refmv_count, mv_ref_list, Done); - } - } - - // Check the rest of the neighbors in much the same way - // as before except we don't need to keep track of sub blocks or - // mode counts. - for (; i < MVREF_NEIGHBOURS; ++i) { - const POSITION *const mv_ref = &mv_ref_search[i]; - if (is_inside(tile, mi_col, mi_row, cm->mi_rows, mv_ref)) { - const MB_MODE_INFO *const candidate = &xd->mi[mv_ref->col + mv_ref->row * - xd->mi_stride].src_mi->mbmi; - different_ref_found = 1; - - if (candidate->ref_frame[0] == ref_frame) - ADD_MV_REF_LIST(candidate->mv[0], refmv_count, mv_ref_list, Done); - else if (candidate->ref_frame[1] == ref_frame) - ADD_MV_REF_LIST(candidate->mv[1], refmv_count, mv_ref_list, Done); - } - } - - // TODO(hkuang): Remove this sync after fixing pthread_cond_broadcast - // on windows platform. The sync here is unncessary if use_perv_frame_mvs - // is 0. But after removing it, there will be hang in the unit test on windows - // due to several threads waiting for a thread's signal. -#if defined(_WIN32) && !HAVE_PTHREAD_H - if (cm->frame_parallel_decode && sync != NULL) { - sync(data, mi_row); - } -#endif - - // Check the last frame's mode and mv info. - if (cm->use_prev_frame_mvs) { - // Synchronize here for frame parallel decode if sync function is provided. - if (cm->frame_parallel_decode && sync != NULL) { - sync(data, mi_row); - } - - if (prev_frame_mvs->ref_frame[0] == ref_frame) { - ADD_MV_REF_LIST(prev_frame_mvs->mv[0], refmv_count, mv_ref_list, Done); - } else if (prev_frame_mvs->ref_frame[1] == ref_frame) { - ADD_MV_REF_LIST(prev_frame_mvs->mv[1], refmv_count, mv_ref_list, Done); - } - } - - // Since we couldn't find 2 mvs from the same reference frame - // go back through the neighbors and find motion vectors from - // different reference frames. - if (different_ref_found) { - for (i = 0; i < MVREF_NEIGHBOURS; ++i) { - const POSITION *mv_ref = &mv_ref_search[i]; - if (is_inside(tile, mi_col, mi_row, cm->mi_rows, mv_ref)) { - const MB_MODE_INFO *const candidate = &xd->mi[mv_ref->col + mv_ref->row - * xd->mi_stride].src_mi->mbmi; - - // If the candidate is INTRA we don't want to consider its mv. - IF_DIFF_REF_FRAME_ADD_MV(candidate, ref_frame, ref_sign_bias, - refmv_count, mv_ref_list, Done); - } - } - } - - // Since we still don't have a candidate we'll try the last frame. - if (cm->use_prev_frame_mvs) { - if (prev_frame_mvs->ref_frame[0] != ref_frame && - prev_frame_mvs->ref_frame[0] > INTRA_FRAME) { - int_mv mv = prev_frame_mvs->mv[0]; - if (ref_sign_bias[prev_frame_mvs->ref_frame[0]] != - ref_sign_bias[ref_frame]) { - mv.as_mv.row *= -1; - mv.as_mv.col *= -1; - } - ADD_MV_REF_LIST(mv, refmv_count, mv_ref_list, Done); - } - - if (prev_frame_mvs->ref_frame[1] > INTRA_FRAME && - prev_frame_mvs->ref_frame[1] != ref_frame && - prev_frame_mvs->mv[1].as_int != prev_frame_mvs->mv[0].as_int) { - int_mv mv = prev_frame_mvs->mv[1]; - if (ref_sign_bias[prev_frame_mvs->ref_frame[1]] != - ref_sign_bias[ref_frame]) { - mv.as_mv.row *= -1; - mv.as_mv.col *= -1; - } - ADD_MV_REF_LIST(mv, refmv_count, mv_ref_list, Done); - } - } - - Done: - - mi->mbmi.mode_context[ref_frame] = counter_to_context[context_counter]; - - // Clamp vectors - for (i = 0; i < MAX_MV_REF_CANDIDATES; ++i) - clamp_mv_ref(&mv_ref_list[i].as_mv, xd); -} - -void vp9_find_mv_refs(const VP9_COMMON *cm, const MACROBLOCKD *xd, - const TileInfo *const tile, - MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame, - int_mv *mv_ref_list, - int mi_row, int mi_col, - find_mv_refs_sync sync, void *const data) { - find_mv_refs_idx(cm, xd, tile, mi, ref_frame, mv_ref_list, -1, - mi_row, mi_col, sync, data); -} - -static void lower_mv_precision(MV *mv, int allow_hp) { - const int use_hp = allow_hp && vp9_use_mv_hp(mv); - if (!use_hp) { - if (mv->row & 1) - mv->row += (mv->row > 0 ? -1 : 1); - if (mv->col & 1) - mv->col += (mv->col > 0 ? -1 : 1); - } -} - -void vp9_find_best_ref_mvs(MACROBLOCKD *xd, int allow_hp, - int_mv *mvlist, int_mv *nearest_mv, - int_mv *near_mv) { - int i; - // Make sure all the candidates are properly clamped etc - for (i = 0; i < MAX_MV_REF_CANDIDATES; ++i) { - lower_mv_precision(&mvlist[i].as_mv, allow_hp); - clamp_mv2(&mvlist[i].as_mv, xd); - } - *nearest_mv = mvlist[0]; - *near_mv = mvlist[1]; -} - -void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd, - const TileInfo *const tile, - int block, int ref, int mi_row, int mi_col, - int_mv *nearest_mv, int_mv *near_mv) { - int_mv mv_list[MAX_MV_REF_CANDIDATES]; - MODE_INFO *const mi = xd->mi[0].src_mi; - b_mode_info *bmi = mi->bmi; - int n; - - assert(MAX_MV_REF_CANDIDATES == 2); - - find_mv_refs_idx(cm, xd, tile, mi, mi->mbmi.ref_frame[ref], mv_list, block, - mi_row, mi_col, NULL, NULL); - - near_mv->as_int = 0; - switch (block) { - case 0: - nearest_mv->as_int = mv_list[0].as_int; - near_mv->as_int = mv_list[1].as_int; - break; - case 1: - case 2: - nearest_mv->as_int = bmi[0].as_mv[ref].as_int; - for (n = 0; n < MAX_MV_REF_CANDIDATES; ++n) - if (nearest_mv->as_int != mv_list[n].as_int) { - near_mv->as_int = mv_list[n].as_int; - break; - } - break; - case 3: { - int_mv candidates[2 + MAX_MV_REF_CANDIDATES]; - candidates[0] = bmi[1].as_mv[ref]; - candidates[1] = bmi[0].as_mv[ref]; - candidates[2] = mv_list[0]; - candidates[3] = mv_list[1]; - - nearest_mv->as_int = bmi[2].as_mv[ref].as_int; - for (n = 0; n < 2 + MAX_MV_REF_CANDIDATES; ++n) - if (nearest_mv->as_int != candidates[n].as_int) { - near_mv->as_int = candidates[n].as_int; - break; - } - break; - } - default: - assert("Invalid block index."); - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_mvref_common.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_mvref_common.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_mvref_common.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_mvref_common.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,232 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef VP9_COMMON_VP9_MVREF_COMMON_H_ -#define VP9_COMMON_VP9_MVREF_COMMON_H_ - -#include "vp9/common/vp9_onyxc_int.h" -#include "vp9/common/vp9_blockd.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define LEFT_TOP_MARGIN ((VP9_ENC_BORDER_IN_PIXELS - VP9_INTERP_EXTEND) << 3) -#define RIGHT_BOTTOM_MARGIN ((VP9_ENC_BORDER_IN_PIXELS -\ - VP9_INTERP_EXTEND) << 3) - -#define MVREF_NEIGHBOURS 8 - -typedef struct position { - int row; - int col; -} POSITION; - -typedef enum { - BOTH_ZERO = 0, - ZERO_PLUS_PREDICTED = 1, - BOTH_PREDICTED = 2, - NEW_PLUS_NON_INTRA = 3, - BOTH_NEW = 4, - INTRA_PLUS_NON_INTRA = 5, - BOTH_INTRA = 6, - INVALID_CASE = 9 -} motion_vector_context; - -// This is used to figure out a context for the ref blocks. The code flattens -// an array that would have 3 possible counts (0, 1 & 2) for 3 choices by -// adding 9 for each intra block, 3 for each zero mv and 1 for each new -// motion vector. This single number is then converted into a context -// with a single lookup ( counter_to_context ). -static const int mode_2_counter[MB_MODE_COUNT] = { - 9, // DC_PRED - 9, // V_PRED - 9, // H_PRED - 9, // D45_PRED - 9, // D135_PRED - 9, // D117_PRED - 9, // D153_PRED - 9, // D207_PRED - 9, // D63_PRED - 9, // TM_PRED - 0, // NEARESTMV - 0, // NEARMV - 3, // ZEROMV - 1, // NEWMV -}; - -// There are 3^3 different combinations of 3 counts that can be either 0,1 or -// 2. However the actual count can never be greater than 2 so the highest -// counter we need is 18. 9 is an invalid counter that's never used. -static const int counter_to_context[19] = { - BOTH_PREDICTED, // 0 - NEW_PLUS_NON_INTRA, // 1 - BOTH_NEW, // 2 - ZERO_PLUS_PREDICTED, // 3 - NEW_PLUS_NON_INTRA, // 4 - INVALID_CASE, // 5 - BOTH_ZERO, // 6 - INVALID_CASE, // 7 - INVALID_CASE, // 8 - INTRA_PLUS_NON_INTRA, // 9 - INTRA_PLUS_NON_INTRA, // 10 - INVALID_CASE, // 11 - INTRA_PLUS_NON_INTRA, // 12 - INVALID_CASE, // 13 - INVALID_CASE, // 14 - INVALID_CASE, // 15 - INVALID_CASE, // 16 - INVALID_CASE, // 17 - BOTH_INTRA // 18 -}; - -static const POSITION mv_ref_blocks[BLOCK_SIZES][MVREF_NEIGHBOURS] = { - // 4X4 - {{-1, 0}, {0, -1}, {-1, -1}, {-2, 0}, {0, -2}, {-2, -1}, {-1, -2}, {-2, -2}}, - // 4X8 - {{-1, 0}, {0, -1}, {-1, -1}, {-2, 0}, {0, -2}, {-2, -1}, {-1, -2}, {-2, -2}}, - // 8X4 - {{-1, 0}, {0, -1}, {-1, -1}, {-2, 0}, {0, -2}, {-2, -1}, {-1, -2}, {-2, -2}}, - // 8X8 - {{-1, 0}, {0, -1}, {-1, -1}, {-2, 0}, {0, -2}, {-2, -1}, {-1, -2}, {-2, -2}}, - // 8X16 - {{0, -1}, {-1, 0}, {1, -1}, {-1, -1}, {0, -2}, {-2, 0}, {-2, -1}, {-1, -2}}, - // 16X8 - {{-1, 0}, {0, -1}, {-1, 1}, {-1, -1}, {-2, 0}, {0, -2}, {-1, -2}, {-2, -1}}, - // 16X16 - {{-1, 0}, {0, -1}, {-1, 1}, {1, -1}, {-1, -1}, {-3, 0}, {0, -3}, {-3, -3}}, - // 16X32 - {{0, -1}, {-1, 0}, {2, -1}, {-1, -1}, {-1, 1}, {0, -3}, {-3, 0}, {-3, -3}}, - // 32X16 - {{-1, 0}, {0, -1}, {-1, 2}, {-1, -1}, {1, -1}, {-3, 0}, {0, -3}, {-3, -3}}, - // 32X32 - {{-1, 1}, {1, -1}, {-1, 2}, {2, -1}, {-1, -1}, {-3, 0}, {0, -3}, {-3, -3}}, - // 32X64 - {{0, -1}, {-1, 0}, {4, -1}, {-1, 2}, {-1, -1}, {0, -3}, {-3, 0}, {2, -1}}, - // 64X32 - {{-1, 0}, {0, -1}, {-1, 4}, {2, -1}, {-1, -1}, {-3, 0}, {0, -3}, {-1, 2}}, - // 64X64 - {{-1, 3}, {3, -1}, {-1, 4}, {4, -1}, {-1, -1}, {-1, 0}, {0, -1}, {-1, 6}} -}; - -static const int idx_n_column_to_subblock[4][2] = { - {1, 2}, - {1, 3}, - {3, 2}, - {3, 3} -}; - -// clamp_mv_ref -#define MV_BORDER (16 << 3) // Allow 16 pels in 1/8th pel units - -static INLINE void clamp_mv_ref(MV *mv, const MACROBLOCKD *xd) { - clamp_mv(mv, xd->mb_to_left_edge - MV_BORDER, - xd->mb_to_right_edge + MV_BORDER, - xd->mb_to_top_edge - MV_BORDER, - xd->mb_to_bottom_edge + MV_BORDER); -} - -// This function returns either the appropriate sub block or block's mv -// on whether the block_size < 8x8 and we have check_sub_blocks set. -static INLINE int_mv get_sub_block_mv(const MODE_INFO *candidate, int which_mv, - int search_col, int block_idx) { - return block_idx >= 0 && candidate->mbmi.sb_type < BLOCK_8X8 - ? candidate->bmi[idx_n_column_to_subblock[block_idx][search_col == 0]] - .as_mv[which_mv] - : candidate->mbmi.mv[which_mv]; -} - - -// Performs mv sign inversion if indicated by the reference frame combination. -static INLINE int_mv scale_mv(const MB_MODE_INFO *mbmi, int ref, - const MV_REFERENCE_FRAME this_ref_frame, - const int *ref_sign_bias) { - int_mv mv = mbmi->mv[ref]; - if (ref_sign_bias[mbmi->ref_frame[ref]] != ref_sign_bias[this_ref_frame]) { - mv.as_mv.row *= -1; - mv.as_mv.col *= -1; - } - return mv; -} - -// This macro is used to add a motion vector mv_ref list if it isn't -// already in the list. If it's the second motion vector it will also -// skip all additional processing and jump to done! -#define ADD_MV_REF_LIST(mv, refmv_count, mv_ref_list, Done) \ - do { \ - if (refmv_count) { \ - if ((mv).as_int != (mv_ref_list)[0].as_int) { \ - (mv_ref_list)[(refmv_count)] = (mv); \ - goto Done; \ - } \ - } else { \ - (mv_ref_list)[(refmv_count)++] = (mv); \ - } \ - } while (0) - -// If either reference frame is different, not INTRA, and they -// are different from each other scale and add the mv to our list. -#define IF_DIFF_REF_FRAME_ADD_MV(mbmi, ref_frame, ref_sign_bias, refmv_count, \ - mv_ref_list, Done) \ - do { \ - if (is_inter_block(mbmi)) { \ - if ((mbmi)->ref_frame[0] != ref_frame) \ - ADD_MV_REF_LIST(scale_mv((mbmi), 0, ref_frame, ref_sign_bias), \ - refmv_count, mv_ref_list, Done); \ - if (has_second_ref(mbmi) && \ - (mbmi)->ref_frame[1] != ref_frame && \ - (mbmi)->mv[1].as_int != (mbmi)->mv[0].as_int) \ - ADD_MV_REF_LIST(scale_mv((mbmi), 1, ref_frame, ref_sign_bias), \ - refmv_count, mv_ref_list, Done); \ - } \ - } while (0) - - -// Checks that the given mi_row, mi_col and search point -// are inside the borders of the tile. -static INLINE int is_inside(const TileInfo *const tile, - int mi_col, int mi_row, int mi_rows, - const POSITION *mi_pos) { - return !(mi_row + mi_pos->row < 0 || - mi_col + mi_pos->col < tile->mi_col_start || - mi_row + mi_pos->row >= mi_rows || - mi_col + mi_pos->col >= tile->mi_col_end); -} - -// TODO(jingning): this mv clamping function should be block size dependent. -static INLINE void clamp_mv2(MV *mv, const MACROBLOCKD *xd) { - clamp_mv(mv, xd->mb_to_left_edge - LEFT_TOP_MARGIN, - xd->mb_to_right_edge + RIGHT_BOTTOM_MARGIN, - xd->mb_to_top_edge - LEFT_TOP_MARGIN, - xd->mb_to_bottom_edge + RIGHT_BOTTOM_MARGIN); -} - -typedef void (*find_mv_refs_sync)(void *const data, int mi_row); -void vp9_find_mv_refs(const VP9_COMMON *cm, const MACROBLOCKD *xd, - const TileInfo *const tile, - MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame, - int_mv *mv_ref_list, int mi_row, int mi_col, - find_mv_refs_sync sync, void *const data); - -// check a list of motion vectors by sad score using a number rows of pixels -// above and a number cols of pixels in the left to select the one with best -// score to use as ref motion vector -void vp9_find_best_ref_mvs(MACROBLOCKD *xd, int allow_hp, - int_mv *mvlist, int_mv *nearest_mv, int_mv *near_mv); - -void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd, - const TileInfo *const tile, - int block, int ref, int mi_row, int mi_col, - int_mv *nearest_mv, int_mv *near_mv); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_MVREF_COMMON_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_onyxc_int.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_onyxc_int.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_onyxc_int.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_onyxc_int.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,434 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_ONYXC_INT_H_ -#define VP9_COMMON_VP9_ONYXC_INT_H_ - -#include "./vpx_config.h" -#include "vpx/internal/vpx_codec_internal.h" -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_loopfilter.h" -#include "vp9/common/vp9_entropymv.h" -#include "vp9/common/vp9_entropy.h" -#include "vp9/common/vp9_entropymode.h" -#include "vp9/common/vp9_frame_buffers.h" -#include "vp9/common/vp9_quant_common.h" -#include "vp9/common/vp9_thread.h" -#include "vp9/common/vp9_tile_common.h" - -#if CONFIG_VP9_POSTPROC -#include "vp9/common/vp9_postproc.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#define REFS_PER_FRAME 3 - -#define REF_FRAMES_LOG2 3 -#define REF_FRAMES (1 << REF_FRAMES_LOG2) - -// 4 scratch frames for the new frames to support a maximum of 4 cores decoding -// in parallel, 3 for scaled references on the encoder. -// TODO(hkuang): Add ondemand frame buffers instead of hardcoding the number -// of framebuffers. -// TODO(jkoleszar): These 3 extra references could probably come from the -// normal reference pool. -#define FRAME_BUFFERS (REF_FRAMES + 7) - -#define FRAME_CONTEXTS_LOG2 2 -#define FRAME_CONTEXTS (1 << FRAME_CONTEXTS_LOG2) - -#define NUM_PING_PONG_BUFFERS 2 - -extern const struct { - PARTITION_CONTEXT above; - PARTITION_CONTEXT left; -} partition_context_lookup[BLOCK_SIZES]; - - -typedef enum { - SINGLE_REFERENCE = 0, - COMPOUND_REFERENCE = 1, - REFERENCE_MODE_SELECT = 2, - REFERENCE_MODES = 3, -} REFERENCE_MODE; - -typedef struct { - int_mv mv[2]; - MV_REFERENCE_FRAME ref_frame[2]; -} MV_REF; - -typedef struct { - int ref_count; - MV_REF *mvs; - int mi_rows; - int mi_cols; - vpx_codec_frame_buffer_t raw_frame_buffer; - YV12_BUFFER_CONFIG buf; - - // The Following variables will only be used in frame parallel decode. - - // frame_worker_owner indicates which FrameWorker owns this buffer. NULL means - // that no FrameWorker owns, or is decoding, this buffer. - VP9Worker *frame_worker_owner; - - // row and col indicate which position frame has been decoded to in real - // pixel unit. They are reset to -1 when decoding begins and set to INT_MAX - // when the frame is fully decoded. - int row; - int col; -} RefCntBuffer; - -typedef struct { - // Protect BufferPool from being accessed by several FrameWorkers at - // the same time during frame parallel decode. - // TODO(hkuang): Try to use atomic variable instead of locking the whole pool. -#if CONFIG_MULTITHREAD - pthread_mutex_t pool_mutex; -#endif - - // Private data associated with the frame buffer callbacks. - void *cb_priv; - - vpx_get_frame_buffer_cb_fn_t get_fb_cb; - vpx_release_frame_buffer_cb_fn_t release_fb_cb; - - RefCntBuffer frame_bufs[FRAME_BUFFERS]; - - // Frame buffers allocated internally by the codec. - InternalFrameBufferList int_frame_buffers; -} BufferPool; - -typedef struct VP9Common { - struct vpx_internal_error_info error; - vpx_color_space_t color_space; - int width; - int height; - int display_width; - int display_height; - int last_width; - int last_height; - - // TODO(jkoleszar): this implies chroma ss right now, but could vary per - // plane. Revisit as part of the future change to YV12_BUFFER_CONFIG to - // support additional planes. - int subsampling_x; - int subsampling_y; - -#if CONFIG_VP9_HIGHBITDEPTH - int use_highbitdepth; // Marks if we need to use 16bit frame buffers. -#endif - - YV12_BUFFER_CONFIG *frame_to_show; - RefCntBuffer *prev_frame; - - // TODO(hkuang): Combine this with cur_buf in macroblockd. - RefCntBuffer *cur_frame; - - int ref_frame_map[REF_FRAMES]; /* maps fb_idx to reference slot */ - - // Prepare ref_frame_map for the next frame. - // Only used in frame parallel decode. - int next_ref_frame_map[REF_FRAMES]; - - // TODO(jkoleszar): could expand active_ref_idx to 4, with 0 as intra, and - // roll new_fb_idx into it. - - // Each frame can reference REFS_PER_FRAME buffers - RefBuffer frame_refs[REFS_PER_FRAME]; - - int new_fb_idx; - -#if CONFIG_VP9_POSTPROC - YV12_BUFFER_CONFIG post_proc_buffer; - YV12_BUFFER_CONFIG post_proc_buffer_int; -#endif - - FRAME_TYPE last_frame_type; /* last frame's frame type for motion search.*/ - FRAME_TYPE frame_type; - - int show_frame; - int last_show_frame; - int show_existing_frame; - - // Flag signaling that the frame is encoded using only INTRA modes. - int intra_only; - - int allow_high_precision_mv; - - // Flag signaling that the frame context should be reset to default values. - // 0 or 1 implies don't reset, 2 reset just the context specified in the - // frame header, 3 reset all contexts. - int reset_frame_context; - - // MBs, mb_rows/cols is in 16-pixel units; mi_rows/cols is in - // MODE_INFO (8-pixel) units. - int MBs; - int mb_rows, mi_rows; - int mb_cols, mi_cols; - int mi_stride; - - /* profile settings */ - TX_MODE tx_mode; - - int base_qindex; - int y_dc_delta_q; - int uv_dc_delta_q; - int uv_ac_delta_q; - - /* We allocate a MODE_INFO struct for each macroblock, together with - an extra row on top and column on the left to simplify prediction. */ - int mi_alloc_size; - MODE_INFO *mip; /* Base of allocated array */ - MODE_INFO *mi; /* Corresponds to upper left visible macroblock */ - - // TODO(agrange): Move prev_mi into encoder structure. - // prev_mip and prev_mi will only be allocated in VP9 encoder. - MODE_INFO *prev_mip; /* MODE_INFO array 'mip' from last decoded frame */ - MODE_INFO *prev_mi; /* 'mi' from last frame (points into prev_mip) */ - - // Separate mi functions between encoder and decoder. - int (*alloc_mi)(struct VP9Common *cm, int mi_size); - void (*free_mi)(struct VP9Common *cm); - void (*setup_mi)(struct VP9Common *cm); - - - // Whether to use previous frame's motion vectors for prediction. - int use_prev_frame_mvs; - - // Persistent mb segment id map used in prediction. - int seg_map_idx; - int prev_seg_map_idx; - - uint8_t *seg_map_array[NUM_PING_PONG_BUFFERS]; - uint8_t *last_frame_seg_map; - uint8_t *current_frame_seg_map; - - INTERP_FILTER interp_filter; - - loop_filter_info_n lf_info; - - int refresh_frame_context; /* Two state 0 = NO, 1 = YES */ - - int ref_frame_sign_bias[MAX_REF_FRAMES]; /* Two state 0, 1 */ - - struct loopfilter lf; - struct segmentation seg; - - // TODO(hkuang): Remove this as it is the same as frame_parallel_decode - // in pbi. - int frame_parallel_decode; // frame-based threading. - - // Context probabilities for reference frame prediction - MV_REFERENCE_FRAME comp_fixed_ref; - MV_REFERENCE_FRAME comp_var_ref[2]; - REFERENCE_MODE reference_mode; - - FRAME_CONTEXT *fc; /* this frame entropy */ - FRAME_CONTEXT *frame_contexts; // FRAME_CONTEXTS - unsigned int frame_context_idx; /* Context to use/update */ - FRAME_COUNTS counts; - - unsigned int current_video_frame; - BITSTREAM_PROFILE profile; - - // VPX_BITS_8 in profile 0 or 1, VPX_BITS_10 or VPX_BITS_12 in profile 2 or 3. - vpx_bit_depth_t bit_depth; - vpx_bit_depth_t dequant_bit_depth; // bit_depth of current dequantizer - -#if CONFIG_VP9_POSTPROC - struct postproc_state postproc_state; -#endif - - int error_resilient_mode; - int frame_parallel_decoding_mode; - - int log2_tile_cols, log2_tile_rows; - int byte_alignment; - - // Private data associated with the frame buffer callbacks. - void *cb_priv; - vpx_get_frame_buffer_cb_fn_t get_fb_cb; - vpx_release_frame_buffer_cb_fn_t release_fb_cb; - - // Handles memory for the codec. - InternalFrameBufferList int_frame_buffers; - - // External BufferPool passed from outside. - BufferPool *buffer_pool; - - PARTITION_CONTEXT *above_seg_context; - ENTROPY_CONTEXT *above_context; -} VP9_COMMON; - -// TODO(hkuang): Don't need to lock the whole pool after implementing atomic -// frame reference count. -void lock_buffer_pool(BufferPool *const pool); -void unlock_buffer_pool(BufferPool *const pool); - -static INLINE YV12_BUFFER_CONFIG *get_ref_frame(VP9_COMMON *cm, int index) { - if (index < 0 || index >= REF_FRAMES) - return NULL; - if (cm->ref_frame_map[index] < 0) - return NULL; - assert(cm->ref_frame_map[index] < FRAME_BUFFERS); - return &cm->buffer_pool->frame_bufs[cm->ref_frame_map[index]].buf; -} - -static INLINE YV12_BUFFER_CONFIG *get_frame_new_buffer(VP9_COMMON *cm) { - return &cm->buffer_pool->frame_bufs[cm->new_fb_idx].buf; -} - -static INLINE int get_free_fb(VP9_COMMON *cm) { - RefCntBuffer *const frame_bufs = cm->buffer_pool->frame_bufs; - int i; - - lock_buffer_pool(cm->buffer_pool); - for (i = 0; i < FRAME_BUFFERS; ++i) - if (frame_bufs[i].ref_count == 0) - break; - - assert(i < FRAME_BUFFERS); - frame_bufs[i].ref_count = 1; - unlock_buffer_pool(cm->buffer_pool); - return i; -} - -static INLINE void ref_cnt_fb(RefCntBuffer *bufs, int *idx, int new_idx) { - const int ref_index = *idx; - - if (ref_index >= 0 && bufs[ref_index].ref_count > 0) - bufs[ref_index].ref_count--; - - *idx = new_idx; - - bufs[new_idx].ref_count++; -} - -static INLINE int mi_cols_aligned_to_sb(int n_mis) { - return ALIGN_POWER_OF_TWO(n_mis, MI_BLOCK_SIZE_LOG2); -} - -static INLINE void init_macroblockd(VP9_COMMON *cm, MACROBLOCKD *xd) { - int i; - - for (i = 0; i < MAX_MB_PLANE; ++i) { - xd->plane[i].dqcoeff = xd->dqcoeff; - xd->above_context[i] = cm->above_context + - i * sizeof(*cm->above_context) * 2 * mi_cols_aligned_to_sb(cm->mi_cols); - } - - xd->above_seg_context = cm->above_seg_context; - xd->mi_stride = cm->mi_stride; - xd->error_info = &cm->error; -} - -static INLINE int frame_is_intra_only(const VP9_COMMON *const cm) { - return cm->frame_type == KEY_FRAME || cm->intra_only; -} - -static INLINE const vp9_prob* get_partition_probs(const VP9_COMMON *cm, - int ctx) { - return frame_is_intra_only(cm) ? vp9_kf_partition_probs[ctx] - : cm->fc->partition_prob[ctx]; -} - -static INLINE void set_skip_context(MACROBLOCKD *xd, int mi_row, int mi_col) { - const int above_idx = mi_col * 2; - const int left_idx = (mi_row * 2) & 15; - int i; - for (i = 0; i < MAX_MB_PLANE; ++i) { - struct macroblockd_plane *const pd = &xd->plane[i]; - pd->above_context = &xd->above_context[i][above_idx >> pd->subsampling_x]; - pd->left_context = &xd->left_context[i][left_idx >> pd->subsampling_y]; - } -} - -static INLINE int calc_mi_size(int len) { - // len is in mi units. - return len + MI_BLOCK_SIZE; -} - -static INLINE void set_mi_row_col(MACROBLOCKD *xd, const TileInfo *const tile, - int mi_row, int bh, - int mi_col, int bw, - int mi_rows, int mi_cols) { - xd->mb_to_top_edge = -((mi_row * MI_SIZE) * 8); - xd->mb_to_bottom_edge = ((mi_rows - bh - mi_row) * MI_SIZE) * 8; - xd->mb_to_left_edge = -((mi_col * MI_SIZE) * 8); - xd->mb_to_right_edge = ((mi_cols - bw - mi_col) * MI_SIZE) * 8; - - // Are edges available for intra prediction? - xd->up_available = (mi_row != 0); - xd->left_available = (mi_col > tile->mi_col_start); - if (xd->up_available) { - xd->above_mi = xd->mi[-xd->mi_stride].src_mi; - xd->above_mbmi = xd->above_mi ? &xd->above_mi->mbmi : NULL; - } else { - xd->above_mi = NULL; - xd->above_mbmi = NULL; - } - - if (xd->left_available) { - xd->left_mi = xd->mi[-1].src_mi; - xd->left_mbmi = xd->left_mi ? &xd->left_mi->mbmi : NULL; - } else { - xd->left_mi = NULL; - xd->left_mbmi = NULL; - } -} - -static INLINE void update_partition_context(MACROBLOCKD *xd, - int mi_row, int mi_col, - BLOCK_SIZE subsize, - BLOCK_SIZE bsize) { - PARTITION_CONTEXT *const above_ctx = xd->above_seg_context + mi_col; - PARTITION_CONTEXT *const left_ctx = xd->left_seg_context + (mi_row & MI_MASK); - - // num_4x4_blocks_wide_lookup[bsize] / 2 - const int bs = num_8x8_blocks_wide_lookup[bsize]; - - // update the partition context at the end notes. set partition bits - // of block sizes larger than the current one to be one, and partition - // bits of smaller block sizes to be zero. - vpx_memset(above_ctx, partition_context_lookup[subsize].above, bs); - vpx_memset(left_ctx, partition_context_lookup[subsize].left, bs); -} - -static INLINE int partition_plane_context(const MACROBLOCKD *xd, - int mi_row, int mi_col, - BLOCK_SIZE bsize) { - const PARTITION_CONTEXT *above_ctx = xd->above_seg_context + mi_col; - const PARTITION_CONTEXT *left_ctx = xd->left_seg_context + (mi_row & MI_MASK); - - const int bsl = mi_width_log2_lookup[bsize]; - const int bs = 1 << bsl; - int above = 0, left = 0, i; - - assert(b_width_log2_lookup[bsize] == b_height_log2_lookup[bsize]); - assert(bsl >= 0); - - for (i = 0; i < bs; i++) { - above |= above_ctx[i]; - left |= left_ctx[i]; - } - above = (above & bs) > 0; - left = (left & bs) > 0; - - return (left * 2 + above) + bsl * PARTITION_PLOFFSET; -} - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_ONYXC_INT_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_postproc.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_postproc.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_postproc.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_postproc.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,752 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include - -#include "./vpx_config.h" -#include "./vpx_scale_rtcd.h" -#include "./vp9_rtcd.h" - -#include "vpx_scale/vpx_scale.h" -#include "vpx_scale/yv12config.h" - -#if CONFIG_VP9_HIGHBITDEPTH -#include "vp9/common/vp9_common.h" -#endif -#include "vp9/common/vp9_onyxc_int.h" -#include "vp9/common/vp9_postproc.h" -#include "vp9/common/vp9_systemdependent.h" -#include "vp9/common/vp9_textblit.h" - -#if CONFIG_VP9_POSTPROC -static const short kernel5[] = { - 1, 1, 4, 1, 1 -}; - -const short vp9_rv[] = { - 8, 5, 2, 2, 8, 12, 4, 9, 8, 3, - 0, 3, 9, 0, 0, 0, 8, 3, 14, 4, - 10, 1, 11, 14, 1, 14, 9, 6, 12, 11, - 8, 6, 10, 0, 0, 8, 9, 0, 3, 14, - 8, 11, 13, 4, 2, 9, 0, 3, 9, 6, - 1, 2, 3, 14, 13, 1, 8, 2, 9, 7, - 3, 3, 1, 13, 13, 6, 6, 5, 2, 7, - 11, 9, 11, 8, 7, 3, 2, 0, 13, 13, - 14, 4, 12, 5, 12, 10, 8, 10, 13, 10, - 4, 14, 4, 10, 0, 8, 11, 1, 13, 7, - 7, 14, 6, 14, 13, 2, 13, 5, 4, 4, - 0, 10, 0, 5, 13, 2, 12, 7, 11, 13, - 8, 0, 4, 10, 7, 2, 7, 2, 2, 5, - 3, 4, 7, 3, 3, 14, 14, 5, 9, 13, - 3, 14, 3, 6, 3, 0, 11, 8, 13, 1, - 13, 1, 12, 0, 10, 9, 7, 6, 2, 8, - 5, 2, 13, 7, 1, 13, 14, 7, 6, 7, - 9, 6, 10, 11, 7, 8, 7, 5, 14, 8, - 4, 4, 0, 8, 7, 10, 0, 8, 14, 11, - 3, 12, 5, 7, 14, 3, 14, 5, 2, 6, - 11, 12, 12, 8, 0, 11, 13, 1, 2, 0, - 5, 10, 14, 7, 8, 0, 4, 11, 0, 8, - 0, 3, 10, 5, 8, 0, 11, 6, 7, 8, - 10, 7, 13, 9, 2, 5, 1, 5, 10, 2, - 4, 3, 5, 6, 10, 8, 9, 4, 11, 14, - 0, 10, 0, 5, 13, 2, 12, 7, 11, 13, - 8, 0, 4, 10, 7, 2, 7, 2, 2, 5, - 3, 4, 7, 3, 3, 14, 14, 5, 9, 13, - 3, 14, 3, 6, 3, 0, 11, 8, 13, 1, - 13, 1, 12, 0, 10, 9, 7, 6, 2, 8, - 5, 2, 13, 7, 1, 13, 14, 7, 6, 7, - 9, 6, 10, 11, 7, 8, 7, 5, 14, 8, - 4, 4, 0, 8, 7, 10, 0, 8, 14, 11, - 3, 12, 5, 7, 14, 3, 14, 5, 2, 6, - 11, 12, 12, 8, 0, 11, 13, 1, 2, 0, - 5, 10, 14, 7, 8, 0, 4, 11, 0, 8, - 0, 3, 10, 5, 8, 0, 11, 6, 7, 8, - 10, 7, 13, 9, 2, 5, 1, 5, 10, 2, - 4, 3, 5, 6, 10, 8, 9, 4, 11, 14, - 3, 8, 3, 7, 8, 5, 11, 4, 12, 3, - 11, 9, 14, 8, 14, 13, 4, 3, 1, 2, - 14, 6, 5, 4, 4, 11, 4, 6, 2, 1, - 5, 8, 8, 12, 13, 5, 14, 10, 12, 13, - 0, 9, 5, 5, 11, 10, 13, 9, 10, 13, -}; - -static const uint8_t q_diff_thresh = 20; -static const uint8_t last_q_thresh = 170; - -void vp9_post_proc_down_and_across_c(const uint8_t *src_ptr, - uint8_t *dst_ptr, - int src_pixels_per_line, - int dst_pixels_per_line, - int rows, - int cols, - int flimit) { - uint8_t const *p_src; - uint8_t *p_dst; - int row; - int col; - int i; - int v; - int pitch = src_pixels_per_line; - uint8_t d[8]; - (void)dst_pixels_per_line; - - for (row = 0; row < rows; row++) { - /* post_proc_down for one row */ - p_src = src_ptr; - p_dst = dst_ptr; - - for (col = 0; col < cols; col++) { - int kernel = 4; - int v = p_src[col]; - - for (i = -2; i <= 2; i++) { - if (abs(v - p_src[col + i * pitch]) > flimit) - goto down_skip_convolve; - - kernel += kernel5[2 + i] * p_src[col + i * pitch]; - } - - v = (kernel >> 3); - down_skip_convolve: - p_dst[col] = v; - } - - /* now post_proc_across */ - p_src = dst_ptr; - p_dst = dst_ptr; - - for (i = 0; i < 8; i++) - d[i] = p_src[i]; - - for (col = 0; col < cols; col++) { - int kernel = 4; - v = p_src[col]; - - d[col & 7] = v; - - for (i = -2; i <= 2; i++) { - if (abs(v - p_src[col + i]) > flimit) - goto across_skip_convolve; - - kernel += kernel5[2 + i] * p_src[col + i]; - } - - d[col & 7] = (kernel >> 3); - across_skip_convolve: - - if (col >= 2) - p_dst[col - 2] = d[(col - 2) & 7]; - } - - /* handle the last two pixels */ - p_dst[col - 2] = d[(col - 2) & 7]; - p_dst[col - 1] = d[(col - 1) & 7]; - - - /* next row */ - src_ptr += pitch; - dst_ptr += pitch; - } -} - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_highbd_post_proc_down_and_across_c(const uint16_t *src_ptr, - uint16_t *dst_ptr, - int src_pixels_per_line, - int dst_pixels_per_line, - int rows, - int cols, - int flimit) { - uint16_t const *p_src; - uint16_t *p_dst; - int row; - int col; - int i; - int v; - int pitch = src_pixels_per_line; - uint16_t d[8]; - - for (row = 0; row < rows; row++) { - // post_proc_down for one row. - p_src = src_ptr; - p_dst = dst_ptr; - - for (col = 0; col < cols; col++) { - int kernel = 4; - int v = p_src[col]; - - for (i = -2; i <= 2; i++) { - if (abs(v - p_src[col + i * pitch]) > flimit) - goto down_skip_convolve; - - kernel += kernel5[2 + i] * p_src[col + i * pitch]; - } - - v = (kernel >> 3); - - down_skip_convolve: - p_dst[col] = v; - } - - /* now post_proc_across */ - p_src = dst_ptr; - p_dst = dst_ptr; - - for (i = 0; i < 8; i++) - d[i] = p_src[i]; - - for (col = 0; col < cols; col++) { - int kernel = 4; - v = p_src[col]; - - d[col & 7] = v; - - for (i = -2; i <= 2; i++) { - if (abs(v - p_src[col + i]) > flimit) - goto across_skip_convolve; - - kernel += kernel5[2 + i] * p_src[col + i]; - } - - d[col & 7] = (kernel >> 3); - - across_skip_convolve: - if (col >= 2) - p_dst[col - 2] = d[(col - 2) & 7]; - } - - /* handle the last two pixels */ - p_dst[col - 2] = d[(col - 2) & 7]; - p_dst[col - 1] = d[(col - 1) & 7]; - - - /* next row */ - src_ptr += pitch; - dst_ptr += dst_pixels_per_line; - } -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -static int q2mbl(int x) { - if (x < 20) x = 20; - - x = 50 + (x - 50) * 10 / 8; - return x * x / 3; -} - -void vp9_mbpost_proc_across_ip_c(uint8_t *src, int pitch, - int rows, int cols, int flimit) { - int r, c, i; - uint8_t *s = src; - uint8_t d[16]; - - for (r = 0; r < rows; r++) { - int sumsq = 0; - int sum = 0; - - for (i = -8; i <= 6; i++) { - sumsq += s[i] * s[i]; - sum += s[i]; - d[i + 8] = 0; - } - - for (c = 0; c < cols + 8; c++) { - int x = s[c + 7] - s[c - 8]; - int y = s[c + 7] + s[c - 8]; - - sum += x; - sumsq += x * y; - - d[c & 15] = s[c]; - - if (sumsq * 15 - sum * sum < flimit) { - d[c & 15] = (8 + sum + s[c]) >> 4; - } - - s[c - 8] = d[(c - 8) & 15]; - } - s += pitch; - } -} - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_highbd_mbpost_proc_across_ip_c(uint16_t *src, int pitch, - int rows, int cols, int flimit) { - int r, c, i; - - uint16_t *s = src; - uint16_t d[16]; - - - for (r = 0; r < rows; r++) { - int sumsq = 0; - int sum = 0; - - for (i = -8; i <= 6; i++) { - sumsq += s[i] * s[i]; - sum += s[i]; - d[i + 8] = 0; - } - - for (c = 0; c < cols + 8; c++) { - int x = s[c + 7] - s[c - 8]; - int y = s[c + 7] + s[c - 8]; - - sum += x; - sumsq += x * y; - - d[c & 15] = s[c]; - - if (sumsq * 15 - sum * sum < flimit) { - d[c & 15] = (8 + sum + s[c]) >> 4; - } - - s[c - 8] = d[(c - 8) & 15]; - } - - s += pitch; - } -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -void vp9_mbpost_proc_down_c(uint8_t *dst, int pitch, - int rows, int cols, int flimit) { - int r, c, i; - const short *rv3 = &vp9_rv[63 & rand()]; // NOLINT - - for (c = 0; c < cols; c++) { - uint8_t *s = &dst[c]; - int sumsq = 0; - int sum = 0; - uint8_t d[16]; - const short *rv2 = rv3 + ((c * 17) & 127); - - for (i = -8; i <= 6; i++) { - sumsq += s[i * pitch] * s[i * pitch]; - sum += s[i * pitch]; - } - - for (r = 0; r < rows + 8; r++) { - sumsq += s[7 * pitch] * s[ 7 * pitch] - s[-8 * pitch] * s[-8 * pitch]; - sum += s[7 * pitch] - s[-8 * pitch]; - d[r & 15] = s[0]; - - if (sumsq * 15 - sum * sum < flimit) { - d[r & 15] = (rv2[r & 127] + sum + s[0]) >> 4; - } - - s[-8 * pitch] = d[(r - 8) & 15]; - s += pitch; - } - } -} - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_highbd_mbpost_proc_down_c(uint16_t *dst, int pitch, - int rows, int cols, int flimit) { - int r, c, i; - const int16_t *rv3 = &vp9_rv[63 & rand()]; // NOLINT - - for (c = 0; c < cols; c++) { - uint16_t *s = &dst[c]; - int sumsq = 0; - int sum = 0; - uint16_t d[16]; - const int16_t *rv2 = rv3 + ((c * 17) & 127); - - for (i = -8; i <= 6; i++) { - sumsq += s[i * pitch] * s[i * pitch]; - sum += s[i * pitch]; - } - - for (r = 0; r < rows + 8; r++) { - sumsq += s[7 * pitch] * s[ 7 * pitch] - s[-8 * pitch] * s[-8 * pitch]; - sum += s[7 * pitch] - s[-8 * pitch]; - d[r & 15] = s[0]; - - if (sumsq * 15 - sum * sum < flimit) { - d[r & 15] = (rv2[r & 127] + sum + s[0]) >> 4; - } - - s[-8 * pitch] = d[(r - 8) & 15]; - s += pitch; - } - } -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -static void deblock_and_de_macro_block(YV12_BUFFER_CONFIG *source, - YV12_BUFFER_CONFIG *post, - int q, - int low_var_thresh, - int flag) { - double level = 6.0e-05 * q * q * q - .0067 * q * q + .306 * q + .0065; - int ppl = (int)(level + .5); - (void) low_var_thresh; - (void) flag; - -#if CONFIG_VP9_HIGHBITDEPTH - if (source->flags & YV12_FLAG_HIGHBITDEPTH) { - vp9_highbd_post_proc_down_and_across(CONVERT_TO_SHORTPTR(source->y_buffer), - CONVERT_TO_SHORTPTR(post->y_buffer), - source->y_stride, post->y_stride, - source->y_height, source->y_width, - ppl); - - vp9_highbd_mbpost_proc_across_ip(CONVERT_TO_SHORTPTR(post->y_buffer), - post->y_stride, post->y_height, - post->y_width, q2mbl(q)); - - vp9_highbd_mbpost_proc_down(CONVERT_TO_SHORTPTR(post->y_buffer), - post->y_stride, post->y_height, - post->y_width, q2mbl(q)); - - vp9_highbd_post_proc_down_and_across(CONVERT_TO_SHORTPTR(source->u_buffer), - CONVERT_TO_SHORTPTR(post->u_buffer), - source->uv_stride, post->uv_stride, - source->uv_height, source->uv_width, - ppl); - vp9_highbd_post_proc_down_and_across(CONVERT_TO_SHORTPTR(source->v_buffer), - CONVERT_TO_SHORTPTR(post->v_buffer), - source->uv_stride, post->uv_stride, - source->uv_height, source->uv_width, - ppl); - } else { - vp9_post_proc_down_and_across(source->y_buffer, post->y_buffer, - source->y_stride, post->y_stride, - source->y_height, source->y_width, ppl); - - vp9_mbpost_proc_across_ip(post->y_buffer, post->y_stride, post->y_height, - post->y_width, q2mbl(q)); - - vp9_mbpost_proc_down(post->y_buffer, post->y_stride, post->y_height, - post->y_width, q2mbl(q)); - - vp9_post_proc_down_and_across(source->u_buffer, post->u_buffer, - source->uv_stride, post->uv_stride, - source->uv_height, source->uv_width, ppl); - vp9_post_proc_down_and_across(source->v_buffer, post->v_buffer, - source->uv_stride, post->uv_stride, - source->uv_height, source->uv_width, ppl); - } -#else - vp9_post_proc_down_and_across(source->y_buffer, post->y_buffer, - source->y_stride, post->y_stride, - source->y_height, source->y_width, ppl); - - vp9_mbpost_proc_across_ip(post->y_buffer, post->y_stride, post->y_height, - post->y_width, q2mbl(q)); - - vp9_mbpost_proc_down(post->y_buffer, post->y_stride, post->y_height, - post->y_width, q2mbl(q)); - - vp9_post_proc_down_and_across(source->u_buffer, post->u_buffer, - source->uv_stride, post->uv_stride, - source->uv_height, source->uv_width, ppl); - vp9_post_proc_down_and_across(source->v_buffer, post->v_buffer, - source->uv_stride, post->uv_stride, - source->uv_height, source->uv_width, ppl); -#endif // CONFIG_VP9_HIGHBITDEPTH -} - -void vp9_deblock(const YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst, - int q) { - const int ppl = (int)(6.0e-05 * q * q * q - 0.0067 * q * q + 0.306 * q - + 0.0065 + 0.5); - int i; - - const uint8_t *const srcs[3] = {src->y_buffer, src->u_buffer, src->v_buffer}; - const int src_strides[3] = {src->y_stride, src->uv_stride, src->uv_stride}; - const int src_widths[3] = {src->y_width, src->uv_width, src->uv_width}; - const int src_heights[3] = {src->y_height, src->uv_height, src->uv_height}; - - uint8_t *const dsts[3] = {dst->y_buffer, dst->u_buffer, dst->v_buffer}; - const int dst_strides[3] = {dst->y_stride, dst->uv_stride, dst->uv_stride}; - - for (i = 0; i < MAX_MB_PLANE; ++i) { -#if CONFIG_VP9_HIGHBITDEPTH - assert((src->flags & YV12_FLAG_HIGHBITDEPTH) == - (dst->flags & YV12_FLAG_HIGHBITDEPTH)); - if (src->flags & YV12_FLAG_HIGHBITDEPTH) { - vp9_highbd_post_proc_down_and_across(CONVERT_TO_SHORTPTR(srcs[i]), - CONVERT_TO_SHORTPTR(dsts[i]), - src_strides[i], dst_strides[i], - src_heights[i], src_widths[i], ppl); - } else { - vp9_post_proc_down_and_across(srcs[i], dsts[i], - src_strides[i], dst_strides[i], - src_heights[i], src_widths[i], ppl); - } -#else - vp9_post_proc_down_and_across(srcs[i], dsts[i], - src_strides[i], dst_strides[i], - src_heights[i], src_widths[i], ppl); -#endif // CONFIG_VP9_HIGHBITDEPTH - } -} - -void vp9_denoise(const YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst, - int q) { - const int ppl = (int)(6.0e-05 * q * q * q - 0.0067 * q * q + 0.306 * q - + 0.0065 + 0.5); - int i; - - const uint8_t *const srcs[3] = {src->y_buffer, src->u_buffer, src->v_buffer}; - const int src_strides[3] = {src->y_stride, src->uv_stride, src->uv_stride}; - const int src_widths[3] = {src->y_width, src->uv_width, src->uv_width}; - const int src_heights[3] = {src->y_height, src->uv_height, src->uv_height}; - - uint8_t *const dsts[3] = {dst->y_buffer, dst->u_buffer, dst->v_buffer}; - const int dst_strides[3] = {dst->y_stride, dst->uv_stride, dst->uv_stride}; - - for (i = 0; i < MAX_MB_PLANE; ++i) { - const int src_stride = src_strides[i]; - const int src_width = src_widths[i] - 4; - const int src_height = src_heights[i] - 4; - const int dst_stride = dst_strides[i]; - -#if CONFIG_VP9_HIGHBITDEPTH - assert((src->flags & YV12_FLAG_HIGHBITDEPTH) == - (dst->flags & YV12_FLAG_HIGHBITDEPTH)); - if (src->flags & YV12_FLAG_HIGHBITDEPTH) { - const uint16_t *const src = CONVERT_TO_SHORTPTR(srcs[i] + 2 * src_stride - + 2); - uint16_t *const dst = CONVERT_TO_SHORTPTR(dsts[i] + 2 * dst_stride + 2); - vp9_highbd_post_proc_down_and_across(src, dst, src_stride, dst_stride, - src_height, src_width, ppl); - } else { - const uint8_t *const src = srcs[i] + 2 * src_stride + 2; - uint8_t *const dst = dsts[i] + 2 * dst_stride + 2; - - vp9_post_proc_down_and_across(src, dst, src_stride, dst_stride, - src_height, src_width, ppl); - } -#else - const uint8_t *const src = srcs[i] + 2 * src_stride + 2; - uint8_t *const dst = dsts[i] + 2 * dst_stride + 2; - vp9_post_proc_down_and_across(src, dst, src_stride, dst_stride, - src_height, src_width, ppl); -#endif - } -} - -static double gaussian(double sigma, double mu, double x) { - return 1 / (sigma * sqrt(2.0 * 3.14159265)) * - (exp(-(x - mu) * (x - mu) / (2 * sigma * sigma))); -} - -static void fillrd(struct postproc_state *state, int q, int a) { - char char_dist[300]; - - double sigma; - int ai = a, qi = q, i; - - vp9_clear_system_state(); - - sigma = ai + .5 + .6 * (63 - qi) / 63.0; - - /* set up a lookup table of 256 entries that matches - * a gaussian distribution with sigma determined by q. - */ - { - double i; - int next, j; - - next = 0; - - for (i = -32; i < 32; i++) { - int a = (int)(0.5 + 256 * gaussian(sigma, 0, i)); - - if (a) { - for (j = 0; j < a; j++) { - char_dist[next + j] = (char) i; - } - - next = next + j; - } - } - - for (; next < 256; next++) - char_dist[next] = 0; - } - - for (i = 0; i < 3072; i++) { - state->noise[i] = char_dist[rand() & 0xff]; // NOLINT - } - - for (i = 0; i < 16; i++) { - state->blackclamp[i] = -char_dist[0]; - state->whiteclamp[i] = -char_dist[0]; - state->bothclamp[i] = -2 * char_dist[0]; - } - - state->last_q = q; - state->last_noise = a; -} - -void vp9_plane_add_noise_c(uint8_t *start, char *noise, - char blackclamp[16], - char whiteclamp[16], - char bothclamp[16], - unsigned int width, unsigned int height, int pitch) { - unsigned int i, j; - - // TODO(jbb): why does simd code use both but c doesn't, normalize and - // fix.. - (void) bothclamp; - for (i = 0; i < height; i++) { - uint8_t *pos = start + i * pitch; - char *ref = (char *)(noise + (rand() & 0xff)); // NOLINT - - for (j = 0; j < width; j++) { - if (pos[j] < blackclamp[0]) - pos[j] = blackclamp[0]; - - if (pos[j] > 255 + whiteclamp[0]) - pos[j] = 255 + whiteclamp[0]; - - pos[j] += ref[j]; - } - } -} - -static void swap_mi_and_prev_mi(VP9_COMMON *cm) { - // Current mip will be the prev_mip for the next frame. - MODE_INFO *temp = cm->postproc_state.prev_mip; - cm->postproc_state.prev_mip = cm->mip; - cm->mip = temp; - - // Update the upper left visible macroblock ptrs. - cm->mi = cm->mip + cm->mi_stride + 1; - cm->postproc_state.prev_mi = cm->postproc_state.prev_mip + cm->mi_stride + 1; -} - -int vp9_post_proc_frame(struct VP9Common *cm, - YV12_BUFFER_CONFIG *dest, vp9_ppflags_t *ppflags) { - const int q = MIN(105, cm->lf.filter_level * 2); - const int flags = ppflags->post_proc_flag; - YV12_BUFFER_CONFIG *const ppbuf = &cm->post_proc_buffer; - struct postproc_state *const ppstate = &cm->postproc_state; - - if (!cm->frame_to_show) - return -1; - - if (!flags) { - *dest = *cm->frame_to_show; - return 0; - } - - vp9_clear_system_state(); - - // Alloc memory for prev_mip in the first frame. - if (cm->current_video_frame == 1) { - cm->postproc_state.last_base_qindex = cm->base_qindex; - cm->postproc_state.last_frame_valid = 1; - ppstate->prev_mip = vpx_calloc(cm->mi_alloc_size, sizeof(*cm->mip)); - if (!ppstate->prev_mip) { - return 1; - } - ppstate->prev_mi = ppstate->prev_mip + cm->mi_stride + 1; - vpx_memset(ppstate->prev_mip, 0, - cm->mi_stride * (cm->mi_rows + 1) * sizeof(*cm->mip)); - } - - // Allocate post_proc_buffer_int if needed. - if ((flags & VP9D_MFQE) && !cm->post_proc_buffer_int.buffer_alloc) { - if ((flags & VP9D_DEMACROBLOCK) || (flags & VP9D_DEBLOCK)) { - const int width = ALIGN_POWER_OF_TWO(cm->width, 4); - const int height = ALIGN_POWER_OF_TWO(cm->height, 4); - - if (vp9_alloc_frame_buffer(&cm->post_proc_buffer_int, width, height, - cm->subsampling_x, cm->subsampling_y, -#if CONFIG_VP9_HIGHBITDEPTH - cm->use_highbitdepth, -#endif // CONFIG_VP9_HIGHBITDEPTH - VP9_ENC_BORDER_IN_PIXELS, - cm->byte_alignment) < 0) { - vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR, - "Failed to allocate MFQE framebuffer"); - } - - // Ensure that postproc is set to all 0s so that post proc - // doesn't pull random data in from edge. - vpx_memset(cm->post_proc_buffer_int.buffer_alloc, 128, - cm->post_proc_buffer.frame_size); - } - } - - if (vp9_realloc_frame_buffer(&cm->post_proc_buffer, cm->width, cm->height, - cm->subsampling_x, cm->subsampling_y, -#if CONFIG_VP9_HIGHBITDEPTH - cm->use_highbitdepth, -#endif - VP9_DEC_BORDER_IN_PIXELS, cm->byte_alignment, - NULL, NULL, NULL) < 0) - vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR, - "Failed to allocate post-processing buffer"); - - if ((flags & VP9D_MFQE) && cm->current_video_frame >= 2 && - cm->postproc_state.last_frame_valid && cm->bit_depth == 8 && - cm->postproc_state.last_base_qindex <= last_q_thresh && - cm->base_qindex - cm->postproc_state.last_base_qindex >= q_diff_thresh) { - vp9_mfqe(cm); - // TODO(jackychen): Consider whether enable deblocking by default - // if mfqe is enabled. Need to take both the quality and the speed - // into consideration. - if ((flags & VP9D_DEMACROBLOCK) || (flags & VP9D_DEBLOCK)) { - vp8_yv12_copy_frame(ppbuf, &cm->post_proc_buffer_int); - } - if ((flags & VP9D_DEMACROBLOCK) && cm->post_proc_buffer_int.buffer_alloc) { - deblock_and_de_macro_block(&cm->post_proc_buffer_int, ppbuf, - q + (ppflags->deblocking_level - 5) * 10, - 1, 0); - } else if (flags & VP9D_DEBLOCK) { - vp9_deblock(&cm->post_proc_buffer_int, ppbuf, q); - } else { - vp8_yv12_copy_frame(&cm->post_proc_buffer_int, ppbuf); - } - } else if (flags & VP9D_DEMACROBLOCK) { - deblock_and_de_macro_block(cm->frame_to_show, ppbuf, - q + (ppflags->deblocking_level - 5) * 10, 1, 0); - } else if (flags & VP9D_DEBLOCK) { - vp9_deblock(cm->frame_to_show, ppbuf, q); - } else { - vp8_yv12_copy_frame(cm->frame_to_show, ppbuf); - } - - cm->postproc_state.last_base_qindex = cm->base_qindex; - cm->postproc_state.last_frame_valid = 1; - - if (flags & VP9D_ADDNOISE) { - const int noise_level = ppflags->noise_level; - if (ppstate->last_q != q || - ppstate->last_noise != noise_level) { - fillrd(ppstate, 63 - q, noise_level); - } - - vp9_plane_add_noise(ppbuf->y_buffer, ppstate->noise, ppstate->blackclamp, - ppstate->whiteclamp, ppstate->bothclamp, - ppbuf->y_width, ppbuf->y_height, ppbuf->y_stride); - } - - *dest = *ppbuf; - - /* handle problem with extending borders */ - dest->y_width = cm->width; - dest->y_height = cm->height; - dest->uv_width = dest->y_width >> cm->subsampling_x; - dest->uv_height = dest->y_height >> cm->subsampling_y; - - swap_mi_and_prev_mi(cm); - return 0; -} -#endif // CONFIG_VP9_POSTPROC diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_postproc.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_postproc.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_postproc.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_postproc.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP9_COMMON_VP9_POSTPROC_H_ -#define VP9_COMMON_VP9_POSTPROC_H_ - -#include "vpx_ports/mem.h" -#include "vpx_scale/yv12config.h" -#include "vp9/common/vp9_blockd.h" -#include "vp9/common/vp9_mfqe.h" -#include "vp9/common/vp9_ppflags.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct postproc_state { - int last_q; - int last_noise; - char noise[3072]; - int last_base_qindex; - int last_frame_valid; - MODE_INFO *prev_mip; - MODE_INFO *prev_mi; - DECLARE_ALIGNED(16, char, blackclamp[16]); - DECLARE_ALIGNED(16, char, whiteclamp[16]); - DECLARE_ALIGNED(16, char, bothclamp[16]); -}; - -struct VP9Common; - -#define MFQE_PRECISION 4 - -int vp9_post_proc_frame(struct VP9Common *cm, - YV12_BUFFER_CONFIG *dest, vp9_ppflags_t *flags); - -void vp9_denoise(const YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst, int q); - -void vp9_deblock(const YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst, int q); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_POSTPROC_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_ppflags.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_ppflags.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_ppflags.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_ppflags.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_PPFLAGS_H_ -#define VP9_COMMON_VP9_PPFLAGS_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - VP9D_NOFILTERING = 0, - VP9D_DEBLOCK = 1 << 0, - VP9D_DEMACROBLOCK = 1 << 1, - VP9D_ADDNOISE = 1 << 2, - VP9D_DEBUG_TXT_FRAME_INFO = 1 << 3, - VP9D_DEBUG_TXT_MBLK_MODES = 1 << 4, - VP9D_DEBUG_TXT_DC_DIFF = 1 << 5, - VP9D_DEBUG_TXT_RATE_INFO = 1 << 6, - VP9D_DEBUG_DRAW_MV = 1 << 7, - VP9D_DEBUG_CLR_BLK_MODES = 1 << 8, - VP9D_DEBUG_CLR_FRM_REF_BLKS = 1 << 9, - VP9D_MFQE = 1 << 10 -}; - -typedef struct { - int post_proc_flag; - int deblocking_level; - int noise_level; -} vp9_ppflags_t; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_PPFLAGS_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_pred_common.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_pred_common.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_pred_common.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_pred_common.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,381 +0,0 @@ - -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_pred_common.h" -#include "vp9/common/vp9_seg_common.h" - -// Returns a context number for the given MB prediction signal -int vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd) { - // Note: - // The mode info data structure has a one element border above and to the - // left of the entries correpsonding to real macroblocks. - // The prediction flags in these dummy entries are initialised to 0. - const MB_MODE_INFO *const left_mbmi = xd->left_mbmi; - const int left_type = xd->left_available && is_inter_block(left_mbmi) ? - left_mbmi->interp_filter : SWITCHABLE_FILTERS; - const MB_MODE_INFO *const above_mbmi = xd->above_mbmi; - const int above_type = xd->up_available && is_inter_block(above_mbmi) ? - above_mbmi->interp_filter : SWITCHABLE_FILTERS; - - if (left_type == above_type) - return left_type; - else if (left_type == SWITCHABLE_FILTERS && above_type != SWITCHABLE_FILTERS) - return above_type; - else if (left_type != SWITCHABLE_FILTERS && above_type == SWITCHABLE_FILTERS) - return left_type; - else - return SWITCHABLE_FILTERS; -} - -// The mode info data structure has a one element border above and to the -// left of the entries corresponding to real macroblocks. -// The prediction flags in these dummy entries are initialized to 0. -// 0 - inter/inter, inter/--, --/inter, --/-- -// 1 - intra/inter, inter/intra -// 2 - intra/--, --/intra -// 3 - intra/intra -int vp9_get_intra_inter_context(const MACROBLOCKD *xd) { - const MB_MODE_INFO *const above_mbmi = xd->above_mbmi; - const MB_MODE_INFO *const left_mbmi = xd->left_mbmi; - const int has_above = xd->up_available; - const int has_left = xd->left_available; - - if (has_above && has_left) { // both edges available - const int above_intra = !is_inter_block(above_mbmi); - const int left_intra = !is_inter_block(left_mbmi); - return left_intra && above_intra ? 3 - : left_intra || above_intra; - } else if (has_above || has_left) { // one edge available - return 2 * !is_inter_block(has_above ? above_mbmi : left_mbmi); - } else { - return 0; - } -} - -int vp9_get_reference_mode_context(const VP9_COMMON *cm, - const MACROBLOCKD *xd) { - int ctx; - const MB_MODE_INFO *const above_mbmi = xd->above_mbmi; - const MB_MODE_INFO *const left_mbmi = xd->left_mbmi; - const int has_above = xd->up_available; - const int has_left = xd->left_available; - // Note: - // The mode info data structure has a one element border above and to the - // left of the entries correpsonding to real macroblocks. - // The prediction flags in these dummy entries are initialised to 0. - if (has_above && has_left) { // both edges available - if (!has_second_ref(above_mbmi) && !has_second_ref(left_mbmi)) - // neither edge uses comp pred (0/1) - ctx = (above_mbmi->ref_frame[0] == cm->comp_fixed_ref) ^ - (left_mbmi->ref_frame[0] == cm->comp_fixed_ref); - else if (!has_second_ref(above_mbmi)) - // one of two edges uses comp pred (2/3) - ctx = 2 + (above_mbmi->ref_frame[0] == cm->comp_fixed_ref || - !is_inter_block(above_mbmi)); - else if (!has_second_ref(left_mbmi)) - // one of two edges uses comp pred (2/3) - ctx = 2 + (left_mbmi->ref_frame[0] == cm->comp_fixed_ref || - !is_inter_block(left_mbmi)); - else // both edges use comp pred (4) - ctx = 4; - } else if (has_above || has_left) { // one edge available - const MB_MODE_INFO *edge_mbmi = has_above ? above_mbmi : left_mbmi; - - if (!has_second_ref(edge_mbmi)) - // edge does not use comp pred (0/1) - ctx = edge_mbmi->ref_frame[0] == cm->comp_fixed_ref; - else - // edge uses comp pred (3) - ctx = 3; - } else { // no edges available (1) - ctx = 1; - } - assert(ctx >= 0 && ctx < COMP_INTER_CONTEXTS); - return ctx; -} - -// Returns a context number for the given MB prediction signal -int vp9_get_pred_context_comp_ref_p(const VP9_COMMON *cm, - const MACROBLOCKD *xd) { - int pred_context; - const MB_MODE_INFO *const above_mbmi = xd->above_mbmi; - const MB_MODE_INFO *const left_mbmi = xd->left_mbmi; - const int above_in_image = xd->up_available; - const int left_in_image = xd->left_available; - - // Note: - // The mode info data structure has a one element border above and to the - // left of the entries correpsonding to real macroblocks. - // The prediction flags in these dummy entries are initialised to 0. - const int fix_ref_idx = cm->ref_frame_sign_bias[cm->comp_fixed_ref]; - const int var_ref_idx = !fix_ref_idx; - - if (above_in_image && left_in_image) { // both edges available - const int above_intra = !is_inter_block(above_mbmi); - const int left_intra = !is_inter_block(left_mbmi); - - if (above_intra && left_intra) { // intra/intra (2) - pred_context = 2; - } else if (above_intra || left_intra) { // intra/inter - const MB_MODE_INFO *edge_mbmi = above_intra ? left_mbmi : above_mbmi; - - if (!has_second_ref(edge_mbmi)) // single pred (1/3) - pred_context = 1 + 2 * (edge_mbmi->ref_frame[0] != cm->comp_var_ref[1]); - else // comp pred (1/3) - pred_context = 1 + 2 * (edge_mbmi->ref_frame[var_ref_idx] - != cm->comp_var_ref[1]); - } else { // inter/inter - const int l_sg = !has_second_ref(left_mbmi); - const int a_sg = !has_second_ref(above_mbmi); - const MV_REFERENCE_FRAME vrfa = a_sg ? above_mbmi->ref_frame[0] - : above_mbmi->ref_frame[var_ref_idx]; - const MV_REFERENCE_FRAME vrfl = l_sg ? left_mbmi->ref_frame[0] - : left_mbmi->ref_frame[var_ref_idx]; - - if (vrfa == vrfl && cm->comp_var_ref[1] == vrfa) { - pred_context = 0; - } else if (l_sg && a_sg) { // single/single - if ((vrfa == cm->comp_fixed_ref && vrfl == cm->comp_var_ref[0]) || - (vrfl == cm->comp_fixed_ref && vrfa == cm->comp_var_ref[0])) - pred_context = 4; - else if (vrfa == vrfl) - pred_context = 3; - else - pred_context = 1; - } else if (l_sg || a_sg) { // single/comp - const MV_REFERENCE_FRAME vrfc = l_sg ? vrfa : vrfl; - const MV_REFERENCE_FRAME rfs = a_sg ? vrfa : vrfl; - if (vrfc == cm->comp_var_ref[1] && rfs != cm->comp_var_ref[1]) - pred_context = 1; - else if (rfs == cm->comp_var_ref[1] && vrfc != cm->comp_var_ref[1]) - pred_context = 2; - else - pred_context = 4; - } else if (vrfa == vrfl) { // comp/comp - pred_context = 4; - } else { - pred_context = 2; - } - } - } else if (above_in_image || left_in_image) { // one edge available - const MB_MODE_INFO *edge_mbmi = above_in_image ? above_mbmi : left_mbmi; - - if (!is_inter_block(edge_mbmi)) { - pred_context = 2; - } else { - if (has_second_ref(edge_mbmi)) - pred_context = 4 * (edge_mbmi->ref_frame[var_ref_idx] - != cm->comp_var_ref[1]); - else - pred_context = 3 * (edge_mbmi->ref_frame[0] != cm->comp_var_ref[1]); - } - } else { // no edges available (2) - pred_context = 2; - } - assert(pred_context >= 0 && pred_context < REF_CONTEXTS); - - return pred_context; -} - -int vp9_get_pred_context_single_ref_p1(const MACROBLOCKD *xd) { - int pred_context; - const MB_MODE_INFO *const above_mbmi = xd->above_mbmi; - const MB_MODE_INFO *const left_mbmi = xd->left_mbmi; - const int has_above = xd->up_available; - const int has_left = xd->left_available; - // Note: - // The mode info data structure has a one element border above and to the - // left of the entries correpsonding to real macroblocks. - // The prediction flags in these dummy entries are initialised to 0. - if (has_above && has_left) { // both edges available - const int above_intra = !is_inter_block(above_mbmi); - const int left_intra = !is_inter_block(left_mbmi); - - if (above_intra && left_intra) { // intra/intra - pred_context = 2; - } else if (above_intra || left_intra) { // intra/inter or inter/intra - const MB_MODE_INFO *edge_mbmi = above_intra ? left_mbmi : above_mbmi; - if (!has_second_ref(edge_mbmi)) - pred_context = 4 * (edge_mbmi->ref_frame[0] == LAST_FRAME); - else - pred_context = 1 + (edge_mbmi->ref_frame[0] == LAST_FRAME || - edge_mbmi->ref_frame[1] == LAST_FRAME); - } else { // inter/inter - const int above_has_second = has_second_ref(above_mbmi); - const int left_has_second = has_second_ref(left_mbmi); - const MV_REFERENCE_FRAME above0 = above_mbmi->ref_frame[0]; - const MV_REFERENCE_FRAME above1 = above_mbmi->ref_frame[1]; - const MV_REFERENCE_FRAME left0 = left_mbmi->ref_frame[0]; - const MV_REFERENCE_FRAME left1 = left_mbmi->ref_frame[1]; - - if (above_has_second && left_has_second) { - pred_context = 1 + (above0 == LAST_FRAME || above1 == LAST_FRAME || - left0 == LAST_FRAME || left1 == LAST_FRAME); - } else if (above_has_second || left_has_second) { - const MV_REFERENCE_FRAME rfs = !above_has_second ? above0 : left0; - const MV_REFERENCE_FRAME crf1 = above_has_second ? above0 : left0; - const MV_REFERENCE_FRAME crf2 = above_has_second ? above1 : left1; - - if (rfs == LAST_FRAME) - pred_context = 3 + (crf1 == LAST_FRAME || crf2 == LAST_FRAME); - else - pred_context = (crf1 == LAST_FRAME || crf2 == LAST_FRAME); - } else { - pred_context = 2 * (above0 == LAST_FRAME) + 2 * (left0 == LAST_FRAME); - } - } - } else if (has_above || has_left) { // one edge available - const MB_MODE_INFO *edge_mbmi = has_above ? above_mbmi : left_mbmi; - if (!is_inter_block(edge_mbmi)) { // intra - pred_context = 2; - } else { // inter - if (!has_second_ref(edge_mbmi)) - pred_context = 4 * (edge_mbmi->ref_frame[0] == LAST_FRAME); - else - pred_context = 1 + (edge_mbmi->ref_frame[0] == LAST_FRAME || - edge_mbmi->ref_frame[1] == LAST_FRAME); - } - } else { // no edges available - pred_context = 2; - } - - assert(pred_context >= 0 && pred_context < REF_CONTEXTS); - return pred_context; -} - -int vp9_get_pred_context_single_ref_p2(const MACROBLOCKD *xd) { - int pred_context; - const MB_MODE_INFO *const above_mbmi = xd->above_mbmi; - const MB_MODE_INFO *const left_mbmi = xd->left_mbmi; - const int has_above = xd->up_available; - const int has_left = xd->left_available; - - // Note: - // The mode info data structure has a one element border above and to the - // left of the entries correpsonding to real macroblocks. - // The prediction flags in these dummy entries are initialised to 0. - if (has_above && has_left) { // both edges available - const int above_intra = !is_inter_block(above_mbmi); - const int left_intra = !is_inter_block(left_mbmi); - - if (above_intra && left_intra) { // intra/intra - pred_context = 2; - } else if (above_intra || left_intra) { // intra/inter or inter/intra - const MB_MODE_INFO *edge_mbmi = above_intra ? left_mbmi : above_mbmi; - if (!has_second_ref(edge_mbmi)) { - if (edge_mbmi->ref_frame[0] == LAST_FRAME) - pred_context = 3; - else - pred_context = 4 * (edge_mbmi->ref_frame[0] == GOLDEN_FRAME); - } else { - pred_context = 1 + 2 * (edge_mbmi->ref_frame[0] == GOLDEN_FRAME || - edge_mbmi->ref_frame[1] == GOLDEN_FRAME); - } - } else { // inter/inter - const int above_has_second = has_second_ref(above_mbmi); - const int left_has_second = has_second_ref(left_mbmi); - const MV_REFERENCE_FRAME above0 = above_mbmi->ref_frame[0]; - const MV_REFERENCE_FRAME above1 = above_mbmi->ref_frame[1]; - const MV_REFERENCE_FRAME left0 = left_mbmi->ref_frame[0]; - const MV_REFERENCE_FRAME left1 = left_mbmi->ref_frame[1]; - - if (above_has_second && left_has_second) { - if (above0 == left0 && above1 == left1) - pred_context = 3 * (above0 == GOLDEN_FRAME || - above1 == GOLDEN_FRAME || - left0 == GOLDEN_FRAME || - left1 == GOLDEN_FRAME); - else - pred_context = 2; - } else if (above_has_second || left_has_second) { - const MV_REFERENCE_FRAME rfs = !above_has_second ? above0 : left0; - const MV_REFERENCE_FRAME crf1 = above_has_second ? above0 : left0; - const MV_REFERENCE_FRAME crf2 = above_has_second ? above1 : left1; - - if (rfs == GOLDEN_FRAME) - pred_context = 3 + (crf1 == GOLDEN_FRAME || crf2 == GOLDEN_FRAME); - else if (rfs == ALTREF_FRAME) - pred_context = crf1 == GOLDEN_FRAME || crf2 == GOLDEN_FRAME; - else - pred_context = 1 + 2 * (crf1 == GOLDEN_FRAME || crf2 == GOLDEN_FRAME); - } else { - if (above0 == LAST_FRAME && left0 == LAST_FRAME) { - pred_context = 3; - } else if (above0 == LAST_FRAME || left0 == LAST_FRAME) { - const MV_REFERENCE_FRAME edge0 = (above0 == LAST_FRAME) ? left0 - : above0; - pred_context = 4 * (edge0 == GOLDEN_FRAME); - } else { - pred_context = 2 * (above0 == GOLDEN_FRAME) + - 2 * (left0 == GOLDEN_FRAME); - } - } - } - } else if (has_above || has_left) { // one edge available - const MB_MODE_INFO *edge_mbmi = has_above ? above_mbmi : left_mbmi; - - if (!is_inter_block(edge_mbmi) || - (edge_mbmi->ref_frame[0] == LAST_FRAME && !has_second_ref(edge_mbmi))) - pred_context = 2; - else if (!has_second_ref(edge_mbmi)) - pred_context = 4 * (edge_mbmi->ref_frame[0] == GOLDEN_FRAME); - else - pred_context = 3 * (edge_mbmi->ref_frame[0] == GOLDEN_FRAME || - edge_mbmi->ref_frame[1] == GOLDEN_FRAME); - } else { // no edges available (2) - pred_context = 2; - } - assert(pred_context >= 0 && pred_context < REF_CONTEXTS); - return pred_context; -} -// Returns a context number for the given MB prediction signal -// The mode info data structure has a one element border above and to the -// left of the entries corresponding to real blocks. -// The prediction flags in these dummy entries are initialized to 0. -int vp9_get_tx_size_context(const MACROBLOCKD *xd) { - const int max_tx_size = max_txsize_lookup[xd->mi[0].src_mi->mbmi.sb_type]; - const MB_MODE_INFO *const above_mbmi = xd->above_mbmi; - const MB_MODE_INFO *const left_mbmi = xd->left_mbmi; - const int has_above = xd->up_available; - const int has_left = xd->left_available; - int above_ctx = (has_above && !above_mbmi->skip) ? (int)above_mbmi->tx_size - : max_tx_size; - int left_ctx = (has_left && !left_mbmi->skip) ? (int)left_mbmi->tx_size - : max_tx_size; - if (!has_left) - left_ctx = above_ctx; - - if (!has_above) - above_ctx = left_ctx; - - return (above_ctx + left_ctx) > max_tx_size; -} - -int vp9_get_segment_id(const VP9_COMMON *cm, const uint8_t *segment_ids, - BLOCK_SIZE bsize, int mi_row, int mi_col) { - const int mi_offset = mi_row * cm->mi_cols + mi_col; - const int bw = num_8x8_blocks_wide_lookup[bsize]; - const int bh = num_8x8_blocks_high_lookup[bsize]; - const int xmis = MIN(cm->mi_cols - mi_col, bw); - const int ymis = MIN(cm->mi_rows - mi_row, bh); - int x, y, segment_id = INT_MAX; - - for (y = 0; y < ymis; y++) - for (x = 0; x < xmis; x++) - segment_id = MIN(segment_id, - segment_ids[mi_offset + y * cm->mi_cols + x]); - - assert(segment_id >= 0 && segment_id < MAX_SEGMENTS); - return segment_id; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_pred_common.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_pred_common.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_pred_common.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_pred_common.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_PRED_COMMON_H_ -#define VP9_COMMON_VP9_PRED_COMMON_H_ - -#include "vp9/common/vp9_blockd.h" -#include "vp9/common/vp9_onyxc_int.h" - -#ifdef __cplusplus -extern "C" { -#endif - -int vp9_get_segment_id(const VP9_COMMON *cm, const uint8_t *segment_ids, - BLOCK_SIZE bsize, int mi_row, int mi_col); - -static INLINE int vp9_get_pred_context_seg_id(const MACROBLOCKD *xd) { - const MODE_INFO *const above_mi = xd->above_mi; - const MODE_INFO *const left_mi = xd->left_mi; - const int above_sip = (above_mi != NULL) ? - above_mi->mbmi.seg_id_predicted : 0; - const int left_sip = (left_mi != NULL) ? left_mi->mbmi.seg_id_predicted : 0; - - return above_sip + left_sip; -} - -static INLINE vp9_prob vp9_get_pred_prob_seg_id(const struct segmentation *seg, - const MACROBLOCKD *xd) { - return seg->pred_probs[vp9_get_pred_context_seg_id(xd)]; -} - -static INLINE int vp9_get_skip_context(const MACROBLOCKD *xd) { - const MODE_INFO *const above_mi = xd->above_mi; - const MODE_INFO *const left_mi = xd->left_mi; - const int above_skip = (above_mi != NULL) ? above_mi->mbmi.skip : 0; - const int left_skip = (left_mi != NULL) ? left_mi->mbmi.skip : 0; - return above_skip + left_skip; -} - -static INLINE vp9_prob vp9_get_skip_prob(const VP9_COMMON *cm, - const MACROBLOCKD *xd) { - return cm->fc->skip_probs[vp9_get_skip_context(xd)]; -} - -int vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd); - -int vp9_get_intra_inter_context(const MACROBLOCKD *xd); - -static INLINE vp9_prob vp9_get_intra_inter_prob(const VP9_COMMON *cm, - const MACROBLOCKD *xd) { - return cm->fc->intra_inter_prob[vp9_get_intra_inter_context(xd)]; -} - -int vp9_get_reference_mode_context(const VP9_COMMON *cm, const MACROBLOCKD *xd); - -static INLINE vp9_prob vp9_get_reference_mode_prob(const VP9_COMMON *cm, - const MACROBLOCKD *xd) { - return cm->fc->comp_inter_prob[vp9_get_reference_mode_context(cm, xd)]; -} - -int vp9_get_pred_context_comp_ref_p(const VP9_COMMON *cm, - const MACROBLOCKD *xd); - -static INLINE vp9_prob vp9_get_pred_prob_comp_ref_p(const VP9_COMMON *cm, - const MACROBLOCKD *xd) { - const int pred_context = vp9_get_pred_context_comp_ref_p(cm, xd); - return cm->fc->comp_ref_prob[pred_context]; -} - -int vp9_get_pred_context_single_ref_p1(const MACROBLOCKD *xd); - -static INLINE vp9_prob vp9_get_pred_prob_single_ref_p1(const VP9_COMMON *cm, - const MACROBLOCKD *xd) { - return cm->fc->single_ref_prob[vp9_get_pred_context_single_ref_p1(xd)][0]; -} - -int vp9_get_pred_context_single_ref_p2(const MACROBLOCKD *xd); - -static INLINE vp9_prob vp9_get_pred_prob_single_ref_p2(const VP9_COMMON *cm, - const MACROBLOCKD *xd) { - return cm->fc->single_ref_prob[vp9_get_pred_context_single_ref_p2(xd)][1]; -} - -int vp9_get_tx_size_context(const MACROBLOCKD *xd); - -static INLINE const vp9_prob *get_tx_probs(TX_SIZE max_tx_size, int ctx, - const struct tx_probs *tx_probs) { - switch (max_tx_size) { - case TX_8X8: - return tx_probs->p8x8[ctx]; - case TX_16X16: - return tx_probs->p16x16[ctx]; - case TX_32X32: - return tx_probs->p32x32[ctx]; - default: - assert(0 && "Invalid max_tx_size."); - return NULL; - } -} - -static INLINE const vp9_prob *get_tx_probs2(TX_SIZE max_tx_size, - const MACROBLOCKD *xd, - const struct tx_probs *tx_probs) { - return get_tx_probs(max_tx_size, vp9_get_tx_size_context(xd), tx_probs); -} - -static INLINE unsigned int *get_tx_counts(TX_SIZE max_tx_size, int ctx, - struct tx_counts *tx_counts) { - switch (max_tx_size) { - case TX_8X8: - return tx_counts->p8x8[ctx]; - case TX_16X16: - return tx_counts->p16x16[ctx]; - case TX_32X32: - return tx_counts->p32x32[ctx]; - default: - assert(0 && "Invalid max_tx_size."); - return NULL; - } -} - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_PRED_COMMON_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_prob.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_prob.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_prob.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_prob.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vp9/common/vp9_prob.h" - -const uint8_t vp9_norm[256] = { - 0, 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 -}; - -static unsigned int tree_merge_probs_impl(unsigned int i, - const vp9_tree_index *tree, - const vp9_prob *pre_probs, - const unsigned int *counts, - vp9_prob *probs) { - const int l = tree[i]; - const unsigned int left_count = (l <= 0) - ? counts[-l] - : tree_merge_probs_impl(l, tree, pre_probs, counts, probs); - const int r = tree[i + 1]; - const unsigned int right_count = (r <= 0) - ? counts[-r] - : tree_merge_probs_impl(r, tree, pre_probs, counts, probs); - const unsigned int ct[2] = { left_count, right_count }; - probs[i >> 1] = mode_mv_merge_probs(pre_probs[i >> 1], ct); - return left_count + right_count; -} - -void vp9_tree_merge_probs(const vp9_tree_index *tree, const vp9_prob *pre_probs, - const unsigned int *counts, vp9_prob *probs) { - tree_merge_probs_impl(0, tree, pre_probs, counts, probs); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_prob.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_prob.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_prob.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_prob.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_PROB_H_ -#define VP9_COMMON_VP9_PROB_H_ - -#include "./vpx_config.h" - -#include "vpx_ports/mem.h" - -#include "vp9/common/vp9_common.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef uint8_t vp9_prob; - -#define MAX_PROB 255 - -#define vp9_prob_half ((vp9_prob) 128) - -typedef int8_t vp9_tree_index; - -#define TREE_SIZE(leaf_count) (2 * (leaf_count) - 2) - -#define vp9_complement(x) (255 - x) - -#define MODE_MV_COUNT_SAT 20 - -/* We build coding trees compactly in arrays. - Each node of the tree is a pair of vp9_tree_indices. - Array index often references a corresponding probability table. - Index <= 0 means done encoding/decoding and value = -Index, - Index > 0 means need another bit, specification at index. - Nonnegative indices are always even; processing begins at node 0. */ - -typedef const vp9_tree_index vp9_tree[]; - -static INLINE vp9_prob clip_prob(int p) { - return (p > 255) ? 255 : (p < 1) ? 1 : p; -} - -static INLINE vp9_prob get_prob(int num, int den) { - return (den == 0) ? 128u : clip_prob(((int64_t)num * 256 + (den >> 1)) / den); -} - -static INLINE vp9_prob get_binary_prob(int n0, int n1) { - return get_prob(n0, n0 + n1); -} - -/* This function assumes prob1 and prob2 are already within [1,255] range. */ -static INLINE vp9_prob weighted_prob(int prob1, int prob2, int factor) { - return ROUND_POWER_OF_TWO(prob1 * (256 - factor) + prob2 * factor, 8); -} - -static INLINE vp9_prob merge_probs(vp9_prob pre_prob, - const unsigned int ct[2], - unsigned int count_sat, - unsigned int max_update_factor) { - const vp9_prob prob = get_binary_prob(ct[0], ct[1]); - const unsigned int count = MIN(ct[0] + ct[1], count_sat); - const unsigned int factor = max_update_factor * count / count_sat; - return weighted_prob(pre_prob, prob, factor); -} - -// MODE_MV_MAX_UPDATE_FACTOR (128) * count / MODE_MV_COUNT_SAT; -static const int count_to_update_factor[MODE_MV_COUNT_SAT + 1] = { - 0, 6, 12, 19, 25, 32, 38, 44, 51, 57, 64, - 70, 76, 83, 89, 96, 102, 108, 115, 121, 128 -}; - -static INLINE vp9_prob mode_mv_merge_probs(vp9_prob pre_prob, - const unsigned int ct[2]) { - const unsigned int den = ct[0] + ct[1]; - if (den == 0) { - return pre_prob; - } else { - const unsigned int count = MIN(den, MODE_MV_COUNT_SAT); - const unsigned int factor = count_to_update_factor[count]; - const vp9_prob prob = - clip_prob(((int64_t)(ct[0]) * 256 + (den >> 1)) / den); - return weighted_prob(pre_prob, prob, factor); - } -} - -void vp9_tree_merge_probs(const vp9_tree_index *tree, const vp9_prob *pre_probs, - const unsigned int *counts, vp9_prob *probs); - - -DECLARE_ALIGNED(16, extern const uint8_t, vp9_norm[256]); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_PROB_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_quant_common.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_quant_common.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_quant_common.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_quant_common.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,278 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_quant_common.h" -#include "vp9/common/vp9_seg_common.h" - -static const int16_t dc_qlookup[QINDEX_RANGE] = { - 4, 8, 8, 9, 10, 11, 12, 12, - 13, 14, 15, 16, 17, 18, 19, 19, - 20, 21, 22, 23, 24, 25, 26, 26, - 27, 28, 29, 30, 31, 32, 32, 33, - 34, 35, 36, 37, 38, 38, 39, 40, - 41, 42, 43, 43, 44, 45, 46, 47, - 48, 48, 49, 50, 51, 52, 53, 53, - 54, 55, 56, 57, 57, 58, 59, 60, - 61, 62, 62, 63, 64, 65, 66, 66, - 67, 68, 69, 70, 70, 71, 72, 73, - 74, 74, 75, 76, 77, 78, 78, 79, - 80, 81, 81, 82, 83, 84, 85, 85, - 87, 88, 90, 92, 93, 95, 96, 98, - 99, 101, 102, 104, 105, 107, 108, 110, - 111, 113, 114, 116, 117, 118, 120, 121, - 123, 125, 127, 129, 131, 134, 136, 138, - 140, 142, 144, 146, 148, 150, 152, 154, - 156, 158, 161, 164, 166, 169, 172, 174, - 177, 180, 182, 185, 187, 190, 192, 195, - 199, 202, 205, 208, 211, 214, 217, 220, - 223, 226, 230, 233, 237, 240, 243, 247, - 250, 253, 257, 261, 265, 269, 272, 276, - 280, 284, 288, 292, 296, 300, 304, 309, - 313, 317, 322, 326, 330, 335, 340, 344, - 349, 354, 359, 364, 369, 374, 379, 384, - 389, 395, 400, 406, 411, 417, 423, 429, - 435, 441, 447, 454, 461, 467, 475, 482, - 489, 497, 505, 513, 522, 530, 539, 549, - 559, 569, 579, 590, 602, 614, 626, 640, - 654, 668, 684, 700, 717, 736, 755, 775, - 796, 819, 843, 869, 896, 925, 955, 988, - 1022, 1058, 1098, 1139, 1184, 1232, 1282, 1336, -}; - -#if CONFIG_VP9_HIGHBITDEPTH -static const int16_t dc_qlookup_10[QINDEX_RANGE] = { - 4, 9, 10, 13, 15, 17, 20, 22, - 25, 28, 31, 34, 37, 40, 43, 47, - 50, 53, 57, 60, 64, 68, 71, 75, - 78, 82, 86, 90, 93, 97, 101, 105, - 109, 113, 116, 120, 124, 128, 132, 136, - 140, 143, 147, 151, 155, 159, 163, 166, - 170, 174, 178, 182, 185, 189, 193, 197, - 200, 204, 208, 212, 215, 219, 223, 226, - 230, 233, 237, 241, 244, 248, 251, 255, - 259, 262, 266, 269, 273, 276, 280, 283, - 287, 290, 293, 297, 300, 304, 307, 310, - 314, 317, 321, 324, 327, 331, 334, 337, - 343, 350, 356, 362, 369, 375, 381, 387, - 394, 400, 406, 412, 418, 424, 430, 436, - 442, 448, 454, 460, 466, 472, 478, 484, - 490, 499, 507, 516, 525, 533, 542, 550, - 559, 567, 576, 584, 592, 601, 609, 617, - 625, 634, 644, 655, 666, 676, 687, 698, - 708, 718, 729, 739, 749, 759, 770, 782, - 795, 807, 819, 831, 844, 856, 868, 880, - 891, 906, 920, 933, 947, 961, 975, 988, - 1001, 1015, 1030, 1045, 1061, 1076, 1090, 1105, - 1120, 1137, 1153, 1170, 1186, 1202, 1218, 1236, - 1253, 1271, 1288, 1306, 1323, 1342, 1361, 1379, - 1398, 1416, 1436, 1456, 1476, 1496, 1516, 1537, - 1559, 1580, 1601, 1624, 1647, 1670, 1692, 1717, - 1741, 1766, 1791, 1817, 1844, 1871, 1900, 1929, - 1958, 1990, 2021, 2054, 2088, 2123, 2159, 2197, - 2236, 2276, 2319, 2363, 2410, 2458, 2508, 2561, - 2616, 2675, 2737, 2802, 2871, 2944, 3020, 3102, - 3188, 3280, 3375, 3478, 3586, 3702, 3823, 3953, - 4089, 4236, 4394, 4559, 4737, 4929, 5130, 5347, -}; - -static const int16_t dc_qlookup_12[QINDEX_RANGE] = { - 4, 12, 18, 25, 33, 41, 50, 60, - 70, 80, 91, 103, 115, 127, 140, 153, - 166, 180, 194, 208, 222, 237, 251, 266, - 281, 296, 312, 327, 343, 358, 374, 390, - 405, 421, 437, 453, 469, 484, 500, 516, - 532, 548, 564, 580, 596, 611, 627, 643, - 659, 674, 690, 706, 721, 737, 752, 768, - 783, 798, 814, 829, 844, 859, 874, 889, - 904, 919, 934, 949, 964, 978, 993, 1008, - 1022, 1037, 1051, 1065, 1080, 1094, 1108, 1122, - 1136, 1151, 1165, 1179, 1192, 1206, 1220, 1234, - 1248, 1261, 1275, 1288, 1302, 1315, 1329, 1342, - 1368, 1393, 1419, 1444, 1469, 1494, 1519, 1544, - 1569, 1594, 1618, 1643, 1668, 1692, 1717, 1741, - 1765, 1789, 1814, 1838, 1862, 1885, 1909, 1933, - 1957, 1992, 2027, 2061, 2096, 2130, 2165, 2199, - 2233, 2267, 2300, 2334, 2367, 2400, 2434, 2467, - 2499, 2532, 2575, 2618, 2661, 2704, 2746, 2788, - 2830, 2872, 2913, 2954, 2995, 3036, 3076, 3127, - 3177, 3226, 3275, 3324, 3373, 3421, 3469, 3517, - 3565, 3621, 3677, 3733, 3788, 3843, 3897, 3951, - 4005, 4058, 4119, 4181, 4241, 4301, 4361, 4420, - 4479, 4546, 4612, 4677, 4742, 4807, 4871, 4942, - 5013, 5083, 5153, 5222, 5291, 5367, 5442, 5517, - 5591, 5665, 5745, 5825, 5905, 5984, 6063, 6149, - 6234, 6319, 6404, 6495, 6587, 6678, 6769, 6867, - 6966, 7064, 7163, 7269, 7376, 7483, 7599, 7715, - 7832, 7958, 8085, 8214, 8352, 8492, 8635, 8788, - 8945, 9104, 9275, 9450, 9639, 9832, 10031, 10245, - 10465, 10702, 10946, 11210, 11482, 11776, 12081, 12409, - 12750, 13118, 13501, 13913, 14343, 14807, 15290, 15812, - 16356, 16943, 17575, 18237, 18949, 19718, 20521, 21387, -}; -#endif - -static const int16_t ac_qlookup[QINDEX_RANGE] = { - 4, 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, - 104, 106, 108, 110, 112, 114, 116, 118, - 120, 122, 124, 126, 128, 130, 132, 134, - 136, 138, 140, 142, 144, 146, 148, 150, - 152, 155, 158, 161, 164, 167, 170, 173, - 176, 179, 182, 185, 188, 191, 194, 197, - 200, 203, 207, 211, 215, 219, 223, 227, - 231, 235, 239, 243, 247, 251, 255, 260, - 265, 270, 275, 280, 285, 290, 295, 300, - 305, 311, 317, 323, 329, 335, 341, 347, - 353, 359, 366, 373, 380, 387, 394, 401, - 408, 416, 424, 432, 440, 448, 456, 465, - 474, 483, 492, 501, 510, 520, 530, 540, - 550, 560, 571, 582, 593, 604, 615, 627, - 639, 651, 663, 676, 689, 702, 715, 729, - 743, 757, 771, 786, 801, 816, 832, 848, - 864, 881, 898, 915, 933, 951, 969, 988, - 1007, 1026, 1046, 1066, 1087, 1108, 1129, 1151, - 1173, 1196, 1219, 1243, 1267, 1292, 1317, 1343, - 1369, 1396, 1423, 1451, 1479, 1508, 1537, 1567, - 1597, 1628, 1660, 1692, 1725, 1759, 1793, 1828, -}; - -#if CONFIG_VP9_HIGHBITDEPTH -static const int16_t ac_qlookup_10[QINDEX_RANGE] = { - 4, 9, 11, 13, 16, 18, 21, 24, - 27, 30, 33, 37, 40, 44, 48, 51, - 55, 59, 63, 67, 71, 75, 79, 83, - 88, 92, 96, 100, 105, 109, 114, 118, - 122, 127, 131, 136, 140, 145, 149, 154, - 158, 163, 168, 172, 177, 181, 186, 190, - 195, 199, 204, 208, 213, 217, 222, 226, - 231, 235, 240, 244, 249, 253, 258, 262, - 267, 271, 275, 280, 284, 289, 293, 297, - 302, 306, 311, 315, 319, 324, 328, 332, - 337, 341, 345, 349, 354, 358, 362, 367, - 371, 375, 379, 384, 388, 392, 396, 401, - 409, 417, 425, 433, 441, 449, 458, 466, - 474, 482, 490, 498, 506, 514, 523, 531, - 539, 547, 555, 563, 571, 579, 588, 596, - 604, 616, 628, 640, 652, 664, 676, 688, - 700, 713, 725, 737, 749, 761, 773, 785, - 797, 809, 825, 841, 857, 873, 889, 905, - 922, 938, 954, 970, 986, 1002, 1018, 1038, - 1058, 1078, 1098, 1118, 1138, 1158, 1178, 1198, - 1218, 1242, 1266, 1290, 1314, 1338, 1362, 1386, - 1411, 1435, 1463, 1491, 1519, 1547, 1575, 1603, - 1631, 1663, 1695, 1727, 1759, 1791, 1823, 1859, - 1895, 1931, 1967, 2003, 2039, 2079, 2119, 2159, - 2199, 2239, 2283, 2327, 2371, 2415, 2459, 2507, - 2555, 2603, 2651, 2703, 2755, 2807, 2859, 2915, - 2971, 3027, 3083, 3143, 3203, 3263, 3327, 3391, - 3455, 3523, 3591, 3659, 3731, 3803, 3876, 3952, - 4028, 4104, 4184, 4264, 4348, 4432, 4516, 4604, - 4692, 4784, 4876, 4972, 5068, 5168, 5268, 5372, - 5476, 5584, 5692, 5804, 5916, 6032, 6148, 6268, - 6388, 6512, 6640, 6768, 6900, 7036, 7172, 7312, -}; - -static const int16_t ac_qlookup_12[QINDEX_RANGE] = { - 4, 13, 19, 27, 35, 44, 54, 64, - 75, 87, 99, 112, 126, 139, 154, 168, - 183, 199, 214, 230, 247, 263, 280, 297, - 314, 331, 349, 366, 384, 402, 420, 438, - 456, 475, 493, 511, 530, 548, 567, 586, - 604, 623, 642, 660, 679, 698, 716, 735, - 753, 772, 791, 809, 828, 846, 865, 884, - 902, 920, 939, 957, 976, 994, 1012, 1030, - 1049, 1067, 1085, 1103, 1121, 1139, 1157, 1175, - 1193, 1211, 1229, 1246, 1264, 1282, 1299, 1317, - 1335, 1352, 1370, 1387, 1405, 1422, 1440, 1457, - 1474, 1491, 1509, 1526, 1543, 1560, 1577, 1595, - 1627, 1660, 1693, 1725, 1758, 1791, 1824, 1856, - 1889, 1922, 1954, 1987, 2020, 2052, 2085, 2118, - 2150, 2183, 2216, 2248, 2281, 2313, 2346, 2378, - 2411, 2459, 2508, 2556, 2605, 2653, 2701, 2750, - 2798, 2847, 2895, 2943, 2992, 3040, 3088, 3137, - 3185, 3234, 3298, 3362, 3426, 3491, 3555, 3619, - 3684, 3748, 3812, 3876, 3941, 4005, 4069, 4149, - 4230, 4310, 4390, 4470, 4550, 4631, 4711, 4791, - 4871, 4967, 5064, 5160, 5256, 5352, 5448, 5544, - 5641, 5737, 5849, 5961, 6073, 6185, 6297, 6410, - 6522, 6650, 6778, 6906, 7034, 7162, 7290, 7435, - 7579, 7723, 7867, 8011, 8155, 8315, 8475, 8635, - 8795, 8956, 9132, 9308, 9484, 9660, 9836, 10028, - 10220, 10412, 10604, 10812, 11020, 11228, 11437, 11661, - 11885, 12109, 12333, 12573, 12813, 13053, 13309, 13565, - 13821, 14093, 14365, 14637, 14925, 15213, 15502, 15806, - 16110, 16414, 16734, 17054, 17390, 17726, 18062, 18414, - 18766, 19134, 19502, 19886, 20270, 20670, 21070, 21486, - 21902, 22334, 22766, 23214, 23662, 24126, 24590, 25070, - 25551, 26047, 26559, 27071, 27599, 28143, 28687, 29247, -}; -#endif - -int16_t vp9_dc_quant(int qindex, int delta, vpx_bit_depth_t bit_depth) { -#if CONFIG_VP9_HIGHBITDEPTH - switch (bit_depth) { - case VPX_BITS_8: - return dc_qlookup[clamp(qindex + delta, 0, MAXQ)]; - case VPX_BITS_10: - return dc_qlookup_10[clamp(qindex + delta, 0, MAXQ)]; - case VPX_BITS_12: - return dc_qlookup_12[clamp(qindex + delta, 0, MAXQ)]; - default: - assert(0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10 or VPX_BITS_12"); - return -1; - } -#else - (void) bit_depth; - return dc_qlookup[clamp(qindex + delta, 0, MAXQ)]; -#endif -} - -int16_t vp9_ac_quant(int qindex, int delta, vpx_bit_depth_t bit_depth) { -#if CONFIG_VP9_HIGHBITDEPTH - switch (bit_depth) { - case VPX_BITS_8: - return ac_qlookup[clamp(qindex + delta, 0, MAXQ)]; - case VPX_BITS_10: - return ac_qlookup_10[clamp(qindex + delta, 0, MAXQ)]; - case VPX_BITS_12: - return ac_qlookup_12[clamp(qindex + delta, 0, MAXQ)]; - default: - assert(0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10 or VPX_BITS_12"); - return -1; - } -#else - (void) bit_depth; - return ac_qlookup[clamp(qindex + delta, 0, MAXQ)]; -#endif -} - -int vp9_get_qindex(const struct segmentation *seg, int segment_id, - int base_qindex) { - if (vp9_segfeature_active(seg, segment_id, SEG_LVL_ALT_Q)) { - const int data = vp9_get_segdata(seg, segment_id, SEG_LVL_ALT_Q); - const int seg_qindex = seg->abs_delta == SEGMENT_ABSDATA ? - data : base_qindex + data; - return clamp(seg_qindex, 0, MAXQ); - } else { - return base_qindex; - } -} - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_quant_common.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_quant_common.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_quant_common.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_quant_common.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_QUANT_COMMON_H_ -#define VP9_COMMON_VP9_QUANT_COMMON_H_ - -#include "vpx/vpx_codec.h" -#include "vp9/common/vp9_seg_common.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define MINQ 0 -#define MAXQ 255 -#define QINDEX_RANGE (MAXQ - MINQ + 1) -#define QINDEX_BITS 8 - -int16_t vp9_dc_quant(int qindex, int delta, vpx_bit_depth_t bit_depth); -int16_t vp9_ac_quant(int qindex, int delta, vpx_bit_depth_t bit_depth); - -int vp9_get_qindex(const struct segmentation *seg, int segment_id, - int base_qindex); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_QUANT_COMMON_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_reconinter.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_reconinter.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_reconinter.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_reconinter.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,318 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "./vpx_scale_rtcd.h" -#include "./vpx_config.h" - -#include "vpx/vpx_integer.h" - -#include "vp9/common/vp9_blockd.h" -#include "vp9/common/vp9_filter.h" -#include "vp9/common/vp9_reconinter.h" -#include "vp9/common/vp9_reconintra.h" - -void inter_predictor(const uint8_t *src, int src_stride, - uint8_t *dst, int dst_stride, - const int subpel_x, - const int subpel_y, - const struct scale_factors *sf, - int w, int h, int ref, - const InterpKernel *kernel, - int xs, int ys) { - sf->predict[subpel_x != 0][subpel_y != 0][ref]( - src, src_stride, dst, dst_stride, - kernel[subpel_x], xs, kernel[subpel_y], ys, w, h); -} - -#if CONFIG_VP9_HIGHBITDEPTH -void high_inter_predictor(const uint8_t *src, int src_stride, - uint8_t *dst, int dst_stride, - const int subpel_x, - const int subpel_y, - const struct scale_factors *sf, - int w, int h, int ref, - const InterpKernel *kernel, - int xs, int ys, int bd) { - sf->highbd_predict[subpel_x != 0][subpel_y != 0][ref]( - src, src_stride, dst, dst_stride, - kernel[subpel_x], xs, kernel[subpel_y], ys, w, h, bd); -} - -void vp9_highbd_build_inter_predictor(const uint8_t *src, int src_stride, - uint8_t *dst, int dst_stride, - const MV *src_mv, - const struct scale_factors *sf, - int w, int h, int ref, - const InterpKernel *kernel, - enum mv_precision precision, - int x, int y, int bd) { - const int is_q4 = precision == MV_PRECISION_Q4; - const MV mv_q4 = { is_q4 ? src_mv->row : src_mv->row * 2, - is_q4 ? src_mv->col : src_mv->col * 2 }; - MV32 mv = vp9_scale_mv(&mv_q4, x, y, sf); - const int subpel_x = mv.col & SUBPEL_MASK; - const int subpel_y = mv.row & SUBPEL_MASK; - - src += (mv.row >> SUBPEL_BITS) * src_stride + (mv.col >> SUBPEL_BITS); - - high_inter_predictor(src, src_stride, dst, dst_stride, subpel_x, subpel_y, - sf, w, h, ref, kernel, sf->x_step_q4, sf->y_step_q4, bd); -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -void vp9_build_inter_predictor(const uint8_t *src, int src_stride, - uint8_t *dst, int dst_stride, - const MV *src_mv, - const struct scale_factors *sf, - int w, int h, int ref, - const InterpKernel *kernel, - enum mv_precision precision, - int x, int y) { - const int is_q4 = precision == MV_PRECISION_Q4; - const MV mv_q4 = { is_q4 ? src_mv->row : src_mv->row * 2, - is_q4 ? src_mv->col : src_mv->col * 2 }; - MV32 mv = vp9_scale_mv(&mv_q4, x, y, sf); - const int subpel_x = mv.col & SUBPEL_MASK; - const int subpel_y = mv.row & SUBPEL_MASK; - - src += (mv.row >> SUBPEL_BITS) * src_stride + (mv.col >> SUBPEL_BITS); - - inter_predictor(src, src_stride, dst, dst_stride, subpel_x, subpel_y, - sf, w, h, ref, kernel, sf->x_step_q4, sf->y_step_q4); -} - -static INLINE int round_mv_comp_q4(int value) { - return (value < 0 ? value - 2 : value + 2) / 4; -} - -static MV mi_mv_pred_q4(const MODE_INFO *mi, int idx) { - MV res = { round_mv_comp_q4(mi->bmi[0].as_mv[idx].as_mv.row + - mi->bmi[1].as_mv[idx].as_mv.row + - mi->bmi[2].as_mv[idx].as_mv.row + - mi->bmi[3].as_mv[idx].as_mv.row), - round_mv_comp_q4(mi->bmi[0].as_mv[idx].as_mv.col + - mi->bmi[1].as_mv[idx].as_mv.col + - mi->bmi[2].as_mv[idx].as_mv.col + - mi->bmi[3].as_mv[idx].as_mv.col) }; - return res; -} - -static INLINE int round_mv_comp_q2(int value) { - return (value < 0 ? value - 1 : value + 1) / 2; -} - -static MV mi_mv_pred_q2(const MODE_INFO *mi, int idx, int block0, int block1) { - MV res = { round_mv_comp_q2(mi->bmi[block0].as_mv[idx].as_mv.row + - mi->bmi[block1].as_mv[idx].as_mv.row), - round_mv_comp_q2(mi->bmi[block0].as_mv[idx].as_mv.col + - mi->bmi[block1].as_mv[idx].as_mv.col) }; - return res; -} - -// TODO(jkoleszar): yet another mv clamping function :-( -MV clamp_mv_to_umv_border_sb(const MACROBLOCKD *xd, const MV *src_mv, - int bw, int bh, int ss_x, int ss_y) { - // If the MV points so far into the UMV border that no visible pixels - // are used for reconstruction, the subpel part of the MV can be - // discarded and the MV limited to 16 pixels with equivalent results. - const int spel_left = (VP9_INTERP_EXTEND + bw) << SUBPEL_BITS; - const int spel_right = spel_left - SUBPEL_SHIFTS; - const int spel_top = (VP9_INTERP_EXTEND + bh) << SUBPEL_BITS; - const int spel_bottom = spel_top - SUBPEL_SHIFTS; - MV clamped_mv = { - src_mv->row * (1 << (1 - ss_y)), - src_mv->col * (1 << (1 - ss_x)) - }; - assert(ss_x <= 1); - assert(ss_y <= 1); - - clamp_mv(&clamped_mv, - xd->mb_to_left_edge * (1 << (1 - ss_x)) - spel_left, - xd->mb_to_right_edge * (1 << (1 - ss_x)) + spel_right, - xd->mb_to_top_edge * (1 << (1 - ss_y)) - spel_top, - xd->mb_to_bottom_edge * (1 << (1 - ss_y)) + spel_bottom); - - return clamped_mv; -} - -MV average_split_mvs(const struct macroblockd_plane *pd, - const MODE_INFO *mi, int ref, int block) { - const int ss_idx = ((pd->subsampling_x > 0) << 1) | (pd->subsampling_y > 0); - MV res = {0, 0}; - switch (ss_idx) { - case 0: - res = mi->bmi[block].as_mv[ref].as_mv; - break; - case 1: - res = mi_mv_pred_q2(mi, ref, block, block + 2); - break; - case 2: - res = mi_mv_pred_q2(mi, ref, block, block + 1); - break; - case 3: - res = mi_mv_pred_q4(mi, ref); - break; - default: - assert(ss_idx <= 3 && ss_idx >= 0); - } - return res; -} - -void build_inter_predictors(MACROBLOCKD *xd, int plane, int block, - int bw, int bh, - int x, int y, int w, int h, - int mi_x, int mi_y) { - struct macroblockd_plane *const pd = &xd->plane[plane]; - const MODE_INFO *mi = xd->mi[0].src_mi; - const int is_compound = has_second_ref(&mi->mbmi); - const InterpKernel *kernel = vp9_get_interp_kernel(mi->mbmi.interp_filter); - int ref; - - for (ref = 0; ref < 1 + is_compound; ++ref) { - const struct scale_factors *const sf = &xd->block_refs[ref]->sf; - struct buf_2d *const pre_buf = &pd->pre[ref]; - struct buf_2d *const dst_buf = &pd->dst; - uint8_t *const dst = dst_buf->buf + dst_buf->stride * y + x; - const MV mv = mi->mbmi.sb_type < BLOCK_8X8 - ? average_split_mvs(pd, mi, ref, block) - : mi->mbmi.mv[ref].as_mv; - - // TODO(jkoleszar): This clamping is done in the incorrect place for the - // scaling case. It needs to be done on the scaled MV, not the pre-scaling - // MV. Note however that it performs the subsampling aware scaling so - // that the result is always q4. - // mv_precision precision is MV_PRECISION_Q4. - const MV mv_q4 = clamp_mv_to_umv_border_sb(xd, &mv, bw, bh, - pd->subsampling_x, - pd->subsampling_y); - - uint8_t *pre; - MV32 scaled_mv; - int xs, ys, subpel_x, subpel_y; - const int is_scaled = vp9_is_scaled(sf); - - if (is_scaled) { - pre = pre_buf->buf + scaled_buffer_offset(x, y, pre_buf->stride, sf); - scaled_mv = vp9_scale_mv(&mv_q4, mi_x + x, mi_y + y, sf); - xs = sf->x_step_q4; - ys = sf->y_step_q4; - } else { - pre = pre_buf->buf + (y * pre_buf->stride + x); - scaled_mv.row = mv_q4.row; - scaled_mv.col = mv_q4.col; - xs = ys = 16; - } - subpel_x = scaled_mv.col & SUBPEL_MASK; - subpel_y = scaled_mv.row & SUBPEL_MASK; - pre += (scaled_mv.row >> SUBPEL_BITS) * pre_buf->stride - + (scaled_mv.col >> SUBPEL_BITS); - -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - high_inter_predictor(pre, pre_buf->stride, dst, dst_buf->stride, - subpel_x, subpel_y, sf, w, h, ref, kernel, xs, ys, - xd->bd); - } else { - inter_predictor(pre, pre_buf->stride, dst, dst_buf->stride, - subpel_x, subpel_y, sf, w, h, ref, kernel, xs, ys); - } -#else - inter_predictor(pre, pre_buf->stride, dst, dst_buf->stride, - subpel_x, subpel_y, sf, w, h, ref, kernel, xs, ys); -#endif // CONFIG_VP9_HIGHBITDEPTH - } -} - -static void build_inter_predictors_for_planes(MACROBLOCKD *xd, BLOCK_SIZE bsize, - int mi_row, int mi_col, - int plane_from, int plane_to) { - int plane; - const int mi_x = mi_col * MI_SIZE; - const int mi_y = mi_row * MI_SIZE; - for (plane = plane_from; plane <= plane_to; ++plane) { - const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, - &xd->plane[plane]); - const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize]; - const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize]; - const int bw = 4 * num_4x4_w; - const int bh = 4 * num_4x4_h; - - if (xd->mi[0].src_mi->mbmi.sb_type < BLOCK_8X8) { - int i = 0, x, y; - assert(bsize == BLOCK_8X8); - for (y = 0; y < num_4x4_h; ++y) - for (x = 0; x < num_4x4_w; ++x) - build_inter_predictors(xd, plane, i++, bw, bh, - 4 * x, 4 * y, 4, 4, mi_x, mi_y); - } else { - build_inter_predictors(xd, plane, 0, bw, bh, - 0, 0, bw, bh, mi_x, mi_y); - } - } -} - -void vp9_build_inter_predictors_sby(MACROBLOCKD *xd, int mi_row, int mi_col, - BLOCK_SIZE bsize) { - build_inter_predictors_for_planes(xd, bsize, mi_row, mi_col, 0, 0); -} - -void vp9_build_inter_predictors_sbp(MACROBLOCKD *xd, int mi_row, int mi_col, - BLOCK_SIZE bsize, int plane) { - build_inter_predictors_for_planes(xd, bsize, mi_row, mi_col, plane, plane); -} - -void vp9_build_inter_predictors_sbuv(MACROBLOCKD *xd, int mi_row, int mi_col, - BLOCK_SIZE bsize) { - build_inter_predictors_for_planes(xd, bsize, mi_row, mi_col, 1, - MAX_MB_PLANE - 1); -} - -void vp9_build_inter_predictors_sb(MACROBLOCKD *xd, int mi_row, int mi_col, - BLOCK_SIZE bsize) { - build_inter_predictors_for_planes(xd, bsize, mi_row, mi_col, 0, - MAX_MB_PLANE - 1); -} - -void vp9_setup_dst_planes(struct macroblockd_plane planes[MAX_MB_PLANE], - const YV12_BUFFER_CONFIG *src, - int mi_row, int mi_col) { - uint8_t *const buffers[4] = {src->y_buffer, src->u_buffer, src->v_buffer, - src->alpha_buffer}; - const int strides[4] = {src->y_stride, src->uv_stride, src->uv_stride, - src->alpha_stride}; - int i; - - for (i = 0; i < MAX_MB_PLANE; ++i) { - struct macroblockd_plane *const pd = &planes[i]; - setup_pred_plane(&pd->dst, buffers[i], strides[i], mi_row, mi_col, NULL, - pd->subsampling_x, pd->subsampling_y); - } -} - -void vp9_setup_pre_planes(MACROBLOCKD *xd, int idx, - const YV12_BUFFER_CONFIG *src, - int mi_row, int mi_col, - const struct scale_factors *sf) { - if (src != NULL) { - int i; - uint8_t *const buffers[4] = {src->y_buffer, src->u_buffer, src->v_buffer, - src->alpha_buffer}; - const int strides[4] = {src->y_stride, src->uv_stride, src->uv_stride, - src->alpha_stride}; - - for (i = 0; i < MAX_MB_PLANE; ++i) { - struct macroblockd_plane *const pd = &xd->plane[i]; - setup_pred_plane(&pd->pre[idx], buffers[i], strides[i], mi_row, mi_col, - sf, pd->subsampling_x, pd->subsampling_y); - } - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_reconinter.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_reconinter.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_reconinter.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_reconinter.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,114 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_RECONINTER_H_ -#define VP9_COMMON_VP9_RECONINTER_H_ - -#include "vpx/vpx_integer.h" -#include "vp9/common/vp9_onyxc_int.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void inter_predictor(const uint8_t *src, int src_stride, - uint8_t *dst, int dst_stride, - const int subpel_x, - const int subpel_y, - const struct scale_factors *sf, - int w, int h, int ref, - const InterpKernel *kernel, - int xs, int ys); - -#if CONFIG_VP9_HIGHBITDEPTH -void high_inter_predictor(const uint8_t *src, int src_stride, - uint8_t *dst, int dst_stride, - const int subpel_x, - const int subpel_y, - const struct scale_factors *sf, - int w, int h, int ref, - const InterpKernel *kernel, - int xs, int ys, int bd); -#endif // CONFIG_VP9_HIGHBITDEPTH - -MV average_split_mvs(const struct macroblockd_plane *pd, const MODE_INFO *mi, - int ref, int block); - -MV clamp_mv_to_umv_border_sb(const MACROBLOCKD *xd, const MV *src_mv, - int bw, int bh, int ss_x, int ss_y); - -void build_inter_predictors(MACROBLOCKD *xd, int plane, int block, - int bw, int bh, - int x, int y, int w, int h, - int mi_x, int mi_y); - -void vp9_build_inter_predictors_sby(MACROBLOCKD *xd, int mi_row, int mi_col, - BLOCK_SIZE bsize); - -void vp9_build_inter_predictors_sbp(MACROBLOCKD *xd, int mi_row, int mi_col, - BLOCK_SIZE bsize, int plane); - -void vp9_build_inter_predictors_sbuv(MACROBLOCKD *xd, int mi_row, int mi_col, - BLOCK_SIZE bsize); - -void vp9_build_inter_predictors_sb(MACROBLOCKD *xd, int mi_row, int mi_col, - BLOCK_SIZE bsize); - -void vp9_build_inter_predictor(const uint8_t *src, int src_stride, - uint8_t *dst, int dst_stride, - const MV *mv_q3, - const struct scale_factors *sf, - int w, int h, int do_avg, - const InterpKernel *kernel, - enum mv_precision precision, - int x, int y); - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_highbd_build_inter_predictor(const uint8_t *src, int src_stride, - uint8_t *dst, int dst_stride, - const MV *mv_q3, - const struct scale_factors *sf, - int w, int h, int do_avg, - const InterpKernel *kernel, - enum mv_precision precision, - int x, int y, int bd); -#endif - -static INLINE int scaled_buffer_offset(int x_offset, int y_offset, int stride, - const struct scale_factors *sf) { - const int x = sf ? sf->scale_value_x(x_offset, sf) : x_offset; - const int y = sf ? sf->scale_value_y(y_offset, sf) : y_offset; - return y * stride + x; -} - -static INLINE void setup_pred_plane(struct buf_2d *dst, - uint8_t *src, int stride, - int mi_row, int mi_col, - const struct scale_factors *scale, - int subsampling_x, int subsampling_y) { - const int x = (MI_SIZE * mi_col) >> subsampling_x; - const int y = (MI_SIZE * mi_row) >> subsampling_y; - dst->buf = src + scaled_buffer_offset(x, y, stride, scale); - dst->stride = stride; -} - -void vp9_setup_dst_planes(struct macroblockd_plane planes[MAX_MB_PLANE], - const YV12_BUFFER_CONFIG *src, - int mi_row, int mi_col); - -void vp9_setup_pre_planes(MACROBLOCKD *xd, int idx, - const YV12_BUFFER_CONFIG *src, int mi_row, int mi_col, - const struct scale_factors *sf); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_RECONINTER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_reconintra.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_reconintra.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_reconintra.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_reconintra.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,901 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "./vpx_config.h" -#include "./vp9_rtcd.h" - -#include "vpx_mem/vpx_mem.h" -#include "vpx_ports/vpx_once.h" - -#include "vp9/common/vp9_reconintra.h" -#include "vp9/common/vp9_onyxc_int.h" - -const TX_TYPE intra_mode_to_tx_type_lookup[INTRA_MODES] = { - DCT_DCT, // DC - ADST_DCT, // V - DCT_ADST, // H - DCT_DCT, // D45 - ADST_ADST, // D135 - ADST_DCT, // D117 - DCT_ADST, // D153 - DCT_ADST, // D207 - ADST_DCT, // D63 - ADST_ADST, // TM -}; - -// This serves as a wrapper function, so that all the prediction functions -// can be unified and accessed as a pointer array. Note that the boundary -// above and left are not necessarily used all the time. -#define intra_pred_sized(type, size) \ - void vp9_##type##_predictor_##size##x##size##_c(uint8_t *dst, \ - ptrdiff_t stride, \ - const uint8_t *above, \ - const uint8_t *left) { \ - type##_predictor(dst, stride, size, above, left); \ - } - -#if CONFIG_VP9_HIGHBITDEPTH -#define intra_pred_highbd_sized(type, size) \ - void vp9_highbd_##type##_predictor_##size##x##size##_c( \ - uint16_t *dst, ptrdiff_t stride, const uint16_t *above, \ - const uint16_t *left, int bd) { \ - highbd_##type##_predictor(dst, stride, size, above, left, bd); \ - } - -#define intra_pred_allsizes(type) \ - intra_pred_sized(type, 4) \ - intra_pred_sized(type, 8) \ - intra_pred_sized(type, 16) \ - intra_pred_sized(type, 32) \ - intra_pred_highbd_sized(type, 4) \ - intra_pred_highbd_sized(type, 8) \ - intra_pred_highbd_sized(type, 16) \ - intra_pred_highbd_sized(type, 32) - -#else - -#define intra_pred_allsizes(type) \ - intra_pred_sized(type, 4) \ - intra_pred_sized(type, 8) \ - intra_pred_sized(type, 16) \ - intra_pred_sized(type, 32) -#endif // CONFIG_VP9_HIGHBITDEPTH - -#if CONFIG_VP9_HIGHBITDEPTH -static INLINE void highbd_d207_predictor(uint16_t *dst, ptrdiff_t stride, - int bs, const uint16_t *above, - const uint16_t *left, int bd) { - int r, c; - (void) above; - (void) bd; - - // First column. - for (r = 0; r < bs - 1; ++r) { - dst[r * stride] = ROUND_POWER_OF_TWO(left[r] + left[r + 1], 1); - } - dst[(bs - 1) * stride] = left[bs - 1]; - dst++; - - // Second column. - for (r = 0; r < bs - 2; ++r) { - dst[r * stride] = ROUND_POWER_OF_TWO(left[r] + left[r + 1] * 2 + - left[r + 2], 2); - } - dst[(bs - 2) * stride] = ROUND_POWER_OF_TWO(left[bs - 2] + - left[bs - 1] * 3, 2); - dst[(bs - 1) * stride] = left[bs - 1]; - dst++; - - // Rest of last row. - for (c = 0; c < bs - 2; ++c) - dst[(bs - 1) * stride + c] = left[bs - 1]; - - for (r = bs - 2; r >= 0; --r) { - for (c = 0; c < bs - 2; ++c) - dst[r * stride + c] = dst[(r + 1) * stride + c - 2]; - } -} - -static INLINE void highbd_d63_predictor(uint16_t *dst, ptrdiff_t stride, - int bs, const uint16_t *above, - const uint16_t *left, int bd) { - int r, c; - (void) left; - (void) bd; - for (r = 0; r < bs; ++r) { - for (c = 0; c < bs; ++c) { - dst[c] = r & 1 ? ROUND_POWER_OF_TWO(above[r/2 + c] + - above[r/2 + c + 1] * 2 + - above[r/2 + c + 2], 2) - : ROUND_POWER_OF_TWO(above[r/2 + c] + - above[r/2 + c + 1], 1); - } - dst += stride; - } -} - -static INLINE void highbd_d45_predictor(uint16_t *dst, ptrdiff_t stride, int bs, - const uint16_t *above, - const uint16_t *left, int bd) { - int r, c; - (void) left; - (void) bd; - for (r = 0; r < bs; ++r) { - for (c = 0; c < bs; ++c) { - dst[c] = r + c + 2 < bs * 2 ? ROUND_POWER_OF_TWO(above[r + c] + - above[r + c + 1] * 2 + - above[r + c + 2], 2) - : above[bs * 2 - 1]; - } - dst += stride; - } -} - -static INLINE void highbd_d117_predictor(uint16_t *dst, ptrdiff_t stride, - int bs, const uint16_t *above, - const uint16_t *left, int bd) { - int r, c; - (void) bd; - - // first row - for (c = 0; c < bs; c++) - dst[c] = ROUND_POWER_OF_TWO(above[c - 1] + above[c], 1); - dst += stride; - - // second row - dst[0] = ROUND_POWER_OF_TWO(left[0] + above[-1] * 2 + above[0], 2); - for (c = 1; c < bs; c++) - dst[c] = ROUND_POWER_OF_TWO(above[c - 2] + above[c - 1] * 2 + above[c], 2); - dst += stride; - - // the rest of first col - dst[0] = ROUND_POWER_OF_TWO(above[-1] + left[0] * 2 + left[1], 2); - for (r = 3; r < bs; ++r) - dst[(r - 2) * stride] = ROUND_POWER_OF_TWO(left[r - 3] + left[r - 2] * 2 + - left[r - 1], 2); - - // the rest of the block - for (r = 2; r < bs; ++r) { - for (c = 1; c < bs; c++) - dst[c] = dst[-2 * stride + c - 1]; - dst += stride; - } -} - -static INLINE void highbd_d135_predictor(uint16_t *dst, ptrdiff_t stride, - int bs, const uint16_t *above, - const uint16_t *left, int bd) { - int r, c; - (void) bd; - dst[0] = ROUND_POWER_OF_TWO(left[0] + above[-1] * 2 + above[0], 2); - for (c = 1; c < bs; c++) - dst[c] = ROUND_POWER_OF_TWO(above[c - 2] + above[c - 1] * 2 + above[c], 2); - - dst[stride] = ROUND_POWER_OF_TWO(above[-1] + left[0] * 2 + left[1], 2); - for (r = 2; r < bs; ++r) - dst[r * stride] = ROUND_POWER_OF_TWO(left[r - 2] + left[r - 1] * 2 + - left[r], 2); - - dst += stride; - for (r = 1; r < bs; ++r) { - for (c = 1; c < bs; c++) - dst[c] = dst[-stride + c - 1]; - dst += stride; - } -} - -static INLINE void highbd_d153_predictor(uint16_t *dst, ptrdiff_t stride, - int bs, const uint16_t *above, - const uint16_t *left, int bd) { - int r, c; - (void) bd; - dst[0] = ROUND_POWER_OF_TWO(above[-1] + left[0], 1); - for (r = 1; r < bs; r++) - dst[r * stride] = ROUND_POWER_OF_TWO(left[r - 1] + left[r], 1); - dst++; - - dst[0] = ROUND_POWER_OF_TWO(left[0] + above[-1] * 2 + above[0], 2); - dst[stride] = ROUND_POWER_OF_TWO(above[-1] + left[0] * 2 + left[1], 2); - for (r = 2; r < bs; r++) - dst[r * stride] = ROUND_POWER_OF_TWO(left[r - 2] + left[r - 1] * 2 + - left[r], 2); - dst++; - - for (c = 0; c < bs - 2; c++) - dst[c] = ROUND_POWER_OF_TWO(above[c - 1] + above[c] * 2 + above[c + 1], 2); - dst += stride; - - for (r = 1; r < bs; ++r) { - for (c = 0; c < bs - 2; c++) - dst[c] = dst[-stride + c - 2]; - dst += stride; - } -} - -static INLINE void highbd_v_predictor(uint16_t *dst, ptrdiff_t stride, - int bs, const uint16_t *above, - const uint16_t *left, int bd) { - int r; - (void) left; - (void) bd; - for (r = 0; r < bs; r++) { - vpx_memcpy(dst, above, bs * sizeof(uint16_t)); - dst += stride; - } -} - -static INLINE void highbd_h_predictor(uint16_t *dst, ptrdiff_t stride, - int bs, const uint16_t *above, - const uint16_t *left, int bd) { - int r; - (void) above; - (void) bd; - for (r = 0; r < bs; r++) { - vpx_memset16(dst, left[r], bs); - dst += stride; - } -} - -static INLINE void highbd_tm_predictor(uint16_t *dst, ptrdiff_t stride, - int bs, const uint16_t *above, - const uint16_t *left, int bd) { - int r, c; - int ytop_left = above[-1]; - (void) bd; - - for (r = 0; r < bs; r++) { - for (c = 0; c < bs; c++) - dst[c] = clip_pixel_highbd(left[r] + above[c] - ytop_left, bd); - dst += stride; - } -} - -static INLINE void highbd_dc_128_predictor(uint16_t *dst, ptrdiff_t stride, - int bs, const uint16_t *above, - const uint16_t *left, int bd) { - int r; - (void) above; - (void) left; - - for (r = 0; r < bs; r++) { - vpx_memset16(dst, 128 << (bd - 8), bs); - dst += stride; - } -} - -static INLINE void highbd_dc_left_predictor(uint16_t *dst, ptrdiff_t stride, - int bs, const uint16_t *above, - const uint16_t *left, int bd) { - int i, r, expected_dc, sum = 0; - (void) above; - (void) bd; - - for (i = 0; i < bs; i++) - sum += left[i]; - expected_dc = (sum + (bs >> 1)) / bs; - - for (r = 0; r < bs; r++) { - vpx_memset16(dst, expected_dc, bs); - dst += stride; - } -} - -static INLINE void highbd_dc_top_predictor(uint16_t *dst, ptrdiff_t stride, - int bs, const uint16_t *above, - const uint16_t *left, int bd) { - int i, r, expected_dc, sum = 0; - (void) left; - (void) bd; - - for (i = 0; i < bs; i++) - sum += above[i]; - expected_dc = (sum + (bs >> 1)) / bs; - - for (r = 0; r < bs; r++) { - vpx_memset16(dst, expected_dc, bs); - dst += stride; - } -} - -static INLINE void highbd_dc_predictor(uint16_t *dst, ptrdiff_t stride, - int bs, const uint16_t *above, - const uint16_t *left, int bd) { - int i, r, expected_dc, sum = 0; - const int count = 2 * bs; - (void) bd; - - for (i = 0; i < bs; i++) { - sum += above[i]; - sum += left[i]; - } - - expected_dc = (sum + (count >> 1)) / count; - - for (r = 0; r < bs; r++) { - vpx_memset16(dst, expected_dc, bs); - dst += stride; - } -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -static INLINE void d207_predictor(uint8_t *dst, ptrdiff_t stride, int bs, - const uint8_t *above, const uint8_t *left) { - int r, c; - (void) above; - // first column - for (r = 0; r < bs - 1; ++r) - dst[r * stride] = ROUND_POWER_OF_TWO(left[r] + left[r + 1], 1); - dst[(bs - 1) * stride] = left[bs - 1]; - dst++; - - // second column - for (r = 0; r < bs - 2; ++r) - dst[r * stride] = ROUND_POWER_OF_TWO(left[r] + left[r + 1] * 2 + - left[r + 2], 2); - dst[(bs - 2) * stride] = ROUND_POWER_OF_TWO(left[bs - 2] + - left[bs - 1] * 3, 2); - dst[(bs - 1) * stride] = left[bs - 1]; - dst++; - - // rest of last row - for (c = 0; c < bs - 2; ++c) - dst[(bs - 1) * stride + c] = left[bs - 1]; - - for (r = bs - 2; r >= 0; --r) - for (c = 0; c < bs - 2; ++c) - dst[r * stride + c] = dst[(r + 1) * stride + c - 2]; -} -intra_pred_allsizes(d207) - -static INLINE void d63_predictor(uint8_t *dst, ptrdiff_t stride, int bs, - const uint8_t *above, const uint8_t *left) { - int r, c; - (void) left; - for (r = 0; r < bs; ++r) { - for (c = 0; c < bs; ++c) - dst[c] = r & 1 ? ROUND_POWER_OF_TWO(above[r/2 + c] + - above[r/2 + c + 1] * 2 + - above[r/2 + c + 2], 2) - : ROUND_POWER_OF_TWO(above[r/2 + c] + - above[r/2 + c + 1], 1); - dst += stride; - } -} -intra_pred_allsizes(d63) - -static INLINE void d45_predictor(uint8_t *dst, ptrdiff_t stride, int bs, - const uint8_t *above, const uint8_t *left) { - int r, c; - (void) left; - for (r = 0; r < bs; ++r) { - for (c = 0; c < bs; ++c) - dst[c] = r + c + 2 < bs * 2 ? ROUND_POWER_OF_TWO(above[r + c] + - above[r + c + 1] * 2 + - above[r + c + 2], 2) - : above[bs * 2 - 1]; - dst += stride; - } -} -intra_pred_allsizes(d45) - -static INLINE void d117_predictor(uint8_t *dst, ptrdiff_t stride, int bs, - const uint8_t *above, const uint8_t *left) { - int r, c; - - // first row - for (c = 0; c < bs; c++) - dst[c] = ROUND_POWER_OF_TWO(above[c - 1] + above[c], 1); - dst += stride; - - // second row - dst[0] = ROUND_POWER_OF_TWO(left[0] + above[-1] * 2 + above[0], 2); - for (c = 1; c < bs; c++) - dst[c] = ROUND_POWER_OF_TWO(above[c - 2] + above[c - 1] * 2 + above[c], 2); - dst += stride; - - // the rest of first col - dst[0] = ROUND_POWER_OF_TWO(above[-1] + left[0] * 2 + left[1], 2); - for (r = 3; r < bs; ++r) - dst[(r - 2) * stride] = ROUND_POWER_OF_TWO(left[r - 3] + left[r - 2] * 2 + - left[r - 1], 2); - - // the rest of the block - for (r = 2; r < bs; ++r) { - for (c = 1; c < bs; c++) - dst[c] = dst[-2 * stride + c - 1]; - dst += stride; - } -} -intra_pred_allsizes(d117) - -static INLINE void d135_predictor(uint8_t *dst, ptrdiff_t stride, int bs, - const uint8_t *above, const uint8_t *left) { - int r, c; - dst[0] = ROUND_POWER_OF_TWO(left[0] + above[-1] * 2 + above[0], 2); - for (c = 1; c < bs; c++) - dst[c] = ROUND_POWER_OF_TWO(above[c - 2] + above[c - 1] * 2 + above[c], 2); - - dst[stride] = ROUND_POWER_OF_TWO(above[-1] + left[0] * 2 + left[1], 2); - for (r = 2; r < bs; ++r) - dst[r * stride] = ROUND_POWER_OF_TWO(left[r - 2] + left[r - 1] * 2 + - left[r], 2); - - dst += stride; - for (r = 1; r < bs; ++r) { - for (c = 1; c < bs; c++) - dst[c] = dst[-stride + c - 1]; - dst += stride; - } -} -intra_pred_allsizes(d135) - -static INLINE void d153_predictor(uint8_t *dst, ptrdiff_t stride, int bs, - const uint8_t *above, const uint8_t *left) { - int r, c; - dst[0] = ROUND_POWER_OF_TWO(above[-1] + left[0], 1); - for (r = 1; r < bs; r++) - dst[r * stride] = ROUND_POWER_OF_TWO(left[r - 1] + left[r], 1); - dst++; - - dst[0] = ROUND_POWER_OF_TWO(left[0] + above[-1] * 2 + above[0], 2); - dst[stride] = ROUND_POWER_OF_TWO(above[-1] + left[0] * 2 + left[1], 2); - for (r = 2; r < bs; r++) - dst[r * stride] = ROUND_POWER_OF_TWO(left[r - 2] + left[r - 1] * 2 + - left[r], 2); - dst++; - - for (c = 0; c < bs - 2; c++) - dst[c] = ROUND_POWER_OF_TWO(above[c - 1] + above[c] * 2 + above[c + 1], 2); - dst += stride; - - for (r = 1; r < bs; ++r) { - for (c = 0; c < bs - 2; c++) - dst[c] = dst[-stride + c - 2]; - dst += stride; - } -} -intra_pred_allsizes(d153) - -static INLINE void v_predictor(uint8_t *dst, ptrdiff_t stride, int bs, - const uint8_t *above, const uint8_t *left) { - int r; - (void) left; - - for (r = 0; r < bs; r++) { - vpx_memcpy(dst, above, bs); - dst += stride; - } -} -intra_pred_allsizes(v) - -static INLINE void h_predictor(uint8_t *dst, ptrdiff_t stride, int bs, - const uint8_t *above, const uint8_t *left) { - int r; - (void) above; - - for (r = 0; r < bs; r++) { - vpx_memset(dst, left[r], bs); - dst += stride; - } -} -intra_pred_allsizes(h) - -static INLINE void tm_predictor(uint8_t *dst, ptrdiff_t stride, int bs, - const uint8_t *above, const uint8_t *left) { - int r, c; - int ytop_left = above[-1]; - - for (r = 0; r < bs; r++) { - for (c = 0; c < bs; c++) - dst[c] = clip_pixel(left[r] + above[c] - ytop_left); - dst += stride; - } -} -intra_pred_allsizes(tm) - -static INLINE void dc_128_predictor(uint8_t *dst, ptrdiff_t stride, int bs, - const uint8_t *above, const uint8_t *left) { - int r; - (void) above; - (void) left; - - for (r = 0; r < bs; r++) { - vpx_memset(dst, 128, bs); - dst += stride; - } -} -intra_pred_allsizes(dc_128) - -static INLINE void dc_left_predictor(uint8_t *dst, ptrdiff_t stride, int bs, - const uint8_t *above, - const uint8_t *left) { - int i, r, expected_dc, sum = 0; - (void) above; - - for (i = 0; i < bs; i++) - sum += left[i]; - expected_dc = (sum + (bs >> 1)) / bs; - - for (r = 0; r < bs; r++) { - vpx_memset(dst, expected_dc, bs); - dst += stride; - } -} -intra_pred_allsizes(dc_left) - -static INLINE void dc_top_predictor(uint8_t *dst, ptrdiff_t stride, int bs, - const uint8_t *above, const uint8_t *left) { - int i, r, expected_dc, sum = 0; - (void) left; - - for (i = 0; i < bs; i++) - sum += above[i]; - expected_dc = (sum + (bs >> 1)) / bs; - - for (r = 0; r < bs; r++) { - vpx_memset(dst, expected_dc, bs); - dst += stride; - } -} -intra_pred_allsizes(dc_top) - -static INLINE void dc_predictor(uint8_t *dst, ptrdiff_t stride, int bs, - const uint8_t *above, const uint8_t *left) { - int i, r, expected_dc, sum = 0; - const int count = 2 * bs; - - for (i = 0; i < bs; i++) { - sum += above[i]; - sum += left[i]; - } - - expected_dc = (sum + (count >> 1)) / count; - - for (r = 0; r < bs; r++) { - vpx_memset(dst, expected_dc, bs); - dst += stride; - } -} -intra_pred_allsizes(dc) -#undef intra_pred_allsizes - -typedef void (*intra_pred_fn)(uint8_t *dst, ptrdiff_t stride, - const uint8_t *above, const uint8_t *left); - -static intra_pred_fn pred[INTRA_MODES][TX_SIZES]; -static intra_pred_fn dc_pred[2][2][TX_SIZES]; - -#if CONFIG_VP9_HIGHBITDEPTH -typedef void (*intra_high_pred_fn)(uint16_t *dst, ptrdiff_t stride, - const uint16_t *above, const uint16_t *left, - int bd); -static intra_high_pred_fn pred_high[INTRA_MODES][4]; -static intra_high_pred_fn dc_pred_high[2][2][4]; -#endif // CONFIG_VP9_HIGHBITDEPTH - -static void vp9_init_intra_predictors_internal(void) { -#define INIT_ALL_SIZES(p, type) \ - p[TX_4X4] = vp9_##type##_predictor_4x4; \ - p[TX_8X8] = vp9_##type##_predictor_8x8; \ - p[TX_16X16] = vp9_##type##_predictor_16x16; \ - p[TX_32X32] = vp9_##type##_predictor_32x32 - - INIT_ALL_SIZES(pred[V_PRED], v); - INIT_ALL_SIZES(pred[H_PRED], h); - INIT_ALL_SIZES(pred[D207_PRED], d207); - INIT_ALL_SIZES(pred[D45_PRED], d45); - INIT_ALL_SIZES(pred[D63_PRED], d63); - INIT_ALL_SIZES(pred[D117_PRED], d117); - INIT_ALL_SIZES(pred[D135_PRED], d135); - INIT_ALL_SIZES(pred[D153_PRED], d153); - INIT_ALL_SIZES(pred[TM_PRED], tm); - - INIT_ALL_SIZES(dc_pred[0][0], dc_128); - INIT_ALL_SIZES(dc_pred[0][1], dc_top); - INIT_ALL_SIZES(dc_pred[1][0], dc_left); - INIT_ALL_SIZES(dc_pred[1][1], dc); - -#if CONFIG_VP9_HIGHBITDEPTH - INIT_ALL_SIZES(pred_high[V_PRED], highbd_v); - INIT_ALL_SIZES(pred_high[H_PRED], highbd_h); - INIT_ALL_SIZES(pred_high[D207_PRED], highbd_d207); - INIT_ALL_SIZES(pred_high[D45_PRED], highbd_d45); - INIT_ALL_SIZES(pred_high[D63_PRED], highbd_d63); - INIT_ALL_SIZES(pred_high[D117_PRED], highbd_d117); - INIT_ALL_SIZES(pred_high[D135_PRED], highbd_d135); - INIT_ALL_SIZES(pred_high[D153_PRED], highbd_d153); - INIT_ALL_SIZES(pred_high[TM_PRED], highbd_tm); - - INIT_ALL_SIZES(dc_pred_high[0][0], highbd_dc_128); - INIT_ALL_SIZES(dc_pred_high[0][1], highbd_dc_top); - INIT_ALL_SIZES(dc_pred_high[1][0], highbd_dc_left); - INIT_ALL_SIZES(dc_pred_high[1][1], highbd_dc); -#endif // CONFIG_VP9_HIGHBITDEPTH - -#undef intra_pred_allsizes -} - -#if CONFIG_VP9_HIGHBITDEPTH -static void build_intra_predictors_high(const MACROBLOCKD *xd, - const uint8_t *ref8, - int ref_stride, - uint8_t *dst8, - int dst_stride, - PREDICTION_MODE mode, - TX_SIZE tx_size, - int up_available, - int left_available, - int right_available, - int x, int y, - int plane, int bd) { - int i; - uint16_t *dst = CONVERT_TO_SHORTPTR(dst8); - uint16_t *ref = CONVERT_TO_SHORTPTR(ref8); - DECLARE_ALIGNED_ARRAY(16, uint16_t, left_col, 64); - DECLARE_ALIGNED_ARRAY(16, uint16_t, above_data, 128 + 16); - uint16_t *above_row = above_data + 16; - const uint16_t *const_above_row = above_row; - const int bs = 4 << tx_size; - int frame_width, frame_height; - int x0, y0; - const struct macroblockd_plane *const pd = &xd->plane[plane]; - // int base=128; - int base = 128 << (bd - 8); - // 127 127 127 .. 127 127 127 127 127 127 - // 129 A B .. Y Z - // 129 C D .. W X - // 129 E F .. U V - // 129 G H .. S T T T T T - - // Get current frame pointer, width and height. - if (plane == 0) { - frame_width = xd->cur_buf->y_width; - frame_height = xd->cur_buf->y_height; - } else { - frame_width = xd->cur_buf->uv_width; - frame_height = xd->cur_buf->uv_height; - } - - // Get block position in current frame. - x0 = (-xd->mb_to_left_edge >> (3 + pd->subsampling_x)) + x; - y0 = (-xd->mb_to_top_edge >> (3 + pd->subsampling_y)) + y; - - // left - if (left_available) { - if (xd->mb_to_bottom_edge < 0) { - /* slower path if the block needs border extension */ - if (y0 + bs <= frame_height) { - for (i = 0; i < bs; ++i) - left_col[i] = ref[i * ref_stride - 1]; - } else { - const int extend_bottom = frame_height - y0; - for (i = 0; i < extend_bottom; ++i) - left_col[i] = ref[i * ref_stride - 1]; - for (; i < bs; ++i) - left_col[i] = ref[(extend_bottom - 1) * ref_stride - 1]; - } - } else { - /* faster path if the block does not need extension */ - for (i = 0; i < bs; ++i) - left_col[i] = ref[i * ref_stride - 1]; - } - } else { - // TODO(Peter): this value should probably change for high bitdepth - vpx_memset16(left_col, base + 1, bs); - } - - // TODO(hkuang) do not extend 2*bs pixels for all modes. - // above - if (up_available) { - const uint16_t *above_ref = ref - ref_stride; - if (xd->mb_to_right_edge < 0) { - /* slower path if the block needs border extension */ - if (x0 + 2 * bs <= frame_width) { - if (right_available && bs == 4) { - vpx_memcpy(above_row, above_ref, 2 * bs * sizeof(uint16_t)); - } else { - vpx_memcpy(above_row, above_ref, bs * sizeof(uint16_t)); - vpx_memset16(above_row + bs, above_row[bs - 1], bs); - } - } else if (x0 + bs <= frame_width) { - const int r = frame_width - x0; - if (right_available && bs == 4) { - vpx_memcpy(above_row, above_ref, r * sizeof(uint16_t)); - vpx_memset16(above_row + r, above_row[r - 1], - x0 + 2 * bs - frame_width); - } else { - vpx_memcpy(above_row, above_ref, bs * sizeof(uint16_t)); - vpx_memset16(above_row + bs, above_row[bs - 1], bs); - } - } else if (x0 <= frame_width) { - const int r = frame_width - x0; - vpx_memcpy(above_row, above_ref, r * sizeof(uint16_t)); - vpx_memset16(above_row + r, above_row[r - 1], - x0 + 2 * bs - frame_width); - } - // TODO(Peter) this value should probably change for high bitdepth - above_row[-1] = left_available ? above_ref[-1] : (base+1); - } else { - /* faster path if the block does not need extension */ - if (bs == 4 && right_available && left_available) { - const_above_row = above_ref; - } else { - vpx_memcpy(above_row, above_ref, bs * sizeof(uint16_t)); - if (bs == 4 && right_available) - vpx_memcpy(above_row + bs, above_ref + bs, bs * sizeof(uint16_t)); - else - vpx_memset16(above_row + bs, above_row[bs - 1], bs); - // TODO(Peter): this value should probably change for high bitdepth - above_row[-1] = left_available ? above_ref[-1] : (base+1); - } - } - } else { - vpx_memset16(above_row, base - 1, bs * 2); - // TODO(Peter): this value should probably change for high bitdepth - above_row[-1] = base - 1; - } - - // predict - if (mode == DC_PRED) { - dc_pred_high[left_available][up_available][tx_size](dst, dst_stride, - const_above_row, - left_col, xd->bd); - } else { - pred_high[mode][tx_size](dst, dst_stride, const_above_row, left_col, - xd->bd); - } -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -static void build_intra_predictors(const MACROBLOCKD *xd, const uint8_t *ref, - int ref_stride, uint8_t *dst, int dst_stride, - PREDICTION_MODE mode, TX_SIZE tx_size, - int up_available, int left_available, - int right_available, int x, int y, - int plane) { - int i; - DECLARE_ALIGNED_ARRAY(16, uint8_t, left_col, 64); - DECLARE_ALIGNED_ARRAY(16, uint8_t, above_data, 128 + 16); - uint8_t *above_row = above_data + 16; - const uint8_t *const_above_row = above_row; - const int bs = 4 << tx_size; - int frame_width, frame_height; - int x0, y0; - const struct macroblockd_plane *const pd = &xd->plane[plane]; - - // 127 127 127 .. 127 127 127 127 127 127 - // 129 A B .. Y Z - // 129 C D .. W X - // 129 E F .. U V - // 129 G H .. S T T T T T - // .. - - // Get current frame pointer, width and height. - if (plane == 0) { - frame_width = xd->cur_buf->y_width; - frame_height = xd->cur_buf->y_height; - } else { - frame_width = xd->cur_buf->uv_width; - frame_height = xd->cur_buf->uv_height; - } - - // Get block position in current frame. - x0 = (-xd->mb_to_left_edge >> (3 + pd->subsampling_x)) + x; - y0 = (-xd->mb_to_top_edge >> (3 + pd->subsampling_y)) + y; - - vpx_memset(left_col, 129, 64); - - // left - if (left_available) { - if (xd->mb_to_bottom_edge < 0) { - /* slower path if the block needs border extension */ - if (y0 + bs <= frame_height) { - for (i = 0; i < bs; ++i) - left_col[i] = ref[i * ref_stride - 1]; - } else { - const int extend_bottom = frame_height - y0; - for (i = 0; i < extend_bottom; ++i) - left_col[i] = ref[i * ref_stride - 1]; - for (; i < bs; ++i) - left_col[i] = ref[(extend_bottom - 1) * ref_stride - 1]; - } - } else { - /* faster path if the block does not need extension */ - for (i = 0; i < bs; ++i) - left_col[i] = ref[i * ref_stride - 1]; - } - } - - // TODO(hkuang) do not extend 2*bs pixels for all modes. - // above - if (up_available) { - const uint8_t *above_ref = ref - ref_stride; - if (xd->mb_to_right_edge < 0) { - /* slower path if the block needs border extension */ - if (x0 + 2 * bs <= frame_width) { - if (right_available && bs == 4) { - vpx_memcpy(above_row, above_ref, 2 * bs); - } else { - vpx_memcpy(above_row, above_ref, bs); - vpx_memset(above_row + bs, above_row[bs - 1], bs); - } - } else if (x0 + bs <= frame_width) { - const int r = frame_width - x0; - if (right_available && bs == 4) { - vpx_memcpy(above_row, above_ref, r); - vpx_memset(above_row + r, above_row[r - 1], - x0 + 2 * bs - frame_width); - } else { - vpx_memcpy(above_row, above_ref, bs); - vpx_memset(above_row + bs, above_row[bs - 1], bs); - } - } else if (x0 <= frame_width) { - const int r = frame_width - x0; - vpx_memcpy(above_row, above_ref, r); - vpx_memset(above_row + r, above_row[r - 1], - x0 + 2 * bs - frame_width); - } - above_row[-1] = left_available ? above_ref[-1] : 129; - } else { - /* faster path if the block does not need extension */ - if (bs == 4 && right_available && left_available) { - const_above_row = above_ref; - } else { - vpx_memcpy(above_row, above_ref, bs); - if (bs == 4 && right_available) - vpx_memcpy(above_row + bs, above_ref + bs, bs); - else - vpx_memset(above_row + bs, above_row[bs - 1], bs); - above_row[-1] = left_available ? above_ref[-1] : 129; - } - } - } else { - vpx_memset(above_row, 127, bs * 2); - above_row[-1] = 127; - } - - // predict - if (mode == DC_PRED) { - dc_pred[left_available][up_available][tx_size](dst, dst_stride, - const_above_row, left_col); - } else { - pred[mode][tx_size](dst, dst_stride, const_above_row, left_col); - } -} - -void vp9_predict_intra_block(const MACROBLOCKD *xd, int block_idx, int bwl_in, - TX_SIZE tx_size, PREDICTION_MODE mode, - const uint8_t *ref, int ref_stride, - uint8_t *dst, int dst_stride, - int aoff, int loff, int plane) { - const int bwl = bwl_in - tx_size; - const int wmask = (1 << bwl) - 1; - const int have_top = (block_idx >> bwl) || xd->up_available; - const int have_left = (block_idx & wmask) || xd->left_available; - const int have_right = ((block_idx & wmask) != wmask); - const int x = aoff * 4; - const int y = loff * 4; - - assert(bwl >= 0); -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - build_intra_predictors_high(xd, ref, ref_stride, dst, dst_stride, mode, - tx_size, have_top, have_left, have_right, - x, y, plane, xd->bd); - return; - } -#endif - build_intra_predictors(xd, ref, ref_stride, dst, dst_stride, mode, tx_size, - have_top, have_left, have_right, x, y, plane); -} - -void vp9_init_intra_predictors() { - once(vp9_init_intra_predictors_internal); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_reconintra.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_reconintra.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_reconintra.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_reconintra.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_RECONINTRA_H_ -#define VP9_COMMON_VP9_RECONINTRA_H_ - -#include "vpx/vpx_integer.h" -#include "vp9/common/vp9_blockd.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void vp9_init_intra_predictors(); - -void vp9_predict_intra_block(const MACROBLOCKD *xd, int block_idx, int bwl_in, - TX_SIZE tx_size, PREDICTION_MODE mode, - const uint8_t *ref, int ref_stride, - uint8_t *dst, int dst_stride, - int aoff, int loff, int plane); -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_RECONINTRA_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_rtcd.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_rtcd.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_rtcd.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_rtcd.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2011 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#include "./vpx_config.h" -#define RTCD_C -#include "./vp9_rtcd.h" -#include "vpx_ports/vpx_once.h" - -void vpx_scale_rtcd(void); - -void vp9_rtcd() { - vpx_scale_rtcd(); - // TODO(JBB): Remove this once, by insuring that both the encoder and - // decoder setup functions are protected by once(); - once(setup_rtcd_internal); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_scale.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_scale.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_scale.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_scale.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,165 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_filter.h" -#include "vp9/common/vp9_scale.h" - -static INLINE int scaled_x(int val, const struct scale_factors *sf) { - return (int)((int64_t)val * sf->x_scale_fp >> REF_SCALE_SHIFT); -} - -static INLINE int scaled_y(int val, const struct scale_factors *sf) { - return (int)((int64_t)val * sf->y_scale_fp >> REF_SCALE_SHIFT); -} - -static int unscaled_value(int val, const struct scale_factors *sf) { - (void) sf; - return val; -} - -static int get_fixed_point_scale_factor(int other_size, int this_size) { - // Calculate scaling factor once for each reference frame - // and use fixed point scaling factors in decoding and encoding routines. - // Hardware implementations can calculate scale factor in device driver - // and use multiplication and shifting on hardware instead of division. - return (other_size << REF_SCALE_SHIFT) / this_size; -} - -MV32 vp9_scale_mv(const MV *mv, int x, int y, const struct scale_factors *sf) { - const int x_off_q4 = scaled_x(x << SUBPEL_BITS, sf) & SUBPEL_MASK; - const int y_off_q4 = scaled_y(y << SUBPEL_BITS, sf) & SUBPEL_MASK; - const MV32 res = { - scaled_y(mv->row, sf) + y_off_q4, - scaled_x(mv->col, sf) + x_off_q4 - }; - return res; -} - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_setup_scale_factors_for_frame(struct scale_factors *sf, - int other_w, int other_h, - int this_w, int this_h, - int use_highbd) { -#else -void vp9_setup_scale_factors_for_frame(struct scale_factors *sf, - int other_w, int other_h, - int this_w, int this_h) { -#endif - if (!valid_ref_frame_size(other_w, other_h, this_w, this_h)) { - sf->x_scale_fp = REF_INVALID_SCALE; - sf->y_scale_fp = REF_INVALID_SCALE; - return; - } - - sf->x_scale_fp = get_fixed_point_scale_factor(other_w, this_w); - sf->y_scale_fp = get_fixed_point_scale_factor(other_h, this_h); - sf->x_step_q4 = scaled_x(16, sf); - sf->y_step_q4 = scaled_y(16, sf); - - if (vp9_is_scaled(sf)) { - sf->scale_value_x = scaled_x; - sf->scale_value_y = scaled_y; - } else { - sf->scale_value_x = unscaled_value; - sf->scale_value_y = unscaled_value; - } - - // TODO(agrange): Investigate the best choice of functions to use here - // for EIGHTTAP_SMOOTH. Since it is not interpolating, need to choose what - // to do at full-pel offsets. The current selection, where the filter is - // applied in one direction only, and not at all for 0,0, seems to give the - // best quality, but it may be worth trying an additional mode that does - // do the filtering on full-pel. - if (sf->x_step_q4 == 16) { - if (sf->y_step_q4 == 16) { - // No scaling in either direction. - sf->predict[0][0][0] = vp9_convolve_copy; - sf->predict[0][0][1] = vp9_convolve_avg; - sf->predict[0][1][0] = vp9_convolve8_vert; - sf->predict[0][1][1] = vp9_convolve8_avg_vert; - sf->predict[1][0][0] = vp9_convolve8_horiz; - sf->predict[1][0][1] = vp9_convolve8_avg_horiz; - } else { - // No scaling in x direction. Must always scale in the y direction. - sf->predict[0][0][0] = vp9_convolve8_vert; - sf->predict[0][0][1] = vp9_convolve8_avg_vert; - sf->predict[0][1][0] = vp9_convolve8_vert; - sf->predict[0][1][1] = vp9_convolve8_avg_vert; - sf->predict[1][0][0] = vp9_convolve8; - sf->predict[1][0][1] = vp9_convolve8_avg; - } - } else { - if (sf->y_step_q4 == 16) { - // No scaling in the y direction. Must always scale in the x direction. - sf->predict[0][0][0] = vp9_convolve8_horiz; - sf->predict[0][0][1] = vp9_convolve8_avg_horiz; - sf->predict[0][1][0] = vp9_convolve8; - sf->predict[0][1][1] = vp9_convolve8_avg; - sf->predict[1][0][0] = vp9_convolve8_horiz; - sf->predict[1][0][1] = vp9_convolve8_avg_horiz; - } else { - // Must always scale in both directions. - sf->predict[0][0][0] = vp9_convolve8; - sf->predict[0][0][1] = vp9_convolve8_avg; - sf->predict[0][1][0] = vp9_convolve8; - sf->predict[0][1][1] = vp9_convolve8_avg; - sf->predict[1][0][0] = vp9_convolve8; - sf->predict[1][0][1] = vp9_convolve8_avg; - } - } - // 2D subpel motion always gets filtered in both directions - sf->predict[1][1][0] = vp9_convolve8; - sf->predict[1][1][1] = vp9_convolve8_avg; -#if CONFIG_VP9_HIGHBITDEPTH - if (use_highbd) { - if (sf->x_step_q4 == 16) { - if (sf->y_step_q4 == 16) { - // No scaling in either direction. - sf->highbd_predict[0][0][0] = vp9_highbd_convolve_copy; - sf->highbd_predict[0][0][1] = vp9_highbd_convolve_avg; - sf->highbd_predict[0][1][0] = vp9_highbd_convolve8_vert; - sf->highbd_predict[0][1][1] = vp9_highbd_convolve8_avg_vert; - sf->highbd_predict[1][0][0] = vp9_highbd_convolve8_horiz; - sf->highbd_predict[1][0][1] = vp9_highbd_convolve8_avg_horiz; - } else { - // No scaling in x direction. Must always scale in the y direction. - sf->highbd_predict[0][0][0] = vp9_highbd_convolve8_vert; - sf->highbd_predict[0][0][1] = vp9_highbd_convolve8_avg_vert; - sf->highbd_predict[0][1][0] = vp9_highbd_convolve8_vert; - sf->highbd_predict[0][1][1] = vp9_highbd_convolve8_avg_vert; - sf->highbd_predict[1][0][0] = vp9_highbd_convolve8; - sf->highbd_predict[1][0][1] = vp9_highbd_convolve8_avg; - } - } else { - if (sf->y_step_q4 == 16) { - // No scaling in the y direction. Must always scale in the x direction. - sf->highbd_predict[0][0][0] = vp9_highbd_convolve8_horiz; - sf->highbd_predict[0][0][1] = vp9_highbd_convolve8_avg_horiz; - sf->highbd_predict[0][1][0] = vp9_highbd_convolve8; - sf->highbd_predict[0][1][1] = vp9_highbd_convolve8_avg; - sf->highbd_predict[1][0][0] = vp9_highbd_convolve8_horiz; - sf->highbd_predict[1][0][1] = vp9_highbd_convolve8_avg_horiz; - } else { - // Must always scale in both directions. - sf->highbd_predict[0][0][0] = vp9_highbd_convolve8; - sf->highbd_predict[0][0][1] = vp9_highbd_convolve8_avg; - sf->highbd_predict[0][1][0] = vp9_highbd_convolve8; - sf->highbd_predict[0][1][1] = vp9_highbd_convolve8_avg; - sf->highbd_predict[1][0][0] = vp9_highbd_convolve8; - sf->highbd_predict[1][0][1] = vp9_highbd_convolve8_avg; - } - } - // 2D subpel motion always gets filtered in both directions. - sf->highbd_predict[1][1][0] = vp9_highbd_convolve8; - sf->highbd_predict[1][1][1] = vp9_highbd_convolve8_avg; - } -#endif -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_scale.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_scale.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_scale.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_scale.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_SCALE_H_ -#define VP9_COMMON_VP9_SCALE_H_ - -#include "vp9/common/vp9_mv.h" -#include "vp9/common/vp9_convolve.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define REF_SCALE_SHIFT 14 -#define REF_NO_SCALE (1 << REF_SCALE_SHIFT) -#define REF_INVALID_SCALE -1 - -struct scale_factors { - int x_scale_fp; // horizontal fixed point scale factor - int y_scale_fp; // vertical fixed point scale factor - int x_step_q4; - int y_step_q4; - - int (*scale_value_x)(int val, const struct scale_factors *sf); - int (*scale_value_y)(int val, const struct scale_factors *sf); - - convolve_fn_t predict[2][2][2]; // horiz, vert, avg -#if CONFIG_VP9_HIGHBITDEPTH - highbd_convolve_fn_t highbd_predict[2][2][2]; // horiz, vert, avg -#endif -}; - -MV32 vp9_scale_mv(const MV *mv, int x, int y, const struct scale_factors *sf); - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_setup_scale_factors_for_frame(struct scale_factors *sf, - int other_w, int other_h, - int this_w, int this_h, - int use_high); -#else -void vp9_setup_scale_factors_for_frame(struct scale_factors *sf, - int other_w, int other_h, - int this_w, int this_h); -#endif - -static INLINE int vp9_is_valid_scale(const struct scale_factors *sf) { - return sf->x_scale_fp != REF_INVALID_SCALE && - sf->y_scale_fp != REF_INVALID_SCALE; -} - -static INLINE int vp9_is_scaled(const struct scale_factors *sf) { - return vp9_is_valid_scale(sf) && - (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE); -} - -static INLINE int valid_ref_frame_size(int ref_width, int ref_height, - int this_width, int this_height) { - return 2 * this_width >= ref_width && - 2 * this_height >= ref_height && - this_width <= 16 * ref_width && - this_height <= 16 * ref_height; -} - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_SCALE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_scan.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_scan.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_scan.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_scan.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,727 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "vp9/common/vp9_scan.h" - -DECLARE_ALIGNED(16, static const int16_t, default_scan_4x4[16]) = { - 0, 4, 1, 5, - 8, 2, 12, 9, - 3, 6, 13, 10, - 7, 14, 11, 15, -}; - -DECLARE_ALIGNED(16, static const int16_t, col_scan_4x4[16]) = { - 0, 4, 8, 1, - 12, 5, 9, 2, - 13, 6, 10, 3, - 7, 14, 11, 15, -}; - -DECLARE_ALIGNED(16, static const int16_t, row_scan_4x4[16]) = { - 0, 1, 4, 2, - 5, 3, 6, 8, - 9, 7, 12, 10, - 13, 11, 14, 15, -}; - -DECLARE_ALIGNED(16, static const int16_t, default_scan_8x8[64]) = { - 0, 8, 1, 16, 9, 2, 17, 24, - 10, 3, 18, 25, 32, 11, 4, 26, - 33, 19, 40, 12, 34, 27, 5, 41, - 20, 48, 13, 35, 42, 28, 21, 6, - 49, 56, 36, 43, 29, 7, 14, 50, - 57, 44, 22, 37, 15, 51, 58, 30, - 45, 23, 52, 59, 38, 31, 60, 53, - 46, 39, 61, 54, 47, 62, 55, 63, -}; - -DECLARE_ALIGNED(16, static const int16_t, col_scan_8x8[64]) = { - 0, 8, 16, 1, 24, 9, 32, 17, - 2, 40, 25, 10, 33, 18, 48, 3, - 26, 41, 11, 56, 19, 34, 4, 49, - 27, 42, 12, 35, 20, 57, 50, 28, - 5, 43, 13, 36, 58, 51, 21, 44, - 6, 29, 59, 37, 14, 52, 22, 7, - 45, 60, 30, 15, 38, 53, 23, 46, - 31, 61, 39, 54, 47, 62, 55, 63, -}; - -DECLARE_ALIGNED(16, static const int16_t, row_scan_8x8[64]) = { - 0, 1, 2, 8, 9, 3, 16, 10, - 4, 17, 11, 24, 5, 18, 25, 12, - 19, 26, 32, 6, 13, 20, 33, 27, - 7, 34, 40, 21, 28, 41, 14, 35, - 48, 42, 29, 36, 49, 22, 43, 15, - 56, 37, 50, 44, 30, 57, 23, 51, - 58, 45, 38, 52, 31, 59, 53, 46, - 60, 39, 61, 47, 54, 55, 62, 63, -}; - -DECLARE_ALIGNED(16, static const int16_t, default_scan_16x16[256]) = { - 0, 16, 1, 32, 17, 2, 48, 33, 18, 3, 64, 34, 49, 19, 65, 80, - 50, 4, 35, 66, 20, 81, 96, 51, 5, 36, 82, 97, 67, 112, 21, 52, - 98, 37, 83, 113, 6, 68, 128, 53, 22, 99, 114, 84, 7, 129, 38, 69, - 100, 115, 144, 130, 85, 54, 23, 8, 145, 39, 70, 116, 101, 131, 160, 146, - 55, 86, 24, 71, 132, 117, 161, 40, 9, 102, 147, 176, 162, 87, 56, 25, - 133, 118, 177, 148, 72, 103, 41, 163, 10, 192, 178, 88, 57, 134, 149, 119, - 26, 164, 73, 104, 193, 42, 179, 208, 11, 135, 89, 165, 120, 150, 58, 194, - 180, 27, 74, 209, 105, 151, 136, 43, 90, 224, 166, 195, 181, 121, 210, 59, - 12, 152, 106, 167, 196, 75, 137, 225, 211, 240, 182, 122, 91, 28, 197, 13, - 226, 168, 183, 153, 44, 212, 138, 107, 241, 60, 29, 123, 198, 184, 227, 169, - 242, 76, 213, 154, 45, 92, 14, 199, 139, 61, 228, 214, 170, 185, 243, 108, - 77, 155, 30, 15, 200, 229, 124, 215, 244, 93, 46, 186, 171, 201, 109, 140, - 230, 62, 216, 245, 31, 125, 78, 156, 231, 47, 187, 202, 217, 94, 246, 141, - 63, 232, 172, 110, 247, 157, 79, 218, 203, 126, 233, 188, 248, 95, 173, 142, - 219, 111, 249, 234, 158, 127, 189, 204, 250, 235, 143, 174, 220, 205, 159, - 251, - 190, 221, 175, 236, 237, 191, 206, 252, 222, 253, 207, 238, 223, 254, 239, - 255, -}; - -DECLARE_ALIGNED(16, static const int16_t, col_scan_16x16[256]) = { - 0, 16, 32, 48, 1, 64, 17, 80, 33, 96, 49, 2, 65, 112, 18, 81, - 34, 128, 50, 97, 3, 66, 144, 19, 113, 35, 82, 160, 98, 51, 129, 4, - 67, 176, 20, 114, 145, 83, 36, 99, 130, 52, 192, 5, 161, 68, 115, 21, - 146, 84, 208, 177, 37, 131, 100, 53, 162, 224, 69, 6, 116, 193, 147, 85, - 22, 240, 132, 38, 178, 101, 163, 54, 209, 117, 70, 7, 148, 194, 86, 179, - 225, 23, 133, 39, 164, 8, 102, 210, 241, 55, 195, 118, 149, 71, 180, 24, - 87, 226, 134, 165, 211, 40, 103, 56, 72, 150, 196, 242, 119, 9, 181, 227, - 88, 166, 25, 135, 41, 104, 212, 57, 151, 197, 120, 73, 243, 182, 136, 167, - 213, 89, 10, 228, 105, 152, 198, 26, 42, 121, 183, 244, 168, 58, 137, 229, - 74, 214, 90, 153, 199, 184, 11, 106, 245, 27, 122, 230, 169, 43, 215, 59, - 200, 138, 185, 246, 75, 12, 91, 154, 216, 231, 107, 28, 44, 201, 123, 170, - 60, 247, 232, 76, 139, 13, 92, 217, 186, 248, 155, 108, 29, 124, 45, 202, - 233, 171, 61, 14, 77, 140, 15, 249, 93, 30, 187, 156, 218, 46, 109, 125, - 62, 172, 78, 203, 31, 141, 234, 94, 47, 188, 63, 157, 110, 250, 219, 79, - 126, 204, 173, 142, 95, 189, 111, 235, 158, 220, 251, 127, 174, 143, 205, - 236, - 159, 190, 221, 252, 175, 206, 237, 191, 253, 222, 238, 207, 254, 223, 239, - 255, -}; - -DECLARE_ALIGNED(16, static const int16_t, row_scan_16x16[256]) = { - 0, 1, 2, 16, 3, 17, 4, 18, 32, 5, 33, 19, 6, 34, 48, 20, - 49, 7, 35, 21, 50, 64, 8, 36, 65, 22, 51, 37, 80, 9, 66, 52, - 23, 38, 81, 67, 10, 53, 24, 82, 68, 96, 39, 11, 54, 83, 97, 69, - 25, 98, 84, 40, 112, 55, 12, 70, 99, 113, 85, 26, 41, 56, 114, 100, - 13, 71, 128, 86, 27, 115, 101, 129, 42, 57, 72, 116, 14, 87, 130, 102, - 144, 73, 131, 117, 28, 58, 15, 88, 43, 145, 103, 132, 146, 118, 74, 160, - 89, 133, 104, 29, 59, 147, 119, 44, 161, 148, 90, 105, 134, 162, 120, 176, - 75, 135, 149, 30, 60, 163, 177, 45, 121, 91, 106, 164, 178, 150, 192, 136, - 165, 179, 31, 151, 193, 76, 122, 61, 137, 194, 107, 152, 180, 208, 46, 166, - 167, 195, 92, 181, 138, 209, 123, 153, 224, 196, 77, 168, 210, 182, 240, 108, - 197, 62, 154, 225, 183, 169, 211, 47, 139, 93, 184, 226, 212, 241, 198, 170, - 124, 155, 199, 78, 213, 185, 109, 227, 200, 63, 228, 242, 140, 214, 171, 186, - 156, 229, 243, 125, 94, 201, 244, 215, 216, 230, 141, 187, 202, 79, 172, 110, - 157, 245, 217, 231, 95, 246, 232, 126, 203, 247, 233, 173, 218, 142, 111, - 158, - 188, 248, 127, 234, 219, 249, 189, 204, 143, 174, 159, 250, 235, 205, 220, - 175, - 190, 251, 221, 191, 206, 236, 207, 237, 252, 222, 253, 223, 238, 239, 254, - 255, -}; - -DECLARE_ALIGNED(16, static const int16_t, default_scan_32x32[1024]) = { - 0, 32, 1, 64, 33, 2, 96, 65, 34, 128, 3, 97, 66, 160, - 129, 35, 98, 4, 67, 130, 161, 192, 36, 99, 224, 5, 162, 193, - 68, 131, 37, 100, - 225, 194, 256, 163, 69, 132, 6, 226, 257, 288, 195, 101, 164, 38, - 258, 7, 227, 289, 133, 320, 70, 196, 165, 290, 259, 228, 39, 321, - 102, 352, 8, 197, - 71, 134, 322, 291, 260, 353, 384, 229, 166, 103, 40, 354, 323, 292, - 135, 385, 198, 261, 72, 9, 416, 167, 386, 355, 230, 324, 104, 293, - 41, 417, 199, 136, - 262, 387, 448, 325, 356, 10, 73, 418, 231, 168, 449, 294, 388, 105, - 419, 263, 42, 200, 357, 450, 137, 480, 74, 326, 232, 11, 389, 169, - 295, 420, 106, 451, - 481, 358, 264, 327, 201, 43, 138, 512, 482, 390, 296, 233, 170, 421, - 75, 452, 359, 12, 513, 265, 483, 328, 107, 202, 514, 544, 422, 391, - 453, 139, 44, 234, - 484, 297, 360, 171, 76, 515, 545, 266, 329, 454, 13, 423, 203, 108, - 546, 485, 576, 298, 235, 140, 361, 330, 172, 547, 45, 455, 267, 577, - 486, 77, 204, 362, - 608, 14, 299, 578, 109, 236, 487, 609, 331, 141, 579, 46, 15, 173, - 610, 363, 78, 205, 16, 110, 237, 611, 142, 47, 174, 79, 206, 17, - 111, 238, 48, 143, - 80, 175, 112, 207, 49, 18, 239, 81, 113, 19, 50, 82, 114, 51, - 83, 115, 640, 516, 392, 268, 144, 20, 672, 641, 548, 517, 424, - 393, 300, 269, 176, 145, - 52, 21, 704, 673, 642, 580, 549, 518, 456, 425, 394, 332, 301, - 270, 208, 177, 146, 84, 53, 22, 736, 705, 674, 643, 612, 581, - 550, 519, 488, 457, 426, 395, - 364, 333, 302, 271, 240, 209, 178, 147, 116, 85, 54, 23, 737, - 706, 675, 613, 582, 551, 489, 458, 427, 365, 334, 303, 241, - 210, 179, 117, 86, 55, 738, 707, - 614, 583, 490, 459, 366, 335, 242, 211, 118, 87, 739, 615, 491, - 367, 243, 119, 768, 644, 520, 396, 272, 148, 24, 800, 769, 676, - 645, 552, 521, 428, 397, 304, - 273, 180, 149, 56, 25, 832, 801, 770, 708, 677, 646, 584, 553, - 522, 460, 429, 398, 336, 305, 274, 212, 181, 150, 88, 57, 26, - 864, 833, 802, 771, 740, 709, - 678, 647, 616, 585, 554, 523, 492, 461, 430, 399, 368, 337, 306, - 275, 244, 213, 182, 151, 120, 89, 58, 27, 865, 834, 803, 741, - 710, 679, 617, 586, 555, 493, - 462, 431, 369, 338, 307, 245, 214, 183, 121, 90, 59, 866, 835, - 742, 711, 618, 587, 494, 463, 370, 339, 246, 215, 122, 91, 867, - 743, 619, 495, 371, 247, 123, - 896, 772, 648, 524, 400, 276, 152, 28, 928, 897, 804, 773, 680, - 649, 556, 525, 432, 401, 308, 277, 184, 153, 60, 29, 960, 929, - 898, 836, 805, 774, 712, 681, - 650, 588, 557, 526, 464, 433, 402, 340, 309, 278, 216, 185, 154, - 92, 61, 30, 992, 961, 930, 899, 868, 837, 806, 775, 744, 713, 682, - 651, 620, 589, 558, 527, - 496, 465, 434, 403, 372, 341, 310, 279, 248, 217, 186, 155, 124, - 93, 62, 31, 993, 962, 931, 869, 838, 807, 745, 714, 683, 621, 590, - 559, 497, 466, 435, 373, - 342, 311, 249, 218, 187, 125, 94, 63, 994, 963, 870, 839, 746, 715, - 622, 591, 498, 467, 374, 343, 250, 219, 126, 95, 995, 871, 747, 623, - 499, 375, 251, 127, - 900, 776, 652, 528, 404, 280, 156, 932, 901, 808, 777, 684, 653, 560, - 529, 436, 405, 312, 281, 188, 157, 964, 933, 902, 840, 809, 778, 716, - 685, 654, 592, 561, - 530, 468, 437, 406, 344, 313, 282, 220, 189, 158, 996, 965, 934, 903, - 872, 841, 810, 779, 748, 717, 686, 655, 624, 593, 562, 531, 500, 469, - 438, 407, 376, 345, - 314, 283, 252, 221, 190, 159, 997, 966, 935, 873, 842, 811, 749, 718, - 687, 625, 594, 563, 501, 470, 439, 377, 346, 315, 253, 222, 191, 998, - 967, 874, 843, 750, - 719, 626, 595, 502, 471, 378, 347, 254, 223, 999, 875, 751, 627, 503, - 379, 255, 904, 780, 656, 532, 408, 284, 936, 905, 812, 781, 688, 657, - 564, 533, 440, 409, - 316, 285, 968, 937, 906, 844, 813, 782, 720, 689, 658, 596, 565, 534, - 472, 441, 410, 348, 317, 286, 1000, 969, 938, 907, 876, 845, 814, 783, - 752, 721, 690, 659, - 628, 597, 566, 535, 504, 473, 442, 411, 380, 349, 318, 287, 1001, 970, - 939, 877, 846, 815, 753, 722, 691, 629, 598, 567, 505, 474, 443, 381, - 350, 319, 1002, 971, - 878, 847, 754, 723, 630, 599, 506, 475, 382, 351, 1003, 879, 755, 631, - 507, 383, 908, 784, 660, 536, 412, 940, 909, 816, 785, 692, 661, 568, - 537, 444, 413, 972, - 941, 910, 848, 817, 786, 724, 693, 662, 600, 569, 538, 476, 445, 414, - 1004, 973, 942, 911, 880, 849, 818, 787, 756, 725, 694, 663, 632, 601, - 570, 539, 508, 477, - 446, 415, 1005, 974, 943, 881, 850, 819, 757, 726, 695, 633, 602, 571, - 509, 478, 447, 1006, 975, 882, 851, 758, 727, 634, 603, 510, 479, - 1007, 883, 759, 635, 511, - 912, 788, 664, 540, 944, 913, 820, 789, 696, 665, 572, 541, 976, 945, - 914, 852, 821, 790, 728, 697, 666, 604, 573, 542, 1008, 977, 946, 915, - 884, 853, 822, 791, - 760, 729, 698, 667, 636, 605, 574, 543, 1009, 978, 947, 885, 854, 823, - 761, 730, 699, 637, 606, 575, 1010, 979, 886, 855, 762, 731, 638, 607, - 1011, 887, 763, 639, - 916, 792, 668, 948, 917, 824, 793, 700, 669, 980, 949, 918, 856, 825, - 794, 732, 701, 670, 1012, 981, 950, 919, 888, 857, 826, 795, 764, 733, - 702, 671, 1013, 982, - 951, 889, 858, 827, 765, 734, 703, 1014, 983, 890, 859, 766, 735, 1015, - 891, 767, 920, 796, 952, 921, 828, 797, 984, 953, 922, 860, 829, 798, - 1016, 985, 954, 923, - 892, 861, 830, 799, 1017, 986, 955, 893, 862, 831, 1018, 987, 894, 863, - 1019, 895, 924, 956, 925, 988, 957, 926, 1020, 989, 958, 927, 1021, - 990, 959, 1022, 991, 1023, -}; - -// Neighborhood 5-tuples for various scans and blocksizes, -// in {top, left, topleft, topright, bottomleft} order -// for each position in raster scan order. -// -1 indicates the neighbor does not exist. -DECLARE_ALIGNED(16, static const int16_t, - default_scan_4x4_neighbors[17 * MAX_NEIGHBORS]) = { - 0, 0, 0, 0, 0, 0, 1, 4, 4, 4, 1, 1, 8, 8, 5, 8, 2, 2, 2, 5, 9, 12, 6, 9, - 3, 6, 10, 13, 7, 10, 11, 14, 0, 0, -}; - -DECLARE_ALIGNED(16, static const int16_t, - col_scan_4x4_neighbors[17 * MAX_NEIGHBORS]) = { - 0, 0, 0, 0, 4, 4, 0, 0, 8, 8, 1, 1, 5, 5, 1, 1, 9, 9, 2, 2, 6, 6, 2, 2, 3, - 3, 10, 10, 7, 7, 11, 11, 0, 0, -}; - -DECLARE_ALIGNED(16, static const int16_t, - row_scan_4x4_neighbors[17 * MAX_NEIGHBORS]) = { - 0, 0, 0, 0, 0, 0, 1, 1, 4, 4, 2, 2, 5, 5, 4, 4, 8, 8, 6, 6, 8, 8, 9, 9, 12, - 12, 10, 10, 13, 13, 14, 14, 0, 0, -}; - -DECLARE_ALIGNED(16, static const int16_t, - col_scan_8x8_neighbors[65 * MAX_NEIGHBORS]) = { - 0, 0, 0, 0, 8, 8, 0, 0, 16, 16, 1, 1, 24, 24, 9, 9, 1, 1, 32, 32, 17, 17, 2, - 2, 25, 25, 10, 10, 40, 40, 2, 2, 18, 18, 33, 33, 3, 3, 48, 48, 11, 11, 26, - 26, 3, 3, 41, 41, 19, 19, 34, 34, 4, 4, 27, 27, 12, 12, 49, 49, 42, 42, 20, - 20, 4, 4, 35, 35, 5, 5, 28, 28, 50, 50, 43, 43, 13, 13, 36, 36, 5, 5, 21, 21, - 51, 51, 29, 29, 6, 6, 44, 44, 14, 14, 6, 6, 37, 37, 52, 52, 22, 22, 7, 7, 30, - 30, 45, 45, 15, 15, 38, 38, 23, 23, 53, 53, 31, 31, 46, 46, 39, 39, 54, 54, - 47, 47, 55, 55, 0, 0, -}; - -DECLARE_ALIGNED(16, static const int16_t, - row_scan_8x8_neighbors[65 * MAX_NEIGHBORS]) = { - 0, 0, 0, 0, 1, 1, 0, 0, 8, 8, 2, 2, 8, 8, 9, 9, 3, 3, 16, 16, 10, 10, 16, 16, - 4, 4, 17, 17, 24, 24, 11, 11, 18, 18, 25, 25, 24, 24, 5, 5, 12, 12, 19, 19, - 32, 32, 26, 26, 6, 6, 33, 33, 32, 32, 20, 20, 27, 27, 40, 40, 13, 13, 34, 34, - 40, 40, 41, 41, 28, 28, 35, 35, 48, 48, 21, 21, 42, 42, 14, 14, 48, 48, 36, - 36, 49, 49, 43, 43, 29, 29, 56, 56, 22, 22, 50, 50, 57, 57, 44, 44, 37, 37, - 51, 51, 30, 30, 58, 58, 52, 52, 45, 45, 59, 59, 38, 38, 60, 60, 46, 46, 53, - 53, 54, 54, 61, 61, 62, 62, 0, 0, -}; - -DECLARE_ALIGNED(16, static const int16_t, - default_scan_8x8_neighbors[65 * MAX_NEIGHBORS]) = { - 0, 0, 0, 0, 0, 0, 8, 8, 1, 8, 1, 1, 9, 16, 16, 16, 2, 9, 2, 2, 10, 17, 17, - 24, 24, 24, 3, 10, 3, 3, 18, 25, 25, 32, 11, 18, 32, 32, 4, 11, 26, 33, 19, - 26, 4, 4, 33, 40, 12, 19, 40, 40, 5, 12, 27, 34, 34, 41, 20, 27, 13, 20, 5, - 5, 41, 48, 48, 48, 28, 35, 35, 42, 21, 28, 6, 6, 6, 13, 42, 49, 49, 56, 36, - 43, 14, 21, 29, 36, 7, 14, 43, 50, 50, 57, 22, 29, 37, 44, 15, 22, 44, 51, - 51, 58, 30, 37, 23, 30, 52, 59, 45, 52, 38, 45, 31, 38, 53, 60, 46, 53, 39, - 46, 54, 61, 47, 54, 55, 62, 0, 0, -}; - -DECLARE_ALIGNED(16, static const int16_t, - col_scan_16x16_neighbors[257 * MAX_NEIGHBORS]) = { - 0, 0, 0, 0, 16, 16, 32, 32, 0, 0, 48, 48, 1, 1, 64, 64, - 17, 17, 80, 80, 33, 33, 1, 1, 49, 49, 96, 96, 2, 2, 65, 65, - 18, 18, 112, 112, 34, 34, 81, 81, 2, 2, 50, 50, 128, 128, 3, 3, - 97, 97, 19, 19, 66, 66, 144, 144, 82, 82, 35, 35, 113, 113, 3, 3, - 51, 51, 160, 160, 4, 4, 98, 98, 129, 129, 67, 67, 20, 20, 83, 83, - 114, 114, 36, 36, 176, 176, 4, 4, 145, 145, 52, 52, 99, 99, 5, 5, - 130, 130, 68, 68, 192, 192, 161, 161, 21, 21, 115, 115, 84, 84, 37, 37, - 146, 146, 208, 208, 53, 53, 5, 5, 100, 100, 177, 177, 131, 131, 69, 69, - 6, 6, 224, 224, 116, 116, 22, 22, 162, 162, 85, 85, 147, 147, 38, 38, - 193, 193, 101, 101, 54, 54, 6, 6, 132, 132, 178, 178, 70, 70, 163, 163, - 209, 209, 7, 7, 117, 117, 23, 23, 148, 148, 7, 7, 86, 86, 194, 194, - 225, 225, 39, 39, 179, 179, 102, 102, 133, 133, 55, 55, 164, 164, 8, 8, - 71, 71, 210, 210, 118, 118, 149, 149, 195, 195, 24, 24, 87, 87, 40, 40, - 56, 56, 134, 134, 180, 180, 226, 226, 103, 103, 8, 8, 165, 165, 211, 211, - 72, 72, 150, 150, 9, 9, 119, 119, 25, 25, 88, 88, 196, 196, 41, 41, - 135, 135, 181, 181, 104, 104, 57, 57, 227, 227, 166, 166, 120, 120, 151, 151, - 197, 197, 73, 73, 9, 9, 212, 212, 89, 89, 136, 136, 182, 182, 10, 10, - 26, 26, 105, 105, 167, 167, 228, 228, 152, 152, 42, 42, 121, 121, 213, 213, - 58, 58, 198, 198, 74, 74, 137, 137, 183, 183, 168, 168, 10, 10, 90, 90, - 229, 229, 11, 11, 106, 106, 214, 214, 153, 153, 27, 27, 199, 199, 43, 43, - 184, 184, 122, 122, 169, 169, 230, 230, 59, 59, 11, 11, 75, 75, 138, 138, - 200, 200, 215, 215, 91, 91, 12, 12, 28, 28, 185, 185, 107, 107, 154, 154, - 44, 44, 231, 231, 216, 216, 60, 60, 123, 123, 12, 12, 76, 76, 201, 201, - 170, 170, 232, 232, 139, 139, 92, 92, 13, 13, 108, 108, 29, 29, 186, 186, - 217, 217, 155, 155, 45, 45, 13, 13, 61, 61, 124, 124, 14, 14, 233, 233, - 77, 77, 14, 14, 171, 171, 140, 140, 202, 202, 30, 30, 93, 93, 109, 109, - 46, 46, 156, 156, 62, 62, 187, 187, 15, 15, 125, 125, 218, 218, 78, 78, - 31, 31, 172, 172, 47, 47, 141, 141, 94, 94, 234, 234, 203, 203, 63, 63, - 110, 110, 188, 188, 157, 157, 126, 126, 79, 79, 173, 173, 95, 95, 219, 219, - 142, 142, 204, 204, 235, 235, 111, 111, 158, 158, 127, 127, 189, 189, 220, - 220, 143, 143, 174, 174, 205, 205, 236, 236, 159, 159, 190, 190, 221, 221, - 175, 175, 237, 237, 206, 206, 222, 222, 191, 191, 238, 238, 207, 207, 223, - 223, 239, 239, 0, 0, -}; - -DECLARE_ALIGNED(16, static const int16_t, - row_scan_16x16_neighbors[257 * MAX_NEIGHBORS]) = { - 0, 0, 0, 0, 1, 1, 0, 0, 2, 2, 16, 16, 3, 3, 17, 17, - 16, 16, 4, 4, 32, 32, 18, 18, 5, 5, 33, 33, 32, 32, 19, 19, - 48, 48, 6, 6, 34, 34, 20, 20, 49, 49, 48, 48, 7, 7, 35, 35, - 64, 64, 21, 21, 50, 50, 36, 36, 64, 64, 8, 8, 65, 65, 51, 51, - 22, 22, 37, 37, 80, 80, 66, 66, 9, 9, 52, 52, 23, 23, 81, 81, - 67, 67, 80, 80, 38, 38, 10, 10, 53, 53, 82, 82, 96, 96, 68, 68, - 24, 24, 97, 97, 83, 83, 39, 39, 96, 96, 54, 54, 11, 11, 69, 69, - 98, 98, 112, 112, 84, 84, 25, 25, 40, 40, 55, 55, 113, 113, 99, 99, - 12, 12, 70, 70, 112, 112, 85, 85, 26, 26, 114, 114, 100, 100, 128, 128, - 41, 41, 56, 56, 71, 71, 115, 115, 13, 13, 86, 86, 129, 129, 101, 101, - 128, 128, 72, 72, 130, 130, 116, 116, 27, 27, 57, 57, 14, 14, 87, 87, - 42, 42, 144, 144, 102, 102, 131, 131, 145, 145, 117, 117, 73, 73, 144, 144, - 88, 88, 132, 132, 103, 103, 28, 28, 58, 58, 146, 146, 118, 118, 43, 43, - 160, 160, 147, 147, 89, 89, 104, 104, 133, 133, 161, 161, 119, 119, 160, 160, - 74, 74, 134, 134, 148, 148, 29, 29, 59, 59, 162, 162, 176, 176, 44, 44, - 120, 120, 90, 90, 105, 105, 163, 163, 177, 177, 149, 149, 176, 176, 135, 135, - 164, 164, 178, 178, 30, 30, 150, 150, 192, 192, 75, 75, 121, 121, 60, 60, - 136, 136, 193, 193, 106, 106, 151, 151, 179, 179, 192, 192, 45, 45, 165, 165, - 166, 166, 194, 194, 91, 91, 180, 180, 137, 137, 208, 208, 122, 122, 152, 152, - 208, 208, 195, 195, 76, 76, 167, 167, 209, 209, 181, 181, 224, 224, 107, 107, - 196, 196, 61, 61, 153, 153, 224, 224, 182, 182, 168, 168, 210, 210, 46, 46, - 138, 138, 92, 92, 183, 183, 225, 225, 211, 211, 240, 240, 197, 197, 169, 169, - 123, 123, 154, 154, 198, 198, 77, 77, 212, 212, 184, 184, 108, 108, 226, 226, - 199, 199, 62, 62, 227, 227, 241, 241, 139, 139, 213, 213, 170, 170, 185, 185, - 155, 155, 228, 228, 242, 242, 124, 124, 93, 93, 200, 200, 243, 243, 214, 214, - 215, 215, 229, 229, 140, 140, 186, 186, 201, 201, 78, 78, 171, 171, 109, 109, - 156, 156, 244, 244, 216, 216, 230, 230, 94, 94, 245, 245, 231, 231, 125, 125, - 202, 202, 246, 246, 232, 232, 172, 172, 217, 217, 141, 141, 110, 110, 157, - 157, 187, 187, 247, 247, 126, 126, 233, 233, 218, 218, 248, 248, 188, 188, - 203, 203, 142, 142, 173, 173, 158, 158, 249, 249, 234, 234, 204, 204, 219, - 219, 174, 174, 189, 189, 250, 250, 220, 220, 190, 190, 205, 205, 235, 235, - 206, 206, 236, 236, 251, 251, 221, 221, 252, 252, 222, 222, 237, 237, 238, - 238, 253, 253, 254, 254, 0, 0, -}; - -DECLARE_ALIGNED(16, static const int16_t, - default_scan_16x16_neighbors[257 * MAX_NEIGHBORS]) = { - 0, 0, 0, 0, 0, 0, 16, 16, 1, 16, 1, 1, 32, 32, 17, 32, - 2, 17, 2, 2, 48, 48, 18, 33, 33, 48, 3, 18, 49, 64, 64, 64, - 34, 49, 3, 3, 19, 34, 50, 65, 4, 19, 65, 80, 80, 80, 35, 50, - 4, 4, 20, 35, 66, 81, 81, 96, 51, 66, 96, 96, 5, 20, 36, 51, - 82, 97, 21, 36, 67, 82, 97, 112, 5, 5, 52, 67, 112, 112, 37, 52, - 6, 21, 83, 98, 98, 113, 68, 83, 6, 6, 113, 128, 22, 37, 53, 68, - 84, 99, 99, 114, 128, 128, 114, 129, 69, 84, 38, 53, 7, 22, 7, 7, - 129, 144, 23, 38, 54, 69, 100, 115, 85, 100, 115, 130, 144, 144, 130, 145, - 39, 54, 70, 85, 8, 23, 55, 70, 116, 131, 101, 116, 145, 160, 24, 39, - 8, 8, 86, 101, 131, 146, 160, 160, 146, 161, 71, 86, 40, 55, 9, 24, - 117, 132, 102, 117, 161, 176, 132, 147, 56, 71, 87, 102, 25, 40, 147, 162, - 9, 9, 176, 176, 162, 177, 72, 87, 41, 56, 118, 133, 133, 148, 103, 118, - 10, 25, 148, 163, 57, 72, 88, 103, 177, 192, 26, 41, 163, 178, 192, 192, - 10, 10, 119, 134, 73, 88, 149, 164, 104, 119, 134, 149, 42, 57, 178, 193, - 164, 179, 11, 26, 58, 73, 193, 208, 89, 104, 135, 150, 120, 135, 27, 42, - 74, 89, 208, 208, 150, 165, 179, 194, 165, 180, 105, 120, 194, 209, 43, 58, - 11, 11, 136, 151, 90, 105, 151, 166, 180, 195, 59, 74, 121, 136, 209, 224, - 195, 210, 224, 224, 166, 181, 106, 121, 75, 90, 12, 27, 181, 196, 12, 12, - 210, 225, 152, 167, 167, 182, 137, 152, 28, 43, 196, 211, 122, 137, 91, 106, - 225, 240, 44, 59, 13, 28, 107, 122, 182, 197, 168, 183, 211, 226, 153, 168, - 226, 241, 60, 75, 197, 212, 138, 153, 29, 44, 76, 91, 13, 13, 183, 198, - 123, 138, 45, 60, 212, 227, 198, 213, 154, 169, 169, 184, 227, 242, 92, 107, - 61, 76, 139, 154, 14, 29, 14, 14, 184, 199, 213, 228, 108, 123, 199, 214, - 228, 243, 77, 92, 30, 45, 170, 185, 155, 170, 185, 200, 93, 108, 124, 139, - 214, 229, 46, 61, 200, 215, 229, 244, 15, 30, 109, 124, 62, 77, 140, 155, - 215, 230, 31, 46, 171, 186, 186, 201, 201, 216, 78, 93, 230, 245, 125, 140, - 47, 62, 216, 231, 156, 171, 94, 109, 231, 246, 141, 156, 63, 78, 202, 217, - 187, 202, 110, 125, 217, 232, 172, 187, 232, 247, 79, 94, 157, 172, 126, 141, - 203, 218, 95, 110, 233, 248, 218, 233, 142, 157, 111, 126, 173, 188, 188, 203, - 234, 249, 219, 234, 127, 142, 158, 173, 204, 219, 189, 204, 143, 158, 235, - 250, 174, 189, 205, 220, 159, 174, 220, 235, 221, 236, 175, 190, 190, 205, - 236, 251, 206, 221, 237, 252, 191, 206, 222, 237, 207, 222, 238, 253, 223, - 238, 239, 254, 0, 0, -}; - -DECLARE_ALIGNED(16, static const int16_t, - default_scan_32x32_neighbors[1025 * MAX_NEIGHBORS]) = { - 0, 0, 0, 0, 0, 0, 32, 32, 1, 32, 1, 1, 64, 64, 33, 64, - 2, 33, 96, 96, 2, 2, 65, 96, 34, 65, 128, 128, 97, 128, 3, 34, - 66, 97, 3, 3, 35, 66, 98, 129, 129, 160, 160, 160, 4, 35, 67, 98, - 192, 192, 4, 4, 130, 161, 161, 192, 36, 67, 99, 130, 5, 36, 68, 99, - 193, 224, 162, 193, 224, 224, 131, 162, 37, 68, 100, 131, 5, 5, 194, 225, - 225, 256, 256, 256, 163, 194, 69, 100, 132, 163, 6, 37, 226, 257, 6, 6, - 195, 226, 257, 288, 101, 132, 288, 288, 38, 69, 164, 195, 133, 164, 258, 289, - 227, 258, 196, 227, 7, 38, 289, 320, 70, 101, 320, 320, 7, 7, 165, 196, - 39, 70, 102, 133, 290, 321, 259, 290, 228, 259, 321, 352, 352, 352, 197, 228, - 134, 165, 71, 102, 8, 39, 322, 353, 291, 322, 260, 291, 103, 134, 353, 384, - 166, 197, 229, 260, 40, 71, 8, 8, 384, 384, 135, 166, 354, 385, 323, 354, - 198, 229, 292, 323, 72, 103, 261, 292, 9, 40, 385, 416, 167, 198, 104, 135, - 230, 261, 355, 386, 416, 416, 293, 324, 324, 355, 9, 9, 41, 72, 386, 417, - 199, 230, 136, 167, 417, 448, 262, 293, 356, 387, 73, 104, 387, 418, 231, 262, - 10, 41, 168, 199, 325, 356, 418, 449, 105, 136, 448, 448, 42, 73, 294, 325, - 200, 231, 10, 10, 357, 388, 137, 168, 263, 294, 388, 419, 74, 105, 419, 450, - 449, 480, 326, 357, 232, 263, 295, 326, 169, 200, 11, 42, 106, 137, 480, 480, - 450, 481, 358, 389, 264, 295, 201, 232, 138, 169, 389, 420, 43, 74, 420, 451, - 327, 358, 11, 11, 481, 512, 233, 264, 451, 482, 296, 327, 75, 106, 170, 201, - 482, 513, 512, 512, 390, 421, 359, 390, 421, 452, 107, 138, 12, 43, 202, 233, - 452, 483, 265, 296, 328, 359, 139, 170, 44, 75, 483, 514, 513, 544, 234, 265, - 297, 328, 422, 453, 12, 12, 391, 422, 171, 202, 76, 107, 514, 545, 453, 484, - 544, 544, 266, 297, 203, 234, 108, 139, 329, 360, 298, 329, 140, 171, 515, - 546, 13, 44, 423, 454, 235, 266, 545, 576, 454, 485, 45, 76, 172, 203, 330, - 361, 576, 576, 13, 13, 267, 298, 546, 577, 77, 108, 204, 235, 455, 486, 577, - 608, 299, 330, 109, 140, 547, 578, 14, 45, 14, 14, 141, 172, 578, 609, 331, - 362, 46, 77, 173, 204, 15, 15, 78, 109, 205, 236, 579, 610, 110, 141, 15, 46, - 142, 173, 47, 78, 174, 205, 16, 16, 79, 110, 206, 237, 16, 47, 111, 142, - 48, 79, 143, 174, 80, 111, 175, 206, 17, 48, 17, 17, 207, 238, 49, 80, - 81, 112, 18, 18, 18, 49, 50, 81, 82, 113, 19, 50, 51, 82, 83, 114, 608, 608, - 484, 515, 360, 391, 236, 267, 112, 143, 19, 19, 640, 640, 609, 640, 516, 547, - 485, 516, 392, 423, 361, 392, 268, 299, 237, 268, 144, 175, 113, 144, 20, 51, - 20, 20, 672, 672, 641, 672, 610, 641, 548, 579, 517, 548, 486, 517, 424, 455, - 393, 424, 362, 393, 300, 331, 269, 300, 238, 269, 176, 207, 145, 176, 114, - 145, 52, 83, 21, 52, 21, 21, 704, 704, 673, 704, 642, 673, 611, 642, 580, - 611, 549, 580, 518, 549, 487, 518, 456, 487, 425, 456, 394, 425, 363, 394, - 332, 363, 301, 332, 270, 301, 239, 270, 208, 239, 177, 208, 146, 177, 115, - 146, 84, 115, 53, 84, 22, 53, 22, 22, 705, 736, 674, 705, 643, 674, 581, 612, - 550, 581, 519, 550, 457, 488, 426, 457, 395, 426, 333, 364, 302, 333, 271, - 302, 209, 240, 178, 209, 147, 178, 85, 116, 54, 85, 23, 54, 706, 737, 675, - 706, 582, 613, 551, 582, 458, 489, 427, 458, 334, 365, 303, 334, 210, 241, - 179, 210, 86, 117, 55, 86, 707, 738, 583, 614, 459, 490, 335, 366, 211, 242, - 87, 118, 736, 736, 612, 643, 488, 519, 364, 395, 240, 271, 116, 147, 23, 23, - 768, 768, 737, 768, 644, 675, 613, 644, 520, 551, 489, 520, 396, 427, 365, - 396, 272, 303, 241, 272, 148, 179, 117, 148, 24, 55, 24, 24, 800, 800, 769, - 800, 738, 769, 676, 707, 645, 676, 614, 645, 552, 583, 521, 552, 490, 521, - 428, 459, 397, 428, 366, 397, 304, 335, 273, 304, 242, 273, 180, 211, 149, - 180, 118, 149, 56, 87, 25, 56, 25, 25, 832, 832, 801, 832, 770, 801, 739, - 770, 708, 739, 677, 708, 646, 677, 615, 646, 584, 615, 553, 584, 522, 553, - 491, 522, 460, 491, 429, 460, 398, 429, 367, 398, 336, 367, 305, 336, 274, - 305, 243, 274, 212, 243, 181, 212, 150, 181, 119, 150, 88, 119, 57, 88, 26, - 57, 26, 26, 833, 864, 802, 833, 771, 802, 709, 740, 678, 709, 647, 678, 585, - 616, 554, 585, 523, 554, 461, 492, 430, 461, 399, 430, 337, 368, 306, 337, - 275, 306, 213, 244, 182, 213, 151, 182, 89, 120, 58, 89, 27, 58, 834, 865, - 803, 834, 710, 741, 679, 710, 586, 617, 555, 586, 462, 493, 431, 462, 338, - 369, 307, 338, 214, 245, 183, 214, 90, 121, 59, 90, 835, 866, 711, 742, 587, - 618, 463, 494, 339, 370, 215, 246, 91, 122, 864, 864, 740, 771, 616, 647, - 492, 523, 368, 399, 244, 275, 120, 151, 27, 27, 896, 896, 865, 896, 772, 803, - 741, 772, 648, 679, 617, 648, 524, 555, 493, 524, 400, 431, 369, 400, 276, - 307, 245, 276, 152, 183, 121, 152, 28, 59, 28, 28, 928, 928, 897, 928, 866, - 897, 804, 835, 773, 804, 742, 773, 680, 711, 649, 680, 618, 649, 556, 587, - 525, 556, 494, 525, 432, 463, 401, 432, 370, 401, 308, 339, 277, 308, 246, - 277, 184, 215, 153, 184, 122, 153, 60, 91, 29, 60, 29, 29, 960, 960, 929, - 960, 898, 929, 867, 898, 836, 867, 805, 836, 774, 805, 743, 774, 712, 743, - 681, 712, 650, 681, 619, 650, 588, 619, 557, 588, 526, 557, 495, 526, 464, - 495, 433, 464, 402, 433, 371, 402, 340, 371, 309, 340, 278, 309, 247, 278, - 216, 247, 185, 216, 154, 185, 123, 154, 92, 123, 61, 92, 30, 61, 30, 30, - 961, 992, 930, 961, 899, 930, 837, 868, 806, 837, 775, 806, 713, 744, 682, - 713, 651, 682, 589, 620, 558, 589, 527, 558, 465, 496, 434, 465, 403, 434, - 341, 372, 310, 341, 279, 310, 217, 248, 186, 217, 155, 186, 93, 124, 62, 93, - 31, 62, 962, 993, 931, 962, 838, 869, 807, 838, 714, 745, 683, 714, 590, 621, - 559, 590, 466, 497, 435, 466, 342, 373, 311, 342, 218, 249, 187, 218, 94, - 125, 63, 94, 963, 994, 839, 870, 715, 746, 591, 622, 467, 498, 343, 374, 219, - 250, 95, 126, 868, 899, 744, 775, 620, 651, 496, 527, 372, 403, 248, 279, - 124, 155, 900, 931, 869, 900, 776, 807, 745, 776, 652, 683, 621, 652, 528, - 559, 497, 528, 404, 435, 373, 404, 280, 311, 249, 280, 156, 187, 125, 156, - 932, 963, 901, 932, 870, 901, 808, 839, 777, 808, 746, 777, 684, 715, 653, - 684, 622, 653, 560, 591, 529, 560, 498, 529, 436, 467, 405, 436, 374, 405, - 312, 343, 281, 312, 250, 281, 188, 219, 157, 188, 126, 157, 964, 995, 933, - 964, 902, 933, 871, 902, 840, 871, 809, 840, 778, 809, 747, 778, 716, 747, - 685, 716, 654, 685, 623, 654, 592, 623, 561, 592, 530, 561, 499, 530, 468, - 499, 437, 468, 406, 437, 375, 406, 344, 375, 313, 344, 282, 313, 251, 282, - 220, 251, 189, 220, 158, 189, 127, 158, 965, 996, 934, 965, 903, 934, 841, - 872, 810, 841, 779, 810, 717, 748, 686, 717, 655, 686, 593, 624, 562, 593, - 531, 562, 469, 500, 438, 469, 407, 438, 345, 376, 314, 345, 283, 314, 221, - 252, 190, 221, 159, 190, 966, 997, 935, 966, 842, 873, 811, 842, 718, 749, - 687, 718, 594, 625, 563, 594, 470, 501, 439, 470, 346, 377, 315, 346, 222, - 253, 191, 222, 967, 998, 843, 874, 719, 750, 595, 626, 471, 502, 347, 378, - 223, 254, 872, 903, 748, 779, 624, 655, 500, 531, 376, 407, 252, 283, 904, - 935, 873, 904, 780, 811, 749, 780, 656, 687, 625, 656, 532, 563, 501, 532, - 408, 439, 377, 408, 284, 315, 253, 284, 936, 967, 905, 936, 874, 905, 812, - 843, 781, 812, 750, 781, 688, 719, 657, 688, 626, 657, 564, 595, 533, 564, - 502, 533, 440, 471, 409, 440, 378, 409, 316, 347, 285, 316, 254, 285, 968, - 999, 937, 968, 906, 937, 875, 906, 844, 875, 813, 844, 782, 813, 751, 782, - 720, 751, 689, 720, 658, 689, 627, 658, 596, 627, 565, 596, 534, 565, 503, - 534, 472, 503, 441, 472, 410, 441, 379, 410, 348, 379, 317, 348, 286, 317, - 255, 286, 969, 1000, 938, 969, 907, 938, 845, 876, 814, 845, 783, 814, 721, - 752, 690, 721, 659, 690, 597, 628, 566, 597, 535, 566, 473, 504, 442, 473, - 411, 442, 349, 380, 318, 349, 287, 318, 970, 1001, 939, 970, 846, 877, 815, - 846, 722, 753, 691, 722, 598, 629, 567, 598, 474, 505, 443, 474, 350, 381, - 319, 350, 971, 1002, 847, 878, 723, 754, 599, 630, 475, 506, 351, 382, 876, - 907, 752, 783, 628, 659, 504, 535, 380, 411, 908, 939, 877, 908, 784, 815, - 753, 784, 660, 691, 629, 660, 536, 567, 505, 536, 412, 443, 381, 412, 940, - 971, 909, 940, 878, 909, 816, 847, 785, 816, 754, 785, 692, 723, 661, 692, - 630, 661, 568, 599, 537, 568, 506, 537, 444, 475, 413, 444, 382, 413, 972, - 1003, 941, 972, 910, 941, 879, 910, 848, 879, 817, 848, 786, 817, 755, 786, - 724, 755, 693, 724, 662, 693, 631, 662, 600, 631, 569, 600, 538, 569, 507, - 538, 476, 507, 445, 476, 414, 445, 383, 414, 973, 1004, 942, 973, 911, 942, - 849, 880, 818, 849, 787, 818, 725, 756, 694, 725, 663, 694, 601, 632, 570, - 601, 539, 570, 477, 508, 446, 477, 415, 446, 974, 1005, 943, 974, 850, 881, - 819, 850, 726, 757, 695, 726, 602, 633, 571, 602, 478, 509, 447, 478, 975, - 1006, 851, 882, 727, 758, 603, 634, 479, 510, 880, 911, 756, 787, 632, 663, - 508, 539, 912, 943, 881, 912, 788, 819, 757, 788, 664, 695, 633, 664, 540, - 571, 509, 540, 944, 975, 913, 944, 882, 913, 820, 851, 789, 820, 758, 789, - 696, 727, 665, 696, 634, 665, 572, 603, 541, 572, 510, 541, 976, 1007, 945, - 976, 914, 945, 883, 914, 852, 883, 821, 852, 790, 821, 759, 790, 728, 759, - 697, 728, 666, 697, 635, 666, 604, 635, 573, 604, 542, 573, 511, 542, 977, - 1008, 946, 977, 915, 946, 853, 884, 822, 853, 791, 822, 729, 760, 698, 729, - 667, 698, 605, 636, 574, 605, 543, 574, 978, 1009, 947, 978, 854, 885, 823, - 854, 730, 761, 699, 730, 606, 637, 575, 606, 979, 1010, 855, 886, 731, 762, - 607, 638, 884, 915, 760, 791, 636, 667, 916, 947, 885, 916, 792, 823, 761, - 792, 668, 699, 637, 668, 948, 979, 917, 948, 886, 917, 824, 855, 793, 824, - 762, 793, 700, 731, 669, 700, 638, 669, 980, 1011, 949, 980, 918, 949, 887, - 918, 856, 887, 825, 856, 794, 825, 763, 794, 732, 763, 701, 732, 670, 701, - 639, 670, 981, 1012, 950, 981, 919, 950, 857, 888, 826, 857, 795, 826, 733, - 764, 702, 733, 671, 702, 982, 1013, 951, 982, 858, 889, 827, 858, 734, 765, - 703, 734, 983, 1014, 859, 890, 735, 766, 888, 919, 764, 795, 920, 951, 889, - 920, 796, 827, 765, 796, 952, 983, 921, 952, 890, 921, 828, 859, 797, 828, - 766, 797, 984, 1015, 953, 984, 922, 953, 891, 922, 860, 891, 829, 860, 798, - 829, 767, 798, 985, 1016, 954, 985, 923, 954, 861, 892, 830, 861, 799, 830, - 986, 1017, 955, 986, 862, 893, 831, 862, 987, 1018, 863, 894, 892, 923, 924, - 955, 893, 924, 956, 987, 925, 956, 894, 925, 988, 1019, 957, 988, 926, 957, - 895, 926, 989, 1020, 958, 989, 927, 958, 990, 1021, 959, 990, 991, 1022, 0, 0, -}; - -DECLARE_ALIGNED(16, static const int16_t, vp9_default_iscan_4x4[16]) = { - 0, 2, 5, 8, 1, 3, 9, 12, 4, 7, 11, 14, 6, 10, 13, 15, -}; - -DECLARE_ALIGNED(16, static const int16_t, vp9_col_iscan_4x4[16]) = { - 0, 3, 7, 11, 1, 5, 9, 12, 2, 6, 10, 14, 4, 8, 13, 15, -}; - -DECLARE_ALIGNED(16, static const int16_t, vp9_row_iscan_4x4[16]) = { - 0, 1, 3, 5, 2, 4, 6, 9, 7, 8, 11, 13, 10, 12, 14, 15, -}; - -DECLARE_ALIGNED(16, static const int16_t, vp9_col_iscan_8x8[64]) = { - 0, 3, 8, 15, 22, 32, 40, 47, 1, 5, 11, 18, 26, 34, 44, 51, - 2, 7, 13, 20, 28, 38, 46, 54, 4, 10, 16, 24, 31, 41, 50, 56, - 6, 12, 21, 27, 35, 43, 52, 58, 9, 17, 25, 33, 39, 48, 55, 60, - 14, 23, 30, 37, 45, 53, 59, 62, 19, 29, 36, 42, 49, 57, 61, 63, -}; - -DECLARE_ALIGNED(16, static const int16_t, vp9_row_iscan_8x8[64]) = { - 0, 1, 2, 5, 8, 12, 19, 24, 3, 4, 7, 10, 15, 20, 30, 39, - 6, 9, 13, 16, 21, 27, 37, 46, 11, 14, 17, 23, 28, 34, 44, 52, - 18, 22, 25, 31, 35, 41, 50, 57, 26, 29, 33, 38, 43, 49, 55, 59, - 32, 36, 42, 47, 51, 54, 60, 61, 40, 45, 48, 53, 56, 58, 62, 63, -}; - -DECLARE_ALIGNED(16, static const int16_t, vp9_default_iscan_8x8[64]) = { - 0, 2, 5, 9, 14, 22, 31, 37, 1, 4, 8, 13, 19, 26, 38, 44, - 3, 6, 10, 17, 24, 30, 42, 49, 7, 11, 15, 21, 29, 36, 47, 53, - 12, 16, 20, 27, 34, 43, 52, 57, 18, 23, 28, 35, 41, 48, 56, 60, - 25, 32, 39, 45, 50, 55, 59, 62, 33, 40, 46, 51, 54, 58, 61, 63, -}; - -DECLARE_ALIGNED(16, static const int16_t, vp9_col_iscan_16x16[256]) = { - 0, 4, 11, 20, 31, 43, 59, 75, 85, 109, 130, 150, 165, 181, 195, 198, - 1, 6, 14, 23, 34, 47, 64, 81, 95, 114, 135, 153, 171, 188, 201, 212, - 2, 8, 16, 25, 38, 52, 67, 83, 101, 116, 136, 157, 172, 190, 205, 216, - 3, 10, 18, 29, 41, 55, 71, 89, 103, 119, 141, 159, 176, 194, 208, 218, - 5, 12, 21, 32, 45, 58, 74, 93, 104, 123, 144, 164, 179, 196, 210, 223, - 7, 15, 26, 37, 49, 63, 78, 96, 112, 129, 146, 166, 182, 200, 215, 228, - 9, 19, 28, 39, 54, 69, 86, 102, 117, 132, 151, 170, 187, 206, 220, 230, - 13, 24, 35, 46, 60, 73, 91, 108, 122, 137, 154, 174, 189, 207, 224, 235, - 17, 30, 40, 53, 66, 82, 98, 115, 126, 142, 161, 180, 197, 213, 227, 237, - 22, 36, 48, 62, 76, 92, 105, 120, 133, 147, 167, 186, 203, 219, 232, 240, - 27, 44, 56, 70, 84, 99, 113, 127, 140, 156, 175, 193, 209, 226, 236, 244, - 33, 51, 68, 79, 94, 110, 125, 138, 149, 162, 184, 202, 217, 229, 241, 247, - 42, 61, 77, 90, 106, 121, 134, 148, 160, 173, 191, 211, 225, 238, 245, 251, - 50, 72, 87, 100, 118, 128, 145, 158, 168, 183, 204, 222, 233, 242, 249, 253, - 57, 80, 97, 111, 131, 143, 155, 169, 178, 192, 214, 231, 239, 246, 250, 254, - 65, 88, 107, 124, 139, 152, 163, 177, 185, 199, 221, 234, 243, 248, 252, 255, -}; - -DECLARE_ALIGNED(16, static const int16_t, vp9_row_iscan_16x16[256]) = { - 0, 1, 2, 4, 6, 9, 12, 17, 22, 29, 36, 43, 54, 64, 76, 86, - 3, 5, 7, 11, 15, 19, 25, 32, 38, 48, 59, 68, 84, 99, 115, 130, - 8, 10, 13, 18, 23, 27, 33, 42, 51, 60, 72, 88, 103, 119, 142, 167, - 14, 16, 20, 26, 31, 37, 44, 53, 61, 73, 85, 100, 116, 135, 161, 185, - 21, 24, 30, 35, 40, 47, 55, 65, 74, 81, 94, 112, 133, 154, 179, 205, - 28, 34, 39, 45, 50, 58, 67, 77, 87, 96, 106, 121, 146, 169, 196, 212, - 41, 46, 49, 56, 63, 70, 79, 90, 98, 107, 122, 138, 159, 182, 207, 222, - 52, 57, 62, 69, 75, 83, 93, 102, 110, 120, 134, 150, 176, 195, 215, 226, - 66, 71, 78, 82, 91, 97, 108, 113, 127, 136, 148, 168, 188, 202, 221, 232, - 80, 89, 92, 101, 105, 114, 125, 131, 139, 151, 162, 177, 192, 208, 223, 234, - 95, 104, 109, 117, 123, 128, 143, 144, 155, 165, 175, 190, 206, 219, 233, 239, - 111, 118, 124, 129, 140, 147, 157, 164, 170, 181, 191, 203, 224, 230, 240, - 243, 126, 132, 137, 145, 153, 160, 174, 178, 184, 197, 204, 216, 231, 237, - 244, 246, 141, 149, 156, 166, 172, 180, 189, 199, 200, 210, 220, 228, 238, - 242, 249, 251, 152, 163, 171, 183, 186, 193, 201, 211, 214, 218, 227, 236, - 245, 247, 252, 253, 158, 173, 187, 194, 198, 209, 213, 217, 225, 229, 235, - 241, 248, 250, 254, 255, -}; - -DECLARE_ALIGNED(16, static const int16_t, vp9_default_iscan_16x16[256]) = { - 0, 2, 5, 9, 17, 24, 36, 44, 55, 72, 88, 104, 128, 143, 166, 179, - 1, 4, 8, 13, 20, 30, 40, 54, 66, 79, 96, 113, 141, 154, 178, 196, - 3, 7, 11, 18, 25, 33, 46, 57, 71, 86, 101, 119, 148, 164, 186, 201, - 6, 12, 16, 23, 31, 39, 53, 64, 78, 92, 110, 127, 153, 169, 193, 208, - 10, 14, 19, 28, 37, 47, 58, 67, 84, 98, 114, 133, 161, 176, 198, 214, - 15, 21, 26, 34, 43, 52, 65, 77, 91, 106, 120, 140, 165, 185, 205, 221, - 22, 27, 32, 41, 48, 60, 73, 85, 99, 116, 130, 151, 175, 190, 211, 225, - 29, 35, 42, 49, 59, 69, 81, 95, 108, 125, 139, 155, 182, 197, 217, 229, - 38, 45, 51, 61, 68, 80, 93, 105, 118, 134, 150, 168, 191, 207, 223, 234, - 50, 56, 63, 74, 83, 94, 109, 117, 129, 147, 163, 177, 199, 213, 228, 238, - 62, 70, 76, 87, 97, 107, 122, 131, 145, 159, 172, 188, 210, 222, 235, 242, - 75, 82, 90, 102, 112, 124, 138, 146, 157, 173, 187, 202, 219, 230, 240, 245, - 89, 100, 111, 123, 132, 142, 156, 167, 180, 189, 203, 216, 231, 237, 246, 250, - 103, 115, 126, 136, 149, 162, 171, 183, 194, 204, 215, 224, 236, 241, 248, - 252, 121, 135, 144, 158, 170, 181, 192, 200, 209, 218, 227, 233, 243, 244, - 251, 254, 137, 152, 160, 174, 184, 195, 206, 212, 220, 226, 232, 239, 247, - 249, 253, 255, -}; - -DECLARE_ALIGNED(16, static const int16_t, vp9_default_iscan_32x32[1024]) = { - 0, 2, 5, 10, 17, 25, 38, 47, 62, 83, 101, 121, 145, 170, 193, 204, - 210, 219, 229, 233, 245, 257, 275, 299, 342, 356, 377, 405, 455, 471, 495, - 527, 1, 4, 8, 15, 22, 30, 45, 58, 74, 92, 112, 133, 158, 184, 203, 215, 222, - 228, 234, 237, 256, 274, 298, 317, 355, 376, 404, 426, 470, 494, 526, 551, - 3, 7, 12, 18, 28, 36, 52, 64, 82, 102, 118, 142, 164, 189, 208, 217, 224, - 231, 235, 238, 273, 297, 316, 329, 375, 403, 425, 440, 493, 525, 550, 567, - 6, 11, 16, 23, 31, 43, 60, 73, 90, 109, 126, 150, 173, 196, 211, 220, 226, - 232, 236, 239, 296, 315, 328, 335, 402, 424, 439, 447, 524, 549, 566, 575, - 9, 14, 19, 29, 37, 50, 65, 78, 95, 116, 134, 157, 179, 201, 214, 223, 244, - 255, 272, 295, 341, 354, 374, 401, 454, 469, 492, 523, 582, 596, 617, 645, - 13, 20, 26, 35, 44, 54, 72, 85, 105, 123, 140, 163, 182, 205, 216, 225, - 254, 271, 294, 314, 353, 373, 400, 423, 468, 491, 522, 548, 595, 616, 644, - 666, 21, 27, 33, 42, 53, 63, 80, 94, 113, 132, 151, 172, 190, 209, 218, 227, - 270, 293, 313, 327, 372, 399, 422, 438, 490, 521, 547, 565, 615, 643, 665, - 680, 24, 32, 39, 48, 57, 71, 88, 104, 120, 139, 159, 178, 197, 212, 221, 230, - 292, 312, 326, 334, 398, 421, 437, 446, 520, 546, 564, 574, 642, 664, 679, - 687, 34, 40, 46, 56, 68, 81, 96, 111, 130, 147, 167, 186, 243, 253, 269, 291, - 340, 352, 371, 397, 453, 467, 489, 519, 581, 594, 614, 641, 693, 705, 723, - 747, 41, 49, 55, 67, 77, 91, 107, 124, 138, 161, 177, 194, 252, 268, 290, - 311, 351, 370, 396, 420, 466, 488, 518, 545, 593, 613, 640, 663, 704, 722, - 746, 765, 51, 59, 66, 76, 89, 99, 119, 131, 149, 168, 181, 200, 267, 289, - 310, 325, 369, 395, 419, 436, 487, 517, 544, 563, 612, 639, 662, 678, 721, - 745, 764, 777, 61, 69, 75, 87, 100, 114, 129, 144, 162, 180, 191, 207, 288, - 309, 324, 333, 394, 418, 435, 445, 516, 543, 562, 573, 638, 661, 677, 686, - 744, 763, 776, 783, 70, 79, 86, 97, 108, 122, 137, 155, 242, 251, 266, 287, - 339, 350, 368, 393, 452, 465, 486, 515, 580, 592, 611, 637, 692, 703, 720, - 743, 788, 798, 813, 833, 84, 93, 103, 110, 125, 141, 154, 171, 250, 265, 286, - 308, 349, 367, 392, 417, 464, 485, 514, 542, 591, 610, 636, 660, 702, 719, - 742, 762, 797, 812, 832, 848, 98, 106, 115, 127, 143, 156, 169, 185, 264, - 285, 307, 323, 366, 391, 416, 434, 484, 513, 541, 561, 609, 635, 659, 676, - 718, 741, 761, 775, 811, 831, 847, 858, 117, 128, 136, 148, 160, 175, 188, - 198, 284, 306, 322, 332, 390, 415, 433, 444, 512, 540, 560, 572, 634, 658, - 675, 685, 740, 760, 774, 782, 830, 846, 857, 863, 135, 146, 152, 165, 241, - 249, 263, 283, 338, 348, 365, 389, 451, 463, 483, 511, 579, 590, 608, 633, - 691, 701, 717, 739, 787, 796, 810, 829, 867, 875, 887, 903, 153, 166, 174, - 183, 248, 262, 282, 305, 347, 364, 388, 414, 462, 482, 510, 539, 589, 607, - 632, 657, 700, 716, 738, 759, 795, 809, 828, 845, 874, 886, 902, 915, 176, - 187, 195, 202, 261, 281, 304, 321, 363, 387, 413, 432, 481, 509, 538, 559, - 606, 631, 656, 674, 715, 737, 758, 773, 808, 827, 844, 856, 885, 901, 914, - 923, 192, 199, 206, 213, 280, 303, 320, 331, 386, 412, 431, 443, 508, 537, - 558, 571, 630, 655, 673, 684, 736, 757, 772, 781, 826, 843, 855, 862, 900, - 913, 922, 927, 240, 247, 260, 279, 337, 346, 362, 385, 450, 461, 480, 507, - 578, 588, 605, 629, 690, 699, 714, 735, 786, 794, 807, 825, 866, 873, 884, - 899, 930, 936, 945, 957, 246, 259, 278, 302, 345, 361, 384, 411, 460, 479, - 506, 536, 587, 604, 628, 654, 698, 713, 734, 756, 793, 806, 824, 842, 872, - 883, 898, 912, 935, 944, 956, 966, 258, 277, 301, 319, 360, 383, 410, 430, - 478, 505, 535, 557, 603, 627, 653, 672, 712, 733, 755, 771, 805, 823, 841, - 854, 882, 897, 911, 921, 943, 955, 965, 972, 276, 300, 318, 330, 382, 409, - 429, 442, 504, 534, 556, 570, 626, 652, 671, 683, 732, 754, 770, 780, 822, - 840, 853, 861, 896, 910, 920, 926, 954, 964, 971, 975, 336, 344, 359, 381, - 449, 459, 477, 503, 577, 586, 602, 625, 689, 697, 711, 731, 785, 792, 804, - 821, 865, 871, 881, 895, 929, 934, 942, 953, 977, 981, 987, 995, 343, 358, - 380, 408, 458, 476, 502, 533, 585, 601, 624, 651, 696, 710, 730, 753, 791, - 803, 820, 839, 870, 880, 894, 909, 933, 941, 952, 963, 980, 986, 994, 1001, - 357, 379, 407, 428, 475, 501, 532, 555, 600, 623, 650, 670, 709, 729, 752, - 769, 802, 819, 838, 852, 879, 893, 908, 919, 940, 951, 962, 970, 985, 993, - 1000, 1005, 378, 406, 427, 441, 500, 531, 554, 569, 622, 649, 669, 682, 728, - 751, 768, 779, 818, 837, 851, 860, 892, 907, 918, 925, 950, 961, 969, 974, - 992, 999, 1004, 1007, 448, 457, 474, 499, 576, 584, 599, 621, 688, 695, 708, - 727, 784, 790, 801, 817, 864, 869, 878, 891, 928, 932, 939, 949, 976, 979, - 984, 991, 1008, 1010, 1013, 1017, 456, 473, 498, 530, 583, 598, 620, 648, - 694, 707, 726, 750, 789, 800, 816, 836, 868, 877, 890, 906, 931, 938, 948, - 960, 978, 983, 990, 998, 1009, 1012, 1016, 1020, 472, 497, 529, 553, 597, - 619, 647, 668, 706, 725, 749, 767, 799, 815, 835, 850, 876, 889, 905, 917, - 937, 947, 959, 968, 982, 989, 997, 1003, 1011, 1015, 1019, 1022, 496, 528, - 552, 568, 618, 646, 667, 681, 724, 748, 766, 778, 814, 834, 849, 859, 888, - 904, 916, 924, 946, 958, 967, 973, 988, 996, 1002, 1006, 1014, 1018, 1021, - 1023, -}; - -const scan_order vp9_default_scan_orders[TX_SIZES] = { - {default_scan_4x4, vp9_default_iscan_4x4, default_scan_4x4_neighbors}, - {default_scan_8x8, vp9_default_iscan_8x8, default_scan_8x8_neighbors}, - {default_scan_16x16, vp9_default_iscan_16x16, default_scan_16x16_neighbors}, - {default_scan_32x32, vp9_default_iscan_32x32, default_scan_32x32_neighbors}, -}; - -const scan_order vp9_scan_orders[TX_SIZES][TX_TYPES] = { - { // TX_4X4 - {default_scan_4x4, vp9_default_iscan_4x4, default_scan_4x4_neighbors}, - {row_scan_4x4, vp9_row_iscan_4x4, row_scan_4x4_neighbors}, - {col_scan_4x4, vp9_col_iscan_4x4, col_scan_4x4_neighbors}, - {default_scan_4x4, vp9_default_iscan_4x4, default_scan_4x4_neighbors} - }, { // TX_8X8 - {default_scan_8x8, vp9_default_iscan_8x8, default_scan_8x8_neighbors}, - {row_scan_8x8, vp9_row_iscan_8x8, row_scan_8x8_neighbors}, - {col_scan_8x8, vp9_col_iscan_8x8, col_scan_8x8_neighbors}, - {default_scan_8x8, vp9_default_iscan_8x8, default_scan_8x8_neighbors} - }, { // TX_16X16 - {default_scan_16x16, vp9_default_iscan_16x16, default_scan_16x16_neighbors}, - {row_scan_16x16, vp9_row_iscan_16x16, row_scan_16x16_neighbors}, - {col_scan_16x16, vp9_col_iscan_16x16, col_scan_16x16_neighbors}, - {default_scan_16x16, vp9_default_iscan_16x16, default_scan_16x16_neighbors} - }, { // TX_32X32 - {default_scan_32x32, vp9_default_iscan_32x32, default_scan_32x32_neighbors}, - {default_scan_32x32, vp9_default_iscan_32x32, default_scan_32x32_neighbors}, - {default_scan_32x32, vp9_default_iscan_32x32, default_scan_32x32_neighbors}, - {default_scan_32x32, vp9_default_iscan_32x32, default_scan_32x32_neighbors}, - } -}; diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_scan.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_scan.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_scan.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_scan.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_SCAN_H_ -#define VP9_COMMON_VP9_SCAN_H_ - -#include "vpx/vpx_integer.h" -#include "vpx_ports/mem.h" - -#include "vp9/common/vp9_enums.h" -#include "vp9/common/vp9_blockd.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define MAX_NEIGHBORS 2 - -typedef struct { - const int16_t *scan; - const int16_t *iscan; - const int16_t *neighbors; -} scan_order; - -extern const scan_order vp9_default_scan_orders[TX_SIZES]; -extern const scan_order vp9_scan_orders[TX_SIZES][TX_TYPES]; - -static INLINE int get_coef_context(const int16_t *neighbors, - const uint8_t *token_cache, int c) { - return (1 + token_cache[neighbors[MAX_NEIGHBORS * c + 0]] + - token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >> 1; -} - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_SCAN_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_seg_common.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_seg_common.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_seg_common.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_seg_common.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "vp9/common/vp9_blockd.h" -#include "vp9/common/vp9_loopfilter.h" -#include "vp9/common/vp9_seg_common.h" -#include "vp9/common/vp9_quant_common.h" - -static const int seg_feature_data_signed[SEG_LVL_MAX] = { 1, 1, 0, 0 }; - -static const int seg_feature_data_max[SEG_LVL_MAX] = { - MAXQ, MAX_LOOP_FILTER, 3, 0 }; - -// These functions provide access to new segment level features. -// Eventually these function may be "optimized out" but for the moment, -// the coding mechanism is still subject to change so these provide a -// convenient single point of change. - -int vp9_segfeature_active(const struct segmentation *seg, int segment_id, - SEG_LVL_FEATURES feature_id) { - return seg->enabled && - (seg->feature_mask[segment_id] & (1 << feature_id)); -} - -void vp9_clearall_segfeatures(struct segmentation *seg) { - vp9_zero(seg->feature_data); - vp9_zero(seg->feature_mask); -} - -void vp9_enable_segfeature(struct segmentation *seg, int segment_id, - SEG_LVL_FEATURES feature_id) { - seg->feature_mask[segment_id] |= 1 << feature_id; -} - -int vp9_seg_feature_data_max(SEG_LVL_FEATURES feature_id) { - return seg_feature_data_max[feature_id]; -} - -int vp9_is_segfeature_signed(SEG_LVL_FEATURES feature_id) { - return seg_feature_data_signed[feature_id]; -} - -void vp9_set_segdata(struct segmentation *seg, int segment_id, - SEG_LVL_FEATURES feature_id, int seg_data) { - assert(seg_data <= seg_feature_data_max[feature_id]); - if (seg_data < 0) { - assert(seg_feature_data_signed[feature_id]); - assert(-seg_data <= seg_feature_data_max[feature_id]); - } - - seg->feature_data[segment_id][feature_id] = seg_data; -} - -int vp9_get_segdata(const struct segmentation *seg, int segment_id, - SEG_LVL_FEATURES feature_id) { - return seg->feature_data[segment_id][feature_id]; -} - - -const vp9_tree_index vp9_segment_tree[TREE_SIZE(MAX_SEGMENTS)] = { - 2, 4, 6, 8, 10, 12, - 0, -1, -2, -3, -4, -5, -6, -7 -}; - - -// TBD? Functions to read and write segment data with range / validity checking diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_seg_common.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_seg_common.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_seg_common.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_seg_common.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_SEG_COMMON_H_ -#define VP9_COMMON_VP9_SEG_COMMON_H_ - -#include "vp9/common/vp9_prob.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define SEGMENT_DELTADATA 0 -#define SEGMENT_ABSDATA 1 - -#define MAX_SEGMENTS 8 -#define SEG_TREE_PROBS (MAX_SEGMENTS-1) - -#define PREDICTION_PROBS 3 - -// Segment level features. -typedef enum { - SEG_LVL_ALT_Q = 0, // Use alternate Quantizer .... - SEG_LVL_ALT_LF = 1, // Use alternate loop filter value... - SEG_LVL_REF_FRAME = 2, // Optional Segment reference frame - SEG_LVL_SKIP = 3, // Optional Segment (0,0) + skip mode - SEG_LVL_MAX = 4 // Number of features supported -} SEG_LVL_FEATURES; - - -struct segmentation { - uint8_t enabled; - uint8_t update_map; - uint8_t update_data; - uint8_t abs_delta; - uint8_t temporal_update; - - vp9_prob tree_probs[SEG_TREE_PROBS]; - vp9_prob pred_probs[PREDICTION_PROBS]; - - int16_t feature_data[MAX_SEGMENTS][SEG_LVL_MAX]; - unsigned int feature_mask[MAX_SEGMENTS]; -}; - -int vp9_segfeature_active(const struct segmentation *seg, - int segment_id, - SEG_LVL_FEATURES feature_id); - -void vp9_clearall_segfeatures(struct segmentation *seg); - -void vp9_enable_segfeature(struct segmentation *seg, - int segment_id, - SEG_LVL_FEATURES feature_id); - -int vp9_seg_feature_data_max(SEG_LVL_FEATURES feature_id); - -int vp9_is_segfeature_signed(SEG_LVL_FEATURES feature_id); - -void vp9_set_segdata(struct segmentation *seg, - int segment_id, - SEG_LVL_FEATURES feature_id, - int seg_data); - -int vp9_get_segdata(const struct segmentation *seg, - int segment_id, - SEG_LVL_FEATURES feature_id); - -extern const vp9_tree_index vp9_segment_tree[TREE_SIZE(MAX_SEGMENTS)]; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_SEG_COMMON_H_ - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_systemdependent.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_systemdependent.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_systemdependent.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_systemdependent.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_SYSTEMDEPENDENT_H_ -#define VP9_COMMON_VP9_SYSTEMDEPENDENT_H_ - -#ifdef _MSC_VER -# include // the ceil() definition must precede intrin.h -# if _MSC_VER > 1310 && (defined(_M_X64) || defined(_M_IX86)) -# include -# define USE_MSC_INTRIN -# endif -# define snprintf _snprintf -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#include "./vpx_config.h" -#if ARCH_X86 || ARCH_X86_64 -void vpx_reset_mmx_state(void); -#define vp9_clear_system_state() vpx_reset_mmx_state() -#else -#define vp9_clear_system_state() -#endif - -#if defined(_MSC_VER) && _MSC_VER < 1800 -// round is not defined in MSVC before VS2013. -static INLINE int round(double x) { - if (x < 0) - return (int)ceil(x - 0.5); - else - return (int)floor(x + 0.5); -} -#endif - -// use GNU builtins where available. -#if defined(__GNUC__) && \ - ((__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4) -static INLINE int get_msb(unsigned int n) { - return 31 ^ __builtin_clz(n); -} -#elif defined(USE_MSC_INTRIN) -#pragma intrinsic(_BitScanReverse) - -static INLINE int get_msb(unsigned int n) { - unsigned long first_set_bit; - _BitScanReverse(&first_set_bit, n); - return first_set_bit; -} -#undef USE_MSC_INTRIN -#else -// Returns (int)floor(log2(n)). n must be > 0. -static INLINE int get_msb(unsigned int n) { - int log = 0; - unsigned int value = n; - int i; - - for (i = 4; i >= 0; --i) { - const int shift = (1 << i); - const unsigned int x = value >> shift; - if (x != 0) { - value = x; - log += shift; - } - } - return log; -} -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_SYSTEMDEPENDENT_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_textblit.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_textblit.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_textblit.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_textblit.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "vp9/common/vp9_textblit.h" - -static const int font[] = { - 0x0, 0x5C00, 0x8020, 0xAFABEA, 0xD7EC0, 0x1111111, 0x1855740, 0x18000, - 0x45C0, 0x74400, 0x51140, 0x23880, 0xC4000, 0x21080, 0x80000, 0x111110, - 0xE9D72E, 0x87E40, 0x12AD732, 0xAAD62A, 0x4F94C4, 0x4D6B7, 0x456AA, - 0x3E8423, 0xAAD6AA, 0xAAD6A2, 0x2800, 0x2A00, 0x8A880, 0x52940, 0x22A20, - 0x15422, 0x6AD62E, 0x1E4A53E, 0xAAD6BF, 0x8C62E, 0xE8C63F, 0x118D6BF, - 0x1094BF, 0xCAC62E, 0x1F2109F, 0x118FE31, 0xF8C628, 0x8A89F, 0x108421F, - 0x1F1105F, 0x1F4105F, 0xE8C62E, 0x2294BF, 0x164C62E, 0x12694BF, 0x8AD6A2, - 0x10FC21, 0x1F8421F, 0x744107, 0xF8220F, 0x1151151, 0x117041, 0x119D731, - 0x47E0, 0x1041041, 0xFC400, 0x10440, 0x1084210, 0x820 -}; - -static void plot(int x, int y, unsigned char *image, int pitch) { - image[x + y * pitch] ^= 255; -} - -void vp9_blit_text(const char *msg, unsigned char *address, const int pitch) { - int letter_bitmap; - unsigned char *output_pos = address; - int colpos = 0; - - while (msg[colpos] != 0) { - char letter = msg[colpos]; - int fontcol, fontrow; - - if (letter <= 'Z' && letter >= ' ') - letter_bitmap = font[letter - ' ']; - else if (letter <= 'z' && letter >= 'a') - letter_bitmap = font[letter - 'a' + 'A' - ' ']; - else - letter_bitmap = font[0]; - - for (fontcol = 6; fontcol >= 0; fontcol--) - for (fontrow = 0; fontrow < 5; fontrow++) - output_pos[fontrow * pitch + fontcol] = - ((letter_bitmap >> (fontcol * 5)) & (1 << fontrow) ? 255 : 0); - - output_pos += 7; - colpos++; - } -} - - - -/* Bresenham line algorithm */ -void vp9_blit_line(int x0, int x1, int y0, int y1, unsigned char *image, - int pitch) { - int steep = abs(y1 - y0) > abs(x1 - x0); - int deltax, deltay; - int error, ystep, y, x; - - if (steep) { - int t; - t = x0; - x0 = y0; - y0 = t; - - t = x1; - x1 = y1; - y1 = t; - } - - if (x0 > x1) { - int t; - t = x0; - x0 = x1; - x1 = t; - - t = y0; - y0 = y1; - y1 = t; - } - - deltax = x1 - x0; - deltay = abs(y1 - y0); - error = deltax / 2; - - y = y0; - - if (y0 < y1) - ystep = 1; - else - ystep = -1; - - if (steep) { - for (x = x0; x <= x1; x++) { - plot(y, x, image, pitch); - - error = error - deltay; - if (error < 0) { - y = y + ystep; - error = error + deltax; - } - } - } else { - for (x = x0; x <= x1; x++) { - plot(x, y, image, pitch); - - error = error - deltay; - if (error < 0) { - y = y + ystep; - error = error + deltax; - } - } - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_textblit.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_textblit.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_textblit.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_textblit.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_TEXTBLIT_H_ -#define VP9_COMMON_VP9_TEXTBLIT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -void vp9_blit_text(const char *msg, unsigned char *address, int pitch); - -void vp9_blit_line(int x0, int x1, int y0, int y1, unsigned char *image, - int pitch); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_TEXTBLIT_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_thread.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_thread.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_thread.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_thread.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,184 +0,0 @@ -// Copyright 2013 Google Inc. All Rights Reserved. -// -// Use of this source code is governed by a BSD-style license -// that can be found in the COPYING file in the root of the source -// tree. An additional intellectual property rights grant can be found -// in the file PATENTS. All contributing project authors may -// be found in the AUTHORS file in the root of the source tree. -// ----------------------------------------------------------------------------- -// -// Multi-threaded worker -// -// Original source: -// http://git.chromium.org/webm/libwebp.git -// 100644 blob 264210ba2807e4da47eb5d18c04cf869d89b9784 src/utils/thread.c - -#include -#include // for memset() -#include "./vp9_thread.h" -#include "vpx_mem/vpx_mem.h" - -#if CONFIG_MULTITHREAD - -struct VP9WorkerImpl { - pthread_mutex_t mutex_; - pthread_cond_t condition_; - pthread_t thread_; -}; - -//------------------------------------------------------------------------------ - -static void execute(VP9Worker *const worker); // Forward declaration. - -static THREADFN thread_loop(void *ptr) { - VP9Worker *const worker = (VP9Worker*)ptr; - int done = 0; - while (!done) { - pthread_mutex_lock(&worker->impl_->mutex_); - while (worker->status_ == OK) { // wait in idling mode - pthread_cond_wait(&worker->impl_->condition_, &worker->impl_->mutex_); - } - if (worker->status_ == WORK) { - execute(worker); - worker->status_ = OK; - } else if (worker->status_ == NOT_OK) { // finish the worker - done = 1; - } - // signal to the main thread that we're done (for sync()) - pthread_cond_signal(&worker->impl_->condition_); - pthread_mutex_unlock(&worker->impl_->mutex_); - } - return THREAD_RETURN(NULL); // Thread is finished -} - -// main thread state control -static void change_state(VP9Worker *const worker, - VP9WorkerStatus new_status) { - // No-op when attempting to change state on a thread that didn't come up. - // Checking status_ without acquiring the lock first would result in a data - // race. - if (worker->impl_ == NULL) return; - - pthread_mutex_lock(&worker->impl_->mutex_); - if (worker->status_ >= OK) { - // wait for the worker to finish - while (worker->status_ != OK) { - pthread_cond_wait(&worker->impl_->condition_, &worker->impl_->mutex_); - } - // assign new status and release the working thread if needed - if (new_status != OK) { - worker->status_ = new_status; - pthread_cond_signal(&worker->impl_->condition_); - } - } - pthread_mutex_unlock(&worker->impl_->mutex_); -} - -#endif // CONFIG_MULTITHREAD - -//------------------------------------------------------------------------------ - -static void init(VP9Worker *const worker) { - memset(worker, 0, sizeof(*worker)); - worker->status_ = NOT_OK; -} - -static int sync(VP9Worker *const worker) { -#if CONFIG_MULTITHREAD - change_state(worker, OK); -#endif - assert(worker->status_ <= OK); - return !worker->had_error; -} - -static int reset(VP9Worker *const worker) { - int ok = 1; - worker->had_error = 0; - if (worker->status_ < OK) { -#if CONFIG_MULTITHREAD - worker->impl_ = (VP9WorkerImpl*)vpx_calloc(1, sizeof(*worker->impl_)); - if (worker->impl_ == NULL) { - return 0; - } - if (pthread_mutex_init(&worker->impl_->mutex_, NULL)) { - goto Error; - } - if (pthread_cond_init(&worker->impl_->condition_, NULL)) { - pthread_mutex_destroy(&worker->impl_->mutex_); - goto Error; - } - pthread_mutex_lock(&worker->impl_->mutex_); - ok = !pthread_create(&worker->impl_->thread_, NULL, thread_loop, worker); - if (ok) worker->status_ = OK; - pthread_mutex_unlock(&worker->impl_->mutex_); - if (!ok) { - pthread_mutex_destroy(&worker->impl_->mutex_); - pthread_cond_destroy(&worker->impl_->condition_); - Error: - vpx_free(worker->impl_); - worker->impl_ = NULL; - return 0; - } -#else - worker->status_ = OK; -#endif - } else if (worker->status_ > OK) { - ok = sync(worker); - } - assert(!ok || (worker->status_ == OK)); - return ok; -} - -static void execute(VP9Worker *const worker) { - if (worker->hook != NULL) { - worker->had_error |= !worker->hook(worker->data1, worker->data2); - } -} - -static void launch(VP9Worker *const worker) { -#if CONFIG_MULTITHREAD - change_state(worker, WORK); -#else - execute(worker); -#endif -} - -static void end(VP9Worker *const worker) { -#if CONFIG_MULTITHREAD - if (worker->impl_ != NULL) { - change_state(worker, NOT_OK); - pthread_join(worker->impl_->thread_, NULL); - pthread_mutex_destroy(&worker->impl_->mutex_); - pthread_cond_destroy(&worker->impl_->condition_); - vpx_free(worker->impl_); - worker->impl_ = NULL; - } -#else - worker->status_ = NOT_OK; - assert(worker->impl_ == NULL); -#endif - assert(worker->status_ == NOT_OK); -} - -//------------------------------------------------------------------------------ - -static VP9WorkerInterface g_worker_interface = { - init, reset, sync, launch, execute, end -}; - -int vp9_set_worker_interface(const VP9WorkerInterface* const winterface) { - if (winterface == NULL || - winterface->init == NULL || winterface->reset == NULL || - winterface->sync == NULL || winterface->launch == NULL || - winterface->execute == NULL || winterface->end == NULL) { - return 0; - } - g_worker_interface = *winterface; - return 1; -} - -const VP9WorkerInterface *vp9_get_worker_interface(void) { - return &g_worker_interface; -} - -//------------------------------------------------------------------------------ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_thread_common.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_thread_common.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_thread_common.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_thread_common.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,421 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "./vpx_config.h" -#include "vpx_mem/vpx_mem.h" -#include "vp9/common/vp9_entropymode.h" -#include "vp9/common/vp9_thread_common.h" -#include "vp9/common/vp9_reconinter.h" - -#if CONFIG_MULTITHREAD -static INLINE void mutex_lock(pthread_mutex_t *const mutex) { - const int kMaxTryLocks = 4000; - int locked = 0; - int i; - - for (i = 0; i < kMaxTryLocks; ++i) { - if (!pthread_mutex_trylock(mutex)) { - locked = 1; - break; - } - } - - if (!locked) - pthread_mutex_lock(mutex); -} -#endif // CONFIG_MULTITHREAD - -static INLINE void sync_read(VP9LfSync *const lf_sync, int r, int c) { -#if CONFIG_MULTITHREAD - const int nsync = lf_sync->sync_range; - - if (r && !(c & (nsync - 1))) { - pthread_mutex_t *const mutex = &lf_sync->mutex_[r - 1]; - mutex_lock(mutex); - - while (c > lf_sync->cur_sb_col[r - 1] - nsync) { - pthread_cond_wait(&lf_sync->cond_[r - 1], mutex); - } - pthread_mutex_unlock(mutex); - } -#else - (void)lf_sync; - (void)r; - (void)c; -#endif // CONFIG_MULTITHREAD -} - -static INLINE void sync_write(VP9LfSync *const lf_sync, int r, int c, - const int sb_cols) { -#if CONFIG_MULTITHREAD - const int nsync = lf_sync->sync_range; - int cur; - // Only signal when there are enough filtered SB for next row to run. - int sig = 1; - - if (c < sb_cols - 1) { - cur = c; - if (c % nsync) - sig = 0; - } else { - cur = sb_cols + nsync; - } - - if (sig) { - mutex_lock(&lf_sync->mutex_[r]); - - lf_sync->cur_sb_col[r] = cur; - - pthread_cond_signal(&lf_sync->cond_[r]); - pthread_mutex_unlock(&lf_sync->mutex_[r]); - } -#else - (void)lf_sync; - (void)r; - (void)c; - (void)sb_cols; -#endif // CONFIG_MULTITHREAD -} - -// Implement row loopfiltering for each thread. -static INLINE -void thread_loop_filter_rows(const YV12_BUFFER_CONFIG *const frame_buffer, - VP9_COMMON *const cm, - struct macroblockd_plane planes[MAX_MB_PLANE], - int start, int stop, int y_only, - VP9LfSync *const lf_sync) { - const int num_planes = y_only ? 1 : MAX_MB_PLANE; - const int use_420 = y_only || (planes[1].subsampling_y == 1 && - planes[1].subsampling_x == 1); - const int sb_cols = mi_cols_aligned_to_sb(cm->mi_cols) >> MI_BLOCK_SIZE_LOG2; - int mi_row, mi_col; - - for (mi_row = start; mi_row < stop; - mi_row += lf_sync->num_workers * MI_BLOCK_SIZE) { - MODE_INFO *const mi = cm->mi + mi_row * cm->mi_stride; - - for (mi_col = 0; mi_col < cm->mi_cols; mi_col += MI_BLOCK_SIZE) { - const int r = mi_row >> MI_BLOCK_SIZE_LOG2; - const int c = mi_col >> MI_BLOCK_SIZE_LOG2; - LOOP_FILTER_MASK lfm; - int plane; - - sync_read(lf_sync, r, c); - - vp9_setup_dst_planes(planes, frame_buffer, mi_row, mi_col); - - // TODO(JBB): Make setup_mask work for non 420. - if (use_420) - vp9_setup_mask(cm, mi_row, mi_col, mi + mi_col, cm->mi_stride, - &lfm); - - for (plane = 0; plane < num_planes; ++plane) { - if (use_420) - vp9_filter_block_plane(cm, &planes[plane], mi_row, &lfm); - else - vp9_filter_block_plane_non420(cm, &planes[plane], mi + mi_col, - mi_row, mi_col); - } - - sync_write(lf_sync, r, c, sb_cols); - } - } -} - -// Row-based multi-threaded loopfilter hook -static int loop_filter_row_worker(VP9LfSync *const lf_sync, - LFWorkerData *const lf_data) { - thread_loop_filter_rows(lf_data->frame_buffer, lf_data->cm, lf_data->planes, - lf_data->start, lf_data->stop, lf_data->y_only, - lf_sync); - return 1; -} - -static void loop_filter_rows_mt(YV12_BUFFER_CONFIG *frame, - VP9_COMMON *cm, - struct macroblockd_plane planes[MAX_MB_PLANE], - int start, int stop, int y_only, - VP9Worker *workers, int nworkers, - VP9LfSync *lf_sync) { - const VP9WorkerInterface *const winterface = vp9_get_worker_interface(); - // Number of superblock rows and cols - const int sb_rows = mi_cols_aligned_to_sb(cm->mi_rows) >> MI_BLOCK_SIZE_LOG2; - // Decoder may allocate more threads than number of tiles based on user's - // input. - const int tile_cols = 1 << cm->log2_tile_cols; - const int num_workers = MIN(nworkers, tile_cols); - int i; - - if (!lf_sync->sync_range || sb_rows != lf_sync->rows || - num_workers > lf_sync->num_workers) { - vp9_loop_filter_dealloc(lf_sync); - vp9_loop_filter_alloc(lf_sync, cm, sb_rows, cm->width, num_workers); - } - - // Initialize cur_sb_col to -1 for all SB rows. - vpx_memset(lf_sync->cur_sb_col, -1, sizeof(*lf_sync->cur_sb_col) * sb_rows); - - // Set up loopfilter thread data. - // The decoder is capping num_workers because it has been observed that using - // more threads on the loopfilter than there are cores will hurt performance - // on Android. This is because the system will only schedule the tile decode - // workers on cores equal to the number of tile columns. Then if the decoder - // tries to use more threads for the loopfilter, it will hurt performance - // because of contention. If the multithreading code changes in the future - // then the number of workers used by the loopfilter should be revisited. - for (i = 0; i < num_workers; ++i) { - VP9Worker *const worker = &workers[i]; - LFWorkerData *const lf_data = &lf_sync->lfdata[i]; - - worker->hook = (VP9WorkerHook)loop_filter_row_worker; - worker->data1 = lf_sync; - worker->data2 = lf_data; - - // Loopfilter data - vp9_loop_filter_data_reset(lf_data, frame, cm, planes); - lf_data->start = start + i * MI_BLOCK_SIZE; - lf_data->stop = stop; - lf_data->y_only = y_only; - - // Start loopfiltering - if (i == num_workers - 1) { - winterface->execute(worker); - } else { - winterface->launch(worker); - } - } - - // Wait till all rows are finished - for (i = 0; i < num_workers; ++i) { - winterface->sync(&workers[i]); - } -} - -void vp9_loop_filter_frame_mt(YV12_BUFFER_CONFIG *frame, - VP9_COMMON *cm, - struct macroblockd_plane planes[MAX_MB_PLANE], - int frame_filter_level, - int y_only, int partial_frame, - VP9Worker *workers, int num_workers, - VP9LfSync *lf_sync) { - int start_mi_row, end_mi_row, mi_rows_to_filter; - - if (!frame_filter_level) return; - - start_mi_row = 0; - mi_rows_to_filter = cm->mi_rows; - if (partial_frame && cm->mi_rows > 8) { - start_mi_row = cm->mi_rows >> 1; - start_mi_row &= 0xfffffff8; - mi_rows_to_filter = MAX(cm->mi_rows / 8, 8); - } - end_mi_row = start_mi_row + mi_rows_to_filter; - vp9_loop_filter_frame_init(cm, frame_filter_level); - - loop_filter_rows_mt(frame, cm, planes, start_mi_row, end_mi_row, - y_only, workers, num_workers, lf_sync); -} - -// Set up nsync by width. -static INLINE int get_sync_range(int width) { - // nsync numbers are picked by testing. For example, for 4k - // video, using 4 gives best performance. - if (width < 640) - return 1; - else if (width <= 1280) - return 2; - else if (width <= 4096) - return 4; - else - return 8; -} - -// Allocate memory for lf row synchronization -void vp9_loop_filter_alloc(VP9LfSync *lf_sync, VP9_COMMON *cm, int rows, - int width, int num_workers) { - lf_sync->rows = rows; -#if CONFIG_MULTITHREAD - { - int i; - - CHECK_MEM_ERROR(cm, lf_sync->mutex_, - vpx_malloc(sizeof(*lf_sync->mutex_) * rows)); - if (lf_sync->mutex_) { - for (i = 0; i < rows; ++i) { - pthread_mutex_init(&lf_sync->mutex_[i], NULL); - } - } - - CHECK_MEM_ERROR(cm, lf_sync->cond_, - vpx_malloc(sizeof(*lf_sync->cond_) * rows)); - if (lf_sync->cond_) { - for (i = 0; i < rows; ++i) { - pthread_cond_init(&lf_sync->cond_[i], NULL); - } - } - } -#endif // CONFIG_MULTITHREAD - - CHECK_MEM_ERROR(cm, lf_sync->lfdata, - vpx_malloc(num_workers * sizeof(*lf_sync->lfdata))); - lf_sync->num_workers = num_workers; - - CHECK_MEM_ERROR(cm, lf_sync->cur_sb_col, - vpx_malloc(sizeof(*lf_sync->cur_sb_col) * rows)); - - // Set up nsync. - lf_sync->sync_range = get_sync_range(width); -} - -// Deallocate lf synchronization related mutex and data -void vp9_loop_filter_dealloc(VP9LfSync *lf_sync) { - if (lf_sync != NULL) { -#if CONFIG_MULTITHREAD - int i; - - if (lf_sync->mutex_ != NULL) { - for (i = 0; i < lf_sync->rows; ++i) { - pthread_mutex_destroy(&lf_sync->mutex_[i]); - } - vpx_free(lf_sync->mutex_); - } - if (lf_sync->cond_ != NULL) { - for (i = 0; i < lf_sync->rows; ++i) { - pthread_cond_destroy(&lf_sync->cond_[i]); - } - vpx_free(lf_sync->cond_); - } -#endif // CONFIG_MULTITHREAD - vpx_free(lf_sync->lfdata); - vpx_free(lf_sync->cur_sb_col); - // clear the structure as the source of this call may be a resize in which - // case this call will be followed by an _alloc() which may fail. - vp9_zero(*lf_sync); - } -} - -// Accumulate frame counts. -void vp9_accumulate_frame_counts(VP9_COMMON *cm, FRAME_COUNTS *counts, - int is_dec) { - int i, j, k, l, m; - - for (i = 0; i < BLOCK_SIZE_GROUPS; i++) - for (j = 0; j < INTRA_MODES; j++) - cm->counts.y_mode[i][j] += counts->y_mode[i][j]; - - for (i = 0; i < INTRA_MODES; i++) - for (j = 0; j < INTRA_MODES; j++) - cm->counts.uv_mode[i][j] += counts->uv_mode[i][j]; - - for (i = 0; i < PARTITION_CONTEXTS; i++) - for (j = 0; j < PARTITION_TYPES; j++) - cm->counts.partition[i][j] += counts->partition[i][j]; - - if (is_dec) { - int n; - for (i = 0; i < TX_SIZES; i++) - for (j = 0; j < PLANE_TYPES; j++) - for (k = 0; k < REF_TYPES; k++) - for (l = 0; l < COEF_BANDS; l++) - for (m = 0; m < COEFF_CONTEXTS; m++) { - cm->counts.eob_branch[i][j][k][l][m] += - counts->eob_branch[i][j][k][l][m]; - for (n = 0; n < UNCONSTRAINED_NODES + 1; n++) - cm->counts.coef[i][j][k][l][m][n] += - counts->coef[i][j][k][l][m][n]; - } - } else { - for (i = 0; i < TX_SIZES; i++) - for (j = 0; j < PLANE_TYPES; j++) - for (k = 0; k < REF_TYPES; k++) - for (l = 0; l < COEF_BANDS; l++) - for (m = 0; m < COEFF_CONTEXTS; m++) - cm->counts.eob_branch[i][j][k][l][m] += - counts->eob_branch[i][j][k][l][m]; - // In the encoder, cm->counts.coef is only updated at frame - // level, so not need to accumulate it here. - // for (n = 0; n < UNCONSTRAINED_NODES + 1; n++) - // cm->counts.coef[i][j][k][l][m][n] += - // counts->coef[i][j][k][l][m][n]; - } - - for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) - for (j = 0; j < SWITCHABLE_FILTERS; j++) - cm->counts.switchable_interp[i][j] += counts->switchable_interp[i][j]; - - for (i = 0; i < INTER_MODE_CONTEXTS; i++) - for (j = 0; j < INTER_MODES; j++) - cm->counts.inter_mode[i][j] += counts->inter_mode[i][j]; - - for (i = 0; i < INTRA_INTER_CONTEXTS; i++) - for (j = 0; j < 2; j++) - cm->counts.intra_inter[i][j] += counts->intra_inter[i][j]; - - for (i = 0; i < COMP_INTER_CONTEXTS; i++) - for (j = 0; j < 2; j++) - cm->counts.comp_inter[i][j] += counts->comp_inter[i][j]; - - for (i = 0; i < REF_CONTEXTS; i++) - for (j = 0; j < 2; j++) - for (k = 0; k < 2; k++) - cm->counts.single_ref[i][j][k] += counts->single_ref[i][j][k]; - - for (i = 0; i < REF_CONTEXTS; i++) - for (j = 0; j < 2; j++) - cm->counts.comp_ref[i][j] += counts->comp_ref[i][j]; - - for (i = 0; i < TX_SIZE_CONTEXTS; i++) { - for (j = 0; j < TX_SIZES; j++) - cm->counts.tx.p32x32[i][j] += counts->tx.p32x32[i][j]; - - for (j = 0; j < TX_SIZES - 1; j++) - cm->counts.tx.p16x16[i][j] += counts->tx.p16x16[i][j]; - - for (j = 0; j < TX_SIZES - 2; j++) - cm->counts.tx.p8x8[i][j] += counts->tx.p8x8[i][j]; - } - - for (i = 0; i < TX_SIZES; i++) - cm->counts.tx.tx_totals[i] += counts->tx.tx_totals[i]; - - for (i = 0; i < SKIP_CONTEXTS; i++) - for (j = 0; j < 2; j++) - cm->counts.skip[i][j] += counts->skip[i][j]; - - for (i = 0; i < MV_JOINTS; i++) - cm->counts.mv.joints[i] += counts->mv.joints[i]; - - for (k = 0; k < 2; k++) { - nmv_component_counts *comps = &cm->counts.mv.comps[k]; - nmv_component_counts *comps_t = &counts->mv.comps[k]; - - for (i = 0; i < 2; i++) { - comps->sign[i] += comps_t->sign[i]; - comps->class0_hp[i] += comps_t->class0_hp[i]; - comps->hp[i] += comps_t->hp[i]; - } - - for (i = 0; i < MV_CLASSES; i++) - comps->classes[i] += comps_t->classes[i]; - - for (i = 0; i < CLASS0_SIZE; i++) { - comps->class0[i] += comps_t->class0[i]; - for (j = 0; j < MV_FP_SIZE; j++) - comps->class0_fp[i][j] += comps_t->class0_fp[i][j]; - } - - for (i = 0; i < MV_OFFSET_BITS; i++) - for (j = 0; j < 2; j++) - comps->bits[i][j] += comps_t->bits[i][j]; - - for (i = 0; i < MV_FP_SIZE; i++) - comps->fp[i] += comps_t->fp[i]; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_thread_common.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_thread_common.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_thread_common.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_thread_common.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_LOOPFILTER_THREAD_H_ -#define VP9_COMMON_VP9_LOOPFILTER_THREAD_H_ -#include "./vpx_config.h" -#include "vp9/common/vp9_loopfilter.h" -#include "vp9/common/vp9_thread.h" - -struct VP9Common; -struct FRAME_COUNTS; - -// Loopfilter row synchronization -typedef struct VP9LfSyncData { -#if CONFIG_MULTITHREAD - pthread_mutex_t *mutex_; - pthread_cond_t *cond_; -#endif - // Allocate memory to store the loop-filtered superblock index in each row. - int *cur_sb_col; - // The optimal sync_range for different resolution and platform should be - // determined by testing. Currently, it is chosen to be a power-of-2 number. - int sync_range; - int rows; - - // Row-based parallel loopfilter data - LFWorkerData *lfdata; - int num_workers; -} VP9LfSync; - -// Allocate memory for loopfilter row synchronization. -void vp9_loop_filter_alloc(VP9LfSync *lf_sync, struct VP9Common *cm, int rows, - int width, int num_workers); - -// Deallocate loopfilter synchronization related mutex and data. -void vp9_loop_filter_dealloc(VP9LfSync *lf_sync); - -// Multi-threaded loopfilter that uses the tile threads. -void vp9_loop_filter_frame_mt(YV12_BUFFER_CONFIG *frame, - struct VP9Common *cm, - struct macroblockd_plane planes[MAX_MB_PLANE], - int frame_filter_level, - int y_only, int partial_frame, - VP9Worker *workers, int num_workers, - VP9LfSync *lf_sync); - -void vp9_accumulate_frame_counts(struct VP9Common *cm, - struct FRAME_COUNTS *counts, int is_dec); - -#endif // VP9_COMMON_VP9_LOOPFILTER_THREAD_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_thread.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_thread.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_thread.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_thread.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,223 +0,0 @@ -// Copyright 2013 Google Inc. All Rights Reserved. -// -// Use of this source code is governed by a BSD-style license -// that can be found in the COPYING file in the root of the source -// tree. An additional intellectual property rights grant can be found -// in the file PATENTS. All contributing project authors may -// be found in the AUTHORS file in the root of the source tree. -// ----------------------------------------------------------------------------- -// -// Multi-threaded worker -// -// Original source: -// http://git.chromium.org/webm/libwebp.git -// 100644 blob 7bd451b124ae3b81596abfbcc823e3cb129d3a38 src/utils/thread.h - -#ifndef VP9_DECODER_VP9_THREAD_H_ -#define VP9_DECODER_VP9_THREAD_H_ - -#include "./vpx_config.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// Set maximum decode threads to be 8 due to the limit of frame buffers -// and not enough semaphores in the emulation layer on windows. -#define MAX_DECODE_THREADS 8 - -#if CONFIG_MULTITHREAD - -#if defined(_WIN32) && !HAVE_PTHREAD_H -#include // NOLINT -#include // NOLINT -#include // NOLINT -typedef HANDLE pthread_t; -typedef CRITICAL_SECTION pthread_mutex_t; -typedef struct { - HANDLE waiting_sem_; - HANDLE received_sem_; - HANDLE signal_event_; -} pthread_cond_t; - -//------------------------------------------------------------------------------ -// simplistic pthread emulation layer - -// _beginthreadex requires __stdcall -#define THREADFN unsigned int __stdcall -#define THREAD_RETURN(val) (unsigned int)((DWORD_PTR)val) - -static INLINE int pthread_create(pthread_t* const thread, const void* attr, - unsigned int (__stdcall *start)(void*), - void* arg) { - (void)attr; - *thread = (pthread_t)_beginthreadex(NULL, /* void *security */ - 0, /* unsigned stack_size */ - start, - arg, - 0, /* unsigned initflag */ - NULL); /* unsigned *thrdaddr */ - if (*thread == NULL) return 1; - SetThreadPriority(*thread, THREAD_PRIORITY_ABOVE_NORMAL); - return 0; -} - -static INLINE int pthread_join(pthread_t thread, void** value_ptr) { - (void)value_ptr; - return (WaitForSingleObject(thread, INFINITE) != WAIT_OBJECT_0 || - CloseHandle(thread) == 0); -} - -// Mutex -static INLINE int pthread_mutex_init(pthread_mutex_t *const mutex, - void* mutexattr) { - (void)mutexattr; - InitializeCriticalSection(mutex); - return 0; -} - -static INLINE int pthread_mutex_trylock(pthread_mutex_t *const mutex) { - return TryEnterCriticalSection(mutex) ? 0 : EBUSY; -} - -static INLINE int pthread_mutex_lock(pthread_mutex_t *const mutex) { - EnterCriticalSection(mutex); - return 0; -} - -static INLINE int pthread_mutex_unlock(pthread_mutex_t *const mutex) { - LeaveCriticalSection(mutex); - return 0; -} - -static INLINE int pthread_mutex_destroy(pthread_mutex_t *const mutex) { - DeleteCriticalSection(mutex); - return 0; -} - -// Condition -static INLINE int pthread_cond_destroy(pthread_cond_t *const condition) { - int ok = 1; - ok &= (CloseHandle(condition->waiting_sem_) != 0); - ok &= (CloseHandle(condition->received_sem_) != 0); - ok &= (CloseHandle(condition->signal_event_) != 0); - return !ok; -} - -static INLINE int pthread_cond_init(pthread_cond_t *const condition, - void* cond_attr) { - (void)cond_attr; - condition->waiting_sem_ = CreateSemaphore(NULL, 0, MAX_DECODE_THREADS, NULL); - condition->received_sem_ = CreateSemaphore(NULL, 0, MAX_DECODE_THREADS, NULL); - condition->signal_event_ = CreateEvent(NULL, FALSE, FALSE, NULL); - if (condition->waiting_sem_ == NULL || - condition->received_sem_ == NULL || - condition->signal_event_ == NULL) { - pthread_cond_destroy(condition); - return 1; - } - return 0; -} - -static INLINE int pthread_cond_signal(pthread_cond_t *const condition) { - int ok = 1; - if (WaitForSingleObject(condition->waiting_sem_, 0) == WAIT_OBJECT_0) { - // a thread is waiting in pthread_cond_wait: allow it to be notified - ok = SetEvent(condition->signal_event_); - // wait until the event is consumed so the signaler cannot consume - // the event via its own pthread_cond_wait. - ok &= (WaitForSingleObject(condition->received_sem_, INFINITE) != - WAIT_OBJECT_0); - } - return !ok; -} - -static INLINE int pthread_cond_wait(pthread_cond_t *const condition, - pthread_mutex_t *const mutex) { - int ok; - // note that there is a consumer available so the signal isn't dropped in - // pthread_cond_signal - if (!ReleaseSemaphore(condition->waiting_sem_, 1, NULL)) - return 1; - // now unlock the mutex so pthread_cond_signal may be issued - pthread_mutex_unlock(mutex); - ok = (WaitForSingleObject(condition->signal_event_, INFINITE) == - WAIT_OBJECT_0); - ok &= ReleaseSemaphore(condition->received_sem_, 1, NULL); - pthread_mutex_lock(mutex); - return !ok; -} -#else // _WIN32 -#include // NOLINT -# define THREADFN void* -# define THREAD_RETURN(val) val -#endif - -#endif // CONFIG_MULTITHREAD - -// State of the worker thread object -typedef enum { - NOT_OK = 0, // object is unusable - OK, // ready to work - WORK // busy finishing the current task -} VP9WorkerStatus; - -// Function to be called by the worker thread. Takes two opaque pointers as -// arguments (data1 and data2), and should return false in case of error. -typedef int (*VP9WorkerHook)(void*, void*); - -// Platform-dependent implementation details for the worker. -typedef struct VP9WorkerImpl VP9WorkerImpl; - -// Synchronization object used to launch job in the worker thread -typedef struct { - VP9WorkerImpl *impl_; - VP9WorkerStatus status_; - VP9WorkerHook hook; // hook to call - void *data1; // first argument passed to 'hook' - void *data2; // second argument passed to 'hook' - int had_error; // return value of the last call to 'hook' -} VP9Worker; - -// The interface for all thread-worker related functions. All these functions -// must be implemented. -typedef struct { - // Must be called first, before any other method. - void (*init)(VP9Worker *const worker); - // Must be called to initialize the object and spawn the thread. Re-entrant. - // Will potentially launch the thread. Returns false in case of error. - int (*reset)(VP9Worker *const worker); - // Makes sure the previous work is finished. Returns true if worker->had_error - // was not set and no error condition was triggered by the working thread. - int (*sync)(VP9Worker *const worker); - // Triggers the thread to call hook() with data1 and data2 arguments. These - // hook/data1/data2 values can be changed at any time before calling this - // function, but not be changed afterward until the next call to Sync(). - void (*launch)(VP9Worker *const worker); - // This function is similar to launch() except that it calls the - // hook directly instead of using a thread. Convenient to bypass the thread - // mechanism while still using the VP9Worker structs. sync() must - // still be called afterward (for error reporting). - void (*execute)(VP9Worker *const worker); - // Kill the thread and terminate the object. To use the object again, one - // must call reset() again. - void (*end)(VP9Worker *const worker); -} VP9WorkerInterface; - -// Install a new set of threading functions, overriding the defaults. This -// should be done before any workers are started, i.e., before any encoding or -// decoding takes place. The contents of the interface struct are copied, it -// is safe to free the corresponding memory after this call. This function is -// not thread-safe. Return false in case of invalid pointer or methods. -int vp9_set_worker_interface(const VP9WorkerInterface *const winterface); - -// Retrieve the currently set thread worker interface. -const VP9WorkerInterface *vp9_get_worker_interface(void); - -//------------------------------------------------------------------------------ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_DECODER_VP9_THREAD_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_tile_common.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_tile_common.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_tile_common.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_tile_common.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vp9/common/vp9_tile_common.h" - -#include "vp9/common/vp9_onyxc_int.h" - -#define MIN_TILE_WIDTH_B64 4 -#define MAX_TILE_WIDTH_B64 64 - -static int get_tile_offset(int idx, int mis, int log2) { - const int sb_cols = mi_cols_aligned_to_sb(mis) >> MI_BLOCK_SIZE_LOG2; - const int offset = ((idx * sb_cols) >> log2) << MI_BLOCK_SIZE_LOG2; - return MIN(offset, mis); -} - -void vp9_tile_set_row(TileInfo *tile, const VP9_COMMON *cm, int row) { - tile->mi_row_start = get_tile_offset(row, cm->mi_rows, cm->log2_tile_rows); - tile->mi_row_end = get_tile_offset(row + 1, cm->mi_rows, cm->log2_tile_rows); -} - -void vp9_tile_set_col(TileInfo *tile, const VP9_COMMON *cm, int col) { - tile->mi_col_start = get_tile_offset(col, cm->mi_cols, cm->log2_tile_cols); - tile->mi_col_end = get_tile_offset(col + 1, cm->mi_cols, cm->log2_tile_cols); -} - -void vp9_tile_init(TileInfo *tile, const VP9_COMMON *cm, int row, int col) { - vp9_tile_set_row(tile, cm, row); - vp9_tile_set_col(tile, cm, col); -} - -static int get_min_log2_tile_cols(const int sb64_cols) { - int min_log2 = 0; - while ((MAX_TILE_WIDTH_B64 << min_log2) < sb64_cols) - ++min_log2; - return min_log2; -} - -static int get_max_log2_tile_cols(const int sb64_cols) { - int max_log2 = 1; - while ((sb64_cols >> max_log2) >= MIN_TILE_WIDTH_B64) - ++max_log2; - return max_log2 - 1; -} - -void vp9_get_tile_n_bits(int mi_cols, - int *min_log2_tile_cols, int *max_log2_tile_cols) { - const int sb64_cols = mi_cols_aligned_to_sb(mi_cols) >> MI_BLOCK_SIZE_LOG2; - *min_log2_tile_cols = get_min_log2_tile_cols(sb64_cols); - *max_log2_tile_cols = get_max_log2_tile_cols(sb64_cols); - assert(*min_log2_tile_cols <= *max_log2_tile_cols); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_tile_common.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_tile_common.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/vp9_tile_common.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/vp9_tile_common.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_COMMON_VP9_TILE_COMMON_H_ -#define VP9_COMMON_VP9_TILE_COMMON_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -struct VP9Common; - -typedef struct TileInfo { - int mi_row_start, mi_row_end; - int mi_col_start, mi_col_end; -} TileInfo; - -// initializes 'tile->mi_(row|col)_(start|end)' for (row, col) based on -// 'cm->log2_tile_(rows|cols)' & 'cm->mi_(rows|cols)' -void vp9_tile_init(TileInfo *tile, const struct VP9Common *cm, - int row, int col); - -void vp9_tile_set_row(TileInfo *tile, const struct VP9Common *cm, int row); -void vp9_tile_set_col(TileInfo *tile, const struct VP9Common *cm, int col); - -void vp9_get_tile_n_bits(int mi_cols, - int *min_log2_tile_cols, int *max_log2_tile_cols); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_COMMON_VP9_TILE_COMMON_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_asm_stubs.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_asm_stubs.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_asm_stubs.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_asm_stubs.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,574 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "./vpx_config.h" -#include "./vp9_rtcd.h" -#include "vpx_ports/mem.h" - -typedef void filter8_1dfunction ( - const unsigned char *src_ptr, - const ptrdiff_t src_pitch, - unsigned char *output_ptr, - ptrdiff_t out_pitch, - unsigned int output_height, - const short *filter -); - -#define FUN_CONV_1D(name, step_q4, filter, dir, src_start, avg, opt) \ - void vp9_convolve8_##name##_##opt(const uint8_t *src, ptrdiff_t src_stride, \ - uint8_t *dst, ptrdiff_t dst_stride, \ - const int16_t *filter_x, int x_step_q4, \ - const int16_t *filter_y, int y_step_q4, \ - int w, int h) { \ - if (step_q4 == 16 && filter[3] != 128) { \ - if (filter[0] || filter[1] || filter[2]) { \ - while (w >= 16) { \ - vp9_filter_block1d16_##dir##8_##avg##opt(src_start, \ - src_stride, \ - dst, \ - dst_stride, \ - h, \ - filter); \ - src += 16; \ - dst += 16; \ - w -= 16; \ - } \ - while (w >= 8) { \ - vp9_filter_block1d8_##dir##8_##avg##opt(src_start, \ - src_stride, \ - dst, \ - dst_stride, \ - h, \ - filter); \ - src += 8; \ - dst += 8; \ - w -= 8; \ - } \ - while (w >= 4) { \ - vp9_filter_block1d4_##dir##8_##avg##opt(src_start, \ - src_stride, \ - dst, \ - dst_stride, \ - h, \ - filter); \ - src += 4; \ - dst += 4; \ - w -= 4; \ - } \ - } else { \ - while (w >= 16) { \ - vp9_filter_block1d16_##dir##2_##avg##opt(src, \ - src_stride, \ - dst, \ - dst_stride, \ - h, \ - filter); \ - src += 16; \ - dst += 16; \ - w -= 16; \ - } \ - while (w >= 8) { \ - vp9_filter_block1d8_##dir##2_##avg##opt(src, \ - src_stride, \ - dst, \ - dst_stride, \ - h, \ - filter); \ - src += 8; \ - dst += 8; \ - w -= 8; \ - } \ - while (w >= 4) { \ - vp9_filter_block1d4_##dir##2_##avg##opt(src, \ - src_stride, \ - dst, \ - dst_stride, \ - h, \ - filter); \ - src += 4; \ - dst += 4; \ - w -= 4; \ - } \ - } \ - } \ - if (w) { \ - vp9_convolve8_##name##_c(src, src_stride, dst, dst_stride, \ - filter_x, x_step_q4, filter_y, y_step_q4, \ - w, h); \ - } \ -} - -#define FUN_CONV_2D(avg, opt) \ -void vp9_convolve8_##avg##opt(const uint8_t *src, ptrdiff_t src_stride, \ - uint8_t *dst, ptrdiff_t dst_stride, \ - const int16_t *filter_x, int x_step_q4, \ - const int16_t *filter_y, int y_step_q4, \ - int w, int h) { \ - assert(w <= 64); \ - assert(h <= 64); \ - if (x_step_q4 == 16 && y_step_q4 == 16) { \ - if (filter_x[0] || filter_x[1] || filter_x[2] || filter_x[3] == 128 || \ - filter_y[0] || filter_y[1] || filter_y[2] || filter_y[3] == 128) { \ - DECLARE_ALIGNED_ARRAY(16, unsigned char, fdata2, 64 * 71); \ - vp9_convolve8_horiz_##opt(src - 3 * src_stride, src_stride, fdata2, 64, \ - filter_x, x_step_q4, filter_y, y_step_q4, \ - w, h + 7); \ - vp9_convolve8_##avg##vert_##opt(fdata2 + 3 * 64, 64, dst, dst_stride, \ - filter_x, x_step_q4, filter_y, \ - y_step_q4, w, h); \ - } else { \ - DECLARE_ALIGNED_ARRAY(16, unsigned char, fdata2, 64 * 65); \ - vp9_convolve8_horiz_##opt(src, src_stride, fdata2, 64, \ - filter_x, x_step_q4, filter_y, y_step_q4, \ - w, h + 1); \ - vp9_convolve8_##avg##vert_##opt(fdata2, 64, dst, dst_stride, \ - filter_x, x_step_q4, filter_y, \ - y_step_q4, w, h); \ - } \ - } else { \ - vp9_convolve8_##avg##c(src, src_stride, dst, dst_stride, \ - filter_x, x_step_q4, filter_y, y_step_q4, w, h); \ - } \ -} - -#if CONFIG_VP9_HIGHBITDEPTH - -typedef void highbd_filter8_1dfunction ( - const uint16_t *src_ptr, - const ptrdiff_t src_pitch, - uint16_t *output_ptr, - ptrdiff_t out_pitch, - unsigned int output_height, - const int16_t *filter, - int bd -); - -#define HIGH_FUN_CONV_1D(name, step_q4, filter, dir, src_start, avg, opt) \ - void vp9_highbd_convolve8_##name##_##opt(const uint8_t *src8, \ - ptrdiff_t src_stride, \ - uint8_t *dst8, \ - ptrdiff_t dst_stride, \ - const int16_t *filter_x, \ - int x_step_q4, \ - const int16_t *filter_y, \ - int y_step_q4, \ - int w, int h, int bd) { \ - if (step_q4 == 16 && filter[3] != 128) { \ - uint16_t *src = CONVERT_TO_SHORTPTR(src8); \ - uint16_t *dst = CONVERT_TO_SHORTPTR(dst8); \ - if (filter[0] || filter[1] || filter[2]) { \ - while (w >= 16) { \ - vp9_highbd_filter_block1d16_##dir##8_##avg##opt(src_start, \ - src_stride, \ - dst, \ - dst_stride, \ - h, \ - filter, \ - bd); \ - src += 16; \ - dst += 16; \ - w -= 16; \ - } \ - while (w >= 8) { \ - vp9_highbd_filter_block1d8_##dir##8_##avg##opt(src_start, \ - src_stride, \ - dst, \ - dst_stride, \ - h, \ - filter, \ - bd); \ - src += 8; \ - dst += 8; \ - w -= 8; \ - } \ - while (w >= 4) { \ - vp9_highbd_filter_block1d4_##dir##8_##avg##opt(src_start, \ - src_stride, \ - dst, \ - dst_stride, \ - h, \ - filter, \ - bd); \ - src += 4; \ - dst += 4; \ - w -= 4; \ - } \ - } else { \ - while (w >= 16) { \ - vp9_highbd_filter_block1d16_##dir##2_##avg##opt(src, \ - src_stride, \ - dst, \ - dst_stride, \ - h, \ - filter, \ - bd); \ - src += 16; \ - dst += 16; \ - w -= 16; \ - } \ - while (w >= 8) { \ - vp9_highbd_filter_block1d8_##dir##2_##avg##opt(src, \ - src_stride, \ - dst, \ - dst_stride, \ - h, \ - filter, \ - bd); \ - src += 8; \ - dst += 8; \ - w -= 8; \ - } \ - while (w >= 4) { \ - vp9_highbd_filter_block1d4_##dir##2_##avg##opt(src, \ - src_stride, \ - dst, \ - dst_stride, \ - h, \ - filter, \ - bd); \ - src += 4; \ - dst += 4; \ - w -= 4; \ - } \ - } \ - } \ - if (w) { \ - vp9_highbd_convolve8_##name##_c(src8, src_stride, dst8, dst_stride, \ - filter_x, x_step_q4, filter_y, y_step_q4, \ - w, h, bd); \ - } \ -} - -#define HIGH_FUN_CONV_2D(avg, opt) \ -void vp9_highbd_convolve8_##avg##opt(const uint8_t *src, ptrdiff_t src_stride, \ - uint8_t *dst, ptrdiff_t dst_stride, \ - const int16_t *filter_x, int x_step_q4, \ - const int16_t *filter_y, int y_step_q4, \ - int w, int h, int bd) { \ - assert(w <= 64); \ - assert(h <= 64); \ - if (x_step_q4 == 16 && y_step_q4 == 16) { \ - if (filter_x[0] || filter_x[1] || filter_x[2] || filter_x[3] == 128 || \ - filter_y[0] || filter_y[1] || filter_y[2] || filter_y[3] == 128) { \ - DECLARE_ALIGNED_ARRAY(16, uint16_t, fdata2, 64 * 71); \ - vp9_highbd_convolve8_horiz_##opt(src - 3 * src_stride, src_stride, \ - CONVERT_TO_BYTEPTR(fdata2), 64, \ - filter_x, x_step_q4, \ - filter_y, y_step_q4, \ - w, h + 7, bd); \ - vp9_highbd_convolve8_##avg##vert_##opt(CONVERT_TO_BYTEPTR(fdata2) + 192, \ - 64, dst, dst_stride, \ - filter_x, x_step_q4, \ - filter_y, y_step_q4, \ - w, h, bd); \ - } else { \ - DECLARE_ALIGNED_ARRAY(16, uint16_t, fdata2, 64 * 65); \ - vp9_highbd_convolve8_horiz_##opt(src, src_stride, \ - CONVERT_TO_BYTEPTR(fdata2), 64, \ - filter_x, x_step_q4, \ - filter_y, y_step_q4, \ - w, h + 1, bd); \ - vp9_highbd_convolve8_##avg##vert_##opt(CONVERT_TO_BYTEPTR(fdata2), 64, \ - dst, dst_stride, \ - filter_x, x_step_q4, \ - filter_y, y_step_q4, \ - w, h, bd); \ - } \ - } else { \ - vp9_highbd_convolve8_##avg##c(src, src_stride, dst, dst_stride, \ - filter_x, x_step_q4, filter_y, y_step_q4, w, \ - h, bd); \ - } \ -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -#if HAVE_AVX2 && HAVE_SSSE3 -filter8_1dfunction vp9_filter_block1d16_v8_avx2; -filter8_1dfunction vp9_filter_block1d16_h8_avx2; -filter8_1dfunction vp9_filter_block1d4_v8_ssse3; -#if ARCH_X86_64 -filter8_1dfunction vp9_filter_block1d8_v8_intrin_ssse3; -filter8_1dfunction vp9_filter_block1d8_h8_intrin_ssse3; -filter8_1dfunction vp9_filter_block1d4_h8_intrin_ssse3; -#define vp9_filter_block1d8_v8_avx2 vp9_filter_block1d8_v8_intrin_ssse3 -#define vp9_filter_block1d8_h8_avx2 vp9_filter_block1d8_h8_intrin_ssse3 -#define vp9_filter_block1d4_h8_avx2 vp9_filter_block1d4_h8_intrin_ssse3 -#else // ARCH_X86 -filter8_1dfunction vp9_filter_block1d8_v8_ssse3; -filter8_1dfunction vp9_filter_block1d8_h8_ssse3; -filter8_1dfunction vp9_filter_block1d4_h8_ssse3; -#define vp9_filter_block1d8_v8_avx2 vp9_filter_block1d8_v8_ssse3 -#define vp9_filter_block1d8_h8_avx2 vp9_filter_block1d8_h8_ssse3 -#define vp9_filter_block1d4_h8_avx2 vp9_filter_block1d4_h8_ssse3 -#endif // ARCH_X86_64 / ARCH_X86 -filter8_1dfunction vp9_filter_block1d16_v2_ssse3; -filter8_1dfunction vp9_filter_block1d16_h2_ssse3; -filter8_1dfunction vp9_filter_block1d8_v2_ssse3; -filter8_1dfunction vp9_filter_block1d8_h2_ssse3; -filter8_1dfunction vp9_filter_block1d4_v2_ssse3; -filter8_1dfunction vp9_filter_block1d4_h2_ssse3; -#define vp9_filter_block1d4_v8_avx2 vp9_filter_block1d4_v8_ssse3 -#define vp9_filter_block1d16_v2_avx2 vp9_filter_block1d16_v2_ssse3 -#define vp9_filter_block1d16_h2_avx2 vp9_filter_block1d16_h2_ssse3 -#define vp9_filter_block1d8_v2_avx2 vp9_filter_block1d8_v2_ssse3 -#define vp9_filter_block1d8_h2_avx2 vp9_filter_block1d8_h2_ssse3 -#define vp9_filter_block1d4_v2_avx2 vp9_filter_block1d4_v2_ssse3 -#define vp9_filter_block1d4_h2_avx2 vp9_filter_block1d4_h2_ssse3 -// void vp9_convolve8_horiz_avx2(const uint8_t *src, ptrdiff_t src_stride, -// uint8_t *dst, ptrdiff_t dst_stride, -// const int16_t *filter_x, int x_step_q4, -// const int16_t *filter_y, int y_step_q4, -// int w, int h); -// void vp9_convolve8_vert_avx2(const uint8_t *src, ptrdiff_t src_stride, -// uint8_t *dst, ptrdiff_t dst_stride, -// const int16_t *filter_x, int x_step_q4, -// const int16_t *filter_y, int y_step_q4, -// int w, int h); -FUN_CONV_1D(horiz, x_step_q4, filter_x, h, src, , avx2); -FUN_CONV_1D(vert, y_step_q4, filter_y, v, src - src_stride * 3, , avx2); - -// void vp9_convolve8_avx2(const uint8_t *src, ptrdiff_t src_stride, -// uint8_t *dst, ptrdiff_t dst_stride, -// const int16_t *filter_x, int x_step_q4, -// const int16_t *filter_y, int y_step_q4, -// int w, int h); -FUN_CONV_2D(, avx2); -#endif // HAVE_AX2 && HAVE_SSSE3 -#if HAVE_SSSE3 -#if ARCH_X86_64 -filter8_1dfunction vp9_filter_block1d16_v8_intrin_ssse3; -filter8_1dfunction vp9_filter_block1d16_h8_intrin_ssse3; -filter8_1dfunction vp9_filter_block1d8_v8_intrin_ssse3; -filter8_1dfunction vp9_filter_block1d8_h8_intrin_ssse3; -filter8_1dfunction vp9_filter_block1d4_v8_ssse3; -filter8_1dfunction vp9_filter_block1d4_h8_intrin_ssse3; -#define vp9_filter_block1d16_v8_ssse3 vp9_filter_block1d16_v8_intrin_ssse3 -#define vp9_filter_block1d16_h8_ssse3 vp9_filter_block1d16_h8_intrin_ssse3 -#define vp9_filter_block1d8_v8_ssse3 vp9_filter_block1d8_v8_intrin_ssse3 -#define vp9_filter_block1d8_h8_ssse3 vp9_filter_block1d8_h8_intrin_ssse3 -#define vp9_filter_block1d4_h8_ssse3 vp9_filter_block1d4_h8_intrin_ssse3 -#else // ARCH_X86 -filter8_1dfunction vp9_filter_block1d16_v8_ssse3; -filter8_1dfunction vp9_filter_block1d16_h8_ssse3; -filter8_1dfunction vp9_filter_block1d8_v8_ssse3; -filter8_1dfunction vp9_filter_block1d8_h8_ssse3; -filter8_1dfunction vp9_filter_block1d4_v8_ssse3; -filter8_1dfunction vp9_filter_block1d4_h8_ssse3; -#endif // ARCH_X86_64 / ARCH_X86 -filter8_1dfunction vp9_filter_block1d16_v8_avg_ssse3; -filter8_1dfunction vp9_filter_block1d16_h8_avg_ssse3; -filter8_1dfunction vp9_filter_block1d8_v8_avg_ssse3; -filter8_1dfunction vp9_filter_block1d8_h8_avg_ssse3; -filter8_1dfunction vp9_filter_block1d4_v8_avg_ssse3; -filter8_1dfunction vp9_filter_block1d4_h8_avg_ssse3; - -filter8_1dfunction vp9_filter_block1d16_v2_ssse3; -filter8_1dfunction vp9_filter_block1d16_h2_ssse3; -filter8_1dfunction vp9_filter_block1d8_v2_ssse3; -filter8_1dfunction vp9_filter_block1d8_h2_ssse3; -filter8_1dfunction vp9_filter_block1d4_v2_ssse3; -filter8_1dfunction vp9_filter_block1d4_h2_ssse3; -filter8_1dfunction vp9_filter_block1d16_v2_avg_ssse3; -filter8_1dfunction vp9_filter_block1d16_h2_avg_ssse3; -filter8_1dfunction vp9_filter_block1d8_v2_avg_ssse3; -filter8_1dfunction vp9_filter_block1d8_h2_avg_ssse3; -filter8_1dfunction vp9_filter_block1d4_v2_avg_ssse3; -filter8_1dfunction vp9_filter_block1d4_h2_avg_ssse3; - -// void vp9_convolve8_horiz_ssse3(const uint8_t *src, ptrdiff_t src_stride, -// uint8_t *dst, ptrdiff_t dst_stride, -// const int16_t *filter_x, int x_step_q4, -// const int16_t *filter_y, int y_step_q4, -// int w, int h); -// void vp9_convolve8_vert_ssse3(const uint8_t *src, ptrdiff_t src_stride, -// uint8_t *dst, ptrdiff_t dst_stride, -// const int16_t *filter_x, int x_step_q4, -// const int16_t *filter_y, int y_step_q4, -// int w, int h); -// void vp9_convolve8_avg_horiz_ssse3(const uint8_t *src, ptrdiff_t src_stride, -// uint8_t *dst, ptrdiff_t dst_stride, -// const int16_t *filter_x, int x_step_q4, -// const int16_t *filter_y, int y_step_q4, -// int w, int h); -// void vp9_convolve8_avg_vert_ssse3(const uint8_t *src, ptrdiff_t src_stride, -// uint8_t *dst, ptrdiff_t dst_stride, -// const int16_t *filter_x, int x_step_q4, -// const int16_t *filter_y, int y_step_q4, -// int w, int h); -FUN_CONV_1D(horiz, x_step_q4, filter_x, h, src, , ssse3); -FUN_CONV_1D(vert, y_step_q4, filter_y, v, src - src_stride * 3, , ssse3); -FUN_CONV_1D(avg_horiz, x_step_q4, filter_x, h, src, avg_, ssse3); -FUN_CONV_1D(avg_vert, y_step_q4, filter_y, v, src - src_stride * 3, avg_, - ssse3); - -// void vp9_convolve8_ssse3(const uint8_t *src, ptrdiff_t src_stride, -// uint8_t *dst, ptrdiff_t dst_stride, -// const int16_t *filter_x, int x_step_q4, -// const int16_t *filter_y, int y_step_q4, -// int w, int h); -// void vp9_convolve8_avg_ssse3(const uint8_t *src, ptrdiff_t src_stride, -// uint8_t *dst, ptrdiff_t dst_stride, -// const int16_t *filter_x, int x_step_q4, -// const int16_t *filter_y, int y_step_q4, -// int w, int h); -FUN_CONV_2D(, ssse3); -FUN_CONV_2D(avg_ , ssse3); -#endif // HAVE_SSSE3 - -#if HAVE_SSE2 -filter8_1dfunction vp9_filter_block1d16_v8_sse2; -filter8_1dfunction vp9_filter_block1d16_h8_sse2; -filter8_1dfunction vp9_filter_block1d8_v8_sse2; -filter8_1dfunction vp9_filter_block1d8_h8_sse2; -filter8_1dfunction vp9_filter_block1d4_v8_sse2; -filter8_1dfunction vp9_filter_block1d4_h8_sse2; -filter8_1dfunction vp9_filter_block1d16_v8_avg_sse2; -filter8_1dfunction vp9_filter_block1d16_h8_avg_sse2; -filter8_1dfunction vp9_filter_block1d8_v8_avg_sse2; -filter8_1dfunction vp9_filter_block1d8_h8_avg_sse2; -filter8_1dfunction vp9_filter_block1d4_v8_avg_sse2; -filter8_1dfunction vp9_filter_block1d4_h8_avg_sse2; - -filter8_1dfunction vp9_filter_block1d16_v2_sse2; -filter8_1dfunction vp9_filter_block1d16_h2_sse2; -filter8_1dfunction vp9_filter_block1d8_v2_sse2; -filter8_1dfunction vp9_filter_block1d8_h2_sse2; -filter8_1dfunction vp9_filter_block1d4_v2_sse2; -filter8_1dfunction vp9_filter_block1d4_h2_sse2; -filter8_1dfunction vp9_filter_block1d16_v2_avg_sse2; -filter8_1dfunction vp9_filter_block1d16_h2_avg_sse2; -filter8_1dfunction vp9_filter_block1d8_v2_avg_sse2; -filter8_1dfunction vp9_filter_block1d8_h2_avg_sse2; -filter8_1dfunction vp9_filter_block1d4_v2_avg_sse2; -filter8_1dfunction vp9_filter_block1d4_h2_avg_sse2; - -// void vp9_convolve8_horiz_sse2(const uint8_t *src, ptrdiff_t src_stride, -// uint8_t *dst, ptrdiff_t dst_stride, -// const int16_t *filter_x, int x_step_q4, -// const int16_t *filter_y, int y_step_q4, -// int w, int h); -// void vp9_convolve8_vert_sse2(const uint8_t *src, ptrdiff_t src_stride, -// uint8_t *dst, ptrdiff_t dst_stride, -// const int16_t *filter_x, int x_step_q4, -// const int16_t *filter_y, int y_step_q4, -// int w, int h); -// void vp9_convolve8_avg_horiz_sse2(const uint8_t *src, ptrdiff_t src_stride, -// uint8_t *dst, ptrdiff_t dst_stride, -// const int16_t *filter_x, int x_step_q4, -// const int16_t *filter_y, int y_step_q4, -// int w, int h); -// void vp9_convolve8_avg_vert_sse2(const uint8_t *src, ptrdiff_t src_stride, -// uint8_t *dst, ptrdiff_t dst_stride, -// const int16_t *filter_x, int x_step_q4, -// const int16_t *filter_y, int y_step_q4, -// int w, int h); -FUN_CONV_1D(horiz, x_step_q4, filter_x, h, src, , sse2); -FUN_CONV_1D(vert, y_step_q4, filter_y, v, src - src_stride * 3, , sse2); -FUN_CONV_1D(avg_horiz, x_step_q4, filter_x, h, src, avg_, sse2); -FUN_CONV_1D(avg_vert, y_step_q4, filter_y, v, src - src_stride * 3, avg_, sse2); - -// void vp9_convolve8_sse2(const uint8_t *src, ptrdiff_t src_stride, -// uint8_t *dst, ptrdiff_t dst_stride, -// const int16_t *filter_x, int x_step_q4, -// const int16_t *filter_y, int y_step_q4, -// int w, int h); -// void vp9_convolve8_avg_sse2(const uint8_t *src, ptrdiff_t src_stride, -// uint8_t *dst, ptrdiff_t dst_stride, -// const int16_t *filter_x, int x_step_q4, -// const int16_t *filter_y, int y_step_q4, -// int w, int h); -FUN_CONV_2D(, sse2); -FUN_CONV_2D(avg_ , sse2); - -#if CONFIG_VP9_HIGHBITDEPTH && ARCH_X86_64 -highbd_filter8_1dfunction vp9_highbd_filter_block1d16_v8_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d16_h8_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d8_v8_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d8_h8_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d4_v8_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d4_h8_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d16_v8_avg_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d16_h8_avg_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d8_v8_avg_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d8_h8_avg_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d4_v8_avg_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d4_h8_avg_sse2; - -highbd_filter8_1dfunction vp9_highbd_filter_block1d16_v2_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d16_h2_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d8_v2_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d8_h2_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d4_v2_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d4_h2_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d16_v2_avg_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d16_h2_avg_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d8_v2_avg_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d8_h2_avg_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d4_v2_avg_sse2; -highbd_filter8_1dfunction vp9_highbd_filter_block1d4_h2_avg_sse2; - -// void vp9_highbd_convolve8_horiz_sse2(const uint8_t *src, -// ptrdiff_t src_stride, -// uint8_t *dst, -// ptrdiff_t dst_stride, -// const int16_t *filter_x, -// int x_step_q4, -// const int16_t *filter_y, -// int y_step_q4, -// int w, int h, int bd); -// void vp9_highbd_convolve8_vert_sse2(const uint8_t *src, -// ptrdiff_t src_stride, -// uint8_t *dst, -// ptrdiff_t dst_stride, -// const int16_t *filter_x, -// int x_step_q4, -// const int16_t *filter_y, -// int y_step_q4, -// int w, int h, int bd); -// void vp9_highbd_convolve8_avg_horiz_sse2(const uint8_t *src, -// ptrdiff_t src_stride, -// uint8_t *dst, -// ptrdiff_t dst_stride, -// const int16_t *filter_x, -// int x_step_q4, -// const int16_t *filter_y, -// int y_step_q4, -// int w, int h, int bd); -// void vp9_highbd_convolve8_avg_vert_sse2(const uint8_t *src, -// ptrdiff_t src_stride, -// uint8_t *dst, -// ptrdiff_t dst_stride, -// const int16_t *filter_x, -// int x_step_q4, -// const int16_t *filter_y, -// int y_step_q4, -// int w, int h, int bd); -HIGH_FUN_CONV_1D(horiz, x_step_q4, filter_x, h, src, , sse2); -HIGH_FUN_CONV_1D(vert, y_step_q4, filter_y, v, src - src_stride * 3, , sse2); -HIGH_FUN_CONV_1D(avg_horiz, x_step_q4, filter_x, h, src, avg_, sse2); -HIGH_FUN_CONV_1D(avg_vert, y_step_q4, filter_y, v, src - src_stride * 3, avg_, - sse2); - -// void vp9_highbd_convolve8_sse2(const uint8_t *src, ptrdiff_t src_stride, -// uint8_t *dst, ptrdiff_t dst_stride, -// const int16_t *filter_x, int x_step_q4, -// const int16_t *filter_y, int y_step_q4, -// int w, int h, int bd); -// void vp9_highbd_convolve8_avg_sse2(const uint8_t *src, ptrdiff_t src_stride, -// uint8_t *dst, ptrdiff_t dst_stride, -// const int16_t *filter_x, int x_step_q4, -// const int16_t *filter_y, int y_step_q4, -// int w, int h, int bd); -HIGH_FUN_CONV_2D(, sse2); -HIGH_FUN_CONV_2D(avg_ , sse2); -#endif // CONFIG_VP9_HIGHBITDEPTH && ARCH_X86_64 -#endif // HAVE_SSE2 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_copy_sse2.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_copy_sse2.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_copy_sse2.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_copy_sse2.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,156 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - -%include "third_party/x86inc/x86inc.asm" - -SECTION .text - -%macro convolve_fn 1 -INIT_XMM sse2 -cglobal convolve_%1, 4, 7, 4, src, src_stride, dst, dst_stride, \ - fx, fxs, fy, fys, w, h - mov r4d, dword wm - cmp r4d, 4 - je .w4 - cmp r4d, 8 - je .w8 - cmp r4d, 16 - je .w16 - cmp r4d, 32 - je .w32 - - mov r4d, dword hm -.loop64: - movu m0, [srcq] - movu m1, [srcq+16] - movu m2, [srcq+32] - movu m3, [srcq+48] - add srcq, src_strideq -%ifidn %1, avg - pavgb m0, [dstq] - pavgb m1, [dstq+16] - pavgb m2, [dstq+32] - pavgb m3, [dstq+48] -%endif - mova [dstq ], m0 - mova [dstq+16], m1 - mova [dstq+32], m2 - mova [dstq+48], m3 - add dstq, dst_strideq - dec r4d - jnz .loop64 - RET - -.w32: - mov r4d, dword hm -.loop32: - movu m0, [srcq] - movu m1, [srcq+16] - movu m2, [srcq+src_strideq] - movu m3, [srcq+src_strideq+16] - lea srcq, [srcq+src_strideq*2] -%ifidn %1, avg - pavgb m0, [dstq] - pavgb m1, [dstq +16] - pavgb m2, [dstq+dst_strideq] - pavgb m3, [dstq+dst_strideq+16] -%endif - mova [dstq ], m0 - mova [dstq +16], m1 - mova [dstq+dst_strideq ], m2 - mova [dstq+dst_strideq+16], m3 - lea dstq, [dstq+dst_strideq*2] - sub r4d, 2 - jnz .loop32 - RET - -.w16: - mov r4d, dword hm - lea r5q, [src_strideq*3] - lea r6q, [dst_strideq*3] -.loop16: - movu m0, [srcq] - movu m1, [srcq+src_strideq] - movu m2, [srcq+src_strideq*2] - movu m3, [srcq+r5q] - lea srcq, [srcq+src_strideq*4] -%ifidn %1, avg - pavgb m0, [dstq] - pavgb m1, [dstq+dst_strideq] - pavgb m2, [dstq+dst_strideq*2] - pavgb m3, [dstq+r6q] -%endif - mova [dstq ], m0 - mova [dstq+dst_strideq ], m1 - mova [dstq+dst_strideq*2], m2 - mova [dstq+r6q ], m3 - lea dstq, [dstq+dst_strideq*4] - sub r4d, 4 - jnz .loop16 - RET - -INIT_MMX sse -.w8: - mov r4d, dword hm - lea r5q, [src_strideq*3] - lea r6q, [dst_strideq*3] -.loop8: - movu m0, [srcq] - movu m1, [srcq+src_strideq] - movu m2, [srcq+src_strideq*2] - movu m3, [srcq+r5q] - lea srcq, [srcq+src_strideq*4] -%ifidn %1, avg - pavgb m0, [dstq] - pavgb m1, [dstq+dst_strideq] - pavgb m2, [dstq+dst_strideq*2] - pavgb m3, [dstq+r6q] -%endif - mova [dstq ], m0 - mova [dstq+dst_strideq ], m1 - mova [dstq+dst_strideq*2], m2 - mova [dstq+r6q ], m3 - lea dstq, [dstq+dst_strideq*4] - sub r4d, 4 - jnz .loop8 - RET - -.w4: - mov r4d, dword hm - lea r5q, [src_strideq*3] - lea r6q, [dst_strideq*3] -.loop4: - movh m0, [srcq] - movh m1, [srcq+src_strideq] - movh m2, [srcq+src_strideq*2] - movh m3, [srcq+r5q] - lea srcq, [srcq+src_strideq*4] -%ifidn %1, avg - movh m4, [dstq] - movh m5, [dstq+dst_strideq] - movh m6, [dstq+dst_strideq*2] - movh m7, [dstq+r6q] - pavgb m0, m4 - pavgb m1, m5 - pavgb m2, m6 - pavgb m3, m7 -%endif - movh [dstq ], m0 - movh [dstq+dst_strideq ], m1 - movh [dstq+dst_strideq*2], m2 - movh [dstq+r6q ], m3 - lea dstq, [dstq+dst_strideq*4] - sub r4d, 4 - jnz .loop4 - RET -%endmacro - -convolve_fn copy -convolve_fn avg diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_high_intrapred_sse2.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_high_intrapred_sse2.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_high_intrapred_sse2.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_high_intrapred_sse2.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,476 +0,0 @@ -; -; Copyright (c) 2014 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - -%include "third_party/x86inc/x86inc.asm" - -SECTION_RODATA -pw_4: times 8 dw 4 -pw_8: times 8 dw 8 -pw_16: times 4 dd 16 -pw_32: times 4 dd 32 - -SECTION .text -INIT_MMX sse -cglobal highbd_dc_predictor_4x4, 4, 5, 4, dst, stride, above, left, goffset - GET_GOT goffsetq - - movq m0, [aboveq] - movq m2, [leftq] - DEFINE_ARGS dst, stride, one - mov oned, 0x0001 - pxor m1, m1 - movd m3, oned - pshufw m3, m3, 0x0 - paddw m0, m2 - pmaddwd m0, m3 - packssdw m0, m1 - pmaddwd m0, m3 - paddw m0, [GLOBAL(pw_4)] - psraw m0, 3 - pshufw m0, m0, 0x0 - movq [dstq ], m0 - movq [dstq+strideq*2], m0 - lea dstq, [dstq+strideq*4] - movq [dstq ], m0 - movq [dstq+strideq*2], m0 - - RESTORE_GOT - RET - -INIT_XMM sse2 -cglobal highbd_dc_predictor_8x8, 4, 5, 4, dst, stride, above, left, goffset - GET_GOT goffsetq - - pxor m1, m1 - mova m0, [aboveq] - mova m2, [leftq] - DEFINE_ARGS dst, stride, stride3, one - mov oned, 0x00010001 - lea stride3q, [strideq*3] - movd m3, oned - pshufd m3, m3, 0x0 - paddw m0, m2 - pmaddwd m0, m3 - packssdw m0, m1 - pmaddwd m0, m3 - packssdw m0, m1 - pmaddwd m0, m3 - paddw m0, [GLOBAL(pw_8)] - psrlw m0, 4 - pshuflw m0, m0, 0x0 - punpcklqdq m0, m0 - mova [dstq ], m0 - mova [dstq+strideq*2 ], m0 - mova [dstq+strideq*4 ], m0 - mova [dstq+stride3q*2], m0 - lea dstq, [dstq+strideq*8] - mova [dstq ], m0 - mova [dstq+strideq*2 ], m0 - mova [dstq+strideq*4 ], m0 - mova [dstq+stride3q*2], m0 - - RESTORE_GOT - RET - -INIT_XMM sse2 -cglobal highbd_dc_predictor_16x16, 4, 5, 5, dst, stride, above, left, goffset - GET_GOT goffsetq - - pxor m1, m1 - mova m0, [aboveq] - mova m3, [aboveq+16] - mova m2, [leftq] - mova m4, [leftq+16] - DEFINE_ARGS dst, stride, stride3, lines4 - lea stride3q, [strideq*3] - mov lines4d, 4 - paddw m0, m2 - paddw m0, m3 - paddw m0, m4 - movhlps m2, m0 - paddw m0, m2 - punpcklwd m0, m1 - movhlps m2, m0 - paddd m0, m2 - punpckldq m0, m1 - movhlps m2, m0 - paddd m0, m2 - paddd m0, [GLOBAL(pw_16)] - psrad m0, 5 - pshuflw m0, m0, 0x0 - punpcklqdq m0, m0 -.loop: - mova [dstq ], m0 - mova [dstq +16], m0 - mova [dstq+strideq*2 ], m0 - mova [dstq+strideq*2 +16], m0 - mova [dstq+strideq*4 ], m0 - mova [dstq+strideq*4 +16], m0 - mova [dstq+stride3q*2 ], m0 - mova [dstq+stride3q*2+16], m0 - lea dstq, [dstq+strideq*8] - dec lines4d - jnz .loop - - RESTORE_GOT - REP_RET - -%if ARCH_X86_64 -INIT_XMM sse2 -cglobal highbd_dc_predictor_32x32, 4, 5, 9, dst, stride, above, left, goffset - GET_GOT goffsetq - - pxor m1, m1 - mova m0, [aboveq] - mova m2, [aboveq+16] - mova m3, [aboveq+32] - mova m4, [aboveq+48] - mova m5, [leftq] - mova m6, [leftq+16] - mova m7, [leftq+32] - mova m8, [leftq+48] - DEFINE_ARGS dst, stride, stride3, lines4 - lea stride3q, [strideq*3] - mov lines4d, 8 - paddw m0, m2 - paddw m0, m3 - paddw m0, m4 - paddw m0, m5 - paddw m0, m6 - paddw m0, m7 - paddw m0, m8 - movhlps m2, m0 - paddw m0, m2 - punpcklwd m0, m1 - movhlps m2, m0 - paddd m0, m2 - punpckldq m0, m1 - movhlps m2, m0 - paddd m0, m2 - paddd m0, [GLOBAL(pw_32)] - psrad m0, 6 - pshuflw m0, m0, 0x0 - punpcklqdq m0, m0 -.loop: - mova [dstq ], m0 - mova [dstq +16 ], m0 - mova [dstq +32 ], m0 - mova [dstq +48 ], m0 - mova [dstq+strideq*2 ], m0 - mova [dstq+strideq*2+16 ], m0 - mova [dstq+strideq*2+32 ], m0 - mova [dstq+strideq*2+48 ], m0 - mova [dstq+strideq*4 ], m0 - mova [dstq+strideq*4+16 ], m0 - mova [dstq+strideq*4+32 ], m0 - mova [dstq+strideq*4+48 ], m0 - mova [dstq+stride3q*2 ], m0 - mova [dstq+stride3q*2 +16], m0 - mova [dstq+stride3q*2 +32], m0 - mova [dstq+stride3q*2 +48], m0 - lea dstq, [dstq+strideq*8] - dec lines4d - jnz .loop - - RESTORE_GOT - REP_RET -%endif - -INIT_MMX sse -cglobal highbd_v_predictor_4x4, 3, 3, 1, dst, stride, above - movq m0, [aboveq] - movq [dstq ], m0 - movq [dstq+strideq*2], m0 - lea dstq, [dstq+strideq*4] - movq [dstq ], m0 - movq [dstq+strideq*2], m0 - RET - -INIT_XMM sse2 -cglobal highbd_v_predictor_8x8, 3, 3, 1, dst, stride, above - mova m0, [aboveq] - DEFINE_ARGS dst, stride, stride3 - lea stride3q, [strideq*3] - mova [dstq ], m0 - mova [dstq+strideq*2 ], m0 - mova [dstq+strideq*4 ], m0 - mova [dstq+stride3q*2], m0 - lea dstq, [dstq+strideq*8] - mova [dstq ], m0 - mova [dstq+strideq*2 ], m0 - mova [dstq+strideq*4 ], m0 - mova [dstq+stride3q*2], m0 - RET - -INIT_XMM sse2 -cglobal highbd_v_predictor_16x16, 3, 4, 2, dst, stride, above - mova m0, [aboveq] - mova m1, [aboveq+16] - DEFINE_ARGS dst, stride, stride3, nlines4 - lea stride3q, [strideq*3] - mov nlines4d, 4 -.loop: - mova [dstq ], m0 - mova [dstq +16], m1 - mova [dstq+strideq*2 ], m0 - mova [dstq+strideq*2 +16], m1 - mova [dstq+strideq*4 ], m0 - mova [dstq+strideq*4 +16], m1 - mova [dstq+stride3q*2 ], m0 - mova [dstq+stride3q*2+16], m1 - lea dstq, [dstq+strideq*8] - dec nlines4d - jnz .loop - REP_RET - -INIT_XMM sse2 -cglobal highbd_v_predictor_32x32, 3, 4, 4, dst, stride, above - mova m0, [aboveq] - mova m1, [aboveq+16] - mova m2, [aboveq+32] - mova m3, [aboveq+48] - DEFINE_ARGS dst, stride, stride3, nlines4 - lea stride3q, [strideq*3] - mov nlines4d, 8 -.loop: - mova [dstq ], m0 - mova [dstq +16], m1 - mova [dstq +32], m2 - mova [dstq +48], m3 - mova [dstq+strideq*2 ], m0 - mova [dstq+strideq*2 +16], m1 - mova [dstq+strideq*2 +32], m2 - mova [dstq+strideq*2 +48], m3 - mova [dstq+strideq*4 ], m0 - mova [dstq+strideq*4 +16], m1 - mova [dstq+strideq*4 +32], m2 - mova [dstq+strideq*4 +48], m3 - mova [dstq+stride3q*2 ], m0 - mova [dstq+stride3q*2 +16], m1 - mova [dstq+stride3q*2 +32], m2 - mova [dstq+stride3q*2 +48], m3 - lea dstq, [dstq+strideq*8] - dec nlines4d - jnz .loop - REP_RET - -INIT_MMX sse -cglobal highbd_tm_predictor_4x4, 5, 6, 5, dst, stride, above, left, bps, one - movd m1, [aboveq-2] - movq m0, [aboveq] - pshufw m1, m1, 0x0 - ; Get the values to compute the maximum value at this bit depth - mov oned, 1 - movd m3, oned - movd m4, bpsd - pshufw m3, m3, 0x0 - DEFINE_ARGS dst, stride, line, left - mov lineq, -2 - mova m2, m3 - psllw m3, m4 - add leftq, 8 - psubw m3, m2 ; max possible value - pxor m4, m4 ; min possible value - psubw m0, m1 -.loop: - movq m1, [leftq+lineq*4] - movq m2, [leftq+lineq*4+2] - pshufw m1, m1, 0x0 - pshufw m2, m2, 0x0 - paddw m1, m0 - paddw m2, m0 - ;Clamp to the bit-depth - pminsw m1, m3 - pminsw m2, m3 - pmaxsw m1, m4 - pmaxsw m2, m4 - ;Store the values - movq [dstq ], m1 - movq [dstq+strideq*2], m2 - lea dstq, [dstq+strideq*4] - inc lineq - jnz .loop - REP_RET - -INIT_XMM sse2 -cglobal highbd_tm_predictor_8x8, 5, 6, 5, dst, stride, above, left, bps, one - movd m1, [aboveq-2] - mova m0, [aboveq] - pshuflw m1, m1, 0x0 - ; Get the values to compute the maximum value at this bit depth - mov oned, 1 - pxor m3, m3 - pxor m4, m4 - pinsrw m3, oned, 0 - pinsrw m4, bpsd, 0 - pshuflw m3, m3, 0x0 - DEFINE_ARGS dst, stride, line, left - punpcklqdq m3, m3 - mov lineq, -4 - mova m2, m3 - punpcklqdq m1, m1 - psllw m3, m4 - add leftq, 16 - psubw m3, m2 ; max possible value - pxor m4, m4 ; min possible value - psubw m0, m1 -.loop: - movd m1, [leftq+lineq*4] - movd m2, [leftq+lineq*4+2] - pshuflw m1, m1, 0x0 - pshuflw m2, m2, 0x0 - punpcklqdq m1, m1 - punpcklqdq m2, m2 - paddw m1, m0 - paddw m2, m0 - ;Clamp to the bit-depth - pminsw m1, m3 - pminsw m2, m3 - pmaxsw m1, m4 - pmaxsw m2, m4 - ;Store the values - mova [dstq ], m1 - mova [dstq+strideq*2], m2 - lea dstq, [dstq+strideq*4] - inc lineq - jnz .loop - REP_RET - -%if ARCH_X86_64 -INIT_XMM sse2 -cglobal highbd_tm_predictor_16x16, 5, 6, 9, dst, stride, above, left, bps, one - movd m2, [aboveq-2] - mova m0, [aboveq] - mova m1, [aboveq+16] - pshuflw m2, m2, 0x0 - ; Get the values to compute the maximum value at this bit depth - mov oned, 1 - pxor m7, m7 - pxor m8, m8 - pinsrw m7, oned, 0 - pinsrw m8, bpsd, 0 - pshuflw m7, m7, 0x0 - DEFINE_ARGS dst, stride, line, left - punpcklqdq m7, m7 - mov lineq, -8 - mova m5, m7 - punpcklqdq m2, m2 - psllw m7, m8 - add leftq, 32 - psubw m7, m5 ; max possible value - pxor m8, m8 ; min possible value - psubw m0, m2 - psubw m1, m2 -.loop: - movd m2, [leftq+lineq*4] - movd m3, [leftq+lineq*4+2] - pshuflw m2, m2, 0x0 - pshuflw m3, m3, 0x0 - punpcklqdq m2, m2 - punpcklqdq m3, m3 - paddw m4, m2, m0 - paddw m5, m3, m0 - paddw m2, m1 - paddw m3, m1 - ;Clamp to the bit-depth - pminsw m4, m7 - pminsw m5, m7 - pminsw m2, m7 - pminsw m3, m7 - pmaxsw m4, m8 - pmaxsw m5, m8 - pmaxsw m2, m8 - pmaxsw m3, m8 - ;Store the values - mova [dstq ], m4 - mova [dstq+strideq*2 ], m5 - mova [dstq +16], m2 - mova [dstq+strideq*2+16], m3 - lea dstq, [dstq+strideq*4] - inc lineq - jnz .loop - REP_RET - -INIT_XMM sse2 -cglobal highbd_tm_predictor_32x32, 5, 6, 12, dst, stride, above, left, bps, one - movd m0, [aboveq-2] - mova m1, [aboveq] - mova m2, [aboveq+16] - mova m3, [aboveq+32] - mova m4, [aboveq+48] - pshuflw m0, m0, 0x0 - ; Get the values to compute the maximum value at this bit depth - mov oned, 1 - pxor m10, m10 - pxor m11, m11 - pinsrw m10, oned, 0 - pinsrw m11, bpsd, 0 - pshuflw m10, m10, 0x0 - DEFINE_ARGS dst, stride, line, left - punpcklqdq m10, m10 - mov lineq, -16 - mova m5, m10 - punpcklqdq m0, m0 - psllw m10, m11 - add leftq, 64 - psubw m10, m5 ; max possible value - pxor m11, m11 ; min possible value - psubw m1, m0 - psubw m2, m0 - psubw m3, m0 - psubw m4, m0 -.loop: - movd m5, [leftq+lineq*4] - movd m6, [leftq+lineq*4+2] - pshuflw m5, m5, 0x0 - pshuflw m6, m6, 0x0 - punpcklqdq m5, m5 - punpcklqdq m6, m6 - paddw m7, m5, m1 - paddw m8, m5, m2 - paddw m9, m5, m3 - paddw m5, m4 - ;Clamp these values to the bit-depth - pminsw m7, m10 - pminsw m8, m10 - pminsw m9, m10 - pminsw m5, m10 - pmaxsw m7, m11 - pmaxsw m8, m11 - pmaxsw m9, m11 - pmaxsw m5, m11 - ;Store these values - mova [dstq ], m7 - mova [dstq +16], m8 - mova [dstq +32], m9 - mova [dstq +48], m5 - paddw m7, m6, m1 - paddw m8, m6, m2 - paddw m9, m6, m3 - paddw m6, m4 - ;Clamp these values to the bit-depth - pminsw m7, m10 - pminsw m8, m10 - pminsw m9, m10 - pminsw m6, m10 - pmaxsw m7, m11 - pmaxsw m8, m11 - pmaxsw m9, m11 - pmaxsw m6, m11 - ;Store these values - mova [dstq+strideq*2 ], m7 - mova [dstq+strideq*2+16], m8 - mova [dstq+strideq*2+32], m9 - mova [dstq+strideq*2+48], m6 - lea dstq, [dstq+strideq*4] - inc lineq - jnz .loop - REP_RET -%endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_high_loopfilter_intrin_sse2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_high_loopfilter_intrin_sse2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_high_loopfilter_intrin_sse2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_high_loopfilter_intrin_sse2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1214 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include // SSE2 - -#include "./vp9_rtcd.h" -#include "vp9/common/vp9_loopfilter.h" -#include "vpx_ports/emmintrin_compat.h" - -static INLINE __m128i signed_char_clamp_bd_sse2(__m128i value, int bd) { - __m128i ubounded; - __m128i lbounded; - __m128i retval; - - const __m128i zero = _mm_set1_epi16(0); - const __m128i one = _mm_set1_epi16(1); - __m128i t80, max, min; - - if (bd == 8) { - t80 = _mm_set1_epi16(0x80); - max = _mm_subs_epi16( - _mm_subs_epi16(_mm_slli_epi16(one, 8), one), t80); - } else if (bd == 10) { - t80 = _mm_set1_epi16(0x200); - max = _mm_subs_epi16( - _mm_subs_epi16(_mm_slli_epi16(one, 10), one), t80); - } else { // bd == 12 - t80 = _mm_set1_epi16(0x800); - max = _mm_subs_epi16( - _mm_subs_epi16(_mm_slli_epi16(one, 12), one), t80); - } - - min = _mm_subs_epi16(zero, t80); - - ubounded = _mm_cmpgt_epi16(value, max); - lbounded = _mm_cmplt_epi16(value, min); - retval = _mm_andnot_si128(_mm_or_si128(ubounded, lbounded), value); - ubounded = _mm_and_si128(ubounded, max); - lbounded = _mm_and_si128(lbounded, min); - retval = _mm_or_si128(retval, ubounded); - retval = _mm_or_si128(retval, lbounded); - return retval; -} - -// TODO(debargha, peter): Break up large functions into smaller ones -// in this file. -static void highbd_mb_lpf_horizontal_edge_w_sse2_8(uint16_t *s, - int p, - const uint8_t *_blimit, - const uint8_t *_limit, - const uint8_t *_thresh, - int bd) { - const __m128i zero = _mm_set1_epi16(0); - const __m128i one = _mm_set1_epi16(1); - __m128i blimit, limit, thresh; - __m128i q7, p7, q6, p6, q5, p5, q4, p4, q3, p3, q2, p2, q1, p1, q0, p0; - __m128i mask, hev, flat, flat2, abs_p1p0, abs_q1q0; - __m128i ps1, qs1, ps0, qs0; - __m128i abs_p0q0, abs_p1q1, ffff, work; - __m128i filt, work_a, filter1, filter2; - __m128i flat2_q6, flat2_p6, flat2_q5, flat2_p5, flat2_q4, flat2_p4; - __m128i flat2_q3, flat2_p3, flat2_q2, flat2_p2, flat2_q1, flat2_p1; - __m128i flat2_q0, flat2_p0; - __m128i flat_q2, flat_p2, flat_q1, flat_p1, flat_q0, flat_p0; - __m128i pixelFilter_p, pixelFilter_q; - __m128i pixetFilter_p2p1p0, pixetFilter_q2q1q0; - __m128i sum_p7, sum_q7, sum_p3, sum_q3; - __m128i t4, t3, t80, t1; - __m128i eight, four; - - if (bd == 8) { - blimit = _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_blimit), zero); - limit = _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_limit), zero); - thresh = _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_thresh), zero); - } else if (bd == 10) { - blimit = _mm_slli_epi16( - _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_blimit), zero), 2); - limit = _mm_slli_epi16( - _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_limit), zero), 2); - thresh = _mm_slli_epi16( - _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_thresh), zero), 2); - } else { // bd == 12 - blimit = _mm_slli_epi16( - _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_blimit), zero), 4); - limit = _mm_slli_epi16( - _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_limit), zero), 4); - thresh = _mm_slli_epi16( - _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_thresh), zero), 4); - } - - q4 = _mm_load_si128((__m128i *)(s + 4 * p)); - p4 = _mm_load_si128((__m128i *)(s - 5 * p)); - q3 = _mm_load_si128((__m128i *)(s + 3 * p)); - p3 = _mm_load_si128((__m128i *)(s - 4 * p)); - q2 = _mm_load_si128((__m128i *)(s + 2 * p)); - p2 = _mm_load_si128((__m128i *)(s - 3 * p)); - q1 = _mm_load_si128((__m128i *)(s + 1 * p)); - p1 = _mm_load_si128((__m128i *)(s - 2 * p)); - q0 = _mm_load_si128((__m128i *)(s + 0 * p)); - p0 = _mm_load_si128((__m128i *)(s - 1 * p)); - - // highbd_filter_mask - abs_p1p0 = _mm_or_si128(_mm_subs_epu16(p1, p0), _mm_subs_epu16(p0, p1)); - abs_q1q0 = _mm_or_si128(_mm_subs_epu16(q1, q0), _mm_subs_epu16(q0, q1)); - - ffff = _mm_cmpeq_epi16(abs_p1p0, abs_p1p0); - - abs_p0q0 = _mm_or_si128(_mm_subs_epu16(p0, q0), _mm_subs_epu16(q0, p0)); - abs_p1q1 = _mm_or_si128(_mm_subs_epu16(p1, q1), _mm_subs_epu16(q1, p1)); - - // highbd_hev_mask (in C code this is actually called from highbd_filter4) - flat = _mm_max_epi16(abs_p1p0, abs_q1q0); - hev = _mm_subs_epu16(flat, thresh); - hev = _mm_xor_si128(_mm_cmpeq_epi16(hev, zero), ffff); - - abs_p0q0 =_mm_adds_epu16(abs_p0q0, abs_p0q0); // abs(p0 - q0) * 2 - abs_p1q1 = _mm_srli_epi16(abs_p1q1, 1); // abs(p1 - q1) / 2 - mask = _mm_subs_epu16(_mm_adds_epu16(abs_p0q0, abs_p1q1), blimit); - mask = _mm_xor_si128(_mm_cmpeq_epi16(mask, zero), ffff); - mask = _mm_and_si128(mask, _mm_adds_epu16(limit, one)); - work = _mm_max_epi16(_mm_or_si128(_mm_subs_epu16(p1, p0), - _mm_subs_epu16(p0, p1)), - _mm_or_si128(_mm_subs_epu16(q1, q0), - _mm_subs_epu16(q0, q1))); - mask = _mm_max_epi16(work, mask); - work = _mm_max_epi16(_mm_or_si128(_mm_subs_epu16(p2, p1), - _mm_subs_epu16(p1, p2)), - _mm_or_si128(_mm_subs_epu16(q2, q1), - _mm_subs_epu16(q1, q2))); - mask = _mm_max_epi16(work, mask); - work = _mm_max_epi16(_mm_or_si128(_mm_subs_epu16(p3, p2), - _mm_subs_epu16(p2, p3)), - _mm_or_si128(_mm_subs_epu16(q3, q2), - _mm_subs_epu16(q2, q3))); - mask = _mm_max_epi16(work, mask); - - mask = _mm_subs_epu16(mask, limit); - mask = _mm_cmpeq_epi16(mask, zero); // return ~mask - - // lp filter - // highbd_filter4 - t4 = _mm_set1_epi16(4); - t3 = _mm_set1_epi16(3); - if (bd == 8) - t80 = _mm_set1_epi16(0x80); - else if (bd == 10) - t80 = _mm_set1_epi16(0x200); - else // bd == 12 - t80 = _mm_set1_epi16(0x800); - - t1 = _mm_set1_epi16(0x1); - - ps1 = _mm_subs_epi16(p1, t80); - qs1 = _mm_subs_epi16(q1, t80); - ps0 = _mm_subs_epi16(p0, t80); - qs0 = _mm_subs_epi16(q0, t80); - - filt = _mm_and_si128( - signed_char_clamp_bd_sse2(_mm_subs_epi16(ps1, qs1), bd), hev); - work_a = _mm_subs_epi16(qs0, ps0); - filt = _mm_adds_epi16(filt, work_a); - filt = _mm_adds_epi16(filt, work_a); - filt = signed_char_clamp_bd_sse2(_mm_adds_epi16(filt, work_a), bd); - filt = _mm_and_si128(filt, mask); - filter1 = signed_char_clamp_bd_sse2(_mm_adds_epi16(filt, t4), bd); - filter2 = signed_char_clamp_bd_sse2(_mm_adds_epi16(filt, t3), bd); - - // Filter1 >> 3 - filter1 = _mm_srai_epi16(filter1, 0x3); - filter2 = _mm_srai_epi16(filter2, 0x3); - - qs0 = _mm_adds_epi16( - signed_char_clamp_bd_sse2(_mm_subs_epi16(qs0, filter1), bd), - t80); - ps0 = _mm_adds_epi16( - signed_char_clamp_bd_sse2(_mm_adds_epi16(ps0, filter2), bd), - t80); - filt = _mm_adds_epi16(filter1, t1); - filt = _mm_srai_epi16(filt, 1); - filt = _mm_andnot_si128(hev, filt); - qs1 = _mm_adds_epi16( - signed_char_clamp_bd_sse2(_mm_subs_epi16(qs1, filt), bd), - t80); - ps1 = _mm_adds_epi16( - signed_char_clamp_bd_sse2(_mm_adds_epi16(ps1, filt), bd), - t80); - - // end highbd_filter4 - // loopfilter done - - // highbd_flat_mask4 - flat = _mm_max_epi16(_mm_or_si128(_mm_subs_epu16(p2, p0), - _mm_subs_epu16(p0, p2)), - _mm_or_si128(_mm_subs_epu16(p3, p0), - _mm_subs_epu16(p0, p3))); - work = _mm_max_epi16(_mm_or_si128(_mm_subs_epu16(q2, q0), - _mm_subs_epu16(q0, q2)), - _mm_or_si128(_mm_subs_epu16(q3, q0), - _mm_subs_epu16(q0, q3))); - flat = _mm_max_epi16(work, flat); - work = _mm_max_epi16(abs_p1p0, abs_q1q0); - flat = _mm_max_epi16(work, flat); - - if (bd == 8) - flat = _mm_subs_epu16(flat, one); - else if (bd == 10) - flat = _mm_subs_epu16(flat, _mm_slli_epi16(one, 2)); - else // bd == 12 - flat = _mm_subs_epu16(flat, _mm_slli_epi16(one, 4)); - - flat = _mm_cmpeq_epi16(flat, zero); - // end flat_mask4 - - // flat & mask = flat && mask (as used in filter8) - // (because, in both vars, each block of 16 either all 1s or all 0s) - flat = _mm_and_si128(flat, mask); - - p5 = _mm_load_si128((__m128i *)(s - 6 * p)); - q5 = _mm_load_si128((__m128i *)(s + 5 * p)); - p6 = _mm_load_si128((__m128i *)(s - 7 * p)); - q6 = _mm_load_si128((__m128i *)(s + 6 * p)); - p7 = _mm_load_si128((__m128i *)(s - 8 * p)); - q7 = _mm_load_si128((__m128i *)(s + 7 * p)); - - // highbd_flat_mask5 (arguments passed in are p0, q0, p4-p7, q4-q7 - // but referred to as p0-p4 & q0-q4 in fn) - flat2 = _mm_max_epi16(_mm_or_si128(_mm_subs_epu16(p4, p0), - _mm_subs_epu16(p0, p4)), - _mm_or_si128(_mm_subs_epu16(q4, q0), - _mm_subs_epu16(q0, q4))); - - work = _mm_max_epi16(_mm_or_si128(_mm_subs_epu16(p5, p0), - _mm_subs_epu16(p0, p5)), - _mm_or_si128(_mm_subs_epu16(q5, q0), - _mm_subs_epu16(q0, q5))); - flat2 = _mm_max_epi16(work, flat2); - - work = _mm_max_epi16(_mm_or_si128(_mm_subs_epu16(p6, p0), - _mm_subs_epu16(p0, p6)), - _mm_or_si128(_mm_subs_epu16(q6, q0), - _mm_subs_epu16(q0, q6))); - flat2 = _mm_max_epi16(work, flat2); - - work = _mm_max_epi16(_mm_or_si128(_mm_subs_epu16(p7, p0), - _mm_subs_epu16(p0, p7)), - _mm_or_si128(_mm_subs_epu16(q7, q0), - _mm_subs_epu16(q0, q7))); - flat2 = _mm_max_epi16(work, flat2); - - if (bd == 8) - flat2 = _mm_subs_epu16(flat2, one); - else if (bd == 10) - flat2 = _mm_subs_epu16(flat2, _mm_slli_epi16(one, 2)); - else // bd == 12 - flat2 = _mm_subs_epu16(flat2, _mm_slli_epi16(one, 4)); - - flat2 = _mm_cmpeq_epi16(flat2, zero); - flat2 = _mm_and_si128(flat2, flat); // flat2 & flat & mask - // end highbd_flat_mask5 - - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // flat and wide flat calculations - eight = _mm_set1_epi16(8); - four = _mm_set1_epi16(4); - - pixelFilter_p = _mm_add_epi16(_mm_add_epi16(p6, p5), - _mm_add_epi16(p4, p3)); - pixelFilter_q = _mm_add_epi16(_mm_add_epi16(q6, q5), - _mm_add_epi16(q4, q3)); - - pixetFilter_p2p1p0 = _mm_add_epi16(p0, _mm_add_epi16(p2, p1)); - pixelFilter_p = _mm_add_epi16(pixelFilter_p, pixetFilter_p2p1p0); - - pixetFilter_q2q1q0 = _mm_add_epi16(q0, _mm_add_epi16(q2, q1)); - pixelFilter_q = _mm_add_epi16(pixelFilter_q, pixetFilter_q2q1q0); - pixelFilter_p = _mm_add_epi16(eight, _mm_add_epi16(pixelFilter_p, - pixelFilter_q)); - pixetFilter_p2p1p0 = _mm_add_epi16(four, - _mm_add_epi16(pixetFilter_p2p1p0, - pixetFilter_q2q1q0)); - flat2_p0 = _mm_srli_epi16(_mm_add_epi16(pixelFilter_p, - _mm_add_epi16(p7, p0)), 4); - flat2_q0 = _mm_srli_epi16(_mm_add_epi16(pixelFilter_p, - _mm_add_epi16(q7, q0)), 4); - flat_p0 = _mm_srli_epi16(_mm_add_epi16(pixetFilter_p2p1p0, - _mm_add_epi16(p3, p0)), 3); - flat_q0 = _mm_srli_epi16(_mm_add_epi16(pixetFilter_p2p1p0, - _mm_add_epi16(q3, q0)), 3); - - sum_p7 = _mm_add_epi16(p7, p7); - sum_q7 = _mm_add_epi16(q7, q7); - sum_p3 = _mm_add_epi16(p3, p3); - sum_q3 = _mm_add_epi16(q3, q3); - - pixelFilter_q = _mm_sub_epi16(pixelFilter_p, p6); - pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q6); - flat2_p1 = _mm_srli_epi16( - _mm_add_epi16(pixelFilter_p, _mm_add_epi16(sum_p7, p1)), 4); - flat2_q1 = _mm_srli_epi16( - _mm_add_epi16(pixelFilter_q, _mm_add_epi16(sum_q7, q1)), 4); - - pixetFilter_q2q1q0 = _mm_sub_epi16(pixetFilter_p2p1p0, p2); - pixetFilter_p2p1p0 = _mm_sub_epi16(pixetFilter_p2p1p0, q2); - flat_p1 = _mm_srli_epi16(_mm_add_epi16(pixetFilter_p2p1p0, - _mm_add_epi16(sum_p3, p1)), 3); - flat_q1 = _mm_srli_epi16(_mm_add_epi16(pixetFilter_q2q1q0, - _mm_add_epi16(sum_q3, q1)), 3); - - sum_p7 = _mm_add_epi16(sum_p7, p7); - sum_q7 = _mm_add_epi16(sum_q7, q7); - sum_p3 = _mm_add_epi16(sum_p3, p3); - sum_q3 = _mm_add_epi16(sum_q3, q3); - - pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q5); - pixelFilter_q = _mm_sub_epi16(pixelFilter_q, p5); - flat2_p2 = _mm_srli_epi16(_mm_add_epi16(pixelFilter_p, - _mm_add_epi16(sum_p7, p2)), 4); - flat2_q2 = _mm_srli_epi16(_mm_add_epi16(pixelFilter_q, - _mm_add_epi16(sum_q7, q2)), 4); - - pixetFilter_p2p1p0 = _mm_sub_epi16(pixetFilter_p2p1p0, q1); - pixetFilter_q2q1q0 = _mm_sub_epi16(pixetFilter_q2q1q0, p1); - flat_p2 = _mm_srli_epi16(_mm_add_epi16(pixetFilter_p2p1p0, - _mm_add_epi16(sum_p3, p2)), 3); - flat_q2 = _mm_srli_epi16(_mm_add_epi16(pixetFilter_q2q1q0, - _mm_add_epi16(sum_q3, q2)), 3); - - sum_p7 = _mm_add_epi16(sum_p7, p7); - sum_q7 = _mm_add_epi16(sum_q7, q7); - pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q4); - pixelFilter_q = _mm_sub_epi16(pixelFilter_q, p4); - flat2_p3 = _mm_srli_epi16(_mm_add_epi16(pixelFilter_p, - _mm_add_epi16(sum_p7, p3)), 4); - flat2_q3 = _mm_srli_epi16(_mm_add_epi16(pixelFilter_q, - _mm_add_epi16(sum_q7, q3)), 4); - - sum_p7 = _mm_add_epi16(sum_p7, p7); - sum_q7 = _mm_add_epi16(sum_q7, q7); - pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q3); - pixelFilter_q = _mm_sub_epi16(pixelFilter_q, p3); - flat2_p4 = _mm_srli_epi16(_mm_add_epi16(pixelFilter_p, - _mm_add_epi16(sum_p7, p4)), 4); - flat2_q4 = _mm_srli_epi16(_mm_add_epi16(pixelFilter_q, - _mm_add_epi16(sum_q7, q4)), 4); - - sum_p7 = _mm_add_epi16(sum_p7, p7); - sum_q7 = _mm_add_epi16(sum_q7, q7); - pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q2); - pixelFilter_q = _mm_sub_epi16(pixelFilter_q, p2); - flat2_p5 = _mm_srli_epi16(_mm_add_epi16(pixelFilter_p, - _mm_add_epi16(sum_p7, p5)), 4); - flat2_q5 = _mm_srli_epi16(_mm_add_epi16(pixelFilter_q, - _mm_add_epi16(sum_q7, q5)), 4); - - sum_p7 = _mm_add_epi16(sum_p7, p7); - sum_q7 = _mm_add_epi16(sum_q7, q7); - pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q1); - pixelFilter_q = _mm_sub_epi16(pixelFilter_q, p1); - flat2_p6 = _mm_srli_epi16(_mm_add_epi16(pixelFilter_p, - _mm_add_epi16(sum_p7, p6)), 4); - flat2_q6 = _mm_srli_epi16(_mm_add_epi16(pixelFilter_q, - _mm_add_epi16(sum_q7, q6)), 4); - - // wide flat - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - // highbd_filter8 - p2 = _mm_andnot_si128(flat, p2); - // p2 remains unchanged if !(flat && mask) - flat_p2 = _mm_and_si128(flat, flat_p2); - // when (flat && mask) - p2 = _mm_or_si128(p2, flat_p2); // full list of p2 values - q2 = _mm_andnot_si128(flat, q2); - flat_q2 = _mm_and_si128(flat, flat_q2); - q2 = _mm_or_si128(q2, flat_q2); // full list of q2 values - - ps1 = _mm_andnot_si128(flat, ps1); - // p1 takes the value assigned to in in filter4 if !(flat && mask) - flat_p1 = _mm_and_si128(flat, flat_p1); - // when (flat && mask) - p1 = _mm_or_si128(ps1, flat_p1); // full list of p1 values - qs1 = _mm_andnot_si128(flat, qs1); - flat_q1 = _mm_and_si128(flat, flat_q1); - q1 = _mm_or_si128(qs1, flat_q1); // full list of q1 values - - ps0 = _mm_andnot_si128(flat, ps0); - // p0 takes the value assigned to in in filter4 if !(flat && mask) - flat_p0 = _mm_and_si128(flat, flat_p0); - // when (flat && mask) - p0 = _mm_or_si128(ps0, flat_p0); // full list of p0 values - qs0 = _mm_andnot_si128(flat, qs0); - flat_q0 = _mm_and_si128(flat, flat_q0); - q0 = _mm_or_si128(qs0, flat_q0); // full list of q0 values - // end highbd_filter8 - - // highbd_filter16 - p6 = _mm_andnot_si128(flat2, p6); - // p6 remains unchanged if !(flat2 && flat && mask) - flat2_p6 = _mm_and_si128(flat2, flat2_p6); - // get values for when (flat2 && flat && mask) - p6 = _mm_or_si128(p6, flat2_p6); // full list of p6 values - q6 = _mm_andnot_si128(flat2, q6); - // q6 remains unchanged if !(flat2 && flat && mask) - flat2_q6 = _mm_and_si128(flat2, flat2_q6); - // get values for when (flat2 && flat && mask) - q6 = _mm_or_si128(q6, flat2_q6); // full list of q6 values - _mm_store_si128((__m128i *)(s - 7 * p), p6); - _mm_store_si128((__m128i *)(s + 6 * p), q6); - - p5 = _mm_andnot_si128(flat2, p5); - // p5 remains unchanged if !(flat2 && flat && mask) - flat2_p5 = _mm_and_si128(flat2, flat2_p5); - // get values for when (flat2 && flat && mask) - p5 = _mm_or_si128(p5, flat2_p5); - // full list of p5 values - q5 = _mm_andnot_si128(flat2, q5); - // q5 remains unchanged if !(flat2 && flat && mask) - flat2_q5 = _mm_and_si128(flat2, flat2_q5); - // get values for when (flat2 && flat && mask) - q5 = _mm_or_si128(q5, flat2_q5); - // full list of q5 values - _mm_store_si128((__m128i *)(s - 6 * p), p5); - _mm_store_si128((__m128i *)(s + 5 * p), q5); - - p4 = _mm_andnot_si128(flat2, p4); - // p4 remains unchanged if !(flat2 && flat && mask) - flat2_p4 = _mm_and_si128(flat2, flat2_p4); - // get values for when (flat2 && flat && mask) - p4 = _mm_or_si128(p4, flat2_p4); // full list of p4 values - q4 = _mm_andnot_si128(flat2, q4); - // q4 remains unchanged if !(flat2 && flat && mask) - flat2_q4 = _mm_and_si128(flat2, flat2_q4); - // get values for when (flat2 && flat && mask) - q4 = _mm_or_si128(q4, flat2_q4); // full list of q4 values - _mm_store_si128((__m128i *)(s - 5 * p), p4); - _mm_store_si128((__m128i *)(s + 4 * p), q4); - - p3 = _mm_andnot_si128(flat2, p3); - // p3 takes value from highbd_filter8 if !(flat2 && flat && mask) - flat2_p3 = _mm_and_si128(flat2, flat2_p3); - // get values for when (flat2 && flat && mask) - p3 = _mm_or_si128(p3, flat2_p3); // full list of p3 values - q3 = _mm_andnot_si128(flat2, q3); - // q3 takes value from highbd_filter8 if !(flat2 && flat && mask) - flat2_q3 = _mm_and_si128(flat2, flat2_q3); - // get values for when (flat2 && flat && mask) - q3 = _mm_or_si128(q3, flat2_q3); // full list of q3 values - _mm_store_si128((__m128i *)(s - 4 * p), p3); - _mm_store_si128((__m128i *)(s + 3 * p), q3); - - p2 = _mm_andnot_si128(flat2, p2); - // p2 takes value from highbd_filter8 if !(flat2 && flat && mask) - flat2_p2 = _mm_and_si128(flat2, flat2_p2); - // get values for when (flat2 && flat && mask) - p2 = _mm_or_si128(p2, flat2_p2); - // full list of p2 values - q2 = _mm_andnot_si128(flat2, q2); - // q2 takes value from highbd_filter8 if !(flat2 && flat && mask) - flat2_q2 = _mm_and_si128(flat2, flat2_q2); - // get values for when (flat2 && flat && mask) - q2 = _mm_or_si128(q2, flat2_q2); // full list of q2 values - _mm_store_si128((__m128i *)(s - 3 * p), p2); - _mm_store_si128((__m128i *)(s + 2 * p), q2); - - p1 = _mm_andnot_si128(flat2, p1); - // p1 takes value from highbd_filter8 if !(flat2 && flat && mask) - flat2_p1 = _mm_and_si128(flat2, flat2_p1); - // get values for when (flat2 && flat && mask) - p1 = _mm_or_si128(p1, flat2_p1); // full list of p1 values - q1 = _mm_andnot_si128(flat2, q1); - // q1 takes value from highbd_filter8 if !(flat2 && flat && mask) - flat2_q1 = _mm_and_si128(flat2, flat2_q1); - // get values for when (flat2 && flat && mask) - q1 = _mm_or_si128(q1, flat2_q1); // full list of q1 values - _mm_store_si128((__m128i *)(s - 2 * p), p1); - _mm_store_si128((__m128i *)(s + 1 * p), q1); - - p0 = _mm_andnot_si128(flat2, p0); - // p0 takes value from highbd_filter8 if !(flat2 && flat && mask) - flat2_p0 = _mm_and_si128(flat2, flat2_p0); - // get values for when (flat2 && flat && mask) - p0 = _mm_or_si128(p0, flat2_p0); // full list of p0 values - q0 = _mm_andnot_si128(flat2, q0); - // q0 takes value from highbd_filter8 if !(flat2 && flat && mask) - flat2_q0 = _mm_and_si128(flat2, flat2_q0); - // get values for when (flat2 && flat && mask) - q0 = _mm_or_si128(q0, flat2_q0); // full list of q0 values - _mm_store_si128((__m128i *)(s - 1 * p), p0); - _mm_store_si128((__m128i *)(s - 0 * p), q0); -} - -static void highbd_mb_lpf_horizontal_edge_w_sse2_16(uint16_t *s, - int p, - const uint8_t *_blimit, - const uint8_t *_limit, - const uint8_t *_thresh, - int bd) { - highbd_mb_lpf_horizontal_edge_w_sse2_8(s, p, _blimit, _limit, _thresh, bd); - highbd_mb_lpf_horizontal_edge_w_sse2_8(s + 8, p, _blimit, _limit, _thresh, - bd); -} - -// TODO(yunqingwang): remove count and call these 2 functions(8 or 16) directly. -void vp9_highbd_lpf_horizontal_16_sse2(uint16_t *s, int p, - const uint8_t *_blimit, - const uint8_t *_limit, - const uint8_t *_thresh, - int count, int bd) { - if (count == 1) - highbd_mb_lpf_horizontal_edge_w_sse2_8(s, p, _blimit, _limit, _thresh, bd); - else - highbd_mb_lpf_horizontal_edge_w_sse2_16(s, p, _blimit, _limit, _thresh, bd); -} - -void vp9_highbd_lpf_horizontal_8_sse2(uint16_t *s, int p, - const uint8_t *_blimit, - const uint8_t *_limit, - const uint8_t *_thresh, - int count, int bd) { - DECLARE_ALIGNED_ARRAY(16, uint16_t, flat_op2, 16); - DECLARE_ALIGNED_ARRAY(16, uint16_t, flat_op1, 16); - DECLARE_ALIGNED_ARRAY(16, uint16_t, flat_op0, 16); - DECLARE_ALIGNED_ARRAY(16, uint16_t, flat_oq2, 16); - DECLARE_ALIGNED_ARRAY(16, uint16_t, flat_oq1, 16); - DECLARE_ALIGNED_ARRAY(16, uint16_t, flat_oq0, 16); - const __m128i zero = _mm_set1_epi16(0); - __m128i blimit, limit, thresh; - __m128i mask, hev, flat; - __m128i p3 = _mm_load_si128((__m128i *)(s - 4 * p)); - __m128i q3 = _mm_load_si128((__m128i *)(s + 3 * p)); - __m128i p2 = _mm_load_si128((__m128i *)(s - 3 * p)); - __m128i q2 = _mm_load_si128((__m128i *)(s + 2 * p)); - __m128i p1 = _mm_load_si128((__m128i *)(s - 2 * p)); - __m128i q1 = _mm_load_si128((__m128i *)(s + 1 * p)); - __m128i p0 = _mm_load_si128((__m128i *)(s - 1 * p)); - __m128i q0 = _mm_load_si128((__m128i *)(s + 0 * p)); - const __m128i one = _mm_set1_epi16(1); - const __m128i ffff = _mm_cmpeq_epi16(one, one); - __m128i abs_p1q1, abs_p0q0, abs_q1q0, abs_p1p0, work; - const __m128i four = _mm_set1_epi16(4); - __m128i workp_a, workp_b, workp_shft; - - const __m128i t4 = _mm_set1_epi16(4); - const __m128i t3 = _mm_set1_epi16(3); - __m128i t80; - const __m128i t1 = _mm_set1_epi16(0x1); - __m128i ps1, ps0, qs0, qs1; - __m128i filt; - __m128i work_a; - __m128i filter1, filter2; - - (void)count; - - if (bd == 8) { - blimit = _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_blimit), zero); - limit = _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_limit), zero); - thresh = _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_thresh), zero); - t80 = _mm_set1_epi16(0x80); - } else if (bd == 10) { - blimit = _mm_slli_epi16( - _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_blimit), zero), 2); - limit = _mm_slli_epi16( - _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_limit), zero), 2); - thresh = _mm_slli_epi16( - _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_thresh), zero), 2); - t80 = _mm_set1_epi16(0x200); - } else { // bd == 12 - blimit = _mm_slli_epi16( - _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_blimit), zero), 4); - limit = _mm_slli_epi16( - _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_limit), zero), 4); - thresh = _mm_slli_epi16( - _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_thresh), zero), 4); - t80 = _mm_set1_epi16(0x800); - } - - ps1 = _mm_subs_epi16(p1, t80); - ps0 = _mm_subs_epi16(p0, t80); - qs0 = _mm_subs_epi16(q0, t80); - qs1 = _mm_subs_epi16(q1, t80); - - // filter_mask and hev_mask - abs_p1p0 = _mm_or_si128(_mm_subs_epu16(p1, p0), - _mm_subs_epu16(p0, p1)); - abs_q1q0 = _mm_or_si128(_mm_subs_epu16(q1, q0), - _mm_subs_epu16(q0, q1)); - - abs_p0q0 = _mm_or_si128(_mm_subs_epu16(p0, q0), - _mm_subs_epu16(q0, p0)); - abs_p1q1 = _mm_or_si128(_mm_subs_epu16(p1, q1), - _mm_subs_epu16(q1, p1)); - flat = _mm_max_epi16(abs_p1p0, abs_q1q0); - hev = _mm_subs_epu16(flat, thresh); - hev = _mm_xor_si128(_mm_cmpeq_epi16(hev, zero), ffff); - - abs_p0q0 =_mm_adds_epu16(abs_p0q0, abs_p0q0); - abs_p1q1 = _mm_srli_epi16(abs_p1q1, 1); - mask = _mm_subs_epu16(_mm_adds_epu16(abs_p0q0, abs_p1q1), blimit); - mask = _mm_xor_si128(_mm_cmpeq_epi16(mask, zero), ffff); - // mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 > blimit) * -1; - // So taking maximums continues to work: - mask = _mm_and_si128(mask, _mm_adds_epu16(limit, one)); - mask = _mm_max_epi16(abs_p1p0, mask); - // mask |= (abs(p1 - p0) > limit) * -1; - mask = _mm_max_epi16(abs_q1q0, mask); - // mask |= (abs(q1 - q0) > limit) * -1; - - work = _mm_max_epi16(_mm_or_si128(_mm_subs_epu16(p2, p1), - _mm_subs_epu16(p1, p2)), - _mm_or_si128(_mm_subs_epu16(q2, q1), - _mm_subs_epu16(q1, q2))); - mask = _mm_max_epi16(work, mask); - work = _mm_max_epi16(_mm_or_si128(_mm_subs_epu16(p3, p2), - _mm_subs_epu16(p2, p3)), - _mm_or_si128(_mm_subs_epu16(q3, q2), - _mm_subs_epu16(q2, q3))); - mask = _mm_max_epi16(work, mask); - mask = _mm_subs_epu16(mask, limit); - mask = _mm_cmpeq_epi16(mask, zero); - - // flat_mask4 - flat = _mm_max_epi16(_mm_or_si128(_mm_subs_epu16(p2, p0), - _mm_subs_epu16(p0, p2)), - _mm_or_si128(_mm_subs_epu16(q2, q0), - _mm_subs_epu16(q0, q2))); - work = _mm_max_epi16(_mm_or_si128(_mm_subs_epu16(p3, p0), - _mm_subs_epu16(p0, p3)), - _mm_or_si128(_mm_subs_epu16(q3, q0), - _mm_subs_epu16(q0, q3))); - flat = _mm_max_epi16(work, flat); - flat = _mm_max_epi16(abs_p1p0, flat); - flat = _mm_max_epi16(abs_q1q0, flat); - - if (bd == 8) - flat = _mm_subs_epu16(flat, one); - else if (bd == 10) - flat = _mm_subs_epu16(flat, _mm_slli_epi16(one, 2)); - else // bd == 12 - flat = _mm_subs_epu16(flat, _mm_slli_epi16(one, 4)); - - flat = _mm_cmpeq_epi16(flat, zero); - flat = _mm_and_si128(flat, mask); // flat & mask - - // Added before shift for rounding part of ROUND_POWER_OF_TWO - - workp_a = _mm_add_epi16(_mm_add_epi16(p3, p3), _mm_add_epi16(p2, p1)); - workp_a = _mm_add_epi16(_mm_add_epi16(workp_a, four), p0); - workp_b = _mm_add_epi16(_mm_add_epi16(q0, p2), p3); - workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3); - _mm_store_si128((__m128i *)&flat_op2[0], workp_shft); - - workp_b = _mm_add_epi16(_mm_add_epi16(q0, q1), p1); - workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3); - _mm_store_si128((__m128i *)&flat_op1[0], workp_shft); - - workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p3), q2); - workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, p1), p0); - workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3); - _mm_store_si128((__m128i *)&flat_op0[0], workp_shft); - - workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p3), q3); - workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, p0), q0); - workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3); - _mm_store_si128((__m128i *)&flat_oq0[0], workp_shft); - - workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p2), q3); - workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, q0), q1); - workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3); - _mm_store_si128((__m128i *)&flat_oq1[0], workp_shft); - - workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p1), q3); - workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, q1), q2); - workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3); - _mm_store_si128((__m128i *)&flat_oq2[0], workp_shft); - - // lp filter - filt = signed_char_clamp_bd_sse2(_mm_subs_epi16(ps1, qs1), bd); - filt = _mm_and_si128(filt, hev); - work_a = _mm_subs_epi16(qs0, ps0); - filt = _mm_adds_epi16(filt, work_a); - filt = _mm_adds_epi16(filt, work_a); - filt = _mm_adds_epi16(filt, work_a); - // (vp9_filter + 3 * (qs0 - ps0)) & mask - filt = signed_char_clamp_bd_sse2(filt, bd); - filt = _mm_and_si128(filt, mask); - - filter1 = _mm_adds_epi16(filt, t4); - filter2 = _mm_adds_epi16(filt, t3); - - // Filter1 >> 3 - filter1 = signed_char_clamp_bd_sse2(filter1, bd); - filter1 = _mm_srai_epi16(filter1, 3); - - // Filter2 >> 3 - filter2 = signed_char_clamp_bd_sse2(filter2, bd); - filter2 = _mm_srai_epi16(filter2, 3); - - // filt >> 1 - filt = _mm_adds_epi16(filter1, t1); - filt = _mm_srai_epi16(filt, 1); - // filter = ROUND_POWER_OF_TWO(filter1, 1) & ~hev; - filt = _mm_andnot_si128(hev, filt); - - work_a = signed_char_clamp_bd_sse2(_mm_subs_epi16(qs0, filter1), bd); - work_a = _mm_adds_epi16(work_a, t80); - q0 = _mm_load_si128((__m128i *)flat_oq0); - work_a = _mm_andnot_si128(flat, work_a); - q0 = _mm_and_si128(flat, q0); - q0 = _mm_or_si128(work_a, q0); - - work_a = signed_char_clamp_bd_sse2(_mm_subs_epi16(qs1, filt), bd); - work_a = _mm_adds_epi16(work_a, t80); - q1 = _mm_load_si128((__m128i *)flat_oq1); - work_a = _mm_andnot_si128(flat, work_a); - q1 = _mm_and_si128(flat, q1); - q1 = _mm_or_si128(work_a, q1); - - work_a = _mm_loadu_si128((__m128i *)(s + 2 * p)); - q2 = _mm_load_si128((__m128i *)flat_oq2); - work_a = _mm_andnot_si128(flat, work_a); - q2 = _mm_and_si128(flat, q2); - q2 = _mm_or_si128(work_a, q2); - - work_a = signed_char_clamp_bd_sse2(_mm_adds_epi16(ps0, filter2), bd); - work_a = _mm_adds_epi16(work_a, t80); - p0 = _mm_load_si128((__m128i *)flat_op0); - work_a = _mm_andnot_si128(flat, work_a); - p0 = _mm_and_si128(flat, p0); - p0 = _mm_or_si128(work_a, p0); - - work_a = signed_char_clamp_bd_sse2(_mm_adds_epi16(ps1, filt), bd); - work_a = _mm_adds_epi16(work_a, t80); - p1 = _mm_load_si128((__m128i *)flat_op1); - work_a = _mm_andnot_si128(flat, work_a); - p1 = _mm_and_si128(flat, p1); - p1 = _mm_or_si128(work_a, p1); - - work_a = _mm_loadu_si128((__m128i *)(s - 3 * p)); - p2 = _mm_load_si128((__m128i *)flat_op2); - work_a = _mm_andnot_si128(flat, work_a); - p2 = _mm_and_si128(flat, p2); - p2 = _mm_or_si128(work_a, p2); - - _mm_store_si128((__m128i *)(s - 3 * p), p2); - _mm_store_si128((__m128i *)(s - 2 * p), p1); - _mm_store_si128((__m128i *)(s - 1 * p), p0); - _mm_store_si128((__m128i *)(s + 0 * p), q0); - _mm_store_si128((__m128i *)(s + 1 * p), q1); - _mm_store_si128((__m128i *)(s + 2 * p), q2); -} - -void vp9_highbd_lpf_horizontal_8_dual_sse2(uint16_t *s, int p, - const uint8_t *_blimit0, - const uint8_t *_limit0, - const uint8_t *_thresh0, - const uint8_t *_blimit1, - const uint8_t *_limit1, - const uint8_t *_thresh1, - int bd) { - vp9_highbd_lpf_horizontal_8_sse2(s, p, _blimit0, _limit0, _thresh0, 1, bd); - vp9_highbd_lpf_horizontal_8_sse2(s + 8, p, _blimit1, _limit1, _thresh1, - 1, bd); -} - -void vp9_highbd_lpf_horizontal_4_sse2(uint16_t *s, int p, - const uint8_t *_blimit, - const uint8_t *_limit, - const uint8_t *_thresh, - int count, int bd) { - const __m128i zero = _mm_set1_epi16(0); - __m128i blimit, limit, thresh; - __m128i mask, hev, flat; - __m128i p3 = _mm_loadu_si128((__m128i *)(s - 4 * p)); - __m128i p2 = _mm_loadu_si128((__m128i *)(s - 3 * p)); - __m128i p1 = _mm_loadu_si128((__m128i *)(s - 2 * p)); - __m128i p0 = _mm_loadu_si128((__m128i *)(s - 1 * p)); - __m128i q0 = _mm_loadu_si128((__m128i *)(s - 0 * p)); - __m128i q1 = _mm_loadu_si128((__m128i *)(s + 1 * p)); - __m128i q2 = _mm_loadu_si128((__m128i *)(s + 2 * p)); - __m128i q3 = _mm_loadu_si128((__m128i *)(s + 3 * p)); - const __m128i abs_p1p0 = _mm_or_si128(_mm_subs_epu16(p1, p0), - _mm_subs_epu16(p0, p1)); - const __m128i abs_q1q0 = _mm_or_si128(_mm_subs_epu16(q1, q0), - _mm_subs_epu16(q0, q1)); - const __m128i ffff = _mm_cmpeq_epi16(abs_p1p0, abs_p1p0); - const __m128i one = _mm_set1_epi16(1); - __m128i abs_p0q0 = _mm_or_si128(_mm_subs_epu16(p0, q0), - _mm_subs_epu16(q0, p0)); - __m128i abs_p1q1 = _mm_or_si128(_mm_subs_epu16(p1, q1), - _mm_subs_epu16(q1, p1)); - __m128i work; - const __m128i t4 = _mm_set1_epi16(4); - const __m128i t3 = _mm_set1_epi16(3); - __m128i t80; - __m128i tff80; - __m128i tffe0; - __m128i t1f; - // equivalent to shifting 0x1f left by bitdepth - 8 - // and setting new bits to 1 - const __m128i t1 = _mm_set1_epi16(0x1); - __m128i t7f; - // equivalent to shifting 0x7f left by bitdepth - 8 - // and setting new bits to 1 - __m128i ps1, ps0, qs0, qs1; - __m128i filt; - __m128i work_a; - __m128i filter1, filter2; - - (void)count; - - if (bd == 8) { - blimit = _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_blimit), zero); - limit = _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_limit), zero); - thresh = _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_thresh), zero); - t80 = _mm_set1_epi16(0x80); - tff80 = _mm_set1_epi16(0xff80); - tffe0 = _mm_set1_epi16(0xffe0); - t1f = _mm_srli_epi16(_mm_set1_epi16(0x1fff), 8); - t7f = _mm_srli_epi16(_mm_set1_epi16(0x7fff), 8); - } else if (bd == 10) { - blimit = _mm_slli_epi16( - _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_blimit), zero), 2); - limit = _mm_slli_epi16( - _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_limit), zero), 2); - thresh = _mm_slli_epi16( - _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_thresh), zero), 2); - t80 = _mm_slli_epi16(_mm_set1_epi16(0x80), 2); - tff80 = _mm_slli_epi16(_mm_set1_epi16(0xff80), 2); - tffe0 = _mm_slli_epi16(_mm_set1_epi16(0xffe0), 2); - t1f = _mm_srli_epi16(_mm_set1_epi16(0x1fff), 6); - t7f = _mm_srli_epi16(_mm_set1_epi16(0x7fff), 6); - } else { // bd == 12 - blimit = _mm_slli_epi16( - _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_blimit), zero), 4); - limit = _mm_slli_epi16( - _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_limit), zero), 4); - thresh = _mm_slli_epi16( - _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_thresh), zero), 4); - t80 = _mm_slli_epi16(_mm_set1_epi16(0x80), 4); - tff80 = _mm_slli_epi16(_mm_set1_epi16(0xff80), 4); - tffe0 = _mm_slli_epi16(_mm_set1_epi16(0xffe0), 4); - t1f = _mm_srli_epi16(_mm_set1_epi16(0x1fff), 4); - t7f = _mm_srli_epi16(_mm_set1_epi16(0x7fff), 4); - } - - ps1 = _mm_subs_epi16(_mm_loadu_si128((__m128i *)(s - 2 * p)), t80); - ps0 = _mm_subs_epi16(_mm_loadu_si128((__m128i *)(s - 1 * p)), t80); - qs0 = _mm_subs_epi16(_mm_loadu_si128((__m128i *)(s + 0 * p)), t80); - qs1 = _mm_subs_epi16(_mm_loadu_si128((__m128i *)(s + 1 * p)), t80); - - // filter_mask and hev_mask - flat = _mm_max_epi16(abs_p1p0, abs_q1q0); - hev = _mm_subs_epu16(flat, thresh); - hev = _mm_xor_si128(_mm_cmpeq_epi16(hev, zero), ffff); - - abs_p0q0 =_mm_adds_epu16(abs_p0q0, abs_p0q0); - abs_p1q1 = _mm_srli_epi16(abs_p1q1, 1); - mask = _mm_subs_epu16(_mm_adds_epu16(abs_p0q0, abs_p1q1), blimit); - mask = _mm_xor_si128(_mm_cmpeq_epi16(mask, zero), ffff); - // mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 > blimit) * -1; - // So taking maximums continues to work: - mask = _mm_and_si128(mask, _mm_adds_epu16(limit, one)); - mask = _mm_max_epi16(flat, mask); - // mask |= (abs(p1 - p0) > limit) * -1; - // mask |= (abs(q1 - q0) > limit) * -1; - work = _mm_max_epi16(_mm_or_si128(_mm_subs_epu16(p2, p1), - _mm_subs_epu16(p1, p2)), - _mm_or_si128(_mm_subs_epu16(p3, p2), - _mm_subs_epu16(p2, p3))); - mask = _mm_max_epi16(work, mask); - work = _mm_max_epi16(_mm_or_si128(_mm_subs_epu16(q2, q1), - _mm_subs_epu16(q1, q2)), - _mm_or_si128(_mm_subs_epu16(q3, q2), - _mm_subs_epu16(q2, q3))); - mask = _mm_max_epi16(work, mask); - mask = _mm_subs_epu16(mask, limit); - mask = _mm_cmpeq_epi16(mask, zero); - - // filter4 - filt = signed_char_clamp_bd_sse2(_mm_subs_epi16(ps1, qs1), bd); - filt = _mm_and_si128(filt, hev); - work_a = _mm_subs_epi16(qs0, ps0); - filt = _mm_adds_epi16(filt, work_a); - filt = _mm_adds_epi16(filt, work_a); - filt = signed_char_clamp_bd_sse2(_mm_adds_epi16(filt, work_a), bd); - - // (vp9_filter + 3 * (qs0 - ps0)) & mask - filt = _mm_and_si128(filt, mask); - - filter1 = signed_char_clamp_bd_sse2(_mm_adds_epi16(filt, t4), bd); - filter2 = signed_char_clamp_bd_sse2(_mm_adds_epi16(filt, t3), bd); - - // Filter1 >> 3 - work_a = _mm_cmpgt_epi16(zero, filter1); // get the values that are <0 - filter1 = _mm_srli_epi16(filter1, 3); - work_a = _mm_and_si128(work_a, tffe0); // sign bits for the values < 0 - filter1 = _mm_and_si128(filter1, t1f); // clamp the range - filter1 = _mm_or_si128(filter1, work_a); // reinsert the sign bits - - // Filter2 >> 3 - work_a = _mm_cmpgt_epi16(zero, filter2); - filter2 = _mm_srli_epi16(filter2, 3); - work_a = _mm_and_si128(work_a, tffe0); - filter2 = _mm_and_si128(filter2, t1f); - filter2 = _mm_or_si128(filter2, work_a); - - // filt >> 1 - filt = _mm_adds_epi16(filter1, t1); - work_a = _mm_cmpgt_epi16(zero, filt); - filt = _mm_srli_epi16(filt, 1); - work_a = _mm_and_si128(work_a, tff80); - filt = _mm_and_si128(filt, t7f); - filt = _mm_or_si128(filt, work_a); - - filt = _mm_andnot_si128(hev, filt); - - q0 = _mm_adds_epi16( - signed_char_clamp_bd_sse2(_mm_subs_epi16(qs0, filter1), bd), t80); - q1 = _mm_adds_epi16( - signed_char_clamp_bd_sse2(_mm_subs_epi16(qs1, filt), bd), t80); - p0 = _mm_adds_epi16( - signed_char_clamp_bd_sse2(_mm_adds_epi16(ps0, filter2), bd), t80); - p1 = _mm_adds_epi16( - signed_char_clamp_bd_sse2(_mm_adds_epi16(ps1, filt), bd), t80); - - _mm_storeu_si128((__m128i *)(s - 2 * p), p1); - _mm_storeu_si128((__m128i *)(s - 1 * p), p0); - _mm_storeu_si128((__m128i *)(s + 0 * p), q0); - _mm_storeu_si128((__m128i *)(s + 1 * p), q1); -} - -void vp9_highbd_lpf_horizontal_4_dual_sse2(uint16_t *s, int p, - const uint8_t *_blimit0, - const uint8_t *_limit0, - const uint8_t *_thresh0, - const uint8_t *_blimit1, - const uint8_t *_limit1, - const uint8_t *_thresh1, - int bd) { - vp9_highbd_lpf_horizontal_4_sse2(s, p, _blimit0, _limit0, _thresh0, 1, bd); - vp9_highbd_lpf_horizontal_4_sse2(s + 8, p, _blimit1, _limit1, _thresh1, 1, - bd); -} - -static INLINE void highbd_transpose(uint16_t *src[], int in_p, - uint16_t *dst[], int out_p, - int num_8x8_to_transpose) { - int idx8x8 = 0; - __m128i p0, p1, p2, p3, p4, p5, p6, p7, x0, x1, x2, x3, x4, x5, x6, x7; - do { - uint16_t *in = src[idx8x8]; - uint16_t *out = dst[idx8x8]; - - p0 = _mm_loadu_si128((__m128i *)(in + 0*in_p)); // 00 01 02 03 04 05 06 07 - p1 = _mm_loadu_si128((__m128i *)(in + 1*in_p)); // 10 11 12 13 14 15 16 17 - p2 = _mm_loadu_si128((__m128i *)(in + 2*in_p)); // 20 21 22 23 24 25 26 27 - p3 = _mm_loadu_si128((__m128i *)(in + 3*in_p)); // 30 31 32 33 34 35 36 37 - p4 = _mm_loadu_si128((__m128i *)(in + 4*in_p)); // 40 41 42 43 44 45 46 47 - p5 = _mm_loadu_si128((__m128i *)(in + 5*in_p)); // 50 51 52 53 54 55 56 57 - p6 = _mm_loadu_si128((__m128i *)(in + 6*in_p)); // 60 61 62 63 64 65 66 67 - p7 = _mm_loadu_si128((__m128i *)(in + 7*in_p)); // 70 71 72 73 74 75 76 77 - // 00 10 01 11 02 12 03 13 - x0 = _mm_unpacklo_epi16(p0, p1); - // 20 30 21 31 22 32 23 33 - x1 = _mm_unpacklo_epi16(p2, p3); - // 40 50 41 51 42 52 43 53 - x2 = _mm_unpacklo_epi16(p4, p5); - // 60 70 61 71 62 72 63 73 - x3 = _mm_unpacklo_epi16(p6, p7); - // 00 10 20 30 01 11 21 31 - x4 = _mm_unpacklo_epi32(x0, x1); - // 40 50 60 70 41 51 61 71 - x5 = _mm_unpacklo_epi32(x2, x3); - // 00 10 20 30 40 50 60 70 - x6 = _mm_unpacklo_epi64(x4, x5); - // 01 11 21 31 41 51 61 71 - x7 = _mm_unpackhi_epi64(x4, x5); - - _mm_storeu_si128((__m128i *)(out + 0*out_p), x6); - // 00 10 20 30 40 50 60 70 - _mm_storeu_si128((__m128i *)(out + 1*out_p), x7); - // 01 11 21 31 41 51 61 71 - - // 02 12 22 32 03 13 23 33 - x4 = _mm_unpackhi_epi32(x0, x1); - // 42 52 62 72 43 53 63 73 - x5 = _mm_unpackhi_epi32(x2, x3); - // 02 12 22 32 42 52 62 72 - x6 = _mm_unpacklo_epi64(x4, x5); - // 03 13 23 33 43 53 63 73 - x7 = _mm_unpackhi_epi64(x4, x5); - - _mm_storeu_si128((__m128i *)(out + 2*out_p), x6); - // 02 12 22 32 42 52 62 72 - _mm_storeu_si128((__m128i *)(out + 3*out_p), x7); - // 03 13 23 33 43 53 63 73 - - // 04 14 05 15 06 16 07 17 - x0 = _mm_unpackhi_epi16(p0, p1); - // 24 34 25 35 26 36 27 37 - x1 = _mm_unpackhi_epi16(p2, p3); - // 44 54 45 55 46 56 47 57 - x2 = _mm_unpackhi_epi16(p4, p5); - // 64 74 65 75 66 76 67 77 - x3 = _mm_unpackhi_epi16(p6, p7); - // 04 14 24 34 05 15 25 35 - x4 = _mm_unpacklo_epi32(x0, x1); - // 44 54 64 74 45 55 65 75 - x5 = _mm_unpacklo_epi32(x2, x3); - // 04 14 24 34 44 54 64 74 - x6 = _mm_unpacklo_epi64(x4, x5); - // 05 15 25 35 45 55 65 75 - x7 = _mm_unpackhi_epi64(x4, x5); - - _mm_storeu_si128((__m128i *)(out + 4*out_p), x6); - // 04 14 24 34 44 54 64 74 - _mm_storeu_si128((__m128i *)(out + 5*out_p), x7); - // 05 15 25 35 45 55 65 75 - - // 06 16 26 36 07 17 27 37 - x4 = _mm_unpackhi_epi32(x0, x1); - // 46 56 66 76 47 57 67 77 - x5 = _mm_unpackhi_epi32(x2, x3); - // 06 16 26 36 46 56 66 76 - x6 = _mm_unpacklo_epi64(x4, x5); - // 07 17 27 37 47 57 67 77 - x7 = _mm_unpackhi_epi64(x4, x5); - - _mm_storeu_si128((__m128i *)(out + 6*out_p), x6); - // 06 16 26 36 46 56 66 76 - _mm_storeu_si128((__m128i *)(out + 7*out_p), x7); - // 07 17 27 37 47 57 67 77 - } while (++idx8x8 < num_8x8_to_transpose); -} - -static INLINE void highbd_transpose8x16(uint16_t *in0, uint16_t *in1, - int in_p, uint16_t *out, int out_p) { - uint16_t *src0[1]; - uint16_t *src1[1]; - uint16_t *dest0[1]; - uint16_t *dest1[1]; - src0[0] = in0; - src1[0] = in1; - dest0[0] = out; - dest1[0] = out + 8; - highbd_transpose(src0, in_p, dest0, out_p, 1); - highbd_transpose(src1, in_p, dest1, out_p, 1); -} - -void vp9_highbd_lpf_vertical_4_sse2(uint16_t *s, int p, - const uint8_t *blimit, - const uint8_t *limit, - const uint8_t *thresh, - int count, int bd) { - DECLARE_ALIGNED_ARRAY(16, uint16_t, t_dst, 8 * 8); - uint16_t *src[1]; - uint16_t *dst[1]; - (void)count; - - // Transpose 8x8 - src[0] = s - 4; - dst[0] = t_dst; - - highbd_transpose(src, p, dst, 8, 1); - - // Loop filtering - vp9_highbd_lpf_horizontal_4_sse2(t_dst + 4 * 8, 8, blimit, limit, thresh, 1, - bd); - - src[0] = t_dst; - dst[0] = s - 4; - - // Transpose back - highbd_transpose(src, 8, dst, p, 1); -} - -void vp9_highbd_lpf_vertical_4_dual_sse2(uint16_t *s, int p, - const uint8_t *blimit0, - const uint8_t *limit0, - const uint8_t *thresh0, - const uint8_t *blimit1, - const uint8_t *limit1, - const uint8_t *thresh1, - int bd) { - DECLARE_ALIGNED_ARRAY(16, uint16_t, t_dst, 16 * 8); - uint16_t *src[2]; - uint16_t *dst[2]; - - // Transpose 8x16 - highbd_transpose8x16(s - 4, s - 4 + p * 8, p, t_dst, 16); - - // Loop filtering - vp9_highbd_lpf_horizontal_4_dual_sse2(t_dst + 4 * 16, 16, blimit0, limit0, - thresh0, blimit1, limit1, thresh1, bd); - src[0] = t_dst; - src[1] = t_dst + 8; - dst[0] = s - 4; - dst[1] = s - 4 + p * 8; - - // Transpose back - highbd_transpose(src, 16, dst, p, 2); -} - -void vp9_highbd_lpf_vertical_8_sse2(uint16_t *s, int p, - const uint8_t *blimit, - const uint8_t *limit, - const uint8_t *thresh, - int count, int bd) { - DECLARE_ALIGNED_ARRAY(16, uint16_t, t_dst, 8 * 8); - uint16_t *src[1]; - uint16_t *dst[1]; - (void)count; - - // Transpose 8x8 - src[0] = s - 4; - dst[0] = t_dst; - - highbd_transpose(src, p, dst, 8, 1); - - // Loop filtering - vp9_highbd_lpf_horizontal_8_sse2(t_dst + 4 * 8, 8, blimit, limit, thresh, 1, - bd); - - src[0] = t_dst; - dst[0] = s - 4; - - // Transpose back - highbd_transpose(src, 8, dst, p, 1); -} - -void vp9_highbd_lpf_vertical_8_dual_sse2(uint16_t *s, int p, - const uint8_t *blimit0, - const uint8_t *limit0, - const uint8_t *thresh0, - const uint8_t *blimit1, - const uint8_t *limit1, - const uint8_t *thresh1, - int bd) { - DECLARE_ALIGNED_ARRAY(16, uint16_t, t_dst, 16 * 8); - uint16_t *src[2]; - uint16_t *dst[2]; - - // Transpose 8x16 - highbd_transpose8x16(s - 4, s - 4 + p * 8, p, t_dst, 16); - - // Loop filtering - vp9_highbd_lpf_horizontal_8_dual_sse2(t_dst + 4 * 16, 16, blimit0, limit0, - thresh0, blimit1, limit1, thresh1, bd); - src[0] = t_dst; - src[1] = t_dst + 8; - - dst[0] = s - 4; - dst[1] = s - 4 + p * 8; - - // Transpose back - highbd_transpose(src, 16, dst, p, 2); -} - -void vp9_highbd_lpf_vertical_16_sse2(uint16_t *s, int p, - const uint8_t *blimit, - const uint8_t *limit, - const uint8_t *thresh, - int bd) { - DECLARE_ALIGNED_ARRAY(16, uint16_t, t_dst, 8 * 16); - uint16_t *src[2]; - uint16_t *dst[2]; - - src[0] = s - 8; - src[1] = s; - dst[0] = t_dst; - dst[1] = t_dst + 8 * 8; - - // Transpose 16x8 - highbd_transpose(src, p, dst, 8, 2); - - // Loop filtering - highbd_mb_lpf_horizontal_edge_w_sse2_8(t_dst + 8 * 8, 8, blimit, limit, - thresh, bd); - src[0] = t_dst; - src[1] = t_dst + 8 * 8; - dst[0] = s - 8; - dst[1] = s; - - // Transpose back - highbd_transpose(src, 8, dst, p, 2); -} - -void vp9_highbd_lpf_vertical_16_dual_sse2(uint16_t *s, - int p, - const uint8_t *blimit, - const uint8_t *limit, - const uint8_t *thresh, - int bd) { - DECLARE_ALIGNED_ARRAY(16, uint16_t, t_dst, 256); - - // Transpose 16x16 - highbd_transpose8x16(s - 8, s - 8 + 8 * p, p, t_dst, 16); - highbd_transpose8x16(s, s + 8 * p, p, t_dst + 8 * 16, 16); - - // Loop filtering - highbd_mb_lpf_horizontal_edge_w_sse2_16(t_dst + 8 * 16, 16, blimit, limit, - thresh, bd); - - // Transpose back - highbd_transpose8x16(t_dst, t_dst + 8 * 16, 16, s - 8, p); - highbd_transpose8x16(t_dst + 8, t_dst + 8 + 8 * 16, 16, s - 8 + 8 * p, p); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_high_subpixel_8t_sse2.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_high_subpixel_8t_sse2.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_high_subpixel_8t_sse2.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_high_subpixel_8t_sse2.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,962 +0,0 @@ -; -; Copyright (c) 2014 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -;Note: tap3 and tap4 have to be applied and added after other taps to avoid -;overflow. - -%macro HIGH_GET_FILTERS_4 0 - mov rdx, arg(5) ;filter ptr - mov rcx, 0x00000040 - - movdqa xmm7, [rdx] ;load filters - pshuflw xmm0, xmm7, 0b ;k0 - pshuflw xmm1, xmm7, 01010101b ;k1 - pshuflw xmm2, xmm7, 10101010b ;k2 - pshuflw xmm3, xmm7, 11111111b ;k3 - psrldq xmm7, 8 - pshuflw xmm4, xmm7, 0b ;k4 - pshuflw xmm5, xmm7, 01010101b ;k5 - pshuflw xmm6, xmm7, 10101010b ;k6 - pshuflw xmm7, xmm7, 11111111b ;k7 - - punpcklwd xmm0, xmm6 - punpcklwd xmm2, xmm5 - punpcklwd xmm3, xmm4 - punpcklwd xmm1, xmm7 - - movdqa k0k6, xmm0 - movdqa k2k5, xmm2 - movdqa k3k4, xmm3 - movdqa k1k7, xmm1 - - movq xmm6, rcx - pshufd xmm6, xmm6, 0 - movdqa krd, xmm6 - - ;Compute max and min values of a pixel - mov rdx, 0x00010001 - movsxd rcx, DWORD PTR arg(6) ;bps - movq xmm0, rdx - movq xmm1, rcx - pshufd xmm0, xmm0, 0b - movdqa xmm2, xmm0 - psllw xmm0, xmm1 - psubw xmm0, xmm2 - pxor xmm1, xmm1 - movdqa max, xmm0 ;max value (for clamping) - movdqa min, xmm1 ;min value (for clamping) - -%endm - -%macro HIGH_APPLY_FILTER_4 1 - punpcklwd xmm0, xmm6 ;two row in one register - punpcklwd xmm1, xmm7 - punpcklwd xmm2, xmm5 - punpcklwd xmm3, xmm4 - - pmaddwd xmm0, k0k6 ;multiply the filter factors - pmaddwd xmm1, k1k7 - pmaddwd xmm2, k2k5 - pmaddwd xmm3, k3k4 - - paddd xmm0, xmm1 ;sum - paddd xmm0, xmm2 - paddd xmm0, xmm3 - - paddd xmm0, krd ;rounding - psrad xmm0, 7 ;shift - packssdw xmm0, xmm0 ;pack to word - - ;clamp the values - pminsw xmm0, max - pmaxsw xmm0, min - -%if %1 - movq xmm1, [rdi] - pavgw xmm0, xmm1 -%endif - movq [rdi], xmm0 -%endm - -%macro HIGH_GET_FILTERS 0 - mov rdx, arg(5) ;filter ptr - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;output_ptr - mov rcx, 0x00000040 - - movdqa xmm7, [rdx] ;load filters - pshuflw xmm0, xmm7, 0b ;k0 - pshuflw xmm1, xmm7, 01010101b ;k1 - pshuflw xmm2, xmm7, 10101010b ;k2 - pshuflw xmm3, xmm7, 11111111b ;k3 - pshufhw xmm4, xmm7, 0b ;k4 - pshufhw xmm5, xmm7, 01010101b ;k5 - pshufhw xmm6, xmm7, 10101010b ;k6 - pshufhw xmm7, xmm7, 11111111b ;k7 - punpcklqdq xmm2, xmm2 - punpcklqdq xmm3, xmm3 - punpcklwd xmm0, xmm1 - punpckhwd xmm6, xmm7 - punpckhwd xmm2, xmm5 - punpckhwd xmm3, xmm4 - - movdqa k0k1, xmm0 ;store filter factors on stack - movdqa k6k7, xmm6 - movdqa k2k5, xmm2 - movdqa k3k4, xmm3 - - movq xmm6, rcx - pshufd xmm6, xmm6, 0 - movdqa krd, xmm6 ;rounding - - ;Compute max and min values of a pixel - mov rdx, 0x00010001 - movsxd rcx, DWORD PTR arg(6) ;bps - movq xmm0, rdx - movq xmm1, rcx - pshufd xmm0, xmm0, 0b - movdqa xmm2, xmm0 - psllw xmm0, xmm1 - psubw xmm0, xmm2 - pxor xmm1, xmm1 - movdqa max, xmm0 ;max value (for clamping) - movdqa min, xmm1 ;min value (for clamping) -%endm - -%macro LOAD_VERT_8 1 - movdqu xmm0, [rsi + %1] ;0 - movdqu xmm1, [rsi + rax + %1] ;1 - movdqu xmm6, [rsi + rdx * 2 + %1] ;6 - lea rsi, [rsi + rax] - movdqu xmm7, [rsi + rdx * 2 + %1] ;7 - movdqu xmm2, [rsi + rax + %1] ;2 - movdqu xmm3, [rsi + rax * 2 + %1] ;3 - movdqu xmm4, [rsi + rdx + %1] ;4 - movdqu xmm5, [rsi + rax * 4 + %1] ;5 -%endm - -%macro HIGH_APPLY_FILTER_8 2 - movdqu temp, xmm4 - movdqa xmm4, xmm0 - punpcklwd xmm0, xmm1 - punpckhwd xmm4, xmm1 - movdqa xmm1, xmm6 - punpcklwd xmm6, xmm7 - punpckhwd xmm1, xmm7 - movdqa xmm7, xmm2 - punpcklwd xmm2, xmm5 - punpckhwd xmm7, xmm5 - - movdqu xmm5, temp - movdqu temp, xmm4 - movdqa xmm4, xmm3 - punpcklwd xmm3, xmm5 - punpckhwd xmm4, xmm5 - movdqu xmm5, temp - - pmaddwd xmm0, k0k1 - pmaddwd xmm5, k0k1 - pmaddwd xmm6, k6k7 - pmaddwd xmm1, k6k7 - pmaddwd xmm2, k2k5 - pmaddwd xmm7, k2k5 - pmaddwd xmm3, k3k4 - pmaddwd xmm4, k3k4 - - paddd xmm0, xmm6 - paddd xmm0, xmm2 - paddd xmm0, xmm3 - paddd xmm5, xmm1 - paddd xmm5, xmm7 - paddd xmm5, xmm4 - - paddd xmm0, krd ;rounding - paddd xmm5, krd - psrad xmm0, 7 ;shift - psrad xmm5, 7 - packssdw xmm0, xmm5 ;pack back to word - - ;clamp the values - pminsw xmm0, max - pmaxsw xmm0, min - -%if %1 - movdqu xmm1, [rdi + %2] - pavgw xmm0, xmm1 -%endif - movdqu [rdi + %2], xmm0 -%endm - -;void vp9_filter_block1d4_v8_sse2 -;( -; unsigned char *src_ptr, -; unsigned int src_pitch, -; unsigned char *output_ptr, -; unsigned int out_pitch, -; unsigned int output_height, -; short *filter -;) -global sym(vp9_highbd_filter_block1d4_v8_sse2) PRIVATE -sym(vp9_highbd_filter_block1d4_v8_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 7 - push rsi - push rdi - push rbx - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, 16 * 7 - %define k0k6 [rsp + 16 * 0] - %define k2k5 [rsp + 16 * 1] - %define k3k4 [rsp + 16 * 2] - %define k1k7 [rsp + 16 * 3] - %define krd [rsp + 16 * 4] - %define max [rsp + 16 * 5] - %define min [rsp + 16 * 6] - - HIGH_GET_FILTERS_4 - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;output_ptr - - movsxd rax, DWORD PTR arg(1) ;pixels_per_line - movsxd rbx, DWORD PTR arg(3) ;out_pitch - lea rax, [rax + rax] ;bytes per line - lea rbx, [rbx + rbx] - lea rdx, [rax + rax * 2] - movsxd rcx, DWORD PTR arg(4) ;output_height - -.loop: - movq xmm0, [rsi] ;load src: row 0 - movq xmm1, [rsi + rax] ;1 - movq xmm6, [rsi + rdx * 2] ;6 - lea rsi, [rsi + rax] - movq xmm7, [rsi + rdx * 2] ;7 - movq xmm2, [rsi + rax] ;2 - movq xmm3, [rsi + rax * 2] ;3 - movq xmm4, [rsi + rdx] ;4 - movq xmm5, [rsi + rax * 4] ;5 - - HIGH_APPLY_FILTER_4 0 - - lea rdi, [rdi + rbx] - dec rcx - jnz .loop - - add rsp, 16 * 7 - pop rsp - pop rbx - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -;void vp9_filter_block1d8_v8_sse2 -;( -; unsigned char *src_ptr, -; unsigned int src_pitch, -; unsigned char *output_ptr, -; unsigned int out_pitch, -; unsigned int output_height, -; short *filter -;) -global sym(vp9_highbd_filter_block1d8_v8_sse2) PRIVATE -sym(vp9_highbd_filter_block1d8_v8_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 7 - push rsi - push rdi - push rbx - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, 16 * 8 - %define k0k1 [rsp + 16 * 0] - %define k6k7 [rsp + 16 * 1] - %define k2k5 [rsp + 16 * 2] - %define k3k4 [rsp + 16 * 3] - %define krd [rsp + 16 * 4] - %define temp [rsp + 16 * 5] - %define max [rsp + 16 * 6] - %define min [rsp + 16 * 7] - - HIGH_GET_FILTERS - - movsxd rax, DWORD PTR arg(1) ;pixels_per_line - movsxd rbx, DWORD PTR arg(3) ;out_pitch - lea rax, [rax + rax] ;bytes per line - lea rbx, [rbx + rbx] - lea rdx, [rax + rax * 2] - movsxd rcx, DWORD PTR arg(4) ;output_height - -.loop: - LOAD_VERT_8 0 - HIGH_APPLY_FILTER_8 0, 0 - - lea rdi, [rdi + rbx] - dec rcx - jnz .loop - - add rsp, 16 * 8 - pop rsp - pop rbx - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -;void vp9_filter_block1d16_v8_sse2 -;( -; unsigned char *src_ptr, -; unsigned int src_pitch, -; unsigned char *output_ptr, -; unsigned int out_pitch, -; unsigned int output_height, -; short *filter -;) -global sym(vp9_highbd_filter_block1d16_v8_sse2) PRIVATE -sym(vp9_highbd_filter_block1d16_v8_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 7 - push rsi - push rdi - push rbx - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, 16 * 8 - %define k0k1 [rsp + 16 * 0] - %define k6k7 [rsp + 16 * 1] - %define k2k5 [rsp + 16 * 2] - %define k3k4 [rsp + 16 * 3] - %define krd [rsp + 16 * 4] - %define temp [rsp + 16 * 5] - %define max [rsp + 16 * 6] - %define min [rsp + 16 * 7] - - HIGH_GET_FILTERS - - movsxd rax, DWORD PTR arg(1) ;pixels_per_line - movsxd rbx, DWORD PTR arg(3) ;out_pitch - lea rax, [rax + rax] ;bytes per line - lea rbx, [rbx + rbx] - lea rdx, [rax + rax * 2] - movsxd rcx, DWORD PTR arg(4) ;output_height - -.loop: - LOAD_VERT_8 0 - HIGH_APPLY_FILTER_8 0, 0 - sub rsi, rax - - LOAD_VERT_8 16 - HIGH_APPLY_FILTER_8 0, 16 - add rdi, rbx - - dec rcx - jnz .loop - - add rsp, 16 * 8 - pop rsp - pop rbx - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -global sym(vp9_highbd_filter_block1d4_v8_avg_sse2) PRIVATE -sym(vp9_highbd_filter_block1d4_v8_avg_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 7 - push rsi - push rdi - push rbx - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, 16 * 7 - %define k0k6 [rsp + 16 * 0] - %define k2k5 [rsp + 16 * 1] - %define k3k4 [rsp + 16 * 2] - %define k1k7 [rsp + 16 * 3] - %define krd [rsp + 16 * 4] - %define max [rsp + 16 * 5] - %define min [rsp + 16 * 6] - - HIGH_GET_FILTERS_4 - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;output_ptr - - movsxd rax, DWORD PTR arg(1) ;pixels_per_line - movsxd rbx, DWORD PTR arg(3) ;out_pitch - lea rax, [rax + rax] ;bytes per line - lea rbx, [rbx + rbx] - lea rdx, [rax + rax * 2] - movsxd rcx, DWORD PTR arg(4) ;output_height - -.loop: - movq xmm0, [rsi] ;load src: row 0 - movq xmm1, [rsi + rax] ;1 - movq xmm6, [rsi + rdx * 2] ;6 - lea rsi, [rsi + rax] - movq xmm7, [rsi + rdx * 2] ;7 - movq xmm2, [rsi + rax] ;2 - movq xmm3, [rsi + rax * 2] ;3 - movq xmm4, [rsi + rdx] ;4 - movq xmm5, [rsi + rax * 4] ;5 - - HIGH_APPLY_FILTER_4 1 - - lea rdi, [rdi + rbx] - dec rcx - jnz .loop - - add rsp, 16 * 7 - pop rsp - pop rbx - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -global sym(vp9_highbd_filter_block1d8_v8_avg_sse2) PRIVATE -sym(vp9_highbd_filter_block1d8_v8_avg_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 7 - push rsi - push rdi - push rbx - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, 16 * 8 - %define k0k1 [rsp + 16 * 0] - %define k6k7 [rsp + 16 * 1] - %define k2k5 [rsp + 16 * 2] - %define k3k4 [rsp + 16 * 3] - %define krd [rsp + 16 * 4] - %define temp [rsp + 16 * 5] - %define max [rsp + 16 * 6] - %define min [rsp + 16 * 7] - - HIGH_GET_FILTERS - - movsxd rax, DWORD PTR arg(1) ;pixels_per_line - movsxd rbx, DWORD PTR arg(3) ;out_pitch - lea rax, [rax + rax] ;bytes per line - lea rbx, [rbx + rbx] - lea rdx, [rax + rax * 2] - movsxd rcx, DWORD PTR arg(4) ;output_height -.loop: - LOAD_VERT_8 0 - HIGH_APPLY_FILTER_8 1, 0 - - lea rdi, [rdi + rbx] - dec rcx - jnz .loop - - add rsp, 16 * 8 - pop rsp - pop rbx - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -global sym(vp9_highbd_filter_block1d16_v8_avg_sse2) PRIVATE -sym(vp9_highbd_filter_block1d16_v8_avg_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 7 - push rsi - push rdi - push rbx - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, 16 * 8 - %define k0k1 [rsp + 16 * 0] - %define k6k7 [rsp + 16 * 1] - %define k2k5 [rsp + 16 * 2] - %define k3k4 [rsp + 16 * 3] - %define krd [rsp + 16 * 4] - %define temp [rsp + 16 * 5] - %define max [rsp + 16 * 6] - %define min [rsp + 16 * 7] - - HIGH_GET_FILTERS - - movsxd rax, DWORD PTR arg(1) ;pixels_per_line - movsxd rbx, DWORD PTR arg(3) ;out_pitch - lea rax, [rax + rax] ;bytes per line - lea rbx, [rbx + rbx] - lea rdx, [rax + rax * 2] - movsxd rcx, DWORD PTR arg(4) ;output_height -.loop: - LOAD_VERT_8 0 - HIGH_APPLY_FILTER_8 1, 0 - sub rsi, rax - - LOAD_VERT_8 16 - HIGH_APPLY_FILTER_8 1, 16 - add rdi, rbx - - dec rcx - jnz .loop - - add rsp, 16 * 8 - pop rsp - pop rbx - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -;void vp9_filter_block1d4_h8_sse2 -;( -; unsigned char *src_ptr, -; unsigned int src_pixels_per_line, -; unsigned char *output_ptr, -; unsigned int output_pitch, -; unsigned int output_height, -; short *filter -;) -global sym(vp9_highbd_filter_block1d4_h8_sse2) PRIVATE -sym(vp9_highbd_filter_block1d4_h8_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 7 - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, 16 * 7 - %define k0k6 [rsp + 16 * 0] - %define k2k5 [rsp + 16 * 1] - %define k3k4 [rsp + 16 * 2] - %define k1k7 [rsp + 16 * 3] - %define krd [rsp + 16 * 4] - %define max [rsp + 16 * 5] - %define min [rsp + 16 * 6] - - HIGH_GET_FILTERS_4 - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;output_ptr - - movsxd rax, DWORD PTR arg(1) ;pixels_per_line - movsxd rdx, DWORD PTR arg(3) ;out_pitch - lea rax, [rax + rax] ;bytes per line - lea rdx, [rdx + rdx] - movsxd rcx, DWORD PTR arg(4) ;output_height - -.loop: - movdqu xmm0, [rsi - 6] ;load src - movdqu xmm4, [rsi + 2] - movdqa xmm1, xmm0 - movdqa xmm6, xmm4 - movdqa xmm7, xmm4 - movdqa xmm2, xmm0 - movdqa xmm3, xmm0 - movdqa xmm5, xmm4 - - psrldq xmm1, 2 - psrldq xmm6, 4 - psrldq xmm7, 6 - psrldq xmm2, 4 - psrldq xmm3, 6 - psrldq xmm5, 2 - - HIGH_APPLY_FILTER_4 0 - - lea rsi, [rsi + rax] - lea rdi, [rdi + rdx] - dec rcx - jnz .loop - - add rsp, 16 * 7 - pop rsp - - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -;void vp9_filter_block1d8_h8_sse2 -;( -; unsigned char *src_ptr, -; unsigned int src_pixels_per_line, -; unsigned char *output_ptr, -; unsigned int output_pitch, -; unsigned int output_height, -; short *filter -;) -global sym(vp9_highbd_filter_block1d8_h8_sse2) PRIVATE -sym(vp9_highbd_filter_block1d8_h8_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 7 - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, 16 * 8 - %define k0k1 [rsp + 16 * 0] - %define k6k7 [rsp + 16 * 1] - %define k2k5 [rsp + 16 * 2] - %define k3k4 [rsp + 16 * 3] - %define krd [rsp + 16 * 4] - %define temp [rsp + 16 * 5] - %define max [rsp + 16 * 6] - %define min [rsp + 16 * 7] - - HIGH_GET_FILTERS - - movsxd rax, DWORD PTR arg(1) ;pixels_per_line - movsxd rdx, DWORD PTR arg(3) ;out_pitch - lea rax, [rax + rax] ;bytes per line - lea rdx, [rdx + rdx] - movsxd rcx, DWORD PTR arg(4) ;output_height - -.loop: - movdqu xmm0, [rsi - 6] ;load src - movdqu xmm1, [rsi - 4] - movdqu xmm2, [rsi - 2] - movdqu xmm3, [rsi] - movdqu xmm4, [rsi + 2] - movdqu xmm5, [rsi + 4] - movdqu xmm6, [rsi + 6] - movdqu xmm7, [rsi + 8] - - HIGH_APPLY_FILTER_8 0, 0 - - lea rsi, [rsi + rax] - lea rdi, [rdi + rdx] - dec rcx - jnz .loop - - add rsp, 16 * 8 - pop rsp - - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -;void vp9_filter_block1d16_h8_sse2 -;( -; unsigned char *src_ptr, -; unsigned int src_pixels_per_line, -; unsigned char *output_ptr, -; unsigned int output_pitch, -; unsigned int output_height, -; short *filter -;) -global sym(vp9_highbd_filter_block1d16_h8_sse2) PRIVATE -sym(vp9_highbd_filter_block1d16_h8_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 7 - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, 16 * 8 - %define k0k1 [rsp + 16 * 0] - %define k6k7 [rsp + 16 * 1] - %define k2k5 [rsp + 16 * 2] - %define k3k4 [rsp + 16 * 3] - %define krd [rsp + 16 * 4] - %define temp [rsp + 16 * 5] - %define max [rsp + 16 * 6] - %define min [rsp + 16 * 7] - - HIGH_GET_FILTERS - - movsxd rax, DWORD PTR arg(1) ;pixels_per_line - movsxd rdx, DWORD PTR arg(3) ;out_pitch - lea rax, [rax + rax] ;bytes per line - lea rdx, [rdx + rdx] - movsxd rcx, DWORD PTR arg(4) ;output_height - -.loop: - movdqu xmm0, [rsi - 6] ;load src - movdqu xmm1, [rsi - 4] - movdqu xmm2, [rsi - 2] - movdqu xmm3, [rsi] - movdqu xmm4, [rsi + 2] - movdqu xmm5, [rsi + 4] - movdqu xmm6, [rsi + 6] - movdqu xmm7, [rsi + 8] - - HIGH_APPLY_FILTER_8 0, 0 - - movdqu xmm0, [rsi + 10] ;load src - movdqu xmm1, [rsi + 12] - movdqu xmm2, [rsi + 14] - movdqu xmm3, [rsi + 16] - movdqu xmm4, [rsi + 18] - movdqu xmm5, [rsi + 20] - movdqu xmm6, [rsi + 22] - movdqu xmm7, [rsi + 24] - - HIGH_APPLY_FILTER_8 0, 16 - - lea rsi, [rsi + rax] - lea rdi, [rdi + rdx] - dec rcx - jnz .loop - - add rsp, 16 * 8 - pop rsp - - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -global sym(vp9_highbd_filter_block1d4_h8_avg_sse2) PRIVATE -sym(vp9_highbd_filter_block1d4_h8_avg_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 7 - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, 16 * 7 - %define k0k6 [rsp + 16 * 0] - %define k2k5 [rsp + 16 * 1] - %define k3k4 [rsp + 16 * 2] - %define k1k7 [rsp + 16 * 3] - %define krd [rsp + 16 * 4] - %define max [rsp + 16 * 5] - %define min [rsp + 16 * 6] - - HIGH_GET_FILTERS_4 - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;output_ptr - - movsxd rax, DWORD PTR arg(1) ;pixels_per_line - movsxd rdx, DWORD PTR arg(3) ;out_pitch - lea rax, [rax + rax] ;bytes per line - lea rdx, [rdx + rdx] - movsxd rcx, DWORD PTR arg(4) ;output_height - -.loop: - movdqu xmm0, [rsi - 6] ;load src - movdqu xmm4, [rsi + 2] - movdqa xmm1, xmm0 - movdqa xmm6, xmm4 - movdqa xmm7, xmm4 - movdqa xmm2, xmm0 - movdqa xmm3, xmm0 - movdqa xmm5, xmm4 - - psrldq xmm1, 2 - psrldq xmm6, 4 - psrldq xmm7, 6 - psrldq xmm2, 4 - psrldq xmm3, 6 - psrldq xmm5, 2 - - HIGH_APPLY_FILTER_4 1 - - lea rsi, [rsi + rax] - lea rdi, [rdi + rdx] - dec rcx - jnz .loop - - add rsp, 16 * 7 - pop rsp - - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -global sym(vp9_highbd_filter_block1d8_h8_avg_sse2) PRIVATE -sym(vp9_highbd_filter_block1d8_h8_avg_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 7 - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, 16 * 8 - %define k0k1 [rsp + 16 * 0] - %define k6k7 [rsp + 16 * 1] - %define k2k5 [rsp + 16 * 2] - %define k3k4 [rsp + 16 * 3] - %define krd [rsp + 16 * 4] - %define temp [rsp + 16 * 5] - %define max [rsp + 16 * 6] - %define min [rsp + 16 * 7] - - HIGH_GET_FILTERS - - movsxd rax, DWORD PTR arg(1) ;pixels_per_line - movsxd rdx, DWORD PTR arg(3) ;out_pitch - lea rax, [rax + rax] ;bytes per line - lea rdx, [rdx + rdx] - movsxd rcx, DWORD PTR arg(4) ;output_height - -.loop: - movdqu xmm0, [rsi - 6] ;load src - movdqu xmm1, [rsi - 4] - movdqu xmm2, [rsi - 2] - movdqu xmm3, [rsi] - movdqu xmm4, [rsi + 2] - movdqu xmm5, [rsi + 4] - movdqu xmm6, [rsi + 6] - movdqu xmm7, [rsi + 8] - - HIGH_APPLY_FILTER_8 1, 0 - - lea rsi, [rsi + rax] - lea rdi, [rdi + rdx] - dec rcx - jnz .loop - - add rsp, 16 * 8 - pop rsp - - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -global sym(vp9_highbd_filter_block1d16_h8_avg_sse2) PRIVATE -sym(vp9_highbd_filter_block1d16_h8_avg_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 7 - push rsi - push rdi - ; end prolog - - ALIGN_STACK 16, rax - sub rsp, 16 * 8 - %define k0k1 [rsp + 16 * 0] - %define k6k7 [rsp + 16 * 1] - %define k2k5 [rsp + 16 * 2] - %define k3k4 [rsp + 16 * 3] - %define krd [rsp + 16 * 4] - %define temp [rsp + 16 * 5] - %define max [rsp + 16 * 6] - %define min [rsp + 16 * 7] - - HIGH_GET_FILTERS - - movsxd rax, DWORD PTR arg(1) ;pixels_per_line - movsxd rdx, DWORD PTR arg(3) ;out_pitch - lea rax, [rax + rax] ;bytes per line - lea rdx, [rdx + rdx] - movsxd rcx, DWORD PTR arg(4) ;output_height - -.loop: - movdqu xmm0, [rsi - 6] ;load src - movdqu xmm1, [rsi - 4] - movdqu xmm2, [rsi - 2] - movdqu xmm3, [rsi] - movdqu xmm4, [rsi + 2] - movdqu xmm5, [rsi + 4] - movdqu xmm6, [rsi + 6] - movdqu xmm7, [rsi + 8] - - HIGH_APPLY_FILTER_8 1, 0 - - movdqu xmm0, [rsi + 10] ;load src - movdqu xmm1, [rsi + 12] - movdqu xmm2, [rsi + 14] - movdqu xmm3, [rsi + 16] - movdqu xmm4, [rsi + 18] - movdqu xmm5, [rsi + 20] - movdqu xmm6, [rsi + 22] - movdqu xmm7, [rsi + 24] - - HIGH_APPLY_FILTER_8 1, 16 - - lea rsi, [rsi + rax] - lea rdi, [rdi + rdx] - dec rcx - jnz .loop - - add rsp, 16 * 8 - pop rsp - - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_high_subpixel_bilinear_sse2.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_high_subpixel_bilinear_sse2.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_high_subpixel_bilinear_sse2.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_high_subpixel_bilinear_sse2.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,494 +0,0 @@ -; -; Copyright (c) 2014 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - -%include "vpx_ports/x86_abi_support.asm" - -%macro HIGH_GET_PARAM_4 0 - mov rdx, arg(5) ;filter ptr - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;output_ptr - mov rcx, 0x00000040 - - movdqa xmm3, [rdx] ;load filters - pshuflw xmm4, xmm3, 11111111b ;k3 - psrldq xmm3, 8 - pshuflw xmm3, xmm3, 0b ;k4 - punpcklwd xmm4, xmm3 ;k3k4 - - movq xmm3, rcx ;rounding - pshufd xmm3, xmm3, 0 - - mov rdx, 0x00010001 - movsxd rcx, DWORD PTR arg(6) ;bps - movq xmm5, rdx - movq xmm2, rcx - pshufd xmm5, xmm5, 0b - movdqa xmm1, xmm5 - psllw xmm5, xmm2 - psubw xmm5, xmm1 ;max value (for clamping) - pxor xmm2, xmm2 ;min value (for clamping) - - movsxd rax, DWORD PTR arg(1) ;pixels_per_line - movsxd rdx, DWORD PTR arg(3) ;out_pitch - movsxd rcx, DWORD PTR arg(4) ;output_height -%endm - -%macro HIGH_APPLY_FILTER_4 1 - - punpcklwd xmm0, xmm1 ;two row in one register - pmaddwd xmm0, xmm4 ;multiply the filter factors - - paddd xmm0, xmm3 ;rounding - psrad xmm0, 7 ;shift - packssdw xmm0, xmm0 ;pack to word - - ;clamp the values - pminsw xmm0, xmm5 - pmaxsw xmm0, xmm2 - -%if %1 - movq xmm1, [rdi] - pavgw xmm0, xmm1 -%endif - - movq [rdi], xmm0 - lea rsi, [rsi + 2*rax] - lea rdi, [rdi + 2*rdx] - dec rcx -%endm - -%if ARCH_X86_64 -%macro HIGH_GET_PARAM 0 - mov rdx, arg(5) ;filter ptr - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;output_ptr - mov rcx, 0x00000040 - - movdqa xmm6, [rdx] ;load filters - - pshuflw xmm7, xmm6, 11111111b ;k3 - pshufhw xmm6, xmm6, 0b ;k4 - psrldq xmm6, 8 - punpcklwd xmm7, xmm6 ;k3k4k3k4k3k4k3k4 - - movq xmm4, rcx ;rounding - pshufd xmm4, xmm4, 0 - - mov rdx, 0x00010001 - movsxd rcx, DWORD PTR arg(6) ;bps - movq xmm8, rdx - movq xmm5, rcx - pshufd xmm8, xmm8, 0b - movdqa xmm1, xmm8 - psllw xmm8, xmm5 - psubw xmm8, xmm1 ;max value (for clamping) - pxor xmm5, xmm5 ;min value (for clamping) - - movsxd rax, DWORD PTR arg(1) ;pixels_per_line - movsxd rdx, DWORD PTR arg(3) ;out_pitch - movsxd rcx, DWORD PTR arg(4) ;output_height -%endm - -%macro HIGH_APPLY_FILTER_8 1 - movdqa xmm6, xmm0 - punpckhwd xmm6, xmm1 - punpcklwd xmm0, xmm1 - pmaddwd xmm6, xmm7 - pmaddwd xmm0, xmm7 - - paddd xmm6, xmm4 ;rounding - paddd xmm0, xmm4 ;rounding - psrad xmm6, 7 ;shift - psrad xmm0, 7 ;shift - packssdw xmm0, xmm6 ;pack back to word - - ;clamp the values - pminsw xmm0, xmm8 - pmaxsw xmm0, xmm5 - -%if %1 - movdqu xmm1, [rdi] - pavgw xmm0, xmm1 -%endif - movdqu [rdi], xmm0 ;store the result - - lea rsi, [rsi + 2*rax] - lea rdi, [rdi + 2*rdx] - dec rcx -%endm - -%macro HIGH_APPLY_FILTER_16 1 - movdqa xmm9, xmm0 - movdqa xmm6, xmm2 - punpckhwd xmm9, xmm1 - punpckhwd xmm6, xmm3 - punpcklwd xmm0, xmm1 - punpcklwd xmm2, xmm3 - - pmaddwd xmm9, xmm7 - pmaddwd xmm6, xmm7 - pmaddwd xmm0, xmm7 - pmaddwd xmm2, xmm7 - - paddd xmm9, xmm4 ;rounding - paddd xmm6, xmm4 - paddd xmm0, xmm4 - paddd xmm2, xmm4 - - psrad xmm9, 7 ;shift - psrad xmm6, 7 - psrad xmm0, 7 - psrad xmm2, 7 - - packssdw xmm0, xmm9 ;pack back to word - packssdw xmm2, xmm6 ;pack back to word - - ;clamp the values - pminsw xmm0, xmm8 - pmaxsw xmm0, xmm5 - pminsw xmm2, xmm8 - pmaxsw xmm2, xmm5 - -%if %1 - movdqu xmm1, [rdi] - movdqu xmm3, [rdi + 16] - pavgw xmm0, xmm1 - pavgw xmm2, xmm3 -%endif - movdqu [rdi], xmm0 ;store the result - movdqu [rdi + 16], xmm2 ;store the result - - lea rsi, [rsi + 2*rax] - lea rdi, [rdi + 2*rdx] - dec rcx -%endm -%endif - -global sym(vp9_highbd_filter_block1d4_v2_sse2) PRIVATE -sym(vp9_highbd_filter_block1d4_v2_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - push rsi - push rdi - ; end prolog - - HIGH_GET_PARAM_4 -.loop: - movq xmm0, [rsi] ;load src - movq xmm1, [rsi + 2*rax] - - HIGH_APPLY_FILTER_4 0 - jnz .loop - - ; begin epilog - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret - -%if ARCH_X86_64 -global sym(vp9_highbd_filter_block1d8_v2_sse2) PRIVATE -sym(vp9_highbd_filter_block1d8_v2_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 8 - push rsi - push rdi - ; end prolog - - HIGH_GET_PARAM -.loop: - movdqu xmm0, [rsi] ;0 - movdqu xmm1, [rsi + 2*rax] ;1 - - HIGH_APPLY_FILTER_8 0 - jnz .loop - - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -global sym(vp9_highbd_filter_block1d16_v2_sse2) PRIVATE -sym(vp9_highbd_filter_block1d16_v2_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 9 - push rsi - push rdi - ; end prolog - - HIGH_GET_PARAM -.loop: - movdqu xmm0, [rsi] ;0 - movdqu xmm2, [rsi + 16] - movdqu xmm1, [rsi + 2*rax] ;1 - movdqu xmm3, [rsi + 2*rax + 16] - - HIGH_APPLY_FILTER_16 0 - jnz .loop - - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret -%endif - -global sym(vp9_highbd_filter_block1d4_v2_avg_sse2) PRIVATE -sym(vp9_highbd_filter_block1d4_v2_avg_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - push rsi - push rdi - ; end prolog - - HIGH_GET_PARAM_4 -.loop: - movq xmm0, [rsi] ;load src - movq xmm1, [rsi + 2*rax] - - HIGH_APPLY_FILTER_4 1 - jnz .loop - - ; begin epilog - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret - -%if ARCH_X86_64 -global sym(vp9_highbd_filter_block1d8_v2_avg_sse2) PRIVATE -sym(vp9_highbd_filter_block1d8_v2_avg_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 8 - push rsi - push rdi - ; end prolog - - HIGH_GET_PARAM -.loop: - movdqu xmm0, [rsi] ;0 - movdqu xmm1, [rsi + 2*rax] ;1 - - HIGH_APPLY_FILTER_8 1 - jnz .loop - - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -global sym(vp9_highbd_filter_block1d16_v2_avg_sse2) PRIVATE -sym(vp9_highbd_filter_block1d16_v2_avg_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 9 - push rsi - push rdi - ; end prolog - - HIGH_GET_PARAM -.loop: - movdqu xmm0, [rsi] ;0 - movdqu xmm1, [rsi + 2*rax] ;1 - movdqu xmm2, [rsi + 16] - movdqu xmm3, [rsi + 2*rax + 16] - - HIGH_APPLY_FILTER_16 1 - jnz .loop - - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret -%endif - -global sym(vp9_highbd_filter_block1d4_h2_sse2) PRIVATE -sym(vp9_highbd_filter_block1d4_h2_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - push rsi - push rdi - ; end prolog - - HIGH_GET_PARAM_4 -.loop: - movdqu xmm0, [rsi] ;load src - movdqa xmm1, xmm0 - psrldq xmm1, 2 - - HIGH_APPLY_FILTER_4 0 - jnz .loop - - ; begin epilog - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret - -%if ARCH_X86_64 -global sym(vp9_highbd_filter_block1d8_h2_sse2) PRIVATE -sym(vp9_highbd_filter_block1d8_h2_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 8 - push rsi - push rdi - ; end prolog - - HIGH_GET_PARAM -.loop: - movdqu xmm0, [rsi] ;load src - movdqu xmm1, [rsi + 2] - - HIGH_APPLY_FILTER_8 0 - jnz .loop - - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -global sym(vp9_highbd_filter_block1d16_h2_sse2) PRIVATE -sym(vp9_highbd_filter_block1d16_h2_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 9 - push rsi - push rdi - ; end prolog - - HIGH_GET_PARAM -.loop: - movdqu xmm0, [rsi] ;load src - movdqu xmm1, [rsi + 2] - movdqu xmm2, [rsi + 16] - movdqu xmm3, [rsi + 18] - - HIGH_APPLY_FILTER_16 0 - jnz .loop - - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret -%endif - -global sym(vp9_highbd_filter_block1d4_h2_avg_sse2) PRIVATE -sym(vp9_highbd_filter_block1d4_h2_avg_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - push rsi - push rdi - ; end prolog - - HIGH_GET_PARAM_4 -.loop: - movdqu xmm0, [rsi] ;load src - movdqa xmm1, xmm0 - psrldq xmm1, 2 - - HIGH_APPLY_FILTER_4 1 - jnz .loop - - ; begin epilog - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret - -%if ARCH_X86_64 -global sym(vp9_highbd_filter_block1d8_h2_avg_sse2) PRIVATE -sym(vp9_highbd_filter_block1d8_h2_avg_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 8 - push rsi - push rdi - ; end prolog - - HIGH_GET_PARAM -.loop: - movdqu xmm0, [rsi] ;load src - movdqu xmm1, [rsi + 2] - - HIGH_APPLY_FILTER_8 1 - jnz .loop - - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -global sym(vp9_highbd_filter_block1d16_h2_avg_sse2) PRIVATE -sym(vp9_highbd_filter_block1d16_h2_avg_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 7 - SAVE_XMM 9 - push rsi - push rdi - ; end prolog - - HIGH_GET_PARAM -.loop: - movdqu xmm0, [rsi] ;load src - movdqu xmm1, [rsi + 2] - movdqu xmm2, [rsi + 16] - movdqu xmm3, [rsi + 18] - - HIGH_APPLY_FILTER_16 1 - jnz .loop - - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret -%endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_idct_intrin_sse2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_idct_intrin_sse2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_idct_intrin_sse2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_idct_intrin_sse2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,4558 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vp9/common/x86/vp9_idct_intrin_sse2.h" -#include "vp9/common/vp9_idct.h" - -#define RECON_AND_STORE4X4(dest, in_x) \ -{ \ - __m128i d0 = _mm_cvtsi32_si128(*(const int *)(dest)); \ - d0 = _mm_unpacklo_epi8(d0, zero); \ - d0 = _mm_add_epi16(in_x, d0); \ - d0 = _mm_packus_epi16(d0, d0); \ - *(int *)dest = _mm_cvtsi128_si32(d0); \ - dest += stride; \ -} - -void vp9_idct4x4_16_add_sse2(const int16_t *input, uint8_t *dest, int stride) { - const __m128i zero = _mm_setzero_si128(); - const __m128i eight = _mm_set1_epi16(8); - const __m128i cst = _mm_setr_epi16((int16_t)cospi_16_64, (int16_t)cospi_16_64, - (int16_t)cospi_16_64, (int16_t)-cospi_16_64, - (int16_t)cospi_24_64, (int16_t)-cospi_8_64, - (int16_t)cospi_8_64, (int16_t)cospi_24_64); - const __m128i rounding = _mm_set1_epi32(DCT_CONST_ROUNDING); - __m128i input0, input1, input2, input3; - - // Rows - input0 = _mm_load_si128((const __m128i *)input); - input2 = _mm_load_si128((const __m128i *)(input + 8)); - - // Construct i3, i1, i3, i1, i2, i0, i2, i0 - input0 = _mm_shufflelo_epi16(input0, 0xd8); - input0 = _mm_shufflehi_epi16(input0, 0xd8); - input2 = _mm_shufflelo_epi16(input2, 0xd8); - input2 = _mm_shufflehi_epi16(input2, 0xd8); - - input1 = _mm_unpackhi_epi32(input0, input0); - input0 = _mm_unpacklo_epi32(input0, input0); - input3 = _mm_unpackhi_epi32(input2, input2); - input2 = _mm_unpacklo_epi32(input2, input2); - - // Stage 1 - input0 = _mm_madd_epi16(input0, cst); - input1 = _mm_madd_epi16(input1, cst); - input2 = _mm_madd_epi16(input2, cst); - input3 = _mm_madd_epi16(input3, cst); - - input0 = _mm_add_epi32(input0, rounding); - input1 = _mm_add_epi32(input1, rounding); - input2 = _mm_add_epi32(input2, rounding); - input3 = _mm_add_epi32(input3, rounding); - - input0 = _mm_srai_epi32(input0, DCT_CONST_BITS); - input1 = _mm_srai_epi32(input1, DCT_CONST_BITS); - input2 = _mm_srai_epi32(input2, DCT_CONST_BITS); - input3 = _mm_srai_epi32(input3, DCT_CONST_BITS); - - // Stage 2 - input0 = _mm_packs_epi32(input0, input1); - input1 = _mm_packs_epi32(input2, input3); - - // Transpose - input2 = _mm_unpacklo_epi16(input0, input1); - input3 = _mm_unpackhi_epi16(input0, input1); - input0 = _mm_unpacklo_epi32(input2, input3); - input1 = _mm_unpackhi_epi32(input2, input3); - - // Switch column2, column 3, and then, we got: - // input2: column1, column 0; input3: column2, column 3. - input1 = _mm_shuffle_epi32(input1, 0x4e); - input2 = _mm_add_epi16(input0, input1); - input3 = _mm_sub_epi16(input0, input1); - - // Columns - // Construct i3, i1, i3, i1, i2, i0, i2, i0 - input0 = _mm_unpacklo_epi32(input2, input2); - input1 = _mm_unpackhi_epi32(input2, input2); - input2 = _mm_unpackhi_epi32(input3, input3); - input3 = _mm_unpacklo_epi32(input3, input3); - - // Stage 1 - input0 = _mm_madd_epi16(input0, cst); - input1 = _mm_madd_epi16(input1, cst); - input2 = _mm_madd_epi16(input2, cst); - input3 = _mm_madd_epi16(input3, cst); - - input0 = _mm_add_epi32(input0, rounding); - input1 = _mm_add_epi32(input1, rounding); - input2 = _mm_add_epi32(input2, rounding); - input3 = _mm_add_epi32(input3, rounding); - - input0 = _mm_srai_epi32(input0, DCT_CONST_BITS); - input1 = _mm_srai_epi32(input1, DCT_CONST_BITS); - input2 = _mm_srai_epi32(input2, DCT_CONST_BITS); - input3 = _mm_srai_epi32(input3, DCT_CONST_BITS); - - // Stage 2 - input0 = _mm_packs_epi32(input0, input2); - input1 = _mm_packs_epi32(input1, input3); - - // Transpose - input2 = _mm_unpacklo_epi16(input0, input1); - input3 = _mm_unpackhi_epi16(input0, input1); - input0 = _mm_unpacklo_epi32(input2, input3); - input1 = _mm_unpackhi_epi32(input2, input3); - - // Switch column2, column 3, and then, we got: - // input2: column1, column 0; input3: column2, column 3. - input1 = _mm_shuffle_epi32(input1, 0x4e); - input2 = _mm_add_epi16(input0, input1); - input3 = _mm_sub_epi16(input0, input1); - - // Final round and shift - input2 = _mm_add_epi16(input2, eight); - input3 = _mm_add_epi16(input3, eight); - - input2 = _mm_srai_epi16(input2, 4); - input3 = _mm_srai_epi16(input3, 4); - - // Reconstruction and Store - { - __m128i d0 = _mm_cvtsi32_si128(*(const int *)(dest)); - __m128i d2 = _mm_cvtsi32_si128(*(const int *)(dest + stride * 2)); - d0 = _mm_unpacklo_epi32(d0, - _mm_cvtsi32_si128(*(const int *) (dest + stride))); - d2 = _mm_unpacklo_epi32(_mm_cvtsi32_si128( - *(const int *) (dest + stride * 3)), d2); - d0 = _mm_unpacklo_epi8(d0, zero); - d2 = _mm_unpacklo_epi8(d2, zero); - d0 = _mm_add_epi16(d0, input2); - d2 = _mm_add_epi16(d2, input3); - d0 = _mm_packus_epi16(d0, d2); - // store input0 - *(int *)dest = _mm_cvtsi128_si32(d0); - // store input1 - d0 = _mm_srli_si128(d0, 4); - *(int *)(dest + stride) = _mm_cvtsi128_si32(d0); - // store input2 - d0 = _mm_srli_si128(d0, 4); - *(int *)(dest + stride * 3) = _mm_cvtsi128_si32(d0); - // store input3 - d0 = _mm_srli_si128(d0, 4); - *(int *)(dest + stride * 2) = _mm_cvtsi128_si32(d0); - } -} - -void vp9_idct4x4_1_add_sse2(const int16_t *input, uint8_t *dest, int stride) { - __m128i dc_value; - const __m128i zero = _mm_setzero_si128(); - int a; - - a = dct_const_round_shift(input[0] * cospi_16_64); - a = dct_const_round_shift(a * cospi_16_64); - a = ROUND_POWER_OF_TWO(a, 4); - - dc_value = _mm_set1_epi16(a); - - RECON_AND_STORE4X4(dest, dc_value); - RECON_AND_STORE4X4(dest, dc_value); - RECON_AND_STORE4X4(dest, dc_value); - RECON_AND_STORE4X4(dest, dc_value); -} - -static INLINE void transpose_4x4(__m128i *res) { - const __m128i tr0_0 = _mm_unpacklo_epi16(res[0], res[1]); - const __m128i tr0_1 = _mm_unpackhi_epi16(res[0], res[1]); - - res[0] = _mm_unpacklo_epi16(tr0_0, tr0_1); - res[1] = _mm_unpackhi_epi16(tr0_0, tr0_1); -} - -static void idct4_sse2(__m128i *in) { - const __m128i k__cospi_p16_p16 = pair_set_epi16(cospi_16_64, cospi_16_64); - const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64); - const __m128i k__cospi_p24_m08 = pair_set_epi16(cospi_24_64, -cospi_8_64); - const __m128i k__cospi_p08_p24 = pair_set_epi16(cospi_8_64, cospi_24_64); - const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING); - __m128i u[8], v[8]; - - transpose_4x4(in); - // stage 1 - u[0] = _mm_unpacklo_epi16(in[0], in[1]); - u[1] = _mm_unpackhi_epi16(in[0], in[1]); - v[0] = _mm_madd_epi16(u[0], k__cospi_p16_p16); - v[1] = _mm_madd_epi16(u[0], k__cospi_p16_m16); - v[2] = _mm_madd_epi16(u[1], k__cospi_p24_m08); - v[3] = _mm_madd_epi16(u[1], k__cospi_p08_p24); - - u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING); - u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING); - u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING); - u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING); - - v[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS); - v[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS); - v[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS); - v[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS); - - u[0] = _mm_packs_epi32(v[0], v[1]); - u[1] = _mm_packs_epi32(v[3], v[2]); - - // stage 2 - in[0] = _mm_add_epi16(u[0], u[1]); - in[1] = _mm_sub_epi16(u[0], u[1]); - in[1] = _mm_shuffle_epi32(in[1], 0x4E); -} - -static void iadst4_sse2(__m128i *in) { - const __m128i k__sinpi_p01_p04 = pair_set_epi16(sinpi_1_9, sinpi_4_9); - const __m128i k__sinpi_p03_p02 = pair_set_epi16(sinpi_3_9, sinpi_2_9); - const __m128i k__sinpi_p02_m01 = pair_set_epi16(sinpi_2_9, -sinpi_1_9); - const __m128i k__sinpi_p03_m04 = pair_set_epi16(sinpi_3_9, -sinpi_4_9); - const __m128i k__sinpi_p03_p03 = _mm_set1_epi16((int16_t)sinpi_3_9); - const __m128i kZero = _mm_set1_epi16(0); - const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING); - __m128i u[8], v[8], in7; - - transpose_4x4(in); - in7 = _mm_srli_si128(in[1], 8); - in7 = _mm_add_epi16(in7, in[0]); - in7 = _mm_sub_epi16(in7, in[1]); - - u[0] = _mm_unpacklo_epi16(in[0], in[1]); - u[1] = _mm_unpackhi_epi16(in[0], in[1]); - u[2] = _mm_unpacklo_epi16(in7, kZero); - u[3] = _mm_unpackhi_epi16(in[0], kZero); - - v[0] = _mm_madd_epi16(u[0], k__sinpi_p01_p04); // s0 + s3 - v[1] = _mm_madd_epi16(u[1], k__sinpi_p03_p02); // s2 + s5 - v[2] = _mm_madd_epi16(u[2], k__sinpi_p03_p03); // x2 - v[3] = _mm_madd_epi16(u[0], k__sinpi_p02_m01); // s1 - s4 - v[4] = _mm_madd_epi16(u[1], k__sinpi_p03_m04); // s2 - s6 - v[5] = _mm_madd_epi16(u[3], k__sinpi_p03_p03); // s2 - - u[0] = _mm_add_epi32(v[0], v[1]); - u[1] = _mm_add_epi32(v[3], v[4]); - u[2] = v[2]; - u[3] = _mm_add_epi32(u[0], u[1]); - u[4] = _mm_slli_epi32(v[5], 2); - u[5] = _mm_add_epi32(u[3], v[5]); - u[6] = _mm_sub_epi32(u[5], u[4]); - - v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING); - v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING); - v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING); - v[3] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING); - - u[0] = _mm_srai_epi32(v[0], DCT_CONST_BITS); - u[1] = _mm_srai_epi32(v[1], DCT_CONST_BITS); - u[2] = _mm_srai_epi32(v[2], DCT_CONST_BITS); - u[3] = _mm_srai_epi32(v[3], DCT_CONST_BITS); - - in[0] = _mm_packs_epi32(u[0], u[1]); - in[1] = _mm_packs_epi32(u[2], u[3]); -} - -void vp9_iht4x4_16_add_sse2(const int16_t *input, uint8_t *dest, int stride, - int tx_type) { - __m128i in[2]; - const __m128i zero = _mm_setzero_si128(); - const __m128i eight = _mm_set1_epi16(8); - - in[0]= _mm_loadu_si128((const __m128i *)(input)); - in[1]= _mm_loadu_si128((const __m128i *)(input + 8)); - - switch (tx_type) { - case 0: // DCT_DCT - idct4_sse2(in); - idct4_sse2(in); - break; - case 1: // ADST_DCT - idct4_sse2(in); - iadst4_sse2(in); - break; - case 2: // DCT_ADST - iadst4_sse2(in); - idct4_sse2(in); - break; - case 3: // ADST_ADST - iadst4_sse2(in); - iadst4_sse2(in); - break; - default: - assert(0); - break; - } - - // Final round and shift - in[0] = _mm_add_epi16(in[0], eight); - in[1] = _mm_add_epi16(in[1], eight); - - in[0] = _mm_srai_epi16(in[0], 4); - in[1] = _mm_srai_epi16(in[1], 4); - - // Reconstruction and Store - { - __m128i d0 = _mm_cvtsi32_si128(*(const int *)(dest)); - __m128i d2 = _mm_cvtsi32_si128(*(const int *)(dest + stride * 2)); - d0 = _mm_unpacklo_epi32(d0, - _mm_cvtsi32_si128(*(const int *) (dest + stride))); - d2 = _mm_unpacklo_epi32(d2, _mm_cvtsi32_si128( - *(const int *) (dest + stride * 3))); - d0 = _mm_unpacklo_epi8(d0, zero); - d2 = _mm_unpacklo_epi8(d2, zero); - d0 = _mm_add_epi16(d0, in[0]); - d2 = _mm_add_epi16(d2, in[1]); - d0 = _mm_packus_epi16(d0, d2); - // store result[0] - *(int *)dest = _mm_cvtsi128_si32(d0); - // store result[1] - d0 = _mm_srli_si128(d0, 4); - *(int *)(dest + stride) = _mm_cvtsi128_si32(d0); - // store result[2] - d0 = _mm_srli_si128(d0, 4); - *(int *)(dest + stride * 2) = _mm_cvtsi128_si32(d0); - // store result[3] - d0 = _mm_srli_si128(d0, 4); - *(int *)(dest + stride * 3) = _mm_cvtsi128_si32(d0); - } -} - -#define TRANSPOSE_8X8(in0, in1, in2, in3, in4, in5, in6, in7, \ - out0, out1, out2, out3, out4, out5, out6, out7) \ - { \ - const __m128i tr0_0 = _mm_unpacklo_epi16(in0, in1); \ - const __m128i tr0_1 = _mm_unpacklo_epi16(in2, in3); \ - const __m128i tr0_2 = _mm_unpackhi_epi16(in0, in1); \ - const __m128i tr0_3 = _mm_unpackhi_epi16(in2, in3); \ - const __m128i tr0_4 = _mm_unpacklo_epi16(in4, in5); \ - const __m128i tr0_5 = _mm_unpacklo_epi16(in6, in7); \ - const __m128i tr0_6 = _mm_unpackhi_epi16(in4, in5); \ - const __m128i tr0_7 = _mm_unpackhi_epi16(in6, in7); \ - \ - const __m128i tr1_0 = _mm_unpacklo_epi32(tr0_0, tr0_1); \ - const __m128i tr1_1 = _mm_unpacklo_epi32(tr0_2, tr0_3); \ - const __m128i tr1_2 = _mm_unpackhi_epi32(tr0_0, tr0_1); \ - const __m128i tr1_3 = _mm_unpackhi_epi32(tr0_2, tr0_3); \ - const __m128i tr1_4 = _mm_unpacklo_epi32(tr0_4, tr0_5); \ - const __m128i tr1_5 = _mm_unpacklo_epi32(tr0_6, tr0_7); \ - const __m128i tr1_6 = _mm_unpackhi_epi32(tr0_4, tr0_5); \ - const __m128i tr1_7 = _mm_unpackhi_epi32(tr0_6, tr0_7); \ - \ - out0 = _mm_unpacklo_epi64(tr1_0, tr1_4); \ - out1 = _mm_unpackhi_epi64(tr1_0, tr1_4); \ - out2 = _mm_unpacklo_epi64(tr1_2, tr1_6); \ - out3 = _mm_unpackhi_epi64(tr1_2, tr1_6); \ - out4 = _mm_unpacklo_epi64(tr1_1, tr1_5); \ - out5 = _mm_unpackhi_epi64(tr1_1, tr1_5); \ - out6 = _mm_unpacklo_epi64(tr1_3, tr1_7); \ - out7 = _mm_unpackhi_epi64(tr1_3, tr1_7); \ - } - -#define TRANSPOSE_4X8_10(tmp0, tmp1, tmp2, tmp3, \ - out0, out1, out2, out3) \ - { \ - const __m128i tr0_0 = _mm_unpackhi_epi16(tmp0, tmp1); \ - const __m128i tr0_1 = _mm_unpacklo_epi16(tmp1, tmp0); \ - const __m128i tr0_4 = _mm_unpacklo_epi16(tmp2, tmp3); \ - const __m128i tr0_5 = _mm_unpackhi_epi16(tmp3, tmp2); \ - \ - const __m128i tr1_0 = _mm_unpacklo_epi32(tr0_0, tr0_1); \ - const __m128i tr1_2 = _mm_unpackhi_epi32(tr0_0, tr0_1); \ - const __m128i tr1_4 = _mm_unpacklo_epi32(tr0_4, tr0_5); \ - const __m128i tr1_6 = _mm_unpackhi_epi32(tr0_4, tr0_5); \ - \ - out0 = _mm_unpacklo_epi64(tr1_0, tr1_4); \ - out1 = _mm_unpackhi_epi64(tr1_0, tr1_4); \ - out2 = _mm_unpacklo_epi64(tr1_2, tr1_6); \ - out3 = _mm_unpackhi_epi64(tr1_2, tr1_6); \ - } - -#define TRANSPOSE_8X8_10(in0, in1, in2, in3, out0, out1) \ - { \ - const __m128i tr0_0 = _mm_unpacklo_epi16(in0, in1); \ - const __m128i tr0_1 = _mm_unpacklo_epi16(in2, in3); \ - out0 = _mm_unpacklo_epi32(tr0_0, tr0_1); \ - out1 = _mm_unpackhi_epi32(tr0_0, tr0_1); \ - } - -// Define Macro for multiplying elements by constants and adding them together. -#define MULTIPLICATION_AND_ADD(lo_0, hi_0, lo_1, hi_1, \ - cst0, cst1, cst2, cst3, res0, res1, res2, res3) \ - { \ - tmp0 = _mm_madd_epi16(lo_0, cst0); \ - tmp1 = _mm_madd_epi16(hi_0, cst0); \ - tmp2 = _mm_madd_epi16(lo_0, cst1); \ - tmp3 = _mm_madd_epi16(hi_0, cst1); \ - tmp4 = _mm_madd_epi16(lo_1, cst2); \ - tmp5 = _mm_madd_epi16(hi_1, cst2); \ - tmp6 = _mm_madd_epi16(lo_1, cst3); \ - tmp7 = _mm_madd_epi16(hi_1, cst3); \ - \ - tmp0 = _mm_add_epi32(tmp0, rounding); \ - tmp1 = _mm_add_epi32(tmp1, rounding); \ - tmp2 = _mm_add_epi32(tmp2, rounding); \ - tmp3 = _mm_add_epi32(tmp3, rounding); \ - tmp4 = _mm_add_epi32(tmp4, rounding); \ - tmp5 = _mm_add_epi32(tmp5, rounding); \ - tmp6 = _mm_add_epi32(tmp6, rounding); \ - tmp7 = _mm_add_epi32(tmp7, rounding); \ - \ - tmp0 = _mm_srai_epi32(tmp0, DCT_CONST_BITS); \ - tmp1 = _mm_srai_epi32(tmp1, DCT_CONST_BITS); \ - tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS); \ - tmp3 = _mm_srai_epi32(tmp3, DCT_CONST_BITS); \ - tmp4 = _mm_srai_epi32(tmp4, DCT_CONST_BITS); \ - tmp5 = _mm_srai_epi32(tmp5, DCT_CONST_BITS); \ - tmp6 = _mm_srai_epi32(tmp6, DCT_CONST_BITS); \ - tmp7 = _mm_srai_epi32(tmp7, DCT_CONST_BITS); \ - \ - res0 = _mm_packs_epi32(tmp0, tmp1); \ - res1 = _mm_packs_epi32(tmp2, tmp3); \ - res2 = _mm_packs_epi32(tmp4, tmp5); \ - res3 = _mm_packs_epi32(tmp6, tmp7); \ - } - -#define MULTIPLICATION_AND_ADD_2(lo_0, hi_0, cst0, cst1, res0, res1) \ - { \ - tmp0 = _mm_madd_epi16(lo_0, cst0); \ - tmp1 = _mm_madd_epi16(hi_0, cst0); \ - tmp2 = _mm_madd_epi16(lo_0, cst1); \ - tmp3 = _mm_madd_epi16(hi_0, cst1); \ - \ - tmp0 = _mm_add_epi32(tmp0, rounding); \ - tmp1 = _mm_add_epi32(tmp1, rounding); \ - tmp2 = _mm_add_epi32(tmp2, rounding); \ - tmp3 = _mm_add_epi32(tmp3, rounding); \ - \ - tmp0 = _mm_srai_epi32(tmp0, DCT_CONST_BITS); \ - tmp1 = _mm_srai_epi32(tmp1, DCT_CONST_BITS); \ - tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS); \ - tmp3 = _mm_srai_epi32(tmp3, DCT_CONST_BITS); \ - \ - res0 = _mm_packs_epi32(tmp0, tmp1); \ - res1 = _mm_packs_epi32(tmp2, tmp3); \ - } - -#define IDCT8(in0, in1, in2, in3, in4, in5, in6, in7, \ - out0, out1, out2, out3, out4, out5, out6, out7) \ - { \ - /* Stage1 */ \ - { \ - const __m128i lo_17 = _mm_unpacklo_epi16(in1, in7); \ - const __m128i hi_17 = _mm_unpackhi_epi16(in1, in7); \ - const __m128i lo_35 = _mm_unpacklo_epi16(in3, in5); \ - const __m128i hi_35 = _mm_unpackhi_epi16(in3, in5); \ - \ - MULTIPLICATION_AND_ADD(lo_17, hi_17, lo_35, hi_35, stg1_0, \ - stg1_1, stg1_2, stg1_3, stp1_4, \ - stp1_7, stp1_5, stp1_6) \ - } \ - \ - /* Stage2 */ \ - { \ - const __m128i lo_04 = _mm_unpacklo_epi16(in0, in4); \ - const __m128i hi_04 = _mm_unpackhi_epi16(in0, in4); \ - const __m128i lo_26 = _mm_unpacklo_epi16(in2, in6); \ - const __m128i hi_26 = _mm_unpackhi_epi16(in2, in6); \ - \ - MULTIPLICATION_AND_ADD(lo_04, hi_04, lo_26, hi_26, stg2_0, \ - stg2_1, stg2_2, stg2_3, stp2_0, \ - stp2_1, stp2_2, stp2_3) \ - \ - stp2_4 = _mm_adds_epi16(stp1_4, stp1_5); \ - stp2_5 = _mm_subs_epi16(stp1_4, stp1_5); \ - stp2_6 = _mm_subs_epi16(stp1_7, stp1_6); \ - stp2_7 = _mm_adds_epi16(stp1_7, stp1_6); \ - } \ - \ - /* Stage3 */ \ - { \ - const __m128i lo_56 = _mm_unpacklo_epi16(stp2_6, stp2_5); \ - const __m128i hi_56 = _mm_unpackhi_epi16(stp2_6, stp2_5); \ - \ - stp1_0 = _mm_adds_epi16(stp2_0, stp2_3); \ - stp1_1 = _mm_adds_epi16(stp2_1, stp2_2); \ - stp1_2 = _mm_subs_epi16(stp2_1, stp2_2); \ - stp1_3 = _mm_subs_epi16(stp2_0, stp2_3); \ - \ - tmp0 = _mm_madd_epi16(lo_56, stg2_1); \ - tmp1 = _mm_madd_epi16(hi_56, stg2_1); \ - tmp2 = _mm_madd_epi16(lo_56, stg2_0); \ - tmp3 = _mm_madd_epi16(hi_56, stg2_0); \ - \ - tmp0 = _mm_add_epi32(tmp0, rounding); \ - tmp1 = _mm_add_epi32(tmp1, rounding); \ - tmp2 = _mm_add_epi32(tmp2, rounding); \ - tmp3 = _mm_add_epi32(tmp3, rounding); \ - \ - tmp0 = _mm_srai_epi32(tmp0, DCT_CONST_BITS); \ - tmp1 = _mm_srai_epi32(tmp1, DCT_CONST_BITS); \ - tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS); \ - tmp3 = _mm_srai_epi32(tmp3, DCT_CONST_BITS); \ - \ - stp1_5 = _mm_packs_epi32(tmp0, tmp1); \ - stp1_6 = _mm_packs_epi32(tmp2, tmp3); \ - } \ - \ - /* Stage4 */ \ - out0 = _mm_adds_epi16(stp1_0, stp2_7); \ - out1 = _mm_adds_epi16(stp1_1, stp1_6); \ - out2 = _mm_adds_epi16(stp1_2, stp1_5); \ - out3 = _mm_adds_epi16(stp1_3, stp2_4); \ - out4 = _mm_subs_epi16(stp1_3, stp2_4); \ - out5 = _mm_subs_epi16(stp1_2, stp1_5); \ - out6 = _mm_subs_epi16(stp1_1, stp1_6); \ - out7 = _mm_subs_epi16(stp1_0, stp2_7); \ - } - -void vp9_idct8x8_64_add_sse2(const int16_t *input, uint8_t *dest, int stride) { - const __m128i zero = _mm_setzero_si128(); - const __m128i rounding = _mm_set1_epi32(DCT_CONST_ROUNDING); - const __m128i final_rounding = _mm_set1_epi16(1<<4); - const __m128i stg1_0 = pair_set_epi16(cospi_28_64, -cospi_4_64); - const __m128i stg1_1 = pair_set_epi16(cospi_4_64, cospi_28_64); - const __m128i stg1_2 = pair_set_epi16(-cospi_20_64, cospi_12_64); - const __m128i stg1_3 = pair_set_epi16(cospi_12_64, cospi_20_64); - const __m128i stg2_0 = pair_set_epi16(cospi_16_64, cospi_16_64); - const __m128i stg2_1 = pair_set_epi16(cospi_16_64, -cospi_16_64); - const __m128i stg2_2 = pair_set_epi16(cospi_24_64, -cospi_8_64); - const __m128i stg2_3 = pair_set_epi16(cospi_8_64, cospi_24_64); - - __m128i in0, in1, in2, in3, in4, in5, in6, in7; - __m128i stp1_0, stp1_1, stp1_2, stp1_3, stp1_4, stp1_5, stp1_6, stp1_7; - __m128i stp2_0, stp2_1, stp2_2, stp2_3, stp2_4, stp2_5, stp2_6, stp2_7; - __m128i tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - int i; - - // Load input data. - in0 = _mm_load_si128((const __m128i *)input); - in1 = _mm_load_si128((const __m128i *)(input + 8 * 1)); - in2 = _mm_load_si128((const __m128i *)(input + 8 * 2)); - in3 = _mm_load_si128((const __m128i *)(input + 8 * 3)); - in4 = _mm_load_si128((const __m128i *)(input + 8 * 4)); - in5 = _mm_load_si128((const __m128i *)(input + 8 * 5)); - in6 = _mm_load_si128((const __m128i *)(input + 8 * 6)); - in7 = _mm_load_si128((const __m128i *)(input + 8 * 7)); - - // 2-D - for (i = 0; i < 2; i++) { - // 8x8 Transpose is copied from vp9_fdct8x8_sse2() - TRANSPOSE_8X8(in0, in1, in2, in3, in4, in5, in6, in7, - in0, in1, in2, in3, in4, in5, in6, in7); - - // 4-stage 1D idct8x8 - IDCT8(in0, in1, in2, in3, in4, in5, in6, in7, - in0, in1, in2, in3, in4, in5, in6, in7); - } - - // Final rounding and shift - in0 = _mm_adds_epi16(in0, final_rounding); - in1 = _mm_adds_epi16(in1, final_rounding); - in2 = _mm_adds_epi16(in2, final_rounding); - in3 = _mm_adds_epi16(in3, final_rounding); - in4 = _mm_adds_epi16(in4, final_rounding); - in5 = _mm_adds_epi16(in5, final_rounding); - in6 = _mm_adds_epi16(in6, final_rounding); - in7 = _mm_adds_epi16(in7, final_rounding); - - in0 = _mm_srai_epi16(in0, 5); - in1 = _mm_srai_epi16(in1, 5); - in2 = _mm_srai_epi16(in2, 5); - in3 = _mm_srai_epi16(in3, 5); - in4 = _mm_srai_epi16(in4, 5); - in5 = _mm_srai_epi16(in5, 5); - in6 = _mm_srai_epi16(in6, 5); - in7 = _mm_srai_epi16(in7, 5); - - RECON_AND_STORE(dest, in0); - RECON_AND_STORE(dest, in1); - RECON_AND_STORE(dest, in2); - RECON_AND_STORE(dest, in3); - RECON_AND_STORE(dest, in4); - RECON_AND_STORE(dest, in5); - RECON_AND_STORE(dest, in6); - RECON_AND_STORE(dest, in7); -} - -void vp9_idct8x8_1_add_sse2(const int16_t *input, uint8_t *dest, int stride) { - __m128i dc_value; - const __m128i zero = _mm_setzero_si128(); - int a; - - a = dct_const_round_shift(input[0] * cospi_16_64); - a = dct_const_round_shift(a * cospi_16_64); - a = ROUND_POWER_OF_TWO(a, 5); - - dc_value = _mm_set1_epi16(a); - - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); -} - -static void idct8_sse2(__m128i *in) { - const __m128i rounding = _mm_set1_epi32(DCT_CONST_ROUNDING); - const __m128i stg1_0 = pair_set_epi16(cospi_28_64, -cospi_4_64); - const __m128i stg1_1 = pair_set_epi16(cospi_4_64, cospi_28_64); - const __m128i stg1_2 = pair_set_epi16(-cospi_20_64, cospi_12_64); - const __m128i stg1_3 = pair_set_epi16(cospi_12_64, cospi_20_64); - const __m128i stg2_0 = pair_set_epi16(cospi_16_64, cospi_16_64); - const __m128i stg2_1 = pair_set_epi16(cospi_16_64, -cospi_16_64); - const __m128i stg2_2 = pair_set_epi16(cospi_24_64, -cospi_8_64); - const __m128i stg2_3 = pair_set_epi16(cospi_8_64, cospi_24_64); - - __m128i in0, in1, in2, in3, in4, in5, in6, in7; - __m128i stp1_0, stp1_1, stp1_2, stp1_3, stp1_4, stp1_5, stp1_6, stp1_7; - __m128i stp2_0, stp2_1, stp2_2, stp2_3, stp2_4, stp2_5, stp2_6, stp2_7; - __m128i tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - - // 8x8 Transpose is copied from vp9_fdct8x8_sse2() - TRANSPOSE_8X8(in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7], - in0, in1, in2, in3, in4, in5, in6, in7); - - // 4-stage 1D idct8x8 - IDCT8(in0, in1, in2, in3, in4, in5, in6, in7, - in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]); -} - -static void iadst8_sse2(__m128i *in) { - const __m128i k__cospi_p02_p30 = pair_set_epi16(cospi_2_64, cospi_30_64); - const __m128i k__cospi_p30_m02 = pair_set_epi16(cospi_30_64, -cospi_2_64); - const __m128i k__cospi_p10_p22 = pair_set_epi16(cospi_10_64, cospi_22_64); - const __m128i k__cospi_p22_m10 = pair_set_epi16(cospi_22_64, -cospi_10_64); - const __m128i k__cospi_p18_p14 = pair_set_epi16(cospi_18_64, cospi_14_64); - const __m128i k__cospi_p14_m18 = pair_set_epi16(cospi_14_64, -cospi_18_64); - const __m128i k__cospi_p26_p06 = pair_set_epi16(cospi_26_64, cospi_6_64); - const __m128i k__cospi_p06_m26 = pair_set_epi16(cospi_6_64, -cospi_26_64); - const __m128i k__cospi_p08_p24 = pair_set_epi16(cospi_8_64, cospi_24_64); - const __m128i k__cospi_p24_m08 = pair_set_epi16(cospi_24_64, -cospi_8_64); - const __m128i k__cospi_m24_p08 = pair_set_epi16(-cospi_24_64, cospi_8_64); - const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64); - const __m128i k__cospi_p16_p16 = _mm_set1_epi16((int16_t)cospi_16_64); - const __m128i k__const_0 = _mm_set1_epi16(0); - const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING); - - __m128i u0, u1, u2, u3, u4, u5, u6, u7, u8, u9, u10, u11, u12, u13, u14, u15; - __m128i v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15; - __m128i w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15; - __m128i s0, s1, s2, s3, s4, s5, s6, s7; - __m128i in0, in1, in2, in3, in4, in5, in6, in7; - - // transpose - array_transpose_8x8(in, in); - - // properly aligned for butterfly input - in0 = in[7]; - in1 = in[0]; - in2 = in[5]; - in3 = in[2]; - in4 = in[3]; - in5 = in[4]; - in6 = in[1]; - in7 = in[6]; - - // column transformation - // stage 1 - // interleave and multiply/add into 32-bit integer - s0 = _mm_unpacklo_epi16(in0, in1); - s1 = _mm_unpackhi_epi16(in0, in1); - s2 = _mm_unpacklo_epi16(in2, in3); - s3 = _mm_unpackhi_epi16(in2, in3); - s4 = _mm_unpacklo_epi16(in4, in5); - s5 = _mm_unpackhi_epi16(in4, in5); - s6 = _mm_unpacklo_epi16(in6, in7); - s7 = _mm_unpackhi_epi16(in6, in7); - - u0 = _mm_madd_epi16(s0, k__cospi_p02_p30); - u1 = _mm_madd_epi16(s1, k__cospi_p02_p30); - u2 = _mm_madd_epi16(s0, k__cospi_p30_m02); - u3 = _mm_madd_epi16(s1, k__cospi_p30_m02); - u4 = _mm_madd_epi16(s2, k__cospi_p10_p22); - u5 = _mm_madd_epi16(s3, k__cospi_p10_p22); - u6 = _mm_madd_epi16(s2, k__cospi_p22_m10); - u7 = _mm_madd_epi16(s3, k__cospi_p22_m10); - u8 = _mm_madd_epi16(s4, k__cospi_p18_p14); - u9 = _mm_madd_epi16(s5, k__cospi_p18_p14); - u10 = _mm_madd_epi16(s4, k__cospi_p14_m18); - u11 = _mm_madd_epi16(s5, k__cospi_p14_m18); - u12 = _mm_madd_epi16(s6, k__cospi_p26_p06); - u13 = _mm_madd_epi16(s7, k__cospi_p26_p06); - u14 = _mm_madd_epi16(s6, k__cospi_p06_m26); - u15 = _mm_madd_epi16(s7, k__cospi_p06_m26); - - // addition - w0 = _mm_add_epi32(u0, u8); - w1 = _mm_add_epi32(u1, u9); - w2 = _mm_add_epi32(u2, u10); - w3 = _mm_add_epi32(u3, u11); - w4 = _mm_add_epi32(u4, u12); - w5 = _mm_add_epi32(u5, u13); - w6 = _mm_add_epi32(u6, u14); - w7 = _mm_add_epi32(u7, u15); - w8 = _mm_sub_epi32(u0, u8); - w9 = _mm_sub_epi32(u1, u9); - w10 = _mm_sub_epi32(u2, u10); - w11 = _mm_sub_epi32(u3, u11); - w12 = _mm_sub_epi32(u4, u12); - w13 = _mm_sub_epi32(u5, u13); - w14 = _mm_sub_epi32(u6, u14); - w15 = _mm_sub_epi32(u7, u15); - - // shift and rounding - v0 = _mm_add_epi32(w0, k__DCT_CONST_ROUNDING); - v1 = _mm_add_epi32(w1, k__DCT_CONST_ROUNDING); - v2 = _mm_add_epi32(w2, k__DCT_CONST_ROUNDING); - v3 = _mm_add_epi32(w3, k__DCT_CONST_ROUNDING); - v4 = _mm_add_epi32(w4, k__DCT_CONST_ROUNDING); - v5 = _mm_add_epi32(w5, k__DCT_CONST_ROUNDING); - v6 = _mm_add_epi32(w6, k__DCT_CONST_ROUNDING); - v7 = _mm_add_epi32(w7, k__DCT_CONST_ROUNDING); - v8 = _mm_add_epi32(w8, k__DCT_CONST_ROUNDING); - v9 = _mm_add_epi32(w9, k__DCT_CONST_ROUNDING); - v10 = _mm_add_epi32(w10, k__DCT_CONST_ROUNDING); - v11 = _mm_add_epi32(w11, k__DCT_CONST_ROUNDING); - v12 = _mm_add_epi32(w12, k__DCT_CONST_ROUNDING); - v13 = _mm_add_epi32(w13, k__DCT_CONST_ROUNDING); - v14 = _mm_add_epi32(w14, k__DCT_CONST_ROUNDING); - v15 = _mm_add_epi32(w15, k__DCT_CONST_ROUNDING); - - u0 = _mm_srai_epi32(v0, DCT_CONST_BITS); - u1 = _mm_srai_epi32(v1, DCT_CONST_BITS); - u2 = _mm_srai_epi32(v2, DCT_CONST_BITS); - u3 = _mm_srai_epi32(v3, DCT_CONST_BITS); - u4 = _mm_srai_epi32(v4, DCT_CONST_BITS); - u5 = _mm_srai_epi32(v5, DCT_CONST_BITS); - u6 = _mm_srai_epi32(v6, DCT_CONST_BITS); - u7 = _mm_srai_epi32(v7, DCT_CONST_BITS); - u8 = _mm_srai_epi32(v8, DCT_CONST_BITS); - u9 = _mm_srai_epi32(v9, DCT_CONST_BITS); - u10 = _mm_srai_epi32(v10, DCT_CONST_BITS); - u11 = _mm_srai_epi32(v11, DCT_CONST_BITS); - u12 = _mm_srai_epi32(v12, DCT_CONST_BITS); - u13 = _mm_srai_epi32(v13, DCT_CONST_BITS); - u14 = _mm_srai_epi32(v14, DCT_CONST_BITS); - u15 = _mm_srai_epi32(v15, DCT_CONST_BITS); - - // back to 16-bit and pack 8 integers into __m128i - in[0] = _mm_packs_epi32(u0, u1); - in[1] = _mm_packs_epi32(u2, u3); - in[2] = _mm_packs_epi32(u4, u5); - in[3] = _mm_packs_epi32(u6, u7); - in[4] = _mm_packs_epi32(u8, u9); - in[5] = _mm_packs_epi32(u10, u11); - in[6] = _mm_packs_epi32(u12, u13); - in[7] = _mm_packs_epi32(u14, u15); - - // stage 2 - s0 = _mm_add_epi16(in[0], in[2]); - s1 = _mm_add_epi16(in[1], in[3]); - s2 = _mm_sub_epi16(in[0], in[2]); - s3 = _mm_sub_epi16(in[1], in[3]); - u0 = _mm_unpacklo_epi16(in[4], in[5]); - u1 = _mm_unpackhi_epi16(in[4], in[5]); - u2 = _mm_unpacklo_epi16(in[6], in[7]); - u3 = _mm_unpackhi_epi16(in[6], in[7]); - - v0 = _mm_madd_epi16(u0, k__cospi_p08_p24); - v1 = _mm_madd_epi16(u1, k__cospi_p08_p24); - v2 = _mm_madd_epi16(u0, k__cospi_p24_m08); - v3 = _mm_madd_epi16(u1, k__cospi_p24_m08); - v4 = _mm_madd_epi16(u2, k__cospi_m24_p08); - v5 = _mm_madd_epi16(u3, k__cospi_m24_p08); - v6 = _mm_madd_epi16(u2, k__cospi_p08_p24); - v7 = _mm_madd_epi16(u3, k__cospi_p08_p24); - - w0 = _mm_add_epi32(v0, v4); - w1 = _mm_add_epi32(v1, v5); - w2 = _mm_add_epi32(v2, v6); - w3 = _mm_add_epi32(v3, v7); - w4 = _mm_sub_epi32(v0, v4); - w5 = _mm_sub_epi32(v1, v5); - w6 = _mm_sub_epi32(v2, v6); - w7 = _mm_sub_epi32(v3, v7); - - v0 = _mm_add_epi32(w0, k__DCT_CONST_ROUNDING); - v1 = _mm_add_epi32(w1, k__DCT_CONST_ROUNDING); - v2 = _mm_add_epi32(w2, k__DCT_CONST_ROUNDING); - v3 = _mm_add_epi32(w3, k__DCT_CONST_ROUNDING); - v4 = _mm_add_epi32(w4, k__DCT_CONST_ROUNDING); - v5 = _mm_add_epi32(w5, k__DCT_CONST_ROUNDING); - v6 = _mm_add_epi32(w6, k__DCT_CONST_ROUNDING); - v7 = _mm_add_epi32(w7, k__DCT_CONST_ROUNDING); - - u0 = _mm_srai_epi32(v0, DCT_CONST_BITS); - u1 = _mm_srai_epi32(v1, DCT_CONST_BITS); - u2 = _mm_srai_epi32(v2, DCT_CONST_BITS); - u3 = _mm_srai_epi32(v3, DCT_CONST_BITS); - u4 = _mm_srai_epi32(v4, DCT_CONST_BITS); - u5 = _mm_srai_epi32(v5, DCT_CONST_BITS); - u6 = _mm_srai_epi32(v6, DCT_CONST_BITS); - u7 = _mm_srai_epi32(v7, DCT_CONST_BITS); - - // back to 16-bit intergers - s4 = _mm_packs_epi32(u0, u1); - s5 = _mm_packs_epi32(u2, u3); - s6 = _mm_packs_epi32(u4, u5); - s7 = _mm_packs_epi32(u6, u7); - - // stage 3 - u0 = _mm_unpacklo_epi16(s2, s3); - u1 = _mm_unpackhi_epi16(s2, s3); - u2 = _mm_unpacklo_epi16(s6, s7); - u3 = _mm_unpackhi_epi16(s6, s7); - - v0 = _mm_madd_epi16(u0, k__cospi_p16_p16); - v1 = _mm_madd_epi16(u1, k__cospi_p16_p16); - v2 = _mm_madd_epi16(u0, k__cospi_p16_m16); - v3 = _mm_madd_epi16(u1, k__cospi_p16_m16); - v4 = _mm_madd_epi16(u2, k__cospi_p16_p16); - v5 = _mm_madd_epi16(u3, k__cospi_p16_p16); - v6 = _mm_madd_epi16(u2, k__cospi_p16_m16); - v7 = _mm_madd_epi16(u3, k__cospi_p16_m16); - - u0 = _mm_add_epi32(v0, k__DCT_CONST_ROUNDING); - u1 = _mm_add_epi32(v1, k__DCT_CONST_ROUNDING); - u2 = _mm_add_epi32(v2, k__DCT_CONST_ROUNDING); - u3 = _mm_add_epi32(v3, k__DCT_CONST_ROUNDING); - u4 = _mm_add_epi32(v4, k__DCT_CONST_ROUNDING); - u5 = _mm_add_epi32(v5, k__DCT_CONST_ROUNDING); - u6 = _mm_add_epi32(v6, k__DCT_CONST_ROUNDING); - u7 = _mm_add_epi32(v7, k__DCT_CONST_ROUNDING); - - v0 = _mm_srai_epi32(u0, DCT_CONST_BITS); - v1 = _mm_srai_epi32(u1, DCT_CONST_BITS); - v2 = _mm_srai_epi32(u2, DCT_CONST_BITS); - v3 = _mm_srai_epi32(u3, DCT_CONST_BITS); - v4 = _mm_srai_epi32(u4, DCT_CONST_BITS); - v5 = _mm_srai_epi32(u5, DCT_CONST_BITS); - v6 = _mm_srai_epi32(u6, DCT_CONST_BITS); - v7 = _mm_srai_epi32(u7, DCT_CONST_BITS); - - s2 = _mm_packs_epi32(v0, v1); - s3 = _mm_packs_epi32(v2, v3); - s6 = _mm_packs_epi32(v4, v5); - s7 = _mm_packs_epi32(v6, v7); - - in[0] = s0; - in[1] = _mm_sub_epi16(k__const_0, s4); - in[2] = s6; - in[3] = _mm_sub_epi16(k__const_0, s2); - in[4] = s3; - in[5] = _mm_sub_epi16(k__const_0, s7); - in[6] = s5; - in[7] = _mm_sub_epi16(k__const_0, s1); -} - - -void vp9_iht8x8_64_add_sse2(const int16_t *input, uint8_t *dest, int stride, - int tx_type) { - __m128i in[8]; - const __m128i zero = _mm_setzero_si128(); - const __m128i final_rounding = _mm_set1_epi16(1<<4); - - // load input data - in[0] = _mm_load_si128((const __m128i *)input); - in[1] = _mm_load_si128((const __m128i *)(input + 8 * 1)); - in[2] = _mm_load_si128((const __m128i *)(input + 8 * 2)); - in[3] = _mm_load_si128((const __m128i *)(input + 8 * 3)); - in[4] = _mm_load_si128((const __m128i *)(input + 8 * 4)); - in[5] = _mm_load_si128((const __m128i *)(input + 8 * 5)); - in[6] = _mm_load_si128((const __m128i *)(input + 8 * 6)); - in[7] = _mm_load_si128((const __m128i *)(input + 8 * 7)); - - switch (tx_type) { - case 0: // DCT_DCT - idct8_sse2(in); - idct8_sse2(in); - break; - case 1: // ADST_DCT - idct8_sse2(in); - iadst8_sse2(in); - break; - case 2: // DCT_ADST - iadst8_sse2(in); - idct8_sse2(in); - break; - case 3: // ADST_ADST - iadst8_sse2(in); - iadst8_sse2(in); - break; - default: - assert(0); - break; - } - - // Final rounding and shift - in[0] = _mm_adds_epi16(in[0], final_rounding); - in[1] = _mm_adds_epi16(in[1], final_rounding); - in[2] = _mm_adds_epi16(in[2], final_rounding); - in[3] = _mm_adds_epi16(in[3], final_rounding); - in[4] = _mm_adds_epi16(in[4], final_rounding); - in[5] = _mm_adds_epi16(in[5], final_rounding); - in[6] = _mm_adds_epi16(in[6], final_rounding); - in[7] = _mm_adds_epi16(in[7], final_rounding); - - in[0] = _mm_srai_epi16(in[0], 5); - in[1] = _mm_srai_epi16(in[1], 5); - in[2] = _mm_srai_epi16(in[2], 5); - in[3] = _mm_srai_epi16(in[3], 5); - in[4] = _mm_srai_epi16(in[4], 5); - in[5] = _mm_srai_epi16(in[5], 5); - in[6] = _mm_srai_epi16(in[6], 5); - in[7] = _mm_srai_epi16(in[7], 5); - - RECON_AND_STORE(dest, in[0]); - RECON_AND_STORE(dest, in[1]); - RECON_AND_STORE(dest, in[2]); - RECON_AND_STORE(dest, in[3]); - RECON_AND_STORE(dest, in[4]); - RECON_AND_STORE(dest, in[5]); - RECON_AND_STORE(dest, in[6]); - RECON_AND_STORE(dest, in[7]); -} - -void vp9_idct8x8_12_add_sse2(const int16_t *input, uint8_t *dest, int stride) { - const __m128i zero = _mm_setzero_si128(); - const __m128i rounding = _mm_set1_epi32(DCT_CONST_ROUNDING); - const __m128i final_rounding = _mm_set1_epi16(1<<4); - const __m128i stg1_0 = pair_set_epi16(cospi_28_64, -cospi_4_64); - const __m128i stg1_1 = pair_set_epi16(cospi_4_64, cospi_28_64); - const __m128i stg1_2 = pair_set_epi16(-cospi_20_64, cospi_12_64); - const __m128i stg1_3 = pair_set_epi16(cospi_12_64, cospi_20_64); - const __m128i stg2_0 = pair_set_epi16(cospi_16_64, cospi_16_64); - const __m128i stg2_1 = pair_set_epi16(cospi_16_64, -cospi_16_64); - const __m128i stg2_2 = pair_set_epi16(cospi_24_64, -cospi_8_64); - const __m128i stg2_3 = pair_set_epi16(cospi_8_64, cospi_24_64); - const __m128i stg3_0 = pair_set_epi16(-cospi_16_64, cospi_16_64); - - __m128i in0, in1, in2, in3, in4, in5, in6, in7; - __m128i stp1_0, stp1_1, stp1_2, stp1_3, stp1_4, stp1_5, stp1_6, stp1_7; - __m128i stp2_0, stp2_1, stp2_2, stp2_3, stp2_4, stp2_5, stp2_6, stp2_7; - __m128i tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - - // Rows. Load 4-row input data. - in0 = _mm_load_si128((const __m128i *)input); - in1 = _mm_load_si128((const __m128i *)(input + 8 * 1)); - in2 = _mm_load_si128((const __m128i *)(input + 8 * 2)); - in3 = _mm_load_si128((const __m128i *)(input + 8 * 3)); - - // 8x4 Transpose - TRANSPOSE_8X8_10(in0, in1, in2, in3, in0, in1); - // Stage1 - { //NOLINT - const __m128i lo_17 = _mm_unpackhi_epi16(in0, zero); - const __m128i lo_35 = _mm_unpackhi_epi16(in1, zero); - - tmp0 = _mm_madd_epi16(lo_17, stg1_0); - tmp2 = _mm_madd_epi16(lo_17, stg1_1); - tmp4 = _mm_madd_epi16(lo_35, stg1_2); - tmp6 = _mm_madd_epi16(lo_35, stg1_3); - - tmp0 = _mm_add_epi32(tmp0, rounding); - tmp2 = _mm_add_epi32(tmp2, rounding); - tmp4 = _mm_add_epi32(tmp4, rounding); - tmp6 = _mm_add_epi32(tmp6, rounding); - tmp0 = _mm_srai_epi32(tmp0, DCT_CONST_BITS); - tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS); - tmp4 = _mm_srai_epi32(tmp4, DCT_CONST_BITS); - tmp6 = _mm_srai_epi32(tmp6, DCT_CONST_BITS); - - stp1_4 = _mm_packs_epi32(tmp0, tmp2); - stp1_5 = _mm_packs_epi32(tmp4, tmp6); - } - - // Stage2 - { //NOLINT - const __m128i lo_04 = _mm_unpacklo_epi16(in0, zero); - const __m128i lo_26 = _mm_unpacklo_epi16(in1, zero); - - tmp0 = _mm_madd_epi16(lo_04, stg2_0); - tmp2 = _mm_madd_epi16(lo_04, stg2_1); - tmp4 = _mm_madd_epi16(lo_26, stg2_2); - tmp6 = _mm_madd_epi16(lo_26, stg2_3); - - tmp0 = _mm_add_epi32(tmp0, rounding); - tmp2 = _mm_add_epi32(tmp2, rounding); - tmp4 = _mm_add_epi32(tmp4, rounding); - tmp6 = _mm_add_epi32(tmp6, rounding); - tmp0 = _mm_srai_epi32(tmp0, DCT_CONST_BITS); - tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS); - tmp4 = _mm_srai_epi32(tmp4, DCT_CONST_BITS); - tmp6 = _mm_srai_epi32(tmp6, DCT_CONST_BITS); - - stp2_0 = _mm_packs_epi32(tmp0, tmp2); - stp2_2 = _mm_packs_epi32(tmp6, tmp4); - - tmp0 = _mm_adds_epi16(stp1_4, stp1_5); - tmp1 = _mm_subs_epi16(stp1_4, stp1_5); - - stp2_4 = tmp0; - stp2_5 = _mm_unpacklo_epi64(tmp1, zero); - stp2_6 = _mm_unpackhi_epi64(tmp1, zero); - } - - // Stage3 - { //NOLINT - const __m128i lo_56 = _mm_unpacklo_epi16(stp2_5, stp2_6); - - tmp4 = _mm_adds_epi16(stp2_0, stp2_2); - tmp6 = _mm_subs_epi16(stp2_0, stp2_2); - - stp1_2 = _mm_unpackhi_epi64(tmp6, tmp4); - stp1_3 = _mm_unpacklo_epi64(tmp6, tmp4); - - tmp0 = _mm_madd_epi16(lo_56, stg3_0); - tmp2 = _mm_madd_epi16(lo_56, stg2_0); // stg3_1 = stg2_0 - - tmp0 = _mm_add_epi32(tmp0, rounding); - tmp2 = _mm_add_epi32(tmp2, rounding); - tmp0 = _mm_srai_epi32(tmp0, DCT_CONST_BITS); - tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS); - - stp1_5 = _mm_packs_epi32(tmp0, tmp2); - } - - // Stage4 - tmp0 = _mm_adds_epi16(stp1_3, stp2_4); - tmp1 = _mm_adds_epi16(stp1_2, stp1_5); - tmp2 = _mm_subs_epi16(stp1_3, stp2_4); - tmp3 = _mm_subs_epi16(stp1_2, stp1_5); - - TRANSPOSE_4X8_10(tmp0, tmp1, tmp2, tmp3, in0, in1, in2, in3) - - IDCT8(in0, in1, in2, in3, zero, zero, zero, zero, - in0, in1, in2, in3, in4, in5, in6, in7); - // Final rounding and shift - in0 = _mm_adds_epi16(in0, final_rounding); - in1 = _mm_adds_epi16(in1, final_rounding); - in2 = _mm_adds_epi16(in2, final_rounding); - in3 = _mm_adds_epi16(in3, final_rounding); - in4 = _mm_adds_epi16(in4, final_rounding); - in5 = _mm_adds_epi16(in5, final_rounding); - in6 = _mm_adds_epi16(in6, final_rounding); - in7 = _mm_adds_epi16(in7, final_rounding); - - in0 = _mm_srai_epi16(in0, 5); - in1 = _mm_srai_epi16(in1, 5); - in2 = _mm_srai_epi16(in2, 5); - in3 = _mm_srai_epi16(in3, 5); - in4 = _mm_srai_epi16(in4, 5); - in5 = _mm_srai_epi16(in5, 5); - in6 = _mm_srai_epi16(in6, 5); - in7 = _mm_srai_epi16(in7, 5); - - RECON_AND_STORE(dest, in0); - RECON_AND_STORE(dest, in1); - RECON_AND_STORE(dest, in2); - RECON_AND_STORE(dest, in3); - RECON_AND_STORE(dest, in4); - RECON_AND_STORE(dest, in5); - RECON_AND_STORE(dest, in6); - RECON_AND_STORE(dest, in7); -} - -#define IDCT16 \ - /* Stage2 */ \ - { \ - const __m128i lo_1_15 = _mm_unpacklo_epi16(in[1], in[15]); \ - const __m128i hi_1_15 = _mm_unpackhi_epi16(in[1], in[15]); \ - const __m128i lo_9_7 = _mm_unpacklo_epi16(in[9], in[7]); \ - const __m128i hi_9_7 = _mm_unpackhi_epi16(in[9], in[7]); \ - const __m128i lo_5_11 = _mm_unpacklo_epi16(in[5], in[11]); \ - const __m128i hi_5_11 = _mm_unpackhi_epi16(in[5], in[11]); \ - const __m128i lo_13_3 = _mm_unpacklo_epi16(in[13], in[3]); \ - const __m128i hi_13_3 = _mm_unpackhi_epi16(in[13], in[3]); \ - \ - MULTIPLICATION_AND_ADD(lo_1_15, hi_1_15, lo_9_7, hi_9_7, \ - stg2_0, stg2_1, stg2_2, stg2_3, \ - stp2_8, stp2_15, stp2_9, stp2_14) \ - \ - MULTIPLICATION_AND_ADD(lo_5_11, hi_5_11, lo_13_3, hi_13_3, \ - stg2_4, stg2_5, stg2_6, stg2_7, \ - stp2_10, stp2_13, stp2_11, stp2_12) \ - } \ - \ - /* Stage3 */ \ - { \ - const __m128i lo_2_14 = _mm_unpacklo_epi16(in[2], in[14]); \ - const __m128i hi_2_14 = _mm_unpackhi_epi16(in[2], in[14]); \ - const __m128i lo_10_6 = _mm_unpacklo_epi16(in[10], in[6]); \ - const __m128i hi_10_6 = _mm_unpackhi_epi16(in[10], in[6]); \ - \ - MULTIPLICATION_AND_ADD(lo_2_14, hi_2_14, lo_10_6, hi_10_6, \ - stg3_0, stg3_1, stg3_2, stg3_3, \ - stp1_4, stp1_7, stp1_5, stp1_6) \ - \ - stp1_8_0 = _mm_add_epi16(stp2_8, stp2_9); \ - stp1_9 = _mm_sub_epi16(stp2_8, stp2_9); \ - stp1_10 = _mm_sub_epi16(stp2_11, stp2_10); \ - stp1_11 = _mm_add_epi16(stp2_11, stp2_10); \ - \ - stp1_12_0 = _mm_add_epi16(stp2_12, stp2_13); \ - stp1_13 = _mm_sub_epi16(stp2_12, stp2_13); \ - stp1_14 = _mm_sub_epi16(stp2_15, stp2_14); \ - stp1_15 = _mm_add_epi16(stp2_15, stp2_14); \ - } \ - \ - /* Stage4 */ \ - { \ - const __m128i lo_0_8 = _mm_unpacklo_epi16(in[0], in[8]); \ - const __m128i hi_0_8 = _mm_unpackhi_epi16(in[0], in[8]); \ - const __m128i lo_4_12 = _mm_unpacklo_epi16(in[4], in[12]); \ - const __m128i hi_4_12 = _mm_unpackhi_epi16(in[4], in[12]); \ - \ - const __m128i lo_9_14 = _mm_unpacklo_epi16(stp1_9, stp1_14); \ - const __m128i hi_9_14 = _mm_unpackhi_epi16(stp1_9, stp1_14); \ - const __m128i lo_10_13 = _mm_unpacklo_epi16(stp1_10, stp1_13); \ - const __m128i hi_10_13 = _mm_unpackhi_epi16(stp1_10, stp1_13); \ - \ - MULTIPLICATION_AND_ADD(lo_0_8, hi_0_8, lo_4_12, hi_4_12, \ - stg4_0, stg4_1, stg4_2, stg4_3, \ - stp2_0, stp2_1, stp2_2, stp2_3) \ - \ - stp2_4 = _mm_add_epi16(stp1_4, stp1_5); \ - stp2_5 = _mm_sub_epi16(stp1_4, stp1_5); \ - stp2_6 = _mm_sub_epi16(stp1_7, stp1_6); \ - stp2_7 = _mm_add_epi16(stp1_7, stp1_6); \ - \ - MULTIPLICATION_AND_ADD(lo_9_14, hi_9_14, lo_10_13, hi_10_13, \ - stg4_4, stg4_5, stg4_6, stg4_7, \ - stp2_9, stp2_14, stp2_10, stp2_13) \ - } \ - \ - /* Stage5 */ \ - { \ - const __m128i lo_6_5 = _mm_unpacklo_epi16(stp2_6, stp2_5); \ - const __m128i hi_6_5 = _mm_unpackhi_epi16(stp2_6, stp2_5); \ - \ - stp1_0 = _mm_add_epi16(stp2_0, stp2_3); \ - stp1_1 = _mm_add_epi16(stp2_1, stp2_2); \ - stp1_2 = _mm_sub_epi16(stp2_1, stp2_2); \ - stp1_3 = _mm_sub_epi16(stp2_0, stp2_3); \ - \ - tmp0 = _mm_madd_epi16(lo_6_5, stg4_1); \ - tmp1 = _mm_madd_epi16(hi_6_5, stg4_1); \ - tmp2 = _mm_madd_epi16(lo_6_5, stg4_0); \ - tmp3 = _mm_madd_epi16(hi_6_5, stg4_0); \ - \ - tmp0 = _mm_add_epi32(tmp0, rounding); \ - tmp1 = _mm_add_epi32(tmp1, rounding); \ - tmp2 = _mm_add_epi32(tmp2, rounding); \ - tmp3 = _mm_add_epi32(tmp3, rounding); \ - \ - tmp0 = _mm_srai_epi32(tmp0, DCT_CONST_BITS); \ - tmp1 = _mm_srai_epi32(tmp1, DCT_CONST_BITS); \ - tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS); \ - tmp3 = _mm_srai_epi32(tmp3, DCT_CONST_BITS); \ - \ - stp1_5 = _mm_packs_epi32(tmp0, tmp1); \ - stp1_6 = _mm_packs_epi32(tmp2, tmp3); \ - \ - stp1_8 = _mm_add_epi16(stp1_8_0, stp1_11); \ - stp1_9 = _mm_add_epi16(stp2_9, stp2_10); \ - stp1_10 = _mm_sub_epi16(stp2_9, stp2_10); \ - stp1_11 = _mm_sub_epi16(stp1_8_0, stp1_11); \ - \ - stp1_12 = _mm_sub_epi16(stp1_15, stp1_12_0); \ - stp1_13 = _mm_sub_epi16(stp2_14, stp2_13); \ - stp1_14 = _mm_add_epi16(stp2_14, stp2_13); \ - stp1_15 = _mm_add_epi16(stp1_15, stp1_12_0); \ - } \ - \ - /* Stage6 */ \ - { \ - const __m128i lo_10_13 = _mm_unpacklo_epi16(stp1_10, stp1_13); \ - const __m128i hi_10_13 = _mm_unpackhi_epi16(stp1_10, stp1_13); \ - const __m128i lo_11_12 = _mm_unpacklo_epi16(stp1_11, stp1_12); \ - const __m128i hi_11_12 = _mm_unpackhi_epi16(stp1_11, stp1_12); \ - \ - stp2_0 = _mm_add_epi16(stp1_0, stp2_7); \ - stp2_1 = _mm_add_epi16(stp1_1, stp1_6); \ - stp2_2 = _mm_add_epi16(stp1_2, stp1_5); \ - stp2_3 = _mm_add_epi16(stp1_3, stp2_4); \ - stp2_4 = _mm_sub_epi16(stp1_3, stp2_4); \ - stp2_5 = _mm_sub_epi16(stp1_2, stp1_5); \ - stp2_6 = _mm_sub_epi16(stp1_1, stp1_6); \ - stp2_7 = _mm_sub_epi16(stp1_0, stp2_7); \ - \ - MULTIPLICATION_AND_ADD(lo_10_13, hi_10_13, lo_11_12, hi_11_12, \ - stg6_0, stg4_0, stg6_0, stg4_0, \ - stp2_10, stp2_13, stp2_11, stp2_12) \ - } - -#define IDCT16_10 \ - /* Stage2 */ \ - { \ - const __m128i lo_1_15 = _mm_unpacklo_epi16(in[1], zero); \ - const __m128i hi_1_15 = _mm_unpackhi_epi16(in[1], zero); \ - const __m128i lo_13_3 = _mm_unpacklo_epi16(zero, in[3]); \ - const __m128i hi_13_3 = _mm_unpackhi_epi16(zero, in[3]); \ - \ - MULTIPLICATION_AND_ADD(lo_1_15, hi_1_15, lo_13_3, hi_13_3, \ - stg2_0, stg2_1, stg2_6, stg2_7, \ - stp1_8_0, stp1_15, stp1_11, stp1_12_0) \ - } \ - \ - /* Stage3 */ \ - { \ - const __m128i lo_2_14 = _mm_unpacklo_epi16(in[2], zero); \ - const __m128i hi_2_14 = _mm_unpackhi_epi16(in[2], zero); \ - \ - MULTIPLICATION_AND_ADD_2(lo_2_14, hi_2_14, \ - stg3_0, stg3_1, \ - stp2_4, stp2_7) \ - \ - stp1_9 = stp1_8_0; \ - stp1_10 = stp1_11; \ - \ - stp1_13 = stp1_12_0; \ - stp1_14 = stp1_15; \ - } \ - \ - /* Stage4 */ \ - { \ - const __m128i lo_0_8 = _mm_unpacklo_epi16(in[0], zero); \ - const __m128i hi_0_8 = _mm_unpackhi_epi16(in[0], zero); \ - \ - const __m128i lo_9_14 = _mm_unpacklo_epi16(stp1_9, stp1_14); \ - const __m128i hi_9_14 = _mm_unpackhi_epi16(stp1_9, stp1_14); \ - const __m128i lo_10_13 = _mm_unpacklo_epi16(stp1_10, stp1_13); \ - const __m128i hi_10_13 = _mm_unpackhi_epi16(stp1_10, stp1_13); \ - \ - MULTIPLICATION_AND_ADD_2(lo_0_8, hi_0_8, \ - stg4_0, stg4_1, \ - stp1_0, stp1_1) \ - stp2_5 = stp2_4; \ - stp2_6 = stp2_7; \ - \ - MULTIPLICATION_AND_ADD(lo_9_14, hi_9_14, lo_10_13, hi_10_13, \ - stg4_4, stg4_5, stg4_6, stg4_7, \ - stp2_9, stp2_14, stp2_10, stp2_13) \ - } \ - \ - /* Stage5 */ \ - { \ - const __m128i lo_6_5 = _mm_unpacklo_epi16(stp2_6, stp2_5); \ - const __m128i hi_6_5 = _mm_unpackhi_epi16(stp2_6, stp2_5); \ - \ - stp1_2 = stp1_1; \ - stp1_3 = stp1_0; \ - \ - tmp0 = _mm_madd_epi16(lo_6_5, stg4_1); \ - tmp1 = _mm_madd_epi16(hi_6_5, stg4_1); \ - tmp2 = _mm_madd_epi16(lo_6_5, stg4_0); \ - tmp3 = _mm_madd_epi16(hi_6_5, stg4_0); \ - \ - tmp0 = _mm_add_epi32(tmp0, rounding); \ - tmp1 = _mm_add_epi32(tmp1, rounding); \ - tmp2 = _mm_add_epi32(tmp2, rounding); \ - tmp3 = _mm_add_epi32(tmp3, rounding); \ - \ - tmp0 = _mm_srai_epi32(tmp0, DCT_CONST_BITS); \ - tmp1 = _mm_srai_epi32(tmp1, DCT_CONST_BITS); \ - tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS); \ - tmp3 = _mm_srai_epi32(tmp3, DCT_CONST_BITS); \ - \ - stp1_5 = _mm_packs_epi32(tmp0, tmp1); \ - stp1_6 = _mm_packs_epi32(tmp2, tmp3); \ - \ - stp1_8 = _mm_add_epi16(stp1_8_0, stp1_11); \ - stp1_9 = _mm_add_epi16(stp2_9, stp2_10); \ - stp1_10 = _mm_sub_epi16(stp2_9, stp2_10); \ - stp1_11 = _mm_sub_epi16(stp1_8_0, stp1_11); \ - \ - stp1_12 = _mm_sub_epi16(stp1_15, stp1_12_0); \ - stp1_13 = _mm_sub_epi16(stp2_14, stp2_13); \ - stp1_14 = _mm_add_epi16(stp2_14, stp2_13); \ - stp1_15 = _mm_add_epi16(stp1_15, stp1_12_0); \ - } \ - \ - /* Stage6 */ \ - { \ - const __m128i lo_10_13 = _mm_unpacklo_epi16(stp1_10, stp1_13); \ - const __m128i hi_10_13 = _mm_unpackhi_epi16(stp1_10, stp1_13); \ - const __m128i lo_11_12 = _mm_unpacklo_epi16(stp1_11, stp1_12); \ - const __m128i hi_11_12 = _mm_unpackhi_epi16(stp1_11, stp1_12); \ - \ - stp2_0 = _mm_add_epi16(stp1_0, stp2_7); \ - stp2_1 = _mm_add_epi16(stp1_1, stp1_6); \ - stp2_2 = _mm_add_epi16(stp1_2, stp1_5); \ - stp2_3 = _mm_add_epi16(stp1_3, stp2_4); \ - stp2_4 = _mm_sub_epi16(stp1_3, stp2_4); \ - stp2_5 = _mm_sub_epi16(stp1_2, stp1_5); \ - stp2_6 = _mm_sub_epi16(stp1_1, stp1_6); \ - stp2_7 = _mm_sub_epi16(stp1_0, stp2_7); \ - \ - MULTIPLICATION_AND_ADD(lo_10_13, hi_10_13, lo_11_12, hi_11_12, \ - stg6_0, stg4_0, stg6_0, stg4_0, \ - stp2_10, stp2_13, stp2_11, stp2_12) \ - } - -void vp9_idct16x16_256_add_sse2(const int16_t *input, uint8_t *dest, - int stride) { - const __m128i rounding = _mm_set1_epi32(DCT_CONST_ROUNDING); - const __m128i final_rounding = _mm_set1_epi16(1<<5); - const __m128i zero = _mm_setzero_si128(); - - const __m128i stg2_0 = pair_set_epi16(cospi_30_64, -cospi_2_64); - const __m128i stg2_1 = pair_set_epi16(cospi_2_64, cospi_30_64); - const __m128i stg2_2 = pair_set_epi16(cospi_14_64, -cospi_18_64); - const __m128i stg2_3 = pair_set_epi16(cospi_18_64, cospi_14_64); - const __m128i stg2_4 = pair_set_epi16(cospi_22_64, -cospi_10_64); - const __m128i stg2_5 = pair_set_epi16(cospi_10_64, cospi_22_64); - const __m128i stg2_6 = pair_set_epi16(cospi_6_64, -cospi_26_64); - const __m128i stg2_7 = pair_set_epi16(cospi_26_64, cospi_6_64); - - const __m128i stg3_0 = pair_set_epi16(cospi_28_64, -cospi_4_64); - const __m128i stg3_1 = pair_set_epi16(cospi_4_64, cospi_28_64); - const __m128i stg3_2 = pair_set_epi16(cospi_12_64, -cospi_20_64); - const __m128i stg3_3 = pair_set_epi16(cospi_20_64, cospi_12_64); - - const __m128i stg4_0 = pair_set_epi16(cospi_16_64, cospi_16_64); - const __m128i stg4_1 = pair_set_epi16(cospi_16_64, -cospi_16_64); - const __m128i stg4_2 = pair_set_epi16(cospi_24_64, -cospi_8_64); - const __m128i stg4_3 = pair_set_epi16(cospi_8_64, cospi_24_64); - const __m128i stg4_4 = pair_set_epi16(-cospi_8_64, cospi_24_64); - const __m128i stg4_5 = pair_set_epi16(cospi_24_64, cospi_8_64); - const __m128i stg4_6 = pair_set_epi16(-cospi_24_64, -cospi_8_64); - const __m128i stg4_7 = pair_set_epi16(-cospi_8_64, cospi_24_64); - - const __m128i stg6_0 = pair_set_epi16(-cospi_16_64, cospi_16_64); - - __m128i in[16], l[16], r[16], *curr1; - __m128i stp1_0, stp1_1, stp1_2, stp1_3, stp1_4, stp1_5, stp1_6, stp1_7, - stp1_8, stp1_9, stp1_10, stp1_11, stp1_12, stp1_13, stp1_14, stp1_15, - stp1_8_0, stp1_12_0; - __m128i stp2_0, stp2_1, stp2_2, stp2_3, stp2_4, stp2_5, stp2_6, stp2_7, - stp2_8, stp2_9, stp2_10, stp2_11, stp2_12, stp2_13, stp2_14, stp2_15; - __m128i tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - int i; - - curr1 = l; - for (i = 0; i < 2; i++) { - // 1-D idct - - // Load input data. - in[0] = _mm_load_si128((const __m128i *)input); - in[8] = _mm_load_si128((const __m128i *)(input + 8 * 1)); - in[1] = _mm_load_si128((const __m128i *)(input + 8 * 2)); - in[9] = _mm_load_si128((const __m128i *)(input + 8 * 3)); - in[2] = _mm_load_si128((const __m128i *)(input + 8 * 4)); - in[10] = _mm_load_si128((const __m128i *)(input + 8 * 5)); - in[3] = _mm_load_si128((const __m128i *)(input + 8 * 6)); - in[11] = _mm_load_si128((const __m128i *)(input + 8 * 7)); - in[4] = _mm_load_si128((const __m128i *)(input + 8 * 8)); - in[12] = _mm_load_si128((const __m128i *)(input + 8 * 9)); - in[5] = _mm_load_si128((const __m128i *)(input + 8 * 10)); - in[13] = _mm_load_si128((const __m128i *)(input + 8 * 11)); - in[6] = _mm_load_si128((const __m128i *)(input + 8 * 12)); - in[14] = _mm_load_si128((const __m128i *)(input + 8 * 13)); - in[7] = _mm_load_si128((const __m128i *)(input + 8 * 14)); - in[15] = _mm_load_si128((const __m128i *)(input + 8 * 15)); - - array_transpose_8x8(in, in); - array_transpose_8x8(in+8, in+8); - - IDCT16 - - // Stage7 - curr1[0] = _mm_add_epi16(stp2_0, stp1_15); - curr1[1] = _mm_add_epi16(stp2_1, stp1_14); - curr1[2] = _mm_add_epi16(stp2_2, stp2_13); - curr1[3] = _mm_add_epi16(stp2_3, stp2_12); - curr1[4] = _mm_add_epi16(stp2_4, stp2_11); - curr1[5] = _mm_add_epi16(stp2_5, stp2_10); - curr1[6] = _mm_add_epi16(stp2_6, stp1_9); - curr1[7] = _mm_add_epi16(stp2_7, stp1_8); - curr1[8] = _mm_sub_epi16(stp2_7, stp1_8); - curr1[9] = _mm_sub_epi16(stp2_6, stp1_9); - curr1[10] = _mm_sub_epi16(stp2_5, stp2_10); - curr1[11] = _mm_sub_epi16(stp2_4, stp2_11); - curr1[12] = _mm_sub_epi16(stp2_3, stp2_12); - curr1[13] = _mm_sub_epi16(stp2_2, stp2_13); - curr1[14] = _mm_sub_epi16(stp2_1, stp1_14); - curr1[15] = _mm_sub_epi16(stp2_0, stp1_15); - - curr1 = r; - input += 128; - } - for (i = 0; i < 2; i++) { - // 1-D idct - array_transpose_8x8(l+i*8, in); - array_transpose_8x8(r+i*8, in+8); - - IDCT16 - - // 2-D - in[0] = _mm_add_epi16(stp2_0, stp1_15); - in[1] = _mm_add_epi16(stp2_1, stp1_14); - in[2] = _mm_add_epi16(stp2_2, stp2_13); - in[3] = _mm_add_epi16(stp2_3, stp2_12); - in[4] = _mm_add_epi16(stp2_4, stp2_11); - in[5] = _mm_add_epi16(stp2_5, stp2_10); - in[6] = _mm_add_epi16(stp2_6, stp1_9); - in[7] = _mm_add_epi16(stp2_7, stp1_8); - in[8] = _mm_sub_epi16(stp2_7, stp1_8); - in[9] = _mm_sub_epi16(stp2_6, stp1_9); - in[10] = _mm_sub_epi16(stp2_5, stp2_10); - in[11] = _mm_sub_epi16(stp2_4, stp2_11); - in[12] = _mm_sub_epi16(stp2_3, stp2_12); - in[13] = _mm_sub_epi16(stp2_2, stp2_13); - in[14] = _mm_sub_epi16(stp2_1, stp1_14); - in[15] = _mm_sub_epi16(stp2_0, stp1_15); - - // Final rounding and shift - in[0] = _mm_adds_epi16(in[0], final_rounding); - in[1] = _mm_adds_epi16(in[1], final_rounding); - in[2] = _mm_adds_epi16(in[2], final_rounding); - in[3] = _mm_adds_epi16(in[3], final_rounding); - in[4] = _mm_adds_epi16(in[4], final_rounding); - in[5] = _mm_adds_epi16(in[5], final_rounding); - in[6] = _mm_adds_epi16(in[6], final_rounding); - in[7] = _mm_adds_epi16(in[7], final_rounding); - in[8] = _mm_adds_epi16(in[8], final_rounding); - in[9] = _mm_adds_epi16(in[9], final_rounding); - in[10] = _mm_adds_epi16(in[10], final_rounding); - in[11] = _mm_adds_epi16(in[11], final_rounding); - in[12] = _mm_adds_epi16(in[12], final_rounding); - in[13] = _mm_adds_epi16(in[13], final_rounding); - in[14] = _mm_adds_epi16(in[14], final_rounding); - in[15] = _mm_adds_epi16(in[15], final_rounding); - - in[0] = _mm_srai_epi16(in[0], 6); - in[1] = _mm_srai_epi16(in[1], 6); - in[2] = _mm_srai_epi16(in[2], 6); - in[3] = _mm_srai_epi16(in[3], 6); - in[4] = _mm_srai_epi16(in[4], 6); - in[5] = _mm_srai_epi16(in[5], 6); - in[6] = _mm_srai_epi16(in[6], 6); - in[7] = _mm_srai_epi16(in[7], 6); - in[8] = _mm_srai_epi16(in[8], 6); - in[9] = _mm_srai_epi16(in[9], 6); - in[10] = _mm_srai_epi16(in[10], 6); - in[11] = _mm_srai_epi16(in[11], 6); - in[12] = _mm_srai_epi16(in[12], 6); - in[13] = _mm_srai_epi16(in[13], 6); - in[14] = _mm_srai_epi16(in[14], 6); - in[15] = _mm_srai_epi16(in[15], 6); - - RECON_AND_STORE(dest, in[0]); - RECON_AND_STORE(dest, in[1]); - RECON_AND_STORE(dest, in[2]); - RECON_AND_STORE(dest, in[3]); - RECON_AND_STORE(dest, in[4]); - RECON_AND_STORE(dest, in[5]); - RECON_AND_STORE(dest, in[6]); - RECON_AND_STORE(dest, in[7]); - RECON_AND_STORE(dest, in[8]); - RECON_AND_STORE(dest, in[9]); - RECON_AND_STORE(dest, in[10]); - RECON_AND_STORE(dest, in[11]); - RECON_AND_STORE(dest, in[12]); - RECON_AND_STORE(dest, in[13]); - RECON_AND_STORE(dest, in[14]); - RECON_AND_STORE(dest, in[15]); - - dest += 8 - (stride * 16); - } -} - -void vp9_idct16x16_1_add_sse2(const int16_t *input, uint8_t *dest, int stride) { - __m128i dc_value; - const __m128i zero = _mm_setzero_si128(); - int a, i; - - a = dct_const_round_shift(input[0] * cospi_16_64); - a = dct_const_round_shift(a * cospi_16_64); - a = ROUND_POWER_OF_TWO(a, 6); - - dc_value = _mm_set1_epi16(a); - - for (i = 0; i < 2; ++i) { - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - dest += 8 - (stride * 16); - } -} - -static void iadst16_8col(__m128i *in) { - // perform 16x16 1-D ADST for 8 columns - __m128i s[16], x[16], u[32], v[32]; - const __m128i k__cospi_p01_p31 = pair_set_epi16(cospi_1_64, cospi_31_64); - const __m128i k__cospi_p31_m01 = pair_set_epi16(cospi_31_64, -cospi_1_64); - const __m128i k__cospi_p05_p27 = pair_set_epi16(cospi_5_64, cospi_27_64); - const __m128i k__cospi_p27_m05 = pair_set_epi16(cospi_27_64, -cospi_5_64); - const __m128i k__cospi_p09_p23 = pair_set_epi16(cospi_9_64, cospi_23_64); - const __m128i k__cospi_p23_m09 = pair_set_epi16(cospi_23_64, -cospi_9_64); - const __m128i k__cospi_p13_p19 = pair_set_epi16(cospi_13_64, cospi_19_64); - const __m128i k__cospi_p19_m13 = pair_set_epi16(cospi_19_64, -cospi_13_64); - const __m128i k__cospi_p17_p15 = pair_set_epi16(cospi_17_64, cospi_15_64); - const __m128i k__cospi_p15_m17 = pair_set_epi16(cospi_15_64, -cospi_17_64); - const __m128i k__cospi_p21_p11 = pair_set_epi16(cospi_21_64, cospi_11_64); - const __m128i k__cospi_p11_m21 = pair_set_epi16(cospi_11_64, -cospi_21_64); - const __m128i k__cospi_p25_p07 = pair_set_epi16(cospi_25_64, cospi_7_64); - const __m128i k__cospi_p07_m25 = pair_set_epi16(cospi_7_64, -cospi_25_64); - const __m128i k__cospi_p29_p03 = pair_set_epi16(cospi_29_64, cospi_3_64); - const __m128i k__cospi_p03_m29 = pair_set_epi16(cospi_3_64, -cospi_29_64); - const __m128i k__cospi_p04_p28 = pair_set_epi16(cospi_4_64, cospi_28_64); - const __m128i k__cospi_p28_m04 = pair_set_epi16(cospi_28_64, -cospi_4_64); - const __m128i k__cospi_p20_p12 = pair_set_epi16(cospi_20_64, cospi_12_64); - const __m128i k__cospi_p12_m20 = pair_set_epi16(cospi_12_64, -cospi_20_64); - const __m128i k__cospi_m28_p04 = pair_set_epi16(-cospi_28_64, cospi_4_64); - const __m128i k__cospi_m12_p20 = pair_set_epi16(-cospi_12_64, cospi_20_64); - const __m128i k__cospi_p08_p24 = pair_set_epi16(cospi_8_64, cospi_24_64); - const __m128i k__cospi_p24_m08 = pair_set_epi16(cospi_24_64, -cospi_8_64); - const __m128i k__cospi_m24_p08 = pair_set_epi16(-cospi_24_64, cospi_8_64); - const __m128i k__cospi_m16_m16 = _mm_set1_epi16((int16_t)-cospi_16_64); - const __m128i k__cospi_p16_p16 = _mm_set1_epi16((int16_t)cospi_16_64); - const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64); - const __m128i k__cospi_m16_p16 = pair_set_epi16(-cospi_16_64, cospi_16_64); - const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING); - const __m128i kZero = _mm_set1_epi16(0); - - u[0] = _mm_unpacklo_epi16(in[15], in[0]); - u[1] = _mm_unpackhi_epi16(in[15], in[0]); - u[2] = _mm_unpacklo_epi16(in[13], in[2]); - u[3] = _mm_unpackhi_epi16(in[13], in[2]); - u[4] = _mm_unpacklo_epi16(in[11], in[4]); - u[5] = _mm_unpackhi_epi16(in[11], in[4]); - u[6] = _mm_unpacklo_epi16(in[9], in[6]); - u[7] = _mm_unpackhi_epi16(in[9], in[6]); - u[8] = _mm_unpacklo_epi16(in[7], in[8]); - u[9] = _mm_unpackhi_epi16(in[7], in[8]); - u[10] = _mm_unpacklo_epi16(in[5], in[10]); - u[11] = _mm_unpackhi_epi16(in[5], in[10]); - u[12] = _mm_unpacklo_epi16(in[3], in[12]); - u[13] = _mm_unpackhi_epi16(in[3], in[12]); - u[14] = _mm_unpacklo_epi16(in[1], in[14]); - u[15] = _mm_unpackhi_epi16(in[1], in[14]); - - v[0] = _mm_madd_epi16(u[0], k__cospi_p01_p31); - v[1] = _mm_madd_epi16(u[1], k__cospi_p01_p31); - v[2] = _mm_madd_epi16(u[0], k__cospi_p31_m01); - v[3] = _mm_madd_epi16(u[1], k__cospi_p31_m01); - v[4] = _mm_madd_epi16(u[2], k__cospi_p05_p27); - v[5] = _mm_madd_epi16(u[3], k__cospi_p05_p27); - v[6] = _mm_madd_epi16(u[2], k__cospi_p27_m05); - v[7] = _mm_madd_epi16(u[3], k__cospi_p27_m05); - v[8] = _mm_madd_epi16(u[4], k__cospi_p09_p23); - v[9] = _mm_madd_epi16(u[5], k__cospi_p09_p23); - v[10] = _mm_madd_epi16(u[4], k__cospi_p23_m09); - v[11] = _mm_madd_epi16(u[5], k__cospi_p23_m09); - v[12] = _mm_madd_epi16(u[6], k__cospi_p13_p19); - v[13] = _mm_madd_epi16(u[7], k__cospi_p13_p19); - v[14] = _mm_madd_epi16(u[6], k__cospi_p19_m13); - v[15] = _mm_madd_epi16(u[7], k__cospi_p19_m13); - v[16] = _mm_madd_epi16(u[8], k__cospi_p17_p15); - v[17] = _mm_madd_epi16(u[9], k__cospi_p17_p15); - v[18] = _mm_madd_epi16(u[8], k__cospi_p15_m17); - v[19] = _mm_madd_epi16(u[9], k__cospi_p15_m17); - v[20] = _mm_madd_epi16(u[10], k__cospi_p21_p11); - v[21] = _mm_madd_epi16(u[11], k__cospi_p21_p11); - v[22] = _mm_madd_epi16(u[10], k__cospi_p11_m21); - v[23] = _mm_madd_epi16(u[11], k__cospi_p11_m21); - v[24] = _mm_madd_epi16(u[12], k__cospi_p25_p07); - v[25] = _mm_madd_epi16(u[13], k__cospi_p25_p07); - v[26] = _mm_madd_epi16(u[12], k__cospi_p07_m25); - v[27] = _mm_madd_epi16(u[13], k__cospi_p07_m25); - v[28] = _mm_madd_epi16(u[14], k__cospi_p29_p03); - v[29] = _mm_madd_epi16(u[15], k__cospi_p29_p03); - v[30] = _mm_madd_epi16(u[14], k__cospi_p03_m29); - v[31] = _mm_madd_epi16(u[15], k__cospi_p03_m29); - - u[0] = _mm_add_epi32(v[0], v[16]); - u[1] = _mm_add_epi32(v[1], v[17]); - u[2] = _mm_add_epi32(v[2], v[18]); - u[3] = _mm_add_epi32(v[3], v[19]); - u[4] = _mm_add_epi32(v[4], v[20]); - u[5] = _mm_add_epi32(v[5], v[21]); - u[6] = _mm_add_epi32(v[6], v[22]); - u[7] = _mm_add_epi32(v[7], v[23]); - u[8] = _mm_add_epi32(v[8], v[24]); - u[9] = _mm_add_epi32(v[9], v[25]); - u[10] = _mm_add_epi32(v[10], v[26]); - u[11] = _mm_add_epi32(v[11], v[27]); - u[12] = _mm_add_epi32(v[12], v[28]); - u[13] = _mm_add_epi32(v[13], v[29]); - u[14] = _mm_add_epi32(v[14], v[30]); - u[15] = _mm_add_epi32(v[15], v[31]); - u[16] = _mm_sub_epi32(v[0], v[16]); - u[17] = _mm_sub_epi32(v[1], v[17]); - u[18] = _mm_sub_epi32(v[2], v[18]); - u[19] = _mm_sub_epi32(v[3], v[19]); - u[20] = _mm_sub_epi32(v[4], v[20]); - u[21] = _mm_sub_epi32(v[5], v[21]); - u[22] = _mm_sub_epi32(v[6], v[22]); - u[23] = _mm_sub_epi32(v[7], v[23]); - u[24] = _mm_sub_epi32(v[8], v[24]); - u[25] = _mm_sub_epi32(v[9], v[25]); - u[26] = _mm_sub_epi32(v[10], v[26]); - u[27] = _mm_sub_epi32(v[11], v[27]); - u[28] = _mm_sub_epi32(v[12], v[28]); - u[29] = _mm_sub_epi32(v[13], v[29]); - u[30] = _mm_sub_epi32(v[14], v[30]); - u[31] = _mm_sub_epi32(v[15], v[31]); - - v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING); - v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING); - v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING); - v[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING); - v[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING); - v[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING); - v[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING); - v[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING); - v[8] = _mm_add_epi32(u[8], k__DCT_CONST_ROUNDING); - v[9] = _mm_add_epi32(u[9], k__DCT_CONST_ROUNDING); - v[10] = _mm_add_epi32(u[10], k__DCT_CONST_ROUNDING); - v[11] = _mm_add_epi32(u[11], k__DCT_CONST_ROUNDING); - v[12] = _mm_add_epi32(u[12], k__DCT_CONST_ROUNDING); - v[13] = _mm_add_epi32(u[13], k__DCT_CONST_ROUNDING); - v[14] = _mm_add_epi32(u[14], k__DCT_CONST_ROUNDING); - v[15] = _mm_add_epi32(u[15], k__DCT_CONST_ROUNDING); - v[16] = _mm_add_epi32(u[16], k__DCT_CONST_ROUNDING); - v[17] = _mm_add_epi32(u[17], k__DCT_CONST_ROUNDING); - v[18] = _mm_add_epi32(u[18], k__DCT_CONST_ROUNDING); - v[19] = _mm_add_epi32(u[19], k__DCT_CONST_ROUNDING); - v[20] = _mm_add_epi32(u[20], k__DCT_CONST_ROUNDING); - v[21] = _mm_add_epi32(u[21], k__DCT_CONST_ROUNDING); - v[22] = _mm_add_epi32(u[22], k__DCT_CONST_ROUNDING); - v[23] = _mm_add_epi32(u[23], k__DCT_CONST_ROUNDING); - v[24] = _mm_add_epi32(u[24], k__DCT_CONST_ROUNDING); - v[25] = _mm_add_epi32(u[25], k__DCT_CONST_ROUNDING); - v[26] = _mm_add_epi32(u[26], k__DCT_CONST_ROUNDING); - v[27] = _mm_add_epi32(u[27], k__DCT_CONST_ROUNDING); - v[28] = _mm_add_epi32(u[28], k__DCT_CONST_ROUNDING); - v[29] = _mm_add_epi32(u[29], k__DCT_CONST_ROUNDING); - v[30] = _mm_add_epi32(u[30], k__DCT_CONST_ROUNDING); - v[31] = _mm_add_epi32(u[31], k__DCT_CONST_ROUNDING); - - u[0] = _mm_srai_epi32(v[0], DCT_CONST_BITS); - u[1] = _mm_srai_epi32(v[1], DCT_CONST_BITS); - u[2] = _mm_srai_epi32(v[2], DCT_CONST_BITS); - u[3] = _mm_srai_epi32(v[3], DCT_CONST_BITS); - u[4] = _mm_srai_epi32(v[4], DCT_CONST_BITS); - u[5] = _mm_srai_epi32(v[5], DCT_CONST_BITS); - u[6] = _mm_srai_epi32(v[6], DCT_CONST_BITS); - u[7] = _mm_srai_epi32(v[7], DCT_CONST_BITS); - u[8] = _mm_srai_epi32(v[8], DCT_CONST_BITS); - u[9] = _mm_srai_epi32(v[9], DCT_CONST_BITS); - u[10] = _mm_srai_epi32(v[10], DCT_CONST_BITS); - u[11] = _mm_srai_epi32(v[11], DCT_CONST_BITS); - u[12] = _mm_srai_epi32(v[12], DCT_CONST_BITS); - u[13] = _mm_srai_epi32(v[13], DCT_CONST_BITS); - u[14] = _mm_srai_epi32(v[14], DCT_CONST_BITS); - u[15] = _mm_srai_epi32(v[15], DCT_CONST_BITS); - u[16] = _mm_srai_epi32(v[16], DCT_CONST_BITS); - u[17] = _mm_srai_epi32(v[17], DCT_CONST_BITS); - u[18] = _mm_srai_epi32(v[18], DCT_CONST_BITS); - u[19] = _mm_srai_epi32(v[19], DCT_CONST_BITS); - u[20] = _mm_srai_epi32(v[20], DCT_CONST_BITS); - u[21] = _mm_srai_epi32(v[21], DCT_CONST_BITS); - u[22] = _mm_srai_epi32(v[22], DCT_CONST_BITS); - u[23] = _mm_srai_epi32(v[23], DCT_CONST_BITS); - u[24] = _mm_srai_epi32(v[24], DCT_CONST_BITS); - u[25] = _mm_srai_epi32(v[25], DCT_CONST_BITS); - u[26] = _mm_srai_epi32(v[26], DCT_CONST_BITS); - u[27] = _mm_srai_epi32(v[27], DCT_CONST_BITS); - u[28] = _mm_srai_epi32(v[28], DCT_CONST_BITS); - u[29] = _mm_srai_epi32(v[29], DCT_CONST_BITS); - u[30] = _mm_srai_epi32(v[30], DCT_CONST_BITS); - u[31] = _mm_srai_epi32(v[31], DCT_CONST_BITS); - - s[0] = _mm_packs_epi32(u[0], u[1]); - s[1] = _mm_packs_epi32(u[2], u[3]); - s[2] = _mm_packs_epi32(u[4], u[5]); - s[3] = _mm_packs_epi32(u[6], u[7]); - s[4] = _mm_packs_epi32(u[8], u[9]); - s[5] = _mm_packs_epi32(u[10], u[11]); - s[6] = _mm_packs_epi32(u[12], u[13]); - s[7] = _mm_packs_epi32(u[14], u[15]); - s[8] = _mm_packs_epi32(u[16], u[17]); - s[9] = _mm_packs_epi32(u[18], u[19]); - s[10] = _mm_packs_epi32(u[20], u[21]); - s[11] = _mm_packs_epi32(u[22], u[23]); - s[12] = _mm_packs_epi32(u[24], u[25]); - s[13] = _mm_packs_epi32(u[26], u[27]); - s[14] = _mm_packs_epi32(u[28], u[29]); - s[15] = _mm_packs_epi32(u[30], u[31]); - - // stage 2 - u[0] = _mm_unpacklo_epi16(s[8], s[9]); - u[1] = _mm_unpackhi_epi16(s[8], s[9]); - u[2] = _mm_unpacklo_epi16(s[10], s[11]); - u[3] = _mm_unpackhi_epi16(s[10], s[11]); - u[4] = _mm_unpacklo_epi16(s[12], s[13]); - u[5] = _mm_unpackhi_epi16(s[12], s[13]); - u[6] = _mm_unpacklo_epi16(s[14], s[15]); - u[7] = _mm_unpackhi_epi16(s[14], s[15]); - - v[0] = _mm_madd_epi16(u[0], k__cospi_p04_p28); - v[1] = _mm_madd_epi16(u[1], k__cospi_p04_p28); - v[2] = _mm_madd_epi16(u[0], k__cospi_p28_m04); - v[3] = _mm_madd_epi16(u[1], k__cospi_p28_m04); - v[4] = _mm_madd_epi16(u[2], k__cospi_p20_p12); - v[5] = _mm_madd_epi16(u[3], k__cospi_p20_p12); - v[6] = _mm_madd_epi16(u[2], k__cospi_p12_m20); - v[7] = _mm_madd_epi16(u[3], k__cospi_p12_m20); - v[8] = _mm_madd_epi16(u[4], k__cospi_m28_p04); - v[9] = _mm_madd_epi16(u[5], k__cospi_m28_p04); - v[10] = _mm_madd_epi16(u[4], k__cospi_p04_p28); - v[11] = _mm_madd_epi16(u[5], k__cospi_p04_p28); - v[12] = _mm_madd_epi16(u[6], k__cospi_m12_p20); - v[13] = _mm_madd_epi16(u[7], k__cospi_m12_p20); - v[14] = _mm_madd_epi16(u[6], k__cospi_p20_p12); - v[15] = _mm_madd_epi16(u[7], k__cospi_p20_p12); - - u[0] = _mm_add_epi32(v[0], v[8]); - u[1] = _mm_add_epi32(v[1], v[9]); - u[2] = _mm_add_epi32(v[2], v[10]); - u[3] = _mm_add_epi32(v[3], v[11]); - u[4] = _mm_add_epi32(v[4], v[12]); - u[5] = _mm_add_epi32(v[5], v[13]); - u[6] = _mm_add_epi32(v[6], v[14]); - u[7] = _mm_add_epi32(v[7], v[15]); - u[8] = _mm_sub_epi32(v[0], v[8]); - u[9] = _mm_sub_epi32(v[1], v[9]); - u[10] = _mm_sub_epi32(v[2], v[10]); - u[11] = _mm_sub_epi32(v[3], v[11]); - u[12] = _mm_sub_epi32(v[4], v[12]); - u[13] = _mm_sub_epi32(v[5], v[13]); - u[14] = _mm_sub_epi32(v[6], v[14]); - u[15] = _mm_sub_epi32(v[7], v[15]); - - v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING); - v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING); - v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING); - v[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING); - v[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING); - v[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING); - v[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING); - v[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING); - v[8] = _mm_add_epi32(u[8], k__DCT_CONST_ROUNDING); - v[9] = _mm_add_epi32(u[9], k__DCT_CONST_ROUNDING); - v[10] = _mm_add_epi32(u[10], k__DCT_CONST_ROUNDING); - v[11] = _mm_add_epi32(u[11], k__DCT_CONST_ROUNDING); - v[12] = _mm_add_epi32(u[12], k__DCT_CONST_ROUNDING); - v[13] = _mm_add_epi32(u[13], k__DCT_CONST_ROUNDING); - v[14] = _mm_add_epi32(u[14], k__DCT_CONST_ROUNDING); - v[15] = _mm_add_epi32(u[15], k__DCT_CONST_ROUNDING); - - u[0] = _mm_srai_epi32(v[0], DCT_CONST_BITS); - u[1] = _mm_srai_epi32(v[1], DCT_CONST_BITS); - u[2] = _mm_srai_epi32(v[2], DCT_CONST_BITS); - u[3] = _mm_srai_epi32(v[3], DCT_CONST_BITS); - u[4] = _mm_srai_epi32(v[4], DCT_CONST_BITS); - u[5] = _mm_srai_epi32(v[5], DCT_CONST_BITS); - u[6] = _mm_srai_epi32(v[6], DCT_CONST_BITS); - u[7] = _mm_srai_epi32(v[7], DCT_CONST_BITS); - u[8] = _mm_srai_epi32(v[8], DCT_CONST_BITS); - u[9] = _mm_srai_epi32(v[9], DCT_CONST_BITS); - u[10] = _mm_srai_epi32(v[10], DCT_CONST_BITS); - u[11] = _mm_srai_epi32(v[11], DCT_CONST_BITS); - u[12] = _mm_srai_epi32(v[12], DCT_CONST_BITS); - u[13] = _mm_srai_epi32(v[13], DCT_CONST_BITS); - u[14] = _mm_srai_epi32(v[14], DCT_CONST_BITS); - u[15] = _mm_srai_epi32(v[15], DCT_CONST_BITS); - - x[0] = _mm_add_epi16(s[0], s[4]); - x[1] = _mm_add_epi16(s[1], s[5]); - x[2] = _mm_add_epi16(s[2], s[6]); - x[3] = _mm_add_epi16(s[3], s[7]); - x[4] = _mm_sub_epi16(s[0], s[4]); - x[5] = _mm_sub_epi16(s[1], s[5]); - x[6] = _mm_sub_epi16(s[2], s[6]); - x[7] = _mm_sub_epi16(s[3], s[7]); - x[8] = _mm_packs_epi32(u[0], u[1]); - x[9] = _mm_packs_epi32(u[2], u[3]); - x[10] = _mm_packs_epi32(u[4], u[5]); - x[11] = _mm_packs_epi32(u[6], u[7]); - x[12] = _mm_packs_epi32(u[8], u[9]); - x[13] = _mm_packs_epi32(u[10], u[11]); - x[14] = _mm_packs_epi32(u[12], u[13]); - x[15] = _mm_packs_epi32(u[14], u[15]); - - // stage 3 - u[0] = _mm_unpacklo_epi16(x[4], x[5]); - u[1] = _mm_unpackhi_epi16(x[4], x[5]); - u[2] = _mm_unpacklo_epi16(x[6], x[7]); - u[3] = _mm_unpackhi_epi16(x[6], x[7]); - u[4] = _mm_unpacklo_epi16(x[12], x[13]); - u[5] = _mm_unpackhi_epi16(x[12], x[13]); - u[6] = _mm_unpacklo_epi16(x[14], x[15]); - u[7] = _mm_unpackhi_epi16(x[14], x[15]); - - v[0] = _mm_madd_epi16(u[0], k__cospi_p08_p24); - v[1] = _mm_madd_epi16(u[1], k__cospi_p08_p24); - v[2] = _mm_madd_epi16(u[0], k__cospi_p24_m08); - v[3] = _mm_madd_epi16(u[1], k__cospi_p24_m08); - v[4] = _mm_madd_epi16(u[2], k__cospi_m24_p08); - v[5] = _mm_madd_epi16(u[3], k__cospi_m24_p08); - v[6] = _mm_madd_epi16(u[2], k__cospi_p08_p24); - v[7] = _mm_madd_epi16(u[3], k__cospi_p08_p24); - v[8] = _mm_madd_epi16(u[4], k__cospi_p08_p24); - v[9] = _mm_madd_epi16(u[5], k__cospi_p08_p24); - v[10] = _mm_madd_epi16(u[4], k__cospi_p24_m08); - v[11] = _mm_madd_epi16(u[5], k__cospi_p24_m08); - v[12] = _mm_madd_epi16(u[6], k__cospi_m24_p08); - v[13] = _mm_madd_epi16(u[7], k__cospi_m24_p08); - v[14] = _mm_madd_epi16(u[6], k__cospi_p08_p24); - v[15] = _mm_madd_epi16(u[7], k__cospi_p08_p24); - - u[0] = _mm_add_epi32(v[0], v[4]); - u[1] = _mm_add_epi32(v[1], v[5]); - u[2] = _mm_add_epi32(v[2], v[6]); - u[3] = _mm_add_epi32(v[3], v[7]); - u[4] = _mm_sub_epi32(v[0], v[4]); - u[5] = _mm_sub_epi32(v[1], v[5]); - u[6] = _mm_sub_epi32(v[2], v[6]); - u[7] = _mm_sub_epi32(v[3], v[7]); - u[8] = _mm_add_epi32(v[8], v[12]); - u[9] = _mm_add_epi32(v[9], v[13]); - u[10] = _mm_add_epi32(v[10], v[14]); - u[11] = _mm_add_epi32(v[11], v[15]); - u[12] = _mm_sub_epi32(v[8], v[12]); - u[13] = _mm_sub_epi32(v[9], v[13]); - u[14] = _mm_sub_epi32(v[10], v[14]); - u[15] = _mm_sub_epi32(v[11], v[15]); - - u[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING); - u[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING); - u[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING); - u[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING); - u[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING); - u[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING); - u[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING); - u[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING); - u[8] = _mm_add_epi32(u[8], k__DCT_CONST_ROUNDING); - u[9] = _mm_add_epi32(u[9], k__DCT_CONST_ROUNDING); - u[10] = _mm_add_epi32(u[10], k__DCT_CONST_ROUNDING); - u[11] = _mm_add_epi32(u[11], k__DCT_CONST_ROUNDING); - u[12] = _mm_add_epi32(u[12], k__DCT_CONST_ROUNDING); - u[13] = _mm_add_epi32(u[13], k__DCT_CONST_ROUNDING); - u[14] = _mm_add_epi32(u[14], k__DCT_CONST_ROUNDING); - u[15] = _mm_add_epi32(u[15], k__DCT_CONST_ROUNDING); - - v[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS); - v[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS); - v[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS); - v[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS); - v[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS); - v[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS); - v[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS); - v[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS); - v[8] = _mm_srai_epi32(u[8], DCT_CONST_BITS); - v[9] = _mm_srai_epi32(u[9], DCT_CONST_BITS); - v[10] = _mm_srai_epi32(u[10], DCT_CONST_BITS); - v[11] = _mm_srai_epi32(u[11], DCT_CONST_BITS); - v[12] = _mm_srai_epi32(u[12], DCT_CONST_BITS); - v[13] = _mm_srai_epi32(u[13], DCT_CONST_BITS); - v[14] = _mm_srai_epi32(u[14], DCT_CONST_BITS); - v[15] = _mm_srai_epi32(u[15], DCT_CONST_BITS); - - s[0] = _mm_add_epi16(x[0], x[2]); - s[1] = _mm_add_epi16(x[1], x[3]); - s[2] = _mm_sub_epi16(x[0], x[2]); - s[3] = _mm_sub_epi16(x[1], x[3]); - s[4] = _mm_packs_epi32(v[0], v[1]); - s[5] = _mm_packs_epi32(v[2], v[3]); - s[6] = _mm_packs_epi32(v[4], v[5]); - s[7] = _mm_packs_epi32(v[6], v[7]); - s[8] = _mm_add_epi16(x[8], x[10]); - s[9] = _mm_add_epi16(x[9], x[11]); - s[10] = _mm_sub_epi16(x[8], x[10]); - s[11] = _mm_sub_epi16(x[9], x[11]); - s[12] = _mm_packs_epi32(v[8], v[9]); - s[13] = _mm_packs_epi32(v[10], v[11]); - s[14] = _mm_packs_epi32(v[12], v[13]); - s[15] = _mm_packs_epi32(v[14], v[15]); - - // stage 4 - u[0] = _mm_unpacklo_epi16(s[2], s[3]); - u[1] = _mm_unpackhi_epi16(s[2], s[3]); - u[2] = _mm_unpacklo_epi16(s[6], s[7]); - u[3] = _mm_unpackhi_epi16(s[6], s[7]); - u[4] = _mm_unpacklo_epi16(s[10], s[11]); - u[5] = _mm_unpackhi_epi16(s[10], s[11]); - u[6] = _mm_unpacklo_epi16(s[14], s[15]); - u[7] = _mm_unpackhi_epi16(s[14], s[15]); - - v[0] = _mm_madd_epi16(u[0], k__cospi_m16_m16); - v[1] = _mm_madd_epi16(u[1], k__cospi_m16_m16); - v[2] = _mm_madd_epi16(u[0], k__cospi_p16_m16); - v[3] = _mm_madd_epi16(u[1], k__cospi_p16_m16); - v[4] = _mm_madd_epi16(u[2], k__cospi_p16_p16); - v[5] = _mm_madd_epi16(u[3], k__cospi_p16_p16); - v[6] = _mm_madd_epi16(u[2], k__cospi_m16_p16); - v[7] = _mm_madd_epi16(u[3], k__cospi_m16_p16); - v[8] = _mm_madd_epi16(u[4], k__cospi_p16_p16); - v[9] = _mm_madd_epi16(u[5], k__cospi_p16_p16); - v[10] = _mm_madd_epi16(u[4], k__cospi_m16_p16); - v[11] = _mm_madd_epi16(u[5], k__cospi_m16_p16); - v[12] = _mm_madd_epi16(u[6], k__cospi_m16_m16); - v[13] = _mm_madd_epi16(u[7], k__cospi_m16_m16); - v[14] = _mm_madd_epi16(u[6], k__cospi_p16_m16); - v[15] = _mm_madd_epi16(u[7], k__cospi_p16_m16); - - u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING); - u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING); - u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING); - u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING); - u[4] = _mm_add_epi32(v[4], k__DCT_CONST_ROUNDING); - u[5] = _mm_add_epi32(v[5], k__DCT_CONST_ROUNDING); - u[6] = _mm_add_epi32(v[6], k__DCT_CONST_ROUNDING); - u[7] = _mm_add_epi32(v[7], k__DCT_CONST_ROUNDING); - u[8] = _mm_add_epi32(v[8], k__DCT_CONST_ROUNDING); - u[9] = _mm_add_epi32(v[9], k__DCT_CONST_ROUNDING); - u[10] = _mm_add_epi32(v[10], k__DCT_CONST_ROUNDING); - u[11] = _mm_add_epi32(v[11], k__DCT_CONST_ROUNDING); - u[12] = _mm_add_epi32(v[12], k__DCT_CONST_ROUNDING); - u[13] = _mm_add_epi32(v[13], k__DCT_CONST_ROUNDING); - u[14] = _mm_add_epi32(v[14], k__DCT_CONST_ROUNDING); - u[15] = _mm_add_epi32(v[15], k__DCT_CONST_ROUNDING); - - v[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS); - v[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS); - v[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS); - v[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS); - v[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS); - v[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS); - v[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS); - v[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS); - v[8] = _mm_srai_epi32(u[8], DCT_CONST_BITS); - v[9] = _mm_srai_epi32(u[9], DCT_CONST_BITS); - v[10] = _mm_srai_epi32(u[10], DCT_CONST_BITS); - v[11] = _mm_srai_epi32(u[11], DCT_CONST_BITS); - v[12] = _mm_srai_epi32(u[12], DCT_CONST_BITS); - v[13] = _mm_srai_epi32(u[13], DCT_CONST_BITS); - v[14] = _mm_srai_epi32(u[14], DCT_CONST_BITS); - v[15] = _mm_srai_epi32(u[15], DCT_CONST_BITS); - - in[0] = s[0]; - in[1] = _mm_sub_epi16(kZero, s[8]); - in[2] = s[12]; - in[3] = _mm_sub_epi16(kZero, s[4]); - in[4] = _mm_packs_epi32(v[4], v[5]); - in[5] = _mm_packs_epi32(v[12], v[13]); - in[6] = _mm_packs_epi32(v[8], v[9]); - in[7] = _mm_packs_epi32(v[0], v[1]); - in[8] = _mm_packs_epi32(v[2], v[3]); - in[9] = _mm_packs_epi32(v[10], v[11]); - in[10] = _mm_packs_epi32(v[14], v[15]); - in[11] = _mm_packs_epi32(v[6], v[7]); - in[12] = s[5]; - in[13] = _mm_sub_epi16(kZero, s[13]); - in[14] = s[9]; - in[15] = _mm_sub_epi16(kZero, s[1]); -} - -static void idct16_8col(__m128i *in) { - const __m128i k__cospi_p30_m02 = pair_set_epi16(cospi_30_64, -cospi_2_64); - const __m128i k__cospi_p02_p30 = pair_set_epi16(cospi_2_64, cospi_30_64); - const __m128i k__cospi_p14_m18 = pair_set_epi16(cospi_14_64, -cospi_18_64); - const __m128i k__cospi_p18_p14 = pair_set_epi16(cospi_18_64, cospi_14_64); - const __m128i k__cospi_p22_m10 = pair_set_epi16(cospi_22_64, -cospi_10_64); - const __m128i k__cospi_p10_p22 = pair_set_epi16(cospi_10_64, cospi_22_64); - const __m128i k__cospi_p06_m26 = pair_set_epi16(cospi_6_64, -cospi_26_64); - const __m128i k__cospi_p26_p06 = pair_set_epi16(cospi_26_64, cospi_6_64); - const __m128i k__cospi_p28_m04 = pair_set_epi16(cospi_28_64, -cospi_4_64); - const __m128i k__cospi_p04_p28 = pair_set_epi16(cospi_4_64, cospi_28_64); - const __m128i k__cospi_p12_m20 = pair_set_epi16(cospi_12_64, -cospi_20_64); - const __m128i k__cospi_p20_p12 = pair_set_epi16(cospi_20_64, cospi_12_64); - const __m128i k__cospi_p16_p16 = _mm_set1_epi16((int16_t)cospi_16_64); - const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64); - const __m128i k__cospi_p24_m08 = pair_set_epi16(cospi_24_64, -cospi_8_64); - const __m128i k__cospi_p08_p24 = pair_set_epi16(cospi_8_64, cospi_24_64); - const __m128i k__cospi_m08_p24 = pair_set_epi16(-cospi_8_64, cospi_24_64); - const __m128i k__cospi_p24_p08 = pair_set_epi16(cospi_24_64, cospi_8_64); - const __m128i k__cospi_m24_m08 = pair_set_epi16(-cospi_24_64, -cospi_8_64); - const __m128i k__cospi_m16_p16 = pair_set_epi16(-cospi_16_64, cospi_16_64); - const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING); - __m128i v[16], u[16], s[16], t[16]; - - // stage 1 - s[0] = in[0]; - s[1] = in[8]; - s[2] = in[4]; - s[3] = in[12]; - s[4] = in[2]; - s[5] = in[10]; - s[6] = in[6]; - s[7] = in[14]; - s[8] = in[1]; - s[9] = in[9]; - s[10] = in[5]; - s[11] = in[13]; - s[12] = in[3]; - s[13] = in[11]; - s[14] = in[7]; - s[15] = in[15]; - - // stage 2 - u[0] = _mm_unpacklo_epi16(s[8], s[15]); - u[1] = _mm_unpackhi_epi16(s[8], s[15]); - u[2] = _mm_unpacklo_epi16(s[9], s[14]); - u[3] = _mm_unpackhi_epi16(s[9], s[14]); - u[4] = _mm_unpacklo_epi16(s[10], s[13]); - u[5] = _mm_unpackhi_epi16(s[10], s[13]); - u[6] = _mm_unpacklo_epi16(s[11], s[12]); - u[7] = _mm_unpackhi_epi16(s[11], s[12]); - - v[0] = _mm_madd_epi16(u[0], k__cospi_p30_m02); - v[1] = _mm_madd_epi16(u[1], k__cospi_p30_m02); - v[2] = _mm_madd_epi16(u[0], k__cospi_p02_p30); - v[3] = _mm_madd_epi16(u[1], k__cospi_p02_p30); - v[4] = _mm_madd_epi16(u[2], k__cospi_p14_m18); - v[5] = _mm_madd_epi16(u[3], k__cospi_p14_m18); - v[6] = _mm_madd_epi16(u[2], k__cospi_p18_p14); - v[7] = _mm_madd_epi16(u[3], k__cospi_p18_p14); - v[8] = _mm_madd_epi16(u[4], k__cospi_p22_m10); - v[9] = _mm_madd_epi16(u[5], k__cospi_p22_m10); - v[10] = _mm_madd_epi16(u[4], k__cospi_p10_p22); - v[11] = _mm_madd_epi16(u[5], k__cospi_p10_p22); - v[12] = _mm_madd_epi16(u[6], k__cospi_p06_m26); - v[13] = _mm_madd_epi16(u[7], k__cospi_p06_m26); - v[14] = _mm_madd_epi16(u[6], k__cospi_p26_p06); - v[15] = _mm_madd_epi16(u[7], k__cospi_p26_p06); - - u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING); - u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING); - u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING); - u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING); - u[4] = _mm_add_epi32(v[4], k__DCT_CONST_ROUNDING); - u[5] = _mm_add_epi32(v[5], k__DCT_CONST_ROUNDING); - u[6] = _mm_add_epi32(v[6], k__DCT_CONST_ROUNDING); - u[7] = _mm_add_epi32(v[7], k__DCT_CONST_ROUNDING); - u[8] = _mm_add_epi32(v[8], k__DCT_CONST_ROUNDING); - u[9] = _mm_add_epi32(v[9], k__DCT_CONST_ROUNDING); - u[10] = _mm_add_epi32(v[10], k__DCT_CONST_ROUNDING); - u[11] = _mm_add_epi32(v[11], k__DCT_CONST_ROUNDING); - u[12] = _mm_add_epi32(v[12], k__DCT_CONST_ROUNDING); - u[13] = _mm_add_epi32(v[13], k__DCT_CONST_ROUNDING); - u[14] = _mm_add_epi32(v[14], k__DCT_CONST_ROUNDING); - u[15] = _mm_add_epi32(v[15], k__DCT_CONST_ROUNDING); - - u[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS); - u[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS); - u[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS); - u[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS); - u[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS); - u[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS); - u[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS); - u[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS); - u[8] = _mm_srai_epi32(u[8], DCT_CONST_BITS); - u[9] = _mm_srai_epi32(u[9], DCT_CONST_BITS); - u[10] = _mm_srai_epi32(u[10], DCT_CONST_BITS); - u[11] = _mm_srai_epi32(u[11], DCT_CONST_BITS); - u[12] = _mm_srai_epi32(u[12], DCT_CONST_BITS); - u[13] = _mm_srai_epi32(u[13], DCT_CONST_BITS); - u[14] = _mm_srai_epi32(u[14], DCT_CONST_BITS); - u[15] = _mm_srai_epi32(u[15], DCT_CONST_BITS); - - s[8] = _mm_packs_epi32(u[0], u[1]); - s[15] = _mm_packs_epi32(u[2], u[3]); - s[9] = _mm_packs_epi32(u[4], u[5]); - s[14] = _mm_packs_epi32(u[6], u[7]); - s[10] = _mm_packs_epi32(u[8], u[9]); - s[13] = _mm_packs_epi32(u[10], u[11]); - s[11] = _mm_packs_epi32(u[12], u[13]); - s[12] = _mm_packs_epi32(u[14], u[15]); - - // stage 3 - t[0] = s[0]; - t[1] = s[1]; - t[2] = s[2]; - t[3] = s[3]; - u[0] = _mm_unpacklo_epi16(s[4], s[7]); - u[1] = _mm_unpackhi_epi16(s[4], s[7]); - u[2] = _mm_unpacklo_epi16(s[5], s[6]); - u[3] = _mm_unpackhi_epi16(s[5], s[6]); - - v[0] = _mm_madd_epi16(u[0], k__cospi_p28_m04); - v[1] = _mm_madd_epi16(u[1], k__cospi_p28_m04); - v[2] = _mm_madd_epi16(u[0], k__cospi_p04_p28); - v[3] = _mm_madd_epi16(u[1], k__cospi_p04_p28); - v[4] = _mm_madd_epi16(u[2], k__cospi_p12_m20); - v[5] = _mm_madd_epi16(u[3], k__cospi_p12_m20); - v[6] = _mm_madd_epi16(u[2], k__cospi_p20_p12); - v[7] = _mm_madd_epi16(u[3], k__cospi_p20_p12); - - u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING); - u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING); - u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING); - u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING); - u[4] = _mm_add_epi32(v[4], k__DCT_CONST_ROUNDING); - u[5] = _mm_add_epi32(v[5], k__DCT_CONST_ROUNDING); - u[6] = _mm_add_epi32(v[6], k__DCT_CONST_ROUNDING); - u[7] = _mm_add_epi32(v[7], k__DCT_CONST_ROUNDING); - - u[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS); - u[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS); - u[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS); - u[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS); - u[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS); - u[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS); - u[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS); - u[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS); - - t[4] = _mm_packs_epi32(u[0], u[1]); - t[7] = _mm_packs_epi32(u[2], u[3]); - t[5] = _mm_packs_epi32(u[4], u[5]); - t[6] = _mm_packs_epi32(u[6], u[7]); - t[8] = _mm_add_epi16(s[8], s[9]); - t[9] = _mm_sub_epi16(s[8], s[9]); - t[10] = _mm_sub_epi16(s[11], s[10]); - t[11] = _mm_add_epi16(s[10], s[11]); - t[12] = _mm_add_epi16(s[12], s[13]); - t[13] = _mm_sub_epi16(s[12], s[13]); - t[14] = _mm_sub_epi16(s[15], s[14]); - t[15] = _mm_add_epi16(s[14], s[15]); - - // stage 4 - u[0] = _mm_unpacklo_epi16(t[0], t[1]); - u[1] = _mm_unpackhi_epi16(t[0], t[1]); - u[2] = _mm_unpacklo_epi16(t[2], t[3]); - u[3] = _mm_unpackhi_epi16(t[2], t[3]); - u[4] = _mm_unpacklo_epi16(t[9], t[14]); - u[5] = _mm_unpackhi_epi16(t[9], t[14]); - u[6] = _mm_unpacklo_epi16(t[10], t[13]); - u[7] = _mm_unpackhi_epi16(t[10], t[13]); - - v[0] = _mm_madd_epi16(u[0], k__cospi_p16_p16); - v[1] = _mm_madd_epi16(u[1], k__cospi_p16_p16); - v[2] = _mm_madd_epi16(u[0], k__cospi_p16_m16); - v[3] = _mm_madd_epi16(u[1], k__cospi_p16_m16); - v[4] = _mm_madd_epi16(u[2], k__cospi_p24_m08); - v[5] = _mm_madd_epi16(u[3], k__cospi_p24_m08); - v[6] = _mm_madd_epi16(u[2], k__cospi_p08_p24); - v[7] = _mm_madd_epi16(u[3], k__cospi_p08_p24); - v[8] = _mm_madd_epi16(u[4], k__cospi_m08_p24); - v[9] = _mm_madd_epi16(u[5], k__cospi_m08_p24); - v[10] = _mm_madd_epi16(u[4], k__cospi_p24_p08); - v[11] = _mm_madd_epi16(u[5], k__cospi_p24_p08); - v[12] = _mm_madd_epi16(u[6], k__cospi_m24_m08); - v[13] = _mm_madd_epi16(u[7], k__cospi_m24_m08); - v[14] = _mm_madd_epi16(u[6], k__cospi_m08_p24); - v[15] = _mm_madd_epi16(u[7], k__cospi_m08_p24); - - u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING); - u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING); - u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING); - u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING); - u[4] = _mm_add_epi32(v[4], k__DCT_CONST_ROUNDING); - u[5] = _mm_add_epi32(v[5], k__DCT_CONST_ROUNDING); - u[6] = _mm_add_epi32(v[6], k__DCT_CONST_ROUNDING); - u[7] = _mm_add_epi32(v[7], k__DCT_CONST_ROUNDING); - u[8] = _mm_add_epi32(v[8], k__DCT_CONST_ROUNDING); - u[9] = _mm_add_epi32(v[9], k__DCT_CONST_ROUNDING); - u[10] = _mm_add_epi32(v[10], k__DCT_CONST_ROUNDING); - u[11] = _mm_add_epi32(v[11], k__DCT_CONST_ROUNDING); - u[12] = _mm_add_epi32(v[12], k__DCT_CONST_ROUNDING); - u[13] = _mm_add_epi32(v[13], k__DCT_CONST_ROUNDING); - u[14] = _mm_add_epi32(v[14], k__DCT_CONST_ROUNDING); - u[15] = _mm_add_epi32(v[15], k__DCT_CONST_ROUNDING); - - u[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS); - u[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS); - u[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS); - u[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS); - u[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS); - u[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS); - u[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS); - u[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS); - u[8] = _mm_srai_epi32(u[8], DCT_CONST_BITS); - u[9] = _mm_srai_epi32(u[9], DCT_CONST_BITS); - u[10] = _mm_srai_epi32(u[10], DCT_CONST_BITS); - u[11] = _mm_srai_epi32(u[11], DCT_CONST_BITS); - u[12] = _mm_srai_epi32(u[12], DCT_CONST_BITS); - u[13] = _mm_srai_epi32(u[13], DCT_CONST_BITS); - u[14] = _mm_srai_epi32(u[14], DCT_CONST_BITS); - u[15] = _mm_srai_epi32(u[15], DCT_CONST_BITS); - - s[0] = _mm_packs_epi32(u[0], u[1]); - s[1] = _mm_packs_epi32(u[2], u[3]); - s[2] = _mm_packs_epi32(u[4], u[5]); - s[3] = _mm_packs_epi32(u[6], u[7]); - s[4] = _mm_add_epi16(t[4], t[5]); - s[5] = _mm_sub_epi16(t[4], t[5]); - s[6] = _mm_sub_epi16(t[7], t[6]); - s[7] = _mm_add_epi16(t[6], t[7]); - s[8] = t[8]; - s[15] = t[15]; - s[9] = _mm_packs_epi32(u[8], u[9]); - s[14] = _mm_packs_epi32(u[10], u[11]); - s[10] = _mm_packs_epi32(u[12], u[13]); - s[13] = _mm_packs_epi32(u[14], u[15]); - s[11] = t[11]; - s[12] = t[12]; - - // stage 5 - t[0] = _mm_add_epi16(s[0], s[3]); - t[1] = _mm_add_epi16(s[1], s[2]); - t[2] = _mm_sub_epi16(s[1], s[2]); - t[3] = _mm_sub_epi16(s[0], s[3]); - t[4] = s[4]; - t[7] = s[7]; - - u[0] = _mm_unpacklo_epi16(s[5], s[6]); - u[1] = _mm_unpackhi_epi16(s[5], s[6]); - v[0] = _mm_madd_epi16(u[0], k__cospi_m16_p16); - v[1] = _mm_madd_epi16(u[1], k__cospi_m16_p16); - v[2] = _mm_madd_epi16(u[0], k__cospi_p16_p16); - v[3] = _mm_madd_epi16(u[1], k__cospi_p16_p16); - u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING); - u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING); - u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING); - u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING); - u[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS); - u[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS); - u[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS); - u[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS); - t[5] = _mm_packs_epi32(u[0], u[1]); - t[6] = _mm_packs_epi32(u[2], u[3]); - - t[8] = _mm_add_epi16(s[8], s[11]); - t[9] = _mm_add_epi16(s[9], s[10]); - t[10] = _mm_sub_epi16(s[9], s[10]); - t[11] = _mm_sub_epi16(s[8], s[11]); - t[12] = _mm_sub_epi16(s[15], s[12]); - t[13] = _mm_sub_epi16(s[14], s[13]); - t[14] = _mm_add_epi16(s[13], s[14]); - t[15] = _mm_add_epi16(s[12], s[15]); - - // stage 6 - s[0] = _mm_add_epi16(t[0], t[7]); - s[1] = _mm_add_epi16(t[1], t[6]); - s[2] = _mm_add_epi16(t[2], t[5]); - s[3] = _mm_add_epi16(t[3], t[4]); - s[4] = _mm_sub_epi16(t[3], t[4]); - s[5] = _mm_sub_epi16(t[2], t[5]); - s[6] = _mm_sub_epi16(t[1], t[6]); - s[7] = _mm_sub_epi16(t[0], t[7]); - s[8] = t[8]; - s[9] = t[9]; - - u[0] = _mm_unpacklo_epi16(t[10], t[13]); - u[1] = _mm_unpackhi_epi16(t[10], t[13]); - u[2] = _mm_unpacklo_epi16(t[11], t[12]); - u[3] = _mm_unpackhi_epi16(t[11], t[12]); - - v[0] = _mm_madd_epi16(u[0], k__cospi_m16_p16); - v[1] = _mm_madd_epi16(u[1], k__cospi_m16_p16); - v[2] = _mm_madd_epi16(u[0], k__cospi_p16_p16); - v[3] = _mm_madd_epi16(u[1], k__cospi_p16_p16); - v[4] = _mm_madd_epi16(u[2], k__cospi_m16_p16); - v[5] = _mm_madd_epi16(u[3], k__cospi_m16_p16); - v[6] = _mm_madd_epi16(u[2], k__cospi_p16_p16); - v[7] = _mm_madd_epi16(u[3], k__cospi_p16_p16); - - u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING); - u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING); - u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING); - u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING); - u[4] = _mm_add_epi32(v[4], k__DCT_CONST_ROUNDING); - u[5] = _mm_add_epi32(v[5], k__DCT_CONST_ROUNDING); - u[6] = _mm_add_epi32(v[6], k__DCT_CONST_ROUNDING); - u[7] = _mm_add_epi32(v[7], k__DCT_CONST_ROUNDING); - - u[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS); - u[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS); - u[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS); - u[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS); - u[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS); - u[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS); - u[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS); - u[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS); - - s[10] = _mm_packs_epi32(u[0], u[1]); - s[13] = _mm_packs_epi32(u[2], u[3]); - s[11] = _mm_packs_epi32(u[4], u[5]); - s[12] = _mm_packs_epi32(u[6], u[7]); - s[14] = t[14]; - s[15] = t[15]; - - // stage 7 - in[0] = _mm_add_epi16(s[0], s[15]); - in[1] = _mm_add_epi16(s[1], s[14]); - in[2] = _mm_add_epi16(s[2], s[13]); - in[3] = _mm_add_epi16(s[3], s[12]); - in[4] = _mm_add_epi16(s[4], s[11]); - in[5] = _mm_add_epi16(s[5], s[10]); - in[6] = _mm_add_epi16(s[6], s[9]); - in[7] = _mm_add_epi16(s[7], s[8]); - in[8] = _mm_sub_epi16(s[7], s[8]); - in[9] = _mm_sub_epi16(s[6], s[9]); - in[10] = _mm_sub_epi16(s[5], s[10]); - in[11] = _mm_sub_epi16(s[4], s[11]); - in[12] = _mm_sub_epi16(s[3], s[12]); - in[13] = _mm_sub_epi16(s[2], s[13]); - in[14] = _mm_sub_epi16(s[1], s[14]); - in[15] = _mm_sub_epi16(s[0], s[15]); -} - -static void idct16_sse2(__m128i *in0, __m128i *in1) { - array_transpose_16x16(in0, in1); - idct16_8col(in0); - idct16_8col(in1); -} - -static void iadst16_sse2(__m128i *in0, __m128i *in1) { - array_transpose_16x16(in0, in1); - iadst16_8col(in0); - iadst16_8col(in1); -} - -void vp9_iht16x16_256_add_sse2(const int16_t *input, uint8_t *dest, int stride, - int tx_type) { - __m128i in0[16], in1[16]; - - load_buffer_8x16(input, in0); - input += 8; - load_buffer_8x16(input, in1); - - switch (tx_type) { - case 0: // DCT_DCT - idct16_sse2(in0, in1); - idct16_sse2(in0, in1); - break; - case 1: // ADST_DCT - idct16_sse2(in0, in1); - iadst16_sse2(in0, in1); - break; - case 2: // DCT_ADST - iadst16_sse2(in0, in1); - idct16_sse2(in0, in1); - break; - case 3: // ADST_ADST - iadst16_sse2(in0, in1); - iadst16_sse2(in0, in1); - break; - default: - assert(0); - break; - } - - write_buffer_8x16(dest, in0, stride); - dest += 8; - write_buffer_8x16(dest, in1, stride); -} - -void vp9_idct16x16_10_add_sse2(const int16_t *input, uint8_t *dest, - int stride) { - const __m128i rounding = _mm_set1_epi32(DCT_CONST_ROUNDING); - const __m128i final_rounding = _mm_set1_epi16(1<<5); - const __m128i zero = _mm_setzero_si128(); - - const __m128i stg2_0 = pair_set_epi16(cospi_30_64, -cospi_2_64); - const __m128i stg2_1 = pair_set_epi16(cospi_2_64, cospi_30_64); - const __m128i stg2_6 = pair_set_epi16(cospi_6_64, -cospi_26_64); - const __m128i stg2_7 = pair_set_epi16(cospi_26_64, cospi_6_64); - - const __m128i stg3_0 = pair_set_epi16(cospi_28_64, -cospi_4_64); - const __m128i stg3_1 = pair_set_epi16(cospi_4_64, cospi_28_64); - - const __m128i stg4_0 = pair_set_epi16(cospi_16_64, cospi_16_64); - const __m128i stg4_1 = pair_set_epi16(cospi_16_64, -cospi_16_64); - const __m128i stg4_4 = pair_set_epi16(-cospi_8_64, cospi_24_64); - const __m128i stg4_5 = pair_set_epi16(cospi_24_64, cospi_8_64); - const __m128i stg4_6 = pair_set_epi16(-cospi_24_64, -cospi_8_64); - const __m128i stg4_7 = pair_set_epi16(-cospi_8_64, cospi_24_64); - - const __m128i stg6_0 = pair_set_epi16(-cospi_16_64, cospi_16_64); - __m128i in[16], l[16]; - __m128i stp1_0, stp1_1, stp1_2, stp1_3, stp1_4, stp1_5, stp1_6, - stp1_8, stp1_9, stp1_10, stp1_11, stp1_12, stp1_13, stp1_14, stp1_15, - stp1_8_0, stp1_12_0; - __m128i stp2_0, stp2_1, stp2_2, stp2_3, stp2_4, stp2_5, stp2_6, stp2_7, - stp2_8, stp2_9, stp2_10, stp2_11, stp2_12, stp2_13, stp2_14; - __m128i tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - int i; - // First 1-D inverse DCT - // Load input data. - in[0] = _mm_load_si128((const __m128i *)input); - in[1] = _mm_load_si128((const __m128i *)(input + 8 * 2)); - in[2] = _mm_load_si128((const __m128i *)(input + 8 * 4)); - in[3] = _mm_load_si128((const __m128i *)(input + 8 * 6)); - - TRANSPOSE_8X4(in[0], in[1], in[2], in[3], in[0], in[1]); - - // Stage2 - { - const __m128i lo_1_15 = _mm_unpackhi_epi16(in[0], zero); - const __m128i lo_13_3 = _mm_unpackhi_epi16(zero, in[1]); - - tmp0 = _mm_madd_epi16(lo_1_15, stg2_0); - tmp2 = _mm_madd_epi16(lo_1_15, stg2_1); - tmp5 = _mm_madd_epi16(lo_13_3, stg2_6); - tmp7 = _mm_madd_epi16(lo_13_3, stg2_7); - - tmp0 = _mm_add_epi32(tmp0, rounding); - tmp2 = _mm_add_epi32(tmp2, rounding); - tmp5 = _mm_add_epi32(tmp5, rounding); - tmp7 = _mm_add_epi32(tmp7, rounding); - - tmp0 = _mm_srai_epi32(tmp0, DCT_CONST_BITS); - tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS); - tmp5 = _mm_srai_epi32(tmp5, DCT_CONST_BITS); - tmp7 = _mm_srai_epi32(tmp7, DCT_CONST_BITS); - - stp2_8 = _mm_packs_epi32(tmp0, tmp2); - stp2_11 = _mm_packs_epi32(tmp5, tmp7); - } - - // Stage3 - { - const __m128i lo_2_14 = _mm_unpacklo_epi16(in[1], zero); - - tmp0 = _mm_madd_epi16(lo_2_14, stg3_0); - tmp2 = _mm_madd_epi16(lo_2_14, stg3_1); - - tmp0 = _mm_add_epi32(tmp0, rounding); - tmp2 = _mm_add_epi32(tmp2, rounding); - tmp0 = _mm_srai_epi32(tmp0, DCT_CONST_BITS); - tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS); - - stp1_13 = _mm_unpackhi_epi64(stp2_11, zero); - stp1_14 = _mm_unpackhi_epi64(stp2_8, zero); - - stp1_4 = _mm_packs_epi32(tmp0, tmp2); - } - - // Stage4 - { - const __m128i lo_0_8 = _mm_unpacklo_epi16(in[0], zero); - const __m128i lo_9_14 = _mm_unpacklo_epi16(stp2_8, stp1_14); - const __m128i lo_10_13 = _mm_unpacklo_epi16(stp2_11, stp1_13); - - tmp0 = _mm_madd_epi16(lo_0_8, stg4_0); - tmp2 = _mm_madd_epi16(lo_0_8, stg4_1); - tmp1 = _mm_madd_epi16(lo_9_14, stg4_4); - tmp3 = _mm_madd_epi16(lo_9_14, stg4_5); - tmp5 = _mm_madd_epi16(lo_10_13, stg4_6); - tmp7 = _mm_madd_epi16(lo_10_13, stg4_7); - - tmp0 = _mm_add_epi32(tmp0, rounding); - tmp2 = _mm_add_epi32(tmp2, rounding); - tmp1 = _mm_add_epi32(tmp1, rounding); - tmp3 = _mm_add_epi32(tmp3, rounding); - tmp5 = _mm_add_epi32(tmp5, rounding); - tmp7 = _mm_add_epi32(tmp7, rounding); - - tmp0 = _mm_srai_epi32(tmp0, DCT_CONST_BITS); - tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS); - tmp1 = _mm_srai_epi32(tmp1, DCT_CONST_BITS); - tmp3 = _mm_srai_epi32(tmp3, DCT_CONST_BITS); - tmp5 = _mm_srai_epi32(tmp5, DCT_CONST_BITS); - tmp7 = _mm_srai_epi32(tmp7, DCT_CONST_BITS); - - stp1_0 = _mm_packs_epi32(tmp0, tmp0); - stp1_1 = _mm_packs_epi32(tmp2, tmp2); - stp2_9 = _mm_packs_epi32(tmp1, tmp3); - stp2_10 = _mm_packs_epi32(tmp5, tmp7); - - stp2_6 = _mm_unpackhi_epi64(stp1_4, zero); - } - - // Stage5 and Stage6 - { - tmp0 = _mm_add_epi16(stp2_8, stp2_11); - tmp1 = _mm_sub_epi16(stp2_8, stp2_11); - tmp2 = _mm_add_epi16(stp2_9, stp2_10); - tmp3 = _mm_sub_epi16(stp2_9, stp2_10); - - stp1_9 = _mm_unpacklo_epi64(tmp2, zero); - stp1_10 = _mm_unpacklo_epi64(tmp3, zero); - stp1_8 = _mm_unpacklo_epi64(tmp0, zero); - stp1_11 = _mm_unpacklo_epi64(tmp1, zero); - - stp1_13 = _mm_unpackhi_epi64(tmp3, zero); - stp1_14 = _mm_unpackhi_epi64(tmp2, zero); - stp1_12 = _mm_unpackhi_epi64(tmp1, zero); - stp1_15 = _mm_unpackhi_epi64(tmp0, zero); - } - - // Stage6 - { - const __m128i lo_6_5 = _mm_unpacklo_epi16(stp2_6, stp1_4); - const __m128i lo_10_13 = _mm_unpacklo_epi16(stp1_10, stp1_13); - const __m128i lo_11_12 = _mm_unpacklo_epi16(stp1_11, stp1_12); - - tmp1 = _mm_madd_epi16(lo_6_5, stg4_1); - tmp3 = _mm_madd_epi16(lo_6_5, stg4_0); - tmp0 = _mm_madd_epi16(lo_10_13, stg6_0); - tmp2 = _mm_madd_epi16(lo_10_13, stg4_0); - tmp4 = _mm_madd_epi16(lo_11_12, stg6_0); - tmp6 = _mm_madd_epi16(lo_11_12, stg4_0); - - tmp1 = _mm_add_epi32(tmp1, rounding); - tmp3 = _mm_add_epi32(tmp3, rounding); - tmp0 = _mm_add_epi32(tmp0, rounding); - tmp2 = _mm_add_epi32(tmp2, rounding); - tmp4 = _mm_add_epi32(tmp4, rounding); - tmp6 = _mm_add_epi32(tmp6, rounding); - - tmp1 = _mm_srai_epi32(tmp1, DCT_CONST_BITS); - tmp3 = _mm_srai_epi32(tmp3, DCT_CONST_BITS); - tmp0 = _mm_srai_epi32(tmp0, DCT_CONST_BITS); - tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS); - tmp4 = _mm_srai_epi32(tmp4, DCT_CONST_BITS); - tmp6 = _mm_srai_epi32(tmp6, DCT_CONST_BITS); - - stp1_6 = _mm_packs_epi32(tmp3, tmp1); - - stp2_10 = _mm_packs_epi32(tmp0, zero); - stp2_13 = _mm_packs_epi32(tmp2, zero); - stp2_11 = _mm_packs_epi32(tmp4, zero); - stp2_12 = _mm_packs_epi32(tmp6, zero); - - tmp0 = _mm_add_epi16(stp1_0, stp1_4); - tmp1 = _mm_sub_epi16(stp1_0, stp1_4); - tmp2 = _mm_add_epi16(stp1_1, stp1_6); - tmp3 = _mm_sub_epi16(stp1_1, stp1_6); - - stp2_0 = _mm_unpackhi_epi64(tmp0, zero); - stp2_1 = _mm_unpacklo_epi64(tmp2, zero); - stp2_2 = _mm_unpackhi_epi64(tmp2, zero); - stp2_3 = _mm_unpacklo_epi64(tmp0, zero); - stp2_4 = _mm_unpacklo_epi64(tmp1, zero); - stp2_5 = _mm_unpackhi_epi64(tmp3, zero); - stp2_6 = _mm_unpacklo_epi64(tmp3, zero); - stp2_7 = _mm_unpackhi_epi64(tmp1, zero); - } - - // Stage7. Left 8x16 only. - l[0] = _mm_add_epi16(stp2_0, stp1_15); - l[1] = _mm_add_epi16(stp2_1, stp1_14); - l[2] = _mm_add_epi16(stp2_2, stp2_13); - l[3] = _mm_add_epi16(stp2_3, stp2_12); - l[4] = _mm_add_epi16(stp2_4, stp2_11); - l[5] = _mm_add_epi16(stp2_5, stp2_10); - l[6] = _mm_add_epi16(stp2_6, stp1_9); - l[7] = _mm_add_epi16(stp2_7, stp1_8); - l[8] = _mm_sub_epi16(stp2_7, stp1_8); - l[9] = _mm_sub_epi16(stp2_6, stp1_9); - l[10] = _mm_sub_epi16(stp2_5, stp2_10); - l[11] = _mm_sub_epi16(stp2_4, stp2_11); - l[12] = _mm_sub_epi16(stp2_3, stp2_12); - l[13] = _mm_sub_epi16(stp2_2, stp2_13); - l[14] = _mm_sub_epi16(stp2_1, stp1_14); - l[15] = _mm_sub_epi16(stp2_0, stp1_15); - - // Second 1-D inverse transform, performed per 8x16 block - for (i = 0; i < 2; i++) { - array_transpose_4X8(l + 8*i, in); - - IDCT16_10 - - // Stage7 - in[0] = _mm_add_epi16(stp2_0, stp1_15); - in[1] = _mm_add_epi16(stp2_1, stp1_14); - in[2] = _mm_add_epi16(stp2_2, stp2_13); - in[3] = _mm_add_epi16(stp2_3, stp2_12); - in[4] = _mm_add_epi16(stp2_4, stp2_11); - in[5] = _mm_add_epi16(stp2_5, stp2_10); - in[6] = _mm_add_epi16(stp2_6, stp1_9); - in[7] = _mm_add_epi16(stp2_7, stp1_8); - in[8] = _mm_sub_epi16(stp2_7, stp1_8); - in[9] = _mm_sub_epi16(stp2_6, stp1_9); - in[10] = _mm_sub_epi16(stp2_5, stp2_10); - in[11] = _mm_sub_epi16(stp2_4, stp2_11); - in[12] = _mm_sub_epi16(stp2_3, stp2_12); - in[13] = _mm_sub_epi16(stp2_2, stp2_13); - in[14] = _mm_sub_epi16(stp2_1, stp1_14); - in[15] = _mm_sub_epi16(stp2_0, stp1_15); - - // Final rounding and shift - in[0] = _mm_adds_epi16(in[0], final_rounding); - in[1] = _mm_adds_epi16(in[1], final_rounding); - in[2] = _mm_adds_epi16(in[2], final_rounding); - in[3] = _mm_adds_epi16(in[3], final_rounding); - in[4] = _mm_adds_epi16(in[4], final_rounding); - in[5] = _mm_adds_epi16(in[5], final_rounding); - in[6] = _mm_adds_epi16(in[6], final_rounding); - in[7] = _mm_adds_epi16(in[7], final_rounding); - in[8] = _mm_adds_epi16(in[8], final_rounding); - in[9] = _mm_adds_epi16(in[9], final_rounding); - in[10] = _mm_adds_epi16(in[10], final_rounding); - in[11] = _mm_adds_epi16(in[11], final_rounding); - in[12] = _mm_adds_epi16(in[12], final_rounding); - in[13] = _mm_adds_epi16(in[13], final_rounding); - in[14] = _mm_adds_epi16(in[14], final_rounding); - in[15] = _mm_adds_epi16(in[15], final_rounding); - - in[0] = _mm_srai_epi16(in[0], 6); - in[1] = _mm_srai_epi16(in[1], 6); - in[2] = _mm_srai_epi16(in[2], 6); - in[3] = _mm_srai_epi16(in[3], 6); - in[4] = _mm_srai_epi16(in[4], 6); - in[5] = _mm_srai_epi16(in[5], 6); - in[6] = _mm_srai_epi16(in[6], 6); - in[7] = _mm_srai_epi16(in[7], 6); - in[8] = _mm_srai_epi16(in[8], 6); - in[9] = _mm_srai_epi16(in[9], 6); - in[10] = _mm_srai_epi16(in[10], 6); - in[11] = _mm_srai_epi16(in[11], 6); - in[12] = _mm_srai_epi16(in[12], 6); - in[13] = _mm_srai_epi16(in[13], 6); - in[14] = _mm_srai_epi16(in[14], 6); - in[15] = _mm_srai_epi16(in[15], 6); - - RECON_AND_STORE(dest, in[0]); - RECON_AND_STORE(dest, in[1]); - RECON_AND_STORE(dest, in[2]); - RECON_AND_STORE(dest, in[3]); - RECON_AND_STORE(dest, in[4]); - RECON_AND_STORE(dest, in[5]); - RECON_AND_STORE(dest, in[6]); - RECON_AND_STORE(dest, in[7]); - RECON_AND_STORE(dest, in[8]); - RECON_AND_STORE(dest, in[9]); - RECON_AND_STORE(dest, in[10]); - RECON_AND_STORE(dest, in[11]); - RECON_AND_STORE(dest, in[12]); - RECON_AND_STORE(dest, in[13]); - RECON_AND_STORE(dest, in[14]); - RECON_AND_STORE(dest, in[15]); - - dest += 8 - (stride * 16); - } -} - -#define LOAD_DQCOEFF(reg, input) \ - { \ - reg = _mm_load_si128((const __m128i *) input); \ - input += 8; \ - } \ - -#define IDCT32_34 \ -/* Stage1 */ \ -{ \ - const __m128i zero = _mm_setzero_si128();\ - const __m128i lo_1_31 = _mm_unpacklo_epi16(in[1], zero); \ - const __m128i hi_1_31 = _mm_unpackhi_epi16(in[1], zero); \ - \ - const __m128i lo_25_7= _mm_unpacklo_epi16(zero, in[7]); \ - const __m128i hi_25_7 = _mm_unpackhi_epi16(zero, in[7]); \ - \ - const __m128i lo_5_27 = _mm_unpacklo_epi16(in[5], zero); \ - const __m128i hi_5_27 = _mm_unpackhi_epi16(in[5], zero); \ - \ - const __m128i lo_29_3 = _mm_unpacklo_epi16(zero, in[3]); \ - const __m128i hi_29_3 = _mm_unpackhi_epi16(zero, in[3]); \ - \ - MULTIPLICATION_AND_ADD_2(lo_1_31, hi_1_31, stg1_0, \ - stg1_1, stp1_16, stp1_31); \ - MULTIPLICATION_AND_ADD_2(lo_25_7, hi_25_7, stg1_6, \ - stg1_7, stp1_19, stp1_28); \ - MULTIPLICATION_AND_ADD_2(lo_5_27, hi_5_27, stg1_8, \ - stg1_9, stp1_20, stp1_27); \ - MULTIPLICATION_AND_ADD_2(lo_29_3, hi_29_3, stg1_14, \ - stg1_15, stp1_23, stp1_24); \ -} \ -\ -/* Stage2 */ \ -{ \ - const __m128i zero = _mm_setzero_si128();\ - const __m128i lo_2_30 = _mm_unpacklo_epi16(in[2], zero); \ - const __m128i hi_2_30 = _mm_unpackhi_epi16(in[2], zero); \ - \ - const __m128i lo_26_6 = _mm_unpacklo_epi16(zero, in[6]); \ - const __m128i hi_26_6 = _mm_unpackhi_epi16(zero, in[6]); \ - \ - MULTIPLICATION_AND_ADD_2(lo_2_30, hi_2_30, stg2_0, \ - stg2_1, stp2_8, stp2_15); \ - MULTIPLICATION_AND_ADD_2(lo_26_6, hi_26_6, stg2_6, \ - stg2_7, stp2_11, stp2_12); \ - \ - stp2_16 = stp1_16; \ - stp2_19 = stp1_19; \ - \ - stp2_20 = stp1_20; \ - stp2_23 = stp1_23; \ - \ - stp2_24 = stp1_24; \ - stp2_27 = stp1_27; \ - \ - stp2_28 = stp1_28; \ - stp2_31 = stp1_31; \ -} \ -\ -/* Stage3 */ \ -{ \ - const __m128i zero = _mm_setzero_si128();\ - const __m128i lo_4_28 = _mm_unpacklo_epi16(in[4], zero); \ - const __m128i hi_4_28 = _mm_unpackhi_epi16(in[4], zero); \ - \ - const __m128i lo_17_30 = _mm_unpacklo_epi16(stp1_16, stp1_31); \ - const __m128i hi_17_30 = _mm_unpackhi_epi16(stp1_16, stp1_31); \ - const __m128i lo_18_29 = _mm_unpacklo_epi16(stp1_19, stp1_28); \ - const __m128i hi_18_29 = _mm_unpackhi_epi16(stp1_19, stp1_28); \ - \ - const __m128i lo_21_26 = _mm_unpacklo_epi16(stp1_20, stp1_27); \ - const __m128i hi_21_26 = _mm_unpackhi_epi16(stp1_20, stp1_27); \ - const __m128i lo_22_25 = _mm_unpacklo_epi16(stp1_23, stp1_24); \ - const __m128i hi_22_25 = _mm_unpackhi_epi16(stp1_23, stp2_24); \ - \ - MULTIPLICATION_AND_ADD_2(lo_4_28, hi_4_28, stg3_0, \ - stg3_1, stp1_4, stp1_7); \ - \ - stp1_8 = stp2_8; \ - stp1_11 = stp2_11; \ - stp1_12 = stp2_12; \ - stp1_15 = stp2_15; \ - \ - MULTIPLICATION_AND_ADD(lo_17_30, hi_17_30, lo_18_29, hi_18_29, stg3_4, \ - stg3_5, stg3_6, stg3_4, stp1_17, stp1_30, \ - stp1_18, stp1_29) \ - MULTIPLICATION_AND_ADD(lo_21_26, hi_21_26, lo_22_25, hi_22_25, stg3_8, \ - stg3_9, stg3_10, stg3_8, stp1_21, stp1_26, \ - stp1_22, stp1_25) \ - \ - stp1_16 = stp2_16; \ - stp1_31 = stp2_31; \ - stp1_19 = stp2_19; \ - stp1_20 = stp2_20; \ - stp1_23 = stp2_23; \ - stp1_24 = stp2_24; \ - stp1_27 = stp2_27; \ - stp1_28 = stp2_28; \ -} \ -\ -/* Stage4 */ \ -{ \ - const __m128i zero = _mm_setzero_si128();\ - const __m128i lo_0_16 = _mm_unpacklo_epi16(in[0], zero); \ - const __m128i hi_0_16 = _mm_unpackhi_epi16(in[0], zero); \ - \ - const __m128i lo_9_14 = _mm_unpacklo_epi16(stp2_8, stp2_15); \ - const __m128i hi_9_14 = _mm_unpackhi_epi16(stp2_8, stp2_15); \ - const __m128i lo_10_13 = _mm_unpacklo_epi16(stp2_11, stp2_12); \ - const __m128i hi_10_13 = _mm_unpackhi_epi16(stp2_11, stp2_12); \ - \ - MULTIPLICATION_AND_ADD_2(lo_0_16, hi_0_16, stg4_0, \ - stg4_1, stp2_0, stp2_1); \ - \ - stp2_4 = stp1_4; \ - stp2_5 = stp1_4; \ - stp2_6 = stp1_7; \ - stp2_7 = stp1_7; \ - \ - MULTIPLICATION_AND_ADD(lo_9_14, hi_9_14, lo_10_13, hi_10_13, stg4_4, \ - stg4_5, stg4_6, stg4_4, stp2_9, stp2_14, \ - stp2_10, stp2_13) \ - \ - stp2_8 = stp1_8; \ - stp2_15 = stp1_15; \ - stp2_11 = stp1_11; \ - stp2_12 = stp1_12; \ - \ - stp2_16 = _mm_add_epi16(stp1_16, stp1_19); \ - stp2_17 = _mm_add_epi16(stp1_17, stp1_18); \ - stp2_18 = _mm_sub_epi16(stp1_17, stp1_18); \ - stp2_19 = _mm_sub_epi16(stp1_16, stp1_19); \ - stp2_20 = _mm_sub_epi16(stp1_23, stp1_20); \ - stp2_21 = _mm_sub_epi16(stp1_22, stp1_21); \ - stp2_22 = _mm_add_epi16(stp1_22, stp1_21); \ - stp2_23 = _mm_add_epi16(stp1_23, stp1_20); \ - \ - stp2_24 = _mm_add_epi16(stp1_24, stp1_27); \ - stp2_25 = _mm_add_epi16(stp1_25, stp1_26); \ - stp2_26 = _mm_sub_epi16(stp1_25, stp1_26); \ - stp2_27 = _mm_sub_epi16(stp1_24, stp1_27); \ - stp2_28 = _mm_sub_epi16(stp1_31, stp1_28); \ - stp2_29 = _mm_sub_epi16(stp1_30, stp1_29); \ - stp2_30 = _mm_add_epi16(stp1_29, stp1_30); \ - stp2_31 = _mm_add_epi16(stp1_28, stp1_31); \ -} \ -\ -/* Stage5 */ \ -{ \ - const __m128i lo_6_5 = _mm_unpacklo_epi16(stp2_6, stp2_5); \ - const __m128i hi_6_5 = _mm_unpackhi_epi16(stp2_6, stp2_5); \ - const __m128i lo_18_29 = _mm_unpacklo_epi16(stp2_18, stp2_29); \ - const __m128i hi_18_29 = _mm_unpackhi_epi16(stp2_18, stp2_29); \ - \ - const __m128i lo_19_28 = _mm_unpacklo_epi16(stp2_19, stp2_28); \ - const __m128i hi_19_28 = _mm_unpackhi_epi16(stp2_19, stp2_28); \ - const __m128i lo_20_27 = _mm_unpacklo_epi16(stp2_20, stp2_27); \ - const __m128i hi_20_27 = _mm_unpackhi_epi16(stp2_20, stp2_27); \ - \ - const __m128i lo_21_26 = _mm_unpacklo_epi16(stp2_21, stp2_26); \ - const __m128i hi_21_26 = _mm_unpackhi_epi16(stp2_21, stp2_26); \ - \ - stp1_0 = stp2_0; \ - stp1_1 = stp2_1; \ - stp1_2 = stp2_1; \ - stp1_3 = stp2_0; \ - \ - tmp0 = _mm_madd_epi16(lo_6_5, stg4_1); \ - tmp1 = _mm_madd_epi16(hi_6_5, stg4_1); \ - tmp2 = _mm_madd_epi16(lo_6_5, stg4_0); \ - tmp3 = _mm_madd_epi16(hi_6_5, stg4_0); \ - \ - tmp0 = _mm_add_epi32(tmp0, rounding); \ - tmp1 = _mm_add_epi32(tmp1, rounding); \ - tmp2 = _mm_add_epi32(tmp2, rounding); \ - tmp3 = _mm_add_epi32(tmp3, rounding); \ - \ - tmp0 = _mm_srai_epi32(tmp0, DCT_CONST_BITS); \ - tmp1 = _mm_srai_epi32(tmp1, DCT_CONST_BITS); \ - tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS); \ - tmp3 = _mm_srai_epi32(tmp3, DCT_CONST_BITS); \ - \ - stp1_5 = _mm_packs_epi32(tmp0, tmp1); \ - stp1_6 = _mm_packs_epi32(tmp2, tmp3); \ - \ - stp1_4 = stp2_4; \ - stp1_7 = stp2_7; \ - \ - stp1_8 = _mm_add_epi16(stp2_8, stp2_11); \ - stp1_9 = _mm_add_epi16(stp2_9, stp2_10); \ - stp1_10 = _mm_sub_epi16(stp2_9, stp2_10); \ - stp1_11 = _mm_sub_epi16(stp2_8, stp2_11); \ - stp1_12 = _mm_sub_epi16(stp2_15, stp2_12); \ - stp1_13 = _mm_sub_epi16(stp2_14, stp2_13); \ - stp1_14 = _mm_add_epi16(stp2_14, stp2_13); \ - stp1_15 = _mm_add_epi16(stp2_15, stp2_12); \ - \ - stp1_16 = stp2_16; \ - stp1_17 = stp2_17; \ - \ - MULTIPLICATION_AND_ADD(lo_18_29, hi_18_29, lo_19_28, hi_19_28, stg4_4, \ - stg4_5, stg4_4, stg4_5, stp1_18, stp1_29, \ - stp1_19, stp1_28) \ - MULTIPLICATION_AND_ADD(lo_20_27, hi_20_27, lo_21_26, hi_21_26, stg4_6, \ - stg4_4, stg4_6, stg4_4, stp1_20, stp1_27, \ - stp1_21, stp1_26) \ - \ - stp1_22 = stp2_22; \ - stp1_23 = stp2_23; \ - stp1_24 = stp2_24; \ - stp1_25 = stp2_25; \ - stp1_30 = stp2_30; \ - stp1_31 = stp2_31; \ -} \ -\ -/* Stage6 */ \ -{ \ - const __m128i lo_10_13 = _mm_unpacklo_epi16(stp1_10, stp1_13); \ - const __m128i hi_10_13 = _mm_unpackhi_epi16(stp1_10, stp1_13); \ - const __m128i lo_11_12 = _mm_unpacklo_epi16(stp1_11, stp1_12); \ - const __m128i hi_11_12 = _mm_unpackhi_epi16(stp1_11, stp1_12); \ - \ - stp2_0 = _mm_add_epi16(stp1_0, stp1_7); \ - stp2_1 = _mm_add_epi16(stp1_1, stp1_6); \ - stp2_2 = _mm_add_epi16(stp1_2, stp1_5); \ - stp2_3 = _mm_add_epi16(stp1_3, stp1_4); \ - stp2_4 = _mm_sub_epi16(stp1_3, stp1_4); \ - stp2_5 = _mm_sub_epi16(stp1_2, stp1_5); \ - stp2_6 = _mm_sub_epi16(stp1_1, stp1_6); \ - stp2_7 = _mm_sub_epi16(stp1_0, stp1_7); \ - \ - stp2_8 = stp1_8; \ - stp2_9 = stp1_9; \ - stp2_14 = stp1_14; \ - stp2_15 = stp1_15; \ - \ - MULTIPLICATION_AND_ADD(lo_10_13, hi_10_13, lo_11_12, hi_11_12, \ - stg6_0, stg4_0, stg6_0, stg4_0, stp2_10, \ - stp2_13, stp2_11, stp2_12) \ - \ - stp2_16 = _mm_add_epi16(stp1_16, stp1_23); \ - stp2_17 = _mm_add_epi16(stp1_17, stp1_22); \ - stp2_18 = _mm_add_epi16(stp1_18, stp1_21); \ - stp2_19 = _mm_add_epi16(stp1_19, stp1_20); \ - stp2_20 = _mm_sub_epi16(stp1_19, stp1_20); \ - stp2_21 = _mm_sub_epi16(stp1_18, stp1_21); \ - stp2_22 = _mm_sub_epi16(stp1_17, stp1_22); \ - stp2_23 = _mm_sub_epi16(stp1_16, stp1_23); \ - \ - stp2_24 = _mm_sub_epi16(stp1_31, stp1_24); \ - stp2_25 = _mm_sub_epi16(stp1_30, stp1_25); \ - stp2_26 = _mm_sub_epi16(stp1_29, stp1_26); \ - stp2_27 = _mm_sub_epi16(stp1_28, stp1_27); \ - stp2_28 = _mm_add_epi16(stp1_27, stp1_28); \ - stp2_29 = _mm_add_epi16(stp1_26, stp1_29); \ - stp2_30 = _mm_add_epi16(stp1_25, stp1_30); \ - stp2_31 = _mm_add_epi16(stp1_24, stp1_31); \ -} \ -\ -/* Stage7 */ \ -{ \ - const __m128i lo_20_27 = _mm_unpacklo_epi16(stp2_20, stp2_27); \ - const __m128i hi_20_27 = _mm_unpackhi_epi16(stp2_20, stp2_27); \ - const __m128i lo_21_26 = _mm_unpacklo_epi16(stp2_21, stp2_26); \ - const __m128i hi_21_26 = _mm_unpackhi_epi16(stp2_21, stp2_26); \ - \ - const __m128i lo_22_25 = _mm_unpacklo_epi16(stp2_22, stp2_25); \ - const __m128i hi_22_25 = _mm_unpackhi_epi16(stp2_22, stp2_25); \ - const __m128i lo_23_24 = _mm_unpacklo_epi16(stp2_23, stp2_24); \ - const __m128i hi_23_24 = _mm_unpackhi_epi16(stp2_23, stp2_24); \ - \ - stp1_0 = _mm_add_epi16(stp2_0, stp2_15); \ - stp1_1 = _mm_add_epi16(stp2_1, stp2_14); \ - stp1_2 = _mm_add_epi16(stp2_2, stp2_13); \ - stp1_3 = _mm_add_epi16(stp2_3, stp2_12); \ - stp1_4 = _mm_add_epi16(stp2_4, stp2_11); \ - stp1_5 = _mm_add_epi16(stp2_5, stp2_10); \ - stp1_6 = _mm_add_epi16(stp2_6, stp2_9); \ - stp1_7 = _mm_add_epi16(stp2_7, stp2_8); \ - stp1_8 = _mm_sub_epi16(stp2_7, stp2_8); \ - stp1_9 = _mm_sub_epi16(stp2_6, stp2_9); \ - stp1_10 = _mm_sub_epi16(stp2_5, stp2_10); \ - stp1_11 = _mm_sub_epi16(stp2_4, stp2_11); \ - stp1_12 = _mm_sub_epi16(stp2_3, stp2_12); \ - stp1_13 = _mm_sub_epi16(stp2_2, stp2_13); \ - stp1_14 = _mm_sub_epi16(stp2_1, stp2_14); \ - stp1_15 = _mm_sub_epi16(stp2_0, stp2_15); \ - \ - stp1_16 = stp2_16; \ - stp1_17 = stp2_17; \ - stp1_18 = stp2_18; \ - stp1_19 = stp2_19; \ - \ - MULTIPLICATION_AND_ADD(lo_20_27, hi_20_27, lo_21_26, hi_21_26, stg6_0, \ - stg4_0, stg6_0, stg4_0, stp1_20, stp1_27, \ - stp1_21, stp1_26) \ - MULTIPLICATION_AND_ADD(lo_22_25, hi_22_25, lo_23_24, hi_23_24, stg6_0, \ - stg4_0, stg6_0, stg4_0, stp1_22, stp1_25, \ - stp1_23, stp1_24) \ - \ - stp1_28 = stp2_28; \ - stp1_29 = stp2_29; \ - stp1_30 = stp2_30; \ - stp1_31 = stp2_31; \ -} - - -#define IDCT32 \ -/* Stage1 */ \ -{ \ - const __m128i lo_1_31 = _mm_unpacklo_epi16(in[1], in[31]); \ - const __m128i hi_1_31 = _mm_unpackhi_epi16(in[1], in[31]); \ - const __m128i lo_17_15 = _mm_unpacklo_epi16(in[17], in[15]); \ - const __m128i hi_17_15 = _mm_unpackhi_epi16(in[17], in[15]); \ - \ - const __m128i lo_9_23 = _mm_unpacklo_epi16(in[9], in[23]); \ - const __m128i hi_9_23 = _mm_unpackhi_epi16(in[9], in[23]); \ - const __m128i lo_25_7= _mm_unpacklo_epi16(in[25], in[7]); \ - const __m128i hi_25_7 = _mm_unpackhi_epi16(in[25], in[7]); \ - \ - const __m128i lo_5_27 = _mm_unpacklo_epi16(in[5], in[27]); \ - const __m128i hi_5_27 = _mm_unpackhi_epi16(in[5], in[27]); \ - const __m128i lo_21_11 = _mm_unpacklo_epi16(in[21], in[11]); \ - const __m128i hi_21_11 = _mm_unpackhi_epi16(in[21], in[11]); \ - \ - const __m128i lo_13_19 = _mm_unpacklo_epi16(in[13], in[19]); \ - const __m128i hi_13_19 = _mm_unpackhi_epi16(in[13], in[19]); \ - const __m128i lo_29_3 = _mm_unpacklo_epi16(in[29], in[3]); \ - const __m128i hi_29_3 = _mm_unpackhi_epi16(in[29], in[3]); \ - \ - MULTIPLICATION_AND_ADD(lo_1_31, hi_1_31, lo_17_15, hi_17_15, stg1_0, \ - stg1_1, stg1_2, stg1_3, stp1_16, stp1_31, \ - stp1_17, stp1_30) \ - MULTIPLICATION_AND_ADD(lo_9_23, hi_9_23, lo_25_7, hi_25_7, stg1_4, \ - stg1_5, stg1_6, stg1_7, stp1_18, stp1_29, \ - stp1_19, stp1_28) \ - MULTIPLICATION_AND_ADD(lo_5_27, hi_5_27, lo_21_11, hi_21_11, stg1_8, \ - stg1_9, stg1_10, stg1_11, stp1_20, stp1_27, \ - stp1_21, stp1_26) \ - MULTIPLICATION_AND_ADD(lo_13_19, hi_13_19, lo_29_3, hi_29_3, stg1_12, \ - stg1_13, stg1_14, stg1_15, stp1_22, stp1_25, \ - stp1_23, stp1_24) \ -} \ -\ -/* Stage2 */ \ -{ \ - const __m128i lo_2_30 = _mm_unpacklo_epi16(in[2], in[30]); \ - const __m128i hi_2_30 = _mm_unpackhi_epi16(in[2], in[30]); \ - const __m128i lo_18_14 = _mm_unpacklo_epi16(in[18], in[14]); \ - const __m128i hi_18_14 = _mm_unpackhi_epi16(in[18], in[14]); \ - \ - const __m128i lo_10_22 = _mm_unpacklo_epi16(in[10], in[22]); \ - const __m128i hi_10_22 = _mm_unpackhi_epi16(in[10], in[22]); \ - const __m128i lo_26_6 = _mm_unpacklo_epi16(in[26], in[6]); \ - const __m128i hi_26_6 = _mm_unpackhi_epi16(in[26], in[6]); \ - \ - MULTIPLICATION_AND_ADD(lo_2_30, hi_2_30, lo_18_14, hi_18_14, stg2_0, \ - stg2_1, stg2_2, stg2_3, stp2_8, stp2_15, stp2_9, \ - stp2_14) \ - MULTIPLICATION_AND_ADD(lo_10_22, hi_10_22, lo_26_6, hi_26_6, stg2_4, \ - stg2_5, stg2_6, stg2_7, stp2_10, stp2_13, \ - stp2_11, stp2_12) \ - \ - stp2_16 = _mm_add_epi16(stp1_16, stp1_17); \ - stp2_17 = _mm_sub_epi16(stp1_16, stp1_17); \ - stp2_18 = _mm_sub_epi16(stp1_19, stp1_18); \ - stp2_19 = _mm_add_epi16(stp1_19, stp1_18); \ - \ - stp2_20 = _mm_add_epi16(stp1_20, stp1_21); \ - stp2_21 = _mm_sub_epi16(stp1_20, stp1_21); \ - stp2_22 = _mm_sub_epi16(stp1_23, stp1_22); \ - stp2_23 = _mm_add_epi16(stp1_23, stp1_22); \ - \ - stp2_24 = _mm_add_epi16(stp1_24, stp1_25); \ - stp2_25 = _mm_sub_epi16(stp1_24, stp1_25); \ - stp2_26 = _mm_sub_epi16(stp1_27, stp1_26); \ - stp2_27 = _mm_add_epi16(stp1_27, stp1_26); \ - \ - stp2_28 = _mm_add_epi16(stp1_28, stp1_29); \ - stp2_29 = _mm_sub_epi16(stp1_28, stp1_29); \ - stp2_30 = _mm_sub_epi16(stp1_31, stp1_30); \ - stp2_31 = _mm_add_epi16(stp1_31, stp1_30); \ -} \ -\ -/* Stage3 */ \ -{ \ - const __m128i lo_4_28 = _mm_unpacklo_epi16(in[4], in[28]); \ - const __m128i hi_4_28 = _mm_unpackhi_epi16(in[4], in[28]); \ - const __m128i lo_20_12 = _mm_unpacklo_epi16(in[20], in[12]); \ - const __m128i hi_20_12 = _mm_unpackhi_epi16(in[20], in[12]); \ - \ - const __m128i lo_17_30 = _mm_unpacklo_epi16(stp2_17, stp2_30); \ - const __m128i hi_17_30 = _mm_unpackhi_epi16(stp2_17, stp2_30); \ - const __m128i lo_18_29 = _mm_unpacklo_epi16(stp2_18, stp2_29); \ - const __m128i hi_18_29 = _mm_unpackhi_epi16(stp2_18, stp2_29); \ - \ - const __m128i lo_21_26 = _mm_unpacklo_epi16(stp2_21, stp2_26); \ - const __m128i hi_21_26 = _mm_unpackhi_epi16(stp2_21, stp2_26); \ - const __m128i lo_22_25 = _mm_unpacklo_epi16(stp2_22, stp2_25); \ - const __m128i hi_22_25 = _mm_unpackhi_epi16(stp2_22, stp2_25); \ - \ - MULTIPLICATION_AND_ADD(lo_4_28, hi_4_28, lo_20_12, hi_20_12, stg3_0, \ - stg3_1, stg3_2, stg3_3, stp1_4, stp1_7, stp1_5, \ - stp1_6) \ - \ - stp1_8 = _mm_add_epi16(stp2_8, stp2_9); \ - stp1_9 = _mm_sub_epi16(stp2_8, stp2_9); \ - stp1_10 = _mm_sub_epi16(stp2_11, stp2_10); \ - stp1_11 = _mm_add_epi16(stp2_11, stp2_10); \ - stp1_12 = _mm_add_epi16(stp2_12, stp2_13); \ - stp1_13 = _mm_sub_epi16(stp2_12, stp2_13); \ - stp1_14 = _mm_sub_epi16(stp2_15, stp2_14); \ - stp1_15 = _mm_add_epi16(stp2_15, stp2_14); \ - \ - MULTIPLICATION_AND_ADD(lo_17_30, hi_17_30, lo_18_29, hi_18_29, stg3_4, \ - stg3_5, stg3_6, stg3_4, stp1_17, stp1_30, \ - stp1_18, stp1_29) \ - MULTIPLICATION_AND_ADD(lo_21_26, hi_21_26, lo_22_25, hi_22_25, stg3_8, \ - stg3_9, stg3_10, stg3_8, stp1_21, stp1_26, \ - stp1_22, stp1_25) \ - \ - stp1_16 = stp2_16; \ - stp1_31 = stp2_31; \ - stp1_19 = stp2_19; \ - stp1_20 = stp2_20; \ - stp1_23 = stp2_23; \ - stp1_24 = stp2_24; \ - stp1_27 = stp2_27; \ - stp1_28 = stp2_28; \ -} \ -\ -/* Stage4 */ \ -{ \ - const __m128i lo_0_16 = _mm_unpacklo_epi16(in[0], in[16]); \ - const __m128i hi_0_16 = _mm_unpackhi_epi16(in[0], in[16]); \ - const __m128i lo_8_24 = _mm_unpacklo_epi16(in[8], in[24]); \ - const __m128i hi_8_24 = _mm_unpackhi_epi16(in[8], in[24]); \ - \ - const __m128i lo_9_14 = _mm_unpacklo_epi16(stp1_9, stp1_14); \ - const __m128i hi_9_14 = _mm_unpackhi_epi16(stp1_9, stp1_14); \ - const __m128i lo_10_13 = _mm_unpacklo_epi16(stp1_10, stp1_13); \ - const __m128i hi_10_13 = _mm_unpackhi_epi16(stp1_10, stp1_13); \ - \ - MULTIPLICATION_AND_ADD(lo_0_16, hi_0_16, lo_8_24, hi_8_24, stg4_0, \ - stg4_1, stg4_2, stg4_3, stp2_0, stp2_1, \ - stp2_2, stp2_3) \ - \ - stp2_4 = _mm_add_epi16(stp1_4, stp1_5); \ - stp2_5 = _mm_sub_epi16(stp1_4, stp1_5); \ - stp2_6 = _mm_sub_epi16(stp1_7, stp1_6); \ - stp2_7 = _mm_add_epi16(stp1_7, stp1_6); \ - \ - MULTIPLICATION_AND_ADD(lo_9_14, hi_9_14, lo_10_13, hi_10_13, stg4_4, \ - stg4_5, stg4_6, stg4_4, stp2_9, stp2_14, \ - stp2_10, stp2_13) \ - \ - stp2_8 = stp1_8; \ - stp2_15 = stp1_15; \ - stp2_11 = stp1_11; \ - stp2_12 = stp1_12; \ - \ - stp2_16 = _mm_add_epi16(stp1_16, stp1_19); \ - stp2_17 = _mm_add_epi16(stp1_17, stp1_18); \ - stp2_18 = _mm_sub_epi16(stp1_17, stp1_18); \ - stp2_19 = _mm_sub_epi16(stp1_16, stp1_19); \ - stp2_20 = _mm_sub_epi16(stp1_23, stp1_20); \ - stp2_21 = _mm_sub_epi16(stp1_22, stp1_21); \ - stp2_22 = _mm_add_epi16(stp1_22, stp1_21); \ - stp2_23 = _mm_add_epi16(stp1_23, stp1_20); \ - \ - stp2_24 = _mm_add_epi16(stp1_24, stp1_27); \ - stp2_25 = _mm_add_epi16(stp1_25, stp1_26); \ - stp2_26 = _mm_sub_epi16(stp1_25, stp1_26); \ - stp2_27 = _mm_sub_epi16(stp1_24, stp1_27); \ - stp2_28 = _mm_sub_epi16(stp1_31, stp1_28); \ - stp2_29 = _mm_sub_epi16(stp1_30, stp1_29); \ - stp2_30 = _mm_add_epi16(stp1_29, stp1_30); \ - stp2_31 = _mm_add_epi16(stp1_28, stp1_31); \ -} \ -\ -/* Stage5 */ \ -{ \ - const __m128i lo_6_5 = _mm_unpacklo_epi16(stp2_6, stp2_5); \ - const __m128i hi_6_5 = _mm_unpackhi_epi16(stp2_6, stp2_5); \ - const __m128i lo_18_29 = _mm_unpacklo_epi16(stp2_18, stp2_29); \ - const __m128i hi_18_29 = _mm_unpackhi_epi16(stp2_18, stp2_29); \ - \ - const __m128i lo_19_28 = _mm_unpacklo_epi16(stp2_19, stp2_28); \ - const __m128i hi_19_28 = _mm_unpackhi_epi16(stp2_19, stp2_28); \ - const __m128i lo_20_27 = _mm_unpacklo_epi16(stp2_20, stp2_27); \ - const __m128i hi_20_27 = _mm_unpackhi_epi16(stp2_20, stp2_27); \ - \ - const __m128i lo_21_26 = _mm_unpacklo_epi16(stp2_21, stp2_26); \ - const __m128i hi_21_26 = _mm_unpackhi_epi16(stp2_21, stp2_26); \ - \ - stp1_0 = _mm_add_epi16(stp2_0, stp2_3); \ - stp1_1 = _mm_add_epi16(stp2_1, stp2_2); \ - stp1_2 = _mm_sub_epi16(stp2_1, stp2_2); \ - stp1_3 = _mm_sub_epi16(stp2_0, stp2_3); \ - \ - tmp0 = _mm_madd_epi16(lo_6_5, stg4_1); \ - tmp1 = _mm_madd_epi16(hi_6_5, stg4_1); \ - tmp2 = _mm_madd_epi16(lo_6_5, stg4_0); \ - tmp3 = _mm_madd_epi16(hi_6_5, stg4_0); \ - \ - tmp0 = _mm_add_epi32(tmp0, rounding); \ - tmp1 = _mm_add_epi32(tmp1, rounding); \ - tmp2 = _mm_add_epi32(tmp2, rounding); \ - tmp3 = _mm_add_epi32(tmp3, rounding); \ - \ - tmp0 = _mm_srai_epi32(tmp0, DCT_CONST_BITS); \ - tmp1 = _mm_srai_epi32(tmp1, DCT_CONST_BITS); \ - tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS); \ - tmp3 = _mm_srai_epi32(tmp3, DCT_CONST_BITS); \ - \ - stp1_5 = _mm_packs_epi32(tmp0, tmp1); \ - stp1_6 = _mm_packs_epi32(tmp2, tmp3); \ - \ - stp1_4 = stp2_4; \ - stp1_7 = stp2_7; \ - \ - stp1_8 = _mm_add_epi16(stp2_8, stp2_11); \ - stp1_9 = _mm_add_epi16(stp2_9, stp2_10); \ - stp1_10 = _mm_sub_epi16(stp2_9, stp2_10); \ - stp1_11 = _mm_sub_epi16(stp2_8, stp2_11); \ - stp1_12 = _mm_sub_epi16(stp2_15, stp2_12); \ - stp1_13 = _mm_sub_epi16(stp2_14, stp2_13); \ - stp1_14 = _mm_add_epi16(stp2_14, stp2_13); \ - stp1_15 = _mm_add_epi16(stp2_15, stp2_12); \ - \ - stp1_16 = stp2_16; \ - stp1_17 = stp2_17; \ - \ - MULTIPLICATION_AND_ADD(lo_18_29, hi_18_29, lo_19_28, hi_19_28, stg4_4, \ - stg4_5, stg4_4, stg4_5, stp1_18, stp1_29, \ - stp1_19, stp1_28) \ - MULTIPLICATION_AND_ADD(lo_20_27, hi_20_27, lo_21_26, hi_21_26, stg4_6, \ - stg4_4, stg4_6, stg4_4, stp1_20, stp1_27, \ - stp1_21, stp1_26) \ - \ - stp1_22 = stp2_22; \ - stp1_23 = stp2_23; \ - stp1_24 = stp2_24; \ - stp1_25 = stp2_25; \ - stp1_30 = stp2_30; \ - stp1_31 = stp2_31; \ -} \ -\ -/* Stage6 */ \ -{ \ - const __m128i lo_10_13 = _mm_unpacklo_epi16(stp1_10, stp1_13); \ - const __m128i hi_10_13 = _mm_unpackhi_epi16(stp1_10, stp1_13); \ - const __m128i lo_11_12 = _mm_unpacklo_epi16(stp1_11, stp1_12); \ - const __m128i hi_11_12 = _mm_unpackhi_epi16(stp1_11, stp1_12); \ - \ - stp2_0 = _mm_add_epi16(stp1_0, stp1_7); \ - stp2_1 = _mm_add_epi16(stp1_1, stp1_6); \ - stp2_2 = _mm_add_epi16(stp1_2, stp1_5); \ - stp2_3 = _mm_add_epi16(stp1_3, stp1_4); \ - stp2_4 = _mm_sub_epi16(stp1_3, stp1_4); \ - stp2_5 = _mm_sub_epi16(stp1_2, stp1_5); \ - stp2_6 = _mm_sub_epi16(stp1_1, stp1_6); \ - stp2_7 = _mm_sub_epi16(stp1_0, stp1_7); \ - \ - stp2_8 = stp1_8; \ - stp2_9 = stp1_9; \ - stp2_14 = stp1_14; \ - stp2_15 = stp1_15; \ - \ - MULTIPLICATION_AND_ADD(lo_10_13, hi_10_13, lo_11_12, hi_11_12, \ - stg6_0, stg4_0, stg6_0, stg4_0, stp2_10, \ - stp2_13, stp2_11, stp2_12) \ - \ - stp2_16 = _mm_add_epi16(stp1_16, stp1_23); \ - stp2_17 = _mm_add_epi16(stp1_17, stp1_22); \ - stp2_18 = _mm_add_epi16(stp1_18, stp1_21); \ - stp2_19 = _mm_add_epi16(stp1_19, stp1_20); \ - stp2_20 = _mm_sub_epi16(stp1_19, stp1_20); \ - stp2_21 = _mm_sub_epi16(stp1_18, stp1_21); \ - stp2_22 = _mm_sub_epi16(stp1_17, stp1_22); \ - stp2_23 = _mm_sub_epi16(stp1_16, stp1_23); \ - \ - stp2_24 = _mm_sub_epi16(stp1_31, stp1_24); \ - stp2_25 = _mm_sub_epi16(stp1_30, stp1_25); \ - stp2_26 = _mm_sub_epi16(stp1_29, stp1_26); \ - stp2_27 = _mm_sub_epi16(stp1_28, stp1_27); \ - stp2_28 = _mm_add_epi16(stp1_27, stp1_28); \ - stp2_29 = _mm_add_epi16(stp1_26, stp1_29); \ - stp2_30 = _mm_add_epi16(stp1_25, stp1_30); \ - stp2_31 = _mm_add_epi16(stp1_24, stp1_31); \ -} \ -\ -/* Stage7 */ \ -{ \ - const __m128i lo_20_27 = _mm_unpacklo_epi16(stp2_20, stp2_27); \ - const __m128i hi_20_27 = _mm_unpackhi_epi16(stp2_20, stp2_27); \ - const __m128i lo_21_26 = _mm_unpacklo_epi16(stp2_21, stp2_26); \ - const __m128i hi_21_26 = _mm_unpackhi_epi16(stp2_21, stp2_26); \ - \ - const __m128i lo_22_25 = _mm_unpacklo_epi16(stp2_22, stp2_25); \ - const __m128i hi_22_25 = _mm_unpackhi_epi16(stp2_22, stp2_25); \ - const __m128i lo_23_24 = _mm_unpacklo_epi16(stp2_23, stp2_24); \ - const __m128i hi_23_24 = _mm_unpackhi_epi16(stp2_23, stp2_24); \ - \ - stp1_0 = _mm_add_epi16(stp2_0, stp2_15); \ - stp1_1 = _mm_add_epi16(stp2_1, stp2_14); \ - stp1_2 = _mm_add_epi16(stp2_2, stp2_13); \ - stp1_3 = _mm_add_epi16(stp2_3, stp2_12); \ - stp1_4 = _mm_add_epi16(stp2_4, stp2_11); \ - stp1_5 = _mm_add_epi16(stp2_5, stp2_10); \ - stp1_6 = _mm_add_epi16(stp2_6, stp2_9); \ - stp1_7 = _mm_add_epi16(stp2_7, stp2_8); \ - stp1_8 = _mm_sub_epi16(stp2_7, stp2_8); \ - stp1_9 = _mm_sub_epi16(stp2_6, stp2_9); \ - stp1_10 = _mm_sub_epi16(stp2_5, stp2_10); \ - stp1_11 = _mm_sub_epi16(stp2_4, stp2_11); \ - stp1_12 = _mm_sub_epi16(stp2_3, stp2_12); \ - stp1_13 = _mm_sub_epi16(stp2_2, stp2_13); \ - stp1_14 = _mm_sub_epi16(stp2_1, stp2_14); \ - stp1_15 = _mm_sub_epi16(stp2_0, stp2_15); \ - \ - stp1_16 = stp2_16; \ - stp1_17 = stp2_17; \ - stp1_18 = stp2_18; \ - stp1_19 = stp2_19; \ - \ - MULTIPLICATION_AND_ADD(lo_20_27, hi_20_27, lo_21_26, hi_21_26, stg6_0, \ - stg4_0, stg6_0, stg4_0, stp1_20, stp1_27, \ - stp1_21, stp1_26) \ - MULTIPLICATION_AND_ADD(lo_22_25, hi_22_25, lo_23_24, hi_23_24, stg6_0, \ - stg4_0, stg6_0, stg4_0, stp1_22, stp1_25, \ - stp1_23, stp1_24) \ - \ - stp1_28 = stp2_28; \ - stp1_29 = stp2_29; \ - stp1_30 = stp2_30; \ - stp1_31 = stp2_31; \ -} - -// Only upper-left 8x8 has non-zero coeff -void vp9_idct32x32_34_add_sse2(const int16_t *input, uint8_t *dest, - int stride) { - const __m128i rounding = _mm_set1_epi32(DCT_CONST_ROUNDING); - const __m128i final_rounding = _mm_set1_epi16(1<<5); - - // idct constants for each stage - const __m128i stg1_0 = pair_set_epi16(cospi_31_64, -cospi_1_64); - const __m128i stg1_1 = pair_set_epi16(cospi_1_64, cospi_31_64); - const __m128i stg1_2 = pair_set_epi16(cospi_15_64, -cospi_17_64); - const __m128i stg1_3 = pair_set_epi16(cospi_17_64, cospi_15_64); - const __m128i stg1_4 = pair_set_epi16(cospi_23_64, -cospi_9_64); - const __m128i stg1_5 = pair_set_epi16(cospi_9_64, cospi_23_64); - const __m128i stg1_6 = pair_set_epi16(cospi_7_64, -cospi_25_64); - const __m128i stg1_7 = pair_set_epi16(cospi_25_64, cospi_7_64); - const __m128i stg1_8 = pair_set_epi16(cospi_27_64, -cospi_5_64); - const __m128i stg1_9 = pair_set_epi16(cospi_5_64, cospi_27_64); - const __m128i stg1_10 = pair_set_epi16(cospi_11_64, -cospi_21_64); - const __m128i stg1_11 = pair_set_epi16(cospi_21_64, cospi_11_64); - const __m128i stg1_12 = pair_set_epi16(cospi_19_64, -cospi_13_64); - const __m128i stg1_13 = pair_set_epi16(cospi_13_64, cospi_19_64); - const __m128i stg1_14 = pair_set_epi16(cospi_3_64, -cospi_29_64); - const __m128i stg1_15 = pair_set_epi16(cospi_29_64, cospi_3_64); - - const __m128i stg2_0 = pair_set_epi16(cospi_30_64, -cospi_2_64); - const __m128i stg2_1 = pair_set_epi16(cospi_2_64, cospi_30_64); - const __m128i stg2_2 = pair_set_epi16(cospi_14_64, -cospi_18_64); - const __m128i stg2_3 = pair_set_epi16(cospi_18_64, cospi_14_64); - const __m128i stg2_4 = pair_set_epi16(cospi_22_64, -cospi_10_64); - const __m128i stg2_5 = pair_set_epi16(cospi_10_64, cospi_22_64); - const __m128i stg2_6 = pair_set_epi16(cospi_6_64, -cospi_26_64); - const __m128i stg2_7 = pair_set_epi16(cospi_26_64, cospi_6_64); - - const __m128i stg3_0 = pair_set_epi16(cospi_28_64, -cospi_4_64); - const __m128i stg3_1 = pair_set_epi16(cospi_4_64, cospi_28_64); - const __m128i stg3_2 = pair_set_epi16(cospi_12_64, -cospi_20_64); - const __m128i stg3_3 = pair_set_epi16(cospi_20_64, cospi_12_64); - const __m128i stg3_4 = pair_set_epi16(-cospi_4_64, cospi_28_64); - const __m128i stg3_5 = pair_set_epi16(cospi_28_64, cospi_4_64); - const __m128i stg3_6 = pair_set_epi16(-cospi_28_64, -cospi_4_64); - const __m128i stg3_8 = pair_set_epi16(-cospi_20_64, cospi_12_64); - const __m128i stg3_9 = pair_set_epi16(cospi_12_64, cospi_20_64); - const __m128i stg3_10 = pair_set_epi16(-cospi_12_64, -cospi_20_64); - - const __m128i stg4_0 = pair_set_epi16(cospi_16_64, cospi_16_64); - const __m128i stg4_1 = pair_set_epi16(cospi_16_64, -cospi_16_64); - const __m128i stg4_2 = pair_set_epi16(cospi_24_64, -cospi_8_64); - const __m128i stg4_3 = pair_set_epi16(cospi_8_64, cospi_24_64); - const __m128i stg4_4 = pair_set_epi16(-cospi_8_64, cospi_24_64); - const __m128i stg4_5 = pair_set_epi16(cospi_24_64, cospi_8_64); - const __m128i stg4_6 = pair_set_epi16(-cospi_24_64, -cospi_8_64); - - const __m128i stg6_0 = pair_set_epi16(-cospi_16_64, cospi_16_64); - - __m128i in[32], col[32]; - __m128i stp1_0, stp1_1, stp1_2, stp1_3, stp1_4, stp1_5, stp1_6, stp1_7, - stp1_8, stp1_9, stp1_10, stp1_11, stp1_12, stp1_13, stp1_14, stp1_15, - stp1_16, stp1_17, stp1_18, stp1_19, stp1_20, stp1_21, stp1_22, - stp1_23, stp1_24, stp1_25, stp1_26, stp1_27, stp1_28, stp1_29, - stp1_30, stp1_31; - __m128i stp2_0, stp2_1, stp2_2, stp2_3, stp2_4, stp2_5, stp2_6, stp2_7, - stp2_8, stp2_9, stp2_10, stp2_11, stp2_12, stp2_13, stp2_14, stp2_15, - stp2_16, stp2_17, stp2_18, stp2_19, stp2_20, stp2_21, stp2_22, - stp2_23, stp2_24, stp2_25, stp2_26, stp2_27, stp2_28, stp2_29, - stp2_30, stp2_31; - __m128i tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - int i; - // Load input data. - LOAD_DQCOEFF(in[0], input); - LOAD_DQCOEFF(in[8], input); - LOAD_DQCOEFF(in[16], input); - LOAD_DQCOEFF(in[24], input); - LOAD_DQCOEFF(in[1], input); - LOAD_DQCOEFF(in[9], input); - LOAD_DQCOEFF(in[17], input); - LOAD_DQCOEFF(in[25], input); - LOAD_DQCOEFF(in[2], input); - LOAD_DQCOEFF(in[10], input); - LOAD_DQCOEFF(in[18], input); - LOAD_DQCOEFF(in[26], input); - LOAD_DQCOEFF(in[3], input); - LOAD_DQCOEFF(in[11], input); - LOAD_DQCOEFF(in[19], input); - LOAD_DQCOEFF(in[27], input); - - LOAD_DQCOEFF(in[4], input); - LOAD_DQCOEFF(in[12], input); - LOAD_DQCOEFF(in[20], input); - LOAD_DQCOEFF(in[28], input); - LOAD_DQCOEFF(in[5], input); - LOAD_DQCOEFF(in[13], input); - LOAD_DQCOEFF(in[21], input); - LOAD_DQCOEFF(in[29], input); - LOAD_DQCOEFF(in[6], input); - LOAD_DQCOEFF(in[14], input); - LOAD_DQCOEFF(in[22], input); - LOAD_DQCOEFF(in[30], input); - LOAD_DQCOEFF(in[7], input); - LOAD_DQCOEFF(in[15], input); - LOAD_DQCOEFF(in[23], input); - LOAD_DQCOEFF(in[31], input); - - array_transpose_8x8(in, in); - array_transpose_8x8(in+8, in+8); - array_transpose_8x8(in+16, in+16); - array_transpose_8x8(in+24, in+24); - - IDCT32 - - // 1_D: Store 32 intermediate results for each 8x32 block. - col[0] = _mm_add_epi16(stp1_0, stp1_31); - col[1] = _mm_add_epi16(stp1_1, stp1_30); - col[2] = _mm_add_epi16(stp1_2, stp1_29); - col[3] = _mm_add_epi16(stp1_3, stp1_28); - col[4] = _mm_add_epi16(stp1_4, stp1_27); - col[5] = _mm_add_epi16(stp1_5, stp1_26); - col[6] = _mm_add_epi16(stp1_6, stp1_25); - col[7] = _mm_add_epi16(stp1_7, stp1_24); - col[8] = _mm_add_epi16(stp1_8, stp1_23); - col[9] = _mm_add_epi16(stp1_9, stp1_22); - col[10] = _mm_add_epi16(stp1_10, stp1_21); - col[11] = _mm_add_epi16(stp1_11, stp1_20); - col[12] = _mm_add_epi16(stp1_12, stp1_19); - col[13] = _mm_add_epi16(stp1_13, stp1_18); - col[14] = _mm_add_epi16(stp1_14, stp1_17); - col[15] = _mm_add_epi16(stp1_15, stp1_16); - col[16] = _mm_sub_epi16(stp1_15, stp1_16); - col[17] = _mm_sub_epi16(stp1_14, stp1_17); - col[18] = _mm_sub_epi16(stp1_13, stp1_18); - col[19] = _mm_sub_epi16(stp1_12, stp1_19); - col[20] = _mm_sub_epi16(stp1_11, stp1_20); - col[21] = _mm_sub_epi16(stp1_10, stp1_21); - col[22] = _mm_sub_epi16(stp1_9, stp1_22); - col[23] = _mm_sub_epi16(stp1_8, stp1_23); - col[24] = _mm_sub_epi16(stp1_7, stp1_24); - col[25] = _mm_sub_epi16(stp1_6, stp1_25); - col[26] = _mm_sub_epi16(stp1_5, stp1_26); - col[27] = _mm_sub_epi16(stp1_4, stp1_27); - col[28] = _mm_sub_epi16(stp1_3, stp1_28); - col[29] = _mm_sub_epi16(stp1_2, stp1_29); - col[30] = _mm_sub_epi16(stp1_1, stp1_30); - col[31] = _mm_sub_epi16(stp1_0, stp1_31); - for (i = 0; i < 4; i++) { - const __m128i zero = _mm_setzero_si128(); - // Transpose 32x8 block to 8x32 block - array_transpose_8x8(col+i*8, in); - IDCT32_34 - - // 2_D: Calculate the results and store them to destination. - in[0] = _mm_add_epi16(stp1_0, stp1_31); - in[1] = _mm_add_epi16(stp1_1, stp1_30); - in[2] = _mm_add_epi16(stp1_2, stp1_29); - in[3] = _mm_add_epi16(stp1_3, stp1_28); - in[4] = _mm_add_epi16(stp1_4, stp1_27); - in[5] = _mm_add_epi16(stp1_5, stp1_26); - in[6] = _mm_add_epi16(stp1_6, stp1_25); - in[7] = _mm_add_epi16(stp1_7, stp1_24); - in[8] = _mm_add_epi16(stp1_8, stp1_23); - in[9] = _mm_add_epi16(stp1_9, stp1_22); - in[10] = _mm_add_epi16(stp1_10, stp1_21); - in[11] = _mm_add_epi16(stp1_11, stp1_20); - in[12] = _mm_add_epi16(stp1_12, stp1_19); - in[13] = _mm_add_epi16(stp1_13, stp1_18); - in[14] = _mm_add_epi16(stp1_14, stp1_17); - in[15] = _mm_add_epi16(stp1_15, stp1_16); - in[16] = _mm_sub_epi16(stp1_15, stp1_16); - in[17] = _mm_sub_epi16(stp1_14, stp1_17); - in[18] = _mm_sub_epi16(stp1_13, stp1_18); - in[19] = _mm_sub_epi16(stp1_12, stp1_19); - in[20] = _mm_sub_epi16(stp1_11, stp1_20); - in[21] = _mm_sub_epi16(stp1_10, stp1_21); - in[22] = _mm_sub_epi16(stp1_9, stp1_22); - in[23] = _mm_sub_epi16(stp1_8, stp1_23); - in[24] = _mm_sub_epi16(stp1_7, stp1_24); - in[25] = _mm_sub_epi16(stp1_6, stp1_25); - in[26] = _mm_sub_epi16(stp1_5, stp1_26); - in[27] = _mm_sub_epi16(stp1_4, stp1_27); - in[28] = _mm_sub_epi16(stp1_3, stp1_28); - in[29] = _mm_sub_epi16(stp1_2, stp1_29); - in[30] = _mm_sub_epi16(stp1_1, stp1_30); - in[31] = _mm_sub_epi16(stp1_0, stp1_31); - - // Final rounding and shift - in[0] = _mm_adds_epi16(in[0], final_rounding); - in[1] = _mm_adds_epi16(in[1], final_rounding); - in[2] = _mm_adds_epi16(in[2], final_rounding); - in[3] = _mm_adds_epi16(in[3], final_rounding); - in[4] = _mm_adds_epi16(in[4], final_rounding); - in[5] = _mm_adds_epi16(in[5], final_rounding); - in[6] = _mm_adds_epi16(in[6], final_rounding); - in[7] = _mm_adds_epi16(in[7], final_rounding); - in[8] = _mm_adds_epi16(in[8], final_rounding); - in[9] = _mm_adds_epi16(in[9], final_rounding); - in[10] = _mm_adds_epi16(in[10], final_rounding); - in[11] = _mm_adds_epi16(in[11], final_rounding); - in[12] = _mm_adds_epi16(in[12], final_rounding); - in[13] = _mm_adds_epi16(in[13], final_rounding); - in[14] = _mm_adds_epi16(in[14], final_rounding); - in[15] = _mm_adds_epi16(in[15], final_rounding); - in[16] = _mm_adds_epi16(in[16], final_rounding); - in[17] = _mm_adds_epi16(in[17], final_rounding); - in[18] = _mm_adds_epi16(in[18], final_rounding); - in[19] = _mm_adds_epi16(in[19], final_rounding); - in[20] = _mm_adds_epi16(in[20], final_rounding); - in[21] = _mm_adds_epi16(in[21], final_rounding); - in[22] = _mm_adds_epi16(in[22], final_rounding); - in[23] = _mm_adds_epi16(in[23], final_rounding); - in[24] = _mm_adds_epi16(in[24], final_rounding); - in[25] = _mm_adds_epi16(in[25], final_rounding); - in[26] = _mm_adds_epi16(in[26], final_rounding); - in[27] = _mm_adds_epi16(in[27], final_rounding); - in[28] = _mm_adds_epi16(in[28], final_rounding); - in[29] = _mm_adds_epi16(in[29], final_rounding); - in[30] = _mm_adds_epi16(in[30], final_rounding); - in[31] = _mm_adds_epi16(in[31], final_rounding); - - in[0] = _mm_srai_epi16(in[0], 6); - in[1] = _mm_srai_epi16(in[1], 6); - in[2] = _mm_srai_epi16(in[2], 6); - in[3] = _mm_srai_epi16(in[3], 6); - in[4] = _mm_srai_epi16(in[4], 6); - in[5] = _mm_srai_epi16(in[5], 6); - in[6] = _mm_srai_epi16(in[6], 6); - in[7] = _mm_srai_epi16(in[7], 6); - in[8] = _mm_srai_epi16(in[8], 6); - in[9] = _mm_srai_epi16(in[9], 6); - in[10] = _mm_srai_epi16(in[10], 6); - in[11] = _mm_srai_epi16(in[11], 6); - in[12] = _mm_srai_epi16(in[12], 6); - in[13] = _mm_srai_epi16(in[13], 6); - in[14] = _mm_srai_epi16(in[14], 6); - in[15] = _mm_srai_epi16(in[15], 6); - in[16] = _mm_srai_epi16(in[16], 6); - in[17] = _mm_srai_epi16(in[17], 6); - in[18] = _mm_srai_epi16(in[18], 6); - in[19] = _mm_srai_epi16(in[19], 6); - in[20] = _mm_srai_epi16(in[20], 6); - in[21] = _mm_srai_epi16(in[21], 6); - in[22] = _mm_srai_epi16(in[22], 6); - in[23] = _mm_srai_epi16(in[23], 6); - in[24] = _mm_srai_epi16(in[24], 6); - in[25] = _mm_srai_epi16(in[25], 6); - in[26] = _mm_srai_epi16(in[26], 6); - in[27] = _mm_srai_epi16(in[27], 6); - in[28] = _mm_srai_epi16(in[28], 6); - in[29] = _mm_srai_epi16(in[29], 6); - in[30] = _mm_srai_epi16(in[30], 6); - in[31] = _mm_srai_epi16(in[31], 6); - - RECON_AND_STORE(dest, in[0]); - RECON_AND_STORE(dest, in[1]); - RECON_AND_STORE(dest, in[2]); - RECON_AND_STORE(dest, in[3]); - RECON_AND_STORE(dest, in[4]); - RECON_AND_STORE(dest, in[5]); - RECON_AND_STORE(dest, in[6]); - RECON_AND_STORE(dest, in[7]); - RECON_AND_STORE(dest, in[8]); - RECON_AND_STORE(dest, in[9]); - RECON_AND_STORE(dest, in[10]); - RECON_AND_STORE(dest, in[11]); - RECON_AND_STORE(dest, in[12]); - RECON_AND_STORE(dest, in[13]); - RECON_AND_STORE(dest, in[14]); - RECON_AND_STORE(dest, in[15]); - RECON_AND_STORE(dest, in[16]); - RECON_AND_STORE(dest, in[17]); - RECON_AND_STORE(dest, in[18]); - RECON_AND_STORE(dest, in[19]); - RECON_AND_STORE(dest, in[20]); - RECON_AND_STORE(dest, in[21]); - RECON_AND_STORE(dest, in[22]); - RECON_AND_STORE(dest, in[23]); - RECON_AND_STORE(dest, in[24]); - RECON_AND_STORE(dest, in[25]); - RECON_AND_STORE(dest, in[26]); - RECON_AND_STORE(dest, in[27]); - RECON_AND_STORE(dest, in[28]); - RECON_AND_STORE(dest, in[29]); - RECON_AND_STORE(dest, in[30]); - RECON_AND_STORE(dest, in[31]); - - dest += 8 - (stride * 32); - } - } - -void vp9_idct32x32_1024_add_sse2(const int16_t *input, uint8_t *dest, - int stride) { - const __m128i rounding = _mm_set1_epi32(DCT_CONST_ROUNDING); - const __m128i final_rounding = _mm_set1_epi16(1<<5); - const __m128i zero = _mm_setzero_si128(); - - // idct constants for each stage - const __m128i stg1_0 = pair_set_epi16(cospi_31_64, -cospi_1_64); - const __m128i stg1_1 = pair_set_epi16(cospi_1_64, cospi_31_64); - const __m128i stg1_2 = pair_set_epi16(cospi_15_64, -cospi_17_64); - const __m128i stg1_3 = pair_set_epi16(cospi_17_64, cospi_15_64); - const __m128i stg1_4 = pair_set_epi16(cospi_23_64, -cospi_9_64); - const __m128i stg1_5 = pair_set_epi16(cospi_9_64, cospi_23_64); - const __m128i stg1_6 = pair_set_epi16(cospi_7_64, -cospi_25_64); - const __m128i stg1_7 = pair_set_epi16(cospi_25_64, cospi_7_64); - const __m128i stg1_8 = pair_set_epi16(cospi_27_64, -cospi_5_64); - const __m128i stg1_9 = pair_set_epi16(cospi_5_64, cospi_27_64); - const __m128i stg1_10 = pair_set_epi16(cospi_11_64, -cospi_21_64); - const __m128i stg1_11 = pair_set_epi16(cospi_21_64, cospi_11_64); - const __m128i stg1_12 = pair_set_epi16(cospi_19_64, -cospi_13_64); - const __m128i stg1_13 = pair_set_epi16(cospi_13_64, cospi_19_64); - const __m128i stg1_14 = pair_set_epi16(cospi_3_64, -cospi_29_64); - const __m128i stg1_15 = pair_set_epi16(cospi_29_64, cospi_3_64); - - const __m128i stg2_0 = pair_set_epi16(cospi_30_64, -cospi_2_64); - const __m128i stg2_1 = pair_set_epi16(cospi_2_64, cospi_30_64); - const __m128i stg2_2 = pair_set_epi16(cospi_14_64, -cospi_18_64); - const __m128i stg2_3 = pair_set_epi16(cospi_18_64, cospi_14_64); - const __m128i stg2_4 = pair_set_epi16(cospi_22_64, -cospi_10_64); - const __m128i stg2_5 = pair_set_epi16(cospi_10_64, cospi_22_64); - const __m128i stg2_6 = pair_set_epi16(cospi_6_64, -cospi_26_64); - const __m128i stg2_7 = pair_set_epi16(cospi_26_64, cospi_6_64); - - const __m128i stg3_0 = pair_set_epi16(cospi_28_64, -cospi_4_64); - const __m128i stg3_1 = pair_set_epi16(cospi_4_64, cospi_28_64); - const __m128i stg3_2 = pair_set_epi16(cospi_12_64, -cospi_20_64); - const __m128i stg3_3 = pair_set_epi16(cospi_20_64, cospi_12_64); - const __m128i stg3_4 = pair_set_epi16(-cospi_4_64, cospi_28_64); - const __m128i stg3_5 = pair_set_epi16(cospi_28_64, cospi_4_64); - const __m128i stg3_6 = pair_set_epi16(-cospi_28_64, -cospi_4_64); - const __m128i stg3_8 = pair_set_epi16(-cospi_20_64, cospi_12_64); - const __m128i stg3_9 = pair_set_epi16(cospi_12_64, cospi_20_64); - const __m128i stg3_10 = pair_set_epi16(-cospi_12_64, -cospi_20_64); - - const __m128i stg4_0 = pair_set_epi16(cospi_16_64, cospi_16_64); - const __m128i stg4_1 = pair_set_epi16(cospi_16_64, -cospi_16_64); - const __m128i stg4_2 = pair_set_epi16(cospi_24_64, -cospi_8_64); - const __m128i stg4_3 = pair_set_epi16(cospi_8_64, cospi_24_64); - const __m128i stg4_4 = pair_set_epi16(-cospi_8_64, cospi_24_64); - const __m128i stg4_5 = pair_set_epi16(cospi_24_64, cospi_8_64); - const __m128i stg4_6 = pair_set_epi16(-cospi_24_64, -cospi_8_64); - - const __m128i stg6_0 = pair_set_epi16(-cospi_16_64, cospi_16_64); - - __m128i in[32], col[128], zero_idx[16]; - __m128i stp1_0, stp1_1, stp1_2, stp1_3, stp1_4, stp1_5, stp1_6, stp1_7, - stp1_8, stp1_9, stp1_10, stp1_11, stp1_12, stp1_13, stp1_14, stp1_15, - stp1_16, stp1_17, stp1_18, stp1_19, stp1_20, stp1_21, stp1_22, - stp1_23, stp1_24, stp1_25, stp1_26, stp1_27, stp1_28, stp1_29, - stp1_30, stp1_31; - __m128i stp2_0, stp2_1, stp2_2, stp2_3, stp2_4, stp2_5, stp2_6, stp2_7, - stp2_8, stp2_9, stp2_10, stp2_11, stp2_12, stp2_13, stp2_14, stp2_15, - stp2_16, stp2_17, stp2_18, stp2_19, stp2_20, stp2_21, stp2_22, - stp2_23, stp2_24, stp2_25, stp2_26, stp2_27, stp2_28, stp2_29, - stp2_30, stp2_31; - __m128i tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - int i, j, i32; - - for (i = 0; i < 4; i++) { - i32 = (i << 5); - // First 1-D idct - // Load input data. - LOAD_DQCOEFF(in[0], input); - LOAD_DQCOEFF(in[8], input); - LOAD_DQCOEFF(in[16], input); - LOAD_DQCOEFF(in[24], input); - LOAD_DQCOEFF(in[1], input); - LOAD_DQCOEFF(in[9], input); - LOAD_DQCOEFF(in[17], input); - LOAD_DQCOEFF(in[25], input); - LOAD_DQCOEFF(in[2], input); - LOAD_DQCOEFF(in[10], input); - LOAD_DQCOEFF(in[18], input); - LOAD_DQCOEFF(in[26], input); - LOAD_DQCOEFF(in[3], input); - LOAD_DQCOEFF(in[11], input); - LOAD_DQCOEFF(in[19], input); - LOAD_DQCOEFF(in[27], input); - - LOAD_DQCOEFF(in[4], input); - LOAD_DQCOEFF(in[12], input); - LOAD_DQCOEFF(in[20], input); - LOAD_DQCOEFF(in[28], input); - LOAD_DQCOEFF(in[5], input); - LOAD_DQCOEFF(in[13], input); - LOAD_DQCOEFF(in[21], input); - LOAD_DQCOEFF(in[29], input); - LOAD_DQCOEFF(in[6], input); - LOAD_DQCOEFF(in[14], input); - LOAD_DQCOEFF(in[22], input); - LOAD_DQCOEFF(in[30], input); - LOAD_DQCOEFF(in[7], input); - LOAD_DQCOEFF(in[15], input); - LOAD_DQCOEFF(in[23], input); - LOAD_DQCOEFF(in[31], input); - - // checking if all entries are zero - zero_idx[0] = _mm_or_si128(in[0], in[1]); - zero_idx[1] = _mm_or_si128(in[2], in[3]); - zero_idx[2] = _mm_or_si128(in[4], in[5]); - zero_idx[3] = _mm_or_si128(in[6], in[7]); - zero_idx[4] = _mm_or_si128(in[8], in[9]); - zero_idx[5] = _mm_or_si128(in[10], in[11]); - zero_idx[6] = _mm_or_si128(in[12], in[13]); - zero_idx[7] = _mm_or_si128(in[14], in[15]); - zero_idx[8] = _mm_or_si128(in[16], in[17]); - zero_idx[9] = _mm_or_si128(in[18], in[19]); - zero_idx[10] = _mm_or_si128(in[20], in[21]); - zero_idx[11] = _mm_or_si128(in[22], in[23]); - zero_idx[12] = _mm_or_si128(in[24], in[25]); - zero_idx[13] = _mm_or_si128(in[26], in[27]); - zero_idx[14] = _mm_or_si128(in[28], in[29]); - zero_idx[15] = _mm_or_si128(in[30], in[31]); - - zero_idx[0] = _mm_or_si128(zero_idx[0], zero_idx[1]); - zero_idx[1] = _mm_or_si128(zero_idx[2], zero_idx[3]); - zero_idx[2] = _mm_or_si128(zero_idx[4], zero_idx[5]); - zero_idx[3] = _mm_or_si128(zero_idx[6], zero_idx[7]); - zero_idx[4] = _mm_or_si128(zero_idx[8], zero_idx[9]); - zero_idx[5] = _mm_or_si128(zero_idx[10], zero_idx[11]); - zero_idx[6] = _mm_or_si128(zero_idx[12], zero_idx[13]); - zero_idx[7] = _mm_or_si128(zero_idx[14], zero_idx[15]); - - zero_idx[8] = _mm_or_si128(zero_idx[0], zero_idx[1]); - zero_idx[9] = _mm_or_si128(zero_idx[2], zero_idx[3]); - zero_idx[10] = _mm_or_si128(zero_idx[4], zero_idx[5]); - zero_idx[11] = _mm_or_si128(zero_idx[6], zero_idx[7]); - zero_idx[12] = _mm_or_si128(zero_idx[8], zero_idx[9]); - zero_idx[13] = _mm_or_si128(zero_idx[10], zero_idx[11]); - zero_idx[14] = _mm_or_si128(zero_idx[12], zero_idx[13]); - - if (_mm_movemask_epi8(_mm_cmpeq_epi32(zero_idx[14], zero)) == 0xFFFF) { - col[i32 + 0] = _mm_setzero_si128(); - col[i32 + 1] = _mm_setzero_si128(); - col[i32 + 2] = _mm_setzero_si128(); - col[i32 + 3] = _mm_setzero_si128(); - col[i32 + 4] = _mm_setzero_si128(); - col[i32 + 5] = _mm_setzero_si128(); - col[i32 + 6] = _mm_setzero_si128(); - col[i32 + 7] = _mm_setzero_si128(); - col[i32 + 8] = _mm_setzero_si128(); - col[i32 + 9] = _mm_setzero_si128(); - col[i32 + 10] = _mm_setzero_si128(); - col[i32 + 11] = _mm_setzero_si128(); - col[i32 + 12] = _mm_setzero_si128(); - col[i32 + 13] = _mm_setzero_si128(); - col[i32 + 14] = _mm_setzero_si128(); - col[i32 + 15] = _mm_setzero_si128(); - col[i32 + 16] = _mm_setzero_si128(); - col[i32 + 17] = _mm_setzero_si128(); - col[i32 + 18] = _mm_setzero_si128(); - col[i32 + 19] = _mm_setzero_si128(); - col[i32 + 20] = _mm_setzero_si128(); - col[i32 + 21] = _mm_setzero_si128(); - col[i32 + 22] = _mm_setzero_si128(); - col[i32 + 23] = _mm_setzero_si128(); - col[i32 + 24] = _mm_setzero_si128(); - col[i32 + 25] = _mm_setzero_si128(); - col[i32 + 26] = _mm_setzero_si128(); - col[i32 + 27] = _mm_setzero_si128(); - col[i32 + 28] = _mm_setzero_si128(); - col[i32 + 29] = _mm_setzero_si128(); - col[i32 + 30] = _mm_setzero_si128(); - col[i32 + 31] = _mm_setzero_si128(); - continue; - } - - // Transpose 32x8 block to 8x32 block - array_transpose_8x8(in, in); - array_transpose_8x8(in+8, in+8); - array_transpose_8x8(in+16, in+16); - array_transpose_8x8(in+24, in+24); - - IDCT32 - - // 1_D: Store 32 intermediate results for each 8x32 block. - col[i32 + 0] = _mm_add_epi16(stp1_0, stp1_31); - col[i32 + 1] = _mm_add_epi16(stp1_1, stp1_30); - col[i32 + 2] = _mm_add_epi16(stp1_2, stp1_29); - col[i32 + 3] = _mm_add_epi16(stp1_3, stp1_28); - col[i32 + 4] = _mm_add_epi16(stp1_4, stp1_27); - col[i32 + 5] = _mm_add_epi16(stp1_5, stp1_26); - col[i32 + 6] = _mm_add_epi16(stp1_6, stp1_25); - col[i32 + 7] = _mm_add_epi16(stp1_7, stp1_24); - col[i32 + 8] = _mm_add_epi16(stp1_8, stp1_23); - col[i32 + 9] = _mm_add_epi16(stp1_9, stp1_22); - col[i32 + 10] = _mm_add_epi16(stp1_10, stp1_21); - col[i32 + 11] = _mm_add_epi16(stp1_11, stp1_20); - col[i32 + 12] = _mm_add_epi16(stp1_12, stp1_19); - col[i32 + 13] = _mm_add_epi16(stp1_13, stp1_18); - col[i32 + 14] = _mm_add_epi16(stp1_14, stp1_17); - col[i32 + 15] = _mm_add_epi16(stp1_15, stp1_16); - col[i32 + 16] = _mm_sub_epi16(stp1_15, stp1_16); - col[i32 + 17] = _mm_sub_epi16(stp1_14, stp1_17); - col[i32 + 18] = _mm_sub_epi16(stp1_13, stp1_18); - col[i32 + 19] = _mm_sub_epi16(stp1_12, stp1_19); - col[i32 + 20] = _mm_sub_epi16(stp1_11, stp1_20); - col[i32 + 21] = _mm_sub_epi16(stp1_10, stp1_21); - col[i32 + 22] = _mm_sub_epi16(stp1_9, stp1_22); - col[i32 + 23] = _mm_sub_epi16(stp1_8, stp1_23); - col[i32 + 24] = _mm_sub_epi16(stp1_7, stp1_24); - col[i32 + 25] = _mm_sub_epi16(stp1_6, stp1_25); - col[i32 + 26] = _mm_sub_epi16(stp1_5, stp1_26); - col[i32 + 27] = _mm_sub_epi16(stp1_4, stp1_27); - col[i32 + 28] = _mm_sub_epi16(stp1_3, stp1_28); - col[i32 + 29] = _mm_sub_epi16(stp1_2, stp1_29); - col[i32 + 30] = _mm_sub_epi16(stp1_1, stp1_30); - col[i32 + 31] = _mm_sub_epi16(stp1_0, stp1_31); - } - for (i = 0; i < 4; i++) { - // Second 1-D idct - j = i << 3; - - // Transpose 32x8 block to 8x32 block - array_transpose_8x8(col+j, in); - array_transpose_8x8(col+j+32, in+8); - array_transpose_8x8(col+j+64, in+16); - array_transpose_8x8(col+j+96, in+24); - - IDCT32 - - // 2_D: Calculate the results and store them to destination. - in[0] = _mm_add_epi16(stp1_0, stp1_31); - in[1] = _mm_add_epi16(stp1_1, stp1_30); - in[2] = _mm_add_epi16(stp1_2, stp1_29); - in[3] = _mm_add_epi16(stp1_3, stp1_28); - in[4] = _mm_add_epi16(stp1_4, stp1_27); - in[5] = _mm_add_epi16(stp1_5, stp1_26); - in[6] = _mm_add_epi16(stp1_6, stp1_25); - in[7] = _mm_add_epi16(stp1_7, stp1_24); - in[8] = _mm_add_epi16(stp1_8, stp1_23); - in[9] = _mm_add_epi16(stp1_9, stp1_22); - in[10] = _mm_add_epi16(stp1_10, stp1_21); - in[11] = _mm_add_epi16(stp1_11, stp1_20); - in[12] = _mm_add_epi16(stp1_12, stp1_19); - in[13] = _mm_add_epi16(stp1_13, stp1_18); - in[14] = _mm_add_epi16(stp1_14, stp1_17); - in[15] = _mm_add_epi16(stp1_15, stp1_16); - in[16] = _mm_sub_epi16(stp1_15, stp1_16); - in[17] = _mm_sub_epi16(stp1_14, stp1_17); - in[18] = _mm_sub_epi16(stp1_13, stp1_18); - in[19] = _mm_sub_epi16(stp1_12, stp1_19); - in[20] = _mm_sub_epi16(stp1_11, stp1_20); - in[21] = _mm_sub_epi16(stp1_10, stp1_21); - in[22] = _mm_sub_epi16(stp1_9, stp1_22); - in[23] = _mm_sub_epi16(stp1_8, stp1_23); - in[24] = _mm_sub_epi16(stp1_7, stp1_24); - in[25] = _mm_sub_epi16(stp1_6, stp1_25); - in[26] = _mm_sub_epi16(stp1_5, stp1_26); - in[27] = _mm_sub_epi16(stp1_4, stp1_27); - in[28] = _mm_sub_epi16(stp1_3, stp1_28); - in[29] = _mm_sub_epi16(stp1_2, stp1_29); - in[30] = _mm_sub_epi16(stp1_1, stp1_30); - in[31] = _mm_sub_epi16(stp1_0, stp1_31); - - // Final rounding and shift - in[0] = _mm_adds_epi16(in[0], final_rounding); - in[1] = _mm_adds_epi16(in[1], final_rounding); - in[2] = _mm_adds_epi16(in[2], final_rounding); - in[3] = _mm_adds_epi16(in[3], final_rounding); - in[4] = _mm_adds_epi16(in[4], final_rounding); - in[5] = _mm_adds_epi16(in[5], final_rounding); - in[6] = _mm_adds_epi16(in[6], final_rounding); - in[7] = _mm_adds_epi16(in[7], final_rounding); - in[8] = _mm_adds_epi16(in[8], final_rounding); - in[9] = _mm_adds_epi16(in[9], final_rounding); - in[10] = _mm_adds_epi16(in[10], final_rounding); - in[11] = _mm_adds_epi16(in[11], final_rounding); - in[12] = _mm_adds_epi16(in[12], final_rounding); - in[13] = _mm_adds_epi16(in[13], final_rounding); - in[14] = _mm_adds_epi16(in[14], final_rounding); - in[15] = _mm_adds_epi16(in[15], final_rounding); - in[16] = _mm_adds_epi16(in[16], final_rounding); - in[17] = _mm_adds_epi16(in[17], final_rounding); - in[18] = _mm_adds_epi16(in[18], final_rounding); - in[19] = _mm_adds_epi16(in[19], final_rounding); - in[20] = _mm_adds_epi16(in[20], final_rounding); - in[21] = _mm_adds_epi16(in[21], final_rounding); - in[22] = _mm_adds_epi16(in[22], final_rounding); - in[23] = _mm_adds_epi16(in[23], final_rounding); - in[24] = _mm_adds_epi16(in[24], final_rounding); - in[25] = _mm_adds_epi16(in[25], final_rounding); - in[26] = _mm_adds_epi16(in[26], final_rounding); - in[27] = _mm_adds_epi16(in[27], final_rounding); - in[28] = _mm_adds_epi16(in[28], final_rounding); - in[29] = _mm_adds_epi16(in[29], final_rounding); - in[30] = _mm_adds_epi16(in[30], final_rounding); - in[31] = _mm_adds_epi16(in[31], final_rounding); - - in[0] = _mm_srai_epi16(in[0], 6); - in[1] = _mm_srai_epi16(in[1], 6); - in[2] = _mm_srai_epi16(in[2], 6); - in[3] = _mm_srai_epi16(in[3], 6); - in[4] = _mm_srai_epi16(in[4], 6); - in[5] = _mm_srai_epi16(in[5], 6); - in[6] = _mm_srai_epi16(in[6], 6); - in[7] = _mm_srai_epi16(in[7], 6); - in[8] = _mm_srai_epi16(in[8], 6); - in[9] = _mm_srai_epi16(in[9], 6); - in[10] = _mm_srai_epi16(in[10], 6); - in[11] = _mm_srai_epi16(in[11], 6); - in[12] = _mm_srai_epi16(in[12], 6); - in[13] = _mm_srai_epi16(in[13], 6); - in[14] = _mm_srai_epi16(in[14], 6); - in[15] = _mm_srai_epi16(in[15], 6); - in[16] = _mm_srai_epi16(in[16], 6); - in[17] = _mm_srai_epi16(in[17], 6); - in[18] = _mm_srai_epi16(in[18], 6); - in[19] = _mm_srai_epi16(in[19], 6); - in[20] = _mm_srai_epi16(in[20], 6); - in[21] = _mm_srai_epi16(in[21], 6); - in[22] = _mm_srai_epi16(in[22], 6); - in[23] = _mm_srai_epi16(in[23], 6); - in[24] = _mm_srai_epi16(in[24], 6); - in[25] = _mm_srai_epi16(in[25], 6); - in[26] = _mm_srai_epi16(in[26], 6); - in[27] = _mm_srai_epi16(in[27], 6); - in[28] = _mm_srai_epi16(in[28], 6); - in[29] = _mm_srai_epi16(in[29], 6); - in[30] = _mm_srai_epi16(in[30], 6); - in[31] = _mm_srai_epi16(in[31], 6); - - RECON_AND_STORE(dest, in[0]); - RECON_AND_STORE(dest, in[1]); - RECON_AND_STORE(dest, in[2]); - RECON_AND_STORE(dest, in[3]); - RECON_AND_STORE(dest, in[4]); - RECON_AND_STORE(dest, in[5]); - RECON_AND_STORE(dest, in[6]); - RECON_AND_STORE(dest, in[7]); - RECON_AND_STORE(dest, in[8]); - RECON_AND_STORE(dest, in[9]); - RECON_AND_STORE(dest, in[10]); - RECON_AND_STORE(dest, in[11]); - RECON_AND_STORE(dest, in[12]); - RECON_AND_STORE(dest, in[13]); - RECON_AND_STORE(dest, in[14]); - RECON_AND_STORE(dest, in[15]); - RECON_AND_STORE(dest, in[16]); - RECON_AND_STORE(dest, in[17]); - RECON_AND_STORE(dest, in[18]); - RECON_AND_STORE(dest, in[19]); - RECON_AND_STORE(dest, in[20]); - RECON_AND_STORE(dest, in[21]); - RECON_AND_STORE(dest, in[22]); - RECON_AND_STORE(dest, in[23]); - RECON_AND_STORE(dest, in[24]); - RECON_AND_STORE(dest, in[25]); - RECON_AND_STORE(dest, in[26]); - RECON_AND_STORE(dest, in[27]); - RECON_AND_STORE(dest, in[28]); - RECON_AND_STORE(dest, in[29]); - RECON_AND_STORE(dest, in[30]); - RECON_AND_STORE(dest, in[31]); - - dest += 8 - (stride * 32); - } -} //NOLINT - -void vp9_idct32x32_1_add_sse2(const int16_t *input, uint8_t *dest, int stride) { - __m128i dc_value; - const __m128i zero = _mm_setzero_si128(); - int a, i; - - a = dct_const_round_shift(input[0] * cospi_16_64); - a = dct_const_round_shift(a * cospi_16_64); - a = ROUND_POWER_OF_TWO(a, 6); - - dc_value = _mm_set1_epi16(a); - - for (i = 0; i < 4; ++i) { - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - RECON_AND_STORE(dest, dc_value); - dest += 8 - (stride * 32); - } -} - -#if CONFIG_VP9_HIGHBITDEPTH -static INLINE __m128i clamp_high_sse2(__m128i value, int bd) { - __m128i ubounded, retval; - const __m128i zero = _mm_set1_epi16(0); - const __m128i one = _mm_set1_epi16(1); - const __m128i max = _mm_subs_epi16(_mm_slli_epi16(one, bd), one); - ubounded = _mm_cmpgt_epi16(value, max); - retval = _mm_andnot_si128(ubounded, value); - ubounded = _mm_and_si128(ubounded, max); - retval = _mm_or_si128(retval, ubounded); - retval = _mm_and_si128(retval, _mm_cmpgt_epi16(retval, zero)); - return retval; -} - -void vp9_highbd_idct4x4_16_add_sse2(const tran_low_t *input, uint8_t *dest8, - int stride, int bd) { - tran_low_t out[4 * 4]; - tran_low_t *outptr = out; - int i, j; - __m128i inptr[4]; - __m128i sign_bits[2]; - __m128i temp_mm, min_input, max_input; - int test; - uint16_t * dest = CONVERT_TO_SHORTPTR(dest8); - int optimised_cols = 0; - const __m128i zero = _mm_set1_epi16(0); - const __m128i eight = _mm_set1_epi16(8); - const __m128i max = _mm_set1_epi16(12043); - const __m128i min = _mm_set1_epi16(-12043); - // Load input into __m128i - inptr[0] = _mm_loadu_si128((const __m128i *)input); - inptr[1] = _mm_loadu_si128((const __m128i *)(input + 4)); - inptr[2] = _mm_loadu_si128((const __m128i *)(input + 8)); - inptr[3] = _mm_loadu_si128((const __m128i *)(input + 12)); - - // Pack to 16 bits - inptr[0] = _mm_packs_epi32(inptr[0], inptr[1]); - inptr[1] = _mm_packs_epi32(inptr[2], inptr[3]); - - max_input = _mm_max_epi16(inptr[0], inptr[1]); - min_input = _mm_min_epi16(inptr[0], inptr[1]); - max_input = _mm_cmpgt_epi16(max_input, max); - min_input = _mm_cmplt_epi16(min_input, min); - temp_mm = _mm_or_si128(max_input, min_input); - test = _mm_movemask_epi8(temp_mm); - - if (!test) { - // Do the row transform - idct4_sse2(inptr); - - // Check the min & max values - max_input = _mm_max_epi16(inptr[0], inptr[1]); - min_input = _mm_min_epi16(inptr[0], inptr[1]); - max_input = _mm_cmpgt_epi16(max_input, max); - min_input = _mm_cmplt_epi16(min_input, min); - temp_mm = _mm_or_si128(max_input, min_input); - test = _mm_movemask_epi8(temp_mm); - - if (test) { - transpose_4x4(inptr); - sign_bits[0] = _mm_cmplt_epi16(inptr[0], zero); - sign_bits[1] = _mm_cmplt_epi16(inptr[1], zero); - inptr[3] = _mm_unpackhi_epi16(inptr[1], sign_bits[1]); - inptr[2] = _mm_unpacklo_epi16(inptr[1], sign_bits[1]); - inptr[1] = _mm_unpackhi_epi16(inptr[0], sign_bits[0]); - inptr[0] = _mm_unpacklo_epi16(inptr[0], sign_bits[0]); - _mm_storeu_si128((__m128i*)outptr, inptr[0]); - _mm_storeu_si128((__m128i*)(outptr + 4), inptr[1]); - _mm_storeu_si128((__m128i*)(outptr + 8), inptr[2]); - _mm_storeu_si128((__m128i*)(outptr + 12), inptr[3]); - } else { - // Set to use the optimised transform for the column - optimised_cols = 1; - } - } else { - // Run the un-optimised row transform - for (i = 0; i < 4; ++i) { - vp9_highbd_idct4(input, outptr, bd); - input += 4; - outptr += 4; - } - } - - if (optimised_cols) { - idct4_sse2(inptr); - - // Final round and shift - inptr[0] = _mm_add_epi16(inptr[0], eight); - inptr[1] = _mm_add_epi16(inptr[1], eight); - - inptr[0] = _mm_srai_epi16(inptr[0], 4); - inptr[1] = _mm_srai_epi16(inptr[1], 4); - - // Reconstruction and Store - { - __m128i d0 = _mm_loadl_epi64((const __m128i *)dest); - __m128i d2 = _mm_loadl_epi64((const __m128i *)(dest + stride * 2)); - d0 = _mm_unpacklo_epi64(d0, - _mm_loadl_epi64((const __m128i *)(dest + stride))); - d2 = _mm_unpacklo_epi64(d2, - _mm_loadl_epi64((const __m128i *)(dest + stride * 3))); - d0 = clamp_high_sse2(_mm_adds_epi16(d0, inptr[0]), bd); - d2 = clamp_high_sse2(_mm_adds_epi16(d2, inptr[1]), bd); - // store input0 - _mm_storel_epi64((__m128i *)dest, d0); - // store input1 - d0 = _mm_srli_si128(d0, 8); - _mm_storel_epi64((__m128i *)(dest + stride), d0); - // store input2 - _mm_storel_epi64((__m128i *)(dest + stride * 2), d2); - // store input3 - d2 = _mm_srli_si128(d2, 8); - _mm_storel_epi64((__m128i *)(dest + stride * 3), d2); - } - } else { - // Run the un-optimised column transform - tran_low_t temp_in[4], temp_out[4]; - // Columns - for (i = 0; i < 4; ++i) { - for (j = 0; j < 4; ++j) - temp_in[j] = out[j * 4 + i]; - vp9_highbd_idct4(temp_in, temp_out, bd); - for (j = 0; j < 4; ++j) { - dest[j * stride + i] = highbd_clip_pixel_add( - dest[j * stride + i], ROUND_POWER_OF_TWO(temp_out[j], 4), bd); - } - } - } -} - -void vp9_highbd_idct8x8_64_add_sse2(const tran_low_t *input, uint8_t *dest8, - int stride, int bd) { - tran_low_t out[8 * 8]; - tran_low_t *outptr = out; - int i, j, test; - __m128i inptr[8]; - __m128i min_input, max_input, temp1, temp2, sign_bits; - uint16_t * dest = CONVERT_TO_SHORTPTR(dest8); - const __m128i zero = _mm_set1_epi16(0); - const __m128i sixteen = _mm_set1_epi16(16); - const __m128i max = _mm_set1_epi16(6201); - const __m128i min = _mm_set1_epi16(-6201); - int optimised_cols = 0; - - // Load input into __m128i & pack to 16 bits - for (i = 0; i < 8; i++) { - temp1 = _mm_loadu_si128((const __m128i *)(input + 8*i)); - temp2 = _mm_loadu_si128((const __m128i *)(input + 8*i + 4)); - inptr[i] = _mm_packs_epi32(temp1, temp2); - } - - // Find the min & max for the row transform - max_input = _mm_max_epi16(inptr[0], inptr[1]); - min_input = _mm_min_epi16(inptr[0], inptr[1]); - for (i = 2; i < 8; i++) { - max_input = _mm_max_epi16(max_input, inptr[i]); - min_input = _mm_min_epi16(min_input, inptr[i]); - } - max_input = _mm_cmpgt_epi16(max_input, max); - min_input = _mm_cmplt_epi16(min_input, min); - temp1 = _mm_or_si128(max_input, min_input); - test = _mm_movemask_epi8(temp1); - - if (!test) { - // Do the row transform - idct8_sse2(inptr); - - // Find the min & max for the column transform - max_input = _mm_max_epi16(inptr[0], inptr[1]); - min_input = _mm_min_epi16(inptr[0], inptr[1]); - for (i = 2; i < 8; i++) { - max_input = _mm_max_epi16(max_input, inptr[i]); - min_input = _mm_min_epi16(min_input, inptr[i]); - } - max_input = _mm_cmpgt_epi16(max_input, max); - min_input = _mm_cmplt_epi16(min_input, min); - temp1 = _mm_or_si128(max_input, min_input); - test = _mm_movemask_epi8(temp1); - - if (test) { - array_transpose_8x8(inptr, inptr); - for (i = 0; i < 8; i++) { - sign_bits = _mm_cmplt_epi16(inptr[i], zero); - temp1 = _mm_unpackhi_epi16(inptr[i], sign_bits); - temp2 = _mm_unpacklo_epi16(inptr[i], sign_bits); - _mm_storeu_si128((__m128i*)(outptr + 4*(2*i+1)), temp1); - _mm_storeu_si128((__m128i*)(outptr + 4*(2*i)), temp2); - } - } else { - // Set to use the optimised transform for the column - optimised_cols = 1; - } - } else { - // Run the un-optimised row transform - for (i = 0; i < 8; ++i) { - vp9_highbd_idct8(input, outptr, bd); - input += 8; - outptr += 8; - } - } - - if (optimised_cols) { - idct8_sse2(inptr); - - // Final round & shift and Reconstruction and Store - { - __m128i d[8]; - for (i = 0; i < 8; i++) { - inptr[i] = _mm_add_epi16(inptr[i], sixteen); - d[i] = _mm_loadu_si128((const __m128i *)(dest + stride*i)); - inptr[i] = _mm_srai_epi16(inptr[i], 5); - d[i] = clamp_high_sse2(_mm_adds_epi16(d[i], inptr[i]), bd); - // Store - _mm_storeu_si128((__m128i *)(dest + stride*i), d[i]); - } - } - } else { - // Run the un-optimised column transform - tran_low_t temp_in[8], temp_out[8]; - for (i = 0; i < 8; ++i) { - for (j = 0; j < 8; ++j) - temp_in[j] = out[j * 8 + i]; - vp9_highbd_idct8(temp_in, temp_out, bd); - for (j = 0; j < 8; ++j) { - dest[j * stride + i] = highbd_clip_pixel_add( - dest[j * stride + i], ROUND_POWER_OF_TWO(temp_out[j], 5), bd); - } - } - } -} - -void vp9_highbd_idct8x8_10_add_sse2(const tran_low_t *input, uint8_t *dest8, - int stride, int bd) { - tran_low_t out[8 * 8] = { 0 }; - tran_low_t *outptr = out; - int i, j, test; - __m128i inptr[8]; - __m128i min_input, max_input, temp1, temp2, sign_bits; - uint16_t * dest = CONVERT_TO_SHORTPTR(dest8); - const __m128i zero = _mm_set1_epi16(0); - const __m128i sixteen = _mm_set1_epi16(16); - const __m128i max = _mm_set1_epi16(6201); - const __m128i min = _mm_set1_epi16(-6201); - int optimised_cols = 0; - - // Load input into __m128i & pack to 16 bits - for (i = 0; i < 8; i++) { - temp1 = _mm_loadu_si128((const __m128i *)(input + 8*i)); - temp2 = _mm_loadu_si128((const __m128i *)(input + 8*i + 4)); - inptr[i] = _mm_packs_epi32(temp1, temp2); - } - - // Find the min & max for the row transform - // only first 4 row has non-zero coefs - max_input = _mm_max_epi16(inptr[0], inptr[1]); - min_input = _mm_min_epi16(inptr[0], inptr[1]); - for (i = 2; i < 4; i++) { - max_input = _mm_max_epi16(max_input, inptr[i]); - min_input = _mm_min_epi16(min_input, inptr[i]); - } - max_input = _mm_cmpgt_epi16(max_input, max); - min_input = _mm_cmplt_epi16(min_input, min); - temp1 = _mm_or_si128(max_input, min_input); - test = _mm_movemask_epi8(temp1); - - if (!test) { - // Do the row transform - idct8_sse2(inptr); - - // Find the min & max for the column transform - // N.B. Only first 4 cols contain non-zero coeffs - max_input = _mm_max_epi16(inptr[0], inptr[1]); - min_input = _mm_min_epi16(inptr[0], inptr[1]); - for (i = 2; i < 8; i++) { - max_input = _mm_max_epi16(max_input, inptr[i]); - min_input = _mm_min_epi16(min_input, inptr[i]); - } - max_input = _mm_cmpgt_epi16(max_input, max); - min_input = _mm_cmplt_epi16(min_input, min); - temp1 = _mm_or_si128(max_input, min_input); - test = _mm_movemask_epi8(temp1); - - if (test) { - // Use fact only first 4 rows contain non-zero coeffs - array_transpose_4X8(inptr, inptr); - for (i = 0; i < 4; i++) { - sign_bits = _mm_cmplt_epi16(inptr[i], zero); - temp1 = _mm_unpackhi_epi16(inptr[i], sign_bits); - temp2 = _mm_unpacklo_epi16(inptr[i], sign_bits); - _mm_storeu_si128((__m128i*)(outptr + 4*(2*i+1)), temp1); - _mm_storeu_si128((__m128i*)(outptr + 4*(2*i)), temp2); - } - } else { - // Set to use the optimised transform for the column - optimised_cols = 1; - } - } else { - // Run the un-optimised row transform - for (i = 0; i < 4; ++i) { - vp9_highbd_idct8(input, outptr, bd); - input += 8; - outptr += 8; - } - } - - if (optimised_cols) { - idct8_sse2(inptr); - - // Final round & shift and Reconstruction and Store - { - __m128i d[8]; - for (i = 0; i < 8; i++) { - inptr[i] = _mm_add_epi16(inptr[i], sixteen); - d[i] = _mm_loadu_si128((const __m128i *)(dest + stride*i)); - inptr[i] = _mm_srai_epi16(inptr[i], 5); - d[i] = clamp_high_sse2(_mm_adds_epi16(d[i], inptr[i]), bd); - // Store - _mm_storeu_si128((__m128i *)(dest + stride*i), d[i]); - } - } - } else { - // Run the un-optimised column transform - tran_low_t temp_in[8], temp_out[8]; - for (i = 0; i < 8; ++i) { - for (j = 0; j < 8; ++j) - temp_in[j] = out[j * 8 + i]; - vp9_highbd_idct8(temp_in, temp_out, bd); - for (j = 0; j < 8; ++j) { - dest[j * stride + i] = highbd_clip_pixel_add( - dest[j * stride + i], ROUND_POWER_OF_TWO(temp_out[j], 5), bd); - } - } - } -} - -void vp9_highbd_idct16x16_256_add_sse2(const tran_low_t *input, uint8_t *dest8, - int stride, int bd) { - tran_low_t out[16 * 16]; - tran_low_t *outptr = out; - int i, j, test; - __m128i inptr[32]; - __m128i min_input, max_input, temp1, temp2, sign_bits; - uint16_t * dest = CONVERT_TO_SHORTPTR(dest8); - const __m128i zero = _mm_set1_epi16(0); - const __m128i rounding = _mm_set1_epi16(32); - const __m128i max = _mm_set1_epi16(3155); - const __m128i min = _mm_set1_epi16(-3155); - int optimised_cols = 0; - - // Load input into __m128i & pack to 16 bits - for (i = 0; i < 16; i++) { - temp1 = _mm_loadu_si128((const __m128i *)(input + 16*i)); - temp2 = _mm_loadu_si128((const __m128i *)(input + 16*i + 4)); - inptr[i] = _mm_packs_epi32(temp1, temp2); - temp1 = _mm_loadu_si128((const __m128i *)(input + 16*i + 8)); - temp2 = _mm_loadu_si128((const __m128i *)(input + 16*i + 12)); - inptr[i + 16] = _mm_packs_epi32(temp1, temp2); - } - - // Find the min & max for the row transform - max_input = _mm_max_epi16(inptr[0], inptr[1]); - min_input = _mm_min_epi16(inptr[0], inptr[1]); - for (i = 2; i < 32; i++) { - max_input = _mm_max_epi16(max_input, inptr[i]); - min_input = _mm_min_epi16(min_input, inptr[i]); - } - max_input = _mm_cmpgt_epi16(max_input, max); - min_input = _mm_cmplt_epi16(min_input, min); - temp1 = _mm_or_si128(max_input, min_input); - test = _mm_movemask_epi8(temp1); - - if (!test) { - // Do the row transform - idct16_sse2(inptr, inptr + 16); - - // Find the min & max for the column transform - max_input = _mm_max_epi16(inptr[0], inptr[1]); - min_input = _mm_min_epi16(inptr[0], inptr[1]); - for (i = 2; i < 32; i++) { - max_input = _mm_max_epi16(max_input, inptr[i]); - min_input = _mm_min_epi16(min_input, inptr[i]); - } - max_input = _mm_cmpgt_epi16(max_input, max); - min_input = _mm_cmplt_epi16(min_input, min); - temp1 = _mm_or_si128(max_input, min_input); - test = _mm_movemask_epi8(temp1); - - if (test) { - array_transpose_16x16(inptr, inptr + 16); - for (i = 0; i < 16; i++) { - sign_bits = _mm_cmplt_epi16(inptr[i], zero); - temp1 = _mm_unpacklo_epi16(inptr[i ], sign_bits); - temp2 = _mm_unpackhi_epi16(inptr[i ], sign_bits); - _mm_storeu_si128((__m128i*)(outptr + 4*(i*4)), temp1); - _mm_storeu_si128((__m128i*)(outptr + 4*(i*4+1)), temp2); - sign_bits = _mm_cmplt_epi16(inptr[i+16], zero); - temp1 = _mm_unpacklo_epi16(inptr[i+16], sign_bits); - temp2 = _mm_unpackhi_epi16(inptr[i+16], sign_bits); - _mm_storeu_si128((__m128i*)(outptr + 4*(i*4+2)), temp1); - _mm_storeu_si128((__m128i*)(outptr + 4*(i*4+3)), temp2); - } - } else { - // Set to use the optimised transform for the column - optimised_cols = 1; - } - } else { - // Run the un-optimised row transform - for (i = 0; i < 16; ++i) { - vp9_highbd_idct16(input, outptr, bd); - input += 16; - outptr += 16; - } - } - - if (optimised_cols) { - idct16_sse2(inptr, inptr + 16); - - // Final round & shift and Reconstruction and Store - { - __m128i d[2]; - for (i = 0; i < 16; i++) { - inptr[i ] = _mm_add_epi16(inptr[i ], rounding); - inptr[i+16] = _mm_add_epi16(inptr[i+16], rounding); - d[0] = _mm_loadu_si128((const __m128i *)(dest + stride*i)); - d[1] = _mm_loadu_si128((const __m128i *)(dest + stride*i + 8)); - inptr[i ] = _mm_srai_epi16(inptr[i ], 6); - inptr[i+16] = _mm_srai_epi16(inptr[i+16], 6); - d[0] = clamp_high_sse2(_mm_add_epi16(d[0], inptr[i ]), bd); - d[1] = clamp_high_sse2(_mm_add_epi16(d[1], inptr[i+16]), bd); - // Store - _mm_storeu_si128((__m128i *)(dest + stride*i), d[0]); - _mm_storeu_si128((__m128i *)(dest + stride*i + 8), d[1]); - } - } - } else { - // Run the un-optimised column transform - tran_low_t temp_in[16], temp_out[16]; - for (i = 0; i < 16; ++i) { - for (j = 0; j < 16; ++j) - temp_in[j] = out[j * 16 + i]; - vp9_highbd_idct16(temp_in, temp_out, bd); - for (j = 0; j < 16; ++j) { - dest[j * stride + i] = highbd_clip_pixel_add( - dest[j * stride + i], ROUND_POWER_OF_TWO(temp_out[j], 6), bd); - } - } - } -} - -void vp9_highbd_idct16x16_10_add_sse2(const tran_low_t *input, uint8_t *dest8, - int stride, int bd) { - tran_low_t out[16 * 16] = { 0 }; - tran_low_t *outptr = out; - int i, j, test; - __m128i inptr[32]; - __m128i min_input, max_input, temp1, temp2, sign_bits; - uint16_t * dest = CONVERT_TO_SHORTPTR(dest8); - const __m128i zero = _mm_set1_epi16(0); - const __m128i rounding = _mm_set1_epi16(32); - const __m128i max = _mm_set1_epi16(3155); - const __m128i min = _mm_set1_epi16(-3155); - int optimised_cols = 0; - - // Load input into __m128i & pack to 16 bits - for (i = 0; i < 16; i++) { - temp1 = _mm_loadu_si128((const __m128i *)(input + 16*i)); - temp2 = _mm_loadu_si128((const __m128i *)(input + 16*i + 4)); - inptr[i] = _mm_packs_epi32(temp1, temp2); - temp1 = _mm_loadu_si128((const __m128i *)(input + 16*i + 8)); - temp2 = _mm_loadu_si128((const __m128i *)(input + 16*i + 12)); - inptr[i + 16] = _mm_packs_epi32(temp1, temp2); - } - - // Find the min & max for the row transform - // Since all non-zero dct coefficients are in upper-left 4x4 area, - // we only need to consider first 4 rows here. - max_input = _mm_max_epi16(inptr[0], inptr[1]); - min_input = _mm_min_epi16(inptr[0], inptr[1]); - for (i = 2; i < 4; i++) { - max_input = _mm_max_epi16(max_input, inptr[i]); - min_input = _mm_min_epi16(min_input, inptr[i]); - } - max_input = _mm_cmpgt_epi16(max_input, max); - min_input = _mm_cmplt_epi16(min_input, min); - temp1 = _mm_or_si128(max_input, min_input); - test = _mm_movemask_epi8(temp1); - - if (!test) { - // Do the row transform (N.B. This transposes inptr) - idct16_sse2(inptr, inptr + 16); - - // Find the min & max for the column transform - // N.B. Only first 4 cols contain non-zero coeffs - max_input = _mm_max_epi16(inptr[0], inptr[1]); - min_input = _mm_min_epi16(inptr[0], inptr[1]); - for (i = 2; i < 16; i++) { - max_input = _mm_max_epi16(max_input, inptr[i]); - min_input = _mm_min_epi16(min_input, inptr[i]); - } - max_input = _mm_cmpgt_epi16(max_input, max); - min_input = _mm_cmplt_epi16(min_input, min); - temp1 = _mm_or_si128(max_input, min_input); - test = _mm_movemask_epi8(temp1); - - if (test) { - // Use fact only first 4 rows contain non-zero coeffs - array_transpose_8x8(inptr, inptr); - array_transpose_8x8(inptr + 8, inptr + 16); - for (i = 0; i < 4; i++) { - sign_bits = _mm_cmplt_epi16(inptr[i], zero); - temp1 = _mm_unpacklo_epi16(inptr[i ], sign_bits); - temp2 = _mm_unpackhi_epi16(inptr[i ], sign_bits); - _mm_storeu_si128((__m128i*)(outptr + 4*(i*4)), temp1); - _mm_storeu_si128((__m128i*)(outptr + 4*(i*4+1)), temp2); - sign_bits = _mm_cmplt_epi16(inptr[i+16], zero); - temp1 = _mm_unpacklo_epi16(inptr[i+16], sign_bits); - temp2 = _mm_unpackhi_epi16(inptr[i+16], sign_bits); - _mm_storeu_si128((__m128i*)(outptr + 4*(i*4+2)), temp1); - _mm_storeu_si128((__m128i*)(outptr + 4*(i*4+3)), temp2); - } - } else { - // Set to use the optimised transform for the column - optimised_cols = 1; - } - } else { - // Run the un-optimised row transform - for (i = 0; i < 4; ++i) { - vp9_highbd_idct16(input, outptr, bd); - input += 16; - outptr += 16; - } - } - - if (optimised_cols) { - idct16_sse2(inptr, inptr + 16); - - // Final round & shift and Reconstruction and Store - { - __m128i d[2]; - for (i = 0; i < 16; i++) { - inptr[i ] = _mm_add_epi16(inptr[i ], rounding); - inptr[i+16] = _mm_add_epi16(inptr[i+16], rounding); - d[0] = _mm_loadu_si128((const __m128i *)(dest + stride*i)); - d[1] = _mm_loadu_si128((const __m128i *)(dest + stride*i + 8)); - inptr[i ] = _mm_srai_epi16(inptr[i ], 6); - inptr[i+16] = _mm_srai_epi16(inptr[i+16], 6); - d[0] = clamp_high_sse2(_mm_add_epi16(d[0], inptr[i ]), bd); - d[1] = clamp_high_sse2(_mm_add_epi16(d[1], inptr[i+16]), bd); - // Store - _mm_storeu_si128((__m128i *)(dest + stride*i), d[0]); - _mm_storeu_si128((__m128i *)(dest + stride*i + 8), d[1]); - } - } - } else { - // Run the un-optimised column transform - tran_low_t temp_in[16], temp_out[16]; - for (i = 0; i < 16; ++i) { - for (j = 0; j < 16; ++j) - temp_in[j] = out[j * 16 + i]; - vp9_highbd_idct16(temp_in, temp_out, bd); - for (j = 0; j < 16; ++j) { - dest[j * stride + i] = highbd_clip_pixel_add( - dest[j * stride + i], ROUND_POWER_OF_TWO(temp_out[j], 6), bd); - } - } - } -} - -#endif // CONFIG_VP9_HIGHBITDEPTH diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_idct_intrin_sse2.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_idct_intrin_sse2.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_idct_intrin_sse2.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_idct_intrin_sse2.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,175 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include // SSE2 -#include "./vpx_config.h" -#include "vpx/vpx_integer.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_idct.h" - -// perform 8x8 transpose -static INLINE void array_transpose_8x8(__m128i *in, __m128i *res) { - const __m128i tr0_0 = _mm_unpacklo_epi16(in[0], in[1]); - const __m128i tr0_1 = _mm_unpacklo_epi16(in[2], in[3]); - const __m128i tr0_2 = _mm_unpackhi_epi16(in[0], in[1]); - const __m128i tr0_3 = _mm_unpackhi_epi16(in[2], in[3]); - const __m128i tr0_4 = _mm_unpacklo_epi16(in[4], in[5]); - const __m128i tr0_5 = _mm_unpacklo_epi16(in[6], in[7]); - const __m128i tr0_6 = _mm_unpackhi_epi16(in[4], in[5]); - const __m128i tr0_7 = _mm_unpackhi_epi16(in[6], in[7]); - - const __m128i tr1_0 = _mm_unpacklo_epi32(tr0_0, tr0_1); - const __m128i tr1_1 = _mm_unpacklo_epi32(tr0_4, tr0_5); - const __m128i tr1_2 = _mm_unpackhi_epi32(tr0_0, tr0_1); - const __m128i tr1_3 = _mm_unpackhi_epi32(tr0_4, tr0_5); - const __m128i tr1_4 = _mm_unpacklo_epi32(tr0_2, tr0_3); - const __m128i tr1_5 = _mm_unpacklo_epi32(tr0_6, tr0_7); - const __m128i tr1_6 = _mm_unpackhi_epi32(tr0_2, tr0_3); - const __m128i tr1_7 = _mm_unpackhi_epi32(tr0_6, tr0_7); - - res[0] = _mm_unpacklo_epi64(tr1_0, tr1_1); - res[1] = _mm_unpackhi_epi64(tr1_0, tr1_1); - res[2] = _mm_unpacklo_epi64(tr1_2, tr1_3); - res[3] = _mm_unpackhi_epi64(tr1_2, tr1_3); - res[4] = _mm_unpacklo_epi64(tr1_4, tr1_5); - res[5] = _mm_unpackhi_epi64(tr1_4, tr1_5); - res[6] = _mm_unpacklo_epi64(tr1_6, tr1_7); - res[7] = _mm_unpackhi_epi64(tr1_6, tr1_7); -} - -#define TRANSPOSE_8X4(in0, in1, in2, in3, out0, out1) \ - { \ - const __m128i tr0_0 = _mm_unpacklo_epi16(in0, in1); \ - const __m128i tr0_1 = _mm_unpacklo_epi16(in2, in3); \ - \ - in0 = _mm_unpacklo_epi32(tr0_0, tr0_1); /* i1 i0 */ \ - in1 = _mm_unpackhi_epi32(tr0_0, tr0_1); /* i3 i2 */ \ - } - -static INLINE void array_transpose_4X8(__m128i *in, __m128i * out) { - const __m128i tr0_0 = _mm_unpacklo_epi16(in[0], in[1]); - const __m128i tr0_1 = _mm_unpacklo_epi16(in[2], in[3]); - const __m128i tr0_4 = _mm_unpacklo_epi16(in[4], in[5]); - const __m128i tr0_5 = _mm_unpacklo_epi16(in[6], in[7]); - - const __m128i tr1_0 = _mm_unpacklo_epi32(tr0_0, tr0_1); - const __m128i tr1_2 = _mm_unpackhi_epi32(tr0_0, tr0_1); - const __m128i tr1_4 = _mm_unpacklo_epi32(tr0_4, tr0_5); - const __m128i tr1_6 = _mm_unpackhi_epi32(tr0_4, tr0_5); - - out[0] = _mm_unpacklo_epi64(tr1_0, tr1_4); - out[1] = _mm_unpackhi_epi64(tr1_0, tr1_4); - out[2] = _mm_unpacklo_epi64(tr1_2, tr1_6); - out[3] = _mm_unpackhi_epi64(tr1_2, tr1_6); -} - -static INLINE void array_transpose_16x16(__m128i *res0, __m128i *res1) { - __m128i tbuf[8]; - array_transpose_8x8(res0, res0); - array_transpose_8x8(res1, tbuf); - array_transpose_8x8(res0 + 8, res1); - array_transpose_8x8(res1 + 8, res1 + 8); - - res0[8] = tbuf[0]; - res0[9] = tbuf[1]; - res0[10] = tbuf[2]; - res0[11] = tbuf[3]; - res0[12] = tbuf[4]; - res0[13] = tbuf[5]; - res0[14] = tbuf[6]; - res0[15] = tbuf[7]; -} - -static INLINE void load_buffer_8x16(const int16_t *input, __m128i *in) { - in[0] = _mm_load_si128((const __m128i *)(input + 0 * 16)); - in[1] = _mm_load_si128((const __m128i *)(input + 1 * 16)); - in[2] = _mm_load_si128((const __m128i *)(input + 2 * 16)); - in[3] = _mm_load_si128((const __m128i *)(input + 3 * 16)); - in[4] = _mm_load_si128((const __m128i *)(input + 4 * 16)); - in[5] = _mm_load_si128((const __m128i *)(input + 5 * 16)); - in[6] = _mm_load_si128((const __m128i *)(input + 6 * 16)); - in[7] = _mm_load_si128((const __m128i *)(input + 7 * 16)); - - in[8] = _mm_load_si128((const __m128i *)(input + 8 * 16)); - in[9] = _mm_load_si128((const __m128i *)(input + 9 * 16)); - in[10] = _mm_load_si128((const __m128i *)(input + 10 * 16)); - in[11] = _mm_load_si128((const __m128i *)(input + 11 * 16)); - in[12] = _mm_load_si128((const __m128i *)(input + 12 * 16)); - in[13] = _mm_load_si128((const __m128i *)(input + 13 * 16)); - in[14] = _mm_load_si128((const __m128i *)(input + 14 * 16)); - in[15] = _mm_load_si128((const __m128i *)(input + 15 * 16)); -} - -#define RECON_AND_STORE(dest, in_x) \ - { \ - __m128i d0 = _mm_loadl_epi64((__m128i *)(dest)); \ - d0 = _mm_unpacklo_epi8(d0, zero); \ - d0 = _mm_add_epi16(in_x, d0); \ - d0 = _mm_packus_epi16(d0, d0); \ - _mm_storel_epi64((__m128i *)(dest), d0); \ - dest += stride; \ - } - -static INLINE void write_buffer_8x16(uint8_t *dest, __m128i *in, int stride) { - const __m128i final_rounding = _mm_set1_epi16(1<<5); - const __m128i zero = _mm_setzero_si128(); - // Final rounding and shift - in[0] = _mm_adds_epi16(in[0], final_rounding); - in[1] = _mm_adds_epi16(in[1], final_rounding); - in[2] = _mm_adds_epi16(in[2], final_rounding); - in[3] = _mm_adds_epi16(in[3], final_rounding); - in[4] = _mm_adds_epi16(in[4], final_rounding); - in[5] = _mm_adds_epi16(in[5], final_rounding); - in[6] = _mm_adds_epi16(in[6], final_rounding); - in[7] = _mm_adds_epi16(in[7], final_rounding); - in[8] = _mm_adds_epi16(in[8], final_rounding); - in[9] = _mm_adds_epi16(in[9], final_rounding); - in[10] = _mm_adds_epi16(in[10], final_rounding); - in[11] = _mm_adds_epi16(in[11], final_rounding); - in[12] = _mm_adds_epi16(in[12], final_rounding); - in[13] = _mm_adds_epi16(in[13], final_rounding); - in[14] = _mm_adds_epi16(in[14], final_rounding); - in[15] = _mm_adds_epi16(in[15], final_rounding); - - in[0] = _mm_srai_epi16(in[0], 6); - in[1] = _mm_srai_epi16(in[1], 6); - in[2] = _mm_srai_epi16(in[2], 6); - in[3] = _mm_srai_epi16(in[3], 6); - in[4] = _mm_srai_epi16(in[4], 6); - in[5] = _mm_srai_epi16(in[5], 6); - in[6] = _mm_srai_epi16(in[6], 6); - in[7] = _mm_srai_epi16(in[7], 6); - in[8] = _mm_srai_epi16(in[8], 6); - in[9] = _mm_srai_epi16(in[9], 6); - in[10] = _mm_srai_epi16(in[10], 6); - in[11] = _mm_srai_epi16(in[11], 6); - in[12] = _mm_srai_epi16(in[12], 6); - in[13] = _mm_srai_epi16(in[13], 6); - in[14] = _mm_srai_epi16(in[14], 6); - in[15] = _mm_srai_epi16(in[15], 6); - - RECON_AND_STORE(dest, in[0]); - RECON_AND_STORE(dest, in[1]); - RECON_AND_STORE(dest, in[2]); - RECON_AND_STORE(dest, in[3]); - RECON_AND_STORE(dest, in[4]); - RECON_AND_STORE(dest, in[5]); - RECON_AND_STORE(dest, in[6]); - RECON_AND_STORE(dest, in[7]); - RECON_AND_STORE(dest, in[8]); - RECON_AND_STORE(dest, in[9]); - RECON_AND_STORE(dest, in[10]); - RECON_AND_STORE(dest, in[11]); - RECON_AND_STORE(dest, in[12]); - RECON_AND_STORE(dest, in[13]); - RECON_AND_STORE(dest, in[14]); - RECON_AND_STORE(dest, in[15]); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_idct_intrin_ssse3.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_idct_intrin_ssse3.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_idct_intrin_ssse3.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_idct_intrin_ssse3.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,762 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#if defined(_MSC_VER) && _MSC_VER <= 1500 -// Need to include math.h before calling tmmintrin.h/intrin.h -// in certain versions of MSVS. -#include -#endif -#include // SSSE3 -#include "vp9/common/x86/vp9_idct_intrin_sse2.h" - -static void idct16_8col(__m128i *in, int round) { - const __m128i k__cospi_p30_m02 = pair_set_epi16(cospi_30_64, -cospi_2_64); - const __m128i k__cospi_p02_p30 = pair_set_epi16(cospi_2_64, cospi_30_64); - const __m128i k__cospi_p14_m18 = pair_set_epi16(cospi_14_64, -cospi_18_64); - const __m128i k__cospi_p18_p14 = pair_set_epi16(cospi_18_64, cospi_14_64); - const __m128i k__cospi_p22_m10 = pair_set_epi16(cospi_22_64, -cospi_10_64); - const __m128i k__cospi_p10_p22 = pair_set_epi16(cospi_10_64, cospi_22_64); - const __m128i k__cospi_p06_m26 = pair_set_epi16(cospi_6_64, -cospi_26_64); - const __m128i k__cospi_p26_p06 = pair_set_epi16(cospi_26_64, cospi_6_64); - const __m128i k__cospi_p28_m04 = pair_set_epi16(cospi_28_64, -cospi_4_64); - const __m128i k__cospi_p04_p28 = pair_set_epi16(cospi_4_64, cospi_28_64); - const __m128i k__cospi_p12_m20 = pair_set_epi16(cospi_12_64, -cospi_20_64); - const __m128i k__cospi_p20_p12 = pair_set_epi16(cospi_20_64, cospi_12_64); - const __m128i k__cospi_p24_m08 = pair_set_epi16(cospi_24_64, -cospi_8_64); - const __m128i k__cospi_p08_p24 = pair_set_epi16(cospi_8_64, cospi_24_64); - const __m128i k__cospi_m08_p24 = pair_set_epi16(-cospi_8_64, cospi_24_64); - const __m128i k__cospi_p24_p08 = pair_set_epi16(cospi_24_64, cospi_8_64); - const __m128i k__cospi_m24_m08 = pair_set_epi16(-cospi_24_64, -cospi_8_64); - const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING); - const __m128i k__cospi_p16_p16_x2 = pair_set_epi16(23170, 23170); - const __m128i k__cospi_p16_p16 = _mm_set1_epi16((int16_t)cospi_16_64); - const __m128i k__cospi_m16_p16 = pair_set_epi16(-cospi_16_64, cospi_16_64); - - __m128i v[16], u[16], s[16], t[16]; - - // stage 1 - s[0] = in[0]; - s[1] = in[8]; - s[2] = in[4]; - s[3] = in[12]; - s[4] = in[2]; - s[5] = in[10]; - s[6] = in[6]; - s[7] = in[14]; - s[8] = in[1]; - s[9] = in[9]; - s[10] = in[5]; - s[11] = in[13]; - s[12] = in[3]; - s[13] = in[11]; - s[14] = in[7]; - s[15] = in[15]; - - // stage 2 - u[0] = _mm_unpacklo_epi16(s[8], s[15]); - u[1] = _mm_unpackhi_epi16(s[8], s[15]); - u[2] = _mm_unpacklo_epi16(s[9], s[14]); - u[3] = _mm_unpackhi_epi16(s[9], s[14]); - u[4] = _mm_unpacklo_epi16(s[10], s[13]); - u[5] = _mm_unpackhi_epi16(s[10], s[13]); - u[6] = _mm_unpacklo_epi16(s[11], s[12]); - u[7] = _mm_unpackhi_epi16(s[11], s[12]); - - v[0] = _mm_madd_epi16(u[0], k__cospi_p30_m02); - v[1] = _mm_madd_epi16(u[1], k__cospi_p30_m02); - v[2] = _mm_madd_epi16(u[0], k__cospi_p02_p30); - v[3] = _mm_madd_epi16(u[1], k__cospi_p02_p30); - v[4] = _mm_madd_epi16(u[2], k__cospi_p14_m18); - v[5] = _mm_madd_epi16(u[3], k__cospi_p14_m18); - v[6] = _mm_madd_epi16(u[2], k__cospi_p18_p14); - v[7] = _mm_madd_epi16(u[3], k__cospi_p18_p14); - v[8] = _mm_madd_epi16(u[4], k__cospi_p22_m10); - v[9] = _mm_madd_epi16(u[5], k__cospi_p22_m10); - v[10] = _mm_madd_epi16(u[4], k__cospi_p10_p22); - v[11] = _mm_madd_epi16(u[5], k__cospi_p10_p22); - v[12] = _mm_madd_epi16(u[6], k__cospi_p06_m26); - v[13] = _mm_madd_epi16(u[7], k__cospi_p06_m26); - v[14] = _mm_madd_epi16(u[6], k__cospi_p26_p06); - v[15] = _mm_madd_epi16(u[7], k__cospi_p26_p06); - - u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING); - u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING); - u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING); - u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING); - u[4] = _mm_add_epi32(v[4], k__DCT_CONST_ROUNDING); - u[5] = _mm_add_epi32(v[5], k__DCT_CONST_ROUNDING); - u[6] = _mm_add_epi32(v[6], k__DCT_CONST_ROUNDING); - u[7] = _mm_add_epi32(v[7], k__DCT_CONST_ROUNDING); - u[8] = _mm_add_epi32(v[8], k__DCT_CONST_ROUNDING); - u[9] = _mm_add_epi32(v[9], k__DCT_CONST_ROUNDING); - u[10] = _mm_add_epi32(v[10], k__DCT_CONST_ROUNDING); - u[11] = _mm_add_epi32(v[11], k__DCT_CONST_ROUNDING); - u[12] = _mm_add_epi32(v[12], k__DCT_CONST_ROUNDING); - u[13] = _mm_add_epi32(v[13], k__DCT_CONST_ROUNDING); - u[14] = _mm_add_epi32(v[14], k__DCT_CONST_ROUNDING); - u[15] = _mm_add_epi32(v[15], k__DCT_CONST_ROUNDING); - - u[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS); - u[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS); - u[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS); - u[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS); - u[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS); - u[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS); - u[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS); - u[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS); - u[8] = _mm_srai_epi32(u[8], DCT_CONST_BITS); - u[9] = _mm_srai_epi32(u[9], DCT_CONST_BITS); - u[10] = _mm_srai_epi32(u[10], DCT_CONST_BITS); - u[11] = _mm_srai_epi32(u[11], DCT_CONST_BITS); - u[12] = _mm_srai_epi32(u[12], DCT_CONST_BITS); - u[13] = _mm_srai_epi32(u[13], DCT_CONST_BITS); - u[14] = _mm_srai_epi32(u[14], DCT_CONST_BITS); - u[15] = _mm_srai_epi32(u[15], DCT_CONST_BITS); - - s[8] = _mm_packs_epi32(u[0], u[1]); - s[15] = _mm_packs_epi32(u[2], u[3]); - s[9] = _mm_packs_epi32(u[4], u[5]); - s[14] = _mm_packs_epi32(u[6], u[7]); - s[10] = _mm_packs_epi32(u[8], u[9]); - s[13] = _mm_packs_epi32(u[10], u[11]); - s[11] = _mm_packs_epi32(u[12], u[13]); - s[12] = _mm_packs_epi32(u[14], u[15]); - - // stage 3 - t[0] = s[0]; - t[1] = s[1]; - t[2] = s[2]; - t[3] = s[3]; - u[0] = _mm_unpacklo_epi16(s[4], s[7]); - u[1] = _mm_unpackhi_epi16(s[4], s[7]); - u[2] = _mm_unpacklo_epi16(s[5], s[6]); - u[3] = _mm_unpackhi_epi16(s[5], s[6]); - - v[0] = _mm_madd_epi16(u[0], k__cospi_p28_m04); - v[1] = _mm_madd_epi16(u[1], k__cospi_p28_m04); - v[2] = _mm_madd_epi16(u[0], k__cospi_p04_p28); - v[3] = _mm_madd_epi16(u[1], k__cospi_p04_p28); - v[4] = _mm_madd_epi16(u[2], k__cospi_p12_m20); - v[5] = _mm_madd_epi16(u[3], k__cospi_p12_m20); - v[6] = _mm_madd_epi16(u[2], k__cospi_p20_p12); - v[7] = _mm_madd_epi16(u[3], k__cospi_p20_p12); - - u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING); - u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING); - u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING); - u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING); - u[4] = _mm_add_epi32(v[4], k__DCT_CONST_ROUNDING); - u[5] = _mm_add_epi32(v[5], k__DCT_CONST_ROUNDING); - u[6] = _mm_add_epi32(v[6], k__DCT_CONST_ROUNDING); - u[7] = _mm_add_epi32(v[7], k__DCT_CONST_ROUNDING); - - u[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS); - u[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS); - u[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS); - u[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS); - u[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS); - u[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS); - u[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS); - u[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS); - - t[4] = _mm_packs_epi32(u[0], u[1]); - t[7] = _mm_packs_epi32(u[2], u[3]); - t[5] = _mm_packs_epi32(u[4], u[5]); - t[6] = _mm_packs_epi32(u[6], u[7]); - t[8] = _mm_add_epi16(s[8], s[9]); - t[9] = _mm_sub_epi16(s[8], s[9]); - t[10] = _mm_sub_epi16(s[11], s[10]); - t[11] = _mm_add_epi16(s[10], s[11]); - t[12] = _mm_add_epi16(s[12], s[13]); - t[13] = _mm_sub_epi16(s[12], s[13]); - t[14] = _mm_sub_epi16(s[15], s[14]); - t[15] = _mm_add_epi16(s[14], s[15]); - - // stage 4 - u[0] = _mm_add_epi16(t[0], t[1]); - u[1] = _mm_sub_epi16(t[0], t[1]); - u[2] = _mm_unpacklo_epi16(t[2], t[3]); - u[3] = _mm_unpackhi_epi16(t[2], t[3]); - u[4] = _mm_unpacklo_epi16(t[9], t[14]); - u[5] = _mm_unpackhi_epi16(t[9], t[14]); - u[6] = _mm_unpacklo_epi16(t[10], t[13]); - u[7] = _mm_unpackhi_epi16(t[10], t[13]); - - s[0] = _mm_mulhrs_epi16(u[0], k__cospi_p16_p16_x2); - s[1] = _mm_mulhrs_epi16(u[1], k__cospi_p16_p16_x2); - v[4] = _mm_madd_epi16(u[2], k__cospi_p24_m08); - v[5] = _mm_madd_epi16(u[3], k__cospi_p24_m08); - v[6] = _mm_madd_epi16(u[2], k__cospi_p08_p24); - v[7] = _mm_madd_epi16(u[3], k__cospi_p08_p24); - v[8] = _mm_madd_epi16(u[4], k__cospi_m08_p24); - v[9] = _mm_madd_epi16(u[5], k__cospi_m08_p24); - v[10] = _mm_madd_epi16(u[4], k__cospi_p24_p08); - v[11] = _mm_madd_epi16(u[5], k__cospi_p24_p08); - v[12] = _mm_madd_epi16(u[6], k__cospi_m24_m08); - v[13] = _mm_madd_epi16(u[7], k__cospi_m24_m08); - v[14] = _mm_madd_epi16(u[6], k__cospi_m08_p24); - v[15] = _mm_madd_epi16(u[7], k__cospi_m08_p24); - - u[4] = _mm_add_epi32(v[4], k__DCT_CONST_ROUNDING); - u[5] = _mm_add_epi32(v[5], k__DCT_CONST_ROUNDING); - u[6] = _mm_add_epi32(v[6], k__DCT_CONST_ROUNDING); - u[7] = _mm_add_epi32(v[7], k__DCT_CONST_ROUNDING); - u[8] = _mm_add_epi32(v[8], k__DCT_CONST_ROUNDING); - u[9] = _mm_add_epi32(v[9], k__DCT_CONST_ROUNDING); - u[10] = _mm_add_epi32(v[10], k__DCT_CONST_ROUNDING); - u[11] = _mm_add_epi32(v[11], k__DCT_CONST_ROUNDING); - u[12] = _mm_add_epi32(v[12], k__DCT_CONST_ROUNDING); - u[13] = _mm_add_epi32(v[13], k__DCT_CONST_ROUNDING); - u[14] = _mm_add_epi32(v[14], k__DCT_CONST_ROUNDING); - u[15] = _mm_add_epi32(v[15], k__DCT_CONST_ROUNDING); - - u[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS); - u[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS); - u[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS); - u[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS); - u[8] = _mm_srai_epi32(u[8], DCT_CONST_BITS); - u[9] = _mm_srai_epi32(u[9], DCT_CONST_BITS); - u[10] = _mm_srai_epi32(u[10], DCT_CONST_BITS); - u[11] = _mm_srai_epi32(u[11], DCT_CONST_BITS); - u[12] = _mm_srai_epi32(u[12], DCT_CONST_BITS); - u[13] = _mm_srai_epi32(u[13], DCT_CONST_BITS); - u[14] = _mm_srai_epi32(u[14], DCT_CONST_BITS); - u[15] = _mm_srai_epi32(u[15], DCT_CONST_BITS); - - s[2] = _mm_packs_epi32(u[4], u[5]); - s[3] = _mm_packs_epi32(u[6], u[7]); - s[4] = _mm_add_epi16(t[4], t[5]); - s[5] = _mm_sub_epi16(t[4], t[5]); - s[6] = _mm_sub_epi16(t[7], t[6]); - s[7] = _mm_add_epi16(t[6], t[7]); - s[8] = t[8]; - s[15] = t[15]; - s[9] = _mm_packs_epi32(u[8], u[9]); - s[14] = _mm_packs_epi32(u[10], u[11]); - s[10] = _mm_packs_epi32(u[12], u[13]); - s[13] = _mm_packs_epi32(u[14], u[15]); - s[11] = t[11]; - s[12] = t[12]; - - // stage 5 - t[0] = _mm_add_epi16(s[0], s[3]); - t[1] = _mm_add_epi16(s[1], s[2]); - t[2] = _mm_sub_epi16(s[1], s[2]); - t[3] = _mm_sub_epi16(s[0], s[3]); - t[4] = s[4]; - t[7] = s[7]; - - u[0] = _mm_sub_epi16(s[6], s[5]); - u[1] = _mm_add_epi16(s[6], s[5]); - t[5] = _mm_mulhrs_epi16(u[0], k__cospi_p16_p16_x2); - t[6] = _mm_mulhrs_epi16(u[1], k__cospi_p16_p16_x2); - - t[8] = _mm_add_epi16(s[8], s[11]); - t[9] = _mm_add_epi16(s[9], s[10]); - t[10] = _mm_sub_epi16(s[9], s[10]); - t[11] = _mm_sub_epi16(s[8], s[11]); - t[12] = _mm_sub_epi16(s[15], s[12]); - t[13] = _mm_sub_epi16(s[14], s[13]); - t[14] = _mm_add_epi16(s[13], s[14]); - t[15] = _mm_add_epi16(s[12], s[15]); - - // stage 6 - if (round == 1) { - s[0] = _mm_add_epi16(t[0], t[7]); - s[1] = _mm_add_epi16(t[1], t[6]); - s[2] = _mm_add_epi16(t[2], t[5]); - s[3] = _mm_add_epi16(t[3], t[4]); - s[4] = _mm_sub_epi16(t[3], t[4]); - s[5] = _mm_sub_epi16(t[2], t[5]); - s[6] = _mm_sub_epi16(t[1], t[6]); - s[7] = _mm_sub_epi16(t[0], t[7]); - s[8] = t[8]; - s[9] = t[9]; - - u[0] = _mm_unpacklo_epi16(t[10], t[13]); - u[1] = _mm_unpackhi_epi16(t[10], t[13]); - u[2] = _mm_unpacklo_epi16(t[11], t[12]); - u[3] = _mm_unpackhi_epi16(t[11], t[12]); - - v[0] = _mm_madd_epi16(u[0], k__cospi_m16_p16); - v[1] = _mm_madd_epi16(u[1], k__cospi_m16_p16); - v[2] = _mm_madd_epi16(u[0], k__cospi_p16_p16); - v[3] = _mm_madd_epi16(u[1], k__cospi_p16_p16); - v[4] = _mm_madd_epi16(u[2], k__cospi_m16_p16); - v[5] = _mm_madd_epi16(u[3], k__cospi_m16_p16); - v[6] = _mm_madd_epi16(u[2], k__cospi_p16_p16); - v[7] = _mm_madd_epi16(u[3], k__cospi_p16_p16); - - u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING); - u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING); - u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING); - u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING); - u[4] = _mm_add_epi32(v[4], k__DCT_CONST_ROUNDING); - u[5] = _mm_add_epi32(v[5], k__DCT_CONST_ROUNDING); - u[6] = _mm_add_epi32(v[6], k__DCT_CONST_ROUNDING); - u[7] = _mm_add_epi32(v[7], k__DCT_CONST_ROUNDING); - - u[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS); - u[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS); - u[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS); - u[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS); - u[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS); - u[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS); - u[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS); - u[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS); - - s[10] = _mm_packs_epi32(u[0], u[1]); - s[13] = _mm_packs_epi32(u[2], u[3]); - s[11] = _mm_packs_epi32(u[4], u[5]); - s[12] = _mm_packs_epi32(u[6], u[7]); - s[14] = t[14]; - s[15] = t[15]; - } else { - s[0] = _mm_add_epi16(t[0], t[7]); - s[1] = _mm_add_epi16(t[1], t[6]); - s[2] = _mm_add_epi16(t[2], t[5]); - s[3] = _mm_add_epi16(t[3], t[4]); - s[4] = _mm_sub_epi16(t[3], t[4]); - s[5] = _mm_sub_epi16(t[2], t[5]); - s[6] = _mm_sub_epi16(t[1], t[6]); - s[7] = _mm_sub_epi16(t[0], t[7]); - s[8] = t[8]; - s[9] = t[9]; - - u[0] = _mm_sub_epi16(t[13], t[10]); - u[1] = _mm_add_epi16(t[13], t[10]); - u[2] = _mm_sub_epi16(t[12], t[11]); - u[3] = _mm_add_epi16(t[12], t[11]); - - s[10] = _mm_mulhrs_epi16(u[0], k__cospi_p16_p16_x2); - s[13] = _mm_mulhrs_epi16(u[1], k__cospi_p16_p16_x2); - s[11] = _mm_mulhrs_epi16(u[2], k__cospi_p16_p16_x2); - s[12] = _mm_mulhrs_epi16(u[3], k__cospi_p16_p16_x2); - s[14] = t[14]; - s[15] = t[15]; - } - - // stage 7 - in[0] = _mm_add_epi16(s[0], s[15]); - in[1] = _mm_add_epi16(s[1], s[14]); - in[2] = _mm_add_epi16(s[2], s[13]); - in[3] = _mm_add_epi16(s[3], s[12]); - in[4] = _mm_add_epi16(s[4], s[11]); - in[5] = _mm_add_epi16(s[5], s[10]); - in[6] = _mm_add_epi16(s[6], s[9]); - in[7] = _mm_add_epi16(s[7], s[8]); - in[8] = _mm_sub_epi16(s[7], s[8]); - in[9] = _mm_sub_epi16(s[6], s[9]); - in[10] = _mm_sub_epi16(s[5], s[10]); - in[11] = _mm_sub_epi16(s[4], s[11]); - in[12] = _mm_sub_epi16(s[3], s[12]); - in[13] = _mm_sub_epi16(s[2], s[13]); - in[14] = _mm_sub_epi16(s[1], s[14]); - in[15] = _mm_sub_epi16(s[0], s[15]); -} - -static void idct16_sse2(__m128i *in0, __m128i *in1, int round) { - array_transpose_16x16(in0, in1); - idct16_8col(in0, round); - idct16_8col(in1, round); -} - -void vp9_idct16x16_256_add_ssse3(const int16_t *input, uint8_t *dest, - int stride) { - __m128i in0[16], in1[16]; - - load_buffer_8x16(input, in0); - input += 8; - load_buffer_8x16(input, in1); - - idct16_sse2(in0, in1, 0); - idct16_sse2(in0, in1, 1); - - write_buffer_8x16(dest, in0, stride); - dest += 8; - write_buffer_8x16(dest, in1, stride); -} - -static void idct16_10_r1(__m128i *in, __m128i *l) { - const __m128i rounding = _mm_set1_epi32(DCT_CONST_ROUNDING); - const __m128i zero = _mm_setzero_si128(); - - const __m128i stg2_01 = dual_set_epi16(3212, 32610); - const __m128i stg2_67 = dual_set_epi16(-9512, 31358); - const __m128i stg3_01 = dual_set_epi16(6392, 32138); - const __m128i stg4_01 = dual_set_epi16(23170, 23170); - - - - const __m128i stg4_4 = pair_set_epi16(-cospi_8_64, cospi_24_64); - const __m128i stg4_5 = pair_set_epi16(cospi_24_64, cospi_8_64); - const __m128i stg4_6 = pair_set_epi16(-cospi_24_64, -cospi_8_64); - const __m128i stg4_7 = pair_set_epi16(-cospi_8_64, cospi_24_64); - - __m128i stp1_0, stp1_1, stp1_4, stp1_6, - stp1_8, stp1_9, stp1_10, stp1_11, stp1_12, stp1_13, stp1_14, stp1_15; - __m128i stp2_0, stp2_1, stp2_2, stp2_3, stp2_4, stp2_5, stp2_6, stp2_7, - stp2_8, stp2_9, stp2_10, stp2_11, stp2_12, stp2_13; - __m128i tmp0, tmp1, tmp2, tmp3, tmp4; - - // Stage2 - { - const __m128i lo_1_15 = _mm_unpackhi_epi64(in[0], in[0]); - const __m128i lo_13_3 = _mm_unpackhi_epi64(in[1], in[1]); - - stp2_8 = _mm_mulhrs_epi16(lo_1_15, stg2_01); - stp2_11 = _mm_mulhrs_epi16(lo_13_3, stg2_67); - } - - // Stage3 - { - const __m128i lo_2_14 = _mm_unpacklo_epi64(in[1], in[1]); - stp1_4 = _mm_mulhrs_epi16(lo_2_14, stg3_01); - - stp1_13 = _mm_unpackhi_epi64(stp2_11, zero); - stp1_14 = _mm_unpackhi_epi64(stp2_8, zero); - } - - // Stage4 - { - const __m128i lo_0_8 = _mm_unpacklo_epi64(in[0], in[0]); - const __m128i lo_9_14 = _mm_unpacklo_epi16(stp2_8, stp1_14); - const __m128i lo_10_13 = _mm_unpacklo_epi16(stp2_11, stp1_13); - - tmp0 = _mm_mulhrs_epi16(lo_0_8, stg4_01); - tmp1 = _mm_madd_epi16(lo_9_14, stg4_4); - tmp3 = _mm_madd_epi16(lo_9_14, stg4_5); - tmp2 = _mm_madd_epi16(lo_10_13, stg4_6); - tmp4 = _mm_madd_epi16(lo_10_13, stg4_7); - - tmp1 = _mm_add_epi32(tmp1, rounding); - tmp3 = _mm_add_epi32(tmp3, rounding); - tmp2 = _mm_add_epi32(tmp2, rounding); - tmp4 = _mm_add_epi32(tmp4, rounding); - - tmp1 = _mm_srai_epi32(tmp1, DCT_CONST_BITS); - tmp3 = _mm_srai_epi32(tmp3, DCT_CONST_BITS); - tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS); - tmp4 = _mm_srai_epi32(tmp4, DCT_CONST_BITS); - - stp1_0 = _mm_unpacklo_epi64(tmp0, tmp0); - stp1_1 = _mm_unpackhi_epi64(tmp0, tmp0); - stp2_9 = _mm_packs_epi32(tmp1, tmp3); - stp2_10 = _mm_packs_epi32(tmp2, tmp4); - - stp2_6 = _mm_unpackhi_epi64(stp1_4, zero); - } - - // Stage5 and Stage6 - { - tmp0 = _mm_add_epi16(stp2_8, stp2_11); - tmp1 = _mm_sub_epi16(stp2_8, stp2_11); - tmp2 = _mm_add_epi16(stp2_9, stp2_10); - tmp3 = _mm_sub_epi16(stp2_9, stp2_10); - - stp1_9 = _mm_unpacklo_epi64(tmp2, zero); - stp1_10 = _mm_unpacklo_epi64(tmp3, zero); - stp1_8 = _mm_unpacklo_epi64(tmp0, zero); - stp1_11 = _mm_unpacklo_epi64(tmp1, zero); - - stp1_13 = _mm_unpackhi_epi64(tmp3, zero); - stp1_14 = _mm_unpackhi_epi64(tmp2, zero); - stp1_12 = _mm_unpackhi_epi64(tmp1, zero); - stp1_15 = _mm_unpackhi_epi64(tmp0, zero); - } - - // Stage6 - { - const __m128i lo_6_5 = _mm_add_epi16(stp2_6, stp1_4); - const __m128i lo_6_6 = _mm_sub_epi16(stp2_6, stp1_4); - const __m128i lo_10_13 = _mm_sub_epi16(stp1_13, stp1_10); - const __m128i lo_10_14 = _mm_add_epi16(stp1_13, stp1_10); - const __m128i lo_11_12 = _mm_sub_epi16(stp1_12, stp1_11); - const __m128i lo_11_13 = _mm_add_epi16(stp1_12, stp1_11); - - tmp1 = _mm_unpacklo_epi64(lo_6_5, lo_6_6); - tmp0 = _mm_unpacklo_epi64(lo_10_13, lo_10_14); - tmp4 = _mm_unpacklo_epi64(lo_11_12, lo_11_13); - - stp1_6 = _mm_mulhrs_epi16(tmp1, stg4_01); - tmp0 = _mm_mulhrs_epi16(tmp0, stg4_01); - tmp4 = _mm_mulhrs_epi16(tmp4, stg4_01); - - stp2_10 = _mm_unpacklo_epi64(tmp0, zero); - stp2_13 = _mm_unpackhi_epi64(tmp0, zero); - stp2_11 = _mm_unpacklo_epi64(tmp4, zero); - stp2_12 = _mm_unpackhi_epi64(tmp4, zero); - - tmp0 = _mm_add_epi16(stp1_0, stp1_4); - tmp1 = _mm_sub_epi16(stp1_0, stp1_4); - tmp2 = _mm_add_epi16(stp1_1, stp1_6); - tmp3 = _mm_sub_epi16(stp1_1, stp1_6); - - stp2_0 = _mm_unpackhi_epi64(tmp0, zero); - stp2_1 = _mm_unpacklo_epi64(tmp2, zero); - stp2_2 = _mm_unpackhi_epi64(tmp2, zero); - stp2_3 = _mm_unpacklo_epi64(tmp0, zero); - stp2_4 = _mm_unpacklo_epi64(tmp1, zero); - stp2_5 = _mm_unpackhi_epi64(tmp3, zero); - stp2_6 = _mm_unpacklo_epi64(tmp3, zero); - stp2_7 = _mm_unpackhi_epi64(tmp1, zero); - } - - // Stage7. Left 8x16 only. - l[0] = _mm_add_epi16(stp2_0, stp1_15); - l[1] = _mm_add_epi16(stp2_1, stp1_14); - l[2] = _mm_add_epi16(stp2_2, stp2_13); - l[3] = _mm_add_epi16(stp2_3, stp2_12); - l[4] = _mm_add_epi16(stp2_4, stp2_11); - l[5] = _mm_add_epi16(stp2_5, stp2_10); - l[6] = _mm_add_epi16(stp2_6, stp1_9); - l[7] = _mm_add_epi16(stp2_7, stp1_8); - l[8] = _mm_sub_epi16(stp2_7, stp1_8); - l[9] = _mm_sub_epi16(stp2_6, stp1_9); - l[10] = _mm_sub_epi16(stp2_5, stp2_10); - l[11] = _mm_sub_epi16(stp2_4, stp2_11); - l[12] = _mm_sub_epi16(stp2_3, stp2_12); - l[13] = _mm_sub_epi16(stp2_2, stp2_13); - l[14] = _mm_sub_epi16(stp2_1, stp1_14); - l[15] = _mm_sub_epi16(stp2_0, stp1_15); -} - -static void idct16_10_r2(__m128i *in) { - const __m128i rounding = _mm_set1_epi32(DCT_CONST_ROUNDING); - - const __m128i stg2_0 = dual_set_epi16(3212, 3212); - const __m128i stg2_1 = dual_set_epi16(32610, 32610); - const __m128i stg2_6 = dual_set_epi16(-9512, -9512); - const __m128i stg2_7 = dual_set_epi16(31358, 31358); - const __m128i stg3_0 = dual_set_epi16(6392, 6392); - const __m128i stg3_1 = dual_set_epi16(32138, 32138); - const __m128i stg4_01 = dual_set_epi16(23170, 23170); - - const __m128i stg4_4 = pair_set_epi16(-cospi_8_64, cospi_24_64); - const __m128i stg4_5 = pair_set_epi16(cospi_24_64, cospi_8_64); - const __m128i stg4_6 = pair_set_epi16(-cospi_24_64, -cospi_8_64); - const __m128i stg4_7 = pair_set_epi16(-cospi_8_64, cospi_24_64); - - __m128i stp1_0, stp1_2, stp1_3, stp1_5, stp1_6, - stp1_8, stp1_9, stp1_10, stp1_11, stp1_12, stp1_13, stp1_14, stp1_15, - stp1_8_0, stp1_12_0; - __m128i stp2_0, stp2_1, stp2_2, stp2_3, stp2_4, stp2_5, stp2_6, stp2_7, - stp2_9, stp2_10, stp2_11, stp2_12, stp2_13, stp2_14; - __m128i tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - - /* Stage2 */ - { - stp1_8_0 = _mm_mulhrs_epi16(in[1], stg2_0); - stp1_15 = _mm_mulhrs_epi16(in[1], stg2_1); - stp1_11 = _mm_mulhrs_epi16(in[3], stg2_6); - stp1_12_0 = _mm_mulhrs_epi16(in[3], stg2_7); - } - - /* Stage3 */ - { - stp2_4 = _mm_mulhrs_epi16(in[2], stg3_0); - stp2_7 = _mm_mulhrs_epi16(in[2], stg3_1); - - stp1_9 = stp1_8_0; - stp1_10 = stp1_11; - - stp1_13 = stp1_12_0; - stp1_14 = stp1_15; - } - - /* Stage4 */ - { - const __m128i lo_9_14 = _mm_unpacklo_epi16(stp1_9, stp1_14); - const __m128i hi_9_14 = _mm_unpackhi_epi16(stp1_9, stp1_14); - const __m128i lo_10_13 = _mm_unpacklo_epi16(stp1_10, stp1_13); - const __m128i hi_10_13 = _mm_unpackhi_epi16(stp1_10, stp1_13); - - stp1_0 = _mm_mulhrs_epi16(in[0], stg4_01); - - stp2_5 = stp2_4; - stp2_6 = stp2_7; - - - tmp0 = _mm_madd_epi16(lo_9_14, stg4_4); - tmp1 = _mm_madd_epi16(hi_9_14, stg4_4); - tmp2 = _mm_madd_epi16(lo_9_14, stg4_5); - tmp3 = _mm_madd_epi16(hi_9_14, stg4_5); - tmp4 = _mm_madd_epi16(lo_10_13, stg4_6); - tmp5 = _mm_madd_epi16(hi_10_13, stg4_6); - tmp6 = _mm_madd_epi16(lo_10_13, stg4_7); - tmp7 = _mm_madd_epi16(hi_10_13, stg4_7); - - tmp0 = _mm_add_epi32(tmp0, rounding); - tmp1 = _mm_add_epi32(tmp1, rounding); - tmp2 = _mm_add_epi32(tmp2, rounding); - tmp3 = _mm_add_epi32(tmp3, rounding); - tmp4 = _mm_add_epi32(tmp4, rounding); - tmp5 = _mm_add_epi32(tmp5, rounding); - tmp6 = _mm_add_epi32(tmp6, rounding); - tmp7 = _mm_add_epi32(tmp7, rounding); - - tmp0 = _mm_srai_epi32(tmp0, 14); - tmp1 = _mm_srai_epi32(tmp1, 14); - tmp2 = _mm_srai_epi32(tmp2, 14); - tmp3 = _mm_srai_epi32(tmp3, 14); - tmp4 = _mm_srai_epi32(tmp4, 14); - tmp5 = _mm_srai_epi32(tmp5, 14); - tmp6 = _mm_srai_epi32(tmp6, 14); - tmp7 = _mm_srai_epi32(tmp7, 14); - - stp2_9 = _mm_packs_epi32(tmp0, tmp1); - stp2_14 = _mm_packs_epi32(tmp2, tmp3); - stp2_10 = _mm_packs_epi32(tmp4, tmp5); - stp2_13 = _mm_packs_epi32(tmp6, tmp7); - } - - /* Stage5 */ - { - stp1_2 = stp1_0; - stp1_3 = stp1_0; - - tmp0 = _mm_sub_epi16(stp2_6, stp2_5); - tmp1 = _mm_add_epi16(stp2_6, stp2_5); - - stp1_5 = _mm_mulhrs_epi16(tmp0, stg4_01); - stp1_6 = _mm_mulhrs_epi16(tmp1, stg4_01); - - stp1_8 = _mm_add_epi16(stp1_8_0, stp1_11); - stp1_9 = _mm_add_epi16(stp2_9, stp2_10); - stp1_10 = _mm_sub_epi16(stp2_9, stp2_10); - stp1_11 = _mm_sub_epi16(stp1_8_0, stp1_11); - - stp1_12 = _mm_sub_epi16(stp1_15, stp1_12_0); - stp1_13 = _mm_sub_epi16(stp2_14, stp2_13); - stp1_14 = _mm_add_epi16(stp2_14, stp2_13); - stp1_15 = _mm_add_epi16(stp1_15, stp1_12_0); - } - - /* Stage6 */ - { - stp2_0 = _mm_add_epi16(stp1_0, stp2_7); - stp2_1 = _mm_add_epi16(stp1_0, stp1_6); - stp2_2 = _mm_add_epi16(stp1_2, stp1_5); - stp2_3 = _mm_add_epi16(stp1_3, stp2_4); - - tmp0 = _mm_sub_epi16(stp1_13, stp1_10); - tmp1 = _mm_add_epi16(stp1_13, stp1_10); - tmp2 = _mm_sub_epi16(stp1_12, stp1_11); - tmp3 = _mm_add_epi16(stp1_12, stp1_11); - - stp2_4 = _mm_sub_epi16(stp1_3, stp2_4); - stp2_5 = _mm_sub_epi16(stp1_2, stp1_5); - stp2_6 = _mm_sub_epi16(stp1_0, stp1_6); - stp2_7 = _mm_sub_epi16(stp1_0, stp2_7); - - stp2_10 = _mm_mulhrs_epi16(tmp0, stg4_01); - stp2_13 = _mm_mulhrs_epi16(tmp1, stg4_01); - stp2_11 = _mm_mulhrs_epi16(tmp2, stg4_01); - stp2_12 = _mm_mulhrs_epi16(tmp3, stg4_01); - } - - // Stage7 - in[0] = _mm_add_epi16(stp2_0, stp1_15); - in[1] = _mm_add_epi16(stp2_1, stp1_14); - in[2] = _mm_add_epi16(stp2_2, stp2_13); - in[3] = _mm_add_epi16(stp2_3, stp2_12); - in[4] = _mm_add_epi16(stp2_4, stp2_11); - in[5] = _mm_add_epi16(stp2_5, stp2_10); - in[6] = _mm_add_epi16(stp2_6, stp1_9); - in[7] = _mm_add_epi16(stp2_7, stp1_8); - in[8] = _mm_sub_epi16(stp2_7, stp1_8); - in[9] = _mm_sub_epi16(stp2_6, stp1_9); - in[10] = _mm_sub_epi16(stp2_5, stp2_10); - in[11] = _mm_sub_epi16(stp2_4, stp2_11); - in[12] = _mm_sub_epi16(stp2_3, stp2_12); - in[13] = _mm_sub_epi16(stp2_2, stp2_13); - in[14] = _mm_sub_epi16(stp2_1, stp1_14); - in[15] = _mm_sub_epi16(stp2_0, stp1_15); -} - -void vp9_idct16x16_10_add_ssse3(const int16_t *input, uint8_t *dest, - int stride) { - const __m128i final_rounding = _mm_set1_epi16(1<<5); - const __m128i zero = _mm_setzero_si128(); - __m128i in[16], l[16]; - - int i; - // First 1-D inverse DCT - // Load input data. - in[0] = _mm_load_si128((const __m128i *)input); - in[1] = _mm_load_si128((const __m128i *)(input + 8 * 2)); - in[2] = _mm_load_si128((const __m128i *)(input + 8 * 4)); - in[3] = _mm_load_si128((const __m128i *)(input + 8 * 6)); - - TRANSPOSE_8X4(in[0], in[1], in[2], in[3], in[0], in[1]); - - idct16_10_r1(in, l); - - // Second 1-D inverse transform, performed per 8x16 block - for (i = 0; i < 2; i++) { - array_transpose_4X8(l + 8*i, in); - - idct16_10_r2(in); - - // Final rounding and shift - in[0] = _mm_adds_epi16(in[0], final_rounding); - in[1] = _mm_adds_epi16(in[1], final_rounding); - in[2] = _mm_adds_epi16(in[2], final_rounding); - in[3] = _mm_adds_epi16(in[3], final_rounding); - in[4] = _mm_adds_epi16(in[4], final_rounding); - in[5] = _mm_adds_epi16(in[5], final_rounding); - in[6] = _mm_adds_epi16(in[6], final_rounding); - in[7] = _mm_adds_epi16(in[7], final_rounding); - in[8] = _mm_adds_epi16(in[8], final_rounding); - in[9] = _mm_adds_epi16(in[9], final_rounding); - in[10] = _mm_adds_epi16(in[10], final_rounding); - in[11] = _mm_adds_epi16(in[11], final_rounding); - in[12] = _mm_adds_epi16(in[12], final_rounding); - in[13] = _mm_adds_epi16(in[13], final_rounding); - in[14] = _mm_adds_epi16(in[14], final_rounding); - in[15] = _mm_adds_epi16(in[15], final_rounding); - - in[0] = _mm_srai_epi16(in[0], 6); - in[1] = _mm_srai_epi16(in[1], 6); - in[2] = _mm_srai_epi16(in[2], 6); - in[3] = _mm_srai_epi16(in[3], 6); - in[4] = _mm_srai_epi16(in[4], 6); - in[5] = _mm_srai_epi16(in[5], 6); - in[6] = _mm_srai_epi16(in[6], 6); - in[7] = _mm_srai_epi16(in[7], 6); - in[8] = _mm_srai_epi16(in[8], 6); - in[9] = _mm_srai_epi16(in[9], 6); - in[10] = _mm_srai_epi16(in[10], 6); - in[11] = _mm_srai_epi16(in[11], 6); - in[12] = _mm_srai_epi16(in[12], 6); - in[13] = _mm_srai_epi16(in[13], 6); - in[14] = _mm_srai_epi16(in[14], 6); - in[15] = _mm_srai_epi16(in[15], 6); - - RECON_AND_STORE(dest, in[0]); - RECON_AND_STORE(dest, in[1]); - RECON_AND_STORE(dest, in[2]); - RECON_AND_STORE(dest, in[3]); - RECON_AND_STORE(dest, in[4]); - RECON_AND_STORE(dest, in[5]); - RECON_AND_STORE(dest, in[6]); - RECON_AND_STORE(dest, in[7]); - RECON_AND_STORE(dest, in[8]); - RECON_AND_STORE(dest, in[9]); - RECON_AND_STORE(dest, in[10]); - RECON_AND_STORE(dest, in[11]); - RECON_AND_STORE(dest, in[12]); - RECON_AND_STORE(dest, in[13]); - RECON_AND_STORE(dest, in[14]); - RECON_AND_STORE(dest, in[15]); - - dest += 8 - (stride * 16); - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_idct_ssse3_x86_64.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_idct_ssse3_x86_64.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_idct_ssse3_x86_64.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_idct_ssse3_x86_64.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,300 +0,0 @@ -; -; Copyright (c) 2014 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; -%include "third_party/x86inc/x86inc.asm" - -; This file provides SSSE3 version of the inverse transformation. Part -; of the functions are originally derived from the ffmpeg project. -; Note that the current version applies to x86 64-bit only. - -SECTION_RODATA - -pw_11585x2: times 8 dw 23170 -pd_8192: times 4 dd 8192 -pw_16: times 8 dw 16 - -%macro TRANSFORM_COEFFS 2 -pw_%1_%2: dw %1, %2, %1, %2, %1, %2, %1, %2 -pw_m%2_%1: dw -%2, %1, -%2, %1, -%2, %1, -%2, %1 -%endmacro - -TRANSFORM_COEFFS 6270, 15137 -TRANSFORM_COEFFS 3196, 16069 -TRANSFORM_COEFFS 13623, 9102 - -%macro PAIR_PP_COEFFS 2 -dpw_%1_%2: dw %1, %1, %1, %1, %2, %2, %2, %2 -%endmacro - -%macro PAIR_MP_COEFFS 2 -dpw_m%1_%2: dw -%1, -%1, -%1, -%1, %2, %2, %2, %2 -%endmacro - -%macro PAIR_MM_COEFFS 2 -dpw_m%1_m%2: dw -%1, -%1, -%1, -%1, -%2, -%2, -%2, -%2 -%endmacro - -PAIR_PP_COEFFS 30274, 12540 -PAIR_PP_COEFFS 6392, 32138 -PAIR_MP_COEFFS 18204, 27246 - -PAIR_PP_COEFFS 12540, 12540 -PAIR_PP_COEFFS 30274, 30274 -PAIR_PP_COEFFS 6392, 6392 -PAIR_PP_COEFFS 32138, 32138 -PAIR_MM_COEFFS 18204, 18204 -PAIR_PP_COEFFS 27246, 27246 - -SECTION .text - -%if ARCH_X86_64 -%macro SUM_SUB 3 - psubw m%3, m%1, m%2 - paddw m%1, m%2 - SWAP %2, %3 -%endmacro - -; butterfly operation -%macro MUL_ADD_2X 6 ; dst1, dst2, src, round, coefs1, coefs2 - pmaddwd m%1, m%3, %5 - pmaddwd m%2, m%3, %6 - paddd m%1, %4 - paddd m%2, %4 - psrad m%1, 14 - psrad m%2, 14 -%endmacro - -%macro BUTTERFLY_4X 7 ; dst1, dst2, coef1, coef2, round, tmp1, tmp2 - punpckhwd m%6, m%2, m%1 - MUL_ADD_2X %7, %6, %6, %5, [pw_m%4_%3], [pw_%3_%4] - punpcklwd m%2, m%1 - MUL_ADD_2X %1, %2, %2, %5, [pw_m%4_%3], [pw_%3_%4] - packssdw m%1, m%7 - packssdw m%2, m%6 -%endmacro - -; matrix transpose -%macro INTERLEAVE_2X 4 - punpckh%1 m%4, m%2, m%3 - punpckl%1 m%2, m%3 - SWAP %3, %4 -%endmacro - -%macro TRANSPOSE8X8 9 - INTERLEAVE_2X wd, %1, %2, %9 - INTERLEAVE_2X wd, %3, %4, %9 - INTERLEAVE_2X wd, %5, %6, %9 - INTERLEAVE_2X wd, %7, %8, %9 - - INTERLEAVE_2X dq, %1, %3, %9 - INTERLEAVE_2X dq, %2, %4, %9 - INTERLEAVE_2X dq, %5, %7, %9 - INTERLEAVE_2X dq, %6, %8, %9 - - INTERLEAVE_2X qdq, %1, %5, %9 - INTERLEAVE_2X qdq, %3, %7, %9 - INTERLEAVE_2X qdq, %2, %6, %9 - INTERLEAVE_2X qdq, %4, %8, %9 - - SWAP %2, %5 - SWAP %4, %7 -%endmacro - -%macro IDCT8_1D 0 - SUM_SUB 0, 4, 9 - BUTTERFLY_4X 2, 6, 6270, 15137, m8, 9, 10 - pmulhrsw m0, m12 - pmulhrsw m4, m12 - BUTTERFLY_4X 1, 7, 3196, 16069, m8, 9, 10 - BUTTERFLY_4X 5, 3, 13623, 9102, m8, 9, 10 - - SUM_SUB 1, 5, 9 - SUM_SUB 7, 3, 9 - SUM_SUB 0, 6, 9 - SUM_SUB 4, 2, 9 - SUM_SUB 3, 5, 9 - pmulhrsw m3, m12 - pmulhrsw m5, m12 - - SUM_SUB 0, 7, 9 - SUM_SUB 4, 3, 9 - SUM_SUB 2, 5, 9 - SUM_SUB 6, 1, 9 - - SWAP 3, 6 - SWAP 1, 4 -%endmacro - -; This macro handles 8 pixels per line -%macro ADD_STORE_8P_2X 5; src1, src2, tmp1, tmp2, zero - paddw m%1, m11 - paddw m%2, m11 - psraw m%1, 5 - psraw m%2, 5 - - movh m%3, [outputq] - movh m%4, [outputq + strideq] - punpcklbw m%3, m%5 - punpcklbw m%4, m%5 - paddw m%3, m%1 - paddw m%4, m%2 - packuswb m%3, m%5 - packuswb m%4, m%5 - movh [outputq], m%3 - movh [outputq + strideq], m%4 -%endmacro - -INIT_XMM ssse3 -; full inverse 8x8 2D-DCT transform -cglobal idct8x8_64_add, 3, 5, 13, input, output, stride - mova m8, [pd_8192] - mova m11, [pw_16] - mova m12, [pw_11585x2] - - lea r3, [2 * strideq] - - mova m0, [inputq + 0] - mova m1, [inputq + 16] - mova m2, [inputq + 32] - mova m3, [inputq + 48] - mova m4, [inputq + 64] - mova m5, [inputq + 80] - mova m6, [inputq + 96] - mova m7, [inputq + 112] - - TRANSPOSE8X8 0, 1, 2, 3, 4, 5, 6, 7, 9 - IDCT8_1D - TRANSPOSE8X8 0, 1, 2, 3, 4, 5, 6, 7, 9 - IDCT8_1D - - pxor m12, m12 - ADD_STORE_8P_2X 0, 1, 9, 10, 12 - lea outputq, [outputq + r3] - ADD_STORE_8P_2X 2, 3, 9, 10, 12 - lea outputq, [outputq + r3] - ADD_STORE_8P_2X 4, 5, 9, 10, 12 - lea outputq, [outputq + r3] - ADD_STORE_8P_2X 6, 7, 9, 10, 12 - - RET - -; inverse 8x8 2D-DCT transform with only first 10 coeffs non-zero -cglobal idct8x8_12_add, 3, 5, 13, input, output, stride - mova m8, [pd_8192] - mova m11, [pw_16] - mova m12, [pw_11585x2] - - lea r3, [2 * strideq] - - mova m0, [inputq + 0] - mova m1, [inputq + 16] - mova m2, [inputq + 32] - mova m3, [inputq + 48] - - punpcklwd m0, m1 - punpcklwd m2, m3 - punpckhdq m9, m0, m2 - punpckldq m0, m2 - SWAP 2, 9 - - ; m0 -> [0], [0] - ; m1 -> [1], [1] - ; m2 -> [2], [2] - ; m3 -> [3], [3] - punpckhqdq m10, m0, m0 - punpcklqdq m0, m0 - punpckhqdq m9, m2, m2 - punpcklqdq m2, m2 - SWAP 1, 10 - SWAP 3, 9 - - pmulhrsw m0, m12 - pmulhrsw m2, [dpw_30274_12540] - pmulhrsw m1, [dpw_6392_32138] - pmulhrsw m3, [dpw_m18204_27246] - - SUM_SUB 0, 2, 9 - SUM_SUB 1, 3, 9 - - punpcklqdq m9, m3, m3 - punpckhqdq m5, m3, m9 - - SUM_SUB 3, 5, 9 - punpckhqdq m5, m3 - pmulhrsw m5, m12 - - punpckhqdq m9, m1, m5 - punpcklqdq m1, m5 - SWAP 5, 9 - - SUM_SUB 0, 5, 9 - SUM_SUB 2, 1, 9 - - punpckhqdq m3, m0, m0 - punpckhqdq m4, m1, m1 - punpckhqdq m6, m5, m5 - punpckhqdq m7, m2, m2 - - punpcklwd m0, m3 - punpcklwd m7, m2 - punpcklwd m1, m4 - punpcklwd m6, m5 - - punpckhdq m4, m0, m7 - punpckldq m0, m7 - punpckhdq m10, m1, m6 - punpckldq m5, m1, m6 - - punpckhqdq m1, m0, m5 - punpcklqdq m0, m5 - punpckhqdq m3, m4, m10 - punpcklqdq m2, m4, m10 - - - pmulhrsw m0, m12 - pmulhrsw m6, m2, [dpw_30274_30274] - pmulhrsw m4, m2, [dpw_12540_12540] - - pmulhrsw m7, m1, [dpw_32138_32138] - pmulhrsw m1, [dpw_6392_6392] - pmulhrsw m5, m3, [dpw_m18204_m18204] - pmulhrsw m3, [dpw_27246_27246] - - mova m2, m0 - SUM_SUB 0, 6, 9 - SUM_SUB 2, 4, 9 - SUM_SUB 1, 5, 9 - SUM_SUB 7, 3, 9 - - SUM_SUB 3, 5, 9 - pmulhrsw m3, m12 - pmulhrsw m5, m12 - - SUM_SUB 0, 7, 9 - SUM_SUB 2, 3, 9 - SUM_SUB 4, 5, 9 - SUM_SUB 6, 1, 9 - - SWAP 3, 6 - SWAP 1, 2 - SWAP 2, 4 - - - pxor m12, m12 - ADD_STORE_8P_2X 0, 1, 9, 10, 12 - lea outputq, [outputq + r3] - ADD_STORE_8P_2X 2, 3, 9, 10, 12 - lea outputq, [outputq + r3] - ADD_STORE_8P_2X 4, 5, 9, 10, 12 - lea outputq, [outputq + r3] - ADD_STORE_8P_2X 6, 7, 9, 10, 12 - - RET - -%endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_loopfilter_intrin_avx2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_loopfilter_intrin_avx2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_loopfilter_intrin_avx2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_loopfilter_intrin_avx2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,984 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include /* AVX2 */ -#include "vpx_ports/mem.h" - -static void mb_lpf_horizontal_edge_w_avx2_8(unsigned char *s, int p, - const unsigned char *_blimit, const unsigned char *_limit, - const unsigned char *_thresh) { - __m128i mask, hev, flat, flat2; - const __m128i zero = _mm_set1_epi16(0); - const __m128i one = _mm_set1_epi8(1); - __m128i q7p7, q6p6, q5p5, q4p4, q3p3, q2p2, q1p1, q0p0, p0q0, p1q1; - __m128i abs_p1p0; - - const __m128i thresh = _mm_broadcastb_epi8( - _mm_cvtsi32_si128((int) _thresh[0])); - const __m128i limit = _mm_broadcastb_epi8( - _mm_cvtsi32_si128((int) _limit[0])); - const __m128i blimit = _mm_broadcastb_epi8( - _mm_cvtsi32_si128((int) _blimit[0])); - - q4p4 = _mm_loadl_epi64((__m128i *) (s - 5 * p)); - q4p4 = _mm_castps_si128( - _mm_loadh_pi(_mm_castsi128_ps(q4p4), (__m64 *) (s + 4 * p))); - q3p3 = _mm_loadl_epi64((__m128i *) (s - 4 * p)); - q3p3 = _mm_castps_si128( - _mm_loadh_pi(_mm_castsi128_ps(q3p3), (__m64 *) (s + 3 * p))); - q2p2 = _mm_loadl_epi64((__m128i *) (s - 3 * p)); - q2p2 = _mm_castps_si128( - _mm_loadh_pi(_mm_castsi128_ps(q2p2), (__m64 *) (s + 2 * p))); - q1p1 = _mm_loadl_epi64((__m128i *) (s - 2 * p)); - q1p1 = _mm_castps_si128( - _mm_loadh_pi(_mm_castsi128_ps(q1p1), (__m64 *) (s + 1 * p))); - p1q1 = _mm_shuffle_epi32(q1p1, 78); - q0p0 = _mm_loadl_epi64((__m128i *) (s - 1 * p)); - q0p0 = _mm_castps_si128( - _mm_loadh_pi(_mm_castsi128_ps(q0p0), (__m64 *) (s - 0 * p))); - p0q0 = _mm_shuffle_epi32(q0p0, 78); - - { - __m128i abs_p1q1, abs_p0q0, abs_q1q0, fe, ff, work; - abs_p1p0 = _mm_or_si128(_mm_subs_epu8(q1p1, q0p0), - _mm_subs_epu8(q0p0, q1p1)); - abs_q1q0 = _mm_srli_si128(abs_p1p0, 8); - fe = _mm_set1_epi8(0xfe); - ff = _mm_cmpeq_epi8(abs_p1p0, abs_p1p0); - abs_p0q0 = _mm_or_si128(_mm_subs_epu8(q0p0, p0q0), - _mm_subs_epu8(p0q0, q0p0)); - abs_p1q1 = _mm_or_si128(_mm_subs_epu8(q1p1, p1q1), - _mm_subs_epu8(p1q1, q1p1)); - flat = _mm_max_epu8(abs_p1p0, abs_q1q0); - hev = _mm_subs_epu8(flat, thresh); - hev = _mm_xor_si128(_mm_cmpeq_epi8(hev, zero), ff); - - abs_p0q0 = _mm_adds_epu8(abs_p0q0, abs_p0q0); - abs_p1q1 = _mm_srli_epi16(_mm_and_si128(abs_p1q1, fe), 1); - mask = _mm_subs_epu8(_mm_adds_epu8(abs_p0q0, abs_p1q1), blimit); - mask = _mm_xor_si128(_mm_cmpeq_epi8(mask, zero), ff); - // mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 > blimit) * -1; - mask = _mm_max_epu8(abs_p1p0, mask); - // mask |= (abs(p1 - p0) > limit) * -1; - // mask |= (abs(q1 - q0) > limit) * -1; - - work = _mm_max_epu8( - _mm_or_si128(_mm_subs_epu8(q2p2, q1p1), - _mm_subs_epu8(q1p1, q2p2)), - _mm_or_si128(_mm_subs_epu8(q3p3, q2p2), - _mm_subs_epu8(q2p2, q3p3))); - mask = _mm_max_epu8(work, mask); - mask = _mm_max_epu8(mask, _mm_srli_si128(mask, 8)); - mask = _mm_subs_epu8(mask, limit); - mask = _mm_cmpeq_epi8(mask, zero); - } - - // lp filter - { - const __m128i t4 = _mm_set1_epi8(4); - const __m128i t3 = _mm_set1_epi8(3); - const __m128i t80 = _mm_set1_epi8(0x80); - const __m128i t1 = _mm_set1_epi16(0x1); - __m128i qs1ps1 = _mm_xor_si128(q1p1, t80); - __m128i qs0ps0 = _mm_xor_si128(q0p0, t80); - __m128i qs0 = _mm_xor_si128(p0q0, t80); - __m128i qs1 = _mm_xor_si128(p1q1, t80); - __m128i filt; - __m128i work_a; - __m128i filter1, filter2; - __m128i flat2_q6p6, flat2_q5p5, flat2_q4p4, flat2_q3p3, flat2_q2p2; - __m128i flat2_q1p1, flat2_q0p0, flat_q2p2, flat_q1p1, flat_q0p0; - - filt = _mm_and_si128(_mm_subs_epi8(qs1ps1, qs1), hev); - work_a = _mm_subs_epi8(qs0, qs0ps0); - filt = _mm_adds_epi8(filt, work_a); - filt = _mm_adds_epi8(filt, work_a); - filt = _mm_adds_epi8(filt, work_a); - /* (vp9_filter + 3 * (qs0 - ps0)) & mask */ - filt = _mm_and_si128(filt, mask); - - filter1 = _mm_adds_epi8(filt, t4); - filter2 = _mm_adds_epi8(filt, t3); - - filter1 = _mm_unpacklo_epi8(zero, filter1); - filter1 = _mm_srai_epi16(filter1, 0xB); - filter2 = _mm_unpacklo_epi8(zero, filter2); - filter2 = _mm_srai_epi16(filter2, 0xB); - - /* Filter1 >> 3 */ - filt = _mm_packs_epi16(filter2, _mm_subs_epi16(zero, filter1)); - qs0ps0 = _mm_xor_si128(_mm_adds_epi8(qs0ps0, filt), t80); - - /* filt >> 1 */ - filt = _mm_adds_epi16(filter1, t1); - filt = _mm_srai_epi16(filt, 1); - filt = _mm_andnot_si128( - _mm_srai_epi16(_mm_unpacklo_epi8(zero, hev), 0x8), filt); - filt = _mm_packs_epi16(filt, _mm_subs_epi16(zero, filt)); - qs1ps1 = _mm_xor_si128(_mm_adds_epi8(qs1ps1, filt), t80); - // loopfilter done - - { - __m128i work; - flat = _mm_max_epu8( - _mm_or_si128(_mm_subs_epu8(q2p2, q0p0), - _mm_subs_epu8(q0p0, q2p2)), - _mm_or_si128(_mm_subs_epu8(q3p3, q0p0), - _mm_subs_epu8(q0p0, q3p3))); - flat = _mm_max_epu8(abs_p1p0, flat); - flat = _mm_max_epu8(flat, _mm_srli_si128(flat, 8)); - flat = _mm_subs_epu8(flat, one); - flat = _mm_cmpeq_epi8(flat, zero); - flat = _mm_and_si128(flat, mask); - - q5p5 = _mm_loadl_epi64((__m128i *) (s - 6 * p)); - q5p5 = _mm_castps_si128( - _mm_loadh_pi(_mm_castsi128_ps(q5p5), - (__m64 *) (s + 5 * p))); - - q6p6 = _mm_loadl_epi64((__m128i *) (s - 7 * p)); - q6p6 = _mm_castps_si128( - _mm_loadh_pi(_mm_castsi128_ps(q6p6), - (__m64 *) (s + 6 * p))); - - flat2 = _mm_max_epu8( - _mm_or_si128(_mm_subs_epu8(q4p4, q0p0), - _mm_subs_epu8(q0p0, q4p4)), - _mm_or_si128(_mm_subs_epu8(q5p5, q0p0), - _mm_subs_epu8(q0p0, q5p5))); - - q7p7 = _mm_loadl_epi64((__m128i *) (s - 8 * p)); - q7p7 = _mm_castps_si128( - _mm_loadh_pi(_mm_castsi128_ps(q7p7), - (__m64 *) (s + 7 * p))); - - work = _mm_max_epu8( - _mm_or_si128(_mm_subs_epu8(q6p6, q0p0), - _mm_subs_epu8(q0p0, q6p6)), - _mm_or_si128(_mm_subs_epu8(q7p7, q0p0), - _mm_subs_epu8(q0p0, q7p7))); - - flat2 = _mm_max_epu8(work, flat2); - flat2 = _mm_max_epu8(flat2, _mm_srli_si128(flat2, 8)); - flat2 = _mm_subs_epu8(flat2, one); - flat2 = _mm_cmpeq_epi8(flat2, zero); - flat2 = _mm_and_si128(flat2, flat); // flat2 & flat & mask - } - - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // flat and wide flat calculations - { - const __m128i eight = _mm_set1_epi16(8); - const __m128i four = _mm_set1_epi16(4); - __m128i p7_16, p6_16, p5_16, p4_16, p3_16, p2_16, p1_16, p0_16; - __m128i q7_16, q6_16, q5_16, q4_16, q3_16, q2_16, q1_16, q0_16; - __m128i pixelFilter_p, pixelFilter_q; - __m128i pixetFilter_p2p1p0, pixetFilter_q2q1q0; - __m128i sum_p7, sum_q7, sum_p3, sum_q3, res_p, res_q; - - p7_16 = _mm_unpacklo_epi8(q7p7, zero); - p6_16 = _mm_unpacklo_epi8(q6p6, zero); - p5_16 = _mm_unpacklo_epi8(q5p5, zero); - p4_16 = _mm_unpacklo_epi8(q4p4, zero); - p3_16 = _mm_unpacklo_epi8(q3p3, zero); - p2_16 = _mm_unpacklo_epi8(q2p2, zero); - p1_16 = _mm_unpacklo_epi8(q1p1, zero); - p0_16 = _mm_unpacklo_epi8(q0p0, zero); - q0_16 = _mm_unpackhi_epi8(q0p0, zero); - q1_16 = _mm_unpackhi_epi8(q1p1, zero); - q2_16 = _mm_unpackhi_epi8(q2p2, zero); - q3_16 = _mm_unpackhi_epi8(q3p3, zero); - q4_16 = _mm_unpackhi_epi8(q4p4, zero); - q5_16 = _mm_unpackhi_epi8(q5p5, zero); - q6_16 = _mm_unpackhi_epi8(q6p6, zero); - q7_16 = _mm_unpackhi_epi8(q7p7, zero); - - pixelFilter_p = _mm_add_epi16(_mm_add_epi16(p6_16, p5_16), - _mm_add_epi16(p4_16, p3_16)); - pixelFilter_q = _mm_add_epi16(_mm_add_epi16(q6_16, q5_16), - _mm_add_epi16(q4_16, q3_16)); - - pixetFilter_p2p1p0 = _mm_add_epi16(p0_16, - _mm_add_epi16(p2_16, p1_16)); - pixelFilter_p = _mm_add_epi16(pixelFilter_p, pixetFilter_p2p1p0); - - pixetFilter_q2q1q0 = _mm_add_epi16(q0_16, - _mm_add_epi16(q2_16, q1_16)); - pixelFilter_q = _mm_add_epi16(pixelFilter_q, pixetFilter_q2q1q0); - pixelFilter_p = _mm_add_epi16(eight, - _mm_add_epi16(pixelFilter_p, pixelFilter_q)); - pixetFilter_p2p1p0 = _mm_add_epi16(four, - _mm_add_epi16(pixetFilter_p2p1p0, pixetFilter_q2q1q0)); - res_p = _mm_srli_epi16( - _mm_add_epi16(pixelFilter_p, _mm_add_epi16(p7_16, p0_16)), - 4); - res_q = _mm_srli_epi16( - _mm_add_epi16(pixelFilter_p, _mm_add_epi16(q7_16, q0_16)), - 4); - flat2_q0p0 = _mm_packus_epi16(res_p, res_q); - res_p = _mm_srli_epi16( - _mm_add_epi16(pixetFilter_p2p1p0, - _mm_add_epi16(p3_16, p0_16)), 3); - res_q = _mm_srli_epi16( - _mm_add_epi16(pixetFilter_p2p1p0, - _mm_add_epi16(q3_16, q0_16)), 3); - - flat_q0p0 = _mm_packus_epi16(res_p, res_q); - - sum_p7 = _mm_add_epi16(p7_16, p7_16); - sum_q7 = _mm_add_epi16(q7_16, q7_16); - sum_p3 = _mm_add_epi16(p3_16, p3_16); - sum_q3 = _mm_add_epi16(q3_16, q3_16); - - pixelFilter_q = _mm_sub_epi16(pixelFilter_p, p6_16); - pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q6_16); - res_p = _mm_srli_epi16( - _mm_add_epi16(pixelFilter_p, _mm_add_epi16(sum_p7, p1_16)), - 4); - res_q = _mm_srli_epi16( - _mm_add_epi16(pixelFilter_q, _mm_add_epi16(sum_q7, q1_16)), - 4); - flat2_q1p1 = _mm_packus_epi16(res_p, res_q); - - pixetFilter_q2q1q0 = _mm_sub_epi16(pixetFilter_p2p1p0, p2_16); - pixetFilter_p2p1p0 = _mm_sub_epi16(pixetFilter_p2p1p0, q2_16); - res_p = _mm_srli_epi16( - _mm_add_epi16(pixetFilter_p2p1p0, - _mm_add_epi16(sum_p3, p1_16)), 3); - res_q = _mm_srli_epi16( - _mm_add_epi16(pixetFilter_q2q1q0, - _mm_add_epi16(sum_q3, q1_16)), 3); - flat_q1p1 = _mm_packus_epi16(res_p, res_q); - - sum_p7 = _mm_add_epi16(sum_p7, p7_16); - sum_q7 = _mm_add_epi16(sum_q7, q7_16); - sum_p3 = _mm_add_epi16(sum_p3, p3_16); - sum_q3 = _mm_add_epi16(sum_q3, q3_16); - - pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q5_16); - pixelFilter_q = _mm_sub_epi16(pixelFilter_q, p5_16); - res_p = _mm_srli_epi16( - _mm_add_epi16(pixelFilter_p, _mm_add_epi16(sum_p7, p2_16)), - 4); - res_q = _mm_srli_epi16( - _mm_add_epi16(pixelFilter_q, _mm_add_epi16(sum_q7, q2_16)), - 4); - flat2_q2p2 = _mm_packus_epi16(res_p, res_q); - - pixetFilter_p2p1p0 = _mm_sub_epi16(pixetFilter_p2p1p0, q1_16); - pixetFilter_q2q1q0 = _mm_sub_epi16(pixetFilter_q2q1q0, p1_16); - - res_p = _mm_srli_epi16( - _mm_add_epi16(pixetFilter_p2p1p0, - _mm_add_epi16(sum_p3, p2_16)), 3); - res_q = _mm_srli_epi16( - _mm_add_epi16(pixetFilter_q2q1q0, - _mm_add_epi16(sum_q3, q2_16)), 3); - flat_q2p2 = _mm_packus_epi16(res_p, res_q); - - sum_p7 = _mm_add_epi16(sum_p7, p7_16); - sum_q7 = _mm_add_epi16(sum_q7, q7_16); - pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q4_16); - pixelFilter_q = _mm_sub_epi16(pixelFilter_q, p4_16); - res_p = _mm_srli_epi16( - _mm_add_epi16(pixelFilter_p, _mm_add_epi16(sum_p7, p3_16)), - 4); - res_q = _mm_srli_epi16( - _mm_add_epi16(pixelFilter_q, _mm_add_epi16(sum_q7, q3_16)), - 4); - flat2_q3p3 = _mm_packus_epi16(res_p, res_q); - - sum_p7 = _mm_add_epi16(sum_p7, p7_16); - sum_q7 = _mm_add_epi16(sum_q7, q7_16); - pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q3_16); - pixelFilter_q = _mm_sub_epi16(pixelFilter_q, p3_16); - res_p = _mm_srli_epi16( - _mm_add_epi16(pixelFilter_p, _mm_add_epi16(sum_p7, p4_16)), - 4); - res_q = _mm_srli_epi16( - _mm_add_epi16(pixelFilter_q, _mm_add_epi16(sum_q7, q4_16)), - 4); - flat2_q4p4 = _mm_packus_epi16(res_p, res_q); - - sum_p7 = _mm_add_epi16(sum_p7, p7_16); - sum_q7 = _mm_add_epi16(sum_q7, q7_16); - pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q2_16); - pixelFilter_q = _mm_sub_epi16(pixelFilter_q, p2_16); - res_p = _mm_srli_epi16( - _mm_add_epi16(pixelFilter_p, _mm_add_epi16(sum_p7, p5_16)), - 4); - res_q = _mm_srli_epi16( - _mm_add_epi16(pixelFilter_q, _mm_add_epi16(sum_q7, q5_16)), - 4); - flat2_q5p5 = _mm_packus_epi16(res_p, res_q); - - sum_p7 = _mm_add_epi16(sum_p7, p7_16); - sum_q7 = _mm_add_epi16(sum_q7, q7_16); - pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q1_16); - pixelFilter_q = _mm_sub_epi16(pixelFilter_q, p1_16); - res_p = _mm_srli_epi16( - _mm_add_epi16(pixelFilter_p, _mm_add_epi16(sum_p7, p6_16)), - 4); - res_q = _mm_srli_epi16( - _mm_add_epi16(pixelFilter_q, _mm_add_epi16(sum_q7, q6_16)), - 4); - flat2_q6p6 = _mm_packus_epi16(res_p, res_q); - } - // wide flat - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - flat = _mm_shuffle_epi32(flat, 68); - flat2 = _mm_shuffle_epi32(flat2, 68); - - q2p2 = _mm_andnot_si128(flat, q2p2); - flat_q2p2 = _mm_and_si128(flat, flat_q2p2); - q2p2 = _mm_or_si128(q2p2, flat_q2p2); - - qs1ps1 = _mm_andnot_si128(flat, qs1ps1); - flat_q1p1 = _mm_and_si128(flat, flat_q1p1); - q1p1 = _mm_or_si128(qs1ps1, flat_q1p1); - - qs0ps0 = _mm_andnot_si128(flat, qs0ps0); - flat_q0p0 = _mm_and_si128(flat, flat_q0p0); - q0p0 = _mm_or_si128(qs0ps0, flat_q0p0); - - q6p6 = _mm_andnot_si128(flat2, q6p6); - flat2_q6p6 = _mm_and_si128(flat2, flat2_q6p6); - q6p6 = _mm_or_si128(q6p6, flat2_q6p6); - _mm_storel_epi64((__m128i *) (s - 7 * p), q6p6); - _mm_storeh_pi((__m64 *) (s + 6 * p), _mm_castsi128_ps(q6p6)); - - q5p5 = _mm_andnot_si128(flat2, q5p5); - flat2_q5p5 = _mm_and_si128(flat2, flat2_q5p5); - q5p5 = _mm_or_si128(q5p5, flat2_q5p5); - _mm_storel_epi64((__m128i *) (s - 6 * p), q5p5); - _mm_storeh_pi((__m64 *) (s + 5 * p), _mm_castsi128_ps(q5p5)); - - q4p4 = _mm_andnot_si128(flat2, q4p4); - flat2_q4p4 = _mm_and_si128(flat2, flat2_q4p4); - q4p4 = _mm_or_si128(q4p4, flat2_q4p4); - _mm_storel_epi64((__m128i *) (s - 5 * p), q4p4); - _mm_storeh_pi((__m64 *) (s + 4 * p), _mm_castsi128_ps(q4p4)); - - q3p3 = _mm_andnot_si128(flat2, q3p3); - flat2_q3p3 = _mm_and_si128(flat2, flat2_q3p3); - q3p3 = _mm_or_si128(q3p3, flat2_q3p3); - _mm_storel_epi64((__m128i *) (s - 4 * p), q3p3); - _mm_storeh_pi((__m64 *) (s + 3 * p), _mm_castsi128_ps(q3p3)); - - q2p2 = _mm_andnot_si128(flat2, q2p2); - flat2_q2p2 = _mm_and_si128(flat2, flat2_q2p2); - q2p2 = _mm_or_si128(q2p2, flat2_q2p2); - _mm_storel_epi64((__m128i *) (s - 3 * p), q2p2); - _mm_storeh_pi((__m64 *) (s + 2 * p), _mm_castsi128_ps(q2p2)); - - q1p1 = _mm_andnot_si128(flat2, q1p1); - flat2_q1p1 = _mm_and_si128(flat2, flat2_q1p1); - q1p1 = _mm_or_si128(q1p1, flat2_q1p1); - _mm_storel_epi64((__m128i *) (s - 2 * p), q1p1); - _mm_storeh_pi((__m64 *) (s + 1 * p), _mm_castsi128_ps(q1p1)); - - q0p0 = _mm_andnot_si128(flat2, q0p0); - flat2_q0p0 = _mm_and_si128(flat2, flat2_q0p0); - q0p0 = _mm_or_si128(q0p0, flat2_q0p0); - _mm_storel_epi64((__m128i *) (s - 1 * p), q0p0); - _mm_storeh_pi((__m64 *) (s - 0 * p), _mm_castsi128_ps(q0p0)); - } -} - -DECLARE_ALIGNED(32, static const uint8_t, filt_loopfilter_avx2[32]) = { - 0, 128, 1, 128, 2, 128, 3, 128, 4, 128, 5, 128, 6, 128, 7, 128, - 8, 128, 9, 128, 10, 128, 11, 128, 12, 128, 13, 128, 14, 128, 15, 128 -}; - -static void mb_lpf_horizontal_edge_w_avx2_16(unsigned char *s, int p, - const unsigned char *_blimit, const unsigned char *_limit, - const unsigned char *_thresh) { - __m128i mask, hev, flat, flat2; - const __m128i zero = _mm_set1_epi16(0); - const __m128i one = _mm_set1_epi8(1); - __m128i p7, p6, p5; - __m128i p4, p3, p2, p1, p0, q0, q1, q2, q3, q4; - __m128i q5, q6, q7; - __m256i p256_7, q256_7, p256_6, q256_6, p256_5, q256_5, p256_4, - q256_4, p256_3, q256_3, p256_2, q256_2, p256_1, q256_1, - p256_0, q256_0; - - const __m128i thresh = _mm_broadcastb_epi8( - _mm_cvtsi32_si128((int) _thresh[0])); - const __m128i limit = _mm_broadcastb_epi8( - _mm_cvtsi32_si128((int) _limit[0])); - const __m128i blimit = _mm_broadcastb_epi8( - _mm_cvtsi32_si128((int) _blimit[0])); - - p256_4 = _mm256_castpd_si256(_mm256_broadcast_pd( - (__m128d const *)(s - 5 * p))); - p256_3 = _mm256_castpd_si256(_mm256_broadcast_pd( - (__m128d const *)(s - 4 * p))); - p256_2 = _mm256_castpd_si256(_mm256_broadcast_pd( - (__m128d const *)(s - 3 * p))); - p256_1 = _mm256_castpd_si256(_mm256_broadcast_pd( - (__m128d const *)(s - 2 * p))); - p256_0 = _mm256_castpd_si256(_mm256_broadcast_pd( - (__m128d const *)(s - 1 * p))); - q256_0 = _mm256_castpd_si256(_mm256_broadcast_pd( - (__m128d const *)(s - 0 * p))); - q256_1 = _mm256_castpd_si256(_mm256_broadcast_pd( - (__m128d const *)(s + 1 * p))); - q256_2 = _mm256_castpd_si256(_mm256_broadcast_pd( - (__m128d const *)(s + 2 * p))); - q256_3 = _mm256_castpd_si256(_mm256_broadcast_pd( - (__m128d const *)(s + 3 * p))); - q256_4 = _mm256_castpd_si256(_mm256_broadcast_pd( - (__m128d const *)(s + 4 * p))); - - p4 = _mm256_castsi256_si128(p256_4); - p3 = _mm256_castsi256_si128(p256_3); - p2 = _mm256_castsi256_si128(p256_2); - p1 = _mm256_castsi256_si128(p256_1); - p0 = _mm256_castsi256_si128(p256_0); - q0 = _mm256_castsi256_si128(q256_0); - q1 = _mm256_castsi256_si128(q256_1); - q2 = _mm256_castsi256_si128(q256_2); - q3 = _mm256_castsi256_si128(q256_3); - q4 = _mm256_castsi256_si128(q256_4); - - { - const __m128i abs_p1p0 = _mm_or_si128(_mm_subs_epu8(p1, p0), - _mm_subs_epu8(p0, p1)); - const __m128i abs_q1q0 = _mm_or_si128(_mm_subs_epu8(q1, q0), - _mm_subs_epu8(q0, q1)); - const __m128i fe = _mm_set1_epi8(0xfe); - const __m128i ff = _mm_cmpeq_epi8(abs_p1p0, abs_p1p0); - __m128i abs_p0q0 = _mm_or_si128(_mm_subs_epu8(p0, q0), - _mm_subs_epu8(q0, p0)); - __m128i abs_p1q1 = _mm_or_si128(_mm_subs_epu8(p1, q1), - _mm_subs_epu8(q1, p1)); - __m128i work; - flat = _mm_max_epu8(abs_p1p0, abs_q1q0); - hev = _mm_subs_epu8(flat, thresh); - hev = _mm_xor_si128(_mm_cmpeq_epi8(hev, zero), ff); - - abs_p0q0 = _mm_adds_epu8(abs_p0q0, abs_p0q0); - abs_p1q1 = _mm_srli_epi16(_mm_and_si128(abs_p1q1, fe), 1); - mask = _mm_subs_epu8(_mm_adds_epu8(abs_p0q0, abs_p1q1), blimit); - mask = _mm_xor_si128(_mm_cmpeq_epi8(mask, zero), ff); - // mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 > blimit) * -1; - mask = _mm_max_epu8(flat, mask); - // mask |= (abs(p1 - p0) > limit) * -1; - // mask |= (abs(q1 - q0) > limit) * -1; - work = _mm_max_epu8( - _mm_or_si128(_mm_subs_epu8(p2, p1), _mm_subs_epu8(p1, p2)), - _mm_or_si128(_mm_subs_epu8(p3, p2), _mm_subs_epu8(p2, p3))); - mask = _mm_max_epu8(work, mask); - work = _mm_max_epu8( - _mm_or_si128(_mm_subs_epu8(q2, q1), _mm_subs_epu8(q1, q2)), - _mm_or_si128(_mm_subs_epu8(q3, q2), _mm_subs_epu8(q2, q3))); - mask = _mm_max_epu8(work, mask); - mask = _mm_subs_epu8(mask, limit); - mask = _mm_cmpeq_epi8(mask, zero); - } - - // lp filter - { - const __m128i t4 = _mm_set1_epi8(4); - const __m128i t3 = _mm_set1_epi8(3); - const __m128i t80 = _mm_set1_epi8(0x80); - const __m128i te0 = _mm_set1_epi8(0xe0); - const __m128i t1f = _mm_set1_epi8(0x1f); - const __m128i t1 = _mm_set1_epi8(0x1); - const __m128i t7f = _mm_set1_epi8(0x7f); - - __m128i ps1 = _mm_xor_si128(p1, t80); - __m128i ps0 = _mm_xor_si128(p0, t80); - __m128i qs0 = _mm_xor_si128(q0, t80); - __m128i qs1 = _mm_xor_si128(q1, t80); - __m128i filt; - __m128i work_a; - __m128i filter1, filter2; - __m128i flat2_p6, flat2_p5, flat2_p4, flat2_p3, flat2_p2, flat2_p1, - flat2_p0, flat2_q0, flat2_q1, flat2_q2, flat2_q3, flat2_q4, - flat2_q5, flat2_q6, flat_p2, flat_p1, flat_p0, flat_q0, flat_q1, - flat_q2; - - filt = _mm_and_si128(_mm_subs_epi8(ps1, qs1), hev); - work_a = _mm_subs_epi8(qs0, ps0); - filt = _mm_adds_epi8(filt, work_a); - filt = _mm_adds_epi8(filt, work_a); - filt = _mm_adds_epi8(filt, work_a); - /* (vp9_filter + 3 * (qs0 - ps0)) & mask */ - filt = _mm_and_si128(filt, mask); - - filter1 = _mm_adds_epi8(filt, t4); - filter2 = _mm_adds_epi8(filt, t3); - - /* Filter1 >> 3 */ - work_a = _mm_cmpgt_epi8(zero, filter1); - filter1 = _mm_srli_epi16(filter1, 3); - work_a = _mm_and_si128(work_a, te0); - filter1 = _mm_and_si128(filter1, t1f); - filter1 = _mm_or_si128(filter1, work_a); - qs0 = _mm_xor_si128(_mm_subs_epi8(qs0, filter1), t80); - - /* Filter2 >> 3 */ - work_a = _mm_cmpgt_epi8(zero, filter2); - filter2 = _mm_srli_epi16(filter2, 3); - work_a = _mm_and_si128(work_a, te0); - filter2 = _mm_and_si128(filter2, t1f); - filter2 = _mm_or_si128(filter2, work_a); - ps0 = _mm_xor_si128(_mm_adds_epi8(ps0, filter2), t80); - - /* filt >> 1 */ - filt = _mm_adds_epi8(filter1, t1); - work_a = _mm_cmpgt_epi8(zero, filt); - filt = _mm_srli_epi16(filt, 1); - work_a = _mm_and_si128(work_a, t80); - filt = _mm_and_si128(filt, t7f); - filt = _mm_or_si128(filt, work_a); - filt = _mm_andnot_si128(hev, filt); - ps1 = _mm_xor_si128(_mm_adds_epi8(ps1, filt), t80); - qs1 = _mm_xor_si128(_mm_subs_epi8(qs1, filt), t80); - // loopfilter done - - { - __m128i work; - work = _mm_max_epu8( - _mm_or_si128(_mm_subs_epu8(p2, p0), _mm_subs_epu8(p0, p2)), - _mm_or_si128(_mm_subs_epu8(q2, q0), _mm_subs_epu8(q0, q2))); - flat = _mm_max_epu8(work, flat); - work = _mm_max_epu8( - _mm_or_si128(_mm_subs_epu8(p3, p0), _mm_subs_epu8(p0, p3)), - _mm_or_si128(_mm_subs_epu8(q3, q0), _mm_subs_epu8(q0, q3))); - flat = _mm_max_epu8(work, flat); - work = _mm_max_epu8( - _mm_or_si128(_mm_subs_epu8(p4, p0), _mm_subs_epu8(p0, p4)), - _mm_or_si128(_mm_subs_epu8(q4, q0), _mm_subs_epu8(q0, q4))); - flat = _mm_subs_epu8(flat, one); - flat = _mm_cmpeq_epi8(flat, zero); - flat = _mm_and_si128(flat, mask); - - p256_5 = _mm256_castpd_si256(_mm256_broadcast_pd( - (__m128d const *)(s - 6 * p))); - q256_5 = _mm256_castpd_si256(_mm256_broadcast_pd( - (__m128d const *)(s + 5 * p))); - p5 = _mm256_castsi256_si128(p256_5); - q5 = _mm256_castsi256_si128(q256_5); - flat2 = _mm_max_epu8( - _mm_or_si128(_mm_subs_epu8(p5, p0), _mm_subs_epu8(p0, p5)), - _mm_or_si128(_mm_subs_epu8(q5, q0), _mm_subs_epu8(q0, q5))); - - flat2 = _mm_max_epu8(work, flat2); - p256_6 = _mm256_castpd_si256(_mm256_broadcast_pd( - (__m128d const *)(s - 7 * p))); - q256_6 = _mm256_castpd_si256(_mm256_broadcast_pd( - (__m128d const *)(s + 6 * p))); - p6 = _mm256_castsi256_si128(p256_6); - q6 = _mm256_castsi256_si128(q256_6); - work = _mm_max_epu8( - _mm_or_si128(_mm_subs_epu8(p6, p0), _mm_subs_epu8(p0, p6)), - _mm_or_si128(_mm_subs_epu8(q6, q0), _mm_subs_epu8(q0, q6))); - - flat2 = _mm_max_epu8(work, flat2); - - p256_7 = _mm256_castpd_si256(_mm256_broadcast_pd( - (__m128d const *)(s - 8 * p))); - q256_7 = _mm256_castpd_si256(_mm256_broadcast_pd( - (__m128d const *)(s + 7 * p))); - p7 = _mm256_castsi256_si128(p256_7); - q7 = _mm256_castsi256_si128(q256_7); - work = _mm_max_epu8( - _mm_or_si128(_mm_subs_epu8(p7, p0), _mm_subs_epu8(p0, p7)), - _mm_or_si128(_mm_subs_epu8(q7, q0), _mm_subs_epu8(q0, q7))); - - flat2 = _mm_max_epu8(work, flat2); - flat2 = _mm_subs_epu8(flat2, one); - flat2 = _mm_cmpeq_epi8(flat2, zero); - flat2 = _mm_and_si128(flat2, flat); // flat2 & flat & mask - } - - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // flat and wide flat calculations - { - const __m256i eight = _mm256_set1_epi16(8); - const __m256i four = _mm256_set1_epi16(4); - __m256i pixelFilter_p, pixelFilter_q, pixetFilter_p2p1p0, - pixetFilter_q2q1q0, sum_p7, sum_q7, sum_p3, sum_q3, res_p, - res_q; - - const __m256i filter = _mm256_load_si256( - (__m256i const *)filt_loopfilter_avx2); - p256_7 = _mm256_shuffle_epi8(p256_7, filter); - p256_6 = _mm256_shuffle_epi8(p256_6, filter); - p256_5 = _mm256_shuffle_epi8(p256_5, filter); - p256_4 = _mm256_shuffle_epi8(p256_4, filter); - p256_3 = _mm256_shuffle_epi8(p256_3, filter); - p256_2 = _mm256_shuffle_epi8(p256_2, filter); - p256_1 = _mm256_shuffle_epi8(p256_1, filter); - p256_0 = _mm256_shuffle_epi8(p256_0, filter); - q256_0 = _mm256_shuffle_epi8(q256_0, filter); - q256_1 = _mm256_shuffle_epi8(q256_1, filter); - q256_2 = _mm256_shuffle_epi8(q256_2, filter); - q256_3 = _mm256_shuffle_epi8(q256_3, filter); - q256_4 = _mm256_shuffle_epi8(q256_4, filter); - q256_5 = _mm256_shuffle_epi8(q256_5, filter); - q256_6 = _mm256_shuffle_epi8(q256_6, filter); - q256_7 = _mm256_shuffle_epi8(q256_7, filter); - - pixelFilter_p = _mm256_add_epi16(_mm256_add_epi16(p256_6, p256_5), - _mm256_add_epi16(p256_4, p256_3)); - pixelFilter_q = _mm256_add_epi16(_mm256_add_epi16(q256_6, q256_5), - _mm256_add_epi16(q256_4, q256_3)); - - pixetFilter_p2p1p0 = _mm256_add_epi16(p256_0, - _mm256_add_epi16(p256_2, p256_1)); - pixelFilter_p = _mm256_add_epi16(pixelFilter_p, pixetFilter_p2p1p0); - - pixetFilter_q2q1q0 = _mm256_add_epi16(q256_0, - _mm256_add_epi16(q256_2, q256_1)); - pixelFilter_q = _mm256_add_epi16(pixelFilter_q, pixetFilter_q2q1q0); - - pixelFilter_p = _mm256_add_epi16(eight, - _mm256_add_epi16(pixelFilter_p, pixelFilter_q)); - - pixetFilter_p2p1p0 = _mm256_add_epi16(four, - _mm256_add_epi16(pixetFilter_p2p1p0, pixetFilter_q2q1q0)); - - res_p = _mm256_srli_epi16( - _mm256_add_epi16(pixelFilter_p, - _mm256_add_epi16(p256_7, p256_0)), 4); - - flat2_p0 = _mm256_castsi256_si128( - _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_p), - 168)); - - res_q = _mm256_srli_epi16( - _mm256_add_epi16(pixelFilter_p, - _mm256_add_epi16(q256_7, q256_0)), 4); - - flat2_q0 = _mm256_castsi256_si128( - _mm256_permute4x64_epi64(_mm256_packus_epi16(res_q, res_q), - 168)); - - res_p = _mm256_srli_epi16( - _mm256_add_epi16(pixetFilter_p2p1p0, - _mm256_add_epi16(p256_3, p256_0)), 3); - - flat_p0 = _mm256_castsi256_si128( - _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_p), - 168)); - - res_q = _mm256_srli_epi16( - _mm256_add_epi16(pixetFilter_p2p1p0, - _mm256_add_epi16(q256_3, q256_0)), 3); - - flat_q0 = _mm256_castsi256_si128( - _mm256_permute4x64_epi64(_mm256_packus_epi16(res_q, res_q), - 168)); - - sum_p7 = _mm256_add_epi16(p256_7, p256_7); - - sum_q7 = _mm256_add_epi16(q256_7, q256_7); - - sum_p3 = _mm256_add_epi16(p256_3, p256_3); - - sum_q3 = _mm256_add_epi16(q256_3, q256_3); - - pixelFilter_q = _mm256_sub_epi16(pixelFilter_p, p256_6); - - pixelFilter_p = _mm256_sub_epi16(pixelFilter_p, q256_6); - - res_p = _mm256_srli_epi16( - _mm256_add_epi16(pixelFilter_p, - _mm256_add_epi16(sum_p7, p256_1)), 4); - - flat2_p1 = _mm256_castsi256_si128( - _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_p), - 168)); - - res_q = _mm256_srli_epi16( - _mm256_add_epi16(pixelFilter_q, - _mm256_add_epi16(sum_q7, q256_1)), 4); - - flat2_q1 = _mm256_castsi256_si128( - _mm256_permute4x64_epi64(_mm256_packus_epi16(res_q, res_q), - 168)); - - pixetFilter_q2q1q0 = _mm256_sub_epi16(pixetFilter_p2p1p0, p256_2); - - pixetFilter_p2p1p0 = _mm256_sub_epi16(pixetFilter_p2p1p0, q256_2); - - res_p = _mm256_srli_epi16( - _mm256_add_epi16(pixetFilter_p2p1p0, - _mm256_add_epi16(sum_p3, p256_1)), 3); - - flat_p1 = _mm256_castsi256_si128( - _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_p), - 168)); - - res_q = _mm256_srli_epi16( - _mm256_add_epi16(pixetFilter_q2q1q0, - _mm256_add_epi16(sum_q3, q256_1)), 3); - - flat_q1 = _mm256_castsi256_si128( - _mm256_permute4x64_epi64(_mm256_packus_epi16(res_q, res_q), - 168)); - - sum_p7 = _mm256_add_epi16(sum_p7, p256_7); - - sum_q7 = _mm256_add_epi16(sum_q7, q256_7); - - sum_p3 = _mm256_add_epi16(sum_p3, p256_3); - - sum_q3 = _mm256_add_epi16(sum_q3, q256_3); - - pixelFilter_p = _mm256_sub_epi16(pixelFilter_p, q256_5); - - pixelFilter_q = _mm256_sub_epi16(pixelFilter_q, p256_5); - - res_p = _mm256_srli_epi16( - _mm256_add_epi16(pixelFilter_p, - _mm256_add_epi16(sum_p7, p256_2)), 4); - - flat2_p2 = _mm256_castsi256_si128( - _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_p), - 168)); - - res_q = _mm256_srli_epi16( - _mm256_add_epi16(pixelFilter_q, - _mm256_add_epi16(sum_q7, q256_2)), 4); - - flat2_q2 = _mm256_castsi256_si128( - _mm256_permute4x64_epi64(_mm256_packus_epi16(res_q, res_q), - 168)); - - pixetFilter_p2p1p0 = _mm256_sub_epi16(pixetFilter_p2p1p0, q256_1); - - pixetFilter_q2q1q0 = _mm256_sub_epi16(pixetFilter_q2q1q0, p256_1); - - res_p = _mm256_srli_epi16( - _mm256_add_epi16(pixetFilter_p2p1p0, - _mm256_add_epi16(sum_p3, p256_2)), 3); - - flat_p2 = _mm256_castsi256_si128( - _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_p), - 168)); - - res_q = _mm256_srli_epi16( - _mm256_add_epi16(pixetFilter_q2q1q0, - _mm256_add_epi16(sum_q3, q256_2)), 3); - - flat_q2 = _mm256_castsi256_si128( - _mm256_permute4x64_epi64(_mm256_packus_epi16(res_q, res_q), - 168)); - - sum_p7 = _mm256_add_epi16(sum_p7, p256_7); - - sum_q7 = _mm256_add_epi16(sum_q7, q256_7); - - pixelFilter_p = _mm256_sub_epi16(pixelFilter_p, q256_4); - - pixelFilter_q = _mm256_sub_epi16(pixelFilter_q, p256_4); - - res_p = _mm256_srli_epi16( - _mm256_add_epi16(pixelFilter_p, - _mm256_add_epi16(sum_p7, p256_3)), 4); - - flat2_p3 = _mm256_castsi256_si128( - _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_p), - 168)); - - res_q = _mm256_srli_epi16( - _mm256_add_epi16(pixelFilter_q, - _mm256_add_epi16(sum_q7, q256_3)), 4); - - flat2_q3 = _mm256_castsi256_si128( - _mm256_permute4x64_epi64(_mm256_packus_epi16(res_q, res_q), - 168)); - - sum_p7 = _mm256_add_epi16(sum_p7, p256_7); - - sum_q7 = _mm256_add_epi16(sum_q7, q256_7); - - pixelFilter_p = _mm256_sub_epi16(pixelFilter_p, q256_3); - - pixelFilter_q = _mm256_sub_epi16(pixelFilter_q, p256_3); - - res_p = _mm256_srli_epi16( - _mm256_add_epi16(pixelFilter_p, - _mm256_add_epi16(sum_p7, p256_4)), 4); - - flat2_p4 = _mm256_castsi256_si128( - _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_p), - 168)); - - res_q = _mm256_srli_epi16( - _mm256_add_epi16(pixelFilter_q, - _mm256_add_epi16(sum_q7, q256_4)), 4); - - flat2_q4 = _mm256_castsi256_si128( - _mm256_permute4x64_epi64(_mm256_packus_epi16(res_q, res_q), - 168)); - - sum_p7 = _mm256_add_epi16(sum_p7, p256_7); - - sum_q7 = _mm256_add_epi16(sum_q7, q256_7); - - pixelFilter_p = _mm256_sub_epi16(pixelFilter_p, q256_2); - - pixelFilter_q = _mm256_sub_epi16(pixelFilter_q, p256_2); - - res_p = _mm256_srli_epi16( - _mm256_add_epi16(pixelFilter_p, - _mm256_add_epi16(sum_p7, p256_5)), 4); - - flat2_p5 = _mm256_castsi256_si128( - _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_p), - 168)); - - res_q = _mm256_srli_epi16( - _mm256_add_epi16(pixelFilter_q, - _mm256_add_epi16(sum_q7, q256_5)), 4); - - flat2_q5 = _mm256_castsi256_si128( - _mm256_permute4x64_epi64(_mm256_packus_epi16(res_q, res_q), - 168)); - - sum_p7 = _mm256_add_epi16(sum_p7, p256_7); - - sum_q7 = _mm256_add_epi16(sum_q7, q256_7); - - pixelFilter_p = _mm256_sub_epi16(pixelFilter_p, q256_1); - - pixelFilter_q = _mm256_sub_epi16(pixelFilter_q, p256_1); - - res_p = _mm256_srli_epi16( - _mm256_add_epi16(pixelFilter_p, - _mm256_add_epi16(sum_p7, p256_6)), 4); - - flat2_p6 = _mm256_castsi256_si128( - _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_p), - 168)); - - res_q = _mm256_srli_epi16( - _mm256_add_epi16(pixelFilter_q, - _mm256_add_epi16(sum_q7, q256_6)), 4); - - flat2_q6 = _mm256_castsi256_si128( - _mm256_permute4x64_epi64(_mm256_packus_epi16(res_q, res_q), - 168)); - } - - // wide flat - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - p2 = _mm_andnot_si128(flat, p2); - flat_p2 = _mm_and_si128(flat, flat_p2); - p2 = _mm_or_si128(flat_p2, p2); - - p1 = _mm_andnot_si128(flat, ps1); - flat_p1 = _mm_and_si128(flat, flat_p1); - p1 = _mm_or_si128(flat_p1, p1); - - p0 = _mm_andnot_si128(flat, ps0); - flat_p0 = _mm_and_si128(flat, flat_p0); - p0 = _mm_or_si128(flat_p0, p0); - - q0 = _mm_andnot_si128(flat, qs0); - flat_q0 = _mm_and_si128(flat, flat_q0); - q0 = _mm_or_si128(flat_q0, q0); - - q1 = _mm_andnot_si128(flat, qs1); - flat_q1 = _mm_and_si128(flat, flat_q1); - q1 = _mm_or_si128(flat_q1, q1); - - q2 = _mm_andnot_si128(flat, q2); - flat_q2 = _mm_and_si128(flat, flat_q2); - q2 = _mm_or_si128(flat_q2, q2); - - p6 = _mm_andnot_si128(flat2, p6); - flat2_p6 = _mm_and_si128(flat2, flat2_p6); - p6 = _mm_or_si128(flat2_p6, p6); - _mm_storeu_si128((__m128i *) (s - 7 * p), p6); - - p5 = _mm_andnot_si128(flat2, p5); - flat2_p5 = _mm_and_si128(flat2, flat2_p5); - p5 = _mm_or_si128(flat2_p5, p5); - _mm_storeu_si128((__m128i *) (s - 6 * p), p5); - - p4 = _mm_andnot_si128(flat2, p4); - flat2_p4 = _mm_and_si128(flat2, flat2_p4); - p4 = _mm_or_si128(flat2_p4, p4); - _mm_storeu_si128((__m128i *) (s - 5 * p), p4); - - p3 = _mm_andnot_si128(flat2, p3); - flat2_p3 = _mm_and_si128(flat2, flat2_p3); - p3 = _mm_or_si128(flat2_p3, p3); - _mm_storeu_si128((__m128i *) (s - 4 * p), p3); - - p2 = _mm_andnot_si128(flat2, p2); - flat2_p2 = _mm_and_si128(flat2, flat2_p2); - p2 = _mm_or_si128(flat2_p2, p2); - _mm_storeu_si128((__m128i *) (s - 3 * p), p2); - - p1 = _mm_andnot_si128(flat2, p1); - flat2_p1 = _mm_and_si128(flat2, flat2_p1); - p1 = _mm_or_si128(flat2_p1, p1); - _mm_storeu_si128((__m128i *) (s - 2 * p), p1); - - p0 = _mm_andnot_si128(flat2, p0); - flat2_p0 = _mm_and_si128(flat2, flat2_p0); - p0 = _mm_or_si128(flat2_p0, p0); - _mm_storeu_si128((__m128i *) (s - 1 * p), p0); - - q0 = _mm_andnot_si128(flat2, q0); - flat2_q0 = _mm_and_si128(flat2, flat2_q0); - q0 = _mm_or_si128(flat2_q0, q0); - _mm_storeu_si128((__m128i *) (s - 0 * p), q0); - - q1 = _mm_andnot_si128(flat2, q1); - flat2_q1 = _mm_and_si128(flat2, flat2_q1); - q1 = _mm_or_si128(flat2_q1, q1); - _mm_storeu_si128((__m128i *) (s + 1 * p), q1); - - q2 = _mm_andnot_si128(flat2, q2); - flat2_q2 = _mm_and_si128(flat2, flat2_q2); - q2 = _mm_or_si128(flat2_q2, q2); - _mm_storeu_si128((__m128i *) (s + 2 * p), q2); - - q3 = _mm_andnot_si128(flat2, q3); - flat2_q3 = _mm_and_si128(flat2, flat2_q3); - q3 = _mm_or_si128(flat2_q3, q3); - _mm_storeu_si128((__m128i *) (s + 3 * p), q3); - - q4 = _mm_andnot_si128(flat2, q4); - flat2_q4 = _mm_and_si128(flat2, flat2_q4); - q4 = _mm_or_si128(flat2_q4, q4); - _mm_storeu_si128((__m128i *) (s + 4 * p), q4); - - q5 = _mm_andnot_si128(flat2, q5); - flat2_q5 = _mm_and_si128(flat2, flat2_q5); - q5 = _mm_or_si128(flat2_q5, q5); - _mm_storeu_si128((__m128i *) (s + 5 * p), q5); - - q6 = _mm_andnot_si128(flat2, q6); - flat2_q6 = _mm_and_si128(flat2, flat2_q6); - q6 = _mm_or_si128(flat2_q6, q6); - _mm_storeu_si128((__m128i *) (s + 6 * p), q6); - } -} - -void vp9_lpf_horizontal_16_avx2(unsigned char *s, int p, - const unsigned char *_blimit, const unsigned char *_limit, - const unsigned char *_thresh, int count) { - if (count == 1) - mb_lpf_horizontal_edge_w_avx2_8(s, p, _blimit, _limit, _thresh); - else - mb_lpf_horizontal_edge_w_avx2_16(s, p, _blimit, _limit, _thresh); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_loopfilter_intrin_sse2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_loopfilter_intrin_sse2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_loopfilter_intrin_sse2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_loopfilter_intrin_sse2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1578 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include // SSE2 -#include "vp9/common/vp9_loopfilter.h" -#include "vpx_ports/emmintrin_compat.h" - -static INLINE __m128i abs_diff(__m128i a, __m128i b) { - return _mm_or_si128(_mm_subs_epu8(a, b), _mm_subs_epu8(b, a)); -} - -static void mb_lpf_horizontal_edge_w_sse2_8(unsigned char *s, - int p, - const unsigned char *_blimit, - const unsigned char *_limit, - const unsigned char *_thresh) { - const __m128i zero = _mm_set1_epi16(0); - const __m128i one = _mm_set1_epi8(1); - const __m128i blimit = _mm_load_si128((const __m128i *)_blimit); - const __m128i limit = _mm_load_si128((const __m128i *)_limit); - const __m128i thresh = _mm_load_si128((const __m128i *)_thresh); - __m128i mask, hev, flat, flat2; - __m128i q7p7, q6p6, q5p5, q4p4, q3p3, q2p2, q1p1, q0p0, p0q0, p1q1; - __m128i abs_p1p0; - - q4p4 = _mm_loadl_epi64((__m128i *)(s - 5 * p)); - q4p4 = _mm_castps_si128(_mm_loadh_pi(_mm_castsi128_ps(q4p4), - (__m64 *)(s + 4 * p))); - q3p3 = _mm_loadl_epi64((__m128i *)(s - 4 * p)); - q3p3 = _mm_castps_si128(_mm_loadh_pi(_mm_castsi128_ps(q3p3), - (__m64 *)(s + 3 * p))); - q2p2 = _mm_loadl_epi64((__m128i *)(s - 3 * p)); - q2p2 = _mm_castps_si128(_mm_loadh_pi(_mm_castsi128_ps(q2p2), - (__m64 *)(s + 2 * p))); - q1p1 = _mm_loadl_epi64((__m128i *)(s - 2 * p)); - q1p1 = _mm_castps_si128(_mm_loadh_pi(_mm_castsi128_ps(q1p1), - (__m64 *)(s + 1 * p))); - p1q1 = _mm_shuffle_epi32(q1p1, 78); - q0p0 = _mm_loadl_epi64((__m128i *)(s - 1 * p)); - q0p0 = _mm_castps_si128(_mm_loadh_pi(_mm_castsi128_ps(q0p0), - (__m64 *)(s - 0 * p))); - p0q0 = _mm_shuffle_epi32(q0p0, 78); - - { - __m128i abs_p1q1, abs_p0q0, abs_q1q0, fe, ff, work; - abs_p1p0 = abs_diff(q1p1, q0p0); - abs_q1q0 = _mm_srli_si128(abs_p1p0, 8); - fe = _mm_set1_epi8(0xfe); - ff = _mm_cmpeq_epi8(abs_p1p0, abs_p1p0); - abs_p0q0 = abs_diff(q0p0, p0q0); - abs_p1q1 = abs_diff(q1p1, p1q1); - flat = _mm_max_epu8(abs_p1p0, abs_q1q0); - hev = _mm_subs_epu8(flat, thresh); - hev = _mm_xor_si128(_mm_cmpeq_epi8(hev, zero), ff); - - abs_p0q0 =_mm_adds_epu8(abs_p0q0, abs_p0q0); - abs_p1q1 = _mm_srli_epi16(_mm_and_si128(abs_p1q1, fe), 1); - mask = _mm_subs_epu8(_mm_adds_epu8(abs_p0q0, abs_p1q1), blimit); - mask = _mm_xor_si128(_mm_cmpeq_epi8(mask, zero), ff); - // mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 > blimit) * -1; - mask = _mm_max_epu8(abs_p1p0, mask); - // mask |= (abs(p1 - p0) > limit) * -1; - // mask |= (abs(q1 - q0) > limit) * -1; - - work = _mm_max_epu8(abs_diff(q2p2, q1p1), - abs_diff(q3p3, q2p2)); - mask = _mm_max_epu8(work, mask); - mask = _mm_max_epu8(mask, _mm_srli_si128(mask, 8)); - mask = _mm_subs_epu8(mask, limit); - mask = _mm_cmpeq_epi8(mask, zero); - } - - // lp filter - { - const __m128i t4 = _mm_set1_epi8(4); - const __m128i t3 = _mm_set1_epi8(3); - const __m128i t80 = _mm_set1_epi8(0x80); - const __m128i t1 = _mm_set1_epi16(0x1); - __m128i qs1ps1 = _mm_xor_si128(q1p1, t80); - __m128i qs0ps0 = _mm_xor_si128(q0p0, t80); - __m128i qs0 = _mm_xor_si128(p0q0, t80); - __m128i qs1 = _mm_xor_si128(p1q1, t80); - __m128i filt; - __m128i work_a; - __m128i filter1, filter2; - __m128i flat2_q6p6, flat2_q5p5, flat2_q4p4, flat2_q3p3, flat2_q2p2; - __m128i flat2_q1p1, flat2_q0p0, flat_q2p2, flat_q1p1, flat_q0p0; - - filt = _mm_and_si128(_mm_subs_epi8(qs1ps1, qs1), hev); - work_a = _mm_subs_epi8(qs0, qs0ps0); - filt = _mm_adds_epi8(filt, work_a); - filt = _mm_adds_epi8(filt, work_a); - filt = _mm_adds_epi8(filt, work_a); - // (vp9_filter + 3 * (qs0 - ps0)) & mask - filt = _mm_and_si128(filt, mask); - - filter1 = _mm_adds_epi8(filt, t4); - filter2 = _mm_adds_epi8(filt, t3); - - filter1 = _mm_unpacklo_epi8(zero, filter1); - filter1 = _mm_srai_epi16(filter1, 0xB); - filter2 = _mm_unpacklo_epi8(zero, filter2); - filter2 = _mm_srai_epi16(filter2, 0xB); - - // Filter1 >> 3 - filt = _mm_packs_epi16(filter2, _mm_subs_epi16(zero, filter1)); - qs0ps0 = _mm_xor_si128(_mm_adds_epi8(qs0ps0, filt), t80); - - // filt >> 1 - filt = _mm_adds_epi16(filter1, t1); - filt = _mm_srai_epi16(filt, 1); - filt = _mm_andnot_si128(_mm_srai_epi16(_mm_unpacklo_epi8(zero, hev), 0x8), - filt); - filt = _mm_packs_epi16(filt, _mm_subs_epi16(zero, filt)); - qs1ps1 = _mm_xor_si128(_mm_adds_epi8(qs1ps1, filt), t80); - // loopfilter done - - { - __m128i work; - flat = _mm_max_epu8(abs_diff(q2p2, q0p0), abs_diff(q3p3, q0p0)); - flat = _mm_max_epu8(abs_p1p0, flat); - flat = _mm_max_epu8(flat, _mm_srli_si128(flat, 8)); - flat = _mm_subs_epu8(flat, one); - flat = _mm_cmpeq_epi8(flat, zero); - flat = _mm_and_si128(flat, mask); - - q5p5 = _mm_loadl_epi64((__m128i *)(s - 6 * p)); - q5p5 = _mm_castps_si128(_mm_loadh_pi(_mm_castsi128_ps(q5p5), - (__m64 *)(s + 5 * p))); - - q6p6 = _mm_loadl_epi64((__m128i *)(s - 7 * p)); - q6p6 = _mm_castps_si128(_mm_loadh_pi(_mm_castsi128_ps(q6p6), - (__m64 *)(s + 6 * p))); - flat2 = _mm_max_epu8(abs_diff(q4p4, q0p0), abs_diff(q5p5, q0p0)); - - q7p7 = _mm_loadl_epi64((__m128i *)(s - 8 * p)); - q7p7 = _mm_castps_si128(_mm_loadh_pi(_mm_castsi128_ps(q7p7), - (__m64 *)(s + 7 * p))); - work = _mm_max_epu8(abs_diff(q6p6, q0p0), abs_diff(q7p7, q0p0)); - flat2 = _mm_max_epu8(work, flat2); - flat2 = _mm_max_epu8(flat2, _mm_srli_si128(flat2, 8)); - flat2 = _mm_subs_epu8(flat2, one); - flat2 = _mm_cmpeq_epi8(flat2, zero); - flat2 = _mm_and_si128(flat2, flat); // flat2 & flat & mask - } - - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // flat and wide flat calculations - { - const __m128i eight = _mm_set1_epi16(8); - const __m128i four = _mm_set1_epi16(4); - __m128i p7_16, p6_16, p5_16, p4_16, p3_16, p2_16, p1_16, p0_16; - __m128i q7_16, q6_16, q5_16, q4_16, q3_16, q2_16, q1_16, q0_16; - __m128i pixelFilter_p, pixelFilter_q; - __m128i pixetFilter_p2p1p0, pixetFilter_q2q1q0; - __m128i sum_p7, sum_q7, sum_p3, sum_q3, res_p, res_q; - - p7_16 = _mm_unpacklo_epi8(q7p7, zero);; - p6_16 = _mm_unpacklo_epi8(q6p6, zero); - p5_16 = _mm_unpacklo_epi8(q5p5, zero); - p4_16 = _mm_unpacklo_epi8(q4p4, zero); - p3_16 = _mm_unpacklo_epi8(q3p3, zero); - p2_16 = _mm_unpacklo_epi8(q2p2, zero); - p1_16 = _mm_unpacklo_epi8(q1p1, zero); - p0_16 = _mm_unpacklo_epi8(q0p0, zero); - q0_16 = _mm_unpackhi_epi8(q0p0, zero); - q1_16 = _mm_unpackhi_epi8(q1p1, zero); - q2_16 = _mm_unpackhi_epi8(q2p2, zero); - q3_16 = _mm_unpackhi_epi8(q3p3, zero); - q4_16 = _mm_unpackhi_epi8(q4p4, zero); - q5_16 = _mm_unpackhi_epi8(q5p5, zero); - q6_16 = _mm_unpackhi_epi8(q6p6, zero); - q7_16 = _mm_unpackhi_epi8(q7p7, zero); - - pixelFilter_p = _mm_add_epi16(_mm_add_epi16(p6_16, p5_16), - _mm_add_epi16(p4_16, p3_16)); - pixelFilter_q = _mm_add_epi16(_mm_add_epi16(q6_16, q5_16), - _mm_add_epi16(q4_16, q3_16)); - - pixetFilter_p2p1p0 = _mm_add_epi16(p0_16, _mm_add_epi16(p2_16, p1_16)); - pixelFilter_p = _mm_add_epi16(pixelFilter_p, pixetFilter_p2p1p0); - - pixetFilter_q2q1q0 = _mm_add_epi16(q0_16, _mm_add_epi16(q2_16, q1_16)); - pixelFilter_q = _mm_add_epi16(pixelFilter_q, pixetFilter_q2q1q0); - pixelFilter_p = _mm_add_epi16(eight, _mm_add_epi16(pixelFilter_p, - pixelFilter_q)); - pixetFilter_p2p1p0 = _mm_add_epi16(four, - _mm_add_epi16(pixetFilter_p2p1p0, - pixetFilter_q2q1q0)); - res_p = _mm_srli_epi16(_mm_add_epi16(pixelFilter_p, - _mm_add_epi16(p7_16, p0_16)), 4); - res_q = _mm_srli_epi16(_mm_add_epi16(pixelFilter_p, - _mm_add_epi16(q7_16, q0_16)), 4); - flat2_q0p0 = _mm_packus_epi16(res_p, res_q); - res_p = _mm_srli_epi16(_mm_add_epi16(pixetFilter_p2p1p0, - _mm_add_epi16(p3_16, p0_16)), 3); - res_q = _mm_srli_epi16(_mm_add_epi16(pixetFilter_p2p1p0, - _mm_add_epi16(q3_16, q0_16)), 3); - - flat_q0p0 = _mm_packus_epi16(res_p, res_q); - - sum_p7 = _mm_add_epi16(p7_16, p7_16); - sum_q7 = _mm_add_epi16(q7_16, q7_16); - sum_p3 = _mm_add_epi16(p3_16, p3_16); - sum_q3 = _mm_add_epi16(q3_16, q3_16); - - pixelFilter_q = _mm_sub_epi16(pixelFilter_p, p6_16); - pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q6_16); - res_p = _mm_srli_epi16(_mm_add_epi16(pixelFilter_p, - _mm_add_epi16(sum_p7, p1_16)), 4); - res_q = _mm_srli_epi16(_mm_add_epi16(pixelFilter_q, - _mm_add_epi16(sum_q7, q1_16)), 4); - flat2_q1p1 = _mm_packus_epi16(res_p, res_q); - - pixetFilter_q2q1q0 = _mm_sub_epi16(pixetFilter_p2p1p0, p2_16); - pixetFilter_p2p1p0 = _mm_sub_epi16(pixetFilter_p2p1p0, q2_16); - res_p = _mm_srli_epi16(_mm_add_epi16(pixetFilter_p2p1p0, - _mm_add_epi16(sum_p3, p1_16)), 3); - res_q = _mm_srli_epi16(_mm_add_epi16(pixetFilter_q2q1q0, - _mm_add_epi16(sum_q3, q1_16)), 3); - flat_q1p1 = _mm_packus_epi16(res_p, res_q); - - sum_p7 = _mm_add_epi16(sum_p7, p7_16); - sum_q7 = _mm_add_epi16(sum_q7, q7_16); - sum_p3 = _mm_add_epi16(sum_p3, p3_16); - sum_q3 = _mm_add_epi16(sum_q3, q3_16); - - pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q5_16); - pixelFilter_q = _mm_sub_epi16(pixelFilter_q, p5_16); - res_p = _mm_srli_epi16(_mm_add_epi16(pixelFilter_p, - _mm_add_epi16(sum_p7, p2_16)), 4); - res_q = _mm_srli_epi16(_mm_add_epi16(pixelFilter_q, - _mm_add_epi16(sum_q7, q2_16)), 4); - flat2_q2p2 = _mm_packus_epi16(res_p, res_q); - - pixetFilter_p2p1p0 = _mm_sub_epi16(pixetFilter_p2p1p0, q1_16); - pixetFilter_q2q1q0 = _mm_sub_epi16(pixetFilter_q2q1q0, p1_16); - - res_p = _mm_srli_epi16(_mm_add_epi16(pixetFilter_p2p1p0, - _mm_add_epi16(sum_p3, p2_16)), 3); - res_q = _mm_srli_epi16(_mm_add_epi16(pixetFilter_q2q1q0, - _mm_add_epi16(sum_q3, q2_16)), 3); - flat_q2p2 = _mm_packus_epi16(res_p, res_q); - - sum_p7 = _mm_add_epi16(sum_p7, p7_16); - sum_q7 = _mm_add_epi16(sum_q7, q7_16); - pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q4_16); - pixelFilter_q = _mm_sub_epi16(pixelFilter_q, p4_16); - res_p = _mm_srli_epi16(_mm_add_epi16(pixelFilter_p, - _mm_add_epi16(sum_p7, p3_16)), 4); - res_q = _mm_srli_epi16(_mm_add_epi16(pixelFilter_q, - _mm_add_epi16(sum_q7, q3_16)), 4); - flat2_q3p3 = _mm_packus_epi16(res_p, res_q); - - sum_p7 = _mm_add_epi16(sum_p7, p7_16); - sum_q7 = _mm_add_epi16(sum_q7, q7_16); - pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q3_16); - pixelFilter_q = _mm_sub_epi16(pixelFilter_q, p3_16); - res_p = _mm_srli_epi16(_mm_add_epi16(pixelFilter_p, - _mm_add_epi16(sum_p7, p4_16)), 4); - res_q = _mm_srli_epi16(_mm_add_epi16(pixelFilter_q, - _mm_add_epi16(sum_q7, q4_16)), 4); - flat2_q4p4 = _mm_packus_epi16(res_p, res_q); - - sum_p7 = _mm_add_epi16(sum_p7, p7_16); - sum_q7 = _mm_add_epi16(sum_q7, q7_16); - pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q2_16); - pixelFilter_q = _mm_sub_epi16(pixelFilter_q, p2_16); - res_p = _mm_srli_epi16(_mm_add_epi16(pixelFilter_p, - _mm_add_epi16(sum_p7, p5_16)), 4); - res_q = _mm_srli_epi16(_mm_add_epi16(pixelFilter_q, - _mm_add_epi16(sum_q7, q5_16)), 4); - flat2_q5p5 = _mm_packus_epi16(res_p, res_q); - - sum_p7 = _mm_add_epi16(sum_p7, p7_16); - sum_q7 = _mm_add_epi16(sum_q7, q7_16); - pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q1_16); - pixelFilter_q = _mm_sub_epi16(pixelFilter_q, p1_16); - res_p = _mm_srli_epi16(_mm_add_epi16(pixelFilter_p, - _mm_add_epi16(sum_p7, p6_16)), 4); - res_q = _mm_srli_epi16(_mm_add_epi16(pixelFilter_q, - _mm_add_epi16(sum_q7, q6_16)), 4); - flat2_q6p6 = _mm_packus_epi16(res_p, res_q); - } - // wide flat - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - flat = _mm_shuffle_epi32(flat, 68); - flat2 = _mm_shuffle_epi32(flat2, 68); - - q2p2 = _mm_andnot_si128(flat, q2p2); - flat_q2p2 = _mm_and_si128(flat, flat_q2p2); - q2p2 = _mm_or_si128(q2p2, flat_q2p2); - - qs1ps1 = _mm_andnot_si128(flat, qs1ps1); - flat_q1p1 = _mm_and_si128(flat, flat_q1p1); - q1p1 = _mm_or_si128(qs1ps1, flat_q1p1); - - qs0ps0 = _mm_andnot_si128(flat, qs0ps0); - flat_q0p0 = _mm_and_si128(flat, flat_q0p0); - q0p0 = _mm_or_si128(qs0ps0, flat_q0p0); - - q6p6 = _mm_andnot_si128(flat2, q6p6); - flat2_q6p6 = _mm_and_si128(flat2, flat2_q6p6); - q6p6 = _mm_or_si128(q6p6, flat2_q6p6); - _mm_storel_epi64((__m128i *)(s - 7 * p), q6p6); - _mm_storeh_pi((__m64 *)(s + 6 * p), _mm_castsi128_ps(q6p6)); - - q5p5 = _mm_andnot_si128(flat2, q5p5); - flat2_q5p5 = _mm_and_si128(flat2, flat2_q5p5); - q5p5 = _mm_or_si128(q5p5, flat2_q5p5); - _mm_storel_epi64((__m128i *)(s - 6 * p), q5p5); - _mm_storeh_pi((__m64 *)(s + 5 * p), _mm_castsi128_ps(q5p5)); - - q4p4 = _mm_andnot_si128(flat2, q4p4); - flat2_q4p4 = _mm_and_si128(flat2, flat2_q4p4); - q4p4 = _mm_or_si128(q4p4, flat2_q4p4); - _mm_storel_epi64((__m128i *)(s - 5 * p), q4p4); - _mm_storeh_pi((__m64 *)(s + 4 * p), _mm_castsi128_ps(q4p4)); - - q3p3 = _mm_andnot_si128(flat2, q3p3); - flat2_q3p3 = _mm_and_si128(flat2, flat2_q3p3); - q3p3 = _mm_or_si128(q3p3, flat2_q3p3); - _mm_storel_epi64((__m128i *)(s - 4 * p), q3p3); - _mm_storeh_pi((__m64 *)(s + 3 * p), _mm_castsi128_ps(q3p3)); - - q2p2 = _mm_andnot_si128(flat2, q2p2); - flat2_q2p2 = _mm_and_si128(flat2, flat2_q2p2); - q2p2 = _mm_or_si128(q2p2, flat2_q2p2); - _mm_storel_epi64((__m128i *)(s - 3 * p), q2p2); - _mm_storeh_pi((__m64 *)(s + 2 * p), _mm_castsi128_ps(q2p2)); - - q1p1 = _mm_andnot_si128(flat2, q1p1); - flat2_q1p1 = _mm_and_si128(flat2, flat2_q1p1); - q1p1 = _mm_or_si128(q1p1, flat2_q1p1); - _mm_storel_epi64((__m128i *)(s - 2 * p), q1p1); - _mm_storeh_pi((__m64 *)(s + 1 * p), _mm_castsi128_ps(q1p1)); - - q0p0 = _mm_andnot_si128(flat2, q0p0); - flat2_q0p0 = _mm_and_si128(flat2, flat2_q0p0); - q0p0 = _mm_or_si128(q0p0, flat2_q0p0); - _mm_storel_epi64((__m128i *)(s - 1 * p), q0p0); - _mm_storeh_pi((__m64 *)(s - 0 * p), _mm_castsi128_ps(q0p0)); - } -} - -static INLINE __m128i filter_add2_sub2(const __m128i *const total, - const __m128i *const a1, - const __m128i *const a2, - const __m128i *const s1, - const __m128i *const s2) { - __m128i x = _mm_add_epi16(*a1, *total); - x = _mm_add_epi16(_mm_sub_epi16(x, _mm_add_epi16(*s1, *s2)), *a2); - return x; -} - -static INLINE __m128i filter8_mask(const __m128i *const flat, - const __m128i *const other_filt, - const __m128i *const f8_lo, - const __m128i *const f8_hi) { - const __m128i f8 = _mm_packus_epi16(_mm_srli_epi16(*f8_lo, 3), - _mm_srli_epi16(*f8_hi, 3)); - const __m128i result = _mm_and_si128(*flat, f8); - return _mm_or_si128(_mm_andnot_si128(*flat, *other_filt), result); -} - -static INLINE __m128i filter16_mask(const __m128i *const flat, - const __m128i *const other_filt, - const __m128i *const f_lo, - const __m128i *const f_hi) { - const __m128i f = _mm_packus_epi16(_mm_srli_epi16(*f_lo, 4), - _mm_srli_epi16(*f_hi, 4)); - const __m128i result = _mm_and_si128(*flat, f); - return _mm_or_si128(_mm_andnot_si128(*flat, *other_filt), result); -} - -static void mb_lpf_horizontal_edge_w_sse2_16(unsigned char *s, - int p, - const unsigned char *_blimit, - const unsigned char *_limit, - const unsigned char *_thresh) { - const __m128i zero = _mm_set1_epi16(0); - const __m128i one = _mm_set1_epi8(1); - const __m128i blimit = _mm_load_si128((const __m128i *)_blimit); - const __m128i limit = _mm_load_si128((const __m128i *)_limit); - const __m128i thresh = _mm_load_si128((const __m128i *)_thresh); - __m128i mask, hev, flat, flat2; - __m128i p7, p6, p5; - __m128i p4, p3, p2, p1, p0, q0, q1, q2, q3, q4; - __m128i q5, q6, q7; - - __m128i op2, op1, op0, oq0, oq1, oq2; - - __m128i max_abs_p1p0q1q0; - - p7 = _mm_loadu_si128((__m128i *)(s - 8 * p)); - p6 = _mm_loadu_si128((__m128i *)(s - 7 * p)); - p5 = _mm_loadu_si128((__m128i *)(s - 6 * p)); - p4 = _mm_loadu_si128((__m128i *)(s - 5 * p)); - p3 = _mm_loadu_si128((__m128i *)(s - 4 * p)); - p2 = _mm_loadu_si128((__m128i *)(s - 3 * p)); - p1 = _mm_loadu_si128((__m128i *)(s - 2 * p)); - p0 = _mm_loadu_si128((__m128i *)(s - 1 * p)); - q0 = _mm_loadu_si128((__m128i *)(s - 0 * p)); - q1 = _mm_loadu_si128((__m128i *)(s + 1 * p)); - q2 = _mm_loadu_si128((__m128i *)(s + 2 * p)); - q3 = _mm_loadu_si128((__m128i *)(s + 3 * p)); - q4 = _mm_loadu_si128((__m128i *)(s + 4 * p)); - q5 = _mm_loadu_si128((__m128i *)(s + 5 * p)); - q6 = _mm_loadu_si128((__m128i *)(s + 6 * p)); - q7 = _mm_loadu_si128((__m128i *)(s + 7 * p)); - - { - const __m128i abs_p1p0 = abs_diff(p1, p0); - const __m128i abs_q1q0 = abs_diff(q1, q0); - const __m128i fe = _mm_set1_epi8(0xfe); - const __m128i ff = _mm_cmpeq_epi8(zero, zero); - __m128i abs_p0q0 = abs_diff(p0, q0); - __m128i abs_p1q1 = abs_diff(p1, q1); - __m128i work; - max_abs_p1p0q1q0 = _mm_max_epu8(abs_p1p0, abs_q1q0); - - abs_p0q0 =_mm_adds_epu8(abs_p0q0, abs_p0q0); - abs_p1q1 = _mm_srli_epi16(_mm_and_si128(abs_p1q1, fe), 1); - mask = _mm_subs_epu8(_mm_adds_epu8(abs_p0q0, abs_p1q1), blimit); - mask = _mm_xor_si128(_mm_cmpeq_epi8(mask, zero), ff); - // mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 > blimit) * -1; - mask = _mm_max_epu8(max_abs_p1p0q1q0, mask); - // mask |= (abs(p1 - p0) > limit) * -1; - // mask |= (abs(q1 - q0) > limit) * -1; - work = _mm_max_epu8(abs_diff(p2, p1), abs_diff(p3, p2)); - mask = _mm_max_epu8(work, mask); - work = _mm_max_epu8(abs_diff(q2, q1), abs_diff(q3, q2)); - mask = _mm_max_epu8(work, mask); - mask = _mm_subs_epu8(mask, limit); - mask = _mm_cmpeq_epi8(mask, zero); - } - - { - __m128i work; - work = _mm_max_epu8(abs_diff(p2, p0), abs_diff(q2, q0)); - flat = _mm_max_epu8(work, max_abs_p1p0q1q0); - work = _mm_max_epu8(abs_diff(p3, p0), abs_diff(q3, q0)); - flat = _mm_max_epu8(work, flat); - work = _mm_max_epu8(abs_diff(p4, p0), abs_diff(q4, q0)); - flat = _mm_subs_epu8(flat, one); - flat = _mm_cmpeq_epi8(flat, zero); - flat = _mm_and_si128(flat, mask); - flat2 = _mm_max_epu8(abs_diff(p5, p0), abs_diff(q5, q0)); - flat2 = _mm_max_epu8(work, flat2); - work = _mm_max_epu8(abs_diff(p6, p0), abs_diff(q6, q0)); - flat2 = _mm_max_epu8(work, flat2); - work = _mm_max_epu8(abs_diff(p7, p0), abs_diff(q7, q0)); - flat2 = _mm_max_epu8(work, flat2); - flat2 = _mm_subs_epu8(flat2, one); - flat2 = _mm_cmpeq_epi8(flat2, zero); - flat2 = _mm_and_si128(flat2, flat); // flat2 & flat & mask - } - - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // filter4 - { - const __m128i t4 = _mm_set1_epi8(4); - const __m128i t3 = _mm_set1_epi8(3); - const __m128i t80 = _mm_set1_epi8(0x80); - const __m128i te0 = _mm_set1_epi8(0xe0); - const __m128i t1f = _mm_set1_epi8(0x1f); - const __m128i t1 = _mm_set1_epi8(0x1); - const __m128i t7f = _mm_set1_epi8(0x7f); - const __m128i ff = _mm_cmpeq_epi8(t4, t4); - - __m128i filt; - __m128i work_a; - __m128i filter1, filter2; - - op1 = _mm_xor_si128(p1, t80); - op0 = _mm_xor_si128(p0, t80); - oq0 = _mm_xor_si128(q0, t80); - oq1 = _mm_xor_si128(q1, t80); - - hev = _mm_subs_epu8(max_abs_p1p0q1q0, thresh); - hev = _mm_xor_si128(_mm_cmpeq_epi8(hev, zero), ff); - filt = _mm_and_si128(_mm_subs_epi8(op1, oq1), hev); - - work_a = _mm_subs_epi8(oq0, op0); - filt = _mm_adds_epi8(filt, work_a); - filt = _mm_adds_epi8(filt, work_a); - filt = _mm_adds_epi8(filt, work_a); - // (vp9_filter + 3 * (qs0 - ps0)) & mask - filt = _mm_and_si128(filt, mask); - filter1 = _mm_adds_epi8(filt, t4); - filter2 = _mm_adds_epi8(filt, t3); - - // Filter1 >> 3 - work_a = _mm_cmpgt_epi8(zero, filter1); - filter1 = _mm_srli_epi16(filter1, 3); - work_a = _mm_and_si128(work_a, te0); - filter1 = _mm_and_si128(filter1, t1f); - filter1 = _mm_or_si128(filter1, work_a); - oq0 = _mm_xor_si128(_mm_subs_epi8(oq0, filter1), t80); - - // Filter2 >> 3 - work_a = _mm_cmpgt_epi8(zero, filter2); - filter2 = _mm_srli_epi16(filter2, 3); - work_a = _mm_and_si128(work_a, te0); - filter2 = _mm_and_si128(filter2, t1f); - filter2 = _mm_or_si128(filter2, work_a); - op0 = _mm_xor_si128(_mm_adds_epi8(op0, filter2), t80); - - // filt >> 1 - filt = _mm_adds_epi8(filter1, t1); - work_a = _mm_cmpgt_epi8(zero, filt); - filt = _mm_srli_epi16(filt, 1); - work_a = _mm_and_si128(work_a, t80); - filt = _mm_and_si128(filt, t7f); - filt = _mm_or_si128(filt, work_a); - filt = _mm_andnot_si128(hev, filt); - op1 = _mm_xor_si128(_mm_adds_epi8(op1, filt), t80); - oq1 = _mm_xor_si128(_mm_subs_epi8(oq1, filt), t80); - // loopfilter done - - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // filter8 - { - const __m128i four = _mm_set1_epi16(4); - const __m128i p3_lo = _mm_unpacklo_epi8(p3, zero); - const __m128i p2_lo = _mm_unpacklo_epi8(p2, zero); - const __m128i p1_lo = _mm_unpacklo_epi8(p1, zero); - const __m128i p0_lo = _mm_unpacklo_epi8(p0, zero); - const __m128i q0_lo = _mm_unpacklo_epi8(q0, zero); - const __m128i q1_lo = _mm_unpacklo_epi8(q1, zero); - const __m128i q2_lo = _mm_unpacklo_epi8(q2, zero); - const __m128i q3_lo = _mm_unpacklo_epi8(q3, zero); - - const __m128i p3_hi = _mm_unpackhi_epi8(p3, zero); - const __m128i p2_hi = _mm_unpackhi_epi8(p2, zero); - const __m128i p1_hi = _mm_unpackhi_epi8(p1, zero); - const __m128i p0_hi = _mm_unpackhi_epi8(p0, zero); - const __m128i q0_hi = _mm_unpackhi_epi8(q0, zero); - const __m128i q1_hi = _mm_unpackhi_epi8(q1, zero); - const __m128i q2_hi = _mm_unpackhi_epi8(q2, zero); - const __m128i q3_hi = _mm_unpackhi_epi8(q3, zero); - __m128i f8_lo, f8_hi; - - f8_lo = _mm_add_epi16(_mm_add_epi16(p3_lo, four), - _mm_add_epi16(p3_lo, p2_lo)); - f8_lo = _mm_add_epi16(_mm_add_epi16(p3_lo, f8_lo), - _mm_add_epi16(p2_lo, p1_lo)); - f8_lo = _mm_add_epi16(_mm_add_epi16(p0_lo, q0_lo), f8_lo); - - f8_hi = _mm_add_epi16(_mm_add_epi16(p3_hi, four), - _mm_add_epi16(p3_hi, p2_hi)); - f8_hi = _mm_add_epi16(_mm_add_epi16(p3_hi, f8_hi), - _mm_add_epi16(p2_hi, p1_hi)); - f8_hi = _mm_add_epi16(_mm_add_epi16(p0_hi, q0_hi), f8_hi); - - op2 = filter8_mask(&flat, &p2, &f8_lo, &f8_hi); - - f8_lo = filter_add2_sub2(&f8_lo, &q1_lo, &p1_lo, &p2_lo, &p3_lo); - f8_hi = filter_add2_sub2(&f8_hi, &q1_hi, &p1_hi, &p2_hi, &p3_hi); - op1 = filter8_mask(&flat, &op1, &f8_lo, &f8_hi); - - f8_lo = filter_add2_sub2(&f8_lo, &q2_lo, &p0_lo, &p1_lo, &p3_lo); - f8_hi = filter_add2_sub2(&f8_hi, &q2_hi, &p0_hi, &p1_hi, &p3_hi); - op0 = filter8_mask(&flat, &op0, &f8_lo, &f8_hi); - - f8_lo = filter_add2_sub2(&f8_lo, &q3_lo, &q0_lo, &p0_lo, &p3_lo); - f8_hi = filter_add2_sub2(&f8_hi, &q3_hi, &q0_hi, &p0_hi, &p3_hi); - oq0 = filter8_mask(&flat, &oq0, &f8_lo, &f8_hi); - - f8_lo = filter_add2_sub2(&f8_lo, &q3_lo, &q1_lo, &q0_lo, &p2_lo); - f8_hi = filter_add2_sub2(&f8_hi, &q3_hi, &q1_hi, &q0_hi, &p2_hi); - oq1 = filter8_mask(&flat, &oq1, &f8_lo, &f8_hi); - - f8_lo = filter_add2_sub2(&f8_lo, &q3_lo, &q2_lo, &q1_lo, &p1_lo); - f8_hi = filter_add2_sub2(&f8_hi, &q3_hi, &q2_hi, &q1_hi, &p1_hi); - oq2 = filter8_mask(&flat, &q2, &f8_lo, &f8_hi); - } - - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // wide flat calculations - { - const __m128i eight = _mm_set1_epi16(8); - const __m128i p7_lo = _mm_unpacklo_epi8(p7, zero); - const __m128i p6_lo = _mm_unpacklo_epi8(p6, zero); - const __m128i p5_lo = _mm_unpacklo_epi8(p5, zero); - const __m128i p4_lo = _mm_unpacklo_epi8(p4, zero); - const __m128i p3_lo = _mm_unpacklo_epi8(p3, zero); - const __m128i p2_lo = _mm_unpacklo_epi8(p2, zero); - const __m128i p1_lo = _mm_unpacklo_epi8(p1, zero); - const __m128i p0_lo = _mm_unpacklo_epi8(p0, zero); - const __m128i q0_lo = _mm_unpacklo_epi8(q0, zero); - const __m128i q1_lo = _mm_unpacklo_epi8(q1, zero); - const __m128i q2_lo = _mm_unpacklo_epi8(q2, zero); - const __m128i q3_lo = _mm_unpacklo_epi8(q3, zero); - const __m128i q4_lo = _mm_unpacklo_epi8(q4, zero); - const __m128i q5_lo = _mm_unpacklo_epi8(q5, zero); - const __m128i q6_lo = _mm_unpacklo_epi8(q6, zero); - const __m128i q7_lo = _mm_unpacklo_epi8(q7, zero); - - const __m128i p7_hi = _mm_unpackhi_epi8(p7, zero); - const __m128i p6_hi = _mm_unpackhi_epi8(p6, zero); - const __m128i p5_hi = _mm_unpackhi_epi8(p5, zero); - const __m128i p4_hi = _mm_unpackhi_epi8(p4, zero); - const __m128i p3_hi = _mm_unpackhi_epi8(p3, zero); - const __m128i p2_hi = _mm_unpackhi_epi8(p2, zero); - const __m128i p1_hi = _mm_unpackhi_epi8(p1, zero); - const __m128i p0_hi = _mm_unpackhi_epi8(p0, zero); - const __m128i q0_hi = _mm_unpackhi_epi8(q0, zero); - const __m128i q1_hi = _mm_unpackhi_epi8(q1, zero); - const __m128i q2_hi = _mm_unpackhi_epi8(q2, zero); - const __m128i q3_hi = _mm_unpackhi_epi8(q3, zero); - const __m128i q4_hi = _mm_unpackhi_epi8(q4, zero); - const __m128i q5_hi = _mm_unpackhi_epi8(q5, zero); - const __m128i q6_hi = _mm_unpackhi_epi8(q6, zero); - const __m128i q7_hi = _mm_unpackhi_epi8(q7, zero); - - __m128i f_lo; - __m128i f_hi; - - f_lo = _mm_sub_epi16(_mm_slli_epi16(p7_lo, 3), p7_lo); // p7 * 7 - f_lo = _mm_add_epi16(_mm_slli_epi16(p6_lo, 1), - _mm_add_epi16(p4_lo, f_lo)); - f_lo = _mm_add_epi16(_mm_add_epi16(p3_lo, f_lo), - _mm_add_epi16(p2_lo, p1_lo)); - f_lo = _mm_add_epi16(_mm_add_epi16(p0_lo, q0_lo), f_lo); - f_lo = _mm_add_epi16(_mm_add_epi16(p5_lo, eight), f_lo); - - f_hi = _mm_sub_epi16(_mm_slli_epi16(p7_hi, 3), p7_hi); // p7 * 7 - f_hi = _mm_add_epi16(_mm_slli_epi16(p6_hi, 1), - _mm_add_epi16(p4_hi, f_hi)); - f_hi = _mm_add_epi16(_mm_add_epi16(p3_hi, f_hi), - _mm_add_epi16(p2_hi, p1_hi)); - f_hi = _mm_add_epi16(_mm_add_epi16(p0_hi, q0_hi), f_hi); - f_hi = _mm_add_epi16(_mm_add_epi16(p5_hi, eight), f_hi); - - p6 = filter16_mask(&flat2, &p6, &f_lo, &f_hi); - _mm_storeu_si128((__m128i *)(s - 7 * p), p6); - - f_lo = filter_add2_sub2(&f_lo, &q1_lo, &p5_lo, &p6_lo, &p7_lo); - f_hi = filter_add2_sub2(&f_hi, &q1_hi, &p5_hi, &p6_hi, &p7_hi); - p5 = filter16_mask(&flat2, &p5, &f_lo, &f_hi); - _mm_storeu_si128((__m128i *)(s - 6 * p), p5); - - f_lo = filter_add2_sub2(&f_lo, &q2_lo, &p4_lo, &p5_lo, &p7_lo); - f_hi = filter_add2_sub2(&f_hi, &q2_hi, &p4_hi, &p5_hi, &p7_hi); - p4 = filter16_mask(&flat2, &p4, &f_lo, &f_hi); - _mm_storeu_si128((__m128i *)(s - 5 * p), p4); - - f_lo = filter_add2_sub2(&f_lo, &q3_lo, &p3_lo, &p4_lo, &p7_lo); - f_hi = filter_add2_sub2(&f_hi, &q3_hi, &p3_hi, &p4_hi, &p7_hi); - p3 = filter16_mask(&flat2, &p3, &f_lo, &f_hi); - _mm_storeu_si128((__m128i *)(s - 4 * p), p3); - - f_lo = filter_add2_sub2(&f_lo, &q4_lo, &p2_lo, &p3_lo, &p7_lo); - f_hi = filter_add2_sub2(&f_hi, &q4_hi, &p2_hi, &p3_hi, &p7_hi); - op2 = filter16_mask(&flat2, &op2, &f_lo, &f_hi); - _mm_storeu_si128((__m128i *)(s - 3 * p), op2); - - f_lo = filter_add2_sub2(&f_lo, &q5_lo, &p1_lo, &p2_lo, &p7_lo); - f_hi = filter_add2_sub2(&f_hi, &q5_hi, &p1_hi, &p2_hi, &p7_hi); - op1 = filter16_mask(&flat2, &op1, &f_lo, &f_hi); - _mm_storeu_si128((__m128i *)(s - 2 * p), op1); - - f_lo = filter_add2_sub2(&f_lo, &q6_lo, &p0_lo, &p1_lo, &p7_lo); - f_hi = filter_add2_sub2(&f_hi, &q6_hi, &p0_hi, &p1_hi, &p7_hi); - op0 = filter16_mask(&flat2, &op0, &f_lo, &f_hi); - _mm_storeu_si128((__m128i *)(s - 1 * p), op0); - - f_lo = filter_add2_sub2(&f_lo, &q7_lo, &q0_lo, &p0_lo, &p7_lo); - f_hi = filter_add2_sub2(&f_hi, &q7_hi, &q0_hi, &p0_hi, &p7_hi); - oq0 = filter16_mask(&flat2, &oq0, &f_lo, &f_hi); - _mm_storeu_si128((__m128i *)(s - 0 * p), oq0); - - f_lo = filter_add2_sub2(&f_lo, &q7_lo, &q1_lo, &p6_lo, &q0_lo); - f_hi = filter_add2_sub2(&f_hi, &q7_hi, &q1_hi, &p6_hi, &q0_hi); - oq1 = filter16_mask(&flat2, &oq1, &f_lo, &f_hi); - _mm_storeu_si128((__m128i *)(s + 1 * p), oq1); - - f_lo = filter_add2_sub2(&f_lo, &q7_lo, &q2_lo, &p5_lo, &q1_lo); - f_hi = filter_add2_sub2(&f_hi, &q7_hi, &q2_hi, &p5_hi, &q1_hi); - oq2 = filter16_mask(&flat2, &oq2, &f_lo, &f_hi); - _mm_storeu_si128((__m128i *)(s + 2 * p), oq2); - - f_lo = filter_add2_sub2(&f_lo, &q7_lo, &q3_lo, &p4_lo, &q2_lo); - f_hi = filter_add2_sub2(&f_hi, &q7_hi, &q3_hi, &p4_hi, &q2_hi); - q3 = filter16_mask(&flat2, &q3, &f_lo, &f_hi); - _mm_storeu_si128((__m128i *)(s + 3 * p), q3); - - f_lo = filter_add2_sub2(&f_lo, &q7_lo, &q4_lo, &p3_lo, &q3_lo); - f_hi = filter_add2_sub2(&f_hi, &q7_hi, &q4_hi, &p3_hi, &q3_hi); - q4 = filter16_mask(&flat2, &q4, &f_lo, &f_hi); - _mm_storeu_si128((__m128i *)(s + 4 * p), q4); - - f_lo = filter_add2_sub2(&f_lo, &q7_lo, &q5_lo, &p2_lo, &q4_lo); - f_hi = filter_add2_sub2(&f_hi, &q7_hi, &q5_hi, &p2_hi, &q4_hi); - q5 = filter16_mask(&flat2, &q5, &f_lo, &f_hi); - _mm_storeu_si128((__m128i *)(s + 5 * p), q5); - - f_lo = filter_add2_sub2(&f_lo, &q7_lo, &q6_lo, &p1_lo, &q5_lo); - f_hi = filter_add2_sub2(&f_hi, &q7_hi, &q6_hi, &p1_hi, &q5_hi); - q6 = filter16_mask(&flat2, &q6, &f_lo, &f_hi); - _mm_storeu_si128((__m128i *)(s + 6 * p), q6); - } - // wide flat - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - } -} - -// TODO(yunqingwang): remove count and call these 2 functions(8 or 16) directly. -void vp9_lpf_horizontal_16_sse2(unsigned char *s, int p, - const unsigned char *_blimit, - const unsigned char *_limit, - const unsigned char *_thresh, int count) { - if (count == 1) - mb_lpf_horizontal_edge_w_sse2_8(s, p, _blimit, _limit, _thresh); - else - mb_lpf_horizontal_edge_w_sse2_16(s, p, _blimit, _limit, _thresh); -} - -void vp9_lpf_horizontal_8_sse2(unsigned char *s, int p, - const unsigned char *_blimit, - const unsigned char *_limit, - const unsigned char *_thresh, int count) { - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_op2, 16); - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_op1, 16); - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_op0, 16); - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_oq2, 16); - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_oq1, 16); - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_oq0, 16); - const __m128i zero = _mm_set1_epi16(0); - const __m128i blimit = _mm_load_si128((const __m128i *)_blimit); - const __m128i limit = _mm_load_si128((const __m128i *)_limit); - const __m128i thresh = _mm_load_si128((const __m128i *)_thresh); - __m128i mask, hev, flat; - __m128i p3, p2, p1, p0, q0, q1, q2, q3; - __m128i q3p3, q2p2, q1p1, q0p0, p1q1, p0q0; - - (void)count; - - q3p3 = _mm_unpacklo_epi64(_mm_loadl_epi64((__m128i *)(s - 4 * p)), - _mm_loadl_epi64((__m128i *)(s + 3 * p))); - q2p2 = _mm_unpacklo_epi64(_mm_loadl_epi64((__m128i *)(s - 3 * p)), - _mm_loadl_epi64((__m128i *)(s + 2 * p))); - q1p1 = _mm_unpacklo_epi64(_mm_loadl_epi64((__m128i *)(s - 2 * p)), - _mm_loadl_epi64((__m128i *)(s + 1 * p))); - q0p0 = _mm_unpacklo_epi64(_mm_loadl_epi64((__m128i *)(s - 1 * p)), - _mm_loadl_epi64((__m128i *)(s - 0 * p))); - p1q1 = _mm_shuffle_epi32(q1p1, 78); - p0q0 = _mm_shuffle_epi32(q0p0, 78); - - { - // filter_mask and hev_mask - const __m128i one = _mm_set1_epi8(1); - const __m128i fe = _mm_set1_epi8(0xfe); - const __m128i ff = _mm_cmpeq_epi8(fe, fe); - __m128i abs_p1q1, abs_p0q0, abs_q1q0, abs_p1p0, work; - abs_p1p0 = abs_diff(q1p1, q0p0); - abs_q1q0 = _mm_srli_si128(abs_p1p0, 8); - - abs_p0q0 = abs_diff(q0p0, p0q0); - abs_p1q1 = abs_diff(q1p1, p1q1); - flat = _mm_max_epu8(abs_p1p0, abs_q1q0); - hev = _mm_subs_epu8(flat, thresh); - hev = _mm_xor_si128(_mm_cmpeq_epi8(hev, zero), ff); - - abs_p0q0 =_mm_adds_epu8(abs_p0q0, abs_p0q0); - abs_p1q1 = _mm_srli_epi16(_mm_and_si128(abs_p1q1, fe), 1); - mask = _mm_subs_epu8(_mm_adds_epu8(abs_p0q0, abs_p1q1), blimit); - mask = _mm_xor_si128(_mm_cmpeq_epi8(mask, zero), ff); - // mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 > blimit) * -1; - mask = _mm_max_epu8(abs_p1p0, mask); - // mask |= (abs(p1 - p0) > limit) * -1; - // mask |= (abs(q1 - q0) > limit) * -1; - - work = _mm_max_epu8(abs_diff(q2p2, q1p1), - abs_diff(q3p3, q2p2)); - mask = _mm_max_epu8(work, mask); - mask = _mm_max_epu8(mask, _mm_srli_si128(mask, 8)); - mask = _mm_subs_epu8(mask, limit); - mask = _mm_cmpeq_epi8(mask, zero); - - // flat_mask4 - - flat = _mm_max_epu8(abs_diff(q2p2, q0p0), - abs_diff(q3p3, q0p0)); - flat = _mm_max_epu8(abs_p1p0, flat); - flat = _mm_max_epu8(flat, _mm_srli_si128(flat, 8)); - flat = _mm_subs_epu8(flat, one); - flat = _mm_cmpeq_epi8(flat, zero); - flat = _mm_and_si128(flat, mask); - } - - { - const __m128i four = _mm_set1_epi16(4); - unsigned char *src = s; - { - __m128i workp_a, workp_b, workp_shft; - p3 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src - 4 * p)), zero); - p2 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src - 3 * p)), zero); - p1 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src - 2 * p)), zero); - p0 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src - 1 * p)), zero); - q0 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src - 0 * p)), zero); - q1 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src + 1 * p)), zero); - q2 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src + 2 * p)), zero); - q3 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src + 3 * p)), zero); - - workp_a = _mm_add_epi16(_mm_add_epi16(p3, p3), _mm_add_epi16(p2, p1)); - workp_a = _mm_add_epi16(_mm_add_epi16(workp_a, four), p0); - workp_b = _mm_add_epi16(_mm_add_epi16(q0, p2), p3); - workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3); - _mm_storel_epi64((__m128i *)&flat_op2[0], - _mm_packus_epi16(workp_shft, workp_shft)); - - workp_b = _mm_add_epi16(_mm_add_epi16(q0, q1), p1); - workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3); - _mm_storel_epi64((__m128i *)&flat_op1[0], - _mm_packus_epi16(workp_shft, workp_shft)); - - workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p3), q2); - workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, p1), p0); - workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3); - _mm_storel_epi64((__m128i *)&flat_op0[0], - _mm_packus_epi16(workp_shft, workp_shft)); - - workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p3), q3); - workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, p0), q0); - workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3); - _mm_storel_epi64((__m128i *)&flat_oq0[0], - _mm_packus_epi16(workp_shft, workp_shft)); - - workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p2), q3); - workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, q0), q1); - workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3); - _mm_storel_epi64((__m128i *)&flat_oq1[0], - _mm_packus_epi16(workp_shft, workp_shft)); - - workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p1), q3); - workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, q1), q2); - workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3); - _mm_storel_epi64((__m128i *)&flat_oq2[0], - _mm_packus_epi16(workp_shft, workp_shft)); - } - } - // lp filter - { - const __m128i t4 = _mm_set1_epi8(4); - const __m128i t3 = _mm_set1_epi8(3); - const __m128i t80 = _mm_set1_epi8(0x80); - const __m128i t1 = _mm_set1_epi8(0x1); - const __m128i ps1 = _mm_xor_si128(_mm_loadl_epi64((__m128i *)(s - 2 * p)), - t80); - const __m128i ps0 = _mm_xor_si128(_mm_loadl_epi64((__m128i *)(s - 1 * p)), - t80); - const __m128i qs0 = _mm_xor_si128(_mm_loadl_epi64((__m128i *)(s + 0 * p)), - t80); - const __m128i qs1 = _mm_xor_si128(_mm_loadl_epi64((__m128i *)(s + 1 * p)), - t80); - __m128i filt; - __m128i work_a; - __m128i filter1, filter2; - - filt = _mm_and_si128(_mm_subs_epi8(ps1, qs1), hev); - work_a = _mm_subs_epi8(qs0, ps0); - filt = _mm_adds_epi8(filt, work_a); - filt = _mm_adds_epi8(filt, work_a); - filt = _mm_adds_epi8(filt, work_a); - // (vp9_filter + 3 * (qs0 - ps0)) & mask - filt = _mm_and_si128(filt, mask); - - filter1 = _mm_adds_epi8(filt, t4); - filter2 = _mm_adds_epi8(filt, t3); - - // Filter1 >> 3 - filter1 = _mm_unpacklo_epi8(zero, filter1); - filter1 = _mm_srai_epi16(filter1, 11); - filter1 = _mm_packs_epi16(filter1, filter1); - - // Filter2 >> 3 - filter2 = _mm_unpacklo_epi8(zero, filter2); - filter2 = _mm_srai_epi16(filter2, 11); - filter2 = _mm_packs_epi16(filter2, zero); - - // filt >> 1 - filt = _mm_adds_epi8(filter1, t1); - filt = _mm_unpacklo_epi8(zero, filt); - filt = _mm_srai_epi16(filt, 9); - filt = _mm_packs_epi16(filt, zero); - - filt = _mm_andnot_si128(hev, filt); - - work_a = _mm_xor_si128(_mm_subs_epi8(qs0, filter1), t80); - q0 = _mm_loadl_epi64((__m128i *)flat_oq0); - work_a = _mm_andnot_si128(flat, work_a); - q0 = _mm_and_si128(flat, q0); - q0 = _mm_or_si128(work_a, q0); - - work_a = _mm_xor_si128(_mm_subs_epi8(qs1, filt), t80); - q1 = _mm_loadl_epi64((__m128i *)flat_oq1); - work_a = _mm_andnot_si128(flat, work_a); - q1 = _mm_and_si128(flat, q1); - q1 = _mm_or_si128(work_a, q1); - - work_a = _mm_loadu_si128((__m128i *)(s + 2 * p)); - q2 = _mm_loadl_epi64((__m128i *)flat_oq2); - work_a = _mm_andnot_si128(flat, work_a); - q2 = _mm_and_si128(flat, q2); - q2 = _mm_or_si128(work_a, q2); - - work_a = _mm_xor_si128(_mm_adds_epi8(ps0, filter2), t80); - p0 = _mm_loadl_epi64((__m128i *)flat_op0); - work_a = _mm_andnot_si128(flat, work_a); - p0 = _mm_and_si128(flat, p0); - p0 = _mm_or_si128(work_a, p0); - - work_a = _mm_xor_si128(_mm_adds_epi8(ps1, filt), t80); - p1 = _mm_loadl_epi64((__m128i *)flat_op1); - work_a = _mm_andnot_si128(flat, work_a); - p1 = _mm_and_si128(flat, p1); - p1 = _mm_or_si128(work_a, p1); - - work_a = _mm_loadu_si128((__m128i *)(s - 3 * p)); - p2 = _mm_loadl_epi64((__m128i *)flat_op2); - work_a = _mm_andnot_si128(flat, work_a); - p2 = _mm_and_si128(flat, p2); - p2 = _mm_or_si128(work_a, p2); - - _mm_storel_epi64((__m128i *)(s - 3 * p), p2); - _mm_storel_epi64((__m128i *)(s - 2 * p), p1); - _mm_storel_epi64((__m128i *)(s - 1 * p), p0); - _mm_storel_epi64((__m128i *)(s + 0 * p), q0); - _mm_storel_epi64((__m128i *)(s + 1 * p), q1); - _mm_storel_epi64((__m128i *)(s + 2 * p), q2); - } -} - -void vp9_lpf_horizontal_8_dual_sse2(uint8_t *s, int p, - const uint8_t *_blimit0, - const uint8_t *_limit0, - const uint8_t *_thresh0, - const uint8_t *_blimit1, - const uint8_t *_limit1, - const uint8_t *_thresh1) { - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_op2, 16); - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_op1, 16); - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_op0, 16); - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_oq2, 16); - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_oq1, 16); - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_oq0, 16); - const __m128i zero = _mm_set1_epi16(0); - const __m128i blimit = - _mm_unpacklo_epi64(_mm_load_si128((const __m128i *)_blimit0), - _mm_load_si128((const __m128i *)_blimit1)); - const __m128i limit = - _mm_unpacklo_epi64(_mm_load_si128((const __m128i *)_limit0), - _mm_load_si128((const __m128i *)_limit1)); - const __m128i thresh = - _mm_unpacklo_epi64(_mm_load_si128((const __m128i *)_thresh0), - _mm_load_si128((const __m128i *)_thresh1)); - - __m128i mask, hev, flat; - __m128i p3, p2, p1, p0, q0, q1, q2, q3; - - p3 = _mm_loadu_si128((__m128i *)(s - 4 * p)); - p2 = _mm_loadu_si128((__m128i *)(s - 3 * p)); - p1 = _mm_loadu_si128((__m128i *)(s - 2 * p)); - p0 = _mm_loadu_si128((__m128i *)(s - 1 * p)); - q0 = _mm_loadu_si128((__m128i *)(s - 0 * p)); - q1 = _mm_loadu_si128((__m128i *)(s + 1 * p)); - q2 = _mm_loadu_si128((__m128i *)(s + 2 * p)); - q3 = _mm_loadu_si128((__m128i *)(s + 3 * p)); - { - const __m128i abs_p1p0 = _mm_or_si128(_mm_subs_epu8(p1, p0), - _mm_subs_epu8(p0, p1)); - const __m128i abs_q1q0 = _mm_or_si128(_mm_subs_epu8(q1, q0), - _mm_subs_epu8(q0, q1)); - const __m128i one = _mm_set1_epi8(1); - const __m128i fe = _mm_set1_epi8(0xfe); - const __m128i ff = _mm_cmpeq_epi8(abs_p1p0, abs_p1p0); - __m128i abs_p0q0 = _mm_or_si128(_mm_subs_epu8(p0, q0), - _mm_subs_epu8(q0, p0)); - __m128i abs_p1q1 = _mm_or_si128(_mm_subs_epu8(p1, q1), - _mm_subs_epu8(q1, p1)); - __m128i work; - - // filter_mask and hev_mask - flat = _mm_max_epu8(abs_p1p0, abs_q1q0); - hev = _mm_subs_epu8(flat, thresh); - hev = _mm_xor_si128(_mm_cmpeq_epi8(hev, zero), ff); - - abs_p0q0 =_mm_adds_epu8(abs_p0q0, abs_p0q0); - abs_p1q1 = _mm_srli_epi16(_mm_and_si128(abs_p1q1, fe), 1); - mask = _mm_subs_epu8(_mm_adds_epu8(abs_p0q0, abs_p1q1), blimit); - mask = _mm_xor_si128(_mm_cmpeq_epi8(mask, zero), ff); - // mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 > blimit) * -1; - mask = _mm_max_epu8(flat, mask); - // mask |= (abs(p1 - p0) > limit) * -1; - // mask |= (abs(q1 - q0) > limit) * -1; - work = _mm_max_epu8(_mm_or_si128(_mm_subs_epu8(p2, p1), - _mm_subs_epu8(p1, p2)), - _mm_or_si128(_mm_subs_epu8(p3, p2), - _mm_subs_epu8(p2, p3))); - mask = _mm_max_epu8(work, mask); - work = _mm_max_epu8(_mm_or_si128(_mm_subs_epu8(q2, q1), - _mm_subs_epu8(q1, q2)), - _mm_or_si128(_mm_subs_epu8(q3, q2), - _mm_subs_epu8(q2, q3))); - mask = _mm_max_epu8(work, mask); - mask = _mm_subs_epu8(mask, limit); - mask = _mm_cmpeq_epi8(mask, zero); - - // flat_mask4 - work = _mm_max_epu8(_mm_or_si128(_mm_subs_epu8(p2, p0), - _mm_subs_epu8(p0, p2)), - _mm_or_si128(_mm_subs_epu8(q2, q0), - _mm_subs_epu8(q0, q2))); - flat = _mm_max_epu8(work, flat); - work = _mm_max_epu8(_mm_or_si128(_mm_subs_epu8(p3, p0), - _mm_subs_epu8(p0, p3)), - _mm_or_si128(_mm_subs_epu8(q3, q0), - _mm_subs_epu8(q0, q3))); - flat = _mm_max_epu8(work, flat); - flat = _mm_subs_epu8(flat, one); - flat = _mm_cmpeq_epi8(flat, zero); - flat = _mm_and_si128(flat, mask); - } - { - const __m128i four = _mm_set1_epi16(4); - unsigned char *src = s; - int i = 0; - - do { - __m128i workp_a, workp_b, workp_shft; - p3 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src - 4 * p)), zero); - p2 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src - 3 * p)), zero); - p1 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src - 2 * p)), zero); - p0 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src - 1 * p)), zero); - q0 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src - 0 * p)), zero); - q1 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src + 1 * p)), zero); - q2 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src + 2 * p)), zero); - q3 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src + 3 * p)), zero); - - workp_a = _mm_add_epi16(_mm_add_epi16(p3, p3), _mm_add_epi16(p2, p1)); - workp_a = _mm_add_epi16(_mm_add_epi16(workp_a, four), p0); - workp_b = _mm_add_epi16(_mm_add_epi16(q0, p2), p3); - workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3); - _mm_storel_epi64((__m128i *)&flat_op2[i * 8], - _mm_packus_epi16(workp_shft, workp_shft)); - - workp_b = _mm_add_epi16(_mm_add_epi16(q0, q1), p1); - workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3); - _mm_storel_epi64((__m128i *)&flat_op1[i * 8], - _mm_packus_epi16(workp_shft, workp_shft)); - - workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p3), q2); - workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, p1), p0); - workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3); - _mm_storel_epi64((__m128i *)&flat_op0[i * 8], - _mm_packus_epi16(workp_shft, workp_shft)); - - workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p3), q3); - workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, p0), q0); - workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3); - _mm_storel_epi64((__m128i *)&flat_oq0[i * 8], - _mm_packus_epi16(workp_shft, workp_shft)); - - workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p2), q3); - workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, q0), q1); - workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3); - _mm_storel_epi64((__m128i *)&flat_oq1[i * 8], - _mm_packus_epi16(workp_shft, workp_shft)); - - workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p1), q3); - workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, q1), q2); - workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3); - _mm_storel_epi64((__m128i *)&flat_oq2[i * 8], - _mm_packus_epi16(workp_shft, workp_shft)); - - src += 8; - } while (++i < 2); - } - // lp filter - { - const __m128i t4 = _mm_set1_epi8(4); - const __m128i t3 = _mm_set1_epi8(3); - const __m128i t80 = _mm_set1_epi8(0x80); - const __m128i te0 = _mm_set1_epi8(0xe0); - const __m128i t1f = _mm_set1_epi8(0x1f); - const __m128i t1 = _mm_set1_epi8(0x1); - const __m128i t7f = _mm_set1_epi8(0x7f); - - const __m128i ps1 = _mm_xor_si128(_mm_loadu_si128((__m128i *)(s - 2 * p)), - t80); - const __m128i ps0 = _mm_xor_si128(_mm_loadu_si128((__m128i *)(s - 1 * p)), - t80); - const __m128i qs0 = _mm_xor_si128(_mm_loadu_si128((__m128i *)(s + 0 * p)), - t80); - const __m128i qs1 = _mm_xor_si128(_mm_loadu_si128((__m128i *)(s + 1 * p)), - t80); - __m128i filt; - __m128i work_a; - __m128i filter1, filter2; - - filt = _mm_and_si128(_mm_subs_epi8(ps1, qs1), hev); - work_a = _mm_subs_epi8(qs0, ps0); - filt = _mm_adds_epi8(filt, work_a); - filt = _mm_adds_epi8(filt, work_a); - filt = _mm_adds_epi8(filt, work_a); - // (vp9_filter + 3 * (qs0 - ps0)) & mask - filt = _mm_and_si128(filt, mask); - - filter1 = _mm_adds_epi8(filt, t4); - filter2 = _mm_adds_epi8(filt, t3); - - // Filter1 >> 3 - work_a = _mm_cmpgt_epi8(zero, filter1); - filter1 = _mm_srli_epi16(filter1, 3); - work_a = _mm_and_si128(work_a, te0); - filter1 = _mm_and_si128(filter1, t1f); - filter1 = _mm_or_si128(filter1, work_a); - - // Filter2 >> 3 - work_a = _mm_cmpgt_epi8(zero, filter2); - filter2 = _mm_srli_epi16(filter2, 3); - work_a = _mm_and_si128(work_a, te0); - filter2 = _mm_and_si128(filter2, t1f); - filter2 = _mm_or_si128(filter2, work_a); - - // filt >> 1 - filt = _mm_adds_epi8(filter1, t1); - work_a = _mm_cmpgt_epi8(zero, filt); - filt = _mm_srli_epi16(filt, 1); - work_a = _mm_and_si128(work_a, t80); - filt = _mm_and_si128(filt, t7f); - filt = _mm_or_si128(filt, work_a); - - filt = _mm_andnot_si128(hev, filt); - - work_a = _mm_xor_si128(_mm_subs_epi8(qs0, filter1), t80); - q0 = _mm_load_si128((__m128i *)flat_oq0); - work_a = _mm_andnot_si128(flat, work_a); - q0 = _mm_and_si128(flat, q0); - q0 = _mm_or_si128(work_a, q0); - - work_a = _mm_xor_si128(_mm_subs_epi8(qs1, filt), t80); - q1 = _mm_load_si128((__m128i *)flat_oq1); - work_a = _mm_andnot_si128(flat, work_a); - q1 = _mm_and_si128(flat, q1); - q1 = _mm_or_si128(work_a, q1); - - work_a = _mm_loadu_si128((__m128i *)(s + 2 * p)); - q2 = _mm_load_si128((__m128i *)flat_oq2); - work_a = _mm_andnot_si128(flat, work_a); - q2 = _mm_and_si128(flat, q2); - q2 = _mm_or_si128(work_a, q2); - - work_a = _mm_xor_si128(_mm_adds_epi8(ps0, filter2), t80); - p0 = _mm_load_si128((__m128i *)flat_op0); - work_a = _mm_andnot_si128(flat, work_a); - p0 = _mm_and_si128(flat, p0); - p0 = _mm_or_si128(work_a, p0); - - work_a = _mm_xor_si128(_mm_adds_epi8(ps1, filt), t80); - p1 = _mm_load_si128((__m128i *)flat_op1); - work_a = _mm_andnot_si128(flat, work_a); - p1 = _mm_and_si128(flat, p1); - p1 = _mm_or_si128(work_a, p1); - - work_a = _mm_loadu_si128((__m128i *)(s - 3 * p)); - p2 = _mm_load_si128((__m128i *)flat_op2); - work_a = _mm_andnot_si128(flat, work_a); - p2 = _mm_and_si128(flat, p2); - p2 = _mm_or_si128(work_a, p2); - - _mm_storeu_si128((__m128i *)(s - 3 * p), p2); - _mm_storeu_si128((__m128i *)(s - 2 * p), p1); - _mm_storeu_si128((__m128i *)(s - 1 * p), p0); - _mm_storeu_si128((__m128i *)(s + 0 * p), q0); - _mm_storeu_si128((__m128i *)(s + 1 * p), q1); - _mm_storeu_si128((__m128i *)(s + 2 * p), q2); - } -} - -void vp9_lpf_horizontal_4_dual_sse2(unsigned char *s, int p, - const unsigned char *_blimit0, - const unsigned char *_limit0, - const unsigned char *_thresh0, - const unsigned char *_blimit1, - const unsigned char *_limit1, - const unsigned char *_thresh1) { - const __m128i blimit = - _mm_unpacklo_epi64(_mm_load_si128((const __m128i *)_blimit0), - _mm_load_si128((const __m128i *)_blimit1)); - const __m128i limit = - _mm_unpacklo_epi64(_mm_load_si128((const __m128i *)_limit0), - _mm_load_si128((const __m128i *)_limit1)); - const __m128i thresh = - _mm_unpacklo_epi64(_mm_load_si128((const __m128i *)_thresh0), - _mm_load_si128((const __m128i *)_thresh1)); - const __m128i zero = _mm_set1_epi16(0); - __m128i p3, p2, p1, p0, q0, q1, q2, q3; - __m128i mask, hev, flat; - - p3 = _mm_loadu_si128((__m128i *)(s - 4 * p)); - p2 = _mm_loadu_si128((__m128i *)(s - 3 * p)); - p1 = _mm_loadu_si128((__m128i *)(s - 2 * p)); - p0 = _mm_loadu_si128((__m128i *)(s - 1 * p)); - q0 = _mm_loadu_si128((__m128i *)(s - 0 * p)); - q1 = _mm_loadu_si128((__m128i *)(s + 1 * p)); - q2 = _mm_loadu_si128((__m128i *)(s + 2 * p)); - q3 = _mm_loadu_si128((__m128i *)(s + 3 * p)); - - // filter_mask and hev_mask - { - const __m128i abs_p1p0 = _mm_or_si128(_mm_subs_epu8(p1, p0), - _mm_subs_epu8(p0, p1)); - const __m128i abs_q1q0 = _mm_or_si128(_mm_subs_epu8(q1, q0), - _mm_subs_epu8(q0, q1)); - const __m128i fe = _mm_set1_epi8(0xfe); - const __m128i ff = _mm_cmpeq_epi8(abs_p1p0, abs_p1p0); - __m128i abs_p0q0 = _mm_or_si128(_mm_subs_epu8(p0, q0), - _mm_subs_epu8(q0, p0)); - __m128i abs_p1q1 = _mm_or_si128(_mm_subs_epu8(p1, q1), - _mm_subs_epu8(q1, p1)); - __m128i work; - - flat = _mm_max_epu8(abs_p1p0, abs_q1q0); - hev = _mm_subs_epu8(flat, thresh); - hev = _mm_xor_si128(_mm_cmpeq_epi8(hev, zero), ff); - - abs_p0q0 =_mm_adds_epu8(abs_p0q0, abs_p0q0); - abs_p1q1 = _mm_srli_epi16(_mm_and_si128(abs_p1q1, fe), 1); - mask = _mm_subs_epu8(_mm_adds_epu8(abs_p0q0, abs_p1q1), blimit); - mask = _mm_xor_si128(_mm_cmpeq_epi8(mask, zero), ff); - // mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 > blimit) * -1; - mask = _mm_max_epu8(flat, mask); - // mask |= (abs(p1 - p0) > limit) * -1; - // mask |= (abs(q1 - q0) > limit) * -1; - work = _mm_max_epu8(_mm_or_si128(_mm_subs_epu8(p2, p1), - _mm_subs_epu8(p1, p2)), - _mm_or_si128(_mm_subs_epu8(p3, p2), - _mm_subs_epu8(p2, p3))); - mask = _mm_max_epu8(work, mask); - work = _mm_max_epu8(_mm_or_si128(_mm_subs_epu8(q2, q1), - _mm_subs_epu8(q1, q2)), - _mm_or_si128(_mm_subs_epu8(q3, q2), - _mm_subs_epu8(q2, q3))); - mask = _mm_max_epu8(work, mask); - mask = _mm_subs_epu8(mask, limit); - mask = _mm_cmpeq_epi8(mask, zero); - } - - // filter4 - { - const __m128i t4 = _mm_set1_epi8(4); - const __m128i t3 = _mm_set1_epi8(3); - const __m128i t80 = _mm_set1_epi8(0x80); - const __m128i te0 = _mm_set1_epi8(0xe0); - const __m128i t1f = _mm_set1_epi8(0x1f); - const __m128i t1 = _mm_set1_epi8(0x1); - const __m128i t7f = _mm_set1_epi8(0x7f); - - const __m128i ps1 = _mm_xor_si128(_mm_loadu_si128((__m128i *)(s - 2 * p)), - t80); - const __m128i ps0 = _mm_xor_si128(_mm_loadu_si128((__m128i *)(s - 1 * p)), - t80); - const __m128i qs0 = _mm_xor_si128(_mm_loadu_si128((__m128i *)(s + 0 * p)), - t80); - const __m128i qs1 = _mm_xor_si128(_mm_loadu_si128((__m128i *)(s + 1 * p)), - t80); - __m128i filt; - __m128i work_a; - __m128i filter1, filter2; - - filt = _mm_and_si128(_mm_subs_epi8(ps1, qs1), hev); - work_a = _mm_subs_epi8(qs0, ps0); - filt = _mm_adds_epi8(filt, work_a); - filt = _mm_adds_epi8(filt, work_a); - filt = _mm_adds_epi8(filt, work_a); - // (vp9_filter + 3 * (qs0 - ps0)) & mask - filt = _mm_and_si128(filt, mask); - - filter1 = _mm_adds_epi8(filt, t4); - filter2 = _mm_adds_epi8(filt, t3); - - // Filter1 >> 3 - work_a = _mm_cmpgt_epi8(zero, filter1); - filter1 = _mm_srli_epi16(filter1, 3); - work_a = _mm_and_si128(work_a, te0); - filter1 = _mm_and_si128(filter1, t1f); - filter1 = _mm_or_si128(filter1, work_a); - - // Filter2 >> 3 - work_a = _mm_cmpgt_epi8(zero, filter2); - filter2 = _mm_srli_epi16(filter2, 3); - work_a = _mm_and_si128(work_a, te0); - filter2 = _mm_and_si128(filter2, t1f); - filter2 = _mm_or_si128(filter2, work_a); - - // filt >> 1 - filt = _mm_adds_epi8(filter1, t1); - work_a = _mm_cmpgt_epi8(zero, filt); - filt = _mm_srli_epi16(filt, 1); - work_a = _mm_and_si128(work_a, t80); - filt = _mm_and_si128(filt, t7f); - filt = _mm_or_si128(filt, work_a); - - filt = _mm_andnot_si128(hev, filt); - - q0 = _mm_xor_si128(_mm_subs_epi8(qs0, filter1), t80); - q1 = _mm_xor_si128(_mm_subs_epi8(qs1, filt), t80); - p0 = _mm_xor_si128(_mm_adds_epi8(ps0, filter2), t80); - p1 = _mm_xor_si128(_mm_adds_epi8(ps1, filt), t80); - - _mm_storeu_si128((__m128i *)(s - 2 * p), p1); - _mm_storeu_si128((__m128i *)(s - 1 * p), p0); - _mm_storeu_si128((__m128i *)(s + 0 * p), q0); - _mm_storeu_si128((__m128i *)(s + 1 * p), q1); - } -} - -static INLINE void transpose8x16(unsigned char *in0, unsigned char *in1, - int in_p, unsigned char *out, int out_p) { - __m128i x0, x1, x2, x3, x4, x5, x6, x7; - __m128i x8, x9, x10, x11, x12, x13, x14, x15; - - // Read in 16 lines - x0 = _mm_loadl_epi64((__m128i *)in0); - x8 = _mm_loadl_epi64((__m128i *)in1); - x1 = _mm_loadl_epi64((__m128i *)(in0 + in_p)); - x9 = _mm_loadl_epi64((__m128i *)(in1 + in_p)); - x2 = _mm_loadl_epi64((__m128i *)(in0 + 2 * in_p)); - x10 = _mm_loadl_epi64((__m128i *)(in1 + 2 * in_p)); - x3 = _mm_loadl_epi64((__m128i *)(in0 + 3*in_p)); - x11 = _mm_loadl_epi64((__m128i *)(in1 + 3*in_p)); - x4 = _mm_loadl_epi64((__m128i *)(in0 + 4*in_p)); - x12 = _mm_loadl_epi64((__m128i *)(in1 + 4*in_p)); - x5 = _mm_loadl_epi64((__m128i *)(in0 + 5*in_p)); - x13 = _mm_loadl_epi64((__m128i *)(in1 + 5*in_p)); - x6 = _mm_loadl_epi64((__m128i *)(in0 + 6*in_p)); - x14 = _mm_loadl_epi64((__m128i *)(in1 + 6*in_p)); - x7 = _mm_loadl_epi64((__m128i *)(in0 + 7*in_p)); - x15 = _mm_loadl_epi64((__m128i *)(in1 + 7*in_p)); - - x0 = _mm_unpacklo_epi8(x0, x1); - x1 = _mm_unpacklo_epi8(x2, x3); - x2 = _mm_unpacklo_epi8(x4, x5); - x3 = _mm_unpacklo_epi8(x6, x7); - - x8 = _mm_unpacklo_epi8(x8, x9); - x9 = _mm_unpacklo_epi8(x10, x11); - x10 = _mm_unpacklo_epi8(x12, x13); - x11 = _mm_unpacklo_epi8(x14, x15); - - x4 = _mm_unpacklo_epi16(x0, x1); - x5 = _mm_unpacklo_epi16(x2, x3); - x12 = _mm_unpacklo_epi16(x8, x9); - x13 = _mm_unpacklo_epi16(x10, x11); - - x6 = _mm_unpacklo_epi32(x4, x5); - x7 = _mm_unpackhi_epi32(x4, x5); - x14 = _mm_unpacklo_epi32(x12, x13); - x15 = _mm_unpackhi_epi32(x12, x13); - - // Store first 4-line result - _mm_storeu_si128((__m128i *)out, _mm_unpacklo_epi64(x6, x14)); - _mm_storeu_si128((__m128i *)(out + out_p), _mm_unpackhi_epi64(x6, x14)); - _mm_storeu_si128((__m128i *)(out + 2 * out_p), _mm_unpacklo_epi64(x7, x15)); - _mm_storeu_si128((__m128i *)(out + 3 * out_p), _mm_unpackhi_epi64(x7, x15)); - - x4 = _mm_unpackhi_epi16(x0, x1); - x5 = _mm_unpackhi_epi16(x2, x3); - x12 = _mm_unpackhi_epi16(x8, x9); - x13 = _mm_unpackhi_epi16(x10, x11); - - x6 = _mm_unpacklo_epi32(x4, x5); - x7 = _mm_unpackhi_epi32(x4, x5); - x14 = _mm_unpacklo_epi32(x12, x13); - x15 = _mm_unpackhi_epi32(x12, x13); - - // Store second 4-line result - _mm_storeu_si128((__m128i *)(out + 4 * out_p), _mm_unpacklo_epi64(x6, x14)); - _mm_storeu_si128((__m128i *)(out + 5 * out_p), _mm_unpackhi_epi64(x6, x14)); - _mm_storeu_si128((__m128i *)(out + 6 * out_p), _mm_unpacklo_epi64(x7, x15)); - _mm_storeu_si128((__m128i *)(out + 7 * out_p), _mm_unpackhi_epi64(x7, x15)); -} - -static INLINE void transpose(unsigned char *src[], int in_p, - unsigned char *dst[], int out_p, - int num_8x8_to_transpose) { - int idx8x8 = 0; - __m128i x0, x1, x2, x3, x4, x5, x6, x7; - do { - unsigned char *in = src[idx8x8]; - unsigned char *out = dst[idx8x8]; - - x0 = _mm_loadl_epi64((__m128i *)(in + 0*in_p)); // 00 01 02 03 04 05 06 07 - x1 = _mm_loadl_epi64((__m128i *)(in + 1*in_p)); // 10 11 12 13 14 15 16 17 - x2 = _mm_loadl_epi64((__m128i *)(in + 2*in_p)); // 20 21 22 23 24 25 26 27 - x3 = _mm_loadl_epi64((__m128i *)(in + 3*in_p)); // 30 31 32 33 34 35 36 37 - x4 = _mm_loadl_epi64((__m128i *)(in + 4*in_p)); // 40 41 42 43 44 45 46 47 - x5 = _mm_loadl_epi64((__m128i *)(in + 5*in_p)); // 50 51 52 53 54 55 56 57 - x6 = _mm_loadl_epi64((__m128i *)(in + 6*in_p)); // 60 61 62 63 64 65 66 67 - x7 = _mm_loadl_epi64((__m128i *)(in + 7*in_p)); // 70 71 72 73 74 75 76 77 - // 00 10 01 11 02 12 03 13 04 14 05 15 06 16 07 17 - x0 = _mm_unpacklo_epi8(x0, x1); - // 20 30 21 31 22 32 23 33 24 34 25 35 26 36 27 37 - x1 = _mm_unpacklo_epi8(x2, x3); - // 40 50 41 51 42 52 43 53 44 54 45 55 46 56 47 57 - x2 = _mm_unpacklo_epi8(x4, x5); - // 60 70 61 71 62 72 63 73 64 74 65 75 66 76 67 77 - x3 = _mm_unpacklo_epi8(x6, x7); - // 00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33 - x4 = _mm_unpacklo_epi16(x0, x1); - // 40 50 60 70 41 51 61 71 42 52 62 72 43 53 63 73 - x5 = _mm_unpacklo_epi16(x2, x3); - // 00 10 20 30 40 50 60 70 01 11 21 31 41 51 61 71 - x6 = _mm_unpacklo_epi32(x4, x5); - // 02 12 22 32 42 52 62 72 03 13 23 33 43 53 63 73 - x7 = _mm_unpackhi_epi32(x4, x5); - - _mm_storel_pd((double *)(out + 0*out_p), - _mm_castsi128_pd(x6)); // 00 10 20 30 40 50 60 70 - _mm_storeh_pd((double *)(out + 1*out_p), - _mm_castsi128_pd(x6)); // 01 11 21 31 41 51 61 71 - _mm_storel_pd((double *)(out + 2*out_p), - _mm_castsi128_pd(x7)); // 02 12 22 32 42 52 62 72 - _mm_storeh_pd((double *)(out + 3*out_p), - _mm_castsi128_pd(x7)); // 03 13 23 33 43 53 63 73 - - // 04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37 - x4 = _mm_unpackhi_epi16(x0, x1); - // 44 54 64 74 45 55 65 75 46 56 66 76 47 57 67 77 - x5 = _mm_unpackhi_epi16(x2, x3); - // 04 14 24 34 44 54 64 74 05 15 25 35 45 55 65 75 - x6 = _mm_unpacklo_epi32(x4, x5); - // 06 16 26 36 46 56 66 76 07 17 27 37 47 57 67 77 - x7 = _mm_unpackhi_epi32(x4, x5); - - _mm_storel_pd((double *)(out + 4*out_p), - _mm_castsi128_pd(x6)); // 04 14 24 34 44 54 64 74 - _mm_storeh_pd((double *)(out + 5*out_p), - _mm_castsi128_pd(x6)); // 05 15 25 35 45 55 65 75 - _mm_storel_pd((double *)(out + 6*out_p), - _mm_castsi128_pd(x7)); // 06 16 26 36 46 56 66 76 - _mm_storeh_pd((double *)(out + 7*out_p), - _mm_castsi128_pd(x7)); // 07 17 27 37 47 57 67 77 - } while (++idx8x8 < num_8x8_to_transpose); -} - -void vp9_lpf_vertical_4_dual_sse2(uint8_t *s, int p, const uint8_t *blimit0, - const uint8_t *limit0, - const uint8_t *thresh0, - const uint8_t *blimit1, - const uint8_t *limit1, - const uint8_t *thresh1) { - DECLARE_ALIGNED_ARRAY(16, unsigned char, t_dst, 16 * 8); - unsigned char *src[2]; - unsigned char *dst[2]; - - // Transpose 8x16 - transpose8x16(s - 4, s - 4 + p * 8, p, t_dst, 16); - - // Loop filtering - vp9_lpf_horizontal_4_dual_sse2(t_dst + 4 * 16, 16, blimit0, limit0, thresh0, - blimit1, limit1, thresh1); - src[0] = t_dst; - src[1] = t_dst + 8; - dst[0] = s - 4; - dst[1] = s - 4 + p * 8; - - // Transpose back - transpose(src, 16, dst, p, 2); -} - -void vp9_lpf_vertical_8_sse2(unsigned char *s, int p, - const unsigned char *blimit, - const unsigned char *limit, - const unsigned char *thresh, int count) { - DECLARE_ALIGNED_ARRAY(8, unsigned char, t_dst, 8 * 8); - unsigned char *src[1]; - unsigned char *dst[1]; - (void)count; - - // Transpose 8x8 - src[0] = s - 4; - dst[0] = t_dst; - - transpose(src, p, dst, 8, 1); - - // Loop filtering - vp9_lpf_horizontal_8_sse2(t_dst + 4 * 8, 8, blimit, limit, thresh, 1); - - src[0] = t_dst; - dst[0] = s - 4; - - // Transpose back - transpose(src, 8, dst, p, 1); -} - -void vp9_lpf_vertical_8_dual_sse2(uint8_t *s, int p, const uint8_t *blimit0, - const uint8_t *limit0, - const uint8_t *thresh0, - const uint8_t *blimit1, - const uint8_t *limit1, - const uint8_t *thresh1) { - DECLARE_ALIGNED_ARRAY(16, unsigned char, t_dst, 16 * 8); - unsigned char *src[2]; - unsigned char *dst[2]; - - // Transpose 8x16 - transpose8x16(s - 4, s - 4 + p * 8, p, t_dst, 16); - - // Loop filtering - vp9_lpf_horizontal_8_dual_sse2(t_dst + 4 * 16, 16, blimit0, limit0, thresh0, - blimit1, limit1, thresh1); - src[0] = t_dst; - src[1] = t_dst + 8; - - dst[0] = s - 4; - dst[1] = s - 4 + p * 8; - - // Transpose back - transpose(src, 16, dst, p, 2); -} - -void vp9_lpf_vertical_16_sse2(unsigned char *s, int p, - const unsigned char *blimit, - const unsigned char *limit, - const unsigned char *thresh) { - DECLARE_ALIGNED_ARRAY(8, unsigned char, t_dst, 8 * 16); - unsigned char *src[2]; - unsigned char *dst[2]; - - src[0] = s - 8; - src[1] = s; - dst[0] = t_dst; - dst[1] = t_dst + 8 * 8; - - // Transpose 16x8 - transpose(src, p, dst, 8, 2); - - // Loop filtering - mb_lpf_horizontal_edge_w_sse2_8(t_dst + 8 * 8, 8, blimit, limit, thresh); - - src[0] = t_dst; - src[1] = t_dst + 8 * 8; - dst[0] = s - 8; - dst[1] = s; - - // Transpose back - transpose(src, 8, dst, p, 2); -} - -void vp9_lpf_vertical_16_dual_sse2(unsigned char *s, int p, - const uint8_t *blimit, const uint8_t *limit, - const uint8_t *thresh) { - DECLARE_ALIGNED_ARRAY(16, unsigned char, t_dst, 256); - - // Transpose 16x16 - transpose8x16(s - 8, s - 8 + 8 * p, p, t_dst, 16); - transpose8x16(s, s + 8 * p, p, t_dst + 8 * 16, 16); - - // Loop filtering - mb_lpf_horizontal_edge_w_sse2_16(t_dst + 8 * 16, 16, blimit, limit, - thresh); - - // Transpose back - transpose8x16(t_dst, t_dst + 8 * 16, 16, s - 8, p); - transpose8x16(t_dst + 8, t_dst + 8 + 8 * 16, 16, s - 8 + 8 * p, p); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_subpixel_8t_intrin_avx2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_subpixel_8t_intrin_avx2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_subpixel_8t_intrin_avx2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_subpixel_8t_intrin_avx2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,544 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "vpx_ports/mem.h" - -// filters for 16_h8 and 16_v8 -DECLARE_ALIGNED(32, static const uint8_t, filt1_global_avx2[32]) = { - 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, - 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 -}; - -DECLARE_ALIGNED(32, static const uint8_t, filt2_global_avx2[32]) = { - 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, - 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10 -}; - -DECLARE_ALIGNED(32, static const uint8_t, filt3_global_avx2[32]) = { - 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, - 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12 -}; - -DECLARE_ALIGNED(32, static const uint8_t, filt4_global_avx2[32]) = { - 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, - 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14 -}; - -#if defined(__clang__) -# if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ <= 3) || \ - (defined(__APPLE__) && __clang_major__ == 5 && __clang_minor__ == 0) -# define MM256_BROADCASTSI128_SI256(x) \ - _mm_broadcastsi128_si256((__m128i const *)&(x)) -# else // clang > 3.3, and not 5.0 on macosx. -# define MM256_BROADCASTSI128_SI256(x) _mm256_broadcastsi128_si256(x) -# endif // clang <= 3.3 -#elif defined(__GNUC__) -# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ <= 6) -# define MM256_BROADCASTSI128_SI256(x) \ - _mm_broadcastsi128_si256((__m128i const *)&(x)) -# elif __GNUC__ == 4 && __GNUC_MINOR__ == 7 -# define MM256_BROADCASTSI128_SI256(x) _mm_broadcastsi128_si256(x) -# else // gcc > 4.7 -# define MM256_BROADCASTSI128_SI256(x) _mm256_broadcastsi128_si256(x) -# endif // gcc <= 4.6 -#else // !(gcc || clang) -# define MM256_BROADCASTSI128_SI256(x) _mm256_broadcastsi128_si256(x) -#endif // __clang__ - -void vp9_filter_block1d16_h8_avx2(unsigned char *src_ptr, - unsigned int src_pixels_per_line, - unsigned char *output_ptr, - unsigned int output_pitch, - unsigned int output_height, - int16_t *filter) { - __m128i filtersReg; - __m256i addFilterReg64, filt1Reg, filt2Reg, filt3Reg, filt4Reg; - __m256i firstFilters, secondFilters, thirdFilters, forthFilters; - __m256i srcRegFilt32b1_1, srcRegFilt32b2_1, srcRegFilt32b2, srcRegFilt32b3; - __m256i srcReg32b1, srcReg32b2, filtersReg32; - unsigned int i; - unsigned int src_stride, dst_stride; - - // create a register with 0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64 - addFilterReg64 = _mm256_set1_epi32((int)0x0400040u); - filtersReg = _mm_loadu_si128((__m128i *)filter); - // converting the 16 bit (short) to 8 bit (byte) and have the same data - // in both lanes of 128 bit register. - filtersReg =_mm_packs_epi16(filtersReg, filtersReg); - // have the same data in both lanes of a 256 bit register - filtersReg32 = MM256_BROADCASTSI128_SI256(filtersReg); - - // duplicate only the first 16 bits (first and second byte) - // across 256 bit register - firstFilters = _mm256_shuffle_epi8(filtersReg32, - _mm256_set1_epi16(0x100u)); - // duplicate only the second 16 bits (third and forth byte) - // across 256 bit register - secondFilters = _mm256_shuffle_epi8(filtersReg32, - _mm256_set1_epi16(0x302u)); - // duplicate only the third 16 bits (fifth and sixth byte) - // across 256 bit register - thirdFilters = _mm256_shuffle_epi8(filtersReg32, - _mm256_set1_epi16(0x504u)); - // duplicate only the forth 16 bits (seventh and eighth byte) - // across 256 bit register - forthFilters = _mm256_shuffle_epi8(filtersReg32, - _mm256_set1_epi16(0x706u)); - - filt1Reg = _mm256_load_si256((__m256i const *)filt1_global_avx2); - filt2Reg = _mm256_load_si256((__m256i const *)filt2_global_avx2); - filt3Reg = _mm256_load_si256((__m256i const *)filt3_global_avx2); - filt4Reg = _mm256_load_si256((__m256i const *)filt4_global_avx2); - - // multiple the size of the source and destination stride by two - src_stride = src_pixels_per_line << 1; - dst_stride = output_pitch << 1; - for (i = output_height; i > 1; i-=2) { - // load the 2 strides of source - srcReg32b1 = _mm256_castsi128_si256( - _mm_loadu_si128((__m128i *)(src_ptr-3))); - srcReg32b1 = _mm256_inserti128_si256(srcReg32b1, - _mm_loadu_si128((__m128i *) - (src_ptr+src_pixels_per_line-3)), 1); - - // filter the source buffer - srcRegFilt32b1_1= _mm256_shuffle_epi8(srcReg32b1, filt1Reg); - srcRegFilt32b2= _mm256_shuffle_epi8(srcReg32b1, filt4Reg); - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt32b1_1 = _mm256_maddubs_epi16(srcRegFilt32b1_1, firstFilters); - srcRegFilt32b2 = _mm256_maddubs_epi16(srcRegFilt32b2, forthFilters); - - // add and saturate the results together - srcRegFilt32b1_1 = _mm256_adds_epi16(srcRegFilt32b1_1, srcRegFilt32b2); - - // filter the source buffer - srcRegFilt32b3= _mm256_shuffle_epi8(srcReg32b1, filt2Reg); - srcRegFilt32b2= _mm256_shuffle_epi8(srcReg32b1, filt3Reg); - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt32b3 = _mm256_maddubs_epi16(srcRegFilt32b3, secondFilters); - srcRegFilt32b2 = _mm256_maddubs_epi16(srcRegFilt32b2, thirdFilters); - - // add and saturate the results together - srcRegFilt32b1_1 = _mm256_adds_epi16(srcRegFilt32b1_1, - _mm256_min_epi16(srcRegFilt32b3, srcRegFilt32b2)); - - // reading 2 strides of the next 16 bytes - // (part of it was being read by earlier read) - srcReg32b2 = _mm256_castsi128_si256( - _mm_loadu_si128((__m128i *)(src_ptr+5))); - srcReg32b2 = _mm256_inserti128_si256(srcReg32b2, - _mm_loadu_si128((__m128i *) - (src_ptr+src_pixels_per_line+5)), 1); - - // add and saturate the results together - srcRegFilt32b1_1 = _mm256_adds_epi16(srcRegFilt32b1_1, - _mm256_max_epi16(srcRegFilt32b3, srcRegFilt32b2)); - - // filter the source buffer - srcRegFilt32b2_1 = _mm256_shuffle_epi8(srcReg32b2, filt1Reg); - srcRegFilt32b2 = _mm256_shuffle_epi8(srcReg32b2, filt4Reg); - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt32b2_1 = _mm256_maddubs_epi16(srcRegFilt32b2_1, firstFilters); - srcRegFilt32b2 = _mm256_maddubs_epi16(srcRegFilt32b2, forthFilters); - - // add and saturate the results together - srcRegFilt32b2_1 = _mm256_adds_epi16(srcRegFilt32b2_1, srcRegFilt32b2); - - // filter the source buffer - srcRegFilt32b3= _mm256_shuffle_epi8(srcReg32b2, filt2Reg); - srcRegFilt32b2= _mm256_shuffle_epi8(srcReg32b2, filt3Reg); - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt32b3 = _mm256_maddubs_epi16(srcRegFilt32b3, secondFilters); - srcRegFilt32b2 = _mm256_maddubs_epi16(srcRegFilt32b2, thirdFilters); - - // add and saturate the results together - srcRegFilt32b2_1 = _mm256_adds_epi16(srcRegFilt32b2_1, - _mm256_min_epi16(srcRegFilt32b3, srcRegFilt32b2)); - srcRegFilt32b2_1 = _mm256_adds_epi16(srcRegFilt32b2_1, - _mm256_max_epi16(srcRegFilt32b3, srcRegFilt32b2)); - - - srcRegFilt32b1_1 = _mm256_adds_epi16(srcRegFilt32b1_1, addFilterReg64); - - srcRegFilt32b2_1 = _mm256_adds_epi16(srcRegFilt32b2_1, addFilterReg64); - - // shift by 7 bit each 16 bit - srcRegFilt32b1_1 = _mm256_srai_epi16(srcRegFilt32b1_1, 7); - srcRegFilt32b2_1 = _mm256_srai_epi16(srcRegFilt32b2_1, 7); - - // shrink to 8 bit each 16 bits, the first lane contain the first - // convolve result and the second lane contain the second convolve - // result - srcRegFilt32b1_1 = _mm256_packus_epi16(srcRegFilt32b1_1, - srcRegFilt32b2_1); - - src_ptr+=src_stride; - - // save 16 bytes - _mm_store_si128((__m128i*)output_ptr, - _mm256_castsi256_si128(srcRegFilt32b1_1)); - - // save the next 16 bits - _mm_store_si128((__m128i*)(output_ptr+output_pitch), - _mm256_extractf128_si256(srcRegFilt32b1_1, 1)); - output_ptr+=dst_stride; - } - - // if the number of strides is odd. - // process only 16 bytes - if (i > 0) { - __m128i srcReg1, srcReg2, srcRegFilt1_1, srcRegFilt2_1; - __m128i srcRegFilt2, srcRegFilt3; - - srcReg1 = _mm_loadu_si128((__m128i *)(src_ptr-3)); - - // filter the source buffer - srcRegFilt1_1 = _mm_shuffle_epi8(srcReg1, - _mm256_castsi256_si128(filt1Reg)); - srcRegFilt2 = _mm_shuffle_epi8(srcReg1, - _mm256_castsi256_si128(filt4Reg)); - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt1_1 = _mm_maddubs_epi16(srcRegFilt1_1, - _mm256_castsi256_si128(firstFilters)); - srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2, - _mm256_castsi256_si128(forthFilters)); - - // add and saturate the results together - srcRegFilt1_1 = _mm_adds_epi16(srcRegFilt1_1, srcRegFilt2); - - // filter the source buffer - srcRegFilt3= _mm_shuffle_epi8(srcReg1, - _mm256_castsi256_si128(filt2Reg)); - srcRegFilt2= _mm_shuffle_epi8(srcReg1, - _mm256_castsi256_si128(filt3Reg)); - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt3 = _mm_maddubs_epi16(srcRegFilt3, - _mm256_castsi256_si128(secondFilters)); - srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2, - _mm256_castsi256_si128(thirdFilters)); - - // add and saturate the results together - srcRegFilt1_1 = _mm_adds_epi16(srcRegFilt1_1, - _mm_min_epi16(srcRegFilt3, srcRegFilt2)); - - // reading the next 16 bytes - // (part of it was being read by earlier read) - srcReg2 = _mm_loadu_si128((__m128i *)(src_ptr+5)); - - // add and saturate the results together - srcRegFilt1_1 = _mm_adds_epi16(srcRegFilt1_1, - _mm_max_epi16(srcRegFilt3, srcRegFilt2)); - - // filter the source buffer - srcRegFilt2_1 = _mm_shuffle_epi8(srcReg2, - _mm256_castsi256_si128(filt1Reg)); - srcRegFilt2 = _mm_shuffle_epi8(srcReg2, - _mm256_castsi256_si128(filt4Reg)); - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt2_1 = _mm_maddubs_epi16(srcRegFilt2_1, - _mm256_castsi256_si128(firstFilters)); - srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2, - _mm256_castsi256_si128(forthFilters)); - - // add and saturate the results together - srcRegFilt2_1 = _mm_adds_epi16(srcRegFilt2_1, srcRegFilt2); - - // filter the source buffer - srcRegFilt3 = _mm_shuffle_epi8(srcReg2, - _mm256_castsi256_si128(filt2Reg)); - srcRegFilt2 = _mm_shuffle_epi8(srcReg2, - _mm256_castsi256_si128(filt3Reg)); - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt3 = _mm_maddubs_epi16(srcRegFilt3, - _mm256_castsi256_si128(secondFilters)); - srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2, - _mm256_castsi256_si128(thirdFilters)); - - // add and saturate the results together - srcRegFilt2_1 = _mm_adds_epi16(srcRegFilt2_1, - _mm_min_epi16(srcRegFilt3, srcRegFilt2)); - srcRegFilt2_1 = _mm_adds_epi16(srcRegFilt2_1, - _mm_max_epi16(srcRegFilt3, srcRegFilt2)); - - - srcRegFilt1_1 = _mm_adds_epi16(srcRegFilt1_1, - _mm256_castsi256_si128(addFilterReg64)); - - srcRegFilt2_1 = _mm_adds_epi16(srcRegFilt2_1, - _mm256_castsi256_si128(addFilterReg64)); - - // shift by 7 bit each 16 bit - srcRegFilt1_1 = _mm_srai_epi16(srcRegFilt1_1, 7); - srcRegFilt2_1 = _mm_srai_epi16(srcRegFilt2_1, 7); - - // shrink to 8 bit each 16 bits, the first lane contain the first - // convolve result and the second lane contain the second convolve - // result - srcRegFilt1_1 = _mm_packus_epi16(srcRegFilt1_1, srcRegFilt2_1); - - // save 16 bytes - _mm_store_si128((__m128i*)output_ptr, srcRegFilt1_1); - } -} - -void vp9_filter_block1d16_v8_avx2(unsigned char *src_ptr, - unsigned int src_pitch, - unsigned char *output_ptr, - unsigned int out_pitch, - unsigned int output_height, - int16_t *filter) { - __m128i filtersReg; - __m256i addFilterReg64; - __m256i srcReg32b1, srcReg32b2, srcReg32b3, srcReg32b4, srcReg32b5; - __m256i srcReg32b6, srcReg32b7, srcReg32b8, srcReg32b9, srcReg32b10; - __m256i srcReg32b11, srcReg32b12, filtersReg32; - __m256i firstFilters, secondFilters, thirdFilters, forthFilters; - unsigned int i; - unsigned int src_stride, dst_stride; - - // create a register with 0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64 - addFilterReg64 = _mm256_set1_epi32((int)0x0400040u); - filtersReg = _mm_loadu_si128((__m128i *)filter); - // converting the 16 bit (short) to 8 bit (byte) and have the - // same data in both lanes of 128 bit register. - filtersReg =_mm_packs_epi16(filtersReg, filtersReg); - // have the same data in both lanes of a 256 bit register - filtersReg32 = MM256_BROADCASTSI128_SI256(filtersReg); - - // duplicate only the first 16 bits (first and second byte) - // across 256 bit register - firstFilters = _mm256_shuffle_epi8(filtersReg32, - _mm256_set1_epi16(0x100u)); - // duplicate only the second 16 bits (third and forth byte) - // across 256 bit register - secondFilters = _mm256_shuffle_epi8(filtersReg32, - _mm256_set1_epi16(0x302u)); - // duplicate only the third 16 bits (fifth and sixth byte) - // across 256 bit register - thirdFilters = _mm256_shuffle_epi8(filtersReg32, - _mm256_set1_epi16(0x504u)); - // duplicate only the forth 16 bits (seventh and eighth byte) - // across 256 bit register - forthFilters = _mm256_shuffle_epi8(filtersReg32, - _mm256_set1_epi16(0x706u)); - - // multiple the size of the source and destination stride by two - src_stride = src_pitch << 1; - dst_stride = out_pitch << 1; - - // load 16 bytes 7 times in stride of src_pitch - srcReg32b1 = _mm256_castsi128_si256( - _mm_loadu_si128((__m128i *)(src_ptr))); - srcReg32b2 = _mm256_castsi128_si256( - _mm_loadu_si128((__m128i *)(src_ptr+src_pitch))); - srcReg32b3 = _mm256_castsi128_si256( - _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*2))); - srcReg32b4 = _mm256_castsi128_si256( - _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*3))); - srcReg32b5 = _mm256_castsi128_si256( - _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*4))); - srcReg32b6 = _mm256_castsi128_si256( - _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*5))); - srcReg32b7 = _mm256_castsi128_si256( - _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*6))); - - // have each consecutive loads on the same 256 register - srcReg32b1 = _mm256_inserti128_si256(srcReg32b1, - _mm256_castsi256_si128(srcReg32b2), 1); - srcReg32b2 = _mm256_inserti128_si256(srcReg32b2, - _mm256_castsi256_si128(srcReg32b3), 1); - srcReg32b3 = _mm256_inserti128_si256(srcReg32b3, - _mm256_castsi256_si128(srcReg32b4), 1); - srcReg32b4 = _mm256_inserti128_si256(srcReg32b4, - _mm256_castsi256_si128(srcReg32b5), 1); - srcReg32b5 = _mm256_inserti128_si256(srcReg32b5, - _mm256_castsi256_si128(srcReg32b6), 1); - srcReg32b6 = _mm256_inserti128_si256(srcReg32b6, - _mm256_castsi256_si128(srcReg32b7), 1); - - // merge every two consecutive registers except the last one - srcReg32b10 = _mm256_unpacklo_epi8(srcReg32b1, srcReg32b2); - srcReg32b1 = _mm256_unpackhi_epi8(srcReg32b1, srcReg32b2); - - // save - srcReg32b11 = _mm256_unpacklo_epi8(srcReg32b3, srcReg32b4); - - // save - srcReg32b3 = _mm256_unpackhi_epi8(srcReg32b3, srcReg32b4); - - // save - srcReg32b2 = _mm256_unpacklo_epi8(srcReg32b5, srcReg32b6); - - // save - srcReg32b5 = _mm256_unpackhi_epi8(srcReg32b5, srcReg32b6); - - - for (i = output_height; i > 1; i-=2) { - // load the last 2 loads of 16 bytes and have every two - // consecutive loads in the same 256 bit register - srcReg32b8 = _mm256_castsi128_si256( - _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*7))); - srcReg32b7 = _mm256_inserti128_si256(srcReg32b7, - _mm256_castsi256_si128(srcReg32b8), 1); - srcReg32b9 = _mm256_castsi128_si256( - _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*8))); - srcReg32b8 = _mm256_inserti128_si256(srcReg32b8, - _mm256_castsi256_si128(srcReg32b9), 1); - - // merge every two consecutive registers - // save - srcReg32b4 = _mm256_unpacklo_epi8(srcReg32b7, srcReg32b8); - srcReg32b7 = _mm256_unpackhi_epi8(srcReg32b7, srcReg32b8); - - // multiply 2 adjacent elements with the filter and add the result - srcReg32b10 = _mm256_maddubs_epi16(srcReg32b10, firstFilters); - srcReg32b6 = _mm256_maddubs_epi16(srcReg32b4, forthFilters); - - // add and saturate the results together - srcReg32b10 = _mm256_adds_epi16(srcReg32b10, srcReg32b6); - - // multiply 2 adjacent elements with the filter and add the result - srcReg32b8 = _mm256_maddubs_epi16(srcReg32b11, secondFilters); - srcReg32b12 = _mm256_maddubs_epi16(srcReg32b2, thirdFilters); - - // add and saturate the results together - srcReg32b10 = _mm256_adds_epi16(srcReg32b10, - _mm256_min_epi16(srcReg32b8, srcReg32b12)); - srcReg32b10 = _mm256_adds_epi16(srcReg32b10, - _mm256_max_epi16(srcReg32b8, srcReg32b12)); - - // multiply 2 adjacent elements with the filter and add the result - srcReg32b1 = _mm256_maddubs_epi16(srcReg32b1, firstFilters); - srcReg32b6 = _mm256_maddubs_epi16(srcReg32b7, forthFilters); - - srcReg32b1 = _mm256_adds_epi16(srcReg32b1, srcReg32b6); - - // multiply 2 adjacent elements with the filter and add the result - srcReg32b8 = _mm256_maddubs_epi16(srcReg32b3, secondFilters); - srcReg32b12 = _mm256_maddubs_epi16(srcReg32b5, thirdFilters); - - // add and saturate the results together - srcReg32b1 = _mm256_adds_epi16(srcReg32b1, - _mm256_min_epi16(srcReg32b8, srcReg32b12)); - srcReg32b1 = _mm256_adds_epi16(srcReg32b1, - _mm256_max_epi16(srcReg32b8, srcReg32b12)); - - srcReg32b10 = _mm256_adds_epi16(srcReg32b10, addFilterReg64); - srcReg32b1 = _mm256_adds_epi16(srcReg32b1, addFilterReg64); - - // shift by 7 bit each 16 bit - srcReg32b10 = _mm256_srai_epi16(srcReg32b10, 7); - srcReg32b1 = _mm256_srai_epi16(srcReg32b1, 7); - - // shrink to 8 bit each 16 bits, the first lane contain the first - // convolve result and the second lane contain the second convolve - // result - srcReg32b1 = _mm256_packus_epi16(srcReg32b10, srcReg32b1); - - src_ptr+=src_stride; - - // save 16 bytes - _mm_store_si128((__m128i*)output_ptr, - _mm256_castsi256_si128(srcReg32b1)); - - // save the next 16 bits - _mm_store_si128((__m128i*)(output_ptr+out_pitch), - _mm256_extractf128_si256(srcReg32b1, 1)); - - output_ptr+=dst_stride; - - // save part of the registers for next strides - srcReg32b10 = srcReg32b11; - srcReg32b1 = srcReg32b3; - srcReg32b11 = srcReg32b2; - srcReg32b3 = srcReg32b5; - srcReg32b2 = srcReg32b4; - srcReg32b5 = srcReg32b7; - srcReg32b7 = srcReg32b9; - } - if (i > 0) { - __m128i srcRegFilt1, srcRegFilt3, srcRegFilt4, srcRegFilt5; - __m128i srcRegFilt6, srcRegFilt7, srcRegFilt8; - // load the last 16 bytes - srcRegFilt8 = _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*7)); - - // merge the last 2 results together - srcRegFilt4 = _mm_unpacklo_epi8( - _mm256_castsi256_si128(srcReg32b7), srcRegFilt8); - srcRegFilt7 = _mm_unpackhi_epi8( - _mm256_castsi256_si128(srcReg32b7), srcRegFilt8); - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt1 = _mm_maddubs_epi16(_mm256_castsi256_si128(srcReg32b10), - _mm256_castsi256_si128(firstFilters)); - srcRegFilt4 = _mm_maddubs_epi16(srcRegFilt4, - _mm256_castsi256_si128(forthFilters)); - srcRegFilt3 = _mm_maddubs_epi16(_mm256_castsi256_si128(srcReg32b1), - _mm256_castsi256_si128(firstFilters)); - srcRegFilt7 = _mm_maddubs_epi16(srcRegFilt7, - _mm256_castsi256_si128(forthFilters)); - - // add and saturate the results together - srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, srcRegFilt4); - srcRegFilt3 = _mm_adds_epi16(srcRegFilt3, srcRegFilt7); - - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt4 = _mm_maddubs_epi16(_mm256_castsi256_si128(srcReg32b11), - _mm256_castsi256_si128(secondFilters)); - srcRegFilt5 = _mm_maddubs_epi16(_mm256_castsi256_si128(srcReg32b3), - _mm256_castsi256_si128(secondFilters)); - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt6 = _mm_maddubs_epi16(_mm256_castsi256_si128(srcReg32b2), - _mm256_castsi256_si128(thirdFilters)); - srcRegFilt7 = _mm_maddubs_epi16(_mm256_castsi256_si128(srcReg32b5), - _mm256_castsi256_si128(thirdFilters)); - - // add and saturate the results together - srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, - _mm_min_epi16(srcRegFilt4, srcRegFilt6)); - srcRegFilt3 = _mm_adds_epi16(srcRegFilt3, - _mm_min_epi16(srcRegFilt5, srcRegFilt7)); - - // add and saturate the results together - srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, - _mm_max_epi16(srcRegFilt4, srcRegFilt6)); - srcRegFilt3 = _mm_adds_epi16(srcRegFilt3, - _mm_max_epi16(srcRegFilt5, srcRegFilt7)); - - - srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, - _mm256_castsi256_si128(addFilterReg64)); - srcRegFilt3 = _mm_adds_epi16(srcRegFilt3, - _mm256_castsi256_si128(addFilterReg64)); - - // shift by 7 bit each 16 bit - srcRegFilt1 = _mm_srai_epi16(srcRegFilt1, 7); - srcRegFilt3 = _mm_srai_epi16(srcRegFilt3, 7); - - // shrink to 8 bit each 16 bits, the first lane contain the first - // convolve result and the second lane contain the second convolve - // result - srcRegFilt1 = _mm_packus_epi16(srcRegFilt1, srcRegFilt3); - - // save 16 bytes - _mm_store_si128((__m128i*)output_ptr, srcRegFilt1); - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_subpixel_8t_intrin_ssse3.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_subpixel_8t_intrin_ssse3.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/common/x86/vp9_subpixel_8t_intrin_ssse3.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/common/x86/vp9_subpixel_8t_intrin_ssse3.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,510 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "vpx_ports/mem.h" -#include "vpx_ports/emmintrin_compat.h" - -// filters only for the 4_h8 convolution -DECLARE_ALIGNED(16, static const uint8_t, filt1_4_h8[16]) = { - 0, 1, 1, 2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 5, 5, 6 -}; - -DECLARE_ALIGNED(16, static const uint8_t, filt2_4_h8[16]) = { - 4, 5, 5, 6, 6, 7, 7, 8, 6, 7, 7, 8, 8, 9, 9, 10 -}; - -// filters for 8_h8 and 16_h8 -DECLARE_ALIGNED(16, static const uint8_t, filt1_global[16]) = { - 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 -}; - -DECLARE_ALIGNED(16, static const uint8_t, filt2_global[16]) = { - 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10 -}; - -DECLARE_ALIGNED(16, static const uint8_t, filt3_global[16]) = { - 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12 -}; - -DECLARE_ALIGNED(16, static const uint8_t, filt4_global[16]) = { - 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14 -}; - -void vp9_filter_block1d4_h8_intrin_ssse3(unsigned char *src_ptr, - unsigned int src_pixels_per_line, - unsigned char *output_ptr, - unsigned int output_pitch, - unsigned int output_height, - int16_t *filter) { - __m128i firstFilters, secondFilters, shuffle1, shuffle2; - __m128i srcRegFilt1, srcRegFilt2, srcRegFilt3, srcRegFilt4; - __m128i addFilterReg64, filtersReg, srcReg, minReg; - unsigned int i; - - // create a register with 0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64 - addFilterReg64 =_mm_set1_epi32((int)0x0400040u); - filtersReg = _mm_loadu_si128((__m128i *)filter); - // converting the 16 bit (short) to 8 bit (byte) and have the same data - // in both lanes of 128 bit register. - filtersReg =_mm_packs_epi16(filtersReg, filtersReg); - - // duplicate only the first 16 bits in the filter into the first lane - firstFilters = _mm_shufflelo_epi16(filtersReg, 0); - // duplicate only the third 16 bit in the filter into the first lane - secondFilters = _mm_shufflelo_epi16(filtersReg, 0xAAu); - // duplicate only the seconds 16 bits in the filter into the second lane - // firstFilters: k0 k1 k0 k1 k0 k1 k0 k1 k2 k3 k2 k3 k2 k3 k2 k3 - firstFilters = _mm_shufflehi_epi16(firstFilters, 0x55u); - // duplicate only the forth 16 bits in the filter into the second lane - // secondFilters: k4 k5 k4 k5 k4 k5 k4 k5 k6 k7 k6 k7 k6 k7 k6 k7 - secondFilters = _mm_shufflehi_epi16(secondFilters, 0xFFu); - - // loading the local filters - shuffle1 =_mm_load_si128((__m128i const *)filt1_4_h8); - shuffle2 = _mm_load_si128((__m128i const *)filt2_4_h8); - - for (i = 0; i < output_height; i++) { - srcReg = _mm_loadu_si128((__m128i *)(src_ptr-3)); - - // filter the source buffer - srcRegFilt1= _mm_shuffle_epi8(srcReg, shuffle1); - srcRegFilt2= _mm_shuffle_epi8(srcReg, shuffle2); - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt1 = _mm_maddubs_epi16(srcRegFilt1, firstFilters); - srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2, secondFilters); - - // extract the higher half of the lane - srcRegFilt3 = _mm_srli_si128(srcRegFilt1, 8); - srcRegFilt4 = _mm_srli_si128(srcRegFilt2, 8); - - minReg = _mm_min_epi16(srcRegFilt3, srcRegFilt2); - - // add and saturate all the results together - srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, srcRegFilt4); - srcRegFilt3 = _mm_max_epi16(srcRegFilt3, srcRegFilt2); - srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, minReg); - srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, srcRegFilt3); - srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, addFilterReg64); - - // shift by 7 bit each 16 bits - srcRegFilt1 = _mm_srai_epi16(srcRegFilt1, 7); - - // shrink to 8 bit each 16 bits - srcRegFilt1 = _mm_packus_epi16(srcRegFilt1, srcRegFilt1); - src_ptr+=src_pixels_per_line; - - // save only 4 bytes - *((int*)&output_ptr[0])= _mm_cvtsi128_si32(srcRegFilt1); - - output_ptr+=output_pitch; - } -} - -void vp9_filter_block1d8_h8_intrin_ssse3(unsigned char *src_ptr, - unsigned int src_pixels_per_line, - unsigned char *output_ptr, - unsigned int output_pitch, - unsigned int output_height, - int16_t *filter) { - __m128i firstFilters, secondFilters, thirdFilters, forthFilters, srcReg; - __m128i filt1Reg, filt2Reg, filt3Reg, filt4Reg; - __m128i srcRegFilt1, srcRegFilt2, srcRegFilt3, srcRegFilt4; - __m128i addFilterReg64, filtersReg, minReg; - unsigned int i; - - // create a register with 0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64 - addFilterReg64 = _mm_set1_epi32((int)0x0400040u); - filtersReg = _mm_loadu_si128((__m128i *)filter); - // converting the 16 bit (short) to 8 bit (byte) and have the same data - // in both lanes of 128 bit register. - filtersReg =_mm_packs_epi16(filtersReg, filtersReg); - - // duplicate only the first 16 bits (first and second byte) - // across 128 bit register - firstFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x100u)); - // duplicate only the second 16 bits (third and forth byte) - // across 128 bit register - secondFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x302u)); - // duplicate only the third 16 bits (fifth and sixth byte) - // across 128 bit register - thirdFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x504u)); - // duplicate only the forth 16 bits (seventh and eighth byte) - // across 128 bit register - forthFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x706u)); - - filt1Reg = _mm_load_si128((__m128i const *)filt1_global); - filt2Reg = _mm_load_si128((__m128i const *)filt2_global); - filt3Reg = _mm_load_si128((__m128i const *)filt3_global); - filt4Reg = _mm_load_si128((__m128i const *)filt4_global); - - for (i = 0; i < output_height; i++) { - srcReg = _mm_loadu_si128((__m128i *)(src_ptr-3)); - - // filter the source buffer - srcRegFilt1= _mm_shuffle_epi8(srcReg, filt1Reg); - srcRegFilt2= _mm_shuffle_epi8(srcReg, filt2Reg); - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt1 = _mm_maddubs_epi16(srcRegFilt1, firstFilters); - srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2, secondFilters); - - // filter the source buffer - srcRegFilt3= _mm_shuffle_epi8(srcReg, filt3Reg); - srcRegFilt4= _mm_shuffle_epi8(srcReg, filt4Reg); - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt3 = _mm_maddubs_epi16(srcRegFilt3, thirdFilters); - srcRegFilt4 = _mm_maddubs_epi16(srcRegFilt4, forthFilters); - - // add and saturate all the results together - minReg = _mm_min_epi16(srcRegFilt2, srcRegFilt3); - srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, srcRegFilt4); - - srcRegFilt2= _mm_max_epi16(srcRegFilt2, srcRegFilt3); - srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, minReg); - srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, srcRegFilt2); - srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, addFilterReg64); - - // shift by 7 bit each 16 bits - srcRegFilt1 = _mm_srai_epi16(srcRegFilt1, 7); - - // shrink to 8 bit each 16 bits - srcRegFilt1 = _mm_packus_epi16(srcRegFilt1, srcRegFilt1); - - src_ptr+=src_pixels_per_line; - - // save only 8 bytes - _mm_storel_epi64((__m128i*)&output_ptr[0], srcRegFilt1); - - output_ptr+=output_pitch; - } -} - -void vp9_filter_block1d16_h8_intrin_ssse3(unsigned char *src_ptr, - unsigned int src_pixels_per_line, - unsigned char *output_ptr, - unsigned int output_pitch, - unsigned int output_height, - int16_t *filter) { - __m128i addFilterReg64, filtersReg, srcReg1, srcReg2; - __m128i filt1Reg, filt2Reg, filt3Reg, filt4Reg; - __m128i firstFilters, secondFilters, thirdFilters, forthFilters; - __m128i srcRegFilt1_1, srcRegFilt2_1, srcRegFilt2, srcRegFilt3; - unsigned int i; - - // create a register with 0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64 - addFilterReg64 = _mm_set1_epi32((int)0x0400040u); - filtersReg = _mm_loadu_si128((__m128i *)filter); - // converting the 16 bit (short) to 8 bit (byte) and have the same data - // in both lanes of 128 bit register. - filtersReg =_mm_packs_epi16(filtersReg, filtersReg); - - // duplicate only the first 16 bits (first and second byte) - // across 128 bit register - firstFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x100u)); - // duplicate only the second 16 bits (third and forth byte) - // across 128 bit register - secondFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x302u)); - // duplicate only the third 16 bits (fifth and sixth byte) - // across 128 bit register - thirdFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x504u)); - // duplicate only the forth 16 bits (seventh and eighth byte) - // across 128 bit register - forthFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x706u)); - - filt1Reg = _mm_load_si128((__m128i const *)filt1_global); - filt2Reg = _mm_load_si128((__m128i const *)filt2_global); - filt3Reg = _mm_load_si128((__m128i const *)filt3_global); - filt4Reg = _mm_load_si128((__m128i const *)filt4_global); - - for (i = 0; i < output_height; i++) { - srcReg1 = _mm_loadu_si128((__m128i *)(src_ptr-3)); - - // filter the source buffer - srcRegFilt1_1= _mm_shuffle_epi8(srcReg1, filt1Reg); - srcRegFilt2= _mm_shuffle_epi8(srcReg1, filt4Reg); - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt1_1 = _mm_maddubs_epi16(srcRegFilt1_1, firstFilters); - srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2, forthFilters); - - // add and saturate the results together - srcRegFilt1_1 = _mm_adds_epi16(srcRegFilt1_1, srcRegFilt2); - - // filter the source buffer - srcRegFilt3= _mm_shuffle_epi8(srcReg1, filt2Reg); - srcRegFilt2= _mm_shuffle_epi8(srcReg1, filt3Reg); - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt3 = _mm_maddubs_epi16(srcRegFilt3, secondFilters); - srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2, thirdFilters); - - // add and saturate the results together - srcRegFilt1_1 = _mm_adds_epi16(srcRegFilt1_1, - _mm_min_epi16(srcRegFilt3, srcRegFilt2)); - - // reading the next 16 bytes. - // (part of it was being read by earlier read) - srcReg2 = _mm_loadu_si128((__m128i *)(src_ptr+5)); - - // add and saturate the results together - srcRegFilt1_1 = _mm_adds_epi16(srcRegFilt1_1, - _mm_max_epi16(srcRegFilt3, srcRegFilt2)); - - // filter the source buffer - srcRegFilt2_1= _mm_shuffle_epi8(srcReg2, filt1Reg); - srcRegFilt2= _mm_shuffle_epi8(srcReg2, filt4Reg); - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt2_1 = _mm_maddubs_epi16(srcRegFilt2_1, firstFilters); - srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2, forthFilters); - - // add and saturate the results together - srcRegFilt2_1 = _mm_adds_epi16(srcRegFilt2_1, srcRegFilt2); - - // filter the source buffer - srcRegFilt3= _mm_shuffle_epi8(srcReg2, filt2Reg); - srcRegFilt2= _mm_shuffle_epi8(srcReg2, filt3Reg); - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt3 = _mm_maddubs_epi16(srcRegFilt3, secondFilters); - srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2, thirdFilters); - - // add and saturate the results together - srcRegFilt2_1 = _mm_adds_epi16(srcRegFilt2_1, - _mm_min_epi16(srcRegFilt3, srcRegFilt2)); - srcRegFilt2_1 = _mm_adds_epi16(srcRegFilt2_1, - _mm_max_epi16(srcRegFilt3, srcRegFilt2)); - - srcRegFilt1_1 = _mm_adds_epi16(srcRegFilt1_1, addFilterReg64); - srcRegFilt2_1 = _mm_adds_epi16(srcRegFilt2_1, addFilterReg64); - - // shift by 7 bit each 16 bit - srcRegFilt1_1 = _mm_srai_epi16(srcRegFilt1_1, 7); - srcRegFilt2_1 = _mm_srai_epi16(srcRegFilt2_1, 7); - - // shrink to 8 bit each 16 bits, the first lane contain the first - // convolve result and the second lane contain the second convolve - // result - srcRegFilt1_1 = _mm_packus_epi16(srcRegFilt1_1, srcRegFilt2_1); - - src_ptr+=src_pixels_per_line; - - // save 16 bytes - _mm_store_si128((__m128i*)output_ptr, srcRegFilt1_1); - - output_ptr+=output_pitch; - } -} - -void vp9_filter_block1d8_v8_intrin_ssse3(unsigned char *src_ptr, - unsigned int src_pitch, - unsigned char *output_ptr, - unsigned int out_pitch, - unsigned int output_height, - int16_t *filter) { - __m128i addFilterReg64, filtersReg, minReg; - __m128i firstFilters, secondFilters, thirdFilters, forthFilters; - __m128i srcRegFilt1, srcRegFilt2, srcRegFilt3, srcRegFilt5; - __m128i srcReg1, srcReg2, srcReg3, srcReg4, srcReg5, srcReg6, srcReg7; - __m128i srcReg8; - unsigned int i; - - // create a register with 0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64 - addFilterReg64 = _mm_set1_epi32((int)0x0400040u); - filtersReg = _mm_loadu_si128((__m128i *)filter); - // converting the 16 bit (short) to 8 bit (byte) and have the same data - // in both lanes of 128 bit register. - filtersReg =_mm_packs_epi16(filtersReg, filtersReg); - - // duplicate only the first 16 bits in the filter - firstFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x100u)); - // duplicate only the second 16 bits in the filter - secondFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x302u)); - // duplicate only the third 16 bits in the filter - thirdFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x504u)); - // duplicate only the forth 16 bits in the filter - forthFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x706u)); - - // load the first 7 rows of 8 bytes - srcReg1 = _mm_loadl_epi64((__m128i *)&src_ptr[0]); - srcReg2 = _mm_loadl_epi64((__m128i *)&(src_ptr + src_pitch)[0]); - srcReg3 = _mm_loadl_epi64((__m128i *)&(src_ptr + src_pitch * 2)[0]); - srcReg4 = _mm_loadl_epi64((__m128i *)&(src_ptr + src_pitch * 3)[0]); - srcReg5 = _mm_loadl_epi64((__m128i *)&(src_ptr + src_pitch * 4)[0]); - srcReg6 = _mm_loadl_epi64((__m128i *)&(src_ptr + src_pitch * 5)[0]); - srcReg7 = _mm_loadl_epi64((__m128i *)&(src_ptr + src_pitch * 6)[0]); - - for (i = 0; i < output_height; i++) { - // load the last 8 bytes - srcReg8 = _mm_loadl_epi64((__m128i *)&(src_ptr + src_pitch * 7)[0]); - - // merge the result together - srcRegFilt1 = _mm_unpacklo_epi8(srcReg1, srcReg2); - srcRegFilt3 = _mm_unpacklo_epi8(srcReg3, srcReg4); - - // merge the result together - srcRegFilt2 = _mm_unpacklo_epi8(srcReg5, srcReg6); - srcRegFilt5 = _mm_unpacklo_epi8(srcReg7, srcReg8); - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt1 = _mm_maddubs_epi16(srcRegFilt1, firstFilters); - srcRegFilt3 = _mm_maddubs_epi16(srcRegFilt3, secondFilters); - srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2, thirdFilters); - srcRegFilt5 = _mm_maddubs_epi16(srcRegFilt5, forthFilters); - - // add and saturate the results together - minReg = _mm_min_epi16(srcRegFilt2, srcRegFilt3); - srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, srcRegFilt5); - srcRegFilt2 = _mm_max_epi16(srcRegFilt2, srcRegFilt3); - srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, minReg); - srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, srcRegFilt2); - srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, addFilterReg64); - - // shift by 7 bit each 16 bit - srcRegFilt1 = _mm_srai_epi16(srcRegFilt1, 7); - - // shrink to 8 bit each 16 bits - srcRegFilt1 = _mm_packus_epi16(srcRegFilt1, srcRegFilt1); - - src_ptr+=src_pitch; - - // shift down a row - srcReg1 = srcReg2; - srcReg2 = srcReg3; - srcReg3 = srcReg4; - srcReg4 = srcReg5; - srcReg5 = srcReg6; - srcReg6 = srcReg7; - srcReg7 = srcReg8; - - // save only 8 bytes convolve result - _mm_storel_epi64((__m128i*)&output_ptr[0], srcRegFilt1); - - output_ptr+=out_pitch; - } -} - -void vp9_filter_block1d16_v8_intrin_ssse3(unsigned char *src_ptr, - unsigned int src_pitch, - unsigned char *output_ptr, - unsigned int out_pitch, - unsigned int output_height, - int16_t *filter) { - __m128i addFilterReg64, filtersReg, srcRegFilt1, srcRegFilt3; - __m128i firstFilters, secondFilters, thirdFilters, forthFilters; - __m128i srcRegFilt5, srcRegFilt6, srcRegFilt7, srcRegFilt8; - __m128i srcReg1, srcReg2, srcReg3, srcReg4, srcReg5, srcReg6, srcReg7; - __m128i srcReg8; - unsigned int i; - - // create a register with 0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64 - addFilterReg64 = _mm_set1_epi32((int)0x0400040u); - filtersReg = _mm_loadu_si128((__m128i *)filter); - // converting the 16 bit (short) to 8 bit (byte) and have the same data - // in both lanes of 128 bit register. - filtersReg =_mm_packs_epi16(filtersReg, filtersReg); - - // duplicate only the first 16 bits in the filter - firstFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x100u)); - // duplicate only the second 16 bits in the filter - secondFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x302u)); - // duplicate only the third 16 bits in the filter - thirdFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x504u)); - // duplicate only the forth 16 bits in the filter - forthFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x706u)); - - // load the first 7 rows of 16 bytes - srcReg1 = _mm_loadu_si128((__m128i *)(src_ptr)); - srcReg2 = _mm_loadu_si128((__m128i *)(src_ptr + src_pitch)); - srcReg3 = _mm_loadu_si128((__m128i *)(src_ptr + src_pitch * 2)); - srcReg4 = _mm_loadu_si128((__m128i *)(src_ptr + src_pitch * 3)); - srcReg5 = _mm_loadu_si128((__m128i *)(src_ptr + src_pitch * 4)); - srcReg6 = _mm_loadu_si128((__m128i *)(src_ptr + src_pitch * 5)); - srcReg7 = _mm_loadu_si128((__m128i *)(src_ptr + src_pitch * 6)); - - for (i = 0; i < output_height; i++) { - // load the last 16 bytes - srcReg8 = _mm_loadu_si128((__m128i *)(src_ptr + src_pitch * 7)); - - // merge the result together - srcRegFilt5 = _mm_unpacklo_epi8(srcReg1, srcReg2); - srcRegFilt6 = _mm_unpacklo_epi8(srcReg7, srcReg8); - srcRegFilt1 = _mm_unpackhi_epi8(srcReg1, srcReg2); - srcRegFilt3 = _mm_unpackhi_epi8(srcReg7, srcReg8); - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt5 = _mm_maddubs_epi16(srcRegFilt5, firstFilters); - srcRegFilt6 = _mm_maddubs_epi16(srcRegFilt6, forthFilters); - srcRegFilt1 = _mm_maddubs_epi16(srcRegFilt1, firstFilters); - srcRegFilt3 = _mm_maddubs_epi16(srcRegFilt3, forthFilters); - - // add and saturate the results together - srcRegFilt5 = _mm_adds_epi16(srcRegFilt5, srcRegFilt6); - srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, srcRegFilt3); - - // merge the result together - srcRegFilt3 = _mm_unpacklo_epi8(srcReg3, srcReg4); - srcRegFilt6 = _mm_unpackhi_epi8(srcReg3, srcReg4); - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt3 = _mm_maddubs_epi16(srcRegFilt3, secondFilters); - srcRegFilt6 = _mm_maddubs_epi16(srcRegFilt6, secondFilters); - - // merge the result together - srcRegFilt7 = _mm_unpacklo_epi8(srcReg5, srcReg6); - srcRegFilt8 = _mm_unpackhi_epi8(srcReg5, srcReg6); - - // multiply 2 adjacent elements with the filter and add the result - srcRegFilt7 = _mm_maddubs_epi16(srcRegFilt7, thirdFilters); - srcRegFilt8 = _mm_maddubs_epi16(srcRegFilt8, thirdFilters); - - // add and saturate the results together - srcRegFilt5 = _mm_adds_epi16(srcRegFilt5, - _mm_min_epi16(srcRegFilt3, srcRegFilt7)); - srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, - _mm_min_epi16(srcRegFilt6, srcRegFilt8)); - - // add and saturate the results together - srcRegFilt5 = _mm_adds_epi16(srcRegFilt5, - _mm_max_epi16(srcRegFilt3, srcRegFilt7)); - srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, - _mm_max_epi16(srcRegFilt6, srcRegFilt8)); - srcRegFilt5 = _mm_adds_epi16(srcRegFilt5, addFilterReg64); - srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, addFilterReg64); - - // shift by 7 bit each 16 bit - srcRegFilt5 = _mm_srai_epi16(srcRegFilt5, 7); - srcRegFilt1 = _mm_srai_epi16(srcRegFilt1, 7); - - // shrink to 8 bit each 16 bits, the first lane contain the first - // convolve result and the second lane contain the second convolve - // result - srcRegFilt1 = _mm_packus_epi16(srcRegFilt5, srcRegFilt1); - - src_ptr+=src_pitch; - - // shift down a row - srcReg1 = srcReg2; - srcReg2 = srcReg3; - srcReg3 = srcReg4; - srcReg4 = srcReg5; - srcReg5 = srcReg6; - srcReg6 = srcReg7; - srcReg7 = srcReg8; - - // save 16 bytes convolve result - _mm_store_si128((__m128i*)output_ptr, srcRegFilt1); - - output_ptr+=out_pitch; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_decodeframe.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_decodeframe.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_decodeframe.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_decodeframe.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2028 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include // qsort() - -#include "./vp9_rtcd.h" -#include "./vpx_scale_rtcd.h" - -#include "vpx_mem/vpx_mem.h" -#include "vpx_ports/mem_ops.h" -#include "vpx_scale/vpx_scale.h" - -#include "vp9/common/vp9_alloccommon.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_entropy.h" -#include "vp9/common/vp9_entropymode.h" -#include "vp9/common/vp9_idct.h" -#include "vp9/common/vp9_thread_common.h" -#include "vp9/common/vp9_pred_common.h" -#include "vp9/common/vp9_quant_common.h" -#include "vp9/common/vp9_reconintra.h" -#include "vp9/common/vp9_reconinter.h" -#include "vp9/common/vp9_seg_common.h" -#include "vp9/common/vp9_thread.h" -#include "vp9/common/vp9_tile_common.h" - -#include "vp9/decoder/vp9_decodeframe.h" -#include "vp9/decoder/vp9_detokenize.h" -#include "vp9/decoder/vp9_decodemv.h" -#include "vp9/decoder/vp9_decoder.h" -#include "vp9/decoder/vp9_dsubexp.h" -#include "vp9/decoder/vp9_read_bit_buffer.h" -#include "vp9/decoder/vp9_reader.h" - -#define MAX_VP9_HEADER_SIZE 80 - -static int is_compound_reference_allowed(const VP9_COMMON *cm) { - int i; - for (i = 1; i < REFS_PER_FRAME; ++i) - if (cm->ref_frame_sign_bias[i + 1] != cm->ref_frame_sign_bias[1]) - return 1; - - return 0; -} - -static void setup_compound_reference_mode(VP9_COMMON *cm) { - if (cm->ref_frame_sign_bias[LAST_FRAME] == - cm->ref_frame_sign_bias[GOLDEN_FRAME]) { - cm->comp_fixed_ref = ALTREF_FRAME; - cm->comp_var_ref[0] = LAST_FRAME; - cm->comp_var_ref[1] = GOLDEN_FRAME; - } else if (cm->ref_frame_sign_bias[LAST_FRAME] == - cm->ref_frame_sign_bias[ALTREF_FRAME]) { - cm->comp_fixed_ref = GOLDEN_FRAME; - cm->comp_var_ref[0] = LAST_FRAME; - cm->comp_var_ref[1] = ALTREF_FRAME; - } else { - cm->comp_fixed_ref = LAST_FRAME; - cm->comp_var_ref[0] = GOLDEN_FRAME; - cm->comp_var_ref[1] = ALTREF_FRAME; - } -} - -static int read_is_valid(const uint8_t *start, size_t len, const uint8_t *end) { - return len != 0 && len <= (size_t)(end - start); -} - -static int decode_unsigned_max(struct vp9_read_bit_buffer *rb, int max) { - const int data = vp9_rb_read_literal(rb, get_unsigned_bits(max)); - return data > max ? max : data; -} - -static TX_MODE read_tx_mode(vp9_reader *r) { - TX_MODE tx_mode = vp9_read_literal(r, 2); - if (tx_mode == ALLOW_32X32) - tx_mode += vp9_read_bit(r); - return tx_mode; -} - -static void read_tx_mode_probs(struct tx_probs *tx_probs, vp9_reader *r) { - int i, j; - - for (i = 0; i < TX_SIZE_CONTEXTS; ++i) - for (j = 0; j < TX_SIZES - 3; ++j) - vp9_diff_update_prob(r, &tx_probs->p8x8[i][j]); - - for (i = 0; i < TX_SIZE_CONTEXTS; ++i) - for (j = 0; j < TX_SIZES - 2; ++j) - vp9_diff_update_prob(r, &tx_probs->p16x16[i][j]); - - for (i = 0; i < TX_SIZE_CONTEXTS; ++i) - for (j = 0; j < TX_SIZES - 1; ++j) - vp9_diff_update_prob(r, &tx_probs->p32x32[i][j]); -} - -static void read_switchable_interp_probs(FRAME_CONTEXT *fc, vp9_reader *r) { - int i, j; - for (j = 0; j < SWITCHABLE_FILTER_CONTEXTS; ++j) - for (i = 0; i < SWITCHABLE_FILTERS - 1; ++i) - vp9_diff_update_prob(r, &fc->switchable_interp_prob[j][i]); -} - -static void read_inter_mode_probs(FRAME_CONTEXT *fc, vp9_reader *r) { - int i, j; - for (i = 0; i < INTER_MODE_CONTEXTS; ++i) - for (j = 0; j < INTER_MODES - 1; ++j) - vp9_diff_update_prob(r, &fc->inter_mode_probs[i][j]); -} - -static REFERENCE_MODE read_frame_reference_mode(const VP9_COMMON *cm, - vp9_reader *r) { - if (is_compound_reference_allowed(cm)) { - return vp9_read_bit(r) ? (vp9_read_bit(r) ? REFERENCE_MODE_SELECT - : COMPOUND_REFERENCE) - : SINGLE_REFERENCE; - } else { - return SINGLE_REFERENCE; - } -} - -static void read_frame_reference_mode_probs(VP9_COMMON *cm, vp9_reader *r) { - FRAME_CONTEXT *const fc = cm->fc; - int i; - - if (cm->reference_mode == REFERENCE_MODE_SELECT) - for (i = 0; i < COMP_INTER_CONTEXTS; ++i) - vp9_diff_update_prob(r, &fc->comp_inter_prob[i]); - - if (cm->reference_mode != COMPOUND_REFERENCE) - for (i = 0; i < REF_CONTEXTS; ++i) { - vp9_diff_update_prob(r, &fc->single_ref_prob[i][0]); - vp9_diff_update_prob(r, &fc->single_ref_prob[i][1]); - } - - if (cm->reference_mode != SINGLE_REFERENCE) - for (i = 0; i < REF_CONTEXTS; ++i) - vp9_diff_update_prob(r, &fc->comp_ref_prob[i]); -} - -static void update_mv_probs(vp9_prob *p, int n, vp9_reader *r) { - int i; - for (i = 0; i < n; ++i) - if (vp9_read(r, MV_UPDATE_PROB)) - p[i] = (vp9_read_literal(r, 7) << 1) | 1; -} - -static void read_mv_probs(nmv_context *ctx, int allow_hp, vp9_reader *r) { - int i, j; - - update_mv_probs(ctx->joints, MV_JOINTS - 1, r); - - for (i = 0; i < 2; ++i) { - nmv_component *const comp_ctx = &ctx->comps[i]; - update_mv_probs(&comp_ctx->sign, 1, r); - update_mv_probs(comp_ctx->classes, MV_CLASSES - 1, r); - update_mv_probs(comp_ctx->class0, CLASS0_SIZE - 1, r); - update_mv_probs(comp_ctx->bits, MV_OFFSET_BITS, r); - } - - for (i = 0; i < 2; ++i) { - nmv_component *const comp_ctx = &ctx->comps[i]; - for (j = 0; j < CLASS0_SIZE; ++j) - update_mv_probs(comp_ctx->class0_fp[j], MV_FP_SIZE - 1, r); - update_mv_probs(comp_ctx->fp, 3, r); - } - - if (allow_hp) { - for (i = 0; i < 2; ++i) { - nmv_component *const comp_ctx = &ctx->comps[i]; - update_mv_probs(&comp_ctx->class0_hp, 1, r); - update_mv_probs(&comp_ctx->hp, 1, r); - } - } -} - -static void inverse_transform_block(MACROBLOCKD* xd, int plane, int block, - TX_SIZE tx_size, uint8_t *dst, int stride, - int eob) { - struct macroblockd_plane *const pd = &xd->plane[plane]; - if (eob > 0) { - TX_TYPE tx_type = DCT_DCT; - tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - if (xd->lossless) { - tx_type = DCT_DCT; - vp9_highbd_iwht4x4_add(dqcoeff, dst, stride, eob, xd->bd); - } else { - const PLANE_TYPE plane_type = pd->plane_type; - switch (tx_size) { - case TX_4X4: - tx_type = get_tx_type_4x4(plane_type, xd, block); - vp9_highbd_iht4x4_add(tx_type, dqcoeff, dst, stride, eob, xd->bd); - break; - case TX_8X8: - tx_type = get_tx_type(plane_type, xd); - vp9_highbd_iht8x8_add(tx_type, dqcoeff, dst, stride, eob, xd->bd); - break; - case TX_16X16: - tx_type = get_tx_type(plane_type, xd); - vp9_highbd_iht16x16_add(tx_type, dqcoeff, dst, stride, eob, xd->bd); - break; - case TX_32X32: - tx_type = DCT_DCT; - vp9_highbd_idct32x32_add(dqcoeff, dst, stride, eob, xd->bd); - break; - default: - assert(0 && "Invalid transform size"); - } - } - } else { - if (xd->lossless) { - tx_type = DCT_DCT; - vp9_iwht4x4_add(dqcoeff, dst, stride, eob); - } else { - const PLANE_TYPE plane_type = pd->plane_type; - switch (tx_size) { - case TX_4X4: - tx_type = get_tx_type_4x4(plane_type, xd, block); - vp9_iht4x4_add(tx_type, dqcoeff, dst, stride, eob); - break; - case TX_8X8: - tx_type = get_tx_type(plane_type, xd); - vp9_iht8x8_add(tx_type, dqcoeff, dst, stride, eob); - break; - case TX_16X16: - tx_type = get_tx_type(plane_type, xd); - vp9_iht16x16_add(tx_type, dqcoeff, dst, stride, eob); - break; - case TX_32X32: - tx_type = DCT_DCT; - vp9_idct32x32_add(dqcoeff, dst, stride, eob); - break; - default: - assert(0 && "Invalid transform size"); - return; - } - } - } -#else - if (xd->lossless) { - tx_type = DCT_DCT; - vp9_iwht4x4_add(dqcoeff, dst, stride, eob); - } else { - const PLANE_TYPE plane_type = pd->plane_type; - switch (tx_size) { - case TX_4X4: - tx_type = get_tx_type_4x4(plane_type, xd, block); - vp9_iht4x4_add(tx_type, dqcoeff, dst, stride, eob); - break; - case TX_8X8: - tx_type = get_tx_type(plane_type, xd); - vp9_iht8x8_add(tx_type, dqcoeff, dst, stride, eob); - break; - case TX_16X16: - tx_type = get_tx_type(plane_type, xd); - vp9_iht16x16_add(tx_type, dqcoeff, dst, stride, eob); - break; - case TX_32X32: - tx_type = DCT_DCT; - vp9_idct32x32_add(dqcoeff, dst, stride, eob); - break; - default: - assert(0 && "Invalid transform size"); - return; - } - } -#endif // CONFIG_VP9_HIGHBITDEPTH - - if (eob == 1) { - vpx_memset(dqcoeff, 0, 2 * sizeof(dqcoeff[0])); - } else { - if (tx_type == DCT_DCT && tx_size <= TX_16X16 && eob <= 10) - vpx_memset(dqcoeff, 0, 4 * (4 << tx_size) * sizeof(dqcoeff[0])); - else if (tx_size == TX_32X32 && eob <= 34) - vpx_memset(dqcoeff, 0, 256 * sizeof(dqcoeff[0])); - else - vpx_memset(dqcoeff, 0, (16 << (tx_size << 1)) * sizeof(dqcoeff[0])); - } - } -} - -struct intra_args { - VP9_COMMON *cm; - MACROBLOCKD *xd; - FRAME_COUNTS *counts; - vp9_reader *r; - const int16_t *const y_dequant; - const int16_t *const uv_dequant; -}; - -static void predict_and_reconstruct_intra_block(int plane, int block, - BLOCK_SIZE plane_bsize, - TX_SIZE tx_size, void *arg) { - struct intra_args *const args = (struct intra_args *)arg; - VP9_COMMON *const cm = args->cm; - MACROBLOCKD *const xd = args->xd; - struct macroblockd_plane *const pd = &xd->plane[plane]; - MODE_INFO *const mi = xd->mi[0].src_mi; - const PREDICTION_MODE mode = (plane == 0) ? get_y_mode(mi, block) - : mi->mbmi.uv_mode; - const int16_t *const dequant = (plane == 0) ? args->y_dequant - : args->uv_dequant; - int x, y; - uint8_t *dst; - txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &x, &y); - dst = &pd->dst.buf[4 * y * pd->dst.stride + 4 * x]; - - vp9_predict_intra_block(xd, block >> (tx_size << 1), - b_width_log2_lookup[plane_bsize], tx_size, mode, - dst, pd->dst.stride, dst, pd->dst.stride, - x, y, plane); - - if (!mi->mbmi.skip) { - const int eob = vp9_decode_block_tokens(cm, xd, args->counts, plane, block, - plane_bsize, x, y, tx_size, - args->r, dequant); - inverse_transform_block(xd, plane, block, tx_size, dst, pd->dst.stride, - eob); - } -} - -struct inter_args { - VP9_COMMON *cm; - MACROBLOCKD *xd; - vp9_reader *r; - FRAME_COUNTS *counts; - int *eobtotal; - const int16_t *const y_dequant; - const int16_t *const uv_dequant; -}; - -static void reconstruct_inter_block(int plane, int block, - BLOCK_SIZE plane_bsize, - TX_SIZE tx_size, void *arg) { - struct inter_args *args = (struct inter_args *)arg; - VP9_COMMON *const cm = args->cm; - MACROBLOCKD *const xd = args->xd; - struct macroblockd_plane *const pd = &xd->plane[plane]; - const int16_t *const dequant = (plane == 0) ? args->y_dequant - : args->uv_dequant; - int x, y, eob; - txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &x, &y); - eob = vp9_decode_block_tokens(cm, xd, args->counts, plane, block, plane_bsize, - x, y, tx_size, args->r, dequant); - inverse_transform_block(xd, plane, block, tx_size, - &pd->dst.buf[4 * y * pd->dst.stride + 4 * x], - pd->dst.stride, eob); - *args->eobtotal += eob; -} - -static MB_MODE_INFO *set_offsets(VP9_COMMON *const cm, MACROBLOCKD *const xd, - const TileInfo *const tile, - BLOCK_SIZE bsize, int mi_row, int mi_col) { - const int bw = num_8x8_blocks_wide_lookup[bsize]; - const int bh = num_8x8_blocks_high_lookup[bsize]; - const int x_mis = MIN(bw, cm->mi_cols - mi_col); - const int y_mis = MIN(bh, cm->mi_rows - mi_row); - const int offset = mi_row * cm->mi_stride + mi_col; - int x, y; - - xd->mi = cm->mi + offset; - xd->mi[0].src_mi = &xd->mi[0]; // Point to self. - xd->mi[0].mbmi.sb_type = bsize; - - for (y = 0; y < y_mis; ++y) - for (x = !y; x < x_mis; ++x) { - xd->mi[y * cm->mi_stride + x].src_mi = &xd->mi[0]; - } - - set_skip_context(xd, mi_row, mi_col); - - // Distance of Mb to the various image edges. These are specified to 8th pel - // as they are always compared to values that are in 1/8th pel units - set_mi_row_col(xd, tile, mi_row, bh, mi_col, bw, cm->mi_rows, cm->mi_cols); - - vp9_setup_dst_planes(xd->plane, get_frame_new_buffer(cm), mi_row, mi_col); - return &xd->mi[0].mbmi; -} - -static void decode_block(VP9Decoder *const pbi, MACROBLOCKD *const xd, - FRAME_COUNTS *counts, - const TileInfo *const tile, - int mi_row, int mi_col, - vp9_reader *r, BLOCK_SIZE bsize) { - VP9_COMMON *const cm = &pbi->common; - const int less8x8 = bsize < BLOCK_8X8; - int16_t y_dequant[2], uv_dequant[2]; - int qindex = cm->base_qindex; - MB_MODE_INFO *mbmi = set_offsets(cm, xd, tile, bsize, mi_row, mi_col); - vp9_read_mode_info(pbi, xd, counts, tile, mi_row, mi_col, r); - - if (less8x8) - bsize = BLOCK_8X8; - - if (mbmi->skip) { - reset_skip_context(xd, bsize); - } else if (cm->seg.enabled) { - qindex = vp9_get_qindex(&cm->seg, mbmi->segment_id, cm->base_qindex); - } - - y_dequant[0] = vp9_dc_quant(qindex, cm->y_dc_delta_q, cm->bit_depth); - y_dequant[1] = vp9_ac_quant(qindex, 0, cm->bit_depth); - uv_dequant[0] = vp9_dc_quant(qindex, cm->uv_dc_delta_q, cm->bit_depth); - uv_dequant[1] = vp9_ac_quant(qindex, cm->uv_ac_delta_q, cm->bit_depth); - - if (!is_inter_block(mbmi)) { - struct intra_args arg = {cm, xd, counts, r , y_dequant, uv_dequant}; - vp9_foreach_transformed_block(xd, bsize, - predict_and_reconstruct_intra_block, &arg); - } else { - // Prediction - vp9_dec_build_inter_predictors_sb(pbi, xd, mi_row, mi_col, bsize); - - // Reconstruction - if (!mbmi->skip) { - int eobtotal = 0; - struct inter_args arg = {cm, xd, r, counts, &eobtotal, y_dequant, - uv_dequant}; - vp9_foreach_transformed_block(xd, bsize, reconstruct_inter_block, &arg); - if (!less8x8 && eobtotal == 0) - mbmi->skip = 1; // skip loopfilter - } - } - - xd->corrupted |= vp9_reader_has_error(r); -} - -static PARTITION_TYPE read_partition(VP9_COMMON *cm, MACROBLOCKD *xd, - FRAME_COUNTS *counts, int hbs, - int mi_row, int mi_col, BLOCK_SIZE bsize, - vp9_reader *r) { - const int ctx = partition_plane_context(xd, mi_row, mi_col, bsize); - const vp9_prob *const probs = get_partition_probs(cm, ctx); - const int has_rows = (mi_row + hbs) < cm->mi_rows; - const int has_cols = (mi_col + hbs) < cm->mi_cols; - PARTITION_TYPE p; - - if (has_rows && has_cols) - p = (PARTITION_TYPE)vp9_read_tree(r, vp9_partition_tree, probs); - else if (!has_rows && has_cols) - p = vp9_read(r, probs[1]) ? PARTITION_SPLIT : PARTITION_HORZ; - else if (has_rows && !has_cols) - p = vp9_read(r, probs[2]) ? PARTITION_SPLIT : PARTITION_VERT; - else - p = PARTITION_SPLIT; - - if (!cm->frame_parallel_decoding_mode) - ++counts->partition[ctx][p]; - - return p; -} - -static void decode_partition(VP9Decoder *const pbi, MACROBLOCKD *const xd, - FRAME_COUNTS *counts, - const TileInfo *const tile, - int mi_row, int mi_col, - vp9_reader* r, BLOCK_SIZE bsize) { - VP9_COMMON *const cm = &pbi->common; - const int hbs = num_8x8_blocks_wide_lookup[bsize] / 2; - PARTITION_TYPE partition; - BLOCK_SIZE subsize, uv_subsize; - - if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) - return; - - partition = read_partition(cm, xd, counts, hbs, mi_row, mi_col, bsize, r); - subsize = get_subsize(bsize, partition); - uv_subsize = ss_size_lookup[subsize][cm->subsampling_x][cm->subsampling_y]; - if (subsize >= BLOCK_8X8 && uv_subsize == BLOCK_INVALID) - vpx_internal_error(xd->error_info, - VPX_CODEC_CORRUPT_FRAME, "Invalid block size."); - if (subsize < BLOCK_8X8) { - decode_block(pbi, xd, counts, tile, mi_row, mi_col, r, subsize); - } else { - switch (partition) { - case PARTITION_NONE: - decode_block(pbi, xd, counts, tile, mi_row, mi_col, r, subsize); - break; - case PARTITION_HORZ: - decode_block(pbi, xd, counts, tile, mi_row, mi_col, r, subsize); - if (mi_row + hbs < cm->mi_rows) - decode_block(pbi, xd, counts, tile, mi_row + hbs, mi_col, r, subsize); - break; - case PARTITION_VERT: - decode_block(pbi, xd, counts, tile, mi_row, mi_col, r, subsize); - if (mi_col + hbs < cm->mi_cols) - decode_block(pbi, xd, counts, tile, mi_row, mi_col + hbs, r, subsize); - break; - case PARTITION_SPLIT: - decode_partition(pbi, xd, counts, tile, mi_row, mi_col, r, subsize); - decode_partition(pbi, xd, counts, tile, mi_row, mi_col + hbs, r, - subsize); - decode_partition(pbi, xd, counts, tile, mi_row + hbs, mi_col, r, - subsize); - decode_partition(pbi, xd, counts, tile, mi_row + hbs, mi_col + hbs, r, - subsize); - break; - default: - assert(0 && "Invalid partition type"); - } - } - - // update partition context - if (bsize >= BLOCK_8X8 && - (bsize == BLOCK_8X8 || partition != PARTITION_SPLIT)) - update_partition_context(xd, mi_row, mi_col, subsize, bsize); -} - -static void setup_token_decoder(const uint8_t *data, - const uint8_t *data_end, - size_t read_size, - struct vpx_internal_error_info *error_info, - vp9_reader *r, - vpx_decrypt_cb decrypt_cb, - void *decrypt_state) { - // Validate the calculated partition length. If the buffer - // described by the partition can't be fully read, then restrict - // it to the portion that can be (for EC mode) or throw an error. - if (!read_is_valid(data, read_size, data_end)) - vpx_internal_error(error_info, VPX_CODEC_CORRUPT_FRAME, - "Truncated packet or corrupt tile length"); - - if (vp9_reader_init(r, data, read_size, decrypt_cb, decrypt_state)) - vpx_internal_error(error_info, VPX_CODEC_MEM_ERROR, - "Failed to allocate bool decoder %d", 1); -} - -static void read_coef_probs_common(vp9_coeff_probs_model *coef_probs, - vp9_reader *r) { - int i, j, k, l, m; - - if (vp9_read_bit(r)) - for (i = 0; i < PLANE_TYPES; ++i) - for (j = 0; j < REF_TYPES; ++j) - for (k = 0; k < COEF_BANDS; ++k) - for (l = 0; l < BAND_COEFF_CONTEXTS(k); ++l) - for (m = 0; m < UNCONSTRAINED_NODES; ++m) - vp9_diff_update_prob(r, &coef_probs[i][j][k][l][m]); -} - -static void read_coef_probs(FRAME_CONTEXT *fc, TX_MODE tx_mode, - vp9_reader *r) { - const TX_SIZE max_tx_size = tx_mode_to_biggest_tx_size[tx_mode]; - TX_SIZE tx_size; - for (tx_size = TX_4X4; tx_size <= max_tx_size; ++tx_size) - read_coef_probs_common(fc->coef_probs[tx_size], r); -} - -static void setup_segmentation(struct segmentation *seg, - struct vp9_read_bit_buffer *rb) { - int i, j; - - seg->update_map = 0; - seg->update_data = 0; - - seg->enabled = vp9_rb_read_bit(rb); - if (!seg->enabled) - return; - - // Segmentation map update - seg->update_map = vp9_rb_read_bit(rb); - if (seg->update_map) { - for (i = 0; i < SEG_TREE_PROBS; i++) - seg->tree_probs[i] = vp9_rb_read_bit(rb) ? vp9_rb_read_literal(rb, 8) - : MAX_PROB; - - seg->temporal_update = vp9_rb_read_bit(rb); - if (seg->temporal_update) { - for (i = 0; i < PREDICTION_PROBS; i++) - seg->pred_probs[i] = vp9_rb_read_bit(rb) ? vp9_rb_read_literal(rb, 8) - : MAX_PROB; - } else { - for (i = 0; i < PREDICTION_PROBS; i++) - seg->pred_probs[i] = MAX_PROB; - } - } - - // Segmentation data update - seg->update_data = vp9_rb_read_bit(rb); - if (seg->update_data) { - seg->abs_delta = vp9_rb_read_bit(rb); - - vp9_clearall_segfeatures(seg); - - for (i = 0; i < MAX_SEGMENTS; i++) { - for (j = 0; j < SEG_LVL_MAX; j++) { - int data = 0; - const int feature_enabled = vp9_rb_read_bit(rb); - if (feature_enabled) { - vp9_enable_segfeature(seg, i, j); - data = decode_unsigned_max(rb, vp9_seg_feature_data_max(j)); - if (vp9_is_segfeature_signed(j)) - data = vp9_rb_read_bit(rb) ? -data : data; - } - vp9_set_segdata(seg, i, j, data); - } - } - } -} - -static void setup_loopfilter(struct loopfilter *lf, - struct vp9_read_bit_buffer *rb) { - lf->filter_level = vp9_rb_read_literal(rb, 6); - lf->sharpness_level = vp9_rb_read_literal(rb, 3); - - // Read in loop filter deltas applied at the MB level based on mode or ref - // frame. - lf->mode_ref_delta_update = 0; - - lf->mode_ref_delta_enabled = vp9_rb_read_bit(rb); - if (lf->mode_ref_delta_enabled) { - lf->mode_ref_delta_update = vp9_rb_read_bit(rb); - if (lf->mode_ref_delta_update) { - int i; - - for (i = 0; i < MAX_REF_LF_DELTAS; i++) - if (vp9_rb_read_bit(rb)) - lf->ref_deltas[i] = vp9_rb_read_signed_literal(rb, 6); - - for (i = 0; i < MAX_MODE_LF_DELTAS; i++) - if (vp9_rb_read_bit(rb)) - lf->mode_deltas[i] = vp9_rb_read_signed_literal(rb, 6); - } - } -} - -static INLINE int read_delta_q(struct vp9_read_bit_buffer *rb) { - return vp9_rb_read_bit(rb) ? vp9_rb_read_signed_literal(rb, 4) : 0; -} - -static void setup_quantization(VP9_COMMON *const cm, MACROBLOCKD *const xd, - struct vp9_read_bit_buffer *rb) { - cm->base_qindex = vp9_rb_read_literal(rb, QINDEX_BITS); - cm->y_dc_delta_q = read_delta_q(rb); - cm->uv_dc_delta_q = read_delta_q(rb); - cm->uv_ac_delta_q = read_delta_q(rb); - cm->dequant_bit_depth = cm->bit_depth; - xd->lossless = cm->base_qindex == 0 && - cm->y_dc_delta_q == 0 && - cm->uv_dc_delta_q == 0 && - cm->uv_ac_delta_q == 0; -#if CONFIG_VP9_HIGHBITDEPTH - xd->bd = (int)cm->bit_depth; -#endif -} - -static INTERP_FILTER read_interp_filter(struct vp9_read_bit_buffer *rb) { - const INTERP_FILTER literal_to_filter[] = { EIGHTTAP_SMOOTH, - EIGHTTAP, - EIGHTTAP_SHARP, - BILINEAR }; - return vp9_rb_read_bit(rb) ? SWITCHABLE - : literal_to_filter[vp9_rb_read_literal(rb, 2)]; -} - -void vp9_read_frame_size(struct vp9_read_bit_buffer *rb, - int *width, int *height) { - *width = vp9_rb_read_literal(rb, 16) + 1; - *height = vp9_rb_read_literal(rb, 16) + 1; -} - -static void setup_display_size(VP9_COMMON *cm, struct vp9_read_bit_buffer *rb) { - cm->display_width = cm->width; - cm->display_height = cm->height; - if (vp9_rb_read_bit(rb)) - vp9_read_frame_size(rb, &cm->display_width, &cm->display_height); -} - -static void resize_mv_buffer(VP9_COMMON *cm) { - vpx_free(cm->cur_frame->mvs); - cm->cur_frame->mi_rows = cm->mi_rows; - cm->cur_frame->mi_cols = cm->mi_cols; - cm->cur_frame->mvs = (MV_REF *)vpx_calloc(cm->mi_rows * cm->mi_cols, - sizeof(*cm->cur_frame->mvs)); -} - -static void resize_context_buffers(VP9_COMMON *cm, int width, int height) { -#if CONFIG_SIZE_LIMIT - if (width > DECODE_WIDTH_LIMIT || height > DECODE_HEIGHT_LIMIT) - vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, - "Width and height beyond allowed size."); -#endif - if (cm->width != width || cm->height != height) { - const int new_mi_rows = - ALIGN_POWER_OF_TWO(height, MI_SIZE_LOG2) >> MI_SIZE_LOG2; - const int new_mi_cols = - ALIGN_POWER_OF_TWO(width, MI_SIZE_LOG2) >> MI_SIZE_LOG2; - - // Allocations in vp9_alloc_context_buffers() depend on individual - // dimensions as well as the overall size. - if (new_mi_cols > cm->mi_cols || new_mi_rows > cm->mi_rows) { - if (vp9_alloc_context_buffers(cm, width, height)) - vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR, - "Failed to allocate context buffers"); - } else { - vp9_set_mb_mi(cm, width, height); - } - vp9_init_context_buffers(cm); - cm->width = width; - cm->height = height; - } - if (cm->cur_frame->mvs == NULL || cm->mi_rows > cm->cur_frame->mi_rows || - cm->mi_cols > cm->cur_frame->mi_cols) { - resize_mv_buffer(cm); - } -} - -static void setup_frame_size(VP9_COMMON *cm, struct vp9_read_bit_buffer *rb) { - int width, height; - BufferPool *const pool = cm->buffer_pool; - vp9_read_frame_size(rb, &width, &height); - resize_context_buffers(cm, width, height); - setup_display_size(cm, rb); - - lock_buffer_pool(pool); - if (vp9_realloc_frame_buffer( - get_frame_new_buffer(cm), cm->width, cm->height, - cm->subsampling_x, cm->subsampling_y, -#if CONFIG_VP9_HIGHBITDEPTH - cm->use_highbitdepth, -#endif - VP9_DEC_BORDER_IN_PIXELS, - cm->byte_alignment, - &pool->frame_bufs[cm->new_fb_idx].raw_frame_buffer, pool->get_fb_cb, - pool->cb_priv)) { - unlock_buffer_pool(pool); - vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR, - "Failed to allocate frame buffer"); - } - unlock_buffer_pool(pool); - - pool->frame_bufs[cm->new_fb_idx].buf.subsampling_x = cm->subsampling_x; - pool->frame_bufs[cm->new_fb_idx].buf.subsampling_y = cm->subsampling_y; - pool->frame_bufs[cm->new_fb_idx].buf.bit_depth = (unsigned int)cm->bit_depth; - pool->frame_bufs[cm->new_fb_idx].buf.color_space = cm->color_space; -} - -static INLINE int valid_ref_frame_img_fmt(vpx_bit_depth_t ref_bit_depth, - int ref_xss, int ref_yss, - vpx_bit_depth_t this_bit_depth, - int this_xss, int this_yss) { - return ref_bit_depth == this_bit_depth && ref_xss == this_xss && - ref_yss == this_yss; -} - -static void setup_frame_size_with_refs(VP9_COMMON *cm, - struct vp9_read_bit_buffer *rb) { - int width, height; - int found = 0, i; - int has_valid_ref_frame = 0; - BufferPool *const pool = cm->buffer_pool; - for (i = 0; i < REFS_PER_FRAME; ++i) { - if (vp9_rb_read_bit(rb)) { - YV12_BUFFER_CONFIG *const buf = cm->frame_refs[i].buf; - width = buf->y_crop_width; - height = buf->y_crop_height; - found = 1; - break; - } - } - - if (!found) - vp9_read_frame_size(rb, &width, &height); - - if (width <= 0 || height <= 0) - vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, - "Invalid frame size"); - - // Check to make sure at least one of frames that this frame references - // has valid dimensions. - for (i = 0; i < REFS_PER_FRAME; ++i) { - RefBuffer *const ref_frame = &cm->frame_refs[i]; - has_valid_ref_frame |= valid_ref_frame_size(ref_frame->buf->y_crop_width, - ref_frame->buf->y_crop_height, - width, height); - } - if (!has_valid_ref_frame) - vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, - "Referenced frame has invalid size"); - for (i = 0; i < REFS_PER_FRAME; ++i) { - RefBuffer *const ref_frame = &cm->frame_refs[i]; - if (!valid_ref_frame_img_fmt( - ref_frame->buf->bit_depth, - ref_frame->buf->subsampling_x, - ref_frame->buf->subsampling_y, - cm->bit_depth, - cm->subsampling_x, - cm->subsampling_y)) - vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, - "Referenced frame has incompatible color format"); - } - - resize_context_buffers(cm, width, height); - setup_display_size(cm, rb); - - lock_buffer_pool(pool); - if (vp9_realloc_frame_buffer( - get_frame_new_buffer(cm), cm->width, cm->height, - cm->subsampling_x, cm->subsampling_y, -#if CONFIG_VP9_HIGHBITDEPTH - cm->use_highbitdepth, -#endif - VP9_DEC_BORDER_IN_PIXELS, - cm->byte_alignment, - &pool->frame_bufs[cm->new_fb_idx].raw_frame_buffer, pool->get_fb_cb, - pool->cb_priv)) { - unlock_buffer_pool(pool); - vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR, - "Failed to allocate frame buffer"); - } - unlock_buffer_pool(pool); - - pool->frame_bufs[cm->new_fb_idx].buf.subsampling_x = cm->subsampling_x; - pool->frame_bufs[cm->new_fb_idx].buf.subsampling_y = cm->subsampling_y; - pool->frame_bufs[cm->new_fb_idx].buf.bit_depth = (unsigned int)cm->bit_depth; - pool->frame_bufs[cm->new_fb_idx].buf.color_space = cm->color_space; -} - -static void setup_tile_info(VP9_COMMON *cm, struct vp9_read_bit_buffer *rb) { - int min_log2_tile_cols, max_log2_tile_cols, max_ones; - vp9_get_tile_n_bits(cm->mi_cols, &min_log2_tile_cols, &max_log2_tile_cols); - - // columns - max_ones = max_log2_tile_cols - min_log2_tile_cols; - cm->log2_tile_cols = min_log2_tile_cols; - while (max_ones-- && vp9_rb_read_bit(rb)) - cm->log2_tile_cols++; - - if (cm->log2_tile_cols > 6) - vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, - "Invalid number of tile columns"); - - // rows - cm->log2_tile_rows = vp9_rb_read_bit(rb); - if (cm->log2_tile_rows) - cm->log2_tile_rows += vp9_rb_read_bit(rb); -} - -typedef struct TileBuffer { - const uint8_t *data; - size_t size; - int col; // only used with multi-threaded decoding -} TileBuffer; - -// Reads the next tile returning its size and adjusting '*data' accordingly -// based on 'is_last'. -static void get_tile_buffer(const uint8_t *const data_end, - int is_last, - struct vpx_internal_error_info *error_info, - const uint8_t **data, - vpx_decrypt_cb decrypt_cb, void *decrypt_state, - TileBuffer *buf) { - size_t size; - - if (!is_last) { - if (!read_is_valid(*data, 4, data_end)) - vpx_internal_error(error_info, VPX_CODEC_CORRUPT_FRAME, - "Truncated packet or corrupt tile length"); - - if (decrypt_cb) { - uint8_t be_data[4]; - decrypt_cb(decrypt_state, *data, be_data, 4); - size = mem_get_be32(be_data); - } else { - size = mem_get_be32(*data); - } - *data += 4; - - if (size > (size_t)(data_end - *data)) - vpx_internal_error(error_info, VPX_CODEC_CORRUPT_FRAME, - "Truncated packet or corrupt tile size"); - } else { - size = data_end - *data; - } - - buf->data = *data; - buf->size = size; - - *data += size; -} - -static void get_tile_buffers(VP9Decoder *pbi, - const uint8_t *data, const uint8_t *data_end, - int tile_cols, int tile_rows, - TileBuffer (*tile_buffers)[1 << 6]) { - int r, c; - - for (r = 0; r < tile_rows; ++r) { - for (c = 0; c < tile_cols; ++c) { - const int is_last = (r == tile_rows - 1) && (c == tile_cols - 1); - TileBuffer *const buf = &tile_buffers[r][c]; - buf->col = c; - get_tile_buffer(data_end, is_last, &pbi->common.error, &data, - pbi->decrypt_cb, pbi->decrypt_state, buf); - } - } -} - -static const uint8_t *decode_tiles(VP9Decoder *pbi, - const uint8_t *data, - const uint8_t *data_end) { - VP9_COMMON *const cm = &pbi->common; - const VP9WorkerInterface *const winterface = vp9_get_worker_interface(); - const int aligned_cols = mi_cols_aligned_to_sb(cm->mi_cols); - const int tile_cols = 1 << cm->log2_tile_cols; - const int tile_rows = 1 << cm->log2_tile_rows; - TileBuffer tile_buffers[4][1 << 6]; - int tile_row, tile_col; - int mi_row, mi_col; - TileData *tile_data = NULL; - - if (cm->lf.filter_level && pbi->lf_worker.data1 == NULL) { - CHECK_MEM_ERROR(cm, pbi->lf_worker.data1, - vpx_memalign(32, sizeof(LFWorkerData))); - pbi->lf_worker.hook = (VP9WorkerHook)vp9_loop_filter_worker; - if (pbi->max_threads > 1 && !winterface->reset(&pbi->lf_worker)) { - vpx_internal_error(&cm->error, VPX_CODEC_ERROR, - "Loop filter thread creation failed"); - } - } - - if (cm->lf.filter_level) { - LFWorkerData *const lf_data = (LFWorkerData*)pbi->lf_worker.data1; - // Be sure to sync as we might be resuming after a failed frame decode. - winterface->sync(&pbi->lf_worker); - vp9_loop_filter_data_reset(lf_data, get_frame_new_buffer(cm), cm, - pbi->mb.plane); - } - - assert(tile_rows <= 4); - assert(tile_cols <= (1 << 6)); - - // Note: this memset assumes above_context[0], [1] and [2] - // are allocated as part of the same buffer. - vpx_memset(cm->above_context, 0, - sizeof(*cm->above_context) * MAX_MB_PLANE * 2 * aligned_cols); - - vpx_memset(cm->above_seg_context, 0, - sizeof(*cm->above_seg_context) * aligned_cols); - - get_tile_buffers(pbi, data, data_end, tile_cols, tile_rows, tile_buffers); - - if (pbi->tile_data == NULL || - (tile_cols * tile_rows) != pbi->total_tiles) { - vpx_free(pbi->tile_data); - CHECK_MEM_ERROR( - cm, - pbi->tile_data, - vpx_memalign(32, tile_cols * tile_rows * (sizeof(*pbi->tile_data)))); - pbi->total_tiles = tile_rows * tile_cols; - } - - // Load all tile information into tile_data. - for (tile_row = 0; tile_row < tile_rows; ++tile_row) { - for (tile_col = 0; tile_col < tile_cols; ++tile_col) { - TileInfo tile; - const TileBuffer *const buf = &tile_buffers[tile_row][tile_col]; - tile_data = pbi->tile_data + tile_cols * tile_row + tile_col; - tile_data->cm = cm; - tile_data->xd = pbi->mb; - tile_data->xd.corrupted = 0; - vp9_tile_init(&tile, tile_data->cm, tile_row, tile_col); - setup_token_decoder(buf->data, data_end, buf->size, &cm->error, - &tile_data->bit_reader, pbi->decrypt_cb, - pbi->decrypt_state); - init_macroblockd(cm, &tile_data->xd); - } - } - - for (tile_row = 0; tile_row < tile_rows; ++tile_row) { - TileInfo tile; - vp9_tile_set_row(&tile, cm, tile_row); - for (mi_row = tile.mi_row_start; mi_row < tile.mi_row_end; - mi_row += MI_BLOCK_SIZE) { - for (tile_col = 0; tile_col < tile_cols; ++tile_col) { - const int col = pbi->inv_tile_order ? - tile_cols - tile_col - 1 : tile_col; - tile_data = pbi->tile_data + tile_cols * tile_row + col; - vp9_tile_set_col(&tile, tile_data->cm, col); - vp9_zero(tile_data->xd.left_context); - vp9_zero(tile_data->xd.left_seg_context); - for (mi_col = tile.mi_col_start; mi_col < tile.mi_col_end; - mi_col += MI_BLOCK_SIZE) { - decode_partition(pbi, &tile_data->xd, &cm->counts, &tile, mi_row, - mi_col, &tile_data->bit_reader, BLOCK_64X64); - } - pbi->mb.corrupted |= tile_data->xd.corrupted; - if (pbi->mb.corrupted) - vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, - "Failed to decode tile data"); - } - // Loopfilter one row. - if (cm->lf.filter_level) { - const int lf_start = mi_row - MI_BLOCK_SIZE; - LFWorkerData *const lf_data = (LFWorkerData*)pbi->lf_worker.data1; - - // delay the loopfilter by 1 macroblock row. - if (lf_start < 0) continue; - - // decoding has completed: finish up the loop filter in this thread. - if (mi_row + MI_BLOCK_SIZE >= cm->mi_rows) continue; - - winterface->sync(&pbi->lf_worker); - lf_data->start = lf_start; - lf_data->stop = mi_row; - if (pbi->max_threads > 1) { - winterface->launch(&pbi->lf_worker); - } else { - winterface->execute(&pbi->lf_worker); - } - } - // After loopfiltering, the last 7 row pixels in each superblock row may - // still be changed by the longest loopfilter of the next superblock - // row. - if (pbi->frame_parallel_decode) - vp9_frameworker_broadcast(pbi->cur_buf, - mi_row << MI_BLOCK_SIZE_LOG2); - } - } - - // Loopfilter remaining rows in the frame. - if (cm->lf.filter_level) { - LFWorkerData *const lf_data = (LFWorkerData*)pbi->lf_worker.data1; - winterface->sync(&pbi->lf_worker); - lf_data->start = lf_data->stop; - lf_data->stop = cm->mi_rows; - winterface->execute(&pbi->lf_worker); - } - - // Get last tile data. - tile_data = pbi->tile_data + tile_cols * tile_rows - 1; - - if (pbi->frame_parallel_decode) - vp9_frameworker_broadcast(pbi->cur_buf, INT_MAX); - return vp9_reader_find_end(&tile_data->bit_reader); -} - -static int tile_worker_hook(TileWorkerData *const tile_data, - const TileInfo *const tile) { - int mi_row, mi_col; - - if (setjmp(tile_data->error_info.jmp)) { - tile_data->error_info.setjmp = 0; - tile_data->xd.corrupted = 1; - return 0; - } - - tile_data->error_info.setjmp = 1; - tile_data->xd.error_info = &tile_data->error_info; - - for (mi_row = tile->mi_row_start; mi_row < tile->mi_row_end; - mi_row += MI_BLOCK_SIZE) { - vp9_zero(tile_data->xd.left_context); - vp9_zero(tile_data->xd.left_seg_context); - for (mi_col = tile->mi_col_start; mi_col < tile->mi_col_end; - mi_col += MI_BLOCK_SIZE) { - decode_partition(tile_data->pbi, &tile_data->xd, &tile_data->counts, - tile, mi_row, mi_col, &tile_data->bit_reader, - BLOCK_64X64); - } - } - return !tile_data->xd.corrupted; -} - -// sorts in descending order -static int compare_tile_buffers(const void *a, const void *b) { - const TileBuffer *const buf1 = (const TileBuffer*)a; - const TileBuffer *const buf2 = (const TileBuffer*)b; - if (buf1->size < buf2->size) { - return 1; - } else if (buf1->size == buf2->size) { - return 0; - } else { - return -1; - } -} - -static const uint8_t *decode_tiles_mt(VP9Decoder *pbi, - const uint8_t *data, - const uint8_t *data_end) { - VP9_COMMON *const cm = &pbi->common; - const VP9WorkerInterface *const winterface = vp9_get_worker_interface(); - const uint8_t *bit_reader_end = NULL; - const int aligned_mi_cols = mi_cols_aligned_to_sb(cm->mi_cols); - const int tile_cols = 1 << cm->log2_tile_cols; - const int tile_rows = 1 << cm->log2_tile_rows; - const int num_workers = MIN(pbi->max_threads & ~1, tile_cols); - TileBuffer tile_buffers[1][1 << 6]; - int n; - int final_worker = -1; - - assert(tile_cols <= (1 << 6)); - assert(tile_rows == 1); - (void)tile_rows; - - // TODO(jzern): See if we can remove the restriction of passing in max - // threads to the decoder. - if (pbi->num_tile_workers == 0) { - const int num_threads = pbi->max_threads & ~1; - int i; - // TODO(jzern): Allocate one less worker, as in the current code we only - // use num_threads - 1 workers. - CHECK_MEM_ERROR(cm, pbi->tile_workers, - vpx_malloc(num_threads * sizeof(*pbi->tile_workers))); - // Ensure tile data offsets will be properly aligned. This may fail on - // platforms without DECLARE_ALIGNED(). - assert((sizeof(*pbi->tile_worker_data) % 16) == 0); - CHECK_MEM_ERROR(cm, pbi->tile_worker_data, - vpx_memalign(32, num_threads * - sizeof(*pbi->tile_worker_data))); - CHECK_MEM_ERROR(cm, pbi->tile_worker_info, - vpx_malloc(num_threads * sizeof(*pbi->tile_worker_info))); - for (i = 0; i < num_threads; ++i) { - VP9Worker *const worker = &pbi->tile_workers[i]; - ++pbi->num_tile_workers; - - winterface->init(worker); - if (i < num_threads - 1 && !winterface->reset(worker)) { - vpx_internal_error(&cm->error, VPX_CODEC_ERROR, - "Tile decoder thread creation failed"); - } - } - } - - // Reset tile decoding hook - for (n = 0; n < num_workers; ++n) { - VP9Worker *const worker = &pbi->tile_workers[n]; - winterface->sync(worker); - worker->hook = (VP9WorkerHook)tile_worker_hook; - worker->data1 = &pbi->tile_worker_data[n]; - worker->data2 = &pbi->tile_worker_info[n]; - } - - // Note: this memset assumes above_context[0], [1] and [2] - // are allocated as part of the same buffer. - vpx_memset(cm->above_context, 0, - sizeof(*cm->above_context) * MAX_MB_PLANE * 2 * aligned_mi_cols); - vpx_memset(cm->above_seg_context, 0, - sizeof(*cm->above_seg_context) * aligned_mi_cols); - - // Load tile data into tile_buffers - get_tile_buffers(pbi, data, data_end, tile_cols, tile_rows, tile_buffers); - - // Sort the buffers based on size in descending order. - qsort(tile_buffers[0], tile_cols, sizeof(tile_buffers[0][0]), - compare_tile_buffers); - - // Rearrange the tile buffers such that per-tile group the largest, and - // presumably the most difficult, tile will be decoded in the main thread. - // This should help minimize the number of instances where the main thread is - // waiting for a worker to complete. - { - int group_start = 0; - while (group_start < tile_cols) { - const TileBuffer largest = tile_buffers[0][group_start]; - const int group_end = MIN(group_start + num_workers, tile_cols) - 1; - memmove(tile_buffers[0] + group_start, tile_buffers[0] + group_start + 1, - (group_end - group_start) * sizeof(tile_buffers[0][0])); - tile_buffers[0][group_end] = largest; - group_start = group_end + 1; - } - } - - // Initialize thread frame counts. - if (!cm->frame_parallel_decoding_mode) { - int i; - - for (i = 0; i < num_workers; ++i) { - TileWorkerData *const tile_data = - (TileWorkerData*)pbi->tile_workers[i].data1; - vp9_zero(tile_data->counts); - } - } - - n = 0; - while (n < tile_cols) { - int i; - for (i = 0; i < num_workers && n < tile_cols; ++i) { - VP9Worker *const worker = &pbi->tile_workers[i]; - TileWorkerData *const tile_data = (TileWorkerData*)worker->data1; - TileInfo *const tile = (TileInfo*)worker->data2; - TileBuffer *const buf = &tile_buffers[0][n]; - - tile_data->pbi = pbi; - tile_data->xd = pbi->mb; - tile_data->xd.corrupted = 0; - vp9_tile_init(tile, cm, 0, buf->col); - setup_token_decoder(buf->data, data_end, buf->size, &cm->error, - &tile_data->bit_reader, pbi->decrypt_cb, - pbi->decrypt_state); - init_macroblockd(cm, &tile_data->xd); - - worker->had_error = 0; - if (i == num_workers - 1 || n == tile_cols - 1) { - winterface->execute(worker); - } else { - winterface->launch(worker); - } - - if (buf->col == tile_cols - 1) { - final_worker = i; - } - - ++n; - } - - for (; i > 0; --i) { - VP9Worker *const worker = &pbi->tile_workers[i - 1]; - // TODO(jzern): The tile may have specific error data associated with - // its vpx_internal_error_info which could be propagated to the main info - // in cm. Additionally once the threads have been synced and an error is - // detected, there's no point in continuing to decode tiles. - pbi->mb.corrupted |= !winterface->sync(worker); - } - if (final_worker > -1) { - TileWorkerData *const tile_data = - (TileWorkerData*)pbi->tile_workers[final_worker].data1; - bit_reader_end = vp9_reader_find_end(&tile_data->bit_reader); - final_worker = -1; - } - - // Accumulate thread frame counts. - if (n >= tile_cols && !cm->frame_parallel_decoding_mode) { - for (i = 0; i < num_workers; ++i) { - TileWorkerData *const tile_data = - (TileWorkerData*)pbi->tile_workers[i].data1; - vp9_accumulate_frame_counts(cm, &tile_data->counts, 1); - } - } - } - - return bit_reader_end; -} - -static void error_handler(void *data) { - VP9_COMMON *const cm = (VP9_COMMON *)data; - vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, "Truncated packet"); -} - -int vp9_read_sync_code(struct vp9_read_bit_buffer *const rb) { - return vp9_rb_read_literal(rb, 8) == VP9_SYNC_CODE_0 && - vp9_rb_read_literal(rb, 8) == VP9_SYNC_CODE_1 && - vp9_rb_read_literal(rb, 8) == VP9_SYNC_CODE_2; -} - -BITSTREAM_PROFILE vp9_read_profile(struct vp9_read_bit_buffer *rb) { - int profile = vp9_rb_read_bit(rb); - profile |= vp9_rb_read_bit(rb) << 1; - if (profile > 2) - profile += vp9_rb_read_bit(rb); - return (BITSTREAM_PROFILE) profile; -} - -static void read_bitdepth_colorspace_sampling( - VP9_COMMON *cm, struct vp9_read_bit_buffer *rb) { - if (cm->profile >= PROFILE_2) { - cm->bit_depth = vp9_rb_read_bit(rb) ? VPX_BITS_12 : VPX_BITS_10; -#if CONFIG_VP9_HIGHBITDEPTH - cm->use_highbitdepth = 1; -#endif - } else { - cm->bit_depth = VPX_BITS_8; -#if CONFIG_VP9_HIGHBITDEPTH - cm->use_highbitdepth = 0; -#endif - } - cm->color_space = vp9_rb_read_literal(rb, 3); - if (cm->color_space != VPX_CS_SRGB) { - vp9_rb_read_bit(rb); // [16,235] (including xvycc) vs [0,255] range - if (cm->profile == PROFILE_1 || cm->profile == PROFILE_3) { - cm->subsampling_x = vp9_rb_read_bit(rb); - cm->subsampling_y = vp9_rb_read_bit(rb); - if (cm->subsampling_x == 1 && cm->subsampling_y == 1) - vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, - "4:2:0 color not supported in profile 1 or 3"); - if (vp9_rb_read_bit(rb)) - vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, - "Reserved bit set"); - } else { - cm->subsampling_y = cm->subsampling_x = 1; - } - } else { - if (cm->profile == PROFILE_1 || cm->profile == PROFILE_3) { - // Note if colorspace is SRGB then 4:4:4 chroma sampling is assumed. - // 4:2:2 or 4:4:0 chroma sampling is not allowed. - cm->subsampling_y = cm->subsampling_x = 0; - if (vp9_rb_read_bit(rb)) - vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, - "Reserved bit set"); - } else { - vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, - "4:4:4 color not supported in profile 0 or 2"); - } - } -} - -static size_t read_uncompressed_header(VP9Decoder *pbi, - struct vp9_read_bit_buffer *rb) { - VP9_COMMON *const cm = &pbi->common; - RefCntBuffer *const frame_bufs = cm->buffer_pool->frame_bufs; - BufferPool *const pool = pbi->common.buffer_pool; - int i, mask, ref_index = 0; - size_t sz; - - cm->last_frame_type = cm->frame_type; - - if (vp9_rb_read_literal(rb, 2) != VP9_FRAME_MARKER) - vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, - "Invalid frame marker"); - - cm->profile = vp9_read_profile(rb); - - if (cm->profile >= MAX_PROFILES) - vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, - "Unsupported bitstream profile"); - - cm->show_existing_frame = vp9_rb_read_bit(rb); - if (cm->show_existing_frame) { - // Show an existing frame directly. - const int frame_to_show = cm->ref_frame_map[vp9_rb_read_literal(rb, 3)]; - lock_buffer_pool(pool); - if (frame_to_show < 0 || frame_bufs[frame_to_show].ref_count < 1) { - unlock_buffer_pool(pool); - vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, - "Buffer %d does not contain a decoded frame", - frame_to_show); - } - - ref_cnt_fb(frame_bufs, &cm->new_fb_idx, frame_to_show); - unlock_buffer_pool(pool); - pbi->refresh_frame_flags = 0; - cm->lf.filter_level = 0; - cm->show_frame = 1; - - if (pbi->frame_parallel_decode) { - for (i = 0; i < REF_FRAMES; ++i) - cm->next_ref_frame_map[i] = cm->ref_frame_map[i]; - } - return 0; - } - - cm->frame_type = (FRAME_TYPE) vp9_rb_read_bit(rb); - cm->show_frame = vp9_rb_read_bit(rb); - cm->error_resilient_mode = vp9_rb_read_bit(rb); - - if (cm->frame_type == KEY_FRAME) { - if (!vp9_read_sync_code(rb)) - vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, - "Invalid frame sync code"); - - read_bitdepth_colorspace_sampling(cm, rb); - pbi->refresh_frame_flags = (1 << REF_FRAMES) - 1; - - for (i = 0; i < REFS_PER_FRAME; ++i) { - cm->frame_refs[i].idx = INVALID_IDX; - cm->frame_refs[i].buf = NULL; - } - - setup_frame_size(cm, rb); - if (pbi->need_resync) { - vpx_memset(&cm->ref_frame_map, -1, sizeof(cm->ref_frame_map)); - pbi->need_resync = 0; - } - } else { - cm->intra_only = cm->show_frame ? 0 : vp9_rb_read_bit(rb); - - cm->reset_frame_context = cm->error_resilient_mode ? - 0 : vp9_rb_read_literal(rb, 2); - - if (cm->intra_only) { - if (!vp9_read_sync_code(rb)) - vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, - "Invalid frame sync code"); - if (cm->profile > PROFILE_0) { - read_bitdepth_colorspace_sampling(cm, rb); - } else { - // NOTE: The intra-only frame header does not include the specification - // of either the color format or color sub-sampling in profile 0. VP9 - // specifies that the default color format should be YUV 4:2:0 in this - // case (normative). - cm->color_space = VPX_CS_BT_601; - cm->subsampling_y = cm->subsampling_x = 1; - cm->bit_depth = VPX_BITS_8; -#if CONFIG_VP9_HIGHBITDEPTH - cm->use_highbitdepth = 0; -#endif - } - - pbi->refresh_frame_flags = vp9_rb_read_literal(rb, REF_FRAMES); - setup_frame_size(cm, rb); - if (pbi->need_resync) { - vpx_memset(&cm->ref_frame_map, -1, sizeof(cm->ref_frame_map)); - pbi->need_resync = 0; - } - } else if (pbi->need_resync != 1) { /* Skip if need resync */ - pbi->refresh_frame_flags = vp9_rb_read_literal(rb, REF_FRAMES); - for (i = 0; i < REFS_PER_FRAME; ++i) { - const int ref = vp9_rb_read_literal(rb, REF_FRAMES_LOG2); - const int idx = cm->ref_frame_map[ref]; - RefBuffer *const ref_frame = &cm->frame_refs[i]; - ref_frame->idx = idx; - ref_frame->buf = &frame_bufs[idx].buf; - cm->ref_frame_sign_bias[LAST_FRAME + i] = vp9_rb_read_bit(rb); - } - - setup_frame_size_with_refs(cm, rb); - - cm->allow_high_precision_mv = vp9_rb_read_bit(rb); - cm->interp_filter = read_interp_filter(rb); - - for (i = 0; i < REFS_PER_FRAME; ++i) { - RefBuffer *const ref_buf = &cm->frame_refs[i]; -#if CONFIG_VP9_HIGHBITDEPTH - vp9_setup_scale_factors_for_frame(&ref_buf->sf, - ref_buf->buf->y_crop_width, - ref_buf->buf->y_crop_height, - cm->width, cm->height, - cm->use_highbitdepth); -#else - vp9_setup_scale_factors_for_frame(&ref_buf->sf, - ref_buf->buf->y_crop_width, - ref_buf->buf->y_crop_height, - cm->width, cm->height); -#endif - } - } - } -#if CONFIG_VP9_HIGHBITDEPTH - get_frame_new_buffer(cm)->bit_depth = cm->bit_depth; -#endif - get_frame_new_buffer(cm)->color_space = cm->color_space; - - if (pbi->need_resync) { - vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, - "Keyframe / intra-only frame required to reset decoder" - " state"); - } - - if (!cm->error_resilient_mode) { - cm->refresh_frame_context = vp9_rb_read_bit(rb); - cm->frame_parallel_decoding_mode = vp9_rb_read_bit(rb); - } else { - cm->refresh_frame_context = 0; - cm->frame_parallel_decoding_mode = 1; - } - - // This flag will be overridden by the call to vp9_setup_past_independence - // below, forcing the use of context 0 for those frame types. - cm->frame_context_idx = vp9_rb_read_literal(rb, FRAME_CONTEXTS_LOG2); - - // Generate next_ref_frame_map. - lock_buffer_pool(pool); - for (mask = pbi->refresh_frame_flags; mask; mask >>= 1) { - if (mask & 1) { - cm->next_ref_frame_map[ref_index] = cm->new_fb_idx; - ++frame_bufs[cm->new_fb_idx].ref_count; - } else { - cm->next_ref_frame_map[ref_index] = cm->ref_frame_map[ref_index]; - } - // Current thread holds the reference frame. - if (cm->ref_frame_map[ref_index] >= 0) - ++frame_bufs[cm->ref_frame_map[ref_index]].ref_count; - ++ref_index; - } - - for (; ref_index < REF_FRAMES; ++ref_index) { - cm->next_ref_frame_map[ref_index] = cm->ref_frame_map[ref_index]; - // Current thread holds the reference frame. - if (cm->ref_frame_map[ref_index] >= 0) - ++frame_bufs[cm->ref_frame_map[ref_index]].ref_count; - } - unlock_buffer_pool(pool); - pbi->hold_ref_buf = 1; - - if (frame_is_intra_only(cm) || cm->error_resilient_mode) - vp9_setup_past_independence(cm); - - setup_loopfilter(&cm->lf, rb); - setup_quantization(cm, &pbi->mb, rb); - setup_segmentation(&cm->seg, rb); - - setup_tile_info(cm, rb); - sz = vp9_rb_read_literal(rb, 16); - - if (sz == 0) - vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, - "Invalid header size"); - - return sz; -} - -static int read_compressed_header(VP9Decoder *pbi, const uint8_t *data, - size_t partition_size) { - VP9_COMMON *const cm = &pbi->common; - MACROBLOCKD *const xd = &pbi->mb; - FRAME_CONTEXT *const fc = cm->fc; - vp9_reader r; - int k; - - if (vp9_reader_init(&r, data, partition_size, pbi->decrypt_cb, - pbi->decrypt_state)) - vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR, - "Failed to allocate bool decoder 0"); - - cm->tx_mode = xd->lossless ? ONLY_4X4 : read_tx_mode(&r); - if (cm->tx_mode == TX_MODE_SELECT) - read_tx_mode_probs(&fc->tx_probs, &r); - read_coef_probs(fc, cm->tx_mode, &r); - - for (k = 0; k < SKIP_CONTEXTS; ++k) - vp9_diff_update_prob(&r, &fc->skip_probs[k]); - - if (!frame_is_intra_only(cm)) { - nmv_context *const nmvc = &fc->nmvc; - int i, j; - - read_inter_mode_probs(fc, &r); - - if (cm->interp_filter == SWITCHABLE) - read_switchable_interp_probs(fc, &r); - - for (i = 0; i < INTRA_INTER_CONTEXTS; i++) - vp9_diff_update_prob(&r, &fc->intra_inter_prob[i]); - - cm->reference_mode = read_frame_reference_mode(cm, &r); - if (cm->reference_mode != SINGLE_REFERENCE) - setup_compound_reference_mode(cm); - read_frame_reference_mode_probs(cm, &r); - - for (j = 0; j < BLOCK_SIZE_GROUPS; j++) - for (i = 0; i < INTRA_MODES - 1; ++i) - vp9_diff_update_prob(&r, &fc->y_mode_prob[j][i]); - - for (j = 0; j < PARTITION_CONTEXTS; ++j) - for (i = 0; i < PARTITION_TYPES - 1; ++i) - vp9_diff_update_prob(&r, &fc->partition_prob[j][i]); - - read_mv_probs(nmvc, cm->allow_high_precision_mv, &r); - } - - return vp9_reader_has_error(&r); -} - -#ifdef NDEBUG -#define debug_check_frame_counts(cm) (void)0 -#else // !NDEBUG -// Counts should only be incremented when frame_parallel_decoding_mode and -// error_resilient_mode are disabled. -static void debug_check_frame_counts(const VP9_COMMON *const cm) { - FRAME_COUNTS zero_counts; - vp9_zero(zero_counts); - assert(cm->frame_parallel_decoding_mode || cm->error_resilient_mode); - assert(!memcmp(cm->counts.y_mode, zero_counts.y_mode, - sizeof(cm->counts.y_mode))); - assert(!memcmp(cm->counts.uv_mode, zero_counts.uv_mode, - sizeof(cm->counts.uv_mode))); - assert(!memcmp(cm->counts.partition, zero_counts.partition, - sizeof(cm->counts.partition))); - assert(!memcmp(cm->counts.coef, zero_counts.coef, - sizeof(cm->counts.coef))); - assert(!memcmp(cm->counts.eob_branch, zero_counts.eob_branch, - sizeof(cm->counts.eob_branch))); - assert(!memcmp(cm->counts.switchable_interp, zero_counts.switchable_interp, - sizeof(cm->counts.switchable_interp))); - assert(!memcmp(cm->counts.inter_mode, zero_counts.inter_mode, - sizeof(cm->counts.inter_mode))); - assert(!memcmp(cm->counts.intra_inter, zero_counts.intra_inter, - sizeof(cm->counts.intra_inter))); - assert(!memcmp(cm->counts.comp_inter, zero_counts.comp_inter, - sizeof(cm->counts.comp_inter))); - assert(!memcmp(cm->counts.single_ref, zero_counts.single_ref, - sizeof(cm->counts.single_ref))); - assert(!memcmp(cm->counts.comp_ref, zero_counts.comp_ref, - sizeof(cm->counts.comp_ref))); - assert(!memcmp(&cm->counts.tx, &zero_counts.tx, sizeof(cm->counts.tx))); - assert(!memcmp(cm->counts.skip, zero_counts.skip, sizeof(cm->counts.skip))); - assert(!memcmp(&cm->counts.mv, &zero_counts.mv, sizeof(cm->counts.mv))); -} -#endif // NDEBUG - -static struct vp9_read_bit_buffer* init_read_bit_buffer( - VP9Decoder *pbi, - struct vp9_read_bit_buffer *rb, - const uint8_t *data, - const uint8_t *data_end, - uint8_t *clear_data /* buffer size MAX_VP9_HEADER_SIZE */) { - rb->bit_offset = 0; - rb->error_handler = error_handler; - rb->error_handler_data = &pbi->common; - if (pbi->decrypt_cb) { - const int n = (int)MIN(MAX_VP9_HEADER_SIZE, data_end - data); - pbi->decrypt_cb(pbi->decrypt_state, data, clear_data, n); - rb->bit_buffer = clear_data; - rb->bit_buffer_end = clear_data + n; - } else { - rb->bit_buffer = data; - rb->bit_buffer_end = data_end; - } - return rb; -} - -void vp9_decode_frame(VP9Decoder *pbi, - const uint8_t *data, const uint8_t *data_end, - const uint8_t **p_data_end) { - VP9_COMMON *const cm = &pbi->common; - MACROBLOCKD *const xd = &pbi->mb; - struct vp9_read_bit_buffer rb = { NULL, NULL, 0, NULL, 0}; - int context_updated = 0; - uint8_t clear_data[MAX_VP9_HEADER_SIZE]; - const size_t first_partition_size = read_uncompressed_header(pbi, - init_read_bit_buffer(pbi, &rb, data, data_end, clear_data)); - const int tile_rows = 1 << cm->log2_tile_rows; - const int tile_cols = 1 << cm->log2_tile_cols; - YV12_BUFFER_CONFIG *const new_fb = get_frame_new_buffer(cm); - xd->cur_buf = new_fb; - - if (!first_partition_size) { - // showing a frame directly - *p_data_end = data + (cm->profile <= PROFILE_2 ? 1 : 2); - return; - } - - data += vp9_rb_bytes_read(&rb); - if (!read_is_valid(data, first_partition_size, data_end)) - vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, - "Truncated packet or corrupt header length"); - - cm->use_prev_frame_mvs = !cm->error_resilient_mode && - cm->width == cm->last_width && - cm->height == cm->last_height && - !cm->intra_only && - cm->last_show_frame; - - vp9_setup_block_planes(xd, cm->subsampling_x, cm->subsampling_y); - - *cm->fc = cm->frame_contexts[cm->frame_context_idx]; - if (!cm->fc->initialized) - vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, - "Uninitialized entropy context."); - - vp9_zero(cm->counts); - - xd->corrupted = 0; - new_fb->corrupted = read_compressed_header(pbi, data, first_partition_size); - if (new_fb->corrupted) - vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, - "Decode failed. Frame data header is corrupted."); - - if (cm->lf.filter_level) { - vp9_loop_filter_frame_init(cm, cm->lf.filter_level); - } - - // If encoded in frame parallel mode, frame context is ready after decoding - // the frame header. - if (pbi->frame_parallel_decode && cm->frame_parallel_decoding_mode) { - VP9Worker *const worker = pbi->frame_worker_owner; - FrameWorkerData *const frame_worker_data = worker->data1; - if (cm->refresh_frame_context) { - context_updated = 1; - cm->frame_contexts[cm->frame_context_idx] = *cm->fc; - } - vp9_frameworker_lock_stats(worker); - pbi->cur_buf->row = -1; - pbi->cur_buf->col = -1; - frame_worker_data->frame_context_ready = 1; - // Signal the main thread that context is ready. - vp9_frameworker_signal_stats(worker); - vp9_frameworker_unlock_stats(worker); - } - - if (pbi->max_threads > 1 && tile_rows == 1 && tile_cols > 1) { - // Multi-threaded tile decoder - *p_data_end = decode_tiles_mt(pbi, data + first_partition_size, data_end); - if (!xd->corrupted) { - // If multiple threads are used to decode tiles, then we use those threads - // to do parallel loopfiltering. - vp9_loop_filter_frame_mt(new_fb, cm, pbi->mb.plane, cm->lf.filter_level, - 0, 0, pbi->tile_workers, pbi->num_tile_workers, - &pbi->lf_row_sync); - } else { - vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, - "Decode failed. Frame data is corrupted."); - - } - } else { - *p_data_end = decode_tiles(pbi, data + first_partition_size, data_end); - } - - if (!xd->corrupted) { - if (!cm->error_resilient_mode && !cm->frame_parallel_decoding_mode) { - vp9_adapt_coef_probs(cm); - - if (!frame_is_intra_only(cm)) { - vp9_adapt_mode_probs(cm); - vp9_adapt_mv_probs(cm, cm->allow_high_precision_mv); - } - } else { - debug_check_frame_counts(cm); - } - } else { - vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, - "Decode failed. Frame data is corrupted."); - } - - // Non frame parallel update frame context here. - if (cm->refresh_frame_context && !context_updated) - cm->frame_contexts[cm->frame_context_idx] = *cm->fc; -} - -static void build_mc_border(const uint8_t *src, int src_stride, - uint8_t *dst, int dst_stride, - int x, int y, int b_w, int b_h, int w, int h) { - // Get a pointer to the start of the real data for this row. - const uint8_t *ref_row = src - x - y * src_stride; - - if (y >= h) - ref_row += (h - 1) * src_stride; - else if (y > 0) - ref_row += y * src_stride; - - do { - int right = 0, copy; - int left = x < 0 ? -x : 0; - - if (left > b_w) - left = b_w; - - if (x + b_w > w) - right = x + b_w - w; - - if (right > b_w) - right = b_w; - - copy = b_w - left - right; - - if (left) - memset(dst, ref_row[0], left); - - if (copy) - memcpy(dst + left, ref_row + x + left, copy); - - if (right) - memset(dst + left + copy, ref_row[w - 1], right); - - dst += dst_stride; - ++y; - - if (y > 0 && y < h) - ref_row += src_stride; - } while (--b_h); -} - -#if CONFIG_VP9_HIGHBITDEPTH -static void high_build_mc_border(const uint8_t *src8, int src_stride, - uint16_t *dst, int dst_stride, - int x, int y, int b_w, int b_h, - int w, int h) { - // Get a pointer to the start of the real data for this row. - const uint16_t *src = CONVERT_TO_SHORTPTR(src8); - const uint16_t *ref_row = src - x - y * src_stride; - - if (y >= h) - ref_row += (h - 1) * src_stride; - else if (y > 0) - ref_row += y * src_stride; - - do { - int right = 0, copy; - int left = x < 0 ? -x : 0; - - if (left > b_w) - left = b_w; - - if (x + b_w > w) - right = x + b_w - w; - - if (right > b_w) - right = b_w; - - copy = b_w - left - right; - - if (left) - vpx_memset16(dst, ref_row[0], left); - - if (copy) - memcpy(dst + left, ref_row + x + left, copy * sizeof(uint16_t)); - - if (right) - vpx_memset16(dst + left + copy, ref_row[w - 1], right); - - dst += dst_stride; - ++y; - - if (y > 0 && y < h) - ref_row += src_stride; - } while (--b_h); -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -void dec_build_inter_predictors(VP9Decoder *const pbi, MACROBLOCKD *xd, - int plane, int block, int bw, int bh, int x, - int y, int w, int h, int mi_x, int mi_y) { - struct macroblockd_plane *const pd = &xd->plane[plane]; - const MODE_INFO *mi = xd->mi[0].src_mi; - const int is_compound = has_second_ref(&mi->mbmi); - const InterpKernel *kernel = vp9_get_interp_kernel(mi->mbmi.interp_filter); - int ref; - - for (ref = 0; ref < 1 + is_compound; ++ref) { - const struct scale_factors *const sf = &xd->block_refs[ref]->sf; - struct buf_2d *const pre_buf = &pd->pre[ref]; - struct buf_2d *const dst_buf = &pd->dst; - uint8_t *const dst = dst_buf->buf + dst_buf->stride * y + x; - const MV mv = mi->mbmi.sb_type < BLOCK_8X8 - ? average_split_mvs(pd, mi, ref, block) - : mi->mbmi.mv[ref].as_mv; - - const MV mv_q4 = clamp_mv_to_umv_border_sb(xd, &mv, bw, bh, - pd->subsampling_x, - pd->subsampling_y); - - MV32 scaled_mv; - int xs, ys, x0, y0, x0_16, y0_16, y1, frame_width, frame_height, - buf_stride, subpel_x, subpel_y; - uint8_t *ref_frame, *buf_ptr; - const int idx = xd->block_refs[ref]->idx; - BufferPool *const pool = pbi->common.buffer_pool; - RefCntBuffer *const ref_frame_buf = &pool->frame_bufs[idx]; - const int is_scaled = vp9_is_scaled(sf); - - // Get reference frame pointer, width and height. - if (plane == 0) { - frame_width = ref_frame_buf->buf.y_crop_width; - frame_height = ref_frame_buf->buf.y_crop_height; - ref_frame = ref_frame_buf->buf.y_buffer; - } else { - frame_width = ref_frame_buf->buf.uv_crop_width; - frame_height = ref_frame_buf->buf.uv_crop_height; - ref_frame = plane == 1 ? ref_frame_buf->buf.u_buffer - : ref_frame_buf->buf.v_buffer; - } - - if (is_scaled) { - // Co-ordinate of containing block to pixel precision. - int x_start = (-xd->mb_to_left_edge >> (3 + pd->subsampling_x)); - int y_start = (-xd->mb_to_top_edge >> (3 + pd->subsampling_y)); - - // Co-ordinate of the block to 1/16th pixel precision. - x0_16 = (x_start + x) << SUBPEL_BITS; - y0_16 = (y_start + y) << SUBPEL_BITS; - - // Co-ordinate of current block in reference frame - // to 1/16th pixel precision. - x0_16 = sf->scale_value_x(x0_16, sf); - y0_16 = sf->scale_value_y(y0_16, sf); - - // Map the top left corner of the block into the reference frame. - x0 = sf->scale_value_x(x_start + x, sf); - y0 = sf->scale_value_y(y_start + y, sf); - - // Scale the MV and incorporate the sub-pixel offset of the block - // in the reference frame. - scaled_mv = vp9_scale_mv(&mv_q4, mi_x + x, mi_y + y, sf); - xs = sf->x_step_q4; - ys = sf->y_step_q4; - } else { - // Co-ordinate of containing block to pixel precision. - x0 = (-xd->mb_to_left_edge >> (3 + pd->subsampling_x)) + x; - y0 = (-xd->mb_to_top_edge >> (3 + pd->subsampling_y)) + y; - - // Co-ordinate of the block to 1/16th pixel precision. - x0_16 = x0 << SUBPEL_BITS; - y0_16 = y0 << SUBPEL_BITS; - - scaled_mv.row = mv_q4.row; - scaled_mv.col = mv_q4.col; - xs = ys = 16; - } - subpel_x = scaled_mv.col & SUBPEL_MASK; - subpel_y = scaled_mv.row & SUBPEL_MASK; - - // Calculate the top left corner of the best matching block in the - // reference frame. - x0 += scaled_mv.col >> SUBPEL_BITS; - y0 += scaled_mv.row >> SUBPEL_BITS; - x0_16 += scaled_mv.col; - y0_16 += scaled_mv.row; - - // Get reference block pointer. - buf_ptr = ref_frame + y0 * pre_buf->stride + x0; - buf_stride = pre_buf->stride; - - // Get reference block bottom right vertical coordinate. - y1 = ((y0_16 + (h - 1) * ys) >> SUBPEL_BITS) + 1; - - // Do border extension if there is motion or the - // width/height is not a multiple of 8 pixels. - if (is_scaled || scaled_mv.col || scaled_mv.row || - (frame_width & 0x7) || (frame_height & 0x7)) { - // Get reference block bottom right horizontal coordinate. - int x1 = ((x0_16 + (w - 1) * xs) >> SUBPEL_BITS) + 1; - int x_pad = 0, y_pad = 0; - - if (subpel_x || (sf->x_step_q4 != SUBPEL_SHIFTS)) { - x0 -= VP9_INTERP_EXTEND - 1; - x1 += VP9_INTERP_EXTEND; - x_pad = 1; - } - - if (subpel_y || (sf->y_step_q4 != SUBPEL_SHIFTS)) { - y0 -= VP9_INTERP_EXTEND - 1; - y1 += VP9_INTERP_EXTEND; - y_pad = 1; - } - - // Wait until reference block is ready. Pad 7 more pixels as last 7 - // pixels of each superblock row can be changed by next superblock row. - if (pbi->frame_parallel_decode) - vp9_frameworker_wait(pbi->frame_worker_owner, ref_frame_buf, - MAX(0, (y1 + 7) << (plane == 0 ? 0 : 1))); - - // Skip border extension if block is inside the frame. - if (x0 < 0 || x0 > frame_width - 1 || x1 < 0 || x1 > frame_width - 1 || - y0 < 0 || y0 > frame_height - 1 || y1 < 0 || y1 > frame_height - 1) { - uint8_t *buf_ptr1 = ref_frame + y0 * pre_buf->stride + x0; - // Extend the border. -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - high_build_mc_border(buf_ptr1, - pre_buf->stride, - xd->mc_buf_high, - x1 - x0 + 1, - x0, - y0, - x1 - x0 + 1, - y1 - y0 + 1, - frame_width, - frame_height); - buf_stride = x1 - x0 + 1; - buf_ptr = CONVERT_TO_BYTEPTR(xd->mc_buf_high) + - y_pad * 3 * buf_stride + x_pad * 3; - } else { - build_mc_border(buf_ptr1, - pre_buf->stride, - xd->mc_buf, - x1 - x0 + 1, - x0, - y0, - x1 - x0 + 1, - y1 - y0 + 1, - frame_width, - frame_height); - buf_stride = x1 - x0 + 1; - buf_ptr = xd->mc_buf + y_pad * 3 * buf_stride + x_pad * 3; - } -#else - build_mc_border(buf_ptr1, - pre_buf->stride, - xd->mc_buf, - x1 - x0 + 1, - x0, - y0, - x1 - x0 + 1, - y1 - y0 + 1, - frame_width, - frame_height); - buf_stride = x1 - x0 + 1; - buf_ptr = xd->mc_buf + y_pad * 3 * buf_stride + x_pad * 3; -#endif // CONFIG_VP9_HIGHBITDEPTH - } - } else { - // Wait until reference block is ready. Pad 7 more pixels as last 7 - // pixels of each superblock row can be changed by next superblock row. - if (pbi->frame_parallel_decode) - vp9_frameworker_wait(pbi->frame_worker_owner, ref_frame_buf, - MAX(0, (y1 + 7) << (plane == 0 ? 0 : 1))); - } -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - high_inter_predictor(buf_ptr, buf_stride, dst, dst_buf->stride, subpel_x, - subpel_y, sf, w, h, ref, kernel, xs, ys, xd->bd); - } else { - inter_predictor(buf_ptr, buf_stride, dst, dst_buf->stride, subpel_x, - subpel_y, sf, w, h, ref, kernel, xs, ys); - } -#else - inter_predictor(buf_ptr, buf_stride, dst, dst_buf->stride, subpel_x, - subpel_y, sf, w, h, ref, kernel, xs, ys); -#endif // CONFIG_VP9_HIGHBITDEPTH - } -} - -void vp9_dec_build_inter_predictors_sb(VP9Decoder *const pbi, MACROBLOCKD *xd, - int mi_row, int mi_col, - BLOCK_SIZE bsize) { - int plane; - const int mi_x = mi_col * MI_SIZE; - const int mi_y = mi_row * MI_SIZE; - for (plane = 0; plane < MAX_MB_PLANE; ++plane) { - const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, - &xd->plane[plane]); - const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize]; - const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize]; - const int bw = 4 * num_4x4_w; - const int bh = 4 * num_4x4_h; - - if (xd->mi[0].src_mi->mbmi.sb_type < BLOCK_8X8) { - int i = 0, x, y; - assert(bsize == BLOCK_8X8); - for (y = 0; y < num_4x4_h; ++y) - for (x = 0; x < num_4x4_w; ++x) - dec_build_inter_predictors(pbi, xd, plane, i++, bw, bh, - 4 * x, 4 * y, 4, 4, mi_x, mi_y); - } else { - dec_build_inter_predictors(pbi, xd, plane, 0, bw, bh, - 0, 0, bw, bh, mi_x, mi_y); - } - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_decodeframe.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_decodeframe.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_decodeframe.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_decodeframe.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP9_DECODER_VP9_DECODEFRAME_H_ -#define VP9_DECODER_VP9_DECODEFRAME_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -struct VP9Common; -struct VP9Decoder; -struct vp9_read_bit_buffer; - -void vp9_init_dequantizer(struct VP9Common *cm); - -void vp9_decode_frame(struct VP9Decoder *pbi, - const uint8_t *data, const uint8_t *data_end, - const uint8_t **p_data_end); - -int vp9_read_sync_code(struct vp9_read_bit_buffer *const rb); -void vp9_read_frame_size(struct vp9_read_bit_buffer *rb, - int *width, int *height); -BITSTREAM_PROFILE vp9_read_profile(struct vp9_read_bit_buffer *rb); - -void vp9_dec_build_inter_predictors_sb(struct VP9Decoder *const pbi, - MACROBLOCKD *xd, int mi_row, int mi_col, - BLOCK_SIZE bsize); -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_DECODER_VP9_DECODEFRAME_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_decodemv.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_decodemv.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_decodemv.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_decodemv.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,614 +0,0 @@ -/* - Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_entropy.h" -#include "vp9/common/vp9_entropymode.h" -#include "vp9/common/vp9_entropymv.h" -#include "vp9/common/vp9_mvref_common.h" -#include "vp9/common/vp9_pred_common.h" -#include "vp9/common/vp9_reconinter.h" -#include "vp9/common/vp9_seg_common.h" - -#include "vp9/decoder/vp9_decodemv.h" -#include "vp9/decoder/vp9_decodeframe.h" -#include "vp9/decoder/vp9_reader.h" - -static PREDICTION_MODE read_intra_mode(vp9_reader *r, const vp9_prob *p) { - return (PREDICTION_MODE)vp9_read_tree(r, vp9_intra_mode_tree, p); -} - -static PREDICTION_MODE read_intra_mode_y(VP9_COMMON *cm, FRAME_COUNTS *counts, - vp9_reader *r, int size_group) { - const PREDICTION_MODE y_mode = - read_intra_mode(r, cm->fc->y_mode_prob[size_group]); - if (!cm->frame_parallel_decoding_mode) - ++counts->y_mode[size_group][y_mode]; - return y_mode; -} - -static PREDICTION_MODE read_intra_mode_uv(VP9_COMMON *cm, FRAME_COUNTS *counts, - vp9_reader *r, - PREDICTION_MODE y_mode) { - const PREDICTION_MODE uv_mode = read_intra_mode(r, - cm->fc->uv_mode_prob[y_mode]); - if (!cm->frame_parallel_decoding_mode) - ++counts->uv_mode[y_mode][uv_mode]; - return uv_mode; -} - -static PREDICTION_MODE read_inter_mode(VP9_COMMON *cm, FRAME_COUNTS *counts, - vp9_reader *r, int ctx) { - const int mode = vp9_read_tree(r, vp9_inter_mode_tree, - cm->fc->inter_mode_probs[ctx]); - if (!cm->frame_parallel_decoding_mode) - ++counts->inter_mode[ctx][mode]; - - return NEARESTMV + mode; -} - -static int read_segment_id(vp9_reader *r, const struct segmentation *seg) { - return vp9_read_tree(r, vp9_segment_tree, seg->tree_probs); -} - -static TX_SIZE read_selected_tx_size(VP9_COMMON *cm, MACROBLOCKD *xd, - FRAME_COUNTS *counts, - TX_SIZE max_tx_size, vp9_reader *r) { - const int ctx = vp9_get_tx_size_context(xd); - const vp9_prob *tx_probs = get_tx_probs(max_tx_size, ctx, &cm->fc->tx_probs); - int tx_size = vp9_read(r, tx_probs[0]); - if (tx_size != TX_4X4 && max_tx_size >= TX_16X16) { - tx_size += vp9_read(r, tx_probs[1]); - if (tx_size != TX_8X8 && max_tx_size >= TX_32X32) - tx_size += vp9_read(r, tx_probs[2]); - } - - if (!cm->frame_parallel_decoding_mode) - ++get_tx_counts(max_tx_size, ctx, &counts->tx)[tx_size]; - return (TX_SIZE)tx_size; -} - -static TX_SIZE read_tx_size(VP9_COMMON *cm, MACROBLOCKD *xd, - FRAME_COUNTS *counts, - int allow_select, vp9_reader *r) { - TX_MODE tx_mode = cm->tx_mode; - BLOCK_SIZE bsize = xd->mi[0].src_mi->mbmi.sb_type; - const TX_SIZE max_tx_size = max_txsize_lookup[bsize]; - if (allow_select && tx_mode == TX_MODE_SELECT && bsize >= BLOCK_8X8) - return read_selected_tx_size(cm, xd, counts, max_tx_size, r); - else - return MIN(max_tx_size, tx_mode_to_biggest_tx_size[tx_mode]); -} - -static void set_segment_id(VP9_COMMON *cm, BLOCK_SIZE bsize, - int mi_row, int mi_col, int segment_id) { - const int mi_offset = mi_row * cm->mi_cols + mi_col; - const int bw = num_8x8_blocks_wide_lookup[bsize]; - const int bh = num_8x8_blocks_high_lookup[bsize]; - const int xmis = MIN(cm->mi_cols - mi_col, bw); - const int ymis = MIN(cm->mi_rows - mi_row, bh); - int x, y; - - assert(segment_id >= 0 && segment_id < MAX_SEGMENTS); - - for (y = 0; y < ymis; y++) - for (x = 0; x < xmis; x++) - cm->current_frame_seg_map[mi_offset + y * cm->mi_cols + x] = segment_id; -} - -static void copy_segment_id(const VP9_COMMON *cm, - const uint8_t *last_segment_ids, - uint8_t *current_segment_ids, - BLOCK_SIZE bsize, int mi_row, int mi_col) { - const int mi_offset = mi_row * cm->mi_cols + mi_col; - const int bw = num_8x8_blocks_wide_lookup[bsize]; - const int bh = num_8x8_blocks_high_lookup[bsize]; - const int xmis = MIN(cm->mi_cols - mi_col, bw); - const int ymis = MIN(cm->mi_rows - mi_row, bh); - int x, y; - - for (y = 0; y < ymis; y++) - for (x = 0; x < xmis; x++) - current_segment_ids[mi_offset + y * cm->mi_cols + x] = last_segment_ids ? - last_segment_ids[mi_offset + y * cm->mi_cols + x] : 0; -} - -static int read_intra_segment_id(VP9_COMMON *const cm, BLOCK_SIZE bsize, - int mi_row, int mi_col, - vp9_reader *r) { - struct segmentation *const seg = &cm->seg; - int segment_id; - - if (!seg->enabled) - return 0; // Default for disabled segmentation - - if (!seg->update_map) { - copy_segment_id(cm, cm->last_frame_seg_map, cm->current_frame_seg_map, - bsize, mi_row, mi_col); - return 0; - } - - segment_id = read_segment_id(r, seg); - set_segment_id(cm, bsize, mi_row, mi_col, segment_id); - return segment_id; -} - -static int read_inter_segment_id(VP9_COMMON *const cm, MACROBLOCKD *const xd, - int mi_row, int mi_col, vp9_reader *r) { - struct segmentation *const seg = &cm->seg; - MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi; - const BLOCK_SIZE bsize = mbmi->sb_type; - int predicted_segment_id, segment_id; - - if (!seg->enabled) - return 0; // Default for disabled segmentation - - predicted_segment_id = cm->last_frame_seg_map ? - vp9_get_segment_id(cm, cm->last_frame_seg_map, bsize, mi_row, mi_col) : 0; - - if (!seg->update_map) { - copy_segment_id(cm, cm->last_frame_seg_map, cm->current_frame_seg_map, - bsize, mi_row, mi_col); - return predicted_segment_id; - } - - if (seg->temporal_update) { - const vp9_prob pred_prob = vp9_get_pred_prob_seg_id(seg, xd); - mbmi->seg_id_predicted = vp9_read(r, pred_prob); - segment_id = mbmi->seg_id_predicted ? predicted_segment_id - : read_segment_id(r, seg); - } else { - segment_id = read_segment_id(r, seg); - } - set_segment_id(cm, bsize, mi_row, mi_col, segment_id); - return segment_id; -} - -static int read_skip(VP9_COMMON *cm, const MACROBLOCKD *xd, - FRAME_COUNTS *counts, - int segment_id, vp9_reader *r) { - if (vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP)) { - return 1; - } else { - const int ctx = vp9_get_skip_context(xd); - const int skip = vp9_read(r, cm->fc->skip_probs[ctx]); - if (!cm->frame_parallel_decoding_mode) - ++counts->skip[ctx][skip]; - return skip; - } -} - -static void read_intra_frame_mode_info(VP9_COMMON *const cm, - MACROBLOCKD *const xd, - FRAME_COUNTS *counts, - int mi_row, int mi_col, vp9_reader *r) { - MODE_INFO *const mi = xd->mi[0].src_mi; - MB_MODE_INFO *const mbmi = &mi->mbmi; - const MODE_INFO *above_mi = xd->mi[-cm->mi_stride].src_mi; - const MODE_INFO *left_mi = xd->left_available ? xd->mi[-1].src_mi : NULL; - const BLOCK_SIZE bsize = mbmi->sb_type; - int i; - - mbmi->segment_id = read_intra_segment_id(cm, bsize, mi_row, mi_col, r); - mbmi->skip = read_skip(cm, xd, counts, mbmi->segment_id, r); - mbmi->tx_size = read_tx_size(cm, xd, counts, 1, r); - mbmi->ref_frame[0] = INTRA_FRAME; - mbmi->ref_frame[1] = NONE; - - switch (bsize) { - case BLOCK_4X4: - for (i = 0; i < 4; ++i) - mi->bmi[i].as_mode = - read_intra_mode(r, get_y_mode_probs(mi, above_mi, left_mi, i)); - mbmi->mode = mi->bmi[3].as_mode; - break; - case BLOCK_4X8: - mi->bmi[0].as_mode = mi->bmi[2].as_mode = - read_intra_mode(r, get_y_mode_probs(mi, above_mi, left_mi, 0)); - mi->bmi[1].as_mode = mi->bmi[3].as_mode = mbmi->mode = - read_intra_mode(r, get_y_mode_probs(mi, above_mi, left_mi, 1)); - break; - case BLOCK_8X4: - mi->bmi[0].as_mode = mi->bmi[1].as_mode = - read_intra_mode(r, get_y_mode_probs(mi, above_mi, left_mi, 0)); - mi->bmi[2].as_mode = mi->bmi[3].as_mode = mbmi->mode = - read_intra_mode(r, get_y_mode_probs(mi, above_mi, left_mi, 2)); - break; - default: - mbmi->mode = read_intra_mode(r, - get_y_mode_probs(mi, above_mi, left_mi, 0)); - } - - mbmi->uv_mode = read_intra_mode(r, vp9_kf_uv_mode_prob[mbmi->mode]); -} - -static int read_mv_component(vp9_reader *r, - const nmv_component *mvcomp, int usehp) { - int mag, d, fr, hp; - const int sign = vp9_read(r, mvcomp->sign); - const int mv_class = vp9_read_tree(r, vp9_mv_class_tree, mvcomp->classes); - const int class0 = mv_class == MV_CLASS_0; - - // Integer part - if (class0) { - d = vp9_read_tree(r, vp9_mv_class0_tree, mvcomp->class0); - } else { - int i; - const int n = mv_class + CLASS0_BITS - 1; // number of bits - - d = 0; - for (i = 0; i < n; ++i) - d |= vp9_read(r, mvcomp->bits[i]) << i; - } - - // Fractional part - fr = vp9_read_tree(r, vp9_mv_fp_tree, class0 ? mvcomp->class0_fp[d] - : mvcomp->fp); - - // High precision part (if hp is not used, the default value of the hp is 1) - hp = usehp ? vp9_read(r, class0 ? mvcomp->class0_hp : mvcomp->hp) - : 1; - - // Result - mag = vp9_get_mv_mag(mv_class, (d << 3) | (fr << 1) | hp) + 1; - return sign ? -mag : mag; -} - -static INLINE void read_mv(vp9_reader *r, MV *mv, const MV *ref, - const nmv_context *ctx, - nmv_context_counts *counts, int allow_hp) { - const MV_JOINT_TYPE joint_type = - (MV_JOINT_TYPE)vp9_read_tree(r, vp9_mv_joint_tree, ctx->joints); - const int use_hp = allow_hp && vp9_use_mv_hp(ref); - MV diff = {0, 0}; - - if (mv_joint_vertical(joint_type)) - diff.row = read_mv_component(r, &ctx->comps[0], use_hp); - - if (mv_joint_horizontal(joint_type)) - diff.col = read_mv_component(r, &ctx->comps[1], use_hp); - - vp9_inc_mv(&diff, counts); - - mv->row = ref->row + diff.row; - mv->col = ref->col + diff.col; -} - -static REFERENCE_MODE read_block_reference_mode(VP9_COMMON *cm, - const MACROBLOCKD *xd, - FRAME_COUNTS *counts, - vp9_reader *r) { - if (cm->reference_mode == REFERENCE_MODE_SELECT) { - const int ctx = vp9_get_reference_mode_context(cm, xd); - const REFERENCE_MODE mode = - (REFERENCE_MODE)vp9_read(r, cm->fc->comp_inter_prob[ctx]); - if (!cm->frame_parallel_decoding_mode) - ++counts->comp_inter[ctx][mode]; - return mode; // SINGLE_REFERENCE or COMPOUND_REFERENCE - } else { - return cm->reference_mode; - } -} - -// Read the referncence frame -static void read_ref_frames(VP9_COMMON *const cm, MACROBLOCKD *const xd, - FRAME_COUNTS *counts, vp9_reader *r, - int segment_id, MV_REFERENCE_FRAME ref_frame[2]) { - FRAME_CONTEXT *const fc = cm->fc; - - if (vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME)) { - ref_frame[0] = (MV_REFERENCE_FRAME)vp9_get_segdata(&cm->seg, segment_id, - SEG_LVL_REF_FRAME); - ref_frame[1] = NONE; - } else { - const REFERENCE_MODE mode = read_block_reference_mode(cm, xd, counts, r); - // FIXME(rbultje) I'm pretty sure this breaks segmentation ref frame coding - if (mode == COMPOUND_REFERENCE) { - const int idx = cm->ref_frame_sign_bias[cm->comp_fixed_ref]; - const int ctx = vp9_get_pred_context_comp_ref_p(cm, xd); - const int bit = vp9_read(r, fc->comp_ref_prob[ctx]); - if (!cm->frame_parallel_decoding_mode) - ++counts->comp_ref[ctx][bit]; - ref_frame[idx] = cm->comp_fixed_ref; - ref_frame[!idx] = cm->comp_var_ref[bit]; - } else if (mode == SINGLE_REFERENCE) { - const int ctx0 = vp9_get_pred_context_single_ref_p1(xd); - const int bit0 = vp9_read(r, fc->single_ref_prob[ctx0][0]); - if (!cm->frame_parallel_decoding_mode) - ++counts->single_ref[ctx0][0][bit0]; - if (bit0) { - const int ctx1 = vp9_get_pred_context_single_ref_p2(xd); - const int bit1 = vp9_read(r, fc->single_ref_prob[ctx1][1]); - if (!cm->frame_parallel_decoding_mode) - ++counts->single_ref[ctx1][1][bit1]; - ref_frame[0] = bit1 ? ALTREF_FRAME : GOLDEN_FRAME; - } else { - ref_frame[0] = LAST_FRAME; - } - - ref_frame[1] = NONE; - } else { - assert(0 && "Invalid prediction mode."); - } - } -} - - -static INLINE INTERP_FILTER read_switchable_interp_filter( - VP9_COMMON *const cm, MACROBLOCKD *const xd, - FRAME_COUNTS *counts, vp9_reader *r) { - const int ctx = vp9_get_pred_context_switchable_interp(xd); - const INTERP_FILTER type = - (INTERP_FILTER)vp9_read_tree(r, vp9_switchable_interp_tree, - cm->fc->switchable_interp_prob[ctx]); - if (!cm->frame_parallel_decoding_mode) - ++counts->switchable_interp[ctx][type]; - return type; -} - -static void read_intra_block_mode_info(VP9_COMMON *const cm, - FRAME_COUNTS *counts, MODE_INFO *mi, - vp9_reader *r) { - MB_MODE_INFO *const mbmi = &mi->mbmi; - const BLOCK_SIZE bsize = mi->mbmi.sb_type; - int i; - - mbmi->ref_frame[0] = INTRA_FRAME; - mbmi->ref_frame[1] = NONE; - - switch (bsize) { - case BLOCK_4X4: - for (i = 0; i < 4; ++i) - mi->bmi[i].as_mode = read_intra_mode_y(cm, counts, r, 0); - mbmi->mode = mi->bmi[3].as_mode; - break; - case BLOCK_4X8: - mi->bmi[0].as_mode = mi->bmi[2].as_mode = read_intra_mode_y(cm, counts, - r, 0); - mi->bmi[1].as_mode = mi->bmi[3].as_mode = mbmi->mode = - read_intra_mode_y(cm, counts, r, 0); - break; - case BLOCK_8X4: - mi->bmi[0].as_mode = mi->bmi[1].as_mode = read_intra_mode_y(cm, counts, - r, 0); - mi->bmi[2].as_mode = mi->bmi[3].as_mode = mbmi->mode = - read_intra_mode_y(cm, counts, r, 0); - break; - default: - mbmi->mode = read_intra_mode_y(cm, counts, r, size_group_lookup[bsize]); - } - - mbmi->uv_mode = read_intra_mode_uv(cm, counts, r, mbmi->mode); -} - -static INLINE int is_mv_valid(const MV *mv) { - return mv->row > MV_LOW && mv->row < MV_UPP && - mv->col > MV_LOW && mv->col < MV_UPP; -} - -static INLINE int assign_mv(VP9_COMMON *cm, FRAME_COUNTS *counts, - PREDICTION_MODE mode, - int_mv mv[2], int_mv ref_mv[2], - int_mv nearest_mv[2], int_mv near_mv[2], - int is_compound, int allow_hp, vp9_reader *r) { - int i; - int ret = 1; - - switch (mode) { - case NEWMV: { - nmv_context_counts *const mv_counts = cm->frame_parallel_decoding_mode ? - NULL : &counts->mv; - for (i = 0; i < 1 + is_compound; ++i) { - read_mv(r, &mv[i].as_mv, &ref_mv[i].as_mv, &cm->fc->nmvc, mv_counts, - allow_hp); - ret = ret && is_mv_valid(&mv[i].as_mv); - } - break; - } - case NEARESTMV: { - mv[0].as_int = nearest_mv[0].as_int; - if (is_compound) - mv[1].as_int = nearest_mv[1].as_int; - break; - } - case NEARMV: { - mv[0].as_int = near_mv[0].as_int; - if (is_compound) - mv[1].as_int = near_mv[1].as_int; - break; - } - case ZEROMV: { - mv[0].as_int = 0; - if (is_compound) - mv[1].as_int = 0; - break; - } - default: { - return 0; - } - } - return ret; -} - -static int read_is_inter_block(VP9_COMMON *const cm, MACROBLOCKD *const xd, - FRAME_COUNTS *counts, - int segment_id, vp9_reader *r) { - if (vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME)) { - return vp9_get_segdata(&cm->seg, segment_id, SEG_LVL_REF_FRAME) != - INTRA_FRAME; - } else { - const int ctx = vp9_get_intra_inter_context(xd); - const int is_inter = vp9_read(r, cm->fc->intra_inter_prob[ctx]); - if (!cm->frame_parallel_decoding_mode) - ++counts->intra_inter[ctx][is_inter]; - return is_inter; - } -} - -static void fpm_sync(void *const data, int mi_row) { - VP9Decoder *const pbi = (VP9Decoder *)data; - vp9_frameworker_wait(pbi->frame_worker_owner, pbi->common.prev_frame, - mi_row << MI_BLOCK_SIZE_LOG2); -} - -static void read_inter_block_mode_info(VP9Decoder *const pbi, - MACROBLOCKD *const xd, - FRAME_COUNTS *counts, - const TileInfo *const tile, - MODE_INFO *const mi, - int mi_row, int mi_col, vp9_reader *r) { - VP9_COMMON *const cm = &pbi->common; - MB_MODE_INFO *const mbmi = &mi->mbmi; - const BLOCK_SIZE bsize = mbmi->sb_type; - const int allow_hp = cm->allow_high_precision_mv; - int_mv nearestmv[2], nearmv[2]; - int inter_mode_ctx, ref, is_compound; - - read_ref_frames(cm, xd, counts, r, mbmi->segment_id, mbmi->ref_frame); - is_compound = has_second_ref(mbmi); - - for (ref = 0; ref < 1 + is_compound; ++ref) { - const MV_REFERENCE_FRAME frame = mbmi->ref_frame[ref]; - RefBuffer *ref_buf = &cm->frame_refs[frame - LAST_FRAME]; - xd->block_refs[ref] = ref_buf; - if ((!vp9_is_valid_scale(&ref_buf->sf))) - vpx_internal_error(xd->error_info, VPX_CODEC_UNSUP_BITSTREAM, - "Reference frame has invalid dimensions"); - vp9_setup_pre_planes(xd, ref, ref_buf->buf, mi_row, mi_col, - &ref_buf->sf); - vp9_find_mv_refs(cm, xd, tile, mi, frame, mbmi->ref_mvs[frame], - mi_row, mi_col, fpm_sync, (void *)pbi); - } - - inter_mode_ctx = mbmi->mode_context[mbmi->ref_frame[0]]; - - if (vp9_segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP)) { - mbmi->mode = ZEROMV; - if (bsize < BLOCK_8X8) { - vpx_internal_error(xd->error_info, VPX_CODEC_UNSUP_BITSTREAM, - "Invalid usage of segement feature on small blocks"); - return; - } - } else { - if (bsize >= BLOCK_8X8) - mbmi->mode = read_inter_mode(cm, counts, r, inter_mode_ctx); - } - - if (bsize < BLOCK_8X8 || mbmi->mode != ZEROMV) { - for (ref = 0; ref < 1 + is_compound; ++ref) { - vp9_find_best_ref_mvs(xd, allow_hp, mbmi->ref_mvs[mbmi->ref_frame[ref]], - &nearestmv[ref], &nearmv[ref]); - } - } - - mbmi->interp_filter = (cm->interp_filter == SWITCHABLE) - ? read_switchable_interp_filter(cm, xd, counts, r) - : cm->interp_filter; - - if (bsize < BLOCK_8X8) { - const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize]; // 1 or 2 - const int num_4x4_h = num_4x4_blocks_high_lookup[bsize]; // 1 or 2 - int idx, idy; - PREDICTION_MODE b_mode; - int_mv nearest_sub8x8[2], near_sub8x8[2]; - for (idy = 0; idy < 2; idy += num_4x4_h) { - for (idx = 0; idx < 2; idx += num_4x4_w) { - int_mv block[2]; - const int j = idy * 2 + idx; - b_mode = read_inter_mode(cm, counts, r, inter_mode_ctx); - - if (b_mode == NEARESTMV || b_mode == NEARMV) - for (ref = 0; ref < 1 + is_compound; ++ref) - vp9_append_sub8x8_mvs_for_idx(cm, xd, tile, j, ref, mi_row, mi_col, - &nearest_sub8x8[ref], - &near_sub8x8[ref]); - - if (!assign_mv(cm, counts, b_mode, block, nearestmv, - nearest_sub8x8, near_sub8x8, - is_compound, allow_hp, r)) { - xd->corrupted |= 1; - break; - }; - - mi->bmi[j].as_mv[0].as_int = block[0].as_int; - if (is_compound) - mi->bmi[j].as_mv[1].as_int = block[1].as_int; - - if (num_4x4_h == 2) - mi->bmi[j + 2] = mi->bmi[j]; - if (num_4x4_w == 2) - mi->bmi[j + 1] = mi->bmi[j]; - } - } - - mi->mbmi.mode = b_mode; - - mbmi->mv[0].as_int = mi->bmi[3].as_mv[0].as_int; - mbmi->mv[1].as_int = mi->bmi[3].as_mv[1].as_int; - } else { - xd->corrupted |= !assign_mv(cm, counts, mbmi->mode, mbmi->mv, nearestmv, - nearestmv, nearmv, is_compound, allow_hp, r); - } -} - -static void read_inter_frame_mode_info(VP9Decoder *const pbi, - MACROBLOCKD *const xd, - FRAME_COUNTS *counts, - const TileInfo *const tile, - int mi_row, int mi_col, vp9_reader *r) { - VP9_COMMON *const cm = &pbi->common; - MODE_INFO *const mi = xd->mi[0].src_mi; - MB_MODE_INFO *const mbmi = &mi->mbmi; - int inter_block; - - mbmi->mv[0].as_int = 0; - mbmi->mv[1].as_int = 0; - mbmi->segment_id = read_inter_segment_id(cm, xd, mi_row, mi_col, r); - mbmi->skip = read_skip(cm, xd, counts, mbmi->segment_id, r); - inter_block = read_is_inter_block(cm, xd, counts, mbmi->segment_id, r); - mbmi->tx_size = read_tx_size(cm, xd, counts, !mbmi->skip || !inter_block, r); - - if (inter_block) - read_inter_block_mode_info(pbi, xd, counts, tile, mi, mi_row, mi_col, r); - else - read_intra_block_mode_info(cm, counts, mi, r); -} - -void vp9_read_mode_info(VP9Decoder *const pbi, MACROBLOCKD *xd, - FRAME_COUNTS *counts, - const TileInfo *const tile, - int mi_row, int mi_col, vp9_reader *r) { - VP9_COMMON *const cm = &pbi->common; - MODE_INFO *const mi = xd->mi[0].src_mi; - const int bw = num_8x8_blocks_wide_lookup[mi->mbmi.sb_type]; - const int bh = num_8x8_blocks_high_lookup[mi->mbmi.sb_type]; - const int x_mis = MIN(bw, cm->mi_cols - mi_col); - const int y_mis = MIN(bh, cm->mi_rows - mi_row); - MV_REF* frame_mvs = cm->cur_frame->mvs + mi_row * cm->mi_cols + mi_col; - int w, h; - - if (frame_is_intra_only(cm)) - read_intra_frame_mode_info(cm, xd, counts, mi_row, mi_col, r); - else - read_inter_frame_mode_info(pbi, xd, counts, tile, mi_row, mi_col, r); - - for (h = 0; h < y_mis; ++h) { - MV_REF *const frame_mv = frame_mvs + h * cm->mi_cols; - for (w = 0; w < x_mis; ++w) { - MV_REF *const mv = frame_mv + w; - mv->ref_frame[0] = mi->src_mi->mbmi.ref_frame[0]; - mv->ref_frame[1] = mi->src_mi->mbmi.ref_frame[1]; - mv->mv[0].as_int = mi->src_mi->mbmi.mv[0].as_int; - mv->mv[1].as_int = mi->src_mi->mbmi.mv[1].as_int; - } - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_decodemv.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_decodemv.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_decodemv.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_decodemv.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_DECODER_VP9_DECODEMV_H_ -#define VP9_DECODER_VP9_DECODEMV_H_ - -#include "vp9/decoder/vp9_decoder.h" -#include "vp9/decoder/vp9_reader.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct TileInfo; - -void vp9_read_mode_info(VP9Decoder *const pbi, MACROBLOCKD *xd, - FRAME_COUNTS *counts, - const struct TileInfo *const tile, - int mi_row, int mi_col, vp9_reader *r); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_DECODER_VP9_DECODEMV_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_decoder.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_decoder.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_decoder.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_decoder.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,492 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include - -#include "./vpx_scale_rtcd.h" - -#include "vpx_mem/vpx_mem.h" -#include "vpx_ports/vpx_once.h" -#include "vpx_ports/vpx_timer.h" -#include "vpx_scale/vpx_scale.h" - -#include "vp9/common/vp9_alloccommon.h" -#include "vp9/common/vp9_loopfilter.h" -#include "vp9/common/vp9_onyxc_int.h" -#if CONFIG_VP9_POSTPROC -#include "vp9/common/vp9_postproc.h" -#endif -#include "vp9/common/vp9_quant_common.h" -#include "vp9/common/vp9_reconintra.h" -#include "vp9/common/vp9_systemdependent.h" -#include "vp9/common/vp9_thread.h" - -#include "vp9/decoder/vp9_decodeframe.h" -#include "vp9/decoder/vp9_decoder.h" -#include "vp9/decoder/vp9_detokenize.h" - -static void initialize_dec(void) { - static volatile int init_done = 0; - - if (!init_done) { - vp9_rtcd(); - vp9_init_intra_predictors(); - init_done = 1; - } -} - -static void vp9_dec_setup_mi(VP9_COMMON *cm) { - cm->mi = cm->mip + cm->mi_stride + 1; - vpx_memset(cm->mip, 0, cm->mi_stride * (cm->mi_rows + 1) * sizeof(*cm->mip)); -} - -static int vp9_dec_alloc_mi(VP9_COMMON *cm, int mi_size) { - cm->mip = vpx_calloc(mi_size, sizeof(*cm->mip)); - if (!cm->mip) - return 1; - cm->mi_alloc_size = mi_size; - return 0; -} - -static void vp9_dec_free_mi(VP9_COMMON *cm) { - vpx_free(cm->mip); - cm->mip = NULL; -} - -VP9Decoder *vp9_decoder_create(BufferPool *const pool) { - VP9Decoder *volatile const pbi = vpx_memalign(32, sizeof(*pbi)); - VP9_COMMON *volatile const cm = pbi ? &pbi->common : NULL; - - if (!cm) - return NULL; - - vp9_zero(*pbi); - - if (setjmp(cm->error.jmp)) { - cm->error.setjmp = 0; - vp9_decoder_remove(pbi); - return NULL; - } - - cm->error.setjmp = 1; - - CHECK_MEM_ERROR(cm, cm->fc, - (FRAME_CONTEXT *)vpx_calloc(1, sizeof(*cm->fc))); - CHECK_MEM_ERROR(cm, cm->frame_contexts, - (FRAME_CONTEXT *)vpx_calloc(FRAME_CONTEXTS, - sizeof(*cm->frame_contexts))); - - pbi->need_resync = 1; - once(initialize_dec); - - // Initialize the references to not point to any frame buffers. - vpx_memset(&cm->ref_frame_map, -1, sizeof(cm->ref_frame_map)); - vpx_memset(&cm->next_ref_frame_map, -1, sizeof(cm->next_ref_frame_map)); - - cm->current_video_frame = 0; - pbi->ready_for_new_data = 1; - pbi->common.buffer_pool = pool; - - cm->bit_depth = VPX_BITS_8; - cm->dequant_bit_depth = VPX_BITS_8; - - cm->alloc_mi = vp9_dec_alloc_mi; - cm->free_mi = vp9_dec_free_mi; - cm->setup_mi = vp9_dec_setup_mi; - - vp9_loop_filter_init(cm); - - cm->error.setjmp = 0; - - vp9_get_worker_interface()->init(&pbi->lf_worker); - - return pbi; -} - -void vp9_decoder_remove(VP9Decoder *pbi) { - int i; - - vp9_get_worker_interface()->end(&pbi->lf_worker); - vpx_free(pbi->lf_worker.data1); - vpx_free(pbi->tile_data); - for (i = 0; i < pbi->num_tile_workers; ++i) { - VP9Worker *const worker = &pbi->tile_workers[i]; - vp9_get_worker_interface()->end(worker); - } - vpx_free(pbi->tile_worker_data); - vpx_free(pbi->tile_worker_info); - vpx_free(pbi->tile_workers); - - if (pbi->num_tile_workers > 0) { - vp9_loop_filter_dealloc(&pbi->lf_row_sync); - } - - vpx_free(pbi); -} - -static int equal_dimensions(const YV12_BUFFER_CONFIG *a, - const YV12_BUFFER_CONFIG *b) { - return a->y_height == b->y_height && a->y_width == b->y_width && - a->uv_height == b->uv_height && a->uv_width == b->uv_width; -} - -vpx_codec_err_t vp9_copy_reference_dec(VP9Decoder *pbi, - VP9_REFFRAME ref_frame_flag, - YV12_BUFFER_CONFIG *sd) { - VP9_COMMON *cm = &pbi->common; - - /* TODO(jkoleszar): The decoder doesn't have any real knowledge of what the - * encoder is using the frame buffers for. This is just a stub to keep the - * vpxenc --test-decode functionality working, and will be replaced in a - * later commit that adds VP9-specific controls for this functionality. - */ - if (ref_frame_flag == VP9_LAST_FLAG) { - const YV12_BUFFER_CONFIG *const cfg = get_ref_frame(cm, 0); - if (cfg == NULL) { - vpx_internal_error(&cm->error, VPX_CODEC_ERROR, - "No 'last' reference frame"); - return VPX_CODEC_ERROR; - } - if (!equal_dimensions(cfg, sd)) - vpx_internal_error(&cm->error, VPX_CODEC_ERROR, - "Incorrect buffer dimensions"); - else - vp8_yv12_copy_frame(cfg, sd); - } else { - vpx_internal_error(&cm->error, VPX_CODEC_ERROR, - "Invalid reference frame"); - } - - return cm->error.error_code; -} - - -vpx_codec_err_t vp9_set_reference_dec(VP9_COMMON *cm, - VP9_REFFRAME ref_frame_flag, - YV12_BUFFER_CONFIG *sd) { - RefBuffer *ref_buf = NULL; - RefCntBuffer *const frame_bufs = cm->buffer_pool->frame_bufs; - - // TODO(jkoleszar): The decoder doesn't have any real knowledge of what the - // encoder is using the frame buffers for. This is just a stub to keep the - // vpxenc --test-decode functionality working, and will be replaced in a - // later commit that adds VP9-specific controls for this functionality. - if (ref_frame_flag == VP9_LAST_FLAG) { - ref_buf = &cm->frame_refs[0]; - } else if (ref_frame_flag == VP9_GOLD_FLAG) { - ref_buf = &cm->frame_refs[1]; - } else if (ref_frame_flag == VP9_ALT_FLAG) { - ref_buf = &cm->frame_refs[2]; - } else { - vpx_internal_error(&cm->error, VPX_CODEC_ERROR, - "Invalid reference frame"); - return cm->error.error_code; - } - - if (!equal_dimensions(ref_buf->buf, sd)) { - vpx_internal_error(&cm->error, VPX_CODEC_ERROR, - "Incorrect buffer dimensions"); - } else { - int *ref_fb_ptr = &ref_buf->idx; - - // Find an empty frame buffer. - const int free_fb = get_free_fb(cm); - // Decrease ref_count since it will be increased again in - // ref_cnt_fb() below. - --frame_bufs[free_fb].ref_count; - - // Manage the reference counters and copy image. - ref_cnt_fb(frame_bufs, ref_fb_ptr, free_fb); - ref_buf->buf = &frame_bufs[*ref_fb_ptr].buf; - vp8_yv12_copy_frame(sd, ref_buf->buf); - } - - return cm->error.error_code; -} - -/* If any buffer updating is signaled it should be done here. */ -static void swap_frame_buffers(VP9Decoder *pbi) { - int ref_index = 0, mask; - VP9_COMMON *const cm = &pbi->common; - BufferPool *const pool = cm->buffer_pool; - RefCntBuffer *const frame_bufs = cm->buffer_pool->frame_bufs; - - lock_buffer_pool(pool); - for (mask = pbi->refresh_frame_flags; mask; mask >>= 1) { - const int old_idx = cm->ref_frame_map[ref_index]; - // Current thread releases the holding of reference frame. - decrease_ref_count(old_idx, frame_bufs, pool); - - // Release the reference frame in reference map. - if ((mask & 1) && old_idx >= 0) { - decrease_ref_count(old_idx, frame_bufs, pool); - } - cm->ref_frame_map[ref_index] = cm->next_ref_frame_map[ref_index]; - ++ref_index; - } - - // Current thread releases the holding of reference frame. - for (; ref_index < REF_FRAMES && !cm->show_existing_frame; ++ref_index) { - const int old_idx = cm->ref_frame_map[ref_index]; - decrease_ref_count(old_idx, frame_bufs, pool); - cm->ref_frame_map[ref_index] = cm->next_ref_frame_map[ref_index]; - } - unlock_buffer_pool(pool); - pbi->hold_ref_buf = 0; - cm->frame_to_show = get_frame_new_buffer(cm); - - if (!pbi->frame_parallel_decode || !cm->show_frame) { - lock_buffer_pool(pool); - --frame_bufs[cm->new_fb_idx].ref_count; - unlock_buffer_pool(pool); - } - - // Invalidate these references until the next frame starts. - for (ref_index = 0; ref_index < 3; ref_index++) - cm->frame_refs[ref_index].idx = -1; -} - -int vp9_receive_compressed_data(VP9Decoder *pbi, - size_t size, const uint8_t **psource) { - VP9_COMMON *volatile const cm = &pbi->common; - BufferPool *volatile const pool = cm->buffer_pool; - RefCntBuffer *volatile const frame_bufs = cm->buffer_pool->frame_bufs; - const uint8_t *source = *psource; - int retcode = 0; - cm->error.error_code = VPX_CODEC_OK; - - if (size == 0) { - // This is used to signal that we are missing frames. - // We do not know if the missing frame(s) was supposed to update - // any of the reference buffers, but we act conservative and - // mark only the last buffer as corrupted. - // - // TODO(jkoleszar): Error concealment is undefined and non-normative - // at this point, but if it becomes so, [0] may not always be the correct - // thing to do here. - if (cm->frame_refs[0].idx > 0) { - assert(cm->frame_refs[0].buf != NULL); - cm->frame_refs[0].buf->corrupted = 1; - } - } - - pbi->ready_for_new_data = 0; - - // Check if the previous frame was a frame without any references to it. - // Release frame buffer if not decoding in frame parallel mode. - if (!pbi->frame_parallel_decode && cm->new_fb_idx >= 0 - && frame_bufs[cm->new_fb_idx].ref_count == 0) - pool->release_fb_cb(pool->cb_priv, - &frame_bufs[cm->new_fb_idx].raw_frame_buffer); - cm->new_fb_idx = get_free_fb(cm); - - // Assign a MV array to the frame buffer. - cm->cur_frame = &pool->frame_bufs[cm->new_fb_idx]; - - pbi->hold_ref_buf = 0; - if (pbi->frame_parallel_decode) { - VP9Worker *const worker = pbi->frame_worker_owner; - vp9_frameworker_lock_stats(worker); - frame_bufs[cm->new_fb_idx].frame_worker_owner = worker; - // Reset decoding progress. - pbi->cur_buf = &frame_bufs[cm->new_fb_idx]; - pbi->cur_buf->row = -1; - pbi->cur_buf->col = -1; - vp9_frameworker_unlock_stats(worker); - } else { - pbi->cur_buf = &frame_bufs[cm->new_fb_idx]; - } - - - if (setjmp(cm->error.jmp)) { - const VP9WorkerInterface *const winterface = vp9_get_worker_interface(); - int i; - - cm->error.setjmp = 0; - pbi->ready_for_new_data = 1; - - // Synchronize all threads immediately as a subsequent decode call may - // cause a resize invalidating some allocations. - winterface->sync(&pbi->lf_worker); - for (i = 0; i < pbi->num_tile_workers; ++i) { - winterface->sync(&pbi->tile_workers[i]); - } - - lock_buffer_pool(pool); - // Release all the reference buffers if worker thread is holding them. - if (pbi->hold_ref_buf == 1) { - int ref_index = 0, mask; - for (mask = pbi->refresh_frame_flags; mask; mask >>= 1) { - const int old_idx = cm->ref_frame_map[ref_index]; - // Current thread releases the holding of reference frame. - decrease_ref_count(old_idx, frame_bufs, pool); - - // Release the reference frame in reference map. - if ((mask & 1) && old_idx >= 0) { - decrease_ref_count(old_idx, frame_bufs, pool); - } - ++ref_index; - } - - // Current thread releases the holding of reference frame. - for (; ref_index < REF_FRAMES && !cm->show_existing_frame; ++ref_index) { - const int old_idx = cm->ref_frame_map[ref_index]; - decrease_ref_count(old_idx, frame_bufs, pool); - } - pbi->hold_ref_buf = 0; - } - // Release current frame. - decrease_ref_count(cm->new_fb_idx, frame_bufs, pool); - unlock_buffer_pool(pool); - - vp9_clear_system_state(); - return -1; - } - - cm->error.setjmp = 1; - vp9_decode_frame(pbi, source, source + size, psource); - - swap_frame_buffers(pbi); - - vp9_clear_system_state(); - - if (!cm->show_existing_frame) { - cm->last_show_frame = cm->show_frame; - cm->prev_frame = cm->cur_frame; - if (cm->seg.enabled && !pbi->frame_parallel_decode) - vp9_swap_current_and_last_seg_map(cm); - } - - // Update progress in frame parallel decode. - if (pbi->frame_parallel_decode) { - // Need to lock the mutex here as another thread may - // be accessing this buffer. - VP9Worker *const worker = pbi->frame_worker_owner; - FrameWorkerData *const frame_worker_data = worker->data1; - vp9_frameworker_lock_stats(worker); - - if (cm->show_frame) { - cm->current_video_frame++; - } - frame_worker_data->frame_decoded = 1; - frame_worker_data->frame_context_ready = 1; - vp9_frameworker_signal_stats(worker); - vp9_frameworker_unlock_stats(worker); - } else { - cm->last_width = cm->width; - cm->last_height = cm->height; - if (cm->show_frame) { - cm->current_video_frame++; - } - } - - cm->error.setjmp = 0; - return retcode; -} - -int vp9_get_raw_frame(VP9Decoder *pbi, YV12_BUFFER_CONFIG *sd, - vp9_ppflags_t *flags) { - VP9_COMMON *const cm = &pbi->common; - int ret = -1; -#if !CONFIG_VP9_POSTPROC - (void)*flags; -#endif - - if (pbi->ready_for_new_data == 1) - return ret; - - pbi->ready_for_new_data = 1; - - /* no raw frame to show!!! */ - if (!cm->show_frame) - return ret; - - pbi->ready_for_new_data = 1; - -#if CONFIG_VP9_POSTPROC - if (!cm->show_existing_frame) { - ret = vp9_post_proc_frame(cm, sd, flags); - } else { - *sd = *cm->frame_to_show; - ret = 0; - } -#else - *sd = *cm->frame_to_show; - ret = 0; -#endif /*!CONFIG_POSTPROC*/ - vp9_clear_system_state(); - return ret; -} - -vpx_codec_err_t vp9_parse_superframe_index(const uint8_t *data, - size_t data_sz, - uint32_t sizes[8], int *count, - vpx_decrypt_cb decrypt_cb, - void *decrypt_state) { - // A chunk ending with a byte matching 0xc0 is an invalid chunk unless - // it is a super frame index. If the last byte of real video compression - // data is 0xc0 the encoder must add a 0 byte. If we have the marker but - // not the associated matching marker byte at the front of the index we have - // an invalid bitstream and need to return an error. - - uint8_t marker; - - assert(data_sz); - marker = read_marker(decrypt_cb, decrypt_state, data + data_sz - 1); - *count = 0; - - if ((marker & 0xe0) == 0xc0) { - const uint32_t frames = (marker & 0x7) + 1; - const uint32_t mag = ((marker >> 3) & 0x3) + 1; - const size_t index_sz = 2 + mag * frames; - - // This chunk is marked as having a superframe index but doesn't have - // enough data for it, thus it's an invalid superframe index. - if (data_sz < index_sz) - return VPX_CODEC_CORRUPT_FRAME; - - { - const uint8_t marker2 = read_marker(decrypt_cb, decrypt_state, - data + data_sz - index_sz); - - // This chunk is marked as having a superframe index but doesn't have - // the matching marker byte at the front of the index therefore it's an - // invalid chunk. - if (marker != marker2) - return VPX_CODEC_CORRUPT_FRAME; - } - - { - // Found a valid superframe index. - uint32_t i, j; - const uint8_t *x = &data[data_sz - index_sz + 1]; - - // Frames has a maximum of 8 and mag has a maximum of 4. - uint8_t clear_buffer[32]; - assert(sizeof(clear_buffer) >= frames * mag); - if (decrypt_cb) { - decrypt_cb(decrypt_state, x, clear_buffer, frames * mag); - x = clear_buffer; - } - - for (i = 0; i < frames; ++i) { - uint32_t this_sz = 0; - - for (j = 0; j < mag; ++j) - this_sz |= (*x++) << (j * 8); - sizes[i] = this_sz; - } - *count = frames; - } - } - return VPX_CODEC_OK; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_decoder.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_decoder.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_decoder.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_decoder.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,136 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_DECODER_VP9_DECODER_H_ -#define VP9_DECODER_VP9_DECODER_H_ - -#include "./vpx_config.h" - -#include "vpx/vpx_codec.h" -#include "vpx_scale/yv12config.h" -#include "vp9/common/vp9_thread_common.h" -#include "vp9/common/vp9_onyxc_int.h" -#include "vp9/common/vp9_ppflags.h" -#include "vp9/common/vp9_thread.h" -#include "vp9/decoder/vp9_dthread.h" -#include "vp9/decoder/vp9_reader.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// TODO(hkuang): combine this with TileWorkerData. -typedef struct TileData { - VP9_COMMON *cm; - vp9_reader bit_reader; - DECLARE_ALIGNED(16, MACROBLOCKD, xd); -} TileData; - -typedef struct TileWorkerData { - struct VP9Decoder *pbi; - vp9_reader bit_reader; - FRAME_COUNTS counts; - DECLARE_ALIGNED(16, MACROBLOCKD, xd); - struct vpx_internal_error_info error_info; -} TileWorkerData; - -typedef struct VP9Decoder { - DECLARE_ALIGNED(16, MACROBLOCKD, mb); - - DECLARE_ALIGNED(16, VP9_COMMON, common); - - int ready_for_new_data; - - int refresh_frame_flags; - - int frame_parallel_decode; // frame-based threading. - - // TODO(hkuang): Combine this with cur_buf in macroblockd as they are - // the same. - RefCntBuffer *cur_buf; // Current decoding frame buffer. - - VP9Worker *frame_worker_owner; // frame_worker that owns this pbi. - VP9Worker lf_worker; - VP9Worker *tile_workers; - TileWorkerData *tile_worker_data; - TileInfo *tile_worker_info; - int num_tile_workers; - - TileData *tile_data; - int total_tiles; - - VP9LfSync lf_row_sync; - - vpx_decrypt_cb decrypt_cb; - void *decrypt_state; - - int max_threads; - int inv_tile_order; - int need_resync; // wait for key/intra-only frame. - int hold_ref_buf; // hold the reference buffer. -} VP9Decoder; - -int vp9_receive_compressed_data(struct VP9Decoder *pbi, - size_t size, const uint8_t **dest); - -int vp9_get_raw_frame(struct VP9Decoder *pbi, YV12_BUFFER_CONFIG *sd, - vp9_ppflags_t *flags); - -vpx_codec_err_t vp9_copy_reference_dec(struct VP9Decoder *pbi, - VP9_REFFRAME ref_frame_flag, - YV12_BUFFER_CONFIG *sd); - -vpx_codec_err_t vp9_set_reference_dec(VP9_COMMON *cm, - VP9_REFFRAME ref_frame_flag, - YV12_BUFFER_CONFIG *sd); - -static INLINE uint8_t read_marker(vpx_decrypt_cb decrypt_cb, - void *decrypt_state, - const uint8_t *data) { - if (decrypt_cb) { - uint8_t marker; - decrypt_cb(decrypt_state, data, &marker, 1); - return marker; - } - return *data; -} - -// This function is exposed for use in tests, as well as the inlined function -// "read_marker". -vpx_codec_err_t vp9_parse_superframe_index(const uint8_t *data, - size_t data_sz, - uint32_t sizes[8], int *count, - vpx_decrypt_cb decrypt_cb, - void *decrypt_state); - -struct VP9Decoder *vp9_decoder_create(BufferPool *const pool); - -void vp9_decoder_remove(struct VP9Decoder *pbi); - -static INLINE void decrease_ref_count(int idx, RefCntBuffer *const frame_bufs, - BufferPool *const pool) { - if (idx >= 0) { - --frame_bufs[idx].ref_count; - // A worker may only get a free framebuffer index when calling get_free_fb. - // But the private buffer is not set up until finish decoding header. - // So any error happens during decoding header, the frame_bufs will not - // have valid priv buffer. - if (frame_bufs[idx].ref_count == 0 && - frame_bufs[idx].raw_frame_buffer.priv) { - pool->release_fb_cb(pool->cb_priv, &frame_bufs[idx].raw_frame_buffer); - } - } -} - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_DECODER_VP9_DECODER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_detokenize.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_detokenize.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_detokenize.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_detokenize.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,231 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vpx_mem/vpx_mem.h" -#include "vpx_ports/mem.h" - -#include "vp9/common/vp9_blockd.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_entropy.h" -#if CONFIG_COEFFICIENT_RANGE_CHECKING -#include "vp9/common/vp9_idct.h" -#endif - -#include "vp9/decoder/vp9_detokenize.h" - -#define EOB_CONTEXT_NODE 0 -#define ZERO_CONTEXT_NODE 1 -#define ONE_CONTEXT_NODE 2 -#define LOW_VAL_CONTEXT_NODE 0 -#define TWO_CONTEXT_NODE 1 -#define THREE_CONTEXT_NODE 2 -#define HIGH_LOW_CONTEXT_NODE 3 -#define CAT_ONE_CONTEXT_NODE 4 -#define CAT_THREEFOUR_CONTEXT_NODE 5 -#define CAT_THREE_CONTEXT_NODE 6 -#define CAT_FIVE_CONTEXT_NODE 7 - -#define INCREMENT_COUNT(token) \ - do { \ - if (!cm->frame_parallel_decoding_mode) \ - ++coef_counts[band][ctx][token]; \ - } while (0) - -static INLINE int read_coeff(const vp9_prob *probs, int n, vp9_reader *r) { - int i, val = 0; - for (i = 0; i < n; ++i) - val = (val << 1) | vp9_read(r, probs[i]); - return val; -} - -static const vp9_tree_index coeff_subtree_high[TREE_SIZE(ENTROPY_TOKENS)] = { - 2, 6, /* 0 = LOW_VAL */ - -TWO_TOKEN, 4, /* 1 = TWO */ - -THREE_TOKEN, -FOUR_TOKEN, /* 2 = THREE */ - 8, 10, /* 3 = HIGH_LOW */ - -CATEGORY1_TOKEN, -CATEGORY2_TOKEN, /* 4 = CAT_ONE */ - 12, 14, /* 5 = CAT_THREEFOUR */ - -CATEGORY3_TOKEN, -CATEGORY4_TOKEN, /* 6 = CAT_THREE */ - -CATEGORY5_TOKEN, -CATEGORY6_TOKEN /* 7 = CAT_FIVE */ -}; - -static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd, - FRAME_COUNTS *counts, PLANE_TYPE type, - tran_low_t *dqcoeff, TX_SIZE tx_size, const int16_t *dq, - int ctx, const int16_t *scan, const int16_t *nb, - vp9_reader *r) { - const int max_eob = 16 << (tx_size << 1); - const FRAME_CONTEXT *const fc = cm->fc; - const int ref = is_inter_block(&xd->mi[0].src_mi->mbmi); - int band, c = 0; - const vp9_prob (*coef_probs)[COEFF_CONTEXTS][UNCONSTRAINED_NODES] = - fc->coef_probs[tx_size][type][ref]; - const vp9_prob *prob; - unsigned int (*coef_counts)[COEFF_CONTEXTS][UNCONSTRAINED_NODES + 1] = - counts->coef[tx_size][type][ref]; - unsigned int (*eob_branch_count)[COEFF_CONTEXTS] = - counts->eob_branch[tx_size][type][ref]; - uint8_t token_cache[32 * 32]; - const uint8_t *band_translate = get_band_translate(tx_size); - const int dq_shift = (tx_size == TX_32X32); - int v, token; - int16_t dqv = dq[0]; - const uint8_t *cat1_prob; - const uint8_t *cat2_prob; - const uint8_t *cat3_prob; - const uint8_t *cat4_prob; - const uint8_t *cat5_prob; - const uint8_t *cat6_prob; - -#if CONFIG_VP9_HIGHBITDEPTH - if (cm->use_highbitdepth) { - if (cm->bit_depth == VPX_BITS_10) { - cat1_prob = vp9_cat1_prob_high10; - cat2_prob = vp9_cat2_prob_high10; - cat3_prob = vp9_cat3_prob_high10; - cat4_prob = vp9_cat4_prob_high10; - cat5_prob = vp9_cat5_prob_high10; - cat6_prob = vp9_cat6_prob_high10; - } else { - cat1_prob = vp9_cat1_prob_high12; - cat2_prob = vp9_cat2_prob_high12; - cat3_prob = vp9_cat3_prob_high12; - cat4_prob = vp9_cat4_prob_high12; - cat5_prob = vp9_cat5_prob_high12; - cat6_prob = vp9_cat6_prob_high12; - } - } else { - cat1_prob = vp9_cat1_prob; - cat2_prob = vp9_cat2_prob; - cat3_prob = vp9_cat3_prob; - cat4_prob = vp9_cat4_prob; - cat5_prob = vp9_cat5_prob; - cat6_prob = vp9_cat6_prob; - } -#else - cat1_prob = vp9_cat1_prob; - cat2_prob = vp9_cat2_prob; - cat3_prob = vp9_cat3_prob; - cat4_prob = vp9_cat4_prob; - cat5_prob = vp9_cat5_prob; - cat6_prob = vp9_cat6_prob; -#endif - - while (c < max_eob) { - int val = -1; - band = *band_translate++; - prob = coef_probs[band][ctx]; - if (!cm->frame_parallel_decoding_mode) - ++eob_branch_count[band][ctx]; - if (!vp9_read(r, prob[EOB_CONTEXT_NODE])) { - INCREMENT_COUNT(EOB_MODEL_TOKEN); - break; - } - - while (!vp9_read(r, prob[ZERO_CONTEXT_NODE])) { - INCREMENT_COUNT(ZERO_TOKEN); - dqv = dq[1]; - token_cache[scan[c]] = 0; - ++c; - if (c >= max_eob) - return c; // zero tokens at the end (no eob token) - ctx = get_coef_context(nb, token_cache, c); - band = *band_translate++; - prob = coef_probs[band][ctx]; - } - - if (!vp9_read(r, prob[ONE_CONTEXT_NODE])) { - INCREMENT_COUNT(ONE_TOKEN); - token = ONE_TOKEN; - val = 1; - } else { - INCREMENT_COUNT(TWO_TOKEN); - token = vp9_read_tree(r, coeff_subtree_high, - vp9_pareto8_full[prob[PIVOT_NODE] - 1]); - switch (token) { - case TWO_TOKEN: - case THREE_TOKEN: - case FOUR_TOKEN: - val = token; - break; - case CATEGORY1_TOKEN: - val = CAT1_MIN_VAL + read_coeff(cat1_prob, 1, r); - break; - case CATEGORY2_TOKEN: - val = CAT2_MIN_VAL + read_coeff(cat2_prob, 2, r); - break; - case CATEGORY3_TOKEN: - val = CAT3_MIN_VAL + read_coeff(cat3_prob, 3, r); - break; - case CATEGORY4_TOKEN: - val = CAT4_MIN_VAL + read_coeff(cat4_prob, 4, r); - break; - case CATEGORY5_TOKEN: - val = CAT5_MIN_VAL + read_coeff(cat5_prob, 5, r); - break; - case CATEGORY6_TOKEN: -#if CONFIG_VP9_HIGHBITDEPTH - switch (cm->bit_depth) { - case VPX_BITS_8: - val = CAT6_MIN_VAL + read_coeff(cat6_prob, 14, r); - break; - case VPX_BITS_10: - val = CAT6_MIN_VAL + read_coeff(cat6_prob, 16, r); - break; - case VPX_BITS_12: - val = CAT6_MIN_VAL + read_coeff(cat6_prob, 18, r); - break; - default: - assert(0); - return -1; - } -#else - val = CAT6_MIN_VAL + read_coeff(cat6_prob, 14, r); -#endif - break; - } - } - v = (val * dqv) >> dq_shift; -#if CONFIG_COEFFICIENT_RANGE_CHECKING -#if CONFIG_VP9_HIGHBITDEPTH - dqcoeff[scan[c]] = highbd_check_range((vp9_read_bit(r) ? -v : v), - cm->bit_depth); -#else - dqcoeff[scan[c]] = check_range(vp9_read_bit(r) ? -v : v); -#endif // CONFIG_VP9_HIGHBITDEPTH -#else - dqcoeff[scan[c]] = vp9_read_bit(r) ? -v : v; -#endif // CONFIG_COEFFICIENT_RANGE_CHECKING - token_cache[scan[c]] = vp9_pt_energy_class[token]; - ++c; - ctx = get_coef_context(nb, token_cache, c); - dqv = dq[1]; - } - - return c; -} - -int vp9_decode_block_tokens(VP9_COMMON *cm, MACROBLOCKD *xd, - FRAME_COUNTS *counts, int plane, int block, - BLOCK_SIZE plane_bsize, int x, int y, - TX_SIZE tx_size, vp9_reader *r, - const int16_t *const dequant) { - struct macroblockd_plane *const pd = &xd->plane[plane]; - const int ctx = get_entropy_context(tx_size, pd->above_context + x, - pd->left_context + y); - const scan_order *so = get_scan(xd, tx_size, pd->plane_type, block); - const int eob = decode_coefs(cm, xd, counts, pd->plane_type, - BLOCK_OFFSET(pd->dqcoeff, block), tx_size, - dequant, ctx, so->scan, so->neighbors, r); - vp9_set_contexts(xd, pd, plane_bsize, tx_size, eob > 0, x, y); - return eob; -} - - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_detokenize.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_detokenize.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_detokenize.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_detokenize.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP9_DECODER_VP9_DETOKENIZE_H_ -#define VP9_DECODER_VP9_DETOKENIZE_H_ - -#include "vp9/decoder/vp9_decoder.h" -#include "vp9/decoder/vp9_reader.h" - -#ifdef __cplusplus -extern "C" { -#endif - -int vp9_decode_block_tokens(VP9_COMMON *cm, MACROBLOCKD *xd, - FRAME_COUNTS *counts, int plane, int block, - BLOCK_SIZE plane_bsize, int x, int y, - TX_SIZE tx_size, vp9_reader *r, - const int16_t *const dequant); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_DECODER_VP9_DETOKENIZE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_dsubexp.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_dsubexp.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_dsubexp.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_dsubexp.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -/* - Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vp9/common/vp9_entropy.h" - -#include "vp9/decoder/vp9_dsubexp.h" - -static int inv_recenter_nonneg(int v, int m) { - if (v > 2 * m) - return v; - - return v % 2 ? m - (v + 1) / 2 : m + v / 2; -} - -static int decode_uniform(vp9_reader *r) { - const int l = 8; - const int m = (1 << l) - 191; - const int v = vp9_read_literal(r, l - 1); - return v < m ? v : (v << 1) - m + vp9_read_bit(r); -} - -static int inv_remap_prob(int v, int m) { - static int inv_map_table[MAX_PROB - 1] = { - 6, 19, 32, 45, 58, 71, 84, 97, 110, 123, 136, 149, 162, 175, 188, - 201, 214, 227, 240, 253, 0, 1, 2, 3, 4, 5, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252 - }; - // The clamp is not necessary for conforming VP9 stream, it is added to - // prevent out of bound access for bad input data - v = clamp(v, 0, 253); - v = inv_map_table[v]; - m--; - if ((m << 1) <= MAX_PROB) { - return 1 + inv_recenter_nonneg(v + 1, m); - } else { - return MAX_PROB - inv_recenter_nonneg(v + 1, MAX_PROB - 1 - m); - } -} - -static int decode_term_subexp(vp9_reader *r) { - if (!vp9_read_bit(r)) - return vp9_read_literal(r, 4); - if (!vp9_read_bit(r)) - return vp9_read_literal(r, 4) + 16; - if (!vp9_read_bit(r)) - return vp9_read_literal(r, 5) + 32; - return decode_uniform(r) + 64; -} - -void vp9_diff_update_prob(vp9_reader *r, vp9_prob* p) { - if (vp9_read(r, DIFF_UPDATE_PROB)) { - const int delp = decode_term_subexp(r); - *p = (vp9_prob)inv_remap_prob(delp, *p); - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_dsubexp.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_dsubexp.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_dsubexp.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_dsubexp.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP9_DECODER_VP9_DSUBEXP_H_ -#define VP9_DECODER_VP9_DSUBEXP_H_ - -#include "vp9/decoder/vp9_reader.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void vp9_diff_update_prob(vp9_reader *r, vp9_prob* p); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_DECODER_VP9_DSUBEXP_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_dthread.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_dthread.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_dthread.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_dthread.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "./vpx_config.h" -#include "vpx_mem/vpx_mem.h" -#include "vp9/common/vp9_reconinter.h" -#include "vp9/decoder/vp9_dthread.h" -#include "vp9/decoder/vp9_decoder.h" - -// #define DEBUG_THREAD - -// TODO(hkuang): Clean up all the #ifdef in this file. -void vp9_frameworker_lock_stats(VP9Worker *const worker) { -#if CONFIG_MULTITHREAD - FrameWorkerData *const worker_data = worker->data1; - pthread_mutex_lock(&worker_data->stats_mutex); -#else - (void)worker; -#endif -} - -void vp9_frameworker_unlock_stats(VP9Worker *const worker) { -#if CONFIG_MULTITHREAD - FrameWorkerData *const worker_data = worker->data1; - pthread_mutex_unlock(&worker_data->stats_mutex); -#else - (void)worker; -#endif -} - -void vp9_frameworker_signal_stats(VP9Worker *const worker) { -#if CONFIG_MULTITHREAD - FrameWorkerData *const worker_data = worker->data1; - -// TODO(hkuang): Fix the pthread_cond_broadcast in windows wrapper. -#if defined(_WIN32) && !HAVE_PTHREAD_H - pthread_cond_signal(&worker_data->stats_cond); -#else - pthread_cond_broadcast(&worker_data->stats_cond); -#endif - -#else - (void)worker; -#endif -} - -// This macro prevents thread_sanitizer from reporting known concurrent writes. -#if defined(__has_feature) -#if __has_feature(thread_sanitizer) -#define BUILDING_WITH_TSAN -#endif -#endif - -// TODO(hkuang): Remove worker parameter as it is only used in debug code. -void vp9_frameworker_wait(VP9Worker *const worker, RefCntBuffer *const ref_buf, - int row) { -#if CONFIG_MULTITHREAD - if (!ref_buf) - return; - -#ifndef BUILDING_WITH_TSAN - // The following line of code will get harmless tsan error but it is the key - // to get best performance. - if (ref_buf->row >= row && ref_buf->buf.corrupted != 1) return; -#endif - - { - // Find the worker thread that owns the reference frame. If the reference - // frame has been fully decoded, it may not have owner. - VP9Worker *const ref_worker = ref_buf->frame_worker_owner; - FrameWorkerData *const ref_worker_data = - (FrameWorkerData *)ref_worker->data1; - const VP9Decoder *const pbi = ref_worker_data->pbi; - -#ifdef DEBUG_THREAD - { - FrameWorkerData *const worker_data = (FrameWorkerData *)worker->data1; - printf("%d %p worker is waiting for %d %p worker (%d) ref %d \r\n", - worker_data->worker_id, worker, ref_worker_data->worker_id, - ref_buf->frame_worker_owner, row, ref_buf->row); - } -#endif - - vp9_frameworker_lock_stats(ref_worker); - while (ref_buf->row < row && pbi->cur_buf == ref_buf && - ref_buf->buf.corrupted != 1) { - pthread_cond_wait(&ref_worker_data->stats_cond, - &ref_worker_data->stats_mutex); - } - - if (ref_buf->buf.corrupted == 1) { - FrameWorkerData *const worker_data = (FrameWorkerData *)worker->data1; - vp9_frameworker_unlock_stats(ref_worker); - vpx_internal_error(&worker_data->pbi->common.error, - VPX_CODEC_CORRUPT_FRAME, - "Worker %p failed to decode frame", worker); - } - vp9_frameworker_unlock_stats(ref_worker); - } -#else - (void)worker; - (void)ref_buf; - (void)row; - (void)ref_buf; -#endif // CONFIG_MULTITHREAD -} - -void vp9_frameworker_broadcast(RefCntBuffer *const buf, int row) { -#if CONFIG_MULTITHREAD - VP9Worker *worker = buf->frame_worker_owner; - -#ifdef DEBUG_THREAD - { - FrameWorkerData *const worker_data = (FrameWorkerData *)worker->data1; - printf("%d %p worker decode to (%d) \r\n", worker_data->worker_id, - buf->frame_worker_owner, row); - } -#endif - - vp9_frameworker_lock_stats(worker); - buf->row = row; - vp9_frameworker_signal_stats(worker); - vp9_frameworker_unlock_stats(worker); -#else - (void)buf; - (void)row; -#endif // CONFIG_MULTITHREAD -} - -void vp9_frameworker_copy_context(VP9Worker *const dst_worker, - VP9Worker *const src_worker) { -#if CONFIG_MULTITHREAD - FrameWorkerData *const src_worker_data = (FrameWorkerData *)src_worker->data1; - FrameWorkerData *const dst_worker_data = (FrameWorkerData *)dst_worker->data1; - VP9_COMMON *const src_cm = &src_worker_data->pbi->common; - VP9_COMMON *const dst_cm = &dst_worker_data->pbi->common; - int i; - - // Wait until source frame's context is ready. - vp9_frameworker_lock_stats(src_worker); - while (!src_worker_data->frame_context_ready) { - pthread_cond_wait(&src_worker_data->stats_cond, - &src_worker_data->stats_mutex); - } - - dst_cm->last_frame_seg_map = src_cm->seg.enabled ? - src_cm->current_frame_seg_map : src_cm->last_frame_seg_map; - dst_worker_data->pbi->need_resync = src_worker_data->pbi->need_resync; - vp9_frameworker_unlock_stats(src_worker); - - dst_cm->prev_frame = src_cm->show_existing_frame ? - src_cm->prev_frame : src_cm->cur_frame; - dst_cm->last_width = !src_cm->show_existing_frame ? - src_cm->width : src_cm->last_width; - dst_cm->last_height = !src_cm->show_existing_frame ? - src_cm->height : src_cm->last_height; - dst_cm->subsampling_x = src_cm->subsampling_x; - dst_cm->subsampling_y = src_cm->subsampling_y; - dst_cm->frame_type = src_cm->frame_type; - dst_cm->last_show_frame = !src_cm->show_existing_frame ? - src_cm->show_frame : src_cm->last_show_frame; - for (i = 0; i < REF_FRAMES; ++i) - dst_cm->ref_frame_map[i] = src_cm->next_ref_frame_map[i]; - - memcpy(dst_cm->lf_info.lfthr, src_cm->lf_info.lfthr, - (MAX_LOOP_FILTER + 1) * sizeof(loop_filter_thresh)); - dst_cm->lf.last_sharpness_level = src_cm->lf.sharpness_level; - dst_cm->lf.filter_level = src_cm->lf.filter_level; - memcpy(dst_cm->lf.ref_deltas, src_cm->lf.ref_deltas, MAX_REF_LF_DELTAS); - memcpy(dst_cm->lf.mode_deltas, src_cm->lf.mode_deltas, MAX_MODE_LF_DELTAS); - dst_cm->seg = src_cm->seg; - memcpy(dst_cm->frame_contexts, src_cm->frame_contexts, - FRAME_CONTEXTS * sizeof(dst_cm->frame_contexts[0])); -#else - (void) dst_worker; - (void) src_worker; -#endif // CONFIG_MULTITHREAD -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_dthread.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_dthread.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_dthread.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_dthread.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_DECODER_VP9_DTHREAD_H_ -#define VP9_DECODER_VP9_DTHREAD_H_ - -#include "./vpx_config.h" -#include "vp9/common/vp9_thread.h" -#include "vpx/internal/vpx_codec_internal.h" - -struct VP9Common; -struct VP9Decoder; - -// WorkerData for the FrameWorker thread. It contains all the information of -// the worker and decode structures for decoding a frame. -typedef struct FrameWorkerData { - struct VP9Decoder *pbi; - const uint8_t *data; - const uint8_t *data_end; - size_t data_size; - void *user_priv; - int result; - int worker_id; - int received_frame; - - // scratch_buffer is used in frame parallel mode only. - // It is used to make a copy of the compressed data. - uint8_t *scratch_buffer; - size_t scratch_buffer_size; - -#if CONFIG_MULTITHREAD - pthread_mutex_t stats_mutex; - pthread_cond_t stats_cond; -#endif - - int frame_context_ready; // Current frame's context is ready to read. - int frame_decoded; // Finished decoding current frame. -} FrameWorkerData; - -void vp9_frameworker_lock_stats(VP9Worker *const worker); -void vp9_frameworker_unlock_stats(VP9Worker *const worker); -void vp9_frameworker_signal_stats(VP9Worker *const worker); - -// Wait until ref_buf has been decoded to row in real pixel unit. -// Note: worker may already finish decoding ref_buf and release it in order to -// start decoding next frame. So need to check whether worker is still decoding -// ref_buf. -void vp9_frameworker_wait(VP9Worker *const worker, RefCntBuffer *const ref_buf, - int row); - -// FrameWorker broadcasts its decoding progress so other workers that are -// waiting on it can resume decoding. -void vp9_frameworker_broadcast(RefCntBuffer *const buf, int row); - -// Copy necessary decoding context from src worker to dst worker. -void vp9_frameworker_copy_context(VP9Worker *const dst_worker, - VP9Worker *const src_worker); - -#endif // VP9_DECODER_VP9_DTHREAD_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_read_bit_buffer.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_read_bit_buffer.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_read_bit_buffer.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_read_bit_buffer.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#include "vp9/decoder/vp9_read_bit_buffer.h" - -size_t vp9_rb_bytes_read(struct vp9_read_bit_buffer *rb) { - return (rb->bit_offset + 7) >> 3; -} - -int vp9_rb_read_bit(struct vp9_read_bit_buffer *rb) { - const size_t off = rb->bit_offset; - const size_t p = off >> 3; - const int q = 7 - (int)(off & 0x7); - if (rb->bit_buffer + p < rb->bit_buffer_end) { - const int bit = (rb->bit_buffer[p] >> q) & 1; - rb->bit_offset = off + 1; - return bit; - } else { - rb->error_handler(rb->error_handler_data); - return 0; - } -} - -int vp9_rb_read_literal(struct vp9_read_bit_buffer *rb, int bits) { - int value = 0, bit; - for (bit = bits - 1; bit >= 0; bit--) - value |= vp9_rb_read_bit(rb) << bit; - return value; -} - -int vp9_rb_read_signed_literal(struct vp9_read_bit_buffer *rb, - int bits) { - const int value = vp9_rb_read_literal(rb, bits); - return vp9_rb_read_bit(rb) ? -value : value; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_read_bit_buffer.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_read_bit_buffer.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_read_bit_buffer.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_read_bit_buffer.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_DECODER_VP9_READ_BIT_BUFFER_H_ -#define VP9_DECODER_VP9_READ_BIT_BUFFER_H_ - -#include - -#include "vpx/vpx_integer.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void (*vp9_rb_error_handler)(void *data); - -struct vp9_read_bit_buffer { - const uint8_t *bit_buffer; - const uint8_t *bit_buffer_end; - size_t bit_offset; - - void *error_handler_data; - vp9_rb_error_handler error_handler; -}; - -size_t vp9_rb_bytes_read(struct vp9_read_bit_buffer *rb); - -int vp9_rb_read_bit(struct vp9_read_bit_buffer *rb); - -int vp9_rb_read_literal(struct vp9_read_bit_buffer *rb, int bits); - -int vp9_rb_read_signed_literal(struct vp9_read_bit_buffer *rb, int bits); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_DECODER_VP9_READ_BIT_BUFFER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_reader.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_reader.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_reader.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_reader.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vpx_ports/mem.h" -#include "vpx_mem/vpx_mem.h" - -#include "vp9/decoder/vp9_reader.h" - -// This is meant to be a large, positive constant that can still be efficiently -// loaded as an immediate (on platforms like ARM, for example). -// Even relatively modest values like 100 would work fine. -#define LOTS_OF_BITS 0x40000000 - -int vp9_reader_init(vp9_reader *r, - const uint8_t *buffer, - size_t size, - vpx_decrypt_cb decrypt_cb, - void *decrypt_state) { - if (size && !buffer) { - return 1; - } else { - r->buffer_end = buffer + size; - r->buffer = buffer; - r->value = 0; - r->count = -8; - r->range = 255; - r->decrypt_cb = decrypt_cb; - r->decrypt_state = decrypt_state; - vp9_reader_fill(r); - return vp9_read_bit(r) != 0; // marker bit - } -} - -void vp9_reader_fill(vp9_reader *r) { - const uint8_t *const buffer_end = r->buffer_end; - const uint8_t *buffer = r->buffer; - const uint8_t *buffer_start = buffer; - BD_VALUE value = r->value; - int count = r->count; - int shift = BD_VALUE_SIZE - CHAR_BIT - (count + CHAR_BIT); - int loop_end = 0; - const size_t bytes_left = buffer_end - buffer; - const size_t bits_left = bytes_left * CHAR_BIT; - const int x = (int)(shift + CHAR_BIT - bits_left); - - if (r->decrypt_cb) { - size_t n = MIN(sizeof(r->clear_buffer), bytes_left); - r->decrypt_cb(r->decrypt_state, buffer, r->clear_buffer, (int)n); - buffer = r->clear_buffer; - buffer_start = r->clear_buffer; - } - - if (x >= 0) { - count += LOTS_OF_BITS; - loop_end = x; - } - - if (x < 0 || bits_left) { - while (shift >= loop_end) { - count += CHAR_BIT; - value |= (BD_VALUE)*buffer++ << shift; - shift -= CHAR_BIT; - } - } - - // NOTE: Variable 'buffer' may not relate to 'r->buffer' after decryption, - // so we increase 'r->buffer' by the amount that 'buffer' moved, rather than - // assign 'buffer' to 'r->buffer'. - r->buffer += buffer - buffer_start; - r->value = value; - r->count = count; -} - -const uint8_t *vp9_reader_find_end(vp9_reader *r) { - // Find the end of the coded buffer - while (r->count > CHAR_BIT && r->count < BD_VALUE_SIZE) { - r->count -= CHAR_BIT; - r->buffer--; - } - return r->buffer; -} - -int vp9_reader_has_error(vp9_reader *r) { - // Check if we have reached the end of the buffer. - // - // Variable 'count' stores the number of bits in the 'value' buffer, minus - // 8. The top byte is part of the algorithm, and the remainder is buffered - // to be shifted into it. So if count == 8, the top 16 bits of 'value' are - // occupied, 8 for the algorithm and 8 in the buffer. - // - // When reading a byte from the user's buffer, count is filled with 8 and - // one byte is filled into the value buffer. When we reach the end of the - // data, count is additionally filled with LOTS_OF_BITS. So when - // count == LOTS_OF_BITS - 1, the user's data has been exhausted. - // - // 1 if we have tried to decode bits after the end of stream was encountered. - // 0 No error. - return r->count > BD_VALUE_SIZE && r->count < LOTS_OF_BITS; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_reader.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_reader.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/decoder/vp9_reader.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/decoder/vp9_reader.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_DECODER_VP9_READER_H_ -#define VP9_DECODER_VP9_READER_H_ - -#include -#include - -#include "./vpx_config.h" -#include "vpx_ports/mem.h" -#include "vpx/vp8dx.h" -#include "vpx/vpx_integer.h" - -#include "vp9/common/vp9_prob.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef size_t BD_VALUE; - -#define BD_VALUE_SIZE ((int)sizeof(BD_VALUE) * CHAR_BIT) - -typedef struct { - // Be careful when reordering this struct, it may impact the cache negatively. - BD_VALUE value; - unsigned int range; - int count; - const uint8_t *buffer_end; - const uint8_t *buffer; - vpx_decrypt_cb decrypt_cb; - void *decrypt_state; - uint8_t clear_buffer[sizeof(BD_VALUE) + 1]; -} vp9_reader; - -int vp9_reader_init(vp9_reader *r, - const uint8_t *buffer, - size_t size, - vpx_decrypt_cb decrypt_cb, - void *decrypt_state); - -void vp9_reader_fill(vp9_reader *r); - -int vp9_reader_has_error(vp9_reader *r); - -const uint8_t *vp9_reader_find_end(vp9_reader *r); - -static INLINE int vp9_read(vp9_reader *r, int prob) { - unsigned int bit = 0; - BD_VALUE value; - BD_VALUE bigsplit; - int count; - unsigned int range; - unsigned int split = (r->range * prob + (256 - prob)) >> CHAR_BIT; - - if (r->count < 0) - vp9_reader_fill(r); - - value = r->value; - count = r->count; - - bigsplit = (BD_VALUE)split << (BD_VALUE_SIZE - CHAR_BIT); - - range = split; - - if (value >= bigsplit) { - range = r->range - split; - value = value - bigsplit; - bit = 1; - } - - { - register unsigned int shift = vp9_norm[range]; - range <<= shift; - value <<= shift; - count -= shift; - } - r->value = value; - r->count = count; - r->range = range; - - return bit; -} - -static INLINE int vp9_read_bit(vp9_reader *r) { - return vp9_read(r, 128); // vp9_prob_half -} - -static INLINE int vp9_read_literal(vp9_reader *r, int bits) { - int literal = 0, bit; - - for (bit = bits - 1; bit >= 0; bit--) - literal |= vp9_read_bit(r) << bit; - - return literal; -} - -static INLINE int vp9_read_tree(vp9_reader *r, const vp9_tree_index *tree, - const vp9_prob *probs) { - vp9_tree_index i = 0; - - while ((i = tree[i + vp9_read(r, probs[i >> 1])]) > 0) - continue; - - return -i; -} - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_DECODER_VP9_READER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_avg_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_avg_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_avg_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_avg_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2015 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "./vp9_rtcd.h" -#include "./vpx_config.h" - -#include "vpx/vpx_integer.h" - -static INLINE unsigned int horizontal_add_u16x8(const uint16x8_t v_16x8) { - const uint32x4_t a = vpaddlq_u16(v_16x8); - const uint64x2_t b = vpaddlq_u32(a); - const uint32x2_t c = vadd_u32(vreinterpret_u32_u64(vget_low_u64(b)), - vreinterpret_u32_u64(vget_high_u64(b))); - return vget_lane_u32(c, 0); -} - -unsigned int vp9_avg_8x8_neon(const uint8_t *s, int p) { - uint8x8_t v_s0 = vld1_u8(s); - const uint8x8_t v_s1 = vld1_u8(s + p); - uint16x8_t v_sum = vaddl_u8(v_s0, v_s1); - - v_s0 = vld1_u8(s + 2 * p); - v_sum = vaddw_u8(v_sum, v_s0); - - v_s0 = vld1_u8(s + 3 * p); - v_sum = vaddw_u8(v_sum, v_s0); - - v_s0 = vld1_u8(s + 4 * p); - v_sum = vaddw_u8(v_sum, v_s0); - - v_s0 = vld1_u8(s + 5 * p); - v_sum = vaddw_u8(v_sum, v_s0); - - v_s0 = vld1_u8(s + 6 * p); - v_sum = vaddw_u8(v_sum, v_s0); - - v_s0 = vld1_u8(s + 7 * p); - v_sum = vaddw_u8(v_sum, v_s0); - - return (horizontal_add_u16x8(v_sum) + 32) >> 6; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_dct_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_dct_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_dct_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_dct_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,241 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "./vp9_rtcd.h" -#include "./vpx_config.h" - -#include "vp9/common/vp9_blockd.h" -#include "vp9/common/vp9_idct.h" - -void vp9_fdct8x8_1_neon(const int16_t *input, int16_t *output, int stride) { - int r; - int16x8_t sum = vld1q_s16(&input[0]); - for (r = 1; r < 8; ++r) { - const int16x8_t input_00 = vld1q_s16(&input[r * stride]); - sum = vaddq_s16(sum, input_00); - } - { - const int32x4_t a = vpaddlq_s16(sum); - const int64x2_t b = vpaddlq_s32(a); - const int32x2_t c = vadd_s32(vreinterpret_s32_s64(vget_low_s64(b)), - vreinterpret_s32_s64(vget_high_s64(b))); - output[0] = vget_lane_s16(vreinterpret_s16_s32(c), 0); - output[1] = 0; - } -} - -void vp9_fdct8x8_quant_neon(const int16_t *input, int stride, - int16_t* coeff_ptr, intptr_t n_coeffs, - int skip_block, const int16_t* zbin_ptr, - const int16_t* round_ptr, const int16_t* quant_ptr, - const int16_t* quant_shift_ptr, - int16_t* qcoeff_ptr, int16_t* dqcoeff_ptr, - const int16_t* dequant_ptr, uint16_t* eob_ptr, - const int16_t* scan_ptr, - const int16_t* iscan_ptr) { - int16_t temp_buffer[64]; - (void)coeff_ptr; - - vp9_fdct8x8_neon(input, temp_buffer, stride); - vp9_quantize_fp_neon(temp_buffer, n_coeffs, skip_block, zbin_ptr, round_ptr, - quant_ptr, quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, - dequant_ptr, eob_ptr, scan_ptr, iscan_ptr); -} - -void vp9_fdct8x8_neon(const int16_t *input, int16_t *final_output, int stride) { - int i; - // stage 1 - int16x8_t input_0 = vshlq_n_s16(vld1q_s16(&input[0 * stride]), 2); - int16x8_t input_1 = vshlq_n_s16(vld1q_s16(&input[1 * stride]), 2); - int16x8_t input_2 = vshlq_n_s16(vld1q_s16(&input[2 * stride]), 2); - int16x8_t input_3 = vshlq_n_s16(vld1q_s16(&input[3 * stride]), 2); - int16x8_t input_4 = vshlq_n_s16(vld1q_s16(&input[4 * stride]), 2); - int16x8_t input_5 = vshlq_n_s16(vld1q_s16(&input[5 * stride]), 2); - int16x8_t input_6 = vshlq_n_s16(vld1q_s16(&input[6 * stride]), 2); - int16x8_t input_7 = vshlq_n_s16(vld1q_s16(&input[7 * stride]), 2); - for (i = 0; i < 2; ++i) { - int16x8_t out_0, out_1, out_2, out_3, out_4, out_5, out_6, out_7; - const int16x8_t v_s0 = vaddq_s16(input_0, input_7); - const int16x8_t v_s1 = vaddq_s16(input_1, input_6); - const int16x8_t v_s2 = vaddq_s16(input_2, input_5); - const int16x8_t v_s3 = vaddq_s16(input_3, input_4); - const int16x8_t v_s4 = vsubq_s16(input_3, input_4); - const int16x8_t v_s5 = vsubq_s16(input_2, input_5); - const int16x8_t v_s6 = vsubq_s16(input_1, input_6); - const int16x8_t v_s7 = vsubq_s16(input_0, input_7); - // fdct4(step, step); - int16x8_t v_x0 = vaddq_s16(v_s0, v_s3); - int16x8_t v_x1 = vaddq_s16(v_s1, v_s2); - int16x8_t v_x2 = vsubq_s16(v_s1, v_s2); - int16x8_t v_x3 = vsubq_s16(v_s0, v_s3); - // fdct4(step, step); - int32x4_t v_t0_lo = vaddl_s16(vget_low_s16(v_x0), vget_low_s16(v_x1)); - int32x4_t v_t0_hi = vaddl_s16(vget_high_s16(v_x0), vget_high_s16(v_x1)); - int32x4_t v_t1_lo = vsubl_s16(vget_low_s16(v_x0), vget_low_s16(v_x1)); - int32x4_t v_t1_hi = vsubl_s16(vget_high_s16(v_x0), vget_high_s16(v_x1)); - int32x4_t v_t2_lo = vmull_n_s16(vget_low_s16(v_x2), (int16_t)cospi_24_64); - int32x4_t v_t2_hi = vmull_n_s16(vget_high_s16(v_x2), (int16_t)cospi_24_64); - int32x4_t v_t3_lo = vmull_n_s16(vget_low_s16(v_x3), (int16_t)cospi_24_64); - int32x4_t v_t3_hi = vmull_n_s16(vget_high_s16(v_x3), (int16_t)cospi_24_64); - v_t2_lo = vmlal_n_s16(v_t2_lo, vget_low_s16(v_x3), (int16_t)cospi_8_64); - v_t2_hi = vmlal_n_s16(v_t2_hi, vget_high_s16(v_x3), (int16_t)cospi_8_64); - v_t3_lo = vmlsl_n_s16(v_t3_lo, vget_low_s16(v_x2), (int16_t)cospi_8_64); - v_t3_hi = vmlsl_n_s16(v_t3_hi, vget_high_s16(v_x2), (int16_t)cospi_8_64); - v_t0_lo = vmulq_n_s32(v_t0_lo, cospi_16_64); - v_t0_hi = vmulq_n_s32(v_t0_hi, cospi_16_64); - v_t1_lo = vmulq_n_s32(v_t1_lo, cospi_16_64); - v_t1_hi = vmulq_n_s32(v_t1_hi, cospi_16_64); - { - const int16x4_t a = vrshrn_n_s32(v_t0_lo, DCT_CONST_BITS); - const int16x4_t b = vrshrn_n_s32(v_t0_hi, DCT_CONST_BITS); - const int16x4_t c = vrshrn_n_s32(v_t1_lo, DCT_CONST_BITS); - const int16x4_t d = vrshrn_n_s32(v_t1_hi, DCT_CONST_BITS); - const int16x4_t e = vrshrn_n_s32(v_t2_lo, DCT_CONST_BITS); - const int16x4_t f = vrshrn_n_s32(v_t2_hi, DCT_CONST_BITS); - const int16x4_t g = vrshrn_n_s32(v_t3_lo, DCT_CONST_BITS); - const int16x4_t h = vrshrn_n_s32(v_t3_hi, DCT_CONST_BITS); - out_0 = vcombine_s16(a, c); // 00 01 02 03 40 41 42 43 - out_2 = vcombine_s16(e, g); // 20 21 22 23 60 61 62 63 - out_4 = vcombine_s16(b, d); // 04 05 06 07 44 45 46 47 - out_6 = vcombine_s16(f, h); // 24 25 26 27 64 65 66 67 - } - // Stage 2 - v_x0 = vsubq_s16(v_s6, v_s5); - v_x1 = vaddq_s16(v_s6, v_s5); - v_t0_lo = vmull_n_s16(vget_low_s16(v_x0), (int16_t)cospi_16_64); - v_t0_hi = vmull_n_s16(vget_high_s16(v_x0), (int16_t)cospi_16_64); - v_t1_lo = vmull_n_s16(vget_low_s16(v_x1), (int16_t)cospi_16_64); - v_t1_hi = vmull_n_s16(vget_high_s16(v_x1), (int16_t)cospi_16_64); - { - const int16x4_t a = vrshrn_n_s32(v_t0_lo, DCT_CONST_BITS); - const int16x4_t b = vrshrn_n_s32(v_t0_hi, DCT_CONST_BITS); - const int16x4_t c = vrshrn_n_s32(v_t1_lo, DCT_CONST_BITS); - const int16x4_t d = vrshrn_n_s32(v_t1_hi, DCT_CONST_BITS); - const int16x8_t ab = vcombine_s16(a, b); - const int16x8_t cd = vcombine_s16(c, d); - // Stage 3 - v_x0 = vaddq_s16(v_s4, ab); - v_x1 = vsubq_s16(v_s4, ab); - v_x2 = vsubq_s16(v_s7, cd); - v_x3 = vaddq_s16(v_s7, cd); - } - // Stage 4 - v_t0_lo = vmull_n_s16(vget_low_s16(v_x3), (int16_t)cospi_4_64); - v_t0_hi = vmull_n_s16(vget_high_s16(v_x3), (int16_t)cospi_4_64); - v_t0_lo = vmlal_n_s16(v_t0_lo, vget_low_s16(v_x0), (int16_t)cospi_28_64); - v_t0_hi = vmlal_n_s16(v_t0_hi, vget_high_s16(v_x0), (int16_t)cospi_28_64); - v_t1_lo = vmull_n_s16(vget_low_s16(v_x1), (int16_t)cospi_12_64); - v_t1_hi = vmull_n_s16(vget_high_s16(v_x1), (int16_t)cospi_12_64); - v_t1_lo = vmlal_n_s16(v_t1_lo, vget_low_s16(v_x2), (int16_t)cospi_20_64); - v_t1_hi = vmlal_n_s16(v_t1_hi, vget_high_s16(v_x2), (int16_t)cospi_20_64); - v_t2_lo = vmull_n_s16(vget_low_s16(v_x2), (int16_t)cospi_12_64); - v_t2_hi = vmull_n_s16(vget_high_s16(v_x2), (int16_t)cospi_12_64); - v_t2_lo = vmlsl_n_s16(v_t2_lo, vget_low_s16(v_x1), (int16_t)cospi_20_64); - v_t2_hi = vmlsl_n_s16(v_t2_hi, vget_high_s16(v_x1), (int16_t)cospi_20_64); - v_t3_lo = vmull_n_s16(vget_low_s16(v_x3), (int16_t)cospi_28_64); - v_t3_hi = vmull_n_s16(vget_high_s16(v_x3), (int16_t)cospi_28_64); - v_t3_lo = vmlsl_n_s16(v_t3_lo, vget_low_s16(v_x0), (int16_t)cospi_4_64); - v_t3_hi = vmlsl_n_s16(v_t3_hi, vget_high_s16(v_x0), (int16_t)cospi_4_64); - { - const int16x4_t a = vrshrn_n_s32(v_t0_lo, DCT_CONST_BITS); - const int16x4_t b = vrshrn_n_s32(v_t0_hi, DCT_CONST_BITS); - const int16x4_t c = vrshrn_n_s32(v_t1_lo, DCT_CONST_BITS); - const int16x4_t d = vrshrn_n_s32(v_t1_hi, DCT_CONST_BITS); - const int16x4_t e = vrshrn_n_s32(v_t2_lo, DCT_CONST_BITS); - const int16x4_t f = vrshrn_n_s32(v_t2_hi, DCT_CONST_BITS); - const int16x4_t g = vrshrn_n_s32(v_t3_lo, DCT_CONST_BITS); - const int16x4_t h = vrshrn_n_s32(v_t3_hi, DCT_CONST_BITS); - out_1 = vcombine_s16(a, c); // 10 11 12 13 50 51 52 53 - out_3 = vcombine_s16(e, g); // 30 31 32 33 70 71 72 73 - out_5 = vcombine_s16(b, d); // 14 15 16 17 54 55 56 57 - out_7 = vcombine_s16(f, h); // 34 35 36 37 74 75 76 77 - } - // transpose 8x8 - { - // 00 01 02 03 40 41 42 43 - // 10 11 12 13 50 51 52 53 - // 20 21 22 23 60 61 62 63 - // 30 31 32 33 70 71 72 73 - // 04 05 06 07 44 45 46 47 - // 14 15 16 17 54 55 56 57 - // 24 25 26 27 64 65 66 67 - // 34 35 36 37 74 75 76 77 - const int32x4x2_t r02_s32 = vtrnq_s32(vreinterpretq_s32_s16(out_0), - vreinterpretq_s32_s16(out_2)); - const int32x4x2_t r13_s32 = vtrnq_s32(vreinterpretq_s32_s16(out_1), - vreinterpretq_s32_s16(out_3)); - const int32x4x2_t r46_s32 = vtrnq_s32(vreinterpretq_s32_s16(out_4), - vreinterpretq_s32_s16(out_6)); - const int32x4x2_t r57_s32 = vtrnq_s32(vreinterpretq_s32_s16(out_5), - vreinterpretq_s32_s16(out_7)); - const int16x8x2_t r01_s16 = - vtrnq_s16(vreinterpretq_s16_s32(r02_s32.val[0]), - vreinterpretq_s16_s32(r13_s32.val[0])); - const int16x8x2_t r23_s16 = - vtrnq_s16(vreinterpretq_s16_s32(r02_s32.val[1]), - vreinterpretq_s16_s32(r13_s32.val[1])); - const int16x8x2_t r45_s16 = - vtrnq_s16(vreinterpretq_s16_s32(r46_s32.val[0]), - vreinterpretq_s16_s32(r57_s32.val[0])); - const int16x8x2_t r67_s16 = - vtrnq_s16(vreinterpretq_s16_s32(r46_s32.val[1]), - vreinterpretq_s16_s32(r57_s32.val[1])); - input_0 = r01_s16.val[0]; - input_1 = r01_s16.val[1]; - input_2 = r23_s16.val[0]; - input_3 = r23_s16.val[1]; - input_4 = r45_s16.val[0]; - input_5 = r45_s16.val[1]; - input_6 = r67_s16.val[0]; - input_7 = r67_s16.val[1]; - // 00 10 20 30 40 50 60 70 - // 01 11 21 31 41 51 61 71 - // 02 12 22 32 42 52 62 72 - // 03 13 23 33 43 53 63 73 - // 04 14 24 34 44 54 64 74 - // 05 15 25 35 45 55 65 75 - // 06 16 26 36 46 56 66 76 - // 07 17 27 37 47 57 67 77 - } - } // for - { - // from vp9_dct_sse2.c - // Post-condition (division by two) - // division of two 16 bits signed numbers using shifts - // n / 2 = (n - (n >> 15)) >> 1 - const int16x8_t sign_in0 = vshrq_n_s16(input_0, 15); - const int16x8_t sign_in1 = vshrq_n_s16(input_1, 15); - const int16x8_t sign_in2 = vshrq_n_s16(input_2, 15); - const int16x8_t sign_in3 = vshrq_n_s16(input_3, 15); - const int16x8_t sign_in4 = vshrq_n_s16(input_4, 15); - const int16x8_t sign_in5 = vshrq_n_s16(input_5, 15); - const int16x8_t sign_in6 = vshrq_n_s16(input_6, 15); - const int16x8_t sign_in7 = vshrq_n_s16(input_7, 15); - input_0 = vhsubq_s16(input_0, sign_in0); - input_1 = vhsubq_s16(input_1, sign_in1); - input_2 = vhsubq_s16(input_2, sign_in2); - input_3 = vhsubq_s16(input_3, sign_in3); - input_4 = vhsubq_s16(input_4, sign_in4); - input_5 = vhsubq_s16(input_5, sign_in5); - input_6 = vhsubq_s16(input_6, sign_in6); - input_7 = vhsubq_s16(input_7, sign_in7); - // store results - vst1q_s16(&final_output[0 * 8], input_0); - vst1q_s16(&final_output[1 * 8], input_1); - vst1q_s16(&final_output[2 * 8], input_2); - vst1q_s16(&final_output[3 * 8], input_3); - vst1q_s16(&final_output[4 * 8], input_4); - vst1q_s16(&final_output[5 * 8], input_5); - vst1q_s16(&final_output[6 * 8], input_6); - vst1q_s16(&final_output[7 * 8], input_7); - } -} - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_quantize_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_quantize_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_quantize_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_quantize_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include - -#include "vpx_mem/vpx_mem.h" - -#include "vp9/common/vp9_quant_common.h" -#include "vp9/common/vp9_seg_common.h" - -#include "vp9/encoder/vp9_encoder.h" -#include "vp9/encoder/vp9_quantize.h" -#include "vp9/encoder/vp9_rd.h" - -void vp9_quantize_fp_neon(const int16_t *coeff_ptr, intptr_t count, - int skip_block, const int16_t *zbin_ptr, - const int16_t *round_ptr, const int16_t *quant_ptr, - const int16_t *quant_shift_ptr, int16_t *qcoeff_ptr, - int16_t *dqcoeff_ptr, const int16_t *dequant_ptr, - uint16_t *eob_ptr, - const int16_t *scan, const int16_t *iscan) { - // TODO(jingning) Decide the need of these arguments after the - // quantization process is completed. - (void)zbin_ptr; - (void)quant_shift_ptr; - (void)scan; - - if (!skip_block) { - // Quantization pass: All coefficients with index >= zero_flag are - // skippable. Note: zero_flag can be zero. - int i; - const int16x8_t v_zero = vdupq_n_s16(0); - const int16x8_t v_one = vdupq_n_s16(1); - int16x8_t v_eobmax_76543210 = vdupq_n_s16(-1); - int16x8_t v_round = vmovq_n_s16(round_ptr[1]); - int16x8_t v_quant = vmovq_n_s16(quant_ptr[1]); - int16x8_t v_dequant = vmovq_n_s16(dequant_ptr[1]); - // adjust for dc - v_round = vsetq_lane_s16(round_ptr[0], v_round, 0); - v_quant = vsetq_lane_s16(quant_ptr[0], v_quant, 0); - v_dequant = vsetq_lane_s16(dequant_ptr[0], v_dequant, 0); - // process dc and the first seven ac coeffs - { - const int16x8_t v_iscan = vld1q_s16(&iscan[0]); - const int16x8_t v_coeff = vld1q_s16(&coeff_ptr[0]); - const int16x8_t v_coeff_sign = vshrq_n_s16(v_coeff, 15); - const int16x8_t v_tmp = vabaq_s16(v_round, v_coeff, v_zero); - const int32x4_t v_tmp_lo = vmull_s16(vget_low_s16(v_tmp), - vget_low_s16(v_quant)); - const int32x4_t v_tmp_hi = vmull_s16(vget_high_s16(v_tmp), - vget_high_s16(v_quant)); - const int16x8_t v_tmp2 = vcombine_s16(vshrn_n_s32(v_tmp_lo, 16), - vshrn_n_s32(v_tmp_hi, 16)); - const uint16x8_t v_nz_mask = vceqq_s16(v_tmp2, v_zero); - const int16x8_t v_iscan_plus1 = vaddq_s16(v_iscan, v_one); - const int16x8_t v_nz_iscan = vbslq_s16(v_nz_mask, v_zero, v_iscan_plus1); - const int16x8_t v_qcoeff_a = veorq_s16(v_tmp2, v_coeff_sign); - const int16x8_t v_qcoeff = vsubq_s16(v_qcoeff_a, v_coeff_sign); - const int16x8_t v_dqcoeff = vmulq_s16(v_qcoeff, v_dequant); - v_eobmax_76543210 = vmaxq_s16(v_eobmax_76543210, v_nz_iscan); - vst1q_s16(&qcoeff_ptr[0], v_qcoeff); - vst1q_s16(&dqcoeff_ptr[0], v_dqcoeff); - v_round = vmovq_n_s16(round_ptr[1]); - v_quant = vmovq_n_s16(quant_ptr[1]); - v_dequant = vmovq_n_s16(dequant_ptr[1]); - } - // now process the rest of the ac coeffs - for (i = 8; i < count; i += 8) { - const int16x8_t v_iscan = vld1q_s16(&iscan[i]); - const int16x8_t v_coeff = vld1q_s16(&coeff_ptr[i]); - const int16x8_t v_coeff_sign = vshrq_n_s16(v_coeff, 15); - const int16x8_t v_tmp = vabaq_s16(v_round, v_coeff, v_zero); - const int32x4_t v_tmp_lo = vmull_s16(vget_low_s16(v_tmp), - vget_low_s16(v_quant)); - const int32x4_t v_tmp_hi = vmull_s16(vget_high_s16(v_tmp), - vget_high_s16(v_quant)); - const int16x8_t v_tmp2 = vcombine_s16(vshrn_n_s32(v_tmp_lo, 16), - vshrn_n_s32(v_tmp_hi, 16)); - const uint16x8_t v_nz_mask = vceqq_s16(v_tmp2, v_zero); - const int16x8_t v_iscan_plus1 = vaddq_s16(v_iscan, v_one); - const int16x8_t v_nz_iscan = vbslq_s16(v_nz_mask, v_zero, v_iscan_plus1); - const int16x8_t v_qcoeff_a = veorq_s16(v_tmp2, v_coeff_sign); - const int16x8_t v_qcoeff = vsubq_s16(v_qcoeff_a, v_coeff_sign); - const int16x8_t v_dqcoeff = vmulq_s16(v_qcoeff, v_dequant); - v_eobmax_76543210 = vmaxq_s16(v_eobmax_76543210, v_nz_iscan); - vst1q_s16(&qcoeff_ptr[i], v_qcoeff); - vst1q_s16(&dqcoeff_ptr[i], v_dqcoeff); - } - { - const int16x4_t v_eobmax_3210 = - vmax_s16(vget_low_s16(v_eobmax_76543210), - vget_high_s16(v_eobmax_76543210)); - const int64x1_t v_eobmax_xx32 = - vshr_n_s64(vreinterpret_s64_s16(v_eobmax_3210), 32); - const int16x4_t v_eobmax_tmp = - vmax_s16(v_eobmax_3210, vreinterpret_s16_s64(v_eobmax_xx32)); - const int64x1_t v_eobmax_xxx3 = - vshr_n_s64(vreinterpret_s64_s16(v_eobmax_tmp), 16); - const int16x4_t v_eobmax_final = - vmax_s16(v_eobmax_tmp, vreinterpret_s16_s64(v_eobmax_xxx3)); - - *eob_ptr = (uint16_t)vget_lane_s16(v_eobmax_final, 0); - } - } else { - vpx_memset(qcoeff_ptr, 0, count * sizeof(int16_t)); - vpx_memset(dqcoeff_ptr, 0, count * sizeof(int16_t)); - *eob_ptr = 0; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_sad4d_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_sad4d_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_sad4d_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_sad4d_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,226 +0,0 @@ -/* - * Copyright (c) 2015 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "./vp9_rtcd.h" -#include "./vpx_config.h" - -#include "vpx/vpx_integer.h" - -static INLINE unsigned int horizontal_long_add_16x8(const uint16x8_t vec_lo, - const uint16x8_t vec_hi) { - const uint32x4_t vec_l_lo = vaddl_u16(vget_low_u16(vec_lo), - vget_high_u16(vec_lo)); - const uint32x4_t vec_l_hi = vaddl_u16(vget_low_u16(vec_hi), - vget_high_u16(vec_hi)); - const uint32x4_t a = vaddq_u32(vec_l_lo, vec_l_hi); - const uint64x2_t b = vpaddlq_u32(a); - const uint32x2_t c = vadd_u32(vreinterpret_u32_u64(vget_low_u64(b)), - vreinterpret_u32_u64(vget_high_u64(b))); - return vget_lane_u32(c, 0); -} - -// Calculate the absolute difference of 64 bytes from vec_src_00, vec_src_16, -// vec_src_32, vec_src_48 and ref. Accumulate partial sums in vec_sum_ref_lo -// and vec_sum_ref_hi. -static void sad_neon_64(const uint8x16_t vec_src_00, - const uint8x16_t vec_src_16, - const uint8x16_t vec_src_32, - const uint8x16_t vec_src_48, - const uint8_t *ref, - uint16x8_t *vec_sum_ref_lo, - uint16x8_t *vec_sum_ref_hi) { - const uint8x16_t vec_ref_00 = vld1q_u8(ref); - const uint8x16_t vec_ref_16 = vld1q_u8(ref + 16); - const uint8x16_t vec_ref_32 = vld1q_u8(ref + 32); - const uint8x16_t vec_ref_48 = vld1q_u8(ref + 48); - - *vec_sum_ref_lo = vabal_u8(*vec_sum_ref_lo, vget_low_u8(vec_src_00), - vget_low_u8(vec_ref_00)); - *vec_sum_ref_hi = vabal_u8(*vec_sum_ref_hi, vget_high_u8(vec_src_00), - vget_high_u8(vec_ref_00)); - *vec_sum_ref_lo = vabal_u8(*vec_sum_ref_lo, vget_low_u8(vec_src_16), - vget_low_u8(vec_ref_16)); - *vec_sum_ref_hi = vabal_u8(*vec_sum_ref_hi, vget_high_u8(vec_src_16), - vget_high_u8(vec_ref_16)); - *vec_sum_ref_lo = vabal_u8(*vec_sum_ref_lo, vget_low_u8(vec_src_32), - vget_low_u8(vec_ref_32)); - *vec_sum_ref_hi = vabal_u8(*vec_sum_ref_hi, vget_high_u8(vec_src_32), - vget_high_u8(vec_ref_32)); - *vec_sum_ref_lo = vabal_u8(*vec_sum_ref_lo, vget_low_u8(vec_src_48), - vget_low_u8(vec_ref_48)); - *vec_sum_ref_hi = vabal_u8(*vec_sum_ref_hi, vget_high_u8(vec_src_48), - vget_high_u8(vec_ref_48)); -} - -// Calculate the absolute difference of 32 bytes from vec_src_00, vec_src_16, -// and ref. Accumulate partial sums in vec_sum_ref_lo and vec_sum_ref_hi. -static void sad_neon_32(const uint8x16_t vec_src_00, - const uint8x16_t vec_src_16, - const uint8_t *ref, - uint16x8_t *vec_sum_ref_lo, - uint16x8_t *vec_sum_ref_hi) { - const uint8x16_t vec_ref_00 = vld1q_u8(ref); - const uint8x16_t vec_ref_16 = vld1q_u8(ref + 16); - - *vec_sum_ref_lo = vabal_u8(*vec_sum_ref_lo, vget_low_u8(vec_src_00), - vget_low_u8(vec_ref_00)); - *vec_sum_ref_hi = vabal_u8(*vec_sum_ref_hi, vget_high_u8(vec_src_00), - vget_high_u8(vec_ref_00)); - *vec_sum_ref_lo = vabal_u8(*vec_sum_ref_lo, vget_low_u8(vec_src_16), - vget_low_u8(vec_ref_16)); - *vec_sum_ref_hi = vabal_u8(*vec_sum_ref_hi, vget_high_u8(vec_src_16), - vget_high_u8(vec_ref_16)); -} - -void vp9_sad64x64x4d_neon(const uint8_t *src, int src_stride, - const uint8_t* const ref[4], int ref_stride, - unsigned int *res) { - int i; - uint16x8_t vec_sum_ref0_lo = vdupq_n_u16(0); - uint16x8_t vec_sum_ref0_hi = vdupq_n_u16(0); - uint16x8_t vec_sum_ref1_lo = vdupq_n_u16(0); - uint16x8_t vec_sum_ref1_hi = vdupq_n_u16(0); - uint16x8_t vec_sum_ref2_lo = vdupq_n_u16(0); - uint16x8_t vec_sum_ref2_hi = vdupq_n_u16(0); - uint16x8_t vec_sum_ref3_lo = vdupq_n_u16(0); - uint16x8_t vec_sum_ref3_hi = vdupq_n_u16(0); - const uint8_t *ref0, *ref1, *ref2, *ref3; - ref0 = ref[0]; - ref1 = ref[1]; - ref2 = ref[2]; - ref3 = ref[3]; - - for (i = 0; i < 64; ++i) { - const uint8x16_t vec_src_00 = vld1q_u8(src); - const uint8x16_t vec_src_16 = vld1q_u8(src + 16); - const uint8x16_t vec_src_32 = vld1q_u8(src + 32); - const uint8x16_t vec_src_48 = vld1q_u8(src + 48); - - sad_neon_64(vec_src_00, vec_src_16, vec_src_32, vec_src_48, ref0, - &vec_sum_ref0_lo, &vec_sum_ref0_hi); - sad_neon_64(vec_src_00, vec_src_16, vec_src_32, vec_src_48, ref1, - &vec_sum_ref1_lo, &vec_sum_ref1_hi); - sad_neon_64(vec_src_00, vec_src_16, vec_src_32, vec_src_48, ref2, - &vec_sum_ref2_lo, &vec_sum_ref2_hi); - sad_neon_64(vec_src_00, vec_src_16, vec_src_32, vec_src_48, ref3, - &vec_sum_ref3_lo, &vec_sum_ref3_hi); - - src += src_stride; - ref0 += ref_stride; - ref1 += ref_stride; - ref2 += ref_stride; - ref3 += ref_stride; - } - - res[0] = horizontal_long_add_16x8(vec_sum_ref0_lo, vec_sum_ref0_hi); - res[1] = horizontal_long_add_16x8(vec_sum_ref1_lo, vec_sum_ref1_hi); - res[2] = horizontal_long_add_16x8(vec_sum_ref2_lo, vec_sum_ref2_hi); - res[3] = horizontal_long_add_16x8(vec_sum_ref3_lo, vec_sum_ref3_hi); -} - -void vp9_sad32x32x4d_neon(const uint8_t *src, int src_stride, - const uint8_t* const ref[4], int ref_stride, - unsigned int *res) { - int i; - uint16x8_t vec_sum_ref0_lo = vdupq_n_u16(0); - uint16x8_t vec_sum_ref0_hi = vdupq_n_u16(0); - uint16x8_t vec_sum_ref1_lo = vdupq_n_u16(0); - uint16x8_t vec_sum_ref1_hi = vdupq_n_u16(0); - uint16x8_t vec_sum_ref2_lo = vdupq_n_u16(0); - uint16x8_t vec_sum_ref2_hi = vdupq_n_u16(0); - uint16x8_t vec_sum_ref3_lo = vdupq_n_u16(0); - uint16x8_t vec_sum_ref3_hi = vdupq_n_u16(0); - const uint8_t *ref0, *ref1, *ref2, *ref3; - ref0 = ref[0]; - ref1 = ref[1]; - ref2 = ref[2]; - ref3 = ref[3]; - - for (i = 0; i < 32; ++i) { - const uint8x16_t vec_src_00 = vld1q_u8(src); - const uint8x16_t vec_src_16 = vld1q_u8(src + 16); - - sad_neon_32(vec_src_00, vec_src_16, ref0, - &vec_sum_ref0_lo, &vec_sum_ref0_hi); - sad_neon_32(vec_src_00, vec_src_16, ref1, - &vec_sum_ref1_lo, &vec_sum_ref1_hi); - sad_neon_32(vec_src_00, vec_src_16, ref2, - &vec_sum_ref2_lo, &vec_sum_ref2_hi); - sad_neon_32(vec_src_00, vec_src_16, ref3, - &vec_sum_ref3_lo, &vec_sum_ref3_hi); - - src += src_stride; - ref0 += ref_stride; - ref1 += ref_stride; - ref2 += ref_stride; - ref3 += ref_stride; - } - - res[0] = horizontal_long_add_16x8(vec_sum_ref0_lo, vec_sum_ref0_hi); - res[1] = horizontal_long_add_16x8(vec_sum_ref1_lo, vec_sum_ref1_hi); - res[2] = horizontal_long_add_16x8(vec_sum_ref2_lo, vec_sum_ref2_hi); - res[3] = horizontal_long_add_16x8(vec_sum_ref3_lo, vec_sum_ref3_hi); -} - -void vp9_sad16x16x4d_neon(const uint8_t *src, int src_stride, - const uint8_t* const ref[4], int ref_stride, - unsigned int *res) { - int i; - uint16x8_t vec_sum_ref0_lo = vdupq_n_u16(0); - uint16x8_t vec_sum_ref0_hi = vdupq_n_u16(0); - uint16x8_t vec_sum_ref1_lo = vdupq_n_u16(0); - uint16x8_t vec_sum_ref1_hi = vdupq_n_u16(0); - uint16x8_t vec_sum_ref2_lo = vdupq_n_u16(0); - uint16x8_t vec_sum_ref2_hi = vdupq_n_u16(0); - uint16x8_t vec_sum_ref3_lo = vdupq_n_u16(0); - uint16x8_t vec_sum_ref3_hi = vdupq_n_u16(0); - const uint8_t *ref0, *ref1, *ref2, *ref3; - ref0 = ref[0]; - ref1 = ref[1]; - ref2 = ref[2]; - ref3 = ref[3]; - - for (i = 0; i < 16; ++i) { - const uint8x16_t vec_src = vld1q_u8(src); - const uint8x16_t vec_ref0 = vld1q_u8(ref0); - const uint8x16_t vec_ref1 = vld1q_u8(ref1); - const uint8x16_t vec_ref2 = vld1q_u8(ref2); - const uint8x16_t vec_ref3 = vld1q_u8(ref3); - - vec_sum_ref0_lo = vabal_u8(vec_sum_ref0_lo, vget_low_u8(vec_src), - vget_low_u8(vec_ref0)); - vec_sum_ref0_hi = vabal_u8(vec_sum_ref0_hi, vget_high_u8(vec_src), - vget_high_u8(vec_ref0)); - vec_sum_ref1_lo = vabal_u8(vec_sum_ref1_lo, vget_low_u8(vec_src), - vget_low_u8(vec_ref1)); - vec_sum_ref1_hi = vabal_u8(vec_sum_ref1_hi, vget_high_u8(vec_src), - vget_high_u8(vec_ref1)); - vec_sum_ref2_lo = vabal_u8(vec_sum_ref2_lo, vget_low_u8(vec_src), - vget_low_u8(vec_ref2)); - vec_sum_ref2_hi = vabal_u8(vec_sum_ref2_hi, vget_high_u8(vec_src), - vget_high_u8(vec_ref2)); - vec_sum_ref3_lo = vabal_u8(vec_sum_ref3_lo, vget_low_u8(vec_src), - vget_low_u8(vec_ref3)); - vec_sum_ref3_hi = vabal_u8(vec_sum_ref3_hi, vget_high_u8(vec_src), - vget_high_u8(vec_ref3)); - - src += src_stride; - ref0 += ref_stride; - ref1 += ref_stride; - ref2 += ref_stride; - ref3 += ref_stride; - } - - res[0] = horizontal_long_add_16x8(vec_sum_ref0_lo, vec_sum_ref0_hi); - res[1] = horizontal_long_add_16x8(vec_sum_ref1_lo, vec_sum_ref1_hi); - res[2] = horizontal_long_add_16x8(vec_sum_ref2_lo, vec_sum_ref2_hi); - res[3] = horizontal_long_add_16x8(vec_sum_ref3_lo, vec_sum_ref3_hi); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_sad_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_sad_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_sad_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_sad_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "./vp9_rtcd.h" -#include "./vpx_config.h" - -#include "vpx/vpx_integer.h" - -static INLINE unsigned int horizontal_long_add_16x8(const uint16x8_t vec_lo, - const uint16x8_t vec_hi) { - const uint32x4_t vec_l_lo = vaddl_u16(vget_low_u16(vec_lo), - vget_high_u16(vec_lo)); - const uint32x4_t vec_l_hi = vaddl_u16(vget_low_u16(vec_hi), - vget_high_u16(vec_hi)); - const uint32x4_t a = vaddq_u32(vec_l_lo, vec_l_hi); - const uint64x2_t b = vpaddlq_u32(a); - const uint32x2_t c = vadd_u32(vreinterpret_u32_u64(vget_low_u64(b)), - vreinterpret_u32_u64(vget_high_u64(b))); - return vget_lane_u32(c, 0); -} -static INLINE unsigned int horizontal_add_16x8(const uint16x8_t vec_16x8) { - const uint32x4_t a = vpaddlq_u16(vec_16x8); - const uint64x2_t b = vpaddlq_u32(a); - const uint32x2_t c = vadd_u32(vreinterpret_u32_u64(vget_low_u64(b)), - vreinterpret_u32_u64(vget_high_u64(b))); - return vget_lane_u32(c, 0); -} - -unsigned int vp9_sad64x64_neon(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride) { - int i; - uint16x8_t vec_accum_lo = vdupq_n_u16(0); - uint16x8_t vec_accum_hi = vdupq_n_u16(0); - for (i = 0; i < 64; ++i) { - const uint8x16_t vec_src_00 = vld1q_u8(src); - const uint8x16_t vec_src_16 = vld1q_u8(src + 16); - const uint8x16_t vec_src_32 = vld1q_u8(src + 32); - const uint8x16_t vec_src_48 = vld1q_u8(src + 48); - const uint8x16_t vec_ref_00 = vld1q_u8(ref); - const uint8x16_t vec_ref_16 = vld1q_u8(ref + 16); - const uint8x16_t vec_ref_32 = vld1q_u8(ref + 32); - const uint8x16_t vec_ref_48 = vld1q_u8(ref + 48); - src += src_stride; - ref += ref_stride; - vec_accum_lo = vabal_u8(vec_accum_lo, vget_low_u8(vec_src_00), - vget_low_u8(vec_ref_00)); - vec_accum_hi = vabal_u8(vec_accum_hi, vget_high_u8(vec_src_00), - vget_high_u8(vec_ref_00)); - vec_accum_lo = vabal_u8(vec_accum_lo, vget_low_u8(vec_src_16), - vget_low_u8(vec_ref_16)); - vec_accum_hi = vabal_u8(vec_accum_hi, vget_high_u8(vec_src_16), - vget_high_u8(vec_ref_16)); - vec_accum_lo = vabal_u8(vec_accum_lo, vget_low_u8(vec_src_32), - vget_low_u8(vec_ref_32)); - vec_accum_hi = vabal_u8(vec_accum_hi, vget_high_u8(vec_src_32), - vget_high_u8(vec_ref_32)); - vec_accum_lo = vabal_u8(vec_accum_lo, vget_low_u8(vec_src_48), - vget_low_u8(vec_ref_48)); - vec_accum_hi = vabal_u8(vec_accum_hi, vget_high_u8(vec_src_48), - vget_high_u8(vec_ref_48)); - } - return horizontal_long_add_16x8(vec_accum_lo, vec_accum_hi); -} - -unsigned int vp9_sad32x32_neon(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride) { - int i; - uint16x8_t vec_accum_lo = vdupq_n_u16(0); - uint16x8_t vec_accum_hi = vdupq_n_u16(0); - - for (i = 0; i < 32; ++i) { - const uint8x16_t vec_src_00 = vld1q_u8(src); - const uint8x16_t vec_src_16 = vld1q_u8(src + 16); - const uint8x16_t vec_ref_00 = vld1q_u8(ref); - const uint8x16_t vec_ref_16 = vld1q_u8(ref + 16); - src += src_stride; - ref += ref_stride; - vec_accum_lo = vabal_u8(vec_accum_lo, vget_low_u8(vec_src_00), - vget_low_u8(vec_ref_00)); - vec_accum_hi = vabal_u8(vec_accum_hi, vget_high_u8(vec_src_00), - vget_high_u8(vec_ref_00)); - vec_accum_lo = vabal_u8(vec_accum_lo, vget_low_u8(vec_src_16), - vget_low_u8(vec_ref_16)); - vec_accum_hi = vabal_u8(vec_accum_hi, vget_high_u8(vec_src_16), - vget_high_u8(vec_ref_16)); - } - return horizontal_add_16x8(vaddq_u16(vec_accum_lo, vec_accum_hi)); -} - -unsigned int vp9_sad16x16_neon(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride) { - int i; - uint16x8_t vec_accum_lo = vdupq_n_u16(0); - uint16x8_t vec_accum_hi = vdupq_n_u16(0); - - for (i = 0; i < 16; ++i) { - const uint8x16_t vec_src = vld1q_u8(src); - const uint8x16_t vec_ref = vld1q_u8(ref); - src += src_stride; - ref += ref_stride; - vec_accum_lo = vabal_u8(vec_accum_lo, vget_low_u8(vec_src), - vget_low_u8(vec_ref)); - vec_accum_hi = vabal_u8(vec_accum_hi, vget_high_u8(vec_src), - vget_high_u8(vec_ref)); - } - return horizontal_add_16x8(vaddq_u16(vec_accum_lo, vec_accum_hi)); -} - -unsigned int vp9_sad8x8_neon(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride) { - int i; - uint16x8_t vec_accum = vdupq_n_u16(0); - - for (i = 0; i < 8; ++i) { - const uint8x8_t vec_src = vld1_u8(src); - const uint8x8_t vec_ref = vld1_u8(ref); - src += src_stride; - ref += ref_stride; - vec_accum = vabal_u8(vec_accum, vec_src, vec_ref); - } - return horizontal_add_16x8(vec_accum); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_subtract_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_subtract_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_subtract_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_subtract_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "./vp9_rtcd.h" -#include "./vpx_config.h" - -#include "vpx/vpx_integer.h" - -void vp9_subtract_block_neon(int rows, int cols, - int16_t *diff, ptrdiff_t diff_stride, - const uint8_t *src, ptrdiff_t src_stride, - const uint8_t *pred, ptrdiff_t pred_stride) { - int r, c; - - if (cols > 16) { - for (r = 0; r < rows; ++r) { - for (c = 0; c < cols; c += 32) { - const uint8x16_t v_src_00 = vld1q_u8(&src[c + 0]); - const uint8x16_t v_src_16 = vld1q_u8(&src[c + 16]); - const uint8x16_t v_pred_00 = vld1q_u8(&pred[c + 0]); - const uint8x16_t v_pred_16 = vld1q_u8(&pred[c + 16]); - const uint16x8_t v_diff_lo_00 = vsubl_u8(vget_low_u8(v_src_00), - vget_low_u8(v_pred_00)); - const uint16x8_t v_diff_hi_00 = vsubl_u8(vget_high_u8(v_src_00), - vget_high_u8(v_pred_00)); - const uint16x8_t v_diff_lo_16 = vsubl_u8(vget_low_u8(v_src_16), - vget_low_u8(v_pred_16)); - const uint16x8_t v_diff_hi_16 = vsubl_u8(vget_high_u8(v_src_16), - vget_high_u8(v_pred_16)); - vst1q_s16(&diff[c + 0], vreinterpretq_s16_u16(v_diff_lo_00)); - vst1q_s16(&diff[c + 8], vreinterpretq_s16_u16(v_diff_hi_00)); - vst1q_s16(&diff[c + 16], vreinterpretq_s16_u16(v_diff_lo_16)); - vst1q_s16(&diff[c + 24], vreinterpretq_s16_u16(v_diff_hi_16)); - } - diff += diff_stride; - pred += pred_stride; - src += src_stride; - } - } else if (cols > 8) { - for (r = 0; r < rows; ++r) { - const uint8x16_t v_src = vld1q_u8(&src[0]); - const uint8x16_t v_pred = vld1q_u8(&pred[0]); - const uint16x8_t v_diff_lo = vsubl_u8(vget_low_u8(v_src), - vget_low_u8(v_pred)); - const uint16x8_t v_diff_hi = vsubl_u8(vget_high_u8(v_src), - vget_high_u8(v_pred)); - vst1q_s16(&diff[0], vreinterpretq_s16_u16(v_diff_lo)); - vst1q_s16(&diff[8], vreinterpretq_s16_u16(v_diff_hi)); - diff += diff_stride; - pred += pred_stride; - src += src_stride; - } - } else if (cols > 4) { - for (r = 0; r < rows; ++r) { - const uint8x8_t v_src = vld1_u8(&src[0]); - const uint8x8_t v_pred = vld1_u8(&pred[0]); - const uint16x8_t v_diff = vsubl_u8(v_src, v_pred); - vst1q_s16(&diff[0], vreinterpretq_s16_u16(v_diff)); - diff += diff_stride; - pred += pred_stride; - src += src_stride; - } - } else { - for (r = 0; r < rows; ++r) { - for (c = 0; c < cols; ++c) - diff[c] = src[c] - pred[c]; - - diff += diff_stride; - pred += pred_stride; - src += src_stride; - } - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_variance_neon.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_variance_neon.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_variance_neon.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/arm/neon/vp9_variance_neon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,305 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "./vp9_rtcd.h" -#include "./vpx_config.h" - -#include "vpx_ports/mem.h" -#include "vpx/vpx_integer.h" - -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_filter.h" - -#include "vp9/encoder/vp9_variance.h" - -enum { kWidth8 = 8 }; -enum { kHeight8 = 8 }; -enum { kHeight8PlusOne = 9 }; -enum { kWidth16 = 16 }; -enum { kHeight16 = 16 }; -enum { kHeight16PlusOne = 17 }; -enum { kWidth32 = 32 }; -enum { kHeight32 = 32 }; -enum { kHeight32PlusOne = 33 }; -enum { kWidth64 = 64 }; -enum { kHeight64 = 64 }; -enum { kHeight64PlusOne = 65 }; -enum { kPixelStepOne = 1 }; -enum { kAlign16 = 16 }; - -static INLINE int horizontal_add_s16x8(const int16x8_t v_16x8) { - const int32x4_t a = vpaddlq_s16(v_16x8); - const int64x2_t b = vpaddlq_s32(a); - const int32x2_t c = vadd_s32(vreinterpret_s32_s64(vget_low_s64(b)), - vreinterpret_s32_s64(vget_high_s64(b))); - return vget_lane_s32(c, 0); -} - -static INLINE int horizontal_add_s32x4(const int32x4_t v_32x4) { - const int64x2_t b = vpaddlq_s32(v_32x4); - const int32x2_t c = vadd_s32(vreinterpret_s32_s64(vget_low_s64(b)), - vreinterpret_s32_s64(vget_high_s64(b))); - return vget_lane_s32(c, 0); -} - -// w * h must be less than 2048 or local variable v_sum may overflow. -static void variance_neon_w8(const uint8_t *a, int a_stride, - const uint8_t *b, int b_stride, - int w, int h, uint32_t *sse, int *sum) { - int i, j; - int16x8_t v_sum = vdupq_n_s16(0); - int32x4_t v_sse_lo = vdupq_n_s32(0); - int32x4_t v_sse_hi = vdupq_n_s32(0); - - for (i = 0; i < h; ++i) { - for (j = 0; j < w; j += 8) { - const uint8x8_t v_a = vld1_u8(&a[j]); - const uint8x8_t v_b = vld1_u8(&b[j]); - const uint16x8_t v_diff = vsubl_u8(v_a, v_b); - const int16x8_t sv_diff = vreinterpretq_s16_u16(v_diff); - v_sum = vaddq_s16(v_sum, sv_diff); - v_sse_lo = vmlal_s16(v_sse_lo, - vget_low_s16(sv_diff), - vget_low_s16(sv_diff)); - v_sse_hi = vmlal_s16(v_sse_hi, - vget_high_s16(sv_diff), - vget_high_s16(sv_diff)); - } - a += a_stride; - b += b_stride; - } - - *sum = horizontal_add_s16x8(v_sum); - *sse = (unsigned int)horizontal_add_s32x4(vaddq_s32(v_sse_lo, v_sse_hi)); -} - -void vp9_get8x8var_neon(const uint8_t *src_ptr, int source_stride, - const uint8_t *ref_ptr, int ref_stride, - unsigned int *sse, int *sum) { - variance_neon_w8(src_ptr, source_stride, ref_ptr, ref_stride, kWidth8, - kHeight8, sse, sum); -} - -unsigned int vp9_variance8x8_neon(const uint8_t *a, int a_stride, - const uint8_t *b, int b_stride, - unsigned int *sse) { - int sum; - variance_neon_w8(a, a_stride, b, b_stride, kWidth8, kHeight8, sse, &sum); - return *sse - (((int64_t)sum * sum) >> 6); // >> 6 = / 8 * 8 -} - -void vp9_get16x16var_neon(const uint8_t *src_ptr, int source_stride, - const uint8_t *ref_ptr, int ref_stride, - unsigned int *sse, int *sum) { - variance_neon_w8(src_ptr, source_stride, ref_ptr, ref_stride, kWidth16, - kHeight16, sse, sum); -} - -unsigned int vp9_variance16x16_neon(const uint8_t *a, int a_stride, - const uint8_t *b, int b_stride, - unsigned int *sse) { - int sum; - variance_neon_w8(a, a_stride, b, b_stride, kWidth16, kHeight16, sse, &sum); - return *sse - (((int64_t)sum * sum) >> 8); // >> 8 = / 16 * 16 -} - -static void var_filter_block2d_bil_w8(const uint8_t *src_ptr, - uint8_t *output_ptr, - unsigned int src_pixels_per_line, - int pixel_step, - unsigned int output_height, - unsigned int output_width, - const int16_t *vp9_filter) { - const uint8x8_t f0 = vmov_n_u8((uint8_t)vp9_filter[0]); - const uint8x8_t f1 = vmov_n_u8((uint8_t)vp9_filter[1]); - unsigned int i; - for (i = 0; i < output_height; ++i) { - const uint8x8_t src_0 = vld1_u8(&src_ptr[0]); - const uint8x8_t src_1 = vld1_u8(&src_ptr[pixel_step]); - const uint16x8_t a = vmull_u8(src_0, f0); - const uint16x8_t b = vmlal_u8(a, src_1, f1); - const uint8x8_t out = vrshrn_n_u16(b, FILTER_BITS); - vst1_u8(&output_ptr[0], out); - // Next row... - src_ptr += src_pixels_per_line; - output_ptr += output_width; - } -} - -static void var_filter_block2d_bil_w16(const uint8_t *src_ptr, - uint8_t *output_ptr, - unsigned int src_pixels_per_line, - int pixel_step, - unsigned int output_height, - unsigned int output_width, - const int16_t *vp9_filter) { - const uint8x8_t f0 = vmov_n_u8((uint8_t)vp9_filter[0]); - const uint8x8_t f1 = vmov_n_u8((uint8_t)vp9_filter[1]); - unsigned int i, j; - for (i = 0; i < output_height; ++i) { - for (j = 0; j < output_width; j += 16) { - const uint8x16_t src_0 = vld1q_u8(&src_ptr[j]); - const uint8x16_t src_1 = vld1q_u8(&src_ptr[j + pixel_step]); - const uint16x8_t a = vmull_u8(vget_low_u8(src_0), f0); - const uint16x8_t b = vmlal_u8(a, vget_low_u8(src_1), f1); - const uint8x8_t out_lo = vrshrn_n_u16(b, FILTER_BITS); - const uint16x8_t c = vmull_u8(vget_high_u8(src_0), f0); - const uint16x8_t d = vmlal_u8(c, vget_high_u8(src_1), f1); - const uint8x8_t out_hi = vrshrn_n_u16(d, FILTER_BITS); - vst1q_u8(&output_ptr[j], vcombine_u8(out_lo, out_hi)); - } - // Next row... - src_ptr += src_pixels_per_line; - output_ptr += output_width; - } -} - -unsigned int vp9_sub_pixel_variance8x8_neon(const uint8_t *src, - int src_stride, - int xoffset, - int yoffset, - const uint8_t *dst, - int dst_stride, - unsigned int *sse) { - DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, temp2, kHeight8 * kWidth8); - DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, fdata3, kHeight8PlusOne * kWidth8); - - var_filter_block2d_bil_w8(src, fdata3, src_stride, kPixelStepOne, - kHeight8PlusOne, kWidth8, - BILINEAR_FILTERS_2TAP(xoffset)); - var_filter_block2d_bil_w8(fdata3, temp2, kWidth8, kWidth8, kHeight8, - kWidth8, BILINEAR_FILTERS_2TAP(yoffset)); - return vp9_variance8x8_neon(temp2, kWidth8, dst, dst_stride, sse); -} - -unsigned int vp9_sub_pixel_variance16x16_neon(const uint8_t *src, - int src_stride, - int xoffset, - int yoffset, - const uint8_t *dst, - int dst_stride, - unsigned int *sse) { - DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, temp2, kHeight16 * kWidth16); - DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, fdata3, kHeight16PlusOne * kWidth16); - - var_filter_block2d_bil_w16(src, fdata3, src_stride, kPixelStepOne, - kHeight16PlusOne, kWidth16, - BILINEAR_FILTERS_2TAP(xoffset)); - var_filter_block2d_bil_w16(fdata3, temp2, kWidth16, kWidth16, kHeight16, - kWidth16, BILINEAR_FILTERS_2TAP(yoffset)); - return vp9_variance16x16_neon(temp2, kWidth16, dst, dst_stride, sse); -} - -void vp9_get32x32var_neon(const uint8_t *src_ptr, int source_stride, - const uint8_t *ref_ptr, int ref_stride, - unsigned int *sse, int *sum) { - variance_neon_w8(src_ptr, source_stride, ref_ptr, ref_stride, kWidth32, - kHeight32, sse, sum); -} - -unsigned int vp9_variance32x32_neon(const uint8_t *a, int a_stride, - const uint8_t *b, int b_stride, - unsigned int *sse) { - int sum; - variance_neon_w8(a, a_stride, b, b_stride, kWidth32, kHeight32, sse, &sum); - return *sse - (((int64_t)sum * sum) >> 10); // >> 10 = / 32 * 32 -} - -unsigned int vp9_variance32x64_neon(const uint8_t *a, int a_stride, - const uint8_t *b, int b_stride, - unsigned int *sse) { - int sum1, sum2; - uint32_t sse1, sse2; - variance_neon_w8(a, a_stride, b, b_stride, kWidth32, kHeight32, &sse1, &sum1); - variance_neon_w8(a + (kHeight32 * a_stride), a_stride, - b + (kHeight32 * b_stride), b_stride, kWidth32, kHeight32, - &sse2, &sum2); - *sse = sse1 + sse2; - sum1 += sum2; - return *sse - (((int64_t)sum1 * sum1) >> 11); // >> 11 = / 32 * 64 -} - -unsigned int vp9_variance64x32_neon(const uint8_t *a, int a_stride, - const uint8_t *b, int b_stride, - unsigned int *sse) { - int sum1, sum2; - uint32_t sse1, sse2; - variance_neon_w8(a, a_stride, b, b_stride, kWidth64, kHeight16, &sse1, &sum1); - variance_neon_w8(a + (kHeight16 * a_stride), a_stride, - b + (kHeight16 * b_stride), b_stride, kWidth64, kHeight16, - &sse2, &sum2); - *sse = sse1 + sse2; - sum1 += sum2; - return *sse - (((int64_t)sum1 * sum1) >> 11); // >> 11 = / 32 * 64 -} - -unsigned int vp9_variance64x64_neon(const uint8_t *a, int a_stride, - const uint8_t *b, int b_stride, - unsigned int *sse) { - int sum1, sum2; - uint32_t sse1, sse2; - - variance_neon_w8(a, a_stride, b, b_stride, kWidth64, kHeight16, &sse1, &sum1); - variance_neon_w8(a + (kHeight16 * a_stride), a_stride, - b + (kHeight16 * b_stride), b_stride, kWidth64, kHeight16, - &sse2, &sum2); - sse1 += sse2; - sum1 += sum2; - - variance_neon_w8(a + (kHeight16 * 2 * a_stride), a_stride, - b + (kHeight16 * 2 * b_stride), b_stride, - kWidth64, kHeight16, &sse2, &sum2); - sse1 += sse2; - sum1 += sum2; - - variance_neon_w8(a + (kHeight16 * 3 * a_stride), a_stride, - b + (kHeight16 * 3 * b_stride), b_stride, - kWidth64, kHeight16, &sse2, &sum2); - *sse = sse1 + sse2; - sum1 += sum2; - return *sse - (((int64_t)sum1 * sum1) >> 12); // >> 12 = / 64 * 64 -} - -unsigned int vp9_sub_pixel_variance32x32_neon(const uint8_t *src, - int src_stride, - int xoffset, - int yoffset, - const uint8_t *dst, - int dst_stride, - unsigned int *sse) { - DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, temp2, kHeight32 * kWidth32); - DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, fdata3, kHeight32PlusOne * kWidth32); - - var_filter_block2d_bil_w16(src, fdata3, src_stride, kPixelStepOne, - kHeight32PlusOne, kWidth32, - BILINEAR_FILTERS_2TAP(xoffset)); - var_filter_block2d_bil_w16(fdata3, temp2, kWidth32, kWidth32, kHeight32, - kWidth32, BILINEAR_FILTERS_2TAP(yoffset)); - return vp9_variance32x32_neon(temp2, kWidth32, dst, dst_stride, sse); -} - -unsigned int vp9_sub_pixel_variance64x64_neon(const uint8_t *src, - int src_stride, - int xoffset, - int yoffset, - const uint8_t *dst, - int dst_stride, - unsigned int *sse) { - DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, temp2, kHeight64 * kWidth64); - DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, fdata3, kHeight64PlusOne * kWidth64); - - var_filter_block2d_bil_w16(src, fdata3, src_stride, kPixelStepOne, - kHeight64PlusOne, kWidth64, - BILINEAR_FILTERS_2TAP(xoffset)); - var_filter_block2d_bil_w16(fdata3, temp2, kWidth64, kWidth64, kHeight64, - kWidth64, BILINEAR_FILTERS_2TAP(yoffset)); - return vp9_variance64x64_neon(temp2, kWidth64, dst, dst_stride, sse); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_aq_complexity.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_aq_complexity.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_aq_complexity.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_aq_complexity.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,163 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "vp9/encoder/vp9_aq_variance.h" -#include "vp9/encoder/vp9_encodeframe.h" -#include "vp9/common/vp9_seg_common.h" -#include "vp9/encoder/vp9_segmentation.h" - -#define AQ_C_SEGMENTS 5 -#define DEFAULT_AQ2_SEG 3 // Neutral Q segment -#define AQ_C_STRENGTHS 3 -static const double aq_c_q_adj_factor[AQ_C_STRENGTHS][AQ_C_SEGMENTS] = - { {1.75, 1.25, 1.05, 1.00, 0.90}, - {2.00, 1.50, 1.15, 1.00, 0.85}, - {2.50, 1.75, 1.25, 1.00, 0.80} }; -static const double aq_c_transitions[AQ_C_STRENGTHS][AQ_C_SEGMENTS] = - { {0.15, 0.30, 0.55, 2.00, 100.0}, - {0.20, 0.40, 0.65, 2.00, 100.0}, - {0.25, 0.50, 0.75, 2.00, 100.0} }; -static const double aq_c_var_thresholds[AQ_C_STRENGTHS][AQ_C_SEGMENTS] = - { {-4.0, -3.0, -2.0, 100.00, 100.0}, - {-3.5, -2.5, -1.5, 100.00, 100.0}, - {-3.0, -2.0, -1.0, 100.00, 100.0} }; - -#define DEFAULT_COMPLEXITY 64 - - -static int get_aq_c_strength(int q_index, vpx_bit_depth_t bit_depth) { - // Approximate base quatizer (truncated to int) - const int base_quant = vp9_ac_quant(q_index, 0, bit_depth) / 4; - return (base_quant > 10) + (base_quant > 25); -} - -void vp9_setup_in_frame_q_adj(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - struct segmentation *const seg = &cm->seg; - - // Make SURE use of floating point in this function is safe. - vp9_clear_system_state(); - - if (cm->frame_type == KEY_FRAME || - cpi->refresh_alt_ref_frame || - (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref)) { - int segment; - const int aq_strength = get_aq_c_strength(cm->base_qindex, cm->bit_depth); - - // Clear down the segment map. - vpx_memset(cpi->segmentation_map, DEFAULT_AQ2_SEG, - cm->mi_rows * cm->mi_cols); - - vp9_clearall_segfeatures(seg); - - // Segmentation only makes sense if the target bits per SB is above a - // threshold. Below this the overheads will usually outweigh any benefit. - if (cpi->rc.sb64_target_rate < 256) { - vp9_disable_segmentation(seg); - return; - } - - vp9_enable_segmentation(seg); - - // Select delta coding method. - seg->abs_delta = SEGMENT_DELTADATA; - - // Default segment "Q" feature is disabled so it defaults to the baseline Q. - vp9_disable_segfeature(seg, DEFAULT_AQ2_SEG, SEG_LVL_ALT_Q); - - // Use some of the segments for in frame Q adjustment. - for (segment = 0; segment < AQ_C_SEGMENTS; ++segment) { - int qindex_delta; - - if (segment == DEFAULT_AQ2_SEG) - continue; - - qindex_delta = - vp9_compute_qdelta_by_rate(&cpi->rc, cm->frame_type, cm->base_qindex, - aq_c_q_adj_factor[aq_strength][segment], - cm->bit_depth); - - - // For AQ complexity mode, we dont allow Q0 in a segment if the base - // Q is not 0. Q0 (lossless) implies 4x4 only and in AQ mode 2 a segment - // Q delta is sometimes applied without going back around the rd loop. - // This could lead to an illegal combination of partition size and q. - if ((cm->base_qindex != 0) && ((cm->base_qindex + qindex_delta) == 0)) { - qindex_delta = -cm->base_qindex + 1; - } - if ((cm->base_qindex + qindex_delta) > 0) { - vp9_enable_segfeature(seg, segment, SEG_LVL_ALT_Q); - vp9_set_segdata(seg, segment, SEG_LVL_ALT_Q, qindex_delta); - } - } - } -} - -#define DEFAULT_LV_THRESH 10.0 -#define MIN_DEFAULT_LV_THRESH 8.0 -#define VAR_STRENGTH_STEP 0.25 -// Select a segment for the current block. -// The choice of segment for a block depends on the ratio of the projected -// bits for the block vs a target average and its spatial complexity. -void vp9_caq_select_segment(VP9_COMP *cpi, MACROBLOCK *mb, BLOCK_SIZE bs, - int mi_row, int mi_col, int projected_rate) { - VP9_COMMON *const cm = &cpi->common; - - const int mi_offset = mi_row * cm->mi_cols + mi_col; - const int bw = num_8x8_blocks_wide_lookup[BLOCK_64X64]; - const int bh = num_8x8_blocks_high_lookup[BLOCK_64X64]; - const int xmis = MIN(cm->mi_cols - mi_col, num_8x8_blocks_wide_lookup[bs]); - const int ymis = MIN(cm->mi_rows - mi_row, num_8x8_blocks_high_lookup[bs]); - int x, y; - int i; - unsigned char segment; - - if (0) { - segment = DEFAULT_AQ2_SEG; - } else { - // Rate depends on fraction of a SB64 in frame (xmis * ymis / bw * bh). - // It is converted to bits * 256 units. - const int target_rate = (cpi->rc.sb64_target_rate * xmis * ymis * 256) / - (bw * bh); - double logvar; - double low_var_thresh; - const int aq_strength = get_aq_c_strength(cm->base_qindex, cm->bit_depth); - - vp9_clear_system_state(); - low_var_thresh = (cpi->oxcf.pass == 2) - ? MAX(cpi->twopass.mb_av_energy, MIN_DEFAULT_LV_THRESH) - : DEFAULT_LV_THRESH; - - vp9_setup_src_planes(mb, cpi->Source, mi_row, mi_col); - logvar = vp9_log_block_var(cpi, mb, bs); - - segment = AQ_C_SEGMENTS - 1; // Just in case no break out below. - for (i = 0; i < AQ_C_SEGMENTS; ++i) { - // Test rate against a threshold value and variance against a threshold. - // Increasing segment number (higher variance and complexity) = higher Q. - if ((projected_rate < - target_rate * aq_c_transitions[aq_strength][i]) && - (logvar < (low_var_thresh + aq_c_var_thresholds[aq_strength][i]))) { - segment = i; - break; - } - } - } - - // Fill in the entires in the segment map corresponding to this SB64. - for (y = 0; y < ymis; y++) { - for (x = 0; x < xmis; x++) { - cpi->segmentation_map[mi_offset + y * cm->mi_cols + x] = segment; - } - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_aq_complexity.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_aq_complexity.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_aq_complexity.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_aq_complexity.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP9_ENCODER_VP9_AQ_COMPLEXITY_H_ -#define VP9_ENCODER_VP9_AQ_COMPLEXITY_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -struct VP9_COMP; -struct macroblock; - -// Select a segment for the current Block. -void vp9_caq_select_segment(struct VP9_COMP *cpi, struct macroblock *, - BLOCK_SIZE bs, - int mi_row, int mi_col, int projected_rate); - -// This function sets up a set of segments with delta Q values around -// the baseline frame quantizer. -void vp9_setup_in_frame_q_adj(struct VP9_COMP *cpi); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_AQ_COMPLEXITY_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_aq_cyclicrefresh.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_aq_cyclicrefresh.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_aq_cyclicrefresh.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_aq_cyclicrefresh.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,480 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "vp9/encoder/vp9_aq_cyclicrefresh.h" - -#include "vp9/common/vp9_seg_common.h" - -#include "vp9/encoder/vp9_ratectrl.h" -#include "vp9/encoder/vp9_segmentation.h" - -struct CYCLIC_REFRESH { - // Percentage of blocks per frame that are targeted as candidates - // for cyclic refresh. - int percent_refresh; - // Maximum q-delta as percentage of base q. - int max_qdelta_perc; - // Superblock starting index for cycling through the frame. - int sb_index; - // Controls how long block will need to wait to be refreshed again, in - // excess of the cycle time, i.e., in the case of all zero motion, block - // will be refreshed every (100/percent_refresh + time_for_refresh) frames. - int time_for_refresh; - // Target number of (8x8) blocks that are set for delta-q. - int target_num_seg_blocks; - // Actual number of (8x8) blocks that were applied delta-q. - int actual_num_seg1_blocks; - int actual_num_seg2_blocks; - // RD mult. parameters for segment 1. - int rdmult; - // Cyclic refresh map. - signed char *map; - // Thresholds applied to the projected rate/distortion of the coding block, - // when deciding whether block should be refreshed. - int64_t thresh_rate_sb; - int64_t thresh_dist_sb; - // Threshold applied to the motion vector (in units of 1/8 pel) of the - // coding block, when deciding whether block should be refreshed. - int16_t motion_thresh; - // Rate target ratio to set q delta. - double rate_ratio_qdelta; - double low_content_avg; - int qindex_delta_seg1; - int qindex_delta_seg2; -}; - -CYCLIC_REFRESH *vp9_cyclic_refresh_alloc(int mi_rows, int mi_cols) { - CYCLIC_REFRESH *const cr = vpx_calloc(1, sizeof(*cr)); - if (cr == NULL) - return NULL; - - cr->map = vpx_calloc(mi_rows * mi_cols, sizeof(*cr->map)); - if (cr->map == NULL) { - vpx_free(cr); - return NULL; - } - - return cr; -} - -void vp9_cyclic_refresh_free(CYCLIC_REFRESH *cr) { - vpx_free(cr->map); - vpx_free(cr); -} - -// Check if we should turn off cyclic refresh based on bitrate condition. -static int apply_cyclic_refresh_bitrate(const VP9_COMMON *cm, - const RATE_CONTROL *rc) { - // Turn off cyclic refresh if bits available per frame is not sufficiently - // larger than bit cost of segmentation. Segment map bit cost should scale - // with number of seg blocks, so compare available bits to number of blocks. - // Average bits available per frame = avg_frame_bandwidth - // Number of (8x8) blocks in frame = mi_rows * mi_cols; - const float factor = 0.25; - const int number_blocks = cm->mi_rows * cm->mi_cols; - // The condition below corresponds to turning off at target bitrates: - // (at 30fps), ~12kbps for CIF, 36kbps for VGA, 100kps for HD/720p. - // Also turn off at very small frame sizes, to avoid too large fraction of - // superblocks to be refreshed per frame. Threshold below is less than QCIF. - if (rc->avg_frame_bandwidth < factor * number_blocks || - number_blocks / 64 < 5) - return 0; - else - return 1; -} - -// Check if this coding block, of size bsize, should be considered for refresh -// (lower-qp coding). Decision can be based on various factors, such as -// size of the coding block (i.e., below min_block size rejected), coding -// mode, and rate/distortion. -static int candidate_refresh_aq(const CYCLIC_REFRESH *cr, - const MB_MODE_INFO *mbmi, - int64_t rate, - int64_t dist, - int bsize) { - MV mv = mbmi->mv[0].as_mv; - // Reject the block for lower-qp coding if projected distortion - // is above the threshold, and any of the following is true: - // 1) mode uses large mv - // 2) mode is an intra-mode - // Otherwise accept for refresh. - if (dist > cr->thresh_dist_sb && - (mv.row > cr->motion_thresh || mv.row < -cr->motion_thresh || - mv.col > cr->motion_thresh || mv.col < -cr->motion_thresh || - !is_inter_block(mbmi))) - return CR_SEGMENT_ID_BASE; - else if (bsize >= BLOCK_16X16 && - rate < cr->thresh_rate_sb && - is_inter_block(mbmi) && - mbmi->mv[0].as_int == 0) - // More aggressive delta-q for bigger blocks with zero motion. - return CR_SEGMENT_ID_BOOST2; - else - return CR_SEGMENT_ID_BOOST1; -} - -// Compute delta-q for the segment. -static int compute_deltaq(const VP9_COMP *cpi, int q, double rate_factor) { - const CYCLIC_REFRESH *const cr = cpi->cyclic_refresh; - const RATE_CONTROL *const rc = &cpi->rc; - int deltaq = vp9_compute_qdelta_by_rate(rc, cpi->common.frame_type, - q, rate_factor, - cpi->common.bit_depth); - if ((-deltaq) > cr->max_qdelta_perc * q / 100) { - deltaq = -cr->max_qdelta_perc * q / 100; - } - return deltaq; -} - -// For the just encoded frame, estimate the bits, incorporating the delta-q -// from non-base segment. For now ignore effect of multiple segments -// (with different delta-q). Note this function is called in the postencode -// (called from rc_update_rate_correction_factors()). -int vp9_cyclic_refresh_estimate_bits_at_q(const VP9_COMP *cpi, - double correction_factor) { - const VP9_COMMON *const cm = &cpi->common; - const CYCLIC_REFRESH *const cr = cpi->cyclic_refresh; - int estimated_bits; - int mbs = cm->MBs; - int num8x8bl = mbs << 2; - // Weight for non-base segments: use actual number of blocks refreshed in - // previous/just encoded frame. Note number of blocks here is in 8x8 units. - double weight_segment1 = (double)cr->actual_num_seg1_blocks / num8x8bl; - double weight_segment2 = (double)cr->actual_num_seg2_blocks / num8x8bl; - // Take segment weighted average for estimated bits. - estimated_bits = (int)((1.0 - weight_segment1 - weight_segment2) * - vp9_estimate_bits_at_q(cm->frame_type, cm->base_qindex, mbs, - correction_factor, cm->bit_depth) + - weight_segment1 * - vp9_estimate_bits_at_q(cm->frame_type, - cm->base_qindex + cr->qindex_delta_seg1, mbs, - correction_factor, cm->bit_depth) + - weight_segment2 * - vp9_estimate_bits_at_q(cm->frame_type, - cm->base_qindex + cr->qindex_delta_seg2, mbs, - correction_factor, cm->bit_depth)); - return estimated_bits; -} - -// Prior to encoding the frame, estimate the bits per mb, for a given q = i and -// a corresponding delta-q (for segment 1). This function is called in the -// rc_regulate_q() to set the base qp index. -// Note: the segment map is set to either 0/CR_SEGMENT_ID_BASE (no refresh) or -// to 1/CR_SEGMENT_ID_BOOST1 (refresh) for each superblock, prior to encoding. -int vp9_cyclic_refresh_rc_bits_per_mb(const VP9_COMP *cpi, int i, - double correction_factor) { - const VP9_COMMON *const cm = &cpi->common; - CYCLIC_REFRESH *const cr = cpi->cyclic_refresh; - int bits_per_mb; - int num8x8bl = cm->MBs << 2; - // Weight for segment prior to encoding: take the average of the target - // number for the frame to be encoded and the actual from the previous frame. - double weight_segment = (double)((cr->target_num_seg_blocks + - cr->actual_num_seg1_blocks + cr->actual_num_seg2_blocks) >> 1) / - num8x8bl; - // Compute delta-q corresponding to qindex i. - int deltaq = compute_deltaq(cpi, i, cr->rate_ratio_qdelta); - // Take segment weighted average for bits per mb. - bits_per_mb = (int)((1.0 - weight_segment) * - vp9_rc_bits_per_mb(cm->frame_type, i, correction_factor, cm->bit_depth) + - weight_segment * - vp9_rc_bits_per_mb(cm->frame_type, i + deltaq, correction_factor, - cm->bit_depth)); - return bits_per_mb; -} - -// Prior to coding a given prediction block, of size bsize at (mi_row, mi_col), -// check if we should reset the segment_id, and update the cyclic_refresh map -// and segmentation map. -void vp9_cyclic_refresh_update_segment(VP9_COMP *const cpi, - MB_MODE_INFO *const mbmi, - int mi_row, int mi_col, - BLOCK_SIZE bsize, - int64_t rate, - int64_t dist, - int skip) { - const VP9_COMMON *const cm = &cpi->common; - CYCLIC_REFRESH *const cr = cpi->cyclic_refresh; - const int bw = num_8x8_blocks_wide_lookup[bsize]; - const int bh = num_8x8_blocks_high_lookup[bsize]; - const int xmis = MIN(cm->mi_cols - mi_col, bw); - const int ymis = MIN(cm->mi_rows - mi_row, bh); - const int block_index = mi_row * cm->mi_cols + mi_col; - const int refresh_this_block = candidate_refresh_aq(cr, mbmi, rate, dist, - bsize); - // Default is to not update the refresh map. - int new_map_value = cr->map[block_index]; - int x = 0; int y = 0; - - // If this block is labeled for refresh, check if we should reset the - // segment_id. - if (cyclic_refresh_segment_id_boosted(mbmi->segment_id)) { - mbmi->segment_id = refresh_this_block; - // Reset segment_id if will be skipped. - if (skip) - mbmi->segment_id = CR_SEGMENT_ID_BASE; - } - - // Update the cyclic refresh map, to be used for setting segmentation map - // for the next frame. If the block will be refreshed this frame, mark it - // as clean. The magnitude of the -ve influences how long before we consider - // it for refresh again. - if (cyclic_refresh_segment_id_boosted(mbmi->segment_id)) { - new_map_value = -cr->time_for_refresh; - } else if (refresh_this_block) { - // Else if it is accepted as candidate for refresh, and has not already - // been refreshed (marked as 1) then mark it as a candidate for cleanup - // for future time (marked as 0), otherwise don't update it. - if (cr->map[block_index] == 1) - new_map_value = 0; - } else { - // Leave it marked as block that is not candidate for refresh. - new_map_value = 1; - } - - // Update entries in the cyclic refresh map with new_map_value, and - // copy mbmi->segment_id into global segmentation map. - for (y = 0; y < ymis; y++) - for (x = 0; x < xmis; x++) { - cr->map[block_index + y * cm->mi_cols + x] = new_map_value; - cpi->segmentation_map[block_index + y * cm->mi_cols + x] = - mbmi->segment_id; - } -} - -// Update the actual number of blocks that were applied the segment delta q. -void vp9_cyclic_refresh_postencode(VP9_COMP *const cpi) { - VP9_COMMON *const cm = &cpi->common; - CYCLIC_REFRESH *const cr = cpi->cyclic_refresh; - unsigned char *const seg_map = cpi->segmentation_map; - int mi_row, mi_col; - cr->actual_num_seg1_blocks = 0; - cr->actual_num_seg2_blocks = 0; - for (mi_row = 0; mi_row < cm->mi_rows; mi_row++) - for (mi_col = 0; mi_col < cm->mi_cols; mi_col++) { - if (cyclic_refresh_segment_id( - seg_map[mi_row * cm->mi_cols + mi_col]) == CR_SEGMENT_ID_BOOST1) - cr->actual_num_seg1_blocks++; - else if (cyclic_refresh_segment_id( - seg_map[mi_row * cm->mi_cols + mi_col]) == CR_SEGMENT_ID_BOOST2) - cr->actual_num_seg2_blocks++; - } -} - -// Set golden frame update interval, for non-svc 1 pass CBR mode. -void vp9_cyclic_refresh_set_golden_update(VP9_COMP *const cpi) { - RATE_CONTROL *const rc = &cpi->rc; - CYCLIC_REFRESH *const cr = cpi->cyclic_refresh; - // Set minimum gf_interval for GF update to a multiple (== 2) of refresh - // period. Depending on past encoding stats, GF flag may be reset and update - // may not occur until next baseline_gf_interval. - if (cr->percent_refresh > 0) - rc->baseline_gf_interval = 2 * (100 / cr->percent_refresh); - else - rc->baseline_gf_interval = 20; -} - -// Update some encoding stats (from the just encoded frame), and if the golden -// reference is to be updated check if we should NOT update the golden ref. -void vp9_cyclic_refresh_check_golden_update(VP9_COMP *const cpi) { - VP9_COMMON *const cm = &cpi->common; - CYCLIC_REFRESH *const cr = cpi->cyclic_refresh; - int mi_row, mi_col; - double fraction_low = 0.0; - int low_content_frame = 0; - for (mi_row = 0; mi_row < cm->mi_rows; mi_row++) - for (mi_col = 0; mi_col < cm->mi_cols; mi_col++) { - if (cr->map[mi_row * cm->mi_cols + mi_col] < 1) - low_content_frame++; - } - fraction_low = - (double)low_content_frame / (cm->mi_rows * cm->mi_cols); - // Update average. - cr->low_content_avg = (fraction_low + 3 * cr->low_content_avg) / 4; - if (cpi->refresh_golden_frame == 1) { - // Don't update golden reference if the amount of low_content for the - // current encoded frame is small, or if the recursive average of the - // low_content over the update interval window falls below threshold. - if (fraction_low < 0.8 || cr->low_content_avg < 0.7) - cpi->refresh_golden_frame = 0; - // Reset for next internal. - cr->low_content_avg = fraction_low; - } -} - -// Update the segmentation map, and related quantities: cyclic refresh map, -// refresh sb_index, and target number of blocks to be refreshed. -// The map is set to either 0/CR_SEGMENT_ID_BASE (no refresh) or to -// 1/CR_SEGMENT_ID_BOOST1 (refresh) for each superblock. -// Blocks labeled as BOOST1 may later get set to BOOST2 (during the -// encoding of the superblock). -void vp9_cyclic_refresh_update_map(VP9_COMP *const cpi) { - VP9_COMMON *const cm = &cpi->common; - CYCLIC_REFRESH *const cr = cpi->cyclic_refresh; - unsigned char *const seg_map = cpi->segmentation_map; - int i, block_count, bl_index, sb_rows, sb_cols, sbs_in_frame; - int xmis, ymis, x, y; - vpx_memset(seg_map, CR_SEGMENT_ID_BASE, cm->mi_rows * cm->mi_cols); - sb_cols = (cm->mi_cols + MI_BLOCK_SIZE - 1) / MI_BLOCK_SIZE; - sb_rows = (cm->mi_rows + MI_BLOCK_SIZE - 1) / MI_BLOCK_SIZE; - sbs_in_frame = sb_cols * sb_rows; - // Number of target blocks to get the q delta (segment 1). - block_count = cr->percent_refresh * cm->mi_rows * cm->mi_cols / 100; - // Set the segmentation map: cycle through the superblocks, starting at - // cr->mb_index, and stopping when either block_count blocks have been found - // to be refreshed, or we have passed through whole frame. - assert(cr->sb_index < sbs_in_frame); - i = cr->sb_index; - cr->target_num_seg_blocks = 0; - do { - int sum_map = 0; - // Get the mi_row/mi_col corresponding to superblock index i. - int sb_row_index = (i / sb_cols); - int sb_col_index = i - sb_row_index * sb_cols; - int mi_row = sb_row_index * MI_BLOCK_SIZE; - int mi_col = sb_col_index * MI_BLOCK_SIZE; - assert(mi_row >= 0 && mi_row < cm->mi_rows); - assert(mi_col >= 0 && mi_col < cm->mi_cols); - bl_index = mi_row * cm->mi_cols + mi_col; - // Loop through all 8x8 blocks in superblock and update map. - xmis = MIN(cm->mi_cols - mi_col, - num_8x8_blocks_wide_lookup[BLOCK_64X64]); - ymis = MIN(cm->mi_rows - mi_row, - num_8x8_blocks_high_lookup[BLOCK_64X64]); - for (y = 0; y < ymis; y++) { - for (x = 0; x < xmis; x++) { - const int bl_index2 = bl_index + y * cm->mi_cols + x; - // If the block is as a candidate for clean up then mark it - // for possible boost/refresh (segment 1). The segment id may get - // reset to 0 later if block gets coded anything other than ZEROMV. - if (cr->map[bl_index2] == 0) { - sum_map++; - } else if (cr->map[bl_index2] < 0) { - cr->map[bl_index2]++; - } - } - } - // Enforce constant segment over superblock. - // If segment is at least half of superblock, set to 1. - if (sum_map >= xmis * ymis / 2) { - for (y = 0; y < ymis; y++) - for (x = 0; x < xmis; x++) { - seg_map[bl_index + y * cm->mi_cols + x] = CR_SEGMENT_ID_BOOST1; - } - cr->target_num_seg_blocks += xmis * ymis; - } - i++; - if (i == sbs_in_frame) { - i = 0; - } - } while (cr->target_num_seg_blocks < block_count && i != cr->sb_index); - cr->sb_index = i; -} - -// Set/update global/frame level cyclic refresh parameters. -void vp9_cyclic_refresh_update_parameters(VP9_COMP *const cpi) { - const RATE_CONTROL *const rc = &cpi->rc; - CYCLIC_REFRESH *const cr = cpi->cyclic_refresh; - cr->percent_refresh = 10; - // Use larger delta-qp (increase rate_ratio_qdelta) for first few (~4) - // periods of the refresh cycle, after a key frame. This corresponds to ~40 - // frames with cr->percent_refresh = 10. - if (rc->frames_since_key < 40) - cr->rate_ratio_qdelta = 3.0; - else - cr->rate_ratio_qdelta = 2.0; -} - -// Setup cyclic background refresh: set delta q and segmentation map. -void vp9_cyclic_refresh_setup(VP9_COMP *const cpi) { - VP9_COMMON *const cm = &cpi->common; - const RATE_CONTROL *const rc = &cpi->rc; - CYCLIC_REFRESH *const cr = cpi->cyclic_refresh; - struct segmentation *const seg = &cm->seg; - const int apply_cyclic_refresh = apply_cyclic_refresh_bitrate(cm, rc); - if (cm->current_video_frame == 0) - cr->low_content_avg = 0.0; - // Don't apply refresh on key frame or enhancement layer frames. - if (!apply_cyclic_refresh || - (cm->frame_type == KEY_FRAME) || - (cpi->svc.temporal_layer_id > 0) || - (cpi->svc.spatial_layer_id > 0)) { - // Set segmentation map to 0 and disable. - unsigned char *const seg_map = cpi->segmentation_map; - vpx_memset(seg_map, 0, cm->mi_rows * cm->mi_cols); - vp9_disable_segmentation(&cm->seg); - if (cm->frame_type == KEY_FRAME) - cr->sb_index = 0; - return; - } else { - int qindex_delta = 0; - int qindex2; - const double q = vp9_convert_qindex_to_q(cm->base_qindex, cm->bit_depth); - vp9_clear_system_state(); - cr->max_qdelta_perc = 50; - cr->time_for_refresh = 0; - // Set rate threshold to some multiple (set to 2 for now) of the target - // rate (target is given by sb64_target_rate and scaled by 256). - cr->thresh_rate_sb = ((int64_t)(rc->sb64_target_rate) << 8) << 2; - // Distortion threshold, quadratic in Q, scale factor to be adjusted. - // q will not exceed 457, so (q * q) is within 32bit; see: - // vp9_convert_qindex_to_q(), vp9_ac_quant(), ac_qlookup*[]. - cr->thresh_dist_sb = ((int64_t)(q * q)) << 2; - cr->motion_thresh = 32; - // Set up segmentation. - // Clear down the segment map. - vp9_enable_segmentation(&cm->seg); - vp9_clearall_segfeatures(seg); - // Select delta coding method. - seg->abs_delta = SEGMENT_DELTADATA; - - // Note: setting temporal_update has no effect, as the seg-map coding method - // (temporal or spatial) is determined in vp9_choose_segmap_coding_method(), - // based on the coding cost of each method. For error_resilient mode on the - // last_frame_seg_map is set to 0, so if temporal coding is used, it is - // relative to 0 previous map. - // seg->temporal_update = 0; - - // Segment BASE "Q" feature is disabled so it defaults to the baseline Q. - vp9_disable_segfeature(seg, CR_SEGMENT_ID_BASE, SEG_LVL_ALT_Q); - // Use segment BOOST1 for in-frame Q adjustment. - vp9_enable_segfeature(seg, CR_SEGMENT_ID_BOOST1, SEG_LVL_ALT_Q); - // Use segment BOOST2 for more aggressive in-frame Q adjustment. - vp9_enable_segfeature(seg, CR_SEGMENT_ID_BOOST2, SEG_LVL_ALT_Q); - - // Set the q delta for segment BOOST1. - qindex_delta = compute_deltaq(cpi, cm->base_qindex, cr->rate_ratio_qdelta); - cr->qindex_delta_seg1 = qindex_delta; - - // Compute rd-mult for segment BOOST1. - qindex2 = clamp(cm->base_qindex + cm->y_dc_delta_q + qindex_delta, 0, MAXQ); - - cr->rdmult = vp9_compute_rd_mult(cpi, qindex2); - - vp9_set_segdata(seg, CR_SEGMENT_ID_BOOST1, SEG_LVL_ALT_Q, qindex_delta); - - // Set a more aggressive (higher) q delta for segment BOOST2. - qindex_delta = compute_deltaq(cpi, cm->base_qindex, - MIN(CR_MAX_RATE_TARGET_RATIO, - CR_BOOST2_FAC * cr->rate_ratio_qdelta)); - cr->qindex_delta_seg2 = qindex_delta; - vp9_set_segdata(seg, CR_SEGMENT_ID_BOOST2, SEG_LVL_ALT_Q, qindex_delta); - - // Update the segmentation and refresh map. - vp9_cyclic_refresh_update_map(cpi); - } -} - -int vp9_cyclic_refresh_get_rdmult(const CYCLIC_REFRESH *cr) { - return cr->rdmult; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_aq_cyclicrefresh.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_aq_cyclicrefresh.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_aq_cyclicrefresh.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_aq_cyclicrefresh.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP9_ENCODER_VP9_AQ_CYCLICREFRESH_H_ -#define VP9_ENCODER_VP9_AQ_CYCLICREFRESH_H_ - -#include "vp9/common/vp9_blockd.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// The segment ids used in cyclic refresh: from base (no boost) to increasing -// boost (higher delta-qp). -#define CR_SEGMENT_ID_BASE 0 -#define CR_SEGMENT_ID_BOOST1 1 -#define CR_SEGMENT_ID_BOOST2 2 - -// Maximum rate target ratio for setting segment delta-qp. -#define CR_MAX_RATE_TARGET_RATIO 4.0 - -// Boost factor for rate target ratio, for segment CR_SEGMENT_ID_BOOST2. -#define CR_BOOST2_FAC 1.7 - -struct VP9_COMP; - -struct CYCLIC_REFRESH; -typedef struct CYCLIC_REFRESH CYCLIC_REFRESH; - -CYCLIC_REFRESH *vp9_cyclic_refresh_alloc(int mi_rows, int mi_cols); - -void vp9_cyclic_refresh_free(CYCLIC_REFRESH *cr); - -// Estimate the bits, incorporating the delta-q from segment 1, after encoding -// the frame. -int vp9_cyclic_refresh_estimate_bits_at_q(const struct VP9_COMP *cpi, - double correction_factor); - -// Estimate the bits per mb, for a given q = i and a corresponding delta-q -// (for segment 1), prior to encoding the frame. -int vp9_cyclic_refresh_rc_bits_per_mb(const struct VP9_COMP *cpi, int i, - double correction_factor); - -// Prior to coding a given prediction block, of size bsize at (mi_row, mi_col), -// check if we should reset the segment_id, and update the cyclic_refresh map -// and segmentation map. -void vp9_cyclic_refresh_update_segment(struct VP9_COMP *const cpi, - MB_MODE_INFO *const mbmi, - int mi_row, int mi_col, BLOCK_SIZE bsize, - int64_t rate, int64_t dist, int skip); - -// Update the segmentation map, and related quantities: cyclic refresh map, -// refresh sb_index, and target number of blocks to be refreshed. -void vp9_cyclic_refresh_update__map(struct VP9_COMP *const cpi); - -// Update the actual number of blocks that were applied the segment delta q. -void vp9_cyclic_refresh_postencode(struct VP9_COMP *const cpi); - -// Set golden frame update interval, for non-svc 1 pass CBR mode. -void vp9_cyclic_refresh_set_golden_update(struct VP9_COMP *const cpi); - -// Check if we should not update golden reference, based on past refresh stats. -void vp9_cyclic_refresh_check_golden_update(struct VP9_COMP *const cpi); - -// Set/update global/frame level refresh parameters. -void vp9_cyclic_refresh_update_parameters(struct VP9_COMP *const cpi); - -// Setup cyclic background refresh: set delta q and segmentation map. -void vp9_cyclic_refresh_setup(struct VP9_COMP *const cpi); - -int vp9_cyclic_refresh_get_rdmult(const CYCLIC_REFRESH *cr); - -static INLINE int cyclic_refresh_segment_id_boosted(int segment_id) { - return segment_id == CR_SEGMENT_ID_BOOST1 || - segment_id == CR_SEGMENT_ID_BOOST2; -} - -static INLINE int cyclic_refresh_segment_id(int segment_id) { - if (segment_id == CR_SEGMENT_ID_BOOST1) - return CR_SEGMENT_ID_BOOST1; - else if (segment_id == CR_SEGMENT_ID_BOOST2) - return CR_SEGMENT_ID_BOOST2; - else - return CR_SEGMENT_ID_BASE; -} - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_AQ_CYCLICREFRESH_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_aq_variance.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_aq_variance.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_aq_variance.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_aq_variance.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "vp9/encoder/vp9_aq_variance.h" - -#include "vp9/common/vp9_seg_common.h" - -#include "vp9/encoder/vp9_ratectrl.h" -#include "vp9/encoder/vp9_rd.h" -#include "vp9/encoder/vp9_segmentation.h" -#include "vp9/common/vp9_systemdependent.h" - -#define ENERGY_MIN (-4) -#define ENERGY_MAX (1) -#define ENERGY_SPAN (ENERGY_MAX - ENERGY_MIN + 1) -#define ENERGY_IN_BOUNDS(energy)\ - assert((energy) >= ENERGY_MIN && (energy) <= ENERGY_MAX) - -static const double rate_ratio[MAX_SEGMENTS] = - {2.5, 2.0, 1.5, 1.0, 0.75, 1.0, 1.0, 1.0}; -static const int segment_id[ENERGY_SPAN] = {0, 1, 1, 2, 3, 4}; - -#define SEGMENT_ID(i) segment_id[(i) - ENERGY_MIN] - -DECLARE_ALIGNED(16, static const uint8_t, vp9_64_zeros[64]) = {0}; -#if CONFIG_VP9_HIGHBITDEPTH -DECLARE_ALIGNED(16, static const uint16_t, vp9_highbd_64_zeros[64]) = {0}; -#endif - -unsigned int vp9_vaq_segment_id(int energy) { - ENERGY_IN_BOUNDS(energy); - return SEGMENT_ID(energy); -} - -void vp9_vaq_frame_setup(VP9_COMP *cpi) { - VP9_COMMON *cm = &cpi->common; - struct segmentation *seg = &cm->seg; - int i; - - if (cm->frame_type == KEY_FRAME || - cpi->refresh_alt_ref_frame || - (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref)) { - vp9_enable_segmentation(seg); - vp9_clearall_segfeatures(seg); - - seg->abs_delta = SEGMENT_DELTADATA; - - vp9_clear_system_state(); - - for (i = 0; i < MAX_SEGMENTS; ++i) { - int qindex_delta = - vp9_compute_qdelta_by_rate(&cpi->rc, cm->frame_type, cm->base_qindex, - rate_ratio[i], cm->bit_depth); - - // We don't allow qindex 0 in a segment if the base value is not 0. - // Q index 0 (lossless) implies 4x4 encoding only and in AQ mode a segment - // Q delta is sometimes applied without going back around the rd loop. - // This could lead to an illegal combination of partition size and q. - if ((cm->base_qindex != 0) && ((cm->base_qindex + qindex_delta) == 0)) { - qindex_delta = -cm->base_qindex + 1; - } - - // No need to enable SEG_LVL_ALT_Q for this segment. - if (rate_ratio[i] == 1.0) { - continue; - } - - vp9_set_segdata(seg, i, SEG_LVL_ALT_Q, qindex_delta); - vp9_enable_segfeature(seg, i, SEG_LVL_ALT_Q); - } - } -} - - -static unsigned int block_variance(VP9_COMP *cpi, MACROBLOCK *x, - BLOCK_SIZE bs) { - MACROBLOCKD *xd = &x->e_mbd; - unsigned int var, sse; - int right_overflow = (xd->mb_to_right_edge < 0) ? - ((-xd->mb_to_right_edge) >> 3) : 0; - int bottom_overflow = (xd->mb_to_bottom_edge < 0) ? - ((-xd->mb_to_bottom_edge) >> 3) : 0; - - if (right_overflow || bottom_overflow) { - const int bw = 8 * num_8x8_blocks_wide_lookup[bs] - right_overflow; - const int bh = 8 * num_8x8_blocks_high_lookup[bs] - bottom_overflow; - int avg; -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - highbd_variance(x->plane[0].src.buf, x->plane[0].src.stride, - CONVERT_TO_BYTEPTR(vp9_highbd_64_zeros), 0, bw, bh, - &sse, &avg); - sse >>= 2 * (xd->bd - 8); - avg >>= (xd->bd - 8); - } else { - variance(x->plane[0].src.buf, x->plane[0].src.stride, - vp9_64_zeros, 0, bw, bh, &sse, &avg); - } -#else - variance(x->plane[0].src.buf, x->plane[0].src.stride, - vp9_64_zeros, 0, bw, bh, &sse, &avg); -#endif // CONFIG_VP9_HIGHBITDEPTH - var = sse - (((int64_t)avg * avg) / (bw * bh)); - return (256 * var) / (bw * bh); - } else { -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - var = cpi->fn_ptr[bs].vf(x->plane[0].src.buf, - x->plane[0].src.stride, - CONVERT_TO_BYTEPTR(vp9_highbd_64_zeros), - 0, &sse); - } else { - var = cpi->fn_ptr[bs].vf(x->plane[0].src.buf, - x->plane[0].src.stride, - vp9_64_zeros, 0, &sse); - } -#else - var = cpi->fn_ptr[bs].vf(x->plane[0].src.buf, - x->plane[0].src.stride, - vp9_64_zeros, 0, &sse); -#endif // CONFIG_VP9_HIGHBITDEPTH - return (256 * var) >> num_pels_log2_lookup[bs]; - } -} - -double vp9_log_block_var(VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs) { - unsigned int var = block_variance(cpi, x, bs); - vp9_clear_system_state(); - return log(var + 1.0); -} - -#define DEFAULT_E_MIDPOINT 10.0 -int vp9_block_energy(VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs) { - double energy; - double energy_midpoint; - vp9_clear_system_state(); - energy_midpoint = - (cpi->oxcf.pass == 2) ? cpi->twopass.mb_av_energy : DEFAULT_E_MIDPOINT; - energy = vp9_log_block_var(cpi, x, bs) - energy_midpoint; - return clamp((int)round(energy), ENERGY_MIN, ENERGY_MAX); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_aq_variance.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_aq_variance.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_aq_variance.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_aq_variance.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP9_ENCODER_VP9_AQ_VARIANCE_H_ -#define VP9_ENCODER_VP9_AQ_VARIANCE_H_ - -#include "vp9/encoder/vp9_encoder.h" - -#ifdef __cplusplus -extern "C" { -#endif - -unsigned int vp9_vaq_segment_id(int energy); -void vp9_vaq_frame_setup(VP9_COMP *cpi); - -int vp9_block_energy(VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs); -double vp9_log_block_var(VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_AQ_VARIANCE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_avg.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_avg.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_avg.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_avg.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#include "vp9/common/vp9_common.h" -#include "vpx_ports/mem.h" - -unsigned int vp9_avg_8x8_c(const uint8_t *s, int p) { - int i, j; - int sum = 0; - for (i = 0; i < 8; ++i, s+=p) - for (j = 0; j < 8; sum += s[j], ++j) {} - - return (sum + 32) >> 6; -} - -unsigned int vp9_avg_4x4_c(const uint8_t *s, int p) { - int i, j; - int sum = 0; - for (i = 0; i < 4; ++i, s+=p) - for (j = 0; j < 4; sum += s[j], ++j) {} - - return (sum + 8) >> 4; -} - -// Integer projection onto row vectors. -void vp9_int_pro_row_c(int16_t *hbuf, uint8_t const *ref, - const int ref_stride, const int height) { - int idx; - const int norm_factor = MAX(8, height >> 1); - for (idx = 0; idx < 16; ++idx) { - int i; - hbuf[idx] = 0; - for (i = 0; i < height; ++i) - hbuf[idx] += ref[i * ref_stride]; - hbuf[idx] /= norm_factor; - ++ref; - } -} - -int16_t vp9_int_pro_col_c(uint8_t const *ref, const int width) { - int idx; - int16_t sum = 0; - for (idx = 0; idx < width; ++idx) - sum += ref[idx]; - return sum; -} - -int vp9_vector_var_c(int16_t const *ref, int16_t const *src, - const int bwl) { - int i; - int width = 4 << bwl; - int sse = 0, mean = 0, var; - - for (i = 0; i < width; ++i) { - int diff = ref[i] - src[i]; - mean += diff; - sse += diff * diff; - } - - var = sse - ((mean * mean) >> (bwl + 2)); - return var; -} - -#if CONFIG_VP9_HIGHBITDEPTH -unsigned int vp9_highbd_avg_8x8_c(const uint8_t *s8, int p) { - int i, j; - int sum = 0; - const uint16_t* s = CONVERT_TO_SHORTPTR(s8); - for (i = 0; i < 8; ++i, s+=p) - for (j = 0; j < 8; sum += s[j], ++j) {} - - return (sum + 32) >> 6; -} - -unsigned int vp9_highbd_avg_4x4_c(const uint8_t *s8, int p) { - int i, j; - int sum = 0; - const uint16_t* s = CONVERT_TO_SHORTPTR(s8); - for (i = 0; i < 4; ++i, s+=p) - for (j = 0; j < 4; sum += s[j], ++j) {} - - return (sum + 8) >> 4; -} -#endif // CONFIG_VP9_HIGHBITDEPTH - - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_bitstream.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_bitstream.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_bitstream.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_bitstream.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1247 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include - -#include "vpx/vpx_encoder.h" -#include "vpx_mem/vpx_mem.h" -#include "vpx_ports/mem_ops.h" - -#include "vp9/common/vp9_entropy.h" -#include "vp9/common/vp9_entropymode.h" -#include "vp9/common/vp9_entropymv.h" -#include "vp9/common/vp9_mvref_common.h" -#include "vp9/common/vp9_pred_common.h" -#include "vp9/common/vp9_seg_common.h" -#include "vp9/common/vp9_systemdependent.h" -#include "vp9/common/vp9_tile_common.h" - -#include "vp9/encoder/vp9_cost.h" -#include "vp9/encoder/vp9_bitstream.h" -#include "vp9/encoder/vp9_encodemv.h" -#include "vp9/encoder/vp9_mcomp.h" -#include "vp9/encoder/vp9_segmentation.h" -#include "vp9/encoder/vp9_subexp.h" -#include "vp9/encoder/vp9_tokenize.h" -#include "vp9/encoder/vp9_write_bit_buffer.h" - -static const struct vp9_token intra_mode_encodings[INTRA_MODES] = { - {0, 1}, {6, 3}, {28, 5}, {30, 5}, {58, 6}, {59, 6}, {126, 7}, {127, 7}, - {62, 6}, {2, 2}}; -static const struct vp9_token switchable_interp_encodings[SWITCHABLE_FILTERS] = - {{0, 1}, {2, 2}, {3, 2}}; -static const struct vp9_token partition_encodings[PARTITION_TYPES] = - {{0, 1}, {2, 2}, {6, 3}, {7, 3}}; -static const struct vp9_token inter_mode_encodings[INTER_MODES] = - {{2, 2}, {6, 3}, {0, 1}, {7, 3}}; - -static void write_intra_mode(vp9_writer *w, PREDICTION_MODE mode, - const vp9_prob *probs) { - vp9_write_token(w, vp9_intra_mode_tree, probs, &intra_mode_encodings[mode]); -} - -static void write_inter_mode(vp9_writer *w, PREDICTION_MODE mode, - const vp9_prob *probs) { - assert(is_inter_mode(mode)); - vp9_write_token(w, vp9_inter_mode_tree, probs, - &inter_mode_encodings[INTER_OFFSET(mode)]); -} - -static void encode_unsigned_max(struct vp9_write_bit_buffer *wb, - int data, int max) { - vp9_wb_write_literal(wb, data, get_unsigned_bits(max)); -} - -static void prob_diff_update(const vp9_tree_index *tree, - vp9_prob probs[/*n - 1*/], - const unsigned int counts[/*n - 1*/], - int n, vp9_writer *w) { - int i; - unsigned int branch_ct[32][2]; - - // Assuming max number of probabilities <= 32 - assert(n <= 32); - - vp9_tree_probs_from_distribution(tree, branch_ct, counts); - for (i = 0; i < n - 1; ++i) - vp9_cond_prob_diff_update(w, &probs[i], branch_ct[i]); -} - -static void write_selected_tx_size(const VP9_COMMON *cm, - const MACROBLOCKD *xd, vp9_writer *w) { - TX_SIZE tx_size = xd->mi[0].src_mi->mbmi.tx_size; - BLOCK_SIZE bsize = xd->mi[0].src_mi->mbmi.sb_type; - const TX_SIZE max_tx_size = max_txsize_lookup[bsize]; - const vp9_prob *const tx_probs = get_tx_probs2(max_tx_size, xd, - &cm->fc->tx_probs); - vp9_write(w, tx_size != TX_4X4, tx_probs[0]); - if (tx_size != TX_4X4 && max_tx_size >= TX_16X16) { - vp9_write(w, tx_size != TX_8X8, tx_probs[1]); - if (tx_size != TX_8X8 && max_tx_size >= TX_32X32) - vp9_write(w, tx_size != TX_16X16, tx_probs[2]); - } -} - -static int write_skip(const VP9_COMMON *cm, const MACROBLOCKD *xd, - int segment_id, const MODE_INFO *mi, vp9_writer *w) { - if (vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP)) { - return 1; - } else { - const int skip = mi->mbmi.skip; - vp9_write(w, skip, vp9_get_skip_prob(cm, xd)); - return skip; - } -} - -static void update_skip_probs(VP9_COMMON *cm, vp9_writer *w, - FRAME_COUNTS *counts) { - int k; - - for (k = 0; k < SKIP_CONTEXTS; ++k) - vp9_cond_prob_diff_update(w, &cm->fc->skip_probs[k], counts->skip[k]); -} - -static void update_switchable_interp_probs(VP9_COMMON *cm, vp9_writer *w, - FRAME_COUNTS *counts) { - int j; - for (j = 0; j < SWITCHABLE_FILTER_CONTEXTS; ++j) - prob_diff_update(vp9_switchable_interp_tree, - cm->fc->switchable_interp_prob[j], - counts->switchable_interp[j], SWITCHABLE_FILTERS, w); -} - -static void pack_mb_tokens(vp9_writer *w, - TOKENEXTRA **tp, const TOKENEXTRA *const stop, - vpx_bit_depth_t bit_depth) { - TOKENEXTRA *p = *tp; - - while (p < stop && p->token != EOSB_TOKEN) { - const int t = p->token; - const struct vp9_token *const a = &vp9_coef_encodings[t]; - int i = 0; - int v = a->value; - int n = a->len; -#if CONFIG_VP9_HIGHBITDEPTH - const vp9_extra_bit *b; - if (bit_depth == VPX_BITS_12) - b = &vp9_extra_bits_high12[t]; - else if (bit_depth == VPX_BITS_10) - b = &vp9_extra_bits_high10[t]; - else - b = &vp9_extra_bits[t]; -#else - const vp9_extra_bit *const b = &vp9_extra_bits[t]; - (void) bit_depth; -#endif // CONFIG_VP9_HIGHBITDEPTH - - /* skip one or two nodes */ - if (p->skip_eob_node) { - n -= p->skip_eob_node; - i = 2 * p->skip_eob_node; - } - - // TODO(jbb): expanding this can lead to big gains. It allows - // much better branch prediction and would enable us to avoid numerous - // lookups and compares. - - // If we have a token that's in the constrained set, the coefficient tree - // is split into two treed writes. The first treed write takes care of the - // unconstrained nodes. The second treed write takes care of the - // constrained nodes. - if (t >= TWO_TOKEN && t < EOB_TOKEN) { - int len = UNCONSTRAINED_NODES - p->skip_eob_node; - int bits = v >> (n - len); - vp9_write_tree(w, vp9_coef_tree, p->context_tree, bits, len, i); - vp9_write_tree(w, vp9_coef_con_tree, - vp9_pareto8_full[p->context_tree[PIVOT_NODE] - 1], - v, n - len, 0); - } else { - vp9_write_tree(w, vp9_coef_tree, p->context_tree, v, n, i); - } - - if (b->base_val) { - const int e = p->extra, l = b->len; - - if (l) { - const unsigned char *pb = b->prob; - int v = e >> 1; - int n = l; /* number of bits in v, assumed nonzero */ - int i = 0; - - do { - const int bb = (v >> --n) & 1; - vp9_write(w, bb, pb[i >> 1]); - i = b->tree[i + bb]; - } while (n); - } - - vp9_write_bit(w, e & 1); - } - ++p; - } - - *tp = p + (p->token == EOSB_TOKEN); -} - -static void write_segment_id(vp9_writer *w, const struct segmentation *seg, - int segment_id) { - if (seg->enabled && seg->update_map) - vp9_write_tree(w, vp9_segment_tree, seg->tree_probs, segment_id, 3, 0); -} - -// This function encodes the reference frame -static void write_ref_frames(const VP9_COMMON *cm, const MACROBLOCKD *xd, - vp9_writer *w) { - const MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi; - const int is_compound = has_second_ref(mbmi); - const int segment_id = mbmi->segment_id; - - // If segment level coding of this signal is disabled... - // or the segment allows multiple reference frame options - if (vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME)) { - assert(!is_compound); - assert(mbmi->ref_frame[0] == - vp9_get_segdata(&cm->seg, segment_id, SEG_LVL_REF_FRAME)); - } else { - // does the feature use compound prediction or not - // (if not specified at the frame/segment level) - if (cm->reference_mode == REFERENCE_MODE_SELECT) { - vp9_write(w, is_compound, vp9_get_reference_mode_prob(cm, xd)); - } else { - assert(!is_compound == (cm->reference_mode == SINGLE_REFERENCE)); - } - - if (is_compound) { - vp9_write(w, mbmi->ref_frame[0] == GOLDEN_FRAME, - vp9_get_pred_prob_comp_ref_p(cm, xd)); - } else { - const int bit0 = mbmi->ref_frame[0] != LAST_FRAME; - vp9_write(w, bit0, vp9_get_pred_prob_single_ref_p1(cm, xd)); - if (bit0) { - const int bit1 = mbmi->ref_frame[0] != GOLDEN_FRAME; - vp9_write(w, bit1, vp9_get_pred_prob_single_ref_p2(cm, xd)); - } - } - } -} - -static void pack_inter_mode_mvs(VP9_COMP *cpi, const MODE_INFO *mi, - vp9_writer *w) { - VP9_COMMON *const cm = &cpi->common; - const nmv_context *nmvc = &cm->fc->nmvc; - const MACROBLOCK *const x = &cpi->td.mb; - const MACROBLOCKD *const xd = &x->e_mbd; - const struct segmentation *const seg = &cm->seg; - const MB_MODE_INFO *const mbmi = &mi->mbmi; - const PREDICTION_MODE mode = mbmi->mode; - const int segment_id = mbmi->segment_id; - const BLOCK_SIZE bsize = mbmi->sb_type; - const int allow_hp = cm->allow_high_precision_mv; - const int is_inter = is_inter_block(mbmi); - const int is_compound = has_second_ref(mbmi); - int skip, ref; - - if (seg->update_map) { - if (seg->temporal_update) { - const int pred_flag = mbmi->seg_id_predicted; - vp9_prob pred_prob = vp9_get_pred_prob_seg_id(seg, xd); - vp9_write(w, pred_flag, pred_prob); - if (!pred_flag) - write_segment_id(w, seg, segment_id); - } else { - write_segment_id(w, seg, segment_id); - } - } - - skip = write_skip(cm, xd, segment_id, mi, w); - - if (!vp9_segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME)) - vp9_write(w, is_inter, vp9_get_intra_inter_prob(cm, xd)); - - if (bsize >= BLOCK_8X8 && cm->tx_mode == TX_MODE_SELECT && - !(is_inter && - (skip || vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP)))) { - write_selected_tx_size(cm, xd, w); - } - - if (!is_inter) { - if (bsize >= BLOCK_8X8) { - write_intra_mode(w, mode, cm->fc->y_mode_prob[size_group_lookup[bsize]]); - } else { - int idx, idy; - const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize]; - const int num_4x4_h = num_4x4_blocks_high_lookup[bsize]; - for (idy = 0; idy < 2; idy += num_4x4_h) { - for (idx = 0; idx < 2; idx += num_4x4_w) { - const PREDICTION_MODE b_mode = mi->bmi[idy * 2 + idx].as_mode; - write_intra_mode(w, b_mode, cm->fc->y_mode_prob[0]); - } - } - } - write_intra_mode(w, mbmi->uv_mode, cm->fc->uv_mode_prob[mode]); - } else { - const int mode_ctx = mbmi->mode_context[mbmi->ref_frame[0]]; - const vp9_prob *const inter_probs = cm->fc->inter_mode_probs[mode_ctx]; - write_ref_frames(cm, xd, w); - - // If segment skip is not enabled code the mode. - if (!vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP)) { - if (bsize >= BLOCK_8X8) { - write_inter_mode(w, mode, inter_probs); - } - } - - if (cm->interp_filter == SWITCHABLE) { - const int ctx = vp9_get_pred_context_switchable_interp(xd); - vp9_write_token(w, vp9_switchable_interp_tree, - cm->fc->switchable_interp_prob[ctx], - &switchable_interp_encodings[mbmi->interp_filter]); - ++cpi->interp_filter_selected[0][mbmi->interp_filter]; - } else { - assert(mbmi->interp_filter == cm->interp_filter); - } - - if (bsize < BLOCK_8X8) { - const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize]; - const int num_4x4_h = num_4x4_blocks_high_lookup[bsize]; - int idx, idy; - for (idy = 0; idy < 2; idy += num_4x4_h) { - for (idx = 0; idx < 2; idx += num_4x4_w) { - const int j = idy * 2 + idx; - const PREDICTION_MODE b_mode = mi->bmi[j].as_mode; - write_inter_mode(w, b_mode, inter_probs); - if (b_mode == NEWMV) { - for (ref = 0; ref < 1 + is_compound; ++ref) - vp9_encode_mv(cpi, w, &mi->bmi[j].as_mv[ref].as_mv, - &mbmi->ref_mvs[mbmi->ref_frame[ref]][0].as_mv, - nmvc, allow_hp); - } - } - } - } else { - if (mode == NEWMV) { - for (ref = 0; ref < 1 + is_compound; ++ref) - vp9_encode_mv(cpi, w, &mbmi->mv[ref].as_mv, - &mbmi->ref_mvs[mbmi->ref_frame[ref]][0].as_mv, nmvc, - allow_hp); - } - } - } -} - -static void write_mb_modes_kf(const VP9_COMMON *cm, const MACROBLOCKD *xd, - MODE_INFO *mi_8x8, vp9_writer *w) { - const struct segmentation *const seg = &cm->seg; - const MODE_INFO *const mi = mi_8x8; - const MODE_INFO *const above_mi = xd->above_mi; - const MODE_INFO *const left_mi = xd->left_mi; - const MB_MODE_INFO *const mbmi = &mi->mbmi; - const BLOCK_SIZE bsize = mbmi->sb_type; - - if (seg->update_map) - write_segment_id(w, seg, mbmi->segment_id); - - write_skip(cm, xd, mbmi->segment_id, mi, w); - - if (bsize >= BLOCK_8X8 && cm->tx_mode == TX_MODE_SELECT) - write_selected_tx_size(cm, xd, w); - - if (bsize >= BLOCK_8X8) { - write_intra_mode(w, mbmi->mode, get_y_mode_probs(mi, above_mi, left_mi, 0)); - } else { - const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize]; - const int num_4x4_h = num_4x4_blocks_high_lookup[bsize]; - int idx, idy; - - for (idy = 0; idy < 2; idy += num_4x4_h) { - for (idx = 0; idx < 2; idx += num_4x4_w) { - const int block = idy * 2 + idx; - write_intra_mode(w, mi->bmi[block].as_mode, - get_y_mode_probs(mi, above_mi, left_mi, block)); - } - } - } - - write_intra_mode(w, mbmi->uv_mode, vp9_kf_uv_mode_prob[mbmi->mode]); -} - -static void write_modes_b(VP9_COMP *cpi, const TileInfo *const tile, - vp9_writer *w, TOKENEXTRA **tok, - const TOKENEXTRA *const tok_end, - int mi_row, int mi_col) { - const VP9_COMMON *const cm = &cpi->common; - MACROBLOCKD *const xd = &cpi->td.mb.e_mbd; - MODE_INFO *m; - - xd->mi = cm->mi + (mi_row * cm->mi_stride + mi_col); - m = xd->mi; - - set_mi_row_col(xd, tile, - mi_row, num_8x8_blocks_high_lookup[m->mbmi.sb_type], - mi_col, num_8x8_blocks_wide_lookup[m->mbmi.sb_type], - cm->mi_rows, cm->mi_cols); - if (frame_is_intra_only(cm)) { - write_mb_modes_kf(cm, xd, xd->mi, w); - } else { - pack_inter_mode_mvs(cpi, m, w); - } - - assert(*tok < tok_end); - pack_mb_tokens(w, tok, tok_end, cm->bit_depth); -} - -static void write_partition(const VP9_COMMON *const cm, - const MACROBLOCKD *const xd, - int hbs, int mi_row, int mi_col, - PARTITION_TYPE p, BLOCK_SIZE bsize, vp9_writer *w) { - const int ctx = partition_plane_context(xd, mi_row, mi_col, bsize); - const vp9_prob *const probs = get_partition_probs(cm, ctx); - const int has_rows = (mi_row + hbs) < cm->mi_rows; - const int has_cols = (mi_col + hbs) < cm->mi_cols; - - if (has_rows && has_cols) { - vp9_write_token(w, vp9_partition_tree, probs, &partition_encodings[p]); - } else if (!has_rows && has_cols) { - assert(p == PARTITION_SPLIT || p == PARTITION_HORZ); - vp9_write(w, p == PARTITION_SPLIT, probs[1]); - } else if (has_rows && !has_cols) { - assert(p == PARTITION_SPLIT || p == PARTITION_VERT); - vp9_write(w, p == PARTITION_SPLIT, probs[2]); - } else { - assert(p == PARTITION_SPLIT); - } -} - -static void write_modes_sb(VP9_COMP *cpi, - const TileInfo *const tile, vp9_writer *w, - TOKENEXTRA **tok, const TOKENEXTRA *const tok_end, - int mi_row, int mi_col, BLOCK_SIZE bsize) { - const VP9_COMMON *const cm = &cpi->common; - MACROBLOCKD *const xd = &cpi->td.mb.e_mbd; - - const int bsl = b_width_log2_lookup[bsize]; - const int bs = (1 << bsl) / 4; - PARTITION_TYPE partition; - BLOCK_SIZE subsize; - const MODE_INFO *m = NULL; - - if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) - return; - - m = cm->mi[mi_row * cm->mi_stride + mi_col].src_mi; - - partition = partition_lookup[bsl][m->mbmi.sb_type]; - write_partition(cm, xd, bs, mi_row, mi_col, partition, bsize, w); - subsize = get_subsize(bsize, partition); - if (subsize < BLOCK_8X8) { - write_modes_b(cpi, tile, w, tok, tok_end, mi_row, mi_col); - } else { - switch (partition) { - case PARTITION_NONE: - write_modes_b(cpi, tile, w, tok, tok_end, mi_row, mi_col); - break; - case PARTITION_HORZ: - write_modes_b(cpi, tile, w, tok, tok_end, mi_row, mi_col); - if (mi_row + bs < cm->mi_rows) - write_modes_b(cpi, tile, w, tok, tok_end, mi_row + bs, mi_col); - break; - case PARTITION_VERT: - write_modes_b(cpi, tile, w, tok, tok_end, mi_row, mi_col); - if (mi_col + bs < cm->mi_cols) - write_modes_b(cpi, tile, w, tok, tok_end, mi_row, mi_col + bs); - break; - case PARTITION_SPLIT: - write_modes_sb(cpi, tile, w, tok, tok_end, mi_row, mi_col, subsize); - write_modes_sb(cpi, tile, w, tok, tok_end, mi_row, mi_col + bs, - subsize); - write_modes_sb(cpi, tile, w, tok, tok_end, mi_row + bs, mi_col, - subsize); - write_modes_sb(cpi, tile, w, tok, tok_end, mi_row + bs, mi_col + bs, - subsize); - break; - default: - assert(0); - } - } - - // update partition context - if (bsize >= BLOCK_8X8 && - (bsize == BLOCK_8X8 || partition != PARTITION_SPLIT)) - update_partition_context(xd, mi_row, mi_col, subsize, bsize); -} - -static void write_modes(VP9_COMP *cpi, - const TileInfo *const tile, vp9_writer *w, - TOKENEXTRA **tok, const TOKENEXTRA *const tok_end) { - MACROBLOCKD *const xd = &cpi->td.mb.e_mbd; - int mi_row, mi_col; - - for (mi_row = tile->mi_row_start; mi_row < tile->mi_row_end; - mi_row += MI_BLOCK_SIZE) { - vp9_zero(xd->left_seg_context); - for (mi_col = tile->mi_col_start; mi_col < tile->mi_col_end; - mi_col += MI_BLOCK_SIZE) - write_modes_sb(cpi, tile, w, tok, tok_end, mi_row, mi_col, - BLOCK_64X64); - } -} - -static void build_tree_distribution(VP9_COMP *cpi, TX_SIZE tx_size, - vp9_coeff_stats *coef_branch_ct, - vp9_coeff_probs_model *coef_probs) { - vp9_coeff_count *coef_counts = cpi->td.rd_counts.coef_counts[tx_size]; - unsigned int (*eob_branch_ct)[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS] = - cpi->common.counts.eob_branch[tx_size]; - int i, j, k, l, m; - - for (i = 0; i < PLANE_TYPES; ++i) { - for (j = 0; j < REF_TYPES; ++j) { - for (k = 0; k < COEF_BANDS; ++k) { - for (l = 0; l < BAND_COEFF_CONTEXTS(k); ++l) { - vp9_tree_probs_from_distribution(vp9_coef_tree, - coef_branch_ct[i][j][k][l], - coef_counts[i][j][k][l]); - coef_branch_ct[i][j][k][l][0][1] = eob_branch_ct[i][j][k][l] - - coef_branch_ct[i][j][k][l][0][0]; - for (m = 0; m < UNCONSTRAINED_NODES; ++m) - coef_probs[i][j][k][l][m] = get_binary_prob( - coef_branch_ct[i][j][k][l][m][0], - coef_branch_ct[i][j][k][l][m][1]); - } - } - } - } -} - -static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi, - TX_SIZE tx_size, - vp9_coeff_stats *frame_branch_ct, - vp9_coeff_probs_model *new_coef_probs) { - vp9_coeff_probs_model *old_coef_probs = cpi->common.fc->coef_probs[tx_size]; - const vp9_prob upd = DIFF_UPDATE_PROB; - const int entropy_nodes_update = UNCONSTRAINED_NODES; - int i, j, k, l, t; - int stepsize = cpi->sf.coeff_prob_appx_step; - - switch (cpi->sf.use_fast_coef_updates) { - case TWO_LOOP: { - /* dry run to see if there is any update at all needed */ - int savings = 0; - int update[2] = {0, 0}; - for (i = 0; i < PLANE_TYPES; ++i) { - for (j = 0; j < REF_TYPES; ++j) { - for (k = 0; k < COEF_BANDS; ++k) { - for (l = 0; l < BAND_COEFF_CONTEXTS(k); ++l) { - for (t = 0; t < entropy_nodes_update; ++t) { - vp9_prob newp = new_coef_probs[i][j][k][l][t]; - const vp9_prob oldp = old_coef_probs[i][j][k][l][t]; - int s; - int u = 0; - if (t == PIVOT_NODE) - s = vp9_prob_diff_update_savings_search_model( - frame_branch_ct[i][j][k][l][0], - old_coef_probs[i][j][k][l], &newp, upd, stepsize); - else - s = vp9_prob_diff_update_savings_search( - frame_branch_ct[i][j][k][l][t], oldp, &newp, upd); - if (s > 0 && newp != oldp) - u = 1; - if (u) - savings += s - (int)(vp9_cost_zero(upd)); - else - savings -= (int)(vp9_cost_zero(upd)); - update[u]++; - } - } - } - } - } - - // printf("Update %d %d, savings %d\n", update[0], update[1], savings); - /* Is coef updated at all */ - if (update[1] == 0 || savings < 0) { - vp9_write_bit(bc, 0); - return; - } - vp9_write_bit(bc, 1); - for (i = 0; i < PLANE_TYPES; ++i) { - for (j = 0; j < REF_TYPES; ++j) { - for (k = 0; k < COEF_BANDS; ++k) { - for (l = 0; l < BAND_COEFF_CONTEXTS(k); ++l) { - // calc probs and branch cts for this frame only - for (t = 0; t < entropy_nodes_update; ++t) { - vp9_prob newp = new_coef_probs[i][j][k][l][t]; - vp9_prob *oldp = old_coef_probs[i][j][k][l] + t; - const vp9_prob upd = DIFF_UPDATE_PROB; - int s; - int u = 0; - if (t == PIVOT_NODE) - s = vp9_prob_diff_update_savings_search_model( - frame_branch_ct[i][j][k][l][0], - old_coef_probs[i][j][k][l], &newp, upd, stepsize); - else - s = vp9_prob_diff_update_savings_search( - frame_branch_ct[i][j][k][l][t], - *oldp, &newp, upd); - if (s > 0 && newp != *oldp) - u = 1; - vp9_write(bc, u, upd); - if (u) { - /* send/use new probability */ - vp9_write_prob_diff_update(bc, newp, *oldp); - *oldp = newp; - } - } - } - } - } - } - return; - } - - case ONE_LOOP_REDUCED: { - int updates = 0; - int noupdates_before_first = 0; - for (i = 0; i < PLANE_TYPES; ++i) { - for (j = 0; j < REF_TYPES; ++j) { - for (k = 0; k < COEF_BANDS; ++k) { - for (l = 0; l < BAND_COEFF_CONTEXTS(k); ++l) { - // calc probs and branch cts for this frame only - for (t = 0; t < entropy_nodes_update; ++t) { - vp9_prob newp = new_coef_probs[i][j][k][l][t]; - vp9_prob *oldp = old_coef_probs[i][j][k][l] + t; - int s; - int u = 0; - - if (t == PIVOT_NODE) { - s = vp9_prob_diff_update_savings_search_model( - frame_branch_ct[i][j][k][l][0], - old_coef_probs[i][j][k][l], &newp, upd, stepsize); - } else { - s = vp9_prob_diff_update_savings_search( - frame_branch_ct[i][j][k][l][t], - *oldp, &newp, upd); - } - - if (s > 0 && newp != *oldp) - u = 1; - updates += u; - if (u == 0 && updates == 0) { - noupdates_before_first++; - continue; - } - if (u == 1 && updates == 1) { - int v; - // first update - vp9_write_bit(bc, 1); - for (v = 0; v < noupdates_before_first; ++v) - vp9_write(bc, 0, upd); - } - vp9_write(bc, u, upd); - if (u) { - /* send/use new probability */ - vp9_write_prob_diff_update(bc, newp, *oldp); - *oldp = newp; - } - } - } - } - } - } - if (updates == 0) { - vp9_write_bit(bc, 0); // no updates - } - return; - } - default: - assert(0); - } -} - -static void update_coef_probs(VP9_COMP *cpi, vp9_writer* w) { - const TX_MODE tx_mode = cpi->common.tx_mode; - const TX_SIZE max_tx_size = tx_mode_to_biggest_tx_size[tx_mode]; - TX_SIZE tx_size; - for (tx_size = TX_4X4; tx_size <= max_tx_size; ++tx_size) { - vp9_coeff_stats frame_branch_ct[PLANE_TYPES]; - vp9_coeff_probs_model frame_coef_probs[PLANE_TYPES]; - if (cpi->td.counts->tx.tx_totals[tx_size] <= 20 || - (tx_size >= TX_16X16 && cpi->sf.tx_size_search_method == USE_TX_8X8)) { - vp9_write_bit(w, 0); - } else { - build_tree_distribution(cpi, tx_size, frame_branch_ct, - frame_coef_probs); - update_coef_probs_common(w, cpi, tx_size, frame_branch_ct, - frame_coef_probs); - } - } -} - -static void encode_loopfilter(struct loopfilter *lf, - struct vp9_write_bit_buffer *wb) { - int i; - - // Encode the loop filter level and type - vp9_wb_write_literal(wb, lf->filter_level, 6); - vp9_wb_write_literal(wb, lf->sharpness_level, 3); - - // Write out loop filter deltas applied at the MB level based on mode or - // ref frame (if they are enabled). - vp9_wb_write_bit(wb, lf->mode_ref_delta_enabled); - - if (lf->mode_ref_delta_enabled) { - vp9_wb_write_bit(wb, lf->mode_ref_delta_update); - if (lf->mode_ref_delta_update) { - for (i = 0; i < MAX_REF_LF_DELTAS; i++) { - const int delta = lf->ref_deltas[i]; - const int changed = delta != lf->last_ref_deltas[i]; - vp9_wb_write_bit(wb, changed); - if (changed) { - lf->last_ref_deltas[i] = delta; - vp9_wb_write_literal(wb, abs(delta) & 0x3F, 6); - vp9_wb_write_bit(wb, delta < 0); - } - } - - for (i = 0; i < MAX_MODE_LF_DELTAS; i++) { - const int delta = lf->mode_deltas[i]; - const int changed = delta != lf->last_mode_deltas[i]; - vp9_wb_write_bit(wb, changed); - if (changed) { - lf->last_mode_deltas[i] = delta; - vp9_wb_write_literal(wb, abs(delta) & 0x3F, 6); - vp9_wb_write_bit(wb, delta < 0); - } - } - } - } -} - -static void write_delta_q(struct vp9_write_bit_buffer *wb, int delta_q) { - if (delta_q != 0) { - vp9_wb_write_bit(wb, 1); - vp9_wb_write_literal(wb, abs(delta_q), 4); - vp9_wb_write_bit(wb, delta_q < 0); - } else { - vp9_wb_write_bit(wb, 0); - } -} - -static void encode_quantization(const VP9_COMMON *const cm, - struct vp9_write_bit_buffer *wb) { - vp9_wb_write_literal(wb, cm->base_qindex, QINDEX_BITS); - write_delta_q(wb, cm->y_dc_delta_q); - write_delta_q(wb, cm->uv_dc_delta_q); - write_delta_q(wb, cm->uv_ac_delta_q); -} - -static void encode_segmentation(VP9_COMMON *cm, MACROBLOCKD *xd, - struct vp9_write_bit_buffer *wb) { - int i, j; - - const struct segmentation *seg = &cm->seg; - - vp9_wb_write_bit(wb, seg->enabled); - if (!seg->enabled) - return; - - // Segmentation map - vp9_wb_write_bit(wb, seg->update_map); - if (seg->update_map) { - // Select the coding strategy (temporal or spatial) - vp9_choose_segmap_coding_method(cm, xd); - // Write out probabilities used to decode unpredicted macro-block segments - for (i = 0; i < SEG_TREE_PROBS; i++) { - const int prob = seg->tree_probs[i]; - const int update = prob != MAX_PROB; - vp9_wb_write_bit(wb, update); - if (update) - vp9_wb_write_literal(wb, prob, 8); - } - - // Write out the chosen coding method. - vp9_wb_write_bit(wb, seg->temporal_update); - if (seg->temporal_update) { - for (i = 0; i < PREDICTION_PROBS; i++) { - const int prob = seg->pred_probs[i]; - const int update = prob != MAX_PROB; - vp9_wb_write_bit(wb, update); - if (update) - vp9_wb_write_literal(wb, prob, 8); - } - } - } - - // Segmentation data - vp9_wb_write_bit(wb, seg->update_data); - if (seg->update_data) { - vp9_wb_write_bit(wb, seg->abs_delta); - - for (i = 0; i < MAX_SEGMENTS; i++) { - for (j = 0; j < SEG_LVL_MAX; j++) { - const int active = vp9_segfeature_active(seg, i, j); - vp9_wb_write_bit(wb, active); - if (active) { - const int data = vp9_get_segdata(seg, i, j); - const int data_max = vp9_seg_feature_data_max(j); - - if (vp9_is_segfeature_signed(j)) { - encode_unsigned_max(wb, abs(data), data_max); - vp9_wb_write_bit(wb, data < 0); - } else { - encode_unsigned_max(wb, data, data_max); - } - } - } - } - } -} - -static void encode_txfm_probs(VP9_COMMON *cm, vp9_writer *w, - FRAME_COUNTS *counts) { - // Mode - vp9_write_literal(w, MIN(cm->tx_mode, ALLOW_32X32), 2); - if (cm->tx_mode >= ALLOW_32X32) - vp9_write_bit(w, cm->tx_mode == TX_MODE_SELECT); - - // Probabilities - if (cm->tx_mode == TX_MODE_SELECT) { - int i, j; - unsigned int ct_8x8p[TX_SIZES - 3][2]; - unsigned int ct_16x16p[TX_SIZES - 2][2]; - unsigned int ct_32x32p[TX_SIZES - 1][2]; - - - for (i = 0; i < TX_SIZE_CONTEXTS; i++) { - tx_counts_to_branch_counts_8x8(counts->tx.p8x8[i], ct_8x8p); - for (j = 0; j < TX_SIZES - 3; j++) - vp9_cond_prob_diff_update(w, &cm->fc->tx_probs.p8x8[i][j], ct_8x8p[j]); - } - - for (i = 0; i < TX_SIZE_CONTEXTS; i++) { - tx_counts_to_branch_counts_16x16(counts->tx.p16x16[i], ct_16x16p); - for (j = 0; j < TX_SIZES - 2; j++) - vp9_cond_prob_diff_update(w, &cm->fc->tx_probs.p16x16[i][j], - ct_16x16p[j]); - } - - for (i = 0; i < TX_SIZE_CONTEXTS; i++) { - tx_counts_to_branch_counts_32x32(counts->tx.p32x32[i], ct_32x32p); - for (j = 0; j < TX_SIZES - 1; j++) - vp9_cond_prob_diff_update(w, &cm->fc->tx_probs.p32x32[i][j], - ct_32x32p[j]); - } - } -} - -static void write_interp_filter(INTERP_FILTER filter, - struct vp9_write_bit_buffer *wb) { - const int filter_to_literal[] = { 1, 0, 2, 3 }; - - vp9_wb_write_bit(wb, filter == SWITCHABLE); - if (filter != SWITCHABLE) - vp9_wb_write_literal(wb, filter_to_literal[filter], 2); -} - -static void fix_interp_filter(VP9_COMMON *cm, FRAME_COUNTS *counts) { - if (cm->interp_filter == SWITCHABLE) { - // Check to see if only one of the filters is actually used - int count[SWITCHABLE_FILTERS]; - int i, j, c = 0; - for (i = 0; i < SWITCHABLE_FILTERS; ++i) { - count[i] = 0; - for (j = 0; j < SWITCHABLE_FILTER_CONTEXTS; ++j) - count[i] += counts->switchable_interp[j][i]; - c += (count[i] > 0); - } - if (c == 1) { - // Only one filter is used. So set the filter at frame level - for (i = 0; i < SWITCHABLE_FILTERS; ++i) { - if (count[i]) { - cm->interp_filter = i; - break; - } - } - } - } -} - -static void write_tile_info(const VP9_COMMON *const cm, - struct vp9_write_bit_buffer *wb) { - int min_log2_tile_cols, max_log2_tile_cols, ones; - vp9_get_tile_n_bits(cm->mi_cols, &min_log2_tile_cols, &max_log2_tile_cols); - - // columns - ones = cm->log2_tile_cols - min_log2_tile_cols; - while (ones--) - vp9_wb_write_bit(wb, 1); - - if (cm->log2_tile_cols < max_log2_tile_cols) - vp9_wb_write_bit(wb, 0); - - // rows - vp9_wb_write_bit(wb, cm->log2_tile_rows != 0); - if (cm->log2_tile_rows != 0) - vp9_wb_write_bit(wb, cm->log2_tile_rows != 1); -} - -static int get_refresh_mask(VP9_COMP *cpi) { - if (vp9_preserve_existing_gf(cpi)) { - // We have decided to preserve the previously existing golden frame as our - // new ARF frame. However, in the short term we leave it in the GF slot and, - // if we're updating the GF with the current decoded frame, we save it - // instead to the ARF slot. - // Later, in the function vp9_encoder.c:vp9_update_reference_frames() we - // will swap gld_fb_idx and alt_fb_idx to achieve our objective. We do it - // there so that it can be done outside of the recode loop. - // Note: This is highly specific to the use of ARF as a forward reference, - // and this needs to be generalized as other uses are implemented - // (like RTC/temporal scalability). - return (cpi->refresh_last_frame << cpi->lst_fb_idx) | - (cpi->refresh_golden_frame << cpi->alt_fb_idx); - } else { - int arf_idx = cpi->alt_fb_idx; - if ((cpi->oxcf.pass == 2) && cpi->multi_arf_allowed) { - const GF_GROUP *const gf_group = &cpi->twopass.gf_group; - arf_idx = gf_group->arf_update_idx[gf_group->index]; - } - return (cpi->refresh_last_frame << cpi->lst_fb_idx) | - (cpi->refresh_golden_frame << cpi->gld_fb_idx) | - (cpi->refresh_alt_ref_frame << arf_idx); - } -} - -static size_t encode_tiles(VP9_COMP *cpi, uint8_t *data_ptr) { - VP9_COMMON *const cm = &cpi->common; - vp9_writer residual_bc; - int tile_row, tile_col; - TOKENEXTRA *tok_end; - size_t total_size = 0; - const int tile_cols = 1 << cm->log2_tile_cols; - const int tile_rows = 1 << cm->log2_tile_rows; - - vpx_memset(cm->above_seg_context, 0, sizeof(*cm->above_seg_context) * - mi_cols_aligned_to_sb(cm->mi_cols)); - - for (tile_row = 0; tile_row < tile_rows; tile_row++) { - for (tile_col = 0; tile_col < tile_cols; tile_col++) { - int tile_idx = tile_row * tile_cols + tile_col; - TOKENEXTRA *tok = cpi->tile_tok[tile_row][tile_col]; - - tok_end = cpi->tile_tok[tile_row][tile_col] + - cpi->tok_count[tile_row][tile_col]; - - if (tile_col < tile_cols - 1 || tile_row < tile_rows - 1) - vp9_start_encode(&residual_bc, data_ptr + total_size + 4); - else - vp9_start_encode(&residual_bc, data_ptr + total_size); - - write_modes(cpi, &cpi->tile_data[tile_idx].tile_info, - &residual_bc, &tok, tok_end); - assert(tok == tok_end); - vp9_stop_encode(&residual_bc); - if (tile_col < tile_cols - 1 || tile_row < tile_rows - 1) { - // size of this tile - mem_put_be32(data_ptr + total_size, residual_bc.pos); - total_size += 4; - } - - total_size += residual_bc.pos; - } - } - - return total_size; -} - -static void write_display_size(const VP9_COMMON *cm, - struct vp9_write_bit_buffer *wb) { - const int scaling_active = cm->width != cm->display_width || - cm->height != cm->display_height; - vp9_wb_write_bit(wb, scaling_active); - if (scaling_active) { - vp9_wb_write_literal(wb, cm->display_width - 1, 16); - vp9_wb_write_literal(wb, cm->display_height - 1, 16); - } -} - -static void write_frame_size(const VP9_COMMON *cm, - struct vp9_write_bit_buffer *wb) { - vp9_wb_write_literal(wb, cm->width - 1, 16); - vp9_wb_write_literal(wb, cm->height - 1, 16); - - write_display_size(cm, wb); -} - -static void write_frame_size_with_refs(VP9_COMP *cpi, - struct vp9_write_bit_buffer *wb) { - VP9_COMMON *const cm = &cpi->common; - int found = 0; - - MV_REFERENCE_FRAME ref_frame; - for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) { - YV12_BUFFER_CONFIG *cfg = get_ref_frame_buffer(cpi, ref_frame); - - // Set "found" to 0 for temporal svc and for spatial svc key frame - if (cpi->use_svc && - ((cpi->svc.number_temporal_layers > 1 && - cpi->oxcf.rc_mode == VPX_CBR) || - (cpi->svc.number_spatial_layers > 1 && - cpi->svc.layer_context[cpi->svc.spatial_layer_id].is_key_frame) || - (is_two_pass_svc(cpi) && - cpi->svc.encode_empty_frame_state == ENCODING && - cpi->svc.layer_context[0].frames_from_key_frame < - cpi->svc.number_temporal_layers + 1))) { - found = 0; - } else if (cfg != NULL) { - found = cm->width == cfg->y_crop_width && - cm->height == cfg->y_crop_height; - } - vp9_wb_write_bit(wb, found); - if (found) { - break; - } - } - - if (!found) { - vp9_wb_write_literal(wb, cm->width - 1, 16); - vp9_wb_write_literal(wb, cm->height - 1, 16); - } - - write_display_size(cm, wb); -} - -static void write_sync_code(struct vp9_write_bit_buffer *wb) { - vp9_wb_write_literal(wb, VP9_SYNC_CODE_0, 8); - vp9_wb_write_literal(wb, VP9_SYNC_CODE_1, 8); - vp9_wb_write_literal(wb, VP9_SYNC_CODE_2, 8); -} - -static void write_profile(BITSTREAM_PROFILE profile, - struct vp9_write_bit_buffer *wb) { - switch (profile) { - case PROFILE_0: - vp9_wb_write_literal(wb, 0, 2); - break; - case PROFILE_1: - vp9_wb_write_literal(wb, 2, 2); - break; - case PROFILE_2: - vp9_wb_write_literal(wb, 1, 2); - break; - case PROFILE_3: - vp9_wb_write_literal(wb, 6, 3); - break; - default: - assert(0); - } -} - -static void write_bitdepth_colorspace_sampling( - VP9_COMMON *const cm, struct vp9_write_bit_buffer *wb) { - if (cm->profile >= PROFILE_2) { - assert(cm->bit_depth > VPX_BITS_8); - vp9_wb_write_bit(wb, cm->bit_depth == VPX_BITS_10 ? 0 : 1); - } - vp9_wb_write_literal(wb, cm->color_space, 3); - if (cm->color_space != VPX_CS_SRGB) { - vp9_wb_write_bit(wb, 0); // 0: [16, 235] (i.e. xvYCC), 1: [0, 255] - if (cm->profile == PROFILE_1 || cm->profile == PROFILE_3) { - assert(cm->subsampling_x != 1 || cm->subsampling_y != 1); - vp9_wb_write_bit(wb, cm->subsampling_x); - vp9_wb_write_bit(wb, cm->subsampling_y); - vp9_wb_write_bit(wb, 0); // unused - } else { - assert(cm->subsampling_x == 1 && cm->subsampling_y == 1); - } - } else { - assert(cm->profile == PROFILE_1 || cm->profile == PROFILE_3); - vp9_wb_write_bit(wb, 0); // unused - } -} - -static void write_uncompressed_header(VP9_COMP *cpi, - struct vp9_write_bit_buffer *wb) { - VP9_COMMON *const cm = &cpi->common; - MACROBLOCKD *const xd = &cpi->td.mb.e_mbd; - - vp9_wb_write_literal(wb, VP9_FRAME_MARKER, 2); - - write_profile(cm->profile, wb); - - vp9_wb_write_bit(wb, 0); // show_existing_frame - vp9_wb_write_bit(wb, cm->frame_type); - vp9_wb_write_bit(wb, cm->show_frame); - vp9_wb_write_bit(wb, cm->error_resilient_mode); - - if (cm->frame_type == KEY_FRAME) { - write_sync_code(wb); - write_bitdepth_colorspace_sampling(cm, wb); - write_frame_size(cm, wb); - } else { - // In spatial svc if it's not error_resilient_mode then we need to code all - // visible frames as invisible. But we need to keep the show_frame flag so - // that the publisher could know whether it is supposed to be visible. - // So we will code the show_frame flag as it is. Then code the intra_only - // bit here. This will make the bitstream incompatible. In the player we - // will change to show_frame flag to 0, then add an one byte frame with - // show_existing_frame flag which tells the decoder which frame we want to - // show. - if (!cm->show_frame) - vp9_wb_write_bit(wb, cm->intra_only); - - if (!cm->error_resilient_mode) - vp9_wb_write_literal(wb, cm->reset_frame_context, 2); - - if (cm->intra_only) { - write_sync_code(wb); - - // Note for profile 0, 420 8bpp is assumed. - if (cm->profile > PROFILE_0) { - write_bitdepth_colorspace_sampling(cm, wb); - } - - vp9_wb_write_literal(wb, get_refresh_mask(cpi), REF_FRAMES); - write_frame_size(cm, wb); - } else { - MV_REFERENCE_FRAME ref_frame; - vp9_wb_write_literal(wb, get_refresh_mask(cpi), REF_FRAMES); - for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) { - assert(get_ref_frame_map_idx(cpi, ref_frame) != INVALID_IDX); - vp9_wb_write_literal(wb, get_ref_frame_map_idx(cpi, ref_frame), - REF_FRAMES_LOG2); - vp9_wb_write_bit(wb, cm->ref_frame_sign_bias[ref_frame]); - } - - write_frame_size_with_refs(cpi, wb); - - vp9_wb_write_bit(wb, cm->allow_high_precision_mv); - - fix_interp_filter(cm, cpi->td.counts); - write_interp_filter(cm->interp_filter, wb); - } - } - - if (!cm->error_resilient_mode) { - vp9_wb_write_bit(wb, cm->refresh_frame_context); - vp9_wb_write_bit(wb, cm->frame_parallel_decoding_mode); - } - - vp9_wb_write_literal(wb, cm->frame_context_idx, FRAME_CONTEXTS_LOG2); - - encode_loopfilter(&cm->lf, wb); - encode_quantization(cm, wb); - encode_segmentation(cm, xd, wb); - - write_tile_info(cm, wb); -} - -static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) { - VP9_COMMON *const cm = &cpi->common; - MACROBLOCKD *const xd = &cpi->td.mb.e_mbd; - FRAME_CONTEXT *const fc = cm->fc; - FRAME_COUNTS *counts = cpi->td.counts; - vp9_writer header_bc; - - vp9_start_encode(&header_bc, data); - - if (xd->lossless) - cm->tx_mode = ONLY_4X4; - else - encode_txfm_probs(cm, &header_bc, counts); - - update_coef_probs(cpi, &header_bc); - update_skip_probs(cm, &header_bc, counts); - - if (!frame_is_intra_only(cm)) { - int i; - - for (i = 0; i < INTER_MODE_CONTEXTS; ++i) - prob_diff_update(vp9_inter_mode_tree, cm->fc->inter_mode_probs[i], - counts->inter_mode[i], INTER_MODES, &header_bc); - - if (cm->interp_filter == SWITCHABLE) - update_switchable_interp_probs(cm, &header_bc, counts); - - for (i = 0; i < INTRA_INTER_CONTEXTS; i++) - vp9_cond_prob_diff_update(&header_bc, &fc->intra_inter_prob[i], - counts->intra_inter[i]); - - if (cpi->allow_comp_inter_inter) { - const int use_compound_pred = cm->reference_mode != SINGLE_REFERENCE; - const int use_hybrid_pred = cm->reference_mode == REFERENCE_MODE_SELECT; - - vp9_write_bit(&header_bc, use_compound_pred); - if (use_compound_pred) { - vp9_write_bit(&header_bc, use_hybrid_pred); - if (use_hybrid_pred) - for (i = 0; i < COMP_INTER_CONTEXTS; i++) - vp9_cond_prob_diff_update(&header_bc, &fc->comp_inter_prob[i], - counts->comp_inter[i]); - } - } - - if (cm->reference_mode != COMPOUND_REFERENCE) { - for (i = 0; i < REF_CONTEXTS; i++) { - vp9_cond_prob_diff_update(&header_bc, &fc->single_ref_prob[i][0], - counts->single_ref[i][0]); - vp9_cond_prob_diff_update(&header_bc, &fc->single_ref_prob[i][1], - counts->single_ref[i][1]); - } - } - - if (cm->reference_mode != SINGLE_REFERENCE) - for (i = 0; i < REF_CONTEXTS; i++) - vp9_cond_prob_diff_update(&header_bc, &fc->comp_ref_prob[i], - counts->comp_ref[i]); - - for (i = 0; i < BLOCK_SIZE_GROUPS; ++i) - prob_diff_update(vp9_intra_mode_tree, cm->fc->y_mode_prob[i], - counts->y_mode[i], INTRA_MODES, &header_bc); - - for (i = 0; i < PARTITION_CONTEXTS; ++i) - prob_diff_update(vp9_partition_tree, fc->partition_prob[i], - counts->partition[i], PARTITION_TYPES, &header_bc); - - vp9_write_nmv_probs(cm, cm->allow_high_precision_mv, &header_bc, - &counts->mv); - } - - vp9_stop_encode(&header_bc); - assert(header_bc.pos <= 0xffff); - - return header_bc.pos; -} - -void vp9_pack_bitstream(VP9_COMP *cpi, uint8_t *dest, size_t *size) { - uint8_t *data = dest; - size_t first_part_size, uncompressed_hdr_size; - struct vp9_write_bit_buffer wb = {data, 0}; - struct vp9_write_bit_buffer saved_wb; - - write_uncompressed_header(cpi, &wb); - saved_wb = wb; - vp9_wb_write_literal(&wb, 0, 16); // don't know in advance first part. size - - uncompressed_hdr_size = vp9_wb_bytes_written(&wb); - data += uncompressed_hdr_size; - - vp9_clear_system_state(); - - first_part_size = write_compressed_header(cpi, data); - data += first_part_size; - // TODO(jbb): Figure out what to do if first_part_size > 16 bits. - vp9_wb_write_literal(&saved_wb, (int)first_part_size, 16); - - data += encode_tiles(cpi, data); - - *size = data - dest; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_bitstream.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_bitstream.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_bitstream.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_bitstream.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP9_ENCODER_VP9_BITSTREAM_H_ -#define VP9_ENCODER_VP9_BITSTREAM_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "vp9/encoder/vp9_encoder.h" - -void vp9_pack_bitstream(VP9_COMP *cpi, uint8_t *dest, size_t *size); - -static INLINE int vp9_preserve_existing_gf(VP9_COMP *cpi) { - return !cpi->multi_arf_allowed && cpi->refresh_golden_frame && - cpi->rc.is_src_frame_alt_ref && - (!cpi->use_svc || // Add spatial svc base layer case here - (is_two_pass_svc(cpi) && - cpi->svc.spatial_layer_id == 0 && - cpi->svc.layer_context[0].gold_ref_idx >=0 && - cpi->oxcf.ss_enable_auto_arf[0])); -} - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_BITSTREAM_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_block.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_block.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_block.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_block.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_BLOCK_H_ -#define VP9_ENCODER_VP9_BLOCK_H_ - -#include "vp9/common/vp9_entropymv.h" -#include "vp9/common/vp9_entropy.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - unsigned int sse; - int sum; - unsigned int var; -} diff; - -struct macroblock_plane { - DECLARE_ALIGNED(16, int16_t, src_diff[64 * 64]); - tran_low_t *qcoeff; - tran_low_t *coeff; - uint16_t *eobs; - struct buf_2d src; - - // Quantizer setings - int16_t *quant_fp; - int16_t *round_fp; - int16_t *quant; - int16_t *quant_shift; - int16_t *zbin; - int16_t *round; - - int64_t quant_thred[2]; -}; - -/* The [2] dimension is for whether we skip the EOB node (i.e. if previous - * coefficient in this block was zero) or not. */ -typedef unsigned int vp9_coeff_cost[PLANE_TYPES][REF_TYPES][COEF_BANDS][2] - [COEFF_CONTEXTS][ENTROPY_TOKENS]; - -typedef struct macroblock MACROBLOCK; -struct macroblock { - struct macroblock_plane plane[MAX_MB_PLANE]; - - MACROBLOCKD e_mbd; - int skip_block; - int select_tx_size; - int skip_recode; - int skip_optimize; - int q_index; - - int errorperbit; - int sadperbit16; - int sadperbit4; - int rddiv; - int rdmult; - int mb_energy; - - // These are set to their default values at the beginning, and then adjusted - // further in the encoding process. - BLOCK_SIZE min_partition_size; - BLOCK_SIZE max_partition_size; - - int mv_best_ref_index[MAX_REF_FRAMES]; - unsigned int max_mv_context[MAX_REF_FRAMES]; - unsigned int source_variance; - unsigned int pred_sse[MAX_REF_FRAMES]; - int pred_mv_sad[MAX_REF_FRAMES]; - - int nmvjointcost[MV_JOINTS]; - int *nmvcost[2]; - int *nmvcost_hp[2]; - int **mvcost; - - int nmvjointsadcost[MV_JOINTS]; - int *nmvsadcost[2]; - int *nmvsadcost_hp[2]; - int **mvsadcost; - - // These define limits to motion vector components to prevent them - // from extending outside the UMV borders - int mv_col_min; - int mv_col_max; - int mv_row_min; - int mv_row_max; - - uint8_t zcoeff_blk[TX_SIZES][256]; - int skip; - - int encode_breakout; - - // note that token_costs is the cost when eob node is skipped - vp9_coeff_cost token_costs[TX_SIZES]; - - int optimize; - - // indicate if it is in the rd search loop or encoding process - int use_lp32x32fdct; - int skip_encode; - - // use fast quantization process - int quant_fp; - - // skip forward transform and quantization - uint8_t skip_txfm[MAX_MB_PLANE << 2]; - - int64_t bsse[MAX_MB_PLANE << 2]; - - // Used to store sub partition's choices. - MV pred_mv[MAX_REF_FRAMES]; - - // Strong color activity detection. Used in RTC coding mode to enhance - // the visual quality at the boundary of moving color objects. - uint8_t color_sensitivity[2]; - - void (*fwd_txm4x4)(const int16_t *input, tran_low_t *output, int stride); - void (*itxm_add)(const tran_low_t *input, uint8_t *dest, int stride, int eob); -#if CONFIG_VP9_HIGHBITDEPTH - void (*highbd_itxm_add)(const tran_low_t *input, uint8_t *dest, int stride, - int eob, int bd); -#endif -}; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_BLOCK_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_context_tree.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_context_tree.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_context_tree.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_context_tree.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vp9/encoder/vp9_context_tree.h" -#include "vp9/encoder/vp9_encoder.h" - -static const BLOCK_SIZE square[] = { - BLOCK_8X8, - BLOCK_16X16, - BLOCK_32X32, - BLOCK_64X64, -}; - -static void alloc_mode_context(VP9_COMMON *cm, int num_4x4_blk, - PICK_MODE_CONTEXT *ctx) { - const int num_blk = (num_4x4_blk < 4 ? 4 : num_4x4_blk); - const int num_pix = num_blk << 4; - int i, k; - ctx->num_4x4_blk = num_blk; - - CHECK_MEM_ERROR(cm, ctx->zcoeff_blk, - vpx_calloc(num_4x4_blk, sizeof(uint8_t))); - for (i = 0; i < MAX_MB_PLANE; ++i) { - for (k = 0; k < 3; ++k) { - CHECK_MEM_ERROR(cm, ctx->coeff[i][k], - vpx_memalign(16, num_pix * sizeof(*ctx->coeff[i][k]))); - CHECK_MEM_ERROR(cm, ctx->qcoeff[i][k], - vpx_memalign(16, num_pix * sizeof(*ctx->qcoeff[i][k]))); - CHECK_MEM_ERROR(cm, ctx->dqcoeff[i][k], - vpx_memalign(16, num_pix * sizeof(*ctx->dqcoeff[i][k]))); - CHECK_MEM_ERROR(cm, ctx->eobs[i][k], - vpx_memalign(16, num_pix * sizeof(*ctx->eobs[i][k]))); - ctx->coeff_pbuf[i][k] = ctx->coeff[i][k]; - ctx->qcoeff_pbuf[i][k] = ctx->qcoeff[i][k]; - ctx->dqcoeff_pbuf[i][k] = ctx->dqcoeff[i][k]; - ctx->eobs_pbuf[i][k] = ctx->eobs[i][k]; - } - } -} - -static void free_mode_context(PICK_MODE_CONTEXT *ctx) { - int i, k; - vpx_free(ctx->zcoeff_blk); - ctx->zcoeff_blk = 0; - for (i = 0; i < MAX_MB_PLANE; ++i) { - for (k = 0; k < 3; ++k) { - vpx_free(ctx->coeff[i][k]); - ctx->coeff[i][k] = 0; - vpx_free(ctx->qcoeff[i][k]); - ctx->qcoeff[i][k] = 0; - vpx_free(ctx->dqcoeff[i][k]); - ctx->dqcoeff[i][k] = 0; - vpx_free(ctx->eobs[i][k]); - ctx->eobs[i][k] = 0; - } - } -} - -static void alloc_tree_contexts(VP9_COMMON *cm, PC_TREE *tree, - int num_4x4_blk) { - alloc_mode_context(cm, num_4x4_blk, &tree->none); - alloc_mode_context(cm, num_4x4_blk/2, &tree->horizontal[0]); - alloc_mode_context(cm, num_4x4_blk/2, &tree->vertical[0]); - - /* TODO(Jbb): for 4x8 and 8x4 these allocated values are not used. - * Figure out a better way to do this. */ - alloc_mode_context(cm, num_4x4_blk/2, &tree->horizontal[1]); - alloc_mode_context(cm, num_4x4_blk/2, &tree->vertical[1]); -} - -static void free_tree_contexts(PC_TREE *tree) { - free_mode_context(&tree->none); - free_mode_context(&tree->horizontal[0]); - free_mode_context(&tree->horizontal[1]); - free_mode_context(&tree->vertical[0]); - free_mode_context(&tree->vertical[1]); -} - -// This function sets up a tree of contexts such that at each square -// partition level. There are contexts for none, horizontal, vertical, and -// split. Along with a block_size value and a selected block_size which -// represents the state of our search. -void vp9_setup_pc_tree(VP9_COMMON *cm, ThreadData *td) { - int i, j; - const int leaf_nodes = 64; - const int tree_nodes = 64 + 16 + 4 + 1; - int pc_tree_index = 0; - PC_TREE *this_pc; - PICK_MODE_CONTEXT *this_leaf; - int square_index = 1; - int nodes; - - vpx_free(td->leaf_tree); - CHECK_MEM_ERROR(cm, td->leaf_tree, vpx_calloc(leaf_nodes, - sizeof(*td->leaf_tree))); - vpx_free(td->pc_tree); - CHECK_MEM_ERROR(cm, td->pc_tree, vpx_calloc(tree_nodes, - sizeof(*td->pc_tree))); - - this_pc = &td->pc_tree[0]; - this_leaf = &td->leaf_tree[0]; - - // 4x4 blocks smaller than 8x8 but in the same 8x8 block share the same - // context so we only need to allocate 1 for each 8x8 block. - for (i = 0; i < leaf_nodes; ++i) - alloc_mode_context(cm, 1, &td->leaf_tree[i]); - - // Sets up all the leaf nodes in the tree. - for (pc_tree_index = 0; pc_tree_index < leaf_nodes; ++pc_tree_index) { - PC_TREE *const tree = &td->pc_tree[pc_tree_index]; - tree->block_size = square[0]; - alloc_tree_contexts(cm, tree, 4); - tree->leaf_split[0] = this_leaf++; - for (j = 1; j < 4; j++) - tree->leaf_split[j] = tree->leaf_split[0]; - } - - // Each node has 4 leaf nodes, fill each block_size level of the tree - // from leafs to the root. - for (nodes = 16; nodes > 0; nodes >>= 2) { - for (i = 0; i < nodes; ++i) { - PC_TREE *const tree = &td->pc_tree[pc_tree_index]; - alloc_tree_contexts(cm, tree, 4 << (2 * square_index)); - tree->block_size = square[square_index]; - for (j = 0; j < 4; j++) - tree->split[j] = this_pc++; - ++pc_tree_index; - } - ++square_index; - } - td->pc_root = &td->pc_tree[tree_nodes - 1]; - td->pc_root[0].none.best_mode_index = 2; -} - -void vp9_free_pc_tree(ThreadData *td) { - const int tree_nodes = 64 + 16 + 4 + 1; - int i; - - // Set up all 4x4 mode contexts - for (i = 0; i < 64; ++i) - free_mode_context(&td->leaf_tree[i]); - - // Sets up all the leaf nodes in the tree. - for (i = 0; i < tree_nodes; ++i) - free_tree_contexts(&td->pc_tree[i]); - - vpx_free(td->pc_tree); - td->pc_tree = NULL; - vpx_free(td->leaf_tree); - td->leaf_tree = NULL; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_context_tree.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_context_tree.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_context_tree.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_context_tree.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_CONTEXT_TREE_H_ -#define VP9_ENCODER_VP9_CONTEXT_TREE_H_ - -#include "vp9/common/vp9_blockd.h" - -struct VP9_COMP; -struct VP9Common; -struct ThreadData; - -// Structure to hold snapshot of coding context during the mode picking process -typedef struct { - MODE_INFO mic; - uint8_t *zcoeff_blk; - tran_low_t *coeff[MAX_MB_PLANE][3]; - tran_low_t *qcoeff[MAX_MB_PLANE][3]; - tran_low_t *dqcoeff[MAX_MB_PLANE][3]; - uint16_t *eobs[MAX_MB_PLANE][3]; - - // dual buffer pointers, 0: in use, 1: best in store - tran_low_t *coeff_pbuf[MAX_MB_PLANE][3]; - tran_low_t *qcoeff_pbuf[MAX_MB_PLANE][3]; - tran_low_t *dqcoeff_pbuf[MAX_MB_PLANE][3]; - uint16_t *eobs_pbuf[MAX_MB_PLANE][3]; - - int is_coded; - int num_4x4_blk; - int skip; - int pred_pixel_ready; - // For current partition, only if all Y, U, and V transform blocks' - // coefficients are quantized to 0, skippable is set to 0. - int skippable; - uint8_t skip_txfm[MAX_MB_PLANE << 2]; - int best_mode_index; - int hybrid_pred_diff; - int comp_pred_diff; - int single_pred_diff; - int64_t tx_rd_diff[TX_MODES]; - int64_t best_filter_diff[SWITCHABLE_FILTER_CONTEXTS]; - - // TODO(jingning) Use RD_COST struct here instead. This involves a boarder - // scope of refactoring. - int rate; - int64_t dist; - -#if CONFIG_VP9_TEMPORAL_DENOISING - unsigned int newmv_sse; - unsigned int zeromv_sse; - PREDICTION_MODE best_sse_inter_mode; - int_mv best_sse_mv; - MV_REFERENCE_FRAME best_reference_frame; - MV_REFERENCE_FRAME best_zeromv_reference_frame; -#endif - - // motion vector cache for adaptive motion search control in partition - // search loop - MV pred_mv[MAX_REF_FRAMES]; - INTERP_FILTER pred_interp_filter; -} PICK_MODE_CONTEXT; - -typedef struct PC_TREE { - int index; - PARTITION_TYPE partitioning; - BLOCK_SIZE block_size; - PICK_MODE_CONTEXT none; - PICK_MODE_CONTEXT horizontal[2]; - PICK_MODE_CONTEXT vertical[2]; - union { - struct PC_TREE *split[4]; - PICK_MODE_CONTEXT *leaf_split[4]; - }; -} PC_TREE; - -void vp9_setup_pc_tree(struct VP9Common *cm, struct ThreadData *td); -void vp9_free_pc_tree(struct ThreadData *td); - -#endif /* VP9_ENCODER_VP9_CONTEXT_TREE_H_ */ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_cost.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_cost.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_cost.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_cost.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vp9/encoder/vp9_cost.h" - -const unsigned int vp9_prob_cost[256] = { - 2047, 2047, 1791, 1641, 1535, 1452, 1385, 1328, 1279, 1235, 1196, 1161, - 1129, 1099, 1072, 1046, 1023, 1000, 979, 959, 940, 922, 905, 889, - 873, 858, 843, 829, 816, 803, 790, 778, 767, 755, 744, 733, - 723, 713, 703, 693, 684, 675, 666, 657, 649, 641, 633, 625, - 617, 609, 602, 594, 587, 580, 573, 567, 560, 553, 547, 541, - 534, 528, 522, 516, 511, 505, 499, 494, 488, 483, 477, 472, - 467, 462, 457, 452, 447, 442, 437, 433, 428, 424, 419, 415, - 410, 406, 401, 397, 393, 389, 385, 381, 377, 373, 369, 365, - 361, 357, 353, 349, 346, 342, 338, 335, 331, 328, 324, 321, - 317, 314, 311, 307, 304, 301, 297, 294, 291, 288, 285, 281, - 278, 275, 272, 269, 266, 263, 260, 257, 255, 252, 249, 246, - 243, 240, 238, 235, 232, 229, 227, 224, 221, 219, 216, 214, - 211, 208, 206, 203, 201, 198, 196, 194, 191, 189, 186, 184, - 181, 179, 177, 174, 172, 170, 168, 165, 163, 161, 159, 156, - 154, 152, 150, 148, 145, 143, 141, 139, 137, 135, 133, 131, - 129, 127, 125, 123, 121, 119, 117, 115, 113, 111, 109, 107, - 105, 103, 101, 99, 97, 95, 93, 92, 90, 88, 86, 84, - 82, 81, 79, 77, 75, 73, 72, 70, 68, 66, 65, 63, - 61, 60, 58, 56, 55, 53, 51, 50, 48, 46, 45, 43, - 41, 40, 38, 37, 35, 33, 32, 30, 29, 27, 25, 24, - 22, 21, 19, 18, 16, 15, 13, 12, 10, 9, 7, 6, - 4, 3, 1, 1}; - -static void cost(int *costs, vp9_tree tree, const vp9_prob *probs, - int i, int c) { - const vp9_prob prob = probs[i / 2]; - int b; - - for (b = 0; b <= 1; ++b) { - const int cc = c + vp9_cost_bit(prob, b); - const vp9_tree_index ii = tree[i + b]; - - if (ii <= 0) - costs[-ii] = cc; - else - cost(costs, tree, probs, ii, cc); - } -} - -void vp9_cost_tokens(int *costs, const vp9_prob *probs, vp9_tree tree) { - cost(costs, tree, probs, 0, 0); -} - -void vp9_cost_tokens_skip(int *costs, const vp9_prob *probs, vp9_tree tree) { - assert(tree[0] <= 0 && tree[1] > 0); - - costs[-tree[0]] = vp9_cost_bit(probs[0], 0); - cost(costs, tree, probs, 2, 0); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_cost.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_cost.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_cost.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_cost.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_COST_H_ -#define VP9_ENCODER_VP9_COST_H_ - -#include "vp9/common/vp9_prob.h" - -#ifdef __cplusplus -extern "C" { -#endif - -extern const unsigned int vp9_prob_cost[256]; - -#define vp9_cost_zero(prob) (vp9_prob_cost[prob]) - -#define vp9_cost_one(prob) vp9_cost_zero(vp9_complement(prob)) - -#define vp9_cost_bit(prob, bit) vp9_cost_zero((bit) ? vp9_complement(prob) \ - : (prob)) - -static INLINE unsigned int cost_branch256(const unsigned int ct[2], - vp9_prob p) { - return ct[0] * vp9_cost_zero(p) + ct[1] * vp9_cost_one(p); -} - -static INLINE int treed_cost(vp9_tree tree, const vp9_prob *probs, - int bits, int len) { - int cost = 0; - vp9_tree_index i = 0; - - do { - const int bit = (bits >> --len) & 1; - cost += vp9_cost_bit(probs[i >> 1], bit); - i = tree[i + bit]; - } while (len); - - return cost; -} - -void vp9_cost_tokens(int *costs, const vp9_prob *probs, vp9_tree tree); -void vp9_cost_tokens_skip(int *costs, const vp9_prob *probs, vp9_tree tree); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_COST_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_dct.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_dct.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_dct.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_dct.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1591 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vpx_config.h" -#include "./vp9_rtcd.h" - -#include "vp9/common/vp9_blockd.h" -#include "vp9/common/vp9_idct.h" -#include "vp9/common/vp9_systemdependent.h" -#include "vp9/encoder/vp9_dct.h" - -static INLINE tran_high_t fdct_round_shift(tran_high_t input) { - tran_high_t rv = ROUND_POWER_OF_TWO(input, DCT_CONST_BITS); - // TODO(debargha, peter.derivaz): Find new bounds for this assert - // and make the bounds consts. - // assert(INT16_MIN <= rv && rv <= INT16_MAX); - return rv; -} - -void vp9_fdct4(const tran_low_t *input, tran_low_t *output) { - tran_high_t step[4]; - tran_high_t temp1, temp2; - - step[0] = input[0] + input[3]; - step[1] = input[1] + input[2]; - step[2] = input[1] - input[2]; - step[3] = input[0] - input[3]; - - temp1 = (step[0] + step[1]) * cospi_16_64; - temp2 = (step[0] - step[1]) * cospi_16_64; - output[0] = (tran_low_t)fdct_round_shift(temp1); - output[2] = (tran_low_t)fdct_round_shift(temp2); - temp1 = step[2] * cospi_24_64 + step[3] * cospi_8_64; - temp2 = -step[2] * cospi_8_64 + step[3] * cospi_24_64; - output[1] = (tran_low_t)fdct_round_shift(temp1); - output[3] = (tran_low_t)fdct_round_shift(temp2); -} - -void vp9_fdct4x4_1_c(const int16_t *input, tran_low_t *output, int stride) { - int r, c; - tran_low_t sum = 0; - for (r = 0; r < 4; ++r) - for (c = 0; c < 4; ++c) - sum += input[r * stride + c]; - - output[0] = sum << 1; - output[1] = 0; -} - -void vp9_fdct4x4_c(const int16_t *input, tran_low_t *output, int stride) { - // The 2D transform is done with two passes which are actually pretty - // similar. In the first one, we transform the columns and transpose - // the results. In the second one, we transform the rows. To achieve that, - // as the first pass results are transposed, we transpose the columns (that - // is the transposed rows) and transpose the results (so that it goes back - // in normal/row positions). - int pass; - // We need an intermediate buffer between passes. - tran_low_t intermediate[4 * 4]; - const int16_t *in_pass0 = input; - const tran_low_t *in = NULL; - tran_low_t *out = intermediate; - // Do the two transform/transpose passes - for (pass = 0; pass < 2; ++pass) { - tran_high_t input[4]; // canbe16 - tran_high_t step[4]; // canbe16 - tran_high_t temp1, temp2; // needs32 - int i; - for (i = 0; i < 4; ++i) { - // Load inputs. - if (0 == pass) { - input[0] = in_pass0[0 * stride] * 16; - input[1] = in_pass0[1 * stride] * 16; - input[2] = in_pass0[2 * stride] * 16; - input[3] = in_pass0[3 * stride] * 16; - if (i == 0 && input[0]) { - input[0] += 1; - } - } else { - input[0] = in[0 * 4]; - input[1] = in[1 * 4]; - input[2] = in[2 * 4]; - input[3] = in[3 * 4]; - } - // Transform. - step[0] = input[0] + input[3]; - step[1] = input[1] + input[2]; - step[2] = input[1] - input[2]; - step[3] = input[0] - input[3]; - temp1 = (step[0] + step[1]) * cospi_16_64; - temp2 = (step[0] - step[1]) * cospi_16_64; - out[0] = (tran_low_t)fdct_round_shift(temp1); - out[2] = (tran_low_t)fdct_round_shift(temp2); - temp1 = step[2] * cospi_24_64 + step[3] * cospi_8_64; - temp2 = -step[2] * cospi_8_64 + step[3] * cospi_24_64; - out[1] = (tran_low_t)fdct_round_shift(temp1); - out[3] = (tran_low_t)fdct_round_shift(temp2); - // Do next column (which is a transposed row in second/horizontal pass) - in_pass0++; - in++; - out += 4; - } - // Setup in/out for next pass. - in = intermediate; - out = output; - } - - { - int i, j; - for (i = 0; i < 4; ++i) { - for (j = 0; j < 4; ++j) - output[j + i * 4] = (output[j + i * 4] + 1) >> 2; - } - } -} - -void vp9_fadst4(const tran_low_t *input, tran_low_t *output) { - tran_high_t x0, x1, x2, x3; - tran_high_t s0, s1, s2, s3, s4, s5, s6, s7; - - x0 = input[0]; - x1 = input[1]; - x2 = input[2]; - x3 = input[3]; - - if (!(x0 | x1 | x2 | x3)) { - output[0] = output[1] = output[2] = output[3] = 0; - return; - } - - s0 = sinpi_1_9 * x0; - s1 = sinpi_4_9 * x0; - s2 = sinpi_2_9 * x1; - s3 = sinpi_1_9 * x1; - s4 = sinpi_3_9 * x2; - s5 = sinpi_4_9 * x3; - s6 = sinpi_2_9 * x3; - s7 = x0 + x1 - x3; - - x0 = s0 + s2 + s5; - x1 = sinpi_3_9 * s7; - x2 = s1 - s3 + s6; - x3 = s4; - - s0 = x0 + x3; - s1 = x1; - s2 = x2 - x3; - s3 = x2 - x0 + x3; - - // 1-D transform scaling factor is sqrt(2). - output[0] = (tran_low_t)fdct_round_shift(s0); - output[1] = (tran_low_t)fdct_round_shift(s1); - output[2] = (tran_low_t)fdct_round_shift(s2); - output[3] = (tran_low_t)fdct_round_shift(s3); -} - -void vp9_fht4x4_c(const int16_t *input, tran_low_t *output, - int stride, int tx_type) { - if (tx_type == DCT_DCT) { - vp9_fdct4x4_c(input, output, stride); - } else { - tran_low_t out[4 * 4]; - int i, j; - tran_low_t temp_in[4], temp_out[4]; - const transform_2d ht = FHT_4[tx_type]; - - // Columns - for (i = 0; i < 4; ++i) { - for (j = 0; j < 4; ++j) - temp_in[j] = input[j * stride + i] * 16; - if (i == 0 && temp_in[0]) - temp_in[0] += 1; - ht.cols(temp_in, temp_out); - for (j = 0; j < 4; ++j) - out[j * 4 + i] = temp_out[j]; - } - - // Rows - for (i = 0; i < 4; ++i) { - for (j = 0; j < 4; ++j) - temp_in[j] = out[j + i * 4]; - ht.rows(temp_in, temp_out); - for (j = 0; j < 4; ++j) - output[j + i * 4] = (temp_out[j] + 1) >> 2; - } - } -} - -void vp9_fdct8(const tran_low_t *input, tran_low_t *output) { - tran_high_t s0, s1, s2, s3, s4, s5, s6, s7; // canbe16 - tran_high_t t0, t1, t2, t3; // needs32 - tran_high_t x0, x1, x2, x3; // canbe16 - - // stage 1 - s0 = input[0] + input[7]; - s1 = input[1] + input[6]; - s2 = input[2] + input[5]; - s3 = input[3] + input[4]; - s4 = input[3] - input[4]; - s5 = input[2] - input[5]; - s6 = input[1] - input[6]; - s7 = input[0] - input[7]; - - // fdct4(step, step); - x0 = s0 + s3; - x1 = s1 + s2; - x2 = s1 - s2; - x3 = s0 - s3; - t0 = (x0 + x1) * cospi_16_64; - t1 = (x0 - x1) * cospi_16_64; - t2 = x2 * cospi_24_64 + x3 * cospi_8_64; - t3 = -x2 * cospi_8_64 + x3 * cospi_24_64; - output[0] = (tran_low_t)fdct_round_shift(t0); - output[2] = (tran_low_t)fdct_round_shift(t2); - output[4] = (tran_low_t)fdct_round_shift(t1); - output[6] = (tran_low_t)fdct_round_shift(t3); - - // Stage 2 - t0 = (s6 - s5) * cospi_16_64; - t1 = (s6 + s5) * cospi_16_64; - t2 = (tran_low_t)fdct_round_shift(t0); - t3 = (tran_low_t)fdct_round_shift(t1); - - // Stage 3 - x0 = s4 + t2; - x1 = s4 - t2; - x2 = s7 - t3; - x3 = s7 + t3; - - // Stage 4 - t0 = x0 * cospi_28_64 + x3 * cospi_4_64; - t1 = x1 * cospi_12_64 + x2 * cospi_20_64; - t2 = x2 * cospi_12_64 + x1 * -cospi_20_64; - t3 = x3 * cospi_28_64 + x0 * -cospi_4_64; - output[1] = (tran_low_t)fdct_round_shift(t0); - output[3] = (tran_low_t)fdct_round_shift(t2); - output[5] = (tran_low_t)fdct_round_shift(t1); - output[7] = (tran_low_t)fdct_round_shift(t3); -} - -void vp9_fdct8x8_1_c(const int16_t *input, tran_low_t *output, int stride) { - int r, c; - tran_low_t sum = 0; - for (r = 0; r < 8; ++r) - for (c = 0; c < 8; ++c) - sum += input[r * stride + c]; - - output[0] = sum; - output[1] = 0; -} - -void vp9_fdct8x8_c(const int16_t *input, tran_low_t *final_output, int stride) { - int i, j; - tran_low_t intermediate[64]; - - // Transform columns - { - tran_low_t *output = intermediate; - tran_high_t s0, s1, s2, s3, s4, s5, s6, s7; // canbe16 - tran_high_t t0, t1, t2, t3; // needs32 - tran_high_t x0, x1, x2, x3; // canbe16 - - int i; - for (i = 0; i < 8; i++) { - // stage 1 - s0 = (input[0 * stride] + input[7 * stride]) * 4; - s1 = (input[1 * stride] + input[6 * stride]) * 4; - s2 = (input[2 * stride] + input[5 * stride]) * 4; - s3 = (input[3 * stride] + input[4 * stride]) * 4; - s4 = (input[3 * stride] - input[4 * stride]) * 4; - s5 = (input[2 * stride] - input[5 * stride]) * 4; - s6 = (input[1 * stride] - input[6 * stride]) * 4; - s7 = (input[0 * stride] - input[7 * stride]) * 4; - - // fdct4(step, step); - x0 = s0 + s3; - x1 = s1 + s2; - x2 = s1 - s2; - x3 = s0 - s3; - t0 = (x0 + x1) * cospi_16_64; - t1 = (x0 - x1) * cospi_16_64; - t2 = x2 * cospi_24_64 + x3 * cospi_8_64; - t3 = -x2 * cospi_8_64 + x3 * cospi_24_64; - output[0 * 8] = (tran_low_t)fdct_round_shift(t0); - output[2 * 8] = (tran_low_t)fdct_round_shift(t2); - output[4 * 8] = (tran_low_t)fdct_round_shift(t1); - output[6 * 8] = (tran_low_t)fdct_round_shift(t3); - - // Stage 2 - t0 = (s6 - s5) * cospi_16_64; - t1 = (s6 + s5) * cospi_16_64; - t2 = fdct_round_shift(t0); - t3 = fdct_round_shift(t1); - - // Stage 3 - x0 = s4 + t2; - x1 = s4 - t2; - x2 = s7 - t3; - x3 = s7 + t3; - - // Stage 4 - t0 = x0 * cospi_28_64 + x3 * cospi_4_64; - t1 = x1 * cospi_12_64 + x2 * cospi_20_64; - t2 = x2 * cospi_12_64 + x1 * -cospi_20_64; - t3 = x3 * cospi_28_64 + x0 * -cospi_4_64; - output[1 * 8] = (tran_low_t)fdct_round_shift(t0); - output[3 * 8] = (tran_low_t)fdct_round_shift(t2); - output[5 * 8] = (tran_low_t)fdct_round_shift(t1); - output[7 * 8] = (tran_low_t)fdct_round_shift(t3); - input++; - output++; - } - } - - // Rows - for (i = 0; i < 8; ++i) { - vp9_fdct8(&intermediate[i * 8], &final_output[i * 8]); - for (j = 0; j < 8; ++j) - final_output[j + i * 8] /= 2; - } -} - -void vp9_fdct8x8_quant_c(const int16_t *input, int stride, - tran_low_t *coeff_ptr, intptr_t n_coeffs, - int skip_block, - const int16_t *zbin_ptr, const int16_t *round_ptr, - const int16_t *quant_ptr, - const int16_t *quant_shift_ptr, - tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, - const int16_t *dequant_ptr, - uint16_t *eob_ptr, - const int16_t *scan, const int16_t *iscan) { - int eob = -1; - - int i, j; - tran_low_t intermediate[64]; - - // Transform columns - { - tran_low_t *output = intermediate; - tran_high_t s0, s1, s2, s3, s4, s5, s6, s7; // canbe16 - tran_high_t t0, t1, t2, t3; // needs32 - tran_high_t x0, x1, x2, x3; // canbe16 - - int i; - for (i = 0; i < 8; i++) { - // stage 1 - s0 = (input[0 * stride] + input[7 * stride]) * 4; - s1 = (input[1 * stride] + input[6 * stride]) * 4; - s2 = (input[2 * stride] + input[5 * stride]) * 4; - s3 = (input[3 * stride] + input[4 * stride]) * 4; - s4 = (input[3 * stride] - input[4 * stride]) * 4; - s5 = (input[2 * stride] - input[5 * stride]) * 4; - s6 = (input[1 * stride] - input[6 * stride]) * 4; - s7 = (input[0 * stride] - input[7 * stride]) * 4; - - // fdct4(step, step); - x0 = s0 + s3; - x1 = s1 + s2; - x2 = s1 - s2; - x3 = s0 - s3; - t0 = (x0 + x1) * cospi_16_64; - t1 = (x0 - x1) * cospi_16_64; - t2 = x2 * cospi_24_64 + x3 * cospi_8_64; - t3 = -x2 * cospi_8_64 + x3 * cospi_24_64; - output[0 * 8] = (tran_low_t)fdct_round_shift(t0); - output[2 * 8] = (tran_low_t)fdct_round_shift(t2); - output[4 * 8] = (tran_low_t)fdct_round_shift(t1); - output[6 * 8] = (tran_low_t)fdct_round_shift(t3); - - // Stage 2 - t0 = (s6 - s5) * cospi_16_64; - t1 = (s6 + s5) * cospi_16_64; - t2 = fdct_round_shift(t0); - t3 = fdct_round_shift(t1); - - // Stage 3 - x0 = s4 + t2; - x1 = s4 - t2; - x2 = s7 - t3; - x3 = s7 + t3; - - // Stage 4 - t0 = x0 * cospi_28_64 + x3 * cospi_4_64; - t1 = x1 * cospi_12_64 + x2 * cospi_20_64; - t2 = x2 * cospi_12_64 + x1 * -cospi_20_64; - t3 = x3 * cospi_28_64 + x0 * -cospi_4_64; - output[1 * 8] = (tran_low_t)fdct_round_shift(t0); - output[3 * 8] = (tran_low_t)fdct_round_shift(t2); - output[5 * 8] = (tran_low_t)fdct_round_shift(t1); - output[7 * 8] = (tran_low_t)fdct_round_shift(t3); - input++; - output++; - } - } - - // Rows - for (i = 0; i < 8; ++i) { - vp9_fdct8(&intermediate[i * 8], &coeff_ptr[i * 8]); - for (j = 0; j < 8; ++j) - coeff_ptr[j + i * 8] /= 2; - } - - // TODO(jingning) Decide the need of these arguments after the - // quantization process is completed. - (void)zbin_ptr; - (void)quant_shift_ptr; - (void)iscan; - - vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); - vpx_memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); - - if (!skip_block) { - // Quantization pass: All coefficients with index >= zero_flag are - // skippable. Note: zero_flag can be zero. - for (i = 0; i < n_coeffs; i++) { - const int rc = scan[i]; - const int coeff = coeff_ptr[rc]; - const int coeff_sign = (coeff >> 31); - const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign; - - int tmp = clamp(abs_coeff + round_ptr[rc != 0], INT16_MIN, INT16_MAX); - tmp = (tmp * quant_ptr[rc != 0]) >> 16; - - qcoeff_ptr[rc] = (tmp ^ coeff_sign) - coeff_sign; - dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0]; - - if (tmp) - eob = i; - } - } - *eob_ptr = eob + 1; -} - -void vp9_fdct16x16_1_c(const int16_t *input, tran_low_t *output, int stride) { - int r, c; - tran_low_t sum = 0; - for (r = 0; r < 16; ++r) - for (c = 0; c < 16; ++c) - sum += input[r * stride + c]; - - output[0] = sum >> 1; - output[1] = 0; -} - -void vp9_fdct16x16_c(const int16_t *input, tran_low_t *output, int stride) { - // The 2D transform is done with two passes which are actually pretty - // similar. In the first one, we transform the columns and transpose - // the results. In the second one, we transform the rows. To achieve that, - // as the first pass results are transposed, we transpose the columns (that - // is the transposed rows) and transpose the results (so that it goes back - // in normal/row positions). - int pass; - // We need an intermediate buffer between passes. - tran_low_t intermediate[256]; - const int16_t *in_pass0 = input; - const tran_low_t *in = NULL; - tran_low_t *out = intermediate; - // Do the two transform/transpose passes - for (pass = 0; pass < 2; ++pass) { - tran_high_t step1[8]; // canbe16 - tran_high_t step2[8]; // canbe16 - tran_high_t step3[8]; // canbe16 - tran_high_t input[8]; // canbe16 - tran_high_t temp1, temp2; // needs32 - int i; - for (i = 0; i < 16; i++) { - if (0 == pass) { - // Calculate input for the first 8 results. - input[0] = (in_pass0[0 * stride] + in_pass0[15 * stride]) * 4; - input[1] = (in_pass0[1 * stride] + in_pass0[14 * stride]) * 4; - input[2] = (in_pass0[2 * stride] + in_pass0[13 * stride]) * 4; - input[3] = (in_pass0[3 * stride] + in_pass0[12 * stride]) * 4; - input[4] = (in_pass0[4 * stride] + in_pass0[11 * stride]) * 4; - input[5] = (in_pass0[5 * stride] + in_pass0[10 * stride]) * 4; - input[6] = (in_pass0[6 * stride] + in_pass0[ 9 * stride]) * 4; - input[7] = (in_pass0[7 * stride] + in_pass0[ 8 * stride]) * 4; - // Calculate input for the next 8 results. - step1[0] = (in_pass0[7 * stride] - in_pass0[ 8 * stride]) * 4; - step1[1] = (in_pass0[6 * stride] - in_pass0[ 9 * stride]) * 4; - step1[2] = (in_pass0[5 * stride] - in_pass0[10 * stride]) * 4; - step1[3] = (in_pass0[4 * stride] - in_pass0[11 * stride]) * 4; - step1[4] = (in_pass0[3 * stride] - in_pass0[12 * stride]) * 4; - step1[5] = (in_pass0[2 * stride] - in_pass0[13 * stride]) * 4; - step1[6] = (in_pass0[1 * stride] - in_pass0[14 * stride]) * 4; - step1[7] = (in_pass0[0 * stride] - in_pass0[15 * stride]) * 4; - } else { - // Calculate input for the first 8 results. - input[0] = ((in[0 * 16] + 1) >> 2) + ((in[15 * 16] + 1) >> 2); - input[1] = ((in[1 * 16] + 1) >> 2) + ((in[14 * 16] + 1) >> 2); - input[2] = ((in[2 * 16] + 1) >> 2) + ((in[13 * 16] + 1) >> 2); - input[3] = ((in[3 * 16] + 1) >> 2) + ((in[12 * 16] + 1) >> 2); - input[4] = ((in[4 * 16] + 1) >> 2) + ((in[11 * 16] + 1) >> 2); - input[5] = ((in[5 * 16] + 1) >> 2) + ((in[10 * 16] + 1) >> 2); - input[6] = ((in[6 * 16] + 1) >> 2) + ((in[ 9 * 16] + 1) >> 2); - input[7] = ((in[7 * 16] + 1) >> 2) + ((in[ 8 * 16] + 1) >> 2); - // Calculate input for the next 8 results. - step1[0] = ((in[7 * 16] + 1) >> 2) - ((in[ 8 * 16] + 1) >> 2); - step1[1] = ((in[6 * 16] + 1) >> 2) - ((in[ 9 * 16] + 1) >> 2); - step1[2] = ((in[5 * 16] + 1) >> 2) - ((in[10 * 16] + 1) >> 2); - step1[3] = ((in[4 * 16] + 1) >> 2) - ((in[11 * 16] + 1) >> 2); - step1[4] = ((in[3 * 16] + 1) >> 2) - ((in[12 * 16] + 1) >> 2); - step1[5] = ((in[2 * 16] + 1) >> 2) - ((in[13 * 16] + 1) >> 2); - step1[6] = ((in[1 * 16] + 1) >> 2) - ((in[14 * 16] + 1) >> 2); - step1[7] = ((in[0 * 16] + 1) >> 2) - ((in[15 * 16] + 1) >> 2); - } - // Work on the first eight values; fdct8(input, even_results); - { - tran_high_t s0, s1, s2, s3, s4, s5, s6, s7; // canbe16 - tran_high_t t0, t1, t2, t3; // needs32 - tran_high_t x0, x1, x2, x3; // canbe16 - - // stage 1 - s0 = input[0] + input[7]; - s1 = input[1] + input[6]; - s2 = input[2] + input[5]; - s3 = input[3] + input[4]; - s4 = input[3] - input[4]; - s5 = input[2] - input[5]; - s6 = input[1] - input[6]; - s7 = input[0] - input[7]; - - // fdct4(step, step); - x0 = s0 + s3; - x1 = s1 + s2; - x2 = s1 - s2; - x3 = s0 - s3; - t0 = (x0 + x1) * cospi_16_64; - t1 = (x0 - x1) * cospi_16_64; - t2 = x3 * cospi_8_64 + x2 * cospi_24_64; - t3 = x3 * cospi_24_64 - x2 * cospi_8_64; - out[0] = (tran_low_t)fdct_round_shift(t0); - out[4] = (tran_low_t)fdct_round_shift(t2); - out[8] = (tran_low_t)fdct_round_shift(t1); - out[12] = (tran_low_t)fdct_round_shift(t3); - - // Stage 2 - t0 = (s6 - s5) * cospi_16_64; - t1 = (s6 + s5) * cospi_16_64; - t2 = fdct_round_shift(t0); - t3 = fdct_round_shift(t1); - - // Stage 3 - x0 = s4 + t2; - x1 = s4 - t2; - x2 = s7 - t3; - x3 = s7 + t3; - - // Stage 4 - t0 = x0 * cospi_28_64 + x3 * cospi_4_64; - t1 = x1 * cospi_12_64 + x2 * cospi_20_64; - t2 = x2 * cospi_12_64 + x1 * -cospi_20_64; - t3 = x3 * cospi_28_64 + x0 * -cospi_4_64; - out[2] = (tran_low_t)fdct_round_shift(t0); - out[6] = (tran_low_t)fdct_round_shift(t2); - out[10] = (tran_low_t)fdct_round_shift(t1); - out[14] = (tran_low_t)fdct_round_shift(t3); - } - // Work on the next eight values; step1 -> odd_results - { - // step 2 - temp1 = (step1[5] - step1[2]) * cospi_16_64; - temp2 = (step1[4] - step1[3]) * cospi_16_64; - step2[2] = fdct_round_shift(temp1); - step2[3] = fdct_round_shift(temp2); - temp1 = (step1[4] + step1[3]) * cospi_16_64; - temp2 = (step1[5] + step1[2]) * cospi_16_64; - step2[4] = fdct_round_shift(temp1); - step2[5] = fdct_round_shift(temp2); - // step 3 - step3[0] = step1[0] + step2[3]; - step3[1] = step1[1] + step2[2]; - step3[2] = step1[1] - step2[2]; - step3[3] = step1[0] - step2[3]; - step3[4] = step1[7] - step2[4]; - step3[5] = step1[6] - step2[5]; - step3[6] = step1[6] + step2[5]; - step3[7] = step1[7] + step2[4]; - // step 4 - temp1 = step3[1] * -cospi_8_64 + step3[6] * cospi_24_64; - temp2 = step3[2] * cospi_24_64 + step3[5] * cospi_8_64; - step2[1] = fdct_round_shift(temp1); - step2[2] = fdct_round_shift(temp2); - temp1 = step3[2] * cospi_8_64 - step3[5] * cospi_24_64; - temp2 = step3[1] * cospi_24_64 + step3[6] * cospi_8_64; - step2[5] = fdct_round_shift(temp1); - step2[6] = fdct_round_shift(temp2); - // step 5 - step1[0] = step3[0] + step2[1]; - step1[1] = step3[0] - step2[1]; - step1[2] = step3[3] + step2[2]; - step1[3] = step3[3] - step2[2]; - step1[4] = step3[4] - step2[5]; - step1[5] = step3[4] + step2[5]; - step1[6] = step3[7] - step2[6]; - step1[7] = step3[7] + step2[6]; - // step 6 - temp1 = step1[0] * cospi_30_64 + step1[7] * cospi_2_64; - temp2 = step1[1] * cospi_14_64 + step1[6] * cospi_18_64; - out[1] = (tran_low_t)fdct_round_shift(temp1); - out[9] = (tran_low_t)fdct_round_shift(temp2); - temp1 = step1[2] * cospi_22_64 + step1[5] * cospi_10_64; - temp2 = step1[3] * cospi_6_64 + step1[4] * cospi_26_64; - out[5] = (tran_low_t)fdct_round_shift(temp1); - out[13] = (tran_low_t)fdct_round_shift(temp2); - temp1 = step1[3] * -cospi_26_64 + step1[4] * cospi_6_64; - temp2 = step1[2] * -cospi_10_64 + step1[5] * cospi_22_64; - out[3] = (tran_low_t)fdct_round_shift(temp1); - out[11] = (tran_low_t)fdct_round_shift(temp2); - temp1 = step1[1] * -cospi_18_64 + step1[6] * cospi_14_64; - temp2 = step1[0] * -cospi_2_64 + step1[7] * cospi_30_64; - out[7] = (tran_low_t)fdct_round_shift(temp1); - out[15] = (tran_low_t)fdct_round_shift(temp2); - } - // Do next column (which is a transposed row in second/horizontal pass) - in++; - in_pass0++; - out += 16; - } - // Setup in/out for next pass. - in = intermediate; - out = output; - } -} - -void vp9_fadst8(const tran_low_t *input, tran_low_t *output) { - tran_high_t s0, s1, s2, s3, s4, s5, s6, s7; - - tran_high_t x0 = input[7]; - tran_high_t x1 = input[0]; - tran_high_t x2 = input[5]; - tran_high_t x3 = input[2]; - tran_high_t x4 = input[3]; - tran_high_t x5 = input[4]; - tran_high_t x6 = input[1]; - tran_high_t x7 = input[6]; - - // stage 1 - s0 = cospi_2_64 * x0 + cospi_30_64 * x1; - s1 = cospi_30_64 * x0 - cospi_2_64 * x1; - s2 = cospi_10_64 * x2 + cospi_22_64 * x3; - s3 = cospi_22_64 * x2 - cospi_10_64 * x3; - s4 = cospi_18_64 * x4 + cospi_14_64 * x5; - s5 = cospi_14_64 * x4 - cospi_18_64 * x5; - s6 = cospi_26_64 * x6 + cospi_6_64 * x7; - s7 = cospi_6_64 * x6 - cospi_26_64 * x7; - - x0 = fdct_round_shift(s0 + s4); - x1 = fdct_round_shift(s1 + s5); - x2 = fdct_round_shift(s2 + s6); - x3 = fdct_round_shift(s3 + s7); - x4 = fdct_round_shift(s0 - s4); - x5 = fdct_round_shift(s1 - s5); - x6 = fdct_round_shift(s2 - s6); - x7 = fdct_round_shift(s3 - s7); - - // stage 2 - s0 = x0; - s1 = x1; - s2 = x2; - s3 = x3; - s4 = cospi_8_64 * x4 + cospi_24_64 * x5; - s5 = cospi_24_64 * x4 - cospi_8_64 * x5; - s6 = - cospi_24_64 * x6 + cospi_8_64 * x7; - s7 = cospi_8_64 * x6 + cospi_24_64 * x7; - - x0 = s0 + s2; - x1 = s1 + s3; - x2 = s0 - s2; - x3 = s1 - s3; - x4 = fdct_round_shift(s4 + s6); - x5 = fdct_round_shift(s5 + s7); - x6 = fdct_round_shift(s4 - s6); - x7 = fdct_round_shift(s5 - s7); - - // stage 3 - s2 = cospi_16_64 * (x2 + x3); - s3 = cospi_16_64 * (x2 - x3); - s6 = cospi_16_64 * (x6 + x7); - s7 = cospi_16_64 * (x6 - x7); - - x2 = fdct_round_shift(s2); - x3 = fdct_round_shift(s3); - x6 = fdct_round_shift(s6); - x7 = fdct_round_shift(s7); - - output[0] = (tran_low_t)x0; - output[1] = (tran_low_t)-x4; - output[2] = (tran_low_t)x6; - output[3] = (tran_low_t)-x2; - output[4] = (tran_low_t)x3; - output[5] = (tran_low_t)-x7; - output[6] = (tran_low_t)x5; - output[7] = (tran_low_t)-x1; -} - -void vp9_fht8x8_c(const int16_t *input, tran_low_t *output, - int stride, int tx_type) { - if (tx_type == DCT_DCT) { - vp9_fdct8x8_c(input, output, stride); - } else { - tran_low_t out[64]; - int i, j; - tran_low_t temp_in[8], temp_out[8]; - const transform_2d ht = FHT_8[tx_type]; - - // Columns - for (i = 0; i < 8; ++i) { - for (j = 0; j < 8; ++j) - temp_in[j] = input[j * stride + i] * 4; - ht.cols(temp_in, temp_out); - for (j = 0; j < 8; ++j) - out[j * 8 + i] = temp_out[j]; - } - - // Rows - for (i = 0; i < 8; ++i) { - for (j = 0; j < 8; ++j) - temp_in[j] = out[j + i * 8]; - ht.rows(temp_in, temp_out); - for (j = 0; j < 8; ++j) - output[j + i * 8] = (temp_out[j] + (temp_out[j] < 0)) >> 1; - } - } -} - -/* 4-point reversible, orthonormal Walsh-Hadamard in 3.5 adds, 0.5 shifts per - pixel. */ -void vp9_fwht4x4_c(const int16_t *input, tran_low_t *output, int stride) { - int i; - tran_high_t a1, b1, c1, d1, e1; - const int16_t *ip_pass0 = input; - const tran_low_t *ip = NULL; - tran_low_t *op = output; - - for (i = 0; i < 4; i++) { - a1 = ip_pass0[0 * stride]; - b1 = ip_pass0[1 * stride]; - c1 = ip_pass0[2 * stride]; - d1 = ip_pass0[3 * stride]; - - a1 += b1; - d1 = d1 - c1; - e1 = (a1 - d1) >> 1; - b1 = e1 - b1; - c1 = e1 - c1; - a1 -= c1; - d1 += b1; - op[0] = (tran_low_t)a1; - op[4] = (tran_low_t)c1; - op[8] = (tran_low_t)d1; - op[12] = (tran_low_t)b1; - - ip_pass0++; - op++; - } - ip = output; - op = output; - - for (i = 0; i < 4; i++) { - a1 = ip[0]; - b1 = ip[1]; - c1 = ip[2]; - d1 = ip[3]; - - a1 += b1; - d1 -= c1; - e1 = (a1 - d1) >> 1; - b1 = e1 - b1; - c1 = e1 - c1; - a1 -= c1; - d1 += b1; - op[0] = (tran_low_t)(a1 * UNIT_QUANT_FACTOR); - op[1] = (tran_low_t)(c1 * UNIT_QUANT_FACTOR); - op[2] = (tran_low_t)(d1 * UNIT_QUANT_FACTOR); - op[3] = (tran_low_t)(b1 * UNIT_QUANT_FACTOR); - - ip += 4; - op += 4; - } -} - -// Rewrote to use same algorithm as others. -void vp9_fdct16(const tran_low_t in[16], tran_low_t out[16]) { - tran_high_t step1[8]; // canbe16 - tran_high_t step2[8]; // canbe16 - tran_high_t step3[8]; // canbe16 - tran_high_t input[8]; // canbe16 - tran_high_t temp1, temp2; // needs32 - - // step 1 - input[0] = in[0] + in[15]; - input[1] = in[1] + in[14]; - input[2] = in[2] + in[13]; - input[3] = in[3] + in[12]; - input[4] = in[4] + in[11]; - input[5] = in[5] + in[10]; - input[6] = in[6] + in[ 9]; - input[7] = in[7] + in[ 8]; - - step1[0] = in[7] - in[ 8]; - step1[1] = in[6] - in[ 9]; - step1[2] = in[5] - in[10]; - step1[3] = in[4] - in[11]; - step1[4] = in[3] - in[12]; - step1[5] = in[2] - in[13]; - step1[6] = in[1] - in[14]; - step1[7] = in[0] - in[15]; - - // fdct8(step, step); - { - tran_high_t s0, s1, s2, s3, s4, s5, s6, s7; // canbe16 - tran_high_t t0, t1, t2, t3; // needs32 - tran_high_t x0, x1, x2, x3; // canbe16 - - // stage 1 - s0 = input[0] + input[7]; - s1 = input[1] + input[6]; - s2 = input[2] + input[5]; - s3 = input[3] + input[4]; - s4 = input[3] - input[4]; - s5 = input[2] - input[5]; - s6 = input[1] - input[6]; - s7 = input[0] - input[7]; - - // fdct4(step, step); - x0 = s0 + s3; - x1 = s1 + s2; - x2 = s1 - s2; - x3 = s0 - s3; - t0 = (x0 + x1) * cospi_16_64; - t1 = (x0 - x1) * cospi_16_64; - t2 = x3 * cospi_8_64 + x2 * cospi_24_64; - t3 = x3 * cospi_24_64 - x2 * cospi_8_64; - out[0] = (tran_low_t)fdct_round_shift(t0); - out[4] = (tran_low_t)fdct_round_shift(t2); - out[8] = (tran_low_t)fdct_round_shift(t1); - out[12] = (tran_low_t)fdct_round_shift(t3); - - // Stage 2 - t0 = (s6 - s5) * cospi_16_64; - t1 = (s6 + s5) * cospi_16_64; - t2 = fdct_round_shift(t0); - t3 = fdct_round_shift(t1); - - // Stage 3 - x0 = s4 + t2; - x1 = s4 - t2; - x2 = s7 - t3; - x3 = s7 + t3; - - // Stage 4 - t0 = x0 * cospi_28_64 + x3 * cospi_4_64; - t1 = x1 * cospi_12_64 + x2 * cospi_20_64; - t2 = x2 * cospi_12_64 + x1 * -cospi_20_64; - t3 = x3 * cospi_28_64 + x0 * -cospi_4_64; - out[2] = (tran_low_t)fdct_round_shift(t0); - out[6] = (tran_low_t)fdct_round_shift(t2); - out[10] = (tran_low_t)fdct_round_shift(t1); - out[14] = (tran_low_t)fdct_round_shift(t3); - } - - // step 2 - temp1 = (step1[5] - step1[2]) * cospi_16_64; - temp2 = (step1[4] - step1[3]) * cospi_16_64; - step2[2] = fdct_round_shift(temp1); - step2[3] = fdct_round_shift(temp2); - temp1 = (step1[4] + step1[3]) * cospi_16_64; - temp2 = (step1[5] + step1[2]) * cospi_16_64; - step2[4] = fdct_round_shift(temp1); - step2[5] = fdct_round_shift(temp2); - - // step 3 - step3[0] = step1[0] + step2[3]; - step3[1] = step1[1] + step2[2]; - step3[2] = step1[1] - step2[2]; - step3[3] = step1[0] - step2[3]; - step3[4] = step1[7] - step2[4]; - step3[5] = step1[6] - step2[5]; - step3[6] = step1[6] + step2[5]; - step3[7] = step1[7] + step2[4]; - - // step 4 - temp1 = step3[1] * -cospi_8_64 + step3[6] * cospi_24_64; - temp2 = step3[2] * cospi_24_64 + step3[5] * cospi_8_64; - step2[1] = fdct_round_shift(temp1); - step2[2] = fdct_round_shift(temp2); - temp1 = step3[2] * cospi_8_64 - step3[5] * cospi_24_64; - temp2 = step3[1] * cospi_24_64 + step3[6] * cospi_8_64; - step2[5] = fdct_round_shift(temp1); - step2[6] = fdct_round_shift(temp2); - - // step 5 - step1[0] = step3[0] + step2[1]; - step1[1] = step3[0] - step2[1]; - step1[2] = step3[3] + step2[2]; - step1[3] = step3[3] - step2[2]; - step1[4] = step3[4] - step2[5]; - step1[5] = step3[4] + step2[5]; - step1[6] = step3[7] - step2[6]; - step1[7] = step3[7] + step2[6]; - - // step 6 - temp1 = step1[0] * cospi_30_64 + step1[7] * cospi_2_64; - temp2 = step1[1] * cospi_14_64 + step1[6] * cospi_18_64; - out[1] = (tran_low_t)fdct_round_shift(temp1); - out[9] = (tran_low_t)fdct_round_shift(temp2); - - temp1 = step1[2] * cospi_22_64 + step1[5] * cospi_10_64; - temp2 = step1[3] * cospi_6_64 + step1[4] * cospi_26_64; - out[5] = (tran_low_t)fdct_round_shift(temp1); - out[13] = (tran_low_t)fdct_round_shift(temp2); - - temp1 = step1[3] * -cospi_26_64 + step1[4] * cospi_6_64; - temp2 = step1[2] * -cospi_10_64 + step1[5] * cospi_22_64; - out[3] = (tran_low_t)fdct_round_shift(temp1); - out[11] = (tran_low_t)fdct_round_shift(temp2); - - temp1 = step1[1] * -cospi_18_64 + step1[6] * cospi_14_64; - temp2 = step1[0] * -cospi_2_64 + step1[7] * cospi_30_64; - out[7] = (tran_low_t)fdct_round_shift(temp1); - out[15] = (tran_low_t)fdct_round_shift(temp2); -} - -void vp9_fadst16(const tran_low_t *input, tran_low_t *output) { - tran_high_t s0, s1, s2, s3, s4, s5, s6, s7, s8; - tran_high_t s9, s10, s11, s12, s13, s14, s15; - - tran_high_t x0 = input[15]; - tran_high_t x1 = input[0]; - tran_high_t x2 = input[13]; - tran_high_t x3 = input[2]; - tran_high_t x4 = input[11]; - tran_high_t x5 = input[4]; - tran_high_t x6 = input[9]; - tran_high_t x7 = input[6]; - tran_high_t x8 = input[7]; - tran_high_t x9 = input[8]; - tran_high_t x10 = input[5]; - tran_high_t x11 = input[10]; - tran_high_t x12 = input[3]; - tran_high_t x13 = input[12]; - tran_high_t x14 = input[1]; - tran_high_t x15 = input[14]; - - // stage 1 - s0 = x0 * cospi_1_64 + x1 * cospi_31_64; - s1 = x0 * cospi_31_64 - x1 * cospi_1_64; - s2 = x2 * cospi_5_64 + x3 * cospi_27_64; - s3 = x2 * cospi_27_64 - x3 * cospi_5_64; - s4 = x4 * cospi_9_64 + x5 * cospi_23_64; - s5 = x4 * cospi_23_64 - x5 * cospi_9_64; - s6 = x6 * cospi_13_64 + x7 * cospi_19_64; - s7 = x6 * cospi_19_64 - x7 * cospi_13_64; - s8 = x8 * cospi_17_64 + x9 * cospi_15_64; - s9 = x8 * cospi_15_64 - x9 * cospi_17_64; - s10 = x10 * cospi_21_64 + x11 * cospi_11_64; - s11 = x10 * cospi_11_64 - x11 * cospi_21_64; - s12 = x12 * cospi_25_64 + x13 * cospi_7_64; - s13 = x12 * cospi_7_64 - x13 * cospi_25_64; - s14 = x14 * cospi_29_64 + x15 * cospi_3_64; - s15 = x14 * cospi_3_64 - x15 * cospi_29_64; - - x0 = fdct_round_shift(s0 + s8); - x1 = fdct_round_shift(s1 + s9); - x2 = fdct_round_shift(s2 + s10); - x3 = fdct_round_shift(s3 + s11); - x4 = fdct_round_shift(s4 + s12); - x5 = fdct_round_shift(s5 + s13); - x6 = fdct_round_shift(s6 + s14); - x7 = fdct_round_shift(s7 + s15); - x8 = fdct_round_shift(s0 - s8); - x9 = fdct_round_shift(s1 - s9); - x10 = fdct_round_shift(s2 - s10); - x11 = fdct_round_shift(s3 - s11); - x12 = fdct_round_shift(s4 - s12); - x13 = fdct_round_shift(s5 - s13); - x14 = fdct_round_shift(s6 - s14); - x15 = fdct_round_shift(s7 - s15); - - // stage 2 - s0 = x0; - s1 = x1; - s2 = x2; - s3 = x3; - s4 = x4; - s5 = x5; - s6 = x6; - s7 = x7; - s8 = x8 * cospi_4_64 + x9 * cospi_28_64; - s9 = x8 * cospi_28_64 - x9 * cospi_4_64; - s10 = x10 * cospi_20_64 + x11 * cospi_12_64; - s11 = x10 * cospi_12_64 - x11 * cospi_20_64; - s12 = - x12 * cospi_28_64 + x13 * cospi_4_64; - s13 = x12 * cospi_4_64 + x13 * cospi_28_64; - s14 = - x14 * cospi_12_64 + x15 * cospi_20_64; - s15 = x14 * cospi_20_64 + x15 * cospi_12_64; - - x0 = s0 + s4; - x1 = s1 + s5; - x2 = s2 + s6; - x3 = s3 + s7; - x4 = s0 - s4; - x5 = s1 - s5; - x6 = s2 - s6; - x7 = s3 - s7; - x8 = fdct_round_shift(s8 + s12); - x9 = fdct_round_shift(s9 + s13); - x10 = fdct_round_shift(s10 + s14); - x11 = fdct_round_shift(s11 + s15); - x12 = fdct_round_shift(s8 - s12); - x13 = fdct_round_shift(s9 - s13); - x14 = fdct_round_shift(s10 - s14); - x15 = fdct_round_shift(s11 - s15); - - // stage 3 - s0 = x0; - s1 = x1; - s2 = x2; - s3 = x3; - s4 = x4 * cospi_8_64 + x5 * cospi_24_64; - s5 = x4 * cospi_24_64 - x5 * cospi_8_64; - s6 = - x6 * cospi_24_64 + x7 * cospi_8_64; - s7 = x6 * cospi_8_64 + x7 * cospi_24_64; - s8 = x8; - s9 = x9; - s10 = x10; - s11 = x11; - s12 = x12 * cospi_8_64 + x13 * cospi_24_64; - s13 = x12 * cospi_24_64 - x13 * cospi_8_64; - s14 = - x14 * cospi_24_64 + x15 * cospi_8_64; - s15 = x14 * cospi_8_64 + x15 * cospi_24_64; - - x0 = s0 + s2; - x1 = s1 + s3; - x2 = s0 - s2; - x3 = s1 - s3; - x4 = fdct_round_shift(s4 + s6); - x5 = fdct_round_shift(s5 + s7); - x6 = fdct_round_shift(s4 - s6); - x7 = fdct_round_shift(s5 - s7); - x8 = s8 + s10; - x9 = s9 + s11; - x10 = s8 - s10; - x11 = s9 - s11; - x12 = fdct_round_shift(s12 + s14); - x13 = fdct_round_shift(s13 + s15); - x14 = fdct_round_shift(s12 - s14); - x15 = fdct_round_shift(s13 - s15); - - // stage 4 - s2 = (- cospi_16_64) * (x2 + x3); - s3 = cospi_16_64 * (x2 - x3); - s6 = cospi_16_64 * (x6 + x7); - s7 = cospi_16_64 * (- x6 + x7); - s10 = cospi_16_64 * (x10 + x11); - s11 = cospi_16_64 * (- x10 + x11); - s14 = (- cospi_16_64) * (x14 + x15); - s15 = cospi_16_64 * (x14 - x15); - - x2 = fdct_round_shift(s2); - x3 = fdct_round_shift(s3); - x6 = fdct_round_shift(s6); - x7 = fdct_round_shift(s7); - x10 = fdct_round_shift(s10); - x11 = fdct_round_shift(s11); - x14 = fdct_round_shift(s14); - x15 = fdct_round_shift(s15); - - output[0] = (tran_low_t)x0; - output[1] = (tran_low_t)-x8; - output[2] = (tran_low_t)x12; - output[3] = (tran_low_t)-x4; - output[4] = (tran_low_t)x6; - output[5] = (tran_low_t)x14; - output[6] = (tran_low_t)x10; - output[7] = (tran_low_t)x2; - output[8] = (tran_low_t)x3; - output[9] = (tran_low_t)x11; - output[10] = (tran_low_t)x15; - output[11] = (tran_low_t)x7; - output[12] = (tran_low_t)x5; - output[13] = (tran_low_t)-x13; - output[14] = (tran_low_t)x9; - output[15] = (tran_low_t)-x1; -} - -void vp9_fht16x16_c(const int16_t *input, tran_low_t *output, - int stride, int tx_type) { - if (tx_type == DCT_DCT) { - vp9_fdct16x16_c(input, output, stride); - } else { - tran_low_t out[256]; - int i, j; - tran_low_t temp_in[16], temp_out[16]; - const transform_2d ht = FHT_16[tx_type]; - - // Columns - for (i = 0; i < 16; ++i) { - for (j = 0; j < 16; ++j) - temp_in[j] = input[j * stride + i] * 4; - ht.cols(temp_in, temp_out); - for (j = 0; j < 16; ++j) - out[j * 16 + i] = (temp_out[j] + 1 + (temp_out[j] < 0)) >> 2; - } - - // Rows - for (i = 0; i < 16; ++i) { - for (j = 0; j < 16; ++j) - temp_in[j] = out[j + i * 16]; - ht.rows(temp_in, temp_out); - for (j = 0; j < 16; ++j) - output[j + i * 16] = temp_out[j]; - } - } -} - -static INLINE tran_high_t dct_32_round(tran_high_t input) { - tran_high_t rv = ROUND_POWER_OF_TWO(input, DCT_CONST_BITS); - // TODO(debargha, peter.derivaz): Find new bounds for this assert, - // and make the bounds consts. - // assert(-131072 <= rv && rv <= 131071); - return rv; -} - -static INLINE tran_high_t half_round_shift(tran_high_t input) { - tran_high_t rv = (input + 1 + (input < 0)) >> 2; - return rv; -} - -void vp9_fdct32(const tran_high_t *input, tran_high_t *output, int round) { - tran_high_t step[32]; - // Stage 1 - step[0] = input[0] + input[(32 - 1)]; - step[1] = input[1] + input[(32 - 2)]; - step[2] = input[2] + input[(32 - 3)]; - step[3] = input[3] + input[(32 - 4)]; - step[4] = input[4] + input[(32 - 5)]; - step[5] = input[5] + input[(32 - 6)]; - step[6] = input[6] + input[(32 - 7)]; - step[7] = input[7] + input[(32 - 8)]; - step[8] = input[8] + input[(32 - 9)]; - step[9] = input[9] + input[(32 - 10)]; - step[10] = input[10] + input[(32 - 11)]; - step[11] = input[11] + input[(32 - 12)]; - step[12] = input[12] + input[(32 - 13)]; - step[13] = input[13] + input[(32 - 14)]; - step[14] = input[14] + input[(32 - 15)]; - step[15] = input[15] + input[(32 - 16)]; - step[16] = -input[16] + input[(32 - 17)]; - step[17] = -input[17] + input[(32 - 18)]; - step[18] = -input[18] + input[(32 - 19)]; - step[19] = -input[19] + input[(32 - 20)]; - step[20] = -input[20] + input[(32 - 21)]; - step[21] = -input[21] + input[(32 - 22)]; - step[22] = -input[22] + input[(32 - 23)]; - step[23] = -input[23] + input[(32 - 24)]; - step[24] = -input[24] + input[(32 - 25)]; - step[25] = -input[25] + input[(32 - 26)]; - step[26] = -input[26] + input[(32 - 27)]; - step[27] = -input[27] + input[(32 - 28)]; - step[28] = -input[28] + input[(32 - 29)]; - step[29] = -input[29] + input[(32 - 30)]; - step[30] = -input[30] + input[(32 - 31)]; - step[31] = -input[31] + input[(32 - 32)]; - - // Stage 2 - output[0] = step[0] + step[16 - 1]; - output[1] = step[1] + step[16 - 2]; - output[2] = step[2] + step[16 - 3]; - output[3] = step[3] + step[16 - 4]; - output[4] = step[4] + step[16 - 5]; - output[5] = step[5] + step[16 - 6]; - output[6] = step[6] + step[16 - 7]; - output[7] = step[7] + step[16 - 8]; - output[8] = -step[8] + step[16 - 9]; - output[9] = -step[9] + step[16 - 10]; - output[10] = -step[10] + step[16 - 11]; - output[11] = -step[11] + step[16 - 12]; - output[12] = -step[12] + step[16 - 13]; - output[13] = -step[13] + step[16 - 14]; - output[14] = -step[14] + step[16 - 15]; - output[15] = -step[15] + step[16 - 16]; - - output[16] = step[16]; - output[17] = step[17]; - output[18] = step[18]; - output[19] = step[19]; - - output[20] = dct_32_round((-step[20] + step[27]) * cospi_16_64); - output[21] = dct_32_round((-step[21] + step[26]) * cospi_16_64); - output[22] = dct_32_round((-step[22] + step[25]) * cospi_16_64); - output[23] = dct_32_round((-step[23] + step[24]) * cospi_16_64); - - output[24] = dct_32_round((step[24] + step[23]) * cospi_16_64); - output[25] = dct_32_round((step[25] + step[22]) * cospi_16_64); - output[26] = dct_32_round((step[26] + step[21]) * cospi_16_64); - output[27] = dct_32_round((step[27] + step[20]) * cospi_16_64); - - output[28] = step[28]; - output[29] = step[29]; - output[30] = step[30]; - output[31] = step[31]; - - // dump the magnitude by 4, hence the intermediate values are within - // the range of 16 bits. - if (round) { - output[0] = half_round_shift(output[0]); - output[1] = half_round_shift(output[1]); - output[2] = half_round_shift(output[2]); - output[3] = half_round_shift(output[3]); - output[4] = half_round_shift(output[4]); - output[5] = half_round_shift(output[5]); - output[6] = half_round_shift(output[6]); - output[7] = half_round_shift(output[7]); - output[8] = half_round_shift(output[8]); - output[9] = half_round_shift(output[9]); - output[10] = half_round_shift(output[10]); - output[11] = half_round_shift(output[11]); - output[12] = half_round_shift(output[12]); - output[13] = half_round_shift(output[13]); - output[14] = half_round_shift(output[14]); - output[15] = half_round_shift(output[15]); - - output[16] = half_round_shift(output[16]); - output[17] = half_round_shift(output[17]); - output[18] = half_round_shift(output[18]); - output[19] = half_round_shift(output[19]); - output[20] = half_round_shift(output[20]); - output[21] = half_round_shift(output[21]); - output[22] = half_round_shift(output[22]); - output[23] = half_round_shift(output[23]); - output[24] = half_round_shift(output[24]); - output[25] = half_round_shift(output[25]); - output[26] = half_round_shift(output[26]); - output[27] = half_round_shift(output[27]); - output[28] = half_round_shift(output[28]); - output[29] = half_round_shift(output[29]); - output[30] = half_round_shift(output[30]); - output[31] = half_round_shift(output[31]); - } - - // Stage 3 - step[0] = output[0] + output[(8 - 1)]; - step[1] = output[1] + output[(8 - 2)]; - step[2] = output[2] + output[(8 - 3)]; - step[3] = output[3] + output[(8 - 4)]; - step[4] = -output[4] + output[(8 - 5)]; - step[5] = -output[5] + output[(8 - 6)]; - step[6] = -output[6] + output[(8 - 7)]; - step[7] = -output[7] + output[(8 - 8)]; - step[8] = output[8]; - step[9] = output[9]; - step[10] = dct_32_round((-output[10] + output[13]) * cospi_16_64); - step[11] = dct_32_round((-output[11] + output[12]) * cospi_16_64); - step[12] = dct_32_round((output[12] + output[11]) * cospi_16_64); - step[13] = dct_32_round((output[13] + output[10]) * cospi_16_64); - step[14] = output[14]; - step[15] = output[15]; - - step[16] = output[16] + output[23]; - step[17] = output[17] + output[22]; - step[18] = output[18] + output[21]; - step[19] = output[19] + output[20]; - step[20] = -output[20] + output[19]; - step[21] = -output[21] + output[18]; - step[22] = -output[22] + output[17]; - step[23] = -output[23] + output[16]; - step[24] = -output[24] + output[31]; - step[25] = -output[25] + output[30]; - step[26] = -output[26] + output[29]; - step[27] = -output[27] + output[28]; - step[28] = output[28] + output[27]; - step[29] = output[29] + output[26]; - step[30] = output[30] + output[25]; - step[31] = output[31] + output[24]; - - // Stage 4 - output[0] = step[0] + step[3]; - output[1] = step[1] + step[2]; - output[2] = -step[2] + step[1]; - output[3] = -step[3] + step[0]; - output[4] = step[4]; - output[5] = dct_32_round((-step[5] + step[6]) * cospi_16_64); - output[6] = dct_32_round((step[6] + step[5]) * cospi_16_64); - output[7] = step[7]; - output[8] = step[8] + step[11]; - output[9] = step[9] + step[10]; - output[10] = -step[10] + step[9]; - output[11] = -step[11] + step[8]; - output[12] = -step[12] + step[15]; - output[13] = -step[13] + step[14]; - output[14] = step[14] + step[13]; - output[15] = step[15] + step[12]; - - output[16] = step[16]; - output[17] = step[17]; - output[18] = dct_32_round(step[18] * -cospi_8_64 + step[29] * cospi_24_64); - output[19] = dct_32_round(step[19] * -cospi_8_64 + step[28] * cospi_24_64); - output[20] = dct_32_round(step[20] * -cospi_24_64 + step[27] * -cospi_8_64); - output[21] = dct_32_round(step[21] * -cospi_24_64 + step[26] * -cospi_8_64); - output[22] = step[22]; - output[23] = step[23]; - output[24] = step[24]; - output[25] = step[25]; - output[26] = dct_32_round(step[26] * cospi_24_64 + step[21] * -cospi_8_64); - output[27] = dct_32_round(step[27] * cospi_24_64 + step[20] * -cospi_8_64); - output[28] = dct_32_round(step[28] * cospi_8_64 + step[19] * cospi_24_64); - output[29] = dct_32_round(step[29] * cospi_8_64 + step[18] * cospi_24_64); - output[30] = step[30]; - output[31] = step[31]; - - // Stage 5 - step[0] = dct_32_round((output[0] + output[1]) * cospi_16_64); - step[1] = dct_32_round((-output[1] + output[0]) * cospi_16_64); - step[2] = dct_32_round(output[2] * cospi_24_64 + output[3] * cospi_8_64); - step[3] = dct_32_round(output[3] * cospi_24_64 - output[2] * cospi_8_64); - step[4] = output[4] + output[5]; - step[5] = -output[5] + output[4]; - step[6] = -output[6] + output[7]; - step[7] = output[7] + output[6]; - step[8] = output[8]; - step[9] = dct_32_round(output[9] * -cospi_8_64 + output[14] * cospi_24_64); - step[10] = dct_32_round(output[10] * -cospi_24_64 + output[13] * -cospi_8_64); - step[11] = output[11]; - step[12] = output[12]; - step[13] = dct_32_round(output[13] * cospi_24_64 + output[10] * -cospi_8_64); - step[14] = dct_32_round(output[14] * cospi_8_64 + output[9] * cospi_24_64); - step[15] = output[15]; - - step[16] = output[16] + output[19]; - step[17] = output[17] + output[18]; - step[18] = -output[18] + output[17]; - step[19] = -output[19] + output[16]; - step[20] = -output[20] + output[23]; - step[21] = -output[21] + output[22]; - step[22] = output[22] + output[21]; - step[23] = output[23] + output[20]; - step[24] = output[24] + output[27]; - step[25] = output[25] + output[26]; - step[26] = -output[26] + output[25]; - step[27] = -output[27] + output[24]; - step[28] = -output[28] + output[31]; - step[29] = -output[29] + output[30]; - step[30] = output[30] + output[29]; - step[31] = output[31] + output[28]; - - // Stage 6 - output[0] = step[0]; - output[1] = step[1]; - output[2] = step[2]; - output[3] = step[3]; - output[4] = dct_32_round(step[4] * cospi_28_64 + step[7] * cospi_4_64); - output[5] = dct_32_round(step[5] * cospi_12_64 + step[6] * cospi_20_64); - output[6] = dct_32_round(step[6] * cospi_12_64 + step[5] * -cospi_20_64); - output[7] = dct_32_round(step[7] * cospi_28_64 + step[4] * -cospi_4_64); - output[8] = step[8] + step[9]; - output[9] = -step[9] + step[8]; - output[10] = -step[10] + step[11]; - output[11] = step[11] + step[10]; - output[12] = step[12] + step[13]; - output[13] = -step[13] + step[12]; - output[14] = -step[14] + step[15]; - output[15] = step[15] + step[14]; - - output[16] = step[16]; - output[17] = dct_32_round(step[17] * -cospi_4_64 + step[30] * cospi_28_64); - output[18] = dct_32_round(step[18] * -cospi_28_64 + step[29] * -cospi_4_64); - output[19] = step[19]; - output[20] = step[20]; - output[21] = dct_32_round(step[21] * -cospi_20_64 + step[26] * cospi_12_64); - output[22] = dct_32_round(step[22] * -cospi_12_64 + step[25] * -cospi_20_64); - output[23] = step[23]; - output[24] = step[24]; - output[25] = dct_32_round(step[25] * cospi_12_64 + step[22] * -cospi_20_64); - output[26] = dct_32_round(step[26] * cospi_20_64 + step[21] * cospi_12_64); - output[27] = step[27]; - output[28] = step[28]; - output[29] = dct_32_round(step[29] * cospi_28_64 + step[18] * -cospi_4_64); - output[30] = dct_32_round(step[30] * cospi_4_64 + step[17] * cospi_28_64); - output[31] = step[31]; - - // Stage 7 - step[0] = output[0]; - step[1] = output[1]; - step[2] = output[2]; - step[3] = output[3]; - step[4] = output[4]; - step[5] = output[5]; - step[6] = output[6]; - step[7] = output[7]; - step[8] = dct_32_round(output[8] * cospi_30_64 + output[15] * cospi_2_64); - step[9] = dct_32_round(output[9] * cospi_14_64 + output[14] * cospi_18_64); - step[10] = dct_32_round(output[10] * cospi_22_64 + output[13] * cospi_10_64); - step[11] = dct_32_round(output[11] * cospi_6_64 + output[12] * cospi_26_64); - step[12] = dct_32_round(output[12] * cospi_6_64 + output[11] * -cospi_26_64); - step[13] = dct_32_round(output[13] * cospi_22_64 + output[10] * -cospi_10_64); - step[14] = dct_32_round(output[14] * cospi_14_64 + output[9] * -cospi_18_64); - step[15] = dct_32_round(output[15] * cospi_30_64 + output[8] * -cospi_2_64); - - step[16] = output[16] + output[17]; - step[17] = -output[17] + output[16]; - step[18] = -output[18] + output[19]; - step[19] = output[19] + output[18]; - step[20] = output[20] + output[21]; - step[21] = -output[21] + output[20]; - step[22] = -output[22] + output[23]; - step[23] = output[23] + output[22]; - step[24] = output[24] + output[25]; - step[25] = -output[25] + output[24]; - step[26] = -output[26] + output[27]; - step[27] = output[27] + output[26]; - step[28] = output[28] + output[29]; - step[29] = -output[29] + output[28]; - step[30] = -output[30] + output[31]; - step[31] = output[31] + output[30]; - - // Final stage --- outputs indices are bit-reversed. - output[0] = step[0]; - output[16] = step[1]; - output[8] = step[2]; - output[24] = step[3]; - output[4] = step[4]; - output[20] = step[5]; - output[12] = step[6]; - output[28] = step[7]; - output[2] = step[8]; - output[18] = step[9]; - output[10] = step[10]; - output[26] = step[11]; - output[6] = step[12]; - output[22] = step[13]; - output[14] = step[14]; - output[30] = step[15]; - - output[1] = dct_32_round(step[16] * cospi_31_64 + step[31] * cospi_1_64); - output[17] = dct_32_round(step[17] * cospi_15_64 + step[30] * cospi_17_64); - output[9] = dct_32_round(step[18] * cospi_23_64 + step[29] * cospi_9_64); - output[25] = dct_32_round(step[19] * cospi_7_64 + step[28] * cospi_25_64); - output[5] = dct_32_round(step[20] * cospi_27_64 + step[27] * cospi_5_64); - output[21] = dct_32_round(step[21] * cospi_11_64 + step[26] * cospi_21_64); - output[13] = dct_32_round(step[22] * cospi_19_64 + step[25] * cospi_13_64); - output[29] = dct_32_round(step[23] * cospi_3_64 + step[24] * cospi_29_64); - output[3] = dct_32_round(step[24] * cospi_3_64 + step[23] * -cospi_29_64); - output[19] = dct_32_round(step[25] * cospi_19_64 + step[22] * -cospi_13_64); - output[11] = dct_32_round(step[26] * cospi_11_64 + step[21] * -cospi_21_64); - output[27] = dct_32_round(step[27] * cospi_27_64 + step[20] * -cospi_5_64); - output[7] = dct_32_round(step[28] * cospi_7_64 + step[19] * -cospi_25_64); - output[23] = dct_32_round(step[29] * cospi_23_64 + step[18] * -cospi_9_64); - output[15] = dct_32_round(step[30] * cospi_15_64 + step[17] * -cospi_17_64); - output[31] = dct_32_round(step[31] * cospi_31_64 + step[16] * -cospi_1_64); -} - -void vp9_fdct32x32_1_c(const int16_t *input, tran_low_t *output, int stride) { - int r, c; - tran_low_t sum = 0; - for (r = 0; r < 32; ++r) - for (c = 0; c < 32; ++c) - sum += input[r * stride + c]; - - output[0] = sum >> 3; - output[1] = 0; -} - -void vp9_fdct32x32_c(const int16_t *input, tran_low_t *out, int stride) { - int i, j; - tran_high_t output[32 * 32]; - - // Columns - for (i = 0; i < 32; ++i) { - tran_high_t temp_in[32], temp_out[32]; - for (j = 0; j < 32; ++j) - temp_in[j] = input[j * stride + i] * 4; - vp9_fdct32(temp_in, temp_out, 0); - for (j = 0; j < 32; ++j) - output[j * 32 + i] = (temp_out[j] + 1 + (temp_out[j] > 0)) >> 2; - } - - // Rows - for (i = 0; i < 32; ++i) { - tran_high_t temp_in[32], temp_out[32]; - for (j = 0; j < 32; ++j) - temp_in[j] = output[j + i * 32]; - vp9_fdct32(temp_in, temp_out, 0); - for (j = 0; j < 32; ++j) - out[j + i * 32] = - (tran_low_t)((temp_out[j] + 1 + (temp_out[j] < 0)) >> 2); - } -} - -// Note that although we use dct_32_round in dct32 computation flow, -// this 2d fdct32x32 for rate-distortion optimization loop is operating -// within 16 bits precision. -void vp9_fdct32x32_rd_c(const int16_t *input, tran_low_t *out, int stride) { - int i, j; - tran_high_t output[32 * 32]; - - // Columns - for (i = 0; i < 32; ++i) { - tran_high_t temp_in[32], temp_out[32]; - for (j = 0; j < 32; ++j) - temp_in[j] = input[j * stride + i] * 4; - vp9_fdct32(temp_in, temp_out, 0); - for (j = 0; j < 32; ++j) - // TODO(cd): see quality impact of only doing - // output[j * 32 + i] = (temp_out[j] + 1) >> 2; - // PS: also change code in vp9/encoder/x86/vp9_dct_sse2.c - output[j * 32 + i] = (temp_out[j] + 1 + (temp_out[j] > 0)) >> 2; - } - - // Rows - for (i = 0; i < 32; ++i) { - tran_high_t temp_in[32], temp_out[32]; - for (j = 0; j < 32; ++j) - temp_in[j] = output[j + i * 32]; - vp9_fdct32(temp_in, temp_out, 1); - for (j = 0; j < 32; ++j) - out[j + i * 32] = (tran_low_t)temp_out[j]; - } -} - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_highbd_fdct4x4_c(const int16_t *input, tran_low_t *output, - int stride) { - vp9_fdct4x4_c(input, output, stride); -} - -void vp9_highbd_fht4x4_c(const int16_t *input, tran_low_t *output, - int stride, int tx_type) { - vp9_fht4x4_c(input, output, stride, tx_type); -} - -void vp9_highbd_fdct8x8_1_c(const int16_t *input, tran_low_t *final_output, - int stride) { - vp9_fdct8x8_1_c(input, final_output, stride); -} - -void vp9_highbd_fdct8x8_c(const int16_t *input, tran_low_t *final_output, - int stride) { - vp9_fdct8x8_c(input, final_output, stride); -} - -void vp9_highbd_fdct16x16_1_c(const int16_t *input, tran_low_t *output, - int stride) { - vp9_fdct16x16_1_c(input, output, stride); -} - -void vp9_highbd_fdct16x16_c(const int16_t *input, tran_low_t *output, - int stride) { - vp9_fdct16x16_c(input, output, stride); -} - -void vp9_highbd_fht8x8_c(const int16_t *input, tran_low_t *output, - int stride, int tx_type) { - vp9_fht8x8_c(input, output, stride, tx_type); -} - -void vp9_highbd_fwht4x4_c(const int16_t *input, tran_low_t *output, - int stride) { - vp9_fwht4x4_c(input, output, stride); -} - -void vp9_highbd_fht16x16_c(const int16_t *input, tran_low_t *output, - int stride, int tx_type) { - vp9_fht16x16_c(input, output, stride, tx_type); -} - -void vp9_highbd_fdct32x32_1_c(const int16_t *input, tran_low_t *out, - int stride) { - vp9_fdct32x32_1_c(input, out, stride); -} - -void vp9_highbd_fdct32x32_c(const int16_t *input, tran_low_t *out, int stride) { - vp9_fdct32x32_c(input, out, stride); -} - -void vp9_highbd_fdct32x32_rd_c(const int16_t *input, tran_low_t *out, - int stride) { - vp9_fdct32x32_rd_c(input, out, stride); -} -#endif // CONFIG_VP9_HIGHBITDEPTH diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_dct.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_dct.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_dct.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_dct.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_DCT_H_ -#define VP9_ENCODER_VP9_DCT_H_ - -#include "vp9/common/vp9_idct.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void vp9_highbd_fdct4x4_c(const int16_t *input, tran_low_t *output, int stride); -void vp9_highbd_fdct8x8_c(const int16_t *input, tran_low_t *output, int stride); -void vp9_highbd_fdct16x16_c(const int16_t *input, tran_low_t *output, - int stride); -void vp9_highbd_fdct32x32_c(const int16_t *input, tran_low_t *out, int stride); -void vp9_highbd_fdct32x32_rd_c(const int16_t *input, tran_low_t *out, - int stride); - -void vp9_fdct4(const tran_low_t *input, tran_low_t *output); -void vp9_fadst4(const tran_low_t *input, tran_low_t *output); -void vp9_fdct8(const tran_low_t *input, tran_low_t *output); -void vp9_fadst8(const tran_low_t *input, tran_low_t *output); -void vp9_fdct16(const tran_low_t in[16], tran_low_t out[16]); -void vp9_fadst16(const tran_low_t *input, tran_low_t *output); -void vp9_fdct32(const tran_high_t *input, tran_high_t *output, int round); - -static const transform_2d FHT_4[] = { - { vp9_fdct4, vp9_fdct4 }, // DCT_DCT = 0 - { vp9_fadst4, vp9_fdct4 }, // ADST_DCT = 1 - { vp9_fdct4, vp9_fadst4 }, // DCT_ADST = 2 - { vp9_fadst4, vp9_fadst4 } // ADST_ADST = 3 -}; - -static const transform_2d FHT_8[] = { - { vp9_fdct8, vp9_fdct8 }, // DCT_DCT = 0 - { vp9_fadst8, vp9_fdct8 }, // ADST_DCT = 1 - { vp9_fdct8, vp9_fadst8 }, // DCT_ADST = 2 - { vp9_fadst8, vp9_fadst8 } // ADST_ADST = 3 -}; - -static const transform_2d FHT_16[] = { - { vp9_fdct16, vp9_fdct16 }, // DCT_DCT = 0 - { vp9_fadst16, vp9_fdct16 }, // ADST_DCT = 1 - { vp9_fdct16, vp9_fadst16 }, // DCT_ADST = 2 - { vp9_fadst16, vp9_fadst16 } // ADST_ADST = 3 -}; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_DCT_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_denoiser.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_denoiser.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_denoiser.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_denoiser.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,498 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include "vpx_scale/yv12config.h" -#include "vpx/vpx_integer.h" -#include "vp9/common/vp9_reconinter.h" -#include "vp9/encoder/vp9_context_tree.h" -#include "vp9/encoder/vp9_denoiser.h" - -/* The VP9 denoiser is a work-in-progress. It currently is only designed to work - * with speed 6, though it (inexplicably) seems to also work with speed 5 (one - * would need to modify the source code in vp9_pickmode.c and vp9_encoder.c to - * make the calls to the vp9_denoiser_* functions when in speed 5). - * - * The implementation is very similar to that of the VP8 denoiser. While - * choosing the motion vectors / reference frames, the denoiser is run, and if - * it did not modify the signal to much, the denoised block is copied to the - * signal. - */ - -#ifdef OUTPUT_YUV_DENOISED -static void make_grayscale(YV12_BUFFER_CONFIG *yuv); -#endif - -static int absdiff_thresh(BLOCK_SIZE bs, int increase_denoising) { - (void)bs; - return 3 + (increase_denoising ? 1 : 0); -} - -static int delta_thresh(BLOCK_SIZE bs, int increase_denoising) { - (void)bs; - (void)increase_denoising; - return 4; -} - -static int noise_motion_thresh(BLOCK_SIZE bs, int increase_denoising) { - (void)bs; - (void)increase_denoising; - return 625; -} - -static unsigned int sse_thresh(BLOCK_SIZE bs, int increase_denoising) { - return (1 << num_pels_log2_lookup[bs]) * (increase_denoising ? 60 : 40); -} - -static int sse_diff_thresh(BLOCK_SIZE bs, int increase_denoising, - int motion_magnitude) { - if (motion_magnitude > - noise_motion_thresh(bs, increase_denoising)) { - return 0; - } else { - return (1 << num_pels_log2_lookup[bs]) * 20; - } -} - -int total_adj_strong_thresh(BLOCK_SIZE bs, int increase_denoising) { - return (1 << num_pels_log2_lookup[bs]) * (increase_denoising ? 3 : 2); -} - -static int total_adj_weak_thresh(BLOCK_SIZE bs, int increase_denoising) { - return (1 << num_pels_log2_lookup[bs]) * (increase_denoising ? 3 : 2); -} - -// TODO(jackychen): If increase_denoising is enabled in the future, -// we might need to update the code for calculating 'total_adj' in -// case the C code is not bit-exact with corresponding sse2 code. -int vp9_denoiser_filter_c(const uint8_t *sig, int sig_stride, - const uint8_t *mc_avg, - int mc_avg_stride, - uint8_t *avg, int avg_stride, - int increase_denoising, - BLOCK_SIZE bs, - int motion_magnitude) { - int r, c; - const uint8_t *sig_start = sig; - const uint8_t *mc_avg_start = mc_avg; - uint8_t *avg_start = avg; - int diff, adj, absdiff, delta; - int adj_val[] = {3, 4, 6}; - int total_adj = 0; - int shift_inc = 1; - - // If motion_magnitude is small, making the denoiser more aggressive by - // increasing the adjustment for each level. Add another increment for - // blocks that are labeled for increase denoising. - if (motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD) { - if (increase_denoising) { - shift_inc = 2; - } - adj_val[0] += shift_inc; - adj_val[1] += shift_inc; - adj_val[2] += shift_inc; - } - - // First attempt to apply a strong temporal denoising filter. - for (r = 0; r < (4 << b_height_log2_lookup[bs]); ++r) { - for (c = 0; c < (4 << b_width_log2_lookup[bs]); ++c) { - diff = mc_avg[c] - sig[c]; - absdiff = abs(diff); - - if (absdiff <= absdiff_thresh(bs, increase_denoising)) { - avg[c] = mc_avg[c]; - total_adj += diff; - } else { - switch (absdiff) { - case 4: case 5: case 6: case 7: - adj = adj_val[0]; - break; - case 8: case 9: case 10: case 11: - case 12: case 13: case 14: case 15: - adj = adj_val[1]; - break; - default: - adj = adj_val[2]; - } - if (diff > 0) { - avg[c] = MIN(UINT8_MAX, sig[c] + adj); - total_adj += adj; - } else { - avg[c] = MAX(0, sig[c] - adj); - total_adj -= adj; - } - } - } - sig += sig_stride; - avg += avg_stride; - mc_avg += mc_avg_stride; - } - - // If the strong filter did not modify the signal too much, we're all set. - if (abs(total_adj) <= total_adj_strong_thresh(bs, increase_denoising)) { - return FILTER_BLOCK; - } - - // Otherwise, we try to dampen the filter if the delta is not too high. - delta = ((abs(total_adj) - total_adj_strong_thresh(bs, increase_denoising)) - >> num_pels_log2_lookup[bs]) + 1; - - if (delta >= delta_thresh(bs, increase_denoising)) { - return COPY_BLOCK; - } - - mc_avg = mc_avg_start; - avg = avg_start; - sig = sig_start; - for (r = 0; r < (4 << b_height_log2_lookup[bs]); ++r) { - for (c = 0; c < (4 << b_width_log2_lookup[bs]); ++c) { - diff = mc_avg[c] - sig[c]; - adj = abs(diff); - if (adj > delta) { - adj = delta; - } - if (diff > 0) { - // Diff positive means we made positive adjustment above - // (in first try/attempt), so now make negative adjustment to bring - // denoised signal down. - avg[c] = MAX(0, avg[c] - adj); - total_adj -= adj; - } else { - // Diff negative means we made negative adjustment above - // (in first try/attempt), so now make positive adjustment to bring - // denoised signal up. - avg[c] = MIN(UINT8_MAX, avg[c] + adj); - total_adj += adj; - } - } - sig += sig_stride; - avg += avg_stride; - mc_avg += mc_avg_stride; - } - - // We can use the filter if it has been sufficiently dampened - if (abs(total_adj) <= total_adj_weak_thresh(bs, increase_denoising)) { - return FILTER_BLOCK; - } - return COPY_BLOCK; -} - -static uint8_t *block_start(uint8_t *framebuf, int stride, - int mi_row, int mi_col) { - return framebuf + (stride * mi_row * 8) + (mi_col * 8); -} - -static VP9_DENOISER_DECISION perform_motion_compensation(VP9_DENOISER *denoiser, - MACROBLOCK *mb, - BLOCK_SIZE bs, - int increase_denoising, - int mi_row, - int mi_col, - PICK_MODE_CONTEXT *ctx, - int *motion_magnitude - ) { - int mv_col, mv_row; - int sse_diff = ctx->zeromv_sse - ctx->newmv_sse; - MV_REFERENCE_FRAME frame; - MACROBLOCKD *filter_mbd = &mb->e_mbd; - MB_MODE_INFO *mbmi = &filter_mbd->mi[0].src_mi->mbmi; - MB_MODE_INFO saved_mbmi; - int i, j; - struct buf_2d saved_dst[MAX_MB_PLANE]; - struct buf_2d saved_pre[MAX_MB_PLANE][2]; // 2 pre buffers - - mv_col = ctx->best_sse_mv.as_mv.col; - mv_row = ctx->best_sse_mv.as_mv.row; - *motion_magnitude = mv_row * mv_row + mv_col * mv_col; - frame = ctx->best_reference_frame; - - saved_mbmi = *mbmi; - - // If the best reference frame uses inter-prediction and there is enough of a - // difference in sum-squared-error, use it. - if (frame != INTRA_FRAME && - sse_diff > sse_diff_thresh(bs, increase_denoising, *motion_magnitude)) { - mbmi->ref_frame[0] = ctx->best_reference_frame; - mbmi->mode = ctx->best_sse_inter_mode; - mbmi->mv[0] = ctx->best_sse_mv; - } else { - // Otherwise, use the zero reference frame. - frame = ctx->best_zeromv_reference_frame; - - mbmi->ref_frame[0] = ctx->best_zeromv_reference_frame; - mbmi->mode = ZEROMV; - mbmi->mv[0].as_int = 0; - - ctx->best_sse_inter_mode = ZEROMV; - ctx->best_sse_mv.as_int = 0; - ctx->newmv_sse = ctx->zeromv_sse; - } - - if (ctx->newmv_sse > sse_thresh(bs, increase_denoising)) { - // Restore everything to its original state - *mbmi = saved_mbmi; - return COPY_BLOCK; - } - if (*motion_magnitude > - (noise_motion_thresh(bs, increase_denoising) << 3)) { - // Restore everything to its original state - *mbmi = saved_mbmi; - return COPY_BLOCK; - } - - // We will restore these after motion compensation. - for (i = 0; i < MAX_MB_PLANE; ++i) { - for (j = 0; j < 2; ++j) { - saved_pre[i][j] = filter_mbd->plane[i].pre[j]; - } - saved_dst[i] = filter_mbd->plane[i].dst; - } - - // Set the pointers in the MACROBLOCKD to point to the buffers in the denoiser - // struct. - for (j = 0; j < 2; ++j) { - filter_mbd->plane[0].pre[j].buf = - block_start(denoiser->running_avg_y[frame].y_buffer, - denoiser->running_avg_y[frame].y_stride, - mi_row, mi_col); - filter_mbd->plane[0].pre[j].stride = - denoiser->running_avg_y[frame].y_stride; - filter_mbd->plane[1].pre[j].buf = - block_start(denoiser->running_avg_y[frame].u_buffer, - denoiser->running_avg_y[frame].uv_stride, - mi_row, mi_col); - filter_mbd->plane[1].pre[j].stride = - denoiser->running_avg_y[frame].uv_stride; - filter_mbd->plane[2].pre[j].buf = - block_start(denoiser->running_avg_y[frame].v_buffer, - denoiser->running_avg_y[frame].uv_stride, - mi_row, mi_col); - filter_mbd->plane[2].pre[j].stride = - denoiser->running_avg_y[frame].uv_stride; - } - filter_mbd->plane[0].dst.buf = - block_start(denoiser->mc_running_avg_y.y_buffer, - denoiser->mc_running_avg_y.y_stride, - mi_row, mi_col); - filter_mbd->plane[0].dst.stride = denoiser->mc_running_avg_y.y_stride; - filter_mbd->plane[1].dst.buf = - block_start(denoiser->mc_running_avg_y.u_buffer, - denoiser->mc_running_avg_y.uv_stride, - mi_row, mi_col); - filter_mbd->plane[1].dst.stride = denoiser->mc_running_avg_y.uv_stride; - filter_mbd->plane[2].dst.buf = - block_start(denoiser->mc_running_avg_y.v_buffer, - denoiser->mc_running_avg_y.uv_stride, - mi_row, mi_col); - filter_mbd->plane[2].dst.stride = denoiser->mc_running_avg_y.uv_stride; - - vp9_build_inter_predictors_sby(filter_mbd, mv_row, mv_col, bs); - - // Restore everything to its original state - *mbmi = saved_mbmi; - for (i = 0; i < MAX_MB_PLANE; ++i) { - for (j = 0; j < 2; ++j) { - filter_mbd->plane[i].pre[j] = saved_pre[i][j]; - } - filter_mbd->plane[i].dst = saved_dst[i]; - } - - mv_row = ctx->best_sse_mv.as_mv.row; - mv_col = ctx->best_sse_mv.as_mv.col; - - return FILTER_BLOCK; -} - -void vp9_denoiser_denoise(VP9_DENOISER *denoiser, MACROBLOCK *mb, - int mi_row, int mi_col, BLOCK_SIZE bs, - PICK_MODE_CONTEXT *ctx) { - int motion_magnitude = 0; - VP9_DENOISER_DECISION decision = FILTER_BLOCK; - YV12_BUFFER_CONFIG avg = denoiser->running_avg_y[INTRA_FRAME]; - YV12_BUFFER_CONFIG mc_avg = denoiser->mc_running_avg_y; - uint8_t *avg_start = block_start(avg.y_buffer, avg.y_stride, mi_row, mi_col); - uint8_t *mc_avg_start = block_start(mc_avg.y_buffer, mc_avg.y_stride, - mi_row, mi_col); - struct buf_2d src = mb->plane[0].src; - - decision = perform_motion_compensation(denoiser, mb, bs, - denoiser->increase_denoising, - mi_row, mi_col, ctx, - &motion_magnitude); - - if (decision == FILTER_BLOCK) { - decision = vp9_denoiser_filter(src.buf, src.stride, - mc_avg_start, mc_avg.y_stride, - avg_start, avg.y_stride, - 0, bs, motion_magnitude); - } - - if (decision == FILTER_BLOCK) { - vp9_convolve_copy(avg_start, avg.y_stride, src.buf, src.stride, - NULL, 0, NULL, 0, - num_4x4_blocks_wide_lookup[bs] << 2, - num_4x4_blocks_high_lookup[bs] << 2); - } else { // COPY_BLOCK - vp9_convolve_copy(src.buf, src.stride, avg_start, avg.y_stride, - NULL, 0, NULL, 0, - num_4x4_blocks_wide_lookup[bs] << 2, - num_4x4_blocks_high_lookup[bs] << 2); - } -} - -static void copy_frame(YV12_BUFFER_CONFIG dest, const YV12_BUFFER_CONFIG src) { - int r; - const uint8_t *srcbuf = src.y_buffer; - uint8_t *destbuf = dest.y_buffer; - - assert(dest.y_width == src.y_width); - assert(dest.y_height == src.y_height); - - for (r = 0; r < dest.y_height; ++r) { - vpx_memcpy(destbuf, srcbuf, dest.y_width); - destbuf += dest.y_stride; - srcbuf += src.y_stride; - } -} - -static void swap_frame_buffer(YV12_BUFFER_CONFIG *dest, - YV12_BUFFER_CONFIG *src) { - uint8_t *tmp_buf = dest->y_buffer; - assert(dest->y_width == src->y_width); - assert(dest->y_height == src->y_height); - dest->y_buffer = src->y_buffer; - src->y_buffer = tmp_buf; -} - -void vp9_denoiser_update_frame_info(VP9_DENOISER *denoiser, - YV12_BUFFER_CONFIG src, - FRAME_TYPE frame_type, - int refresh_alt_ref_frame, - int refresh_golden_frame, - int refresh_last_frame) { - if (frame_type == KEY_FRAME) { - int i; - // Start at 1 so as not to overwrite the INTRA_FRAME - for (i = 1; i < MAX_REF_FRAMES; ++i) - copy_frame(denoiser->running_avg_y[i], src); - return; - } - - /* For non key frames */ - if (refresh_alt_ref_frame) { - swap_frame_buffer(&denoiser->running_avg_y[ALTREF_FRAME], - &denoiser->running_avg_y[INTRA_FRAME]); - } - if (refresh_golden_frame) { - swap_frame_buffer(&denoiser->running_avg_y[GOLDEN_FRAME], - &denoiser->running_avg_y[INTRA_FRAME]); - } - if (refresh_last_frame) { - swap_frame_buffer(&denoiser->running_avg_y[LAST_FRAME], - &denoiser->running_avg_y[INTRA_FRAME]); - } -} - -void vp9_denoiser_reset_frame_stats(PICK_MODE_CONTEXT *ctx) { - ctx->zeromv_sse = UINT_MAX; - ctx->newmv_sse = UINT_MAX; -} - -void vp9_denoiser_update_frame_stats(MB_MODE_INFO *mbmi, unsigned int sse, - PREDICTION_MODE mode, - PICK_MODE_CONTEXT *ctx) { - // TODO(tkopp): Use both MVs if possible - if (mbmi->mv[0].as_int == 0 && sse < ctx->zeromv_sse) { - ctx->zeromv_sse = sse; - ctx->best_zeromv_reference_frame = mbmi->ref_frame[0]; - } - - if (mbmi->mv[0].as_int != 0 && sse < ctx->newmv_sse) { - ctx->newmv_sse = sse; - ctx->best_sse_inter_mode = mode; - ctx->best_sse_mv = mbmi->mv[0]; - ctx->best_reference_frame = mbmi->ref_frame[0]; - } -} - -int vp9_denoiser_alloc(VP9_DENOISER *denoiser, int width, int height, - int ssx, int ssy, -#if CONFIG_VP9_HIGHBITDEPTH - int use_highbitdepth, -#endif - int border) { - int i, fail; - const int legacy_byte_alignment = 0; - assert(denoiser != NULL); - - for (i = 0; i < MAX_REF_FRAMES; ++i) { - fail = vp9_alloc_frame_buffer(&denoiser->running_avg_y[i], width, height, - ssx, ssy, -#if CONFIG_VP9_HIGHBITDEPTH - use_highbitdepth, -#endif - border, legacy_byte_alignment); - if (fail) { - vp9_denoiser_free(denoiser); - return 1; - } -#ifdef OUTPUT_YUV_DENOISED - make_grayscale(&denoiser->running_avg_y[i]); -#endif - } - - fail = vp9_alloc_frame_buffer(&denoiser->mc_running_avg_y, width, height, - ssx, ssy, -#if CONFIG_VP9_HIGHBITDEPTH - use_highbitdepth, -#endif - border, legacy_byte_alignment); - if (fail) { - vp9_denoiser_free(denoiser); - return 1; - } -#ifdef OUTPUT_YUV_DENOISED - make_grayscale(&denoiser->running_avg_y[i]); -#endif - denoiser->increase_denoising = 0; - denoiser->frame_buffer_initialized = 1; - - return 0; -} - -void vp9_denoiser_free(VP9_DENOISER *denoiser) { - int i; - denoiser->frame_buffer_initialized = 0; - if (denoiser == NULL) { - return; - } - for (i = 0; i < MAX_REF_FRAMES; ++i) { - vp9_free_frame_buffer(&denoiser->running_avg_y[i]); - } - vp9_free_frame_buffer(&denoiser->mc_running_avg_y); -} - -#ifdef OUTPUT_YUV_DENOISED -static void make_grayscale(YV12_BUFFER_CONFIG *yuv) { - int r, c; - uint8_t *u = yuv->u_buffer; - uint8_t *v = yuv->v_buffer; - - for (r = 0; r < yuv->uv_height; ++r) { - for (c = 0; c < yuv->uv_width; ++c) { - u[c] = UINT8_MAX / 2; - v[c] = UINT8_MAX / 2; - } - u += yuv->uv_stride; - v += yuv->uv_stride; - } -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_denoiser.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_denoiser.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_denoiser.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_denoiser.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_DENOISER_H_ -#define VP9_ENCODER_DENOISER_H_ - -#include "vp9/encoder/vp9_block.h" -#include "vpx_scale/yv12config.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define MOTION_MAGNITUDE_THRESHOLD (8 * 3) - -typedef enum vp9_denoiser_decision { - COPY_BLOCK, - FILTER_BLOCK -} VP9_DENOISER_DECISION; - -typedef struct vp9_denoiser { - YV12_BUFFER_CONFIG running_avg_y[MAX_REF_FRAMES]; - YV12_BUFFER_CONFIG mc_running_avg_y; - int increase_denoising; - int frame_buffer_initialized; -} VP9_DENOISER; - -void vp9_denoiser_update_frame_info(VP9_DENOISER *denoiser, - YV12_BUFFER_CONFIG src, - FRAME_TYPE frame_type, - int refresh_alt_ref_frame, - int refresh_golden_frame, - int refresh_last_frame); - -void vp9_denoiser_denoise(VP9_DENOISER *denoiser, MACROBLOCK *mb, - int mi_row, int mi_col, BLOCK_SIZE bs, - PICK_MODE_CONTEXT *ctx); - -void vp9_denoiser_reset_frame_stats(PICK_MODE_CONTEXT *ctx); - -void vp9_denoiser_update_frame_stats(MB_MODE_INFO *mbmi, - unsigned int sse, PREDICTION_MODE mode, - PICK_MODE_CONTEXT *ctx); - -int vp9_denoiser_alloc(VP9_DENOISER *denoiser, int width, int height, - int ssx, int ssy, -#if CONFIG_VP9_HIGHBITDEPTH - int use_highbitdepth, -#endif - int border); - -#if CONFIG_VP9_TEMPORAL_DENOISING -int total_adj_strong_thresh(BLOCK_SIZE bs, int increase_denoising); -#endif - -void vp9_denoiser_free(VP9_DENOISER *denoiser); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_DENOISER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_encodeframe.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_encodeframe.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_encodeframe.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_encodeframe.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,4132 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include - -#include "./vp9_rtcd.h" -#include "./vpx_config.h" - -#include "vpx_ports/vpx_timer.h" - -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_entropy.h" -#include "vp9/common/vp9_entropymode.h" -#include "vp9/common/vp9_idct.h" -#include "vp9/common/vp9_mvref_common.h" -#include "vp9/common/vp9_pred_common.h" -#include "vp9/common/vp9_quant_common.h" -#include "vp9/common/vp9_reconintra.h" -#include "vp9/common/vp9_reconinter.h" -#include "vp9/common/vp9_seg_common.h" -#include "vp9/common/vp9_systemdependent.h" -#include "vp9/common/vp9_tile_common.h" - -#include "vp9/encoder/vp9_aq_complexity.h" -#include "vp9/encoder/vp9_aq_cyclicrefresh.h" -#include "vp9/encoder/vp9_aq_variance.h" -#include "vp9/encoder/vp9_encodeframe.h" -#include "vp9/encoder/vp9_encodemb.h" -#include "vp9/encoder/vp9_encodemv.h" -#include "vp9/encoder/vp9_ethread.h" -#include "vp9/encoder/vp9_extend.h" -#include "vp9/encoder/vp9_pickmode.h" -#include "vp9/encoder/vp9_rd.h" -#include "vp9/encoder/vp9_rdopt.h" -#include "vp9/encoder/vp9_segmentation.h" -#include "vp9/encoder/vp9_tokenize.h" - -static void encode_superblock(VP9_COMP *cpi, ThreadData * td, - TOKENEXTRA **t, int output_enabled, - int mi_row, int mi_col, BLOCK_SIZE bsize, - PICK_MODE_CONTEXT *ctx); - -// This is used as a reference when computing the source variance for the -// purposes of activity masking. -// Eventually this should be replaced by custom no-reference routines, -// which will be faster. -static const uint8_t VP9_VAR_OFFS[64] = { - 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, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128 -}; - -#if CONFIG_VP9_HIGHBITDEPTH -static const uint16_t VP9_HIGH_VAR_OFFS_8[64] = { - 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, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128 -}; - -static const uint16_t VP9_HIGH_VAR_OFFS_10[64] = { - 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, - 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, - 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, - 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, - 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, - 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, - 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, - 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, 128*4, 128*4 -}; - -static const uint16_t VP9_HIGH_VAR_OFFS_12[64] = { - 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, - 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, - 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, - 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, - 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, - 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, - 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, - 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, 128*16 -}; -#endif // CONFIG_VP9_HIGHBITDEPTH - -static unsigned int get_sby_perpixel_variance(VP9_COMP *cpi, - const struct buf_2d *ref, - BLOCK_SIZE bs) { - unsigned int sse; - const unsigned int var = cpi->fn_ptr[bs].vf(ref->buf, ref->stride, - VP9_VAR_OFFS, 0, &sse); - return ROUND_POWER_OF_TWO(var, num_pels_log2_lookup[bs]); -} - -#if CONFIG_VP9_HIGHBITDEPTH -static unsigned int high_get_sby_perpixel_variance( - VP9_COMP *cpi, const struct buf_2d *ref, BLOCK_SIZE bs, int bd) { - unsigned int var, sse; - switch (bd) { - case 10: - var = cpi->fn_ptr[bs].vf(ref->buf, ref->stride, - CONVERT_TO_BYTEPTR(VP9_HIGH_VAR_OFFS_10), - 0, &sse); - break; - case 12: - var = cpi->fn_ptr[bs].vf(ref->buf, ref->stride, - CONVERT_TO_BYTEPTR(VP9_HIGH_VAR_OFFS_12), - 0, &sse); - break; - case 8: - default: - var = cpi->fn_ptr[bs].vf(ref->buf, ref->stride, - CONVERT_TO_BYTEPTR(VP9_HIGH_VAR_OFFS_8), - 0, &sse); - break; - } - return ROUND_POWER_OF_TWO(var, num_pels_log2_lookup[bs]); -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -static unsigned int get_sby_perpixel_diff_variance(VP9_COMP *cpi, - const struct buf_2d *ref, - int mi_row, int mi_col, - BLOCK_SIZE bs) { - unsigned int sse, var; - uint8_t *last_y; - const YV12_BUFFER_CONFIG *last = get_ref_frame_buffer(cpi, LAST_FRAME); - - assert(last != NULL); - last_y = - &last->y_buffer[mi_row * MI_SIZE * last->y_stride + mi_col * MI_SIZE]; - var = cpi->fn_ptr[bs].vf(ref->buf, ref->stride, last_y, last->y_stride, &sse); - return ROUND_POWER_OF_TWO(var, num_pels_log2_lookup[bs]); -} - -static BLOCK_SIZE get_rd_var_based_fixed_partition(VP9_COMP *cpi, MACROBLOCK *x, - int mi_row, - int mi_col) { - unsigned int var = get_sby_perpixel_diff_variance(cpi, &x->plane[0].src, - mi_row, mi_col, - BLOCK_64X64); - if (var < 8) - return BLOCK_64X64; - else if (var < 128) - return BLOCK_32X32; - else if (var < 2048) - return BLOCK_16X16; - else - return BLOCK_8X8; -} - -static BLOCK_SIZE get_nonrd_var_based_fixed_partition(VP9_COMP *cpi, - MACROBLOCK *x, - int mi_row, - int mi_col) { - unsigned int var = get_sby_perpixel_diff_variance(cpi, &x->plane[0].src, - mi_row, mi_col, - BLOCK_64X64); - if (var < 4) - return BLOCK_64X64; - else if (var < 10) - return BLOCK_32X32; - else - return BLOCK_16X16; -} - -// Lighter version of set_offsets that only sets the mode info -// pointers. -static INLINE void set_mode_info_offsets(VP9_COMMON *const cm, - MACROBLOCKD *const xd, - int mi_row, - int mi_col) { - const int idx_str = xd->mi_stride * mi_row + mi_col; - xd->mi = cm->mi + idx_str; - xd->mi[0].src_mi = &xd->mi[0]; -} - -static void set_offsets(VP9_COMP *cpi, const TileInfo *const tile, - MACROBLOCK *const x, int mi_row, int mi_col, - BLOCK_SIZE bsize) { - VP9_COMMON *const cm = &cpi->common; - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *mbmi; - const int mi_width = num_8x8_blocks_wide_lookup[bsize]; - const int mi_height = num_8x8_blocks_high_lookup[bsize]; - const struct segmentation *const seg = &cm->seg; - - set_skip_context(xd, mi_row, mi_col); - - set_mode_info_offsets(cm, xd, mi_row, mi_col); - - mbmi = &xd->mi[0].src_mi->mbmi; - - // Set up destination pointers. - vp9_setup_dst_planes(xd->plane, get_frame_new_buffer(cm), mi_row, mi_col); - - // Set up limit values for MV components. - // Mv beyond the range do not produce new/different prediction block. - x->mv_row_min = -(((mi_row + mi_height) * MI_SIZE) + VP9_INTERP_EXTEND); - x->mv_col_min = -(((mi_col + mi_width) * MI_SIZE) + VP9_INTERP_EXTEND); - x->mv_row_max = (cm->mi_rows - mi_row) * MI_SIZE + VP9_INTERP_EXTEND; - x->mv_col_max = (cm->mi_cols - mi_col) * MI_SIZE + VP9_INTERP_EXTEND; - - // Set up distance of MB to edge of frame in 1/8th pel units. - assert(!(mi_col & (mi_width - 1)) && !(mi_row & (mi_height - 1))); - set_mi_row_col(xd, tile, mi_row, mi_height, mi_col, mi_width, - cm->mi_rows, cm->mi_cols); - - // Set up source buffers. - vp9_setup_src_planes(x, cpi->Source, mi_row, mi_col); - - // R/D setup. - x->rddiv = cpi->rd.RDDIV; - x->rdmult = cpi->rd.RDMULT; - - // Setup segment ID. - if (seg->enabled) { - if (cpi->oxcf.aq_mode != VARIANCE_AQ) { - const uint8_t *const map = seg->update_map ? cpi->segmentation_map - : cm->last_frame_seg_map; - mbmi->segment_id = vp9_get_segment_id(cm, map, bsize, mi_row, mi_col); - } - vp9_init_plane_quantizers(cpi, x); - - x->encode_breakout = cpi->segment_encode_breakout[mbmi->segment_id]; - } else { - mbmi->segment_id = 0; - x->encode_breakout = cpi->encode_breakout; - } -} - -static void duplicate_mode_info_in_sb(VP9_COMMON *cm, MACROBLOCKD *xd, - int mi_row, int mi_col, - BLOCK_SIZE bsize) { - const int block_width = num_8x8_blocks_wide_lookup[bsize]; - const int block_height = num_8x8_blocks_high_lookup[bsize]; - int i, j; - for (j = 0; j < block_height; ++j) - for (i = 0; i < block_width; ++i) { - if (mi_row + j < cm->mi_rows && mi_col + i < cm->mi_cols) - xd->mi[j * xd->mi_stride + i].src_mi = &xd->mi[0]; - } -} - -static void set_block_size(VP9_COMP * const cpi, - MACROBLOCKD *const xd, - int mi_row, int mi_col, - BLOCK_SIZE bsize) { - if (cpi->common.mi_cols > mi_col && cpi->common.mi_rows > mi_row) { - set_mode_info_offsets(&cpi->common, xd, mi_row, mi_col); - xd->mi[0].src_mi->mbmi.sb_type = bsize; - } -} - -typedef struct { - int64_t sum_square_error; - int64_t sum_error; - int log2_count; - int variance; -} var; - -typedef struct { - var none; - var horz[2]; - var vert[2]; -} partition_variance; - -typedef struct { - partition_variance part_variances; - var split[4]; -} v4x4; - -typedef struct { - partition_variance part_variances; - v4x4 split[4]; -} v8x8; - -typedef struct { - partition_variance part_variances; - v8x8 split[4]; -} v16x16; - -typedef struct { - partition_variance part_variances; - v16x16 split[4]; -} v32x32; - -typedef struct { - partition_variance part_variances; - v32x32 split[4]; -} v64x64; - -typedef struct { - partition_variance *part_variances; - var *split[4]; -} variance_node; - -typedef enum { - V16X16, - V32X32, - V64X64, -} TREE_LEVEL; - -static void tree_to_node(void *data, BLOCK_SIZE bsize, variance_node *node) { - int i; - node->part_variances = NULL; - switch (bsize) { - case BLOCK_64X64: { - v64x64 *vt = (v64x64 *) data; - node->part_variances = &vt->part_variances; - for (i = 0; i < 4; i++) - node->split[i] = &vt->split[i].part_variances.none; - break; - } - case BLOCK_32X32: { - v32x32 *vt = (v32x32 *) data; - node->part_variances = &vt->part_variances; - for (i = 0; i < 4; i++) - node->split[i] = &vt->split[i].part_variances.none; - break; - } - case BLOCK_16X16: { - v16x16 *vt = (v16x16 *) data; - node->part_variances = &vt->part_variances; - for (i = 0; i < 4; i++) - node->split[i] = &vt->split[i].part_variances.none; - break; - } - case BLOCK_8X8: { - v8x8 *vt = (v8x8 *) data; - node->part_variances = &vt->part_variances; - for (i = 0; i < 4; i++) - node->split[i] = &vt->split[i].part_variances.none; - break; - } - case BLOCK_4X4: { - v4x4 *vt = (v4x4 *) data; - node->part_variances = &vt->part_variances; - for (i = 0; i < 4; i++) - node->split[i] = &vt->split[i]; - break; - } - default: { - assert(0); - break; - } - } -} - -// Set variance values given sum square error, sum error, count. -static void fill_variance(int64_t s2, int64_t s, int c, var *v) { - v->sum_square_error = s2; - v->sum_error = s; - v->log2_count = c; -} - -static void get_variance(var *v) { - v->variance = (int)(256 * (v->sum_square_error - - ((v->sum_error * v->sum_error) >> v->log2_count)) >> v->log2_count); -} - -void sum_2_variances(const var *a, const var *b, var *r) { - assert(a->log2_count == b->log2_count); - fill_variance(a->sum_square_error + b->sum_square_error, - a->sum_error + b->sum_error, a->log2_count + 1, r); -} - -static void fill_variance_tree(void *data, BLOCK_SIZE bsize) { - variance_node node; - tree_to_node(data, bsize, &node); - sum_2_variances(node.split[0], node.split[1], &node.part_variances->horz[0]); - sum_2_variances(node.split[2], node.split[3], &node.part_variances->horz[1]); - sum_2_variances(node.split[0], node.split[2], &node.part_variances->vert[0]); - sum_2_variances(node.split[1], node.split[3], &node.part_variances->vert[1]); - sum_2_variances(&node.part_variances->vert[0], &node.part_variances->vert[1], - &node.part_variances->none); -} - -static int set_vt_partitioning(VP9_COMP *cpi, - MACROBLOCKD *const xd, - void *data, - BLOCK_SIZE bsize, - int mi_row, - int mi_col, - int64_t threshold, - BLOCK_SIZE bsize_min, - int force_split) { - VP9_COMMON * const cm = &cpi->common; - variance_node vt; - const int block_width = num_8x8_blocks_wide_lookup[bsize]; - const int block_height = num_8x8_blocks_high_lookup[bsize]; - - assert(block_height == block_width); - tree_to_node(data, bsize, &vt); - - if (force_split) - return 0; - - // For bsize=bsize_min (16x16/8x8 for 8x8/4x4 downsampling), select if - // variance is below threshold, otherwise split will be selected. - // No check for vert/horiz split as too few samples for variance. - if (bsize == bsize_min) { - get_variance(&vt.part_variances->none); - if (mi_col + block_width / 2 < cm->mi_cols && - mi_row + block_height / 2 < cm->mi_rows && - vt.part_variances->none.variance < threshold) { - set_block_size(cpi, xd, mi_row, mi_col, bsize); - return 1; - } - return 0; - } else if (bsize > bsize_min) { - // Variance is already computed for 32x32 blocks to set the force_split. - if (bsize != BLOCK_32X32) - get_variance(&vt.part_variances->none); - // For key frame or low_res: for bsize above 32X32 or very high variance, - // take split. - if (cm->frame_type == KEY_FRAME && - (bsize > BLOCK_32X32 || - vt.part_variances->none.variance > (threshold << 4))) { - return 0; - } - // If variance is low, take the bsize (no split). - if (mi_col + block_width / 2 < cm->mi_cols && - mi_row + block_height / 2 < cm->mi_rows && - vt.part_variances->none.variance < threshold) { - set_block_size(cpi, xd, mi_row, mi_col, bsize); - return 1; - } - - // Check vertical split. - if (mi_row + block_height / 2 < cm->mi_rows) { - get_variance(&vt.part_variances->vert[0]); - get_variance(&vt.part_variances->vert[1]); - if (vt.part_variances->vert[0].variance < threshold && - vt.part_variances->vert[1].variance < threshold) { - BLOCK_SIZE subsize = get_subsize(bsize, PARTITION_VERT); - set_block_size(cpi, xd, mi_row, mi_col, subsize); - set_block_size(cpi, xd, mi_row, mi_col + block_width / 2, subsize); - return 1; - } - } - // Check horizontal split. - if (mi_col + block_width / 2 < cm->mi_cols) { - get_variance(&vt.part_variances->horz[0]); - get_variance(&vt.part_variances->horz[1]); - if (vt.part_variances->horz[0].variance < threshold && - vt.part_variances->horz[1].variance < threshold) { - BLOCK_SIZE subsize = get_subsize(bsize, PARTITION_HORZ); - set_block_size(cpi, xd, mi_row, mi_col, subsize); - set_block_size(cpi, xd, mi_row + block_height / 2, mi_col, subsize); - return 1; - } - } - - return 0; - } - return 0; -} - - -void vp9_set_vbp_thresholds(VP9_COMP *cpi, int q) { - SPEED_FEATURES *const sf = &cpi->sf; - if (sf->partition_search_type != VAR_BASED_PARTITION && - sf->partition_search_type != REFERENCE_PARTITION) { - return; - } else { - VP9_COMMON *const cm = &cpi->common; - const int is_key_frame = (cm->frame_type == KEY_FRAME); - const int threshold_multiplier = is_key_frame ? 80 : 4; - const int64_t threshold_base = (int64_t)(threshold_multiplier * - vp9_convert_qindex_to_q(q, cm->bit_depth)); - - // TODO(marpan): Allow 4x4 partitions for inter-frames. - // use_4x4_partition = (variance4x4downsample[i2 + j] == 1); - // If 4x4 partition is not used, then 8x8 partition will be selected - // if variance of 16x16 block is very high, so use larger threshold - // for 16x16 (threshold_bsize_min) in that case. - if (is_key_frame) { - cpi->vbp_threshold = threshold_base >> 2; - cpi->vbp_threshold_bsize_max = threshold_base; - cpi->vbp_threshold_bsize_min = threshold_base << 2; - cpi->vbp_threshold_16x16 = cpi->vbp_threshold; - cpi->vbp_bsize_min = BLOCK_8X8; - } else { - cpi->vbp_threshold = threshold_base; - if (cm->width <= 352 && cm->height <= 288) { - cpi->vbp_threshold_bsize_max = threshold_base >> 2; - cpi->vbp_threshold_bsize_min = threshold_base << 3; - } else { - cpi->vbp_threshold_bsize_max = threshold_base; - cpi->vbp_threshold_bsize_min = threshold_base << cpi->oxcf.speed; - } - cpi->vbp_threshold_16x16 = cpi->vbp_threshold_bsize_min; - cpi->vbp_bsize_min = BLOCK_16X16; - } - } -} - -// This function chooses partitioning based on the variance between source and -// reconstructed last, where variance is computed for down-sampled inputs. -static void choose_partitioning(VP9_COMP *cpi, - const TileInfo *const tile, - MACROBLOCK *x, - int mi_row, int mi_col) { - VP9_COMMON * const cm = &cpi->common; - MACROBLOCKD *xd = &x->e_mbd; - int i, j, k, m; - v64x64 vt; - v16x16 vt2[16]; - int force_split[5]; - uint8_t *s; - const uint8_t *d; - int sp; - int dp; - int pixels_wide = 64, pixels_high = 64; - - // Always use 4x4 partition for key frame. - const int is_key_frame = (cm->frame_type == KEY_FRAME); - const int use_4x4_partition = is_key_frame; - const int low_res = (cm->width <= 352 && cm->height <= 288); - int variance4x4downsample[16]; - - int segment_id = CR_SEGMENT_ID_BASE; - if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && cm->seg.enabled) { - const uint8_t *const map = cm->seg.update_map ? cpi->segmentation_map : - cm->last_frame_seg_map; - segment_id = vp9_get_segment_id(cm, map, BLOCK_64X64, mi_row, mi_col); - } - - set_offsets(cpi, tile, x, mi_row, mi_col, BLOCK_64X64); - - if (xd->mb_to_right_edge < 0) - pixels_wide += (xd->mb_to_right_edge >> 3); - if (xd->mb_to_bottom_edge < 0) - pixels_high += (xd->mb_to_bottom_edge >> 3); - - s = x->plane[0].src.buf; - sp = x->plane[0].src.stride; - - if (!is_key_frame) { - MB_MODE_INFO *mbmi = &xd->mi[0].src_mi->mbmi; - unsigned int uv_sad; - const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_buffer(cpi, LAST_FRAME); - - const YV12_BUFFER_CONFIG *yv12_g = get_ref_frame_buffer(cpi, GOLDEN_FRAME); - unsigned int y_sad, y_sad_g; - BLOCK_SIZE bsize; - if (mi_row + 4 < cm->mi_rows && mi_col + 4 < cm->mi_cols) - bsize = BLOCK_64X64; - else if (mi_row + 4 < cm->mi_rows && mi_col + 4 >= cm->mi_cols) - bsize = BLOCK_32X64; - else if (mi_row + 4 >= cm->mi_rows && mi_col + 4 < cm->mi_cols) - bsize = BLOCK_64X32; - else - bsize = BLOCK_32X32; - - assert(yv12 != NULL); - - if (yv12_g && yv12_g != yv12) { - vp9_setup_pre_planes(xd, 0, yv12_g, mi_row, mi_col, - &cm->frame_refs[GOLDEN_FRAME - 1].sf); - y_sad_g = cpi->fn_ptr[bsize].sdf(x->plane[0].src.buf, - x->plane[0].src.stride, - xd->plane[0].pre[0].buf, - xd->plane[0].pre[0].stride); - } else { - y_sad_g = UINT_MAX; - } - - vp9_setup_pre_planes(xd, 0, yv12, mi_row, mi_col, - &cm->frame_refs[LAST_FRAME - 1].sf); - mbmi->ref_frame[0] = LAST_FRAME; - mbmi->ref_frame[1] = NONE; - mbmi->sb_type = BLOCK_64X64; - mbmi->mv[0].as_int = 0; - mbmi->interp_filter = BILINEAR; - - y_sad = vp9_int_pro_motion_estimation(cpi, x, bsize); - if (y_sad_g < y_sad) { - vp9_setup_pre_planes(xd, 0, yv12_g, mi_row, mi_col, - &cm->frame_refs[GOLDEN_FRAME - 1].sf); - mbmi->ref_frame[0] = GOLDEN_FRAME; - mbmi->mv[0].as_int = 0; - y_sad = y_sad_g; - } else { - x->pred_mv[LAST_FRAME] = mbmi->mv[0].as_mv; - } - - vp9_build_inter_predictors_sb(xd, mi_row, mi_col, BLOCK_64X64); - - for (i = 1; i <= 2; ++i) { - struct macroblock_plane *p = &x->plane[i]; - struct macroblockd_plane *pd = &xd->plane[i]; - const BLOCK_SIZE bs = get_plane_block_size(bsize, pd); - - if (bs == BLOCK_INVALID) - uv_sad = UINT_MAX; - else - uv_sad = cpi->fn_ptr[bs].sdf(p->src.buf, p->src.stride, - pd->dst.buf, pd->dst.stride); - - x->color_sensitivity[i - 1] = uv_sad > (y_sad >> 2); - } - - d = xd->plane[0].dst.buf; - dp = xd->plane[0].dst.stride; - } else { - d = VP9_VAR_OFFS; - dp = 0; -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - switch (xd->bd) { - case 10: - d = CONVERT_TO_BYTEPTR(VP9_HIGH_VAR_OFFS_10); - break; - case 12: - d = CONVERT_TO_BYTEPTR(VP9_HIGH_VAR_OFFS_12); - break; - case 8: - default: - d = CONVERT_TO_BYTEPTR(VP9_HIGH_VAR_OFFS_8); - break; - } - } -#endif // CONFIG_VP9_HIGHBITDEPTH - } - - // Index for force_split: 0 for 64x64, 1-4 for 32x32 blocks, - force_split[0] = 0; - // Fill in the entire tree of 8x8 (or 4x4 under some conditions) variances - // for splits. - for (i = 0; i < 4; i++) { - const int x32_idx = ((i & 1) << 5); - const int y32_idx = ((i >> 1) << 5); - const int i2 = i << 2; - force_split[i + 1] = 0; - for (j = 0; j < 4; j++) { - const int x16_idx = x32_idx + ((j & 1) << 4); - const int y16_idx = y32_idx + ((j >> 1) << 4); - v16x16 *vst = &vt.split[i].split[j]; - variance4x4downsample[i2 + j] = 0; - if (!is_key_frame) { - for (k = 0; k < 4; k++) { - int x8_idx = x16_idx + ((k & 1) << 3); - int y8_idx = y16_idx + ((k >> 1) << 3); - unsigned int sse = 0; - int sum = 0; - if (x8_idx < pixels_wide && y8_idx < pixels_high) { - int s_avg, d_avg; -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - s_avg = vp9_highbd_avg_8x8(s + y8_idx * sp + x8_idx, sp); - d_avg = vp9_highbd_avg_8x8(d + y8_idx * dp + x8_idx, dp); - } else { - s_avg = vp9_avg_8x8(s + y8_idx * sp + x8_idx, sp); - d_avg = vp9_avg_8x8(d + y8_idx * dp + x8_idx, dp); - } -#else - s_avg = vp9_avg_8x8(s + y8_idx * sp + x8_idx, sp); - d_avg = vp9_avg_8x8(d + y8_idx * dp + x8_idx, dp); -#endif - sum = s_avg - d_avg; - sse = sum * sum; - } - // If variance is based on 8x8 downsampling, we stop here and have - // one sample for 8x8 block (so use 1 for count in fill_variance), - // which of course means variance = 0 for 8x8 block. - fill_variance(sse, sum, 0, &vst->split[k].part_variances.none); - } - fill_variance_tree(&vt.split[i].split[j], BLOCK_16X16); - // For low-resolution, compute the variance based on 8x8 down-sampling, - // and if it is large (above the threshold) we go down for 4x4. - // For key frame we always go down to 4x4. - if (low_res) - get_variance(&vt.split[i].split[j].part_variances.none); - } - if (is_key_frame || (low_res && - vt.split[i].split[j].part_variances.none.variance > - (cpi->vbp_threshold << 1))) { - // Go down to 4x4 down-sampling for variance. - variance4x4downsample[i2 + j] = 1; - for (k = 0; k < 4; k++) { - int x8_idx = x16_idx + ((k & 1) << 3); - int y8_idx = y16_idx + ((k >> 1) << 3); - v8x8 *vst2 = is_key_frame ? &vst->split[k] : - &vt2[i2 + j].split[k]; - for (m = 0; m < 4; m++) { - int x4_idx = x8_idx + ((m & 1) << 2); - int y4_idx = y8_idx + ((m >> 1) << 2); - unsigned int sse = 0; - int sum = 0; - if (x4_idx < pixels_wide && y4_idx < pixels_high) { - int d_avg = 128; -#if CONFIG_VP9_HIGHBITDEPTH - int s_avg; - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - s_avg = vp9_highbd_avg_4x4(s + y4_idx * sp + x4_idx, sp); - if (cm->frame_type != KEY_FRAME) - d_avg = vp9_highbd_avg_4x4(d + y4_idx * dp + x4_idx, dp); - } else { - s_avg = vp9_avg_4x4(s + y4_idx * sp + x4_idx, sp); - if (cm->frame_type != KEY_FRAME) - d_avg = vp9_avg_4x4(d + y4_idx * dp + x4_idx, dp); - } -#else - int s_avg = vp9_avg_4x4(s + y4_idx * sp + x4_idx, sp); - if (!is_key_frame) - d_avg = vp9_avg_4x4(d + y4_idx * dp + x4_idx, dp); -#endif - sum = s_avg - d_avg; - sse = sum * sum; - } - // If variance is based on 4x4 down-sampling, we stop here and have - // one sample for 4x4 block (so use 1 for count in fill_variance), - // which of course means variance = 0 for 4x4 block. - fill_variance(sse, sum, 0, &vst2->split[m].part_variances.none); - } - } - } - } - } - - // No 64x64 blocks on segments other than base (un-boosted) segment, - // so force split. - if (cyclic_refresh_segment_id_boosted(segment_id)) - force_split[0] = 1; - - // Fill the rest of the variance tree by summing split partition values. - for (i = 0; i < 4; i++) { - const int i2 = i << 2; - for (j = 0; j < 4; j++) { - if (variance4x4downsample[i2 + j] == 1) { - v16x16 *vtemp = (!is_key_frame) ? &vt2[i2 + j] : - &vt.split[i].split[j]; - for (m = 0; m < 4; m++) - fill_variance_tree(&vtemp->split[m], BLOCK_8X8); - fill_variance_tree(vtemp, BLOCK_16X16); - } - } - fill_variance_tree(&vt.split[i], BLOCK_32X32); - // If variance of this 32x32 block is above the threshold, force the block - // to split. This also forces a split on the upper (64x64) level. - get_variance(&vt.split[i].part_variances.none); - if (vt.split[i].part_variances.none.variance > cpi->vbp_threshold) { - force_split[i + 1] = 1; - force_split[0] = 1; - } - } - if (!force_split[0]) - fill_variance_tree(&vt, BLOCK_64X64); - - // Now go through the entire structure, splitting every block size until - // we get to one that's got a variance lower than our threshold. - if ( mi_col + 8 > cm->mi_cols || mi_row + 8 > cm->mi_rows || - !set_vt_partitioning(cpi, xd, &vt, BLOCK_64X64, mi_row, mi_col, - cpi->vbp_threshold_bsize_max, BLOCK_16X16, - force_split[0])) { - for (i = 0; i < 4; ++i) { - const int x32_idx = ((i & 1) << 2); - const int y32_idx = ((i >> 1) << 2); - const int i2 = i << 2; - if (!set_vt_partitioning(cpi, xd, &vt.split[i], BLOCK_32X32, - (mi_row + y32_idx), (mi_col + x32_idx), - cpi->vbp_threshold, - BLOCK_16X16, force_split[i + 1])) { - for (j = 0; j < 4; ++j) { - const int x16_idx = ((j & 1) << 1); - const int y16_idx = ((j >> 1) << 1); - // For inter frames: if variance4x4downsample[] == 1 for this 16x16 - // block, then the variance is based on 4x4 down-sampling, so use vt2 - // in set_vt_partioning(), otherwise use vt. - v16x16 *vtemp = (!is_key_frame && - variance4x4downsample[i2 + j] == 1) ? - &vt2[i2 + j] : &vt.split[i].split[j]; - if (!set_vt_partitioning(cpi, xd, vtemp, BLOCK_16X16, - mi_row + y32_idx + y16_idx, - mi_col + x32_idx + x16_idx, - cpi->vbp_threshold_16x16, - cpi->vbp_bsize_min, 0)) { - for (k = 0; k < 4; ++k) { - const int x8_idx = (k & 1); - const int y8_idx = (k >> 1); - if (use_4x4_partition) { - if (!set_vt_partitioning(cpi, xd, &vtemp->split[k], - BLOCK_8X8, - mi_row + y32_idx + y16_idx + y8_idx, - mi_col + x32_idx + x16_idx + x8_idx, - cpi->vbp_threshold_bsize_min, - BLOCK_8X8, 0)) { - set_block_size(cpi, xd, - (mi_row + y32_idx + y16_idx + y8_idx), - (mi_col + x32_idx + x16_idx + x8_idx), - BLOCK_4X4); - } - } else { - set_block_size(cpi, xd, - (mi_row + y32_idx + y16_idx + y8_idx), - (mi_col + x32_idx + x16_idx + x8_idx), - BLOCK_8X8); - } - } - } - } - } - } - } -} - -static void update_state(VP9_COMP *cpi, ThreadData *td, - PICK_MODE_CONTEXT *ctx, - int mi_row, int mi_col, BLOCK_SIZE bsize, - int output_enabled) { - int i, x_idx, y; - VP9_COMMON *const cm = &cpi->common; - RD_COUNTS *const rdc = &td->rd_counts; - MACROBLOCK *const x = &td->mb; - MACROBLOCKD *const xd = &x->e_mbd; - struct macroblock_plane *const p = x->plane; - struct macroblockd_plane *const pd = xd->plane; - MODE_INFO *mi = &ctx->mic; - MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi; - MODE_INFO *mi_addr = &xd->mi[0]; - const struct segmentation *const seg = &cm->seg; - const int bw = num_8x8_blocks_wide_lookup[mi->mbmi.sb_type]; - const int bh = num_8x8_blocks_high_lookup[mi->mbmi.sb_type]; - const int x_mis = MIN(bw, cm->mi_cols - mi_col); - const int y_mis = MIN(bh, cm->mi_rows - mi_row); - MV_REF *const frame_mvs = - cm->cur_frame->mvs + mi_row * cm->mi_cols + mi_col; - int w, h; - - const int mis = cm->mi_stride; - const int mi_width = num_8x8_blocks_wide_lookup[bsize]; - const int mi_height = num_8x8_blocks_high_lookup[bsize]; - int max_plane; - - assert(mi->mbmi.sb_type == bsize); - - *mi_addr = *mi; - mi_addr->src_mi = mi_addr; - - // If segmentation in use - if (seg->enabled) { - // For in frame complexity AQ copy the segment id from the segment map. - if (cpi->oxcf.aq_mode == COMPLEXITY_AQ) { - const uint8_t *const map = seg->update_map ? cpi->segmentation_map - : cm->last_frame_seg_map; - mi_addr->mbmi.segment_id = - vp9_get_segment_id(cm, map, bsize, mi_row, mi_col); - } - // Else for cyclic refresh mode update the segment map, set the segment id - // and then update the quantizer. - if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) { - vp9_cyclic_refresh_update_segment(cpi, &xd->mi[0].src_mi->mbmi, mi_row, - mi_col, bsize, ctx->rate, ctx->dist, - x->skip); - } - } - - max_plane = is_inter_block(mbmi) ? MAX_MB_PLANE : 1; - for (i = 0; i < max_plane; ++i) { - p[i].coeff = ctx->coeff_pbuf[i][1]; - p[i].qcoeff = ctx->qcoeff_pbuf[i][1]; - pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][1]; - p[i].eobs = ctx->eobs_pbuf[i][1]; - } - - for (i = max_plane; i < MAX_MB_PLANE; ++i) { - p[i].coeff = ctx->coeff_pbuf[i][2]; - p[i].qcoeff = ctx->qcoeff_pbuf[i][2]; - pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][2]; - p[i].eobs = ctx->eobs_pbuf[i][2]; - } - - // Restore the coding context of the MB to that that was in place - // when the mode was picked for it - for (y = 0; y < mi_height; y++) - for (x_idx = 0; x_idx < mi_width; x_idx++) - if ((xd->mb_to_right_edge >> (3 + MI_SIZE_LOG2)) + mi_width > x_idx - && (xd->mb_to_bottom_edge >> (3 + MI_SIZE_LOG2)) + mi_height > y) { - xd->mi[x_idx + y * mis].src_mi = mi_addr; - } - - if (cpi->oxcf.aq_mode) - vp9_init_plane_quantizers(cpi, x); - - // FIXME(rbultje) I'm pretty sure this should go to the end of this block - // (i.e. after the output_enabled) - if (bsize < BLOCK_32X32) { - if (bsize < BLOCK_16X16) - ctx->tx_rd_diff[ALLOW_16X16] = ctx->tx_rd_diff[ALLOW_8X8]; - ctx->tx_rd_diff[ALLOW_32X32] = ctx->tx_rd_diff[ALLOW_16X16]; - } - - if (is_inter_block(mbmi) && mbmi->sb_type < BLOCK_8X8) { - mbmi->mv[0].as_int = mi->bmi[3].as_mv[0].as_int; - mbmi->mv[1].as_int = mi->bmi[3].as_mv[1].as_int; - } - - x->skip = ctx->skip; - vpx_memcpy(x->zcoeff_blk[mbmi->tx_size], ctx->zcoeff_blk, - sizeof(uint8_t) * ctx->num_4x4_blk); - - if (!output_enabled) - return; - - if (!vp9_segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP)) { - for (i = 0; i < TX_MODES; i++) - rdc->tx_select_diff[i] += ctx->tx_rd_diff[i]; - } - -#if CONFIG_INTERNAL_STATS - if (frame_is_intra_only(cm)) { - static const int kf_mode_index[] = { - THR_DC /*DC_PRED*/, - THR_V_PRED /*V_PRED*/, - THR_H_PRED /*H_PRED*/, - THR_D45_PRED /*D45_PRED*/, - THR_D135_PRED /*D135_PRED*/, - THR_D117_PRED /*D117_PRED*/, - THR_D153_PRED /*D153_PRED*/, - THR_D207_PRED /*D207_PRED*/, - THR_D63_PRED /*D63_PRED*/, - THR_TM /*TM_PRED*/, - }; - ++cpi->mode_chosen_counts[kf_mode_index[mbmi->mode]]; - } else { - // Note how often each mode chosen as best - ++cpi->mode_chosen_counts[ctx->best_mode_index]; - } -#endif - if (!frame_is_intra_only(cm)) { - if (is_inter_block(mbmi)) { - vp9_update_mv_count(td); - - if (cm->interp_filter == SWITCHABLE) { - const int ctx = vp9_get_pred_context_switchable_interp(xd); - ++td->counts->switchable_interp[ctx][mbmi->interp_filter]; - } - } - - rdc->comp_pred_diff[SINGLE_REFERENCE] += ctx->single_pred_diff; - rdc->comp_pred_diff[COMPOUND_REFERENCE] += ctx->comp_pred_diff; - rdc->comp_pred_diff[REFERENCE_MODE_SELECT] += ctx->hybrid_pred_diff; - - for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i) - rdc->filter_diff[i] += ctx->best_filter_diff[i]; - } - - for (h = 0; h < y_mis; ++h) { - MV_REF *const frame_mv = frame_mvs + h * cm->mi_cols; - for (w = 0; w < x_mis; ++w) { - MV_REF *const mv = frame_mv + w; - mv->ref_frame[0] = mi->src_mi->mbmi.ref_frame[0]; - mv->ref_frame[1] = mi->src_mi->mbmi.ref_frame[1]; - mv->mv[0].as_int = mi->src_mi->mbmi.mv[0].as_int; - mv->mv[1].as_int = mi->src_mi->mbmi.mv[1].as_int; - } - } -} - -void vp9_setup_src_planes(MACROBLOCK *x, const YV12_BUFFER_CONFIG *src, - int mi_row, int mi_col) { - uint8_t *const buffers[3] = {src->y_buffer, src->u_buffer, src->v_buffer }; - const int strides[3] = {src->y_stride, src->uv_stride, src->uv_stride }; - int i; - - // Set current frame pointer. - x->e_mbd.cur_buf = src; - - for (i = 0; i < MAX_MB_PLANE; i++) - setup_pred_plane(&x->plane[i].src, buffers[i], strides[i], mi_row, mi_col, - NULL, x->e_mbd.plane[i].subsampling_x, - x->e_mbd.plane[i].subsampling_y); -} - -static void set_mode_info_seg_skip(MACROBLOCK *x, TX_MODE tx_mode, - RD_COST *rd_cost, BLOCK_SIZE bsize) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi; - INTERP_FILTER filter_ref; - - if (xd->up_available) - filter_ref = xd->mi[-xd->mi_stride].src_mi->mbmi.interp_filter; - else if (xd->left_available) - filter_ref = xd->mi[-1].src_mi->mbmi.interp_filter; - else - filter_ref = EIGHTTAP; - - mbmi->sb_type = bsize; - mbmi->mode = ZEROMV; - mbmi->tx_size = MIN(max_txsize_lookup[bsize], - tx_mode_to_biggest_tx_size[tx_mode]); - mbmi->skip = 1; - mbmi->uv_mode = DC_PRED; - mbmi->ref_frame[0] = LAST_FRAME; - mbmi->ref_frame[1] = NONE; - mbmi->mv[0].as_int = 0; - mbmi->interp_filter = filter_ref; - - xd->mi[0].src_mi->bmi[0].as_mv[0].as_int = 0; - x->skip = 1; - - vp9_rd_cost_init(rd_cost); -} - -static int set_segment_rdmult(VP9_COMP *const cpi, - MACROBLOCK *const x, - int8_t segment_id) { - int segment_qindex; - VP9_COMMON *const cm = &cpi->common; - vp9_init_plane_quantizers(cpi, x); - vp9_clear_system_state(); - segment_qindex = vp9_get_qindex(&cm->seg, segment_id, - cm->base_qindex); - return vp9_compute_rd_mult(cpi, segment_qindex + cm->y_dc_delta_q); -} - -static void rd_pick_sb_modes(VP9_COMP *cpi, - TileDataEnc *tile_data, - MACROBLOCK *const x, - int mi_row, int mi_col, RD_COST *rd_cost, - BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx, - int64_t best_rd) { - VP9_COMMON *const cm = &cpi->common; - TileInfo *const tile_info = &tile_data->tile_info; - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *mbmi; - struct macroblock_plane *const p = x->plane; - struct macroblockd_plane *const pd = xd->plane; - const AQ_MODE aq_mode = cpi->oxcf.aq_mode; - int i, orig_rdmult; - - vp9_clear_system_state(); - - // Use the lower precision, but faster, 32x32 fdct for mode selection. - x->use_lp32x32fdct = 1; - - set_offsets(cpi, tile_info, x, mi_row, mi_col, bsize); - mbmi = &xd->mi[0].src_mi->mbmi; - mbmi->sb_type = bsize; - - for (i = 0; i < MAX_MB_PLANE; ++i) { - p[i].coeff = ctx->coeff_pbuf[i][0]; - p[i].qcoeff = ctx->qcoeff_pbuf[i][0]; - pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][0]; - p[i].eobs = ctx->eobs_pbuf[i][0]; - } - ctx->is_coded = 0; - ctx->skippable = 0; - ctx->pred_pixel_ready = 0; - x->skip_recode = 0; - - // Set to zero to make sure we do not use the previous encoded frame stats - mbmi->skip = 0; - -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - x->source_variance = - high_get_sby_perpixel_variance(cpi, &x->plane[0].src, bsize, xd->bd); - } else { - x->source_variance = - get_sby_perpixel_variance(cpi, &x->plane[0].src, bsize); - } -#else - x->source_variance = get_sby_perpixel_variance(cpi, &x->plane[0].src, bsize); -#endif // CONFIG_VP9_HIGHBITDEPTH - - // Save rdmult before it might be changed, so it can be restored later. - orig_rdmult = x->rdmult; - - if (aq_mode == VARIANCE_AQ) { - const int energy = bsize <= BLOCK_16X16 ? x->mb_energy - : vp9_block_energy(cpi, x, bsize); - if (cm->frame_type == KEY_FRAME || - cpi->refresh_alt_ref_frame || - (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref)) { - mbmi->segment_id = vp9_vaq_segment_id(energy); - } else { - const uint8_t *const map = cm->seg.update_map ? cpi->segmentation_map - : cm->last_frame_seg_map; - mbmi->segment_id = vp9_get_segment_id(cm, map, bsize, mi_row, mi_col); - } - x->rdmult = set_segment_rdmult(cpi, x, mbmi->segment_id); - } else if (aq_mode == COMPLEXITY_AQ) { - x->rdmult = set_segment_rdmult(cpi, x, mbmi->segment_id); - } else if (aq_mode == CYCLIC_REFRESH_AQ) { - const uint8_t *const map = cm->seg.update_map ? cpi->segmentation_map - : cm->last_frame_seg_map; - // If segment 1, use rdmult for that segment. - if (vp9_get_segment_id(cm, map, bsize, mi_row, mi_col)) - x->rdmult = vp9_cyclic_refresh_get_rdmult(cpi->cyclic_refresh); - } - - // Find best coding mode & reconstruct the MB so it is available - // as a predictor for MBs that follow in the SB - if (frame_is_intra_only(cm)) { - vp9_rd_pick_intra_mode_sb(cpi, x, rd_cost, bsize, ctx, best_rd); - } else { - if (bsize >= BLOCK_8X8) { - if (vp9_segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP)) - vp9_rd_pick_inter_mode_sb_seg_skip(cpi, tile_data, x, rd_cost, bsize, - ctx, best_rd); - else - vp9_rd_pick_inter_mode_sb(cpi, tile_data, x, mi_row, mi_col, - rd_cost, bsize, ctx, best_rd); - } else { - vp9_rd_pick_inter_mode_sub8x8(cpi, tile_data, x, mi_row, mi_col, - rd_cost, bsize, ctx, best_rd); - } - } - - - // Examine the resulting rate and for AQ mode 2 make a segment choice. - if ((rd_cost->rate != INT_MAX) && - (aq_mode == COMPLEXITY_AQ) && (bsize >= BLOCK_16X16) && - (cm->frame_type == KEY_FRAME || - cpi->refresh_alt_ref_frame || - (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref))) { - vp9_caq_select_segment(cpi, x, bsize, mi_row, mi_col, rd_cost->rate); - } - - x->rdmult = orig_rdmult; - - // TODO(jingning) The rate-distortion optimization flow needs to be - // refactored to provide proper exit/return handle. - if (rd_cost->rate == INT_MAX) - rd_cost->rdcost = INT64_MAX; - - ctx->rate = rd_cost->rate; - ctx->dist = rd_cost->dist; -} - -static void update_stats(VP9_COMMON *cm, ThreadData *td) { - const MACROBLOCK *x = &td->mb; - const MACROBLOCKD *const xd = &x->e_mbd; - const MODE_INFO *const mi = xd->mi[0].src_mi; - const MB_MODE_INFO *const mbmi = &mi->mbmi; - const BLOCK_SIZE bsize = mbmi->sb_type; - - if (!frame_is_intra_only(cm)) { - FRAME_COUNTS *const counts = td->counts; - const int inter_block = is_inter_block(mbmi); - const int seg_ref_active = vp9_segfeature_active(&cm->seg, mbmi->segment_id, - SEG_LVL_REF_FRAME); - if (!seg_ref_active) { - counts->intra_inter[vp9_get_intra_inter_context(xd)][inter_block]++; - // If the segment reference feature is enabled we have only a single - // reference frame allowed for the segment so exclude it from - // the reference frame counts used to work out probabilities. - if (inter_block) { - const MV_REFERENCE_FRAME ref0 = mbmi->ref_frame[0]; - if (cm->reference_mode == REFERENCE_MODE_SELECT) - counts->comp_inter[vp9_get_reference_mode_context(cm, xd)] - [has_second_ref(mbmi)]++; - - if (has_second_ref(mbmi)) { - counts->comp_ref[vp9_get_pred_context_comp_ref_p(cm, xd)] - [ref0 == GOLDEN_FRAME]++; - } else { - counts->single_ref[vp9_get_pred_context_single_ref_p1(xd)][0] - [ref0 != LAST_FRAME]++; - if (ref0 != LAST_FRAME) - counts->single_ref[vp9_get_pred_context_single_ref_p2(xd)][1] - [ref0 != GOLDEN_FRAME]++; - } - } - } - if (inter_block && - !vp9_segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP)) { - const int mode_ctx = mbmi->mode_context[mbmi->ref_frame[0]]; - if (bsize >= BLOCK_8X8) { - const PREDICTION_MODE mode = mbmi->mode; - ++counts->inter_mode[mode_ctx][INTER_OFFSET(mode)]; - } else { - const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize]; - const int num_4x4_h = num_4x4_blocks_high_lookup[bsize]; - int idx, idy; - for (idy = 0; idy < 2; idy += num_4x4_h) { - for (idx = 0; idx < 2; idx += num_4x4_w) { - const int j = idy * 2 + idx; - const PREDICTION_MODE b_mode = mi->bmi[j].as_mode; - ++counts->inter_mode[mode_ctx][INTER_OFFSET(b_mode)]; - } - } - } - } - } -} - -static void restore_context(MACROBLOCK *const x, int mi_row, int mi_col, - ENTROPY_CONTEXT a[16 * MAX_MB_PLANE], - ENTROPY_CONTEXT l[16 * MAX_MB_PLANE], - PARTITION_CONTEXT sa[8], PARTITION_CONTEXT sl[8], - BLOCK_SIZE bsize) { - MACROBLOCKD *const xd = &x->e_mbd; - int p; - const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize]; - const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bsize]; - int mi_width = num_8x8_blocks_wide_lookup[bsize]; - int mi_height = num_8x8_blocks_high_lookup[bsize]; - for (p = 0; p < MAX_MB_PLANE; p++) { - vpx_memcpy( - xd->above_context[p] + ((mi_col * 2) >> xd->plane[p].subsampling_x), - a + num_4x4_blocks_wide * p, - (sizeof(ENTROPY_CONTEXT) * num_4x4_blocks_wide) >> - xd->plane[p].subsampling_x); - vpx_memcpy( - xd->left_context[p] - + ((mi_row & MI_MASK) * 2 >> xd->plane[p].subsampling_y), - l + num_4x4_blocks_high * p, - (sizeof(ENTROPY_CONTEXT) * num_4x4_blocks_high) >> - xd->plane[p].subsampling_y); - } - vpx_memcpy(xd->above_seg_context + mi_col, sa, - sizeof(*xd->above_seg_context) * mi_width); - vpx_memcpy(xd->left_seg_context + (mi_row & MI_MASK), sl, - sizeof(xd->left_seg_context[0]) * mi_height); -} - -static void save_context(MACROBLOCK *const x, int mi_row, int mi_col, - ENTROPY_CONTEXT a[16 * MAX_MB_PLANE], - ENTROPY_CONTEXT l[16 * MAX_MB_PLANE], - PARTITION_CONTEXT sa[8], PARTITION_CONTEXT sl[8], - BLOCK_SIZE bsize) { - const MACROBLOCKD *const xd = &x->e_mbd; - int p; - const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize]; - const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bsize]; - int mi_width = num_8x8_blocks_wide_lookup[bsize]; - int mi_height = num_8x8_blocks_high_lookup[bsize]; - - // buffer the above/left context information of the block in search. - for (p = 0; p < MAX_MB_PLANE; ++p) { - vpx_memcpy( - a + num_4x4_blocks_wide * p, - xd->above_context[p] + (mi_col * 2 >> xd->plane[p].subsampling_x), - (sizeof(ENTROPY_CONTEXT) * num_4x4_blocks_wide) >> - xd->plane[p].subsampling_x); - vpx_memcpy( - l + num_4x4_blocks_high * p, - xd->left_context[p] - + ((mi_row & MI_MASK) * 2 >> xd->plane[p].subsampling_y), - (sizeof(ENTROPY_CONTEXT) * num_4x4_blocks_high) >> - xd->plane[p].subsampling_y); - } - vpx_memcpy(sa, xd->above_seg_context + mi_col, - sizeof(*xd->above_seg_context) * mi_width); - vpx_memcpy(sl, xd->left_seg_context + (mi_row & MI_MASK), - sizeof(xd->left_seg_context[0]) * mi_height); -} - -static void encode_b(VP9_COMP *cpi, const TileInfo *const tile, - ThreadData *td, - TOKENEXTRA **tp, int mi_row, int mi_col, - int output_enabled, BLOCK_SIZE bsize, - PICK_MODE_CONTEXT *ctx) { - MACROBLOCK *const x = &td->mb; - set_offsets(cpi, tile, x, mi_row, mi_col, bsize); - update_state(cpi, td, ctx, mi_row, mi_col, bsize, output_enabled); - encode_superblock(cpi, td, tp, output_enabled, mi_row, mi_col, bsize, ctx); - - if (output_enabled) { - update_stats(&cpi->common, td); - - (*tp)->token = EOSB_TOKEN; - (*tp)++; - } -} - -static void encode_sb(VP9_COMP *cpi, ThreadData *td, - const TileInfo *const tile, - TOKENEXTRA **tp, int mi_row, int mi_col, - int output_enabled, BLOCK_SIZE bsize, - PC_TREE *pc_tree) { - VP9_COMMON *const cm = &cpi->common; - MACROBLOCK *const x = &td->mb; - MACROBLOCKD *const xd = &x->e_mbd; - - const int bsl = b_width_log2_lookup[bsize], hbs = (1 << bsl) / 4; - int ctx; - PARTITION_TYPE partition; - BLOCK_SIZE subsize = bsize; - - if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) - return; - - if (bsize >= BLOCK_8X8) { - ctx = partition_plane_context(xd, mi_row, mi_col, bsize); - subsize = get_subsize(bsize, pc_tree->partitioning); - } else { - ctx = 0; - subsize = BLOCK_4X4; - } - - partition = partition_lookup[bsl][subsize]; - if (output_enabled && bsize != BLOCK_4X4) - td->counts->partition[ctx][partition]++; - - switch (partition) { - case PARTITION_NONE: - encode_b(cpi, tile, td, tp, mi_row, mi_col, output_enabled, subsize, - &pc_tree->none); - break; - case PARTITION_VERT: - encode_b(cpi, tile, td, tp, mi_row, mi_col, output_enabled, subsize, - &pc_tree->vertical[0]); - if (mi_col + hbs < cm->mi_cols && bsize > BLOCK_8X8) { - encode_b(cpi, tile, td, tp, mi_row, mi_col + hbs, output_enabled, - subsize, &pc_tree->vertical[1]); - } - break; - case PARTITION_HORZ: - encode_b(cpi, tile, td, tp, mi_row, mi_col, output_enabled, subsize, - &pc_tree->horizontal[0]); - if (mi_row + hbs < cm->mi_rows && bsize > BLOCK_8X8) { - encode_b(cpi, tile, td, tp, mi_row + hbs, mi_col, output_enabled, - subsize, &pc_tree->horizontal[1]); - } - break; - case PARTITION_SPLIT: - if (bsize == BLOCK_8X8) { - encode_b(cpi, tile, td, tp, mi_row, mi_col, output_enabled, subsize, - pc_tree->leaf_split[0]); - } else { - encode_sb(cpi, td, tile, tp, mi_row, mi_col, output_enabled, subsize, - pc_tree->split[0]); - encode_sb(cpi, td, tile, tp, mi_row, mi_col + hbs, output_enabled, - subsize, pc_tree->split[1]); - encode_sb(cpi, td, tile, tp, mi_row + hbs, mi_col, output_enabled, - subsize, pc_tree->split[2]); - encode_sb(cpi, td, tile, tp, mi_row + hbs, mi_col + hbs, output_enabled, - subsize, pc_tree->split[3]); - } - break; - default: - assert(0 && "Invalid partition type."); - break; - } - - if (partition != PARTITION_SPLIT || bsize == BLOCK_8X8) - update_partition_context(xd, mi_row, mi_col, subsize, bsize); -} - -// Check to see if the given partition size is allowed for a specified number -// of 8x8 block rows and columns remaining in the image. -// If not then return the largest allowed partition size -static BLOCK_SIZE find_partition_size(BLOCK_SIZE bsize, - int rows_left, int cols_left, - int *bh, int *bw) { - if (rows_left <= 0 || cols_left <= 0) { - return MIN(bsize, BLOCK_8X8); - } else { - for (; bsize > 0; bsize -= 3) { - *bh = num_8x8_blocks_high_lookup[bsize]; - *bw = num_8x8_blocks_wide_lookup[bsize]; - if ((*bh <= rows_left) && (*bw <= cols_left)) { - break; - } - } - } - return bsize; -} - -static void set_partial_b64x64_partition(MODE_INFO *mi, int mis, - int bh_in, int bw_in, int row8x8_remaining, int col8x8_remaining, - BLOCK_SIZE bsize, MODE_INFO *mi_8x8) { - int bh = bh_in; - int r, c; - for (r = 0; r < MI_BLOCK_SIZE; r += bh) { - int bw = bw_in; - for (c = 0; c < MI_BLOCK_SIZE; c += bw) { - const int index = r * mis + c; - mi_8x8[index].src_mi = mi + index; - mi_8x8[index].src_mi->mbmi.sb_type = find_partition_size(bsize, - row8x8_remaining - r, col8x8_remaining - c, &bh, &bw); - } - } -} - -// This function attempts to set all mode info entries in a given SB64 -// to the same block partition size. -// However, at the bottom and right borders of the image the requested size -// may not be allowed in which case this code attempts to choose the largest -// allowable partition. -static void set_fixed_partitioning(VP9_COMP *cpi, const TileInfo *const tile, - MODE_INFO *mi_8x8, int mi_row, int mi_col, - BLOCK_SIZE bsize) { - VP9_COMMON *const cm = &cpi->common; - const int mis = cm->mi_stride; - const int row8x8_remaining = tile->mi_row_end - mi_row; - const int col8x8_remaining = tile->mi_col_end - mi_col; - int block_row, block_col; - MODE_INFO *mi_upper_left = cm->mi + mi_row * mis + mi_col; - int bh = num_8x8_blocks_high_lookup[bsize]; - int bw = num_8x8_blocks_wide_lookup[bsize]; - - assert((row8x8_remaining > 0) && (col8x8_remaining > 0)); - - // Apply the requested partition size to the SB64 if it is all "in image" - if ((col8x8_remaining >= MI_BLOCK_SIZE) && - (row8x8_remaining >= MI_BLOCK_SIZE)) { - for (block_row = 0; block_row < MI_BLOCK_SIZE; block_row += bh) { - for (block_col = 0; block_col < MI_BLOCK_SIZE; block_col += bw) { - int index = block_row * mis + block_col; - mi_8x8[index].src_mi = mi_upper_left + index; - mi_8x8[index].src_mi->mbmi.sb_type = bsize; - } - } - } else { - // Else this is a partial SB64. - set_partial_b64x64_partition(mi_upper_left, mis, bh, bw, row8x8_remaining, - col8x8_remaining, bsize, mi_8x8); - } -} - -const struct { - int row; - int col; -} coord_lookup[16] = { - // 32x32 index = 0 - {0, 0}, {0, 2}, {2, 0}, {2, 2}, - // 32x32 index = 1 - {0, 4}, {0, 6}, {2, 4}, {2, 6}, - // 32x32 index = 2 - {4, 0}, {4, 2}, {6, 0}, {6, 2}, - // 32x32 index = 3 - {4, 4}, {4, 6}, {6, 4}, {6, 6}, -}; - -static void set_source_var_based_partition(VP9_COMP *cpi, - const TileInfo *const tile, - MACROBLOCK *const x, - MODE_INFO *mi_8x8, - int mi_row, int mi_col) { - VP9_COMMON *const cm = &cpi->common; - const int mis = cm->mi_stride; - const int row8x8_remaining = tile->mi_row_end - mi_row; - const int col8x8_remaining = tile->mi_col_end - mi_col; - MODE_INFO *mi_upper_left = cm->mi + mi_row * mis + mi_col; - - vp9_setup_src_planes(x, cpi->Source, mi_row, mi_col); - - assert((row8x8_remaining > 0) && (col8x8_remaining > 0)); - - // In-image SB64 - if ((col8x8_remaining >= MI_BLOCK_SIZE) && - (row8x8_remaining >= MI_BLOCK_SIZE)) { - int i, j; - int index; - diff d32[4]; - const int offset = (mi_row >> 1) * cm->mb_cols + (mi_col >> 1); - int is_larger_better = 0; - int use32x32 = 0; - unsigned int thr = cpi->source_var_thresh; - - vpx_memset(d32, 0, 4 * sizeof(diff)); - - for (i = 0; i < 4; i++) { - diff *d16[4]; - - for (j = 0; j < 4; j++) { - int b_mi_row = coord_lookup[i * 4 + j].row; - int b_mi_col = coord_lookup[i * 4 + j].col; - int boffset = b_mi_row / 2 * cm->mb_cols + - b_mi_col / 2; - - d16[j] = cpi->source_diff_var + offset + boffset; - - index = b_mi_row * mis + b_mi_col; - mi_8x8[index].src_mi = mi_upper_left + index; - mi_8x8[index].src_mi->mbmi.sb_type = BLOCK_16X16; - - // TODO(yunqingwang): If d16[j].var is very large, use 8x8 partition - // size to further improve quality. - } - - is_larger_better = (d16[0]->var < thr) && (d16[1]->var < thr) && - (d16[2]->var < thr) && (d16[3]->var < thr); - - // Use 32x32 partition - if (is_larger_better) { - use32x32 += 1; - - for (j = 0; j < 4; j++) { - d32[i].sse += d16[j]->sse; - d32[i].sum += d16[j]->sum; - } - - d32[i].var = d32[i].sse - (((int64_t)d32[i].sum * d32[i].sum) >> 10); - - index = coord_lookup[i*4].row * mis + coord_lookup[i*4].col; - mi_8x8[index].src_mi = mi_upper_left + index; - mi_8x8[index].src_mi->mbmi.sb_type = BLOCK_32X32; - } - } - - if (use32x32 == 4) { - thr <<= 1; - is_larger_better = (d32[0].var < thr) && (d32[1].var < thr) && - (d32[2].var < thr) && (d32[3].var < thr); - - // Use 64x64 partition - if (is_larger_better) { - mi_8x8[0].src_mi = mi_upper_left; - mi_8x8[0].src_mi->mbmi.sb_type = BLOCK_64X64; - } - } - } else { // partial in-image SB64 - int bh = num_8x8_blocks_high_lookup[BLOCK_16X16]; - int bw = num_8x8_blocks_wide_lookup[BLOCK_16X16]; - set_partial_b64x64_partition(mi_upper_left, mis, bh, bw, - row8x8_remaining, col8x8_remaining, BLOCK_16X16, mi_8x8); - } -} - -static void update_state_rt(VP9_COMP *cpi, ThreadData *td, - PICK_MODE_CONTEXT *ctx, - int mi_row, int mi_col, int bsize) { - VP9_COMMON *const cm = &cpi->common; - MACROBLOCK *const x = &td->mb; - MACROBLOCKD *const xd = &x->e_mbd; - MODE_INFO *const mi = xd->mi[0].src_mi; - MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi; - const struct segmentation *const seg = &cm->seg; - const int bw = num_8x8_blocks_wide_lookup[mi->mbmi.sb_type]; - const int bh = num_8x8_blocks_high_lookup[mi->mbmi.sb_type]; - const int x_mis = MIN(bw, cm->mi_cols - mi_col); - const int y_mis = MIN(bh, cm->mi_rows - mi_row); - - xd->mi[0] = ctx->mic; - xd->mi[0].src_mi = &xd->mi[0]; - - if (seg->enabled && cpi->oxcf.aq_mode) { - // For in frame complexity AQ or variance AQ, copy segment_id from - // segmentation_map. - if (cpi->oxcf.aq_mode == COMPLEXITY_AQ || - cpi->oxcf.aq_mode == VARIANCE_AQ ) { - const uint8_t *const map = seg->update_map ? cpi->segmentation_map - : cm->last_frame_seg_map; - mbmi->segment_id = vp9_get_segment_id(cm, map, bsize, mi_row, mi_col); - } else { - // Setting segmentation map for cyclic_refresh. - vp9_cyclic_refresh_update_segment(cpi, mbmi, mi_row, mi_col, bsize, - ctx->rate, ctx->dist, x->skip); - } - vp9_init_plane_quantizers(cpi, x); - } - - if (is_inter_block(mbmi)) { - vp9_update_mv_count(td); - if (cm->interp_filter == SWITCHABLE) { - const int pred_ctx = vp9_get_pred_context_switchable_interp(xd); - ++td->counts->switchable_interp[pred_ctx][mbmi->interp_filter]; - } - - if (mbmi->sb_type < BLOCK_8X8) { - mbmi->mv[0].as_int = mi->bmi[3].as_mv[0].as_int; - mbmi->mv[1].as_int = mi->bmi[3].as_mv[1].as_int; - } - } - - if (cm->use_prev_frame_mvs) { - MV_REF *const frame_mvs = - cm->cur_frame->mvs + mi_row * cm->mi_cols + mi_col; - int w, h; - - for (h = 0; h < y_mis; ++h) { - MV_REF *const frame_mv = frame_mvs + h * cm->mi_cols; - for (w = 0; w < x_mis; ++w) { - MV_REF *const mv = frame_mv + w; - mv->ref_frame[0] = mi->src_mi->mbmi.ref_frame[0]; - mv->ref_frame[1] = mi->src_mi->mbmi.ref_frame[1]; - mv->mv[0].as_int = mi->src_mi->mbmi.mv[0].as_int; - mv->mv[1].as_int = mi->src_mi->mbmi.mv[1].as_int; - } - } - } - - x->skip = ctx->skip; - x->skip_txfm[0] = mbmi->segment_id ? 0 : ctx->skip_txfm[0]; -} - -static void encode_b_rt(VP9_COMP *cpi, ThreadData *td, - const TileInfo *const tile, - TOKENEXTRA **tp, int mi_row, int mi_col, - int output_enabled, BLOCK_SIZE bsize, - PICK_MODE_CONTEXT *ctx) { - MACROBLOCK *const x = &td->mb; - set_offsets(cpi, tile, x, mi_row, mi_col, bsize); - update_state_rt(cpi, td, ctx, mi_row, mi_col, bsize); - -#if CONFIG_VP9_TEMPORAL_DENOISING - if (cpi->oxcf.noise_sensitivity > 0 && output_enabled && - cpi->common.frame_type != KEY_FRAME) { - vp9_denoiser_denoise(&cpi->denoiser, x, mi_row, mi_col, - MAX(BLOCK_8X8, bsize), ctx); - } -#endif - - encode_superblock(cpi, td, tp, output_enabled, mi_row, mi_col, bsize, ctx); - update_stats(&cpi->common, td); - - (*tp)->token = EOSB_TOKEN; - (*tp)++; -} - -static void encode_sb_rt(VP9_COMP *cpi, ThreadData *td, - const TileInfo *const tile, - TOKENEXTRA **tp, int mi_row, int mi_col, - int output_enabled, BLOCK_SIZE bsize, - PC_TREE *pc_tree) { - VP9_COMMON *const cm = &cpi->common; - MACROBLOCK *const x = &td->mb; - MACROBLOCKD *const xd = &x->e_mbd; - - const int bsl = b_width_log2_lookup[bsize], hbs = (1 << bsl) / 4; - int ctx; - PARTITION_TYPE partition; - BLOCK_SIZE subsize; - - if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) - return; - - if (bsize >= BLOCK_8X8) { - const int idx_str = xd->mi_stride * mi_row + mi_col; - MODE_INFO *mi_8x8 = cm->mi[idx_str].src_mi; - ctx = partition_plane_context(xd, mi_row, mi_col, bsize); - subsize = mi_8x8[0].src_mi->mbmi.sb_type; - } else { - ctx = 0; - subsize = BLOCK_4X4; - } - - partition = partition_lookup[bsl][subsize]; - if (output_enabled && bsize != BLOCK_4X4) - td->counts->partition[ctx][partition]++; - - switch (partition) { - case PARTITION_NONE: - encode_b_rt(cpi, td, tile, tp, mi_row, mi_col, output_enabled, subsize, - &pc_tree->none); - break; - case PARTITION_VERT: - encode_b_rt(cpi, td, tile, tp, mi_row, mi_col, output_enabled, subsize, - &pc_tree->vertical[0]); - if (mi_col + hbs < cm->mi_cols && bsize > BLOCK_8X8) { - encode_b_rt(cpi, td, tile, tp, mi_row, mi_col + hbs, output_enabled, - subsize, &pc_tree->vertical[1]); - } - break; - case PARTITION_HORZ: - encode_b_rt(cpi, td, tile, tp, mi_row, mi_col, output_enabled, subsize, - &pc_tree->horizontal[0]); - if (mi_row + hbs < cm->mi_rows && bsize > BLOCK_8X8) { - encode_b_rt(cpi, td, tile, tp, mi_row + hbs, mi_col, output_enabled, - subsize, &pc_tree->horizontal[1]); - } - break; - case PARTITION_SPLIT: - subsize = get_subsize(bsize, PARTITION_SPLIT); - encode_sb_rt(cpi, td, tile, tp, mi_row, mi_col, output_enabled, subsize, - pc_tree->split[0]); - encode_sb_rt(cpi, td, tile, tp, mi_row, mi_col + hbs, output_enabled, - subsize, pc_tree->split[1]); - encode_sb_rt(cpi, td, tile, tp, mi_row + hbs, mi_col, output_enabled, - subsize, pc_tree->split[2]); - encode_sb_rt(cpi, td, tile, tp, mi_row + hbs, mi_col + hbs, - output_enabled, subsize, pc_tree->split[3]); - break; - default: - assert(0 && "Invalid partition type."); - break; - } - - if (partition != PARTITION_SPLIT || bsize == BLOCK_8X8) - update_partition_context(xd, mi_row, mi_col, subsize, bsize); -} - -static void rd_use_partition(VP9_COMP *cpi, - ThreadData *td, - TileDataEnc *tile_data, - MODE_INFO *mi_8x8, TOKENEXTRA **tp, - int mi_row, int mi_col, - BLOCK_SIZE bsize, - int *rate, int64_t *dist, - int do_recon, PC_TREE *pc_tree) { - VP9_COMMON *const cm = &cpi->common; - TileInfo *const tile_info = &tile_data->tile_info; - MACROBLOCK *const x = &td->mb; - MACROBLOCKD *const xd = &x->e_mbd; - const int mis = cm->mi_stride; - const int bsl = b_width_log2_lookup[bsize]; - const int mi_step = num_4x4_blocks_wide_lookup[bsize] / 2; - const int bss = (1 << bsl) / 4; - int i, pl; - PARTITION_TYPE partition = PARTITION_NONE; - BLOCK_SIZE subsize; - ENTROPY_CONTEXT l[16 * MAX_MB_PLANE], a[16 * MAX_MB_PLANE]; - PARTITION_CONTEXT sl[8], sa[8]; - RD_COST last_part_rdc, none_rdc, chosen_rdc; - BLOCK_SIZE sub_subsize = BLOCK_4X4; - int splits_below = 0; - BLOCK_SIZE bs_type = mi_8x8[0].src_mi->mbmi.sb_type; - int do_partition_search = 1; - PICK_MODE_CONTEXT *ctx = &pc_tree->none; - - if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) - return; - - assert(num_4x4_blocks_wide_lookup[bsize] == - num_4x4_blocks_high_lookup[bsize]); - - vp9_rd_cost_reset(&last_part_rdc); - vp9_rd_cost_reset(&none_rdc); - vp9_rd_cost_reset(&chosen_rdc); - - partition = partition_lookup[bsl][bs_type]; - subsize = get_subsize(bsize, partition); - - pc_tree->partitioning = partition; - save_context(x, mi_row, mi_col, a, l, sa, sl, bsize); - - if (bsize == BLOCK_16X16 && cpi->oxcf.aq_mode) { - set_offsets(cpi, tile_info, x, mi_row, mi_col, bsize); - x->mb_energy = vp9_block_energy(cpi, x, bsize); - } - - if (do_partition_search && - cpi->sf.partition_search_type == SEARCH_PARTITION && - cpi->sf.adjust_partitioning_from_last_frame) { - // Check if any of the sub blocks are further split. - if (partition == PARTITION_SPLIT && subsize > BLOCK_8X8) { - sub_subsize = get_subsize(subsize, PARTITION_SPLIT); - splits_below = 1; - for (i = 0; i < 4; i++) { - int jj = i >> 1, ii = i & 0x01; - MODE_INFO *this_mi = mi_8x8[jj * bss * mis + ii * bss].src_mi; - if (this_mi && this_mi->mbmi.sb_type >= sub_subsize) { - splits_below = 0; - } - } - } - - // If partition is not none try none unless each of the 4 splits are split - // even further.. - if (partition != PARTITION_NONE && !splits_below && - mi_row + (mi_step >> 1) < cm->mi_rows && - mi_col + (mi_step >> 1) < cm->mi_cols) { - pc_tree->partitioning = PARTITION_NONE; - rd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, &none_rdc, bsize, - ctx, INT64_MAX); - - pl = partition_plane_context(xd, mi_row, mi_col, bsize); - - if (none_rdc.rate < INT_MAX) { - none_rdc.rate += cpi->partition_cost[pl][PARTITION_NONE]; - none_rdc.rdcost = RDCOST(x->rdmult, x->rddiv, none_rdc.rate, - none_rdc.dist); - } - - restore_context(x, mi_row, mi_col, a, l, sa, sl, bsize); - mi_8x8[0].src_mi->mbmi.sb_type = bs_type; - pc_tree->partitioning = partition; - } - } - - switch (partition) { - case PARTITION_NONE: - rd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, &last_part_rdc, - bsize, ctx, INT64_MAX); - break; - case PARTITION_HORZ: - rd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, &last_part_rdc, - subsize, &pc_tree->horizontal[0], - INT64_MAX); - if (last_part_rdc.rate != INT_MAX && - bsize >= BLOCK_8X8 && mi_row + (mi_step >> 1) < cm->mi_rows) { - RD_COST tmp_rdc; - PICK_MODE_CONTEXT *ctx = &pc_tree->horizontal[0]; - vp9_rd_cost_init(&tmp_rdc); - update_state(cpi, td, ctx, mi_row, mi_col, subsize, 0); - encode_superblock(cpi, td, tp, 0, mi_row, mi_col, subsize, ctx); - rd_pick_sb_modes(cpi, tile_data, x, - mi_row + (mi_step >> 1), mi_col, &tmp_rdc, - subsize, &pc_tree->horizontal[1], INT64_MAX); - if (tmp_rdc.rate == INT_MAX || tmp_rdc.dist == INT64_MAX) { - vp9_rd_cost_reset(&last_part_rdc); - break; - } - last_part_rdc.rate += tmp_rdc.rate; - last_part_rdc.dist += tmp_rdc.dist; - last_part_rdc.rdcost += tmp_rdc.rdcost; - } - break; - case PARTITION_VERT: - rd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, &last_part_rdc, - subsize, &pc_tree->vertical[0], INT64_MAX); - if (last_part_rdc.rate != INT_MAX && - bsize >= BLOCK_8X8 && mi_col + (mi_step >> 1) < cm->mi_cols) { - RD_COST tmp_rdc; - PICK_MODE_CONTEXT *ctx = &pc_tree->vertical[0]; - vp9_rd_cost_init(&tmp_rdc); - update_state(cpi, td, ctx, mi_row, mi_col, subsize, 0); - encode_superblock(cpi, td, tp, 0, mi_row, mi_col, subsize, ctx); - rd_pick_sb_modes(cpi, tile_data, x, - mi_row, mi_col + (mi_step >> 1), &tmp_rdc, - subsize, &pc_tree->vertical[bsize > BLOCK_8X8], - INT64_MAX); - if (tmp_rdc.rate == INT_MAX || tmp_rdc.dist == INT64_MAX) { - vp9_rd_cost_reset(&last_part_rdc); - break; - } - last_part_rdc.rate += tmp_rdc.rate; - last_part_rdc.dist += tmp_rdc.dist; - last_part_rdc.rdcost += tmp_rdc.rdcost; - } - break; - case PARTITION_SPLIT: - if (bsize == BLOCK_8X8) { - rd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, &last_part_rdc, - subsize, pc_tree->leaf_split[0], INT64_MAX); - break; - } - last_part_rdc.rate = 0; - last_part_rdc.dist = 0; - last_part_rdc.rdcost = 0; - for (i = 0; i < 4; i++) { - int x_idx = (i & 1) * (mi_step >> 1); - int y_idx = (i >> 1) * (mi_step >> 1); - int jj = i >> 1, ii = i & 0x01; - RD_COST tmp_rdc; - if ((mi_row + y_idx >= cm->mi_rows) || (mi_col + x_idx >= cm->mi_cols)) - continue; - - vp9_rd_cost_init(&tmp_rdc); - rd_use_partition(cpi, td, tile_data, - mi_8x8 + jj * bss * mis + ii * bss, tp, - mi_row + y_idx, mi_col + x_idx, subsize, - &tmp_rdc.rate, &tmp_rdc.dist, - i != 3, pc_tree->split[i]); - if (tmp_rdc.rate == INT_MAX || tmp_rdc.dist == INT64_MAX) { - vp9_rd_cost_reset(&last_part_rdc); - break; - } - last_part_rdc.rate += tmp_rdc.rate; - last_part_rdc.dist += tmp_rdc.dist; - } - break; - default: - assert(0); - break; - } - - pl = partition_plane_context(xd, mi_row, mi_col, bsize); - if (last_part_rdc.rate < INT_MAX) { - last_part_rdc.rate += cpi->partition_cost[pl][partition]; - last_part_rdc.rdcost = RDCOST(x->rdmult, x->rddiv, - last_part_rdc.rate, last_part_rdc.dist); - } - - if (do_partition_search - && cpi->sf.adjust_partitioning_from_last_frame - && cpi->sf.partition_search_type == SEARCH_PARTITION - && partition != PARTITION_SPLIT && bsize > BLOCK_8X8 - && (mi_row + mi_step < cm->mi_rows || - mi_row + (mi_step >> 1) == cm->mi_rows) - && (mi_col + mi_step < cm->mi_cols || - mi_col + (mi_step >> 1) == cm->mi_cols)) { - BLOCK_SIZE split_subsize = get_subsize(bsize, PARTITION_SPLIT); - chosen_rdc.rate = 0; - chosen_rdc.dist = 0; - restore_context(x, mi_row, mi_col, a, l, sa, sl, bsize); - pc_tree->partitioning = PARTITION_SPLIT; - - // Split partition. - for (i = 0; i < 4; i++) { - int x_idx = (i & 1) * (mi_step >> 1); - int y_idx = (i >> 1) * (mi_step >> 1); - RD_COST tmp_rdc; - ENTROPY_CONTEXT l[16 * MAX_MB_PLANE], a[16 * MAX_MB_PLANE]; - PARTITION_CONTEXT sl[8], sa[8]; - - if ((mi_row + y_idx >= cm->mi_rows) || (mi_col + x_idx >= cm->mi_cols)) - continue; - - save_context(x, mi_row, mi_col, a, l, sa, sl, bsize); - pc_tree->split[i]->partitioning = PARTITION_NONE; - rd_pick_sb_modes(cpi, tile_data, x, - mi_row + y_idx, mi_col + x_idx, &tmp_rdc, - split_subsize, &pc_tree->split[i]->none, INT64_MAX); - - restore_context(x, mi_row, mi_col, a, l, sa, sl, bsize); - - if (tmp_rdc.rate == INT_MAX || tmp_rdc.dist == INT64_MAX) { - vp9_rd_cost_reset(&chosen_rdc); - break; - } - - chosen_rdc.rate += tmp_rdc.rate; - chosen_rdc.dist += tmp_rdc.dist; - - if (i != 3) - encode_sb(cpi, td, tile_info, tp, mi_row + y_idx, mi_col + x_idx, 0, - split_subsize, pc_tree->split[i]); - - pl = partition_plane_context(xd, mi_row + y_idx, mi_col + x_idx, - split_subsize); - chosen_rdc.rate += cpi->partition_cost[pl][PARTITION_NONE]; - } - pl = partition_plane_context(xd, mi_row, mi_col, bsize); - if (chosen_rdc.rate < INT_MAX) { - chosen_rdc.rate += cpi->partition_cost[pl][PARTITION_SPLIT]; - chosen_rdc.rdcost = RDCOST(x->rdmult, x->rddiv, - chosen_rdc.rate, chosen_rdc.dist); - } - } - - // If last_part is better set the partitioning to that. - if (last_part_rdc.rdcost < chosen_rdc.rdcost) { - mi_8x8[0].src_mi->mbmi.sb_type = bsize; - if (bsize >= BLOCK_8X8) - pc_tree->partitioning = partition; - chosen_rdc = last_part_rdc; - } - // If none was better set the partitioning to that. - if (none_rdc.rdcost < chosen_rdc.rdcost) { - if (bsize >= BLOCK_8X8) - pc_tree->partitioning = PARTITION_NONE; - chosen_rdc = none_rdc; - } - - restore_context(x, mi_row, mi_col, a, l, sa, sl, bsize); - - // We must have chosen a partitioning and encoding or we'll fail later on. - // No other opportunities for success. - if (bsize == BLOCK_64X64) - assert(chosen_rdc.rate < INT_MAX && chosen_rdc.dist < INT64_MAX); - - if (do_recon) { - int output_enabled = (bsize == BLOCK_64X64); - encode_sb(cpi, td, tile_info, tp, mi_row, mi_col, output_enabled, bsize, - pc_tree); - } - - *rate = chosen_rdc.rate; - *dist = chosen_rdc.dist; -} - -static const BLOCK_SIZE min_partition_size[BLOCK_SIZES] = { - BLOCK_4X4, BLOCK_4X4, BLOCK_4X4, - BLOCK_4X4, BLOCK_4X4, BLOCK_4X4, - BLOCK_8X8, BLOCK_8X8, BLOCK_8X8, - BLOCK_16X16, BLOCK_16X16, BLOCK_16X16, - BLOCK_16X16 -}; - -static const BLOCK_SIZE max_partition_size[BLOCK_SIZES] = { - BLOCK_8X8, BLOCK_16X16, BLOCK_16X16, - BLOCK_16X16, BLOCK_32X32, BLOCK_32X32, - BLOCK_32X32, BLOCK_64X64, BLOCK_64X64, - BLOCK_64X64, BLOCK_64X64, BLOCK_64X64, - BLOCK_64X64 -}; - -// Look at all the mode_info entries for blocks that are part of this -// partition and find the min and max values for sb_type. -// At the moment this is designed to work on a 64x64 SB but could be -// adjusted to use a size parameter. -// -// The min and max are assumed to have been initialized prior to calling this -// function so repeat calls can accumulate a min and max of more than one sb64. -static void get_sb_partition_size_range(MACROBLOCKD *xd, MODE_INFO *mi_8x8, - BLOCK_SIZE *min_block_size, - BLOCK_SIZE *max_block_size, - int bs_hist[BLOCK_SIZES]) { - int sb_width_in_blocks = MI_BLOCK_SIZE; - int sb_height_in_blocks = MI_BLOCK_SIZE; - int i, j; - int index = 0; - - // Check the sb_type for each block that belongs to this region. - for (i = 0; i < sb_height_in_blocks; ++i) { - for (j = 0; j < sb_width_in_blocks; ++j) { - MODE_INFO *mi = mi_8x8[index+j].src_mi; - BLOCK_SIZE sb_type = mi ? mi->mbmi.sb_type : 0; - bs_hist[sb_type]++; - *min_block_size = MIN(*min_block_size, sb_type); - *max_block_size = MAX(*max_block_size, sb_type); - } - index += xd->mi_stride; - } -} - -// Next square block size less or equal than current block size. -static const BLOCK_SIZE next_square_size[BLOCK_SIZES] = { - BLOCK_4X4, BLOCK_4X4, BLOCK_4X4, - BLOCK_8X8, BLOCK_8X8, BLOCK_8X8, - BLOCK_16X16, BLOCK_16X16, BLOCK_16X16, - BLOCK_32X32, BLOCK_32X32, BLOCK_32X32, - BLOCK_64X64 -}; - -// Look at neighboring blocks and set a min and max partition size based on -// what they chose. -static void rd_auto_partition_range(VP9_COMP *cpi, const TileInfo *const tile, - MACROBLOCKD *const xd, - int mi_row, int mi_col, - BLOCK_SIZE *min_block_size, - BLOCK_SIZE *max_block_size) { - VP9_COMMON *const cm = &cpi->common; - MODE_INFO *mi = xd->mi[0].src_mi; - const int left_in_image = xd->left_available && mi[-1].src_mi; - const int above_in_image = xd->up_available && mi[-xd->mi_stride].src_mi; - const int row8x8_remaining = tile->mi_row_end - mi_row; - const int col8x8_remaining = tile->mi_col_end - mi_col; - int bh, bw; - BLOCK_SIZE min_size = BLOCK_4X4; - BLOCK_SIZE max_size = BLOCK_64X64; - int i = 0; - int bs_hist[BLOCK_SIZES] = {0}; - - // Trap case where we do not have a prediction. - if (left_in_image || above_in_image || cm->frame_type != KEY_FRAME) { - // Default "min to max" and "max to min" - min_size = BLOCK_64X64; - max_size = BLOCK_4X4; - - // NOTE: each call to get_sb_partition_size_range() uses the previous - // passed in values for min and max as a starting point. - // Find the min and max partition used in previous frame at this location - if (cm->frame_type != KEY_FRAME) { - MODE_INFO *prev_mi = - cm->prev_mip + cm->mi_stride + 1 + mi_row * xd->mi_stride + mi_col; - - get_sb_partition_size_range(xd, prev_mi, &min_size, &max_size, bs_hist); - } - // Find the min and max partition sizes used in the left SB64 - if (left_in_image) { - MODE_INFO *left_sb64_mi = mi[-MI_BLOCK_SIZE].src_mi; - get_sb_partition_size_range(xd, left_sb64_mi, &min_size, &max_size, - bs_hist); - } - // Find the min and max partition sizes used in the above SB64. - if (above_in_image) { - MODE_INFO *above_sb64_mi = mi[-xd->mi_stride * MI_BLOCK_SIZE].src_mi; - get_sb_partition_size_range(xd, above_sb64_mi, &min_size, &max_size, - bs_hist); - } - - // adjust observed min and max - if (cpi->sf.auto_min_max_partition_size == RELAXED_NEIGHBORING_MIN_MAX) { - min_size = min_partition_size[min_size]; - max_size = max_partition_size[max_size]; - } else if (cpi->sf.auto_min_max_partition_size == - CONSTRAIN_NEIGHBORING_MIN_MAX) { - // adjust the search range based on the histogram of the observed - // partition sizes from left, above the previous co-located blocks - int sum = 0; - int first_moment = 0; - int second_moment = 0; - int var_unnormalized = 0; - - for (i = 0; i < BLOCK_SIZES; i++) { - sum += bs_hist[i]; - first_moment += bs_hist[i] * i; - second_moment += bs_hist[i] * i * i; - } - - // if variance is small enough, - // adjust the range around its mean size, which gives a tighter range - var_unnormalized = second_moment - first_moment * first_moment / sum; - if (var_unnormalized <= 4 * sum) { - int mean = first_moment / sum; - min_size = min_partition_size[mean]; - max_size = max_partition_size[mean]; - } else { - min_size = min_partition_size[min_size]; - max_size = max_partition_size[max_size]; - } - } - } - - // Check border cases where max and min from neighbors may not be legal. - max_size = find_partition_size(max_size, - row8x8_remaining, col8x8_remaining, - &bh, &bw); - min_size = MIN(min_size, max_size); - - // When use_square_partition_only is true, make sure at least one square - // partition is allowed by selecting the next smaller square size as - // *min_block_size. - if (cpi->sf.use_square_partition_only && - next_square_size[max_size] < min_size) { - min_size = next_square_size[max_size]; - } - - *min_block_size = min_size; - *max_block_size = max_size; -} - -static void auto_partition_range(VP9_COMP *cpi, const TileInfo *const tile, - MACROBLOCKD *const xd, - int mi_row, int mi_col, - BLOCK_SIZE *min_block_size, - BLOCK_SIZE *max_block_size) { - VP9_COMMON *const cm = &cpi->common; - MODE_INFO *mi_8x8 = xd->mi; - const int left_in_image = xd->left_available && mi_8x8[-1].src_mi; - const int above_in_image = xd->up_available && - mi_8x8[-xd->mi_stride].src_mi; - int row8x8_remaining = tile->mi_row_end - mi_row; - int col8x8_remaining = tile->mi_col_end - mi_col; - int bh, bw; - BLOCK_SIZE min_size = BLOCK_32X32; - BLOCK_SIZE max_size = BLOCK_8X8; - int bsl = mi_width_log2_lookup[BLOCK_64X64]; - const int search_range_ctrl = (((mi_row + mi_col) >> bsl) + - get_chessboard_index(cm->current_video_frame)) & 0x1; - // Trap case where we do not have a prediction. - if (search_range_ctrl && - (left_in_image || above_in_image || cm->frame_type != KEY_FRAME)) { - int block; - MODE_INFO *mi; - BLOCK_SIZE sb_type; - - // Find the min and max partition sizes used in the left SB64. - if (left_in_image) { - MODE_INFO *cur_mi; - mi = mi_8x8[-1].src_mi; - for (block = 0; block < MI_BLOCK_SIZE; ++block) { - cur_mi = mi[block * xd->mi_stride].src_mi; - sb_type = cur_mi ? cur_mi->mbmi.sb_type : 0; - min_size = MIN(min_size, sb_type); - max_size = MAX(max_size, sb_type); - } - } - // Find the min and max partition sizes used in the above SB64. - if (above_in_image) { - mi = mi_8x8[-xd->mi_stride * MI_BLOCK_SIZE].src_mi; - for (block = 0; block < MI_BLOCK_SIZE; ++block) { - sb_type = mi[block].src_mi ? mi[block].src_mi->mbmi.sb_type : 0; - min_size = MIN(min_size, sb_type); - max_size = MAX(max_size, sb_type); - } - } - - min_size = min_partition_size[min_size]; - max_size = find_partition_size(max_size, row8x8_remaining, col8x8_remaining, - &bh, &bw); - min_size = MIN(min_size, max_size); - min_size = MAX(min_size, BLOCK_8X8); - max_size = MIN(max_size, BLOCK_32X32); - } else { - min_size = BLOCK_8X8; - max_size = BLOCK_32X32; - } - - *min_block_size = min_size; - *max_block_size = max_size; -} - -// TODO(jingning) refactor functions setting partition search range -static void set_partition_range(VP9_COMMON *cm, MACROBLOCKD *xd, - int mi_row, int mi_col, BLOCK_SIZE bsize, - BLOCK_SIZE *min_bs, BLOCK_SIZE *max_bs) { - int mi_width = num_8x8_blocks_wide_lookup[bsize]; - int mi_height = num_8x8_blocks_high_lookup[bsize]; - int idx, idy; - - MODE_INFO *mi; - const int idx_str = cm->mi_stride * mi_row + mi_col; - MODE_INFO *prev_mi = (cm->prev_mip + cm->mi_stride + 1 + idx_str)->src_mi; - - - BLOCK_SIZE bs, min_size, max_size; - - min_size = BLOCK_64X64; - max_size = BLOCK_4X4; - - if (prev_mi) { - for (idy = 0; idy < mi_height; ++idy) { - for (idx = 0; idx < mi_width; ++idx) { - mi = prev_mi[idy * cm->mi_stride + idx].src_mi; - bs = mi ? mi->mbmi.sb_type : bsize; - min_size = MIN(min_size, bs); - max_size = MAX(max_size, bs); - } - } - } - - if (xd->left_available) { - for (idy = 0; idy < mi_height; ++idy) { - mi = xd->mi[idy * cm->mi_stride - 1].src_mi; - bs = mi ? mi->mbmi.sb_type : bsize; - min_size = MIN(min_size, bs); - max_size = MAX(max_size, bs); - } - } - - if (xd->up_available) { - for (idx = 0; idx < mi_width; ++idx) { - mi = xd->mi[idx - cm->mi_stride].src_mi; - bs = mi ? mi->mbmi.sb_type : bsize; - min_size = MIN(min_size, bs); - max_size = MAX(max_size, bs); - } - } - - if (min_size == max_size) { - min_size = min_partition_size[min_size]; - max_size = max_partition_size[max_size]; - } - - *min_bs = min_size; - *max_bs = max_size; -} - -static INLINE void store_pred_mv(MACROBLOCK *x, PICK_MODE_CONTEXT *ctx) { - vpx_memcpy(ctx->pred_mv, x->pred_mv, sizeof(x->pred_mv)); -} - -static INLINE void load_pred_mv(MACROBLOCK *x, PICK_MODE_CONTEXT *ctx) { - vpx_memcpy(x->pred_mv, ctx->pred_mv, sizeof(x->pred_mv)); -} - -#if CONFIG_FP_MB_STATS -const int num_16x16_blocks_wide_lookup[BLOCK_SIZES] = - {1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 4, 4}; -const int num_16x16_blocks_high_lookup[BLOCK_SIZES] = - {1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 4, 2, 4}; -const int qindex_skip_threshold_lookup[BLOCK_SIZES] = - {0, 10, 10, 30, 40, 40, 60, 80, 80, 90, 100, 100, 120}; -const int qindex_split_threshold_lookup[BLOCK_SIZES] = - {0, 3, 3, 7, 15, 15, 30, 40, 40, 60, 80, 80, 120}; -const int complexity_16x16_blocks_threshold[BLOCK_SIZES] = - {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 6}; - -typedef enum { - MV_ZERO = 0, - MV_LEFT = 1, - MV_UP = 2, - MV_RIGHT = 3, - MV_DOWN = 4, - MV_INVALID -} MOTION_DIRECTION; - -static INLINE MOTION_DIRECTION get_motion_direction_fp(uint8_t fp_byte) { - if (fp_byte & FPMB_MOTION_ZERO_MASK) { - return MV_ZERO; - } else if (fp_byte & FPMB_MOTION_LEFT_MASK) { - return MV_LEFT; - } else if (fp_byte & FPMB_MOTION_RIGHT_MASK) { - return MV_RIGHT; - } else if (fp_byte & FPMB_MOTION_UP_MASK) { - return MV_UP; - } else { - return MV_DOWN; - } -} - -static INLINE int get_motion_inconsistency(MOTION_DIRECTION this_mv, - MOTION_DIRECTION that_mv) { - if (this_mv == that_mv) { - return 0; - } else { - return abs(this_mv - that_mv) == 2 ? 2 : 1; - } -} -#endif - -// TODO(jingning,jimbankoski,rbultje): properly skip partition types that are -// unlikely to be selected depending on previous rate-distortion optimization -// results, for encoding speed-up. -static void rd_pick_partition(VP9_COMP *cpi, ThreadData *td, - TileDataEnc *tile_data, - TOKENEXTRA **tp, int mi_row, int mi_col, - BLOCK_SIZE bsize, RD_COST *rd_cost, - int64_t best_rd, PC_TREE *pc_tree) { - VP9_COMMON *const cm = &cpi->common; - TileInfo *const tile_info = &tile_data->tile_info; - MACROBLOCK *const x = &td->mb; - MACROBLOCKD *const xd = &x->e_mbd; - const int mi_step = num_8x8_blocks_wide_lookup[bsize] / 2; - ENTROPY_CONTEXT l[16 * MAX_MB_PLANE], a[16 * MAX_MB_PLANE]; - PARTITION_CONTEXT sl[8], sa[8]; - TOKENEXTRA *tp_orig = *tp; - PICK_MODE_CONTEXT *ctx = &pc_tree->none; - int i, pl; - BLOCK_SIZE subsize; - RD_COST this_rdc, sum_rdc, best_rdc; - int do_split = bsize >= BLOCK_8X8; - int do_rect = 1; - - // Override skipping rectangular partition operations for edge blocks - const int force_horz_split = (mi_row + mi_step >= cm->mi_rows); - const int force_vert_split = (mi_col + mi_step >= cm->mi_cols); - const int xss = x->e_mbd.plane[1].subsampling_x; - const int yss = x->e_mbd.plane[1].subsampling_y; - - BLOCK_SIZE min_size = x->min_partition_size; - BLOCK_SIZE max_size = x->max_partition_size; - -#if CONFIG_FP_MB_STATS - unsigned int src_diff_var = UINT_MAX; - int none_complexity = 0; -#endif - - int partition_none_allowed = !force_horz_split && !force_vert_split; - int partition_horz_allowed = !force_vert_split && yss <= xss && - bsize >= BLOCK_8X8; - int partition_vert_allowed = !force_horz_split && xss <= yss && - bsize >= BLOCK_8X8; - (void) *tp_orig; - - assert(num_8x8_blocks_wide_lookup[bsize] == - num_8x8_blocks_high_lookup[bsize]); - - vp9_rd_cost_init(&this_rdc); - vp9_rd_cost_init(&sum_rdc); - vp9_rd_cost_reset(&best_rdc); - best_rdc.rdcost = best_rd; - - set_offsets(cpi, tile_info, x, mi_row, mi_col, bsize); - - if (bsize == BLOCK_16X16 && cpi->oxcf.aq_mode) - x->mb_energy = vp9_block_energy(cpi, x, bsize); - - if (cpi->sf.cb_partition_search && bsize == BLOCK_16X16) { - int cb_partition_search_ctrl = ((pc_tree->index == 0 || pc_tree->index == 3) - + get_chessboard_index(cm->current_video_frame)) & 0x1; - - if (cb_partition_search_ctrl && bsize > min_size && bsize < max_size) - set_partition_range(cm, xd, mi_row, mi_col, bsize, &min_size, &max_size); - } - - // Determine partition types in search according to the speed features. - // The threshold set here has to be of square block size. - if (cpi->sf.auto_min_max_partition_size) { - partition_none_allowed &= (bsize <= max_size && bsize >= min_size); - partition_horz_allowed &= ((bsize <= max_size && bsize > min_size) || - force_horz_split); - partition_vert_allowed &= ((bsize <= max_size && bsize > min_size) || - force_vert_split); - do_split &= bsize > min_size; - } - if (cpi->sf.use_square_partition_only) { - partition_horz_allowed &= force_horz_split; - partition_vert_allowed &= force_vert_split; - } - - save_context(x, mi_row, mi_col, a, l, sa, sl, bsize); - -#if CONFIG_FP_MB_STATS - if (cpi->use_fp_mb_stats) { - set_offsets(cpi, tile_info, x, mi_row, mi_col, bsize); - src_diff_var = get_sby_perpixel_diff_variance(cpi, &x->plane[0].src, - mi_row, mi_col, bsize); - } -#endif - -#if CONFIG_FP_MB_STATS - // Decide whether we shall split directly and skip searching NONE by using - // the first pass block statistics - if (cpi->use_fp_mb_stats && bsize >= BLOCK_32X32 && do_split && - partition_none_allowed && src_diff_var > 4 && - cm->base_qindex < qindex_split_threshold_lookup[bsize]) { - int mb_row = mi_row >> 1; - int mb_col = mi_col >> 1; - int mb_row_end = - MIN(mb_row + num_16x16_blocks_high_lookup[bsize], cm->mb_rows); - int mb_col_end = - MIN(mb_col + num_16x16_blocks_wide_lookup[bsize], cm->mb_cols); - int r, c; - - // compute a complexity measure, basically measure inconsistency of motion - // vectors obtained from the first pass in the current block - for (r = mb_row; r < mb_row_end ; r++) { - for (c = mb_col; c < mb_col_end; c++) { - const int mb_index = r * cm->mb_cols + c; - - MOTION_DIRECTION this_mv; - MOTION_DIRECTION right_mv; - MOTION_DIRECTION bottom_mv; - - this_mv = - get_motion_direction_fp(cpi->twopass.this_frame_mb_stats[mb_index]); - - // to its right - if (c != mb_col_end - 1) { - right_mv = get_motion_direction_fp( - cpi->twopass.this_frame_mb_stats[mb_index + 1]); - none_complexity += get_motion_inconsistency(this_mv, right_mv); - } - - // to its bottom - if (r != mb_row_end - 1) { - bottom_mv = get_motion_direction_fp( - cpi->twopass.this_frame_mb_stats[mb_index + cm->mb_cols]); - none_complexity += get_motion_inconsistency(this_mv, bottom_mv); - } - - // do not count its left and top neighbors to avoid double counting - } - } - - if (none_complexity > complexity_16x16_blocks_threshold[bsize]) { - partition_none_allowed = 0; - } - } -#endif - - // PARTITION_NONE - if (partition_none_allowed) { - rd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, - &this_rdc, bsize, ctx, best_rdc.rdcost); - if (this_rdc.rate != INT_MAX) { - if (bsize >= BLOCK_8X8) { - pl = partition_plane_context(xd, mi_row, mi_col, bsize); - this_rdc.rate += cpi->partition_cost[pl][PARTITION_NONE]; - this_rdc.rdcost = RDCOST(x->rdmult, x->rddiv, - this_rdc.rate, this_rdc.dist); - } - - if (this_rdc.rdcost < best_rdc.rdcost) { - int64_t dist_breakout_thr = cpi->sf.partition_search_breakout_dist_thr; - int rate_breakout_thr = cpi->sf.partition_search_breakout_rate_thr; - - best_rdc = this_rdc; - if (bsize >= BLOCK_8X8) - pc_tree->partitioning = PARTITION_NONE; - - // Adjust dist breakout threshold according to the partition size. - dist_breakout_thr >>= 8 - (b_width_log2_lookup[bsize] + - b_height_log2_lookup[bsize]); - - rate_breakout_thr *= num_pels_log2_lookup[bsize]; - - // If all y, u, v transform blocks in this partition are skippable, and - // the dist & rate are within the thresholds, the partition search is - // terminated for current branch of the partition search tree. - // The dist & rate thresholds are set to 0 at speed 0 to disable the - // early termination at that speed. - if (!x->e_mbd.lossless && - (ctx->skippable && best_rdc.dist < dist_breakout_thr && - best_rdc.rate < rate_breakout_thr)) { - do_split = 0; - do_rect = 0; - } - -#if CONFIG_FP_MB_STATS - // Check if every 16x16 first pass block statistics has zero - // motion and the corresponding first pass residue is small enough. - // If that is the case, check the difference variance between the - // current frame and the last frame. If the variance is small enough, - // stop further splitting in RD optimization - if (cpi->use_fp_mb_stats && do_split != 0 && - cm->base_qindex > qindex_skip_threshold_lookup[bsize]) { - int mb_row = mi_row >> 1; - int mb_col = mi_col >> 1; - int mb_row_end = - MIN(mb_row + num_16x16_blocks_high_lookup[bsize], cm->mb_rows); - int mb_col_end = - MIN(mb_col + num_16x16_blocks_wide_lookup[bsize], cm->mb_cols); - int r, c; - - int skip = 1; - for (r = mb_row; r < mb_row_end; r++) { - for (c = mb_col; c < mb_col_end; c++) { - const int mb_index = r * cm->mb_cols + c; - if (!(cpi->twopass.this_frame_mb_stats[mb_index] & - FPMB_MOTION_ZERO_MASK) || - !(cpi->twopass.this_frame_mb_stats[mb_index] & - FPMB_ERROR_SMALL_MASK)) { - skip = 0; - break; - } - } - if (skip == 0) { - break; - } - } - if (skip) { - if (src_diff_var == UINT_MAX) { - set_offsets(cpi, tile_info, x, mi_row, mi_col, bsize); - src_diff_var = get_sby_perpixel_diff_variance( - cpi, &x->plane[0].src, mi_row, mi_col, bsize); - } - if (src_diff_var < 8) { - do_split = 0; - do_rect = 0; - } - } - } -#endif - } - } - restore_context(x, mi_row, mi_col, a, l, sa, sl, bsize); - } - - // store estimated motion vector - if (cpi->sf.adaptive_motion_search) - store_pred_mv(x, ctx); - - // PARTITION_SPLIT - // TODO(jingning): use the motion vectors given by the above search as - // the starting point of motion search in the following partition type check. - if (do_split) { - subsize = get_subsize(bsize, PARTITION_SPLIT); - if (bsize == BLOCK_8X8) { - i = 4; - if (cpi->sf.adaptive_pred_interp_filter && partition_none_allowed) - pc_tree->leaf_split[0]->pred_interp_filter = - ctx->mic.mbmi.interp_filter; - rd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, &sum_rdc, subsize, - pc_tree->leaf_split[0], best_rdc.rdcost); - if (sum_rdc.rate == INT_MAX) - sum_rdc.rdcost = INT64_MAX; - } else { - for (i = 0; i < 4 && sum_rdc.rdcost < best_rdc.rdcost; ++i) { - const int x_idx = (i & 1) * mi_step; - const int y_idx = (i >> 1) * mi_step; - - if (mi_row + y_idx >= cm->mi_rows || mi_col + x_idx >= cm->mi_cols) - continue; - - if (cpi->sf.adaptive_motion_search) - load_pred_mv(x, ctx); - - pc_tree->split[i]->index = i; - rd_pick_partition(cpi, td, tile_data, tp, - mi_row + y_idx, mi_col + x_idx, - subsize, &this_rdc, - best_rdc.rdcost - sum_rdc.rdcost, pc_tree->split[i]); - - if (this_rdc.rate == INT_MAX) { - sum_rdc.rdcost = INT64_MAX; - break; - } else { - sum_rdc.rate += this_rdc.rate; - sum_rdc.dist += this_rdc.dist; - sum_rdc.rdcost += this_rdc.rdcost; - } - } - } - - if (sum_rdc.rdcost < best_rdc.rdcost && i == 4) { - pl = partition_plane_context(xd, mi_row, mi_col, bsize); - sum_rdc.rate += cpi->partition_cost[pl][PARTITION_SPLIT]; - sum_rdc.rdcost = RDCOST(x->rdmult, x->rddiv, - sum_rdc.rate, sum_rdc.dist); - - if (sum_rdc.rdcost < best_rdc.rdcost) { - best_rdc = sum_rdc; - pc_tree->partitioning = PARTITION_SPLIT; - } - } else { - // skip rectangular partition test when larger block size - // gives better rd cost - if (cpi->sf.less_rectangular_check) - do_rect &= !partition_none_allowed; - } - restore_context(x, mi_row, mi_col, a, l, sa, sl, bsize); - } - - // PARTITION_HORZ - if (partition_horz_allowed && do_rect) { - subsize = get_subsize(bsize, PARTITION_HORZ); - if (cpi->sf.adaptive_motion_search) - load_pred_mv(x, ctx); - if (cpi->sf.adaptive_pred_interp_filter && bsize == BLOCK_8X8 && - partition_none_allowed) - pc_tree->horizontal[0].pred_interp_filter = - ctx->mic.mbmi.interp_filter; - rd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, &sum_rdc, subsize, - &pc_tree->horizontal[0], best_rdc.rdcost); - - if (sum_rdc.rdcost < best_rdc.rdcost && mi_row + mi_step < cm->mi_rows && - bsize > BLOCK_8X8) { - PICK_MODE_CONTEXT *ctx = &pc_tree->horizontal[0]; - update_state(cpi, td, ctx, mi_row, mi_col, subsize, 0); - encode_superblock(cpi, td, tp, 0, mi_row, mi_col, subsize, ctx); - - if (cpi->sf.adaptive_motion_search) - load_pred_mv(x, ctx); - if (cpi->sf.adaptive_pred_interp_filter && bsize == BLOCK_8X8 && - partition_none_allowed) - pc_tree->horizontal[1].pred_interp_filter = - ctx->mic.mbmi.interp_filter; - rd_pick_sb_modes(cpi, tile_data, x, mi_row + mi_step, mi_col, - &this_rdc, subsize, &pc_tree->horizontal[1], - best_rdc.rdcost - sum_rdc.rdcost); - if (this_rdc.rate == INT_MAX) { - sum_rdc.rdcost = INT64_MAX; - } else { - sum_rdc.rate += this_rdc.rate; - sum_rdc.dist += this_rdc.dist; - sum_rdc.rdcost += this_rdc.rdcost; - } - } - - if (sum_rdc.rdcost < best_rdc.rdcost) { - pl = partition_plane_context(xd, mi_row, mi_col, bsize); - sum_rdc.rate += cpi->partition_cost[pl][PARTITION_HORZ]; - sum_rdc.rdcost = RDCOST(x->rdmult, x->rddiv, sum_rdc.rate, sum_rdc.dist); - if (sum_rdc.rdcost < best_rdc.rdcost) { - best_rdc = sum_rdc; - pc_tree->partitioning = PARTITION_HORZ; - } - } - restore_context(x, mi_row, mi_col, a, l, sa, sl, bsize); - } - // PARTITION_VERT - if (partition_vert_allowed && do_rect) { - subsize = get_subsize(bsize, PARTITION_VERT); - - if (cpi->sf.adaptive_motion_search) - load_pred_mv(x, ctx); - if (cpi->sf.adaptive_pred_interp_filter && bsize == BLOCK_8X8 && - partition_none_allowed) - pc_tree->vertical[0].pred_interp_filter = - ctx->mic.mbmi.interp_filter; - rd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, &sum_rdc, subsize, - &pc_tree->vertical[0], best_rdc.rdcost); - if (sum_rdc.rdcost < best_rdc.rdcost && mi_col + mi_step < cm->mi_cols && - bsize > BLOCK_8X8) { - update_state(cpi, td, &pc_tree->vertical[0], mi_row, mi_col, subsize, 0); - encode_superblock(cpi, td, tp, 0, mi_row, mi_col, subsize, - &pc_tree->vertical[0]); - - if (cpi->sf.adaptive_motion_search) - load_pred_mv(x, ctx); - if (cpi->sf.adaptive_pred_interp_filter && bsize == BLOCK_8X8 && - partition_none_allowed) - pc_tree->vertical[1].pred_interp_filter = - ctx->mic.mbmi.interp_filter; - rd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col + mi_step, - &this_rdc, subsize, - &pc_tree->vertical[1], best_rdc.rdcost - sum_rdc.rdcost); - if (this_rdc.rate == INT_MAX) { - sum_rdc.rdcost = INT64_MAX; - } else { - sum_rdc.rate += this_rdc.rate; - sum_rdc.dist += this_rdc.dist; - sum_rdc.rdcost += this_rdc.rdcost; - } - } - - if (sum_rdc.rdcost < best_rdc.rdcost) { - pl = partition_plane_context(xd, mi_row, mi_col, bsize); - sum_rdc.rate += cpi->partition_cost[pl][PARTITION_VERT]; - sum_rdc.rdcost = RDCOST(x->rdmult, x->rddiv, - sum_rdc.rate, sum_rdc.dist); - if (sum_rdc.rdcost < best_rdc.rdcost) { - best_rdc = sum_rdc; - pc_tree->partitioning = PARTITION_VERT; - } - } - restore_context(x, mi_row, mi_col, a, l, sa, sl, bsize); - } - - // TODO(jbb): This code added so that we avoid static analysis - // warning related to the fact that best_rd isn't used after this - // point. This code should be refactored so that the duplicate - // checks occur in some sub function and thus are used... - (void) best_rd; - *rd_cost = best_rdc; - - - if (best_rdc.rate < INT_MAX && best_rdc.dist < INT64_MAX && - pc_tree->index != 3) { - int output_enabled = (bsize == BLOCK_64X64); - encode_sb(cpi, td, tile_info, tp, mi_row, mi_col, output_enabled, - bsize, pc_tree); - } - - if (bsize == BLOCK_64X64) { - assert(tp_orig < *tp); - assert(best_rdc.rate < INT_MAX); - assert(best_rdc.dist < INT64_MAX); - } else { - assert(tp_orig == *tp); - } -} - -static void encode_rd_sb_row(VP9_COMP *cpi, - ThreadData *td, - TileDataEnc *tile_data, - int mi_row, - TOKENEXTRA **tp) { - VP9_COMMON *const cm = &cpi->common; - TileInfo *const tile_info = &tile_data->tile_info; - MACROBLOCK *const x = &td->mb; - MACROBLOCKD *const xd = &x->e_mbd; - SPEED_FEATURES *const sf = &cpi->sf; - int mi_col; - - // Initialize the left context for the new SB row - vpx_memset(&xd->left_context, 0, sizeof(xd->left_context)); - vpx_memset(xd->left_seg_context, 0, sizeof(xd->left_seg_context)); - - // Code each SB in the row - for (mi_col = tile_info->mi_col_start; mi_col < tile_info->mi_col_end; - mi_col += MI_BLOCK_SIZE) { - const struct segmentation *const seg = &cm->seg; - int dummy_rate; - int64_t dummy_dist; - RD_COST dummy_rdc; - int i; - int seg_skip = 0; - - const int idx_str = cm->mi_stride * mi_row + mi_col; - MODE_INFO *mi = cm->mi + idx_str; - - if (sf->adaptive_pred_interp_filter) { - for (i = 0; i < 64; ++i) - td->leaf_tree[i].pred_interp_filter = SWITCHABLE; - - for (i = 0; i < 64; ++i) { - td->pc_tree[i].vertical[0].pred_interp_filter = SWITCHABLE; - td->pc_tree[i].vertical[1].pred_interp_filter = SWITCHABLE; - td->pc_tree[i].horizontal[0].pred_interp_filter = SWITCHABLE; - td->pc_tree[i].horizontal[1].pred_interp_filter = SWITCHABLE; - } - } - - vp9_zero(x->pred_mv); - td->pc_root->index = 0; - - if (seg->enabled) { - const uint8_t *const map = seg->update_map ? cpi->segmentation_map - : cm->last_frame_seg_map; - int segment_id = vp9_get_segment_id(cm, map, BLOCK_64X64, mi_row, mi_col); - seg_skip = vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP); - } - - x->source_variance = UINT_MAX; - if (sf->partition_search_type == FIXED_PARTITION || seg_skip) { - const BLOCK_SIZE bsize = - seg_skip ? BLOCK_64X64 : sf->always_this_block_size; - set_offsets(cpi, tile_info, x, mi_row, mi_col, BLOCK_64X64); - set_fixed_partitioning(cpi, tile_info, mi, mi_row, mi_col, bsize); - rd_use_partition(cpi, td, tile_data, mi, tp, mi_row, mi_col, - BLOCK_64X64, &dummy_rate, &dummy_dist, 1, td->pc_root); - } else if (cpi->partition_search_skippable_frame) { - BLOCK_SIZE bsize; - set_offsets(cpi, tile_info, x, mi_row, mi_col, BLOCK_64X64); - bsize = get_rd_var_based_fixed_partition(cpi, x, mi_row, mi_col); - set_fixed_partitioning(cpi, tile_info, mi, mi_row, mi_col, bsize); - rd_use_partition(cpi, td, tile_data, mi, tp, mi_row, mi_col, - BLOCK_64X64, &dummy_rate, &dummy_dist, 1, td->pc_root); - } else if (sf->partition_search_type == VAR_BASED_PARTITION && - cm->frame_type != KEY_FRAME) { - choose_partitioning(cpi, tile_info, x, mi_row, mi_col); - rd_use_partition(cpi, td, tile_data, mi, tp, mi_row, mi_col, - BLOCK_64X64, &dummy_rate, &dummy_dist, 1, td->pc_root); - } else { - // If required set upper and lower partition size limits - if (sf->auto_min_max_partition_size) { - set_offsets(cpi, tile_info, x, mi_row, mi_col, BLOCK_64X64); - rd_auto_partition_range(cpi, tile_info, xd, mi_row, mi_col, - &x->min_partition_size, - &x->max_partition_size); - } - rd_pick_partition(cpi, td, tile_data, tp, mi_row, mi_col, BLOCK_64X64, - &dummy_rdc, INT64_MAX, td->pc_root); - } - } -} - -static void init_encode_frame_mb_context(VP9_COMP *cpi) { - MACROBLOCK *const x = &cpi->td.mb; - VP9_COMMON *const cm = &cpi->common; - MACROBLOCKD *const xd = &x->e_mbd; - const int aligned_mi_cols = mi_cols_aligned_to_sb(cm->mi_cols); - - // Copy data over into macro block data structures. - vp9_setup_src_planes(x, cpi->Source, 0, 0); - - vp9_setup_block_planes(&x->e_mbd, cm->subsampling_x, cm->subsampling_y); - - // Note: this memset assumes above_context[0], [1] and [2] - // are allocated as part of the same buffer. - vpx_memset(xd->above_context[0], 0, - sizeof(*xd->above_context[0]) * - 2 * aligned_mi_cols * MAX_MB_PLANE); - vpx_memset(xd->above_seg_context, 0, - sizeof(*xd->above_seg_context) * aligned_mi_cols); -} - -static int check_dual_ref_flags(VP9_COMP *cpi) { - const int ref_flags = cpi->ref_frame_flags; - - if (vp9_segfeature_active(&cpi->common.seg, 1, SEG_LVL_REF_FRAME)) { - return 0; - } else { - return (!!(ref_flags & VP9_GOLD_FLAG) + !!(ref_flags & VP9_LAST_FLAG) - + !!(ref_flags & VP9_ALT_FLAG)) >= 2; - } -} - -static void reset_skip_tx_size(VP9_COMMON *cm, TX_SIZE max_tx_size) { - int mi_row, mi_col; - const int mis = cm->mi_stride; - MODE_INFO *mi_ptr = cm->mi; - - for (mi_row = 0; mi_row < cm->mi_rows; ++mi_row, mi_ptr += mis) { - for (mi_col = 0; mi_col < cm->mi_cols; ++mi_col) { - if (mi_ptr[mi_col].src_mi->mbmi.tx_size > max_tx_size) - mi_ptr[mi_col].src_mi->mbmi.tx_size = max_tx_size; - } - } -} - -static MV_REFERENCE_FRAME get_frame_type(const VP9_COMP *cpi) { - if (frame_is_intra_only(&cpi->common)) - return INTRA_FRAME; - else if (cpi->rc.is_src_frame_alt_ref && cpi->refresh_golden_frame) - return ALTREF_FRAME; - else if (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame) - return GOLDEN_FRAME; - else - return LAST_FRAME; -} - -static TX_MODE select_tx_mode(const VP9_COMP *cpi, MACROBLOCKD *const xd) { - if (xd->lossless) - return ONLY_4X4; - if (cpi->common.frame_type == KEY_FRAME && - cpi->sf.use_nonrd_pick_mode && - cpi->sf.partition_search_type == VAR_BASED_PARTITION) - return ALLOW_16X16; - if (cpi->sf.tx_size_search_method == USE_LARGESTALL) - return ALLOW_32X32; - else if (cpi->sf.tx_size_search_method == USE_FULL_RD|| - cpi->sf.tx_size_search_method == USE_TX_8X8) - return TX_MODE_SELECT; - else - return cpi->common.tx_mode; -} - -static void hybrid_intra_mode_search(VP9_COMP *cpi, MACROBLOCK *const x, - RD_COST *rd_cost, BLOCK_SIZE bsize, - PICK_MODE_CONTEXT *ctx) { - if (bsize < BLOCK_16X16) - vp9_rd_pick_intra_mode_sb(cpi, x, rd_cost, bsize, ctx, INT64_MAX); - else - vp9_pick_intra_mode(cpi, x, rd_cost, bsize, ctx); -} - -static void nonrd_pick_sb_modes(VP9_COMP *cpi, - TileDataEnc *tile_data, MACROBLOCK *const x, - int mi_row, int mi_col, RD_COST *rd_cost, - BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx) { - VP9_COMMON *const cm = &cpi->common; - TileInfo *const tile_info = &tile_data->tile_info; - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *mbmi; - set_offsets(cpi, tile_info, x, mi_row, mi_col, bsize); - mbmi = &xd->mi[0].src_mi->mbmi; - mbmi->sb_type = bsize; - - if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && cm->seg.enabled) - if (mbmi->segment_id) - x->rdmult = vp9_cyclic_refresh_get_rdmult(cpi->cyclic_refresh); - - if (cm->frame_type == KEY_FRAME) - hybrid_intra_mode_search(cpi, x, rd_cost, bsize, ctx); - else if (vp9_segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP)) - set_mode_info_seg_skip(x, cm->tx_mode, rd_cost, bsize); - else if (bsize >= BLOCK_8X8) - vp9_pick_inter_mode(cpi, x, tile_data, mi_row, mi_col, - rd_cost, bsize, ctx); - else - vp9_pick_inter_mode_sub8x8(cpi, x, tile_data, mi_row, mi_col, - rd_cost, bsize, ctx); - - duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col, bsize); - - if (rd_cost->rate == INT_MAX) - vp9_rd_cost_reset(rd_cost); - - ctx->rate = rd_cost->rate; - ctx->dist = rd_cost->dist; -} - -static void fill_mode_info_sb(VP9_COMMON *cm, MACROBLOCK *x, - int mi_row, int mi_col, - BLOCK_SIZE bsize, - PC_TREE *pc_tree) { - MACROBLOCKD *xd = &x->e_mbd; - int bsl = b_width_log2_lookup[bsize], hbs = (1 << bsl) / 4; - PARTITION_TYPE partition = pc_tree->partitioning; - BLOCK_SIZE subsize = get_subsize(bsize, partition); - - assert(bsize >= BLOCK_8X8); - - if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) - return; - - switch (partition) { - case PARTITION_NONE: - set_mode_info_offsets(cm, xd, mi_row, mi_col); - *(xd->mi[0].src_mi) = pc_tree->none.mic; - duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col, bsize); - break; - case PARTITION_VERT: - set_mode_info_offsets(cm, xd, mi_row, mi_col); - *(xd->mi[0].src_mi) = pc_tree->vertical[0].mic; - duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col, subsize); - - if (mi_col + hbs < cm->mi_cols) { - set_mode_info_offsets(cm, xd, mi_row, mi_col + hbs); - *(xd->mi[0].src_mi) = pc_tree->vertical[1].mic; - duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col + hbs, subsize); - } - break; - case PARTITION_HORZ: - set_mode_info_offsets(cm, xd, mi_row, mi_col); - *(xd->mi[0].src_mi) = pc_tree->horizontal[0].mic; - duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col, subsize); - if (mi_row + hbs < cm->mi_rows) { - set_mode_info_offsets(cm, xd, mi_row + hbs, mi_col); - *(xd->mi[0].src_mi) = pc_tree->horizontal[1].mic; - duplicate_mode_info_in_sb(cm, xd, mi_row + hbs, mi_col, subsize); - } - break; - case PARTITION_SPLIT: { - fill_mode_info_sb(cm, x, mi_row, mi_col, subsize, pc_tree->split[0]); - fill_mode_info_sb(cm, x, mi_row, mi_col + hbs, subsize, - pc_tree->split[1]); - fill_mode_info_sb(cm, x, mi_row + hbs, mi_col, subsize, - pc_tree->split[2]); - fill_mode_info_sb(cm, x, mi_row + hbs, mi_col + hbs, subsize, - pc_tree->split[3]); - break; - } - default: - break; - } -} - -// Reset the prediction pixel ready flag recursively. -static void pred_pixel_ready_reset(PC_TREE *pc_tree, BLOCK_SIZE bsize) { - pc_tree->none.pred_pixel_ready = 0; - pc_tree->horizontal[0].pred_pixel_ready = 0; - pc_tree->horizontal[1].pred_pixel_ready = 0; - pc_tree->vertical[0].pred_pixel_ready = 0; - pc_tree->vertical[1].pred_pixel_ready = 0; - - if (bsize > BLOCK_8X8) { - BLOCK_SIZE subsize = get_subsize(bsize, PARTITION_SPLIT); - int i; - for (i = 0; i < 4; ++i) - pred_pixel_ready_reset(pc_tree->split[i], subsize); - } -} - -static void nonrd_pick_partition(VP9_COMP *cpi, ThreadData *td, - TileDataEnc *tile_data, - TOKENEXTRA **tp, int mi_row, - int mi_col, BLOCK_SIZE bsize, RD_COST *rd_cost, - int do_recon, int64_t best_rd, - PC_TREE *pc_tree) { - const SPEED_FEATURES *const sf = &cpi->sf; - VP9_COMMON *const cm = &cpi->common; - TileInfo *const tile_info = &tile_data->tile_info; - MACROBLOCK *const x = &td->mb; - MACROBLOCKD *const xd = &x->e_mbd; - const int ms = num_8x8_blocks_wide_lookup[bsize] / 2; - TOKENEXTRA *tp_orig = *tp; - PICK_MODE_CONTEXT *ctx = &pc_tree->none; - int i; - BLOCK_SIZE subsize = bsize; - RD_COST this_rdc, sum_rdc, best_rdc; - int do_split = bsize >= BLOCK_8X8; - int do_rect = 1; - // Override skipping rectangular partition operations for edge blocks - const int force_horz_split = (mi_row + ms >= cm->mi_rows); - const int force_vert_split = (mi_col + ms >= cm->mi_cols); - const int xss = x->e_mbd.plane[1].subsampling_x; - const int yss = x->e_mbd.plane[1].subsampling_y; - - int partition_none_allowed = !force_horz_split && !force_vert_split; - int partition_horz_allowed = !force_vert_split && yss <= xss && - bsize >= BLOCK_8X8; - int partition_vert_allowed = !force_horz_split && xss <= yss && - bsize >= BLOCK_8X8; - (void) *tp_orig; - - assert(num_8x8_blocks_wide_lookup[bsize] == - num_8x8_blocks_high_lookup[bsize]); - - vp9_rd_cost_init(&sum_rdc); - vp9_rd_cost_reset(&best_rdc); - best_rdc.rdcost = best_rd; - - // Determine partition types in search according to the speed features. - // The threshold set here has to be of square block size. - if (sf->auto_min_max_partition_size) { - partition_none_allowed &= (bsize <= x->max_partition_size && - bsize >= x->min_partition_size); - partition_horz_allowed &= ((bsize <= x->max_partition_size && - bsize > x->min_partition_size) || - force_horz_split); - partition_vert_allowed &= ((bsize <= x->max_partition_size && - bsize > x->min_partition_size) || - force_vert_split); - do_split &= bsize > x->min_partition_size; - } - if (sf->use_square_partition_only) { - partition_horz_allowed &= force_horz_split; - partition_vert_allowed &= force_vert_split; - } - - ctx->pred_pixel_ready = !(partition_vert_allowed || - partition_horz_allowed || - do_split); - - // PARTITION_NONE - if (partition_none_allowed) { - nonrd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, - &this_rdc, bsize, ctx); - ctx->mic.mbmi = xd->mi[0].src_mi->mbmi; - ctx->skip_txfm[0] = x->skip_txfm[0]; - ctx->skip = x->skip; - - if (this_rdc.rate != INT_MAX) { - int pl = partition_plane_context(xd, mi_row, mi_col, bsize); - this_rdc.rate += cpi->partition_cost[pl][PARTITION_NONE]; - this_rdc.rdcost = RDCOST(x->rdmult, x->rddiv, - this_rdc.rate, this_rdc.dist); - if (this_rdc.rdcost < best_rdc.rdcost) { - int64_t dist_breakout_thr = sf->partition_search_breakout_dist_thr; - int64_t rate_breakout_thr = sf->partition_search_breakout_rate_thr; - - dist_breakout_thr >>= 8 - (b_width_log2_lookup[bsize] + - b_height_log2_lookup[bsize]); - - rate_breakout_thr *= num_pels_log2_lookup[bsize]; - - best_rdc = this_rdc; - if (bsize >= BLOCK_8X8) - pc_tree->partitioning = PARTITION_NONE; - - if (!x->e_mbd.lossless && - this_rdc.rate < rate_breakout_thr && - this_rdc.dist < dist_breakout_thr) { - do_split = 0; - do_rect = 0; - } - } - } - } - - // store estimated motion vector - store_pred_mv(x, ctx); - - // PARTITION_SPLIT - if (do_split) { - int pl = partition_plane_context(xd, mi_row, mi_col, bsize); - sum_rdc.rate += cpi->partition_cost[pl][PARTITION_SPLIT]; - sum_rdc.rdcost = RDCOST(x->rdmult, x->rddiv, sum_rdc.rate, sum_rdc.dist); - subsize = get_subsize(bsize, PARTITION_SPLIT); - for (i = 0; i < 4 && sum_rdc.rdcost < best_rdc.rdcost; ++i) { - const int x_idx = (i & 1) * ms; - const int y_idx = (i >> 1) * ms; - - if (mi_row + y_idx >= cm->mi_rows || mi_col + x_idx >= cm->mi_cols) - continue; - load_pred_mv(x, ctx); - nonrd_pick_partition(cpi, td, tile_data, tp, - mi_row + y_idx, mi_col + x_idx, - subsize, &this_rdc, 0, - best_rdc.rdcost - sum_rdc.rdcost, pc_tree->split[i]); - - if (this_rdc.rate == INT_MAX) { - vp9_rd_cost_reset(&sum_rdc); - } else { - sum_rdc.rate += this_rdc.rate; - sum_rdc.dist += this_rdc.dist; - sum_rdc.rdcost += this_rdc.rdcost; - } - } - - if (sum_rdc.rdcost < best_rdc.rdcost) { - best_rdc = sum_rdc; - pc_tree->partitioning = PARTITION_SPLIT; - } else { - // skip rectangular partition test when larger block size - // gives better rd cost - if (sf->less_rectangular_check) - do_rect &= !partition_none_allowed; - } - } - - // PARTITION_HORZ - if (partition_horz_allowed && do_rect) { - subsize = get_subsize(bsize, PARTITION_HORZ); - if (sf->adaptive_motion_search) - load_pred_mv(x, ctx); - pc_tree->horizontal[0].pred_pixel_ready = 1; - nonrd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, &sum_rdc, subsize, - &pc_tree->horizontal[0]); - - pc_tree->horizontal[0].mic.mbmi = xd->mi[0].src_mi->mbmi; - pc_tree->horizontal[0].skip_txfm[0] = x->skip_txfm[0]; - pc_tree->horizontal[0].skip = x->skip; - - if (sum_rdc.rdcost < best_rdc.rdcost && mi_row + ms < cm->mi_rows) { - load_pred_mv(x, ctx); - pc_tree->horizontal[1].pred_pixel_ready = 1; - nonrd_pick_sb_modes(cpi, tile_data, x, mi_row + ms, mi_col, - &this_rdc, subsize, - &pc_tree->horizontal[1]); - - pc_tree->horizontal[1].mic.mbmi = xd->mi[0].src_mi->mbmi; - pc_tree->horizontal[1].skip_txfm[0] = x->skip_txfm[0]; - pc_tree->horizontal[1].skip = x->skip; - - if (this_rdc.rate == INT_MAX) { - vp9_rd_cost_reset(&sum_rdc); - } else { - int pl = partition_plane_context(xd, mi_row, mi_col, bsize); - this_rdc.rate += cpi->partition_cost[pl][PARTITION_HORZ]; - sum_rdc.rate += this_rdc.rate; - sum_rdc.dist += this_rdc.dist; - sum_rdc.rdcost = RDCOST(x->rdmult, x->rddiv, - sum_rdc.rate, sum_rdc.dist); - } - } - - if (sum_rdc.rdcost < best_rdc.rdcost) { - best_rdc = sum_rdc; - pc_tree->partitioning = PARTITION_HORZ; - } else { - pred_pixel_ready_reset(pc_tree, bsize); - } - } - - // PARTITION_VERT - if (partition_vert_allowed && do_rect) { - subsize = get_subsize(bsize, PARTITION_VERT); - if (sf->adaptive_motion_search) - load_pred_mv(x, ctx); - pc_tree->vertical[0].pred_pixel_ready = 1; - nonrd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, &sum_rdc, subsize, - &pc_tree->vertical[0]); - pc_tree->vertical[0].mic.mbmi = xd->mi[0].src_mi->mbmi; - pc_tree->vertical[0].skip_txfm[0] = x->skip_txfm[0]; - pc_tree->vertical[0].skip = x->skip; - - if (sum_rdc.rdcost < best_rdc.rdcost && mi_col + ms < cm->mi_cols) { - load_pred_mv(x, ctx); - pc_tree->vertical[1].pred_pixel_ready = 1; - nonrd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col + ms, - &this_rdc, subsize, - &pc_tree->vertical[1]); - pc_tree->vertical[1].mic.mbmi = xd->mi[0].src_mi->mbmi; - pc_tree->vertical[1].skip_txfm[0] = x->skip_txfm[0]; - pc_tree->vertical[1].skip = x->skip; - - if (this_rdc.rate == INT_MAX) { - vp9_rd_cost_reset(&sum_rdc); - } else { - int pl = partition_plane_context(xd, mi_row, mi_col, bsize); - sum_rdc.rate += cpi->partition_cost[pl][PARTITION_VERT]; - sum_rdc.rate += this_rdc.rate; - sum_rdc.dist += this_rdc.dist; - sum_rdc.rdcost = RDCOST(x->rdmult, x->rddiv, - sum_rdc.rate, sum_rdc.dist); - } - } - - if (sum_rdc.rdcost < best_rdc.rdcost) { - best_rdc = sum_rdc; - pc_tree->partitioning = PARTITION_VERT; - } else { - pred_pixel_ready_reset(pc_tree, bsize); - } - } - - *rd_cost = best_rdc; - - if (best_rdc.rate == INT_MAX) { - vp9_rd_cost_reset(rd_cost); - return; - } - - // update mode info array - fill_mode_info_sb(cm, x, mi_row, mi_col, bsize, pc_tree); - - if (best_rdc.rate < INT_MAX && best_rdc.dist < INT64_MAX && do_recon) { - int output_enabled = (bsize == BLOCK_64X64); - encode_sb_rt(cpi, td, tile_info, tp, mi_row, mi_col, output_enabled, - bsize, pc_tree); - } - - if (bsize == BLOCK_64X64 && do_recon) { - assert(tp_orig < *tp); - assert(best_rdc.rate < INT_MAX); - assert(best_rdc.dist < INT64_MAX); - } else { - assert(tp_orig == *tp); - } -} - -static void nonrd_select_partition(VP9_COMP *cpi, - ThreadData *td, - TileDataEnc *tile_data, - MODE_INFO *mi, - TOKENEXTRA **tp, - int mi_row, int mi_col, - BLOCK_SIZE bsize, int output_enabled, - RD_COST *rd_cost, PC_TREE *pc_tree) { - VP9_COMMON *const cm = &cpi->common; - TileInfo *const tile_info = &tile_data->tile_info; - MACROBLOCK *const x = &td->mb; - MACROBLOCKD *const xd = &x->e_mbd; - const int bsl = b_width_log2_lookup[bsize], hbs = (1 << bsl) / 4; - const int mis = cm->mi_stride; - PARTITION_TYPE partition; - BLOCK_SIZE subsize; - RD_COST this_rdc; - - vp9_rd_cost_reset(&this_rdc); - if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) - return; - - subsize = (bsize >= BLOCK_8X8) ? mi[0].src_mi->mbmi.sb_type : BLOCK_4X4; - partition = partition_lookup[bsl][subsize]; - - if (bsize == BLOCK_32X32 && partition != PARTITION_NONE && - subsize >= BLOCK_16X16) { - x->max_partition_size = BLOCK_32X32; - x->min_partition_size = BLOCK_8X8; - nonrd_pick_partition(cpi, td, tile_data, tp, mi_row, mi_col, bsize, - rd_cost, 0, INT64_MAX, pc_tree); - } else if (bsize == BLOCK_16X16 && partition != PARTITION_NONE) { - x->max_partition_size = BLOCK_16X16; - x->min_partition_size = BLOCK_8X8; - nonrd_pick_partition(cpi, td, tile_data, tp, mi_row, mi_col, bsize, - rd_cost, 0, INT64_MAX, pc_tree); - } else { - switch (partition) { - case PARTITION_NONE: - pc_tree->none.pred_pixel_ready = 1; - nonrd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, rd_cost, - subsize, &pc_tree->none); - pc_tree->none.mic.mbmi = xd->mi[0].src_mi->mbmi; - pc_tree->none.skip_txfm[0] = x->skip_txfm[0]; - pc_tree->none.skip = x->skip; - break; - case PARTITION_VERT: - pc_tree->vertical[0].pred_pixel_ready = 1; - nonrd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, rd_cost, - subsize, &pc_tree->vertical[0]); - pc_tree->vertical[0].mic.mbmi = xd->mi[0].src_mi->mbmi; - pc_tree->vertical[0].skip_txfm[0] = x->skip_txfm[0]; - pc_tree->vertical[0].skip = x->skip; - if (mi_col + hbs < cm->mi_cols) { - pc_tree->vertical[1].pred_pixel_ready = 1; - nonrd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col + hbs, - &this_rdc, subsize, &pc_tree->vertical[1]); - pc_tree->vertical[1].mic.mbmi = xd->mi[0].src_mi->mbmi; - pc_tree->vertical[1].skip_txfm[0] = x->skip_txfm[0]; - pc_tree->vertical[1].skip = x->skip; - if (this_rdc.rate != INT_MAX && this_rdc.dist != INT64_MAX && - rd_cost->rate != INT_MAX && rd_cost->dist != INT64_MAX) { - rd_cost->rate += this_rdc.rate; - rd_cost->dist += this_rdc.dist; - } - } - break; - case PARTITION_HORZ: - pc_tree->horizontal[0].pred_pixel_ready = 1; - nonrd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, rd_cost, - subsize, &pc_tree->horizontal[0]); - pc_tree->horizontal[0].mic.mbmi = xd->mi[0].src_mi->mbmi; - pc_tree->horizontal[0].skip_txfm[0] = x->skip_txfm[0]; - pc_tree->horizontal[0].skip = x->skip; - if (mi_row + hbs < cm->mi_rows) { - pc_tree->horizontal[1].pred_pixel_ready = 1; - nonrd_pick_sb_modes(cpi, tile_data, x, mi_row + hbs, mi_col, - &this_rdc, subsize, &pc_tree->horizontal[1]); - pc_tree->horizontal[1].mic.mbmi = xd->mi[0].src_mi->mbmi; - pc_tree->horizontal[1].skip_txfm[0] = x->skip_txfm[0]; - pc_tree->horizontal[1].skip = x->skip; - if (this_rdc.rate != INT_MAX && this_rdc.dist != INT64_MAX && - rd_cost->rate != INT_MAX && rd_cost->dist != INT64_MAX) { - rd_cost->rate += this_rdc.rate; - rd_cost->dist += this_rdc.dist; - } - } - break; - case PARTITION_SPLIT: - subsize = get_subsize(bsize, PARTITION_SPLIT); - nonrd_select_partition(cpi, td, tile_data, mi, tp, mi_row, mi_col, - subsize, output_enabled, rd_cost, - pc_tree->split[0]); - nonrd_select_partition(cpi, td, tile_data, mi + hbs, tp, - mi_row, mi_col + hbs, subsize, output_enabled, - &this_rdc, pc_tree->split[1]); - if (this_rdc.rate != INT_MAX && this_rdc.dist != INT64_MAX && - rd_cost->rate != INT_MAX && rd_cost->dist != INT64_MAX) { - rd_cost->rate += this_rdc.rate; - rd_cost->dist += this_rdc.dist; - } - nonrd_select_partition(cpi, td, tile_data, mi + hbs * mis, tp, - mi_row + hbs, mi_col, subsize, output_enabled, - &this_rdc, pc_tree->split[2]); - if (this_rdc.rate != INT_MAX && this_rdc.dist != INT64_MAX && - rd_cost->rate != INT_MAX && rd_cost->dist != INT64_MAX) { - rd_cost->rate += this_rdc.rate; - rd_cost->dist += this_rdc.dist; - } - nonrd_select_partition(cpi, td, tile_data, mi + hbs * mis + hbs, tp, - mi_row + hbs, mi_col + hbs, subsize, - output_enabled, &this_rdc, pc_tree->split[3]); - if (this_rdc.rate != INT_MAX && this_rdc.dist != INT64_MAX && - rd_cost->rate != INT_MAX && rd_cost->dist != INT64_MAX) { - rd_cost->rate += this_rdc.rate; - rd_cost->dist += this_rdc.dist; - } - break; - default: - assert(0 && "Invalid partition type."); - break; - } - } - - if (bsize == BLOCK_64X64 && output_enabled) - encode_sb_rt(cpi, td, tile_info, tp, mi_row, mi_col, 1, bsize, pc_tree); -} - - -static void nonrd_use_partition(VP9_COMP *cpi, - ThreadData *td, - TileDataEnc *tile_data, - MODE_INFO *mi, - TOKENEXTRA **tp, - int mi_row, int mi_col, - BLOCK_SIZE bsize, int output_enabled, - RD_COST *dummy_cost, PC_TREE *pc_tree) { - VP9_COMMON *const cm = &cpi->common; - TileInfo *tile_info = &tile_data->tile_info; - MACROBLOCK *const x = &td->mb; - MACROBLOCKD *const xd = &x->e_mbd; - const int bsl = b_width_log2_lookup[bsize], hbs = (1 << bsl) / 4; - const int mis = cm->mi_stride; - PARTITION_TYPE partition; - BLOCK_SIZE subsize; - - if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) - return; - - subsize = (bsize >= BLOCK_8X8) ? mi[0].src_mi->mbmi.sb_type : BLOCK_4X4; - partition = partition_lookup[bsl][subsize]; - - if (output_enabled && bsize != BLOCK_4X4) { - int ctx = partition_plane_context(xd, mi_row, mi_col, bsize); - td->counts->partition[ctx][partition]++; - } - - switch (partition) { - case PARTITION_NONE: - pc_tree->none.pred_pixel_ready = 1; - nonrd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, dummy_cost, - subsize, &pc_tree->none); - pc_tree->none.mic.mbmi = xd->mi[0].src_mi->mbmi; - pc_tree->none.skip_txfm[0] = x->skip_txfm[0]; - pc_tree->none.skip = x->skip; - encode_b_rt(cpi, td, tile_info, tp, mi_row, mi_col, output_enabled, - subsize, &pc_tree->none); - break; - case PARTITION_VERT: - pc_tree->vertical[0].pred_pixel_ready = 1; - nonrd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, dummy_cost, - subsize, &pc_tree->vertical[0]); - pc_tree->vertical[0].mic.mbmi = xd->mi[0].src_mi->mbmi; - pc_tree->vertical[0].skip_txfm[0] = x->skip_txfm[0]; - pc_tree->vertical[0].skip = x->skip; - encode_b_rt(cpi, td, tile_info, tp, mi_row, mi_col, output_enabled, - subsize, &pc_tree->vertical[0]); - if (mi_col + hbs < cm->mi_cols && bsize > BLOCK_8X8) { - pc_tree->vertical[1].pred_pixel_ready = 1; - nonrd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col + hbs, - dummy_cost, subsize, &pc_tree->vertical[1]); - pc_tree->vertical[1].mic.mbmi = xd->mi[0].src_mi->mbmi; - pc_tree->vertical[1].skip_txfm[0] = x->skip_txfm[0]; - pc_tree->vertical[1].skip = x->skip; - encode_b_rt(cpi, td, tile_info, tp, mi_row, mi_col + hbs, - output_enabled, subsize, &pc_tree->vertical[1]); - } - break; - case PARTITION_HORZ: - pc_tree->horizontal[0].pred_pixel_ready = 1; - nonrd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, dummy_cost, - subsize, &pc_tree->horizontal[0]); - pc_tree->horizontal[0].mic.mbmi = xd->mi[0].src_mi->mbmi; - pc_tree->horizontal[0].skip_txfm[0] = x->skip_txfm[0]; - pc_tree->horizontal[0].skip = x->skip; - encode_b_rt(cpi, td, tile_info, tp, mi_row, mi_col, output_enabled, - subsize, &pc_tree->horizontal[0]); - - if (mi_row + hbs < cm->mi_rows && bsize > BLOCK_8X8) { - pc_tree->horizontal[1].pred_pixel_ready = 1; - nonrd_pick_sb_modes(cpi, tile_data, x, mi_row + hbs, mi_col, - dummy_cost, subsize, &pc_tree->horizontal[1]); - pc_tree->horizontal[1].mic.mbmi = xd->mi[0].src_mi->mbmi; - pc_tree->horizontal[1].skip_txfm[0] = x->skip_txfm[0]; - pc_tree->horizontal[1].skip = x->skip; - encode_b_rt(cpi, td, tile_info, tp, mi_row + hbs, mi_col, - output_enabled, subsize, &pc_tree->horizontal[1]); - } - break; - case PARTITION_SPLIT: - subsize = get_subsize(bsize, PARTITION_SPLIT); - if (bsize == BLOCK_8X8) { - nonrd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, dummy_cost, - subsize, pc_tree->leaf_split[0]); - encode_b_rt(cpi, td, tile_info, tp, mi_row, mi_col, - output_enabled, subsize, pc_tree->leaf_split[0]); - } else { - nonrd_use_partition(cpi, td, tile_data, mi, tp, mi_row, mi_col, - subsize, output_enabled, dummy_cost, - pc_tree->split[0]); - nonrd_use_partition(cpi, td, tile_data, mi + hbs, tp, - mi_row, mi_col + hbs, subsize, output_enabled, - dummy_cost, pc_tree->split[1]); - nonrd_use_partition(cpi, td, tile_data, mi + hbs * mis, tp, - mi_row + hbs, mi_col, subsize, output_enabled, - dummy_cost, pc_tree->split[2]); - nonrd_use_partition(cpi, td, tile_data, mi + hbs * mis + hbs, tp, - mi_row + hbs, mi_col + hbs, subsize, output_enabled, - dummy_cost, pc_tree->split[3]); - } - break; - default: - assert(0 && "Invalid partition type."); - break; - } - - if (partition != PARTITION_SPLIT || bsize == BLOCK_8X8) - update_partition_context(xd, mi_row, mi_col, subsize, bsize); -} - -static void encode_nonrd_sb_row(VP9_COMP *cpi, - ThreadData *td, - TileDataEnc *tile_data, - int mi_row, - TOKENEXTRA **tp) { - SPEED_FEATURES *const sf = &cpi->sf; - VP9_COMMON *const cm = &cpi->common; - TileInfo *const tile_info = &tile_data->tile_info; - MACROBLOCK *const x = &td->mb; - MACROBLOCKD *const xd = &x->e_mbd; - int mi_col; - - // Initialize the left context for the new SB row - vpx_memset(&xd->left_context, 0, sizeof(xd->left_context)); - vpx_memset(xd->left_seg_context, 0, sizeof(xd->left_seg_context)); - - // Code each SB in the row - for (mi_col = tile_info->mi_col_start; mi_col < tile_info->mi_col_end; - mi_col += MI_BLOCK_SIZE) { - const struct segmentation *const seg = &cm->seg; - RD_COST dummy_rdc; - const int idx_str = cm->mi_stride * mi_row + mi_col; - MODE_INFO *mi = cm->mi + idx_str; - PARTITION_SEARCH_TYPE partition_search_type = sf->partition_search_type; - BLOCK_SIZE bsize = BLOCK_64X64; - int seg_skip = 0; - x->source_variance = UINT_MAX; - vp9_zero(x->pred_mv); - vp9_rd_cost_init(&dummy_rdc); - x->color_sensitivity[0] = 0; - x->color_sensitivity[1] = 0; - - if (seg->enabled) { - const uint8_t *const map = seg->update_map ? cpi->segmentation_map - : cm->last_frame_seg_map; - int segment_id = vp9_get_segment_id(cm, map, BLOCK_64X64, mi_row, mi_col); - seg_skip = vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP); - if (seg_skip) { - partition_search_type = FIXED_PARTITION; - } - } - - // Set the partition type of the 64X64 block - switch (partition_search_type) { - case VAR_BASED_PARTITION: - // TODO(jingning, marpan): The mode decision and encoding process - // support both intra and inter sub8x8 block coding for RTC mode. - // Tune the thresholds accordingly to use sub8x8 block coding for - // coding performance improvement. - choose_partitioning(cpi, tile_info, x, mi_row, mi_col); - nonrd_use_partition(cpi, td, tile_data, mi, tp, mi_row, mi_col, - BLOCK_64X64, 1, &dummy_rdc, td->pc_root); - break; - case SOURCE_VAR_BASED_PARTITION: - set_source_var_based_partition(cpi, tile_info, x, mi, mi_row, mi_col); - nonrd_use_partition(cpi, td, tile_data, mi, tp, mi_row, mi_col, - BLOCK_64X64, 1, &dummy_rdc, td->pc_root); - break; - case FIXED_PARTITION: - if (!seg_skip) - bsize = sf->always_this_block_size; - set_fixed_partitioning(cpi, tile_info, mi, mi_row, mi_col, bsize); - nonrd_use_partition(cpi, td, tile_data, mi, tp, mi_row, mi_col, - BLOCK_64X64, 1, &dummy_rdc, td->pc_root); - break; - case REFERENCE_PARTITION: - set_offsets(cpi, tile_info, x, mi_row, mi_col, BLOCK_64X64); - if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && cm->seg.enabled && - xd->mi[0].src_mi->mbmi.segment_id) { - x->max_partition_size = BLOCK_64X64; - x->min_partition_size = BLOCK_8X8; - nonrd_pick_partition(cpi, td, tile_data, tp, mi_row, mi_col, - BLOCK_64X64, &dummy_rdc, 1, - INT64_MAX, td->pc_root); - } else { - choose_partitioning(cpi, tile_info, x, mi_row, mi_col); - nonrd_select_partition(cpi, td, tile_data, mi, tp, mi_row, mi_col, - BLOCK_64X64, 1, &dummy_rdc, td->pc_root); - } - - break; - default: - assert(0); - break; - } - } -} -// end RTC play code - -static int set_var_thresh_from_histogram(VP9_COMP *cpi) { - const SPEED_FEATURES *const sf = &cpi->sf; - const VP9_COMMON *const cm = &cpi->common; - - const uint8_t *src = cpi->Source->y_buffer; - const uint8_t *last_src = cpi->Last_Source->y_buffer; - const int src_stride = cpi->Source->y_stride; - const int last_stride = cpi->Last_Source->y_stride; - - // Pick cutoff threshold - const int cutoff = (MIN(cm->width, cm->height) >= 720) ? - (cm->MBs * VAR_HIST_LARGE_CUT_OFF / 100) : - (cm->MBs * VAR_HIST_SMALL_CUT_OFF / 100); - DECLARE_ALIGNED_ARRAY(16, int, hist, VAR_HIST_BINS); - diff *var16 = cpi->source_diff_var; - - int sum = 0; - int i, j; - - vpx_memset(hist, 0, VAR_HIST_BINS * sizeof(hist[0])); - - for (i = 0; i < cm->mb_rows; i++) { - for (j = 0; j < cm->mb_cols; j++) { -#if CONFIG_VP9_HIGHBITDEPTH - if (cm->use_highbitdepth) { - switch (cm->bit_depth) { - case VPX_BITS_8: - vp9_highbd_get16x16var(src, src_stride, last_src, last_stride, - &var16->sse, &var16->sum); - break; - case VPX_BITS_10: - vp9_highbd_10_get16x16var(src, src_stride, last_src, last_stride, - &var16->sse, &var16->sum); - break; - case VPX_BITS_12: - vp9_highbd_12_get16x16var(src, src_stride, last_src, last_stride, - &var16->sse, &var16->sum); - break; - default: - assert(0 && "cm->bit_depth should be VPX_BITS_8, VPX_BITS_10" - " or VPX_BITS_12"); - return -1; - } - } else { - vp9_get16x16var(src, src_stride, last_src, last_stride, - &var16->sse, &var16->sum); - } -#else - vp9_get16x16var(src, src_stride, last_src, last_stride, - &var16->sse, &var16->sum); -#endif // CONFIG_VP9_HIGHBITDEPTH - var16->var = var16->sse - - (((uint32_t)var16->sum * var16->sum) >> 8); - - if (var16->var >= VAR_HIST_MAX_BG_VAR) - hist[VAR_HIST_BINS - 1]++; - else - hist[var16->var / VAR_HIST_FACTOR]++; - - src += 16; - last_src += 16; - var16++; - } - - src = src - cm->mb_cols * 16 + 16 * src_stride; - last_src = last_src - cm->mb_cols * 16 + 16 * last_stride; - } - - cpi->source_var_thresh = 0; - - if (hist[VAR_HIST_BINS - 1] < cutoff) { - for (i = 0; i < VAR_HIST_BINS - 1; i++) { - sum += hist[i]; - - if (sum > cutoff) { - cpi->source_var_thresh = (i + 1) * VAR_HIST_FACTOR; - return 0; - } - } - } - - return sf->search_type_check_frequency; -} - -static void source_var_based_partition_search_method(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - SPEED_FEATURES *const sf = &cpi->sf; - - if (cm->frame_type == KEY_FRAME) { - // For key frame, use SEARCH_PARTITION. - sf->partition_search_type = SEARCH_PARTITION; - } else if (cm->intra_only) { - sf->partition_search_type = FIXED_PARTITION; - } else { - if (cm->last_width != cm->width || cm->last_height != cm->height) { - if (cpi->source_diff_var) - vpx_free(cpi->source_diff_var); - - CHECK_MEM_ERROR(cm, cpi->source_diff_var, - vpx_calloc(cm->MBs, sizeof(diff))); - } - - if (!cpi->frames_till_next_var_check) - cpi->frames_till_next_var_check = set_var_thresh_from_histogram(cpi); - - if (cpi->frames_till_next_var_check > 0) { - sf->partition_search_type = FIXED_PARTITION; - cpi->frames_till_next_var_check--; - } - } -} - -static int get_skip_encode_frame(const VP9_COMMON *cm, ThreadData *const td) { - unsigned int intra_count = 0, inter_count = 0; - int j; - - for (j = 0; j < INTRA_INTER_CONTEXTS; ++j) { - intra_count += td->counts->intra_inter[j][0]; - inter_count += td->counts->intra_inter[j][1]; - } - - return (intra_count << 2) < inter_count && - cm->frame_type != KEY_FRAME && - cm->show_frame; -} - -void vp9_init_tile_data(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - const int tile_cols = 1 << cm->log2_tile_cols; - const int tile_rows = 1 << cm->log2_tile_rows; - int tile_col, tile_row; - TOKENEXTRA *pre_tok = cpi->tile_tok[0][0]; - int tile_tok = 0; - - if (cpi->tile_data == NULL) { - CHECK_MEM_ERROR(cm, cpi->tile_data, - vpx_malloc(tile_cols * tile_rows * sizeof(*cpi->tile_data))); - for (tile_row = 0; tile_row < tile_rows; ++tile_row) - for (tile_col = 0; tile_col < tile_cols; ++tile_col) { - TileDataEnc *tile_data = - &cpi->tile_data[tile_row * tile_cols + tile_col]; - int i, j; - for (i = 0; i < BLOCK_SIZES; ++i) { - for (j = 0; j < MAX_MODES; ++j) { - tile_data->thresh_freq_fact[i][j] = 32; - tile_data->mode_map[i][j] = j; - } - } - } - } - - for (tile_row = 0; tile_row < tile_rows; ++tile_row) { - for (tile_col = 0; tile_col < tile_cols; ++tile_col) { - TileInfo *tile_info = - &cpi->tile_data[tile_row * tile_cols + tile_col].tile_info; - vp9_tile_init(tile_info, cm, tile_row, tile_col); - - cpi->tile_tok[tile_row][tile_col] = pre_tok + tile_tok; - pre_tok = cpi->tile_tok[tile_row][tile_col]; - tile_tok = allocated_tokens(*tile_info); - } - } -} - -void vp9_encode_tile(VP9_COMP *cpi, ThreadData *td, - int tile_row, int tile_col) { - VP9_COMMON *const cm = &cpi->common; - const int tile_cols = 1 << cm->log2_tile_cols; - TileDataEnc *this_tile = - &cpi->tile_data[tile_row * tile_cols + tile_col]; - const TileInfo * const tile_info = &this_tile->tile_info; - TOKENEXTRA *tok = cpi->tile_tok[tile_row][tile_col]; - int mi_row; - - for (mi_row = tile_info->mi_row_start; mi_row < tile_info->mi_row_end; - mi_row += MI_BLOCK_SIZE) { - if (cpi->sf.use_nonrd_pick_mode) - encode_nonrd_sb_row(cpi, td, this_tile, mi_row, &tok); - else - encode_rd_sb_row(cpi, td, this_tile, mi_row, &tok); - } - cpi->tok_count[tile_row][tile_col] = - (unsigned int)(tok - cpi->tile_tok[tile_row][tile_col]); - assert(tok - cpi->tile_tok[tile_row][tile_col] <= - allocated_tokens(*tile_info)); -} - -static void encode_tiles(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - const int tile_cols = 1 << cm->log2_tile_cols; - const int tile_rows = 1 << cm->log2_tile_rows; - int tile_col, tile_row; - - vp9_init_tile_data(cpi); - - for (tile_row = 0; tile_row < tile_rows; ++tile_row) - for (tile_col = 0; tile_col < tile_cols; ++tile_col) - vp9_encode_tile(cpi, &cpi->td, tile_row, tile_col); -} - -#if CONFIG_FP_MB_STATS -static int input_fpmb_stats(FIRSTPASS_MB_STATS *firstpass_mb_stats, - VP9_COMMON *cm, uint8_t **this_frame_mb_stats) { - uint8_t *mb_stats_in = firstpass_mb_stats->mb_stats_start + - cm->current_video_frame * cm->MBs * sizeof(uint8_t); - - if (mb_stats_in > firstpass_mb_stats->mb_stats_end) - return EOF; - - *this_frame_mb_stats = mb_stats_in; - - return 1; -} -#endif - -static void encode_frame_internal(VP9_COMP *cpi) { - SPEED_FEATURES *const sf = &cpi->sf; - RD_OPT *const rd_opt = &cpi->rd; - ThreadData *const td = &cpi->td; - MACROBLOCK *const x = &td->mb; - VP9_COMMON *const cm = &cpi->common; - MACROBLOCKD *const xd = &x->e_mbd; - RD_COUNTS *const rdc = &cpi->td.rd_counts; - - xd->mi = cm->mi; - xd->mi[0].src_mi = &xd->mi[0]; - - vp9_zero(*td->counts); - vp9_zero(rdc->coef_counts); - vp9_zero(rdc->comp_pred_diff); - vp9_zero(rdc->filter_diff); - vp9_zero(rdc->tx_select_diff); - vp9_zero(rd_opt->tx_select_threshes); - - xd->lossless = cm->base_qindex == 0 && - cm->y_dc_delta_q == 0 && - cm->uv_dc_delta_q == 0 && - cm->uv_ac_delta_q == 0; - -#if CONFIG_VP9_HIGHBITDEPTH - if (cm->use_highbitdepth) - x->fwd_txm4x4 = xd->lossless ? vp9_highbd_fwht4x4 : vp9_highbd_fdct4x4; - else - x->fwd_txm4x4 = xd->lossless ? vp9_fwht4x4 : vp9_fdct4x4; - x->highbd_itxm_add = xd->lossless ? vp9_highbd_iwht4x4_add : - vp9_highbd_idct4x4_add; -#else - x->fwd_txm4x4 = xd->lossless ? vp9_fwht4x4 : vp9_fdct4x4; -#endif // CONFIG_VP9_HIGHBITDEPTH - x->itxm_add = xd->lossless ? vp9_iwht4x4_add : vp9_idct4x4_add; - - if (xd->lossless) - x->optimize = 0; - - cm->tx_mode = select_tx_mode(cpi, xd); - - vp9_frame_init_quantizer(cpi); - - vp9_initialize_rd_consts(cpi); - vp9_initialize_me_consts(cpi, x, cm->base_qindex); - init_encode_frame_mb_context(cpi); - cm->use_prev_frame_mvs = !cm->error_resilient_mode && - cm->width == cm->last_width && - cm->height == cm->last_height && - !cm->intra_only && - cm->last_show_frame; - // Special case: set prev_mi to NULL when the previous mode info - // context cannot be used. - cm->prev_mi = cm->use_prev_frame_mvs ? - cm->prev_mip + cm->mi_stride + 1 : NULL; - - x->quant_fp = cpi->sf.use_quant_fp; - vp9_zero(x->skip_txfm); - if (sf->use_nonrd_pick_mode) { - // Initialize internal buffer pointers for rtc coding, where non-RD - // mode decision is used and hence no buffer pointer swap needed. - int i; - struct macroblock_plane *const p = x->plane; - struct macroblockd_plane *const pd = xd->plane; - PICK_MODE_CONTEXT *ctx = &cpi->td.pc_root->none; - - for (i = 0; i < MAX_MB_PLANE; ++i) { - p[i].coeff = ctx->coeff_pbuf[i][0]; - p[i].qcoeff = ctx->qcoeff_pbuf[i][0]; - pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][0]; - p[i].eobs = ctx->eobs_pbuf[i][0]; - } - vp9_zero(x->zcoeff_blk); - - if (sf->partition_search_type == SOURCE_VAR_BASED_PARTITION) - source_var_based_partition_search_method(cpi); - } - - { - struct vpx_usec_timer emr_timer; - vpx_usec_timer_start(&emr_timer); - -#if CONFIG_FP_MB_STATS - if (cpi->use_fp_mb_stats) { - input_fpmb_stats(&cpi->twopass.firstpass_mb_stats, cm, - &cpi->twopass.this_frame_mb_stats); - } -#endif - - // If allowed, encoding tiles in parallel with one thread handling one tile. - if (MIN(cpi->oxcf.max_threads, 1 << cm->log2_tile_cols) > 1) - vp9_encode_tiles_mt(cpi); - else - encode_tiles(cpi); - - vpx_usec_timer_mark(&emr_timer); - cpi->time_encode_sb_row += vpx_usec_timer_elapsed(&emr_timer); - } - - sf->skip_encode_frame = sf->skip_encode_sb ? - get_skip_encode_frame(cm, td) : 0; - -#if 0 - // Keep record of the total distortion this time around for future use - cpi->last_frame_distortion = cpi->frame_distortion; -#endif -} - -static INTERP_FILTER get_interp_filter( - const int64_t threshes[SWITCHABLE_FILTER_CONTEXTS], int is_alt_ref) { - if (!is_alt_ref && - threshes[EIGHTTAP_SMOOTH] > threshes[EIGHTTAP] && - threshes[EIGHTTAP_SMOOTH] > threshes[EIGHTTAP_SHARP] && - threshes[EIGHTTAP_SMOOTH] > threshes[SWITCHABLE - 1]) { - return EIGHTTAP_SMOOTH; - } else if (threshes[EIGHTTAP_SHARP] > threshes[EIGHTTAP] && - threshes[EIGHTTAP_SHARP] > threshes[SWITCHABLE - 1]) { - return EIGHTTAP_SHARP; - } else if (threshes[EIGHTTAP] > threshes[SWITCHABLE - 1]) { - return EIGHTTAP; - } else { - return SWITCHABLE; - } -} - -void vp9_encode_frame(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - - // In the longer term the encoder should be generalized to match the - // decoder such that we allow compound where one of the 3 buffers has a - // different sign bias and that buffer is then the fixed ref. However, this - // requires further work in the rd loop. For now the only supported encoder - // side behavior is where the ALT ref buffer has opposite sign bias to - // the other two. - if (!frame_is_intra_only(cm)) { - if ((cm->ref_frame_sign_bias[ALTREF_FRAME] == - cm->ref_frame_sign_bias[GOLDEN_FRAME]) || - (cm->ref_frame_sign_bias[ALTREF_FRAME] == - cm->ref_frame_sign_bias[LAST_FRAME])) { - cpi->allow_comp_inter_inter = 0; - } else { - cpi->allow_comp_inter_inter = 1; - cm->comp_fixed_ref = ALTREF_FRAME; - cm->comp_var_ref[0] = LAST_FRAME; - cm->comp_var_ref[1] = GOLDEN_FRAME; - } - } - - if (cpi->sf.frame_parameter_update) { - int i; - RD_OPT *const rd_opt = &cpi->rd; - FRAME_COUNTS *counts = cpi->td.counts; - RD_COUNTS *const rdc = &cpi->td.rd_counts; - - // This code does a single RD pass over the whole frame assuming - // either compound, single or hybrid prediction as per whatever has - // worked best for that type of frame in the past. - // It also predicts whether another coding mode would have worked - // better that this coding mode. If that is the case, it remembers - // that for subsequent frames. - // It does the same analysis for transform size selection also. - const MV_REFERENCE_FRAME frame_type = get_frame_type(cpi); - int64_t *const mode_thrs = rd_opt->prediction_type_threshes[frame_type]; - int64_t *const filter_thrs = rd_opt->filter_threshes[frame_type]; - int *const tx_thrs = rd_opt->tx_select_threshes[frame_type]; - const int is_alt_ref = frame_type == ALTREF_FRAME; - - /* prediction (compound, single or hybrid) mode selection */ - if (is_alt_ref || !cpi->allow_comp_inter_inter) - cm->reference_mode = SINGLE_REFERENCE; - else if (mode_thrs[COMPOUND_REFERENCE] > mode_thrs[SINGLE_REFERENCE] && - mode_thrs[COMPOUND_REFERENCE] > - mode_thrs[REFERENCE_MODE_SELECT] && - check_dual_ref_flags(cpi) && - cpi->static_mb_pct == 100) - cm->reference_mode = COMPOUND_REFERENCE; - else if (mode_thrs[SINGLE_REFERENCE] > mode_thrs[REFERENCE_MODE_SELECT]) - cm->reference_mode = SINGLE_REFERENCE; - else - cm->reference_mode = REFERENCE_MODE_SELECT; - - if (cm->interp_filter == SWITCHABLE) - cm->interp_filter = get_interp_filter(filter_thrs, is_alt_ref); - - encode_frame_internal(cpi); - - for (i = 0; i < REFERENCE_MODES; ++i) - mode_thrs[i] = (mode_thrs[i] + rdc->comp_pred_diff[i] / cm->MBs) / 2; - - for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i) - filter_thrs[i] = (filter_thrs[i] + rdc->filter_diff[i] / cm->MBs) / 2; - - for (i = 0; i < TX_MODES; ++i) { - int64_t pd = rdc->tx_select_diff[i]; - if (i == TX_MODE_SELECT) - pd -= RDCOST(cpi->td.mb.rdmult, cpi->td.mb.rddiv, 2048 * (TX_SIZES - 1), - 0); - tx_thrs[i] = (tx_thrs[i] + (int)(pd / cm->MBs)) / 2; - } - - if (cm->reference_mode == REFERENCE_MODE_SELECT) { - int single_count_zero = 0; - int comp_count_zero = 0; - - for (i = 0; i < COMP_INTER_CONTEXTS; i++) { - single_count_zero += counts->comp_inter[i][0]; - comp_count_zero += counts->comp_inter[i][1]; - } - - if (comp_count_zero == 0) { - cm->reference_mode = SINGLE_REFERENCE; - vp9_zero(counts->comp_inter); - } else if (single_count_zero == 0) { - cm->reference_mode = COMPOUND_REFERENCE; - vp9_zero(counts->comp_inter); - } - } - - if (cm->tx_mode == TX_MODE_SELECT) { - int count4x4 = 0; - int count8x8_lp = 0, count8x8_8x8p = 0; - int count16x16_16x16p = 0, count16x16_lp = 0; - int count32x32 = 0; - - for (i = 0; i < TX_SIZE_CONTEXTS; ++i) { - count4x4 += counts->tx.p32x32[i][TX_4X4]; - count4x4 += counts->tx.p16x16[i][TX_4X4]; - count4x4 += counts->tx.p8x8[i][TX_4X4]; - - count8x8_lp += counts->tx.p32x32[i][TX_8X8]; - count8x8_lp += counts->tx.p16x16[i][TX_8X8]; - count8x8_8x8p += counts->tx.p8x8[i][TX_8X8]; - - count16x16_16x16p += counts->tx.p16x16[i][TX_16X16]; - count16x16_lp += counts->tx.p32x32[i][TX_16X16]; - count32x32 += counts->tx.p32x32[i][TX_32X32]; - } - if (count4x4 == 0 && count16x16_lp == 0 && count16x16_16x16p == 0 && - count32x32 == 0) { - cm->tx_mode = ALLOW_8X8; - reset_skip_tx_size(cm, TX_8X8); - } else if (count8x8_8x8p == 0 && count16x16_16x16p == 0 && - count8x8_lp == 0 && count16x16_lp == 0 && count32x32 == 0) { - cm->tx_mode = ONLY_4X4; - reset_skip_tx_size(cm, TX_4X4); - } else if (count8x8_lp == 0 && count16x16_lp == 0 && count4x4 == 0) { - cm->tx_mode = ALLOW_32X32; - } else if (count32x32 == 0 && count8x8_lp == 0 && count4x4 == 0) { - cm->tx_mode = ALLOW_16X16; - reset_skip_tx_size(cm, TX_16X16); - } - } - } else { - cm->reference_mode = SINGLE_REFERENCE; - encode_frame_internal(cpi); - } -} - -static void sum_intra_stats(FRAME_COUNTS *counts, const MODE_INFO *mi) { - const PREDICTION_MODE y_mode = mi->mbmi.mode; - const PREDICTION_MODE uv_mode = mi->mbmi.uv_mode; - const BLOCK_SIZE bsize = mi->mbmi.sb_type; - - if (bsize < BLOCK_8X8) { - int idx, idy; - const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize]; - const int num_4x4_h = num_4x4_blocks_high_lookup[bsize]; - for (idy = 0; idy < 2; idy += num_4x4_h) - for (idx = 0; idx < 2; idx += num_4x4_w) - ++counts->y_mode[0][mi->bmi[idy * 2 + idx].as_mode]; - } else { - ++counts->y_mode[size_group_lookup[bsize]][y_mode]; - } - - ++counts->uv_mode[y_mode][uv_mode]; -} - -static void encode_superblock(VP9_COMP *cpi, ThreadData *td, - TOKENEXTRA **t, int output_enabled, - int mi_row, int mi_col, BLOCK_SIZE bsize, - PICK_MODE_CONTEXT *ctx) { - VP9_COMMON *const cm = &cpi->common; - MACROBLOCK *const x = &td->mb; - MACROBLOCKD *const xd = &x->e_mbd; - MODE_INFO *mi_8x8 = xd->mi; - MODE_INFO *mi = mi_8x8; - MB_MODE_INFO *mbmi = &mi->mbmi; - const int seg_skip = vp9_segfeature_active(&cm->seg, mbmi->segment_id, - SEG_LVL_SKIP); - const int mis = cm->mi_stride; - const int mi_width = num_8x8_blocks_wide_lookup[bsize]; - const int mi_height = num_8x8_blocks_high_lookup[bsize]; - - x->skip_recode = !x->select_tx_size && mbmi->sb_type >= BLOCK_8X8 && - cpi->oxcf.aq_mode != COMPLEXITY_AQ && - cpi->oxcf.aq_mode != CYCLIC_REFRESH_AQ && - cpi->sf.allow_skip_recode; - - if (!x->skip_recode && !cpi->sf.use_nonrd_pick_mode) - vpx_memset(x->skip_txfm, 0, sizeof(x->skip_txfm)); - - x->skip_optimize = ctx->is_coded; - ctx->is_coded = 1; - x->use_lp32x32fdct = cpi->sf.use_lp32x32fdct; - x->skip_encode = (!output_enabled && cpi->sf.skip_encode_frame && - x->q_index < QIDX_SKIP_THRESH); - - if (x->skip_encode) - return; - - set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]); - - if (!is_inter_block(mbmi)) { - int plane; - mbmi->skip = 1; - for (plane = 0; plane < MAX_MB_PLANE; ++plane) - vp9_encode_intra_block_plane(x, MAX(bsize, BLOCK_8X8), plane); - if (output_enabled) - sum_intra_stats(td->counts, mi); - vp9_tokenize_sb(cpi, td, t, !output_enabled, MAX(bsize, BLOCK_8X8)); - } else { - int ref; - const int is_compound = has_second_ref(mbmi); - for (ref = 0; ref < 1 + is_compound; ++ref) { - YV12_BUFFER_CONFIG *cfg = get_ref_frame_buffer(cpi, - mbmi->ref_frame[ref]); - assert(cfg != NULL); - vp9_setup_pre_planes(xd, ref, cfg, mi_row, mi_col, - &xd->block_refs[ref]->sf); - } - if (!(cpi->sf.reuse_inter_pred_sby && ctx->pred_pixel_ready) || seg_skip) - vp9_build_inter_predictors_sby(xd, mi_row, mi_col, MAX(bsize, BLOCK_8X8)); - - vp9_build_inter_predictors_sbuv(xd, mi_row, mi_col, MAX(bsize, BLOCK_8X8)); - - vp9_encode_sb(x, MAX(bsize, BLOCK_8X8)); - vp9_tokenize_sb(cpi, td, t, !output_enabled, MAX(bsize, BLOCK_8X8)); - } - - if (output_enabled) { - if (cm->tx_mode == TX_MODE_SELECT && - mbmi->sb_type >= BLOCK_8X8 && - !(is_inter_block(mbmi) && (mbmi->skip || seg_skip))) { - ++get_tx_counts(max_txsize_lookup[bsize], vp9_get_tx_size_context(xd), - &td->counts->tx)[mbmi->tx_size]; - } else { - int x, y; - TX_SIZE tx_size; - // The new intra coding scheme requires no change of transform size - if (is_inter_block(&mi->mbmi)) { - tx_size = MIN(tx_mode_to_biggest_tx_size[cm->tx_mode], - max_txsize_lookup[bsize]); - } else { - tx_size = (bsize >= BLOCK_8X8) ? mbmi->tx_size : TX_4X4; - } - - for (y = 0; y < mi_height; y++) - for (x = 0; x < mi_width; x++) - if (mi_col + x < cm->mi_cols && mi_row + y < cm->mi_rows) - mi_8x8[mis * y + x].src_mi->mbmi.tx_size = tx_size; - } - ++td->counts->tx.tx_totals[mbmi->tx_size]; - ++td->counts->tx.tx_totals[get_uv_tx_size(mbmi, &xd->plane[1])]; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_encodeframe.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_encodeframe.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_encodeframe.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_encodeframe.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP9_ENCODER_VP9_ENCODEFRAME_H_ -#define VP9_ENCODER_VP9_ENCODEFRAME_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -struct macroblock; -struct yv12_buffer_config; -struct VP9_COMP; -struct ThreadData; - -// Constants used in SOURCE_VAR_BASED_PARTITION -#define VAR_HIST_MAX_BG_VAR 1000 -#define VAR_HIST_FACTOR 10 -#define VAR_HIST_BINS (VAR_HIST_MAX_BG_VAR / VAR_HIST_FACTOR + 1) -#define VAR_HIST_LARGE_CUT_OFF 75 -#define VAR_HIST_SMALL_CUT_OFF 45 - -void vp9_setup_src_planes(struct macroblock *x, - const struct yv12_buffer_config *src, - int mi_row, int mi_col); - -void vp9_encode_frame(struct VP9_COMP *cpi); - -void vp9_init_tile_data(struct VP9_COMP *cpi); -void vp9_encode_tile(struct VP9_COMP *cpi, struct ThreadData *td, - int tile_row, int tile_col); - -void vp9_set_vbp_thresholds(struct VP9_COMP *cpi, int q); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_ENCODEFRAME_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_encodemb.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_encodemb.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_encodemb.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_encodemb.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1044 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include "./vp9_rtcd.h" -#include "./vpx_config.h" - -#include "vpx_mem/vpx_mem.h" - -#include "vp9/common/vp9_idct.h" -#include "vp9/common/vp9_reconinter.h" -#include "vp9/common/vp9_reconintra.h" -#include "vp9/common/vp9_systemdependent.h" - -#include "vp9/encoder/vp9_encodemb.h" -#include "vp9/encoder/vp9_quantize.h" -#include "vp9/encoder/vp9_rd.h" -#include "vp9/encoder/vp9_tokenize.h" - -struct optimize_ctx { - ENTROPY_CONTEXT ta[MAX_MB_PLANE][16]; - ENTROPY_CONTEXT tl[MAX_MB_PLANE][16]; -}; - -void vp9_subtract_block_c(int rows, int cols, - int16_t *diff, ptrdiff_t diff_stride, - const uint8_t *src, ptrdiff_t src_stride, - const uint8_t *pred, ptrdiff_t pred_stride) { - int r, c; - - for (r = 0; r < rows; r++) { - for (c = 0; c < cols; c++) - diff[c] = src[c] - pred[c]; - - diff += diff_stride; - pred += pred_stride; - src += src_stride; - } -} - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_highbd_subtract_block_c(int rows, int cols, - int16_t *diff, ptrdiff_t diff_stride, - const uint8_t *src8, ptrdiff_t src_stride, - const uint8_t *pred8, ptrdiff_t pred_stride, - int bd) { - int r, c; - uint16_t *src = CONVERT_TO_SHORTPTR(src8); - uint16_t *pred = CONVERT_TO_SHORTPTR(pred8); - (void) bd; - - for (r = 0; r < rows; r++) { - for (c = 0; c < cols; c++) { - diff[c] = src[c] - pred[c]; - } - - diff += diff_stride; - pred += pred_stride; - src += src_stride; - } -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -void vp9_subtract_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) { - struct macroblock_plane *const p = &x->plane[plane]; - const struct macroblockd_plane *const pd = &x->e_mbd.plane[plane]; - const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd); - const int bw = 4 * num_4x4_blocks_wide_lookup[plane_bsize]; - const int bh = 4 * num_4x4_blocks_high_lookup[plane_bsize]; - -#if CONFIG_VP9_HIGHBITDEPTH - if (x->e_mbd.cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - vp9_highbd_subtract_block(bh, bw, p->src_diff, bw, p->src.buf, - p->src.stride, pd->dst.buf, pd->dst.stride, - x->e_mbd.bd); - return; - } -#endif // CONFIG_VP9_HIGHBITDEPTH - vp9_subtract_block(bh, bw, p->src_diff, bw, p->src.buf, p->src.stride, - pd->dst.buf, pd->dst.stride); -} - -#define RDTRUNC(RM, DM, R, D) ((128 + (R) * (RM)) & 0xFF) - -typedef struct vp9_token_state { - int rate; - int error; - int next; - int16_t token; - short qc; -} vp9_token_state; - -// TODO(jimbankoski): experiment to find optimal RD numbers. -static const int plane_rd_mult[PLANE_TYPES] = { 4, 2 }; - -#define UPDATE_RD_COST()\ -{\ - rd_cost0 = RDCOST(rdmult, rddiv, rate0, error0);\ - rd_cost1 = RDCOST(rdmult, rddiv, rate1, error1);\ - if (rd_cost0 == rd_cost1) {\ - rd_cost0 = RDTRUNC(rdmult, rddiv, rate0, error0);\ - rd_cost1 = RDTRUNC(rdmult, rddiv, rate1, error1);\ - }\ -} - -// This function is a place holder for now but may ultimately need -// to scan previous tokens to work out the correct context. -static int trellis_get_coeff_context(const int16_t *scan, - const int16_t *nb, - int idx, int token, - uint8_t *token_cache) { - int bak = token_cache[scan[idx]], pt; - token_cache[scan[idx]] = vp9_pt_energy_class[token]; - pt = get_coef_context(nb, token_cache, idx + 1); - token_cache[scan[idx]] = bak; - return pt; -} - -static int optimize_b(MACROBLOCK *mb, int plane, int block, - TX_SIZE tx_size, int ctx) { - MACROBLOCKD *const xd = &mb->e_mbd; - struct macroblock_plane *const p = &mb->plane[plane]; - struct macroblockd_plane *const pd = &xd->plane[plane]; - const int ref = is_inter_block(&xd->mi[0].src_mi->mbmi); - vp9_token_state tokens[1025][2]; - unsigned best_index[1025][2]; - uint8_t token_cache[1024]; - const tran_low_t *const coeff = BLOCK_OFFSET(mb->plane[plane].coeff, block); - tran_low_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block); - tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); - const int eob = p->eobs[block]; - const PLANE_TYPE type = pd->plane_type; - const int default_eob = 16 << (tx_size << 1); - const int mul = 1 + (tx_size == TX_32X32); - const int16_t *dequant_ptr = pd->dequant; - const uint8_t *const band_translate = get_band_translate(tx_size); - const scan_order *const so = get_scan(xd, tx_size, type, block); - const int16_t *const scan = so->scan; - const int16_t *const nb = so->neighbors; - int next = eob, sz = 0; - int64_t rdmult = mb->rdmult * plane_rd_mult[type], rddiv = mb->rddiv; - int64_t rd_cost0, rd_cost1; - int rate0, rate1, error0, error1; - int16_t t0, t1; - EXTRABIT e0; - int best, band, pt, i, final_eob; -#if CONFIG_VP9_HIGHBITDEPTH - const int16_t *cat6_high_cost = vp9_get_high_cost_table(xd->bd); -#else - const int16_t *cat6_high_cost = vp9_get_high_cost_table(8); -#endif - - assert((!type && !plane) || (type && plane)); - assert(eob <= default_eob); - - /* Now set up a Viterbi trellis to evaluate alternative roundings. */ - if (!ref) - rdmult = (rdmult * 9) >> 4; - - /* Initialize the sentinel node of the trellis. */ - tokens[eob][0].rate = 0; - tokens[eob][0].error = 0; - tokens[eob][0].next = default_eob; - tokens[eob][0].token = EOB_TOKEN; - tokens[eob][0].qc = 0; - tokens[eob][1] = tokens[eob][0]; - - for (i = 0; i < eob; i++) - token_cache[scan[i]] = - vp9_pt_energy_class[vp9_get_token(qcoeff[scan[i]])]; - - for (i = eob; i-- > 0;) { - int base_bits, d2, dx; - const int rc = scan[i]; - int x = qcoeff[rc]; - /* Only add a trellis state for non-zero coefficients. */ - if (x) { - int shortcut = 0; - error0 = tokens[next][0].error; - error1 = tokens[next][1].error; - /* Evaluate the first possibility for this state. */ - rate0 = tokens[next][0].rate; - rate1 = tokens[next][1].rate; - vp9_get_token_extra(x, &t0, &e0); - /* Consider both possible successor states. */ - if (next < default_eob) { - band = band_translate[i + 1]; - pt = trellis_get_coeff_context(scan, nb, i, t0, token_cache); - rate0 += mb->token_costs[tx_size][type][ref][band][0][pt] - [tokens[next][0].token]; - rate1 += mb->token_costs[tx_size][type][ref][band][0][pt] - [tokens[next][1].token]; - } - UPDATE_RD_COST(); - /* And pick the best. */ - best = rd_cost1 < rd_cost0; - base_bits = vp9_get_cost(t0, e0, cat6_high_cost); - dx = mul * (dqcoeff[rc] - coeff[rc]); -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - dx >>= xd->bd - 8; - } -#endif // CONFIG_VP9_HIGHBITDEPTH - d2 = dx * dx; - tokens[i][0].rate = base_bits + (best ? rate1 : rate0); - tokens[i][0].error = d2 + (best ? error1 : error0); - tokens[i][0].next = next; - tokens[i][0].token = t0; - tokens[i][0].qc = x; - best_index[i][0] = best; - - /* Evaluate the second possibility for this state. */ - rate0 = tokens[next][0].rate; - rate1 = tokens[next][1].rate; - - if ((abs(x) * dequant_ptr[rc != 0] > abs(coeff[rc]) * mul) && - (abs(x) * dequant_ptr[rc != 0] < abs(coeff[rc]) * mul + - dequant_ptr[rc != 0])) - shortcut = 1; - else - shortcut = 0; - - if (shortcut) { - sz = -(x < 0); - x -= 2 * sz + 1; - } - - /* Consider both possible successor states. */ - if (!x) { - /* If we reduced this coefficient to zero, check to see if - * we need to move the EOB back here. - */ - t0 = tokens[next][0].token == EOB_TOKEN ? EOB_TOKEN : ZERO_TOKEN; - t1 = tokens[next][1].token == EOB_TOKEN ? EOB_TOKEN : ZERO_TOKEN; - e0 = 0; - } else { - vp9_get_token_extra(x, &t0, &e0); - t1 = t0; - } - if (next < default_eob) { - band = band_translate[i + 1]; - if (t0 != EOB_TOKEN) { - pt = trellis_get_coeff_context(scan, nb, i, t0, token_cache); - rate0 += mb->token_costs[tx_size][type][ref][band][!x][pt] - [tokens[next][0].token]; - } - if (t1 != EOB_TOKEN) { - pt = trellis_get_coeff_context(scan, nb, i, t1, token_cache); - rate1 += mb->token_costs[tx_size][type][ref][band][!x][pt] - [tokens[next][1].token]; - } - } - - UPDATE_RD_COST(); - /* And pick the best. */ - best = rd_cost1 < rd_cost0; - base_bits = vp9_get_cost(t0, e0, cat6_high_cost); - - if (shortcut) { -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - dx -= ((dequant_ptr[rc != 0] >> (xd->bd - 8)) + sz) ^ sz; - } else { - dx -= (dequant_ptr[rc != 0] + sz) ^ sz; - } -#else - dx -= (dequant_ptr[rc != 0] + sz) ^ sz; -#endif // CONFIG_VP9_HIGHBITDEPTH - d2 = dx * dx; - } - tokens[i][1].rate = base_bits + (best ? rate1 : rate0); - tokens[i][1].error = d2 + (best ? error1 : error0); - tokens[i][1].next = next; - tokens[i][1].token = best ? t1 : t0; - tokens[i][1].qc = x; - best_index[i][1] = best; - /* Finally, make this the new head of the trellis. */ - next = i; - } else { - /* There's no choice to make for a zero coefficient, so we don't - * add a new trellis node, but we do need to update the costs. - */ - band = band_translate[i + 1]; - t0 = tokens[next][0].token; - t1 = tokens[next][1].token; - /* Update the cost of each path if we're past the EOB token. */ - if (t0 != EOB_TOKEN) { - tokens[next][0].rate += - mb->token_costs[tx_size][type][ref][band][1][0][t0]; - tokens[next][0].token = ZERO_TOKEN; - } - if (t1 != EOB_TOKEN) { - tokens[next][1].rate += - mb->token_costs[tx_size][type][ref][band][1][0][t1]; - tokens[next][1].token = ZERO_TOKEN; - } - best_index[i][0] = best_index[i][1] = 0; - /* Don't update next, because we didn't add a new node. */ - } - } - - /* Now pick the best path through the whole trellis. */ - band = band_translate[i + 1]; - rate0 = tokens[next][0].rate; - rate1 = tokens[next][1].rate; - error0 = tokens[next][0].error; - error1 = tokens[next][1].error; - t0 = tokens[next][0].token; - t1 = tokens[next][1].token; - rate0 += mb->token_costs[tx_size][type][ref][band][0][ctx][t0]; - rate1 += mb->token_costs[tx_size][type][ref][band][0][ctx][t1]; - UPDATE_RD_COST(); - best = rd_cost1 < rd_cost0; - final_eob = -1; - vpx_memset(qcoeff, 0, sizeof(*qcoeff) * (16 << (tx_size * 2))); - vpx_memset(dqcoeff, 0, sizeof(*dqcoeff) * (16 << (tx_size * 2))); - for (i = next; i < eob; i = next) { - const int x = tokens[i][best].qc; - const int rc = scan[i]; - if (x) { - final_eob = i; - } - - qcoeff[rc] = x; - dqcoeff[rc] = (x * dequant_ptr[rc != 0]) / mul; - - next = tokens[i][best].next; - best = best_index[i][best]; - } - final_eob++; - - mb->plane[plane].eobs[block] = final_eob; - return final_eob; -} - -static INLINE void fdct32x32(int rd_transform, - const int16_t *src, tran_low_t *dst, - int src_stride) { - if (rd_transform) - vp9_fdct32x32_rd(src, dst, src_stride); - else - vp9_fdct32x32(src, dst, src_stride); -} - -#if CONFIG_VP9_HIGHBITDEPTH -static INLINE void highbd_fdct32x32(int rd_transform, const int16_t *src, - tran_low_t *dst, int src_stride) { - if (rd_transform) - vp9_highbd_fdct32x32_rd(src, dst, src_stride); - else - vp9_highbd_fdct32x32(src, dst, src_stride); -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -void vp9_xform_quant_fp(MACROBLOCK *x, int plane, int block, - BLOCK_SIZE plane_bsize, TX_SIZE tx_size) { - MACROBLOCKD *const xd = &x->e_mbd; - const struct macroblock_plane *const p = &x->plane[plane]; - const struct macroblockd_plane *const pd = &xd->plane[plane]; - const scan_order *const scan_order = &vp9_default_scan_orders[tx_size]; - tran_low_t *const coeff = BLOCK_OFFSET(p->coeff, block); - tran_low_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block); - tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); - uint16_t *const eob = &p->eobs[block]; - const int diff_stride = 4 * num_4x4_blocks_wide_lookup[plane_bsize]; - int i, j; - const int16_t *src_diff; - txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j); - src_diff = &p->src_diff[4 * (j * diff_stride + i)]; - -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - switch (tx_size) { - case TX_32X32: - highbd_fdct32x32(x->use_lp32x32fdct, src_diff, coeff, diff_stride); - vp9_highbd_quantize_fp_32x32(coeff, 1024, x->skip_block, p->zbin, - p->round_fp, p->quant_fp, p->quant_shift, - qcoeff, dqcoeff, pd->dequant, - eob, scan_order->scan, - scan_order->iscan); - break; - case TX_16X16: - vp9_highbd_fdct16x16(src_diff, coeff, diff_stride); - vp9_highbd_quantize_fp(coeff, 256, x->skip_block, p->zbin, p->round_fp, - p->quant_fp, p->quant_shift, qcoeff, dqcoeff, - pd->dequant, eob, - scan_order->scan, scan_order->iscan); - break; - case TX_8X8: - vp9_highbd_fdct8x8(src_diff, coeff, diff_stride); - vp9_highbd_quantize_fp(coeff, 64, x->skip_block, p->zbin, p->round_fp, - p->quant_fp, p->quant_shift, qcoeff, dqcoeff, - pd->dequant, eob, - scan_order->scan, scan_order->iscan); - break; - case TX_4X4: - x->fwd_txm4x4(src_diff, coeff, diff_stride); - vp9_highbd_quantize_fp(coeff, 16, x->skip_block, p->zbin, p->round_fp, - p->quant_fp, p->quant_shift, qcoeff, dqcoeff, - pd->dequant, eob, - scan_order->scan, scan_order->iscan); - break; - default: - assert(0); - } - return; - } -#endif // CONFIG_VP9_HIGHBITDEPTH - - switch (tx_size) { - case TX_32X32: - fdct32x32(x->use_lp32x32fdct, src_diff, coeff, diff_stride); - vp9_quantize_fp_32x32(coeff, 1024, x->skip_block, p->zbin, p->round_fp, - p->quant_fp, p->quant_shift, qcoeff, dqcoeff, - pd->dequant, eob, scan_order->scan, - scan_order->iscan); - break; - case TX_16X16: - vp9_fdct16x16(src_diff, coeff, diff_stride); - vp9_quantize_fp(coeff, 256, x->skip_block, p->zbin, p->round_fp, - p->quant_fp, p->quant_shift, qcoeff, dqcoeff, - pd->dequant, eob, - scan_order->scan, scan_order->iscan); - break; - case TX_8X8: - vp9_fdct8x8_quant(src_diff, diff_stride, coeff, 64, - x->skip_block, p->zbin, p->round_fp, - p->quant_fp, p->quant_shift, qcoeff, dqcoeff, - pd->dequant, eob, - scan_order->scan, scan_order->iscan); - break; - case TX_4X4: - x->fwd_txm4x4(src_diff, coeff, diff_stride); - vp9_quantize_fp(coeff, 16, x->skip_block, p->zbin, p->round_fp, - p->quant_fp, p->quant_shift, qcoeff, dqcoeff, - pd->dequant, eob, - scan_order->scan, scan_order->iscan); - break; - default: - assert(0); - break; - } -} - -void vp9_xform_quant_dc(MACROBLOCK *x, int plane, int block, - BLOCK_SIZE plane_bsize, TX_SIZE tx_size) { - MACROBLOCKD *const xd = &x->e_mbd; - const struct macroblock_plane *const p = &x->plane[plane]; - const struct macroblockd_plane *const pd = &xd->plane[plane]; - tran_low_t *const coeff = BLOCK_OFFSET(p->coeff, block); - tran_low_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block); - tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); - uint16_t *const eob = &p->eobs[block]; - const int diff_stride = 4 * num_4x4_blocks_wide_lookup[plane_bsize]; - int i, j; - const int16_t *src_diff; - - txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j); - src_diff = &p->src_diff[4 * (j * diff_stride + i)]; - -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - switch (tx_size) { - case TX_32X32: - vp9_highbd_fdct32x32_1(src_diff, coeff, diff_stride); - vp9_highbd_quantize_dc_32x32(coeff, x->skip_block, p->round, - p->quant_fp[0], qcoeff, dqcoeff, - pd->dequant[0], eob); - break; - case TX_16X16: - vp9_highbd_fdct16x16_1(src_diff, coeff, diff_stride); - vp9_highbd_quantize_dc(coeff, 256, x->skip_block, p->round, - p->quant_fp[0], qcoeff, dqcoeff, - pd->dequant[0], eob); - break; - case TX_8X8: - vp9_highbd_fdct8x8_1(src_diff, coeff, diff_stride); - vp9_highbd_quantize_dc(coeff, 64, x->skip_block, p->round, - p->quant_fp[0], qcoeff, dqcoeff, - pd->dequant[0], eob); - break; - case TX_4X4: - x->fwd_txm4x4(src_diff, coeff, diff_stride); - vp9_highbd_quantize_dc(coeff, 16, x->skip_block, p->round, - p->quant_fp[0], qcoeff, dqcoeff, - pd->dequant[0], eob); - break; - default: - assert(0); - } - return; - } -#endif // CONFIG_VP9_HIGHBITDEPTH - - switch (tx_size) { - case TX_32X32: - vp9_fdct32x32_1(src_diff, coeff, diff_stride); - vp9_quantize_dc_32x32(coeff, x->skip_block, p->round, - p->quant_fp[0], qcoeff, dqcoeff, - pd->dequant[0], eob); - break; - case TX_16X16: - vp9_fdct16x16_1(src_diff, coeff, diff_stride); - vp9_quantize_dc(coeff, 256, x->skip_block, p->round, - p->quant_fp[0], qcoeff, dqcoeff, - pd->dequant[0], eob); - break; - case TX_8X8: - vp9_fdct8x8_1(src_diff, coeff, diff_stride); - vp9_quantize_dc(coeff, 64, x->skip_block, p->round, - p->quant_fp[0], qcoeff, dqcoeff, - pd->dequant[0], eob); - break; - case TX_4X4: - x->fwd_txm4x4(src_diff, coeff, diff_stride); - vp9_quantize_dc(coeff, 16, x->skip_block, p->round, - p->quant_fp[0], qcoeff, dqcoeff, - pd->dequant[0], eob); - break; - default: - assert(0); - break; - } -} - -void vp9_xform_quant(MACROBLOCK *x, int plane, int block, - BLOCK_SIZE plane_bsize, TX_SIZE tx_size) { - MACROBLOCKD *const xd = &x->e_mbd; - const struct macroblock_plane *const p = &x->plane[plane]; - const struct macroblockd_plane *const pd = &xd->plane[plane]; - const scan_order *const scan_order = &vp9_default_scan_orders[tx_size]; - tran_low_t *const coeff = BLOCK_OFFSET(p->coeff, block); - tran_low_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block); - tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); - uint16_t *const eob = &p->eobs[block]; - const int diff_stride = 4 * num_4x4_blocks_wide_lookup[plane_bsize]; - int i, j; - const int16_t *src_diff; - txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j); - src_diff = &p->src_diff[4 * (j * diff_stride + i)]; - -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - switch (tx_size) { - case TX_32X32: - highbd_fdct32x32(x->use_lp32x32fdct, src_diff, coeff, diff_stride); - vp9_highbd_quantize_b_32x32(coeff, 1024, x->skip_block, p->zbin, - p->round, p->quant, p->quant_shift, qcoeff, - dqcoeff, pd->dequant, eob, - scan_order->scan, scan_order->iscan); - break; - case TX_16X16: - vp9_highbd_fdct16x16(src_diff, coeff, diff_stride); - vp9_highbd_quantize_b(coeff, 256, x->skip_block, p->zbin, p->round, - p->quant, p->quant_shift, qcoeff, dqcoeff, - pd->dequant, eob, - scan_order->scan, scan_order->iscan); - break; - case TX_8X8: - vp9_highbd_fdct8x8(src_diff, coeff, diff_stride); - vp9_highbd_quantize_b(coeff, 64, x->skip_block, p->zbin, p->round, - p->quant, p->quant_shift, qcoeff, dqcoeff, - pd->dequant, eob, - scan_order->scan, scan_order->iscan); - break; - case TX_4X4: - x->fwd_txm4x4(src_diff, coeff, diff_stride); - vp9_highbd_quantize_b(coeff, 16, x->skip_block, p->zbin, p->round, - p->quant, p->quant_shift, qcoeff, dqcoeff, - pd->dequant, eob, - scan_order->scan, scan_order->iscan); - break; - default: - assert(0); - } - return; - } -#endif // CONFIG_VP9_HIGHBITDEPTH - - switch (tx_size) { - case TX_32X32: - fdct32x32(x->use_lp32x32fdct, src_diff, coeff, diff_stride); - vp9_quantize_b_32x32(coeff, 1024, x->skip_block, p->zbin, p->round, - p->quant, p->quant_shift, qcoeff, dqcoeff, - pd->dequant, eob, scan_order->scan, - scan_order->iscan); - break; - case TX_16X16: - vp9_fdct16x16(src_diff, coeff, diff_stride); - vp9_quantize_b(coeff, 256, x->skip_block, p->zbin, p->round, - p->quant, p->quant_shift, qcoeff, dqcoeff, - pd->dequant, eob, - scan_order->scan, scan_order->iscan); - break; - case TX_8X8: - vp9_fdct8x8(src_diff, coeff, diff_stride); - vp9_quantize_b(coeff, 64, x->skip_block, p->zbin, p->round, - p->quant, p->quant_shift, qcoeff, dqcoeff, - pd->dequant, eob, - scan_order->scan, scan_order->iscan); - break; - case TX_4X4: - x->fwd_txm4x4(src_diff, coeff, diff_stride); - vp9_quantize_b(coeff, 16, x->skip_block, p->zbin, p->round, - p->quant, p->quant_shift, qcoeff, dqcoeff, - pd->dequant, eob, - scan_order->scan, scan_order->iscan); - break; - default: - assert(0); - break; - } -} - -static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize, - TX_SIZE tx_size, void *arg) { - struct encode_b_args *const args = arg; - MACROBLOCK *const x = args->x; - MACROBLOCKD *const xd = &x->e_mbd; - struct optimize_ctx *const ctx = args->ctx; - struct macroblock_plane *const p = &x->plane[plane]; - struct macroblockd_plane *const pd = &xd->plane[plane]; - tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); - int i, j; - uint8_t *dst; - ENTROPY_CONTEXT *a, *l; - txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j); - dst = &pd->dst.buf[4 * j * pd->dst.stride + 4 * i]; - a = &ctx->ta[plane][i]; - l = &ctx->tl[plane][j]; - - // TODO(jingning): per transformed block zero forcing only enabled for - // luma component. will integrate chroma components as well. - if (x->zcoeff_blk[tx_size][block] && plane == 0) { - p->eobs[block] = 0; - *a = *l = 0; - return; - } - - if (!x->skip_recode) { - if (x->quant_fp) { - // Encoding process for rtc mode - if (x->skip_txfm[0] == 1 && plane == 0) { - // skip forward transform - p->eobs[block] = 0; - *a = *l = 0; - return; - } else { - vp9_xform_quant_fp(x, plane, block, plane_bsize, tx_size); - } - } else { - if (max_txsize_lookup[plane_bsize] == tx_size) { - int txfm_blk_index = (plane << 2) + (block >> (tx_size << 1)); - if (x->skip_txfm[txfm_blk_index] == 0) { - // full forward transform and quantization - vp9_xform_quant(x, plane, block, plane_bsize, tx_size); - } else if (x->skip_txfm[txfm_blk_index]== 2) { - // fast path forward transform and quantization - vp9_xform_quant_dc(x, plane, block, plane_bsize, tx_size); - } else { - // skip forward transform - p->eobs[block] = 0; - *a = *l = 0; - return; - } - } else { - vp9_xform_quant(x, plane, block, plane_bsize, tx_size); - } - } - } - - if (x->optimize && (!x->skip_recode || !x->skip_optimize)) { - const int ctx = combine_entropy_contexts(*a, *l); - *a = *l = optimize_b(x, plane, block, tx_size, ctx) > 0; - } else { - *a = *l = p->eobs[block] > 0; - } - - if (p->eobs[block]) - *(args->skip) = 0; - - if (x->skip_encode || p->eobs[block] == 0) - return; -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - switch (tx_size) { - case TX_32X32: - vp9_highbd_idct32x32_add(dqcoeff, dst, pd->dst.stride, - p->eobs[block], xd->bd); - break; - case TX_16X16: - vp9_highbd_idct16x16_add(dqcoeff, dst, pd->dst.stride, - p->eobs[block], xd->bd); - break; - case TX_8X8: - vp9_highbd_idct8x8_add(dqcoeff, dst, pd->dst.stride, - p->eobs[block], xd->bd); - break; - case TX_4X4: - // this is like vp9_short_idct4x4 but has a special case around eob<=1 - // which is significant (not just an optimization) for the lossless - // case. - x->highbd_itxm_add(dqcoeff, dst, pd->dst.stride, - p->eobs[block], xd->bd); - break; - default: - assert(0 && "Invalid transform size"); - } - return; - } -#endif // CONFIG_VP9_HIGHBITDEPTH - - switch (tx_size) { - case TX_32X32: - vp9_idct32x32_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]); - break; - case TX_16X16: - vp9_idct16x16_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]); - break; - case TX_8X8: - vp9_idct8x8_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]); - break; - case TX_4X4: - // this is like vp9_short_idct4x4 but has a special case around eob<=1 - // which is significant (not just an optimization) for the lossless - // case. - x->itxm_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]); - break; - default: - assert(0 && "Invalid transform size"); - break; - } -} - -static void encode_block_pass1(int plane, int block, BLOCK_SIZE plane_bsize, - TX_SIZE tx_size, void *arg) { - MACROBLOCK *const x = (MACROBLOCK *)arg; - MACROBLOCKD *const xd = &x->e_mbd; - struct macroblock_plane *const p = &x->plane[plane]; - struct macroblockd_plane *const pd = &xd->plane[plane]; - tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); - int i, j; - uint8_t *dst; - txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j); - dst = &pd->dst.buf[4 * j * pd->dst.stride + 4 * i]; - - vp9_xform_quant(x, plane, block, plane_bsize, tx_size); - - if (p->eobs[block] > 0) { -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - x->highbd_itxm_add(dqcoeff, dst, pd->dst.stride, p->eobs[block], xd->bd); - return; - } -#endif // CONFIG_VP9_HIGHBITDEPTH - x->itxm_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]); - } -} - -void vp9_encode_sby_pass1(MACROBLOCK *x, BLOCK_SIZE bsize) { - vp9_subtract_plane(x, bsize, 0); - vp9_foreach_transformed_block_in_plane(&x->e_mbd, bsize, 0, - encode_block_pass1, x); -} - -void vp9_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize) { - MACROBLOCKD *const xd = &x->e_mbd; - struct optimize_ctx ctx; - MB_MODE_INFO *mbmi = &xd->mi[0].src_mi->mbmi; - struct encode_b_args arg = {x, &ctx, &mbmi->skip}; - int plane; - - mbmi->skip = 1; - - if (x->skip) - return; - - for (plane = 0; plane < MAX_MB_PLANE; ++plane) { - if (!x->skip_recode) - vp9_subtract_plane(x, bsize, plane); - - if (x->optimize && (!x->skip_recode || !x->skip_optimize)) { - const struct macroblockd_plane* const pd = &xd->plane[plane]; - const TX_SIZE tx_size = plane ? get_uv_tx_size(mbmi, pd) : mbmi->tx_size; - vp9_get_entropy_contexts(bsize, tx_size, pd, - ctx.ta[plane], ctx.tl[plane]); - } - - vp9_foreach_transformed_block_in_plane(xd, bsize, plane, encode_block, - &arg); - } -} - -void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize, - TX_SIZE tx_size, void *arg) { - struct encode_b_args* const args = arg; - MACROBLOCK *const x = args->x; - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *mbmi = &xd->mi[0].src_mi->mbmi; - struct macroblock_plane *const p = &x->plane[plane]; - struct macroblockd_plane *const pd = &xd->plane[plane]; - tran_low_t *coeff = BLOCK_OFFSET(p->coeff, block); - tran_low_t *qcoeff = BLOCK_OFFSET(p->qcoeff, block); - tran_low_t *dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); - const scan_order *scan_order; - TX_TYPE tx_type; - PREDICTION_MODE mode; - const int bwl = b_width_log2_lookup[plane_bsize]; - const int diff_stride = 4 * (1 << bwl); - uint8_t *src, *dst; - int16_t *src_diff; - uint16_t *eob = &p->eobs[block]; - const int src_stride = p->src.stride; - const int dst_stride = pd->dst.stride; - int i, j; - txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j); - dst = &pd->dst.buf[4 * (j * dst_stride + i)]; - src = &p->src.buf[4 * (j * src_stride + i)]; - src_diff = &p->src_diff[4 * (j * diff_stride + i)]; - -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - switch (tx_size) { - case TX_32X32: - scan_order = &vp9_default_scan_orders[TX_32X32]; - mode = plane == 0 ? mbmi->mode : mbmi->uv_mode; - vp9_predict_intra_block(xd, block >> 6, bwl, TX_32X32, mode, - x->skip_encode ? src : dst, - x->skip_encode ? src_stride : dst_stride, - dst, dst_stride, i, j, plane); - if (!x->skip_recode) { - vp9_highbd_subtract_block(32, 32, src_diff, diff_stride, - src, src_stride, dst, dst_stride, xd->bd); - highbd_fdct32x32(x->use_lp32x32fdct, src_diff, coeff, diff_stride); - vp9_highbd_quantize_b_32x32(coeff, 1024, x->skip_block, p->zbin, - p->round, p->quant, p->quant_shift, - qcoeff, dqcoeff, pd->dequant, eob, - scan_order->scan, scan_order->iscan); - } - if (!x->skip_encode && *eob) { - vp9_highbd_idct32x32_add(dqcoeff, dst, dst_stride, *eob, xd->bd); - } - break; - case TX_16X16: - tx_type = get_tx_type(pd->plane_type, xd); - scan_order = &vp9_scan_orders[TX_16X16][tx_type]; - mode = plane == 0 ? mbmi->mode : mbmi->uv_mode; - vp9_predict_intra_block(xd, block >> 4, bwl, TX_16X16, mode, - x->skip_encode ? src : dst, - x->skip_encode ? src_stride : dst_stride, - dst, dst_stride, i, j, plane); - if (!x->skip_recode) { - vp9_highbd_subtract_block(16, 16, src_diff, diff_stride, - src, src_stride, dst, dst_stride, xd->bd); - vp9_highbd_fht16x16(src_diff, coeff, diff_stride, tx_type); - vp9_highbd_quantize_b(coeff, 256, x->skip_block, p->zbin, p->round, - p->quant, p->quant_shift, qcoeff, dqcoeff, - pd->dequant, eob, - scan_order->scan, scan_order->iscan); - } - if (!x->skip_encode && *eob) { - vp9_highbd_iht16x16_add(tx_type, dqcoeff, dst, dst_stride, - *eob, xd->bd); - } - break; - case TX_8X8: - tx_type = get_tx_type(pd->plane_type, xd); - scan_order = &vp9_scan_orders[TX_8X8][tx_type]; - mode = plane == 0 ? mbmi->mode : mbmi->uv_mode; - vp9_predict_intra_block(xd, block >> 2, bwl, TX_8X8, mode, - x->skip_encode ? src : dst, - x->skip_encode ? src_stride : dst_stride, - dst, dst_stride, i, j, plane); - if (!x->skip_recode) { - vp9_highbd_subtract_block(8, 8, src_diff, diff_stride, - src, src_stride, dst, dst_stride, xd->bd); - vp9_highbd_fht8x8(src_diff, coeff, diff_stride, tx_type); - vp9_highbd_quantize_b(coeff, 64, x->skip_block, p->zbin, p->round, - p->quant, p->quant_shift, qcoeff, dqcoeff, - pd->dequant, eob, - scan_order->scan, scan_order->iscan); - } - if (!x->skip_encode && *eob) { - vp9_highbd_iht8x8_add(tx_type, dqcoeff, dst, dst_stride, *eob, - xd->bd); - } - break; - case TX_4X4: - tx_type = get_tx_type_4x4(pd->plane_type, xd, block); - scan_order = &vp9_scan_orders[TX_4X4][tx_type]; - mode = plane == 0 ? get_y_mode(xd->mi[0].src_mi, block) : mbmi->uv_mode; - vp9_predict_intra_block(xd, block, bwl, TX_4X4, mode, - x->skip_encode ? src : dst, - x->skip_encode ? src_stride : dst_stride, - dst, dst_stride, i, j, plane); - - if (!x->skip_recode) { - vp9_highbd_subtract_block(4, 4, src_diff, diff_stride, - src, src_stride, dst, dst_stride, xd->bd); - if (tx_type != DCT_DCT) - vp9_highbd_fht4x4(src_diff, coeff, diff_stride, tx_type); - else - x->fwd_txm4x4(src_diff, coeff, diff_stride); - vp9_highbd_quantize_b(coeff, 16, x->skip_block, p->zbin, p->round, - p->quant, p->quant_shift, qcoeff, dqcoeff, - pd->dequant, eob, - scan_order->scan, scan_order->iscan); - } - - if (!x->skip_encode && *eob) { - if (tx_type == DCT_DCT) { - // this is like vp9_short_idct4x4 but has a special case around - // eob<=1 which is significant (not just an optimization) for the - // lossless case. - x->highbd_itxm_add(dqcoeff, dst, dst_stride, *eob, xd->bd); - } else { - vp9_highbd_iht4x4_16_add(dqcoeff, dst, dst_stride, tx_type, xd->bd); - } - } - break; - default: - assert(0); - return; - } - if (*eob) - *(args->skip) = 0; - return; - } -#endif // CONFIG_VP9_HIGHBITDEPTH - - switch (tx_size) { - case TX_32X32: - scan_order = &vp9_default_scan_orders[TX_32X32]; - mode = plane == 0 ? mbmi->mode : mbmi->uv_mode; - vp9_predict_intra_block(xd, block >> 6, bwl, TX_32X32, mode, - x->skip_encode ? src : dst, - x->skip_encode ? src_stride : dst_stride, - dst, dst_stride, i, j, plane); - if (!x->skip_recode) { - vp9_subtract_block(32, 32, src_diff, diff_stride, - src, src_stride, dst, dst_stride); - fdct32x32(x->use_lp32x32fdct, src_diff, coeff, diff_stride); - vp9_quantize_b_32x32(coeff, 1024, x->skip_block, p->zbin, p->round, - p->quant, p->quant_shift, qcoeff, dqcoeff, - pd->dequant, eob, scan_order->scan, - scan_order->iscan); - } - if (!x->skip_encode && *eob) - vp9_idct32x32_add(dqcoeff, dst, dst_stride, *eob); - break; - case TX_16X16: - tx_type = get_tx_type(pd->plane_type, xd); - scan_order = &vp9_scan_orders[TX_16X16][tx_type]; - mode = plane == 0 ? mbmi->mode : mbmi->uv_mode; - vp9_predict_intra_block(xd, block >> 4, bwl, TX_16X16, mode, - x->skip_encode ? src : dst, - x->skip_encode ? src_stride : dst_stride, - dst, dst_stride, i, j, plane); - if (!x->skip_recode) { - vp9_subtract_block(16, 16, src_diff, diff_stride, - src, src_stride, dst, dst_stride); - vp9_fht16x16(src_diff, coeff, diff_stride, tx_type); - vp9_quantize_b(coeff, 256, x->skip_block, p->zbin, p->round, - p->quant, p->quant_shift, qcoeff, dqcoeff, - pd->dequant, eob, scan_order->scan, - scan_order->iscan); - } - if (!x->skip_encode && *eob) - vp9_iht16x16_add(tx_type, dqcoeff, dst, dst_stride, *eob); - break; - case TX_8X8: - tx_type = get_tx_type(pd->plane_type, xd); - scan_order = &vp9_scan_orders[TX_8X8][tx_type]; - mode = plane == 0 ? mbmi->mode : mbmi->uv_mode; - vp9_predict_intra_block(xd, block >> 2, bwl, TX_8X8, mode, - x->skip_encode ? src : dst, - x->skip_encode ? src_stride : dst_stride, - dst, dst_stride, i, j, plane); - if (!x->skip_recode) { - vp9_subtract_block(8, 8, src_diff, diff_stride, - src, src_stride, dst, dst_stride); - vp9_fht8x8(src_diff, coeff, diff_stride, tx_type); - vp9_quantize_b(coeff, 64, x->skip_block, p->zbin, p->round, p->quant, - p->quant_shift, qcoeff, dqcoeff, - pd->dequant, eob, scan_order->scan, - scan_order->iscan); - } - if (!x->skip_encode && *eob) - vp9_iht8x8_add(tx_type, dqcoeff, dst, dst_stride, *eob); - break; - case TX_4X4: - tx_type = get_tx_type_4x4(pd->plane_type, xd, block); - scan_order = &vp9_scan_orders[TX_4X4][tx_type]; - mode = plane == 0 ? get_y_mode(xd->mi[0].src_mi, block) : mbmi->uv_mode; - vp9_predict_intra_block(xd, block, bwl, TX_4X4, mode, - x->skip_encode ? src : dst, - x->skip_encode ? src_stride : dst_stride, - dst, dst_stride, i, j, plane); - - if (!x->skip_recode) { - vp9_subtract_block(4, 4, src_diff, diff_stride, - src, src_stride, dst, dst_stride); - if (tx_type != DCT_DCT) - vp9_fht4x4(src_diff, coeff, diff_stride, tx_type); - else - x->fwd_txm4x4(src_diff, coeff, diff_stride); - vp9_quantize_b(coeff, 16, x->skip_block, p->zbin, p->round, p->quant, - p->quant_shift, qcoeff, dqcoeff, - pd->dequant, eob, scan_order->scan, - scan_order->iscan); - } - - if (!x->skip_encode && *eob) { - if (tx_type == DCT_DCT) - // this is like vp9_short_idct4x4 but has a special case around eob<=1 - // which is significant (not just an optimization) for the lossless - // case. - x->itxm_add(dqcoeff, dst, dst_stride, *eob); - else - vp9_iht4x4_16_add(dqcoeff, dst, dst_stride, tx_type); - } - break; - default: - assert(0); - break; - } - if (*eob) - *(args->skip) = 0; -} - -void vp9_encode_intra_block_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) { - const MACROBLOCKD *const xd = &x->e_mbd; - struct encode_b_args arg = {x, NULL, &xd->mi[0].src_mi->mbmi.skip}; - - vp9_foreach_transformed_block_in_plane(xd, bsize, plane, - vp9_encode_block_intra, &arg); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_encodemb.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_encodemb.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_encodemb.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_encodemb.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_ENCODEMB_H_ -#define VP9_ENCODER_VP9_ENCODEMB_H_ - -#include "./vpx_config.h" -#include "vp9/encoder/vp9_block.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct encode_b_args { - MACROBLOCK *x; - struct optimize_ctx *ctx; - int8_t *skip; -}; -void vp9_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize); -void vp9_encode_sby_pass1(MACROBLOCK *x, BLOCK_SIZE bsize); -void vp9_xform_quant_fp(MACROBLOCK *x, int plane, int block, - BLOCK_SIZE plane_bsize, TX_SIZE tx_size); -void vp9_xform_quant_dc(MACROBLOCK *x, int plane, int block, - BLOCK_SIZE plane_bsize, TX_SIZE tx_size); -void vp9_xform_quant(MACROBLOCK *x, int plane, int block, - BLOCK_SIZE plane_bsize, TX_SIZE tx_size); - -void vp9_subtract_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane); - -void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize, - TX_SIZE tx_size, void *arg); - -void vp9_encode_intra_block_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_ENCODEMB_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_encodemv.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_encodemv.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_encodemv.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_encodemv.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,266 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_entropymode.h" -#include "vp9/common/vp9_systemdependent.h" - -#include "vp9/encoder/vp9_cost.h" -#include "vp9/encoder/vp9_encodemv.h" - -static struct vp9_token mv_joint_encodings[MV_JOINTS]; -static struct vp9_token mv_class_encodings[MV_CLASSES]; -static struct vp9_token mv_fp_encodings[MV_FP_SIZE]; -static struct vp9_token mv_class0_encodings[CLASS0_SIZE]; - -void vp9_entropy_mv_init() { - vp9_tokens_from_tree(mv_joint_encodings, vp9_mv_joint_tree); - vp9_tokens_from_tree(mv_class_encodings, vp9_mv_class_tree); - vp9_tokens_from_tree(mv_class0_encodings, vp9_mv_class0_tree); - vp9_tokens_from_tree(mv_fp_encodings, vp9_mv_fp_tree); -} - -static void encode_mv_component(vp9_writer* w, int comp, - const nmv_component* mvcomp, int usehp) { - int offset; - const int sign = comp < 0; - const int mag = sign ? -comp : comp; - const int mv_class = vp9_get_mv_class(mag - 1, &offset); - const int d = offset >> 3; // int mv data - const int fr = (offset >> 1) & 3; // fractional mv data - const int hp = offset & 1; // high precision mv data - - assert(comp != 0); - - // Sign - vp9_write(w, sign, mvcomp->sign); - - // Class - vp9_write_token(w, vp9_mv_class_tree, mvcomp->classes, - &mv_class_encodings[mv_class]); - - // Integer bits - if (mv_class == MV_CLASS_0) { - vp9_write_token(w, vp9_mv_class0_tree, mvcomp->class0, - &mv_class0_encodings[d]); - } else { - int i; - const int n = mv_class + CLASS0_BITS - 1; // number of bits - for (i = 0; i < n; ++i) - vp9_write(w, (d >> i) & 1, mvcomp->bits[i]); - } - - // Fractional bits - vp9_write_token(w, vp9_mv_fp_tree, - mv_class == MV_CLASS_0 ? mvcomp->class0_fp[d] : mvcomp->fp, - &mv_fp_encodings[fr]); - - // High precision bit - if (usehp) - vp9_write(w, hp, - mv_class == MV_CLASS_0 ? mvcomp->class0_hp : mvcomp->hp); -} - - -static void build_nmv_component_cost_table(int *mvcost, - const nmv_component* const mvcomp, - int usehp) { - int i, v; - int sign_cost[2], class_cost[MV_CLASSES], class0_cost[CLASS0_SIZE]; - int bits_cost[MV_OFFSET_BITS][2]; - int class0_fp_cost[CLASS0_SIZE][MV_FP_SIZE], fp_cost[MV_FP_SIZE]; - int class0_hp_cost[2], hp_cost[2]; - - sign_cost[0] = vp9_cost_zero(mvcomp->sign); - sign_cost[1] = vp9_cost_one(mvcomp->sign); - vp9_cost_tokens(class_cost, mvcomp->classes, vp9_mv_class_tree); - vp9_cost_tokens(class0_cost, mvcomp->class0, vp9_mv_class0_tree); - for (i = 0; i < MV_OFFSET_BITS; ++i) { - bits_cost[i][0] = vp9_cost_zero(mvcomp->bits[i]); - bits_cost[i][1] = vp9_cost_one(mvcomp->bits[i]); - } - - for (i = 0; i < CLASS0_SIZE; ++i) - vp9_cost_tokens(class0_fp_cost[i], mvcomp->class0_fp[i], vp9_mv_fp_tree); - vp9_cost_tokens(fp_cost, mvcomp->fp, vp9_mv_fp_tree); - - if (usehp) { - class0_hp_cost[0] = vp9_cost_zero(mvcomp->class0_hp); - class0_hp_cost[1] = vp9_cost_one(mvcomp->class0_hp); - hp_cost[0] = vp9_cost_zero(mvcomp->hp); - hp_cost[1] = vp9_cost_one(mvcomp->hp); - } - mvcost[0] = 0; - for (v = 1; v <= MV_MAX; ++v) { - int z, c, o, d, e, f, cost = 0; - z = v - 1; - c = vp9_get_mv_class(z, &o); - cost += class_cost[c]; - d = (o >> 3); /* int mv data */ - f = (o >> 1) & 3; /* fractional pel mv data */ - e = (o & 1); /* high precision mv data */ - if (c == MV_CLASS_0) { - cost += class0_cost[d]; - } else { - int i, b; - b = c + CLASS0_BITS - 1; /* number of bits */ - for (i = 0; i < b; ++i) - cost += bits_cost[i][((d >> i) & 1)]; - } - if (c == MV_CLASS_0) { - cost += class0_fp_cost[d][f]; - } else { - cost += fp_cost[f]; - } - if (usehp) { - if (c == MV_CLASS_0) { - cost += class0_hp_cost[e]; - } else { - cost += hp_cost[e]; - } - } - mvcost[v] = cost + sign_cost[0]; - mvcost[-v] = cost + sign_cost[1]; - } -} - -static int update_mv(vp9_writer *w, const unsigned int ct[2], vp9_prob *cur_p, - vp9_prob upd_p) { - const vp9_prob new_p = get_binary_prob(ct[0], ct[1]) | 1; - const int update = cost_branch256(ct, *cur_p) + vp9_cost_zero(upd_p) > - cost_branch256(ct, new_p) + vp9_cost_one(upd_p) + 7 * 256; - vp9_write(w, update, upd_p); - if (update) { - *cur_p = new_p; - vp9_write_literal(w, new_p >> 1, 7); - } - return update; -} - -static void write_mv_update(const vp9_tree_index *tree, - vp9_prob probs[/*n - 1*/], - const unsigned int counts[/*n - 1*/], - int n, vp9_writer *w) { - int i; - unsigned int branch_ct[32][2]; - - // Assuming max number of probabilities <= 32 - assert(n <= 32); - - vp9_tree_probs_from_distribution(tree, branch_ct, counts); - for (i = 0; i < n - 1; ++i) - update_mv(w, branch_ct[i], &probs[i], MV_UPDATE_PROB); -} - -void vp9_write_nmv_probs(VP9_COMMON *cm, int usehp, vp9_writer *w, - nmv_context_counts *const counts) { - int i, j; - nmv_context *const mvc = &cm->fc->nmvc; - - write_mv_update(vp9_mv_joint_tree, mvc->joints, counts->joints, MV_JOINTS, w); - - for (i = 0; i < 2; ++i) { - nmv_component *comp = &mvc->comps[i]; - nmv_component_counts *comp_counts = &counts->comps[i]; - - update_mv(w, comp_counts->sign, &comp->sign, MV_UPDATE_PROB); - write_mv_update(vp9_mv_class_tree, comp->classes, comp_counts->classes, - MV_CLASSES, w); - write_mv_update(vp9_mv_class0_tree, comp->class0, comp_counts->class0, - CLASS0_SIZE, w); - for (j = 0; j < MV_OFFSET_BITS; ++j) - update_mv(w, comp_counts->bits[j], &comp->bits[j], MV_UPDATE_PROB); - } - - for (i = 0; i < 2; ++i) { - for (j = 0; j < CLASS0_SIZE; ++j) - write_mv_update(vp9_mv_fp_tree, mvc->comps[i].class0_fp[j], - counts->comps[i].class0_fp[j], MV_FP_SIZE, w); - - write_mv_update(vp9_mv_fp_tree, mvc->comps[i].fp, counts->comps[i].fp, - MV_FP_SIZE, w); - } - - if (usehp) { - for (i = 0; i < 2; ++i) { - update_mv(w, counts->comps[i].class0_hp, &mvc->comps[i].class0_hp, - MV_UPDATE_PROB); - update_mv(w, counts->comps[i].hp, &mvc->comps[i].hp, MV_UPDATE_PROB); - } - } -} - -void vp9_encode_mv(VP9_COMP* cpi, vp9_writer* w, - const MV* mv, const MV* ref, - const nmv_context* mvctx, int usehp) { - const MV diff = {mv->row - ref->row, - mv->col - ref->col}; - const MV_JOINT_TYPE j = vp9_get_mv_joint(&diff); - usehp = usehp && vp9_use_mv_hp(ref); - - vp9_write_token(w, vp9_mv_joint_tree, mvctx->joints, &mv_joint_encodings[j]); - if (mv_joint_vertical(j)) - encode_mv_component(w, diff.row, &mvctx->comps[0], usehp); - - if (mv_joint_horizontal(j)) - encode_mv_component(w, diff.col, &mvctx->comps[1], usehp); - - // If auto_mv_step_size is enabled then keep track of the largest - // motion vector component used. - if (cpi->sf.mv.auto_mv_step_size) { - unsigned int maxv = MAX(abs(mv->row), abs(mv->col)) >> 3; - cpi->max_mv_magnitude = MAX(maxv, cpi->max_mv_magnitude); - } -} - -void vp9_build_nmv_cost_table(int *mvjoint, int *mvcost[2], - const nmv_context* ctx, int usehp) { - vp9_cost_tokens(mvjoint, ctx->joints, vp9_mv_joint_tree); - build_nmv_component_cost_table(mvcost[0], &ctx->comps[0], usehp); - build_nmv_component_cost_table(mvcost[1], &ctx->comps[1], usehp); -} - -static void inc_mvs(const MB_MODE_INFO *mbmi, const int_mv mvs[2], - nmv_context_counts *counts) { - int i; - - for (i = 0; i < 1 + has_second_ref(mbmi); ++i) { - const MV *ref = &mbmi->ref_mvs[mbmi->ref_frame[i]][0].as_mv; - const MV diff = {mvs[i].as_mv.row - ref->row, - mvs[i].as_mv.col - ref->col}; - vp9_inc_mv(&diff, counts); - } -} - -void vp9_update_mv_count(ThreadData *td) { - const MACROBLOCKD *xd = &td->mb.e_mbd; - const MODE_INFO *mi = xd->mi[0].src_mi; - const MB_MODE_INFO *const mbmi = &mi->mbmi; - - if (mbmi->sb_type < BLOCK_8X8) { - const int num_4x4_w = num_4x4_blocks_wide_lookup[mbmi->sb_type]; - const int num_4x4_h = num_4x4_blocks_high_lookup[mbmi->sb_type]; - int idx, idy; - - for (idy = 0; idy < 2; idy += num_4x4_h) { - for (idx = 0; idx < 2; idx += num_4x4_w) { - const int i = idy * 2 + idx; - if (mi->bmi[i].as_mode == NEWMV) - inc_mvs(mbmi, mi->bmi[i].as_mv, &td->counts->mv); - } - } - } else { - if (mbmi->mode == NEWMV) - inc_mvs(mbmi, mbmi->mv, &td->counts->mv); - } -} - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_encodemv.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_encodemv.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_encodemv.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_encodemv.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP9_ENCODER_VP9_ENCODEMV_H_ -#define VP9_ENCODER_VP9_ENCODEMV_H_ - -#include "vp9/encoder/vp9_encoder.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void vp9_entropy_mv_init(); - -void vp9_write_nmv_probs(VP9_COMMON *cm, int usehp, vp9_writer *w, - nmv_context_counts *const counts); - -void vp9_encode_mv(VP9_COMP *cpi, vp9_writer* w, const MV* mv, const MV* ref, - const nmv_context* mvctx, int usehp); - -void vp9_build_nmv_cost_table(int *mvjoint, int *mvcost[2], - const nmv_context* mvctx, int usehp); - -void vp9_update_mv_count(ThreadData *td); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_ENCODEMV_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_encoder.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_encoder.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_encoder.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_encoder.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,4304 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include - -#include "./vpx_config.h" -#include "./vpx_scale_rtcd.h" -#include "vpx/internal/vpx_psnr.h" -#include "vpx_ports/vpx_timer.h" - -#include "vp9/common/vp9_alloccommon.h" -#include "vp9/common/vp9_filter.h" -#include "vp9/common/vp9_idct.h" -#if CONFIG_VP9_POSTPROC -#include "vp9/common/vp9_postproc.h" -#endif -#include "vp9/common/vp9_reconinter.h" -#include "vp9/common/vp9_reconintra.h" -#include "vp9/common/vp9_systemdependent.h" -#include "vp9/common/vp9_tile_common.h" - -#include "vp9/encoder/vp9_aq_complexity.h" -#include "vp9/encoder/vp9_aq_cyclicrefresh.h" -#include "vp9/encoder/vp9_aq_variance.h" -#include "vp9/encoder/vp9_bitstream.h" -#include "vp9/encoder/vp9_context_tree.h" -#include "vp9/encoder/vp9_encodeframe.h" -#include "vp9/encoder/vp9_encodemv.h" -#include "vp9/encoder/vp9_encoder.h" -#include "vp9/encoder/vp9_ethread.h" -#include "vp9/encoder/vp9_firstpass.h" -#include "vp9/encoder/vp9_mbgraph.h" -#include "vp9/encoder/vp9_picklpf.h" -#include "vp9/encoder/vp9_ratectrl.h" -#include "vp9/encoder/vp9_rd.h" -#include "vp9/encoder/vp9_resize.h" -#include "vp9/encoder/vp9_segmentation.h" -#include "vp9/encoder/vp9_skin_detection.h" -#include "vp9/encoder/vp9_speed_features.h" -#if CONFIG_INTERNAL_STATS -#include "vp9/encoder/vp9_ssim.h" -#endif -#include "vp9/encoder/vp9_svc_layercontext.h" -#include "vp9/encoder/vp9_temporal_filter.h" - -#define AM_SEGMENT_ID_INACTIVE 7 -#define AM_SEGMENT_ID_ACTIVE 0 - -#define SHARP_FILTER_QTHRESH 0 /* Q threshold for 8-tap sharp filter */ - -#define ALTREF_HIGH_PRECISION_MV 1 // Whether to use high precision mv - // for altref computation. -#define HIGH_PRECISION_MV_QTHRESH 200 // Q threshold for high precision - // mv. Choose a very high value for - // now so that HIGH_PRECISION is always - // chosen. -// #define OUTPUT_YUV_REC - -#ifdef OUTPUT_YUV_DENOISED -FILE *yuv_denoised_file = NULL; -#endif -#ifdef OUTPUT_YUV_SKINMAP -FILE *yuv_skinmap_file = NULL; -#endif -#ifdef OUTPUT_YUV_REC -FILE *yuv_rec_file; -#endif - -#if 0 -FILE *framepsnr; -FILE *kf_list; -FILE *keyfile; -#endif - -static INLINE void Scale2Ratio(VPX_SCALING mode, int *hr, int *hs) { - switch (mode) { - case NORMAL: - *hr = 1; - *hs = 1; - break; - case FOURFIVE: - *hr = 4; - *hs = 5; - break; - case THREEFIVE: - *hr = 3; - *hs = 5; - break; - case ONETWO: - *hr = 1; - *hs = 2; - break; - default: - *hr = 1; - *hs = 1; - assert(0); - break; - } -} - -// Mark all inactive blocks as active. Other segmentation features may be set -// so memset cannot be used, instead only inactive blocks should be reset. -void vp9_suppress_active_map(VP9_COMP *cpi) { - unsigned char *const seg_map = cpi->segmentation_map; - int i; - if (cpi->active_map.enabled || cpi->active_map.update) - for (i = 0; i < cpi->common.mi_rows * cpi->common.mi_cols; ++i) - if (seg_map[i] == AM_SEGMENT_ID_INACTIVE) - seg_map[i] = AM_SEGMENT_ID_ACTIVE; -} - -void vp9_apply_active_map(VP9_COMP *cpi) { - struct segmentation *const seg = &cpi->common.seg; - unsigned char *const seg_map = cpi->segmentation_map; - const unsigned char *const active_map = cpi->active_map.map; - int i; - - assert(AM_SEGMENT_ID_ACTIVE == CR_SEGMENT_ID_BASE); - - if (cpi->active_map.update) { - if (cpi->active_map.enabled) { - for (i = 0; i < cpi->common.mi_rows * cpi->common.mi_cols; ++i) - if (seg_map[i] == AM_SEGMENT_ID_ACTIVE) seg_map[i] = active_map[i]; - vp9_enable_segmentation(seg); - vp9_enable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_SKIP); - } else { - vp9_disable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_SKIP); - if (seg->enabled) { - seg->update_data = 1; - seg->update_map = 1; - } - } - cpi->active_map.update = 0; - } -} - -int vp9_set_active_map(VP9_COMP* cpi, - unsigned char* new_map_16x16, - int rows, - int cols) { - if (rows == cpi->common.mb_rows && cols == cpi->common.mb_cols) { - unsigned char *const active_map_8x8 = cpi->active_map.map; - const int mi_rows = cpi->common.mi_rows; - const int mi_cols = cpi->common.mi_cols; - cpi->active_map.update = 1; - if (new_map_16x16) { - int r, c; - for (r = 0; r < mi_rows; ++r) { - for (c = 0; c < mi_cols; ++c) { - active_map_8x8[r * mi_cols + c] = - new_map_16x16[(r >> 1) * cols + (c >> 1)] - ? AM_SEGMENT_ID_ACTIVE - : AM_SEGMENT_ID_INACTIVE; - } - } - cpi->active_map.enabled = 1; - } else { - cpi->active_map.enabled = 0; - } - return 0; - } else { - return -1; - } -} - -void vp9_set_high_precision_mv(VP9_COMP *cpi, int allow_high_precision_mv) { - MACROBLOCK *const mb = &cpi->td.mb; - cpi->common.allow_high_precision_mv = allow_high_precision_mv; - if (cpi->common.allow_high_precision_mv) { - mb->mvcost = mb->nmvcost_hp; - mb->mvsadcost = mb->nmvsadcost_hp; - } else { - mb->mvcost = mb->nmvcost; - mb->mvsadcost = mb->nmvsadcost; - } -} - -static void setup_frame(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - // Set up entropy context depending on frame type. The decoder mandates - // the use of the default context, index 0, for keyframes and inter - // frames where the error_resilient_mode or intra_only flag is set. For - // other inter-frames the encoder currently uses only two contexts; - // context 1 for ALTREF frames and context 0 for the others. - if (frame_is_intra_only(cm) || cm->error_resilient_mode) { - vp9_setup_past_independence(cm); - } else { - if (!cpi->use_svc) - cm->frame_context_idx = cpi->refresh_alt_ref_frame; - } - - if (cm->frame_type == KEY_FRAME) { - if (!is_two_pass_svc(cpi)) - cpi->refresh_golden_frame = 1; - cpi->refresh_alt_ref_frame = 1; - vp9_zero(cpi->interp_filter_selected); - } else { - *cm->fc = cm->frame_contexts[cm->frame_context_idx]; - vp9_zero(cpi->interp_filter_selected[0]); - } -} - -static void vp9_enc_setup_mi(VP9_COMMON *cm) { - int i; - cm->mi = cm->mip + cm->mi_stride + 1; - vpx_memset(cm->mip, 0, cm->mi_stride * (cm->mi_rows + 1) * sizeof(*cm->mip)); - cm->prev_mi = cm->prev_mip + cm->mi_stride + 1; - // Clear top border row - vpx_memset(cm->prev_mip, 0, sizeof(*cm->prev_mip) * cm->mi_stride); - // Clear left border column - for (i = 1; i < cm->mi_rows + 1; ++i) - vpx_memset(&cm->prev_mip[i * cm->mi_stride], 0, sizeof(*cm->prev_mip)); -} - -static int vp9_enc_alloc_mi(VP9_COMMON *cm, int mi_size) { - cm->mip = vpx_calloc(mi_size, sizeof(*cm->mip)); - if (!cm->mip) - return 1; - cm->prev_mip = vpx_calloc(mi_size, sizeof(*cm->prev_mip)); - if (!cm->prev_mip) - return 1; - cm->mi_alloc_size = mi_size; - return 0; -} - -static void vp9_enc_free_mi(VP9_COMMON *cm) { - vpx_free(cm->mip); - cm->mip = NULL; - vpx_free(cm->prev_mip); - cm->prev_mip = NULL; -} - -static void vp9_swap_mi_and_prev_mi(VP9_COMMON *cm) { - // Current mip will be the prev_mip for the next frame. - MODE_INFO *temp = cm->prev_mip; - cm->prev_mip = cm->mip; - cm->mip = temp; - - // Update the upper left visible macroblock ptrs. - cm->mi = cm->mip + cm->mi_stride + 1; - cm->prev_mi = cm->prev_mip + cm->mi_stride + 1; -} - -void vp9_initialize_enc(void) { - static volatile int init_done = 0; - - if (!init_done) { - vp9_rtcd(); - vp9_init_intra_predictors(); - vp9_init_me_luts(); - vp9_rc_init_minq_luts(); - vp9_entropy_mv_init(); - vp9_temporal_filter_init(); - init_done = 1; - } -} - -static void dealloc_compressor_data(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - int i; - - vpx_free(cpi->tile_data); - cpi->tile_data = NULL; - - // Delete sementation map - vpx_free(cpi->segmentation_map); - cpi->segmentation_map = NULL; - vpx_free(cpi->coding_context.last_frame_seg_map_copy); - cpi->coding_context.last_frame_seg_map_copy = NULL; - - vpx_free(cpi->nmvcosts[0]); - vpx_free(cpi->nmvcosts[1]); - cpi->nmvcosts[0] = NULL; - cpi->nmvcosts[1] = NULL; - - vpx_free(cpi->nmvcosts_hp[0]); - vpx_free(cpi->nmvcosts_hp[1]); - cpi->nmvcosts_hp[0] = NULL; - cpi->nmvcosts_hp[1] = NULL; - - vpx_free(cpi->nmvsadcosts[0]); - vpx_free(cpi->nmvsadcosts[1]); - cpi->nmvsadcosts[0] = NULL; - cpi->nmvsadcosts[1] = NULL; - - vpx_free(cpi->nmvsadcosts_hp[0]); - vpx_free(cpi->nmvsadcosts_hp[1]); - cpi->nmvsadcosts_hp[0] = NULL; - cpi->nmvsadcosts_hp[1] = NULL; - - vp9_cyclic_refresh_free(cpi->cyclic_refresh); - cpi->cyclic_refresh = NULL; - - vpx_free(cpi->active_map.map); - cpi->active_map.map = NULL; - - vp9_free_ref_frame_buffers(cm); - vp9_free_context_buffers(cm); - - vp9_free_frame_buffer(&cpi->last_frame_uf); - vp9_free_frame_buffer(&cpi->scaled_source); - vp9_free_frame_buffer(&cpi->scaled_last_source); - vp9_free_frame_buffer(&cpi->alt_ref_buffer); - vp9_lookahead_destroy(cpi->lookahead); - - vpx_free(cpi->tile_tok[0][0]); - cpi->tile_tok[0][0] = 0; - - vp9_free_pc_tree(&cpi->td); - - for (i = 0; i < cpi->svc.number_spatial_layers; ++i) { - LAYER_CONTEXT *const lc = &cpi->svc.layer_context[i]; - vpx_free(lc->rc_twopass_stats_in.buf); - lc->rc_twopass_stats_in.buf = NULL; - lc->rc_twopass_stats_in.sz = 0; - } - - if (cpi->source_diff_var != NULL) { - vpx_free(cpi->source_diff_var); - cpi->source_diff_var = NULL; - } - - for (i = 0; i < MAX_LAG_BUFFERS; ++i) { - vp9_free_frame_buffer(&cpi->svc.scaled_frames[i]); - } - vpx_memset(&cpi->svc.scaled_frames[0], 0, - MAX_LAG_BUFFERS * sizeof(cpi->svc.scaled_frames[0])); - - vp9_free_frame_buffer(&cpi->svc.empty_frame.img); - vpx_memset(&cpi->svc.empty_frame, 0, sizeof(cpi->svc.empty_frame)); -} - -static void save_coding_context(VP9_COMP *cpi) { - CODING_CONTEXT *const cc = &cpi->coding_context; - VP9_COMMON *cm = &cpi->common; - - // Stores a snapshot of key state variables which can subsequently be - // restored with a call to vp9_restore_coding_context. These functions are - // intended for use in a re-code loop in vp9_compress_frame where the - // quantizer value is adjusted between loop iterations. - vp9_copy(cc->nmvjointcost, cpi->td.mb.nmvjointcost); - - vpx_memcpy(cc->nmvcosts[0], cpi->nmvcosts[0], - MV_VALS * sizeof(*cpi->nmvcosts[0])); - vpx_memcpy(cc->nmvcosts[1], cpi->nmvcosts[1], - MV_VALS * sizeof(*cpi->nmvcosts[1])); - vpx_memcpy(cc->nmvcosts_hp[0], cpi->nmvcosts_hp[0], - MV_VALS * sizeof(*cpi->nmvcosts_hp[0])); - vpx_memcpy(cc->nmvcosts_hp[1], cpi->nmvcosts_hp[1], - MV_VALS * sizeof(*cpi->nmvcosts_hp[1])); - - vp9_copy(cc->segment_pred_probs, cm->seg.pred_probs); - - vpx_memcpy(cpi->coding_context.last_frame_seg_map_copy, - cm->last_frame_seg_map, (cm->mi_rows * cm->mi_cols)); - - vp9_copy(cc->last_ref_lf_deltas, cm->lf.last_ref_deltas); - vp9_copy(cc->last_mode_lf_deltas, cm->lf.last_mode_deltas); - - cc->fc = *cm->fc; -} - -static void restore_coding_context(VP9_COMP *cpi) { - CODING_CONTEXT *const cc = &cpi->coding_context; - VP9_COMMON *cm = &cpi->common; - - // Restore key state variables to the snapshot state stored in the - // previous call to vp9_save_coding_context. - vp9_copy(cpi->td.mb.nmvjointcost, cc->nmvjointcost); - - vpx_memcpy(cpi->nmvcosts[0], cc->nmvcosts[0], - MV_VALS * sizeof(*cc->nmvcosts[0])); - vpx_memcpy(cpi->nmvcosts[1], cc->nmvcosts[1], - MV_VALS * sizeof(*cc->nmvcosts[1])); - vpx_memcpy(cpi->nmvcosts_hp[0], cc->nmvcosts_hp[0], - MV_VALS * sizeof(*cc->nmvcosts_hp[0])); - vpx_memcpy(cpi->nmvcosts_hp[1], cc->nmvcosts_hp[1], - MV_VALS * sizeof(*cc->nmvcosts_hp[1])); - - vp9_copy(cm->seg.pred_probs, cc->segment_pred_probs); - - vpx_memcpy(cm->last_frame_seg_map, - cpi->coding_context.last_frame_seg_map_copy, - (cm->mi_rows * cm->mi_cols)); - - vp9_copy(cm->lf.last_ref_deltas, cc->last_ref_lf_deltas); - vp9_copy(cm->lf.last_mode_deltas, cc->last_mode_lf_deltas); - - *cm->fc = cc->fc; -} - -static void configure_static_seg_features(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - const RATE_CONTROL *const rc = &cpi->rc; - struct segmentation *const seg = &cm->seg; - - int high_q = (int)(rc->avg_q > 48.0); - int qi_delta; - - // Disable and clear down for KF - if (cm->frame_type == KEY_FRAME) { - // Clear down the global segmentation map - vpx_memset(cpi->segmentation_map, 0, cm->mi_rows * cm->mi_cols); - seg->update_map = 0; - seg->update_data = 0; - cpi->static_mb_pct = 0; - - // Disable segmentation - vp9_disable_segmentation(seg); - - // Clear down the segment features. - vp9_clearall_segfeatures(seg); - } else if (cpi->refresh_alt_ref_frame) { - // If this is an alt ref frame - // Clear down the global segmentation map - vpx_memset(cpi->segmentation_map, 0, cm->mi_rows * cm->mi_cols); - seg->update_map = 0; - seg->update_data = 0; - cpi->static_mb_pct = 0; - - // Disable segmentation and individual segment features by default - vp9_disable_segmentation(seg); - vp9_clearall_segfeatures(seg); - - // Scan frames from current to arf frame. - // This function re-enables segmentation if appropriate. - vp9_update_mbgraph_stats(cpi); - - // If segmentation was enabled set those features needed for the - // arf itself. - if (seg->enabled) { - seg->update_map = 1; - seg->update_data = 1; - - qi_delta = vp9_compute_qdelta(rc, rc->avg_q, rc->avg_q * 0.875, - cm->bit_depth); - vp9_set_segdata(seg, 1, SEG_LVL_ALT_Q, qi_delta - 2); - vp9_set_segdata(seg, 1, SEG_LVL_ALT_LF, -2); - - vp9_enable_segfeature(seg, 1, SEG_LVL_ALT_Q); - vp9_enable_segfeature(seg, 1, SEG_LVL_ALT_LF); - - // Where relevant assume segment data is delta data - seg->abs_delta = SEGMENT_DELTADATA; - } - } else if (seg->enabled) { - // All other frames if segmentation has been enabled - - // First normal frame in a valid gf or alt ref group - if (rc->frames_since_golden == 0) { - // Set up segment features for normal frames in an arf group - if (rc->source_alt_ref_active) { - seg->update_map = 0; - seg->update_data = 1; - seg->abs_delta = SEGMENT_DELTADATA; - - qi_delta = vp9_compute_qdelta(rc, rc->avg_q, rc->avg_q * 1.125, - cm->bit_depth); - vp9_set_segdata(seg, 1, SEG_LVL_ALT_Q, qi_delta + 2); - vp9_enable_segfeature(seg, 1, SEG_LVL_ALT_Q); - - vp9_set_segdata(seg, 1, SEG_LVL_ALT_LF, -2); - vp9_enable_segfeature(seg, 1, SEG_LVL_ALT_LF); - - // Segment coding disabled for compred testing - if (high_q || (cpi->static_mb_pct == 100)) { - vp9_set_segdata(seg, 1, SEG_LVL_REF_FRAME, ALTREF_FRAME); - vp9_enable_segfeature(seg, 1, SEG_LVL_REF_FRAME); - vp9_enable_segfeature(seg, 1, SEG_LVL_SKIP); - } - } else { - // Disable segmentation and clear down features if alt ref - // is not active for this group - - vp9_disable_segmentation(seg); - - vpx_memset(cpi->segmentation_map, 0, cm->mi_rows * cm->mi_cols); - - seg->update_map = 0; - seg->update_data = 0; - - vp9_clearall_segfeatures(seg); - } - } else if (rc->is_src_frame_alt_ref) { - // Special case where we are coding over the top of a previous - // alt ref frame. - // Segment coding disabled for compred testing - - // Enable ref frame features for segment 0 as well - vp9_enable_segfeature(seg, 0, SEG_LVL_REF_FRAME); - vp9_enable_segfeature(seg, 1, SEG_LVL_REF_FRAME); - - // All mbs should use ALTREF_FRAME - vp9_clear_segdata(seg, 0, SEG_LVL_REF_FRAME); - vp9_set_segdata(seg, 0, SEG_LVL_REF_FRAME, ALTREF_FRAME); - vp9_clear_segdata(seg, 1, SEG_LVL_REF_FRAME); - vp9_set_segdata(seg, 1, SEG_LVL_REF_FRAME, ALTREF_FRAME); - - // Skip all MBs if high Q (0,0 mv and skip coeffs) - if (high_q) { - vp9_enable_segfeature(seg, 0, SEG_LVL_SKIP); - vp9_enable_segfeature(seg, 1, SEG_LVL_SKIP); - } - // Enable data update - seg->update_data = 1; - } else { - // All other frames. - - // No updates.. leave things as they are. - seg->update_map = 0; - seg->update_data = 0; - } - } -} - -static void update_reference_segmentation_map(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - MODE_INFO *mi_8x8_ptr = cm->mi; - uint8_t *cache_ptr = cm->last_frame_seg_map; - int row, col; - - for (row = 0; row < cm->mi_rows; row++) { - MODE_INFO *mi_8x8 = mi_8x8_ptr; - uint8_t *cache = cache_ptr; - for (col = 0; col < cm->mi_cols; col++, mi_8x8++, cache++) - cache[0] = mi_8x8[0].src_mi->mbmi.segment_id; - mi_8x8_ptr += cm->mi_stride; - cache_ptr += cm->mi_cols; - } -} - -static void alloc_raw_frame_buffers(VP9_COMP *cpi) { - VP9_COMMON *cm = &cpi->common; - const VP9EncoderConfig *oxcf = &cpi->oxcf; - - if (!cpi->lookahead) - cpi->lookahead = vp9_lookahead_init(oxcf->width, oxcf->height, - cm->subsampling_x, cm->subsampling_y, -#if CONFIG_VP9_HIGHBITDEPTH - cm->use_highbitdepth, -#endif - oxcf->lag_in_frames); - if (!cpi->lookahead) - vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR, - "Failed to allocate lag buffers"); - - // TODO(agrange) Check if ARF is enabled and skip allocation if not. - if (vp9_realloc_frame_buffer(&cpi->alt_ref_buffer, - oxcf->width, oxcf->height, - cm->subsampling_x, cm->subsampling_y, -#if CONFIG_VP9_HIGHBITDEPTH - cm->use_highbitdepth, -#endif - VP9_ENC_BORDER_IN_PIXELS, cm->byte_alignment, - NULL, NULL, NULL)) - vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR, - "Failed to allocate altref buffer"); -} - -static void alloc_util_frame_buffers(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - if (vp9_realloc_frame_buffer(&cpi->last_frame_uf, - cm->width, cm->height, - cm->subsampling_x, cm->subsampling_y, -#if CONFIG_VP9_HIGHBITDEPTH - cm->use_highbitdepth, -#endif - VP9_ENC_BORDER_IN_PIXELS, cm->byte_alignment, - NULL, NULL, NULL)) - vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR, - "Failed to allocate last frame buffer"); - - if (vp9_realloc_frame_buffer(&cpi->scaled_source, - cm->width, cm->height, - cm->subsampling_x, cm->subsampling_y, -#if CONFIG_VP9_HIGHBITDEPTH - cm->use_highbitdepth, -#endif - VP9_ENC_BORDER_IN_PIXELS, cm->byte_alignment, - NULL, NULL, NULL)) - vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR, - "Failed to allocate scaled source buffer"); - - if (vp9_realloc_frame_buffer(&cpi->scaled_last_source, - cm->width, cm->height, - cm->subsampling_x, cm->subsampling_y, -#if CONFIG_VP9_HIGHBITDEPTH - cm->use_highbitdepth, -#endif - VP9_ENC_BORDER_IN_PIXELS, cm->byte_alignment, - NULL, NULL, NULL)) - vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR, - "Failed to allocate scaled last source buffer"); -} - -void vp9_alloc_compressor_data(VP9_COMP *cpi) { - VP9_COMMON *cm = &cpi->common; - - vp9_alloc_context_buffers(cm, cm->width, cm->height); - - vpx_free(cpi->tile_tok[0][0]); - - { - unsigned int tokens = get_token_alloc(cm->mb_rows, cm->mb_cols); - CHECK_MEM_ERROR(cm, cpi->tile_tok[0][0], - vpx_calloc(tokens, sizeof(*cpi->tile_tok[0][0]))); - } - - vp9_setup_pc_tree(&cpi->common, &cpi->td); -} - -static void update_frame_size(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - MACROBLOCKD *const xd = &cpi->td.mb.e_mbd; - - vp9_set_mb_mi(cm, cm->width, cm->height); - vp9_init_context_buffers(cm); - init_macroblockd(cm, xd); - - if (is_two_pass_svc(cpi)) { - if (vp9_realloc_frame_buffer(&cpi->alt_ref_buffer, - cm->width, cm->height, - cm->subsampling_x, cm->subsampling_y, -#if CONFIG_VP9_HIGHBITDEPTH - cm->use_highbitdepth, -#endif - VP9_ENC_BORDER_IN_PIXELS, cm->byte_alignment, - NULL, NULL, NULL)) - vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR, - "Failed to reallocate alt_ref_buffer"); - } -} - -void vp9_new_framerate(VP9_COMP *cpi, double framerate) { - cpi->framerate = framerate < 0.1 ? 30 : framerate; - vp9_rc_update_framerate(cpi); -} - -static void set_tile_limits(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - - int min_log2_tile_cols, max_log2_tile_cols; - vp9_get_tile_n_bits(cm->mi_cols, &min_log2_tile_cols, &max_log2_tile_cols); - - cm->log2_tile_cols = clamp(cpi->oxcf.tile_columns, - min_log2_tile_cols, max_log2_tile_cols); - cm->log2_tile_rows = cpi->oxcf.tile_rows; -} - -static void init_buffer_indices(VP9_COMP *cpi) { - cpi->lst_fb_idx = 0; - cpi->gld_fb_idx = 1; - cpi->alt_fb_idx = 2; -} - -static void init_config(struct VP9_COMP *cpi, VP9EncoderConfig *oxcf) { - VP9_COMMON *const cm = &cpi->common; - - cpi->oxcf = *oxcf; - cpi->framerate = oxcf->init_framerate; - - cm->profile = oxcf->profile; - cm->bit_depth = oxcf->bit_depth; -#if CONFIG_VP9_HIGHBITDEPTH - cm->use_highbitdepth = oxcf->use_highbitdepth; -#endif - cm->color_space = oxcf->color_space; - - cm->width = oxcf->width; - cm->height = oxcf->height; - vp9_alloc_compressor_data(cpi); - - // Single thread case: use counts in common. - cpi->td.counts = &cm->counts; - - // Spatial scalability. - cpi->svc.number_spatial_layers = oxcf->ss_number_layers; - // Temporal scalability. - cpi->svc.number_temporal_layers = oxcf->ts_number_layers; - - if ((cpi->svc.number_temporal_layers > 1 && cpi->oxcf.rc_mode == VPX_CBR) || - ((cpi->svc.number_temporal_layers > 1 || - cpi->svc.number_spatial_layers > 1) && - cpi->oxcf.pass != 1)) { - vp9_init_layer_context(cpi); - } - - // change includes all joint functionality - vp9_change_config(cpi, oxcf); - - cpi->static_mb_pct = 0; - cpi->ref_frame_flags = 0; - - init_buffer_indices(cpi); -} - -static void set_rc_buffer_sizes(RATE_CONTROL *rc, - const VP9EncoderConfig *oxcf) { - const int64_t bandwidth = oxcf->target_bandwidth; - const int64_t starting = oxcf->starting_buffer_level_ms; - const int64_t optimal = oxcf->optimal_buffer_level_ms; - const int64_t maximum = oxcf->maximum_buffer_size_ms; - - rc->starting_buffer_level = starting * bandwidth / 1000; - rc->optimal_buffer_level = (optimal == 0) ? bandwidth / 8 - : optimal * bandwidth / 1000; - rc->maximum_buffer_size = (maximum == 0) ? bandwidth / 8 - : maximum * bandwidth / 1000; -} - -#if CONFIG_VP9_HIGHBITDEPTH -#define HIGHBD_BFP(BT, SDF, SDAF, VF, SVF, SVAF, SDX3F, SDX8F, SDX4DF) \ - cpi->fn_ptr[BT].sdf = SDF; \ - cpi->fn_ptr[BT].sdaf = SDAF; \ - cpi->fn_ptr[BT].vf = VF; \ - cpi->fn_ptr[BT].svf = SVF; \ - cpi->fn_ptr[BT].svaf = SVAF; \ - cpi->fn_ptr[BT].sdx3f = SDX3F; \ - cpi->fn_ptr[BT].sdx8f = SDX8F; \ - cpi->fn_ptr[BT].sdx4df = SDX4DF; - -#define MAKE_BFP_SAD_WRAPPER(fnname) \ -static unsigned int fnname##_bits8(const uint8_t *src_ptr, \ - int source_stride, \ - const uint8_t *ref_ptr, \ - int ref_stride) { \ - return fnname(src_ptr, source_stride, ref_ptr, ref_stride); \ -} \ -static unsigned int fnname##_bits10(const uint8_t *src_ptr, \ - int source_stride, \ - const uint8_t *ref_ptr, \ - int ref_stride) { \ - return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 2; \ -} \ -static unsigned int fnname##_bits12(const uint8_t *src_ptr, \ - int source_stride, \ - const uint8_t *ref_ptr, \ - int ref_stride) { \ - return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 4; \ -} - -#define MAKE_BFP_SADAVG_WRAPPER(fnname) static unsigned int \ -fnname##_bits8(const uint8_t *src_ptr, \ - int source_stride, \ - const uint8_t *ref_ptr, \ - int ref_stride, \ - const uint8_t *second_pred) { \ - return fnname(src_ptr, source_stride, ref_ptr, ref_stride, second_pred); \ -} \ -static unsigned int fnname##_bits10(const uint8_t *src_ptr, \ - int source_stride, \ - const uint8_t *ref_ptr, \ - int ref_stride, \ - const uint8_t *second_pred) { \ - return fnname(src_ptr, source_stride, ref_ptr, ref_stride, \ - second_pred) >> 2; \ -} \ -static unsigned int fnname##_bits12(const uint8_t *src_ptr, \ - int source_stride, \ - const uint8_t *ref_ptr, \ - int ref_stride, \ - const uint8_t *second_pred) { \ - return fnname(src_ptr, source_stride, ref_ptr, ref_stride, \ - second_pred) >> 4; \ -} - -#define MAKE_BFP_SAD3_WRAPPER(fnname) \ -static void fnname##_bits8(const uint8_t *src_ptr, \ - int source_stride, \ - const uint8_t *ref_ptr, \ - int ref_stride, \ - unsigned int *sad_array) { \ - fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array); \ -} \ -static void fnname##_bits10(const uint8_t *src_ptr, \ - int source_stride, \ - const uint8_t *ref_ptr, \ - int ref_stride, \ - unsigned int *sad_array) { \ - int i; \ - fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array); \ - for (i = 0; i < 3; i++) \ - sad_array[i] >>= 2; \ -} \ -static void fnname##_bits12(const uint8_t *src_ptr, \ - int source_stride, \ - const uint8_t *ref_ptr, \ - int ref_stride, \ - unsigned int *sad_array) { \ - int i; \ - fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array); \ - for (i = 0; i < 3; i++) \ - sad_array[i] >>= 4; \ -} - -#define MAKE_BFP_SAD8_WRAPPER(fnname) \ -static void fnname##_bits8(const uint8_t *src_ptr, \ - int source_stride, \ - const uint8_t *ref_ptr, \ - int ref_stride, \ - unsigned int *sad_array) { \ - fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array); \ -} \ -static void fnname##_bits10(const uint8_t *src_ptr, \ - int source_stride, \ - const uint8_t *ref_ptr, \ - int ref_stride, \ - unsigned int *sad_array) { \ - int i; \ - fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array); \ - for (i = 0; i < 8; i++) \ - sad_array[i] >>= 2; \ -} \ -static void fnname##_bits12(const uint8_t *src_ptr, \ - int source_stride, \ - const uint8_t *ref_ptr, \ - int ref_stride, \ - unsigned int *sad_array) { \ - int i; \ - fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array); \ - for (i = 0; i < 8; i++) \ - sad_array[i] >>= 4; \ -} -#define MAKE_BFP_SAD4D_WRAPPER(fnname) \ -static void fnname##_bits8(const uint8_t *src_ptr, \ - int source_stride, \ - const uint8_t* const ref_ptr[], \ - int ref_stride, \ - unsigned int *sad_array) { \ - fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array); \ -} \ -static void fnname##_bits10(const uint8_t *src_ptr, \ - int source_stride, \ - const uint8_t* const ref_ptr[], \ - int ref_stride, \ - unsigned int *sad_array) { \ - int i; \ - fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array); \ - for (i = 0; i < 4; i++) \ - sad_array[i] >>= 2; \ -} \ -static void fnname##_bits12(const uint8_t *src_ptr, \ - int source_stride, \ - const uint8_t* const ref_ptr[], \ - int ref_stride, \ - unsigned int *sad_array) { \ - int i; \ - fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array); \ - for (i = 0; i < 4; i++) \ - sad_array[i] >>= 4; \ -} - -MAKE_BFP_SAD_WRAPPER(vp9_highbd_sad32x16) -MAKE_BFP_SADAVG_WRAPPER(vp9_highbd_sad32x16_avg) -MAKE_BFP_SAD4D_WRAPPER(vp9_highbd_sad32x16x4d) -MAKE_BFP_SAD_WRAPPER(vp9_highbd_sad16x32) -MAKE_BFP_SADAVG_WRAPPER(vp9_highbd_sad16x32_avg) -MAKE_BFP_SAD4D_WRAPPER(vp9_highbd_sad16x32x4d) -MAKE_BFP_SAD_WRAPPER(vp9_highbd_sad64x32) -MAKE_BFP_SADAVG_WRAPPER(vp9_highbd_sad64x32_avg) -MAKE_BFP_SAD4D_WRAPPER(vp9_highbd_sad64x32x4d) -MAKE_BFP_SAD_WRAPPER(vp9_highbd_sad32x64) -MAKE_BFP_SADAVG_WRAPPER(vp9_highbd_sad32x64_avg) -MAKE_BFP_SAD4D_WRAPPER(vp9_highbd_sad32x64x4d) -MAKE_BFP_SAD_WRAPPER(vp9_highbd_sad32x32) -MAKE_BFP_SADAVG_WRAPPER(vp9_highbd_sad32x32_avg) -MAKE_BFP_SAD3_WRAPPER(vp9_highbd_sad32x32x3) -MAKE_BFP_SAD8_WRAPPER(vp9_highbd_sad32x32x8) -MAKE_BFP_SAD4D_WRAPPER(vp9_highbd_sad32x32x4d) -MAKE_BFP_SAD_WRAPPER(vp9_highbd_sad64x64) -MAKE_BFP_SADAVG_WRAPPER(vp9_highbd_sad64x64_avg) -MAKE_BFP_SAD3_WRAPPER(vp9_highbd_sad64x64x3) -MAKE_BFP_SAD8_WRAPPER(vp9_highbd_sad64x64x8) -MAKE_BFP_SAD4D_WRAPPER(vp9_highbd_sad64x64x4d) -MAKE_BFP_SAD_WRAPPER(vp9_highbd_sad16x16) -MAKE_BFP_SADAVG_WRAPPER(vp9_highbd_sad16x16_avg) -MAKE_BFP_SAD3_WRAPPER(vp9_highbd_sad16x16x3) -MAKE_BFP_SAD8_WRAPPER(vp9_highbd_sad16x16x8) -MAKE_BFP_SAD4D_WRAPPER(vp9_highbd_sad16x16x4d) -MAKE_BFP_SAD_WRAPPER(vp9_highbd_sad16x8) -MAKE_BFP_SADAVG_WRAPPER(vp9_highbd_sad16x8_avg) -MAKE_BFP_SAD3_WRAPPER(vp9_highbd_sad16x8x3) -MAKE_BFP_SAD8_WRAPPER(vp9_highbd_sad16x8x8) -MAKE_BFP_SAD4D_WRAPPER(vp9_highbd_sad16x8x4d) -MAKE_BFP_SAD_WRAPPER(vp9_highbd_sad8x16) -MAKE_BFP_SADAVG_WRAPPER(vp9_highbd_sad8x16_avg) -MAKE_BFP_SAD3_WRAPPER(vp9_highbd_sad8x16x3) -MAKE_BFP_SAD8_WRAPPER(vp9_highbd_sad8x16x8) -MAKE_BFP_SAD4D_WRAPPER(vp9_highbd_sad8x16x4d) -MAKE_BFP_SAD_WRAPPER(vp9_highbd_sad8x8) -MAKE_BFP_SADAVG_WRAPPER(vp9_highbd_sad8x8_avg) -MAKE_BFP_SAD3_WRAPPER(vp9_highbd_sad8x8x3) -MAKE_BFP_SAD8_WRAPPER(vp9_highbd_sad8x8x8) -MAKE_BFP_SAD4D_WRAPPER(vp9_highbd_sad8x8x4d) -MAKE_BFP_SAD_WRAPPER(vp9_highbd_sad8x4) -MAKE_BFP_SADAVG_WRAPPER(vp9_highbd_sad8x4_avg) -MAKE_BFP_SAD8_WRAPPER(vp9_highbd_sad8x4x8) -MAKE_BFP_SAD4D_WRAPPER(vp9_highbd_sad8x4x4d) -MAKE_BFP_SAD_WRAPPER(vp9_highbd_sad4x8) -MAKE_BFP_SADAVG_WRAPPER(vp9_highbd_sad4x8_avg) -MAKE_BFP_SAD8_WRAPPER(vp9_highbd_sad4x8x8) -MAKE_BFP_SAD4D_WRAPPER(vp9_highbd_sad4x8x4d) -MAKE_BFP_SAD_WRAPPER(vp9_highbd_sad4x4) -MAKE_BFP_SADAVG_WRAPPER(vp9_highbd_sad4x4_avg) -MAKE_BFP_SAD3_WRAPPER(vp9_highbd_sad4x4x3) -MAKE_BFP_SAD8_WRAPPER(vp9_highbd_sad4x4x8) -MAKE_BFP_SAD4D_WRAPPER(vp9_highbd_sad4x4x4d) - -static void highbd_set_var_fns(VP9_COMP *const cpi) { - VP9_COMMON *const cm = &cpi->common; - if (cm->use_highbitdepth) { - switch (cm->bit_depth) { - case VPX_BITS_8: - HIGHBD_BFP(BLOCK_32X16, - vp9_highbd_sad32x16_bits8, - vp9_highbd_sad32x16_avg_bits8, - vp9_highbd_variance32x16, - vp9_highbd_sub_pixel_variance32x16, - vp9_highbd_sub_pixel_avg_variance32x16, - NULL, - NULL, - vp9_highbd_sad32x16x4d_bits8) - - HIGHBD_BFP(BLOCK_16X32, - vp9_highbd_sad16x32_bits8, - vp9_highbd_sad16x32_avg_bits8, - vp9_highbd_variance16x32, - vp9_highbd_sub_pixel_variance16x32, - vp9_highbd_sub_pixel_avg_variance16x32, - NULL, - NULL, - vp9_highbd_sad16x32x4d_bits8) - - HIGHBD_BFP(BLOCK_64X32, - vp9_highbd_sad64x32_bits8, - vp9_highbd_sad64x32_avg_bits8, - vp9_highbd_variance64x32, - vp9_highbd_sub_pixel_variance64x32, - vp9_highbd_sub_pixel_avg_variance64x32, - NULL, - NULL, - vp9_highbd_sad64x32x4d_bits8) - - HIGHBD_BFP(BLOCK_32X64, - vp9_highbd_sad32x64_bits8, - vp9_highbd_sad32x64_avg_bits8, - vp9_highbd_variance32x64, - vp9_highbd_sub_pixel_variance32x64, - vp9_highbd_sub_pixel_avg_variance32x64, - NULL, - NULL, - vp9_highbd_sad32x64x4d_bits8) - - HIGHBD_BFP(BLOCK_32X32, - vp9_highbd_sad32x32_bits8, - vp9_highbd_sad32x32_avg_bits8, - vp9_highbd_variance32x32, - vp9_highbd_sub_pixel_variance32x32, - vp9_highbd_sub_pixel_avg_variance32x32, - vp9_highbd_sad32x32x3_bits8, - vp9_highbd_sad32x32x8_bits8, - vp9_highbd_sad32x32x4d_bits8) - - HIGHBD_BFP(BLOCK_64X64, - vp9_highbd_sad64x64_bits8, - vp9_highbd_sad64x64_avg_bits8, - vp9_highbd_variance64x64, - vp9_highbd_sub_pixel_variance64x64, - vp9_highbd_sub_pixel_avg_variance64x64, - vp9_highbd_sad64x64x3_bits8, - vp9_highbd_sad64x64x8_bits8, - vp9_highbd_sad64x64x4d_bits8) - - HIGHBD_BFP(BLOCK_16X16, - vp9_highbd_sad16x16_bits8, - vp9_highbd_sad16x16_avg_bits8, - vp9_highbd_variance16x16, - vp9_highbd_sub_pixel_variance16x16, - vp9_highbd_sub_pixel_avg_variance16x16, - vp9_highbd_sad16x16x3_bits8, - vp9_highbd_sad16x16x8_bits8, - vp9_highbd_sad16x16x4d_bits8) - - HIGHBD_BFP(BLOCK_16X8, - vp9_highbd_sad16x8_bits8, - vp9_highbd_sad16x8_avg_bits8, - vp9_highbd_variance16x8, - vp9_highbd_sub_pixel_variance16x8, - vp9_highbd_sub_pixel_avg_variance16x8, - vp9_highbd_sad16x8x3_bits8, - vp9_highbd_sad16x8x8_bits8, - vp9_highbd_sad16x8x4d_bits8) - - HIGHBD_BFP(BLOCK_8X16, - vp9_highbd_sad8x16_bits8, - vp9_highbd_sad8x16_avg_bits8, - vp9_highbd_variance8x16, - vp9_highbd_sub_pixel_variance8x16, - vp9_highbd_sub_pixel_avg_variance8x16, - vp9_highbd_sad8x16x3_bits8, - vp9_highbd_sad8x16x8_bits8, - vp9_highbd_sad8x16x4d_bits8) - - HIGHBD_BFP(BLOCK_8X8, - vp9_highbd_sad8x8_bits8, - vp9_highbd_sad8x8_avg_bits8, - vp9_highbd_variance8x8, - vp9_highbd_sub_pixel_variance8x8, - vp9_highbd_sub_pixel_avg_variance8x8, - vp9_highbd_sad8x8x3_bits8, - vp9_highbd_sad8x8x8_bits8, - vp9_highbd_sad8x8x4d_bits8) - - HIGHBD_BFP(BLOCK_8X4, - vp9_highbd_sad8x4_bits8, - vp9_highbd_sad8x4_avg_bits8, - vp9_highbd_variance8x4, - vp9_highbd_sub_pixel_variance8x4, - vp9_highbd_sub_pixel_avg_variance8x4, - NULL, - vp9_highbd_sad8x4x8_bits8, - vp9_highbd_sad8x4x4d_bits8) - - HIGHBD_BFP(BLOCK_4X8, - vp9_highbd_sad4x8_bits8, - vp9_highbd_sad4x8_avg_bits8, - vp9_highbd_variance4x8, - vp9_highbd_sub_pixel_variance4x8, - vp9_highbd_sub_pixel_avg_variance4x8, - NULL, - vp9_highbd_sad4x8x8_bits8, - vp9_highbd_sad4x8x4d_bits8) - - HIGHBD_BFP(BLOCK_4X4, - vp9_highbd_sad4x4_bits8, - vp9_highbd_sad4x4_avg_bits8, - vp9_highbd_variance4x4, - vp9_highbd_sub_pixel_variance4x4, - vp9_highbd_sub_pixel_avg_variance4x4, - vp9_highbd_sad4x4x3_bits8, - vp9_highbd_sad4x4x8_bits8, - vp9_highbd_sad4x4x4d_bits8) - break; - - case VPX_BITS_10: - HIGHBD_BFP(BLOCK_32X16, - vp9_highbd_sad32x16_bits10, - vp9_highbd_sad32x16_avg_bits10, - vp9_highbd_10_variance32x16, - vp9_highbd_10_sub_pixel_variance32x16, - vp9_highbd_10_sub_pixel_avg_variance32x16, - NULL, - NULL, - vp9_highbd_sad32x16x4d_bits10) - - HIGHBD_BFP(BLOCK_16X32, - vp9_highbd_sad16x32_bits10, - vp9_highbd_sad16x32_avg_bits10, - vp9_highbd_10_variance16x32, - vp9_highbd_10_sub_pixel_variance16x32, - vp9_highbd_10_sub_pixel_avg_variance16x32, - NULL, - NULL, - vp9_highbd_sad16x32x4d_bits10) - - HIGHBD_BFP(BLOCK_64X32, - vp9_highbd_sad64x32_bits10, - vp9_highbd_sad64x32_avg_bits10, - vp9_highbd_10_variance64x32, - vp9_highbd_10_sub_pixel_variance64x32, - vp9_highbd_10_sub_pixel_avg_variance64x32, - NULL, - NULL, - vp9_highbd_sad64x32x4d_bits10) - - HIGHBD_BFP(BLOCK_32X64, - vp9_highbd_sad32x64_bits10, - vp9_highbd_sad32x64_avg_bits10, - vp9_highbd_10_variance32x64, - vp9_highbd_10_sub_pixel_variance32x64, - vp9_highbd_10_sub_pixel_avg_variance32x64, - NULL, - NULL, - vp9_highbd_sad32x64x4d_bits10) - - HIGHBD_BFP(BLOCK_32X32, - vp9_highbd_sad32x32_bits10, - vp9_highbd_sad32x32_avg_bits10, - vp9_highbd_10_variance32x32, - vp9_highbd_10_sub_pixel_variance32x32, - vp9_highbd_10_sub_pixel_avg_variance32x32, - vp9_highbd_sad32x32x3_bits10, - vp9_highbd_sad32x32x8_bits10, - vp9_highbd_sad32x32x4d_bits10) - - HIGHBD_BFP(BLOCK_64X64, - vp9_highbd_sad64x64_bits10, - vp9_highbd_sad64x64_avg_bits10, - vp9_highbd_10_variance64x64, - vp9_highbd_10_sub_pixel_variance64x64, - vp9_highbd_10_sub_pixel_avg_variance64x64, - vp9_highbd_sad64x64x3_bits10, - vp9_highbd_sad64x64x8_bits10, - vp9_highbd_sad64x64x4d_bits10) - - HIGHBD_BFP(BLOCK_16X16, - vp9_highbd_sad16x16_bits10, - vp9_highbd_sad16x16_avg_bits10, - vp9_highbd_10_variance16x16, - vp9_highbd_10_sub_pixel_variance16x16, - vp9_highbd_10_sub_pixel_avg_variance16x16, - vp9_highbd_sad16x16x3_bits10, - vp9_highbd_sad16x16x8_bits10, - vp9_highbd_sad16x16x4d_bits10) - - HIGHBD_BFP(BLOCK_16X8, - vp9_highbd_sad16x8_bits10, - vp9_highbd_sad16x8_avg_bits10, - vp9_highbd_10_variance16x8, - vp9_highbd_10_sub_pixel_variance16x8, - vp9_highbd_10_sub_pixel_avg_variance16x8, - vp9_highbd_sad16x8x3_bits10, - vp9_highbd_sad16x8x8_bits10, - vp9_highbd_sad16x8x4d_bits10) - - HIGHBD_BFP(BLOCK_8X16, - vp9_highbd_sad8x16_bits10, - vp9_highbd_sad8x16_avg_bits10, - vp9_highbd_10_variance8x16, - vp9_highbd_10_sub_pixel_variance8x16, - vp9_highbd_10_sub_pixel_avg_variance8x16, - vp9_highbd_sad8x16x3_bits10, - vp9_highbd_sad8x16x8_bits10, - vp9_highbd_sad8x16x4d_bits10) - - HIGHBD_BFP(BLOCK_8X8, - vp9_highbd_sad8x8_bits10, - vp9_highbd_sad8x8_avg_bits10, - vp9_highbd_10_variance8x8, - vp9_highbd_10_sub_pixel_variance8x8, - vp9_highbd_10_sub_pixel_avg_variance8x8, - vp9_highbd_sad8x8x3_bits10, - vp9_highbd_sad8x8x8_bits10, - vp9_highbd_sad8x8x4d_bits10) - - HIGHBD_BFP(BLOCK_8X4, - vp9_highbd_sad8x4_bits10, - vp9_highbd_sad8x4_avg_bits10, - vp9_highbd_10_variance8x4, - vp9_highbd_10_sub_pixel_variance8x4, - vp9_highbd_10_sub_pixel_avg_variance8x4, - NULL, - vp9_highbd_sad8x4x8_bits10, - vp9_highbd_sad8x4x4d_bits10) - - HIGHBD_BFP(BLOCK_4X8, - vp9_highbd_sad4x8_bits10, - vp9_highbd_sad4x8_avg_bits10, - vp9_highbd_10_variance4x8, - vp9_highbd_10_sub_pixel_variance4x8, - vp9_highbd_10_sub_pixel_avg_variance4x8, - NULL, - vp9_highbd_sad4x8x8_bits10, - vp9_highbd_sad4x8x4d_bits10) - - HIGHBD_BFP(BLOCK_4X4, - vp9_highbd_sad4x4_bits10, - vp9_highbd_sad4x4_avg_bits10, - vp9_highbd_10_variance4x4, - vp9_highbd_10_sub_pixel_variance4x4, - vp9_highbd_10_sub_pixel_avg_variance4x4, - vp9_highbd_sad4x4x3_bits10, - vp9_highbd_sad4x4x8_bits10, - vp9_highbd_sad4x4x4d_bits10) - break; - - case VPX_BITS_12: - HIGHBD_BFP(BLOCK_32X16, - vp9_highbd_sad32x16_bits12, - vp9_highbd_sad32x16_avg_bits12, - vp9_highbd_12_variance32x16, - vp9_highbd_12_sub_pixel_variance32x16, - vp9_highbd_12_sub_pixel_avg_variance32x16, - NULL, - NULL, - vp9_highbd_sad32x16x4d_bits12) - - HIGHBD_BFP(BLOCK_16X32, - vp9_highbd_sad16x32_bits12, - vp9_highbd_sad16x32_avg_bits12, - vp9_highbd_12_variance16x32, - vp9_highbd_12_sub_pixel_variance16x32, - vp9_highbd_12_sub_pixel_avg_variance16x32, - NULL, - NULL, - vp9_highbd_sad16x32x4d_bits12) - - HIGHBD_BFP(BLOCK_64X32, - vp9_highbd_sad64x32_bits12, - vp9_highbd_sad64x32_avg_bits12, - vp9_highbd_12_variance64x32, - vp9_highbd_12_sub_pixel_variance64x32, - vp9_highbd_12_sub_pixel_avg_variance64x32, - NULL, - NULL, - vp9_highbd_sad64x32x4d_bits12) - - HIGHBD_BFP(BLOCK_32X64, - vp9_highbd_sad32x64_bits12, - vp9_highbd_sad32x64_avg_bits12, - vp9_highbd_12_variance32x64, - vp9_highbd_12_sub_pixel_variance32x64, - vp9_highbd_12_sub_pixel_avg_variance32x64, - NULL, - NULL, - vp9_highbd_sad32x64x4d_bits12) - - HIGHBD_BFP(BLOCK_32X32, - vp9_highbd_sad32x32_bits12, - vp9_highbd_sad32x32_avg_bits12, - vp9_highbd_12_variance32x32, - vp9_highbd_12_sub_pixel_variance32x32, - vp9_highbd_12_sub_pixel_avg_variance32x32, - vp9_highbd_sad32x32x3_bits12, - vp9_highbd_sad32x32x8_bits12, - vp9_highbd_sad32x32x4d_bits12) - - HIGHBD_BFP(BLOCK_64X64, - vp9_highbd_sad64x64_bits12, - vp9_highbd_sad64x64_avg_bits12, - vp9_highbd_12_variance64x64, - vp9_highbd_12_sub_pixel_variance64x64, - vp9_highbd_12_sub_pixel_avg_variance64x64, - vp9_highbd_sad64x64x3_bits12, - vp9_highbd_sad64x64x8_bits12, - vp9_highbd_sad64x64x4d_bits12) - - HIGHBD_BFP(BLOCK_16X16, - vp9_highbd_sad16x16_bits12, - vp9_highbd_sad16x16_avg_bits12, - vp9_highbd_12_variance16x16, - vp9_highbd_12_sub_pixel_variance16x16, - vp9_highbd_12_sub_pixel_avg_variance16x16, - vp9_highbd_sad16x16x3_bits12, - vp9_highbd_sad16x16x8_bits12, - vp9_highbd_sad16x16x4d_bits12) - - HIGHBD_BFP(BLOCK_16X8, - vp9_highbd_sad16x8_bits12, - vp9_highbd_sad16x8_avg_bits12, - vp9_highbd_12_variance16x8, - vp9_highbd_12_sub_pixel_variance16x8, - vp9_highbd_12_sub_pixel_avg_variance16x8, - vp9_highbd_sad16x8x3_bits12, - vp9_highbd_sad16x8x8_bits12, - vp9_highbd_sad16x8x4d_bits12) - - HIGHBD_BFP(BLOCK_8X16, - vp9_highbd_sad8x16_bits12, - vp9_highbd_sad8x16_avg_bits12, - vp9_highbd_12_variance8x16, - vp9_highbd_12_sub_pixel_variance8x16, - vp9_highbd_12_sub_pixel_avg_variance8x16, - vp9_highbd_sad8x16x3_bits12, - vp9_highbd_sad8x16x8_bits12, - vp9_highbd_sad8x16x4d_bits12) - - HIGHBD_BFP(BLOCK_8X8, - vp9_highbd_sad8x8_bits12, - vp9_highbd_sad8x8_avg_bits12, - vp9_highbd_12_variance8x8, - vp9_highbd_12_sub_pixel_variance8x8, - vp9_highbd_12_sub_pixel_avg_variance8x8, - vp9_highbd_sad8x8x3_bits12, - vp9_highbd_sad8x8x8_bits12, - vp9_highbd_sad8x8x4d_bits12) - - HIGHBD_BFP(BLOCK_8X4, - vp9_highbd_sad8x4_bits12, - vp9_highbd_sad8x4_avg_bits12, - vp9_highbd_12_variance8x4, - vp9_highbd_12_sub_pixel_variance8x4, - vp9_highbd_12_sub_pixel_avg_variance8x4, - NULL, - vp9_highbd_sad8x4x8_bits12, - vp9_highbd_sad8x4x4d_bits12) - - HIGHBD_BFP(BLOCK_4X8, - vp9_highbd_sad4x8_bits12, - vp9_highbd_sad4x8_avg_bits12, - vp9_highbd_12_variance4x8, - vp9_highbd_12_sub_pixel_variance4x8, - vp9_highbd_12_sub_pixel_avg_variance4x8, - NULL, - vp9_highbd_sad4x8x8_bits12, - vp9_highbd_sad4x8x4d_bits12) - - HIGHBD_BFP(BLOCK_4X4, - vp9_highbd_sad4x4_bits12, - vp9_highbd_sad4x4_avg_bits12, - vp9_highbd_12_variance4x4, - vp9_highbd_12_sub_pixel_variance4x4, - vp9_highbd_12_sub_pixel_avg_variance4x4, - vp9_highbd_sad4x4x3_bits12, - vp9_highbd_sad4x4x8_bits12, - vp9_highbd_sad4x4x4d_bits12) - break; - - default: - assert(0 && "cm->bit_depth should be VPX_BITS_8, " - "VPX_BITS_10 or VPX_BITS_12"); - } - } -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -static void realloc_segmentation_maps(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - - // Create the encoder segmentation map and set all entries to 0 - vpx_free(cpi->segmentation_map); - CHECK_MEM_ERROR(cm, cpi->segmentation_map, - vpx_calloc(cm->mi_rows * cm->mi_cols, 1)); - - // Create a map used for cyclic background refresh. - if (cpi->cyclic_refresh) - vp9_cyclic_refresh_free(cpi->cyclic_refresh); - CHECK_MEM_ERROR(cm, cpi->cyclic_refresh, - vp9_cyclic_refresh_alloc(cm->mi_rows, cm->mi_cols)); - - // Create a map used to mark inactive areas. - vpx_free(cpi->active_map.map); - CHECK_MEM_ERROR(cm, cpi->active_map.map, - vpx_calloc(cm->mi_rows * cm->mi_cols, 1)); - - // And a place holder structure is the coding context - // for use if we want to save and restore it - vpx_free(cpi->coding_context.last_frame_seg_map_copy); - CHECK_MEM_ERROR(cm, cpi->coding_context.last_frame_seg_map_copy, - vpx_calloc(cm->mi_rows * cm->mi_cols, 1)); -} - -void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) { - VP9_COMMON *const cm = &cpi->common; - RATE_CONTROL *const rc = &cpi->rc; - - if (cm->profile != oxcf->profile) - cm->profile = oxcf->profile; - cm->bit_depth = oxcf->bit_depth; - cm->color_space = oxcf->color_space; - - if (cm->profile <= PROFILE_1) - assert(cm->bit_depth == VPX_BITS_8); - else - assert(cm->bit_depth > VPX_BITS_8); - - cpi->oxcf = *oxcf; -#if CONFIG_VP9_HIGHBITDEPTH - cpi->td.mb.e_mbd.bd = (int)cm->bit_depth; -#endif // CONFIG_VP9_HIGHBITDEPTH - - rc->baseline_gf_interval = DEFAULT_GF_INTERVAL; - - cpi->refresh_golden_frame = 0; - cpi->refresh_last_frame = 1; - cm->refresh_frame_context = 1; - cm->reset_frame_context = 0; - - vp9_reset_segment_features(&cm->seg); - vp9_set_high_precision_mv(cpi, 0); - - { - int i; - - for (i = 0; i < MAX_SEGMENTS; i++) - cpi->segment_encode_breakout[i] = cpi->oxcf.encode_breakout; - } - cpi->encode_breakout = cpi->oxcf.encode_breakout; - - set_rc_buffer_sizes(rc, &cpi->oxcf); - - // Under a configuration change, where maximum_buffer_size may change, - // keep buffer level clipped to the maximum allowed buffer size. - rc->bits_off_target = MIN(rc->bits_off_target, rc->maximum_buffer_size); - rc->buffer_level = MIN(rc->buffer_level, rc->maximum_buffer_size); - - // Set up frame rate and related parameters rate control values. - vp9_new_framerate(cpi, cpi->framerate); - - // Set absolute upper and lower quality limits - rc->worst_quality = cpi->oxcf.worst_allowed_q; - rc->best_quality = cpi->oxcf.best_allowed_q; - - cm->interp_filter = cpi->sf.default_interp_filter; - - cm->display_width = cpi->oxcf.width; - cm->display_height = cpi->oxcf.height; - cm->width = cpi->oxcf.width; - cm->height = cpi->oxcf.height; - - if (cpi->initial_width) { - if (cm->width > cpi->initial_width || cm->height > cpi->initial_height) { - vp9_free_context_buffers(cm); - vp9_alloc_compressor_data(cpi); - realloc_segmentation_maps(cpi); - cpi->initial_width = cpi->initial_height = 0; - } - } - update_frame_size(cpi); - - if ((cpi->svc.number_temporal_layers > 1 && - cpi->oxcf.rc_mode == VPX_CBR) || - ((cpi->svc.number_temporal_layers > 1 || - cpi->svc.number_spatial_layers > 1) && - cpi->oxcf.pass != 1)) { - vp9_update_layer_context_change_config(cpi, - (int)cpi->oxcf.target_bandwidth); - } - - cpi->alt_ref_source = NULL; - rc->is_src_frame_alt_ref = 0; - -#if 0 - // Experimental RD Code - cpi->frame_distortion = 0; - cpi->last_frame_distortion = 0; -#endif - - set_tile_limits(cpi); - - cpi->ext_refresh_frame_flags_pending = 0; - cpi->ext_refresh_frame_context_pending = 0; - -#if CONFIG_VP9_HIGHBITDEPTH - highbd_set_var_fns(cpi); -#endif -} - -#ifndef M_LOG2_E -#define M_LOG2_E 0.693147180559945309417 -#endif -#define log2f(x) (log (x) / (float) M_LOG2_E) - -static void cal_nmvjointsadcost(int *mvjointsadcost) { - mvjointsadcost[0] = 600; - mvjointsadcost[1] = 300; - mvjointsadcost[2] = 300; - mvjointsadcost[3] = 300; -} - -static void cal_nmvsadcosts(int *mvsadcost[2]) { - int i = 1; - - mvsadcost[0][0] = 0; - mvsadcost[1][0] = 0; - - do { - double z = 256 * (2 * (log2f(8 * i) + .6)); - mvsadcost[0][i] = (int)z; - mvsadcost[1][i] = (int)z; - mvsadcost[0][-i] = (int)z; - mvsadcost[1][-i] = (int)z; - } while (++i <= MV_MAX); -} - -static void cal_nmvsadcosts_hp(int *mvsadcost[2]) { - int i = 1; - - mvsadcost[0][0] = 0; - mvsadcost[1][0] = 0; - - do { - double z = 256 * (2 * (log2f(8 * i) + .6)); - mvsadcost[0][i] = (int)z; - mvsadcost[1][i] = (int)z; - mvsadcost[0][-i] = (int)z; - mvsadcost[1][-i] = (int)z; - } while (++i <= MV_MAX); -} - - -VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf, - BufferPool *const pool) { - unsigned int i; - VP9_COMP *volatile const cpi = vpx_memalign(32, sizeof(VP9_COMP)); - VP9_COMMON *volatile const cm = cpi != NULL ? &cpi->common : NULL; - - if (!cm) - return NULL; - - vp9_zero(*cpi); - - if (setjmp(cm->error.jmp)) { - cm->error.setjmp = 0; - vp9_remove_compressor(cpi); - return 0; - } - - cm->error.setjmp = 1; - cm->alloc_mi = vp9_enc_alloc_mi; - cm->free_mi = vp9_enc_free_mi; - cm->setup_mi = vp9_enc_setup_mi; - - CHECK_MEM_ERROR(cm, cm->fc, - (FRAME_CONTEXT *)vpx_calloc(1, sizeof(*cm->fc))); - CHECK_MEM_ERROR(cm, cm->frame_contexts, - (FRAME_CONTEXT *)vpx_calloc(FRAME_CONTEXTS, - sizeof(*cm->frame_contexts))); - - cpi->use_svc = 0; - cpi->common.buffer_pool = pool; - - init_config(cpi, oxcf); - vp9_rc_init(&cpi->oxcf, oxcf->pass, &cpi->rc); - - cm->current_video_frame = 0; - cpi->partition_search_skippable_frame = 0; - cpi->tile_data = NULL; - - realloc_segmentation_maps(cpi); - - CHECK_MEM_ERROR(cm, cpi->nmvcosts[0], - vpx_calloc(MV_VALS, sizeof(*cpi->nmvcosts[0]))); - CHECK_MEM_ERROR(cm, cpi->nmvcosts[1], - vpx_calloc(MV_VALS, sizeof(*cpi->nmvcosts[1]))); - CHECK_MEM_ERROR(cm, cpi->nmvcosts_hp[0], - vpx_calloc(MV_VALS, sizeof(*cpi->nmvcosts_hp[0]))); - CHECK_MEM_ERROR(cm, cpi->nmvcosts_hp[1], - vpx_calloc(MV_VALS, sizeof(*cpi->nmvcosts_hp[1]))); - CHECK_MEM_ERROR(cm, cpi->nmvsadcosts[0], - vpx_calloc(MV_VALS, sizeof(*cpi->nmvsadcosts[0]))); - CHECK_MEM_ERROR(cm, cpi->nmvsadcosts[1], - vpx_calloc(MV_VALS, sizeof(*cpi->nmvsadcosts[1]))); - CHECK_MEM_ERROR(cm, cpi->nmvsadcosts_hp[0], - vpx_calloc(MV_VALS, sizeof(*cpi->nmvsadcosts_hp[0]))); - CHECK_MEM_ERROR(cm, cpi->nmvsadcosts_hp[1], - vpx_calloc(MV_VALS, sizeof(*cpi->nmvsadcosts_hp[1]))); - - for (i = 0; i < (sizeof(cpi->mbgraph_stats) / - sizeof(cpi->mbgraph_stats[0])); i++) { - CHECK_MEM_ERROR(cm, cpi->mbgraph_stats[i].mb_stats, - vpx_calloc(cm->MBs * - sizeof(*cpi->mbgraph_stats[i].mb_stats), 1)); - } - -#if CONFIG_FP_MB_STATS - cpi->use_fp_mb_stats = 0; - if (cpi->use_fp_mb_stats) { - // a place holder used to store the first pass mb stats in the first pass - CHECK_MEM_ERROR(cm, cpi->twopass.frame_mb_stats_buf, - vpx_calloc(cm->MBs * sizeof(uint8_t), 1)); - } else { - cpi->twopass.frame_mb_stats_buf = NULL; - } -#endif - - cpi->refresh_alt_ref_frame = 0; - cpi->multi_arf_last_grp_enabled = 0; - - cpi->b_calculate_psnr = CONFIG_INTERNAL_STATS; -#if CONFIG_INTERNAL_STATS - cpi->b_calculate_ssimg = 0; - - cpi->count = 0; - cpi->bytes = 0; - - if (cpi->b_calculate_psnr) { - cpi->total_y = 0.0; - cpi->total_u = 0.0; - cpi->total_v = 0.0; - cpi->total = 0.0; - cpi->total_sq_error = 0; - cpi->total_samples = 0; - - cpi->totalp_y = 0.0; - cpi->totalp_u = 0.0; - cpi->totalp_v = 0.0; - cpi->totalp = 0.0; - cpi->totalp_sq_error = 0; - cpi->totalp_samples = 0; - - cpi->tot_recode_hits = 0; - cpi->summed_quality = 0; - cpi->summed_weights = 0; - cpi->summedp_quality = 0; - cpi->summedp_weights = 0; - } - - if (cpi->b_calculate_ssimg) { - cpi->total_ssimg_y = 0; - cpi->total_ssimg_u = 0; - cpi->total_ssimg_v = 0; - cpi->total_ssimg_all = 0; - } - -#endif - - cpi->first_time_stamp_ever = INT64_MAX; - - cal_nmvjointsadcost(cpi->td.mb.nmvjointsadcost); - cpi->td.mb.nmvcost[0] = &cpi->nmvcosts[0][MV_MAX]; - cpi->td.mb.nmvcost[1] = &cpi->nmvcosts[1][MV_MAX]; - cpi->td.mb.nmvsadcost[0] = &cpi->nmvsadcosts[0][MV_MAX]; - cpi->td.mb.nmvsadcost[1] = &cpi->nmvsadcosts[1][MV_MAX]; - cal_nmvsadcosts(cpi->td.mb.nmvsadcost); - - cpi->td.mb.nmvcost_hp[0] = &cpi->nmvcosts_hp[0][MV_MAX]; - cpi->td.mb.nmvcost_hp[1] = &cpi->nmvcosts_hp[1][MV_MAX]; - cpi->td.mb.nmvsadcost_hp[0] = &cpi->nmvsadcosts_hp[0][MV_MAX]; - cpi->td.mb.nmvsadcost_hp[1] = &cpi->nmvsadcosts_hp[1][MV_MAX]; - cal_nmvsadcosts_hp(cpi->td.mb.nmvsadcost_hp); - -#if CONFIG_VP9_TEMPORAL_DENOISING -#ifdef OUTPUT_YUV_DENOISED - yuv_denoised_file = fopen("denoised.yuv", "ab"); -#endif -#endif -#ifdef OUTPUT_YUV_SKINMAP - yuv_skinmap_file = fopen("skinmap.yuv", "ab"); -#endif -#ifdef OUTPUT_YUV_REC - yuv_rec_file = fopen("rec.yuv", "wb"); -#endif - -#if 0 - framepsnr = fopen("framepsnr.stt", "a"); - kf_list = fopen("kf_list.stt", "w"); -#endif - - cpi->allow_encode_breakout = ENCODE_BREAKOUT_ENABLED; - - if (oxcf->pass == 1) { - vp9_init_first_pass(cpi); - } else if (oxcf->pass == 2) { - const size_t packet_sz = sizeof(FIRSTPASS_STATS); - const int packets = (int)(oxcf->two_pass_stats_in.sz / packet_sz); - - if (cpi->svc.number_spatial_layers > 1 - || cpi->svc.number_temporal_layers > 1) { - FIRSTPASS_STATS *const stats = oxcf->two_pass_stats_in.buf; - FIRSTPASS_STATS *stats_copy[VPX_SS_MAX_LAYERS] = {0}; - int i; - - for (i = 0; i < oxcf->ss_number_layers; ++i) { - FIRSTPASS_STATS *const last_packet_for_layer = - &stats[packets - oxcf->ss_number_layers + i]; - const int layer_id = (int)last_packet_for_layer->spatial_layer_id; - const int packets_in_layer = (int)last_packet_for_layer->count + 1; - if (layer_id >= 0 && layer_id < oxcf->ss_number_layers) { - LAYER_CONTEXT *const lc = &cpi->svc.layer_context[layer_id]; - - vpx_free(lc->rc_twopass_stats_in.buf); - - lc->rc_twopass_stats_in.sz = packets_in_layer * packet_sz; - CHECK_MEM_ERROR(cm, lc->rc_twopass_stats_in.buf, - vpx_malloc(lc->rc_twopass_stats_in.sz)); - lc->twopass.stats_in_start = lc->rc_twopass_stats_in.buf; - lc->twopass.stats_in = lc->twopass.stats_in_start; - lc->twopass.stats_in_end = lc->twopass.stats_in_start - + packets_in_layer - 1; - stats_copy[layer_id] = lc->rc_twopass_stats_in.buf; - } - } - - for (i = 0; i < packets; ++i) { - const int layer_id = (int)stats[i].spatial_layer_id; - if (layer_id >= 0 && layer_id < oxcf->ss_number_layers - && stats_copy[layer_id] != NULL) { - *stats_copy[layer_id] = stats[i]; - ++stats_copy[layer_id]; - } - } - - vp9_init_second_pass_spatial_svc(cpi); - } else { -#if CONFIG_FP_MB_STATS - if (cpi->use_fp_mb_stats) { - const size_t psz = cpi->common.MBs * sizeof(uint8_t); - const int ps = (int)(oxcf->firstpass_mb_stats_in.sz / psz); - - cpi->twopass.firstpass_mb_stats.mb_stats_start = - oxcf->firstpass_mb_stats_in.buf; - cpi->twopass.firstpass_mb_stats.mb_stats_end = - cpi->twopass.firstpass_mb_stats.mb_stats_start + - (ps - 1) * cpi->common.MBs * sizeof(uint8_t); - } -#endif - - cpi->twopass.stats_in_start = oxcf->two_pass_stats_in.buf; - cpi->twopass.stats_in = cpi->twopass.stats_in_start; - cpi->twopass.stats_in_end = &cpi->twopass.stats_in[packets - 1]; - - vp9_init_second_pass(cpi); - } - } - - vp9_set_speed_features_framesize_independent(cpi); - vp9_set_speed_features_framesize_dependent(cpi); - - // Allocate memory to store variances for a frame. - CHECK_MEM_ERROR(cm, cpi->source_diff_var, - vpx_calloc(cm->MBs, sizeof(diff))); - cpi->source_var_thresh = 0; - cpi->frames_till_next_var_check = 0; - -#define BFP(BT, SDF, SDAF, VF, SVF, SVAF, SDX3F, SDX8F, SDX4DF)\ - cpi->fn_ptr[BT].sdf = SDF; \ - cpi->fn_ptr[BT].sdaf = SDAF; \ - cpi->fn_ptr[BT].vf = VF; \ - cpi->fn_ptr[BT].svf = SVF; \ - cpi->fn_ptr[BT].svaf = SVAF; \ - cpi->fn_ptr[BT].sdx3f = SDX3F; \ - cpi->fn_ptr[BT].sdx8f = SDX8F; \ - cpi->fn_ptr[BT].sdx4df = SDX4DF; - - BFP(BLOCK_32X16, vp9_sad32x16, vp9_sad32x16_avg, - vp9_variance32x16, vp9_sub_pixel_variance32x16, - vp9_sub_pixel_avg_variance32x16, NULL, NULL, vp9_sad32x16x4d) - - BFP(BLOCK_16X32, vp9_sad16x32, vp9_sad16x32_avg, - vp9_variance16x32, vp9_sub_pixel_variance16x32, - vp9_sub_pixel_avg_variance16x32, NULL, NULL, vp9_sad16x32x4d) - - BFP(BLOCK_64X32, vp9_sad64x32, vp9_sad64x32_avg, - vp9_variance64x32, vp9_sub_pixel_variance64x32, - vp9_sub_pixel_avg_variance64x32, NULL, NULL, vp9_sad64x32x4d) - - BFP(BLOCK_32X64, vp9_sad32x64, vp9_sad32x64_avg, - vp9_variance32x64, vp9_sub_pixel_variance32x64, - vp9_sub_pixel_avg_variance32x64, NULL, NULL, vp9_sad32x64x4d) - - BFP(BLOCK_32X32, vp9_sad32x32, vp9_sad32x32_avg, - vp9_variance32x32, vp9_sub_pixel_variance32x32, - vp9_sub_pixel_avg_variance32x32, vp9_sad32x32x3, vp9_sad32x32x8, - vp9_sad32x32x4d) - - BFP(BLOCK_64X64, vp9_sad64x64, vp9_sad64x64_avg, - vp9_variance64x64, vp9_sub_pixel_variance64x64, - vp9_sub_pixel_avg_variance64x64, vp9_sad64x64x3, vp9_sad64x64x8, - vp9_sad64x64x4d) - - BFP(BLOCK_16X16, vp9_sad16x16, vp9_sad16x16_avg, - vp9_variance16x16, vp9_sub_pixel_variance16x16, - vp9_sub_pixel_avg_variance16x16, vp9_sad16x16x3, vp9_sad16x16x8, - vp9_sad16x16x4d) - - BFP(BLOCK_16X8, vp9_sad16x8, vp9_sad16x8_avg, - vp9_variance16x8, vp9_sub_pixel_variance16x8, - vp9_sub_pixel_avg_variance16x8, - vp9_sad16x8x3, vp9_sad16x8x8, vp9_sad16x8x4d) - - BFP(BLOCK_8X16, vp9_sad8x16, vp9_sad8x16_avg, - vp9_variance8x16, vp9_sub_pixel_variance8x16, - vp9_sub_pixel_avg_variance8x16, - vp9_sad8x16x3, vp9_sad8x16x8, vp9_sad8x16x4d) - - BFP(BLOCK_8X8, vp9_sad8x8, vp9_sad8x8_avg, - vp9_variance8x8, vp9_sub_pixel_variance8x8, - vp9_sub_pixel_avg_variance8x8, - vp9_sad8x8x3, vp9_sad8x8x8, vp9_sad8x8x4d) - - BFP(BLOCK_8X4, vp9_sad8x4, vp9_sad8x4_avg, - vp9_variance8x4, vp9_sub_pixel_variance8x4, - vp9_sub_pixel_avg_variance8x4, NULL, vp9_sad8x4x8, vp9_sad8x4x4d) - - BFP(BLOCK_4X8, vp9_sad4x8, vp9_sad4x8_avg, - vp9_variance4x8, vp9_sub_pixel_variance4x8, - vp9_sub_pixel_avg_variance4x8, NULL, vp9_sad4x8x8, vp9_sad4x8x4d) - - BFP(BLOCK_4X4, vp9_sad4x4, vp9_sad4x4_avg, - vp9_variance4x4, vp9_sub_pixel_variance4x4, - vp9_sub_pixel_avg_variance4x4, - vp9_sad4x4x3, vp9_sad4x4x8, vp9_sad4x4x4d) - -#if CONFIG_VP9_HIGHBITDEPTH - highbd_set_var_fns(cpi); -#endif - - /* vp9_init_quantizer() is first called here. Add check in - * vp9_frame_init_quantizer() so that vp9_init_quantizer is only - * called later when needed. This will avoid unnecessary calls of - * vp9_init_quantizer() for every frame. - */ - vp9_init_quantizer(cpi); - - vp9_loop_filter_init(cm); - - cm->error.setjmp = 0; - - return cpi; -} - -void vp9_remove_compressor(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - unsigned int i; - int t; - - if (!cpi) - return; - - if (cpi && (cm->current_video_frame > 0)) { -#if CONFIG_INTERNAL_STATS - - vp9_clear_system_state(); - - // printf("\n8x8-4x4:%d-%d\n", cpi->t8x8_count, cpi->t4x4_count); - if (cpi->oxcf.pass != 1) { - FILE *f = fopen("opsnr.stt", "a"); - double time_encoded = (cpi->last_end_time_stamp_seen - - cpi->first_time_stamp_ever) / 10000000.000; - double total_encode_time = (cpi->time_receive_data + - cpi->time_compress_data) / 1000.000; - const double dr = - (double)cpi->bytes * (double) 8 / (double)1000 / time_encoded; - const double peak = (double)((1 << cpi->oxcf.input_bit_depth) - 1); - - if (cpi->b_calculate_psnr) { - const double total_psnr = - vpx_sse_to_psnr((double)cpi->total_samples, peak, - (double)cpi->total_sq_error); - const double totalp_psnr = - vpx_sse_to_psnr((double)cpi->totalp_samples, peak, - (double)cpi->totalp_sq_error); - const double total_ssim = 100 * pow(cpi->summed_quality / - cpi->summed_weights, 8.0); - const double totalp_ssim = 100 * pow(cpi->summedp_quality / - cpi->summedp_weights, 8.0); - - fprintf(f, "Bitrate\tAVGPsnr\tGLBPsnr\tAVPsnrP\tGLPsnrP\t" - "VPXSSIM\tVPSSIMP\t Time(ms)\n"); - fprintf(f, "%7.2f\t%7.3f\t%7.3f\t%7.3f\t%7.3f\t%7.3f\t%7.3f\t%8.0f\n", - dr, cpi->total / cpi->count, total_psnr, - cpi->totalp / cpi->count, totalp_psnr, total_ssim, totalp_ssim, - total_encode_time); - } - - if (cpi->b_calculate_ssimg) { - fprintf(f, "BitRate\tSSIM_Y\tSSIM_U\tSSIM_V\tSSIM_A\t Time(ms)\n"); - fprintf(f, "%7.2f\t%6.4f\t%6.4f\t%6.4f\t%6.4f\t%8.0f\n", dr, - cpi->total_ssimg_y / cpi->count, - cpi->total_ssimg_u / cpi->count, - cpi->total_ssimg_v / cpi->count, - cpi->total_ssimg_all / cpi->count, total_encode_time); - } - - fclose(f); - } - -#endif - -#if 0 - { - printf("\n_pick_loop_filter_level:%d\n", cpi->time_pick_lpf / 1000); - printf("\n_frames recive_data encod_mb_row compress_frame Total\n"); - printf("%6d %10ld %10ld %10ld %10ld\n", cpi->common.current_video_frame, - cpi->time_receive_data / 1000, cpi->time_encode_sb_row / 1000, - cpi->time_compress_data / 1000, - (cpi->time_receive_data + cpi->time_compress_data) / 1000); - } -#endif - } - -#if CONFIG_VP9_TEMPORAL_DENOISING - vp9_denoiser_free(&(cpi->denoiser)); -#endif - - for (t = 0; t < cpi->num_workers; ++t) { - VP9Worker *const worker = &cpi->workers[t]; - EncWorkerData *const thread_data = &cpi->tile_thr_data[t]; - - // Deallocate allocated threads. - vp9_get_worker_interface()->end(worker); - - // Deallocate allocated thread data. - if (t < cpi->num_workers - 1) { - vpx_free(thread_data->td->counts); - vp9_free_pc_tree(thread_data->td); - vpx_free(thread_data->td); - } - } - vpx_free(cpi->tile_thr_data); - vpx_free(cpi->workers); - - if (cpi->num_workers > 1) - vp9_loop_filter_dealloc(&cpi->lf_row_sync); - - dealloc_compressor_data(cpi); - - for (i = 0; i < sizeof(cpi->mbgraph_stats) / - sizeof(cpi->mbgraph_stats[0]); ++i) { - vpx_free(cpi->mbgraph_stats[i].mb_stats); - } - -#if CONFIG_FP_MB_STATS - if (cpi->use_fp_mb_stats) { - vpx_free(cpi->twopass.frame_mb_stats_buf); - cpi->twopass.frame_mb_stats_buf = NULL; - } -#endif - - vp9_remove_common(cm); - vpx_free(cpi); - -#if CONFIG_VP9_TEMPORAL_DENOISING -#ifdef OUTPUT_YUV_DENOISED - fclose(yuv_denoised_file); -#endif -#endif -#ifdef OUTPUT_YUV_SKINMAP - fclose(yuv_skinmap_file); -#endif -#ifdef OUTPUT_YUV_REC - fclose(yuv_rec_file); -#endif - -#if 0 - - if (keyfile) - fclose(keyfile); - - if (framepsnr) - fclose(framepsnr); - - if (kf_list) - fclose(kf_list); - -#endif -} - -static int64_t get_sse(const uint8_t *a, int a_stride, - const uint8_t *b, int b_stride, - int width, int height) { - const int dw = width % 16; - const int dh = height % 16; - int64_t total_sse = 0; - unsigned int sse = 0; - int sum = 0; - int x, y; - - if (dw > 0) { - variance(&a[width - dw], a_stride, &b[width - dw], b_stride, - dw, height, &sse, &sum); - total_sse += sse; - } - - if (dh > 0) { - variance(&a[(height - dh) * a_stride], a_stride, - &b[(height - dh) * b_stride], b_stride, - width - dw, dh, &sse, &sum); - total_sse += sse; - } - - for (y = 0; y < height / 16; ++y) { - const uint8_t *pa = a; - const uint8_t *pb = b; - for (x = 0; x < width / 16; ++x) { - vp9_mse16x16(pa, a_stride, pb, b_stride, &sse); - total_sse += sse; - - pa += 16; - pb += 16; - } - - a += 16 * a_stride; - b += 16 * b_stride; - } - - return total_sse; -} - -#if CONFIG_VP9_HIGHBITDEPTH -static int64_t highbd_get_sse_shift(const uint8_t *a8, int a_stride, - const uint8_t *b8, int b_stride, - int width, int height, - unsigned int input_shift) { - const uint16_t *a = CONVERT_TO_SHORTPTR(a8); - const uint16_t *b = CONVERT_TO_SHORTPTR(b8); - int64_t total_sse = 0; - int x, y; - for (y = 0; y < height; ++y) { - for (x = 0; x < width; ++x) { - int64_t diff; - diff = (a[x] >> input_shift) - (b[x] >> input_shift); - total_sse += diff * diff; - } - a += a_stride; - b += b_stride; - } - return total_sse; -} - -static int64_t highbd_get_sse(const uint8_t *a, int a_stride, - const uint8_t *b, int b_stride, - int width, int height) { - int64_t total_sse = 0; - int x, y; - const int dw = width % 16; - const int dh = height % 16; - unsigned int sse = 0; - int sum = 0; - if (dw > 0) { - highbd_variance(&a[width - dw], a_stride, &b[width - dw], b_stride, - dw, height, &sse, &sum); - total_sse += sse; - } - if (dh > 0) { - highbd_variance(&a[(height - dh) * a_stride], a_stride, - &b[(height - dh) * b_stride], b_stride, - width - dw, dh, &sse, &sum); - total_sse += sse; - } - for (y = 0; y < height / 16; ++y) { - const uint8_t *pa = a; - const uint8_t *pb = b; - for (x = 0; x < width / 16; ++x) { - vp9_highbd_mse16x16(pa, a_stride, pb, b_stride, &sse); - total_sse += sse; - pa += 16; - pb += 16; - } - a += 16 * a_stride; - b += 16 * b_stride; - } - return total_sse; -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -typedef struct { - double psnr[4]; // total/y/u/v - uint64_t sse[4]; // total/y/u/v - uint32_t samples[4]; // total/y/u/v -} PSNR_STATS; - -static void calc_psnr(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b, - PSNR_STATS *psnr) { - static const double peak = 255.0; - const int widths[3] = { - a->y_crop_width, a->uv_crop_width, a->uv_crop_width}; - const int heights[3] = { - a->y_crop_height, a->uv_crop_height, a->uv_crop_height}; - const uint8_t *a_planes[3] = {a->y_buffer, a->u_buffer, a->v_buffer}; - const int a_strides[3] = {a->y_stride, a->uv_stride, a->uv_stride}; - const uint8_t *b_planes[3] = {b->y_buffer, b->u_buffer, b->v_buffer}; - const int b_strides[3] = {b->y_stride, b->uv_stride, b->uv_stride}; - int i; - uint64_t total_sse = 0; - uint32_t total_samples = 0; - - for (i = 0; i < 3; ++i) { - const int w = widths[i]; - const int h = heights[i]; - const uint32_t samples = w * h; - const uint64_t sse = get_sse(a_planes[i], a_strides[i], - b_planes[i], b_strides[i], - w, h); - psnr->sse[1 + i] = sse; - psnr->samples[1 + i] = samples; - psnr->psnr[1 + i] = vpx_sse_to_psnr(samples, peak, (double)sse); - - total_sse += sse; - total_samples += samples; - } - - psnr->sse[0] = total_sse; - psnr->samples[0] = total_samples; - psnr->psnr[0] = vpx_sse_to_psnr((double)total_samples, peak, - (double)total_sse); -} - -#if CONFIG_VP9_HIGHBITDEPTH -static void calc_highbd_psnr(const YV12_BUFFER_CONFIG *a, - const YV12_BUFFER_CONFIG *b, - PSNR_STATS *psnr, - unsigned int bit_depth, - unsigned int in_bit_depth) { - const int widths[3] = - {a->y_crop_width, a->uv_crop_width, a->uv_crop_width }; - const int heights[3] = - {a->y_crop_height, a->uv_crop_height, a->uv_crop_height}; - const uint8_t *a_planes[3] = {a->y_buffer, a->u_buffer, a->v_buffer }; - const int a_strides[3] = {a->y_stride, a->uv_stride, a->uv_stride}; - const uint8_t *b_planes[3] = {b->y_buffer, b->u_buffer, b->v_buffer }; - const int b_strides[3] = {b->y_stride, b->uv_stride, b->uv_stride}; - int i; - uint64_t total_sse = 0; - uint32_t total_samples = 0; - const double peak = (double)((1 << in_bit_depth) - 1); - const unsigned int input_shift = bit_depth - in_bit_depth; - - for (i = 0; i < 3; ++i) { - const int w = widths[i]; - const int h = heights[i]; - const uint32_t samples = w * h; - uint64_t sse; - if (a->flags & YV12_FLAG_HIGHBITDEPTH) { - if (input_shift) { - sse = highbd_get_sse_shift(a_planes[i], a_strides[i], - b_planes[i], b_strides[i], w, h, - input_shift); - } else { - sse = highbd_get_sse(a_planes[i], a_strides[i], - b_planes[i], b_strides[i], w, h); - } - } else { - sse = get_sse(a_planes[i], a_strides[i], - b_planes[i], b_strides[i], - w, h); - } - psnr->sse[1 + i] = sse; - psnr->samples[1 + i] = samples; - psnr->psnr[1 + i] = vpx_sse_to_psnr(samples, peak, (double)sse); - - total_sse += sse; - total_samples += samples; - } - - psnr->sse[0] = total_sse; - psnr->samples[0] = total_samples; - psnr->psnr[0] = vpx_sse_to_psnr((double)total_samples, peak, - (double)total_sse); -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -static void generate_psnr_packet(VP9_COMP *cpi) { - struct vpx_codec_cx_pkt pkt; - int i; - PSNR_STATS psnr; -#if CONFIG_VP9_HIGHBITDEPTH - calc_highbd_psnr(cpi->Source, cpi->common.frame_to_show, &psnr, - cpi->td.mb.e_mbd.bd, cpi->oxcf.input_bit_depth); -#else - calc_psnr(cpi->Source, cpi->common.frame_to_show, &psnr); -#endif - - for (i = 0; i < 4; ++i) { - pkt.data.psnr.samples[i] = psnr.samples[i]; - pkt.data.psnr.sse[i] = psnr.sse[i]; - pkt.data.psnr.psnr[i] = psnr.psnr[i]; - } - pkt.kind = VPX_CODEC_PSNR_PKT; - if (is_two_pass_svc(cpi)) - cpi->svc.layer_context[cpi->svc.spatial_layer_id].psnr_pkt = pkt.data.psnr; - else - vpx_codec_pkt_list_add(cpi->output_pkt_list, &pkt); -} - -int vp9_use_as_reference(VP9_COMP *cpi, int ref_frame_flags) { - if (ref_frame_flags > 7) - return -1; - - cpi->ref_frame_flags = ref_frame_flags; - return 0; -} - -void vp9_update_reference(VP9_COMP *cpi, int ref_frame_flags) { - cpi->ext_refresh_golden_frame = (ref_frame_flags & VP9_GOLD_FLAG) != 0; - cpi->ext_refresh_alt_ref_frame = (ref_frame_flags & VP9_ALT_FLAG) != 0; - cpi->ext_refresh_last_frame = (ref_frame_flags & VP9_LAST_FLAG) != 0; - cpi->ext_refresh_frame_flags_pending = 1; -} - -static YV12_BUFFER_CONFIG *get_vp9_ref_frame_buffer(VP9_COMP *cpi, - VP9_REFFRAME ref_frame_flag) { - MV_REFERENCE_FRAME ref_frame = NONE; - if (ref_frame_flag == VP9_LAST_FLAG) - ref_frame = LAST_FRAME; - else if (ref_frame_flag == VP9_GOLD_FLAG) - ref_frame = GOLDEN_FRAME; - else if (ref_frame_flag == VP9_ALT_FLAG) - ref_frame = ALTREF_FRAME; - - return ref_frame == NONE ? NULL : get_ref_frame_buffer(cpi, ref_frame); -} - -int vp9_copy_reference_enc(VP9_COMP *cpi, VP9_REFFRAME ref_frame_flag, - YV12_BUFFER_CONFIG *sd) { - YV12_BUFFER_CONFIG *cfg = get_vp9_ref_frame_buffer(cpi, ref_frame_flag); - if (cfg) { - vp8_yv12_copy_frame(cfg, sd); - return 0; - } else { - return -1; - } -} - -int vp9_set_reference_enc(VP9_COMP *cpi, VP9_REFFRAME ref_frame_flag, - YV12_BUFFER_CONFIG *sd) { - YV12_BUFFER_CONFIG *cfg = get_vp9_ref_frame_buffer(cpi, ref_frame_flag); - if (cfg) { - vp8_yv12_copy_frame(sd, cfg); - return 0; - } else { - return -1; - } -} - -int vp9_update_entropy(VP9_COMP * cpi, int update) { - cpi->ext_refresh_frame_context = update; - cpi->ext_refresh_frame_context_pending = 1; - return 0; -} - -#if defined(OUTPUT_YUV_DENOISED) || defined(OUTPUT_YUV_SKINMAP) -// The denoiser buffer is allocated as a YUV 440 buffer. This function writes it -// as YUV 420. We simply use the top-left pixels of the UV buffers, since we do -// not denoise the UV channels at this time. If ever we implement UV channel -// denoising we will have to modify this. -void vp9_write_yuv_frame_420(YV12_BUFFER_CONFIG *s, FILE *f) { - uint8_t *src = s->y_buffer; - int h = s->y_height; - - do { - fwrite(src, s->y_width, 1, f); - src += s->y_stride; - } while (--h); - - src = s->u_buffer; - h = s->uv_height; - - do { - fwrite(src, s->uv_width, 1, f); - src += s->uv_stride; - } while (--h); - - src = s->v_buffer; - h = s->uv_height; - - do { - fwrite(src, s->uv_width, 1, f); - src += s->uv_stride; - } while (--h); -} -#endif - -#ifdef OUTPUT_YUV_REC -void vp9_write_yuv_rec_frame(VP9_COMMON *cm) { - YV12_BUFFER_CONFIG *s = cm->frame_to_show; - uint8_t *src = s->y_buffer; - int h = cm->height; - -#if CONFIG_VP9_HIGHBITDEPTH - if (s->flags & YV12_FLAG_HIGHBITDEPTH) { - uint16_t *src16 = CONVERT_TO_SHORTPTR(s->y_buffer); - - do { - fwrite(src16, s->y_width, 2, yuv_rec_file); - src16 += s->y_stride; - } while (--h); - - src16 = CONVERT_TO_SHORTPTR(s->u_buffer); - h = s->uv_height; - - do { - fwrite(src16, s->uv_width, 2, yuv_rec_file); - src16 += s->uv_stride; - } while (--h); - - src16 = CONVERT_TO_SHORTPTR(s->v_buffer); - h = s->uv_height; - - do { - fwrite(src16, s->uv_width, 2, yuv_rec_file); - src16 += s->uv_stride; - } while (--h); - - fflush(yuv_rec_file); - return; - } -#endif // CONFIG_VP9_HIGHBITDEPTH - - do { - fwrite(src, s->y_width, 1, yuv_rec_file); - src += s->y_stride; - } while (--h); - - src = s->u_buffer; - h = s->uv_height; - - do { - fwrite(src, s->uv_width, 1, yuv_rec_file); - src += s->uv_stride; - } while (--h); - - src = s->v_buffer; - h = s->uv_height; - - do { - fwrite(src, s->uv_width, 1, yuv_rec_file); - src += s->uv_stride; - } while (--h); - - fflush(yuv_rec_file); -} -#endif - -#if CONFIG_VP9_HIGHBITDEPTH -static void scale_and_extend_frame_nonnormative(const YV12_BUFFER_CONFIG *src, - YV12_BUFFER_CONFIG *dst, - int bd) { -#else -static void scale_and_extend_frame_nonnormative(const YV12_BUFFER_CONFIG *src, - YV12_BUFFER_CONFIG *dst) { -#endif // CONFIG_VP9_HIGHBITDEPTH - // TODO(dkovalev): replace YV12_BUFFER_CONFIG with vpx_image_t - int i; - const uint8_t *const srcs[3] = {src->y_buffer, src->u_buffer, src->v_buffer}; - const int src_strides[3] = {src->y_stride, src->uv_stride, src->uv_stride}; - const int src_widths[3] = {src->y_crop_width, src->uv_crop_width, - src->uv_crop_width }; - const int src_heights[3] = {src->y_crop_height, src->uv_crop_height, - src->uv_crop_height}; - uint8_t *const dsts[3] = {dst->y_buffer, dst->u_buffer, dst->v_buffer}; - const int dst_strides[3] = {dst->y_stride, dst->uv_stride, dst->uv_stride}; - const int dst_widths[3] = {dst->y_crop_width, dst->uv_crop_width, - dst->uv_crop_width}; - const int dst_heights[3] = {dst->y_crop_height, dst->uv_crop_height, - dst->uv_crop_height}; - - for (i = 0; i < MAX_MB_PLANE; ++i) { -#if CONFIG_VP9_HIGHBITDEPTH - if (src->flags & YV12_FLAG_HIGHBITDEPTH) { - vp9_highbd_resize_plane(srcs[i], src_heights[i], src_widths[i], - src_strides[i], dsts[i], dst_heights[i], - dst_widths[i], dst_strides[i], bd); - } else { - vp9_resize_plane(srcs[i], src_heights[i], src_widths[i], src_strides[i], - dsts[i], dst_heights[i], dst_widths[i], dst_strides[i]); - } -#else - vp9_resize_plane(srcs[i], src_heights[i], src_widths[i], src_strides[i], - dsts[i], dst_heights[i], dst_widths[i], dst_strides[i]); -#endif // CONFIG_VP9_HIGHBITDEPTH - } - vp9_extend_frame_borders(dst); -} - -#if CONFIG_VP9_HIGHBITDEPTH -static void scale_and_extend_frame(const YV12_BUFFER_CONFIG *src, - YV12_BUFFER_CONFIG *dst, int bd) { -#else -static void scale_and_extend_frame(const YV12_BUFFER_CONFIG *src, - YV12_BUFFER_CONFIG *dst) { -#endif // CONFIG_VP9_HIGHBITDEPTH - const int src_w = src->y_crop_width; - const int src_h = src->y_crop_height; - const int dst_w = dst->y_crop_width; - const int dst_h = dst->y_crop_height; - const uint8_t *const srcs[3] = {src->y_buffer, src->u_buffer, src->v_buffer}; - const int src_strides[3] = {src->y_stride, src->uv_stride, src->uv_stride}; - uint8_t *const dsts[3] = {dst->y_buffer, dst->u_buffer, dst->v_buffer}; - const int dst_strides[3] = {dst->y_stride, dst->uv_stride, dst->uv_stride}; - const InterpKernel *const kernel = vp9_get_interp_kernel(EIGHTTAP); - int x, y, i; - - for (y = 0; y < dst_h; y += 16) { - for (x = 0; x < dst_w; x += 16) { - for (i = 0; i < MAX_MB_PLANE; ++i) { - const int factor = (i == 0 || i == 3 ? 1 : 2); - const int x_q4 = x * (16 / factor) * src_w / dst_w; - const int y_q4 = y * (16 / factor) * src_h / dst_h; - const int src_stride = src_strides[i]; - const int dst_stride = dst_strides[i]; - const uint8_t *src_ptr = srcs[i] + (y / factor) * src_h / dst_h * - src_stride + (x / factor) * src_w / dst_w; - uint8_t *dst_ptr = dsts[i] + (y / factor) * dst_stride + (x / factor); - -#if CONFIG_VP9_HIGHBITDEPTH - if (src->flags & YV12_FLAG_HIGHBITDEPTH) { - vp9_highbd_convolve8(src_ptr, src_stride, dst_ptr, dst_stride, - kernel[x_q4 & 0xf], 16 * src_w / dst_w, - kernel[y_q4 & 0xf], 16 * src_h / dst_h, - 16 / factor, 16 / factor, bd); - } else { - vp9_convolve8(src_ptr, src_stride, dst_ptr, dst_stride, - kernel[x_q4 & 0xf], 16 * src_w / dst_w, - kernel[y_q4 & 0xf], 16 * src_h / dst_h, - 16 / factor, 16 / factor); - } -#else - vp9_convolve8(src_ptr, src_stride, dst_ptr, dst_stride, - kernel[x_q4 & 0xf], 16 * src_w / dst_w, - kernel[y_q4 & 0xf], 16 * src_h / dst_h, - 16 / factor, 16 / factor); -#endif // CONFIG_VP9_HIGHBITDEPTH - } - } - } - - vp9_extend_frame_borders(dst); -} - -static int scale_down(VP9_COMP *cpi, int q) { - RATE_CONTROL *const rc = &cpi->rc; - GF_GROUP *const gf_group = &cpi->twopass.gf_group; - int scale = 0; - assert(frame_is_kf_gf_arf(cpi)); - - if (rc->frame_size_selector == UNSCALED && - q >= rc->rf_level_maxq[gf_group->rf_level[gf_group->index]]) { - const int max_size_thresh = (int)(rate_thresh_mult[SCALE_STEP1] - * MAX(rc->this_frame_target, rc->avg_frame_bandwidth)); - scale = rc->projected_frame_size > max_size_thresh ? 1 : 0; - } - return scale; -} - -// Function to test for conditions that indicate we should loop -// back and recode a frame. -static int recode_loop_test(VP9_COMP *cpi, - int high_limit, int low_limit, - int q, int maxq, int minq) { - const RATE_CONTROL *const rc = &cpi->rc; - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - const int frame_is_kfgfarf = frame_is_kf_gf_arf(cpi); - int force_recode = 0; - - if ((cpi->sf.recode_loop == ALLOW_RECODE) || - (frame_is_kfgfarf && - (cpi->sf.recode_loop == ALLOW_RECODE_KFARFGF))) { - if (frame_is_kfgfarf && - (oxcf->resize_mode == RESIZE_DYNAMIC) && - scale_down(cpi, q)) { - // Code this group at a lower resolution. - cpi->resize_pending = 1; - return 1; - } - - // TODO(agrange) high_limit could be greater than the scale-down threshold. - if ((rc->projected_frame_size > high_limit && q < maxq) || - (rc->projected_frame_size < low_limit && q > minq)) { - force_recode = 1; - } else if (cpi->oxcf.rc_mode == VPX_CQ) { - // Deal with frame undershoot and whether or not we are - // below the automatically set cq level. - if (q > oxcf->cq_level && - rc->projected_frame_size < ((rc->this_frame_target * 7) >> 3)) { - force_recode = 1; - } - } - } - return force_recode; -} - -void vp9_update_reference_frames(VP9_COMP *cpi) { - VP9_COMMON * const cm = &cpi->common; - BufferPool *const pool = cm->buffer_pool; - - // At this point the new frame has been encoded. - // If any buffer copy / swapping is signaled it should be done here. - if (cm->frame_type == KEY_FRAME) { - ref_cnt_fb(pool->frame_bufs, - &cm->ref_frame_map[cpi->gld_fb_idx], cm->new_fb_idx); - ref_cnt_fb(pool->frame_bufs, - &cm->ref_frame_map[cpi->alt_fb_idx], cm->new_fb_idx); - } else if (vp9_preserve_existing_gf(cpi)) { - // We have decided to preserve the previously existing golden frame as our - // new ARF frame. However, in the short term in function - // vp9_bitstream.c::get_refresh_mask() we left it in the GF slot and, if - // we're updating the GF with the current decoded frame, we save it to the - // ARF slot instead. - // We now have to update the ARF with the current frame and swap gld_fb_idx - // and alt_fb_idx so that, overall, we've stored the old GF in the new ARF - // slot and, if we're updating the GF, the current frame becomes the new GF. - int tmp; - - ref_cnt_fb(pool->frame_bufs, - &cm->ref_frame_map[cpi->alt_fb_idx], cm->new_fb_idx); - - tmp = cpi->alt_fb_idx; - cpi->alt_fb_idx = cpi->gld_fb_idx; - cpi->gld_fb_idx = tmp; - - if (is_two_pass_svc(cpi)) { - cpi->svc.layer_context[0].gold_ref_idx = cpi->gld_fb_idx; - cpi->svc.layer_context[0].alt_ref_idx = cpi->alt_fb_idx; - } - } else { /* For non key/golden frames */ - if (cpi->refresh_alt_ref_frame) { - int arf_idx = cpi->alt_fb_idx; - if ((cpi->oxcf.pass == 2) && cpi->multi_arf_allowed) { - const GF_GROUP *const gf_group = &cpi->twopass.gf_group; - arf_idx = gf_group->arf_update_idx[gf_group->index]; - } - - ref_cnt_fb(pool->frame_bufs, - &cm->ref_frame_map[arf_idx], cm->new_fb_idx); - vpx_memcpy(cpi->interp_filter_selected[ALTREF_FRAME], - cpi->interp_filter_selected[0], - sizeof(cpi->interp_filter_selected[0])); - } - - if (cpi->refresh_golden_frame) { - ref_cnt_fb(pool->frame_bufs, - &cm->ref_frame_map[cpi->gld_fb_idx], cm->new_fb_idx); - if (!cpi->rc.is_src_frame_alt_ref) - vpx_memcpy(cpi->interp_filter_selected[GOLDEN_FRAME], - cpi->interp_filter_selected[0], - sizeof(cpi->interp_filter_selected[0])); - else - vpx_memcpy(cpi->interp_filter_selected[GOLDEN_FRAME], - cpi->interp_filter_selected[ALTREF_FRAME], - sizeof(cpi->interp_filter_selected[ALTREF_FRAME])); - } - } - - if (cpi->refresh_last_frame) { - ref_cnt_fb(pool->frame_bufs, - &cm->ref_frame_map[cpi->lst_fb_idx], cm->new_fb_idx); - if (!cpi->rc.is_src_frame_alt_ref) - vpx_memcpy(cpi->interp_filter_selected[LAST_FRAME], - cpi->interp_filter_selected[0], - sizeof(cpi->interp_filter_selected[0])); - } -#if CONFIG_VP9_TEMPORAL_DENOISING - if (cpi->oxcf.noise_sensitivity > 0) { - vp9_denoiser_update_frame_info(&cpi->denoiser, - *cpi->Source, - cpi->common.frame_type, - cpi->refresh_alt_ref_frame, - cpi->refresh_golden_frame, - cpi->refresh_last_frame); - } -#endif -} - -static void loopfilter_frame(VP9_COMP *cpi, VP9_COMMON *cm) { - MACROBLOCKD *xd = &cpi->td.mb.e_mbd; - struct loopfilter *lf = &cm->lf; - if (xd->lossless) { - lf->filter_level = 0; - } else { - struct vpx_usec_timer timer; - - vp9_clear_system_state(); - - vpx_usec_timer_start(&timer); - - vp9_pick_filter_level(cpi->Source, cpi, cpi->sf.lpf_pick); - - vpx_usec_timer_mark(&timer); - cpi->time_pick_lpf += vpx_usec_timer_elapsed(&timer); - } - - if (lf->filter_level > 0) { - if (cpi->num_workers > 1) - vp9_loop_filter_frame_mt(cm->frame_to_show, cm, xd->plane, - lf->filter_level, 0, 0, - cpi->workers, cpi->num_workers, - &cpi->lf_row_sync); - else - vp9_loop_filter_frame(cm->frame_to_show, cm, xd, lf->filter_level, 0, 0); - } - - vp9_extend_frame_inner_borders(cm->frame_to_show); -} - -static INLINE void alloc_frame_mvs(const VP9_COMMON *cm, - int buffer_idx) { - RefCntBuffer *const new_fb_ptr = &cm->buffer_pool->frame_bufs[buffer_idx]; - if (new_fb_ptr->mvs == NULL || - new_fb_ptr->mi_rows < cm->mi_rows || - new_fb_ptr->mi_cols < cm->mi_cols) { - vpx_free(new_fb_ptr->mvs); - new_fb_ptr->mvs = - (MV_REF *)vpx_calloc(cm->mi_rows * cm->mi_cols, - sizeof(*new_fb_ptr->mvs)); - new_fb_ptr->mi_rows = cm->mi_rows; - new_fb_ptr->mi_cols = cm->mi_cols; - } -} - -void vp9_scale_references(VP9_COMP *cpi) { - VP9_COMMON *cm = &cpi->common; - MV_REFERENCE_FRAME ref_frame; - const VP9_REFFRAME ref_mask[3] = {VP9_LAST_FLAG, VP9_GOLD_FLAG, VP9_ALT_FLAG}; - - for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) { - // Need to convert from VP9_REFFRAME to index into ref_mask (subtract 1). - if (cpi->ref_frame_flags & ref_mask[ref_frame - 1]) { - BufferPool *const pool = cm->buffer_pool; - const YV12_BUFFER_CONFIG *const ref = get_ref_frame_buffer(cpi, - ref_frame); - - if (ref == NULL) { - cpi->scaled_ref_idx[ref_frame - 1] = INVALID_IDX; - continue; - } - -#if CONFIG_VP9_HIGHBITDEPTH - if (ref->y_crop_width != cm->width || ref->y_crop_height != cm->height) { - const int new_fb = get_free_fb(cm); - RefCntBuffer *const new_fb_ptr = &pool->frame_bufs[new_fb]; - cm->cur_frame = &pool->frame_bufs[new_fb]; - vp9_realloc_frame_buffer(&pool->frame_bufs[new_fb].buf, - cm->width, cm->height, - cm->subsampling_x, cm->subsampling_y, - cm->use_highbitdepth, - VP9_ENC_BORDER_IN_PIXELS, cm->byte_alignment, - NULL, NULL, NULL); - scale_and_extend_frame(ref, &new_fb_ptr->buf, (int)cm->bit_depth); -#else - if (ref->y_crop_width != cm->width || ref->y_crop_height != cm->height) { - const int new_fb = get_free_fb(cm); - RefCntBuffer *const new_fb_ptr = &pool->frame_bufs[new_fb]; - vp9_realloc_frame_buffer(&new_fb_ptr->buf, - cm->width, cm->height, - cm->subsampling_x, cm->subsampling_y, - VP9_ENC_BORDER_IN_PIXELS, cm->byte_alignment, - NULL, NULL, NULL); - scale_and_extend_frame(ref, &new_fb_ptr->buf); -#endif // CONFIG_VP9_HIGHBITDEPTH - cpi->scaled_ref_idx[ref_frame - 1] = new_fb; - - alloc_frame_mvs(cm, new_fb); - } else { - const int buf_idx = get_ref_frame_buf_idx(cpi, ref_frame); - cpi->scaled_ref_idx[ref_frame - 1] = buf_idx; - ++pool->frame_bufs[buf_idx].ref_count; - } - } else { - cpi->scaled_ref_idx[ref_frame - 1] = INVALID_IDX; - } - } -} - -static void release_scaled_references(VP9_COMP *cpi) { - VP9_COMMON *cm = &cpi->common; - int i; - for (i = 0; i < MAX_REF_FRAMES; ++i) { - const int idx = cpi->scaled_ref_idx[i]; - RefCntBuffer *const buf = idx != INVALID_IDX ? - &cm->buffer_pool->frame_bufs[idx] : NULL; - if (buf != NULL) { - --buf->ref_count; - cpi->scaled_ref_idx[i] = INVALID_IDX; - } - } -} - -static void full_to_model_count(unsigned int *model_count, - unsigned int *full_count) { - int n; - model_count[ZERO_TOKEN] = full_count[ZERO_TOKEN]; - model_count[ONE_TOKEN] = full_count[ONE_TOKEN]; - model_count[TWO_TOKEN] = full_count[TWO_TOKEN]; - for (n = THREE_TOKEN; n < EOB_TOKEN; ++n) - model_count[TWO_TOKEN] += full_count[n]; - model_count[EOB_MODEL_TOKEN] = full_count[EOB_TOKEN]; -} - -static void full_to_model_counts(vp9_coeff_count_model *model_count, - vp9_coeff_count *full_count) { - int i, j, k, l; - - for (i = 0; i < PLANE_TYPES; ++i) - for (j = 0; j < REF_TYPES; ++j) - for (k = 0; k < COEF_BANDS; ++k) - for (l = 0; l < BAND_COEFF_CONTEXTS(k); ++l) - full_to_model_count(model_count[i][j][k][l], full_count[i][j][k][l]); -} - -#if 0 && CONFIG_INTERNAL_STATS -static void output_frame_level_debug_stats(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - FILE *const f = fopen("tmp.stt", cm->current_video_frame ? "a" : "w"); - int64_t recon_err; - - vp9_clear_system_state(); - - recon_err = vp9_get_y_sse(cpi->Source, get_frame_new_buffer(cm)); - - if (cpi->twopass.total_left_stats.coded_error != 0.0) - fprintf(f, "%10u %dx%d %10d %10d %10d %10d" - "%10"PRId64" %10"PRId64" %10"PRId64" %10"PRId64" %10d " - "%7.2lf %7.2lf %7.2lf %7.2lf %7.2lf" - "%6d %6d %5d %5d %5d " - "%10"PRId64" %10.3lf" - "%10lf %8u %10"PRId64" %10d %10d\n", - cpi->common.current_video_frame, - cm->width, cm->height, - cpi->rc.this_frame_target, - cpi->rc.projected_frame_size, - cpi->rc.projected_frame_size / cpi->common.MBs, - (cpi->rc.projected_frame_size - cpi->rc.this_frame_target), - cpi->rc.vbr_bits_off_target, - cpi->rc.total_target_vs_actual, - (cpi->rc.starting_buffer_level - cpi->rc.bits_off_target), - cpi->rc.total_actual_bits, cm->base_qindex, - vp9_convert_qindex_to_q(cm->base_qindex, cm->bit_depth), - (double)vp9_dc_quant(cm->base_qindex, 0, cm->bit_depth) / 4.0, - vp9_convert_qindex_to_q(cpi->twopass.active_worst_quality, - cm->bit_depth), - cpi->rc.avg_q, - vp9_convert_qindex_to_q(cpi->oxcf.cq_level, cm->bit_depth), - cpi->refresh_last_frame, cpi->refresh_golden_frame, - cpi->refresh_alt_ref_frame, cm->frame_type, cpi->rc.gfu_boost, - cpi->twopass.bits_left, - cpi->twopass.total_left_stats.coded_error, - cpi->twopass.bits_left / - (1 + cpi->twopass.total_left_stats.coded_error), - cpi->tot_recode_hits, recon_err, cpi->rc.kf_boost, - cpi->twopass.kf_zeromotion_pct); - - fclose(f); - - if (0) { - FILE *const fmodes = fopen("Modes.stt", "a"); - int i; - - fprintf(fmodes, "%6d:%1d:%1d:%1d ", cpi->common.current_video_frame, - cm->frame_type, cpi->refresh_golden_frame, - cpi->refresh_alt_ref_frame); - - for (i = 0; i < MAX_MODES; ++i) - fprintf(fmodes, "%5d ", cpi->mode_chosen_counts[i]); - - fprintf(fmodes, "\n"); - - fclose(fmodes); - } -} -#endif - -static void set_mv_search_params(VP9_COMP *cpi) { - const VP9_COMMON *const cm = &cpi->common; - const unsigned int max_mv_def = MIN(cm->width, cm->height); - - // Default based on max resolution. - cpi->mv_step_param = vp9_init_search_range(max_mv_def); - - if (cpi->sf.mv.auto_mv_step_size) { - if (frame_is_intra_only(cm)) { - // Initialize max_mv_magnitude for use in the first INTER frame - // after a key/intra-only frame. - cpi->max_mv_magnitude = max_mv_def; - } else { - if (cm->show_frame) { - // Allow mv_steps to correspond to twice the max mv magnitude found - // in the previous frame, capped by the default max_mv_magnitude based - // on resolution. - cpi->mv_step_param = - vp9_init_search_range(MIN(max_mv_def, 2 * cpi->max_mv_magnitude)); - } - cpi->max_mv_magnitude = 0; - } - } -} - -static void set_size_independent_vars(VP9_COMP *cpi) { - vp9_set_speed_features_framesize_independent(cpi); - vp9_set_rd_speed_thresholds(cpi); - vp9_set_rd_speed_thresholds_sub8x8(cpi); - cpi->common.interp_filter = cpi->sf.default_interp_filter; -} - -static void set_size_dependent_vars(VP9_COMP *cpi, int *q, - int *bottom_index, int *top_index) { - VP9_COMMON *const cm = &cpi->common; - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - - // Setup variables that depend on the dimensions of the frame. - vp9_set_speed_features_framesize_dependent(cpi); - - // Decide q and q bounds. - *q = vp9_rc_pick_q_and_bounds(cpi, bottom_index, top_index); - - if (!frame_is_intra_only(cm)) { - vp9_set_high_precision_mv(cpi, (*q) < HIGH_PRECISION_MV_QTHRESH); - } - - // Configure experimental use of segmentation for enhanced coding of - // static regions if indicated. - // Only allowed in the second pass of a two pass encode, as it requires - // lagged coding, and if the relevant speed feature flag is set. - if (oxcf->pass == 2 && cpi->sf.static_segmentation) - configure_static_seg_features(cpi); - -#if CONFIG_VP9_POSTPROC - if (oxcf->noise_sensitivity > 0) { - int l = 0; - switch (oxcf->noise_sensitivity) { - case 1: - l = 20; - break; - case 2: - l = 40; - break; - case 3: - l = 60; - break; - case 4: - case 5: - l = 100; - break; - case 6: - l = 150; - break; - } - vp9_denoise(cpi->Source, cpi->Source, l); - } -#endif // CONFIG_VP9_POSTPROC -} - -static void init_motion_estimation(VP9_COMP *cpi) { - int y_stride = cpi->scaled_source.y_stride; - - if (cpi->sf.mv.search_method == NSTEP) { - vp9_init3smotion_compensation(&cpi->ss_cfg, y_stride); - } else if (cpi->sf.mv.search_method == DIAMOND) { - vp9_init_dsmotion_compensation(&cpi->ss_cfg, y_stride); - } -} - -void set_frame_size(VP9_COMP *cpi) { - int ref_frame; - VP9_COMMON *const cm = &cpi->common; - VP9EncoderConfig *const oxcf = &cpi->oxcf; - MACROBLOCKD *const xd = &cpi->td.mb.e_mbd; - - if (oxcf->pass == 2 && - oxcf->rc_mode == VPX_VBR && - ((oxcf->resize_mode == RESIZE_FIXED && cm->current_video_frame == 0) || - (oxcf->resize_mode == RESIZE_DYNAMIC && cpi->resize_pending))) { - calculate_coded_size( - cpi, &oxcf->scaled_frame_width, &oxcf->scaled_frame_height); - - // There has been a change in frame size. - vp9_set_size_literal(cpi, oxcf->scaled_frame_width, - oxcf->scaled_frame_height); - } - - if ((oxcf->pass == 2) && - (!cpi->use_svc || - (is_two_pass_svc(cpi) && - cpi->svc.encode_empty_frame_state != ENCODING))) { - vp9_set_target_rate(cpi); - } - - alloc_frame_mvs(cm, cm->new_fb_idx); - - // Reset the frame pointers to the current frame size. - vp9_realloc_frame_buffer(get_frame_new_buffer(cm), - cm->width, cm->height, - cm->subsampling_x, cm->subsampling_y, -#if CONFIG_VP9_HIGHBITDEPTH - cm->use_highbitdepth, -#endif - VP9_ENC_BORDER_IN_PIXELS, cm->byte_alignment, - NULL, NULL, NULL); - - alloc_util_frame_buffers(cpi); - init_motion_estimation(cpi); - - for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) { - RefBuffer *const ref_buf = &cm->frame_refs[ref_frame - 1]; - const int buf_idx = get_ref_frame_buf_idx(cpi, ref_frame); - - ref_buf->idx = buf_idx; - - if (buf_idx != INVALID_IDX) { - YV12_BUFFER_CONFIG *const buf = &cm->buffer_pool->frame_bufs[buf_idx].buf; - ref_buf->buf = buf; -#if CONFIG_VP9_HIGHBITDEPTH - vp9_setup_scale_factors_for_frame(&ref_buf->sf, - buf->y_crop_width, buf->y_crop_height, - cm->width, cm->height, - (buf->flags & YV12_FLAG_HIGHBITDEPTH) ? - 1 : 0); -#else - vp9_setup_scale_factors_for_frame(&ref_buf->sf, - buf->y_crop_width, buf->y_crop_height, - cm->width, cm->height); -#endif // CONFIG_VP9_HIGHBITDEPTH - if (vp9_is_scaled(&ref_buf->sf)) - vp9_extend_frame_borders(buf); - } else { - ref_buf->buf = NULL; - } - } - - set_ref_ptrs(cm, xd, LAST_FRAME, LAST_FRAME); -} - -static void encode_without_recode_loop(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - int q = 0, bottom_index = 0, top_index = 0; // Dummy variables. - - vp9_clear_system_state(); - - set_frame_size(cpi); - - cpi->Source = vp9_scale_if_required(cm, cpi->un_scaled_source, - &cpi->scaled_source); - - if (cpi->unscaled_last_source != NULL) - cpi->Last_Source = vp9_scale_if_required(cm, cpi->unscaled_last_source, - &cpi->scaled_last_source); - - if (frame_is_intra_only(cm) == 0) { - vp9_scale_references(cpi); - } - - set_size_independent_vars(cpi); - set_size_dependent_vars(cpi, &q, &bottom_index, &top_index); - - vp9_set_quantizer(cm, q); - vp9_set_vbp_thresholds(cpi, q); - - setup_frame(cpi); - - vp9_suppress_active_map(cpi); - // Variance adaptive and in frame q adjustment experiments are mutually - // exclusive. - if (cpi->oxcf.aq_mode == VARIANCE_AQ) { - vp9_vaq_frame_setup(cpi); - } else if (cpi->oxcf.aq_mode == COMPLEXITY_AQ) { - vp9_setup_in_frame_q_adj(cpi); - } else if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) { - vp9_cyclic_refresh_setup(cpi); - } - vp9_apply_active_map(cpi); - - // transform / motion compensation build reconstruction frame - vp9_encode_frame(cpi); - - // Update some stats from cyclic refresh, and check if we should not update - // golden reference, for non-SVC 1 pass CBR. - if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && - cm->frame_type != KEY_FRAME && - !cpi->use_svc && - (cpi->oxcf.pass == 0 && cpi->oxcf.rc_mode == VPX_CBR)) - vp9_cyclic_refresh_check_golden_update(cpi); - - // Update the skip mb flag probabilities based on the distribution - // seen in the last encoder iteration. - // update_base_skip_probs(cpi); - vp9_clear_system_state(); -} - -static void encode_with_recode_loop(VP9_COMP *cpi, - size_t *size, - uint8_t *dest) { - VP9_COMMON *const cm = &cpi->common; - RATE_CONTROL *const rc = &cpi->rc; - int bottom_index, top_index; - int loop_count = 0; - int loop_at_this_size = 0; - int loop = 0; - int overshoot_seen = 0; - int undershoot_seen = 0; - int frame_over_shoot_limit; - int frame_under_shoot_limit; - int q = 0, q_low = 0, q_high = 0; - - set_size_independent_vars(cpi); - - do { - vp9_clear_system_state(); - - set_frame_size(cpi); - - if (loop_count == 0 || cpi->resize_pending != 0) { - set_size_dependent_vars(cpi, &q, &bottom_index, &top_index); - - // TODO(agrange) Scale cpi->max_mv_magnitude if frame-size has changed. - set_mv_search_params(cpi); - - // Reset the loop state for new frame size. - overshoot_seen = 0; - undershoot_seen = 0; - - // Reconfiguration for change in frame size has concluded. - cpi->resize_pending = 0; - - q_low = bottom_index; - q_high = top_index; - - loop_at_this_size = 0; - } - - // Decide frame size bounds first time through. - if (loop_count == 0) { - vp9_rc_compute_frame_size_bounds(cpi, rc->this_frame_target, - &frame_under_shoot_limit, - &frame_over_shoot_limit); - } - - cpi->Source = vp9_scale_if_required(cm, cpi->un_scaled_source, - &cpi->scaled_source); - - if (cpi->unscaled_last_source != NULL) - cpi->Last_Source = vp9_scale_if_required(cm, cpi->unscaled_last_source, - &cpi->scaled_last_source); - - if (frame_is_intra_only(cm) == 0) { - if (loop_count > 0) { - release_scaled_references(cpi); - } - vp9_scale_references(cpi); - } - - vp9_set_quantizer(cm, q); - - if (loop_count == 0) - setup_frame(cpi); - - // Variance adaptive and in frame q adjustment experiments are mutually - // exclusive. - if (cpi->oxcf.aq_mode == VARIANCE_AQ) { - vp9_vaq_frame_setup(cpi); - } else if (cpi->oxcf.aq_mode == COMPLEXITY_AQ) { - vp9_setup_in_frame_q_adj(cpi); - } - - // transform / motion compensation build reconstruction frame - vp9_encode_frame(cpi); - - // Update the skip mb flag probabilities based on the distribution - // seen in the last encoder iteration. - // update_base_skip_probs(cpi); - - vp9_clear_system_state(); - - // Dummy pack of the bitstream using up to date stats to get an - // accurate estimate of output frame size to determine if we need - // to recode. - if (cpi->sf.recode_loop >= ALLOW_RECODE_KFARFGF) { - save_coding_context(cpi); - if (!cpi->sf.use_nonrd_pick_mode) - vp9_pack_bitstream(cpi, dest, size); - - rc->projected_frame_size = (int)(*size) << 3; - restore_coding_context(cpi); - - if (frame_over_shoot_limit == 0) - frame_over_shoot_limit = 1; - } - - if (cpi->oxcf.rc_mode == VPX_Q) { - loop = 0; - } else { - if ((cm->frame_type == KEY_FRAME) && - rc->this_key_frame_forced && - (rc->projected_frame_size < rc->max_frame_bandwidth)) { - int last_q = q; - int64_t kf_err; - - int64_t high_err_target = cpi->ambient_err; - int64_t low_err_target = cpi->ambient_err >> 1; - -#if CONFIG_VP9_HIGHBITDEPTH - if (cm->use_highbitdepth) { - kf_err = vp9_highbd_get_y_sse(cpi->Source, get_frame_new_buffer(cm)); - } else { - kf_err = vp9_get_y_sse(cpi->Source, get_frame_new_buffer(cm)); - } -#else - kf_err = vp9_get_y_sse(cpi->Source, get_frame_new_buffer(cm)); -#endif // CONFIG_VP9_HIGHBITDEPTH - - // Prevent possible divide by zero error below for perfect KF - kf_err += !kf_err; - - // The key frame is not good enough or we can afford - // to make it better without undue risk of popping. - if ((kf_err > high_err_target && - rc->projected_frame_size <= frame_over_shoot_limit) || - (kf_err > low_err_target && - rc->projected_frame_size <= frame_under_shoot_limit)) { - // Lower q_high - q_high = q > q_low ? q - 1 : q_low; - - // Adjust Q - q = (int)((q * high_err_target) / kf_err); - q = MIN(q, (q_high + q_low) >> 1); - } else if (kf_err < low_err_target && - rc->projected_frame_size >= frame_under_shoot_limit) { - // The key frame is much better than the previous frame - // Raise q_low - q_low = q < q_high ? q + 1 : q_high; - - // Adjust Q - q = (int)((q * low_err_target) / kf_err); - q = MIN(q, (q_high + q_low + 1) >> 1); - } - - // Clamp Q to upper and lower limits: - q = clamp(q, q_low, q_high); - - loop = q != last_q; - } else if (recode_loop_test( - cpi, frame_over_shoot_limit, frame_under_shoot_limit, - q, MAX(q_high, top_index), bottom_index)) { - // Is the projected frame size out of range and are we allowed - // to attempt to recode. - int last_q = q; - int retries = 0; - - if (cpi->resize_pending == 1) { - // Change in frame size so go back around the recode loop. - cpi->rc.frame_size_selector = - SCALE_STEP1 - cpi->rc.frame_size_selector; - cpi->rc.next_frame_size_selector = cpi->rc.frame_size_selector; - -#if CONFIG_INTERNAL_STATS - ++cpi->tot_recode_hits; -#endif - ++loop_count; - loop = 1; - continue; - } - - // Frame size out of permitted range: - // Update correction factor & compute new Q to try... - - // Frame is too large - if (rc->projected_frame_size > rc->this_frame_target) { - // Special case if the projected size is > the max allowed. - if (rc->projected_frame_size >= rc->max_frame_bandwidth) - q_high = rc->worst_quality; - - // Raise Qlow as to at least the current value - q_low = q < q_high ? q + 1 : q_high; - - if (undershoot_seen || loop_at_this_size > 1) { - // Update rate_correction_factor unless - vp9_rc_update_rate_correction_factors(cpi); - - q = (q_high + q_low + 1) / 2; - } else { - // Update rate_correction_factor unless - vp9_rc_update_rate_correction_factors(cpi); - - q = vp9_rc_regulate_q(cpi, rc->this_frame_target, - bottom_index, MAX(q_high, top_index)); - - while (q < q_low && retries < 10) { - vp9_rc_update_rate_correction_factors(cpi); - q = vp9_rc_regulate_q(cpi, rc->this_frame_target, - bottom_index, MAX(q_high, top_index)); - retries++; - } - } - - overshoot_seen = 1; - } else { - // Frame is too small - q_high = q > q_low ? q - 1 : q_low; - - if (overshoot_seen || loop_at_this_size > 1) { - vp9_rc_update_rate_correction_factors(cpi); - q = (q_high + q_low) / 2; - } else { - vp9_rc_update_rate_correction_factors(cpi); - q = vp9_rc_regulate_q(cpi, rc->this_frame_target, - bottom_index, top_index); - // Special case reset for qlow for constrained quality. - // This should only trigger where there is very substantial - // undershoot on a frame and the auto cq level is above - // the user passsed in value. - if (cpi->oxcf.rc_mode == VPX_CQ && - q < q_low) { - q_low = q; - } - - while (q > q_high && retries < 10) { - vp9_rc_update_rate_correction_factors(cpi); - q = vp9_rc_regulate_q(cpi, rc->this_frame_target, - bottom_index, top_index); - retries++; - } - } - - undershoot_seen = 1; - } - - // Clamp Q to upper and lower limits: - q = clamp(q, q_low, q_high); - - loop = (q != last_q); - } else { - loop = 0; - } - } - - // Special case for overlay frame. - if (rc->is_src_frame_alt_ref && - rc->projected_frame_size < rc->max_frame_bandwidth) - loop = 0; - - if (loop) { - ++loop_count; - ++loop_at_this_size; - -#if CONFIG_INTERNAL_STATS - ++cpi->tot_recode_hits; -#endif - } - } while (loop); -} - -static int get_ref_frame_flags(const VP9_COMP *cpi) { - const int *const map = cpi->common.ref_frame_map; - const int gold_is_last = map[cpi->gld_fb_idx] == map[cpi->lst_fb_idx]; - const int alt_is_last = map[cpi->alt_fb_idx] == map[cpi->lst_fb_idx]; - const int gold_is_alt = map[cpi->gld_fb_idx] == map[cpi->alt_fb_idx]; - int flags = VP9_ALT_FLAG | VP9_GOLD_FLAG | VP9_LAST_FLAG; - - if (gold_is_last) - flags &= ~VP9_GOLD_FLAG; - - if (cpi->rc.frames_till_gf_update_due == INT_MAX && - (cpi->svc.number_temporal_layers == 1 && - cpi->svc.number_spatial_layers == 1)) - flags &= ~VP9_GOLD_FLAG; - - if (alt_is_last) - flags &= ~VP9_ALT_FLAG; - - if (gold_is_alt) - flags &= ~VP9_ALT_FLAG; - - return flags; -} - -static void set_ext_overrides(VP9_COMP *cpi) { - // Overrides the defaults with the externally supplied values with - // vp9_update_reference() and vp9_update_entropy() calls - // Note: The overrides are valid only for the next frame passed - // to encode_frame_to_data_rate() function - if (cpi->ext_refresh_frame_context_pending) { - cpi->common.refresh_frame_context = cpi->ext_refresh_frame_context; - cpi->ext_refresh_frame_context_pending = 0; - } - if (cpi->ext_refresh_frame_flags_pending) { - cpi->refresh_last_frame = cpi->ext_refresh_last_frame; - cpi->refresh_golden_frame = cpi->ext_refresh_golden_frame; - cpi->refresh_alt_ref_frame = cpi->ext_refresh_alt_ref_frame; - cpi->ext_refresh_frame_flags_pending = 0; - } -} - -YV12_BUFFER_CONFIG *vp9_scale_if_required(VP9_COMMON *cm, - YV12_BUFFER_CONFIG *unscaled, - YV12_BUFFER_CONFIG *scaled) { - if (cm->mi_cols * MI_SIZE != unscaled->y_width || - cm->mi_rows * MI_SIZE != unscaled->y_height) { -#if CONFIG_VP9_HIGHBITDEPTH - scale_and_extend_frame_nonnormative(unscaled, scaled, (int)cm->bit_depth); -#else - scale_and_extend_frame_nonnormative(unscaled, scaled); -#endif // CONFIG_VP9_HIGHBITDEPTH - return scaled; - } else { - return unscaled; - } -} - -static void set_arf_sign_bias(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - int arf_sign_bias; - - if ((cpi->oxcf.pass == 2) && cpi->multi_arf_allowed) { - const GF_GROUP *const gf_group = &cpi->twopass.gf_group; - arf_sign_bias = cpi->rc.source_alt_ref_active && - (!cpi->refresh_alt_ref_frame || - (gf_group->rf_level[gf_group->index] == GF_ARF_LOW)); - } else { - arf_sign_bias = - (cpi->rc.source_alt_ref_active && !cpi->refresh_alt_ref_frame); - } - cm->ref_frame_sign_bias[ALTREF_FRAME] = arf_sign_bias; -} - -int setup_interp_filter_search_mask(VP9_COMP *cpi) { - INTERP_FILTER ifilter; - int ref_total[MAX_REF_FRAMES] = {0}; - MV_REFERENCE_FRAME ref; - int mask = 0; - if (cpi->common.last_frame_type == KEY_FRAME || - cpi->refresh_alt_ref_frame) - return mask; - for (ref = LAST_FRAME; ref <= ALTREF_FRAME; ++ref) - for (ifilter = EIGHTTAP; ifilter <= EIGHTTAP_SHARP; ++ifilter) - ref_total[ref] += cpi->interp_filter_selected[ref][ifilter]; - - for (ifilter = EIGHTTAP; ifilter <= EIGHTTAP_SHARP; ++ifilter) { - if ((ref_total[LAST_FRAME] && - cpi->interp_filter_selected[LAST_FRAME][ifilter] == 0) && - (ref_total[GOLDEN_FRAME] == 0 || - cpi->interp_filter_selected[GOLDEN_FRAME][ifilter] * 50 - < ref_total[GOLDEN_FRAME]) && - (ref_total[ALTREF_FRAME] == 0 || - cpi->interp_filter_selected[ALTREF_FRAME][ifilter] * 50 - < ref_total[ALTREF_FRAME])) - mask |= 1 << ifilter; - } - return mask; -} - -static void encode_frame_to_data_rate(VP9_COMP *cpi, - size_t *size, - uint8_t *dest, - unsigned int *frame_flags) { - VP9_COMMON *const cm = &cpi->common; - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - struct segmentation *const seg = &cm->seg; - TX_SIZE t; - - set_ext_overrides(cpi); - vp9_clear_system_state(); - - // Set the arf sign bias for this frame. - set_arf_sign_bias(cpi); - - // Set default state for segment based loop filter update flags. - cm->lf.mode_ref_delta_update = 0; - - if (cpi->oxcf.pass == 2 && - cpi->sf.adaptive_interp_filter_search) - cpi->sf.interp_filter_search_mask = - setup_interp_filter_search_mask(cpi); - - // Set various flags etc to special state if it is a key frame. - if (frame_is_intra_only(cm)) { - // Reset the loop filter deltas and segmentation map. - vp9_reset_segment_features(&cm->seg); - - // If segmentation is enabled force a map update for key frames. - if (seg->enabled) { - seg->update_map = 1; - seg->update_data = 1; - } - - // The alternate reference frame cannot be active for a key frame. - cpi->rc.source_alt_ref_active = 0; - - cm->error_resilient_mode = oxcf->error_resilient_mode; - cm->frame_parallel_decoding_mode = oxcf->frame_parallel_decoding_mode; - - // By default, encoder assumes decoder can use prev_mi. - if (cm->error_resilient_mode) { - cm->frame_parallel_decoding_mode = 1; - cm->reset_frame_context = 0; - cm->refresh_frame_context = 0; - } else if (cm->intra_only) { - // Only reset the current context. - cm->reset_frame_context = 2; - } - } - if (is_two_pass_svc(cpi) && cm->error_resilient_mode == 0) { - // Use the last frame context for the empty frame. - cm->frame_context_idx = - (cpi->svc.encode_empty_frame_state == ENCODING) ? FRAME_CONTEXTS - 1 : - cpi->svc.spatial_layer_id * cpi->svc.number_temporal_layers + - cpi->svc.temporal_layer_id; - - // The probs will be updated based on the frame type of its previous - // frame if frame_parallel_decoding_mode is 0. The type may vary for - // the frame after a key frame in base layer since we may drop enhancement - // layers. So set frame_parallel_decoding_mode to 1 in this case. - if (cpi->svc.number_temporal_layers == 1) { - if (cpi->svc.spatial_layer_id == 0 && - cpi->svc.layer_context[0].last_frame_type == KEY_FRAME) - cm->frame_parallel_decoding_mode = 1; - else - cm->frame_parallel_decoding_mode = 0; - } else if (cpi->svc.spatial_layer_id == 0) { - // Find the 2nd frame in temporal base layer and 1st frame in temporal - // enhancement layers from the key frame. - int i; - for (i = 0; i < cpi->svc.number_temporal_layers; ++i) { - if (cpi->svc.layer_context[0].frames_from_key_frame == 1 << i) { - cm->frame_parallel_decoding_mode = 1; - break; - } - } - if (i == cpi->svc.number_temporal_layers) - cm->frame_parallel_decoding_mode = 0; - } - } - - // For 1 pass CBR, check if we are dropping this frame. - // Never drop on key frame. - if (oxcf->pass == 0 && - oxcf->rc_mode == VPX_CBR && - cm->frame_type != KEY_FRAME) { - if (vp9_rc_drop_frame(cpi)) { - vp9_rc_postencode_update_drop_frame(cpi); - ++cm->current_video_frame; - return; - } - } - - vp9_clear_system_state(); - -#if CONFIG_INTERNAL_STATS - vpx_memset(cpi->mode_chosen_counts, 0, - MAX_MODES * sizeof(*cpi->mode_chosen_counts)); -#endif - - if (cpi->sf.recode_loop == DISALLOW_RECODE) { - encode_without_recode_loop(cpi); - } else { - encode_with_recode_loop(cpi, size, dest); - } - -#if CONFIG_VP9_TEMPORAL_DENOISING -#ifdef OUTPUT_YUV_DENOISED - if (oxcf->noise_sensitivity > 0) { - vp9_write_yuv_frame_420(&cpi->denoiser.running_avg_y[INTRA_FRAME], - yuv_denoised_file); - } -#endif -#endif -#ifdef OUTPUT_YUV_SKINMAP - if (cpi->common.current_video_frame > 1) { - vp9_compute_skin_map(cpi, yuv_skinmap_file); - } -#endif - - // Special case code to reduce pulsing when key frames are forced at a - // fixed interval. Note the reconstruction error if it is the frame before - // the force key frame - if (cpi->rc.next_key_frame_forced && cpi->rc.frames_to_key == 1) { -#if CONFIG_VP9_HIGHBITDEPTH - if (cm->use_highbitdepth) { - cpi->ambient_err = vp9_highbd_get_y_sse(cpi->Source, - get_frame_new_buffer(cm)); - } else { - cpi->ambient_err = vp9_get_y_sse(cpi->Source, get_frame_new_buffer(cm)); - } -#else - cpi->ambient_err = vp9_get_y_sse(cpi->Source, get_frame_new_buffer(cm)); -#endif // CONFIG_VP9_HIGHBITDEPTH - } - - // If the encoder forced a KEY_FRAME decision - if (cm->frame_type == KEY_FRAME) - cpi->refresh_last_frame = 1; - - cm->frame_to_show = get_frame_new_buffer(cm); - - // Pick the loop filter level for the frame. - loopfilter_frame(cpi, cm); - - // build the bitstream - vp9_pack_bitstream(cpi, dest, size); - - if (cm->seg.update_map) - update_reference_segmentation_map(cpi); - - if (frame_is_intra_only(cm) == 0) { - release_scaled_references(cpi); - } - vp9_update_reference_frames(cpi); - - for (t = TX_4X4; t <= TX_32X32; t++) - full_to_model_counts(cpi->td.counts->coef[t], - cpi->td.rd_counts.coef_counts[t]); - - if (!cm->error_resilient_mode && !cm->frame_parallel_decoding_mode) - vp9_adapt_coef_probs(cm); - - if (!frame_is_intra_only(cm)) { - if (!cm->error_resilient_mode && !cm->frame_parallel_decoding_mode) { - vp9_adapt_mode_probs(cm); - vp9_adapt_mv_probs(cm, cm->allow_high_precision_mv); - } - } - - if (cpi->refresh_golden_frame == 1) - cpi->frame_flags |= FRAMEFLAGS_GOLDEN; - else - cpi->frame_flags &= ~FRAMEFLAGS_GOLDEN; - - if (cpi->refresh_alt_ref_frame == 1) - cpi->frame_flags |= FRAMEFLAGS_ALTREF; - else - cpi->frame_flags &= ~FRAMEFLAGS_ALTREF; - - cpi->ref_frame_flags = get_ref_frame_flags(cpi); - - cm->last_frame_type = cm->frame_type; - - if (!(is_two_pass_svc(cpi) && cpi->svc.encode_empty_frame_state == ENCODING)) - vp9_rc_postencode_update(cpi, *size); - -#if 0 - output_frame_level_debug_stats(cpi); -#endif - - if (cm->frame_type == KEY_FRAME) { - // Tell the caller that the frame was coded as a key frame - *frame_flags = cpi->frame_flags | FRAMEFLAGS_KEY; - } else { - *frame_flags = cpi->frame_flags & ~FRAMEFLAGS_KEY; - } - - // Clear the one shot update flags for segmentation map and mode/ref loop - // filter deltas. - cm->seg.update_map = 0; - cm->seg.update_data = 0; - cm->lf.mode_ref_delta_update = 0; - - // keep track of the last coded dimensions - cm->last_width = cm->width; - cm->last_height = cm->height; - - // reset to normal state now that we are done. - if (!cm->show_existing_frame) - cm->last_show_frame = cm->show_frame; - - if (cm->show_frame) { - vp9_swap_mi_and_prev_mi(cm); - // Don't increment frame counters if this was an altref buffer - // update not a real frame - ++cm->current_video_frame; - if (cpi->use_svc) - vp9_inc_frame_in_layer(cpi); - } - cm->prev_frame = cm->cur_frame; - - if (is_two_pass_svc(cpi)) - cpi->svc.layer_context[cpi->svc.spatial_layer_id].last_frame_type = - cm->frame_type; -} - -static void SvcEncode(VP9_COMP *cpi, size_t *size, uint8_t *dest, - unsigned int *frame_flags) { - vp9_rc_get_svc_params(cpi); - encode_frame_to_data_rate(cpi, size, dest, frame_flags); -} - -static void Pass0Encode(VP9_COMP *cpi, size_t *size, uint8_t *dest, - unsigned int *frame_flags) { - if (cpi->oxcf.rc_mode == VPX_CBR) { - vp9_rc_get_one_pass_cbr_params(cpi); - } else { - vp9_rc_get_one_pass_vbr_params(cpi); - } - encode_frame_to_data_rate(cpi, size, dest, frame_flags); -} - -static void Pass2Encode(VP9_COMP *cpi, size_t *size, - uint8_t *dest, unsigned int *frame_flags) { - cpi->allow_encode_breakout = ENCODE_BREAKOUT_ENABLED; - encode_frame_to_data_rate(cpi, size, dest, frame_flags); - - if (!(is_two_pass_svc(cpi) && cpi->svc.encode_empty_frame_state == ENCODING)) - vp9_twopass_postencode_update(cpi); -} - -static void init_ref_frame_bufs(VP9_COMMON *cm) { - int i; - BufferPool *const pool = cm->buffer_pool; - cm->new_fb_idx = INVALID_IDX; - for (i = 0; i < REF_FRAMES; ++i) { - cm->ref_frame_map[i] = INVALID_IDX; - pool->frame_bufs[i].ref_count = 0; - } -} - -static void check_initial_width(VP9_COMP *cpi, -#if CONFIG_VP9_HIGHBITDEPTH - int use_highbitdepth, -#endif - int subsampling_x, int subsampling_y) { - VP9_COMMON *const cm = &cpi->common; - - if (!cpi->initial_width || -#if CONFIG_VP9_HIGHBITDEPTH - cm->use_highbitdepth != use_highbitdepth || -#endif - cm->subsampling_x != subsampling_x || - cm->subsampling_y != subsampling_y) { - cm->subsampling_x = subsampling_x; - cm->subsampling_y = subsampling_y; -#if CONFIG_VP9_HIGHBITDEPTH - cm->use_highbitdepth = use_highbitdepth; -#endif - - alloc_raw_frame_buffers(cpi); - init_ref_frame_bufs(cm); - alloc_util_frame_buffers(cpi); - - init_motion_estimation(cpi); // TODO(agrange) This can be removed. - - cpi->initial_width = cm->width; - cpi->initial_height = cm->height; - cpi->initial_mbs = cm->MBs; - } -} - -#if CONFIG_VP9_TEMPORAL_DENOISING -static void setup_denoiser_buffer(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - if (cpi->oxcf.noise_sensitivity > 0 && - !cpi->denoiser.frame_buffer_initialized) { - vp9_denoiser_alloc(&(cpi->denoiser), cm->width, cm->height, - cm->subsampling_x, cm->subsampling_y, -#if CONFIG_VP9_HIGHBITDEPTH - cm->use_highbitdepth, -#endif - VP9_ENC_BORDER_IN_PIXELS); - } -} -#endif - -int vp9_receive_raw_frame(VP9_COMP *cpi, unsigned int frame_flags, - YV12_BUFFER_CONFIG *sd, int64_t time_stamp, - int64_t end_time) { - VP9_COMMON *cm = &cpi->common; - struct vpx_usec_timer timer; - int res = 0; - const int subsampling_x = sd->subsampling_x; - const int subsampling_y = sd->subsampling_y; -#if CONFIG_VP9_HIGHBITDEPTH - const int use_highbitdepth = sd->flags & YV12_FLAG_HIGHBITDEPTH; - check_initial_width(cpi, use_highbitdepth, subsampling_x, subsampling_y); -#else - check_initial_width(cpi, subsampling_x, subsampling_y); -#endif // CONFIG_VP9_HIGHBITDEPTH - -#if CONFIG_VP9_TEMPORAL_DENOISING - setup_denoiser_buffer(cpi); -#endif - vpx_usec_timer_start(&timer); - - if (vp9_lookahead_push(cpi->lookahead, sd, time_stamp, end_time, -#if CONFIG_VP9_HIGHBITDEPTH - use_highbitdepth, -#endif // CONFIG_VP9_HIGHBITDEPTH - frame_flags)) - res = -1; - vpx_usec_timer_mark(&timer); - cpi->time_receive_data += vpx_usec_timer_elapsed(&timer); - - if ((cm->profile == PROFILE_0 || cm->profile == PROFILE_2) && - (subsampling_x != 1 || subsampling_y != 1)) { - vpx_internal_error(&cm->error, VPX_CODEC_INVALID_PARAM, - "Non-4:2:0 color format requires profile 1 or 3"); - res = -1; - } - if ((cm->profile == PROFILE_1 || cm->profile == PROFILE_3) && - (subsampling_x == 1 && subsampling_y == 1)) { - vpx_internal_error(&cm->error, VPX_CODEC_INVALID_PARAM, - "4:2:0 color format requires profile 0 or 2"); - res = -1; - } - - return res; -} - - -static int frame_is_reference(const VP9_COMP *cpi) { - const VP9_COMMON *cm = &cpi->common; - - return cm->frame_type == KEY_FRAME || - cpi->refresh_last_frame || - cpi->refresh_golden_frame || - cpi->refresh_alt_ref_frame || - cm->refresh_frame_context || - cm->lf.mode_ref_delta_update || - cm->seg.update_map || - cm->seg.update_data; -} - -void adjust_frame_rate(VP9_COMP *cpi, - const struct lookahead_entry *source) { - int64_t this_duration; - int step = 0; - - if (source->ts_start == cpi->first_time_stamp_ever) { - this_duration = source->ts_end - source->ts_start; - step = 1; - } else { - int64_t last_duration = cpi->last_end_time_stamp_seen - - cpi->last_time_stamp_seen; - - this_duration = source->ts_end - cpi->last_end_time_stamp_seen; - - // do a step update if the duration changes by 10% - if (last_duration) - step = (int)((this_duration - last_duration) * 10 / last_duration); - } - - if (this_duration) { - if (step) { - vp9_new_framerate(cpi, 10000000.0 / this_duration); - } else { - // Average this frame's rate into the last second's average - // frame rate. If we haven't seen 1 second yet, then average - // over the whole interval seen. - const double interval = MIN((double)(source->ts_end - - cpi->first_time_stamp_ever), 10000000.0); - double avg_duration = 10000000.0 / cpi->framerate; - avg_duration *= (interval - avg_duration + this_duration); - avg_duration /= interval; - - vp9_new_framerate(cpi, 10000000.0 / avg_duration); - } - } - cpi->last_time_stamp_seen = source->ts_start; - cpi->last_end_time_stamp_seen = source->ts_end; -} - -// Returns 0 if this is not an alt ref else the offset of the source frame -// used as the arf midpoint. -static int get_arf_src_index(VP9_COMP *cpi) { - RATE_CONTROL *const rc = &cpi->rc; - int arf_src_index = 0; - if (is_altref_enabled(cpi)) { - if (cpi->oxcf.pass == 2) { - const GF_GROUP *const gf_group = &cpi->twopass.gf_group; - if (gf_group->update_type[gf_group->index] == ARF_UPDATE) { - arf_src_index = gf_group->arf_src_offset[gf_group->index]; - } - } else if (rc->source_alt_ref_pending) { - arf_src_index = rc->frames_till_gf_update_due; - } - } - return arf_src_index; -} - -static void check_src_altref(VP9_COMP *cpi, - const struct lookahead_entry *source) { - RATE_CONTROL *const rc = &cpi->rc; - - if (cpi->oxcf.pass == 2) { - const GF_GROUP *const gf_group = &cpi->twopass.gf_group; - rc->is_src_frame_alt_ref = - (gf_group->update_type[gf_group->index] == OVERLAY_UPDATE); - } else { - rc->is_src_frame_alt_ref = cpi->alt_ref_source && - (source == cpi->alt_ref_source); - } - - if (rc->is_src_frame_alt_ref) { - // Current frame is an ARF overlay frame. - cpi->alt_ref_source = NULL; - - // Don't refresh the last buffer for an ARF overlay frame. It will - // become the GF so preserve last as an alternative prediction option. - cpi->refresh_last_frame = 0; - } -} - -int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags, - size_t *size, uint8_t *dest, - int64_t *time_stamp, int64_t *time_end, int flush) { - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - VP9_COMMON *const cm = &cpi->common; - BufferPool *const pool = cm->buffer_pool; - RATE_CONTROL *const rc = &cpi->rc; - struct vpx_usec_timer cmptimer; - YV12_BUFFER_CONFIG *force_src_buffer = NULL; - struct lookahead_entry *last_source = NULL; - struct lookahead_entry *source = NULL; - int arf_src_index; - int i; - - if (is_two_pass_svc(cpi)) { -#if CONFIG_SPATIAL_SVC - vp9_svc_start_frame(cpi); - // Use a small empty frame instead of a real frame - if (cpi->svc.encode_empty_frame_state == ENCODING) - source = &cpi->svc.empty_frame; -#endif - if (oxcf->pass == 2) - vp9_restore_layer_context(cpi); - } - - vpx_usec_timer_start(&cmptimer); - - vp9_set_high_precision_mv(cpi, ALTREF_HIGH_PRECISION_MV); - - // Is multi-arf enabled. - // Note that at the moment multi_arf is only configured for 2 pass VBR and - // will not work properly with svc. - if ((oxcf->pass == 2) && !cpi->use_svc && - (cpi->oxcf.enable_auto_arf > 1)) - cpi->multi_arf_allowed = 1; - else - cpi->multi_arf_allowed = 0; - - // Normal defaults - cm->reset_frame_context = 0; - cm->refresh_frame_context = 1; - cpi->refresh_last_frame = 1; - cpi->refresh_golden_frame = 0; - cpi->refresh_alt_ref_frame = 0; - - // Should we encode an arf frame. - arf_src_index = get_arf_src_index(cpi); - - // Skip alt frame if we encode the empty frame - if (is_two_pass_svc(cpi) && source != NULL) - arf_src_index = 0; - - if (arf_src_index) { - assert(arf_src_index <= rc->frames_to_key); - - if ((source = vp9_lookahead_peek(cpi->lookahead, arf_src_index)) != NULL) { - cpi->alt_ref_source = source; - -#if CONFIG_SPATIAL_SVC - if (is_two_pass_svc(cpi) && cpi->svc.spatial_layer_id > 0) { - int i; - // Reference a hidden frame from a lower layer - for (i = cpi->svc.spatial_layer_id - 1; i >= 0; --i) { - if (oxcf->ss_enable_auto_arf[i]) { - cpi->gld_fb_idx = cpi->svc.layer_context[i].alt_ref_idx; - break; - } - } - } - cpi->svc.layer_context[cpi->svc.spatial_layer_id].has_alt_frame = 1; -#endif - - if (oxcf->arnr_max_frames > 0) { - // Produce the filtered ARF frame. - vp9_temporal_filter(cpi, arf_src_index); - vp9_extend_frame_borders(&cpi->alt_ref_buffer); - force_src_buffer = &cpi->alt_ref_buffer; - } - - cm->show_frame = 0; - cpi->refresh_alt_ref_frame = 1; - cpi->refresh_golden_frame = 0; - cpi->refresh_last_frame = 0; - rc->is_src_frame_alt_ref = 0; - rc->source_alt_ref_pending = 0; - } else { - rc->source_alt_ref_pending = 0; - } - } - - if (!source) { - // Get last frame source. - if (cm->current_video_frame > 0) { - if ((last_source = vp9_lookahead_peek(cpi->lookahead, -1)) == NULL) - return -1; - } - - // Read in the source frame. -#if CONFIG_SPATIAL_SVC - if (is_two_pass_svc(cpi)) - source = vp9_svc_lookahead_pop(cpi, cpi->lookahead, flush); - else -#endif - source = vp9_lookahead_pop(cpi->lookahead, flush); - if (source != NULL) { - cm->show_frame = 1; - cm->intra_only = 0; - // if the flags indicate intra frame, but if the current picture is for - // non-zero spatial layer, it should not be an intra picture. - // TODO(Won Kap): this needs to change if per-layer intra frame is - // allowed. - if ((source->flags & VPX_EFLAG_FORCE_KF) && cpi->svc.spatial_layer_id) { - source->flags &= ~(unsigned int)(VPX_EFLAG_FORCE_KF); - } - - // Check to see if the frame should be encoded as an arf overlay. - check_src_altref(cpi, source); - } - } - - if (source) { - cpi->un_scaled_source = cpi->Source = force_src_buffer ? force_src_buffer - : &source->img; - - cpi->unscaled_last_source = last_source != NULL ? &last_source->img : NULL; - - *time_stamp = source->ts_start; - *time_end = source->ts_end; - *frame_flags = (source->flags & VPX_EFLAG_FORCE_KF) ? FRAMEFLAGS_KEY : 0; - - } else { - *size = 0; - if (flush && oxcf->pass == 1 && !cpi->twopass.first_pass_done) { - vp9_end_first_pass(cpi); /* get last stats packet */ - cpi->twopass.first_pass_done = 1; - } - return -1; - } - - if (source->ts_start < cpi->first_time_stamp_ever) { - cpi->first_time_stamp_ever = source->ts_start; - cpi->last_end_time_stamp_seen = source->ts_start; - } - - // Clear down mmx registers - vp9_clear_system_state(); - - // adjust frame rates based on timestamps given - if (cm->show_frame) { - adjust_frame_rate(cpi, source); - } - - if (cpi->svc.number_temporal_layers > 1 && - oxcf->rc_mode == VPX_CBR) { - vp9_update_temporal_layer_framerate(cpi); - vp9_restore_layer_context(cpi); - } - - // Find a free buffer for the new frame, releasing the reference previously - // held. - if (cm->new_fb_idx != INVALID_IDX) { - --pool->frame_bufs[cm->new_fb_idx].ref_count; - } - cm->new_fb_idx = get_free_fb(cm); - - if (cm->new_fb_idx == INVALID_IDX) - return -1; - - cm->cur_frame = &pool->frame_bufs[cm->new_fb_idx]; - - if (!cpi->use_svc && cpi->multi_arf_allowed) { - if (cm->frame_type == KEY_FRAME) { - init_buffer_indices(cpi); - } else if (oxcf->pass == 2) { - const GF_GROUP *const gf_group = &cpi->twopass.gf_group; - cpi->alt_fb_idx = gf_group->arf_ref_idx[gf_group->index]; - } - } - - // Start with a 0 size frame. - *size = 0; - - cpi->frame_flags = *frame_flags; - - if ((oxcf->pass == 2) && - (!cpi->use_svc || - (is_two_pass_svc(cpi) && - cpi->svc.encode_empty_frame_state != ENCODING))) { - vp9_rc_get_second_pass_params(cpi); - } else { - set_frame_size(cpi); - } - - for (i = 0; i < MAX_REF_FRAMES; ++i) - cpi->scaled_ref_idx[i] = INVALID_IDX; - - if (oxcf->pass == 1 && - (!cpi->use_svc || is_two_pass_svc(cpi))) { - const int lossless = is_lossless_requested(oxcf); -#if CONFIG_VP9_HIGHBITDEPTH - if (cpi->oxcf.use_highbitdepth) - cpi->td.mb.fwd_txm4x4 = lossless ? - vp9_highbd_fwht4x4 : vp9_highbd_fdct4x4; - else - cpi->td.mb.fwd_txm4x4 = lossless ? vp9_fwht4x4 : vp9_fdct4x4; - cpi->td.mb.highbd_itxm_add = lossless ? vp9_highbd_iwht4x4_add : - vp9_highbd_idct4x4_add; -#else - cpi->td.mb.fwd_txm4x4 = lossless ? vp9_fwht4x4 : vp9_fdct4x4; -#endif // CONFIG_VP9_HIGHBITDEPTH - cpi->td.mb.itxm_add = lossless ? vp9_iwht4x4_add : vp9_idct4x4_add; - vp9_first_pass(cpi, source); - } else if (oxcf->pass == 2 && - (!cpi->use_svc || is_two_pass_svc(cpi))) { - Pass2Encode(cpi, size, dest, frame_flags); - } else if (cpi->use_svc) { - SvcEncode(cpi, size, dest, frame_flags); - } else { - // One pass encode - Pass0Encode(cpi, size, dest, frame_flags); - } - - if (cm->refresh_frame_context) - cm->frame_contexts[cm->frame_context_idx] = *cm->fc; - - // No frame encoded, or frame was dropped, release scaled references. - if ((*size == 0) && (frame_is_intra_only(cm) == 0)) { - release_scaled_references(cpi); - } - - if (*size > 0) { - cpi->droppable = !frame_is_reference(cpi); - } - - // Save layer specific state. - if ((cpi->svc.number_temporal_layers > 1 && - oxcf->rc_mode == VPX_CBR) || - ((cpi->svc.number_temporal_layers > 1 || - cpi->svc.number_spatial_layers > 1) && - oxcf->pass == 2)) { - vp9_save_layer_context(cpi); - } - - vpx_usec_timer_mark(&cmptimer); - cpi->time_compress_data += vpx_usec_timer_elapsed(&cmptimer); - - if (cpi->b_calculate_psnr && oxcf->pass != 1 && cm->show_frame) - generate_psnr_packet(cpi); - -#if CONFIG_INTERNAL_STATS - - if (oxcf->pass != 1) { - cpi->bytes += (int)(*size); - - if (cm->show_frame) { - cpi->count++; - - if (cpi->b_calculate_psnr) { - YV12_BUFFER_CONFIG *orig = cpi->Source; - YV12_BUFFER_CONFIG *recon = cpi->common.frame_to_show; - YV12_BUFFER_CONFIG *pp = &cm->post_proc_buffer; - PSNR_STATS psnr; -#if CONFIG_VP9_HIGHBITDEPTH - calc_highbd_psnr(orig, recon, &psnr, cpi->td.mb.e_mbd.bd, - cpi->oxcf.input_bit_depth); -#else - calc_psnr(orig, recon, &psnr); -#endif // CONFIG_VP9_HIGHBITDEPTH - - cpi->total += psnr.psnr[0]; - cpi->total_y += psnr.psnr[1]; - cpi->total_u += psnr.psnr[2]; - cpi->total_v += psnr.psnr[3]; - cpi->total_sq_error += psnr.sse[0]; - cpi->total_samples += psnr.samples[0]; - - { - PSNR_STATS psnr2; - double frame_ssim2 = 0, weight = 0; -#if CONFIG_VP9_POSTPROC - if (vp9_alloc_frame_buffer(&cm->post_proc_buffer, - recon->y_crop_width, recon->y_crop_height, - cm->subsampling_x, cm->subsampling_y, -#if CONFIG_VP9_HIGHBITDEPTH - cm->use_highbitdepth, -#endif - VP9_ENC_BORDER_IN_PIXELS, - cm->byte_alignment) < 0) { - vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR, - "Failed to allocate post processing buffer"); - } - - vp9_deblock(cm->frame_to_show, &cm->post_proc_buffer, - cm->lf.filter_level * 10 / 6); -#endif - vp9_clear_system_state(); - -#if CONFIG_VP9_HIGHBITDEPTH - calc_highbd_psnr(orig, pp, &psnr, cpi->td.mb.e_mbd.bd, - cpi->oxcf.input_bit_depth); -#else - calc_psnr(orig, pp, &psnr2); -#endif // CONFIG_VP9_HIGHBITDEPTH - - cpi->totalp += psnr2.psnr[0]; - cpi->totalp_y += psnr2.psnr[1]; - cpi->totalp_u += psnr2.psnr[2]; - cpi->totalp_v += psnr2.psnr[3]; - cpi->totalp_sq_error += psnr2.sse[0]; - cpi->totalp_samples += psnr2.samples[0]; - -#if CONFIG_VP9_HIGHBITDEPTH - if (cm->use_highbitdepth) { - frame_ssim2 = vp9_highbd_calc_ssim(orig, recon, &weight, - (int)cm->bit_depth); - } else { - frame_ssim2 = vp9_calc_ssim(orig, recon, &weight); - } -#else - frame_ssim2 = vp9_calc_ssim(orig, recon, &weight); -#endif // CONFIG_VP9_HIGHBITDEPTH - - cpi->summed_quality += frame_ssim2 * weight; - cpi->summed_weights += weight; - -#if CONFIG_VP9_HIGHBITDEPTH - if (cm->use_highbitdepth) { - frame_ssim2 = vp9_highbd_calc_ssim( - orig, &cm->post_proc_buffer, &weight, (int)cm->bit_depth); - } else { - frame_ssim2 = vp9_calc_ssim(orig, &cm->post_proc_buffer, &weight); - } -#else - frame_ssim2 = vp9_calc_ssim(orig, &cm->post_proc_buffer, &weight); -#endif // CONFIG_VP9_HIGHBITDEPTH - - cpi->summedp_quality += frame_ssim2 * weight; - cpi->summedp_weights += weight; -#if 0 - { - FILE *f = fopen("q_used.stt", "a"); - fprintf(f, "%5d : Y%f7.3:U%f7.3:V%f7.3:F%f7.3:S%7.3f\n", - cpi->common.current_video_frame, y2, u2, v2, - frame_psnr2, frame_ssim2); - fclose(f); - } -#endif - } - } - - - if (cpi->b_calculate_ssimg) { - double y, u, v, frame_all; -#if CONFIG_VP9_HIGHBITDEPTH - if (cm->use_highbitdepth) { - frame_all = vp9_highbd_calc_ssimg(cpi->Source, cm->frame_to_show, &y, - &u, &v, (int)cm->bit_depth); - } else { - frame_all = vp9_calc_ssimg(cpi->Source, cm->frame_to_show, &y, &u, - &v); - } -#else - frame_all = vp9_calc_ssimg(cpi->Source, cm->frame_to_show, &y, &u, &v); -#endif // CONFIG_VP9_HIGHBITDEPTH - cpi->total_ssimg_y += y; - cpi->total_ssimg_u += u; - cpi->total_ssimg_v += v; - cpi->total_ssimg_all += frame_all; - } - } - } - -#endif - - if (is_two_pass_svc(cpi)) { - if (cpi->svc.encode_empty_frame_state == ENCODING) - cpi->svc.encode_empty_frame_state = ENCODED; - - if (cm->show_frame) { - ++cpi->svc.spatial_layer_to_encode; - if (cpi->svc.spatial_layer_to_encode >= cpi->svc.number_spatial_layers) - cpi->svc.spatial_layer_to_encode = 0; - - // May need the empty frame after an visible frame. - cpi->svc.encode_empty_frame_state = NEED_TO_ENCODE; - } - } - return 0; -} - -int vp9_get_preview_raw_frame(VP9_COMP *cpi, YV12_BUFFER_CONFIG *dest, - vp9_ppflags_t *flags) { - VP9_COMMON *cm = &cpi->common; -#if !CONFIG_VP9_POSTPROC - (void)flags; -#endif - - if (!cm->show_frame) { - return -1; - } else { - int ret; -#if CONFIG_VP9_POSTPROC - ret = vp9_post_proc_frame(cm, dest, flags); -#else - if (cm->frame_to_show) { - *dest = *cm->frame_to_show; - dest->y_width = cm->width; - dest->y_height = cm->height; - dest->uv_width = cm->width >> cm->subsampling_x; - dest->uv_height = cm->height >> cm->subsampling_y; - ret = 0; - } else { - ret = -1; - } -#endif // !CONFIG_VP9_POSTPROC - vp9_clear_system_state(); - return ret; - } -} - -int vp9_set_internal_size(VP9_COMP *cpi, - VPX_SCALING horiz_mode, VPX_SCALING vert_mode) { - VP9_COMMON *cm = &cpi->common; - int hr = 0, hs = 0, vr = 0, vs = 0; - - if (horiz_mode > ONETWO || vert_mode > ONETWO) - return -1; - - Scale2Ratio(horiz_mode, &hr, &hs); - Scale2Ratio(vert_mode, &vr, &vs); - - // always go to the next whole number - cm->width = (hs - 1 + cpi->oxcf.width * hr) / hs; - cm->height = (vs - 1 + cpi->oxcf.height * vr) / vs; - assert(cm->width <= cpi->initial_width); - assert(cm->height <= cpi->initial_height); - - update_frame_size(cpi); - - return 0; -} - -int vp9_set_size_literal(VP9_COMP *cpi, unsigned int width, - unsigned int height) { - VP9_COMMON *cm = &cpi->common; -#if CONFIG_VP9_HIGHBITDEPTH - check_initial_width(cpi, cm->use_highbitdepth, 1, 1); -#else - check_initial_width(cpi, 1, 1); -#endif // CONFIG_VP9_HIGHBITDEPTH - -#if CONFIG_VP9_TEMPORAL_DENOISING - setup_denoiser_buffer(cpi); -#endif - - if (width) { - cm->width = width; - if (cm->width > cpi->initial_width) { - cm->width = cpi->initial_width; - printf("Warning: Desired width too large, changed to %d\n", cm->width); - } - } - - if (height) { - cm->height = height; - if (cm->height > cpi->initial_height) { - cm->height = cpi->initial_height; - printf("Warning: Desired height too large, changed to %d\n", cm->height); - } - } - assert(cm->width <= cpi->initial_width); - assert(cm->height <= cpi->initial_height); - - update_frame_size(cpi); - - return 0; -} - -void vp9_set_svc(VP9_COMP *cpi, int use_svc) { - cpi->use_svc = use_svc; - return; -} - -int64_t vp9_get_y_sse(const YV12_BUFFER_CONFIG *a, - const YV12_BUFFER_CONFIG *b) { - assert(a->y_crop_width == b->y_crop_width); - assert(a->y_crop_height == b->y_crop_height); - - return get_sse(a->y_buffer, a->y_stride, b->y_buffer, b->y_stride, - a->y_crop_width, a->y_crop_height); -} - -#if CONFIG_VP9_HIGHBITDEPTH -int64_t vp9_highbd_get_y_sse(const YV12_BUFFER_CONFIG *a, - const YV12_BUFFER_CONFIG *b) { - assert(a->y_crop_width == b->y_crop_width); - assert(a->y_crop_height == b->y_crop_height); - assert((a->flags & YV12_FLAG_HIGHBITDEPTH) != 0); - assert((b->flags & YV12_FLAG_HIGHBITDEPTH) != 0); - - return highbd_get_sse(a->y_buffer, a->y_stride, b->y_buffer, b->y_stride, - a->y_crop_width, a->y_crop_height); -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -int vp9_get_quantizer(VP9_COMP *cpi) { - return cpi->common.base_qindex; -} - -void vp9_apply_encoding_flags(VP9_COMP *cpi, vpx_enc_frame_flags_t flags) { - if (flags & (VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_REF_GF | - VP8_EFLAG_NO_REF_ARF)) { - int ref = 7; - - if (flags & VP8_EFLAG_NO_REF_LAST) - ref ^= VP9_LAST_FLAG; - - if (flags & VP8_EFLAG_NO_REF_GF) - ref ^= VP9_GOLD_FLAG; - - if (flags & VP8_EFLAG_NO_REF_ARF) - ref ^= VP9_ALT_FLAG; - - vp9_use_as_reference(cpi, ref); - } - - if (flags & (VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF | - VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_FORCE_GF | - VP8_EFLAG_FORCE_ARF)) { - int upd = 7; - - if (flags & VP8_EFLAG_NO_UPD_LAST) - upd ^= VP9_LAST_FLAG; - - if (flags & VP8_EFLAG_NO_UPD_GF) - upd ^= VP9_GOLD_FLAG; - - if (flags & VP8_EFLAG_NO_UPD_ARF) - upd ^= VP9_ALT_FLAG; - - vp9_update_reference(cpi, upd); - } - - if (flags & VP8_EFLAG_NO_UPD_ENTROPY) { - vp9_update_entropy(cpi, 0); - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_encoder.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_encoder.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_encoder.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_encoder.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,627 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_ENCODER_H_ -#define VP9_ENCODER_VP9_ENCODER_H_ - -#include - -#include "./vpx_config.h" -#include "vpx/internal/vpx_codec_internal.h" -#include "vpx/vp8cx.h" - -#include "vp9/common/vp9_alloccommon.h" -#include "vp9/common/vp9_ppflags.h" -#include "vp9/common/vp9_entropymode.h" -#include "vp9/common/vp9_thread_common.h" -#include "vp9/common/vp9_onyxc_int.h" -#include "vp9/common/vp9_thread.h" - -#include "vp9/encoder/vp9_aq_cyclicrefresh.h" -#include "vp9/encoder/vp9_context_tree.h" -#include "vp9/encoder/vp9_encodemb.h" -#include "vp9/encoder/vp9_firstpass.h" -#include "vp9/encoder/vp9_lookahead.h" -#include "vp9/encoder/vp9_mbgraph.h" -#include "vp9/encoder/vp9_mcomp.h" -#include "vp9/encoder/vp9_quantize.h" -#include "vp9/encoder/vp9_ratectrl.h" -#include "vp9/encoder/vp9_rd.h" -#include "vp9/encoder/vp9_speed_features.h" -#include "vp9/encoder/vp9_svc_layercontext.h" -#include "vp9/encoder/vp9_tokenize.h" -#include "vp9/encoder/vp9_variance.h" - -#if CONFIG_VP9_TEMPORAL_DENOISING -#include "vp9/encoder/vp9_denoiser.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#define DEFAULT_GF_INTERVAL 10 - -typedef struct { - int nmvjointcost[MV_JOINTS]; - int nmvcosts[2][MV_VALS]; - int nmvcosts_hp[2][MV_VALS]; - - vp9_prob segment_pred_probs[PREDICTION_PROBS]; - - unsigned char *last_frame_seg_map_copy; - - // 0 = Intra, Last, GF, ARF - signed char last_ref_lf_deltas[MAX_REF_LF_DELTAS]; - // 0 = ZERO_MV, MV - signed char last_mode_lf_deltas[MAX_MODE_LF_DELTAS]; - - FRAME_CONTEXT fc; -} CODING_CONTEXT; - - -typedef enum { - // encode_breakout is disabled. - ENCODE_BREAKOUT_DISABLED = 0, - // encode_breakout is enabled. - ENCODE_BREAKOUT_ENABLED = 1, - // encode_breakout is enabled with small max_thresh limit. - ENCODE_BREAKOUT_LIMITED = 2 -} ENCODE_BREAKOUT_TYPE; - -typedef enum { - NORMAL = 0, - FOURFIVE = 1, - THREEFIVE = 2, - ONETWO = 3 -} VPX_SCALING; - -typedef enum { - // Good Quality Fast Encoding. The encoder balances quality with the amount of - // time it takes to encode the output. Speed setting controls how fast. - GOOD, - - // The encoder places priority on the quality of the output over encoding - // speed. The output is compressed at the highest possible quality. This - // option takes the longest amount of time to encode. Speed setting ignored. - BEST, - - // Realtime/Live Encoding. This mode is optimized for realtime encoding (for - // example, capturing a television signal or feed from a live camera). Speed - // setting controls how fast. - REALTIME -} MODE; - -typedef enum { - FRAMEFLAGS_KEY = 1 << 0, - FRAMEFLAGS_GOLDEN = 1 << 1, - FRAMEFLAGS_ALTREF = 1 << 2, -} FRAMETYPE_FLAGS; - -typedef enum { - NO_AQ = 0, - VARIANCE_AQ = 1, - COMPLEXITY_AQ = 2, - CYCLIC_REFRESH_AQ = 3, - AQ_MODE_COUNT // This should always be the last member of the enum -} AQ_MODE; - -typedef enum { - RESIZE_NONE = 0, // No frame resizing allowed (except for SVC). - RESIZE_FIXED = 1, // All frames are coded at the specified dimension. - RESIZE_DYNAMIC = 2 // Coded size of each frame is determined by the codec. -} RESIZE_TYPE; - -typedef struct VP9EncoderConfig { - BITSTREAM_PROFILE profile; - vpx_bit_depth_t bit_depth; // Codec bit-depth. - int width; // width of data passed to the compressor - int height; // height of data passed to the compressor - unsigned int input_bit_depth; // Input bit depth. - double init_framerate; // set to passed in framerate - int64_t target_bandwidth; // bandwidth to be used in kilobits per second - - int noise_sensitivity; // pre processing blur: recommendation 0 - int sharpness; // sharpening output: recommendation 0: - int speed; - // maximum allowed bitrate for any intra frame in % of bitrate target. - unsigned int rc_max_intra_bitrate_pct; - // maximum allowed bitrate for any inter frame in % of bitrate target. - unsigned int rc_max_inter_bitrate_pct; - // percent of rate boost for golden frame in CBR mode. - unsigned int gf_cbr_boost_pct; - - MODE mode; - int pass; - - // Key Framing Operations - int auto_key; // autodetect cut scenes and set the keyframes - int key_freq; // maximum distance to key frame. - - int lag_in_frames; // how many frames lag before we start encoding - - // ---------------------------------------------------------------- - // DATARATE CONTROL OPTIONS - - // vbr, cbr, constrained quality or constant quality - enum vpx_rc_mode rc_mode; - - // buffer targeting aggressiveness - int under_shoot_pct; - int over_shoot_pct; - - // buffering parameters - int64_t starting_buffer_level_ms; - int64_t optimal_buffer_level_ms; - int64_t maximum_buffer_size_ms; - - // Frame drop threshold. - int drop_frames_water_mark; - - // controlling quality - int fixed_q; - int worst_allowed_q; - int best_allowed_q; - int cq_level; - AQ_MODE aq_mode; // Adaptive Quantization mode - - // Internal frame size scaling. - RESIZE_TYPE resize_mode; - int scaled_frame_width; - int scaled_frame_height; - - // Enable feature to reduce the frame quantization every x frames. - int frame_periodic_boost; - - // two pass datarate control - int two_pass_vbrbias; // two pass datarate control tweaks - int two_pass_vbrmin_section; - int two_pass_vbrmax_section; - // END DATARATE CONTROL OPTIONS - // ---------------------------------------------------------------- - - // Spatial and temporal scalability. - int ss_number_layers; // Number of spatial layers. - int ts_number_layers; // Number of temporal layers. - // Bitrate allocation for spatial layers. - int ss_target_bitrate[VPX_SS_MAX_LAYERS]; - int ss_enable_auto_arf[VPX_SS_MAX_LAYERS]; - // Bitrate allocation (CBR mode) and framerate factor, for temporal layers. - int ts_target_bitrate[VPX_TS_MAX_LAYERS]; - int ts_rate_decimator[VPX_TS_MAX_LAYERS]; - - int enable_auto_arf; - - int encode_breakout; // early breakout : for video conf recommend 800 - - /* Bitfield defining the error resiliency features to enable. - * Can provide decodable frames after losses in previous - * frames and decodable partitions after losses in the same frame. - */ - unsigned int error_resilient_mode; - - /* Bitfield defining the parallel decoding mode where the - * decoding in successive frames may be conducted in parallel - * just by decoding the frame headers. - */ - unsigned int frame_parallel_decoding_mode; - - int arnr_max_frames; - int arnr_strength; - - int tile_columns; - int tile_rows; - - int max_threads; - - vpx_fixed_buf_t two_pass_stats_in; - struct vpx_codec_pkt_list *output_pkt_list; - -#if CONFIG_FP_MB_STATS - vpx_fixed_buf_t firstpass_mb_stats_in; -#endif - - vp8e_tuning tuning; - vp9e_tune_content content; -#if CONFIG_VP9_HIGHBITDEPTH - int use_highbitdepth; -#endif - vpx_color_space_t color_space; -} VP9EncoderConfig; - -static INLINE int is_lossless_requested(const VP9EncoderConfig *cfg) { - return cfg->best_allowed_q == 0 && cfg->worst_allowed_q == 0; -} - -// TODO(jingning) All spatially adaptive variables should go to TileDataEnc. -typedef struct TileDataEnc { - TileInfo tile_info; - int thresh_freq_fact[BLOCK_SIZES][MAX_MODES]; - int mode_map[BLOCK_SIZES][MAX_MODES]; -} TileDataEnc; - -typedef struct RD_COUNTS { - vp9_coeff_count coef_counts[TX_SIZES][PLANE_TYPES]; - int64_t comp_pred_diff[REFERENCE_MODES]; - int64_t tx_select_diff[TX_MODES]; - int64_t filter_diff[SWITCHABLE_FILTER_CONTEXTS]; -} RD_COUNTS; - -typedef struct ThreadData { - MACROBLOCK mb; - RD_COUNTS rd_counts; - FRAME_COUNTS *counts; - - PICK_MODE_CONTEXT *leaf_tree; - PC_TREE *pc_tree; - PC_TREE *pc_root; -} ThreadData; - -struct EncWorkerData; - -typedef struct ActiveMap { - int enabled; - int update; - unsigned char *map; -} ActiveMap; - -typedef struct VP9_COMP { - QUANTS quants; - ThreadData td; - DECLARE_ALIGNED(16, int16_t, y_dequant[QINDEX_RANGE][8]); - DECLARE_ALIGNED(16, int16_t, uv_dequant[QINDEX_RANGE][8]); - VP9_COMMON common; - VP9EncoderConfig oxcf; - struct lookahead_ctx *lookahead; - struct lookahead_entry *alt_ref_source; - - YV12_BUFFER_CONFIG *Source; - YV12_BUFFER_CONFIG *Last_Source; // NULL for first frame and alt_ref frames - YV12_BUFFER_CONFIG *un_scaled_source; - YV12_BUFFER_CONFIG scaled_source; - YV12_BUFFER_CONFIG *unscaled_last_source; - YV12_BUFFER_CONFIG scaled_last_source; - - TileDataEnc *tile_data; - - // For a still frame, this flag is set to 1 to skip partition search. - int partition_search_skippable_frame; - - int scaled_ref_idx[MAX_REF_FRAMES]; - int lst_fb_idx; - int gld_fb_idx; - int alt_fb_idx; - - int refresh_last_frame; - int refresh_golden_frame; - int refresh_alt_ref_frame; - - int ext_refresh_frame_flags_pending; - int ext_refresh_last_frame; - int ext_refresh_golden_frame; - int ext_refresh_alt_ref_frame; - - int ext_refresh_frame_context_pending; - int ext_refresh_frame_context; - - YV12_BUFFER_CONFIG last_frame_uf; - - TOKENEXTRA *tile_tok[4][1 << 6]; - unsigned int tok_count[4][1 << 6]; - - // Ambient reconstruction err target for force key frames - int64_t ambient_err; - - RD_OPT rd; - - CODING_CONTEXT coding_context; - - int *nmvcosts[2]; - int *nmvcosts_hp[2]; - int *nmvsadcosts[2]; - int *nmvsadcosts_hp[2]; - - int64_t last_time_stamp_seen; - int64_t last_end_time_stamp_seen; - int64_t first_time_stamp_ever; - - RATE_CONTROL rc; - double framerate; - - int interp_filter_selected[MAX_REF_FRAMES][SWITCHABLE]; - - struct vpx_codec_pkt_list *output_pkt_list; - - MBGRAPH_FRAME_STATS mbgraph_stats[MAX_LAG_BUFFERS]; - int mbgraph_n_frames; // number of frames filled in the above - int static_mb_pct; // % forced skip mbs by segmentation - int ref_frame_flags; - - SPEED_FEATURES sf; - - unsigned int max_mv_magnitude; - int mv_step_param; - - int allow_comp_inter_inter; - - // Default value is 1. From first pass stats, encode_breakout may be disabled. - ENCODE_BREAKOUT_TYPE allow_encode_breakout; - - // Get threshold from external input. A suggested threshold is 800 for HD - // clips, and 300 for < HD clips. - int encode_breakout; - - unsigned char *segmentation_map; - - // segment threashold for encode breakout - int segment_encode_breakout[MAX_SEGMENTS]; - - CYCLIC_REFRESH *cyclic_refresh; - ActiveMap active_map; - - fractional_mv_step_fp *find_fractional_mv_step; - vp9_full_search_fn_t full_search_sad; - vp9_diamond_search_fn_t diamond_search_sad; - vp9_variance_fn_ptr_t fn_ptr[BLOCK_SIZES]; - uint64_t time_receive_data; - uint64_t time_compress_data; - uint64_t time_pick_lpf; - uint64_t time_encode_sb_row; - -#if CONFIG_FP_MB_STATS - int use_fp_mb_stats; -#endif - - TWO_PASS twopass; - - YV12_BUFFER_CONFIG alt_ref_buffer; - - -#if CONFIG_INTERNAL_STATS - unsigned int mode_chosen_counts[MAX_MODES]; - - int count; - double total_y; - double total_u; - double total_v; - double total; - uint64_t total_sq_error; - uint64_t total_samples; - - double totalp_y; - double totalp_u; - double totalp_v; - double totalp; - uint64_t totalp_sq_error; - uint64_t totalp_samples; - - int bytes; - double summed_quality; - double summed_weights; - double summedp_quality; - double summedp_weights; - unsigned int tot_recode_hits; - - - double total_ssimg_y; - double total_ssimg_u; - double total_ssimg_v; - double total_ssimg_all; - - int b_calculate_ssimg; -#endif - int b_calculate_psnr; - - int droppable; - - int initial_width; - int initial_height; - int initial_mbs; // Number of MBs in the full-size frame; to be used to - // normalize the firstpass stats. This will differ from the - // number of MBs in the current frame when the frame is - // scaled. - - int use_svc; - - SVC svc; - - // Store frame variance info in SOURCE_VAR_BASED_PARTITION search type. - diff *source_diff_var; - // The threshold used in SOURCE_VAR_BASED_PARTITION search type. - unsigned int source_var_thresh; - int frames_till_next_var_check; - - int frame_flags; - - search_site_config ss_cfg; - - int mbmode_cost[INTRA_MODES]; - unsigned int inter_mode_cost[INTER_MODE_CONTEXTS][INTER_MODES]; - int intra_uv_mode_cost[FRAME_TYPES][INTRA_MODES]; - int y_mode_costs[INTRA_MODES][INTRA_MODES][INTRA_MODES]; - int switchable_interp_costs[SWITCHABLE_FILTER_CONTEXTS][SWITCHABLE_FILTERS]; - int partition_cost[PARTITION_CONTEXTS][PARTITION_TYPES]; - - int multi_arf_allowed; - int multi_arf_enabled; - int multi_arf_last_grp_enabled; - -#if CONFIG_VP9_TEMPORAL_DENOISING - VP9_DENOISER denoiser; -#endif - - int resize_pending; - - // VAR_BASED_PARTITION thresholds - int64_t vbp_threshold; - int64_t vbp_threshold_bsize_min; - int64_t vbp_threshold_bsize_max; - int64_t vbp_threshold_16x16; - BLOCK_SIZE vbp_bsize_min; - - // Multi-threading - int num_workers; - VP9Worker *workers; - struct EncWorkerData *tile_thr_data; - VP9LfSync lf_row_sync; -} VP9_COMP; - -void vp9_initialize_enc(void); - -struct VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf, - BufferPool *const pool); -void vp9_remove_compressor(VP9_COMP *cpi); - -void vp9_change_config(VP9_COMP *cpi, const VP9EncoderConfig *oxcf); - - // receive a frames worth of data. caller can assume that a copy of this - // frame is made and not just a copy of the pointer.. -int vp9_receive_raw_frame(VP9_COMP *cpi, unsigned int frame_flags, - YV12_BUFFER_CONFIG *sd, int64_t time_stamp, - int64_t end_time_stamp); - -int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags, - size_t *size, uint8_t *dest, - int64_t *time_stamp, int64_t *time_end, int flush); - -int vp9_get_preview_raw_frame(VP9_COMP *cpi, YV12_BUFFER_CONFIG *dest, - vp9_ppflags_t *flags); - -int vp9_use_as_reference(VP9_COMP *cpi, int ref_frame_flags); - -void vp9_update_reference(VP9_COMP *cpi, int ref_frame_flags); - -int vp9_copy_reference_enc(VP9_COMP *cpi, VP9_REFFRAME ref_frame_flag, - YV12_BUFFER_CONFIG *sd); - -int vp9_set_reference_enc(VP9_COMP *cpi, VP9_REFFRAME ref_frame_flag, - YV12_BUFFER_CONFIG *sd); - -int vp9_update_entropy(VP9_COMP *cpi, int update); - -int vp9_set_active_map(VP9_COMP *cpi, unsigned char *map, int rows, int cols); - -int vp9_set_internal_size(VP9_COMP *cpi, - VPX_SCALING horiz_mode, VPX_SCALING vert_mode); - -int vp9_set_size_literal(VP9_COMP *cpi, unsigned int width, - unsigned int height); - -void vp9_set_svc(VP9_COMP *cpi, int use_svc); - -int vp9_get_quantizer(struct VP9_COMP *cpi); - -static INLINE int frame_is_kf_gf_arf(const VP9_COMP *cpi) { - return frame_is_intra_only(&cpi->common) || - cpi->refresh_alt_ref_frame || - (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref); -} - -static INLINE int get_ref_frame_map_idx(const VP9_COMP *cpi, - MV_REFERENCE_FRAME ref_frame) { - if (ref_frame == LAST_FRAME) { - return cpi->lst_fb_idx; - } else if (ref_frame == GOLDEN_FRAME) { - return cpi->gld_fb_idx; - } else { - return cpi->alt_fb_idx; - } -} - -static INLINE int get_ref_frame_buf_idx(const VP9_COMP *const cpi, - int ref_frame) { - const VP9_COMMON *const cm = &cpi->common; - const int map_idx = get_ref_frame_map_idx(cpi, ref_frame); - return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : INVALID_IDX; -} - -static INLINE YV12_BUFFER_CONFIG *get_ref_frame_buffer( - VP9_COMP *cpi, MV_REFERENCE_FRAME ref_frame) { - VP9_COMMON *const cm = &cpi->common; - const int buf_idx = get_ref_frame_buf_idx(cpi, ref_frame); - return - buf_idx != INVALID_IDX ? &cm->buffer_pool->frame_bufs[buf_idx].buf : NULL; -} - -static INLINE int get_token_alloc(int mb_rows, int mb_cols) { - // TODO(JBB): double check we can't exceed this token count if we have a - // 32x32 transform crossing a boundary at a multiple of 16. - // mb_rows, cols are in units of 16 pixels. We assume 3 planes all at full - // resolution. We assume up to 1 token per pixel, and then allow - // a head room of 4. - return mb_rows * mb_cols * (16 * 16 * 3 + 4); -} - -// Get the allocated token size for a tile. It does the same calculation as in -// the frame token allocation. -static INLINE int allocated_tokens(TileInfo tile) { - int tile_mb_rows = (tile.mi_row_end - tile.mi_row_start + 1) >> 1; - int tile_mb_cols = (tile.mi_col_end - tile.mi_col_start + 1) >> 1; - - return get_token_alloc(tile_mb_rows, tile_mb_cols); -} - -int64_t vp9_get_y_sse(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b); -#if CONFIG_VP9_HIGHBITDEPTH -int64_t vp9_highbd_get_y_sse(const YV12_BUFFER_CONFIG *a, - const YV12_BUFFER_CONFIG *b); -#endif // CONFIG_VP9_HIGHBITDEPTH - -void vp9_alloc_compressor_data(VP9_COMP *cpi); - -void vp9_scale_references(VP9_COMP *cpi); - -void vp9_update_reference_frames(VP9_COMP *cpi); - -void vp9_set_high_precision_mv(VP9_COMP *cpi, int allow_high_precision_mv); - -YV12_BUFFER_CONFIG *vp9_scale_if_required(VP9_COMMON *cm, - YV12_BUFFER_CONFIG *unscaled, - YV12_BUFFER_CONFIG *scaled); - -void vp9_apply_encoding_flags(VP9_COMP *cpi, vpx_enc_frame_flags_t flags); - -static INLINE int is_two_pass_svc(const struct VP9_COMP *const cpi) { - return cpi->use_svc && - ((cpi->svc.number_spatial_layers > 1) || - (cpi->svc.number_temporal_layers > 1 && cpi->oxcf.pass != 0)); -} - -static INLINE int is_altref_enabled(const VP9_COMP *const cpi) { - return cpi->oxcf.mode != REALTIME && cpi->oxcf.lag_in_frames > 0 && - (cpi->oxcf.enable_auto_arf && - (!is_two_pass_svc(cpi) || - cpi->oxcf.ss_enable_auto_arf[cpi->svc.spatial_layer_id])); -} - -static INLINE void set_ref_ptrs(VP9_COMMON *cm, MACROBLOCKD *xd, - MV_REFERENCE_FRAME ref0, - MV_REFERENCE_FRAME ref1) { - xd->block_refs[0] = &cm->frame_refs[ref0 >= LAST_FRAME ? ref0 - LAST_FRAME - : 0]; - xd->block_refs[1] = &cm->frame_refs[ref1 >= LAST_FRAME ? ref1 - LAST_FRAME - : 0]; -} - -static INLINE int get_chessboard_index(const int frame_index) { - return frame_index & 0x1; -} - -static INLINE int *cond_cost_list(const struct VP9_COMP *cpi, int *cost_list) { - return cpi->sf.mv.subpel_search_method != SUBPEL_TREE ? cost_list : NULL; -} - -void vp9_new_framerate(VP9_COMP *cpi, double framerate); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_ENCODER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_ethread.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_ethread.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_ethread.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_ethread.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,179 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vp9/encoder/vp9_encodeframe.h" -#include "vp9/encoder/vp9_encoder.h" -#include "vp9/encoder/vp9_ethread.h" - -static void accumulate_rd_opt(ThreadData *td, ThreadData *td_t) { - int i, j, k, l, m, n; - - for (i = 0; i < REFERENCE_MODES; i++) - td->rd_counts.comp_pred_diff[i] += td_t->rd_counts.comp_pred_diff[i]; - - for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) - td->rd_counts.filter_diff[i] += td_t->rd_counts.filter_diff[i]; - - for (i = 0; i < TX_MODES; i++) - td->rd_counts.tx_select_diff[i] += td_t->rd_counts.tx_select_diff[i]; - - for (i = 0; i < TX_SIZES; i++) - for (j = 0; j < PLANE_TYPES; j++) - for (k = 0; k < REF_TYPES; k++) - for (l = 0; l < COEF_BANDS; l++) - for (m = 0; m < COEFF_CONTEXTS; m++) - for (n = 0; n < ENTROPY_TOKENS; n++) - td->rd_counts.coef_counts[i][j][k][l][m][n] += - td_t->rd_counts.coef_counts[i][j][k][l][m][n]; -} - -static int enc_worker_hook(EncWorkerData *const thread_data, void *unused) { - VP9_COMP *const cpi = thread_data->cpi; - const VP9_COMMON *const cm = &cpi->common; - const int tile_cols = 1 << cm->log2_tile_cols; - const int tile_rows = 1 << cm->log2_tile_rows; - int t; - - (void) unused; - - for (t = thread_data->start; t < tile_rows * tile_cols; - t += cpi->num_workers) { - int tile_row = t / tile_cols; - int tile_col = t % tile_cols; - - vp9_encode_tile(cpi, thread_data->td, tile_row, tile_col); - } - - return 0; -} - -void vp9_encode_tiles_mt(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - const int tile_cols = 1 << cm->log2_tile_cols; - const VP9WorkerInterface *const winterface = vp9_get_worker_interface(); - const int num_workers = MIN(cpi->oxcf.max_threads, tile_cols); - int i; - - vp9_init_tile_data(cpi); - - // Only run once to create threads and allocate thread data. - if (cpi->num_workers == 0) { - CHECK_MEM_ERROR(cm, cpi->workers, - vpx_malloc(num_workers * sizeof(*cpi->workers))); - - CHECK_MEM_ERROR(cm, cpi->tile_thr_data, - vpx_calloc(num_workers, sizeof(*cpi->tile_thr_data))); - - for (i = 0; i < num_workers; i++) { - VP9Worker *const worker = &cpi->workers[i]; - EncWorkerData *thread_data = &cpi->tile_thr_data[i]; - - ++cpi->num_workers; - winterface->init(worker); - - if (i < num_workers - 1) { - thread_data->cpi = cpi; - - // Allocate thread data. - CHECK_MEM_ERROR(cm, thread_data->td, - vpx_memalign(32, sizeof(*thread_data->td))); - vp9_zero(*thread_data->td); - - // Set up pc_tree. - thread_data->td->leaf_tree = NULL; - thread_data->td->pc_tree = NULL; - vp9_setup_pc_tree(cm, thread_data->td); - - // Allocate frame counters in thread data. - CHECK_MEM_ERROR(cm, thread_data->td->counts, - vpx_calloc(1, sizeof(*thread_data->td->counts))); - - // Create threads - if (!winterface->reset(worker)) - vpx_internal_error(&cm->error, VPX_CODEC_ERROR, - "Tile encoder thread creation failed"); - } else { - // Main thread acts as a worker and uses the thread data in cpi. - thread_data->cpi = cpi; - thread_data->td = &cpi->td; - } - - winterface->sync(worker); - } - } - - for (i = 0; i < num_workers; i++) { - VP9Worker *const worker = &cpi->workers[i]; - EncWorkerData *thread_data; - - worker->hook = (VP9WorkerHook)enc_worker_hook; - worker->data1 = &cpi->tile_thr_data[i]; - worker->data2 = NULL; - thread_data = (EncWorkerData*)worker->data1; - - // Before encoding a frame, copy the thread data from cpi. - if (thread_data->td != &cpi->td) { - thread_data->td->mb = cpi->td.mb; - thread_data->td->rd_counts = cpi->td.rd_counts; - } - if (thread_data->td->counts != &cpi->common.counts) { - vpx_memcpy(thread_data->td->counts, &cpi->common.counts, - sizeof(cpi->common.counts)); - } - - // Handle use_nonrd_pick_mode case. - if (cpi->sf.use_nonrd_pick_mode) { - MACROBLOCK *const x = &thread_data->td->mb; - MACROBLOCKD *const xd = &x->e_mbd; - struct macroblock_plane *const p = x->plane; - struct macroblockd_plane *const pd = xd->plane; - PICK_MODE_CONTEXT *ctx = &thread_data->td->pc_root->none; - int j; - - for (j = 0; j < MAX_MB_PLANE; ++j) { - p[j].coeff = ctx->coeff_pbuf[j][0]; - p[j].qcoeff = ctx->qcoeff_pbuf[j][0]; - pd[j].dqcoeff = ctx->dqcoeff_pbuf[j][0]; - p[j].eobs = ctx->eobs_pbuf[j][0]; - } - } - } - - // Encode a frame - for (i = 0; i < num_workers; i++) { - VP9Worker *const worker = &cpi->workers[i]; - EncWorkerData *const thread_data = (EncWorkerData*)worker->data1; - - // Set the starting tile for each thread. - thread_data->start = i; - - if (i == num_workers - 1) - winterface->execute(worker); - else - winterface->launch(worker); - } - - // Encoding ends. - for (i = 0; i < num_workers; i++) { - VP9Worker *const worker = &cpi->workers[i]; - winterface->sync(worker); - } - - for (i = 0; i < num_workers; i++) { - VP9Worker *const worker = &cpi->workers[i]; - EncWorkerData *const thread_data = (EncWorkerData*)worker->data1; - - // Accumulate counters. - if (i < num_workers - 1) { - vp9_accumulate_frame_counts(cm, thread_data->td->counts, 0); - accumulate_rd_opt(&cpi->td, thread_data->td); - } - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_ethread.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_ethread.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_ethread.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_ethread.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_ETHREAD_H_ -#define VP9_ENCODER_VP9_ETHREAD_H_ - -struct VP9_COMP; -struct ThreadData; - -typedef struct EncWorkerData { - struct VP9_COMP *cpi; - struct ThreadData *td; - int start; -} EncWorkerData; - -void vp9_encode_tiles_mt(struct VP9_COMP *cpi); - -#endif // VP9_ENCODER_VP9_ETHREAD_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_extend.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_extend.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_extend.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_extend.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,197 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vpx_mem/vpx_mem.h" - -#include "vp9/common/vp9_common.h" -#include "vp9/encoder/vp9_extend.h" - -static void copy_and_extend_plane(const uint8_t *src, int src_pitch, - uint8_t *dst, int dst_pitch, - int w, int h, - int extend_top, int extend_left, - int extend_bottom, int extend_right) { - int i, linesize; - - // copy the left and right most columns out - const uint8_t *src_ptr1 = src; - const uint8_t *src_ptr2 = src + w - 1; - uint8_t *dst_ptr1 = dst - extend_left; - uint8_t *dst_ptr2 = dst + w; - - for (i = 0; i < h; i++) { - vpx_memset(dst_ptr1, src_ptr1[0], extend_left); - vpx_memcpy(dst_ptr1 + extend_left, src_ptr1, w); - vpx_memset(dst_ptr2, src_ptr2[0], extend_right); - src_ptr1 += src_pitch; - src_ptr2 += src_pitch; - dst_ptr1 += dst_pitch; - dst_ptr2 += dst_pitch; - } - - // Now copy the top and bottom lines into each line of the respective - // borders - src_ptr1 = dst - extend_left; - src_ptr2 = dst + dst_pitch * (h - 1) - extend_left; - dst_ptr1 = dst + dst_pitch * (-extend_top) - extend_left; - dst_ptr2 = dst + dst_pitch * (h) - extend_left; - linesize = extend_left + extend_right + w; - - for (i = 0; i < extend_top; i++) { - vpx_memcpy(dst_ptr1, src_ptr1, linesize); - dst_ptr1 += dst_pitch; - } - - for (i = 0; i < extend_bottom; i++) { - vpx_memcpy(dst_ptr2, src_ptr2, linesize); - dst_ptr2 += dst_pitch; - } -} - -#if CONFIG_VP9_HIGHBITDEPTH -static void highbd_copy_and_extend_plane(const uint8_t *src8, int src_pitch, - uint8_t *dst8, int dst_pitch, - int w, int h, - int extend_top, int extend_left, - int extend_bottom, int extend_right) { - int i, linesize; - uint16_t *src = CONVERT_TO_SHORTPTR(src8); - uint16_t *dst = CONVERT_TO_SHORTPTR(dst8); - - // copy the left and right most columns out - const uint16_t *src_ptr1 = src; - const uint16_t *src_ptr2 = src + w - 1; - uint16_t *dst_ptr1 = dst - extend_left; - uint16_t *dst_ptr2 = dst + w; - - for (i = 0; i < h; i++) { - vpx_memset16(dst_ptr1, src_ptr1[0], extend_left); - vpx_memcpy(dst_ptr1 + extend_left, src_ptr1, w * sizeof(uint16_t)); - vpx_memset16(dst_ptr2, src_ptr2[0], extend_right); - src_ptr1 += src_pitch; - src_ptr2 += src_pitch; - dst_ptr1 += dst_pitch; - dst_ptr2 += dst_pitch; - } - - // Now copy the top and bottom lines into each line of the respective - // borders - src_ptr1 = dst - extend_left; - src_ptr2 = dst + dst_pitch * (h - 1) - extend_left; - dst_ptr1 = dst + dst_pitch * (-extend_top) - extend_left; - dst_ptr2 = dst + dst_pitch * (h) - extend_left; - linesize = extend_left + extend_right + w; - - for (i = 0; i < extend_top; i++) { - vpx_memcpy(dst_ptr1, src_ptr1, linesize * sizeof(uint16_t)); - dst_ptr1 += dst_pitch; - } - - for (i = 0; i < extend_bottom; i++) { - vpx_memcpy(dst_ptr2, src_ptr2, linesize * sizeof(uint16_t)); - dst_ptr2 += dst_pitch; - } -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -void vp9_copy_and_extend_frame(const YV12_BUFFER_CONFIG *src, - YV12_BUFFER_CONFIG *dst) { - // Extend src frame in buffer - // Altref filtering assumes 16 pixel extension - const int et_y = 16; - const int el_y = 16; - // Motion estimation may use src block variance with the block size up - // to 64x64, so the right and bottom need to be extended to 64 multiple - // or up to 16, whichever is greater. - const int er_y = MAX(src->y_width + 16, ALIGN_POWER_OF_TWO(src->y_width, 6)) - - src->y_crop_width; - const int eb_y = MAX(src->y_height + 16, ALIGN_POWER_OF_TWO(src->y_height, 6)) - - src->y_crop_height; - const int uv_width_subsampling = (src->uv_width != src->y_width); - const int uv_height_subsampling = (src->uv_height != src->y_height); - const int et_uv = et_y >> uv_height_subsampling; - const int el_uv = el_y >> uv_width_subsampling; - const int eb_uv = eb_y >> uv_height_subsampling; - const int er_uv = er_y >> uv_width_subsampling; - -#if CONFIG_VP9_HIGHBITDEPTH - if (src->flags & YV12_FLAG_HIGHBITDEPTH) { - highbd_copy_and_extend_plane(src->y_buffer, src->y_stride, - dst->y_buffer, dst->y_stride, - src->y_crop_width, src->y_crop_height, - et_y, el_y, eb_y, er_y); - - highbd_copy_and_extend_plane(src->u_buffer, src->uv_stride, - dst->u_buffer, dst->uv_stride, - src->uv_crop_width, src->uv_crop_height, - et_uv, el_uv, eb_uv, er_uv); - - highbd_copy_and_extend_plane(src->v_buffer, src->uv_stride, - dst->v_buffer, dst->uv_stride, - src->uv_crop_width, src->uv_crop_height, - et_uv, el_uv, eb_uv, er_uv); - return; - } -#endif // CONFIG_VP9_HIGHBITDEPTH - - copy_and_extend_plane(src->y_buffer, src->y_stride, - dst->y_buffer, dst->y_stride, - src->y_crop_width, src->y_crop_height, - et_y, el_y, eb_y, er_y); - - copy_and_extend_plane(src->u_buffer, src->uv_stride, - dst->u_buffer, dst->uv_stride, - src->uv_crop_width, src->uv_crop_height, - et_uv, el_uv, eb_uv, er_uv); - - copy_and_extend_plane(src->v_buffer, src->uv_stride, - dst->v_buffer, dst->uv_stride, - src->uv_crop_width, src->uv_crop_height, - et_uv, el_uv, eb_uv, er_uv); -} - -void vp9_copy_and_extend_frame_with_rect(const YV12_BUFFER_CONFIG *src, - YV12_BUFFER_CONFIG *dst, - int srcy, int srcx, - int srch, int srcw) { - // If the side is not touching the bounder then don't extend. - const int et_y = srcy ? 0 : dst->border; - const int el_y = srcx ? 0 : dst->border; - const int eb_y = srcy + srch != src->y_height ? 0 : - dst->border + dst->y_height - src->y_height; - const int er_y = srcx + srcw != src->y_width ? 0 : - dst->border + dst->y_width - src->y_width; - const int src_y_offset = srcy * src->y_stride + srcx; - const int dst_y_offset = srcy * dst->y_stride + srcx; - - const int et_uv = ROUND_POWER_OF_TWO(et_y, 1); - const int el_uv = ROUND_POWER_OF_TWO(el_y, 1); - const int eb_uv = ROUND_POWER_OF_TWO(eb_y, 1); - const int er_uv = ROUND_POWER_OF_TWO(er_y, 1); - const int src_uv_offset = ((srcy * src->uv_stride) >> 1) + (srcx >> 1); - const int dst_uv_offset = ((srcy * dst->uv_stride) >> 1) + (srcx >> 1); - const int srch_uv = ROUND_POWER_OF_TWO(srch, 1); - const int srcw_uv = ROUND_POWER_OF_TWO(srcw, 1); - - copy_and_extend_plane(src->y_buffer + src_y_offset, src->y_stride, - dst->y_buffer + dst_y_offset, dst->y_stride, - srcw, srch, - et_y, el_y, eb_y, er_y); - - copy_and_extend_plane(src->u_buffer + src_uv_offset, src->uv_stride, - dst->u_buffer + dst_uv_offset, dst->uv_stride, - srcw_uv, srch_uv, - et_uv, el_uv, eb_uv, er_uv); - - copy_and_extend_plane(src->v_buffer + src_uv_offset, src->uv_stride, - dst->v_buffer + dst_uv_offset, dst->uv_stride, - srcw_uv, srch_uv, - et_uv, el_uv, eb_uv, er_uv); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_extend.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_extend.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_extend.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_extend.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_EXTEND_H_ -#define VP9_ENCODER_VP9_EXTEND_H_ - -#include "vpx_scale/yv12config.h" -#include "vpx/vpx_integer.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -void vp9_copy_and_extend_frame(const YV12_BUFFER_CONFIG *src, - YV12_BUFFER_CONFIG *dst); - -void vp9_copy_and_extend_frame_with_rect(const YV12_BUFFER_CONFIG *src, - YV12_BUFFER_CONFIG *dst, - int srcy, int srcx, - int srch, int srcw); -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_EXTEND_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_firstpass.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_firstpass.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_firstpass.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_firstpass.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2693 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include - -#include "./vpx_scale_rtcd.h" - -#include "vpx_mem/vpx_mem.h" -#include "vpx_scale/vpx_scale.h" -#include "vpx_scale/yv12config.h" - -#include "vp9/common/vp9_entropymv.h" -#include "vp9/common/vp9_quant_common.h" -#include "vp9/common/vp9_reconinter.h" // vp9_setup_dst_planes() -#include "vp9/common/vp9_systemdependent.h" -#include "vp9/encoder/vp9_aq_variance.h" -#include "vp9/encoder/vp9_block.h" -#include "vp9/encoder/vp9_encodeframe.h" -#include "vp9/encoder/vp9_encodemb.h" -#include "vp9/encoder/vp9_encodemv.h" -#include "vp9/encoder/vp9_encoder.h" -#include "vp9/encoder/vp9_extend.h" -#include "vp9/encoder/vp9_firstpass.h" -#include "vp9/encoder/vp9_mcomp.h" -#include "vp9/encoder/vp9_quantize.h" -#include "vp9/encoder/vp9_rd.h" -#include "vp9/encoder/vp9_variance.h" - -#define OUTPUT_FPF 0 -#define ARF_STATS_OUTPUT 0 - -#define GROUP_ADAPTIVE_MAXQ 0 - -#define BOOST_BREAKOUT 12.5 -#define BOOST_FACTOR 12.5 -#define ERR_DIVISOR 128.0 -#define FACTOR_PT_LOW 0.70 -#define FACTOR_PT_HIGH 0.90 -#define FIRST_PASS_Q 10.0 -#define GF_MAX_BOOST 96.0 -#define INTRA_MODE_PENALTY 1024 -#define KF_MAX_BOOST 128.0 -#define MIN_ARF_GF_BOOST 240 -#define MIN_DECAY_FACTOR 0.01 -#define MIN_GF_INTERVAL 4 -#define MIN_KF_BOOST 300 -#define NEW_MV_MODE_PENALTY 32 -#define SVC_FACTOR_PT_LOW 0.45 -#define DARK_THRESH 64 -#define DEFAULT_GRP_WEIGHT 1.0 -#define RC_FACTOR_MIN 0.75 -#define RC_FACTOR_MAX 1.75 - - -#define INTRA_WEIGHT_EXPERIMENT 0 -#if INTRA_WEIGHT_EXPERIMENT -#define NCOUNT_INTRA_THRESH 8192 -#define NCOUNT_INTRA_FACTOR 3 -#define NCOUNT_FRAME_II_THRESH 5.0 -#endif - -#define DOUBLE_DIVIDE_CHECK(x) ((x) < 0 ? (x) - 0.000001 : (x) + 0.000001) - -#if ARF_STATS_OUTPUT -unsigned int arf_count = 0; -#endif - -// Resets the first pass file to the given position using a relative seek from -// the current position. -static void reset_fpf_position(TWO_PASS *p, - const FIRSTPASS_STATS *position) { - p->stats_in = position; -} - -// Read frame stats at an offset from the current position. -static const FIRSTPASS_STATS *read_frame_stats(const TWO_PASS *p, int offset) { - if ((offset >= 0 && p->stats_in + offset >= p->stats_in_end) || - (offset < 0 && p->stats_in + offset < p->stats_in_start)) { - return NULL; - } - - return &p->stats_in[offset]; -} - -static int input_stats(TWO_PASS *p, FIRSTPASS_STATS *fps) { - if (p->stats_in >= p->stats_in_end) - return EOF; - - *fps = *p->stats_in; - ++p->stats_in; - return 1; -} - -static void output_stats(FIRSTPASS_STATS *stats, - struct vpx_codec_pkt_list *pktlist) { - struct vpx_codec_cx_pkt pkt; - pkt.kind = VPX_CODEC_STATS_PKT; - pkt.data.twopass_stats.buf = stats; - pkt.data.twopass_stats.sz = sizeof(FIRSTPASS_STATS); - vpx_codec_pkt_list_add(pktlist, &pkt); - -// TEMP debug code -#if OUTPUT_FPF - { - FILE *fpfile; - fpfile = fopen("firstpass.stt", "a"); - - fprintf(fpfile, "%12.0lf %12.4lf %12.0lf %12.0lf %12.0lf %12.4lf %12.4lf" - "%12.4lf %12.4lf %12.4lf %12.4lf %12.4lf %12.4lf %12.4lf" - "%12.4lf %12.0lf %12.0lf %12.0lf %12.4lf\n", - stats->frame, - stats->weight, - stats->intra_error, - stats->coded_error, - stats->sr_coded_error, - stats->pcnt_inter, - stats->pcnt_motion, - stats->pcnt_second_ref, - stats->pcnt_neutral, - stats->MVr, - stats->mvr_abs, - stats->MVc, - stats->mvc_abs, - stats->MVrv, - stats->MVcv, - stats->mv_in_out_count, - stats->new_mv_count, - stats->count, - stats->duration); - fclose(fpfile); - } -#endif -} - -#if CONFIG_FP_MB_STATS -static void output_fpmb_stats(uint8_t *this_frame_mb_stats, VP9_COMMON *cm, - struct vpx_codec_pkt_list *pktlist) { - struct vpx_codec_cx_pkt pkt; - pkt.kind = VPX_CODEC_FPMB_STATS_PKT; - pkt.data.firstpass_mb_stats.buf = this_frame_mb_stats; - pkt.data.firstpass_mb_stats.sz = cm->initial_mbs * sizeof(uint8_t); - vpx_codec_pkt_list_add(pktlist, &pkt); -} -#endif - -static void zero_stats(FIRSTPASS_STATS *section) { - section->frame = 0.0; - section->weight = 0.0; - section->intra_error = 0.0; - section->coded_error = 0.0; - section->sr_coded_error = 0.0; - section->pcnt_inter = 0.0; - section->pcnt_motion = 0.0; - section->pcnt_second_ref = 0.0; - section->pcnt_neutral = 0.0; - section->MVr = 0.0; - section->mvr_abs = 0.0; - section->MVc = 0.0; - section->mvc_abs = 0.0; - section->MVrv = 0.0; - section->MVcv = 0.0; - section->mv_in_out_count = 0.0; - section->new_mv_count = 0.0; - section->count = 0.0; - section->duration = 1.0; - section->spatial_layer_id = 0; -} - -static void accumulate_stats(FIRSTPASS_STATS *section, - const FIRSTPASS_STATS *frame) { - section->frame += frame->frame; - section->weight += frame->weight; - section->spatial_layer_id = frame->spatial_layer_id; - section->intra_error += frame->intra_error; - section->coded_error += frame->coded_error; - section->sr_coded_error += frame->sr_coded_error; - section->pcnt_inter += frame->pcnt_inter; - section->pcnt_motion += frame->pcnt_motion; - section->pcnt_second_ref += frame->pcnt_second_ref; - section->pcnt_neutral += frame->pcnt_neutral; - section->MVr += frame->MVr; - section->mvr_abs += frame->mvr_abs; - section->MVc += frame->MVc; - section->mvc_abs += frame->mvc_abs; - section->MVrv += frame->MVrv; - section->MVcv += frame->MVcv; - section->mv_in_out_count += frame->mv_in_out_count; - section->new_mv_count += frame->new_mv_count; - section->count += frame->count; - section->duration += frame->duration; -} - -static void subtract_stats(FIRSTPASS_STATS *section, - const FIRSTPASS_STATS *frame) { - section->frame -= frame->frame; - section->weight -= frame->weight; - section->intra_error -= frame->intra_error; - section->coded_error -= frame->coded_error; - section->sr_coded_error -= frame->sr_coded_error; - section->pcnt_inter -= frame->pcnt_inter; - section->pcnt_motion -= frame->pcnt_motion; - section->pcnt_second_ref -= frame->pcnt_second_ref; - section->pcnt_neutral -= frame->pcnt_neutral; - section->MVr -= frame->MVr; - section->mvr_abs -= frame->mvr_abs; - section->MVc -= frame->MVc; - section->mvc_abs -= frame->mvc_abs; - section->MVrv -= frame->MVrv; - section->MVcv -= frame->MVcv; - section->mv_in_out_count -= frame->mv_in_out_count; - section->new_mv_count -= frame->new_mv_count; - section->count -= frame->count; - section->duration -= frame->duration; -} - - -// Calculate a modified Error used in distributing bits between easier and -// harder frames. -static double calculate_modified_err(const TWO_PASS *twopass, - const VP9EncoderConfig *oxcf, - const FIRSTPASS_STATS *this_frame) { - const FIRSTPASS_STATS *const stats = &twopass->total_stats; - const double av_weight = stats->weight / stats->count; - const double av_err = (stats->coded_error * av_weight) / stats->count; - const double modified_error = - av_err * pow(this_frame->coded_error * this_frame->weight / - DOUBLE_DIVIDE_CHECK(av_err), oxcf->two_pass_vbrbias / 100.0); - return fclamp(modified_error, - twopass->modified_error_min, twopass->modified_error_max); -} - -// This function returns the maximum target rate per frame. -static int frame_max_bits(const RATE_CONTROL *rc, - const VP9EncoderConfig *oxcf) { - int64_t max_bits = ((int64_t)rc->avg_frame_bandwidth * - (int64_t)oxcf->two_pass_vbrmax_section) / 100; - if (max_bits < 0) - max_bits = 0; - else if (max_bits > rc->max_frame_bandwidth) - max_bits = rc->max_frame_bandwidth; - - return (int)max_bits; -} - -void vp9_init_first_pass(VP9_COMP *cpi) { - zero_stats(&cpi->twopass.total_stats); -} - -void vp9_end_first_pass(VP9_COMP *cpi) { - if (is_two_pass_svc(cpi)) { - int i; - for (i = 0; i < cpi->svc.number_spatial_layers; ++i) { - output_stats(&cpi->svc.layer_context[i].twopass.total_stats, - cpi->output_pkt_list); - } - } else { - output_stats(&cpi->twopass.total_stats, cpi->output_pkt_list); - } -} - -static vp9_variance_fn_t get_block_variance_fn(BLOCK_SIZE bsize) { - switch (bsize) { - case BLOCK_8X8: - return vp9_mse8x8; - case BLOCK_16X8: - return vp9_mse16x8; - case BLOCK_8X16: - return vp9_mse8x16; - default: - return vp9_mse16x16; - } -} - -static unsigned int get_prediction_error(BLOCK_SIZE bsize, - const struct buf_2d *src, - const struct buf_2d *ref) { - unsigned int sse; - const vp9_variance_fn_t fn = get_block_variance_fn(bsize); - fn(src->buf, src->stride, ref->buf, ref->stride, &sse); - return sse; -} - -#if CONFIG_VP9_HIGHBITDEPTH -static vp9_variance_fn_t highbd_get_block_variance_fn(BLOCK_SIZE bsize, - int bd) { - switch (bd) { - default: - switch (bsize) { - case BLOCK_8X8: - return vp9_highbd_mse8x8; - case BLOCK_16X8: - return vp9_highbd_mse16x8; - case BLOCK_8X16: - return vp9_highbd_mse8x16; - default: - return vp9_highbd_mse16x16; - } - break; - case 10: - switch (bsize) { - case BLOCK_8X8: - return vp9_highbd_10_mse8x8; - case BLOCK_16X8: - return vp9_highbd_10_mse16x8; - case BLOCK_8X16: - return vp9_highbd_10_mse8x16; - default: - return vp9_highbd_10_mse16x16; - } - break; - case 12: - switch (bsize) { - case BLOCK_8X8: - return vp9_highbd_12_mse8x8; - case BLOCK_16X8: - return vp9_highbd_12_mse16x8; - case BLOCK_8X16: - return vp9_highbd_12_mse8x16; - default: - return vp9_highbd_12_mse16x16; - } - break; - } -} - -static unsigned int highbd_get_prediction_error(BLOCK_SIZE bsize, - const struct buf_2d *src, - const struct buf_2d *ref, - int bd) { - unsigned int sse; - const vp9_variance_fn_t fn = highbd_get_block_variance_fn(bsize, bd); - fn(src->buf, src->stride, ref->buf, ref->stride, &sse); - return sse; -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -// Refine the motion search range according to the frame dimension -// for first pass test. -static int get_search_range(const VP9_COMP *cpi) { - int sr = 0; - const int dim = MIN(cpi->initial_width, cpi->initial_height); - - while ((dim << sr) < MAX_FULL_PEL_VAL) - ++sr; - return sr; -} - -static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x, - const MV *ref_mv, MV *best_mv, - int *best_motion_err) { - MACROBLOCKD *const xd = &x->e_mbd; - MV tmp_mv = {0, 0}; - MV ref_mv_full = {ref_mv->row >> 3, ref_mv->col >> 3}; - int num00, tmp_err, n; - const BLOCK_SIZE bsize = xd->mi[0].src_mi->mbmi.sb_type; - vp9_variance_fn_ptr_t v_fn_ptr = cpi->fn_ptr[bsize]; - const int new_mv_mode_penalty = NEW_MV_MODE_PENALTY; - - int step_param = 3; - int further_steps = (MAX_MVSEARCH_STEPS - 1) - step_param; - const int sr = get_search_range(cpi); - step_param += sr; - further_steps -= sr; - - // Override the default variance function to use MSE. - v_fn_ptr.vf = get_block_variance_fn(bsize); -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - v_fn_ptr.vf = highbd_get_block_variance_fn(bsize, xd->bd); - } -#endif // CONFIG_VP9_HIGHBITDEPTH - - // Center the initial step/diamond search on best mv. - tmp_err = cpi->diamond_search_sad(x, &cpi->ss_cfg, &ref_mv_full, &tmp_mv, - step_param, - x->sadperbit16, &num00, &v_fn_ptr, ref_mv); - if (tmp_err < INT_MAX) - tmp_err = vp9_get_mvpred_var(x, &tmp_mv, ref_mv, &v_fn_ptr, 1); - if (tmp_err < INT_MAX - new_mv_mode_penalty) - tmp_err += new_mv_mode_penalty; - - if (tmp_err < *best_motion_err) { - *best_motion_err = tmp_err; - *best_mv = tmp_mv; - } - - // Carry out further step/diamond searches as necessary. - n = num00; - num00 = 0; - - while (n < further_steps) { - ++n; - - if (num00) { - --num00; - } else { - tmp_err = cpi->diamond_search_sad(x, &cpi->ss_cfg, &ref_mv_full, &tmp_mv, - step_param + n, x->sadperbit16, - &num00, &v_fn_ptr, ref_mv); - if (tmp_err < INT_MAX) - tmp_err = vp9_get_mvpred_var(x, &tmp_mv, ref_mv, &v_fn_ptr, 1); - if (tmp_err < INT_MAX - new_mv_mode_penalty) - tmp_err += new_mv_mode_penalty; - - if (tmp_err < *best_motion_err) { - *best_motion_err = tmp_err; - *best_mv = tmp_mv; - } - } - } -} - -static BLOCK_SIZE get_bsize(const VP9_COMMON *cm, int mb_row, int mb_col) { - if (2 * mb_col + 1 < cm->mi_cols) { - return 2 * mb_row + 1 < cm->mi_rows ? BLOCK_16X16 - : BLOCK_16X8; - } else { - return 2 * mb_row + 1 < cm->mi_rows ? BLOCK_8X16 - : BLOCK_8X8; - } -} - -static int find_fp_qindex(vpx_bit_depth_t bit_depth) { - int i; - - for (i = 0; i < QINDEX_RANGE; ++i) - if (vp9_convert_qindex_to_q(i, bit_depth) >= FIRST_PASS_Q) - break; - - if (i == QINDEX_RANGE) - i--; - - return i; -} - -static void set_first_pass_params(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - if (!cpi->refresh_alt_ref_frame && - (cm->current_video_frame == 0 || - (cpi->frame_flags & FRAMEFLAGS_KEY))) { - cm->frame_type = KEY_FRAME; - } else { - cm->frame_type = INTER_FRAME; - } - // Do not use periodic key frames. - cpi->rc.frames_to_key = INT_MAX; -} - -void vp9_first_pass(VP9_COMP *cpi, const struct lookahead_entry *source) { - int mb_row, mb_col; - MACROBLOCK *const x = &cpi->td.mb; - VP9_COMMON *const cm = &cpi->common; - MACROBLOCKD *const xd = &x->e_mbd; - TileInfo tile; - struct macroblock_plane *const p = x->plane; - struct macroblockd_plane *const pd = xd->plane; - const PICK_MODE_CONTEXT *ctx = &cpi->td.pc_root->none; - int i; - - int recon_yoffset, recon_uvoffset; - int64_t intra_error = 0; - int64_t coded_error = 0; - int64_t sr_coded_error = 0; - - int sum_mvr = 0, sum_mvc = 0; - int sum_mvr_abs = 0, sum_mvc_abs = 0; - int64_t sum_mvrs = 0, sum_mvcs = 0; - int mvcount = 0; - int intercount = 0; - int second_ref_count = 0; - const int intrapenalty = INTRA_MODE_PENALTY; - double neutral_count; - int new_mv_count = 0; - int sum_in_vectors = 0; - MV lastmv = {0, 0}; - TWO_PASS *twopass = &cpi->twopass; - const MV zero_mv = {0, 0}; - int recon_y_stride, recon_uv_stride, uv_mb_height; - - YV12_BUFFER_CONFIG *const lst_yv12 = get_ref_frame_buffer(cpi, LAST_FRAME); - YV12_BUFFER_CONFIG *gld_yv12 = get_ref_frame_buffer(cpi, GOLDEN_FRAME); - YV12_BUFFER_CONFIG *const new_yv12 = get_frame_new_buffer(cm); - const YV12_BUFFER_CONFIG *first_ref_buf = lst_yv12; - - LAYER_CONTEXT *const lc = is_two_pass_svc(cpi) ? - &cpi->svc.layer_context[cpi->svc.spatial_layer_id] : NULL; - double intra_factor; - double brightness_factor; - BufferPool *const pool = cm->buffer_pool; - - // First pass code requires valid last and new frame buffers. - assert(new_yv12 != NULL); - assert((lc != NULL) || frame_is_intra_only(cm) || (lst_yv12 != NULL)); - -#if CONFIG_FP_MB_STATS - if (cpi->use_fp_mb_stats) { - vp9_zero_array(cpi->twopass.frame_mb_stats_buf, cm->initial_mbs); - } -#endif - - vp9_clear_system_state(); - - intra_factor = 0.0; - brightness_factor = 0.0; - neutral_count = 0.0; - - set_first_pass_params(cpi); - vp9_set_quantizer(cm, find_fp_qindex(cm->bit_depth)); - - if (lc != NULL) { - twopass = &lc->twopass; - - cpi->lst_fb_idx = cpi->svc.spatial_layer_id; - cpi->ref_frame_flags = VP9_LAST_FLAG; - - if (cpi->svc.number_spatial_layers + cpi->svc.spatial_layer_id < - REF_FRAMES) { - cpi->gld_fb_idx = - cpi->svc.number_spatial_layers + cpi->svc.spatial_layer_id; - cpi->ref_frame_flags |= VP9_GOLD_FLAG; - cpi->refresh_golden_frame = (lc->current_video_frame_in_layer == 0); - } else { - cpi->refresh_golden_frame = 0; - } - - if (lc->current_video_frame_in_layer == 0) - cpi->ref_frame_flags = 0; - - vp9_scale_references(cpi); - - // Use either last frame or alt frame for motion search. - if (cpi->ref_frame_flags & VP9_LAST_FLAG) { - first_ref_buf = vp9_get_scaled_ref_frame(cpi, LAST_FRAME); - if (first_ref_buf == NULL) - first_ref_buf = get_ref_frame_buffer(cpi, LAST_FRAME); - } - - if (cpi->ref_frame_flags & VP9_GOLD_FLAG) { - gld_yv12 = vp9_get_scaled_ref_frame(cpi, GOLDEN_FRAME); - if (gld_yv12 == NULL) { - gld_yv12 = get_ref_frame_buffer(cpi, GOLDEN_FRAME); - } - } else { - gld_yv12 = NULL; - } - - set_ref_ptrs(cm, xd, - (cpi->ref_frame_flags & VP9_LAST_FLAG) ? LAST_FRAME: NONE, - (cpi->ref_frame_flags & VP9_GOLD_FLAG) ? GOLDEN_FRAME : NONE); - - cpi->Source = vp9_scale_if_required(cm, cpi->un_scaled_source, - &cpi->scaled_source); - } - - vp9_setup_block_planes(&x->e_mbd, cm->subsampling_x, cm->subsampling_y); - - vp9_setup_src_planes(x, cpi->Source, 0, 0); - vp9_setup_dst_planes(xd->plane, new_yv12, 0, 0); - - if (!frame_is_intra_only(cm)) { - vp9_setup_pre_planes(xd, 0, first_ref_buf, 0, 0, NULL); - } - - xd->mi = cm->mi; - xd->mi[0].src_mi = &xd->mi[0]; - - vp9_frame_init_quantizer(cpi); - - for (i = 0; i < MAX_MB_PLANE; ++i) { - p[i].coeff = ctx->coeff_pbuf[i][1]; - p[i].qcoeff = ctx->qcoeff_pbuf[i][1]; - pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][1]; - p[i].eobs = ctx->eobs_pbuf[i][1]; - } - x->skip_recode = 0; - - vp9_init_mv_probs(cm); - vp9_initialize_rd_consts(cpi); - - // Tiling is ignored in the first pass. - vp9_tile_init(&tile, cm, 0, 0); - - recon_y_stride = new_yv12->y_stride; - recon_uv_stride = new_yv12->uv_stride; - uv_mb_height = 16 >> (new_yv12->y_height > new_yv12->uv_height); - - for (mb_row = 0; mb_row < cm->mb_rows; ++mb_row) { - MV best_ref_mv = {0, 0}; - - // Reset above block coeffs. - xd->up_available = (mb_row != 0); - recon_yoffset = (mb_row * recon_y_stride * 16); - recon_uvoffset = (mb_row * recon_uv_stride * uv_mb_height); - - // Set up limit values for motion vectors to prevent them extending - // outside the UMV borders. - x->mv_row_min = -((mb_row * 16) + BORDER_MV_PIXELS_B16); - x->mv_row_max = ((cm->mb_rows - 1 - mb_row) * 16) - + BORDER_MV_PIXELS_B16; - - for (mb_col = 0; mb_col < cm->mb_cols; ++mb_col) { - int this_error; - const int use_dc_pred = (mb_col || mb_row) && (!mb_col || !mb_row); - const BLOCK_SIZE bsize = get_bsize(cm, mb_row, mb_col); - double log_intra; - int level_sample; - -#if CONFIG_FP_MB_STATS - const int mb_index = mb_row * cm->mb_cols + mb_col; -#endif - - vp9_clear_system_state(); - - xd->plane[0].dst.buf = new_yv12->y_buffer + recon_yoffset; - xd->plane[1].dst.buf = new_yv12->u_buffer + recon_uvoffset; - xd->plane[2].dst.buf = new_yv12->v_buffer + recon_uvoffset; - xd->left_available = (mb_col != 0); - xd->mi[0].src_mi->mbmi.sb_type = bsize; - xd->mi[0].src_mi->mbmi.ref_frame[0] = INTRA_FRAME; - set_mi_row_col(xd, &tile, - mb_row << 1, num_8x8_blocks_high_lookup[bsize], - mb_col << 1, num_8x8_blocks_wide_lookup[bsize], - cm->mi_rows, cm->mi_cols); - - // Do intra 16x16 prediction. - x->skip_encode = 0; - xd->mi[0].src_mi->mbmi.mode = DC_PRED; - xd->mi[0].src_mi->mbmi.tx_size = use_dc_pred ? - (bsize >= BLOCK_16X16 ? TX_16X16 : TX_8X8) : TX_4X4; - vp9_encode_intra_block_plane(x, bsize, 0); - this_error = vp9_get_mb_ss(x->plane[0].src_diff); -#if CONFIG_VP9_HIGHBITDEPTH - if (cm->use_highbitdepth) { - switch (cm->bit_depth) { - case VPX_BITS_8: - break; - case VPX_BITS_10: - this_error >>= 4; - break; - case VPX_BITS_12: - this_error >>= 8; - break; - default: - assert(0 && "cm->bit_depth should be VPX_BITS_8, " - "VPX_BITS_10 or VPX_BITS_12"); - return; - } - } -#endif // CONFIG_VP9_HIGHBITDEPTH - - vp9_clear_system_state(); - log_intra = log(this_error + 1.0); - if (log_intra < 10.0) - intra_factor += 1.0 + ((10.0 - log_intra) * 0.05); - else - intra_factor += 1.0; - -#if CONFIG_VP9_HIGHBITDEPTH - if (cm->use_highbitdepth) - level_sample = CONVERT_TO_SHORTPTR(x->plane[0].src.buf)[0]; - else - level_sample = x->plane[0].src.buf[0]; -#else - level_sample = x->plane[0].src.buf[0]; -#endif - if ((level_sample < DARK_THRESH) && (log_intra < 9.0)) - brightness_factor += 1.0 + (0.01 * (DARK_THRESH - level_sample)); - else - brightness_factor += 1.0; - - // Intrapenalty below deals with situations where the intra and inter - // error scores are very low (e.g. a plain black frame). - // We do not have special cases in first pass for 0,0 and nearest etc so - // all inter modes carry an overhead cost estimate for the mv. - // When the error score is very low this causes us to pick all or lots of - // INTRA modes and throw lots of key frames. - // This penalty adds a cost matching that of a 0,0 mv to the intra case. - this_error += intrapenalty; - - // Accumulate the intra error. - intra_error += (int64_t)this_error; - -#if CONFIG_FP_MB_STATS - if (cpi->use_fp_mb_stats) { - // initialization - cpi->twopass.frame_mb_stats_buf[mb_index] = 0; - } -#endif - - // Set up limit values for motion vectors to prevent them extending - // outside the UMV borders. - x->mv_col_min = -((mb_col * 16) + BORDER_MV_PIXELS_B16); - x->mv_col_max = ((cm->mb_cols - 1 - mb_col) * 16) + BORDER_MV_PIXELS_B16; - - // Other than for the first frame do a motion search. - if ((lc == NULL && cm->current_video_frame > 0) || - (lc != NULL && lc->current_video_frame_in_layer > 0)) { - int tmp_err, motion_error, raw_motion_error; - // Assume 0,0 motion with no mv overhead. - MV mv = {0, 0} , tmp_mv = {0, 0}; - struct buf_2d unscaled_last_source_buf_2d; - - xd->plane[0].pre[0].buf = first_ref_buf->y_buffer + recon_yoffset; -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - motion_error = highbd_get_prediction_error( - bsize, &x->plane[0].src, &xd->plane[0].pre[0], xd->bd); - } else { - motion_error = get_prediction_error( - bsize, &x->plane[0].src, &xd->plane[0].pre[0]); - } -#else - motion_error = get_prediction_error( - bsize, &x->plane[0].src, &xd->plane[0].pre[0]); -#endif // CONFIG_VP9_HIGHBITDEPTH - - // Compute the motion error of the 0,0 motion using the last source - // frame as the reference. Skip the further motion search on - // reconstructed frame if this error is small. - unscaled_last_source_buf_2d.buf = - cpi->unscaled_last_source->y_buffer + recon_yoffset; - unscaled_last_source_buf_2d.stride = - cpi->unscaled_last_source->y_stride; -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - raw_motion_error = highbd_get_prediction_error( - bsize, &x->plane[0].src, &unscaled_last_source_buf_2d, xd->bd); - } else { - raw_motion_error = get_prediction_error( - bsize, &x->plane[0].src, &unscaled_last_source_buf_2d); - } -#else - raw_motion_error = get_prediction_error( - bsize, &x->plane[0].src, &unscaled_last_source_buf_2d); -#endif // CONFIG_VP9_HIGHBITDEPTH - - // TODO(pengchong): Replace the hard-coded threshold - if (raw_motion_error > 25 || lc != NULL) { - // Test last reference frame using the previous best mv as the - // starting point (best reference) for the search. - first_pass_motion_search(cpi, x, &best_ref_mv, &mv, &motion_error); - - // If the current best reference mv is not centered on 0,0 then do a - // 0,0 based search as well. - if (!is_zero_mv(&best_ref_mv)) { - tmp_err = INT_MAX; - first_pass_motion_search(cpi, x, &zero_mv, &tmp_mv, &tmp_err); - - if (tmp_err < motion_error) { - motion_error = tmp_err; - mv = tmp_mv; - } - } - - // Search in an older reference frame. - if (((lc == NULL && cm->current_video_frame > 1) || - (lc != NULL && lc->current_video_frame_in_layer > 1)) - && gld_yv12 != NULL) { - // Assume 0,0 motion with no mv overhead. - int gf_motion_error; - - xd->plane[0].pre[0].buf = gld_yv12->y_buffer + recon_yoffset; -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - gf_motion_error = highbd_get_prediction_error( - bsize, &x->plane[0].src, &xd->plane[0].pre[0], xd->bd); - } else { - gf_motion_error = get_prediction_error( - bsize, &x->plane[0].src, &xd->plane[0].pre[0]); - } -#else - gf_motion_error = get_prediction_error( - bsize, &x->plane[0].src, &xd->plane[0].pre[0]); -#endif // CONFIG_VP9_HIGHBITDEPTH - - first_pass_motion_search(cpi, x, &zero_mv, &tmp_mv, - &gf_motion_error); - - if (gf_motion_error < motion_error && gf_motion_error < this_error) - ++second_ref_count; - - // Reset to last frame as reference buffer. - xd->plane[0].pre[0].buf = first_ref_buf->y_buffer + recon_yoffset; - xd->plane[1].pre[0].buf = first_ref_buf->u_buffer + recon_uvoffset; - xd->plane[2].pre[0].buf = first_ref_buf->v_buffer + recon_uvoffset; - - // In accumulating a score for the older reference frame take the - // best of the motion predicted score and the intra coded error - // (just as will be done for) accumulation of "coded_error" for - // the last frame. - if (gf_motion_error < this_error) - sr_coded_error += gf_motion_error; - else - sr_coded_error += this_error; - } else { - sr_coded_error += motion_error; - } - } else { - sr_coded_error += motion_error; - } - - // Start by assuming that intra mode is best. - best_ref_mv.row = 0; - best_ref_mv.col = 0; - -#if CONFIG_FP_MB_STATS - if (cpi->use_fp_mb_stats) { - // intra predication statistics - cpi->twopass.frame_mb_stats_buf[mb_index] = 0; - cpi->twopass.frame_mb_stats_buf[mb_index] |= FPMB_DCINTRA_MASK; - cpi->twopass.frame_mb_stats_buf[mb_index] |= FPMB_MOTION_ZERO_MASK; - if (this_error > FPMB_ERROR_LARGE_TH) { - cpi->twopass.frame_mb_stats_buf[mb_index] |= FPMB_ERROR_LARGE_MASK; - } else if (this_error < FPMB_ERROR_SMALL_TH) { - cpi->twopass.frame_mb_stats_buf[mb_index] |= FPMB_ERROR_SMALL_MASK; - } - } -#endif - - if (motion_error <= this_error) { - vp9_clear_system_state(); - - // Keep a count of cases where the inter and intra were very close - // and very low. This helps with scene cut detection for example in - // cropped clips with black bars at the sides or top and bottom. -#if INTRA_WEIGHT_EXPERIMENT - if (((this_error - intrapenalty) * 9 <= motion_error * 10) && - (this_error < (2 * intrapenalty))) { - neutral_count += 1.0; - // Also track cases where the intra is not much worse than the inter - // and use this in limiting the GF/arf group length. - } else if ((this_error > NCOUNT_INTRA_THRESH) && - (this_error < (NCOUNT_INTRA_FACTOR * motion_error))) { - neutral_count += (double)motion_error / - DOUBLE_DIVIDE_CHECK((double)this_error); - } -#else - if (((this_error - intrapenalty) * 9 <= motion_error * 10) && - (this_error < (2 * intrapenalty))) { - neutral_count += 1.0; - } -#endif - - mv.row *= 8; - mv.col *= 8; - this_error = motion_error; - xd->mi[0].src_mi->mbmi.mode = NEWMV; - xd->mi[0].src_mi->mbmi.mv[0].as_mv = mv; - xd->mi[0].src_mi->mbmi.tx_size = TX_4X4; - xd->mi[0].src_mi->mbmi.ref_frame[0] = LAST_FRAME; - xd->mi[0].src_mi->mbmi.ref_frame[1] = NONE; - vp9_build_inter_predictors_sby(xd, mb_row << 1, mb_col << 1, bsize); - vp9_encode_sby_pass1(x, bsize); - sum_mvr += mv.row; - sum_mvr_abs += abs(mv.row); - sum_mvc += mv.col; - sum_mvc_abs += abs(mv.col); - sum_mvrs += mv.row * mv.row; - sum_mvcs += mv.col * mv.col; - ++intercount; - - best_ref_mv = mv; - -#if CONFIG_FP_MB_STATS - if (cpi->use_fp_mb_stats) { - // inter predication statistics - cpi->twopass.frame_mb_stats_buf[mb_index] = 0; - cpi->twopass.frame_mb_stats_buf[mb_index] &= ~FPMB_DCINTRA_MASK; - cpi->twopass.frame_mb_stats_buf[mb_index] |= FPMB_MOTION_ZERO_MASK; - if (this_error > FPMB_ERROR_LARGE_TH) { - cpi->twopass.frame_mb_stats_buf[mb_index] |= - FPMB_ERROR_LARGE_MASK; - } else if (this_error < FPMB_ERROR_SMALL_TH) { - cpi->twopass.frame_mb_stats_buf[mb_index] |= - FPMB_ERROR_SMALL_MASK; - } - } -#endif - - if (!is_zero_mv(&mv)) { - ++mvcount; - -#if CONFIG_FP_MB_STATS - if (cpi->use_fp_mb_stats) { - cpi->twopass.frame_mb_stats_buf[mb_index] &= - ~FPMB_MOTION_ZERO_MASK; - // check estimated motion direction - if (mv.as_mv.col > 0 && mv.as_mv.col >= abs(mv.as_mv.row)) { - // right direction - cpi->twopass.frame_mb_stats_buf[mb_index] |= - FPMB_MOTION_RIGHT_MASK; - } else if (mv.as_mv.row < 0 && - abs(mv.as_mv.row) >= abs(mv.as_mv.col)) { - // up direction - cpi->twopass.frame_mb_stats_buf[mb_index] |= - FPMB_MOTION_UP_MASK; - } else if (mv.as_mv.col < 0 && - abs(mv.as_mv.col) >= abs(mv.as_mv.row)) { - // left direction - cpi->twopass.frame_mb_stats_buf[mb_index] |= - FPMB_MOTION_LEFT_MASK; - } else { - // down direction - cpi->twopass.frame_mb_stats_buf[mb_index] |= - FPMB_MOTION_DOWN_MASK; - } - } -#endif - - // Non-zero vector, was it different from the last non zero vector? - if (!is_equal_mv(&mv, &lastmv)) - ++new_mv_count; - lastmv = mv; - - // Does the row vector point inwards or outwards? - if (mb_row < cm->mb_rows / 2) { - if (mv.row > 0) - --sum_in_vectors; - else if (mv.row < 0) - ++sum_in_vectors; - } else if (mb_row > cm->mb_rows / 2) { - if (mv.row > 0) - ++sum_in_vectors; - else if (mv.row < 0) - --sum_in_vectors; - } - - // Does the col vector point inwards or outwards? - if (mb_col < cm->mb_cols / 2) { - if (mv.col > 0) - --sum_in_vectors; - else if (mv.col < 0) - ++sum_in_vectors; - } else if (mb_col > cm->mb_cols / 2) { - if (mv.col > 0) - ++sum_in_vectors; - else if (mv.col < 0) - --sum_in_vectors; - } - } - } - } else { - sr_coded_error += (int64_t)this_error; - } - coded_error += (int64_t)this_error; - - // Adjust to the next column of MBs. - x->plane[0].src.buf += 16; - x->plane[1].src.buf += uv_mb_height; - x->plane[2].src.buf += uv_mb_height; - - recon_yoffset += 16; - recon_uvoffset += uv_mb_height; - } - - // Adjust to the next row of MBs. - x->plane[0].src.buf += 16 * x->plane[0].src.stride - 16 * cm->mb_cols; - x->plane[1].src.buf += uv_mb_height * x->plane[1].src.stride - - uv_mb_height * cm->mb_cols; - x->plane[2].src.buf += uv_mb_height * x->plane[1].src.stride - - uv_mb_height * cm->mb_cols; - - vp9_clear_system_state(); - } - - { - FIRSTPASS_STATS fps; - // The minimum error here insures some bit allocation to frames even - // in static regions. The allocation per MB declines for larger formats - // where the typical "real" energy per MB also falls. - // Initial estimate here uses sqrt(mbs) to define the min_err, where the - // number of mbs is proportional to the image area. - const int num_mbs = (cpi->oxcf.resize_mode != RESIZE_NONE) - ? cpi->initial_mbs : cpi->common.MBs; - const double min_err = 200 * sqrt(num_mbs); - - intra_factor = intra_factor / (double)num_mbs; - brightness_factor = brightness_factor / (double)num_mbs; - fps.weight = intra_factor * brightness_factor; - - fps.frame = cm->current_video_frame; - fps.spatial_layer_id = cpi->svc.spatial_layer_id; - fps.coded_error = (double)(coded_error >> 8) + min_err; - fps.sr_coded_error = (double)(sr_coded_error >> 8) + min_err; - fps.intra_error = (double)(intra_error >> 8) + min_err; - fps.count = 1.0; - fps.pcnt_inter = (double)intercount / num_mbs; - fps.pcnt_second_ref = (double)second_ref_count / num_mbs; - fps.pcnt_neutral = (double)neutral_count / num_mbs; - - if (mvcount > 0) { - fps.MVr = (double)sum_mvr / mvcount; - fps.mvr_abs = (double)sum_mvr_abs / mvcount; - fps.MVc = (double)sum_mvc / mvcount; - fps.mvc_abs = (double)sum_mvc_abs / mvcount; - fps.MVrv = ((double)sum_mvrs - (fps.MVr * fps.MVr / mvcount)) / mvcount; - fps.MVcv = ((double)sum_mvcs - (fps.MVc * fps.MVc / mvcount)) / mvcount; - fps.mv_in_out_count = (double)sum_in_vectors / (mvcount * 2); - fps.new_mv_count = new_mv_count; - fps.pcnt_motion = (double)mvcount / num_mbs; - } else { - fps.MVr = 0.0; - fps.mvr_abs = 0.0; - fps.MVc = 0.0; - fps.mvc_abs = 0.0; - fps.MVrv = 0.0; - fps.MVcv = 0.0; - fps.mv_in_out_count = 0.0; - fps.new_mv_count = 0.0; - fps.pcnt_motion = 0.0; - } - - // TODO(paulwilkins): Handle the case when duration is set to 0, or - // something less than the full time between subsequent values of - // cpi->source_time_stamp. - fps.duration = (double)(source->ts_end - source->ts_start); - - // Don't want to do output stats with a stack variable! - twopass->this_frame_stats = fps; - output_stats(&twopass->this_frame_stats, cpi->output_pkt_list); - accumulate_stats(&twopass->total_stats, &fps); - -#if CONFIG_FP_MB_STATS - if (cpi->use_fp_mb_stats) { - output_fpmb_stats(twopass->frame_mb_stats_buf, cm, cpi->output_pkt_list); - } -#endif - } - - // Copy the previous Last Frame back into gf and and arf buffers if - // the prediction is good enough... but also don't allow it to lag too far. - if ((twopass->sr_update_lag > 3) || - ((cm->current_video_frame > 0) && - (twopass->this_frame_stats.pcnt_inter > 0.20) && - ((twopass->this_frame_stats.intra_error / - DOUBLE_DIVIDE_CHECK(twopass->this_frame_stats.coded_error)) > 2.0))) { - if (gld_yv12 != NULL) { - ref_cnt_fb(pool->frame_bufs, &cm->ref_frame_map[cpi->gld_fb_idx], - cm->ref_frame_map[cpi->lst_fb_idx]); - } - twopass->sr_update_lag = 1; - } else { - ++twopass->sr_update_lag; - } - - vp9_extend_frame_borders(new_yv12); - - if (lc != NULL) { - vp9_update_reference_frames(cpi); - } else { - // The frame we just compressed now becomes the last frame. - ref_cnt_fb(pool->frame_bufs, &cm->ref_frame_map[cpi->lst_fb_idx], - cm->new_fb_idx); - } - - // Special case for the first frame. Copy into the GF buffer as a second - // reference. - if (cm->current_video_frame == 0 && cpi->gld_fb_idx != INVALID_IDX && - lc == NULL) { - ref_cnt_fb(pool->frame_bufs, &cm->ref_frame_map[cpi->gld_fb_idx], - cm->ref_frame_map[cpi->lst_fb_idx]); - } - - // Use this to see what the first pass reconstruction looks like. - if (0) { - char filename[512]; - FILE *recon_file; - snprintf(filename, sizeof(filename), "enc%04d.yuv", - (int)cm->current_video_frame); - - if (cm->current_video_frame == 0) - recon_file = fopen(filename, "wb"); - else - recon_file = fopen(filename, "ab"); - - (void)fwrite(lst_yv12->buffer_alloc, lst_yv12->frame_size, 1, recon_file); - fclose(recon_file); - } - - ++cm->current_video_frame; - if (cpi->use_svc) - vp9_inc_frame_in_layer(cpi); -} - -static double calc_correction_factor(double err_per_mb, - double err_divisor, - double pt_low, - double pt_high, - int q, - vpx_bit_depth_t bit_depth) { - const double error_term = err_per_mb / err_divisor; - - // Adjustment based on actual quantizer to power term. - const double power_term = - MIN(vp9_convert_qindex_to_q(q, bit_depth) * 0.01 + pt_low, pt_high); - - // Calculate correction factor. - if (power_term < 1.0) - assert(error_term >= 0.0); - - return fclamp(pow(error_term, power_term), 0.05, 5.0); -} - -// Larger image formats are expected to be a little harder to code relatively -// given the same prediction error score. This in part at least relates to the -// increased size and hence coding cost of motion vectors. -#define EDIV_SIZE_FACTOR 800 - -static int get_twopass_worst_quality(const VP9_COMP *cpi, - const double section_err, - int section_target_bandwidth, - double group_weight_factor) { - const RATE_CONTROL *const rc = &cpi->rc; - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - - if (section_target_bandwidth <= 0) { - return rc->worst_quality; // Highest value allowed - } else { - const int num_mbs = (cpi->oxcf.resize_mode != RESIZE_NONE) - ? cpi->initial_mbs : cpi->common.MBs; - const double err_per_mb = section_err / num_mbs; - const double speed_term = 1.0 + 0.04 * oxcf->speed; - const double ediv_size_correction = num_mbs / EDIV_SIZE_FACTOR; - const int target_norm_bits_per_mb = ((uint64_t)section_target_bandwidth << - BPER_MB_NORMBITS) / num_mbs; - - int q; - int is_svc_upper_layer = 0; - - if (is_two_pass_svc(cpi) && cpi->svc.spatial_layer_id > 0) - is_svc_upper_layer = 1; - - - // Try and pick a max Q that will be high enough to encode the - // content at the given rate. - for (q = rc->best_quality; q < rc->worst_quality; ++q) { - const double factor = - calc_correction_factor(err_per_mb, - ERR_DIVISOR - ediv_size_correction, - is_svc_upper_layer ? SVC_FACTOR_PT_LOW : - FACTOR_PT_LOW, FACTOR_PT_HIGH, q, - cpi->common.bit_depth); - const int bits_per_mb = - vp9_rc_bits_per_mb(INTER_FRAME, q, - factor * speed_term * group_weight_factor, - cpi->common.bit_depth); - if (bits_per_mb <= target_norm_bits_per_mb) - break; - } - - // Restriction on active max q for constrained quality mode. - if (cpi->oxcf.rc_mode == VPX_CQ) - q = MAX(q, oxcf->cq_level); - return q; - } -} - -static void setup_rf_level_maxq(VP9_COMP *cpi) { - int i; - RATE_CONTROL *const rc = &cpi->rc; - for (i = INTER_NORMAL; i < RATE_FACTOR_LEVELS; ++i) { - int qdelta = vp9_frame_type_qdelta(cpi, i, rc->worst_quality); - rc->rf_level_maxq[i] = MAX(rc->worst_quality + qdelta, rc->best_quality); - } -} - -void vp9_init_subsampling(VP9_COMP *cpi) { - const VP9_COMMON *const cm = &cpi->common; - RATE_CONTROL *const rc = &cpi->rc; - const int w = cm->width; - const int h = cm->height; - int i; - - for (i = 0; i < FRAME_SCALE_STEPS; ++i) { - // Note: Frames with odd-sized dimensions may result from this scaling. - rc->frame_width[i] = (w * 16) / frame_scale_factor[i]; - rc->frame_height[i] = (h * 16) / frame_scale_factor[i]; - } - - setup_rf_level_maxq(cpi); -} - -void calculate_coded_size(VP9_COMP *cpi, - int *scaled_frame_width, - int *scaled_frame_height) { - RATE_CONTROL *const rc = &cpi->rc; - *scaled_frame_width = rc->frame_width[rc->frame_size_selector]; - *scaled_frame_height = rc->frame_height[rc->frame_size_selector]; -} - -void vp9_init_second_pass(VP9_COMP *cpi) { - SVC *const svc = &cpi->svc; - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - const int is_two_pass_svc = (svc->number_spatial_layers > 1) || - (svc->number_temporal_layers > 1); - TWO_PASS *const twopass = is_two_pass_svc ? - &svc->layer_context[svc->spatial_layer_id].twopass : &cpi->twopass; - double frame_rate; - FIRSTPASS_STATS *stats; - - zero_stats(&twopass->total_stats); - zero_stats(&twopass->total_left_stats); - - if (!twopass->stats_in_end) - return; - - stats = &twopass->total_stats; - - *stats = *twopass->stats_in_end; - twopass->total_left_stats = *stats; - - frame_rate = 10000000.0 * stats->count / stats->duration; - // Each frame can have a different duration, as the frame rate in the source - // isn't guaranteed to be constant. The frame rate prior to the first frame - // encoded in the second pass is a guess. However, the sum duration is not. - // It is calculated based on the actual durations of all frames from the - // first pass. - - if (is_two_pass_svc) { - vp9_update_spatial_layer_framerate(cpi, frame_rate); - twopass->bits_left = (int64_t)(stats->duration * - svc->layer_context[svc->spatial_layer_id].target_bandwidth / - 10000000.0); - } else { - vp9_new_framerate(cpi, frame_rate); - twopass->bits_left = (int64_t)(stats->duration * oxcf->target_bandwidth / - 10000000.0); - } - - // This variable monitors how far behind the second ref update is lagging. - twopass->sr_update_lag = 1; - - // Scan the first pass file and calculate a modified total error based upon - // the bias/power function used to allocate bits. - { - const double avg_error = stats->coded_error / - DOUBLE_DIVIDE_CHECK(stats->count); - const FIRSTPASS_STATS *s = twopass->stats_in; - double modified_error_total = 0.0; - twopass->modified_error_min = (avg_error * - oxcf->two_pass_vbrmin_section) / 100; - twopass->modified_error_max = (avg_error * - oxcf->two_pass_vbrmax_section) / 100; - while (s < twopass->stats_in_end) { - modified_error_total += calculate_modified_err(twopass, oxcf, s); - ++s; - } - twopass->modified_error_left = modified_error_total; - } - - // Reset the vbr bits off target counter - cpi->rc.vbr_bits_off_target = 0; - - cpi->rc.rate_error_estimate = 0; - - // Static sequence monitor variables. - twopass->kf_zeromotion_pct = 100; - twopass->last_kfgroup_zeromotion_pct = 100; - - if (oxcf->resize_mode != RESIZE_NONE) { - vp9_init_subsampling(cpi); - } -} - -#define SR_DIFF_PART 0.0015 -#define MOTION_AMP_PART 0.003 -#define INTRA_PART 0.005 -#define DEFAULT_DECAY_LIMIT 0.75 -#define LOW_SR_DIFF_TRHESH 0.1 -#define SR_DIFF_MAX 128.0 - -static double get_sr_decay_rate(const VP9_COMP *cpi, - const FIRSTPASS_STATS *frame) { - const int num_mbs = (cpi->oxcf.resize_mode != RESIZE_NONE) - ? cpi->initial_mbs : cpi->common.MBs; - double sr_diff = - (frame->sr_coded_error - frame->coded_error) / num_mbs; - double sr_decay = 1.0; - double modified_pct_inter; - double modified_pcnt_intra; - const double motion_amplitude_factor = - frame->pcnt_motion * ((frame->mvc_abs + frame->mvr_abs) / 2); - - modified_pct_inter = frame->pcnt_inter; -#if INTRA_WEIGHT_EXPERIMENT - if ((frame->intra_error / DOUBLE_DIVIDE_CHECK(frame->coded_error)) < - (double)NCOUNT_FRAME_II_THRESH) - modified_pct_inter = frame->pcnt_inter - frame->pcnt_neutral; -#endif - modified_pcnt_intra = 100 * (1.0 - modified_pct_inter); - - - if ((sr_diff > LOW_SR_DIFF_TRHESH)) { - sr_diff = MIN(sr_diff, SR_DIFF_MAX); - sr_decay = 1.0 - (SR_DIFF_PART * sr_diff) - - (MOTION_AMP_PART * motion_amplitude_factor) - - (INTRA_PART * modified_pcnt_intra); - } - return MAX(sr_decay, MIN(DEFAULT_DECAY_LIMIT, modified_pct_inter)); -} - -// This function gives an estimate of how badly we believe the prediction -// quality is decaying from frame to frame. -static double get_zero_motion_factor(const VP9_COMP *cpi, - const FIRSTPASS_STATS *frame) { - const double zero_motion_pct = frame->pcnt_inter - - frame->pcnt_motion; - double sr_decay = get_sr_decay_rate(cpi, frame); - return MIN(sr_decay, zero_motion_pct); -} - -#define ZM_POWER_FACTOR 0.75 - -static double get_prediction_decay_rate(const VP9_COMP *cpi, - const FIRSTPASS_STATS *next_frame) { - const double sr_decay_rate = get_sr_decay_rate(cpi, next_frame); - const double zero_motion_factor = - (0.95 * pow((next_frame->pcnt_inter - next_frame->pcnt_motion), - ZM_POWER_FACTOR)); - - return MAX(zero_motion_factor, - (sr_decay_rate + ((1.0 - sr_decay_rate) * zero_motion_factor))); -} - -// Function to test for a condition where a complex transition is followed -// by a static section. For example in slide shows where there is a fade -// between slides. This is to help with more optimal kf and gf positioning. -static int detect_transition_to_still(const TWO_PASS *twopass, - int frame_interval, int still_interval, - double loop_decay_rate, - double last_decay_rate) { - // Break clause to detect very still sections after motion - // For example a static image after a fade or other transition - // instead of a clean scene cut. - if (frame_interval > MIN_GF_INTERVAL && - loop_decay_rate >= 0.999 && - last_decay_rate < 0.9) { - int j; - - // Look ahead a few frames to see if static condition persists... - for (j = 0; j < still_interval; ++j) { - const FIRSTPASS_STATS *stats = &twopass->stats_in[j]; - if (stats >= twopass->stats_in_end) - break; - - if (stats->pcnt_inter - stats->pcnt_motion < 0.999) - break; - } - - // Only if it does do we signal a transition to still. - return j == still_interval; - } - - return 0; -} - -// This function detects a flash through the high relative pcnt_second_ref -// score in the frame following a flash frame. The offset passed in should -// reflect this. -static int detect_flash(const TWO_PASS *twopass, int offset) { - const FIRSTPASS_STATS *const next_frame = read_frame_stats(twopass, offset); - - // What we are looking for here is a situation where there is a - // brief break in prediction (such as a flash) but subsequent frames - // are reasonably well predicted by an earlier (pre flash) frame. - // The recovery after a flash is indicated by a high pcnt_second_ref - // compared to pcnt_inter. - return next_frame != NULL && - next_frame->pcnt_second_ref > next_frame->pcnt_inter && - next_frame->pcnt_second_ref >= 0.5; -} - -// Update the motion related elements to the GF arf boost calculation. -static void accumulate_frame_motion_stats(const FIRSTPASS_STATS *stats, - double *mv_in_out, - double *mv_in_out_accumulator, - double *abs_mv_in_out_accumulator, - double *mv_ratio_accumulator) { - const double pct = stats->pcnt_motion; - - // Accumulate Motion In/Out of frame stats. - *mv_in_out = stats->mv_in_out_count * pct; - *mv_in_out_accumulator += *mv_in_out; - *abs_mv_in_out_accumulator += fabs(*mv_in_out); - - // Accumulate a measure of how uniform (or conversely how random) the motion - // field is (a ratio of abs(mv) / mv). - if (pct > 0.05) { - const double mvr_ratio = fabs(stats->mvr_abs) / - DOUBLE_DIVIDE_CHECK(fabs(stats->MVr)); - const double mvc_ratio = fabs(stats->mvc_abs) / - DOUBLE_DIVIDE_CHECK(fabs(stats->MVc)); - - *mv_ratio_accumulator += pct * (mvr_ratio < stats->mvr_abs ? - mvr_ratio : stats->mvr_abs); - *mv_ratio_accumulator += pct * (mvc_ratio < stats->mvc_abs ? - mvc_ratio : stats->mvc_abs); - } -} - -#define BASELINE_ERR_PER_MB 1000.0 -static double calc_frame_boost(VP9_COMP *cpi, - const FIRSTPASS_STATS *this_frame, - double this_frame_mv_in_out, - double max_boost) { - double frame_boost; - const double lq = - vp9_convert_qindex_to_q(cpi->rc.avg_frame_qindex[INTER_FRAME], - cpi->common.bit_depth); - const double boost_q_correction = MIN((0.5 + (lq * 0.015)), 1.5); - const int num_mbs = (cpi->oxcf.resize_mode != RESIZE_NONE) - ? cpi->initial_mbs : cpi->common.MBs; - - // Underlying boost factor is based on inter error ratio. - frame_boost = (BASELINE_ERR_PER_MB * num_mbs) / - DOUBLE_DIVIDE_CHECK(this_frame->coded_error); - frame_boost = frame_boost * BOOST_FACTOR * boost_q_correction; - - // Increase boost for frames where new data coming into frame (e.g. zoom out). - // Slightly reduce boost if there is a net balance of motion out of the frame - // (zoom in). The range for this_frame_mv_in_out is -1.0 to +1.0. - if (this_frame_mv_in_out > 0.0) - frame_boost += frame_boost * (this_frame_mv_in_out * 2.0); - // In the extreme case the boost is halved. - else - frame_boost += frame_boost * (this_frame_mv_in_out / 2.0); - - return MIN(frame_boost, max_boost * boost_q_correction); -} - -static int calc_arf_boost(VP9_COMP *cpi, int offset, - int f_frames, int b_frames, - int *f_boost, int *b_boost) { - TWO_PASS *const twopass = &cpi->twopass; - int i; - double boost_score = 0.0; - double mv_ratio_accumulator = 0.0; - double decay_accumulator = 1.0; - double this_frame_mv_in_out = 0.0; - double mv_in_out_accumulator = 0.0; - double abs_mv_in_out_accumulator = 0.0; - int arf_boost; - int flash_detected = 0; - - // Search forward from the proposed arf/next gf position. - for (i = 0; i < f_frames; ++i) { - const FIRSTPASS_STATS *this_frame = read_frame_stats(twopass, i + offset); - if (this_frame == NULL) - break; - - // Update the motion related elements to the boost calculation. - accumulate_frame_motion_stats(this_frame, - &this_frame_mv_in_out, &mv_in_out_accumulator, - &abs_mv_in_out_accumulator, - &mv_ratio_accumulator); - - // We want to discount the flash frame itself and the recovery - // frame that follows as both will have poor scores. - flash_detected = detect_flash(twopass, i + offset) || - detect_flash(twopass, i + offset + 1); - - // Accumulate the effect of prediction quality decay. - if (!flash_detected) { - decay_accumulator *= get_prediction_decay_rate(cpi, this_frame); - decay_accumulator = decay_accumulator < MIN_DECAY_FACTOR - ? MIN_DECAY_FACTOR : decay_accumulator; - } - - boost_score += decay_accumulator * calc_frame_boost(cpi, this_frame, - this_frame_mv_in_out, - GF_MAX_BOOST); - } - - *f_boost = (int)boost_score; - - // Reset for backward looking loop. - boost_score = 0.0; - mv_ratio_accumulator = 0.0; - decay_accumulator = 1.0; - this_frame_mv_in_out = 0.0; - mv_in_out_accumulator = 0.0; - abs_mv_in_out_accumulator = 0.0; - - // Search backward towards last gf position. - for (i = -1; i >= -b_frames; --i) { - const FIRSTPASS_STATS *this_frame = read_frame_stats(twopass, i + offset); - if (this_frame == NULL) - break; - - // Update the motion related elements to the boost calculation. - accumulate_frame_motion_stats(this_frame, - &this_frame_mv_in_out, &mv_in_out_accumulator, - &abs_mv_in_out_accumulator, - &mv_ratio_accumulator); - - // We want to discount the the flash frame itself and the recovery - // frame that follows as both will have poor scores. - flash_detected = detect_flash(twopass, i + offset) || - detect_flash(twopass, i + offset + 1); - - // Cumulative effect of prediction quality decay. - if (!flash_detected) { - decay_accumulator *= get_prediction_decay_rate(cpi, this_frame); - decay_accumulator = decay_accumulator < MIN_DECAY_FACTOR - ? MIN_DECAY_FACTOR : decay_accumulator; - } - - boost_score += decay_accumulator * calc_frame_boost(cpi, this_frame, - this_frame_mv_in_out, - GF_MAX_BOOST); - } - *b_boost = (int)boost_score; - - arf_boost = (*f_boost + *b_boost); - if (arf_boost < ((b_frames + f_frames) * 20)) - arf_boost = ((b_frames + f_frames) * 20); - arf_boost = MAX(arf_boost, MIN_ARF_GF_BOOST); - - return arf_boost; -} - -// Calculate a section intra ratio used in setting max loop filter. -static int calculate_section_intra_ratio(const FIRSTPASS_STATS *begin, - const FIRSTPASS_STATS *end, - int section_length) { - const FIRSTPASS_STATS *s = begin; - double intra_error = 0.0; - double coded_error = 0.0; - int i = 0; - - while (s < end && i < section_length) { - intra_error += s->intra_error; - coded_error += s->coded_error; - ++s; - ++i; - } - - return (int)(intra_error / DOUBLE_DIVIDE_CHECK(coded_error)); -} - -// Calculate the total bits to allocate in this GF/ARF group. -static int64_t calculate_total_gf_group_bits(VP9_COMP *cpi, - double gf_group_err) { - const RATE_CONTROL *const rc = &cpi->rc; - const TWO_PASS *const twopass = &cpi->twopass; - const int max_bits = frame_max_bits(rc, &cpi->oxcf); - int64_t total_group_bits; - - // Calculate the bits to be allocated to the group as a whole. - if ((twopass->kf_group_bits > 0) && (twopass->kf_group_error_left > 0)) { - total_group_bits = (int64_t)(twopass->kf_group_bits * - (gf_group_err / twopass->kf_group_error_left)); - } else { - total_group_bits = 0; - } - - // Clamp odd edge cases. - total_group_bits = (total_group_bits < 0) ? - 0 : (total_group_bits > twopass->kf_group_bits) ? - twopass->kf_group_bits : total_group_bits; - - // Clip based on user supplied data rate variability limit. - if (total_group_bits > (int64_t)max_bits * rc->baseline_gf_interval) - total_group_bits = (int64_t)max_bits * rc->baseline_gf_interval; - - return total_group_bits; -} - -// Calculate the number bits extra to assign to boosted frames in a group. -static int calculate_boost_bits(int frame_count, - int boost, int64_t total_group_bits) { - int allocation_chunks; - - // return 0 for invalid inputs (could arise e.g. through rounding errors) - if (!boost || (total_group_bits <= 0) || (frame_count <= 0) ) - return 0; - - allocation_chunks = (frame_count * 100) + boost; - - // Prevent overflow. - if (boost > 1023) { - int divisor = boost >> 10; - boost /= divisor; - allocation_chunks /= divisor; - } - - // Calculate the number of extra bits for use in the boosted frame or frames. - return MAX((int)(((int64_t)boost * total_group_bits) / allocation_chunks), 0); -} - -// Current limit on maximum number of active arfs in a GF/ARF group. -#define MAX_ACTIVE_ARFS 2 -#define ARF_SLOT1 2 -#define ARF_SLOT2 3 -// This function indirects the choice of buffers for arfs. -// At the moment the values are fixed but this may change as part of -// the integration process with other codec features that swap buffers around. -static void get_arf_buffer_indices(unsigned char *arf_buffer_indices) { - arf_buffer_indices[0] = ARF_SLOT1; - arf_buffer_indices[1] = ARF_SLOT2; -} - -static void allocate_gf_group_bits(VP9_COMP *cpi, int64_t gf_group_bits, - double group_error, int gf_arf_bits) { - RATE_CONTROL *const rc = &cpi->rc; - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - TWO_PASS *const twopass = &cpi->twopass; - GF_GROUP *const gf_group = &twopass->gf_group; - FIRSTPASS_STATS frame_stats; - int i; - int frame_index = 1; - int target_frame_size; - int key_frame; - const int max_bits = frame_max_bits(&cpi->rc, &cpi->oxcf); - int64_t total_group_bits = gf_group_bits; - double modified_err = 0.0; - double err_fraction; - int mid_boost_bits = 0; - int mid_frame_idx; - unsigned char arf_buffer_indices[MAX_ACTIVE_ARFS]; - int alt_frame_index = frame_index; - int has_temporal_layers = is_two_pass_svc(cpi) && - cpi->svc.number_temporal_layers > 1; - - // Only encode alt reference frame in temporal base layer. - if (has_temporal_layers) - alt_frame_index = cpi->svc.number_temporal_layers; - - key_frame = cpi->common.frame_type == KEY_FRAME || - vp9_is_upper_layer_key_frame(cpi); - - get_arf_buffer_indices(arf_buffer_indices); - - // For key frames the frame target rate is already set and it - // is also the golden frame. - if (!key_frame) { - if (rc->source_alt_ref_active) { - gf_group->update_type[0] = OVERLAY_UPDATE; - gf_group->rf_level[0] = INTER_NORMAL; - gf_group->bit_allocation[0] = 0; - gf_group->arf_update_idx[0] = arf_buffer_indices[0]; - gf_group->arf_ref_idx[0] = arf_buffer_indices[0]; - } else { - gf_group->update_type[0] = GF_UPDATE; - gf_group->rf_level[0] = GF_ARF_STD; - gf_group->bit_allocation[0] = gf_arf_bits; - gf_group->arf_update_idx[0] = arf_buffer_indices[0]; - gf_group->arf_ref_idx[0] = arf_buffer_indices[0]; - } - - // Step over the golden frame / overlay frame - if (EOF == input_stats(twopass, &frame_stats)) - return; - } - - // Deduct the boost bits for arf (or gf if it is not a key frame) - // from the group total. - if (rc->source_alt_ref_pending || !key_frame) - total_group_bits -= gf_arf_bits; - - // Store the bits to spend on the ARF if there is one. - if (rc->source_alt_ref_pending) { - gf_group->update_type[alt_frame_index] = ARF_UPDATE; - gf_group->rf_level[alt_frame_index] = GF_ARF_STD; - gf_group->bit_allocation[alt_frame_index] = gf_arf_bits; - - if (has_temporal_layers) - gf_group->arf_src_offset[alt_frame_index] = - (unsigned char)(rc->baseline_gf_interval - - cpi->svc.number_temporal_layers); - else - gf_group->arf_src_offset[alt_frame_index] = - (unsigned char)(rc->baseline_gf_interval - 1); - - gf_group->arf_update_idx[alt_frame_index] = arf_buffer_indices[0]; - gf_group->arf_ref_idx[alt_frame_index] = - arf_buffer_indices[cpi->multi_arf_last_grp_enabled && - rc->source_alt_ref_active]; - if (!has_temporal_layers) - ++frame_index; - - if (cpi->multi_arf_enabled) { - // Set aside a slot for a level 1 arf. - gf_group->update_type[frame_index] = ARF_UPDATE; - gf_group->rf_level[frame_index] = GF_ARF_LOW; - gf_group->arf_src_offset[frame_index] = - (unsigned char)((rc->baseline_gf_interval >> 1) - 1); - gf_group->arf_update_idx[frame_index] = arf_buffer_indices[1]; - gf_group->arf_ref_idx[frame_index] = arf_buffer_indices[0]; - ++frame_index; - } - } - - // Define middle frame - mid_frame_idx = frame_index + (rc->baseline_gf_interval >> 1) - 1; - - // Allocate bits to the other frames in the group. - for (i = 0; i < rc->baseline_gf_interval - 1; ++i) { - int arf_idx = 0; - if (EOF == input_stats(twopass, &frame_stats)) - break; - - if (has_temporal_layers && frame_index == alt_frame_index) { - ++frame_index; - } - - modified_err = calculate_modified_err(twopass, oxcf, &frame_stats); - - if (group_error > 0) - err_fraction = modified_err / DOUBLE_DIVIDE_CHECK(group_error); - else - err_fraction = 0.0; - - target_frame_size = (int)((double)total_group_bits * err_fraction); - - if (rc->source_alt_ref_pending && cpi->multi_arf_enabled) { - mid_boost_bits += (target_frame_size >> 4); - target_frame_size -= (target_frame_size >> 4); - - if (frame_index <= mid_frame_idx) - arf_idx = 1; - } - gf_group->arf_update_idx[frame_index] = arf_buffer_indices[arf_idx]; - gf_group->arf_ref_idx[frame_index] = arf_buffer_indices[arf_idx]; - - target_frame_size = clamp(target_frame_size, 0, - MIN(max_bits, (int)total_group_bits)); - - gf_group->update_type[frame_index] = LF_UPDATE; - gf_group->rf_level[frame_index] = INTER_NORMAL; - - gf_group->bit_allocation[frame_index] = target_frame_size; - ++frame_index; - } - - // Note: - // We need to configure the frame at the end of the sequence + 1 that will be - // the start frame for the next group. Otherwise prior to the call to - // vp9_rc_get_second_pass_params() the data will be undefined. - gf_group->arf_update_idx[frame_index] = arf_buffer_indices[0]; - gf_group->arf_ref_idx[frame_index] = arf_buffer_indices[0]; - - if (rc->source_alt_ref_pending) { - gf_group->update_type[frame_index] = OVERLAY_UPDATE; - gf_group->rf_level[frame_index] = INTER_NORMAL; - - // Final setup for second arf and its overlay. - if (cpi->multi_arf_enabled) { - gf_group->bit_allocation[2] = - gf_group->bit_allocation[mid_frame_idx] + mid_boost_bits; - gf_group->update_type[mid_frame_idx] = OVERLAY_UPDATE; - gf_group->bit_allocation[mid_frame_idx] = 0; - } - } else { - gf_group->update_type[frame_index] = GF_UPDATE; - gf_group->rf_level[frame_index] = GF_ARF_STD; - } - - // Note whether multi-arf was enabled this group for next time. - cpi->multi_arf_last_grp_enabled = cpi->multi_arf_enabled; -} - -// Analyse and define a gf/arf group. -static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { - VP9_COMMON *const cm = &cpi->common; - RATE_CONTROL *const rc = &cpi->rc; - VP9EncoderConfig *const oxcf = &cpi->oxcf; - TWO_PASS *const twopass = &cpi->twopass; - FIRSTPASS_STATS next_frame; - const FIRSTPASS_STATS *const start_pos = twopass->stats_in; - int i; - - double boost_score = 0.0; - double old_boost_score = 0.0; - double gf_group_err = 0.0; -#if GROUP_ADAPTIVE_MAXQ - double gf_group_raw_error = 0.0; -#endif - double gf_first_frame_err = 0.0; - double mod_frame_err = 0.0; - - double mv_ratio_accumulator = 0.0; - double decay_accumulator = 1.0; - double zero_motion_accumulator = 1.0; - - double loop_decay_rate = 1.00; - double last_loop_decay_rate = 1.00; - - double this_frame_mv_in_out = 0.0; - double mv_in_out_accumulator = 0.0; - double abs_mv_in_out_accumulator = 0.0; - double mv_ratio_accumulator_thresh; - unsigned int allow_alt_ref = is_altref_enabled(cpi); - - int f_boost = 0; - int b_boost = 0; - int flash_detected; - int active_max_gf_interval; - int active_min_gf_interval; - int64_t gf_group_bits; - double gf_group_error_left; - int gf_arf_bits; - int is_key_frame = frame_is_intra_only(cm); - - // Reset the GF group data structures unless this is a key - // frame in which case it will already have been done. - if (is_key_frame == 0) { - vp9_zero(twopass->gf_group); - } - - vp9_clear_system_state(); - vp9_zero(next_frame); - - // Load stats for the current frame. - mod_frame_err = calculate_modified_err(twopass, oxcf, this_frame); - - // Note the error of the frame at the start of the group. This will be - // the GF frame error if we code a normal gf. - gf_first_frame_err = mod_frame_err; - - // If this is a key frame or the overlay from a previous arf then - // the error score / cost of this frame has already been accounted for. - if (is_key_frame || rc->source_alt_ref_active) { - gf_group_err -= gf_first_frame_err; -#if GROUP_ADAPTIVE_MAXQ - gf_group_raw_error -= this_frame->coded_error; -#endif - } - - // Motion breakout threshold for loop below depends on image size. - mv_ratio_accumulator_thresh = - (cpi->initial_height + cpi->initial_width) / 4.0; - - // Set a maximum and minimum interval for the GF group. - // If the image appears almost completely static we can extend beyond this. - { - int int_max_q = - (int)(vp9_convert_qindex_to_q(twopass->active_worst_quality, - cpi->common.bit_depth)); - int int_lbq = - (int)(vp9_convert_qindex_to_q(rc->last_boosted_qindex, - cpi->common.bit_depth)); - active_min_gf_interval = MIN_GF_INTERVAL + MIN(2, int_max_q / 200); - if (active_min_gf_interval > rc->max_gf_interval) - active_min_gf_interval = rc->max_gf_interval; - - if (cpi->multi_arf_allowed) { - active_max_gf_interval = rc->max_gf_interval; - } else { - // The value chosen depends on the active Q range. At low Q we have - // bits to spare and are better with a smaller interval and smaller boost. - // At high Q when there are few bits to spare we are better with a longer - // interval to spread the cost of the GF. - active_max_gf_interval = 12 + MIN(4, (int_lbq / 6)); - if (active_max_gf_interval > rc->max_gf_interval) - active_max_gf_interval = rc->max_gf_interval; - } - } - - i = 0; - while (i < rc->static_scene_max_gf_interval && i < rc->frames_to_key) { - ++i; - - // Accumulate error score of frames in this gf group. - mod_frame_err = calculate_modified_err(twopass, oxcf, this_frame); - gf_group_err += mod_frame_err; -#if GROUP_ADAPTIVE_MAXQ - gf_group_raw_error += this_frame->coded_error; -#endif - - if (EOF == input_stats(twopass, &next_frame)) - break; - - // Test for the case where there is a brief flash but the prediction - // quality back to an earlier frame is then restored. - flash_detected = detect_flash(twopass, 0); - - // Update the motion related elements to the boost calculation. - accumulate_frame_motion_stats(&next_frame, - &this_frame_mv_in_out, &mv_in_out_accumulator, - &abs_mv_in_out_accumulator, - &mv_ratio_accumulator); - - // Accumulate the effect of prediction quality decay. - if (!flash_detected) { - last_loop_decay_rate = loop_decay_rate; - loop_decay_rate = get_prediction_decay_rate(cpi, &next_frame); - - decay_accumulator = decay_accumulator * loop_decay_rate; - - // Monitor for static sections. - zero_motion_accumulator = - MIN(zero_motion_accumulator, get_zero_motion_factor(cpi, &next_frame)); - - // Break clause to detect very still sections after motion. For example, - // a static image after a fade or other transition. - if (detect_transition_to_still(twopass, i, 5, loop_decay_rate, - last_loop_decay_rate)) { - allow_alt_ref = 0; - break; - } - } - - // Calculate a boost number for this frame. - boost_score += decay_accumulator * calc_frame_boost(cpi, &next_frame, - this_frame_mv_in_out, - GF_MAX_BOOST); - - // Break out conditions. - if ( - // Break at active_max_gf_interval unless almost totally static. - (i >= active_max_gf_interval && (zero_motion_accumulator < 0.995)) || - ( - // Don't break out with a very short interval. - (i > active_min_gf_interval) && - (!flash_detected) && - ((mv_ratio_accumulator > mv_ratio_accumulator_thresh) || - (abs_mv_in_out_accumulator > 3.0) || - (mv_in_out_accumulator < -2.0) || - ((boost_score - old_boost_score) < BOOST_BREAKOUT)))) { - boost_score = old_boost_score; - break; - } - - *this_frame = next_frame; - old_boost_score = boost_score; - } - - twopass->gf_zeromotion_pct = (int)(zero_motion_accumulator * 1000.0); - - // Was the group length constrained by the requirement for a new KF? - rc->constrained_gf_group = (i >= rc->frames_to_key) ? 1 : 0; - - // Set the interval until the next gf. - if (is_key_frame || rc->source_alt_ref_active) - rc->baseline_gf_interval = i - 1; - else - rc->baseline_gf_interval = i; - - // Only encode alt reference frame in temporal base layer. So - // baseline_gf_interval should be multiple of a temporal layer group - // (typically the frame distance between two base layer frames) - if (is_two_pass_svc(cpi) && cpi->svc.number_temporal_layers > 1) { - int count = (1 << (cpi->svc.number_temporal_layers - 1)) - 1; - int new_gf_interval = (rc->baseline_gf_interval + count) & (~count); - int j; - for (j = 0; j < new_gf_interval - rc->baseline_gf_interval; ++j) { - if (EOF == input_stats(twopass, this_frame)) - break; - gf_group_err += calculate_modified_err(twopass, oxcf, this_frame); -#if GROUP_ADAPTIVE_MAXQ - gf_group_raw_error += this_frame->coded_error; -#endif - } - rc->baseline_gf_interval = new_gf_interval; - } - - rc->frames_till_gf_update_due = rc->baseline_gf_interval; - - // Should we use the alternate reference frame. - if (allow_alt_ref && - (i < cpi->oxcf.lag_in_frames) && - (i >= MIN_GF_INTERVAL)) { - // Calculate the boost for alt ref. - rc->gfu_boost = calc_arf_boost(cpi, 0, (i - 1), (i - 1), &f_boost, - &b_boost); - rc->source_alt_ref_pending = 1; - - // Test to see if multi arf is appropriate. - cpi->multi_arf_enabled = - (cpi->multi_arf_allowed && (rc->baseline_gf_interval >= 6) && - (zero_motion_accumulator < 0.995)) ? 1 : 0; - } else { - rc->gfu_boost = MAX((int)boost_score, MIN_ARF_GF_BOOST); - rc->source_alt_ref_pending = 0; - } - - // Reset the file position. - reset_fpf_position(twopass, start_pos); - - // Calculate the bits to be allocated to the gf/arf group as a whole - gf_group_bits = calculate_total_gf_group_bits(cpi, gf_group_err); - -#if GROUP_ADAPTIVE_MAXQ - // Calculate an estimate of the maxq needed for the group. - // We are more agressive about correcting for sections - // where there could be significant overshoot than for easier - // sections where we do not wish to risk creating an overshoot - // of the allocated bit budget. - if ((cpi->oxcf.rc_mode != VPX_Q) && (rc->baseline_gf_interval > 1)) { - const int vbr_group_bits_per_frame = - (int)(gf_group_bits / rc->baseline_gf_interval); - const double group_av_err = gf_group_raw_error / rc->baseline_gf_interval; - int tmp_q; - // rc factor is a weight factor that corrects for local rate control drift. - double rc_factor = 1.0; - if (rc->rate_error_estimate > 0) { - rc_factor = MAX(RC_FACTOR_MIN, - (double)(100 - rc->rate_error_estimate) / 100.0); - } else { - rc_factor = MIN(RC_FACTOR_MAX, - (double)(100 - rc->rate_error_estimate) / 100.0); - } - tmp_q = - get_twopass_worst_quality(cpi, group_av_err, vbr_group_bits_per_frame, - twopass->kfgroup_inter_fraction * rc_factor); - twopass->active_worst_quality = - MAX(tmp_q, twopass->active_worst_quality >> 1); - } -#endif - - // Calculate the extra bits to be used for boosted frame(s) - gf_arf_bits = calculate_boost_bits(rc->baseline_gf_interval, - rc->gfu_boost, gf_group_bits); - - // Adjust KF group bits and error remaining. - twopass->kf_group_error_left -= (int64_t)gf_group_err; - - // If this is an arf update we want to remove the score for the overlay - // frame at the end which will usually be very cheap to code. - // The overlay frame has already, in effect, been coded so we want to spread - // the remaining bits among the other frames. - // For normal GFs remove the score for the GF itself unless this is - // also a key frame in which case it has already been accounted for. - if (rc->source_alt_ref_pending) { - gf_group_error_left = gf_group_err - mod_frame_err; - } else if (is_key_frame == 0) { - gf_group_error_left = gf_group_err - gf_first_frame_err; - } else { - gf_group_error_left = gf_group_err; - } - - // Allocate bits to each of the frames in the GF group. - allocate_gf_group_bits(cpi, gf_group_bits, gf_group_error_left, gf_arf_bits); - - // Reset the file position. - reset_fpf_position(twopass, start_pos); - - // Calculate a section intra ratio used in setting max loop filter. - if (cpi->common.frame_type != KEY_FRAME) { - twopass->section_intra_rating = - calculate_section_intra_ratio(start_pos, twopass->stats_in_end, - rc->baseline_gf_interval); - } - - if (oxcf->resize_mode == RESIZE_DYNAMIC) { - // Default to starting GF groups at normal frame size. - cpi->rc.next_frame_size_selector = UNSCALED; - } -} - -// TODO(PGW) Re-examine the use of II ration in this code in the light of# -// changes elsewhere -#define KF_II_MAX 128.0 -static int test_candidate_kf(TWO_PASS *twopass, - const FIRSTPASS_STATS *last_frame, - const FIRSTPASS_STATS *this_frame, - const FIRSTPASS_STATS *next_frame) { - int is_viable_kf = 0; - - // Does the frame satisfy the primary criteria of a key frame? - // If so, then examine how well it predicts subsequent frames. - if ((this_frame->pcnt_second_ref < 0.10) && - (next_frame->pcnt_second_ref < 0.10) && - ((this_frame->pcnt_inter < 0.05) || - (((this_frame->pcnt_inter - this_frame->pcnt_neutral) < 0.35) && - ((this_frame->intra_error / - DOUBLE_DIVIDE_CHECK(this_frame->coded_error)) < 2.5) && - ((fabs(last_frame->coded_error - this_frame->coded_error) / - DOUBLE_DIVIDE_CHECK(this_frame->coded_error) > 0.40) || - (fabs(last_frame->intra_error - this_frame->intra_error) / - DOUBLE_DIVIDE_CHECK(this_frame->intra_error) > 0.40) || - ((next_frame->intra_error / - DOUBLE_DIVIDE_CHECK(next_frame->coded_error)) > 3.5))))) { - int i; - const FIRSTPASS_STATS *start_pos = twopass->stats_in; - FIRSTPASS_STATS local_next_frame = *next_frame; - double boost_score = 0.0; - double old_boost_score = 0.0; - double decay_accumulator = 1.0; - - // Examine how well the key frame predicts subsequent frames. - for (i = 0; i < 16; ++i) { - double next_iiratio = (BOOST_FACTOR * local_next_frame.intra_error / - DOUBLE_DIVIDE_CHECK(local_next_frame.coded_error)); - - if (next_iiratio > KF_II_MAX) - next_iiratio = KF_II_MAX; - - // Cumulative effect of decay in prediction quality. - if (local_next_frame.pcnt_inter > 0.85) - decay_accumulator *= local_next_frame.pcnt_inter; - else - decay_accumulator *= (0.85 + local_next_frame.pcnt_inter) / 2.0; - - // Keep a running total. - boost_score += (decay_accumulator * next_iiratio); - - // Test various breakout clauses. - if ((local_next_frame.pcnt_inter < 0.05) || - (next_iiratio < 1.5) || - (((local_next_frame.pcnt_inter - - local_next_frame.pcnt_neutral) < 0.20) && - (next_iiratio < 3.0)) || - ((boost_score - old_boost_score) < 3.0) || - (local_next_frame.intra_error < 200)) { - break; - } - - old_boost_score = boost_score; - - // Get the next frame details - if (EOF == input_stats(twopass, &local_next_frame)) - break; - } - - // If there is tolerable prediction for at least the next 3 frames then - // break out else discard this potential key frame and move on - if (boost_score > 30.0 && (i > 3)) { - is_viable_kf = 1; - } else { - // Reset the file position - reset_fpf_position(twopass, start_pos); - - is_viable_kf = 0; - } - } - - return is_viable_kf; -} - -static void find_next_key_frame(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { - int i, j; - RATE_CONTROL *const rc = &cpi->rc; - TWO_PASS *const twopass = &cpi->twopass; - GF_GROUP *const gf_group = &twopass->gf_group; - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - const FIRSTPASS_STATS first_frame = *this_frame; - const FIRSTPASS_STATS *const start_position = twopass->stats_in; - FIRSTPASS_STATS next_frame; - FIRSTPASS_STATS last_frame; - int kf_bits = 0; - int loop_decay_counter = 0; - double decay_accumulator = 1.0; - double av_decay_accumulator = 0.0; - double zero_motion_accumulator = 1.0; - double boost_score = 0.0; - double kf_mod_err = 0.0; - double kf_group_err = 0.0; - double recent_loop_decay[8] = {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}; - - vp9_zero(next_frame); - - cpi->common.frame_type = KEY_FRAME; - - // Reset the GF group data structures. - vp9_zero(*gf_group); - - // Is this a forced key frame by interval. - rc->this_key_frame_forced = rc->next_key_frame_forced; - - // Clear the alt ref active flag and last group multi arf flags as they - // can never be set for a key frame. - rc->source_alt_ref_active = 0; - cpi->multi_arf_last_grp_enabled = 0; - - // KF is always a GF so clear frames till next gf counter. - rc->frames_till_gf_update_due = 0; - - rc->frames_to_key = 1; - - twopass->kf_group_bits = 0; // Total bits available to kf group - twopass->kf_group_error_left = 0; // Group modified error score. - - kf_mod_err = calculate_modified_err(twopass, oxcf, this_frame); - - // Find the next keyframe. - i = 0; - while (twopass->stats_in < twopass->stats_in_end && - rc->frames_to_key < cpi->oxcf.key_freq) { - // Accumulate kf group error. - kf_group_err += calculate_modified_err(twopass, oxcf, this_frame); - - // Load the next frame's stats. - last_frame = *this_frame; - input_stats(twopass, this_frame); - - // Provided that we are not at the end of the file... - if (cpi->oxcf.auto_key && twopass->stats_in < twopass->stats_in_end) { - double loop_decay_rate; - - // Check for a scene cut. - if (test_candidate_kf(twopass, &last_frame, this_frame, - twopass->stats_in)) - break; - - // How fast is the prediction quality decaying? - loop_decay_rate = get_prediction_decay_rate(cpi, twopass->stats_in); - - // We want to know something about the recent past... rather than - // as used elsewhere where we are concerned with decay in prediction - // quality since the last GF or KF. - recent_loop_decay[i % 8] = loop_decay_rate; - decay_accumulator = 1.0; - for (j = 0; j < 8; ++j) - decay_accumulator *= recent_loop_decay[j]; - - // Special check for transition or high motion followed by a - // static scene. - if (detect_transition_to_still(twopass, i, cpi->oxcf.key_freq - i, - loop_decay_rate, decay_accumulator)) - break; - - // Step on to the next frame. - ++rc->frames_to_key; - - // If we don't have a real key frame within the next two - // key_freq intervals then break out of the loop. - if (rc->frames_to_key >= 2 * cpi->oxcf.key_freq) - break; - } else { - ++rc->frames_to_key; - } - ++i; - } - - // If there is a max kf interval set by the user we must obey it. - // We already breakout of the loop above at 2x max. - // This code centers the extra kf if the actual natural interval - // is between 1x and 2x. - if (cpi->oxcf.auto_key && - rc->frames_to_key > cpi->oxcf.key_freq) { - FIRSTPASS_STATS tmp_frame = first_frame; - - rc->frames_to_key /= 2; - - // Reset to the start of the group. - reset_fpf_position(twopass, start_position); - - kf_group_err = 0.0; - - // Rescan to get the correct error data for the forced kf group. - for (i = 0; i < rc->frames_to_key; ++i) { - kf_group_err += calculate_modified_err(twopass, oxcf, &tmp_frame); - input_stats(twopass, &tmp_frame); - } - rc->next_key_frame_forced = 1; - } else if (twopass->stats_in == twopass->stats_in_end || - rc->frames_to_key >= cpi->oxcf.key_freq) { - rc->next_key_frame_forced = 1; - } else { - rc->next_key_frame_forced = 0; - } - - if (is_two_pass_svc(cpi) && cpi->svc.number_temporal_layers > 1) { - int count = (1 << (cpi->svc.number_temporal_layers - 1)) - 1; - int new_frame_to_key = (rc->frames_to_key + count) & (~count); - int j; - for (j = 0; j < new_frame_to_key - rc->frames_to_key; ++j) { - if (EOF == input_stats(twopass, this_frame)) - break; - kf_group_err += calculate_modified_err(twopass, oxcf, this_frame); - } - rc->frames_to_key = new_frame_to_key; - } - - // Special case for the last key frame of the file. - if (twopass->stats_in >= twopass->stats_in_end) { - // Accumulate kf group error. - kf_group_err += calculate_modified_err(twopass, oxcf, this_frame); - } - - // Calculate the number of bits that should be assigned to the kf group. - if (twopass->bits_left > 0 && twopass->modified_error_left > 0.0) { - // Maximum number of bits for a single normal frame (not key frame). - const int max_bits = frame_max_bits(rc, &cpi->oxcf); - - // Maximum number of bits allocated to the key frame group. - int64_t max_grp_bits; - - // Default allocation based on bits left and relative - // complexity of the section. - twopass->kf_group_bits = (int64_t)(twopass->bits_left * - (kf_group_err / twopass->modified_error_left)); - - // Clip based on maximum per frame rate defined by the user. - max_grp_bits = (int64_t)max_bits * (int64_t)rc->frames_to_key; - if (twopass->kf_group_bits > max_grp_bits) - twopass->kf_group_bits = max_grp_bits; - } else { - twopass->kf_group_bits = 0; - } - twopass->kf_group_bits = MAX(0, twopass->kf_group_bits); - - // Reset the first pass file position. - reset_fpf_position(twopass, start_position); - - // Scan through the kf group collating various stats used to determine - // how many bits to spend on it. - decay_accumulator = 1.0; - boost_score = 0.0; - for (i = 0; i < (rc->frames_to_key - 1); ++i) { - if (EOF == input_stats(twopass, &next_frame)) - break; - - // Monitor for static sections. - zero_motion_accumulator = - MIN(zero_motion_accumulator, - get_zero_motion_factor(cpi, &next_frame)); - - // Not all frames in the group are necessarily used in calculating boost. - if ((i <= rc->max_gf_interval) || - ((i <= (rc->max_gf_interval * 4)) && (decay_accumulator > 0.5))) { - const double frame_boost = - calc_frame_boost(cpi, this_frame, 0, KF_MAX_BOOST); - - // How fast is prediction quality decaying. - if (!detect_flash(twopass, 0)) { - const double loop_decay_rate = - get_prediction_decay_rate(cpi, &next_frame); - decay_accumulator *= loop_decay_rate; - decay_accumulator = MAX(decay_accumulator, MIN_DECAY_FACTOR); - av_decay_accumulator += decay_accumulator; - ++loop_decay_counter; - } - boost_score += (decay_accumulator * frame_boost); - } - } - av_decay_accumulator /= (double)loop_decay_counter; - - reset_fpf_position(twopass, start_position); - - // Store the zero motion percentage - twopass->kf_zeromotion_pct = (int)(zero_motion_accumulator * 100.0); - - // Calculate a section intra ratio used in setting max loop filter. - twopass->section_intra_rating = - calculate_section_intra_ratio(start_position, twopass->stats_in_end, - rc->frames_to_key); - - // Apply various clamps for min and max boost - rc->kf_boost = (int)(av_decay_accumulator * boost_score); - rc->kf_boost = MAX(rc->kf_boost, (rc->frames_to_key * 3)); - rc->kf_boost = MAX(rc->kf_boost, MIN_KF_BOOST); - - // Work out how many bits to allocate for the key frame itself. - kf_bits = calculate_boost_bits((rc->frames_to_key - 1), - rc->kf_boost, twopass->kf_group_bits); - - // Work out the fraction of the kf group bits reserved for the inter frames - // within the group after discounting the bits for the kf itself. - if (twopass->kf_group_bits) { - twopass->kfgroup_inter_fraction = - (double)(twopass->kf_group_bits - kf_bits) / - (double)twopass->kf_group_bits; - } else { - twopass->kfgroup_inter_fraction = 1.0; - } - - twopass->kf_group_bits -= kf_bits; - - // Save the bits to spend on the key frame. - gf_group->bit_allocation[0] = kf_bits; - gf_group->update_type[0] = KF_UPDATE; - gf_group->rf_level[0] = KF_STD; - - // Note the total error score of the kf group minus the key frame itself. - twopass->kf_group_error_left = (int)(kf_group_err - kf_mod_err); - - // Adjust the count of total modified error left. - // The count of bits left is adjusted elsewhere based on real coded frame - // sizes. - twopass->modified_error_left -= kf_group_err; - - if (oxcf->resize_mode == RESIZE_DYNAMIC) { - // Default to normal-sized frame on keyframes. - cpi->rc.next_frame_size_selector = UNSCALED; - } -} - -// Define the reference buffers that will be updated post encode. -void configure_buffer_updates(VP9_COMP *cpi) { - TWO_PASS *const twopass = &cpi->twopass; - - cpi->rc.is_src_frame_alt_ref = 0; - switch (twopass->gf_group.update_type[twopass->gf_group.index]) { - case KF_UPDATE: - cpi->refresh_last_frame = 1; - cpi->refresh_golden_frame = 1; - cpi->refresh_alt_ref_frame = 1; - break; - case LF_UPDATE: - cpi->refresh_last_frame = 1; - cpi->refresh_golden_frame = 0; - cpi->refresh_alt_ref_frame = 0; - break; - case GF_UPDATE: - cpi->refresh_last_frame = 1; - cpi->refresh_golden_frame = 1; - cpi->refresh_alt_ref_frame = 0; - break; - case OVERLAY_UPDATE: - cpi->refresh_last_frame = 0; - cpi->refresh_golden_frame = 1; - cpi->refresh_alt_ref_frame = 0; - cpi->rc.is_src_frame_alt_ref = 1; - break; - case ARF_UPDATE: - cpi->refresh_last_frame = 0; - cpi->refresh_golden_frame = 0; - cpi->refresh_alt_ref_frame = 1; - break; - default: - assert(0); - break; - } - if (is_two_pass_svc(cpi)) { - if (cpi->svc.temporal_layer_id > 0) { - cpi->refresh_last_frame = 0; - cpi->refresh_golden_frame = 0; - } - if (cpi->svc.layer_context[cpi->svc.spatial_layer_id].gold_ref_idx < 0) - cpi->refresh_golden_frame = 0; - if (cpi->alt_ref_source == NULL) - cpi->refresh_alt_ref_frame = 0; - } -} - -int is_skippable_frame(const VP9_COMP *cpi) { - // If the current frame does not have non-zero motion vector detected in the - // first pass, and so do its previous and forward frames, then this frame - // can be skipped for partition check, and the partition size is assigned - // according to the variance - const SVC *const svc = &cpi->svc; - const TWO_PASS *const twopass = is_two_pass_svc(cpi) ? - &svc->layer_context[svc->spatial_layer_id].twopass : &cpi->twopass; - - return (!frame_is_intra_only(&cpi->common) && - twopass->stats_in - 2 > twopass->stats_in_start && - twopass->stats_in < twopass->stats_in_end && - (twopass->stats_in - 1)->pcnt_inter - (twopass->stats_in - 1)->pcnt_motion - == 1 && - (twopass->stats_in - 2)->pcnt_inter - (twopass->stats_in - 2)->pcnt_motion - == 1 && - twopass->stats_in->pcnt_inter - twopass->stats_in->pcnt_motion == 1); -} - -void vp9_rc_get_second_pass_params(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - RATE_CONTROL *const rc = &cpi->rc; - TWO_PASS *const twopass = &cpi->twopass; - GF_GROUP *const gf_group = &twopass->gf_group; - int frames_left; - FIRSTPASS_STATS this_frame; - - int target_rate; - LAYER_CONTEXT *const lc = is_two_pass_svc(cpi) ? - &cpi->svc.layer_context[cpi->svc.spatial_layer_id] : 0; - - if (lc != NULL) { - frames_left = (int)(twopass->total_stats.count - - lc->current_video_frame_in_layer); - } else { - frames_left = (int)(twopass->total_stats.count - - cm->current_video_frame); - } - - if (!twopass->stats_in) - return; - - // If this is an arf frame then we dont want to read the stats file or - // advance the input pointer as we already have what we need. - if (gf_group->update_type[gf_group->index] == ARF_UPDATE) { - int target_rate; - configure_buffer_updates(cpi); - target_rate = gf_group->bit_allocation[gf_group->index]; - target_rate = vp9_rc_clamp_pframe_target_size(cpi, target_rate); - rc->base_frame_target = target_rate; - - cm->frame_type = INTER_FRAME; - - if (lc != NULL) { - if (cpi->svc.spatial_layer_id == 0) { - lc->is_key_frame = 0; - } else { - lc->is_key_frame = cpi->svc.layer_context[0].is_key_frame; - - if (lc->is_key_frame) - cpi->ref_frame_flags &= (~VP9_LAST_FLAG); - } - } - - // Do the firstpass stats indicate that this frame is skippable for the - // partition search? - if (cpi->sf.allow_partition_search_skip && - cpi->oxcf.pass == 2 && (!cpi->use_svc || is_two_pass_svc(cpi))) { - cpi->partition_search_skippable_frame = is_skippable_frame(cpi); - } - - return; - } - - vp9_clear_system_state(); - - if (cpi->oxcf.rc_mode == VPX_Q) { - twopass->active_worst_quality = cpi->oxcf.cq_level; - } else if (cm->current_video_frame == 0 || - (lc != NULL && lc->current_video_frame_in_layer == 0)) { - // Special case code for first frame. - const int section_target_bandwidth = (int)(twopass->bits_left / - frames_left); - const double section_error = - twopass->total_left_stats.coded_error / twopass->total_left_stats.count; - const int tmp_q = - get_twopass_worst_quality(cpi, section_error, - section_target_bandwidth, DEFAULT_GRP_WEIGHT); - - twopass->active_worst_quality = tmp_q; - twopass->baseline_active_worst_quality = tmp_q; - rc->ni_av_qi = tmp_q; - rc->last_q[INTER_FRAME] = tmp_q; - rc->avg_q = vp9_convert_qindex_to_q(tmp_q, cm->bit_depth); - rc->avg_frame_qindex[INTER_FRAME] = tmp_q; - rc->last_q[KEY_FRAME] = (tmp_q + cpi->oxcf.best_allowed_q) / 2; - rc->avg_frame_qindex[KEY_FRAME] = rc->last_q[KEY_FRAME]; - } - vp9_zero(this_frame); - if (EOF == input_stats(twopass, &this_frame)) - return; - - // Keyframe and section processing. - if (rc->frames_to_key == 0 || (cpi->frame_flags & FRAMEFLAGS_KEY)) { - FIRSTPASS_STATS this_frame_copy; - this_frame_copy = this_frame; - // Define next KF group and assign bits to it. - find_next_key_frame(cpi, &this_frame); - this_frame = this_frame_copy; - } else { - cm->frame_type = INTER_FRAME; - } - - if (lc != NULL) { - if (cpi->svc.spatial_layer_id == 0) { - lc->is_key_frame = (cm->frame_type == KEY_FRAME); - if (lc->is_key_frame) { - cpi->ref_frame_flags &= - (~VP9_LAST_FLAG & ~VP9_GOLD_FLAG & ~VP9_ALT_FLAG); - lc->frames_from_key_frame = 0; - // Reset the empty frame resolution since we have a key frame. - cpi->svc.empty_frame_width = cm->width; - cpi->svc.empty_frame_height = cm->height; - } - } else { - cm->frame_type = INTER_FRAME; - lc->is_key_frame = cpi->svc.layer_context[0].is_key_frame; - - if (lc->is_key_frame) { - cpi->ref_frame_flags &= (~VP9_LAST_FLAG); - lc->frames_from_key_frame = 0; - } - } - } - - // Define a new GF/ARF group. (Should always enter here for key frames). - if (rc->frames_till_gf_update_due == 0) { - define_gf_group(cpi, &this_frame); - - rc->frames_till_gf_update_due = rc->baseline_gf_interval; - if (lc != NULL) - cpi->refresh_golden_frame = 1; - -#if ARF_STATS_OUTPUT - { - FILE *fpfile; - fpfile = fopen("arf.stt", "a"); - ++arf_count; - fprintf(fpfile, "%10d %10ld %10d %10d %10ld\n", - cm->current_video_frame, rc->frames_till_gf_update_due, - rc->kf_boost, arf_count, rc->gfu_boost); - - fclose(fpfile); - } -#endif - } - - configure_buffer_updates(cpi); - - // Do the firstpass stats indicate that this frame is skippable for the - // partition search? - if (cpi->sf.allow_partition_search_skip && cpi->oxcf.pass == 2 && - (!cpi->use_svc || is_two_pass_svc(cpi))) { - cpi->partition_search_skippable_frame = is_skippable_frame(cpi); - } - - target_rate = gf_group->bit_allocation[gf_group->index]; - if (cpi->common.frame_type == KEY_FRAME) - target_rate = vp9_rc_clamp_iframe_target_size(cpi, target_rate); - else - target_rate = vp9_rc_clamp_pframe_target_size(cpi, target_rate); - - rc->base_frame_target = target_rate; - - { - const int num_mbs = (cpi->oxcf.resize_mode != RESIZE_NONE) - ? cpi->initial_mbs : cpi->common.MBs; - // The multiplication by 256 reverses a scaling factor of (>> 8) - // applied when combining MB error values for the frame. - twopass->mb_av_energy = - log(((this_frame.intra_error * 256.0) / num_mbs) + 1.0); - } - - // Update the total stats remaining structure. - subtract_stats(&twopass->total_left_stats, &this_frame); -} - -#define MINQ_ADJ_LIMIT 48 -void vp9_twopass_postencode_update(VP9_COMP *cpi) { - TWO_PASS *const twopass = &cpi->twopass; - RATE_CONTROL *const rc = &cpi->rc; - const int bits_used = rc->base_frame_target; - - // VBR correction is done through rc->vbr_bits_off_target. Based on the - // sign of this value, a limited % adjustment is made to the target rate - // of subsequent frames, to try and push it back towards 0. This method - // is designed to prevent extreme behaviour at the end of a clip - // or group of frames. - rc->vbr_bits_off_target += rc->base_frame_target - rc->projected_frame_size; - twopass->bits_left = MAX(twopass->bits_left - bits_used, 0); - - // Calculate the pct rc error. - if (rc->total_actual_bits) { - rc->rate_error_estimate = - (int)((rc->vbr_bits_off_target * 100) / rc->total_actual_bits); - rc->rate_error_estimate = clamp(rc->rate_error_estimate, -100, 100); - } else { - rc->rate_error_estimate = 0; - } - - if (cpi->common.frame_type != KEY_FRAME && - !vp9_is_upper_layer_key_frame(cpi)) { - twopass->kf_group_bits -= bits_used; - twopass->last_kfgroup_zeromotion_pct = twopass->kf_zeromotion_pct; - } - twopass->kf_group_bits = MAX(twopass->kf_group_bits, 0); - - // Increment the gf group index ready for the next frame. - ++twopass->gf_group.index; - - // If the rate control is drifting consider adjustment to min or maxq. - if ((cpi->oxcf.rc_mode != VPX_Q) && - (cpi->twopass.gf_zeromotion_pct < VLOW_MOTION_THRESHOLD) && - !cpi->rc.is_src_frame_alt_ref) { - const int maxq_adj_limit = - rc->worst_quality - twopass->active_worst_quality; - const int minq_adj_limit = - (cpi->oxcf.rc_mode == VPX_CQ) ? 0 : MINQ_ADJ_LIMIT; - - // Undershoot. - if (rc->rate_error_estimate > cpi->oxcf.under_shoot_pct) { - --twopass->extend_maxq; - if (rc->rolling_target_bits >= rc->rolling_actual_bits) - ++twopass->extend_minq; - // Overshoot. - } else if (rc->rate_error_estimate < -cpi->oxcf.over_shoot_pct) { - --twopass->extend_minq; - if (rc->rolling_target_bits < rc->rolling_actual_bits) - ++twopass->extend_maxq; - } else { - // Adjustment for extreme local overshoot. - if (rc->projected_frame_size > (2 * rc->base_frame_target) && - rc->projected_frame_size > (2 * rc->avg_frame_bandwidth)) - ++twopass->extend_maxq; - - // Unwind undershoot or overshoot adjustment. - if (rc->rolling_target_bits < rc->rolling_actual_bits) - --twopass->extend_minq; - else if (rc->rolling_target_bits > rc->rolling_actual_bits) - --twopass->extend_maxq; - } - - twopass->extend_minq = clamp(twopass->extend_minq, 0, minq_adj_limit); - twopass->extend_maxq = clamp(twopass->extend_maxq, 0, maxq_adj_limit); - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_firstpass.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_firstpass.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_firstpass.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_firstpass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_FIRSTPASS_H_ -#define VP9_ENCODER_VP9_FIRSTPASS_H_ - -#include "vp9/encoder/vp9_lookahead.h" -#include "vp9/encoder/vp9_ratectrl.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if CONFIG_FP_MB_STATS - -#define FPMB_DCINTRA_MASK 0x01 - -#define FPMB_MOTION_ZERO_MASK 0x02 -#define FPMB_MOTION_LEFT_MASK 0x04 -#define FPMB_MOTION_RIGHT_MASK 0x08 -#define FPMB_MOTION_UP_MASK 0x10 -#define FPMB_MOTION_DOWN_MASK 0x20 - -#define FPMB_ERROR_SMALL_MASK 0x40 -#define FPMB_ERROR_LARGE_MASK 0x80 -#define FPMB_ERROR_SMALL_TH 2000 -#define FPMB_ERROR_LARGE_TH 48000 - -typedef struct { - uint8_t *mb_stats_start; - uint8_t *mb_stats_end; -} FIRSTPASS_MB_STATS; -#endif - -#define VLOW_MOTION_THRESHOLD 950 - -typedef struct { - double frame; - double weight; - double intra_error; - double coded_error; - double sr_coded_error; - double pcnt_inter; - double pcnt_motion; - double pcnt_second_ref; - double pcnt_neutral; - double MVr; - double mvr_abs; - double MVc; - double mvc_abs; - double MVrv; - double MVcv; - double mv_in_out_count; - double new_mv_count; - double duration; - double count; - int64_t spatial_layer_id; -} FIRSTPASS_STATS; - -typedef enum { - KF_UPDATE = 0, - LF_UPDATE = 1, - GF_UPDATE = 2, - ARF_UPDATE = 3, - OVERLAY_UPDATE = 4, - FRAME_UPDATE_TYPES = 5 -} FRAME_UPDATE_TYPE; - -typedef struct { - unsigned char index; - RATE_FACTOR_LEVEL rf_level[(MAX_LAG_BUFFERS * 2) + 1]; - FRAME_UPDATE_TYPE update_type[(MAX_LAG_BUFFERS * 2) + 1]; - unsigned char arf_src_offset[(MAX_LAG_BUFFERS * 2) + 1]; - unsigned char arf_update_idx[(MAX_LAG_BUFFERS * 2) + 1]; - unsigned char arf_ref_idx[(MAX_LAG_BUFFERS * 2) + 1]; - int bit_allocation[(MAX_LAG_BUFFERS * 2) + 1]; -} GF_GROUP; - -typedef struct { - unsigned int section_intra_rating; - FIRSTPASS_STATS total_stats; - FIRSTPASS_STATS this_frame_stats; - const FIRSTPASS_STATS *stats_in; - const FIRSTPASS_STATS *stats_in_start; - const FIRSTPASS_STATS *stats_in_end; - FIRSTPASS_STATS total_left_stats; - int first_pass_done; - int64_t bits_left; - double modified_error_min; - double modified_error_max; - double modified_error_left; - double mb_av_energy; - -#if CONFIG_FP_MB_STATS - uint8_t *frame_mb_stats_buf; - uint8_t *this_frame_mb_stats; - FIRSTPASS_MB_STATS firstpass_mb_stats; -#endif - - // Projected total bits available for a key frame group of frames - int64_t kf_group_bits; - - // Error score of frames still to be coded in kf group - int64_t kf_group_error_left; - - // The fraction for a kf groups total bits allocated to the inter frames - double kfgroup_inter_fraction; - - int sr_update_lag; - - int kf_zeromotion_pct; - int last_kfgroup_zeromotion_pct; - int gf_zeromotion_pct; - int active_worst_quality; - int baseline_active_worst_quality; - int extend_minq; - int extend_maxq; - - GF_GROUP gf_group; -} TWO_PASS; - -struct VP9_COMP; - -void vp9_init_first_pass(struct VP9_COMP *cpi); -void vp9_rc_get_first_pass_params(struct VP9_COMP *cpi); -void vp9_first_pass(struct VP9_COMP *cpi, const struct lookahead_entry *source); -void vp9_end_first_pass(struct VP9_COMP *cpi); - -void vp9_init_second_pass(struct VP9_COMP *cpi); -void vp9_rc_get_second_pass_params(struct VP9_COMP *cpi); - -// Post encode update of the rate control parameters for 2-pass -void vp9_twopass_postencode_update(struct VP9_COMP *cpi); - -void vp9_init_subsampling(struct VP9_COMP *cpi); - -void calculate_coded_size(struct VP9_COMP *cpi, - int *scaled_frame_width, - int *scaled_frame_height); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_FIRSTPASS_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_lookahead.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_lookahead.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_lookahead.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_lookahead.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,245 +0,0 @@ -/* - * Copyright (c) 2011 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#include -#include - -#include "./vpx_config.h" - -#include "vp9/common/vp9_common.h" - -#include "vp9/encoder/vp9_encoder.h" -#include "vp9/encoder/vp9_extend.h" -#include "vp9/encoder/vp9_lookahead.h" - -/* Return the buffer at the given absolute index and increment the index */ -static struct lookahead_entry *pop(struct lookahead_ctx *ctx, - unsigned int *idx) { - unsigned int index = *idx; - struct lookahead_entry *buf = ctx->buf + index; - - assert(index < ctx->max_sz); - if (++index >= ctx->max_sz) - index -= ctx->max_sz; - *idx = index; - return buf; -} - - -void vp9_lookahead_destroy(struct lookahead_ctx *ctx) { - if (ctx) { - if (ctx->buf) { - unsigned int i; - - for (i = 0; i < ctx->max_sz; i++) - vp9_free_frame_buffer(&ctx->buf[i].img); - free(ctx->buf); - } - free(ctx); - } -} - - -struct lookahead_ctx *vp9_lookahead_init(unsigned int width, - unsigned int height, - unsigned int subsampling_x, - unsigned int subsampling_y, -#if CONFIG_VP9_HIGHBITDEPTH - int use_highbitdepth, -#endif - unsigned int depth) { - struct lookahead_ctx *ctx = NULL; - - // Clamp the lookahead queue depth - depth = clamp(depth, 1, MAX_LAG_BUFFERS); - - // Allocate memory to keep previous source frames available. - depth += MAX_PRE_FRAMES; - - // Allocate the lookahead structures - ctx = calloc(1, sizeof(*ctx)); - if (ctx) { - const int legacy_byte_alignment = 0; - unsigned int i; - ctx->max_sz = depth; - ctx->buf = calloc(depth, sizeof(*ctx->buf)); - if (!ctx->buf) - goto bail; - for (i = 0; i < depth; i++) - if (vp9_alloc_frame_buffer(&ctx->buf[i].img, - width, height, subsampling_x, subsampling_y, -#if CONFIG_VP9_HIGHBITDEPTH - use_highbitdepth, -#endif - VP9_ENC_BORDER_IN_PIXELS, - legacy_byte_alignment)) - goto bail; - } - return ctx; - bail: - vp9_lookahead_destroy(ctx); - return NULL; -} - -#define USE_PARTIAL_COPY 0 - -int vp9_lookahead_push(struct lookahead_ctx *ctx, YV12_BUFFER_CONFIG *src, - int64_t ts_start, int64_t ts_end, -#if CONFIG_VP9_HIGHBITDEPTH - int use_highbitdepth, -#endif - unsigned int flags) { - struct lookahead_entry *buf; -#if USE_PARTIAL_COPY - int row, col, active_end; - int mb_rows = (src->y_height + 15) >> 4; - int mb_cols = (src->y_width + 15) >> 4; -#endif - int width = src->y_crop_width; - int height = src->y_crop_height; - int uv_width = src->uv_crop_width; - int uv_height = src->uv_crop_height; - int subsampling_x = src->subsampling_x; - int subsampling_y = src->subsampling_y; - int larger_dimensions, new_dimensions; - - if (ctx->sz + 1 + MAX_PRE_FRAMES > ctx->max_sz) - return 1; - ctx->sz++; - buf = pop(ctx, &ctx->write_idx); - - new_dimensions = width != buf->img.y_crop_width || - height != buf->img.y_crop_height || - uv_width != buf->img.uv_crop_width || - uv_height != buf->img.uv_crop_height; - larger_dimensions = width > buf->img.y_width || - height > buf->img.y_height || - uv_width > buf->img.uv_width || - uv_height > buf->img.uv_height; - assert(!larger_dimensions || new_dimensions); - -#if USE_PARTIAL_COPY - // TODO(jkoleszar): This is disabled for now, as - // vp9_copy_and_extend_frame_with_rect is not subsampling/alpha aware. - - // Only do this partial copy if the following conditions are all met: - // 1. Lookahead queue has has size of 1. - // 2. Active map is provided. - // 3. This is not a key frame, golden nor altref frame. - if (!new_dimensions && ctx->max_sz == 1 && active_map && !flags) { - for (row = 0; row < mb_rows; ++row) { - col = 0; - - while (1) { - // Find the first active macroblock in this row. - for (; col < mb_cols; ++col) { - if (active_map[col]) - break; - } - - // No more active macroblock in this row. - if (col == mb_cols) - break; - - // Find the end of active region in this row. - active_end = col; - - for (; active_end < mb_cols; ++active_end) { - if (!active_map[active_end]) - break; - } - - // Only copy this active region. - vp9_copy_and_extend_frame_with_rect(src, &buf->img, - row << 4, - col << 4, 16, - (active_end - col) << 4); - - // Start again from the end of this active region. - col = active_end; - } - - active_map += mb_cols; - } - } else { -#endif - if (larger_dimensions) { - YV12_BUFFER_CONFIG new_img; - memset(&new_img, 0, sizeof(new_img)); - if (vp9_alloc_frame_buffer(&new_img, - width, height, subsampling_x, subsampling_y, -#if CONFIG_VP9_HIGHBITDEPTH - use_highbitdepth, -#endif - VP9_ENC_BORDER_IN_PIXELS, - 0)) - return 1; - vp9_free_frame_buffer(&buf->img); - buf->img = new_img; - } else if (new_dimensions) { - buf->img.y_crop_width = src->y_crop_width; - buf->img.y_crop_height = src->y_crop_height; - buf->img.uv_crop_width = src->uv_crop_width; - buf->img.uv_crop_height = src->uv_crop_height; - buf->img.subsampling_x = src->subsampling_x; - buf->img.subsampling_y = src->subsampling_y; - } - // Partial copy not implemented yet - vp9_copy_and_extend_frame(src, &buf->img); -#if USE_PARTIAL_COPY - } -#endif - - buf->ts_start = ts_start; - buf->ts_end = ts_end; - buf->flags = flags; - return 0; -} - - -struct lookahead_entry *vp9_lookahead_pop(struct lookahead_ctx *ctx, - int drain) { - struct lookahead_entry *buf = NULL; - - if (ctx->sz && (drain || ctx->sz == ctx->max_sz - MAX_PRE_FRAMES)) { - buf = pop(ctx, &ctx->read_idx); - ctx->sz--; - } - return buf; -} - - -struct lookahead_entry *vp9_lookahead_peek(struct lookahead_ctx *ctx, - int index) { - struct lookahead_entry *buf = NULL; - - if (index >= 0) { - // Forward peek - if (index < (int)ctx->sz) { - index += ctx->read_idx; - if (index >= (int)ctx->max_sz) - index -= ctx->max_sz; - buf = ctx->buf + index; - } - } else if (index < 0) { - // Backward peek - if (-index <= MAX_PRE_FRAMES) { - index += ctx->read_idx; - if (index < 0) - index += ctx->max_sz; - buf = ctx->buf + index; - } - } - - return buf; -} - -unsigned int vp9_lookahead_depth(struct lookahead_ctx *ctx) { - return ctx->sz; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_lookahead.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_lookahead.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_lookahead.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_lookahead.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2011 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_LOOKAHEAD_H_ -#define VP9_ENCODER_VP9_LOOKAHEAD_H_ - -#include "vpx_scale/yv12config.h" -#include "vpx/vpx_integer.h" - -#if CONFIG_SPATIAL_SVC -#include "vpx/vp8cx.h" -#include "vpx/vpx_encoder.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#define MAX_LAG_BUFFERS 25 - -struct lookahead_entry { - YV12_BUFFER_CONFIG img; - int64_t ts_start; - int64_t ts_end; - unsigned int flags; -}; - -// The max of past frames we want to keep in the queue. -#define MAX_PRE_FRAMES 1 - -struct lookahead_ctx { - unsigned int max_sz; /* Absolute size of the queue */ - unsigned int sz; /* Number of buffers currently in the queue */ - unsigned int read_idx; /* Read index */ - unsigned int write_idx; /* Write index */ - struct lookahead_entry *buf; /* Buffer list */ -}; - -/**\brief Initializes the lookahead stage - * - * The lookahead stage is a queue of frame buffers on which some analysis - * may be done when buffers are enqueued. - */ -struct lookahead_ctx *vp9_lookahead_init(unsigned int width, - unsigned int height, - unsigned int subsampling_x, - unsigned int subsampling_y, -#if CONFIG_VP9_HIGHBITDEPTH - int use_highbitdepth, -#endif - unsigned int depth); - - -/**\brief Destroys the lookahead stage - */ -void vp9_lookahead_destroy(struct lookahead_ctx *ctx); - - -/**\brief Enqueue a source buffer - * - * This function will copy the source image into a new framebuffer with - * the expected stride/border. - * - * If active_map is non-NULL and there is only one frame in the queue, then copy - * only active macroblocks. - * - * \param[in] ctx Pointer to the lookahead context - * \param[in] src Pointer to the image to enqueue - * \param[in] ts_start Timestamp for the start of this frame - * \param[in] ts_end Timestamp for the end of this frame - * \param[in] flags Flags set on this frame - * \param[in] active_map Map that specifies which macroblock is active - */ -int vp9_lookahead_push(struct lookahead_ctx *ctx, YV12_BUFFER_CONFIG *src, - int64_t ts_start, int64_t ts_end, -#if CONFIG_VP9_HIGHBITDEPTH - int use_highbitdepth, -#endif - unsigned int flags); - - -/**\brief Get the next source buffer to encode - * - * - * \param[in] ctx Pointer to the lookahead context - * \param[in] drain Flag indicating the buffer should be drained - * (return a buffer regardless of the current queue depth) - * - * \retval NULL, if drain set and queue is empty - * \retval NULL, if drain not set and queue not of the configured depth - */ -struct lookahead_entry *vp9_lookahead_pop(struct lookahead_ctx *ctx, - int drain); - - -/**\brief Get a future source buffer to encode - * - * \param[in] ctx Pointer to the lookahead context - * \param[in] index Index of the frame to be returned, 0 == next frame - * - * \retval NULL, if no buffer exists at the specified index - */ -struct lookahead_entry *vp9_lookahead_peek(struct lookahead_ctx *ctx, - int index); - - -/**\brief Get the number of frames currently in the lookahead queue - * - * \param[in] ctx Pointer to the lookahead context - */ -unsigned int vp9_lookahead_depth(struct lookahead_ctx *ctx); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_LOOKAHEAD_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_mbgraph.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_mbgraph.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_mbgraph.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_mbgraph.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,414 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "vpx_mem/vpx_mem.h" -#include "vp9/encoder/vp9_segmentation.h" -#include "vp9/encoder/vp9_mcomp.h" -#include "vp9/common/vp9_blockd.h" -#include "vp9/common/vp9_reconinter.h" -#include "vp9/common/vp9_reconintra.h" -#include "vp9/common/vp9_systemdependent.h" - - -static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi, - const MV *ref_mv, - MV *dst_mv, - int mb_row, - int mb_col) { - MACROBLOCK *const x = &cpi->td.mb; - MACROBLOCKD *const xd = &x->e_mbd; - const MV_SPEED_FEATURES *const mv_sf = &cpi->sf.mv; - const vp9_variance_fn_ptr_t v_fn_ptr = cpi->fn_ptr[BLOCK_16X16]; - - const int tmp_col_min = x->mv_col_min; - const int tmp_col_max = x->mv_col_max; - const int tmp_row_min = x->mv_row_min; - const int tmp_row_max = x->mv_row_max; - MV ref_full; - int cost_list[5]; - - // Further step/diamond searches as necessary - int step_param = mv_sf->reduce_first_step_size; - step_param = MIN(step_param, MAX_MVSEARCH_STEPS - 2); - - vp9_set_mv_search_range(x, ref_mv); - - ref_full.col = ref_mv->col >> 3; - ref_full.row = ref_mv->row >> 3; - - /*cpi->sf.search_method == HEX*/ - vp9_hex_search(x, &ref_full, step_param, x->errorperbit, 0, - cond_cost_list(cpi, cost_list), - &v_fn_ptr, 0, ref_mv, dst_mv); - - // Try sub-pixel MC - // if (bestsme > error_thresh && bestsme < INT_MAX) - { - int distortion; - unsigned int sse; - cpi->find_fractional_mv_step( - x, dst_mv, ref_mv, cpi->common.allow_high_precision_mv, x->errorperbit, - &v_fn_ptr, 0, mv_sf->subpel_iters_per_step, - cond_cost_list(cpi, cost_list), - NULL, NULL, - &distortion, &sse, NULL, 0, 0); - } - - xd->mi[0].src_mi->mbmi.mode = NEWMV; - xd->mi[0].src_mi->mbmi.mv[0].as_mv = *dst_mv; - - vp9_build_inter_predictors_sby(xd, mb_row, mb_col, BLOCK_16X16); - - /* restore UMV window */ - x->mv_col_min = tmp_col_min; - x->mv_col_max = tmp_col_max; - x->mv_row_min = tmp_row_min; - x->mv_row_max = tmp_row_max; - - return vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride, - xd->plane[0].dst.buf, xd->plane[0].dst.stride); -} - -static int do_16x16_motion_search(VP9_COMP *cpi, const MV *ref_mv, - int_mv *dst_mv, int mb_row, int mb_col) { - MACROBLOCK *const x = &cpi->td.mb; - MACROBLOCKD *const xd = &x->e_mbd; - unsigned int err, tmp_err; - MV tmp_mv; - - // Try zero MV first - // FIXME should really use something like near/nearest MV and/or MV prediction - err = vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride, - xd->plane[0].pre[0].buf, xd->plane[0].pre[0].stride); - dst_mv->as_int = 0; - - // Test last reference frame using the previous best mv as the - // starting point (best reference) for the search - tmp_err = do_16x16_motion_iteration(cpi, ref_mv, &tmp_mv, mb_row, mb_col); - if (tmp_err < err) { - err = tmp_err; - dst_mv->as_mv = tmp_mv; - } - - // If the current best reference mv is not centered on 0,0 then do a 0,0 - // based search as well. - if (ref_mv->row != 0 || ref_mv->col != 0) { - unsigned int tmp_err; - MV zero_ref_mv = {0, 0}, tmp_mv; - - tmp_err = do_16x16_motion_iteration(cpi, &zero_ref_mv, &tmp_mv, - mb_row, mb_col); - if (tmp_err < err) { - dst_mv->as_mv = tmp_mv; - err = tmp_err; - } - } - - return err; -} - -static int do_16x16_zerozero_search(VP9_COMP *cpi, int_mv *dst_mv) { - MACROBLOCK *const x = &cpi->td.mb; - MACROBLOCKD *const xd = &x->e_mbd; - unsigned int err; - - // Try zero MV first - // FIXME should really use something like near/nearest MV and/or MV prediction - err = vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride, - xd->plane[0].pre[0].buf, xd->plane[0].pre[0].stride); - - dst_mv->as_int = 0; - - return err; -} -static int find_best_16x16_intra(VP9_COMP *cpi, PREDICTION_MODE *pbest_mode) { - MACROBLOCK *const x = &cpi->td.mb; - MACROBLOCKD *const xd = &x->e_mbd; - PREDICTION_MODE best_mode = -1, mode; - unsigned int best_err = INT_MAX; - - // calculate SATD for each intra prediction mode; - // we're intentionally not doing 4x4, we just want a rough estimate - for (mode = DC_PRED; mode <= TM_PRED; mode++) { - unsigned int err; - - xd->mi[0].src_mi->mbmi.mode = mode; - vp9_predict_intra_block(xd, 0, 2, TX_16X16, mode, - x->plane[0].src.buf, x->plane[0].src.stride, - xd->plane[0].dst.buf, xd->plane[0].dst.stride, - 0, 0, 0); - err = vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride, - xd->plane[0].dst.buf, xd->plane[0].dst.stride); - - // find best - if (err < best_err) { - best_err = err; - best_mode = mode; - } - } - - if (pbest_mode) - *pbest_mode = best_mode; - - return best_err; -} - -static void update_mbgraph_mb_stats -( - VP9_COMP *cpi, - MBGRAPH_MB_STATS *stats, - YV12_BUFFER_CONFIG *buf, - int mb_y_offset, - YV12_BUFFER_CONFIG *golden_ref, - const MV *prev_golden_ref_mv, - YV12_BUFFER_CONFIG *alt_ref, - int mb_row, - int mb_col -) { - MACROBLOCK *const x = &cpi->td.mb; - MACROBLOCKD *const xd = &x->e_mbd; - int intra_error; - VP9_COMMON *cm = &cpi->common; - - // FIXME in practice we're completely ignoring chroma here - x->plane[0].src.buf = buf->y_buffer + mb_y_offset; - x->plane[0].src.stride = buf->y_stride; - - xd->plane[0].dst.buf = get_frame_new_buffer(cm)->y_buffer + mb_y_offset; - xd->plane[0].dst.stride = get_frame_new_buffer(cm)->y_stride; - - // do intra 16x16 prediction - intra_error = find_best_16x16_intra(cpi, - &stats->ref[INTRA_FRAME].m.mode); - if (intra_error <= 0) - intra_error = 1; - stats->ref[INTRA_FRAME].err = intra_error; - - // Golden frame MV search, if it exists and is different than last frame - if (golden_ref) { - int g_motion_error; - xd->plane[0].pre[0].buf = golden_ref->y_buffer + mb_y_offset; - xd->plane[0].pre[0].stride = golden_ref->y_stride; - g_motion_error = do_16x16_motion_search(cpi, - prev_golden_ref_mv, - &stats->ref[GOLDEN_FRAME].m.mv, - mb_row, mb_col); - stats->ref[GOLDEN_FRAME].err = g_motion_error; - } else { - stats->ref[GOLDEN_FRAME].err = INT_MAX; - stats->ref[GOLDEN_FRAME].m.mv.as_int = 0; - } - - // Do an Alt-ref frame MV search, if it exists and is different than - // last/golden frame. - if (alt_ref) { - int a_motion_error; - xd->plane[0].pre[0].buf = alt_ref->y_buffer + mb_y_offset; - xd->plane[0].pre[0].stride = alt_ref->y_stride; - a_motion_error = do_16x16_zerozero_search(cpi, - &stats->ref[ALTREF_FRAME].m.mv); - - stats->ref[ALTREF_FRAME].err = a_motion_error; - } else { - stats->ref[ALTREF_FRAME].err = INT_MAX; - stats->ref[ALTREF_FRAME].m.mv.as_int = 0; - } -} - -static void update_mbgraph_frame_stats(VP9_COMP *cpi, - MBGRAPH_FRAME_STATS *stats, - YV12_BUFFER_CONFIG *buf, - YV12_BUFFER_CONFIG *golden_ref, - YV12_BUFFER_CONFIG *alt_ref) { - MACROBLOCK *const x = &cpi->td.mb; - MACROBLOCKD *const xd = &x->e_mbd; - VP9_COMMON *const cm = &cpi->common; - - int mb_col, mb_row, offset = 0; - int mb_y_offset = 0, arf_y_offset = 0, gld_y_offset = 0; - MV gld_top_mv = {0, 0}; - MODE_INFO mi_local; - - vp9_zero(mi_local); - // Set up limit values for motion vectors to prevent them extending outside - // the UMV borders. - x->mv_row_min = -BORDER_MV_PIXELS_B16; - x->mv_row_max = (cm->mb_rows - 1) * 8 + BORDER_MV_PIXELS_B16; - xd->up_available = 0; - xd->plane[0].dst.stride = buf->y_stride; - xd->plane[0].pre[0].stride = buf->y_stride; - xd->plane[1].dst.stride = buf->uv_stride; - xd->mi[0].src_mi = &mi_local; - mi_local.mbmi.sb_type = BLOCK_16X16; - mi_local.mbmi.ref_frame[0] = LAST_FRAME; - mi_local.mbmi.ref_frame[1] = NONE; - - for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) { - MV gld_left_mv = gld_top_mv; - int mb_y_in_offset = mb_y_offset; - int arf_y_in_offset = arf_y_offset; - int gld_y_in_offset = gld_y_offset; - - // Set up limit values for motion vectors to prevent them extending outside - // the UMV borders. - x->mv_col_min = -BORDER_MV_PIXELS_B16; - x->mv_col_max = (cm->mb_cols - 1) * 8 + BORDER_MV_PIXELS_B16; - xd->left_available = 0; - - for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) { - MBGRAPH_MB_STATS *mb_stats = &stats->mb_stats[offset + mb_col]; - - update_mbgraph_mb_stats(cpi, mb_stats, buf, mb_y_in_offset, - golden_ref, &gld_left_mv, alt_ref, - mb_row, mb_col); - gld_left_mv = mb_stats->ref[GOLDEN_FRAME].m.mv.as_mv; - if (mb_col == 0) { - gld_top_mv = gld_left_mv; - } - xd->left_available = 1; - mb_y_in_offset += 16; - gld_y_in_offset += 16; - arf_y_in_offset += 16; - x->mv_col_min -= 16; - x->mv_col_max -= 16; - } - xd->up_available = 1; - mb_y_offset += buf->y_stride * 16; - gld_y_offset += golden_ref->y_stride * 16; - if (alt_ref) - arf_y_offset += alt_ref->y_stride * 16; - x->mv_row_min -= 16; - x->mv_row_max -= 16; - offset += cm->mb_cols; - } -} - -// void separate_arf_mbs_byzz -static void separate_arf_mbs(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - int mb_col, mb_row, offset, i; - int mi_row, mi_col; - int ncnt[4] = { 0 }; - int n_frames = cpi->mbgraph_n_frames; - - int *arf_not_zz; - - CHECK_MEM_ERROR(cm, arf_not_zz, - vpx_calloc(cm->mb_rows * cm->mb_cols * sizeof(*arf_not_zz), - 1)); - - // We are not interested in results beyond the alt ref itself. - if (n_frames > cpi->rc.frames_till_gf_update_due) - n_frames = cpi->rc.frames_till_gf_update_due; - - // defer cost to reference frames - for (i = n_frames - 1; i >= 0; i--) { - MBGRAPH_FRAME_STATS *frame_stats = &cpi->mbgraph_stats[i]; - - for (offset = 0, mb_row = 0; mb_row < cm->mb_rows; - offset += cm->mb_cols, mb_row++) { - for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) { - MBGRAPH_MB_STATS *mb_stats = &frame_stats->mb_stats[offset + mb_col]; - - int altref_err = mb_stats->ref[ALTREF_FRAME].err; - int intra_err = mb_stats->ref[INTRA_FRAME ].err; - int golden_err = mb_stats->ref[GOLDEN_FRAME].err; - - // Test for altref vs intra and gf and that its mv was 0,0. - if (altref_err > 1000 || - altref_err > intra_err || - altref_err > golden_err) { - arf_not_zz[offset + mb_col]++; - } - } - } - } - - // arf_not_zz is indexed by MB, but this loop is indexed by MI to avoid out - // of bound access in segmentation_map - for (mi_row = 0; mi_row < cm->mi_rows; mi_row++) { - for (mi_col = 0; mi_col < cm->mi_cols; mi_col++) { - // If any of the blocks in the sequence failed then the MB - // goes in segment 0 - if (arf_not_zz[mi_row / 2 * cm->mb_cols + mi_col / 2]) { - ncnt[0]++; - cpi->segmentation_map[mi_row * cm->mi_cols + mi_col] = 0; - } else { - cpi->segmentation_map[mi_row * cm->mi_cols + mi_col] = 1; - ncnt[1]++; - } - } - } - - // Only bother with segmentation if over 10% of the MBs in static segment - // if ( ncnt[1] && (ncnt[0] / ncnt[1] < 10) ) - if (1) { - // Note % of blocks that are marked as static - if (cm->MBs) - cpi->static_mb_pct = (ncnt[1] * 100) / (cm->mi_rows * cm->mi_cols); - - // This error case should not be reachable as this function should - // never be called with the common data structure uninitialized. - else - cpi->static_mb_pct = 0; - - vp9_enable_segmentation(&cm->seg); - } else { - cpi->static_mb_pct = 0; - vp9_disable_segmentation(&cm->seg); - } - - // Free localy allocated storage - vpx_free(arf_not_zz); -} - -void vp9_update_mbgraph_stats(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - int i, n_frames = vp9_lookahead_depth(cpi->lookahead); - YV12_BUFFER_CONFIG *golden_ref = get_ref_frame_buffer(cpi, GOLDEN_FRAME); - - assert(golden_ref != NULL); - - // we need to look ahead beyond where the ARF transitions into - // being a GF - so exit if we don't look ahead beyond that - if (n_frames <= cpi->rc.frames_till_gf_update_due) - return; - - if (n_frames > MAX_LAG_BUFFERS) - n_frames = MAX_LAG_BUFFERS; - - cpi->mbgraph_n_frames = n_frames; - for (i = 0; i < n_frames; i++) { - MBGRAPH_FRAME_STATS *frame_stats = &cpi->mbgraph_stats[i]; - vpx_memset(frame_stats->mb_stats, 0, - cm->mb_rows * cm->mb_cols * - sizeof(*cpi->mbgraph_stats[i].mb_stats)); - } - - // do motion search to find contribution of each reference to data - // later on in this GF group - // FIXME really, the GF/last MC search should be done forward, and - // the ARF MC search backwards, to get optimal results for MV caching - for (i = 0; i < n_frames; i++) { - MBGRAPH_FRAME_STATS *frame_stats = &cpi->mbgraph_stats[i]; - struct lookahead_entry *q_cur = vp9_lookahead_peek(cpi->lookahead, i); - - assert(q_cur != NULL); - - update_mbgraph_frame_stats(cpi, frame_stats, &q_cur->img, - golden_ref, cpi->Source); - } - - vp9_clear_system_state(); - - separate_arf_mbs(cpi); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_mbgraph.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_mbgraph.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_mbgraph.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_mbgraph.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_MBGRAPH_H_ -#define VP9_ENCODER_VP9_MBGRAPH_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - struct { - int err; - union { - int_mv mv; - PREDICTION_MODE mode; - } m; - } ref[MAX_REF_FRAMES]; -} MBGRAPH_MB_STATS; - -typedef struct { - MBGRAPH_MB_STATS *mb_stats; -} MBGRAPH_FRAME_STATS; - -struct VP9_COMP; - -void vp9_update_mbgraph_stats(struct VP9_COMP *cpi); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_MBGRAPH_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_mcomp.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_mcomp.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_mcomp.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_mcomp.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2327 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include - -#include "./vpx_config.h" - -#include "vpx_mem/vpx_mem.h" - -#include "vp9/common/vp9_common.h" - -#include "vp9/encoder/vp9_encoder.h" -#include "vp9/encoder/vp9_mcomp.h" - -// #define NEW_DIAMOND_SEARCH - -static INLINE const uint8_t *get_buf_from_mv(const struct buf_2d *buf, - const MV *mv) { - return &buf->buf[mv->row * buf->stride + mv->col]; -} - -void vp9_set_mv_search_range(MACROBLOCK *x, const MV *mv) { - int col_min = (mv->col >> 3) - MAX_FULL_PEL_VAL + (mv->col & 7 ? 1 : 0); - int row_min = (mv->row >> 3) - MAX_FULL_PEL_VAL + (mv->row & 7 ? 1 : 0); - int col_max = (mv->col >> 3) + MAX_FULL_PEL_VAL; - int row_max = (mv->row >> 3) + MAX_FULL_PEL_VAL; - - col_min = MAX(col_min, (MV_LOW >> 3) + 1); - row_min = MAX(row_min, (MV_LOW >> 3) + 1); - col_max = MIN(col_max, (MV_UPP >> 3) - 1); - row_max = MIN(row_max, (MV_UPP >> 3) - 1); - - // Get intersection of UMV window and valid MV window to reduce # of checks - // in diamond search. - if (x->mv_col_min < col_min) - x->mv_col_min = col_min; - if (x->mv_col_max > col_max) - x->mv_col_max = col_max; - if (x->mv_row_min < row_min) - x->mv_row_min = row_min; - if (x->mv_row_max > row_max) - x->mv_row_max = row_max; -} - -int vp9_init_search_range(int size) { - int sr = 0; - // Minimum search size no matter what the passed in value. - size = MAX(16, size); - - while ((size << sr) < MAX_FULL_PEL_VAL) - sr++; - - sr = MIN(sr, MAX_MVSEARCH_STEPS - 2); - return sr; -} - -static INLINE int mv_cost(const MV *mv, - const int *joint_cost, int *const comp_cost[2]) { - return joint_cost[vp9_get_mv_joint(mv)] + - comp_cost[0][mv->row] + comp_cost[1][mv->col]; -} - -int vp9_mv_bit_cost(const MV *mv, const MV *ref, - const int *mvjcost, int *mvcost[2], int weight) { - const MV diff = { mv->row - ref->row, - mv->col - ref->col }; - return ROUND_POWER_OF_TWO(mv_cost(&diff, mvjcost, mvcost) * weight, 7); -} - -static int mv_err_cost(const MV *mv, const MV *ref, - const int *mvjcost, int *mvcost[2], - int error_per_bit) { - if (mvcost) { - const MV diff = { mv->row - ref->row, - mv->col - ref->col }; - return ROUND_POWER_OF_TWO(mv_cost(&diff, mvjcost, mvcost) * - error_per_bit, 13); - } - return 0; -} - -static int mvsad_err_cost(const MACROBLOCK *x, const MV *mv, const MV *ref, - int error_per_bit) { - const MV diff = { mv->row - ref->row, - mv->col - ref->col }; - return ROUND_POWER_OF_TWO(mv_cost(&diff, x->nmvjointsadcost, - x->nmvsadcost) * error_per_bit, 8); -} - -void vp9_init_dsmotion_compensation(search_site_config *cfg, int stride) { - int len, ss_count = 1; - - cfg->ss[0].mv.col = cfg->ss[0].mv.row = 0; - cfg->ss[0].offset = 0; - - for (len = MAX_FIRST_STEP; len > 0; len /= 2) { - // Generate offsets for 4 search sites per step. - const MV ss_mvs[] = {{-len, 0}, {len, 0}, {0, -len}, {0, len}}; - int i; - for (i = 0; i < 4; ++i) { - search_site *const ss = &cfg->ss[ss_count++]; - ss->mv = ss_mvs[i]; - ss->offset = ss->mv.row * stride + ss->mv.col; - } - } - - cfg->ss_count = ss_count; - cfg->searches_per_step = 4; -} - -void vp9_init3smotion_compensation(search_site_config *cfg, int stride) { - int len, ss_count = 1; - - cfg->ss[0].mv.col = cfg->ss[0].mv.row = 0; - cfg->ss[0].offset = 0; - - for (len = MAX_FIRST_STEP; len > 0; len /= 2) { - // Generate offsets for 8 search sites per step. - const MV ss_mvs[8] = { - {-len, 0 }, {len, 0 }, { 0, -len}, {0, len}, - {-len, -len}, {-len, len}, {len, -len}, {len, len} - }; - int i; - for (i = 0; i < 8; ++i) { - search_site *const ss = &cfg->ss[ss_count++]; - ss->mv = ss_mvs[i]; - ss->offset = ss->mv.row * stride + ss->mv.col; - } - } - - cfg->ss_count = ss_count; - cfg->searches_per_step = 8; -} - -/* - * To avoid the penalty for crossing cache-line read, preload the reference - * area in a small buffer, which is aligned to make sure there won't be crossing - * cache-line read while reading from this buffer. This reduced the cpu - * cycles spent on reading ref data in sub-pixel filter functions. - * TODO: Currently, since sub-pixel search range here is -3 ~ 3, copy 22 rows x - * 32 cols area that is enough for 16x16 macroblock. Later, for SPLITMV, we - * could reduce the area. - */ - -/* estimated cost of a motion vector (r,c) */ -#define MVC(r, c) \ - (mvcost ? \ - ((mvjcost[((r) != rr) * 2 + ((c) != rc)] + \ - mvcost[0][((r) - rr)] + mvcost[1][((c) - rc)]) * \ - error_per_bit + 4096) >> 13 : 0) - - -// convert motion vector component to offset for svf calc -static INLINE int sp(int x) { - return (x & 7) << 1; -} - -static INLINE const uint8_t *pre(const uint8_t *buf, int stride, int r, int c) { - return &buf[(r >> 3) * stride + (c >> 3)]; -} - -/* checks if (r, c) has better score than previous best */ -#define CHECK_BETTER(v, r, c) \ - if (c >= minc && c <= maxc && r >= minr && r <= maxr) { \ - if (second_pred == NULL) \ - thismse = vfp->svf(pre(y, y_stride, r, c), y_stride, sp(c), sp(r), z, \ - src_stride, &sse); \ - else \ - thismse = vfp->svaf(pre(y, y_stride, r, c), y_stride, sp(c), sp(r), \ - z, src_stride, &sse, second_pred); \ - if ((v = MVC(r, c) + thismse) < besterr) { \ - besterr = v; \ - br = r; \ - bc = c; \ - *distortion = thismse; \ - *sse1 = sse; \ - } \ - } else { \ - v = INT_MAX; \ - } - -#define FIRST_LEVEL_CHECKS \ - { \ - unsigned int left, right, up, down, diag; \ - CHECK_BETTER(left, tr, tc - hstep); \ - CHECK_BETTER(right, tr, tc + hstep); \ - CHECK_BETTER(up, tr - hstep, tc); \ - CHECK_BETTER(down, tr + hstep, tc); \ - whichdir = (left < right ? 0 : 1) + \ - (up < down ? 0 : 2); \ - switch (whichdir) { \ - case 0: \ - CHECK_BETTER(diag, tr - hstep, tc - hstep); \ - break; \ - case 1: \ - CHECK_BETTER(diag, tr - hstep, tc + hstep); \ - break; \ - case 2: \ - CHECK_BETTER(diag, tr + hstep, tc - hstep); \ - break; \ - case 3: \ - CHECK_BETTER(diag, tr + hstep, tc + hstep); \ - break; \ - } \ - } - -#define SECOND_LEVEL_CHECKS \ - { \ - int kr, kc; \ - unsigned int second; \ - if (tr != br && tc != bc) { \ - kr = br - tr; \ - kc = bc - tc; \ - CHECK_BETTER(second, tr + kr, tc + 2 * kc); \ - CHECK_BETTER(second, tr + 2 * kr, tc + kc); \ - } else if (tr == br && tc != bc) { \ - kc = bc - tc; \ - CHECK_BETTER(second, tr + hstep, tc + 2 * kc); \ - CHECK_BETTER(second, tr - hstep, tc + 2 * kc); \ - switch (whichdir) { \ - case 0: \ - case 1: \ - CHECK_BETTER(second, tr + hstep, tc + kc); \ - break; \ - case 2: \ - case 3: \ - CHECK_BETTER(second, tr - hstep, tc + kc); \ - break; \ - } \ - } else if (tr != br && tc == bc) { \ - kr = br - tr; \ - CHECK_BETTER(second, tr + 2 * kr, tc + hstep); \ - CHECK_BETTER(second, tr + 2 * kr, tc - hstep); \ - switch (whichdir) { \ - case 0: \ - case 2: \ - CHECK_BETTER(second, tr + kr, tc + hstep); \ - break; \ - case 1: \ - case 3: \ - CHECK_BETTER(second, tr + kr, tc - hstep); \ - break; \ - } \ - } \ - } - -#define SETUP_SUBPEL_SEARCH \ - const uint8_t *const z = x->plane[0].src.buf; \ - const int src_stride = x->plane[0].src.stride; \ - const MACROBLOCKD *xd = &x->e_mbd; \ - unsigned int besterr = INT_MAX; \ - unsigned int sse; \ - unsigned int whichdir; \ - int thismse; \ - const unsigned int halfiters = iters_per_step; \ - const unsigned int quarteriters = iters_per_step; \ - const unsigned int eighthiters = iters_per_step; \ - const int y_stride = xd->plane[0].pre[0].stride; \ - const int offset = bestmv->row * y_stride + bestmv->col; \ - const uint8_t *const y = xd->plane[0].pre[0].buf; \ - \ - int rr = ref_mv->row; \ - int rc = ref_mv->col; \ - int br = bestmv->row * 8; \ - int bc = bestmv->col * 8; \ - int hstep = 4; \ - const int minc = MAX(x->mv_col_min * 8, ref_mv->col - MV_MAX); \ - const int maxc = MIN(x->mv_col_max * 8, ref_mv->col + MV_MAX); \ - const int minr = MAX(x->mv_row_min * 8, ref_mv->row - MV_MAX); \ - const int maxr = MIN(x->mv_row_max * 8, ref_mv->row + MV_MAX); \ - int tr = br; \ - int tc = bc; \ - \ - bestmv->row *= 8; \ - bestmv->col *= 8; - -static INLINE unsigned int setup_center_error(const MACROBLOCKD *xd, - const MV *bestmv, - const MV *ref_mv, - int error_per_bit, - const vp9_variance_fn_ptr_t *vfp, - const uint8_t *const src, - const int src_stride, - const uint8_t *const y, - int y_stride, - const uint8_t *second_pred, - int w, int h, int offset, - int *mvjcost, int *mvcost[2], - unsigned int *sse1, - int *distortion) { - unsigned int besterr; -#if CONFIG_VP9_HIGHBITDEPTH - if (second_pred != NULL) { - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - DECLARE_ALIGNED_ARRAY(16, uint16_t, comp_pred16, 64 * 64); - vp9_highbd_comp_avg_pred(comp_pred16, second_pred, w, h, y + offset, - y_stride); - besterr = vfp->vf(CONVERT_TO_BYTEPTR(comp_pred16), w, src, src_stride, - sse1); - } else { - DECLARE_ALIGNED_ARRAY(16, uint8_t, comp_pred, 64 * 64); - vp9_comp_avg_pred(comp_pred, second_pred, w, h, y + offset, y_stride); - besterr = vfp->vf(comp_pred, w, src, src_stride, sse1); - } - } else { - besterr = vfp->vf(y + offset, y_stride, src, src_stride, sse1); - } - *distortion = besterr; - besterr += mv_err_cost(bestmv, ref_mv, mvjcost, mvcost, error_per_bit); -#else - (void) xd; - if (second_pred != NULL) { - DECLARE_ALIGNED_ARRAY(16, uint8_t, comp_pred, 64 * 64); - vp9_comp_avg_pred(comp_pred, second_pred, w, h, y + offset, y_stride); - besterr = vfp->vf(comp_pred, w, src, src_stride, sse1); - } else { - besterr = vfp->vf(y + offset, y_stride, src, src_stride, sse1); - } - *distortion = besterr; - besterr += mv_err_cost(bestmv, ref_mv, mvjcost, mvcost, error_per_bit); -#endif // CONFIG_VP9_HIGHBITDEPTH - return besterr; -} - -static INLINE int divide_and_round(const int n, const int d) { - return ((n < 0) ^ (d < 0)) ? ((n - d / 2) / d) : ((n + d / 2) / d); -} - -static INLINE int is_cost_list_wellbehaved(int *cost_list) { - return cost_list[0] < cost_list[1] && - cost_list[0] < cost_list[2] && - cost_list[0] < cost_list[3] && - cost_list[0] < cost_list[4]; -} - -// Returns surface minima estimate at given precision in 1/2^n bits. -// Assume a model for the cost surface: S = A(x - x0)^2 + B(y - y0)^2 + C -// For a given set of costs S0, S1, S2, S3, S4 at points -// (y, x) = (0, 0), (0, -1), (1, 0), (0, 1) and (-1, 0) respectively, -// the solution for the location of the minima (x0, y0) is given by: -// x0 = 1/2 (S1 - S3)/(S1 + S3 - 2*S0), -// y0 = 1/2 (S4 - S2)/(S4 + S2 - 2*S0). -// The code below is an integerized version of that. -static void get_cost_surf_min(int *cost_list, int *ir, int *ic, - int bits) { - *ic = divide_and_round((cost_list[1] - cost_list[3]) * (1 << (bits - 1)), - (cost_list[1] - 2 * cost_list[0] + cost_list[3])); - *ir = divide_and_round((cost_list[4] - cost_list[2]) * (1 << (bits - 1)), - (cost_list[4] - 2 * cost_list[0] + cost_list[2])); -} - -int vp9_find_best_sub_pixel_tree_pruned_evenmore( - const MACROBLOCK *x, - MV *bestmv, const MV *ref_mv, - int allow_hp, - int error_per_bit, - const vp9_variance_fn_ptr_t *vfp, - int forced_stop, - int iters_per_step, - int *cost_list, - int *mvjcost, int *mvcost[2], - int *distortion, - unsigned int *sse1, - const uint8_t *second_pred, - int w, int h) { - SETUP_SUBPEL_SEARCH; - besterr = setup_center_error(xd, bestmv, ref_mv, error_per_bit, vfp, - z, src_stride, y, y_stride, second_pred, - w, h, offset, mvjcost, mvcost, - sse1, distortion); - (void) halfiters; - (void) quarteriters; - (void) eighthiters; - (void) whichdir; - (void) allow_hp; - (void) forced_stop; - (void) hstep; - - if (cost_list && - cost_list[0] != INT_MAX && cost_list[1] != INT_MAX && - cost_list[2] != INT_MAX && cost_list[3] != INT_MAX && - cost_list[4] != INT_MAX && - is_cost_list_wellbehaved(cost_list)) { - int ir, ic; - unsigned int minpt; - get_cost_surf_min(cost_list, &ir, &ic, 2); - if (ir != 0 || ic != 0) { - CHECK_BETTER(minpt, tr + 2 * ir, tc + 2 * ic); - } - } else { - FIRST_LEVEL_CHECKS; - if (halfiters > 1) { - SECOND_LEVEL_CHECKS; - } - - tr = br; - tc = bc; - - // Each subsequent iteration checks at least one point in common with - // the last iteration could be 2 ( if diag selected) 1/4 pel - // Note forced_stop: 0 - full, 1 - qtr only, 2 - half only - if (forced_stop != 2) { - hstep >>= 1; - FIRST_LEVEL_CHECKS; - if (quarteriters > 1) { - SECOND_LEVEL_CHECKS; - } - } - } - - tr = br; - tc = bc; - - if (allow_hp && vp9_use_mv_hp(ref_mv) && forced_stop == 0) { - hstep >>= 1; - FIRST_LEVEL_CHECKS; - if (eighthiters > 1) { - SECOND_LEVEL_CHECKS; - } - } - - bestmv->row = br; - bestmv->col = bc; - - if ((abs(bestmv->col - ref_mv->col) > (MAX_FULL_PEL_VAL << 3)) || - (abs(bestmv->row - ref_mv->row) > (MAX_FULL_PEL_VAL << 3))) - return INT_MAX; - - return besterr; -} - -int vp9_find_best_sub_pixel_tree_pruned_more(const MACROBLOCK *x, - MV *bestmv, const MV *ref_mv, - int allow_hp, - int error_per_bit, - const vp9_variance_fn_ptr_t *vfp, - int forced_stop, - int iters_per_step, - int *cost_list, - int *mvjcost, int *mvcost[2], - int *distortion, - unsigned int *sse1, - const uint8_t *second_pred, - int w, int h) { - SETUP_SUBPEL_SEARCH; - besterr = setup_center_error(xd, bestmv, ref_mv, error_per_bit, vfp, - z, src_stride, y, y_stride, second_pred, - w, h, offset, mvjcost, mvcost, - sse1, distortion); - if (cost_list && - cost_list[0] != INT_MAX && cost_list[1] != INT_MAX && - cost_list[2] != INT_MAX && cost_list[3] != INT_MAX && - cost_list[4] != INT_MAX && - is_cost_list_wellbehaved(cost_list)) { - unsigned int minpt; - int ir, ic; - get_cost_surf_min(cost_list, &ir, &ic, 1); - if (ir != 0 || ic != 0) { - CHECK_BETTER(minpt, tr + ir * hstep, tc + ic * hstep); - } - } else { - FIRST_LEVEL_CHECKS; - if (halfiters > 1) { - SECOND_LEVEL_CHECKS; - } - } - - // Each subsequent iteration checks at least one point in common with - // the last iteration could be 2 ( if diag selected) 1/4 pel - - // Note forced_stop: 0 - full, 1 - qtr only, 2 - half only - if (forced_stop != 2) { - tr = br; - tc = bc; - hstep >>= 1; - FIRST_LEVEL_CHECKS; - if (quarteriters > 1) { - SECOND_LEVEL_CHECKS; - } - } - - if (allow_hp && vp9_use_mv_hp(ref_mv) && forced_stop == 0) { - tr = br; - tc = bc; - hstep >>= 1; - FIRST_LEVEL_CHECKS; - if (eighthiters > 1) { - SECOND_LEVEL_CHECKS; - } - } - // These lines insure static analysis doesn't warn that - // tr and tc aren't used after the above point. - (void) tr; - (void) tc; - - bestmv->row = br; - bestmv->col = bc; - - if ((abs(bestmv->col - ref_mv->col) > (MAX_FULL_PEL_VAL << 3)) || - (abs(bestmv->row - ref_mv->row) > (MAX_FULL_PEL_VAL << 3))) - return INT_MAX; - - return besterr; -} - -int vp9_find_best_sub_pixel_tree_pruned(const MACROBLOCK *x, - MV *bestmv, const MV *ref_mv, - int allow_hp, - int error_per_bit, - const vp9_variance_fn_ptr_t *vfp, - int forced_stop, - int iters_per_step, - int *cost_list, - int *mvjcost, int *mvcost[2], - int *distortion, - unsigned int *sse1, - const uint8_t *second_pred, - int w, int h) { - SETUP_SUBPEL_SEARCH; - besterr = setup_center_error(xd, bestmv, ref_mv, error_per_bit, vfp, - z, src_stride, y, y_stride, second_pred, - w, h, offset, mvjcost, mvcost, - sse1, distortion); - if (cost_list && - cost_list[0] != INT_MAX && cost_list[1] != INT_MAX && - cost_list[2] != INT_MAX && cost_list[3] != INT_MAX && - cost_list[4] != INT_MAX) { - unsigned int left, right, up, down, diag; - whichdir = (cost_list[1] < cost_list[3] ? 0 : 1) + - (cost_list[2] < cost_list[4] ? 0 : 2); - switch (whichdir) { - case 0: - CHECK_BETTER(left, tr, tc - hstep); - CHECK_BETTER(down, tr + hstep, tc); - CHECK_BETTER(diag, tr + hstep, tc - hstep); - break; - case 1: - CHECK_BETTER(right, tr, tc + hstep); - CHECK_BETTER(down, tr + hstep, tc); - CHECK_BETTER(diag, tr + hstep, tc + hstep); - break; - case 2: - CHECK_BETTER(left, tr, tc - hstep); - CHECK_BETTER(up, tr - hstep, tc); - CHECK_BETTER(diag, tr - hstep, tc - hstep); - break; - case 3: - CHECK_BETTER(right, tr, tc + hstep); - CHECK_BETTER(up, tr - hstep, tc); - CHECK_BETTER(diag, tr - hstep, tc + hstep); - break; - } - } else { - FIRST_LEVEL_CHECKS; - if (halfiters > 1) { - SECOND_LEVEL_CHECKS; - } - } - - tr = br; - tc = bc; - - // Each subsequent iteration checks at least one point in common with - // the last iteration could be 2 ( if diag selected) 1/4 pel - - // Note forced_stop: 0 - full, 1 - qtr only, 2 - half only - if (forced_stop != 2) { - hstep >>= 1; - FIRST_LEVEL_CHECKS; - if (quarteriters > 1) { - SECOND_LEVEL_CHECKS; - } - tr = br; - tc = bc; - } - - if (allow_hp && vp9_use_mv_hp(ref_mv) && forced_stop == 0) { - hstep >>= 1; - FIRST_LEVEL_CHECKS; - if (eighthiters > 1) { - SECOND_LEVEL_CHECKS; - } - tr = br; - tc = bc; - } - // These lines insure static analysis doesn't warn that - // tr and tc aren't used after the above point. - (void) tr; - (void) tc; - - bestmv->row = br; - bestmv->col = bc; - - if ((abs(bestmv->col - ref_mv->col) > (MAX_FULL_PEL_VAL << 3)) || - (abs(bestmv->row - ref_mv->row) > (MAX_FULL_PEL_VAL << 3))) - return INT_MAX; - - return besterr; -} - -const MV search_step_table[12] = { - // left, right, up, down - {0, -4}, {0, 4}, {-4, 0}, {4, 0}, - {0, -2}, {0, 2}, {-2, 0}, {2, 0}, - {0, -1}, {0, 1}, {-1, 0}, {1, 0} -}; - -int vp9_find_best_sub_pixel_tree(const MACROBLOCK *x, - MV *bestmv, const MV *ref_mv, - int allow_hp, - int error_per_bit, - const vp9_variance_fn_ptr_t *vfp, - int forced_stop, - int iters_per_step, - int *cost_list, - int *mvjcost, int *mvcost[2], - int *distortion, - unsigned int *sse1, - const uint8_t *second_pred, - int w, int h) { - const uint8_t *const z = x->plane[0].src.buf; - const uint8_t *const src_address = z; - const int src_stride = x->plane[0].src.stride; - const MACROBLOCKD *xd = &x->e_mbd; - unsigned int besterr = INT_MAX; - unsigned int sse; - unsigned int whichdir = 0; - int thismse; - const int y_stride = xd->plane[0].pre[0].stride; - const int offset = bestmv->row * y_stride + bestmv->col; - const uint8_t *const y = xd->plane[0].pre[0].buf; - - int rr = ref_mv->row; - int rc = ref_mv->col; - int br = bestmv->row * 8; - int bc = bestmv->col * 8; - int hstep = 4; - int iter, round = 3 - forced_stop; - const int minc = MAX(x->mv_col_min * 8, ref_mv->col - MV_MAX); - const int maxc = MIN(x->mv_col_max * 8, ref_mv->col + MV_MAX); - const int minr = MAX(x->mv_row_min * 8, ref_mv->row - MV_MAX); - const int maxr = MIN(x->mv_row_max * 8, ref_mv->row + MV_MAX); - int tr = br; - int tc = bc; - const MV *search_step = search_step_table; - int idx, best_idx = -1; - unsigned int cost_array[5]; - - if (!(allow_hp && vp9_use_mv_hp(ref_mv))) - if (round == 3) - round = 2; - - bestmv->row *= 8; - bestmv->col *= 8; - - besterr = setup_center_error(xd, bestmv, ref_mv, error_per_bit, vfp, - z, src_stride, y, y_stride, second_pred, - w, h, offset, mvjcost, mvcost, - sse1, distortion); - - (void) cost_list; // to silence compiler warning - - for (iter = 0; iter < round; ++iter) { - // Check vertical and horizontal sub-pixel positions. - for (idx = 0; idx < 4; ++idx) { - tr = br + search_step[idx].row; - tc = bc + search_step[idx].col; - if (tc >= minc && tc <= maxc && tr >= minr && tr <= maxr) { - const uint8_t *const pre_address = y + (tr >> 3) * y_stride + (tc >> 3); - int row_offset = (tr & 0x07) << 1; - int col_offset = (tc & 0x07) << 1; - MV this_mv; - this_mv.row = tr; - this_mv.col = tc; - if (second_pred == NULL) - thismse = vfp->svf(pre_address, y_stride, col_offset, row_offset, - src_address, src_stride, &sse); - else - thismse = vfp->svaf(pre_address, y_stride, col_offset, row_offset, - src_address, src_stride, &sse, second_pred); - cost_array[idx] = thismse + - mv_err_cost(&this_mv, ref_mv, mvjcost, mvcost, error_per_bit); - - if (cost_array[idx] < besterr) { - best_idx = idx; - besterr = cost_array[idx]; - *distortion = thismse; - *sse1 = sse; - } - } else { - cost_array[idx] = INT_MAX; - } - } - - // Check diagonal sub-pixel position - tc = bc + (cost_array[0] < cost_array[1] ? -hstep : hstep); - tr = br + (cost_array[2] < cost_array[3] ? -hstep : hstep); - if (tc >= minc && tc <= maxc && tr >= minr && tr <= maxr) { - const uint8_t *const pre_address = y + (tr >> 3) * y_stride + (tc >> 3); - int row_offset = (tr & 0x07) << 1; - int col_offset = (tc & 0x07) << 1; - MV this_mv = {tr, tc}; - if (second_pred == NULL) - thismse = vfp->svf(pre_address, y_stride, col_offset, row_offset, - src_address, src_stride, &sse); - else - thismse = vfp->svaf(pre_address, y_stride, col_offset, row_offset, - src_address, src_stride, &sse, second_pred); - cost_array[4] = thismse + - mv_err_cost(&this_mv, ref_mv, mvjcost, mvcost, error_per_bit); - - if (cost_array[4] < besterr) { - best_idx = 4; - besterr = cost_array[4]; - *distortion = thismse; - *sse1 = sse; - } - } else { - cost_array[idx] = INT_MAX; - } - - if (best_idx < 4 && best_idx >= 0) { - br += search_step[best_idx].row; - bc += search_step[best_idx].col; - } else if (best_idx == 4) { - br = tr; - bc = tc; - } - - if (iters_per_step > 1) - SECOND_LEVEL_CHECKS; - - tr = br; - tc = bc; - - search_step += 4; - hstep >>= 1; - best_idx = -1; - } - - // Each subsequent iteration checks at least one point in common with - // the last iteration could be 2 ( if diag selected) 1/4 pel - - // These lines insure static analysis doesn't warn that - // tr and tc aren't used after the above point. - (void) tr; - (void) tc; - - bestmv->row = br; - bestmv->col = bc; - - if ((abs(bestmv->col - ref_mv->col) > (MAX_FULL_PEL_VAL << 3)) || - (abs(bestmv->row - ref_mv->row) > (MAX_FULL_PEL_VAL << 3))) - return INT_MAX; - - return besterr; -} - -#undef MVC -#undef PRE -#undef CHECK_BETTER - -static INLINE int check_bounds(const MACROBLOCK *x, int row, int col, - int range) { - return ((row - range) >= x->mv_row_min) & - ((row + range) <= x->mv_row_max) & - ((col - range) >= x->mv_col_min) & - ((col + range) <= x->mv_col_max); -} - -static INLINE int is_mv_in(const MACROBLOCK *x, const MV *mv) { - return (mv->col >= x->mv_col_min) && (mv->col <= x->mv_col_max) && - (mv->row >= x->mv_row_min) && (mv->row <= x->mv_row_max); -} - -#define CHECK_BETTER \ - {\ - if (thissad < bestsad) {\ - if (use_mvcost) \ - thissad += mvsad_err_cost(x, &this_mv, &fcenter_mv, sad_per_bit);\ - if (thissad < bestsad) {\ - bestsad = thissad;\ - best_site = i;\ - }\ - }\ - } - -#define MAX_PATTERN_SCALES 11 -#define MAX_PATTERN_CANDIDATES 8 // max number of canddiates per scale -#define PATTERN_CANDIDATES_REF 3 // number of refinement candidates - -// Calculate and return a sad+mvcost list around an integer best pel. -static INLINE void calc_int_cost_list(const MACROBLOCK *x, - const MV *ref_mv, - int sadpb, - const vp9_variance_fn_ptr_t *fn_ptr, - const MV *best_mv, - int *cost_list) { - static const MV neighbors[4] = {{0, -1}, {1, 0}, {0, 1}, {-1, 0}}; - const struct buf_2d *const what = &x->plane[0].src; - const struct buf_2d *const in_what = &x->e_mbd.plane[0].pre[0]; - const MV fcenter_mv = {ref_mv->row >> 3, ref_mv->col >> 3}; - int br = best_mv->row; - int bc = best_mv->col; - MV this_mv; - int i; - unsigned int sse; - - this_mv.row = br; - this_mv.col = bc; - cost_list[0] = fn_ptr->vf(what->buf, what->stride, - get_buf_from_mv(in_what, &this_mv), - in_what->stride, &sse) + - mvsad_err_cost(x, &this_mv, &fcenter_mv, sadpb); - if (check_bounds(x, br, bc, 1)) { - for (i = 0; i < 4; i++) { - const MV this_mv = {br + neighbors[i].row, - bc + neighbors[i].col}; - cost_list[i + 1] = fn_ptr->vf(what->buf, what->stride, - get_buf_from_mv(in_what, &this_mv), - in_what->stride, &sse) + - // mvsad_err_cost(x, &this_mv, &fcenter_mv, sadpb); - mv_err_cost(&this_mv, &fcenter_mv, x->nmvjointcost, x->mvcost, - x->errorperbit); - } - } else { - for (i = 0; i < 4; i++) { - const MV this_mv = {br + neighbors[i].row, - bc + neighbors[i].col}; - if (!is_mv_in(x, &this_mv)) - cost_list[i + 1] = INT_MAX; - else - cost_list[i + 1] = fn_ptr->vf(what->buf, what->stride, - get_buf_from_mv(in_what, &this_mv), - in_what->stride, &sse) + - // mvsad_err_cost(x, &this_mv, &fcenter_mv, sadpb); - mv_err_cost(&this_mv, &fcenter_mv, x->nmvjointcost, x->mvcost, - x->errorperbit); - } - } -} - -// Generic pattern search function that searches over multiple scales. -// Each scale can have a different number of candidates and shape of -// candidates as indicated in the num_candidates and candidates arrays -// passed into this function -// -static int vp9_pattern_search(const MACROBLOCK *x, - MV *ref_mv, - int search_param, - int sad_per_bit, - int do_init_search, - int *cost_list, - const vp9_variance_fn_ptr_t *vfp, - int use_mvcost, - const MV *center_mv, - MV *best_mv, - const int num_candidates[MAX_PATTERN_SCALES], - const MV candidates[MAX_PATTERN_SCALES] - [MAX_PATTERN_CANDIDATES]) { - const MACROBLOCKD *const xd = &x->e_mbd; - static const int search_param_to_steps[MAX_MVSEARCH_STEPS] = { - 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, - }; - int i, s, t; - const struct buf_2d *const what = &x->plane[0].src; - const struct buf_2d *const in_what = &xd->plane[0].pre[0]; - int br, bc; - int bestsad = INT_MAX; - int thissad; - int k = -1; - const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3}; - int best_init_s = search_param_to_steps[search_param]; - // adjust ref_mv to make sure it is within MV range - clamp_mv(ref_mv, x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max); - br = ref_mv->row; - bc = ref_mv->col; - - // Work out the start point for the search - bestsad = vfp->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, ref_mv), in_what->stride) + - mvsad_err_cost(x, ref_mv, &fcenter_mv, sad_per_bit); - - // Search all possible scales upto the search param around the center point - // pick the scale of the point that is best as the starting scale of - // further steps around it. - if (do_init_search) { - s = best_init_s; - best_init_s = -1; - for (t = 0; t <= s; ++t) { - int best_site = -1; - if (check_bounds(x, br, bc, 1 << t)) { - for (i = 0; i < num_candidates[t]; i++) { - const MV this_mv = {br + candidates[t][i].row, - bc + candidates[t][i].col}; - thissad = vfp->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, &this_mv), - in_what->stride); - CHECK_BETTER - } - } else { - for (i = 0; i < num_candidates[t]; i++) { - const MV this_mv = {br + candidates[t][i].row, - bc + candidates[t][i].col}; - if (!is_mv_in(x, &this_mv)) - continue; - thissad = vfp->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, &this_mv), - in_what->stride); - CHECK_BETTER - } - } - if (best_site == -1) { - continue; - } else { - best_init_s = t; - k = best_site; - } - } - if (best_init_s != -1) { - br += candidates[best_init_s][k].row; - bc += candidates[best_init_s][k].col; - } - } - - // If the center point is still the best, just skip this and move to - // the refinement step. - if (best_init_s != -1) { - int best_site = -1; - s = best_init_s; - - do { - // No need to search all 6 points the 1st time if initial search was used - if (!do_init_search || s != best_init_s) { - if (check_bounds(x, br, bc, 1 << s)) { - for (i = 0; i < num_candidates[s]; i++) { - const MV this_mv = {br + candidates[s][i].row, - bc + candidates[s][i].col}; - thissad = vfp->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, &this_mv), - in_what->stride); - CHECK_BETTER - } - } else { - for (i = 0; i < num_candidates[s]; i++) { - const MV this_mv = {br + candidates[s][i].row, - bc + candidates[s][i].col}; - if (!is_mv_in(x, &this_mv)) - continue; - thissad = vfp->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, &this_mv), - in_what->stride); - CHECK_BETTER - } - } - - if (best_site == -1) { - continue; - } else { - br += candidates[s][best_site].row; - bc += candidates[s][best_site].col; - k = best_site; - } - } - - do { - int next_chkpts_indices[PATTERN_CANDIDATES_REF]; - best_site = -1; - next_chkpts_indices[0] = (k == 0) ? num_candidates[s] - 1 : k - 1; - next_chkpts_indices[1] = k; - next_chkpts_indices[2] = (k == num_candidates[s] - 1) ? 0 : k + 1; - - if (check_bounds(x, br, bc, 1 << s)) { - for (i = 0; i < PATTERN_CANDIDATES_REF; i++) { - const MV this_mv = {br + candidates[s][next_chkpts_indices[i]].row, - bc + candidates[s][next_chkpts_indices[i]].col}; - thissad = vfp->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, &this_mv), - in_what->stride); - CHECK_BETTER - } - } else { - for (i = 0; i < PATTERN_CANDIDATES_REF; i++) { - const MV this_mv = {br + candidates[s][next_chkpts_indices[i]].row, - bc + candidates[s][next_chkpts_indices[i]].col}; - if (!is_mv_in(x, &this_mv)) - continue; - thissad = vfp->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, &this_mv), - in_what->stride); - CHECK_BETTER - } - } - - if (best_site != -1) { - k = next_chkpts_indices[best_site]; - br += candidates[s][k].row; - bc += candidates[s][k].col; - } - } while (best_site != -1); - } while (s--); - } - - // Returns the one-away integer pel sad values around the best as follows: - // cost_list[0]: cost at the best integer pel - // cost_list[1]: cost at delta {0, -1} (left) from the best integer pel - // cost_list[2]: cost at delta { 1, 0} (bottom) from the best integer pel - // cost_list[3]: cost at delta { 0, 1} (right) from the best integer pel - // cost_list[4]: cost at delta {-1, 0} (top) from the best integer pel - if (cost_list) { - const MV best_mv = { br, bc }; - calc_int_cost_list(x, &fcenter_mv, sad_per_bit, vfp, &best_mv, cost_list); - } - best_mv->row = br; - best_mv->col = bc; - return bestsad; -} - -// A specialized function where the smallest scale search candidates -// are 4 1-away neighbors, and cost_list is non-null -// TODO(debargha): Merge this function with the one above. Also remove -// use_mvcost option since it is always 1, to save unnecessary branches. -static int vp9_pattern_search_sad(const MACROBLOCK *x, - MV *ref_mv, - int search_param, - int sad_per_bit, - int do_init_search, - int *cost_list, - const vp9_variance_fn_ptr_t *vfp, - int use_mvcost, - const MV *center_mv, - MV *best_mv, - const int num_candidates[MAX_PATTERN_SCALES], - const MV candidates[MAX_PATTERN_SCALES] - [MAX_PATTERN_CANDIDATES]) { - const MACROBLOCKD *const xd = &x->e_mbd; - static const int search_param_to_steps[MAX_MVSEARCH_STEPS] = { - 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, - }; - int i, s, t; - const struct buf_2d *const what = &x->plane[0].src; - const struct buf_2d *const in_what = &xd->plane[0].pre[0]; - int br, bc; - int bestsad = INT_MAX; - int thissad; - int k = -1; - const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3}; - int best_init_s = search_param_to_steps[search_param]; - // adjust ref_mv to make sure it is within MV range - clamp_mv(ref_mv, x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max); - br = ref_mv->row; - bc = ref_mv->col; - if (cost_list != NULL) { - cost_list[0] = cost_list[1] = cost_list[2] = cost_list[3] = cost_list[4] = - INT_MAX; - } - - // Work out the start point for the search - bestsad = vfp->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, ref_mv), in_what->stride) + - mvsad_err_cost(x, ref_mv, &fcenter_mv, sad_per_bit); - - // Search all possible scales upto the search param around the center point - // pick the scale of the point that is best as the starting scale of - // further steps around it. - if (do_init_search) { - s = best_init_s; - best_init_s = -1; - for (t = 0; t <= s; ++t) { - int best_site = -1; - if (check_bounds(x, br, bc, 1 << t)) { - for (i = 0; i < num_candidates[t]; i++) { - const MV this_mv = {br + candidates[t][i].row, - bc + candidates[t][i].col}; - thissad = vfp->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, &this_mv), - in_what->stride); - CHECK_BETTER - } - } else { - for (i = 0; i < num_candidates[t]; i++) { - const MV this_mv = {br + candidates[t][i].row, - bc + candidates[t][i].col}; - if (!is_mv_in(x, &this_mv)) - continue; - thissad = vfp->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, &this_mv), - in_what->stride); - CHECK_BETTER - } - } - if (best_site == -1) { - continue; - } else { - best_init_s = t; - k = best_site; - } - } - if (best_init_s != -1) { - br += candidates[best_init_s][k].row; - bc += candidates[best_init_s][k].col; - } - } - - // If the center point is still the best, just skip this and move to - // the refinement step. - if (best_init_s != -1) { - int do_sad = (num_candidates[0] == 4 && cost_list != NULL); - int best_site = -1; - s = best_init_s; - - for (; s >= do_sad; s--) { - if (!do_init_search || s != best_init_s) { - if (check_bounds(x, br, bc, 1 << s)) { - for (i = 0; i < num_candidates[s]; i++) { - const MV this_mv = {br + candidates[s][i].row, - bc + candidates[s][i].col}; - thissad = vfp->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, &this_mv), - in_what->stride); - CHECK_BETTER - } - } else { - for (i = 0; i < num_candidates[s]; i++) { - const MV this_mv = {br + candidates[s][i].row, - bc + candidates[s][i].col}; - if (!is_mv_in(x, &this_mv)) - continue; - thissad = vfp->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, &this_mv), - in_what->stride); - CHECK_BETTER - } - } - - if (best_site == -1) { - continue; - } else { - br += candidates[s][best_site].row; - bc += candidates[s][best_site].col; - k = best_site; - } - } - - do { - int next_chkpts_indices[PATTERN_CANDIDATES_REF]; - best_site = -1; - next_chkpts_indices[0] = (k == 0) ? num_candidates[s] - 1 : k - 1; - next_chkpts_indices[1] = k; - next_chkpts_indices[2] = (k == num_candidates[s] - 1) ? 0 : k + 1; - - if (check_bounds(x, br, bc, 1 << s)) { - for (i = 0; i < PATTERN_CANDIDATES_REF; i++) { - const MV this_mv = {br + candidates[s][next_chkpts_indices[i]].row, - bc + candidates[s][next_chkpts_indices[i]].col}; - thissad = vfp->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, &this_mv), - in_what->stride); - CHECK_BETTER - } - } else { - for (i = 0; i < PATTERN_CANDIDATES_REF; i++) { - const MV this_mv = {br + candidates[s][next_chkpts_indices[i]].row, - bc + candidates[s][next_chkpts_indices[i]].col}; - if (!is_mv_in(x, &this_mv)) - continue; - thissad = vfp->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, &this_mv), - in_what->stride); - CHECK_BETTER - } - } - - if (best_site != -1) { - k = next_chkpts_indices[best_site]; - br += candidates[s][k].row; - bc += candidates[s][k].col; - } - } while (best_site != -1); - } - - // Note: If we enter the if below, then cost_list must be non-NULL. - if (s == 0) { - cost_list[0] = bestsad; - if (!do_init_search || s != best_init_s) { - if (check_bounds(x, br, bc, 1 << s)) { - for (i = 0; i < num_candidates[s]; i++) { - const MV this_mv = {br + candidates[s][i].row, - bc + candidates[s][i].col}; - cost_list[i + 1] = - thissad = vfp->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, &this_mv), - in_what->stride); - CHECK_BETTER - } - } else { - for (i = 0; i < num_candidates[s]; i++) { - const MV this_mv = {br + candidates[s][i].row, - bc + candidates[s][i].col}; - if (!is_mv_in(x, &this_mv)) - continue; - cost_list[i + 1] = - thissad = vfp->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, &this_mv), - in_what->stride); - CHECK_BETTER - } - } - - if (best_site != -1) { - br += candidates[s][best_site].row; - bc += candidates[s][best_site].col; - k = best_site; - } - } - while (best_site != -1) { - int next_chkpts_indices[PATTERN_CANDIDATES_REF]; - best_site = -1; - next_chkpts_indices[0] = (k == 0) ? num_candidates[s] - 1 : k - 1; - next_chkpts_indices[1] = k; - next_chkpts_indices[2] = (k == num_candidates[s] - 1) ? 0 : k + 1; - cost_list[1] = cost_list[2] = cost_list[3] = cost_list[4] = INT_MAX; - cost_list[((k + 2) % 4) + 1] = cost_list[0]; - cost_list[0] = bestsad; - - if (check_bounds(x, br, bc, 1 << s)) { - for (i = 0; i < PATTERN_CANDIDATES_REF; i++) { - const MV this_mv = {br + candidates[s][next_chkpts_indices[i]].row, - bc + candidates[s][next_chkpts_indices[i]].col}; - cost_list[next_chkpts_indices[i] + 1] = - thissad = vfp->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, &this_mv), - in_what->stride); - CHECK_BETTER - } - } else { - for (i = 0; i < PATTERN_CANDIDATES_REF; i++) { - const MV this_mv = {br + candidates[s][next_chkpts_indices[i]].row, - bc + candidates[s][next_chkpts_indices[i]].col}; - if (!is_mv_in(x, &this_mv)) { - cost_list[next_chkpts_indices[i] + 1] = INT_MAX; - continue; - } - cost_list[next_chkpts_indices[i] + 1] = - thissad = vfp->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, &this_mv), - in_what->stride); - CHECK_BETTER - } - } - - if (best_site != -1) { - k = next_chkpts_indices[best_site]; - br += candidates[s][k].row; - bc += candidates[s][k].col; - } - } - } - } - - // Returns the one-away integer pel sad values around the best as follows: - // cost_list[0]: sad at the best integer pel - // cost_list[1]: sad at delta {0, -1} (left) from the best integer pel - // cost_list[2]: sad at delta { 1, 0} (bottom) from the best integer pel - // cost_list[3]: sad at delta { 0, 1} (right) from the best integer pel - // cost_list[4]: sad at delta {-1, 0} (top) from the best integer pel - if (cost_list) { - static const MV neighbors[4] = {{0, -1}, {1, 0}, {0, 1}, {-1, 0}}; - if (cost_list[0] == INT_MAX) { - cost_list[0] = bestsad; - if (check_bounds(x, br, bc, 1)) { - for (i = 0; i < 4; i++) { - const MV this_mv = { br + neighbors[i].row, - bc + neighbors[i].col }; - cost_list[i + 1] = vfp->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, &this_mv), - in_what->stride); - } - } else { - for (i = 0; i < 4; i++) { - const MV this_mv = {br + neighbors[i].row, - bc + neighbors[i].col}; - if (!is_mv_in(x, &this_mv)) - cost_list[i + 1] = INT_MAX; - else - cost_list[i + 1] = vfp->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, &this_mv), - in_what->stride); - } - } - } else { - if (use_mvcost) { - for (i = 0; i < 4; i++) { - const MV this_mv = {br + neighbors[i].row, - bc + neighbors[i].col}; - if (cost_list[i + 1] != INT_MAX) { - cost_list[i + 1] += - mvsad_err_cost(x, &this_mv, &fcenter_mv, sad_per_bit); - } - } - } - } - } - best_mv->row = br; - best_mv->col = bc; - return bestsad; -} - -int vp9_get_mvpred_var(const MACROBLOCK *x, - const MV *best_mv, const MV *center_mv, - const vp9_variance_fn_ptr_t *vfp, - int use_mvcost) { - const MACROBLOCKD *const xd = &x->e_mbd; - const struct buf_2d *const what = &x->plane[0].src; - const struct buf_2d *const in_what = &xd->plane[0].pre[0]; - const MV mv = {best_mv->row * 8, best_mv->col * 8}; - unsigned int unused; - - return vfp->vf(what->buf, what->stride, - get_buf_from_mv(in_what, best_mv), in_what->stride, &unused) + - (use_mvcost ? mv_err_cost(&mv, center_mv, x->nmvjointcost, - x->mvcost, x->errorperbit) : 0); -} - -int vp9_get_mvpred_av_var(const MACROBLOCK *x, - const MV *best_mv, const MV *center_mv, - const uint8_t *second_pred, - const vp9_variance_fn_ptr_t *vfp, - int use_mvcost) { - const MACROBLOCKD *const xd = &x->e_mbd; - const struct buf_2d *const what = &x->plane[0].src; - const struct buf_2d *const in_what = &xd->plane[0].pre[0]; - const MV mv = {best_mv->row * 8, best_mv->col * 8}; - unsigned int unused; - - return vfp->svaf(get_buf_from_mv(in_what, best_mv), in_what->stride, 0, 0, - what->buf, what->stride, &unused, second_pred) + - (use_mvcost ? mv_err_cost(&mv, center_mv, x->nmvjointcost, - x->mvcost, x->errorperbit) : 0); -} - -int vp9_hex_search(const MACROBLOCK *x, - MV *ref_mv, - int search_param, - int sad_per_bit, - int do_init_search, - int *cost_list, - const vp9_variance_fn_ptr_t *vfp, - int use_mvcost, - const MV *center_mv, MV *best_mv) { - // First scale has 8-closest points, the rest have 6 points in hex shape - // at increasing scales - static const int hex_num_candidates[MAX_PATTERN_SCALES] = { - 8, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 - }; - // Note that the largest candidate step at each scale is 2^scale - static const MV hex_candidates[MAX_PATTERN_SCALES][MAX_PATTERN_CANDIDATES] = { - {{-1, -1}, {0, -1}, {1, -1}, {1, 0}, {1, 1}, { 0, 1}, { -1, 1}, {-1, 0}}, - {{-1, -2}, {1, -2}, {2, 0}, {1, 2}, { -1, 2}, { -2, 0}}, - {{-2, -4}, {2, -4}, {4, 0}, {2, 4}, { -2, 4}, { -4, 0}}, - {{-4, -8}, {4, -8}, {8, 0}, {4, 8}, { -4, 8}, { -8, 0}}, - {{-8, -16}, {8, -16}, {16, 0}, {8, 16}, { -8, 16}, { -16, 0}}, - {{-16, -32}, {16, -32}, {32, 0}, {16, 32}, { -16, 32}, { -32, 0}}, - {{-32, -64}, {32, -64}, {64, 0}, {32, 64}, { -32, 64}, { -64, 0}}, - {{-64, -128}, {64, -128}, {128, 0}, {64, 128}, { -64, 128}, { -128, 0}}, - {{-128, -256}, {128, -256}, {256, 0}, {128, 256}, { -128, 256}, { -256, 0}}, - {{-256, -512}, {256, -512}, {512, 0}, {256, 512}, { -256, 512}, { -512, 0}}, - {{-512, -1024}, {512, -1024}, {1024, 0}, {512, 1024}, { -512, 1024}, - { -1024, 0}}, - }; - return vp9_pattern_search(x, ref_mv, search_param, sad_per_bit, - do_init_search, cost_list, vfp, use_mvcost, - center_mv, best_mv, - hex_num_candidates, hex_candidates); -} - -int vp9_bigdia_search(const MACROBLOCK *x, - MV *ref_mv, - int search_param, - int sad_per_bit, - int do_init_search, - int *cost_list, - const vp9_variance_fn_ptr_t *vfp, - int use_mvcost, - const MV *center_mv, - MV *best_mv) { - // First scale has 4-closest points, the rest have 8 points in diamond - // shape at increasing scales - static const int bigdia_num_candidates[MAX_PATTERN_SCALES] = { - 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - }; - // Note that the largest candidate step at each scale is 2^scale - static const MV bigdia_candidates[MAX_PATTERN_SCALES] - [MAX_PATTERN_CANDIDATES] = { - {{0, -1}, {1, 0}, { 0, 1}, {-1, 0}}, - {{-1, -1}, {0, -2}, {1, -1}, {2, 0}, {1, 1}, {0, 2}, {-1, 1}, {-2, 0}}, - {{-2, -2}, {0, -4}, {2, -2}, {4, 0}, {2, 2}, {0, 4}, {-2, 2}, {-4, 0}}, - {{-4, -4}, {0, -8}, {4, -4}, {8, 0}, {4, 4}, {0, 8}, {-4, 4}, {-8, 0}}, - {{-8, -8}, {0, -16}, {8, -8}, {16, 0}, {8, 8}, {0, 16}, {-8, 8}, {-16, 0}}, - {{-16, -16}, {0, -32}, {16, -16}, {32, 0}, {16, 16}, {0, 32}, - {-16, 16}, {-32, 0}}, - {{-32, -32}, {0, -64}, {32, -32}, {64, 0}, {32, 32}, {0, 64}, - {-32, 32}, {-64, 0}}, - {{-64, -64}, {0, -128}, {64, -64}, {128, 0}, {64, 64}, {0, 128}, - {-64, 64}, {-128, 0}}, - {{-128, -128}, {0, -256}, {128, -128}, {256, 0}, {128, 128}, {0, 256}, - {-128, 128}, {-256, 0}}, - {{-256, -256}, {0, -512}, {256, -256}, {512, 0}, {256, 256}, {0, 512}, - {-256, 256}, {-512, 0}}, - {{-512, -512}, {0, -1024}, {512, -512}, {1024, 0}, {512, 512}, {0, 1024}, - {-512, 512}, {-1024, 0}}, - }; - return vp9_pattern_search_sad(x, ref_mv, search_param, sad_per_bit, - do_init_search, cost_list, vfp, use_mvcost, - center_mv, best_mv, - bigdia_num_candidates, bigdia_candidates); -} - -int vp9_square_search(const MACROBLOCK *x, - MV *ref_mv, - int search_param, - int sad_per_bit, - int do_init_search, - int *cost_list, - const vp9_variance_fn_ptr_t *vfp, - int use_mvcost, - const MV *center_mv, - MV *best_mv) { - // All scales have 8 closest points in square shape - static const int square_num_candidates[MAX_PATTERN_SCALES] = { - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - }; - // Note that the largest candidate step at each scale is 2^scale - static const MV square_candidates[MAX_PATTERN_SCALES] - [MAX_PATTERN_CANDIDATES] = { - {{-1, -1}, {0, -1}, {1, -1}, {1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}}, - {{-2, -2}, {0, -2}, {2, -2}, {2, 0}, {2, 2}, {0, 2}, {-2, 2}, {-2, 0}}, - {{-4, -4}, {0, -4}, {4, -4}, {4, 0}, {4, 4}, {0, 4}, {-4, 4}, {-4, 0}}, - {{-8, -8}, {0, -8}, {8, -8}, {8, 0}, {8, 8}, {0, 8}, {-8, 8}, {-8, 0}}, - {{-16, -16}, {0, -16}, {16, -16}, {16, 0}, {16, 16}, {0, 16}, - {-16, 16}, {-16, 0}}, - {{-32, -32}, {0, -32}, {32, -32}, {32, 0}, {32, 32}, {0, 32}, - {-32, 32}, {-32, 0}}, - {{-64, -64}, {0, -64}, {64, -64}, {64, 0}, {64, 64}, {0, 64}, - {-64, 64}, {-64, 0}}, - {{-128, -128}, {0, -128}, {128, -128}, {128, 0}, {128, 128}, {0, 128}, - {-128, 128}, {-128, 0}}, - {{-256, -256}, {0, -256}, {256, -256}, {256, 0}, {256, 256}, {0, 256}, - {-256, 256}, {-256, 0}}, - {{-512, -512}, {0, -512}, {512, -512}, {512, 0}, {512, 512}, {0, 512}, - {-512, 512}, {-512, 0}}, - {{-1024, -1024}, {0, -1024}, {1024, -1024}, {1024, 0}, {1024, 1024}, - {0, 1024}, {-1024, 1024}, {-1024, 0}}, - }; - return vp9_pattern_search(x, ref_mv, search_param, sad_per_bit, - do_init_search, cost_list, vfp, use_mvcost, - center_mv, best_mv, - square_num_candidates, square_candidates); -} - -int vp9_fast_hex_search(const MACROBLOCK *x, - MV *ref_mv, - int search_param, - int sad_per_bit, - int do_init_search, // must be zero for fast_hex - int *cost_list, - const vp9_variance_fn_ptr_t *vfp, - int use_mvcost, - const MV *center_mv, - MV *best_mv) { - return vp9_hex_search(x, ref_mv, MAX(MAX_MVSEARCH_STEPS - 2, search_param), - sad_per_bit, do_init_search, cost_list, vfp, use_mvcost, - center_mv, best_mv); -} - -int vp9_fast_dia_search(const MACROBLOCK *x, - MV *ref_mv, - int search_param, - int sad_per_bit, - int do_init_search, - int *cost_list, - const vp9_variance_fn_ptr_t *vfp, - int use_mvcost, - const MV *center_mv, - MV *best_mv) { - return vp9_bigdia_search(x, ref_mv, MAX(MAX_MVSEARCH_STEPS - 2, search_param), - sad_per_bit, do_init_search, cost_list, vfp, - use_mvcost, center_mv, best_mv); -} - -#undef CHECK_BETTER - -int vp9_full_range_search_c(const MACROBLOCK *x, - const search_site_config *cfg, - MV *ref_mv, MV *best_mv, - int search_param, int sad_per_bit, int *num00, - const vp9_variance_fn_ptr_t *fn_ptr, - const MV *center_mv) { - const MACROBLOCKD *const xd = &x->e_mbd; - const struct buf_2d *const what = &x->plane[0].src; - const struct buf_2d *const in_what = &xd->plane[0].pre[0]; - const int range = 64; - const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3}; - unsigned int best_sad = INT_MAX; - int r, c, i; - int start_col, end_col, start_row, end_row; - - // The cfg and search_param parameters are not used in this search variant - (void)cfg; - (void)search_param; - - clamp_mv(ref_mv, x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max); - *best_mv = *ref_mv; - *num00 = 11; - best_sad = fn_ptr->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, ref_mv), in_what->stride) + - mvsad_err_cost(x, ref_mv, &fcenter_mv, sad_per_bit); - start_row = MAX(-range, x->mv_row_min - ref_mv->row); - start_col = MAX(-range, x->mv_col_min - ref_mv->col); - end_row = MIN(range, x->mv_row_max - ref_mv->row); - end_col = MIN(range, x->mv_col_max - ref_mv->col); - - for (r = start_row; r <= end_row; ++r) { - for (c = start_col; c <= end_col; c += 4) { - if (c + 3 <= end_col) { - unsigned int sads[4]; - const uint8_t *addrs[4]; - for (i = 0; i < 4; ++i) { - const MV mv = {ref_mv->row + r, ref_mv->col + c + i}; - addrs[i] = get_buf_from_mv(in_what, &mv); - } - - fn_ptr->sdx4df(what->buf, what->stride, addrs, in_what->stride, sads); - - for (i = 0; i < 4; ++i) { - if (sads[i] < best_sad) { - const MV mv = {ref_mv->row + r, ref_mv->col + c + i}; - const unsigned int sad = sads[i] + - mvsad_err_cost(x, &mv, &fcenter_mv, sad_per_bit); - if (sad < best_sad) { - best_sad = sad; - *best_mv = mv; - } - } - } - } else { - for (i = 0; i < end_col - c; ++i) { - const MV mv = {ref_mv->row + r, ref_mv->col + c + i}; - unsigned int sad = fn_ptr->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, &mv), in_what->stride); - if (sad < best_sad) { - sad += mvsad_err_cost(x, &mv, &fcenter_mv, sad_per_bit); - if (sad < best_sad) { - best_sad = sad; - *best_mv = mv; - } - } - } - } - } - } - - return best_sad; -} - -int vp9_diamond_search_sad_c(const MACROBLOCK *x, - const search_site_config *cfg, - MV *ref_mv, MV *best_mv, int search_param, - int sad_per_bit, int *num00, - const vp9_variance_fn_ptr_t *fn_ptr, - const MV *center_mv) { - int i, j, step; - - const MACROBLOCKD *const xd = &x->e_mbd; - uint8_t *what = x->plane[0].src.buf; - const int what_stride = x->plane[0].src.stride; - const uint8_t *in_what; - const int in_what_stride = xd->plane[0].pre[0].stride; - const uint8_t *best_address; - - unsigned int bestsad = INT_MAX; - int best_site = 0; - int last_site = 0; - - int ref_row; - int ref_col; - - // search_param determines the length of the initial step and hence the number - // of iterations. - // 0 = initial step (MAX_FIRST_STEP) pel - // 1 = (MAX_FIRST_STEP/2) pel, - // 2 = (MAX_FIRST_STEP/4) pel... - const search_site *ss = &cfg->ss[search_param * cfg->searches_per_step]; - const int tot_steps = (cfg->ss_count / cfg->searches_per_step) - search_param; - - const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3}; - clamp_mv(ref_mv, x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max); - ref_row = ref_mv->row; - ref_col = ref_mv->col; - *num00 = 0; - best_mv->row = ref_row; - best_mv->col = ref_col; - - // Work out the start point for the search - in_what = xd->plane[0].pre[0].buf + ref_row * in_what_stride + ref_col; - best_address = in_what; - - // Check the starting position - bestsad = fn_ptr->sdf(what, what_stride, in_what, in_what_stride) - + mvsad_err_cost(x, best_mv, &fcenter_mv, sad_per_bit); - - i = 1; - - for (step = 0; step < tot_steps; step++) { - int all_in = 1, t; - - // All_in is true if every one of the points we are checking are within - // the bounds of the image. - all_in &= ((best_mv->row + ss[i].mv.row) > x->mv_row_min); - all_in &= ((best_mv->row + ss[i + 1].mv.row) < x->mv_row_max); - all_in &= ((best_mv->col + ss[i + 2].mv.col) > x->mv_col_min); - all_in &= ((best_mv->col + ss[i + 3].mv.col) < x->mv_col_max); - - // If all the pixels are within the bounds we don't check whether the - // search point is valid in this loop, otherwise we check each point - // for validity.. - if (all_in) { - unsigned int sad_array[4]; - - for (j = 0; j < cfg->searches_per_step; j += 4) { - unsigned char const *block_offset[4]; - - for (t = 0; t < 4; t++) - block_offset[t] = ss[i + t].offset + best_address; - - fn_ptr->sdx4df(what, what_stride, block_offset, in_what_stride, - sad_array); - - for (t = 0; t < 4; t++, i++) { - if (sad_array[t] < bestsad) { - const MV this_mv = {best_mv->row + ss[i].mv.row, - best_mv->col + ss[i].mv.col}; - sad_array[t] += mvsad_err_cost(x, &this_mv, &fcenter_mv, - sad_per_bit); - if (sad_array[t] < bestsad) { - bestsad = sad_array[t]; - best_site = i; - } - } - } - } - } else { - for (j = 0; j < cfg->searches_per_step; j++) { - // Trap illegal vectors - const MV this_mv = {best_mv->row + ss[i].mv.row, - best_mv->col + ss[i].mv.col}; - - if (is_mv_in(x, &this_mv)) { - const uint8_t *const check_here = ss[i].offset + best_address; - unsigned int thissad = fn_ptr->sdf(what, what_stride, check_here, - in_what_stride); - - if (thissad < bestsad) { - thissad += mvsad_err_cost(x, &this_mv, &fcenter_mv, sad_per_bit); - if (thissad < bestsad) { - bestsad = thissad; - best_site = i; - } - } - } - i++; - } - } - if (best_site != last_site) { - best_mv->row += ss[best_site].mv.row; - best_mv->col += ss[best_site].mv.col; - best_address += ss[best_site].offset; - last_site = best_site; -#if defined(NEW_DIAMOND_SEARCH) - while (1) { - const MV this_mv = {best_mv->row + ss[best_site].mv.row, - best_mv->col + ss[best_site].mv.col}; - if (is_mv_in(x, &this_mv)) { - const uint8_t *const check_here = ss[best_site].offset + best_address; - unsigned int thissad = fn_ptr->sdf(what, what_stride, check_here, - in_what_stride); - if (thissad < bestsad) { - thissad += mvsad_err_cost(x, &this_mv, &fcenter_mv, sad_per_bit); - if (thissad < bestsad) { - bestsad = thissad; - best_mv->row += ss[best_site].mv.row; - best_mv->col += ss[best_site].mv.col; - best_address += ss[best_site].offset; - continue; - } - } - } - break; - }; -#endif - } else if (best_address == in_what) { - (*num00)++; - } - } - return bestsad; -} - -static int vector_match(int16_t *ref, int16_t *src, int bwl) { - int best_sad = INT_MAX; - int this_sad; - int d; - int center, offset = 0; - int bw = 4 << bwl; // redundant variable, to be changed in the experiments. - for (d = 0; d <= bw; d += 16) { - this_sad = vp9_vector_var(&ref[d], src, bwl); - if (this_sad < best_sad) { - best_sad = this_sad; - offset = d; - } - } - center = offset; - - for (d = -8; d <= 8; d += 16) { - int this_pos = offset + d; - // check limit - if (this_pos < 0 || this_pos > bw) - continue; - this_sad = vp9_vector_var(&ref[this_pos], src, bwl); - if (this_sad < best_sad) { - best_sad = this_sad; - center = this_pos; - } - } - offset = center; - - for (d = -4; d <= 4; d += 8) { - int this_pos = offset + d; - // check limit - if (this_pos < 0 || this_pos > bw) - continue; - this_sad = vp9_vector_var(&ref[this_pos], src, bwl); - if (this_sad < best_sad) { - best_sad = this_sad; - center = this_pos; - } - } - offset = center; - - for (d = -2; d <= 2; d += 4) { - int this_pos = offset + d; - // check limit - if (this_pos < 0 || this_pos > bw) - continue; - this_sad = vp9_vector_var(&ref[this_pos], src, bwl); - if (this_sad < best_sad) { - best_sad = this_sad; - center = this_pos; - } - } - offset = center; - - for (d = -1; d <= 1; d += 2) { - int this_pos = offset + d; - // check limit - if (this_pos < 0 || this_pos > bw) - continue; - this_sad = vp9_vector_var(&ref[this_pos], src, bwl); - if (this_sad < best_sad) { - best_sad = this_sad; - center = this_pos; - } - } - - return (center - (bw >> 1)); -} - -static const MV search_pos[4] = { - {-1, 0}, {0, -1}, {0, 1}, {1, 0}, -}; - -unsigned int vp9_int_pro_motion_estimation(const VP9_COMP *cpi, MACROBLOCK *x, - BLOCK_SIZE bsize) { - MACROBLOCKD *xd = &x->e_mbd; - DECLARE_ALIGNED(16, int16_t, hbuf[128]); - DECLARE_ALIGNED(16, int16_t, vbuf[128]); - DECLARE_ALIGNED(16, int16_t, src_hbuf[64]); - DECLARE_ALIGNED(16, int16_t, src_vbuf[64]); - int idx; - const int bw = 4 << b_width_log2_lookup[bsize]; - const int bh = 4 << b_height_log2_lookup[bsize]; - const int search_width = bw << 1; - const int search_height = bh << 1; - const int src_stride = x->plane[0].src.stride; - const int ref_stride = xd->plane[0].pre[0].stride; - uint8_t const *ref_buf, *src_buf; - MV *tmp_mv = &xd->mi[0].src_mi->mbmi.mv[0].as_mv; - unsigned int best_sad, tmp_sad, this_sad[4]; - MV this_mv; - const int norm_factor = 3 + (bw >> 5); - -#if CONFIG_VP9_HIGHBITDEPTH - tmp_mv->row = 0; - tmp_mv->col = 0; - return cpi->fn_ptr[bsize].sdf(x->plane[0].src.buf, src_stride, - xd->plane[0].pre[0].buf, ref_stride); -#endif - - // Set up prediction 1-D reference set - ref_buf = xd->plane[0].pre[0].buf - (bw >> 1); - for (idx = 0; idx < search_width; idx += 16) { - vp9_int_pro_row(&hbuf[idx], ref_buf, ref_stride, bh); - ref_buf += 16; - } - - ref_buf = xd->plane[0].pre[0].buf - (bh >> 1) * ref_stride; - for (idx = 0; idx < search_height; ++idx) { - vbuf[idx] = vp9_int_pro_col(ref_buf, bw) >> norm_factor; - ref_buf += ref_stride; - } - - // Set up src 1-D reference set - for (idx = 0; idx < bw; idx += 16) { - src_buf = x->plane[0].src.buf + idx; - vp9_int_pro_row(&src_hbuf[idx], src_buf, src_stride, bh); - } - - src_buf = x->plane[0].src.buf; - for (idx = 0; idx < bh; ++idx) { - src_vbuf[idx] = vp9_int_pro_col(src_buf, bw) >> norm_factor; - src_buf += src_stride; - } - - // Find the best match per 1-D search - tmp_mv->col = vector_match(hbuf, src_hbuf, b_width_log2_lookup[bsize]); - tmp_mv->row = vector_match(vbuf, src_vbuf, b_height_log2_lookup[bsize]); - - this_mv = *tmp_mv; - src_buf = x->plane[0].src.buf; - ref_buf = xd->plane[0].pre[0].buf + this_mv.row * ref_stride + this_mv.col; - best_sad = cpi->fn_ptr[bsize].sdf(src_buf, src_stride, ref_buf, ref_stride); - - { - const uint8_t * const pos[4] = { - ref_buf - ref_stride, - ref_buf - 1, - ref_buf + 1, - ref_buf + ref_stride, - }; - - cpi->fn_ptr[bsize].sdx4df(src_buf, src_stride, pos, ref_stride, this_sad); - } - - for (idx = 0; idx < 4; ++idx) { - if (this_sad[idx] < best_sad) { - best_sad = this_sad[idx]; - tmp_mv->row = search_pos[idx].row + this_mv.row; - tmp_mv->col = search_pos[idx].col + this_mv.col; - } - } - - if (this_sad[0] < this_sad[3]) - this_mv.row -= 1; - else - this_mv.row += 1; - - if (this_sad[1] < this_sad[2]) - this_mv.col -= 1; - else - this_mv.col += 1; - - ref_buf = xd->plane[0].pre[0].buf + this_mv.row * ref_stride + this_mv.col; - - tmp_sad = cpi->fn_ptr[bsize].sdf(src_buf, src_stride, - ref_buf, ref_stride); - if (best_sad > tmp_sad) { - *tmp_mv = this_mv; - best_sad = tmp_sad; - } - - tmp_mv->row *= 8; - tmp_mv->col *= 8; - - return best_sad; -} - -/* do_refine: If last step (1-away) of n-step search doesn't pick the center - point as the best match, we will do a final 1-away diamond - refining search */ -int vp9_full_pixel_diamond(const VP9_COMP *cpi, MACROBLOCK *x, - MV *mvp_full, int step_param, - int sadpb, int further_steps, int do_refine, - int *cost_list, - const vp9_variance_fn_ptr_t *fn_ptr, - const MV *ref_mv, MV *dst_mv) { - MV temp_mv; - int thissme, n, num00 = 0; - int bestsme = cpi->diamond_search_sad(x, &cpi->ss_cfg, mvp_full, &temp_mv, - step_param, sadpb, &n, - fn_ptr, ref_mv); - if (bestsme < INT_MAX) - bestsme = vp9_get_mvpred_var(x, &temp_mv, ref_mv, fn_ptr, 1); - *dst_mv = temp_mv; - - // If there won't be more n-step search, check to see if refining search is - // needed. - if (n > further_steps) - do_refine = 0; - - while (n < further_steps) { - ++n; - - if (num00) { - num00--; - } else { - thissme = cpi->diamond_search_sad(x, &cpi->ss_cfg, mvp_full, &temp_mv, - step_param + n, sadpb, &num00, - fn_ptr, ref_mv); - if (thissme < INT_MAX) - thissme = vp9_get_mvpred_var(x, &temp_mv, ref_mv, fn_ptr, 1); - - // check to see if refining search is needed. - if (num00 > further_steps - n) - do_refine = 0; - - if (thissme < bestsme) { - bestsme = thissme; - *dst_mv = temp_mv; - } - } - } - - // final 1-away diamond refining search - if (do_refine) { - const int search_range = 8; - MV best_mv = *dst_mv; - thissme = vp9_refining_search_sad(x, &best_mv, sadpb, search_range, - fn_ptr, ref_mv); - if (thissme < INT_MAX) - thissme = vp9_get_mvpred_var(x, &best_mv, ref_mv, fn_ptr, 1); - if (thissme < bestsme) { - bestsme = thissme; - *dst_mv = best_mv; - } - } - - // Return cost list. - if (cost_list) { - calc_int_cost_list(x, ref_mv, sadpb, fn_ptr, dst_mv, cost_list); - } - return bestsme; -} - -int vp9_full_search_sad_c(const MACROBLOCK *x, const MV *ref_mv, - int sad_per_bit, int distance, - const vp9_variance_fn_ptr_t *fn_ptr, - const MV *center_mv, MV *best_mv) { - int r, c; - const MACROBLOCKD *const xd = &x->e_mbd; - const struct buf_2d *const what = &x->plane[0].src; - const struct buf_2d *const in_what = &xd->plane[0].pre[0]; - const int row_min = MAX(ref_mv->row - distance, x->mv_row_min); - const int row_max = MIN(ref_mv->row + distance, x->mv_row_max); - const int col_min = MAX(ref_mv->col - distance, x->mv_col_min); - const int col_max = MIN(ref_mv->col + distance, x->mv_col_max); - const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3}; - int best_sad = fn_ptr->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, ref_mv), in_what->stride) + - mvsad_err_cost(x, ref_mv, &fcenter_mv, sad_per_bit); - *best_mv = *ref_mv; - - for (r = row_min; r < row_max; ++r) { - for (c = col_min; c < col_max; ++c) { - const MV mv = {r, c}; - const int sad = fn_ptr->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, &mv), in_what->stride) + - mvsad_err_cost(x, &mv, &fcenter_mv, sad_per_bit); - if (sad < best_sad) { - best_sad = sad; - *best_mv = mv; - } - } - } - return best_sad; -} - -int vp9_full_search_sadx3(const MACROBLOCK *x, const MV *ref_mv, - int sad_per_bit, int distance, - const vp9_variance_fn_ptr_t *fn_ptr, - const MV *center_mv, MV *best_mv) { - int r; - const MACROBLOCKD *const xd = &x->e_mbd; - const struct buf_2d *const what = &x->plane[0].src; - const struct buf_2d *const in_what = &xd->plane[0].pre[0]; - const int row_min = MAX(ref_mv->row - distance, x->mv_row_min); - const int row_max = MIN(ref_mv->row + distance, x->mv_row_max); - const int col_min = MAX(ref_mv->col - distance, x->mv_col_min); - const int col_max = MIN(ref_mv->col + distance, x->mv_col_max); - const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3}; - unsigned int best_sad = fn_ptr->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, ref_mv), in_what->stride) + - mvsad_err_cost(x, ref_mv, &fcenter_mv, sad_per_bit); - *best_mv = *ref_mv; - - for (r = row_min; r < row_max; ++r) { - int c = col_min; - const uint8_t *check_here = &in_what->buf[r * in_what->stride + c]; - - if (fn_ptr->sdx3f != NULL) { - while ((c + 2) < col_max) { - int i; - unsigned int sads[3]; - - fn_ptr->sdx3f(what->buf, what->stride, check_here, in_what->stride, - sads); - - for (i = 0; i < 3; ++i) { - unsigned int sad = sads[i]; - if (sad < best_sad) { - const MV mv = {r, c}; - sad += mvsad_err_cost(x, &mv, &fcenter_mv, sad_per_bit); - if (sad < best_sad) { - best_sad = sad; - *best_mv = mv; - } - } - ++check_here; - ++c; - } - } - } - - while (c < col_max) { - unsigned int sad = fn_ptr->sdf(what->buf, what->stride, - check_here, in_what->stride); - if (sad < best_sad) { - const MV mv = {r, c}; - sad += mvsad_err_cost(x, &mv, &fcenter_mv, sad_per_bit); - if (sad < best_sad) { - best_sad = sad; - *best_mv = mv; - } - } - ++check_here; - ++c; - } - } - - return best_sad; -} - -int vp9_full_search_sadx8(const MACROBLOCK *x, const MV *ref_mv, - int sad_per_bit, int distance, - const vp9_variance_fn_ptr_t *fn_ptr, - const MV *center_mv, MV *best_mv) { - int r; - const MACROBLOCKD *const xd = &x->e_mbd; - const struct buf_2d *const what = &x->plane[0].src; - const struct buf_2d *const in_what = &xd->plane[0].pre[0]; - const int row_min = MAX(ref_mv->row - distance, x->mv_row_min); - const int row_max = MIN(ref_mv->row + distance, x->mv_row_max); - const int col_min = MAX(ref_mv->col - distance, x->mv_col_min); - const int col_max = MIN(ref_mv->col + distance, x->mv_col_max); - const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3}; - unsigned int best_sad = fn_ptr->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, ref_mv), in_what->stride) + - mvsad_err_cost(x, ref_mv, &fcenter_mv, sad_per_bit); - *best_mv = *ref_mv; - - for (r = row_min; r < row_max; ++r) { - int c = col_min; - const uint8_t *check_here = &in_what->buf[r * in_what->stride + c]; - - if (fn_ptr->sdx8f != NULL) { - while ((c + 7) < col_max) { - int i; - unsigned int sads[8]; - - fn_ptr->sdx8f(what->buf, what->stride, check_here, in_what->stride, - sads); - - for (i = 0; i < 8; ++i) { - unsigned int sad = sads[i]; - if (sad < best_sad) { - const MV mv = {r, c}; - sad += mvsad_err_cost(x, &mv, &fcenter_mv, sad_per_bit); - if (sad < best_sad) { - best_sad = sad; - *best_mv = mv; - } - } - ++check_here; - ++c; - } - } - } - - if (fn_ptr->sdx3f != NULL) { - while ((c + 2) < col_max) { - int i; - unsigned int sads[3]; - - fn_ptr->sdx3f(what->buf, what->stride, check_here, in_what->stride, - sads); - - for (i = 0; i < 3; ++i) { - unsigned int sad = sads[i]; - if (sad < best_sad) { - const MV mv = {r, c}; - sad += mvsad_err_cost(x, &mv, &fcenter_mv, sad_per_bit); - if (sad < best_sad) { - best_sad = sad; - *best_mv = mv; - } - } - ++check_here; - ++c; - } - } - } - - while (c < col_max) { - unsigned int sad = fn_ptr->sdf(what->buf, what->stride, - check_here, in_what->stride); - if (sad < best_sad) { - const MV mv = {r, c}; - sad += mvsad_err_cost(x, &mv, &fcenter_mv, sad_per_bit); - if (sad < best_sad) { - best_sad = sad; - *best_mv = mv; - } - } - ++check_here; - ++c; - } - } - - return best_sad; -} - -int vp9_refining_search_sad(const MACROBLOCK *x, - MV *ref_mv, int error_per_bit, - int search_range, - const vp9_variance_fn_ptr_t *fn_ptr, - const MV *center_mv) { - const MACROBLOCKD *const xd = &x->e_mbd; - const MV neighbors[4] = {{ -1, 0}, {0, -1}, {0, 1}, {1, 0}}; - const struct buf_2d *const what = &x->plane[0].src; - const struct buf_2d *const in_what = &xd->plane[0].pre[0]; - const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3}; - const uint8_t *best_address = get_buf_from_mv(in_what, ref_mv); - unsigned int best_sad = fn_ptr->sdf(what->buf, what->stride, best_address, - in_what->stride) + - mvsad_err_cost(x, ref_mv, &fcenter_mv, error_per_bit); - int i, j; - - for (i = 0; i < search_range; i++) { - int best_site = -1; - const int all_in = ((ref_mv->row - 1) > x->mv_row_min) & - ((ref_mv->row + 1) < x->mv_row_max) & - ((ref_mv->col - 1) > x->mv_col_min) & - ((ref_mv->col + 1) < x->mv_col_max); - - if (all_in) { - unsigned int sads[4]; - const uint8_t *const positions[4] = { - best_address - in_what->stride, - best_address - 1, - best_address + 1, - best_address + in_what->stride - }; - - fn_ptr->sdx4df(what->buf, what->stride, positions, in_what->stride, sads); - - for (j = 0; j < 4; ++j) { - if (sads[j] < best_sad) { - const MV mv = {ref_mv->row + neighbors[j].row, - ref_mv->col + neighbors[j].col}; - sads[j] += mvsad_err_cost(x, &mv, &fcenter_mv, error_per_bit); - if (sads[j] < best_sad) { - best_sad = sads[j]; - best_site = j; - } - } - } - } else { - for (j = 0; j < 4; ++j) { - const MV mv = {ref_mv->row + neighbors[j].row, - ref_mv->col + neighbors[j].col}; - - if (is_mv_in(x, &mv)) { - unsigned int sad = fn_ptr->sdf(what->buf, what->stride, - get_buf_from_mv(in_what, &mv), - in_what->stride); - if (sad < best_sad) { - sad += mvsad_err_cost(x, &mv, &fcenter_mv, error_per_bit); - if (sad < best_sad) { - best_sad = sad; - best_site = j; - } - } - } - } - } - - if (best_site == -1) { - break; - } else { - ref_mv->row += neighbors[best_site].row; - ref_mv->col += neighbors[best_site].col; - best_address = get_buf_from_mv(in_what, ref_mv); - } - } - - return best_sad; -} - -// This function is called when we do joint motion search in comp_inter_inter -// mode. -int vp9_refining_search_8p_c(const MACROBLOCK *x, - MV *ref_mv, int error_per_bit, - int search_range, - const vp9_variance_fn_ptr_t *fn_ptr, - const MV *center_mv, - const uint8_t *second_pred) { - const MV neighbors[8] = {{-1, 0}, {0, -1}, {0, 1}, {1, 0}, - {-1, -1}, {1, -1}, {-1, 1}, {1, 1}}; - const MACROBLOCKD *const xd = &x->e_mbd; - const struct buf_2d *const what = &x->plane[0].src; - const struct buf_2d *const in_what = &xd->plane[0].pre[0]; - const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3}; - unsigned int best_sad = fn_ptr->sdaf(what->buf, what->stride, - get_buf_from_mv(in_what, ref_mv), in_what->stride, second_pred) + - mvsad_err_cost(x, ref_mv, &fcenter_mv, error_per_bit); - int i, j; - - for (i = 0; i < search_range; ++i) { - int best_site = -1; - - for (j = 0; j < 8; ++j) { - const MV mv = {ref_mv->row + neighbors[j].row, - ref_mv->col + neighbors[j].col}; - - if (is_mv_in(x, &mv)) { - unsigned int sad = fn_ptr->sdaf(what->buf, what->stride, - get_buf_from_mv(in_what, &mv), in_what->stride, second_pred); - if (sad < best_sad) { - sad += mvsad_err_cost(x, &mv, &fcenter_mv, error_per_bit); - if (sad < best_sad) { - best_sad = sad; - best_site = j; - } - } - } - } - - if (best_site == -1) { - break; - } else { - ref_mv->row += neighbors[best_site].row; - ref_mv->col += neighbors[best_site].col; - } - } - return best_sad; -} - -int vp9_full_pixel_search(VP9_COMP *cpi, MACROBLOCK *x, - BLOCK_SIZE bsize, MV *mvp_full, - int step_param, int error_per_bit, - int *cost_list, - const MV *ref_mv, MV *tmp_mv, - int var_max, int rd) { - const SPEED_FEATURES *const sf = &cpi->sf; - const SEARCH_METHODS method = sf->mv.search_method; - vp9_variance_fn_ptr_t *fn_ptr = &cpi->fn_ptr[bsize]; - int var = 0; - if (cost_list) { - cost_list[0] = INT_MAX; - cost_list[1] = INT_MAX; - cost_list[2] = INT_MAX; - cost_list[3] = INT_MAX; - cost_list[4] = INT_MAX; - } - - switch (method) { - case FAST_DIAMOND: - var = vp9_fast_dia_search(x, mvp_full, step_param, error_per_bit, 0, - cost_list, fn_ptr, 1, ref_mv, tmp_mv); - break; - case FAST_HEX: - var = vp9_fast_hex_search(x, mvp_full, step_param, error_per_bit, 0, - cost_list, fn_ptr, 1, ref_mv, tmp_mv); - break; - case HEX: - var = vp9_hex_search(x, mvp_full, step_param, error_per_bit, 1, - cost_list, fn_ptr, 1, ref_mv, tmp_mv); - break; - case SQUARE: - var = vp9_square_search(x, mvp_full, step_param, error_per_bit, 1, - cost_list, fn_ptr, 1, ref_mv, tmp_mv); - break; - case BIGDIA: - var = vp9_bigdia_search(x, mvp_full, step_param, error_per_bit, 1, - cost_list, fn_ptr, 1, ref_mv, tmp_mv); - break; - case NSTEP: - var = vp9_full_pixel_diamond(cpi, x, mvp_full, step_param, error_per_bit, - MAX_MVSEARCH_STEPS - 1 - step_param, - 1, cost_list, fn_ptr, ref_mv, tmp_mv); - break; - default: - assert(0 && "Invalid search method."); - } - - if (method != NSTEP && rd && var < var_max) - var = vp9_get_mvpred_var(x, tmp_mv, ref_mv, fn_ptr, 1); - - return var; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_mcomp.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_mcomp.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_mcomp.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_mcomp.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,164 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP9_ENCODER_VP9_MCOMP_H_ -#define VP9_ENCODER_VP9_MCOMP_H_ - -#include "vp9/encoder/vp9_block.h" -#include "vp9/encoder/vp9_variance.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// The maximum number of steps in a step search given the largest -// allowed initial step -#define MAX_MVSEARCH_STEPS 11 -// Max full pel mv specified in the unit of full pixel -// Enable the use of motion vector in range [-1023, 1023]. -#define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS - 1)) - 1) -// Maximum size of the first step in full pel units -#define MAX_FIRST_STEP (1 << (MAX_MVSEARCH_STEPS-1)) -// Allowed motion vector pixel distance outside image border -// for Block_16x16 -#define BORDER_MV_PIXELS_B16 (16 + VP9_INTERP_EXTEND) - -// motion search site -typedef struct search_site { - MV mv; - int offset; -} search_site; - -typedef struct search_site_config { - search_site ss[8 * MAX_MVSEARCH_STEPS + 1]; - int ss_count; - int searches_per_step; -} search_site_config; - -void vp9_init_dsmotion_compensation(search_site_config *cfg, int stride); -void vp9_init3smotion_compensation(search_site_config *cfg, int stride); - -void vp9_set_mv_search_range(MACROBLOCK *x, const MV *mv); -int vp9_mv_bit_cost(const MV *mv, const MV *ref, - const int *mvjcost, int *mvcost[2], int weight); - -// Utility to compute variance + MV rate cost for a given MV -int vp9_get_mvpred_var(const MACROBLOCK *x, - const MV *best_mv, const MV *center_mv, - const vp9_variance_fn_ptr_t *vfp, - int use_mvcost); -int vp9_get_mvpred_av_var(const MACROBLOCK *x, - const MV *best_mv, const MV *center_mv, - const uint8_t *second_pred, - const vp9_variance_fn_ptr_t *vfp, - int use_mvcost); - -struct VP9_COMP; -struct SPEED_FEATURES; - -int vp9_init_search_range(int size); - -int vp9_refining_search_sad(const struct macroblock *x, - struct mv *ref_mv, - int sad_per_bit, int distance, - const struct vp9_variance_vtable *fn_ptr, - const struct mv *center_mv); - -// Runs sequence of diamond searches in smaller steps for RD. -int vp9_full_pixel_diamond(const struct VP9_COMP *cpi, MACROBLOCK *x, - MV *mvp_full, int step_param, - int sadpb, int further_steps, int do_refine, - int *cost_list, - const vp9_variance_fn_ptr_t *fn_ptr, - const MV *ref_mv, MV *dst_mv); - -// Perform integral projection based motion estimation. -unsigned int vp9_int_pro_motion_estimation(const struct VP9_COMP *cpi, - MACROBLOCK *x, - BLOCK_SIZE bsize); - -typedef int (integer_mv_pattern_search_fn) ( - const MACROBLOCK *x, - MV *ref_mv, - int search_param, - int error_per_bit, - int do_init_search, - int *cost_list, - const vp9_variance_fn_ptr_t *vf, - int use_mvcost, - const MV *center_mv, - MV *best_mv); - -integer_mv_pattern_search_fn vp9_hex_search; -integer_mv_pattern_search_fn vp9_bigdia_search; -integer_mv_pattern_search_fn vp9_square_search; -integer_mv_pattern_search_fn vp9_fast_hex_search; -integer_mv_pattern_search_fn vp9_fast_dia_search; - -typedef int (fractional_mv_step_fp) ( - const MACROBLOCK *x, - MV *bestmv, const MV *ref_mv, - int allow_hp, - int error_per_bit, - const vp9_variance_fn_ptr_t *vfp, - int forced_stop, // 0 - full, 1 - qtr only, 2 - half only - int iters_per_step, - int *cost_list, - int *mvjcost, int *mvcost[2], - int *distortion, unsigned int *sse1, - const uint8_t *second_pred, - int w, int h); - -extern fractional_mv_step_fp vp9_find_best_sub_pixel_tree; -extern fractional_mv_step_fp vp9_find_best_sub_pixel_tree_pruned; -extern fractional_mv_step_fp vp9_find_best_sub_pixel_tree_pruned_more; -extern fractional_mv_step_fp vp9_find_best_sub_pixel_tree_pruned_evenmore; - -typedef int (*vp9_full_search_fn_t)(const MACROBLOCK *x, - const MV *ref_mv, int sad_per_bit, - int distance, - const vp9_variance_fn_ptr_t *fn_ptr, - const MV *center_mv, MV *best_mv); - -typedef int (*vp9_refining_search_fn_t)(const MACROBLOCK *x, - MV *ref_mv, int sad_per_bit, - int distance, - const vp9_variance_fn_ptr_t *fn_ptr, - const MV *center_mv); - -typedef int (*vp9_diamond_search_fn_t)(const MACROBLOCK *x, - const search_site_config *cfg, - MV *ref_mv, MV *best_mv, - int search_param, int sad_per_bit, - int *num00, - const vp9_variance_fn_ptr_t *fn_ptr, - const MV *center_mv); - -int vp9_refining_search_8p_c(const MACROBLOCK *x, - MV *ref_mv, int error_per_bit, - int search_range, - const vp9_variance_fn_ptr_t *fn_ptr, - const MV *center_mv, const uint8_t *second_pred); - -struct VP9_COMP; - -int vp9_full_pixel_search(struct VP9_COMP *cpi, MACROBLOCK *x, - BLOCK_SIZE bsize, MV *mvp_full, - int step_param, int error_per_bit, - int *cost_list, - const MV *ref_mv, MV *tmp_mv, - int var_max, int rd); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_MCOMP_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_picklpf.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_picklpf.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_picklpf.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_picklpf.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,191 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vpx_scale_rtcd.h" - -#include "vpx_mem/vpx_mem.h" - -#include "vp9/common/vp9_loopfilter.h" -#include "vp9/common/vp9_onyxc_int.h" -#include "vp9/common/vp9_quant_common.h" - -#include "vp9/encoder/vp9_encoder.h" -#include "vp9/encoder/vp9_picklpf.h" -#include "vp9/encoder/vp9_quantize.h" - -static int get_max_filter_level(const VP9_COMP *cpi) { - if (cpi->oxcf.pass == 2) { - return cpi->twopass.section_intra_rating > 8 ? MAX_LOOP_FILTER * 3 / 4 - : MAX_LOOP_FILTER; - } else { - return MAX_LOOP_FILTER; - } -} - - -static int64_t try_filter_frame(const YV12_BUFFER_CONFIG *sd, - VP9_COMP *const cpi, - int filt_level, int partial_frame) { - VP9_COMMON *const cm = &cpi->common; - int64_t filt_err; - - if (cpi->num_workers > 1) - vp9_loop_filter_frame_mt(cm->frame_to_show, cm, cpi->td.mb.e_mbd.plane, - filt_level, 1, partial_frame, - cpi->workers, cpi->num_workers, &cpi->lf_row_sync); - else - vp9_loop_filter_frame(cm->frame_to_show, cm, &cpi->td.mb.e_mbd, filt_level, - 1, partial_frame); - -#if CONFIG_VP9_HIGHBITDEPTH - if (cm->use_highbitdepth) { - filt_err = vp9_highbd_get_y_sse(sd, cm->frame_to_show); - } else { - filt_err = vp9_get_y_sse(sd, cm->frame_to_show); - } -#else - filt_err = vp9_get_y_sse(sd, cm->frame_to_show); -#endif // CONFIG_VP9_HIGHBITDEPTH - - // Re-instate the unfiltered frame - vpx_yv12_copy_y(&cpi->last_frame_uf, cm->frame_to_show); - - return filt_err; -} - -static int search_filter_level(const YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, - int partial_frame) { - const VP9_COMMON *const cm = &cpi->common; - const struct loopfilter *const lf = &cm->lf; - const int min_filter_level = 0; - const int max_filter_level = get_max_filter_level(cpi); - int filt_direction = 0; - int64_t best_err; - int filt_best; - - // Start the search at the previous frame filter level unless it is now out of - // range. - int filt_mid = clamp(lf->filter_level, min_filter_level, max_filter_level); - int filter_step = filt_mid < 16 ? 4 : filt_mid / 4; - // Sum squared error at each filter level - int64_t ss_err[MAX_LOOP_FILTER + 1]; - - // Set each entry to -1 - vpx_memset(ss_err, 0xFF, sizeof(ss_err)); - - // Make a copy of the unfiltered / processed recon buffer - vpx_yv12_copy_y(cm->frame_to_show, &cpi->last_frame_uf); - - best_err = try_filter_frame(sd, cpi, filt_mid, partial_frame); - filt_best = filt_mid; - ss_err[filt_mid] = best_err; - - while (filter_step > 0) { - const int filt_high = MIN(filt_mid + filter_step, max_filter_level); - const int filt_low = MAX(filt_mid - filter_step, min_filter_level); - - // Bias against raising loop filter in favor of lowering it. - int64_t bias = (best_err >> (15 - (filt_mid / 8))) * filter_step; - - if ((cpi->oxcf.pass == 2) && (cpi->twopass.section_intra_rating < 20)) - bias = (bias * cpi->twopass.section_intra_rating) / 20; - - // yx, bias less for large block size - if (cm->tx_mode != ONLY_4X4) - bias >>= 1; - - if (filt_direction <= 0 && filt_low != filt_mid) { - // Get Low filter error score - if (ss_err[filt_low] < 0) { - ss_err[filt_low] = try_filter_frame(sd, cpi, filt_low, partial_frame); - } - // If value is close to the best so far then bias towards a lower loop - // filter value. - if ((ss_err[filt_low] - bias) < best_err) { - // Was it actually better than the previous best? - if (ss_err[filt_low] < best_err) - best_err = ss_err[filt_low]; - - filt_best = filt_low; - } - } - - // Now look at filt_high - if (filt_direction >= 0 && filt_high != filt_mid) { - if (ss_err[filt_high] < 0) { - ss_err[filt_high] = try_filter_frame(sd, cpi, filt_high, partial_frame); - } - // Was it better than the previous best? - if (ss_err[filt_high] < (best_err - bias)) { - best_err = ss_err[filt_high]; - filt_best = filt_high; - } - } - - // Half the step distance if the best filter value was the same as last time - if (filt_best == filt_mid) { - filter_step /= 2; - filt_direction = 0; - } else { - filt_direction = (filt_best < filt_mid) ? -1 : 1; - filt_mid = filt_best; - } - } - - return filt_best; -} - -void vp9_pick_filter_level(const YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, - LPF_PICK_METHOD method) { - VP9_COMMON *const cm = &cpi->common; - struct loopfilter *const lf = &cm->lf; - - lf->sharpness_level = cm->frame_type == KEY_FRAME ? 0 - : cpi->oxcf.sharpness; - - if (method == LPF_PICK_MINIMAL_LPF && lf->filter_level) { - lf->filter_level = 0; - } else if (method >= LPF_PICK_FROM_Q) { - const int min_filter_level = 0; - const int max_filter_level = get_max_filter_level(cpi); - const int q = vp9_ac_quant(cm->base_qindex, 0, cm->bit_depth); - // These values were determined by linear fitting the result of the - // searched level, filt_guess = q * 0.316206 + 3.87252 -#if CONFIG_VP9_HIGHBITDEPTH - int filt_guess; - switch (cm->bit_depth) { - case VPX_BITS_8: - filt_guess = ROUND_POWER_OF_TWO(q * 20723 + 1015158, 18); - break; - case VPX_BITS_10: - filt_guess = ROUND_POWER_OF_TWO(q * 20723 + 4060632, 20); - break; - case VPX_BITS_12: - filt_guess = ROUND_POWER_OF_TWO(q * 20723 + 16242526, 22); - break; - default: - assert(0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10 " - "or VPX_BITS_12"); - return; - } -#else - int filt_guess = ROUND_POWER_OF_TWO(q * 20723 + 1015158, 18); -#endif // CONFIG_VP9_HIGHBITDEPTH - if (cm->frame_type == KEY_FRAME) - filt_guess -= 4; - lf->filter_level = clamp(filt_guess, min_filter_level, max_filter_level); - } else { - lf->filter_level = search_filter_level(sd, cpi, - method == LPF_PICK_FROM_SUBIMAGE); - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_picklpf.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_picklpf.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_picklpf.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_picklpf.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP9_ENCODER_VP9_PICKLPF_H_ -#define VP9_ENCODER_VP9_PICKLPF_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "vp9/encoder/vp9_encoder.h" - -struct yv12_buffer_config; -struct VP9_COMP; - -void vp9_pick_filter_level(const struct yv12_buffer_config *sd, - struct VP9_COMP *cpi, LPF_PICK_METHOD method); -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_PICKLPF_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_pickmode.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_pickmode.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_pickmode.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_pickmode.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1382 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include -#include - -#include "./vp9_rtcd.h" - -#include "vpx_mem/vpx_mem.h" - -#include "vp9/common/vp9_blockd.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_mvref_common.h" -#include "vp9/common/vp9_reconinter.h" -#include "vp9/common/vp9_reconintra.h" - -#include "vp9/encoder/vp9_encoder.h" -#include "vp9/encoder/vp9_pickmode.h" -#include "vp9/encoder/vp9_ratectrl.h" -#include "vp9/encoder/vp9_rd.h" - -typedef struct { - uint8_t *data; - int stride; - int in_use; -} PRED_BUFFER; - -static int mv_refs_rt(const VP9_COMMON *cm, const MACROBLOCKD *xd, - const TileInfo *const tile, - MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame, - int_mv *mv_ref_list, - int mi_row, int mi_col) { - const int *ref_sign_bias = cm->ref_frame_sign_bias; - int i, refmv_count = 0; - - const POSITION *const mv_ref_search = mv_ref_blocks[mi->mbmi.sb_type]; - - int different_ref_found = 0; - int context_counter = 0; - int const_motion = 0; - - // Blank the reference vector list - vpx_memset(mv_ref_list, 0, sizeof(*mv_ref_list) * MAX_MV_REF_CANDIDATES); - - // The nearest 2 blocks are treated differently - // if the size < 8x8 we get the mv from the bmi substructure, - // and we also need to keep a mode count. - for (i = 0; i < 2; ++i) { - const POSITION *const mv_ref = &mv_ref_search[i]; - if (is_inside(tile, mi_col, mi_row, cm->mi_rows, mv_ref)) { - const MODE_INFO *const candidate_mi = xd->mi[mv_ref->col + mv_ref->row * - xd->mi_stride].src_mi; - const MB_MODE_INFO *const candidate = &candidate_mi->mbmi; - // Keep counts for entropy encoding. - context_counter += mode_2_counter[candidate->mode]; - different_ref_found = 1; - - if (candidate->ref_frame[0] == ref_frame) - ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, 0, mv_ref->col, -1), - refmv_count, mv_ref_list, Done); - } - } - - const_motion = 1; - - // Check the rest of the neighbors in much the same way - // as before except we don't need to keep track of sub blocks or - // mode counts. - for (; i < MVREF_NEIGHBOURS && !refmv_count; ++i) { - const POSITION *const mv_ref = &mv_ref_search[i]; - if (is_inside(tile, mi_col, mi_row, cm->mi_rows, mv_ref)) { - const MB_MODE_INFO *const candidate = &xd->mi[mv_ref->col + mv_ref->row * - xd->mi_stride].src_mi->mbmi; - different_ref_found = 1; - - if (candidate->ref_frame[0] == ref_frame) - ADD_MV_REF_LIST(candidate->mv[0], refmv_count, mv_ref_list, Done); - } - } - - // Since we couldn't find 2 mvs from the same reference frame - // go back through the neighbors and find motion vectors from - // different reference frames. - if (different_ref_found && !refmv_count) { - for (i = 0; i < MVREF_NEIGHBOURS; ++i) { - const POSITION *mv_ref = &mv_ref_search[i]; - if (is_inside(tile, mi_col, mi_row, cm->mi_rows, mv_ref)) { - const MB_MODE_INFO *const candidate = &xd->mi[mv_ref->col + mv_ref->row - * xd->mi_stride].src_mi->mbmi; - - // If the candidate is INTRA we don't want to consider its mv. - IF_DIFF_REF_FRAME_ADD_MV(candidate, ref_frame, ref_sign_bias, - refmv_count, mv_ref_list, Done); - } - } - } - - Done: - - mi->mbmi.mode_context[ref_frame] = counter_to_context[context_counter]; - - // Clamp vectors - for (i = 0; i < MAX_MV_REF_CANDIDATES; ++i) - clamp_mv_ref(&mv_ref_list[i].as_mv, xd); - - return const_motion; -} - -static int combined_motion_search(VP9_COMP *cpi, MACROBLOCK *x, - BLOCK_SIZE bsize, int mi_row, int mi_col, - int_mv *tmp_mv, int *rate_mv, - int64_t best_rd_sofar) { - MACROBLOCKD *xd = &x->e_mbd; - MB_MODE_INFO *mbmi = &xd->mi[0].src_mi->mbmi; - struct buf_2d backup_yv12[MAX_MB_PLANE] = {{0, 0}}; - const int step_param = cpi->sf.mv.fullpel_search_step_param; - const int sadpb = x->sadperbit16; - MV mvp_full; - const int ref = mbmi->ref_frame[0]; - const MV ref_mv = mbmi->ref_mvs[ref][0].as_mv; - int dis; - int rate_mode; - const int tmp_col_min = x->mv_col_min; - const int tmp_col_max = x->mv_col_max; - const int tmp_row_min = x->mv_row_min; - const int tmp_row_max = x->mv_row_max; - int rv = 0; - int cost_list[5]; - const YV12_BUFFER_CONFIG *scaled_ref_frame = vp9_get_scaled_ref_frame(cpi, - ref); - if (scaled_ref_frame) { - int i; - // Swap out the reference frame for a version that's been scaled to - // match the resolution of the current frame, allowing the existing - // motion search code to be used without additional modifications. - for (i = 0; i < MAX_MB_PLANE; i++) - backup_yv12[i] = xd->plane[i].pre[0]; - vp9_setup_pre_planes(xd, 0, scaled_ref_frame, mi_row, mi_col, NULL); - } - vp9_set_mv_search_range(x, &ref_mv); - - assert(x->mv_best_ref_index[ref] <= 2); - if (x->mv_best_ref_index[ref] < 2) - mvp_full = mbmi->ref_mvs[ref][x->mv_best_ref_index[ref]].as_mv; - else - mvp_full = x->pred_mv[ref]; - - mvp_full.col >>= 3; - mvp_full.row >>= 3; - - vp9_full_pixel_search(cpi, x, bsize, &mvp_full, step_param, sadpb, - cond_cost_list(cpi, cost_list), - &ref_mv, &tmp_mv->as_mv, INT_MAX, 0); - - x->mv_col_min = tmp_col_min; - x->mv_col_max = tmp_col_max; - x->mv_row_min = tmp_row_min; - x->mv_row_max = tmp_row_max; - - // calculate the bit cost on motion vector - mvp_full.row = tmp_mv->as_mv.row * 8; - mvp_full.col = tmp_mv->as_mv.col * 8; - - *rate_mv = vp9_mv_bit_cost(&mvp_full, &ref_mv, - x->nmvjointcost, x->mvcost, MV_COST_WEIGHT); - - rate_mode = cpi->inter_mode_cost[mbmi->mode_context[ref]] - [INTER_OFFSET(NEWMV)]; - rv = !(RDCOST(x->rdmult, x->rddiv, (*rate_mv + rate_mode), 0) > - best_rd_sofar); - - if (rv) { - cpi->find_fractional_mv_step(x, &tmp_mv->as_mv, &ref_mv, - cpi->common.allow_high_precision_mv, - x->errorperbit, - &cpi->fn_ptr[bsize], - cpi->sf.mv.subpel_force_stop, - cpi->sf.mv.subpel_iters_per_step, - cond_cost_list(cpi, cost_list), - x->nmvjointcost, x->mvcost, - &dis, &x->pred_sse[ref], NULL, 0, 0); - } - - if (scaled_ref_frame) { - int i; - for (i = 0; i < MAX_MB_PLANE; i++) - xd->plane[i].pre[0] = backup_yv12[i]; - } - return rv; -} - - -static void model_rd_for_sb_y(VP9_COMP *cpi, BLOCK_SIZE bsize, - MACROBLOCK *x, MACROBLOCKD *xd, - int *out_rate_sum, int64_t *out_dist_sum, - unsigned int *var_y, unsigned int *sse_y) { - // Note our transform coeffs are 8 times an orthogonal transform. - // Hence quantizer step is also 8 times. To get effective quantizer - // we need to divide by 8 before sending to modeling function. - unsigned int sse; - int rate; - int64_t dist; - struct macroblock_plane *const p = &x->plane[0]; - struct macroblockd_plane *const pd = &xd->plane[0]; - const int64_t dc_thr = p->quant_thred[0] >> 6; - const int64_t ac_thr = p->quant_thred[1] >> 6; - const uint32_t dc_quant = pd->dequant[0]; - const uint32_t ac_quant = pd->dequant[1]; - unsigned int var = cpi->fn_ptr[bsize].vf(p->src.buf, p->src.stride, - pd->dst.buf, pd->dst.stride, &sse); - int skip_dc = 0; - - *var_y = var; - *sse_y = sse; - - if (cpi->common.tx_mode == TX_MODE_SELECT) { - if (sse > (var << 2)) - xd->mi[0].src_mi->mbmi.tx_size = - MIN(max_txsize_lookup[bsize], - tx_mode_to_biggest_tx_size[cpi->common.tx_mode]); - else - xd->mi[0].src_mi->mbmi.tx_size = TX_8X8; - - if (cpi->sf.partition_search_type == VAR_BASED_PARTITION) { - if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && - cyclic_refresh_segment_id_boosted(xd->mi[0].src_mi->mbmi.segment_id)) - xd->mi[0].src_mi->mbmi.tx_size = TX_8X8; - else if (xd->mi[0].src_mi->mbmi.tx_size > TX_16X16) - xd->mi[0].src_mi->mbmi.tx_size = TX_16X16; - } - } else { - xd->mi[0].src_mi->mbmi.tx_size = - MIN(max_txsize_lookup[bsize], - tx_mode_to_biggest_tx_size[cpi->common.tx_mode]); - } - - // Evaluate if the partition block is a skippable block in Y plane. - { - const BLOCK_SIZE unit_size = - txsize_to_bsize[xd->mi[0].src_mi->mbmi.tx_size]; - const unsigned int num_blk_log2 = - (b_width_log2_lookup[bsize] - b_width_log2_lookup[unit_size]) + - (b_height_log2_lookup[bsize] - b_height_log2_lookup[unit_size]); - const unsigned int sse_tx = sse >> num_blk_log2; - const unsigned int var_tx = var >> num_blk_log2; - - x->skip_txfm[0] = 0; - // Check if all ac coefficients can be quantized to zero. - if (var_tx < ac_thr || var == 0) { - x->skip_txfm[0] = 2; - // Check if dc coefficient can be quantized to zero. - if (sse_tx - var_tx < dc_thr || sse == var) - x->skip_txfm[0] = 1; - } else { - if (sse_tx - var_tx < dc_thr || sse == var) - skip_dc = 1; - } - } - - if (x->skip_txfm[0] == 1) { - *out_rate_sum = 0; - *out_dist_sum = sse << 4; - return; - } - - if (!skip_dc) { -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - vp9_model_rd_from_var_lapndz(sse - var, num_pels_log2_lookup[bsize], - dc_quant >> (xd->bd - 5), &rate, &dist); - } else { - vp9_model_rd_from_var_lapndz(sse - var, num_pels_log2_lookup[bsize], - dc_quant >> 3, &rate, &dist); - } -#else - vp9_model_rd_from_var_lapndz(sse - var, num_pels_log2_lookup[bsize], - dc_quant >> 3, &rate, &dist); -#endif // CONFIG_VP9_HIGHBITDEPTH - } - - if (!skip_dc) { - *out_rate_sum = rate >> 1; - *out_dist_sum = dist << 3; - } else { - *out_rate_sum = 0; - *out_dist_sum = (sse - var) << 4; - } - -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - vp9_model_rd_from_var_lapndz(var, num_pels_log2_lookup[bsize], - ac_quant >> (xd->bd - 5), &rate, &dist); - } else { - vp9_model_rd_from_var_lapndz(var, num_pels_log2_lookup[bsize], - ac_quant >> 3, &rate, &dist); - } -#else - vp9_model_rd_from_var_lapndz(var, num_pels_log2_lookup[bsize], - ac_quant >> 3, &rate, &dist); -#endif // CONFIG_VP9_HIGHBITDEPTH - - *out_rate_sum += rate; - *out_dist_sum += dist << 4; -} - -static void model_rd_for_sb_uv(VP9_COMP *cpi, BLOCK_SIZE bsize, - MACROBLOCK *x, MACROBLOCKD *xd, - int *out_rate_sum, int64_t *out_dist_sum, - unsigned int *var_y, unsigned int *sse_y) { - // Note our transform coeffs are 8 times an orthogonal transform. - // Hence quantizer step is also 8 times. To get effective quantizer - // we need to divide by 8 before sending to modeling function. - unsigned int sse; - int rate; - int64_t dist; - int i; - - *out_rate_sum = 0; - *out_dist_sum = 0; - - for (i = 1; i <= 2; ++i) { - struct macroblock_plane *const p = &x->plane[i]; - struct macroblockd_plane *const pd = &xd->plane[i]; - const uint32_t dc_quant = pd->dequant[0]; - const uint32_t ac_quant = pd->dequant[1]; - const BLOCK_SIZE bs = get_plane_block_size(bsize, pd); - unsigned int var; - - if (!x->color_sensitivity[i - 1]) - continue; - - var = cpi->fn_ptr[bs].vf(p->src.buf, p->src.stride, - pd->dst.buf, pd->dst.stride, &sse); - *var_y += var; - *sse_y += sse; - - #if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - vp9_model_rd_from_var_lapndz(sse - var, num_pels_log2_lookup[bs], - dc_quant >> (xd->bd - 5), &rate, &dist); - } else { - vp9_model_rd_from_var_lapndz(sse - var, num_pels_log2_lookup[bs], - dc_quant >> 3, &rate, &dist); - } - #else - vp9_model_rd_from_var_lapndz(sse - var, num_pels_log2_lookup[bs], - dc_quant >> 3, &rate, &dist); - #endif // CONFIG_VP9_HIGHBITDEPTH - - *out_rate_sum += rate >> 1; - *out_dist_sum += dist << 3; - - #if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - vp9_model_rd_from_var_lapndz(var, num_pels_log2_lookup[bs], - ac_quant >> (xd->bd - 5), &rate, &dist); - } else { - vp9_model_rd_from_var_lapndz(var, num_pels_log2_lookup[bs], - ac_quant >> 3, &rate, &dist); - } - #else - vp9_model_rd_from_var_lapndz(var, num_pels_log2_lookup[bs], - ac_quant >> 3, &rate, &dist); - #endif // CONFIG_VP9_HIGHBITDEPTH - - *out_rate_sum += rate; - *out_dist_sum += dist << 4; - } -} - -static int get_pred_buffer(PRED_BUFFER *p, int len) { - int i; - - for (i = 0; i < len; i++) { - if (!p[i].in_use) { - p[i].in_use = 1; - return i; - } - } - return -1; -} - -static void free_pred_buffer(PRED_BUFFER *p) { - if (p != NULL) - p->in_use = 0; -} - -static void encode_breakout_test(VP9_COMP *cpi, MACROBLOCK *x, - BLOCK_SIZE bsize, int mi_row, int mi_col, - MV_REFERENCE_FRAME ref_frame, - PREDICTION_MODE this_mode, - unsigned int var_y, unsigned int sse_y, - struct buf_2d yv12_mb[][MAX_MB_PLANE], - int *rate, int64_t *dist) { - MACROBLOCKD *xd = &x->e_mbd; - MB_MODE_INFO *mbmi = &xd->mi[0].src_mi->mbmi; - - const BLOCK_SIZE uv_size = get_plane_block_size(bsize, &xd->plane[1]); - unsigned int var = var_y, sse = sse_y; - // Skipping threshold for ac. - unsigned int thresh_ac; - // Skipping threshold for dc. - unsigned int thresh_dc; - if (x->encode_breakout > 0) { - // Set a maximum for threshold to avoid big PSNR loss in low bit rate - // case. Use extreme low threshold for static frames to limit - // skipping. - const unsigned int max_thresh = 36000; - // The encode_breakout input - const unsigned int min_thresh = - MIN(((unsigned int)x->encode_breakout << 4), max_thresh); -#if CONFIG_VP9_HIGHBITDEPTH - const int shift = (xd->bd << 1) - 16; -#endif - - // Calculate threshold according to dequant value. - thresh_ac = (xd->plane[0].dequant[1] * xd->plane[0].dequant[1]) >> 3; -#if CONFIG_VP9_HIGHBITDEPTH - if ((xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) && shift > 0) { - thresh_ac = ROUND_POWER_OF_TWO(thresh_ac, shift); - } -#endif // CONFIG_VP9_HIGHBITDEPTH - thresh_ac = clamp(thresh_ac, min_thresh, max_thresh); - - // Adjust ac threshold according to partition size. - thresh_ac >>= - 8 - (b_width_log2_lookup[bsize] + b_height_log2_lookup[bsize]); - - thresh_dc = (xd->plane[0].dequant[0] * xd->plane[0].dequant[0] >> 6); -#if CONFIG_VP9_HIGHBITDEPTH - if ((xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) && shift > 0) { - thresh_dc = ROUND_POWER_OF_TWO(thresh_dc, shift); - } -#endif // CONFIG_VP9_HIGHBITDEPTH - } else { - thresh_ac = 0; - thresh_dc = 0; - } - - // Y skipping condition checking for ac and dc. - if (var <= thresh_ac && (sse - var) <= thresh_dc) { - unsigned int sse_u, sse_v; - unsigned int var_u, var_v; - - // Skip UV prediction unless breakout is zero (lossless) to save - // computation with low impact on the result - if (x->encode_breakout == 0) { - xd->plane[1].pre[0] = yv12_mb[ref_frame][1]; - xd->plane[2].pre[0] = yv12_mb[ref_frame][2]; - vp9_build_inter_predictors_sbuv(xd, mi_row, mi_col, bsize); - } - - var_u = cpi->fn_ptr[uv_size].vf(x->plane[1].src.buf, - x->plane[1].src.stride, - xd->plane[1].dst.buf, - xd->plane[1].dst.stride, &sse_u); - - // U skipping condition checking - if (((var_u << 2) <= thresh_ac) && (sse_u - var_u <= thresh_dc)) { - var_v = cpi->fn_ptr[uv_size].vf(x->plane[2].src.buf, - x->plane[2].src.stride, - xd->plane[2].dst.buf, - xd->plane[2].dst.stride, &sse_v); - - // V skipping condition checking - if (((var_v << 2) <= thresh_ac) && (sse_v - var_v <= thresh_dc)) { - x->skip = 1; - - // The cost of skip bit needs to be added. - *rate = cpi->inter_mode_cost[mbmi->mode_context[ref_frame]] - [INTER_OFFSET(this_mode)]; - - // More on this part of rate - // rate += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 1); - - // Scaling factor for SSE from spatial domain to frequency - // domain is 16. Adjust distortion accordingly. - // TODO(yunqingwang): In this function, only y-plane dist is - // calculated. - *dist = (sse << 4); // + ((sse_u + sse_v) << 4); - - // *disable_skip = 1; - } - } - } -} - -struct estimate_block_intra_args { - VP9_COMP *cpi; - MACROBLOCK *x; - PREDICTION_MODE mode; - int rate; - int64_t dist; -}; - -static void estimate_block_intra(int plane, int block, BLOCK_SIZE plane_bsize, - TX_SIZE tx_size, void *arg) { - struct estimate_block_intra_args* const args = arg; - VP9_COMP *const cpi = args->cpi; - MACROBLOCK *const x = args->x; - MACROBLOCKD *const xd = &x->e_mbd; - struct macroblock_plane *const p = &x->plane[0]; - struct macroblockd_plane *const pd = &xd->plane[0]; - const BLOCK_SIZE bsize_tx = txsize_to_bsize[tx_size]; - uint8_t *const src_buf_base = p->src.buf; - uint8_t *const dst_buf_base = pd->dst.buf; - const int src_stride = p->src.stride; - const int dst_stride = pd->dst.stride; - int i, j; - int rate; - int64_t dist; - unsigned int var_y, sse_y; - txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j); - assert(plane == 0); - (void) plane; - - p->src.buf = &src_buf_base[4 * (j * src_stride + i)]; - pd->dst.buf = &dst_buf_base[4 * (j * dst_stride + i)]; - // Use source buffer as an approximation for the fully reconstructed buffer. - vp9_predict_intra_block(xd, block >> (2 * tx_size), - b_width_log2_lookup[plane_bsize], - tx_size, args->mode, - x->skip_encode ? p->src.buf : pd->dst.buf, - x->skip_encode ? src_stride : dst_stride, - pd->dst.buf, dst_stride, - i, j, 0); - // This procedure assumes zero offset from p->src.buf and pd->dst.buf. - model_rd_for_sb_y(cpi, bsize_tx, x, xd, &rate, &dist, &var_y, &sse_y); - p->src.buf = src_buf_base; - pd->dst.buf = dst_buf_base; - args->rate += rate; - args->dist += dist; -} - -static const THR_MODES mode_idx[MAX_REF_FRAMES - 1][4] = { - {THR_DC, THR_H_PRED, THR_V_PRED, THR_TM}, - {THR_NEARESTMV, THR_NEARMV, THR_ZEROMV, THR_NEWMV}, - {THR_NEARESTG, THR_NEARG, THR_ZEROG, THR_NEWG}, -}; - -static const PREDICTION_MODE intra_mode_list[] = { - DC_PRED, V_PRED, H_PRED, TM_PRED -}; - -void vp9_pick_intra_mode(VP9_COMP *cpi, MACROBLOCK *x, RD_COST *rd_cost, - BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi; - RD_COST this_rdc, best_rdc; - PREDICTION_MODE this_mode; - struct estimate_block_intra_args args = { cpi, x, DC_PRED, 0, 0 }; - const TX_SIZE intra_tx_size = - MIN(max_txsize_lookup[bsize], - tx_mode_to_biggest_tx_size[cpi->common.tx_mode]); - MODE_INFO *const mic = xd->mi[0].src_mi; - int *bmode_costs; - const MODE_INFO *above_mi = xd->mi[-xd->mi_stride].src_mi; - const MODE_INFO *left_mi = xd->left_available ? xd->mi[-1].src_mi : NULL; - const PREDICTION_MODE A = vp9_above_block_mode(mic, above_mi, 0); - const PREDICTION_MODE L = vp9_left_block_mode(mic, left_mi, 0); - bmode_costs = cpi->y_mode_costs[A][L]; - - (void) ctx; - vp9_rd_cost_reset(&best_rdc); - vp9_rd_cost_reset(&this_rdc); - - mbmi->ref_frame[0] = INTRA_FRAME; - mbmi->mv[0].as_int = INVALID_MV; - mbmi->uv_mode = DC_PRED; - vpx_memset(x->skip_txfm, 0, sizeof(x->skip_txfm)); - - // Change the limit of this loop to add other intra prediction - // mode tests. - for (this_mode = DC_PRED; this_mode <= H_PRED; ++this_mode) { - args.mode = this_mode; - args.rate = 0; - args.dist = 0; - mbmi->tx_size = intra_tx_size; - vp9_foreach_transformed_block_in_plane(xd, bsize, 0, - estimate_block_intra, &args); - this_rdc.rate = args.rate; - this_rdc.dist = args.dist; - this_rdc.rate += bmode_costs[this_mode]; - this_rdc.rdcost = RDCOST(x->rdmult, x->rddiv, - this_rdc.rate, this_rdc.dist); - - if (this_rdc.rdcost < best_rdc.rdcost) { - best_rdc = this_rdc; - mbmi->mode = this_mode; - } - } - - *rd_cost = best_rdc; -} - -static const int ref_frame_cost[MAX_REF_FRAMES] = { - 1235, 229, 530, 615, -}; - -typedef struct { - MV_REFERENCE_FRAME ref_frame; - PREDICTION_MODE pred_mode; -} REF_MODE; - -#define RT_INTER_MODES 8 -static const REF_MODE ref_mode_set[RT_INTER_MODES] = { - {LAST_FRAME, ZEROMV}, - {LAST_FRAME, NEARESTMV}, - {GOLDEN_FRAME, ZEROMV}, - {LAST_FRAME, NEARMV}, - {LAST_FRAME, NEWMV}, - {GOLDEN_FRAME, NEARESTMV}, - {GOLDEN_FRAME, NEARMV}, - {GOLDEN_FRAME, NEWMV} -}; - -// TODO(jingning) placeholder for inter-frame non-RD mode decision. -// this needs various further optimizations. to be continued.. -void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, - TileDataEnc *tile_data, - int mi_row, int mi_col, RD_COST *rd_cost, - BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx) { - VP9_COMMON *const cm = &cpi->common; - TileInfo *const tile_info = &tile_data->tile_info; - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi; - struct macroblockd_plane *const pd = &xd->plane[0]; - PREDICTION_MODE best_mode = ZEROMV; - MV_REFERENCE_FRAME ref_frame, best_ref_frame = LAST_FRAME; - MV_REFERENCE_FRAME usable_ref_frame; - TX_SIZE best_tx_size = TX_SIZES; - INTERP_FILTER best_pred_filter = EIGHTTAP; - int_mv frame_mv[MB_MODE_COUNT][MAX_REF_FRAMES]; - struct buf_2d yv12_mb[4][MAX_MB_PLANE]; - static const int flag_list[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG, - VP9_ALT_FLAG }; - RD_COST this_rdc, best_rdc; - uint8_t skip_txfm = 0, best_mode_skip_txfm = 0; - // var_y and sse_y are saved to be used in skipping checking - unsigned int var_y = UINT_MAX; - unsigned int sse_y = UINT_MAX; - // Reduce the intra cost penalty for small blocks (<=16x16). - const int reduction_fac = - (cpi->sf.partition_search_type == VAR_BASED_PARTITION && - bsize <= BLOCK_16X16) ? 2 : 0; - const int intra_cost_penalty = vp9_get_intra_cost_penalty( - cm->base_qindex, cm->y_dc_delta_q, cm->bit_depth) >> reduction_fac; - const int64_t inter_mode_thresh = RDCOST(x->rdmult, x->rddiv, - intra_cost_penalty, 0); - const int *const rd_threshes = cpi->rd.threshes[mbmi->segment_id][bsize]; - const int *const rd_thresh_freq_fact = tile_data->thresh_freq_fact[bsize]; - INTERP_FILTER filter_ref; - const int bsl = mi_width_log2_lookup[bsize]; - const int pred_filter_search = cm->interp_filter == SWITCHABLE ? - (((mi_row + mi_col) >> bsl) + - get_chessboard_index(cm->current_video_frame)) & 0x1 : 0; - int const_motion[MAX_REF_FRAMES] = { 0 }; - const int bh = num_4x4_blocks_high_lookup[bsize] << 2; - const int bw = num_4x4_blocks_wide_lookup[bsize] << 2; - // For speed 6, the result of interp filter is reused later in actual encoding - // process. - // tmp[3] points to dst buffer, and the other 3 point to allocated buffers. - PRED_BUFFER tmp[4]; - DECLARE_ALIGNED_ARRAY(16, uint8_t, pred_buf, 3 * 64 * 64); -#if CONFIG_VP9_HIGHBITDEPTH - DECLARE_ALIGNED_ARRAY(16, uint16_t, pred_buf_16, 3 * 64 * 64); -#endif - struct buf_2d orig_dst = pd->dst; - PRED_BUFFER *best_pred = NULL; - PRED_BUFFER *this_mode_pred = NULL; - const int pixels_in_block = bh * bw; - int reuse_inter_pred = cpi->sf.reuse_inter_pred_sby && ctx->pred_pixel_ready; - int ref_frame_skip_mask = 0; - int idx; - int best_pred_sad = INT_MAX; - - if (reuse_inter_pred) { - int i; - for (i = 0; i < 3; i++) { -#if CONFIG_VP9_HIGHBITDEPTH - if (cm->use_highbitdepth) - tmp[i].data = CONVERT_TO_BYTEPTR(&pred_buf_16[pixels_in_block * i]); - else - tmp[i].data = &pred_buf[pixels_in_block * i]; -#else - tmp[i].data = &pred_buf[pixels_in_block * i]; -#endif // CONFIG_VP9_HIGHBITDEPTH - tmp[i].stride = bw; - tmp[i].in_use = 0; - } - tmp[3].data = pd->dst.buf; - tmp[3].stride = pd->dst.stride; - tmp[3].in_use = 0; - } - - x->skip_encode = cpi->sf.skip_encode_frame && x->q_index < QIDX_SKIP_THRESH; - x->skip = 0; - - if (xd->up_available) - filter_ref = xd->mi[-xd->mi_stride].src_mi->mbmi.interp_filter; - else if (xd->left_available) - filter_ref = xd->mi[-1].src_mi->mbmi.interp_filter; - else - filter_ref = cm->interp_filter; - - // initialize mode decisions - vp9_rd_cost_reset(&best_rdc); - vp9_rd_cost_reset(rd_cost); - mbmi->sb_type = bsize; - mbmi->ref_frame[0] = NONE; - mbmi->ref_frame[1] = NONE; - mbmi->tx_size = MIN(max_txsize_lookup[bsize], - tx_mode_to_biggest_tx_size[cm->tx_mode]); - -#if CONFIG_VP9_TEMPORAL_DENOISING - vp9_denoiser_reset_frame_stats(ctx); -#endif - - if (cpi->rc.frames_since_golden == 0) { - cpi->ref_frame_flags &= (~VP9_GOLD_FLAG); - usable_ref_frame = LAST_FRAME; - } else { - usable_ref_frame = GOLDEN_FRAME; - } - - for (ref_frame = LAST_FRAME; ref_frame <= usable_ref_frame; ++ref_frame) { - const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_buffer(cpi, ref_frame); - - x->pred_mv_sad[ref_frame] = INT_MAX; - frame_mv[NEWMV][ref_frame].as_int = INVALID_MV; - frame_mv[ZEROMV][ref_frame].as_int = 0; - - if ((cpi->ref_frame_flags & flag_list[ref_frame]) && (yv12 != NULL)) { - int_mv *const candidates = mbmi->ref_mvs[ref_frame]; - const struct scale_factors *const sf = &cm->frame_refs[ref_frame - 1].sf; - - vp9_setup_pred_block(xd, yv12_mb[ref_frame], yv12, mi_row, mi_col, - sf, sf); - - if (cm->use_prev_frame_mvs) - vp9_find_mv_refs(cm, xd, tile_info, xd->mi[0].src_mi, ref_frame, - candidates, mi_row, mi_col, NULL, NULL); - else - const_motion[ref_frame] = mv_refs_rt(cm, xd, tile_info, - xd->mi[0].src_mi, - ref_frame, candidates, - mi_row, mi_col); - - vp9_find_best_ref_mvs(xd, cm->allow_high_precision_mv, candidates, - &frame_mv[NEARESTMV][ref_frame], - &frame_mv[NEARMV][ref_frame]); - - if (!vp9_is_scaled(sf) && bsize >= BLOCK_8X8) - vp9_mv_pred(cpi, x, yv12_mb[ref_frame][0].buf, yv12->y_stride, - ref_frame, bsize); - } else { - ref_frame_skip_mask |= (1 << ref_frame); - } - } - - for (idx = 0; idx < RT_INTER_MODES; ++idx) { - int rate_mv = 0; - int mode_rd_thresh; - int mode_index; - int i; - PREDICTION_MODE this_mode = ref_mode_set[idx].pred_mode; - if (!(cpi->sf.inter_mode_mask[bsize] & (1 << this_mode))) - continue; - - ref_frame = ref_mode_set[idx].ref_frame; - if (!(cpi->ref_frame_flags & flag_list[ref_frame])) - continue; - if (const_motion[ref_frame] && this_mode == NEARMV) - continue; - - i = (ref_frame == LAST_FRAME) ? GOLDEN_FRAME : LAST_FRAME; - if (cpi->ref_frame_flags & flag_list[i]) - if (x->pred_mv_sad[ref_frame] > (x->pred_mv_sad[i] << 1)) - ref_frame_skip_mask |= (1 << ref_frame); - if (ref_frame_skip_mask & (1 << ref_frame)) - continue; - - // Select prediction reference frames. - for (i = 0; i < MAX_MB_PLANE; i++) - xd->plane[i].pre[0] = yv12_mb[ref_frame][i]; - - mbmi->ref_frame[0] = ref_frame; - set_ref_ptrs(cm, xd, ref_frame, NONE); - - mode_index = mode_idx[ref_frame][INTER_OFFSET(this_mode)]; - mode_rd_thresh = best_mode_skip_txfm ? - rd_threshes[mode_index] << 1 : rd_threshes[mode_index]; - if (rd_less_than_thresh(best_rdc.rdcost, mode_rd_thresh, - rd_thresh_freq_fact[mode_index])) - continue; - - if (this_mode == NEWMV) { - if (ref_frame > LAST_FRAME) { - int tmp_sad; - int dis, cost_list[5]; - - if (bsize < BLOCK_16X16) - continue; - - tmp_sad = vp9_int_pro_motion_estimation(cpi, x, bsize); - - if (tmp_sad > x->pred_mv_sad[LAST_FRAME]) - continue; - if (tmp_sad + (num_pels_log2_lookup[bsize] << 4) > best_pred_sad) - continue; - - frame_mv[NEWMV][ref_frame].as_int = mbmi->mv[0].as_int; - rate_mv = vp9_mv_bit_cost(&frame_mv[NEWMV][ref_frame].as_mv, - &mbmi->ref_mvs[ref_frame][0].as_mv, - x->nmvjointcost, x->mvcost, MV_COST_WEIGHT); - frame_mv[NEWMV][ref_frame].as_mv.row >>= 3; - frame_mv[NEWMV][ref_frame].as_mv.col >>= 3; - - cpi->find_fractional_mv_step(x, &frame_mv[NEWMV][ref_frame].as_mv, - &mbmi->ref_mvs[ref_frame][0].as_mv, - cpi->common.allow_high_precision_mv, - x->errorperbit, - &cpi->fn_ptr[bsize], - cpi->sf.mv.subpel_force_stop, - cpi->sf.mv.subpel_iters_per_step, - cond_cost_list(cpi, cost_list), - x->nmvjointcost, x->mvcost, &dis, - &x->pred_sse[ref_frame], NULL, 0, 0); - } else if (!combined_motion_search(cpi, x, bsize, mi_row, mi_col, - &frame_mv[NEWMV][ref_frame], &rate_mv, best_rdc.rdcost)) { - continue; - } - } - - if (this_mode == NEWMV && ref_frame == LAST_FRAME && - frame_mv[NEWMV][LAST_FRAME].as_int != INVALID_MV) { - const int pre_stride = xd->plane[0].pre[0].stride; - const uint8_t * const pre_buf = xd->plane[0].pre[0].buf + - (frame_mv[NEWMV][LAST_FRAME].as_mv.row >> 3) * pre_stride + - (frame_mv[NEWMV][LAST_FRAME].as_mv.col >> 3); - best_pred_sad = cpi->fn_ptr[bsize].sdf(x->plane[0].src.buf, - x->plane[0].src.stride, - pre_buf, pre_stride); - } - - if (this_mode != NEARESTMV && - frame_mv[this_mode][ref_frame].as_int == - frame_mv[NEARESTMV][ref_frame].as_int) - continue; - - mbmi->mode = this_mode; - mbmi->mv[0].as_int = frame_mv[this_mode][ref_frame].as_int; - - // Search for the best prediction filter type, when the resulting - // motion vector is at sub-pixel accuracy level for luma component, i.e., - // the last three bits are all zeros. - if (reuse_inter_pred) { - if (!this_mode_pred) { - this_mode_pred = &tmp[3]; - } else { - this_mode_pred = &tmp[get_pred_buffer(tmp, 3)]; - pd->dst.buf = this_mode_pred->data; - pd->dst.stride = bw; - } - } - - if ((this_mode == NEWMV || filter_ref == SWITCHABLE) && pred_filter_search - && (ref_frame == LAST_FRAME) - && (((mbmi->mv[0].as_mv.row | mbmi->mv[0].as_mv.col) & 0x07) != 0)) { - int pf_rate[3]; - int64_t pf_dist[3]; - unsigned int pf_var[3]; - unsigned int pf_sse[3]; - TX_SIZE pf_tx_size[3]; - int64_t best_cost = INT64_MAX; - INTERP_FILTER best_filter = SWITCHABLE, filter; - PRED_BUFFER *current_pred = this_mode_pred; - - for (filter = EIGHTTAP; filter <= EIGHTTAP_SHARP; ++filter) { - int64_t cost; - mbmi->interp_filter = filter; - vp9_build_inter_predictors_sby(xd, mi_row, mi_col, bsize); - model_rd_for_sb_y(cpi, bsize, x, xd, &pf_rate[filter], &pf_dist[filter], - &pf_var[filter], &pf_sse[filter]); - pf_rate[filter] += vp9_get_switchable_rate(cpi, xd); - cost = RDCOST(x->rdmult, x->rddiv, pf_rate[filter], pf_dist[filter]); - pf_tx_size[filter] = mbmi->tx_size; - if (cost < best_cost) { - best_filter = filter; - best_cost = cost; - skip_txfm = x->skip_txfm[0]; - - if (reuse_inter_pred) { - if (this_mode_pred != current_pred) { - free_pred_buffer(this_mode_pred); - this_mode_pred = current_pred; - } - - if (filter < EIGHTTAP_SHARP) { - current_pred = &tmp[get_pred_buffer(tmp, 3)]; - pd->dst.buf = current_pred->data; - pd->dst.stride = bw; - } - } - } - } - - if (reuse_inter_pred && this_mode_pred != current_pred) - free_pred_buffer(current_pred); - - mbmi->interp_filter = best_filter; - mbmi->tx_size = pf_tx_size[best_filter]; - this_rdc.rate = pf_rate[best_filter]; - this_rdc.dist = pf_dist[best_filter]; - var_y = pf_var[best_filter]; - sse_y = pf_sse[best_filter]; - x->skip_txfm[0] = skip_txfm; - } else { - mbmi->interp_filter = (filter_ref == SWITCHABLE) ? EIGHTTAP : filter_ref; - vp9_build_inter_predictors_sby(xd, mi_row, mi_col, bsize); - model_rd_for_sb_y(cpi, bsize, x, xd, &this_rdc.rate, &this_rdc.dist, - &var_y, &sse_y); - this_rdc.rate += - cm->interp_filter == SWITCHABLE ? - vp9_get_switchable_rate(cpi, xd) : 0; - } - - // chroma component rate-distortion cost modeling - if (x->color_sensitivity[0] || x->color_sensitivity[1]) { - int uv_rate = 0; - int64_t uv_dist = 0; - if (x->color_sensitivity[0]) - vp9_build_inter_predictors_sbp(xd, mi_row, mi_col, bsize, 1); - if (x->color_sensitivity[1]) - vp9_build_inter_predictors_sbp(xd, mi_row, mi_col, bsize, 2); - model_rd_for_sb_uv(cpi, bsize, x, xd, &uv_rate, &uv_dist, &var_y, &sse_y); - this_rdc.rate += uv_rate; - this_rdc.dist += uv_dist; - } - - this_rdc.rate += rate_mv; - this_rdc.rate += - cpi->inter_mode_cost[mbmi->mode_context[ref_frame]][INTER_OFFSET( - this_mode)]; - this_rdc.rate += ref_frame_cost[ref_frame]; - this_rdc.rdcost = RDCOST(x->rdmult, x->rddiv, this_rdc.rate, this_rdc.dist); - - // Skipping checking: test to see if this block can be reconstructed by - // prediction only. - if (cpi->allow_encode_breakout) { - encode_breakout_test(cpi, x, bsize, mi_row, mi_col, ref_frame, this_mode, - var_y, sse_y, yv12_mb, &this_rdc.rate, - &this_rdc.dist); - if (x->skip) { - this_rdc.rate += rate_mv; - this_rdc.rdcost = RDCOST(x->rdmult, x->rddiv, this_rdc.rate, - this_rdc.dist); - } - } - -#if CONFIG_VP9_TEMPORAL_DENOISING - if (cpi->oxcf.noise_sensitivity > 0) - vp9_denoiser_update_frame_stats(mbmi, sse_y, this_mode, ctx); -#else - (void)ctx; -#endif - - if (this_rdc.rdcost < best_rdc.rdcost || x->skip) { - best_rdc = this_rdc; - best_mode = this_mode; - best_pred_filter = mbmi->interp_filter; - best_tx_size = mbmi->tx_size; - best_ref_frame = ref_frame; - best_mode_skip_txfm = x->skip_txfm[0]; - - if (reuse_inter_pred) { - free_pred_buffer(best_pred); - best_pred = this_mode_pred; - } - } else { - if (reuse_inter_pred) - free_pred_buffer(this_mode_pred); - } - - if (x->skip) - break; - } - - mbmi->mode = best_mode; - mbmi->interp_filter = best_pred_filter; - mbmi->tx_size = best_tx_size; - mbmi->ref_frame[0] = best_ref_frame; - mbmi->mv[0].as_int = frame_mv[best_mode][best_ref_frame].as_int; - xd->mi[0].src_mi->bmi[0].as_mv[0].as_int = mbmi->mv[0].as_int; - x->skip_txfm[0] = best_mode_skip_txfm; - - // Perform intra prediction search, if the best SAD is above a certain - // threshold. - if (best_rdc.rdcost == INT64_MAX || - (!x->skip && best_rdc.rdcost > inter_mode_thresh && - bsize <= cpi->sf.max_intra_bsize)) { - struct estimate_block_intra_args args = { cpi, x, DC_PRED, 0, 0 }; - const TX_SIZE intra_tx_size = - MIN(max_txsize_lookup[bsize], - tx_mode_to_biggest_tx_size[cpi->common.tx_mode]); - int i; - TX_SIZE best_intra_tx_size = TX_SIZES; - - if (reuse_inter_pred && best_pred != NULL) { - if (best_pred->data == orig_dst.buf) { - this_mode_pred = &tmp[get_pred_buffer(tmp, 3)]; -#if CONFIG_VP9_HIGHBITDEPTH - if (cm->use_highbitdepth) - vp9_highbd_convolve_copy(best_pred->data, best_pred->stride, - this_mode_pred->data, this_mode_pred->stride, - NULL, 0, NULL, 0, bw, bh, xd->bd); - else - vp9_convolve_copy(best_pred->data, best_pred->stride, - this_mode_pred->data, this_mode_pred->stride, - NULL, 0, NULL, 0, bw, bh); -#else - vp9_convolve_copy(best_pred->data, best_pred->stride, - this_mode_pred->data, this_mode_pred->stride, - NULL, 0, NULL, 0, bw, bh); -#endif // CONFIG_VP9_HIGHBITDEPTH - best_pred = this_mode_pred; - } - } - pd->dst = orig_dst; - - for (i = 0; i < 4; ++i) { - const PREDICTION_MODE this_mode = intra_mode_list[i]; - if (!((1 << this_mode) & cpi->sf.intra_y_mode_mask[intra_tx_size])) - continue; - args.mode = this_mode; - args.rate = 0; - args.dist = 0; - mbmi->tx_size = intra_tx_size; - vp9_foreach_transformed_block_in_plane(xd, bsize, 0, - estimate_block_intra, &args); - this_rdc.rate = args.rate; - this_rdc.dist = args.dist; - this_rdc.rate += cpi->mbmode_cost[this_mode]; - this_rdc.rate += ref_frame_cost[INTRA_FRAME]; - this_rdc.rate += intra_cost_penalty; - this_rdc.rdcost = RDCOST(x->rdmult, x->rddiv, - this_rdc.rate, this_rdc.dist); - - if (this_rdc.rdcost < best_rdc.rdcost) { - best_rdc = this_rdc; - mbmi->mode = this_mode; - best_intra_tx_size = mbmi->tx_size; - mbmi->ref_frame[0] = INTRA_FRAME; - mbmi->uv_mode = this_mode; - mbmi->mv[0].as_int = INVALID_MV; - } - } - - // Reset mb_mode_info to the best inter mode. - if (mbmi->ref_frame[0] != INTRA_FRAME) { - x->skip_txfm[0] = best_mode_skip_txfm; - mbmi->tx_size = best_tx_size; - } else { - mbmi->tx_size = best_intra_tx_size; - } - } - - pd->dst = orig_dst; - - if (reuse_inter_pred && best_pred != NULL) { - if (best_pred->data != orig_dst.buf && is_inter_mode(mbmi->mode)) { -#if CONFIG_VP9_HIGHBITDEPTH - if (cm->use_highbitdepth) - vp9_highbd_convolve_copy(best_pred->data, best_pred->stride, - pd->dst.buf, pd->dst.stride, NULL, 0, - NULL, 0, bw, bh, xd->bd); - else - vp9_convolve_copy(best_pred->data, best_pred->stride, - pd->dst.buf, pd->dst.stride, NULL, 0, - NULL, 0, bw, bh); -#else - vp9_convolve_copy(best_pred->data, best_pred->stride, - pd->dst.buf, pd->dst.stride, NULL, 0, - NULL, 0, bw, bh); -#endif // CONFIG_VP9_HIGHBITDEPTH - } - } - - if (cpi->sf.adaptive_rd_thresh) { - THR_MODES best_mode_idx = is_inter_block(mbmi) ? - mode_idx[best_ref_frame][INTER_OFFSET(mbmi->mode)] : - mode_idx[INTRA_FRAME][mbmi->mode]; - PREDICTION_MODE this_mode; - for (ref_frame = LAST_FRAME; ref_frame <= GOLDEN_FRAME; ++ref_frame) { - if (best_ref_frame != ref_frame) continue; - for (this_mode = NEARESTMV; this_mode <= NEWMV; ++this_mode) { - THR_MODES thr_mode_idx = mode_idx[ref_frame][INTER_OFFSET(this_mode)]; - int *freq_fact = &tile_data->thresh_freq_fact[bsize][thr_mode_idx]; - if (thr_mode_idx == best_mode_idx) - *freq_fact -= (*freq_fact >> 4); - else - *freq_fact = MIN(*freq_fact + RD_THRESH_INC, - cpi->sf.adaptive_rd_thresh * RD_THRESH_MAX_FACT); - } - } - } - - *rd_cost = best_rdc; -} - -void vp9_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x, - TileDataEnc *tile_data, - int mi_row, int mi_col, RD_COST *rd_cost, - BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx) { - VP9_COMMON *const cm = &cpi->common; - TileInfo *const tile_info = &tile_data->tile_info; - SPEED_FEATURES *const sf = &cpi->sf; - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi; - const struct segmentation *const seg = &cm->seg; - MV_REFERENCE_FRAME ref_frame, second_ref_frame = NONE; - MV_REFERENCE_FRAME best_ref_frame = NONE; - unsigned char segment_id = mbmi->segment_id; - struct buf_2d yv12_mb[4][MAX_MB_PLANE]; - static const int flag_list[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG, - VP9_ALT_FLAG }; - int64_t best_rd = INT64_MAX; - b_mode_info bsi[MAX_REF_FRAMES][4]; - int ref_frame_skip_mask = 0; - const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize]; - const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bsize]; - int idx, idy; - - x->skip_encode = sf->skip_encode_frame && x->q_index < QIDX_SKIP_THRESH; - ctx->pred_pixel_ready = 0; - - for (ref_frame = LAST_FRAME; ref_frame <= GOLDEN_FRAME; ++ref_frame) { - const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_buffer(cpi, ref_frame); - int_mv dummy_mv[2]; - x->pred_mv_sad[ref_frame] = INT_MAX; - - if ((cpi->ref_frame_flags & flag_list[ref_frame]) && (yv12 != NULL)) { - int_mv *const candidates = mbmi->ref_mvs[ref_frame]; - const struct scale_factors *const sf = - &cm->frame_refs[ref_frame - 1].sf; - vp9_setup_pred_block(xd, yv12_mb[ref_frame], yv12, mi_row, mi_col, - sf, sf); - vp9_find_mv_refs(cm, xd, tile_info, xd->mi[0].src_mi, ref_frame, - candidates, mi_row, mi_col, NULL, NULL); - - vp9_find_best_ref_mvs(xd, cm->allow_high_precision_mv, candidates, - &dummy_mv[0], &dummy_mv[1]); - } else { - ref_frame_skip_mask |= (1 << ref_frame); - } - } - - mbmi->sb_type = bsize; - mbmi->tx_size = TX_4X4; - mbmi->uv_mode = DC_PRED; - mbmi->ref_frame[0] = LAST_FRAME; - mbmi->ref_frame[1] = NONE; - mbmi->interp_filter = cm->interp_filter == SWITCHABLE ? EIGHTTAP - : cm->interp_filter; - - for (ref_frame = LAST_FRAME; ref_frame <= GOLDEN_FRAME; ++ref_frame) { - int64_t this_rd = 0; - int plane; - - if (ref_frame_skip_mask & (1 << ref_frame)) - continue; - - // TODO(jingning, agrange): Scaling reference frame not supported for - // sub8x8 blocks. Is this supported now? - if (ref_frame > INTRA_FRAME && - vp9_is_scaled(&cm->frame_refs[ref_frame - 1].sf)) - continue; - - // If the segment reference frame feature is enabled.... - // then do nothing if the current ref frame is not allowed.. - if (vp9_segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME) && - vp9_get_segdata(seg, segment_id, SEG_LVL_REF_FRAME) != (int)ref_frame) - continue; - - mbmi->ref_frame[0] = ref_frame; - x->skip = 0; - set_ref_ptrs(cm, xd, ref_frame, second_ref_frame); - - // Select prediction reference frames. - for (plane = 0; plane < MAX_MB_PLANE; plane++) - xd->plane[plane].pre[0] = yv12_mb[ref_frame][plane]; - - for (idy = 0; idy < 2; idy += num_4x4_blocks_high) { - for (idx = 0; idx < 2; idx += num_4x4_blocks_wide) { - int_mv b_mv[MB_MODE_COUNT]; - int64_t b_best_rd = INT64_MAX; - const int i = idy * 2 + idx; - PREDICTION_MODE this_mode; - RD_COST this_rdc; - unsigned int var_y, sse_y; - - struct macroblock_plane *p = &x->plane[0]; - struct macroblockd_plane *pd = &xd->plane[0]; - - const struct buf_2d orig_src = p->src; - const struct buf_2d orig_dst = pd->dst; - struct buf_2d orig_pre[2]; - vpx_memcpy(orig_pre, xd->plane[0].pre, sizeof(orig_pre)); - - // set buffer pointers for sub8x8 motion search. - p->src.buf = - &p->src.buf[vp9_raster_block_offset(BLOCK_8X8, i, p->src.stride)]; - pd->dst.buf = - &pd->dst.buf[vp9_raster_block_offset(BLOCK_8X8, i, pd->dst.stride)]; - pd->pre[0].buf = - &pd->pre[0].buf[vp9_raster_block_offset(BLOCK_8X8, - i, pd->pre[0].stride)]; - - b_mv[ZEROMV].as_int = 0; - b_mv[NEWMV].as_int = INVALID_MV; - vp9_append_sub8x8_mvs_for_idx(cm, xd, tile_info, i, 0, mi_row, mi_col, - &b_mv[NEARESTMV], - &b_mv[NEARMV]); - - for (this_mode = NEARESTMV; this_mode <= NEWMV; ++this_mode) { - int b_rate = 0; - xd->mi[0].bmi[i].as_mv[0].as_int = b_mv[this_mode].as_int; - - if (this_mode == NEWMV) { - const int step_param = cpi->sf.mv.fullpel_search_step_param; - MV mvp_full; - MV tmp_mv; - int cost_list[5]; - const int tmp_col_min = x->mv_col_min; - const int tmp_col_max = x->mv_col_max; - const int tmp_row_min = x->mv_row_min; - const int tmp_row_max = x->mv_row_max; - int dummy_dist; - - if (i == 0) { - mvp_full.row = b_mv[NEARESTMV].as_mv.row >> 3; - mvp_full.col = b_mv[NEARESTMV].as_mv.col >> 3; - } else { - mvp_full.row = xd->mi[0].bmi[0].as_mv[0].as_mv.row >> 3; - mvp_full.col = xd->mi[0].bmi[0].as_mv[0].as_mv.col >> 3; - } - - vp9_set_mv_search_range(x, &mbmi->ref_mvs[0]->as_mv); - - vp9_full_pixel_search( - cpi, x, bsize, &mvp_full, step_param, x->sadperbit4, - cond_cost_list(cpi, cost_list), - &mbmi->ref_mvs[ref_frame][0].as_mv, &tmp_mv, - INT_MAX, 0); - - x->mv_col_min = tmp_col_min; - x->mv_col_max = tmp_col_max; - x->mv_row_min = tmp_row_min; - x->mv_row_max = tmp_row_max; - - // calculate the bit cost on motion vector - mvp_full.row = tmp_mv.row * 8; - mvp_full.col = tmp_mv.col * 8; - - b_rate += vp9_mv_bit_cost(&mvp_full, - &mbmi->ref_mvs[ref_frame][0].as_mv, - x->nmvjointcost, x->mvcost, - MV_COST_WEIGHT); - - b_rate += cpi->inter_mode_cost[mbmi->mode_context[ref_frame]] - [INTER_OFFSET(NEWMV)]; - if (RDCOST(x->rdmult, x->rddiv, b_rate, 0) > b_best_rd) - continue; - - cpi->find_fractional_mv_step(x, &tmp_mv, - &mbmi->ref_mvs[ref_frame][0].as_mv, - cpi->common.allow_high_precision_mv, - x->errorperbit, - &cpi->fn_ptr[bsize], - cpi->sf.mv.subpel_force_stop, - cpi->sf.mv.subpel_iters_per_step, - cond_cost_list(cpi, cost_list), - x->nmvjointcost, x->mvcost, - &dummy_dist, - &x->pred_sse[ref_frame], NULL, 0, 0); - - xd->mi[0].bmi[i].as_mv[0].as_mv = tmp_mv; - } else { - b_rate += cpi->inter_mode_cost[mbmi->mode_context[ref_frame]] - [INTER_OFFSET(this_mode)]; - } - -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - vp9_highbd_build_inter_predictor(pd->pre[0].buf, pd->pre[0].stride, - pd->dst.buf, pd->dst.stride, - &xd->mi[0].bmi[i].as_mv[0].as_mv, - &xd->block_refs[0]->sf, - 4 * num_4x4_blocks_wide, - 4 * num_4x4_blocks_high, 0, - vp9_get_interp_kernel(mbmi->interp_filter), - MV_PRECISION_Q3, - mi_col * MI_SIZE + 4 * (i & 0x01), - mi_row * MI_SIZE + 4 * (i >> 1), xd->bd); - } else { -#endif - vp9_build_inter_predictor(pd->pre[0].buf, pd->pre[0].stride, - pd->dst.buf, pd->dst.stride, - &xd->mi[0].bmi[i].as_mv[0].as_mv, - &xd->block_refs[0]->sf, - 4 * num_4x4_blocks_wide, - 4 * num_4x4_blocks_high, 0, - vp9_get_interp_kernel(mbmi->interp_filter), - MV_PRECISION_Q3, - mi_col * MI_SIZE + 4 * (i & 0x01), - mi_row * MI_SIZE + 4 * (i >> 1)); - -#if CONFIG_VP9_HIGHBITDEPTH - } -#endif - - model_rd_for_sb_y(cpi, bsize, x, xd, &this_rdc.rate, &this_rdc.dist, - &var_y, &sse_y); - - this_rdc.rate += b_rate; - this_rdc.rdcost = RDCOST(x->rdmult, x->rddiv, - this_rdc.rate, this_rdc.dist); - if (this_rdc.rdcost < b_best_rd) { - b_best_rd = this_rdc.rdcost; - bsi[ref_frame][i].as_mode = this_mode; - bsi[ref_frame][i].as_mv[0].as_mv = xd->mi[0].bmi[i].as_mv[0].as_mv; - } - } // mode search - - // restore source and prediction buffer pointers. - p->src = orig_src; - pd->pre[0] = orig_pre[0]; - pd->dst = orig_dst; - this_rd += b_best_rd; - - xd->mi[0].bmi[i] = bsi[ref_frame][i]; - if (num_4x4_blocks_wide > 1) - xd->mi[0].bmi[i + 1] = xd->mi[0].bmi[i]; - if (num_4x4_blocks_high > 1) - xd->mi[0].bmi[i + 2] = xd->mi[0].bmi[i]; - } - } // loop through sub8x8 blocks - - if (this_rd < best_rd) { - best_rd = this_rd; - best_ref_frame = ref_frame; - } - } // reference frames - - mbmi->tx_size = TX_4X4; - mbmi->ref_frame[0] = best_ref_frame; - for (idy = 0; idy < 2; idy += num_4x4_blocks_high) { - for (idx = 0; idx < 2; idx += num_4x4_blocks_wide) { - const int block = idy * 2 + idx; - xd->mi[0].bmi[block] = bsi[best_ref_frame][block]; - if (num_4x4_blocks_wide > 1) - xd->mi[0].bmi[block + 1] = bsi[best_ref_frame][block]; - if (num_4x4_blocks_high > 1) - xd->mi[0].bmi[block + 2] = bsi[best_ref_frame][block]; - } - } - mbmi->mode = xd->mi[0].bmi[3].as_mode; - ctx->mic = *(xd->mi[0].src_mi); - ctx->skip_txfm[0] = 0; - ctx->skip = 0; - // Dummy assignment for speed -5. No effect in speed -6. - rd_cost->rdcost = best_rd; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_pickmode.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_pickmode.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_pickmode.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_pickmode.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_PICKMODE_H_ -#define VP9_ENCODER_VP9_PICKMODE_H_ - -#include "vp9/encoder/vp9_encoder.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void vp9_pick_intra_mode(VP9_COMP *cpi, MACROBLOCK *x, RD_COST *rd_cost, - BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx); - -void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, - TileDataEnc *tile_data, - int mi_row, int mi_col, RD_COST *rd_cost, - BLOCK_SIZE bsize, - PICK_MODE_CONTEXT *ctx); - -void vp9_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x, - TileDataEnc *tile_data, - int mi_row, int mi_col, RD_COST *rd_cost, - BLOCK_SIZE bsize, - PICK_MODE_CONTEXT *ctx); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_PICKMODE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_quantize.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_quantize.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_quantize.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_quantize.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,727 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "vpx_mem/vpx_mem.h" - -#include "vp9/common/vp9_quant_common.h" -#include "vp9/common/vp9_seg_common.h" - -#include "vp9/encoder/vp9_encoder.h" -#include "vp9/encoder/vp9_quantize.h" -#include "vp9/encoder/vp9_rd.h" - -void vp9_quantize_dc(const tran_low_t *coeff_ptr, - int n_coeffs, int skip_block, - const int16_t *round_ptr, const int16_t quant, - tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, - const int16_t dequant_ptr, uint16_t *eob_ptr) { - const int rc = 0; - const int coeff = coeff_ptr[rc]; - const int coeff_sign = (coeff >> 31); - const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign; - int tmp, eob = -1; - - vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); - vpx_memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); - - if (!skip_block) { - tmp = clamp(abs_coeff + round_ptr[rc != 0], INT16_MIN, INT16_MAX); - tmp = (tmp * quant) >> 16; - qcoeff_ptr[rc] = (tmp ^ coeff_sign) - coeff_sign; - dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr; - if (tmp) - eob = 0; - } - *eob_ptr = eob + 1; -} - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_highbd_quantize_dc(const tran_low_t *coeff_ptr, - int n_coeffs, int skip_block, - const int16_t *round_ptr, const int16_t quant, - tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, - const int16_t dequant_ptr, uint16_t *eob_ptr) { - int eob = -1; - - vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); - vpx_memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); - - if (!skip_block) { - const int rc = 0; - const int coeff = coeff_ptr[rc]; - const int coeff_sign = (coeff >> 31); - const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign; - - const int64_t tmp = - (clamp(abs_coeff + round_ptr[rc != 0], INT32_MIN, INT32_MAX) * - quant) >> 16; - qcoeff_ptr[rc] = (tran_low_t)((tmp ^ coeff_sign) - coeff_sign); - dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr; - if (tmp) - eob = 0; - } - *eob_ptr = eob + 1; -} -#endif - -void vp9_quantize_dc_32x32(const tran_low_t *coeff_ptr, int skip_block, - const int16_t *round_ptr, const int16_t quant, - tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, - const int16_t dequant_ptr, uint16_t *eob_ptr) { - const int n_coeffs = 1024; - const int rc = 0; - const int coeff = coeff_ptr[rc]; - const int coeff_sign = (coeff >> 31); - const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign; - int tmp, eob = -1; - - vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); - vpx_memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); - - if (!skip_block) { - - tmp = clamp(abs_coeff + ROUND_POWER_OF_TWO(round_ptr[rc != 0], 1), - INT16_MIN, INT16_MAX); - tmp = (tmp * quant) >> 15; - qcoeff_ptr[rc] = (tmp ^ coeff_sign) - coeff_sign; - dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr / 2; - if (tmp) - eob = 0; - } - *eob_ptr = eob + 1; -} - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_highbd_quantize_dc_32x32(const tran_low_t *coeff_ptr, - int skip_block, - const int16_t *round_ptr, - const int16_t quant, - tran_low_t *qcoeff_ptr, - tran_low_t *dqcoeff_ptr, - const int16_t dequant_ptr, - uint16_t *eob_ptr) { - const int n_coeffs = 1024; - int eob = -1; - - vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); - vpx_memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); - - if (!skip_block) { - const int rc = 0; - const int coeff = coeff_ptr[rc]; - const int coeff_sign = (coeff >> 31); - const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign; - - const int64_t tmp = - (clamp(abs_coeff + ROUND_POWER_OF_TWO(round_ptr[rc != 0], 1), - INT32_MIN, INT32_MAX) * quant) >> 15; - qcoeff_ptr[rc] = (tran_low_t)((tmp ^ coeff_sign) - coeff_sign); - dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr / 2; - if (tmp) - eob = 0; - } - *eob_ptr = eob + 1; -} -#endif - -void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, - int skip_block, - const int16_t *zbin_ptr, const int16_t *round_ptr, - const int16_t *quant_ptr, const int16_t *quant_shift_ptr, - tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, - const int16_t *dequant_ptr, - uint16_t *eob_ptr, - const int16_t *scan, const int16_t *iscan) { - int i, eob = -1; - // TODO(jingning) Decide the need of these arguments after the - // quantization process is completed. - (void)zbin_ptr; - (void)quant_shift_ptr; - (void)iscan; - - vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); - vpx_memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); - - if (!skip_block) { - // Quantization pass: All coefficients with index >= zero_flag are - // skippable. Note: zero_flag can be zero. - for (i = 0; i < n_coeffs; i++) { - const int rc = scan[i]; - const int coeff = coeff_ptr[rc]; - const int coeff_sign = (coeff >> 31); - const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign; - - int tmp = clamp(abs_coeff + round_ptr[rc != 0], INT16_MIN, INT16_MAX); - tmp = (tmp * quant_ptr[rc != 0]) >> 16; - - qcoeff_ptr[rc] = (tmp ^ coeff_sign) - coeff_sign; - dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0]; - - if (tmp) - eob = i; - } - } - *eob_ptr = eob + 1; -} - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, - intptr_t count, - int skip_block, - const int16_t *zbin_ptr, - const int16_t *round_ptr, - const int16_t *quant_ptr, - const int16_t *quant_shift_ptr, - tran_low_t *qcoeff_ptr, - tran_low_t *dqcoeff_ptr, - const int16_t *dequant_ptr, - uint16_t *eob_ptr, - const int16_t *scan, - const int16_t *iscan) { - int i; - int eob = -1; - // TODO(jingning) Decide the need of these arguments after the - // quantization process is completed. - (void)zbin_ptr; - (void)quant_shift_ptr; - (void)iscan; - - vpx_memset(qcoeff_ptr, 0, count * sizeof(*qcoeff_ptr)); - vpx_memset(dqcoeff_ptr, 0, count * sizeof(*dqcoeff_ptr)); - - if (!skip_block) { - // Quantization pass: All coefficients with index >= zero_flag are - // skippable. Note: zero_flag can be zero. - for (i = 0; i < count; i++) { - const int rc = scan[i]; - const int coeff = coeff_ptr[rc]; - const int coeff_sign = (coeff >> 31); - const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign; - - const int64_t tmp = - (clamp(abs_coeff + round_ptr[rc != 0], INT32_MIN, INT32_MAX) * - quant_ptr[rc != 0]) >> 16; - - qcoeff_ptr[rc] = (tran_low_t)((tmp ^ coeff_sign) - coeff_sign); - dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0]; - - if (tmp) - eob = i; - } - } - *eob_ptr = eob + 1; -} -#endif - -// TODO(jingning) Refactor this file and combine functions with similar -// operations. -void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, - int skip_block, - const int16_t *zbin_ptr, const int16_t *round_ptr, - const int16_t *quant_ptr, - const int16_t *quant_shift_ptr, - tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, - const int16_t *dequant_ptr, - uint16_t *eob_ptr, - const int16_t *scan, const int16_t *iscan) { - int i, eob = -1; - (void)zbin_ptr; - (void)quant_shift_ptr; - (void)iscan; - - vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); - vpx_memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); - - if (!skip_block) { - for (i = 0; i < n_coeffs; i++) { - const int rc = scan[i]; - const int coeff = coeff_ptr[rc]; - const int coeff_sign = (coeff >> 31); - int tmp = 0; - int abs_coeff = (coeff ^ coeff_sign) - coeff_sign; - - if (abs_coeff >= (dequant_ptr[rc != 0] >> 2)) { - abs_coeff += ROUND_POWER_OF_TWO(round_ptr[rc != 0], 1); - abs_coeff = clamp(abs_coeff, INT16_MIN, INT16_MAX); - tmp = (abs_coeff * quant_ptr[rc != 0]) >> 15; - qcoeff_ptr[rc] = (tmp ^ coeff_sign) - coeff_sign; - dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0] / 2; - } - - if (tmp) - eob = i; - } - } - *eob_ptr = eob + 1; -} - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, - intptr_t n_coeffs, int skip_block, - const int16_t *zbin_ptr, - const int16_t *round_ptr, - const int16_t *quant_ptr, - const int16_t *quant_shift_ptr, - tran_low_t *qcoeff_ptr, - tran_low_t *dqcoeff_ptr, - const int16_t *dequant_ptr, - uint16_t *eob_ptr, - const int16_t *scan, const int16_t *iscan) { - int i, eob = -1; - (void)zbin_ptr; - (void)quant_shift_ptr; - (void)iscan; - - vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); - vpx_memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); - - if (!skip_block) { - for (i = 0; i < n_coeffs; i++) { - const int rc = scan[i]; - const int coeff = coeff_ptr[rc]; - const int coeff_sign = (coeff >> 31); - int64_t tmp = 0; - const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign; - - if (abs_coeff >= (dequant_ptr[rc != 0] >> 2)) { - tmp = clamp(abs_coeff + ROUND_POWER_OF_TWO(round_ptr[rc != 0], 1), - INT32_MIN, INT32_MAX); - tmp = (tmp * quant_ptr[rc != 0]) >> 15; - qcoeff_ptr[rc] = (tran_low_t)((tmp ^ coeff_sign) - coeff_sign); - dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0] / 2; - } - - if (tmp) - eob = i; - } - } - *eob_ptr = eob + 1; -} -#endif - -void vp9_quantize_b_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, - int skip_block, - const int16_t *zbin_ptr, const int16_t *round_ptr, - const int16_t *quant_ptr, const int16_t *quant_shift_ptr, - tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, - const int16_t *dequant_ptr, - uint16_t *eob_ptr, - const int16_t *scan, const int16_t *iscan) { - int i, non_zero_count = (int)n_coeffs, eob = -1; - const int zbins[2] = {zbin_ptr[0], zbin_ptr[1]}; - const int nzbins[2] = {zbins[0] * -1, zbins[1] * -1}; - (void)iscan; - - vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); - vpx_memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); - - if (!skip_block) { - // Pre-scan pass - for (i = (int)n_coeffs - 1; i >= 0; i--) { - const int rc = scan[i]; - const int coeff = coeff_ptr[rc]; - - if (coeff < zbins[rc != 0] && coeff > nzbins[rc != 0]) - non_zero_count--; - else - break; - } - - // Quantization pass: All coefficients with index >= zero_flag are - // skippable. Note: zero_flag can be zero. - for (i = 0; i < non_zero_count; i++) { - const int rc = scan[i]; - const int coeff = coeff_ptr[rc]; - const int coeff_sign = (coeff >> 31); - const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign; - - if (abs_coeff >= zbins[rc != 0]) { - int tmp = clamp(abs_coeff + round_ptr[rc != 0], INT16_MIN, INT16_MAX); - tmp = ((((tmp * quant_ptr[rc != 0]) >> 16) + tmp) * - quant_shift_ptr[rc != 0]) >> 16; // quantization - qcoeff_ptr[rc] = (tmp ^ coeff_sign) - coeff_sign; - dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0]; - - if (tmp) - eob = i; - } - } - } - *eob_ptr = eob + 1; -} - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_highbd_quantize_b_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, - int skip_block, const int16_t *zbin_ptr, - const int16_t *round_ptr, const int16_t *quant_ptr, - const int16_t *quant_shift_ptr, - tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, - const int16_t *dequant_ptr, - uint16_t *eob_ptr, const int16_t *scan, - const int16_t *iscan) { - int i, non_zero_count = (int)n_coeffs, eob = -1; - const int zbins[2] = {zbin_ptr[0], zbin_ptr[1]}; - const int nzbins[2] = {zbins[0] * -1, zbins[1] * -1}; - (void)iscan; - - vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); - vpx_memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); - - if (!skip_block) { - // Pre-scan pass - for (i = (int)n_coeffs - 1; i >= 0; i--) { - const int rc = scan[i]; - const int coeff = coeff_ptr[rc]; - - if (coeff < zbins[rc != 0] && coeff > nzbins[rc != 0]) - non_zero_count--; - else - break; - } - - // Quantization pass: All coefficients with index >= zero_flag are - // skippable. Note: zero_flag can be zero. - for (i = 0; i < non_zero_count; i++) { - const int rc = scan[i]; - const int coeff = coeff_ptr[rc]; - const int coeff_sign = (coeff >> 31); - const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign; - - if (abs_coeff >= zbins[rc != 0]) { - int64_t tmp = clamp(abs_coeff + round_ptr[rc != 0], - INT32_MIN, INT32_MAX); - tmp = ((((tmp * quant_ptr[rc != 0]) >> 16) + tmp) * - quant_shift_ptr[rc != 0]) >> 16; // quantization - qcoeff_ptr[rc] = (tran_low_t)((tmp ^ coeff_sign) - coeff_sign); - dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0]; - - if (tmp) - eob = i; - } - } - } - *eob_ptr = eob + 1; -} -#endif - -void vp9_quantize_b_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, - int skip_block, - const int16_t *zbin_ptr, const int16_t *round_ptr, - const int16_t *quant_ptr, - const int16_t *quant_shift_ptr, - tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, - const int16_t *dequant_ptr, - uint16_t *eob_ptr, - const int16_t *scan, const int16_t *iscan) { - const int zbins[2] = {ROUND_POWER_OF_TWO(zbin_ptr[0], 1), - ROUND_POWER_OF_TWO(zbin_ptr[1], 1)}; - const int nzbins[2] = {zbins[0] * -1, zbins[1] * -1}; - - int idx = 0; - int idx_arr[1024]; - int i, eob = -1; - (void)iscan; - - vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); - vpx_memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); - - if (!skip_block) { - // Pre-scan pass - for (i = 0; i < n_coeffs; i++) { - const int rc = scan[i]; - const int coeff = coeff_ptr[rc]; - - // If the coefficient is out of the base ZBIN range, keep it for - // quantization. - if (coeff >= zbins[rc != 0] || coeff <= nzbins[rc != 0]) - idx_arr[idx++] = i; - } - - // Quantization pass: only process the coefficients selected in - // pre-scan pass. Note: idx can be zero. - for (i = 0; i < idx; i++) { - const int rc = scan[idx_arr[i]]; - const int coeff = coeff_ptr[rc]; - const int coeff_sign = (coeff >> 31); - int tmp; - int abs_coeff = (coeff ^ coeff_sign) - coeff_sign; - abs_coeff += ROUND_POWER_OF_TWO(round_ptr[rc != 0], 1); - abs_coeff = clamp(abs_coeff, INT16_MIN, INT16_MAX); - tmp = ((((abs_coeff * quant_ptr[rc != 0]) >> 16) + abs_coeff) * - quant_shift_ptr[rc != 0]) >> 15; - - qcoeff_ptr[rc] = (tmp ^ coeff_sign) - coeff_sign; - dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0] / 2; - - if (tmp) - eob = idx_arr[i]; - } - } - *eob_ptr = eob + 1; -} - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_highbd_quantize_b_32x32_c(const tran_low_t *coeff_ptr, - intptr_t n_coeffs, int skip_block, - const int16_t *zbin_ptr, - const int16_t *round_ptr, - const int16_t *quant_ptr, - const int16_t *quant_shift_ptr, - tran_low_t *qcoeff_ptr, - tran_low_t *dqcoeff_ptr, - const int16_t *dequant_ptr, - uint16_t *eob_ptr, - const int16_t *scan, const int16_t *iscan) { - const int zbins[2] = {ROUND_POWER_OF_TWO(zbin_ptr[0], 1), - ROUND_POWER_OF_TWO(zbin_ptr[1], 1)}; - const int nzbins[2] = {zbins[0] * -1, zbins[1] * -1}; - - int idx = 0; - int idx_arr[1024]; - int i, eob = -1; - (void)iscan; - - vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); - vpx_memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); - - if (!skip_block) { - // Pre-scan pass - for (i = 0; i < n_coeffs; i++) { - const int rc = scan[i]; - const int coeff = coeff_ptr[rc]; - - // If the coefficient is out of the base ZBIN range, keep it for - // quantization. - if (coeff >= zbins[rc != 0] || coeff <= nzbins[rc != 0]) - idx_arr[idx++] = i; - } - - // Quantization pass: only process the coefficients selected in - // pre-scan pass. Note: idx can be zero. - for (i = 0; i < idx; i++) { - const int rc = scan[idx_arr[i]]; - const int coeff = coeff_ptr[rc]; - const int coeff_sign = (coeff >> 31); - const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign; - int64_t tmp = clamp(abs_coeff + - ROUND_POWER_OF_TWO(round_ptr[rc != 0], 1), - INT32_MIN, INT32_MAX); - tmp = ((((tmp * quant_ptr[rc != 0]) >> 16) + tmp) * - quant_shift_ptr[rc != 0]) >> 15; - - qcoeff_ptr[rc] = (tran_low_t)((tmp ^ coeff_sign) - coeff_sign); - dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0] / 2; - - if (tmp) - eob = idx_arr[i]; - } - } - *eob_ptr = eob + 1; -} -#endif - -void vp9_regular_quantize_b_4x4(MACROBLOCK *x, int plane, int block, - const int16_t *scan, const int16_t *iscan) { - MACROBLOCKD *const xd = &x->e_mbd; - struct macroblock_plane *p = &x->plane[plane]; - struct macroblockd_plane *pd = &xd->plane[plane]; - -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - vp9_highbd_quantize_b(BLOCK_OFFSET(p->coeff, block), - 16, x->skip_block, - p->zbin, p->round, p->quant, p->quant_shift, - BLOCK_OFFSET(p->qcoeff, block), - BLOCK_OFFSET(pd->dqcoeff, block), - pd->dequant, &p->eobs[block], - scan, iscan); - return; - } -#endif - vp9_quantize_b(BLOCK_OFFSET(p->coeff, block), - 16, x->skip_block, - p->zbin, p->round, p->quant, p->quant_shift, - BLOCK_OFFSET(p->qcoeff, block), - BLOCK_OFFSET(pd->dqcoeff, block), - pd->dequant, &p->eobs[block], scan, iscan); -} - -static void invert_quant(int16_t *quant, int16_t *shift, int d) { - unsigned t; - int l; - t = d; - for (l = 0; t > 1; l++) - t >>= 1; - t = 1 + (1 << (16 + l)) / d; - *quant = (int16_t)(t - (1 << 16)); - *shift = 1 << (16 - l); -} - -static int get_qzbin_factor(int q, vpx_bit_depth_t bit_depth) { - const int quant = vp9_dc_quant(q, 0, bit_depth); -#if CONFIG_VP9_HIGHBITDEPTH - switch (bit_depth) { - case VPX_BITS_8: - return q == 0 ? 64 : (quant < 148 ? 84 : 80); - case VPX_BITS_10: - return q == 0 ? 64 : (quant < 592 ? 84 : 80); - case VPX_BITS_12: - return q == 0 ? 64 : (quant < 2368 ? 84 : 80); - default: - assert(0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10 or VPX_BITS_12"); - return -1; - } -#else - (void) bit_depth; - return q == 0 ? 64 : (quant < 148 ? 84 : 80); -#endif -} - -void vp9_init_quantizer(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - QUANTS *const quants = &cpi->quants; - int i, q, quant; - - for (q = 0; q < QINDEX_RANGE; q++) { - const int qzbin_factor = get_qzbin_factor(q, cm->bit_depth); - const int qrounding_factor = q == 0 ? 64 : 48; - - for (i = 0; i < 2; ++i) { - int qrounding_factor_fp = i == 0 ? 48 : 42; - if (q == 0) - qrounding_factor_fp = 64; - - // y - quant = i == 0 ? vp9_dc_quant(q, cm->y_dc_delta_q, cm->bit_depth) - : vp9_ac_quant(q, 0, cm->bit_depth); - invert_quant(&quants->y_quant[q][i], &quants->y_quant_shift[q][i], quant); - quants->y_quant_fp[q][i] = (1 << 16) / quant; - quants->y_round_fp[q][i] = (qrounding_factor_fp * quant) >> 7; - quants->y_zbin[q][i] = ROUND_POWER_OF_TWO(qzbin_factor * quant, 7); - quants->y_round[q][i] = (qrounding_factor * quant) >> 7; - cpi->y_dequant[q][i] = quant; - - // uv - quant = i == 0 ? vp9_dc_quant(q, cm->uv_dc_delta_q, cm->bit_depth) - : vp9_ac_quant(q, cm->uv_ac_delta_q, cm->bit_depth); - invert_quant(&quants->uv_quant[q][i], - &quants->uv_quant_shift[q][i], quant); - quants->uv_quant_fp[q][i] = (1 << 16) / quant; - quants->uv_round_fp[q][i] = (qrounding_factor_fp * quant) >> 7; - quants->uv_zbin[q][i] = ROUND_POWER_OF_TWO(qzbin_factor * quant, 7); - quants->uv_round[q][i] = (qrounding_factor * quant) >> 7; - cpi->uv_dequant[q][i] = quant; - } - - for (i = 2; i < 8; i++) { - quants->y_quant[q][i] = quants->y_quant[q][1]; - quants->y_quant_fp[q][i] = quants->y_quant_fp[q][1]; - quants->y_round_fp[q][i] = quants->y_round_fp[q][1]; - quants->y_quant_shift[q][i] = quants->y_quant_shift[q][1]; - quants->y_zbin[q][i] = quants->y_zbin[q][1]; - quants->y_round[q][i] = quants->y_round[q][1]; - cpi->y_dequant[q][i] = cpi->y_dequant[q][1]; - - quants->uv_quant[q][i] = quants->uv_quant[q][1]; - quants->uv_quant_fp[q][i] = quants->uv_quant_fp[q][1]; - quants->uv_round_fp[q][i] = quants->uv_round_fp[q][1]; - quants->uv_quant_shift[q][i] = quants->uv_quant_shift[q][1]; - quants->uv_zbin[q][i] = quants->uv_zbin[q][1]; - quants->uv_round[q][i] = quants->uv_round[q][1]; - cpi->uv_dequant[q][i] = cpi->uv_dequant[q][1]; - } - } -} - -void vp9_init_plane_quantizers(VP9_COMP *cpi, MACROBLOCK *x) { - const VP9_COMMON *const cm = &cpi->common; - MACROBLOCKD *const xd = &x->e_mbd; - QUANTS *const quants = &cpi->quants; - const int segment_id = xd->mi[0].src_mi->mbmi.segment_id; - const int qindex = vp9_get_qindex(&cm->seg, segment_id, cm->base_qindex); - const int rdmult = vp9_compute_rd_mult(cpi, qindex + cm->y_dc_delta_q); - int i; - - // Y - x->plane[0].quant = quants->y_quant[qindex]; - x->plane[0].quant_fp = quants->y_quant_fp[qindex]; - x->plane[0].round_fp = quants->y_round_fp[qindex]; - x->plane[0].quant_shift = quants->y_quant_shift[qindex]; - x->plane[0].zbin = quants->y_zbin[qindex]; - x->plane[0].round = quants->y_round[qindex]; - xd->plane[0].dequant = cpi->y_dequant[qindex]; - - x->plane[0].quant_thred[0] = x->plane[0].zbin[0] * x->plane[0].zbin[0]; - x->plane[0].quant_thred[1] = x->plane[0].zbin[1] * x->plane[0].zbin[1]; - - // UV - for (i = 1; i < 3; i++) { - x->plane[i].quant = quants->uv_quant[qindex]; - x->plane[i].quant_fp = quants->uv_quant_fp[qindex]; - x->plane[i].round_fp = quants->uv_round_fp[qindex]; - x->plane[i].quant_shift = quants->uv_quant_shift[qindex]; - x->plane[i].zbin = quants->uv_zbin[qindex]; - x->plane[i].round = quants->uv_round[qindex]; - xd->plane[i].dequant = cpi->uv_dequant[qindex]; - - x->plane[i].quant_thred[0] = x->plane[i].zbin[0] * x->plane[i].zbin[0]; - x->plane[i].quant_thred[1] = x->plane[i].zbin[1] * x->plane[i].zbin[1]; - } - - x->skip_block = vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP); - x->q_index = qindex; - - x->errorperbit = rdmult >> 6; - x->errorperbit += (x->errorperbit == 0); - - vp9_initialize_me_consts(cpi, x, x->q_index); -} - -void vp9_frame_init_quantizer(VP9_COMP *cpi) { - vp9_init_plane_quantizers(cpi, &cpi->td.mb); -} - -void vp9_set_quantizer(VP9_COMMON *cm, int q) { - // quantizer has to be reinitialized with vp9_init_quantizer() if any - // delta_q changes. - cm->base_qindex = q; - cm->y_dc_delta_q = 0; - cm->uv_dc_delta_q = 0; - cm->uv_ac_delta_q = 0; -} - -// Table that converts 0-63 Q-range values passed in outside to the Qindex -// range used internally. -static const int quantizer_to_qindex[] = { - 0, 4, 8, 12, 16, 20, 24, 28, - 32, 36, 40, 44, 48, 52, 56, 60, - 64, 68, 72, 76, 80, 84, 88, 92, - 96, 100, 104, 108, 112, 116, 120, 124, - 128, 132, 136, 140, 144, 148, 152, 156, - 160, 164, 168, 172, 176, 180, 184, 188, - 192, 196, 200, 204, 208, 212, 216, 220, - 224, 228, 232, 236, 240, 244, 249, 255, -}; - -int vp9_quantizer_to_qindex(int quantizer) { - return quantizer_to_qindex[quantizer]; -} - -int vp9_qindex_to_quantizer(int qindex) { - int quantizer; - - for (quantizer = 0; quantizer < 64; ++quantizer) - if (quantizer_to_qindex[quantizer] >= qindex) - return quantizer; - - return 63; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_quantize.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_quantize.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_quantize.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_quantize.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_QUANTIZE_H_ -#define VP9_ENCODER_VP9_QUANTIZE_H_ - -#include "./vpx_config.h" -#include "vp9/encoder/vp9_block.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - DECLARE_ALIGNED(16, int16_t, y_quant[QINDEX_RANGE][8]); - DECLARE_ALIGNED(16, int16_t, y_quant_shift[QINDEX_RANGE][8]); - DECLARE_ALIGNED(16, int16_t, y_zbin[QINDEX_RANGE][8]); - DECLARE_ALIGNED(16, int16_t, y_round[QINDEX_RANGE][8]); - - // TODO(jingning): in progress of re-working the quantization. will decide - // if we want to deprecate the current use of y_quant. - DECLARE_ALIGNED(16, int16_t, y_quant_fp[QINDEX_RANGE][8]); - DECLARE_ALIGNED(16, int16_t, uv_quant_fp[QINDEX_RANGE][8]); - DECLARE_ALIGNED(16, int16_t, y_round_fp[QINDEX_RANGE][8]); - DECLARE_ALIGNED(16, int16_t, uv_round_fp[QINDEX_RANGE][8]); - - DECLARE_ALIGNED(16, int16_t, uv_quant[QINDEX_RANGE][8]); - DECLARE_ALIGNED(16, int16_t, uv_quant_shift[QINDEX_RANGE][8]); - DECLARE_ALIGNED(16, int16_t, uv_zbin[QINDEX_RANGE][8]); - DECLARE_ALIGNED(16, int16_t, uv_round[QINDEX_RANGE][8]); -} QUANTS; - -void vp9_quantize_dc(const tran_low_t *coeff_ptr, - int n_coeffs, int skip_block, - const int16_t *round_ptr, const int16_t quant_ptr, - tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, - const int16_t dequant_ptr, uint16_t *eob_ptr); -void vp9_quantize_dc_32x32(const tran_low_t *coeff_ptr, int skip_block, - const int16_t *round_ptr, const int16_t quant_ptr, - tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, - const int16_t dequant_ptr, uint16_t *eob_ptr); -void vp9_regular_quantize_b_4x4(MACROBLOCK *x, int plane, int block, - const int16_t *scan, const int16_t *iscan); - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_highbd_quantize_dc(const tran_low_t *coeff_ptr, - int n_coeffs, int skip_block, - const int16_t *round_ptr, const int16_t quant_ptr, - tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, - const int16_t dequant_ptr, uint16_t *eob_ptr); -void vp9_highbd_quantize_dc_32x32(const tran_low_t *coeff_ptr, - int skip_block, - const int16_t *round_ptr, - const int16_t quant_ptr, - tran_low_t *qcoeff_ptr, - tran_low_t *dqcoeff_ptr, - const int16_t dequant_ptr, - uint16_t *eob_ptr); -#endif - -struct VP9_COMP; -struct VP9Common; - -void vp9_frame_init_quantizer(struct VP9_COMP *cpi); - -void vp9_init_plane_quantizers(struct VP9_COMP *cpi, MACROBLOCK *x); - -void vp9_init_quantizer(struct VP9_COMP *cpi); - -void vp9_set_quantizer(struct VP9Common *cm, int q); - -int vp9_quantizer_to_qindex(int quantizer); - -int vp9_qindex_to_quantizer(int qindex); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_QUANTIZE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_ratectrl.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_ratectrl.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_ratectrl.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_ratectrl.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1695 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include -#include -#include -#include - -#include "vpx_mem/vpx_mem.h" - -#include "vp9/common/vp9_alloccommon.h" -#include "vp9/encoder/vp9_aq_cyclicrefresh.h" -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_entropymode.h" -#include "vp9/common/vp9_quant_common.h" -#include "vp9/common/vp9_seg_common.h" -#include "vp9/common/vp9_systemdependent.h" - -#include "vp9/encoder/vp9_encodemv.h" -#include "vp9/encoder/vp9_ratectrl.h" - -// Max rate target for 1080P and below encodes under normal circumstances -// (1920 * 1080 / (16 * 16)) * MAX_MB_RATE bits per MB -#define MAX_MB_RATE 250 -#define MAXRATE_1080P 2025000 - -#define DEFAULT_KF_BOOST 2000 -#define DEFAULT_GF_BOOST 2000 - -#define LIMIT_QRANGE_FOR_ALTREF_AND_KEY 1 - -#define MIN_BPB_FACTOR 0.005 -#define MAX_BPB_FACTOR 50 - -#define FRAME_OVERHEAD_BITS 200 - -#if CONFIG_VP9_HIGHBITDEPTH -#define ASSIGN_MINQ_TABLE(bit_depth, name) \ - do { \ - switch (bit_depth) { \ - case VPX_BITS_8: \ - name = name##_8; \ - break; \ - case VPX_BITS_10: \ - name = name##_10; \ - break; \ - case VPX_BITS_12: \ - name = name##_12; \ - break; \ - default: \ - assert(0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10" \ - " or VPX_BITS_12"); \ - name = NULL; \ - } \ - } while (0) -#else -#define ASSIGN_MINQ_TABLE(bit_depth, name) \ - do { \ - (void) bit_depth; \ - name = name##_8; \ - } while (0) -#endif - -// Tables relating active max Q to active min Q -static int kf_low_motion_minq_8[QINDEX_RANGE]; -static int kf_high_motion_minq_8[QINDEX_RANGE]; -static int arfgf_low_motion_minq_8[QINDEX_RANGE]; -static int arfgf_high_motion_minq_8[QINDEX_RANGE]; -static int inter_minq_8[QINDEX_RANGE]; -static int rtc_minq_8[QINDEX_RANGE]; - -#if CONFIG_VP9_HIGHBITDEPTH -static int kf_low_motion_minq_10[QINDEX_RANGE]; -static int kf_high_motion_minq_10[QINDEX_RANGE]; -static int arfgf_low_motion_minq_10[QINDEX_RANGE]; -static int arfgf_high_motion_minq_10[QINDEX_RANGE]; -static int inter_minq_10[QINDEX_RANGE]; -static int rtc_minq_10[QINDEX_RANGE]; -static int kf_low_motion_minq_12[QINDEX_RANGE]; -static int kf_high_motion_minq_12[QINDEX_RANGE]; -static int arfgf_low_motion_minq_12[QINDEX_RANGE]; -static int arfgf_high_motion_minq_12[QINDEX_RANGE]; -static int inter_minq_12[QINDEX_RANGE]; -static int rtc_minq_12[QINDEX_RANGE]; -#endif - -static int gf_high = 2000; -static int gf_low = 400; -static int kf_high = 5000; -static int kf_low = 400; - -// Functions to compute the active minq lookup table entries based on a -// formulaic approach to facilitate easier adjustment of the Q tables. -// The formulae were derived from computing a 3rd order polynomial best -// fit to the original data (after plotting real maxq vs minq (not q index)) -static int get_minq_index(double maxq, double x3, double x2, double x1, - vpx_bit_depth_t bit_depth) { - int i; - const double minqtarget = MIN(((x3 * maxq + x2) * maxq + x1) * maxq, - maxq); - - // Special case handling to deal with the step from q2.0 - // down to lossless mode represented by q 1.0. - if (minqtarget <= 2.0) - return 0; - - for (i = 0; i < QINDEX_RANGE; i++) { - if (minqtarget <= vp9_convert_qindex_to_q(i, bit_depth)) - return i; - } - - return QINDEX_RANGE - 1; -} - -static void init_minq_luts(int *kf_low_m, int *kf_high_m, - int *arfgf_low, int *arfgf_high, - int *inter, int *rtc, vpx_bit_depth_t bit_depth) { - int i; - for (i = 0; i < QINDEX_RANGE; i++) { - const double maxq = vp9_convert_qindex_to_q(i, bit_depth); - kf_low_m[i] = get_minq_index(maxq, 0.000001, -0.0004, 0.150, bit_depth); - kf_high_m[i] = get_minq_index(maxq, 0.0000021, -0.00125, 0.55, bit_depth); - arfgf_low[i] = get_minq_index(maxq, 0.0000015, -0.0009, 0.30, bit_depth); - arfgf_high[i] = get_minq_index(maxq, 0.0000021, -0.00125, 0.55, bit_depth); - inter[i] = get_minq_index(maxq, 0.00000271, -0.00113, 0.90, bit_depth); - rtc[i] = get_minq_index(maxq, 0.00000271, -0.00113, 0.70, bit_depth); - } -} - -void vp9_rc_init_minq_luts() { - init_minq_luts(kf_low_motion_minq_8, kf_high_motion_minq_8, - arfgf_low_motion_minq_8, arfgf_high_motion_minq_8, - inter_minq_8, rtc_minq_8, VPX_BITS_8); -#if CONFIG_VP9_HIGHBITDEPTH - init_minq_luts(kf_low_motion_minq_10, kf_high_motion_minq_10, - arfgf_low_motion_minq_10, arfgf_high_motion_minq_10, - inter_minq_10, rtc_minq_10, VPX_BITS_10); - init_minq_luts(kf_low_motion_minq_12, kf_high_motion_minq_12, - arfgf_low_motion_minq_12, arfgf_high_motion_minq_12, - inter_minq_12, rtc_minq_12, VPX_BITS_12); -#endif -} - -// These functions use formulaic calculations to make playing with the -// quantizer tables easier. If necessary they can be replaced by lookup -// tables if and when things settle down in the experimental bitstream -double vp9_convert_qindex_to_q(int qindex, vpx_bit_depth_t bit_depth) { - // Convert the index to a real Q value (scaled down to match old Q values) -#if CONFIG_VP9_HIGHBITDEPTH - switch (bit_depth) { - case VPX_BITS_8: - return vp9_ac_quant(qindex, 0, bit_depth) / 4.0; - case VPX_BITS_10: - return vp9_ac_quant(qindex, 0, bit_depth) / 16.0; - case VPX_BITS_12: - return vp9_ac_quant(qindex, 0, bit_depth) / 64.0; - default: - assert(0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10 or VPX_BITS_12"); - return -1.0; - } -#else - return vp9_ac_quant(qindex, 0, bit_depth) / 4.0; -#endif -} - -int vp9_rc_bits_per_mb(FRAME_TYPE frame_type, int qindex, - double correction_factor, - vpx_bit_depth_t bit_depth) { - const double q = vp9_convert_qindex_to_q(qindex, bit_depth); - int enumerator = frame_type == KEY_FRAME ? 2700000 : 1800000; - - assert(correction_factor <= MAX_BPB_FACTOR && - correction_factor >= MIN_BPB_FACTOR); - - // q based adjustment to baseline enumerator - enumerator += (int)(enumerator * q) >> 12; - return (int)(enumerator * correction_factor / q); -} - -int vp9_estimate_bits_at_q(FRAME_TYPE frame_type, int q, int mbs, - double correction_factor, - vpx_bit_depth_t bit_depth) { - const int bpm = (int)(vp9_rc_bits_per_mb(frame_type, q, correction_factor, - bit_depth)); - return MAX(FRAME_OVERHEAD_BITS, - (int)((uint64_t)bpm * mbs) >> BPER_MB_NORMBITS); -} - -int vp9_rc_clamp_pframe_target_size(const VP9_COMP *const cpi, int target) { - const RATE_CONTROL *rc = &cpi->rc; - const VP9EncoderConfig *oxcf = &cpi->oxcf; - const int min_frame_target = MAX(rc->min_frame_bandwidth, - rc->avg_frame_bandwidth >> 5); - if (target < min_frame_target) - target = min_frame_target; - if (cpi->refresh_golden_frame && rc->is_src_frame_alt_ref) { - // If there is an active ARF at this location use the minimum - // bits on this frame even if it is a constructed arf. - // The active maximum quantizer insures that an appropriate - // number of bits will be spent if needed for constructed ARFs. - target = min_frame_target; - } - // Clip the frame target to the maximum allowed value. - if (target > rc->max_frame_bandwidth) - target = rc->max_frame_bandwidth; - if (oxcf->rc_max_inter_bitrate_pct) { - const int max_rate = rc->avg_frame_bandwidth * - oxcf->rc_max_inter_bitrate_pct / 100; - target = MIN(target, max_rate); - } - return target; -} - -int vp9_rc_clamp_iframe_target_size(const VP9_COMP *const cpi, int target) { - const RATE_CONTROL *rc = &cpi->rc; - const VP9EncoderConfig *oxcf = &cpi->oxcf; - if (oxcf->rc_max_intra_bitrate_pct) { - const int max_rate = rc->avg_frame_bandwidth * - oxcf->rc_max_intra_bitrate_pct / 100; - target = MIN(target, max_rate); - } - if (target > rc->max_frame_bandwidth) - target = rc->max_frame_bandwidth; - return target; -} - -// Update the buffer level for higher layers, given the encoded current layer. -static void update_layer_buffer_level(SVC *svc, int encoded_frame_size) { - int temporal_layer = 0; - int current_temporal_layer = svc->temporal_layer_id; - for (temporal_layer = current_temporal_layer + 1; - temporal_layer < svc->number_temporal_layers; ++temporal_layer) { - LAYER_CONTEXT *lc = &svc->layer_context[temporal_layer]; - RATE_CONTROL *lrc = &lc->rc; - int bits_off_for_this_layer = (int)(lc->target_bandwidth / lc->framerate - - encoded_frame_size); - lrc->bits_off_target += bits_off_for_this_layer; - - // Clip buffer level to maximum buffer size for the layer. - lrc->bits_off_target = MIN(lrc->bits_off_target, lrc->maximum_buffer_size); - lrc->buffer_level = lrc->bits_off_target; - } -} - -// Update the buffer level: leaky bucket model. -static void update_buffer_level(VP9_COMP *cpi, int encoded_frame_size) { - const VP9_COMMON *const cm = &cpi->common; - RATE_CONTROL *const rc = &cpi->rc; - - // Non-viewable frames are a special case and are treated as pure overhead. - if (!cm->show_frame) { - rc->bits_off_target -= encoded_frame_size; - } else { - rc->bits_off_target += rc->avg_frame_bandwidth - encoded_frame_size; - } - - // Clip the buffer level to the maximum specified buffer size. - rc->bits_off_target = MIN(rc->bits_off_target, rc->maximum_buffer_size); - rc->buffer_level = rc->bits_off_target; - - if (cpi->use_svc && cpi->oxcf.rc_mode == VPX_CBR) { - update_layer_buffer_level(&cpi->svc, encoded_frame_size); - } -} - -void vp9_rc_init(const VP9EncoderConfig *oxcf, int pass, RATE_CONTROL *rc) { - int i; - - if (pass == 0 && oxcf->rc_mode == VPX_CBR) { - rc->avg_frame_qindex[KEY_FRAME] = oxcf->worst_allowed_q; - rc->avg_frame_qindex[INTER_FRAME] = oxcf->worst_allowed_q; - } else { - rc->avg_frame_qindex[KEY_FRAME] = (oxcf->worst_allowed_q + - oxcf->best_allowed_q) / 2; - rc->avg_frame_qindex[INTER_FRAME] = (oxcf->worst_allowed_q + - oxcf->best_allowed_q) / 2; - } - - rc->last_q[KEY_FRAME] = oxcf->best_allowed_q; - rc->last_q[INTER_FRAME] = oxcf->worst_allowed_q; - - rc->buffer_level = rc->starting_buffer_level; - rc->bits_off_target = rc->starting_buffer_level; - - rc->rolling_target_bits = rc->avg_frame_bandwidth; - rc->rolling_actual_bits = rc->avg_frame_bandwidth; - rc->long_rolling_target_bits = rc->avg_frame_bandwidth; - rc->long_rolling_actual_bits = rc->avg_frame_bandwidth; - - rc->total_actual_bits = 0; - rc->total_target_bits = 0; - rc->total_target_vs_actual = 0; - - rc->baseline_gf_interval = DEFAULT_GF_INTERVAL; - rc->frames_since_key = 8; // Sensible default for first frame. - rc->this_key_frame_forced = 0; - rc->next_key_frame_forced = 0; - rc->source_alt_ref_pending = 0; - rc->source_alt_ref_active = 0; - - rc->frames_till_gf_update_due = 0; - rc->ni_av_qi = oxcf->worst_allowed_q; - rc->ni_tot_qi = 0; - rc->ni_frames = 0; - - rc->tot_q = 0.0; - rc->avg_q = vp9_convert_qindex_to_q(oxcf->worst_allowed_q, oxcf->bit_depth); - - for (i = 0; i < RATE_FACTOR_LEVELS; ++i) { - rc->rate_correction_factors[i] = 1.0; - } -} - -int vp9_rc_drop_frame(VP9_COMP *cpi) { - const VP9EncoderConfig *oxcf = &cpi->oxcf; - RATE_CONTROL *const rc = &cpi->rc; - - if (!oxcf->drop_frames_water_mark) { - return 0; - } else { - if (rc->buffer_level < 0) { - // Always drop if buffer is below 0. - return 1; - } else { - // If buffer is below drop_mark, for now just drop every other frame - // (starting with the next frame) until it increases back over drop_mark. - int drop_mark = (int)(oxcf->drop_frames_water_mark * - rc->optimal_buffer_level / 100); - if ((rc->buffer_level > drop_mark) && - (rc->decimation_factor > 0)) { - --rc->decimation_factor; - } else if (rc->buffer_level <= drop_mark && - rc->decimation_factor == 0) { - rc->decimation_factor = 1; - } - if (rc->decimation_factor > 0) { - if (rc->decimation_count > 0) { - --rc->decimation_count; - return 1; - } else { - rc->decimation_count = rc->decimation_factor; - return 0; - } - } else { - rc->decimation_count = 0; - return 0; - } - } - } -} - -static double get_rate_correction_factor(const VP9_COMP *cpi) { - const RATE_CONTROL *const rc = &cpi->rc; - double rcf; - - if (cpi->common.frame_type == KEY_FRAME) { - rcf = rc->rate_correction_factors[KF_STD]; - } else if (cpi->oxcf.pass == 2) { - RATE_FACTOR_LEVEL rf_lvl = - cpi->twopass.gf_group.rf_level[cpi->twopass.gf_group.index]; - rcf = rc->rate_correction_factors[rf_lvl]; - } else { - if ((cpi->refresh_alt_ref_frame || cpi->refresh_golden_frame) && - !rc->is_src_frame_alt_ref && !cpi->use_svc && - (cpi->oxcf.rc_mode != VPX_CBR || cpi->oxcf.gf_cbr_boost_pct > 20)) - rcf = rc->rate_correction_factors[GF_ARF_STD]; - else - rcf = rc->rate_correction_factors[INTER_NORMAL]; - } - rcf *= rcf_mult[rc->frame_size_selector]; - return fclamp(rcf, MIN_BPB_FACTOR, MAX_BPB_FACTOR); -} - -static void set_rate_correction_factor(VP9_COMP *cpi, double factor) { - RATE_CONTROL *const rc = &cpi->rc; - - // Normalize RCF to account for the size-dependent scaling factor. - factor /= rcf_mult[cpi->rc.frame_size_selector]; - - factor = fclamp(factor, MIN_BPB_FACTOR, MAX_BPB_FACTOR); - - if (cpi->common.frame_type == KEY_FRAME) { - rc->rate_correction_factors[KF_STD] = factor; - } else if (cpi->oxcf.pass == 2) { - RATE_FACTOR_LEVEL rf_lvl = - cpi->twopass.gf_group.rf_level[cpi->twopass.gf_group.index]; - rc->rate_correction_factors[rf_lvl] = factor; - } else { - if ((cpi->refresh_alt_ref_frame || cpi->refresh_golden_frame) && - !rc->is_src_frame_alt_ref && !cpi->use_svc && - (cpi->oxcf.rc_mode != VPX_CBR || cpi->oxcf.gf_cbr_boost_pct > 20)) - rc->rate_correction_factors[GF_ARF_STD] = factor; - else - rc->rate_correction_factors[INTER_NORMAL] = factor; - } -} - -void vp9_rc_update_rate_correction_factors(VP9_COMP *cpi) { - const VP9_COMMON *const cm = &cpi->common; - int correction_factor = 100; - double rate_correction_factor = get_rate_correction_factor(cpi); - double adjustment_limit; - - int projected_size_based_on_q = 0; - - // Do not update the rate factors for arf overlay frames. - if (cpi->rc.is_src_frame_alt_ref) - return; - - // Clear down mmx registers to allow floating point in what follows - vp9_clear_system_state(); - - // Work out how big we would have expected the frame to be at this Q given - // the current correction factor. - // Stay in double to avoid int overflow when values are large - if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && cpi->common.seg.enabled) { - projected_size_based_on_q = - vp9_cyclic_refresh_estimate_bits_at_q(cpi, rate_correction_factor); - } else { - projected_size_based_on_q = vp9_estimate_bits_at_q(cpi->common.frame_type, - cm->base_qindex, - cm->MBs, - rate_correction_factor, - cm->bit_depth); - } - // Work out a size correction factor. - if (projected_size_based_on_q > FRAME_OVERHEAD_BITS) - correction_factor = (int)((100 * (int64_t)cpi->rc.projected_frame_size) / - projected_size_based_on_q); - - // More heavily damped adjustment used if we have been oscillating either side - // of target. - adjustment_limit = 0.25 + - 0.5 * MIN(1, fabs(log10(0.01 * correction_factor))); - - cpi->rc.q_2_frame = cpi->rc.q_1_frame; - cpi->rc.q_1_frame = cm->base_qindex; - cpi->rc.rc_2_frame = cpi->rc.rc_1_frame; - if (correction_factor > 110) - cpi->rc.rc_1_frame = -1; - else if (correction_factor < 90) - cpi->rc.rc_1_frame = 1; - else - cpi->rc.rc_1_frame = 0; - - if (correction_factor > 102) { - // We are not already at the worst allowable quality - correction_factor = (int)(100 + ((correction_factor - 100) * - adjustment_limit)); - rate_correction_factor = (rate_correction_factor * correction_factor) / 100; - // Keep rate_correction_factor within limits - if (rate_correction_factor > MAX_BPB_FACTOR) - rate_correction_factor = MAX_BPB_FACTOR; - } else if (correction_factor < 99) { - // We are not already at the best allowable quality - correction_factor = (int)(100 - ((100 - correction_factor) * - adjustment_limit)); - rate_correction_factor = (rate_correction_factor * correction_factor) / 100; - - // Keep rate_correction_factor within limits - if (rate_correction_factor < MIN_BPB_FACTOR) - rate_correction_factor = MIN_BPB_FACTOR; - } - - set_rate_correction_factor(cpi, rate_correction_factor); -} - - -int vp9_rc_regulate_q(const VP9_COMP *cpi, int target_bits_per_frame, - int active_best_quality, int active_worst_quality) { - const VP9_COMMON *const cm = &cpi->common; - int q = active_worst_quality; - int last_error = INT_MAX; - int i, target_bits_per_mb, bits_per_mb_at_this_q; - const double correction_factor = get_rate_correction_factor(cpi); - - // Calculate required scaling factor based on target frame size and size of - // frame produced using previous Q. - target_bits_per_mb = - ((uint64_t)target_bits_per_frame << BPER_MB_NORMBITS) / cm->MBs; - - i = active_best_quality; - - do { - if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && cm->seg.enabled) { - bits_per_mb_at_this_q = - (int)vp9_cyclic_refresh_rc_bits_per_mb(cpi, i, correction_factor); - } else { - bits_per_mb_at_this_q = (int)vp9_rc_bits_per_mb(cm->frame_type, i, - correction_factor, - cm->bit_depth); - } - - if (bits_per_mb_at_this_q <= target_bits_per_mb) { - if ((target_bits_per_mb - bits_per_mb_at_this_q) <= last_error) - q = i; - else - q = i - 1; - - break; - } else { - last_error = bits_per_mb_at_this_q - target_bits_per_mb; - } - } while (++i <= active_worst_quality); - - // In CBR mode, this makes sure q is between oscillating Qs to prevent - // resonance. - if (cpi->oxcf.rc_mode == VPX_CBR && - (cpi->rc.rc_1_frame * cpi->rc.rc_2_frame == -1) && - cpi->rc.q_1_frame != cpi->rc.q_2_frame) { - q = clamp(q, MIN(cpi->rc.q_1_frame, cpi->rc.q_2_frame), - MAX(cpi->rc.q_1_frame, cpi->rc.q_2_frame)); - } - return q; -} - -static int get_active_quality(int q, int gfu_boost, int low, int high, - int *low_motion_minq, int *high_motion_minq) { - if (gfu_boost > high) { - return low_motion_minq[q]; - } else if (gfu_boost < low) { - return high_motion_minq[q]; - } else { - const int gap = high - low; - const int offset = high - gfu_boost; - const int qdiff = high_motion_minq[q] - low_motion_minq[q]; - const int adjustment = ((offset * qdiff) + (gap >> 1)) / gap; - return low_motion_minq[q] + adjustment; - } -} - -static int get_kf_active_quality(const RATE_CONTROL *const rc, int q, - vpx_bit_depth_t bit_depth) { - int *kf_low_motion_minq; - int *kf_high_motion_minq; - ASSIGN_MINQ_TABLE(bit_depth, kf_low_motion_minq); - ASSIGN_MINQ_TABLE(bit_depth, kf_high_motion_minq); - return get_active_quality(q, rc->kf_boost, kf_low, kf_high, - kf_low_motion_minq, kf_high_motion_minq); -} - -static int get_gf_active_quality(const RATE_CONTROL *const rc, int q, - vpx_bit_depth_t bit_depth) { - int *arfgf_low_motion_minq; - int *arfgf_high_motion_minq; - ASSIGN_MINQ_TABLE(bit_depth, arfgf_low_motion_minq); - ASSIGN_MINQ_TABLE(bit_depth, arfgf_high_motion_minq); - return get_active_quality(q, rc->gfu_boost, gf_low, gf_high, - arfgf_low_motion_minq, arfgf_high_motion_minq); -} - -static int calc_active_worst_quality_one_pass_vbr(const VP9_COMP *cpi) { - const RATE_CONTROL *const rc = &cpi->rc; - const unsigned int curr_frame = cpi->common.current_video_frame; - int active_worst_quality; - - if (cpi->common.frame_type == KEY_FRAME) { - active_worst_quality = curr_frame == 0 ? rc->worst_quality - : rc->last_q[KEY_FRAME] * 2; - } else { - if (!rc->is_src_frame_alt_ref && - (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame)) { - active_worst_quality = curr_frame == 1 ? rc->last_q[KEY_FRAME] * 5 / 4 - : rc->last_q[INTER_FRAME]; - } else { - active_worst_quality = curr_frame == 1 ? rc->last_q[KEY_FRAME] * 2 - : rc->last_q[INTER_FRAME] * 2; - } - } - return MIN(active_worst_quality, rc->worst_quality); -} - -// Adjust active_worst_quality level based on buffer level. -static int calc_active_worst_quality_one_pass_cbr(const VP9_COMP *cpi) { - // Adjust active_worst_quality: If buffer is above the optimal/target level, - // bring active_worst_quality down depending on fullness of buffer. - // If buffer is below the optimal level, let the active_worst_quality go from - // ambient Q (at buffer = optimal level) to worst_quality level - // (at buffer = critical level). - const VP9_COMMON *const cm = &cpi->common; - const RATE_CONTROL *rc = &cpi->rc; - // Buffer level below which we push active_worst to worst_quality. - int64_t critical_level = rc->optimal_buffer_level >> 3; - int64_t buff_lvl_step = 0; - int adjustment = 0; - int active_worst_quality; - int ambient_qp; - if (cm->frame_type == KEY_FRAME) - return rc->worst_quality; - // For ambient_qp we use minimum of avg_frame_qindex[KEY_FRAME/INTER_FRAME] - // for the first few frames following key frame. These are both initialized - // to worst_quality and updated with (3/4, 1/4) average in postencode_update. - // So for first few frames following key, the qp of that key frame is weighted - // into the active_worst_quality setting. - ambient_qp = (cm->current_video_frame < 5) ? - MIN(rc->avg_frame_qindex[INTER_FRAME], rc->avg_frame_qindex[KEY_FRAME]) : - rc->avg_frame_qindex[INTER_FRAME]; - active_worst_quality = MIN(rc->worst_quality, - ambient_qp * 5 / 4); - if (rc->buffer_level > rc->optimal_buffer_level) { - // Adjust down. - // Maximum limit for down adjustment, ~30%. - int max_adjustment_down = active_worst_quality / 3; - if (max_adjustment_down) { - buff_lvl_step = ((rc->maximum_buffer_size - - rc->optimal_buffer_level) / max_adjustment_down); - if (buff_lvl_step) - adjustment = (int)((rc->buffer_level - rc->optimal_buffer_level) / - buff_lvl_step); - active_worst_quality -= adjustment; - } - } else if (rc->buffer_level > critical_level) { - // Adjust up from ambient Q. - if (critical_level) { - buff_lvl_step = (rc->optimal_buffer_level - critical_level); - if (buff_lvl_step) { - adjustment = (int)((rc->worst_quality - ambient_qp) * - (rc->optimal_buffer_level - rc->buffer_level) / - buff_lvl_step); - } - active_worst_quality = ambient_qp + adjustment; - } - } else { - // Set to worst_quality if buffer is below critical level. - active_worst_quality = rc->worst_quality; - } - return active_worst_quality; -} - -static int rc_pick_q_and_bounds_one_pass_cbr(const VP9_COMP *cpi, - int *bottom_index, - int *top_index) { - const VP9_COMMON *const cm = &cpi->common; - const RATE_CONTROL *const rc = &cpi->rc; - int active_best_quality; - int active_worst_quality = calc_active_worst_quality_one_pass_cbr(cpi); - int q; - int *rtc_minq; - ASSIGN_MINQ_TABLE(cm->bit_depth, rtc_minq); - - if (frame_is_intra_only(cm)) { - active_best_quality = rc->best_quality; - // Handle the special case for key frames forced when we have reached - // the maximum key frame interval. Here force the Q to a range - // based on the ambient Q to reduce the risk of popping. - if (rc->this_key_frame_forced) { - int qindex = rc->last_boosted_qindex; - double last_boosted_q = vp9_convert_qindex_to_q(qindex, cm->bit_depth); - int delta_qindex = vp9_compute_qdelta(rc, last_boosted_q, - (last_boosted_q * 0.75), - cm->bit_depth); - active_best_quality = MAX(qindex + delta_qindex, rc->best_quality); - } else if (cm->current_video_frame > 0) { - // not first frame of one pass and kf_boost is set - double q_adj_factor = 1.0; - double q_val; - - active_best_quality = - get_kf_active_quality(rc, rc->avg_frame_qindex[KEY_FRAME], - cm->bit_depth); - - // Allow somewhat lower kf minq with small image formats. - if ((cm->width * cm->height) <= (352 * 288)) { - q_adj_factor -= 0.25; - } - - // Convert the adjustment factor to a qindex delta - // on active_best_quality. - q_val = vp9_convert_qindex_to_q(active_best_quality, cm->bit_depth); - active_best_quality += vp9_compute_qdelta(rc, q_val, - q_val * q_adj_factor, - cm->bit_depth); - } - } else if (!rc->is_src_frame_alt_ref && - !cpi->use_svc && - (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame)) { - // Use the lower of active_worst_quality and recent - // average Q as basis for GF/ARF best Q limit unless last frame was - // a key frame. - if (rc->frames_since_key > 1 && - rc->avg_frame_qindex[INTER_FRAME] < active_worst_quality) { - q = rc->avg_frame_qindex[INTER_FRAME]; - } else { - q = active_worst_quality; - } - active_best_quality = get_gf_active_quality(rc, q, cm->bit_depth); - } else { - // Use the lower of active_worst_quality and recent/average Q. - if (cm->current_video_frame > 1) { - if (rc->avg_frame_qindex[INTER_FRAME] < active_worst_quality) - active_best_quality = rtc_minq[rc->avg_frame_qindex[INTER_FRAME]]; - else - active_best_quality = rtc_minq[active_worst_quality]; - } else { - if (rc->avg_frame_qindex[KEY_FRAME] < active_worst_quality) - active_best_quality = rtc_minq[rc->avg_frame_qindex[KEY_FRAME]]; - else - active_best_quality = rtc_minq[active_worst_quality]; - } - } - - // Clip the active best and worst quality values to limits - active_best_quality = clamp(active_best_quality, - rc->best_quality, rc->worst_quality); - active_worst_quality = clamp(active_worst_quality, - active_best_quality, rc->worst_quality); - - *top_index = active_worst_quality; - *bottom_index = active_best_quality; - -#if LIMIT_QRANGE_FOR_ALTREF_AND_KEY - // Limit Q range for the adaptive loop. - if (cm->frame_type == KEY_FRAME && - !rc->this_key_frame_forced && - !(cm->current_video_frame == 0)) { - int qdelta = 0; - vp9_clear_system_state(); - qdelta = vp9_compute_qdelta_by_rate(&cpi->rc, cm->frame_type, - active_worst_quality, 2.0, - cm->bit_depth); - *top_index = active_worst_quality + qdelta; - *top_index = (*top_index > *bottom_index) ? *top_index : *bottom_index; - } -#endif - - // Special case code to try and match quality with forced key frames - if (cm->frame_type == KEY_FRAME && rc->this_key_frame_forced) { - q = rc->last_boosted_qindex; - } else { - q = vp9_rc_regulate_q(cpi, rc->this_frame_target, - active_best_quality, active_worst_quality); - if (q > *top_index) { - // Special case when we are targeting the max allowed rate - if (rc->this_frame_target >= rc->max_frame_bandwidth) - *top_index = q; - else - q = *top_index; - } - } - assert(*top_index <= rc->worst_quality && - *top_index >= rc->best_quality); - assert(*bottom_index <= rc->worst_quality && - *bottom_index >= rc->best_quality); - assert(q <= rc->worst_quality && q >= rc->best_quality); - return q; -} - -static int get_active_cq_level(const RATE_CONTROL *rc, - const VP9EncoderConfig *const oxcf) { - static const double cq_adjust_threshold = 0.1; - int active_cq_level = oxcf->cq_level; - if (oxcf->rc_mode == VPX_CQ && - rc->total_target_bits > 0) { - const double x = (double)rc->total_actual_bits / rc->total_target_bits; - if (x < cq_adjust_threshold) { - active_cq_level = (int)(active_cq_level * x / cq_adjust_threshold); - } - } - return active_cq_level; -} - -static int rc_pick_q_and_bounds_one_pass_vbr(const VP9_COMP *cpi, - int *bottom_index, - int *top_index) { - const VP9_COMMON *const cm = &cpi->common; - const RATE_CONTROL *const rc = &cpi->rc; - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - const int cq_level = get_active_cq_level(rc, oxcf); - int active_best_quality; - int active_worst_quality = calc_active_worst_quality_one_pass_vbr(cpi); - int q; - int *inter_minq; - ASSIGN_MINQ_TABLE(cm->bit_depth, inter_minq); - - if (frame_is_intra_only(cm)) { - - // Handle the special case for key frames forced when we have reached - // the maximum key frame interval. Here force the Q to a range - // based on the ambient Q to reduce the risk of popping. - if (rc->this_key_frame_forced) { - int qindex = rc->last_boosted_qindex; - double last_boosted_q = vp9_convert_qindex_to_q(qindex, cm->bit_depth); - int delta_qindex = vp9_compute_qdelta(rc, last_boosted_q, - last_boosted_q * 0.75, - cm->bit_depth); - active_best_quality = MAX(qindex + delta_qindex, rc->best_quality); - } else { - // not first frame of one pass and kf_boost is set - double q_adj_factor = 1.0; - double q_val; - - active_best_quality = - get_kf_active_quality(rc, rc->avg_frame_qindex[KEY_FRAME], - cm->bit_depth); - - // Allow somewhat lower kf minq with small image formats. - if ((cm->width * cm->height) <= (352 * 288)) { - q_adj_factor -= 0.25; - } - - // Convert the adjustment factor to a qindex delta - // on active_best_quality. - q_val = vp9_convert_qindex_to_q(active_best_quality, cm->bit_depth); - active_best_quality += vp9_compute_qdelta(rc, q_val, - q_val * q_adj_factor, - cm->bit_depth); - } - } else if (!rc->is_src_frame_alt_ref && - (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame)) { - // Use the lower of active_worst_quality and recent - // average Q as basis for GF/ARF best Q limit unless last frame was - // a key frame. - if (rc->frames_since_key > 1 && - rc->avg_frame_qindex[INTER_FRAME] < active_worst_quality) { - q = rc->avg_frame_qindex[INTER_FRAME]; - } else { - q = rc->avg_frame_qindex[KEY_FRAME]; - } - // For constrained quality dont allow Q less than the cq level - if (oxcf->rc_mode == VPX_CQ) { - if (q < cq_level) - q = cq_level; - - active_best_quality = get_gf_active_quality(rc, q, cm->bit_depth); - - // Constrained quality use slightly lower active best. - active_best_quality = active_best_quality * 15 / 16; - - } else if (oxcf->rc_mode == VPX_Q) { - if (!cpi->refresh_alt_ref_frame) { - active_best_quality = cq_level; - } else { - active_best_quality = get_gf_active_quality(rc, q, cm->bit_depth); - } - } else { - active_best_quality = get_gf_active_quality(rc, q, cm->bit_depth); - } - } else { - if (oxcf->rc_mode == VPX_Q) { - active_best_quality = cq_level; - } else { - // Use the lower of active_worst_quality and recent/average Q. - if (cm->current_video_frame > 1) - active_best_quality = inter_minq[rc->avg_frame_qindex[INTER_FRAME]]; - else - active_best_quality = inter_minq[rc->avg_frame_qindex[KEY_FRAME]]; - // For the constrained quality mode we don't want - // q to fall below the cq level. - if ((oxcf->rc_mode == VPX_CQ) && - (active_best_quality < cq_level)) { - active_best_quality = cq_level; - } - } - } - - // Clip the active best and worst quality values to limits - active_best_quality = clamp(active_best_quality, - rc->best_quality, rc->worst_quality); - active_worst_quality = clamp(active_worst_quality, - active_best_quality, rc->worst_quality); - - *top_index = active_worst_quality; - *bottom_index = active_best_quality; - -#if LIMIT_QRANGE_FOR_ALTREF_AND_KEY - { - int qdelta = 0; - vp9_clear_system_state(); - - // Limit Q range for the adaptive loop. - if (cm->frame_type == KEY_FRAME && - !rc->this_key_frame_forced && - !(cm->current_video_frame == 0)) { - qdelta = vp9_compute_qdelta_by_rate(&cpi->rc, cm->frame_type, - active_worst_quality, 2.0, - cm->bit_depth); - } else if (!rc->is_src_frame_alt_ref && - (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame)) { - qdelta = vp9_compute_qdelta_by_rate(&cpi->rc, cm->frame_type, - active_worst_quality, 1.75, - cm->bit_depth); - } - *top_index = active_worst_quality + qdelta; - *top_index = (*top_index > *bottom_index) ? *top_index : *bottom_index; - } -#endif - - if (oxcf->rc_mode == VPX_Q) { - q = active_best_quality; - // Special case code to try and match quality with forced key frames - } else if ((cm->frame_type == KEY_FRAME) && rc->this_key_frame_forced) { - q = rc->last_boosted_qindex; - } else { - q = vp9_rc_regulate_q(cpi, rc->this_frame_target, - active_best_quality, active_worst_quality); - if (q > *top_index) { - // Special case when we are targeting the max allowed rate - if (rc->this_frame_target >= rc->max_frame_bandwidth) - *top_index = q; - else - q = *top_index; - } - } - - assert(*top_index <= rc->worst_quality && - *top_index >= rc->best_quality); - assert(*bottom_index <= rc->worst_quality && - *bottom_index >= rc->best_quality); - assert(q <= rc->worst_quality && q >= rc->best_quality); - return q; -} - -int vp9_frame_type_qdelta(const VP9_COMP *cpi, int rf_level, int q) { - static const double rate_factor_deltas[RATE_FACTOR_LEVELS] = { - 1.00, // INTER_NORMAL - 1.00, // INTER_HIGH - 1.50, // GF_ARF_LOW - 1.75, // GF_ARF_STD - 2.00, // KF_STD - }; - static const FRAME_TYPE frame_type[RATE_FACTOR_LEVELS] = - {INTER_FRAME, INTER_FRAME, INTER_FRAME, INTER_FRAME, KEY_FRAME}; - const VP9_COMMON *const cm = &cpi->common; - int qdelta = vp9_compute_qdelta_by_rate(&cpi->rc, frame_type[rf_level], - q, rate_factor_deltas[rf_level], - cm->bit_depth); - return qdelta; -} - -#define STATIC_MOTION_THRESH 95 -static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *cpi, - int *bottom_index, - int *top_index) { - const VP9_COMMON *const cm = &cpi->common; - const RATE_CONTROL *const rc = &cpi->rc; - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - const GF_GROUP *gf_group = &cpi->twopass.gf_group; - const int cq_level = get_active_cq_level(rc, oxcf); - int active_best_quality; - int active_worst_quality = cpi->twopass.active_worst_quality; - int q; - int *inter_minq; - ASSIGN_MINQ_TABLE(cm->bit_depth, inter_minq); - - if (frame_is_intra_only(cm) || vp9_is_upper_layer_key_frame(cpi)) { - // Handle the special case for key frames forced when we have reached - // the maximum key frame interval. Here force the Q to a range - // based on the ambient Q to reduce the risk of popping. - if (rc->this_key_frame_forced) { - double last_boosted_q; - int delta_qindex; - int qindex; - - if (cpi->twopass.last_kfgroup_zeromotion_pct >= STATIC_MOTION_THRESH) { - qindex = MIN(rc->last_kf_qindex, rc->last_boosted_qindex); - active_best_quality = qindex; - last_boosted_q = vp9_convert_qindex_to_q(qindex, cm->bit_depth); - delta_qindex = vp9_compute_qdelta(rc, last_boosted_q, - last_boosted_q * 1.25, - cm->bit_depth); - active_worst_quality = MIN(qindex + delta_qindex, active_worst_quality); - - } else { - qindex = rc->last_boosted_qindex; - last_boosted_q = vp9_convert_qindex_to_q(qindex, cm->bit_depth); - delta_qindex = vp9_compute_qdelta(rc, last_boosted_q, - last_boosted_q * 0.75, - cm->bit_depth); - active_best_quality = MAX(qindex + delta_qindex, rc->best_quality); - } - } else { - // Not forced keyframe. - double q_adj_factor = 1.0; - double q_val; - // Baseline value derived from cpi->active_worst_quality and kf boost. - active_best_quality = get_kf_active_quality(rc, active_worst_quality, - cm->bit_depth); - - // Allow somewhat lower kf minq with small image formats. - if ((cm->width * cm->height) <= (352 * 288)) { - q_adj_factor -= 0.25; - } - - // Make a further adjustment based on the kf zero motion measure. - q_adj_factor += 0.05 - (0.001 * (double)cpi->twopass.kf_zeromotion_pct); - - // Convert the adjustment factor to a qindex delta - // on active_best_quality. - q_val = vp9_convert_qindex_to_q(active_best_quality, cm->bit_depth); - active_best_quality += vp9_compute_qdelta(rc, q_val, - q_val * q_adj_factor, - cm->bit_depth); - } - } else if (!rc->is_src_frame_alt_ref && - (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame)) { - // Use the lower of active_worst_quality and recent - // average Q as basis for GF/ARF best Q limit unless last frame was - // a key frame. - if (rc->frames_since_key > 1 && - rc->avg_frame_qindex[INTER_FRAME] < active_worst_quality) { - q = rc->avg_frame_qindex[INTER_FRAME]; - } else { - q = active_worst_quality; - } - // For constrained quality dont allow Q less than the cq level - if (oxcf->rc_mode == VPX_CQ) { - if (q < cq_level) - q = cq_level; - - active_best_quality = get_gf_active_quality(rc, q, cm->bit_depth); - - // Constrained quality use slightly lower active best. - active_best_quality = active_best_quality * 15 / 16; - - } else if (oxcf->rc_mode == VPX_Q) { - if (!cpi->refresh_alt_ref_frame) { - active_best_quality = cq_level; - } else { - active_best_quality = get_gf_active_quality(rc, q, cm->bit_depth); - - // Modify best quality for second level arfs. For mode VPX_Q this - // becomes the baseline frame q. - if (gf_group->rf_level[gf_group->index] == GF_ARF_LOW) - active_best_quality = (active_best_quality + cq_level + 1) / 2; - } - } else { - active_best_quality = get_gf_active_quality(rc, q, cm->bit_depth); - } - } else { - if (oxcf->rc_mode == VPX_Q) { - active_best_quality = cq_level; - } else { - active_best_quality = inter_minq[active_worst_quality]; - - // For the constrained quality mode we don't want - // q to fall below the cq level. - if ((oxcf->rc_mode == VPX_CQ) && - (active_best_quality < cq_level)) { - active_best_quality = cq_level; - } - } - } - - // Extension to max or min Q if undershoot or overshoot is outside - // the permitted range. - if ((cpi->oxcf.rc_mode != VPX_Q) && - (cpi->twopass.gf_zeromotion_pct < VLOW_MOTION_THRESHOLD)) { - if (frame_is_intra_only(cm) || - (!rc->is_src_frame_alt_ref && - (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame))) { - active_best_quality -= cpi->twopass.extend_minq; - active_worst_quality += (cpi->twopass.extend_maxq / 2); - } else { - active_best_quality -= cpi->twopass.extend_minq / 2; - active_worst_quality += cpi->twopass.extend_maxq; - } - } - -#if LIMIT_QRANGE_FOR_ALTREF_AND_KEY - vp9_clear_system_state(); - // Static forced key frames Q restrictions dealt with elsewhere. - if (!((frame_is_intra_only(cm) || vp9_is_upper_layer_key_frame(cpi))) || - !rc->this_key_frame_forced || - (cpi->twopass.last_kfgroup_zeromotion_pct < STATIC_MOTION_THRESH)) { - int qdelta = vp9_frame_type_qdelta(cpi, gf_group->rf_level[gf_group->index], - active_worst_quality); - active_worst_quality = MAX(active_worst_quality + qdelta, - active_best_quality); - } -#endif - - // Modify active_best_quality for downscaled normal frames. - if (rc->frame_size_selector != UNSCALED && !frame_is_kf_gf_arf(cpi)) { - int qdelta = vp9_compute_qdelta_by_rate(rc, cm->frame_type, - active_best_quality, 2.0, - cm->bit_depth); - active_best_quality = MAX(active_best_quality + qdelta, rc->best_quality); - } - - active_best_quality = clamp(active_best_quality, - rc->best_quality, rc->worst_quality); - active_worst_quality = clamp(active_worst_quality, - active_best_quality, rc->worst_quality); - - if (oxcf->rc_mode == VPX_Q) { - q = active_best_quality; - // Special case code to try and match quality with forced key frames. - } else if ((frame_is_intra_only(cm) || vp9_is_upper_layer_key_frame(cpi)) && - rc->this_key_frame_forced) { - // If static since last kf use better of last boosted and last kf q. - if (cpi->twopass.last_kfgroup_zeromotion_pct >= STATIC_MOTION_THRESH) { - q = MIN(rc->last_kf_qindex, rc->last_boosted_qindex); - } else { - q = rc->last_boosted_qindex; - } - } else { - q = vp9_rc_regulate_q(cpi, rc->this_frame_target, - active_best_quality, active_worst_quality); - if (q > active_worst_quality) { - // Special case when we are targeting the max allowed rate. - if (rc->this_frame_target >= rc->max_frame_bandwidth) - active_worst_quality = q; - else - q = active_worst_quality; - } - } - clamp(q, active_best_quality, active_worst_quality); - - *top_index = active_worst_quality; - *bottom_index = active_best_quality; - - assert(*top_index <= rc->worst_quality && - *top_index >= rc->best_quality); - assert(*bottom_index <= rc->worst_quality && - *bottom_index >= rc->best_quality); - assert(q <= rc->worst_quality && q >= rc->best_quality); - return q; -} - -int vp9_rc_pick_q_and_bounds(const VP9_COMP *cpi, - int *bottom_index, int *top_index) { - int q; - if (cpi->oxcf.pass == 0) { - if (cpi->oxcf.rc_mode == VPX_CBR) - q = rc_pick_q_and_bounds_one_pass_cbr(cpi, bottom_index, top_index); - else - q = rc_pick_q_and_bounds_one_pass_vbr(cpi, bottom_index, top_index); - } else { - q = rc_pick_q_and_bounds_two_pass(cpi, bottom_index, top_index); - } - if (cpi->sf.use_nonrd_pick_mode) { - if (cpi->sf.force_frame_boost == 1) - q -= cpi->sf.max_delta_qindex; - - if (q < *bottom_index) - *bottom_index = q; - else if (q > *top_index) - *top_index = q; - } - return q; -} - -void vp9_rc_compute_frame_size_bounds(const VP9_COMP *cpi, - int frame_target, - int *frame_under_shoot_limit, - int *frame_over_shoot_limit) { - if (cpi->oxcf.rc_mode == VPX_Q) { - *frame_under_shoot_limit = 0; - *frame_over_shoot_limit = INT_MAX; - } else { - // For very small rate targets where the fractional adjustment - // may be tiny make sure there is at least a minimum range. - const int tolerance = (cpi->sf.recode_tolerance * frame_target) / 100; - *frame_under_shoot_limit = MAX(frame_target - tolerance - 200, 0); - *frame_over_shoot_limit = MIN(frame_target + tolerance + 200, - cpi->rc.max_frame_bandwidth); - } -} - -void vp9_rc_set_frame_target(VP9_COMP *cpi, int target) { - const VP9_COMMON *const cm = &cpi->common; - RATE_CONTROL *const rc = &cpi->rc; - - rc->this_frame_target = target; - - // Modify frame size target when down-scaling. - if (cpi->oxcf.resize_mode == RESIZE_DYNAMIC && - rc->frame_size_selector != UNSCALED) - rc->this_frame_target = (int)(rc->this_frame_target - * rate_thresh_mult[rc->frame_size_selector]); - - // Target rate per SB64 (including partial SB64s. - rc->sb64_target_rate = ((int64_t)rc->this_frame_target * 64 * 64) / - (cm->width * cm->height); -} - -static void update_alt_ref_frame_stats(VP9_COMP *cpi) { - // this frame refreshes means next frames don't unless specified by user - RATE_CONTROL *const rc = &cpi->rc; - rc->frames_since_golden = 0; - - // Mark the alt ref as done (setting to 0 means no further alt refs pending). - rc->source_alt_ref_pending = 0; - - // Set the alternate reference frame active flag - rc->source_alt_ref_active = 1; -} - -static void update_golden_frame_stats(VP9_COMP *cpi) { - RATE_CONTROL *const rc = &cpi->rc; - - // Update the Golden frame usage counts. - if (cpi->refresh_golden_frame) { - // this frame refreshes means next frames don't unless specified by user - rc->frames_since_golden = 0; - - if (cpi->oxcf.pass == 2) { - if (!rc->source_alt_ref_pending && - cpi->twopass.gf_group.rf_level[0] == GF_ARF_STD) - rc->source_alt_ref_active = 0; - } else if (!rc->source_alt_ref_pending) { - rc->source_alt_ref_active = 0; - } - - // Decrement count down till next gf - if (rc->frames_till_gf_update_due > 0) - rc->frames_till_gf_update_due--; - - } else if (!cpi->refresh_alt_ref_frame) { - // Decrement count down till next gf - if (rc->frames_till_gf_update_due > 0) - rc->frames_till_gf_update_due--; - - rc->frames_since_golden++; - } -} - -void vp9_rc_postencode_update(VP9_COMP *cpi, uint64_t bytes_used) { - const VP9_COMMON *const cm = &cpi->common; - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - RATE_CONTROL *const rc = &cpi->rc; - const int qindex = cm->base_qindex; - - if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && cm->seg.enabled) { - vp9_cyclic_refresh_postencode(cpi); - } - - // Update rate control heuristics - rc->projected_frame_size = (int)(bytes_used << 3); - - // Post encode loop adjustment of Q prediction. - vp9_rc_update_rate_correction_factors(cpi); - - // Keep a record of last Q and ambient average Q. - if (cm->frame_type == KEY_FRAME) { - rc->last_q[KEY_FRAME] = qindex; - rc->avg_frame_qindex[KEY_FRAME] = - ROUND_POWER_OF_TWO(3 * rc->avg_frame_qindex[KEY_FRAME] + qindex, 2); - } else { - if (rc->is_src_frame_alt_ref || - !(cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame) || - (cpi->use_svc && oxcf->rc_mode == VPX_CBR)) { - rc->last_q[INTER_FRAME] = qindex; - rc->avg_frame_qindex[INTER_FRAME] = - ROUND_POWER_OF_TWO(3 * rc->avg_frame_qindex[INTER_FRAME] + qindex, 2); - rc->ni_frames++; - rc->tot_q += vp9_convert_qindex_to_q(qindex, cm->bit_depth); - rc->avg_q = rc->tot_q / rc->ni_frames; - // Calculate the average Q for normal inter frames (not key or GFU - // frames). - rc->ni_tot_qi += qindex; - rc->ni_av_qi = rc->ni_tot_qi / rc->ni_frames; - } - } - - // Keep record of last boosted (KF/KF/ARF) Q value. - // If the current frame is coded at a lower Q then we also update it. - // If all mbs in this group are skipped only update if the Q value is - // better than that already stored. - // This is used to help set quality in forced key frames to reduce popping - if ((qindex < rc->last_boosted_qindex) || - (cm->frame_type == KEY_FRAME) || - (!rc->constrained_gf_group && - (cpi->refresh_alt_ref_frame || - (cpi->refresh_golden_frame && !rc->is_src_frame_alt_ref)))) { - rc->last_boosted_qindex = qindex; - } - if (cm->frame_type == KEY_FRAME) - rc->last_kf_qindex = qindex; - - update_buffer_level(cpi, rc->projected_frame_size); - - // Rolling monitors of whether we are over or underspending used to help - // regulate min and Max Q in two pass. - if (cm->frame_type != KEY_FRAME) { - rc->rolling_target_bits = ROUND_POWER_OF_TWO( - rc->rolling_target_bits * 3 + rc->this_frame_target, 2); - rc->rolling_actual_bits = ROUND_POWER_OF_TWO( - rc->rolling_actual_bits * 3 + rc->projected_frame_size, 2); - rc->long_rolling_target_bits = ROUND_POWER_OF_TWO( - rc->long_rolling_target_bits * 31 + rc->this_frame_target, 5); - rc->long_rolling_actual_bits = ROUND_POWER_OF_TWO( - rc->long_rolling_actual_bits * 31 + rc->projected_frame_size, 5); - } - - // Actual bits spent - rc->total_actual_bits += rc->projected_frame_size; - rc->total_target_bits += cm->show_frame ? rc->avg_frame_bandwidth : 0; - - rc->total_target_vs_actual = rc->total_actual_bits - rc->total_target_bits; - - if (is_altref_enabled(cpi) && cpi->refresh_alt_ref_frame && - (cm->frame_type != KEY_FRAME)) - // Update the alternate reference frame stats as appropriate. - update_alt_ref_frame_stats(cpi); - else - // Update the Golden frame stats as appropriate. - update_golden_frame_stats(cpi); - - if (cm->frame_type == KEY_FRAME) - rc->frames_since_key = 0; - if (cm->show_frame) { - rc->frames_since_key++; - rc->frames_to_key--; - } - - // Trigger the resizing of the next frame if it is scaled. - cpi->resize_pending = - rc->next_frame_size_selector != rc->frame_size_selector; - rc->frame_size_selector = rc->next_frame_size_selector; -} - -void vp9_rc_postencode_update_drop_frame(VP9_COMP *cpi) { - // Update buffer level with zero size, update frame counters, and return. - update_buffer_level(cpi, 0); - cpi->rc.frames_since_key++; - cpi->rc.frames_to_key--; - cpi->rc.rc_2_frame = 0; - cpi->rc.rc_1_frame = 0; -} - -// Use this macro to turn on/off use of alt-refs in one-pass mode. -#define USE_ALTREF_FOR_ONE_PASS 1 - -static int calc_pframe_target_size_one_pass_vbr(const VP9_COMP *const cpi) { - static const int af_ratio = 10; - const RATE_CONTROL *const rc = &cpi->rc; - int target; -#if USE_ALTREF_FOR_ONE_PASS - target = (!rc->is_src_frame_alt_ref && - (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame)) ? - (rc->avg_frame_bandwidth * rc->baseline_gf_interval * af_ratio) / - (rc->baseline_gf_interval + af_ratio - 1) : - (rc->avg_frame_bandwidth * rc->baseline_gf_interval) / - (rc->baseline_gf_interval + af_ratio - 1); -#else - target = rc->avg_frame_bandwidth; -#endif - return vp9_rc_clamp_pframe_target_size(cpi, target); -} - -static int calc_iframe_target_size_one_pass_vbr(const VP9_COMP *const cpi) { - static const int kf_ratio = 25; - const RATE_CONTROL *rc = &cpi->rc; - const int target = rc->avg_frame_bandwidth * kf_ratio; - return vp9_rc_clamp_iframe_target_size(cpi, target); -} - -void vp9_rc_get_one_pass_vbr_params(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - RATE_CONTROL *const rc = &cpi->rc; - int target; - // TODO(yaowu): replace the "auto_key && 0" below with proper decision logic. - if (!cpi->refresh_alt_ref_frame && - (cm->current_video_frame == 0 || - (cpi->frame_flags & FRAMEFLAGS_KEY) || - rc->frames_to_key == 0 || - (cpi->oxcf.auto_key && 0))) { - cm->frame_type = KEY_FRAME; - rc->this_key_frame_forced = cm->current_video_frame != 0 && - rc->frames_to_key == 0; - rc->frames_to_key = cpi->oxcf.key_freq; - rc->kf_boost = DEFAULT_KF_BOOST; - rc->source_alt_ref_active = 0; - } else { - cm->frame_type = INTER_FRAME; - } - if (rc->frames_till_gf_update_due == 0) { - rc->baseline_gf_interval = DEFAULT_GF_INTERVAL; - rc->frames_till_gf_update_due = rc->baseline_gf_interval; - // NOTE: frames_till_gf_update_due must be <= frames_to_key. - if (rc->frames_till_gf_update_due > rc->frames_to_key) { - rc->frames_till_gf_update_due = rc->frames_to_key; - rc->constrained_gf_group = 1; - } else { - rc->constrained_gf_group = 0; - } - cpi->refresh_golden_frame = 1; - rc->source_alt_ref_pending = USE_ALTREF_FOR_ONE_PASS; - rc->gfu_boost = DEFAULT_GF_BOOST; - } - if (cm->frame_type == KEY_FRAME) - target = calc_iframe_target_size_one_pass_vbr(cpi); - else - target = calc_pframe_target_size_one_pass_vbr(cpi); - vp9_rc_set_frame_target(cpi, target); -} - -static int calc_pframe_target_size_one_pass_cbr(const VP9_COMP *cpi) { - const VP9EncoderConfig *oxcf = &cpi->oxcf; - const RATE_CONTROL *rc = &cpi->rc; - const SVC *const svc = &cpi->svc; - const int64_t diff = rc->optimal_buffer_level - rc->buffer_level; - const int64_t one_pct_bits = 1 + rc->optimal_buffer_level / 100; - int min_frame_target = MAX(rc->avg_frame_bandwidth >> 4, FRAME_OVERHEAD_BITS); - int target; - - if (oxcf->gf_cbr_boost_pct) { - const int af_ratio_pct = oxcf->gf_cbr_boost_pct + 100; - target = cpi->refresh_golden_frame ? - (rc->avg_frame_bandwidth * rc->baseline_gf_interval * af_ratio_pct) / - (rc->baseline_gf_interval * 100 + af_ratio_pct - 100) : - (rc->avg_frame_bandwidth * rc->baseline_gf_interval * 100) / - (rc->baseline_gf_interval * 100 + af_ratio_pct - 100); - } else { - target = rc->avg_frame_bandwidth; - } - if (svc->number_temporal_layers > 1 && - oxcf->rc_mode == VPX_CBR) { - // Note that for layers, avg_frame_bandwidth is the cumulative - // per-frame-bandwidth. For the target size of this frame, use the - // layer average frame size (i.e., non-cumulative per-frame-bw). - int current_temporal_layer = svc->temporal_layer_id; - const LAYER_CONTEXT *lc = &svc->layer_context[current_temporal_layer]; - target = lc->avg_frame_size; - min_frame_target = MAX(lc->avg_frame_size >> 4, FRAME_OVERHEAD_BITS); - } - if (diff > 0) { - // Lower the target bandwidth for this frame. - const int pct_low = (int)MIN(diff / one_pct_bits, oxcf->under_shoot_pct); - target -= (target * pct_low) / 200; - } else if (diff < 0) { - // Increase the target bandwidth for this frame. - const int pct_high = (int)MIN(-diff / one_pct_bits, oxcf->over_shoot_pct); - target += (target * pct_high) / 200; - } - if (oxcf->rc_max_inter_bitrate_pct) { - const int max_rate = rc->avg_frame_bandwidth * - oxcf->rc_max_inter_bitrate_pct / 100; - target = MIN(target, max_rate); - } - return MAX(min_frame_target, target); -} - -static int calc_iframe_target_size_one_pass_cbr(const VP9_COMP *cpi) { - const RATE_CONTROL *rc = &cpi->rc; - const VP9EncoderConfig *oxcf = &cpi->oxcf; - const SVC *const svc = &cpi->svc; - int target; - if (cpi->common.current_video_frame == 0) { - target = ((rc->starting_buffer_level / 2) > INT_MAX) - ? INT_MAX : (int)(rc->starting_buffer_level / 2); - } else { - int kf_boost = 32; - double framerate = cpi->framerate; - if (svc->number_temporal_layers > 1 && - oxcf->rc_mode == VPX_CBR) { - // Use the layer framerate for temporal layers CBR mode. - const LAYER_CONTEXT *lc = &svc->layer_context[svc->temporal_layer_id]; - framerate = lc->framerate; - } - kf_boost = MAX(kf_boost, (int)(2 * framerate - 16)); - if (rc->frames_since_key < framerate / 2) { - kf_boost = (int)(kf_boost * rc->frames_since_key / - (framerate / 2)); - } - target = ((16 + kf_boost) * rc->avg_frame_bandwidth) >> 4; - } - return vp9_rc_clamp_iframe_target_size(cpi, target); -} - -void vp9_rc_get_svc_params(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - RATE_CONTROL *const rc = &cpi->rc; - int target = rc->avg_frame_bandwidth; - if ((cm->current_video_frame == 0) || - (cpi->frame_flags & FRAMEFLAGS_KEY) || - (cpi->oxcf.auto_key && (rc->frames_since_key % - cpi->oxcf.key_freq == 0))) { - cm->frame_type = KEY_FRAME; - rc->source_alt_ref_active = 0; - - if (is_two_pass_svc(cpi)) { - cpi->svc.layer_context[cpi->svc.spatial_layer_id].is_key_frame = 1; - cpi->ref_frame_flags &= - (~VP9_LAST_FLAG & ~VP9_GOLD_FLAG & ~VP9_ALT_FLAG); - } - - if (cpi->oxcf.pass == 0 && cpi->oxcf.rc_mode == VPX_CBR) { - target = calc_iframe_target_size_one_pass_cbr(cpi); - } - } else { - cm->frame_type = INTER_FRAME; - - if (is_two_pass_svc(cpi)) { - LAYER_CONTEXT *lc = &cpi->svc.layer_context[cpi->svc.spatial_layer_id]; - if (cpi->svc.spatial_layer_id == 0) { - lc->is_key_frame = 0; - } else { - lc->is_key_frame = cpi->svc.layer_context[0].is_key_frame; - if (lc->is_key_frame) - cpi->ref_frame_flags &= (~VP9_LAST_FLAG); - } - cpi->ref_frame_flags &= (~VP9_ALT_FLAG); - } - - if (cpi->oxcf.pass == 0 && cpi->oxcf.rc_mode == VPX_CBR) { - target = calc_pframe_target_size_one_pass_cbr(cpi); - } - } - - // Any update/change of global cyclic refresh parameters (amount/delta-qp) - // should be done here, before the frame qp is selected. - if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) - vp9_cyclic_refresh_update_parameters(cpi); - - vp9_rc_set_frame_target(cpi, target); - rc->frames_till_gf_update_due = INT_MAX; - rc->baseline_gf_interval = INT_MAX; -} - -void vp9_rc_get_one_pass_cbr_params(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - RATE_CONTROL *const rc = &cpi->rc; - int target; - // TODO(yaowu): replace the "auto_key && 0" below with proper decision logic. - if ((cm->current_video_frame == 0 || - (cpi->frame_flags & FRAMEFLAGS_KEY) || - rc->frames_to_key == 0 || - (cpi->oxcf.auto_key && 0))) { - cm->frame_type = KEY_FRAME; - rc->this_key_frame_forced = cm->current_video_frame != 0 && - rc->frames_to_key == 0; - rc->frames_to_key = cpi->oxcf.key_freq; - rc->kf_boost = DEFAULT_KF_BOOST; - rc->source_alt_ref_active = 0; - } else { - cm->frame_type = INTER_FRAME; - } - if (rc->frames_till_gf_update_due == 0) { - if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) - vp9_cyclic_refresh_set_golden_update(cpi); - else - rc->baseline_gf_interval = DEFAULT_GF_INTERVAL; - rc->frames_till_gf_update_due = rc->baseline_gf_interval; - // NOTE: frames_till_gf_update_due must be <= frames_to_key. - if (rc->frames_till_gf_update_due > rc->frames_to_key) - rc->frames_till_gf_update_due = rc->frames_to_key; - cpi->refresh_golden_frame = 1; - rc->gfu_boost = DEFAULT_GF_BOOST; - } - - // Any update/change of global cyclic refresh parameters (amount/delta-qp) - // should be done here, before the frame qp is selected. - if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) - vp9_cyclic_refresh_update_parameters(cpi); - - if (cm->frame_type == KEY_FRAME) - target = calc_iframe_target_size_one_pass_cbr(cpi); - else - target = calc_pframe_target_size_one_pass_cbr(cpi); - - vp9_rc_set_frame_target(cpi, target); -} - -int vp9_compute_qdelta(const RATE_CONTROL *rc, double qstart, double qtarget, - vpx_bit_depth_t bit_depth) { - int start_index = rc->worst_quality; - int target_index = rc->worst_quality; - int i; - - // Convert the average q value to an index. - for (i = rc->best_quality; i < rc->worst_quality; ++i) { - start_index = i; - if (vp9_convert_qindex_to_q(i, bit_depth) >= qstart) - break; - } - - // Convert the q target to an index - for (i = rc->best_quality; i < rc->worst_quality; ++i) { - target_index = i; - if (vp9_convert_qindex_to_q(i, bit_depth) >= qtarget) - break; - } - - return target_index - start_index; -} - -int vp9_compute_qdelta_by_rate(const RATE_CONTROL *rc, FRAME_TYPE frame_type, - int qindex, double rate_target_ratio, - vpx_bit_depth_t bit_depth) { - int target_index = rc->worst_quality; - int i; - - // Look up the current projected bits per block for the base index - const int base_bits_per_mb = vp9_rc_bits_per_mb(frame_type, qindex, 1.0, - bit_depth); - - // Find the target bits per mb based on the base value and given ratio. - const int target_bits_per_mb = (int)(rate_target_ratio * base_bits_per_mb); - - // Convert the q target to an index - for (i = rc->best_quality; i < rc->worst_quality; ++i) { - if (vp9_rc_bits_per_mb(frame_type, i, 1.0, bit_depth) <= - target_bits_per_mb) { - target_index = i; - break; - } - } - return target_index - qindex; -} - -void vp9_rc_set_gf_max_interval(const VP9_COMP *const cpi, - RATE_CONTROL *const rc) { - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - // Set Maximum gf/arf interval - rc->max_gf_interval = 16; - - // Extended interval for genuinely static scenes - rc->static_scene_max_gf_interval = MAX_LAG_BUFFERS * 2; - - if (is_altref_enabled(cpi)) { - if (rc->static_scene_max_gf_interval > oxcf->lag_in_frames - 1) - rc->static_scene_max_gf_interval = oxcf->lag_in_frames - 1; - } - - if (rc->max_gf_interval > rc->static_scene_max_gf_interval) - rc->max_gf_interval = rc->static_scene_max_gf_interval; -} - -void vp9_rc_update_framerate(VP9_COMP *cpi) { - const VP9_COMMON *const cm = &cpi->common; - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - RATE_CONTROL *const rc = &cpi->rc; - int vbr_max_bits; - - rc->avg_frame_bandwidth = (int)(oxcf->target_bandwidth / cpi->framerate); - rc->min_frame_bandwidth = (int)(rc->avg_frame_bandwidth * - oxcf->two_pass_vbrmin_section / 100); - - rc->min_frame_bandwidth = MAX(rc->min_frame_bandwidth, FRAME_OVERHEAD_BITS); - - // A maximum bitrate for a frame is defined. - // The baseline for this aligns with HW implementations that - // can support decode of 1080P content up to a bitrate of MAX_MB_RATE bits - // per 16x16 MB (averaged over a frame). However this limit is extended if - // a very high rate is given on the command line or the the rate cannnot - // be acheived because of a user specificed max q (e.g. when the user - // specifies lossless encode. - vbr_max_bits = (int)(((int64_t)rc->avg_frame_bandwidth * - oxcf->two_pass_vbrmax_section) / 100); - rc->max_frame_bandwidth = MAX(MAX((cm->MBs * MAX_MB_RATE), MAXRATE_1080P), - vbr_max_bits); - - vp9_rc_set_gf_max_interval(cpi, rc); -} - -#define VBR_PCT_ADJUSTMENT_LIMIT 50 -// For VBR...adjustment to the frame target based on error from previous frames -static void vbr_rate_correction(VP9_COMP *cpi, - int *this_frame_target, - int64_t vbr_bits_off_target) { - int max_delta; - double position_factor = 1.0; - - // How far through the clip are we. - // This number is used to damp the per frame rate correction. - // Range 0 - 1.0 - if (cpi->twopass.total_stats.count) { - position_factor = sqrt((double)cpi->common.current_video_frame / - cpi->twopass.total_stats.count); - } - max_delta = (int)(position_factor * - ((*this_frame_target * VBR_PCT_ADJUSTMENT_LIMIT) / 100)); - - // vbr_bits_off_target > 0 means we have extra bits to spend - if (vbr_bits_off_target > 0) { - *this_frame_target += - (vbr_bits_off_target > max_delta) ? max_delta - : (int)vbr_bits_off_target; - } else { - *this_frame_target -= - (vbr_bits_off_target < -max_delta) ? max_delta - : (int)-vbr_bits_off_target; - } -} - -void vp9_set_target_rate(VP9_COMP *cpi) { - RATE_CONTROL *const rc = &cpi->rc; - int target_rate = rc->base_frame_target; - - // Correction to rate target based on prior over or under shoot. - if (cpi->oxcf.rc_mode == VPX_VBR || cpi->oxcf.rc_mode == VPX_CQ) - vbr_rate_correction(cpi, &target_rate, rc->vbr_bits_off_target); - vp9_rc_set_frame_target(cpi, target_rate); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_ratectrl.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_ratectrl.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_ratectrl.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_ratectrl.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,250 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP9_ENCODER_VP9_RATECTRL_H_ -#define VP9_ENCODER_VP9_RATECTRL_H_ - -#include "vpx/vpx_codec.h" -#include "vpx/vpx_integer.h" - -#include "vp9/common/vp9_blockd.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// Bits Per MB at different Q (Multiplied by 512) -#define BPER_MB_NORMBITS 9 - -typedef enum { - INTER_NORMAL = 0, - INTER_HIGH = 1, - GF_ARF_LOW = 2, - GF_ARF_STD = 3, - KF_STD = 4, - RATE_FACTOR_LEVELS = 5 -} RATE_FACTOR_LEVEL; - -// Internal frame scaling level. -typedef enum { - UNSCALED = 0, // Frame is unscaled. - SCALE_STEP1 = 1, // First-level down-scaling. - FRAME_SCALE_STEPS -} FRAME_SCALE_LEVEL; - -// Frame dimensions multiplier wrt the native frame size, in 1/16ths, -// specified for the scale-up case. -// e.g. 24 => 16/24 = 2/3 of native size. The restriction to 1/16th is -// intended to match the capabilities of the normative scaling filters, -// giving precedence to the up-scaling accuracy. -static const int frame_scale_factor[FRAME_SCALE_STEPS] = {16, 24}; - -// Multiplier of the target rate to be used as threshold for triggering scaling. -static const double rate_thresh_mult[FRAME_SCALE_STEPS] = {1.0, 2.0}; - -// Scale dependent Rate Correction Factor multipliers. Compensates for the -// greater number of bits per pixel generated in down-scaled frames. -static const double rcf_mult[FRAME_SCALE_STEPS] = {1.0, 2.0}; - -typedef struct { - // Rate targetting variables - int base_frame_target; // A baseline frame target before adjustment - // for previous under or over shoot. - int this_frame_target; // Actual frame target after rc adjustment. - int projected_frame_size; - int sb64_target_rate; - int last_q[FRAME_TYPES]; // Separate values for Intra/Inter - int last_boosted_qindex; // Last boosted GF/KF/ARF q - int last_kf_qindex; // Q index of the last key frame coded. - - int gfu_boost; - int last_boost; - int kf_boost; - - double rate_correction_factors[RATE_FACTOR_LEVELS]; - - int frames_since_golden; - int frames_till_gf_update_due; - int max_gf_interval; - int static_scene_max_gf_interval; - int baseline_gf_interval; - int constrained_gf_group; - int frames_to_key; - int frames_since_key; - int this_key_frame_forced; - int next_key_frame_forced; - int source_alt_ref_pending; - int source_alt_ref_active; - int is_src_frame_alt_ref; - - int avg_frame_bandwidth; // Average frame size target for clip - int min_frame_bandwidth; // Minimum allocation used for any frame - int max_frame_bandwidth; // Maximum burst rate allowed for a frame. - - int ni_av_qi; - int ni_tot_qi; - int ni_frames; - int avg_frame_qindex[FRAME_TYPES]; - double tot_q; - double avg_q; - - int64_t buffer_level; - int64_t bits_off_target; - int64_t vbr_bits_off_target; - - int decimation_factor; - int decimation_count; - - int rolling_target_bits; - int rolling_actual_bits; - - int long_rolling_target_bits; - int long_rolling_actual_bits; - - int rate_error_estimate; - - int64_t total_actual_bits; - int64_t total_target_bits; - int64_t total_target_vs_actual; - - int worst_quality; - int best_quality; - - int64_t starting_buffer_level; - int64_t optimal_buffer_level; - int64_t maximum_buffer_size; - - // rate control history for last frame(1) and the frame before(2). - // -1: undershot - // 1: overshoot - // 0: not initialized. - int rc_1_frame; - int rc_2_frame; - int q_1_frame; - int q_2_frame; - - // Auto frame-scaling variables. - FRAME_SCALE_LEVEL frame_size_selector; - FRAME_SCALE_LEVEL next_frame_size_selector; - int frame_width[FRAME_SCALE_STEPS]; - int frame_height[FRAME_SCALE_STEPS]; - int rf_level_maxq[RATE_FACTOR_LEVELS]; -} RATE_CONTROL; - -struct VP9_COMP; -struct VP9EncoderConfig; - -void vp9_rc_init(const struct VP9EncoderConfig *oxcf, int pass, - RATE_CONTROL *rc); - -int vp9_estimate_bits_at_q(FRAME_TYPE frame_kind, int q, int mbs, - double correction_factor, - vpx_bit_depth_t bit_depth); - -double vp9_convert_qindex_to_q(int qindex, vpx_bit_depth_t bit_depth); - -void vp9_rc_init_minq_luts(); - -// Generally at the high level, the following flow is expected -// to be enforced for rate control: -// First call per frame, one of: -// vp9_rc_get_one_pass_vbr_params() -// vp9_rc_get_one_pass_cbr_params() -// vp9_rc_get_svc_params() -// vp9_rc_get_first_pass_params() -// vp9_rc_get_second_pass_params() -// depending on the usage to set the rate control encode parameters desired. -// -// Then, call encode_frame_to_data_rate() to perform the -// actual encode. This function will in turn call encode_frame() -// one or more times, followed by one of: -// vp9_rc_postencode_update() -// vp9_rc_postencode_update_drop_frame() -// -// The majority of rate control parameters are only expected -// to be set in the vp9_rc_get_..._params() functions and -// updated during the vp9_rc_postencode_update...() functions. -// The only exceptions are vp9_rc_drop_frame() and -// vp9_rc_update_rate_correction_factors() functions. - -// Functions to set parameters for encoding before the actual -// encode_frame_to_data_rate() function. -void vp9_rc_get_one_pass_vbr_params(struct VP9_COMP *cpi); -void vp9_rc_get_one_pass_cbr_params(struct VP9_COMP *cpi); -void vp9_rc_get_svc_params(struct VP9_COMP *cpi); - -// Post encode update of the rate control parameters based -// on bytes used -void vp9_rc_postencode_update(struct VP9_COMP *cpi, uint64_t bytes_used); -// Post encode update of the rate control parameters for dropped frames -void vp9_rc_postencode_update_drop_frame(struct VP9_COMP *cpi); - -// Updates rate correction factors -// Changes only the rate correction factors in the rate control structure. -void vp9_rc_update_rate_correction_factors(struct VP9_COMP *cpi); - -// Decide if we should drop this frame: For 1-pass CBR. -// Changes only the decimation count in the rate control structure -int vp9_rc_drop_frame(struct VP9_COMP *cpi); - -// Computes frame size bounds. -void vp9_rc_compute_frame_size_bounds(const struct VP9_COMP *cpi, - int this_frame_target, - int *frame_under_shoot_limit, - int *frame_over_shoot_limit); - -// Picks q and q bounds given the target for bits -int vp9_rc_pick_q_and_bounds(const struct VP9_COMP *cpi, - int *bottom_index, - int *top_index); - -// Estimates q to achieve a target bits per frame -int vp9_rc_regulate_q(const struct VP9_COMP *cpi, int target_bits_per_frame, - int active_best_quality, int active_worst_quality); - -// Estimates bits per mb for a given qindex and correction factor. -int vp9_rc_bits_per_mb(FRAME_TYPE frame_type, int qindex, - double correction_factor, vpx_bit_depth_t bit_depth); - -// Clamping utilities for bitrate targets for iframes and pframes. -int vp9_rc_clamp_iframe_target_size(const struct VP9_COMP *const cpi, - int target); -int vp9_rc_clamp_pframe_target_size(const struct VP9_COMP *const cpi, - int target); -// Utility to set frame_target into the RATE_CONTROL structure -// This function is called only from the vp9_rc_get_..._params() functions. -void vp9_rc_set_frame_target(struct VP9_COMP *cpi, int target); - -// Computes a q delta (in "q index" terms) to get from a starting q value -// to a target q value -int vp9_compute_qdelta(const RATE_CONTROL *rc, double qstart, double qtarget, - vpx_bit_depth_t bit_depth); - -// Computes a q delta (in "q index" terms) to get from a starting q value -// to a value that should equate to the given rate ratio. -int vp9_compute_qdelta_by_rate(const RATE_CONTROL *rc, FRAME_TYPE frame_type, - int qindex, double rate_target_ratio, - vpx_bit_depth_t bit_depth); - -int vp9_frame_type_qdelta(const struct VP9_COMP *cpi, int rf_level, int q); - -void vp9_rc_update_framerate(struct VP9_COMP *cpi); - -void vp9_rc_set_gf_max_interval(const struct VP9_COMP *const cpi, - RATE_CONTROL *const rc); - -void vp9_set_target_rate(struct VP9_COMP *cpi); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_RATECTRL_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_rd.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_rd.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_rd.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_rd.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,659 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include - -#include "./vp9_rtcd.h" - -#include "vpx_mem/vpx_mem.h" - -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_entropy.h" -#include "vp9/common/vp9_entropymode.h" -#include "vp9/common/vp9_mvref_common.h" -#include "vp9/common/vp9_pred_common.h" -#include "vp9/common/vp9_quant_common.h" -#include "vp9/common/vp9_reconinter.h" -#include "vp9/common/vp9_reconintra.h" -#include "vp9/common/vp9_seg_common.h" -#include "vp9/common/vp9_systemdependent.h" - -#include "vp9/encoder/vp9_cost.h" -#include "vp9/encoder/vp9_encodemb.h" -#include "vp9/encoder/vp9_encodemv.h" -#include "vp9/encoder/vp9_encoder.h" -#include "vp9/encoder/vp9_mcomp.h" -#include "vp9/encoder/vp9_quantize.h" -#include "vp9/encoder/vp9_ratectrl.h" -#include "vp9/encoder/vp9_rd.h" -#include "vp9/encoder/vp9_tokenize.h" -#include "vp9/encoder/vp9_variance.h" - -#define RD_THRESH_POW 1.25 -#define RD_MULT_EPB_RATIO 64 - -// Factor to weigh the rate for switchable interp filters. -#define SWITCHABLE_INTERP_RATE_FACTOR 1 - -void vp9_rd_cost_reset(RD_COST *rd_cost) { - rd_cost->rate = INT_MAX; - rd_cost->dist = INT64_MAX; - rd_cost->rdcost = INT64_MAX; -} - -void vp9_rd_cost_init(RD_COST *rd_cost) { - rd_cost->rate = 0; - rd_cost->dist = 0; - rd_cost->rdcost = 0; -} - -// The baseline rd thresholds for breaking out of the rd loop for -// certain modes are assumed to be based on 8x8 blocks. -// This table is used to correct for block size. -// The factors here are << 2 (2 = x0.5, 32 = x8 etc). -static const uint8_t rd_thresh_block_size_factor[BLOCK_SIZES] = { - 2, 3, 3, 4, 6, 6, 8, 12, 12, 16, 24, 24, 32 -}; - -static void fill_mode_costs(VP9_COMP *cpi) { - const FRAME_CONTEXT *const fc = cpi->common.fc; - int i, j; - - for (i = 0; i < INTRA_MODES; ++i) - for (j = 0; j < INTRA_MODES; ++j) - vp9_cost_tokens(cpi->y_mode_costs[i][j], vp9_kf_y_mode_prob[i][j], - vp9_intra_mode_tree); - - vp9_cost_tokens(cpi->mbmode_cost, fc->y_mode_prob[1], vp9_intra_mode_tree); - vp9_cost_tokens(cpi->intra_uv_mode_cost[KEY_FRAME], - vp9_kf_uv_mode_prob[TM_PRED], vp9_intra_mode_tree); - vp9_cost_tokens(cpi->intra_uv_mode_cost[INTER_FRAME], - fc->uv_mode_prob[TM_PRED], vp9_intra_mode_tree); - - for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i) - vp9_cost_tokens(cpi->switchable_interp_costs[i], - fc->switchable_interp_prob[i], vp9_switchable_interp_tree); -} - -static void fill_token_costs(vp9_coeff_cost *c, - vp9_coeff_probs_model (*p)[PLANE_TYPES]) { - int i, j, k, l; - TX_SIZE t; - for (t = TX_4X4; t <= TX_32X32; ++t) - for (i = 0; i < PLANE_TYPES; ++i) - for (j = 0; j < REF_TYPES; ++j) - for (k = 0; k < COEF_BANDS; ++k) - for (l = 0; l < BAND_COEFF_CONTEXTS(k); ++l) { - vp9_prob probs[ENTROPY_NODES]; - vp9_model_to_full_probs(p[t][i][j][k][l], probs); - vp9_cost_tokens((int *)c[t][i][j][k][0][l], probs, - vp9_coef_tree); - vp9_cost_tokens_skip((int *)c[t][i][j][k][1][l], probs, - vp9_coef_tree); - assert(c[t][i][j][k][0][l][EOB_TOKEN] == - c[t][i][j][k][1][l][EOB_TOKEN]); - } -} - -// Values are now correlated to quantizer. -static int sad_per_bit16lut_8[QINDEX_RANGE]; -static int sad_per_bit4lut_8[QINDEX_RANGE]; - -#if CONFIG_VP9_HIGHBITDEPTH -static int sad_per_bit16lut_10[QINDEX_RANGE]; -static int sad_per_bit4lut_10[QINDEX_RANGE]; -static int sad_per_bit16lut_12[QINDEX_RANGE]; -static int sad_per_bit4lut_12[QINDEX_RANGE]; -#endif - -static void init_me_luts_bd(int *bit16lut, int *bit4lut, int range, - vpx_bit_depth_t bit_depth) { - int i; - // Initialize the sad lut tables using a formulaic calculation for now. - // This is to make it easier to resolve the impact of experimental changes - // to the quantizer tables. - for (i = 0; i < range; i++) { - const double q = vp9_convert_qindex_to_q(i, bit_depth); - bit16lut[i] = (int)(0.0418 * q + 2.4107); - bit4lut[i] = (int)(0.063 * q + 2.742); - } -} - -void vp9_init_me_luts() { - init_me_luts_bd(sad_per_bit16lut_8, sad_per_bit4lut_8, QINDEX_RANGE, - VPX_BITS_8); -#if CONFIG_VP9_HIGHBITDEPTH - init_me_luts_bd(sad_per_bit16lut_10, sad_per_bit4lut_10, QINDEX_RANGE, - VPX_BITS_10); - init_me_luts_bd(sad_per_bit16lut_12, sad_per_bit4lut_12, QINDEX_RANGE, - VPX_BITS_12); -#endif -} - -static const int rd_boost_factor[16] = { - 64, 32, 32, 32, 24, 16, 12, 12, - 8, 8, 4, 4, 2, 2, 1, 0 -}; -static const int rd_frame_type_factor[FRAME_UPDATE_TYPES] = { - 128, 144, 128, 128, 144 -}; - -int vp9_compute_rd_mult(const VP9_COMP *cpi, int qindex) { - const int64_t q = vp9_dc_quant(qindex, 0, cpi->common.bit_depth); -#if CONFIG_VP9_HIGHBITDEPTH - int64_t rdmult = 0; - switch (cpi->common.bit_depth) { - case VPX_BITS_8: - rdmult = 88 * q * q / 24; - break; - case VPX_BITS_10: - rdmult = ROUND_POWER_OF_TWO(88 * q * q / 24, 4); - break; - case VPX_BITS_12: - rdmult = ROUND_POWER_OF_TWO(88 * q * q / 24, 8); - break; - default: - assert(0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10 or VPX_BITS_12"); - return -1; - } -#else - int64_t rdmult = 88 * q * q / 24; -#endif // CONFIG_VP9_HIGHBITDEPTH - if (cpi->oxcf.pass == 2 && (cpi->common.frame_type != KEY_FRAME)) { - const GF_GROUP *const gf_group = &cpi->twopass.gf_group; - const FRAME_UPDATE_TYPE frame_type = gf_group->update_type[gf_group->index]; - const int boost_index = MIN(15, (cpi->rc.gfu_boost / 100)); - - rdmult = (rdmult * rd_frame_type_factor[frame_type]) >> 7; - rdmult += ((rdmult * rd_boost_factor[boost_index]) >> 7); - } - return (int)rdmult; -} - -static int compute_rd_thresh_factor(int qindex, vpx_bit_depth_t bit_depth) { - double q; -#if CONFIG_VP9_HIGHBITDEPTH - switch (bit_depth) { - case VPX_BITS_8: - q = vp9_dc_quant(qindex, 0, VPX_BITS_8) / 4.0; - break; - case VPX_BITS_10: - q = vp9_dc_quant(qindex, 0, VPX_BITS_10) / 16.0; - break; - case VPX_BITS_12: - q = vp9_dc_quant(qindex, 0, VPX_BITS_12) / 64.0; - break; - default: - assert(0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10 or VPX_BITS_12"); - return -1; - } -#else - (void) bit_depth; - q = vp9_dc_quant(qindex, 0, VPX_BITS_8) / 4.0; -#endif // CONFIG_VP9_HIGHBITDEPTH - // TODO(debargha): Adjust the function below. - return MAX((int)(pow(q, RD_THRESH_POW) * 5.12), 8); -} - -void vp9_initialize_me_consts(VP9_COMP *cpi, MACROBLOCK *x, int qindex) { -#if CONFIG_VP9_HIGHBITDEPTH - switch (cpi->common.bit_depth) { - case VPX_BITS_8: - x->sadperbit16 = sad_per_bit16lut_8[qindex]; - x->sadperbit4 = sad_per_bit4lut_8[qindex]; - break; - case VPX_BITS_10: - x->sadperbit16 = sad_per_bit16lut_10[qindex]; - x->sadperbit4 = sad_per_bit4lut_10[qindex]; - break; - case VPX_BITS_12: - x->sadperbit16 = sad_per_bit16lut_12[qindex]; - x->sadperbit4 = sad_per_bit4lut_12[qindex]; - break; - default: - assert(0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10 or VPX_BITS_12"); - } -#else - (void)cpi; - x->sadperbit16 = sad_per_bit16lut_8[qindex]; - x->sadperbit4 = sad_per_bit4lut_8[qindex]; -#endif // CONFIG_VP9_HIGHBITDEPTH -} - -static void set_block_thresholds(const VP9_COMMON *cm, RD_OPT *rd) { - int i, bsize, segment_id; - - for (segment_id = 0; segment_id < MAX_SEGMENTS; ++segment_id) { - const int qindex = - clamp(vp9_get_qindex(&cm->seg, segment_id, cm->base_qindex) + - cm->y_dc_delta_q, 0, MAXQ); - const int q = compute_rd_thresh_factor(qindex, cm->bit_depth); - - for (bsize = 0; bsize < BLOCK_SIZES; ++bsize) { - // Threshold here seems unnecessarily harsh but fine given actual - // range of values used for cpi->sf.thresh_mult[]. - const int t = q * rd_thresh_block_size_factor[bsize]; - const int thresh_max = INT_MAX / t; - - if (bsize >= BLOCK_8X8) { - for (i = 0; i < MAX_MODES; ++i) - rd->threshes[segment_id][bsize][i] = - rd->thresh_mult[i] < thresh_max - ? rd->thresh_mult[i] * t / 4 - : INT_MAX; - } else { - for (i = 0; i < MAX_REFS; ++i) - rd->threshes[segment_id][bsize][i] = - rd->thresh_mult_sub8x8[i] < thresh_max - ? rd->thresh_mult_sub8x8[i] * t / 4 - : INT_MAX; - } - } - } -} - -void vp9_initialize_rd_consts(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - MACROBLOCK *const x = &cpi->td.mb; - RD_OPT *const rd = &cpi->rd; - int i; - - vp9_clear_system_state(); - - rd->RDDIV = RDDIV_BITS; // In bits (to multiply D by 128). - rd->RDMULT = vp9_compute_rd_mult(cpi, cm->base_qindex + cm->y_dc_delta_q); - - x->errorperbit = rd->RDMULT / RD_MULT_EPB_RATIO; - x->errorperbit += (x->errorperbit == 0); - - x->select_tx_size = (cpi->sf.tx_size_search_method == USE_LARGESTALL && - cm->frame_type != KEY_FRAME) ? 0 : 1; - - set_block_thresholds(cm, rd); - - if (!cpi->sf.use_nonrd_pick_mode || cm->frame_type == KEY_FRAME) - fill_token_costs(x->token_costs, cm->fc->coef_probs); - - if (cpi->sf.partition_search_type != VAR_BASED_PARTITION || - cm->frame_type == KEY_FRAME) { - for (i = 0; i < PARTITION_CONTEXTS; ++i) - vp9_cost_tokens(cpi->partition_cost[i], get_partition_probs(cm, i), - vp9_partition_tree); - } - - if (!cpi->sf.use_nonrd_pick_mode || (cm->current_video_frame & 0x07) == 1 || - cm->frame_type == KEY_FRAME) { - fill_mode_costs(cpi); - - if (!frame_is_intra_only(cm)) { - vp9_build_nmv_cost_table(x->nmvjointcost, - cm->allow_high_precision_mv ? x->nmvcost_hp - : x->nmvcost, - &cm->fc->nmvc, cm->allow_high_precision_mv); - - for (i = 0; i < INTER_MODE_CONTEXTS; ++i) - vp9_cost_tokens((int *)cpi->inter_mode_cost[i], - cm->fc->inter_mode_probs[i], vp9_inter_mode_tree); - } - } -} - -static void model_rd_norm(int xsq_q10, int *r_q10, int *d_q10) { - // NOTE: The tables below must be of the same size. - - // The functions described below are sampled at the four most significant - // bits of x^2 + 8 / 256. - - // Normalized rate: - // This table models the rate for a Laplacian source with given variance - // when quantized with a uniform quantizer with given stepsize. The - // closed form expression is: - // Rn(x) = H(sqrt(r)) + sqrt(r)*[1 + H(r)/(1 - r)], - // where r = exp(-sqrt(2) * x) and x = qpstep / sqrt(variance), - // and H(x) is the binary entropy function. - static const int rate_tab_q10[] = { - 65536, 6086, 5574, 5275, 5063, 4899, 4764, 4651, - 4553, 4389, 4255, 4142, 4044, 3958, 3881, 3811, - 3748, 3635, 3538, 3453, 3376, 3307, 3244, 3186, - 3133, 3037, 2952, 2877, 2809, 2747, 2690, 2638, - 2589, 2501, 2423, 2353, 2290, 2232, 2179, 2130, - 2084, 2001, 1928, 1862, 1802, 1748, 1698, 1651, - 1608, 1530, 1460, 1398, 1342, 1290, 1243, 1199, - 1159, 1086, 1021, 963, 911, 864, 821, 781, - 745, 680, 623, 574, 530, 490, 455, 424, - 395, 345, 304, 269, 239, 213, 190, 171, - 154, 126, 104, 87, 73, 61, 52, 44, - 38, 28, 21, 16, 12, 10, 8, 6, - 5, 3, 2, 1, 1, 1, 0, 0, - }; - // Normalized distortion: - // This table models the normalized distortion for a Laplacian source - // with given variance when quantized with a uniform quantizer - // with given stepsize. The closed form expression is: - // Dn(x) = 1 - 1/sqrt(2) * x / sinh(x/sqrt(2)) - // where x = qpstep / sqrt(variance). - // Note the actual distortion is Dn * variance. - static const int dist_tab_q10[] = { - 0, 0, 1, 1, 1, 2, 2, 2, - 3, 3, 4, 5, 5, 6, 7, 7, - 8, 9, 11, 12, 13, 15, 16, 17, - 18, 21, 24, 26, 29, 31, 34, 36, - 39, 44, 49, 54, 59, 64, 69, 73, - 78, 88, 97, 106, 115, 124, 133, 142, - 151, 167, 184, 200, 215, 231, 245, 260, - 274, 301, 327, 351, 375, 397, 418, 439, - 458, 495, 528, 559, 587, 613, 637, 659, - 680, 717, 749, 777, 801, 823, 842, 859, - 874, 899, 919, 936, 949, 960, 969, 977, - 983, 994, 1001, 1006, 1010, 1013, 1015, 1017, - 1018, 1020, 1022, 1022, 1023, 1023, 1023, 1024, - }; - static const int xsq_iq_q10[] = { - 0, 4, 8, 12, 16, 20, 24, 28, - 32, 40, 48, 56, 64, 72, 80, 88, - 96, 112, 128, 144, 160, 176, 192, 208, - 224, 256, 288, 320, 352, 384, 416, 448, - 480, 544, 608, 672, 736, 800, 864, 928, - 992, 1120, 1248, 1376, 1504, 1632, 1760, 1888, - 2016, 2272, 2528, 2784, 3040, 3296, 3552, 3808, - 4064, 4576, 5088, 5600, 6112, 6624, 7136, 7648, - 8160, 9184, 10208, 11232, 12256, 13280, 14304, 15328, - 16352, 18400, 20448, 22496, 24544, 26592, 28640, 30688, - 32736, 36832, 40928, 45024, 49120, 53216, 57312, 61408, - 65504, 73696, 81888, 90080, 98272, 106464, 114656, 122848, - 131040, 147424, 163808, 180192, 196576, 212960, 229344, 245728, - }; - const int tmp = (xsq_q10 >> 2) + 8; - const int k = get_msb(tmp) - 3; - const int xq = (k << 3) + ((tmp >> k) & 0x7); - const int one_q10 = 1 << 10; - const int a_q10 = ((xsq_q10 - xsq_iq_q10[xq]) << 10) >> (2 + k); - const int b_q10 = one_q10 - a_q10; - *r_q10 = (rate_tab_q10[xq] * b_q10 + rate_tab_q10[xq + 1] * a_q10) >> 10; - *d_q10 = (dist_tab_q10[xq] * b_q10 + dist_tab_q10[xq + 1] * a_q10) >> 10; -} - -void vp9_model_rd_from_var_lapndz(unsigned int var, unsigned int n_log2, - unsigned int qstep, int *rate, - int64_t *dist) { - // This function models the rate and distortion for a Laplacian - // source with given variance when quantized with a uniform quantizer - // with given stepsize. The closed form expressions are in: - // Hang and Chen, "Source Model for transform video coder and its - // application - Part I: Fundamental Theory", IEEE Trans. Circ. - // Sys. for Video Tech., April 1997. - if (var == 0) { - *rate = 0; - *dist = 0; - } else { - int d_q10, r_q10; - static const uint32_t MAX_XSQ_Q10 = 245727; - const uint64_t xsq_q10_64 = - (((uint64_t)qstep * qstep << (n_log2 + 10)) + (var >> 1)) / var; - const int xsq_q10 = (int)MIN(xsq_q10_64, MAX_XSQ_Q10); - model_rd_norm(xsq_q10, &r_q10, &d_q10); - *rate = ((r_q10 << n_log2) + 2) >> 2; - *dist = (var * (int64_t)d_q10 + 512) >> 10; - } -} - -void vp9_get_entropy_contexts(BLOCK_SIZE bsize, TX_SIZE tx_size, - const struct macroblockd_plane *pd, - ENTROPY_CONTEXT t_above[16], - ENTROPY_CONTEXT t_left[16]) { - const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd); - const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize]; - const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize]; - const ENTROPY_CONTEXT *const above = pd->above_context; - const ENTROPY_CONTEXT *const left = pd->left_context; - - int i; - switch (tx_size) { - case TX_4X4: - vpx_memcpy(t_above, above, sizeof(ENTROPY_CONTEXT) * num_4x4_w); - vpx_memcpy(t_left, left, sizeof(ENTROPY_CONTEXT) * num_4x4_h); - break; - case TX_8X8: - for (i = 0; i < num_4x4_w; i += 2) - t_above[i] = !!*(const uint16_t *)&above[i]; - for (i = 0; i < num_4x4_h; i += 2) - t_left[i] = !!*(const uint16_t *)&left[i]; - break; - case TX_16X16: - for (i = 0; i < num_4x4_w; i += 4) - t_above[i] = !!*(const uint32_t *)&above[i]; - for (i = 0; i < num_4x4_h; i += 4) - t_left[i] = !!*(const uint32_t *)&left[i]; - break; - case TX_32X32: - for (i = 0; i < num_4x4_w; i += 8) - t_above[i] = !!*(const uint64_t *)&above[i]; - for (i = 0; i < num_4x4_h; i += 8) - t_left[i] = !!*(const uint64_t *)&left[i]; - break; - default: - assert(0 && "Invalid transform size."); - break; - } -} - -void vp9_mv_pred(VP9_COMP *cpi, MACROBLOCK *x, - uint8_t *ref_y_buffer, int ref_y_stride, - int ref_frame, BLOCK_SIZE block_size) { - MACROBLOCKD *xd = &x->e_mbd; - MB_MODE_INFO *mbmi = &xd->mi[0].src_mi->mbmi; - int i; - int zero_seen = 0; - int best_index = 0; - int best_sad = INT_MAX; - int this_sad = INT_MAX; - int max_mv = 0; - uint8_t *src_y_ptr = x->plane[0].src.buf; - uint8_t *ref_y_ptr; - const int num_mv_refs = MAX_MV_REF_CANDIDATES + - (cpi->sf.adaptive_motion_search && - block_size < x->max_partition_size); - - MV pred_mv[3]; - pred_mv[0] = mbmi->ref_mvs[ref_frame][0].as_mv; - pred_mv[1] = mbmi->ref_mvs[ref_frame][1].as_mv; - pred_mv[2] = x->pred_mv[ref_frame]; - assert(num_mv_refs <= (int)(sizeof(pred_mv) / sizeof(pred_mv[0]))); - - // Get the sad for each candidate reference mv. - for (i = 0; i < num_mv_refs; ++i) { - const MV *this_mv = &pred_mv[i]; - - max_mv = MAX(max_mv, MAX(abs(this_mv->row), abs(this_mv->col)) >> 3); - if (is_zero_mv(this_mv) && zero_seen) - continue; - - zero_seen |= is_zero_mv(this_mv); - - ref_y_ptr = - &ref_y_buffer[ref_y_stride * (this_mv->row >> 3) + (this_mv->col >> 3)]; - - // Find sad for current vector. - this_sad = cpi->fn_ptr[block_size].sdf(src_y_ptr, x->plane[0].src.stride, - ref_y_ptr, ref_y_stride); - - // Note if it is the best so far. - if (this_sad < best_sad) { - best_sad = this_sad; - best_index = i; - } - } - - // Note the index of the mv that worked best in the reference list. - x->mv_best_ref_index[ref_frame] = best_index; - x->max_mv_context[ref_frame] = max_mv; - x->pred_mv_sad[ref_frame] = best_sad; -} - -void vp9_setup_pred_block(const MACROBLOCKD *xd, - struct buf_2d dst[MAX_MB_PLANE], - const YV12_BUFFER_CONFIG *src, - int mi_row, int mi_col, - const struct scale_factors *scale, - const struct scale_factors *scale_uv) { - int i; - - dst[0].buf = src->y_buffer; - dst[0].stride = src->y_stride; - dst[1].buf = src->u_buffer; - dst[2].buf = src->v_buffer; - dst[1].stride = dst[2].stride = src->uv_stride; - - for (i = 0; i < MAX_MB_PLANE; ++i) { - setup_pred_plane(dst + i, dst[i].buf, dst[i].stride, mi_row, mi_col, - i ? scale_uv : scale, - xd->plane[i].subsampling_x, xd->plane[i].subsampling_y); - } -} - -int vp9_raster_block_offset(BLOCK_SIZE plane_bsize, - int raster_block, int stride) { - const int bw = b_width_log2_lookup[plane_bsize]; - const int y = 4 * (raster_block >> bw); - const int x = 4 * (raster_block & ((1 << bw) - 1)); - return y * stride + x; -} - -int16_t* vp9_raster_block_offset_int16(BLOCK_SIZE plane_bsize, - int raster_block, int16_t *base) { - const int stride = 4 * num_4x4_blocks_wide_lookup[plane_bsize]; - return base + vp9_raster_block_offset(plane_bsize, raster_block, stride); -} - -YV12_BUFFER_CONFIG *vp9_get_scaled_ref_frame(const VP9_COMP *cpi, - int ref_frame) { - const VP9_COMMON *const cm = &cpi->common; - const int scaled_idx = cpi->scaled_ref_idx[ref_frame - 1]; - const int ref_idx = get_ref_frame_buf_idx(cpi, ref_frame); - return - (scaled_idx != ref_idx && scaled_idx != INVALID_IDX) ? - &cm->buffer_pool->frame_bufs[scaled_idx].buf : NULL; -} - -int vp9_get_switchable_rate(const VP9_COMP *cpi, const MACROBLOCKD *const xd) { - const MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi; - const int ctx = vp9_get_pred_context_switchable_interp(xd); - return SWITCHABLE_INTERP_RATE_FACTOR * - cpi->switchable_interp_costs[ctx][mbmi->interp_filter]; -} - -void vp9_set_rd_speed_thresholds(VP9_COMP *cpi) { - int i; - RD_OPT *const rd = &cpi->rd; - SPEED_FEATURES *const sf = &cpi->sf; - - // Set baseline threshold values. - for (i = 0; i < MAX_MODES; ++i) - rd->thresh_mult[i] = cpi->oxcf.mode == BEST ? -500 : 0; - - if (sf->adaptive_rd_thresh) { - rd->thresh_mult[THR_NEARESTMV] = 300; - rd->thresh_mult[THR_NEARESTG] = 300; - rd->thresh_mult[THR_NEARESTA] = 300; - } else { - rd->thresh_mult[THR_NEARESTMV] = 0; - rd->thresh_mult[THR_NEARESTG] = 0; - rd->thresh_mult[THR_NEARESTA] = 0; - } - - rd->thresh_mult[THR_DC] += 1000; - - rd->thresh_mult[THR_NEWMV] += 1000; - rd->thresh_mult[THR_NEWA] += 1000; - rd->thresh_mult[THR_NEWG] += 1000; - - rd->thresh_mult[THR_NEARMV] += 1000; - rd->thresh_mult[THR_NEARA] += 1000; - rd->thresh_mult[THR_COMP_NEARESTLA] += 1000; - rd->thresh_mult[THR_COMP_NEARESTGA] += 1000; - - rd->thresh_mult[THR_TM] += 1000; - - rd->thresh_mult[THR_COMP_NEARLA] += 1500; - rd->thresh_mult[THR_COMP_NEWLA] += 2000; - rd->thresh_mult[THR_NEARG] += 1000; - rd->thresh_mult[THR_COMP_NEARGA] += 1500; - rd->thresh_mult[THR_COMP_NEWGA] += 2000; - - rd->thresh_mult[THR_ZEROMV] += 2000; - rd->thresh_mult[THR_ZEROG] += 2000; - rd->thresh_mult[THR_ZEROA] += 2000; - rd->thresh_mult[THR_COMP_ZEROLA] += 2500; - rd->thresh_mult[THR_COMP_ZEROGA] += 2500; - - rd->thresh_mult[THR_H_PRED] += 2000; - rd->thresh_mult[THR_V_PRED] += 2000; - rd->thresh_mult[THR_D45_PRED ] += 2500; - rd->thresh_mult[THR_D135_PRED] += 2500; - rd->thresh_mult[THR_D117_PRED] += 2500; - rd->thresh_mult[THR_D153_PRED] += 2500; - rd->thresh_mult[THR_D207_PRED] += 2500; - rd->thresh_mult[THR_D63_PRED] += 2500; -} - -void vp9_set_rd_speed_thresholds_sub8x8(VP9_COMP *cpi) { - static const int thresh_mult[2][MAX_REFS] = - {{2500, 2500, 2500, 4500, 4500, 2500}, - {2000, 2000, 2000, 4000, 4000, 2000}}; - RD_OPT *const rd = &cpi->rd; - const int idx = cpi->oxcf.mode == BEST; - vpx_memcpy(rd->thresh_mult_sub8x8, thresh_mult[idx], - sizeof(thresh_mult[idx])); -} - -void vp9_update_rd_thresh_fact(int (*factor_buf)[MAX_MODES], int rd_thresh, - int bsize, int best_mode_index) { - if (rd_thresh > 0) { - const int top_mode = bsize < BLOCK_8X8 ? MAX_REFS : MAX_MODES; - int mode; - for (mode = 0; mode < top_mode; ++mode) { - const BLOCK_SIZE min_size = MAX(bsize - 1, BLOCK_4X4); - const BLOCK_SIZE max_size = MIN(bsize + 2, BLOCK_64X64); - BLOCK_SIZE bs; - for (bs = min_size; bs <= max_size; ++bs) { - int *const fact = &factor_buf[bs][mode]; - if (mode == best_mode_index) { - *fact -= (*fact >> 4); - } else { - *fact = MIN(*fact + RD_THRESH_INC, - rd_thresh * RD_THRESH_MAX_FACT); - } - } - } - } -} - -int vp9_get_intra_cost_penalty(int qindex, int qdelta, - vpx_bit_depth_t bit_depth) { - const int q = vp9_dc_quant(qindex, qdelta, bit_depth); -#if CONFIG_VP9_HIGHBITDEPTH - switch (bit_depth) { - case VPX_BITS_8: - return 20 * q; - case VPX_BITS_10: - return 5 * q; - case VPX_BITS_12: - return ROUND_POWER_OF_TWO(5 * q, 2); - default: - assert(0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10 or VPX_BITS_12"); - return -1; - } -#else - return 20 * q; -#endif // CONFIG_VP9_HIGHBITDEPTH -} - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_rd.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_rd.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_rd.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_rd.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_RD_H_ -#define VP9_ENCODER_VP9_RD_H_ - -#include - -#include "vp9/common/vp9_blockd.h" - -#include "vp9/encoder/vp9_block.h" -#include "vp9/encoder/vp9_context_tree.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define RDDIV_BITS 7 - -#define RDCOST(RM, DM, R, D) \ - (((128 + ((int64_t)R) * (RM)) >> 8) + (D << DM)) -#define QIDX_SKIP_THRESH 115 - -#define MV_COST_WEIGHT 108 -#define MV_COST_WEIGHT_SUB 120 - -#define INVALID_MV 0x80008000 - -#define MAX_MODES 30 -#define MAX_REFS 6 - -#define RD_THRESH_MAX_FACT 64 -#define RD_THRESH_INC 1 - -// This enumerator type needs to be kept aligned with the mode order in -// const MODE_DEFINITION vp9_mode_order[MAX_MODES] used in the rd code. -typedef enum { - THR_NEARESTMV, - THR_NEARESTA, - THR_NEARESTG, - - THR_DC, - - THR_NEWMV, - THR_NEWA, - THR_NEWG, - - THR_NEARMV, - THR_NEARA, - THR_NEARG, - - THR_ZEROMV, - THR_ZEROG, - THR_ZEROA, - - THR_COMP_NEARESTLA, - THR_COMP_NEARESTGA, - - THR_TM, - - THR_COMP_NEARLA, - THR_COMP_NEWLA, - THR_COMP_NEARGA, - THR_COMP_NEWGA, - - THR_COMP_ZEROLA, - THR_COMP_ZEROGA, - - THR_H_PRED, - THR_V_PRED, - THR_D135_PRED, - THR_D207_PRED, - THR_D153_PRED, - THR_D63_PRED, - THR_D117_PRED, - THR_D45_PRED, -} THR_MODES; - -typedef enum { - THR_LAST, - THR_GOLD, - THR_ALTR, - THR_COMP_LA, - THR_COMP_GA, - THR_INTRA, -} THR_MODES_SUB8X8; - -typedef struct RD_OPT { - // Thresh_mult is used to set a threshold for the rd score. A higher value - // means that we will accept the best mode so far more often. This number - // is used in combination with the current block size, and thresh_freq_fact - // to pick a threshold. - int thresh_mult[MAX_MODES]; - int thresh_mult_sub8x8[MAX_REFS]; - - int threshes[MAX_SEGMENTS][BLOCK_SIZES][MAX_MODES]; - - int64_t prediction_type_threshes[MAX_REF_FRAMES][REFERENCE_MODES]; - // TODO(agrange): can this overflow? - int tx_select_threshes[MAX_REF_FRAMES][TX_MODES]; - - int64_t filter_threshes[MAX_REF_FRAMES][SWITCHABLE_FILTER_CONTEXTS]; - - int RDMULT; - int RDDIV; -} RD_OPT; - -typedef struct RD_COST { - int rate; - int64_t dist; - int64_t rdcost; -} RD_COST; - -// Reset the rate distortion cost values to maximum (invalid) value. -void vp9_rd_cost_reset(RD_COST *rd_cost); -// Initialize the rate distortion cost values to zero. -void vp9_rd_cost_init(RD_COST *rd_cost); - -struct TileInfo; -struct TileDataEnc; -struct VP9_COMP; -struct macroblock; - -int vp9_compute_rd_mult(const struct VP9_COMP *cpi, int qindex); - -void vp9_initialize_rd_consts(struct VP9_COMP *cpi); - -void vp9_initialize_me_consts(struct VP9_COMP *cpi, MACROBLOCK *x, int qindex); - -void vp9_model_rd_from_var_lapndz(unsigned int var, unsigned int n, - unsigned int qstep, int *rate, - int64_t *dist); - -int vp9_get_switchable_rate(const struct VP9_COMP *cpi, - const MACROBLOCKD *const xd); - -int vp9_raster_block_offset(BLOCK_SIZE plane_bsize, - int raster_block, int stride); - -int16_t* vp9_raster_block_offset_int16(BLOCK_SIZE plane_bsize, - int raster_block, int16_t *base); - -YV12_BUFFER_CONFIG *vp9_get_scaled_ref_frame(const struct VP9_COMP *cpi, - int ref_frame); - -void vp9_init_me_luts(); - -void vp9_get_entropy_contexts(BLOCK_SIZE bsize, TX_SIZE tx_size, - const struct macroblockd_plane *pd, - ENTROPY_CONTEXT t_above[16], - ENTROPY_CONTEXT t_left[16]); - -void vp9_set_rd_speed_thresholds(struct VP9_COMP *cpi); - -void vp9_set_rd_speed_thresholds_sub8x8(struct VP9_COMP *cpi); - -void vp9_update_rd_thresh_fact(int (*fact)[MAX_MODES], int rd_thresh, - int bsize, int best_mode_index); - -static INLINE int rd_less_than_thresh(int64_t best_rd, int thresh, - int thresh_fact) { - return best_rd < ((int64_t)thresh * thresh_fact >> 5) || thresh == INT_MAX; -} - -void vp9_mv_pred(struct VP9_COMP *cpi, MACROBLOCK *x, - uint8_t *ref_y_buffer, int ref_y_stride, - int ref_frame, BLOCK_SIZE block_size); - -void vp9_setup_pred_block(const MACROBLOCKD *xd, - struct buf_2d dst[MAX_MB_PLANE], - const YV12_BUFFER_CONFIG *src, - int mi_row, int mi_col, - const struct scale_factors *scale, - const struct scale_factors *scale_uv); - -int vp9_get_intra_cost_penalty(int qindex, int qdelta, - vpx_bit_depth_t bit_depth); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_RD_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_rdopt.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_rdopt.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_rdopt.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_rdopt.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,4250 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vp9_rtcd.h" - -#include "vpx_mem/vpx_mem.h" - -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_entropy.h" -#include "vp9/common/vp9_entropymode.h" -#include "vp9/common/vp9_idct.h" -#include "vp9/common/vp9_mvref_common.h" -#include "vp9/common/vp9_pred_common.h" -#include "vp9/common/vp9_quant_common.h" -#include "vp9/common/vp9_reconinter.h" -#include "vp9/common/vp9_reconintra.h" -#include "vp9/common/vp9_seg_common.h" -#include "vp9/common/vp9_systemdependent.h" - -#include "vp9/encoder/vp9_cost.h" -#include "vp9/encoder/vp9_encodemb.h" -#include "vp9/encoder/vp9_encodemv.h" -#include "vp9/encoder/vp9_encoder.h" -#include "vp9/encoder/vp9_mcomp.h" -#include "vp9/encoder/vp9_quantize.h" -#include "vp9/encoder/vp9_ratectrl.h" -#include "vp9/encoder/vp9_rd.h" -#include "vp9/encoder/vp9_rdopt.h" -#include "vp9/encoder/vp9_variance.h" -#include "vp9/encoder/vp9_aq_variance.h" - -#define LAST_FRAME_MODE_MASK ((1 << GOLDEN_FRAME) | (1 << ALTREF_FRAME) | \ - (1 << INTRA_FRAME)) -#define GOLDEN_FRAME_MODE_MASK ((1 << LAST_FRAME) | (1 << ALTREF_FRAME) | \ - (1 << INTRA_FRAME)) -#define ALT_REF_MODE_MASK ((1 << LAST_FRAME) | (1 << GOLDEN_FRAME) | \ - (1 << INTRA_FRAME)) - -#define SECOND_REF_FRAME_MASK ((1 << ALTREF_FRAME) | 0x01) - -#define MIN_EARLY_TERM_INDEX 3 -#define NEW_MV_DISCOUNT_FACTOR 8 - -typedef struct { - PREDICTION_MODE mode; - MV_REFERENCE_FRAME ref_frame[2]; -} MODE_DEFINITION; - -typedef struct { - MV_REFERENCE_FRAME ref_frame[2]; -} REF_DEFINITION; - -struct rdcost_block_args { - MACROBLOCK *x; - ENTROPY_CONTEXT t_above[16]; - ENTROPY_CONTEXT t_left[16]; - int rate; - int64_t dist; - int64_t sse; - int this_rate; - int64_t this_dist; - int64_t this_sse; - int64_t this_rd; - int64_t best_rd; - int skip; - int use_fast_coef_costing; - const scan_order *so; -}; - -#define LAST_NEW_MV_INDEX 6 -static const MODE_DEFINITION vp9_mode_order[MAX_MODES] = { - {NEARESTMV, {LAST_FRAME, NONE}}, - {NEARESTMV, {ALTREF_FRAME, NONE}}, - {NEARESTMV, {GOLDEN_FRAME, NONE}}, - - {DC_PRED, {INTRA_FRAME, NONE}}, - - {NEWMV, {LAST_FRAME, NONE}}, - {NEWMV, {ALTREF_FRAME, NONE}}, - {NEWMV, {GOLDEN_FRAME, NONE}}, - - {NEARMV, {LAST_FRAME, NONE}}, - {NEARMV, {ALTREF_FRAME, NONE}}, - {NEARMV, {GOLDEN_FRAME, NONE}}, - - {ZEROMV, {LAST_FRAME, NONE}}, - {ZEROMV, {GOLDEN_FRAME, NONE}}, - {ZEROMV, {ALTREF_FRAME, NONE}}, - - {NEARESTMV, {LAST_FRAME, ALTREF_FRAME}}, - {NEARESTMV, {GOLDEN_FRAME, ALTREF_FRAME}}, - - {TM_PRED, {INTRA_FRAME, NONE}}, - - {NEARMV, {LAST_FRAME, ALTREF_FRAME}}, - {NEWMV, {LAST_FRAME, ALTREF_FRAME}}, - {NEARMV, {GOLDEN_FRAME, ALTREF_FRAME}}, - {NEWMV, {GOLDEN_FRAME, ALTREF_FRAME}}, - - {ZEROMV, {LAST_FRAME, ALTREF_FRAME}}, - {ZEROMV, {GOLDEN_FRAME, ALTREF_FRAME}}, - - {H_PRED, {INTRA_FRAME, NONE}}, - {V_PRED, {INTRA_FRAME, NONE}}, - {D135_PRED, {INTRA_FRAME, NONE}}, - {D207_PRED, {INTRA_FRAME, NONE}}, - {D153_PRED, {INTRA_FRAME, NONE}}, - {D63_PRED, {INTRA_FRAME, NONE}}, - {D117_PRED, {INTRA_FRAME, NONE}}, - {D45_PRED, {INTRA_FRAME, NONE}}, -}; - -static const REF_DEFINITION vp9_ref_order[MAX_REFS] = { - {{LAST_FRAME, NONE}}, - {{GOLDEN_FRAME, NONE}}, - {{ALTREF_FRAME, NONE}}, - {{LAST_FRAME, ALTREF_FRAME}}, - {{GOLDEN_FRAME, ALTREF_FRAME}}, - {{INTRA_FRAME, NONE}}, -}; - -static void swap_block_ptr(MACROBLOCK *x, PICK_MODE_CONTEXT *ctx, - int m, int n, int min_plane, int max_plane) { - int i; - - for (i = min_plane; i < max_plane; ++i) { - struct macroblock_plane *const p = &x->plane[i]; - struct macroblockd_plane *const pd = &x->e_mbd.plane[i]; - - p->coeff = ctx->coeff_pbuf[i][m]; - p->qcoeff = ctx->qcoeff_pbuf[i][m]; - pd->dqcoeff = ctx->dqcoeff_pbuf[i][m]; - p->eobs = ctx->eobs_pbuf[i][m]; - - ctx->coeff_pbuf[i][m] = ctx->coeff_pbuf[i][n]; - ctx->qcoeff_pbuf[i][m] = ctx->qcoeff_pbuf[i][n]; - ctx->dqcoeff_pbuf[i][m] = ctx->dqcoeff_pbuf[i][n]; - ctx->eobs_pbuf[i][m] = ctx->eobs_pbuf[i][n]; - - ctx->coeff_pbuf[i][n] = p->coeff; - ctx->qcoeff_pbuf[i][n] = p->qcoeff; - ctx->dqcoeff_pbuf[i][n] = pd->dqcoeff; - ctx->eobs_pbuf[i][n] = p->eobs; - } -} - -static void model_rd_for_sb(VP9_COMP *cpi, BLOCK_SIZE bsize, - MACROBLOCK *x, MACROBLOCKD *xd, - int *out_rate_sum, int64_t *out_dist_sum, - int *skip_txfm_sb, int64_t *skip_sse_sb) { - // Note our transform coeffs are 8 times an orthogonal transform. - // Hence quantizer step is also 8 times. To get effective quantizer - // we need to divide by 8 before sending to modeling function. - int i; - int64_t rate_sum = 0; - int64_t dist_sum = 0; - const int ref = xd->mi[0].src_mi->mbmi.ref_frame[0]; - unsigned int sse; - unsigned int var = 0; - unsigned int sum_sse = 0; - int64_t total_sse = 0; - int skip_flag = 1; - const int shift = 6; - int rate; - int64_t dist; - - x->pred_sse[ref] = 0; - - for (i = 0; i < MAX_MB_PLANE; ++i) { - struct macroblock_plane *const p = &x->plane[i]; - struct macroblockd_plane *const pd = &xd->plane[i]; - const BLOCK_SIZE bs = get_plane_block_size(bsize, pd); - const TX_SIZE max_tx_size = max_txsize_lookup[bs]; - const BLOCK_SIZE unit_size = txsize_to_bsize[max_tx_size]; - const int64_t dc_thr = p->quant_thred[0] >> shift; - const int64_t ac_thr = p->quant_thred[1] >> shift; - // The low thresholds are used to measure if the prediction errors are - // low enough so that we can skip the mode search. - const int64_t low_dc_thr = MIN(50, dc_thr >> 2); - const int64_t low_ac_thr = MIN(80, ac_thr >> 2); - int bw = 1 << (b_width_log2_lookup[bs] - b_width_log2_lookup[unit_size]); - int bh = 1 << (b_height_log2_lookup[bs] - b_width_log2_lookup[unit_size]); - int idx, idy; - int lw = b_width_log2_lookup[unit_size] + 2; - int lh = b_height_log2_lookup[unit_size] + 2; - - sum_sse = 0; - - for (idy = 0; idy < bh; ++idy) { - for (idx = 0; idx < bw; ++idx) { - uint8_t *src = p->src.buf + (idy * p->src.stride << lh) + (idx << lw); - uint8_t *dst = pd->dst.buf + (idy * pd->dst.stride << lh) + (idx << lh); - int block_idx = (idy << 1) + idx; - int low_err_skip = 0; - - var = cpi->fn_ptr[unit_size].vf(src, p->src.stride, - dst, pd->dst.stride, &sse); - x->bsse[(i << 2) + block_idx] = sse; - sum_sse += sse; - - x->skip_txfm[(i << 2) + block_idx] = 0; - if (!x->select_tx_size) { - // Check if all ac coefficients can be quantized to zero. - if (var < ac_thr || var == 0) { - x->skip_txfm[(i << 2) + block_idx] = 2; - - // Check if dc coefficient can be quantized to zero. - if (sse - var < dc_thr || sse == var) { - x->skip_txfm[(i << 2) + block_idx] = 1; - - if (!sse || (var < low_ac_thr && sse - var < low_dc_thr)) - low_err_skip = 1; - } - } - } - - if (skip_flag && !low_err_skip) - skip_flag = 0; - - if (i == 0) - x->pred_sse[ref] += sse; - } - } - - total_sse += sum_sse; - - // Fast approximate the modelling function. - if (cpi->oxcf.speed > 4) { - int64_t rate; - const int64_t square_error = sum_sse; - int quantizer = (pd->dequant[1] >> 3); -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - quantizer >>= (xd->bd - 8); - } -#endif // CONFIG_VP9_HIGHBITDEPTH - - if (quantizer < 120) - rate = (square_error * (280 - quantizer)) >> 8; - else - rate = 0; - dist = (square_error * quantizer) >> 8; - rate_sum += rate; - dist_sum += dist; - } else { -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - vp9_model_rd_from_var_lapndz(sum_sse, num_pels_log2_lookup[bs], - pd->dequant[1] >> (xd->bd - 5), - &rate, &dist); - } else { - vp9_model_rd_from_var_lapndz(sum_sse, num_pels_log2_lookup[bs], - pd->dequant[1] >> 3, &rate, &dist); - } -#else - vp9_model_rd_from_var_lapndz(sum_sse, num_pels_log2_lookup[bs], - pd->dequant[1] >> 3, &rate, &dist); -#endif // CONFIG_VP9_HIGHBITDEPTH - rate_sum += rate; - dist_sum += dist; - } - } - - *skip_txfm_sb = skip_flag; - *skip_sse_sb = total_sse << 4; - *out_rate_sum = (int)rate_sum; - *out_dist_sum = dist_sum << 4; -} - -int64_t vp9_block_error_c(const tran_low_t *coeff, const tran_low_t *dqcoeff, - intptr_t block_size, int64_t *ssz) { - int i; - int64_t error = 0, sqcoeff = 0; - - for (i = 0; i < block_size; i++) { - const int diff = coeff[i] - dqcoeff[i]; - error += diff * diff; - sqcoeff += coeff[i] * coeff[i]; - } - - *ssz = sqcoeff; - return error; -} - - -#if CONFIG_VP9_HIGHBITDEPTH -int64_t vp9_highbd_block_error_c(const tran_low_t *coeff, - const tran_low_t *dqcoeff, - intptr_t block_size, - int64_t *ssz, int bd) { - int i; - int64_t error = 0, sqcoeff = 0; - int shift = 2 * (bd - 8); - int rounding = shift > 0 ? 1 << (shift - 1) : 0; - - for (i = 0; i < block_size; i++) { - const int64_t diff = coeff[i] - dqcoeff[i]; - error += diff * diff; - sqcoeff += (int64_t)coeff[i] * (int64_t)coeff[i]; - } - assert(error >= 0 && sqcoeff >= 0); - error = (error + rounding) >> shift; - sqcoeff = (sqcoeff + rounding) >> shift; - - *ssz = sqcoeff; - return error; -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -/* The trailing '0' is a terminator which is used inside cost_coeffs() to - * decide whether to include cost of a trailing EOB node or not (i.e. we - * can skip this if the last coefficient in this transform block, e.g. the - * 16th coefficient in a 4x4 block or the 64th coefficient in a 8x8 block, - * were non-zero). */ -static const int16_t band_counts[TX_SIZES][8] = { - { 1, 2, 3, 4, 3, 16 - 13, 0 }, - { 1, 2, 3, 4, 11, 64 - 21, 0 }, - { 1, 2, 3, 4, 11, 256 - 21, 0 }, - { 1, 2, 3, 4, 11, 1024 - 21, 0 }, -}; -static int cost_coeffs(MACROBLOCK *x, - int plane, int block, - ENTROPY_CONTEXT *A, ENTROPY_CONTEXT *L, - TX_SIZE tx_size, - const int16_t *scan, const int16_t *nb, - int use_fast_coef_costing) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *mbmi = &xd->mi[0].src_mi->mbmi; - const struct macroblock_plane *p = &x->plane[plane]; - const struct macroblockd_plane *pd = &xd->plane[plane]; - const PLANE_TYPE type = pd->plane_type; - const int16_t *band_count = &band_counts[tx_size][1]; - const int eob = p->eobs[block]; - const tran_low_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block); - unsigned int (*token_costs)[2][COEFF_CONTEXTS][ENTROPY_TOKENS] = - x->token_costs[tx_size][type][is_inter_block(mbmi)]; - uint8_t token_cache[32 * 32]; - int pt = combine_entropy_contexts(*A, *L); - int c, cost; -#if CONFIG_VP9_HIGHBITDEPTH - const int16_t *cat6_high_cost = vp9_get_high_cost_table(xd->bd); -#else - const int16_t *cat6_high_cost = vp9_get_high_cost_table(8); -#endif - - // Check for consistency of tx_size with mode info - assert(type == PLANE_TYPE_Y ? mbmi->tx_size == tx_size - : get_uv_tx_size(mbmi, pd) == tx_size); - - if (eob == 0) { - // single eob token - cost = token_costs[0][0][pt][EOB_TOKEN]; - c = 0; - } else { - int band_left = *band_count++; - - // dc token - int v = qcoeff[0]; - int16_t prev_t; - EXTRABIT e; - vp9_get_token_extra(v, &prev_t, &e); - cost = (*token_costs)[0][pt][prev_t] + - vp9_get_cost(prev_t, e, cat6_high_cost); - - token_cache[0] = vp9_pt_energy_class[prev_t]; - ++token_costs; - - // ac tokens - for (c = 1; c < eob; c++) { - const int rc = scan[c]; - int16_t t; - - v = qcoeff[rc]; - vp9_get_token_extra(v, &t, &e); - if (use_fast_coef_costing) { - cost += (*token_costs)[!prev_t][!prev_t][t] + - vp9_get_cost(t, e, cat6_high_cost); - } else { - pt = get_coef_context(nb, token_cache, c); - cost += (*token_costs)[!prev_t][pt][t] + - vp9_get_cost(t, e, cat6_high_cost); - token_cache[rc] = vp9_pt_energy_class[t]; - } - prev_t = t; - if (!--band_left) { - band_left = *band_count++; - ++token_costs; - } - } - - // eob token - if (band_left) { - if (use_fast_coef_costing) { - cost += (*token_costs)[0][!prev_t][EOB_TOKEN]; - } else { - pt = get_coef_context(nb, token_cache, c); - cost += (*token_costs)[0][pt][EOB_TOKEN]; - } - } - } - - // is eob first coefficient; - *A = *L = (c > 0); - - return cost; -} - -#if CONFIG_VP9_HIGHBITDEPTH -static void dist_block(int plane, int block, TX_SIZE tx_size, - struct rdcost_block_args* args, int bd) { -#else -static void dist_block(int plane, int block, TX_SIZE tx_size, - struct rdcost_block_args* args) { -#endif // CONFIG_VP9_HIGHBITDEPTH - const int ss_txfrm_size = tx_size << 1; - MACROBLOCK* const x = args->x; - MACROBLOCKD* const xd = &x->e_mbd; - const struct macroblock_plane *const p = &x->plane[plane]; - const struct macroblockd_plane *const pd = &xd->plane[plane]; - int64_t this_sse; - int shift = tx_size == TX_32X32 ? 0 : 2; - tran_low_t *const coeff = BLOCK_OFFSET(p->coeff, block); - tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); -#if CONFIG_VP9_HIGHBITDEPTH - args->dist = vp9_highbd_block_error(coeff, dqcoeff, 16 << ss_txfrm_size, - &this_sse, bd) >> shift; -#else - args->dist = vp9_block_error(coeff, dqcoeff, 16 << ss_txfrm_size, - &this_sse) >> shift; -#endif // CONFIG_VP9_HIGHBITDEPTH - args->sse = this_sse >> shift; - - if (x->skip_encode && !is_inter_block(&xd->mi[0].src_mi->mbmi)) { - // TODO(jingning): tune the model to better capture the distortion. - int64_t p = (pd->dequant[1] * pd->dequant[1] * - (1 << ss_txfrm_size)) >> (shift + 2); -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - p >>= ((xd->bd - 8) * 2); - } -#endif // CONFIG_VP9_HIGHBITDEPTH - args->dist += (p >> 4); - args->sse += p; - } -} - -static void rate_block(int plane, int block, BLOCK_SIZE plane_bsize, - TX_SIZE tx_size, struct rdcost_block_args* args) { - int x_idx, y_idx; - txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &x_idx, &y_idx); - - args->rate = cost_coeffs(args->x, plane, block, args->t_above + x_idx, - args->t_left + y_idx, tx_size, - args->so->scan, args->so->neighbors, - args->use_fast_coef_costing); -} - -static void block_rd_txfm(int plane, int block, BLOCK_SIZE plane_bsize, - TX_SIZE tx_size, void *arg) { - struct rdcost_block_args *args = arg; - MACROBLOCK *const x = args->x; - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi; - int64_t rd1, rd2, rd; - - if (args->skip) - return; - - if (!is_inter_block(mbmi)) { - struct encode_b_args arg = {x, NULL, &mbmi->skip}; - vp9_encode_block_intra(plane, block, plane_bsize, tx_size, &arg); -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - dist_block(plane, block, tx_size, args, xd->bd); - } else { - dist_block(plane, block, tx_size, args, 8); - } -#else - dist_block(plane, block, tx_size, args); -#endif // CONFIG_VP9_HIGHBITDEPTH - } else if (max_txsize_lookup[plane_bsize] == tx_size) { - if (x->skip_txfm[(plane << 2) + (block >> (tx_size << 1))] == 0) { - // full forward transform and quantization - vp9_xform_quant(x, plane, block, plane_bsize, tx_size); -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - dist_block(plane, block, tx_size, args, xd->bd); - } else { - dist_block(plane, block, tx_size, args, 8); - } -#else - dist_block(plane, block, tx_size, args); -#endif // CONFIG_VP9_HIGHBITDEPTH - } else if (x->skip_txfm[(plane << 2) + (block >> (tx_size << 1))] == 2) { - // compute DC coefficient - tran_low_t *const coeff = BLOCK_OFFSET(x->plane[plane].coeff, block); - tran_low_t *const dqcoeff = BLOCK_OFFSET(xd->plane[plane].dqcoeff, block); - vp9_xform_quant_dc(x, plane, block, plane_bsize, tx_size); - args->sse = x->bsse[(plane << 2) + (block >> (tx_size << 1))] << 4; - args->dist = args->sse; - if (x->plane[plane].eobs[block]) { - const int64_t orig_sse = (int64_t)coeff[0] * coeff[0]; - const int64_t resd_sse = coeff[0] - dqcoeff[0]; - int64_t dc_correct = orig_sse - resd_sse * resd_sse; -#if CONFIG_VP9_HIGHBITDEPTH - dc_correct >>= ((xd->bd - 8) * 2); -#endif - if (tx_size != TX_32X32) - dc_correct >>= 2; - - args->dist = MAX(0, args->sse - dc_correct); - } - } else { - // skip forward transform - x->plane[plane].eobs[block] = 0; - args->sse = x->bsse[(plane << 2) + (block >> (tx_size << 1))] << 4; - args->dist = args->sse; - } - } else { - // full forward transform and quantization - vp9_xform_quant(x, plane, block, plane_bsize, tx_size); -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - dist_block(plane, block, tx_size, args, xd->bd); - } else { - dist_block(plane, block, tx_size, args, 8); - } -#else - dist_block(plane, block, tx_size, args); -#endif // CONFIG_VP9_HIGHBITDEPTH - } - - rate_block(plane, block, plane_bsize, tx_size, args); - rd1 = RDCOST(x->rdmult, x->rddiv, args->rate, args->dist); - rd2 = RDCOST(x->rdmult, x->rddiv, 0, args->sse); - - // TODO(jingning): temporarily enabled only for luma component - rd = MIN(rd1, rd2); - if (plane == 0) - x->zcoeff_blk[tx_size][block] = !x->plane[plane].eobs[block] || - (rd1 > rd2 && !xd->lossless); - - args->this_rate += args->rate; - args->this_dist += args->dist; - args->this_sse += args->sse; - args->this_rd += rd; - - if (args->this_rd > args->best_rd) { - args->skip = 1; - return; - } -} - -static void txfm_rd_in_plane(MACROBLOCK *x, - int *rate, int64_t *distortion, - int *skippable, int64_t *sse, - int64_t ref_best_rd, int plane, - BLOCK_SIZE bsize, TX_SIZE tx_size, - int use_fast_coef_casting) { - MACROBLOCKD *const xd = &x->e_mbd; - const struct macroblockd_plane *const pd = &xd->plane[plane]; - struct rdcost_block_args args; - vp9_zero(args); - args.x = x; - args.best_rd = ref_best_rd; - args.use_fast_coef_costing = use_fast_coef_casting; - - if (plane == 0) - xd->mi[0].src_mi->mbmi.tx_size = tx_size; - - vp9_get_entropy_contexts(bsize, tx_size, pd, args.t_above, args.t_left); - - args.so = get_scan(xd, tx_size, pd->plane_type, 0); - - vp9_foreach_transformed_block_in_plane(xd, bsize, plane, - block_rd_txfm, &args); - if (args.skip) { - *rate = INT_MAX; - *distortion = INT64_MAX; - *sse = INT64_MAX; - *skippable = 0; - } else { - *distortion = args.this_dist; - *rate = args.this_rate; - *sse = args.this_sse; - *skippable = vp9_is_skippable_in_plane(x, bsize, plane); - } -} - -static void choose_largest_tx_size(VP9_COMP *cpi, MACROBLOCK *x, - int *rate, int64_t *distortion, - int *skip, int64_t *sse, - int64_t ref_best_rd, - BLOCK_SIZE bs) { - const TX_SIZE max_tx_size = max_txsize_lookup[bs]; - VP9_COMMON *const cm = &cpi->common; - const TX_SIZE largest_tx_size = tx_mode_to_biggest_tx_size[cm->tx_mode]; - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi; - - mbmi->tx_size = MIN(max_tx_size, largest_tx_size); - - txfm_rd_in_plane(x, rate, distortion, skip, - sse, ref_best_rd, 0, bs, - mbmi->tx_size, cpi->sf.use_fast_coef_costing); -} - -static void choose_tx_size_from_rd(VP9_COMP *cpi, MACROBLOCK *x, - int *rate, - int64_t *distortion, - int *skip, - int64_t *psse, - int64_t tx_cache[TX_MODES], - int64_t ref_best_rd, - BLOCK_SIZE bs) { - const TX_SIZE max_tx_size = max_txsize_lookup[bs]; - VP9_COMMON *const cm = &cpi->common; - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi; - vp9_prob skip_prob = vp9_get_skip_prob(cm, xd); - int r[TX_SIZES][2], s[TX_SIZES]; - int64_t d[TX_SIZES], sse[TX_SIZES]; - int64_t rd[TX_SIZES][2] = {{INT64_MAX, INT64_MAX}, - {INT64_MAX, INT64_MAX}, - {INT64_MAX, INT64_MAX}, - {INT64_MAX, INT64_MAX}}; - int n, m; - int s0, s1; - const TX_SIZE max_mode_tx_size = tx_mode_to_biggest_tx_size[cm->tx_mode]; - int64_t best_rd = INT64_MAX; - TX_SIZE best_tx = max_tx_size; - - const vp9_prob *tx_probs = get_tx_probs2(max_tx_size, xd, &cm->fc->tx_probs); - assert(skip_prob > 0); - s0 = vp9_cost_bit(skip_prob, 0); - s1 = vp9_cost_bit(skip_prob, 1); - - for (n = max_tx_size; n >= 0; n--) { - txfm_rd_in_plane(x, &r[n][0], &d[n], &s[n], - &sse[n], ref_best_rd, 0, bs, n, - cpi->sf.use_fast_coef_costing); - r[n][1] = r[n][0]; - if (r[n][0] < INT_MAX) { - for (m = 0; m <= n - (n == (int) max_tx_size); m++) { - if (m == n) - r[n][1] += vp9_cost_zero(tx_probs[m]); - else - r[n][1] += vp9_cost_one(tx_probs[m]); - } - } - if (d[n] == INT64_MAX) { - rd[n][0] = rd[n][1] = INT64_MAX; - } else if (s[n]) { - rd[n][0] = rd[n][1] = RDCOST(x->rdmult, x->rddiv, s1, d[n]); - } else { - rd[n][0] = RDCOST(x->rdmult, x->rddiv, r[n][0] + s0, d[n]); - rd[n][1] = RDCOST(x->rdmult, x->rddiv, r[n][1] + s0, d[n]); - } - - // Early termination in transform size search. - if (cpi->sf.tx_size_search_breakout && - (rd[n][1] == INT64_MAX || - (n < (int) max_tx_size && rd[n][1] > rd[n + 1][1]) || - s[n] == 1)) - break; - - if (rd[n][1] < best_rd) { - best_tx = n; - best_rd = rd[n][1]; - } - } - mbmi->tx_size = cm->tx_mode == TX_MODE_SELECT ? - best_tx : MIN(max_tx_size, max_mode_tx_size); - - - *distortion = d[mbmi->tx_size]; - *rate = r[mbmi->tx_size][cm->tx_mode == TX_MODE_SELECT]; - *skip = s[mbmi->tx_size]; - *psse = sse[mbmi->tx_size]; - - tx_cache[ONLY_4X4] = rd[TX_4X4][0]; - tx_cache[ALLOW_8X8] = rd[TX_8X8][0]; - tx_cache[ALLOW_16X16] = rd[MIN(max_tx_size, TX_16X16)][0]; - tx_cache[ALLOW_32X32] = rd[MIN(max_tx_size, TX_32X32)][0]; - - if (max_tx_size == TX_32X32 && best_tx == TX_32X32) { - tx_cache[TX_MODE_SELECT] = rd[TX_32X32][1]; - } else if (max_tx_size >= TX_16X16 && best_tx == TX_16X16) { - tx_cache[TX_MODE_SELECT] = rd[TX_16X16][1]; - } else if (rd[TX_8X8][1] < rd[TX_4X4][1]) { - tx_cache[TX_MODE_SELECT] = rd[TX_8X8][1]; - } else { - tx_cache[TX_MODE_SELECT] = rd[TX_4X4][1]; - } -} - -static void super_block_yrd(VP9_COMP *cpi, MACROBLOCK *x, int *rate, - int64_t *distortion, int *skip, - int64_t *psse, BLOCK_SIZE bs, - int64_t txfm_cache[TX_MODES], - int64_t ref_best_rd) { - MACROBLOCKD *xd = &x->e_mbd; - int64_t sse; - int64_t *ret_sse = psse ? psse : &sse; - - assert(bs == xd->mi[0].src_mi->mbmi.sb_type); - - if (cpi->sf.tx_size_search_method == USE_LARGESTALL || xd->lossless) { - vpx_memset(txfm_cache, 0, TX_MODES * sizeof(int64_t)); - choose_largest_tx_size(cpi, x, rate, distortion, skip, ret_sse, ref_best_rd, - bs); - } else { - choose_tx_size_from_rd(cpi, x, rate, distortion, skip, ret_sse, - txfm_cache, ref_best_rd, bs); - } -} - -static int conditional_skipintra(PREDICTION_MODE mode, - PREDICTION_MODE best_intra_mode) { - if (mode == D117_PRED && - best_intra_mode != V_PRED && - best_intra_mode != D135_PRED) - return 1; - if (mode == D63_PRED && - best_intra_mode != V_PRED && - best_intra_mode != D45_PRED) - return 1; - if (mode == D207_PRED && - best_intra_mode != H_PRED && - best_intra_mode != D45_PRED) - return 1; - if (mode == D153_PRED && - best_intra_mode != H_PRED && - best_intra_mode != D135_PRED) - return 1; - return 0; -} - -static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib, - PREDICTION_MODE *best_mode, - const int *bmode_costs, - ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l, - int *bestrate, int *bestratey, - int64_t *bestdistortion, - BLOCK_SIZE bsize, int64_t rd_thresh) { - PREDICTION_MODE mode; - MACROBLOCKD *const xd = &x->e_mbd; - int64_t best_rd = rd_thresh; - - struct macroblock_plane *p = &x->plane[0]; - struct macroblockd_plane *pd = &xd->plane[0]; - const int src_stride = p->src.stride; - const int dst_stride = pd->dst.stride; - const uint8_t *src_init = &p->src.buf[vp9_raster_block_offset(BLOCK_8X8, ib, - src_stride)]; - uint8_t *dst_init = &pd->dst.buf[vp9_raster_block_offset(BLOCK_8X8, ib, - dst_stride)]; - ENTROPY_CONTEXT ta[2], tempa[2]; - ENTROPY_CONTEXT tl[2], templ[2]; - - const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize]; - const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bsize]; - int idx, idy; - uint8_t best_dst[8 * 8]; -#if CONFIG_VP9_HIGHBITDEPTH - uint16_t best_dst16[8 * 8]; -#endif - - assert(ib < 4); - - vpx_memcpy(ta, a, sizeof(ta)); - vpx_memcpy(tl, l, sizeof(tl)); - xd->mi[0].src_mi->mbmi.tx_size = TX_4X4; - -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - for (mode = DC_PRED; mode <= TM_PRED; ++mode) { - int64_t this_rd; - int ratey = 0; - int64_t distortion = 0; - int rate = bmode_costs[mode]; - - if (!(cpi->sf.intra_y_mode_mask[TX_4X4] & (1 << mode))) - continue; - - // Only do the oblique modes if the best so far is - // one of the neighboring directional modes - if (cpi->sf.mode_search_skip_flags & FLAG_SKIP_INTRA_DIRMISMATCH) { - if (conditional_skipintra(mode, *best_mode)) - continue; - } - - vpx_memcpy(tempa, ta, sizeof(ta)); - vpx_memcpy(templ, tl, sizeof(tl)); - - for (idy = 0; idy < num_4x4_blocks_high; ++idy) { - for (idx = 0; idx < num_4x4_blocks_wide; ++idx) { - const int block = ib + idy * 2 + idx; - const uint8_t *const src = &src_init[idx * 4 + idy * 4 * src_stride]; - uint8_t *const dst = &dst_init[idx * 4 + idy * 4 * dst_stride]; - int16_t *const src_diff = vp9_raster_block_offset_int16(BLOCK_8X8, - block, - p->src_diff); - tran_low_t *const coeff = BLOCK_OFFSET(x->plane[0].coeff, block); - xd->mi[0].src_mi->bmi[block].as_mode = mode; - vp9_predict_intra_block(xd, block, 1, - TX_4X4, mode, - x->skip_encode ? src : dst, - x->skip_encode ? src_stride : dst_stride, - dst, dst_stride, idx, idy, 0); - vp9_highbd_subtract_block(4, 4, src_diff, 8, src, src_stride, - dst, dst_stride, xd->bd); - if (xd->lossless) { - const scan_order *so = &vp9_default_scan_orders[TX_4X4]; - vp9_highbd_fwht4x4(src_diff, coeff, 8); - vp9_regular_quantize_b_4x4(x, 0, block, so->scan, so->iscan); - ratey += cost_coeffs(x, 0, block, tempa + idx, templ + idy, TX_4X4, - so->scan, so->neighbors, - cpi->sf.use_fast_coef_costing); - if (RDCOST(x->rdmult, x->rddiv, ratey, distortion) >= best_rd) - goto next_highbd; - vp9_highbd_iwht4x4_add(BLOCK_OFFSET(pd->dqcoeff, block), - dst, dst_stride, - p->eobs[block], xd->bd); - } else { - int64_t unused; - const TX_TYPE tx_type = get_tx_type_4x4(PLANE_TYPE_Y, xd, block); - const scan_order *so = &vp9_scan_orders[TX_4X4][tx_type]; - vp9_highbd_fht4x4(src_diff, coeff, 8, tx_type); - vp9_regular_quantize_b_4x4(x, 0, block, so->scan, so->iscan); - ratey += cost_coeffs(x, 0, block, tempa + idx, templ + idy, TX_4X4, - so->scan, so->neighbors, - cpi->sf.use_fast_coef_costing); - distortion += vp9_highbd_block_error( - coeff, BLOCK_OFFSET(pd->dqcoeff, block), - 16, &unused, xd->bd) >> 2; - if (RDCOST(x->rdmult, x->rddiv, ratey, distortion) >= best_rd) - goto next_highbd; - vp9_highbd_iht4x4_add(tx_type, BLOCK_OFFSET(pd->dqcoeff, block), - dst, dst_stride, p->eobs[block], xd->bd); - } - } - } - - rate += ratey; - this_rd = RDCOST(x->rdmult, x->rddiv, rate, distortion); - - if (this_rd < best_rd) { - *bestrate = rate; - *bestratey = ratey; - *bestdistortion = distortion; - best_rd = this_rd; - *best_mode = mode; - vpx_memcpy(a, tempa, sizeof(tempa)); - vpx_memcpy(l, templ, sizeof(templ)); - for (idy = 0; idy < num_4x4_blocks_high * 4; ++idy) { - vpx_memcpy(best_dst16 + idy * 8, - CONVERT_TO_SHORTPTR(dst_init + idy * dst_stride), - num_4x4_blocks_wide * 4 * sizeof(uint16_t)); - } - } - next_highbd: - {} - } - if (best_rd >= rd_thresh || x->skip_encode) - return best_rd; - - for (idy = 0; idy < num_4x4_blocks_high * 4; ++idy) { - vpx_memcpy(CONVERT_TO_SHORTPTR(dst_init + idy * dst_stride), - best_dst16 + idy * 8, - num_4x4_blocks_wide * 4 * sizeof(uint16_t)); - } - - return best_rd; - } -#endif // CONFIG_VP9_HIGHBITDEPTH - - for (mode = DC_PRED; mode <= TM_PRED; ++mode) { - int64_t this_rd; - int ratey = 0; - int64_t distortion = 0; - int rate = bmode_costs[mode]; - - if (!(cpi->sf.intra_y_mode_mask[TX_4X4] & (1 << mode))) - continue; - - // Only do the oblique modes if the best so far is - // one of the neighboring directional modes - if (cpi->sf.mode_search_skip_flags & FLAG_SKIP_INTRA_DIRMISMATCH) { - if (conditional_skipintra(mode, *best_mode)) - continue; - } - - vpx_memcpy(tempa, ta, sizeof(ta)); - vpx_memcpy(templ, tl, sizeof(tl)); - - for (idy = 0; idy < num_4x4_blocks_high; ++idy) { - for (idx = 0; idx < num_4x4_blocks_wide; ++idx) { - const int block = ib + idy * 2 + idx; - const uint8_t *const src = &src_init[idx * 4 + idy * 4 * src_stride]; - uint8_t *const dst = &dst_init[idx * 4 + idy * 4 * dst_stride]; - int16_t *const src_diff = - vp9_raster_block_offset_int16(BLOCK_8X8, block, p->src_diff); - tran_low_t *const coeff = BLOCK_OFFSET(x->plane[0].coeff, block); - xd->mi[0].src_mi->bmi[block].as_mode = mode; - vp9_predict_intra_block(xd, block, 1, - TX_4X4, mode, - x->skip_encode ? src : dst, - x->skip_encode ? src_stride : dst_stride, - dst, dst_stride, idx, idy, 0); - vp9_subtract_block(4, 4, src_diff, 8, src, src_stride, dst, dst_stride); - - if (xd->lossless) { - const scan_order *so = &vp9_default_scan_orders[TX_4X4]; - vp9_fwht4x4(src_diff, coeff, 8); - vp9_regular_quantize_b_4x4(x, 0, block, so->scan, so->iscan); - ratey += cost_coeffs(x, 0, block, tempa + idx, templ + idy, TX_4X4, - so->scan, so->neighbors, - cpi->sf.use_fast_coef_costing); - if (RDCOST(x->rdmult, x->rddiv, ratey, distortion) >= best_rd) - goto next; - vp9_iwht4x4_add(BLOCK_OFFSET(pd->dqcoeff, block), dst, dst_stride, - p->eobs[block]); - } else { - int64_t unused; - const TX_TYPE tx_type = get_tx_type_4x4(PLANE_TYPE_Y, xd, block); - const scan_order *so = &vp9_scan_orders[TX_4X4][tx_type]; - vp9_fht4x4(src_diff, coeff, 8, tx_type); - vp9_regular_quantize_b_4x4(x, 0, block, so->scan, so->iscan); - ratey += cost_coeffs(x, 0, block, tempa + idx, templ + idy, TX_4X4, - so->scan, so->neighbors, - cpi->sf.use_fast_coef_costing); - distortion += vp9_block_error(coeff, BLOCK_OFFSET(pd->dqcoeff, block), - 16, &unused) >> 2; - if (RDCOST(x->rdmult, x->rddiv, ratey, distortion) >= best_rd) - goto next; - vp9_iht4x4_add(tx_type, BLOCK_OFFSET(pd->dqcoeff, block), - dst, dst_stride, p->eobs[block]); - } - } - } - - rate += ratey; - this_rd = RDCOST(x->rdmult, x->rddiv, rate, distortion); - - if (this_rd < best_rd) { - *bestrate = rate; - *bestratey = ratey; - *bestdistortion = distortion; - best_rd = this_rd; - *best_mode = mode; - vpx_memcpy(a, tempa, sizeof(tempa)); - vpx_memcpy(l, templ, sizeof(templ)); - for (idy = 0; idy < num_4x4_blocks_high * 4; ++idy) - vpx_memcpy(best_dst + idy * 8, dst_init + idy * dst_stride, - num_4x4_blocks_wide * 4); - } - next: - {} - } - - if (best_rd >= rd_thresh || x->skip_encode) - return best_rd; - - for (idy = 0; idy < num_4x4_blocks_high * 4; ++idy) - vpx_memcpy(dst_init + idy * dst_stride, best_dst + idy * 8, - num_4x4_blocks_wide * 4); - - return best_rd; -} - -static int64_t rd_pick_intra_sub_8x8_y_mode(VP9_COMP *cpi, MACROBLOCK *mb, - int *rate, int *rate_y, - int64_t *distortion, - int64_t best_rd) { - int i, j; - const MACROBLOCKD *const xd = &mb->e_mbd; - MODE_INFO *const mic = xd->mi[0].src_mi; - const MODE_INFO *above_mi = xd->above_mi; - const MODE_INFO *left_mi = xd->left_mi; - const BLOCK_SIZE bsize = xd->mi[0].src_mi->mbmi.sb_type; - const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize]; - const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bsize]; - int idx, idy; - int cost = 0; - int64_t total_distortion = 0; - int tot_rate_y = 0; - int64_t total_rd = 0; - ENTROPY_CONTEXT t_above[4], t_left[4]; - const int *bmode_costs = cpi->mbmode_cost; - - vpx_memcpy(t_above, xd->plane[0].above_context, sizeof(t_above)); - vpx_memcpy(t_left, xd->plane[0].left_context, sizeof(t_left)); - - // Pick modes for each sub-block (of size 4x4, 4x8, or 8x4) in an 8x8 block. - for (idy = 0; idy < 2; idy += num_4x4_blocks_high) { - for (idx = 0; idx < 2; idx += num_4x4_blocks_wide) { - PREDICTION_MODE best_mode = DC_PRED; - int r = INT_MAX, ry = INT_MAX; - int64_t d = INT64_MAX, this_rd = INT64_MAX; - i = idy * 2 + idx; - if (cpi->common.frame_type == KEY_FRAME) { - const PREDICTION_MODE A = vp9_above_block_mode(mic, above_mi, i); - const PREDICTION_MODE L = vp9_left_block_mode(mic, left_mi, i); - - bmode_costs = cpi->y_mode_costs[A][L]; - } - - this_rd = rd_pick_intra4x4block(cpi, mb, i, &best_mode, bmode_costs, - t_above + idx, t_left + idy, &r, &ry, &d, - bsize, best_rd - total_rd); - if (this_rd >= best_rd - total_rd) - return INT64_MAX; - - total_rd += this_rd; - cost += r; - total_distortion += d; - tot_rate_y += ry; - - mic->bmi[i].as_mode = best_mode; - for (j = 1; j < num_4x4_blocks_high; ++j) - mic->bmi[i + j * 2].as_mode = best_mode; - for (j = 1; j < num_4x4_blocks_wide; ++j) - mic->bmi[i + j].as_mode = best_mode; - - if (total_rd >= best_rd) - return INT64_MAX; - } - } - - *rate = cost; - *rate_y = tot_rate_y; - *distortion = total_distortion; - mic->mbmi.mode = mic->bmi[3].as_mode; - - return RDCOST(mb->rdmult, mb->rddiv, cost, total_distortion); -} - -// This function is used only for intra_only frames -static int64_t rd_pick_intra_sby_mode(VP9_COMP *cpi, MACROBLOCK *x, - int *rate, int *rate_tokenonly, - int64_t *distortion, int *skippable, - BLOCK_SIZE bsize, - int64_t tx_cache[TX_MODES], - int64_t best_rd) { - PREDICTION_MODE mode; - PREDICTION_MODE mode_selected = DC_PRED; - MACROBLOCKD *const xd = &x->e_mbd; - MODE_INFO *const mic = xd->mi[0].src_mi; - int this_rate, this_rate_tokenonly, s; - int64_t this_distortion, this_rd; - TX_SIZE best_tx = TX_4X4; - int i; - int *bmode_costs; - const MODE_INFO *above_mi = xd->above_mi; - const MODE_INFO *left_mi = xd->left_mi; - const PREDICTION_MODE A = vp9_above_block_mode(mic, above_mi, 0); - const PREDICTION_MODE L = vp9_left_block_mode(mic, left_mi, 0); - bmode_costs = cpi->y_mode_costs[A][L]; - - if (cpi->sf.tx_size_search_method == USE_FULL_RD) - for (i = 0; i < TX_MODES; i++) - tx_cache[i] = INT64_MAX; - - vpx_memset(x->skip_txfm, 0, sizeof(x->skip_txfm)); - /* Y Search for intra prediction mode */ - for (mode = DC_PRED; mode <= TM_PRED; mode++) { - int64_t local_tx_cache[TX_MODES]; - - if (cpi->sf.use_nonrd_pick_mode) { - // These speed features are turned on in hybrid non-RD and RD mode - // for key frame coding in the context of real-time setting. - if (conditional_skipintra(mode, mode_selected)) - continue; - if (*skippable) - break; - } - - mic->mbmi.mode = mode; - - super_block_yrd(cpi, x, &this_rate_tokenonly, &this_distortion, - &s, NULL, bsize, local_tx_cache, best_rd); - - if (this_rate_tokenonly == INT_MAX) - continue; - - this_rate = this_rate_tokenonly + bmode_costs[mode]; - this_rd = RDCOST(x->rdmult, x->rddiv, this_rate, this_distortion); - - if (this_rd < best_rd) { - mode_selected = mode; - best_rd = this_rd; - best_tx = mic->mbmi.tx_size; - *rate = this_rate; - *rate_tokenonly = this_rate_tokenonly; - *distortion = this_distortion; - *skippable = s; - } - - if (cpi->sf.tx_size_search_method == USE_FULL_RD && this_rd < INT64_MAX) { - for (i = 0; i < TX_MODES && local_tx_cache[i] < INT64_MAX; i++) { - const int64_t adj_rd = this_rd + local_tx_cache[i] - - local_tx_cache[cpi->common.tx_mode]; - if (adj_rd < tx_cache[i]) { - tx_cache[i] = adj_rd; - } - } - } - } - - mic->mbmi.mode = mode_selected; - mic->mbmi.tx_size = best_tx; - - return best_rd; -} - -// Return value 0: early termination triggered, no valid rd cost available; -// 1: rd cost values are valid. -static int super_block_uvrd(const VP9_COMP *cpi, MACROBLOCK *x, - int *rate, int64_t *distortion, int *skippable, - int64_t *sse, BLOCK_SIZE bsize, - int64_t ref_best_rd) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi; - const TX_SIZE uv_tx_size = get_uv_tx_size(mbmi, &xd->plane[1]); - int plane; - int pnrate = 0, pnskip = 1; - int64_t pndist = 0, pnsse = 0; - int is_cost_valid = 1; - - if (ref_best_rd < 0) - is_cost_valid = 0; - - if (is_inter_block(mbmi) && is_cost_valid) { - int plane; - for (plane = 1; plane < MAX_MB_PLANE; ++plane) - vp9_subtract_plane(x, bsize, plane); - } - - *rate = 0; - *distortion = 0; - *sse = 0; - *skippable = 1; - - for (plane = 1; plane < MAX_MB_PLANE; ++plane) { - txfm_rd_in_plane(x, &pnrate, &pndist, &pnskip, &pnsse, - ref_best_rd, plane, bsize, uv_tx_size, - cpi->sf.use_fast_coef_costing); - if (pnrate == INT_MAX) { - is_cost_valid = 0; - break; - } - *rate += pnrate; - *distortion += pndist; - *sse += pnsse; - *skippable &= pnskip; - } - - if (!is_cost_valid) { - // reset cost value - *rate = INT_MAX; - *distortion = INT64_MAX; - *sse = INT64_MAX; - *skippable = 0; - } - - return is_cost_valid; -} - -static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x, - PICK_MODE_CONTEXT *ctx, - int *rate, int *rate_tokenonly, - int64_t *distortion, int *skippable, - BLOCK_SIZE bsize, TX_SIZE max_tx_size) { - MACROBLOCKD *xd = &x->e_mbd; - PREDICTION_MODE mode; - PREDICTION_MODE mode_selected = DC_PRED; - int64_t best_rd = INT64_MAX, this_rd; - int this_rate_tokenonly, this_rate, s; - int64_t this_distortion, this_sse; - - vpx_memset(x->skip_txfm, 0, sizeof(x->skip_txfm)); - for (mode = DC_PRED; mode <= TM_PRED; ++mode) { - if (!(cpi->sf.intra_uv_mode_mask[max_tx_size] & (1 << mode))) - continue; - - xd->mi[0].src_mi->mbmi.uv_mode = mode; - - if (!super_block_uvrd(cpi, x, &this_rate_tokenonly, - &this_distortion, &s, &this_sse, bsize, best_rd)) - continue; - this_rate = this_rate_tokenonly + - cpi->intra_uv_mode_cost[cpi->common.frame_type][mode]; - this_rd = RDCOST(x->rdmult, x->rddiv, this_rate, this_distortion); - - if (this_rd < best_rd) { - mode_selected = mode; - best_rd = this_rd; - *rate = this_rate; - *rate_tokenonly = this_rate_tokenonly; - *distortion = this_distortion; - *skippable = s; - if (!x->select_tx_size) - swap_block_ptr(x, ctx, 2, 0, 1, MAX_MB_PLANE); - } - } - - xd->mi[0].src_mi->mbmi.uv_mode = mode_selected; - return best_rd; -} - -static int64_t rd_sbuv_dcpred(const VP9_COMP *cpi, MACROBLOCK *x, - int *rate, int *rate_tokenonly, - int64_t *distortion, int *skippable, - BLOCK_SIZE bsize) { - const VP9_COMMON *cm = &cpi->common; - int64_t unused; - - x->e_mbd.mi[0].src_mi->mbmi.uv_mode = DC_PRED; - vpx_memset(x->skip_txfm, 0, sizeof(x->skip_txfm)); - super_block_uvrd(cpi, x, rate_tokenonly, distortion, - skippable, &unused, bsize, INT64_MAX); - *rate = *rate_tokenonly + cpi->intra_uv_mode_cost[cm->frame_type][DC_PRED]; - return RDCOST(x->rdmult, x->rddiv, *rate, *distortion); -} - -static void choose_intra_uv_mode(VP9_COMP *cpi, MACROBLOCK *const x, - PICK_MODE_CONTEXT *ctx, - BLOCK_SIZE bsize, TX_SIZE max_tx_size, - int *rate_uv, int *rate_uv_tokenonly, - int64_t *dist_uv, int *skip_uv, - PREDICTION_MODE *mode_uv) { - // Use an estimated rd for uv_intra based on DC_PRED if the - // appropriate speed flag is set. - if (cpi->sf.use_uv_intra_rd_estimate) { - rd_sbuv_dcpred(cpi, x, rate_uv, rate_uv_tokenonly, dist_uv, - skip_uv, bsize < BLOCK_8X8 ? BLOCK_8X8 : bsize); - // Else do a proper rd search for each possible transform size that may - // be considered in the main rd loop. - } else { - rd_pick_intra_sbuv_mode(cpi, x, ctx, - rate_uv, rate_uv_tokenonly, dist_uv, skip_uv, - bsize < BLOCK_8X8 ? BLOCK_8X8 : bsize, max_tx_size); - } - *mode_uv = x->e_mbd.mi[0].src_mi->mbmi.uv_mode; -} - -static int cost_mv_ref(const VP9_COMP *cpi, PREDICTION_MODE mode, - int mode_context) { - assert(is_inter_mode(mode)); - return cpi->inter_mode_cost[mode_context][INTER_OFFSET(mode)]; -} - -static int set_and_cost_bmi_mvs(VP9_COMP *cpi, MACROBLOCKD *xd, int i, - PREDICTION_MODE mode, int_mv this_mv[2], - int_mv frame_mv[MB_MODE_COUNT][MAX_REF_FRAMES], - int_mv seg_mvs[MAX_REF_FRAMES], - int_mv *best_ref_mv[2], const int *mvjcost, - int *mvcost[2]) { - MODE_INFO *const mic = xd->mi[0].src_mi; - const MB_MODE_INFO *const mbmi = &mic->mbmi; - int thismvcost = 0; - int idx, idy; - const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[mbmi->sb_type]; - const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[mbmi->sb_type]; - const int is_compound = has_second_ref(mbmi); - - switch (mode) { - case NEWMV: - this_mv[0].as_int = seg_mvs[mbmi->ref_frame[0]].as_int; - thismvcost += vp9_mv_bit_cost(&this_mv[0].as_mv, &best_ref_mv[0]->as_mv, - mvjcost, mvcost, MV_COST_WEIGHT_SUB); - if (is_compound) { - this_mv[1].as_int = seg_mvs[mbmi->ref_frame[1]].as_int; - thismvcost += vp9_mv_bit_cost(&this_mv[1].as_mv, &best_ref_mv[1]->as_mv, - mvjcost, mvcost, MV_COST_WEIGHT_SUB); - } - break; - case NEARMV: - case NEARESTMV: - this_mv[0].as_int = frame_mv[mode][mbmi->ref_frame[0]].as_int; - if (is_compound) - this_mv[1].as_int = frame_mv[mode][mbmi->ref_frame[1]].as_int; - break; - case ZEROMV: - this_mv[0].as_int = 0; - if (is_compound) - this_mv[1].as_int = 0; - break; - default: - break; - } - - mic->bmi[i].as_mv[0].as_int = this_mv[0].as_int; - if (is_compound) - mic->bmi[i].as_mv[1].as_int = this_mv[1].as_int; - - mic->bmi[i].as_mode = mode; - - for (idy = 0; idy < num_4x4_blocks_high; ++idy) - for (idx = 0; idx < num_4x4_blocks_wide; ++idx) - vpx_memmove(&mic->bmi[i + idy * 2 + idx], - &mic->bmi[i], sizeof(mic->bmi[i])); - - return cost_mv_ref(cpi, mode, mbmi->mode_context[mbmi->ref_frame[0]]) + - thismvcost; -} - -static int64_t encode_inter_mb_segment(VP9_COMP *cpi, - MACROBLOCK *x, - int64_t best_yrd, - int i, - int *labelyrate, - int64_t *distortion, int64_t *sse, - ENTROPY_CONTEXT *ta, - ENTROPY_CONTEXT *tl, - int mi_row, int mi_col) { - int k; - MACROBLOCKD *xd = &x->e_mbd; - struct macroblockd_plane *const pd = &xd->plane[0]; - struct macroblock_plane *const p = &x->plane[0]; - MODE_INFO *const mi = xd->mi[0].src_mi; - const BLOCK_SIZE plane_bsize = get_plane_block_size(mi->mbmi.sb_type, pd); - const int width = 4 * num_4x4_blocks_wide_lookup[plane_bsize]; - const int height = 4 * num_4x4_blocks_high_lookup[plane_bsize]; - int idx, idy; - - const uint8_t *const src = - &p->src.buf[vp9_raster_block_offset(BLOCK_8X8, i, p->src.stride)]; - uint8_t *const dst = &pd->dst.buf[vp9_raster_block_offset(BLOCK_8X8, i, - pd->dst.stride)]; - int64_t thisdistortion = 0, thissse = 0; - int thisrate = 0, ref; - const scan_order *so = &vp9_default_scan_orders[TX_4X4]; - const int is_compound = has_second_ref(&mi->mbmi); - const InterpKernel *kernel = vp9_get_interp_kernel(mi->mbmi.interp_filter); - - for (ref = 0; ref < 1 + is_compound; ++ref) { - const uint8_t *pre = &pd->pre[ref].buf[vp9_raster_block_offset(BLOCK_8X8, i, - pd->pre[ref].stride)]; -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - vp9_highbd_build_inter_predictor(pre, pd->pre[ref].stride, - dst, pd->dst.stride, - &mi->bmi[i].as_mv[ref].as_mv, - &xd->block_refs[ref]->sf, width, height, - ref, kernel, MV_PRECISION_Q3, - mi_col * MI_SIZE + 4 * (i % 2), - mi_row * MI_SIZE + 4 * (i / 2), xd->bd); - } else { - vp9_build_inter_predictor(pre, pd->pre[ref].stride, - dst, pd->dst.stride, - &mi->bmi[i].as_mv[ref].as_mv, - &xd->block_refs[ref]->sf, width, height, ref, - kernel, MV_PRECISION_Q3, - mi_col * MI_SIZE + 4 * (i % 2), - mi_row * MI_SIZE + 4 * (i / 2)); - } -#else - vp9_build_inter_predictor(pre, pd->pre[ref].stride, - dst, pd->dst.stride, - &mi->bmi[i].as_mv[ref].as_mv, - &xd->block_refs[ref]->sf, width, height, ref, - kernel, MV_PRECISION_Q3, - mi_col * MI_SIZE + 4 * (i % 2), - mi_row * MI_SIZE + 4 * (i / 2)); -#endif // CONFIG_VP9_HIGHBITDEPTH - } - -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - vp9_highbd_subtract_block( - height, width, vp9_raster_block_offset_int16(BLOCK_8X8, i, p->src_diff), - 8, src, p->src.stride, dst, pd->dst.stride, xd->bd); - } else { - vp9_subtract_block( - height, width, vp9_raster_block_offset_int16(BLOCK_8X8, i, p->src_diff), - 8, src, p->src.stride, dst, pd->dst.stride); - } -#else - vp9_subtract_block(height, width, - vp9_raster_block_offset_int16(BLOCK_8X8, i, p->src_diff), - 8, src, p->src.stride, dst, pd->dst.stride); -#endif // CONFIG_VP9_HIGHBITDEPTH - - k = i; - for (idy = 0; idy < height / 4; ++idy) { - for (idx = 0; idx < width / 4; ++idx) { - int64_t ssz, rd, rd1, rd2; - tran_low_t* coeff; - - k += (idy * 2 + idx); - coeff = BLOCK_OFFSET(p->coeff, k); - x->fwd_txm4x4(vp9_raster_block_offset_int16(BLOCK_8X8, k, p->src_diff), - coeff, 8); - vp9_regular_quantize_b_4x4(x, 0, k, so->scan, so->iscan); -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - thisdistortion += vp9_highbd_block_error(coeff, - BLOCK_OFFSET(pd->dqcoeff, k), - 16, &ssz, xd->bd); - } else { - thisdistortion += vp9_block_error(coeff, BLOCK_OFFSET(pd->dqcoeff, k), - 16, &ssz); - } -#else - thisdistortion += vp9_block_error(coeff, BLOCK_OFFSET(pd->dqcoeff, k), - 16, &ssz); -#endif // CONFIG_VP9_HIGHBITDEPTH - thissse += ssz; - thisrate += cost_coeffs(x, 0, k, ta + (k & 1), tl + (k >> 1), TX_4X4, - so->scan, so->neighbors, - cpi->sf.use_fast_coef_costing); - rd1 = RDCOST(x->rdmult, x->rddiv, thisrate, thisdistortion >> 2); - rd2 = RDCOST(x->rdmult, x->rddiv, 0, thissse >> 2); - rd = MIN(rd1, rd2); - if (rd >= best_yrd) - return INT64_MAX; - } - } - - *distortion = thisdistortion >> 2; - *labelyrate = thisrate; - *sse = thissse >> 2; - - return RDCOST(x->rdmult, x->rddiv, *labelyrate, *distortion); -} - -typedef struct { - int eobs; - int brate; - int byrate; - int64_t bdist; - int64_t bsse; - int64_t brdcost; - int_mv mvs[2]; - ENTROPY_CONTEXT ta[2]; - ENTROPY_CONTEXT tl[2]; -} SEG_RDSTAT; - -typedef struct { - int_mv *ref_mv[2]; - int_mv mvp; - - int64_t segment_rd; - int r; - int64_t d; - int64_t sse; - int segment_yrate; - PREDICTION_MODE modes[4]; - SEG_RDSTAT rdstat[4][INTER_MODES]; - int mvthresh; -} BEST_SEG_INFO; - -static INLINE int mv_check_bounds(const MACROBLOCK *x, const MV *mv) { - return (mv->row >> 3) < x->mv_row_min || - (mv->row >> 3) > x->mv_row_max || - (mv->col >> 3) < x->mv_col_min || - (mv->col >> 3) > x->mv_col_max; -} - -static INLINE void mi_buf_shift(MACROBLOCK *x, int i) { - MB_MODE_INFO *const mbmi = &x->e_mbd.mi[0].src_mi->mbmi; - struct macroblock_plane *const p = &x->plane[0]; - struct macroblockd_plane *const pd = &x->e_mbd.plane[0]; - - p->src.buf = &p->src.buf[vp9_raster_block_offset(BLOCK_8X8, i, - p->src.stride)]; - assert(((intptr_t)pd->pre[0].buf & 0x7) == 0); - pd->pre[0].buf = &pd->pre[0].buf[vp9_raster_block_offset(BLOCK_8X8, i, - pd->pre[0].stride)]; - if (has_second_ref(mbmi)) - pd->pre[1].buf = &pd->pre[1].buf[vp9_raster_block_offset(BLOCK_8X8, i, - pd->pre[1].stride)]; -} - -static INLINE void mi_buf_restore(MACROBLOCK *x, struct buf_2d orig_src, - struct buf_2d orig_pre[2]) { - MB_MODE_INFO *mbmi = &x->e_mbd.mi[0].src_mi->mbmi; - x->plane[0].src = orig_src; - x->e_mbd.plane[0].pre[0] = orig_pre[0]; - if (has_second_ref(mbmi)) - x->e_mbd.plane[0].pre[1] = orig_pre[1]; -} - -static INLINE int mv_has_subpel(const MV *mv) { - return (mv->row & 0x0F) || (mv->col & 0x0F); -} - -// Check if NEARESTMV/NEARMV/ZEROMV is the cheapest way encode zero motion. -// TODO(aconverse): Find out if this is still productive then clean up or remove -static int check_best_zero_mv( - const VP9_COMP *cpi, const uint8_t mode_context[MAX_REF_FRAMES], - int_mv frame_mv[MB_MODE_COUNT][MAX_REF_FRAMES], int this_mode, - const MV_REFERENCE_FRAME ref_frames[2]) { - if ((this_mode == NEARMV || this_mode == NEARESTMV || this_mode == ZEROMV) && - frame_mv[this_mode][ref_frames[0]].as_int == 0 && - (ref_frames[1] == NONE || - frame_mv[this_mode][ref_frames[1]].as_int == 0)) { - int rfc = mode_context[ref_frames[0]]; - int c1 = cost_mv_ref(cpi, NEARMV, rfc); - int c2 = cost_mv_ref(cpi, NEARESTMV, rfc); - int c3 = cost_mv_ref(cpi, ZEROMV, rfc); - - if (this_mode == NEARMV) { - if (c1 > c3) return 0; - } else if (this_mode == NEARESTMV) { - if (c2 > c3) return 0; - } else { - assert(this_mode == ZEROMV); - if (ref_frames[1] == NONE) { - if ((c3 >= c2 && frame_mv[NEARESTMV][ref_frames[0]].as_int == 0) || - (c3 >= c1 && frame_mv[NEARMV][ref_frames[0]].as_int == 0)) - return 0; - } else { - if ((c3 >= c2 && frame_mv[NEARESTMV][ref_frames[0]].as_int == 0 && - frame_mv[NEARESTMV][ref_frames[1]].as_int == 0) || - (c3 >= c1 && frame_mv[NEARMV][ref_frames[0]].as_int == 0 && - frame_mv[NEARMV][ref_frames[1]].as_int == 0)) - return 0; - } - } - } - return 1; -} - -static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x, - BLOCK_SIZE bsize, - int_mv *frame_mv, - int mi_row, int mi_col, - int_mv single_newmv[MAX_REF_FRAMES], - int *rate_mv) { - const VP9_COMMON *const cm = &cpi->common; - const int pw = 4 * num_4x4_blocks_wide_lookup[bsize]; - const int ph = 4 * num_4x4_blocks_high_lookup[bsize]; - MACROBLOCKD *xd = &x->e_mbd; - MB_MODE_INFO *mbmi = &xd->mi[0].src_mi->mbmi; - const int refs[2] = {mbmi->ref_frame[0], - mbmi->ref_frame[1] < 0 ? 0 : mbmi->ref_frame[1]}; - int_mv ref_mv[2]; - int ite, ref; - // Prediction buffer from second frame. -#if CONFIG_VP9_HIGHBITDEPTH - uint8_t *second_pred; - uint8_t *second_pred_alloc; -#else - uint8_t *second_pred = vpx_memalign(16, pw * ph * sizeof(uint8_t)); -#endif // CONFIG_VP9_HIGHBITDEPTH - const InterpKernel *kernel = vp9_get_interp_kernel(mbmi->interp_filter); - struct scale_factors sf; - - // Do joint motion search in compound mode to get more accurate mv. - struct buf_2d backup_yv12[2][MAX_MB_PLANE]; - int last_besterr[2] = {INT_MAX, INT_MAX}; - const YV12_BUFFER_CONFIG *const scaled_ref_frame[2] = { - vp9_get_scaled_ref_frame(cpi, mbmi->ref_frame[0]), - vp9_get_scaled_ref_frame(cpi, mbmi->ref_frame[1]) - }; -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - second_pred_alloc = vpx_memalign(16, pw * ph * sizeof(uint16_t)); - second_pred = CONVERT_TO_BYTEPTR(second_pred_alloc); - } else { - second_pred_alloc = vpx_memalign(16, pw * ph * sizeof(uint8_t)); - second_pred = second_pred_alloc; - } -#endif // CONFIG_VP9_HIGHBITDEPTH - - for (ref = 0; ref < 2; ++ref) { - ref_mv[ref] = mbmi->ref_mvs[refs[ref]][0]; - - if (scaled_ref_frame[ref]) { - int i; - // Swap out the reference frame for a version that's been scaled to - // match the resolution of the current frame, allowing the existing - // motion search code to be used without additional modifications. - for (i = 0; i < MAX_MB_PLANE; i++) - backup_yv12[ref][i] = xd->plane[i].pre[ref]; - vp9_setup_pre_planes(xd, ref, scaled_ref_frame[ref], mi_row, mi_col, - NULL); - } - - frame_mv[refs[ref]].as_int = single_newmv[refs[ref]].as_int; - } - - // Since we have scaled the reference frames to match the size of the current - // frame we must use a unit scaling factor during mode selection. -#if CONFIG_VP9_HIGHBITDEPTH - vp9_setup_scale_factors_for_frame(&sf, cm->width, cm->height, - cm->width, cm->height, - cm->use_highbitdepth); -#else - vp9_setup_scale_factors_for_frame(&sf, cm->width, cm->height, - cm->width, cm->height); -#endif // CONFIG_VP9_HIGHBITDEPTH - - // Allow joint search multiple times iteratively for each reference frame - // and break out of the search loop if it couldn't find a better mv. - for (ite = 0; ite < 4; ite++) { - struct buf_2d ref_yv12[2]; - int bestsme = INT_MAX; - int sadpb = x->sadperbit16; - MV tmp_mv; - int search_range = 3; - - int tmp_col_min = x->mv_col_min; - int tmp_col_max = x->mv_col_max; - int tmp_row_min = x->mv_row_min; - int tmp_row_max = x->mv_row_max; - int id = ite % 2; // Even iterations search in the first reference frame, - // odd iterations search in the second. The predictor - // found for the 'other' reference frame is factored in. - - // Initialized here because of compiler problem in Visual Studio. - ref_yv12[0] = xd->plane[0].pre[0]; - ref_yv12[1] = xd->plane[0].pre[1]; - - // Get the prediction block from the 'other' reference frame. -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - vp9_highbd_build_inter_predictor(ref_yv12[!id].buf, - ref_yv12[!id].stride, - second_pred, pw, - &frame_mv[refs[!id]].as_mv, - &sf, pw, ph, 0, - kernel, MV_PRECISION_Q3, - mi_col * MI_SIZE, mi_row * MI_SIZE, - xd->bd); - } else { - vp9_build_inter_predictor(ref_yv12[!id].buf, - ref_yv12[!id].stride, - second_pred, pw, - &frame_mv[refs[!id]].as_mv, - &sf, pw, ph, 0, - kernel, MV_PRECISION_Q3, - mi_col * MI_SIZE, mi_row * MI_SIZE); - } -#else - vp9_build_inter_predictor(ref_yv12[!id].buf, - ref_yv12[!id].stride, - second_pred, pw, - &frame_mv[refs[!id]].as_mv, - &sf, pw, ph, 0, - kernel, MV_PRECISION_Q3, - mi_col * MI_SIZE, mi_row * MI_SIZE); -#endif // CONFIG_VP9_HIGHBITDEPTH - - // Do compound motion search on the current reference frame. - if (id) - xd->plane[0].pre[0] = ref_yv12[id]; - vp9_set_mv_search_range(x, &ref_mv[id].as_mv); - - // Use the mv result from the single mode as mv predictor. - tmp_mv = frame_mv[refs[id]].as_mv; - - tmp_mv.col >>= 3; - tmp_mv.row >>= 3; - - // Small-range full-pixel motion search. - bestsme = vp9_refining_search_8p_c(x, &tmp_mv, sadpb, - search_range, - &cpi->fn_ptr[bsize], - &ref_mv[id].as_mv, second_pred); - if (bestsme < INT_MAX) - bestsme = vp9_get_mvpred_av_var(x, &tmp_mv, &ref_mv[id].as_mv, - second_pred, &cpi->fn_ptr[bsize], 1); - - x->mv_col_min = tmp_col_min; - x->mv_col_max = tmp_col_max; - x->mv_row_min = tmp_row_min; - x->mv_row_max = tmp_row_max; - - if (bestsme < INT_MAX) { - int dis; /* TODO: use dis in distortion calculation later. */ - unsigned int sse; - bestsme = cpi->find_fractional_mv_step( - x, &tmp_mv, - &ref_mv[id].as_mv, - cpi->common.allow_high_precision_mv, - x->errorperbit, - &cpi->fn_ptr[bsize], - 0, cpi->sf.mv.subpel_iters_per_step, - NULL, - x->nmvjointcost, x->mvcost, - &dis, &sse, second_pred, - pw, ph); - } - - // Restore the pointer to the first (possibly scaled) prediction buffer. - if (id) - xd->plane[0].pre[0] = ref_yv12[0]; - - if (bestsme < last_besterr[id]) { - frame_mv[refs[id]].as_mv = tmp_mv; - last_besterr[id] = bestsme; - } else { - break; - } - } - - *rate_mv = 0; - - for (ref = 0; ref < 2; ++ref) { - if (scaled_ref_frame[ref]) { - // Restore the prediction frame pointers to their unscaled versions. - int i; - for (i = 0; i < MAX_MB_PLANE; i++) - xd->plane[i].pre[ref] = backup_yv12[ref][i]; - } - - *rate_mv += vp9_mv_bit_cost(&frame_mv[refs[ref]].as_mv, - &mbmi->ref_mvs[refs[ref]][0].as_mv, - x->nmvjointcost, x->mvcost, MV_COST_WEIGHT); - } - -#if CONFIG_VP9_HIGHBITDEPTH - vpx_free(second_pred_alloc); -#else - vpx_free(second_pred); -#endif // CONFIG_VP9_HIGHBITDEPTH -} - -static int64_t rd_pick_best_sub8x8_mode(VP9_COMP *cpi, MACROBLOCK *x, - const TileInfo * const tile, - int_mv *best_ref_mv, - int_mv *second_best_ref_mv, - int64_t best_rd, int *returntotrate, - int *returnyrate, - int64_t *returndistortion, - int *skippable, int64_t *psse, - int mvthresh, - int_mv seg_mvs[4][MAX_REF_FRAMES], - BEST_SEG_INFO *bsi_buf, int filter_idx, - int mi_row, int mi_col) { - int i; - BEST_SEG_INFO *bsi = bsi_buf + filter_idx; - MACROBLOCKD *xd = &x->e_mbd; - MODE_INFO *mi = xd->mi[0].src_mi; - MB_MODE_INFO *mbmi = &mi->mbmi; - int mode_idx; - int k, br = 0, idx, idy; - int64_t bd = 0, block_sse = 0; - PREDICTION_MODE this_mode; - VP9_COMMON *cm = &cpi->common; - struct macroblock_plane *const p = &x->plane[0]; - struct macroblockd_plane *const pd = &xd->plane[0]; - const int label_count = 4; - int64_t this_segment_rd = 0; - int label_mv_thresh; - int segmentyrate = 0; - const BLOCK_SIZE bsize = mbmi->sb_type; - const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize]; - const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bsize]; - ENTROPY_CONTEXT t_above[2], t_left[2]; - int subpelmv = 1, have_ref = 0; - const int has_second_rf = has_second_ref(mbmi); - const int inter_mode_mask = cpi->sf.inter_mode_mask[bsize]; - - vp9_zero(*bsi); - - bsi->segment_rd = best_rd; - bsi->ref_mv[0] = best_ref_mv; - bsi->ref_mv[1] = second_best_ref_mv; - bsi->mvp.as_int = best_ref_mv->as_int; - bsi->mvthresh = mvthresh; - - for (i = 0; i < 4; i++) - bsi->modes[i] = ZEROMV; - - vpx_memcpy(t_above, pd->above_context, sizeof(t_above)); - vpx_memcpy(t_left, pd->left_context, sizeof(t_left)); - - // 64 makes this threshold really big effectively - // making it so that we very rarely check mvs on - // segments. setting this to 1 would make mv thresh - // roughly equal to what it is for macroblocks - label_mv_thresh = 1 * bsi->mvthresh / label_count; - - // Segmentation method overheads - for (idy = 0; idy < 2; idy += num_4x4_blocks_high) { - for (idx = 0; idx < 2; idx += num_4x4_blocks_wide) { - // TODO(jingning,rbultje): rewrite the rate-distortion optimization - // loop for 4x4/4x8/8x4 block coding. to be replaced with new rd loop - int_mv mode_mv[MB_MODE_COUNT][2]; - int_mv frame_mv[MB_MODE_COUNT][MAX_REF_FRAMES]; - PREDICTION_MODE mode_selected = ZEROMV; - int64_t best_rd = INT64_MAX; - const int i = idy * 2 + idx; - int ref; - - for (ref = 0; ref < 1 + has_second_rf; ++ref) { - const MV_REFERENCE_FRAME frame = mbmi->ref_frame[ref]; - frame_mv[ZEROMV][frame].as_int = 0; - vp9_append_sub8x8_mvs_for_idx(cm, xd, tile, i, ref, mi_row, mi_col, - &frame_mv[NEARESTMV][frame], - &frame_mv[NEARMV][frame]); - } - - // search for the best motion vector on this segment - for (this_mode = NEARESTMV; this_mode <= NEWMV; ++this_mode) { - const struct buf_2d orig_src = x->plane[0].src; - struct buf_2d orig_pre[2]; - - mode_idx = INTER_OFFSET(this_mode); - bsi->rdstat[i][mode_idx].brdcost = INT64_MAX; - if (!(inter_mode_mask & (1 << this_mode))) - continue; - - if (!check_best_zero_mv(cpi, mbmi->mode_context, frame_mv, - this_mode, mbmi->ref_frame)) - continue; - - vpx_memcpy(orig_pre, pd->pre, sizeof(orig_pre)); - vpx_memcpy(bsi->rdstat[i][mode_idx].ta, t_above, - sizeof(bsi->rdstat[i][mode_idx].ta)); - vpx_memcpy(bsi->rdstat[i][mode_idx].tl, t_left, - sizeof(bsi->rdstat[i][mode_idx].tl)); - - // motion search for newmv (single predictor case only) - if (!has_second_rf && this_mode == NEWMV && - seg_mvs[i][mbmi->ref_frame[0]].as_int == INVALID_MV) { - MV *const new_mv = &mode_mv[NEWMV][0].as_mv; - int step_param = 0; - int thissme, bestsme = INT_MAX; - int sadpb = x->sadperbit4; - MV mvp_full; - int max_mv; - int cost_list[5]; - - /* Is the best so far sufficiently good that we cant justify doing - * and new motion search. */ - if (best_rd < label_mv_thresh) - break; - - if (cpi->oxcf.mode != BEST) { - // use previous block's result as next block's MV predictor. - if (i > 0) { - bsi->mvp.as_int = mi->bmi[i - 1].as_mv[0].as_int; - if (i == 2) - bsi->mvp.as_int = mi->bmi[i - 2].as_mv[0].as_int; - } - } - if (i == 0) - max_mv = x->max_mv_context[mbmi->ref_frame[0]]; - else - max_mv = MAX(abs(bsi->mvp.as_mv.row), abs(bsi->mvp.as_mv.col)) >> 3; - - if (cpi->sf.mv.auto_mv_step_size && cm->show_frame) { - // Take wtd average of the step_params based on the last frame's - // max mv magnitude and the best ref mvs of the current block for - // the given reference. - step_param = (vp9_init_search_range(max_mv) + - cpi->mv_step_param) / 2; - } else { - step_param = cpi->mv_step_param; - } - - mvp_full.row = bsi->mvp.as_mv.row >> 3; - mvp_full.col = bsi->mvp.as_mv.col >> 3; - - if (cpi->sf.adaptive_motion_search) { - mvp_full.row = x->pred_mv[mbmi->ref_frame[0]].row >> 3; - mvp_full.col = x->pred_mv[mbmi->ref_frame[0]].col >> 3; - step_param = MAX(step_param, 8); - } - - // adjust src pointer for this block - mi_buf_shift(x, i); - - vp9_set_mv_search_range(x, &bsi->ref_mv[0]->as_mv); - - bestsme = vp9_full_pixel_search( - cpi, x, bsize, &mvp_full, step_param, sadpb, - cpi->sf.mv.subpel_search_method != SUBPEL_TREE ? cost_list : NULL, - &bsi->ref_mv[0]->as_mv, new_mv, - INT_MAX, 1); - - // Should we do a full search (best quality only) - if (cpi->oxcf.mode == BEST) { - int_mv *const best_mv = &mi->bmi[i].as_mv[0]; - /* Check if mvp_full is within the range. */ - clamp_mv(&mvp_full, x->mv_col_min, x->mv_col_max, - x->mv_row_min, x->mv_row_max); - thissme = cpi->full_search_sad(x, &mvp_full, - sadpb, 16, &cpi->fn_ptr[bsize], - &bsi->ref_mv[0]->as_mv, - &best_mv->as_mv); - cost_list[1] = cost_list[2] = cost_list[3] = cost_list[4] = INT_MAX; - if (thissme < bestsme) { - bestsme = thissme; - *new_mv = best_mv->as_mv; - } else { - // The full search result is actually worse so re-instate the - // previous best vector - best_mv->as_mv = *new_mv; - } - } - - if (bestsme < INT_MAX) { - int distortion; - cpi->find_fractional_mv_step( - x, - new_mv, - &bsi->ref_mv[0]->as_mv, - cm->allow_high_precision_mv, - x->errorperbit, &cpi->fn_ptr[bsize], - cpi->sf.mv.subpel_force_stop, - cpi->sf.mv.subpel_iters_per_step, - cond_cost_list(cpi, cost_list), - x->nmvjointcost, x->mvcost, - &distortion, - &x->pred_sse[mbmi->ref_frame[0]], - NULL, 0, 0); - - // save motion search result for use in compound prediction - seg_mvs[i][mbmi->ref_frame[0]].as_mv = *new_mv; - } - - if (cpi->sf.adaptive_motion_search) - x->pred_mv[mbmi->ref_frame[0]] = *new_mv; - - // restore src pointers - mi_buf_restore(x, orig_src, orig_pre); - } - - if (has_second_rf) { - if (seg_mvs[i][mbmi->ref_frame[1]].as_int == INVALID_MV || - seg_mvs[i][mbmi->ref_frame[0]].as_int == INVALID_MV) - continue; - } - - if (has_second_rf && this_mode == NEWMV && - mbmi->interp_filter == EIGHTTAP) { - // adjust src pointers - mi_buf_shift(x, i); - if (cpi->sf.comp_inter_joint_search_thresh <= bsize) { - int rate_mv; - joint_motion_search(cpi, x, bsize, frame_mv[this_mode], - mi_row, mi_col, seg_mvs[i], - &rate_mv); - seg_mvs[i][mbmi->ref_frame[0]].as_int = - frame_mv[this_mode][mbmi->ref_frame[0]].as_int; - seg_mvs[i][mbmi->ref_frame[1]].as_int = - frame_mv[this_mode][mbmi->ref_frame[1]].as_int; - } - // restore src pointers - mi_buf_restore(x, orig_src, orig_pre); - } - - bsi->rdstat[i][mode_idx].brate = - set_and_cost_bmi_mvs(cpi, xd, i, this_mode, mode_mv[this_mode], - frame_mv, seg_mvs[i], bsi->ref_mv, - x->nmvjointcost, x->mvcost); - - for (ref = 0; ref < 1 + has_second_rf; ++ref) { - bsi->rdstat[i][mode_idx].mvs[ref].as_int = - mode_mv[this_mode][ref].as_int; - if (num_4x4_blocks_wide > 1) - bsi->rdstat[i + 1][mode_idx].mvs[ref].as_int = - mode_mv[this_mode][ref].as_int; - if (num_4x4_blocks_high > 1) - bsi->rdstat[i + 2][mode_idx].mvs[ref].as_int = - mode_mv[this_mode][ref].as_int; - } - - // Trap vectors that reach beyond the UMV borders - if (mv_check_bounds(x, &mode_mv[this_mode][0].as_mv) || - (has_second_rf && - mv_check_bounds(x, &mode_mv[this_mode][1].as_mv))) - continue; - - if (filter_idx > 0) { - BEST_SEG_INFO *ref_bsi = bsi_buf; - subpelmv = 0; - have_ref = 1; - - for (ref = 0; ref < 1 + has_second_rf; ++ref) { - subpelmv |= mv_has_subpel(&mode_mv[this_mode][ref].as_mv); - have_ref &= mode_mv[this_mode][ref].as_int == - ref_bsi->rdstat[i][mode_idx].mvs[ref].as_int; - } - - if (filter_idx > 1 && !subpelmv && !have_ref) { - ref_bsi = bsi_buf + 1; - have_ref = 1; - for (ref = 0; ref < 1 + has_second_rf; ++ref) - have_ref &= mode_mv[this_mode][ref].as_int == - ref_bsi->rdstat[i][mode_idx].mvs[ref].as_int; - } - - if (!subpelmv && have_ref && - ref_bsi->rdstat[i][mode_idx].brdcost < INT64_MAX) { - vpx_memcpy(&bsi->rdstat[i][mode_idx], &ref_bsi->rdstat[i][mode_idx], - sizeof(SEG_RDSTAT)); - if (num_4x4_blocks_wide > 1) - bsi->rdstat[i + 1][mode_idx].eobs = - ref_bsi->rdstat[i + 1][mode_idx].eobs; - if (num_4x4_blocks_high > 1) - bsi->rdstat[i + 2][mode_idx].eobs = - ref_bsi->rdstat[i + 2][mode_idx].eobs; - - if (bsi->rdstat[i][mode_idx].brdcost < best_rd) { - mode_selected = this_mode; - best_rd = bsi->rdstat[i][mode_idx].brdcost; - } - continue; - } - } - - bsi->rdstat[i][mode_idx].brdcost = - encode_inter_mb_segment(cpi, x, - bsi->segment_rd - this_segment_rd, i, - &bsi->rdstat[i][mode_idx].byrate, - &bsi->rdstat[i][mode_idx].bdist, - &bsi->rdstat[i][mode_idx].bsse, - bsi->rdstat[i][mode_idx].ta, - bsi->rdstat[i][mode_idx].tl, - mi_row, mi_col); - if (bsi->rdstat[i][mode_idx].brdcost < INT64_MAX) { - bsi->rdstat[i][mode_idx].brdcost += RDCOST(x->rdmult, x->rddiv, - bsi->rdstat[i][mode_idx].brate, 0); - bsi->rdstat[i][mode_idx].brate += bsi->rdstat[i][mode_idx].byrate; - bsi->rdstat[i][mode_idx].eobs = p->eobs[i]; - if (num_4x4_blocks_wide > 1) - bsi->rdstat[i + 1][mode_idx].eobs = p->eobs[i + 1]; - if (num_4x4_blocks_high > 1) - bsi->rdstat[i + 2][mode_idx].eobs = p->eobs[i + 2]; - } - - if (bsi->rdstat[i][mode_idx].brdcost < best_rd) { - mode_selected = this_mode; - best_rd = bsi->rdstat[i][mode_idx].brdcost; - } - } /*for each 4x4 mode*/ - - if (best_rd == INT64_MAX) { - int iy, midx; - for (iy = i + 1; iy < 4; ++iy) - for (midx = 0; midx < INTER_MODES; ++midx) - bsi->rdstat[iy][midx].brdcost = INT64_MAX; - bsi->segment_rd = INT64_MAX; - return INT64_MAX; - } - - mode_idx = INTER_OFFSET(mode_selected); - vpx_memcpy(t_above, bsi->rdstat[i][mode_idx].ta, sizeof(t_above)); - vpx_memcpy(t_left, bsi->rdstat[i][mode_idx].tl, sizeof(t_left)); - - set_and_cost_bmi_mvs(cpi, xd, i, mode_selected, mode_mv[mode_selected], - frame_mv, seg_mvs[i], bsi->ref_mv, x->nmvjointcost, - x->mvcost); - - br += bsi->rdstat[i][mode_idx].brate; - bd += bsi->rdstat[i][mode_idx].bdist; - block_sse += bsi->rdstat[i][mode_idx].bsse; - segmentyrate += bsi->rdstat[i][mode_idx].byrate; - this_segment_rd += bsi->rdstat[i][mode_idx].brdcost; - - if (this_segment_rd > bsi->segment_rd) { - int iy, midx; - for (iy = i + 1; iy < 4; ++iy) - for (midx = 0; midx < INTER_MODES; ++midx) - bsi->rdstat[iy][midx].brdcost = INT64_MAX; - bsi->segment_rd = INT64_MAX; - return INT64_MAX; - } - } - } /* for each label */ - - bsi->r = br; - bsi->d = bd; - bsi->segment_yrate = segmentyrate; - bsi->segment_rd = this_segment_rd; - bsi->sse = block_sse; - - // update the coding decisions - for (k = 0; k < 4; ++k) - bsi->modes[k] = mi->bmi[k].as_mode; - - if (bsi->segment_rd > best_rd) - return INT64_MAX; - /* set it to the best */ - for (i = 0; i < 4; i++) { - mode_idx = INTER_OFFSET(bsi->modes[i]); - mi->bmi[i].as_mv[0].as_int = bsi->rdstat[i][mode_idx].mvs[0].as_int; - if (has_second_ref(mbmi)) - mi->bmi[i].as_mv[1].as_int = bsi->rdstat[i][mode_idx].mvs[1].as_int; - x->plane[0].eobs[i] = bsi->rdstat[i][mode_idx].eobs; - mi->bmi[i].as_mode = bsi->modes[i]; - } - - /* - * used to set mbmi->mv.as_int - */ - *returntotrate = bsi->r; - *returndistortion = bsi->d; - *returnyrate = bsi->segment_yrate; - *skippable = vp9_is_skippable_in_plane(x, BLOCK_8X8, 0); - *psse = bsi->sse; - mbmi->mode = bsi->modes[3]; - - return bsi->segment_rd; -} - -static void estimate_ref_frame_costs(const VP9_COMMON *cm, - const MACROBLOCKD *xd, - int segment_id, - unsigned int *ref_costs_single, - unsigned int *ref_costs_comp, - vp9_prob *comp_mode_p) { - int seg_ref_active = vp9_segfeature_active(&cm->seg, segment_id, - SEG_LVL_REF_FRAME); - if (seg_ref_active) { - vpx_memset(ref_costs_single, 0, MAX_REF_FRAMES * sizeof(*ref_costs_single)); - vpx_memset(ref_costs_comp, 0, MAX_REF_FRAMES * sizeof(*ref_costs_comp)); - *comp_mode_p = 128; - } else { - vp9_prob intra_inter_p = vp9_get_intra_inter_prob(cm, xd); - vp9_prob comp_inter_p = 128; - - if (cm->reference_mode == REFERENCE_MODE_SELECT) { - comp_inter_p = vp9_get_reference_mode_prob(cm, xd); - *comp_mode_p = comp_inter_p; - } else { - *comp_mode_p = 128; - } - - ref_costs_single[INTRA_FRAME] = vp9_cost_bit(intra_inter_p, 0); - - if (cm->reference_mode != COMPOUND_REFERENCE) { - vp9_prob ref_single_p1 = vp9_get_pred_prob_single_ref_p1(cm, xd); - vp9_prob ref_single_p2 = vp9_get_pred_prob_single_ref_p2(cm, xd); - unsigned int base_cost = vp9_cost_bit(intra_inter_p, 1); - - if (cm->reference_mode == REFERENCE_MODE_SELECT) - base_cost += vp9_cost_bit(comp_inter_p, 0); - - ref_costs_single[LAST_FRAME] = ref_costs_single[GOLDEN_FRAME] = - ref_costs_single[ALTREF_FRAME] = base_cost; - ref_costs_single[LAST_FRAME] += vp9_cost_bit(ref_single_p1, 0); - ref_costs_single[GOLDEN_FRAME] += vp9_cost_bit(ref_single_p1, 1); - ref_costs_single[ALTREF_FRAME] += vp9_cost_bit(ref_single_p1, 1); - ref_costs_single[GOLDEN_FRAME] += vp9_cost_bit(ref_single_p2, 0); - ref_costs_single[ALTREF_FRAME] += vp9_cost_bit(ref_single_p2, 1); - } else { - ref_costs_single[LAST_FRAME] = 512; - ref_costs_single[GOLDEN_FRAME] = 512; - ref_costs_single[ALTREF_FRAME] = 512; - } - if (cm->reference_mode != SINGLE_REFERENCE) { - vp9_prob ref_comp_p = vp9_get_pred_prob_comp_ref_p(cm, xd); - unsigned int base_cost = vp9_cost_bit(intra_inter_p, 1); - - if (cm->reference_mode == REFERENCE_MODE_SELECT) - base_cost += vp9_cost_bit(comp_inter_p, 1); - - ref_costs_comp[LAST_FRAME] = base_cost + vp9_cost_bit(ref_comp_p, 0); - ref_costs_comp[GOLDEN_FRAME] = base_cost + vp9_cost_bit(ref_comp_p, 1); - } else { - ref_costs_comp[LAST_FRAME] = 512; - ref_costs_comp[GOLDEN_FRAME] = 512; - } - } -} - -static void store_coding_context(MACROBLOCK *x, PICK_MODE_CONTEXT *ctx, - int mode_index, - int64_t comp_pred_diff[REFERENCE_MODES], - const int64_t tx_size_diff[TX_MODES], - int64_t best_filter_diff[SWITCHABLE_FILTER_CONTEXTS], - int skippable) { - MACROBLOCKD *const xd = &x->e_mbd; - - // Take a snapshot of the coding context so it can be - // restored if we decide to encode this way - ctx->skip = x->skip; - ctx->skippable = skippable; - ctx->best_mode_index = mode_index; - ctx->mic = *xd->mi[0].src_mi; - ctx->single_pred_diff = (int)comp_pred_diff[SINGLE_REFERENCE]; - ctx->comp_pred_diff = (int)comp_pred_diff[COMPOUND_REFERENCE]; - ctx->hybrid_pred_diff = (int)comp_pred_diff[REFERENCE_MODE_SELECT]; - - vpx_memcpy(ctx->tx_rd_diff, tx_size_diff, sizeof(ctx->tx_rd_diff)); - vpx_memcpy(ctx->best_filter_diff, best_filter_diff, - sizeof(*best_filter_diff) * SWITCHABLE_FILTER_CONTEXTS); -} - -static void setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x, - const TileInfo *const tile, - MV_REFERENCE_FRAME ref_frame, - BLOCK_SIZE block_size, - int mi_row, int mi_col, - int_mv frame_nearest_mv[MAX_REF_FRAMES], - int_mv frame_near_mv[MAX_REF_FRAMES], - struct buf_2d yv12_mb[4][MAX_MB_PLANE]) { - const VP9_COMMON *cm = &cpi->common; - const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_buffer(cpi, ref_frame); - MACROBLOCKD *const xd = &x->e_mbd; - MODE_INFO *const mi = xd->mi[0].src_mi; - int_mv *const candidates = mi->mbmi.ref_mvs[ref_frame]; - const struct scale_factors *const sf = &cm->frame_refs[ref_frame - 1].sf; - - assert(yv12 != NULL); - - // TODO(jkoleszar): Is the UV buffer ever used here? If so, need to make this - // use the UV scaling factors. - vp9_setup_pred_block(xd, yv12_mb[ref_frame], yv12, mi_row, mi_col, sf, sf); - - // Gets an initial list of candidate vectors from neighbours and orders them - vp9_find_mv_refs(cm, xd, tile, mi, ref_frame, candidates, mi_row, mi_col, - NULL, NULL); - - // Candidate refinement carried out at encoder and decoder - vp9_find_best_ref_mvs(xd, cm->allow_high_precision_mv, candidates, - &frame_nearest_mv[ref_frame], - &frame_near_mv[ref_frame]); - - // Further refinement that is encode side only to test the top few candidates - // in full and choose the best as the centre point for subsequent searches. - // The current implementation doesn't support scaling. - if (!vp9_is_scaled(sf) && block_size >= BLOCK_8X8) - vp9_mv_pred(cpi, x, yv12_mb[ref_frame][0].buf, yv12->y_stride, - ref_frame, block_size); -} - -static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x, - BLOCK_SIZE bsize, - int mi_row, int mi_col, - int_mv *tmp_mv, int *rate_mv) { - MACROBLOCKD *xd = &x->e_mbd; - const VP9_COMMON *cm = &cpi->common; - MB_MODE_INFO *mbmi = &xd->mi[0].src_mi->mbmi; - struct buf_2d backup_yv12[MAX_MB_PLANE] = {{0, 0}}; - int bestsme = INT_MAX; - int step_param; - int sadpb = x->sadperbit16; - MV mvp_full; - int ref = mbmi->ref_frame[0]; - MV ref_mv = mbmi->ref_mvs[ref][0].as_mv; - - int tmp_col_min = x->mv_col_min; - int tmp_col_max = x->mv_col_max; - int tmp_row_min = x->mv_row_min; - int tmp_row_max = x->mv_row_max; - int cost_list[5]; - - const YV12_BUFFER_CONFIG *scaled_ref_frame = vp9_get_scaled_ref_frame(cpi, - ref); - - MV pred_mv[3]; - pred_mv[0] = mbmi->ref_mvs[ref][0].as_mv; - pred_mv[1] = mbmi->ref_mvs[ref][1].as_mv; - pred_mv[2] = x->pred_mv[ref]; - - if (scaled_ref_frame) { - int i; - // Swap out the reference frame for a version that's been scaled to - // match the resolution of the current frame, allowing the existing - // motion search code to be used without additional modifications. - for (i = 0; i < MAX_MB_PLANE; i++) - backup_yv12[i] = xd->plane[i].pre[0]; - - vp9_setup_pre_planes(xd, 0, scaled_ref_frame, mi_row, mi_col, NULL); - } - - vp9_set_mv_search_range(x, &ref_mv); - - // Work out the size of the first step in the mv step search. - // 0 here is maximum length first step. 1 is MAX >> 1 etc. - if (cpi->sf.mv.auto_mv_step_size && cm->show_frame) { - // Take wtd average of the step_params based on the last frame's - // max mv magnitude and that based on the best ref mvs of the current - // block for the given reference. - step_param = (vp9_init_search_range(x->max_mv_context[ref]) + - cpi->mv_step_param) / 2; - } else { - step_param = cpi->mv_step_param; - } - - if (cpi->sf.adaptive_motion_search && bsize < BLOCK_64X64) { - int boffset = 2 * (b_width_log2_lookup[BLOCK_64X64] - - MIN(b_height_log2_lookup[bsize], b_width_log2_lookup[bsize])); - step_param = MAX(step_param, boffset); - } - - if (cpi->sf.adaptive_motion_search) { - int bwl = b_width_log2_lookup[bsize]; - int bhl = b_height_log2_lookup[bsize]; - int tlevel = x->pred_mv_sad[ref] >> (bwl + bhl + 4); - - if (tlevel < 5) - step_param += 2; - - // prev_mv_sad is not setup for dynamically scaled frames. - if (cpi->oxcf.resize_mode != RESIZE_DYNAMIC) { - int i; - for (i = LAST_FRAME; i <= ALTREF_FRAME && cm->show_frame; ++i) { - if ((x->pred_mv_sad[ref] >> 3) > x->pred_mv_sad[i]) { - x->pred_mv[ref].row = 0; - x->pred_mv[ref].col = 0; - tmp_mv->as_int = INVALID_MV; - - if (scaled_ref_frame) { - int i; - for (i = 0; i < MAX_MB_PLANE; ++i) - xd->plane[i].pre[0] = backup_yv12[i]; - } - return; - } - } - } - } - - mvp_full = pred_mv[x->mv_best_ref_index[ref]]; - - mvp_full.col >>= 3; - mvp_full.row >>= 3; - - bestsme = vp9_full_pixel_search(cpi, x, bsize, &mvp_full, step_param, sadpb, - cond_cost_list(cpi, cost_list), - &ref_mv, &tmp_mv->as_mv, INT_MAX, 1); - - x->mv_col_min = tmp_col_min; - x->mv_col_max = tmp_col_max; - x->mv_row_min = tmp_row_min; - x->mv_row_max = tmp_row_max; - - if (bestsme < INT_MAX) { - int dis; /* TODO: use dis in distortion calculation later. */ - cpi->find_fractional_mv_step(x, &tmp_mv->as_mv, &ref_mv, - cm->allow_high_precision_mv, - x->errorperbit, - &cpi->fn_ptr[bsize], - cpi->sf.mv.subpel_force_stop, - cpi->sf.mv.subpel_iters_per_step, - cond_cost_list(cpi, cost_list), - x->nmvjointcost, x->mvcost, - &dis, &x->pred_sse[ref], NULL, 0, 0); - } - *rate_mv = vp9_mv_bit_cost(&tmp_mv->as_mv, &ref_mv, - x->nmvjointcost, x->mvcost, MV_COST_WEIGHT); - - if (cpi->sf.adaptive_motion_search) - x->pred_mv[ref] = tmp_mv->as_mv; - - if (scaled_ref_frame) { - int i; - for (i = 0; i < MAX_MB_PLANE; i++) - xd->plane[i].pre[0] = backup_yv12[i]; - } -} - - - -static INLINE void restore_dst_buf(MACROBLOCKD *xd, - uint8_t *orig_dst[MAX_MB_PLANE], - int orig_dst_stride[MAX_MB_PLANE]) { - int i; - for (i = 0; i < MAX_MB_PLANE; i++) { - xd->plane[i].dst.buf = orig_dst[i]; - xd->plane[i].dst.stride = orig_dst_stride[i]; - } -} - -// In some situations we want to discount tha pparent cost of a new motion -// vector. Where there is a subtle motion field and especially where there is -// low spatial complexity then it can be hard to cover the cost of a new motion -// vector in a single block, even if that motion vector reduces distortion. -// However, once established that vector may be usable through the nearest and -// near mv modes to reduce distortion in subsequent blocks and also improve -// visual quality. -static int discount_newmv_test(const VP9_COMP *cpi, - int this_mode, - int_mv this_mv, - int_mv (*mode_mv)[MAX_REF_FRAMES], - int ref_frame) { - return (!cpi->rc.is_src_frame_alt_ref && - (this_mode == NEWMV) && - (this_mv.as_int != 0) && - ((mode_mv[NEARESTMV][ref_frame].as_int == 0) || - (mode_mv[NEARESTMV][ref_frame].as_int == INVALID_MV)) && - ((mode_mv[NEARMV][ref_frame].as_int == 0) || - (mode_mv[NEARMV][ref_frame].as_int == INVALID_MV))); -} - -static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, - BLOCK_SIZE bsize, - int64_t txfm_cache[], - int *rate2, int64_t *distortion, - int *skippable, - int *rate_y, int *rate_uv, - int *disable_skip, - int_mv (*mode_mv)[MAX_REF_FRAMES], - int mi_row, int mi_col, - int_mv single_newmv[MAX_REF_FRAMES], - INTERP_FILTER (*single_filter)[MAX_REF_FRAMES], - int (*single_skippable)[MAX_REF_FRAMES], - int64_t *psse, - const int64_t ref_best_rd, - int64_t *mask_filter, - int64_t filter_cache[]) { - VP9_COMMON *cm = &cpi->common; - MACROBLOCKD *xd = &x->e_mbd; - MB_MODE_INFO *mbmi = &xd->mi[0].src_mi->mbmi; - const int is_comp_pred = has_second_ref(mbmi); - const int this_mode = mbmi->mode; - int_mv *frame_mv = mode_mv[this_mode]; - int i; - int refs[2] = { mbmi->ref_frame[0], - (mbmi->ref_frame[1] < 0 ? 0 : mbmi->ref_frame[1]) }; - int_mv cur_mv[2]; -#if CONFIG_VP9_HIGHBITDEPTH - DECLARE_ALIGNED_ARRAY(16, uint16_t, tmp_buf16, MAX_MB_PLANE * 64 * 64); - DECLARE_ALIGNED_ARRAY(16, uint8_t, tmp_buf8, MAX_MB_PLANE * 64 * 64); - uint8_t *tmp_buf; -#else - DECLARE_ALIGNED_ARRAY(16, uint8_t, tmp_buf, MAX_MB_PLANE * 64 * 64); -#endif // CONFIG_VP9_HIGHBITDEPTH - int pred_exists = 0; - int intpel_mv; - int64_t rd, tmp_rd, best_rd = INT64_MAX; - int best_needs_copy = 0; - uint8_t *orig_dst[MAX_MB_PLANE]; - int orig_dst_stride[MAX_MB_PLANE]; - int rs = 0; - INTERP_FILTER best_filter = SWITCHABLE; - uint8_t skip_txfm[MAX_MB_PLANE << 2] = {0}; - int64_t bsse[MAX_MB_PLANE << 2] = {0}; - - int bsl = mi_width_log2_lookup[bsize]; - int pred_filter_search = cpi->sf.cb_pred_filter_search ? - (((mi_row + mi_col) >> bsl) + - get_chessboard_index(cm->current_video_frame)) & 0x1 : 0; - - int skip_txfm_sb = 0; - int64_t skip_sse_sb = INT64_MAX; - int64_t distortion_y = 0, distortion_uv = 0; - -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - tmp_buf = CONVERT_TO_BYTEPTR(tmp_buf16); - } else { - tmp_buf = tmp_buf8; - } -#endif // CONFIG_VP9_HIGHBITDEPTH - - if (pred_filter_search) { - INTERP_FILTER af = SWITCHABLE, lf = SWITCHABLE; - if (xd->up_available) - af = xd->mi[-xd->mi_stride].src_mi->mbmi.interp_filter; - if (xd->left_available) - lf = xd->mi[-1].src_mi->mbmi.interp_filter; - - if ((this_mode != NEWMV) || (af == lf)) - best_filter = af; - } - - if (is_comp_pred) { - if (frame_mv[refs[0]].as_int == INVALID_MV || - frame_mv[refs[1]].as_int == INVALID_MV) - return INT64_MAX; - - if (cpi->sf.adaptive_mode_search) { - if (single_filter[this_mode][refs[0]] == - single_filter[this_mode][refs[1]]) - best_filter = single_filter[this_mode][refs[0]]; - } - } - - if (this_mode == NEWMV) { - int rate_mv; - if (is_comp_pred) { - // Initialize mv using single prediction mode result. - frame_mv[refs[0]].as_int = single_newmv[refs[0]].as_int; - frame_mv[refs[1]].as_int = single_newmv[refs[1]].as_int; - - if (cpi->sf.comp_inter_joint_search_thresh <= bsize) { - joint_motion_search(cpi, x, bsize, frame_mv, - mi_row, mi_col, single_newmv, &rate_mv); - } else { - rate_mv = vp9_mv_bit_cost(&frame_mv[refs[0]].as_mv, - &mbmi->ref_mvs[refs[0]][0].as_mv, - x->nmvjointcost, x->mvcost, MV_COST_WEIGHT); - rate_mv += vp9_mv_bit_cost(&frame_mv[refs[1]].as_mv, - &mbmi->ref_mvs[refs[1]][0].as_mv, - x->nmvjointcost, x->mvcost, MV_COST_WEIGHT); - } - *rate2 += rate_mv; - } else { - int_mv tmp_mv; - single_motion_search(cpi, x, bsize, mi_row, mi_col, - &tmp_mv, &rate_mv); - if (tmp_mv.as_int == INVALID_MV) - return INT64_MAX; - - frame_mv[refs[0]].as_int = - xd->mi[0].src_mi->bmi[0].as_mv[0].as_int = tmp_mv.as_int; - single_newmv[refs[0]].as_int = tmp_mv.as_int; - - // Estimate the rate implications of a new mv but discount this - // under certain circumstances where we want to help initiate a weak - // motion field, where the distortion gain for a single block may not - // be enough to overcome the cost of a new mv. - if (discount_newmv_test(cpi, this_mode, tmp_mv, mode_mv, refs[0])) { - *rate2 += MAX((rate_mv / NEW_MV_DISCOUNT_FACTOR), 1); - } else { - *rate2 += rate_mv; - } - } - } - - for (i = 0; i < is_comp_pred + 1; ++i) { - cur_mv[i] = frame_mv[refs[i]]; - // Clip "next_nearest" so that it does not extend to far out of image - if (this_mode != NEWMV) - clamp_mv2(&cur_mv[i].as_mv, xd); - - if (mv_check_bounds(x, &cur_mv[i].as_mv)) - return INT64_MAX; - mbmi->mv[i].as_int = cur_mv[i].as_int; - } - - // do first prediction into the destination buffer. Do the next - // prediction into a temporary buffer. Then keep track of which one - // of these currently holds the best predictor, and use the other - // one for future predictions. In the end, copy from tmp_buf to - // dst if necessary. - for (i = 0; i < MAX_MB_PLANE; i++) { - orig_dst[i] = xd->plane[i].dst.buf; - orig_dst_stride[i] = xd->plane[i].dst.stride; - } - - // We don't include the cost of the second reference here, because there - // are only three options: Last/Golden, ARF/Last or Golden/ARF, or in other - // words if you present them in that order, the second one is always known - // if the first is known. - // - // Under some circumstances we discount the cost of new mv mode to encourage - // initiation of a motion field. - if (discount_newmv_test(cpi, this_mode, frame_mv[refs[0]], - mode_mv, refs[0])) { - *rate2 += MIN(cost_mv_ref(cpi, this_mode, mbmi->mode_context[refs[0]]), - cost_mv_ref(cpi, NEARESTMV, mbmi->mode_context[refs[0]])); - } else { - *rate2 += cost_mv_ref(cpi, this_mode, mbmi->mode_context[refs[0]]); - } - - if (RDCOST(x->rdmult, x->rddiv, *rate2, 0) > ref_best_rd && - mbmi->mode != NEARESTMV) - return INT64_MAX; - - pred_exists = 0; - // Are all MVs integer pel for Y and UV - intpel_mv = !mv_has_subpel(&mbmi->mv[0].as_mv); - if (is_comp_pred) - intpel_mv &= !mv_has_subpel(&mbmi->mv[1].as_mv); - - // Search for best switchable filter by checking the variance of - // pred error irrespective of whether the filter will be used - for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i) - filter_cache[i] = INT64_MAX; - - if (cm->interp_filter != BILINEAR) { - if (x->source_variance < cpi->sf.disable_filter_search_var_thresh) { - best_filter = EIGHTTAP; - } else if (best_filter == SWITCHABLE) { - int newbest; - int tmp_rate_sum = 0; - int64_t tmp_dist_sum = 0; - - for (i = 0; i < SWITCHABLE_FILTERS; ++i) { - int j; - int64_t rs_rd; - int tmp_skip_sb = 0; - int64_t tmp_skip_sse = INT64_MAX; - - mbmi->interp_filter = i; - rs = vp9_get_switchable_rate(cpi, xd); - rs_rd = RDCOST(x->rdmult, x->rddiv, rs, 0); - - if (i > 0 && intpel_mv) { - rd = RDCOST(x->rdmult, x->rddiv, tmp_rate_sum, tmp_dist_sum); - filter_cache[i] = rd; - filter_cache[SWITCHABLE_FILTERS] = - MIN(filter_cache[SWITCHABLE_FILTERS], rd + rs_rd); - if (cm->interp_filter == SWITCHABLE) - rd += rs_rd; - *mask_filter = MAX(*mask_filter, rd); - } else { - int rate_sum = 0; - int64_t dist_sum = 0; - if (i > 0 && cpi->sf.adaptive_interp_filter_search && - (cpi->sf.interp_filter_search_mask & (1 << i))) { - rate_sum = INT_MAX; - dist_sum = INT64_MAX; - continue; - } - - if ((cm->interp_filter == SWITCHABLE && - (!i || best_needs_copy)) || - (cm->interp_filter != SWITCHABLE && - (cm->interp_filter == mbmi->interp_filter || - (i == 0 && intpel_mv)))) { - restore_dst_buf(xd, orig_dst, orig_dst_stride); - } else { - for (j = 0; j < MAX_MB_PLANE; j++) { - xd->plane[j].dst.buf = tmp_buf + j * 64 * 64; - xd->plane[j].dst.stride = 64; - } - } - vp9_build_inter_predictors_sb(xd, mi_row, mi_col, bsize); - model_rd_for_sb(cpi, bsize, x, xd, &rate_sum, &dist_sum, - &tmp_skip_sb, &tmp_skip_sse); - - rd = RDCOST(x->rdmult, x->rddiv, rate_sum, dist_sum); - filter_cache[i] = rd; - filter_cache[SWITCHABLE_FILTERS] = - MIN(filter_cache[SWITCHABLE_FILTERS], rd + rs_rd); - if (cm->interp_filter == SWITCHABLE) - rd += rs_rd; - *mask_filter = MAX(*mask_filter, rd); - - if (i == 0 && intpel_mv) { - tmp_rate_sum = rate_sum; - tmp_dist_sum = dist_sum; - } - } - - if (i == 0 && cpi->sf.use_rd_breakout && ref_best_rd < INT64_MAX) { - if (rd / 2 > ref_best_rd) { - restore_dst_buf(xd, orig_dst, orig_dst_stride); - return INT64_MAX; - } - } - newbest = i == 0 || rd < best_rd; - - if (newbest) { - best_rd = rd; - best_filter = mbmi->interp_filter; - if (cm->interp_filter == SWITCHABLE && i && !intpel_mv) - best_needs_copy = !best_needs_copy; - } - - if ((cm->interp_filter == SWITCHABLE && newbest) || - (cm->interp_filter != SWITCHABLE && - cm->interp_filter == mbmi->interp_filter)) { - pred_exists = 1; - tmp_rd = best_rd; - - skip_txfm_sb = tmp_skip_sb; - skip_sse_sb = tmp_skip_sse; - vpx_memcpy(skip_txfm, x->skip_txfm, sizeof(skip_txfm)); - vpx_memcpy(bsse, x->bsse, sizeof(bsse)); - } - } - restore_dst_buf(xd, orig_dst, orig_dst_stride); - } - } - // Set the appropriate filter - mbmi->interp_filter = cm->interp_filter != SWITCHABLE ? - cm->interp_filter : best_filter; - rs = cm->interp_filter == SWITCHABLE ? vp9_get_switchable_rate(cpi, xd) : 0; - - if (pred_exists) { - if (best_needs_copy) { - // again temporarily set the buffers to local memory to prevent a memcpy - for (i = 0; i < MAX_MB_PLANE; i++) { - xd->plane[i].dst.buf = tmp_buf + i * 64 * 64; - xd->plane[i].dst.stride = 64; - } - } - rd = tmp_rd + RDCOST(x->rdmult, x->rddiv, rs, 0); - } else { - int tmp_rate; - int64_t tmp_dist; - // Handles the special case when a filter that is not in the - // switchable list (ex. bilinear) is indicated at the frame level, or - // skip condition holds. - vp9_build_inter_predictors_sb(xd, mi_row, mi_col, bsize); - model_rd_for_sb(cpi, bsize, x, xd, &tmp_rate, &tmp_dist, - &skip_txfm_sb, &skip_sse_sb); - rd = RDCOST(x->rdmult, x->rddiv, rs + tmp_rate, tmp_dist); - vpx_memcpy(skip_txfm, x->skip_txfm, sizeof(skip_txfm)); - vpx_memcpy(bsse, x->bsse, sizeof(bsse)); - } - - if (!is_comp_pred) - single_filter[this_mode][refs[0]] = mbmi->interp_filter; - - if (cpi->sf.adaptive_mode_search) - if (is_comp_pred) - if (single_skippable[this_mode][refs[0]] && - single_skippable[this_mode][refs[1]]) - vpx_memset(skip_txfm, 1, sizeof(skip_txfm)); - - if (cpi->sf.use_rd_breakout && ref_best_rd < INT64_MAX) { - // if current pred_error modeled rd is substantially more than the best - // so far, do not bother doing full rd - if (rd / 2 > ref_best_rd) { - restore_dst_buf(xd, orig_dst, orig_dst_stride); - return INT64_MAX; - } - } - - if (cm->interp_filter == SWITCHABLE) - *rate2 += rs; - - vpx_memcpy(x->skip_txfm, skip_txfm, sizeof(skip_txfm)); - vpx_memcpy(x->bsse, bsse, sizeof(bsse)); - - if (!skip_txfm_sb) { - int skippable_y, skippable_uv; - int64_t sseuv = INT64_MAX; - int64_t rdcosty = INT64_MAX; - - // Y cost and distortion - vp9_subtract_plane(x, bsize, 0); - super_block_yrd(cpi, x, rate_y, &distortion_y, &skippable_y, psse, - bsize, txfm_cache, ref_best_rd); - - if (*rate_y == INT_MAX) { - *rate2 = INT_MAX; - *distortion = INT64_MAX; - restore_dst_buf(xd, orig_dst, orig_dst_stride); - return INT64_MAX; - } - - *rate2 += *rate_y; - *distortion += distortion_y; - - rdcosty = RDCOST(x->rdmult, x->rddiv, *rate2, *distortion); - rdcosty = MIN(rdcosty, RDCOST(x->rdmult, x->rddiv, 0, *psse)); - - if (!super_block_uvrd(cpi, x, rate_uv, &distortion_uv, &skippable_uv, - &sseuv, bsize, ref_best_rd - rdcosty)) { - *rate2 = INT_MAX; - *distortion = INT64_MAX; - restore_dst_buf(xd, orig_dst, orig_dst_stride); - return INT64_MAX; - } - - *psse += sseuv; - *rate2 += *rate_uv; - *distortion += distortion_uv; - *skippable = skippable_y && skippable_uv; - } else { - x->skip = 1; - *disable_skip = 1; - - // The cost of skip bit needs to be added. - *rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 1); - - *distortion = skip_sse_sb; - } - - if (!is_comp_pred) - single_skippable[this_mode][refs[0]] = *skippable; - - restore_dst_buf(xd, orig_dst, orig_dst_stride); - return 0; // The rate-distortion cost will be re-calculated by caller. -} - -void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, - RD_COST *rd_cost, BLOCK_SIZE bsize, - PICK_MODE_CONTEXT *ctx, int64_t best_rd) { - VP9_COMMON *const cm = &cpi->common; - MACROBLOCKD *const xd = &x->e_mbd; - struct macroblockd_plane *const pd = xd->plane; - int rate_y = 0, rate_uv = 0, rate_y_tokenonly = 0, rate_uv_tokenonly = 0; - int y_skip = 0, uv_skip = 0; - int64_t dist_y = 0, dist_uv = 0, tx_cache[TX_MODES] = { 0 }; - TX_SIZE max_uv_tx_size; - x->skip_encode = 0; - ctx->skip = 0; - xd->mi[0].src_mi->mbmi.ref_frame[0] = INTRA_FRAME; - xd->mi[0].src_mi->mbmi.ref_frame[1] = NONE; - - if (bsize >= BLOCK_8X8) { - if (rd_pick_intra_sby_mode(cpi, x, &rate_y, &rate_y_tokenonly, - &dist_y, &y_skip, bsize, tx_cache, - best_rd) >= best_rd) { - rd_cost->rate = INT_MAX; - return; - } - } else { - y_skip = 0; - if (rd_pick_intra_sub_8x8_y_mode(cpi, x, &rate_y, &rate_y_tokenonly, - &dist_y, best_rd) >= best_rd) { - rd_cost->rate = INT_MAX; - return; - } - } - max_uv_tx_size = get_uv_tx_size_impl(xd->mi[0].src_mi->mbmi.tx_size, bsize, - pd[1].subsampling_x, - pd[1].subsampling_y); - rd_pick_intra_sbuv_mode(cpi, x, ctx, &rate_uv, &rate_uv_tokenonly, - &dist_uv, &uv_skip, MAX(BLOCK_8X8, bsize), - max_uv_tx_size); - - if (y_skip && uv_skip) { - rd_cost->rate = rate_y + rate_uv - rate_y_tokenonly - rate_uv_tokenonly + - vp9_cost_bit(vp9_get_skip_prob(cm, xd), 1); - rd_cost->dist = dist_y + dist_uv; - vp9_zero(ctx->tx_rd_diff); - } else { - int i; - rd_cost->rate = rate_y + rate_uv + - vp9_cost_bit(vp9_get_skip_prob(cm, xd), 0); - rd_cost->dist = dist_y + dist_uv; - if (cpi->sf.tx_size_search_method == USE_FULL_RD) - for (i = 0; i < TX_MODES; i++) { - if (tx_cache[i] < INT64_MAX && tx_cache[cm->tx_mode] < INT64_MAX) - ctx->tx_rd_diff[i] = tx_cache[i] - tx_cache[cm->tx_mode]; - else - ctx->tx_rd_diff[i] = 0; - } - } - - ctx->mic = *xd->mi[0].src_mi; - rd_cost->rdcost = RDCOST(x->rdmult, x->rddiv, rd_cost->rate, rd_cost->dist); -} - -void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, - TileDataEnc *tile_data, - MACROBLOCK *x, - int mi_row, int mi_col, - RD_COST *rd_cost, BLOCK_SIZE bsize, - PICK_MODE_CONTEXT *ctx, - int64_t best_rd_so_far) { - VP9_COMMON *const cm = &cpi->common; - TileInfo *const tile_info = &tile_data->tile_info; - RD_OPT *const rd_opt = &cpi->rd; - SPEED_FEATURES *const sf = &cpi->sf; - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi; - const struct segmentation *const seg = &cm->seg; - PREDICTION_MODE this_mode; - MV_REFERENCE_FRAME ref_frame, second_ref_frame; - unsigned char segment_id = mbmi->segment_id; - int comp_pred, i, k; - int_mv frame_mv[MB_MODE_COUNT][MAX_REF_FRAMES]; - struct buf_2d yv12_mb[4][MAX_MB_PLANE]; - int_mv single_newmv[MAX_REF_FRAMES] = { { 0 } }; - INTERP_FILTER single_inter_filter[MB_MODE_COUNT][MAX_REF_FRAMES]; - int single_skippable[MB_MODE_COUNT][MAX_REF_FRAMES]; - static const int flag_list[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG, - VP9_ALT_FLAG }; - int64_t best_rd = best_rd_so_far; - int64_t best_tx_rd[TX_MODES]; - int64_t best_tx_diff[TX_MODES]; - int64_t best_pred_diff[REFERENCE_MODES]; - int64_t best_pred_rd[REFERENCE_MODES]; - int64_t best_filter_rd[SWITCHABLE_FILTER_CONTEXTS]; - int64_t best_filter_diff[SWITCHABLE_FILTER_CONTEXTS]; - MB_MODE_INFO best_mbmode; - int best_mode_skippable = 0; - int midx, best_mode_index = -1; - unsigned int ref_costs_single[MAX_REF_FRAMES], ref_costs_comp[MAX_REF_FRAMES]; - vp9_prob comp_mode_p; - int64_t best_intra_rd = INT64_MAX; - unsigned int best_pred_sse = UINT_MAX; - PREDICTION_MODE best_intra_mode = DC_PRED; - int rate_uv_intra[TX_SIZES], rate_uv_tokenonly[TX_SIZES]; - int64_t dist_uv[TX_SIZES]; - int skip_uv[TX_SIZES]; - PREDICTION_MODE mode_uv[TX_SIZES]; - const int intra_cost_penalty = vp9_get_intra_cost_penalty( - cm->base_qindex, cm->y_dc_delta_q, cm->bit_depth); - int best_skip2 = 0; - uint8_t ref_frame_skip_mask[2] = { 0 }; - uint16_t mode_skip_mask[MAX_REF_FRAMES] = { 0 }; - int mode_skip_start = sf->mode_skip_start + 1; - const int *const rd_threshes = rd_opt->threshes[segment_id][bsize]; - const int *const rd_thresh_freq_fact = tile_data->thresh_freq_fact[bsize]; - int64_t mode_threshold[MAX_MODES]; - int *mode_map = tile_data->mode_map[bsize]; - const int mode_search_skip_flags = sf->mode_search_skip_flags; - int64_t mask_filter = 0; - int64_t filter_cache[SWITCHABLE_FILTER_CONTEXTS]; - - vp9_zero(best_mbmode); - - x->skip_encode = sf->skip_encode_frame && x->q_index < QIDX_SKIP_THRESH; - - for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i) - filter_cache[i] = INT64_MAX; - - estimate_ref_frame_costs(cm, xd, segment_id, ref_costs_single, ref_costs_comp, - &comp_mode_p); - - for (i = 0; i < REFERENCE_MODES; ++i) - best_pred_rd[i] = INT64_MAX; - for (i = 0; i < TX_MODES; i++) - best_tx_rd[i] = INT64_MAX; - for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) - best_filter_rd[i] = INT64_MAX; - for (i = 0; i < TX_SIZES; i++) - rate_uv_intra[i] = INT_MAX; - for (i = 0; i < MAX_REF_FRAMES; ++i) - x->pred_sse[i] = INT_MAX; - for (i = 0; i < MB_MODE_COUNT; ++i) { - for (k = 0; k < MAX_REF_FRAMES; ++k) { - single_inter_filter[i][k] = SWITCHABLE; - single_skippable[i][k] = 0; - } - } - - rd_cost->rate = INT_MAX; - - for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) { - x->pred_mv_sad[ref_frame] = INT_MAX; - if (cpi->ref_frame_flags & flag_list[ref_frame]) { - assert(get_ref_frame_buffer(cpi, ref_frame) != NULL); - setup_buffer_inter(cpi, x, tile_info, ref_frame, bsize, mi_row, mi_col, - frame_mv[NEARESTMV], frame_mv[NEARMV], yv12_mb); - } - frame_mv[NEWMV][ref_frame].as_int = INVALID_MV; - frame_mv[ZEROMV][ref_frame].as_int = 0; - } - - for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) { - if (!(cpi->ref_frame_flags & flag_list[ref_frame])) { - // Skip checking missing references in both single and compound reference - // modes. Note that a mode will be skipped iff both reference frames - // are masked out. - ref_frame_skip_mask[0] |= (1 << ref_frame); - ref_frame_skip_mask[1] |= SECOND_REF_FRAME_MASK; - } else if (sf->reference_masking) { - for (i = LAST_FRAME; i <= ALTREF_FRAME; ++i) { - // Skip fixed mv modes for poor references - if ((x->pred_mv_sad[ref_frame] >> 2) > x->pred_mv_sad[i]) { - mode_skip_mask[ref_frame] |= INTER_NEAREST_NEAR_ZERO; - break; - } - } - } - // If the segment reference frame feature is enabled.... - // then do nothing if the current ref frame is not allowed.. - if (vp9_segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME) && - vp9_get_segdata(seg, segment_id, SEG_LVL_REF_FRAME) != (int)ref_frame) { - ref_frame_skip_mask[0] |= (1 << ref_frame); - ref_frame_skip_mask[1] |= SECOND_REF_FRAME_MASK; - } - } - - // Disable this drop out case if the ref frame - // segment level feature is enabled for this segment. This is to - // prevent the possibility that we end up unable to pick any mode. - if (!vp9_segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME)) { - // Only consider ZEROMV/ALTREF_FRAME for alt ref frame, - // unless ARNR filtering is enabled in which case we want - // an unfiltered alternative. We allow near/nearest as well - // because they may result in zero-zero MVs but be cheaper. - if (cpi->rc.is_src_frame_alt_ref && (cpi->oxcf.arnr_max_frames == 0)) { - ref_frame_skip_mask[0] = (1 << LAST_FRAME) | (1 << GOLDEN_FRAME); - ref_frame_skip_mask[1] = SECOND_REF_FRAME_MASK; - mode_skip_mask[ALTREF_FRAME] = ~INTER_NEAREST_NEAR_ZERO; - if (frame_mv[NEARMV][ALTREF_FRAME].as_int != 0) - mode_skip_mask[ALTREF_FRAME] |= (1 << NEARMV); - if (frame_mv[NEARESTMV][ALTREF_FRAME].as_int != 0) - mode_skip_mask[ALTREF_FRAME] |= (1 << NEARESTMV); - } - } - - if (cpi->rc.is_src_frame_alt_ref) { - if (sf->alt_ref_search_fp) { - mode_skip_mask[ALTREF_FRAME] = 0; - ref_frame_skip_mask[0] = ~(1 << ALTREF_FRAME); - ref_frame_skip_mask[1] = SECOND_REF_FRAME_MASK; - } - } - - if (sf->alt_ref_search_fp) - if (!cm->show_frame && x->pred_mv_sad[GOLDEN_FRAME] < INT_MAX) - if (x->pred_mv_sad[ALTREF_FRAME] > (x->pred_mv_sad[GOLDEN_FRAME] << 1)) - mode_skip_mask[ALTREF_FRAME] |= INTER_ALL; - - if (sf->adaptive_mode_search) { - if (cm->show_frame && !cpi->rc.is_src_frame_alt_ref && - cpi->rc.frames_since_golden >= 3) - if (x->pred_mv_sad[GOLDEN_FRAME] > (x->pred_mv_sad[LAST_FRAME] << 1)) - mode_skip_mask[GOLDEN_FRAME] |= INTER_ALL; - } - - if (bsize > sf->max_intra_bsize) { - ref_frame_skip_mask[0] |= (1 << INTRA_FRAME); - ref_frame_skip_mask[1] |= (1 << INTRA_FRAME); - } - - mode_skip_mask[INTRA_FRAME] |= - ~(sf->intra_y_mode_mask[max_txsize_lookup[bsize]]); - - for (i = 0; i <= LAST_NEW_MV_INDEX; ++i) - mode_threshold[i] = 0; - for (i = LAST_NEW_MV_INDEX + 1; i < MAX_MODES; ++i) - mode_threshold[i] = ((int64_t)rd_threshes[i] * rd_thresh_freq_fact[i]) >> 5; - - midx = sf->schedule_mode_search ? mode_skip_start : 0; - while (midx > 4) { - uint8_t end_pos = 0; - for (i = 5; i < midx; ++i) { - if (mode_threshold[mode_map[i - 1]] > mode_threshold[mode_map[i]]) { - uint8_t tmp = mode_map[i]; - mode_map[i] = mode_map[i - 1]; - mode_map[i - 1] = tmp; - end_pos = i; - } - } - midx = end_pos; - } - - for (midx = 0; midx < MAX_MODES; ++midx) { - int mode_index = mode_map[midx]; - int mode_excluded = 0; - int64_t this_rd = INT64_MAX; - int disable_skip = 0; - int compmode_cost = 0; - int rate2 = 0, rate_y = 0, rate_uv = 0; - int64_t distortion2 = 0, distortion_y = 0, distortion_uv = 0; - int skippable = 0; - int64_t tx_cache[TX_MODES]; - int this_skip2 = 0; - int64_t total_sse = INT64_MAX; - int early_term = 0; - - this_mode = vp9_mode_order[mode_index].mode; - ref_frame = vp9_mode_order[mode_index].ref_frame[0]; - second_ref_frame = vp9_mode_order[mode_index].ref_frame[1]; - - // Look at the reference frame of the best mode so far and set the - // skip mask to look at a subset of the remaining modes. - if (midx == mode_skip_start && best_mode_index >= 0) { - switch (best_mbmode.ref_frame[0]) { - case INTRA_FRAME: - break; - case LAST_FRAME: - ref_frame_skip_mask[0] |= LAST_FRAME_MODE_MASK; - ref_frame_skip_mask[1] |= SECOND_REF_FRAME_MASK; - break; - case GOLDEN_FRAME: - ref_frame_skip_mask[0] |= GOLDEN_FRAME_MODE_MASK; - ref_frame_skip_mask[1] |= SECOND_REF_FRAME_MASK; - break; - case ALTREF_FRAME: - ref_frame_skip_mask[0] |= ALT_REF_MODE_MASK; - break; - case NONE: - case MAX_REF_FRAMES: - assert(0 && "Invalid Reference frame"); - break; - } - } - - if ((ref_frame_skip_mask[0] & (1 << ref_frame)) && - (ref_frame_skip_mask[1] & (1 << MAX(0, second_ref_frame)))) - continue; - - if (mode_skip_mask[ref_frame] & (1 << this_mode)) - continue; - - // Test best rd so far against threshold for trying this mode. - if (best_mode_skippable && sf->schedule_mode_search) - mode_threshold[mode_index] <<= 1; - - if (best_rd < mode_threshold[mode_index]) - continue; - - if (sf->motion_field_mode_search) { - const int mi_width = MIN(num_8x8_blocks_wide_lookup[bsize], - tile_info->mi_col_end - mi_col); - const int mi_height = MIN(num_8x8_blocks_high_lookup[bsize], - tile_info->mi_row_end - mi_row); - const int bsl = mi_width_log2_lookup[bsize]; - int cb_partition_search_ctrl = (((mi_row + mi_col) >> bsl) - + get_chessboard_index(cm->current_video_frame)) & 0x1; - MB_MODE_INFO *ref_mbmi; - int const_motion = 1; - int skip_ref_frame = !cb_partition_search_ctrl; - MV_REFERENCE_FRAME rf = NONE; - int_mv ref_mv; - ref_mv.as_int = INVALID_MV; - - if ((mi_row - 1) >= tile_info->mi_row_start) { - ref_mv = xd->mi[-xd->mi_stride].src_mi->mbmi.mv[0]; - rf = xd->mi[-xd->mi_stride].src_mi->mbmi.ref_frame[0]; - for (i = 0; i < mi_width; ++i) { - ref_mbmi = &xd->mi[-xd->mi_stride + i].src_mi->mbmi; - const_motion &= (ref_mv.as_int == ref_mbmi->mv[0].as_int) && - (ref_frame == ref_mbmi->ref_frame[0]); - skip_ref_frame &= (rf == ref_mbmi->ref_frame[0]); - } - } - - if ((mi_col - 1) >= tile_info->mi_col_start) { - if (ref_mv.as_int == INVALID_MV) - ref_mv = xd->mi[-1].src_mi->mbmi.mv[0]; - if (rf == NONE) - rf = xd->mi[-1].src_mi->mbmi.ref_frame[0]; - for (i = 0; i < mi_height; ++i) { - ref_mbmi = &xd->mi[i * xd->mi_stride - 1].src_mi->mbmi; - const_motion &= (ref_mv.as_int == ref_mbmi->mv[0].as_int) && - (ref_frame == ref_mbmi->ref_frame[0]); - skip_ref_frame &= (rf == ref_mbmi->ref_frame[0]); - } - } - - if (skip_ref_frame && this_mode != NEARESTMV && this_mode != NEWMV) - if (rf > INTRA_FRAME) - if (ref_frame != rf) - continue; - - if (const_motion) - if (this_mode == NEARMV || this_mode == ZEROMV) - continue; - } - - comp_pred = second_ref_frame > INTRA_FRAME; - if (comp_pred) { - if (!cpi->allow_comp_inter_inter) - continue; - - // Skip compound inter modes if ARF is not available. - if (!(cpi->ref_frame_flags & flag_list[second_ref_frame])) - continue; - - // Do not allow compound prediction if the segment level reference frame - // feature is in use as in this case there can only be one reference. - if (vp9_segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME)) - continue; - - if ((mode_search_skip_flags & FLAG_SKIP_COMP_BESTINTRA) && - best_mode_index >= 0 && best_mbmode.ref_frame[0] == INTRA_FRAME) - continue; - - mode_excluded = cm->reference_mode == SINGLE_REFERENCE; - } else { - if (ref_frame != INTRA_FRAME) - mode_excluded = cm->reference_mode == COMPOUND_REFERENCE; - } - - if (ref_frame == INTRA_FRAME) { - if (sf->adaptive_mode_search) - if ((x->source_variance << num_pels_log2_lookup[bsize]) > best_pred_sse) - continue; - - if (this_mode != DC_PRED) { - // Disable intra modes other than DC_PRED for blocks with low variance - // Threshold for intra skipping based on source variance - // TODO(debargha): Specialize the threshold for super block sizes - const unsigned int skip_intra_var_thresh = 64; - if ((mode_search_skip_flags & FLAG_SKIP_INTRA_LOWVAR) && - x->source_variance < skip_intra_var_thresh) - continue; - // Only search the oblique modes if the best so far is - // one of the neighboring directional modes - if ((mode_search_skip_flags & FLAG_SKIP_INTRA_BESTINTER) && - (this_mode >= D45_PRED && this_mode <= TM_PRED)) { - if (best_mode_index >= 0 && - best_mbmode.ref_frame[0] > INTRA_FRAME) - continue; - } - if (mode_search_skip_flags & FLAG_SKIP_INTRA_DIRMISMATCH) { - if (conditional_skipintra(this_mode, best_intra_mode)) - continue; - } - } - } else { - const MV_REFERENCE_FRAME ref_frames[2] = {ref_frame, second_ref_frame}; - if (!check_best_zero_mv(cpi, mbmi->mode_context, frame_mv, - this_mode, ref_frames)) - continue; - } - - mbmi->mode = this_mode; - mbmi->uv_mode = DC_PRED; - mbmi->ref_frame[0] = ref_frame; - mbmi->ref_frame[1] = second_ref_frame; - // Evaluate all sub-pel filters irrespective of whether we can use - // them for this frame. - mbmi->interp_filter = cm->interp_filter == SWITCHABLE ? EIGHTTAP - : cm->interp_filter; - mbmi->mv[0].as_int = mbmi->mv[1].as_int = 0; - - x->skip = 0; - set_ref_ptrs(cm, xd, ref_frame, second_ref_frame); - - // Select prediction reference frames. - for (i = 0; i < MAX_MB_PLANE; i++) { - xd->plane[i].pre[0] = yv12_mb[ref_frame][i]; - if (comp_pred) - xd->plane[i].pre[1] = yv12_mb[second_ref_frame][i]; - } - - for (i = 0; i < TX_MODES; ++i) - tx_cache[i] = INT64_MAX; - - if (ref_frame == INTRA_FRAME) { - TX_SIZE uv_tx; - struct macroblockd_plane *const pd = &xd->plane[1]; - vpx_memset(x->skip_txfm, 0, sizeof(x->skip_txfm)); - super_block_yrd(cpi, x, &rate_y, &distortion_y, &skippable, - NULL, bsize, tx_cache, best_rd); - if (rate_y == INT_MAX) - continue; - - uv_tx = get_uv_tx_size_impl(mbmi->tx_size, bsize, pd->subsampling_x, - pd->subsampling_y); - if (rate_uv_intra[uv_tx] == INT_MAX) { - choose_intra_uv_mode(cpi, x, ctx, bsize, uv_tx, - &rate_uv_intra[uv_tx], &rate_uv_tokenonly[uv_tx], - &dist_uv[uv_tx], &skip_uv[uv_tx], &mode_uv[uv_tx]); - } - - rate_uv = rate_uv_tokenonly[uv_tx]; - distortion_uv = dist_uv[uv_tx]; - skippable = skippable && skip_uv[uv_tx]; - mbmi->uv_mode = mode_uv[uv_tx]; - - rate2 = rate_y + cpi->mbmode_cost[mbmi->mode] + rate_uv_intra[uv_tx]; - if (this_mode != DC_PRED && this_mode != TM_PRED) - rate2 += intra_cost_penalty; - distortion2 = distortion_y + distortion_uv; - } else { - this_rd = handle_inter_mode(cpi, x, bsize, - tx_cache, - &rate2, &distortion2, &skippable, - &rate_y, &rate_uv, - &disable_skip, frame_mv, - mi_row, mi_col, - single_newmv, single_inter_filter, - single_skippable, &total_sse, best_rd, - &mask_filter, filter_cache); - if (this_rd == INT64_MAX) - continue; - - compmode_cost = vp9_cost_bit(comp_mode_p, comp_pred); - - if (cm->reference_mode == REFERENCE_MODE_SELECT) - rate2 += compmode_cost; - } - - // Estimate the reference frame signaling cost and add it - // to the rolling cost variable. - if (comp_pred) { - rate2 += ref_costs_comp[ref_frame]; - } else { - rate2 += ref_costs_single[ref_frame]; - } - - if (!disable_skip) { - if (skippable) { - // Back out the coefficient coding costs - rate2 -= (rate_y + rate_uv); - - // Cost the skip mb case - rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 1); - } else if (ref_frame != INTRA_FRAME && !xd->lossless) { - if (RDCOST(x->rdmult, x->rddiv, rate_y + rate_uv, distortion2) < - RDCOST(x->rdmult, x->rddiv, 0, total_sse)) { - // Add in the cost of the no skip flag. - rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 0); - } else { - // FIXME(rbultje) make this work for splitmv also - rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 1); - distortion2 = total_sse; - assert(total_sse >= 0); - rate2 -= (rate_y + rate_uv); - this_skip2 = 1; - } - } else { - // Add in the cost of the no skip flag. - rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 0); - } - - // Calculate the final RD estimate for this mode. - this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2); - } - - if (ref_frame == INTRA_FRAME) { - // Keep record of best intra rd - if (this_rd < best_intra_rd) { - best_intra_rd = this_rd; - best_intra_mode = mbmi->mode; - } - } - - if (!disable_skip && ref_frame == INTRA_FRAME) { - for (i = 0; i < REFERENCE_MODES; ++i) - best_pred_rd[i] = MIN(best_pred_rd[i], this_rd); - for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) - best_filter_rd[i] = MIN(best_filter_rd[i], this_rd); - } - - // Did this mode help.. i.e. is it the new best mode - if (this_rd < best_rd || x->skip) { - int max_plane = MAX_MB_PLANE; - if (!mode_excluded) { - // Note index of best mode so far - best_mode_index = mode_index; - - if (ref_frame == INTRA_FRAME) { - /* required for left and above block mv */ - mbmi->mv[0].as_int = 0; - max_plane = 1; - } else { - best_pred_sse = x->pred_sse[ref_frame]; - } - - rd_cost->rate = rate2; - rd_cost->dist = distortion2; - rd_cost->rdcost = this_rd; - best_rd = this_rd; - best_mbmode = *mbmi; - best_skip2 = this_skip2; - best_mode_skippable = skippable; - - if (!x->select_tx_size) - swap_block_ptr(x, ctx, 1, 0, 0, max_plane); - vpx_memcpy(ctx->zcoeff_blk, x->zcoeff_blk[mbmi->tx_size], - sizeof(uint8_t) * ctx->num_4x4_blk); - - // TODO(debargha): enhance this test with a better distortion prediction - // based on qp, activity mask and history - if ((mode_search_skip_flags & FLAG_EARLY_TERMINATE) && - (mode_index > MIN_EARLY_TERM_INDEX)) { - int qstep = xd->plane[0].dequant[1]; - // TODO(debargha): Enhance this by specializing for each mode_index - int scale = 4; -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - qstep >>= (xd->bd - 8); - } -#endif // CONFIG_VP9_HIGHBITDEPTH - if (x->source_variance < UINT_MAX) { - const int var_adjust = (x->source_variance < 16); - scale -= var_adjust; - } - if (ref_frame > INTRA_FRAME && - distortion2 * scale < qstep * qstep) { - early_term = 1; - } - } - } - } - - /* keep record of best compound/single-only prediction */ - if (!disable_skip && ref_frame != INTRA_FRAME) { - int64_t single_rd, hybrid_rd, single_rate, hybrid_rate; - - if (cm->reference_mode == REFERENCE_MODE_SELECT) { - single_rate = rate2 - compmode_cost; - hybrid_rate = rate2; - } else { - single_rate = rate2; - hybrid_rate = rate2 + compmode_cost; - } - - single_rd = RDCOST(x->rdmult, x->rddiv, single_rate, distortion2); - hybrid_rd = RDCOST(x->rdmult, x->rddiv, hybrid_rate, distortion2); - - if (!comp_pred) { - if (single_rd < best_pred_rd[SINGLE_REFERENCE]) - best_pred_rd[SINGLE_REFERENCE] = single_rd; - } else { - if (single_rd < best_pred_rd[COMPOUND_REFERENCE]) - best_pred_rd[COMPOUND_REFERENCE] = single_rd; - } - if (hybrid_rd < best_pred_rd[REFERENCE_MODE_SELECT]) - best_pred_rd[REFERENCE_MODE_SELECT] = hybrid_rd; - - /* keep record of best filter type */ - if (!mode_excluded && cm->interp_filter != BILINEAR) { - int64_t ref = filter_cache[cm->interp_filter == SWITCHABLE ? - SWITCHABLE_FILTERS : cm->interp_filter]; - - for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) { - int64_t adj_rd; - if (ref == INT64_MAX) - adj_rd = 0; - else if (filter_cache[i] == INT64_MAX) - // when early termination is triggered, the encoder does not have - // access to the rate-distortion cost. it only knows that the cost - // should be above the maximum valid value. hence it takes the known - // maximum plus an arbitrary constant as the rate-distortion cost. - adj_rd = mask_filter - ref + 10; - else - adj_rd = filter_cache[i] - ref; - - adj_rd += this_rd; - best_filter_rd[i] = MIN(best_filter_rd[i], adj_rd); - } - } - } - - /* keep record of best txfm size */ - if (bsize < BLOCK_32X32) { - if (bsize < BLOCK_16X16) - tx_cache[ALLOW_16X16] = tx_cache[ALLOW_8X8]; - - tx_cache[ALLOW_32X32] = tx_cache[ALLOW_16X16]; - } - if (!mode_excluded && this_rd != INT64_MAX) { - for (i = 0; i < TX_MODES && tx_cache[i] < INT64_MAX; i++) { - int64_t adj_rd = INT64_MAX; - adj_rd = this_rd + tx_cache[i] - tx_cache[cm->tx_mode]; - - if (adj_rd < best_tx_rd[i]) - best_tx_rd[i] = adj_rd; - } - } - - if (early_term) - break; - - if (x->skip && !comp_pred) - break; - } - - // The inter modes' rate costs are not calculated precisely in some cases. - // Therefore, sometimes, NEWMV is chosen instead of NEARESTMV, NEARMV, and - // ZEROMV. Here, checks are added for those cases, and the mode decisions - // are corrected. - if (best_mbmode.mode == NEWMV) { - const MV_REFERENCE_FRAME refs[2] = {best_mbmode.ref_frame[0], - best_mbmode.ref_frame[1]}; - int comp_pred_mode = refs[1] > INTRA_FRAME; - - if (frame_mv[NEARESTMV][refs[0]].as_int == best_mbmode.mv[0].as_int && - ((comp_pred_mode && frame_mv[NEARESTMV][refs[1]].as_int == - best_mbmode.mv[1].as_int) || !comp_pred_mode)) - best_mbmode.mode = NEARESTMV; - else if (frame_mv[NEARMV][refs[0]].as_int == best_mbmode.mv[0].as_int && - ((comp_pred_mode && frame_mv[NEARMV][refs[1]].as_int == - best_mbmode.mv[1].as_int) || !comp_pred_mode)) - best_mbmode.mode = NEARMV; - else if (best_mbmode.mv[0].as_int == 0 && - ((comp_pred_mode && best_mbmode.mv[1].as_int == 0) || !comp_pred_mode)) - best_mbmode.mode = ZEROMV; - } - - if (best_mode_index < 0 || best_rd >= best_rd_so_far) { - rd_cost->rate = INT_MAX; - rd_cost->rdcost = INT64_MAX; - return; - } - - // If we used an estimate for the uv intra rd in the loop above... - if (sf->use_uv_intra_rd_estimate) { - // Do Intra UV best rd mode selection if best mode choice above was intra. - if (best_mbmode.ref_frame[0] == INTRA_FRAME) { - TX_SIZE uv_tx_size; - *mbmi = best_mbmode; - uv_tx_size = get_uv_tx_size(mbmi, &xd->plane[1]); - rd_pick_intra_sbuv_mode(cpi, x, ctx, &rate_uv_intra[uv_tx_size], - &rate_uv_tokenonly[uv_tx_size], - &dist_uv[uv_tx_size], - &skip_uv[uv_tx_size], - bsize < BLOCK_8X8 ? BLOCK_8X8 : bsize, - uv_tx_size); - } - } - - assert((cm->interp_filter == SWITCHABLE) || - (cm->interp_filter == best_mbmode.interp_filter) || - !is_inter_block(&best_mbmode)); - - if (!cpi->rc.is_src_frame_alt_ref) - vp9_update_rd_thresh_fact(tile_data->thresh_freq_fact, - sf->adaptive_rd_thresh, bsize, best_mode_index); - - // macroblock modes - *mbmi = best_mbmode; - x->skip |= best_skip2; - - for (i = 0; i < REFERENCE_MODES; ++i) { - if (best_pred_rd[i] == INT64_MAX) - best_pred_diff[i] = INT_MIN; - else - best_pred_diff[i] = best_rd - best_pred_rd[i]; - } - - if (!x->skip) { - for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) { - if (best_filter_rd[i] == INT64_MAX) - best_filter_diff[i] = 0; - else - best_filter_diff[i] = best_rd - best_filter_rd[i]; - } - if (cm->interp_filter == SWITCHABLE) - assert(best_filter_diff[SWITCHABLE_FILTERS] == 0); - for (i = 0; i < TX_MODES; i++) { - if (best_tx_rd[i] == INT64_MAX) - best_tx_diff[i] = 0; - else - best_tx_diff[i] = best_rd - best_tx_rd[i]; - } - } else { - vp9_zero(best_filter_diff); - vp9_zero(best_tx_diff); - } - - // TODO(yunqingwang): Moving this line in front of the above best_filter_diff - // updating code causes PSNR loss. Need to figure out the confliction. - x->skip |= best_mode_skippable; - - if (!x->skip && !x->select_tx_size) { - int has_high_freq_coeff = 0; - int plane; - int max_plane = is_inter_block(&xd->mi[0].src_mi->mbmi) - ? MAX_MB_PLANE : 1; - for (plane = 0; plane < max_plane; ++plane) { - x->plane[plane].eobs = ctx->eobs_pbuf[plane][1]; - has_high_freq_coeff |= vp9_has_high_freq_in_plane(x, bsize, plane); - } - - for (plane = max_plane; plane < MAX_MB_PLANE; ++plane) { - x->plane[plane].eobs = ctx->eobs_pbuf[plane][2]; - has_high_freq_coeff |= vp9_has_high_freq_in_plane(x, bsize, plane); - } - - best_mode_skippable |= !has_high_freq_coeff; - } - - assert(best_mode_index >= 0); - - store_coding_context(x, ctx, best_mode_index, best_pred_diff, - best_tx_diff, best_filter_diff, best_mode_skippable); -} - -void vp9_rd_pick_inter_mode_sb_seg_skip(VP9_COMP *cpi, - TileDataEnc *tile_data, - MACROBLOCK *x, - RD_COST *rd_cost, - BLOCK_SIZE bsize, - PICK_MODE_CONTEXT *ctx, - int64_t best_rd_so_far) { - VP9_COMMON *const cm = &cpi->common; - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi; - unsigned char segment_id = mbmi->segment_id; - const int comp_pred = 0; - int i; - int64_t best_tx_diff[TX_MODES]; - int64_t best_pred_diff[REFERENCE_MODES]; - int64_t best_filter_diff[SWITCHABLE_FILTER_CONTEXTS]; - unsigned int ref_costs_single[MAX_REF_FRAMES], ref_costs_comp[MAX_REF_FRAMES]; - vp9_prob comp_mode_p; - INTERP_FILTER best_filter = SWITCHABLE; - int64_t this_rd = INT64_MAX; - int rate2 = 0; - const int64_t distortion2 = 0; - - x->skip_encode = cpi->sf.skip_encode_frame && x->q_index < QIDX_SKIP_THRESH; - - estimate_ref_frame_costs(cm, xd, segment_id, ref_costs_single, ref_costs_comp, - &comp_mode_p); - - for (i = 0; i < MAX_REF_FRAMES; ++i) - x->pred_sse[i] = INT_MAX; - for (i = LAST_FRAME; i < MAX_REF_FRAMES; ++i) - x->pred_mv_sad[i] = INT_MAX; - - rd_cost->rate = INT_MAX; - - assert(vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP)); - - mbmi->mode = ZEROMV; - mbmi->uv_mode = DC_PRED; - mbmi->ref_frame[0] = LAST_FRAME; - mbmi->ref_frame[1] = NONE; - mbmi->mv[0].as_int = 0; - x->skip = 1; - - if (cm->interp_filter != BILINEAR) { - best_filter = EIGHTTAP; - if (cm->interp_filter == SWITCHABLE && - x->source_variance >= cpi->sf.disable_filter_search_var_thresh) { - int rs; - int best_rs = INT_MAX; - for (i = 0; i < SWITCHABLE_FILTERS; ++i) { - mbmi->interp_filter = i; - rs = vp9_get_switchable_rate(cpi, xd); - if (rs < best_rs) { - best_rs = rs; - best_filter = mbmi->interp_filter; - } - } - } - } - // Set the appropriate filter - if (cm->interp_filter == SWITCHABLE) { - mbmi->interp_filter = best_filter; - rate2 += vp9_get_switchable_rate(cpi, xd); - } else { - mbmi->interp_filter = cm->interp_filter; - } - - if (cm->reference_mode == REFERENCE_MODE_SELECT) - rate2 += vp9_cost_bit(comp_mode_p, comp_pred); - - // Estimate the reference frame signaling cost and add it - // to the rolling cost variable. - rate2 += ref_costs_single[LAST_FRAME]; - this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2); - - rd_cost->rate = rate2; - rd_cost->dist = distortion2; - rd_cost->rdcost = this_rd; - - if (this_rd >= best_rd_so_far) { - rd_cost->rate = INT_MAX; - rd_cost->rdcost = INT64_MAX; - return; - } - - assert((cm->interp_filter == SWITCHABLE) || - (cm->interp_filter == mbmi->interp_filter)); - - vp9_update_rd_thresh_fact(tile_data->thresh_freq_fact, - cpi->sf.adaptive_rd_thresh, bsize, THR_ZEROMV); - - vp9_zero(best_pred_diff); - vp9_zero(best_filter_diff); - vp9_zero(best_tx_diff); - - if (!x->select_tx_size) - swap_block_ptr(x, ctx, 1, 0, 0, MAX_MB_PLANE); - store_coding_context(x, ctx, THR_ZEROMV, - best_pred_diff, best_tx_diff, best_filter_diff, 0); -} - -void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, - TileDataEnc *tile_data, - MACROBLOCK *x, - int mi_row, int mi_col, - RD_COST *rd_cost, - BLOCK_SIZE bsize, - PICK_MODE_CONTEXT *ctx, - int64_t best_rd_so_far) { - VP9_COMMON *const cm = &cpi->common; - TileInfo *const tile_info = &tile_data->tile_info; - RD_OPT *const rd_opt = &cpi->rd; - SPEED_FEATURES *const sf = &cpi->sf; - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi; - const struct segmentation *const seg = &cm->seg; - MV_REFERENCE_FRAME ref_frame, second_ref_frame; - unsigned char segment_id = mbmi->segment_id; - int comp_pred, i; - int_mv frame_mv[MB_MODE_COUNT][MAX_REF_FRAMES]; - struct buf_2d yv12_mb[4][MAX_MB_PLANE]; - static const int flag_list[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG, - VP9_ALT_FLAG }; - int64_t best_rd = best_rd_so_far; - int64_t best_yrd = best_rd_so_far; // FIXME(rbultje) more precise - static const int64_t best_tx_diff[TX_MODES] = { 0 }; - int64_t best_pred_diff[REFERENCE_MODES]; - int64_t best_pred_rd[REFERENCE_MODES]; - int64_t best_filter_rd[SWITCHABLE_FILTER_CONTEXTS]; - int64_t best_filter_diff[SWITCHABLE_FILTER_CONTEXTS]; - MB_MODE_INFO best_mbmode; - int ref_index, best_ref_index = 0; - unsigned int ref_costs_single[MAX_REF_FRAMES], ref_costs_comp[MAX_REF_FRAMES]; - vp9_prob comp_mode_p; - INTERP_FILTER tmp_best_filter = SWITCHABLE; - int rate_uv_intra, rate_uv_tokenonly; - int64_t dist_uv; - int skip_uv; - PREDICTION_MODE mode_uv = DC_PRED; - const int intra_cost_penalty = vp9_get_intra_cost_penalty( - cm->base_qindex, cm->y_dc_delta_q, cm->bit_depth); - int_mv seg_mvs[4][MAX_REF_FRAMES]; - b_mode_info best_bmodes[4]; - int best_skip2 = 0; - int ref_frame_skip_mask[2] = { 0 }; - int64_t mask_filter = 0; - int64_t filter_cache[SWITCHABLE_FILTER_CONTEXTS]; - - x->skip_encode = sf->skip_encode_frame && x->q_index < QIDX_SKIP_THRESH; - vpx_memset(x->zcoeff_blk[TX_4X4], 0, 4); - vp9_zero(best_mbmode); - - for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i) - filter_cache[i] = INT64_MAX; - - for (i = 0; i < 4; i++) { - int j; - for (j = 0; j < MAX_REF_FRAMES; j++) - seg_mvs[i][j].as_int = INVALID_MV; - } - - estimate_ref_frame_costs(cm, xd, segment_id, ref_costs_single, ref_costs_comp, - &comp_mode_p); - - for (i = 0; i < REFERENCE_MODES; ++i) - best_pred_rd[i] = INT64_MAX; - for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) - best_filter_rd[i] = INT64_MAX; - rate_uv_intra = INT_MAX; - - rd_cost->rate = INT_MAX; - - for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ref_frame++) { - if (cpi->ref_frame_flags & flag_list[ref_frame]) { - setup_buffer_inter(cpi, x, tile_info, - ref_frame, bsize, mi_row, mi_col, - frame_mv[NEARESTMV], frame_mv[NEARMV], - yv12_mb); - } else { - ref_frame_skip_mask[0] |= (1 << ref_frame); - ref_frame_skip_mask[1] |= SECOND_REF_FRAME_MASK; - } - frame_mv[NEWMV][ref_frame].as_int = INVALID_MV; - frame_mv[ZEROMV][ref_frame].as_int = 0; - } - - for (ref_index = 0; ref_index < MAX_REFS; ++ref_index) { - int mode_excluded = 0; - int64_t this_rd = INT64_MAX; - int disable_skip = 0; - int compmode_cost = 0; - int rate2 = 0, rate_y = 0, rate_uv = 0; - int64_t distortion2 = 0, distortion_y = 0, distortion_uv = 0; - int skippable = 0; - int i; - int this_skip2 = 0; - int64_t total_sse = INT_MAX; - int early_term = 0; - - ref_frame = vp9_ref_order[ref_index].ref_frame[0]; - second_ref_frame = vp9_ref_order[ref_index].ref_frame[1]; - - // Look at the reference frame of the best mode so far and set the - // skip mask to look at a subset of the remaining modes. - if (ref_index > 2 && sf->mode_skip_start < MAX_MODES) { - if (ref_index == 3) { - switch (best_mbmode.ref_frame[0]) { - case INTRA_FRAME: - break; - case LAST_FRAME: - ref_frame_skip_mask[0] |= (1 << GOLDEN_FRAME) | (1 << ALTREF_FRAME); - ref_frame_skip_mask[1] |= SECOND_REF_FRAME_MASK; - break; - case GOLDEN_FRAME: - ref_frame_skip_mask[0] |= (1 << LAST_FRAME) | (1 << ALTREF_FRAME); - ref_frame_skip_mask[1] |= SECOND_REF_FRAME_MASK; - break; - case ALTREF_FRAME: - ref_frame_skip_mask[0] |= (1 << GOLDEN_FRAME) | (1 << LAST_FRAME); - break; - case NONE: - case MAX_REF_FRAMES: - assert(0 && "Invalid Reference frame"); - break; - } - } - } - - if ((ref_frame_skip_mask[0] & (1 << ref_frame)) && - (ref_frame_skip_mask[1] & (1 << MAX(0, second_ref_frame)))) - continue; - - // Test best rd so far against threshold for trying this mode. - if (rd_less_than_thresh(best_rd, - rd_opt->threshes[segment_id][bsize][ref_index], - tile_data->thresh_freq_fact[bsize][ref_index])) - continue; - - comp_pred = second_ref_frame > INTRA_FRAME; - if (comp_pred) { - if (!cpi->allow_comp_inter_inter) - continue; - if (!(cpi->ref_frame_flags & flag_list[second_ref_frame])) - continue; - // Do not allow compound prediction if the segment level reference frame - // feature is in use as in this case there can only be one reference. - if (vp9_segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME)) - continue; - - if ((sf->mode_search_skip_flags & FLAG_SKIP_COMP_BESTINTRA) && - best_mbmode.ref_frame[0] == INTRA_FRAME) - continue; - } - - // TODO(jingning, jkoleszar): scaling reference frame not supported for - // sub8x8 blocks. - if (ref_frame > INTRA_FRAME && - vp9_is_scaled(&cm->frame_refs[ref_frame - 1].sf)) - continue; - - if (second_ref_frame > INTRA_FRAME && - vp9_is_scaled(&cm->frame_refs[second_ref_frame - 1].sf)) - continue; - - if (comp_pred) - mode_excluded = cm->reference_mode == SINGLE_REFERENCE; - else if (ref_frame != INTRA_FRAME) - mode_excluded = cm->reference_mode == COMPOUND_REFERENCE; - - // If the segment reference frame feature is enabled.... - // then do nothing if the current ref frame is not allowed.. - if (vp9_segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME) && - vp9_get_segdata(seg, segment_id, SEG_LVL_REF_FRAME) != (int)ref_frame) { - continue; - // Disable this drop out case if the ref frame - // segment level feature is enabled for this segment. This is to - // prevent the possibility that we end up unable to pick any mode. - } else if (!vp9_segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME)) { - // Only consider ZEROMV/ALTREF_FRAME for alt ref frame, - // unless ARNR filtering is enabled in which case we want - // an unfiltered alternative. We allow near/nearest as well - // because they may result in zero-zero MVs but be cheaper. - if (cpi->rc.is_src_frame_alt_ref && (cpi->oxcf.arnr_max_frames == 0)) - continue; - } - - mbmi->tx_size = TX_4X4; - mbmi->uv_mode = DC_PRED; - mbmi->ref_frame[0] = ref_frame; - mbmi->ref_frame[1] = second_ref_frame; - // Evaluate all sub-pel filters irrespective of whether we can use - // them for this frame. - mbmi->interp_filter = cm->interp_filter == SWITCHABLE ? EIGHTTAP - : cm->interp_filter; - x->skip = 0; - set_ref_ptrs(cm, xd, ref_frame, second_ref_frame); - - // Select prediction reference frames. - for (i = 0; i < MAX_MB_PLANE; i++) { - xd->plane[i].pre[0] = yv12_mb[ref_frame][i]; - if (comp_pred) - xd->plane[i].pre[1] = yv12_mb[second_ref_frame][i]; - } - - if (ref_frame == INTRA_FRAME) { - int rate; - if (rd_pick_intra_sub_8x8_y_mode(cpi, x, &rate, &rate_y, - &distortion_y, best_rd) >= best_rd) - continue; - rate2 += rate; - rate2 += intra_cost_penalty; - distortion2 += distortion_y; - - if (rate_uv_intra == INT_MAX) { - choose_intra_uv_mode(cpi, x, ctx, bsize, TX_4X4, - &rate_uv_intra, - &rate_uv_tokenonly, - &dist_uv, &skip_uv, - &mode_uv); - } - rate2 += rate_uv_intra; - rate_uv = rate_uv_tokenonly; - distortion2 += dist_uv; - distortion_uv = dist_uv; - mbmi->uv_mode = mode_uv; - } else { - int rate; - int64_t distortion; - int64_t this_rd_thresh; - int64_t tmp_rd, tmp_best_rd = INT64_MAX, tmp_best_rdu = INT64_MAX; - int tmp_best_rate = INT_MAX, tmp_best_ratey = INT_MAX; - int64_t tmp_best_distortion = INT_MAX, tmp_best_sse, uv_sse; - int tmp_best_skippable = 0; - int switchable_filter_index; - int_mv *second_ref = comp_pred ? - &mbmi->ref_mvs[second_ref_frame][0] : NULL; - b_mode_info tmp_best_bmodes[16]; - MB_MODE_INFO tmp_best_mbmode; - BEST_SEG_INFO bsi[SWITCHABLE_FILTERS]; - int pred_exists = 0; - int uv_skippable; - - this_rd_thresh = (ref_frame == LAST_FRAME) ? - rd_opt->threshes[segment_id][bsize][THR_LAST] : - rd_opt->threshes[segment_id][bsize][THR_ALTR]; - this_rd_thresh = (ref_frame == GOLDEN_FRAME) ? - rd_opt->threshes[segment_id][bsize][THR_GOLD] : this_rd_thresh; - for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i) - filter_cache[i] = INT64_MAX; - - if (cm->interp_filter != BILINEAR) { - tmp_best_filter = EIGHTTAP; - if (x->source_variance < sf->disable_filter_search_var_thresh) { - tmp_best_filter = EIGHTTAP; - } else if (sf->adaptive_pred_interp_filter == 1 && - ctx->pred_interp_filter < SWITCHABLE) { - tmp_best_filter = ctx->pred_interp_filter; - } else if (sf->adaptive_pred_interp_filter == 2) { - tmp_best_filter = ctx->pred_interp_filter < SWITCHABLE ? - ctx->pred_interp_filter : 0; - } else { - for (switchable_filter_index = 0; - switchable_filter_index < SWITCHABLE_FILTERS; - ++switchable_filter_index) { - int newbest, rs; - int64_t rs_rd; - mbmi->interp_filter = switchable_filter_index; - tmp_rd = rd_pick_best_sub8x8_mode(cpi, x, tile_info, - &mbmi->ref_mvs[ref_frame][0], - second_ref, best_yrd, &rate, - &rate_y, &distortion, - &skippable, &total_sse, - (int) this_rd_thresh, seg_mvs, - bsi, switchable_filter_index, - mi_row, mi_col); - - if (tmp_rd == INT64_MAX) - continue; - rs = vp9_get_switchable_rate(cpi, xd); - rs_rd = RDCOST(x->rdmult, x->rddiv, rs, 0); - filter_cache[switchable_filter_index] = tmp_rd; - filter_cache[SWITCHABLE_FILTERS] = - MIN(filter_cache[SWITCHABLE_FILTERS], - tmp_rd + rs_rd); - if (cm->interp_filter == SWITCHABLE) - tmp_rd += rs_rd; - - mask_filter = MAX(mask_filter, tmp_rd); - - newbest = (tmp_rd < tmp_best_rd); - if (newbest) { - tmp_best_filter = mbmi->interp_filter; - tmp_best_rd = tmp_rd; - } - if ((newbest && cm->interp_filter == SWITCHABLE) || - (mbmi->interp_filter == cm->interp_filter && - cm->interp_filter != SWITCHABLE)) { - tmp_best_rdu = tmp_rd; - tmp_best_rate = rate; - tmp_best_ratey = rate_y; - tmp_best_distortion = distortion; - tmp_best_sse = total_sse; - tmp_best_skippable = skippable; - tmp_best_mbmode = *mbmi; - for (i = 0; i < 4; i++) { - tmp_best_bmodes[i] = xd->mi[0].src_mi->bmi[i]; - x->zcoeff_blk[TX_4X4][i] = !x->plane[0].eobs[i]; - } - pred_exists = 1; - if (switchable_filter_index == 0 && - sf->use_rd_breakout && - best_rd < INT64_MAX) { - if (tmp_best_rdu / 2 > best_rd) { - // skip searching the other filters if the first is - // already substantially larger than the best so far - tmp_best_filter = mbmi->interp_filter; - tmp_best_rdu = INT64_MAX; - break; - } - } - } - } // switchable_filter_index loop - } - } - - if (tmp_best_rdu == INT64_MAX && pred_exists) - continue; - - mbmi->interp_filter = (cm->interp_filter == SWITCHABLE ? - tmp_best_filter : cm->interp_filter); - if (!pred_exists) { - // Handles the special case when a filter that is not in the - // switchable list (bilinear, 6-tap) is indicated at the frame level - tmp_rd = rd_pick_best_sub8x8_mode(cpi, x, tile_info, - &mbmi->ref_mvs[ref_frame][0], - second_ref, best_yrd, &rate, &rate_y, - &distortion, &skippable, &total_sse, - (int) this_rd_thresh, seg_mvs, bsi, 0, - mi_row, mi_col); - if (tmp_rd == INT64_MAX) - continue; - } else { - total_sse = tmp_best_sse; - rate = tmp_best_rate; - rate_y = tmp_best_ratey; - distortion = tmp_best_distortion; - skippable = tmp_best_skippable; - *mbmi = tmp_best_mbmode; - for (i = 0; i < 4; i++) - xd->mi[0].src_mi->bmi[i] = tmp_best_bmodes[i]; - } - - rate2 += rate; - distortion2 += distortion; - - if (cm->interp_filter == SWITCHABLE) - rate2 += vp9_get_switchable_rate(cpi, xd); - - if (!mode_excluded) - mode_excluded = comp_pred ? cm->reference_mode == SINGLE_REFERENCE - : cm->reference_mode == COMPOUND_REFERENCE; - - compmode_cost = vp9_cost_bit(comp_mode_p, comp_pred); - - tmp_best_rdu = best_rd - - MIN(RDCOST(x->rdmult, x->rddiv, rate2, distortion2), - RDCOST(x->rdmult, x->rddiv, 0, total_sse)); - - if (tmp_best_rdu > 0) { - // If even the 'Y' rd value of split is higher than best so far - // then dont bother looking at UV - vp9_build_inter_predictors_sbuv(&x->e_mbd, mi_row, mi_col, - BLOCK_8X8); - vpx_memset(x->skip_txfm, 0, sizeof(x->skip_txfm)); - if (!super_block_uvrd(cpi, x, &rate_uv, &distortion_uv, &uv_skippable, - &uv_sse, BLOCK_8X8, tmp_best_rdu)) - continue; - - rate2 += rate_uv; - distortion2 += distortion_uv; - skippable = skippable && uv_skippable; - total_sse += uv_sse; - } - } - - if (cm->reference_mode == REFERENCE_MODE_SELECT) - rate2 += compmode_cost; - - // Estimate the reference frame signaling cost and add it - // to the rolling cost variable. - if (second_ref_frame > INTRA_FRAME) { - rate2 += ref_costs_comp[ref_frame]; - } else { - rate2 += ref_costs_single[ref_frame]; - } - - if (!disable_skip) { - // Skip is never coded at the segment level for sub8x8 blocks and instead - // always coded in the bitstream at the mode info level. - - if (ref_frame != INTRA_FRAME && !xd->lossless) { - if (RDCOST(x->rdmult, x->rddiv, rate_y + rate_uv, distortion2) < - RDCOST(x->rdmult, x->rddiv, 0, total_sse)) { - // Add in the cost of the no skip flag. - rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 0); - } else { - // FIXME(rbultje) make this work for splitmv also - rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 1); - distortion2 = total_sse; - assert(total_sse >= 0); - rate2 -= (rate_y + rate_uv); - rate_y = 0; - rate_uv = 0; - this_skip2 = 1; - } - } else { - // Add in the cost of the no skip flag. - rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 0); - } - - // Calculate the final RD estimate for this mode. - this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2); - } - - if (!disable_skip && ref_frame == INTRA_FRAME) { - for (i = 0; i < REFERENCE_MODES; ++i) - best_pred_rd[i] = MIN(best_pred_rd[i], this_rd); - for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) - best_filter_rd[i] = MIN(best_filter_rd[i], this_rd); - } - - // Did this mode help.. i.e. is it the new best mode - if (this_rd < best_rd || x->skip) { - if (!mode_excluded) { - int max_plane = MAX_MB_PLANE; - // Note index of best mode so far - best_ref_index = ref_index; - - if (ref_frame == INTRA_FRAME) { - /* required for left and above block mv */ - mbmi->mv[0].as_int = 0; - max_plane = 1; - } - - rd_cost->rate = rate2; - rd_cost->dist = distortion2; - rd_cost->rdcost = this_rd; - best_rd = this_rd; - best_yrd = best_rd - - RDCOST(x->rdmult, x->rddiv, rate_uv, distortion_uv); - best_mbmode = *mbmi; - best_skip2 = this_skip2; - if (!x->select_tx_size) - swap_block_ptr(x, ctx, 1, 0, 0, max_plane); - vpx_memcpy(ctx->zcoeff_blk, x->zcoeff_blk[TX_4X4], - sizeof(uint8_t) * ctx->num_4x4_blk); - - for (i = 0; i < 4; i++) - best_bmodes[i] = xd->mi[0].src_mi->bmi[i]; - - // TODO(debargha): enhance this test with a better distortion prediction - // based on qp, activity mask and history - if ((sf->mode_search_skip_flags & FLAG_EARLY_TERMINATE) && - (ref_index > MIN_EARLY_TERM_INDEX)) { - int qstep = xd->plane[0].dequant[1]; - // TODO(debargha): Enhance this by specializing for each mode_index - int scale = 4; -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - qstep >>= (xd->bd - 8); - } -#endif // CONFIG_VP9_HIGHBITDEPTH - if (x->source_variance < UINT_MAX) { - const int var_adjust = (x->source_variance < 16); - scale -= var_adjust; - } - if (ref_frame > INTRA_FRAME && - distortion2 * scale < qstep * qstep) { - early_term = 1; - } - } - } - } - - /* keep record of best compound/single-only prediction */ - if (!disable_skip && ref_frame != INTRA_FRAME) { - int64_t single_rd, hybrid_rd, single_rate, hybrid_rate; - - if (cm->reference_mode == REFERENCE_MODE_SELECT) { - single_rate = rate2 - compmode_cost; - hybrid_rate = rate2; - } else { - single_rate = rate2; - hybrid_rate = rate2 + compmode_cost; - } - - single_rd = RDCOST(x->rdmult, x->rddiv, single_rate, distortion2); - hybrid_rd = RDCOST(x->rdmult, x->rddiv, hybrid_rate, distortion2); - - if (!comp_pred && single_rd < best_pred_rd[SINGLE_REFERENCE]) - best_pred_rd[SINGLE_REFERENCE] = single_rd; - else if (comp_pred && single_rd < best_pred_rd[COMPOUND_REFERENCE]) - best_pred_rd[COMPOUND_REFERENCE] = single_rd; - - if (hybrid_rd < best_pred_rd[REFERENCE_MODE_SELECT]) - best_pred_rd[REFERENCE_MODE_SELECT] = hybrid_rd; - } - - /* keep record of best filter type */ - if (!mode_excluded && !disable_skip && ref_frame != INTRA_FRAME && - cm->interp_filter != BILINEAR) { - int64_t ref = filter_cache[cm->interp_filter == SWITCHABLE ? - SWITCHABLE_FILTERS : cm->interp_filter]; - int64_t adj_rd; - for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) { - if (ref == INT64_MAX) - adj_rd = 0; - else if (filter_cache[i] == INT64_MAX) - // when early termination is triggered, the encoder does not have - // access to the rate-distortion cost. it only knows that the cost - // should be above the maximum valid value. hence it takes the known - // maximum plus an arbitrary constant as the rate-distortion cost. - adj_rd = mask_filter - ref + 10; - else - adj_rd = filter_cache[i] - ref; - - adj_rd += this_rd; - best_filter_rd[i] = MIN(best_filter_rd[i], adj_rd); - } - } - - if (early_term) - break; - - if (x->skip && !comp_pred) - break; - } - - if (best_rd >= best_rd_so_far) { - rd_cost->rate = INT_MAX; - rd_cost->rdcost = INT64_MAX; - return; - } - - // If we used an estimate for the uv intra rd in the loop above... - if (sf->use_uv_intra_rd_estimate) { - // Do Intra UV best rd mode selection if best mode choice above was intra. - if (best_mbmode.ref_frame[0] == INTRA_FRAME) { - *mbmi = best_mbmode; - rd_pick_intra_sbuv_mode(cpi, x, ctx, &rate_uv_intra, - &rate_uv_tokenonly, - &dist_uv, - &skip_uv, - BLOCK_8X8, TX_4X4); - } - } - - if (best_rd == INT64_MAX) { - rd_cost->rate = INT_MAX; - rd_cost->dist = INT64_MAX; - rd_cost->rdcost = INT64_MAX; - return; - } - - assert((cm->interp_filter == SWITCHABLE) || - (cm->interp_filter == best_mbmode.interp_filter) || - !is_inter_block(&best_mbmode)); - - vp9_update_rd_thresh_fact(tile_data->thresh_freq_fact, - sf->adaptive_rd_thresh, bsize, best_ref_index); - - // macroblock modes - *mbmi = best_mbmode; - x->skip |= best_skip2; - if (!is_inter_block(&best_mbmode)) { - for (i = 0; i < 4; i++) - xd->mi[0].src_mi->bmi[i].as_mode = best_bmodes[i].as_mode; - } else { - for (i = 0; i < 4; ++i) - vpx_memcpy(&xd->mi[0].src_mi->bmi[i], &best_bmodes[i], - sizeof(b_mode_info)); - - mbmi->mv[0].as_int = xd->mi[0].src_mi->bmi[3].as_mv[0].as_int; - mbmi->mv[1].as_int = xd->mi[0].src_mi->bmi[3].as_mv[1].as_int; - } - - for (i = 0; i < REFERENCE_MODES; ++i) { - if (best_pred_rd[i] == INT64_MAX) - best_pred_diff[i] = INT_MIN; - else - best_pred_diff[i] = best_rd - best_pred_rd[i]; - } - - if (!x->skip) { - for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) { - if (best_filter_rd[i] == INT64_MAX) - best_filter_diff[i] = 0; - else - best_filter_diff[i] = best_rd - best_filter_rd[i]; - } - if (cm->interp_filter == SWITCHABLE) - assert(best_filter_diff[SWITCHABLE_FILTERS] == 0); - } else { - vp9_zero(best_filter_diff); - } - - store_coding_context(x, ctx, best_ref_index, - best_pred_diff, best_tx_diff, best_filter_diff, 0); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_rdopt.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_rdopt.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_rdopt.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_rdopt.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_RDOPT_H_ -#define VP9_ENCODER_VP9_RDOPT_H_ - -#include "vp9/common/vp9_blockd.h" - -#include "vp9/encoder/vp9_block.h" -#include "vp9/encoder/vp9_context_tree.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct TileInfo; -struct VP9_COMP; -struct macroblock; -struct RD_COST; - -void vp9_rd_pick_intra_mode_sb(struct VP9_COMP *cpi, struct macroblock *x, - struct RD_COST *rd_cost, BLOCK_SIZE bsize, - PICK_MODE_CONTEXT *ctx, int64_t best_rd); - -void vp9_rd_pick_inter_mode_sb(struct VP9_COMP *cpi, - struct TileDataEnc *tile_data, - struct macroblock *x, - int mi_row, int mi_col, - struct RD_COST *rd_cost, - BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx, - int64_t best_rd_so_far); - -void vp9_rd_pick_inter_mode_sb_seg_skip(struct VP9_COMP *cpi, - struct TileDataEnc *tile_data, - struct macroblock *x, - struct RD_COST *rd_cost, - BLOCK_SIZE bsize, - PICK_MODE_CONTEXT *ctx, - int64_t best_rd_so_far); - -void vp9_rd_pick_inter_mode_sub8x8(struct VP9_COMP *cpi, - struct TileDataEnc *tile_data, - struct macroblock *x, - int mi_row, int mi_col, - struct RD_COST *rd_cost, - BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx, - int64_t best_rd_so_far); -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_RDOPT_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_resize.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_resize.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_resize.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_resize.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,924 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include -#include -#include -#include - -#include "vp9/common/vp9_common.h" -#include "vp9/encoder/vp9_resize.h" - -#define FILTER_BITS 7 - -#define INTERP_TAPS 8 -#define SUBPEL_BITS 5 -#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1) -#define INTERP_PRECISION_BITS 32 - -typedef int16_t interp_kernel[INTERP_TAPS]; - -// Filters for interpolation (0.5-band) - note this also filters integer pels. -const interp_kernel vp9_filteredinterp_filters500[(1 << SUBPEL_BITS)] = { - {-3, 0, 35, 64, 35, 0, -3, 0}, - {-3, -1, 34, 64, 36, 1, -3, 0}, - {-3, -1, 32, 64, 38, 1, -3, 0}, - {-2, -2, 31, 63, 39, 2, -3, 0}, - {-2, -2, 29, 63, 41, 2, -3, 0}, - {-2, -2, 28, 63, 42, 3, -4, 0}, - {-2, -3, 27, 63, 43, 4, -4, 0}, - {-2, -3, 25, 62, 45, 5, -4, 0}, - {-2, -3, 24, 62, 46, 5, -4, 0}, - {-2, -3, 23, 61, 47, 6, -4, 0}, - {-2, -3, 21, 60, 49, 7, -4, 0}, - {-1, -4, 20, 60, 50, 8, -4, -1}, - {-1, -4, 19, 59, 51, 9, -4, -1}, - {-1, -4, 17, 58, 52, 10, -4, 0}, - {-1, -4, 16, 57, 53, 12, -4, -1}, - {-1, -4, 15, 56, 54, 13, -4, -1}, - {-1, -4, 14, 55, 55, 14, -4, -1}, - {-1, -4, 13, 54, 56, 15, -4, -1}, - {-1, -4, 12, 53, 57, 16, -4, -1}, - {0, -4, 10, 52, 58, 17, -4, -1}, - {-1, -4, 9, 51, 59, 19, -4, -1}, - {-1, -4, 8, 50, 60, 20, -4, -1}, - {0, -4, 7, 49, 60, 21, -3, -2}, - {0, -4, 6, 47, 61, 23, -3, -2}, - {0, -4, 5, 46, 62, 24, -3, -2}, - {0, -4, 5, 45, 62, 25, -3, -2}, - {0, -4, 4, 43, 63, 27, -3, -2}, - {0, -4, 3, 42, 63, 28, -2, -2}, - {0, -3, 2, 41, 63, 29, -2, -2}, - {0, -3, 2, 39, 63, 31, -2, -2}, - {0, -3, 1, 38, 64, 32, -1, -3}, - {0, -3, 1, 36, 64, 34, -1, -3} -}; - -// Filters for interpolation (0.625-band) - note this also filters integer pels. -const interp_kernel vp9_filteredinterp_filters625[(1 << SUBPEL_BITS)] = { - {-1, -8, 33, 80, 33, -8, -1, 0}, - {-1, -8, 30, 80, 35, -8, -1, 1}, - {-1, -8, 28, 80, 37, -7, -2, 1}, - {0, -8, 26, 79, 39, -7, -2, 1}, - {0, -8, 24, 79, 41, -7, -2, 1}, - {0, -8, 22, 78, 43, -6, -2, 1}, - {0, -8, 20, 78, 45, -5, -3, 1}, - {0, -8, 18, 77, 48, -5, -3, 1}, - {0, -8, 16, 76, 50, -4, -3, 1}, - {0, -8, 15, 75, 52, -3, -4, 1}, - {0, -7, 13, 74, 54, -3, -4, 1}, - {0, -7, 11, 73, 56, -2, -4, 1}, - {0, -7, 10, 71, 58, -1, -4, 1}, - {1, -7, 8, 70, 60, 0, -5, 1}, - {1, -6, 6, 68, 62, 1, -5, 1}, - {1, -6, 5, 67, 63, 2, -5, 1}, - {1, -6, 4, 65, 65, 4, -6, 1}, - {1, -5, 2, 63, 67, 5, -6, 1}, - {1, -5, 1, 62, 68, 6, -6, 1}, - {1, -5, 0, 60, 70, 8, -7, 1}, - {1, -4, -1, 58, 71, 10, -7, 0}, - {1, -4, -2, 56, 73, 11, -7, 0}, - {1, -4, -3, 54, 74, 13, -7, 0}, - {1, -4, -3, 52, 75, 15, -8, 0}, - {1, -3, -4, 50, 76, 16, -8, 0}, - {1, -3, -5, 48, 77, 18, -8, 0}, - {1, -3, -5, 45, 78, 20, -8, 0}, - {1, -2, -6, 43, 78, 22, -8, 0}, - {1, -2, -7, 41, 79, 24, -8, 0}, - {1, -2, -7, 39, 79, 26, -8, 0}, - {1, -2, -7, 37, 80, 28, -8, -1}, - {1, -1, -8, 35, 80, 30, -8, -1}, -}; - -// Filters for interpolation (0.75-band) - note this also filters integer pels. -const interp_kernel vp9_filteredinterp_filters750[(1 << SUBPEL_BITS)] = { - {2, -11, 25, 96, 25, -11, 2, 0}, - {2, -11, 22, 96, 28, -11, 2, 0}, - {2, -10, 19, 95, 31, -11, 2, 0}, - {2, -10, 17, 95, 34, -12, 2, 0}, - {2, -9, 14, 94, 37, -12, 2, 0}, - {2, -8, 12, 93, 40, -12, 1, 0}, - {2, -8, 9, 92, 43, -12, 1, 1}, - {2, -7, 7, 91, 46, -12, 1, 0}, - {2, -7, 5, 90, 49, -12, 1, 0}, - {2, -6, 3, 88, 52, -12, 0, 1}, - {2, -5, 1, 86, 55, -12, 0, 1}, - {2, -5, -1, 84, 58, -11, 0, 1}, - {2, -4, -2, 82, 61, -11, -1, 1}, - {2, -4, -4, 80, 64, -10, -1, 1}, - {1, -3, -5, 77, 67, -9, -1, 1}, - {1, -3, -6, 75, 70, -8, -2, 1}, - {1, -2, -7, 72, 72, -7, -2, 1}, - {1, -2, -8, 70, 75, -6, -3, 1}, - {1, -1, -9, 67, 77, -5, -3, 1}, - {1, -1, -10, 64, 80, -4, -4, 2}, - {1, -1, -11, 61, 82, -2, -4, 2}, - {1, 0, -11, 58, 84, -1, -5, 2}, - {1, 0, -12, 55, 86, 1, -5, 2}, - {1, 0, -12, 52, 88, 3, -6, 2}, - {0, 1, -12, 49, 90, 5, -7, 2}, - {0, 1, -12, 46, 91, 7, -7, 2}, - {1, 1, -12, 43, 92, 9, -8, 2}, - {0, 1, -12, 40, 93, 12, -8, 2}, - {0, 2, -12, 37, 94, 14, -9, 2}, - {0, 2, -12, 34, 95, 17, -10, 2}, - {0, 2, -11, 31, 95, 19, -10, 2}, - {0, 2, -11, 28, 96, 22, -11, 2} -}; - -// Filters for interpolation (0.875-band) - note this also filters integer pels. -const interp_kernel vp9_filteredinterp_filters875[(1 << SUBPEL_BITS)] = { - {3, -8, 13, 112, 13, -8, 3, 0}, - {3, -7, 10, 112, 17, -9, 3, -1}, - {2, -6, 7, 111, 21, -9, 3, -1}, - {2, -5, 4, 111, 24, -10, 3, -1}, - {2, -4, 1, 110, 28, -11, 3, -1}, - {1, -3, -1, 108, 32, -12, 4, -1}, - {1, -2, -3, 106, 36, -13, 4, -1}, - {1, -1, -6, 105, 40, -14, 4, -1}, - {1, -1, -7, 102, 44, -14, 4, -1}, - {1, 0, -9, 100, 48, -15, 4, -1}, - {1, 1, -11, 97, 53, -16, 4, -1}, - {0, 1, -12, 95, 57, -16, 4, -1}, - {0, 2, -13, 91, 61, -16, 4, -1}, - {0, 2, -14, 88, 65, -16, 4, -1}, - {0, 3, -15, 84, 69, -17, 4, 0}, - {0, 3, -16, 81, 73, -16, 3, 0}, - {0, 3, -16, 77, 77, -16, 3, 0}, - {0, 3, -16, 73, 81, -16, 3, 0}, - {0, 4, -17, 69, 84, -15, 3, 0}, - {-1, 4, -16, 65, 88, -14, 2, 0}, - {-1, 4, -16, 61, 91, -13, 2, 0}, - {-1, 4, -16, 57, 95, -12, 1, 0}, - {-1, 4, -16, 53, 97, -11, 1, 1}, - {-1, 4, -15, 48, 100, -9, 0, 1}, - {-1, 4, -14, 44, 102, -7, -1, 1}, - {-1, 4, -14, 40, 105, -6, -1, 1}, - {-1, 4, -13, 36, 106, -3, -2, 1}, - {-1, 4, -12, 32, 108, -1, -3, 1}, - {-1, 3, -11, 28, 110, 1, -4, 2}, - {-1, 3, -10, 24, 111, 4, -5, 2}, - {-1, 3, -9, 21, 111, 7, -6, 2}, - {-1, 3, -9, 17, 112, 10, -7, 3} -}; - -// Filters for interpolation (full-band) - no filtering for integer pixels -const interp_kernel vp9_filteredinterp_filters1000[(1 << SUBPEL_BITS)] = { - {0, 0, 0, 128, 0, 0, 0, 0}, - {0, 1, -3, 128, 3, -1, 0, 0}, - {-1, 2, -6, 127, 7, -2, 1, 0}, - {-1, 3, -9, 126, 12, -4, 1, 0}, - {-1, 4, -12, 125, 16, -5, 1, 0}, - {-1, 4, -14, 123, 20, -6, 2, 0}, - {-1, 5, -15, 120, 25, -8, 2, 0}, - {-1, 5, -17, 118, 30, -9, 3, -1}, - {-1, 6, -18, 114, 35, -10, 3, -1}, - {-1, 6, -19, 111, 41, -12, 3, -1}, - {-1, 6, -20, 107, 46, -13, 4, -1}, - {-1, 6, -21, 103, 52, -14, 4, -1}, - {-1, 6, -21, 99, 57, -16, 5, -1}, - {-1, 6, -21, 94, 63, -17, 5, -1}, - {-1, 6, -20, 89, 68, -18, 5, -1}, - {-1, 6, -20, 84, 73, -19, 6, -1}, - {-1, 6, -20, 79, 79, -20, 6, -1}, - {-1, 6, -19, 73, 84, -20, 6, -1}, - {-1, 5, -18, 68, 89, -20, 6, -1}, - {-1, 5, -17, 63, 94, -21, 6, -1}, - {-1, 5, -16, 57, 99, -21, 6, -1}, - {-1, 4, -14, 52, 103, -21, 6, -1}, - {-1, 4, -13, 46, 107, -20, 6, -1}, - {-1, 3, -12, 41, 111, -19, 6, -1}, - {-1, 3, -10, 35, 114, -18, 6, -1}, - {-1, 3, -9, 30, 118, -17, 5, -1}, - {0, 2, -8, 25, 120, -15, 5, -1}, - {0, 2, -6, 20, 123, -14, 4, -1}, - {0, 1, -5, 16, 125, -12, 4, -1}, - {0, 1, -4, 12, 126, -9, 3, -1}, - {0, 1, -2, 7, 127, -6, 2, -1}, - {0, 0, -1, 3, 128, -3, 1, 0} -}; - -// Filters for factor of 2 downsampling. -static const int16_t vp9_down2_symeven_half_filter[] = {56, 12, -3, -1}; -static const int16_t vp9_down2_symodd_half_filter[] = {64, 35, 0, -3}; - -static const interp_kernel *choose_interp_filter(int inlength, int outlength) { - int outlength16 = outlength * 16; - if (outlength16 >= inlength * 16) - return vp9_filteredinterp_filters1000; - else if (outlength16 >= inlength * 13) - return vp9_filteredinterp_filters875; - else if (outlength16 >= inlength * 11) - return vp9_filteredinterp_filters750; - else if (outlength16 >= inlength * 9) - return vp9_filteredinterp_filters625; - else - return vp9_filteredinterp_filters500; -} - -static void interpolate(const uint8_t *const input, int inlength, - uint8_t *output, int outlength) { - const int64_t delta = (((uint64_t)inlength << 32) + outlength / 2) / - outlength; - const int64_t offset = inlength > outlength ? - (((int64_t)(inlength - outlength) << 31) + outlength / 2) / outlength : - -(((int64_t)(outlength - inlength) << 31) + outlength / 2) / outlength; - uint8_t *optr = output; - int x, x1, x2, sum, k, int_pel, sub_pel; - int64_t y; - - const interp_kernel *interp_filters = - choose_interp_filter(inlength, outlength); - - x = 0; - y = offset; - while ((y >> INTERP_PRECISION_BITS) < (INTERP_TAPS / 2 - 1)) { - x++; - y += delta; - } - x1 = x; - x = outlength - 1; - y = delta * x + offset; - while ((y >> INTERP_PRECISION_BITS) + - (int64_t)(INTERP_TAPS / 2) >= inlength) { - x--; - y -= delta; - } - x2 = x; - if (x1 > x2) { - for (x = 0, y = offset; x < outlength; ++x, y += delta) { - const int16_t *filter; - int_pel = y >> INTERP_PRECISION_BITS; - sub_pel = (y >> (INTERP_PRECISION_BITS - SUBPEL_BITS)) & SUBPEL_MASK; - filter = interp_filters[sub_pel]; - sum = 0; - for (k = 0; k < INTERP_TAPS; ++k) { - const int pk = int_pel - INTERP_TAPS / 2 + 1 + k; - sum += filter[k] * input[(pk < 0 ? 0 : - (pk >= inlength ? inlength - 1 : pk))]; - } - *optr++ = clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS)); - } - } else { - // Initial part. - for (x = 0, y = offset; x < x1; ++x, y += delta) { - const int16_t *filter; - int_pel = y >> INTERP_PRECISION_BITS; - sub_pel = (y >> (INTERP_PRECISION_BITS - SUBPEL_BITS)) & SUBPEL_MASK; - filter = interp_filters[sub_pel]; - sum = 0; - for (k = 0; k < INTERP_TAPS; ++k) - sum += filter[k] * input[(int_pel - INTERP_TAPS / 2 + 1 + k < 0 ? - 0 : - int_pel - INTERP_TAPS / 2 + 1 + k)]; - *optr++ = clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS)); - } - // Middle part. - for (; x <= x2; ++x, y += delta) { - const int16_t *filter; - int_pel = y >> INTERP_PRECISION_BITS; - sub_pel = (y >> (INTERP_PRECISION_BITS - SUBPEL_BITS)) & SUBPEL_MASK; - filter = interp_filters[sub_pel]; - sum = 0; - for (k = 0; k < INTERP_TAPS; ++k) - sum += filter[k] * input[int_pel - INTERP_TAPS / 2 + 1 + k]; - *optr++ = clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS)); - } - // End part. - for (; x < outlength; ++x, y += delta) { - const int16_t *filter; - int_pel = y >> INTERP_PRECISION_BITS; - sub_pel = (y >> (INTERP_PRECISION_BITS - SUBPEL_BITS)) & SUBPEL_MASK; - filter = interp_filters[sub_pel]; - sum = 0; - for (k = 0; k < INTERP_TAPS; ++k) - sum += filter[k] * input[(int_pel - INTERP_TAPS / 2 + 1 + k >= - inlength ? inlength - 1 : - int_pel - INTERP_TAPS / 2 + 1 + k)]; - *optr++ = clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS)); - } - } -} - -static void down2_symeven(const uint8_t *const input, int length, - uint8_t *output) { - // Actual filter len = 2 * filter_len_half. - const int16_t *filter = vp9_down2_symeven_half_filter; - const int filter_len_half = sizeof(vp9_down2_symeven_half_filter) / 2; - int i, j; - uint8_t *optr = output; - int l1 = filter_len_half; - int l2 = (length - filter_len_half); - l1 += (l1 & 1); - l2 += (l2 & 1); - if (l1 > l2) { - // Short input length. - for (i = 0; i < length; i += 2) { - int sum = (1 << (FILTER_BITS - 1)); - for (j = 0; j < filter_len_half; ++j) { - sum += (input[(i - j < 0 ? 0 : i - j)] + - input[(i + 1 + j >= length ? length - 1 : i + 1 + j)]) * - filter[j]; - } - sum >>= FILTER_BITS; - *optr++ = clip_pixel(sum); - } - } else { - // Initial part. - for (i = 0; i < l1; i += 2) { - int sum = (1 << (FILTER_BITS - 1)); - for (j = 0; j < filter_len_half; ++j) { - sum += (input[(i - j < 0 ? 0 : i - j)] + input[i + 1 + j]) * filter[j]; - } - sum >>= FILTER_BITS; - *optr++ = clip_pixel(sum); - } - // Middle part. - for (; i < l2; i += 2) { - int sum = (1 << (FILTER_BITS - 1)); - for (j = 0; j < filter_len_half; ++j) { - sum += (input[i - j] + input[i + 1 + j]) * filter[j]; - } - sum >>= FILTER_BITS; - *optr++ = clip_pixel(sum); - } - // End part. - for (; i < length; i += 2) { - int sum = (1 << (FILTER_BITS - 1)); - for (j = 0; j < filter_len_half; ++j) { - sum += (input[i - j] + - input[(i + 1 + j >= length ? length - 1 : i + 1 + j)]) * - filter[j]; - } - sum >>= FILTER_BITS; - *optr++ = clip_pixel(sum); - } - } -} - -static void down2_symodd(const uint8_t *const input, int length, - uint8_t *output) { - // Actual filter len = 2 * filter_len_half - 1. - const int16_t *filter = vp9_down2_symodd_half_filter; - const int filter_len_half = sizeof(vp9_down2_symodd_half_filter) / 2; - int i, j; - uint8_t *optr = output; - int l1 = filter_len_half - 1; - int l2 = (length - filter_len_half + 1); - l1 += (l1 & 1); - l2 += (l2 & 1); - if (l1 > l2) { - // Short input length. - for (i = 0; i < length; i += 2) { - int sum = (1 << (FILTER_BITS - 1)) + input[i] * filter[0]; - for (j = 1; j < filter_len_half; ++j) { - sum += (input[(i - j < 0 ? 0 : i - j)] + - input[(i + j >= length ? length - 1 : i + j)]) * - filter[j]; - } - sum >>= FILTER_BITS; - *optr++ = clip_pixel(sum); - } - } else { - // Initial part. - for (i = 0; i < l1; i += 2) { - int sum = (1 << (FILTER_BITS - 1)) + input[i] * filter[0]; - for (j = 1; j < filter_len_half; ++j) { - sum += (input[(i - j < 0 ? 0 : i - j)] + input[i + j]) * filter[j]; - } - sum >>= FILTER_BITS; - *optr++ = clip_pixel(sum); - } - // Middle part. - for (; i < l2; i += 2) { - int sum = (1 << (FILTER_BITS - 1)) + input[i] * filter[0]; - for (j = 1; j < filter_len_half; ++j) { - sum += (input[i - j] + input[i + j]) * filter[j]; - } - sum >>= FILTER_BITS; - *optr++ = clip_pixel(sum); - } - // End part. - for (; i < length; i += 2) { - int sum = (1 << (FILTER_BITS - 1)) + input[i] * filter[0]; - for (j = 1; j < filter_len_half; ++j) { - sum += (input[i - j] + input[(i + j >= length ? length - 1 : i + j)]) * - filter[j]; - } - sum >>= FILTER_BITS; - *optr++ = clip_pixel(sum); - } - } -} - -static int get_down2_length(int length, int steps) { - int s; - for (s = 0; s < steps; ++s) - length = (length + 1) >> 1; - return length; -} - -int get_down2_steps(int in_length, int out_length) { - int steps = 0; - int proj_in_length; - while ((proj_in_length = get_down2_length(in_length, 1)) >= out_length) { - ++steps; - in_length = proj_in_length; - } - return steps; -} - -static void resize_multistep(const uint8_t *const input, - int length, - uint8_t *output, - int olength, - uint8_t *buf) { - int steps; - if (length == olength) { - memcpy(output, input, sizeof(uint8_t) * length); - return; - } - steps = get_down2_steps(length, olength); - - if (steps > 0) { - int s; - uint8_t *out = NULL; - uint8_t *tmpbuf = NULL; - uint8_t *otmp, *otmp2; - int filteredlength = length; - if (!tmpbuf) { - tmpbuf = (uint8_t *)malloc(sizeof(uint8_t) * length); - otmp = tmpbuf; - } else { - otmp = buf; - } - otmp2 = otmp + get_down2_length(length, 1); - for (s = 0; s < steps; ++s) { - const int proj_filteredlength = get_down2_length(filteredlength, 1); - const uint8_t *const in = (s == 0 ? input : out); - if (s == steps - 1 && proj_filteredlength == olength) - out = output; - else - out = (s & 1 ? otmp2 : otmp); - if (filteredlength & 1) - down2_symodd(in, filteredlength, out); - else - down2_symeven(in, filteredlength, out); - filteredlength = proj_filteredlength; - } - if (filteredlength != olength) { - interpolate(out, filteredlength, output, olength); - } - if (tmpbuf) - free(tmpbuf); - } else { - interpolate(input, length, output, olength); - } -} - -static void fill_col_to_arr(uint8_t *img, int stride, int len, uint8_t *arr) { - int i; - uint8_t *iptr = img; - uint8_t *aptr = arr; - for (i = 0; i < len; ++i, iptr += stride) { - *aptr++ = *iptr; - } -} - -static void fill_arr_to_col(uint8_t *img, int stride, int len, uint8_t *arr) { - int i; - uint8_t *iptr = img; - uint8_t *aptr = arr; - for (i = 0; i < len; ++i, iptr += stride) { - *iptr = *aptr++; - } -} - -void vp9_resize_plane(const uint8_t *const input, - int height, - int width, - int in_stride, - uint8_t *output, - int height2, - int width2, - int out_stride) { - int i; - uint8_t *intbuf = (uint8_t *)malloc(sizeof(uint8_t) * width2 * height); - uint8_t *tmpbuf = (uint8_t *)malloc(sizeof(uint8_t) * - (width < height ? height : width)); - uint8_t *arrbuf = (uint8_t *)malloc(sizeof(uint8_t) * (height + height2)); - assert(width > 0); - assert(height > 0); - assert(width2 > 0); - assert(height2 > 0); - for (i = 0; i < height; ++i) - resize_multistep(input + in_stride * i, width, - intbuf + width2 * i, width2, tmpbuf); - for (i = 0; i < width2; ++i) { - fill_col_to_arr(intbuf + i, width2, height, arrbuf); - resize_multistep(arrbuf, height, arrbuf + height, height2, tmpbuf); - fill_arr_to_col(output + i, out_stride, height2, arrbuf + height); - } - free(intbuf); - free(tmpbuf); - free(arrbuf); -} - -#if CONFIG_VP9_HIGHBITDEPTH -static void highbd_interpolate(const uint16_t *const input, int inlength, - uint16_t *output, int outlength, int bd) { - const int64_t delta = - (((uint64_t)inlength << 32) + outlength / 2) / outlength; - const int64_t offset = inlength > outlength ? - (((int64_t)(inlength - outlength) << 31) + outlength / 2) / outlength : - -(((int64_t)(outlength - inlength) << 31) + outlength / 2) / outlength; - uint16_t *optr = output; - int x, x1, x2, sum, k, int_pel, sub_pel; - int64_t y; - - const interp_kernel *interp_filters = - choose_interp_filter(inlength, outlength); - - x = 0; - y = offset; - while ((y >> INTERP_PRECISION_BITS) < (INTERP_TAPS / 2 - 1)) { - x++; - y += delta; - } - x1 = x; - x = outlength - 1; - y = delta * x + offset; - while ((y >> INTERP_PRECISION_BITS) + - (int64_t)(INTERP_TAPS / 2) >= inlength) { - x--; - y -= delta; - } - x2 = x; - if (x1 > x2) { - for (x = 0, y = offset; x < outlength; ++x, y += delta) { - const int16_t *filter; - int_pel = y >> INTERP_PRECISION_BITS; - sub_pel = (y >> (INTERP_PRECISION_BITS - SUBPEL_BITS)) & SUBPEL_MASK; - filter = interp_filters[sub_pel]; - sum = 0; - for (k = 0; k < INTERP_TAPS; ++k) { - const int pk = int_pel - INTERP_TAPS / 2 + 1 + k; - sum += filter[k] * - input[(pk < 0 ? 0 : (pk >= inlength ? inlength - 1 : pk))]; - } - *optr++ = clip_pixel_highbd(ROUND_POWER_OF_TWO(sum, FILTER_BITS), bd); - } - } else { - // Initial part. - for (x = 0, y = offset; x < x1; ++x, y += delta) { - const int16_t *filter; - int_pel = y >> INTERP_PRECISION_BITS; - sub_pel = (y >> (INTERP_PRECISION_BITS - SUBPEL_BITS)) & SUBPEL_MASK; - filter = interp_filters[sub_pel]; - sum = 0; - for (k = 0; k < INTERP_TAPS; ++k) - sum += filter[k] * - input[(int_pel - INTERP_TAPS / 2 + 1 + k < 0 ? - 0 : int_pel - INTERP_TAPS / 2 + 1 + k)]; - *optr++ = clip_pixel_highbd(ROUND_POWER_OF_TWO(sum, FILTER_BITS), bd); - } - // Middle part. - for (; x <= x2; ++x, y += delta) { - const int16_t *filter; - int_pel = y >> INTERP_PRECISION_BITS; - sub_pel = (y >> (INTERP_PRECISION_BITS - SUBPEL_BITS)) & SUBPEL_MASK; - filter = interp_filters[sub_pel]; - sum = 0; - for (k = 0; k < INTERP_TAPS; ++k) - sum += filter[k] * input[int_pel - INTERP_TAPS / 2 + 1 + k]; - *optr++ = clip_pixel_highbd(ROUND_POWER_OF_TWO(sum, FILTER_BITS), bd); - } - // End part. - for (; x < outlength; ++x, y += delta) { - const int16_t *filter; - int_pel = y >> INTERP_PRECISION_BITS; - sub_pel = (y >> (INTERP_PRECISION_BITS - SUBPEL_BITS)) & SUBPEL_MASK; - filter = interp_filters[sub_pel]; - sum = 0; - for (k = 0; k < INTERP_TAPS; ++k) - sum += filter[k] * input[(int_pel - INTERP_TAPS / 2 + 1 + k >= - inlength ? inlength - 1 : - int_pel - INTERP_TAPS / 2 + 1 + k)]; - *optr++ = clip_pixel_highbd(ROUND_POWER_OF_TWO(sum, FILTER_BITS), bd); - } - } -} - -static void highbd_down2_symeven(const uint16_t *const input, int length, - uint16_t *output, int bd) { - // Actual filter len = 2 * filter_len_half. - static const int16_t *filter = vp9_down2_symeven_half_filter; - const int filter_len_half = sizeof(vp9_down2_symeven_half_filter) / 2; - int i, j; - uint16_t *optr = output; - int l1 = filter_len_half; - int l2 = (length - filter_len_half); - l1 += (l1 & 1); - l2 += (l2 & 1); - if (l1 > l2) { - // Short input length. - for (i = 0; i < length; i += 2) { - int sum = (1 << (FILTER_BITS - 1)); - for (j = 0; j < filter_len_half; ++j) { - sum += (input[(i - j < 0 ? 0 : i - j)] + - input[(i + 1 + j >= length ? length - 1 : i + 1 + j)]) * - filter[j]; - } - sum >>= FILTER_BITS; - *optr++ = clip_pixel_highbd(sum, bd); - } - } else { - // Initial part. - for (i = 0; i < l1; i += 2) { - int sum = (1 << (FILTER_BITS - 1)); - for (j = 0; j < filter_len_half; ++j) { - sum += (input[(i - j < 0 ? 0 : i - j)] + input[i + 1 + j]) * filter[j]; - } - sum >>= FILTER_BITS; - *optr++ = clip_pixel_highbd(sum, bd); - } - // Middle part. - for (; i < l2; i += 2) { - int sum = (1 << (FILTER_BITS - 1)); - for (j = 0; j < filter_len_half; ++j) { - sum += (input[i - j] + input[i + 1 + j]) * filter[j]; - } - sum >>= FILTER_BITS; - *optr++ = clip_pixel_highbd(sum, bd); - } - // End part. - for (; i < length; i += 2) { - int sum = (1 << (FILTER_BITS - 1)); - for (j = 0; j < filter_len_half; ++j) { - sum += (input[i - j] + - input[(i + 1 + j >= length ? length - 1 : i + 1 + j)]) * - filter[j]; - } - sum >>= FILTER_BITS; - *optr++ = clip_pixel_highbd(sum, bd); - } - } -} - -static void highbd_down2_symodd(const uint16_t *const input, int length, - uint16_t *output, int bd) { - // Actual filter len = 2 * filter_len_half - 1. - static const int16_t *filter = vp9_down2_symodd_half_filter; - const int filter_len_half = sizeof(vp9_down2_symodd_half_filter) / 2; - int i, j; - uint16_t *optr = output; - int l1 = filter_len_half - 1; - int l2 = (length - filter_len_half + 1); - l1 += (l1 & 1); - l2 += (l2 & 1); - if (l1 > l2) { - // Short input length. - for (i = 0; i < length; i += 2) { - int sum = (1 << (FILTER_BITS - 1)) + input[i] * filter[0]; - for (j = 1; j < filter_len_half; ++j) { - sum += (input[(i - j < 0 ? 0 : i - j)] + - input[(i + j >= length ? length - 1 : i + j)]) * - filter[j]; - } - sum >>= FILTER_BITS; - *optr++ = clip_pixel_highbd(sum, bd); - } - } else { - // Initial part. - for (i = 0; i < l1; i += 2) { - int sum = (1 << (FILTER_BITS - 1)) + input[i] * filter[0]; - for (j = 1; j < filter_len_half; ++j) { - sum += (input[(i - j < 0 ? 0 : i - j)] + input[i + j]) * filter[j]; - } - sum >>= FILTER_BITS; - *optr++ = clip_pixel_highbd(sum, bd); - } - // Middle part. - for (; i < l2; i += 2) { - int sum = (1 << (FILTER_BITS - 1)) + input[i] * filter[0]; - for (j = 1; j < filter_len_half; ++j) { - sum += (input[i - j] + input[i + j]) * filter[j]; - } - sum >>= FILTER_BITS; - *optr++ = clip_pixel_highbd(sum, bd); - } - // End part. - for (; i < length; i += 2) { - int sum = (1 << (FILTER_BITS - 1)) + input[i] * filter[0]; - for (j = 1; j < filter_len_half; ++j) { - sum += (input[i - j] + input[(i + j >= length ? length - 1 : i + j)]) * - filter[j]; - } - sum >>= FILTER_BITS; - *optr++ = clip_pixel_highbd(sum, bd); - } - } -} - -static void highbd_resize_multistep(const uint16_t *const input, - int length, - uint16_t *output, - int olength, - uint16_t *buf, - int bd) { - int steps; - if (length == olength) { - memcpy(output, input, sizeof(uint16_t) * length); - return; - } - steps = get_down2_steps(length, olength); - - if (steps > 0) { - int s; - uint16_t *out = NULL; - uint16_t *tmpbuf = NULL; - uint16_t *otmp, *otmp2; - int filteredlength = length; - if (!tmpbuf) { - tmpbuf = (uint16_t *)malloc(sizeof(uint16_t) * length); - otmp = tmpbuf; - } else { - otmp = buf; - } - otmp2 = otmp + get_down2_length(length, 1); - for (s = 0; s < steps; ++s) { - const int proj_filteredlength = get_down2_length(filteredlength, 1); - const uint16_t *const in = (s == 0 ? input : out); - if (s == steps - 1 && proj_filteredlength == olength) - out = output; - else - out = (s & 1 ? otmp2 : otmp); - if (filteredlength & 1) - highbd_down2_symodd(in, filteredlength, out, bd); - else - highbd_down2_symeven(in, filteredlength, out, bd); - filteredlength = proj_filteredlength; - } - if (filteredlength != olength) { - highbd_interpolate(out, filteredlength, output, olength, bd); - } - if (tmpbuf) - free(tmpbuf); - } else { - highbd_interpolate(input, length, output, olength, bd); - } -} - -static void highbd_fill_col_to_arr(uint16_t *img, int stride, int len, - uint16_t *arr) { - int i; - uint16_t *iptr = img; - uint16_t *aptr = arr; - for (i = 0; i < len; ++i, iptr += stride) { - *aptr++ = *iptr; - } -} - -static void highbd_fill_arr_to_col(uint16_t *img, int stride, int len, - uint16_t *arr) { - int i; - uint16_t *iptr = img; - uint16_t *aptr = arr; - for (i = 0; i < len; ++i, iptr += stride) { - *iptr = *aptr++; - } -} - -void vp9_highbd_resize_plane(const uint8_t *const input, - int height, - int width, - int in_stride, - uint8_t *output, - int height2, - int width2, - int out_stride, - int bd) { - int i; - uint16_t *intbuf = (uint16_t *)malloc(sizeof(uint16_t) * width2 * height); - uint16_t *tmpbuf = (uint16_t *)malloc(sizeof(uint16_t) * - (width < height ? height : width)); - uint16_t *arrbuf = (uint16_t *)malloc(sizeof(uint16_t) * (height + height2)); - for (i = 0; i < height; ++i) { - highbd_resize_multistep(CONVERT_TO_SHORTPTR(input + in_stride * i), width, - intbuf + width2 * i, width2, tmpbuf, bd); - } - for (i = 0; i < width2; ++i) { - highbd_fill_col_to_arr(intbuf + i, width2, height, arrbuf); - highbd_resize_multistep(arrbuf, height, arrbuf + height, height2, tmpbuf, - bd); - highbd_fill_arr_to_col(CONVERT_TO_SHORTPTR(output + i), out_stride, height2, - arrbuf + height); - } - free(intbuf); - free(tmpbuf); - free(arrbuf); -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -void vp9_resize_frame420(const uint8_t *const y, - int y_stride, - const uint8_t *const u, const uint8_t *const v, - int uv_stride, - int height, int width, - uint8_t *oy, int oy_stride, - uint8_t *ou, uint8_t *ov, int ouv_stride, - int oheight, int owidth) { - vp9_resize_plane(y, height, width, y_stride, - oy, oheight, owidth, oy_stride); - vp9_resize_plane(u, height / 2, width / 2, uv_stride, - ou, oheight / 2, owidth / 2, ouv_stride); - vp9_resize_plane(v, height / 2, width / 2, uv_stride, - ov, oheight / 2, owidth / 2, ouv_stride); -} - -void vp9_resize_frame422(const uint8_t *const y, int y_stride, - const uint8_t *const u, const uint8_t *const v, - int uv_stride, - int height, int width, - uint8_t *oy, int oy_stride, - uint8_t *ou, uint8_t *ov, int ouv_stride, - int oheight, int owidth) { - vp9_resize_plane(y, height, width, y_stride, - oy, oheight, owidth, oy_stride); - vp9_resize_plane(u, height, width / 2, uv_stride, - ou, oheight, owidth / 2, ouv_stride); - vp9_resize_plane(v, height, width / 2, uv_stride, - ov, oheight, owidth / 2, ouv_stride); -} - -void vp9_resize_frame444(const uint8_t *const y, int y_stride, - const uint8_t *const u, const uint8_t *const v, - int uv_stride, - int height, int width, - uint8_t *oy, int oy_stride, - uint8_t *ou, uint8_t *ov, int ouv_stride, - int oheight, int owidth) { - vp9_resize_plane(y, height, width, y_stride, - oy, oheight, owidth, oy_stride); - vp9_resize_plane(u, height, width, uv_stride, - ou, oheight, owidth, ouv_stride); - vp9_resize_plane(v, height, width, uv_stride, - ov, oheight, owidth, ouv_stride); -} - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_highbd_resize_frame420(const uint8_t *const y, - int y_stride, - const uint8_t *const u, const uint8_t *const v, - int uv_stride, - int height, int width, - uint8_t *oy, int oy_stride, - uint8_t *ou, uint8_t *ov, int ouv_stride, - int oheight, int owidth, int bd) { - vp9_highbd_resize_plane(y, height, width, y_stride, - oy, oheight, owidth, oy_stride, bd); - vp9_highbd_resize_plane(u, height / 2, width / 2, uv_stride, - ou, oheight / 2, owidth / 2, ouv_stride, bd); - vp9_highbd_resize_plane(v, height / 2, width / 2, uv_stride, - ov, oheight / 2, owidth / 2, ouv_stride, bd); -} - -void vp9_highbd_resize_frame422(const uint8_t *const y, int y_stride, - const uint8_t *const u, const uint8_t *const v, - int uv_stride, - int height, int width, - uint8_t *oy, int oy_stride, - uint8_t *ou, uint8_t *ov, int ouv_stride, - int oheight, int owidth, int bd) { - vp9_highbd_resize_plane(y, height, width, y_stride, - oy, oheight, owidth, oy_stride, bd); - vp9_highbd_resize_plane(u, height, width / 2, uv_stride, - ou, oheight, owidth / 2, ouv_stride, bd); - vp9_highbd_resize_plane(v, height, width / 2, uv_stride, - ov, oheight, owidth / 2, ouv_stride, bd); -} - -void vp9_highbd_resize_frame444(const uint8_t *const y, int y_stride, - const uint8_t *const u, const uint8_t *const v, - int uv_stride, - int height, int width, - uint8_t *oy, int oy_stride, - uint8_t *ou, uint8_t *ov, int ouv_stride, - int oheight, int owidth, int bd) { - vp9_highbd_resize_plane(y, height, width, y_stride, - oy, oheight, owidth, oy_stride, bd); - vp9_highbd_resize_plane(u, height, width, uv_stride, - ou, oheight, owidth, ouv_stride, bd); - vp9_highbd_resize_plane(v, height, width, uv_stride, - ov, oheight, owidth, ouv_stride, bd); -} -#endif // CONFIG_VP9_HIGHBITDEPTH diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_resize.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_resize.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_resize.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_resize.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_RESIZE_H_ -#define VP9_ENCODER_VP9_RESIZE_H_ - -#include -#include "vpx/vpx_integer.h" - -void vp9_resize_plane(const uint8_t *const input, - int height, - int width, - int in_stride, - uint8_t *output, - int height2, - int width2, - int out_stride); -void vp9_resize_frame420(const uint8_t *const y, - int y_stride, - const uint8_t *const u, - const uint8_t *const v, - int uv_stride, - int height, - int width, - uint8_t *oy, - int oy_stride, - uint8_t *ou, - uint8_t *ov, - int ouv_stride, - int oheight, - int owidth); -void vp9_resize_frame422(const uint8_t *const y, - int y_stride, - const uint8_t *const u, - const uint8_t *const v, - int uv_stride, - int height, - int width, - uint8_t *oy, - int oy_stride, - uint8_t *ou, - uint8_t *ov, - int ouv_stride, - int oheight, - int owidth); -void vp9_resize_frame444(const uint8_t *const y, - int y_stride, - const uint8_t *const u, - const uint8_t *const v, - int uv_stride, - int height, - int width, - uint8_t *oy, - int oy_stride, - uint8_t *ou, - uint8_t *ov, - int ouv_stride, - int oheight, - int owidth); - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_highbd_resize_plane(const uint8_t *const input, - int height, - int width, - int in_stride, - uint8_t *output, - int height2, - int width2, - int out_stride, - int bd); -void vp9_highbd_resize_frame420(const uint8_t *const y, - int y_stride, - const uint8_t *const u, - const uint8_t *const v, - int uv_stride, - int height, - int width, - uint8_t *oy, - int oy_stride, - uint8_t *ou, - uint8_t *ov, - int ouv_stride, - int oheight, - int owidth, - int bd); -void vp9_highbd_resize_frame422(const uint8_t *const y, - int y_stride, - const uint8_t *const u, - const uint8_t *const v, - int uv_stride, - int height, - int width, - uint8_t *oy, - int oy_stride, - uint8_t *ou, - uint8_t *ov, - int ouv_stride, - int oheight, - int owidth, - int bd); -void vp9_highbd_resize_frame444(const uint8_t *const y, - int y_stride, - const uint8_t *const u, - const uint8_t *const v, - int uv_stride, - int height, - int width, - uint8_t *oy, - int oy_stride, - uint8_t *ou, - uint8_t *ov, - int ouv_stride, - int oheight, - int owidth, - int bd); -#endif // CONFIG_VP9_HIGHBITDEPTH -#endif // VP9_ENCODER_VP9_RESIZE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_sad.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_sad.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_sad.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_sad.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,276 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "./vp9_rtcd.h" -#include "./vpx_config.h" - -#include "vpx/vpx_integer.h" -#if CONFIG_VP9_HIGHBITDEPTH -#include "vp9/common/vp9_common.h" -#endif -#include "vp9/encoder/vp9_variance.h" - -static INLINE unsigned int sad(const uint8_t *a, int a_stride, - const uint8_t *b, int b_stride, - int width, int height) { - int y, x; - unsigned int sad = 0; - - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - sad += abs(a[x] - b[x]); - - a += a_stride; - b += b_stride; - } - return sad; -} - -#define sadMxN(m, n) \ -unsigned int vp9_sad##m##x##n##_c(const uint8_t *src, int src_stride, \ - const uint8_t *ref, int ref_stride) { \ - return sad(src, src_stride, ref, ref_stride, m, n); \ -} \ -unsigned int vp9_sad##m##x##n##_avg_c(const uint8_t *src, int src_stride, \ - const uint8_t *ref, int ref_stride, \ - const uint8_t *second_pred) { \ - uint8_t comp_pred[m * n]; \ - vp9_comp_avg_pred(comp_pred, second_pred, m, n, ref, ref_stride); \ - return sad(src, src_stride, comp_pred, m, m, n); \ -} - -#define sadMxNxK(m, n, k) \ -void vp9_sad##m##x##n##x##k##_c(const uint8_t *src, int src_stride, \ - const uint8_t *ref, int ref_stride, \ - unsigned int *sads) { \ - int i; \ - for (i = 0; i < k; ++i) \ - sads[i] = vp9_sad##m##x##n##_c(src, src_stride, &ref[i], ref_stride); \ -} - -#define sadMxNx4D(m, n) \ -void vp9_sad##m##x##n##x4d_c(const uint8_t *src, int src_stride, \ - const uint8_t *const refs[], int ref_stride, \ - unsigned int *sads) { \ - int i; \ - for (i = 0; i < 4; ++i) \ - sads[i] = vp9_sad##m##x##n##_c(src, src_stride, refs[i], ref_stride); \ -} - -// 64x64 -sadMxN(64, 64) -sadMxNxK(64, 64, 3) -sadMxNxK(64, 64, 8) -sadMxNx4D(64, 64) - -// 64x32 -sadMxN(64, 32) -sadMxNx4D(64, 32) - -// 32x64 -sadMxN(32, 64) -sadMxNx4D(32, 64) - -// 32x32 -sadMxN(32, 32) -sadMxNxK(32, 32, 3) -sadMxNxK(32, 32, 8) -sadMxNx4D(32, 32) - -// 32x16 -sadMxN(32, 16) -sadMxNx4D(32, 16) - -// 16x32 -sadMxN(16, 32) -sadMxNx4D(16, 32) - -// 16x16 -sadMxN(16, 16) -sadMxNxK(16, 16, 3) -sadMxNxK(16, 16, 8) -sadMxNx4D(16, 16) - -// 16x8 -sadMxN(16, 8) -sadMxNxK(16, 8, 3) -sadMxNxK(16, 8, 8) -sadMxNx4D(16, 8) - -// 8x16 -sadMxN(8, 16) -sadMxNxK(8, 16, 3) -sadMxNxK(8, 16, 8) -sadMxNx4D(8, 16) - -// 8x8 -sadMxN(8, 8) -sadMxNxK(8, 8, 3) -sadMxNxK(8, 8, 8) -sadMxNx4D(8, 8) - -// 8x4 -sadMxN(8, 4) -sadMxNxK(8, 4, 8) -sadMxNx4D(8, 4) - -// 4x8 -sadMxN(4, 8) -sadMxNxK(4, 8, 8) -sadMxNx4D(4, 8) - -// 4x4 -sadMxN(4, 4) -sadMxNxK(4, 4, 3) -sadMxNxK(4, 4, 8) -sadMxNx4D(4, 4) - -#if CONFIG_VP9_HIGHBITDEPTH -static INLINE unsigned int highbd_sad(const uint8_t *a8, int a_stride, - const uint8_t *b8, int b_stride, - int width, int height) { - int y, x; - unsigned int sad = 0; - const uint16_t *a = CONVERT_TO_SHORTPTR(a8); - const uint16_t *b = CONVERT_TO_SHORTPTR(b8); - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - sad += abs(a[x] - b[x]); - - a += a_stride; - b += b_stride; - } - return sad; -} - -static INLINE unsigned int highbd_sadb(const uint8_t *a8, int a_stride, - const uint16_t *b, int b_stride, - int width, int height) { - int y, x; - unsigned int sad = 0; - const uint16_t *a = CONVERT_TO_SHORTPTR(a8); - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - sad += abs(a[x] - b[x]); - - a += a_stride; - b += b_stride; - } - return sad; -} - -#define highbd_sadMxN(m, n) \ -unsigned int vp9_highbd_sad##m##x##n##_c(const uint8_t *src, int src_stride, \ - const uint8_t *ref, int ref_stride) { \ - return highbd_sad(src, src_stride, ref, ref_stride, m, n); \ -} \ -unsigned int vp9_highbd_sad##m##x##n##_avg_c(const uint8_t *src, \ - int src_stride, \ - const uint8_t *ref, \ - int ref_stride, \ - const uint8_t *second_pred) { \ - uint16_t comp_pred[m * n]; \ - vp9_highbd_comp_avg_pred(comp_pred, second_pred, m, n, ref, ref_stride); \ - return highbd_sadb(src, src_stride, comp_pred, m, m, n); \ -} - -#define highbd_sadMxNxK(m, n, k) \ -void vp9_highbd_sad##m##x##n##x##k##_c(const uint8_t *src, int src_stride, \ - const uint8_t *ref, int ref_stride, \ - unsigned int *sads) { \ - int i; \ - for (i = 0; i < k; ++i) { \ - sads[i] = vp9_highbd_sad##m##x##n##_c(src, src_stride, &ref[i], \ - ref_stride); \ - } \ -} - -#define highbd_sadMxNx4D(m, n) \ -void vp9_highbd_sad##m##x##n##x4d_c(const uint8_t *src, int src_stride, \ - const uint8_t *const refs[], \ - int ref_stride, unsigned int *sads) { \ - int i; \ - for (i = 0; i < 4; ++i) { \ - sads[i] = vp9_highbd_sad##m##x##n##_c(src, src_stride, refs[i], \ - ref_stride); \ - } \ -} - -// 64x64 -highbd_sadMxN(64, 64) -highbd_sadMxNxK(64, 64, 3) -highbd_sadMxNxK(64, 64, 8) -highbd_sadMxNx4D(64, 64) - -// 64x32 -highbd_sadMxN(64, 32) -highbd_sadMxNx4D(64, 32) - -// 32x64 -highbd_sadMxN(32, 64) -highbd_sadMxNx4D(32, 64) - -// 32x32 -highbd_sadMxN(32, 32) -highbd_sadMxNxK(32, 32, 3) -highbd_sadMxNxK(32, 32, 8) -highbd_sadMxNx4D(32, 32) - -// 32x16 -highbd_sadMxN(32, 16) -highbd_sadMxNx4D(32, 16) - -// 16x32 -highbd_sadMxN(16, 32) -highbd_sadMxNx4D(16, 32) - -// 16x16 -highbd_sadMxN(16, 16) -highbd_sadMxNxK(16, 16, 3) -highbd_sadMxNxK(16, 16, 8) -highbd_sadMxNx4D(16, 16) - -// 16x8 -highbd_sadMxN(16, 8) -highbd_sadMxNxK(16, 8, 3) -highbd_sadMxNxK(16, 8, 8) -highbd_sadMxNx4D(16, 8) - -// 8x16 -highbd_sadMxN(8, 16) -highbd_sadMxNxK(8, 16, 3) -highbd_sadMxNxK(8, 16, 8) -highbd_sadMxNx4D(8, 16) - -// 8x8 -highbd_sadMxN(8, 8) -highbd_sadMxNxK(8, 8, 3) -highbd_sadMxNxK(8, 8, 8) -highbd_sadMxNx4D(8, 8) - -// 8x4 -highbd_sadMxN(8, 4) -highbd_sadMxNxK(8, 4, 8) -highbd_sadMxNx4D(8, 4) - -// 4x8 -highbd_sadMxN(4, 8) -highbd_sadMxNxK(4, 8, 8) -highbd_sadMxNx4D(4, 8) - -// 4x4 -highbd_sadMxN(4, 4) -highbd_sadMxNxK(4, 4, 3) -highbd_sadMxNxK(4, 4, 8) -highbd_sadMxNx4D(4, 4) - -#endif // CONFIG_VP9_HIGHBITDEPTH diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_segmentation.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_segmentation.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_segmentation.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_segmentation.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#include - -#include "vpx_mem/vpx_mem.h" - -#include "vp9/common/vp9_pred_common.h" -#include "vp9/common/vp9_tile_common.h" - -#include "vp9/encoder/vp9_cost.h" -#include "vp9/encoder/vp9_segmentation.h" - -void vp9_enable_segmentation(struct segmentation *seg) { - seg->enabled = 1; - seg->update_map = 1; - seg->update_data = 1; -} - -void vp9_disable_segmentation(struct segmentation *seg) { - seg->enabled = 0; - seg->update_map = 0; - seg->update_data = 0; -} - -void vp9_set_segment_data(struct segmentation *seg, - signed char *feature_data, - unsigned char abs_delta) { - seg->abs_delta = abs_delta; - - vpx_memcpy(seg->feature_data, feature_data, sizeof(seg->feature_data)); -} -void vp9_disable_segfeature(struct segmentation *seg, int segment_id, - SEG_LVL_FEATURES feature_id) { - seg->feature_mask[segment_id] &= ~(1 << feature_id); -} - -void vp9_clear_segdata(struct segmentation *seg, int segment_id, - SEG_LVL_FEATURES feature_id) { - seg->feature_data[segment_id][feature_id] = 0; -} - -// Based on set of segment counts calculate a probability tree -static void calc_segtree_probs(int *segcounts, vp9_prob *segment_tree_probs) { - // Work out probabilities of each segment - const int c01 = segcounts[0] + segcounts[1]; - const int c23 = segcounts[2] + segcounts[3]; - const int c45 = segcounts[4] + segcounts[5]; - const int c67 = segcounts[6] + segcounts[7]; - - segment_tree_probs[0] = get_binary_prob(c01 + c23, c45 + c67); - segment_tree_probs[1] = get_binary_prob(c01, c23); - segment_tree_probs[2] = get_binary_prob(c45, c67); - segment_tree_probs[3] = get_binary_prob(segcounts[0], segcounts[1]); - segment_tree_probs[4] = get_binary_prob(segcounts[2], segcounts[3]); - segment_tree_probs[5] = get_binary_prob(segcounts[4], segcounts[5]); - segment_tree_probs[6] = get_binary_prob(segcounts[6], segcounts[7]); -} - -// Based on set of segment counts and probabilities calculate a cost estimate -static int cost_segmap(int *segcounts, vp9_prob *probs) { - const int c01 = segcounts[0] + segcounts[1]; - const int c23 = segcounts[2] + segcounts[3]; - const int c45 = segcounts[4] + segcounts[5]; - const int c67 = segcounts[6] + segcounts[7]; - const int c0123 = c01 + c23; - const int c4567 = c45 + c67; - - // Cost the top node of the tree - int cost = c0123 * vp9_cost_zero(probs[0]) + - c4567 * vp9_cost_one(probs[0]); - - // Cost subsequent levels - if (c0123 > 0) { - cost += c01 * vp9_cost_zero(probs[1]) + - c23 * vp9_cost_one(probs[1]); - - if (c01 > 0) - cost += segcounts[0] * vp9_cost_zero(probs[3]) + - segcounts[1] * vp9_cost_one(probs[3]); - if (c23 > 0) - cost += segcounts[2] * vp9_cost_zero(probs[4]) + - segcounts[3] * vp9_cost_one(probs[4]); - } - - if (c4567 > 0) { - cost += c45 * vp9_cost_zero(probs[2]) + - c67 * vp9_cost_one(probs[2]); - - if (c45 > 0) - cost += segcounts[4] * vp9_cost_zero(probs[5]) + - segcounts[5] * vp9_cost_one(probs[5]); - if (c67 > 0) - cost += segcounts[6] * vp9_cost_zero(probs[6]) + - segcounts[7] * vp9_cost_one(probs[6]); - } - - return cost; -} - -static void count_segs(const VP9_COMMON *cm, MACROBLOCKD *xd, - const TileInfo *tile, MODE_INFO *mi, - int *no_pred_segcounts, - int (*temporal_predictor_count)[2], - int *t_unpred_seg_counts, - int bw, int bh, int mi_row, int mi_col) { - int segment_id; - - if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) - return; - - xd->mi = mi; - segment_id = xd->mi[0].src_mi->mbmi.segment_id; - - set_mi_row_col(xd, tile, mi_row, bh, mi_col, bw, cm->mi_rows, cm->mi_cols); - - // Count the number of hits on each segment with no prediction - no_pred_segcounts[segment_id]++; - - // Temporal prediction not allowed on key frames - if (cm->frame_type != KEY_FRAME) { - const BLOCK_SIZE bsize = xd->mi[0].src_mi->mbmi.sb_type; - // Test to see if the segment id matches the predicted value. - const int pred_segment_id = vp9_get_segment_id(cm, cm->last_frame_seg_map, - bsize, mi_row, mi_col); - const int pred_flag = pred_segment_id == segment_id; - const int pred_context = vp9_get_pred_context_seg_id(xd); - - // Store the prediction status for this mb and update counts - // as appropriate - xd->mi[0].src_mi->mbmi.seg_id_predicted = pred_flag; - temporal_predictor_count[pred_context][pred_flag]++; - - // Update the "unpredicted" segment count - if (!pred_flag) - t_unpred_seg_counts[segment_id]++; - } -} - -static void count_segs_sb(const VP9_COMMON *cm, MACROBLOCKD *xd, - const TileInfo *tile, MODE_INFO *mi, - int *no_pred_segcounts, - int (*temporal_predictor_count)[2], - int *t_unpred_seg_counts, - int mi_row, int mi_col, - BLOCK_SIZE bsize) { - const int mis = cm->mi_stride; - int bw, bh; - const int bs = num_8x8_blocks_wide_lookup[bsize], hbs = bs / 2; - - if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) - return; - - bw = num_8x8_blocks_wide_lookup[mi[0].src_mi->mbmi.sb_type]; - bh = num_8x8_blocks_high_lookup[mi[0].src_mi->mbmi.sb_type]; - - if (bw == bs && bh == bs) { - count_segs(cm, xd, tile, mi, no_pred_segcounts, temporal_predictor_count, - t_unpred_seg_counts, bs, bs, mi_row, mi_col); - } else if (bw == bs && bh < bs) { - count_segs(cm, xd, tile, mi, no_pred_segcounts, temporal_predictor_count, - t_unpred_seg_counts, bs, hbs, mi_row, mi_col); - count_segs(cm, xd, tile, mi + hbs * mis, no_pred_segcounts, - temporal_predictor_count, t_unpred_seg_counts, bs, hbs, - mi_row + hbs, mi_col); - } else if (bw < bs && bh == bs) { - count_segs(cm, xd, tile, mi, no_pred_segcounts, temporal_predictor_count, - t_unpred_seg_counts, hbs, bs, mi_row, mi_col); - count_segs(cm, xd, tile, mi + hbs, - no_pred_segcounts, temporal_predictor_count, t_unpred_seg_counts, - hbs, bs, mi_row, mi_col + hbs); - } else { - const BLOCK_SIZE subsize = subsize_lookup[PARTITION_SPLIT][bsize]; - int n; - - assert(bw < bs && bh < bs); - - for (n = 0; n < 4; n++) { - const int mi_dc = hbs * (n & 1); - const int mi_dr = hbs * (n >> 1); - - count_segs_sb(cm, xd, tile, &mi[mi_dr * mis + mi_dc], - no_pred_segcounts, temporal_predictor_count, - t_unpred_seg_counts, - mi_row + mi_dr, mi_col + mi_dc, subsize); - } - } -} - -void vp9_choose_segmap_coding_method(VP9_COMMON *cm, MACROBLOCKD *xd) { - struct segmentation *seg = &cm->seg; - - int no_pred_cost; - int t_pred_cost = INT_MAX; - - int i, tile_col, mi_row, mi_col; - - int temporal_predictor_count[PREDICTION_PROBS][2] = { { 0 } }; - int no_pred_segcounts[MAX_SEGMENTS] = { 0 }; - int t_unpred_seg_counts[MAX_SEGMENTS] = { 0 }; - - vp9_prob no_pred_tree[SEG_TREE_PROBS]; - vp9_prob t_pred_tree[SEG_TREE_PROBS]; - vp9_prob t_nopred_prob[PREDICTION_PROBS]; - - // Set default state for the segment tree probabilities and the - // temporal coding probabilities - vpx_memset(seg->tree_probs, 255, sizeof(seg->tree_probs)); - vpx_memset(seg->pred_probs, 255, sizeof(seg->pred_probs)); - - // First of all generate stats regarding how well the last segment map - // predicts this one - for (tile_col = 0; tile_col < 1 << cm->log2_tile_cols; tile_col++) { - TileInfo tile; - MODE_INFO *mi_ptr; - vp9_tile_init(&tile, cm, 0, tile_col); - - mi_ptr = cm->mi + tile.mi_col_start; - for (mi_row = 0; mi_row < cm->mi_rows; - mi_row += 8, mi_ptr += 8 * cm->mi_stride) { - MODE_INFO *mi = mi_ptr; - for (mi_col = tile.mi_col_start; mi_col < tile.mi_col_end; - mi_col += 8, mi += 8) - count_segs_sb(cm, xd, &tile, mi, no_pred_segcounts, - temporal_predictor_count, t_unpred_seg_counts, - mi_row, mi_col, BLOCK_64X64); - } - } - - // Work out probability tree for coding segments without prediction - // and the cost. - calc_segtree_probs(no_pred_segcounts, no_pred_tree); - no_pred_cost = cost_segmap(no_pred_segcounts, no_pred_tree); - - // Key frames cannot use temporal prediction - if (!frame_is_intra_only(cm)) { - // Work out probability tree for coding those segments not - // predicted using the temporal method and the cost. - calc_segtree_probs(t_unpred_seg_counts, t_pred_tree); - t_pred_cost = cost_segmap(t_unpred_seg_counts, t_pred_tree); - - // Add in the cost of the signaling for each prediction context. - for (i = 0; i < PREDICTION_PROBS; i++) { - const int count0 = temporal_predictor_count[i][0]; - const int count1 = temporal_predictor_count[i][1]; - - t_nopred_prob[i] = get_binary_prob(count0, count1); - - // Add in the predictor signaling cost - t_pred_cost += count0 * vp9_cost_zero(t_nopred_prob[i]) + - count1 * vp9_cost_one(t_nopred_prob[i]); - } - } - - // Now choose which coding method to use. - if (t_pred_cost < no_pred_cost) { - seg->temporal_update = 1; - vpx_memcpy(seg->tree_probs, t_pred_tree, sizeof(t_pred_tree)); - vpx_memcpy(seg->pred_probs, t_nopred_prob, sizeof(t_nopred_prob)); - } else { - seg->temporal_update = 0; - vpx_memcpy(seg->tree_probs, no_pred_tree, sizeof(no_pred_tree)); - } -} - -void vp9_reset_segment_features(struct segmentation *seg) { - // Set up default state for MB feature flags - seg->enabled = 0; - seg->update_map = 0; - seg->update_data = 0; - vpx_memset(seg->tree_probs, 255, sizeof(seg->tree_probs)); - vp9_clearall_segfeatures(seg); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_segmentation.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_segmentation.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_segmentation.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_segmentation.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP9_ENCODER_VP9_SEGMENTATION_H_ -#define VP9_ENCODER_VP9_SEGMENTATION_H_ - -#include "vp9/common/vp9_blockd.h" -#include "vp9/encoder/vp9_encoder.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void vp9_enable_segmentation(struct segmentation *seg); -void vp9_disable_segmentation(struct segmentation *seg); - -void vp9_disable_segfeature(struct segmentation *seg, - int segment_id, - SEG_LVL_FEATURES feature_id); -void vp9_clear_segdata(struct segmentation *seg, - int segment_id, - SEG_LVL_FEATURES feature_id); - -// The values given for each segment can be either deltas (from the default -// value chosen for the frame) or absolute values. -// -// Valid range for abs values is (0-127 for MB_LVL_ALT_Q), (0-63 for -// SEGMENT_ALT_LF) -// Valid range for delta values are (+/-127 for MB_LVL_ALT_Q), (+/-63 for -// SEGMENT_ALT_LF) -// -// abs_delta = SEGMENT_DELTADATA (deltas) abs_delta = SEGMENT_ABSDATA (use -// the absolute values given). -void vp9_set_segment_data(struct segmentation *seg, signed char *feature_data, - unsigned char abs_delta); - -void vp9_choose_segmap_coding_method(VP9_COMMON *cm, MACROBLOCKD *xd); - -void vp9_reset_segment_features(struct segmentation *seg); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_SEGMENTATION_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_skin_detection.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_skin_detection.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_skin_detection.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_skin_detection.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2015 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "vp9/common/vp9_blockd.h" -#include "vp9/encoder/vp9_encoder.h" -#include "vp9/encoder/vp9_skin_detection.h" - -// Fixed-point skin color model parameters. -static const int skin_mean[2] = {7463, 9614}; // q6 -static const int skin_inv_cov[4] = {4107, 1663, 1663, 2157}; // q16 -static const int skin_threshold = 1570636; // q18 - -// Thresholds on luminance. -static const int y_low = 20; -static const int y_high = 220; - -// Evaluates the Mahalanobis distance measure for the input CbCr values. -static int evaluate_skin_color_difference(int cb, int cr) { - const int cb_q6 = cb << 6; - const int cr_q6 = cr << 6; - const int cb_diff_q12 = (cb_q6 - skin_mean[0]) * (cb_q6 - skin_mean[0]); - const int cbcr_diff_q12 = (cb_q6 - skin_mean[0]) * (cr_q6 - skin_mean[1]); - const int cr_diff_q12 = (cr_q6 - skin_mean[1]) * (cr_q6 - skin_mean[1]); - const int cb_diff_q2 = (cb_diff_q12 + (1 << 9)) >> 10; - const int cbcr_diff_q2 = (cbcr_diff_q12 + (1 << 9)) >> 10; - const int cr_diff_q2 = (cr_diff_q12 + (1 << 9)) >> 10; - const int skin_diff = skin_inv_cov[0] * cb_diff_q2 + - skin_inv_cov[1] * cbcr_diff_q2 + - skin_inv_cov[2] * cbcr_diff_q2 + - skin_inv_cov[3] * cr_diff_q2; - return skin_diff; -} - -int vp9_skin_pixel(const uint8_t y, const uint8_t cb, const uint8_t cr) { - if (y < y_low || y > y_high) - return 0; - else - return (evaluate_skin_color_difference(cb, cr) < skin_threshold); -} - -#ifdef OUTPUT_YUV_SKINMAP -// For viewing skin map on input source. -void vp9_compute_skin_map(VP9_COMP *const cpi, FILE *yuv_skinmap_file) { - int i, j, mi_row, mi_col; - VP9_COMMON *const cm = &cpi->common; - uint8_t *y; - const uint8_t *src_y = cpi->Source->y_buffer; - const uint8_t *src_u = cpi->Source->u_buffer; - const uint8_t *src_v = cpi->Source->v_buffer; - const int src_ystride = cpi->Source->y_stride; - const int src_uvstride = cpi->Source->uv_stride; - YV12_BUFFER_CONFIG skinmap; - vpx_memset(&skinmap, 0, sizeof(YV12_BUFFER_CONFIG)); - if (vp9_alloc_frame_buffer(&skinmap, cm->width, cm->height, - cm->subsampling_x, cm->subsampling_y, - VP9_ENC_BORDER_IN_PIXELS, cm->byte_alignment)) { - vp9_free_frame_buffer(&skinmap); - return; - } - vpx_memset(skinmap.buffer_alloc, 128, skinmap.frame_size); - y = skinmap.y_buffer; - // Loop through 8x8 blocks and set skin map based on center pixel of block. - // Set y to white for skin block, otherwise set to source with gray scale. - // Ignore rightmost/bottom boundary blocks. - for (mi_row = 0; mi_row < cm->mi_rows - 1; ++mi_row) { - for (mi_col = 0; mi_col < cm->mi_cols - 1; ++mi_col) { - // Use middle pixel for each 8x8 block for skin detection. - // If middle pixel is skin, assign whole 8x8 block to skin. - const uint8_t ysource = src_y[4 * src_ystride + 4]; - const uint8_t usource = src_u[2 * src_uvstride + 2]; - const uint8_t vsource = src_v[2 * src_uvstride + 2]; - const int is_skin = vp9_skin_pixel(ysource, usource, vsource); - for (i = 0; i < 8; i++) { - for (j = 0; j < 8; j++) { - if (is_skin) - y[i * src_ystride + j] = 255; - else - y[i * src_ystride + j] = src_y[i * src_ystride + j]; - } - } - y += 8; - src_y += 8; - src_u += 4; - src_v += 4; - } - y += (src_ystride << 3) - ((cm->mi_cols - 1) << 3); - src_y += (src_ystride << 3) - ((cm->mi_cols - 1) << 3); - src_u += (src_uvstride << 2) - ((cm->mi_cols - 1) << 2); - src_v += (src_uvstride << 2) - ((cm->mi_cols - 1) << 2); - } - vp9_write_yuv_frame_420(&skinmap, yuv_skinmap_file); - vp9_free_frame_buffer(&skinmap); -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_skin_detection.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_skin_detection.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_skin_detection.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_skin_detection.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2015 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_SKIN_MAP_H_ -#define VP9_ENCODER_VP9_SKIN_MAP_H_ - -#include "vp9/common/vp9_blockd.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct VP9_COMP; - -// #define OUTPUT_YUV_SKINMAP - -int vp9_skin_pixel(const uint8_t y, const uint8_t cb, const uint8_t cr); - -#ifdef OUTPUT_YUV_SKINMAP -// For viewing skin map on input source. -void vp9_compute_skin_map(VP9_COMP *const cpi, FILE *yuv_skinmap_file); -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_SKIN_MAP_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_speed_features.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_speed_features.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_speed_features.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_speed_features.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,499 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "vp9/encoder/vp9_encoder.h" -#include "vp9/encoder/vp9_speed_features.h" - -// Intra only frames, golden frames (except alt ref overlays) and -// alt ref frames tend to be coded at a higher than ambient quality -static int frame_is_boosted(const VP9_COMP *cpi) { - return frame_is_kf_gf_arf(cpi) || vp9_is_upper_layer_key_frame(cpi); -} - -static void set_good_speed_feature_framesize_dependent(VP9_COMMON *cm, - SPEED_FEATURES *sf, - int speed) { - if (speed >= 1) { - if (MIN(cm->width, cm->height) >= 720) { - sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT - : DISABLE_ALL_INTER_SPLIT; - sf->partition_search_breakout_dist_thr = (1 << 23); - } else { - sf->disable_split_mask = DISABLE_COMPOUND_SPLIT; - sf->partition_search_breakout_dist_thr = (1 << 21); - } - } - - if (speed >= 2) { - if (MIN(cm->width, cm->height) >= 720) { - sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT - : DISABLE_ALL_INTER_SPLIT; - sf->adaptive_pred_interp_filter = 0; - sf->partition_search_breakout_dist_thr = (1 << 24); - sf->partition_search_breakout_rate_thr = 120; - } else { - sf->disable_split_mask = LAST_AND_INTRA_SPLIT_ONLY; - sf->partition_search_breakout_dist_thr = (1 << 22); - sf->partition_search_breakout_rate_thr = 100; - } - } - - if (speed >= 3) { - if (MIN(cm->width, cm->height) >= 720) { - sf->disable_split_mask = DISABLE_ALL_SPLIT; - sf->schedule_mode_search = cm->base_qindex < 220 ? 1 : 0; - sf->partition_search_breakout_dist_thr = (1 << 25); - sf->partition_search_breakout_rate_thr = 200; - } else { - sf->max_intra_bsize = BLOCK_32X32; - sf->disable_split_mask = DISABLE_ALL_INTER_SPLIT; - sf->schedule_mode_search = cm->base_qindex < 175 ? 1 : 0; - sf->partition_search_breakout_dist_thr = (1 << 23); - sf->partition_search_breakout_rate_thr = 120; - } - } - - if (speed >= 4) { - if (MIN(cm->width, cm->height) >= 720) { - sf->partition_search_breakout_dist_thr = (1 << 26); - } else { - sf->partition_search_breakout_dist_thr = (1 << 24); - } - sf->disable_split_mask = DISABLE_ALL_SPLIT; - } -} - -static void set_good_speed_feature(VP9_COMP *cpi, VP9_COMMON *cm, - SPEED_FEATURES *sf, int speed) { - const int boosted = frame_is_boosted(cpi); - - sf->adaptive_rd_thresh = 1; - sf->allow_skip_recode = 1; - - if (speed >= 1) { - sf->use_square_partition_only = !frame_is_intra_only(cm); - sf->less_rectangular_check = 1; - - sf->use_rd_breakout = 1; - sf->adaptive_motion_search = 1; - sf->mv.auto_mv_step_size = 1; - sf->adaptive_rd_thresh = 2; - sf->mv.subpel_iters_per_step = 1; - sf->mode_skip_start = 10; - sf->adaptive_pred_interp_filter = 1; - - sf->recode_loop = ALLOW_RECODE_KFARFGF; - sf->intra_y_mode_mask[TX_32X32] = INTRA_DC_H_V; - sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC_H_V; - sf->intra_y_mode_mask[TX_16X16] = INTRA_DC_H_V; - sf->intra_uv_mode_mask[TX_16X16] = INTRA_DC_H_V; - - sf->tx_size_search_breakout = 1; - sf->partition_search_breakout_rate_thr = 80; - } - - if (speed >= 2) { - sf->tx_size_search_method = frame_is_boosted(cpi) ? USE_FULL_RD - : USE_LARGESTALL; - - // Reference masking is not supported in dynamic scaling mode. - sf->reference_masking = cpi->oxcf.resize_mode != RESIZE_DYNAMIC ? 1 : 0; - - sf->mode_search_skip_flags = (cm->frame_type == KEY_FRAME) ? 0 : - FLAG_SKIP_INTRA_DIRMISMATCH | - FLAG_SKIP_INTRA_BESTINTER | - FLAG_SKIP_COMP_BESTINTRA | - FLAG_SKIP_INTRA_LOWVAR; - sf->disable_filter_search_var_thresh = 100; - sf->comp_inter_joint_search_thresh = BLOCK_SIZES; - sf->auto_min_max_partition_size = CONSTRAIN_NEIGHBORING_MIN_MAX; - - sf->allow_partition_search_skip = 1; - } - - if (speed >= 3) { - sf->tx_size_search_method = frame_is_intra_only(cm) ? USE_FULL_RD - : USE_LARGESTALL; - sf->mv.subpel_search_method = SUBPEL_TREE_PRUNED; - sf->adaptive_pred_interp_filter = 0; - sf->adaptive_mode_search = 1; - sf->cb_partition_search = !boosted; - sf->cb_pred_filter_search = 1; - sf->alt_ref_search_fp = 1; - sf->recode_loop = ALLOW_RECODE_KFMAXBW; - sf->adaptive_rd_thresh = 3; - sf->mode_skip_start = 6; - sf->intra_y_mode_mask[TX_32X32] = INTRA_DC; - sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC; - sf->adaptive_interp_filter_search = 1; - } - - if (speed >= 4) { - sf->use_square_partition_only = 1; - sf->tx_size_search_method = USE_LARGESTALL; - sf->mv.search_method = BIGDIA; - sf->mv.subpel_search_method = SUBPEL_TREE_PRUNED_MORE; - sf->adaptive_rd_thresh = 4; - if (cm->frame_type != KEY_FRAME) - sf->mode_search_skip_flags |= FLAG_EARLY_TERMINATE; - sf->disable_filter_search_var_thresh = 200; - sf->use_lp32x32fdct = 1; - sf->use_fast_coef_updates = ONE_LOOP_REDUCED; - sf->use_fast_coef_costing = 1; - sf->motion_field_mode_search = !boosted; - sf->partition_search_breakout_rate_thr = 300; - } - - if (speed >= 5) { - int i; - sf->optimize_coefficients = 0; - sf->mv.search_method = HEX; - sf->disable_filter_search_var_thresh = 500; - for (i = 0; i < TX_SIZES; ++i) { - sf->intra_y_mode_mask[i] = INTRA_DC; - sf->intra_uv_mode_mask[i] = INTRA_DC; - } - sf->partition_search_breakout_rate_thr = 500; - sf->mv.reduce_first_step_size = 1; - } -} - -static void set_rt_speed_feature_framesize_dependent(VP9_COMP *cpi, - SPEED_FEATURES *sf, int speed) { - VP9_COMMON *const cm = &cpi->common; - - if (speed >= 1) { - if (MIN(cm->width, cm->height) >= 720) { - sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT - : DISABLE_ALL_INTER_SPLIT; - } else { - sf->disable_split_mask = DISABLE_COMPOUND_SPLIT; - } - } - - if (speed >= 2) { - if (MIN(cm->width, cm->height) >= 720) { - sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT - : DISABLE_ALL_INTER_SPLIT; - } else { - sf->disable_split_mask = LAST_AND_INTRA_SPLIT_ONLY; - } - } - - if (speed >= 5) { - if (MIN(cm->width, cm->height) >= 720) { - sf->partition_search_breakout_dist_thr = (1 << 25); - } else { - sf->partition_search_breakout_dist_thr = (1 << 23); - } - } - - if (speed >= 7) { - sf->encode_breakout_thresh = (MIN(cm->width, cm->height) >= 720) ? - 800 : 300; - } -} - -static void set_rt_speed_feature(VP9_COMP *cpi, SPEED_FEATURES *sf, - int speed, vp9e_tune_content content) { - VP9_COMMON *const cm = &cpi->common; - const int is_keyframe = cm->frame_type == KEY_FRAME; - const int frames_since_key = is_keyframe ? 0 : cpi->rc.frames_since_key; - sf->static_segmentation = 0; - sf->adaptive_rd_thresh = 1; - sf->use_fast_coef_costing = 1; - - if (speed >= 1) { - sf->use_square_partition_only = !frame_is_intra_only(cm); - sf->less_rectangular_check = 1; - sf->tx_size_search_method = frame_is_intra_only(cm) ? USE_FULL_RD - : USE_LARGESTALL; - - sf->use_rd_breakout = 1; - - sf->adaptive_motion_search = 1; - sf->adaptive_pred_interp_filter = 1; - sf->mv.auto_mv_step_size = 1; - sf->adaptive_rd_thresh = 2; - sf->intra_y_mode_mask[TX_32X32] = INTRA_DC_H_V; - sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC_H_V; - sf->intra_uv_mode_mask[TX_16X16] = INTRA_DC_H_V; - } - - if (speed >= 2) { - sf->mode_search_skip_flags = (cm->frame_type == KEY_FRAME) ? 0 : - FLAG_SKIP_INTRA_DIRMISMATCH | - FLAG_SKIP_INTRA_BESTINTER | - FLAG_SKIP_COMP_BESTINTRA | - FLAG_SKIP_INTRA_LOWVAR; - sf->adaptive_pred_interp_filter = 2; - - // Reference masking is not supported in dynamic scaling mode. - sf->reference_masking = cpi->oxcf.resize_mode != RESIZE_DYNAMIC ? 1 : 0; - - sf->disable_filter_search_var_thresh = 50; - sf->comp_inter_joint_search_thresh = BLOCK_SIZES; - sf->auto_min_max_partition_size = RELAXED_NEIGHBORING_MIN_MAX; - sf->lf_motion_threshold = LOW_MOTION_THRESHOLD; - sf->adjust_partitioning_from_last_frame = 1; - sf->last_partitioning_redo_frequency = 3; - sf->use_lp32x32fdct = 1; - sf->mode_skip_start = 11; - sf->intra_y_mode_mask[TX_16X16] = INTRA_DC_H_V; - } - - if (speed >= 3) { - sf->use_square_partition_only = 1; - sf->disable_filter_search_var_thresh = 100; - sf->use_uv_intra_rd_estimate = 1; - sf->skip_encode_sb = 1; - sf->mv.subpel_iters_per_step = 1; - sf->adaptive_rd_thresh = 4; - sf->mode_skip_start = 6; - sf->allow_skip_recode = 0; - sf->optimize_coefficients = 0; - sf->disable_split_mask = DISABLE_ALL_SPLIT; - sf->lpf_pick = LPF_PICK_FROM_Q; - } - - if (speed >= 4) { - int i; - sf->last_partitioning_redo_frequency = 4; - sf->adaptive_rd_thresh = 5; - sf->use_fast_coef_costing = 0; - sf->auto_min_max_partition_size = STRICT_NEIGHBORING_MIN_MAX; - sf->adjust_partitioning_from_last_frame = - cm->last_frame_type != cm->frame_type || (0 == - (frames_since_key + 1) % sf->last_partitioning_redo_frequency); - sf->mv.subpel_force_stop = 1; - for (i = 0; i < TX_SIZES; i++) { - sf->intra_y_mode_mask[i] = INTRA_DC_H_V; - sf->intra_uv_mode_mask[i] = INTRA_DC; - } - sf->intra_y_mode_mask[TX_32X32] = INTRA_DC; - sf->frame_parameter_update = 0; - sf->mv.search_method = FAST_HEX; - - sf->inter_mode_mask[BLOCK_32X32] = INTER_NEAREST_NEAR_NEW; - sf->inter_mode_mask[BLOCK_32X64] = INTER_NEAREST; - sf->inter_mode_mask[BLOCK_64X32] = INTER_NEAREST; - sf->inter_mode_mask[BLOCK_64X64] = INTER_NEAREST; - sf->max_intra_bsize = BLOCK_32X32; - sf->allow_skip_recode = 1; - } - - if (speed >= 5) { - sf->use_quant_fp = !is_keyframe; - sf->auto_min_max_partition_size = is_keyframe ? RELAXED_NEIGHBORING_MIN_MAX - : STRICT_NEIGHBORING_MIN_MAX; - sf->default_max_partition_size = BLOCK_32X32; - sf->default_min_partition_size = BLOCK_8X8; - sf->force_frame_boost = is_keyframe || - (frames_since_key % (sf->last_partitioning_redo_frequency << 1) == 1); - sf->max_delta_qindex = is_keyframe ? 20 : 15; - sf->partition_search_type = REFERENCE_PARTITION; - sf->use_nonrd_pick_mode = !is_keyframe; - sf->allow_skip_recode = 0; - sf->inter_mode_mask[BLOCK_32X32] = INTER_NEAREST_NEW_ZERO; - sf->inter_mode_mask[BLOCK_32X64] = INTER_NEAREST_NEW_ZERO; - sf->inter_mode_mask[BLOCK_64X32] = INTER_NEAREST_NEW_ZERO; - sf->inter_mode_mask[BLOCK_64X64] = INTER_NEAREST_NEW_ZERO; - sf->adaptive_rd_thresh = 2; - // This feature is only enabled when partition search is disabled. - sf->reuse_inter_pred_sby = 1; - sf->partition_search_breakout_rate_thr = 200; - sf->coeff_prob_appx_step = 4; - sf->use_fast_coef_updates = is_keyframe ? TWO_LOOP : ONE_LOOP_REDUCED; - sf->mode_search_skip_flags = FLAG_SKIP_INTRA_DIRMISMATCH; - - if (!is_keyframe) { - int i; - if (content == VP9E_CONTENT_SCREEN) { - for (i = 0; i < TX_SIZES; ++i) - sf->intra_y_mode_mask[i] = INTRA_DC_TM_H_V; - } else { - for (i = 0; i < TX_SIZES; i++) - sf->intra_y_mode_mask[i] = INTRA_DC; - } - } - } - - if (speed >= 6) { - // Adaptively switch between SOURCE_VAR_BASED_PARTITION and FIXED_PARTITION. - sf->partition_search_type = VAR_BASED_PARTITION; - // Turn on this to use non-RD key frame coding mode. - sf->use_nonrd_pick_mode = 1; - sf->mv.search_method = NSTEP; - sf->tx_size_search_method = is_keyframe ? USE_LARGESTALL : USE_TX_8X8; - sf->mv.reduce_first_step_size = 1; - sf->skip_encode_sb = 0; - } - - if (speed >= 7) { - sf->adaptive_rd_thresh = 3; - sf->mv.search_method = FAST_DIAMOND; - sf->mv.fullpel_search_step_param = 10; - } - if (speed >= 8) { - sf->adaptive_rd_thresh = 4; - sf->mv.subpel_force_stop = 2; - sf->lpf_pick = LPF_PICK_MINIMAL_LPF; - } -} - -void vp9_set_speed_features_framesize_dependent(VP9_COMP *cpi) { - SPEED_FEATURES *const sf = &cpi->sf; - VP9_COMMON *const cm = &cpi->common; - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - RD_OPT *const rd = &cpi->rd; - int i; - - if (oxcf->mode == REALTIME) { - set_rt_speed_feature_framesize_dependent(cpi, sf, oxcf->speed); - } else if (oxcf->mode == GOOD) { - set_good_speed_feature_framesize_dependent(cm, sf, oxcf->speed); - } - - if (sf->disable_split_mask == DISABLE_ALL_SPLIT) { - sf->adaptive_pred_interp_filter = 0; - } - - if (cpi->encode_breakout && oxcf->mode == REALTIME && - sf->encode_breakout_thresh > cpi->encode_breakout) { - cpi->encode_breakout = sf->encode_breakout_thresh; - } - - // Check for masked out split cases. - for (i = 0; i < MAX_REFS; ++i) { - if (sf->disable_split_mask & (1 << i)) { - rd->thresh_mult_sub8x8[i] = INT_MAX; - } - } -} - -void vp9_set_speed_features_framesize_independent(VP9_COMP *cpi) { - SPEED_FEATURES *const sf = &cpi->sf; - VP9_COMMON *const cm = &cpi->common; - MACROBLOCK *const x = &cpi->td.mb; - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - int i; - - // best quality defaults - sf->frame_parameter_update = 1; - sf->mv.search_method = NSTEP; - sf->recode_loop = ALLOW_RECODE; - sf->mv.subpel_search_method = SUBPEL_TREE; - sf->mv.subpel_iters_per_step = 2; - sf->mv.subpel_force_stop = 0; - sf->optimize_coefficients = !is_lossless_requested(&cpi->oxcf); - sf->mv.reduce_first_step_size = 0; - sf->coeff_prob_appx_step = 1; - sf->mv.auto_mv_step_size = 0; - sf->mv.fullpel_search_step_param = 6; - sf->comp_inter_joint_search_thresh = BLOCK_4X4; - sf->adaptive_rd_thresh = 0; - sf->tx_size_search_method = USE_FULL_RD; - sf->use_lp32x32fdct = 0; - sf->adaptive_motion_search = 0; - sf->adaptive_pred_interp_filter = 0; - sf->adaptive_mode_search = 0; - sf->cb_pred_filter_search = 0; - sf->cb_partition_search = 0; - sf->motion_field_mode_search = 0; - sf->alt_ref_search_fp = 0; - sf->use_quant_fp = 0; - sf->reference_masking = 0; - sf->partition_search_type = SEARCH_PARTITION; - sf->less_rectangular_check = 0; - sf->use_square_partition_only = 0; - sf->auto_min_max_partition_size = NOT_IN_USE; - sf->default_max_partition_size = BLOCK_64X64; - sf->default_min_partition_size = BLOCK_4X4; - sf->adjust_partitioning_from_last_frame = 0; - sf->last_partitioning_redo_frequency = 4; - sf->disable_split_mask = 0; - sf->mode_search_skip_flags = 0; - sf->force_frame_boost = 0; - sf->max_delta_qindex = 0; - sf->disable_filter_search_var_thresh = 0; - sf->adaptive_interp_filter_search = 0; - sf->allow_partition_search_skip = 0; - - for (i = 0; i < TX_SIZES; i++) { - sf->intra_y_mode_mask[i] = INTRA_ALL; - sf->intra_uv_mode_mask[i] = INTRA_ALL; - } - sf->use_rd_breakout = 0; - sf->skip_encode_sb = 0; - sf->use_uv_intra_rd_estimate = 0; - sf->allow_skip_recode = 0; - sf->lpf_pick = LPF_PICK_FROM_FULL_IMAGE; - sf->use_fast_coef_updates = TWO_LOOP; - sf->use_fast_coef_costing = 0; - sf->mode_skip_start = MAX_MODES; // Mode index at which mode skip mask set - sf->schedule_mode_search = 0; - sf->use_nonrd_pick_mode = 0; - for (i = 0; i < BLOCK_SIZES; ++i) - sf->inter_mode_mask[i] = INTER_ALL; - sf->max_intra_bsize = BLOCK_64X64; - sf->reuse_inter_pred_sby = 0; - // This setting only takes effect when partition_search_type is set - // to FIXED_PARTITION. - sf->always_this_block_size = BLOCK_16X16; - sf->search_type_check_frequency = 50; - sf->encode_breakout_thresh = 0; - // Recode loop tolerance %. - sf->recode_tolerance = 25; - sf->default_interp_filter = SWITCHABLE; - sf->tx_size_search_breakout = 0; - sf->partition_search_breakout_dist_thr = 0; - sf->partition_search_breakout_rate_thr = 0; - - if (oxcf->mode == REALTIME) - set_rt_speed_feature(cpi, sf, oxcf->speed, oxcf->content); - else if (oxcf->mode == GOOD) - set_good_speed_feature(cpi, cm, sf, oxcf->speed); - - cpi->full_search_sad = vp9_full_search_sad; - cpi->diamond_search_sad = oxcf->mode == BEST ? vp9_full_range_search - : vp9_diamond_search_sad; - - // Slow quant, dct and trellis not worthwhile for first pass - // so make sure they are always turned off. - if (oxcf->pass == 1) - sf->optimize_coefficients = 0; - - // No recode for 1 pass. - if (oxcf->pass == 0) { - sf->recode_loop = DISALLOW_RECODE; - sf->optimize_coefficients = 0; - } - - if (sf->mv.subpel_search_method == SUBPEL_TREE) { - cpi->find_fractional_mv_step = vp9_find_best_sub_pixel_tree; - } else if (sf->mv.subpel_search_method == SUBPEL_TREE_PRUNED) { - cpi->find_fractional_mv_step = vp9_find_best_sub_pixel_tree_pruned; - } else if (sf->mv.subpel_search_method == SUBPEL_TREE_PRUNED_MORE) { - cpi->find_fractional_mv_step = vp9_find_best_sub_pixel_tree_pruned_more; - } else if (sf->mv.subpel_search_method == SUBPEL_TREE_PRUNED_EVENMORE) { - cpi->find_fractional_mv_step = vp9_find_best_sub_pixel_tree_pruned_evenmore; - } - - x->optimize = sf->optimize_coefficients == 1 && oxcf->pass != 1; - - x->min_partition_size = sf->default_min_partition_size; - x->max_partition_size = sf->default_max_partition_size; - - if (!cpi->oxcf.frame_periodic_boost) { - sf->max_delta_qindex = 0; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_speed_features.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_speed_features.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_speed_features.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_speed_features.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,423 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_SPEED_FEATURES_H_ -#define VP9_ENCODER_VP9_SPEED_FEATURES_H_ - -#include "vp9/common/vp9_enums.h" - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - INTRA_ALL = (1 << DC_PRED) | - (1 << V_PRED) | (1 << H_PRED) | - (1 << D45_PRED) | (1 << D135_PRED) | - (1 << D117_PRED) | (1 << D153_PRED) | - (1 << D207_PRED) | (1 << D63_PRED) | - (1 << TM_PRED), - INTRA_DC = (1 << DC_PRED), - INTRA_DC_TM = (1 << DC_PRED) | (1 << TM_PRED), - INTRA_DC_H_V = (1 << DC_PRED) | (1 << V_PRED) | (1 << H_PRED), - INTRA_DC_TM_H_V = (1 << DC_PRED) | (1 << TM_PRED) | (1 << V_PRED) | - (1 << H_PRED) -}; - -enum { - INTER_ALL = (1 << NEARESTMV) | (1 << NEARMV) | (1 << ZEROMV) | (1 << NEWMV), - INTER_NEAREST = (1 << NEARESTMV), - INTER_NEAREST_NEW = (1 << NEARESTMV) | (1 << NEWMV), - INTER_NEAREST_ZERO = (1 << NEARESTMV) | (1 << ZEROMV), - INTER_NEAREST_NEW_ZERO = (1 << NEARESTMV) | (1 << ZEROMV) | (1 << NEWMV), - INTER_NEAREST_NEAR_NEW = (1 << NEARESTMV) | (1 << NEARMV) | (1 << NEWMV), - INTER_NEAREST_NEAR_ZERO = (1 << NEARESTMV) | (1 << NEARMV) | (1 << ZEROMV), -}; - -enum { - DISABLE_ALL_INTER_SPLIT = (1 << THR_COMP_GA) | - (1 << THR_COMP_LA) | - (1 << THR_ALTR) | - (1 << THR_GOLD) | - (1 << THR_LAST), - - DISABLE_ALL_SPLIT = (1 << THR_INTRA) | DISABLE_ALL_INTER_SPLIT, - - DISABLE_COMPOUND_SPLIT = (1 << THR_COMP_GA) | (1 << THR_COMP_LA), - - LAST_AND_INTRA_SPLIT_ONLY = (1 << THR_COMP_GA) | - (1 << THR_COMP_LA) | - (1 << THR_ALTR) | - (1 << THR_GOLD) -}; - -typedef enum { - DIAMOND = 0, - NSTEP = 1, - HEX = 2, - BIGDIA = 3, - SQUARE = 4, - FAST_HEX = 5, - FAST_DIAMOND = 6 -} SEARCH_METHODS; - -typedef enum { - // No recode. - DISALLOW_RECODE = 0, - // Allow recode for KF and exceeding maximum frame bandwidth. - ALLOW_RECODE_KFMAXBW = 1, - // Allow recode only for KF/ARF/GF frames. - ALLOW_RECODE_KFARFGF = 2, - // Allow recode for all frames based on bitrate constraints. - ALLOW_RECODE = 3, -} RECODE_LOOP_TYPE; - -typedef enum { - SUBPEL_TREE = 0, - SUBPEL_TREE_PRUNED = 1, // Prunes 1/2-pel searches - SUBPEL_TREE_PRUNED_MORE = 2, // Prunes 1/2-pel searches more aggressively - SUBPEL_TREE_PRUNED_EVENMORE = 3, // Prunes 1/2- and 1/4-pel searches - // Other methods to come -} SUBPEL_SEARCH_METHODS; - -typedef enum { - NO_MOTION_THRESHOLD = 0, - LOW_MOTION_THRESHOLD = 7 -} MOTION_THRESHOLD; - -typedef enum { - USE_FULL_RD = 0, - USE_LARGESTALL, - USE_TX_8X8 -} TX_SIZE_SEARCH_METHOD; - -typedef enum { - NOT_IN_USE = 0, - RELAXED_NEIGHBORING_MIN_MAX = 1, - CONSTRAIN_NEIGHBORING_MIN_MAX = 2, - STRICT_NEIGHBORING_MIN_MAX = 3 -} AUTO_MIN_MAX_MODE; - -typedef enum { - // Try the full image with different values. - LPF_PICK_FROM_FULL_IMAGE, - // Try a small portion of the image with different values. - LPF_PICK_FROM_SUBIMAGE, - // Estimate the level based on quantizer and frame type - LPF_PICK_FROM_Q, - // Pick 0 to disable LPF if LPF was enabled last frame - LPF_PICK_MINIMAL_LPF -} LPF_PICK_METHOD; - -typedef enum { - // Terminate search early based on distortion so far compared to - // qp step, distortion in the neighborhood of the frame, etc. - FLAG_EARLY_TERMINATE = 1 << 0, - - // Skips comp inter modes if the best so far is an intra mode. - FLAG_SKIP_COMP_BESTINTRA = 1 << 1, - - // Skips oblique intra modes if the best so far is an inter mode. - FLAG_SKIP_INTRA_BESTINTER = 1 << 3, - - // Skips oblique intra modes at angles 27, 63, 117, 153 if the best - // intra so far is not one of the neighboring directions. - FLAG_SKIP_INTRA_DIRMISMATCH = 1 << 4, - - // Skips intra modes other than DC_PRED if the source variance is small - FLAG_SKIP_INTRA_LOWVAR = 1 << 5, -} MODE_SEARCH_SKIP_LOGIC; - -typedef enum { - FLAG_SKIP_EIGHTTAP = 1 << EIGHTTAP, - FLAG_SKIP_EIGHTTAP_SMOOTH = 1 << EIGHTTAP_SMOOTH, - FLAG_SKIP_EIGHTTAP_SHARP = 1 << EIGHTTAP_SHARP, -} INTERP_FILTER_MASK; - -typedef enum { - // Search partitions using RD/NONRD criterion - SEARCH_PARTITION, - - // Always use a fixed size partition - FIXED_PARTITION, - - REFERENCE_PARTITION, - - // Use an arbitrary partitioning scheme based on source variance within - // a 64X64 SB - VAR_BASED_PARTITION, - - // Use non-fixed partitions based on source variance - SOURCE_VAR_BASED_PARTITION -} PARTITION_SEARCH_TYPE; - -typedef enum { - // Does a dry run to see if any of the contexts need to be updated or not, - // before the final run. - TWO_LOOP = 0, - - // No dry run, also only half the coef contexts and bands are updated. - // The rest are not updated at all. - ONE_LOOP_REDUCED = 1 -} FAST_COEFF_UPDATE; - -typedef struct MV_SPEED_FEATURES { - // Motion search method (Diamond, NSTEP, Hex, Big Diamond, Square, etc). - SEARCH_METHODS search_method; - - // This parameter controls which step in the n-step process we start at. - // It's changed adaptively based on circumstances. - int reduce_first_step_size; - - // If this is set to 1, we limit the motion search range to 2 times the - // largest motion vector found in the last frame. - int auto_mv_step_size; - - // Subpel_search_method can only be subpel_tree which does a subpixel - // logarithmic search that keeps stepping at 1/2 pixel units until - // you stop getting a gain, and then goes on to 1/4 and repeats - // the same process. Along the way it skips many diagonals. - SUBPEL_SEARCH_METHODS subpel_search_method; - - // Maximum number of steps in logarithmic subpel search before giving up. - int subpel_iters_per_step; - - // Control when to stop subpel search - int subpel_force_stop; - - // This variable sets the step_param used in full pel motion search. - int fullpel_search_step_param; -} MV_SPEED_FEATURES; - -typedef struct SPEED_FEATURES { - MV_SPEED_FEATURES mv; - - // Frame level coding parameter update - int frame_parameter_update; - - RECODE_LOOP_TYPE recode_loop; - - // Trellis (dynamic programming) optimization of quantized values (+1, 0). - int optimize_coefficients; - - // Always set to 0. If on it enables 0 cost background transmission - // (except for the initial transmission of the segmentation). The feature is - // disabled because the addition of very large block sizes make the - // backgrounds very to cheap to encode, and the segmentation we have - // adds overhead. - int static_segmentation; - - // If 1 we iterate finding a best reference for 2 ref frames together - via - // a log search that iterates 4 times (check around mv for last for best - // error of combined predictor then check around mv for alt). If 0 we - // we just use the best motion vector found for each frame by itself. - BLOCK_SIZE comp_inter_joint_search_thresh; - - // This variable is used to cap the maximum number of times we skip testing a - // mode to be evaluated. A high value means we will be faster. - int adaptive_rd_thresh; - - // Enables skipping the reconstruction step (idct, recon) in the - // intermediate steps assuming the last frame didn't have too many intra - // blocks and the q is less than a threshold. - int skip_encode_sb; - int skip_encode_frame; - // Speed feature to allow or disallow skipping of recode at block - // level within a frame. - int allow_skip_recode; - - // Coefficient probability model approximation step size - int coeff_prob_appx_step; - - // The threshold is to determine how slow the motino is, it is used when - // use_lastframe_partitioning is set to LAST_FRAME_PARTITION_LOW_MOTION - MOTION_THRESHOLD lf_motion_threshold; - - // Determine which method we use to determine transform size. We can choose - // between options like full rd, largest for prediction size, largest - // for intra and model coefs for the rest. - TX_SIZE_SEARCH_METHOD tx_size_search_method; - - // Low precision 32x32 fdct keeps everything in 16 bits and thus is less - // precise but significantly faster than the non lp version. - int use_lp32x32fdct; - - // After looking at the first set of modes (set by index here), skip - // checking modes for reference frames that don't match the reference frame - // of the best so far. - int mode_skip_start; - - // TODO(JBB): Remove this. - int reference_masking; - - PARTITION_SEARCH_TYPE partition_search_type; - - // Used if partition_search_type = FIXED_SIZE_PARTITION - BLOCK_SIZE always_this_block_size; - - // Skip rectangular partition test when partition type none gives better - // rd than partition type split. - int less_rectangular_check; - - // Disable testing non square partitions. (eg 16x32) - int use_square_partition_only; - - // Sets min and max partition sizes for this 64x64 region based on the - // same 64x64 in last encoded frame, and the left and above neighbor. - AUTO_MIN_MAX_MODE auto_min_max_partition_size; - - // Min and max partition size we enable (block_size) as per auto - // min max, but also used by adjust partitioning, and pick_partitioning. - BLOCK_SIZE default_min_partition_size; - BLOCK_SIZE default_max_partition_size; - - // Whether or not we allow partitions one smaller or one greater than the last - // frame's partitioning. Only used if use_lastframe_partitioning is set. - int adjust_partitioning_from_last_frame; - - // How frequently we re do the partitioning from scratch. Only used if - // use_lastframe_partitioning is set. - int last_partitioning_redo_frequency; - - // Disables sub 8x8 blocksizes in different scenarios: Choices are to disable - // it always, to allow it for only Last frame and Intra, disable it for all - // inter modes or to enable it always. - int disable_split_mask; - - // TODO(jingning): combine the related motion search speed features - // This allows us to use motion search at other sizes as a starting - // point for this motion search and limits the search range around it. - int adaptive_motion_search; - - int schedule_mode_search; - - // Allows sub 8x8 modes to use the prediction filter that was determined - // best for 8x8 mode. If set to 0 we always re check all the filters for - // sizes less than 8x8, 1 means we check all filter modes if no 8x8 filter - // was selected, and 2 means we use 8 tap if no 8x8 filter mode was selected. - int adaptive_pred_interp_filter; - - // Adaptive prediction mode search - int adaptive_mode_search; - - // Chessboard pattern prediction filter type search - int cb_pred_filter_search; - - int cb_partition_search; - - int motion_field_mode_search; - - int alt_ref_search_fp; - - // Fast quantization process path - int use_quant_fp; - - // Use finer quantizer in every other few frames that run variable block - // partition type search. - int force_frame_boost; - - // Maximally allowed base quantization index fluctuation. - int max_delta_qindex; - - // Implements various heuristics to skip searching modes - // The heuristics selected are based on flags - // defined in the MODE_SEARCH_SKIP_HEURISTICS enum - unsigned int mode_search_skip_flags; - - // A source variance threshold below which filter search is disabled - // Choose a very large value (UINT_MAX) to use 8-tap always - unsigned int disable_filter_search_var_thresh; - - // These bit masks allow you to enable or disable intra modes for each - // transform size separately. - int intra_y_mode_mask[TX_SIZES]; - int intra_uv_mode_mask[TX_SIZES]; - - // This variable enables an early break out of mode testing if the model for - // rd built from the prediction signal indicates a value that's much - // higher than the best rd we've seen so far. - int use_rd_breakout; - - // This enables us to use an estimate for intra rd based on dc mode rather - // than choosing an actual uv mode in the stage of encoding before the actual - // final encode. - int use_uv_intra_rd_estimate; - - // This feature controls how the loop filter level is determined. - LPF_PICK_METHOD lpf_pick; - - // This feature limits the number of coefficients updates we actually do - // by only looking at counts from 1/2 the bands. - FAST_COEFF_UPDATE use_fast_coef_updates; - - // This flag controls the use of non-RD mode decision. - int use_nonrd_pick_mode; - - // A binary mask indicating if NEARESTMV, NEARMV, ZEROMV, NEWMV - // modes are used in order from LSB to MSB for each BLOCK_SIZE. - int inter_mode_mask[BLOCK_SIZES]; - - // This feature controls whether we do the expensive context update and - // calculation in the rd coefficient costing loop. - int use_fast_coef_costing; - - // This feature controls the tolerence vs target used in deciding whether to - // recode a frame. It has no meaning if recode is disabled. - int recode_tolerance; - - // This variable controls the maximum block size where intra blocks can be - // used in inter frames. - // TODO(aconverse): Fold this into one of the other many mode skips - BLOCK_SIZE max_intra_bsize; - - // The frequency that we check if SOURCE_VAR_BASED_PARTITION or - // FIXED_PARTITION search type should be used. - int search_type_check_frequency; - - // When partition is pre-set, the inter prediction result from pick_inter_mode - // can be reused in final block encoding process. It is enabled only for real- - // time mode speed 6. - int reuse_inter_pred_sby; - - // This variable sets the encode_breakout threshold. Currently, it is only - // enabled in real time mode. - int encode_breakout_thresh; - - // default interp filter choice - INTERP_FILTER default_interp_filter; - - // Early termination in transform size search, which only applies while - // tx_size_search_method is USE_FULL_RD. - int tx_size_search_breakout; - - // adaptive interp_filter search to allow skip of certain filter types. - int adaptive_interp_filter_search; - - // mask for skip evaluation of certain interp_filter type. - INTERP_FILTER_MASK interp_filter_search_mask; - - // Partition search early breakout thresholds. - int64_t partition_search_breakout_dist_thr; - int partition_search_breakout_rate_thr; - - // Allow skipping partition search for still image frame - int allow_partition_search_skip; -} SPEED_FEATURES; - -struct VP9_COMP; - -void vp9_set_speed_features_framesize_independent(struct VP9_COMP *cpi); -void vp9_set_speed_features_framesize_dependent(struct VP9_COMP *cpi); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_SPEED_FEATURES_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_ssim.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_ssim.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_ssim.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_ssim.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,254 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "./vp9_rtcd.h" - -#include "vp9/encoder/vp9_ssim.h" - -void vp9_ssim_parms_16x16_c(uint8_t *s, int sp, uint8_t *r, - int rp, unsigned long *sum_s, unsigned long *sum_r, - unsigned long *sum_sq_s, unsigned long *sum_sq_r, - unsigned long *sum_sxr) { - int i, j; - for (i = 0; i < 16; i++, s += sp, r += rp) { - for (j = 0; j < 16; j++) { - *sum_s += s[j]; - *sum_r += r[j]; - *sum_sq_s += s[j] * s[j]; - *sum_sq_r += r[j] * r[j]; - *sum_sxr += s[j] * r[j]; - } - } -} -void vp9_ssim_parms_8x8_c(uint8_t *s, int sp, uint8_t *r, int rp, - unsigned long *sum_s, unsigned long *sum_r, - unsigned long *sum_sq_s, unsigned long *sum_sq_r, - unsigned long *sum_sxr) { - int i, j; - for (i = 0; i < 8; i++, s += sp, r += rp) { - for (j = 0; j < 8; j++) { - *sum_s += s[j]; - *sum_r += r[j]; - *sum_sq_s += s[j] * s[j]; - *sum_sq_r += r[j] * r[j]; - *sum_sxr += s[j] * r[j]; - } - } -} - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_highbd_ssim_parms_8x8_c(uint16_t *s, int sp, uint16_t *r, int rp, - uint32_t *sum_s, uint32_t *sum_r, - uint32_t *sum_sq_s, uint32_t *sum_sq_r, - uint32_t *sum_sxr) { - int i, j; - for (i = 0; i < 8; i++, s += sp, r += rp) { - for (j = 0; j < 8; j++) { - *sum_s += s[j]; - *sum_r += r[j]; - *sum_sq_s += s[j] * s[j]; - *sum_sq_r += r[j] * r[j]; - *sum_sxr += s[j] * r[j]; - } - } -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -static const int64_t cc1 = 26634; // (64^2*(.01*255)^2 -static const int64_t cc2 = 239708; // (64^2*(.03*255)^2 - -static double similarity(unsigned long sum_s, unsigned long sum_r, - unsigned long sum_sq_s, unsigned long sum_sq_r, - unsigned long sum_sxr, int count) { - int64_t ssim_n, ssim_d; - int64_t c1, c2; - - // scale the constants by number of pixels - c1 = (cc1 * count * count) >> 12; - c2 = (cc2 * count * count) >> 12; - - ssim_n = (2 * sum_s * sum_r + c1) * ((int64_t) 2 * count * sum_sxr - - (int64_t) 2 * sum_s * sum_r + c2); - - ssim_d = (sum_s * sum_s + sum_r * sum_r + c1) * - ((int64_t)count * sum_sq_s - (int64_t)sum_s * sum_s + - (int64_t)count * sum_sq_r - (int64_t) sum_r * sum_r + c2); - - return ssim_n * 1.0 / ssim_d; -} - -static double ssim_8x8(uint8_t *s, int sp, uint8_t *r, int rp) { - unsigned long sum_s = 0, sum_r = 0, sum_sq_s = 0, sum_sq_r = 0, sum_sxr = 0; - vp9_ssim_parms_8x8(s, sp, r, rp, &sum_s, &sum_r, &sum_sq_s, &sum_sq_r, - &sum_sxr); - return similarity(sum_s, sum_r, sum_sq_s, sum_sq_r, sum_sxr, 64); -} - -#if CONFIG_VP9_HIGHBITDEPTH -static double highbd_ssim_8x8(uint16_t *s, int sp, uint16_t *r, int rp, - unsigned int bd) { - uint32_t sum_s = 0, sum_r = 0, sum_sq_s = 0, sum_sq_r = 0, sum_sxr = 0; - const int oshift = bd - 8; - vp9_highbd_ssim_parms_8x8(s, sp, r, rp, &sum_s, &sum_r, &sum_sq_s, &sum_sq_r, - &sum_sxr); - return similarity(sum_s >> oshift, - sum_r >> oshift, - sum_sq_s >> (2 * oshift), - sum_sq_r >> (2 * oshift), - sum_sxr >> (2 * oshift), - 64); -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -// We are using a 8x8 moving window with starting location of each 8x8 window -// on the 4x4 pixel grid. Such arrangement allows the windows to overlap -// block boundaries to penalize blocking artifacts. -double vp9_ssim2(uint8_t *img1, uint8_t *img2, int stride_img1, - int stride_img2, int width, int height) { - int i, j; - int samples = 0; - double ssim_total = 0; - - // sample point start with each 4x4 location - for (i = 0; i <= height - 8; - i += 4, img1 += stride_img1 * 4, img2 += stride_img2 * 4) { - for (j = 0; j <= width - 8; j += 4) { - double v = ssim_8x8(img1 + j, stride_img1, img2 + j, stride_img2); - ssim_total += v; - samples++; - } - } - ssim_total /= samples; - return ssim_total; -} - -#if CONFIG_VP9_HIGHBITDEPTH -double vp9_highbd_ssim2(uint8_t *img1, uint8_t *img2, int stride_img1, - int stride_img2, int width, int height, - unsigned int bd) { - int i, j; - int samples = 0; - double ssim_total = 0; - - // sample point start with each 4x4 location - for (i = 0; i <= height - 8; - i += 4, img1 += stride_img1 * 4, img2 += stride_img2 * 4) { - for (j = 0; j <= width - 8; j += 4) { - double v = highbd_ssim_8x8(CONVERT_TO_SHORTPTR(img1 + j), stride_img1, - CONVERT_TO_SHORTPTR(img2 + j), stride_img2, - bd); - ssim_total += v; - samples++; - } - } - ssim_total /= samples; - return ssim_total; -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -double vp9_calc_ssim(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest, - double *weight) { - double a, b, c; - double ssimv; - - a = vp9_ssim2(source->y_buffer, dest->y_buffer, - source->y_stride, dest->y_stride, - source->y_crop_width, source->y_crop_height); - - b = vp9_ssim2(source->u_buffer, dest->u_buffer, - source->uv_stride, dest->uv_stride, - source->uv_crop_width, source->uv_crop_height); - - c = vp9_ssim2(source->v_buffer, dest->v_buffer, - source->uv_stride, dest->uv_stride, - source->uv_crop_width, source->uv_crop_height); - - ssimv = a * .8 + .1 * (b + c); - - *weight = 1; - - return ssimv; -} - -double vp9_calc_ssimg(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest, - double *ssim_y, double *ssim_u, double *ssim_v) { - double ssim_all = 0; - double a, b, c; - - a = vp9_ssim2(source->y_buffer, dest->y_buffer, - source->y_stride, dest->y_stride, - source->y_crop_width, source->y_crop_height); - - b = vp9_ssim2(source->u_buffer, dest->u_buffer, - source->uv_stride, dest->uv_stride, - source->uv_crop_width, source->uv_crop_height); - - c = vp9_ssim2(source->v_buffer, dest->v_buffer, - source->uv_stride, dest->uv_stride, - source->uv_crop_width, source->uv_crop_height); - *ssim_y = a; - *ssim_u = b; - *ssim_v = c; - ssim_all = (a * 4 + b + c) / 6; - - return ssim_all; -} - -#if CONFIG_VP9_HIGHBITDEPTH -double vp9_highbd_calc_ssim(YV12_BUFFER_CONFIG *source, - YV12_BUFFER_CONFIG *dest, - double *weight, unsigned int bd) { - double a, b, c; - double ssimv; - - a = vp9_highbd_ssim2(source->y_buffer, dest->y_buffer, - source->y_stride, dest->y_stride, - source->y_crop_width, source->y_crop_height, bd); - - b = vp9_highbd_ssim2(source->u_buffer, dest->u_buffer, - source->uv_stride, dest->uv_stride, - source->uv_crop_width, source->uv_crop_height, bd); - - c = vp9_highbd_ssim2(source->v_buffer, dest->v_buffer, - source->uv_stride, dest->uv_stride, - source->uv_crop_width, source->uv_crop_height, bd); - - ssimv = a * .8 + .1 * (b + c); - - *weight = 1; - - return ssimv; -} - -double vp9_highbd_calc_ssimg(YV12_BUFFER_CONFIG *source, - YV12_BUFFER_CONFIG *dest, double *ssim_y, - double *ssim_u, double *ssim_v, unsigned int bd) { - double ssim_all = 0; - double a, b, c; - - a = vp9_highbd_ssim2(source->y_buffer, dest->y_buffer, - source->y_stride, dest->y_stride, - source->y_crop_width, source->y_crop_height, bd); - - b = vp9_highbd_ssim2(source->u_buffer, dest->u_buffer, - source->uv_stride, dest->uv_stride, - source->uv_crop_width, source->uv_crop_height, bd); - - c = vp9_highbd_ssim2(source->v_buffer, dest->v_buffer, - source->uv_stride, dest->uv_stride, - source->uv_crop_width, source->uv_crop_height, bd); - *ssim_y = a; - *ssim_u = b; - *ssim_v = c; - ssim_all = (a * 4 + b + c) / 6; - - return ssim_all; -} -#endif // CONFIG_VP9_HIGHBITDEPTH diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_ssim.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_ssim.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_ssim.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_ssim.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_SSIM_H_ -#define VP9_ENCODER_VP9_SSIM_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "vpx_scale/yv12config.h" - -double vp9_calc_ssim(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest, - double *weight); - -double vp9_calc_ssimg(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest, - double *ssim_y, double *ssim_u, double *ssim_v); - -#if CONFIG_VP9_HIGHBITDEPTH -double vp9_highbd_calc_ssim(YV12_BUFFER_CONFIG *source, - YV12_BUFFER_CONFIG *dest, - double *weight, - unsigned int bd); - -double vp9_highbd_calc_ssimg(YV12_BUFFER_CONFIG *source, - YV12_BUFFER_CONFIG *dest, - double *ssim_y, - double *ssim_u, - double *ssim_v, - unsigned int bd); -#endif // CONFIG_VP9_HIGHBITDEPTH - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_SSIM_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_subexp.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_subexp.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_subexp.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_subexp.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,213 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_entropy.h" - -#include "vp9/encoder/vp9_cost.h" -#include "vp9/encoder/vp9_writer.h" - -#define vp9_cost_upd256 ((int)(vp9_cost_one(upd) - vp9_cost_zero(upd))) - -static const int update_bits[255] = { - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, -}; - -static int recenter_nonneg(int v, int m) { - if (v > (m << 1)) - return v; - else if (v >= m) - return ((v - m) << 1); - else - return ((m - v) << 1) - 1; -} - -static int remap_prob(int v, int m) { - int i; - static const int map_table[MAX_PROB - 1] = { - // generated by: - // map_table[j] = split_index(j, MAX_PROB - 1, MODULUS_PARAM); - 20, 21, 22, 23, 24, 25, 0, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 2, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 3, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 4, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 5, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 6, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 7, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 8, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 9, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 10, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 11, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 12, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 13, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 14, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 15, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 16, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 17, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 18, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 19, - }; - v--; - m--; - if ((m << 1) <= MAX_PROB) - i = recenter_nonneg(v, m) - 1; - else - i = recenter_nonneg(MAX_PROB - 1 - v, MAX_PROB - 1 - m) - 1; - - i = map_table[i]; - return i; -} - -static int prob_diff_update_cost(vp9_prob newp, vp9_prob oldp) { - int delp = remap_prob(newp, oldp); - return update_bits[delp] * 256; -} - -static void encode_uniform(vp9_writer *w, int v) { - const int l = 8; - const int m = (1 << l) - 191; - if (v < m) { - vp9_write_literal(w, v, l - 1); - } else { - vp9_write_literal(w, m + ((v - m) >> 1), l - 1); - vp9_write_literal(w, (v - m) & 1, 1); - } -} - -static INLINE int write_bit_gte(vp9_writer *w, int word, int test) { - vp9_write_literal(w, word >= test, 1); - return word >= test; -} - -static void encode_term_subexp(vp9_writer *w, int word) { - if (!write_bit_gte(w, word, 16)) { - vp9_write_literal(w, word, 4); - } else if (!write_bit_gte(w, word, 32)) { - vp9_write_literal(w, word - 16, 4); - } else if (!write_bit_gte(w, word, 64)) { - vp9_write_literal(w, word - 32, 5); - } else { - encode_uniform(w, word - 64); - } -} - -void vp9_write_prob_diff_update(vp9_writer *w, vp9_prob newp, vp9_prob oldp) { - const int delp = remap_prob(newp, oldp); - encode_term_subexp(w, delp); -} - -int vp9_prob_diff_update_savings_search(const unsigned int *ct, - vp9_prob oldp, vp9_prob *bestp, - vp9_prob upd) { - const int old_b = cost_branch256(ct, oldp); - int bestsavings = 0; - vp9_prob newp, bestnewp = oldp; - const int step = *bestp > oldp ? -1 : 1; - - for (newp = *bestp; newp != oldp; newp += step) { - const int new_b = cost_branch256(ct, newp); - const int update_b = prob_diff_update_cost(newp, oldp) + vp9_cost_upd256; - const int savings = old_b - new_b - update_b; - if (savings > bestsavings) { - bestsavings = savings; - bestnewp = newp; - } - } - *bestp = bestnewp; - return bestsavings; -} - -int vp9_prob_diff_update_savings_search_model(const unsigned int *ct, - const vp9_prob *oldp, - vp9_prob *bestp, - vp9_prob upd, - int stepsize) { - int i, old_b, new_b, update_b, savings, bestsavings, step; - int newp; - vp9_prob bestnewp, newplist[ENTROPY_NODES], oldplist[ENTROPY_NODES]; - vp9_model_to_full_probs(oldp, oldplist); - vpx_memcpy(newplist, oldp, sizeof(vp9_prob) * UNCONSTRAINED_NODES); - for (i = UNCONSTRAINED_NODES, old_b = 0; i < ENTROPY_NODES; ++i) - old_b += cost_branch256(ct + 2 * i, oldplist[i]); - old_b += cost_branch256(ct + 2 * PIVOT_NODE, oldplist[PIVOT_NODE]); - - bestsavings = 0; - bestnewp = oldp[PIVOT_NODE]; - - if (*bestp > oldp[PIVOT_NODE]) { - step = -stepsize; - for (newp = *bestp; newp > oldp[PIVOT_NODE]; newp += step) { - if (newp < 1 || newp > 255) - continue; - newplist[PIVOT_NODE] = newp; - vp9_model_to_full_probs(newplist, newplist); - for (i = UNCONSTRAINED_NODES, new_b = 0; i < ENTROPY_NODES; ++i) - new_b += cost_branch256(ct + 2 * i, newplist[i]); - new_b += cost_branch256(ct + 2 * PIVOT_NODE, newplist[PIVOT_NODE]); - update_b = prob_diff_update_cost(newp, oldp[PIVOT_NODE]) + - vp9_cost_upd256; - savings = old_b - new_b - update_b; - if (savings > bestsavings) { - bestsavings = savings; - bestnewp = newp; - } - } - } else { - step = stepsize; - for (newp = *bestp; newp < oldp[PIVOT_NODE]; newp += step) { - if (newp < 1 || newp > 255) - continue; - newplist[PIVOT_NODE] = newp; - vp9_model_to_full_probs(newplist, newplist); - for (i = UNCONSTRAINED_NODES, new_b = 0; i < ENTROPY_NODES; ++i) - new_b += cost_branch256(ct + 2 * i, newplist[i]); - new_b += cost_branch256(ct + 2 * PIVOT_NODE, newplist[PIVOT_NODE]); - update_b = prob_diff_update_cost(newp, oldp[PIVOT_NODE]) + - vp9_cost_upd256; - savings = old_b - new_b - update_b; - if (savings > bestsavings) { - bestsavings = savings; - bestnewp = newp; - } - } - } - - *bestp = bestnewp; - return bestsavings; -} - -void vp9_cond_prob_diff_update(vp9_writer *w, vp9_prob *oldp, - const unsigned int ct[2]) { - const vp9_prob upd = DIFF_UPDATE_PROB; - vp9_prob newp = get_binary_prob(ct[0], ct[1]); - const int savings = vp9_prob_diff_update_savings_search(ct, *oldp, &newp, - upd); - assert(newp >= 1); - if (savings > 0) { - vp9_write(w, 1, upd); - vp9_write_prob_diff_update(w, newp, *oldp); - *oldp = newp; - } else { - vp9_write(w, 0, upd); - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_subexp.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_subexp.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_subexp.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_subexp.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VP9_ENCODER_VP9_SUBEXP_H_ -#define VP9_ENCODER_VP9_SUBEXP_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -void vp9_write_prob_diff_update(vp9_writer *w, - vp9_prob newp, vp9_prob oldp); - -void vp9_cond_prob_diff_update(vp9_writer *w, vp9_prob *oldp, - unsigned int *ct); - -int vp9_prob_diff_update_savings_search(const unsigned int *ct, - vp9_prob oldp, vp9_prob *bestp, - vp9_prob upd); - - -int vp9_prob_diff_update_savings_search_model(const unsigned int *ct, - const vp9_prob *oldp, - vp9_prob *bestp, - vp9_prob upd, - int stepsize); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_SUBEXP_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_svc_layercontext.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_svc_layercontext.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_svc_layercontext.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_svc_layercontext.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,415 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "vp9/encoder/vp9_encoder.h" -#include "vp9/encoder/vp9_svc_layercontext.h" -#include "vp9/encoder/vp9_extend.h" - -#define SMALL_FRAME_FB_IDX 7 - -void vp9_init_layer_context(VP9_COMP *const cpi) { - SVC *const svc = &cpi->svc; - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - int layer; - int layer_end; - int alt_ref_idx = svc->number_spatial_layers; - - svc->spatial_layer_id = 0; - svc->temporal_layer_id = 0; - - if (svc->number_temporal_layers > 1 && cpi->oxcf.rc_mode == VPX_CBR) { - layer_end = svc->number_temporal_layers; - } else { - layer_end = svc->number_spatial_layers; - - if (cpi->oxcf.error_resilient_mode == 0 && cpi->oxcf.pass == 2) { - if (vp9_realloc_frame_buffer(&cpi->svc.empty_frame.img, - cpi->common.width, cpi->common.height, - cpi->common.subsampling_x, - cpi->common.subsampling_y, -#if CONFIG_VP9_HIGHBITDEPTH - cpi->common.use_highbitdepth, -#endif - VP9_ENC_BORDER_IN_PIXELS, - cpi->common.byte_alignment, - NULL, NULL, NULL)) - vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR, - "Failed to allocate empty frame for multiple frame " - "contexts"); - - vpx_memset(cpi->svc.empty_frame.img.buffer_alloc, 0x80, - cpi->svc.empty_frame.img.buffer_alloc_sz); - cpi->svc.empty_frame_width = cpi->common.width; - cpi->svc.empty_frame_height = cpi->common.height; - } - } - - for (layer = 0; layer < layer_end; ++layer) { - LAYER_CONTEXT *const lc = &svc->layer_context[layer]; - RATE_CONTROL *const lrc = &lc->rc; - int i; - lc->current_video_frame_in_layer = 0; - lc->layer_size = 0; - lc->frames_from_key_frame = 0; - lc->last_frame_type = FRAME_TYPES; - lrc->ni_av_qi = oxcf->worst_allowed_q; - lrc->total_actual_bits = 0; - lrc->total_target_vs_actual = 0; - lrc->ni_tot_qi = 0; - lrc->tot_q = 0.0; - lrc->avg_q = 0.0; - lrc->ni_frames = 0; - lrc->decimation_count = 0; - lrc->decimation_factor = 0; - - for (i = 0; i < RATE_FACTOR_LEVELS; ++i) { - lrc->rate_correction_factors[i] = 1.0; - } - - if (svc->number_temporal_layers > 1 && cpi->oxcf.rc_mode == VPX_CBR) { - lc->target_bandwidth = oxcf->ts_target_bitrate[layer]; - lrc->last_q[INTER_FRAME] = oxcf->worst_allowed_q; - lrc->avg_frame_qindex[INTER_FRAME] = oxcf->worst_allowed_q; - lrc->avg_frame_qindex[KEY_FRAME] = oxcf->worst_allowed_q; - } else { - lc->target_bandwidth = oxcf->ss_target_bitrate[layer]; - lrc->last_q[KEY_FRAME] = oxcf->best_allowed_q; - lrc->last_q[INTER_FRAME] = oxcf->best_allowed_q; - lrc->avg_frame_qindex[KEY_FRAME] = (oxcf->worst_allowed_q + - oxcf->best_allowed_q) / 2; - lrc->avg_frame_qindex[INTER_FRAME] = (oxcf->worst_allowed_q + - oxcf->best_allowed_q) / 2; - if (oxcf->ss_enable_auto_arf[layer]) - lc->alt_ref_idx = alt_ref_idx++; - else - lc->alt_ref_idx = INVALID_IDX; - lc->gold_ref_idx = INVALID_IDX; - } - - lrc->buffer_level = oxcf->starting_buffer_level_ms * - lc->target_bandwidth / 1000; - lrc->bits_off_target = lrc->buffer_level; - } - - // Still have extra buffer for base layer golden frame - if (!(svc->number_temporal_layers > 1 && cpi->oxcf.rc_mode == VPX_CBR) - && alt_ref_idx < REF_FRAMES) - svc->layer_context[0].gold_ref_idx = alt_ref_idx; -} - -// Update the layer context from a change_config() call. -void vp9_update_layer_context_change_config(VP9_COMP *const cpi, - const int target_bandwidth) { - SVC *const svc = &cpi->svc; - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - const RATE_CONTROL *const rc = &cpi->rc; - int layer; - int layer_end; - float bitrate_alloc = 1.0; - - if (svc->number_temporal_layers > 1 && cpi->oxcf.rc_mode == VPX_CBR) { - layer_end = svc->number_temporal_layers; - } else { - layer_end = svc->number_spatial_layers; - } - - for (layer = 0; layer < layer_end; ++layer) { - LAYER_CONTEXT *const lc = &svc->layer_context[layer]; - RATE_CONTROL *const lrc = &lc->rc; - - if (svc->number_temporal_layers > 1 && cpi->oxcf.rc_mode == VPX_CBR) { - lc->target_bandwidth = oxcf->ts_target_bitrate[layer]; - } else { - lc->target_bandwidth = oxcf->ss_target_bitrate[layer]; - } - bitrate_alloc = (float)lc->target_bandwidth / target_bandwidth; - // Update buffer-related quantities. - lrc->starting_buffer_level = - (int64_t)(rc->starting_buffer_level * bitrate_alloc); - lrc->optimal_buffer_level = - (int64_t)(rc->optimal_buffer_level * bitrate_alloc); - lrc->maximum_buffer_size = - (int64_t)(rc->maximum_buffer_size * bitrate_alloc); - lrc->bits_off_target = MIN(lrc->bits_off_target, lrc->maximum_buffer_size); - lrc->buffer_level = MIN(lrc->buffer_level, lrc->maximum_buffer_size); - // Update framerate-related quantities. - if (svc->number_temporal_layers > 1 && cpi->oxcf.rc_mode == VPX_CBR) { - lc->framerate = cpi->framerate / oxcf->ts_rate_decimator[layer]; - } else { - lc->framerate = cpi->framerate; - } - lrc->avg_frame_bandwidth = (int)(lc->target_bandwidth / lc->framerate); - lrc->max_frame_bandwidth = rc->max_frame_bandwidth; - // Update qp-related quantities. - lrc->worst_quality = rc->worst_quality; - lrc->best_quality = rc->best_quality; - } -} - -static LAYER_CONTEXT *get_layer_context(VP9_COMP *const cpi) { - return (cpi->svc.number_temporal_layers > 1 && cpi->oxcf.rc_mode == VPX_CBR) ? - &cpi->svc.layer_context[cpi->svc.temporal_layer_id] : - &cpi->svc.layer_context[cpi->svc.spatial_layer_id]; -} - -void vp9_update_temporal_layer_framerate(VP9_COMP *const cpi) { - SVC *const svc = &cpi->svc; - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - LAYER_CONTEXT *const lc = get_layer_context(cpi); - RATE_CONTROL *const lrc = &lc->rc; - const int layer = svc->temporal_layer_id; - - lc->framerate = cpi->framerate / oxcf->ts_rate_decimator[layer]; - lrc->avg_frame_bandwidth = (int)(lc->target_bandwidth / lc->framerate); - lrc->max_frame_bandwidth = cpi->rc.max_frame_bandwidth; - // Update the average layer frame size (non-cumulative per-frame-bw). - if (layer == 0) { - lc->avg_frame_size = lrc->avg_frame_bandwidth; - } else { - const double prev_layer_framerate = - cpi->framerate / oxcf->ts_rate_decimator[layer - 1]; - const int prev_layer_target_bandwidth = oxcf->ts_target_bitrate[layer - 1]; - lc->avg_frame_size = - (int)((lc->target_bandwidth - prev_layer_target_bandwidth) / - (lc->framerate - prev_layer_framerate)); - } -} - -void vp9_update_spatial_layer_framerate(VP9_COMP *const cpi, double framerate) { - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - LAYER_CONTEXT *const lc = get_layer_context(cpi); - RATE_CONTROL *const lrc = &lc->rc; - - lc->framerate = framerate; - lrc->avg_frame_bandwidth = (int)(lc->target_bandwidth / lc->framerate); - lrc->min_frame_bandwidth = (int)(lrc->avg_frame_bandwidth * - oxcf->two_pass_vbrmin_section / 100); - lrc->max_frame_bandwidth = (int)(((int64_t)lrc->avg_frame_bandwidth * - oxcf->two_pass_vbrmax_section) / 100); - vp9_rc_set_gf_max_interval(cpi, lrc); -} - -void vp9_restore_layer_context(VP9_COMP *const cpi) { - LAYER_CONTEXT *const lc = get_layer_context(cpi); - const int old_frame_since_key = cpi->rc.frames_since_key; - const int old_frame_to_key = cpi->rc.frames_to_key; - - cpi->rc = lc->rc; - cpi->twopass = lc->twopass; - cpi->oxcf.target_bandwidth = lc->target_bandwidth; - cpi->alt_ref_source = lc->alt_ref_source; - // Reset the frames_since_key and frames_to_key counters to their values - // before the layer restore. Keep these defined for the stream (not layer). - if (cpi->svc.number_temporal_layers > 1) { - cpi->rc.frames_since_key = old_frame_since_key; - cpi->rc.frames_to_key = old_frame_to_key; - } -} - -void vp9_save_layer_context(VP9_COMP *const cpi) { - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - LAYER_CONTEXT *const lc = get_layer_context(cpi); - - lc->rc = cpi->rc; - lc->twopass = cpi->twopass; - lc->target_bandwidth = (int)oxcf->target_bandwidth; - lc->alt_ref_source = cpi->alt_ref_source; -} - -void vp9_init_second_pass_spatial_svc(VP9_COMP *cpi) { - SVC *const svc = &cpi->svc; - int i; - - for (i = 0; i < svc->number_spatial_layers; ++i) { - TWO_PASS *const twopass = &svc->layer_context[i].twopass; - - svc->spatial_layer_id = i; - vp9_init_second_pass(cpi); - - twopass->total_stats.spatial_layer_id = i; - twopass->total_left_stats.spatial_layer_id = i; - } - svc->spatial_layer_id = 0; -} - -void vp9_inc_frame_in_layer(VP9_COMP *const cpi) { - LAYER_CONTEXT *const lc = - (cpi->svc.number_temporal_layers > 1 && cpi->oxcf.rc_mode == VPX_CBR) ? - &cpi->svc.layer_context[cpi->svc.temporal_layer_id] : - &cpi->svc.layer_context[cpi->svc.spatial_layer_id]; - ++lc->current_video_frame_in_layer; - ++lc->frames_from_key_frame; -} - -int vp9_is_upper_layer_key_frame(const VP9_COMP *const cpi) { - return is_two_pass_svc(cpi) && - cpi->svc.spatial_layer_id > 0 && - cpi->svc.layer_context[cpi->svc.spatial_layer_id].is_key_frame; -} - -#if CONFIG_SPATIAL_SVC -static void get_layer_resolution(const int width_org, const int height_org, - const int num, const int den, - int *width_out, int *height_out) { - int w, h; - - if (width_out == NULL || height_out == NULL || den == 0) - return; - - w = width_org * num / den; - h = height_org * num / den; - - // make height and width even to make chrome player happy - w += w % 2; - h += h % 2; - - *width_out = w; - *height_out = h; -} - -int vp9_svc_start_frame(VP9_COMP *const cpi) { - int width = 0, height = 0; - LAYER_CONTEXT *lc; - struct lookahead_entry *buf; - int count = 1 << (cpi->svc.number_temporal_layers - 1); - - cpi->svc.spatial_layer_id = cpi->svc.spatial_layer_to_encode; - lc = &cpi->svc.layer_context[cpi->svc.spatial_layer_id]; - - cpi->svc.temporal_layer_id = 0; - while ((lc->current_video_frame_in_layer % count) != 0) { - ++cpi->svc.temporal_layer_id; - count >>= 1; - } - - cpi->ref_frame_flags = VP9_ALT_FLAG | VP9_GOLD_FLAG | VP9_LAST_FLAG; - - cpi->lst_fb_idx = cpi->svc.spatial_layer_id; - - if (cpi->svc.spatial_layer_id == 0) - cpi->gld_fb_idx = (lc->gold_ref_idx >= 0) ? - lc->gold_ref_idx : cpi->lst_fb_idx; - else - cpi->gld_fb_idx = cpi->svc.spatial_layer_id - 1; - - if (lc->current_video_frame_in_layer == 0) { - if (cpi->svc.spatial_layer_id >= 2) { - cpi->alt_fb_idx = cpi->svc.spatial_layer_id - 2; - } else { - cpi->alt_fb_idx = cpi->lst_fb_idx; - cpi->ref_frame_flags &= (~VP9_LAST_FLAG & ~VP9_ALT_FLAG); - } - } else { - if (cpi->oxcf.ss_enable_auto_arf[cpi->svc.spatial_layer_id]) { - cpi->alt_fb_idx = lc->alt_ref_idx; - if (!lc->has_alt_frame) - cpi->ref_frame_flags &= (~VP9_ALT_FLAG); - } else { - // Find a proper alt_fb_idx for layers that don't have alt ref frame - if (cpi->svc.spatial_layer_id == 0) { - cpi->alt_fb_idx = cpi->lst_fb_idx; - } else { - LAYER_CONTEXT *lc_lower = - &cpi->svc.layer_context[cpi->svc.spatial_layer_id - 1]; - - if (cpi->oxcf.ss_enable_auto_arf[cpi->svc.spatial_layer_id - 1] && - lc_lower->alt_ref_source != NULL) - cpi->alt_fb_idx = lc_lower->alt_ref_idx; - else if (cpi->svc.spatial_layer_id >= 2) - cpi->alt_fb_idx = cpi->svc.spatial_layer_id - 2; - else - cpi->alt_fb_idx = cpi->lst_fb_idx; - } - } - } - - get_layer_resolution(cpi->oxcf.width, cpi->oxcf.height, - lc->scaling_factor_num, lc->scaling_factor_den, - &width, &height); - - // Workaround for multiple frame contexts. In some frames we can't use prev_mi - // since its previous frame could be changed during decoding time. The idea is - // we put a empty invisible frame in front of them, then we will not use - // prev_mi when encoding these frames. - - buf = vp9_lookahead_peek(cpi->lookahead, 0); - if (cpi->oxcf.error_resilient_mode == 0 && cpi->oxcf.pass == 2 && - cpi->svc.encode_empty_frame_state == NEED_TO_ENCODE && - lc->rc.frames_to_key != 0 && - !(buf != NULL && (buf->flags & VPX_EFLAG_FORCE_KF))) { - if ((cpi->svc.number_temporal_layers > 1 && - cpi->svc.temporal_layer_id < cpi->svc.number_temporal_layers - 1) || - (cpi->svc.number_spatial_layers > 1 && - cpi->svc.spatial_layer_id == 0)) { - struct lookahead_entry *buf = vp9_lookahead_peek(cpi->lookahead, 0); - - if (buf != NULL) { - cpi->svc.empty_frame.ts_start = buf->ts_start; - cpi->svc.empty_frame.ts_end = buf->ts_end; - cpi->svc.encode_empty_frame_state = ENCODING; - cpi->common.show_frame = 0; - cpi->ref_frame_flags = 0; - cpi->common.frame_type = INTER_FRAME; - cpi->lst_fb_idx = - cpi->gld_fb_idx = cpi->alt_fb_idx = SMALL_FRAME_FB_IDX; - - // Gradually make the empty frame smaller to save bits. Make it half of - // its previous size because of the scaling factor restriction. - cpi->svc.empty_frame_width >>= 1; - cpi->svc.empty_frame_width = (cpi->svc.empty_frame_width + 1) & ~1; - if (cpi->svc.empty_frame_width < 16) - cpi->svc.empty_frame_width = 16; - - cpi->svc.empty_frame_height >>= 1; - cpi->svc.empty_frame_height = (cpi->svc.empty_frame_height + 1) & ~1; - if (cpi->svc.empty_frame_height < 16) - cpi->svc.empty_frame_height = 16; - - width = cpi->svc.empty_frame_width; - height = cpi->svc.empty_frame_height; - } - } - } - - cpi->oxcf.worst_allowed_q = vp9_quantizer_to_qindex(lc->max_q); - cpi->oxcf.best_allowed_q = vp9_quantizer_to_qindex(lc->min_q); - - vp9_change_config(cpi, &cpi->oxcf); - - if (vp9_set_size_literal(cpi, width, height) != 0) - return VPX_CODEC_INVALID_PARAM; - - vp9_set_high_precision_mv(cpi, 1); - - cpi->alt_ref_source = get_layer_context(cpi)->alt_ref_source; - - return 0; -} - -struct lookahead_entry *vp9_svc_lookahead_pop(VP9_COMP *const cpi, - struct lookahead_ctx *ctx, - int drain) { - struct lookahead_entry *buf = NULL; - - if (ctx->sz && (drain || ctx->sz == ctx->max_sz - MAX_PRE_FRAMES)) { - buf = vp9_lookahead_peek(ctx, 0); - if (buf != NULL) { - // Only remove the buffer when pop the highest layer. - if (cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1) { - vp9_lookahead_pop(ctx, drain); - } - } - } - - return buf; -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_svc_layercontext.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_svc_layercontext.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_svc_layercontext.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_svc_layercontext.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_SVC_LAYERCONTEXT_H_ -#define VP9_ENCODER_VP9_SVC_LAYERCONTEXT_H_ - -#include "vpx/vpx_encoder.h" - -#include "vp9/encoder/vp9_ratectrl.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - RATE_CONTROL rc; - int target_bandwidth; - double framerate; - int avg_frame_size; - int max_q; - int min_q; - int scaling_factor_num; - int scaling_factor_den; - TWO_PASS twopass; - vpx_fixed_buf_t rc_twopass_stats_in; - unsigned int current_video_frame_in_layer; - int is_key_frame; - int frames_from_key_frame; - FRAME_TYPE last_frame_type; - struct lookahead_entry *alt_ref_source; - int alt_ref_idx; - int gold_ref_idx; - int has_alt_frame; - size_t layer_size; - struct vpx_psnr_pkt psnr_pkt; -} LAYER_CONTEXT; - -typedef struct { - int spatial_layer_id; - int temporal_layer_id; - int number_spatial_layers; - int number_temporal_layers; - - int spatial_layer_to_encode; - - // Workaround for multiple frame contexts - enum { - ENCODED = 0, - ENCODING, - NEED_TO_ENCODE - }encode_empty_frame_state; - struct lookahead_entry empty_frame; - int empty_frame_width; - int empty_frame_height; - - // Store scaled source frames to be used for temporal filter to generate - // a alt ref frame. - YV12_BUFFER_CONFIG scaled_frames[MAX_LAG_BUFFERS]; - - // Layer context used for rate control in one pass temporal CBR mode or - // two pass spatial mode. Defined for temporal or spatial layers for now. - // Does not support temporal combined with spatial RC. - LAYER_CONTEXT layer_context[MAX(VPX_TS_MAX_LAYERS, VPX_SS_MAX_LAYERS)]; -} SVC; - -struct VP9_COMP; - -// Initialize layer context data from init_config(). -void vp9_init_layer_context(struct VP9_COMP *const cpi); - -// Update the layer context from a change_config() call. -void vp9_update_layer_context_change_config(struct VP9_COMP *const cpi, - const int target_bandwidth); - -// Prior to encoding the frame, update framerate-related quantities -// for the current temporal layer. -void vp9_update_temporal_layer_framerate(struct VP9_COMP *const cpi); - -// Update framerate-related quantities for the current spatial layer. -void vp9_update_spatial_layer_framerate(struct VP9_COMP *const cpi, - double framerate); - -// Prior to encoding the frame, set the layer context, for the current layer -// to be encoded, to the cpi struct. -void vp9_restore_layer_context(struct VP9_COMP *const cpi); - -// Save the layer context after encoding the frame. -void vp9_save_layer_context(struct VP9_COMP *const cpi); - -// Initialize second pass rc for spatial svc. -void vp9_init_second_pass_spatial_svc(struct VP9_COMP *cpi); - -// Increment number of video frames in layer -void vp9_inc_frame_in_layer(struct VP9_COMP *const cpi); - -// Check if current layer is key frame in spatial upper layer -int vp9_is_upper_layer_key_frame(const struct VP9_COMP *const cpi); - -// Get the next source buffer to encode -struct lookahead_entry *vp9_svc_lookahead_pop(struct VP9_COMP *const cpi, - struct lookahead_ctx *ctx, - int drain); - -// Start a frame and initialize svc parameters -int vp9_svc_start_frame(struct VP9_COMP *const cpi); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_SVC_LAYERCONTEXT_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_temporal_filter.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_temporal_filter.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_temporal_filter.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_temporal_filter.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,748 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "vp9/common/vp9_alloccommon.h" -#include "vp9/common/vp9_onyxc_int.h" -#include "vp9/common/vp9_quant_common.h" -#include "vp9/common/vp9_reconinter.h" -#include "vp9/common/vp9_systemdependent.h" -#include "vp9/encoder/vp9_extend.h" -#include "vp9/encoder/vp9_firstpass.h" -#include "vp9/encoder/vp9_mcomp.h" -#include "vp9/encoder/vp9_encoder.h" -#include "vp9/encoder/vp9_quantize.h" -#include "vp9/encoder/vp9_ratectrl.h" -#include "vp9/encoder/vp9_segmentation.h" -#include "vpx_mem/vpx_mem.h" -#include "vpx_ports/vpx_timer.h" -#include "vpx_scale/vpx_scale.h" - -static int fixed_divide[512]; - -static void temporal_filter_predictors_mb_c(MACROBLOCKD *xd, - uint8_t *y_mb_ptr, - uint8_t *u_mb_ptr, - uint8_t *v_mb_ptr, - int stride, - int uv_block_width, - int uv_block_height, - int mv_row, - int mv_col, - uint8_t *pred, - struct scale_factors *scale, - int x, int y) { - const int which_mv = 0; - const MV mv = { mv_row, mv_col }; - const InterpKernel *const kernel = - vp9_get_interp_kernel(xd->mi[0].src_mi->mbmi.interp_filter); - - enum mv_precision mv_precision_uv; - int uv_stride; - if (uv_block_width == 8) { - uv_stride = (stride + 1) >> 1; - mv_precision_uv = MV_PRECISION_Q4; - } else { - uv_stride = stride; - mv_precision_uv = MV_PRECISION_Q3; - } - -#if CONFIG_VP9_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - vp9_highbd_build_inter_predictor(y_mb_ptr, stride, - &pred[0], 16, - &mv, - scale, - 16, 16, - which_mv, - kernel, MV_PRECISION_Q3, x, y, xd->bd); - - vp9_highbd_build_inter_predictor(u_mb_ptr, uv_stride, - &pred[256], uv_block_width, - &mv, - scale, - uv_block_width, uv_block_height, - which_mv, - kernel, mv_precision_uv, x, y, xd->bd); - - vp9_highbd_build_inter_predictor(v_mb_ptr, uv_stride, - &pred[512], uv_block_width, - &mv, - scale, - uv_block_width, uv_block_height, - which_mv, - kernel, mv_precision_uv, x, y, xd->bd); - return; - } -#endif // CONFIG_VP9_HIGHBITDEPTH - vp9_build_inter_predictor(y_mb_ptr, stride, - &pred[0], 16, - &mv, - scale, - 16, 16, - which_mv, - kernel, MV_PRECISION_Q3, x, y); - - vp9_build_inter_predictor(u_mb_ptr, uv_stride, - &pred[256], uv_block_width, - &mv, - scale, - uv_block_width, uv_block_height, - which_mv, - kernel, mv_precision_uv, x, y); - - vp9_build_inter_predictor(v_mb_ptr, uv_stride, - &pred[512], uv_block_width, - &mv, - scale, - uv_block_width, uv_block_height, - which_mv, - kernel, mv_precision_uv, x, y); -} - -void vp9_temporal_filter_init() { - int i; - - fixed_divide[0] = 0; - for (i = 1; i < 512; ++i) - fixed_divide[i] = 0x80000 / i; -} - -void vp9_temporal_filter_apply_c(uint8_t *frame1, - unsigned int stride, - uint8_t *frame2, - unsigned int block_width, - unsigned int block_height, - int strength, - int filter_weight, - unsigned int *accumulator, - uint16_t *count) { - unsigned int i, j, k; - int modifier; - int byte = 0; - const int rounding = strength > 0 ? 1 << (strength - 1) : 0; - - for (i = 0, k = 0; i < block_height; i++) { - for (j = 0; j < block_width; j++, k++) { - int src_byte = frame1[byte]; - int pixel_value = *frame2++; - - modifier = src_byte - pixel_value; - // This is an integer approximation of: - // float coeff = (3.0 * modifer * modifier) / pow(2, strength); - // modifier = (int)roundf(coeff > 16 ? 0 : 16-coeff); - modifier *= modifier; - modifier *= 3; - modifier += rounding; - modifier >>= strength; - - if (modifier > 16) - modifier = 16; - - modifier = 16 - modifier; - modifier *= filter_weight; - - count[k] += modifier; - accumulator[k] += modifier * pixel_value; - - byte++; - } - - byte += stride - block_width; - } -} - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_highbd_temporal_filter_apply_c(uint8_t *frame1_8, - unsigned int stride, - uint8_t *frame2_8, - unsigned int block_width, - unsigned int block_height, - int strength, - int filter_weight, - unsigned int *accumulator, - uint16_t *count) { - uint16_t *frame1 = CONVERT_TO_SHORTPTR(frame1_8); - uint16_t *frame2 = CONVERT_TO_SHORTPTR(frame2_8); - unsigned int i, j, k; - int modifier; - int byte = 0; - const int rounding = strength > 0 ? 1 << (strength - 1) : 0; - - for (i = 0, k = 0; i < block_height; i++) { - for (j = 0; j < block_width; j++, k++) { - int src_byte = frame1[byte]; - int pixel_value = *frame2++; - - modifier = src_byte - pixel_value; - // This is an integer approximation of: - // float coeff = (3.0 * modifer * modifier) / pow(2, strength); - // modifier = (int)roundf(coeff > 16 ? 0 : 16-coeff); - modifier *= modifier; - modifier *= 3; - modifier += rounding; - modifier >>= strength; - - if (modifier > 16) - modifier = 16; - - modifier = 16 - modifier; - modifier *= filter_weight; - - count[k] += modifier; - accumulator[k] += modifier * pixel_value; - - byte++; - } - - byte += stride - block_width; - } -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -static int temporal_filter_find_matching_mb_c(VP9_COMP *cpi, - uint8_t *arf_frame_buf, - uint8_t *frame_ptr_buf, - int stride) { - MACROBLOCK *const x = &cpi->td.mb; - MACROBLOCKD *const xd = &x->e_mbd; - const MV_SPEED_FEATURES *const mv_sf = &cpi->sf.mv; - int step_param; - int sadpb = x->sadperbit16; - int bestsme = INT_MAX; - int distortion; - unsigned int sse; - int cost_list[5]; - - MV best_ref_mv1 = {0, 0}; - MV best_ref_mv1_full; /* full-pixel value of best_ref_mv1 */ - MV *ref_mv = &x->e_mbd.mi[0].src_mi->bmi[0].as_mv[0].as_mv; - - // Save input state - struct buf_2d src = x->plane[0].src; - struct buf_2d pre = xd->plane[0].pre[0]; - - best_ref_mv1_full.col = best_ref_mv1.col >> 3; - best_ref_mv1_full.row = best_ref_mv1.row >> 3; - - // Setup frame pointers - x->plane[0].src.buf = arf_frame_buf; - x->plane[0].src.stride = stride; - xd->plane[0].pre[0].buf = frame_ptr_buf; - xd->plane[0].pre[0].stride = stride; - - step_param = mv_sf->reduce_first_step_size; - step_param = MIN(step_param, MAX_MVSEARCH_STEPS - 2); - - // Ignore mv costing by sending NULL pointer instead of cost arrays - vp9_hex_search(x, &best_ref_mv1_full, step_param, sadpb, 1, - cond_cost_list(cpi, cost_list), - &cpi->fn_ptr[BLOCK_16X16], 0, &best_ref_mv1, ref_mv); - - // Ignore mv costing by sending NULL pointer instead of cost array - bestsme = cpi->find_fractional_mv_step(x, ref_mv, - &best_ref_mv1, - cpi->common.allow_high_precision_mv, - x->errorperbit, - &cpi->fn_ptr[BLOCK_16X16], - 0, mv_sf->subpel_iters_per_step, - cond_cost_list(cpi, cost_list), - NULL, NULL, - &distortion, &sse, NULL, 0, 0); - - // Restore input state - x->plane[0].src = src; - xd->plane[0].pre[0] = pre; - - return bestsme; -} - -static void temporal_filter_iterate_c(VP9_COMP *cpi, - YV12_BUFFER_CONFIG **frames, - int frame_count, - int alt_ref_index, - int strength, - struct scale_factors *scale) { - int byte; - int frame; - int mb_col, mb_row; - unsigned int filter_weight; - int mb_cols = (frames[alt_ref_index]->y_crop_width + 15) >> 4; - int mb_rows = (frames[alt_ref_index]->y_crop_height + 15) >> 4; - int mb_y_offset = 0; - int mb_uv_offset = 0; - DECLARE_ALIGNED_ARRAY(16, unsigned int, accumulator, 16 * 16 * 3); - DECLARE_ALIGNED_ARRAY(16, uint16_t, count, 16 * 16 * 3); - MACROBLOCKD *mbd = &cpi->td.mb.e_mbd; - YV12_BUFFER_CONFIG *f = frames[alt_ref_index]; - uint8_t *dst1, *dst2; -#if CONFIG_VP9_HIGHBITDEPTH - DECLARE_ALIGNED_ARRAY(16, uint16_t, predictor16, 16 * 16 * 3); - DECLARE_ALIGNED_ARRAY(16, uint8_t, predictor8, 16 * 16 * 3); - uint8_t *predictor; -#else - DECLARE_ALIGNED_ARRAY(16, uint8_t, predictor, 16 * 16 * 3); -#endif - const int mb_uv_height = 16 >> mbd->plane[1].subsampling_y; - const int mb_uv_width = 16 >> mbd->plane[1].subsampling_x; - - // Save input state - uint8_t* input_buffer[MAX_MB_PLANE]; - int i; -#if CONFIG_VP9_HIGHBITDEPTH - if (mbd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - predictor = CONVERT_TO_BYTEPTR(predictor16); - } else { - predictor = predictor8; - } -#endif - - for (i = 0; i < MAX_MB_PLANE; i++) - input_buffer[i] = mbd->plane[i].pre[0].buf; - - for (mb_row = 0; mb_row < mb_rows; mb_row++) { - // Source frames are extended to 16 pixels. This is different than - // L/A/G reference frames that have a border of 32 (VP9ENCBORDERINPIXELS) - // A 6/8 tap filter is used for motion search. This requires 2 pixels - // before and 3 pixels after. So the largest Y mv on a border would - // then be 16 - VP9_INTERP_EXTEND. The UV blocks are half the size of the - // Y and therefore only extended by 8. The largest mv that a UV block - // can support is 8 - VP9_INTERP_EXTEND. A UV mv is half of a Y mv. - // (16 - VP9_INTERP_EXTEND) >> 1 which is greater than - // 8 - VP9_INTERP_EXTEND. - // To keep the mv in play for both Y and UV planes the max that it - // can be on a border is therefore 16 - (2*VP9_INTERP_EXTEND+1). - cpi->td.mb.mv_row_min = -((mb_row * 16) + (17 - 2 * VP9_INTERP_EXTEND)); - cpi->td.mb.mv_row_max = ((mb_rows - 1 - mb_row) * 16) - + (17 - 2 * VP9_INTERP_EXTEND); - - for (mb_col = 0; mb_col < mb_cols; mb_col++) { - int i, j, k; - int stride; - - vpx_memset(accumulator, 0, 16 * 16 * 3 * sizeof(accumulator[0])); - vpx_memset(count, 0, 16 * 16 * 3 * sizeof(count[0])); - - cpi->td.mb.mv_col_min = -((mb_col * 16) + (17 - 2 * VP9_INTERP_EXTEND)); - cpi->td.mb.mv_col_max = ((mb_cols - 1 - mb_col) * 16) - + (17 - 2 * VP9_INTERP_EXTEND); - - for (frame = 0; frame < frame_count; frame++) { - const int thresh_low = 10000; - const int thresh_high = 20000; - - if (frames[frame] == NULL) - continue; - - mbd->mi[0].src_mi->bmi[0].as_mv[0].as_mv.row = 0; - mbd->mi[0].src_mi->bmi[0].as_mv[0].as_mv.col = 0; - - if (frame == alt_ref_index) { - filter_weight = 2; - } else { - // Find best match in this frame by MC - int err = temporal_filter_find_matching_mb_c(cpi, - frames[alt_ref_index]->y_buffer + mb_y_offset, - frames[frame]->y_buffer + mb_y_offset, - frames[frame]->y_stride); - - // Assign higher weight to matching MB if it's error - // score is lower. If not applying MC default behavior - // is to weight all MBs equal. - filter_weight = err < thresh_low - ? 2 : err < thresh_high ? 1 : 0; - } - - if (filter_weight != 0) { - // Construct the predictors - temporal_filter_predictors_mb_c(mbd, - frames[frame]->y_buffer + mb_y_offset, - frames[frame]->u_buffer + mb_uv_offset, - frames[frame]->v_buffer + mb_uv_offset, - frames[frame]->y_stride, - mb_uv_width, mb_uv_height, - mbd->mi[0].src_mi->bmi[0].as_mv[0].as_mv.row, - mbd->mi[0].src_mi->bmi[0].as_mv[0].as_mv.col, - predictor, scale, - mb_col * 16, mb_row * 16); - -#if CONFIG_VP9_HIGHBITDEPTH - if (mbd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - int adj_strength = strength + 2 * (mbd->bd - 8); - // Apply the filter (YUV) - vp9_highbd_temporal_filter_apply(f->y_buffer + mb_y_offset, - f->y_stride, - predictor, 16, 16, adj_strength, - filter_weight, - accumulator, count); - vp9_highbd_temporal_filter_apply(f->u_buffer + mb_uv_offset, - f->uv_stride, predictor + 256, - mb_uv_width, mb_uv_height, - adj_strength, - filter_weight, accumulator + 256, - count + 256); - vp9_highbd_temporal_filter_apply(f->v_buffer + mb_uv_offset, - f->uv_stride, predictor + 512, - mb_uv_width, mb_uv_height, - adj_strength, filter_weight, - accumulator + 512, count + 512); - } else { - // Apply the filter (YUV) - vp9_temporal_filter_apply(f->y_buffer + mb_y_offset, f->y_stride, - predictor, 16, 16, - strength, filter_weight, - accumulator, count); - vp9_temporal_filter_apply(f->u_buffer + mb_uv_offset, f->uv_stride, - predictor + 256, - mb_uv_width, mb_uv_height, strength, - filter_weight, accumulator + 256, - count + 256); - vp9_temporal_filter_apply(f->v_buffer + mb_uv_offset, f->uv_stride, - predictor + 512, - mb_uv_width, mb_uv_height, strength, - filter_weight, accumulator + 512, - count + 512); - } -#else - // Apply the filter (YUV) - vp9_temporal_filter_apply(f->y_buffer + mb_y_offset, f->y_stride, - predictor, 16, 16, - strength, filter_weight, - accumulator, count); - vp9_temporal_filter_apply(f->u_buffer + mb_uv_offset, f->uv_stride, - predictor + 256, - mb_uv_width, mb_uv_height, strength, - filter_weight, accumulator + 256, - count + 256); - vp9_temporal_filter_apply(f->v_buffer + mb_uv_offset, f->uv_stride, - predictor + 512, - mb_uv_width, mb_uv_height, strength, - filter_weight, accumulator + 512, - count + 512); -#endif // CONFIG_VP9_HIGHBITDEPTH - } - } - -#if CONFIG_VP9_HIGHBITDEPTH - if (mbd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - uint16_t *dst1_16; - uint16_t *dst2_16; - // Normalize filter output to produce AltRef frame - dst1 = cpi->alt_ref_buffer.y_buffer; - dst1_16 = CONVERT_TO_SHORTPTR(dst1); - stride = cpi->alt_ref_buffer.y_stride; - byte = mb_y_offset; - for (i = 0, k = 0; i < 16; i++) { - for (j = 0; j < 16; j++, k++) { - unsigned int pval = accumulator[k] + (count[k] >> 1); - pval *= fixed_divide[count[k]]; - pval >>= 19; - - dst1_16[byte] = (uint16_t)pval; - - // move to next pixel - byte++; - } - - byte += stride - 16; - } - - dst1 = cpi->alt_ref_buffer.u_buffer; - dst2 = cpi->alt_ref_buffer.v_buffer; - dst1_16 = CONVERT_TO_SHORTPTR(dst1); - dst2_16 = CONVERT_TO_SHORTPTR(dst2); - stride = cpi->alt_ref_buffer.uv_stride; - byte = mb_uv_offset; - for (i = 0, k = 256; i < mb_uv_height; i++) { - for (j = 0; j < mb_uv_width; j++, k++) { - int m = k + 256; - - // U - unsigned int pval = accumulator[k] + (count[k] >> 1); - pval *= fixed_divide[count[k]]; - pval >>= 19; - dst1_16[byte] = (uint16_t)pval; - - // V - pval = accumulator[m] + (count[m] >> 1); - pval *= fixed_divide[count[m]]; - pval >>= 19; - dst2_16[byte] = (uint16_t)pval; - - // move to next pixel - byte++; - } - - byte += stride - mb_uv_width; - } - } else { - // Normalize filter output to produce AltRef frame - dst1 = cpi->alt_ref_buffer.y_buffer; - stride = cpi->alt_ref_buffer.y_stride; - byte = mb_y_offset; - for (i = 0, k = 0; i < 16; i++) { - for (j = 0; j < 16; j++, k++) { - unsigned int pval = accumulator[k] + (count[k] >> 1); - pval *= fixed_divide[count[k]]; - pval >>= 19; - - dst1[byte] = (uint8_t)pval; - - // move to next pixel - byte++; - } - byte += stride - 16; - } - - dst1 = cpi->alt_ref_buffer.u_buffer; - dst2 = cpi->alt_ref_buffer.v_buffer; - stride = cpi->alt_ref_buffer.uv_stride; - byte = mb_uv_offset; - for (i = 0, k = 256; i < mb_uv_height; i++) { - for (j = 0; j < mb_uv_width; j++, k++) { - int m = k + 256; - - // U - unsigned int pval = accumulator[k] + (count[k] >> 1); - pval *= fixed_divide[count[k]]; - pval >>= 19; - dst1[byte] = (uint8_t)pval; - - // V - pval = accumulator[m] + (count[m] >> 1); - pval *= fixed_divide[count[m]]; - pval >>= 19; - dst2[byte] = (uint8_t)pval; - - // move to next pixel - byte++; - } - byte += stride - mb_uv_width; - } - } -#else - // Normalize filter output to produce AltRef frame - dst1 = cpi->alt_ref_buffer.y_buffer; - stride = cpi->alt_ref_buffer.y_stride; - byte = mb_y_offset; - for (i = 0, k = 0; i < 16; i++) { - for (j = 0; j < 16; j++, k++) { - unsigned int pval = accumulator[k] + (count[k] >> 1); - pval *= fixed_divide[count[k]]; - pval >>= 19; - - dst1[byte] = (uint8_t)pval; - - // move to next pixel - byte++; - } - byte += stride - 16; - } - - dst1 = cpi->alt_ref_buffer.u_buffer; - dst2 = cpi->alt_ref_buffer.v_buffer; - stride = cpi->alt_ref_buffer.uv_stride; - byte = mb_uv_offset; - for (i = 0, k = 256; i < mb_uv_height; i++) { - for (j = 0; j < mb_uv_width; j++, k++) { - int m = k + 256; - - // U - unsigned int pval = accumulator[k] + (count[k] >> 1); - pval *= fixed_divide[count[k]]; - pval >>= 19; - dst1[byte] = (uint8_t)pval; - - // V - pval = accumulator[m] + (count[m] >> 1); - pval *= fixed_divide[count[m]]; - pval >>= 19; - dst2[byte] = (uint8_t)pval; - - // move to next pixel - byte++; - } - byte += stride - mb_uv_width; - } -#endif // CONFIG_VP9_HIGHBITDEPTH - mb_y_offset += 16; - mb_uv_offset += mb_uv_width; - } - mb_y_offset += 16 * (f->y_stride - mb_cols); - mb_uv_offset += mb_uv_height * f->uv_stride - mb_uv_width * mb_cols; - } - - // Restore input state - for (i = 0; i < MAX_MB_PLANE; i++) - mbd->plane[i].pre[0].buf = input_buffer[i]; -} - -// Apply buffer limits and context specific adjustments to arnr filter. -static void adjust_arnr_filter(VP9_COMP *cpi, - int distance, int group_boost, - int *arnr_frames, int *arnr_strength) { - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - const int frames_after_arf = - vp9_lookahead_depth(cpi->lookahead) - distance - 1; - int frames_fwd = (cpi->oxcf.arnr_max_frames - 1) >> 1; - int frames_bwd; - int q, frames, strength; - - // Define the forward and backwards filter limits for this arnr group. - if (frames_fwd > frames_after_arf) - frames_fwd = frames_after_arf; - if (frames_fwd > distance) - frames_fwd = distance; - - frames_bwd = frames_fwd; - - // For even length filter there is one more frame backward - // than forward: e.g. len=6 ==> bbbAff, len=7 ==> bbbAfff. - if (frames_bwd < distance) - frames_bwd += (oxcf->arnr_max_frames + 1) & 0x1; - - // Set the baseline active filter size. - frames = frames_bwd + 1 + frames_fwd; - - // Adjust the strength based on active max q. - if (cpi->common.current_video_frame > 1) - q = ((int)vp9_convert_qindex_to_q( - cpi->rc.avg_frame_qindex[INTER_FRAME], cpi->common.bit_depth)); - else - q = ((int)vp9_convert_qindex_to_q( - cpi->rc.avg_frame_qindex[KEY_FRAME], cpi->common.bit_depth)); - if (q > 16) { - strength = oxcf->arnr_strength; - } else { - strength = oxcf->arnr_strength - ((16 - q) / 2); - if (strength < 0) - strength = 0; - } - - // Adjust number of frames in filter and strength based on gf boost level. - if (frames > group_boost / 150) { - frames = group_boost / 150; - frames += !(frames & 1); - } - - if (strength > group_boost / 300) { - strength = group_boost / 300; - } - - // Adjustments for second level arf in multi arf case. - if (cpi->oxcf.pass == 2 && cpi->multi_arf_allowed) { - const GF_GROUP *const gf_group = &cpi->twopass.gf_group; - if (gf_group->rf_level[gf_group->index] != GF_ARF_STD) { - strength >>= 1; - } - } - - *arnr_frames = frames; - *arnr_strength = strength; -} - -void vp9_temporal_filter(VP9_COMP *cpi, int distance) { - VP9_COMMON *const cm = &cpi->common; - RATE_CONTROL *const rc = &cpi->rc; - MACROBLOCKD *const xd = &cpi->td.mb.e_mbd; - int frame; - int frames_to_blur; - int start_frame; - int strength; - int frames_to_blur_backward; - int frames_to_blur_forward; - struct scale_factors sf; - YV12_BUFFER_CONFIG *frames[MAX_LAG_BUFFERS] = {NULL}; - - // Apply context specific adjustments to the arnr filter parameters. - adjust_arnr_filter(cpi, distance, rc->gfu_boost, &frames_to_blur, &strength); - frames_to_blur_backward = (frames_to_blur / 2); - frames_to_blur_forward = ((frames_to_blur - 1) / 2); - start_frame = distance + frames_to_blur_forward; - - // Setup frame pointers, NULL indicates frame not included in filter. - for (frame = 0; frame < frames_to_blur; ++frame) { - const int which_buffer = start_frame - frame; - struct lookahead_entry *buf = vp9_lookahead_peek(cpi->lookahead, - which_buffer); - frames[frames_to_blur - 1 - frame] = &buf->img; - } - - if (frames_to_blur > 0) { - // Setup scaling factors. Scaling on each of the arnr frames is not - // supported. - if (is_two_pass_svc(cpi)) { - // In spatial svc the scaling factors might be less then 1/2. - // So we will use non-normative scaling. - int frame_used = 0; -#if CONFIG_VP9_HIGHBITDEPTH - vp9_setup_scale_factors_for_frame( - &sf, - get_frame_new_buffer(cm)->y_crop_width, - get_frame_new_buffer(cm)->y_crop_height, - get_frame_new_buffer(cm)->y_crop_width, - get_frame_new_buffer(cm)->y_crop_height, - cm->use_highbitdepth); -#else - vp9_setup_scale_factors_for_frame( - &sf, - get_frame_new_buffer(cm)->y_crop_width, - get_frame_new_buffer(cm)->y_crop_height, - get_frame_new_buffer(cm)->y_crop_width, - get_frame_new_buffer(cm)->y_crop_height); -#endif // CONFIG_VP9_HIGHBITDEPTH - - for (frame = 0; frame < frames_to_blur; ++frame) { - if (cm->mi_cols * MI_SIZE != frames[frame]->y_width || - cm->mi_rows * MI_SIZE != frames[frame]->y_height) { - if (vp9_realloc_frame_buffer(&cpi->svc.scaled_frames[frame_used], - cm->width, cm->height, - cm->subsampling_x, cm->subsampling_y, -#if CONFIG_VP9_HIGHBITDEPTH - cm->use_highbitdepth, -#endif - VP9_ENC_BORDER_IN_PIXELS, - cm->byte_alignment, - NULL, NULL, NULL)) { - vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR, - "Failed to reallocate alt_ref_buffer"); - } - frames[frame] = vp9_scale_if_required( - cm, frames[frame], &cpi->svc.scaled_frames[frame_used]); - ++frame_used; - } - } - cm->mi = cm->mip + cm->mi_stride + 1; - xd->mi = cm->mi; - xd->mi[0].src_mi = &xd->mi[0]; - } else { - // ARF is produced at the native frame size and resized when coded. -#if CONFIG_VP9_HIGHBITDEPTH - vp9_setup_scale_factors_for_frame(&sf, - frames[0]->y_crop_width, - frames[0]->y_crop_height, - frames[0]->y_crop_width, - frames[0]->y_crop_height, - cm->use_highbitdepth); -#else - vp9_setup_scale_factors_for_frame(&sf, - frames[0]->y_crop_width, - frames[0]->y_crop_height, - frames[0]->y_crop_width, - frames[0]->y_crop_height); -#endif // CONFIG_VP9_HIGHBITDEPTH - } - } - - temporal_filter_iterate_c(cpi, frames, frames_to_blur, - frames_to_blur_backward, strength, &sf); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_temporal_filter.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_temporal_filter.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_temporal_filter.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_temporal_filter.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_TEMPORAL_FILTER_H_ -#define VP9_ENCODER_VP9_TEMPORAL_FILTER_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -void vp9_temporal_filter_init(); -void vp9_temporal_filter(VP9_COMP *cpi, int distance); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_TEMPORAL_FILTER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_tokenize.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_tokenize.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_tokenize.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_tokenize.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,649 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include -#include - -#include "vpx_mem/vpx_mem.h" - -#include "vp9/common/vp9_entropy.h" -#include "vp9/common/vp9_pred_common.h" -#include "vp9/common/vp9_seg_common.h" - -#include "vp9/encoder/vp9_cost.h" -#include "vp9/encoder/vp9_encoder.h" -#include "vp9/encoder/vp9_tokenize.h" - -static const TOKENVALUE dct_cat_lt_10_value_tokens[] = { - {9, 63}, {9, 61}, {9, 59}, {9, 57}, {9, 55}, {9, 53}, {9, 51}, {9, 49}, - {9, 47}, {9, 45}, {9, 43}, {9, 41}, {9, 39}, {9, 37}, {9, 35}, {9, 33}, - {9, 31}, {9, 29}, {9, 27}, {9, 25}, {9, 23}, {9, 21}, {9, 19}, {9, 17}, - {9, 15}, {9, 13}, {9, 11}, {9, 9}, {9, 7}, {9, 5}, {9, 3}, {9, 1}, - {8, 31}, {8, 29}, {8, 27}, {8, 25}, {8, 23}, {8, 21}, - {8, 19}, {8, 17}, {8, 15}, {8, 13}, {8, 11}, {8, 9}, - {8, 7}, {8, 5}, {8, 3}, {8, 1}, - {7, 15}, {7, 13}, {7, 11}, {7, 9}, {7, 7}, {7, 5}, {7, 3}, {7, 1}, - {6, 7}, {6, 5}, {6, 3}, {6, 1}, {5, 3}, {5, 1}, - {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 0}, - {1, 0}, {2, 0}, {3, 0}, {4, 0}, - {5, 0}, {5, 2}, {6, 0}, {6, 2}, {6, 4}, {6, 6}, - {7, 0}, {7, 2}, {7, 4}, {7, 6}, {7, 8}, {7, 10}, {7, 12}, {7, 14}, - {8, 0}, {8, 2}, {8, 4}, {8, 6}, {8, 8}, {8, 10}, {8, 12}, - {8, 14}, {8, 16}, {8, 18}, {8, 20}, {8, 22}, {8, 24}, - {8, 26}, {8, 28}, {8, 30}, {9, 0}, {9, 2}, - {9, 4}, {9, 6}, {9, 8}, {9, 10}, {9, 12}, {9, 14}, {9, 16}, - {9, 18}, {9, 20}, {9, 22}, {9, 24}, {9, 26}, {9, 28}, - {9, 30}, {9, 32}, {9, 34}, {9, 36}, {9, 38}, {9, 40}, - {9, 42}, {9, 44}, {9, 46}, {9, 48}, {9, 50}, {9, 52}, - {9, 54}, {9, 56}, {9, 58}, {9, 60}, {9, 62} -}; -const TOKENVALUE *vp9_dct_cat_lt_10_value_tokens = dct_cat_lt_10_value_tokens + - (sizeof(dct_cat_lt_10_value_tokens) / sizeof(*dct_cat_lt_10_value_tokens)) - / 2; - -// Array indices are identical to previously-existing CONTEXT_NODE indices -const vp9_tree_index vp9_coef_tree[TREE_SIZE(ENTROPY_TOKENS)] = { - -EOB_TOKEN, 2, // 0 = EOB - -ZERO_TOKEN, 4, // 1 = ZERO - -ONE_TOKEN, 6, // 2 = ONE - 8, 12, // 3 = LOW_VAL - -TWO_TOKEN, 10, // 4 = TWO - -THREE_TOKEN, -FOUR_TOKEN, // 5 = THREE - 14, 16, // 6 = HIGH_LOW - -CATEGORY1_TOKEN, -CATEGORY2_TOKEN, // 7 = CAT_ONE - 18, 20, // 8 = CAT_THREEFOUR - -CATEGORY3_TOKEN, -CATEGORY4_TOKEN, // 9 = CAT_THREE - -CATEGORY5_TOKEN, -CATEGORY6_TOKEN // 10 = CAT_FIVE -}; - -// Unconstrained Node Tree -const vp9_tree_index vp9_coef_con_tree[TREE_SIZE(ENTROPY_TOKENS)] = { - 2, 6, // 0 = LOW_VAL - -TWO_TOKEN, 4, // 1 = TWO - -THREE_TOKEN, -FOUR_TOKEN, // 2 = THREE - 8, 10, // 3 = HIGH_LOW - -CATEGORY1_TOKEN, -CATEGORY2_TOKEN, // 4 = CAT_ONE - 12, 14, // 5 = CAT_THREEFOUR - -CATEGORY3_TOKEN, -CATEGORY4_TOKEN, // 6 = CAT_THREE - -CATEGORY5_TOKEN, -CATEGORY6_TOKEN // 7 = CAT_FIVE -}; - -static const vp9_tree_index cat1[2] = {0, 0}; -static const vp9_tree_index cat2[4] = {2, 2, 0, 0}; -static const vp9_tree_index cat3[6] = {2, 2, 4, 4, 0, 0}; -static const vp9_tree_index cat4[8] = {2, 2, 4, 4, 6, 6, 0, 0}; -static const vp9_tree_index cat5[10] = {2, 2, 4, 4, 6, 6, 8, 8, 0, 0}; -static const vp9_tree_index cat6[28] = {2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, - 14, 14, 16, 16, 18, 18, 20, 20, 22, 22, 24, 24, 26, 26, 0, 0}; - -static const int16_t zero_cost[] = {0}; -static const int16_t one_cost[] = {255, 257}; -static const int16_t two_cost[] = {255, 257}; -static const int16_t three_cost[] = {255, 257}; -static const int16_t four_cost[] = {255, 257}; -static const int16_t cat1_cost[] = {429, 431, 616, 618}; -static const int16_t cat2_cost[] = {624, 626, 727, 729, 848, 850, 951, 953}; -static const int16_t cat3_cost[] = { - 820, 822, 893, 895, 940, 942, 1013, 1015, 1096, 1098, 1169, 1171, 1216, 1218, - 1289, 1291 -}; -static const int16_t cat4_cost[] = { - 1032, 1034, 1075, 1077, 1105, 1107, 1148, 1150, 1194, 1196, 1237, 1239, - 1267, 1269, 1310, 1312, 1328, 1330, 1371, 1373, 1401, 1403, 1444, 1446, - 1490, 1492, 1533, 1535, 1563, 1565, 1606, 1608 -}; -static const int16_t cat5_cost[] = { - 1269, 1271, 1283, 1285, 1306, 1308, 1320, - 1322, 1347, 1349, 1361, 1363, 1384, 1386, 1398, 1400, 1443, 1445, 1457, - 1459, 1480, 1482, 1494, 1496, 1521, 1523, 1535, 1537, 1558, 1560, 1572, - 1574, 1592, 1594, 1606, 1608, 1629, 1631, 1643, 1645, 1670, 1672, 1684, - 1686, 1707, 1709, 1721, 1723, 1766, 1768, 1780, 1782, 1803, 1805, 1817, - 1819, 1844, 1846, 1858, 1860, 1881, 1883, 1895, 1897 -}; -const int16_t vp9_cat6_low_cost[256] = { - 1638, 1640, 1646, 1648, 1652, 1654, 1660, 1662, - 1670, 1672, 1678, 1680, 1684, 1686, 1692, 1694, 1711, 1713, 1719, 1721, - 1725, 1727, 1733, 1735, 1743, 1745, 1751, 1753, 1757, 1759, 1765, 1767, - 1787, 1789, 1795, 1797, 1801, 1803, 1809, 1811, 1819, 1821, 1827, 1829, - 1833, 1835, 1841, 1843, 1860, 1862, 1868, 1870, 1874, 1876, 1882, 1884, - 1892, 1894, 1900, 1902, 1906, 1908, 1914, 1916, 1940, 1942, 1948, 1950, - 1954, 1956, 1962, 1964, 1972, 1974, 1980, 1982, 1986, 1988, 1994, 1996, - 2013, 2015, 2021, 2023, 2027, 2029, 2035, 2037, 2045, 2047, 2053, 2055, - 2059, 2061, 2067, 2069, 2089, 2091, 2097, 2099, 2103, 2105, 2111, 2113, - 2121, 2123, 2129, 2131, 2135, 2137, 2143, 2145, 2162, 2164, 2170, 2172, - 2176, 2178, 2184, 2186, 2194, 2196, 2202, 2204, 2208, 2210, 2216, 2218, - 2082, 2084, 2090, 2092, 2096, 2098, 2104, 2106, 2114, 2116, 2122, 2124, - 2128, 2130, 2136, 2138, 2155, 2157, 2163, 2165, 2169, 2171, 2177, 2179, - 2187, 2189, 2195, 2197, 2201, 2203, 2209, 2211, 2231, 2233, 2239, 2241, - 2245, 2247, 2253, 2255, 2263, 2265, 2271, 2273, 2277, 2279, 2285, 2287, - 2304, 2306, 2312, 2314, 2318, 2320, 2326, 2328, 2336, 2338, 2344, 2346, - 2350, 2352, 2358, 2360, 2384, 2386, 2392, 2394, 2398, 2400, 2406, 2408, - 2416, 2418, 2424, 2426, 2430, 2432, 2438, 2440, 2457, 2459, 2465, 2467, - 2471, 2473, 2479, 2481, 2489, 2491, 2497, 2499, 2503, 2505, 2511, 2513, - 2533, 2535, 2541, 2543, 2547, 2549, 2555, 2557, 2565, 2567, 2573, 2575, - 2579, 2581, 2587, 2589, 2606, 2608, 2614, 2616, 2620, 2622, 2628, 2630, - 2638, 2640, 2646, 2648, 2652, 2654, 2660, 2662 -}; -const int16_t vp9_cat6_high_cost[128] = { - 72, 892, 1183, 2003, 1448, 2268, 2559, 3379, - 1709, 2529, 2820, 3640, 3085, 3905, 4196, 5016, 2118, 2938, 3229, 4049, - 3494, 4314, 4605, 5425, 3755, 4575, 4866, 5686, 5131, 5951, 6242, 7062, - 2118, 2938, 3229, 4049, 3494, 4314, 4605, 5425, 3755, 4575, 4866, 5686, - 5131, 5951, 6242, 7062, 4164, 4984, 5275, 6095, 5540, 6360, 6651, 7471, - 5801, 6621, 6912, 7732, 7177, 7997, 8288, 9108, 2118, 2938, 3229, 4049, - 3494, 4314, 4605, 5425, 3755, 4575, 4866, 5686, 5131, 5951, 6242, 7062, - 4164, 4984, 5275, 6095, 5540, 6360, 6651, 7471, 5801, 6621, 6912, 7732, - 7177, 7997, 8288, 9108, 4164, 4984, 5275, 6095, 5540, 6360, 6651, 7471, - 5801, 6621, 6912, 7732, 7177, 7997, 8288, 9108, 6210, 7030, 7321, 8141, - 7586, 8406, 8697, 9517, 7847, 8667, 8958, 9778, 9223, 10043, 10334, 11154 -}; - -#if CONFIG_VP9_HIGHBITDEPTH -const int16_t vp9_cat6_high10_high_cost[512] = { - 74, 894, 1185, 2005, 1450, 2270, 2561, - 3381, 1711, 2531, 2822, 3642, 3087, 3907, 4198, 5018, 2120, 2940, 3231, - 4051, 3496, 4316, 4607, 5427, 3757, 4577, 4868, 5688, 5133, 5953, 6244, - 7064, 2120, 2940, 3231, 4051, 3496, 4316, 4607, 5427, 3757, 4577, 4868, - 5688, 5133, 5953, 6244, 7064, 4166, 4986, 5277, 6097, 5542, 6362, 6653, - 7473, 5803, 6623, 6914, 7734, 7179, 7999, 8290, 9110, 2120, 2940, 3231, - 4051, 3496, 4316, 4607, 5427, 3757, 4577, 4868, 5688, 5133, 5953, 6244, - 7064, 4166, 4986, 5277, 6097, 5542, 6362, 6653, 7473, 5803, 6623, 6914, - 7734, 7179, 7999, 8290, 9110, 4166, 4986, 5277, 6097, 5542, 6362, 6653, - 7473, 5803, 6623, 6914, 7734, 7179, 7999, 8290, 9110, 6212, 7032, 7323, - 8143, 7588, 8408, 8699, 9519, 7849, 8669, 8960, 9780, 9225, 10045, 10336, - 11156, 2120, 2940, 3231, 4051, 3496, 4316, 4607, 5427, 3757, 4577, 4868, - 5688, 5133, 5953, 6244, 7064, 4166, 4986, 5277, 6097, 5542, 6362, 6653, - 7473, 5803, 6623, 6914, 7734, 7179, 7999, 8290, 9110, 4166, 4986, 5277, - 6097, 5542, 6362, 6653, 7473, 5803, 6623, 6914, 7734, 7179, 7999, 8290, - 9110, 6212, 7032, 7323, 8143, 7588, 8408, 8699, 9519, 7849, 8669, 8960, - 9780, 9225, 10045, 10336, 11156, 4166, 4986, 5277, 6097, 5542, 6362, 6653, - 7473, 5803, 6623, 6914, 7734, 7179, 7999, 8290, 9110, 6212, 7032, 7323, - 8143, 7588, 8408, 8699, 9519, 7849, 8669, 8960, 9780, 9225, 10045, 10336, - 11156, 6212, 7032, 7323, 8143, 7588, 8408, 8699, 9519, 7849, 8669, 8960, - 9780, 9225, 10045, 10336, 11156, 8258, 9078, 9369, 10189, 9634, 10454, - 10745, 11565, 9895, 10715, 11006, 11826, 11271, 12091, 12382, 13202, 2120, - 2940, 3231, 4051, 3496, 4316, 4607, 5427, 3757, 4577, 4868, 5688, 5133, - 5953, 6244, 7064, 4166, 4986, 5277, 6097, 5542, 6362, 6653, 7473, 5803, - 6623, 6914, 7734, 7179, 7999, 8290, 9110, 4166, 4986, 5277, 6097, 5542, - 6362, 6653, 7473, 5803, 6623, 6914, 7734, 7179, 7999, 8290, 9110, 6212, - 7032, 7323, 8143, 7588, 8408, 8699, 9519, 7849, 8669, 8960, 9780, 9225, - 10045, 10336, 11156, 4166, 4986, 5277, 6097, 5542, 6362, 6653, 7473, 5803, - 6623, 6914, 7734, 7179, 7999, 8290, 9110, 6212, 7032, 7323, 8143, 7588, - 8408, 8699, 9519, 7849, 8669, 8960, 9780, 9225, 10045, 10336, 11156, 6212, - 7032, 7323, 8143, 7588, 8408, 8699, 9519, 7849, 8669, 8960, 9780, 9225, - 10045, 10336, 11156, 8258, 9078, 9369, 10189, 9634, 10454, 10745, 11565, - 9895, 10715, 11006, 11826, 11271, 12091, 12382, 13202, 4166, 4986, 5277, - 6097, 5542, 6362, 6653, 7473, 5803, 6623, 6914, 7734, 7179, 7999, 8290, - 9110, 6212, 7032, 7323, 8143, 7588, 8408, 8699, 9519, 7849, 8669, 8960, - 9780, 9225, 10045, 10336, 11156, 6212, 7032, 7323, 8143, 7588, 8408, 8699, - 9519, 7849, 8669, 8960, 9780, 9225, 10045, 10336, 11156, 8258, 9078, 9369, - 10189, 9634, 10454, 10745, 11565, 9895, 10715, 11006, 11826, 11271, 12091, - 12382, 13202, 6212, 7032, 7323, 8143, 7588, 8408, 8699, 9519, 7849, 8669, - 8960, 9780, 9225, 10045, 10336, 11156, 8258, 9078, 9369, 10189, 9634, 10454, - 10745, 11565, 9895, 10715, 11006, 11826, 11271, 12091, 12382, 13202, 8258, - 9078, 9369, 10189, 9634, 10454, 10745, 11565, 9895, 10715, 11006, 11826, - 11271, 12091, 12382, 13202, 10304, 11124, 11415, 12235, 11680, 12500, 12791, - 13611, 11941, 12761, 13052, 13872, 13317, 14137, 14428, 15248, -}; -const int16_t vp9_cat6_high12_high_cost[2048] = { - 76, 896, 1187, 2007, 1452, 2272, 2563, - 3383, 1713, 2533, 2824, 3644, 3089, 3909, 4200, 5020, 2122, 2942, 3233, - 4053, 3498, 4318, 4609, 5429, 3759, 4579, 4870, 5690, 5135, 5955, 6246, - 7066, 2122, 2942, 3233, 4053, 3498, 4318, 4609, 5429, 3759, 4579, 4870, - 5690, 5135, 5955, 6246, 7066, 4168, 4988, 5279, 6099, 5544, 6364, 6655, - 7475, 5805, 6625, 6916, 7736, 7181, 8001, 8292, 9112, 2122, 2942, 3233, - 4053, 3498, 4318, 4609, 5429, 3759, 4579, 4870, 5690, 5135, 5955, 6246, - 7066, 4168, 4988, 5279, 6099, 5544, 6364, 6655, 7475, 5805, 6625, 6916, - 7736, 7181, 8001, 8292, 9112, 4168, 4988, 5279, 6099, 5544, 6364, 6655, - 7475, 5805, 6625, 6916, 7736, 7181, 8001, 8292, 9112, 6214, 7034, 7325, - 8145, 7590, 8410, 8701, 9521, 7851, 8671, 8962, 9782, 9227, 10047, 10338, - 11158, 2122, 2942, 3233, 4053, 3498, 4318, 4609, 5429, 3759, 4579, 4870, - 5690, 5135, 5955, 6246, 7066, 4168, 4988, 5279, 6099, 5544, 6364, 6655, - 7475, 5805, 6625, 6916, 7736, 7181, 8001, 8292, 9112, 4168, 4988, 5279, - 6099, 5544, 6364, 6655, 7475, 5805, 6625, 6916, 7736, 7181, 8001, 8292, - 9112, 6214, 7034, 7325, 8145, 7590, 8410, 8701, 9521, 7851, 8671, 8962, - 9782, 9227, 10047, 10338, 11158, 4168, 4988, 5279, 6099, 5544, 6364, 6655, - 7475, 5805, 6625, 6916, 7736, 7181, 8001, 8292, 9112, 6214, 7034, 7325, - 8145, 7590, 8410, 8701, 9521, 7851, 8671, 8962, 9782, 9227, 10047, 10338, - 11158, 6214, 7034, 7325, 8145, 7590, 8410, 8701, 9521, 7851, 8671, 8962, - 9782, 9227, 10047, 10338, 11158, 8260, 9080, 9371, 10191, 9636, 10456, - 10747, 11567, 9897, 10717, 11008, 11828, 11273, 12093, 12384, 13204, 2122, - 2942, 3233, 4053, 3498, 4318, 4609, 5429, 3759, 4579, 4870, 5690, 5135, - 5955, 6246, 7066, 4168, 4988, 5279, 6099, 5544, 6364, 6655, 7475, 5805, - 6625, 6916, 7736, 7181, 8001, 8292, 9112, 4168, 4988, 5279, 6099, 5544, - 6364, 6655, 7475, 5805, 6625, 6916, 7736, 7181, 8001, 8292, 9112, 6214, - 7034, 7325, 8145, 7590, 8410, 8701, 9521, 7851, 8671, 8962, 9782, 9227, - 10047, 10338, 11158, 4168, 4988, 5279, 6099, 5544, 6364, 6655, 7475, 5805, - 6625, 6916, 7736, 7181, 8001, 8292, 9112, 6214, 7034, 7325, 8145, 7590, - 8410, 8701, 9521, 7851, 8671, 8962, 9782, 9227, 10047, 10338, 11158, 6214, - 7034, 7325, 8145, 7590, 8410, 8701, 9521, 7851, 8671, 8962, 9782, 9227, - 10047, 10338, 11158, 8260, 9080, 9371, 10191, 9636, 10456, 10747, 11567, - 9897, 10717, 11008, 11828, 11273, 12093, 12384, 13204, 4168, 4988, 5279, - 6099, 5544, 6364, 6655, 7475, 5805, 6625, 6916, 7736, 7181, 8001, 8292, - 9112, 6214, 7034, 7325, 8145, 7590, 8410, 8701, 9521, 7851, 8671, 8962, - 9782, 9227, 10047, 10338, 11158, 6214, 7034, 7325, 8145, 7590, 8410, 8701, - 9521, 7851, 8671, 8962, 9782, 9227, 10047, 10338, 11158, 8260, 9080, 9371, - 10191, 9636, 10456, 10747, 11567, 9897, 10717, 11008, 11828, 11273, 12093, - 12384, 13204, 6214, 7034, 7325, 8145, 7590, 8410, 8701, 9521, 7851, 8671, - 8962, 9782, 9227, 10047, 10338, 11158, 8260, 9080, 9371, 10191, 9636, 10456, - 10747, 11567, 9897, 10717, 11008, 11828, 11273, 12093, 12384, 13204, 8260, - 9080, 9371, 10191, 9636, 10456, 10747, 11567, 9897, 10717, 11008, 11828, - 11273, 12093, 12384, 13204, 10306, 11126, 11417, 12237, 11682, 12502, 12793, - 13613, 11943, 12763, 13054, 13874, 13319, 14139, 14430, 15250, 2122, 2942, - 3233, 4053, 3498, 4318, 4609, 5429, 3759, 4579, 4870, 5690, 5135, 5955, - 6246, 7066, 4168, 4988, 5279, 6099, 5544, 6364, 6655, 7475, 5805, 6625, - 6916, 7736, 7181, 8001, 8292, 9112, 4168, 4988, 5279, 6099, 5544, 6364, - 6655, 7475, 5805, 6625, 6916, 7736, 7181, 8001, 8292, 9112, 6214, 7034, - 7325, 8145, 7590, 8410, 8701, 9521, 7851, 8671, 8962, 9782, 9227, 10047, - 10338, 11158, 4168, 4988, 5279, 6099, 5544, 6364, 6655, 7475, 5805, 6625, - 6916, 7736, 7181, 8001, 8292, 9112, 6214, 7034, 7325, 8145, 7590, 8410, - 8701, 9521, 7851, 8671, 8962, 9782, 9227, 10047, 10338, 11158, 6214, 7034, - 7325, 8145, 7590, 8410, 8701, 9521, 7851, 8671, 8962, 9782, 9227, 10047, - 10338, 11158, 8260, 9080, 9371, 10191, 9636, 10456, 10747, 11567, 9897, - 10717, 11008, 11828, 11273, 12093, 12384, 13204, 4168, 4988, 5279, 6099, - 5544, 6364, 6655, 7475, 5805, 6625, 6916, 7736, 7181, 8001, 8292, 9112, - 6214, 7034, 7325, 8145, 7590, 8410, 8701, 9521, 7851, 8671, 8962, 9782, - 9227, 10047, 10338, 11158, 6214, 7034, 7325, 8145, 7590, 8410, 8701, 9521, - 7851, 8671, 8962, 9782, 9227, 10047, 10338, 11158, 8260, 9080, 9371, 10191, - 9636, 10456, 10747, 11567, 9897, 10717, 11008, 11828, 11273, 12093, 12384, - 13204, 6214, 7034, 7325, 8145, 7590, 8410, 8701, 9521, 7851, 8671, 8962, - 9782, 9227, 10047, 10338, 11158, 8260, 9080, 9371, 10191, 9636, 10456, - 10747, 11567, 9897, 10717, 11008, 11828, 11273, 12093, 12384, 13204, 8260, - 9080, 9371, 10191, 9636, 10456, 10747, 11567, 9897, 10717, 11008, 11828, - 11273, 12093, 12384, 13204, 10306, 11126, 11417, 12237, 11682, 12502, 12793, - 13613, 11943, 12763, 13054, 13874, 13319, 14139, 14430, 15250, 4168, 4988, - 5279, 6099, 5544, 6364, 6655, 7475, 5805, 6625, 6916, 7736, 7181, 8001, - 8292, 9112, 6214, 7034, 7325, 8145, 7590, 8410, 8701, 9521, 7851, 8671, - 8962, 9782, 9227, 10047, 10338, 11158, 6214, 7034, 7325, 8145, 7590, 8410, - 8701, 9521, 7851, 8671, 8962, 9782, 9227, 10047, 10338, 11158, 8260, 9080, - 9371, 10191, 9636, 10456, 10747, 11567, 9897, 10717, 11008, 11828, 11273, - 12093, 12384, 13204, 6214, 7034, 7325, 8145, 7590, 8410, 8701, 9521, 7851, - 8671, 8962, 9782, 9227, 10047, 10338, 11158, 8260, 9080, 9371, 10191, 9636, - 10456, 10747, 11567, 9897, 10717, 11008, 11828, 11273, 12093, 12384, 13204, - 8260, 9080, 9371, 10191, 9636, 10456, 10747, 11567, 9897, 10717, 11008, - 11828, 11273, 12093, 12384, 13204, 10306, 11126, 11417, 12237, 11682, 12502, - 12793, 13613, 11943, 12763, 13054, 13874, 13319, 14139, 14430, 15250, 6214, - 7034, 7325, 8145, 7590, 8410, 8701, 9521, 7851, 8671, 8962, 9782, 9227, - 10047, 10338, 11158, 8260, 9080, 9371, 10191, 9636, 10456, 10747, 11567, - 9897, 10717, 11008, 11828, 11273, 12093, 12384, 13204, 8260, 9080, 9371, - 10191, 9636, 10456, 10747, 11567, 9897, 10717, 11008, 11828, 11273, 12093, - 12384, 13204, 10306, 11126, 11417, 12237, 11682, 12502, 12793, 13613, 11943, - 12763, 13054, 13874, 13319, 14139, 14430, 15250, 8260, 9080, 9371, 10191, - 9636, 10456, 10747, 11567, 9897, 10717, 11008, 11828, 11273, 12093, 12384, - 13204, 10306, 11126, 11417, 12237, 11682, 12502, 12793, 13613, 11943, 12763, - 13054, 13874, 13319, 14139, 14430, 15250, 10306, 11126, 11417, 12237, 11682, - 12502, 12793, 13613, 11943, 12763, 13054, 13874, 13319, 14139, 14430, 15250, - 12352, 13172, 13463, 14283, 13728, 14548, 14839, 15659, 13989, 14809, 15100, - 15920, 15365, 16185, 16476, 17296, 2122, 2942, 3233, 4053, 3498, 4318, 4609, - 5429, 3759, 4579, 4870, 5690, 5135, 5955, 6246, 7066, 4168, 4988, 5279, - 6099, 5544, 6364, 6655, 7475, 5805, 6625, 6916, 7736, 7181, 8001, 8292, - 9112, 4168, 4988, 5279, 6099, 5544, 6364, 6655, 7475, 5805, 6625, 6916, - 7736, 7181, 8001, 8292, 9112, 6214, 7034, 7325, 8145, 7590, 8410, 8701, - 9521, 7851, 8671, 8962, 9782, 9227, 10047, 10338, 11158, 4168, 4988, 5279, - 6099, 5544, 6364, 6655, 7475, 5805, 6625, 6916, 7736, 7181, 8001, 8292, - 9112, 6214, 7034, 7325, 8145, 7590, 8410, 8701, 9521, 7851, 8671, 8962, - 9782, 9227, 10047, 10338, 11158, 6214, 7034, 7325, 8145, 7590, 8410, 8701, - 9521, 7851, 8671, 8962, 9782, 9227, 10047, 10338, 11158, 8260, 9080, 9371, - 10191, 9636, 10456, 10747, 11567, 9897, 10717, 11008, 11828, 11273, 12093, - 12384, 13204, 4168, 4988, 5279, 6099, 5544, 6364, 6655, 7475, 5805, 6625, - 6916, 7736, 7181, 8001, 8292, 9112, 6214, 7034, 7325, 8145, 7590, 8410, - 8701, 9521, 7851, 8671, 8962, 9782, 9227, 10047, 10338, 11158, 6214, 7034, - 7325, 8145, 7590, 8410, 8701, 9521, 7851, 8671, 8962, 9782, 9227, 10047, - 10338, 11158, 8260, 9080, 9371, 10191, 9636, 10456, 10747, 11567, 9897, - 10717, 11008, 11828, 11273, 12093, 12384, 13204, 6214, 7034, 7325, 8145, - 7590, 8410, 8701, 9521, 7851, 8671, 8962, 9782, 9227, 10047, 10338, 11158, - 8260, 9080, 9371, 10191, 9636, 10456, 10747, 11567, 9897, 10717, 11008, - 11828, 11273, 12093, 12384, 13204, 8260, 9080, 9371, 10191, 9636, 10456, - 10747, 11567, 9897, 10717, 11008, 11828, 11273, 12093, 12384, 13204, 10306, - 11126, 11417, 12237, 11682, 12502, 12793, 13613, 11943, 12763, 13054, 13874, - 13319, 14139, 14430, 15250, 4168, 4988, 5279, 6099, 5544, 6364, 6655, 7475, - 5805, 6625, 6916, 7736, 7181, 8001, 8292, 9112, 6214, 7034, 7325, 8145, - 7590, 8410, 8701, 9521, 7851, 8671, 8962, 9782, 9227, 10047, 10338, 11158, - 6214, 7034, 7325, 8145, 7590, 8410, 8701, 9521, 7851, 8671, 8962, 9782, - 9227, 10047, 10338, 11158, 8260, 9080, 9371, 10191, 9636, 10456, 10747, - 11567, 9897, 10717, 11008, 11828, 11273, 12093, 12384, 13204, 6214, 7034, - 7325, 8145, 7590, 8410, 8701, 9521, 7851, 8671, 8962, 9782, 9227, 10047, - 10338, 11158, 8260, 9080, 9371, 10191, 9636, 10456, 10747, 11567, 9897, - 10717, 11008, 11828, 11273, 12093, 12384, 13204, 8260, 9080, 9371, 10191, - 9636, 10456, 10747, 11567, 9897, 10717, 11008, 11828, 11273, 12093, 12384, - 13204, 10306, 11126, 11417, 12237, 11682, 12502, 12793, 13613, 11943, 12763, - 13054, 13874, 13319, 14139, 14430, 15250, 6214, 7034, 7325, 8145, 7590, - 8410, 8701, 9521, 7851, 8671, 8962, 9782, 9227, 10047, 10338, 11158, 8260, - 9080, 9371, 10191, 9636, 10456, 10747, 11567, 9897, 10717, 11008, 11828, - 11273, 12093, 12384, 13204, 8260, 9080, 9371, 10191, 9636, 10456, 10747, - 11567, 9897, 10717, 11008, 11828, 11273, 12093, 12384, 13204, 10306, 11126, - 11417, 12237, 11682, 12502, 12793, 13613, 11943, 12763, 13054, 13874, 13319, - 14139, 14430, 15250, 8260, 9080, 9371, 10191, 9636, 10456, 10747, 11567, - 9897, 10717, 11008, 11828, 11273, 12093, 12384, 13204, 10306, 11126, 11417, - 12237, 11682, 12502, 12793, 13613, 11943, 12763, 13054, 13874, 13319, 14139, - 14430, 15250, 10306, 11126, 11417, 12237, 11682, 12502, 12793, 13613, 11943, - 12763, 13054, 13874, 13319, 14139, 14430, 15250, 12352, 13172, 13463, 14283, - 13728, 14548, 14839, 15659, 13989, 14809, 15100, 15920, 15365, 16185, 16476, - 17296, 4168, 4988, 5279, 6099, 5544, 6364, 6655, 7475, 5805, 6625, 6916, - 7736, 7181, 8001, 8292, 9112, 6214, 7034, 7325, 8145, 7590, 8410, 8701, - 9521, 7851, 8671, 8962, 9782, 9227, 10047, 10338, 11158, 6214, 7034, 7325, - 8145, 7590, 8410, 8701, 9521, 7851, 8671, 8962, 9782, 9227, 10047, 10338, - 11158, 8260, 9080, 9371, 10191, 9636, 10456, 10747, 11567, 9897, 10717, - 11008, 11828, 11273, 12093, 12384, 13204, 6214, 7034, 7325, 8145, 7590, - 8410, 8701, 9521, 7851, 8671, 8962, 9782, 9227, 10047, 10338, 11158, 8260, - 9080, 9371, 10191, 9636, 10456, 10747, 11567, 9897, 10717, 11008, 11828, - 11273, 12093, 12384, 13204, 8260, 9080, 9371, 10191, 9636, 10456, 10747, - 11567, 9897, 10717, 11008, 11828, 11273, 12093, 12384, 13204, 10306, 11126, - 11417, 12237, 11682, 12502, 12793, 13613, 11943, 12763, 13054, 13874, 13319, - 14139, 14430, 15250, 6214, 7034, 7325, 8145, 7590, 8410, 8701, 9521, 7851, - 8671, 8962, 9782, 9227, 10047, 10338, 11158, 8260, 9080, 9371, 10191, 9636, - 10456, 10747, 11567, 9897, 10717, 11008, 11828, 11273, 12093, 12384, 13204, - 8260, 9080, 9371, 10191, 9636, 10456, 10747, 11567, 9897, 10717, 11008, - 11828, 11273, 12093, 12384, 13204, 10306, 11126, 11417, 12237, 11682, 12502, - 12793, 13613, 11943, 12763, 13054, 13874, 13319, 14139, 14430, 15250, 8260, - 9080, 9371, 10191, 9636, 10456, 10747, 11567, 9897, 10717, 11008, 11828, - 11273, 12093, 12384, 13204, 10306, 11126, 11417, 12237, 11682, 12502, 12793, - 13613, 11943, 12763, 13054, 13874, 13319, 14139, 14430, 15250, 10306, 11126, - 11417, 12237, 11682, 12502, 12793, 13613, 11943, 12763, 13054, 13874, 13319, - 14139, 14430, 15250, 12352, 13172, 13463, 14283, 13728, 14548, 14839, 15659, - 13989, 14809, 15100, 15920, 15365, 16185, 16476, 17296, 6214, 7034, 7325, - 8145, 7590, 8410, 8701, 9521, 7851, 8671, 8962, 9782, 9227, 10047, 10338, - 11158, 8260, 9080, 9371, 10191, 9636, 10456, 10747, 11567, 9897, 10717, - 11008, 11828, 11273, 12093, 12384, 13204, 8260, 9080, 9371, 10191, 9636, - 10456, 10747, 11567, 9897, 10717, 11008, 11828, 11273, 12093, 12384, 13204, - 10306, 11126, 11417, 12237, 11682, 12502, 12793, 13613, 11943, 12763, 13054, - 13874, 13319, 14139, 14430, 15250, 8260, 9080, 9371, 10191, 9636, 10456, - 10747, 11567, 9897, 10717, 11008, 11828, 11273, 12093, 12384, 13204, 10306, - 11126, 11417, 12237, 11682, 12502, 12793, 13613, 11943, 12763, 13054, 13874, - 13319, 14139, 14430, 15250, 10306, 11126, 11417, 12237, 11682, 12502, 12793, - 13613, 11943, 12763, 13054, 13874, 13319, 14139, 14430, 15250, 12352, 13172, - 13463, 14283, 13728, 14548, 14839, 15659, 13989, 14809, 15100, 15920, 15365, - 16185, 16476, 17296, 8260, 9080, 9371, 10191, 9636, 10456, 10747, 11567, - 9897, 10717, 11008, 11828, 11273, 12093, 12384, 13204, 10306, 11126, 11417, - 12237, 11682, 12502, 12793, 13613, 11943, 12763, 13054, 13874, 13319, 14139, - 14430, 15250, 10306, 11126, 11417, 12237, 11682, 12502, 12793, 13613, 11943, - 12763, 13054, 13874, 13319, 14139, 14430, 15250, 12352, 13172, 13463, 14283, - 13728, 14548, 14839, 15659, 13989, 14809, 15100, 15920, 15365, 16185, 16476, - 17296, 10306, 11126, 11417, 12237, 11682, 12502, 12793, 13613, 11943, 12763, - 13054, 13874, 13319, 14139, 14430, 15250, 12352, 13172, 13463, 14283, 13728, - 14548, 14839, 15659, 13989, 14809, 15100, 15920, 15365, 16185, 16476, 17296, - 12352, 13172, 13463, 14283, 13728, 14548, 14839, 15659, 13989, 14809, 15100, - 15920, 15365, 16185, 16476, 17296, 14398, 15218, 15509, 16329, 15774, 16594, - 16885, 17705, 16035, 16855, 17146, 17966, 17411, 18231, 18522, 19342 -}; -#endif - -#if CONFIG_VP9_HIGHBITDEPTH -static const vp9_tree_index cat1_high10[2] = {0, 0}; -static const vp9_tree_index cat2_high10[4] = {2, 2, 0, 0}; -static const vp9_tree_index cat3_high10[6] = {2, 2, 4, 4, 0, 0}; -static const vp9_tree_index cat4_high10[8] = {2, 2, 4, 4, 6, 6, 0, 0}; -static const vp9_tree_index cat5_high10[10] = {2, 2, 4, 4, 6, 6, 8, 8, 0, 0}; -static const vp9_tree_index cat6_high10[32] = {2, 2, 4, 4, 6, 6, 8, 8, 10, 10, - 12, 12, 14, 14, 16, 16, 18, 18, 20, 20, 22, 22, 24, 24, 26, 26, 28, 28, - 30, 30, 0, 0}; -static const vp9_tree_index cat1_high12[2] = {0, 0}; -static const vp9_tree_index cat2_high12[4] = {2, 2, 0, 0}; -static const vp9_tree_index cat3_high12[6] = {2, 2, 4, 4, 0, 0}; -static const vp9_tree_index cat4_high12[8] = {2, 2, 4, 4, 6, 6, 0, 0}; -static const vp9_tree_index cat5_high12[10] = {2, 2, 4, 4, 6, 6, 8, 8, 0, 0}; -static const vp9_tree_index cat6_high12[36] = {2, 2, 4, 4, 6, 6, 8, 8, 10, 10, - 12, 12, 14, 14, 16, 16, 18, 18, 20, 20, 22, 22, 24, 24, 26, 26, 28, 28, - 30, 30, 32, 32, 34, 34, 0, 0}; -#endif - -const vp9_extra_bit vp9_extra_bits[ENTROPY_TOKENS] = { - {0, 0, 0, 0, zero_cost}, // ZERO_TOKEN - {0, 0, 0, 1, one_cost}, // ONE_TOKEN - {0, 0, 0, 2, two_cost}, // TWO_TOKEN - {0, 0, 0, 3, three_cost}, // THREE_TOKEN - {0, 0, 0, 4, four_cost}, // FOUR_TOKEN - {cat1, vp9_cat1_prob, 1, CAT1_MIN_VAL, cat1_cost}, // CATEGORY1_TOKEN - {cat2, vp9_cat2_prob, 2, CAT2_MIN_VAL, cat2_cost}, // CATEGORY2_TOKEN - {cat3, vp9_cat3_prob, 3, CAT3_MIN_VAL, cat3_cost}, // CATEGORY3_TOKEN - {cat4, vp9_cat4_prob, 4, CAT4_MIN_VAL, cat4_cost}, // CATEGORY4_TOKEN - {cat5, vp9_cat5_prob, 5, CAT5_MIN_VAL, cat5_cost}, // CATEGORY5_TOKEN - {cat6, vp9_cat6_prob, 14, CAT6_MIN_VAL, 0}, // CATEGORY6_TOKEN - {0, 0, 0, 0, zero_cost} // EOB_TOKEN -}; - -#if CONFIG_VP9_HIGHBITDEPTH -const vp9_extra_bit vp9_extra_bits_high10[ENTROPY_TOKENS] = { - {0, 0, 0, 0, zero_cost}, // ZERO - {0, 0, 0, 1, one_cost}, // ONE - {0, 0, 0, 2, two_cost}, // TWO - {0, 0, 0, 3, three_cost}, // THREE - {0, 0, 0, 4, four_cost}, // FOUR - {cat1_high10, vp9_cat1_prob_high10, 1, CAT1_MIN_VAL, cat1_cost}, // CAT1 - {cat2_high10, vp9_cat2_prob_high10, 2, CAT2_MIN_VAL, cat2_cost}, // CAT2 - {cat3_high10, vp9_cat3_prob_high10, 3, CAT3_MIN_VAL, cat3_cost}, // CAT3 - {cat4_high10, vp9_cat4_prob_high10, 4, CAT4_MIN_VAL, cat4_cost}, // CAT4 - {cat5_high10, vp9_cat5_prob_high10, 5, CAT5_MIN_VAL, cat5_cost}, // CAT5 - {cat6_high10, vp9_cat6_prob_high10, 16, CAT6_MIN_VAL, 0}, // CAT6 - {0, 0, 0, 0, zero_cost} // EOB -}; -const vp9_extra_bit vp9_extra_bits_high12[ENTROPY_TOKENS] = { - {0, 0, 0, 0, zero_cost}, // ZERO - {0, 0, 0, 1, one_cost}, // ONE - {0, 0, 0, 2, two_cost}, // TWO - {0, 0, 0, 3, three_cost}, // THREE - {0, 0, 0, 4, four_cost}, // FOUR - {cat1_high12, vp9_cat1_prob_high12, 1, CAT1_MIN_VAL, cat1_cost}, // CAT1 - {cat2_high12, vp9_cat2_prob_high12, 2, CAT2_MIN_VAL, cat2_cost}, // CAT2 - {cat3_high12, vp9_cat3_prob_high12, 3, CAT3_MIN_VAL, cat3_cost}, // CAT3 - {cat4_high12, vp9_cat4_prob_high12, 4, CAT4_MIN_VAL, cat4_cost}, // CAT4 - {cat5_high12, vp9_cat5_prob_high12, 5, CAT5_MIN_VAL, cat5_cost}, // CAT5 - {cat6_high12, vp9_cat6_prob_high12, 18, CAT6_MIN_VAL, 0}, // CAT6 - {0, 0, 0, 0, zero_cost} // EOB -}; -#endif - -const struct vp9_token vp9_coef_encodings[ENTROPY_TOKENS] = { - {2, 2}, {6, 3}, {28, 5}, {58, 6}, {59, 6}, {60, 6}, {61, 6}, {124, 7}, - {125, 7}, {126, 7}, {127, 7}, {0, 1} -}; - - -struct tokenize_b_args { - VP9_COMP *cpi; - ThreadData *td; - TOKENEXTRA **tp; -}; - -static void set_entropy_context_b(int plane, int block, BLOCK_SIZE plane_bsize, - TX_SIZE tx_size, void *arg) { - struct tokenize_b_args* const args = arg; - ThreadData *const td = args->td; - MACROBLOCK *const x = &td->mb; - MACROBLOCKD *const xd = &x->e_mbd; - struct macroblock_plane *p = &x->plane[plane]; - struct macroblockd_plane *pd = &xd->plane[plane]; - int aoff, loff; - txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &aoff, &loff); - vp9_set_contexts(xd, pd, plane_bsize, tx_size, p->eobs[block] > 0, - aoff, loff); -} - -static INLINE void add_token(TOKENEXTRA **t, const vp9_prob *context_tree, - int32_t extra, uint8_t token, - uint8_t skip_eob_node, - unsigned int *counts) { - (*t)->token = token; - (*t)->extra = extra; - (*t)->context_tree = context_tree; - (*t)->skip_eob_node = skip_eob_node; - (*t)++; - ++counts[token]; -} - -static INLINE void add_token_no_extra(TOKENEXTRA **t, - const vp9_prob *context_tree, - uint8_t token, - uint8_t skip_eob_node, - unsigned int *counts) { - (*t)->token = token; - (*t)->context_tree = context_tree; - (*t)->skip_eob_node = skip_eob_node; - (*t)++; - ++counts[token]; -} - -static INLINE int get_tx_eob(const struct segmentation *seg, int segment_id, - TX_SIZE tx_size) { - const int eob_max = 16 << (tx_size << 1); - return vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP) ? 0 : eob_max; -} - -static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize, - TX_SIZE tx_size, void *arg) { - struct tokenize_b_args* const args = arg; - VP9_COMP *cpi = args->cpi; - ThreadData *const td = args->td; - MACROBLOCK *const x = &td->mb; - MACROBLOCKD *const xd = &x->e_mbd; - TOKENEXTRA **tp = args->tp; - uint8_t token_cache[32 * 32]; - struct macroblock_plane *p = &x->plane[plane]; - struct macroblockd_plane *pd = &xd->plane[plane]; - MB_MODE_INFO *mbmi = &xd->mi[0].src_mi->mbmi; - int pt; /* near block/prev token context index */ - int c; - TOKENEXTRA *t = *tp; /* store tokens starting here */ - int eob = p->eobs[block]; - const PLANE_TYPE type = pd->plane_type; - const tran_low_t *qcoeff = BLOCK_OFFSET(p->qcoeff, block); - const int segment_id = mbmi->segment_id; - const int16_t *scan, *nb; - const scan_order *so; - const int ref = is_inter_block(mbmi); - unsigned int (*const counts)[COEFF_CONTEXTS][ENTROPY_TOKENS] = - td->rd_counts.coef_counts[tx_size][type][ref]; - vp9_prob (*const coef_probs)[COEFF_CONTEXTS][UNCONSTRAINED_NODES] = - cpi->common.fc->coef_probs[tx_size][type][ref]; - unsigned int (*const eob_branch)[COEFF_CONTEXTS] = - td->counts->eob_branch[tx_size][type][ref]; - const uint8_t *const band = get_band_translate(tx_size); - const int seg_eob = get_tx_eob(&cpi->common.seg, segment_id, tx_size); - int16_t token; - EXTRABIT extra; - int aoff, loff; - txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &aoff, &loff); - - pt = get_entropy_context(tx_size, pd->above_context + aoff, - pd->left_context + loff); - so = get_scan(xd, tx_size, type, block); - scan = so->scan; - nb = so->neighbors; - c = 0; - - while (c < eob) { - int v = 0; - int skip_eob = 0; - v = qcoeff[scan[c]]; - - while (!v) { - add_token_no_extra(&t, coef_probs[band[c]][pt], ZERO_TOKEN, skip_eob, - counts[band[c]][pt]); - eob_branch[band[c]][pt] += !skip_eob; - - skip_eob = 1; - token_cache[scan[c]] = 0; - ++c; - pt = get_coef_context(nb, token_cache, c); - v = qcoeff[scan[c]]; - } - - vp9_get_token_extra(v, &token, &extra); - - add_token(&t, coef_probs[band[c]][pt], extra, (uint8_t)token, - (uint8_t)skip_eob, counts[band[c]][pt]); - eob_branch[band[c]][pt] += !skip_eob; - - token_cache[scan[c]] = vp9_pt_energy_class[token]; - ++c; - pt = get_coef_context(nb, token_cache, c); - } - if (c < seg_eob) { - add_token_no_extra(&t, coef_probs[band[c]][pt], EOB_TOKEN, 0, - counts[band[c]][pt]); - ++eob_branch[band[c]][pt]; - } - - *tp = t; - - vp9_set_contexts(xd, pd, plane_bsize, tx_size, c > 0, aoff, loff); -} - -struct is_skippable_args { - MACROBLOCK *x; - int *skippable; -}; -static void is_skippable(int plane, int block, - BLOCK_SIZE plane_bsize, TX_SIZE tx_size, - void *argv) { - struct is_skippable_args *args = argv; - (void)plane_bsize; - (void)tx_size; - args->skippable[0] &= (!args->x->plane[plane].eobs[block]); -} - -// TODO(yaowu): rewrite and optimize this function to remove the usage of -// vp9_foreach_transform_block() and simplify is_skippable(). -int vp9_is_skippable_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) { - int result = 1; - struct is_skippable_args args = {x, &result}; - vp9_foreach_transformed_block_in_plane(&x->e_mbd, bsize, plane, is_skippable, - &args); - return result; -} - -static void has_high_freq_coeff(int plane, int block, - BLOCK_SIZE plane_bsize, TX_SIZE tx_size, - void *argv) { - struct is_skippable_args *args = argv; - int eobs = (tx_size == TX_4X4) ? 3 : 10; - (void) plane_bsize; - - *(args->skippable) |= (args->x->plane[plane].eobs[block] > eobs); -} - -int vp9_has_high_freq_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) { - int result = 0; - struct is_skippable_args args = {x, &result}; - vp9_foreach_transformed_block_in_plane(&x->e_mbd, bsize, plane, - has_high_freq_coeff, &args); - return result; -} - -void vp9_tokenize_sb(VP9_COMP *cpi, ThreadData *td, TOKENEXTRA **t, - int dry_run, BLOCK_SIZE bsize) { - VP9_COMMON *const cm = &cpi->common; - MACROBLOCK *const x = &td->mb; - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi; - TOKENEXTRA *t_backup = *t; - const int ctx = vp9_get_skip_context(xd); - const int skip_inc = !vp9_segfeature_active(&cm->seg, mbmi->segment_id, - SEG_LVL_SKIP); - struct tokenize_b_args arg = {cpi, td, t}; - if (mbmi->skip) { - if (!dry_run) - td->counts->skip[ctx][1] += skip_inc; - reset_skip_context(xd, bsize); - if (dry_run) - *t = t_backup; - return; - } - - if (!dry_run) { - td->counts->skip[ctx][0] += skip_inc; - vp9_foreach_transformed_block(xd, bsize, tokenize_b, &arg); - } else { - vp9_foreach_transformed_block(xd, bsize, set_entropy_context_b, &arg); - *t = t_backup; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_tokenize.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_tokenize.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_tokenize.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_tokenize.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_TOKENIZE_H_ -#define VP9_ENCODER_VP9_TOKENIZE_H_ - -#include "vp9/common/vp9_entropy.h" - -#include "vp9/encoder/vp9_block.h" -#include "vp9/encoder/vp9_treewriter.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define EOSB_TOKEN 127 // Not signalled, encoder only - -#if CONFIG_VP9_HIGHBITDEPTH - typedef int32_t EXTRABIT; -#else - typedef int16_t EXTRABIT; -#endif - - -typedef struct { - int16_t token; - EXTRABIT extra; -} TOKENVALUE; - -typedef struct { - const vp9_prob *context_tree; - EXTRABIT extra; - uint8_t token; - uint8_t skip_eob_node; -} TOKENEXTRA; - -extern const vp9_tree_index vp9_coef_tree[]; -extern const vp9_tree_index vp9_coef_con_tree[]; -extern const struct vp9_token vp9_coef_encodings[]; - -int vp9_is_skippable_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane); -int vp9_has_high_freq_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane); - -struct VP9_COMP; -struct ThreadData; - -void vp9_tokenize_sb(struct VP9_COMP *cpi, struct ThreadData *td, - TOKENEXTRA **t, int dry_run, BLOCK_SIZE bsize); - -extern const int16_t *vp9_dct_value_cost_ptr; -/* TODO: The Token field should be broken out into a separate char array to - * improve cache locality, since it's needed for costing when the rest of the - * fields are not. - */ -extern const TOKENVALUE *vp9_dct_value_tokens_ptr; -extern const TOKENVALUE *vp9_dct_cat_lt_10_value_tokens; -extern const int16_t vp9_cat6_low_cost[256]; -extern const int16_t vp9_cat6_high_cost[128]; -extern const int16_t vp9_cat6_high10_high_cost[512]; -extern const int16_t vp9_cat6_high12_high_cost[2048]; -static INLINE int16_t vp9_get_cost(int16_t token, EXTRABIT extrabits, - const int16_t *cat6_high_table) { - if (token != CATEGORY6_TOKEN) - return vp9_extra_bits[token].cost[extrabits]; - return vp9_cat6_low_cost[extrabits & 0xff] - + cat6_high_table[extrabits >> 8]; -} - -#if CONFIG_VP9_HIGHBITDEPTH -static INLINE const int16_t* vp9_get_high_cost_table(int bit_depth) { - return bit_depth == 8 ? vp9_cat6_high_cost - : (bit_depth == 10 ? vp9_cat6_high10_high_cost : - vp9_cat6_high12_high_cost); -} -#else -static INLINE const int16_t* vp9_get_high_cost_table(int bit_depth) { - (void) bit_depth; - return vp9_cat6_high_cost; -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -static INLINE void vp9_get_token_extra(int v, int16_t *token, EXTRABIT *extra) { - if (v >= CAT6_MIN_VAL || v <= -CAT6_MIN_VAL) { - *token = CATEGORY6_TOKEN; - if (v >= CAT6_MIN_VAL) - *extra = 2 * v - 2 * CAT6_MIN_VAL; - else - *extra = -2 * v - 2 * CAT6_MIN_VAL + 1; - return; - } - *token = vp9_dct_cat_lt_10_value_tokens[v].token; - *extra = vp9_dct_cat_lt_10_value_tokens[v].extra; -} -static INLINE int16_t vp9_get_token(int v) { - if (v >= CAT6_MIN_VAL || v <= -CAT6_MIN_VAL) - return 10; - return vp9_dct_cat_lt_10_value_tokens[v].token; -} - - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_TOKENIZE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_treewriter.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_treewriter.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_treewriter.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_treewriter.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "vp9/encoder/vp9_treewriter.h" - -static void tree2tok(struct vp9_token *tokens, const vp9_tree_index *tree, - int i, int v, int l) { - v += v; - ++l; - - do { - const vp9_tree_index j = tree[i++]; - if (j <= 0) { - tokens[-j].value = v; - tokens[-j].len = l; - } else { - tree2tok(tokens, tree, j, v, l); - } - } while (++v & 1); -} - -void vp9_tokens_from_tree(struct vp9_token *tokens, - const vp9_tree_index *tree) { - tree2tok(tokens, tree, 0, 0, 0); -} - -static unsigned int convert_distribution(unsigned int i, vp9_tree tree, - unsigned int branch_ct[][2], - const unsigned int num_events[]) { - unsigned int left, right; - - if (tree[i] <= 0) - left = num_events[-tree[i]]; - else - left = convert_distribution(tree[i], tree, branch_ct, num_events); - - if (tree[i + 1] <= 0) - right = num_events[-tree[i + 1]]; - else - right = convert_distribution(tree[i + 1], tree, branch_ct, num_events); - - branch_ct[i >> 1][0] = left; - branch_ct[i >> 1][1] = right; - return left + right; -} - -void vp9_tree_probs_from_distribution(vp9_tree tree, - unsigned int branch_ct[/* n-1 */][2], - const unsigned int num_events[/* n */]) { - convert_distribution(0, tree, branch_ct, num_events); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_treewriter.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_treewriter.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_treewriter.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_treewriter.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_TREEWRITER_H_ -#define VP9_ENCODER_VP9_TREEWRITER_H_ - -#include "vp9/encoder/vp9_writer.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void vp9_tree_probs_from_distribution(vp9_tree tree, - unsigned int branch_ct[ /* n - 1 */ ][2], - const unsigned int num_events[ /* n */ ]); - -struct vp9_token { - int value; - int len; -}; - -void vp9_tokens_from_tree(struct vp9_token*, const vp9_tree_index *); - -static INLINE void vp9_write_tree(vp9_writer *w, const vp9_tree_index *tree, - const vp9_prob *probs, int bits, int len, - vp9_tree_index i) { - do { - const int bit = (bits >> --len) & 1; - vp9_write(w, bit, probs[i >> 1]); - i = tree[i + bit]; - } while (len); -} - -static INLINE void vp9_write_token(vp9_writer *w, const vp9_tree_index *tree, - const vp9_prob *probs, - const struct vp9_token *token) { - vp9_write_tree(w, tree, probs, token->value, token->len, 0); -} - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_TREEWRITER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_variance.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_variance.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_variance.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_variance.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,651 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "./vp9_rtcd.h" - -#include "vpx_ports/mem.h" -#include "vpx/vpx_integer.h" - -#include "vp9/common/vp9_common.h" -#include "vp9/common/vp9_filter.h" - -#include "vp9/encoder/vp9_variance.h" - -void variance(const uint8_t *a, int a_stride, - const uint8_t *b, int b_stride, - int w, int h, unsigned int *sse, int *sum) { - int i, j; - - *sum = 0; - *sse = 0; - - for (i = 0; i < h; i++) { - for (j = 0; j < w; j++) { - const int diff = a[j] - b[j]; - *sum += diff; - *sse += diff * diff; - } - - a += a_stride; - b += b_stride; - } -} - -// Applies a 1-D 2-tap bi-linear filter to the source block in either horizontal -// or vertical direction to produce the filtered output block. Used to implement -// first-pass of 2-D separable filter. -// -// Produces int32_t output to retain precision for next pass. Two filter taps -// should sum to VP9_FILTER_WEIGHT. pixel_step defines whether the filter is -// applied horizontally (pixel_step=1) or vertically (pixel_step=stride). It -// defines the offset required to move from one input to the next. -static void var_filter_block2d_bil_first_pass(const uint8_t *src_ptr, - uint16_t *output_ptr, - unsigned int src_pixels_per_line, - int pixel_step, - unsigned int output_height, - unsigned int output_width, - const int16_t *vp9_filter) { - unsigned int i, j; - - for (i = 0; i < output_height; i++) { - for (j = 0; j < output_width; j++) { - output_ptr[j] = ROUND_POWER_OF_TWO((int)src_ptr[0] * vp9_filter[0] + - (int)src_ptr[pixel_step] * vp9_filter[1], - FILTER_BITS); - - src_ptr++; - } - - // Next row... - src_ptr += src_pixels_per_line - output_width; - output_ptr += output_width; - } -} - -// Applies a 1-D 2-tap bi-linear filter to the source block in either horizontal -// or vertical direction to produce the filtered output block. Used to implement -// second-pass of 2-D separable filter. -// -// Requires 32-bit input as produced by filter_block2d_bil_first_pass. Two -// filter taps should sum to VP9_FILTER_WEIGHT. pixel_step defines whether the -// filter is applied horizontally (pixel_step=1) or vertically (pixel_step= -// stride). It defines the offset required to move from one input to the next. -static void var_filter_block2d_bil_second_pass(const uint16_t *src_ptr, - uint8_t *output_ptr, - unsigned int src_pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const int16_t *vp9_filter) { - unsigned int i, j; - - for (i = 0; i < output_height; i++) { - for (j = 0; j < output_width; j++) { - output_ptr[j] = ROUND_POWER_OF_TWO((int)src_ptr[0] * vp9_filter[0] + - (int)src_ptr[pixel_step] * vp9_filter[1], - FILTER_BITS); - src_ptr++; - } - - src_ptr += src_pixels_per_line - output_width; - output_ptr += output_width; - } -} - -unsigned int vp9_get_mb_ss_c(const int16_t *src_ptr) { - unsigned int i, sum = 0; - - for (i = 0; i < 256; ++i) { - sum += src_ptr[i] * src_ptr[i]; - } - - return sum; -} - -#define VAR(W, H) \ -unsigned int vp9_variance##W##x##H##_c(const uint8_t *a, int a_stride, \ - const uint8_t *b, int b_stride, \ - unsigned int *sse) { \ - int sum; \ - variance(a, a_stride, b, b_stride, W, H, sse, &sum); \ - return *sse - (((int64_t)sum * sum) / (W * H)); \ -} - -#define SUBPIX_VAR(W, H) \ -unsigned int vp9_sub_pixel_variance##W##x##H##_c( \ - const uint8_t *src, int src_stride, \ - int xoffset, int yoffset, \ - const uint8_t *dst, int dst_stride, \ - unsigned int *sse) { \ - uint16_t fdata3[(H + 1) * W]; \ - uint8_t temp2[H * W]; \ -\ - var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, W, \ - BILINEAR_FILTERS_2TAP(xoffset)); \ - var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \ - BILINEAR_FILTERS_2TAP(yoffset)); \ -\ - return vp9_variance##W##x##H##_c(temp2, W, dst, dst_stride, sse); \ -} - -#define SUBPIX_AVG_VAR(W, H) \ -unsigned int vp9_sub_pixel_avg_variance##W##x##H##_c( \ - const uint8_t *src, int src_stride, \ - int xoffset, int yoffset, \ - const uint8_t *dst, int dst_stride, \ - unsigned int *sse, \ - const uint8_t *second_pred) { \ - uint16_t fdata3[(H + 1) * W]; \ - uint8_t temp2[H * W]; \ - DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, H * W); \ -\ - var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, W, \ - BILINEAR_FILTERS_2TAP(xoffset)); \ - var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \ - BILINEAR_FILTERS_2TAP(yoffset)); \ -\ - vp9_comp_avg_pred(temp3, second_pred, W, H, temp2, W); \ -\ - return vp9_variance##W##x##H##_c(temp3, W, dst, dst_stride, sse); \ -} - -void vp9_get16x16var_c(const uint8_t *src_ptr, int source_stride, - const uint8_t *ref_ptr, int ref_stride, - unsigned int *sse, int *sum) { - variance(src_ptr, source_stride, ref_ptr, ref_stride, 16, 16, sse, sum); -} - -void vp9_get8x8var_c(const uint8_t *src_ptr, int source_stride, - const uint8_t *ref_ptr, int ref_stride, - unsigned int *sse, int *sum) { - variance(src_ptr, source_stride, ref_ptr, ref_stride, 8, 8, sse, sum); -} - -unsigned int vp9_mse16x16_c(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - int sum; - variance(src, src_stride, ref, ref_stride, 16, 16, sse, &sum); - return *sse; -} - -unsigned int vp9_mse16x8_c(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - int sum; - variance(src, src_stride, ref, ref_stride, 16, 8, sse, &sum); - return *sse; -} - -unsigned int vp9_mse8x16_c(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - int sum; - variance(src, src_stride, ref, ref_stride, 8, 16, sse, &sum); - return *sse; -} - -unsigned int vp9_mse8x8_c(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - int sum; - variance(src, src_stride, ref, ref_stride, 8, 8, sse, &sum); - return *sse; -} - -VAR(4, 4) -SUBPIX_VAR(4, 4) -SUBPIX_AVG_VAR(4, 4) - -VAR(4, 8) -SUBPIX_VAR(4, 8) -SUBPIX_AVG_VAR(4, 8) - -VAR(8, 4) -SUBPIX_VAR(8, 4) -SUBPIX_AVG_VAR(8, 4) - -VAR(8, 8) -SUBPIX_VAR(8, 8) -SUBPIX_AVG_VAR(8, 8) - -VAR(8, 16) -SUBPIX_VAR(8, 16) -SUBPIX_AVG_VAR(8, 16) - -VAR(16, 8) -SUBPIX_VAR(16, 8) -SUBPIX_AVG_VAR(16, 8) - -VAR(16, 16) -SUBPIX_VAR(16, 16) -SUBPIX_AVG_VAR(16, 16) - -VAR(16, 32) -SUBPIX_VAR(16, 32) -SUBPIX_AVG_VAR(16, 32) - -VAR(32, 16) -SUBPIX_VAR(32, 16) -SUBPIX_AVG_VAR(32, 16) - -VAR(32, 32) -SUBPIX_VAR(32, 32) -SUBPIX_AVG_VAR(32, 32) - -VAR(32, 64) -SUBPIX_VAR(32, 64) -SUBPIX_AVG_VAR(32, 64) - -VAR(64, 32) -SUBPIX_VAR(64, 32) -SUBPIX_AVG_VAR(64, 32) - -VAR(64, 64) -SUBPIX_VAR(64, 64) -SUBPIX_AVG_VAR(64, 64) - -void vp9_comp_avg_pred(uint8_t *comp_pred, const uint8_t *pred, int width, - int height, const uint8_t *ref, int ref_stride) { - int i, j; - - for (i = 0; i < height; i++) { - for (j = 0; j < width; j++) { - const int tmp = pred[j] + ref[j]; - comp_pred[j] = ROUND_POWER_OF_TWO(tmp, 1); - } - comp_pred += width; - pred += width; - ref += ref_stride; - } -} - -#if CONFIG_VP9_HIGHBITDEPTH -void highbd_variance64(const uint8_t *a8, int a_stride, - const uint8_t *b8, int b_stride, - int w, int h, uint64_t *sse, - uint64_t *sum) { - int i, j; - - uint16_t *a = CONVERT_TO_SHORTPTR(a8); - uint16_t *b = CONVERT_TO_SHORTPTR(b8); - *sum = 0; - *sse = 0; - - for (i = 0; i < h; i++) { - for (j = 0; j < w; j++) { - const int diff = a[j] - b[j]; - *sum += diff; - *sse += diff * diff; - } - a += a_stride; - b += b_stride; - } -} - -void highbd_variance(const uint8_t *a8, int a_stride, - const uint8_t *b8, int b_stride, - int w, int h, unsigned int *sse, - int *sum) { - uint64_t sse_long = 0; - uint64_t sum_long = 0; - highbd_variance64(a8, a_stride, b8, b_stride, w, h, &sse_long, &sum_long); - *sse = (unsigned int)sse_long; - *sum = (int)sum_long; -} - -void highbd_10_variance(const uint8_t *a8, int a_stride, - const uint8_t *b8, int b_stride, - int w, int h, unsigned int *sse, - int *sum) { - uint64_t sse_long = 0; - uint64_t sum_long = 0; - highbd_variance64(a8, a_stride, b8, b_stride, w, h, &sse_long, &sum_long); - *sum = (int)ROUND_POWER_OF_TWO(sum_long, 2); - *sse = (unsigned int)ROUND_POWER_OF_TWO(sse_long, 4); -} - -void highbd_12_variance(const uint8_t *a8, int a_stride, - const uint8_t *b8, int b_stride, - int w, int h, unsigned int *sse, - int *sum) { - uint64_t sse_long = 0; - uint64_t sum_long = 0; - highbd_variance64(a8, a_stride, b8, b_stride, w, h, &sse_long, &sum_long); - *sum = (int)ROUND_POWER_OF_TWO(sum_long, 4); - *sse = (unsigned int)ROUND_POWER_OF_TWO(sse_long, 8); -} - -static void highbd_var_filter_block2d_bil_first_pass( - const uint8_t *src_ptr8, - uint16_t *output_ptr, - unsigned int src_pixels_per_line, - int pixel_step, - unsigned int output_height, - unsigned int output_width, - const int16_t *vp9_filter) { - unsigned int i, j; - uint16_t *src_ptr = CONVERT_TO_SHORTPTR(src_ptr8); - for (i = 0; i < output_height; i++) { - for (j = 0; j < output_width; j++) { - output_ptr[j] = - ROUND_POWER_OF_TWO((int)src_ptr[0] * vp9_filter[0] + - (int)src_ptr[pixel_step] * vp9_filter[1], - FILTER_BITS); - - src_ptr++; - } - - // Next row... - src_ptr += src_pixels_per_line - output_width; - output_ptr += output_width; - } -} - -static void highbd_var_filter_block2d_bil_second_pass( - const uint16_t *src_ptr, - uint16_t *output_ptr, - unsigned int src_pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const int16_t *vp9_filter) { - unsigned int i, j; - - for (i = 0; i < output_height; i++) { - for (j = 0; j < output_width; j++) { - output_ptr[j] = - ROUND_POWER_OF_TWO((int)src_ptr[0] * vp9_filter[0] + - (int)src_ptr[pixel_step] * vp9_filter[1], - FILTER_BITS); - src_ptr++; - } - - src_ptr += src_pixels_per_line - output_width; - output_ptr += output_width; - } -} - -#define HIGHBD_VAR(W, H) \ -unsigned int vp9_highbd_variance##W##x##H##_c(const uint8_t *a, int a_stride, \ - const uint8_t *b, int b_stride, \ - unsigned int *sse) { \ - int sum; \ - highbd_variance(a, a_stride, b, b_stride, W, H, sse, &sum); \ - return *sse - (((int64_t)sum * sum) / (W * H)); \ -} \ -\ -unsigned int vp9_highbd_10_variance##W##x##H##_c(const uint8_t *a, \ - int a_stride, \ - const uint8_t *b, \ - int b_stride, \ - unsigned int *sse) { \ - int sum; \ - highbd_10_variance(a, a_stride, b, b_stride, W, H, sse, &sum); \ - return *sse - (((int64_t)sum * sum) / (W * H)); \ -} \ -\ -unsigned int vp9_highbd_12_variance##W##x##H##_c(const uint8_t *a, \ - int a_stride, \ - const uint8_t *b, \ - int b_stride, \ - unsigned int *sse) { \ - int sum; \ - highbd_12_variance(a, a_stride, b, b_stride, W, H, sse, &sum); \ - return *sse - (((int64_t)sum * sum) / (W * H)); \ -} - -#define HIGHBD_SUBPIX_VAR(W, H) \ -unsigned int vp9_highbd_sub_pixel_variance##W##x##H##_c( \ - const uint8_t *src, int src_stride, \ - int xoffset, int yoffset, \ - const uint8_t *dst, int dst_stride, \ - unsigned int *sse) { \ - uint16_t fdata3[(H + 1) * W]; \ - uint16_t temp2[H * W]; \ -\ - highbd_var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, \ - W, BILINEAR_FILTERS_2TAP(xoffset)); \ - highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \ - BILINEAR_FILTERS_2TAP(yoffset)); \ -\ - return vp9_highbd_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp2), W, dst, \ - dst_stride, sse); \ -} \ -\ -unsigned int vp9_highbd_10_sub_pixel_variance##W##x##H##_c( \ - const uint8_t *src, int src_stride, \ - int xoffset, int yoffset, \ - const uint8_t *dst, int dst_stride, \ - unsigned int *sse) { \ - uint16_t fdata3[(H + 1) * W]; \ - uint16_t temp2[H * W]; \ -\ - highbd_var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, \ - W, BILINEAR_FILTERS_2TAP(xoffset)); \ - highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \ - BILINEAR_FILTERS_2TAP(yoffset)); \ -\ - return vp9_highbd_10_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp2), \ - W, dst, dst_stride, sse); \ -} \ -\ -unsigned int vp9_highbd_12_sub_pixel_variance##W##x##H##_c( \ - const uint8_t *src, int src_stride, \ - int xoffset, int yoffset, \ - const uint8_t *dst, int dst_stride, \ - unsigned int *sse) { \ - uint16_t fdata3[(H + 1) * W]; \ - uint16_t temp2[H * W]; \ -\ - highbd_var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, \ - W, BILINEAR_FILTERS_2TAP(xoffset)); \ - highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \ - BILINEAR_FILTERS_2TAP(yoffset)); \ -\ - return vp9_highbd_12_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp2), \ - W, dst, dst_stride, sse); \ -} - -#define HIGHBD_SUBPIX_AVG_VAR(W, H) \ -unsigned int vp9_highbd_sub_pixel_avg_variance##W##x##H##_c( \ - const uint8_t *src, int src_stride, \ - int xoffset, int yoffset, \ - const uint8_t *dst, int dst_stride, \ - unsigned int *sse, \ - const uint8_t *second_pred) { \ - uint16_t fdata3[(H + 1) * W]; \ - uint16_t temp2[H * W]; \ - DECLARE_ALIGNED_ARRAY(16, uint16_t, temp3, H * W); \ -\ - highbd_var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, \ - W, BILINEAR_FILTERS_2TAP(xoffset)); \ - highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \ - BILINEAR_FILTERS_2TAP(yoffset)); \ -\ - vp9_highbd_comp_avg_pred(temp3, second_pred, W, H, \ - CONVERT_TO_BYTEPTR(temp2), W); \ -\ - return vp9_highbd_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp3), W, dst, \ - dst_stride, sse); \ -} \ -\ -unsigned int vp9_highbd_10_sub_pixel_avg_variance##W##x##H##_c( \ - const uint8_t *src, int src_stride, \ - int xoffset, int yoffset, \ - const uint8_t *dst, int dst_stride, \ - unsigned int *sse, \ - const uint8_t *second_pred) { \ - uint16_t fdata3[(H + 1) * W]; \ - uint16_t temp2[H * W]; \ - DECLARE_ALIGNED_ARRAY(16, uint16_t, temp3, H * W); \ -\ - highbd_var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, \ - W, BILINEAR_FILTERS_2TAP(xoffset)); \ - highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \ - BILINEAR_FILTERS_2TAP(yoffset)); \ -\ - vp9_highbd_comp_avg_pred(temp3, second_pred, W, H, \ - CONVERT_TO_BYTEPTR(temp2), W); \ -\ - return vp9_highbd_10_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp3), \ - W, dst, dst_stride, sse); \ -} \ -\ -unsigned int vp9_highbd_12_sub_pixel_avg_variance##W##x##H##_c( \ - const uint8_t *src, int src_stride, \ - int xoffset, int yoffset, \ - const uint8_t *dst, int dst_stride, \ - unsigned int *sse, \ - const uint8_t *second_pred) { \ - uint16_t fdata3[(H + 1) * W]; \ - uint16_t temp2[H * W]; \ - DECLARE_ALIGNED_ARRAY(16, uint16_t, temp3, H * W); \ -\ - highbd_var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, \ - W, BILINEAR_FILTERS_2TAP(xoffset)); \ - highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \ - BILINEAR_FILTERS_2TAP(yoffset)); \ -\ - vp9_highbd_comp_avg_pred(temp3, second_pred, W, H, \ - CONVERT_TO_BYTEPTR(temp2), W); \ -\ - return vp9_highbd_12_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp3), \ - W, dst, dst_stride, sse); \ -} - -#define HIGHBD_GET_VAR(S) \ -void vp9_highbd_get##S##x##S##var_c(const uint8_t *src, int src_stride, \ - const uint8_t *ref, int ref_stride, \ - unsigned int *sse, int *sum) { \ - highbd_variance(src, src_stride, ref, ref_stride, S, S, sse, sum); \ -} \ -\ -void vp9_highbd_10_get##S##x##S##var_c(const uint8_t *src, int src_stride, \ - const uint8_t *ref, int ref_stride, \ - unsigned int *sse, int *sum) { \ - highbd_10_variance(src, src_stride, ref, ref_stride, S, S, sse, sum); \ -} \ -\ -void vp9_highbd_12_get##S##x##S##var_c(const uint8_t *src, int src_stride, \ - const uint8_t *ref, int ref_stride, \ - unsigned int *sse, int *sum) { \ - highbd_12_variance(src, src_stride, ref, ref_stride, S, S, sse, sum); \ -} - -#define HIGHBD_MSE(W, H) \ -unsigned int vp9_highbd_mse##W##x##H##_c(const uint8_t *src, \ - int src_stride, \ - const uint8_t *ref, \ - int ref_stride, \ - unsigned int *sse) { \ - int sum; \ - highbd_variance(src, src_stride, ref, ref_stride, W, H, sse, &sum); \ - return *sse; \ -} \ -\ -unsigned int vp9_highbd_10_mse##W##x##H##_c(const uint8_t *src, \ - int src_stride, \ - const uint8_t *ref, \ - int ref_stride, \ - unsigned int *sse) { \ - int sum; \ - highbd_10_variance(src, src_stride, ref, ref_stride, W, H, sse, &sum); \ - return *sse; \ -} \ -\ -unsigned int vp9_highbd_12_mse##W##x##H##_c(const uint8_t *src, \ - int src_stride, \ - const uint8_t *ref, \ - int ref_stride, \ - unsigned int *sse) { \ - int sum; \ - highbd_12_variance(src, src_stride, ref, ref_stride, W, H, sse, &sum); \ - return *sse; \ -} - -HIGHBD_GET_VAR(8) -HIGHBD_GET_VAR(16) - -HIGHBD_MSE(16, 16) -HIGHBD_MSE(16, 8) -HIGHBD_MSE(8, 16) -HIGHBD_MSE(8, 8) - -HIGHBD_VAR(4, 4) -HIGHBD_SUBPIX_VAR(4, 4) -HIGHBD_SUBPIX_AVG_VAR(4, 4) - -HIGHBD_VAR(4, 8) -HIGHBD_SUBPIX_VAR(4, 8) -HIGHBD_SUBPIX_AVG_VAR(4, 8) - -HIGHBD_VAR(8, 4) -HIGHBD_SUBPIX_VAR(8, 4) -HIGHBD_SUBPIX_AVG_VAR(8, 4) - -HIGHBD_VAR(8, 8) -HIGHBD_SUBPIX_VAR(8, 8) -HIGHBD_SUBPIX_AVG_VAR(8, 8) - -HIGHBD_VAR(8, 16) -HIGHBD_SUBPIX_VAR(8, 16) -HIGHBD_SUBPIX_AVG_VAR(8, 16) - -HIGHBD_VAR(16, 8) -HIGHBD_SUBPIX_VAR(16, 8) -HIGHBD_SUBPIX_AVG_VAR(16, 8) - -HIGHBD_VAR(16, 16) -HIGHBD_SUBPIX_VAR(16, 16) -HIGHBD_SUBPIX_AVG_VAR(16, 16) - -HIGHBD_VAR(16, 32) -HIGHBD_SUBPIX_VAR(16, 32) -HIGHBD_SUBPIX_AVG_VAR(16, 32) - -HIGHBD_VAR(32, 16) -HIGHBD_SUBPIX_VAR(32, 16) -HIGHBD_SUBPIX_AVG_VAR(32, 16) - -HIGHBD_VAR(32, 32) -HIGHBD_SUBPIX_VAR(32, 32) -HIGHBD_SUBPIX_AVG_VAR(32, 32) - -HIGHBD_VAR(32, 64) -HIGHBD_SUBPIX_VAR(32, 64) -HIGHBD_SUBPIX_AVG_VAR(32, 64) - -HIGHBD_VAR(64, 32) -HIGHBD_SUBPIX_VAR(64, 32) -HIGHBD_SUBPIX_AVG_VAR(64, 32) - -HIGHBD_VAR(64, 64) -HIGHBD_SUBPIX_VAR(64, 64) -HIGHBD_SUBPIX_AVG_VAR(64, 64) - -void vp9_highbd_comp_avg_pred(uint16_t *comp_pred, const uint8_t *pred8, - int width, int height, const uint8_t *ref8, - int ref_stride) { - int i, j; - uint16_t *pred = CONVERT_TO_SHORTPTR(pred8); - uint16_t *ref = CONVERT_TO_SHORTPTR(ref8); - for (i = 0; i < height; i++) { - for (j = 0; j < width; j++) { - const int tmp = pred[j] + ref[j]; - comp_pred[j] = ROUND_POWER_OF_TWO(tmp, 1); - } - comp_pred += width; - pred += width; - ref += ref_stride; - } -} -#endif // CONFIG_VP9_HIGHBITDEPTH diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_variance.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_variance.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_variance.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_variance.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_VARIANCE_H_ -#define VP9_ENCODER_VP9_VARIANCE_H_ - -#include "vpx/vpx_integer.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void variance(const uint8_t *a, int a_stride, - const uint8_t *b, int b_stride, - int w, int h, - unsigned int *sse, int *sum); - -#if CONFIG_VP9_HIGHBITDEPTH -void highbd_variance(const uint8_t *a8, int a_stride, - const uint8_t *b8, int b_stride, - int w, int h, - unsigned int *sse, int *sum); - -void highbd_10_variance(const uint8_t *a8, int a_stride, - const uint8_t *b8, int b_stride, - int w, int h, - unsigned int *sse, int *sum); - -void highbd_12_variance(const uint8_t *a8, int a_stride, - const uint8_t *b8, int b_stride, - int w, int h, - unsigned int *sse, int *sum); -#endif - -typedef unsigned int(*vp9_sad_fn_t)(const uint8_t *src_ptr, - int source_stride, - const uint8_t *ref_ptr, - int ref_stride); - -typedef unsigned int(*vp9_sad_avg_fn_t)(const uint8_t *src_ptr, - int source_stride, - const uint8_t *ref_ptr, - int ref_stride, - const uint8_t *second_pred); - -typedef void (*vp9_sad_multi_fn_t)(const uint8_t *src_ptr, - int source_stride, - const uint8_t *ref_ptr, - int ref_stride, - unsigned int *sad_array); - -typedef void (*vp9_sad_multi_d_fn_t)(const uint8_t *src_ptr, - int source_stride, - const uint8_t* const ref_ptr[], - int ref_stride, unsigned int *sad_array); - -typedef unsigned int (*vp9_variance_fn_t)(const uint8_t *src_ptr, - int source_stride, - const uint8_t *ref_ptr, - int ref_stride, - unsigned int *sse); - -typedef unsigned int (*vp9_subpixvariance_fn_t)(const uint8_t *src_ptr, - int source_stride, - int xoffset, - int yoffset, - const uint8_t *ref_ptr, - int Refstride, - unsigned int *sse); - -typedef unsigned int (*vp9_subp_avg_variance_fn_t)(const uint8_t *src_ptr, - int source_stride, - int xoffset, - int yoffset, - const uint8_t *ref_ptr, - int Refstride, - unsigned int *sse, - const uint8_t *second_pred); - -typedef struct vp9_variance_vtable { - vp9_sad_fn_t sdf; - vp9_sad_avg_fn_t sdaf; - vp9_variance_fn_t vf; - vp9_subpixvariance_fn_t svf; - vp9_subp_avg_variance_fn_t svaf; - vp9_sad_multi_fn_t sdx3f; - vp9_sad_multi_fn_t sdx8f; - vp9_sad_multi_d_fn_t sdx4df; -} vp9_variance_fn_ptr_t; - -void vp9_comp_avg_pred(uint8_t *comp_pred, const uint8_t *pred, int width, - int height, const uint8_t *ref, int ref_stride); - -#if CONFIG_VP9_HIGHBITDEPTH -void vp9_highbd_comp_avg_pred(uint16_t *comp_pred, const uint8_t *pred, - int width, int height, - const uint8_t *ref, int ref_stride); -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_VARIANCE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_write_bit_buffer.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_write_bit_buffer.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_write_bit_buffer.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_write_bit_buffer.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "vp9/encoder/vp9_write_bit_buffer.h" - -size_t vp9_wb_bytes_written(const struct vp9_write_bit_buffer *wb) { - return wb->bit_offset / CHAR_BIT + (wb->bit_offset % CHAR_BIT > 0); -} - -void vp9_wb_write_bit(struct vp9_write_bit_buffer *wb, int bit) { - const int off = (int)wb->bit_offset; - const int p = off / CHAR_BIT; - const int q = CHAR_BIT - 1 - off % CHAR_BIT; - if (q == CHAR_BIT -1) { - wb->bit_buffer[p] = bit << q; - } else { - wb->bit_buffer[p] &= ~(1 << q); - wb->bit_buffer[p] |= bit << q; - } - wb->bit_offset = off + 1; -} - -void vp9_wb_write_literal(struct vp9_write_bit_buffer *wb, int data, int bits) { - int bit; - for (bit = bits - 1; bit >= 0; bit--) - vp9_wb_write_bit(wb, (data >> bit) & 1); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_write_bit_buffer.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_write_bit_buffer.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_write_bit_buffer.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_write_bit_buffer.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_WRITE_BIT_BUFFER_H_ -#define VP9_ENCODER_VP9_WRITE_BIT_BUFFER_H_ - -#include "vpx/vpx_integer.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct vp9_write_bit_buffer { - uint8_t *bit_buffer; - size_t bit_offset; -}; - -size_t vp9_wb_bytes_written(const struct vp9_write_bit_buffer *wb); - -void vp9_wb_write_bit(struct vp9_write_bit_buffer *wb, int bit); - -void vp9_wb_write_literal(struct vp9_write_bit_buffer *wb, int data, int bits); - - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_WRITE_BIT_BUFFER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_writer.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_writer.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_writer.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_writer.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "vp9/encoder/vp9_writer.h" -#include "vp9/common/vp9_entropy.h" - -void vp9_start_encode(vp9_writer *br, uint8_t *source) { - br->lowvalue = 0; - br->range = 255; - br->count = -24; - br->buffer = source; - br->pos = 0; - vp9_write_bit(br, 0); -} - -void vp9_stop_encode(vp9_writer *br) { - int i; - - for (i = 0; i < 32; i++) - vp9_write_bit(br, 0); - - // Ensure there's no ambigous collision with any index marker bytes - if ((br->buffer[br->pos - 1] & 0xe0) == 0xc0) - br->buffer[br->pos++] = 0; -} - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_writer.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_writer.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/vp9_writer.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/vp9_writer.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_VP9_WRITER_H_ -#define VP9_ENCODER_VP9_WRITER_H_ - -#include "vpx_ports/mem.h" - -#include "vp9/common/vp9_prob.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - unsigned int lowvalue; - unsigned int range; - int count; - unsigned int pos; - uint8_t *buffer; -} vp9_writer; - -void vp9_start_encode(vp9_writer *bc, uint8_t *buffer); -void vp9_stop_encode(vp9_writer *bc); - -static INLINE void vp9_write(vp9_writer *br, int bit, int probability) { - unsigned int split; - int count = br->count; - unsigned int range = br->range; - unsigned int lowvalue = br->lowvalue; - register unsigned int shift; - - split = 1 + (((range - 1) * probability) >> 8); - - range = split; - - if (bit) { - lowvalue += split; - range = br->range - split; - } - - shift = vp9_norm[range]; - - range <<= shift; - count += shift; - - if (count >= 0) { - int offset = shift - count; - - if ((lowvalue << (offset - 1)) & 0x80000000) { - int x = br->pos - 1; - - while (x >= 0 && br->buffer[x] == 0xff) { - br->buffer[x] = 0; - x--; - } - - br->buffer[x] += 1; - } - - br->buffer[br->pos++] = (lowvalue >> (24 - offset)); - lowvalue <<= offset; - shift = count; - lowvalue &= 0xffffff; - count -= 8; - } - - lowvalue <<= shift; - br->count = count; - br->lowvalue = lowvalue; - br->range = range; -} - -static INLINE void vp9_write_bit(vp9_writer *w, int bit) { - vp9_write(w, bit, 128); // vp9_prob_half -} - -static INLINE void vp9_write_literal(vp9_writer *w, int data, int bits) { - int bit; - - for (bit = bits - 1; bit >= 0; bit--) - vp9_write_bit(w, 1 & (data >> bit)); -} - -#define vp9_write_prob(w, v) vp9_write_literal((w), (v), 8) - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_VP9_WRITER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_avg_intrin_sse2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_avg_intrin_sse2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_avg_intrin_sse2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_avg_intrin_sse2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,171 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "vpx_ports/mem.h" - - -unsigned int vp9_avg_8x8_sse2(const uint8_t *s, int p) { - __m128i s0, s1, u0; - unsigned int avg = 0; - u0 = _mm_setzero_si128(); - s0 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s)), u0); - s1 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s + p)), u0); - s0 = _mm_adds_epu16(s0, s1); - s1 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s + 2 * p)), u0); - s0 = _mm_adds_epu16(s0, s1); - s1 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s + 3 * p)), u0); - s0 = _mm_adds_epu16(s0, s1); - s1 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s + 4 * p)), u0); - s0 = _mm_adds_epu16(s0, s1); - s1 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s + 5 * p)), u0); - s0 = _mm_adds_epu16(s0, s1); - s1 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s + 6 * p)), u0); - s0 = _mm_adds_epu16(s0, s1); - s1 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s + 7 * p)), u0); - s0 = _mm_adds_epu16(s0, s1); - - s0 = _mm_adds_epu16(s0, _mm_srli_si128(s0, 8)); - s0 = _mm_adds_epu16(s0, _mm_srli_epi64(s0, 32)); - s0 = _mm_adds_epu16(s0, _mm_srli_epi64(s0, 16)); - avg = _mm_extract_epi16(s0, 0); - return (avg + 32) >> 6; -} - -unsigned int vp9_avg_4x4_sse2(const uint8_t *s, int p) { - __m128i s0, s1, u0; - unsigned int avg = 0; - u0 = _mm_setzero_si128(); - s0 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s)), u0); - s1 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s + p)), u0); - s0 = _mm_adds_epu16(s0, s1); - s1 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s + 2 * p)), u0); - s0 = _mm_adds_epu16(s0, s1); - s1 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s + 3 * p)), u0); - s0 = _mm_adds_epu16(s0, s1); - - s0 = _mm_adds_epu16(s0, _mm_srli_si128(s0, 4)); - s0 = _mm_adds_epu16(s0, _mm_srli_epi64(s0, 16)); - avg = _mm_extract_epi16(s0, 0); - return (avg + 8) >> 4; -} - -void vp9_int_pro_row_sse2(int16_t *hbuf, uint8_t const*ref, - const int ref_stride, const int height) { - int idx; - __m128i zero = _mm_setzero_si128(); - __m128i src_line = _mm_loadu_si128((const __m128i *)ref); - __m128i s0 = _mm_unpacklo_epi8(src_line, zero); - __m128i s1 = _mm_unpackhi_epi8(src_line, zero); - __m128i t0, t1; - int height_1 = height - 1; - ref += ref_stride; - - for (idx = 1; idx < height_1; idx += 2) { - src_line = _mm_loadu_si128((const __m128i *)ref); - t0 = _mm_unpacklo_epi8(src_line, zero); - t1 = _mm_unpackhi_epi8(src_line, zero); - s0 = _mm_adds_epu16(s0, t0); - s1 = _mm_adds_epu16(s1, t1); - ref += ref_stride; - - src_line = _mm_loadu_si128((const __m128i *)ref); - t0 = _mm_unpacklo_epi8(src_line, zero); - t1 = _mm_unpackhi_epi8(src_line, zero); - s0 = _mm_adds_epu16(s0, t0); - s1 = _mm_adds_epu16(s1, t1); - ref += ref_stride; - } - - src_line = _mm_loadu_si128((const __m128i *)ref); - t0 = _mm_unpacklo_epi8(src_line, zero); - t1 = _mm_unpackhi_epi8(src_line, zero); - s0 = _mm_adds_epu16(s0, t0); - s1 = _mm_adds_epu16(s1, t1); - - if (height == 64) { - s0 = _mm_srai_epi16(s0, 5); - s1 = _mm_srai_epi16(s1, 5); - } else if (height == 32) { - s0 = _mm_srai_epi16(s0, 4); - s1 = _mm_srai_epi16(s1, 4); - } else { - s0 = _mm_srai_epi16(s0, 3); - s1 = _mm_srai_epi16(s1, 3); - } - - _mm_storeu_si128((__m128i *)hbuf, s0); - hbuf += 8; - _mm_storeu_si128((__m128i *)hbuf, s1); -} - -int16_t vp9_int_pro_col_sse2(uint8_t const *ref, const int width) { - __m128i zero = _mm_setzero_si128(); - __m128i src_line = _mm_load_si128((const __m128i *)ref); - __m128i s0 = _mm_sad_epu8(src_line, zero); - __m128i s1; - int i; - - for (i = 16; i < width; i += 16) { - ref += 16; - src_line = _mm_load_si128((const __m128i *)ref); - s1 = _mm_sad_epu8(src_line, zero); - s0 = _mm_adds_epu16(s0, s1); - } - - s1 = _mm_srli_si128(s0, 8); - s0 = _mm_adds_epu16(s0, s1); - - return _mm_extract_epi16(s0, 0); -} - -int vp9_vector_var_sse2(int16_t const *ref, int16_t const *src, - const int bwl) { - int idx; - int width = 4 << bwl; - int16_t mean; - __m128i v0 = _mm_loadu_si128((const __m128i *)ref); - __m128i v1 = _mm_load_si128((const __m128i *)src); - __m128i diff = _mm_subs_epi16(v0, v1); - __m128i sum = diff; - __m128i sse = _mm_madd_epi16(diff, diff); - - ref += 8; - src += 8; - - for (idx = 8; idx < width; idx += 8) { - v0 = _mm_loadu_si128((const __m128i *)ref); - v1 = _mm_load_si128((const __m128i *)src); - diff = _mm_subs_epi16(v0, v1); - - sum = _mm_add_epi16(sum, diff); - v0 = _mm_madd_epi16(diff, diff); - sse = _mm_add_epi32(sse, v0); - - ref += 8; - src += 8; - } - - v0 = _mm_srli_si128(sum, 8); - sum = _mm_add_epi16(sum, v0); - v0 = _mm_srli_epi64(sum, 32); - sum = _mm_add_epi16(sum, v0); - v0 = _mm_srli_epi32(sum, 16); - sum = _mm_add_epi16(sum, v0); - - v1 = _mm_srli_si128(sse, 8); - sse = _mm_add_epi32(sse, v1); - v1 = _mm_srli_epi64(sse, 32); - sse = _mm_add_epi32(sse, v1); - - mean = _mm_extract_epi16(sum, 0); - - return _mm_cvtsi128_si32(sse) - ((mean * mean) >> (bwl + 2)); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct32x32_avx2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct32x32_avx2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct32x32_avx2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct32x32_avx2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2711 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include // AVX2 -#include "vp9/common/vp9_idct.h" // for cospi constants -#include "vpx_ports/mem.h" - -#define pair256_set_epi16(a, b) \ - _mm256_set_epi16((int16_t)(b), (int16_t)(a), (int16_t)(b), (int16_t)(a), \ - (int16_t)(b), (int16_t)(a), (int16_t)(b), (int16_t)(a), \ - (int16_t)(b), (int16_t)(a), (int16_t)(b), (int16_t)(a), \ - (int16_t)(b), (int16_t)(a), (int16_t)(b), (int16_t)(a)) - -#define pair256_set_epi32(a, b) \ - _mm256_set_epi32((int)(b), (int)(a), (int)(b), (int)(a), \ - (int)(b), (int)(a), (int)(b), (int)(a)) - -#if FDCT32x32_HIGH_PRECISION -static INLINE __m256i k_madd_epi32_avx2(__m256i a, __m256i b) { - __m256i buf0, buf1; - buf0 = _mm256_mul_epu32(a, b); - a = _mm256_srli_epi64(a, 32); - b = _mm256_srli_epi64(b, 32); - buf1 = _mm256_mul_epu32(a, b); - return _mm256_add_epi64(buf0, buf1); -} - -static INLINE __m256i k_packs_epi64_avx2(__m256i a, __m256i b) { - __m256i buf0 = _mm256_shuffle_epi32(a, _MM_SHUFFLE(0, 0, 2, 0)); - __m256i buf1 = _mm256_shuffle_epi32(b, _MM_SHUFFLE(0, 0, 2, 0)); - return _mm256_unpacklo_epi64(buf0, buf1); -} -#endif - -void FDCT32x32_2D_AVX2(const int16_t *input, - int16_t *output_org, int stride) { - // Calculate pre-multiplied strides - const int str1 = stride; - const int str2 = 2 * stride; - const int str3 = 2 * stride + str1; - // We need an intermediate buffer between passes. - DECLARE_ALIGNED(32, int16_t, intermediate[32 * 32]); - // Constants - // When we use them, in one case, they are all the same. In all others - // it's a pair of them that we need to repeat four times. This is done - // by constructing the 32 bit constant corresponding to that pair. - const __m256i k__cospi_p16_p16 = _mm256_set1_epi16((int16_t)cospi_16_64); - const __m256i k__cospi_p16_m16 = pair256_set_epi16(+cospi_16_64, -cospi_16_64); - const __m256i k__cospi_m08_p24 = pair256_set_epi16(-cospi_8_64, cospi_24_64); - const __m256i k__cospi_m24_m08 = pair256_set_epi16(-cospi_24_64, -cospi_8_64); - const __m256i k__cospi_p24_p08 = pair256_set_epi16(+cospi_24_64, cospi_8_64); - const __m256i k__cospi_p12_p20 = pair256_set_epi16(+cospi_12_64, cospi_20_64); - const __m256i k__cospi_m20_p12 = pair256_set_epi16(-cospi_20_64, cospi_12_64); - const __m256i k__cospi_m04_p28 = pair256_set_epi16(-cospi_4_64, cospi_28_64); - const __m256i k__cospi_p28_p04 = pair256_set_epi16(+cospi_28_64, cospi_4_64); - const __m256i k__cospi_m28_m04 = pair256_set_epi16(-cospi_28_64, -cospi_4_64); - const __m256i k__cospi_m12_m20 = pair256_set_epi16(-cospi_12_64, -cospi_20_64); - const __m256i k__cospi_p30_p02 = pair256_set_epi16(+cospi_30_64, cospi_2_64); - const __m256i k__cospi_p14_p18 = pair256_set_epi16(+cospi_14_64, cospi_18_64); - const __m256i k__cospi_p22_p10 = pair256_set_epi16(+cospi_22_64, cospi_10_64); - const __m256i k__cospi_p06_p26 = pair256_set_epi16(+cospi_6_64, cospi_26_64); - const __m256i k__cospi_m26_p06 = pair256_set_epi16(-cospi_26_64, cospi_6_64); - const __m256i k__cospi_m10_p22 = pair256_set_epi16(-cospi_10_64, cospi_22_64); - const __m256i k__cospi_m18_p14 = pair256_set_epi16(-cospi_18_64, cospi_14_64); - const __m256i k__cospi_m02_p30 = pair256_set_epi16(-cospi_2_64, cospi_30_64); - const __m256i k__cospi_p31_p01 = pair256_set_epi16(+cospi_31_64, cospi_1_64); - const __m256i k__cospi_p15_p17 = pair256_set_epi16(+cospi_15_64, cospi_17_64); - const __m256i k__cospi_p23_p09 = pair256_set_epi16(+cospi_23_64, cospi_9_64); - const __m256i k__cospi_p07_p25 = pair256_set_epi16(+cospi_7_64, cospi_25_64); - const __m256i k__cospi_m25_p07 = pair256_set_epi16(-cospi_25_64, cospi_7_64); - const __m256i k__cospi_m09_p23 = pair256_set_epi16(-cospi_9_64, cospi_23_64); - const __m256i k__cospi_m17_p15 = pair256_set_epi16(-cospi_17_64, cospi_15_64); - const __m256i k__cospi_m01_p31 = pair256_set_epi16(-cospi_1_64, cospi_31_64); - const __m256i k__cospi_p27_p05 = pair256_set_epi16(+cospi_27_64, cospi_5_64); - const __m256i k__cospi_p11_p21 = pair256_set_epi16(+cospi_11_64, cospi_21_64); - const __m256i k__cospi_p19_p13 = pair256_set_epi16(+cospi_19_64, cospi_13_64); - const __m256i k__cospi_p03_p29 = pair256_set_epi16(+cospi_3_64, cospi_29_64); - const __m256i k__cospi_m29_p03 = pair256_set_epi16(-cospi_29_64, cospi_3_64); - const __m256i k__cospi_m13_p19 = pair256_set_epi16(-cospi_13_64, cospi_19_64); - const __m256i k__cospi_m21_p11 = pair256_set_epi16(-cospi_21_64, cospi_11_64); - const __m256i k__cospi_m05_p27 = pair256_set_epi16(-cospi_5_64, cospi_27_64); - const __m256i k__DCT_CONST_ROUNDING = _mm256_set1_epi32(DCT_CONST_ROUNDING); - const __m256i kZero = _mm256_set1_epi16(0); - const __m256i kOne = _mm256_set1_epi16(1); - // Do the two transform/transpose passes - int pass; - for (pass = 0; pass < 2; ++pass) { - // We process sixteen columns (transposed rows in second pass) at a time. - int column_start; - for (column_start = 0; column_start < 32; column_start += 16) { - __m256i step1[32]; - __m256i step2[32]; - __m256i step3[32]; - __m256i out[32]; - // Stage 1 - // Note: even though all the loads below are aligned, using the aligned - // intrinsic make the code slightly slower. - if (0 == pass) { - const int16_t *in = &input[column_start]; - // step1[i] = (in[ 0 * stride] + in[(32 - 1) * stride]) << 2; - // Note: the next four blocks could be in a loop. That would help the - // instruction cache but is actually slower. - { - const int16_t *ina = in + 0 * str1; - const int16_t *inb = in + 31 * str1; - __m256i *step1a = &step1[ 0]; - __m256i *step1b = &step1[31]; - const __m256i ina0 = _mm256_loadu_si256((const __m256i *)(ina)); - const __m256i ina1 = _mm256_loadu_si256((const __m256i *)(ina + str1)); - const __m256i ina2 = _mm256_loadu_si256((const __m256i *)(ina + str2)); - const __m256i ina3 = _mm256_loadu_si256((const __m256i *)(ina + str3)); - const __m256i inb3 = _mm256_loadu_si256((const __m256i *)(inb - str3)); - const __m256i inb2 = _mm256_loadu_si256((const __m256i *)(inb - str2)); - const __m256i inb1 = _mm256_loadu_si256((const __m256i *)(inb - str1)); - const __m256i inb0 = _mm256_loadu_si256((const __m256i *)(inb)); - step1a[ 0] = _mm256_add_epi16(ina0, inb0); - step1a[ 1] = _mm256_add_epi16(ina1, inb1); - step1a[ 2] = _mm256_add_epi16(ina2, inb2); - step1a[ 3] = _mm256_add_epi16(ina3, inb3); - step1b[-3] = _mm256_sub_epi16(ina3, inb3); - step1b[-2] = _mm256_sub_epi16(ina2, inb2); - step1b[-1] = _mm256_sub_epi16(ina1, inb1); - step1b[-0] = _mm256_sub_epi16(ina0, inb0); - step1a[ 0] = _mm256_slli_epi16(step1a[ 0], 2); - step1a[ 1] = _mm256_slli_epi16(step1a[ 1], 2); - step1a[ 2] = _mm256_slli_epi16(step1a[ 2], 2); - step1a[ 3] = _mm256_slli_epi16(step1a[ 3], 2); - step1b[-3] = _mm256_slli_epi16(step1b[-3], 2); - step1b[-2] = _mm256_slli_epi16(step1b[-2], 2); - step1b[-1] = _mm256_slli_epi16(step1b[-1], 2); - step1b[-0] = _mm256_slli_epi16(step1b[-0], 2); - } - { - const int16_t *ina = in + 4 * str1; - const int16_t *inb = in + 27 * str1; - __m256i *step1a = &step1[ 4]; - __m256i *step1b = &step1[27]; - const __m256i ina0 = _mm256_loadu_si256((const __m256i *)(ina)); - const __m256i ina1 = _mm256_loadu_si256((const __m256i *)(ina + str1)); - const __m256i ina2 = _mm256_loadu_si256((const __m256i *)(ina + str2)); - const __m256i ina3 = _mm256_loadu_si256((const __m256i *)(ina + str3)); - const __m256i inb3 = _mm256_loadu_si256((const __m256i *)(inb - str3)); - const __m256i inb2 = _mm256_loadu_si256((const __m256i *)(inb - str2)); - const __m256i inb1 = _mm256_loadu_si256((const __m256i *)(inb - str1)); - const __m256i inb0 = _mm256_loadu_si256((const __m256i *)(inb)); - step1a[ 0] = _mm256_add_epi16(ina0, inb0); - step1a[ 1] = _mm256_add_epi16(ina1, inb1); - step1a[ 2] = _mm256_add_epi16(ina2, inb2); - step1a[ 3] = _mm256_add_epi16(ina3, inb3); - step1b[-3] = _mm256_sub_epi16(ina3, inb3); - step1b[-2] = _mm256_sub_epi16(ina2, inb2); - step1b[-1] = _mm256_sub_epi16(ina1, inb1); - step1b[-0] = _mm256_sub_epi16(ina0, inb0); - step1a[ 0] = _mm256_slli_epi16(step1a[ 0], 2); - step1a[ 1] = _mm256_slli_epi16(step1a[ 1], 2); - step1a[ 2] = _mm256_slli_epi16(step1a[ 2], 2); - step1a[ 3] = _mm256_slli_epi16(step1a[ 3], 2); - step1b[-3] = _mm256_slli_epi16(step1b[-3], 2); - step1b[-2] = _mm256_slli_epi16(step1b[-2], 2); - step1b[-1] = _mm256_slli_epi16(step1b[-1], 2); - step1b[-0] = _mm256_slli_epi16(step1b[-0], 2); - } - { - const int16_t *ina = in + 8 * str1; - const int16_t *inb = in + 23 * str1; - __m256i *step1a = &step1[ 8]; - __m256i *step1b = &step1[23]; - const __m256i ina0 = _mm256_loadu_si256((const __m256i *)(ina)); - const __m256i ina1 = _mm256_loadu_si256((const __m256i *)(ina + str1)); - const __m256i ina2 = _mm256_loadu_si256((const __m256i *)(ina + str2)); - const __m256i ina3 = _mm256_loadu_si256((const __m256i *)(ina + str3)); - const __m256i inb3 = _mm256_loadu_si256((const __m256i *)(inb - str3)); - const __m256i inb2 = _mm256_loadu_si256((const __m256i *)(inb - str2)); - const __m256i inb1 = _mm256_loadu_si256((const __m256i *)(inb - str1)); - const __m256i inb0 = _mm256_loadu_si256((const __m256i *)(inb)); - step1a[ 0] = _mm256_add_epi16(ina0, inb0); - step1a[ 1] = _mm256_add_epi16(ina1, inb1); - step1a[ 2] = _mm256_add_epi16(ina2, inb2); - step1a[ 3] = _mm256_add_epi16(ina3, inb3); - step1b[-3] = _mm256_sub_epi16(ina3, inb3); - step1b[-2] = _mm256_sub_epi16(ina2, inb2); - step1b[-1] = _mm256_sub_epi16(ina1, inb1); - step1b[-0] = _mm256_sub_epi16(ina0, inb0); - step1a[ 0] = _mm256_slli_epi16(step1a[ 0], 2); - step1a[ 1] = _mm256_slli_epi16(step1a[ 1], 2); - step1a[ 2] = _mm256_slli_epi16(step1a[ 2], 2); - step1a[ 3] = _mm256_slli_epi16(step1a[ 3], 2); - step1b[-3] = _mm256_slli_epi16(step1b[-3], 2); - step1b[-2] = _mm256_slli_epi16(step1b[-2], 2); - step1b[-1] = _mm256_slli_epi16(step1b[-1], 2); - step1b[-0] = _mm256_slli_epi16(step1b[-0], 2); - } - { - const int16_t *ina = in + 12 * str1; - const int16_t *inb = in + 19 * str1; - __m256i *step1a = &step1[12]; - __m256i *step1b = &step1[19]; - const __m256i ina0 = _mm256_loadu_si256((const __m256i *)(ina)); - const __m256i ina1 = _mm256_loadu_si256((const __m256i *)(ina + str1)); - const __m256i ina2 = _mm256_loadu_si256((const __m256i *)(ina + str2)); - const __m256i ina3 = _mm256_loadu_si256((const __m256i *)(ina + str3)); - const __m256i inb3 = _mm256_loadu_si256((const __m256i *)(inb - str3)); - const __m256i inb2 = _mm256_loadu_si256((const __m256i *)(inb - str2)); - const __m256i inb1 = _mm256_loadu_si256((const __m256i *)(inb - str1)); - const __m256i inb0 = _mm256_loadu_si256((const __m256i *)(inb)); - step1a[ 0] = _mm256_add_epi16(ina0, inb0); - step1a[ 1] = _mm256_add_epi16(ina1, inb1); - step1a[ 2] = _mm256_add_epi16(ina2, inb2); - step1a[ 3] = _mm256_add_epi16(ina3, inb3); - step1b[-3] = _mm256_sub_epi16(ina3, inb3); - step1b[-2] = _mm256_sub_epi16(ina2, inb2); - step1b[-1] = _mm256_sub_epi16(ina1, inb1); - step1b[-0] = _mm256_sub_epi16(ina0, inb0); - step1a[ 0] = _mm256_slli_epi16(step1a[ 0], 2); - step1a[ 1] = _mm256_slli_epi16(step1a[ 1], 2); - step1a[ 2] = _mm256_slli_epi16(step1a[ 2], 2); - step1a[ 3] = _mm256_slli_epi16(step1a[ 3], 2); - step1b[-3] = _mm256_slli_epi16(step1b[-3], 2); - step1b[-2] = _mm256_slli_epi16(step1b[-2], 2); - step1b[-1] = _mm256_slli_epi16(step1b[-1], 2); - step1b[-0] = _mm256_slli_epi16(step1b[-0], 2); - } - } else { - int16_t *in = &intermediate[column_start]; - // step1[i] = in[ 0 * 32] + in[(32 - 1) * 32]; - // Note: using the same approach as above to have common offset is - // counter-productive as all offsets can be calculated at compile - // time. - // Note: the next four blocks could be in a loop. That would help the - // instruction cache but is actually slower. - { - __m256i in00 = _mm256_loadu_si256((const __m256i *)(in + 0 * 32)); - __m256i in01 = _mm256_loadu_si256((const __m256i *)(in + 1 * 32)); - __m256i in02 = _mm256_loadu_si256((const __m256i *)(in + 2 * 32)); - __m256i in03 = _mm256_loadu_si256((const __m256i *)(in + 3 * 32)); - __m256i in28 = _mm256_loadu_si256((const __m256i *)(in + 28 * 32)); - __m256i in29 = _mm256_loadu_si256((const __m256i *)(in + 29 * 32)); - __m256i in30 = _mm256_loadu_si256((const __m256i *)(in + 30 * 32)); - __m256i in31 = _mm256_loadu_si256((const __m256i *)(in + 31 * 32)); - step1[ 0] = _mm256_add_epi16(in00, in31); - step1[ 1] = _mm256_add_epi16(in01, in30); - step1[ 2] = _mm256_add_epi16(in02, in29); - step1[ 3] = _mm256_add_epi16(in03, in28); - step1[28] = _mm256_sub_epi16(in03, in28); - step1[29] = _mm256_sub_epi16(in02, in29); - step1[30] = _mm256_sub_epi16(in01, in30); - step1[31] = _mm256_sub_epi16(in00, in31); - } - { - __m256i in04 = _mm256_loadu_si256((const __m256i *)(in + 4 * 32)); - __m256i in05 = _mm256_loadu_si256((const __m256i *)(in + 5 * 32)); - __m256i in06 = _mm256_loadu_si256((const __m256i *)(in + 6 * 32)); - __m256i in07 = _mm256_loadu_si256((const __m256i *)(in + 7 * 32)); - __m256i in24 = _mm256_loadu_si256((const __m256i *)(in + 24 * 32)); - __m256i in25 = _mm256_loadu_si256((const __m256i *)(in + 25 * 32)); - __m256i in26 = _mm256_loadu_si256((const __m256i *)(in + 26 * 32)); - __m256i in27 = _mm256_loadu_si256((const __m256i *)(in + 27 * 32)); - step1[ 4] = _mm256_add_epi16(in04, in27); - step1[ 5] = _mm256_add_epi16(in05, in26); - step1[ 6] = _mm256_add_epi16(in06, in25); - step1[ 7] = _mm256_add_epi16(in07, in24); - step1[24] = _mm256_sub_epi16(in07, in24); - step1[25] = _mm256_sub_epi16(in06, in25); - step1[26] = _mm256_sub_epi16(in05, in26); - step1[27] = _mm256_sub_epi16(in04, in27); - } - { - __m256i in08 = _mm256_loadu_si256((const __m256i *)(in + 8 * 32)); - __m256i in09 = _mm256_loadu_si256((const __m256i *)(in + 9 * 32)); - __m256i in10 = _mm256_loadu_si256((const __m256i *)(in + 10 * 32)); - __m256i in11 = _mm256_loadu_si256((const __m256i *)(in + 11 * 32)); - __m256i in20 = _mm256_loadu_si256((const __m256i *)(in + 20 * 32)); - __m256i in21 = _mm256_loadu_si256((const __m256i *)(in + 21 * 32)); - __m256i in22 = _mm256_loadu_si256((const __m256i *)(in + 22 * 32)); - __m256i in23 = _mm256_loadu_si256((const __m256i *)(in + 23 * 32)); - step1[ 8] = _mm256_add_epi16(in08, in23); - step1[ 9] = _mm256_add_epi16(in09, in22); - step1[10] = _mm256_add_epi16(in10, in21); - step1[11] = _mm256_add_epi16(in11, in20); - step1[20] = _mm256_sub_epi16(in11, in20); - step1[21] = _mm256_sub_epi16(in10, in21); - step1[22] = _mm256_sub_epi16(in09, in22); - step1[23] = _mm256_sub_epi16(in08, in23); - } - { - __m256i in12 = _mm256_loadu_si256((const __m256i *)(in + 12 * 32)); - __m256i in13 = _mm256_loadu_si256((const __m256i *)(in + 13 * 32)); - __m256i in14 = _mm256_loadu_si256((const __m256i *)(in + 14 * 32)); - __m256i in15 = _mm256_loadu_si256((const __m256i *)(in + 15 * 32)); - __m256i in16 = _mm256_loadu_si256((const __m256i *)(in + 16 * 32)); - __m256i in17 = _mm256_loadu_si256((const __m256i *)(in + 17 * 32)); - __m256i in18 = _mm256_loadu_si256((const __m256i *)(in + 18 * 32)); - __m256i in19 = _mm256_loadu_si256((const __m256i *)(in + 19 * 32)); - step1[12] = _mm256_add_epi16(in12, in19); - step1[13] = _mm256_add_epi16(in13, in18); - step1[14] = _mm256_add_epi16(in14, in17); - step1[15] = _mm256_add_epi16(in15, in16); - step1[16] = _mm256_sub_epi16(in15, in16); - step1[17] = _mm256_sub_epi16(in14, in17); - step1[18] = _mm256_sub_epi16(in13, in18); - step1[19] = _mm256_sub_epi16(in12, in19); - } - } - // Stage 2 - { - step2[ 0] = _mm256_add_epi16(step1[0], step1[15]); - step2[ 1] = _mm256_add_epi16(step1[1], step1[14]); - step2[ 2] = _mm256_add_epi16(step1[2], step1[13]); - step2[ 3] = _mm256_add_epi16(step1[3], step1[12]); - step2[ 4] = _mm256_add_epi16(step1[4], step1[11]); - step2[ 5] = _mm256_add_epi16(step1[5], step1[10]); - step2[ 6] = _mm256_add_epi16(step1[6], step1[ 9]); - step2[ 7] = _mm256_add_epi16(step1[7], step1[ 8]); - step2[ 8] = _mm256_sub_epi16(step1[7], step1[ 8]); - step2[ 9] = _mm256_sub_epi16(step1[6], step1[ 9]); - step2[10] = _mm256_sub_epi16(step1[5], step1[10]); - step2[11] = _mm256_sub_epi16(step1[4], step1[11]); - step2[12] = _mm256_sub_epi16(step1[3], step1[12]); - step2[13] = _mm256_sub_epi16(step1[2], step1[13]); - step2[14] = _mm256_sub_epi16(step1[1], step1[14]); - step2[15] = _mm256_sub_epi16(step1[0], step1[15]); - } - { - const __m256i s2_20_0 = _mm256_unpacklo_epi16(step1[27], step1[20]); - const __m256i s2_20_1 = _mm256_unpackhi_epi16(step1[27], step1[20]); - const __m256i s2_21_0 = _mm256_unpacklo_epi16(step1[26], step1[21]); - const __m256i s2_21_1 = _mm256_unpackhi_epi16(step1[26], step1[21]); - const __m256i s2_22_0 = _mm256_unpacklo_epi16(step1[25], step1[22]); - const __m256i s2_22_1 = _mm256_unpackhi_epi16(step1[25], step1[22]); - const __m256i s2_23_0 = _mm256_unpacklo_epi16(step1[24], step1[23]); - const __m256i s2_23_1 = _mm256_unpackhi_epi16(step1[24], step1[23]); - const __m256i s2_20_2 = _mm256_madd_epi16(s2_20_0, k__cospi_p16_m16); - const __m256i s2_20_3 = _mm256_madd_epi16(s2_20_1, k__cospi_p16_m16); - const __m256i s2_21_2 = _mm256_madd_epi16(s2_21_0, k__cospi_p16_m16); - const __m256i s2_21_3 = _mm256_madd_epi16(s2_21_1, k__cospi_p16_m16); - const __m256i s2_22_2 = _mm256_madd_epi16(s2_22_0, k__cospi_p16_m16); - const __m256i s2_22_3 = _mm256_madd_epi16(s2_22_1, k__cospi_p16_m16); - const __m256i s2_23_2 = _mm256_madd_epi16(s2_23_0, k__cospi_p16_m16); - const __m256i s2_23_3 = _mm256_madd_epi16(s2_23_1, k__cospi_p16_m16); - const __m256i s2_24_2 = _mm256_madd_epi16(s2_23_0, k__cospi_p16_p16); - const __m256i s2_24_3 = _mm256_madd_epi16(s2_23_1, k__cospi_p16_p16); - const __m256i s2_25_2 = _mm256_madd_epi16(s2_22_0, k__cospi_p16_p16); - const __m256i s2_25_3 = _mm256_madd_epi16(s2_22_1, k__cospi_p16_p16); - const __m256i s2_26_2 = _mm256_madd_epi16(s2_21_0, k__cospi_p16_p16); - const __m256i s2_26_3 = _mm256_madd_epi16(s2_21_1, k__cospi_p16_p16); - const __m256i s2_27_2 = _mm256_madd_epi16(s2_20_0, k__cospi_p16_p16); - const __m256i s2_27_3 = _mm256_madd_epi16(s2_20_1, k__cospi_p16_p16); - // dct_const_round_shift - const __m256i s2_20_4 = _mm256_add_epi32(s2_20_2, k__DCT_CONST_ROUNDING); - const __m256i s2_20_5 = _mm256_add_epi32(s2_20_3, k__DCT_CONST_ROUNDING); - const __m256i s2_21_4 = _mm256_add_epi32(s2_21_2, k__DCT_CONST_ROUNDING); - const __m256i s2_21_5 = _mm256_add_epi32(s2_21_3, k__DCT_CONST_ROUNDING); - const __m256i s2_22_4 = _mm256_add_epi32(s2_22_2, k__DCT_CONST_ROUNDING); - const __m256i s2_22_5 = _mm256_add_epi32(s2_22_3, k__DCT_CONST_ROUNDING); - const __m256i s2_23_4 = _mm256_add_epi32(s2_23_2, k__DCT_CONST_ROUNDING); - const __m256i s2_23_5 = _mm256_add_epi32(s2_23_3, k__DCT_CONST_ROUNDING); - const __m256i s2_24_4 = _mm256_add_epi32(s2_24_2, k__DCT_CONST_ROUNDING); - const __m256i s2_24_5 = _mm256_add_epi32(s2_24_3, k__DCT_CONST_ROUNDING); - const __m256i s2_25_4 = _mm256_add_epi32(s2_25_2, k__DCT_CONST_ROUNDING); - const __m256i s2_25_5 = _mm256_add_epi32(s2_25_3, k__DCT_CONST_ROUNDING); - const __m256i s2_26_4 = _mm256_add_epi32(s2_26_2, k__DCT_CONST_ROUNDING); - const __m256i s2_26_5 = _mm256_add_epi32(s2_26_3, k__DCT_CONST_ROUNDING); - const __m256i s2_27_4 = _mm256_add_epi32(s2_27_2, k__DCT_CONST_ROUNDING); - const __m256i s2_27_5 = _mm256_add_epi32(s2_27_3, k__DCT_CONST_ROUNDING); - const __m256i s2_20_6 = _mm256_srai_epi32(s2_20_4, DCT_CONST_BITS); - const __m256i s2_20_7 = _mm256_srai_epi32(s2_20_5, DCT_CONST_BITS); - const __m256i s2_21_6 = _mm256_srai_epi32(s2_21_4, DCT_CONST_BITS); - const __m256i s2_21_7 = _mm256_srai_epi32(s2_21_5, DCT_CONST_BITS); - const __m256i s2_22_6 = _mm256_srai_epi32(s2_22_4, DCT_CONST_BITS); - const __m256i s2_22_7 = _mm256_srai_epi32(s2_22_5, DCT_CONST_BITS); - const __m256i s2_23_6 = _mm256_srai_epi32(s2_23_4, DCT_CONST_BITS); - const __m256i s2_23_7 = _mm256_srai_epi32(s2_23_5, DCT_CONST_BITS); - const __m256i s2_24_6 = _mm256_srai_epi32(s2_24_4, DCT_CONST_BITS); - const __m256i s2_24_7 = _mm256_srai_epi32(s2_24_5, DCT_CONST_BITS); - const __m256i s2_25_6 = _mm256_srai_epi32(s2_25_4, DCT_CONST_BITS); - const __m256i s2_25_7 = _mm256_srai_epi32(s2_25_5, DCT_CONST_BITS); - const __m256i s2_26_6 = _mm256_srai_epi32(s2_26_4, DCT_CONST_BITS); - const __m256i s2_26_7 = _mm256_srai_epi32(s2_26_5, DCT_CONST_BITS); - const __m256i s2_27_6 = _mm256_srai_epi32(s2_27_4, DCT_CONST_BITS); - const __m256i s2_27_7 = _mm256_srai_epi32(s2_27_5, DCT_CONST_BITS); - // Combine - step2[20] = _mm256_packs_epi32(s2_20_6, s2_20_7); - step2[21] = _mm256_packs_epi32(s2_21_6, s2_21_7); - step2[22] = _mm256_packs_epi32(s2_22_6, s2_22_7); - step2[23] = _mm256_packs_epi32(s2_23_6, s2_23_7); - step2[24] = _mm256_packs_epi32(s2_24_6, s2_24_7); - step2[25] = _mm256_packs_epi32(s2_25_6, s2_25_7); - step2[26] = _mm256_packs_epi32(s2_26_6, s2_26_7); - step2[27] = _mm256_packs_epi32(s2_27_6, s2_27_7); - } - -#if !FDCT32x32_HIGH_PRECISION - // dump the magnitude by half, hence the intermediate values are within - // the range of 16 bits. - if (1 == pass) { - __m256i s3_00_0 = _mm256_cmpgt_epi16(kZero,step2[ 0]); - __m256i s3_01_0 = _mm256_cmpgt_epi16(kZero,step2[ 1]); - __m256i s3_02_0 = _mm256_cmpgt_epi16(kZero,step2[ 2]); - __m256i s3_03_0 = _mm256_cmpgt_epi16(kZero,step2[ 3]); - __m256i s3_04_0 = _mm256_cmpgt_epi16(kZero,step2[ 4]); - __m256i s3_05_0 = _mm256_cmpgt_epi16(kZero,step2[ 5]); - __m256i s3_06_0 = _mm256_cmpgt_epi16(kZero,step2[ 6]); - __m256i s3_07_0 = _mm256_cmpgt_epi16(kZero,step2[ 7]); - __m256i s2_08_0 = _mm256_cmpgt_epi16(kZero,step2[ 8]); - __m256i s2_09_0 = _mm256_cmpgt_epi16(kZero,step2[ 9]); - __m256i s3_10_0 = _mm256_cmpgt_epi16(kZero,step2[10]); - __m256i s3_11_0 = _mm256_cmpgt_epi16(kZero,step2[11]); - __m256i s3_12_0 = _mm256_cmpgt_epi16(kZero,step2[12]); - __m256i s3_13_0 = _mm256_cmpgt_epi16(kZero,step2[13]); - __m256i s2_14_0 = _mm256_cmpgt_epi16(kZero,step2[14]); - __m256i s2_15_0 = _mm256_cmpgt_epi16(kZero,step2[15]); - __m256i s3_16_0 = _mm256_cmpgt_epi16(kZero,step1[16]); - __m256i s3_17_0 = _mm256_cmpgt_epi16(kZero,step1[17]); - __m256i s3_18_0 = _mm256_cmpgt_epi16(kZero,step1[18]); - __m256i s3_19_0 = _mm256_cmpgt_epi16(kZero,step1[19]); - __m256i s3_20_0 = _mm256_cmpgt_epi16(kZero,step2[20]); - __m256i s3_21_0 = _mm256_cmpgt_epi16(kZero,step2[21]); - __m256i s3_22_0 = _mm256_cmpgt_epi16(kZero,step2[22]); - __m256i s3_23_0 = _mm256_cmpgt_epi16(kZero,step2[23]); - __m256i s3_24_0 = _mm256_cmpgt_epi16(kZero,step2[24]); - __m256i s3_25_0 = _mm256_cmpgt_epi16(kZero,step2[25]); - __m256i s3_26_0 = _mm256_cmpgt_epi16(kZero,step2[26]); - __m256i s3_27_0 = _mm256_cmpgt_epi16(kZero,step2[27]); - __m256i s3_28_0 = _mm256_cmpgt_epi16(kZero,step1[28]); - __m256i s3_29_0 = _mm256_cmpgt_epi16(kZero,step1[29]); - __m256i s3_30_0 = _mm256_cmpgt_epi16(kZero,step1[30]); - __m256i s3_31_0 = _mm256_cmpgt_epi16(kZero,step1[31]); - - step2[ 0] = _mm256_sub_epi16(step2[ 0], s3_00_0); - step2[ 1] = _mm256_sub_epi16(step2[ 1], s3_01_0); - step2[ 2] = _mm256_sub_epi16(step2[ 2], s3_02_0); - step2[ 3] = _mm256_sub_epi16(step2[ 3], s3_03_0); - step2[ 4] = _mm256_sub_epi16(step2[ 4], s3_04_0); - step2[ 5] = _mm256_sub_epi16(step2[ 5], s3_05_0); - step2[ 6] = _mm256_sub_epi16(step2[ 6], s3_06_0); - step2[ 7] = _mm256_sub_epi16(step2[ 7], s3_07_0); - step2[ 8] = _mm256_sub_epi16(step2[ 8], s2_08_0); - step2[ 9] = _mm256_sub_epi16(step2[ 9], s2_09_0); - step2[10] = _mm256_sub_epi16(step2[10], s3_10_0); - step2[11] = _mm256_sub_epi16(step2[11], s3_11_0); - step2[12] = _mm256_sub_epi16(step2[12], s3_12_0); - step2[13] = _mm256_sub_epi16(step2[13], s3_13_0); - step2[14] = _mm256_sub_epi16(step2[14], s2_14_0); - step2[15] = _mm256_sub_epi16(step2[15], s2_15_0); - step1[16] = _mm256_sub_epi16(step1[16], s3_16_0); - step1[17] = _mm256_sub_epi16(step1[17], s3_17_0); - step1[18] = _mm256_sub_epi16(step1[18], s3_18_0); - step1[19] = _mm256_sub_epi16(step1[19], s3_19_0); - step2[20] = _mm256_sub_epi16(step2[20], s3_20_0); - step2[21] = _mm256_sub_epi16(step2[21], s3_21_0); - step2[22] = _mm256_sub_epi16(step2[22], s3_22_0); - step2[23] = _mm256_sub_epi16(step2[23], s3_23_0); - step2[24] = _mm256_sub_epi16(step2[24], s3_24_0); - step2[25] = _mm256_sub_epi16(step2[25], s3_25_0); - step2[26] = _mm256_sub_epi16(step2[26], s3_26_0); - step2[27] = _mm256_sub_epi16(step2[27], s3_27_0); - step1[28] = _mm256_sub_epi16(step1[28], s3_28_0); - step1[29] = _mm256_sub_epi16(step1[29], s3_29_0); - step1[30] = _mm256_sub_epi16(step1[30], s3_30_0); - step1[31] = _mm256_sub_epi16(step1[31], s3_31_0); - - step2[ 0] = _mm256_add_epi16(step2[ 0], kOne); - step2[ 1] = _mm256_add_epi16(step2[ 1], kOne); - step2[ 2] = _mm256_add_epi16(step2[ 2], kOne); - step2[ 3] = _mm256_add_epi16(step2[ 3], kOne); - step2[ 4] = _mm256_add_epi16(step2[ 4], kOne); - step2[ 5] = _mm256_add_epi16(step2[ 5], kOne); - step2[ 6] = _mm256_add_epi16(step2[ 6], kOne); - step2[ 7] = _mm256_add_epi16(step2[ 7], kOne); - step2[ 8] = _mm256_add_epi16(step2[ 8], kOne); - step2[ 9] = _mm256_add_epi16(step2[ 9], kOne); - step2[10] = _mm256_add_epi16(step2[10], kOne); - step2[11] = _mm256_add_epi16(step2[11], kOne); - step2[12] = _mm256_add_epi16(step2[12], kOne); - step2[13] = _mm256_add_epi16(step2[13], kOne); - step2[14] = _mm256_add_epi16(step2[14], kOne); - step2[15] = _mm256_add_epi16(step2[15], kOne); - step1[16] = _mm256_add_epi16(step1[16], kOne); - step1[17] = _mm256_add_epi16(step1[17], kOne); - step1[18] = _mm256_add_epi16(step1[18], kOne); - step1[19] = _mm256_add_epi16(step1[19], kOne); - step2[20] = _mm256_add_epi16(step2[20], kOne); - step2[21] = _mm256_add_epi16(step2[21], kOne); - step2[22] = _mm256_add_epi16(step2[22], kOne); - step2[23] = _mm256_add_epi16(step2[23], kOne); - step2[24] = _mm256_add_epi16(step2[24], kOne); - step2[25] = _mm256_add_epi16(step2[25], kOne); - step2[26] = _mm256_add_epi16(step2[26], kOne); - step2[27] = _mm256_add_epi16(step2[27], kOne); - step1[28] = _mm256_add_epi16(step1[28], kOne); - step1[29] = _mm256_add_epi16(step1[29], kOne); - step1[30] = _mm256_add_epi16(step1[30], kOne); - step1[31] = _mm256_add_epi16(step1[31], kOne); - - step2[ 0] = _mm256_srai_epi16(step2[ 0], 2); - step2[ 1] = _mm256_srai_epi16(step2[ 1], 2); - step2[ 2] = _mm256_srai_epi16(step2[ 2], 2); - step2[ 3] = _mm256_srai_epi16(step2[ 3], 2); - step2[ 4] = _mm256_srai_epi16(step2[ 4], 2); - step2[ 5] = _mm256_srai_epi16(step2[ 5], 2); - step2[ 6] = _mm256_srai_epi16(step2[ 6], 2); - step2[ 7] = _mm256_srai_epi16(step2[ 7], 2); - step2[ 8] = _mm256_srai_epi16(step2[ 8], 2); - step2[ 9] = _mm256_srai_epi16(step2[ 9], 2); - step2[10] = _mm256_srai_epi16(step2[10], 2); - step2[11] = _mm256_srai_epi16(step2[11], 2); - step2[12] = _mm256_srai_epi16(step2[12], 2); - step2[13] = _mm256_srai_epi16(step2[13], 2); - step2[14] = _mm256_srai_epi16(step2[14], 2); - step2[15] = _mm256_srai_epi16(step2[15], 2); - step1[16] = _mm256_srai_epi16(step1[16], 2); - step1[17] = _mm256_srai_epi16(step1[17], 2); - step1[18] = _mm256_srai_epi16(step1[18], 2); - step1[19] = _mm256_srai_epi16(step1[19], 2); - step2[20] = _mm256_srai_epi16(step2[20], 2); - step2[21] = _mm256_srai_epi16(step2[21], 2); - step2[22] = _mm256_srai_epi16(step2[22], 2); - step2[23] = _mm256_srai_epi16(step2[23], 2); - step2[24] = _mm256_srai_epi16(step2[24], 2); - step2[25] = _mm256_srai_epi16(step2[25], 2); - step2[26] = _mm256_srai_epi16(step2[26], 2); - step2[27] = _mm256_srai_epi16(step2[27], 2); - step1[28] = _mm256_srai_epi16(step1[28], 2); - step1[29] = _mm256_srai_epi16(step1[29], 2); - step1[30] = _mm256_srai_epi16(step1[30], 2); - step1[31] = _mm256_srai_epi16(step1[31], 2); - } -#endif - -#if FDCT32x32_HIGH_PRECISION - if (pass == 0) { -#endif - // Stage 3 - { - step3[0] = _mm256_add_epi16(step2[(8 - 1)], step2[0]); - step3[1] = _mm256_add_epi16(step2[(8 - 2)], step2[1]); - step3[2] = _mm256_add_epi16(step2[(8 - 3)], step2[2]); - step3[3] = _mm256_add_epi16(step2[(8 - 4)], step2[3]); - step3[4] = _mm256_sub_epi16(step2[(8 - 5)], step2[4]); - step3[5] = _mm256_sub_epi16(step2[(8 - 6)], step2[5]); - step3[6] = _mm256_sub_epi16(step2[(8 - 7)], step2[6]); - step3[7] = _mm256_sub_epi16(step2[(8 - 8)], step2[7]); - } - { - const __m256i s3_10_0 = _mm256_unpacklo_epi16(step2[13], step2[10]); - const __m256i s3_10_1 = _mm256_unpackhi_epi16(step2[13], step2[10]); - const __m256i s3_11_0 = _mm256_unpacklo_epi16(step2[12], step2[11]); - const __m256i s3_11_1 = _mm256_unpackhi_epi16(step2[12], step2[11]); - const __m256i s3_10_2 = _mm256_madd_epi16(s3_10_0, k__cospi_p16_m16); - const __m256i s3_10_3 = _mm256_madd_epi16(s3_10_1, k__cospi_p16_m16); - const __m256i s3_11_2 = _mm256_madd_epi16(s3_11_0, k__cospi_p16_m16); - const __m256i s3_11_3 = _mm256_madd_epi16(s3_11_1, k__cospi_p16_m16); - const __m256i s3_12_2 = _mm256_madd_epi16(s3_11_0, k__cospi_p16_p16); - const __m256i s3_12_3 = _mm256_madd_epi16(s3_11_1, k__cospi_p16_p16); - const __m256i s3_13_2 = _mm256_madd_epi16(s3_10_0, k__cospi_p16_p16); - const __m256i s3_13_3 = _mm256_madd_epi16(s3_10_1, k__cospi_p16_p16); - // dct_const_round_shift - const __m256i s3_10_4 = _mm256_add_epi32(s3_10_2, k__DCT_CONST_ROUNDING); - const __m256i s3_10_5 = _mm256_add_epi32(s3_10_3, k__DCT_CONST_ROUNDING); - const __m256i s3_11_4 = _mm256_add_epi32(s3_11_2, k__DCT_CONST_ROUNDING); - const __m256i s3_11_5 = _mm256_add_epi32(s3_11_3, k__DCT_CONST_ROUNDING); - const __m256i s3_12_4 = _mm256_add_epi32(s3_12_2, k__DCT_CONST_ROUNDING); - const __m256i s3_12_5 = _mm256_add_epi32(s3_12_3, k__DCT_CONST_ROUNDING); - const __m256i s3_13_4 = _mm256_add_epi32(s3_13_2, k__DCT_CONST_ROUNDING); - const __m256i s3_13_5 = _mm256_add_epi32(s3_13_3, k__DCT_CONST_ROUNDING); - const __m256i s3_10_6 = _mm256_srai_epi32(s3_10_4, DCT_CONST_BITS); - const __m256i s3_10_7 = _mm256_srai_epi32(s3_10_5, DCT_CONST_BITS); - const __m256i s3_11_6 = _mm256_srai_epi32(s3_11_4, DCT_CONST_BITS); - const __m256i s3_11_7 = _mm256_srai_epi32(s3_11_5, DCT_CONST_BITS); - const __m256i s3_12_6 = _mm256_srai_epi32(s3_12_4, DCT_CONST_BITS); - const __m256i s3_12_7 = _mm256_srai_epi32(s3_12_5, DCT_CONST_BITS); - const __m256i s3_13_6 = _mm256_srai_epi32(s3_13_4, DCT_CONST_BITS); - const __m256i s3_13_7 = _mm256_srai_epi32(s3_13_5, DCT_CONST_BITS); - // Combine - step3[10] = _mm256_packs_epi32(s3_10_6, s3_10_7); - step3[11] = _mm256_packs_epi32(s3_11_6, s3_11_7); - step3[12] = _mm256_packs_epi32(s3_12_6, s3_12_7); - step3[13] = _mm256_packs_epi32(s3_13_6, s3_13_7); - } - { - step3[16] = _mm256_add_epi16(step2[23], step1[16]); - step3[17] = _mm256_add_epi16(step2[22], step1[17]); - step3[18] = _mm256_add_epi16(step2[21], step1[18]); - step3[19] = _mm256_add_epi16(step2[20], step1[19]); - step3[20] = _mm256_sub_epi16(step1[19], step2[20]); - step3[21] = _mm256_sub_epi16(step1[18], step2[21]); - step3[22] = _mm256_sub_epi16(step1[17], step2[22]); - step3[23] = _mm256_sub_epi16(step1[16], step2[23]); - step3[24] = _mm256_sub_epi16(step1[31], step2[24]); - step3[25] = _mm256_sub_epi16(step1[30], step2[25]); - step3[26] = _mm256_sub_epi16(step1[29], step2[26]); - step3[27] = _mm256_sub_epi16(step1[28], step2[27]); - step3[28] = _mm256_add_epi16(step2[27], step1[28]); - step3[29] = _mm256_add_epi16(step2[26], step1[29]); - step3[30] = _mm256_add_epi16(step2[25], step1[30]); - step3[31] = _mm256_add_epi16(step2[24], step1[31]); - } - - // Stage 4 - { - step1[ 0] = _mm256_add_epi16(step3[ 3], step3[ 0]); - step1[ 1] = _mm256_add_epi16(step3[ 2], step3[ 1]); - step1[ 2] = _mm256_sub_epi16(step3[ 1], step3[ 2]); - step1[ 3] = _mm256_sub_epi16(step3[ 0], step3[ 3]); - step1[ 8] = _mm256_add_epi16(step3[11], step2[ 8]); - step1[ 9] = _mm256_add_epi16(step3[10], step2[ 9]); - step1[10] = _mm256_sub_epi16(step2[ 9], step3[10]); - step1[11] = _mm256_sub_epi16(step2[ 8], step3[11]); - step1[12] = _mm256_sub_epi16(step2[15], step3[12]); - step1[13] = _mm256_sub_epi16(step2[14], step3[13]); - step1[14] = _mm256_add_epi16(step3[13], step2[14]); - step1[15] = _mm256_add_epi16(step3[12], step2[15]); - } - { - const __m256i s1_05_0 = _mm256_unpacklo_epi16(step3[6], step3[5]); - const __m256i s1_05_1 = _mm256_unpackhi_epi16(step3[6], step3[5]); - const __m256i s1_05_2 = _mm256_madd_epi16(s1_05_0, k__cospi_p16_m16); - const __m256i s1_05_3 = _mm256_madd_epi16(s1_05_1, k__cospi_p16_m16); - const __m256i s1_06_2 = _mm256_madd_epi16(s1_05_0, k__cospi_p16_p16); - const __m256i s1_06_3 = _mm256_madd_epi16(s1_05_1, k__cospi_p16_p16); - // dct_const_round_shift - const __m256i s1_05_4 = _mm256_add_epi32(s1_05_2, k__DCT_CONST_ROUNDING); - const __m256i s1_05_5 = _mm256_add_epi32(s1_05_3, k__DCT_CONST_ROUNDING); - const __m256i s1_06_4 = _mm256_add_epi32(s1_06_2, k__DCT_CONST_ROUNDING); - const __m256i s1_06_5 = _mm256_add_epi32(s1_06_3, k__DCT_CONST_ROUNDING); - const __m256i s1_05_6 = _mm256_srai_epi32(s1_05_4, DCT_CONST_BITS); - const __m256i s1_05_7 = _mm256_srai_epi32(s1_05_5, DCT_CONST_BITS); - const __m256i s1_06_6 = _mm256_srai_epi32(s1_06_4, DCT_CONST_BITS); - const __m256i s1_06_7 = _mm256_srai_epi32(s1_06_5, DCT_CONST_BITS); - // Combine - step1[5] = _mm256_packs_epi32(s1_05_6, s1_05_7); - step1[6] = _mm256_packs_epi32(s1_06_6, s1_06_7); - } - { - const __m256i s1_18_0 = _mm256_unpacklo_epi16(step3[18], step3[29]); - const __m256i s1_18_1 = _mm256_unpackhi_epi16(step3[18], step3[29]); - const __m256i s1_19_0 = _mm256_unpacklo_epi16(step3[19], step3[28]); - const __m256i s1_19_1 = _mm256_unpackhi_epi16(step3[19], step3[28]); - const __m256i s1_20_0 = _mm256_unpacklo_epi16(step3[20], step3[27]); - const __m256i s1_20_1 = _mm256_unpackhi_epi16(step3[20], step3[27]); - const __m256i s1_21_0 = _mm256_unpacklo_epi16(step3[21], step3[26]); - const __m256i s1_21_1 = _mm256_unpackhi_epi16(step3[21], step3[26]); - const __m256i s1_18_2 = _mm256_madd_epi16(s1_18_0, k__cospi_m08_p24); - const __m256i s1_18_3 = _mm256_madd_epi16(s1_18_1, k__cospi_m08_p24); - const __m256i s1_19_2 = _mm256_madd_epi16(s1_19_0, k__cospi_m08_p24); - const __m256i s1_19_3 = _mm256_madd_epi16(s1_19_1, k__cospi_m08_p24); - const __m256i s1_20_2 = _mm256_madd_epi16(s1_20_0, k__cospi_m24_m08); - const __m256i s1_20_3 = _mm256_madd_epi16(s1_20_1, k__cospi_m24_m08); - const __m256i s1_21_2 = _mm256_madd_epi16(s1_21_0, k__cospi_m24_m08); - const __m256i s1_21_3 = _mm256_madd_epi16(s1_21_1, k__cospi_m24_m08); - const __m256i s1_26_2 = _mm256_madd_epi16(s1_21_0, k__cospi_m08_p24); - const __m256i s1_26_3 = _mm256_madd_epi16(s1_21_1, k__cospi_m08_p24); - const __m256i s1_27_2 = _mm256_madd_epi16(s1_20_0, k__cospi_m08_p24); - const __m256i s1_27_3 = _mm256_madd_epi16(s1_20_1, k__cospi_m08_p24); - const __m256i s1_28_2 = _mm256_madd_epi16(s1_19_0, k__cospi_p24_p08); - const __m256i s1_28_3 = _mm256_madd_epi16(s1_19_1, k__cospi_p24_p08); - const __m256i s1_29_2 = _mm256_madd_epi16(s1_18_0, k__cospi_p24_p08); - const __m256i s1_29_3 = _mm256_madd_epi16(s1_18_1, k__cospi_p24_p08); - // dct_const_round_shift - const __m256i s1_18_4 = _mm256_add_epi32(s1_18_2, k__DCT_CONST_ROUNDING); - const __m256i s1_18_5 = _mm256_add_epi32(s1_18_3, k__DCT_CONST_ROUNDING); - const __m256i s1_19_4 = _mm256_add_epi32(s1_19_2, k__DCT_CONST_ROUNDING); - const __m256i s1_19_5 = _mm256_add_epi32(s1_19_3, k__DCT_CONST_ROUNDING); - const __m256i s1_20_4 = _mm256_add_epi32(s1_20_2, k__DCT_CONST_ROUNDING); - const __m256i s1_20_5 = _mm256_add_epi32(s1_20_3, k__DCT_CONST_ROUNDING); - const __m256i s1_21_4 = _mm256_add_epi32(s1_21_2, k__DCT_CONST_ROUNDING); - const __m256i s1_21_5 = _mm256_add_epi32(s1_21_3, k__DCT_CONST_ROUNDING); - const __m256i s1_26_4 = _mm256_add_epi32(s1_26_2, k__DCT_CONST_ROUNDING); - const __m256i s1_26_5 = _mm256_add_epi32(s1_26_3, k__DCT_CONST_ROUNDING); - const __m256i s1_27_4 = _mm256_add_epi32(s1_27_2, k__DCT_CONST_ROUNDING); - const __m256i s1_27_5 = _mm256_add_epi32(s1_27_3, k__DCT_CONST_ROUNDING); - const __m256i s1_28_4 = _mm256_add_epi32(s1_28_2, k__DCT_CONST_ROUNDING); - const __m256i s1_28_5 = _mm256_add_epi32(s1_28_3, k__DCT_CONST_ROUNDING); - const __m256i s1_29_4 = _mm256_add_epi32(s1_29_2, k__DCT_CONST_ROUNDING); - const __m256i s1_29_5 = _mm256_add_epi32(s1_29_3, k__DCT_CONST_ROUNDING); - const __m256i s1_18_6 = _mm256_srai_epi32(s1_18_4, DCT_CONST_BITS); - const __m256i s1_18_7 = _mm256_srai_epi32(s1_18_5, DCT_CONST_BITS); - const __m256i s1_19_6 = _mm256_srai_epi32(s1_19_4, DCT_CONST_BITS); - const __m256i s1_19_7 = _mm256_srai_epi32(s1_19_5, DCT_CONST_BITS); - const __m256i s1_20_6 = _mm256_srai_epi32(s1_20_4, DCT_CONST_BITS); - const __m256i s1_20_7 = _mm256_srai_epi32(s1_20_5, DCT_CONST_BITS); - const __m256i s1_21_6 = _mm256_srai_epi32(s1_21_4, DCT_CONST_BITS); - const __m256i s1_21_7 = _mm256_srai_epi32(s1_21_5, DCT_CONST_BITS); - const __m256i s1_26_6 = _mm256_srai_epi32(s1_26_4, DCT_CONST_BITS); - const __m256i s1_26_7 = _mm256_srai_epi32(s1_26_5, DCT_CONST_BITS); - const __m256i s1_27_6 = _mm256_srai_epi32(s1_27_4, DCT_CONST_BITS); - const __m256i s1_27_7 = _mm256_srai_epi32(s1_27_5, DCT_CONST_BITS); - const __m256i s1_28_6 = _mm256_srai_epi32(s1_28_4, DCT_CONST_BITS); - const __m256i s1_28_7 = _mm256_srai_epi32(s1_28_5, DCT_CONST_BITS); - const __m256i s1_29_6 = _mm256_srai_epi32(s1_29_4, DCT_CONST_BITS); - const __m256i s1_29_7 = _mm256_srai_epi32(s1_29_5, DCT_CONST_BITS); - // Combine - step1[18] = _mm256_packs_epi32(s1_18_6, s1_18_7); - step1[19] = _mm256_packs_epi32(s1_19_6, s1_19_7); - step1[20] = _mm256_packs_epi32(s1_20_6, s1_20_7); - step1[21] = _mm256_packs_epi32(s1_21_6, s1_21_7); - step1[26] = _mm256_packs_epi32(s1_26_6, s1_26_7); - step1[27] = _mm256_packs_epi32(s1_27_6, s1_27_7); - step1[28] = _mm256_packs_epi32(s1_28_6, s1_28_7); - step1[29] = _mm256_packs_epi32(s1_29_6, s1_29_7); - } - // Stage 5 - { - step2[4] = _mm256_add_epi16(step1[5], step3[4]); - step2[5] = _mm256_sub_epi16(step3[4], step1[5]); - step2[6] = _mm256_sub_epi16(step3[7], step1[6]); - step2[7] = _mm256_add_epi16(step1[6], step3[7]); - } - { - const __m256i out_00_0 = _mm256_unpacklo_epi16(step1[0], step1[1]); - const __m256i out_00_1 = _mm256_unpackhi_epi16(step1[0], step1[1]); - const __m256i out_08_0 = _mm256_unpacklo_epi16(step1[2], step1[3]); - const __m256i out_08_1 = _mm256_unpackhi_epi16(step1[2], step1[3]); - const __m256i out_00_2 = _mm256_madd_epi16(out_00_0, k__cospi_p16_p16); - const __m256i out_00_3 = _mm256_madd_epi16(out_00_1, k__cospi_p16_p16); - const __m256i out_16_2 = _mm256_madd_epi16(out_00_0, k__cospi_p16_m16); - const __m256i out_16_3 = _mm256_madd_epi16(out_00_1, k__cospi_p16_m16); - const __m256i out_08_2 = _mm256_madd_epi16(out_08_0, k__cospi_p24_p08); - const __m256i out_08_3 = _mm256_madd_epi16(out_08_1, k__cospi_p24_p08); - const __m256i out_24_2 = _mm256_madd_epi16(out_08_0, k__cospi_m08_p24); - const __m256i out_24_3 = _mm256_madd_epi16(out_08_1, k__cospi_m08_p24); - // dct_const_round_shift - const __m256i out_00_4 = _mm256_add_epi32(out_00_2, k__DCT_CONST_ROUNDING); - const __m256i out_00_5 = _mm256_add_epi32(out_00_3, k__DCT_CONST_ROUNDING); - const __m256i out_16_4 = _mm256_add_epi32(out_16_2, k__DCT_CONST_ROUNDING); - const __m256i out_16_5 = _mm256_add_epi32(out_16_3, k__DCT_CONST_ROUNDING); - const __m256i out_08_4 = _mm256_add_epi32(out_08_2, k__DCT_CONST_ROUNDING); - const __m256i out_08_5 = _mm256_add_epi32(out_08_3, k__DCT_CONST_ROUNDING); - const __m256i out_24_4 = _mm256_add_epi32(out_24_2, k__DCT_CONST_ROUNDING); - const __m256i out_24_5 = _mm256_add_epi32(out_24_3, k__DCT_CONST_ROUNDING); - const __m256i out_00_6 = _mm256_srai_epi32(out_00_4, DCT_CONST_BITS); - const __m256i out_00_7 = _mm256_srai_epi32(out_00_5, DCT_CONST_BITS); - const __m256i out_16_6 = _mm256_srai_epi32(out_16_4, DCT_CONST_BITS); - const __m256i out_16_7 = _mm256_srai_epi32(out_16_5, DCT_CONST_BITS); - const __m256i out_08_6 = _mm256_srai_epi32(out_08_4, DCT_CONST_BITS); - const __m256i out_08_7 = _mm256_srai_epi32(out_08_5, DCT_CONST_BITS); - const __m256i out_24_6 = _mm256_srai_epi32(out_24_4, DCT_CONST_BITS); - const __m256i out_24_7 = _mm256_srai_epi32(out_24_5, DCT_CONST_BITS); - // Combine - out[ 0] = _mm256_packs_epi32(out_00_6, out_00_7); - out[16] = _mm256_packs_epi32(out_16_6, out_16_7); - out[ 8] = _mm256_packs_epi32(out_08_6, out_08_7); - out[24] = _mm256_packs_epi32(out_24_6, out_24_7); - } - { - const __m256i s2_09_0 = _mm256_unpacklo_epi16(step1[ 9], step1[14]); - const __m256i s2_09_1 = _mm256_unpackhi_epi16(step1[ 9], step1[14]); - const __m256i s2_10_0 = _mm256_unpacklo_epi16(step1[10], step1[13]); - const __m256i s2_10_1 = _mm256_unpackhi_epi16(step1[10], step1[13]); - const __m256i s2_09_2 = _mm256_madd_epi16(s2_09_0, k__cospi_m08_p24); - const __m256i s2_09_3 = _mm256_madd_epi16(s2_09_1, k__cospi_m08_p24); - const __m256i s2_10_2 = _mm256_madd_epi16(s2_10_0, k__cospi_m24_m08); - const __m256i s2_10_3 = _mm256_madd_epi16(s2_10_1, k__cospi_m24_m08); - const __m256i s2_13_2 = _mm256_madd_epi16(s2_10_0, k__cospi_m08_p24); - const __m256i s2_13_3 = _mm256_madd_epi16(s2_10_1, k__cospi_m08_p24); - const __m256i s2_14_2 = _mm256_madd_epi16(s2_09_0, k__cospi_p24_p08); - const __m256i s2_14_3 = _mm256_madd_epi16(s2_09_1, k__cospi_p24_p08); - // dct_const_round_shift - const __m256i s2_09_4 = _mm256_add_epi32(s2_09_2, k__DCT_CONST_ROUNDING); - const __m256i s2_09_5 = _mm256_add_epi32(s2_09_3, k__DCT_CONST_ROUNDING); - const __m256i s2_10_4 = _mm256_add_epi32(s2_10_2, k__DCT_CONST_ROUNDING); - const __m256i s2_10_5 = _mm256_add_epi32(s2_10_3, k__DCT_CONST_ROUNDING); - const __m256i s2_13_4 = _mm256_add_epi32(s2_13_2, k__DCT_CONST_ROUNDING); - const __m256i s2_13_5 = _mm256_add_epi32(s2_13_3, k__DCT_CONST_ROUNDING); - const __m256i s2_14_4 = _mm256_add_epi32(s2_14_2, k__DCT_CONST_ROUNDING); - const __m256i s2_14_5 = _mm256_add_epi32(s2_14_3, k__DCT_CONST_ROUNDING); - const __m256i s2_09_6 = _mm256_srai_epi32(s2_09_4, DCT_CONST_BITS); - const __m256i s2_09_7 = _mm256_srai_epi32(s2_09_5, DCT_CONST_BITS); - const __m256i s2_10_6 = _mm256_srai_epi32(s2_10_4, DCT_CONST_BITS); - const __m256i s2_10_7 = _mm256_srai_epi32(s2_10_5, DCT_CONST_BITS); - const __m256i s2_13_6 = _mm256_srai_epi32(s2_13_4, DCT_CONST_BITS); - const __m256i s2_13_7 = _mm256_srai_epi32(s2_13_5, DCT_CONST_BITS); - const __m256i s2_14_6 = _mm256_srai_epi32(s2_14_4, DCT_CONST_BITS); - const __m256i s2_14_7 = _mm256_srai_epi32(s2_14_5, DCT_CONST_BITS); - // Combine - step2[ 9] = _mm256_packs_epi32(s2_09_6, s2_09_7); - step2[10] = _mm256_packs_epi32(s2_10_6, s2_10_7); - step2[13] = _mm256_packs_epi32(s2_13_6, s2_13_7); - step2[14] = _mm256_packs_epi32(s2_14_6, s2_14_7); - } - { - step2[16] = _mm256_add_epi16(step1[19], step3[16]); - step2[17] = _mm256_add_epi16(step1[18], step3[17]); - step2[18] = _mm256_sub_epi16(step3[17], step1[18]); - step2[19] = _mm256_sub_epi16(step3[16], step1[19]); - step2[20] = _mm256_sub_epi16(step3[23], step1[20]); - step2[21] = _mm256_sub_epi16(step3[22], step1[21]); - step2[22] = _mm256_add_epi16(step1[21], step3[22]); - step2[23] = _mm256_add_epi16(step1[20], step3[23]); - step2[24] = _mm256_add_epi16(step1[27], step3[24]); - step2[25] = _mm256_add_epi16(step1[26], step3[25]); - step2[26] = _mm256_sub_epi16(step3[25], step1[26]); - step2[27] = _mm256_sub_epi16(step3[24], step1[27]); - step2[28] = _mm256_sub_epi16(step3[31], step1[28]); - step2[29] = _mm256_sub_epi16(step3[30], step1[29]); - step2[30] = _mm256_add_epi16(step1[29], step3[30]); - step2[31] = _mm256_add_epi16(step1[28], step3[31]); - } - // Stage 6 - { - const __m256i out_04_0 = _mm256_unpacklo_epi16(step2[4], step2[7]); - const __m256i out_04_1 = _mm256_unpackhi_epi16(step2[4], step2[7]); - const __m256i out_20_0 = _mm256_unpacklo_epi16(step2[5], step2[6]); - const __m256i out_20_1 = _mm256_unpackhi_epi16(step2[5], step2[6]); - const __m256i out_12_0 = _mm256_unpacklo_epi16(step2[5], step2[6]); - const __m256i out_12_1 = _mm256_unpackhi_epi16(step2[5], step2[6]); - const __m256i out_28_0 = _mm256_unpacklo_epi16(step2[4], step2[7]); - const __m256i out_28_1 = _mm256_unpackhi_epi16(step2[4], step2[7]); - const __m256i out_04_2 = _mm256_madd_epi16(out_04_0, k__cospi_p28_p04); - const __m256i out_04_3 = _mm256_madd_epi16(out_04_1, k__cospi_p28_p04); - const __m256i out_20_2 = _mm256_madd_epi16(out_20_0, k__cospi_p12_p20); - const __m256i out_20_3 = _mm256_madd_epi16(out_20_1, k__cospi_p12_p20); - const __m256i out_12_2 = _mm256_madd_epi16(out_12_0, k__cospi_m20_p12); - const __m256i out_12_3 = _mm256_madd_epi16(out_12_1, k__cospi_m20_p12); - const __m256i out_28_2 = _mm256_madd_epi16(out_28_0, k__cospi_m04_p28); - const __m256i out_28_3 = _mm256_madd_epi16(out_28_1, k__cospi_m04_p28); - // dct_const_round_shift - const __m256i out_04_4 = _mm256_add_epi32(out_04_2, k__DCT_CONST_ROUNDING); - const __m256i out_04_5 = _mm256_add_epi32(out_04_3, k__DCT_CONST_ROUNDING); - const __m256i out_20_4 = _mm256_add_epi32(out_20_2, k__DCT_CONST_ROUNDING); - const __m256i out_20_5 = _mm256_add_epi32(out_20_3, k__DCT_CONST_ROUNDING); - const __m256i out_12_4 = _mm256_add_epi32(out_12_2, k__DCT_CONST_ROUNDING); - const __m256i out_12_5 = _mm256_add_epi32(out_12_3, k__DCT_CONST_ROUNDING); - const __m256i out_28_4 = _mm256_add_epi32(out_28_2, k__DCT_CONST_ROUNDING); - const __m256i out_28_5 = _mm256_add_epi32(out_28_3, k__DCT_CONST_ROUNDING); - const __m256i out_04_6 = _mm256_srai_epi32(out_04_4, DCT_CONST_BITS); - const __m256i out_04_7 = _mm256_srai_epi32(out_04_5, DCT_CONST_BITS); - const __m256i out_20_6 = _mm256_srai_epi32(out_20_4, DCT_CONST_BITS); - const __m256i out_20_7 = _mm256_srai_epi32(out_20_5, DCT_CONST_BITS); - const __m256i out_12_6 = _mm256_srai_epi32(out_12_4, DCT_CONST_BITS); - const __m256i out_12_7 = _mm256_srai_epi32(out_12_5, DCT_CONST_BITS); - const __m256i out_28_6 = _mm256_srai_epi32(out_28_4, DCT_CONST_BITS); - const __m256i out_28_7 = _mm256_srai_epi32(out_28_5, DCT_CONST_BITS); - // Combine - out[ 4] = _mm256_packs_epi32(out_04_6, out_04_7); - out[20] = _mm256_packs_epi32(out_20_6, out_20_7); - out[12] = _mm256_packs_epi32(out_12_6, out_12_7); - out[28] = _mm256_packs_epi32(out_28_6, out_28_7); - } - { - step3[ 8] = _mm256_add_epi16(step2[ 9], step1[ 8]); - step3[ 9] = _mm256_sub_epi16(step1[ 8], step2[ 9]); - step3[10] = _mm256_sub_epi16(step1[11], step2[10]); - step3[11] = _mm256_add_epi16(step2[10], step1[11]); - step3[12] = _mm256_add_epi16(step2[13], step1[12]); - step3[13] = _mm256_sub_epi16(step1[12], step2[13]); - step3[14] = _mm256_sub_epi16(step1[15], step2[14]); - step3[15] = _mm256_add_epi16(step2[14], step1[15]); - } - { - const __m256i s3_17_0 = _mm256_unpacklo_epi16(step2[17], step2[30]); - const __m256i s3_17_1 = _mm256_unpackhi_epi16(step2[17], step2[30]); - const __m256i s3_18_0 = _mm256_unpacklo_epi16(step2[18], step2[29]); - const __m256i s3_18_1 = _mm256_unpackhi_epi16(step2[18], step2[29]); - const __m256i s3_21_0 = _mm256_unpacklo_epi16(step2[21], step2[26]); - const __m256i s3_21_1 = _mm256_unpackhi_epi16(step2[21], step2[26]); - const __m256i s3_22_0 = _mm256_unpacklo_epi16(step2[22], step2[25]); - const __m256i s3_22_1 = _mm256_unpackhi_epi16(step2[22], step2[25]); - const __m256i s3_17_2 = _mm256_madd_epi16(s3_17_0, k__cospi_m04_p28); - const __m256i s3_17_3 = _mm256_madd_epi16(s3_17_1, k__cospi_m04_p28); - const __m256i s3_18_2 = _mm256_madd_epi16(s3_18_0, k__cospi_m28_m04); - const __m256i s3_18_3 = _mm256_madd_epi16(s3_18_1, k__cospi_m28_m04); - const __m256i s3_21_2 = _mm256_madd_epi16(s3_21_0, k__cospi_m20_p12); - const __m256i s3_21_3 = _mm256_madd_epi16(s3_21_1, k__cospi_m20_p12); - const __m256i s3_22_2 = _mm256_madd_epi16(s3_22_0, k__cospi_m12_m20); - const __m256i s3_22_3 = _mm256_madd_epi16(s3_22_1, k__cospi_m12_m20); - const __m256i s3_25_2 = _mm256_madd_epi16(s3_22_0, k__cospi_m20_p12); - const __m256i s3_25_3 = _mm256_madd_epi16(s3_22_1, k__cospi_m20_p12); - const __m256i s3_26_2 = _mm256_madd_epi16(s3_21_0, k__cospi_p12_p20); - const __m256i s3_26_3 = _mm256_madd_epi16(s3_21_1, k__cospi_p12_p20); - const __m256i s3_29_2 = _mm256_madd_epi16(s3_18_0, k__cospi_m04_p28); - const __m256i s3_29_3 = _mm256_madd_epi16(s3_18_1, k__cospi_m04_p28); - const __m256i s3_30_2 = _mm256_madd_epi16(s3_17_0, k__cospi_p28_p04); - const __m256i s3_30_3 = _mm256_madd_epi16(s3_17_1, k__cospi_p28_p04); - // dct_const_round_shift - const __m256i s3_17_4 = _mm256_add_epi32(s3_17_2, k__DCT_CONST_ROUNDING); - const __m256i s3_17_5 = _mm256_add_epi32(s3_17_3, k__DCT_CONST_ROUNDING); - const __m256i s3_18_4 = _mm256_add_epi32(s3_18_2, k__DCT_CONST_ROUNDING); - const __m256i s3_18_5 = _mm256_add_epi32(s3_18_3, k__DCT_CONST_ROUNDING); - const __m256i s3_21_4 = _mm256_add_epi32(s3_21_2, k__DCT_CONST_ROUNDING); - const __m256i s3_21_5 = _mm256_add_epi32(s3_21_3, k__DCT_CONST_ROUNDING); - const __m256i s3_22_4 = _mm256_add_epi32(s3_22_2, k__DCT_CONST_ROUNDING); - const __m256i s3_22_5 = _mm256_add_epi32(s3_22_3, k__DCT_CONST_ROUNDING); - const __m256i s3_17_6 = _mm256_srai_epi32(s3_17_4, DCT_CONST_BITS); - const __m256i s3_17_7 = _mm256_srai_epi32(s3_17_5, DCT_CONST_BITS); - const __m256i s3_18_6 = _mm256_srai_epi32(s3_18_4, DCT_CONST_BITS); - const __m256i s3_18_7 = _mm256_srai_epi32(s3_18_5, DCT_CONST_BITS); - const __m256i s3_21_6 = _mm256_srai_epi32(s3_21_4, DCT_CONST_BITS); - const __m256i s3_21_7 = _mm256_srai_epi32(s3_21_5, DCT_CONST_BITS); - const __m256i s3_22_6 = _mm256_srai_epi32(s3_22_4, DCT_CONST_BITS); - const __m256i s3_22_7 = _mm256_srai_epi32(s3_22_5, DCT_CONST_BITS); - const __m256i s3_25_4 = _mm256_add_epi32(s3_25_2, k__DCT_CONST_ROUNDING); - const __m256i s3_25_5 = _mm256_add_epi32(s3_25_3, k__DCT_CONST_ROUNDING); - const __m256i s3_26_4 = _mm256_add_epi32(s3_26_2, k__DCT_CONST_ROUNDING); - const __m256i s3_26_5 = _mm256_add_epi32(s3_26_3, k__DCT_CONST_ROUNDING); - const __m256i s3_29_4 = _mm256_add_epi32(s3_29_2, k__DCT_CONST_ROUNDING); - const __m256i s3_29_5 = _mm256_add_epi32(s3_29_3, k__DCT_CONST_ROUNDING); - const __m256i s3_30_4 = _mm256_add_epi32(s3_30_2, k__DCT_CONST_ROUNDING); - const __m256i s3_30_5 = _mm256_add_epi32(s3_30_3, k__DCT_CONST_ROUNDING); - const __m256i s3_25_6 = _mm256_srai_epi32(s3_25_4, DCT_CONST_BITS); - const __m256i s3_25_7 = _mm256_srai_epi32(s3_25_5, DCT_CONST_BITS); - const __m256i s3_26_6 = _mm256_srai_epi32(s3_26_4, DCT_CONST_BITS); - const __m256i s3_26_7 = _mm256_srai_epi32(s3_26_5, DCT_CONST_BITS); - const __m256i s3_29_6 = _mm256_srai_epi32(s3_29_4, DCT_CONST_BITS); - const __m256i s3_29_7 = _mm256_srai_epi32(s3_29_5, DCT_CONST_BITS); - const __m256i s3_30_6 = _mm256_srai_epi32(s3_30_4, DCT_CONST_BITS); - const __m256i s3_30_7 = _mm256_srai_epi32(s3_30_5, DCT_CONST_BITS); - // Combine - step3[17] = _mm256_packs_epi32(s3_17_6, s3_17_7); - step3[18] = _mm256_packs_epi32(s3_18_6, s3_18_7); - step3[21] = _mm256_packs_epi32(s3_21_6, s3_21_7); - step3[22] = _mm256_packs_epi32(s3_22_6, s3_22_7); - // Combine - step3[25] = _mm256_packs_epi32(s3_25_6, s3_25_7); - step3[26] = _mm256_packs_epi32(s3_26_6, s3_26_7); - step3[29] = _mm256_packs_epi32(s3_29_6, s3_29_7); - step3[30] = _mm256_packs_epi32(s3_30_6, s3_30_7); - } - // Stage 7 - { - const __m256i out_02_0 = _mm256_unpacklo_epi16(step3[ 8], step3[15]); - const __m256i out_02_1 = _mm256_unpackhi_epi16(step3[ 8], step3[15]); - const __m256i out_18_0 = _mm256_unpacklo_epi16(step3[ 9], step3[14]); - const __m256i out_18_1 = _mm256_unpackhi_epi16(step3[ 9], step3[14]); - const __m256i out_10_0 = _mm256_unpacklo_epi16(step3[10], step3[13]); - const __m256i out_10_1 = _mm256_unpackhi_epi16(step3[10], step3[13]); - const __m256i out_26_0 = _mm256_unpacklo_epi16(step3[11], step3[12]); - const __m256i out_26_1 = _mm256_unpackhi_epi16(step3[11], step3[12]); - const __m256i out_02_2 = _mm256_madd_epi16(out_02_0, k__cospi_p30_p02); - const __m256i out_02_3 = _mm256_madd_epi16(out_02_1, k__cospi_p30_p02); - const __m256i out_18_2 = _mm256_madd_epi16(out_18_0, k__cospi_p14_p18); - const __m256i out_18_3 = _mm256_madd_epi16(out_18_1, k__cospi_p14_p18); - const __m256i out_10_2 = _mm256_madd_epi16(out_10_0, k__cospi_p22_p10); - const __m256i out_10_3 = _mm256_madd_epi16(out_10_1, k__cospi_p22_p10); - const __m256i out_26_2 = _mm256_madd_epi16(out_26_0, k__cospi_p06_p26); - const __m256i out_26_3 = _mm256_madd_epi16(out_26_1, k__cospi_p06_p26); - const __m256i out_06_2 = _mm256_madd_epi16(out_26_0, k__cospi_m26_p06); - const __m256i out_06_3 = _mm256_madd_epi16(out_26_1, k__cospi_m26_p06); - const __m256i out_22_2 = _mm256_madd_epi16(out_10_0, k__cospi_m10_p22); - const __m256i out_22_3 = _mm256_madd_epi16(out_10_1, k__cospi_m10_p22); - const __m256i out_14_2 = _mm256_madd_epi16(out_18_0, k__cospi_m18_p14); - const __m256i out_14_3 = _mm256_madd_epi16(out_18_1, k__cospi_m18_p14); - const __m256i out_30_2 = _mm256_madd_epi16(out_02_0, k__cospi_m02_p30); - const __m256i out_30_3 = _mm256_madd_epi16(out_02_1, k__cospi_m02_p30); - // dct_const_round_shift - const __m256i out_02_4 = _mm256_add_epi32(out_02_2, k__DCT_CONST_ROUNDING); - const __m256i out_02_5 = _mm256_add_epi32(out_02_3, k__DCT_CONST_ROUNDING); - const __m256i out_18_4 = _mm256_add_epi32(out_18_2, k__DCT_CONST_ROUNDING); - const __m256i out_18_5 = _mm256_add_epi32(out_18_3, k__DCT_CONST_ROUNDING); - const __m256i out_10_4 = _mm256_add_epi32(out_10_2, k__DCT_CONST_ROUNDING); - const __m256i out_10_5 = _mm256_add_epi32(out_10_3, k__DCT_CONST_ROUNDING); - const __m256i out_26_4 = _mm256_add_epi32(out_26_2, k__DCT_CONST_ROUNDING); - const __m256i out_26_5 = _mm256_add_epi32(out_26_3, k__DCT_CONST_ROUNDING); - const __m256i out_06_4 = _mm256_add_epi32(out_06_2, k__DCT_CONST_ROUNDING); - const __m256i out_06_5 = _mm256_add_epi32(out_06_3, k__DCT_CONST_ROUNDING); - const __m256i out_22_4 = _mm256_add_epi32(out_22_2, k__DCT_CONST_ROUNDING); - const __m256i out_22_5 = _mm256_add_epi32(out_22_3, k__DCT_CONST_ROUNDING); - const __m256i out_14_4 = _mm256_add_epi32(out_14_2, k__DCT_CONST_ROUNDING); - const __m256i out_14_5 = _mm256_add_epi32(out_14_3, k__DCT_CONST_ROUNDING); - const __m256i out_30_4 = _mm256_add_epi32(out_30_2, k__DCT_CONST_ROUNDING); - const __m256i out_30_5 = _mm256_add_epi32(out_30_3, k__DCT_CONST_ROUNDING); - const __m256i out_02_6 = _mm256_srai_epi32(out_02_4, DCT_CONST_BITS); - const __m256i out_02_7 = _mm256_srai_epi32(out_02_5, DCT_CONST_BITS); - const __m256i out_18_6 = _mm256_srai_epi32(out_18_4, DCT_CONST_BITS); - const __m256i out_18_7 = _mm256_srai_epi32(out_18_5, DCT_CONST_BITS); - const __m256i out_10_6 = _mm256_srai_epi32(out_10_4, DCT_CONST_BITS); - const __m256i out_10_7 = _mm256_srai_epi32(out_10_5, DCT_CONST_BITS); - const __m256i out_26_6 = _mm256_srai_epi32(out_26_4, DCT_CONST_BITS); - const __m256i out_26_7 = _mm256_srai_epi32(out_26_5, DCT_CONST_BITS); - const __m256i out_06_6 = _mm256_srai_epi32(out_06_4, DCT_CONST_BITS); - const __m256i out_06_7 = _mm256_srai_epi32(out_06_5, DCT_CONST_BITS); - const __m256i out_22_6 = _mm256_srai_epi32(out_22_4, DCT_CONST_BITS); - const __m256i out_22_7 = _mm256_srai_epi32(out_22_5, DCT_CONST_BITS); - const __m256i out_14_6 = _mm256_srai_epi32(out_14_4, DCT_CONST_BITS); - const __m256i out_14_7 = _mm256_srai_epi32(out_14_5, DCT_CONST_BITS); - const __m256i out_30_6 = _mm256_srai_epi32(out_30_4, DCT_CONST_BITS); - const __m256i out_30_7 = _mm256_srai_epi32(out_30_5, DCT_CONST_BITS); - // Combine - out[ 2] = _mm256_packs_epi32(out_02_6, out_02_7); - out[18] = _mm256_packs_epi32(out_18_6, out_18_7); - out[10] = _mm256_packs_epi32(out_10_6, out_10_7); - out[26] = _mm256_packs_epi32(out_26_6, out_26_7); - out[ 6] = _mm256_packs_epi32(out_06_6, out_06_7); - out[22] = _mm256_packs_epi32(out_22_6, out_22_7); - out[14] = _mm256_packs_epi32(out_14_6, out_14_7); - out[30] = _mm256_packs_epi32(out_30_6, out_30_7); - } - { - step1[16] = _mm256_add_epi16(step3[17], step2[16]); - step1[17] = _mm256_sub_epi16(step2[16], step3[17]); - step1[18] = _mm256_sub_epi16(step2[19], step3[18]); - step1[19] = _mm256_add_epi16(step3[18], step2[19]); - step1[20] = _mm256_add_epi16(step3[21], step2[20]); - step1[21] = _mm256_sub_epi16(step2[20], step3[21]); - step1[22] = _mm256_sub_epi16(step2[23], step3[22]); - step1[23] = _mm256_add_epi16(step3[22], step2[23]); - step1[24] = _mm256_add_epi16(step3[25], step2[24]); - step1[25] = _mm256_sub_epi16(step2[24], step3[25]); - step1[26] = _mm256_sub_epi16(step2[27], step3[26]); - step1[27] = _mm256_add_epi16(step3[26], step2[27]); - step1[28] = _mm256_add_epi16(step3[29], step2[28]); - step1[29] = _mm256_sub_epi16(step2[28], step3[29]); - step1[30] = _mm256_sub_epi16(step2[31], step3[30]); - step1[31] = _mm256_add_epi16(step3[30], step2[31]); - } - // Final stage --- outputs indices are bit-reversed. - { - const __m256i out_01_0 = _mm256_unpacklo_epi16(step1[16], step1[31]); - const __m256i out_01_1 = _mm256_unpackhi_epi16(step1[16], step1[31]); - const __m256i out_17_0 = _mm256_unpacklo_epi16(step1[17], step1[30]); - const __m256i out_17_1 = _mm256_unpackhi_epi16(step1[17], step1[30]); - const __m256i out_09_0 = _mm256_unpacklo_epi16(step1[18], step1[29]); - const __m256i out_09_1 = _mm256_unpackhi_epi16(step1[18], step1[29]); - const __m256i out_25_0 = _mm256_unpacklo_epi16(step1[19], step1[28]); - const __m256i out_25_1 = _mm256_unpackhi_epi16(step1[19], step1[28]); - const __m256i out_01_2 = _mm256_madd_epi16(out_01_0, k__cospi_p31_p01); - const __m256i out_01_3 = _mm256_madd_epi16(out_01_1, k__cospi_p31_p01); - const __m256i out_17_2 = _mm256_madd_epi16(out_17_0, k__cospi_p15_p17); - const __m256i out_17_3 = _mm256_madd_epi16(out_17_1, k__cospi_p15_p17); - const __m256i out_09_2 = _mm256_madd_epi16(out_09_0, k__cospi_p23_p09); - const __m256i out_09_3 = _mm256_madd_epi16(out_09_1, k__cospi_p23_p09); - const __m256i out_25_2 = _mm256_madd_epi16(out_25_0, k__cospi_p07_p25); - const __m256i out_25_3 = _mm256_madd_epi16(out_25_1, k__cospi_p07_p25); - const __m256i out_07_2 = _mm256_madd_epi16(out_25_0, k__cospi_m25_p07); - const __m256i out_07_3 = _mm256_madd_epi16(out_25_1, k__cospi_m25_p07); - const __m256i out_23_2 = _mm256_madd_epi16(out_09_0, k__cospi_m09_p23); - const __m256i out_23_3 = _mm256_madd_epi16(out_09_1, k__cospi_m09_p23); - const __m256i out_15_2 = _mm256_madd_epi16(out_17_0, k__cospi_m17_p15); - const __m256i out_15_3 = _mm256_madd_epi16(out_17_1, k__cospi_m17_p15); - const __m256i out_31_2 = _mm256_madd_epi16(out_01_0, k__cospi_m01_p31); - const __m256i out_31_3 = _mm256_madd_epi16(out_01_1, k__cospi_m01_p31); - // dct_const_round_shift - const __m256i out_01_4 = _mm256_add_epi32(out_01_2, k__DCT_CONST_ROUNDING); - const __m256i out_01_5 = _mm256_add_epi32(out_01_3, k__DCT_CONST_ROUNDING); - const __m256i out_17_4 = _mm256_add_epi32(out_17_2, k__DCT_CONST_ROUNDING); - const __m256i out_17_5 = _mm256_add_epi32(out_17_3, k__DCT_CONST_ROUNDING); - const __m256i out_09_4 = _mm256_add_epi32(out_09_2, k__DCT_CONST_ROUNDING); - const __m256i out_09_5 = _mm256_add_epi32(out_09_3, k__DCT_CONST_ROUNDING); - const __m256i out_25_4 = _mm256_add_epi32(out_25_2, k__DCT_CONST_ROUNDING); - const __m256i out_25_5 = _mm256_add_epi32(out_25_3, k__DCT_CONST_ROUNDING); - const __m256i out_07_4 = _mm256_add_epi32(out_07_2, k__DCT_CONST_ROUNDING); - const __m256i out_07_5 = _mm256_add_epi32(out_07_3, k__DCT_CONST_ROUNDING); - const __m256i out_23_4 = _mm256_add_epi32(out_23_2, k__DCT_CONST_ROUNDING); - const __m256i out_23_5 = _mm256_add_epi32(out_23_3, k__DCT_CONST_ROUNDING); - const __m256i out_15_4 = _mm256_add_epi32(out_15_2, k__DCT_CONST_ROUNDING); - const __m256i out_15_5 = _mm256_add_epi32(out_15_3, k__DCT_CONST_ROUNDING); - const __m256i out_31_4 = _mm256_add_epi32(out_31_2, k__DCT_CONST_ROUNDING); - const __m256i out_31_5 = _mm256_add_epi32(out_31_3, k__DCT_CONST_ROUNDING); - const __m256i out_01_6 = _mm256_srai_epi32(out_01_4, DCT_CONST_BITS); - const __m256i out_01_7 = _mm256_srai_epi32(out_01_5, DCT_CONST_BITS); - const __m256i out_17_6 = _mm256_srai_epi32(out_17_4, DCT_CONST_BITS); - const __m256i out_17_7 = _mm256_srai_epi32(out_17_5, DCT_CONST_BITS); - const __m256i out_09_6 = _mm256_srai_epi32(out_09_4, DCT_CONST_BITS); - const __m256i out_09_7 = _mm256_srai_epi32(out_09_5, DCT_CONST_BITS); - const __m256i out_25_6 = _mm256_srai_epi32(out_25_4, DCT_CONST_BITS); - const __m256i out_25_7 = _mm256_srai_epi32(out_25_5, DCT_CONST_BITS); - const __m256i out_07_6 = _mm256_srai_epi32(out_07_4, DCT_CONST_BITS); - const __m256i out_07_7 = _mm256_srai_epi32(out_07_5, DCT_CONST_BITS); - const __m256i out_23_6 = _mm256_srai_epi32(out_23_4, DCT_CONST_BITS); - const __m256i out_23_7 = _mm256_srai_epi32(out_23_5, DCT_CONST_BITS); - const __m256i out_15_6 = _mm256_srai_epi32(out_15_4, DCT_CONST_BITS); - const __m256i out_15_7 = _mm256_srai_epi32(out_15_5, DCT_CONST_BITS); - const __m256i out_31_6 = _mm256_srai_epi32(out_31_4, DCT_CONST_BITS); - const __m256i out_31_7 = _mm256_srai_epi32(out_31_5, DCT_CONST_BITS); - // Combine - out[ 1] = _mm256_packs_epi32(out_01_6, out_01_7); - out[17] = _mm256_packs_epi32(out_17_6, out_17_7); - out[ 9] = _mm256_packs_epi32(out_09_6, out_09_7); - out[25] = _mm256_packs_epi32(out_25_6, out_25_7); - out[ 7] = _mm256_packs_epi32(out_07_6, out_07_7); - out[23] = _mm256_packs_epi32(out_23_6, out_23_7); - out[15] = _mm256_packs_epi32(out_15_6, out_15_7); - out[31] = _mm256_packs_epi32(out_31_6, out_31_7); - } - { - const __m256i out_05_0 = _mm256_unpacklo_epi16(step1[20], step1[27]); - const __m256i out_05_1 = _mm256_unpackhi_epi16(step1[20], step1[27]); - const __m256i out_21_0 = _mm256_unpacklo_epi16(step1[21], step1[26]); - const __m256i out_21_1 = _mm256_unpackhi_epi16(step1[21], step1[26]); - const __m256i out_13_0 = _mm256_unpacklo_epi16(step1[22], step1[25]); - const __m256i out_13_1 = _mm256_unpackhi_epi16(step1[22], step1[25]); - const __m256i out_29_0 = _mm256_unpacklo_epi16(step1[23], step1[24]); - const __m256i out_29_1 = _mm256_unpackhi_epi16(step1[23], step1[24]); - const __m256i out_05_2 = _mm256_madd_epi16(out_05_0, k__cospi_p27_p05); - const __m256i out_05_3 = _mm256_madd_epi16(out_05_1, k__cospi_p27_p05); - const __m256i out_21_2 = _mm256_madd_epi16(out_21_0, k__cospi_p11_p21); - const __m256i out_21_3 = _mm256_madd_epi16(out_21_1, k__cospi_p11_p21); - const __m256i out_13_2 = _mm256_madd_epi16(out_13_0, k__cospi_p19_p13); - const __m256i out_13_3 = _mm256_madd_epi16(out_13_1, k__cospi_p19_p13); - const __m256i out_29_2 = _mm256_madd_epi16(out_29_0, k__cospi_p03_p29); - const __m256i out_29_3 = _mm256_madd_epi16(out_29_1, k__cospi_p03_p29); - const __m256i out_03_2 = _mm256_madd_epi16(out_29_0, k__cospi_m29_p03); - const __m256i out_03_3 = _mm256_madd_epi16(out_29_1, k__cospi_m29_p03); - const __m256i out_19_2 = _mm256_madd_epi16(out_13_0, k__cospi_m13_p19); - const __m256i out_19_3 = _mm256_madd_epi16(out_13_1, k__cospi_m13_p19); - const __m256i out_11_2 = _mm256_madd_epi16(out_21_0, k__cospi_m21_p11); - const __m256i out_11_3 = _mm256_madd_epi16(out_21_1, k__cospi_m21_p11); - const __m256i out_27_2 = _mm256_madd_epi16(out_05_0, k__cospi_m05_p27); - const __m256i out_27_3 = _mm256_madd_epi16(out_05_1, k__cospi_m05_p27); - // dct_const_round_shift - const __m256i out_05_4 = _mm256_add_epi32(out_05_2, k__DCT_CONST_ROUNDING); - const __m256i out_05_5 = _mm256_add_epi32(out_05_3, k__DCT_CONST_ROUNDING); - const __m256i out_21_4 = _mm256_add_epi32(out_21_2, k__DCT_CONST_ROUNDING); - const __m256i out_21_5 = _mm256_add_epi32(out_21_3, k__DCT_CONST_ROUNDING); - const __m256i out_13_4 = _mm256_add_epi32(out_13_2, k__DCT_CONST_ROUNDING); - const __m256i out_13_5 = _mm256_add_epi32(out_13_3, k__DCT_CONST_ROUNDING); - const __m256i out_29_4 = _mm256_add_epi32(out_29_2, k__DCT_CONST_ROUNDING); - const __m256i out_29_5 = _mm256_add_epi32(out_29_3, k__DCT_CONST_ROUNDING); - const __m256i out_03_4 = _mm256_add_epi32(out_03_2, k__DCT_CONST_ROUNDING); - const __m256i out_03_5 = _mm256_add_epi32(out_03_3, k__DCT_CONST_ROUNDING); - const __m256i out_19_4 = _mm256_add_epi32(out_19_2, k__DCT_CONST_ROUNDING); - const __m256i out_19_5 = _mm256_add_epi32(out_19_3, k__DCT_CONST_ROUNDING); - const __m256i out_11_4 = _mm256_add_epi32(out_11_2, k__DCT_CONST_ROUNDING); - const __m256i out_11_5 = _mm256_add_epi32(out_11_3, k__DCT_CONST_ROUNDING); - const __m256i out_27_4 = _mm256_add_epi32(out_27_2, k__DCT_CONST_ROUNDING); - const __m256i out_27_5 = _mm256_add_epi32(out_27_3, k__DCT_CONST_ROUNDING); - const __m256i out_05_6 = _mm256_srai_epi32(out_05_4, DCT_CONST_BITS); - const __m256i out_05_7 = _mm256_srai_epi32(out_05_5, DCT_CONST_BITS); - const __m256i out_21_6 = _mm256_srai_epi32(out_21_4, DCT_CONST_BITS); - const __m256i out_21_7 = _mm256_srai_epi32(out_21_5, DCT_CONST_BITS); - const __m256i out_13_6 = _mm256_srai_epi32(out_13_4, DCT_CONST_BITS); - const __m256i out_13_7 = _mm256_srai_epi32(out_13_5, DCT_CONST_BITS); - const __m256i out_29_6 = _mm256_srai_epi32(out_29_4, DCT_CONST_BITS); - const __m256i out_29_7 = _mm256_srai_epi32(out_29_5, DCT_CONST_BITS); - const __m256i out_03_6 = _mm256_srai_epi32(out_03_4, DCT_CONST_BITS); - const __m256i out_03_7 = _mm256_srai_epi32(out_03_5, DCT_CONST_BITS); - const __m256i out_19_6 = _mm256_srai_epi32(out_19_4, DCT_CONST_BITS); - const __m256i out_19_7 = _mm256_srai_epi32(out_19_5, DCT_CONST_BITS); - const __m256i out_11_6 = _mm256_srai_epi32(out_11_4, DCT_CONST_BITS); - const __m256i out_11_7 = _mm256_srai_epi32(out_11_5, DCT_CONST_BITS); - const __m256i out_27_6 = _mm256_srai_epi32(out_27_4, DCT_CONST_BITS); - const __m256i out_27_7 = _mm256_srai_epi32(out_27_5, DCT_CONST_BITS); - // Combine - out[ 5] = _mm256_packs_epi32(out_05_6, out_05_7); - out[21] = _mm256_packs_epi32(out_21_6, out_21_7); - out[13] = _mm256_packs_epi32(out_13_6, out_13_7); - out[29] = _mm256_packs_epi32(out_29_6, out_29_7); - out[ 3] = _mm256_packs_epi32(out_03_6, out_03_7); - out[19] = _mm256_packs_epi32(out_19_6, out_19_7); - out[11] = _mm256_packs_epi32(out_11_6, out_11_7); - out[27] = _mm256_packs_epi32(out_27_6, out_27_7); - } -#if FDCT32x32_HIGH_PRECISION - } else { - __m256i lstep1[64], lstep2[64], lstep3[64]; - __m256i u[32], v[32], sign[16]; - const __m256i K32One = _mm256_set_epi32(1, 1, 1, 1, 1, 1, 1, 1); - // start using 32-bit operations - // stage 3 - { - // expanding to 32-bit length priori to addition operations - lstep2[ 0] = _mm256_unpacklo_epi16(step2[ 0], kZero); - lstep2[ 1] = _mm256_unpackhi_epi16(step2[ 0], kZero); - lstep2[ 2] = _mm256_unpacklo_epi16(step2[ 1], kZero); - lstep2[ 3] = _mm256_unpackhi_epi16(step2[ 1], kZero); - lstep2[ 4] = _mm256_unpacklo_epi16(step2[ 2], kZero); - lstep2[ 5] = _mm256_unpackhi_epi16(step2[ 2], kZero); - lstep2[ 6] = _mm256_unpacklo_epi16(step2[ 3], kZero); - lstep2[ 7] = _mm256_unpackhi_epi16(step2[ 3], kZero); - lstep2[ 8] = _mm256_unpacklo_epi16(step2[ 4], kZero); - lstep2[ 9] = _mm256_unpackhi_epi16(step2[ 4], kZero); - lstep2[10] = _mm256_unpacklo_epi16(step2[ 5], kZero); - lstep2[11] = _mm256_unpackhi_epi16(step2[ 5], kZero); - lstep2[12] = _mm256_unpacklo_epi16(step2[ 6], kZero); - lstep2[13] = _mm256_unpackhi_epi16(step2[ 6], kZero); - lstep2[14] = _mm256_unpacklo_epi16(step2[ 7], kZero); - lstep2[15] = _mm256_unpackhi_epi16(step2[ 7], kZero); - lstep2[ 0] = _mm256_madd_epi16(lstep2[ 0], kOne); - lstep2[ 1] = _mm256_madd_epi16(lstep2[ 1], kOne); - lstep2[ 2] = _mm256_madd_epi16(lstep2[ 2], kOne); - lstep2[ 3] = _mm256_madd_epi16(lstep2[ 3], kOne); - lstep2[ 4] = _mm256_madd_epi16(lstep2[ 4], kOne); - lstep2[ 5] = _mm256_madd_epi16(lstep2[ 5], kOne); - lstep2[ 6] = _mm256_madd_epi16(lstep2[ 6], kOne); - lstep2[ 7] = _mm256_madd_epi16(lstep2[ 7], kOne); - lstep2[ 8] = _mm256_madd_epi16(lstep2[ 8], kOne); - lstep2[ 9] = _mm256_madd_epi16(lstep2[ 9], kOne); - lstep2[10] = _mm256_madd_epi16(lstep2[10], kOne); - lstep2[11] = _mm256_madd_epi16(lstep2[11], kOne); - lstep2[12] = _mm256_madd_epi16(lstep2[12], kOne); - lstep2[13] = _mm256_madd_epi16(lstep2[13], kOne); - lstep2[14] = _mm256_madd_epi16(lstep2[14], kOne); - lstep2[15] = _mm256_madd_epi16(lstep2[15], kOne); - - lstep3[ 0] = _mm256_add_epi32(lstep2[14], lstep2[ 0]); - lstep3[ 1] = _mm256_add_epi32(lstep2[15], lstep2[ 1]); - lstep3[ 2] = _mm256_add_epi32(lstep2[12], lstep2[ 2]); - lstep3[ 3] = _mm256_add_epi32(lstep2[13], lstep2[ 3]); - lstep3[ 4] = _mm256_add_epi32(lstep2[10], lstep2[ 4]); - lstep3[ 5] = _mm256_add_epi32(lstep2[11], lstep2[ 5]); - lstep3[ 6] = _mm256_add_epi32(lstep2[ 8], lstep2[ 6]); - lstep3[ 7] = _mm256_add_epi32(lstep2[ 9], lstep2[ 7]); - lstep3[ 8] = _mm256_sub_epi32(lstep2[ 6], lstep2[ 8]); - lstep3[ 9] = _mm256_sub_epi32(lstep2[ 7], lstep2[ 9]); - lstep3[10] = _mm256_sub_epi32(lstep2[ 4], lstep2[10]); - lstep3[11] = _mm256_sub_epi32(lstep2[ 5], lstep2[11]); - lstep3[12] = _mm256_sub_epi32(lstep2[ 2], lstep2[12]); - lstep3[13] = _mm256_sub_epi32(lstep2[ 3], lstep2[13]); - lstep3[14] = _mm256_sub_epi32(lstep2[ 0], lstep2[14]); - lstep3[15] = _mm256_sub_epi32(lstep2[ 1], lstep2[15]); - } - { - const __m256i s3_10_0 = _mm256_unpacklo_epi16(step2[13], step2[10]); - const __m256i s3_10_1 = _mm256_unpackhi_epi16(step2[13], step2[10]); - const __m256i s3_11_0 = _mm256_unpacklo_epi16(step2[12], step2[11]); - const __m256i s3_11_1 = _mm256_unpackhi_epi16(step2[12], step2[11]); - const __m256i s3_10_2 = _mm256_madd_epi16(s3_10_0, k__cospi_p16_m16); - const __m256i s3_10_3 = _mm256_madd_epi16(s3_10_1, k__cospi_p16_m16); - const __m256i s3_11_2 = _mm256_madd_epi16(s3_11_0, k__cospi_p16_m16); - const __m256i s3_11_3 = _mm256_madd_epi16(s3_11_1, k__cospi_p16_m16); - const __m256i s3_12_2 = _mm256_madd_epi16(s3_11_0, k__cospi_p16_p16); - const __m256i s3_12_3 = _mm256_madd_epi16(s3_11_1, k__cospi_p16_p16); - const __m256i s3_13_2 = _mm256_madd_epi16(s3_10_0, k__cospi_p16_p16); - const __m256i s3_13_3 = _mm256_madd_epi16(s3_10_1, k__cospi_p16_p16); - // dct_const_round_shift - const __m256i s3_10_4 = _mm256_add_epi32(s3_10_2, k__DCT_CONST_ROUNDING); - const __m256i s3_10_5 = _mm256_add_epi32(s3_10_3, k__DCT_CONST_ROUNDING); - const __m256i s3_11_4 = _mm256_add_epi32(s3_11_2, k__DCT_CONST_ROUNDING); - const __m256i s3_11_5 = _mm256_add_epi32(s3_11_3, k__DCT_CONST_ROUNDING); - const __m256i s3_12_4 = _mm256_add_epi32(s3_12_2, k__DCT_CONST_ROUNDING); - const __m256i s3_12_5 = _mm256_add_epi32(s3_12_3, k__DCT_CONST_ROUNDING); - const __m256i s3_13_4 = _mm256_add_epi32(s3_13_2, k__DCT_CONST_ROUNDING); - const __m256i s3_13_5 = _mm256_add_epi32(s3_13_3, k__DCT_CONST_ROUNDING); - lstep3[20] = _mm256_srai_epi32(s3_10_4, DCT_CONST_BITS); - lstep3[21] = _mm256_srai_epi32(s3_10_5, DCT_CONST_BITS); - lstep3[22] = _mm256_srai_epi32(s3_11_4, DCT_CONST_BITS); - lstep3[23] = _mm256_srai_epi32(s3_11_5, DCT_CONST_BITS); - lstep3[24] = _mm256_srai_epi32(s3_12_4, DCT_CONST_BITS); - lstep3[25] = _mm256_srai_epi32(s3_12_5, DCT_CONST_BITS); - lstep3[26] = _mm256_srai_epi32(s3_13_4, DCT_CONST_BITS); - lstep3[27] = _mm256_srai_epi32(s3_13_5, DCT_CONST_BITS); - } - { - lstep2[40] = _mm256_unpacklo_epi16(step2[20], kZero); - lstep2[41] = _mm256_unpackhi_epi16(step2[20], kZero); - lstep2[42] = _mm256_unpacklo_epi16(step2[21], kZero); - lstep2[43] = _mm256_unpackhi_epi16(step2[21], kZero); - lstep2[44] = _mm256_unpacklo_epi16(step2[22], kZero); - lstep2[45] = _mm256_unpackhi_epi16(step2[22], kZero); - lstep2[46] = _mm256_unpacklo_epi16(step2[23], kZero); - lstep2[47] = _mm256_unpackhi_epi16(step2[23], kZero); - lstep2[48] = _mm256_unpacklo_epi16(step2[24], kZero); - lstep2[49] = _mm256_unpackhi_epi16(step2[24], kZero); - lstep2[50] = _mm256_unpacklo_epi16(step2[25], kZero); - lstep2[51] = _mm256_unpackhi_epi16(step2[25], kZero); - lstep2[52] = _mm256_unpacklo_epi16(step2[26], kZero); - lstep2[53] = _mm256_unpackhi_epi16(step2[26], kZero); - lstep2[54] = _mm256_unpacklo_epi16(step2[27], kZero); - lstep2[55] = _mm256_unpackhi_epi16(step2[27], kZero); - lstep2[40] = _mm256_madd_epi16(lstep2[40], kOne); - lstep2[41] = _mm256_madd_epi16(lstep2[41], kOne); - lstep2[42] = _mm256_madd_epi16(lstep2[42], kOne); - lstep2[43] = _mm256_madd_epi16(lstep2[43], kOne); - lstep2[44] = _mm256_madd_epi16(lstep2[44], kOne); - lstep2[45] = _mm256_madd_epi16(lstep2[45], kOne); - lstep2[46] = _mm256_madd_epi16(lstep2[46], kOne); - lstep2[47] = _mm256_madd_epi16(lstep2[47], kOne); - lstep2[48] = _mm256_madd_epi16(lstep2[48], kOne); - lstep2[49] = _mm256_madd_epi16(lstep2[49], kOne); - lstep2[50] = _mm256_madd_epi16(lstep2[50], kOne); - lstep2[51] = _mm256_madd_epi16(lstep2[51], kOne); - lstep2[52] = _mm256_madd_epi16(lstep2[52], kOne); - lstep2[53] = _mm256_madd_epi16(lstep2[53], kOne); - lstep2[54] = _mm256_madd_epi16(lstep2[54], kOne); - lstep2[55] = _mm256_madd_epi16(lstep2[55], kOne); - - lstep1[32] = _mm256_unpacklo_epi16(step1[16], kZero); - lstep1[33] = _mm256_unpackhi_epi16(step1[16], kZero); - lstep1[34] = _mm256_unpacklo_epi16(step1[17], kZero); - lstep1[35] = _mm256_unpackhi_epi16(step1[17], kZero); - lstep1[36] = _mm256_unpacklo_epi16(step1[18], kZero); - lstep1[37] = _mm256_unpackhi_epi16(step1[18], kZero); - lstep1[38] = _mm256_unpacklo_epi16(step1[19], kZero); - lstep1[39] = _mm256_unpackhi_epi16(step1[19], kZero); - lstep1[56] = _mm256_unpacklo_epi16(step1[28], kZero); - lstep1[57] = _mm256_unpackhi_epi16(step1[28], kZero); - lstep1[58] = _mm256_unpacklo_epi16(step1[29], kZero); - lstep1[59] = _mm256_unpackhi_epi16(step1[29], kZero); - lstep1[60] = _mm256_unpacklo_epi16(step1[30], kZero); - lstep1[61] = _mm256_unpackhi_epi16(step1[30], kZero); - lstep1[62] = _mm256_unpacklo_epi16(step1[31], kZero); - lstep1[63] = _mm256_unpackhi_epi16(step1[31], kZero); - lstep1[32] = _mm256_madd_epi16(lstep1[32], kOne); - lstep1[33] = _mm256_madd_epi16(lstep1[33], kOne); - lstep1[34] = _mm256_madd_epi16(lstep1[34], kOne); - lstep1[35] = _mm256_madd_epi16(lstep1[35], kOne); - lstep1[36] = _mm256_madd_epi16(lstep1[36], kOne); - lstep1[37] = _mm256_madd_epi16(lstep1[37], kOne); - lstep1[38] = _mm256_madd_epi16(lstep1[38], kOne); - lstep1[39] = _mm256_madd_epi16(lstep1[39], kOne); - lstep1[56] = _mm256_madd_epi16(lstep1[56], kOne); - lstep1[57] = _mm256_madd_epi16(lstep1[57], kOne); - lstep1[58] = _mm256_madd_epi16(lstep1[58], kOne); - lstep1[59] = _mm256_madd_epi16(lstep1[59], kOne); - lstep1[60] = _mm256_madd_epi16(lstep1[60], kOne); - lstep1[61] = _mm256_madd_epi16(lstep1[61], kOne); - lstep1[62] = _mm256_madd_epi16(lstep1[62], kOne); - lstep1[63] = _mm256_madd_epi16(lstep1[63], kOne); - - lstep3[32] = _mm256_add_epi32(lstep2[46], lstep1[32]); - lstep3[33] = _mm256_add_epi32(lstep2[47], lstep1[33]); - - lstep3[34] = _mm256_add_epi32(lstep2[44], lstep1[34]); - lstep3[35] = _mm256_add_epi32(lstep2[45], lstep1[35]); - lstep3[36] = _mm256_add_epi32(lstep2[42], lstep1[36]); - lstep3[37] = _mm256_add_epi32(lstep2[43], lstep1[37]); - lstep3[38] = _mm256_add_epi32(lstep2[40], lstep1[38]); - lstep3[39] = _mm256_add_epi32(lstep2[41], lstep1[39]); - lstep3[40] = _mm256_sub_epi32(lstep1[38], lstep2[40]); - lstep3[41] = _mm256_sub_epi32(lstep1[39], lstep2[41]); - lstep3[42] = _mm256_sub_epi32(lstep1[36], lstep2[42]); - lstep3[43] = _mm256_sub_epi32(lstep1[37], lstep2[43]); - lstep3[44] = _mm256_sub_epi32(lstep1[34], lstep2[44]); - lstep3[45] = _mm256_sub_epi32(lstep1[35], lstep2[45]); - lstep3[46] = _mm256_sub_epi32(lstep1[32], lstep2[46]); - lstep3[47] = _mm256_sub_epi32(lstep1[33], lstep2[47]); - lstep3[48] = _mm256_sub_epi32(lstep1[62], lstep2[48]); - lstep3[49] = _mm256_sub_epi32(lstep1[63], lstep2[49]); - lstep3[50] = _mm256_sub_epi32(lstep1[60], lstep2[50]); - lstep3[51] = _mm256_sub_epi32(lstep1[61], lstep2[51]); - lstep3[52] = _mm256_sub_epi32(lstep1[58], lstep2[52]); - lstep3[53] = _mm256_sub_epi32(lstep1[59], lstep2[53]); - lstep3[54] = _mm256_sub_epi32(lstep1[56], lstep2[54]); - lstep3[55] = _mm256_sub_epi32(lstep1[57], lstep2[55]); - lstep3[56] = _mm256_add_epi32(lstep2[54], lstep1[56]); - lstep3[57] = _mm256_add_epi32(lstep2[55], lstep1[57]); - lstep3[58] = _mm256_add_epi32(lstep2[52], lstep1[58]); - lstep3[59] = _mm256_add_epi32(lstep2[53], lstep1[59]); - lstep3[60] = _mm256_add_epi32(lstep2[50], lstep1[60]); - lstep3[61] = _mm256_add_epi32(lstep2[51], lstep1[61]); - lstep3[62] = _mm256_add_epi32(lstep2[48], lstep1[62]); - lstep3[63] = _mm256_add_epi32(lstep2[49], lstep1[63]); - } - - // stage 4 - { - // expanding to 32-bit length priori to addition operations - lstep2[16] = _mm256_unpacklo_epi16(step2[ 8], kZero); - lstep2[17] = _mm256_unpackhi_epi16(step2[ 8], kZero); - lstep2[18] = _mm256_unpacklo_epi16(step2[ 9], kZero); - lstep2[19] = _mm256_unpackhi_epi16(step2[ 9], kZero); - lstep2[28] = _mm256_unpacklo_epi16(step2[14], kZero); - lstep2[29] = _mm256_unpackhi_epi16(step2[14], kZero); - lstep2[30] = _mm256_unpacklo_epi16(step2[15], kZero); - lstep2[31] = _mm256_unpackhi_epi16(step2[15], kZero); - lstep2[16] = _mm256_madd_epi16(lstep2[16], kOne); - lstep2[17] = _mm256_madd_epi16(lstep2[17], kOne); - lstep2[18] = _mm256_madd_epi16(lstep2[18], kOne); - lstep2[19] = _mm256_madd_epi16(lstep2[19], kOne); - lstep2[28] = _mm256_madd_epi16(lstep2[28], kOne); - lstep2[29] = _mm256_madd_epi16(lstep2[29], kOne); - lstep2[30] = _mm256_madd_epi16(lstep2[30], kOne); - lstep2[31] = _mm256_madd_epi16(lstep2[31], kOne); - - lstep1[ 0] = _mm256_add_epi32(lstep3[ 6], lstep3[ 0]); - lstep1[ 1] = _mm256_add_epi32(lstep3[ 7], lstep3[ 1]); - lstep1[ 2] = _mm256_add_epi32(lstep3[ 4], lstep3[ 2]); - lstep1[ 3] = _mm256_add_epi32(lstep3[ 5], lstep3[ 3]); - lstep1[ 4] = _mm256_sub_epi32(lstep3[ 2], lstep3[ 4]); - lstep1[ 5] = _mm256_sub_epi32(lstep3[ 3], lstep3[ 5]); - lstep1[ 6] = _mm256_sub_epi32(lstep3[ 0], lstep3[ 6]); - lstep1[ 7] = _mm256_sub_epi32(lstep3[ 1], lstep3[ 7]); - lstep1[16] = _mm256_add_epi32(lstep3[22], lstep2[16]); - lstep1[17] = _mm256_add_epi32(lstep3[23], lstep2[17]); - lstep1[18] = _mm256_add_epi32(lstep3[20], lstep2[18]); - lstep1[19] = _mm256_add_epi32(lstep3[21], lstep2[19]); - lstep1[20] = _mm256_sub_epi32(lstep2[18], lstep3[20]); - lstep1[21] = _mm256_sub_epi32(lstep2[19], lstep3[21]); - lstep1[22] = _mm256_sub_epi32(lstep2[16], lstep3[22]); - lstep1[23] = _mm256_sub_epi32(lstep2[17], lstep3[23]); - lstep1[24] = _mm256_sub_epi32(lstep2[30], lstep3[24]); - lstep1[25] = _mm256_sub_epi32(lstep2[31], lstep3[25]); - lstep1[26] = _mm256_sub_epi32(lstep2[28], lstep3[26]); - lstep1[27] = _mm256_sub_epi32(lstep2[29], lstep3[27]); - lstep1[28] = _mm256_add_epi32(lstep3[26], lstep2[28]); - lstep1[29] = _mm256_add_epi32(lstep3[27], lstep2[29]); - lstep1[30] = _mm256_add_epi32(lstep3[24], lstep2[30]); - lstep1[31] = _mm256_add_epi32(lstep3[25], lstep2[31]); - } - { - // to be continued... - // - const __m256i k32_p16_p16 = pair256_set_epi32(cospi_16_64, cospi_16_64); - const __m256i k32_p16_m16 = pair256_set_epi32(cospi_16_64, -cospi_16_64); - - u[0] = _mm256_unpacklo_epi32(lstep3[12], lstep3[10]); - u[1] = _mm256_unpackhi_epi32(lstep3[12], lstep3[10]); - u[2] = _mm256_unpacklo_epi32(lstep3[13], lstep3[11]); - u[3] = _mm256_unpackhi_epi32(lstep3[13], lstep3[11]); - - // TODO(jingning): manually inline k_madd_epi32_avx2_ to further hide - // instruction latency. - v[ 0] = k_madd_epi32_avx2(u[0], k32_p16_m16); - v[ 1] = k_madd_epi32_avx2(u[1], k32_p16_m16); - v[ 2] = k_madd_epi32_avx2(u[2], k32_p16_m16); - v[ 3] = k_madd_epi32_avx2(u[3], k32_p16_m16); - v[ 4] = k_madd_epi32_avx2(u[0], k32_p16_p16); - v[ 5] = k_madd_epi32_avx2(u[1], k32_p16_p16); - v[ 6] = k_madd_epi32_avx2(u[2], k32_p16_p16); - v[ 7] = k_madd_epi32_avx2(u[3], k32_p16_p16); - - u[0] = k_packs_epi64_avx2(v[0], v[1]); - u[1] = k_packs_epi64_avx2(v[2], v[3]); - u[2] = k_packs_epi64_avx2(v[4], v[5]); - u[3] = k_packs_epi64_avx2(v[6], v[7]); - - v[0] = _mm256_add_epi32(u[0], k__DCT_CONST_ROUNDING); - v[1] = _mm256_add_epi32(u[1], k__DCT_CONST_ROUNDING); - v[2] = _mm256_add_epi32(u[2], k__DCT_CONST_ROUNDING); - v[3] = _mm256_add_epi32(u[3], k__DCT_CONST_ROUNDING); - - lstep1[10] = _mm256_srai_epi32(v[0], DCT_CONST_BITS); - lstep1[11] = _mm256_srai_epi32(v[1], DCT_CONST_BITS); - lstep1[12] = _mm256_srai_epi32(v[2], DCT_CONST_BITS); - lstep1[13] = _mm256_srai_epi32(v[3], DCT_CONST_BITS); - } - { - const __m256i k32_m08_p24 = pair256_set_epi32(-cospi_8_64, cospi_24_64); - const __m256i k32_m24_m08 = pair256_set_epi32(-cospi_24_64, -cospi_8_64); - const __m256i k32_p24_p08 = pair256_set_epi32(cospi_24_64, cospi_8_64); - - u[ 0] = _mm256_unpacklo_epi32(lstep3[36], lstep3[58]); - u[ 1] = _mm256_unpackhi_epi32(lstep3[36], lstep3[58]); - u[ 2] = _mm256_unpacklo_epi32(lstep3[37], lstep3[59]); - u[ 3] = _mm256_unpackhi_epi32(lstep3[37], lstep3[59]); - u[ 4] = _mm256_unpacklo_epi32(lstep3[38], lstep3[56]); - u[ 5] = _mm256_unpackhi_epi32(lstep3[38], lstep3[56]); - u[ 6] = _mm256_unpacklo_epi32(lstep3[39], lstep3[57]); - u[ 7] = _mm256_unpackhi_epi32(lstep3[39], lstep3[57]); - u[ 8] = _mm256_unpacklo_epi32(lstep3[40], lstep3[54]); - u[ 9] = _mm256_unpackhi_epi32(lstep3[40], lstep3[54]); - u[10] = _mm256_unpacklo_epi32(lstep3[41], lstep3[55]); - u[11] = _mm256_unpackhi_epi32(lstep3[41], lstep3[55]); - u[12] = _mm256_unpacklo_epi32(lstep3[42], lstep3[52]); - u[13] = _mm256_unpackhi_epi32(lstep3[42], lstep3[52]); - u[14] = _mm256_unpacklo_epi32(lstep3[43], lstep3[53]); - u[15] = _mm256_unpackhi_epi32(lstep3[43], lstep3[53]); - - v[ 0] = k_madd_epi32_avx2(u[ 0], k32_m08_p24); - v[ 1] = k_madd_epi32_avx2(u[ 1], k32_m08_p24); - v[ 2] = k_madd_epi32_avx2(u[ 2], k32_m08_p24); - v[ 3] = k_madd_epi32_avx2(u[ 3], k32_m08_p24); - v[ 4] = k_madd_epi32_avx2(u[ 4], k32_m08_p24); - v[ 5] = k_madd_epi32_avx2(u[ 5], k32_m08_p24); - v[ 6] = k_madd_epi32_avx2(u[ 6], k32_m08_p24); - v[ 7] = k_madd_epi32_avx2(u[ 7], k32_m08_p24); - v[ 8] = k_madd_epi32_avx2(u[ 8], k32_m24_m08); - v[ 9] = k_madd_epi32_avx2(u[ 9], k32_m24_m08); - v[10] = k_madd_epi32_avx2(u[10], k32_m24_m08); - v[11] = k_madd_epi32_avx2(u[11], k32_m24_m08); - v[12] = k_madd_epi32_avx2(u[12], k32_m24_m08); - v[13] = k_madd_epi32_avx2(u[13], k32_m24_m08); - v[14] = k_madd_epi32_avx2(u[14], k32_m24_m08); - v[15] = k_madd_epi32_avx2(u[15], k32_m24_m08); - v[16] = k_madd_epi32_avx2(u[12], k32_m08_p24); - v[17] = k_madd_epi32_avx2(u[13], k32_m08_p24); - v[18] = k_madd_epi32_avx2(u[14], k32_m08_p24); - v[19] = k_madd_epi32_avx2(u[15], k32_m08_p24); - v[20] = k_madd_epi32_avx2(u[ 8], k32_m08_p24); - v[21] = k_madd_epi32_avx2(u[ 9], k32_m08_p24); - v[22] = k_madd_epi32_avx2(u[10], k32_m08_p24); - v[23] = k_madd_epi32_avx2(u[11], k32_m08_p24); - v[24] = k_madd_epi32_avx2(u[ 4], k32_p24_p08); - v[25] = k_madd_epi32_avx2(u[ 5], k32_p24_p08); - v[26] = k_madd_epi32_avx2(u[ 6], k32_p24_p08); - v[27] = k_madd_epi32_avx2(u[ 7], k32_p24_p08); - v[28] = k_madd_epi32_avx2(u[ 0], k32_p24_p08); - v[29] = k_madd_epi32_avx2(u[ 1], k32_p24_p08); - v[30] = k_madd_epi32_avx2(u[ 2], k32_p24_p08); - v[31] = k_madd_epi32_avx2(u[ 3], k32_p24_p08); - - u[ 0] = k_packs_epi64_avx2(v[ 0], v[ 1]); - u[ 1] = k_packs_epi64_avx2(v[ 2], v[ 3]); - u[ 2] = k_packs_epi64_avx2(v[ 4], v[ 5]); - u[ 3] = k_packs_epi64_avx2(v[ 6], v[ 7]); - u[ 4] = k_packs_epi64_avx2(v[ 8], v[ 9]); - u[ 5] = k_packs_epi64_avx2(v[10], v[11]); - u[ 6] = k_packs_epi64_avx2(v[12], v[13]); - u[ 7] = k_packs_epi64_avx2(v[14], v[15]); - u[ 8] = k_packs_epi64_avx2(v[16], v[17]); - u[ 9] = k_packs_epi64_avx2(v[18], v[19]); - u[10] = k_packs_epi64_avx2(v[20], v[21]); - u[11] = k_packs_epi64_avx2(v[22], v[23]); - u[12] = k_packs_epi64_avx2(v[24], v[25]); - u[13] = k_packs_epi64_avx2(v[26], v[27]); - u[14] = k_packs_epi64_avx2(v[28], v[29]); - u[15] = k_packs_epi64_avx2(v[30], v[31]); - - v[ 0] = _mm256_add_epi32(u[ 0], k__DCT_CONST_ROUNDING); - v[ 1] = _mm256_add_epi32(u[ 1], k__DCT_CONST_ROUNDING); - v[ 2] = _mm256_add_epi32(u[ 2], k__DCT_CONST_ROUNDING); - v[ 3] = _mm256_add_epi32(u[ 3], k__DCT_CONST_ROUNDING); - v[ 4] = _mm256_add_epi32(u[ 4], k__DCT_CONST_ROUNDING); - v[ 5] = _mm256_add_epi32(u[ 5], k__DCT_CONST_ROUNDING); - v[ 6] = _mm256_add_epi32(u[ 6], k__DCT_CONST_ROUNDING); - v[ 7] = _mm256_add_epi32(u[ 7], k__DCT_CONST_ROUNDING); - v[ 8] = _mm256_add_epi32(u[ 8], k__DCT_CONST_ROUNDING); - v[ 9] = _mm256_add_epi32(u[ 9], k__DCT_CONST_ROUNDING); - v[10] = _mm256_add_epi32(u[10], k__DCT_CONST_ROUNDING); - v[11] = _mm256_add_epi32(u[11], k__DCT_CONST_ROUNDING); - v[12] = _mm256_add_epi32(u[12], k__DCT_CONST_ROUNDING); - v[13] = _mm256_add_epi32(u[13], k__DCT_CONST_ROUNDING); - v[14] = _mm256_add_epi32(u[14], k__DCT_CONST_ROUNDING); - v[15] = _mm256_add_epi32(u[15], k__DCT_CONST_ROUNDING); - - lstep1[36] = _mm256_srai_epi32(v[ 0], DCT_CONST_BITS); - lstep1[37] = _mm256_srai_epi32(v[ 1], DCT_CONST_BITS); - lstep1[38] = _mm256_srai_epi32(v[ 2], DCT_CONST_BITS); - lstep1[39] = _mm256_srai_epi32(v[ 3], DCT_CONST_BITS); - lstep1[40] = _mm256_srai_epi32(v[ 4], DCT_CONST_BITS); - lstep1[41] = _mm256_srai_epi32(v[ 5], DCT_CONST_BITS); - lstep1[42] = _mm256_srai_epi32(v[ 6], DCT_CONST_BITS); - lstep1[43] = _mm256_srai_epi32(v[ 7], DCT_CONST_BITS); - lstep1[52] = _mm256_srai_epi32(v[ 8], DCT_CONST_BITS); - lstep1[53] = _mm256_srai_epi32(v[ 9], DCT_CONST_BITS); - lstep1[54] = _mm256_srai_epi32(v[10], DCT_CONST_BITS); - lstep1[55] = _mm256_srai_epi32(v[11], DCT_CONST_BITS); - lstep1[56] = _mm256_srai_epi32(v[12], DCT_CONST_BITS); - lstep1[57] = _mm256_srai_epi32(v[13], DCT_CONST_BITS); - lstep1[58] = _mm256_srai_epi32(v[14], DCT_CONST_BITS); - lstep1[59] = _mm256_srai_epi32(v[15], DCT_CONST_BITS); - } - // stage 5 - { - lstep2[ 8] = _mm256_add_epi32(lstep1[10], lstep3[ 8]); - lstep2[ 9] = _mm256_add_epi32(lstep1[11], lstep3[ 9]); - lstep2[10] = _mm256_sub_epi32(lstep3[ 8], lstep1[10]); - lstep2[11] = _mm256_sub_epi32(lstep3[ 9], lstep1[11]); - lstep2[12] = _mm256_sub_epi32(lstep3[14], lstep1[12]); - lstep2[13] = _mm256_sub_epi32(lstep3[15], lstep1[13]); - lstep2[14] = _mm256_add_epi32(lstep1[12], lstep3[14]); - lstep2[15] = _mm256_add_epi32(lstep1[13], lstep3[15]); - } - { - const __m256i k32_p16_p16 = pair256_set_epi32(cospi_16_64, cospi_16_64); - const __m256i k32_p16_m16 = pair256_set_epi32(cospi_16_64, -cospi_16_64); - const __m256i k32_p24_p08 = pair256_set_epi32(cospi_24_64, cospi_8_64); - const __m256i k32_m08_p24 = pair256_set_epi32(-cospi_8_64, cospi_24_64); - - u[0] = _mm256_unpacklo_epi32(lstep1[0], lstep1[2]); - u[1] = _mm256_unpackhi_epi32(lstep1[0], lstep1[2]); - u[2] = _mm256_unpacklo_epi32(lstep1[1], lstep1[3]); - u[3] = _mm256_unpackhi_epi32(lstep1[1], lstep1[3]); - u[4] = _mm256_unpacklo_epi32(lstep1[4], lstep1[6]); - u[5] = _mm256_unpackhi_epi32(lstep1[4], lstep1[6]); - u[6] = _mm256_unpacklo_epi32(lstep1[5], lstep1[7]); - u[7] = _mm256_unpackhi_epi32(lstep1[5], lstep1[7]); - - // TODO(jingning): manually inline k_madd_epi32_avx2_ to further hide - // instruction latency. - v[ 0] = k_madd_epi32_avx2(u[0], k32_p16_p16); - v[ 1] = k_madd_epi32_avx2(u[1], k32_p16_p16); - v[ 2] = k_madd_epi32_avx2(u[2], k32_p16_p16); - v[ 3] = k_madd_epi32_avx2(u[3], k32_p16_p16); - v[ 4] = k_madd_epi32_avx2(u[0], k32_p16_m16); - v[ 5] = k_madd_epi32_avx2(u[1], k32_p16_m16); - v[ 6] = k_madd_epi32_avx2(u[2], k32_p16_m16); - v[ 7] = k_madd_epi32_avx2(u[3], k32_p16_m16); - v[ 8] = k_madd_epi32_avx2(u[4], k32_p24_p08); - v[ 9] = k_madd_epi32_avx2(u[5], k32_p24_p08); - v[10] = k_madd_epi32_avx2(u[6], k32_p24_p08); - v[11] = k_madd_epi32_avx2(u[7], k32_p24_p08); - v[12] = k_madd_epi32_avx2(u[4], k32_m08_p24); - v[13] = k_madd_epi32_avx2(u[5], k32_m08_p24); - v[14] = k_madd_epi32_avx2(u[6], k32_m08_p24); - v[15] = k_madd_epi32_avx2(u[7], k32_m08_p24); - - u[0] = k_packs_epi64_avx2(v[0], v[1]); - u[1] = k_packs_epi64_avx2(v[2], v[3]); - u[2] = k_packs_epi64_avx2(v[4], v[5]); - u[3] = k_packs_epi64_avx2(v[6], v[7]); - u[4] = k_packs_epi64_avx2(v[8], v[9]); - u[5] = k_packs_epi64_avx2(v[10], v[11]); - u[6] = k_packs_epi64_avx2(v[12], v[13]); - u[7] = k_packs_epi64_avx2(v[14], v[15]); - - v[0] = _mm256_add_epi32(u[0], k__DCT_CONST_ROUNDING); - v[1] = _mm256_add_epi32(u[1], k__DCT_CONST_ROUNDING); - v[2] = _mm256_add_epi32(u[2], k__DCT_CONST_ROUNDING); - v[3] = _mm256_add_epi32(u[3], k__DCT_CONST_ROUNDING); - v[4] = _mm256_add_epi32(u[4], k__DCT_CONST_ROUNDING); - v[5] = _mm256_add_epi32(u[5], k__DCT_CONST_ROUNDING); - v[6] = _mm256_add_epi32(u[6], k__DCT_CONST_ROUNDING); - v[7] = _mm256_add_epi32(u[7], k__DCT_CONST_ROUNDING); - - u[0] = _mm256_srai_epi32(v[0], DCT_CONST_BITS); - u[1] = _mm256_srai_epi32(v[1], DCT_CONST_BITS); - u[2] = _mm256_srai_epi32(v[2], DCT_CONST_BITS); - u[3] = _mm256_srai_epi32(v[3], DCT_CONST_BITS); - u[4] = _mm256_srai_epi32(v[4], DCT_CONST_BITS); - u[5] = _mm256_srai_epi32(v[5], DCT_CONST_BITS); - u[6] = _mm256_srai_epi32(v[6], DCT_CONST_BITS); - u[7] = _mm256_srai_epi32(v[7], DCT_CONST_BITS); - - sign[0] = _mm256_cmpgt_epi32(kZero,u[0]); - sign[1] = _mm256_cmpgt_epi32(kZero,u[1]); - sign[2] = _mm256_cmpgt_epi32(kZero,u[2]); - sign[3] = _mm256_cmpgt_epi32(kZero,u[3]); - sign[4] = _mm256_cmpgt_epi32(kZero,u[4]); - sign[5] = _mm256_cmpgt_epi32(kZero,u[5]); - sign[6] = _mm256_cmpgt_epi32(kZero,u[6]); - sign[7] = _mm256_cmpgt_epi32(kZero,u[7]); - - u[0] = _mm256_sub_epi32(u[0], sign[0]); - u[1] = _mm256_sub_epi32(u[1], sign[1]); - u[2] = _mm256_sub_epi32(u[2], sign[2]); - u[3] = _mm256_sub_epi32(u[3], sign[3]); - u[4] = _mm256_sub_epi32(u[4], sign[4]); - u[5] = _mm256_sub_epi32(u[5], sign[5]); - u[6] = _mm256_sub_epi32(u[6], sign[6]); - u[7] = _mm256_sub_epi32(u[7], sign[7]); - - u[0] = _mm256_add_epi32(u[0], K32One); - u[1] = _mm256_add_epi32(u[1], K32One); - u[2] = _mm256_add_epi32(u[2], K32One); - u[3] = _mm256_add_epi32(u[3], K32One); - u[4] = _mm256_add_epi32(u[4], K32One); - u[5] = _mm256_add_epi32(u[5], K32One); - u[6] = _mm256_add_epi32(u[6], K32One); - u[7] = _mm256_add_epi32(u[7], K32One); - - u[0] = _mm256_srai_epi32(u[0], 2); - u[1] = _mm256_srai_epi32(u[1], 2); - u[2] = _mm256_srai_epi32(u[2], 2); - u[3] = _mm256_srai_epi32(u[3], 2); - u[4] = _mm256_srai_epi32(u[4], 2); - u[5] = _mm256_srai_epi32(u[5], 2); - u[6] = _mm256_srai_epi32(u[6], 2); - u[7] = _mm256_srai_epi32(u[7], 2); - - // Combine - out[ 0] = _mm256_packs_epi32(u[0], u[1]); - out[16] = _mm256_packs_epi32(u[2], u[3]); - out[ 8] = _mm256_packs_epi32(u[4], u[5]); - out[24] = _mm256_packs_epi32(u[6], u[7]); - } - { - const __m256i k32_m08_p24 = pair256_set_epi32(-cospi_8_64, cospi_24_64); - const __m256i k32_m24_m08 = pair256_set_epi32(-cospi_24_64, -cospi_8_64); - const __m256i k32_p24_p08 = pair256_set_epi32(cospi_24_64, cospi_8_64); - - u[0] = _mm256_unpacklo_epi32(lstep1[18], lstep1[28]); - u[1] = _mm256_unpackhi_epi32(lstep1[18], lstep1[28]); - u[2] = _mm256_unpacklo_epi32(lstep1[19], lstep1[29]); - u[3] = _mm256_unpackhi_epi32(lstep1[19], lstep1[29]); - u[4] = _mm256_unpacklo_epi32(lstep1[20], lstep1[26]); - u[5] = _mm256_unpackhi_epi32(lstep1[20], lstep1[26]); - u[6] = _mm256_unpacklo_epi32(lstep1[21], lstep1[27]); - u[7] = _mm256_unpackhi_epi32(lstep1[21], lstep1[27]); - - v[0] = k_madd_epi32_avx2(u[0], k32_m08_p24); - v[1] = k_madd_epi32_avx2(u[1], k32_m08_p24); - v[2] = k_madd_epi32_avx2(u[2], k32_m08_p24); - v[3] = k_madd_epi32_avx2(u[3], k32_m08_p24); - v[4] = k_madd_epi32_avx2(u[4], k32_m24_m08); - v[5] = k_madd_epi32_avx2(u[5], k32_m24_m08); - v[6] = k_madd_epi32_avx2(u[6], k32_m24_m08); - v[7] = k_madd_epi32_avx2(u[7], k32_m24_m08); - v[ 8] = k_madd_epi32_avx2(u[4], k32_m08_p24); - v[ 9] = k_madd_epi32_avx2(u[5], k32_m08_p24); - v[10] = k_madd_epi32_avx2(u[6], k32_m08_p24); - v[11] = k_madd_epi32_avx2(u[7], k32_m08_p24); - v[12] = k_madd_epi32_avx2(u[0], k32_p24_p08); - v[13] = k_madd_epi32_avx2(u[1], k32_p24_p08); - v[14] = k_madd_epi32_avx2(u[2], k32_p24_p08); - v[15] = k_madd_epi32_avx2(u[3], k32_p24_p08); - - u[0] = k_packs_epi64_avx2(v[0], v[1]); - u[1] = k_packs_epi64_avx2(v[2], v[3]); - u[2] = k_packs_epi64_avx2(v[4], v[5]); - u[3] = k_packs_epi64_avx2(v[6], v[7]); - u[4] = k_packs_epi64_avx2(v[8], v[9]); - u[5] = k_packs_epi64_avx2(v[10], v[11]); - u[6] = k_packs_epi64_avx2(v[12], v[13]); - u[7] = k_packs_epi64_avx2(v[14], v[15]); - - u[0] = _mm256_add_epi32(u[0], k__DCT_CONST_ROUNDING); - u[1] = _mm256_add_epi32(u[1], k__DCT_CONST_ROUNDING); - u[2] = _mm256_add_epi32(u[2], k__DCT_CONST_ROUNDING); - u[3] = _mm256_add_epi32(u[3], k__DCT_CONST_ROUNDING); - u[4] = _mm256_add_epi32(u[4], k__DCT_CONST_ROUNDING); - u[5] = _mm256_add_epi32(u[5], k__DCT_CONST_ROUNDING); - u[6] = _mm256_add_epi32(u[6], k__DCT_CONST_ROUNDING); - u[7] = _mm256_add_epi32(u[7], k__DCT_CONST_ROUNDING); - - lstep2[18] = _mm256_srai_epi32(u[0], DCT_CONST_BITS); - lstep2[19] = _mm256_srai_epi32(u[1], DCT_CONST_BITS); - lstep2[20] = _mm256_srai_epi32(u[2], DCT_CONST_BITS); - lstep2[21] = _mm256_srai_epi32(u[3], DCT_CONST_BITS); - lstep2[26] = _mm256_srai_epi32(u[4], DCT_CONST_BITS); - lstep2[27] = _mm256_srai_epi32(u[5], DCT_CONST_BITS); - lstep2[28] = _mm256_srai_epi32(u[6], DCT_CONST_BITS); - lstep2[29] = _mm256_srai_epi32(u[7], DCT_CONST_BITS); - } - { - lstep2[32] = _mm256_add_epi32(lstep1[38], lstep3[32]); - lstep2[33] = _mm256_add_epi32(lstep1[39], lstep3[33]); - lstep2[34] = _mm256_add_epi32(lstep1[36], lstep3[34]); - lstep2[35] = _mm256_add_epi32(lstep1[37], lstep3[35]); - lstep2[36] = _mm256_sub_epi32(lstep3[34], lstep1[36]); - lstep2[37] = _mm256_sub_epi32(lstep3[35], lstep1[37]); - lstep2[38] = _mm256_sub_epi32(lstep3[32], lstep1[38]); - lstep2[39] = _mm256_sub_epi32(lstep3[33], lstep1[39]); - lstep2[40] = _mm256_sub_epi32(lstep3[46], lstep1[40]); - lstep2[41] = _mm256_sub_epi32(lstep3[47], lstep1[41]); - lstep2[42] = _mm256_sub_epi32(lstep3[44], lstep1[42]); - lstep2[43] = _mm256_sub_epi32(lstep3[45], lstep1[43]); - lstep2[44] = _mm256_add_epi32(lstep1[42], lstep3[44]); - lstep2[45] = _mm256_add_epi32(lstep1[43], lstep3[45]); - lstep2[46] = _mm256_add_epi32(lstep1[40], lstep3[46]); - lstep2[47] = _mm256_add_epi32(lstep1[41], lstep3[47]); - lstep2[48] = _mm256_add_epi32(lstep1[54], lstep3[48]); - lstep2[49] = _mm256_add_epi32(lstep1[55], lstep3[49]); - lstep2[50] = _mm256_add_epi32(lstep1[52], lstep3[50]); - lstep2[51] = _mm256_add_epi32(lstep1[53], lstep3[51]); - lstep2[52] = _mm256_sub_epi32(lstep3[50], lstep1[52]); - lstep2[53] = _mm256_sub_epi32(lstep3[51], lstep1[53]); - lstep2[54] = _mm256_sub_epi32(lstep3[48], lstep1[54]); - lstep2[55] = _mm256_sub_epi32(lstep3[49], lstep1[55]); - lstep2[56] = _mm256_sub_epi32(lstep3[62], lstep1[56]); - lstep2[57] = _mm256_sub_epi32(lstep3[63], lstep1[57]); - lstep2[58] = _mm256_sub_epi32(lstep3[60], lstep1[58]); - lstep2[59] = _mm256_sub_epi32(lstep3[61], lstep1[59]); - lstep2[60] = _mm256_add_epi32(lstep1[58], lstep3[60]); - lstep2[61] = _mm256_add_epi32(lstep1[59], lstep3[61]); - lstep2[62] = _mm256_add_epi32(lstep1[56], lstep3[62]); - lstep2[63] = _mm256_add_epi32(lstep1[57], lstep3[63]); - } - // stage 6 - { - const __m256i k32_p28_p04 = pair256_set_epi32(cospi_28_64, cospi_4_64); - const __m256i k32_p12_p20 = pair256_set_epi32(cospi_12_64, cospi_20_64); - const __m256i k32_m20_p12 = pair256_set_epi32(-cospi_20_64, cospi_12_64); - const __m256i k32_m04_p28 = pair256_set_epi32(-cospi_4_64, cospi_28_64); - - u[0] = _mm256_unpacklo_epi32(lstep2[ 8], lstep2[14]); - u[1] = _mm256_unpackhi_epi32(lstep2[ 8], lstep2[14]); - u[2] = _mm256_unpacklo_epi32(lstep2[ 9], lstep2[15]); - u[3] = _mm256_unpackhi_epi32(lstep2[ 9], lstep2[15]); - u[4] = _mm256_unpacklo_epi32(lstep2[10], lstep2[12]); - u[5] = _mm256_unpackhi_epi32(lstep2[10], lstep2[12]); - u[6] = _mm256_unpacklo_epi32(lstep2[11], lstep2[13]); - u[7] = _mm256_unpackhi_epi32(lstep2[11], lstep2[13]); - u[8] = _mm256_unpacklo_epi32(lstep2[10], lstep2[12]); - u[9] = _mm256_unpackhi_epi32(lstep2[10], lstep2[12]); - u[10] = _mm256_unpacklo_epi32(lstep2[11], lstep2[13]); - u[11] = _mm256_unpackhi_epi32(lstep2[11], lstep2[13]); - u[12] = _mm256_unpacklo_epi32(lstep2[ 8], lstep2[14]); - u[13] = _mm256_unpackhi_epi32(lstep2[ 8], lstep2[14]); - u[14] = _mm256_unpacklo_epi32(lstep2[ 9], lstep2[15]); - u[15] = _mm256_unpackhi_epi32(lstep2[ 9], lstep2[15]); - - v[0] = k_madd_epi32_avx2(u[0], k32_p28_p04); - v[1] = k_madd_epi32_avx2(u[1], k32_p28_p04); - v[2] = k_madd_epi32_avx2(u[2], k32_p28_p04); - v[3] = k_madd_epi32_avx2(u[3], k32_p28_p04); - v[4] = k_madd_epi32_avx2(u[4], k32_p12_p20); - v[5] = k_madd_epi32_avx2(u[5], k32_p12_p20); - v[6] = k_madd_epi32_avx2(u[6], k32_p12_p20); - v[7] = k_madd_epi32_avx2(u[7], k32_p12_p20); - v[ 8] = k_madd_epi32_avx2(u[ 8], k32_m20_p12); - v[ 9] = k_madd_epi32_avx2(u[ 9], k32_m20_p12); - v[10] = k_madd_epi32_avx2(u[10], k32_m20_p12); - v[11] = k_madd_epi32_avx2(u[11], k32_m20_p12); - v[12] = k_madd_epi32_avx2(u[12], k32_m04_p28); - v[13] = k_madd_epi32_avx2(u[13], k32_m04_p28); - v[14] = k_madd_epi32_avx2(u[14], k32_m04_p28); - v[15] = k_madd_epi32_avx2(u[15], k32_m04_p28); - - u[0] = k_packs_epi64_avx2(v[0], v[1]); - u[1] = k_packs_epi64_avx2(v[2], v[3]); - u[2] = k_packs_epi64_avx2(v[4], v[5]); - u[3] = k_packs_epi64_avx2(v[6], v[7]); - u[4] = k_packs_epi64_avx2(v[8], v[9]); - u[5] = k_packs_epi64_avx2(v[10], v[11]); - u[6] = k_packs_epi64_avx2(v[12], v[13]); - u[7] = k_packs_epi64_avx2(v[14], v[15]); - - v[0] = _mm256_add_epi32(u[0], k__DCT_CONST_ROUNDING); - v[1] = _mm256_add_epi32(u[1], k__DCT_CONST_ROUNDING); - v[2] = _mm256_add_epi32(u[2], k__DCT_CONST_ROUNDING); - v[3] = _mm256_add_epi32(u[3], k__DCT_CONST_ROUNDING); - v[4] = _mm256_add_epi32(u[4], k__DCT_CONST_ROUNDING); - v[5] = _mm256_add_epi32(u[5], k__DCT_CONST_ROUNDING); - v[6] = _mm256_add_epi32(u[6], k__DCT_CONST_ROUNDING); - v[7] = _mm256_add_epi32(u[7], k__DCT_CONST_ROUNDING); - - u[0] = _mm256_srai_epi32(v[0], DCT_CONST_BITS); - u[1] = _mm256_srai_epi32(v[1], DCT_CONST_BITS); - u[2] = _mm256_srai_epi32(v[2], DCT_CONST_BITS); - u[3] = _mm256_srai_epi32(v[3], DCT_CONST_BITS); - u[4] = _mm256_srai_epi32(v[4], DCT_CONST_BITS); - u[5] = _mm256_srai_epi32(v[5], DCT_CONST_BITS); - u[6] = _mm256_srai_epi32(v[6], DCT_CONST_BITS); - u[7] = _mm256_srai_epi32(v[7], DCT_CONST_BITS); - - sign[0] = _mm256_cmpgt_epi32(kZero,u[0]); - sign[1] = _mm256_cmpgt_epi32(kZero,u[1]); - sign[2] = _mm256_cmpgt_epi32(kZero,u[2]); - sign[3] = _mm256_cmpgt_epi32(kZero,u[3]); - sign[4] = _mm256_cmpgt_epi32(kZero,u[4]); - sign[5] = _mm256_cmpgt_epi32(kZero,u[5]); - sign[6] = _mm256_cmpgt_epi32(kZero,u[6]); - sign[7] = _mm256_cmpgt_epi32(kZero,u[7]); - - u[0] = _mm256_sub_epi32(u[0], sign[0]); - u[1] = _mm256_sub_epi32(u[1], sign[1]); - u[2] = _mm256_sub_epi32(u[2], sign[2]); - u[3] = _mm256_sub_epi32(u[3], sign[3]); - u[4] = _mm256_sub_epi32(u[4], sign[4]); - u[5] = _mm256_sub_epi32(u[5], sign[5]); - u[6] = _mm256_sub_epi32(u[6], sign[6]); - u[7] = _mm256_sub_epi32(u[7], sign[7]); - - u[0] = _mm256_add_epi32(u[0], K32One); - u[1] = _mm256_add_epi32(u[1], K32One); - u[2] = _mm256_add_epi32(u[2], K32One); - u[3] = _mm256_add_epi32(u[3], K32One); - u[4] = _mm256_add_epi32(u[4], K32One); - u[5] = _mm256_add_epi32(u[5], K32One); - u[6] = _mm256_add_epi32(u[6], K32One); - u[7] = _mm256_add_epi32(u[7], K32One); - - u[0] = _mm256_srai_epi32(u[0], 2); - u[1] = _mm256_srai_epi32(u[1], 2); - u[2] = _mm256_srai_epi32(u[2], 2); - u[3] = _mm256_srai_epi32(u[3], 2); - u[4] = _mm256_srai_epi32(u[4], 2); - u[5] = _mm256_srai_epi32(u[5], 2); - u[6] = _mm256_srai_epi32(u[6], 2); - u[7] = _mm256_srai_epi32(u[7], 2); - - out[ 4] = _mm256_packs_epi32(u[0], u[1]); - out[20] = _mm256_packs_epi32(u[2], u[3]); - out[12] = _mm256_packs_epi32(u[4], u[5]); - out[28] = _mm256_packs_epi32(u[6], u[7]); - } - { - lstep3[16] = _mm256_add_epi32(lstep2[18], lstep1[16]); - lstep3[17] = _mm256_add_epi32(lstep2[19], lstep1[17]); - lstep3[18] = _mm256_sub_epi32(lstep1[16], lstep2[18]); - lstep3[19] = _mm256_sub_epi32(lstep1[17], lstep2[19]); - lstep3[20] = _mm256_sub_epi32(lstep1[22], lstep2[20]); - lstep3[21] = _mm256_sub_epi32(lstep1[23], lstep2[21]); - lstep3[22] = _mm256_add_epi32(lstep2[20], lstep1[22]); - lstep3[23] = _mm256_add_epi32(lstep2[21], lstep1[23]); - lstep3[24] = _mm256_add_epi32(lstep2[26], lstep1[24]); - lstep3[25] = _mm256_add_epi32(lstep2[27], lstep1[25]); - lstep3[26] = _mm256_sub_epi32(lstep1[24], lstep2[26]); - lstep3[27] = _mm256_sub_epi32(lstep1[25], lstep2[27]); - lstep3[28] = _mm256_sub_epi32(lstep1[30], lstep2[28]); - lstep3[29] = _mm256_sub_epi32(lstep1[31], lstep2[29]); - lstep3[30] = _mm256_add_epi32(lstep2[28], lstep1[30]); - lstep3[31] = _mm256_add_epi32(lstep2[29], lstep1[31]); - } - { - const __m256i k32_m04_p28 = pair256_set_epi32(-cospi_4_64, cospi_28_64); - const __m256i k32_m28_m04 = pair256_set_epi32(-cospi_28_64, -cospi_4_64); - const __m256i k32_m20_p12 = pair256_set_epi32(-cospi_20_64, cospi_12_64); - const __m256i k32_m12_m20 = pair256_set_epi32(-cospi_12_64, - -cospi_20_64); - const __m256i k32_p12_p20 = pair256_set_epi32(cospi_12_64, cospi_20_64); - const __m256i k32_p28_p04 = pair256_set_epi32(cospi_28_64, cospi_4_64); - - u[ 0] = _mm256_unpacklo_epi32(lstep2[34], lstep2[60]); - u[ 1] = _mm256_unpackhi_epi32(lstep2[34], lstep2[60]); - u[ 2] = _mm256_unpacklo_epi32(lstep2[35], lstep2[61]); - u[ 3] = _mm256_unpackhi_epi32(lstep2[35], lstep2[61]); - u[ 4] = _mm256_unpacklo_epi32(lstep2[36], lstep2[58]); - u[ 5] = _mm256_unpackhi_epi32(lstep2[36], lstep2[58]); - u[ 6] = _mm256_unpacklo_epi32(lstep2[37], lstep2[59]); - u[ 7] = _mm256_unpackhi_epi32(lstep2[37], lstep2[59]); - u[ 8] = _mm256_unpacklo_epi32(lstep2[42], lstep2[52]); - u[ 9] = _mm256_unpackhi_epi32(lstep2[42], lstep2[52]); - u[10] = _mm256_unpacklo_epi32(lstep2[43], lstep2[53]); - u[11] = _mm256_unpackhi_epi32(lstep2[43], lstep2[53]); - u[12] = _mm256_unpacklo_epi32(lstep2[44], lstep2[50]); - u[13] = _mm256_unpackhi_epi32(lstep2[44], lstep2[50]); - u[14] = _mm256_unpacklo_epi32(lstep2[45], lstep2[51]); - u[15] = _mm256_unpackhi_epi32(lstep2[45], lstep2[51]); - - v[ 0] = k_madd_epi32_avx2(u[ 0], k32_m04_p28); - v[ 1] = k_madd_epi32_avx2(u[ 1], k32_m04_p28); - v[ 2] = k_madd_epi32_avx2(u[ 2], k32_m04_p28); - v[ 3] = k_madd_epi32_avx2(u[ 3], k32_m04_p28); - v[ 4] = k_madd_epi32_avx2(u[ 4], k32_m28_m04); - v[ 5] = k_madd_epi32_avx2(u[ 5], k32_m28_m04); - v[ 6] = k_madd_epi32_avx2(u[ 6], k32_m28_m04); - v[ 7] = k_madd_epi32_avx2(u[ 7], k32_m28_m04); - v[ 8] = k_madd_epi32_avx2(u[ 8], k32_m20_p12); - v[ 9] = k_madd_epi32_avx2(u[ 9], k32_m20_p12); - v[10] = k_madd_epi32_avx2(u[10], k32_m20_p12); - v[11] = k_madd_epi32_avx2(u[11], k32_m20_p12); - v[12] = k_madd_epi32_avx2(u[12], k32_m12_m20); - v[13] = k_madd_epi32_avx2(u[13], k32_m12_m20); - v[14] = k_madd_epi32_avx2(u[14], k32_m12_m20); - v[15] = k_madd_epi32_avx2(u[15], k32_m12_m20); - v[16] = k_madd_epi32_avx2(u[12], k32_m20_p12); - v[17] = k_madd_epi32_avx2(u[13], k32_m20_p12); - v[18] = k_madd_epi32_avx2(u[14], k32_m20_p12); - v[19] = k_madd_epi32_avx2(u[15], k32_m20_p12); - v[20] = k_madd_epi32_avx2(u[ 8], k32_p12_p20); - v[21] = k_madd_epi32_avx2(u[ 9], k32_p12_p20); - v[22] = k_madd_epi32_avx2(u[10], k32_p12_p20); - v[23] = k_madd_epi32_avx2(u[11], k32_p12_p20); - v[24] = k_madd_epi32_avx2(u[ 4], k32_m04_p28); - v[25] = k_madd_epi32_avx2(u[ 5], k32_m04_p28); - v[26] = k_madd_epi32_avx2(u[ 6], k32_m04_p28); - v[27] = k_madd_epi32_avx2(u[ 7], k32_m04_p28); - v[28] = k_madd_epi32_avx2(u[ 0], k32_p28_p04); - v[29] = k_madd_epi32_avx2(u[ 1], k32_p28_p04); - v[30] = k_madd_epi32_avx2(u[ 2], k32_p28_p04); - v[31] = k_madd_epi32_avx2(u[ 3], k32_p28_p04); - - u[ 0] = k_packs_epi64_avx2(v[ 0], v[ 1]); - u[ 1] = k_packs_epi64_avx2(v[ 2], v[ 3]); - u[ 2] = k_packs_epi64_avx2(v[ 4], v[ 5]); - u[ 3] = k_packs_epi64_avx2(v[ 6], v[ 7]); - u[ 4] = k_packs_epi64_avx2(v[ 8], v[ 9]); - u[ 5] = k_packs_epi64_avx2(v[10], v[11]); - u[ 6] = k_packs_epi64_avx2(v[12], v[13]); - u[ 7] = k_packs_epi64_avx2(v[14], v[15]); - u[ 8] = k_packs_epi64_avx2(v[16], v[17]); - u[ 9] = k_packs_epi64_avx2(v[18], v[19]); - u[10] = k_packs_epi64_avx2(v[20], v[21]); - u[11] = k_packs_epi64_avx2(v[22], v[23]); - u[12] = k_packs_epi64_avx2(v[24], v[25]); - u[13] = k_packs_epi64_avx2(v[26], v[27]); - u[14] = k_packs_epi64_avx2(v[28], v[29]); - u[15] = k_packs_epi64_avx2(v[30], v[31]); - - v[ 0] = _mm256_add_epi32(u[ 0], k__DCT_CONST_ROUNDING); - v[ 1] = _mm256_add_epi32(u[ 1], k__DCT_CONST_ROUNDING); - v[ 2] = _mm256_add_epi32(u[ 2], k__DCT_CONST_ROUNDING); - v[ 3] = _mm256_add_epi32(u[ 3], k__DCT_CONST_ROUNDING); - v[ 4] = _mm256_add_epi32(u[ 4], k__DCT_CONST_ROUNDING); - v[ 5] = _mm256_add_epi32(u[ 5], k__DCT_CONST_ROUNDING); - v[ 6] = _mm256_add_epi32(u[ 6], k__DCT_CONST_ROUNDING); - v[ 7] = _mm256_add_epi32(u[ 7], k__DCT_CONST_ROUNDING); - v[ 8] = _mm256_add_epi32(u[ 8], k__DCT_CONST_ROUNDING); - v[ 9] = _mm256_add_epi32(u[ 9], k__DCT_CONST_ROUNDING); - v[10] = _mm256_add_epi32(u[10], k__DCT_CONST_ROUNDING); - v[11] = _mm256_add_epi32(u[11], k__DCT_CONST_ROUNDING); - v[12] = _mm256_add_epi32(u[12], k__DCT_CONST_ROUNDING); - v[13] = _mm256_add_epi32(u[13], k__DCT_CONST_ROUNDING); - v[14] = _mm256_add_epi32(u[14], k__DCT_CONST_ROUNDING); - v[15] = _mm256_add_epi32(u[15], k__DCT_CONST_ROUNDING); - - lstep3[34] = _mm256_srai_epi32(v[ 0], DCT_CONST_BITS); - lstep3[35] = _mm256_srai_epi32(v[ 1], DCT_CONST_BITS); - lstep3[36] = _mm256_srai_epi32(v[ 2], DCT_CONST_BITS); - lstep3[37] = _mm256_srai_epi32(v[ 3], DCT_CONST_BITS); - lstep3[42] = _mm256_srai_epi32(v[ 4], DCT_CONST_BITS); - lstep3[43] = _mm256_srai_epi32(v[ 5], DCT_CONST_BITS); - lstep3[44] = _mm256_srai_epi32(v[ 6], DCT_CONST_BITS); - lstep3[45] = _mm256_srai_epi32(v[ 7], DCT_CONST_BITS); - lstep3[50] = _mm256_srai_epi32(v[ 8], DCT_CONST_BITS); - lstep3[51] = _mm256_srai_epi32(v[ 9], DCT_CONST_BITS); - lstep3[52] = _mm256_srai_epi32(v[10], DCT_CONST_BITS); - lstep3[53] = _mm256_srai_epi32(v[11], DCT_CONST_BITS); - lstep3[58] = _mm256_srai_epi32(v[12], DCT_CONST_BITS); - lstep3[59] = _mm256_srai_epi32(v[13], DCT_CONST_BITS); - lstep3[60] = _mm256_srai_epi32(v[14], DCT_CONST_BITS); - lstep3[61] = _mm256_srai_epi32(v[15], DCT_CONST_BITS); - } - // stage 7 - { - const __m256i k32_p30_p02 = pair256_set_epi32(cospi_30_64, cospi_2_64); - const __m256i k32_p14_p18 = pair256_set_epi32(cospi_14_64, cospi_18_64); - const __m256i k32_p22_p10 = pair256_set_epi32(cospi_22_64, cospi_10_64); - const __m256i k32_p06_p26 = pair256_set_epi32(cospi_6_64, cospi_26_64); - const __m256i k32_m26_p06 = pair256_set_epi32(-cospi_26_64, cospi_6_64); - const __m256i k32_m10_p22 = pair256_set_epi32(-cospi_10_64, cospi_22_64); - const __m256i k32_m18_p14 = pair256_set_epi32(-cospi_18_64, cospi_14_64); - const __m256i k32_m02_p30 = pair256_set_epi32(-cospi_2_64, cospi_30_64); - - u[ 0] = _mm256_unpacklo_epi32(lstep3[16], lstep3[30]); - u[ 1] = _mm256_unpackhi_epi32(lstep3[16], lstep3[30]); - u[ 2] = _mm256_unpacklo_epi32(lstep3[17], lstep3[31]); - u[ 3] = _mm256_unpackhi_epi32(lstep3[17], lstep3[31]); - u[ 4] = _mm256_unpacklo_epi32(lstep3[18], lstep3[28]); - u[ 5] = _mm256_unpackhi_epi32(lstep3[18], lstep3[28]); - u[ 6] = _mm256_unpacklo_epi32(lstep3[19], lstep3[29]); - u[ 7] = _mm256_unpackhi_epi32(lstep3[19], lstep3[29]); - u[ 8] = _mm256_unpacklo_epi32(lstep3[20], lstep3[26]); - u[ 9] = _mm256_unpackhi_epi32(lstep3[20], lstep3[26]); - u[10] = _mm256_unpacklo_epi32(lstep3[21], lstep3[27]); - u[11] = _mm256_unpackhi_epi32(lstep3[21], lstep3[27]); - u[12] = _mm256_unpacklo_epi32(lstep3[22], lstep3[24]); - u[13] = _mm256_unpackhi_epi32(lstep3[22], lstep3[24]); - u[14] = _mm256_unpacklo_epi32(lstep3[23], lstep3[25]); - u[15] = _mm256_unpackhi_epi32(lstep3[23], lstep3[25]); - - v[ 0] = k_madd_epi32_avx2(u[ 0], k32_p30_p02); - v[ 1] = k_madd_epi32_avx2(u[ 1], k32_p30_p02); - v[ 2] = k_madd_epi32_avx2(u[ 2], k32_p30_p02); - v[ 3] = k_madd_epi32_avx2(u[ 3], k32_p30_p02); - v[ 4] = k_madd_epi32_avx2(u[ 4], k32_p14_p18); - v[ 5] = k_madd_epi32_avx2(u[ 5], k32_p14_p18); - v[ 6] = k_madd_epi32_avx2(u[ 6], k32_p14_p18); - v[ 7] = k_madd_epi32_avx2(u[ 7], k32_p14_p18); - v[ 8] = k_madd_epi32_avx2(u[ 8], k32_p22_p10); - v[ 9] = k_madd_epi32_avx2(u[ 9], k32_p22_p10); - v[10] = k_madd_epi32_avx2(u[10], k32_p22_p10); - v[11] = k_madd_epi32_avx2(u[11], k32_p22_p10); - v[12] = k_madd_epi32_avx2(u[12], k32_p06_p26); - v[13] = k_madd_epi32_avx2(u[13], k32_p06_p26); - v[14] = k_madd_epi32_avx2(u[14], k32_p06_p26); - v[15] = k_madd_epi32_avx2(u[15], k32_p06_p26); - v[16] = k_madd_epi32_avx2(u[12], k32_m26_p06); - v[17] = k_madd_epi32_avx2(u[13], k32_m26_p06); - v[18] = k_madd_epi32_avx2(u[14], k32_m26_p06); - v[19] = k_madd_epi32_avx2(u[15], k32_m26_p06); - v[20] = k_madd_epi32_avx2(u[ 8], k32_m10_p22); - v[21] = k_madd_epi32_avx2(u[ 9], k32_m10_p22); - v[22] = k_madd_epi32_avx2(u[10], k32_m10_p22); - v[23] = k_madd_epi32_avx2(u[11], k32_m10_p22); - v[24] = k_madd_epi32_avx2(u[ 4], k32_m18_p14); - v[25] = k_madd_epi32_avx2(u[ 5], k32_m18_p14); - v[26] = k_madd_epi32_avx2(u[ 6], k32_m18_p14); - v[27] = k_madd_epi32_avx2(u[ 7], k32_m18_p14); - v[28] = k_madd_epi32_avx2(u[ 0], k32_m02_p30); - v[29] = k_madd_epi32_avx2(u[ 1], k32_m02_p30); - v[30] = k_madd_epi32_avx2(u[ 2], k32_m02_p30); - v[31] = k_madd_epi32_avx2(u[ 3], k32_m02_p30); - - u[ 0] = k_packs_epi64_avx2(v[ 0], v[ 1]); - u[ 1] = k_packs_epi64_avx2(v[ 2], v[ 3]); - u[ 2] = k_packs_epi64_avx2(v[ 4], v[ 5]); - u[ 3] = k_packs_epi64_avx2(v[ 6], v[ 7]); - u[ 4] = k_packs_epi64_avx2(v[ 8], v[ 9]); - u[ 5] = k_packs_epi64_avx2(v[10], v[11]); - u[ 6] = k_packs_epi64_avx2(v[12], v[13]); - u[ 7] = k_packs_epi64_avx2(v[14], v[15]); - u[ 8] = k_packs_epi64_avx2(v[16], v[17]); - u[ 9] = k_packs_epi64_avx2(v[18], v[19]); - u[10] = k_packs_epi64_avx2(v[20], v[21]); - u[11] = k_packs_epi64_avx2(v[22], v[23]); - u[12] = k_packs_epi64_avx2(v[24], v[25]); - u[13] = k_packs_epi64_avx2(v[26], v[27]); - u[14] = k_packs_epi64_avx2(v[28], v[29]); - u[15] = k_packs_epi64_avx2(v[30], v[31]); - - v[ 0] = _mm256_add_epi32(u[ 0], k__DCT_CONST_ROUNDING); - v[ 1] = _mm256_add_epi32(u[ 1], k__DCT_CONST_ROUNDING); - v[ 2] = _mm256_add_epi32(u[ 2], k__DCT_CONST_ROUNDING); - v[ 3] = _mm256_add_epi32(u[ 3], k__DCT_CONST_ROUNDING); - v[ 4] = _mm256_add_epi32(u[ 4], k__DCT_CONST_ROUNDING); - v[ 5] = _mm256_add_epi32(u[ 5], k__DCT_CONST_ROUNDING); - v[ 6] = _mm256_add_epi32(u[ 6], k__DCT_CONST_ROUNDING); - v[ 7] = _mm256_add_epi32(u[ 7], k__DCT_CONST_ROUNDING); - v[ 8] = _mm256_add_epi32(u[ 8], k__DCT_CONST_ROUNDING); - v[ 9] = _mm256_add_epi32(u[ 9], k__DCT_CONST_ROUNDING); - v[10] = _mm256_add_epi32(u[10], k__DCT_CONST_ROUNDING); - v[11] = _mm256_add_epi32(u[11], k__DCT_CONST_ROUNDING); - v[12] = _mm256_add_epi32(u[12], k__DCT_CONST_ROUNDING); - v[13] = _mm256_add_epi32(u[13], k__DCT_CONST_ROUNDING); - v[14] = _mm256_add_epi32(u[14], k__DCT_CONST_ROUNDING); - v[15] = _mm256_add_epi32(u[15], k__DCT_CONST_ROUNDING); - - u[ 0] = _mm256_srai_epi32(v[ 0], DCT_CONST_BITS); - u[ 1] = _mm256_srai_epi32(v[ 1], DCT_CONST_BITS); - u[ 2] = _mm256_srai_epi32(v[ 2], DCT_CONST_BITS); - u[ 3] = _mm256_srai_epi32(v[ 3], DCT_CONST_BITS); - u[ 4] = _mm256_srai_epi32(v[ 4], DCT_CONST_BITS); - u[ 5] = _mm256_srai_epi32(v[ 5], DCT_CONST_BITS); - u[ 6] = _mm256_srai_epi32(v[ 6], DCT_CONST_BITS); - u[ 7] = _mm256_srai_epi32(v[ 7], DCT_CONST_BITS); - u[ 8] = _mm256_srai_epi32(v[ 8], DCT_CONST_BITS); - u[ 9] = _mm256_srai_epi32(v[ 9], DCT_CONST_BITS); - u[10] = _mm256_srai_epi32(v[10], DCT_CONST_BITS); - u[11] = _mm256_srai_epi32(v[11], DCT_CONST_BITS); - u[12] = _mm256_srai_epi32(v[12], DCT_CONST_BITS); - u[13] = _mm256_srai_epi32(v[13], DCT_CONST_BITS); - u[14] = _mm256_srai_epi32(v[14], DCT_CONST_BITS); - u[15] = _mm256_srai_epi32(v[15], DCT_CONST_BITS); - - v[ 0] = _mm256_cmpgt_epi32(kZero,u[ 0]); - v[ 1] = _mm256_cmpgt_epi32(kZero,u[ 1]); - v[ 2] = _mm256_cmpgt_epi32(kZero,u[ 2]); - v[ 3] = _mm256_cmpgt_epi32(kZero,u[ 3]); - v[ 4] = _mm256_cmpgt_epi32(kZero,u[ 4]); - v[ 5] = _mm256_cmpgt_epi32(kZero,u[ 5]); - v[ 6] = _mm256_cmpgt_epi32(kZero,u[ 6]); - v[ 7] = _mm256_cmpgt_epi32(kZero,u[ 7]); - v[ 8] = _mm256_cmpgt_epi32(kZero,u[ 8]); - v[ 9] = _mm256_cmpgt_epi32(kZero,u[ 9]); - v[10] = _mm256_cmpgt_epi32(kZero,u[10]); - v[11] = _mm256_cmpgt_epi32(kZero,u[11]); - v[12] = _mm256_cmpgt_epi32(kZero,u[12]); - v[13] = _mm256_cmpgt_epi32(kZero,u[13]); - v[14] = _mm256_cmpgt_epi32(kZero,u[14]); - v[15] = _mm256_cmpgt_epi32(kZero,u[15]); - - u[ 0] = _mm256_sub_epi32(u[ 0], v[ 0]); - u[ 1] = _mm256_sub_epi32(u[ 1], v[ 1]); - u[ 2] = _mm256_sub_epi32(u[ 2], v[ 2]); - u[ 3] = _mm256_sub_epi32(u[ 3], v[ 3]); - u[ 4] = _mm256_sub_epi32(u[ 4], v[ 4]); - u[ 5] = _mm256_sub_epi32(u[ 5], v[ 5]); - u[ 6] = _mm256_sub_epi32(u[ 6], v[ 6]); - u[ 7] = _mm256_sub_epi32(u[ 7], v[ 7]); - u[ 8] = _mm256_sub_epi32(u[ 8], v[ 8]); - u[ 9] = _mm256_sub_epi32(u[ 9], v[ 9]); - u[10] = _mm256_sub_epi32(u[10], v[10]); - u[11] = _mm256_sub_epi32(u[11], v[11]); - u[12] = _mm256_sub_epi32(u[12], v[12]); - u[13] = _mm256_sub_epi32(u[13], v[13]); - u[14] = _mm256_sub_epi32(u[14], v[14]); - u[15] = _mm256_sub_epi32(u[15], v[15]); - - v[ 0] = _mm256_add_epi32(u[ 0], K32One); - v[ 1] = _mm256_add_epi32(u[ 1], K32One); - v[ 2] = _mm256_add_epi32(u[ 2], K32One); - v[ 3] = _mm256_add_epi32(u[ 3], K32One); - v[ 4] = _mm256_add_epi32(u[ 4], K32One); - v[ 5] = _mm256_add_epi32(u[ 5], K32One); - v[ 6] = _mm256_add_epi32(u[ 6], K32One); - v[ 7] = _mm256_add_epi32(u[ 7], K32One); - v[ 8] = _mm256_add_epi32(u[ 8], K32One); - v[ 9] = _mm256_add_epi32(u[ 9], K32One); - v[10] = _mm256_add_epi32(u[10], K32One); - v[11] = _mm256_add_epi32(u[11], K32One); - v[12] = _mm256_add_epi32(u[12], K32One); - v[13] = _mm256_add_epi32(u[13], K32One); - v[14] = _mm256_add_epi32(u[14], K32One); - v[15] = _mm256_add_epi32(u[15], K32One); - - u[ 0] = _mm256_srai_epi32(v[ 0], 2); - u[ 1] = _mm256_srai_epi32(v[ 1], 2); - u[ 2] = _mm256_srai_epi32(v[ 2], 2); - u[ 3] = _mm256_srai_epi32(v[ 3], 2); - u[ 4] = _mm256_srai_epi32(v[ 4], 2); - u[ 5] = _mm256_srai_epi32(v[ 5], 2); - u[ 6] = _mm256_srai_epi32(v[ 6], 2); - u[ 7] = _mm256_srai_epi32(v[ 7], 2); - u[ 8] = _mm256_srai_epi32(v[ 8], 2); - u[ 9] = _mm256_srai_epi32(v[ 9], 2); - u[10] = _mm256_srai_epi32(v[10], 2); - u[11] = _mm256_srai_epi32(v[11], 2); - u[12] = _mm256_srai_epi32(v[12], 2); - u[13] = _mm256_srai_epi32(v[13], 2); - u[14] = _mm256_srai_epi32(v[14], 2); - u[15] = _mm256_srai_epi32(v[15], 2); - - out[ 2] = _mm256_packs_epi32(u[0], u[1]); - out[18] = _mm256_packs_epi32(u[2], u[3]); - out[10] = _mm256_packs_epi32(u[4], u[5]); - out[26] = _mm256_packs_epi32(u[6], u[7]); - out[ 6] = _mm256_packs_epi32(u[8], u[9]); - out[22] = _mm256_packs_epi32(u[10], u[11]); - out[14] = _mm256_packs_epi32(u[12], u[13]); - out[30] = _mm256_packs_epi32(u[14], u[15]); - } - { - lstep1[32] = _mm256_add_epi32(lstep3[34], lstep2[32]); - lstep1[33] = _mm256_add_epi32(lstep3[35], lstep2[33]); - lstep1[34] = _mm256_sub_epi32(lstep2[32], lstep3[34]); - lstep1[35] = _mm256_sub_epi32(lstep2[33], lstep3[35]); - lstep1[36] = _mm256_sub_epi32(lstep2[38], lstep3[36]); - lstep1[37] = _mm256_sub_epi32(lstep2[39], lstep3[37]); - lstep1[38] = _mm256_add_epi32(lstep3[36], lstep2[38]); - lstep1[39] = _mm256_add_epi32(lstep3[37], lstep2[39]); - lstep1[40] = _mm256_add_epi32(lstep3[42], lstep2[40]); - lstep1[41] = _mm256_add_epi32(lstep3[43], lstep2[41]); - lstep1[42] = _mm256_sub_epi32(lstep2[40], lstep3[42]); - lstep1[43] = _mm256_sub_epi32(lstep2[41], lstep3[43]); - lstep1[44] = _mm256_sub_epi32(lstep2[46], lstep3[44]); - lstep1[45] = _mm256_sub_epi32(lstep2[47], lstep3[45]); - lstep1[46] = _mm256_add_epi32(lstep3[44], lstep2[46]); - lstep1[47] = _mm256_add_epi32(lstep3[45], lstep2[47]); - lstep1[48] = _mm256_add_epi32(lstep3[50], lstep2[48]); - lstep1[49] = _mm256_add_epi32(lstep3[51], lstep2[49]); - lstep1[50] = _mm256_sub_epi32(lstep2[48], lstep3[50]); - lstep1[51] = _mm256_sub_epi32(lstep2[49], lstep3[51]); - lstep1[52] = _mm256_sub_epi32(lstep2[54], lstep3[52]); - lstep1[53] = _mm256_sub_epi32(lstep2[55], lstep3[53]); - lstep1[54] = _mm256_add_epi32(lstep3[52], lstep2[54]); - lstep1[55] = _mm256_add_epi32(lstep3[53], lstep2[55]); - lstep1[56] = _mm256_add_epi32(lstep3[58], lstep2[56]); - lstep1[57] = _mm256_add_epi32(lstep3[59], lstep2[57]); - lstep1[58] = _mm256_sub_epi32(lstep2[56], lstep3[58]); - lstep1[59] = _mm256_sub_epi32(lstep2[57], lstep3[59]); - lstep1[60] = _mm256_sub_epi32(lstep2[62], lstep3[60]); - lstep1[61] = _mm256_sub_epi32(lstep2[63], lstep3[61]); - lstep1[62] = _mm256_add_epi32(lstep3[60], lstep2[62]); - lstep1[63] = _mm256_add_epi32(lstep3[61], lstep2[63]); - } - // stage 8 - { - const __m256i k32_p31_p01 = pair256_set_epi32(cospi_31_64, cospi_1_64); - const __m256i k32_p15_p17 = pair256_set_epi32(cospi_15_64, cospi_17_64); - const __m256i k32_p23_p09 = pair256_set_epi32(cospi_23_64, cospi_9_64); - const __m256i k32_p07_p25 = pair256_set_epi32(cospi_7_64, cospi_25_64); - const __m256i k32_m25_p07 = pair256_set_epi32(-cospi_25_64, cospi_7_64); - const __m256i k32_m09_p23 = pair256_set_epi32(-cospi_9_64, cospi_23_64); - const __m256i k32_m17_p15 = pair256_set_epi32(-cospi_17_64, cospi_15_64); - const __m256i k32_m01_p31 = pair256_set_epi32(-cospi_1_64, cospi_31_64); - - u[ 0] = _mm256_unpacklo_epi32(lstep1[32], lstep1[62]); - u[ 1] = _mm256_unpackhi_epi32(lstep1[32], lstep1[62]); - u[ 2] = _mm256_unpacklo_epi32(lstep1[33], lstep1[63]); - u[ 3] = _mm256_unpackhi_epi32(lstep1[33], lstep1[63]); - u[ 4] = _mm256_unpacklo_epi32(lstep1[34], lstep1[60]); - u[ 5] = _mm256_unpackhi_epi32(lstep1[34], lstep1[60]); - u[ 6] = _mm256_unpacklo_epi32(lstep1[35], lstep1[61]); - u[ 7] = _mm256_unpackhi_epi32(lstep1[35], lstep1[61]); - u[ 8] = _mm256_unpacklo_epi32(lstep1[36], lstep1[58]); - u[ 9] = _mm256_unpackhi_epi32(lstep1[36], lstep1[58]); - u[10] = _mm256_unpacklo_epi32(lstep1[37], lstep1[59]); - u[11] = _mm256_unpackhi_epi32(lstep1[37], lstep1[59]); - u[12] = _mm256_unpacklo_epi32(lstep1[38], lstep1[56]); - u[13] = _mm256_unpackhi_epi32(lstep1[38], lstep1[56]); - u[14] = _mm256_unpacklo_epi32(lstep1[39], lstep1[57]); - u[15] = _mm256_unpackhi_epi32(lstep1[39], lstep1[57]); - - v[ 0] = k_madd_epi32_avx2(u[ 0], k32_p31_p01); - v[ 1] = k_madd_epi32_avx2(u[ 1], k32_p31_p01); - v[ 2] = k_madd_epi32_avx2(u[ 2], k32_p31_p01); - v[ 3] = k_madd_epi32_avx2(u[ 3], k32_p31_p01); - v[ 4] = k_madd_epi32_avx2(u[ 4], k32_p15_p17); - v[ 5] = k_madd_epi32_avx2(u[ 5], k32_p15_p17); - v[ 6] = k_madd_epi32_avx2(u[ 6], k32_p15_p17); - v[ 7] = k_madd_epi32_avx2(u[ 7], k32_p15_p17); - v[ 8] = k_madd_epi32_avx2(u[ 8], k32_p23_p09); - v[ 9] = k_madd_epi32_avx2(u[ 9], k32_p23_p09); - v[10] = k_madd_epi32_avx2(u[10], k32_p23_p09); - v[11] = k_madd_epi32_avx2(u[11], k32_p23_p09); - v[12] = k_madd_epi32_avx2(u[12], k32_p07_p25); - v[13] = k_madd_epi32_avx2(u[13], k32_p07_p25); - v[14] = k_madd_epi32_avx2(u[14], k32_p07_p25); - v[15] = k_madd_epi32_avx2(u[15], k32_p07_p25); - v[16] = k_madd_epi32_avx2(u[12], k32_m25_p07); - v[17] = k_madd_epi32_avx2(u[13], k32_m25_p07); - v[18] = k_madd_epi32_avx2(u[14], k32_m25_p07); - v[19] = k_madd_epi32_avx2(u[15], k32_m25_p07); - v[20] = k_madd_epi32_avx2(u[ 8], k32_m09_p23); - v[21] = k_madd_epi32_avx2(u[ 9], k32_m09_p23); - v[22] = k_madd_epi32_avx2(u[10], k32_m09_p23); - v[23] = k_madd_epi32_avx2(u[11], k32_m09_p23); - v[24] = k_madd_epi32_avx2(u[ 4], k32_m17_p15); - v[25] = k_madd_epi32_avx2(u[ 5], k32_m17_p15); - v[26] = k_madd_epi32_avx2(u[ 6], k32_m17_p15); - v[27] = k_madd_epi32_avx2(u[ 7], k32_m17_p15); - v[28] = k_madd_epi32_avx2(u[ 0], k32_m01_p31); - v[29] = k_madd_epi32_avx2(u[ 1], k32_m01_p31); - v[30] = k_madd_epi32_avx2(u[ 2], k32_m01_p31); - v[31] = k_madd_epi32_avx2(u[ 3], k32_m01_p31); - - u[ 0] = k_packs_epi64_avx2(v[ 0], v[ 1]); - u[ 1] = k_packs_epi64_avx2(v[ 2], v[ 3]); - u[ 2] = k_packs_epi64_avx2(v[ 4], v[ 5]); - u[ 3] = k_packs_epi64_avx2(v[ 6], v[ 7]); - u[ 4] = k_packs_epi64_avx2(v[ 8], v[ 9]); - u[ 5] = k_packs_epi64_avx2(v[10], v[11]); - u[ 6] = k_packs_epi64_avx2(v[12], v[13]); - u[ 7] = k_packs_epi64_avx2(v[14], v[15]); - u[ 8] = k_packs_epi64_avx2(v[16], v[17]); - u[ 9] = k_packs_epi64_avx2(v[18], v[19]); - u[10] = k_packs_epi64_avx2(v[20], v[21]); - u[11] = k_packs_epi64_avx2(v[22], v[23]); - u[12] = k_packs_epi64_avx2(v[24], v[25]); - u[13] = k_packs_epi64_avx2(v[26], v[27]); - u[14] = k_packs_epi64_avx2(v[28], v[29]); - u[15] = k_packs_epi64_avx2(v[30], v[31]); - - v[ 0] = _mm256_add_epi32(u[ 0], k__DCT_CONST_ROUNDING); - v[ 1] = _mm256_add_epi32(u[ 1], k__DCT_CONST_ROUNDING); - v[ 2] = _mm256_add_epi32(u[ 2], k__DCT_CONST_ROUNDING); - v[ 3] = _mm256_add_epi32(u[ 3], k__DCT_CONST_ROUNDING); - v[ 4] = _mm256_add_epi32(u[ 4], k__DCT_CONST_ROUNDING); - v[ 5] = _mm256_add_epi32(u[ 5], k__DCT_CONST_ROUNDING); - v[ 6] = _mm256_add_epi32(u[ 6], k__DCT_CONST_ROUNDING); - v[ 7] = _mm256_add_epi32(u[ 7], k__DCT_CONST_ROUNDING); - v[ 8] = _mm256_add_epi32(u[ 8], k__DCT_CONST_ROUNDING); - v[ 9] = _mm256_add_epi32(u[ 9], k__DCT_CONST_ROUNDING); - v[10] = _mm256_add_epi32(u[10], k__DCT_CONST_ROUNDING); - v[11] = _mm256_add_epi32(u[11], k__DCT_CONST_ROUNDING); - v[12] = _mm256_add_epi32(u[12], k__DCT_CONST_ROUNDING); - v[13] = _mm256_add_epi32(u[13], k__DCT_CONST_ROUNDING); - v[14] = _mm256_add_epi32(u[14], k__DCT_CONST_ROUNDING); - v[15] = _mm256_add_epi32(u[15], k__DCT_CONST_ROUNDING); - - u[ 0] = _mm256_srai_epi32(v[ 0], DCT_CONST_BITS); - u[ 1] = _mm256_srai_epi32(v[ 1], DCT_CONST_BITS); - u[ 2] = _mm256_srai_epi32(v[ 2], DCT_CONST_BITS); - u[ 3] = _mm256_srai_epi32(v[ 3], DCT_CONST_BITS); - u[ 4] = _mm256_srai_epi32(v[ 4], DCT_CONST_BITS); - u[ 5] = _mm256_srai_epi32(v[ 5], DCT_CONST_BITS); - u[ 6] = _mm256_srai_epi32(v[ 6], DCT_CONST_BITS); - u[ 7] = _mm256_srai_epi32(v[ 7], DCT_CONST_BITS); - u[ 8] = _mm256_srai_epi32(v[ 8], DCT_CONST_BITS); - u[ 9] = _mm256_srai_epi32(v[ 9], DCT_CONST_BITS); - u[10] = _mm256_srai_epi32(v[10], DCT_CONST_BITS); - u[11] = _mm256_srai_epi32(v[11], DCT_CONST_BITS); - u[12] = _mm256_srai_epi32(v[12], DCT_CONST_BITS); - u[13] = _mm256_srai_epi32(v[13], DCT_CONST_BITS); - u[14] = _mm256_srai_epi32(v[14], DCT_CONST_BITS); - u[15] = _mm256_srai_epi32(v[15], DCT_CONST_BITS); - - v[ 0] = _mm256_cmpgt_epi32(kZero,u[ 0]); - v[ 1] = _mm256_cmpgt_epi32(kZero,u[ 1]); - v[ 2] = _mm256_cmpgt_epi32(kZero,u[ 2]); - v[ 3] = _mm256_cmpgt_epi32(kZero,u[ 3]); - v[ 4] = _mm256_cmpgt_epi32(kZero,u[ 4]); - v[ 5] = _mm256_cmpgt_epi32(kZero,u[ 5]); - v[ 6] = _mm256_cmpgt_epi32(kZero,u[ 6]); - v[ 7] = _mm256_cmpgt_epi32(kZero,u[ 7]); - v[ 8] = _mm256_cmpgt_epi32(kZero,u[ 8]); - v[ 9] = _mm256_cmpgt_epi32(kZero,u[ 9]); - v[10] = _mm256_cmpgt_epi32(kZero,u[10]); - v[11] = _mm256_cmpgt_epi32(kZero,u[11]); - v[12] = _mm256_cmpgt_epi32(kZero,u[12]); - v[13] = _mm256_cmpgt_epi32(kZero,u[13]); - v[14] = _mm256_cmpgt_epi32(kZero,u[14]); - v[15] = _mm256_cmpgt_epi32(kZero,u[15]); - - u[ 0] = _mm256_sub_epi32(u[ 0], v[ 0]); - u[ 1] = _mm256_sub_epi32(u[ 1], v[ 1]); - u[ 2] = _mm256_sub_epi32(u[ 2], v[ 2]); - u[ 3] = _mm256_sub_epi32(u[ 3], v[ 3]); - u[ 4] = _mm256_sub_epi32(u[ 4], v[ 4]); - u[ 5] = _mm256_sub_epi32(u[ 5], v[ 5]); - u[ 6] = _mm256_sub_epi32(u[ 6], v[ 6]); - u[ 7] = _mm256_sub_epi32(u[ 7], v[ 7]); - u[ 8] = _mm256_sub_epi32(u[ 8], v[ 8]); - u[ 9] = _mm256_sub_epi32(u[ 9], v[ 9]); - u[10] = _mm256_sub_epi32(u[10], v[10]); - u[11] = _mm256_sub_epi32(u[11], v[11]); - u[12] = _mm256_sub_epi32(u[12], v[12]); - u[13] = _mm256_sub_epi32(u[13], v[13]); - u[14] = _mm256_sub_epi32(u[14], v[14]); - u[15] = _mm256_sub_epi32(u[15], v[15]); - - v[0] = _mm256_add_epi32(u[0], K32One); - v[1] = _mm256_add_epi32(u[1], K32One); - v[2] = _mm256_add_epi32(u[2], K32One); - v[3] = _mm256_add_epi32(u[3], K32One); - v[4] = _mm256_add_epi32(u[4], K32One); - v[5] = _mm256_add_epi32(u[5], K32One); - v[6] = _mm256_add_epi32(u[6], K32One); - v[7] = _mm256_add_epi32(u[7], K32One); - v[8] = _mm256_add_epi32(u[8], K32One); - v[9] = _mm256_add_epi32(u[9], K32One); - v[10] = _mm256_add_epi32(u[10], K32One); - v[11] = _mm256_add_epi32(u[11], K32One); - v[12] = _mm256_add_epi32(u[12], K32One); - v[13] = _mm256_add_epi32(u[13], K32One); - v[14] = _mm256_add_epi32(u[14], K32One); - v[15] = _mm256_add_epi32(u[15], K32One); - - u[0] = _mm256_srai_epi32(v[0], 2); - u[1] = _mm256_srai_epi32(v[1], 2); - u[2] = _mm256_srai_epi32(v[2], 2); - u[3] = _mm256_srai_epi32(v[3], 2); - u[4] = _mm256_srai_epi32(v[4], 2); - u[5] = _mm256_srai_epi32(v[5], 2); - u[6] = _mm256_srai_epi32(v[6], 2); - u[7] = _mm256_srai_epi32(v[7], 2); - u[8] = _mm256_srai_epi32(v[8], 2); - u[9] = _mm256_srai_epi32(v[9], 2); - u[10] = _mm256_srai_epi32(v[10], 2); - u[11] = _mm256_srai_epi32(v[11], 2); - u[12] = _mm256_srai_epi32(v[12], 2); - u[13] = _mm256_srai_epi32(v[13], 2); - u[14] = _mm256_srai_epi32(v[14], 2); - u[15] = _mm256_srai_epi32(v[15], 2); - - out[ 1] = _mm256_packs_epi32(u[0], u[1]); - out[17] = _mm256_packs_epi32(u[2], u[3]); - out[ 9] = _mm256_packs_epi32(u[4], u[5]); - out[25] = _mm256_packs_epi32(u[6], u[7]); - out[ 7] = _mm256_packs_epi32(u[8], u[9]); - out[23] = _mm256_packs_epi32(u[10], u[11]); - out[15] = _mm256_packs_epi32(u[12], u[13]); - out[31] = _mm256_packs_epi32(u[14], u[15]); - } - { - const __m256i k32_p27_p05 = pair256_set_epi32(cospi_27_64, cospi_5_64); - const __m256i k32_p11_p21 = pair256_set_epi32(cospi_11_64, cospi_21_64); - const __m256i k32_p19_p13 = pair256_set_epi32(cospi_19_64, cospi_13_64); - const __m256i k32_p03_p29 = pair256_set_epi32(cospi_3_64, cospi_29_64); - const __m256i k32_m29_p03 = pair256_set_epi32(-cospi_29_64, cospi_3_64); - const __m256i k32_m13_p19 = pair256_set_epi32(-cospi_13_64, cospi_19_64); - const __m256i k32_m21_p11 = pair256_set_epi32(-cospi_21_64, cospi_11_64); - const __m256i k32_m05_p27 = pair256_set_epi32(-cospi_5_64, cospi_27_64); - - u[ 0] = _mm256_unpacklo_epi32(lstep1[40], lstep1[54]); - u[ 1] = _mm256_unpackhi_epi32(lstep1[40], lstep1[54]); - u[ 2] = _mm256_unpacklo_epi32(lstep1[41], lstep1[55]); - u[ 3] = _mm256_unpackhi_epi32(lstep1[41], lstep1[55]); - u[ 4] = _mm256_unpacklo_epi32(lstep1[42], lstep1[52]); - u[ 5] = _mm256_unpackhi_epi32(lstep1[42], lstep1[52]); - u[ 6] = _mm256_unpacklo_epi32(lstep1[43], lstep1[53]); - u[ 7] = _mm256_unpackhi_epi32(lstep1[43], lstep1[53]); - u[ 8] = _mm256_unpacklo_epi32(lstep1[44], lstep1[50]); - u[ 9] = _mm256_unpackhi_epi32(lstep1[44], lstep1[50]); - u[10] = _mm256_unpacklo_epi32(lstep1[45], lstep1[51]); - u[11] = _mm256_unpackhi_epi32(lstep1[45], lstep1[51]); - u[12] = _mm256_unpacklo_epi32(lstep1[46], lstep1[48]); - u[13] = _mm256_unpackhi_epi32(lstep1[46], lstep1[48]); - u[14] = _mm256_unpacklo_epi32(lstep1[47], lstep1[49]); - u[15] = _mm256_unpackhi_epi32(lstep1[47], lstep1[49]); - - v[ 0] = k_madd_epi32_avx2(u[ 0], k32_p27_p05); - v[ 1] = k_madd_epi32_avx2(u[ 1], k32_p27_p05); - v[ 2] = k_madd_epi32_avx2(u[ 2], k32_p27_p05); - v[ 3] = k_madd_epi32_avx2(u[ 3], k32_p27_p05); - v[ 4] = k_madd_epi32_avx2(u[ 4], k32_p11_p21); - v[ 5] = k_madd_epi32_avx2(u[ 5], k32_p11_p21); - v[ 6] = k_madd_epi32_avx2(u[ 6], k32_p11_p21); - v[ 7] = k_madd_epi32_avx2(u[ 7], k32_p11_p21); - v[ 8] = k_madd_epi32_avx2(u[ 8], k32_p19_p13); - v[ 9] = k_madd_epi32_avx2(u[ 9], k32_p19_p13); - v[10] = k_madd_epi32_avx2(u[10], k32_p19_p13); - v[11] = k_madd_epi32_avx2(u[11], k32_p19_p13); - v[12] = k_madd_epi32_avx2(u[12], k32_p03_p29); - v[13] = k_madd_epi32_avx2(u[13], k32_p03_p29); - v[14] = k_madd_epi32_avx2(u[14], k32_p03_p29); - v[15] = k_madd_epi32_avx2(u[15], k32_p03_p29); - v[16] = k_madd_epi32_avx2(u[12], k32_m29_p03); - v[17] = k_madd_epi32_avx2(u[13], k32_m29_p03); - v[18] = k_madd_epi32_avx2(u[14], k32_m29_p03); - v[19] = k_madd_epi32_avx2(u[15], k32_m29_p03); - v[20] = k_madd_epi32_avx2(u[ 8], k32_m13_p19); - v[21] = k_madd_epi32_avx2(u[ 9], k32_m13_p19); - v[22] = k_madd_epi32_avx2(u[10], k32_m13_p19); - v[23] = k_madd_epi32_avx2(u[11], k32_m13_p19); - v[24] = k_madd_epi32_avx2(u[ 4], k32_m21_p11); - v[25] = k_madd_epi32_avx2(u[ 5], k32_m21_p11); - v[26] = k_madd_epi32_avx2(u[ 6], k32_m21_p11); - v[27] = k_madd_epi32_avx2(u[ 7], k32_m21_p11); - v[28] = k_madd_epi32_avx2(u[ 0], k32_m05_p27); - v[29] = k_madd_epi32_avx2(u[ 1], k32_m05_p27); - v[30] = k_madd_epi32_avx2(u[ 2], k32_m05_p27); - v[31] = k_madd_epi32_avx2(u[ 3], k32_m05_p27); - - u[ 0] = k_packs_epi64_avx2(v[ 0], v[ 1]); - u[ 1] = k_packs_epi64_avx2(v[ 2], v[ 3]); - u[ 2] = k_packs_epi64_avx2(v[ 4], v[ 5]); - u[ 3] = k_packs_epi64_avx2(v[ 6], v[ 7]); - u[ 4] = k_packs_epi64_avx2(v[ 8], v[ 9]); - u[ 5] = k_packs_epi64_avx2(v[10], v[11]); - u[ 6] = k_packs_epi64_avx2(v[12], v[13]); - u[ 7] = k_packs_epi64_avx2(v[14], v[15]); - u[ 8] = k_packs_epi64_avx2(v[16], v[17]); - u[ 9] = k_packs_epi64_avx2(v[18], v[19]); - u[10] = k_packs_epi64_avx2(v[20], v[21]); - u[11] = k_packs_epi64_avx2(v[22], v[23]); - u[12] = k_packs_epi64_avx2(v[24], v[25]); - u[13] = k_packs_epi64_avx2(v[26], v[27]); - u[14] = k_packs_epi64_avx2(v[28], v[29]); - u[15] = k_packs_epi64_avx2(v[30], v[31]); - - v[ 0] = _mm256_add_epi32(u[ 0], k__DCT_CONST_ROUNDING); - v[ 1] = _mm256_add_epi32(u[ 1], k__DCT_CONST_ROUNDING); - v[ 2] = _mm256_add_epi32(u[ 2], k__DCT_CONST_ROUNDING); - v[ 3] = _mm256_add_epi32(u[ 3], k__DCT_CONST_ROUNDING); - v[ 4] = _mm256_add_epi32(u[ 4], k__DCT_CONST_ROUNDING); - v[ 5] = _mm256_add_epi32(u[ 5], k__DCT_CONST_ROUNDING); - v[ 6] = _mm256_add_epi32(u[ 6], k__DCT_CONST_ROUNDING); - v[ 7] = _mm256_add_epi32(u[ 7], k__DCT_CONST_ROUNDING); - v[ 8] = _mm256_add_epi32(u[ 8], k__DCT_CONST_ROUNDING); - v[ 9] = _mm256_add_epi32(u[ 9], k__DCT_CONST_ROUNDING); - v[10] = _mm256_add_epi32(u[10], k__DCT_CONST_ROUNDING); - v[11] = _mm256_add_epi32(u[11], k__DCT_CONST_ROUNDING); - v[12] = _mm256_add_epi32(u[12], k__DCT_CONST_ROUNDING); - v[13] = _mm256_add_epi32(u[13], k__DCT_CONST_ROUNDING); - v[14] = _mm256_add_epi32(u[14], k__DCT_CONST_ROUNDING); - v[15] = _mm256_add_epi32(u[15], k__DCT_CONST_ROUNDING); - - u[ 0] = _mm256_srai_epi32(v[ 0], DCT_CONST_BITS); - u[ 1] = _mm256_srai_epi32(v[ 1], DCT_CONST_BITS); - u[ 2] = _mm256_srai_epi32(v[ 2], DCT_CONST_BITS); - u[ 3] = _mm256_srai_epi32(v[ 3], DCT_CONST_BITS); - u[ 4] = _mm256_srai_epi32(v[ 4], DCT_CONST_BITS); - u[ 5] = _mm256_srai_epi32(v[ 5], DCT_CONST_BITS); - u[ 6] = _mm256_srai_epi32(v[ 6], DCT_CONST_BITS); - u[ 7] = _mm256_srai_epi32(v[ 7], DCT_CONST_BITS); - u[ 8] = _mm256_srai_epi32(v[ 8], DCT_CONST_BITS); - u[ 9] = _mm256_srai_epi32(v[ 9], DCT_CONST_BITS); - u[10] = _mm256_srai_epi32(v[10], DCT_CONST_BITS); - u[11] = _mm256_srai_epi32(v[11], DCT_CONST_BITS); - u[12] = _mm256_srai_epi32(v[12], DCT_CONST_BITS); - u[13] = _mm256_srai_epi32(v[13], DCT_CONST_BITS); - u[14] = _mm256_srai_epi32(v[14], DCT_CONST_BITS); - u[15] = _mm256_srai_epi32(v[15], DCT_CONST_BITS); - - v[ 0] = _mm256_cmpgt_epi32(kZero,u[ 0]); - v[ 1] = _mm256_cmpgt_epi32(kZero,u[ 1]); - v[ 2] = _mm256_cmpgt_epi32(kZero,u[ 2]); - v[ 3] = _mm256_cmpgt_epi32(kZero,u[ 3]); - v[ 4] = _mm256_cmpgt_epi32(kZero,u[ 4]); - v[ 5] = _mm256_cmpgt_epi32(kZero,u[ 5]); - v[ 6] = _mm256_cmpgt_epi32(kZero,u[ 6]); - v[ 7] = _mm256_cmpgt_epi32(kZero,u[ 7]); - v[ 8] = _mm256_cmpgt_epi32(kZero,u[ 8]); - v[ 9] = _mm256_cmpgt_epi32(kZero,u[ 9]); - v[10] = _mm256_cmpgt_epi32(kZero,u[10]); - v[11] = _mm256_cmpgt_epi32(kZero,u[11]); - v[12] = _mm256_cmpgt_epi32(kZero,u[12]); - v[13] = _mm256_cmpgt_epi32(kZero,u[13]); - v[14] = _mm256_cmpgt_epi32(kZero,u[14]); - v[15] = _mm256_cmpgt_epi32(kZero,u[15]); - - u[ 0] = _mm256_sub_epi32(u[ 0], v[ 0]); - u[ 1] = _mm256_sub_epi32(u[ 1], v[ 1]); - u[ 2] = _mm256_sub_epi32(u[ 2], v[ 2]); - u[ 3] = _mm256_sub_epi32(u[ 3], v[ 3]); - u[ 4] = _mm256_sub_epi32(u[ 4], v[ 4]); - u[ 5] = _mm256_sub_epi32(u[ 5], v[ 5]); - u[ 6] = _mm256_sub_epi32(u[ 6], v[ 6]); - u[ 7] = _mm256_sub_epi32(u[ 7], v[ 7]); - u[ 8] = _mm256_sub_epi32(u[ 8], v[ 8]); - u[ 9] = _mm256_sub_epi32(u[ 9], v[ 9]); - u[10] = _mm256_sub_epi32(u[10], v[10]); - u[11] = _mm256_sub_epi32(u[11], v[11]); - u[12] = _mm256_sub_epi32(u[12], v[12]); - u[13] = _mm256_sub_epi32(u[13], v[13]); - u[14] = _mm256_sub_epi32(u[14], v[14]); - u[15] = _mm256_sub_epi32(u[15], v[15]); - - v[0] = _mm256_add_epi32(u[0], K32One); - v[1] = _mm256_add_epi32(u[1], K32One); - v[2] = _mm256_add_epi32(u[2], K32One); - v[3] = _mm256_add_epi32(u[3], K32One); - v[4] = _mm256_add_epi32(u[4], K32One); - v[5] = _mm256_add_epi32(u[5], K32One); - v[6] = _mm256_add_epi32(u[6], K32One); - v[7] = _mm256_add_epi32(u[7], K32One); - v[8] = _mm256_add_epi32(u[8], K32One); - v[9] = _mm256_add_epi32(u[9], K32One); - v[10] = _mm256_add_epi32(u[10], K32One); - v[11] = _mm256_add_epi32(u[11], K32One); - v[12] = _mm256_add_epi32(u[12], K32One); - v[13] = _mm256_add_epi32(u[13], K32One); - v[14] = _mm256_add_epi32(u[14], K32One); - v[15] = _mm256_add_epi32(u[15], K32One); - - u[0] = _mm256_srai_epi32(v[0], 2); - u[1] = _mm256_srai_epi32(v[1], 2); - u[2] = _mm256_srai_epi32(v[2], 2); - u[3] = _mm256_srai_epi32(v[3], 2); - u[4] = _mm256_srai_epi32(v[4], 2); - u[5] = _mm256_srai_epi32(v[5], 2); - u[6] = _mm256_srai_epi32(v[6], 2); - u[7] = _mm256_srai_epi32(v[7], 2); - u[8] = _mm256_srai_epi32(v[8], 2); - u[9] = _mm256_srai_epi32(v[9], 2); - u[10] = _mm256_srai_epi32(v[10], 2); - u[11] = _mm256_srai_epi32(v[11], 2); - u[12] = _mm256_srai_epi32(v[12], 2); - u[13] = _mm256_srai_epi32(v[13], 2); - u[14] = _mm256_srai_epi32(v[14], 2); - u[15] = _mm256_srai_epi32(v[15], 2); - - out[ 5] = _mm256_packs_epi32(u[0], u[1]); - out[21] = _mm256_packs_epi32(u[2], u[3]); - out[13] = _mm256_packs_epi32(u[4], u[5]); - out[29] = _mm256_packs_epi32(u[6], u[7]); - out[ 3] = _mm256_packs_epi32(u[8], u[9]); - out[19] = _mm256_packs_epi32(u[10], u[11]); - out[11] = _mm256_packs_epi32(u[12], u[13]); - out[27] = _mm256_packs_epi32(u[14], u[15]); - } - } -#endif - // Transpose the results, do it as four 8x8 transposes. - { - int transpose_block; - int16_t *output_currStep,*output_nextStep; - if (0 == pass){ - output_currStep = &intermediate[column_start * 32]; - output_nextStep = &intermediate[(column_start + 8) * 32]; - } else{ - output_currStep = &output_org[column_start * 32]; - output_nextStep = &output_org[(column_start + 8) * 32]; - } - for (transpose_block = 0; transpose_block < 4; ++transpose_block) { - __m256i *this_out = &out[8 * transpose_block]; - // 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 - // 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 - // 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 - // 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 - // 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 - // 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 - // 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 - // 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 - const __m256i tr0_0 = _mm256_unpacklo_epi16(this_out[0], this_out[1]); - const __m256i tr0_1 = _mm256_unpacklo_epi16(this_out[2], this_out[3]); - const __m256i tr0_2 = _mm256_unpackhi_epi16(this_out[0], this_out[1]); - const __m256i tr0_3 = _mm256_unpackhi_epi16(this_out[2], this_out[3]); - const __m256i tr0_4 = _mm256_unpacklo_epi16(this_out[4], this_out[5]); - const __m256i tr0_5 = _mm256_unpacklo_epi16(this_out[6], this_out[7]); - const __m256i tr0_6 = _mm256_unpackhi_epi16(this_out[4], this_out[5]); - const __m256i tr0_7 = _mm256_unpackhi_epi16(this_out[6], this_out[7]); - // 00 20 01 21 02 22 03 23 08 28 09 29 10 30 11 31 - // 40 60 41 61 42 62 43 63 48 68 49 69 50 70 51 71 - // 04 24 05 25 06 26 07 27 12 32 13 33 14 34 15 35 - // 44 64 45 65 46 66 47 67 52 72 53 73 54 74 55 75 - // 80 100 81 101 82 102 83 103 88 108 89 109 90 110 91 101 - // 120 140 121 141 122 142 123 143 128 148 129 149 130 150 131 151 - // 84 104 85 105 86 106 87 107 92 112 93 113 94 114 95 115 - // 124 144 125 145 126 146 127 147 132 152 133 153 134 154 135 155 - - const __m256i tr1_0 = _mm256_unpacklo_epi32(tr0_0, tr0_1); - const __m256i tr1_1 = _mm256_unpacklo_epi32(tr0_2, tr0_3); - const __m256i tr1_2 = _mm256_unpackhi_epi32(tr0_0, tr0_1); - const __m256i tr1_3 = _mm256_unpackhi_epi32(tr0_2, tr0_3); - const __m256i tr1_4 = _mm256_unpacklo_epi32(tr0_4, tr0_5); - const __m256i tr1_5 = _mm256_unpacklo_epi32(tr0_6, tr0_7); - const __m256i tr1_6 = _mm256_unpackhi_epi32(tr0_4, tr0_5); - const __m256i tr1_7 = _mm256_unpackhi_epi32(tr0_6, tr0_7); - // 00 20 40 60 01 21 41 61 08 28 48 68 09 29 49 69 - // 04 24 44 64 05 25 45 65 12 32 52 72 13 33 53 73 - // 02 22 42 62 03 23 43 63 10 30 50 70 11 31 51 71 - // 06 26 46 66 07 27 47 67 14 34 54 74 15 35 55 75 - // 80 100 120 140 81 101 121 141 88 108 128 148 89 109 129 149 - // 84 104 124 144 85 105 125 145 92 112 132 152 93 113 133 153 - // 82 102 122 142 83 103 123 143 90 110 130 150 91 101 131 151 - // 86 106 126 146 87 107 127 147 94 114 134 154 95 115 135 155 - __m256i tr2_0 = _mm256_unpacklo_epi64(tr1_0, tr1_4); - __m256i tr2_1 = _mm256_unpackhi_epi64(tr1_0, tr1_4); - __m256i tr2_2 = _mm256_unpacklo_epi64(tr1_2, tr1_6); - __m256i tr2_3 = _mm256_unpackhi_epi64(tr1_2, tr1_6); - __m256i tr2_4 = _mm256_unpacklo_epi64(tr1_1, tr1_5); - __m256i tr2_5 = _mm256_unpackhi_epi64(tr1_1, tr1_5); - __m256i tr2_6 = _mm256_unpacklo_epi64(tr1_3, tr1_7); - __m256i tr2_7 = _mm256_unpackhi_epi64(tr1_3, tr1_7); - // 00 20 40 60 80 100 120 140 08 28 48 68 88 108 128 148 - // 01 21 41 61 81 101 121 141 09 29 49 69 89 109 129 149 - // 02 22 42 62 82 102 122 142 10 30 50 70 90 110 130 150 - // 03 23 43 63 83 103 123 143 11 31 51 71 91 101 131 151 - // 04 24 44 64 84 104 124 144 12 32 52 72 92 112 132 152 - // 05 25 45 65 85 105 125 145 13 33 53 73 93 113 133 153 - // 06 26 46 66 86 106 126 146 14 34 54 74 94 114 134 154 - // 07 27 47 67 87 107 127 147 15 35 55 75 95 115 135 155 - if (0 == pass) { - // output[j] = (output[j] + 1 + (output[j] > 0)) >> 2; - // TODO(cd): see quality impact of only doing - // output[j] = (output[j] + 1) >> 2; - // which would remove the code between here ... - __m256i tr2_0_0 = _mm256_cmpgt_epi16(tr2_0, kZero); - __m256i tr2_1_0 = _mm256_cmpgt_epi16(tr2_1, kZero); - __m256i tr2_2_0 = _mm256_cmpgt_epi16(tr2_2, kZero); - __m256i tr2_3_0 = _mm256_cmpgt_epi16(tr2_3, kZero); - __m256i tr2_4_0 = _mm256_cmpgt_epi16(tr2_4, kZero); - __m256i tr2_5_0 = _mm256_cmpgt_epi16(tr2_5, kZero); - __m256i tr2_6_0 = _mm256_cmpgt_epi16(tr2_6, kZero); - __m256i tr2_7_0 = _mm256_cmpgt_epi16(tr2_7, kZero); - tr2_0 = _mm256_sub_epi16(tr2_0, tr2_0_0); - tr2_1 = _mm256_sub_epi16(tr2_1, tr2_1_0); - tr2_2 = _mm256_sub_epi16(tr2_2, tr2_2_0); - tr2_3 = _mm256_sub_epi16(tr2_3, tr2_3_0); - tr2_4 = _mm256_sub_epi16(tr2_4, tr2_4_0); - tr2_5 = _mm256_sub_epi16(tr2_5, tr2_5_0); - tr2_6 = _mm256_sub_epi16(tr2_6, tr2_6_0); - tr2_7 = _mm256_sub_epi16(tr2_7, tr2_7_0); - // ... and here. - // PS: also change code in vp9/encoder/vp9_dct.c - tr2_0 = _mm256_add_epi16(tr2_0, kOne); - tr2_1 = _mm256_add_epi16(tr2_1, kOne); - tr2_2 = _mm256_add_epi16(tr2_2, kOne); - tr2_3 = _mm256_add_epi16(tr2_3, kOne); - tr2_4 = _mm256_add_epi16(tr2_4, kOne); - tr2_5 = _mm256_add_epi16(tr2_5, kOne); - tr2_6 = _mm256_add_epi16(tr2_6, kOne); - tr2_7 = _mm256_add_epi16(tr2_7, kOne); - tr2_0 = _mm256_srai_epi16(tr2_0, 2); - tr2_1 = _mm256_srai_epi16(tr2_1, 2); - tr2_2 = _mm256_srai_epi16(tr2_2, 2); - tr2_3 = _mm256_srai_epi16(tr2_3, 2); - tr2_4 = _mm256_srai_epi16(tr2_4, 2); - tr2_5 = _mm256_srai_epi16(tr2_5, 2); - tr2_6 = _mm256_srai_epi16(tr2_6, 2); - tr2_7 = _mm256_srai_epi16(tr2_7, 2); - } - // Note: even though all these stores are aligned, using the aligned - // intrinsic make the code slightly slower. - _mm_storeu_si128((__m128i *)(output_currStep + 0 * 32), _mm256_castsi256_si128(tr2_0)); - _mm_storeu_si128((__m128i *)(output_currStep + 1 * 32), _mm256_castsi256_si128(tr2_1)); - _mm_storeu_si128((__m128i *)(output_currStep + 2 * 32), _mm256_castsi256_si128(tr2_2)); - _mm_storeu_si128((__m128i *)(output_currStep + 3 * 32), _mm256_castsi256_si128(tr2_3)); - _mm_storeu_si128((__m128i *)(output_currStep + 4 * 32), _mm256_castsi256_si128(tr2_4)); - _mm_storeu_si128((__m128i *)(output_currStep + 5 * 32), _mm256_castsi256_si128(tr2_5)); - _mm_storeu_si128((__m128i *)(output_currStep + 6 * 32), _mm256_castsi256_si128(tr2_6)); - _mm_storeu_si128((__m128i *)(output_currStep + 7 * 32), _mm256_castsi256_si128(tr2_7)); - - _mm_storeu_si128((__m128i *)(output_nextStep + 0 * 32), _mm256_extractf128_si256(tr2_0,1)); - _mm_storeu_si128((__m128i *)(output_nextStep + 1 * 32), _mm256_extractf128_si256(tr2_1,1)); - _mm_storeu_si128((__m128i *)(output_nextStep + 2 * 32), _mm256_extractf128_si256(tr2_2,1)); - _mm_storeu_si128((__m128i *)(output_nextStep + 3 * 32), _mm256_extractf128_si256(tr2_3,1)); - _mm_storeu_si128((__m128i *)(output_nextStep + 4 * 32), _mm256_extractf128_si256(tr2_4,1)); - _mm_storeu_si128((__m128i *)(output_nextStep + 5 * 32), _mm256_extractf128_si256(tr2_5,1)); - _mm_storeu_si128((__m128i *)(output_nextStep + 6 * 32), _mm256_extractf128_si256(tr2_6,1)); - _mm_storeu_si128((__m128i *)(output_nextStep + 7 * 32), _mm256_extractf128_si256(tr2_7,1)); - // Process next 8x8 - output_currStep += 8; - output_nextStep += 8; - } - } - } - } -} // NOLINT diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct32x32_sse2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct32x32_sse2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct32x32_sse2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct32x32_sse2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,3149 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include // SSE2 -#include "vp9/common/vp9_idct.h" // for cospi constants -#include "vp9/encoder/x86/vp9_dct_sse2.h" -#include "vp9/encoder/vp9_dct.h" -#include "vpx_ports/mem.h" - -#if DCT_HIGH_BIT_DEPTH -#define ADD_EPI16 _mm_adds_epi16 -#define SUB_EPI16 _mm_subs_epi16 -#if FDCT32x32_HIGH_PRECISION -void vp9_fdct32x32_rows_c(const int16_t *intermediate, tran_low_t *out) { - int i, j; - for (i = 0; i < 32; ++i) { - tran_high_t temp_in[32], temp_out[32]; - for (j = 0; j < 32; ++j) - temp_in[j] = intermediate[j * 32 + i]; - vp9_fdct32(temp_in, temp_out, 0); - for (j = 0; j < 32; ++j) - out[j + i * 32] = (temp_out[j] + 1 + (temp_out[j] < 0)) >> 2; - } -} - #define HIGH_FDCT32x32_2D_C vp9_highbd_fdct32x32_c - #define HIGH_FDCT32x32_2D_ROWS_C vp9_fdct32x32_rows_c -#else -void vp9_fdct32x32_rd_rows_c(const int16_t *intermediate, tran_low_t *out) { - int i, j; - for (i = 0; i < 32; ++i) { - tran_high_t temp_in[32], temp_out[32]; - for (j = 0; j < 32; ++j) - temp_in[j] = intermediate[j * 32 + i]; - vp9_fdct32(temp_in, temp_out, 1); - for (j = 0; j < 32; ++j) - out[j + i * 32] = temp_out[j]; - } -} - #define HIGH_FDCT32x32_2D_C vp9_highbd_fdct32x32_rd_c - #define HIGH_FDCT32x32_2D_ROWS_C vp9_fdct32x32_rd_rows_c -#endif // FDCT32x32_HIGH_PRECISION -#else -#define ADD_EPI16 _mm_add_epi16 -#define SUB_EPI16 _mm_sub_epi16 -#endif // DCT_HIGH_BIT_DEPTH - - -void FDCT32x32_2D(const int16_t *input, - tran_low_t *output_org, int stride) { - // Calculate pre-multiplied strides - const int str1 = stride; - const int str2 = 2 * stride; - const int str3 = 2 * stride + str1; - // We need an intermediate buffer between passes. - DECLARE_ALIGNED(16, int16_t, intermediate[32 * 32]); - // Constants - // When we use them, in one case, they are all the same. In all others - // it's a pair of them that we need to repeat four times. This is done - // by constructing the 32 bit constant corresponding to that pair. - const __m128i k__cospi_p16_p16 = _mm_set1_epi16((int16_t)cospi_16_64); - const __m128i k__cospi_p16_m16 = pair_set_epi16(+cospi_16_64, -cospi_16_64); - const __m128i k__cospi_m08_p24 = pair_set_epi16(-cospi_8_64, cospi_24_64); - const __m128i k__cospi_m24_m08 = pair_set_epi16(-cospi_24_64, -cospi_8_64); - const __m128i k__cospi_p24_p08 = pair_set_epi16(+cospi_24_64, cospi_8_64); - const __m128i k__cospi_p12_p20 = pair_set_epi16(+cospi_12_64, cospi_20_64); - const __m128i k__cospi_m20_p12 = pair_set_epi16(-cospi_20_64, cospi_12_64); - const __m128i k__cospi_m04_p28 = pair_set_epi16(-cospi_4_64, cospi_28_64); - const __m128i k__cospi_p28_p04 = pair_set_epi16(+cospi_28_64, cospi_4_64); - const __m128i k__cospi_m28_m04 = pair_set_epi16(-cospi_28_64, -cospi_4_64); - const __m128i k__cospi_m12_m20 = pair_set_epi16(-cospi_12_64, -cospi_20_64); - const __m128i k__cospi_p30_p02 = pair_set_epi16(+cospi_30_64, cospi_2_64); - const __m128i k__cospi_p14_p18 = pair_set_epi16(+cospi_14_64, cospi_18_64); - const __m128i k__cospi_p22_p10 = pair_set_epi16(+cospi_22_64, cospi_10_64); - const __m128i k__cospi_p06_p26 = pair_set_epi16(+cospi_6_64, cospi_26_64); - const __m128i k__cospi_m26_p06 = pair_set_epi16(-cospi_26_64, cospi_6_64); - const __m128i k__cospi_m10_p22 = pair_set_epi16(-cospi_10_64, cospi_22_64); - const __m128i k__cospi_m18_p14 = pair_set_epi16(-cospi_18_64, cospi_14_64); - const __m128i k__cospi_m02_p30 = pair_set_epi16(-cospi_2_64, cospi_30_64); - const __m128i k__cospi_p31_p01 = pair_set_epi16(+cospi_31_64, cospi_1_64); - const __m128i k__cospi_p15_p17 = pair_set_epi16(+cospi_15_64, cospi_17_64); - const __m128i k__cospi_p23_p09 = pair_set_epi16(+cospi_23_64, cospi_9_64); - const __m128i k__cospi_p07_p25 = pair_set_epi16(+cospi_7_64, cospi_25_64); - const __m128i k__cospi_m25_p07 = pair_set_epi16(-cospi_25_64, cospi_7_64); - const __m128i k__cospi_m09_p23 = pair_set_epi16(-cospi_9_64, cospi_23_64); - const __m128i k__cospi_m17_p15 = pair_set_epi16(-cospi_17_64, cospi_15_64); - const __m128i k__cospi_m01_p31 = pair_set_epi16(-cospi_1_64, cospi_31_64); - const __m128i k__cospi_p27_p05 = pair_set_epi16(+cospi_27_64, cospi_5_64); - const __m128i k__cospi_p11_p21 = pair_set_epi16(+cospi_11_64, cospi_21_64); - const __m128i k__cospi_p19_p13 = pair_set_epi16(+cospi_19_64, cospi_13_64); - const __m128i k__cospi_p03_p29 = pair_set_epi16(+cospi_3_64, cospi_29_64); - const __m128i k__cospi_m29_p03 = pair_set_epi16(-cospi_29_64, cospi_3_64); - const __m128i k__cospi_m13_p19 = pair_set_epi16(-cospi_13_64, cospi_19_64); - const __m128i k__cospi_m21_p11 = pair_set_epi16(-cospi_21_64, cospi_11_64); - const __m128i k__cospi_m05_p27 = pair_set_epi16(-cospi_5_64, cospi_27_64); - const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING); - const __m128i kZero = _mm_set1_epi16(0); - const __m128i kOne = _mm_set1_epi16(1); - // Do the two transform/transpose passes - int pass; -#if DCT_HIGH_BIT_DEPTH - int overflow; -#endif - for (pass = 0; pass < 2; ++pass) { - // We process eight columns (transposed rows in second pass) at a time. - int column_start; - for (column_start = 0; column_start < 32; column_start += 8) { - __m128i step1[32]; - __m128i step2[32]; - __m128i step3[32]; - __m128i out[32]; - // Stage 1 - // Note: even though all the loads below are aligned, using the aligned - // intrinsic make the code slightly slower. - if (0 == pass) { - const int16_t *in = &input[column_start]; - // step1[i] = (in[ 0 * stride] + in[(32 - 1) * stride]) << 2; - // Note: the next four blocks could be in a loop. That would help the - // instruction cache but is actually slower. - { - const int16_t *ina = in + 0 * str1; - const int16_t *inb = in + 31 * str1; - __m128i *step1a = &step1[ 0]; - __m128i *step1b = &step1[31]; - const __m128i ina0 = _mm_loadu_si128((const __m128i *)(ina)); - const __m128i ina1 = _mm_loadu_si128((const __m128i *)(ina + str1)); - const __m128i ina2 = _mm_loadu_si128((const __m128i *)(ina + str2)); - const __m128i ina3 = _mm_loadu_si128((const __m128i *)(ina + str3)); - const __m128i inb3 = _mm_loadu_si128((const __m128i *)(inb - str3)); - const __m128i inb2 = _mm_loadu_si128((const __m128i *)(inb - str2)); - const __m128i inb1 = _mm_loadu_si128((const __m128i *)(inb - str1)); - const __m128i inb0 = _mm_loadu_si128((const __m128i *)(inb)); - step1a[ 0] = _mm_add_epi16(ina0, inb0); - step1a[ 1] = _mm_add_epi16(ina1, inb1); - step1a[ 2] = _mm_add_epi16(ina2, inb2); - step1a[ 3] = _mm_add_epi16(ina3, inb3); - step1b[-3] = _mm_sub_epi16(ina3, inb3); - step1b[-2] = _mm_sub_epi16(ina2, inb2); - step1b[-1] = _mm_sub_epi16(ina1, inb1); - step1b[-0] = _mm_sub_epi16(ina0, inb0); - step1a[ 0] = _mm_slli_epi16(step1a[ 0], 2); - step1a[ 1] = _mm_slli_epi16(step1a[ 1], 2); - step1a[ 2] = _mm_slli_epi16(step1a[ 2], 2); - step1a[ 3] = _mm_slli_epi16(step1a[ 3], 2); - step1b[-3] = _mm_slli_epi16(step1b[-3], 2); - step1b[-2] = _mm_slli_epi16(step1b[-2], 2); - step1b[-1] = _mm_slli_epi16(step1b[-1], 2); - step1b[-0] = _mm_slli_epi16(step1b[-0], 2); - } - { - const int16_t *ina = in + 4 * str1; - const int16_t *inb = in + 27 * str1; - __m128i *step1a = &step1[ 4]; - __m128i *step1b = &step1[27]; - const __m128i ina0 = _mm_loadu_si128((const __m128i *)(ina)); - const __m128i ina1 = _mm_loadu_si128((const __m128i *)(ina + str1)); - const __m128i ina2 = _mm_loadu_si128((const __m128i *)(ina + str2)); - const __m128i ina3 = _mm_loadu_si128((const __m128i *)(ina + str3)); - const __m128i inb3 = _mm_loadu_si128((const __m128i *)(inb - str3)); - const __m128i inb2 = _mm_loadu_si128((const __m128i *)(inb - str2)); - const __m128i inb1 = _mm_loadu_si128((const __m128i *)(inb - str1)); - const __m128i inb0 = _mm_loadu_si128((const __m128i *)(inb)); - step1a[ 0] = _mm_add_epi16(ina0, inb0); - step1a[ 1] = _mm_add_epi16(ina1, inb1); - step1a[ 2] = _mm_add_epi16(ina2, inb2); - step1a[ 3] = _mm_add_epi16(ina3, inb3); - step1b[-3] = _mm_sub_epi16(ina3, inb3); - step1b[-2] = _mm_sub_epi16(ina2, inb2); - step1b[-1] = _mm_sub_epi16(ina1, inb1); - step1b[-0] = _mm_sub_epi16(ina0, inb0); - step1a[ 0] = _mm_slli_epi16(step1a[ 0], 2); - step1a[ 1] = _mm_slli_epi16(step1a[ 1], 2); - step1a[ 2] = _mm_slli_epi16(step1a[ 2], 2); - step1a[ 3] = _mm_slli_epi16(step1a[ 3], 2); - step1b[-3] = _mm_slli_epi16(step1b[-3], 2); - step1b[-2] = _mm_slli_epi16(step1b[-2], 2); - step1b[-1] = _mm_slli_epi16(step1b[-1], 2); - step1b[-0] = _mm_slli_epi16(step1b[-0], 2); - } - { - const int16_t *ina = in + 8 * str1; - const int16_t *inb = in + 23 * str1; - __m128i *step1a = &step1[ 8]; - __m128i *step1b = &step1[23]; - const __m128i ina0 = _mm_loadu_si128((const __m128i *)(ina)); - const __m128i ina1 = _mm_loadu_si128((const __m128i *)(ina + str1)); - const __m128i ina2 = _mm_loadu_si128((const __m128i *)(ina + str2)); - const __m128i ina3 = _mm_loadu_si128((const __m128i *)(ina + str3)); - const __m128i inb3 = _mm_loadu_si128((const __m128i *)(inb - str3)); - const __m128i inb2 = _mm_loadu_si128((const __m128i *)(inb - str2)); - const __m128i inb1 = _mm_loadu_si128((const __m128i *)(inb - str1)); - const __m128i inb0 = _mm_loadu_si128((const __m128i *)(inb)); - step1a[ 0] = _mm_add_epi16(ina0, inb0); - step1a[ 1] = _mm_add_epi16(ina1, inb1); - step1a[ 2] = _mm_add_epi16(ina2, inb2); - step1a[ 3] = _mm_add_epi16(ina3, inb3); - step1b[-3] = _mm_sub_epi16(ina3, inb3); - step1b[-2] = _mm_sub_epi16(ina2, inb2); - step1b[-1] = _mm_sub_epi16(ina1, inb1); - step1b[-0] = _mm_sub_epi16(ina0, inb0); - step1a[ 0] = _mm_slli_epi16(step1a[ 0], 2); - step1a[ 1] = _mm_slli_epi16(step1a[ 1], 2); - step1a[ 2] = _mm_slli_epi16(step1a[ 2], 2); - step1a[ 3] = _mm_slli_epi16(step1a[ 3], 2); - step1b[-3] = _mm_slli_epi16(step1b[-3], 2); - step1b[-2] = _mm_slli_epi16(step1b[-2], 2); - step1b[-1] = _mm_slli_epi16(step1b[-1], 2); - step1b[-0] = _mm_slli_epi16(step1b[-0], 2); - } - { - const int16_t *ina = in + 12 * str1; - const int16_t *inb = in + 19 * str1; - __m128i *step1a = &step1[12]; - __m128i *step1b = &step1[19]; - const __m128i ina0 = _mm_loadu_si128((const __m128i *)(ina)); - const __m128i ina1 = _mm_loadu_si128((const __m128i *)(ina + str1)); - const __m128i ina2 = _mm_loadu_si128((const __m128i *)(ina + str2)); - const __m128i ina3 = _mm_loadu_si128((const __m128i *)(ina + str3)); - const __m128i inb3 = _mm_loadu_si128((const __m128i *)(inb - str3)); - const __m128i inb2 = _mm_loadu_si128((const __m128i *)(inb - str2)); - const __m128i inb1 = _mm_loadu_si128((const __m128i *)(inb - str1)); - const __m128i inb0 = _mm_loadu_si128((const __m128i *)(inb)); - step1a[ 0] = _mm_add_epi16(ina0, inb0); - step1a[ 1] = _mm_add_epi16(ina1, inb1); - step1a[ 2] = _mm_add_epi16(ina2, inb2); - step1a[ 3] = _mm_add_epi16(ina3, inb3); - step1b[-3] = _mm_sub_epi16(ina3, inb3); - step1b[-2] = _mm_sub_epi16(ina2, inb2); - step1b[-1] = _mm_sub_epi16(ina1, inb1); - step1b[-0] = _mm_sub_epi16(ina0, inb0); - step1a[ 0] = _mm_slli_epi16(step1a[ 0], 2); - step1a[ 1] = _mm_slli_epi16(step1a[ 1], 2); - step1a[ 2] = _mm_slli_epi16(step1a[ 2], 2); - step1a[ 3] = _mm_slli_epi16(step1a[ 3], 2); - step1b[-3] = _mm_slli_epi16(step1b[-3], 2); - step1b[-2] = _mm_slli_epi16(step1b[-2], 2); - step1b[-1] = _mm_slli_epi16(step1b[-1], 2); - step1b[-0] = _mm_slli_epi16(step1b[-0], 2); - } - } else { - int16_t *in = &intermediate[column_start]; - // step1[i] = in[ 0 * 32] + in[(32 - 1) * 32]; - // Note: using the same approach as above to have common offset is - // counter-productive as all offsets can be calculated at compile - // time. - // Note: the next four blocks could be in a loop. That would help the - // instruction cache but is actually slower. - { - __m128i in00 = _mm_loadu_si128((const __m128i *)(in + 0 * 32)); - __m128i in01 = _mm_loadu_si128((const __m128i *)(in + 1 * 32)); - __m128i in02 = _mm_loadu_si128((const __m128i *)(in + 2 * 32)); - __m128i in03 = _mm_loadu_si128((const __m128i *)(in + 3 * 32)); - __m128i in28 = _mm_loadu_si128((const __m128i *)(in + 28 * 32)); - __m128i in29 = _mm_loadu_si128((const __m128i *)(in + 29 * 32)); - __m128i in30 = _mm_loadu_si128((const __m128i *)(in + 30 * 32)); - __m128i in31 = _mm_loadu_si128((const __m128i *)(in + 31 * 32)); - step1[0] = ADD_EPI16(in00, in31); - step1[1] = ADD_EPI16(in01, in30); - step1[2] = ADD_EPI16(in02, in29); - step1[3] = ADD_EPI16(in03, in28); - step1[28] = SUB_EPI16(in03, in28); - step1[29] = SUB_EPI16(in02, in29); - step1[30] = SUB_EPI16(in01, in30); - step1[31] = SUB_EPI16(in00, in31); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x8(&step1[0], &step1[1], &step1[2], - &step1[3], &step1[28], &step1[29], - &step1[30], &step1[31]); - if (overflow) { - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - { - __m128i in04 = _mm_loadu_si128((const __m128i *)(in + 4 * 32)); - __m128i in05 = _mm_loadu_si128((const __m128i *)(in + 5 * 32)); - __m128i in06 = _mm_loadu_si128((const __m128i *)(in + 6 * 32)); - __m128i in07 = _mm_loadu_si128((const __m128i *)(in + 7 * 32)); - __m128i in24 = _mm_loadu_si128((const __m128i *)(in + 24 * 32)); - __m128i in25 = _mm_loadu_si128((const __m128i *)(in + 25 * 32)); - __m128i in26 = _mm_loadu_si128((const __m128i *)(in + 26 * 32)); - __m128i in27 = _mm_loadu_si128((const __m128i *)(in + 27 * 32)); - step1[4] = ADD_EPI16(in04, in27); - step1[5] = ADD_EPI16(in05, in26); - step1[6] = ADD_EPI16(in06, in25); - step1[7] = ADD_EPI16(in07, in24); - step1[24] = SUB_EPI16(in07, in24); - step1[25] = SUB_EPI16(in06, in25); - step1[26] = SUB_EPI16(in05, in26); - step1[27] = SUB_EPI16(in04, in27); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x8(&step1[4], &step1[5], &step1[6], - &step1[7], &step1[24], &step1[25], - &step1[26], &step1[27]); - if (overflow) { - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - { - __m128i in08 = _mm_loadu_si128((const __m128i *)(in + 8 * 32)); - __m128i in09 = _mm_loadu_si128((const __m128i *)(in + 9 * 32)); - __m128i in10 = _mm_loadu_si128((const __m128i *)(in + 10 * 32)); - __m128i in11 = _mm_loadu_si128((const __m128i *)(in + 11 * 32)); - __m128i in20 = _mm_loadu_si128((const __m128i *)(in + 20 * 32)); - __m128i in21 = _mm_loadu_si128((const __m128i *)(in + 21 * 32)); - __m128i in22 = _mm_loadu_si128((const __m128i *)(in + 22 * 32)); - __m128i in23 = _mm_loadu_si128((const __m128i *)(in + 23 * 32)); - step1[8] = ADD_EPI16(in08, in23); - step1[9] = ADD_EPI16(in09, in22); - step1[10] = ADD_EPI16(in10, in21); - step1[11] = ADD_EPI16(in11, in20); - step1[20] = SUB_EPI16(in11, in20); - step1[21] = SUB_EPI16(in10, in21); - step1[22] = SUB_EPI16(in09, in22); - step1[23] = SUB_EPI16(in08, in23); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x8(&step1[8], &step1[9], &step1[10], - &step1[11], &step1[20], &step1[21], - &step1[22], &step1[23]); - if (overflow) { - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - { - __m128i in12 = _mm_loadu_si128((const __m128i *)(in + 12 * 32)); - __m128i in13 = _mm_loadu_si128((const __m128i *)(in + 13 * 32)); - __m128i in14 = _mm_loadu_si128((const __m128i *)(in + 14 * 32)); - __m128i in15 = _mm_loadu_si128((const __m128i *)(in + 15 * 32)); - __m128i in16 = _mm_loadu_si128((const __m128i *)(in + 16 * 32)); - __m128i in17 = _mm_loadu_si128((const __m128i *)(in + 17 * 32)); - __m128i in18 = _mm_loadu_si128((const __m128i *)(in + 18 * 32)); - __m128i in19 = _mm_loadu_si128((const __m128i *)(in + 19 * 32)); - step1[12] = ADD_EPI16(in12, in19); - step1[13] = ADD_EPI16(in13, in18); - step1[14] = ADD_EPI16(in14, in17); - step1[15] = ADD_EPI16(in15, in16); - step1[16] = SUB_EPI16(in15, in16); - step1[17] = SUB_EPI16(in14, in17); - step1[18] = SUB_EPI16(in13, in18); - step1[19] = SUB_EPI16(in12, in19); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x8(&step1[12], &step1[13], &step1[14], - &step1[15], &step1[16], &step1[17], - &step1[18], &step1[19]); - if (overflow) { - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - } - // Stage 2 - { - step2[0] = ADD_EPI16(step1[0], step1[15]); - step2[1] = ADD_EPI16(step1[1], step1[14]); - step2[2] = ADD_EPI16(step1[2], step1[13]); - step2[3] = ADD_EPI16(step1[3], step1[12]); - step2[4] = ADD_EPI16(step1[4], step1[11]); - step2[5] = ADD_EPI16(step1[5], step1[10]); - step2[6] = ADD_EPI16(step1[6], step1[ 9]); - step2[7] = ADD_EPI16(step1[7], step1[ 8]); - step2[8] = SUB_EPI16(step1[7], step1[ 8]); - step2[9] = SUB_EPI16(step1[6], step1[ 9]); - step2[10] = SUB_EPI16(step1[5], step1[10]); - step2[11] = SUB_EPI16(step1[4], step1[11]); - step2[12] = SUB_EPI16(step1[3], step1[12]); - step2[13] = SUB_EPI16(step1[2], step1[13]); - step2[14] = SUB_EPI16(step1[1], step1[14]); - step2[15] = SUB_EPI16(step1[0], step1[15]); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x16( - &step2[0], &step2[1], &step2[2], &step2[3], - &step2[4], &step2[5], &step2[6], &step2[7], - &step2[8], &step2[9], &step2[10], &step2[11], - &step2[12], &step2[13], &step2[14], &step2[15]); - if (overflow) { - if (pass == 0) - HIGH_FDCT32x32_2D_C(input, output_org, stride); - else - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - { - const __m128i s2_20_0 = _mm_unpacklo_epi16(step1[27], step1[20]); - const __m128i s2_20_1 = _mm_unpackhi_epi16(step1[27], step1[20]); - const __m128i s2_21_0 = _mm_unpacklo_epi16(step1[26], step1[21]); - const __m128i s2_21_1 = _mm_unpackhi_epi16(step1[26], step1[21]); - const __m128i s2_22_0 = _mm_unpacklo_epi16(step1[25], step1[22]); - const __m128i s2_22_1 = _mm_unpackhi_epi16(step1[25], step1[22]); - const __m128i s2_23_0 = _mm_unpacklo_epi16(step1[24], step1[23]); - const __m128i s2_23_1 = _mm_unpackhi_epi16(step1[24], step1[23]); - const __m128i s2_20_2 = _mm_madd_epi16(s2_20_0, k__cospi_p16_m16); - const __m128i s2_20_3 = _mm_madd_epi16(s2_20_1, k__cospi_p16_m16); - const __m128i s2_21_2 = _mm_madd_epi16(s2_21_0, k__cospi_p16_m16); - const __m128i s2_21_3 = _mm_madd_epi16(s2_21_1, k__cospi_p16_m16); - const __m128i s2_22_2 = _mm_madd_epi16(s2_22_0, k__cospi_p16_m16); - const __m128i s2_22_3 = _mm_madd_epi16(s2_22_1, k__cospi_p16_m16); - const __m128i s2_23_2 = _mm_madd_epi16(s2_23_0, k__cospi_p16_m16); - const __m128i s2_23_3 = _mm_madd_epi16(s2_23_1, k__cospi_p16_m16); - const __m128i s2_24_2 = _mm_madd_epi16(s2_23_0, k__cospi_p16_p16); - const __m128i s2_24_3 = _mm_madd_epi16(s2_23_1, k__cospi_p16_p16); - const __m128i s2_25_2 = _mm_madd_epi16(s2_22_0, k__cospi_p16_p16); - const __m128i s2_25_3 = _mm_madd_epi16(s2_22_1, k__cospi_p16_p16); - const __m128i s2_26_2 = _mm_madd_epi16(s2_21_0, k__cospi_p16_p16); - const __m128i s2_26_3 = _mm_madd_epi16(s2_21_1, k__cospi_p16_p16); - const __m128i s2_27_2 = _mm_madd_epi16(s2_20_0, k__cospi_p16_p16); - const __m128i s2_27_3 = _mm_madd_epi16(s2_20_1, k__cospi_p16_p16); - // dct_const_round_shift - const __m128i s2_20_4 = _mm_add_epi32(s2_20_2, k__DCT_CONST_ROUNDING); - const __m128i s2_20_5 = _mm_add_epi32(s2_20_3, k__DCT_CONST_ROUNDING); - const __m128i s2_21_4 = _mm_add_epi32(s2_21_2, k__DCT_CONST_ROUNDING); - const __m128i s2_21_5 = _mm_add_epi32(s2_21_3, k__DCT_CONST_ROUNDING); - const __m128i s2_22_4 = _mm_add_epi32(s2_22_2, k__DCT_CONST_ROUNDING); - const __m128i s2_22_5 = _mm_add_epi32(s2_22_3, k__DCT_CONST_ROUNDING); - const __m128i s2_23_4 = _mm_add_epi32(s2_23_2, k__DCT_CONST_ROUNDING); - const __m128i s2_23_5 = _mm_add_epi32(s2_23_3, k__DCT_CONST_ROUNDING); - const __m128i s2_24_4 = _mm_add_epi32(s2_24_2, k__DCT_CONST_ROUNDING); - const __m128i s2_24_5 = _mm_add_epi32(s2_24_3, k__DCT_CONST_ROUNDING); - const __m128i s2_25_4 = _mm_add_epi32(s2_25_2, k__DCT_CONST_ROUNDING); - const __m128i s2_25_5 = _mm_add_epi32(s2_25_3, k__DCT_CONST_ROUNDING); - const __m128i s2_26_4 = _mm_add_epi32(s2_26_2, k__DCT_CONST_ROUNDING); - const __m128i s2_26_5 = _mm_add_epi32(s2_26_3, k__DCT_CONST_ROUNDING); - const __m128i s2_27_4 = _mm_add_epi32(s2_27_2, k__DCT_CONST_ROUNDING); - const __m128i s2_27_5 = _mm_add_epi32(s2_27_3, k__DCT_CONST_ROUNDING); - const __m128i s2_20_6 = _mm_srai_epi32(s2_20_4, DCT_CONST_BITS); - const __m128i s2_20_7 = _mm_srai_epi32(s2_20_5, DCT_CONST_BITS); - const __m128i s2_21_6 = _mm_srai_epi32(s2_21_4, DCT_CONST_BITS); - const __m128i s2_21_7 = _mm_srai_epi32(s2_21_5, DCT_CONST_BITS); - const __m128i s2_22_6 = _mm_srai_epi32(s2_22_4, DCT_CONST_BITS); - const __m128i s2_22_7 = _mm_srai_epi32(s2_22_5, DCT_CONST_BITS); - const __m128i s2_23_6 = _mm_srai_epi32(s2_23_4, DCT_CONST_BITS); - const __m128i s2_23_7 = _mm_srai_epi32(s2_23_5, DCT_CONST_BITS); - const __m128i s2_24_6 = _mm_srai_epi32(s2_24_4, DCT_CONST_BITS); - const __m128i s2_24_7 = _mm_srai_epi32(s2_24_5, DCT_CONST_BITS); - const __m128i s2_25_6 = _mm_srai_epi32(s2_25_4, DCT_CONST_BITS); - const __m128i s2_25_7 = _mm_srai_epi32(s2_25_5, DCT_CONST_BITS); - const __m128i s2_26_6 = _mm_srai_epi32(s2_26_4, DCT_CONST_BITS); - const __m128i s2_26_7 = _mm_srai_epi32(s2_26_5, DCT_CONST_BITS); - const __m128i s2_27_6 = _mm_srai_epi32(s2_27_4, DCT_CONST_BITS); - const __m128i s2_27_7 = _mm_srai_epi32(s2_27_5, DCT_CONST_BITS); - // Combine - step2[20] = _mm_packs_epi32(s2_20_6, s2_20_7); - step2[21] = _mm_packs_epi32(s2_21_6, s2_21_7); - step2[22] = _mm_packs_epi32(s2_22_6, s2_22_7); - step2[23] = _mm_packs_epi32(s2_23_6, s2_23_7); - step2[24] = _mm_packs_epi32(s2_24_6, s2_24_7); - step2[25] = _mm_packs_epi32(s2_25_6, s2_25_7); - step2[26] = _mm_packs_epi32(s2_26_6, s2_26_7); - step2[27] = _mm_packs_epi32(s2_27_6, s2_27_7); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x8(&step2[20], &step2[21], &step2[22], - &step2[23], &step2[24], &step2[25], - &step2[26], &step2[27]); - if (overflow) { - if (pass == 0) - HIGH_FDCT32x32_2D_C(input, output_org, stride); - else - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - -#if !FDCT32x32_HIGH_PRECISION - // dump the magnitude by half, hence the intermediate values are within - // the range of 16 bits. - if (1 == pass) { - __m128i s3_00_0 = _mm_cmplt_epi16(step2[ 0], kZero); - __m128i s3_01_0 = _mm_cmplt_epi16(step2[ 1], kZero); - __m128i s3_02_0 = _mm_cmplt_epi16(step2[ 2], kZero); - __m128i s3_03_0 = _mm_cmplt_epi16(step2[ 3], kZero); - __m128i s3_04_0 = _mm_cmplt_epi16(step2[ 4], kZero); - __m128i s3_05_0 = _mm_cmplt_epi16(step2[ 5], kZero); - __m128i s3_06_0 = _mm_cmplt_epi16(step2[ 6], kZero); - __m128i s3_07_0 = _mm_cmplt_epi16(step2[ 7], kZero); - __m128i s2_08_0 = _mm_cmplt_epi16(step2[ 8], kZero); - __m128i s2_09_0 = _mm_cmplt_epi16(step2[ 9], kZero); - __m128i s3_10_0 = _mm_cmplt_epi16(step2[10], kZero); - __m128i s3_11_0 = _mm_cmplt_epi16(step2[11], kZero); - __m128i s3_12_0 = _mm_cmplt_epi16(step2[12], kZero); - __m128i s3_13_0 = _mm_cmplt_epi16(step2[13], kZero); - __m128i s2_14_0 = _mm_cmplt_epi16(step2[14], kZero); - __m128i s2_15_0 = _mm_cmplt_epi16(step2[15], kZero); - __m128i s3_16_0 = _mm_cmplt_epi16(step1[16], kZero); - __m128i s3_17_0 = _mm_cmplt_epi16(step1[17], kZero); - __m128i s3_18_0 = _mm_cmplt_epi16(step1[18], kZero); - __m128i s3_19_0 = _mm_cmplt_epi16(step1[19], kZero); - __m128i s3_20_0 = _mm_cmplt_epi16(step2[20], kZero); - __m128i s3_21_0 = _mm_cmplt_epi16(step2[21], kZero); - __m128i s3_22_0 = _mm_cmplt_epi16(step2[22], kZero); - __m128i s3_23_0 = _mm_cmplt_epi16(step2[23], kZero); - __m128i s3_24_0 = _mm_cmplt_epi16(step2[24], kZero); - __m128i s3_25_0 = _mm_cmplt_epi16(step2[25], kZero); - __m128i s3_26_0 = _mm_cmplt_epi16(step2[26], kZero); - __m128i s3_27_0 = _mm_cmplt_epi16(step2[27], kZero); - __m128i s3_28_0 = _mm_cmplt_epi16(step1[28], kZero); - __m128i s3_29_0 = _mm_cmplt_epi16(step1[29], kZero); - __m128i s3_30_0 = _mm_cmplt_epi16(step1[30], kZero); - __m128i s3_31_0 = _mm_cmplt_epi16(step1[31], kZero); - - step2[0] = SUB_EPI16(step2[ 0], s3_00_0); - step2[1] = SUB_EPI16(step2[ 1], s3_01_0); - step2[2] = SUB_EPI16(step2[ 2], s3_02_0); - step2[3] = SUB_EPI16(step2[ 3], s3_03_0); - step2[4] = SUB_EPI16(step2[ 4], s3_04_0); - step2[5] = SUB_EPI16(step2[ 5], s3_05_0); - step2[6] = SUB_EPI16(step2[ 6], s3_06_0); - step2[7] = SUB_EPI16(step2[ 7], s3_07_0); - step2[8] = SUB_EPI16(step2[ 8], s2_08_0); - step2[9] = SUB_EPI16(step2[ 9], s2_09_0); - step2[10] = SUB_EPI16(step2[10], s3_10_0); - step2[11] = SUB_EPI16(step2[11], s3_11_0); - step2[12] = SUB_EPI16(step2[12], s3_12_0); - step2[13] = SUB_EPI16(step2[13], s3_13_0); - step2[14] = SUB_EPI16(step2[14], s2_14_0); - step2[15] = SUB_EPI16(step2[15], s2_15_0); - step1[16] = SUB_EPI16(step1[16], s3_16_0); - step1[17] = SUB_EPI16(step1[17], s3_17_0); - step1[18] = SUB_EPI16(step1[18], s3_18_0); - step1[19] = SUB_EPI16(step1[19], s3_19_0); - step2[20] = SUB_EPI16(step2[20], s3_20_0); - step2[21] = SUB_EPI16(step2[21], s3_21_0); - step2[22] = SUB_EPI16(step2[22], s3_22_0); - step2[23] = SUB_EPI16(step2[23], s3_23_0); - step2[24] = SUB_EPI16(step2[24], s3_24_0); - step2[25] = SUB_EPI16(step2[25], s3_25_0); - step2[26] = SUB_EPI16(step2[26], s3_26_0); - step2[27] = SUB_EPI16(step2[27], s3_27_0); - step1[28] = SUB_EPI16(step1[28], s3_28_0); - step1[29] = SUB_EPI16(step1[29], s3_29_0); - step1[30] = SUB_EPI16(step1[30], s3_30_0); - step1[31] = SUB_EPI16(step1[31], s3_31_0); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x32( - &step2[0], &step2[1], &step2[2], &step2[3], - &step2[4], &step2[5], &step2[6], &step2[7], - &step2[8], &step2[9], &step2[10], &step2[11], - &step2[12], &step2[13], &step2[14], &step2[15], - &step1[16], &step1[17], &step1[18], &step1[19], - &step2[20], &step2[21], &step2[22], &step2[23], - &step2[24], &step2[25], &step2[26], &step2[27], - &step1[28], &step1[29], &step1[30], &step1[31]); - if (overflow) { - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - step2[0] = _mm_add_epi16(step2[ 0], kOne); - step2[1] = _mm_add_epi16(step2[ 1], kOne); - step2[2] = _mm_add_epi16(step2[ 2], kOne); - step2[3] = _mm_add_epi16(step2[ 3], kOne); - step2[4] = _mm_add_epi16(step2[ 4], kOne); - step2[5] = _mm_add_epi16(step2[ 5], kOne); - step2[6] = _mm_add_epi16(step2[ 6], kOne); - step2[7] = _mm_add_epi16(step2[ 7], kOne); - step2[8] = _mm_add_epi16(step2[ 8], kOne); - step2[9] = _mm_add_epi16(step2[ 9], kOne); - step2[10] = _mm_add_epi16(step2[10], kOne); - step2[11] = _mm_add_epi16(step2[11], kOne); - step2[12] = _mm_add_epi16(step2[12], kOne); - step2[13] = _mm_add_epi16(step2[13], kOne); - step2[14] = _mm_add_epi16(step2[14], kOne); - step2[15] = _mm_add_epi16(step2[15], kOne); - step1[16] = _mm_add_epi16(step1[16], kOne); - step1[17] = _mm_add_epi16(step1[17], kOne); - step1[18] = _mm_add_epi16(step1[18], kOne); - step1[19] = _mm_add_epi16(step1[19], kOne); - step2[20] = _mm_add_epi16(step2[20], kOne); - step2[21] = _mm_add_epi16(step2[21], kOne); - step2[22] = _mm_add_epi16(step2[22], kOne); - step2[23] = _mm_add_epi16(step2[23], kOne); - step2[24] = _mm_add_epi16(step2[24], kOne); - step2[25] = _mm_add_epi16(step2[25], kOne); - step2[26] = _mm_add_epi16(step2[26], kOne); - step2[27] = _mm_add_epi16(step2[27], kOne); - step1[28] = _mm_add_epi16(step1[28], kOne); - step1[29] = _mm_add_epi16(step1[29], kOne); - step1[30] = _mm_add_epi16(step1[30], kOne); - step1[31] = _mm_add_epi16(step1[31], kOne); - - step2[0] = _mm_srai_epi16(step2[ 0], 2); - step2[1] = _mm_srai_epi16(step2[ 1], 2); - step2[2] = _mm_srai_epi16(step2[ 2], 2); - step2[3] = _mm_srai_epi16(step2[ 3], 2); - step2[4] = _mm_srai_epi16(step2[ 4], 2); - step2[5] = _mm_srai_epi16(step2[ 5], 2); - step2[6] = _mm_srai_epi16(step2[ 6], 2); - step2[7] = _mm_srai_epi16(step2[ 7], 2); - step2[8] = _mm_srai_epi16(step2[ 8], 2); - step2[9] = _mm_srai_epi16(step2[ 9], 2); - step2[10] = _mm_srai_epi16(step2[10], 2); - step2[11] = _mm_srai_epi16(step2[11], 2); - step2[12] = _mm_srai_epi16(step2[12], 2); - step2[13] = _mm_srai_epi16(step2[13], 2); - step2[14] = _mm_srai_epi16(step2[14], 2); - step2[15] = _mm_srai_epi16(step2[15], 2); - step1[16] = _mm_srai_epi16(step1[16], 2); - step1[17] = _mm_srai_epi16(step1[17], 2); - step1[18] = _mm_srai_epi16(step1[18], 2); - step1[19] = _mm_srai_epi16(step1[19], 2); - step2[20] = _mm_srai_epi16(step2[20], 2); - step2[21] = _mm_srai_epi16(step2[21], 2); - step2[22] = _mm_srai_epi16(step2[22], 2); - step2[23] = _mm_srai_epi16(step2[23], 2); - step2[24] = _mm_srai_epi16(step2[24], 2); - step2[25] = _mm_srai_epi16(step2[25], 2); - step2[26] = _mm_srai_epi16(step2[26], 2); - step2[27] = _mm_srai_epi16(step2[27], 2); - step1[28] = _mm_srai_epi16(step1[28], 2); - step1[29] = _mm_srai_epi16(step1[29], 2); - step1[30] = _mm_srai_epi16(step1[30], 2); - step1[31] = _mm_srai_epi16(step1[31], 2); - } -#endif // !FDCT32x32_HIGH_PRECISION - -#if FDCT32x32_HIGH_PRECISION - if (pass == 0) { -#endif - // Stage 3 - { - step3[0] = ADD_EPI16(step2[(8 - 1)], step2[0]); - step3[1] = ADD_EPI16(step2[(8 - 2)], step2[1]); - step3[2] = ADD_EPI16(step2[(8 - 3)], step2[2]); - step3[3] = ADD_EPI16(step2[(8 - 4)], step2[3]); - step3[4] = SUB_EPI16(step2[(8 - 5)], step2[4]); - step3[5] = SUB_EPI16(step2[(8 - 6)], step2[5]); - step3[6] = SUB_EPI16(step2[(8 - 7)], step2[6]); - step3[7] = SUB_EPI16(step2[(8 - 8)], step2[7]); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x8(&step3[0], &step3[1], &step3[2], - &step3[3], &step3[4], &step3[5], - &step3[6], &step3[7]); - if (overflow) { - if (pass == 0) - HIGH_FDCT32x32_2D_C(input, output_org, stride); - else - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - { - const __m128i s3_10_0 = _mm_unpacklo_epi16(step2[13], step2[10]); - const __m128i s3_10_1 = _mm_unpackhi_epi16(step2[13], step2[10]); - const __m128i s3_11_0 = _mm_unpacklo_epi16(step2[12], step2[11]); - const __m128i s3_11_1 = _mm_unpackhi_epi16(step2[12], step2[11]); - const __m128i s3_10_2 = _mm_madd_epi16(s3_10_0, k__cospi_p16_m16); - const __m128i s3_10_3 = _mm_madd_epi16(s3_10_1, k__cospi_p16_m16); - const __m128i s3_11_2 = _mm_madd_epi16(s3_11_0, k__cospi_p16_m16); - const __m128i s3_11_3 = _mm_madd_epi16(s3_11_1, k__cospi_p16_m16); - const __m128i s3_12_2 = _mm_madd_epi16(s3_11_0, k__cospi_p16_p16); - const __m128i s3_12_3 = _mm_madd_epi16(s3_11_1, k__cospi_p16_p16); - const __m128i s3_13_2 = _mm_madd_epi16(s3_10_0, k__cospi_p16_p16); - const __m128i s3_13_3 = _mm_madd_epi16(s3_10_1, k__cospi_p16_p16); - // dct_const_round_shift - const __m128i s3_10_4 = _mm_add_epi32(s3_10_2, k__DCT_CONST_ROUNDING); - const __m128i s3_10_5 = _mm_add_epi32(s3_10_3, k__DCT_CONST_ROUNDING); - const __m128i s3_11_4 = _mm_add_epi32(s3_11_2, k__DCT_CONST_ROUNDING); - const __m128i s3_11_5 = _mm_add_epi32(s3_11_3, k__DCT_CONST_ROUNDING); - const __m128i s3_12_4 = _mm_add_epi32(s3_12_2, k__DCT_CONST_ROUNDING); - const __m128i s3_12_5 = _mm_add_epi32(s3_12_3, k__DCT_CONST_ROUNDING); - const __m128i s3_13_4 = _mm_add_epi32(s3_13_2, k__DCT_CONST_ROUNDING); - const __m128i s3_13_5 = _mm_add_epi32(s3_13_3, k__DCT_CONST_ROUNDING); - const __m128i s3_10_6 = _mm_srai_epi32(s3_10_4, DCT_CONST_BITS); - const __m128i s3_10_7 = _mm_srai_epi32(s3_10_5, DCT_CONST_BITS); - const __m128i s3_11_6 = _mm_srai_epi32(s3_11_4, DCT_CONST_BITS); - const __m128i s3_11_7 = _mm_srai_epi32(s3_11_5, DCT_CONST_BITS); - const __m128i s3_12_6 = _mm_srai_epi32(s3_12_4, DCT_CONST_BITS); - const __m128i s3_12_7 = _mm_srai_epi32(s3_12_5, DCT_CONST_BITS); - const __m128i s3_13_6 = _mm_srai_epi32(s3_13_4, DCT_CONST_BITS); - const __m128i s3_13_7 = _mm_srai_epi32(s3_13_5, DCT_CONST_BITS); - // Combine - step3[10] = _mm_packs_epi32(s3_10_6, s3_10_7); - step3[11] = _mm_packs_epi32(s3_11_6, s3_11_7); - step3[12] = _mm_packs_epi32(s3_12_6, s3_12_7); - step3[13] = _mm_packs_epi32(s3_13_6, s3_13_7); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x4(&step3[10], &step3[11], - &step3[12], &step3[13]); - if (overflow) { - if (pass == 0) - HIGH_FDCT32x32_2D_C(input, output_org, stride); - else - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - { - step3[16] = ADD_EPI16(step2[23], step1[16]); - step3[17] = ADD_EPI16(step2[22], step1[17]); - step3[18] = ADD_EPI16(step2[21], step1[18]); - step3[19] = ADD_EPI16(step2[20], step1[19]); - step3[20] = SUB_EPI16(step1[19], step2[20]); - step3[21] = SUB_EPI16(step1[18], step2[21]); - step3[22] = SUB_EPI16(step1[17], step2[22]); - step3[23] = SUB_EPI16(step1[16], step2[23]); - step3[24] = SUB_EPI16(step1[31], step2[24]); - step3[25] = SUB_EPI16(step1[30], step2[25]); - step3[26] = SUB_EPI16(step1[29], step2[26]); - step3[27] = SUB_EPI16(step1[28], step2[27]); - step3[28] = ADD_EPI16(step2[27], step1[28]); - step3[29] = ADD_EPI16(step2[26], step1[29]); - step3[30] = ADD_EPI16(step2[25], step1[30]); - step3[31] = ADD_EPI16(step2[24], step1[31]); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x16( - &step3[16], &step3[17], &step3[18], &step3[19], - &step3[20], &step3[21], &step3[22], &step3[23], - &step3[24], &step3[25], &step3[26], &step3[27], - &step3[28], &step3[29], &step3[30], &step3[31]); - if (overflow) { - if (pass == 0) - HIGH_FDCT32x32_2D_C(input, output_org, stride); - else - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - - // Stage 4 - { - step1[0] = ADD_EPI16(step3[ 3], step3[ 0]); - step1[1] = ADD_EPI16(step3[ 2], step3[ 1]); - step1[2] = SUB_EPI16(step3[ 1], step3[ 2]); - step1[3] = SUB_EPI16(step3[ 0], step3[ 3]); - step1[8] = ADD_EPI16(step3[11], step2[ 8]); - step1[9] = ADD_EPI16(step3[10], step2[ 9]); - step1[10] = SUB_EPI16(step2[ 9], step3[10]); - step1[11] = SUB_EPI16(step2[ 8], step3[11]); - step1[12] = SUB_EPI16(step2[15], step3[12]); - step1[13] = SUB_EPI16(step2[14], step3[13]); - step1[14] = ADD_EPI16(step3[13], step2[14]); - step1[15] = ADD_EPI16(step3[12], step2[15]); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x16( - &step1[0], &step1[1], &step1[2], &step1[3], - &step1[4], &step1[5], &step1[6], &step1[7], - &step1[8], &step1[9], &step1[10], &step1[11], - &step1[12], &step1[13], &step1[14], &step1[15]); - if (overflow) { - if (pass == 0) - HIGH_FDCT32x32_2D_C(input, output_org, stride); - else - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - { - const __m128i s1_05_0 = _mm_unpacklo_epi16(step3[6], step3[5]); - const __m128i s1_05_1 = _mm_unpackhi_epi16(step3[6], step3[5]); - const __m128i s1_05_2 = _mm_madd_epi16(s1_05_0, k__cospi_p16_m16); - const __m128i s1_05_3 = _mm_madd_epi16(s1_05_1, k__cospi_p16_m16); - const __m128i s1_06_2 = _mm_madd_epi16(s1_05_0, k__cospi_p16_p16); - const __m128i s1_06_3 = _mm_madd_epi16(s1_05_1, k__cospi_p16_p16); - // dct_const_round_shift - const __m128i s1_05_4 = _mm_add_epi32(s1_05_2, k__DCT_CONST_ROUNDING); - const __m128i s1_05_5 = _mm_add_epi32(s1_05_3, k__DCT_CONST_ROUNDING); - const __m128i s1_06_4 = _mm_add_epi32(s1_06_2, k__DCT_CONST_ROUNDING); - const __m128i s1_06_5 = _mm_add_epi32(s1_06_3, k__DCT_CONST_ROUNDING); - const __m128i s1_05_6 = _mm_srai_epi32(s1_05_4, DCT_CONST_BITS); - const __m128i s1_05_7 = _mm_srai_epi32(s1_05_5, DCT_CONST_BITS); - const __m128i s1_06_6 = _mm_srai_epi32(s1_06_4, DCT_CONST_BITS); - const __m128i s1_06_7 = _mm_srai_epi32(s1_06_5, DCT_CONST_BITS); - // Combine - step1[5] = _mm_packs_epi32(s1_05_6, s1_05_7); - step1[6] = _mm_packs_epi32(s1_06_6, s1_06_7); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x2(&step1[5], &step1[6]); - if (overflow) { - if (pass == 0) - HIGH_FDCT32x32_2D_C(input, output_org, stride); - else - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - { - const __m128i s1_18_0 = _mm_unpacklo_epi16(step3[18], step3[29]); - const __m128i s1_18_1 = _mm_unpackhi_epi16(step3[18], step3[29]); - const __m128i s1_19_0 = _mm_unpacklo_epi16(step3[19], step3[28]); - const __m128i s1_19_1 = _mm_unpackhi_epi16(step3[19], step3[28]); - const __m128i s1_20_0 = _mm_unpacklo_epi16(step3[20], step3[27]); - const __m128i s1_20_1 = _mm_unpackhi_epi16(step3[20], step3[27]); - const __m128i s1_21_0 = _mm_unpacklo_epi16(step3[21], step3[26]); - const __m128i s1_21_1 = _mm_unpackhi_epi16(step3[21], step3[26]); - const __m128i s1_18_2 = _mm_madd_epi16(s1_18_0, k__cospi_m08_p24); - const __m128i s1_18_3 = _mm_madd_epi16(s1_18_1, k__cospi_m08_p24); - const __m128i s1_19_2 = _mm_madd_epi16(s1_19_0, k__cospi_m08_p24); - const __m128i s1_19_3 = _mm_madd_epi16(s1_19_1, k__cospi_m08_p24); - const __m128i s1_20_2 = _mm_madd_epi16(s1_20_0, k__cospi_m24_m08); - const __m128i s1_20_3 = _mm_madd_epi16(s1_20_1, k__cospi_m24_m08); - const __m128i s1_21_2 = _mm_madd_epi16(s1_21_0, k__cospi_m24_m08); - const __m128i s1_21_3 = _mm_madd_epi16(s1_21_1, k__cospi_m24_m08); - const __m128i s1_26_2 = _mm_madd_epi16(s1_21_0, k__cospi_m08_p24); - const __m128i s1_26_3 = _mm_madd_epi16(s1_21_1, k__cospi_m08_p24); - const __m128i s1_27_2 = _mm_madd_epi16(s1_20_0, k__cospi_m08_p24); - const __m128i s1_27_3 = _mm_madd_epi16(s1_20_1, k__cospi_m08_p24); - const __m128i s1_28_2 = _mm_madd_epi16(s1_19_0, k__cospi_p24_p08); - const __m128i s1_28_3 = _mm_madd_epi16(s1_19_1, k__cospi_p24_p08); - const __m128i s1_29_2 = _mm_madd_epi16(s1_18_0, k__cospi_p24_p08); - const __m128i s1_29_3 = _mm_madd_epi16(s1_18_1, k__cospi_p24_p08); - // dct_const_round_shift - const __m128i s1_18_4 = _mm_add_epi32(s1_18_2, k__DCT_CONST_ROUNDING); - const __m128i s1_18_5 = _mm_add_epi32(s1_18_3, k__DCT_CONST_ROUNDING); - const __m128i s1_19_4 = _mm_add_epi32(s1_19_2, k__DCT_CONST_ROUNDING); - const __m128i s1_19_5 = _mm_add_epi32(s1_19_3, k__DCT_CONST_ROUNDING); - const __m128i s1_20_4 = _mm_add_epi32(s1_20_2, k__DCT_CONST_ROUNDING); - const __m128i s1_20_5 = _mm_add_epi32(s1_20_3, k__DCT_CONST_ROUNDING); - const __m128i s1_21_4 = _mm_add_epi32(s1_21_2, k__DCT_CONST_ROUNDING); - const __m128i s1_21_5 = _mm_add_epi32(s1_21_3, k__DCT_CONST_ROUNDING); - const __m128i s1_26_4 = _mm_add_epi32(s1_26_2, k__DCT_CONST_ROUNDING); - const __m128i s1_26_5 = _mm_add_epi32(s1_26_3, k__DCT_CONST_ROUNDING); - const __m128i s1_27_4 = _mm_add_epi32(s1_27_2, k__DCT_CONST_ROUNDING); - const __m128i s1_27_5 = _mm_add_epi32(s1_27_3, k__DCT_CONST_ROUNDING); - const __m128i s1_28_4 = _mm_add_epi32(s1_28_2, k__DCT_CONST_ROUNDING); - const __m128i s1_28_5 = _mm_add_epi32(s1_28_3, k__DCT_CONST_ROUNDING); - const __m128i s1_29_4 = _mm_add_epi32(s1_29_2, k__DCT_CONST_ROUNDING); - const __m128i s1_29_5 = _mm_add_epi32(s1_29_3, k__DCT_CONST_ROUNDING); - const __m128i s1_18_6 = _mm_srai_epi32(s1_18_4, DCT_CONST_BITS); - const __m128i s1_18_7 = _mm_srai_epi32(s1_18_5, DCT_CONST_BITS); - const __m128i s1_19_6 = _mm_srai_epi32(s1_19_4, DCT_CONST_BITS); - const __m128i s1_19_7 = _mm_srai_epi32(s1_19_5, DCT_CONST_BITS); - const __m128i s1_20_6 = _mm_srai_epi32(s1_20_4, DCT_CONST_BITS); - const __m128i s1_20_7 = _mm_srai_epi32(s1_20_5, DCT_CONST_BITS); - const __m128i s1_21_6 = _mm_srai_epi32(s1_21_4, DCT_CONST_BITS); - const __m128i s1_21_7 = _mm_srai_epi32(s1_21_5, DCT_CONST_BITS); - const __m128i s1_26_6 = _mm_srai_epi32(s1_26_4, DCT_CONST_BITS); - const __m128i s1_26_7 = _mm_srai_epi32(s1_26_5, DCT_CONST_BITS); - const __m128i s1_27_6 = _mm_srai_epi32(s1_27_4, DCT_CONST_BITS); - const __m128i s1_27_7 = _mm_srai_epi32(s1_27_5, DCT_CONST_BITS); - const __m128i s1_28_6 = _mm_srai_epi32(s1_28_4, DCT_CONST_BITS); - const __m128i s1_28_7 = _mm_srai_epi32(s1_28_5, DCT_CONST_BITS); - const __m128i s1_29_6 = _mm_srai_epi32(s1_29_4, DCT_CONST_BITS); - const __m128i s1_29_7 = _mm_srai_epi32(s1_29_5, DCT_CONST_BITS); - // Combine - step1[18] = _mm_packs_epi32(s1_18_6, s1_18_7); - step1[19] = _mm_packs_epi32(s1_19_6, s1_19_7); - step1[20] = _mm_packs_epi32(s1_20_6, s1_20_7); - step1[21] = _mm_packs_epi32(s1_21_6, s1_21_7); - step1[26] = _mm_packs_epi32(s1_26_6, s1_26_7); - step1[27] = _mm_packs_epi32(s1_27_6, s1_27_7); - step1[28] = _mm_packs_epi32(s1_28_6, s1_28_7); - step1[29] = _mm_packs_epi32(s1_29_6, s1_29_7); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x8(&step1[18], &step1[19], &step1[20], - &step1[21], &step1[26], &step1[27], - &step1[28], &step1[29]); - if (overflow) { - if (pass == 0) - HIGH_FDCT32x32_2D_C(input, output_org, stride); - else - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - // Stage 5 - { - step2[4] = ADD_EPI16(step1[5], step3[4]); - step2[5] = SUB_EPI16(step3[4], step1[5]); - step2[6] = SUB_EPI16(step3[7], step1[6]); - step2[7] = ADD_EPI16(step1[6], step3[7]); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x4(&step2[4], &step2[5], - &step2[6], &step2[7]); - if (overflow) { - if (pass == 0) - HIGH_FDCT32x32_2D_C(input, output_org, stride); - else - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - { - const __m128i out_00_0 = _mm_unpacklo_epi16(step1[0], step1[1]); - const __m128i out_00_1 = _mm_unpackhi_epi16(step1[0], step1[1]); - const __m128i out_08_0 = _mm_unpacklo_epi16(step1[2], step1[3]); - const __m128i out_08_1 = _mm_unpackhi_epi16(step1[2], step1[3]); - const __m128i out_00_2 = _mm_madd_epi16(out_00_0, k__cospi_p16_p16); - const __m128i out_00_3 = _mm_madd_epi16(out_00_1, k__cospi_p16_p16); - const __m128i out_16_2 = _mm_madd_epi16(out_00_0, k__cospi_p16_m16); - const __m128i out_16_3 = _mm_madd_epi16(out_00_1, k__cospi_p16_m16); - const __m128i out_08_2 = _mm_madd_epi16(out_08_0, k__cospi_p24_p08); - const __m128i out_08_3 = _mm_madd_epi16(out_08_1, k__cospi_p24_p08); - const __m128i out_24_2 = _mm_madd_epi16(out_08_0, k__cospi_m08_p24); - const __m128i out_24_3 = _mm_madd_epi16(out_08_1, k__cospi_m08_p24); - // dct_const_round_shift - const __m128i out_00_4 = _mm_add_epi32(out_00_2, k__DCT_CONST_ROUNDING); - const __m128i out_00_5 = _mm_add_epi32(out_00_3, k__DCT_CONST_ROUNDING); - const __m128i out_16_4 = _mm_add_epi32(out_16_2, k__DCT_CONST_ROUNDING); - const __m128i out_16_5 = _mm_add_epi32(out_16_3, k__DCT_CONST_ROUNDING); - const __m128i out_08_4 = _mm_add_epi32(out_08_2, k__DCT_CONST_ROUNDING); - const __m128i out_08_5 = _mm_add_epi32(out_08_3, k__DCT_CONST_ROUNDING); - const __m128i out_24_4 = _mm_add_epi32(out_24_2, k__DCT_CONST_ROUNDING); - const __m128i out_24_5 = _mm_add_epi32(out_24_3, k__DCT_CONST_ROUNDING); - const __m128i out_00_6 = _mm_srai_epi32(out_00_4, DCT_CONST_BITS); - const __m128i out_00_7 = _mm_srai_epi32(out_00_5, DCT_CONST_BITS); - const __m128i out_16_6 = _mm_srai_epi32(out_16_4, DCT_CONST_BITS); - const __m128i out_16_7 = _mm_srai_epi32(out_16_5, DCT_CONST_BITS); - const __m128i out_08_6 = _mm_srai_epi32(out_08_4, DCT_CONST_BITS); - const __m128i out_08_7 = _mm_srai_epi32(out_08_5, DCT_CONST_BITS); - const __m128i out_24_6 = _mm_srai_epi32(out_24_4, DCT_CONST_BITS); - const __m128i out_24_7 = _mm_srai_epi32(out_24_5, DCT_CONST_BITS); - // Combine - out[ 0] = _mm_packs_epi32(out_00_6, out_00_7); - out[16] = _mm_packs_epi32(out_16_6, out_16_7); - out[ 8] = _mm_packs_epi32(out_08_6, out_08_7); - out[24] = _mm_packs_epi32(out_24_6, out_24_7); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x4(&out[0], &out[16], - &out[8], &out[24]); - if (overflow) { - if (pass == 0) - HIGH_FDCT32x32_2D_C(input, output_org, stride); - else - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - { - const __m128i s2_09_0 = _mm_unpacklo_epi16(step1[ 9], step1[14]); - const __m128i s2_09_1 = _mm_unpackhi_epi16(step1[ 9], step1[14]); - const __m128i s2_10_0 = _mm_unpacklo_epi16(step1[10], step1[13]); - const __m128i s2_10_1 = _mm_unpackhi_epi16(step1[10], step1[13]); - const __m128i s2_09_2 = _mm_madd_epi16(s2_09_0, k__cospi_m08_p24); - const __m128i s2_09_3 = _mm_madd_epi16(s2_09_1, k__cospi_m08_p24); - const __m128i s2_10_2 = _mm_madd_epi16(s2_10_0, k__cospi_m24_m08); - const __m128i s2_10_3 = _mm_madd_epi16(s2_10_1, k__cospi_m24_m08); - const __m128i s2_13_2 = _mm_madd_epi16(s2_10_0, k__cospi_m08_p24); - const __m128i s2_13_3 = _mm_madd_epi16(s2_10_1, k__cospi_m08_p24); - const __m128i s2_14_2 = _mm_madd_epi16(s2_09_0, k__cospi_p24_p08); - const __m128i s2_14_3 = _mm_madd_epi16(s2_09_1, k__cospi_p24_p08); - // dct_const_round_shift - const __m128i s2_09_4 = _mm_add_epi32(s2_09_2, k__DCT_CONST_ROUNDING); - const __m128i s2_09_5 = _mm_add_epi32(s2_09_3, k__DCT_CONST_ROUNDING); - const __m128i s2_10_4 = _mm_add_epi32(s2_10_2, k__DCT_CONST_ROUNDING); - const __m128i s2_10_5 = _mm_add_epi32(s2_10_3, k__DCT_CONST_ROUNDING); - const __m128i s2_13_4 = _mm_add_epi32(s2_13_2, k__DCT_CONST_ROUNDING); - const __m128i s2_13_5 = _mm_add_epi32(s2_13_3, k__DCT_CONST_ROUNDING); - const __m128i s2_14_4 = _mm_add_epi32(s2_14_2, k__DCT_CONST_ROUNDING); - const __m128i s2_14_5 = _mm_add_epi32(s2_14_3, k__DCT_CONST_ROUNDING); - const __m128i s2_09_6 = _mm_srai_epi32(s2_09_4, DCT_CONST_BITS); - const __m128i s2_09_7 = _mm_srai_epi32(s2_09_5, DCT_CONST_BITS); - const __m128i s2_10_6 = _mm_srai_epi32(s2_10_4, DCT_CONST_BITS); - const __m128i s2_10_7 = _mm_srai_epi32(s2_10_5, DCT_CONST_BITS); - const __m128i s2_13_6 = _mm_srai_epi32(s2_13_4, DCT_CONST_BITS); - const __m128i s2_13_7 = _mm_srai_epi32(s2_13_5, DCT_CONST_BITS); - const __m128i s2_14_6 = _mm_srai_epi32(s2_14_4, DCT_CONST_BITS); - const __m128i s2_14_7 = _mm_srai_epi32(s2_14_5, DCT_CONST_BITS); - // Combine - step2[ 9] = _mm_packs_epi32(s2_09_6, s2_09_7); - step2[10] = _mm_packs_epi32(s2_10_6, s2_10_7); - step2[13] = _mm_packs_epi32(s2_13_6, s2_13_7); - step2[14] = _mm_packs_epi32(s2_14_6, s2_14_7); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x4(&step2[9], &step2[10], - &step2[13], &step2[14]); - if (overflow) { - if (pass == 0) - HIGH_FDCT32x32_2D_C(input, output_org, stride); - else - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - { - step2[16] = ADD_EPI16(step1[19], step3[16]); - step2[17] = ADD_EPI16(step1[18], step3[17]); - step2[18] = SUB_EPI16(step3[17], step1[18]); - step2[19] = SUB_EPI16(step3[16], step1[19]); - step2[20] = SUB_EPI16(step3[23], step1[20]); - step2[21] = SUB_EPI16(step3[22], step1[21]); - step2[22] = ADD_EPI16(step1[21], step3[22]); - step2[23] = ADD_EPI16(step1[20], step3[23]); - step2[24] = ADD_EPI16(step1[27], step3[24]); - step2[25] = ADD_EPI16(step1[26], step3[25]); - step2[26] = SUB_EPI16(step3[25], step1[26]); - step2[27] = SUB_EPI16(step3[24], step1[27]); - step2[28] = SUB_EPI16(step3[31], step1[28]); - step2[29] = SUB_EPI16(step3[30], step1[29]); - step2[30] = ADD_EPI16(step1[29], step3[30]); - step2[31] = ADD_EPI16(step1[28], step3[31]); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x16( - &step2[16], &step2[17], &step2[18], &step2[19], - &step2[20], &step2[21], &step2[22], &step2[23], - &step2[24], &step2[25], &step2[26], &step2[27], - &step2[28], &step2[29], &step2[30], &step2[31]); - if (overflow) { - if (pass == 0) - HIGH_FDCT32x32_2D_C(input, output_org, stride); - else - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - // Stage 6 - { - const __m128i out_04_0 = _mm_unpacklo_epi16(step2[4], step2[7]); - const __m128i out_04_1 = _mm_unpackhi_epi16(step2[4], step2[7]); - const __m128i out_20_0 = _mm_unpacklo_epi16(step2[5], step2[6]); - const __m128i out_20_1 = _mm_unpackhi_epi16(step2[5], step2[6]); - const __m128i out_12_0 = _mm_unpacklo_epi16(step2[5], step2[6]); - const __m128i out_12_1 = _mm_unpackhi_epi16(step2[5], step2[6]); - const __m128i out_28_0 = _mm_unpacklo_epi16(step2[4], step2[7]); - const __m128i out_28_1 = _mm_unpackhi_epi16(step2[4], step2[7]); - const __m128i out_04_2 = _mm_madd_epi16(out_04_0, k__cospi_p28_p04); - const __m128i out_04_3 = _mm_madd_epi16(out_04_1, k__cospi_p28_p04); - const __m128i out_20_2 = _mm_madd_epi16(out_20_0, k__cospi_p12_p20); - const __m128i out_20_3 = _mm_madd_epi16(out_20_1, k__cospi_p12_p20); - const __m128i out_12_2 = _mm_madd_epi16(out_12_0, k__cospi_m20_p12); - const __m128i out_12_3 = _mm_madd_epi16(out_12_1, k__cospi_m20_p12); - const __m128i out_28_2 = _mm_madd_epi16(out_28_0, k__cospi_m04_p28); - const __m128i out_28_3 = _mm_madd_epi16(out_28_1, k__cospi_m04_p28); - // dct_const_round_shift - const __m128i out_04_4 = _mm_add_epi32(out_04_2, k__DCT_CONST_ROUNDING); - const __m128i out_04_5 = _mm_add_epi32(out_04_3, k__DCT_CONST_ROUNDING); - const __m128i out_20_4 = _mm_add_epi32(out_20_2, k__DCT_CONST_ROUNDING); - const __m128i out_20_5 = _mm_add_epi32(out_20_3, k__DCT_CONST_ROUNDING); - const __m128i out_12_4 = _mm_add_epi32(out_12_2, k__DCT_CONST_ROUNDING); - const __m128i out_12_5 = _mm_add_epi32(out_12_3, k__DCT_CONST_ROUNDING); - const __m128i out_28_4 = _mm_add_epi32(out_28_2, k__DCT_CONST_ROUNDING); - const __m128i out_28_5 = _mm_add_epi32(out_28_3, k__DCT_CONST_ROUNDING); - const __m128i out_04_6 = _mm_srai_epi32(out_04_4, DCT_CONST_BITS); - const __m128i out_04_7 = _mm_srai_epi32(out_04_5, DCT_CONST_BITS); - const __m128i out_20_6 = _mm_srai_epi32(out_20_4, DCT_CONST_BITS); - const __m128i out_20_7 = _mm_srai_epi32(out_20_5, DCT_CONST_BITS); - const __m128i out_12_6 = _mm_srai_epi32(out_12_4, DCT_CONST_BITS); - const __m128i out_12_7 = _mm_srai_epi32(out_12_5, DCT_CONST_BITS); - const __m128i out_28_6 = _mm_srai_epi32(out_28_4, DCT_CONST_BITS); - const __m128i out_28_7 = _mm_srai_epi32(out_28_5, DCT_CONST_BITS); - // Combine - out[4] = _mm_packs_epi32(out_04_6, out_04_7); - out[20] = _mm_packs_epi32(out_20_6, out_20_7); - out[12] = _mm_packs_epi32(out_12_6, out_12_7); - out[28] = _mm_packs_epi32(out_28_6, out_28_7); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x4(&out[4], &out[20], - &out[12], &out[28]); - if (overflow) { - if (pass == 0) - HIGH_FDCT32x32_2D_C(input, output_org, stride); - else - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - { - step3[8] = ADD_EPI16(step2[ 9], step1[ 8]); - step3[9] = SUB_EPI16(step1[ 8], step2[ 9]); - step3[10] = SUB_EPI16(step1[11], step2[10]); - step3[11] = ADD_EPI16(step2[10], step1[11]); - step3[12] = ADD_EPI16(step2[13], step1[12]); - step3[13] = SUB_EPI16(step1[12], step2[13]); - step3[14] = SUB_EPI16(step1[15], step2[14]); - step3[15] = ADD_EPI16(step2[14], step1[15]); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x8(&step3[8], &step3[9], &step3[10], - &step3[11], &step3[12], &step3[13], - &step3[14], &step3[15]); - if (overflow) { - if (pass == 0) - HIGH_FDCT32x32_2D_C(input, output_org, stride); - else - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - { - const __m128i s3_17_0 = _mm_unpacklo_epi16(step2[17], step2[30]); - const __m128i s3_17_1 = _mm_unpackhi_epi16(step2[17], step2[30]); - const __m128i s3_18_0 = _mm_unpacklo_epi16(step2[18], step2[29]); - const __m128i s3_18_1 = _mm_unpackhi_epi16(step2[18], step2[29]); - const __m128i s3_21_0 = _mm_unpacklo_epi16(step2[21], step2[26]); - const __m128i s3_21_1 = _mm_unpackhi_epi16(step2[21], step2[26]); - const __m128i s3_22_0 = _mm_unpacklo_epi16(step2[22], step2[25]); - const __m128i s3_22_1 = _mm_unpackhi_epi16(step2[22], step2[25]); - const __m128i s3_17_2 = _mm_madd_epi16(s3_17_0, k__cospi_m04_p28); - const __m128i s3_17_3 = _mm_madd_epi16(s3_17_1, k__cospi_m04_p28); - const __m128i s3_18_2 = _mm_madd_epi16(s3_18_0, k__cospi_m28_m04); - const __m128i s3_18_3 = _mm_madd_epi16(s3_18_1, k__cospi_m28_m04); - const __m128i s3_21_2 = _mm_madd_epi16(s3_21_0, k__cospi_m20_p12); - const __m128i s3_21_3 = _mm_madd_epi16(s3_21_1, k__cospi_m20_p12); - const __m128i s3_22_2 = _mm_madd_epi16(s3_22_0, k__cospi_m12_m20); - const __m128i s3_22_3 = _mm_madd_epi16(s3_22_1, k__cospi_m12_m20); - const __m128i s3_25_2 = _mm_madd_epi16(s3_22_0, k__cospi_m20_p12); - const __m128i s3_25_3 = _mm_madd_epi16(s3_22_1, k__cospi_m20_p12); - const __m128i s3_26_2 = _mm_madd_epi16(s3_21_0, k__cospi_p12_p20); - const __m128i s3_26_3 = _mm_madd_epi16(s3_21_1, k__cospi_p12_p20); - const __m128i s3_29_2 = _mm_madd_epi16(s3_18_0, k__cospi_m04_p28); - const __m128i s3_29_3 = _mm_madd_epi16(s3_18_1, k__cospi_m04_p28); - const __m128i s3_30_2 = _mm_madd_epi16(s3_17_0, k__cospi_p28_p04); - const __m128i s3_30_3 = _mm_madd_epi16(s3_17_1, k__cospi_p28_p04); - // dct_const_round_shift - const __m128i s3_17_4 = _mm_add_epi32(s3_17_2, k__DCT_CONST_ROUNDING); - const __m128i s3_17_5 = _mm_add_epi32(s3_17_3, k__DCT_CONST_ROUNDING); - const __m128i s3_18_4 = _mm_add_epi32(s3_18_2, k__DCT_CONST_ROUNDING); - const __m128i s3_18_5 = _mm_add_epi32(s3_18_3, k__DCT_CONST_ROUNDING); - const __m128i s3_21_4 = _mm_add_epi32(s3_21_2, k__DCT_CONST_ROUNDING); - const __m128i s3_21_5 = _mm_add_epi32(s3_21_3, k__DCT_CONST_ROUNDING); - const __m128i s3_22_4 = _mm_add_epi32(s3_22_2, k__DCT_CONST_ROUNDING); - const __m128i s3_22_5 = _mm_add_epi32(s3_22_3, k__DCT_CONST_ROUNDING); - const __m128i s3_17_6 = _mm_srai_epi32(s3_17_4, DCT_CONST_BITS); - const __m128i s3_17_7 = _mm_srai_epi32(s3_17_5, DCT_CONST_BITS); - const __m128i s3_18_6 = _mm_srai_epi32(s3_18_4, DCT_CONST_BITS); - const __m128i s3_18_7 = _mm_srai_epi32(s3_18_5, DCT_CONST_BITS); - const __m128i s3_21_6 = _mm_srai_epi32(s3_21_4, DCT_CONST_BITS); - const __m128i s3_21_7 = _mm_srai_epi32(s3_21_5, DCT_CONST_BITS); - const __m128i s3_22_6 = _mm_srai_epi32(s3_22_4, DCT_CONST_BITS); - const __m128i s3_22_7 = _mm_srai_epi32(s3_22_5, DCT_CONST_BITS); - const __m128i s3_25_4 = _mm_add_epi32(s3_25_2, k__DCT_CONST_ROUNDING); - const __m128i s3_25_5 = _mm_add_epi32(s3_25_3, k__DCT_CONST_ROUNDING); - const __m128i s3_26_4 = _mm_add_epi32(s3_26_2, k__DCT_CONST_ROUNDING); - const __m128i s3_26_5 = _mm_add_epi32(s3_26_3, k__DCT_CONST_ROUNDING); - const __m128i s3_29_4 = _mm_add_epi32(s3_29_2, k__DCT_CONST_ROUNDING); - const __m128i s3_29_5 = _mm_add_epi32(s3_29_3, k__DCT_CONST_ROUNDING); - const __m128i s3_30_4 = _mm_add_epi32(s3_30_2, k__DCT_CONST_ROUNDING); - const __m128i s3_30_5 = _mm_add_epi32(s3_30_3, k__DCT_CONST_ROUNDING); - const __m128i s3_25_6 = _mm_srai_epi32(s3_25_4, DCT_CONST_BITS); - const __m128i s3_25_7 = _mm_srai_epi32(s3_25_5, DCT_CONST_BITS); - const __m128i s3_26_6 = _mm_srai_epi32(s3_26_4, DCT_CONST_BITS); - const __m128i s3_26_7 = _mm_srai_epi32(s3_26_5, DCT_CONST_BITS); - const __m128i s3_29_6 = _mm_srai_epi32(s3_29_4, DCT_CONST_BITS); - const __m128i s3_29_7 = _mm_srai_epi32(s3_29_5, DCT_CONST_BITS); - const __m128i s3_30_6 = _mm_srai_epi32(s3_30_4, DCT_CONST_BITS); - const __m128i s3_30_7 = _mm_srai_epi32(s3_30_5, DCT_CONST_BITS); - // Combine - step3[17] = _mm_packs_epi32(s3_17_6, s3_17_7); - step3[18] = _mm_packs_epi32(s3_18_6, s3_18_7); - step3[21] = _mm_packs_epi32(s3_21_6, s3_21_7); - step3[22] = _mm_packs_epi32(s3_22_6, s3_22_7); - // Combine - step3[25] = _mm_packs_epi32(s3_25_6, s3_25_7); - step3[26] = _mm_packs_epi32(s3_26_6, s3_26_7); - step3[29] = _mm_packs_epi32(s3_29_6, s3_29_7); - step3[30] = _mm_packs_epi32(s3_30_6, s3_30_7); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x8(&step3[17], &step3[18], &step3[21], - &step3[22], &step3[25], &step3[26], - &step3[29], &step3[30]); - if (overflow) { - if (pass == 0) - HIGH_FDCT32x32_2D_C(input, output_org, stride); - else - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - // Stage 7 - { - const __m128i out_02_0 = _mm_unpacklo_epi16(step3[ 8], step3[15]); - const __m128i out_02_1 = _mm_unpackhi_epi16(step3[ 8], step3[15]); - const __m128i out_18_0 = _mm_unpacklo_epi16(step3[ 9], step3[14]); - const __m128i out_18_1 = _mm_unpackhi_epi16(step3[ 9], step3[14]); - const __m128i out_10_0 = _mm_unpacklo_epi16(step3[10], step3[13]); - const __m128i out_10_1 = _mm_unpackhi_epi16(step3[10], step3[13]); - const __m128i out_26_0 = _mm_unpacklo_epi16(step3[11], step3[12]); - const __m128i out_26_1 = _mm_unpackhi_epi16(step3[11], step3[12]); - const __m128i out_02_2 = _mm_madd_epi16(out_02_0, k__cospi_p30_p02); - const __m128i out_02_3 = _mm_madd_epi16(out_02_1, k__cospi_p30_p02); - const __m128i out_18_2 = _mm_madd_epi16(out_18_0, k__cospi_p14_p18); - const __m128i out_18_3 = _mm_madd_epi16(out_18_1, k__cospi_p14_p18); - const __m128i out_10_2 = _mm_madd_epi16(out_10_0, k__cospi_p22_p10); - const __m128i out_10_3 = _mm_madd_epi16(out_10_1, k__cospi_p22_p10); - const __m128i out_26_2 = _mm_madd_epi16(out_26_0, k__cospi_p06_p26); - const __m128i out_26_3 = _mm_madd_epi16(out_26_1, k__cospi_p06_p26); - const __m128i out_06_2 = _mm_madd_epi16(out_26_0, k__cospi_m26_p06); - const __m128i out_06_3 = _mm_madd_epi16(out_26_1, k__cospi_m26_p06); - const __m128i out_22_2 = _mm_madd_epi16(out_10_0, k__cospi_m10_p22); - const __m128i out_22_3 = _mm_madd_epi16(out_10_1, k__cospi_m10_p22); - const __m128i out_14_2 = _mm_madd_epi16(out_18_0, k__cospi_m18_p14); - const __m128i out_14_3 = _mm_madd_epi16(out_18_1, k__cospi_m18_p14); - const __m128i out_30_2 = _mm_madd_epi16(out_02_0, k__cospi_m02_p30); - const __m128i out_30_3 = _mm_madd_epi16(out_02_1, k__cospi_m02_p30); - // dct_const_round_shift - const __m128i out_02_4 = _mm_add_epi32(out_02_2, k__DCT_CONST_ROUNDING); - const __m128i out_02_5 = _mm_add_epi32(out_02_3, k__DCT_CONST_ROUNDING); - const __m128i out_18_4 = _mm_add_epi32(out_18_2, k__DCT_CONST_ROUNDING); - const __m128i out_18_5 = _mm_add_epi32(out_18_3, k__DCT_CONST_ROUNDING); - const __m128i out_10_4 = _mm_add_epi32(out_10_2, k__DCT_CONST_ROUNDING); - const __m128i out_10_5 = _mm_add_epi32(out_10_3, k__DCT_CONST_ROUNDING); - const __m128i out_26_4 = _mm_add_epi32(out_26_2, k__DCT_CONST_ROUNDING); - const __m128i out_26_5 = _mm_add_epi32(out_26_3, k__DCT_CONST_ROUNDING); - const __m128i out_06_4 = _mm_add_epi32(out_06_2, k__DCT_CONST_ROUNDING); - const __m128i out_06_5 = _mm_add_epi32(out_06_3, k__DCT_CONST_ROUNDING); - const __m128i out_22_4 = _mm_add_epi32(out_22_2, k__DCT_CONST_ROUNDING); - const __m128i out_22_5 = _mm_add_epi32(out_22_3, k__DCT_CONST_ROUNDING); - const __m128i out_14_4 = _mm_add_epi32(out_14_2, k__DCT_CONST_ROUNDING); - const __m128i out_14_5 = _mm_add_epi32(out_14_3, k__DCT_CONST_ROUNDING); - const __m128i out_30_4 = _mm_add_epi32(out_30_2, k__DCT_CONST_ROUNDING); - const __m128i out_30_5 = _mm_add_epi32(out_30_3, k__DCT_CONST_ROUNDING); - const __m128i out_02_6 = _mm_srai_epi32(out_02_4, DCT_CONST_BITS); - const __m128i out_02_7 = _mm_srai_epi32(out_02_5, DCT_CONST_BITS); - const __m128i out_18_6 = _mm_srai_epi32(out_18_4, DCT_CONST_BITS); - const __m128i out_18_7 = _mm_srai_epi32(out_18_5, DCT_CONST_BITS); - const __m128i out_10_6 = _mm_srai_epi32(out_10_4, DCT_CONST_BITS); - const __m128i out_10_7 = _mm_srai_epi32(out_10_5, DCT_CONST_BITS); - const __m128i out_26_6 = _mm_srai_epi32(out_26_4, DCT_CONST_BITS); - const __m128i out_26_7 = _mm_srai_epi32(out_26_5, DCT_CONST_BITS); - const __m128i out_06_6 = _mm_srai_epi32(out_06_4, DCT_CONST_BITS); - const __m128i out_06_7 = _mm_srai_epi32(out_06_5, DCT_CONST_BITS); - const __m128i out_22_6 = _mm_srai_epi32(out_22_4, DCT_CONST_BITS); - const __m128i out_22_7 = _mm_srai_epi32(out_22_5, DCT_CONST_BITS); - const __m128i out_14_6 = _mm_srai_epi32(out_14_4, DCT_CONST_BITS); - const __m128i out_14_7 = _mm_srai_epi32(out_14_5, DCT_CONST_BITS); - const __m128i out_30_6 = _mm_srai_epi32(out_30_4, DCT_CONST_BITS); - const __m128i out_30_7 = _mm_srai_epi32(out_30_5, DCT_CONST_BITS); - // Combine - out[ 2] = _mm_packs_epi32(out_02_6, out_02_7); - out[18] = _mm_packs_epi32(out_18_6, out_18_7); - out[10] = _mm_packs_epi32(out_10_6, out_10_7); - out[26] = _mm_packs_epi32(out_26_6, out_26_7); - out[ 6] = _mm_packs_epi32(out_06_6, out_06_7); - out[22] = _mm_packs_epi32(out_22_6, out_22_7); - out[14] = _mm_packs_epi32(out_14_6, out_14_7); - out[30] = _mm_packs_epi32(out_30_6, out_30_7); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x8(&out[2], &out[18], &out[10], - &out[26], &out[6], &out[22], - &out[14], &out[30]); - if (overflow) { - if (pass == 0) - HIGH_FDCT32x32_2D_C(input, output_org, stride); - else - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - { - step1[16] = ADD_EPI16(step3[17], step2[16]); - step1[17] = SUB_EPI16(step2[16], step3[17]); - step1[18] = SUB_EPI16(step2[19], step3[18]); - step1[19] = ADD_EPI16(step3[18], step2[19]); - step1[20] = ADD_EPI16(step3[21], step2[20]); - step1[21] = SUB_EPI16(step2[20], step3[21]); - step1[22] = SUB_EPI16(step2[23], step3[22]); - step1[23] = ADD_EPI16(step3[22], step2[23]); - step1[24] = ADD_EPI16(step3[25], step2[24]); - step1[25] = SUB_EPI16(step2[24], step3[25]); - step1[26] = SUB_EPI16(step2[27], step3[26]); - step1[27] = ADD_EPI16(step3[26], step2[27]); - step1[28] = ADD_EPI16(step3[29], step2[28]); - step1[29] = SUB_EPI16(step2[28], step3[29]); - step1[30] = SUB_EPI16(step2[31], step3[30]); - step1[31] = ADD_EPI16(step3[30], step2[31]); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x16( - &step1[16], &step1[17], &step1[18], &step1[19], - &step1[20], &step1[21], &step1[22], &step1[23], - &step1[24], &step1[25], &step1[26], &step1[27], - &step1[28], &step1[29], &step1[30], &step1[31]); - if (overflow) { - if (pass == 0) - HIGH_FDCT32x32_2D_C(input, output_org, stride); - else - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - // Final stage --- outputs indices are bit-reversed. - { - const __m128i out_01_0 = _mm_unpacklo_epi16(step1[16], step1[31]); - const __m128i out_01_1 = _mm_unpackhi_epi16(step1[16], step1[31]); - const __m128i out_17_0 = _mm_unpacklo_epi16(step1[17], step1[30]); - const __m128i out_17_1 = _mm_unpackhi_epi16(step1[17], step1[30]); - const __m128i out_09_0 = _mm_unpacklo_epi16(step1[18], step1[29]); - const __m128i out_09_1 = _mm_unpackhi_epi16(step1[18], step1[29]); - const __m128i out_25_0 = _mm_unpacklo_epi16(step1[19], step1[28]); - const __m128i out_25_1 = _mm_unpackhi_epi16(step1[19], step1[28]); - const __m128i out_01_2 = _mm_madd_epi16(out_01_0, k__cospi_p31_p01); - const __m128i out_01_3 = _mm_madd_epi16(out_01_1, k__cospi_p31_p01); - const __m128i out_17_2 = _mm_madd_epi16(out_17_0, k__cospi_p15_p17); - const __m128i out_17_3 = _mm_madd_epi16(out_17_1, k__cospi_p15_p17); - const __m128i out_09_2 = _mm_madd_epi16(out_09_0, k__cospi_p23_p09); - const __m128i out_09_3 = _mm_madd_epi16(out_09_1, k__cospi_p23_p09); - const __m128i out_25_2 = _mm_madd_epi16(out_25_0, k__cospi_p07_p25); - const __m128i out_25_3 = _mm_madd_epi16(out_25_1, k__cospi_p07_p25); - const __m128i out_07_2 = _mm_madd_epi16(out_25_0, k__cospi_m25_p07); - const __m128i out_07_3 = _mm_madd_epi16(out_25_1, k__cospi_m25_p07); - const __m128i out_23_2 = _mm_madd_epi16(out_09_0, k__cospi_m09_p23); - const __m128i out_23_3 = _mm_madd_epi16(out_09_1, k__cospi_m09_p23); - const __m128i out_15_2 = _mm_madd_epi16(out_17_0, k__cospi_m17_p15); - const __m128i out_15_3 = _mm_madd_epi16(out_17_1, k__cospi_m17_p15); - const __m128i out_31_2 = _mm_madd_epi16(out_01_0, k__cospi_m01_p31); - const __m128i out_31_3 = _mm_madd_epi16(out_01_1, k__cospi_m01_p31); - // dct_const_round_shift - const __m128i out_01_4 = _mm_add_epi32(out_01_2, k__DCT_CONST_ROUNDING); - const __m128i out_01_5 = _mm_add_epi32(out_01_3, k__DCT_CONST_ROUNDING); - const __m128i out_17_4 = _mm_add_epi32(out_17_2, k__DCT_CONST_ROUNDING); - const __m128i out_17_5 = _mm_add_epi32(out_17_3, k__DCT_CONST_ROUNDING); - const __m128i out_09_4 = _mm_add_epi32(out_09_2, k__DCT_CONST_ROUNDING); - const __m128i out_09_5 = _mm_add_epi32(out_09_3, k__DCT_CONST_ROUNDING); - const __m128i out_25_4 = _mm_add_epi32(out_25_2, k__DCT_CONST_ROUNDING); - const __m128i out_25_5 = _mm_add_epi32(out_25_3, k__DCT_CONST_ROUNDING); - const __m128i out_07_4 = _mm_add_epi32(out_07_2, k__DCT_CONST_ROUNDING); - const __m128i out_07_5 = _mm_add_epi32(out_07_3, k__DCT_CONST_ROUNDING); - const __m128i out_23_4 = _mm_add_epi32(out_23_2, k__DCT_CONST_ROUNDING); - const __m128i out_23_5 = _mm_add_epi32(out_23_3, k__DCT_CONST_ROUNDING); - const __m128i out_15_4 = _mm_add_epi32(out_15_2, k__DCT_CONST_ROUNDING); - const __m128i out_15_5 = _mm_add_epi32(out_15_3, k__DCT_CONST_ROUNDING); - const __m128i out_31_4 = _mm_add_epi32(out_31_2, k__DCT_CONST_ROUNDING); - const __m128i out_31_5 = _mm_add_epi32(out_31_3, k__DCT_CONST_ROUNDING); - const __m128i out_01_6 = _mm_srai_epi32(out_01_4, DCT_CONST_BITS); - const __m128i out_01_7 = _mm_srai_epi32(out_01_5, DCT_CONST_BITS); - const __m128i out_17_6 = _mm_srai_epi32(out_17_4, DCT_CONST_BITS); - const __m128i out_17_7 = _mm_srai_epi32(out_17_5, DCT_CONST_BITS); - const __m128i out_09_6 = _mm_srai_epi32(out_09_4, DCT_CONST_BITS); - const __m128i out_09_7 = _mm_srai_epi32(out_09_5, DCT_CONST_BITS); - const __m128i out_25_6 = _mm_srai_epi32(out_25_4, DCT_CONST_BITS); - const __m128i out_25_7 = _mm_srai_epi32(out_25_5, DCT_CONST_BITS); - const __m128i out_07_6 = _mm_srai_epi32(out_07_4, DCT_CONST_BITS); - const __m128i out_07_7 = _mm_srai_epi32(out_07_5, DCT_CONST_BITS); - const __m128i out_23_6 = _mm_srai_epi32(out_23_4, DCT_CONST_BITS); - const __m128i out_23_7 = _mm_srai_epi32(out_23_5, DCT_CONST_BITS); - const __m128i out_15_6 = _mm_srai_epi32(out_15_4, DCT_CONST_BITS); - const __m128i out_15_7 = _mm_srai_epi32(out_15_5, DCT_CONST_BITS); - const __m128i out_31_6 = _mm_srai_epi32(out_31_4, DCT_CONST_BITS); - const __m128i out_31_7 = _mm_srai_epi32(out_31_5, DCT_CONST_BITS); - // Combine - out[ 1] = _mm_packs_epi32(out_01_6, out_01_7); - out[17] = _mm_packs_epi32(out_17_6, out_17_7); - out[ 9] = _mm_packs_epi32(out_09_6, out_09_7); - out[25] = _mm_packs_epi32(out_25_6, out_25_7); - out[ 7] = _mm_packs_epi32(out_07_6, out_07_7); - out[23] = _mm_packs_epi32(out_23_6, out_23_7); - out[15] = _mm_packs_epi32(out_15_6, out_15_7); - out[31] = _mm_packs_epi32(out_31_6, out_31_7); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x8(&out[1], &out[17], &out[9], - &out[25], &out[7], &out[23], - &out[15], &out[31]); - if (overflow) { - if (pass == 0) - HIGH_FDCT32x32_2D_C(input, output_org, stride); - else - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - { - const __m128i out_05_0 = _mm_unpacklo_epi16(step1[20], step1[27]); - const __m128i out_05_1 = _mm_unpackhi_epi16(step1[20], step1[27]); - const __m128i out_21_0 = _mm_unpacklo_epi16(step1[21], step1[26]); - const __m128i out_21_1 = _mm_unpackhi_epi16(step1[21], step1[26]); - const __m128i out_13_0 = _mm_unpacklo_epi16(step1[22], step1[25]); - const __m128i out_13_1 = _mm_unpackhi_epi16(step1[22], step1[25]); - const __m128i out_29_0 = _mm_unpacklo_epi16(step1[23], step1[24]); - const __m128i out_29_1 = _mm_unpackhi_epi16(step1[23], step1[24]); - const __m128i out_05_2 = _mm_madd_epi16(out_05_0, k__cospi_p27_p05); - const __m128i out_05_3 = _mm_madd_epi16(out_05_1, k__cospi_p27_p05); - const __m128i out_21_2 = _mm_madd_epi16(out_21_0, k__cospi_p11_p21); - const __m128i out_21_3 = _mm_madd_epi16(out_21_1, k__cospi_p11_p21); - const __m128i out_13_2 = _mm_madd_epi16(out_13_0, k__cospi_p19_p13); - const __m128i out_13_3 = _mm_madd_epi16(out_13_1, k__cospi_p19_p13); - const __m128i out_29_2 = _mm_madd_epi16(out_29_0, k__cospi_p03_p29); - const __m128i out_29_3 = _mm_madd_epi16(out_29_1, k__cospi_p03_p29); - const __m128i out_03_2 = _mm_madd_epi16(out_29_0, k__cospi_m29_p03); - const __m128i out_03_3 = _mm_madd_epi16(out_29_1, k__cospi_m29_p03); - const __m128i out_19_2 = _mm_madd_epi16(out_13_0, k__cospi_m13_p19); - const __m128i out_19_3 = _mm_madd_epi16(out_13_1, k__cospi_m13_p19); - const __m128i out_11_2 = _mm_madd_epi16(out_21_0, k__cospi_m21_p11); - const __m128i out_11_3 = _mm_madd_epi16(out_21_1, k__cospi_m21_p11); - const __m128i out_27_2 = _mm_madd_epi16(out_05_0, k__cospi_m05_p27); - const __m128i out_27_3 = _mm_madd_epi16(out_05_1, k__cospi_m05_p27); - // dct_const_round_shift - const __m128i out_05_4 = _mm_add_epi32(out_05_2, k__DCT_CONST_ROUNDING); - const __m128i out_05_5 = _mm_add_epi32(out_05_3, k__DCT_CONST_ROUNDING); - const __m128i out_21_4 = _mm_add_epi32(out_21_2, k__DCT_CONST_ROUNDING); - const __m128i out_21_5 = _mm_add_epi32(out_21_3, k__DCT_CONST_ROUNDING); - const __m128i out_13_4 = _mm_add_epi32(out_13_2, k__DCT_CONST_ROUNDING); - const __m128i out_13_5 = _mm_add_epi32(out_13_3, k__DCT_CONST_ROUNDING); - const __m128i out_29_4 = _mm_add_epi32(out_29_2, k__DCT_CONST_ROUNDING); - const __m128i out_29_5 = _mm_add_epi32(out_29_3, k__DCT_CONST_ROUNDING); - const __m128i out_03_4 = _mm_add_epi32(out_03_2, k__DCT_CONST_ROUNDING); - const __m128i out_03_5 = _mm_add_epi32(out_03_3, k__DCT_CONST_ROUNDING); - const __m128i out_19_4 = _mm_add_epi32(out_19_2, k__DCT_CONST_ROUNDING); - const __m128i out_19_5 = _mm_add_epi32(out_19_3, k__DCT_CONST_ROUNDING); - const __m128i out_11_4 = _mm_add_epi32(out_11_2, k__DCT_CONST_ROUNDING); - const __m128i out_11_5 = _mm_add_epi32(out_11_3, k__DCT_CONST_ROUNDING); - const __m128i out_27_4 = _mm_add_epi32(out_27_2, k__DCT_CONST_ROUNDING); - const __m128i out_27_5 = _mm_add_epi32(out_27_3, k__DCT_CONST_ROUNDING); - const __m128i out_05_6 = _mm_srai_epi32(out_05_4, DCT_CONST_BITS); - const __m128i out_05_7 = _mm_srai_epi32(out_05_5, DCT_CONST_BITS); - const __m128i out_21_6 = _mm_srai_epi32(out_21_4, DCT_CONST_BITS); - const __m128i out_21_7 = _mm_srai_epi32(out_21_5, DCT_CONST_BITS); - const __m128i out_13_6 = _mm_srai_epi32(out_13_4, DCT_CONST_BITS); - const __m128i out_13_7 = _mm_srai_epi32(out_13_5, DCT_CONST_BITS); - const __m128i out_29_6 = _mm_srai_epi32(out_29_4, DCT_CONST_BITS); - const __m128i out_29_7 = _mm_srai_epi32(out_29_5, DCT_CONST_BITS); - const __m128i out_03_6 = _mm_srai_epi32(out_03_4, DCT_CONST_BITS); - const __m128i out_03_7 = _mm_srai_epi32(out_03_5, DCT_CONST_BITS); - const __m128i out_19_6 = _mm_srai_epi32(out_19_4, DCT_CONST_BITS); - const __m128i out_19_7 = _mm_srai_epi32(out_19_5, DCT_CONST_BITS); - const __m128i out_11_6 = _mm_srai_epi32(out_11_4, DCT_CONST_BITS); - const __m128i out_11_7 = _mm_srai_epi32(out_11_5, DCT_CONST_BITS); - const __m128i out_27_6 = _mm_srai_epi32(out_27_4, DCT_CONST_BITS); - const __m128i out_27_7 = _mm_srai_epi32(out_27_5, DCT_CONST_BITS); - // Combine - out[ 5] = _mm_packs_epi32(out_05_6, out_05_7); - out[21] = _mm_packs_epi32(out_21_6, out_21_7); - out[13] = _mm_packs_epi32(out_13_6, out_13_7); - out[29] = _mm_packs_epi32(out_29_6, out_29_7); - out[ 3] = _mm_packs_epi32(out_03_6, out_03_7); - out[19] = _mm_packs_epi32(out_19_6, out_19_7); - out[11] = _mm_packs_epi32(out_11_6, out_11_7); - out[27] = _mm_packs_epi32(out_27_6, out_27_7); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x8(&out[5], &out[21], &out[13], - &out[29], &out[3], &out[19], - &out[11], &out[27]); - if (overflow) { - if (pass == 0) - HIGH_FDCT32x32_2D_C(input, output_org, stride); - else - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } -#if FDCT32x32_HIGH_PRECISION - } else { - __m128i lstep1[64], lstep2[64], lstep3[64]; - __m128i u[32], v[32], sign[16]; - const __m128i K32One = _mm_set_epi32(1, 1, 1, 1); - // start using 32-bit operations - // stage 3 - { - // expanding to 32-bit length priori to addition operations - lstep2[ 0] = _mm_unpacklo_epi16(step2[ 0], kZero); - lstep2[ 1] = _mm_unpackhi_epi16(step2[ 0], kZero); - lstep2[ 2] = _mm_unpacklo_epi16(step2[ 1], kZero); - lstep2[ 3] = _mm_unpackhi_epi16(step2[ 1], kZero); - lstep2[ 4] = _mm_unpacklo_epi16(step2[ 2], kZero); - lstep2[ 5] = _mm_unpackhi_epi16(step2[ 2], kZero); - lstep2[ 6] = _mm_unpacklo_epi16(step2[ 3], kZero); - lstep2[ 7] = _mm_unpackhi_epi16(step2[ 3], kZero); - lstep2[ 8] = _mm_unpacklo_epi16(step2[ 4], kZero); - lstep2[ 9] = _mm_unpackhi_epi16(step2[ 4], kZero); - lstep2[10] = _mm_unpacklo_epi16(step2[ 5], kZero); - lstep2[11] = _mm_unpackhi_epi16(step2[ 5], kZero); - lstep2[12] = _mm_unpacklo_epi16(step2[ 6], kZero); - lstep2[13] = _mm_unpackhi_epi16(step2[ 6], kZero); - lstep2[14] = _mm_unpacklo_epi16(step2[ 7], kZero); - lstep2[15] = _mm_unpackhi_epi16(step2[ 7], kZero); - lstep2[ 0] = _mm_madd_epi16(lstep2[ 0], kOne); - lstep2[ 1] = _mm_madd_epi16(lstep2[ 1], kOne); - lstep2[ 2] = _mm_madd_epi16(lstep2[ 2], kOne); - lstep2[ 3] = _mm_madd_epi16(lstep2[ 3], kOne); - lstep2[ 4] = _mm_madd_epi16(lstep2[ 4], kOne); - lstep2[ 5] = _mm_madd_epi16(lstep2[ 5], kOne); - lstep2[ 6] = _mm_madd_epi16(lstep2[ 6], kOne); - lstep2[ 7] = _mm_madd_epi16(lstep2[ 7], kOne); - lstep2[ 8] = _mm_madd_epi16(lstep2[ 8], kOne); - lstep2[ 9] = _mm_madd_epi16(lstep2[ 9], kOne); - lstep2[10] = _mm_madd_epi16(lstep2[10], kOne); - lstep2[11] = _mm_madd_epi16(lstep2[11], kOne); - lstep2[12] = _mm_madd_epi16(lstep2[12], kOne); - lstep2[13] = _mm_madd_epi16(lstep2[13], kOne); - lstep2[14] = _mm_madd_epi16(lstep2[14], kOne); - lstep2[15] = _mm_madd_epi16(lstep2[15], kOne); - - lstep3[ 0] = _mm_add_epi32(lstep2[14], lstep2[ 0]); - lstep3[ 1] = _mm_add_epi32(lstep2[15], lstep2[ 1]); - lstep3[ 2] = _mm_add_epi32(lstep2[12], lstep2[ 2]); - lstep3[ 3] = _mm_add_epi32(lstep2[13], lstep2[ 3]); - lstep3[ 4] = _mm_add_epi32(lstep2[10], lstep2[ 4]); - lstep3[ 5] = _mm_add_epi32(lstep2[11], lstep2[ 5]); - lstep3[ 6] = _mm_add_epi32(lstep2[ 8], lstep2[ 6]); - lstep3[ 7] = _mm_add_epi32(lstep2[ 9], lstep2[ 7]); - lstep3[ 8] = _mm_sub_epi32(lstep2[ 6], lstep2[ 8]); - lstep3[ 9] = _mm_sub_epi32(lstep2[ 7], lstep2[ 9]); - lstep3[10] = _mm_sub_epi32(lstep2[ 4], lstep2[10]); - lstep3[11] = _mm_sub_epi32(lstep2[ 5], lstep2[11]); - lstep3[12] = _mm_sub_epi32(lstep2[ 2], lstep2[12]); - lstep3[13] = _mm_sub_epi32(lstep2[ 3], lstep2[13]); - lstep3[14] = _mm_sub_epi32(lstep2[ 0], lstep2[14]); - lstep3[15] = _mm_sub_epi32(lstep2[ 1], lstep2[15]); - } - { - const __m128i s3_10_0 = _mm_unpacklo_epi16(step2[13], step2[10]); - const __m128i s3_10_1 = _mm_unpackhi_epi16(step2[13], step2[10]); - const __m128i s3_11_0 = _mm_unpacklo_epi16(step2[12], step2[11]); - const __m128i s3_11_1 = _mm_unpackhi_epi16(step2[12], step2[11]); - const __m128i s3_10_2 = _mm_madd_epi16(s3_10_0, k__cospi_p16_m16); - const __m128i s3_10_3 = _mm_madd_epi16(s3_10_1, k__cospi_p16_m16); - const __m128i s3_11_2 = _mm_madd_epi16(s3_11_0, k__cospi_p16_m16); - const __m128i s3_11_3 = _mm_madd_epi16(s3_11_1, k__cospi_p16_m16); - const __m128i s3_12_2 = _mm_madd_epi16(s3_11_0, k__cospi_p16_p16); - const __m128i s3_12_3 = _mm_madd_epi16(s3_11_1, k__cospi_p16_p16); - const __m128i s3_13_2 = _mm_madd_epi16(s3_10_0, k__cospi_p16_p16); - const __m128i s3_13_3 = _mm_madd_epi16(s3_10_1, k__cospi_p16_p16); - // dct_const_round_shift - const __m128i s3_10_4 = _mm_add_epi32(s3_10_2, k__DCT_CONST_ROUNDING); - const __m128i s3_10_5 = _mm_add_epi32(s3_10_3, k__DCT_CONST_ROUNDING); - const __m128i s3_11_4 = _mm_add_epi32(s3_11_2, k__DCT_CONST_ROUNDING); - const __m128i s3_11_5 = _mm_add_epi32(s3_11_3, k__DCT_CONST_ROUNDING); - const __m128i s3_12_4 = _mm_add_epi32(s3_12_2, k__DCT_CONST_ROUNDING); - const __m128i s3_12_5 = _mm_add_epi32(s3_12_3, k__DCT_CONST_ROUNDING); - const __m128i s3_13_4 = _mm_add_epi32(s3_13_2, k__DCT_CONST_ROUNDING); - const __m128i s3_13_5 = _mm_add_epi32(s3_13_3, k__DCT_CONST_ROUNDING); - lstep3[20] = _mm_srai_epi32(s3_10_4, DCT_CONST_BITS); - lstep3[21] = _mm_srai_epi32(s3_10_5, DCT_CONST_BITS); - lstep3[22] = _mm_srai_epi32(s3_11_4, DCT_CONST_BITS); - lstep3[23] = _mm_srai_epi32(s3_11_5, DCT_CONST_BITS); - lstep3[24] = _mm_srai_epi32(s3_12_4, DCT_CONST_BITS); - lstep3[25] = _mm_srai_epi32(s3_12_5, DCT_CONST_BITS); - lstep3[26] = _mm_srai_epi32(s3_13_4, DCT_CONST_BITS); - lstep3[27] = _mm_srai_epi32(s3_13_5, DCT_CONST_BITS); - } - { - lstep2[40] = _mm_unpacklo_epi16(step2[20], kZero); - lstep2[41] = _mm_unpackhi_epi16(step2[20], kZero); - lstep2[42] = _mm_unpacklo_epi16(step2[21], kZero); - lstep2[43] = _mm_unpackhi_epi16(step2[21], kZero); - lstep2[44] = _mm_unpacklo_epi16(step2[22], kZero); - lstep2[45] = _mm_unpackhi_epi16(step2[22], kZero); - lstep2[46] = _mm_unpacklo_epi16(step2[23], kZero); - lstep2[47] = _mm_unpackhi_epi16(step2[23], kZero); - lstep2[48] = _mm_unpacklo_epi16(step2[24], kZero); - lstep2[49] = _mm_unpackhi_epi16(step2[24], kZero); - lstep2[50] = _mm_unpacklo_epi16(step2[25], kZero); - lstep2[51] = _mm_unpackhi_epi16(step2[25], kZero); - lstep2[52] = _mm_unpacklo_epi16(step2[26], kZero); - lstep2[53] = _mm_unpackhi_epi16(step2[26], kZero); - lstep2[54] = _mm_unpacklo_epi16(step2[27], kZero); - lstep2[55] = _mm_unpackhi_epi16(step2[27], kZero); - lstep2[40] = _mm_madd_epi16(lstep2[40], kOne); - lstep2[41] = _mm_madd_epi16(lstep2[41], kOne); - lstep2[42] = _mm_madd_epi16(lstep2[42], kOne); - lstep2[43] = _mm_madd_epi16(lstep2[43], kOne); - lstep2[44] = _mm_madd_epi16(lstep2[44], kOne); - lstep2[45] = _mm_madd_epi16(lstep2[45], kOne); - lstep2[46] = _mm_madd_epi16(lstep2[46], kOne); - lstep2[47] = _mm_madd_epi16(lstep2[47], kOne); - lstep2[48] = _mm_madd_epi16(lstep2[48], kOne); - lstep2[49] = _mm_madd_epi16(lstep2[49], kOne); - lstep2[50] = _mm_madd_epi16(lstep2[50], kOne); - lstep2[51] = _mm_madd_epi16(lstep2[51], kOne); - lstep2[52] = _mm_madd_epi16(lstep2[52], kOne); - lstep2[53] = _mm_madd_epi16(lstep2[53], kOne); - lstep2[54] = _mm_madd_epi16(lstep2[54], kOne); - lstep2[55] = _mm_madd_epi16(lstep2[55], kOne); - - lstep1[32] = _mm_unpacklo_epi16(step1[16], kZero); - lstep1[33] = _mm_unpackhi_epi16(step1[16], kZero); - lstep1[34] = _mm_unpacklo_epi16(step1[17], kZero); - lstep1[35] = _mm_unpackhi_epi16(step1[17], kZero); - lstep1[36] = _mm_unpacklo_epi16(step1[18], kZero); - lstep1[37] = _mm_unpackhi_epi16(step1[18], kZero); - lstep1[38] = _mm_unpacklo_epi16(step1[19], kZero); - lstep1[39] = _mm_unpackhi_epi16(step1[19], kZero); - lstep1[56] = _mm_unpacklo_epi16(step1[28], kZero); - lstep1[57] = _mm_unpackhi_epi16(step1[28], kZero); - lstep1[58] = _mm_unpacklo_epi16(step1[29], kZero); - lstep1[59] = _mm_unpackhi_epi16(step1[29], kZero); - lstep1[60] = _mm_unpacklo_epi16(step1[30], kZero); - lstep1[61] = _mm_unpackhi_epi16(step1[30], kZero); - lstep1[62] = _mm_unpacklo_epi16(step1[31], kZero); - lstep1[63] = _mm_unpackhi_epi16(step1[31], kZero); - lstep1[32] = _mm_madd_epi16(lstep1[32], kOne); - lstep1[33] = _mm_madd_epi16(lstep1[33], kOne); - lstep1[34] = _mm_madd_epi16(lstep1[34], kOne); - lstep1[35] = _mm_madd_epi16(lstep1[35], kOne); - lstep1[36] = _mm_madd_epi16(lstep1[36], kOne); - lstep1[37] = _mm_madd_epi16(lstep1[37], kOne); - lstep1[38] = _mm_madd_epi16(lstep1[38], kOne); - lstep1[39] = _mm_madd_epi16(lstep1[39], kOne); - lstep1[56] = _mm_madd_epi16(lstep1[56], kOne); - lstep1[57] = _mm_madd_epi16(lstep1[57], kOne); - lstep1[58] = _mm_madd_epi16(lstep1[58], kOne); - lstep1[59] = _mm_madd_epi16(lstep1[59], kOne); - lstep1[60] = _mm_madd_epi16(lstep1[60], kOne); - lstep1[61] = _mm_madd_epi16(lstep1[61], kOne); - lstep1[62] = _mm_madd_epi16(lstep1[62], kOne); - lstep1[63] = _mm_madd_epi16(lstep1[63], kOne); - - lstep3[32] = _mm_add_epi32(lstep2[46], lstep1[32]); - lstep3[33] = _mm_add_epi32(lstep2[47], lstep1[33]); - - lstep3[34] = _mm_add_epi32(lstep2[44], lstep1[34]); - lstep3[35] = _mm_add_epi32(lstep2[45], lstep1[35]); - lstep3[36] = _mm_add_epi32(lstep2[42], lstep1[36]); - lstep3[37] = _mm_add_epi32(lstep2[43], lstep1[37]); - lstep3[38] = _mm_add_epi32(lstep2[40], lstep1[38]); - lstep3[39] = _mm_add_epi32(lstep2[41], lstep1[39]); - lstep3[40] = _mm_sub_epi32(lstep1[38], lstep2[40]); - lstep3[41] = _mm_sub_epi32(lstep1[39], lstep2[41]); - lstep3[42] = _mm_sub_epi32(lstep1[36], lstep2[42]); - lstep3[43] = _mm_sub_epi32(lstep1[37], lstep2[43]); - lstep3[44] = _mm_sub_epi32(lstep1[34], lstep2[44]); - lstep3[45] = _mm_sub_epi32(lstep1[35], lstep2[45]); - lstep3[46] = _mm_sub_epi32(lstep1[32], lstep2[46]); - lstep3[47] = _mm_sub_epi32(lstep1[33], lstep2[47]); - lstep3[48] = _mm_sub_epi32(lstep1[62], lstep2[48]); - lstep3[49] = _mm_sub_epi32(lstep1[63], lstep2[49]); - lstep3[50] = _mm_sub_epi32(lstep1[60], lstep2[50]); - lstep3[51] = _mm_sub_epi32(lstep1[61], lstep2[51]); - lstep3[52] = _mm_sub_epi32(lstep1[58], lstep2[52]); - lstep3[53] = _mm_sub_epi32(lstep1[59], lstep2[53]); - lstep3[54] = _mm_sub_epi32(lstep1[56], lstep2[54]); - lstep3[55] = _mm_sub_epi32(lstep1[57], lstep2[55]); - lstep3[56] = _mm_add_epi32(lstep2[54], lstep1[56]); - lstep3[57] = _mm_add_epi32(lstep2[55], lstep1[57]); - lstep3[58] = _mm_add_epi32(lstep2[52], lstep1[58]); - lstep3[59] = _mm_add_epi32(lstep2[53], lstep1[59]); - lstep3[60] = _mm_add_epi32(lstep2[50], lstep1[60]); - lstep3[61] = _mm_add_epi32(lstep2[51], lstep1[61]); - lstep3[62] = _mm_add_epi32(lstep2[48], lstep1[62]); - lstep3[63] = _mm_add_epi32(lstep2[49], lstep1[63]); - } - - // stage 4 - { - // expanding to 32-bit length priori to addition operations - lstep2[16] = _mm_unpacklo_epi16(step2[ 8], kZero); - lstep2[17] = _mm_unpackhi_epi16(step2[ 8], kZero); - lstep2[18] = _mm_unpacklo_epi16(step2[ 9], kZero); - lstep2[19] = _mm_unpackhi_epi16(step2[ 9], kZero); - lstep2[28] = _mm_unpacklo_epi16(step2[14], kZero); - lstep2[29] = _mm_unpackhi_epi16(step2[14], kZero); - lstep2[30] = _mm_unpacklo_epi16(step2[15], kZero); - lstep2[31] = _mm_unpackhi_epi16(step2[15], kZero); - lstep2[16] = _mm_madd_epi16(lstep2[16], kOne); - lstep2[17] = _mm_madd_epi16(lstep2[17], kOne); - lstep2[18] = _mm_madd_epi16(lstep2[18], kOne); - lstep2[19] = _mm_madd_epi16(lstep2[19], kOne); - lstep2[28] = _mm_madd_epi16(lstep2[28], kOne); - lstep2[29] = _mm_madd_epi16(lstep2[29], kOne); - lstep2[30] = _mm_madd_epi16(lstep2[30], kOne); - lstep2[31] = _mm_madd_epi16(lstep2[31], kOne); - - lstep1[ 0] = _mm_add_epi32(lstep3[ 6], lstep3[ 0]); - lstep1[ 1] = _mm_add_epi32(lstep3[ 7], lstep3[ 1]); - lstep1[ 2] = _mm_add_epi32(lstep3[ 4], lstep3[ 2]); - lstep1[ 3] = _mm_add_epi32(lstep3[ 5], lstep3[ 3]); - lstep1[ 4] = _mm_sub_epi32(lstep3[ 2], lstep3[ 4]); - lstep1[ 5] = _mm_sub_epi32(lstep3[ 3], lstep3[ 5]); - lstep1[ 6] = _mm_sub_epi32(lstep3[ 0], lstep3[ 6]); - lstep1[ 7] = _mm_sub_epi32(lstep3[ 1], lstep3[ 7]); - lstep1[16] = _mm_add_epi32(lstep3[22], lstep2[16]); - lstep1[17] = _mm_add_epi32(lstep3[23], lstep2[17]); - lstep1[18] = _mm_add_epi32(lstep3[20], lstep2[18]); - lstep1[19] = _mm_add_epi32(lstep3[21], lstep2[19]); - lstep1[20] = _mm_sub_epi32(lstep2[18], lstep3[20]); - lstep1[21] = _mm_sub_epi32(lstep2[19], lstep3[21]); - lstep1[22] = _mm_sub_epi32(lstep2[16], lstep3[22]); - lstep1[23] = _mm_sub_epi32(lstep2[17], lstep3[23]); - lstep1[24] = _mm_sub_epi32(lstep2[30], lstep3[24]); - lstep1[25] = _mm_sub_epi32(lstep2[31], lstep3[25]); - lstep1[26] = _mm_sub_epi32(lstep2[28], lstep3[26]); - lstep1[27] = _mm_sub_epi32(lstep2[29], lstep3[27]); - lstep1[28] = _mm_add_epi32(lstep3[26], lstep2[28]); - lstep1[29] = _mm_add_epi32(lstep3[27], lstep2[29]); - lstep1[30] = _mm_add_epi32(lstep3[24], lstep2[30]); - lstep1[31] = _mm_add_epi32(lstep3[25], lstep2[31]); - } - { - // to be continued... - // - const __m128i k32_p16_p16 = pair_set_epi32(cospi_16_64, cospi_16_64); - const __m128i k32_p16_m16 = pair_set_epi32(cospi_16_64, -cospi_16_64); - - u[0] = _mm_unpacklo_epi32(lstep3[12], lstep3[10]); - u[1] = _mm_unpackhi_epi32(lstep3[12], lstep3[10]); - u[2] = _mm_unpacklo_epi32(lstep3[13], lstep3[11]); - u[3] = _mm_unpackhi_epi32(lstep3[13], lstep3[11]); - - // TODO(jingning): manually inline k_madd_epi32_ to further hide - // instruction latency. - v[0] = k_madd_epi32(u[0], k32_p16_m16); - v[1] = k_madd_epi32(u[1], k32_p16_m16); - v[2] = k_madd_epi32(u[2], k32_p16_m16); - v[3] = k_madd_epi32(u[3], k32_p16_m16); - v[4] = k_madd_epi32(u[0], k32_p16_p16); - v[5] = k_madd_epi32(u[1], k32_p16_p16); - v[6] = k_madd_epi32(u[2], k32_p16_p16); - v[7] = k_madd_epi32(u[3], k32_p16_p16); -#if DCT_HIGH_BIT_DEPTH - overflow = k_check_epi32_overflow_8(&v[0], &v[1], &v[2], &v[3], - &v[4], &v[5], &v[6], &v[7], &kZero); - if (overflow) { - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - u[0] = k_packs_epi64(v[0], v[1]); - u[1] = k_packs_epi64(v[2], v[3]); - u[2] = k_packs_epi64(v[4], v[5]); - u[3] = k_packs_epi64(v[6], v[7]); - - v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING); - v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING); - v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING); - v[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING); - - lstep1[10] = _mm_srai_epi32(v[0], DCT_CONST_BITS); - lstep1[11] = _mm_srai_epi32(v[1], DCT_CONST_BITS); - lstep1[12] = _mm_srai_epi32(v[2], DCT_CONST_BITS); - lstep1[13] = _mm_srai_epi32(v[3], DCT_CONST_BITS); - } - { - const __m128i k32_m08_p24 = pair_set_epi32(-cospi_8_64, cospi_24_64); - const __m128i k32_m24_m08 = pair_set_epi32(-cospi_24_64, -cospi_8_64); - const __m128i k32_p24_p08 = pair_set_epi32(cospi_24_64, cospi_8_64); - - u[ 0] = _mm_unpacklo_epi32(lstep3[36], lstep3[58]); - u[ 1] = _mm_unpackhi_epi32(lstep3[36], lstep3[58]); - u[ 2] = _mm_unpacklo_epi32(lstep3[37], lstep3[59]); - u[ 3] = _mm_unpackhi_epi32(lstep3[37], lstep3[59]); - u[ 4] = _mm_unpacklo_epi32(lstep3[38], lstep3[56]); - u[ 5] = _mm_unpackhi_epi32(lstep3[38], lstep3[56]); - u[ 6] = _mm_unpacklo_epi32(lstep3[39], lstep3[57]); - u[ 7] = _mm_unpackhi_epi32(lstep3[39], lstep3[57]); - u[ 8] = _mm_unpacklo_epi32(lstep3[40], lstep3[54]); - u[ 9] = _mm_unpackhi_epi32(lstep3[40], lstep3[54]); - u[10] = _mm_unpacklo_epi32(lstep3[41], lstep3[55]); - u[11] = _mm_unpackhi_epi32(lstep3[41], lstep3[55]); - u[12] = _mm_unpacklo_epi32(lstep3[42], lstep3[52]); - u[13] = _mm_unpackhi_epi32(lstep3[42], lstep3[52]); - u[14] = _mm_unpacklo_epi32(lstep3[43], lstep3[53]); - u[15] = _mm_unpackhi_epi32(lstep3[43], lstep3[53]); - - v[ 0] = k_madd_epi32(u[ 0], k32_m08_p24); - v[ 1] = k_madd_epi32(u[ 1], k32_m08_p24); - v[ 2] = k_madd_epi32(u[ 2], k32_m08_p24); - v[ 3] = k_madd_epi32(u[ 3], k32_m08_p24); - v[ 4] = k_madd_epi32(u[ 4], k32_m08_p24); - v[ 5] = k_madd_epi32(u[ 5], k32_m08_p24); - v[ 6] = k_madd_epi32(u[ 6], k32_m08_p24); - v[ 7] = k_madd_epi32(u[ 7], k32_m08_p24); - v[ 8] = k_madd_epi32(u[ 8], k32_m24_m08); - v[ 9] = k_madd_epi32(u[ 9], k32_m24_m08); - v[10] = k_madd_epi32(u[10], k32_m24_m08); - v[11] = k_madd_epi32(u[11], k32_m24_m08); - v[12] = k_madd_epi32(u[12], k32_m24_m08); - v[13] = k_madd_epi32(u[13], k32_m24_m08); - v[14] = k_madd_epi32(u[14], k32_m24_m08); - v[15] = k_madd_epi32(u[15], k32_m24_m08); - v[16] = k_madd_epi32(u[12], k32_m08_p24); - v[17] = k_madd_epi32(u[13], k32_m08_p24); - v[18] = k_madd_epi32(u[14], k32_m08_p24); - v[19] = k_madd_epi32(u[15], k32_m08_p24); - v[20] = k_madd_epi32(u[ 8], k32_m08_p24); - v[21] = k_madd_epi32(u[ 9], k32_m08_p24); - v[22] = k_madd_epi32(u[10], k32_m08_p24); - v[23] = k_madd_epi32(u[11], k32_m08_p24); - v[24] = k_madd_epi32(u[ 4], k32_p24_p08); - v[25] = k_madd_epi32(u[ 5], k32_p24_p08); - v[26] = k_madd_epi32(u[ 6], k32_p24_p08); - v[27] = k_madd_epi32(u[ 7], k32_p24_p08); - v[28] = k_madd_epi32(u[ 0], k32_p24_p08); - v[29] = k_madd_epi32(u[ 1], k32_p24_p08); - v[30] = k_madd_epi32(u[ 2], k32_p24_p08); - v[31] = k_madd_epi32(u[ 3], k32_p24_p08); - -#if DCT_HIGH_BIT_DEPTH - overflow = k_check_epi32_overflow_32( - &v[0], &v[1], &v[2], &v[3], &v[4], &v[5], &v[6], &v[7], - &v[8], &v[9], &v[10], &v[11], &v[12], &v[13], &v[14], &v[15], - &v[16], &v[17], &v[18], &v[19], &v[20], &v[21], &v[22], &v[23], - &v[24], &v[25], &v[26], &v[27], &v[28], &v[29], &v[30], &v[31], - &kZero); - if (overflow) { - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - u[ 0] = k_packs_epi64(v[ 0], v[ 1]); - u[ 1] = k_packs_epi64(v[ 2], v[ 3]); - u[ 2] = k_packs_epi64(v[ 4], v[ 5]); - u[ 3] = k_packs_epi64(v[ 6], v[ 7]); - u[ 4] = k_packs_epi64(v[ 8], v[ 9]); - u[ 5] = k_packs_epi64(v[10], v[11]); - u[ 6] = k_packs_epi64(v[12], v[13]); - u[ 7] = k_packs_epi64(v[14], v[15]); - u[ 8] = k_packs_epi64(v[16], v[17]); - u[ 9] = k_packs_epi64(v[18], v[19]); - u[10] = k_packs_epi64(v[20], v[21]); - u[11] = k_packs_epi64(v[22], v[23]); - u[12] = k_packs_epi64(v[24], v[25]); - u[13] = k_packs_epi64(v[26], v[27]); - u[14] = k_packs_epi64(v[28], v[29]); - u[15] = k_packs_epi64(v[30], v[31]); - - v[ 0] = _mm_add_epi32(u[ 0], k__DCT_CONST_ROUNDING); - v[ 1] = _mm_add_epi32(u[ 1], k__DCT_CONST_ROUNDING); - v[ 2] = _mm_add_epi32(u[ 2], k__DCT_CONST_ROUNDING); - v[ 3] = _mm_add_epi32(u[ 3], k__DCT_CONST_ROUNDING); - v[ 4] = _mm_add_epi32(u[ 4], k__DCT_CONST_ROUNDING); - v[ 5] = _mm_add_epi32(u[ 5], k__DCT_CONST_ROUNDING); - v[ 6] = _mm_add_epi32(u[ 6], k__DCT_CONST_ROUNDING); - v[ 7] = _mm_add_epi32(u[ 7], k__DCT_CONST_ROUNDING); - v[ 8] = _mm_add_epi32(u[ 8], k__DCT_CONST_ROUNDING); - v[ 9] = _mm_add_epi32(u[ 9], k__DCT_CONST_ROUNDING); - v[10] = _mm_add_epi32(u[10], k__DCT_CONST_ROUNDING); - v[11] = _mm_add_epi32(u[11], k__DCT_CONST_ROUNDING); - v[12] = _mm_add_epi32(u[12], k__DCT_CONST_ROUNDING); - v[13] = _mm_add_epi32(u[13], k__DCT_CONST_ROUNDING); - v[14] = _mm_add_epi32(u[14], k__DCT_CONST_ROUNDING); - v[15] = _mm_add_epi32(u[15], k__DCT_CONST_ROUNDING); - - lstep1[36] = _mm_srai_epi32(v[ 0], DCT_CONST_BITS); - lstep1[37] = _mm_srai_epi32(v[ 1], DCT_CONST_BITS); - lstep1[38] = _mm_srai_epi32(v[ 2], DCT_CONST_BITS); - lstep1[39] = _mm_srai_epi32(v[ 3], DCT_CONST_BITS); - lstep1[40] = _mm_srai_epi32(v[ 4], DCT_CONST_BITS); - lstep1[41] = _mm_srai_epi32(v[ 5], DCT_CONST_BITS); - lstep1[42] = _mm_srai_epi32(v[ 6], DCT_CONST_BITS); - lstep1[43] = _mm_srai_epi32(v[ 7], DCT_CONST_BITS); - lstep1[52] = _mm_srai_epi32(v[ 8], DCT_CONST_BITS); - lstep1[53] = _mm_srai_epi32(v[ 9], DCT_CONST_BITS); - lstep1[54] = _mm_srai_epi32(v[10], DCT_CONST_BITS); - lstep1[55] = _mm_srai_epi32(v[11], DCT_CONST_BITS); - lstep1[56] = _mm_srai_epi32(v[12], DCT_CONST_BITS); - lstep1[57] = _mm_srai_epi32(v[13], DCT_CONST_BITS); - lstep1[58] = _mm_srai_epi32(v[14], DCT_CONST_BITS); - lstep1[59] = _mm_srai_epi32(v[15], DCT_CONST_BITS); - } - // stage 5 - { - lstep2[ 8] = _mm_add_epi32(lstep1[10], lstep3[ 8]); - lstep2[ 9] = _mm_add_epi32(lstep1[11], lstep3[ 9]); - lstep2[10] = _mm_sub_epi32(lstep3[ 8], lstep1[10]); - lstep2[11] = _mm_sub_epi32(lstep3[ 9], lstep1[11]); - lstep2[12] = _mm_sub_epi32(lstep3[14], lstep1[12]); - lstep2[13] = _mm_sub_epi32(lstep3[15], lstep1[13]); - lstep2[14] = _mm_add_epi32(lstep1[12], lstep3[14]); - lstep2[15] = _mm_add_epi32(lstep1[13], lstep3[15]); - } - { - const __m128i k32_p16_p16 = pair_set_epi32(cospi_16_64, cospi_16_64); - const __m128i k32_p16_m16 = pair_set_epi32(cospi_16_64, -cospi_16_64); - const __m128i k32_p24_p08 = pair_set_epi32(cospi_24_64, cospi_8_64); - const __m128i k32_m08_p24 = pair_set_epi32(-cospi_8_64, cospi_24_64); - - u[0] = _mm_unpacklo_epi32(lstep1[0], lstep1[2]); - u[1] = _mm_unpackhi_epi32(lstep1[0], lstep1[2]); - u[2] = _mm_unpacklo_epi32(lstep1[1], lstep1[3]); - u[3] = _mm_unpackhi_epi32(lstep1[1], lstep1[3]); - u[4] = _mm_unpacklo_epi32(lstep1[4], lstep1[6]); - u[5] = _mm_unpackhi_epi32(lstep1[4], lstep1[6]); - u[6] = _mm_unpacklo_epi32(lstep1[5], lstep1[7]); - u[7] = _mm_unpackhi_epi32(lstep1[5], lstep1[7]); - - // TODO(jingning): manually inline k_madd_epi32_ to further hide - // instruction latency. - v[ 0] = k_madd_epi32(u[0], k32_p16_p16); - v[ 1] = k_madd_epi32(u[1], k32_p16_p16); - v[ 2] = k_madd_epi32(u[2], k32_p16_p16); - v[ 3] = k_madd_epi32(u[3], k32_p16_p16); - v[ 4] = k_madd_epi32(u[0], k32_p16_m16); - v[ 5] = k_madd_epi32(u[1], k32_p16_m16); - v[ 6] = k_madd_epi32(u[2], k32_p16_m16); - v[ 7] = k_madd_epi32(u[3], k32_p16_m16); - v[ 8] = k_madd_epi32(u[4], k32_p24_p08); - v[ 9] = k_madd_epi32(u[5], k32_p24_p08); - v[10] = k_madd_epi32(u[6], k32_p24_p08); - v[11] = k_madd_epi32(u[7], k32_p24_p08); - v[12] = k_madd_epi32(u[4], k32_m08_p24); - v[13] = k_madd_epi32(u[5], k32_m08_p24); - v[14] = k_madd_epi32(u[6], k32_m08_p24); - v[15] = k_madd_epi32(u[7], k32_m08_p24); - -#if DCT_HIGH_BIT_DEPTH - overflow = k_check_epi32_overflow_16( - &v[0], &v[1], &v[2], &v[3], &v[4], &v[5], &v[6], &v[7], - &v[8], &v[9], &v[10], &v[11], &v[12], &v[13], &v[14], &v[15], - &kZero); - if (overflow) { - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - u[0] = k_packs_epi64(v[0], v[1]); - u[1] = k_packs_epi64(v[2], v[3]); - u[2] = k_packs_epi64(v[4], v[5]); - u[3] = k_packs_epi64(v[6], v[7]); - u[4] = k_packs_epi64(v[8], v[9]); - u[5] = k_packs_epi64(v[10], v[11]); - u[6] = k_packs_epi64(v[12], v[13]); - u[7] = k_packs_epi64(v[14], v[15]); - - v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING); - v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING); - v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING); - v[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING); - v[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING); - v[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING); - v[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING); - v[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING); - - u[0] = _mm_srai_epi32(v[0], DCT_CONST_BITS); - u[1] = _mm_srai_epi32(v[1], DCT_CONST_BITS); - u[2] = _mm_srai_epi32(v[2], DCT_CONST_BITS); - u[3] = _mm_srai_epi32(v[3], DCT_CONST_BITS); - u[4] = _mm_srai_epi32(v[4], DCT_CONST_BITS); - u[5] = _mm_srai_epi32(v[5], DCT_CONST_BITS); - u[6] = _mm_srai_epi32(v[6], DCT_CONST_BITS); - u[7] = _mm_srai_epi32(v[7], DCT_CONST_BITS); - - sign[0] = _mm_cmplt_epi32(u[0], kZero); - sign[1] = _mm_cmplt_epi32(u[1], kZero); - sign[2] = _mm_cmplt_epi32(u[2], kZero); - sign[3] = _mm_cmplt_epi32(u[3], kZero); - sign[4] = _mm_cmplt_epi32(u[4], kZero); - sign[5] = _mm_cmplt_epi32(u[5], kZero); - sign[6] = _mm_cmplt_epi32(u[6], kZero); - sign[7] = _mm_cmplt_epi32(u[7], kZero); - - u[0] = _mm_sub_epi32(u[0], sign[0]); - u[1] = _mm_sub_epi32(u[1], sign[1]); - u[2] = _mm_sub_epi32(u[2], sign[2]); - u[3] = _mm_sub_epi32(u[3], sign[3]); - u[4] = _mm_sub_epi32(u[4], sign[4]); - u[5] = _mm_sub_epi32(u[5], sign[5]); - u[6] = _mm_sub_epi32(u[6], sign[6]); - u[7] = _mm_sub_epi32(u[7], sign[7]); - - u[0] = _mm_add_epi32(u[0], K32One); - u[1] = _mm_add_epi32(u[1], K32One); - u[2] = _mm_add_epi32(u[2], K32One); - u[3] = _mm_add_epi32(u[3], K32One); - u[4] = _mm_add_epi32(u[4], K32One); - u[5] = _mm_add_epi32(u[5], K32One); - u[6] = _mm_add_epi32(u[6], K32One); - u[7] = _mm_add_epi32(u[7], K32One); - - u[0] = _mm_srai_epi32(u[0], 2); - u[1] = _mm_srai_epi32(u[1], 2); - u[2] = _mm_srai_epi32(u[2], 2); - u[3] = _mm_srai_epi32(u[3], 2); - u[4] = _mm_srai_epi32(u[4], 2); - u[5] = _mm_srai_epi32(u[5], 2); - u[6] = _mm_srai_epi32(u[6], 2); - u[7] = _mm_srai_epi32(u[7], 2); - - // Combine - out[ 0] = _mm_packs_epi32(u[0], u[1]); - out[16] = _mm_packs_epi32(u[2], u[3]); - out[ 8] = _mm_packs_epi32(u[4], u[5]); - out[24] = _mm_packs_epi32(u[6], u[7]); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x4(&out[0], &out[16], - &out[8], &out[24]); - if (overflow) { - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - { - const __m128i k32_m08_p24 = pair_set_epi32(-cospi_8_64, cospi_24_64); - const __m128i k32_m24_m08 = pair_set_epi32(-cospi_24_64, -cospi_8_64); - const __m128i k32_p24_p08 = pair_set_epi32(cospi_24_64, cospi_8_64); - - u[0] = _mm_unpacklo_epi32(lstep1[18], lstep1[28]); - u[1] = _mm_unpackhi_epi32(lstep1[18], lstep1[28]); - u[2] = _mm_unpacklo_epi32(lstep1[19], lstep1[29]); - u[3] = _mm_unpackhi_epi32(lstep1[19], lstep1[29]); - u[4] = _mm_unpacklo_epi32(lstep1[20], lstep1[26]); - u[5] = _mm_unpackhi_epi32(lstep1[20], lstep1[26]); - u[6] = _mm_unpacklo_epi32(lstep1[21], lstep1[27]); - u[7] = _mm_unpackhi_epi32(lstep1[21], lstep1[27]); - - v[0] = k_madd_epi32(u[0], k32_m08_p24); - v[1] = k_madd_epi32(u[1], k32_m08_p24); - v[2] = k_madd_epi32(u[2], k32_m08_p24); - v[3] = k_madd_epi32(u[3], k32_m08_p24); - v[4] = k_madd_epi32(u[4], k32_m24_m08); - v[5] = k_madd_epi32(u[5], k32_m24_m08); - v[6] = k_madd_epi32(u[6], k32_m24_m08); - v[7] = k_madd_epi32(u[7], k32_m24_m08); - v[ 8] = k_madd_epi32(u[4], k32_m08_p24); - v[ 9] = k_madd_epi32(u[5], k32_m08_p24); - v[10] = k_madd_epi32(u[6], k32_m08_p24); - v[11] = k_madd_epi32(u[7], k32_m08_p24); - v[12] = k_madd_epi32(u[0], k32_p24_p08); - v[13] = k_madd_epi32(u[1], k32_p24_p08); - v[14] = k_madd_epi32(u[2], k32_p24_p08); - v[15] = k_madd_epi32(u[3], k32_p24_p08); - -#if DCT_HIGH_BIT_DEPTH - overflow = k_check_epi32_overflow_16( - &v[0], &v[1], &v[2], &v[3], &v[4], &v[5], &v[6], &v[7], - &v[8], &v[9], &v[10], &v[11], &v[12], &v[13], &v[14], &v[15], - &kZero); - if (overflow) { - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - u[0] = k_packs_epi64(v[0], v[1]); - u[1] = k_packs_epi64(v[2], v[3]); - u[2] = k_packs_epi64(v[4], v[5]); - u[3] = k_packs_epi64(v[6], v[7]); - u[4] = k_packs_epi64(v[8], v[9]); - u[5] = k_packs_epi64(v[10], v[11]); - u[6] = k_packs_epi64(v[12], v[13]); - u[7] = k_packs_epi64(v[14], v[15]); - - u[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING); - u[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING); - u[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING); - u[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING); - u[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING); - u[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING); - u[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING); - u[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING); - - lstep2[18] = _mm_srai_epi32(u[0], DCT_CONST_BITS); - lstep2[19] = _mm_srai_epi32(u[1], DCT_CONST_BITS); - lstep2[20] = _mm_srai_epi32(u[2], DCT_CONST_BITS); - lstep2[21] = _mm_srai_epi32(u[3], DCT_CONST_BITS); - lstep2[26] = _mm_srai_epi32(u[4], DCT_CONST_BITS); - lstep2[27] = _mm_srai_epi32(u[5], DCT_CONST_BITS); - lstep2[28] = _mm_srai_epi32(u[6], DCT_CONST_BITS); - lstep2[29] = _mm_srai_epi32(u[7], DCT_CONST_BITS); - } - { - lstep2[32] = _mm_add_epi32(lstep1[38], lstep3[32]); - lstep2[33] = _mm_add_epi32(lstep1[39], lstep3[33]); - lstep2[34] = _mm_add_epi32(lstep1[36], lstep3[34]); - lstep2[35] = _mm_add_epi32(lstep1[37], lstep3[35]); - lstep2[36] = _mm_sub_epi32(lstep3[34], lstep1[36]); - lstep2[37] = _mm_sub_epi32(lstep3[35], lstep1[37]); - lstep2[38] = _mm_sub_epi32(lstep3[32], lstep1[38]); - lstep2[39] = _mm_sub_epi32(lstep3[33], lstep1[39]); - lstep2[40] = _mm_sub_epi32(lstep3[46], lstep1[40]); - lstep2[41] = _mm_sub_epi32(lstep3[47], lstep1[41]); - lstep2[42] = _mm_sub_epi32(lstep3[44], lstep1[42]); - lstep2[43] = _mm_sub_epi32(lstep3[45], lstep1[43]); - lstep2[44] = _mm_add_epi32(lstep1[42], lstep3[44]); - lstep2[45] = _mm_add_epi32(lstep1[43], lstep3[45]); - lstep2[46] = _mm_add_epi32(lstep1[40], lstep3[46]); - lstep2[47] = _mm_add_epi32(lstep1[41], lstep3[47]); - lstep2[48] = _mm_add_epi32(lstep1[54], lstep3[48]); - lstep2[49] = _mm_add_epi32(lstep1[55], lstep3[49]); - lstep2[50] = _mm_add_epi32(lstep1[52], lstep3[50]); - lstep2[51] = _mm_add_epi32(lstep1[53], lstep3[51]); - lstep2[52] = _mm_sub_epi32(lstep3[50], lstep1[52]); - lstep2[53] = _mm_sub_epi32(lstep3[51], lstep1[53]); - lstep2[54] = _mm_sub_epi32(lstep3[48], lstep1[54]); - lstep2[55] = _mm_sub_epi32(lstep3[49], lstep1[55]); - lstep2[56] = _mm_sub_epi32(lstep3[62], lstep1[56]); - lstep2[57] = _mm_sub_epi32(lstep3[63], lstep1[57]); - lstep2[58] = _mm_sub_epi32(lstep3[60], lstep1[58]); - lstep2[59] = _mm_sub_epi32(lstep3[61], lstep1[59]); - lstep2[60] = _mm_add_epi32(lstep1[58], lstep3[60]); - lstep2[61] = _mm_add_epi32(lstep1[59], lstep3[61]); - lstep2[62] = _mm_add_epi32(lstep1[56], lstep3[62]); - lstep2[63] = _mm_add_epi32(lstep1[57], lstep3[63]); - } - // stage 6 - { - const __m128i k32_p28_p04 = pair_set_epi32(cospi_28_64, cospi_4_64); - const __m128i k32_p12_p20 = pair_set_epi32(cospi_12_64, cospi_20_64); - const __m128i k32_m20_p12 = pair_set_epi32(-cospi_20_64, cospi_12_64); - const __m128i k32_m04_p28 = pair_set_epi32(-cospi_4_64, cospi_28_64); - - u[0] = _mm_unpacklo_epi32(lstep2[ 8], lstep2[14]); - u[1] = _mm_unpackhi_epi32(lstep2[ 8], lstep2[14]); - u[2] = _mm_unpacklo_epi32(lstep2[ 9], lstep2[15]); - u[3] = _mm_unpackhi_epi32(lstep2[ 9], lstep2[15]); - u[4] = _mm_unpacklo_epi32(lstep2[10], lstep2[12]); - u[5] = _mm_unpackhi_epi32(lstep2[10], lstep2[12]); - u[6] = _mm_unpacklo_epi32(lstep2[11], lstep2[13]); - u[7] = _mm_unpackhi_epi32(lstep2[11], lstep2[13]); - u[8] = _mm_unpacklo_epi32(lstep2[10], lstep2[12]); - u[9] = _mm_unpackhi_epi32(lstep2[10], lstep2[12]); - u[10] = _mm_unpacklo_epi32(lstep2[11], lstep2[13]); - u[11] = _mm_unpackhi_epi32(lstep2[11], lstep2[13]); - u[12] = _mm_unpacklo_epi32(lstep2[ 8], lstep2[14]); - u[13] = _mm_unpackhi_epi32(lstep2[ 8], lstep2[14]); - u[14] = _mm_unpacklo_epi32(lstep2[ 9], lstep2[15]); - u[15] = _mm_unpackhi_epi32(lstep2[ 9], lstep2[15]); - - v[0] = k_madd_epi32(u[0], k32_p28_p04); - v[1] = k_madd_epi32(u[1], k32_p28_p04); - v[2] = k_madd_epi32(u[2], k32_p28_p04); - v[3] = k_madd_epi32(u[3], k32_p28_p04); - v[4] = k_madd_epi32(u[4], k32_p12_p20); - v[5] = k_madd_epi32(u[5], k32_p12_p20); - v[6] = k_madd_epi32(u[6], k32_p12_p20); - v[7] = k_madd_epi32(u[7], k32_p12_p20); - v[ 8] = k_madd_epi32(u[ 8], k32_m20_p12); - v[ 9] = k_madd_epi32(u[ 9], k32_m20_p12); - v[10] = k_madd_epi32(u[10], k32_m20_p12); - v[11] = k_madd_epi32(u[11], k32_m20_p12); - v[12] = k_madd_epi32(u[12], k32_m04_p28); - v[13] = k_madd_epi32(u[13], k32_m04_p28); - v[14] = k_madd_epi32(u[14], k32_m04_p28); - v[15] = k_madd_epi32(u[15], k32_m04_p28); - -#if DCT_HIGH_BIT_DEPTH - overflow = k_check_epi32_overflow_16( - &v[0], &v[1], &v[2], &v[3], &v[4], &v[5], &v[6], &v[7], - &v[8], &v[9], &v[10], &v[11], &v[12], &v[13], &v[14], &v[15], - &kZero); - if (overflow) { - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - u[0] = k_packs_epi64(v[0], v[1]); - u[1] = k_packs_epi64(v[2], v[3]); - u[2] = k_packs_epi64(v[4], v[5]); - u[3] = k_packs_epi64(v[6], v[7]); - u[4] = k_packs_epi64(v[8], v[9]); - u[5] = k_packs_epi64(v[10], v[11]); - u[6] = k_packs_epi64(v[12], v[13]); - u[7] = k_packs_epi64(v[14], v[15]); - - v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING); - v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING); - v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING); - v[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING); - v[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING); - v[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING); - v[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING); - v[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING); - - u[0] = _mm_srai_epi32(v[0], DCT_CONST_BITS); - u[1] = _mm_srai_epi32(v[1], DCT_CONST_BITS); - u[2] = _mm_srai_epi32(v[2], DCT_CONST_BITS); - u[3] = _mm_srai_epi32(v[3], DCT_CONST_BITS); - u[4] = _mm_srai_epi32(v[4], DCT_CONST_BITS); - u[5] = _mm_srai_epi32(v[5], DCT_CONST_BITS); - u[6] = _mm_srai_epi32(v[6], DCT_CONST_BITS); - u[7] = _mm_srai_epi32(v[7], DCT_CONST_BITS); - - sign[0] = _mm_cmplt_epi32(u[0], kZero); - sign[1] = _mm_cmplt_epi32(u[1], kZero); - sign[2] = _mm_cmplt_epi32(u[2], kZero); - sign[3] = _mm_cmplt_epi32(u[3], kZero); - sign[4] = _mm_cmplt_epi32(u[4], kZero); - sign[5] = _mm_cmplt_epi32(u[5], kZero); - sign[6] = _mm_cmplt_epi32(u[6], kZero); - sign[7] = _mm_cmplt_epi32(u[7], kZero); - - u[0] = _mm_sub_epi32(u[0], sign[0]); - u[1] = _mm_sub_epi32(u[1], sign[1]); - u[2] = _mm_sub_epi32(u[2], sign[2]); - u[3] = _mm_sub_epi32(u[3], sign[3]); - u[4] = _mm_sub_epi32(u[4], sign[4]); - u[5] = _mm_sub_epi32(u[5], sign[5]); - u[6] = _mm_sub_epi32(u[6], sign[6]); - u[7] = _mm_sub_epi32(u[7], sign[7]); - - u[0] = _mm_add_epi32(u[0], K32One); - u[1] = _mm_add_epi32(u[1], K32One); - u[2] = _mm_add_epi32(u[2], K32One); - u[3] = _mm_add_epi32(u[3], K32One); - u[4] = _mm_add_epi32(u[4], K32One); - u[5] = _mm_add_epi32(u[5], K32One); - u[6] = _mm_add_epi32(u[6], K32One); - u[7] = _mm_add_epi32(u[7], K32One); - - u[0] = _mm_srai_epi32(u[0], 2); - u[1] = _mm_srai_epi32(u[1], 2); - u[2] = _mm_srai_epi32(u[2], 2); - u[3] = _mm_srai_epi32(u[3], 2); - u[4] = _mm_srai_epi32(u[4], 2); - u[5] = _mm_srai_epi32(u[5], 2); - u[6] = _mm_srai_epi32(u[6], 2); - u[7] = _mm_srai_epi32(u[7], 2); - - out[ 4] = _mm_packs_epi32(u[0], u[1]); - out[20] = _mm_packs_epi32(u[2], u[3]); - out[12] = _mm_packs_epi32(u[4], u[5]); - out[28] = _mm_packs_epi32(u[6], u[7]); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x4(&out[4], &out[20], - &out[12], &out[28]); - if (overflow) { - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - { - lstep3[16] = _mm_add_epi32(lstep2[18], lstep1[16]); - lstep3[17] = _mm_add_epi32(lstep2[19], lstep1[17]); - lstep3[18] = _mm_sub_epi32(lstep1[16], lstep2[18]); - lstep3[19] = _mm_sub_epi32(lstep1[17], lstep2[19]); - lstep3[20] = _mm_sub_epi32(lstep1[22], lstep2[20]); - lstep3[21] = _mm_sub_epi32(lstep1[23], lstep2[21]); - lstep3[22] = _mm_add_epi32(lstep2[20], lstep1[22]); - lstep3[23] = _mm_add_epi32(lstep2[21], lstep1[23]); - lstep3[24] = _mm_add_epi32(lstep2[26], lstep1[24]); - lstep3[25] = _mm_add_epi32(lstep2[27], lstep1[25]); - lstep3[26] = _mm_sub_epi32(lstep1[24], lstep2[26]); - lstep3[27] = _mm_sub_epi32(lstep1[25], lstep2[27]); - lstep3[28] = _mm_sub_epi32(lstep1[30], lstep2[28]); - lstep3[29] = _mm_sub_epi32(lstep1[31], lstep2[29]); - lstep3[30] = _mm_add_epi32(lstep2[28], lstep1[30]); - lstep3[31] = _mm_add_epi32(lstep2[29], lstep1[31]); - } - { - const __m128i k32_m04_p28 = pair_set_epi32(-cospi_4_64, cospi_28_64); - const __m128i k32_m28_m04 = pair_set_epi32(-cospi_28_64, -cospi_4_64); - const __m128i k32_m20_p12 = pair_set_epi32(-cospi_20_64, cospi_12_64); - const __m128i k32_m12_m20 = pair_set_epi32(-cospi_12_64, - -cospi_20_64); - const __m128i k32_p12_p20 = pair_set_epi32(cospi_12_64, cospi_20_64); - const __m128i k32_p28_p04 = pair_set_epi32(cospi_28_64, cospi_4_64); - - u[ 0] = _mm_unpacklo_epi32(lstep2[34], lstep2[60]); - u[ 1] = _mm_unpackhi_epi32(lstep2[34], lstep2[60]); - u[ 2] = _mm_unpacklo_epi32(lstep2[35], lstep2[61]); - u[ 3] = _mm_unpackhi_epi32(lstep2[35], lstep2[61]); - u[ 4] = _mm_unpacklo_epi32(lstep2[36], lstep2[58]); - u[ 5] = _mm_unpackhi_epi32(lstep2[36], lstep2[58]); - u[ 6] = _mm_unpacklo_epi32(lstep2[37], lstep2[59]); - u[ 7] = _mm_unpackhi_epi32(lstep2[37], lstep2[59]); - u[ 8] = _mm_unpacklo_epi32(lstep2[42], lstep2[52]); - u[ 9] = _mm_unpackhi_epi32(lstep2[42], lstep2[52]); - u[10] = _mm_unpacklo_epi32(lstep2[43], lstep2[53]); - u[11] = _mm_unpackhi_epi32(lstep2[43], lstep2[53]); - u[12] = _mm_unpacklo_epi32(lstep2[44], lstep2[50]); - u[13] = _mm_unpackhi_epi32(lstep2[44], lstep2[50]); - u[14] = _mm_unpacklo_epi32(lstep2[45], lstep2[51]); - u[15] = _mm_unpackhi_epi32(lstep2[45], lstep2[51]); - - v[ 0] = k_madd_epi32(u[ 0], k32_m04_p28); - v[ 1] = k_madd_epi32(u[ 1], k32_m04_p28); - v[ 2] = k_madd_epi32(u[ 2], k32_m04_p28); - v[ 3] = k_madd_epi32(u[ 3], k32_m04_p28); - v[ 4] = k_madd_epi32(u[ 4], k32_m28_m04); - v[ 5] = k_madd_epi32(u[ 5], k32_m28_m04); - v[ 6] = k_madd_epi32(u[ 6], k32_m28_m04); - v[ 7] = k_madd_epi32(u[ 7], k32_m28_m04); - v[ 8] = k_madd_epi32(u[ 8], k32_m20_p12); - v[ 9] = k_madd_epi32(u[ 9], k32_m20_p12); - v[10] = k_madd_epi32(u[10], k32_m20_p12); - v[11] = k_madd_epi32(u[11], k32_m20_p12); - v[12] = k_madd_epi32(u[12], k32_m12_m20); - v[13] = k_madd_epi32(u[13], k32_m12_m20); - v[14] = k_madd_epi32(u[14], k32_m12_m20); - v[15] = k_madd_epi32(u[15], k32_m12_m20); - v[16] = k_madd_epi32(u[12], k32_m20_p12); - v[17] = k_madd_epi32(u[13], k32_m20_p12); - v[18] = k_madd_epi32(u[14], k32_m20_p12); - v[19] = k_madd_epi32(u[15], k32_m20_p12); - v[20] = k_madd_epi32(u[ 8], k32_p12_p20); - v[21] = k_madd_epi32(u[ 9], k32_p12_p20); - v[22] = k_madd_epi32(u[10], k32_p12_p20); - v[23] = k_madd_epi32(u[11], k32_p12_p20); - v[24] = k_madd_epi32(u[ 4], k32_m04_p28); - v[25] = k_madd_epi32(u[ 5], k32_m04_p28); - v[26] = k_madd_epi32(u[ 6], k32_m04_p28); - v[27] = k_madd_epi32(u[ 7], k32_m04_p28); - v[28] = k_madd_epi32(u[ 0], k32_p28_p04); - v[29] = k_madd_epi32(u[ 1], k32_p28_p04); - v[30] = k_madd_epi32(u[ 2], k32_p28_p04); - v[31] = k_madd_epi32(u[ 3], k32_p28_p04); - -#if DCT_HIGH_BIT_DEPTH - overflow = k_check_epi32_overflow_32( - &v[0], &v[1], &v[2], &v[3], &v[4], &v[5], &v[6], &v[7], - &v[8], &v[9], &v[10], &v[11], &v[12], &v[13], &v[14], &v[15], - &v[16], &v[17], &v[18], &v[19], &v[20], &v[21], &v[22], &v[23], - &v[24], &v[25], &v[26], &v[27], &v[28], &v[29], &v[30], &v[31], - &kZero); - if (overflow) { - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - u[ 0] = k_packs_epi64(v[ 0], v[ 1]); - u[ 1] = k_packs_epi64(v[ 2], v[ 3]); - u[ 2] = k_packs_epi64(v[ 4], v[ 5]); - u[ 3] = k_packs_epi64(v[ 6], v[ 7]); - u[ 4] = k_packs_epi64(v[ 8], v[ 9]); - u[ 5] = k_packs_epi64(v[10], v[11]); - u[ 6] = k_packs_epi64(v[12], v[13]); - u[ 7] = k_packs_epi64(v[14], v[15]); - u[ 8] = k_packs_epi64(v[16], v[17]); - u[ 9] = k_packs_epi64(v[18], v[19]); - u[10] = k_packs_epi64(v[20], v[21]); - u[11] = k_packs_epi64(v[22], v[23]); - u[12] = k_packs_epi64(v[24], v[25]); - u[13] = k_packs_epi64(v[26], v[27]); - u[14] = k_packs_epi64(v[28], v[29]); - u[15] = k_packs_epi64(v[30], v[31]); - - v[ 0] = _mm_add_epi32(u[ 0], k__DCT_CONST_ROUNDING); - v[ 1] = _mm_add_epi32(u[ 1], k__DCT_CONST_ROUNDING); - v[ 2] = _mm_add_epi32(u[ 2], k__DCT_CONST_ROUNDING); - v[ 3] = _mm_add_epi32(u[ 3], k__DCT_CONST_ROUNDING); - v[ 4] = _mm_add_epi32(u[ 4], k__DCT_CONST_ROUNDING); - v[ 5] = _mm_add_epi32(u[ 5], k__DCT_CONST_ROUNDING); - v[ 6] = _mm_add_epi32(u[ 6], k__DCT_CONST_ROUNDING); - v[ 7] = _mm_add_epi32(u[ 7], k__DCT_CONST_ROUNDING); - v[ 8] = _mm_add_epi32(u[ 8], k__DCT_CONST_ROUNDING); - v[ 9] = _mm_add_epi32(u[ 9], k__DCT_CONST_ROUNDING); - v[10] = _mm_add_epi32(u[10], k__DCT_CONST_ROUNDING); - v[11] = _mm_add_epi32(u[11], k__DCT_CONST_ROUNDING); - v[12] = _mm_add_epi32(u[12], k__DCT_CONST_ROUNDING); - v[13] = _mm_add_epi32(u[13], k__DCT_CONST_ROUNDING); - v[14] = _mm_add_epi32(u[14], k__DCT_CONST_ROUNDING); - v[15] = _mm_add_epi32(u[15], k__DCT_CONST_ROUNDING); - - lstep3[34] = _mm_srai_epi32(v[ 0], DCT_CONST_BITS); - lstep3[35] = _mm_srai_epi32(v[ 1], DCT_CONST_BITS); - lstep3[36] = _mm_srai_epi32(v[ 2], DCT_CONST_BITS); - lstep3[37] = _mm_srai_epi32(v[ 3], DCT_CONST_BITS); - lstep3[42] = _mm_srai_epi32(v[ 4], DCT_CONST_BITS); - lstep3[43] = _mm_srai_epi32(v[ 5], DCT_CONST_BITS); - lstep3[44] = _mm_srai_epi32(v[ 6], DCT_CONST_BITS); - lstep3[45] = _mm_srai_epi32(v[ 7], DCT_CONST_BITS); - lstep3[50] = _mm_srai_epi32(v[ 8], DCT_CONST_BITS); - lstep3[51] = _mm_srai_epi32(v[ 9], DCT_CONST_BITS); - lstep3[52] = _mm_srai_epi32(v[10], DCT_CONST_BITS); - lstep3[53] = _mm_srai_epi32(v[11], DCT_CONST_BITS); - lstep3[58] = _mm_srai_epi32(v[12], DCT_CONST_BITS); - lstep3[59] = _mm_srai_epi32(v[13], DCT_CONST_BITS); - lstep3[60] = _mm_srai_epi32(v[14], DCT_CONST_BITS); - lstep3[61] = _mm_srai_epi32(v[15], DCT_CONST_BITS); - } - // stage 7 - { - const __m128i k32_p30_p02 = pair_set_epi32(cospi_30_64, cospi_2_64); - const __m128i k32_p14_p18 = pair_set_epi32(cospi_14_64, cospi_18_64); - const __m128i k32_p22_p10 = pair_set_epi32(cospi_22_64, cospi_10_64); - const __m128i k32_p06_p26 = pair_set_epi32(cospi_6_64, cospi_26_64); - const __m128i k32_m26_p06 = pair_set_epi32(-cospi_26_64, cospi_6_64); - const __m128i k32_m10_p22 = pair_set_epi32(-cospi_10_64, cospi_22_64); - const __m128i k32_m18_p14 = pair_set_epi32(-cospi_18_64, cospi_14_64); - const __m128i k32_m02_p30 = pair_set_epi32(-cospi_2_64, cospi_30_64); - - u[ 0] = _mm_unpacklo_epi32(lstep3[16], lstep3[30]); - u[ 1] = _mm_unpackhi_epi32(lstep3[16], lstep3[30]); - u[ 2] = _mm_unpacklo_epi32(lstep3[17], lstep3[31]); - u[ 3] = _mm_unpackhi_epi32(lstep3[17], lstep3[31]); - u[ 4] = _mm_unpacklo_epi32(lstep3[18], lstep3[28]); - u[ 5] = _mm_unpackhi_epi32(lstep3[18], lstep3[28]); - u[ 6] = _mm_unpacklo_epi32(lstep3[19], lstep3[29]); - u[ 7] = _mm_unpackhi_epi32(lstep3[19], lstep3[29]); - u[ 8] = _mm_unpacklo_epi32(lstep3[20], lstep3[26]); - u[ 9] = _mm_unpackhi_epi32(lstep3[20], lstep3[26]); - u[10] = _mm_unpacklo_epi32(lstep3[21], lstep3[27]); - u[11] = _mm_unpackhi_epi32(lstep3[21], lstep3[27]); - u[12] = _mm_unpacklo_epi32(lstep3[22], lstep3[24]); - u[13] = _mm_unpackhi_epi32(lstep3[22], lstep3[24]); - u[14] = _mm_unpacklo_epi32(lstep3[23], lstep3[25]); - u[15] = _mm_unpackhi_epi32(lstep3[23], lstep3[25]); - - v[ 0] = k_madd_epi32(u[ 0], k32_p30_p02); - v[ 1] = k_madd_epi32(u[ 1], k32_p30_p02); - v[ 2] = k_madd_epi32(u[ 2], k32_p30_p02); - v[ 3] = k_madd_epi32(u[ 3], k32_p30_p02); - v[ 4] = k_madd_epi32(u[ 4], k32_p14_p18); - v[ 5] = k_madd_epi32(u[ 5], k32_p14_p18); - v[ 6] = k_madd_epi32(u[ 6], k32_p14_p18); - v[ 7] = k_madd_epi32(u[ 7], k32_p14_p18); - v[ 8] = k_madd_epi32(u[ 8], k32_p22_p10); - v[ 9] = k_madd_epi32(u[ 9], k32_p22_p10); - v[10] = k_madd_epi32(u[10], k32_p22_p10); - v[11] = k_madd_epi32(u[11], k32_p22_p10); - v[12] = k_madd_epi32(u[12], k32_p06_p26); - v[13] = k_madd_epi32(u[13], k32_p06_p26); - v[14] = k_madd_epi32(u[14], k32_p06_p26); - v[15] = k_madd_epi32(u[15], k32_p06_p26); - v[16] = k_madd_epi32(u[12], k32_m26_p06); - v[17] = k_madd_epi32(u[13], k32_m26_p06); - v[18] = k_madd_epi32(u[14], k32_m26_p06); - v[19] = k_madd_epi32(u[15], k32_m26_p06); - v[20] = k_madd_epi32(u[ 8], k32_m10_p22); - v[21] = k_madd_epi32(u[ 9], k32_m10_p22); - v[22] = k_madd_epi32(u[10], k32_m10_p22); - v[23] = k_madd_epi32(u[11], k32_m10_p22); - v[24] = k_madd_epi32(u[ 4], k32_m18_p14); - v[25] = k_madd_epi32(u[ 5], k32_m18_p14); - v[26] = k_madd_epi32(u[ 6], k32_m18_p14); - v[27] = k_madd_epi32(u[ 7], k32_m18_p14); - v[28] = k_madd_epi32(u[ 0], k32_m02_p30); - v[29] = k_madd_epi32(u[ 1], k32_m02_p30); - v[30] = k_madd_epi32(u[ 2], k32_m02_p30); - v[31] = k_madd_epi32(u[ 3], k32_m02_p30); - -#if DCT_HIGH_BIT_DEPTH - overflow = k_check_epi32_overflow_32( - &v[0], &v[1], &v[2], &v[3], &v[4], &v[5], &v[6], &v[7], - &v[8], &v[9], &v[10], &v[11], &v[12], &v[13], &v[14], &v[15], - &v[16], &v[17], &v[18], &v[19], &v[20], &v[21], &v[22], &v[23], - &v[24], &v[25], &v[26], &v[27], &v[28], &v[29], &v[30], &v[31], - &kZero); - if (overflow) { - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - u[ 0] = k_packs_epi64(v[ 0], v[ 1]); - u[ 1] = k_packs_epi64(v[ 2], v[ 3]); - u[ 2] = k_packs_epi64(v[ 4], v[ 5]); - u[ 3] = k_packs_epi64(v[ 6], v[ 7]); - u[ 4] = k_packs_epi64(v[ 8], v[ 9]); - u[ 5] = k_packs_epi64(v[10], v[11]); - u[ 6] = k_packs_epi64(v[12], v[13]); - u[ 7] = k_packs_epi64(v[14], v[15]); - u[ 8] = k_packs_epi64(v[16], v[17]); - u[ 9] = k_packs_epi64(v[18], v[19]); - u[10] = k_packs_epi64(v[20], v[21]); - u[11] = k_packs_epi64(v[22], v[23]); - u[12] = k_packs_epi64(v[24], v[25]); - u[13] = k_packs_epi64(v[26], v[27]); - u[14] = k_packs_epi64(v[28], v[29]); - u[15] = k_packs_epi64(v[30], v[31]); - - v[ 0] = _mm_add_epi32(u[ 0], k__DCT_CONST_ROUNDING); - v[ 1] = _mm_add_epi32(u[ 1], k__DCT_CONST_ROUNDING); - v[ 2] = _mm_add_epi32(u[ 2], k__DCT_CONST_ROUNDING); - v[ 3] = _mm_add_epi32(u[ 3], k__DCT_CONST_ROUNDING); - v[ 4] = _mm_add_epi32(u[ 4], k__DCT_CONST_ROUNDING); - v[ 5] = _mm_add_epi32(u[ 5], k__DCT_CONST_ROUNDING); - v[ 6] = _mm_add_epi32(u[ 6], k__DCT_CONST_ROUNDING); - v[ 7] = _mm_add_epi32(u[ 7], k__DCT_CONST_ROUNDING); - v[ 8] = _mm_add_epi32(u[ 8], k__DCT_CONST_ROUNDING); - v[ 9] = _mm_add_epi32(u[ 9], k__DCT_CONST_ROUNDING); - v[10] = _mm_add_epi32(u[10], k__DCT_CONST_ROUNDING); - v[11] = _mm_add_epi32(u[11], k__DCT_CONST_ROUNDING); - v[12] = _mm_add_epi32(u[12], k__DCT_CONST_ROUNDING); - v[13] = _mm_add_epi32(u[13], k__DCT_CONST_ROUNDING); - v[14] = _mm_add_epi32(u[14], k__DCT_CONST_ROUNDING); - v[15] = _mm_add_epi32(u[15], k__DCT_CONST_ROUNDING); - - u[ 0] = _mm_srai_epi32(v[ 0], DCT_CONST_BITS); - u[ 1] = _mm_srai_epi32(v[ 1], DCT_CONST_BITS); - u[ 2] = _mm_srai_epi32(v[ 2], DCT_CONST_BITS); - u[ 3] = _mm_srai_epi32(v[ 3], DCT_CONST_BITS); - u[ 4] = _mm_srai_epi32(v[ 4], DCT_CONST_BITS); - u[ 5] = _mm_srai_epi32(v[ 5], DCT_CONST_BITS); - u[ 6] = _mm_srai_epi32(v[ 6], DCT_CONST_BITS); - u[ 7] = _mm_srai_epi32(v[ 7], DCT_CONST_BITS); - u[ 8] = _mm_srai_epi32(v[ 8], DCT_CONST_BITS); - u[ 9] = _mm_srai_epi32(v[ 9], DCT_CONST_BITS); - u[10] = _mm_srai_epi32(v[10], DCT_CONST_BITS); - u[11] = _mm_srai_epi32(v[11], DCT_CONST_BITS); - u[12] = _mm_srai_epi32(v[12], DCT_CONST_BITS); - u[13] = _mm_srai_epi32(v[13], DCT_CONST_BITS); - u[14] = _mm_srai_epi32(v[14], DCT_CONST_BITS); - u[15] = _mm_srai_epi32(v[15], DCT_CONST_BITS); - - v[ 0] = _mm_cmplt_epi32(u[ 0], kZero); - v[ 1] = _mm_cmplt_epi32(u[ 1], kZero); - v[ 2] = _mm_cmplt_epi32(u[ 2], kZero); - v[ 3] = _mm_cmplt_epi32(u[ 3], kZero); - v[ 4] = _mm_cmplt_epi32(u[ 4], kZero); - v[ 5] = _mm_cmplt_epi32(u[ 5], kZero); - v[ 6] = _mm_cmplt_epi32(u[ 6], kZero); - v[ 7] = _mm_cmplt_epi32(u[ 7], kZero); - v[ 8] = _mm_cmplt_epi32(u[ 8], kZero); - v[ 9] = _mm_cmplt_epi32(u[ 9], kZero); - v[10] = _mm_cmplt_epi32(u[10], kZero); - v[11] = _mm_cmplt_epi32(u[11], kZero); - v[12] = _mm_cmplt_epi32(u[12], kZero); - v[13] = _mm_cmplt_epi32(u[13], kZero); - v[14] = _mm_cmplt_epi32(u[14], kZero); - v[15] = _mm_cmplt_epi32(u[15], kZero); - - u[ 0] = _mm_sub_epi32(u[ 0], v[ 0]); - u[ 1] = _mm_sub_epi32(u[ 1], v[ 1]); - u[ 2] = _mm_sub_epi32(u[ 2], v[ 2]); - u[ 3] = _mm_sub_epi32(u[ 3], v[ 3]); - u[ 4] = _mm_sub_epi32(u[ 4], v[ 4]); - u[ 5] = _mm_sub_epi32(u[ 5], v[ 5]); - u[ 6] = _mm_sub_epi32(u[ 6], v[ 6]); - u[ 7] = _mm_sub_epi32(u[ 7], v[ 7]); - u[ 8] = _mm_sub_epi32(u[ 8], v[ 8]); - u[ 9] = _mm_sub_epi32(u[ 9], v[ 9]); - u[10] = _mm_sub_epi32(u[10], v[10]); - u[11] = _mm_sub_epi32(u[11], v[11]); - u[12] = _mm_sub_epi32(u[12], v[12]); - u[13] = _mm_sub_epi32(u[13], v[13]); - u[14] = _mm_sub_epi32(u[14], v[14]); - u[15] = _mm_sub_epi32(u[15], v[15]); - - v[ 0] = _mm_add_epi32(u[ 0], K32One); - v[ 1] = _mm_add_epi32(u[ 1], K32One); - v[ 2] = _mm_add_epi32(u[ 2], K32One); - v[ 3] = _mm_add_epi32(u[ 3], K32One); - v[ 4] = _mm_add_epi32(u[ 4], K32One); - v[ 5] = _mm_add_epi32(u[ 5], K32One); - v[ 6] = _mm_add_epi32(u[ 6], K32One); - v[ 7] = _mm_add_epi32(u[ 7], K32One); - v[ 8] = _mm_add_epi32(u[ 8], K32One); - v[ 9] = _mm_add_epi32(u[ 9], K32One); - v[10] = _mm_add_epi32(u[10], K32One); - v[11] = _mm_add_epi32(u[11], K32One); - v[12] = _mm_add_epi32(u[12], K32One); - v[13] = _mm_add_epi32(u[13], K32One); - v[14] = _mm_add_epi32(u[14], K32One); - v[15] = _mm_add_epi32(u[15], K32One); - - u[ 0] = _mm_srai_epi32(v[ 0], 2); - u[ 1] = _mm_srai_epi32(v[ 1], 2); - u[ 2] = _mm_srai_epi32(v[ 2], 2); - u[ 3] = _mm_srai_epi32(v[ 3], 2); - u[ 4] = _mm_srai_epi32(v[ 4], 2); - u[ 5] = _mm_srai_epi32(v[ 5], 2); - u[ 6] = _mm_srai_epi32(v[ 6], 2); - u[ 7] = _mm_srai_epi32(v[ 7], 2); - u[ 8] = _mm_srai_epi32(v[ 8], 2); - u[ 9] = _mm_srai_epi32(v[ 9], 2); - u[10] = _mm_srai_epi32(v[10], 2); - u[11] = _mm_srai_epi32(v[11], 2); - u[12] = _mm_srai_epi32(v[12], 2); - u[13] = _mm_srai_epi32(v[13], 2); - u[14] = _mm_srai_epi32(v[14], 2); - u[15] = _mm_srai_epi32(v[15], 2); - - out[ 2] = _mm_packs_epi32(u[0], u[1]); - out[18] = _mm_packs_epi32(u[2], u[3]); - out[10] = _mm_packs_epi32(u[4], u[5]); - out[26] = _mm_packs_epi32(u[6], u[7]); - out[ 6] = _mm_packs_epi32(u[8], u[9]); - out[22] = _mm_packs_epi32(u[10], u[11]); - out[14] = _mm_packs_epi32(u[12], u[13]); - out[30] = _mm_packs_epi32(u[14], u[15]); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x8(&out[2], &out[18], &out[10], - &out[26], &out[6], &out[22], - &out[14], &out[30]); - if (overflow) { - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - { - lstep1[32] = _mm_add_epi32(lstep3[34], lstep2[32]); - lstep1[33] = _mm_add_epi32(lstep3[35], lstep2[33]); - lstep1[34] = _mm_sub_epi32(lstep2[32], lstep3[34]); - lstep1[35] = _mm_sub_epi32(lstep2[33], lstep3[35]); - lstep1[36] = _mm_sub_epi32(lstep2[38], lstep3[36]); - lstep1[37] = _mm_sub_epi32(lstep2[39], lstep3[37]); - lstep1[38] = _mm_add_epi32(lstep3[36], lstep2[38]); - lstep1[39] = _mm_add_epi32(lstep3[37], lstep2[39]); - lstep1[40] = _mm_add_epi32(lstep3[42], lstep2[40]); - lstep1[41] = _mm_add_epi32(lstep3[43], lstep2[41]); - lstep1[42] = _mm_sub_epi32(lstep2[40], lstep3[42]); - lstep1[43] = _mm_sub_epi32(lstep2[41], lstep3[43]); - lstep1[44] = _mm_sub_epi32(lstep2[46], lstep3[44]); - lstep1[45] = _mm_sub_epi32(lstep2[47], lstep3[45]); - lstep1[46] = _mm_add_epi32(lstep3[44], lstep2[46]); - lstep1[47] = _mm_add_epi32(lstep3[45], lstep2[47]); - lstep1[48] = _mm_add_epi32(lstep3[50], lstep2[48]); - lstep1[49] = _mm_add_epi32(lstep3[51], lstep2[49]); - lstep1[50] = _mm_sub_epi32(lstep2[48], lstep3[50]); - lstep1[51] = _mm_sub_epi32(lstep2[49], lstep3[51]); - lstep1[52] = _mm_sub_epi32(lstep2[54], lstep3[52]); - lstep1[53] = _mm_sub_epi32(lstep2[55], lstep3[53]); - lstep1[54] = _mm_add_epi32(lstep3[52], lstep2[54]); - lstep1[55] = _mm_add_epi32(lstep3[53], lstep2[55]); - lstep1[56] = _mm_add_epi32(lstep3[58], lstep2[56]); - lstep1[57] = _mm_add_epi32(lstep3[59], lstep2[57]); - lstep1[58] = _mm_sub_epi32(lstep2[56], lstep3[58]); - lstep1[59] = _mm_sub_epi32(lstep2[57], lstep3[59]); - lstep1[60] = _mm_sub_epi32(lstep2[62], lstep3[60]); - lstep1[61] = _mm_sub_epi32(lstep2[63], lstep3[61]); - lstep1[62] = _mm_add_epi32(lstep3[60], lstep2[62]); - lstep1[63] = _mm_add_epi32(lstep3[61], lstep2[63]); - } - // stage 8 - { - const __m128i k32_p31_p01 = pair_set_epi32(cospi_31_64, cospi_1_64); - const __m128i k32_p15_p17 = pair_set_epi32(cospi_15_64, cospi_17_64); - const __m128i k32_p23_p09 = pair_set_epi32(cospi_23_64, cospi_9_64); - const __m128i k32_p07_p25 = pair_set_epi32(cospi_7_64, cospi_25_64); - const __m128i k32_m25_p07 = pair_set_epi32(-cospi_25_64, cospi_7_64); - const __m128i k32_m09_p23 = pair_set_epi32(-cospi_9_64, cospi_23_64); - const __m128i k32_m17_p15 = pair_set_epi32(-cospi_17_64, cospi_15_64); - const __m128i k32_m01_p31 = pair_set_epi32(-cospi_1_64, cospi_31_64); - - u[ 0] = _mm_unpacklo_epi32(lstep1[32], lstep1[62]); - u[ 1] = _mm_unpackhi_epi32(lstep1[32], lstep1[62]); - u[ 2] = _mm_unpacklo_epi32(lstep1[33], lstep1[63]); - u[ 3] = _mm_unpackhi_epi32(lstep1[33], lstep1[63]); - u[ 4] = _mm_unpacklo_epi32(lstep1[34], lstep1[60]); - u[ 5] = _mm_unpackhi_epi32(lstep1[34], lstep1[60]); - u[ 6] = _mm_unpacklo_epi32(lstep1[35], lstep1[61]); - u[ 7] = _mm_unpackhi_epi32(lstep1[35], lstep1[61]); - u[ 8] = _mm_unpacklo_epi32(lstep1[36], lstep1[58]); - u[ 9] = _mm_unpackhi_epi32(lstep1[36], lstep1[58]); - u[10] = _mm_unpacklo_epi32(lstep1[37], lstep1[59]); - u[11] = _mm_unpackhi_epi32(lstep1[37], lstep1[59]); - u[12] = _mm_unpacklo_epi32(lstep1[38], lstep1[56]); - u[13] = _mm_unpackhi_epi32(lstep1[38], lstep1[56]); - u[14] = _mm_unpacklo_epi32(lstep1[39], lstep1[57]); - u[15] = _mm_unpackhi_epi32(lstep1[39], lstep1[57]); - - v[ 0] = k_madd_epi32(u[ 0], k32_p31_p01); - v[ 1] = k_madd_epi32(u[ 1], k32_p31_p01); - v[ 2] = k_madd_epi32(u[ 2], k32_p31_p01); - v[ 3] = k_madd_epi32(u[ 3], k32_p31_p01); - v[ 4] = k_madd_epi32(u[ 4], k32_p15_p17); - v[ 5] = k_madd_epi32(u[ 5], k32_p15_p17); - v[ 6] = k_madd_epi32(u[ 6], k32_p15_p17); - v[ 7] = k_madd_epi32(u[ 7], k32_p15_p17); - v[ 8] = k_madd_epi32(u[ 8], k32_p23_p09); - v[ 9] = k_madd_epi32(u[ 9], k32_p23_p09); - v[10] = k_madd_epi32(u[10], k32_p23_p09); - v[11] = k_madd_epi32(u[11], k32_p23_p09); - v[12] = k_madd_epi32(u[12], k32_p07_p25); - v[13] = k_madd_epi32(u[13], k32_p07_p25); - v[14] = k_madd_epi32(u[14], k32_p07_p25); - v[15] = k_madd_epi32(u[15], k32_p07_p25); - v[16] = k_madd_epi32(u[12], k32_m25_p07); - v[17] = k_madd_epi32(u[13], k32_m25_p07); - v[18] = k_madd_epi32(u[14], k32_m25_p07); - v[19] = k_madd_epi32(u[15], k32_m25_p07); - v[20] = k_madd_epi32(u[ 8], k32_m09_p23); - v[21] = k_madd_epi32(u[ 9], k32_m09_p23); - v[22] = k_madd_epi32(u[10], k32_m09_p23); - v[23] = k_madd_epi32(u[11], k32_m09_p23); - v[24] = k_madd_epi32(u[ 4], k32_m17_p15); - v[25] = k_madd_epi32(u[ 5], k32_m17_p15); - v[26] = k_madd_epi32(u[ 6], k32_m17_p15); - v[27] = k_madd_epi32(u[ 7], k32_m17_p15); - v[28] = k_madd_epi32(u[ 0], k32_m01_p31); - v[29] = k_madd_epi32(u[ 1], k32_m01_p31); - v[30] = k_madd_epi32(u[ 2], k32_m01_p31); - v[31] = k_madd_epi32(u[ 3], k32_m01_p31); - -#if DCT_HIGH_BIT_DEPTH - overflow = k_check_epi32_overflow_32( - &v[0], &v[1], &v[2], &v[3], &v[4], &v[5], &v[6], &v[7], - &v[8], &v[9], &v[10], &v[11], &v[12], &v[13], &v[14], &v[15], - &v[16], &v[17], &v[18], &v[19], &v[20], &v[21], &v[22], &v[23], - &v[24], &v[25], &v[26], &v[27], &v[28], &v[29], &v[30], &v[31], - &kZero); - if (overflow) { - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - u[ 0] = k_packs_epi64(v[ 0], v[ 1]); - u[ 1] = k_packs_epi64(v[ 2], v[ 3]); - u[ 2] = k_packs_epi64(v[ 4], v[ 5]); - u[ 3] = k_packs_epi64(v[ 6], v[ 7]); - u[ 4] = k_packs_epi64(v[ 8], v[ 9]); - u[ 5] = k_packs_epi64(v[10], v[11]); - u[ 6] = k_packs_epi64(v[12], v[13]); - u[ 7] = k_packs_epi64(v[14], v[15]); - u[ 8] = k_packs_epi64(v[16], v[17]); - u[ 9] = k_packs_epi64(v[18], v[19]); - u[10] = k_packs_epi64(v[20], v[21]); - u[11] = k_packs_epi64(v[22], v[23]); - u[12] = k_packs_epi64(v[24], v[25]); - u[13] = k_packs_epi64(v[26], v[27]); - u[14] = k_packs_epi64(v[28], v[29]); - u[15] = k_packs_epi64(v[30], v[31]); - - v[ 0] = _mm_add_epi32(u[ 0], k__DCT_CONST_ROUNDING); - v[ 1] = _mm_add_epi32(u[ 1], k__DCT_CONST_ROUNDING); - v[ 2] = _mm_add_epi32(u[ 2], k__DCT_CONST_ROUNDING); - v[ 3] = _mm_add_epi32(u[ 3], k__DCT_CONST_ROUNDING); - v[ 4] = _mm_add_epi32(u[ 4], k__DCT_CONST_ROUNDING); - v[ 5] = _mm_add_epi32(u[ 5], k__DCT_CONST_ROUNDING); - v[ 6] = _mm_add_epi32(u[ 6], k__DCT_CONST_ROUNDING); - v[ 7] = _mm_add_epi32(u[ 7], k__DCT_CONST_ROUNDING); - v[ 8] = _mm_add_epi32(u[ 8], k__DCT_CONST_ROUNDING); - v[ 9] = _mm_add_epi32(u[ 9], k__DCT_CONST_ROUNDING); - v[10] = _mm_add_epi32(u[10], k__DCT_CONST_ROUNDING); - v[11] = _mm_add_epi32(u[11], k__DCT_CONST_ROUNDING); - v[12] = _mm_add_epi32(u[12], k__DCT_CONST_ROUNDING); - v[13] = _mm_add_epi32(u[13], k__DCT_CONST_ROUNDING); - v[14] = _mm_add_epi32(u[14], k__DCT_CONST_ROUNDING); - v[15] = _mm_add_epi32(u[15], k__DCT_CONST_ROUNDING); - - u[ 0] = _mm_srai_epi32(v[ 0], DCT_CONST_BITS); - u[ 1] = _mm_srai_epi32(v[ 1], DCT_CONST_BITS); - u[ 2] = _mm_srai_epi32(v[ 2], DCT_CONST_BITS); - u[ 3] = _mm_srai_epi32(v[ 3], DCT_CONST_BITS); - u[ 4] = _mm_srai_epi32(v[ 4], DCT_CONST_BITS); - u[ 5] = _mm_srai_epi32(v[ 5], DCT_CONST_BITS); - u[ 6] = _mm_srai_epi32(v[ 6], DCT_CONST_BITS); - u[ 7] = _mm_srai_epi32(v[ 7], DCT_CONST_BITS); - u[ 8] = _mm_srai_epi32(v[ 8], DCT_CONST_BITS); - u[ 9] = _mm_srai_epi32(v[ 9], DCT_CONST_BITS); - u[10] = _mm_srai_epi32(v[10], DCT_CONST_BITS); - u[11] = _mm_srai_epi32(v[11], DCT_CONST_BITS); - u[12] = _mm_srai_epi32(v[12], DCT_CONST_BITS); - u[13] = _mm_srai_epi32(v[13], DCT_CONST_BITS); - u[14] = _mm_srai_epi32(v[14], DCT_CONST_BITS); - u[15] = _mm_srai_epi32(v[15], DCT_CONST_BITS); - - v[ 0] = _mm_cmplt_epi32(u[ 0], kZero); - v[ 1] = _mm_cmplt_epi32(u[ 1], kZero); - v[ 2] = _mm_cmplt_epi32(u[ 2], kZero); - v[ 3] = _mm_cmplt_epi32(u[ 3], kZero); - v[ 4] = _mm_cmplt_epi32(u[ 4], kZero); - v[ 5] = _mm_cmplt_epi32(u[ 5], kZero); - v[ 6] = _mm_cmplt_epi32(u[ 6], kZero); - v[ 7] = _mm_cmplt_epi32(u[ 7], kZero); - v[ 8] = _mm_cmplt_epi32(u[ 8], kZero); - v[ 9] = _mm_cmplt_epi32(u[ 9], kZero); - v[10] = _mm_cmplt_epi32(u[10], kZero); - v[11] = _mm_cmplt_epi32(u[11], kZero); - v[12] = _mm_cmplt_epi32(u[12], kZero); - v[13] = _mm_cmplt_epi32(u[13], kZero); - v[14] = _mm_cmplt_epi32(u[14], kZero); - v[15] = _mm_cmplt_epi32(u[15], kZero); - - u[ 0] = _mm_sub_epi32(u[ 0], v[ 0]); - u[ 1] = _mm_sub_epi32(u[ 1], v[ 1]); - u[ 2] = _mm_sub_epi32(u[ 2], v[ 2]); - u[ 3] = _mm_sub_epi32(u[ 3], v[ 3]); - u[ 4] = _mm_sub_epi32(u[ 4], v[ 4]); - u[ 5] = _mm_sub_epi32(u[ 5], v[ 5]); - u[ 6] = _mm_sub_epi32(u[ 6], v[ 6]); - u[ 7] = _mm_sub_epi32(u[ 7], v[ 7]); - u[ 8] = _mm_sub_epi32(u[ 8], v[ 8]); - u[ 9] = _mm_sub_epi32(u[ 9], v[ 9]); - u[10] = _mm_sub_epi32(u[10], v[10]); - u[11] = _mm_sub_epi32(u[11], v[11]); - u[12] = _mm_sub_epi32(u[12], v[12]); - u[13] = _mm_sub_epi32(u[13], v[13]); - u[14] = _mm_sub_epi32(u[14], v[14]); - u[15] = _mm_sub_epi32(u[15], v[15]); - - v[0] = _mm_add_epi32(u[0], K32One); - v[1] = _mm_add_epi32(u[1], K32One); - v[2] = _mm_add_epi32(u[2], K32One); - v[3] = _mm_add_epi32(u[3], K32One); - v[4] = _mm_add_epi32(u[4], K32One); - v[5] = _mm_add_epi32(u[5], K32One); - v[6] = _mm_add_epi32(u[6], K32One); - v[7] = _mm_add_epi32(u[7], K32One); - v[8] = _mm_add_epi32(u[8], K32One); - v[9] = _mm_add_epi32(u[9], K32One); - v[10] = _mm_add_epi32(u[10], K32One); - v[11] = _mm_add_epi32(u[11], K32One); - v[12] = _mm_add_epi32(u[12], K32One); - v[13] = _mm_add_epi32(u[13], K32One); - v[14] = _mm_add_epi32(u[14], K32One); - v[15] = _mm_add_epi32(u[15], K32One); - - u[0] = _mm_srai_epi32(v[0], 2); - u[1] = _mm_srai_epi32(v[1], 2); - u[2] = _mm_srai_epi32(v[2], 2); - u[3] = _mm_srai_epi32(v[3], 2); - u[4] = _mm_srai_epi32(v[4], 2); - u[5] = _mm_srai_epi32(v[5], 2); - u[6] = _mm_srai_epi32(v[6], 2); - u[7] = _mm_srai_epi32(v[7], 2); - u[8] = _mm_srai_epi32(v[8], 2); - u[9] = _mm_srai_epi32(v[9], 2); - u[10] = _mm_srai_epi32(v[10], 2); - u[11] = _mm_srai_epi32(v[11], 2); - u[12] = _mm_srai_epi32(v[12], 2); - u[13] = _mm_srai_epi32(v[13], 2); - u[14] = _mm_srai_epi32(v[14], 2); - u[15] = _mm_srai_epi32(v[15], 2); - - out[ 1] = _mm_packs_epi32(u[0], u[1]); - out[17] = _mm_packs_epi32(u[2], u[3]); - out[ 9] = _mm_packs_epi32(u[4], u[5]); - out[25] = _mm_packs_epi32(u[6], u[7]); - out[ 7] = _mm_packs_epi32(u[8], u[9]); - out[23] = _mm_packs_epi32(u[10], u[11]); - out[15] = _mm_packs_epi32(u[12], u[13]); - out[31] = _mm_packs_epi32(u[14], u[15]); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x8(&out[1], &out[17], &out[9], - &out[25], &out[7], &out[23], - &out[15], &out[31]); - if (overflow) { - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - { - const __m128i k32_p27_p05 = pair_set_epi32(cospi_27_64, cospi_5_64); - const __m128i k32_p11_p21 = pair_set_epi32(cospi_11_64, cospi_21_64); - const __m128i k32_p19_p13 = pair_set_epi32(cospi_19_64, cospi_13_64); - const __m128i k32_p03_p29 = pair_set_epi32(cospi_3_64, cospi_29_64); - const __m128i k32_m29_p03 = pair_set_epi32(-cospi_29_64, cospi_3_64); - const __m128i k32_m13_p19 = pair_set_epi32(-cospi_13_64, cospi_19_64); - const __m128i k32_m21_p11 = pair_set_epi32(-cospi_21_64, cospi_11_64); - const __m128i k32_m05_p27 = pair_set_epi32(-cospi_5_64, cospi_27_64); - - u[ 0] = _mm_unpacklo_epi32(lstep1[40], lstep1[54]); - u[ 1] = _mm_unpackhi_epi32(lstep1[40], lstep1[54]); - u[ 2] = _mm_unpacklo_epi32(lstep1[41], lstep1[55]); - u[ 3] = _mm_unpackhi_epi32(lstep1[41], lstep1[55]); - u[ 4] = _mm_unpacklo_epi32(lstep1[42], lstep1[52]); - u[ 5] = _mm_unpackhi_epi32(lstep1[42], lstep1[52]); - u[ 6] = _mm_unpacklo_epi32(lstep1[43], lstep1[53]); - u[ 7] = _mm_unpackhi_epi32(lstep1[43], lstep1[53]); - u[ 8] = _mm_unpacklo_epi32(lstep1[44], lstep1[50]); - u[ 9] = _mm_unpackhi_epi32(lstep1[44], lstep1[50]); - u[10] = _mm_unpacklo_epi32(lstep1[45], lstep1[51]); - u[11] = _mm_unpackhi_epi32(lstep1[45], lstep1[51]); - u[12] = _mm_unpacklo_epi32(lstep1[46], lstep1[48]); - u[13] = _mm_unpackhi_epi32(lstep1[46], lstep1[48]); - u[14] = _mm_unpacklo_epi32(lstep1[47], lstep1[49]); - u[15] = _mm_unpackhi_epi32(lstep1[47], lstep1[49]); - - v[ 0] = k_madd_epi32(u[ 0], k32_p27_p05); - v[ 1] = k_madd_epi32(u[ 1], k32_p27_p05); - v[ 2] = k_madd_epi32(u[ 2], k32_p27_p05); - v[ 3] = k_madd_epi32(u[ 3], k32_p27_p05); - v[ 4] = k_madd_epi32(u[ 4], k32_p11_p21); - v[ 5] = k_madd_epi32(u[ 5], k32_p11_p21); - v[ 6] = k_madd_epi32(u[ 6], k32_p11_p21); - v[ 7] = k_madd_epi32(u[ 7], k32_p11_p21); - v[ 8] = k_madd_epi32(u[ 8], k32_p19_p13); - v[ 9] = k_madd_epi32(u[ 9], k32_p19_p13); - v[10] = k_madd_epi32(u[10], k32_p19_p13); - v[11] = k_madd_epi32(u[11], k32_p19_p13); - v[12] = k_madd_epi32(u[12], k32_p03_p29); - v[13] = k_madd_epi32(u[13], k32_p03_p29); - v[14] = k_madd_epi32(u[14], k32_p03_p29); - v[15] = k_madd_epi32(u[15], k32_p03_p29); - v[16] = k_madd_epi32(u[12], k32_m29_p03); - v[17] = k_madd_epi32(u[13], k32_m29_p03); - v[18] = k_madd_epi32(u[14], k32_m29_p03); - v[19] = k_madd_epi32(u[15], k32_m29_p03); - v[20] = k_madd_epi32(u[ 8], k32_m13_p19); - v[21] = k_madd_epi32(u[ 9], k32_m13_p19); - v[22] = k_madd_epi32(u[10], k32_m13_p19); - v[23] = k_madd_epi32(u[11], k32_m13_p19); - v[24] = k_madd_epi32(u[ 4], k32_m21_p11); - v[25] = k_madd_epi32(u[ 5], k32_m21_p11); - v[26] = k_madd_epi32(u[ 6], k32_m21_p11); - v[27] = k_madd_epi32(u[ 7], k32_m21_p11); - v[28] = k_madd_epi32(u[ 0], k32_m05_p27); - v[29] = k_madd_epi32(u[ 1], k32_m05_p27); - v[30] = k_madd_epi32(u[ 2], k32_m05_p27); - v[31] = k_madd_epi32(u[ 3], k32_m05_p27); - -#if DCT_HIGH_BIT_DEPTH - overflow = k_check_epi32_overflow_32( - &v[0], &v[1], &v[2], &v[3], &v[4], &v[5], &v[6], &v[7], - &v[8], &v[9], &v[10], &v[11], &v[12], &v[13], &v[14], &v[15], - &v[16], &v[17], &v[18], &v[19], &v[20], &v[21], &v[22], &v[23], - &v[24], &v[25], &v[26], &v[27], &v[28], &v[29], &v[30], &v[31], - &kZero); - if (overflow) { - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - u[ 0] = k_packs_epi64(v[ 0], v[ 1]); - u[ 1] = k_packs_epi64(v[ 2], v[ 3]); - u[ 2] = k_packs_epi64(v[ 4], v[ 5]); - u[ 3] = k_packs_epi64(v[ 6], v[ 7]); - u[ 4] = k_packs_epi64(v[ 8], v[ 9]); - u[ 5] = k_packs_epi64(v[10], v[11]); - u[ 6] = k_packs_epi64(v[12], v[13]); - u[ 7] = k_packs_epi64(v[14], v[15]); - u[ 8] = k_packs_epi64(v[16], v[17]); - u[ 9] = k_packs_epi64(v[18], v[19]); - u[10] = k_packs_epi64(v[20], v[21]); - u[11] = k_packs_epi64(v[22], v[23]); - u[12] = k_packs_epi64(v[24], v[25]); - u[13] = k_packs_epi64(v[26], v[27]); - u[14] = k_packs_epi64(v[28], v[29]); - u[15] = k_packs_epi64(v[30], v[31]); - - v[ 0] = _mm_add_epi32(u[ 0], k__DCT_CONST_ROUNDING); - v[ 1] = _mm_add_epi32(u[ 1], k__DCT_CONST_ROUNDING); - v[ 2] = _mm_add_epi32(u[ 2], k__DCT_CONST_ROUNDING); - v[ 3] = _mm_add_epi32(u[ 3], k__DCT_CONST_ROUNDING); - v[ 4] = _mm_add_epi32(u[ 4], k__DCT_CONST_ROUNDING); - v[ 5] = _mm_add_epi32(u[ 5], k__DCT_CONST_ROUNDING); - v[ 6] = _mm_add_epi32(u[ 6], k__DCT_CONST_ROUNDING); - v[ 7] = _mm_add_epi32(u[ 7], k__DCT_CONST_ROUNDING); - v[ 8] = _mm_add_epi32(u[ 8], k__DCT_CONST_ROUNDING); - v[ 9] = _mm_add_epi32(u[ 9], k__DCT_CONST_ROUNDING); - v[10] = _mm_add_epi32(u[10], k__DCT_CONST_ROUNDING); - v[11] = _mm_add_epi32(u[11], k__DCT_CONST_ROUNDING); - v[12] = _mm_add_epi32(u[12], k__DCT_CONST_ROUNDING); - v[13] = _mm_add_epi32(u[13], k__DCT_CONST_ROUNDING); - v[14] = _mm_add_epi32(u[14], k__DCT_CONST_ROUNDING); - v[15] = _mm_add_epi32(u[15], k__DCT_CONST_ROUNDING); - - u[ 0] = _mm_srai_epi32(v[ 0], DCT_CONST_BITS); - u[ 1] = _mm_srai_epi32(v[ 1], DCT_CONST_BITS); - u[ 2] = _mm_srai_epi32(v[ 2], DCT_CONST_BITS); - u[ 3] = _mm_srai_epi32(v[ 3], DCT_CONST_BITS); - u[ 4] = _mm_srai_epi32(v[ 4], DCT_CONST_BITS); - u[ 5] = _mm_srai_epi32(v[ 5], DCT_CONST_BITS); - u[ 6] = _mm_srai_epi32(v[ 6], DCT_CONST_BITS); - u[ 7] = _mm_srai_epi32(v[ 7], DCT_CONST_BITS); - u[ 8] = _mm_srai_epi32(v[ 8], DCT_CONST_BITS); - u[ 9] = _mm_srai_epi32(v[ 9], DCT_CONST_BITS); - u[10] = _mm_srai_epi32(v[10], DCT_CONST_BITS); - u[11] = _mm_srai_epi32(v[11], DCT_CONST_BITS); - u[12] = _mm_srai_epi32(v[12], DCT_CONST_BITS); - u[13] = _mm_srai_epi32(v[13], DCT_CONST_BITS); - u[14] = _mm_srai_epi32(v[14], DCT_CONST_BITS); - u[15] = _mm_srai_epi32(v[15], DCT_CONST_BITS); - - v[ 0] = _mm_cmplt_epi32(u[ 0], kZero); - v[ 1] = _mm_cmplt_epi32(u[ 1], kZero); - v[ 2] = _mm_cmplt_epi32(u[ 2], kZero); - v[ 3] = _mm_cmplt_epi32(u[ 3], kZero); - v[ 4] = _mm_cmplt_epi32(u[ 4], kZero); - v[ 5] = _mm_cmplt_epi32(u[ 5], kZero); - v[ 6] = _mm_cmplt_epi32(u[ 6], kZero); - v[ 7] = _mm_cmplt_epi32(u[ 7], kZero); - v[ 8] = _mm_cmplt_epi32(u[ 8], kZero); - v[ 9] = _mm_cmplt_epi32(u[ 9], kZero); - v[10] = _mm_cmplt_epi32(u[10], kZero); - v[11] = _mm_cmplt_epi32(u[11], kZero); - v[12] = _mm_cmplt_epi32(u[12], kZero); - v[13] = _mm_cmplt_epi32(u[13], kZero); - v[14] = _mm_cmplt_epi32(u[14], kZero); - v[15] = _mm_cmplt_epi32(u[15], kZero); - - u[ 0] = _mm_sub_epi32(u[ 0], v[ 0]); - u[ 1] = _mm_sub_epi32(u[ 1], v[ 1]); - u[ 2] = _mm_sub_epi32(u[ 2], v[ 2]); - u[ 3] = _mm_sub_epi32(u[ 3], v[ 3]); - u[ 4] = _mm_sub_epi32(u[ 4], v[ 4]); - u[ 5] = _mm_sub_epi32(u[ 5], v[ 5]); - u[ 6] = _mm_sub_epi32(u[ 6], v[ 6]); - u[ 7] = _mm_sub_epi32(u[ 7], v[ 7]); - u[ 8] = _mm_sub_epi32(u[ 8], v[ 8]); - u[ 9] = _mm_sub_epi32(u[ 9], v[ 9]); - u[10] = _mm_sub_epi32(u[10], v[10]); - u[11] = _mm_sub_epi32(u[11], v[11]); - u[12] = _mm_sub_epi32(u[12], v[12]); - u[13] = _mm_sub_epi32(u[13], v[13]); - u[14] = _mm_sub_epi32(u[14], v[14]); - u[15] = _mm_sub_epi32(u[15], v[15]); - - v[0] = _mm_add_epi32(u[0], K32One); - v[1] = _mm_add_epi32(u[1], K32One); - v[2] = _mm_add_epi32(u[2], K32One); - v[3] = _mm_add_epi32(u[3], K32One); - v[4] = _mm_add_epi32(u[4], K32One); - v[5] = _mm_add_epi32(u[5], K32One); - v[6] = _mm_add_epi32(u[6], K32One); - v[7] = _mm_add_epi32(u[7], K32One); - v[8] = _mm_add_epi32(u[8], K32One); - v[9] = _mm_add_epi32(u[9], K32One); - v[10] = _mm_add_epi32(u[10], K32One); - v[11] = _mm_add_epi32(u[11], K32One); - v[12] = _mm_add_epi32(u[12], K32One); - v[13] = _mm_add_epi32(u[13], K32One); - v[14] = _mm_add_epi32(u[14], K32One); - v[15] = _mm_add_epi32(u[15], K32One); - - u[0] = _mm_srai_epi32(v[0], 2); - u[1] = _mm_srai_epi32(v[1], 2); - u[2] = _mm_srai_epi32(v[2], 2); - u[3] = _mm_srai_epi32(v[3], 2); - u[4] = _mm_srai_epi32(v[4], 2); - u[5] = _mm_srai_epi32(v[5], 2); - u[6] = _mm_srai_epi32(v[6], 2); - u[7] = _mm_srai_epi32(v[7], 2); - u[8] = _mm_srai_epi32(v[8], 2); - u[9] = _mm_srai_epi32(v[9], 2); - u[10] = _mm_srai_epi32(v[10], 2); - u[11] = _mm_srai_epi32(v[11], 2); - u[12] = _mm_srai_epi32(v[12], 2); - u[13] = _mm_srai_epi32(v[13], 2); - u[14] = _mm_srai_epi32(v[14], 2); - u[15] = _mm_srai_epi32(v[15], 2); - - out[ 5] = _mm_packs_epi32(u[0], u[1]); - out[21] = _mm_packs_epi32(u[2], u[3]); - out[13] = _mm_packs_epi32(u[4], u[5]); - out[29] = _mm_packs_epi32(u[6], u[7]); - out[ 3] = _mm_packs_epi32(u[8], u[9]); - out[19] = _mm_packs_epi32(u[10], u[11]); - out[11] = _mm_packs_epi32(u[12], u[13]); - out[27] = _mm_packs_epi32(u[14], u[15]); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x8(&out[5], &out[21], &out[13], - &out[29], &out[3], &out[19], - &out[11], &out[27]); - if (overflow) { - HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - } -#endif // FDCT32x32_HIGH_PRECISION - // Transpose the results, do it as four 8x8 transposes. - { - int transpose_block; - int16_t *output0 = &intermediate[column_start * 32]; - tran_low_t *output1 = &output_org[column_start * 32]; - for (transpose_block = 0; transpose_block < 4; ++transpose_block) { - __m128i *this_out = &out[8 * transpose_block]; - // 00 01 02 03 04 05 06 07 - // 10 11 12 13 14 15 16 17 - // 20 21 22 23 24 25 26 27 - // 30 31 32 33 34 35 36 37 - // 40 41 42 43 44 45 46 47 - // 50 51 52 53 54 55 56 57 - // 60 61 62 63 64 65 66 67 - // 70 71 72 73 74 75 76 77 - const __m128i tr0_0 = _mm_unpacklo_epi16(this_out[0], this_out[1]); - const __m128i tr0_1 = _mm_unpacklo_epi16(this_out[2], this_out[3]); - const __m128i tr0_2 = _mm_unpackhi_epi16(this_out[0], this_out[1]); - const __m128i tr0_3 = _mm_unpackhi_epi16(this_out[2], this_out[3]); - const __m128i tr0_4 = _mm_unpacklo_epi16(this_out[4], this_out[5]); - const __m128i tr0_5 = _mm_unpacklo_epi16(this_out[6], this_out[7]); - const __m128i tr0_6 = _mm_unpackhi_epi16(this_out[4], this_out[5]); - const __m128i tr0_7 = _mm_unpackhi_epi16(this_out[6], this_out[7]); - // 00 10 01 11 02 12 03 13 - // 20 30 21 31 22 32 23 33 - // 04 14 05 15 06 16 07 17 - // 24 34 25 35 26 36 27 37 - // 40 50 41 51 42 52 43 53 - // 60 70 61 71 62 72 63 73 - // 54 54 55 55 56 56 57 57 - // 64 74 65 75 66 76 67 77 - const __m128i tr1_0 = _mm_unpacklo_epi32(tr0_0, tr0_1); - const __m128i tr1_1 = _mm_unpacklo_epi32(tr0_2, tr0_3); - const __m128i tr1_2 = _mm_unpackhi_epi32(tr0_0, tr0_1); - const __m128i tr1_3 = _mm_unpackhi_epi32(tr0_2, tr0_3); - const __m128i tr1_4 = _mm_unpacklo_epi32(tr0_4, tr0_5); - const __m128i tr1_5 = _mm_unpacklo_epi32(tr0_6, tr0_7); - const __m128i tr1_6 = _mm_unpackhi_epi32(tr0_4, tr0_5); - const __m128i tr1_7 = _mm_unpackhi_epi32(tr0_6, tr0_7); - // 00 10 20 30 01 11 21 31 - // 40 50 60 70 41 51 61 71 - // 02 12 22 32 03 13 23 33 - // 42 52 62 72 43 53 63 73 - // 04 14 24 34 05 15 21 36 - // 44 54 64 74 45 55 61 76 - // 06 16 26 36 07 17 27 37 - // 46 56 66 76 47 57 67 77 - __m128i tr2_0 = _mm_unpacklo_epi64(tr1_0, tr1_4); - __m128i tr2_1 = _mm_unpackhi_epi64(tr1_0, tr1_4); - __m128i tr2_2 = _mm_unpacklo_epi64(tr1_2, tr1_6); - __m128i tr2_3 = _mm_unpackhi_epi64(tr1_2, tr1_6); - __m128i tr2_4 = _mm_unpacklo_epi64(tr1_1, tr1_5); - __m128i tr2_5 = _mm_unpackhi_epi64(tr1_1, tr1_5); - __m128i tr2_6 = _mm_unpacklo_epi64(tr1_3, tr1_7); - __m128i tr2_7 = _mm_unpackhi_epi64(tr1_3, tr1_7); - // 00 10 20 30 40 50 60 70 - // 01 11 21 31 41 51 61 71 - // 02 12 22 32 42 52 62 72 - // 03 13 23 33 43 53 63 73 - // 04 14 24 34 44 54 64 74 - // 05 15 25 35 45 55 65 75 - // 06 16 26 36 46 56 66 76 - // 07 17 27 37 47 57 67 77 - if (0 == pass) { - // output[j] = (output[j] + 1 + (output[j] > 0)) >> 2; - // TODO(cd): see quality impact of only doing - // output[j] = (output[j] + 1) >> 2; - // which would remove the code between here ... - __m128i tr2_0_0 = _mm_cmpgt_epi16(tr2_0, kZero); - __m128i tr2_1_0 = _mm_cmpgt_epi16(tr2_1, kZero); - __m128i tr2_2_0 = _mm_cmpgt_epi16(tr2_2, kZero); - __m128i tr2_3_0 = _mm_cmpgt_epi16(tr2_3, kZero); - __m128i tr2_4_0 = _mm_cmpgt_epi16(tr2_4, kZero); - __m128i tr2_5_0 = _mm_cmpgt_epi16(tr2_5, kZero); - __m128i tr2_6_0 = _mm_cmpgt_epi16(tr2_6, kZero); - __m128i tr2_7_0 = _mm_cmpgt_epi16(tr2_7, kZero); - tr2_0 = _mm_sub_epi16(tr2_0, tr2_0_0); - tr2_1 = _mm_sub_epi16(tr2_1, tr2_1_0); - tr2_2 = _mm_sub_epi16(tr2_2, tr2_2_0); - tr2_3 = _mm_sub_epi16(tr2_3, tr2_3_0); - tr2_4 = _mm_sub_epi16(tr2_4, tr2_4_0); - tr2_5 = _mm_sub_epi16(tr2_5, tr2_5_0); - tr2_6 = _mm_sub_epi16(tr2_6, tr2_6_0); - tr2_7 = _mm_sub_epi16(tr2_7, tr2_7_0); - // ... and here. - // PS: also change code in vp9/encoder/vp9_dct.c - tr2_0 = _mm_add_epi16(tr2_0, kOne); - tr2_1 = _mm_add_epi16(tr2_1, kOne); - tr2_2 = _mm_add_epi16(tr2_2, kOne); - tr2_3 = _mm_add_epi16(tr2_3, kOne); - tr2_4 = _mm_add_epi16(tr2_4, kOne); - tr2_5 = _mm_add_epi16(tr2_5, kOne); - tr2_6 = _mm_add_epi16(tr2_6, kOne); - tr2_7 = _mm_add_epi16(tr2_7, kOne); - tr2_0 = _mm_srai_epi16(tr2_0, 2); - tr2_1 = _mm_srai_epi16(tr2_1, 2); - tr2_2 = _mm_srai_epi16(tr2_2, 2); - tr2_3 = _mm_srai_epi16(tr2_3, 2); - tr2_4 = _mm_srai_epi16(tr2_4, 2); - tr2_5 = _mm_srai_epi16(tr2_5, 2); - tr2_6 = _mm_srai_epi16(tr2_6, 2); - tr2_7 = _mm_srai_epi16(tr2_7, 2); - } - // Note: even though all these stores are aligned, using the aligned - // intrinsic make the code slightly slower. - if (pass == 0) { - _mm_storeu_si128((__m128i *)(output0 + 0 * 32), tr2_0); - _mm_storeu_si128((__m128i *)(output0 + 1 * 32), tr2_1); - _mm_storeu_si128((__m128i *)(output0 + 2 * 32), tr2_2); - _mm_storeu_si128((__m128i *)(output0 + 3 * 32), tr2_3); - _mm_storeu_si128((__m128i *)(output0 + 4 * 32), tr2_4); - _mm_storeu_si128((__m128i *)(output0 + 5 * 32), tr2_5); - _mm_storeu_si128((__m128i *)(output0 + 6 * 32), tr2_6); - _mm_storeu_si128((__m128i *)(output0 + 7 * 32), tr2_7); - // Process next 8x8 - output0 += 8; - } else { - storeu_output(&tr2_0, (output1 + 0 * 32)); - storeu_output(&tr2_1, (output1 + 1 * 32)); - storeu_output(&tr2_2, (output1 + 2 * 32)); - storeu_output(&tr2_3, (output1 + 3 * 32)); - storeu_output(&tr2_4, (output1 + 4 * 32)); - storeu_output(&tr2_5, (output1 + 5 * 32)); - storeu_output(&tr2_6, (output1 + 6 * 32)); - storeu_output(&tr2_7, (output1 + 7 * 32)); - // Process next 8x8 - output1 += 8; - } - } - } - } - } -} // NOLINT - -#undef ADD_EPI16 -#undef SUB_EPI16 -#undef HIGH_FDCT32x32_2D_C -#undef HIGH_FDCT32x32_2D_ROWS_C diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct_avx2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct_avx2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct_avx2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct_avx2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include // AVX2 -#include "vp9/common/vp9_idct.h" // for cospi constants -#include "vpx_ports/mem.h" - - -#define FDCT32x32_2D_AVX2 vp9_fdct32x32_rd_avx2 -#define FDCT32x32_HIGH_PRECISION 0 -#include "vp9/encoder/x86/vp9_dct32x32_avx2.c" -#undef FDCT32x32_2D_AVX2 -#undef FDCT32x32_HIGH_PRECISION - -#define FDCT32x32_2D_AVX2 vp9_fdct32x32_avx2 -#define FDCT32x32_HIGH_PRECISION 1 -#include "vp9/encoder/x86/vp9_dct32x32_avx2.c" // NOLINT -#undef FDCT32x32_2D_AVX2 -#undef FDCT32x32_HIGH_PRECISION diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct_impl_sse2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct_impl_sse2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct_impl_sse2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct_impl_sse2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1022 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include // SSE2 -#include "vp9/common/vp9_idct.h" // for cospi constants -#include "vp9/encoder/vp9_dct.h" -#include "vp9/encoder/x86/vp9_dct_sse2.h" -#include "vpx_ports/mem.h" - -#if DCT_HIGH_BIT_DEPTH -#define ADD_EPI16 _mm_adds_epi16 -#define SUB_EPI16 _mm_subs_epi16 - -#else -#define ADD_EPI16 _mm_add_epi16 -#define SUB_EPI16 _mm_sub_epi16 -#endif - -void FDCT4x4_2D(const int16_t *input, tran_low_t *output, int stride) { - // This 2D transform implements 4 vertical 1D transforms followed - // by 4 horizontal 1D transforms. The multiplies and adds are as given - // by Chen, Smith and Fralick ('77). The commands for moving the data - // around have been minimized by hand. - // For the purposes of the comments, the 16 inputs are referred to at i0 - // through iF (in raster order), intermediate variables are a0, b0, c0 - // through f, and correspond to the in-place computations mapped to input - // locations. The outputs, o0 through oF are labeled according to the - // output locations. - - // Constants - // These are the coefficients used for the multiplies. - // In the comments, pN means cos(N pi /64) and mN is -cos(N pi /64), - // where cospi_N_64 = cos(N pi /64) - const __m128i k__cospi_A = _mm_setr_epi16(cospi_16_64, cospi_16_64, - cospi_16_64, cospi_16_64, - cospi_16_64, -cospi_16_64, - cospi_16_64, -cospi_16_64); - const __m128i k__cospi_B = _mm_setr_epi16(cospi_16_64, -cospi_16_64, - cospi_16_64, -cospi_16_64, - cospi_16_64, cospi_16_64, - cospi_16_64, cospi_16_64); - const __m128i k__cospi_C = _mm_setr_epi16(cospi_8_64, cospi_24_64, - cospi_8_64, cospi_24_64, - cospi_24_64, -cospi_8_64, - cospi_24_64, -cospi_8_64); - const __m128i k__cospi_D = _mm_setr_epi16(cospi_24_64, -cospi_8_64, - cospi_24_64, -cospi_8_64, - cospi_8_64, cospi_24_64, - cospi_8_64, cospi_24_64); - const __m128i k__cospi_E = _mm_setr_epi16(cospi_16_64, cospi_16_64, - cospi_16_64, cospi_16_64, - cospi_16_64, cospi_16_64, - cospi_16_64, cospi_16_64); - const __m128i k__cospi_F = _mm_setr_epi16(cospi_16_64, -cospi_16_64, - cospi_16_64, -cospi_16_64, - cospi_16_64, -cospi_16_64, - cospi_16_64, -cospi_16_64); - const __m128i k__cospi_G = _mm_setr_epi16(cospi_8_64, cospi_24_64, - cospi_8_64, cospi_24_64, - -cospi_8_64, -cospi_24_64, - -cospi_8_64, -cospi_24_64); - const __m128i k__cospi_H = _mm_setr_epi16(cospi_24_64, -cospi_8_64, - cospi_24_64, -cospi_8_64, - -cospi_24_64, cospi_8_64, - -cospi_24_64, cospi_8_64); - - const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING); - // This second rounding constant saves doing some extra adds at the end - const __m128i k__DCT_CONST_ROUNDING2 = _mm_set1_epi32(DCT_CONST_ROUNDING - +(DCT_CONST_ROUNDING << 1)); - const int DCT_CONST_BITS2 = DCT_CONST_BITS + 2; - const __m128i k__nonzero_bias_a = _mm_setr_epi16(0, 1, 1, 1, 1, 1, 1, 1); - const __m128i k__nonzero_bias_b = _mm_setr_epi16(1, 0, 0, 0, 0, 0, 0, 0); - __m128i in0, in1; -#if DCT_HIGH_BIT_DEPTH - __m128i cmp0, cmp1; - int test, overflow; -#endif - - // Load inputs. - in0 = _mm_loadl_epi64((const __m128i *)(input + 0 * stride)); - in1 = _mm_loadl_epi64((const __m128i *)(input + 1 * stride)); - in1 = _mm_unpacklo_epi64(in1, _mm_loadl_epi64((const __m128i *) - (input + 2 * stride))); - in0 = _mm_unpacklo_epi64(in0, _mm_loadl_epi64((const __m128i *) - (input + 3 * stride))); - // in0 = [i0 i1 i2 i3 iC iD iE iF] - // in1 = [i4 i5 i6 i7 i8 i9 iA iB] -#if DCT_HIGH_BIT_DEPTH - // Check inputs small enough to use optimised code - cmp0 = _mm_xor_si128(_mm_cmpgt_epi16(in0, _mm_set1_epi16(0x3ff)), - _mm_cmplt_epi16(in0, _mm_set1_epi16(0xfc00))); - cmp1 = _mm_xor_si128(_mm_cmpgt_epi16(in1, _mm_set1_epi16(0x3ff)), - _mm_cmplt_epi16(in1, _mm_set1_epi16(0xfc00))); - test = _mm_movemask_epi8(_mm_or_si128(cmp0, cmp1)); - if (test) { - vp9_highbd_fdct4x4_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - - // multiply by 16 to give some extra precision - in0 = _mm_slli_epi16(in0, 4); - in1 = _mm_slli_epi16(in1, 4); - // if (i == 0 && input[0]) input[0] += 1; - // add 1 to the upper left pixel if it is non-zero, which helps reduce - // the round-trip error - { - // The mask will only contain whether the first value is zero, all - // other comparison will fail as something shifted by 4 (above << 4) - // can never be equal to one. To increment in the non-zero case, we - // add the mask and one for the first element: - // - if zero, mask = -1, v = v - 1 + 1 = v - // - if non-zero, mask = 0, v = v + 0 + 1 = v + 1 - __m128i mask = _mm_cmpeq_epi16(in0, k__nonzero_bias_a); - in0 = _mm_add_epi16(in0, mask); - in0 = _mm_add_epi16(in0, k__nonzero_bias_b); - } - // There are 4 total stages, alternating between an add/subtract stage - // followed by an multiply-and-add stage. - { - // Stage 1: Add/subtract - - // in0 = [i0 i1 i2 i3 iC iD iE iF] - // in1 = [i4 i5 i6 i7 i8 i9 iA iB] - const __m128i r0 = _mm_unpacklo_epi16(in0, in1); - const __m128i r1 = _mm_unpackhi_epi16(in0, in1); - // r0 = [i0 i4 i1 i5 i2 i6 i3 i7] - // r1 = [iC i8 iD i9 iE iA iF iB] - const __m128i r2 = _mm_shuffle_epi32(r0, 0xB4); - const __m128i r3 = _mm_shuffle_epi32(r1, 0xB4); - // r2 = [i0 i4 i1 i5 i3 i7 i2 i6] - // r3 = [iC i8 iD i9 iF iB iE iA] - - const __m128i t0 = _mm_add_epi16(r2, r3); - const __m128i t1 = _mm_sub_epi16(r2, r3); - // t0 = [a0 a4 a1 a5 a3 a7 a2 a6] - // t1 = [aC a8 aD a9 aF aB aE aA] - - // Stage 2: multiply by constants (which gets us into 32 bits). - // The constants needed here are: - // k__cospi_A = [p16 p16 p16 p16 p16 m16 p16 m16] - // k__cospi_B = [p16 m16 p16 m16 p16 p16 p16 p16] - // k__cospi_C = [p08 p24 p08 p24 p24 m08 p24 m08] - // k__cospi_D = [p24 m08 p24 m08 p08 p24 p08 p24] - const __m128i u0 = _mm_madd_epi16(t0, k__cospi_A); - const __m128i u2 = _mm_madd_epi16(t0, k__cospi_B); - const __m128i u1 = _mm_madd_epi16(t1, k__cospi_C); - const __m128i u3 = _mm_madd_epi16(t1, k__cospi_D); - // Then add and right-shift to get back to 16-bit range - const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING); - const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING); - const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING); - const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING); - const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS); - const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS); - const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS); - const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS); - // w0 = [b0 b1 b7 b6] - // w1 = [b8 b9 bF bE] - // w2 = [b4 b5 b3 b2] - // w3 = [bC bD bB bA] - const __m128i x0 = _mm_packs_epi32(w0, w1); - const __m128i x1 = _mm_packs_epi32(w2, w3); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x2(&x0, &x1); - if (overflow) { - vp9_highbd_fdct4x4_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - // x0 = [b0 b1 b7 b6 b8 b9 bF bE] - // x1 = [b4 b5 b3 b2 bC bD bB bA] - in0 = _mm_shuffle_epi32(x0, 0xD8); - in1 = _mm_shuffle_epi32(x1, 0x8D); - // in0 = [b0 b1 b8 b9 b7 b6 bF bE] - // in1 = [b3 b2 bB bA b4 b5 bC bD] - } - { - // vertical DCTs finished. Now we do the horizontal DCTs. - // Stage 3: Add/subtract - - const __m128i t0 = ADD_EPI16(in0, in1); - const __m128i t1 = SUB_EPI16(in0, in1); - // t0 = [c0 c1 c8 c9 c4 c5 cC cD] - // t1 = [c3 c2 cB cA -c7 -c6 -cF -cE] -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x2(&t0, &t1); - if (overflow) { - vp9_highbd_fdct4x4_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - - // Stage 4: multiply by constants (which gets us into 32 bits). - { - // The constants needed here are: - // k__cospi_E = [p16 p16 p16 p16 p16 p16 p16 p16] - // k__cospi_F = [p16 m16 p16 m16 p16 m16 p16 m16] - // k__cospi_G = [p08 p24 p08 p24 m08 m24 m08 m24] - // k__cospi_H = [p24 m08 p24 m08 m24 p08 m24 p08] - const __m128i u0 = _mm_madd_epi16(t0, k__cospi_E); - const __m128i u1 = _mm_madd_epi16(t0, k__cospi_F); - const __m128i u2 = _mm_madd_epi16(t1, k__cospi_G); - const __m128i u3 = _mm_madd_epi16(t1, k__cospi_H); - // Then add and right-shift to get back to 16-bit range - // but this combines the final right-shift as well to save operations - // This unusual rounding operations is to maintain bit-accurate - // compatibility with the c version of this function which has two - // rounding steps in a row. - const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING2); - const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING2); - const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING2); - const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING2); - const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS2); - const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS2); - const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS2); - const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS2); - // w0 = [o0 o4 o8 oC] - // w1 = [o2 o6 oA oE] - // w2 = [o1 o5 o9 oD] - // w3 = [o3 o7 oB oF] - // remember the o's are numbered according to the correct output location - const __m128i x0 = _mm_packs_epi32(w0, w1); - const __m128i x1 = _mm_packs_epi32(w2, w3); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x2(&x0, &x1); - if (overflow) { - vp9_highbd_fdct4x4_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - { - // x0 = [o0 o4 o8 oC o2 o6 oA oE] - // x1 = [o1 o5 o9 oD o3 o7 oB oF] - const __m128i y0 = _mm_unpacklo_epi16(x0, x1); - const __m128i y1 = _mm_unpackhi_epi16(x0, x1); - // y0 = [o0 o1 o4 o5 o8 o9 oC oD] - // y1 = [o2 o3 o6 o7 oA oB oE oF] - in0 = _mm_unpacklo_epi32(y0, y1); - // in0 = [o0 o1 o2 o3 o4 o5 o6 o7] - in1 = _mm_unpackhi_epi32(y0, y1); - // in1 = [o8 o9 oA oB oC oD oE oF] - } - } - } - // Post-condition (v + 1) >> 2 is now incorporated into previous - // add and right-shift commands. Only 2 store instructions needed - // because we are using the fact that 1/3 are stored just after 0/2. - storeu_output(&in0, output + 0 * 4); - storeu_output(&in1, output + 2 * 4); -} - - -void FDCT8x8_2D(const int16_t *input, tran_low_t *output, int stride) { - int pass; - // Constants - // When we use them, in one case, they are all the same. In all others - // it's a pair of them that we need to repeat four times. This is done - // by constructing the 32 bit constant corresponding to that pair. - const __m128i k__cospi_p16_p16 = _mm_set1_epi16(cospi_16_64); - const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64); - const __m128i k__cospi_p24_p08 = pair_set_epi16(cospi_24_64, cospi_8_64); - const __m128i k__cospi_m08_p24 = pair_set_epi16(-cospi_8_64, cospi_24_64); - const __m128i k__cospi_p28_p04 = pair_set_epi16(cospi_28_64, cospi_4_64); - const __m128i k__cospi_m04_p28 = pair_set_epi16(-cospi_4_64, cospi_28_64); - const __m128i k__cospi_p12_p20 = pair_set_epi16(cospi_12_64, cospi_20_64); - const __m128i k__cospi_m20_p12 = pair_set_epi16(-cospi_20_64, cospi_12_64); - const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING); -#if DCT_HIGH_BIT_DEPTH - int overflow; -#endif - // Load input - __m128i in0 = _mm_load_si128((const __m128i *)(input + 0 * stride)); - __m128i in1 = _mm_load_si128((const __m128i *)(input + 1 * stride)); - __m128i in2 = _mm_load_si128((const __m128i *)(input + 2 * stride)); - __m128i in3 = _mm_load_si128((const __m128i *)(input + 3 * stride)); - __m128i in4 = _mm_load_si128((const __m128i *)(input + 4 * stride)); - __m128i in5 = _mm_load_si128((const __m128i *)(input + 5 * stride)); - __m128i in6 = _mm_load_si128((const __m128i *)(input + 6 * stride)); - __m128i in7 = _mm_load_si128((const __m128i *)(input + 7 * stride)); - // Pre-condition input (shift by two) - in0 = _mm_slli_epi16(in0, 2); - in1 = _mm_slli_epi16(in1, 2); - in2 = _mm_slli_epi16(in2, 2); - in3 = _mm_slli_epi16(in3, 2); - in4 = _mm_slli_epi16(in4, 2); - in5 = _mm_slli_epi16(in5, 2); - in6 = _mm_slli_epi16(in6, 2); - in7 = _mm_slli_epi16(in7, 2); - - // We do two passes, first the columns, then the rows. The results of the - // first pass are transposed so that the same column code can be reused. The - // results of the second pass are also transposed so that the rows (processed - // as columns) are put back in row positions. - for (pass = 0; pass < 2; pass++) { - // To store results of each pass before the transpose. - __m128i res0, res1, res2, res3, res4, res5, res6, res7; - // Add/subtract - const __m128i q0 = ADD_EPI16(in0, in7); - const __m128i q1 = ADD_EPI16(in1, in6); - const __m128i q2 = ADD_EPI16(in2, in5); - const __m128i q3 = ADD_EPI16(in3, in4); - const __m128i q4 = SUB_EPI16(in3, in4); - const __m128i q5 = SUB_EPI16(in2, in5); - const __m128i q6 = SUB_EPI16(in1, in6); - const __m128i q7 = SUB_EPI16(in0, in7); -#if DCT_HIGH_BIT_DEPTH - if (pass == 1) { - overflow = check_epi16_overflow_x8(&q0, &q1, &q2, &q3, - &q4, &q5, &q6, &q7); - if (overflow) { - vp9_highbd_fdct8x8_c(input, output, stride); - return; - } - } -#endif // DCT_HIGH_BIT_DEPTH - // Work on first four results - { - // Add/subtract - const __m128i r0 = ADD_EPI16(q0, q3); - const __m128i r1 = ADD_EPI16(q1, q2); - const __m128i r2 = SUB_EPI16(q1, q2); - const __m128i r3 = SUB_EPI16(q0, q3); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x4(&r0, &r1, &r2, &r3); - if (overflow) { - vp9_highbd_fdct8x8_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - // Interleave to do the multiply by constants which gets us into 32bits - { - const __m128i t0 = _mm_unpacklo_epi16(r0, r1); - const __m128i t1 = _mm_unpackhi_epi16(r0, r1); - const __m128i t2 = _mm_unpacklo_epi16(r2, r3); - const __m128i t3 = _mm_unpackhi_epi16(r2, r3); - const __m128i u0 = _mm_madd_epi16(t0, k__cospi_p16_p16); - const __m128i u1 = _mm_madd_epi16(t1, k__cospi_p16_p16); - const __m128i u2 = _mm_madd_epi16(t0, k__cospi_p16_m16); - const __m128i u3 = _mm_madd_epi16(t1, k__cospi_p16_m16); - const __m128i u4 = _mm_madd_epi16(t2, k__cospi_p24_p08); - const __m128i u5 = _mm_madd_epi16(t3, k__cospi_p24_p08); - const __m128i u6 = _mm_madd_epi16(t2, k__cospi_m08_p24); - const __m128i u7 = _mm_madd_epi16(t3, k__cospi_m08_p24); - // dct_const_round_shift - const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING); - const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING); - const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING); - const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING); - const __m128i v4 = _mm_add_epi32(u4, k__DCT_CONST_ROUNDING); - const __m128i v5 = _mm_add_epi32(u5, k__DCT_CONST_ROUNDING); - const __m128i v6 = _mm_add_epi32(u6, k__DCT_CONST_ROUNDING); - const __m128i v7 = _mm_add_epi32(u7, k__DCT_CONST_ROUNDING); - const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS); - const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS); - const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS); - const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS); - const __m128i w4 = _mm_srai_epi32(v4, DCT_CONST_BITS); - const __m128i w5 = _mm_srai_epi32(v5, DCT_CONST_BITS); - const __m128i w6 = _mm_srai_epi32(v6, DCT_CONST_BITS); - const __m128i w7 = _mm_srai_epi32(v7, DCT_CONST_BITS); - // Combine - res0 = _mm_packs_epi32(w0, w1); - res4 = _mm_packs_epi32(w2, w3); - res2 = _mm_packs_epi32(w4, w5); - res6 = _mm_packs_epi32(w6, w7); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x4(&res0, &res4, &res2, &res6); - if (overflow) { - vp9_highbd_fdct8x8_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - } - // Work on next four results - { - // Interleave to do the multiply by constants which gets us into 32bits - const __m128i d0 = _mm_unpacklo_epi16(q6, q5); - const __m128i d1 = _mm_unpackhi_epi16(q6, q5); - const __m128i e0 = _mm_madd_epi16(d0, k__cospi_p16_m16); - const __m128i e1 = _mm_madd_epi16(d1, k__cospi_p16_m16); - const __m128i e2 = _mm_madd_epi16(d0, k__cospi_p16_p16); - const __m128i e3 = _mm_madd_epi16(d1, k__cospi_p16_p16); - // dct_const_round_shift - const __m128i f0 = _mm_add_epi32(e0, k__DCT_CONST_ROUNDING); - const __m128i f1 = _mm_add_epi32(e1, k__DCT_CONST_ROUNDING); - const __m128i f2 = _mm_add_epi32(e2, k__DCT_CONST_ROUNDING); - const __m128i f3 = _mm_add_epi32(e3, k__DCT_CONST_ROUNDING); - const __m128i s0 = _mm_srai_epi32(f0, DCT_CONST_BITS); - const __m128i s1 = _mm_srai_epi32(f1, DCT_CONST_BITS); - const __m128i s2 = _mm_srai_epi32(f2, DCT_CONST_BITS); - const __m128i s3 = _mm_srai_epi32(f3, DCT_CONST_BITS); - // Combine - const __m128i r0 = _mm_packs_epi32(s0, s1); - const __m128i r1 = _mm_packs_epi32(s2, s3); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x2(&r0, &r1); - if (overflow) { - vp9_highbd_fdct8x8_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - { - // Add/subtract - const __m128i x0 = ADD_EPI16(q4, r0); - const __m128i x1 = SUB_EPI16(q4, r0); - const __m128i x2 = SUB_EPI16(q7, r1); - const __m128i x3 = ADD_EPI16(q7, r1); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x4(&x0, &x1, &x2, &x3); - if (overflow) { - vp9_highbd_fdct8x8_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - // Interleave to do the multiply by constants which gets us into 32bits - { - const __m128i t0 = _mm_unpacklo_epi16(x0, x3); - const __m128i t1 = _mm_unpackhi_epi16(x0, x3); - const __m128i t2 = _mm_unpacklo_epi16(x1, x2); - const __m128i t3 = _mm_unpackhi_epi16(x1, x2); - const __m128i u0 = _mm_madd_epi16(t0, k__cospi_p28_p04); - const __m128i u1 = _mm_madd_epi16(t1, k__cospi_p28_p04); - const __m128i u2 = _mm_madd_epi16(t0, k__cospi_m04_p28); - const __m128i u3 = _mm_madd_epi16(t1, k__cospi_m04_p28); - const __m128i u4 = _mm_madd_epi16(t2, k__cospi_p12_p20); - const __m128i u5 = _mm_madd_epi16(t3, k__cospi_p12_p20); - const __m128i u6 = _mm_madd_epi16(t2, k__cospi_m20_p12); - const __m128i u7 = _mm_madd_epi16(t3, k__cospi_m20_p12); - // dct_const_round_shift - const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING); - const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING); - const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING); - const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING); - const __m128i v4 = _mm_add_epi32(u4, k__DCT_CONST_ROUNDING); - const __m128i v5 = _mm_add_epi32(u5, k__DCT_CONST_ROUNDING); - const __m128i v6 = _mm_add_epi32(u6, k__DCT_CONST_ROUNDING); - const __m128i v7 = _mm_add_epi32(u7, k__DCT_CONST_ROUNDING); - const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS); - const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS); - const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS); - const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS); - const __m128i w4 = _mm_srai_epi32(v4, DCT_CONST_BITS); - const __m128i w5 = _mm_srai_epi32(v5, DCT_CONST_BITS); - const __m128i w6 = _mm_srai_epi32(v6, DCT_CONST_BITS); - const __m128i w7 = _mm_srai_epi32(v7, DCT_CONST_BITS); - // Combine - res1 = _mm_packs_epi32(w0, w1); - res7 = _mm_packs_epi32(w2, w3); - res5 = _mm_packs_epi32(w4, w5); - res3 = _mm_packs_epi32(w6, w7); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x4(&res1, &res7, &res5, &res3); - if (overflow) { - vp9_highbd_fdct8x8_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - } - } - // Transpose the 8x8. - { - // 00 01 02 03 04 05 06 07 - // 10 11 12 13 14 15 16 17 - // 20 21 22 23 24 25 26 27 - // 30 31 32 33 34 35 36 37 - // 40 41 42 43 44 45 46 47 - // 50 51 52 53 54 55 56 57 - // 60 61 62 63 64 65 66 67 - // 70 71 72 73 74 75 76 77 - const __m128i tr0_0 = _mm_unpacklo_epi16(res0, res1); - const __m128i tr0_1 = _mm_unpacklo_epi16(res2, res3); - const __m128i tr0_2 = _mm_unpackhi_epi16(res0, res1); - const __m128i tr0_3 = _mm_unpackhi_epi16(res2, res3); - const __m128i tr0_4 = _mm_unpacklo_epi16(res4, res5); - const __m128i tr0_5 = _mm_unpacklo_epi16(res6, res7); - const __m128i tr0_6 = _mm_unpackhi_epi16(res4, res5); - const __m128i tr0_7 = _mm_unpackhi_epi16(res6, res7); - // 00 10 01 11 02 12 03 13 - // 20 30 21 31 22 32 23 33 - // 04 14 05 15 06 16 07 17 - // 24 34 25 35 26 36 27 37 - // 40 50 41 51 42 52 43 53 - // 60 70 61 71 62 72 63 73 - // 54 54 55 55 56 56 57 57 - // 64 74 65 75 66 76 67 77 - const __m128i tr1_0 = _mm_unpacklo_epi32(tr0_0, tr0_1); - const __m128i tr1_1 = _mm_unpacklo_epi32(tr0_2, tr0_3); - const __m128i tr1_2 = _mm_unpackhi_epi32(tr0_0, tr0_1); - const __m128i tr1_3 = _mm_unpackhi_epi32(tr0_2, tr0_3); - const __m128i tr1_4 = _mm_unpacklo_epi32(tr0_4, tr0_5); - const __m128i tr1_5 = _mm_unpacklo_epi32(tr0_6, tr0_7); - const __m128i tr1_6 = _mm_unpackhi_epi32(tr0_4, tr0_5); - const __m128i tr1_7 = _mm_unpackhi_epi32(tr0_6, tr0_7); - // 00 10 20 30 01 11 21 31 - // 40 50 60 70 41 51 61 71 - // 02 12 22 32 03 13 23 33 - // 42 52 62 72 43 53 63 73 - // 04 14 24 34 05 15 21 36 - // 44 54 64 74 45 55 61 76 - // 06 16 26 36 07 17 27 37 - // 46 56 66 76 47 57 67 77 - in0 = _mm_unpacklo_epi64(tr1_0, tr1_4); - in1 = _mm_unpackhi_epi64(tr1_0, tr1_4); - in2 = _mm_unpacklo_epi64(tr1_2, tr1_6); - in3 = _mm_unpackhi_epi64(tr1_2, tr1_6); - in4 = _mm_unpacklo_epi64(tr1_1, tr1_5); - in5 = _mm_unpackhi_epi64(tr1_1, tr1_5); - in6 = _mm_unpacklo_epi64(tr1_3, tr1_7); - in7 = _mm_unpackhi_epi64(tr1_3, tr1_7); - // 00 10 20 30 40 50 60 70 - // 01 11 21 31 41 51 61 71 - // 02 12 22 32 42 52 62 72 - // 03 13 23 33 43 53 63 73 - // 04 14 24 34 44 54 64 74 - // 05 15 25 35 45 55 65 75 - // 06 16 26 36 46 56 66 76 - // 07 17 27 37 47 57 67 77 - } - } - // Post-condition output and store it - { - // Post-condition (division by two) - // division of two 16 bits signed numbers using shifts - // n / 2 = (n - (n >> 15)) >> 1 - const __m128i sign_in0 = _mm_srai_epi16(in0, 15); - const __m128i sign_in1 = _mm_srai_epi16(in1, 15); - const __m128i sign_in2 = _mm_srai_epi16(in2, 15); - const __m128i sign_in3 = _mm_srai_epi16(in3, 15); - const __m128i sign_in4 = _mm_srai_epi16(in4, 15); - const __m128i sign_in5 = _mm_srai_epi16(in5, 15); - const __m128i sign_in6 = _mm_srai_epi16(in6, 15); - const __m128i sign_in7 = _mm_srai_epi16(in7, 15); - in0 = _mm_sub_epi16(in0, sign_in0); - in1 = _mm_sub_epi16(in1, sign_in1); - in2 = _mm_sub_epi16(in2, sign_in2); - in3 = _mm_sub_epi16(in3, sign_in3); - in4 = _mm_sub_epi16(in4, sign_in4); - in5 = _mm_sub_epi16(in5, sign_in5); - in6 = _mm_sub_epi16(in6, sign_in6); - in7 = _mm_sub_epi16(in7, sign_in7); - in0 = _mm_srai_epi16(in0, 1); - in1 = _mm_srai_epi16(in1, 1); - in2 = _mm_srai_epi16(in2, 1); - in3 = _mm_srai_epi16(in3, 1); - in4 = _mm_srai_epi16(in4, 1); - in5 = _mm_srai_epi16(in5, 1); - in6 = _mm_srai_epi16(in6, 1); - in7 = _mm_srai_epi16(in7, 1); - // store results - store_output(&in0, (output + 0 * 8)); - store_output(&in1, (output + 1 * 8)); - store_output(&in2, (output + 2 * 8)); - store_output(&in3, (output + 3 * 8)); - store_output(&in4, (output + 4 * 8)); - store_output(&in5, (output + 5 * 8)); - store_output(&in6, (output + 6 * 8)); - store_output(&in7, (output + 7 * 8)); - } -} - -void FDCT16x16_2D(const int16_t *input, tran_low_t *output, int stride) { - // The 2D transform is done with two passes which are actually pretty - // similar. In the first one, we transform the columns and transpose - // the results. In the second one, we transform the rows. To achieve that, - // as the first pass results are transposed, we transpose the columns (that - // is the transposed rows) and transpose the results (so that it goes back - // in normal/row positions). - int pass; - // We need an intermediate buffer between passes. - DECLARE_ALIGNED_ARRAY(16, int16_t, intermediate, 256); - const int16_t *in = input; - int16_t *out0 = intermediate; - tran_low_t *out1 = output; - // Constants - // When we use them, in one case, they are all the same. In all others - // it's a pair of them that we need to repeat four times. This is done - // by constructing the 32 bit constant corresponding to that pair. - const __m128i k__cospi_p16_p16 = _mm_set1_epi16(cospi_16_64); - const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64); - const __m128i k__cospi_p24_p08 = pair_set_epi16(cospi_24_64, cospi_8_64); - const __m128i k__cospi_p08_m24 = pair_set_epi16(cospi_8_64, -cospi_24_64); - const __m128i k__cospi_m08_p24 = pair_set_epi16(-cospi_8_64, cospi_24_64); - const __m128i k__cospi_p28_p04 = pair_set_epi16(cospi_28_64, cospi_4_64); - const __m128i k__cospi_m04_p28 = pair_set_epi16(-cospi_4_64, cospi_28_64); - const __m128i k__cospi_p12_p20 = pair_set_epi16(cospi_12_64, cospi_20_64); - const __m128i k__cospi_m20_p12 = pair_set_epi16(-cospi_20_64, cospi_12_64); - const __m128i k__cospi_p30_p02 = pair_set_epi16(cospi_30_64, cospi_2_64); - const __m128i k__cospi_p14_p18 = pair_set_epi16(cospi_14_64, cospi_18_64); - const __m128i k__cospi_m02_p30 = pair_set_epi16(-cospi_2_64, cospi_30_64); - const __m128i k__cospi_m18_p14 = pair_set_epi16(-cospi_18_64, cospi_14_64); - const __m128i k__cospi_p22_p10 = pair_set_epi16(cospi_22_64, cospi_10_64); - const __m128i k__cospi_p06_p26 = pair_set_epi16(cospi_6_64, cospi_26_64); - const __m128i k__cospi_m10_p22 = pair_set_epi16(-cospi_10_64, cospi_22_64); - const __m128i k__cospi_m26_p06 = pair_set_epi16(-cospi_26_64, cospi_6_64); - const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING); - const __m128i kOne = _mm_set1_epi16(1); - // Do the two transform/transpose passes - for (pass = 0; pass < 2; ++pass) { - // We process eight columns (transposed rows in second pass) at a time. - int column_start; -#if DCT_HIGH_BIT_DEPTH - int overflow; -#endif - for (column_start = 0; column_start < 16; column_start += 8) { - __m128i in00, in01, in02, in03, in04, in05, in06, in07; - __m128i in08, in09, in10, in11, in12, in13, in14, in15; - __m128i input0, input1, input2, input3, input4, input5, input6, input7; - __m128i step1_0, step1_1, step1_2, step1_3; - __m128i step1_4, step1_5, step1_6, step1_7; - __m128i step2_1, step2_2, step2_3, step2_4, step2_5, step2_6; - __m128i step3_0, step3_1, step3_2, step3_3; - __m128i step3_4, step3_5, step3_6, step3_7; - __m128i res00, res01, res02, res03, res04, res05, res06, res07; - __m128i res08, res09, res10, res11, res12, res13, res14, res15; - // Load and pre-condition input. - if (0 == pass) { - in00 = _mm_load_si128((const __m128i *)(in + 0 * stride)); - in01 = _mm_load_si128((const __m128i *)(in + 1 * stride)); - in02 = _mm_load_si128((const __m128i *)(in + 2 * stride)); - in03 = _mm_load_si128((const __m128i *)(in + 3 * stride)); - in04 = _mm_load_si128((const __m128i *)(in + 4 * stride)); - in05 = _mm_load_si128((const __m128i *)(in + 5 * stride)); - in06 = _mm_load_si128((const __m128i *)(in + 6 * stride)); - in07 = _mm_load_si128((const __m128i *)(in + 7 * stride)); - in08 = _mm_load_si128((const __m128i *)(in + 8 * stride)); - in09 = _mm_load_si128((const __m128i *)(in + 9 * stride)); - in10 = _mm_load_si128((const __m128i *)(in + 10 * stride)); - in11 = _mm_load_si128((const __m128i *)(in + 11 * stride)); - in12 = _mm_load_si128((const __m128i *)(in + 12 * stride)); - in13 = _mm_load_si128((const __m128i *)(in + 13 * stride)); - in14 = _mm_load_si128((const __m128i *)(in + 14 * stride)); - in15 = _mm_load_si128((const __m128i *)(in + 15 * stride)); - // x = x << 2 - in00 = _mm_slli_epi16(in00, 2); - in01 = _mm_slli_epi16(in01, 2); - in02 = _mm_slli_epi16(in02, 2); - in03 = _mm_slli_epi16(in03, 2); - in04 = _mm_slli_epi16(in04, 2); - in05 = _mm_slli_epi16(in05, 2); - in06 = _mm_slli_epi16(in06, 2); - in07 = _mm_slli_epi16(in07, 2); - in08 = _mm_slli_epi16(in08, 2); - in09 = _mm_slli_epi16(in09, 2); - in10 = _mm_slli_epi16(in10, 2); - in11 = _mm_slli_epi16(in11, 2); - in12 = _mm_slli_epi16(in12, 2); - in13 = _mm_slli_epi16(in13, 2); - in14 = _mm_slli_epi16(in14, 2); - in15 = _mm_slli_epi16(in15, 2); - } else { - in00 = _mm_load_si128((const __m128i *)(in + 0 * 16)); - in01 = _mm_load_si128((const __m128i *)(in + 1 * 16)); - in02 = _mm_load_si128((const __m128i *)(in + 2 * 16)); - in03 = _mm_load_si128((const __m128i *)(in + 3 * 16)); - in04 = _mm_load_si128((const __m128i *)(in + 4 * 16)); - in05 = _mm_load_si128((const __m128i *)(in + 5 * 16)); - in06 = _mm_load_si128((const __m128i *)(in + 6 * 16)); - in07 = _mm_load_si128((const __m128i *)(in + 7 * 16)); - in08 = _mm_load_si128((const __m128i *)(in + 8 * 16)); - in09 = _mm_load_si128((const __m128i *)(in + 9 * 16)); - in10 = _mm_load_si128((const __m128i *)(in + 10 * 16)); - in11 = _mm_load_si128((const __m128i *)(in + 11 * 16)); - in12 = _mm_load_si128((const __m128i *)(in + 12 * 16)); - in13 = _mm_load_si128((const __m128i *)(in + 13 * 16)); - in14 = _mm_load_si128((const __m128i *)(in + 14 * 16)); - in15 = _mm_load_si128((const __m128i *)(in + 15 * 16)); - // x = (x + 1) >> 2 - in00 = _mm_add_epi16(in00, kOne); - in01 = _mm_add_epi16(in01, kOne); - in02 = _mm_add_epi16(in02, kOne); - in03 = _mm_add_epi16(in03, kOne); - in04 = _mm_add_epi16(in04, kOne); - in05 = _mm_add_epi16(in05, kOne); - in06 = _mm_add_epi16(in06, kOne); - in07 = _mm_add_epi16(in07, kOne); - in08 = _mm_add_epi16(in08, kOne); - in09 = _mm_add_epi16(in09, kOne); - in10 = _mm_add_epi16(in10, kOne); - in11 = _mm_add_epi16(in11, kOne); - in12 = _mm_add_epi16(in12, kOne); - in13 = _mm_add_epi16(in13, kOne); - in14 = _mm_add_epi16(in14, kOne); - in15 = _mm_add_epi16(in15, kOne); - in00 = _mm_srai_epi16(in00, 2); - in01 = _mm_srai_epi16(in01, 2); - in02 = _mm_srai_epi16(in02, 2); - in03 = _mm_srai_epi16(in03, 2); - in04 = _mm_srai_epi16(in04, 2); - in05 = _mm_srai_epi16(in05, 2); - in06 = _mm_srai_epi16(in06, 2); - in07 = _mm_srai_epi16(in07, 2); - in08 = _mm_srai_epi16(in08, 2); - in09 = _mm_srai_epi16(in09, 2); - in10 = _mm_srai_epi16(in10, 2); - in11 = _mm_srai_epi16(in11, 2); - in12 = _mm_srai_epi16(in12, 2); - in13 = _mm_srai_epi16(in13, 2); - in14 = _mm_srai_epi16(in14, 2); - in15 = _mm_srai_epi16(in15, 2); - } - in += 8; - // Calculate input for the first 8 results. - { - input0 = ADD_EPI16(in00, in15); - input1 = ADD_EPI16(in01, in14); - input2 = ADD_EPI16(in02, in13); - input3 = ADD_EPI16(in03, in12); - input4 = ADD_EPI16(in04, in11); - input5 = ADD_EPI16(in05, in10); - input6 = ADD_EPI16(in06, in09); - input7 = ADD_EPI16(in07, in08); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x8(&input0, &input1, &input2, &input3, - &input4, &input5, &input6, &input7); - if (overflow) { - vp9_highbd_fdct16x16_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - // Calculate input for the next 8 results. - { - step1_0 = SUB_EPI16(in07, in08); - step1_1 = SUB_EPI16(in06, in09); - step1_2 = SUB_EPI16(in05, in10); - step1_3 = SUB_EPI16(in04, in11); - step1_4 = SUB_EPI16(in03, in12); - step1_5 = SUB_EPI16(in02, in13); - step1_6 = SUB_EPI16(in01, in14); - step1_7 = SUB_EPI16(in00, in15); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x8(&step1_0, &step1_1, - &step1_2, &step1_3, - &step1_4, &step1_5, - &step1_6, &step1_7); - if (overflow) { - vp9_highbd_fdct16x16_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - // Work on the first eight values; fdct8(input, even_results); - { - // Add/subtract - const __m128i q0 = ADD_EPI16(input0, input7); - const __m128i q1 = ADD_EPI16(input1, input6); - const __m128i q2 = ADD_EPI16(input2, input5); - const __m128i q3 = ADD_EPI16(input3, input4); - const __m128i q4 = SUB_EPI16(input3, input4); - const __m128i q5 = SUB_EPI16(input2, input5); - const __m128i q6 = SUB_EPI16(input1, input6); - const __m128i q7 = SUB_EPI16(input0, input7); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x8(&q0, &q1, &q2, &q3, - &q4, &q5, &q6, &q7); - if (overflow) { - vp9_highbd_fdct16x16_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - // Work on first four results - { - // Add/subtract - const __m128i r0 = ADD_EPI16(q0, q3); - const __m128i r1 = ADD_EPI16(q1, q2); - const __m128i r2 = SUB_EPI16(q1, q2); - const __m128i r3 = SUB_EPI16(q0, q3); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x4(&r0, &r1, &r2, &r3); - if (overflow) { - vp9_highbd_fdct16x16_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - // Interleave to do the multiply by constants which gets us - // into 32 bits. - { - const __m128i t0 = _mm_unpacklo_epi16(r0, r1); - const __m128i t1 = _mm_unpackhi_epi16(r0, r1); - const __m128i t2 = _mm_unpacklo_epi16(r2, r3); - const __m128i t3 = _mm_unpackhi_epi16(r2, r3); - res00 = mult_round_shift(&t0, &t1, &k__cospi_p16_p16, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); - res08 = mult_round_shift(&t0, &t1, &k__cospi_p16_m16, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); - res04 = mult_round_shift(&t2, &t3, &k__cospi_p24_p08, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); - res12 = mult_round_shift(&t2, &t3, &k__cospi_m08_p24, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x4(&res00, &res08, &res04, &res12); - if (overflow) { - vp9_highbd_fdct16x16_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - } - // Work on next four results - { - // Interleave to do the multiply by constants which gets us - // into 32 bits. - const __m128i d0 = _mm_unpacklo_epi16(q6, q5); - const __m128i d1 = _mm_unpackhi_epi16(q6, q5); - const __m128i r0 = mult_round_shift(&d0, &d1, &k__cospi_p16_m16, - &k__DCT_CONST_ROUNDING, - DCT_CONST_BITS); - const __m128i r1 = mult_round_shift(&d0, &d1, &k__cospi_p16_p16, - &k__DCT_CONST_ROUNDING, - DCT_CONST_BITS); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x2(&r0, &r1); - if (overflow) { - vp9_highbd_fdct16x16_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - { - // Add/subtract - const __m128i x0 = ADD_EPI16(q4, r0); - const __m128i x1 = SUB_EPI16(q4, r0); - const __m128i x2 = SUB_EPI16(q7, r1); - const __m128i x3 = ADD_EPI16(q7, r1); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x4(&x0, &x1, &x2, &x3); - if (overflow) { - vp9_highbd_fdct16x16_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - // Interleave to do the multiply by constants which gets us - // into 32 bits. - { - const __m128i t0 = _mm_unpacklo_epi16(x0, x3); - const __m128i t1 = _mm_unpackhi_epi16(x0, x3); - const __m128i t2 = _mm_unpacklo_epi16(x1, x2); - const __m128i t3 = _mm_unpackhi_epi16(x1, x2); - res02 = mult_round_shift(&t0, &t1, &k__cospi_p28_p04, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); - res14 = mult_round_shift(&t0, &t1, &k__cospi_m04_p28, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); - res10 = mult_round_shift(&t2, &t3, &k__cospi_p12_p20, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); - res06 = mult_round_shift(&t2, &t3, &k__cospi_m20_p12, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x4(&res02, &res14, - &res10, &res06); - if (overflow) { - vp9_highbd_fdct16x16_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - } - } - } - // Work on the next eight values; step1 -> odd_results - { - // step 2 - { - const __m128i t0 = _mm_unpacklo_epi16(step1_5, step1_2); - const __m128i t1 = _mm_unpackhi_epi16(step1_5, step1_2); - const __m128i t2 = _mm_unpacklo_epi16(step1_4, step1_3); - const __m128i t3 = _mm_unpackhi_epi16(step1_4, step1_3); - step2_2 = mult_round_shift(&t0, &t1, &k__cospi_p16_m16, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); - step2_3 = mult_round_shift(&t2, &t3, &k__cospi_p16_m16, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); - step2_5 = mult_round_shift(&t0, &t1, &k__cospi_p16_p16, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); - step2_4 = mult_round_shift(&t2, &t3, &k__cospi_p16_p16, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x4(&step2_2, &step2_3, &step2_5, - &step2_4); - if (overflow) { - vp9_highbd_fdct16x16_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - // step 3 - { - step3_0 = ADD_EPI16(step1_0, step2_3); - step3_1 = ADD_EPI16(step1_1, step2_2); - step3_2 = SUB_EPI16(step1_1, step2_2); - step3_3 = SUB_EPI16(step1_0, step2_3); - step3_4 = SUB_EPI16(step1_7, step2_4); - step3_5 = SUB_EPI16(step1_6, step2_5); - step3_6 = ADD_EPI16(step1_6, step2_5); - step3_7 = ADD_EPI16(step1_7, step2_4); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x8(&step3_0, &step3_1, - &step3_2, &step3_3, - &step3_4, &step3_5, - &step3_6, &step3_7); - if (overflow) { - vp9_highbd_fdct16x16_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - // step 4 - { - const __m128i t0 = _mm_unpacklo_epi16(step3_1, step3_6); - const __m128i t1 = _mm_unpackhi_epi16(step3_1, step3_6); - const __m128i t2 = _mm_unpacklo_epi16(step3_2, step3_5); - const __m128i t3 = _mm_unpackhi_epi16(step3_2, step3_5); - step2_1 = mult_round_shift(&t0, &t1, &k__cospi_m08_p24, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); - step2_2 = mult_round_shift(&t2, &t3, &k__cospi_p24_p08, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); - step2_6 = mult_round_shift(&t0, &t1, &k__cospi_p24_p08, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); - step2_5 = mult_round_shift(&t2, &t3, &k__cospi_p08_m24, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x4(&step2_1, &step2_2, &step2_6, - &step2_5); - if (overflow) { - vp9_highbd_fdct16x16_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - // step 5 - { - step1_0 = ADD_EPI16(step3_0, step2_1); - step1_1 = SUB_EPI16(step3_0, step2_1); - step1_2 = ADD_EPI16(step3_3, step2_2); - step1_3 = SUB_EPI16(step3_3, step2_2); - step1_4 = SUB_EPI16(step3_4, step2_5); - step1_5 = ADD_EPI16(step3_4, step2_5); - step1_6 = SUB_EPI16(step3_7, step2_6); - step1_7 = ADD_EPI16(step3_7, step2_6); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x8(&step1_0, &step1_1, - &step1_2, &step1_3, - &step1_4, &step1_5, - &step1_6, &step1_7); - if (overflow) { - vp9_highbd_fdct16x16_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - // step 6 - { - const __m128i t0 = _mm_unpacklo_epi16(step1_0, step1_7); - const __m128i t1 = _mm_unpackhi_epi16(step1_0, step1_7); - const __m128i t2 = _mm_unpacklo_epi16(step1_1, step1_6); - const __m128i t3 = _mm_unpackhi_epi16(step1_1, step1_6); - res01 = mult_round_shift(&t0, &t1, &k__cospi_p30_p02, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); - res09 = mult_round_shift(&t2, &t3, &k__cospi_p14_p18, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); - res15 = mult_round_shift(&t0, &t1, &k__cospi_m02_p30, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); - res07 = mult_round_shift(&t2, &t3, &k__cospi_m18_p14, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x4(&res01, &res09, &res15, &res07); - if (overflow) { - vp9_highbd_fdct16x16_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - { - const __m128i t0 = _mm_unpacklo_epi16(step1_2, step1_5); - const __m128i t1 = _mm_unpackhi_epi16(step1_2, step1_5); - const __m128i t2 = _mm_unpacklo_epi16(step1_3, step1_4); - const __m128i t3 = _mm_unpackhi_epi16(step1_3, step1_4); - res05 = mult_round_shift(&t0, &t1, &k__cospi_p22_p10, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); - res13 = mult_round_shift(&t2, &t3, &k__cospi_p06_p26, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); - res11 = mult_round_shift(&t0, &t1, &k__cospi_m10_p22, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); - res03 = mult_round_shift(&t2, &t3, &k__cospi_m26_p06, - &k__DCT_CONST_ROUNDING, DCT_CONST_BITS); -#if DCT_HIGH_BIT_DEPTH - overflow = check_epi16_overflow_x4(&res05, &res13, &res11, &res03); - if (overflow) { - vp9_highbd_fdct16x16_c(input, output, stride); - return; - } -#endif // DCT_HIGH_BIT_DEPTH - } - } - // Transpose the results, do it as two 8x8 transposes. - transpose_and_output8x8(&res00, &res01, &res02, &res03, - &res04, &res05, &res06, &res07, - pass, out0, out1); - transpose_and_output8x8(&res08, &res09, &res10, &res11, - &res12, &res13, &res14, &res15, - pass, out0 + 8, out1 + 8); - if (pass == 0) { - out0 += 8*16; - } else { - out1 += 8*16; - } - } - // Setup in/out for next pass. - in = intermediate; - } -} - -#undef ADD_EPI16 -#undef SUB_EPI16 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct_sse2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct_sse2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct_sse2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct_sse2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2427 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include // SSE2 -#include "vp9/common/vp9_idct.h" // for cospi constants -#include "vp9/encoder/vp9_dct.h" -#include "vp9/encoder/x86/vp9_dct_sse2.h" -#include "vpx_ports/mem.h" - -void vp9_fdct4x4_1_sse2(const int16_t *input, tran_low_t *output, int stride) { - __m128i in0, in1; - __m128i tmp; - const __m128i zero = _mm_setzero_si128(); - in0 = _mm_loadl_epi64((const __m128i *)(input + 0 * stride)); - in1 = _mm_loadl_epi64((const __m128i *)(input + 1 * stride)); - in1 = _mm_unpacklo_epi64(in1, _mm_loadl_epi64((const __m128i *) - (input + 2 * stride))); - in0 = _mm_unpacklo_epi64(in0, _mm_loadl_epi64((const __m128i *) - (input + 3 * stride))); - - tmp = _mm_add_epi16(in0, in1); - in0 = _mm_unpacklo_epi16(zero, tmp); - in1 = _mm_unpackhi_epi16(zero, tmp); - in0 = _mm_srai_epi32(in0, 16); - in1 = _mm_srai_epi32(in1, 16); - - tmp = _mm_add_epi32(in0, in1); - in0 = _mm_unpacklo_epi32(tmp, zero); - in1 = _mm_unpackhi_epi32(tmp, zero); - - tmp = _mm_add_epi32(in0, in1); - in0 = _mm_srli_si128(tmp, 8); - - in1 = _mm_add_epi32(tmp, in0); - in0 = _mm_slli_epi32(in1, 1); - store_output(&in0, output); -} - -static INLINE void load_buffer_4x4(const int16_t *input, __m128i *in, - int stride) { - const __m128i k__nonzero_bias_a = _mm_setr_epi16(0, 1, 1, 1, 1, 1, 1, 1); - const __m128i k__nonzero_bias_b = _mm_setr_epi16(1, 0, 0, 0, 0, 0, 0, 0); - __m128i mask; - - in[0] = _mm_loadl_epi64((const __m128i *)(input + 0 * stride)); - in[1] = _mm_loadl_epi64((const __m128i *)(input + 1 * stride)); - in[2] = _mm_loadl_epi64((const __m128i *)(input + 2 * stride)); - in[3] = _mm_loadl_epi64((const __m128i *)(input + 3 * stride)); - - in[0] = _mm_slli_epi16(in[0], 4); - in[1] = _mm_slli_epi16(in[1], 4); - in[2] = _mm_slli_epi16(in[2], 4); - in[3] = _mm_slli_epi16(in[3], 4); - - mask = _mm_cmpeq_epi16(in[0], k__nonzero_bias_a); - in[0] = _mm_add_epi16(in[0], mask); - in[0] = _mm_add_epi16(in[0], k__nonzero_bias_b); -} - -static INLINE void write_buffer_4x4(tran_low_t *output, __m128i *res) { - const __m128i kOne = _mm_set1_epi16(1); - __m128i in01 = _mm_unpacklo_epi64(res[0], res[1]); - __m128i in23 = _mm_unpacklo_epi64(res[2], res[3]); - __m128i out01 = _mm_add_epi16(in01, kOne); - __m128i out23 = _mm_add_epi16(in23, kOne); - out01 = _mm_srai_epi16(out01, 2); - out23 = _mm_srai_epi16(out23, 2); - store_output(&out01, (output + 0 * 8)); - store_output(&out23, (output + 1 * 8)); -} - -static INLINE void transpose_4x4(__m128i *res) { - // Combine and transpose - // 00 01 02 03 20 21 22 23 - // 10 11 12 13 30 31 32 33 - const __m128i tr0_0 = _mm_unpacklo_epi16(res[0], res[1]); - const __m128i tr0_1 = _mm_unpackhi_epi16(res[0], res[1]); - - // 00 10 01 11 02 12 03 13 - // 20 30 21 31 22 32 23 33 - res[0] = _mm_unpacklo_epi32(tr0_0, tr0_1); - res[2] = _mm_unpackhi_epi32(tr0_0, tr0_1); - - // 00 10 20 30 01 11 21 31 - // 02 12 22 32 03 13 23 33 - // only use the first 4 16-bit integers - res[1] = _mm_unpackhi_epi64(res[0], res[0]); - res[3] = _mm_unpackhi_epi64(res[2], res[2]); -} - -void fdct4_sse2(__m128i *in) { - const __m128i k__cospi_p16_p16 = _mm_set1_epi16((int16_t)cospi_16_64); - const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64); - const __m128i k__cospi_p08_p24 = pair_set_epi16(cospi_8_64, cospi_24_64); - const __m128i k__cospi_p24_m08 = pair_set_epi16(cospi_24_64, -cospi_8_64); - const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING); - - __m128i u[4], v[4]; - u[0]=_mm_unpacklo_epi16(in[0], in[1]); - u[1]=_mm_unpacklo_epi16(in[3], in[2]); - - v[0] = _mm_add_epi16(u[0], u[1]); - v[1] = _mm_sub_epi16(u[0], u[1]); - - u[0] = _mm_madd_epi16(v[0], k__cospi_p16_p16); // 0 - u[1] = _mm_madd_epi16(v[0], k__cospi_p16_m16); // 2 - u[2] = _mm_madd_epi16(v[1], k__cospi_p08_p24); // 1 - u[3] = _mm_madd_epi16(v[1], k__cospi_p24_m08); // 3 - - v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING); - v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING); - v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING); - v[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING); - u[0] = _mm_srai_epi32(v[0], DCT_CONST_BITS); - u[1] = _mm_srai_epi32(v[1], DCT_CONST_BITS); - u[2] = _mm_srai_epi32(v[2], DCT_CONST_BITS); - u[3] = _mm_srai_epi32(v[3], DCT_CONST_BITS); - - in[0] = _mm_packs_epi32(u[0], u[1]); - in[1] = _mm_packs_epi32(u[2], u[3]); - transpose_4x4(in); -} - -void fadst4_sse2(__m128i *in) { - const __m128i k__sinpi_p01_p02 = pair_set_epi16(sinpi_1_9, sinpi_2_9); - const __m128i k__sinpi_p04_m01 = pair_set_epi16(sinpi_4_9, -sinpi_1_9); - const __m128i k__sinpi_p03_p04 = pair_set_epi16(sinpi_3_9, sinpi_4_9); - const __m128i k__sinpi_m03_p02 = pair_set_epi16(-sinpi_3_9, sinpi_2_9); - const __m128i k__sinpi_p03_p03 = _mm_set1_epi16((int16_t)sinpi_3_9); - const __m128i kZero = _mm_set1_epi16(0); - const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING); - __m128i u[8], v[8]; - __m128i in7 = _mm_add_epi16(in[0], in[1]); - - u[0] = _mm_unpacklo_epi16(in[0], in[1]); - u[1] = _mm_unpacklo_epi16(in[2], in[3]); - u[2] = _mm_unpacklo_epi16(in7, kZero); - u[3] = _mm_unpacklo_epi16(in[2], kZero); - u[4] = _mm_unpacklo_epi16(in[3], kZero); - - v[0] = _mm_madd_epi16(u[0], k__sinpi_p01_p02); // s0 + s2 - v[1] = _mm_madd_epi16(u[1], k__sinpi_p03_p04); // s4 + s5 - v[2] = _mm_madd_epi16(u[2], k__sinpi_p03_p03); // x1 - v[3] = _mm_madd_epi16(u[0], k__sinpi_p04_m01); // s1 - s3 - v[4] = _mm_madd_epi16(u[1], k__sinpi_m03_p02); // -s4 + s6 - v[5] = _mm_madd_epi16(u[3], k__sinpi_p03_p03); // s4 - v[6] = _mm_madd_epi16(u[4], k__sinpi_p03_p03); - - u[0] = _mm_add_epi32(v[0], v[1]); - u[1] = _mm_sub_epi32(v[2], v[6]); - u[2] = _mm_add_epi32(v[3], v[4]); - u[3] = _mm_sub_epi32(u[2], u[0]); - u[4] = _mm_slli_epi32(v[5], 2); - u[5] = _mm_sub_epi32(u[4], v[5]); - u[6] = _mm_add_epi32(u[3], u[5]); - - v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING); - v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING); - v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING); - v[3] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING); - - u[0] = _mm_srai_epi32(v[0], DCT_CONST_BITS); - u[1] = _mm_srai_epi32(v[1], DCT_CONST_BITS); - u[2] = _mm_srai_epi32(v[2], DCT_CONST_BITS); - u[3] = _mm_srai_epi32(v[3], DCT_CONST_BITS); - - in[0] = _mm_packs_epi32(u[0], u[2]); - in[1] = _mm_packs_epi32(u[1], u[3]); - transpose_4x4(in); -} - -void vp9_fht4x4_sse2(const int16_t *input, tran_low_t *output, - int stride, int tx_type) { - __m128i in[4]; - - switch (tx_type) { - case DCT_DCT: - vp9_fdct4x4_sse2(input, output, stride); - break; - case ADST_DCT: - load_buffer_4x4(input, in, stride); - fadst4_sse2(in); - fdct4_sse2(in); - write_buffer_4x4(output, in); - break; - case DCT_ADST: - load_buffer_4x4(input, in, stride); - fdct4_sse2(in); - fadst4_sse2(in); - write_buffer_4x4(output, in); - break; - case ADST_ADST: - load_buffer_4x4(input, in, stride); - fadst4_sse2(in); - fadst4_sse2(in); - write_buffer_4x4(output, in); - break; - default: - assert(0); - break; - } -} - -void vp9_fdct8x8_1_sse2(const int16_t *input, tran_low_t *output, int stride) { - __m128i in0 = _mm_load_si128((const __m128i *)(input + 0 * stride)); - __m128i in1 = _mm_load_si128((const __m128i *)(input + 1 * stride)); - __m128i in2 = _mm_load_si128((const __m128i *)(input + 2 * stride)); - __m128i in3 = _mm_load_si128((const __m128i *)(input + 3 * stride)); - __m128i u0, u1, sum; - - u0 = _mm_add_epi16(in0, in1); - u1 = _mm_add_epi16(in2, in3); - - in0 = _mm_load_si128((const __m128i *)(input + 4 * stride)); - in1 = _mm_load_si128((const __m128i *)(input + 5 * stride)); - in2 = _mm_load_si128((const __m128i *)(input + 6 * stride)); - in3 = _mm_load_si128((const __m128i *)(input + 7 * stride)); - - sum = _mm_add_epi16(u0, u1); - - in0 = _mm_add_epi16(in0, in1); - in2 = _mm_add_epi16(in2, in3); - sum = _mm_add_epi16(sum, in0); - - u0 = _mm_setzero_si128(); - sum = _mm_add_epi16(sum, in2); - - in0 = _mm_unpacklo_epi16(u0, sum); - in1 = _mm_unpackhi_epi16(u0, sum); - in0 = _mm_srai_epi32(in0, 16); - in1 = _mm_srai_epi32(in1, 16); - - sum = _mm_add_epi32(in0, in1); - in0 = _mm_unpacklo_epi32(sum, u0); - in1 = _mm_unpackhi_epi32(sum, u0); - - sum = _mm_add_epi32(in0, in1); - in0 = _mm_srli_si128(sum, 8); - - in1 = _mm_add_epi32(sum, in0); - store_output(&in1, output); -} - -void vp9_fdct8x8_quant_sse2(const int16_t *input, int stride, - int16_t* coeff_ptr, intptr_t n_coeffs, - int skip_block, const int16_t* zbin_ptr, - const int16_t* round_ptr, const int16_t* quant_ptr, - const int16_t* quant_shift_ptr, int16_t* qcoeff_ptr, - int16_t* dqcoeff_ptr, const int16_t* dequant_ptr, - uint16_t* eob_ptr, - const int16_t* scan_ptr, - const int16_t* iscan_ptr) { - __m128i zero; - int pass; - // Constants - // When we use them, in one case, they are all the same. In all others - // it's a pair of them that we need to repeat four times. This is done - // by constructing the 32 bit constant corresponding to that pair. - const __m128i k__cospi_p16_p16 = _mm_set1_epi16((int16_t)cospi_16_64); - const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64); - const __m128i k__cospi_p24_p08 = pair_set_epi16(cospi_24_64, cospi_8_64); - const __m128i k__cospi_m08_p24 = pair_set_epi16(-cospi_8_64, cospi_24_64); - const __m128i k__cospi_p28_p04 = pair_set_epi16(cospi_28_64, cospi_4_64); - const __m128i k__cospi_m04_p28 = pair_set_epi16(-cospi_4_64, cospi_28_64); - const __m128i k__cospi_p12_p20 = pair_set_epi16(cospi_12_64, cospi_20_64); - const __m128i k__cospi_m20_p12 = pair_set_epi16(-cospi_20_64, cospi_12_64); - const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING); - // Load input - __m128i in0 = _mm_load_si128((const __m128i *)(input + 0 * stride)); - __m128i in1 = _mm_load_si128((const __m128i *)(input + 1 * stride)); - __m128i in2 = _mm_load_si128((const __m128i *)(input + 2 * stride)); - __m128i in3 = _mm_load_si128((const __m128i *)(input + 3 * stride)); - __m128i in4 = _mm_load_si128((const __m128i *)(input + 4 * stride)); - __m128i in5 = _mm_load_si128((const __m128i *)(input + 5 * stride)); - __m128i in6 = _mm_load_si128((const __m128i *)(input + 6 * stride)); - __m128i in7 = _mm_load_si128((const __m128i *)(input + 7 * stride)); - __m128i *in[8]; - int index = 0; - - (void)scan_ptr; - (void)zbin_ptr; - (void)quant_shift_ptr; - (void)coeff_ptr; - - // Pre-condition input (shift by two) - in0 = _mm_slli_epi16(in0, 2); - in1 = _mm_slli_epi16(in1, 2); - in2 = _mm_slli_epi16(in2, 2); - in3 = _mm_slli_epi16(in3, 2); - in4 = _mm_slli_epi16(in4, 2); - in5 = _mm_slli_epi16(in5, 2); - in6 = _mm_slli_epi16(in6, 2); - in7 = _mm_slli_epi16(in7, 2); - - in[0] = &in0; - in[1] = &in1; - in[2] = &in2; - in[3] = &in3; - in[4] = &in4; - in[5] = &in5; - in[6] = &in6; - in[7] = &in7; - - // We do two passes, first the columns, then the rows. The results of the - // first pass are transposed so that the same column code can be reused. The - // results of the second pass are also transposed so that the rows (processed - // as columns) are put back in row positions. - for (pass = 0; pass < 2; pass++) { - // To store results of each pass before the transpose. - __m128i res0, res1, res2, res3, res4, res5, res6, res7; - // Add/subtract - const __m128i q0 = _mm_add_epi16(in0, in7); - const __m128i q1 = _mm_add_epi16(in1, in6); - const __m128i q2 = _mm_add_epi16(in2, in5); - const __m128i q3 = _mm_add_epi16(in3, in4); - const __m128i q4 = _mm_sub_epi16(in3, in4); - const __m128i q5 = _mm_sub_epi16(in2, in5); - const __m128i q6 = _mm_sub_epi16(in1, in6); - const __m128i q7 = _mm_sub_epi16(in0, in7); - // Work on first four results - { - // Add/subtract - const __m128i r0 = _mm_add_epi16(q0, q3); - const __m128i r1 = _mm_add_epi16(q1, q2); - const __m128i r2 = _mm_sub_epi16(q1, q2); - const __m128i r3 = _mm_sub_epi16(q0, q3); - // Interleave to do the multiply by constants which gets us into 32bits - const __m128i t0 = _mm_unpacklo_epi16(r0, r1); - const __m128i t1 = _mm_unpackhi_epi16(r0, r1); - const __m128i t2 = _mm_unpacklo_epi16(r2, r3); - const __m128i t3 = _mm_unpackhi_epi16(r2, r3); - const __m128i u0 = _mm_madd_epi16(t0, k__cospi_p16_p16); - const __m128i u1 = _mm_madd_epi16(t1, k__cospi_p16_p16); - const __m128i u2 = _mm_madd_epi16(t0, k__cospi_p16_m16); - const __m128i u3 = _mm_madd_epi16(t1, k__cospi_p16_m16); - const __m128i u4 = _mm_madd_epi16(t2, k__cospi_p24_p08); - const __m128i u5 = _mm_madd_epi16(t3, k__cospi_p24_p08); - const __m128i u6 = _mm_madd_epi16(t2, k__cospi_m08_p24); - const __m128i u7 = _mm_madd_epi16(t3, k__cospi_m08_p24); - // dct_const_round_shift - const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING); - const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING); - const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING); - const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING); - const __m128i v4 = _mm_add_epi32(u4, k__DCT_CONST_ROUNDING); - const __m128i v5 = _mm_add_epi32(u5, k__DCT_CONST_ROUNDING); - const __m128i v6 = _mm_add_epi32(u6, k__DCT_CONST_ROUNDING); - const __m128i v7 = _mm_add_epi32(u7, k__DCT_CONST_ROUNDING); - const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS); - const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS); - const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS); - const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS); - const __m128i w4 = _mm_srai_epi32(v4, DCT_CONST_BITS); - const __m128i w5 = _mm_srai_epi32(v5, DCT_CONST_BITS); - const __m128i w6 = _mm_srai_epi32(v6, DCT_CONST_BITS); - const __m128i w7 = _mm_srai_epi32(v7, DCT_CONST_BITS); - // Combine - res0 = _mm_packs_epi32(w0, w1); - res4 = _mm_packs_epi32(w2, w3); - res2 = _mm_packs_epi32(w4, w5); - res6 = _mm_packs_epi32(w6, w7); - } - // Work on next four results - { - // Interleave to do the multiply by constants which gets us into 32bits - const __m128i d0 = _mm_unpacklo_epi16(q6, q5); - const __m128i d1 = _mm_unpackhi_epi16(q6, q5); - const __m128i e0 = _mm_madd_epi16(d0, k__cospi_p16_m16); - const __m128i e1 = _mm_madd_epi16(d1, k__cospi_p16_m16); - const __m128i e2 = _mm_madd_epi16(d0, k__cospi_p16_p16); - const __m128i e3 = _mm_madd_epi16(d1, k__cospi_p16_p16); - // dct_const_round_shift - const __m128i f0 = _mm_add_epi32(e0, k__DCT_CONST_ROUNDING); - const __m128i f1 = _mm_add_epi32(e1, k__DCT_CONST_ROUNDING); - const __m128i f2 = _mm_add_epi32(e2, k__DCT_CONST_ROUNDING); - const __m128i f3 = _mm_add_epi32(e3, k__DCT_CONST_ROUNDING); - const __m128i s0 = _mm_srai_epi32(f0, DCT_CONST_BITS); - const __m128i s1 = _mm_srai_epi32(f1, DCT_CONST_BITS); - const __m128i s2 = _mm_srai_epi32(f2, DCT_CONST_BITS); - const __m128i s3 = _mm_srai_epi32(f3, DCT_CONST_BITS); - // Combine - const __m128i r0 = _mm_packs_epi32(s0, s1); - const __m128i r1 = _mm_packs_epi32(s2, s3); - // Add/subtract - const __m128i x0 = _mm_add_epi16(q4, r0); - const __m128i x1 = _mm_sub_epi16(q4, r0); - const __m128i x2 = _mm_sub_epi16(q7, r1); - const __m128i x3 = _mm_add_epi16(q7, r1); - // Interleave to do the multiply by constants which gets us into 32bits - const __m128i t0 = _mm_unpacklo_epi16(x0, x3); - const __m128i t1 = _mm_unpackhi_epi16(x0, x3); - const __m128i t2 = _mm_unpacklo_epi16(x1, x2); - const __m128i t3 = _mm_unpackhi_epi16(x1, x2); - const __m128i u0 = _mm_madd_epi16(t0, k__cospi_p28_p04); - const __m128i u1 = _mm_madd_epi16(t1, k__cospi_p28_p04); - const __m128i u2 = _mm_madd_epi16(t0, k__cospi_m04_p28); - const __m128i u3 = _mm_madd_epi16(t1, k__cospi_m04_p28); - const __m128i u4 = _mm_madd_epi16(t2, k__cospi_p12_p20); - const __m128i u5 = _mm_madd_epi16(t3, k__cospi_p12_p20); - const __m128i u6 = _mm_madd_epi16(t2, k__cospi_m20_p12); - const __m128i u7 = _mm_madd_epi16(t3, k__cospi_m20_p12); - // dct_const_round_shift - const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING); - const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING); - const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING); - const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING); - const __m128i v4 = _mm_add_epi32(u4, k__DCT_CONST_ROUNDING); - const __m128i v5 = _mm_add_epi32(u5, k__DCT_CONST_ROUNDING); - const __m128i v6 = _mm_add_epi32(u6, k__DCT_CONST_ROUNDING); - const __m128i v7 = _mm_add_epi32(u7, k__DCT_CONST_ROUNDING); - const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS); - const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS); - const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS); - const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS); - const __m128i w4 = _mm_srai_epi32(v4, DCT_CONST_BITS); - const __m128i w5 = _mm_srai_epi32(v5, DCT_CONST_BITS); - const __m128i w6 = _mm_srai_epi32(v6, DCT_CONST_BITS); - const __m128i w7 = _mm_srai_epi32(v7, DCT_CONST_BITS); - // Combine - res1 = _mm_packs_epi32(w0, w1); - res7 = _mm_packs_epi32(w2, w3); - res5 = _mm_packs_epi32(w4, w5); - res3 = _mm_packs_epi32(w6, w7); - } - // Transpose the 8x8. - { - // 00 01 02 03 04 05 06 07 - // 10 11 12 13 14 15 16 17 - // 20 21 22 23 24 25 26 27 - // 30 31 32 33 34 35 36 37 - // 40 41 42 43 44 45 46 47 - // 50 51 52 53 54 55 56 57 - // 60 61 62 63 64 65 66 67 - // 70 71 72 73 74 75 76 77 - const __m128i tr0_0 = _mm_unpacklo_epi16(res0, res1); - const __m128i tr0_1 = _mm_unpacklo_epi16(res2, res3); - const __m128i tr0_2 = _mm_unpackhi_epi16(res0, res1); - const __m128i tr0_3 = _mm_unpackhi_epi16(res2, res3); - const __m128i tr0_4 = _mm_unpacklo_epi16(res4, res5); - const __m128i tr0_5 = _mm_unpacklo_epi16(res6, res7); - const __m128i tr0_6 = _mm_unpackhi_epi16(res4, res5); - const __m128i tr0_7 = _mm_unpackhi_epi16(res6, res7); - // 00 10 01 11 02 12 03 13 - // 20 30 21 31 22 32 23 33 - // 04 14 05 15 06 16 07 17 - // 24 34 25 35 26 36 27 37 - // 40 50 41 51 42 52 43 53 - // 60 70 61 71 62 72 63 73 - // 54 54 55 55 56 56 57 57 - // 64 74 65 75 66 76 67 77 - const __m128i tr1_0 = _mm_unpacklo_epi32(tr0_0, tr0_1); - const __m128i tr1_1 = _mm_unpacklo_epi32(tr0_2, tr0_3); - const __m128i tr1_2 = _mm_unpackhi_epi32(tr0_0, tr0_1); - const __m128i tr1_3 = _mm_unpackhi_epi32(tr0_2, tr0_3); - const __m128i tr1_4 = _mm_unpacklo_epi32(tr0_4, tr0_5); - const __m128i tr1_5 = _mm_unpacklo_epi32(tr0_6, tr0_7); - const __m128i tr1_6 = _mm_unpackhi_epi32(tr0_4, tr0_5); - const __m128i tr1_7 = _mm_unpackhi_epi32(tr0_6, tr0_7); - // 00 10 20 30 01 11 21 31 - // 40 50 60 70 41 51 61 71 - // 02 12 22 32 03 13 23 33 - // 42 52 62 72 43 53 63 73 - // 04 14 24 34 05 15 21 36 - // 44 54 64 74 45 55 61 76 - // 06 16 26 36 07 17 27 37 - // 46 56 66 76 47 57 67 77 - in0 = _mm_unpacklo_epi64(tr1_0, tr1_4); - in1 = _mm_unpackhi_epi64(tr1_0, tr1_4); - in2 = _mm_unpacklo_epi64(tr1_2, tr1_6); - in3 = _mm_unpackhi_epi64(tr1_2, tr1_6); - in4 = _mm_unpacklo_epi64(tr1_1, tr1_5); - in5 = _mm_unpackhi_epi64(tr1_1, tr1_5); - in6 = _mm_unpacklo_epi64(tr1_3, tr1_7); - in7 = _mm_unpackhi_epi64(tr1_3, tr1_7); - // 00 10 20 30 40 50 60 70 - // 01 11 21 31 41 51 61 71 - // 02 12 22 32 42 52 62 72 - // 03 13 23 33 43 53 63 73 - // 04 14 24 34 44 54 64 74 - // 05 15 25 35 45 55 65 75 - // 06 16 26 36 46 56 66 76 - // 07 17 27 37 47 57 67 77 - } - } - // Post-condition output and store it - { - // Post-condition (division by two) - // division of two 16 bits signed numbers using shifts - // n / 2 = (n - (n >> 15)) >> 1 - const __m128i sign_in0 = _mm_srai_epi16(in0, 15); - const __m128i sign_in1 = _mm_srai_epi16(in1, 15); - const __m128i sign_in2 = _mm_srai_epi16(in2, 15); - const __m128i sign_in3 = _mm_srai_epi16(in3, 15); - const __m128i sign_in4 = _mm_srai_epi16(in4, 15); - const __m128i sign_in5 = _mm_srai_epi16(in5, 15); - const __m128i sign_in6 = _mm_srai_epi16(in6, 15); - const __m128i sign_in7 = _mm_srai_epi16(in7, 15); - in0 = _mm_sub_epi16(in0, sign_in0); - in1 = _mm_sub_epi16(in1, sign_in1); - in2 = _mm_sub_epi16(in2, sign_in2); - in3 = _mm_sub_epi16(in3, sign_in3); - in4 = _mm_sub_epi16(in4, sign_in4); - in5 = _mm_sub_epi16(in5, sign_in5); - in6 = _mm_sub_epi16(in6, sign_in6); - in7 = _mm_sub_epi16(in7, sign_in7); - in0 = _mm_srai_epi16(in0, 1); - in1 = _mm_srai_epi16(in1, 1); - in2 = _mm_srai_epi16(in2, 1); - in3 = _mm_srai_epi16(in3, 1); - in4 = _mm_srai_epi16(in4, 1); - in5 = _mm_srai_epi16(in5, 1); - in6 = _mm_srai_epi16(in6, 1); - in7 = _mm_srai_epi16(in7, 1); - } - - iscan_ptr += n_coeffs; - qcoeff_ptr += n_coeffs; - dqcoeff_ptr += n_coeffs; - n_coeffs = -n_coeffs; - zero = _mm_setzero_si128(); - - if (!skip_block) { - __m128i eob; - __m128i round, quant, dequant; - { - __m128i coeff0, coeff1; - - // Setup global values - { - round = _mm_load_si128((const __m128i*)round_ptr); - quant = _mm_load_si128((const __m128i*)quant_ptr); - dequant = _mm_load_si128((const __m128i*)dequant_ptr); - } - - { - __m128i coeff0_sign, coeff1_sign; - __m128i qcoeff0, qcoeff1; - __m128i qtmp0, qtmp1; - // Do DC and first 15 AC - coeff0 = *in[0]; - coeff1 = *in[1]; - - // Poor man's sign extract - coeff0_sign = _mm_srai_epi16(coeff0, 15); - coeff1_sign = _mm_srai_epi16(coeff1, 15); - qcoeff0 = _mm_xor_si128(coeff0, coeff0_sign); - qcoeff1 = _mm_xor_si128(coeff1, coeff1_sign); - qcoeff0 = _mm_sub_epi16(qcoeff0, coeff0_sign); - qcoeff1 = _mm_sub_epi16(qcoeff1, coeff1_sign); - - qcoeff0 = _mm_adds_epi16(qcoeff0, round); - round = _mm_unpackhi_epi64(round, round); - qcoeff1 = _mm_adds_epi16(qcoeff1, round); - qtmp0 = _mm_mulhi_epi16(qcoeff0, quant); - quant = _mm_unpackhi_epi64(quant, quant); - qtmp1 = _mm_mulhi_epi16(qcoeff1, quant); - - // Reinsert signs - qcoeff0 = _mm_xor_si128(qtmp0, coeff0_sign); - qcoeff1 = _mm_xor_si128(qtmp1, coeff1_sign); - qcoeff0 = _mm_sub_epi16(qcoeff0, coeff0_sign); - qcoeff1 = _mm_sub_epi16(qcoeff1, coeff1_sign); - - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs), qcoeff0); - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs) + 1, qcoeff1); - - coeff0 = _mm_mullo_epi16(qcoeff0, dequant); - dequant = _mm_unpackhi_epi64(dequant, dequant); - coeff1 = _mm_mullo_epi16(qcoeff1, dequant); - - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs), coeff0); - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs) + 1, coeff1); - } - - { - // Scan for eob - __m128i zero_coeff0, zero_coeff1; - __m128i nzero_coeff0, nzero_coeff1; - __m128i iscan0, iscan1; - __m128i eob1; - zero_coeff0 = _mm_cmpeq_epi16(coeff0, zero); - zero_coeff1 = _mm_cmpeq_epi16(coeff1, zero); - nzero_coeff0 = _mm_cmpeq_epi16(zero_coeff0, zero); - nzero_coeff1 = _mm_cmpeq_epi16(zero_coeff1, zero); - iscan0 = _mm_load_si128((const __m128i*)(iscan_ptr + n_coeffs)); - iscan1 = _mm_load_si128((const __m128i*)(iscan_ptr + n_coeffs) + 1); - // Add one to convert from indices to counts - iscan0 = _mm_sub_epi16(iscan0, nzero_coeff0); - iscan1 = _mm_sub_epi16(iscan1, nzero_coeff1); - eob = _mm_and_si128(iscan0, nzero_coeff0); - eob1 = _mm_and_si128(iscan1, nzero_coeff1); - eob = _mm_max_epi16(eob, eob1); - } - n_coeffs += 8 * 2; - } - - // AC only loop - index = 2; - while (n_coeffs < 0) { - __m128i coeff0, coeff1; - { - __m128i coeff0_sign, coeff1_sign; - __m128i qcoeff0, qcoeff1; - __m128i qtmp0, qtmp1; - - assert(index < (int)(sizeof(in) / sizeof(in[0])) - 1); - coeff0 = *in[index]; - coeff1 = *in[index + 1]; - - // Poor man's sign extract - coeff0_sign = _mm_srai_epi16(coeff0, 15); - coeff1_sign = _mm_srai_epi16(coeff1, 15); - qcoeff0 = _mm_xor_si128(coeff0, coeff0_sign); - qcoeff1 = _mm_xor_si128(coeff1, coeff1_sign); - qcoeff0 = _mm_sub_epi16(qcoeff0, coeff0_sign); - qcoeff1 = _mm_sub_epi16(qcoeff1, coeff1_sign); - - qcoeff0 = _mm_adds_epi16(qcoeff0, round); - qcoeff1 = _mm_adds_epi16(qcoeff1, round); - qtmp0 = _mm_mulhi_epi16(qcoeff0, quant); - qtmp1 = _mm_mulhi_epi16(qcoeff1, quant); - - // Reinsert signs - qcoeff0 = _mm_xor_si128(qtmp0, coeff0_sign); - qcoeff1 = _mm_xor_si128(qtmp1, coeff1_sign); - qcoeff0 = _mm_sub_epi16(qcoeff0, coeff0_sign); - qcoeff1 = _mm_sub_epi16(qcoeff1, coeff1_sign); - - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs), qcoeff0); - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs) + 1, qcoeff1); - - coeff0 = _mm_mullo_epi16(qcoeff0, dequant); - coeff1 = _mm_mullo_epi16(qcoeff1, dequant); - - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs), coeff0); - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs) + 1, coeff1); - } - - { - // Scan for eob - __m128i zero_coeff0, zero_coeff1; - __m128i nzero_coeff0, nzero_coeff1; - __m128i iscan0, iscan1; - __m128i eob0, eob1; - zero_coeff0 = _mm_cmpeq_epi16(coeff0, zero); - zero_coeff1 = _mm_cmpeq_epi16(coeff1, zero); - nzero_coeff0 = _mm_cmpeq_epi16(zero_coeff0, zero); - nzero_coeff1 = _mm_cmpeq_epi16(zero_coeff1, zero); - iscan0 = _mm_load_si128((const __m128i*)(iscan_ptr + n_coeffs)); - iscan1 = _mm_load_si128((const __m128i*)(iscan_ptr + n_coeffs) + 1); - // Add one to convert from indices to counts - iscan0 = _mm_sub_epi16(iscan0, nzero_coeff0); - iscan1 = _mm_sub_epi16(iscan1, nzero_coeff1); - eob0 = _mm_and_si128(iscan0, nzero_coeff0); - eob1 = _mm_and_si128(iscan1, nzero_coeff1); - eob0 = _mm_max_epi16(eob0, eob1); - eob = _mm_max_epi16(eob, eob0); - } - n_coeffs += 8 * 2; - index += 2; - } - - // Accumulate EOB - { - __m128i eob_shuffled; - eob_shuffled = _mm_shuffle_epi32(eob, 0xe); - eob = _mm_max_epi16(eob, eob_shuffled); - eob_shuffled = _mm_shufflelo_epi16(eob, 0xe); - eob = _mm_max_epi16(eob, eob_shuffled); - eob_shuffled = _mm_shufflelo_epi16(eob, 0x1); - eob = _mm_max_epi16(eob, eob_shuffled); - *eob_ptr = _mm_extract_epi16(eob, 1); - } - } else { - do { - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs), zero); - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs) + 1, zero); - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs), zero); - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs) + 1, zero); - n_coeffs += 8 * 2; - } while (n_coeffs < 0); - *eob_ptr = 0; - } -} - -// load 8x8 array -static INLINE void load_buffer_8x8(const int16_t *input, __m128i *in, - int stride) { - in[0] = _mm_load_si128((const __m128i *)(input + 0 * stride)); - in[1] = _mm_load_si128((const __m128i *)(input + 1 * stride)); - in[2] = _mm_load_si128((const __m128i *)(input + 2 * stride)); - in[3] = _mm_load_si128((const __m128i *)(input + 3 * stride)); - in[4] = _mm_load_si128((const __m128i *)(input + 4 * stride)); - in[5] = _mm_load_si128((const __m128i *)(input + 5 * stride)); - in[6] = _mm_load_si128((const __m128i *)(input + 6 * stride)); - in[7] = _mm_load_si128((const __m128i *)(input + 7 * stride)); - - in[0] = _mm_slli_epi16(in[0], 2); - in[1] = _mm_slli_epi16(in[1], 2); - in[2] = _mm_slli_epi16(in[2], 2); - in[3] = _mm_slli_epi16(in[3], 2); - in[4] = _mm_slli_epi16(in[4], 2); - in[5] = _mm_slli_epi16(in[5], 2); - in[6] = _mm_slli_epi16(in[6], 2); - in[7] = _mm_slli_epi16(in[7], 2); -} - -// right shift and rounding -static INLINE void right_shift_8x8(__m128i *res, const int bit) { - __m128i sign0 = _mm_srai_epi16(res[0], 15); - __m128i sign1 = _mm_srai_epi16(res[1], 15); - __m128i sign2 = _mm_srai_epi16(res[2], 15); - __m128i sign3 = _mm_srai_epi16(res[3], 15); - __m128i sign4 = _mm_srai_epi16(res[4], 15); - __m128i sign5 = _mm_srai_epi16(res[5], 15); - __m128i sign6 = _mm_srai_epi16(res[6], 15); - __m128i sign7 = _mm_srai_epi16(res[7], 15); - - if (bit == 2) { - const __m128i const_rounding = _mm_set1_epi16(1); - res[0] = _mm_add_epi16(res[0], const_rounding); - res[1] = _mm_add_epi16(res[1], const_rounding); - res[2] = _mm_add_epi16(res[2], const_rounding); - res[3] = _mm_add_epi16(res[3], const_rounding); - res[4] = _mm_add_epi16(res[4], const_rounding); - res[5] = _mm_add_epi16(res[5], const_rounding); - res[6] = _mm_add_epi16(res[6], const_rounding); - res[7] = _mm_add_epi16(res[7], const_rounding); - } - - res[0] = _mm_sub_epi16(res[0], sign0); - res[1] = _mm_sub_epi16(res[1], sign1); - res[2] = _mm_sub_epi16(res[2], sign2); - res[3] = _mm_sub_epi16(res[3], sign3); - res[4] = _mm_sub_epi16(res[4], sign4); - res[5] = _mm_sub_epi16(res[5], sign5); - res[6] = _mm_sub_epi16(res[6], sign6); - res[7] = _mm_sub_epi16(res[7], sign7); - - if (bit == 1) { - res[0] = _mm_srai_epi16(res[0], 1); - res[1] = _mm_srai_epi16(res[1], 1); - res[2] = _mm_srai_epi16(res[2], 1); - res[3] = _mm_srai_epi16(res[3], 1); - res[4] = _mm_srai_epi16(res[4], 1); - res[5] = _mm_srai_epi16(res[5], 1); - res[6] = _mm_srai_epi16(res[6], 1); - res[7] = _mm_srai_epi16(res[7], 1); - } else { - res[0] = _mm_srai_epi16(res[0], 2); - res[1] = _mm_srai_epi16(res[1], 2); - res[2] = _mm_srai_epi16(res[2], 2); - res[3] = _mm_srai_epi16(res[3], 2); - res[4] = _mm_srai_epi16(res[4], 2); - res[5] = _mm_srai_epi16(res[5], 2); - res[6] = _mm_srai_epi16(res[6], 2); - res[7] = _mm_srai_epi16(res[7], 2); - } -} - -// write 8x8 array -static INLINE void write_buffer_8x8(tran_low_t *output, __m128i *res, - int stride) { - store_output(&res[0], (output + 0 * stride)); - store_output(&res[1], (output + 1 * stride)); - store_output(&res[2], (output + 2 * stride)); - store_output(&res[3], (output + 3 * stride)); - store_output(&res[4], (output + 4 * stride)); - store_output(&res[5], (output + 5 * stride)); - store_output(&res[6], (output + 6 * stride)); - store_output(&res[7], (output + 7 * stride)); -} - -// perform in-place transpose -static INLINE void array_transpose_8x8(__m128i *in, __m128i *res) { - const __m128i tr0_0 = _mm_unpacklo_epi16(in[0], in[1]); - const __m128i tr0_1 = _mm_unpacklo_epi16(in[2], in[3]); - const __m128i tr0_2 = _mm_unpackhi_epi16(in[0], in[1]); - const __m128i tr0_3 = _mm_unpackhi_epi16(in[2], in[3]); - const __m128i tr0_4 = _mm_unpacklo_epi16(in[4], in[5]); - const __m128i tr0_5 = _mm_unpacklo_epi16(in[6], in[7]); - const __m128i tr0_6 = _mm_unpackhi_epi16(in[4], in[5]); - const __m128i tr0_7 = _mm_unpackhi_epi16(in[6], in[7]); - // 00 10 01 11 02 12 03 13 - // 20 30 21 31 22 32 23 33 - // 04 14 05 15 06 16 07 17 - // 24 34 25 35 26 36 27 37 - // 40 50 41 51 42 52 43 53 - // 60 70 61 71 62 72 63 73 - // 44 54 45 55 46 56 47 57 - // 64 74 65 75 66 76 67 77 - const __m128i tr1_0 = _mm_unpacklo_epi32(tr0_0, tr0_1); - const __m128i tr1_1 = _mm_unpacklo_epi32(tr0_4, tr0_5); - const __m128i tr1_2 = _mm_unpackhi_epi32(tr0_0, tr0_1); - const __m128i tr1_3 = _mm_unpackhi_epi32(tr0_4, tr0_5); - const __m128i tr1_4 = _mm_unpacklo_epi32(tr0_2, tr0_3); - const __m128i tr1_5 = _mm_unpacklo_epi32(tr0_6, tr0_7); - const __m128i tr1_6 = _mm_unpackhi_epi32(tr0_2, tr0_3); - const __m128i tr1_7 = _mm_unpackhi_epi32(tr0_6, tr0_7); - // 00 10 20 30 01 11 21 31 - // 40 50 60 70 41 51 61 71 - // 02 12 22 32 03 13 23 33 - // 42 52 62 72 43 53 63 73 - // 04 14 24 34 05 15 25 35 - // 44 54 64 74 45 55 65 75 - // 06 16 26 36 07 17 27 37 - // 46 56 66 76 47 57 67 77 - res[0] = _mm_unpacklo_epi64(tr1_0, tr1_1); - res[1] = _mm_unpackhi_epi64(tr1_0, tr1_1); - res[2] = _mm_unpacklo_epi64(tr1_2, tr1_3); - res[3] = _mm_unpackhi_epi64(tr1_2, tr1_3); - res[4] = _mm_unpacklo_epi64(tr1_4, tr1_5); - res[5] = _mm_unpackhi_epi64(tr1_4, tr1_5); - res[6] = _mm_unpacklo_epi64(tr1_6, tr1_7); - res[7] = _mm_unpackhi_epi64(tr1_6, tr1_7); - // 00 10 20 30 40 50 60 70 - // 01 11 21 31 41 51 61 71 - // 02 12 22 32 42 52 62 72 - // 03 13 23 33 43 53 63 73 - // 04 14 24 34 44 54 64 74 - // 05 15 25 35 45 55 65 75 - // 06 16 26 36 46 56 66 76 - // 07 17 27 37 47 57 67 77 -} - -void fdct8_sse2(__m128i *in) { - // constants - const __m128i k__cospi_p16_p16 = _mm_set1_epi16((int16_t)cospi_16_64); - const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64); - const __m128i k__cospi_p24_p08 = pair_set_epi16(cospi_24_64, cospi_8_64); - const __m128i k__cospi_m08_p24 = pair_set_epi16(-cospi_8_64, cospi_24_64); - const __m128i k__cospi_p28_p04 = pair_set_epi16(cospi_28_64, cospi_4_64); - const __m128i k__cospi_m04_p28 = pair_set_epi16(-cospi_4_64, cospi_28_64); - const __m128i k__cospi_p12_p20 = pair_set_epi16(cospi_12_64, cospi_20_64); - const __m128i k__cospi_m20_p12 = pair_set_epi16(-cospi_20_64, cospi_12_64); - const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING); - __m128i u0, u1, u2, u3, u4, u5, u6, u7; - __m128i v0, v1, v2, v3, v4, v5, v6, v7; - __m128i s0, s1, s2, s3, s4, s5, s6, s7; - - // stage 1 - s0 = _mm_add_epi16(in[0], in[7]); - s1 = _mm_add_epi16(in[1], in[6]); - s2 = _mm_add_epi16(in[2], in[5]); - s3 = _mm_add_epi16(in[3], in[4]); - s4 = _mm_sub_epi16(in[3], in[4]); - s5 = _mm_sub_epi16(in[2], in[5]); - s6 = _mm_sub_epi16(in[1], in[6]); - s7 = _mm_sub_epi16(in[0], in[7]); - - u0 = _mm_add_epi16(s0, s3); - u1 = _mm_add_epi16(s1, s2); - u2 = _mm_sub_epi16(s1, s2); - u3 = _mm_sub_epi16(s0, s3); - // interleave and perform butterfly multiplication/addition - v0 = _mm_unpacklo_epi16(u0, u1); - v1 = _mm_unpackhi_epi16(u0, u1); - v2 = _mm_unpacklo_epi16(u2, u3); - v3 = _mm_unpackhi_epi16(u2, u3); - - u0 = _mm_madd_epi16(v0, k__cospi_p16_p16); - u1 = _mm_madd_epi16(v1, k__cospi_p16_p16); - u2 = _mm_madd_epi16(v0, k__cospi_p16_m16); - u3 = _mm_madd_epi16(v1, k__cospi_p16_m16); - u4 = _mm_madd_epi16(v2, k__cospi_p24_p08); - u5 = _mm_madd_epi16(v3, k__cospi_p24_p08); - u6 = _mm_madd_epi16(v2, k__cospi_m08_p24); - u7 = _mm_madd_epi16(v3, k__cospi_m08_p24); - - // shift and rounding - v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING); - v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING); - v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING); - v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING); - v4 = _mm_add_epi32(u4, k__DCT_CONST_ROUNDING); - v5 = _mm_add_epi32(u5, k__DCT_CONST_ROUNDING); - v6 = _mm_add_epi32(u6, k__DCT_CONST_ROUNDING); - v7 = _mm_add_epi32(u7, k__DCT_CONST_ROUNDING); - - u0 = _mm_srai_epi32(v0, DCT_CONST_BITS); - u1 = _mm_srai_epi32(v1, DCT_CONST_BITS); - u2 = _mm_srai_epi32(v2, DCT_CONST_BITS); - u3 = _mm_srai_epi32(v3, DCT_CONST_BITS); - u4 = _mm_srai_epi32(v4, DCT_CONST_BITS); - u5 = _mm_srai_epi32(v5, DCT_CONST_BITS); - u6 = _mm_srai_epi32(v6, DCT_CONST_BITS); - u7 = _mm_srai_epi32(v7, DCT_CONST_BITS); - - in[0] = _mm_packs_epi32(u0, u1); - in[2] = _mm_packs_epi32(u4, u5); - in[4] = _mm_packs_epi32(u2, u3); - in[6] = _mm_packs_epi32(u6, u7); - - // stage 2 - // interleave and perform butterfly multiplication/addition - u0 = _mm_unpacklo_epi16(s6, s5); - u1 = _mm_unpackhi_epi16(s6, s5); - v0 = _mm_madd_epi16(u0, k__cospi_p16_m16); - v1 = _mm_madd_epi16(u1, k__cospi_p16_m16); - v2 = _mm_madd_epi16(u0, k__cospi_p16_p16); - v3 = _mm_madd_epi16(u1, k__cospi_p16_p16); - - // shift and rounding - u0 = _mm_add_epi32(v0, k__DCT_CONST_ROUNDING); - u1 = _mm_add_epi32(v1, k__DCT_CONST_ROUNDING); - u2 = _mm_add_epi32(v2, k__DCT_CONST_ROUNDING); - u3 = _mm_add_epi32(v3, k__DCT_CONST_ROUNDING); - - v0 = _mm_srai_epi32(u0, DCT_CONST_BITS); - v1 = _mm_srai_epi32(u1, DCT_CONST_BITS); - v2 = _mm_srai_epi32(u2, DCT_CONST_BITS); - v3 = _mm_srai_epi32(u3, DCT_CONST_BITS); - - u0 = _mm_packs_epi32(v0, v1); - u1 = _mm_packs_epi32(v2, v3); - - // stage 3 - s0 = _mm_add_epi16(s4, u0); - s1 = _mm_sub_epi16(s4, u0); - s2 = _mm_sub_epi16(s7, u1); - s3 = _mm_add_epi16(s7, u1); - - // stage 4 - u0 = _mm_unpacklo_epi16(s0, s3); - u1 = _mm_unpackhi_epi16(s0, s3); - u2 = _mm_unpacklo_epi16(s1, s2); - u3 = _mm_unpackhi_epi16(s1, s2); - - v0 = _mm_madd_epi16(u0, k__cospi_p28_p04); - v1 = _mm_madd_epi16(u1, k__cospi_p28_p04); - v2 = _mm_madd_epi16(u2, k__cospi_p12_p20); - v3 = _mm_madd_epi16(u3, k__cospi_p12_p20); - v4 = _mm_madd_epi16(u2, k__cospi_m20_p12); - v5 = _mm_madd_epi16(u3, k__cospi_m20_p12); - v6 = _mm_madd_epi16(u0, k__cospi_m04_p28); - v7 = _mm_madd_epi16(u1, k__cospi_m04_p28); - - // shift and rounding - u0 = _mm_add_epi32(v0, k__DCT_CONST_ROUNDING); - u1 = _mm_add_epi32(v1, k__DCT_CONST_ROUNDING); - u2 = _mm_add_epi32(v2, k__DCT_CONST_ROUNDING); - u3 = _mm_add_epi32(v3, k__DCT_CONST_ROUNDING); - u4 = _mm_add_epi32(v4, k__DCT_CONST_ROUNDING); - u5 = _mm_add_epi32(v5, k__DCT_CONST_ROUNDING); - u6 = _mm_add_epi32(v6, k__DCT_CONST_ROUNDING); - u7 = _mm_add_epi32(v7, k__DCT_CONST_ROUNDING); - - v0 = _mm_srai_epi32(u0, DCT_CONST_BITS); - v1 = _mm_srai_epi32(u1, DCT_CONST_BITS); - v2 = _mm_srai_epi32(u2, DCT_CONST_BITS); - v3 = _mm_srai_epi32(u3, DCT_CONST_BITS); - v4 = _mm_srai_epi32(u4, DCT_CONST_BITS); - v5 = _mm_srai_epi32(u5, DCT_CONST_BITS); - v6 = _mm_srai_epi32(u6, DCT_CONST_BITS); - v7 = _mm_srai_epi32(u7, DCT_CONST_BITS); - - in[1] = _mm_packs_epi32(v0, v1); - in[3] = _mm_packs_epi32(v4, v5); - in[5] = _mm_packs_epi32(v2, v3); - in[7] = _mm_packs_epi32(v6, v7); - - // transpose - array_transpose_8x8(in, in); -} - -void fadst8_sse2(__m128i *in) { - // Constants - const __m128i k__cospi_p02_p30 = pair_set_epi16(cospi_2_64, cospi_30_64); - const __m128i k__cospi_p30_m02 = pair_set_epi16(cospi_30_64, -cospi_2_64); - const __m128i k__cospi_p10_p22 = pair_set_epi16(cospi_10_64, cospi_22_64); - const __m128i k__cospi_p22_m10 = pair_set_epi16(cospi_22_64, -cospi_10_64); - const __m128i k__cospi_p18_p14 = pair_set_epi16(cospi_18_64, cospi_14_64); - const __m128i k__cospi_p14_m18 = pair_set_epi16(cospi_14_64, -cospi_18_64); - const __m128i k__cospi_p26_p06 = pair_set_epi16(cospi_26_64, cospi_6_64); - const __m128i k__cospi_p06_m26 = pair_set_epi16(cospi_6_64, -cospi_26_64); - const __m128i k__cospi_p08_p24 = pair_set_epi16(cospi_8_64, cospi_24_64); - const __m128i k__cospi_p24_m08 = pair_set_epi16(cospi_24_64, -cospi_8_64); - const __m128i k__cospi_m24_p08 = pair_set_epi16(-cospi_24_64, cospi_8_64); - const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64); - const __m128i k__cospi_p16_p16 = _mm_set1_epi16((int16_t)cospi_16_64); - const __m128i k__const_0 = _mm_set1_epi16(0); - const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING); - - __m128i u0, u1, u2, u3, u4, u5, u6, u7, u8, u9, u10, u11, u12, u13, u14, u15; - __m128i v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15; - __m128i w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15; - __m128i s0, s1, s2, s3, s4, s5, s6, s7; - __m128i in0, in1, in2, in3, in4, in5, in6, in7; - - // properly aligned for butterfly input - in0 = in[7]; - in1 = in[0]; - in2 = in[5]; - in3 = in[2]; - in4 = in[3]; - in5 = in[4]; - in6 = in[1]; - in7 = in[6]; - - // column transformation - // stage 1 - // interleave and multiply/add into 32-bit integer - s0 = _mm_unpacklo_epi16(in0, in1); - s1 = _mm_unpackhi_epi16(in0, in1); - s2 = _mm_unpacklo_epi16(in2, in3); - s3 = _mm_unpackhi_epi16(in2, in3); - s4 = _mm_unpacklo_epi16(in4, in5); - s5 = _mm_unpackhi_epi16(in4, in5); - s6 = _mm_unpacklo_epi16(in6, in7); - s7 = _mm_unpackhi_epi16(in6, in7); - - u0 = _mm_madd_epi16(s0, k__cospi_p02_p30); - u1 = _mm_madd_epi16(s1, k__cospi_p02_p30); - u2 = _mm_madd_epi16(s0, k__cospi_p30_m02); - u3 = _mm_madd_epi16(s1, k__cospi_p30_m02); - u4 = _mm_madd_epi16(s2, k__cospi_p10_p22); - u5 = _mm_madd_epi16(s3, k__cospi_p10_p22); - u6 = _mm_madd_epi16(s2, k__cospi_p22_m10); - u7 = _mm_madd_epi16(s3, k__cospi_p22_m10); - u8 = _mm_madd_epi16(s4, k__cospi_p18_p14); - u9 = _mm_madd_epi16(s5, k__cospi_p18_p14); - u10 = _mm_madd_epi16(s4, k__cospi_p14_m18); - u11 = _mm_madd_epi16(s5, k__cospi_p14_m18); - u12 = _mm_madd_epi16(s6, k__cospi_p26_p06); - u13 = _mm_madd_epi16(s7, k__cospi_p26_p06); - u14 = _mm_madd_epi16(s6, k__cospi_p06_m26); - u15 = _mm_madd_epi16(s7, k__cospi_p06_m26); - - // addition - w0 = _mm_add_epi32(u0, u8); - w1 = _mm_add_epi32(u1, u9); - w2 = _mm_add_epi32(u2, u10); - w3 = _mm_add_epi32(u3, u11); - w4 = _mm_add_epi32(u4, u12); - w5 = _mm_add_epi32(u5, u13); - w6 = _mm_add_epi32(u6, u14); - w7 = _mm_add_epi32(u7, u15); - w8 = _mm_sub_epi32(u0, u8); - w9 = _mm_sub_epi32(u1, u9); - w10 = _mm_sub_epi32(u2, u10); - w11 = _mm_sub_epi32(u3, u11); - w12 = _mm_sub_epi32(u4, u12); - w13 = _mm_sub_epi32(u5, u13); - w14 = _mm_sub_epi32(u6, u14); - w15 = _mm_sub_epi32(u7, u15); - - // shift and rounding - v0 = _mm_add_epi32(w0, k__DCT_CONST_ROUNDING); - v1 = _mm_add_epi32(w1, k__DCT_CONST_ROUNDING); - v2 = _mm_add_epi32(w2, k__DCT_CONST_ROUNDING); - v3 = _mm_add_epi32(w3, k__DCT_CONST_ROUNDING); - v4 = _mm_add_epi32(w4, k__DCT_CONST_ROUNDING); - v5 = _mm_add_epi32(w5, k__DCT_CONST_ROUNDING); - v6 = _mm_add_epi32(w6, k__DCT_CONST_ROUNDING); - v7 = _mm_add_epi32(w7, k__DCT_CONST_ROUNDING); - v8 = _mm_add_epi32(w8, k__DCT_CONST_ROUNDING); - v9 = _mm_add_epi32(w9, k__DCT_CONST_ROUNDING); - v10 = _mm_add_epi32(w10, k__DCT_CONST_ROUNDING); - v11 = _mm_add_epi32(w11, k__DCT_CONST_ROUNDING); - v12 = _mm_add_epi32(w12, k__DCT_CONST_ROUNDING); - v13 = _mm_add_epi32(w13, k__DCT_CONST_ROUNDING); - v14 = _mm_add_epi32(w14, k__DCT_CONST_ROUNDING); - v15 = _mm_add_epi32(w15, k__DCT_CONST_ROUNDING); - - u0 = _mm_srai_epi32(v0, DCT_CONST_BITS); - u1 = _mm_srai_epi32(v1, DCT_CONST_BITS); - u2 = _mm_srai_epi32(v2, DCT_CONST_BITS); - u3 = _mm_srai_epi32(v3, DCT_CONST_BITS); - u4 = _mm_srai_epi32(v4, DCT_CONST_BITS); - u5 = _mm_srai_epi32(v5, DCT_CONST_BITS); - u6 = _mm_srai_epi32(v6, DCT_CONST_BITS); - u7 = _mm_srai_epi32(v7, DCT_CONST_BITS); - u8 = _mm_srai_epi32(v8, DCT_CONST_BITS); - u9 = _mm_srai_epi32(v9, DCT_CONST_BITS); - u10 = _mm_srai_epi32(v10, DCT_CONST_BITS); - u11 = _mm_srai_epi32(v11, DCT_CONST_BITS); - u12 = _mm_srai_epi32(v12, DCT_CONST_BITS); - u13 = _mm_srai_epi32(v13, DCT_CONST_BITS); - u14 = _mm_srai_epi32(v14, DCT_CONST_BITS); - u15 = _mm_srai_epi32(v15, DCT_CONST_BITS); - - // back to 16-bit and pack 8 integers into __m128i - in[0] = _mm_packs_epi32(u0, u1); - in[1] = _mm_packs_epi32(u2, u3); - in[2] = _mm_packs_epi32(u4, u5); - in[3] = _mm_packs_epi32(u6, u7); - in[4] = _mm_packs_epi32(u8, u9); - in[5] = _mm_packs_epi32(u10, u11); - in[6] = _mm_packs_epi32(u12, u13); - in[7] = _mm_packs_epi32(u14, u15); - - // stage 2 - s0 = _mm_add_epi16(in[0], in[2]); - s1 = _mm_add_epi16(in[1], in[3]); - s2 = _mm_sub_epi16(in[0], in[2]); - s3 = _mm_sub_epi16(in[1], in[3]); - u0 = _mm_unpacklo_epi16(in[4], in[5]); - u1 = _mm_unpackhi_epi16(in[4], in[5]); - u2 = _mm_unpacklo_epi16(in[6], in[7]); - u3 = _mm_unpackhi_epi16(in[6], in[7]); - - v0 = _mm_madd_epi16(u0, k__cospi_p08_p24); - v1 = _mm_madd_epi16(u1, k__cospi_p08_p24); - v2 = _mm_madd_epi16(u0, k__cospi_p24_m08); - v3 = _mm_madd_epi16(u1, k__cospi_p24_m08); - v4 = _mm_madd_epi16(u2, k__cospi_m24_p08); - v5 = _mm_madd_epi16(u3, k__cospi_m24_p08); - v6 = _mm_madd_epi16(u2, k__cospi_p08_p24); - v7 = _mm_madd_epi16(u3, k__cospi_p08_p24); - - w0 = _mm_add_epi32(v0, v4); - w1 = _mm_add_epi32(v1, v5); - w2 = _mm_add_epi32(v2, v6); - w3 = _mm_add_epi32(v3, v7); - w4 = _mm_sub_epi32(v0, v4); - w5 = _mm_sub_epi32(v1, v5); - w6 = _mm_sub_epi32(v2, v6); - w7 = _mm_sub_epi32(v3, v7); - - v0 = _mm_add_epi32(w0, k__DCT_CONST_ROUNDING); - v1 = _mm_add_epi32(w1, k__DCT_CONST_ROUNDING); - v2 = _mm_add_epi32(w2, k__DCT_CONST_ROUNDING); - v3 = _mm_add_epi32(w3, k__DCT_CONST_ROUNDING); - v4 = _mm_add_epi32(w4, k__DCT_CONST_ROUNDING); - v5 = _mm_add_epi32(w5, k__DCT_CONST_ROUNDING); - v6 = _mm_add_epi32(w6, k__DCT_CONST_ROUNDING); - v7 = _mm_add_epi32(w7, k__DCT_CONST_ROUNDING); - - u0 = _mm_srai_epi32(v0, DCT_CONST_BITS); - u1 = _mm_srai_epi32(v1, DCT_CONST_BITS); - u2 = _mm_srai_epi32(v2, DCT_CONST_BITS); - u3 = _mm_srai_epi32(v3, DCT_CONST_BITS); - u4 = _mm_srai_epi32(v4, DCT_CONST_BITS); - u5 = _mm_srai_epi32(v5, DCT_CONST_BITS); - u6 = _mm_srai_epi32(v6, DCT_CONST_BITS); - u7 = _mm_srai_epi32(v7, DCT_CONST_BITS); - - // back to 16-bit intergers - s4 = _mm_packs_epi32(u0, u1); - s5 = _mm_packs_epi32(u2, u3); - s6 = _mm_packs_epi32(u4, u5); - s7 = _mm_packs_epi32(u6, u7); - - // stage 3 - u0 = _mm_unpacklo_epi16(s2, s3); - u1 = _mm_unpackhi_epi16(s2, s3); - u2 = _mm_unpacklo_epi16(s6, s7); - u3 = _mm_unpackhi_epi16(s6, s7); - - v0 = _mm_madd_epi16(u0, k__cospi_p16_p16); - v1 = _mm_madd_epi16(u1, k__cospi_p16_p16); - v2 = _mm_madd_epi16(u0, k__cospi_p16_m16); - v3 = _mm_madd_epi16(u1, k__cospi_p16_m16); - v4 = _mm_madd_epi16(u2, k__cospi_p16_p16); - v5 = _mm_madd_epi16(u3, k__cospi_p16_p16); - v6 = _mm_madd_epi16(u2, k__cospi_p16_m16); - v7 = _mm_madd_epi16(u3, k__cospi_p16_m16); - - u0 = _mm_add_epi32(v0, k__DCT_CONST_ROUNDING); - u1 = _mm_add_epi32(v1, k__DCT_CONST_ROUNDING); - u2 = _mm_add_epi32(v2, k__DCT_CONST_ROUNDING); - u3 = _mm_add_epi32(v3, k__DCT_CONST_ROUNDING); - u4 = _mm_add_epi32(v4, k__DCT_CONST_ROUNDING); - u5 = _mm_add_epi32(v5, k__DCT_CONST_ROUNDING); - u6 = _mm_add_epi32(v6, k__DCT_CONST_ROUNDING); - u7 = _mm_add_epi32(v7, k__DCT_CONST_ROUNDING); - - v0 = _mm_srai_epi32(u0, DCT_CONST_BITS); - v1 = _mm_srai_epi32(u1, DCT_CONST_BITS); - v2 = _mm_srai_epi32(u2, DCT_CONST_BITS); - v3 = _mm_srai_epi32(u3, DCT_CONST_BITS); - v4 = _mm_srai_epi32(u4, DCT_CONST_BITS); - v5 = _mm_srai_epi32(u5, DCT_CONST_BITS); - v6 = _mm_srai_epi32(u6, DCT_CONST_BITS); - v7 = _mm_srai_epi32(u7, DCT_CONST_BITS); - - s2 = _mm_packs_epi32(v0, v1); - s3 = _mm_packs_epi32(v2, v3); - s6 = _mm_packs_epi32(v4, v5); - s7 = _mm_packs_epi32(v6, v7); - - // FIXME(jingning): do subtract using bit inversion? - in[0] = s0; - in[1] = _mm_sub_epi16(k__const_0, s4); - in[2] = s6; - in[3] = _mm_sub_epi16(k__const_0, s2); - in[4] = s3; - in[5] = _mm_sub_epi16(k__const_0, s7); - in[6] = s5; - in[7] = _mm_sub_epi16(k__const_0, s1); - - // transpose - array_transpose_8x8(in, in); -} - -void vp9_fht8x8_sse2(const int16_t *input, tran_low_t *output, - int stride, int tx_type) { - __m128i in[8]; - - switch (tx_type) { - case DCT_DCT: - vp9_fdct8x8_sse2(input, output, stride); - break; - case ADST_DCT: - load_buffer_8x8(input, in, stride); - fadst8_sse2(in); - fdct8_sse2(in); - right_shift_8x8(in, 1); - write_buffer_8x8(output, in, 8); - break; - case DCT_ADST: - load_buffer_8x8(input, in, stride); - fdct8_sse2(in); - fadst8_sse2(in); - right_shift_8x8(in, 1); - write_buffer_8x8(output, in, 8); - break; - case ADST_ADST: - load_buffer_8x8(input, in, stride); - fadst8_sse2(in); - fadst8_sse2(in); - right_shift_8x8(in, 1); - write_buffer_8x8(output, in, 8); - break; - default: - assert(0); - break; - } -} - -void vp9_fdct16x16_1_sse2(const int16_t *input, tran_low_t *output, - int stride) { - __m128i in0, in1, in2, in3; - __m128i u0, u1; - __m128i sum = _mm_setzero_si128(); - int i; - - for (i = 0; i < 2; ++i) { - input += 8 * i; - in0 = _mm_load_si128((const __m128i *)(input + 0 * stride)); - in1 = _mm_load_si128((const __m128i *)(input + 1 * stride)); - in2 = _mm_load_si128((const __m128i *)(input + 2 * stride)); - in3 = _mm_load_si128((const __m128i *)(input + 3 * stride)); - - u0 = _mm_add_epi16(in0, in1); - u1 = _mm_add_epi16(in2, in3); - sum = _mm_add_epi16(sum, u0); - - in0 = _mm_load_si128((const __m128i *)(input + 4 * stride)); - in1 = _mm_load_si128((const __m128i *)(input + 5 * stride)); - in2 = _mm_load_si128((const __m128i *)(input + 6 * stride)); - in3 = _mm_load_si128((const __m128i *)(input + 7 * stride)); - - sum = _mm_add_epi16(sum, u1); - u0 = _mm_add_epi16(in0, in1); - u1 = _mm_add_epi16(in2, in3); - sum = _mm_add_epi16(sum, u0); - - in0 = _mm_load_si128((const __m128i *)(input + 8 * stride)); - in1 = _mm_load_si128((const __m128i *)(input + 9 * stride)); - in2 = _mm_load_si128((const __m128i *)(input + 10 * stride)); - in3 = _mm_load_si128((const __m128i *)(input + 11 * stride)); - - sum = _mm_add_epi16(sum, u1); - u0 = _mm_add_epi16(in0, in1); - u1 = _mm_add_epi16(in2, in3); - sum = _mm_add_epi16(sum, u0); - - in0 = _mm_load_si128((const __m128i *)(input + 12 * stride)); - in1 = _mm_load_si128((const __m128i *)(input + 13 * stride)); - in2 = _mm_load_si128((const __m128i *)(input + 14 * stride)); - in3 = _mm_load_si128((const __m128i *)(input + 15 * stride)); - - sum = _mm_add_epi16(sum, u1); - u0 = _mm_add_epi16(in0, in1); - u1 = _mm_add_epi16(in2, in3); - sum = _mm_add_epi16(sum, u0); - - sum = _mm_add_epi16(sum, u1); - } - - u0 = _mm_setzero_si128(); - in0 = _mm_unpacklo_epi16(u0, sum); - in1 = _mm_unpackhi_epi16(u0, sum); - in0 = _mm_srai_epi32(in0, 16); - in1 = _mm_srai_epi32(in1, 16); - - sum = _mm_add_epi32(in0, in1); - in0 = _mm_unpacklo_epi32(sum, u0); - in1 = _mm_unpackhi_epi32(sum, u0); - - sum = _mm_add_epi32(in0, in1); - in0 = _mm_srli_si128(sum, 8); - - in1 = _mm_add_epi32(sum, in0); - in1 = _mm_srai_epi32(in1, 1); - store_output(&in1, output); -} - -static INLINE void load_buffer_16x16(const int16_t* input, __m128i *in0, - __m128i *in1, int stride) { - // load first 8 columns - load_buffer_8x8(input, in0, stride); - load_buffer_8x8(input + 8 * stride, in0 + 8, stride); - - input += 8; - // load second 8 columns - load_buffer_8x8(input, in1, stride); - load_buffer_8x8(input + 8 * stride, in1 + 8, stride); -} - -static INLINE void write_buffer_16x16(tran_low_t *output, __m128i *in0, - __m128i *in1, int stride) { - // write first 8 columns - write_buffer_8x8(output, in0, stride); - write_buffer_8x8(output + 8 * stride, in0 + 8, stride); - // write second 8 columns - output += 8; - write_buffer_8x8(output, in1, stride); - write_buffer_8x8(output + 8 * stride, in1 + 8, stride); -} - -static INLINE void array_transpose_16x16(__m128i *res0, __m128i *res1) { - __m128i tbuf[8]; - array_transpose_8x8(res0, res0); - array_transpose_8x8(res1, tbuf); - array_transpose_8x8(res0 + 8, res1); - array_transpose_8x8(res1 + 8, res1 + 8); - - res0[8] = tbuf[0]; - res0[9] = tbuf[1]; - res0[10] = tbuf[2]; - res0[11] = tbuf[3]; - res0[12] = tbuf[4]; - res0[13] = tbuf[5]; - res0[14] = tbuf[6]; - res0[15] = tbuf[7]; -} - -static INLINE void right_shift_16x16(__m128i *res0, __m128i *res1) { - // perform rounding operations - right_shift_8x8(res0, 2); - right_shift_8x8(res0 + 8, 2); - right_shift_8x8(res1, 2); - right_shift_8x8(res1 + 8, 2); -} - -void fdct16_8col(__m128i *in) { - // perform 16x16 1-D DCT for 8 columns - __m128i i[8], s[8], p[8], t[8], u[16], v[16]; - const __m128i k__cospi_p16_p16 = _mm_set1_epi16((int16_t)cospi_16_64); - const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64); - const __m128i k__cospi_m16_p16 = pair_set_epi16(-cospi_16_64, cospi_16_64); - const __m128i k__cospi_p24_p08 = pair_set_epi16(cospi_24_64, cospi_8_64); - const __m128i k__cospi_p08_m24 = pair_set_epi16(cospi_8_64, -cospi_24_64); - const __m128i k__cospi_m08_p24 = pair_set_epi16(-cospi_8_64, cospi_24_64); - const __m128i k__cospi_p28_p04 = pair_set_epi16(cospi_28_64, cospi_4_64); - const __m128i k__cospi_m04_p28 = pair_set_epi16(-cospi_4_64, cospi_28_64); - const __m128i k__cospi_p12_p20 = pair_set_epi16(cospi_12_64, cospi_20_64); - const __m128i k__cospi_m20_p12 = pair_set_epi16(-cospi_20_64, cospi_12_64); - const __m128i k__cospi_p30_p02 = pair_set_epi16(cospi_30_64, cospi_2_64); - const __m128i k__cospi_p14_p18 = pair_set_epi16(cospi_14_64, cospi_18_64); - const __m128i k__cospi_m02_p30 = pair_set_epi16(-cospi_2_64, cospi_30_64); - const __m128i k__cospi_m18_p14 = pair_set_epi16(-cospi_18_64, cospi_14_64); - const __m128i k__cospi_p22_p10 = pair_set_epi16(cospi_22_64, cospi_10_64); - const __m128i k__cospi_p06_p26 = pair_set_epi16(cospi_6_64, cospi_26_64); - const __m128i k__cospi_m10_p22 = pair_set_epi16(-cospi_10_64, cospi_22_64); - const __m128i k__cospi_m26_p06 = pair_set_epi16(-cospi_26_64, cospi_6_64); - const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING); - - // stage 1 - i[0] = _mm_add_epi16(in[0], in[15]); - i[1] = _mm_add_epi16(in[1], in[14]); - i[2] = _mm_add_epi16(in[2], in[13]); - i[3] = _mm_add_epi16(in[3], in[12]); - i[4] = _mm_add_epi16(in[4], in[11]); - i[5] = _mm_add_epi16(in[5], in[10]); - i[6] = _mm_add_epi16(in[6], in[9]); - i[7] = _mm_add_epi16(in[7], in[8]); - - s[0] = _mm_sub_epi16(in[7], in[8]); - s[1] = _mm_sub_epi16(in[6], in[9]); - s[2] = _mm_sub_epi16(in[5], in[10]); - s[3] = _mm_sub_epi16(in[4], in[11]); - s[4] = _mm_sub_epi16(in[3], in[12]); - s[5] = _mm_sub_epi16(in[2], in[13]); - s[6] = _mm_sub_epi16(in[1], in[14]); - s[7] = _mm_sub_epi16(in[0], in[15]); - - p[0] = _mm_add_epi16(i[0], i[7]); - p[1] = _mm_add_epi16(i[1], i[6]); - p[2] = _mm_add_epi16(i[2], i[5]); - p[3] = _mm_add_epi16(i[3], i[4]); - p[4] = _mm_sub_epi16(i[3], i[4]); - p[5] = _mm_sub_epi16(i[2], i[5]); - p[6] = _mm_sub_epi16(i[1], i[6]); - p[7] = _mm_sub_epi16(i[0], i[7]); - - u[0] = _mm_add_epi16(p[0], p[3]); - u[1] = _mm_add_epi16(p[1], p[2]); - u[2] = _mm_sub_epi16(p[1], p[2]); - u[3] = _mm_sub_epi16(p[0], p[3]); - - v[0] = _mm_unpacklo_epi16(u[0], u[1]); - v[1] = _mm_unpackhi_epi16(u[0], u[1]); - v[2] = _mm_unpacklo_epi16(u[2], u[3]); - v[3] = _mm_unpackhi_epi16(u[2], u[3]); - - u[0] = _mm_madd_epi16(v[0], k__cospi_p16_p16); - u[1] = _mm_madd_epi16(v[1], k__cospi_p16_p16); - u[2] = _mm_madd_epi16(v[0], k__cospi_p16_m16); - u[3] = _mm_madd_epi16(v[1], k__cospi_p16_m16); - u[4] = _mm_madd_epi16(v[2], k__cospi_p24_p08); - u[5] = _mm_madd_epi16(v[3], k__cospi_p24_p08); - u[6] = _mm_madd_epi16(v[2], k__cospi_m08_p24); - u[7] = _mm_madd_epi16(v[3], k__cospi_m08_p24); - - v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING); - v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING); - v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING); - v[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING); - v[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING); - v[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING); - v[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING); - v[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING); - - u[0] = _mm_srai_epi32(v[0], DCT_CONST_BITS); - u[1] = _mm_srai_epi32(v[1], DCT_CONST_BITS); - u[2] = _mm_srai_epi32(v[2], DCT_CONST_BITS); - u[3] = _mm_srai_epi32(v[3], DCT_CONST_BITS); - u[4] = _mm_srai_epi32(v[4], DCT_CONST_BITS); - u[5] = _mm_srai_epi32(v[5], DCT_CONST_BITS); - u[6] = _mm_srai_epi32(v[6], DCT_CONST_BITS); - u[7] = _mm_srai_epi32(v[7], DCT_CONST_BITS); - - in[0] = _mm_packs_epi32(u[0], u[1]); - in[4] = _mm_packs_epi32(u[4], u[5]); - in[8] = _mm_packs_epi32(u[2], u[3]); - in[12] = _mm_packs_epi32(u[6], u[7]); - - u[0] = _mm_unpacklo_epi16(p[5], p[6]); - u[1] = _mm_unpackhi_epi16(p[5], p[6]); - v[0] = _mm_madd_epi16(u[0], k__cospi_m16_p16); - v[1] = _mm_madd_epi16(u[1], k__cospi_m16_p16); - v[2] = _mm_madd_epi16(u[0], k__cospi_p16_p16); - v[3] = _mm_madd_epi16(u[1], k__cospi_p16_p16); - - u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING); - u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING); - u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING); - u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING); - - v[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS); - v[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS); - v[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS); - v[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS); - - u[0] = _mm_packs_epi32(v[0], v[1]); - u[1] = _mm_packs_epi32(v[2], v[3]); - - t[0] = _mm_add_epi16(p[4], u[0]); - t[1] = _mm_sub_epi16(p[4], u[0]); - t[2] = _mm_sub_epi16(p[7], u[1]); - t[3] = _mm_add_epi16(p[7], u[1]); - - u[0] = _mm_unpacklo_epi16(t[0], t[3]); - u[1] = _mm_unpackhi_epi16(t[0], t[3]); - u[2] = _mm_unpacklo_epi16(t[1], t[2]); - u[3] = _mm_unpackhi_epi16(t[1], t[2]); - - v[0] = _mm_madd_epi16(u[0], k__cospi_p28_p04); - v[1] = _mm_madd_epi16(u[1], k__cospi_p28_p04); - v[2] = _mm_madd_epi16(u[2], k__cospi_p12_p20); - v[3] = _mm_madd_epi16(u[3], k__cospi_p12_p20); - v[4] = _mm_madd_epi16(u[2], k__cospi_m20_p12); - v[5] = _mm_madd_epi16(u[3], k__cospi_m20_p12); - v[6] = _mm_madd_epi16(u[0], k__cospi_m04_p28); - v[7] = _mm_madd_epi16(u[1], k__cospi_m04_p28); - - u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING); - u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING); - u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING); - u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING); - u[4] = _mm_add_epi32(v[4], k__DCT_CONST_ROUNDING); - u[5] = _mm_add_epi32(v[5], k__DCT_CONST_ROUNDING); - u[6] = _mm_add_epi32(v[6], k__DCT_CONST_ROUNDING); - u[7] = _mm_add_epi32(v[7], k__DCT_CONST_ROUNDING); - - v[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS); - v[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS); - v[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS); - v[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS); - v[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS); - v[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS); - v[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS); - v[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS); - - in[2] = _mm_packs_epi32(v[0], v[1]); - in[6] = _mm_packs_epi32(v[4], v[5]); - in[10] = _mm_packs_epi32(v[2], v[3]); - in[14] = _mm_packs_epi32(v[6], v[7]); - - // stage 2 - u[0] = _mm_unpacklo_epi16(s[2], s[5]); - u[1] = _mm_unpackhi_epi16(s[2], s[5]); - u[2] = _mm_unpacklo_epi16(s[3], s[4]); - u[3] = _mm_unpackhi_epi16(s[3], s[4]); - - v[0] = _mm_madd_epi16(u[0], k__cospi_m16_p16); - v[1] = _mm_madd_epi16(u[1], k__cospi_m16_p16); - v[2] = _mm_madd_epi16(u[2], k__cospi_m16_p16); - v[3] = _mm_madd_epi16(u[3], k__cospi_m16_p16); - v[4] = _mm_madd_epi16(u[2], k__cospi_p16_p16); - v[5] = _mm_madd_epi16(u[3], k__cospi_p16_p16); - v[6] = _mm_madd_epi16(u[0], k__cospi_p16_p16); - v[7] = _mm_madd_epi16(u[1], k__cospi_p16_p16); - - u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING); - u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING); - u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING); - u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING); - u[4] = _mm_add_epi32(v[4], k__DCT_CONST_ROUNDING); - u[5] = _mm_add_epi32(v[5], k__DCT_CONST_ROUNDING); - u[6] = _mm_add_epi32(v[6], k__DCT_CONST_ROUNDING); - u[7] = _mm_add_epi32(v[7], k__DCT_CONST_ROUNDING); - - v[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS); - v[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS); - v[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS); - v[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS); - v[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS); - v[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS); - v[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS); - v[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS); - - t[2] = _mm_packs_epi32(v[0], v[1]); - t[3] = _mm_packs_epi32(v[2], v[3]); - t[4] = _mm_packs_epi32(v[4], v[5]); - t[5] = _mm_packs_epi32(v[6], v[7]); - - // stage 3 - p[0] = _mm_add_epi16(s[0], t[3]); - p[1] = _mm_add_epi16(s[1], t[2]); - p[2] = _mm_sub_epi16(s[1], t[2]); - p[3] = _mm_sub_epi16(s[0], t[3]); - p[4] = _mm_sub_epi16(s[7], t[4]); - p[5] = _mm_sub_epi16(s[6], t[5]); - p[6] = _mm_add_epi16(s[6], t[5]); - p[7] = _mm_add_epi16(s[7], t[4]); - - // stage 4 - u[0] = _mm_unpacklo_epi16(p[1], p[6]); - u[1] = _mm_unpackhi_epi16(p[1], p[6]); - u[2] = _mm_unpacklo_epi16(p[2], p[5]); - u[3] = _mm_unpackhi_epi16(p[2], p[5]); - - v[0] = _mm_madd_epi16(u[0], k__cospi_m08_p24); - v[1] = _mm_madd_epi16(u[1], k__cospi_m08_p24); - v[2] = _mm_madd_epi16(u[2], k__cospi_p24_p08); - v[3] = _mm_madd_epi16(u[3], k__cospi_p24_p08); - v[4] = _mm_madd_epi16(u[2], k__cospi_p08_m24); - v[5] = _mm_madd_epi16(u[3], k__cospi_p08_m24); - v[6] = _mm_madd_epi16(u[0], k__cospi_p24_p08); - v[7] = _mm_madd_epi16(u[1], k__cospi_p24_p08); - - u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING); - u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING); - u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING); - u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING); - u[4] = _mm_add_epi32(v[4], k__DCT_CONST_ROUNDING); - u[5] = _mm_add_epi32(v[5], k__DCT_CONST_ROUNDING); - u[6] = _mm_add_epi32(v[6], k__DCT_CONST_ROUNDING); - u[7] = _mm_add_epi32(v[7], k__DCT_CONST_ROUNDING); - - v[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS); - v[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS); - v[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS); - v[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS); - v[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS); - v[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS); - v[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS); - v[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS); - - t[1] = _mm_packs_epi32(v[0], v[1]); - t[2] = _mm_packs_epi32(v[2], v[3]); - t[5] = _mm_packs_epi32(v[4], v[5]); - t[6] = _mm_packs_epi32(v[6], v[7]); - - // stage 5 - s[0] = _mm_add_epi16(p[0], t[1]); - s[1] = _mm_sub_epi16(p[0], t[1]); - s[2] = _mm_add_epi16(p[3], t[2]); - s[3] = _mm_sub_epi16(p[3], t[2]); - s[4] = _mm_sub_epi16(p[4], t[5]); - s[5] = _mm_add_epi16(p[4], t[5]); - s[6] = _mm_sub_epi16(p[7], t[6]); - s[7] = _mm_add_epi16(p[7], t[6]); - - // stage 6 - u[0] = _mm_unpacklo_epi16(s[0], s[7]); - u[1] = _mm_unpackhi_epi16(s[0], s[7]); - u[2] = _mm_unpacklo_epi16(s[1], s[6]); - u[3] = _mm_unpackhi_epi16(s[1], s[6]); - u[4] = _mm_unpacklo_epi16(s[2], s[5]); - u[5] = _mm_unpackhi_epi16(s[2], s[5]); - u[6] = _mm_unpacklo_epi16(s[3], s[4]); - u[7] = _mm_unpackhi_epi16(s[3], s[4]); - - v[0] = _mm_madd_epi16(u[0], k__cospi_p30_p02); - v[1] = _mm_madd_epi16(u[1], k__cospi_p30_p02); - v[2] = _mm_madd_epi16(u[2], k__cospi_p14_p18); - v[3] = _mm_madd_epi16(u[3], k__cospi_p14_p18); - v[4] = _mm_madd_epi16(u[4], k__cospi_p22_p10); - v[5] = _mm_madd_epi16(u[5], k__cospi_p22_p10); - v[6] = _mm_madd_epi16(u[6], k__cospi_p06_p26); - v[7] = _mm_madd_epi16(u[7], k__cospi_p06_p26); - v[8] = _mm_madd_epi16(u[6], k__cospi_m26_p06); - v[9] = _mm_madd_epi16(u[7], k__cospi_m26_p06); - v[10] = _mm_madd_epi16(u[4], k__cospi_m10_p22); - v[11] = _mm_madd_epi16(u[5], k__cospi_m10_p22); - v[12] = _mm_madd_epi16(u[2], k__cospi_m18_p14); - v[13] = _mm_madd_epi16(u[3], k__cospi_m18_p14); - v[14] = _mm_madd_epi16(u[0], k__cospi_m02_p30); - v[15] = _mm_madd_epi16(u[1], k__cospi_m02_p30); - - u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING); - u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING); - u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING); - u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING); - u[4] = _mm_add_epi32(v[4], k__DCT_CONST_ROUNDING); - u[5] = _mm_add_epi32(v[5], k__DCT_CONST_ROUNDING); - u[6] = _mm_add_epi32(v[6], k__DCT_CONST_ROUNDING); - u[7] = _mm_add_epi32(v[7], k__DCT_CONST_ROUNDING); - u[8] = _mm_add_epi32(v[8], k__DCT_CONST_ROUNDING); - u[9] = _mm_add_epi32(v[9], k__DCT_CONST_ROUNDING); - u[10] = _mm_add_epi32(v[10], k__DCT_CONST_ROUNDING); - u[11] = _mm_add_epi32(v[11], k__DCT_CONST_ROUNDING); - u[12] = _mm_add_epi32(v[12], k__DCT_CONST_ROUNDING); - u[13] = _mm_add_epi32(v[13], k__DCT_CONST_ROUNDING); - u[14] = _mm_add_epi32(v[14], k__DCT_CONST_ROUNDING); - u[15] = _mm_add_epi32(v[15], k__DCT_CONST_ROUNDING); - - v[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS); - v[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS); - v[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS); - v[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS); - v[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS); - v[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS); - v[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS); - v[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS); - v[8] = _mm_srai_epi32(u[8], DCT_CONST_BITS); - v[9] = _mm_srai_epi32(u[9], DCT_CONST_BITS); - v[10] = _mm_srai_epi32(u[10], DCT_CONST_BITS); - v[11] = _mm_srai_epi32(u[11], DCT_CONST_BITS); - v[12] = _mm_srai_epi32(u[12], DCT_CONST_BITS); - v[13] = _mm_srai_epi32(u[13], DCT_CONST_BITS); - v[14] = _mm_srai_epi32(u[14], DCT_CONST_BITS); - v[15] = _mm_srai_epi32(u[15], DCT_CONST_BITS); - - in[1] = _mm_packs_epi32(v[0], v[1]); - in[9] = _mm_packs_epi32(v[2], v[3]); - in[5] = _mm_packs_epi32(v[4], v[5]); - in[13] = _mm_packs_epi32(v[6], v[7]); - in[3] = _mm_packs_epi32(v[8], v[9]); - in[11] = _mm_packs_epi32(v[10], v[11]); - in[7] = _mm_packs_epi32(v[12], v[13]); - in[15] = _mm_packs_epi32(v[14], v[15]); -} - -void fadst16_8col(__m128i *in) { - // perform 16x16 1-D ADST for 8 columns - __m128i s[16], x[16], u[32], v[32]; - const __m128i k__cospi_p01_p31 = pair_set_epi16(cospi_1_64, cospi_31_64); - const __m128i k__cospi_p31_m01 = pair_set_epi16(cospi_31_64, -cospi_1_64); - const __m128i k__cospi_p05_p27 = pair_set_epi16(cospi_5_64, cospi_27_64); - const __m128i k__cospi_p27_m05 = pair_set_epi16(cospi_27_64, -cospi_5_64); - const __m128i k__cospi_p09_p23 = pair_set_epi16(cospi_9_64, cospi_23_64); - const __m128i k__cospi_p23_m09 = pair_set_epi16(cospi_23_64, -cospi_9_64); - const __m128i k__cospi_p13_p19 = pair_set_epi16(cospi_13_64, cospi_19_64); - const __m128i k__cospi_p19_m13 = pair_set_epi16(cospi_19_64, -cospi_13_64); - const __m128i k__cospi_p17_p15 = pair_set_epi16(cospi_17_64, cospi_15_64); - const __m128i k__cospi_p15_m17 = pair_set_epi16(cospi_15_64, -cospi_17_64); - const __m128i k__cospi_p21_p11 = pair_set_epi16(cospi_21_64, cospi_11_64); - const __m128i k__cospi_p11_m21 = pair_set_epi16(cospi_11_64, -cospi_21_64); - const __m128i k__cospi_p25_p07 = pair_set_epi16(cospi_25_64, cospi_7_64); - const __m128i k__cospi_p07_m25 = pair_set_epi16(cospi_7_64, -cospi_25_64); - const __m128i k__cospi_p29_p03 = pair_set_epi16(cospi_29_64, cospi_3_64); - const __m128i k__cospi_p03_m29 = pair_set_epi16(cospi_3_64, -cospi_29_64); - const __m128i k__cospi_p04_p28 = pair_set_epi16(cospi_4_64, cospi_28_64); - const __m128i k__cospi_p28_m04 = pair_set_epi16(cospi_28_64, -cospi_4_64); - const __m128i k__cospi_p20_p12 = pair_set_epi16(cospi_20_64, cospi_12_64); - const __m128i k__cospi_p12_m20 = pair_set_epi16(cospi_12_64, -cospi_20_64); - const __m128i k__cospi_m28_p04 = pair_set_epi16(-cospi_28_64, cospi_4_64); - const __m128i k__cospi_m12_p20 = pair_set_epi16(-cospi_12_64, cospi_20_64); - const __m128i k__cospi_p08_p24 = pair_set_epi16(cospi_8_64, cospi_24_64); - const __m128i k__cospi_p24_m08 = pair_set_epi16(cospi_24_64, -cospi_8_64); - const __m128i k__cospi_m24_p08 = pair_set_epi16(-cospi_24_64, cospi_8_64); - const __m128i k__cospi_m16_m16 = _mm_set1_epi16((int16_t)-cospi_16_64); - const __m128i k__cospi_p16_p16 = _mm_set1_epi16((int16_t)cospi_16_64); - const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64); - const __m128i k__cospi_m16_p16 = pair_set_epi16(-cospi_16_64, cospi_16_64); - const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING); - const __m128i kZero = _mm_set1_epi16(0); - - u[0] = _mm_unpacklo_epi16(in[15], in[0]); - u[1] = _mm_unpackhi_epi16(in[15], in[0]); - u[2] = _mm_unpacklo_epi16(in[13], in[2]); - u[3] = _mm_unpackhi_epi16(in[13], in[2]); - u[4] = _mm_unpacklo_epi16(in[11], in[4]); - u[5] = _mm_unpackhi_epi16(in[11], in[4]); - u[6] = _mm_unpacklo_epi16(in[9], in[6]); - u[7] = _mm_unpackhi_epi16(in[9], in[6]); - u[8] = _mm_unpacklo_epi16(in[7], in[8]); - u[9] = _mm_unpackhi_epi16(in[7], in[8]); - u[10] = _mm_unpacklo_epi16(in[5], in[10]); - u[11] = _mm_unpackhi_epi16(in[5], in[10]); - u[12] = _mm_unpacklo_epi16(in[3], in[12]); - u[13] = _mm_unpackhi_epi16(in[3], in[12]); - u[14] = _mm_unpacklo_epi16(in[1], in[14]); - u[15] = _mm_unpackhi_epi16(in[1], in[14]); - - v[0] = _mm_madd_epi16(u[0], k__cospi_p01_p31); - v[1] = _mm_madd_epi16(u[1], k__cospi_p01_p31); - v[2] = _mm_madd_epi16(u[0], k__cospi_p31_m01); - v[3] = _mm_madd_epi16(u[1], k__cospi_p31_m01); - v[4] = _mm_madd_epi16(u[2], k__cospi_p05_p27); - v[5] = _mm_madd_epi16(u[3], k__cospi_p05_p27); - v[6] = _mm_madd_epi16(u[2], k__cospi_p27_m05); - v[7] = _mm_madd_epi16(u[3], k__cospi_p27_m05); - v[8] = _mm_madd_epi16(u[4], k__cospi_p09_p23); - v[9] = _mm_madd_epi16(u[5], k__cospi_p09_p23); - v[10] = _mm_madd_epi16(u[4], k__cospi_p23_m09); - v[11] = _mm_madd_epi16(u[5], k__cospi_p23_m09); - v[12] = _mm_madd_epi16(u[6], k__cospi_p13_p19); - v[13] = _mm_madd_epi16(u[7], k__cospi_p13_p19); - v[14] = _mm_madd_epi16(u[6], k__cospi_p19_m13); - v[15] = _mm_madd_epi16(u[7], k__cospi_p19_m13); - v[16] = _mm_madd_epi16(u[8], k__cospi_p17_p15); - v[17] = _mm_madd_epi16(u[9], k__cospi_p17_p15); - v[18] = _mm_madd_epi16(u[8], k__cospi_p15_m17); - v[19] = _mm_madd_epi16(u[9], k__cospi_p15_m17); - v[20] = _mm_madd_epi16(u[10], k__cospi_p21_p11); - v[21] = _mm_madd_epi16(u[11], k__cospi_p21_p11); - v[22] = _mm_madd_epi16(u[10], k__cospi_p11_m21); - v[23] = _mm_madd_epi16(u[11], k__cospi_p11_m21); - v[24] = _mm_madd_epi16(u[12], k__cospi_p25_p07); - v[25] = _mm_madd_epi16(u[13], k__cospi_p25_p07); - v[26] = _mm_madd_epi16(u[12], k__cospi_p07_m25); - v[27] = _mm_madd_epi16(u[13], k__cospi_p07_m25); - v[28] = _mm_madd_epi16(u[14], k__cospi_p29_p03); - v[29] = _mm_madd_epi16(u[15], k__cospi_p29_p03); - v[30] = _mm_madd_epi16(u[14], k__cospi_p03_m29); - v[31] = _mm_madd_epi16(u[15], k__cospi_p03_m29); - - u[0] = _mm_add_epi32(v[0], v[16]); - u[1] = _mm_add_epi32(v[1], v[17]); - u[2] = _mm_add_epi32(v[2], v[18]); - u[3] = _mm_add_epi32(v[3], v[19]); - u[4] = _mm_add_epi32(v[4], v[20]); - u[5] = _mm_add_epi32(v[5], v[21]); - u[6] = _mm_add_epi32(v[6], v[22]); - u[7] = _mm_add_epi32(v[7], v[23]); - u[8] = _mm_add_epi32(v[8], v[24]); - u[9] = _mm_add_epi32(v[9], v[25]); - u[10] = _mm_add_epi32(v[10], v[26]); - u[11] = _mm_add_epi32(v[11], v[27]); - u[12] = _mm_add_epi32(v[12], v[28]); - u[13] = _mm_add_epi32(v[13], v[29]); - u[14] = _mm_add_epi32(v[14], v[30]); - u[15] = _mm_add_epi32(v[15], v[31]); - u[16] = _mm_sub_epi32(v[0], v[16]); - u[17] = _mm_sub_epi32(v[1], v[17]); - u[18] = _mm_sub_epi32(v[2], v[18]); - u[19] = _mm_sub_epi32(v[3], v[19]); - u[20] = _mm_sub_epi32(v[4], v[20]); - u[21] = _mm_sub_epi32(v[5], v[21]); - u[22] = _mm_sub_epi32(v[6], v[22]); - u[23] = _mm_sub_epi32(v[7], v[23]); - u[24] = _mm_sub_epi32(v[8], v[24]); - u[25] = _mm_sub_epi32(v[9], v[25]); - u[26] = _mm_sub_epi32(v[10], v[26]); - u[27] = _mm_sub_epi32(v[11], v[27]); - u[28] = _mm_sub_epi32(v[12], v[28]); - u[29] = _mm_sub_epi32(v[13], v[29]); - u[30] = _mm_sub_epi32(v[14], v[30]); - u[31] = _mm_sub_epi32(v[15], v[31]); - - v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING); - v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING); - v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING); - v[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING); - v[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING); - v[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING); - v[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING); - v[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING); - v[8] = _mm_add_epi32(u[8], k__DCT_CONST_ROUNDING); - v[9] = _mm_add_epi32(u[9], k__DCT_CONST_ROUNDING); - v[10] = _mm_add_epi32(u[10], k__DCT_CONST_ROUNDING); - v[11] = _mm_add_epi32(u[11], k__DCT_CONST_ROUNDING); - v[12] = _mm_add_epi32(u[12], k__DCT_CONST_ROUNDING); - v[13] = _mm_add_epi32(u[13], k__DCT_CONST_ROUNDING); - v[14] = _mm_add_epi32(u[14], k__DCT_CONST_ROUNDING); - v[15] = _mm_add_epi32(u[15], k__DCT_CONST_ROUNDING); - v[16] = _mm_add_epi32(u[16], k__DCT_CONST_ROUNDING); - v[17] = _mm_add_epi32(u[17], k__DCT_CONST_ROUNDING); - v[18] = _mm_add_epi32(u[18], k__DCT_CONST_ROUNDING); - v[19] = _mm_add_epi32(u[19], k__DCT_CONST_ROUNDING); - v[20] = _mm_add_epi32(u[20], k__DCT_CONST_ROUNDING); - v[21] = _mm_add_epi32(u[21], k__DCT_CONST_ROUNDING); - v[22] = _mm_add_epi32(u[22], k__DCT_CONST_ROUNDING); - v[23] = _mm_add_epi32(u[23], k__DCT_CONST_ROUNDING); - v[24] = _mm_add_epi32(u[24], k__DCT_CONST_ROUNDING); - v[25] = _mm_add_epi32(u[25], k__DCT_CONST_ROUNDING); - v[26] = _mm_add_epi32(u[26], k__DCT_CONST_ROUNDING); - v[27] = _mm_add_epi32(u[27], k__DCT_CONST_ROUNDING); - v[28] = _mm_add_epi32(u[28], k__DCT_CONST_ROUNDING); - v[29] = _mm_add_epi32(u[29], k__DCT_CONST_ROUNDING); - v[30] = _mm_add_epi32(u[30], k__DCT_CONST_ROUNDING); - v[31] = _mm_add_epi32(u[31], k__DCT_CONST_ROUNDING); - - u[0] = _mm_srai_epi32(v[0], DCT_CONST_BITS); - u[1] = _mm_srai_epi32(v[1], DCT_CONST_BITS); - u[2] = _mm_srai_epi32(v[2], DCT_CONST_BITS); - u[3] = _mm_srai_epi32(v[3], DCT_CONST_BITS); - u[4] = _mm_srai_epi32(v[4], DCT_CONST_BITS); - u[5] = _mm_srai_epi32(v[5], DCT_CONST_BITS); - u[6] = _mm_srai_epi32(v[6], DCT_CONST_BITS); - u[7] = _mm_srai_epi32(v[7], DCT_CONST_BITS); - u[8] = _mm_srai_epi32(v[8], DCT_CONST_BITS); - u[9] = _mm_srai_epi32(v[9], DCT_CONST_BITS); - u[10] = _mm_srai_epi32(v[10], DCT_CONST_BITS); - u[11] = _mm_srai_epi32(v[11], DCT_CONST_BITS); - u[12] = _mm_srai_epi32(v[12], DCT_CONST_BITS); - u[13] = _mm_srai_epi32(v[13], DCT_CONST_BITS); - u[14] = _mm_srai_epi32(v[14], DCT_CONST_BITS); - u[15] = _mm_srai_epi32(v[15], DCT_CONST_BITS); - u[16] = _mm_srai_epi32(v[16], DCT_CONST_BITS); - u[17] = _mm_srai_epi32(v[17], DCT_CONST_BITS); - u[18] = _mm_srai_epi32(v[18], DCT_CONST_BITS); - u[19] = _mm_srai_epi32(v[19], DCT_CONST_BITS); - u[20] = _mm_srai_epi32(v[20], DCT_CONST_BITS); - u[21] = _mm_srai_epi32(v[21], DCT_CONST_BITS); - u[22] = _mm_srai_epi32(v[22], DCT_CONST_BITS); - u[23] = _mm_srai_epi32(v[23], DCT_CONST_BITS); - u[24] = _mm_srai_epi32(v[24], DCT_CONST_BITS); - u[25] = _mm_srai_epi32(v[25], DCT_CONST_BITS); - u[26] = _mm_srai_epi32(v[26], DCT_CONST_BITS); - u[27] = _mm_srai_epi32(v[27], DCT_CONST_BITS); - u[28] = _mm_srai_epi32(v[28], DCT_CONST_BITS); - u[29] = _mm_srai_epi32(v[29], DCT_CONST_BITS); - u[30] = _mm_srai_epi32(v[30], DCT_CONST_BITS); - u[31] = _mm_srai_epi32(v[31], DCT_CONST_BITS); - - s[0] = _mm_packs_epi32(u[0], u[1]); - s[1] = _mm_packs_epi32(u[2], u[3]); - s[2] = _mm_packs_epi32(u[4], u[5]); - s[3] = _mm_packs_epi32(u[6], u[7]); - s[4] = _mm_packs_epi32(u[8], u[9]); - s[5] = _mm_packs_epi32(u[10], u[11]); - s[6] = _mm_packs_epi32(u[12], u[13]); - s[7] = _mm_packs_epi32(u[14], u[15]); - s[8] = _mm_packs_epi32(u[16], u[17]); - s[9] = _mm_packs_epi32(u[18], u[19]); - s[10] = _mm_packs_epi32(u[20], u[21]); - s[11] = _mm_packs_epi32(u[22], u[23]); - s[12] = _mm_packs_epi32(u[24], u[25]); - s[13] = _mm_packs_epi32(u[26], u[27]); - s[14] = _mm_packs_epi32(u[28], u[29]); - s[15] = _mm_packs_epi32(u[30], u[31]); - - // stage 2 - u[0] = _mm_unpacklo_epi16(s[8], s[9]); - u[1] = _mm_unpackhi_epi16(s[8], s[9]); - u[2] = _mm_unpacklo_epi16(s[10], s[11]); - u[3] = _mm_unpackhi_epi16(s[10], s[11]); - u[4] = _mm_unpacklo_epi16(s[12], s[13]); - u[5] = _mm_unpackhi_epi16(s[12], s[13]); - u[6] = _mm_unpacklo_epi16(s[14], s[15]); - u[7] = _mm_unpackhi_epi16(s[14], s[15]); - - v[0] = _mm_madd_epi16(u[0], k__cospi_p04_p28); - v[1] = _mm_madd_epi16(u[1], k__cospi_p04_p28); - v[2] = _mm_madd_epi16(u[0], k__cospi_p28_m04); - v[3] = _mm_madd_epi16(u[1], k__cospi_p28_m04); - v[4] = _mm_madd_epi16(u[2], k__cospi_p20_p12); - v[5] = _mm_madd_epi16(u[3], k__cospi_p20_p12); - v[6] = _mm_madd_epi16(u[2], k__cospi_p12_m20); - v[7] = _mm_madd_epi16(u[3], k__cospi_p12_m20); - v[8] = _mm_madd_epi16(u[4], k__cospi_m28_p04); - v[9] = _mm_madd_epi16(u[5], k__cospi_m28_p04); - v[10] = _mm_madd_epi16(u[4], k__cospi_p04_p28); - v[11] = _mm_madd_epi16(u[5], k__cospi_p04_p28); - v[12] = _mm_madd_epi16(u[6], k__cospi_m12_p20); - v[13] = _mm_madd_epi16(u[7], k__cospi_m12_p20); - v[14] = _mm_madd_epi16(u[6], k__cospi_p20_p12); - v[15] = _mm_madd_epi16(u[7], k__cospi_p20_p12); - - u[0] = _mm_add_epi32(v[0], v[8]); - u[1] = _mm_add_epi32(v[1], v[9]); - u[2] = _mm_add_epi32(v[2], v[10]); - u[3] = _mm_add_epi32(v[3], v[11]); - u[4] = _mm_add_epi32(v[4], v[12]); - u[5] = _mm_add_epi32(v[5], v[13]); - u[6] = _mm_add_epi32(v[6], v[14]); - u[7] = _mm_add_epi32(v[7], v[15]); - u[8] = _mm_sub_epi32(v[0], v[8]); - u[9] = _mm_sub_epi32(v[1], v[9]); - u[10] = _mm_sub_epi32(v[2], v[10]); - u[11] = _mm_sub_epi32(v[3], v[11]); - u[12] = _mm_sub_epi32(v[4], v[12]); - u[13] = _mm_sub_epi32(v[5], v[13]); - u[14] = _mm_sub_epi32(v[6], v[14]); - u[15] = _mm_sub_epi32(v[7], v[15]); - - v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING); - v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING); - v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING); - v[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING); - v[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING); - v[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING); - v[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING); - v[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING); - v[8] = _mm_add_epi32(u[8], k__DCT_CONST_ROUNDING); - v[9] = _mm_add_epi32(u[9], k__DCT_CONST_ROUNDING); - v[10] = _mm_add_epi32(u[10], k__DCT_CONST_ROUNDING); - v[11] = _mm_add_epi32(u[11], k__DCT_CONST_ROUNDING); - v[12] = _mm_add_epi32(u[12], k__DCT_CONST_ROUNDING); - v[13] = _mm_add_epi32(u[13], k__DCT_CONST_ROUNDING); - v[14] = _mm_add_epi32(u[14], k__DCT_CONST_ROUNDING); - v[15] = _mm_add_epi32(u[15], k__DCT_CONST_ROUNDING); - - u[0] = _mm_srai_epi32(v[0], DCT_CONST_BITS); - u[1] = _mm_srai_epi32(v[1], DCT_CONST_BITS); - u[2] = _mm_srai_epi32(v[2], DCT_CONST_BITS); - u[3] = _mm_srai_epi32(v[3], DCT_CONST_BITS); - u[4] = _mm_srai_epi32(v[4], DCT_CONST_BITS); - u[5] = _mm_srai_epi32(v[5], DCT_CONST_BITS); - u[6] = _mm_srai_epi32(v[6], DCT_CONST_BITS); - u[7] = _mm_srai_epi32(v[7], DCT_CONST_BITS); - u[8] = _mm_srai_epi32(v[8], DCT_CONST_BITS); - u[9] = _mm_srai_epi32(v[9], DCT_CONST_BITS); - u[10] = _mm_srai_epi32(v[10], DCT_CONST_BITS); - u[11] = _mm_srai_epi32(v[11], DCT_CONST_BITS); - u[12] = _mm_srai_epi32(v[12], DCT_CONST_BITS); - u[13] = _mm_srai_epi32(v[13], DCT_CONST_BITS); - u[14] = _mm_srai_epi32(v[14], DCT_CONST_BITS); - u[15] = _mm_srai_epi32(v[15], DCT_CONST_BITS); - - x[0] = _mm_add_epi16(s[0], s[4]); - x[1] = _mm_add_epi16(s[1], s[5]); - x[2] = _mm_add_epi16(s[2], s[6]); - x[3] = _mm_add_epi16(s[3], s[7]); - x[4] = _mm_sub_epi16(s[0], s[4]); - x[5] = _mm_sub_epi16(s[1], s[5]); - x[6] = _mm_sub_epi16(s[2], s[6]); - x[7] = _mm_sub_epi16(s[3], s[7]); - x[8] = _mm_packs_epi32(u[0], u[1]); - x[9] = _mm_packs_epi32(u[2], u[3]); - x[10] = _mm_packs_epi32(u[4], u[5]); - x[11] = _mm_packs_epi32(u[6], u[7]); - x[12] = _mm_packs_epi32(u[8], u[9]); - x[13] = _mm_packs_epi32(u[10], u[11]); - x[14] = _mm_packs_epi32(u[12], u[13]); - x[15] = _mm_packs_epi32(u[14], u[15]); - - // stage 3 - u[0] = _mm_unpacklo_epi16(x[4], x[5]); - u[1] = _mm_unpackhi_epi16(x[4], x[5]); - u[2] = _mm_unpacklo_epi16(x[6], x[7]); - u[3] = _mm_unpackhi_epi16(x[6], x[7]); - u[4] = _mm_unpacklo_epi16(x[12], x[13]); - u[5] = _mm_unpackhi_epi16(x[12], x[13]); - u[6] = _mm_unpacklo_epi16(x[14], x[15]); - u[7] = _mm_unpackhi_epi16(x[14], x[15]); - - v[0] = _mm_madd_epi16(u[0], k__cospi_p08_p24); - v[1] = _mm_madd_epi16(u[1], k__cospi_p08_p24); - v[2] = _mm_madd_epi16(u[0], k__cospi_p24_m08); - v[3] = _mm_madd_epi16(u[1], k__cospi_p24_m08); - v[4] = _mm_madd_epi16(u[2], k__cospi_m24_p08); - v[5] = _mm_madd_epi16(u[3], k__cospi_m24_p08); - v[6] = _mm_madd_epi16(u[2], k__cospi_p08_p24); - v[7] = _mm_madd_epi16(u[3], k__cospi_p08_p24); - v[8] = _mm_madd_epi16(u[4], k__cospi_p08_p24); - v[9] = _mm_madd_epi16(u[5], k__cospi_p08_p24); - v[10] = _mm_madd_epi16(u[4], k__cospi_p24_m08); - v[11] = _mm_madd_epi16(u[5], k__cospi_p24_m08); - v[12] = _mm_madd_epi16(u[6], k__cospi_m24_p08); - v[13] = _mm_madd_epi16(u[7], k__cospi_m24_p08); - v[14] = _mm_madd_epi16(u[6], k__cospi_p08_p24); - v[15] = _mm_madd_epi16(u[7], k__cospi_p08_p24); - - u[0] = _mm_add_epi32(v[0], v[4]); - u[1] = _mm_add_epi32(v[1], v[5]); - u[2] = _mm_add_epi32(v[2], v[6]); - u[3] = _mm_add_epi32(v[3], v[7]); - u[4] = _mm_sub_epi32(v[0], v[4]); - u[5] = _mm_sub_epi32(v[1], v[5]); - u[6] = _mm_sub_epi32(v[2], v[6]); - u[7] = _mm_sub_epi32(v[3], v[7]); - u[8] = _mm_add_epi32(v[8], v[12]); - u[9] = _mm_add_epi32(v[9], v[13]); - u[10] = _mm_add_epi32(v[10], v[14]); - u[11] = _mm_add_epi32(v[11], v[15]); - u[12] = _mm_sub_epi32(v[8], v[12]); - u[13] = _mm_sub_epi32(v[9], v[13]); - u[14] = _mm_sub_epi32(v[10], v[14]); - u[15] = _mm_sub_epi32(v[11], v[15]); - - u[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING); - u[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING); - u[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING); - u[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING); - u[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING); - u[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING); - u[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING); - u[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING); - u[8] = _mm_add_epi32(u[8], k__DCT_CONST_ROUNDING); - u[9] = _mm_add_epi32(u[9], k__DCT_CONST_ROUNDING); - u[10] = _mm_add_epi32(u[10], k__DCT_CONST_ROUNDING); - u[11] = _mm_add_epi32(u[11], k__DCT_CONST_ROUNDING); - u[12] = _mm_add_epi32(u[12], k__DCT_CONST_ROUNDING); - u[13] = _mm_add_epi32(u[13], k__DCT_CONST_ROUNDING); - u[14] = _mm_add_epi32(u[14], k__DCT_CONST_ROUNDING); - u[15] = _mm_add_epi32(u[15], k__DCT_CONST_ROUNDING); - - v[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS); - v[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS); - v[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS); - v[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS); - v[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS); - v[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS); - v[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS); - v[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS); - v[8] = _mm_srai_epi32(u[8], DCT_CONST_BITS); - v[9] = _mm_srai_epi32(u[9], DCT_CONST_BITS); - v[10] = _mm_srai_epi32(u[10], DCT_CONST_BITS); - v[11] = _mm_srai_epi32(u[11], DCT_CONST_BITS); - v[12] = _mm_srai_epi32(u[12], DCT_CONST_BITS); - v[13] = _mm_srai_epi32(u[13], DCT_CONST_BITS); - v[14] = _mm_srai_epi32(u[14], DCT_CONST_BITS); - v[15] = _mm_srai_epi32(u[15], DCT_CONST_BITS); - - s[0] = _mm_add_epi16(x[0], x[2]); - s[1] = _mm_add_epi16(x[1], x[3]); - s[2] = _mm_sub_epi16(x[0], x[2]); - s[3] = _mm_sub_epi16(x[1], x[3]); - s[4] = _mm_packs_epi32(v[0], v[1]); - s[5] = _mm_packs_epi32(v[2], v[3]); - s[6] = _mm_packs_epi32(v[4], v[5]); - s[7] = _mm_packs_epi32(v[6], v[7]); - s[8] = _mm_add_epi16(x[8], x[10]); - s[9] = _mm_add_epi16(x[9], x[11]); - s[10] = _mm_sub_epi16(x[8], x[10]); - s[11] = _mm_sub_epi16(x[9], x[11]); - s[12] = _mm_packs_epi32(v[8], v[9]); - s[13] = _mm_packs_epi32(v[10], v[11]); - s[14] = _mm_packs_epi32(v[12], v[13]); - s[15] = _mm_packs_epi32(v[14], v[15]); - - // stage 4 - u[0] = _mm_unpacklo_epi16(s[2], s[3]); - u[1] = _mm_unpackhi_epi16(s[2], s[3]); - u[2] = _mm_unpacklo_epi16(s[6], s[7]); - u[3] = _mm_unpackhi_epi16(s[6], s[7]); - u[4] = _mm_unpacklo_epi16(s[10], s[11]); - u[5] = _mm_unpackhi_epi16(s[10], s[11]); - u[6] = _mm_unpacklo_epi16(s[14], s[15]); - u[7] = _mm_unpackhi_epi16(s[14], s[15]); - - v[0] = _mm_madd_epi16(u[0], k__cospi_m16_m16); - v[1] = _mm_madd_epi16(u[1], k__cospi_m16_m16); - v[2] = _mm_madd_epi16(u[0], k__cospi_p16_m16); - v[3] = _mm_madd_epi16(u[1], k__cospi_p16_m16); - v[4] = _mm_madd_epi16(u[2], k__cospi_p16_p16); - v[5] = _mm_madd_epi16(u[3], k__cospi_p16_p16); - v[6] = _mm_madd_epi16(u[2], k__cospi_m16_p16); - v[7] = _mm_madd_epi16(u[3], k__cospi_m16_p16); - v[8] = _mm_madd_epi16(u[4], k__cospi_p16_p16); - v[9] = _mm_madd_epi16(u[5], k__cospi_p16_p16); - v[10] = _mm_madd_epi16(u[4], k__cospi_m16_p16); - v[11] = _mm_madd_epi16(u[5], k__cospi_m16_p16); - v[12] = _mm_madd_epi16(u[6], k__cospi_m16_m16); - v[13] = _mm_madd_epi16(u[7], k__cospi_m16_m16); - v[14] = _mm_madd_epi16(u[6], k__cospi_p16_m16); - v[15] = _mm_madd_epi16(u[7], k__cospi_p16_m16); - - u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING); - u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING); - u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING); - u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING); - u[4] = _mm_add_epi32(v[4], k__DCT_CONST_ROUNDING); - u[5] = _mm_add_epi32(v[5], k__DCT_CONST_ROUNDING); - u[6] = _mm_add_epi32(v[6], k__DCT_CONST_ROUNDING); - u[7] = _mm_add_epi32(v[7], k__DCT_CONST_ROUNDING); - u[8] = _mm_add_epi32(v[8], k__DCT_CONST_ROUNDING); - u[9] = _mm_add_epi32(v[9], k__DCT_CONST_ROUNDING); - u[10] = _mm_add_epi32(v[10], k__DCT_CONST_ROUNDING); - u[11] = _mm_add_epi32(v[11], k__DCT_CONST_ROUNDING); - u[12] = _mm_add_epi32(v[12], k__DCT_CONST_ROUNDING); - u[13] = _mm_add_epi32(v[13], k__DCT_CONST_ROUNDING); - u[14] = _mm_add_epi32(v[14], k__DCT_CONST_ROUNDING); - u[15] = _mm_add_epi32(v[15], k__DCT_CONST_ROUNDING); - - v[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS); - v[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS); - v[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS); - v[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS); - v[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS); - v[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS); - v[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS); - v[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS); - v[8] = _mm_srai_epi32(u[8], DCT_CONST_BITS); - v[9] = _mm_srai_epi32(u[9], DCT_CONST_BITS); - v[10] = _mm_srai_epi32(u[10], DCT_CONST_BITS); - v[11] = _mm_srai_epi32(u[11], DCT_CONST_BITS); - v[12] = _mm_srai_epi32(u[12], DCT_CONST_BITS); - v[13] = _mm_srai_epi32(u[13], DCT_CONST_BITS); - v[14] = _mm_srai_epi32(u[14], DCT_CONST_BITS); - v[15] = _mm_srai_epi32(u[15], DCT_CONST_BITS); - - in[0] = s[0]; - in[1] = _mm_sub_epi16(kZero, s[8]); - in[2] = s[12]; - in[3] = _mm_sub_epi16(kZero, s[4]); - in[4] = _mm_packs_epi32(v[4], v[5]); - in[5] = _mm_packs_epi32(v[12], v[13]); - in[6] = _mm_packs_epi32(v[8], v[9]); - in[7] = _mm_packs_epi32(v[0], v[1]); - in[8] = _mm_packs_epi32(v[2], v[3]); - in[9] = _mm_packs_epi32(v[10], v[11]); - in[10] = _mm_packs_epi32(v[14], v[15]); - in[11] = _mm_packs_epi32(v[6], v[7]); - in[12] = s[5]; - in[13] = _mm_sub_epi16(kZero, s[13]); - in[14] = s[9]; - in[15] = _mm_sub_epi16(kZero, s[1]); -} - -void fdct16_sse2(__m128i *in0, __m128i *in1) { - fdct16_8col(in0); - fdct16_8col(in1); - array_transpose_16x16(in0, in1); -} - -void fadst16_sse2(__m128i *in0, __m128i *in1) { - fadst16_8col(in0); - fadst16_8col(in1); - array_transpose_16x16(in0, in1); -} - -void vp9_fht16x16_sse2(const int16_t *input, tran_low_t *output, - int stride, int tx_type) { - __m128i in0[16], in1[16]; - - switch (tx_type) { - case DCT_DCT: - vp9_fdct16x16_sse2(input, output, stride); - break; - case ADST_DCT: - load_buffer_16x16(input, in0, in1, stride); - fadst16_sse2(in0, in1); - right_shift_16x16(in0, in1); - fdct16_sse2(in0, in1); - write_buffer_16x16(output, in0, in1, 16); - break; - case DCT_ADST: - load_buffer_16x16(input, in0, in1, stride); - fdct16_sse2(in0, in1); - right_shift_16x16(in0, in1); - fadst16_sse2(in0, in1); - write_buffer_16x16(output, in0, in1, 16); - break; - case ADST_ADST: - load_buffer_16x16(input, in0, in1, stride); - fadst16_sse2(in0, in1); - right_shift_16x16(in0, in1); - fadst16_sse2(in0, in1); - write_buffer_16x16(output, in0, in1, 16); - break; - default: - assert(0); - break; - } -} - -void vp9_fdct32x32_1_sse2(const int16_t *input, tran_low_t *output, - int stride) { - __m128i in0, in1, in2, in3; - __m128i u0, u1; - __m128i sum = _mm_setzero_si128(); - int i; - - for (i = 0; i < 8; ++i) { - in0 = _mm_load_si128((const __m128i *)(input + 0)); - in1 = _mm_load_si128((const __m128i *)(input + 8)); - in2 = _mm_load_si128((const __m128i *)(input + 16)); - in3 = _mm_load_si128((const __m128i *)(input + 24)); - - input += stride; - u0 = _mm_add_epi16(in0, in1); - u1 = _mm_add_epi16(in2, in3); - sum = _mm_add_epi16(sum, u0); - - in0 = _mm_load_si128((const __m128i *)(input + 0)); - in1 = _mm_load_si128((const __m128i *)(input + 8)); - in2 = _mm_load_si128((const __m128i *)(input + 16)); - in3 = _mm_load_si128((const __m128i *)(input + 24)); - - input += stride; - sum = _mm_add_epi16(sum, u1); - u0 = _mm_add_epi16(in0, in1); - u1 = _mm_add_epi16(in2, in3); - sum = _mm_add_epi16(sum, u0); - - in0 = _mm_load_si128((const __m128i *)(input + 0)); - in1 = _mm_load_si128((const __m128i *)(input + 8)); - in2 = _mm_load_si128((const __m128i *)(input + 16)); - in3 = _mm_load_si128((const __m128i *)(input + 24)); - - input += stride; - sum = _mm_add_epi16(sum, u1); - u0 = _mm_add_epi16(in0, in1); - u1 = _mm_add_epi16(in2, in3); - sum = _mm_add_epi16(sum, u0); - - in0 = _mm_load_si128((const __m128i *)(input + 0)); - in1 = _mm_load_si128((const __m128i *)(input + 8)); - in2 = _mm_load_si128((const __m128i *)(input + 16)); - in3 = _mm_load_si128((const __m128i *)(input + 24)); - - input += stride; - sum = _mm_add_epi16(sum, u1); - u0 = _mm_add_epi16(in0, in1); - u1 = _mm_add_epi16(in2, in3); - sum = _mm_add_epi16(sum, u0); - - sum = _mm_add_epi16(sum, u1); - } - - u0 = _mm_setzero_si128(); - in0 = _mm_unpacklo_epi16(u0, sum); - in1 = _mm_unpackhi_epi16(u0, sum); - in0 = _mm_srai_epi32(in0, 16); - in1 = _mm_srai_epi32(in1, 16); - - sum = _mm_add_epi32(in0, in1); - in0 = _mm_unpacklo_epi32(sum, u0); - in1 = _mm_unpackhi_epi32(sum, u0); - - sum = _mm_add_epi32(in0, in1); - in0 = _mm_srli_si128(sum, 8); - - in1 = _mm_add_epi32(sum, in0); - in1 = _mm_srai_epi32(in1, 3); - store_output(&in1, output); -} - -#if CONFIG_VP9_HIGHBITDEPTH -/* These SSE2 versions of the FHT functions only actually use SSE2 in the - * DCT_DCT case in all other cases, they revert to C code which is identical - * to that used by the C versions of them. - */ - -void vp9_highbd_fht4x4_sse2(const int16_t *input, tran_low_t *output, - int stride, int tx_type) { - if (tx_type == DCT_DCT) { - vp9_highbd_fdct4x4_sse2(input, output, stride); - } else { - tran_low_t out[4 * 4]; - tran_low_t *outptr = &out[0]; - int i, j; - tran_low_t temp_in[4], temp_out[4]; - const transform_2d ht = FHT_4[tx_type]; - - // Columns - for (i = 0; i < 4; ++i) { - for (j = 0; j < 4; ++j) - temp_in[j] = input[j * stride + i] * 16; - if (i == 0 && temp_in[0]) - temp_in[0] += 1; - ht.cols(temp_in, temp_out); - for (j = 0; j < 4; ++j) - outptr[j * 4 + i] = temp_out[j]; - } - - // Rows - for (i = 0; i < 4; ++i) { - for (j = 0; j < 4; ++j) - temp_in[j] = out[j + i * 4]; - ht.rows(temp_in, temp_out); - for (j = 0; j < 4; ++j) - output[j + i * 4] = (temp_out[j] + 1) >> 2; - } - } -} - -void vp9_highbd_fht8x8_sse2(const int16_t *input, tran_low_t *output, - int stride, int tx_type) { - if (tx_type == DCT_DCT) { - vp9_highbd_fdct8x8_sse2(input, output, stride); - } else { - tran_low_t out[64]; - tran_low_t *outptr = &out[0]; - int i, j; - tran_low_t temp_in[8], temp_out[8]; - const transform_2d ht = FHT_8[tx_type]; - - // Columns - for (i = 0; i < 8; ++i) { - for (j = 0; j < 8; ++j) - temp_in[j] = input[j * stride + i] * 4; - ht.cols(temp_in, temp_out); - for (j = 0; j < 8; ++j) - outptr[j * 8 + i] = temp_out[j]; - } - - // Rows - for (i = 0; i < 8; ++i) { - for (j = 0; j < 8; ++j) - temp_in[j] = out[j + i * 8]; - ht.rows(temp_in, temp_out); - for (j = 0; j < 8; ++j) - output[j + i * 8] = (temp_out[j] + (temp_out[j] < 0)) >> 1; - } - } -} - -void vp9_highbd_fht16x16_sse2(int16_t *input, tran_low_t *output, - int stride, int tx_type) { - if (tx_type == DCT_DCT) { - vp9_highbd_fdct16x16_sse2(input, output, stride); - } else { - tran_low_t out[256]; - tran_low_t *outptr = &out[0]; - int i, j; - tran_low_t temp_in[16], temp_out[16]; - const transform_2d ht = FHT_16[tx_type]; - - // Columns - for (i = 0; i < 16; ++i) { - for (j = 0; j < 16; ++j) - temp_in[j] = input[j * stride + i] * 4; - ht.cols(temp_in, temp_out); - for (j = 0; j < 16; ++j) - outptr[j * 16 + i] = (temp_out[j] + 1 + (temp_out[j] < 0)) >> 2; - } - - // Rows - for (i = 0; i < 16; ++i) { - for (j = 0; j < 16; ++j) - temp_in[j] = out[j + i * 16]; - ht.rows(temp_in, temp_out); - for (j = 0; j < 16; ++j) - output[j + i * 16] = temp_out[j]; - } - } -} -#endif // CONFIG_VP9_HIGHBITDEPTH - -/* - * The DCTnxn functions are defined using the macros below. The main code for - * them is in separate files (vp9/encoder/x86/vp9_dct_impl_sse2.c & - * vp9/encoder/x86/vp9_dct32x32_sse2.c) which are used by both the 8 bit code - * and the high bit depth code. - */ - -#define DCT_HIGH_BIT_DEPTH 0 - -#define FDCT4x4_2D vp9_fdct4x4_sse2 -#define FDCT8x8_2D vp9_fdct8x8_sse2 -#define FDCT16x16_2D vp9_fdct16x16_sse2 -#include "vp9/encoder/x86/vp9_dct_impl_sse2.c" -#undef FDCT4x4_2D -#undef FDCT8x8_2D -#undef FDCT16x16_2D - -#define FDCT32x32_2D vp9_fdct32x32_rd_sse2 -#define FDCT32x32_HIGH_PRECISION 0 -#include "vp9/encoder/x86/vp9_dct32x32_sse2.c" -#undef FDCT32x32_2D -#undef FDCT32x32_HIGH_PRECISION - -#define FDCT32x32_2D vp9_fdct32x32_sse2 -#define FDCT32x32_HIGH_PRECISION 1 -#include "vp9/encoder/x86/vp9_dct32x32_sse2.c" // NOLINT -#undef FDCT32x32_2D -#undef FDCT32x32_HIGH_PRECISION - -#undef DCT_HIGH_BIT_DEPTH - - -#if CONFIG_VP9_HIGHBITDEPTH - -#define DCT_HIGH_BIT_DEPTH 1 - -#define FDCT4x4_2D vp9_highbd_fdct4x4_sse2 -#define FDCT8x8_2D vp9_highbd_fdct8x8_sse2 -#define FDCT16x16_2D vp9_highbd_fdct16x16_sse2 -#include "vp9/encoder/x86/vp9_dct_impl_sse2.c" // NOLINT -#undef FDCT4x4_2D -#undef FDCT8x8_2D -#undef FDCT16x16_2D - -#define FDCT32x32_2D vp9_highbd_fdct32x32_rd_sse2 -#define FDCT32x32_HIGH_PRECISION 0 -#include "vp9/encoder/x86/vp9_dct32x32_sse2.c" // NOLINT -#undef FDCT32x32_2D -#undef FDCT32x32_HIGH_PRECISION - -#define FDCT32x32_2D vp9_highbd_fdct32x32_sse2 -#define FDCT32x32_HIGH_PRECISION 1 -#include "vp9/encoder/x86/vp9_dct32x32_sse2.c" // NOLINT -#undef FDCT32x32_2D -#undef FDCT32x32_HIGH_PRECISION - -#undef DCT_HIGH_BIT_DEPTH - -#endif // CONFIG_VP9_HIGHBITDEPTH diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct_sse2.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct_sse2.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct_sse2.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct_sse2.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,464 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VP9_ENCODER_X86_VP9_DCT_SSE2_H_ -#define VP9_ENCODER_X86_VP9_DCT_SSE2_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#define pair_set_epi32(a, b) \ - _mm_set_epi32((int)(b), (int)(a), (int)(b), (int)(a)) - -void vp9_fdct4x4_sse2(const int16_t *input, tran_low_t *output, int stride); -void vp9_fdct8x8_sse2(const int16_t *input, tran_low_t *output, int stride); -void vp9_fdct16x16_sse2(const int16_t *input, tran_low_t *output, int stride); -void vp9_highbd_fdct4x4_sse2(const int16_t *input, tran_low_t *output, - int stride); -void vp9_highbd_fdct8x8_sse2(const int16_t *input, tran_low_t *output, - int stride); -void vp9_highbd_fdct16x16_sse2(const int16_t *input, tran_low_t *output, - int stride); - -static INLINE __m128i k_madd_epi32(__m128i a, __m128i b) { - __m128i buf0, buf1; - buf0 = _mm_mul_epu32(a, b); - a = _mm_srli_epi64(a, 32); - b = _mm_srli_epi64(b, 32); - buf1 = _mm_mul_epu32(a, b); - return _mm_add_epi64(buf0, buf1); -} - -static INLINE __m128i k_packs_epi64(__m128i a, __m128i b) { - __m128i buf0 = _mm_shuffle_epi32(a, _MM_SHUFFLE(0, 0, 2, 0)); - __m128i buf1 = _mm_shuffle_epi32(b, _MM_SHUFFLE(0, 0, 2, 0)); - return _mm_unpacklo_epi64(buf0, buf1); -} - -static INLINE int check_epi16_overflow_x2(const __m128i *preg0, - const __m128i *preg1) { - const __m128i max_overflow = _mm_set1_epi16(0x7fff); - const __m128i min_overflow = _mm_set1_epi16(0x8000); - __m128i cmp0 = _mm_or_si128(_mm_cmpeq_epi16(*preg0, max_overflow), - _mm_cmpeq_epi16(*preg0, min_overflow)); - __m128i cmp1 = _mm_or_si128(_mm_cmpeq_epi16(*preg1, max_overflow), - _mm_cmpeq_epi16(*preg1, min_overflow)); - cmp0 = _mm_or_si128(cmp0, cmp1); - return _mm_movemask_epi8(cmp0); -} - -static INLINE int check_epi16_overflow_x4(const __m128i *preg0, - const __m128i *preg1, - const __m128i *preg2, - const __m128i *preg3) { - const __m128i max_overflow = _mm_set1_epi16(0x7fff); - const __m128i min_overflow = _mm_set1_epi16(0x8000); - __m128i cmp0 = _mm_or_si128(_mm_cmpeq_epi16(*preg0, max_overflow), - _mm_cmpeq_epi16(*preg0, min_overflow)); - __m128i cmp1 = _mm_or_si128(_mm_cmpeq_epi16(*preg1, max_overflow), - _mm_cmpeq_epi16(*preg1, min_overflow)); - __m128i cmp2 = _mm_or_si128(_mm_cmpeq_epi16(*preg2, max_overflow), - _mm_cmpeq_epi16(*preg2, min_overflow)); - __m128i cmp3 = _mm_or_si128(_mm_cmpeq_epi16(*preg3, max_overflow), - _mm_cmpeq_epi16(*preg3, min_overflow)); - cmp0 = _mm_or_si128(_mm_or_si128(cmp0, cmp1), _mm_or_si128(cmp2, cmp3)); - return _mm_movemask_epi8(cmp0); -} - -static INLINE int check_epi16_overflow_x8(const __m128i *preg0, - const __m128i *preg1, - const __m128i *preg2, - const __m128i *preg3, - const __m128i *preg4, - const __m128i *preg5, - const __m128i *preg6, - const __m128i *preg7) { - int res0, res1; - res0 = check_epi16_overflow_x4(preg0, preg1, preg2, preg3); - res1 = check_epi16_overflow_x4(preg4, preg5, preg6, preg7); - return res0 + res1; -} - -static INLINE int check_epi16_overflow_x12(const __m128i *preg0, - const __m128i *preg1, - const __m128i *preg2, - const __m128i *preg3, - const __m128i *preg4, - const __m128i *preg5, - const __m128i *preg6, - const __m128i *preg7, - const __m128i *preg8, - const __m128i *preg9, - const __m128i *preg10, - const __m128i *preg11) { - int res0, res1; - res0 = check_epi16_overflow_x4(preg0, preg1, preg2, preg3); - res1 = check_epi16_overflow_x4(preg4, preg5, preg6, preg7); - if (!res0) - res0 = check_epi16_overflow_x4(preg8, preg9, preg10, preg11); - return res0 + res1; -} - -static INLINE int check_epi16_overflow_x16(const __m128i *preg0, - const __m128i *preg1, - const __m128i *preg2, - const __m128i *preg3, - const __m128i *preg4, - const __m128i *preg5, - const __m128i *preg6, - const __m128i *preg7, - const __m128i *preg8, - const __m128i *preg9, - const __m128i *preg10, - const __m128i *preg11, - const __m128i *preg12, - const __m128i *preg13, - const __m128i *preg14, - const __m128i *preg15) { - int res0, res1; - res0 = check_epi16_overflow_x4(preg0, preg1, preg2, preg3); - res1 = check_epi16_overflow_x4(preg4, preg5, preg6, preg7); - if (!res0) { - res0 = check_epi16_overflow_x4(preg8, preg9, preg10, preg11); - if (!res1) - res1 = check_epi16_overflow_x4(preg12, preg13, preg14, preg15); - } - return res0 + res1; -} - -static INLINE int check_epi16_overflow_x32(const __m128i *preg0, - const __m128i *preg1, - const __m128i *preg2, - const __m128i *preg3, - const __m128i *preg4, - const __m128i *preg5, - const __m128i *preg6, - const __m128i *preg7, - const __m128i *preg8, - const __m128i *preg9, - const __m128i *preg10, - const __m128i *preg11, - const __m128i *preg12, - const __m128i *preg13, - const __m128i *preg14, - const __m128i *preg15, - const __m128i *preg16, - const __m128i *preg17, - const __m128i *preg18, - const __m128i *preg19, - const __m128i *preg20, - const __m128i *preg21, - const __m128i *preg22, - const __m128i *preg23, - const __m128i *preg24, - const __m128i *preg25, - const __m128i *preg26, - const __m128i *preg27, - const __m128i *preg28, - const __m128i *preg29, - const __m128i *preg30, - const __m128i *preg31) { - int res0, res1; - res0 = check_epi16_overflow_x4(preg0, preg1, preg2, preg3); - res1 = check_epi16_overflow_x4(preg4, preg5, preg6, preg7); - if (!res0) { - res0 = check_epi16_overflow_x4(preg8, preg9, preg10, preg11); - if (!res1) { - res1 = check_epi16_overflow_x4(preg12, preg13, preg14, preg15); - if (!res0) { - res0 = check_epi16_overflow_x4(preg16, preg17, preg18, preg19); - if (!res1) { - res1 = check_epi16_overflow_x4(preg20, preg21, preg22, preg23); - if (!res0) { - res0 = check_epi16_overflow_x4(preg24, preg25, preg26, preg27); - if (!res1) - res1 = check_epi16_overflow_x4(preg28, preg29, preg30, preg31); - } - } - } - } - } - return res0 + res1; -} - -static INLINE int k_check_epi32_overflow_4(const __m128i *preg0, - const __m128i *preg1, - const __m128i *preg2, - const __m128i *preg3, - const __m128i *zero) { - __m128i minus_one = _mm_set1_epi32(-1); - // Check for overflows - __m128i reg0_shifted = _mm_slli_epi64(*preg0, 1); - __m128i reg1_shifted = _mm_slli_epi64(*preg1, 1); - __m128i reg2_shifted = _mm_slli_epi64(*preg2, 1); - __m128i reg3_shifted = _mm_slli_epi64(*preg3, 1); - __m128i reg0_top_dwords = _mm_shuffle_epi32( - reg0_shifted, _MM_SHUFFLE(0, 0, 3, 1)); - __m128i reg1_top_dwords = _mm_shuffle_epi32( - reg1_shifted, _MM_SHUFFLE(0, 0, 3, 1)); - __m128i reg2_top_dwords = _mm_shuffle_epi32( - reg2_shifted, _MM_SHUFFLE(0, 0, 3, 1)); - __m128i reg3_top_dwords = _mm_shuffle_epi32( - reg3_shifted, _MM_SHUFFLE(0, 0, 3, 1)); - __m128i top_dwords_01 = _mm_unpacklo_epi64(reg0_top_dwords, reg1_top_dwords); - __m128i top_dwords_23 = _mm_unpacklo_epi64(reg2_top_dwords, reg3_top_dwords); - __m128i valid_positve_01 = _mm_cmpeq_epi32(top_dwords_01, *zero); - __m128i valid_positve_23 = _mm_cmpeq_epi32(top_dwords_23, *zero); - __m128i valid_negative_01 = _mm_cmpeq_epi32(top_dwords_01, minus_one); - __m128i valid_negative_23 = _mm_cmpeq_epi32(top_dwords_23, minus_one); - int overflow_01 = _mm_movemask_epi8( - _mm_cmpeq_epi32(valid_positve_01, valid_negative_01)); - int overflow_23 = _mm_movemask_epi8( - _mm_cmpeq_epi32(valid_positve_23, valid_negative_23)); - return (overflow_01 + overflow_23); -} - -static INLINE int k_check_epi32_overflow_8(const __m128i *preg0, - const __m128i *preg1, - const __m128i *preg2, - const __m128i *preg3, - const __m128i *preg4, - const __m128i *preg5, - const __m128i *preg6, - const __m128i *preg7, - const __m128i *zero) { - int overflow = k_check_epi32_overflow_4(preg0, preg1, preg2, preg3, zero); - if (!overflow) { - overflow = k_check_epi32_overflow_4(preg4, preg5, preg6, preg7, zero); - } - return overflow; -} - -static INLINE int k_check_epi32_overflow_16(const __m128i *preg0, - const __m128i *preg1, - const __m128i *preg2, - const __m128i *preg3, - const __m128i *preg4, - const __m128i *preg5, - const __m128i *preg6, - const __m128i *preg7, - const __m128i *preg8, - const __m128i *preg9, - const __m128i *preg10, - const __m128i *preg11, - const __m128i *preg12, - const __m128i *preg13, - const __m128i *preg14, - const __m128i *preg15, - const __m128i *zero) { - int overflow = k_check_epi32_overflow_4(preg0, preg1, preg2, preg3, zero); - if (!overflow) { - overflow = k_check_epi32_overflow_4(preg4, preg5, preg6, preg7, zero); - if (!overflow) { - overflow = k_check_epi32_overflow_4(preg8, preg9, preg10, preg11, - zero); - if (!overflow) { - overflow = k_check_epi32_overflow_4(preg12, preg13, preg14, preg15, - zero); - } - } - } - return overflow; -} - -static INLINE int k_check_epi32_overflow_32(const __m128i *preg0, - const __m128i *preg1, - const __m128i *preg2, - const __m128i *preg3, - const __m128i *preg4, - const __m128i *preg5, - const __m128i *preg6, - const __m128i *preg7, - const __m128i *preg8, - const __m128i *preg9, - const __m128i *preg10, - const __m128i *preg11, - const __m128i *preg12, - const __m128i *preg13, - const __m128i *preg14, - const __m128i *preg15, - const __m128i *preg16, - const __m128i *preg17, - const __m128i *preg18, - const __m128i *preg19, - const __m128i *preg20, - const __m128i *preg21, - const __m128i *preg22, - const __m128i *preg23, - const __m128i *preg24, - const __m128i *preg25, - const __m128i *preg26, - const __m128i *preg27, - const __m128i *preg28, - const __m128i *preg29, - const __m128i *preg30, - const __m128i *preg31, - const __m128i *zero) { - int overflow = k_check_epi32_overflow_4(preg0, preg1, preg2, preg3, zero); - if (!overflow) { - overflow = k_check_epi32_overflow_4(preg4, preg5, preg6, preg7, zero); - if (!overflow) { - overflow = k_check_epi32_overflow_4(preg8, preg9, preg10, preg11, zero); - if (!overflow) { - overflow = k_check_epi32_overflow_4(preg12, preg13, preg14, preg15, - zero); - if (!overflow) { - overflow = k_check_epi32_overflow_4(preg16, preg17, preg18, preg19, - zero); - if (!overflow) { - overflow = k_check_epi32_overflow_4(preg20, preg21, - preg22, preg23, zero); - if (!overflow) { - overflow = k_check_epi32_overflow_4(preg24, preg25, - preg26, preg27, zero); - if (!overflow) { - overflow = k_check_epi32_overflow_4(preg28, preg29, - preg30, preg31, zero); - } - } - } - } - } - } - } - return overflow; -} - -static INLINE void store_output(const __m128i *poutput, tran_low_t* dst_ptr) { -#if CONFIG_VP9_HIGHBITDEPTH - const __m128i zero = _mm_setzero_si128(); - const __m128i sign_bits = _mm_cmplt_epi16(*poutput, zero); - __m128i out0 = _mm_unpacklo_epi16(*poutput, sign_bits); - __m128i out1 = _mm_unpackhi_epi16(*poutput, sign_bits); - _mm_store_si128((__m128i *)(dst_ptr), out0); - _mm_store_si128((__m128i *)(dst_ptr + 4), out1); -#else - _mm_store_si128((__m128i *)(dst_ptr), *poutput); -#endif // CONFIG_VP9_HIGHBITDEPTH -} - -static INLINE void storeu_output(const __m128i *poutput, tran_low_t* dst_ptr) { -#if CONFIG_VP9_HIGHBITDEPTH - const __m128i zero = _mm_setzero_si128(); - const __m128i sign_bits = _mm_cmplt_epi16(*poutput, zero); - __m128i out0 = _mm_unpacklo_epi16(*poutput, sign_bits); - __m128i out1 = _mm_unpackhi_epi16(*poutput, sign_bits); - _mm_storeu_si128((__m128i *)(dst_ptr), out0); - _mm_storeu_si128((__m128i *)(dst_ptr + 4), out1); -#else - _mm_storeu_si128((__m128i *)(dst_ptr), *poutput); -#endif // CONFIG_VP9_HIGHBITDEPTH -} - - -static INLINE __m128i mult_round_shift(const __m128i *pin0, - const __m128i *pin1, - const __m128i *pmultiplier, - const __m128i *prounding, - const int shift) { - const __m128i u0 = _mm_madd_epi16(*pin0, *pmultiplier); - const __m128i u1 = _mm_madd_epi16(*pin1, *pmultiplier); - const __m128i v0 = _mm_add_epi32(u0, *prounding); - const __m128i v1 = _mm_add_epi32(u1, *prounding); - const __m128i w0 = _mm_srai_epi32(v0, shift); - const __m128i w1 = _mm_srai_epi32(v1, shift); - return _mm_packs_epi32(w0, w1); -} - -static INLINE void transpose_and_output8x8( - const __m128i *pin00, const __m128i *pin01, - const __m128i *pin02, const __m128i *pin03, - const __m128i *pin04, const __m128i *pin05, - const __m128i *pin06, const __m128i *pin07, - const int pass, int16_t* out0_ptr, - tran_low_t* out1_ptr) { - // 00 01 02 03 04 05 06 07 - // 10 11 12 13 14 15 16 17 - // 20 21 22 23 24 25 26 27 - // 30 31 32 33 34 35 36 37 - // 40 41 42 43 44 45 46 47 - // 50 51 52 53 54 55 56 57 - // 60 61 62 63 64 65 66 67 - // 70 71 72 73 74 75 76 77 - const __m128i tr0_0 = _mm_unpacklo_epi16(*pin00, *pin01); - const __m128i tr0_1 = _mm_unpacklo_epi16(*pin02, *pin03); - const __m128i tr0_2 = _mm_unpackhi_epi16(*pin00, *pin01); - const __m128i tr0_3 = _mm_unpackhi_epi16(*pin02, *pin03); - const __m128i tr0_4 = _mm_unpacklo_epi16(*pin04, *pin05); - const __m128i tr0_5 = _mm_unpacklo_epi16(*pin06, *pin07); - const __m128i tr0_6 = _mm_unpackhi_epi16(*pin04, *pin05); - const __m128i tr0_7 = _mm_unpackhi_epi16(*pin06, *pin07); - // 00 10 01 11 02 12 03 13 - // 20 30 21 31 22 32 23 33 - // 04 14 05 15 06 16 07 17 - // 24 34 25 35 26 36 27 37 - // 40 50 41 51 42 52 43 53 - // 60 70 61 71 62 72 63 73 - // 54 54 55 55 56 56 57 57 - // 64 74 65 75 66 76 67 77 - const __m128i tr1_0 = _mm_unpacklo_epi32(tr0_0, tr0_1); - const __m128i tr1_1 = _mm_unpacklo_epi32(tr0_2, tr0_3); - const __m128i tr1_2 = _mm_unpackhi_epi32(tr0_0, tr0_1); - const __m128i tr1_3 = _mm_unpackhi_epi32(tr0_2, tr0_3); - const __m128i tr1_4 = _mm_unpacklo_epi32(tr0_4, tr0_5); - const __m128i tr1_5 = _mm_unpacklo_epi32(tr0_6, tr0_7); - const __m128i tr1_6 = _mm_unpackhi_epi32(tr0_4, tr0_5); - const __m128i tr1_7 = _mm_unpackhi_epi32(tr0_6, tr0_7); - // 00 10 20 30 01 11 21 31 - // 40 50 60 70 41 51 61 71 - // 02 12 22 32 03 13 23 33 - // 42 52 62 72 43 53 63 73 - // 04 14 24 34 05 15 21 36 - // 44 54 64 74 45 55 61 76 - // 06 16 26 36 07 17 27 37 - // 46 56 66 76 47 57 67 77 - const __m128i tr2_0 = _mm_unpacklo_epi64(tr1_0, tr1_4); - const __m128i tr2_1 = _mm_unpackhi_epi64(tr1_0, tr1_4); - const __m128i tr2_2 = _mm_unpacklo_epi64(tr1_2, tr1_6); - const __m128i tr2_3 = _mm_unpackhi_epi64(tr1_2, tr1_6); - const __m128i tr2_4 = _mm_unpacklo_epi64(tr1_1, tr1_5); - const __m128i tr2_5 = _mm_unpackhi_epi64(tr1_1, tr1_5); - const __m128i tr2_6 = _mm_unpacklo_epi64(tr1_3, tr1_7); - const __m128i tr2_7 = _mm_unpackhi_epi64(tr1_3, tr1_7); - // 00 10 20 30 40 50 60 70 - // 01 11 21 31 41 51 61 71 - // 02 12 22 32 42 52 62 72 - // 03 13 23 33 43 53 63 73 - // 04 14 24 34 44 54 64 74 - // 05 15 25 35 45 55 65 75 - // 06 16 26 36 46 56 66 76 - // 07 17 27 37 47 57 67 77 - if (pass == 0) { - _mm_storeu_si128((__m128i*)(out0_ptr + 0 * 16), tr2_0); - _mm_storeu_si128((__m128i*)(out0_ptr + 1 * 16), tr2_1); - _mm_storeu_si128((__m128i*)(out0_ptr + 2 * 16), tr2_2); - _mm_storeu_si128((__m128i*)(out0_ptr + 3 * 16), tr2_3); - _mm_storeu_si128((__m128i*)(out0_ptr + 4 * 16), tr2_4); - _mm_storeu_si128((__m128i*)(out0_ptr + 5 * 16), tr2_5); - _mm_storeu_si128((__m128i*)(out0_ptr + 6 * 16), tr2_6); - _mm_storeu_si128((__m128i*)(out0_ptr + 7 * 16), tr2_7); - } else { - storeu_output(&tr2_0, (out1_ptr + 0 * 16)); - storeu_output(&tr2_1, (out1_ptr + 1 * 16)); - storeu_output(&tr2_2, (out1_ptr + 2 * 16)); - storeu_output(&tr2_3, (out1_ptr + 3 * 16)); - storeu_output(&tr2_4, (out1_ptr + 4 * 16)); - storeu_output(&tr2_5, (out1_ptr + 5 * 16)); - storeu_output(&tr2_6, (out1_ptr + 6 * 16)); - storeu_output(&tr2_7, (out1_ptr + 7 * 16)); - } -} - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VP9_ENCODER_X86_VP9_DCT_SSE2_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct_ssse3.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct_ssse3.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct_ssse3.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_dct_ssse3.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,456 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#if defined(_MSC_VER) && _MSC_VER <= 1500 -// Need to include math.h before calling tmmintrin.h/intrin.h -// in certain versions of MSVS. -#include -#endif -#include // SSSE3 -#include "vp9/common/x86/vp9_idct_intrin_sse2.h" - -void vp9_fdct8x8_quant_ssse3(const int16_t *input, int stride, - int16_t* coeff_ptr, intptr_t n_coeffs, - int skip_block, const int16_t* zbin_ptr, - const int16_t* round_ptr, const int16_t* quant_ptr, - const int16_t* quant_shift_ptr, - int16_t* qcoeff_ptr, - int16_t* dqcoeff_ptr, const int16_t* dequant_ptr, - uint16_t* eob_ptr, - const int16_t* scan_ptr, - const int16_t* iscan_ptr) { - __m128i zero; - int pass; - // Constants - // When we use them, in one case, they are all the same. In all others - // it's a pair of them that we need to repeat four times. This is done - // by constructing the 32 bit constant corresponding to that pair. - const __m128i k__dual_p16_p16 = dual_set_epi16(23170, 23170); - const __m128i k__cospi_p16_p16 = _mm_set1_epi16((int16_t)cospi_16_64); - const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64); - const __m128i k__cospi_p24_p08 = pair_set_epi16(cospi_24_64, cospi_8_64); - const __m128i k__cospi_m08_p24 = pair_set_epi16(-cospi_8_64, cospi_24_64); - const __m128i k__cospi_p28_p04 = pair_set_epi16(cospi_28_64, cospi_4_64); - const __m128i k__cospi_m04_p28 = pair_set_epi16(-cospi_4_64, cospi_28_64); - const __m128i k__cospi_p12_p20 = pair_set_epi16(cospi_12_64, cospi_20_64); - const __m128i k__cospi_m20_p12 = pair_set_epi16(-cospi_20_64, cospi_12_64); - const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING); - // Load input - __m128i in0 = _mm_load_si128((const __m128i *)(input + 0 * stride)); - __m128i in1 = _mm_load_si128((const __m128i *)(input + 1 * stride)); - __m128i in2 = _mm_load_si128((const __m128i *)(input + 2 * stride)); - __m128i in3 = _mm_load_si128((const __m128i *)(input + 3 * stride)); - __m128i in4 = _mm_load_si128((const __m128i *)(input + 4 * stride)); - __m128i in5 = _mm_load_si128((const __m128i *)(input + 5 * stride)); - __m128i in6 = _mm_load_si128((const __m128i *)(input + 6 * stride)); - __m128i in7 = _mm_load_si128((const __m128i *)(input + 7 * stride)); - __m128i *in[8]; - int index = 0; - - (void)scan_ptr; - (void)zbin_ptr; - (void)quant_shift_ptr; - (void)coeff_ptr; - - // Pre-condition input (shift by two) - in0 = _mm_slli_epi16(in0, 2); - in1 = _mm_slli_epi16(in1, 2); - in2 = _mm_slli_epi16(in2, 2); - in3 = _mm_slli_epi16(in3, 2); - in4 = _mm_slli_epi16(in4, 2); - in5 = _mm_slli_epi16(in5, 2); - in6 = _mm_slli_epi16(in6, 2); - in7 = _mm_slli_epi16(in7, 2); - - in[0] = &in0; - in[1] = &in1; - in[2] = &in2; - in[3] = &in3; - in[4] = &in4; - in[5] = &in5; - in[6] = &in6; - in[7] = &in7; - - // We do two passes, first the columns, then the rows. The results of the - // first pass are transposed so that the same column code can be reused. The - // results of the second pass are also transposed so that the rows (processed - // as columns) are put back in row positions. - for (pass = 0; pass < 2; pass++) { - // To store results of each pass before the transpose. - __m128i res0, res1, res2, res3, res4, res5, res6, res7; - // Add/subtract - const __m128i q0 = _mm_add_epi16(in0, in7); - const __m128i q1 = _mm_add_epi16(in1, in6); - const __m128i q2 = _mm_add_epi16(in2, in5); - const __m128i q3 = _mm_add_epi16(in3, in4); - const __m128i q4 = _mm_sub_epi16(in3, in4); - const __m128i q5 = _mm_sub_epi16(in2, in5); - const __m128i q6 = _mm_sub_epi16(in1, in6); - const __m128i q7 = _mm_sub_epi16(in0, in7); - // Work on first four results - { - // Add/subtract - const __m128i r0 = _mm_add_epi16(q0, q3); - const __m128i r1 = _mm_add_epi16(q1, q2); - const __m128i r2 = _mm_sub_epi16(q1, q2); - const __m128i r3 = _mm_sub_epi16(q0, q3); - // Interleave to do the multiply by constants which gets us into 32bits - const __m128i t0 = _mm_unpacklo_epi16(r0, r1); - const __m128i t1 = _mm_unpackhi_epi16(r0, r1); - const __m128i t2 = _mm_unpacklo_epi16(r2, r3); - const __m128i t3 = _mm_unpackhi_epi16(r2, r3); - - const __m128i u0 = _mm_madd_epi16(t0, k__cospi_p16_p16); - const __m128i u1 = _mm_madd_epi16(t1, k__cospi_p16_p16); - const __m128i u2 = _mm_madd_epi16(t0, k__cospi_p16_m16); - const __m128i u3 = _mm_madd_epi16(t1, k__cospi_p16_m16); - - const __m128i u4 = _mm_madd_epi16(t2, k__cospi_p24_p08); - const __m128i u5 = _mm_madd_epi16(t3, k__cospi_p24_p08); - const __m128i u6 = _mm_madd_epi16(t2, k__cospi_m08_p24); - const __m128i u7 = _mm_madd_epi16(t3, k__cospi_m08_p24); - // dct_const_round_shift - - const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING); - const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING); - const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING); - const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING); - - const __m128i v4 = _mm_add_epi32(u4, k__DCT_CONST_ROUNDING); - const __m128i v5 = _mm_add_epi32(u5, k__DCT_CONST_ROUNDING); - const __m128i v6 = _mm_add_epi32(u6, k__DCT_CONST_ROUNDING); - const __m128i v7 = _mm_add_epi32(u7, k__DCT_CONST_ROUNDING); - - const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS); - const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS); - const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS); - const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS); - - const __m128i w4 = _mm_srai_epi32(v4, DCT_CONST_BITS); - const __m128i w5 = _mm_srai_epi32(v5, DCT_CONST_BITS); - const __m128i w6 = _mm_srai_epi32(v6, DCT_CONST_BITS); - const __m128i w7 = _mm_srai_epi32(v7, DCT_CONST_BITS); - // Combine - - res0 = _mm_packs_epi32(w0, w1); - res4 = _mm_packs_epi32(w2, w3); - res2 = _mm_packs_epi32(w4, w5); - res6 = _mm_packs_epi32(w6, w7); - } - // Work on next four results - { - // Interleave to do the multiply by constants which gets us into 32bits - const __m128i d0 = _mm_sub_epi16(q6, q5); - const __m128i d1 = _mm_add_epi16(q6, q5); - const __m128i r0 = _mm_mulhrs_epi16(d0, k__dual_p16_p16); - const __m128i r1 = _mm_mulhrs_epi16(d1, k__dual_p16_p16); - - // Add/subtract - const __m128i x0 = _mm_add_epi16(q4, r0); - const __m128i x1 = _mm_sub_epi16(q4, r0); - const __m128i x2 = _mm_sub_epi16(q7, r1); - const __m128i x3 = _mm_add_epi16(q7, r1); - // Interleave to do the multiply by constants which gets us into 32bits - const __m128i t0 = _mm_unpacklo_epi16(x0, x3); - const __m128i t1 = _mm_unpackhi_epi16(x0, x3); - const __m128i t2 = _mm_unpacklo_epi16(x1, x2); - const __m128i t3 = _mm_unpackhi_epi16(x1, x2); - const __m128i u0 = _mm_madd_epi16(t0, k__cospi_p28_p04); - const __m128i u1 = _mm_madd_epi16(t1, k__cospi_p28_p04); - const __m128i u2 = _mm_madd_epi16(t0, k__cospi_m04_p28); - const __m128i u3 = _mm_madd_epi16(t1, k__cospi_m04_p28); - const __m128i u4 = _mm_madd_epi16(t2, k__cospi_p12_p20); - const __m128i u5 = _mm_madd_epi16(t3, k__cospi_p12_p20); - const __m128i u6 = _mm_madd_epi16(t2, k__cospi_m20_p12); - const __m128i u7 = _mm_madd_epi16(t3, k__cospi_m20_p12); - // dct_const_round_shift - const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING); - const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING); - const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING); - const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING); - const __m128i v4 = _mm_add_epi32(u4, k__DCT_CONST_ROUNDING); - const __m128i v5 = _mm_add_epi32(u5, k__DCT_CONST_ROUNDING); - const __m128i v6 = _mm_add_epi32(u6, k__DCT_CONST_ROUNDING); - const __m128i v7 = _mm_add_epi32(u7, k__DCT_CONST_ROUNDING); - const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS); - const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS); - const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS); - const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS); - const __m128i w4 = _mm_srai_epi32(v4, DCT_CONST_BITS); - const __m128i w5 = _mm_srai_epi32(v5, DCT_CONST_BITS); - const __m128i w6 = _mm_srai_epi32(v6, DCT_CONST_BITS); - const __m128i w7 = _mm_srai_epi32(v7, DCT_CONST_BITS); - // Combine - res1 = _mm_packs_epi32(w0, w1); - res7 = _mm_packs_epi32(w2, w3); - res5 = _mm_packs_epi32(w4, w5); - res3 = _mm_packs_epi32(w6, w7); - } - // Transpose the 8x8. - { - // 00 01 02 03 04 05 06 07 - // 10 11 12 13 14 15 16 17 - // 20 21 22 23 24 25 26 27 - // 30 31 32 33 34 35 36 37 - // 40 41 42 43 44 45 46 47 - // 50 51 52 53 54 55 56 57 - // 60 61 62 63 64 65 66 67 - // 70 71 72 73 74 75 76 77 - const __m128i tr0_0 = _mm_unpacklo_epi16(res0, res1); - const __m128i tr0_1 = _mm_unpacklo_epi16(res2, res3); - const __m128i tr0_2 = _mm_unpackhi_epi16(res0, res1); - const __m128i tr0_3 = _mm_unpackhi_epi16(res2, res3); - const __m128i tr0_4 = _mm_unpacklo_epi16(res4, res5); - const __m128i tr0_5 = _mm_unpacklo_epi16(res6, res7); - const __m128i tr0_6 = _mm_unpackhi_epi16(res4, res5); - const __m128i tr0_7 = _mm_unpackhi_epi16(res6, res7); - // 00 10 01 11 02 12 03 13 - // 20 30 21 31 22 32 23 33 - // 04 14 05 15 06 16 07 17 - // 24 34 25 35 26 36 27 37 - // 40 50 41 51 42 52 43 53 - // 60 70 61 71 62 72 63 73 - // 54 54 55 55 56 56 57 57 - // 64 74 65 75 66 76 67 77 - const __m128i tr1_0 = _mm_unpacklo_epi32(tr0_0, tr0_1); - const __m128i tr1_1 = _mm_unpacklo_epi32(tr0_2, tr0_3); - const __m128i tr1_2 = _mm_unpackhi_epi32(tr0_0, tr0_1); - const __m128i tr1_3 = _mm_unpackhi_epi32(tr0_2, tr0_3); - const __m128i tr1_4 = _mm_unpacklo_epi32(tr0_4, tr0_5); - const __m128i tr1_5 = _mm_unpacklo_epi32(tr0_6, tr0_7); - const __m128i tr1_6 = _mm_unpackhi_epi32(tr0_4, tr0_5); - const __m128i tr1_7 = _mm_unpackhi_epi32(tr0_6, tr0_7); - // 00 10 20 30 01 11 21 31 - // 40 50 60 70 41 51 61 71 - // 02 12 22 32 03 13 23 33 - // 42 52 62 72 43 53 63 73 - // 04 14 24 34 05 15 21 36 - // 44 54 64 74 45 55 61 76 - // 06 16 26 36 07 17 27 37 - // 46 56 66 76 47 57 67 77 - in0 = _mm_unpacklo_epi64(tr1_0, tr1_4); - in1 = _mm_unpackhi_epi64(tr1_0, tr1_4); - in2 = _mm_unpacklo_epi64(tr1_2, tr1_6); - in3 = _mm_unpackhi_epi64(tr1_2, tr1_6); - in4 = _mm_unpacklo_epi64(tr1_1, tr1_5); - in5 = _mm_unpackhi_epi64(tr1_1, tr1_5); - in6 = _mm_unpacklo_epi64(tr1_3, tr1_7); - in7 = _mm_unpackhi_epi64(tr1_3, tr1_7); - // 00 10 20 30 40 50 60 70 - // 01 11 21 31 41 51 61 71 - // 02 12 22 32 42 52 62 72 - // 03 13 23 33 43 53 63 73 - // 04 14 24 34 44 54 64 74 - // 05 15 25 35 45 55 65 75 - // 06 16 26 36 46 56 66 76 - // 07 17 27 37 47 57 67 77 - } - } - // Post-condition output and store it - { - // Post-condition (division by two) - // division of two 16 bits signed numbers using shifts - // n / 2 = (n - (n >> 15)) >> 1 - const __m128i sign_in0 = _mm_srai_epi16(in0, 15); - const __m128i sign_in1 = _mm_srai_epi16(in1, 15); - const __m128i sign_in2 = _mm_srai_epi16(in2, 15); - const __m128i sign_in3 = _mm_srai_epi16(in3, 15); - const __m128i sign_in4 = _mm_srai_epi16(in4, 15); - const __m128i sign_in5 = _mm_srai_epi16(in5, 15); - const __m128i sign_in6 = _mm_srai_epi16(in6, 15); - const __m128i sign_in7 = _mm_srai_epi16(in7, 15); - in0 = _mm_sub_epi16(in0, sign_in0); - in1 = _mm_sub_epi16(in1, sign_in1); - in2 = _mm_sub_epi16(in2, sign_in2); - in3 = _mm_sub_epi16(in3, sign_in3); - in4 = _mm_sub_epi16(in4, sign_in4); - in5 = _mm_sub_epi16(in5, sign_in5); - in6 = _mm_sub_epi16(in6, sign_in6); - in7 = _mm_sub_epi16(in7, sign_in7); - in0 = _mm_srai_epi16(in0, 1); - in1 = _mm_srai_epi16(in1, 1); - in2 = _mm_srai_epi16(in2, 1); - in3 = _mm_srai_epi16(in3, 1); - in4 = _mm_srai_epi16(in4, 1); - in5 = _mm_srai_epi16(in5, 1); - in6 = _mm_srai_epi16(in6, 1); - in7 = _mm_srai_epi16(in7, 1); - } - - iscan_ptr += n_coeffs; - qcoeff_ptr += n_coeffs; - dqcoeff_ptr += n_coeffs; - n_coeffs = -n_coeffs; - zero = _mm_setzero_si128(); - - if (!skip_block) { - __m128i eob; - __m128i round, quant, dequant; - { - __m128i coeff0, coeff1; - - // Setup global values - { - round = _mm_load_si128((const __m128i*)round_ptr); - quant = _mm_load_si128((const __m128i*)quant_ptr); - dequant = _mm_load_si128((const __m128i*)dequant_ptr); - } - - { - __m128i coeff0_sign, coeff1_sign; - __m128i qcoeff0, qcoeff1; - __m128i qtmp0, qtmp1; - // Do DC and first 15 AC - coeff0 = *in[0]; - coeff1 = *in[1]; - - // Poor man's sign extract - coeff0_sign = _mm_srai_epi16(coeff0, 15); - coeff1_sign = _mm_srai_epi16(coeff1, 15); - qcoeff0 = _mm_xor_si128(coeff0, coeff0_sign); - qcoeff1 = _mm_xor_si128(coeff1, coeff1_sign); - qcoeff0 = _mm_sub_epi16(qcoeff0, coeff0_sign); - qcoeff1 = _mm_sub_epi16(qcoeff1, coeff1_sign); - - qcoeff0 = _mm_adds_epi16(qcoeff0, round); - round = _mm_unpackhi_epi64(round, round); - qcoeff1 = _mm_adds_epi16(qcoeff1, round); - qtmp0 = _mm_mulhi_epi16(qcoeff0, quant); - quant = _mm_unpackhi_epi64(quant, quant); - qtmp1 = _mm_mulhi_epi16(qcoeff1, quant); - - // Reinsert signs - qcoeff0 = _mm_xor_si128(qtmp0, coeff0_sign); - qcoeff1 = _mm_xor_si128(qtmp1, coeff1_sign); - qcoeff0 = _mm_sub_epi16(qcoeff0, coeff0_sign); - qcoeff1 = _mm_sub_epi16(qcoeff1, coeff1_sign); - - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs), qcoeff0); - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs) + 1, qcoeff1); - - coeff0 = _mm_mullo_epi16(qcoeff0, dequant); - dequant = _mm_unpackhi_epi64(dequant, dequant); - coeff1 = _mm_mullo_epi16(qcoeff1, dequant); - - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs), coeff0); - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs) + 1, coeff1); - } - - { - // Scan for eob - __m128i zero_coeff0, zero_coeff1; - __m128i nzero_coeff0, nzero_coeff1; - __m128i iscan0, iscan1; - __m128i eob1; - zero_coeff0 = _mm_cmpeq_epi16(coeff0, zero); - zero_coeff1 = _mm_cmpeq_epi16(coeff1, zero); - nzero_coeff0 = _mm_cmpeq_epi16(zero_coeff0, zero); - nzero_coeff1 = _mm_cmpeq_epi16(zero_coeff1, zero); - iscan0 = _mm_load_si128((const __m128i*)(iscan_ptr + n_coeffs)); - iscan1 = _mm_load_si128((const __m128i*)(iscan_ptr + n_coeffs) + 1); - // Add one to convert from indices to counts - iscan0 = _mm_sub_epi16(iscan0, nzero_coeff0); - iscan1 = _mm_sub_epi16(iscan1, nzero_coeff1); - eob = _mm_and_si128(iscan0, nzero_coeff0); - eob1 = _mm_and_si128(iscan1, nzero_coeff1); - eob = _mm_max_epi16(eob, eob1); - } - n_coeffs += 8 * 2; - } - - // AC only loop - index = 2; - while (n_coeffs < 0) { - __m128i coeff0, coeff1; - { - __m128i coeff0_sign, coeff1_sign; - __m128i qcoeff0, qcoeff1; - __m128i qtmp0, qtmp1; - - assert(index < (int)(sizeof(in) / sizeof(in[0])) - 1); - coeff0 = *in[index]; - coeff1 = *in[index + 1]; - - // Poor man's sign extract - coeff0_sign = _mm_srai_epi16(coeff0, 15); - coeff1_sign = _mm_srai_epi16(coeff1, 15); - qcoeff0 = _mm_xor_si128(coeff0, coeff0_sign); - qcoeff1 = _mm_xor_si128(coeff1, coeff1_sign); - qcoeff0 = _mm_sub_epi16(qcoeff0, coeff0_sign); - qcoeff1 = _mm_sub_epi16(qcoeff1, coeff1_sign); - - qcoeff0 = _mm_adds_epi16(qcoeff0, round); - qcoeff1 = _mm_adds_epi16(qcoeff1, round); - qtmp0 = _mm_mulhi_epi16(qcoeff0, quant); - qtmp1 = _mm_mulhi_epi16(qcoeff1, quant); - - // Reinsert signs - qcoeff0 = _mm_xor_si128(qtmp0, coeff0_sign); - qcoeff1 = _mm_xor_si128(qtmp1, coeff1_sign); - qcoeff0 = _mm_sub_epi16(qcoeff0, coeff0_sign); - qcoeff1 = _mm_sub_epi16(qcoeff1, coeff1_sign); - - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs), qcoeff0); - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs) + 1, qcoeff1); - - coeff0 = _mm_mullo_epi16(qcoeff0, dequant); - coeff1 = _mm_mullo_epi16(qcoeff1, dequant); - - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs), coeff0); - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs) + 1, coeff1); - } - - { - // Scan for eob - __m128i zero_coeff0, zero_coeff1; - __m128i nzero_coeff0, nzero_coeff1; - __m128i iscan0, iscan1; - __m128i eob0, eob1; - zero_coeff0 = _mm_cmpeq_epi16(coeff0, zero); - zero_coeff1 = _mm_cmpeq_epi16(coeff1, zero); - nzero_coeff0 = _mm_cmpeq_epi16(zero_coeff0, zero); - nzero_coeff1 = _mm_cmpeq_epi16(zero_coeff1, zero); - iscan0 = _mm_load_si128((const __m128i*)(iscan_ptr + n_coeffs)); - iscan1 = _mm_load_si128((const __m128i*)(iscan_ptr + n_coeffs) + 1); - // Add one to convert from indices to counts - iscan0 = _mm_sub_epi16(iscan0, nzero_coeff0); - iscan1 = _mm_sub_epi16(iscan1, nzero_coeff1); - eob0 = _mm_and_si128(iscan0, nzero_coeff0); - eob1 = _mm_and_si128(iscan1, nzero_coeff1); - eob0 = _mm_max_epi16(eob0, eob1); - eob = _mm_max_epi16(eob, eob0); - } - n_coeffs += 8 * 2; - index += 2; - } - - // Accumulate EOB - { - __m128i eob_shuffled; - eob_shuffled = _mm_shuffle_epi32(eob, 0xe); - eob = _mm_max_epi16(eob, eob_shuffled); - eob_shuffled = _mm_shufflelo_epi16(eob, 0xe); - eob = _mm_max_epi16(eob, eob_shuffled); - eob_shuffled = _mm_shufflelo_epi16(eob, 0x1); - eob = _mm_max_epi16(eob, eob_shuffled); - *eob_ptr = _mm_extract_epi16(eob, 1); - } - } else { - do { - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs), zero); - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs) + 1, zero); - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs), zero); - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs) + 1, zero); - n_coeffs += 8 * 2; - } while (n_coeffs < 0); - *eob_ptr = 0; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_denoiser_sse2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_denoiser_sse2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_denoiser_sse2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_denoiser_sse2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,376 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "./vpx_config.h" -#include "./vp9_rtcd.h" - -#include "vpx_ports/emmintrin_compat.h" -#include "vpx/vpx_integer.h" -#include "vp9/common/vp9_reconinter.h" -#include "vp9/encoder/vp9_context_tree.h" -#include "vp9/encoder/vp9_denoiser.h" -#include "vpx_mem/vpx_mem.h" - -// Compute the sum of all pixel differences of this MB. -static INLINE int sum_diff_16x1(__m128i acc_diff) { - const __m128i k_1 = _mm_set1_epi16(1); - const __m128i acc_diff_lo = - _mm_srai_epi16(_mm_unpacklo_epi8(acc_diff, acc_diff), 8); - const __m128i acc_diff_hi = - _mm_srai_epi16(_mm_unpackhi_epi8(acc_diff, acc_diff), 8); - const __m128i acc_diff_16 = _mm_add_epi16(acc_diff_lo, acc_diff_hi); - const __m128i hg_fe_dc_ba = _mm_madd_epi16(acc_diff_16, k_1); - const __m128i hgfe_dcba = - _mm_add_epi32(hg_fe_dc_ba, _mm_srli_si128(hg_fe_dc_ba, 8)); - const __m128i hgfedcba = - _mm_add_epi32(hgfe_dcba, _mm_srli_si128(hgfe_dcba, 4)); - return _mm_cvtsi128_si32(hgfedcba); -} - -// Denoise a 16x1 vector. -static INLINE __m128i vp9_denoiser_16x1_sse2(const uint8_t *sig, - const uint8_t *mc_running_avg_y, - uint8_t *running_avg_y, - const __m128i *k_0, - const __m128i *k_4, - const __m128i *k_8, - const __m128i *k_16, - const __m128i *l3, - const __m128i *l32, - const __m128i *l21, - __m128i acc_diff) { - // Calculate differences - const __m128i v_sig = _mm_loadu_si128((const __m128i *)(&sig[0])); - const __m128i v_mc_running_avg_y = - _mm_loadu_si128((const __m128i *)(&mc_running_avg_y[0])); - __m128i v_running_avg_y; - const __m128i pdiff = _mm_subs_epu8(v_mc_running_avg_y, v_sig); - const __m128i ndiff = _mm_subs_epu8(v_sig, v_mc_running_avg_y); - // Obtain the sign. FF if diff is negative. - const __m128i diff_sign = _mm_cmpeq_epi8(pdiff, *k_0); - // Clamp absolute difference to 16 to be used to get mask. Doing this - // allows us to use _mm_cmpgt_epi8, which operates on signed byte. - const __m128i clamped_absdiff = - _mm_min_epu8(_mm_or_si128(pdiff, ndiff), *k_16); - // Get masks for l2 l1 and l0 adjustments. - const __m128i mask2 = _mm_cmpgt_epi8(*k_16, clamped_absdiff); - const __m128i mask1 = _mm_cmpgt_epi8(*k_8, clamped_absdiff); - const __m128i mask0 = _mm_cmpgt_epi8(*k_4, clamped_absdiff); - // Get adjustments for l2, l1, and l0. - __m128i adj2 = _mm_and_si128(mask2, *l32); - const __m128i adj1 = _mm_and_si128(mask1, *l21); - const __m128i adj0 = _mm_and_si128(mask0, clamped_absdiff); - __m128i adj, padj, nadj; - - // Combine the adjustments and get absolute adjustments. - adj2 = _mm_add_epi8(adj2, adj1); - adj = _mm_sub_epi8(*l3, adj2); - adj = _mm_andnot_si128(mask0, adj); - adj = _mm_or_si128(adj, adj0); - - // Restore the sign and get positive and negative adjustments. - padj = _mm_andnot_si128(diff_sign, adj); - nadj = _mm_and_si128(diff_sign, adj); - - // Calculate filtered value. - v_running_avg_y = _mm_adds_epu8(v_sig, padj); - v_running_avg_y = _mm_subs_epu8(v_running_avg_y, nadj); - _mm_storeu_si128((__m128i *)running_avg_y, v_running_avg_y); - - // Adjustments <=7, and each element in acc_diff can fit in signed - // char. - acc_diff = _mm_adds_epi8(acc_diff, padj); - acc_diff = _mm_subs_epi8(acc_diff, nadj); - return acc_diff; -} - -// Denoise a 16x1 vector with a weaker filter. -static INLINE __m128i vp9_denoiser_adj_16x1_sse2( - const uint8_t *sig, const uint8_t *mc_running_avg_y, - uint8_t *running_avg_y, const __m128i k_0, - const __m128i k_delta, __m128i acc_diff) { - __m128i v_running_avg_y = _mm_loadu_si128((__m128i *)(&running_avg_y[0])); - // Calculate differences. - const __m128i v_sig = _mm_loadu_si128((const __m128i *)(&sig[0])); - const __m128i v_mc_running_avg_y = - _mm_loadu_si128((const __m128i *)(&mc_running_avg_y[0])); - const __m128i pdiff = _mm_subs_epu8(v_mc_running_avg_y, v_sig); - const __m128i ndiff = _mm_subs_epu8(v_sig, v_mc_running_avg_y); - // Obtain the sign. FF if diff is negative. - const __m128i diff_sign = _mm_cmpeq_epi8(pdiff, k_0); - // Clamp absolute difference to delta to get the adjustment. - const __m128i adj = - _mm_min_epu8(_mm_or_si128(pdiff, ndiff), k_delta); - // Restore the sign and get positive and negative adjustments. - __m128i padj, nadj; - padj = _mm_andnot_si128(diff_sign, adj); - nadj = _mm_and_si128(diff_sign, adj); - // Calculate filtered value. - v_running_avg_y = _mm_subs_epu8(v_running_avg_y, padj); - v_running_avg_y = _mm_adds_epu8(v_running_avg_y, nadj); - _mm_storeu_si128((__m128i *)running_avg_y, v_running_avg_y); - - // Accumulate the adjustments. - acc_diff = _mm_subs_epi8(acc_diff, padj); - acc_diff = _mm_adds_epi8(acc_diff, nadj); - return acc_diff; -} - -// Denoiser for 4xM and 8xM blocks. -static int vp9_denoiser_NxM_sse2_small( - const uint8_t *sig, int sig_stride, const uint8_t *mc_running_avg_y, - int mc_avg_y_stride, uint8_t *running_avg_y, int avg_y_stride, - int increase_denoising, BLOCK_SIZE bs, int motion_magnitude, int width) { - int sum_diff_thresh, r, sum_diff = 0; - const int shift_inc = (increase_denoising && - motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD) ? - 1 : 0; - uint8_t sig_buffer[8][16], mc_running_buffer[8][16], running_buffer[8][16]; - __m128i acc_diff = _mm_setzero_si128(); - const __m128i k_0 = _mm_setzero_si128(); - const __m128i k_4 = _mm_set1_epi8(4 + shift_inc); - const __m128i k_8 = _mm_set1_epi8(8); - const __m128i k_16 = _mm_set1_epi8(16); - // Modify each level's adjustment according to motion_magnitude. - const __m128i l3 = _mm_set1_epi8( - (motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD) ? 7 + shift_inc : 6); - // Difference between level 3 and level 2 is 2. - const __m128i l32 = _mm_set1_epi8(2); - // Difference between level 2 and level 1 is 1. - const __m128i l21 = _mm_set1_epi8(1); - const uint8_t shift = (width == 4) ? 2 : 1; - - for (r = 0; r < ((4 << b_height_log2_lookup[bs]) >> shift); ++r) { - vpx_memcpy(sig_buffer[r], sig, width); - vpx_memcpy(sig_buffer[r] + width, sig + sig_stride, width); - vpx_memcpy(mc_running_buffer[r], mc_running_avg_y, width); - vpx_memcpy(mc_running_buffer[r] + width, - mc_running_avg_y + mc_avg_y_stride, width); - vpx_memcpy(running_buffer[r], running_avg_y, width); - vpx_memcpy(running_buffer[r] + width, - running_avg_y + avg_y_stride, width); - if (width == 4) { - vpx_memcpy(sig_buffer[r] + width * 2, sig + sig_stride * 2, width); - vpx_memcpy(sig_buffer[r] + width * 3, sig + sig_stride * 3, width); - vpx_memcpy(mc_running_buffer[r] + width * 2, - mc_running_avg_y + mc_avg_y_stride * 2, width); - vpx_memcpy(mc_running_buffer[r] + width * 3, - mc_running_avg_y + mc_avg_y_stride * 3, width); - vpx_memcpy(running_buffer[r] + width * 2, - running_avg_y + avg_y_stride * 2, width); - vpx_memcpy(running_buffer[r] + width * 3, - running_avg_y + avg_y_stride * 3, width); - } - acc_diff = vp9_denoiser_16x1_sse2(sig_buffer[r], - mc_running_buffer[r], - running_buffer[r], - &k_0, &k_4, &k_8, &k_16, - &l3, &l32, &l21, acc_diff); - vpx_memcpy(running_avg_y, running_buffer[r], width); - vpx_memcpy(running_avg_y + avg_y_stride, running_buffer[r] + width, width); - if (width == 4) { - vpx_memcpy(running_avg_y + avg_y_stride * 2, - running_buffer[r] + width * 2, width); - vpx_memcpy(running_avg_y + avg_y_stride * 3, - running_buffer[r] + width * 3, width); - } - // Update pointers for next iteration. - sig += (sig_stride << shift); - mc_running_avg_y += (mc_avg_y_stride << shift); - running_avg_y += (avg_y_stride << shift); - } - - { - sum_diff = sum_diff_16x1(acc_diff); - sum_diff_thresh = total_adj_strong_thresh(bs, increase_denoising); - if (abs(sum_diff) > sum_diff_thresh) { - // Before returning to copy the block (i.e., apply no denoising), - // check if we can still apply some (weaker) temporal filtering to - // this block, that would otherwise not be denoised at all. Simplest - // is to apply an additional adjustment to running_avg_y to bring it - // closer to sig. The adjustment is capped by a maximum delta, and - // chosen such that in most cases the resulting sum_diff will be - // within the acceptable range given by sum_diff_thresh. - - // The delta is set by the excess of absolute pixel diff over the - // threshold. - const int delta = ((abs(sum_diff) - sum_diff_thresh) >> - num_pels_log2_lookup[bs]) + 1; - // Only apply the adjustment for max delta up to 3. - if (delta < 4) { - const __m128i k_delta = _mm_set1_epi8(delta); - running_avg_y -= avg_y_stride * (4 << b_height_log2_lookup[bs]); - for (r = 0; r < ((4 << b_height_log2_lookup[bs]) >> shift); ++r) { - acc_diff = vp9_denoiser_adj_16x1_sse2( - sig_buffer[r], mc_running_buffer[r], running_buffer[r], - k_0, k_delta, acc_diff); - vpx_memcpy(running_avg_y, running_buffer[r], width); - vpx_memcpy(running_avg_y + avg_y_stride, - running_buffer[r] + width, width); - if (width == 4) { - vpx_memcpy(running_avg_y + avg_y_stride * 2, - running_buffer[r] + width * 2, width); - vpx_memcpy(running_avg_y + avg_y_stride * 3, - running_buffer[r] + width * 3, width); - } - // Update pointers for next iteration. - running_avg_y += (avg_y_stride << shift); - } - sum_diff = sum_diff_16x1(acc_diff); - if (abs(sum_diff) > sum_diff_thresh) { - return COPY_BLOCK; - } - } else { - return COPY_BLOCK; - } - } - } - return FILTER_BLOCK; -} - -// Denoiser for 16xM, 32xM and 64xM blocks -static int vp9_denoiser_NxM_sse2_big(const uint8_t *sig, int sig_stride, - const uint8_t *mc_running_avg_y, - int mc_avg_y_stride, - uint8_t *running_avg_y, - int avg_y_stride, - int increase_denoising, BLOCK_SIZE bs, - int motion_magnitude) { - int sum_diff_thresh, r, c, sum_diff = 0; - const int shift_inc = (increase_denoising && - motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD) ? - 1 : 0; - __m128i acc_diff[4][4]; - const __m128i k_0 = _mm_setzero_si128(); - const __m128i k_4 = _mm_set1_epi8(4 + shift_inc); - const __m128i k_8 = _mm_set1_epi8(8); - const __m128i k_16 = _mm_set1_epi8(16); - // Modify each level's adjustment according to motion_magnitude. - const __m128i l3 = _mm_set1_epi8( - (motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD) ? 7 + shift_inc : 6); - // Difference between level 3 and level 2 is 2. - const __m128i l32 = _mm_set1_epi8(2); - // Difference between level 2 and level 1 is 1. - const __m128i l21 = _mm_set1_epi8(1); - - for (c = 0; c < 4; ++c) { - for (r = 0; r < 4; ++r) { - acc_diff[c][r] = _mm_setzero_si128(); - } - } - - for (r = 0; r < (4 << b_height_log2_lookup[bs]); ++r) { - for (c = 0; c < (4 << b_width_log2_lookup[bs]); c += 16) { - acc_diff[c>>4][r>>4] = vp9_denoiser_16x1_sse2( - sig, mc_running_avg_y, running_avg_y, &k_0, &k_4, - &k_8, &k_16, &l3, &l32, &l21, acc_diff[c>>4][r>>4]); - // Update pointers for next iteration. - sig += 16; - mc_running_avg_y += 16; - running_avg_y += 16; - } - - if ((r + 1) % 16 == 0 || (bs == BLOCK_16X8 && r == 7)) { - for (c = 0; c < (4 << b_width_log2_lookup[bs]); c += 16) { - sum_diff += sum_diff_16x1(acc_diff[c>>4][r>>4]); - } - } - - // Update pointers for next iteration. - sig = sig - 16 * ((4 << b_width_log2_lookup[bs]) >> 4) + sig_stride; - mc_running_avg_y = mc_running_avg_y - - 16 * ((4 << b_width_log2_lookup[bs]) >> 4) + - mc_avg_y_stride; - running_avg_y = running_avg_y - - 16 * ((4 << b_width_log2_lookup[bs]) >> 4) + - avg_y_stride; - } - - { - sum_diff_thresh = total_adj_strong_thresh(bs, increase_denoising); - if (abs(sum_diff) > sum_diff_thresh) { - const int delta = ((abs(sum_diff) - sum_diff_thresh) >> - num_pels_log2_lookup[bs]) + 1; - - // Only apply the adjustment for max delta up to 3. - if (delta < 4) { - const __m128i k_delta = _mm_set1_epi8(delta); - sig -= sig_stride * (4 << b_height_log2_lookup[bs]); - mc_running_avg_y -= mc_avg_y_stride * (4 << b_height_log2_lookup[bs]); - running_avg_y -= avg_y_stride * (4 << b_height_log2_lookup[bs]); - sum_diff = 0; - for (r = 0; r < (4 << b_height_log2_lookup[bs]); ++r) { - for (c = 0; c < (4 << b_width_log2_lookup[bs]); c += 16) { - acc_diff[c>>4][r>>4] = vp9_denoiser_adj_16x1_sse2( - sig, mc_running_avg_y, running_avg_y, k_0, - k_delta, acc_diff[c>>4][r>>4]); - // Update pointers for next iteration. - sig += 16; - mc_running_avg_y += 16; - running_avg_y += 16; - } - - if ((r + 1) % 16 == 0 || (bs == BLOCK_16X8 && r == 7)) { - for (c = 0; c < (4 << b_width_log2_lookup[bs]); c += 16) { - sum_diff += sum_diff_16x1(acc_diff[c>>4][r>>4]); - } - } - sig = sig - 16 * ((4 << b_width_log2_lookup[bs]) >> 4) + sig_stride; - mc_running_avg_y = mc_running_avg_y - - 16 * ((4 << b_width_log2_lookup[bs]) >> 4) + - mc_avg_y_stride; - running_avg_y = running_avg_y - - 16 * ((4 << b_width_log2_lookup[bs]) >> 4) + - avg_y_stride; - } - if (abs(sum_diff) > sum_diff_thresh) { - return COPY_BLOCK; - } - } else { - return COPY_BLOCK; - } - } - } - return FILTER_BLOCK; -} - -int vp9_denoiser_filter_sse2(const uint8_t *sig, int sig_stride, - const uint8_t *mc_avg, - int mc_avg_stride, - uint8_t *avg, int avg_stride, - int increase_denoising, - BLOCK_SIZE bs, - int motion_magnitude) { - if (bs == BLOCK_4X4 || bs == BLOCK_4X8) { - return vp9_denoiser_NxM_sse2_small(sig, sig_stride, - mc_avg, mc_avg_stride, - avg, avg_stride, - increase_denoising, - bs, motion_magnitude, 4); - } else if (bs == BLOCK_8X4 || bs == BLOCK_8X8 || bs == BLOCK_8X16) { - return vp9_denoiser_NxM_sse2_small(sig, sig_stride, - mc_avg, mc_avg_stride, - avg, avg_stride, - increase_denoising, - bs, motion_magnitude, 8); - } else if (bs == BLOCK_16X8 || bs == BLOCK_16X16 || bs == BLOCK_16X32 || - bs == BLOCK_32X16|| bs == BLOCK_32X32 || bs == BLOCK_32X64 || - bs == BLOCK_64X32 || bs == BLOCK_64X64) { - return vp9_denoiser_NxM_sse2_big(sig, sig_stride, - mc_avg, mc_avg_stride, - avg, avg_stride, - increase_denoising, - bs, motion_magnitude); - } else { - return COPY_BLOCK; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_error_intrin_avx2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_error_intrin_avx2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_error_intrin_avx2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_error_intrin_avx2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Usee of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include // AVX2 -#include "vpx/vpx_integer.h" - - -int64_t vp9_block_error_avx2(const int16_t *coeff, - const int16_t *dqcoeff, - intptr_t block_size, - int64_t *ssz) { - __m256i sse_reg, ssz_reg, coeff_reg, dqcoeff_reg; - __m256i exp_dqcoeff_lo, exp_dqcoeff_hi, exp_coeff_lo, exp_coeff_hi; - __m256i sse_reg_64hi, ssz_reg_64hi; - __m128i sse_reg128, ssz_reg128; - int64_t sse; - int i; - const __m256i zero_reg = _mm256_set1_epi16(0); - - // init sse and ssz registerd to zero - sse_reg = _mm256_set1_epi16(0); - ssz_reg = _mm256_set1_epi16(0); - - for (i = 0 ; i < block_size ; i+= 16) { - // load 32 bytes from coeff and dqcoeff - coeff_reg = _mm256_loadu_si256((const __m256i *)(coeff + i)); - dqcoeff_reg = _mm256_loadu_si256((const __m256i *)(dqcoeff + i)); - // dqcoeff - coeff - dqcoeff_reg = _mm256_sub_epi16(dqcoeff_reg, coeff_reg); - // madd (dqcoeff - coeff) - dqcoeff_reg = _mm256_madd_epi16(dqcoeff_reg, dqcoeff_reg); - // madd coeff - coeff_reg = _mm256_madd_epi16(coeff_reg, coeff_reg); - // expand each double word of madd (dqcoeff - coeff) to quad word - exp_dqcoeff_lo = _mm256_unpacklo_epi32(dqcoeff_reg, zero_reg); - exp_dqcoeff_hi = _mm256_unpackhi_epi32(dqcoeff_reg, zero_reg); - // expand each double word of madd (coeff) to quad word - exp_coeff_lo = _mm256_unpacklo_epi32(coeff_reg, zero_reg); - exp_coeff_hi = _mm256_unpackhi_epi32(coeff_reg, zero_reg); - // add each quad word of madd (dqcoeff - coeff) and madd (coeff) - sse_reg = _mm256_add_epi64(sse_reg, exp_dqcoeff_lo); - ssz_reg = _mm256_add_epi64(ssz_reg, exp_coeff_lo); - sse_reg = _mm256_add_epi64(sse_reg, exp_dqcoeff_hi); - ssz_reg = _mm256_add_epi64(ssz_reg, exp_coeff_hi); - } - // save the higher 64 bit of each 128 bit lane - sse_reg_64hi = _mm256_srli_si256(sse_reg, 8); - ssz_reg_64hi = _mm256_srli_si256(ssz_reg, 8); - // add the higher 64 bit to the low 64 bit - sse_reg = _mm256_add_epi64(sse_reg, sse_reg_64hi); - ssz_reg = _mm256_add_epi64(ssz_reg, ssz_reg_64hi); - - // add each 64 bit from each of the 128 bit lane of the 256 bit - sse_reg128 = _mm_add_epi64(_mm256_castsi256_si128(sse_reg), - _mm256_extractf128_si256(sse_reg, 1)); - - ssz_reg128 = _mm_add_epi64(_mm256_castsi256_si128(ssz_reg), - _mm256_extractf128_si256(ssz_reg, 1)); - - // store the results - _mm_storel_epi64((__m128i*)(&sse), sse_reg128); - - _mm_storel_epi64((__m128i*)(ssz), ssz_reg128); - return sse; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_highbd_block_error_intrin_sse2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_highbd_block_error_intrin_sse2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_highbd_block_error_intrin_sse2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_highbd_block_error_intrin_sse2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "vp9/common/vp9_common.h" - -int64_t vp9_highbd_block_error_sse2(tran_low_t *coeff, tran_low_t *dqcoeff, - intptr_t block_size, int64_t *ssz, - int bps) { - int i, j, test; - uint32_t temp[4]; - __m128i max, min, cmp0, cmp1, cmp2, cmp3; - int64_t error = 0, sqcoeff = 0; - const int shift = 2 * (bps - 8); - const int rounding = shift > 0 ? 1 << (shift - 1) : 0; - - for (i = 0; i < block_size; i+=8) { - // Load the data into xmm registers - __m128i mm_coeff = _mm_load_si128((__m128i*) (coeff + i)); - __m128i mm_coeff2 = _mm_load_si128((__m128i*) (coeff + i + 4)); - __m128i mm_dqcoeff = _mm_load_si128((__m128i*) (dqcoeff + i)); - __m128i mm_dqcoeff2 = _mm_load_si128((__m128i*) (dqcoeff + i + 4)); - // Check if any values require more than 15 bit - max = _mm_set1_epi32(0x3fff); - min = _mm_set1_epi32(0xffffc000); - cmp0 = _mm_xor_si128(_mm_cmpgt_epi32(mm_coeff, max), - _mm_cmplt_epi32(mm_coeff, min)); - cmp1 = _mm_xor_si128(_mm_cmpgt_epi32(mm_coeff2, max), - _mm_cmplt_epi32(mm_coeff2, min)); - cmp2 = _mm_xor_si128(_mm_cmpgt_epi32(mm_dqcoeff, max), - _mm_cmplt_epi32(mm_dqcoeff, min)); - cmp3 = _mm_xor_si128(_mm_cmpgt_epi32(mm_dqcoeff2, max), - _mm_cmplt_epi32(mm_dqcoeff2, min)); - test = _mm_movemask_epi8(_mm_or_si128(_mm_or_si128(cmp0, cmp1), - _mm_or_si128(cmp2, cmp3))); - - if (!test) { - __m128i mm_diff, error_sse2, sqcoeff_sse2;; - mm_coeff = _mm_packs_epi32(mm_coeff, mm_coeff2); - mm_dqcoeff = _mm_packs_epi32(mm_dqcoeff, mm_dqcoeff2); - mm_diff = _mm_sub_epi16(mm_coeff, mm_dqcoeff); - error_sse2 = _mm_madd_epi16(mm_diff, mm_diff); - sqcoeff_sse2 = _mm_madd_epi16(mm_coeff, mm_coeff); - _mm_storeu_si128((__m128i*)temp, error_sse2); - error = error + temp[0] + temp[1] + temp[2] + temp[3]; - _mm_storeu_si128((__m128i*)temp, sqcoeff_sse2); - sqcoeff += temp[0] + temp[1] + temp[2] + temp[3]; - } else { - for (j = 0; j < 8; j++) { - const int64_t diff = coeff[i + j] - dqcoeff[i + j]; - error += diff * diff; - sqcoeff += (int64_t)coeff[i + j] * (int64_t)coeff[i + j]; - } - } - } - assert(error >= 0 && sqcoeff >= 0); - error = (error + rounding) >> shift; - sqcoeff = (sqcoeff + rounding) >> shift; - - *ssz = sqcoeff; - return error; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_highbd_quantize_intrin_sse2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_highbd_quantize_intrin_sse2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_highbd_quantize_intrin_sse2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_highbd_quantize_intrin_sse2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,180 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "vp9/common/vp9_common.h" - -#if CONFIG_VP9_HIGHBITDEPTH -// from vp9_idct.h: typedef int32_t tran_low_t; -void vp9_highbd_quantize_b_sse2(const tran_low_t *coeff_ptr, - intptr_t count, - int skip_block, - const int16_t *zbin_ptr, - const int16_t *round_ptr, - const int16_t *quant_ptr, - const int16_t *quant_shift_ptr, - tran_low_t *qcoeff_ptr, - tran_low_t *dqcoeff_ptr, - const int16_t *dequant_ptr, - uint16_t *eob_ptr, - const int16_t *scan, - const int16_t *iscan) { - int i, j, non_zero_regs = (int)count / 4, eob_i = -1; - __m128i zbins[2]; - __m128i nzbins[2]; - - zbins[0] = _mm_set_epi32((int)zbin_ptr[1], - (int)zbin_ptr[1], - (int)zbin_ptr[1], - (int)zbin_ptr[0]); - zbins[1] = _mm_set1_epi32((int)zbin_ptr[1]); - - nzbins[0] = _mm_setzero_si128(); - nzbins[1] = _mm_setzero_si128(); - nzbins[0] = _mm_sub_epi32(nzbins[0], zbins[0]); - nzbins[1] = _mm_sub_epi32(nzbins[1], zbins[1]); - - (void)scan; - - vpx_memset(qcoeff_ptr, 0, count * sizeof(*qcoeff_ptr)); - vpx_memset(dqcoeff_ptr, 0, count * sizeof(*dqcoeff_ptr)); - - if (!skip_block) { - // Pre-scan pass - for (i = ((int)count / 4) - 1; i >= 0; i--) { - __m128i coeffs, cmp1, cmp2; - int test; - coeffs = _mm_load_si128((const __m128i *)(coeff_ptr + i * 4)); - cmp1 = _mm_cmplt_epi32(coeffs, zbins[i != 0]); - cmp2 = _mm_cmpgt_epi32(coeffs, nzbins[i != 0]); - cmp1 = _mm_and_si128(cmp1, cmp2); - test = _mm_movemask_epi8(cmp1); - if (test == 0xffff) - non_zero_regs--; - else - break; - } - - // Quantization pass: - for (i = 0; i < non_zero_regs; i++) { - __m128i coeffs, coeffs_sign, tmp1, tmp2; - int test; - int abs_coeff[4]; - int coeff_sign[4]; - - coeffs = _mm_load_si128((const __m128i *)(coeff_ptr + i * 4)); - coeffs_sign = _mm_srai_epi32(coeffs, 31); - coeffs = _mm_sub_epi32( - _mm_xor_si128(coeffs, coeffs_sign), coeffs_sign); - tmp1 = _mm_cmpgt_epi32(coeffs, zbins[i != 0]); - tmp2 = _mm_cmpeq_epi32(coeffs, zbins[i != 0]); - tmp1 = _mm_or_si128(tmp1, tmp2); - test = _mm_movemask_epi8(tmp1); - _mm_storeu_si128((__m128i*)abs_coeff, coeffs); - _mm_storeu_si128((__m128i*)coeff_sign, coeffs_sign); - - for (j = 0; j < 4; j++) { - if (test & (1 << (4 * j))) { - int k = 4 * i + j; - int64_t tmp = clamp(abs_coeff[j] + round_ptr[k != 0], - INT32_MIN, INT32_MAX); - tmp = ((((tmp * quant_ptr[k != 0]) >> 16) + tmp) * - quant_shift_ptr[k != 0]) >> 16; // quantization - qcoeff_ptr[k] = (tmp ^ coeff_sign[j]) - coeff_sign[j]; - dqcoeff_ptr[k] = qcoeff_ptr[k] * dequant_ptr[k != 0]; - if (tmp) - eob_i = iscan[k] > eob_i ? iscan[k] : eob_i; - } - } - } - } - *eob_ptr = eob_i + 1; -} - - -void vp9_highbd_quantize_b_32x32_sse2(const tran_low_t *coeff_ptr, - intptr_t n_coeffs, - int skip_block, - const int16_t *zbin_ptr, - const int16_t *round_ptr, - const int16_t *quant_ptr, - const int16_t *quant_shift_ptr, - tran_low_t *qcoeff_ptr, - tran_low_t *dqcoeff_ptr, - const int16_t *dequant_ptr, - uint16_t *eob_ptr, - const int16_t *scan, - const int16_t *iscan) { - __m128i zbins[2]; - __m128i nzbins[2]; - int idx = 0; - int idx_arr[1024]; - int i, eob = -1; - const int zbin0_tmp = ROUND_POWER_OF_TWO(zbin_ptr[0], 1); - const int zbin1_tmp = ROUND_POWER_OF_TWO(zbin_ptr[1], 1); - (void)scan; - zbins[0] = _mm_set_epi32(zbin1_tmp, - zbin1_tmp, - zbin1_tmp, - zbin0_tmp); - zbins[1] = _mm_set1_epi32(zbin1_tmp); - - nzbins[0] = _mm_setzero_si128(); - nzbins[1] = _mm_setzero_si128(); - nzbins[0] = _mm_sub_epi32(nzbins[0], zbins[0]); - nzbins[1] = _mm_sub_epi32(nzbins[1], zbins[1]); - - vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); - vpx_memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); - - if (!skip_block) { - // Pre-scan pass - for (i = 0; i < n_coeffs / 4; i++) { - __m128i coeffs, cmp1, cmp2; - int test; - coeffs = _mm_load_si128((const __m128i *)(coeff_ptr + i * 4)); - cmp1 = _mm_cmplt_epi32(coeffs, zbins[i != 0]); - cmp2 = _mm_cmpgt_epi32(coeffs, nzbins[i != 0]); - cmp1 = _mm_and_si128(cmp1, cmp2); - test = _mm_movemask_epi8(cmp1); - if (!(test & 0xf)) - idx_arr[idx++] = i * 4; - if (!(test & 0xf0)) - idx_arr[idx++] = i * 4 + 1; - if (!(test & 0xf00)) - idx_arr[idx++] = i * 4 + 2; - if (!(test & 0xf000)) - idx_arr[idx++] = i * 4 + 3; - } - - // Quantization pass: only process the coefficients selected in - // pre-scan pass. Note: idx can be zero. - for (i = 0; i < idx; i++) { - const int rc = idx_arr[i]; - const int coeff = coeff_ptr[rc]; - const int coeff_sign = (coeff >> 31); - int abs_coeff = (coeff ^ coeff_sign) - coeff_sign; - int64_t tmp = clamp(abs_coeff + - ROUND_POWER_OF_TWO(round_ptr[rc != 0], 1), - INT32_MIN, INT32_MAX); - tmp = ((((tmp * quant_ptr[rc != 0]) >> 16) + tmp) * - quant_shift_ptr[rc != 0]) >> 15; - - qcoeff_ptr[rc] = (tmp ^ coeff_sign) - coeff_sign; - dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0] / 2; - - if (tmp) - eob = iscan[idx_arr[i]] > eob ? iscan[idx_arr[i]] : eob; - } - } - *eob_ptr = eob + 1; -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_highbd_variance_sse2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_highbd_variance_sse2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_highbd_variance_sse2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_highbd_variance_sse2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,580 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#include "./vpx_config.h" -#include "vp9/common/vp9_common.h" - -#include "vp9/encoder/vp9_variance.h" -#include "vpx_ports/mem.h" - -typedef uint32_t (*high_variance_fn_t) (const uint16_t *src, int src_stride, - const uint16_t *ref, int ref_stride, - uint32_t *sse, int *sum); - -uint32_t vp9_highbd_calc8x8var_sse2(const uint16_t *src, int src_stride, - const uint16_t *ref, int ref_stride, - uint32_t *sse, int *sum); - -uint32_t vp9_highbd_calc16x16var_sse2(const uint16_t *src, int src_stride, - const uint16_t *ref, int ref_stride, - uint32_t *sse, int *sum); - -static void highbd_variance_sse2(const uint16_t *src, int src_stride, - const uint16_t *ref, int ref_stride, - int w, int h, uint32_t *sse, int *sum, - high_variance_fn_t var_fn, int block_size) { - int i, j; - - *sse = 0; - *sum = 0; - - for (i = 0; i < h; i += block_size) { - for (j = 0; j < w; j += block_size) { - unsigned int sse0; - int sum0; - var_fn(src + src_stride * i + j, src_stride, - ref + ref_stride * i + j, ref_stride, &sse0, &sum0); - *sse += sse0; - *sum += sum0; - } - } -} - -static void highbd_10_variance_sse2(const uint16_t *src, int src_stride, - const uint16_t *ref, int ref_stride, - int w, int h, uint32_t *sse, int *sum, - high_variance_fn_t var_fn, int block_size) { - int i, j; - uint64_t sse_long = 0; - int64_t sum_long = 0; - - for (i = 0; i < h; i += block_size) { - for (j = 0; j < w; j += block_size) { - unsigned int sse0; - int sum0; - var_fn(src + src_stride * i + j, src_stride, - ref + ref_stride * i + j, ref_stride, &sse0, &sum0); - sse_long += sse0; - sum_long += sum0; - } - } - *sum = ROUND_POWER_OF_TWO(sum_long, 2); - *sse = ROUND_POWER_OF_TWO(sse_long, 4); -} - -static void highbd_12_variance_sse2(const uint16_t *src, int src_stride, - const uint16_t *ref, int ref_stride, - int w, int h, uint32_t *sse, int *sum, - high_variance_fn_t var_fn, int block_size) { - int i, j; - uint64_t sse_long = 0; - int64_t sum_long = 0; - - for (i = 0; i < h; i += block_size) { - for (j = 0; j < w; j += block_size) { - unsigned int sse0; - int sum0; - var_fn(src + src_stride * i + j, src_stride, - ref + ref_stride * i + j, ref_stride, &sse0, &sum0); - sse_long += sse0; - sum_long += sum0; - } - } - *sum = ROUND_POWER_OF_TWO(sum_long, 4); - *sse = ROUND_POWER_OF_TWO(sse_long, 8); -} - - -#define HIGH_GET_VAR(S) \ -void vp9_highbd_get##S##x##S##var_sse2(const uint8_t *src8, int src_stride, \ - const uint8_t *ref8, int ref_stride, \ - uint32_t *sse, int *sum) { \ - uint16_t *src = CONVERT_TO_SHORTPTR(src8); \ - uint16_t *ref = CONVERT_TO_SHORTPTR(ref8); \ - vp9_highbd_calc##S##x##S##var_sse2(src, src_stride, ref, ref_stride, \ - sse, sum); \ -} \ -\ -void vp9_highbd_10_get##S##x##S##var_sse2(const uint8_t *src8, int src_stride, \ - const uint8_t *ref8, int ref_stride, \ - uint32_t *sse, int *sum) { \ - uint16_t *src = CONVERT_TO_SHORTPTR(src8); \ - uint16_t *ref = CONVERT_TO_SHORTPTR(ref8); \ - vp9_highbd_calc##S##x##S##var_sse2(src, src_stride, ref, ref_stride, \ - sse, sum); \ - *sum = ROUND_POWER_OF_TWO(*sum, 2); \ - *sse = ROUND_POWER_OF_TWO(*sse, 4); \ -} \ -\ -void vp9_highbd_12_get##S##x##S##var_sse2(const uint8_t *src8, int src_stride, \ - const uint8_t *ref8, int ref_stride, \ - uint32_t *sse, int *sum) { \ - uint16_t *src = CONVERT_TO_SHORTPTR(src8); \ - uint16_t *ref = CONVERT_TO_SHORTPTR(ref8); \ - vp9_highbd_calc##S##x##S##var_sse2(src, src_stride, ref, ref_stride, \ - sse, sum); \ - *sum = ROUND_POWER_OF_TWO(*sum, 4); \ - *sse = ROUND_POWER_OF_TWO(*sse, 8); \ -} - -HIGH_GET_VAR(16); -HIGH_GET_VAR(8); - -#undef HIGH_GET_VAR - -#define VAR_FN(w, h, block_size, shift) \ -uint32_t vp9_highbd_variance##w##x##h##_sse2( \ - const uint8_t *src8, int src_stride, \ - const uint8_t *ref8, int ref_stride, uint32_t *sse) { \ - int sum; \ - uint16_t *src = CONVERT_TO_SHORTPTR(src8); \ - uint16_t *ref = CONVERT_TO_SHORTPTR(ref8); \ - highbd_variance_sse2(src, src_stride, ref, ref_stride, w, h, sse, &sum, \ - vp9_highbd_calc##block_size##x##block_size##var_sse2, \ - block_size); \ - return *sse - (((int64_t)sum * sum) >> shift); \ -} \ -\ -uint32_t vp9_highbd_10_variance##w##x##h##_sse2( \ - const uint8_t *src8, int src_stride, \ - const uint8_t *ref8, int ref_stride, uint32_t *sse) { \ - int sum; \ - uint16_t *src = CONVERT_TO_SHORTPTR(src8); \ - uint16_t *ref = CONVERT_TO_SHORTPTR(ref8); \ - highbd_10_variance_sse2( \ - src, src_stride, ref, ref_stride, w, h, sse, &sum, \ - vp9_highbd_calc##block_size##x##block_size##var_sse2, block_size); \ - return *sse - (((int64_t)sum * sum) >> shift); \ -} \ -\ -uint32_t vp9_highbd_12_variance##w##x##h##_sse2( \ - const uint8_t *src8, int src_stride, \ - const uint8_t *ref8, int ref_stride, uint32_t *sse) { \ - int sum; \ - uint16_t *src = CONVERT_TO_SHORTPTR(src8); \ - uint16_t *ref = CONVERT_TO_SHORTPTR(ref8); \ - highbd_12_variance_sse2( \ - src, src_stride, ref, ref_stride, w, h, sse, &sum, \ - vp9_highbd_calc##block_size##x##block_size##var_sse2, block_size); \ - return *sse - (((int64_t)sum * sum) >> shift); \ -} - -VAR_FN(64, 64, 16, 12); -VAR_FN(64, 32, 16, 11); -VAR_FN(32, 64, 16, 11); -VAR_FN(32, 32, 16, 10); -VAR_FN(32, 16, 16, 9); -VAR_FN(16, 32, 16, 9); -VAR_FN(16, 16, 16, 8); -VAR_FN(16, 8, 8, 7); -VAR_FN(8, 16, 8, 7); -VAR_FN(8, 8, 8, 6); - -#undef VAR_FN - -unsigned int vp9_highbd_mse16x16_sse2(const uint8_t *src8, int src_stride, - const uint8_t *ref8, int ref_stride, - unsigned int *sse) { - int sum; - uint16_t *src = CONVERT_TO_SHORTPTR(src8); - uint16_t *ref = CONVERT_TO_SHORTPTR(ref8); - highbd_variance_sse2(src, src_stride, ref, ref_stride, 16, 16, - sse, &sum, vp9_highbd_calc16x16var_sse2, 16); - return *sse; -} - -unsigned int vp9_highbd_10_mse16x16_sse2(const uint8_t *src8, int src_stride, - const uint8_t *ref8, int ref_stride, - unsigned int *sse) { - int sum; - uint16_t *src = CONVERT_TO_SHORTPTR(src8); - uint16_t *ref = CONVERT_TO_SHORTPTR(ref8); - highbd_10_variance_sse2(src, src_stride, ref, ref_stride, 16, 16, - sse, &sum, vp9_highbd_calc16x16var_sse2, 16); - return *sse; -} - -unsigned int vp9_highbd_12_mse16x16_sse2(const uint8_t *src8, int src_stride, - const uint8_t *ref8, int ref_stride, - unsigned int *sse) { - int sum; - uint16_t *src = CONVERT_TO_SHORTPTR(src8); - uint16_t *ref = CONVERT_TO_SHORTPTR(ref8); - highbd_12_variance_sse2(src, src_stride, ref, ref_stride, 16, 16, - sse, &sum, vp9_highbd_calc16x16var_sse2, 16); - return *sse; -} - -unsigned int vp9_highbd_mse8x8_sse2(const uint8_t *src8, int src_stride, - const uint8_t *ref8, int ref_stride, - unsigned int *sse) { - int sum; - uint16_t *src = CONVERT_TO_SHORTPTR(src8); - uint16_t *ref = CONVERT_TO_SHORTPTR(ref8); - highbd_variance_sse2(src, src_stride, ref, ref_stride, 8, 8, - sse, &sum, vp9_highbd_calc8x8var_sse2, 8); - return *sse; -} - -unsigned int vp9_highbd_10_mse8x8_sse2(const uint8_t *src8, int src_stride, - const uint8_t *ref8, int ref_stride, - unsigned int *sse) { - int sum; - uint16_t *src = CONVERT_TO_SHORTPTR(src8); - uint16_t *ref = CONVERT_TO_SHORTPTR(ref8); - highbd_10_variance_sse2(src, src_stride, ref, ref_stride, 8, 8, - sse, &sum, vp9_highbd_calc8x8var_sse2, 8); - return *sse; -} - -unsigned int vp9_highbd_12_mse8x8_sse2(const uint8_t *src8, int src_stride, - const uint8_t *ref8, int ref_stride, - unsigned int *sse) { - int sum; - uint16_t *src = CONVERT_TO_SHORTPTR(src8); - uint16_t *ref = CONVERT_TO_SHORTPTR(ref8); - highbd_12_variance_sse2(src, src_stride, ref, ref_stride, 8, 8, - sse, &sum, vp9_highbd_calc8x8var_sse2, 8); - return *sse; -} - -#define DECL(w, opt) \ -int vp9_highbd_sub_pixel_variance##w##xh_##opt(const uint16_t *src, \ - ptrdiff_t src_stride, \ - int x_offset, int y_offset, \ - const uint16_t *dst, \ - ptrdiff_t dst_stride, \ - int height, unsigned int *sse); -#define DECLS(opt1, opt2) \ -DECL(8, opt1); \ -DECL(16, opt1) - -DECLS(sse2, sse); -// DECLS(ssse3, ssse3); -#undef DECLS -#undef DECL - -#define FN(w, h, wf, wlog2, hlog2, opt, cast) \ -uint32_t vp9_highbd_sub_pixel_variance##w##x##h##_##opt(const uint8_t *src8, \ - int src_stride, \ - int x_offset, \ - int y_offset, \ - const uint8_t *dst8, \ - int dst_stride, \ - uint32_t *sse_ptr) { \ - uint32_t sse; \ - uint16_t *src = CONVERT_TO_SHORTPTR(src8); \ - uint16_t *dst = CONVERT_TO_SHORTPTR(dst8); \ - int se = vp9_highbd_sub_pixel_variance##wf##xh_##opt(src, src_stride, \ - x_offset, y_offset, \ - dst, dst_stride, h, \ - &sse); \ - if (w > wf) { \ - unsigned int sse2; \ - int se2 = vp9_highbd_sub_pixel_variance##wf##xh_##opt(src + 16, \ - src_stride, \ - x_offset, y_offset, \ - dst + 16, \ - dst_stride, \ - h, &sse2); \ - se += se2; \ - sse += sse2; \ - if (w > wf * 2) { \ - se2 = vp9_highbd_sub_pixel_variance##wf##xh_##opt(src + 32, src_stride, \ - x_offset, y_offset, \ - dst + 32, dst_stride, \ - h, &sse2); \ - se += se2; \ - sse += sse2; \ - se2 = vp9_highbd_sub_pixel_variance##wf##xh_##opt( \ - src + 48, src_stride, x_offset, y_offset, \ - dst + 48, dst_stride, h, &sse2); \ - se += se2; \ - sse += sse2; \ - } \ - } \ - *sse_ptr = sse; \ - return sse - ((cast se * se) >> (wlog2 + hlog2)); \ -} \ -\ -uint32_t vp9_highbd_10_sub_pixel_variance##w##x##h##_##opt( \ - const uint8_t *src8, int src_stride, int x_offset, int y_offset, \ - const uint8_t *dst8, int dst_stride, uint32_t *sse_ptr) { \ - uint32_t sse; \ - uint16_t *src = CONVERT_TO_SHORTPTR(src8); \ - uint16_t *dst = CONVERT_TO_SHORTPTR(dst8); \ - int se = vp9_highbd_sub_pixel_variance##wf##xh_##opt(src, src_stride, \ - x_offset, y_offset, \ - dst, dst_stride, \ - h, &sse); \ - if (w > wf) { \ - uint32_t sse2; \ - int se2 = vp9_highbd_sub_pixel_variance##wf##xh_##opt(src + 16, \ - src_stride, \ - x_offset, y_offset, \ - dst + 16, \ - dst_stride, \ - h, &sse2); \ - se += se2; \ - sse += sse2; \ - if (w > wf * 2) { \ - se2 = vp9_highbd_sub_pixel_variance##wf##xh_##opt(src + 32, src_stride, \ - x_offset, y_offset, \ - dst + 32, dst_stride, \ - h, &sse2); \ - se += se2; \ - sse += sse2; \ - se2 = vp9_highbd_sub_pixel_variance##wf##xh_##opt(src + 48, src_stride, \ - x_offset, y_offset, \ - dst + 48, dst_stride, \ - h, &sse2); \ - se += se2; \ - sse += sse2; \ - } \ - } \ - se = ROUND_POWER_OF_TWO(se, 2); \ - sse = ROUND_POWER_OF_TWO(sse, 4); \ - *sse_ptr = sse; \ - return sse - ((cast se * se) >> (wlog2 + hlog2)); \ -} \ -\ -uint32_t vp9_highbd_12_sub_pixel_variance##w##x##h##_##opt( \ - const uint8_t *src8, int src_stride, int x_offset, int y_offset, \ - const uint8_t *dst8, int dst_stride, uint32_t *sse_ptr) { \ - int start_row; \ - uint32_t sse; \ - int se = 0; \ - uint64_t long_sse = 0; \ - uint16_t *src = CONVERT_TO_SHORTPTR(src8); \ - uint16_t *dst = CONVERT_TO_SHORTPTR(dst8); \ - for (start_row = 0; start_row < h; start_row +=16) { \ - uint32_t sse2; \ - int height = h - start_row < 16 ? h - start_row : 16; \ - int se2 = vp9_highbd_sub_pixel_variance##wf##xh_##opt( \ - src + (start_row * src_stride), src_stride, \ - x_offset, y_offset, dst + (start_row * dst_stride), \ - dst_stride, height, &sse2); \ - se += se2; \ - long_sse += sse2; \ - if (w > wf) { \ - se2 = vp9_highbd_sub_pixel_variance##wf##xh_##opt( \ - src + 16 + (start_row * src_stride), src_stride, \ - x_offset, y_offset, dst + 16 + (start_row * dst_stride), \ - dst_stride, height, &sse2); \ - se += se2; \ - long_sse += sse2; \ - if (w > wf * 2) { \ - se2 = vp9_highbd_sub_pixel_variance##wf##xh_##opt( \ - src + 32 + (start_row * src_stride), src_stride, \ - x_offset, y_offset, dst + 32 + (start_row * dst_stride), \ - dst_stride, height, &sse2); \ - se += se2; \ - long_sse += sse2; \ - se2 = vp9_highbd_sub_pixel_variance##wf##xh_##opt( \ - src + 48 + (start_row * src_stride), src_stride, \ - x_offset, y_offset, dst + 48 + (start_row * dst_stride), \ - dst_stride, height, &sse2); \ - se += se2; \ - long_sse += sse2; \ - }\ - } \ - } \ - se = ROUND_POWER_OF_TWO(se, 4); \ - sse = ROUND_POWER_OF_TWO(long_sse, 8); \ - *sse_ptr = sse; \ - return sse - ((cast se * se) >> (wlog2 + hlog2)); \ -} - -#define FNS(opt1, opt2) \ -FN(64, 64, 16, 6, 6, opt1, (int64_t)); \ -FN(64, 32, 16, 6, 5, opt1, (int64_t)); \ -FN(32, 64, 16, 5, 6, opt1, (int64_t)); \ -FN(32, 32, 16, 5, 5, opt1, (int64_t)); \ -FN(32, 16, 16, 5, 4, opt1, (int64_t)); \ -FN(16, 32, 16, 4, 5, opt1, (int64_t)); \ -FN(16, 16, 16, 4, 4, opt1, (int64_t)); \ -FN(16, 8, 16, 4, 3, opt1, (int64_t)); \ -FN(8, 16, 8, 3, 4, opt1, (int64_t)); \ -FN(8, 8, 8, 3, 3, opt1, (int64_t)); \ -FN(8, 4, 8, 3, 2, opt1, (int64_t)); - - -FNS(sse2, sse); - -#undef FNS -#undef FN - -#define DECL(w, opt) \ -int vp9_highbd_sub_pixel_avg_variance##w##xh_##opt(const uint16_t *src, \ - ptrdiff_t src_stride, \ - int x_offset, int y_offset, \ - const uint16_t *dst, \ - ptrdiff_t dst_stride, \ - const uint16_t *sec, \ - ptrdiff_t sec_stride, \ - int height, \ - unsigned int *sse); -#define DECLS(opt1) \ -DECL(16, opt1) \ -DECL(8, opt1) - -DECLS(sse2); -#undef DECL -#undef DECLS - -#define FN(w, h, wf, wlog2, hlog2, opt, cast) \ -uint32_t vp9_highbd_sub_pixel_avg_variance##w##x##h##_##opt( \ - const uint8_t *src8, int src_stride, int x_offset, int y_offset, \ - const uint8_t *dst8, int dst_stride, uint32_t *sse_ptr, \ - const uint8_t *sec8) { \ - uint32_t sse; \ - uint16_t *src = CONVERT_TO_SHORTPTR(src8); \ - uint16_t *dst = CONVERT_TO_SHORTPTR(dst8); \ - uint16_t *sec = CONVERT_TO_SHORTPTR(sec8); \ - int se = vp9_highbd_sub_pixel_avg_variance##wf##xh_##opt( \ - src, src_stride, x_offset, \ - y_offset, dst, dst_stride, sec, w, h, &sse); \ - if (w > wf) { \ - uint32_t sse2; \ - int se2 = vp9_highbd_sub_pixel_avg_variance##wf##xh_##opt( \ - src + 16, src_stride, x_offset, y_offset, \ - dst + 16, dst_stride, sec + 16, w, h, &sse2); \ - se += se2; \ - sse += sse2; \ - if (w > wf * 2) { \ - se2 = vp9_highbd_sub_pixel_avg_variance##wf##xh_##opt( \ - src + 32, src_stride, x_offset, y_offset, \ - dst + 32, dst_stride, sec + 32, w, h, &sse2); \ - se += se2; \ - sse += sse2; \ - se2 = vp9_highbd_sub_pixel_avg_variance##wf##xh_##opt( \ - src + 48, src_stride, x_offset, y_offset, \ - dst + 48, dst_stride, sec + 48, w, h, &sse2); \ - se += se2; \ - sse += sse2; \ - } \ - } \ - *sse_ptr = sse; \ - return sse - ((cast se * se) >> (wlog2 + hlog2)); \ -} \ -\ -uint32_t vp9_highbd_10_sub_pixel_avg_variance##w##x##h##_##opt( \ - const uint8_t *src8, int src_stride, int x_offset, int y_offset, \ - const uint8_t *dst8, int dst_stride, uint32_t *sse_ptr, \ - const uint8_t *sec8) { \ - uint32_t sse; \ - uint16_t *src = CONVERT_TO_SHORTPTR(src8); \ - uint16_t *dst = CONVERT_TO_SHORTPTR(dst8); \ - uint16_t *sec = CONVERT_TO_SHORTPTR(sec8); \ - int se = vp9_highbd_sub_pixel_avg_variance##wf##xh_##opt( \ - src, src_stride, x_offset, \ - y_offset, dst, dst_stride, \ - sec, w, h, &sse); \ - if (w > wf) { \ - uint32_t sse2; \ - int se2 = vp9_highbd_sub_pixel_avg_variance##wf##xh_##opt( \ - src + 16, src_stride, \ - x_offset, y_offset, \ - dst + 16, dst_stride, \ - sec + 16, w, h, &sse2); \ - se += se2; \ - sse += sse2; \ - if (w > wf * 2) { \ - se2 = vp9_highbd_sub_pixel_avg_variance##wf##xh_##opt( \ - src + 32, src_stride, \ - x_offset, y_offset, \ - dst + 32, dst_stride, \ - sec + 32, w, h, &sse2); \ - se += se2; \ - sse += sse2; \ - se2 = vp9_highbd_sub_pixel_avg_variance##wf##xh_##opt( \ - src + 48, src_stride, \ - x_offset, y_offset, \ - dst + 48, dst_stride, \ - sec + 48, w, h, &sse2); \ - se += se2; \ - sse += sse2; \ - } \ - } \ - se = ROUND_POWER_OF_TWO(se, 2); \ - sse = ROUND_POWER_OF_TWO(sse, 4); \ - *sse_ptr = sse; \ - return sse - ((cast se * se) >> (wlog2 + hlog2)); \ -} \ -\ -uint32_t vp9_highbd_12_sub_pixel_avg_variance##w##x##h##_##opt( \ - const uint8_t *src8, int src_stride, int x_offset, int y_offset, \ - const uint8_t *dst8, int dst_stride, uint32_t *sse_ptr, \ - const uint8_t *sec8) { \ - int start_row; \ - uint32_t sse; \ - int se = 0; \ - uint64_t long_sse = 0; \ - uint16_t *src = CONVERT_TO_SHORTPTR(src8); \ - uint16_t *dst = CONVERT_TO_SHORTPTR(dst8); \ - uint16_t *sec = CONVERT_TO_SHORTPTR(sec8); \ - for (start_row = 0; start_row < h; start_row +=16) { \ - uint32_t sse2; \ - int height = h - start_row < 16 ? h - start_row : 16; \ - int se2 = vp9_highbd_sub_pixel_avg_variance##wf##xh_##opt( \ - src + (start_row * src_stride), src_stride, x_offset, \ - y_offset, dst + (start_row * dst_stride), dst_stride, \ - sec + (start_row * w), w, height, &sse2); \ - se += se2; \ - long_sse += sse2; \ - if (w > wf) { \ - se2 = vp9_highbd_sub_pixel_avg_variance##wf##xh_##opt( \ - src + 16 + (start_row * src_stride), src_stride, \ - x_offset, y_offset, \ - dst + 16 + (start_row * dst_stride), dst_stride, \ - sec + 16 + (start_row * w), w, height, &sse2); \ - se += se2; \ - long_sse += sse2; \ - if (w > wf * 2) { \ - se2 = vp9_highbd_sub_pixel_avg_variance##wf##xh_##opt( \ - src + 32 + (start_row * src_stride), src_stride, \ - x_offset, y_offset, \ - dst + 32 + (start_row * dst_stride), dst_stride, \ - sec + 32 + (start_row * w), w, height, &sse2); \ - se += se2; \ - long_sse += sse2; \ - se2 = vp9_highbd_sub_pixel_avg_variance##wf##xh_##opt( \ - src + 48 + (start_row * src_stride), src_stride, \ - x_offset, y_offset, \ - dst + 48 + (start_row * dst_stride), dst_stride, \ - sec + 48 + (start_row * w), w, height, &sse2); \ - se += se2; \ - long_sse += sse2; \ - } \ - } \ - } \ - se = ROUND_POWER_OF_TWO(se, 4); \ - sse = ROUND_POWER_OF_TWO(long_sse, 8); \ - *sse_ptr = sse; \ - return sse - ((cast se * se) >> (wlog2 + hlog2)); \ -} - - -#define FNS(opt1) \ -FN(64, 64, 16, 6, 6, opt1, (int64_t)); \ -FN(64, 32, 16, 6, 5, opt1, (int64_t)); \ -FN(32, 64, 16, 5, 6, opt1, (int64_t)); \ -FN(32, 32, 16, 5, 5, opt1, (int64_t)); \ -FN(32, 16, 16, 5, 4, opt1, (int64_t)); \ -FN(16, 32, 16, 4, 5, opt1, (int64_t)); \ -FN(16, 16, 16, 4, 4, opt1, (int64_t)); \ -FN(16, 8, 16, 4, 3, opt1, (int64_t)); \ -FN(8, 16, 8, 4, 3, opt1, (int64_t)); \ -FN(8, 8, 8, 3, 3, opt1, (int64_t)); \ -FN(8, 4, 8, 3, 2, opt1, (int64_t)); - -FNS(sse2); - -#undef FNS -#undef FN diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_quantize_sse2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_quantize_sse2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_quantize_sse2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_quantize_sse2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,403 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "vpx/vpx_integer.h" - -void vp9_quantize_b_sse2(const int16_t* coeff_ptr, intptr_t n_coeffs, - int skip_block, const int16_t* zbin_ptr, - const int16_t* round_ptr, const int16_t* quant_ptr, - const int16_t* quant_shift_ptr, int16_t* qcoeff_ptr, - int16_t* dqcoeff_ptr, const int16_t* dequant_ptr, - uint16_t* eob_ptr, - const int16_t* scan_ptr, - const int16_t* iscan_ptr) { - __m128i zero; - (void)scan_ptr; - - coeff_ptr += n_coeffs; - iscan_ptr += n_coeffs; - qcoeff_ptr += n_coeffs; - dqcoeff_ptr += n_coeffs; - n_coeffs = -n_coeffs; - zero = _mm_setzero_si128(); - if (!skip_block) { - __m128i eob; - __m128i zbin; - __m128i round, quant, dequant, shift; - { - __m128i coeff0, coeff1; - - // Setup global values - { - __m128i pw_1; - zbin = _mm_load_si128((const __m128i*)zbin_ptr); - round = _mm_load_si128((const __m128i*)round_ptr); - quant = _mm_load_si128((const __m128i*)quant_ptr); - pw_1 = _mm_set1_epi16(1); - zbin = _mm_sub_epi16(zbin, pw_1); - dequant = _mm_load_si128((const __m128i*)dequant_ptr); - shift = _mm_load_si128((const __m128i*)quant_shift_ptr); - } - - { - __m128i coeff0_sign, coeff1_sign; - __m128i qcoeff0, qcoeff1; - __m128i qtmp0, qtmp1; - __m128i cmp_mask0, cmp_mask1; - // Do DC and first 15 AC - coeff0 = _mm_load_si128((const __m128i*)(coeff_ptr + n_coeffs)); - coeff1 = _mm_load_si128((const __m128i*)(coeff_ptr + n_coeffs) + 1); - - // Poor man's sign extract - coeff0_sign = _mm_srai_epi16(coeff0, 15); - coeff1_sign = _mm_srai_epi16(coeff1, 15); - qcoeff0 = _mm_xor_si128(coeff0, coeff0_sign); - qcoeff1 = _mm_xor_si128(coeff1, coeff1_sign); - qcoeff0 = _mm_sub_epi16(qcoeff0, coeff0_sign); - qcoeff1 = _mm_sub_epi16(qcoeff1, coeff1_sign); - - cmp_mask0 = _mm_cmpgt_epi16(qcoeff0, zbin); - zbin = _mm_unpackhi_epi64(zbin, zbin); // Switch DC to AC - cmp_mask1 = _mm_cmpgt_epi16(qcoeff1, zbin); - qcoeff0 = _mm_adds_epi16(qcoeff0, round); - round = _mm_unpackhi_epi64(round, round); - qcoeff1 = _mm_adds_epi16(qcoeff1, round); - qtmp0 = _mm_mulhi_epi16(qcoeff0, quant); - quant = _mm_unpackhi_epi64(quant, quant); - qtmp1 = _mm_mulhi_epi16(qcoeff1, quant); - qtmp0 = _mm_add_epi16(qtmp0, qcoeff0); - qtmp1 = _mm_add_epi16(qtmp1, qcoeff1); - qcoeff0 = _mm_mulhi_epi16(qtmp0, shift); - shift = _mm_unpackhi_epi64(shift, shift); - qcoeff1 = _mm_mulhi_epi16(qtmp1, shift); - - // Reinsert signs - qcoeff0 = _mm_xor_si128(qcoeff0, coeff0_sign); - qcoeff1 = _mm_xor_si128(qcoeff1, coeff1_sign); - qcoeff0 = _mm_sub_epi16(qcoeff0, coeff0_sign); - qcoeff1 = _mm_sub_epi16(qcoeff1, coeff1_sign); - - // Mask out zbin threshold coeffs - qcoeff0 = _mm_and_si128(qcoeff0, cmp_mask0); - qcoeff1 = _mm_and_si128(qcoeff1, cmp_mask1); - - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs), qcoeff0); - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs) + 1, qcoeff1); - - coeff0 = _mm_mullo_epi16(qcoeff0, dequant); - dequant = _mm_unpackhi_epi64(dequant, dequant); - coeff1 = _mm_mullo_epi16(qcoeff1, dequant); - - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs), coeff0); - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs) + 1, coeff1); - } - - { - // Scan for eob - __m128i zero_coeff0, zero_coeff1; - __m128i nzero_coeff0, nzero_coeff1; - __m128i iscan0, iscan1; - __m128i eob1; - zero_coeff0 = _mm_cmpeq_epi16(coeff0, zero); - zero_coeff1 = _mm_cmpeq_epi16(coeff1, zero); - nzero_coeff0 = _mm_cmpeq_epi16(zero_coeff0, zero); - nzero_coeff1 = _mm_cmpeq_epi16(zero_coeff1, zero); - iscan0 = _mm_load_si128((const __m128i*)(iscan_ptr + n_coeffs)); - iscan1 = _mm_load_si128((const __m128i*)(iscan_ptr + n_coeffs) + 1); - // Add one to convert from indices to counts - iscan0 = _mm_sub_epi16(iscan0, nzero_coeff0); - iscan1 = _mm_sub_epi16(iscan1, nzero_coeff1); - eob = _mm_and_si128(iscan0, nzero_coeff0); - eob1 = _mm_and_si128(iscan1, nzero_coeff1); - eob = _mm_max_epi16(eob, eob1); - } - n_coeffs += 8 * 2; - } - - // AC only loop - while (n_coeffs < 0) { - __m128i coeff0, coeff1; - { - __m128i coeff0_sign, coeff1_sign; - __m128i qcoeff0, qcoeff1; - __m128i qtmp0, qtmp1; - __m128i cmp_mask0, cmp_mask1; - - coeff0 = _mm_load_si128((const __m128i*)(coeff_ptr + n_coeffs)); - coeff1 = _mm_load_si128((const __m128i*)(coeff_ptr + n_coeffs) + 1); - - // Poor man's sign extract - coeff0_sign = _mm_srai_epi16(coeff0, 15); - coeff1_sign = _mm_srai_epi16(coeff1, 15); - qcoeff0 = _mm_xor_si128(coeff0, coeff0_sign); - qcoeff1 = _mm_xor_si128(coeff1, coeff1_sign); - qcoeff0 = _mm_sub_epi16(qcoeff0, coeff0_sign); - qcoeff1 = _mm_sub_epi16(qcoeff1, coeff1_sign); - - cmp_mask0 = _mm_cmpgt_epi16(qcoeff0, zbin); - cmp_mask1 = _mm_cmpgt_epi16(qcoeff1, zbin); - qcoeff0 = _mm_adds_epi16(qcoeff0, round); - qcoeff1 = _mm_adds_epi16(qcoeff1, round); - qtmp0 = _mm_mulhi_epi16(qcoeff0, quant); - qtmp1 = _mm_mulhi_epi16(qcoeff1, quant); - qtmp0 = _mm_add_epi16(qtmp0, qcoeff0); - qtmp1 = _mm_add_epi16(qtmp1, qcoeff1); - qcoeff0 = _mm_mulhi_epi16(qtmp0, shift); - qcoeff1 = _mm_mulhi_epi16(qtmp1, shift); - - // Reinsert signs - qcoeff0 = _mm_xor_si128(qcoeff0, coeff0_sign); - qcoeff1 = _mm_xor_si128(qcoeff1, coeff1_sign); - qcoeff0 = _mm_sub_epi16(qcoeff0, coeff0_sign); - qcoeff1 = _mm_sub_epi16(qcoeff1, coeff1_sign); - - // Mask out zbin threshold coeffs - qcoeff0 = _mm_and_si128(qcoeff0, cmp_mask0); - qcoeff1 = _mm_and_si128(qcoeff1, cmp_mask1); - - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs), qcoeff0); - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs) + 1, qcoeff1); - - coeff0 = _mm_mullo_epi16(qcoeff0, dequant); - coeff1 = _mm_mullo_epi16(qcoeff1, dequant); - - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs), coeff0); - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs) + 1, coeff1); - } - - { - // Scan for eob - __m128i zero_coeff0, zero_coeff1; - __m128i nzero_coeff0, nzero_coeff1; - __m128i iscan0, iscan1; - __m128i eob0, eob1; - zero_coeff0 = _mm_cmpeq_epi16(coeff0, zero); - zero_coeff1 = _mm_cmpeq_epi16(coeff1, zero); - nzero_coeff0 = _mm_cmpeq_epi16(zero_coeff0, zero); - nzero_coeff1 = _mm_cmpeq_epi16(zero_coeff1, zero); - iscan0 = _mm_load_si128((const __m128i*)(iscan_ptr + n_coeffs)); - iscan1 = _mm_load_si128((const __m128i*)(iscan_ptr + n_coeffs) + 1); - // Add one to convert from indices to counts - iscan0 = _mm_sub_epi16(iscan0, nzero_coeff0); - iscan1 = _mm_sub_epi16(iscan1, nzero_coeff1); - eob0 = _mm_and_si128(iscan0, nzero_coeff0); - eob1 = _mm_and_si128(iscan1, nzero_coeff1); - eob0 = _mm_max_epi16(eob0, eob1); - eob = _mm_max_epi16(eob, eob0); - } - n_coeffs += 8 * 2; - } - - // Accumulate EOB - { - __m128i eob_shuffled; - eob_shuffled = _mm_shuffle_epi32(eob, 0xe); - eob = _mm_max_epi16(eob, eob_shuffled); - eob_shuffled = _mm_shufflelo_epi16(eob, 0xe); - eob = _mm_max_epi16(eob, eob_shuffled); - eob_shuffled = _mm_shufflelo_epi16(eob, 0x1); - eob = _mm_max_epi16(eob, eob_shuffled); - *eob_ptr = _mm_extract_epi16(eob, 1); - } - } else { - do { - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs), zero); - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs) + 1, zero); - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs), zero); - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs) + 1, zero); - n_coeffs += 8 * 2; - } while (n_coeffs < 0); - *eob_ptr = 0; - } -} - -void vp9_quantize_fp_sse2(const int16_t* coeff_ptr, intptr_t n_coeffs, - int skip_block, const int16_t* zbin_ptr, - const int16_t* round_ptr, const int16_t* quant_ptr, - const int16_t* quant_shift_ptr, int16_t* qcoeff_ptr, - int16_t* dqcoeff_ptr, const int16_t* dequant_ptr, - uint16_t* eob_ptr, - const int16_t* scan_ptr, - const int16_t* iscan_ptr) { - __m128i zero; - (void)scan_ptr; - (void)zbin_ptr; - (void)quant_shift_ptr; - - coeff_ptr += n_coeffs; - iscan_ptr += n_coeffs; - qcoeff_ptr += n_coeffs; - dqcoeff_ptr += n_coeffs; - n_coeffs = -n_coeffs; - zero = _mm_setzero_si128(); - - if (!skip_block) { - __m128i eob; - __m128i round, quant, dequant; - { - __m128i coeff0, coeff1; - - // Setup global values - { - round = _mm_load_si128((const __m128i*)round_ptr); - quant = _mm_load_si128((const __m128i*)quant_ptr); - dequant = _mm_load_si128((const __m128i*)dequant_ptr); - } - - { - __m128i coeff0_sign, coeff1_sign; - __m128i qcoeff0, qcoeff1; - __m128i qtmp0, qtmp1; - // Do DC and first 15 AC - coeff0 = _mm_load_si128((const __m128i*)(coeff_ptr + n_coeffs)); - coeff1 = _mm_load_si128((const __m128i*)(coeff_ptr + n_coeffs) + 1); - - // Poor man's sign extract - coeff0_sign = _mm_srai_epi16(coeff0, 15); - coeff1_sign = _mm_srai_epi16(coeff1, 15); - qcoeff0 = _mm_xor_si128(coeff0, coeff0_sign); - qcoeff1 = _mm_xor_si128(coeff1, coeff1_sign); - qcoeff0 = _mm_sub_epi16(qcoeff0, coeff0_sign); - qcoeff1 = _mm_sub_epi16(qcoeff1, coeff1_sign); - - qcoeff0 = _mm_adds_epi16(qcoeff0, round); - round = _mm_unpackhi_epi64(round, round); - qcoeff1 = _mm_adds_epi16(qcoeff1, round); - qtmp0 = _mm_mulhi_epi16(qcoeff0, quant); - quant = _mm_unpackhi_epi64(quant, quant); - qtmp1 = _mm_mulhi_epi16(qcoeff1, quant); - - // Reinsert signs - qcoeff0 = _mm_xor_si128(qtmp0, coeff0_sign); - qcoeff1 = _mm_xor_si128(qtmp1, coeff1_sign); - qcoeff0 = _mm_sub_epi16(qcoeff0, coeff0_sign); - qcoeff1 = _mm_sub_epi16(qcoeff1, coeff1_sign); - - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs), qcoeff0); - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs) + 1, qcoeff1); - - coeff0 = _mm_mullo_epi16(qcoeff0, dequant); - dequant = _mm_unpackhi_epi64(dequant, dequant); - coeff1 = _mm_mullo_epi16(qcoeff1, dequant); - - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs), coeff0); - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs) + 1, coeff1); - } - - { - // Scan for eob - __m128i zero_coeff0, zero_coeff1; - __m128i nzero_coeff0, nzero_coeff1; - __m128i iscan0, iscan1; - __m128i eob1; - zero_coeff0 = _mm_cmpeq_epi16(coeff0, zero); - zero_coeff1 = _mm_cmpeq_epi16(coeff1, zero); - nzero_coeff0 = _mm_cmpeq_epi16(zero_coeff0, zero); - nzero_coeff1 = _mm_cmpeq_epi16(zero_coeff1, zero); - iscan0 = _mm_load_si128((const __m128i*)(iscan_ptr + n_coeffs)); - iscan1 = _mm_load_si128((const __m128i*)(iscan_ptr + n_coeffs) + 1); - // Add one to convert from indices to counts - iscan0 = _mm_sub_epi16(iscan0, nzero_coeff0); - iscan1 = _mm_sub_epi16(iscan1, nzero_coeff1); - eob = _mm_and_si128(iscan0, nzero_coeff0); - eob1 = _mm_and_si128(iscan1, nzero_coeff1); - eob = _mm_max_epi16(eob, eob1); - } - n_coeffs += 8 * 2; - } - - // AC only loop - while (n_coeffs < 0) { - __m128i coeff0, coeff1; - { - __m128i coeff0_sign, coeff1_sign; - __m128i qcoeff0, qcoeff1; - __m128i qtmp0, qtmp1; - - coeff0 = _mm_load_si128((const __m128i*)(coeff_ptr + n_coeffs)); - coeff1 = _mm_load_si128((const __m128i*)(coeff_ptr + n_coeffs) + 1); - - // Poor man's sign extract - coeff0_sign = _mm_srai_epi16(coeff0, 15); - coeff1_sign = _mm_srai_epi16(coeff1, 15); - qcoeff0 = _mm_xor_si128(coeff0, coeff0_sign); - qcoeff1 = _mm_xor_si128(coeff1, coeff1_sign); - qcoeff0 = _mm_sub_epi16(qcoeff0, coeff0_sign); - qcoeff1 = _mm_sub_epi16(qcoeff1, coeff1_sign); - - qcoeff0 = _mm_adds_epi16(qcoeff0, round); - qcoeff1 = _mm_adds_epi16(qcoeff1, round); - qtmp0 = _mm_mulhi_epi16(qcoeff0, quant); - qtmp1 = _mm_mulhi_epi16(qcoeff1, quant); - - // Reinsert signs - qcoeff0 = _mm_xor_si128(qtmp0, coeff0_sign); - qcoeff1 = _mm_xor_si128(qtmp1, coeff1_sign); - qcoeff0 = _mm_sub_epi16(qcoeff0, coeff0_sign); - qcoeff1 = _mm_sub_epi16(qcoeff1, coeff1_sign); - - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs), qcoeff0); - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs) + 1, qcoeff1); - - coeff0 = _mm_mullo_epi16(qcoeff0, dequant); - coeff1 = _mm_mullo_epi16(qcoeff1, dequant); - - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs), coeff0); - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs) + 1, coeff1); - } - - { - // Scan for eob - __m128i zero_coeff0, zero_coeff1; - __m128i nzero_coeff0, nzero_coeff1; - __m128i iscan0, iscan1; - __m128i eob0, eob1; - zero_coeff0 = _mm_cmpeq_epi16(coeff0, zero); - zero_coeff1 = _mm_cmpeq_epi16(coeff1, zero); - nzero_coeff0 = _mm_cmpeq_epi16(zero_coeff0, zero); - nzero_coeff1 = _mm_cmpeq_epi16(zero_coeff1, zero); - iscan0 = _mm_load_si128((const __m128i*)(iscan_ptr + n_coeffs)); - iscan1 = _mm_load_si128((const __m128i*)(iscan_ptr + n_coeffs) + 1); - // Add one to convert from indices to counts - iscan0 = _mm_sub_epi16(iscan0, nzero_coeff0); - iscan1 = _mm_sub_epi16(iscan1, nzero_coeff1); - eob0 = _mm_and_si128(iscan0, nzero_coeff0); - eob1 = _mm_and_si128(iscan1, nzero_coeff1); - eob0 = _mm_max_epi16(eob0, eob1); - eob = _mm_max_epi16(eob, eob0); - } - n_coeffs += 8 * 2; - } - - // Accumulate EOB - { - __m128i eob_shuffled; - eob_shuffled = _mm_shuffle_epi32(eob, 0xe); - eob = _mm_max_epi16(eob, eob_shuffled); - eob_shuffled = _mm_shufflelo_epi16(eob, 0xe); - eob = _mm_max_epi16(eob, eob_shuffled); - eob_shuffled = _mm_shufflelo_epi16(eob, 0x1); - eob = _mm_max_epi16(eob, eob_shuffled); - *eob_ptr = _mm_extract_epi16(eob, 1); - } - } else { - do { - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs), zero); - _mm_store_si128((__m128i*)(dqcoeff_ptr + n_coeffs) + 1, zero); - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs), zero); - _mm_store_si128((__m128i*)(qcoeff_ptr + n_coeffs) + 1, zero); - n_coeffs += 8 * 2; - } while (n_coeffs < 0); - *eob_ptr = 0; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad4d_intrin_avx2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad4d_intrin_avx2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad4d_intrin_avx2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad4d_intrin_avx2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,167 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#include // AVX2 -#include "vpx/vpx_integer.h" - -void vp9_sad32x32x4d_avx2(uint8_t *src, - int src_stride, - uint8_t *ref[4], - int ref_stride, - unsigned int res[4]) { - __m256i src_reg, ref0_reg, ref1_reg, ref2_reg, ref3_reg; - __m256i sum_ref0, sum_ref1, sum_ref2, sum_ref3; - __m256i sum_mlow, sum_mhigh; - int i; - uint8_t *ref0, *ref1, *ref2, *ref3; - - ref0 = ref[0]; - ref1 = ref[1]; - ref2 = ref[2]; - ref3 = ref[3]; - sum_ref0 = _mm256_set1_epi16(0); - sum_ref1 = _mm256_set1_epi16(0); - sum_ref2 = _mm256_set1_epi16(0); - sum_ref3 = _mm256_set1_epi16(0); - for (i = 0; i < 32 ; i++) { - // load src and all refs - src_reg = _mm256_loadu_si256((__m256i *)(src)); - ref0_reg = _mm256_loadu_si256((__m256i *) (ref0)); - ref1_reg = _mm256_loadu_si256((__m256i *) (ref1)); - ref2_reg = _mm256_loadu_si256((__m256i *) (ref2)); - ref3_reg = _mm256_loadu_si256((__m256i *) (ref3)); - // sum of the absolute differences between every ref-i to src - ref0_reg = _mm256_sad_epu8(ref0_reg, src_reg); - ref1_reg = _mm256_sad_epu8(ref1_reg, src_reg); - ref2_reg = _mm256_sad_epu8(ref2_reg, src_reg); - ref3_reg = _mm256_sad_epu8(ref3_reg, src_reg); - // sum every ref-i - sum_ref0 = _mm256_add_epi32(sum_ref0, ref0_reg); - sum_ref1 = _mm256_add_epi32(sum_ref1, ref1_reg); - sum_ref2 = _mm256_add_epi32(sum_ref2, ref2_reg); - sum_ref3 = _mm256_add_epi32(sum_ref3, ref3_reg); - - src+= src_stride; - ref0+= ref_stride; - ref1+= ref_stride; - ref2+= ref_stride; - ref3+= ref_stride; - } - { - __m128i sum; - // in sum_ref-i the result is saved in the first 4 bytes - // the other 4 bytes are zeroed. - // sum_ref1 and sum_ref3 are shifted left by 4 bytes - sum_ref1 = _mm256_slli_si256(sum_ref1, 4); - sum_ref3 = _mm256_slli_si256(sum_ref3, 4); - - // merge sum_ref0 and sum_ref1 also sum_ref2 and sum_ref3 - sum_ref0 = _mm256_or_si256(sum_ref0, sum_ref1); - sum_ref2 = _mm256_or_si256(sum_ref2, sum_ref3); - - // merge every 64 bit from each sum_ref-i - sum_mlow = _mm256_unpacklo_epi64(sum_ref0, sum_ref2); - sum_mhigh = _mm256_unpackhi_epi64(sum_ref0, sum_ref2); - - // add the low 64 bit to the high 64 bit - sum_mlow = _mm256_add_epi32(sum_mlow, sum_mhigh); - - // add the low 128 bit to the high 128 bit - sum = _mm_add_epi32(_mm256_castsi256_si128(sum_mlow), - _mm256_extractf128_si256(sum_mlow, 1)); - - _mm_storeu_si128((__m128i *)(res), sum); - } -} - -void vp9_sad64x64x4d_avx2(uint8_t *src, - int src_stride, - uint8_t *ref[4], - int ref_stride, - unsigned int res[4]) { - __m256i src_reg, srcnext_reg, ref0_reg, ref0next_reg; - __m256i ref1_reg, ref1next_reg, ref2_reg, ref2next_reg; - __m256i ref3_reg, ref3next_reg; - __m256i sum_ref0, sum_ref1, sum_ref2, sum_ref3; - __m256i sum_mlow, sum_mhigh; - int i; - uint8_t *ref0, *ref1, *ref2, *ref3; - - ref0 = ref[0]; - ref1 = ref[1]; - ref2 = ref[2]; - ref3 = ref[3]; - sum_ref0 = _mm256_set1_epi16(0); - sum_ref1 = _mm256_set1_epi16(0); - sum_ref2 = _mm256_set1_epi16(0); - sum_ref3 = _mm256_set1_epi16(0); - for (i = 0; i < 64 ; i++) { - // load 64 bytes from src and all refs - src_reg = _mm256_loadu_si256((__m256i *)(src)); - srcnext_reg = _mm256_loadu_si256((__m256i *)(src + 32)); - ref0_reg = _mm256_loadu_si256((__m256i *) (ref0)); - ref0next_reg = _mm256_loadu_si256((__m256i *) (ref0 + 32)); - ref1_reg = _mm256_loadu_si256((__m256i *) (ref1)); - ref1next_reg = _mm256_loadu_si256((__m256i *) (ref1 + 32)); - ref2_reg = _mm256_loadu_si256((__m256i *) (ref2)); - ref2next_reg = _mm256_loadu_si256((__m256i *) (ref2 + 32)); - ref3_reg = _mm256_loadu_si256((__m256i *) (ref3)); - ref3next_reg = _mm256_loadu_si256((__m256i *) (ref3 + 32)); - // sum of the absolute differences between every ref-i to src - ref0_reg = _mm256_sad_epu8(ref0_reg, src_reg); - ref1_reg = _mm256_sad_epu8(ref1_reg, src_reg); - ref2_reg = _mm256_sad_epu8(ref2_reg, src_reg); - ref3_reg = _mm256_sad_epu8(ref3_reg, src_reg); - ref0next_reg = _mm256_sad_epu8(ref0next_reg, srcnext_reg); - ref1next_reg = _mm256_sad_epu8(ref1next_reg, srcnext_reg); - ref2next_reg = _mm256_sad_epu8(ref2next_reg, srcnext_reg); - ref3next_reg = _mm256_sad_epu8(ref3next_reg, srcnext_reg); - - // sum every ref-i - sum_ref0 = _mm256_add_epi32(sum_ref0, ref0_reg); - sum_ref1 = _mm256_add_epi32(sum_ref1, ref1_reg); - sum_ref2 = _mm256_add_epi32(sum_ref2, ref2_reg); - sum_ref3 = _mm256_add_epi32(sum_ref3, ref3_reg); - sum_ref0 = _mm256_add_epi32(sum_ref0, ref0next_reg); - sum_ref1 = _mm256_add_epi32(sum_ref1, ref1next_reg); - sum_ref2 = _mm256_add_epi32(sum_ref2, ref2next_reg); - sum_ref3 = _mm256_add_epi32(sum_ref3, ref3next_reg); - src+= src_stride; - ref0+= ref_stride; - ref1+= ref_stride; - ref2+= ref_stride; - ref3+= ref_stride; - } - { - __m128i sum; - - // in sum_ref-i the result is saved in the first 4 bytes - // the other 4 bytes are zeroed. - // sum_ref1 and sum_ref3 are shifted left by 4 bytes - sum_ref1 = _mm256_slli_si256(sum_ref1, 4); - sum_ref3 = _mm256_slli_si256(sum_ref3, 4); - - // merge sum_ref0 and sum_ref1 also sum_ref2 and sum_ref3 - sum_ref0 = _mm256_or_si256(sum_ref0, sum_ref1); - sum_ref2 = _mm256_or_si256(sum_ref2, sum_ref3); - - // merge every 64 bit from each sum_ref-i - sum_mlow = _mm256_unpacklo_epi64(sum_ref0, sum_ref2); - sum_mhigh = _mm256_unpackhi_epi64(sum_ref0, sum_ref2); - - // add the low 64 bit to the high 64 bit - sum_mlow = _mm256_add_epi32(sum_mlow, sum_mhigh); - - // add the low 128 bit to the high 128 bit - sum = _mm_add_epi32(_mm256_castsi256_si128(sum_mlow), - _mm256_extractf128_si256(sum_mlow, 1)); - - _mm_storeu_si128((__m128i *)(res), sum); - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad4d_sse2.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad4d_sse2.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad4d_sse2.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad4d_sse2.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,231 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - -%include "third_party/x86inc/x86inc.asm" - -SECTION .text - -; PROCESS_4x2x4 first, off_{first,second}_{src,ref}, advance_at_end -%macro PROCESS_4x2x4 5-6 0 - movd m0, [srcq +%2] -%if %1 == 1 - movd m6, [ref1q+%3] - movd m4, [ref2q+%3] - movd m7, [ref3q+%3] - movd m5, [ref4q+%3] - punpckldq m0, [srcq +%4] - punpckldq m6, [ref1q+%5] - punpckldq m4, [ref2q+%5] - punpckldq m7, [ref3q+%5] - punpckldq m5, [ref4q+%5] - psadbw m6, m0 - psadbw m4, m0 - psadbw m7, m0 - psadbw m5, m0 - punpckldq m6, m4 - punpckldq m7, m5 -%else - movd m1, [ref1q+%3] - movd m2, [ref2q+%3] - movd m3, [ref3q+%3] - movd m4, [ref4q+%3] - punpckldq m0, [srcq +%4] - punpckldq m1, [ref1q+%5] - punpckldq m2, [ref2q+%5] - punpckldq m3, [ref3q+%5] - punpckldq m4, [ref4q+%5] - psadbw m1, m0 - psadbw m2, m0 - psadbw m3, m0 - psadbw m4, m0 - punpckldq m1, m2 - punpckldq m3, m4 - paddd m6, m1 - paddd m7, m3 -%endif -%if %6 == 1 - lea srcq, [srcq +src_strideq*2] - lea ref1q, [ref1q+ref_strideq*2] - lea ref2q, [ref2q+ref_strideq*2] - lea ref3q, [ref3q+ref_strideq*2] - lea ref4q, [ref4q+ref_strideq*2] -%endif -%endmacro - -; PROCESS_8x2x4 first, off_{first,second}_{src,ref}, advance_at_end -%macro PROCESS_8x2x4 5-6 0 - movh m0, [srcq +%2] -%if %1 == 1 - movh m4, [ref1q+%3] - movh m5, [ref2q+%3] - movh m6, [ref3q+%3] - movh m7, [ref4q+%3] - movhps m0, [srcq +%4] - movhps m4, [ref1q+%5] - movhps m5, [ref2q+%5] - movhps m6, [ref3q+%5] - movhps m7, [ref4q+%5] - psadbw m4, m0 - psadbw m5, m0 - psadbw m6, m0 - psadbw m7, m0 -%else - movh m1, [ref1q+%3] - movh m2, [ref2q+%3] - movh m3, [ref3q+%3] - movhps m0, [srcq +%4] - movhps m1, [ref1q+%5] - movhps m2, [ref2q+%5] - movhps m3, [ref3q+%5] - psadbw m1, m0 - psadbw m2, m0 - psadbw m3, m0 - paddd m4, m1 - movh m1, [ref4q+%3] - movhps m1, [ref4q+%5] - paddd m5, m2 - paddd m6, m3 - psadbw m1, m0 - paddd m7, m1 -%endif -%if %6 == 1 - lea srcq, [srcq +src_strideq*2] - lea ref1q, [ref1q+ref_strideq*2] - lea ref2q, [ref2q+ref_strideq*2] - lea ref3q, [ref3q+ref_strideq*2] - lea ref4q, [ref4q+ref_strideq*2] -%endif -%endmacro - -; PROCESS_16x2x4 first, off_{first,second}_{src,ref}, advance_at_end -%macro PROCESS_16x2x4 5-6 0 - ; 1st 16 px - mova m0, [srcq +%2] -%if %1 == 1 - movu m4, [ref1q+%3] - movu m5, [ref2q+%3] - movu m6, [ref3q+%3] - movu m7, [ref4q+%3] - psadbw m4, m0 - psadbw m5, m0 - psadbw m6, m0 - psadbw m7, m0 -%else - movu m1, [ref1q+%3] - movu m2, [ref2q+%3] - movu m3, [ref3q+%3] - psadbw m1, m0 - psadbw m2, m0 - psadbw m3, m0 - paddd m4, m1 - movu m1, [ref4q+%3] - paddd m5, m2 - paddd m6, m3 - psadbw m1, m0 - paddd m7, m1 -%endif - - ; 2nd 16 px - mova m0, [srcq +%4] - movu m1, [ref1q+%5] - movu m2, [ref2q+%5] - movu m3, [ref3q+%5] - psadbw m1, m0 - psadbw m2, m0 - psadbw m3, m0 - paddd m4, m1 - movu m1, [ref4q+%5] - paddd m5, m2 - paddd m6, m3 -%if %6 == 1 - lea srcq, [srcq +src_strideq*2] - lea ref1q, [ref1q+ref_strideq*2] - lea ref2q, [ref2q+ref_strideq*2] - lea ref3q, [ref3q+ref_strideq*2] - lea ref4q, [ref4q+ref_strideq*2] -%endif - psadbw m1, m0 - paddd m7, m1 -%endmacro - -; PROCESS_32x2x4 first, off_{first,second}_{src,ref}, advance_at_end -%macro PROCESS_32x2x4 5-6 0 - PROCESS_16x2x4 %1, %2, %3, %2 + 16, %3 + 16 - PROCESS_16x2x4 0, %4, %5, %4 + 16, %5 + 16, %6 -%endmacro - -; PROCESS_64x2x4 first, off_{first,second}_{src,ref}, advance_at_end -%macro PROCESS_64x2x4 5-6 0 - PROCESS_32x2x4 %1, %2, %3, %2 + 32, %3 + 32 - PROCESS_32x2x4 0, %4, %5, %4 + 32, %5 + 32, %6 -%endmacro - -; void vp9_sadNxNx4d_sse2(uint8_t *src, int src_stride, -; uint8_t *ref[4], int ref_stride, -; unsigned int res[4]); -; where NxN = 64x64, 32x32, 16x16, 16x8, 8x16 or 8x8 -%macro SADNXN4D 2 -%if UNIX64 -cglobal sad%1x%2x4d, 5, 8, 8, src, src_stride, ref1, ref_stride, \ - res, ref2, ref3, ref4 -%else -cglobal sad%1x%2x4d, 4, 7, 8, src, src_stride, ref1, ref_stride, \ - ref2, ref3, ref4 -%endif - movsxdifnidn src_strideq, src_strided - movsxdifnidn ref_strideq, ref_strided - mov ref2q, [ref1q+gprsize*1] - mov ref3q, [ref1q+gprsize*2] - mov ref4q, [ref1q+gprsize*3] - mov ref1q, [ref1q+gprsize*0] - - PROCESS_%1x2x4 1, 0, 0, src_strideq, ref_strideq, 1 -%rep (%2-4)/2 - PROCESS_%1x2x4 0, 0, 0, src_strideq, ref_strideq, 1 -%endrep - PROCESS_%1x2x4 0, 0, 0, src_strideq, ref_strideq, 0 - -%if mmsize == 16 - pslldq m5, 4 - pslldq m7, 4 - por m4, m5 - por m6, m7 - mova m5, m4 - mova m7, m6 - punpcklqdq m4, m6 - punpckhqdq m5, m7 - movifnidn r4, r4mp - paddd m4, m5 - movu [r4], m4 - RET -%else - movifnidn r4, r4mp - movq [r4+0], m6 - movq [r4+8], m7 - RET -%endif -%endmacro - -INIT_XMM sse2 -SADNXN4D 64, 64 -SADNXN4D 64, 32 -SADNXN4D 32, 64 -SADNXN4D 32, 32 -SADNXN4D 32, 16 -SADNXN4D 16, 32 -SADNXN4D 16, 16 -SADNXN4D 16, 8 -SADNXN4D 8, 16 -SADNXN4D 8, 8 -SADNXN4D 8, 4 - -INIT_MMX sse -SADNXN4D 4, 8 -SADNXN4D 4, 4 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad_intrin_avx2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad_intrin_avx2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad_intrin_avx2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad_intrin_avx2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,180 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#include -#include "vpx_ports/mem.h" - -#define FSAD64_H(h) \ -unsigned int vp9_sad64x##h##_avx2(const uint8_t *src_ptr, \ - int src_stride, \ - const uint8_t *ref_ptr, \ - int ref_stride) { \ - int i, res; \ - __m256i sad1_reg, sad2_reg, ref1_reg, ref2_reg; \ - __m256i sum_sad = _mm256_setzero_si256(); \ - __m256i sum_sad_h; \ - __m128i sum_sad128; \ - for (i = 0 ; i < h ; i++) { \ - ref1_reg = _mm256_loadu_si256((__m256i const *)ref_ptr); \ - ref2_reg = _mm256_loadu_si256((__m256i const *)(ref_ptr + 32)); \ - sad1_reg = _mm256_sad_epu8(ref1_reg, \ - _mm256_loadu_si256((__m256i const *)src_ptr)); \ - sad2_reg = _mm256_sad_epu8(ref2_reg, \ - _mm256_loadu_si256((__m256i const *)(src_ptr + 32))); \ - sum_sad = _mm256_add_epi32(sum_sad, _mm256_add_epi32(sad1_reg, sad2_reg)); \ - ref_ptr+= ref_stride; \ - src_ptr+= src_stride; \ - } \ - sum_sad_h = _mm256_srli_si256(sum_sad, 8); \ - sum_sad = _mm256_add_epi32(sum_sad, sum_sad_h); \ - sum_sad128 = _mm256_extracti128_si256(sum_sad, 1); \ - sum_sad128 = _mm_add_epi32(_mm256_castsi256_si128(sum_sad), sum_sad128); \ - res = _mm_cvtsi128_si32(sum_sad128); \ - return res; \ -} - -#define FSAD32_H(h) \ -unsigned int vp9_sad32x##h##_avx2(const uint8_t *src_ptr, \ - int src_stride, \ - const uint8_t *ref_ptr, \ - int ref_stride) { \ - int i, res; \ - __m256i sad1_reg, sad2_reg, ref1_reg, ref2_reg; \ - __m256i sum_sad = _mm256_setzero_si256(); \ - __m256i sum_sad_h; \ - __m128i sum_sad128; \ - int ref2_stride = ref_stride << 1; \ - int src2_stride = src_stride << 1; \ - int max = h >> 1; \ - for (i = 0 ; i < max ; i++) { \ - ref1_reg = _mm256_loadu_si256((__m256i const *)ref_ptr); \ - ref2_reg = _mm256_loadu_si256((__m256i const *)(ref_ptr + ref_stride)); \ - sad1_reg = _mm256_sad_epu8(ref1_reg, \ - _mm256_loadu_si256((__m256i const *)src_ptr)); \ - sad2_reg = _mm256_sad_epu8(ref2_reg, \ - _mm256_loadu_si256((__m256i const *)(src_ptr + src_stride))); \ - sum_sad = _mm256_add_epi32(sum_sad, _mm256_add_epi32(sad1_reg, sad2_reg)); \ - ref_ptr+= ref2_stride; \ - src_ptr+= src2_stride; \ - } \ - sum_sad_h = _mm256_srli_si256(sum_sad, 8); \ - sum_sad = _mm256_add_epi32(sum_sad, sum_sad_h); \ - sum_sad128 = _mm256_extracti128_si256(sum_sad, 1); \ - sum_sad128 = _mm_add_epi32(_mm256_castsi256_si128(sum_sad), sum_sad128); \ - res = _mm_cvtsi128_si32(sum_sad128); \ - return res; \ -} - -#define FSAD64 \ -FSAD64_H(64); \ -FSAD64_H(32); - -#define FSAD32 \ -FSAD32_H(64); \ -FSAD32_H(32); \ -FSAD32_H(16); - -FSAD64; -FSAD32; - -#undef FSAD64 -#undef FSAD32 -#undef FSAD64_H -#undef FSAD32_H - -#define FSADAVG64_H(h) \ -unsigned int vp9_sad64x##h##_avg_avx2(const uint8_t *src_ptr, \ - int src_stride, \ - const uint8_t *ref_ptr, \ - int ref_stride, \ - const uint8_t *second_pred) { \ - int i, res; \ - __m256i sad1_reg, sad2_reg, ref1_reg, ref2_reg; \ - __m256i sum_sad = _mm256_setzero_si256(); \ - __m256i sum_sad_h; \ - __m128i sum_sad128; \ - for (i = 0 ; i < h ; i++) { \ - ref1_reg = _mm256_loadu_si256((__m256i const *)ref_ptr); \ - ref2_reg = _mm256_loadu_si256((__m256i const *)(ref_ptr + 32)); \ - ref1_reg = _mm256_avg_epu8(ref1_reg, \ - _mm256_loadu_si256((__m256i const *)second_pred)); \ - ref2_reg = _mm256_avg_epu8(ref2_reg, \ - _mm256_loadu_si256((__m256i const *)(second_pred +32))); \ - sad1_reg = _mm256_sad_epu8(ref1_reg, \ - _mm256_loadu_si256((__m256i const *)src_ptr)); \ - sad2_reg = _mm256_sad_epu8(ref2_reg, \ - _mm256_loadu_si256((__m256i const *)(src_ptr + 32))); \ - sum_sad = _mm256_add_epi32(sum_sad, _mm256_add_epi32(sad1_reg, sad2_reg)); \ - ref_ptr+= ref_stride; \ - src_ptr+= src_stride; \ - second_pred+= 64; \ - } \ - sum_sad_h = _mm256_srli_si256(sum_sad, 8); \ - sum_sad = _mm256_add_epi32(sum_sad, sum_sad_h); \ - sum_sad128 = _mm256_extracti128_si256(sum_sad, 1); \ - sum_sad128 = _mm_add_epi32(_mm256_castsi256_si128(sum_sad), sum_sad128); \ - res = _mm_cvtsi128_si32(sum_sad128); \ - return res; \ -} - -#define FSADAVG32_H(h) \ -unsigned int vp9_sad32x##h##_avg_avx2(const uint8_t *src_ptr, \ - int src_stride, \ - const uint8_t *ref_ptr, \ - int ref_stride, \ - const uint8_t *second_pred) { \ - int i, res; \ - __m256i sad1_reg, sad2_reg, ref1_reg, ref2_reg; \ - __m256i sum_sad = _mm256_setzero_si256(); \ - __m256i sum_sad_h; \ - __m128i sum_sad128; \ - int ref2_stride = ref_stride << 1; \ - int src2_stride = src_stride << 1; \ - int max = h >> 1; \ - for (i = 0 ; i < max ; i++) { \ - ref1_reg = _mm256_loadu_si256((__m256i const *)ref_ptr); \ - ref2_reg = _mm256_loadu_si256((__m256i const *)(ref_ptr + ref_stride)); \ - ref1_reg = _mm256_avg_epu8(ref1_reg, \ - _mm256_loadu_si256((__m256i const *)second_pred)); \ - ref2_reg = _mm256_avg_epu8(ref2_reg, \ - _mm256_loadu_si256((__m256i const *)(second_pred +32))); \ - sad1_reg = _mm256_sad_epu8(ref1_reg, \ - _mm256_loadu_si256((__m256i const *)src_ptr)); \ - sad2_reg = _mm256_sad_epu8(ref2_reg, \ - _mm256_loadu_si256((__m256i const *)(src_ptr + src_stride))); \ - sum_sad = _mm256_add_epi32(sum_sad, \ - _mm256_add_epi32(sad1_reg, sad2_reg)); \ - ref_ptr+= ref2_stride; \ - src_ptr+= src2_stride; \ - second_pred+= 64; \ - } \ - sum_sad_h = _mm256_srli_si256(sum_sad, 8); \ - sum_sad = _mm256_add_epi32(sum_sad, sum_sad_h); \ - sum_sad128 = _mm256_extracti128_si256(sum_sad, 1); \ - sum_sad128 = _mm_add_epi32(_mm256_castsi256_si128(sum_sad), sum_sad128); \ - res = _mm_cvtsi128_si32(sum_sad128); \ - return res; \ -} - -#define FSADAVG64 \ -FSADAVG64_H(64); \ -FSADAVG64_H(32); - -#define FSADAVG32 \ -FSADAVG32_H(64); \ -FSADAVG32_H(32); \ -FSADAVG32_H(16); - -FSADAVG64; -FSADAVG32; - -#undef FSADAVG64 -#undef FSADAVG32 -#undef FSADAVG64_H -#undef FSADAVG32_H diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad_sse2.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad_sse2.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad_sse2.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad_sse2.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,267 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - -%include "third_party/x86inc/x86inc.asm" - -SECTION .text - -%macro SAD_FN 4 -%if %4 == 0 -%if %3 == 5 -cglobal sad%1x%2, 4, %3, 5, src, src_stride, ref, ref_stride, n_rows -%else ; %3 == 7 -cglobal sad%1x%2, 4, %3, 5, src, src_stride, ref, ref_stride, \ - src_stride3, ref_stride3, n_rows -%endif ; %3 == 5/7 -%else ; avg -%if %3 == 5 -cglobal sad%1x%2_avg, 5, 1 + %3, 5, src, src_stride, ref, ref_stride, \ - second_pred, n_rows -%else ; %3 == 7 -cglobal sad%1x%2_avg, 5, ARCH_X86_64 + %3, 5, src, src_stride, \ - ref, ref_stride, \ - second_pred, \ - src_stride3, ref_stride3 -%if ARCH_X86_64 -%define n_rowsd r7d -%else ; x86-32 -%define n_rowsd dword r0m -%endif ; x86-32/64 -%endif ; %3 == 5/7 -%endif ; avg/sad - movsxdifnidn src_strideq, src_strided - movsxdifnidn ref_strideq, ref_strided -%if %3 == 7 - lea src_stride3q, [src_strideq*3] - lea ref_stride3q, [ref_strideq*3] -%endif ; %3 == 7 -%endmacro - -; unsigned int vp9_sad64x64_sse2(uint8_t *src, int src_stride, -; uint8_t *ref, int ref_stride); -%macro SAD64XN 1-2 0 - SAD_FN 64, %1, 5, %2 - mov n_rowsd, %1 - pxor m0, m0 -.loop: - movu m1, [refq] - movu m2, [refq+16] - movu m3, [refq+32] - movu m4, [refq+48] -%if %2 == 1 - pavgb m1, [second_predq+mmsize*0] - pavgb m2, [second_predq+mmsize*1] - pavgb m3, [second_predq+mmsize*2] - pavgb m4, [second_predq+mmsize*3] - lea second_predq, [second_predq+mmsize*4] -%endif - psadbw m1, [srcq] - psadbw m2, [srcq+16] - psadbw m3, [srcq+32] - psadbw m4, [srcq+48] - paddd m1, m2 - paddd m3, m4 - add refq, ref_strideq - paddd m0, m1 - add srcq, src_strideq - paddd m0, m3 - dec n_rowsd - jg .loop - - movhlps m1, m0 - paddd m0, m1 - movd eax, m0 - RET -%endmacro - -INIT_XMM sse2 -SAD64XN 64 ; sad64x64_sse2 -SAD64XN 32 ; sad64x32_sse2 -SAD64XN 64, 1 ; sad64x64_avg_sse2 -SAD64XN 32, 1 ; sad64x32_avg_sse2 - -; unsigned int vp9_sad32x32_sse2(uint8_t *src, int src_stride, -; uint8_t *ref, int ref_stride); -%macro SAD32XN 1-2 0 - SAD_FN 32, %1, 5, %2 - mov n_rowsd, %1/2 - pxor m0, m0 -.loop: - movu m1, [refq] - movu m2, [refq+16] - movu m3, [refq+ref_strideq] - movu m4, [refq+ref_strideq+16] -%if %2 == 1 - pavgb m1, [second_predq+mmsize*0] - pavgb m2, [second_predq+mmsize*1] - pavgb m3, [second_predq+mmsize*2] - pavgb m4, [second_predq+mmsize*3] - lea second_predq, [second_predq+mmsize*4] -%endif - psadbw m1, [srcq] - psadbw m2, [srcq+16] - psadbw m3, [srcq+src_strideq] - psadbw m4, [srcq+src_strideq+16] - paddd m1, m2 - paddd m3, m4 - lea refq, [refq+ref_strideq*2] - paddd m0, m1 - lea srcq, [srcq+src_strideq*2] - paddd m0, m3 - dec n_rowsd - jg .loop - - movhlps m1, m0 - paddd m0, m1 - movd eax, m0 - RET -%endmacro - -INIT_XMM sse2 -SAD32XN 64 ; sad32x64_sse2 -SAD32XN 32 ; sad32x32_sse2 -SAD32XN 16 ; sad32x16_sse2 -SAD32XN 64, 1 ; sad32x64_avg_sse2 -SAD32XN 32, 1 ; sad32x32_avg_sse2 -SAD32XN 16, 1 ; sad32x16_avg_sse2 - -; unsigned int vp9_sad16x{8,16}_sse2(uint8_t *src, int src_stride, -; uint8_t *ref, int ref_stride); -%macro SAD16XN 1-2 0 - SAD_FN 16, %1, 7, %2 - mov n_rowsd, %1/4 - pxor m0, m0 - -.loop: - movu m1, [refq] - movu m2, [refq+ref_strideq] - movu m3, [refq+ref_strideq*2] - movu m4, [refq+ref_stride3q] -%if %2 == 1 - pavgb m1, [second_predq+mmsize*0] - pavgb m2, [second_predq+mmsize*1] - pavgb m3, [second_predq+mmsize*2] - pavgb m4, [second_predq+mmsize*3] - lea second_predq, [second_predq+mmsize*4] -%endif - psadbw m1, [srcq] - psadbw m2, [srcq+src_strideq] - psadbw m3, [srcq+src_strideq*2] - psadbw m4, [srcq+src_stride3q] - paddd m1, m2 - paddd m3, m4 - lea refq, [refq+ref_strideq*4] - paddd m0, m1 - lea srcq, [srcq+src_strideq*4] - paddd m0, m3 - dec n_rowsd - jg .loop - - movhlps m1, m0 - paddd m0, m1 - movd eax, m0 - RET -%endmacro - -INIT_XMM sse2 -SAD16XN 32 ; sad16x32_sse2 -SAD16XN 16 ; sad16x16_sse2 -SAD16XN 8 ; sad16x8_sse2 -SAD16XN 32, 1 ; sad16x32_avg_sse2 -SAD16XN 16, 1 ; sad16x16_avg_sse2 -SAD16XN 8, 1 ; sad16x8_avg_sse2 - -; unsigned int vp9_sad8x{8,16}_sse2(uint8_t *src, int src_stride, -; uint8_t *ref, int ref_stride); -%macro SAD8XN 1-2 0 - SAD_FN 8, %1, 7, %2 - mov n_rowsd, %1/4 - pxor m0, m0 - -.loop: - movh m1, [refq] - movhps m1, [refq+ref_strideq] - movh m2, [refq+ref_strideq*2] - movhps m2, [refq+ref_stride3q] -%if %2 == 1 - pavgb m1, [second_predq+mmsize*0] - pavgb m2, [second_predq+mmsize*1] - lea second_predq, [second_predq+mmsize*2] -%endif - movh m3, [srcq] - movhps m3, [srcq+src_strideq] - movh m4, [srcq+src_strideq*2] - movhps m4, [srcq+src_stride3q] - psadbw m1, m3 - psadbw m2, m4 - lea refq, [refq+ref_strideq*4] - paddd m0, m1 - lea srcq, [srcq+src_strideq*4] - paddd m0, m2 - dec n_rowsd - jg .loop - - movhlps m1, m0 - paddd m0, m1 - movd eax, m0 - RET -%endmacro - -INIT_XMM sse2 -SAD8XN 16 ; sad8x16_sse2 -SAD8XN 8 ; sad8x8_sse2 -SAD8XN 4 ; sad8x4_sse2 -SAD8XN 16, 1 ; sad8x16_avg_sse2 -SAD8XN 8, 1 ; sad8x8_avg_sse2 -SAD8XN 4, 1 ; sad8x4_avg_sse2 - -; unsigned int vp9_sad4x{4, 8}_sse(uint8_t *src, int src_stride, -; uint8_t *ref, int ref_stride); -%macro SAD4XN 1-2 0 - SAD_FN 4, %1, 7, %2 - mov n_rowsd, %1/4 - pxor m0, m0 - -.loop: - movd m1, [refq] - movd m2, [refq+ref_strideq] - movd m3, [refq+ref_strideq*2] - movd m4, [refq+ref_stride3q] - punpckldq m1, m2 - punpckldq m3, m4 -%if %2 == 1 - pavgb m1, [second_predq+mmsize*0] - pavgb m3, [second_predq+mmsize*1] - lea second_predq, [second_predq+mmsize*2] -%endif - movd m2, [srcq] - movd m5, [srcq+src_strideq] - movd m4, [srcq+src_strideq*2] - movd m6, [srcq+src_stride3q] - punpckldq m2, m5 - punpckldq m4, m6 - psadbw m1, m2 - psadbw m3, m4 - lea refq, [refq+ref_strideq*4] - paddd m0, m1 - lea srcq, [srcq+src_strideq*4] - paddd m0, m3 - dec n_rowsd - jg .loop - - movd eax, m0 - RET -%endmacro - -INIT_MMX sse -SAD4XN 8 ; sad4x8_sse -SAD4XN 4 ; sad4x4_sse -SAD4XN 8, 1 ; sad4x8_avg_sse -SAD4XN 4, 1 ; sad4x4_avg_sse diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad_sse3.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad_sse3.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad_sse3.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad_sse3.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,378 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - -%include "vpx_ports/x86_abi_support.asm" - -%macro STACK_FRAME_CREATE_X3 0 -%if ABI_IS_32BIT - %define src_ptr rsi - %define src_stride rax - %define ref_ptr rdi - %define ref_stride rdx - %define end_ptr rcx - %define ret_var rbx - %define result_ptr arg(4) - %define max_err arg(4) - %define height dword ptr arg(4) - push rbp - mov rbp, rsp - push rsi - push rdi - push rbx - - mov rsi, arg(0) ; src_ptr - mov rdi, arg(2) ; ref_ptr - - movsxd rax, dword ptr arg(1) ; src_stride - movsxd rdx, dword ptr arg(3) ; ref_stride -%else - %if LIBVPX_YASM_WIN64 - SAVE_XMM 7, u - %define src_ptr rcx - %define src_stride rdx - %define ref_ptr r8 - %define ref_stride r9 - %define end_ptr r10 - %define ret_var r11 - %define result_ptr [rsp+xmm_stack_space+8+4*8] - %define max_err [rsp+xmm_stack_space+8+4*8] - %define height dword ptr [rsp+xmm_stack_space+8+4*8] - %else - %define src_ptr rdi - %define src_stride rsi - %define ref_ptr rdx - %define ref_stride rcx - %define end_ptr r9 - %define ret_var r10 - %define result_ptr r8 - %define max_err r8 - %define height r8 - %endif -%endif - -%endmacro - -%macro STACK_FRAME_DESTROY_X3 0 - %define src_ptr - %define src_stride - %define ref_ptr - %define ref_stride - %define end_ptr - %define ret_var - %define result_ptr - %define max_err - %define height - -%if ABI_IS_32BIT - pop rbx - pop rdi - pop rsi - pop rbp -%else - %if LIBVPX_YASM_WIN64 - RESTORE_XMM - %endif -%endif - ret -%endmacro - -%macro PROCESS_16X2X3 5 -%if %1==0 - movdqa xmm0, XMMWORD PTR [%2] - lddqu xmm5, XMMWORD PTR [%3] - lddqu xmm6, XMMWORD PTR [%3+1] - lddqu xmm7, XMMWORD PTR [%3+2] - - psadbw xmm5, xmm0 - psadbw xmm6, xmm0 - psadbw xmm7, xmm0 -%else - movdqa xmm0, XMMWORD PTR [%2] - lddqu xmm1, XMMWORD PTR [%3] - lddqu xmm2, XMMWORD PTR [%3+1] - lddqu xmm3, XMMWORD PTR [%3+2] - - psadbw xmm1, xmm0 - psadbw xmm2, xmm0 - psadbw xmm3, xmm0 - - paddw xmm5, xmm1 - paddw xmm6, xmm2 - paddw xmm7, xmm3 -%endif - movdqa xmm0, XMMWORD PTR [%2+%4] - lddqu xmm1, XMMWORD PTR [%3+%5] - lddqu xmm2, XMMWORD PTR [%3+%5+1] - lddqu xmm3, XMMWORD PTR [%3+%5+2] - -%if %1==0 || %1==1 - lea %2, [%2+%4*2] - lea %3, [%3+%5*2] -%endif - - psadbw xmm1, xmm0 - psadbw xmm2, xmm0 - psadbw xmm3, xmm0 - - paddw xmm5, xmm1 - paddw xmm6, xmm2 - paddw xmm7, xmm3 -%endmacro - -%macro PROCESS_8X2X3 5 -%if %1==0 - movq mm0, QWORD PTR [%2] - movq mm5, QWORD PTR [%3] - movq mm6, QWORD PTR [%3+1] - movq mm7, QWORD PTR [%3+2] - - psadbw mm5, mm0 - psadbw mm6, mm0 - psadbw mm7, mm0 -%else - movq mm0, QWORD PTR [%2] - movq mm1, QWORD PTR [%3] - movq mm2, QWORD PTR [%3+1] - movq mm3, QWORD PTR [%3+2] - - psadbw mm1, mm0 - psadbw mm2, mm0 - psadbw mm3, mm0 - - paddw mm5, mm1 - paddw mm6, mm2 - paddw mm7, mm3 -%endif - movq mm0, QWORD PTR [%2+%4] - movq mm1, QWORD PTR [%3+%5] - movq mm2, QWORD PTR [%3+%5+1] - movq mm3, QWORD PTR [%3+%5+2] - -%if %1==0 || %1==1 - lea %2, [%2+%4*2] - lea %3, [%3+%5*2] -%endif - - psadbw mm1, mm0 - psadbw mm2, mm0 - psadbw mm3, mm0 - - paddw mm5, mm1 - paddw mm6, mm2 - paddw mm7, mm3 -%endmacro - -;void int vp9_sad16x16x3_sse3( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride, -; int *results) -global sym(vp9_sad16x16x3_sse3) PRIVATE -sym(vp9_sad16x16x3_sse3): - - STACK_FRAME_CREATE_X3 - - PROCESS_16X2X3 0, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_16X2X3 2, src_ptr, ref_ptr, src_stride, ref_stride - - mov rcx, result_ptr - - movq xmm0, xmm5 - psrldq xmm5, 8 - - paddw xmm0, xmm5 - movd [rcx], xmm0 -;- - movq xmm0, xmm6 - psrldq xmm6, 8 - - paddw xmm0, xmm6 - movd [rcx+4], xmm0 -;- - movq xmm0, xmm7 - psrldq xmm7, 8 - - paddw xmm0, xmm7 - movd [rcx+8], xmm0 - - STACK_FRAME_DESTROY_X3 - -;void int vp9_sad16x8x3_sse3( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride, -; int *results) -global sym(vp9_sad16x8x3_sse3) PRIVATE -sym(vp9_sad16x8x3_sse3): - - STACK_FRAME_CREATE_X3 - - PROCESS_16X2X3 0, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_16X2X3 2, src_ptr, ref_ptr, src_stride, ref_stride - - mov rcx, result_ptr - - movq xmm0, xmm5 - psrldq xmm5, 8 - - paddw xmm0, xmm5 - movd [rcx], xmm0 -;- - movq xmm0, xmm6 - psrldq xmm6, 8 - - paddw xmm0, xmm6 - movd [rcx+4], xmm0 -;- - movq xmm0, xmm7 - psrldq xmm7, 8 - - paddw xmm0, xmm7 - movd [rcx+8], xmm0 - - STACK_FRAME_DESTROY_X3 - -;void int vp9_sad8x16x3_sse3( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride, -; int *results) -global sym(vp9_sad8x16x3_sse3) PRIVATE -sym(vp9_sad8x16x3_sse3): - - STACK_FRAME_CREATE_X3 - - PROCESS_8X2X3 0, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_8X2X3 2, src_ptr, ref_ptr, src_stride, ref_stride - - mov rcx, result_ptr - - punpckldq mm5, mm6 - - movq [rcx], mm5 - movd [rcx+8], mm7 - - STACK_FRAME_DESTROY_X3 - -;void int vp9_sad8x8x3_sse3( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride, -; int *results) -global sym(vp9_sad8x8x3_sse3) PRIVATE -sym(vp9_sad8x8x3_sse3): - - STACK_FRAME_CREATE_X3 - - PROCESS_8X2X3 0, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride - PROCESS_8X2X3 2, src_ptr, ref_ptr, src_stride, ref_stride - - mov rcx, result_ptr - - punpckldq mm5, mm6 - - movq [rcx], mm5 - movd [rcx+8], mm7 - - STACK_FRAME_DESTROY_X3 - -;void int vp9_sad4x4x3_sse3( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride, -; int *results) -global sym(vp9_sad4x4x3_sse3) PRIVATE -sym(vp9_sad4x4x3_sse3): - - STACK_FRAME_CREATE_X3 - - movd mm0, DWORD PTR [src_ptr] - movd mm1, DWORD PTR [ref_ptr] - - movd mm2, DWORD PTR [src_ptr+src_stride] - movd mm3, DWORD PTR [ref_ptr+ref_stride] - - punpcklbw mm0, mm2 - punpcklbw mm1, mm3 - - movd mm4, DWORD PTR [ref_ptr+1] - movd mm5, DWORD PTR [ref_ptr+2] - - movd mm2, DWORD PTR [ref_ptr+ref_stride+1] - movd mm3, DWORD PTR [ref_ptr+ref_stride+2] - - psadbw mm1, mm0 - - punpcklbw mm4, mm2 - punpcklbw mm5, mm3 - - psadbw mm4, mm0 - psadbw mm5, mm0 - - lea src_ptr, [src_ptr+src_stride*2] - lea ref_ptr, [ref_ptr+ref_stride*2] - - movd mm0, DWORD PTR [src_ptr] - movd mm2, DWORD PTR [ref_ptr] - - movd mm3, DWORD PTR [src_ptr+src_stride] - movd mm6, DWORD PTR [ref_ptr+ref_stride] - - punpcklbw mm0, mm3 - punpcklbw mm2, mm6 - - movd mm3, DWORD PTR [ref_ptr+1] - movd mm7, DWORD PTR [ref_ptr+2] - - psadbw mm2, mm0 - - paddw mm1, mm2 - - movd mm2, DWORD PTR [ref_ptr+ref_stride+1] - movd mm6, DWORD PTR [ref_ptr+ref_stride+2] - - punpcklbw mm3, mm2 - punpcklbw mm7, mm6 - - psadbw mm3, mm0 - psadbw mm7, mm0 - - paddw mm3, mm4 - paddw mm7, mm5 - - mov rcx, result_ptr - - punpckldq mm1, mm3 - - movq [rcx], mm1 - movd [rcx+8], mm7 - - STACK_FRAME_DESTROY_X3 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad_sse4.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad_sse4.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad_sse4.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad_sse4.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,359 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -%macro PROCESS_16X2X8 1 -%if %1 - movdqa xmm0, XMMWORD PTR [rsi] - movq xmm1, MMWORD PTR [rdi] - movq xmm3, MMWORD PTR [rdi+8] - movq xmm2, MMWORD PTR [rdi+16] - punpcklqdq xmm1, xmm3 - punpcklqdq xmm3, xmm2 - - movdqa xmm2, xmm1 - mpsadbw xmm1, xmm0, 0x0 - mpsadbw xmm2, xmm0, 0x5 - - psrldq xmm0, 8 - - movdqa xmm4, xmm3 - mpsadbw xmm3, xmm0, 0x0 - mpsadbw xmm4, xmm0, 0x5 - - paddw xmm1, xmm2 - paddw xmm1, xmm3 - paddw xmm1, xmm4 -%else - movdqa xmm0, XMMWORD PTR [rsi] - movq xmm5, MMWORD PTR [rdi] - movq xmm3, MMWORD PTR [rdi+8] - movq xmm2, MMWORD PTR [rdi+16] - punpcklqdq xmm5, xmm3 - punpcklqdq xmm3, xmm2 - - movdqa xmm2, xmm5 - mpsadbw xmm5, xmm0, 0x0 - mpsadbw xmm2, xmm0, 0x5 - - psrldq xmm0, 8 - - movdqa xmm4, xmm3 - mpsadbw xmm3, xmm0, 0x0 - mpsadbw xmm4, xmm0, 0x5 - - paddw xmm5, xmm2 - paddw xmm5, xmm3 - paddw xmm5, xmm4 - - paddw xmm1, xmm5 -%endif - movdqa xmm0, XMMWORD PTR [rsi + rax] - movq xmm5, MMWORD PTR [rdi+ rdx] - movq xmm3, MMWORD PTR [rdi+ rdx+8] - movq xmm2, MMWORD PTR [rdi+ rdx+16] - punpcklqdq xmm5, xmm3 - punpcklqdq xmm3, xmm2 - - lea rsi, [rsi+rax*2] - lea rdi, [rdi+rdx*2] - - movdqa xmm2, xmm5 - mpsadbw xmm5, xmm0, 0x0 - mpsadbw xmm2, xmm0, 0x5 - - psrldq xmm0, 8 - movdqa xmm4, xmm3 - mpsadbw xmm3, xmm0, 0x0 - mpsadbw xmm4, xmm0, 0x5 - - paddw xmm5, xmm2 - paddw xmm5, xmm3 - paddw xmm5, xmm4 - - paddw xmm1, xmm5 -%endmacro - -%macro PROCESS_8X2X8 1 -%if %1 - movq xmm0, MMWORD PTR [rsi] - movq xmm1, MMWORD PTR [rdi] - movq xmm3, MMWORD PTR [rdi+8] - punpcklqdq xmm1, xmm3 - - movdqa xmm2, xmm1 - mpsadbw xmm1, xmm0, 0x0 - mpsadbw xmm2, xmm0, 0x5 - paddw xmm1, xmm2 -%else - movq xmm0, MMWORD PTR [rsi] - movq xmm5, MMWORD PTR [rdi] - movq xmm3, MMWORD PTR [rdi+8] - punpcklqdq xmm5, xmm3 - - movdqa xmm2, xmm5 - mpsadbw xmm5, xmm0, 0x0 - mpsadbw xmm2, xmm0, 0x5 - paddw xmm5, xmm2 - - paddw xmm1, xmm5 -%endif - movq xmm0, MMWORD PTR [rsi + rax] - movq xmm5, MMWORD PTR [rdi+ rdx] - movq xmm3, MMWORD PTR [rdi+ rdx+8] - punpcklqdq xmm5, xmm3 - - lea rsi, [rsi+rax*2] - lea rdi, [rdi+rdx*2] - - movdqa xmm2, xmm5 - mpsadbw xmm5, xmm0, 0x0 - mpsadbw xmm2, xmm0, 0x5 - paddw xmm5, xmm2 - - paddw xmm1, xmm5 -%endmacro - -%macro PROCESS_4X2X8 1 -%if %1 - movd xmm0, [rsi] - movq xmm1, MMWORD PTR [rdi] - movq xmm3, MMWORD PTR [rdi+8] - punpcklqdq xmm1, xmm3 - - mpsadbw xmm1, xmm0, 0x0 -%else - movd xmm0, [rsi] - movq xmm5, MMWORD PTR [rdi] - movq xmm3, MMWORD PTR [rdi+8] - punpcklqdq xmm5, xmm3 - - mpsadbw xmm5, xmm0, 0x0 - - paddw xmm1, xmm5 -%endif - movd xmm0, [rsi + rax] - movq xmm5, MMWORD PTR [rdi+ rdx] - movq xmm3, MMWORD PTR [rdi+ rdx+8] - punpcklqdq xmm5, xmm3 - - lea rsi, [rsi+rax*2] - lea rdi, [rdi+rdx*2] - - mpsadbw xmm5, xmm0, 0x0 - - paddw xmm1, xmm5 -%endmacro - -%macro WRITE_AS_INTS 0 - mov rdi, arg(4) ;Results - pxor xmm0, xmm0 - movdqa xmm2, xmm1 - punpcklwd xmm1, xmm0 - punpckhwd xmm2, xmm0 - - movdqa [rdi], xmm1 - movdqa [rdi + 16], xmm2 -%endmacro - -;void vp9_sad16x16x8_sse4( -; const unsigned char *src_ptr, -; int src_stride, -; const unsigned char *ref_ptr, -; int ref_stride, -; unsigned short *sad_array); -global sym(vp9_sad16x16x8_sse4) PRIVATE -sym(vp9_sad16x16x8_sse4): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - PROCESS_16X2X8 1 - PROCESS_16X2X8 0 - PROCESS_16X2X8 0 - PROCESS_16X2X8 0 - PROCESS_16X2X8 0 - PROCESS_16X2X8 0 - PROCESS_16X2X8 0 - PROCESS_16X2X8 0 - - WRITE_AS_INTS - - ; begin epilog - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret - - -;void vp9_sad16x8x8_sse4( -; const unsigned char *src_ptr, -; int src_stride, -; const unsigned char *ref_ptr, -; int ref_stride, -; unsigned short *sad_array -;); -global sym(vp9_sad16x8x8_sse4) PRIVATE -sym(vp9_sad16x8x8_sse4): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - PROCESS_16X2X8 1 - PROCESS_16X2X8 0 - PROCESS_16X2X8 0 - PROCESS_16X2X8 0 - - WRITE_AS_INTS - - ; begin epilog - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret - - -;void vp9_sad8x8x8_sse4( -; const unsigned char *src_ptr, -; int src_stride, -; const unsigned char *ref_ptr, -; int ref_stride, -; unsigned short *sad_array -;); -global sym(vp9_sad8x8x8_sse4) PRIVATE -sym(vp9_sad8x8x8_sse4): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - PROCESS_8X2X8 1 - PROCESS_8X2X8 0 - PROCESS_8X2X8 0 - PROCESS_8X2X8 0 - - WRITE_AS_INTS - - ; begin epilog - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret - - -;void vp9_sad8x16x8_sse4( -; const unsigned char *src_ptr, -; int src_stride, -; const unsigned char *ref_ptr, -; int ref_stride, -; unsigned short *sad_array -;); -global sym(vp9_sad8x16x8_sse4) PRIVATE -sym(vp9_sad8x16x8_sse4): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - PROCESS_8X2X8 1 - PROCESS_8X2X8 0 - PROCESS_8X2X8 0 - PROCESS_8X2X8 0 - PROCESS_8X2X8 0 - PROCESS_8X2X8 0 - PROCESS_8X2X8 0 - PROCESS_8X2X8 0 - - WRITE_AS_INTS - - ; begin epilog - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret - - -;void vp9_sad4x4x8_c( -; const unsigned char *src_ptr, -; int src_stride, -; const unsigned char *ref_ptr, -; int ref_stride, -; unsigned short *sad_array -;); -global sym(vp9_sad4x4x8_sse4) PRIVATE -sym(vp9_sad4x4x8_sse4): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - PROCESS_4X2X8 1 - PROCESS_4X2X8 0 - - WRITE_AS_INTS - - ; begin epilog - pop rdi - pop rsi - UNSHADOW_ARGS - pop rbp - ret - - - - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad_ssse3.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad_ssse3.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad_ssse3.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_sad_ssse3.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,370 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -%macro PROCESS_16X2X3 1 -%if %1 - movdqa xmm0, XMMWORD PTR [rsi] - lddqu xmm5, XMMWORD PTR [rdi] - lddqu xmm6, XMMWORD PTR [rdi+1] - lddqu xmm7, XMMWORD PTR [rdi+2] - - psadbw xmm5, xmm0 - psadbw xmm6, xmm0 - psadbw xmm7, xmm0 -%else - movdqa xmm0, XMMWORD PTR [rsi] - lddqu xmm1, XMMWORD PTR [rdi] - lddqu xmm2, XMMWORD PTR [rdi+1] - lddqu xmm3, XMMWORD PTR [rdi+2] - - psadbw xmm1, xmm0 - psadbw xmm2, xmm0 - psadbw xmm3, xmm0 - - paddw xmm5, xmm1 - paddw xmm6, xmm2 - paddw xmm7, xmm3 -%endif - movdqa xmm0, XMMWORD PTR [rsi+rax] - lddqu xmm1, XMMWORD PTR [rdi+rdx] - lddqu xmm2, XMMWORD PTR [rdi+rdx+1] - lddqu xmm3, XMMWORD PTR [rdi+rdx+2] - - lea rsi, [rsi+rax*2] - lea rdi, [rdi+rdx*2] - - psadbw xmm1, xmm0 - psadbw xmm2, xmm0 - psadbw xmm3, xmm0 - - paddw xmm5, xmm1 - paddw xmm6, xmm2 - paddw xmm7, xmm3 -%endmacro - -%macro PROCESS_16X2X3_OFFSET 2 -%if %1 - movdqa xmm0, XMMWORD PTR [rsi] - movdqa xmm4, XMMWORD PTR [rdi] - movdqa xmm7, XMMWORD PTR [rdi+16] - - movdqa xmm5, xmm7 - palignr xmm5, xmm4, %2 - - movdqa xmm6, xmm7 - palignr xmm6, xmm4, (%2+1) - - palignr xmm7, xmm4, (%2+2) - - psadbw xmm5, xmm0 - psadbw xmm6, xmm0 - psadbw xmm7, xmm0 -%else - movdqa xmm0, XMMWORD PTR [rsi] - movdqa xmm4, XMMWORD PTR [rdi] - movdqa xmm3, XMMWORD PTR [rdi+16] - - movdqa xmm1, xmm3 - palignr xmm1, xmm4, %2 - - movdqa xmm2, xmm3 - palignr xmm2, xmm4, (%2+1) - - palignr xmm3, xmm4, (%2+2) - - psadbw xmm1, xmm0 - psadbw xmm2, xmm0 - psadbw xmm3, xmm0 - - paddw xmm5, xmm1 - paddw xmm6, xmm2 - paddw xmm7, xmm3 -%endif - movdqa xmm0, XMMWORD PTR [rsi+rax] - movdqa xmm4, XMMWORD PTR [rdi+rdx] - movdqa xmm3, XMMWORD PTR [rdi+rdx+16] - - movdqa xmm1, xmm3 - palignr xmm1, xmm4, %2 - - movdqa xmm2, xmm3 - palignr xmm2, xmm4, (%2+1) - - palignr xmm3, xmm4, (%2+2) - - lea rsi, [rsi+rax*2] - lea rdi, [rdi+rdx*2] - - psadbw xmm1, xmm0 - psadbw xmm2, xmm0 - psadbw xmm3, xmm0 - - paddw xmm5, xmm1 - paddw xmm6, xmm2 - paddw xmm7, xmm3 -%endmacro - -%macro PROCESS_16X16X3_OFFSET 2 -%2_aligned_by_%1: - - sub rdi, %1 - - PROCESS_16X2X3_OFFSET 1, %1 - PROCESS_16X2X3_OFFSET 0, %1 - PROCESS_16X2X3_OFFSET 0, %1 - PROCESS_16X2X3_OFFSET 0, %1 - PROCESS_16X2X3_OFFSET 0, %1 - PROCESS_16X2X3_OFFSET 0, %1 - PROCESS_16X2X3_OFFSET 0, %1 - PROCESS_16X2X3_OFFSET 0, %1 - - jmp %2_store_off - -%endmacro - -%macro PROCESS_16X8X3_OFFSET 2 -%2_aligned_by_%1: - - sub rdi, %1 - - PROCESS_16X2X3_OFFSET 1, %1 - PROCESS_16X2X3_OFFSET 0, %1 - PROCESS_16X2X3_OFFSET 0, %1 - PROCESS_16X2X3_OFFSET 0, %1 - - jmp %2_store_off - -%endmacro - -;void int vp9_sad16x16x3_ssse3( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride, -; int *results) -global sym(vp9_sad16x16x3_ssse3) PRIVATE -sym(vp9_sad16x16x3_ssse3): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - SAVE_XMM 7 - push rsi - push rdi - push rcx - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - mov rdx, 0xf - and rdx, rdi - - jmp .vp9_sad16x16x3_ssse3_skiptable -.vp9_sad16x16x3_ssse3_jumptable: - dd .vp9_sad16x16x3_ssse3_aligned_by_0 - .vp9_sad16x16x3_ssse3_do_jump - dd .vp9_sad16x16x3_ssse3_aligned_by_1 - .vp9_sad16x16x3_ssse3_do_jump - dd .vp9_sad16x16x3_ssse3_aligned_by_2 - .vp9_sad16x16x3_ssse3_do_jump - dd .vp9_sad16x16x3_ssse3_aligned_by_3 - .vp9_sad16x16x3_ssse3_do_jump - dd .vp9_sad16x16x3_ssse3_aligned_by_4 - .vp9_sad16x16x3_ssse3_do_jump - dd .vp9_sad16x16x3_ssse3_aligned_by_5 - .vp9_sad16x16x3_ssse3_do_jump - dd .vp9_sad16x16x3_ssse3_aligned_by_6 - .vp9_sad16x16x3_ssse3_do_jump - dd .vp9_sad16x16x3_ssse3_aligned_by_7 - .vp9_sad16x16x3_ssse3_do_jump - dd .vp9_sad16x16x3_ssse3_aligned_by_8 - .vp9_sad16x16x3_ssse3_do_jump - dd .vp9_sad16x16x3_ssse3_aligned_by_9 - .vp9_sad16x16x3_ssse3_do_jump - dd .vp9_sad16x16x3_ssse3_aligned_by_10 - .vp9_sad16x16x3_ssse3_do_jump - dd .vp9_sad16x16x3_ssse3_aligned_by_11 - .vp9_sad16x16x3_ssse3_do_jump - dd .vp9_sad16x16x3_ssse3_aligned_by_12 - .vp9_sad16x16x3_ssse3_do_jump - dd .vp9_sad16x16x3_ssse3_aligned_by_13 - .vp9_sad16x16x3_ssse3_do_jump - dd .vp9_sad16x16x3_ssse3_aligned_by_14 - .vp9_sad16x16x3_ssse3_do_jump - dd .vp9_sad16x16x3_ssse3_aligned_by_15 - .vp9_sad16x16x3_ssse3_do_jump -.vp9_sad16x16x3_ssse3_skiptable: - - call .vp9_sad16x16x3_ssse3_do_jump -.vp9_sad16x16x3_ssse3_do_jump: - pop rcx ; get the address of do_jump - mov rax, .vp9_sad16x16x3_ssse3_jumptable - .vp9_sad16x16x3_ssse3_do_jump - add rax, rcx ; get the absolute address of vp9_sad16x16x3_ssse3_jumptable - - movsxd rax, dword [rax + 4*rdx] ; get the 32 bit offset from the jumptable - add rcx, rax - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - jmp rcx - - PROCESS_16X16X3_OFFSET 0, .vp9_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 1, .vp9_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 2, .vp9_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 3, .vp9_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 4, .vp9_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 5, .vp9_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 6, .vp9_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 7, .vp9_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 8, .vp9_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 9, .vp9_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 10, .vp9_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 11, .vp9_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 12, .vp9_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 13, .vp9_sad16x16x3_ssse3 - PROCESS_16X16X3_OFFSET 14, .vp9_sad16x16x3_ssse3 - -.vp9_sad16x16x3_ssse3_aligned_by_15: - PROCESS_16X2X3 1 - PROCESS_16X2X3 0 - PROCESS_16X2X3 0 - PROCESS_16X2X3 0 - PROCESS_16X2X3 0 - PROCESS_16X2X3 0 - PROCESS_16X2X3 0 - PROCESS_16X2X3 0 - -.vp9_sad16x16x3_ssse3_store_off: - mov rdi, arg(4) ;Results - - movq xmm0, xmm5 - psrldq xmm5, 8 - - paddw xmm0, xmm5 - movd [rdi], xmm0 -;- - movq xmm0, xmm6 - psrldq xmm6, 8 - - paddw xmm0, xmm6 - movd [rdi+4], xmm0 -;- - movq xmm0, xmm7 - psrldq xmm7, 8 - - paddw xmm0, xmm7 - movd [rdi+8], xmm0 - - ; begin epilog - pop rcx - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -;void int vp9_sad16x8x3_ssse3( -; unsigned char *src_ptr, -; int src_stride, -; unsigned char *ref_ptr, -; int ref_stride, -; int *results) -global sym(vp9_sad16x8x3_ssse3) PRIVATE -sym(vp9_sad16x8x3_ssse3): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 5 - SAVE_XMM 7 - push rsi - push rdi - push rcx - ; end prolog - - mov rsi, arg(0) ;src_ptr - mov rdi, arg(2) ;ref_ptr - - mov rdx, 0xf - and rdx, rdi - - jmp .vp9_sad16x8x3_ssse3_skiptable -.vp9_sad16x8x3_ssse3_jumptable: - dd .vp9_sad16x8x3_ssse3_aligned_by_0 - .vp9_sad16x8x3_ssse3_do_jump - dd .vp9_sad16x8x3_ssse3_aligned_by_1 - .vp9_sad16x8x3_ssse3_do_jump - dd .vp9_sad16x8x3_ssse3_aligned_by_2 - .vp9_sad16x8x3_ssse3_do_jump - dd .vp9_sad16x8x3_ssse3_aligned_by_3 - .vp9_sad16x8x3_ssse3_do_jump - dd .vp9_sad16x8x3_ssse3_aligned_by_4 - .vp9_sad16x8x3_ssse3_do_jump - dd .vp9_sad16x8x3_ssse3_aligned_by_5 - .vp9_sad16x8x3_ssse3_do_jump - dd .vp9_sad16x8x3_ssse3_aligned_by_6 - .vp9_sad16x8x3_ssse3_do_jump - dd .vp9_sad16x8x3_ssse3_aligned_by_7 - .vp9_sad16x8x3_ssse3_do_jump - dd .vp9_sad16x8x3_ssse3_aligned_by_8 - .vp9_sad16x8x3_ssse3_do_jump - dd .vp9_sad16x8x3_ssse3_aligned_by_9 - .vp9_sad16x8x3_ssse3_do_jump - dd .vp9_sad16x8x3_ssse3_aligned_by_10 - .vp9_sad16x8x3_ssse3_do_jump - dd .vp9_sad16x8x3_ssse3_aligned_by_11 - .vp9_sad16x8x3_ssse3_do_jump - dd .vp9_sad16x8x3_ssse3_aligned_by_12 - .vp9_sad16x8x3_ssse3_do_jump - dd .vp9_sad16x8x3_ssse3_aligned_by_13 - .vp9_sad16x8x3_ssse3_do_jump - dd .vp9_sad16x8x3_ssse3_aligned_by_14 - .vp9_sad16x8x3_ssse3_do_jump - dd .vp9_sad16x8x3_ssse3_aligned_by_15 - .vp9_sad16x8x3_ssse3_do_jump -.vp9_sad16x8x3_ssse3_skiptable: - - call .vp9_sad16x8x3_ssse3_do_jump -.vp9_sad16x8x3_ssse3_do_jump: - pop rcx ; get the address of do_jump - mov rax, .vp9_sad16x8x3_ssse3_jumptable - .vp9_sad16x8x3_ssse3_do_jump - add rax, rcx ; get the absolute address of vp9_sad16x8x3_ssse3_jumptable - - movsxd rax, dword [rax + 4*rdx] ; get the 32 bit offset from the jumptable - add rcx, rax - - movsxd rax, dword ptr arg(1) ;src_stride - movsxd rdx, dword ptr arg(3) ;ref_stride - - jmp rcx - - PROCESS_16X8X3_OFFSET 0, .vp9_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 1, .vp9_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 2, .vp9_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 3, .vp9_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 4, .vp9_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 5, .vp9_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 6, .vp9_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 7, .vp9_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 8, .vp9_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 9, .vp9_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 10, .vp9_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 11, .vp9_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 12, .vp9_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 13, .vp9_sad16x8x3_ssse3 - PROCESS_16X8X3_OFFSET 14, .vp9_sad16x8x3_ssse3 - -.vp9_sad16x8x3_ssse3_aligned_by_15: - - PROCESS_16X2X3 1 - PROCESS_16X2X3 0 - PROCESS_16X2X3 0 - PROCESS_16X2X3 0 - -.vp9_sad16x8x3_ssse3_store_off: - mov rdi, arg(4) ;Results - - movq xmm0, xmm5 - psrldq xmm5, 8 - - paddw xmm0, xmm5 - movd [rdi], xmm0 -;- - movq xmm0, xmm6 - psrldq xmm6, 8 - - paddw xmm0, xmm6 - movd [rdi+4], xmm0 -;- - movq xmm0, xmm7 - psrldq xmm7, 8 - - paddw xmm0, xmm7 - movd [rdi+8], xmm0 - - ; begin epilog - pop rcx - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_ssim_opt_x86_64.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_ssim_opt_x86_64.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_ssim_opt_x86_64.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_ssim_opt_x86_64.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,216 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - -%include "vpx_ports/x86_abi_support.asm" - -; tabulate_ssim - sums sum_s,sum_r,sum_sq_s,sum_sq_r, sum_sxr -%macro TABULATE_SSIM 0 - paddusw xmm15, xmm3 ; sum_s - paddusw xmm14, xmm4 ; sum_r - movdqa xmm1, xmm3 - pmaddwd xmm1, xmm1 - paddd xmm13, xmm1 ; sum_sq_s - movdqa xmm2, xmm4 - pmaddwd xmm2, xmm2 - paddd xmm12, xmm2 ; sum_sq_r - pmaddwd xmm3, xmm4 - paddd xmm11, xmm3 ; sum_sxr -%endmacro - -; Sum across the register %1 starting with q words -%macro SUM_ACROSS_Q 1 - movdqa xmm2,%1 - punpckldq %1,xmm0 - punpckhdq xmm2,xmm0 - paddq %1,xmm2 - movdqa xmm2,%1 - punpcklqdq %1,xmm0 - punpckhqdq xmm2,xmm0 - paddq %1,xmm2 -%endmacro - -; Sum across the register %1 starting with q words -%macro SUM_ACROSS_W 1 - movdqa xmm1, %1 - punpcklwd %1,xmm0 - punpckhwd xmm1,xmm0 - paddd %1, xmm1 - SUM_ACROSS_Q %1 -%endmacro -;void ssim_parms_sse2( -; unsigned char *s, -; int sp, -; unsigned char *r, -; int rp -; unsigned long *sum_s, -; unsigned long *sum_r, -; unsigned long *sum_sq_s, -; unsigned long *sum_sq_r, -; unsigned long *sum_sxr); -; -; TODO: Use parm passing through structure, probably don't need the pxors -; ( calling app will initialize to 0 ) could easily fit everything in sse2 -; without too much hastle, and can probably do better estimates with psadw -; or pavgb At this point this is just meant to be first pass for calculating -; all the parms needed for 16x16 ssim so we can play with dssim as distortion -; in mode selection code. -global sym(vp9_ssim_parms_16x16_sse2) PRIVATE -sym(vp9_ssim_parms_16x16_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 9 - SAVE_XMM 15 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;s - mov rcx, arg(1) ;sp - mov rdi, arg(2) ;r - mov rax, arg(3) ;rp - - pxor xmm0, xmm0 - pxor xmm15,xmm15 ;sum_s - pxor xmm14,xmm14 ;sum_r - pxor xmm13,xmm13 ;sum_sq_s - pxor xmm12,xmm12 ;sum_sq_r - pxor xmm11,xmm11 ;sum_sxr - - mov rdx, 16 ;row counter -.NextRow: - - ;grab source and reference pixels - movdqu xmm5, [rsi] - movdqu xmm6, [rdi] - movdqa xmm3, xmm5 - movdqa xmm4, xmm6 - punpckhbw xmm3, xmm0 ; high_s - punpckhbw xmm4, xmm0 ; high_r - - TABULATE_SSIM - - movdqa xmm3, xmm5 - movdqa xmm4, xmm6 - punpcklbw xmm3, xmm0 ; low_s - punpcklbw xmm4, xmm0 ; low_r - - TABULATE_SSIM - - add rsi, rcx ; next s row - add rdi, rax ; next r row - - dec rdx ; counter - jnz .NextRow - - SUM_ACROSS_W xmm15 - SUM_ACROSS_W xmm14 - SUM_ACROSS_Q xmm13 - SUM_ACROSS_Q xmm12 - SUM_ACROSS_Q xmm11 - - mov rdi,arg(4) - movd [rdi], xmm15; - mov rdi,arg(5) - movd [rdi], xmm14; - mov rdi,arg(6) - movd [rdi], xmm13; - mov rdi,arg(7) - movd [rdi], xmm12; - mov rdi,arg(8) - movd [rdi], xmm11; - - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -;void ssim_parms_sse2( -; unsigned char *s, -; int sp, -; unsigned char *r, -; int rp -; unsigned long *sum_s, -; unsigned long *sum_r, -; unsigned long *sum_sq_s, -; unsigned long *sum_sq_r, -; unsigned long *sum_sxr); -; -; TODO: Use parm passing through structure, probably don't need the pxors -; ( calling app will initialize to 0 ) could easily fit everything in sse2 -; without too much hastle, and can probably do better estimates with psadw -; or pavgb At this point this is just meant to be first pass for calculating -; all the parms needed for 16x16 ssim so we can play with dssim as distortion -; in mode selection code. -global sym(vp9_ssim_parms_8x8_sse2) PRIVATE -sym(vp9_ssim_parms_8x8_sse2): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 9 - SAVE_XMM 15 - push rsi - push rdi - ; end prolog - - mov rsi, arg(0) ;s - mov rcx, arg(1) ;sp - mov rdi, arg(2) ;r - mov rax, arg(3) ;rp - - pxor xmm0, xmm0 - pxor xmm15,xmm15 ;sum_s - pxor xmm14,xmm14 ;sum_r - pxor xmm13,xmm13 ;sum_sq_s - pxor xmm12,xmm12 ;sum_sq_r - pxor xmm11,xmm11 ;sum_sxr - - mov rdx, 8 ;row counter -.NextRow: - - ;grab source and reference pixels - movq xmm3, [rsi] - movq xmm4, [rdi] - punpcklbw xmm3, xmm0 ; low_s - punpcklbw xmm4, xmm0 ; low_r - - TABULATE_SSIM - - add rsi, rcx ; next s row - add rdi, rax ; next r row - - dec rdx ; counter - jnz .NextRow - - SUM_ACROSS_W xmm15 - SUM_ACROSS_W xmm14 - SUM_ACROSS_Q xmm13 - SUM_ACROSS_Q xmm12 - SUM_ACROSS_Q xmm11 - - mov rdi,arg(4) - movd [rdi], xmm15; - mov rdi,arg(5) - movd [rdi], xmm14; - mov rdi,arg(6) - movd [rdi], xmm13; - mov rdi,arg(7) - movd [rdi], xmm12; - mov rdi,arg(8) - movd [rdi], xmm11; - - ; begin epilog - pop rdi - pop rsi - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_subpel_variance.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_subpel_variance.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_subpel_variance.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_subpel_variance.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,1420 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - -%include "third_party/x86inc/x86inc.asm" - -SECTION_RODATA -pw_8: times 8 dw 8 -bilin_filter_m_sse2: times 8 dw 16 - times 8 dw 0 - times 8 dw 15 - times 8 dw 1 - times 8 dw 14 - times 8 dw 2 - times 8 dw 13 - times 8 dw 3 - times 8 dw 12 - times 8 dw 4 - times 8 dw 11 - times 8 dw 5 - times 8 dw 10 - times 8 dw 6 - times 8 dw 9 - times 8 dw 7 - times 16 dw 8 - times 8 dw 7 - times 8 dw 9 - times 8 dw 6 - times 8 dw 10 - times 8 dw 5 - times 8 dw 11 - times 8 dw 4 - times 8 dw 12 - times 8 dw 3 - times 8 dw 13 - times 8 dw 2 - times 8 dw 14 - times 8 dw 1 - times 8 dw 15 - -bilin_filter_m_ssse3: times 8 db 16, 0 - times 8 db 15, 1 - times 8 db 14, 2 - times 8 db 13, 3 - times 8 db 12, 4 - times 8 db 11, 5 - times 8 db 10, 6 - times 8 db 9, 7 - times 16 db 8 - times 8 db 7, 9 - times 8 db 6, 10 - times 8 db 5, 11 - times 8 db 4, 12 - times 8 db 3, 13 - times 8 db 2, 14 - times 8 db 1, 15 - -SECTION .text - -; int vp9_sub_pixel_varianceNxh(const uint8_t *src, ptrdiff_t src_stride, -; int x_offset, int y_offset, -; const uint8_t *dst, ptrdiff_t dst_stride, -; int height, unsigned int *sse); -; -; This function returns the SE and stores SSE in the given pointer. - -%macro SUM_SSE 6 ; src1, dst1, src2, dst2, sum, sse - psubw %3, %4 - psubw %1, %2 - paddw %5, %3 - pmaddwd %3, %3 - paddw %5, %1 - pmaddwd %1, %1 - paddd %6, %3 - paddd %6, %1 -%endmacro - -%macro STORE_AND_RET 0 -%if mmsize == 16 - ; if H=64 and W=16, we have 8 words of each 2(1bit)x64(6bit)x9bit=16bit - ; in m6, i.e. it _exactly_ fits in a signed word per word in the xmm reg. - ; We have to sign-extend it before adding the words within the register - ; and outputing to a dword. - pcmpgtw m5, m6 ; mask for 0 > x - movhlps m3, m7 - punpcklwd m4, m6, m5 - punpckhwd m6, m5 ; sign-extend m6 word->dword - paddd m7, m3 - paddd m6, m4 - pshufd m3, m7, 0x1 - movhlps m4, m6 - paddd m7, m3 - paddd m6, m4 - mov r1, ssem ; r1 = unsigned int *sse - pshufd m4, m6, 0x1 - movd [r1], m7 ; store sse - paddd m6, m4 - movd raxd, m6 ; store sum as return value -%else ; mmsize == 8 - pshufw m4, m6, 0xe - pshufw m3, m7, 0xe - paddw m6, m4 - paddd m7, m3 - pcmpgtw m5, m6 ; mask for 0 > x - mov r1, ssem ; r1 = unsigned int *sse - punpcklwd m6, m5 ; sign-extend m6 word->dword - movd [r1], m7 ; store sse - pshufw m4, m6, 0xe - paddd m6, m4 - movd raxd, m6 ; store sum as return value -%endif - RET -%endmacro - -%macro INC_SRC_BY_SRC_STRIDE 0 -%if ARCH_X86=1 && CONFIG_PIC=1 - add srcq, src_stridemp -%else - add srcq, src_strideq -%endif -%endmacro - -%macro SUBPEL_VARIANCE 1-2 0 ; W -%if cpuflag(ssse3) -%define bilin_filter_m bilin_filter_m_ssse3 -%define filter_idx_shift 4 -%else -%define bilin_filter_m bilin_filter_m_sse2 -%define filter_idx_shift 5 -%endif -; FIXME(rbultje) only bilinear filters use >8 registers, and ssse3 only uses -; 11, not 13, if the registers are ordered correctly. May make a minor speed -; difference on Win64 - -%ifdef PIC ; 64bit PIC - %if %2 == 1 ; avg - cglobal sub_pixel_avg_variance%1xh, 9, 10, 13, src, src_stride, \ - x_offset, y_offset, \ - dst, dst_stride, \ - sec, sec_stride, height, sse - %define sec_str sec_strideq - %else - cglobal sub_pixel_variance%1xh, 7, 8, 13, src, src_stride, x_offset, \ - y_offset, dst, dst_stride, height, sse - %endif - %define h heightd - %define bilin_filter sseq -%else - %if ARCH_X86=1 && CONFIG_PIC=1 - %if %2 == 1 ; avg - cglobal sub_pixel_avg_variance%1xh, 7, 7, 13, src, src_stride, \ - x_offset, y_offset, \ - dst, dst_stride, \ - sec, sec_stride, \ - height, sse, g_bilin_filter, g_pw_8 - %define h dword heightm - %define sec_str sec_stridemp - - ;Store bilin_filter and pw_8 location in stack - GET_GOT eax - add esp, 4 ; restore esp - - lea ecx, [GLOBAL(bilin_filter_m)] - mov g_bilin_filterm, ecx - - lea ecx, [GLOBAL(pw_8)] - mov g_pw_8m, ecx - - LOAD_IF_USED 0, 1 ; load eax, ecx back - %else - cglobal sub_pixel_variance%1xh, 7, 7, 13, src, src_stride, x_offset, \ - y_offset, dst, dst_stride, height, sse, \ - g_bilin_filter, g_pw_8 - %define h heightd - - ;Store bilin_filter and pw_8 location in stack - GET_GOT eax - add esp, 4 ; restore esp - - lea ecx, [GLOBAL(bilin_filter_m)] - mov g_bilin_filterm, ecx - - lea ecx, [GLOBAL(pw_8)] - mov g_pw_8m, ecx - - LOAD_IF_USED 0, 1 ; load eax, ecx back - %endif - %else - %if %2 == 1 ; avg - cglobal sub_pixel_avg_variance%1xh, 7 + 2 * ARCH_X86_64, \ - 7 + 2 * ARCH_X86_64, 13, src, src_stride, \ - x_offset, y_offset, \ - dst, dst_stride, \ - sec, sec_stride, \ - height, sse - %if ARCH_X86_64 - %define h heightd - %define sec_str sec_strideq - %else - %define h dword heightm - %define sec_str sec_stridemp - %endif - %else - cglobal sub_pixel_variance%1xh, 7, 7, 13, src, src_stride, x_offset, \ - y_offset, dst, dst_stride, height, sse - %define h heightd - %endif - - %define bilin_filter bilin_filter_m - %endif -%endif - - ASSERT %1 <= 16 ; m6 overflows if w > 16 - pxor m6, m6 ; sum - pxor m7, m7 ; sse - ; FIXME(rbultje) if both filters are bilinear, we don't actually use m5; we - ; could perhaps use it for something more productive then - pxor m5, m5 ; dedicated zero register -%if %1 < 16 - sar h, 1 -%if %2 == 1 ; avg - shl sec_str, 1 -%endif -%endif - - ; FIXME(rbultje) replace by jumptable? - test x_offsetd, x_offsetd - jnz .x_nonzero - ; x_offset == 0 - test y_offsetd, y_offsetd - jnz .x_zero_y_nonzero - - ; x_offset == 0 && y_offset == 0 -.x_zero_y_zero_loop: -%if %1 == 16 - movu m0, [srcq] - mova m1, [dstq] -%if %2 == 1 ; avg - pavgb m0, [secq] - punpckhbw m3, m1, m5 - punpcklbw m1, m5 -%endif - punpckhbw m2, m0, m5 - punpcklbw m0, m5 -%if %2 == 0 ; !avg - punpckhbw m3, m1, m5 - punpcklbw m1, m5 -%endif - SUM_SSE m0, m1, m2, m3, m6, m7 - - add srcq, src_strideq - add dstq, dst_strideq -%else ; %1 < 16 - movh m0, [srcq] -%if %2 == 1 ; avg -%if mmsize == 16 - movhps m0, [srcq+src_strideq] -%else ; mmsize == 8 - punpckldq m0, [srcq+src_strideq] -%endif -%else ; !avg - movh m2, [srcq+src_strideq] -%endif - movh m1, [dstq] - movh m3, [dstq+dst_strideq] -%if %2 == 1 ; avg - pavgb m0, [secq] - punpcklbw m3, m5 - punpcklbw m1, m5 - punpckhbw m2, m0, m5 - punpcklbw m0, m5 -%else ; !avg - punpcklbw m0, m5 - punpcklbw m2, m5 - punpcklbw m3, m5 - punpcklbw m1, m5 -%endif - SUM_SSE m0, m1, m2, m3, m6, m7 - - lea srcq, [srcq+src_strideq*2] - lea dstq, [dstq+dst_strideq*2] -%endif -%if %2 == 1 ; avg - add secq, sec_str -%endif - dec h - jg .x_zero_y_zero_loop - STORE_AND_RET - -.x_zero_y_nonzero: - cmp y_offsetd, 8 - jne .x_zero_y_nonhalf - - ; x_offset == 0 && y_offset == 0.5 -.x_zero_y_half_loop: -%if %1 == 16 - movu m0, [srcq] - movu m4, [srcq+src_strideq] - mova m1, [dstq] - pavgb m0, m4 - punpckhbw m3, m1, m5 -%if %2 == 1 ; avg - pavgb m0, [secq] -%endif - punpcklbw m1, m5 - punpckhbw m2, m0, m5 - punpcklbw m0, m5 - SUM_SSE m0, m1, m2, m3, m6, m7 - - add srcq, src_strideq - add dstq, dst_strideq -%else ; %1 < 16 - movh m0, [srcq] - movh m2, [srcq+src_strideq] -%if %2 == 1 ; avg -%if mmsize == 16 - movhps m2, [srcq+src_strideq*2] -%else ; mmsize == 8 -%if %1 == 4 - movh m1, [srcq+src_strideq*2] - punpckldq m2, m1 -%else - punpckldq m2, [srcq+src_strideq*2] -%endif -%endif - movh m1, [dstq] -%if mmsize == 16 - movlhps m0, m2 -%else ; mmsize == 8 - punpckldq m0, m2 -%endif - movh m3, [dstq+dst_strideq] - pavgb m0, m2 - punpcklbw m1, m5 - pavgb m0, [secq] - punpcklbw m3, m5 - punpckhbw m2, m0, m5 - punpcklbw m0, m5 -%else ; !avg - movh m4, [srcq+src_strideq*2] - movh m1, [dstq] - pavgb m0, m2 - movh m3, [dstq+dst_strideq] - pavgb m2, m4 - punpcklbw m0, m5 - punpcklbw m2, m5 - punpcklbw m3, m5 - punpcklbw m1, m5 -%endif - SUM_SSE m0, m1, m2, m3, m6, m7 - - lea srcq, [srcq+src_strideq*2] - lea dstq, [dstq+dst_strideq*2] -%endif -%if %2 == 1 ; avg - add secq, sec_str -%endif - dec h - jg .x_zero_y_half_loop - STORE_AND_RET - -.x_zero_y_nonhalf: - ; x_offset == 0 && y_offset == bilin interpolation -%ifdef PIC - lea bilin_filter, [bilin_filter_m] -%endif - shl y_offsetd, filter_idx_shift -%if ARCH_X86_64 && mmsize == 16 - mova m8, [bilin_filter+y_offsetq] -%if notcpuflag(ssse3) ; FIXME(rbultje) don't scatter registers on x86-64 - mova m9, [bilin_filter+y_offsetq+16] -%endif - mova m10, [pw_8] -%define filter_y_a m8 -%define filter_y_b m9 -%define filter_rnd m10 -%else ; x86-32 or mmx -%if ARCH_X86=1 && CONFIG_PIC=1 -; x_offset == 0, reuse x_offset reg -%define tempq x_offsetq - add y_offsetq, g_bilin_filterm -%define filter_y_a [y_offsetq] -%define filter_y_b [y_offsetq+16] - mov tempq, g_pw_8m -%define filter_rnd [tempq] -%else - add y_offsetq, bilin_filter -%define filter_y_a [y_offsetq] -%define filter_y_b [y_offsetq+16] -%define filter_rnd [pw_8] -%endif -%endif - -.x_zero_y_other_loop: -%if %1 == 16 - movu m0, [srcq] - movu m4, [srcq+src_strideq] - mova m1, [dstq] -%if cpuflag(ssse3) - punpckhbw m2, m0, m4 - punpcklbw m0, m4 - pmaddubsw m2, filter_y_a - pmaddubsw m0, filter_y_a - paddw m2, filter_rnd - paddw m0, filter_rnd -%else - punpckhbw m2, m0, m5 - punpckhbw m3, m4, m5 - punpcklbw m0, m5 - punpcklbw m4, m5 - ; FIXME(rbultje) instead of out=((num-x)*in1+x*in2+rnd)>>log2(num), we can - ; also do out=in1+(((num-x)*(in2-in1)+rnd)>>log2(num)). Total number of - ; instructions is the same (5), but it is 1 mul instead of 2, so might be - ; slightly faster because of pmullw latency. It would also cut our rodata - ; tables in half for this function, and save 1-2 registers on x86-64. - pmullw m2, filter_y_a - pmullw m3, filter_y_b - paddw m2, filter_rnd - pmullw m0, filter_y_a - pmullw m4, filter_y_b - paddw m0, filter_rnd - paddw m2, m3 - paddw m0, m4 -%endif - psraw m2, 4 - psraw m0, 4 -%if %2 == 1 ; avg - ; FIXME(rbultje) pipeline - packuswb m0, m2 - pavgb m0, [secq] - punpckhbw m2, m0, m5 - punpcklbw m0, m5 -%endif - punpckhbw m3, m1, m5 - punpcklbw m1, m5 - SUM_SSE m0, m1, m2, m3, m6, m7 - - add srcq, src_strideq - add dstq, dst_strideq -%else ; %1 < 16 - movh m0, [srcq] - movh m2, [srcq+src_strideq] - movh m4, [srcq+src_strideq*2] - movh m3, [dstq+dst_strideq] -%if cpuflag(ssse3) - movh m1, [dstq] - punpcklbw m0, m2 - punpcklbw m2, m4 - pmaddubsw m0, filter_y_a - pmaddubsw m2, filter_y_a - punpcklbw m3, m5 - paddw m2, filter_rnd - paddw m0, filter_rnd -%else - punpcklbw m0, m5 - punpcklbw m2, m5 - punpcklbw m4, m5 - pmullw m0, filter_y_a - pmullw m1, m2, filter_y_b - punpcklbw m3, m5 - paddw m0, filter_rnd - pmullw m2, filter_y_a - pmullw m4, filter_y_b - paddw m0, m1 - paddw m2, filter_rnd - movh m1, [dstq] - paddw m2, m4 -%endif - psraw m0, 4 - psraw m2, 4 -%if %2 == 1 ; avg - ; FIXME(rbultje) pipeline - packuswb m0, m2 - pavgb m0, [secq] - punpckhbw m2, m0, m5 - punpcklbw m0, m5 -%endif - punpcklbw m1, m5 - SUM_SSE m0, m1, m2, m3, m6, m7 - - lea srcq, [srcq+src_strideq*2] - lea dstq, [dstq+dst_strideq*2] -%endif -%if %2 == 1 ; avg - add secq, sec_str -%endif - dec h - jg .x_zero_y_other_loop -%undef filter_y_a -%undef filter_y_b -%undef filter_rnd - STORE_AND_RET - -.x_nonzero: - cmp x_offsetd, 8 - jne .x_nonhalf - ; x_offset == 0.5 - test y_offsetd, y_offsetd - jnz .x_half_y_nonzero - - ; x_offset == 0.5 && y_offset == 0 -.x_half_y_zero_loop: -%if %1 == 16 - movu m0, [srcq] - movu m4, [srcq+1] - mova m1, [dstq] - pavgb m0, m4 - punpckhbw m3, m1, m5 -%if %2 == 1 ; avg - pavgb m0, [secq] -%endif - punpcklbw m1, m5 - punpckhbw m2, m0, m5 - punpcklbw m0, m5 - SUM_SSE m0, m1, m2, m3, m6, m7 - - add srcq, src_strideq - add dstq, dst_strideq -%else ; %1 < 16 - movh m0, [srcq] - movh m4, [srcq+1] -%if %2 == 1 ; avg -%if mmsize == 16 - movhps m0, [srcq+src_strideq] - movhps m4, [srcq+src_strideq+1] -%else ; mmsize == 8 - punpckldq m0, [srcq+src_strideq] - punpckldq m4, [srcq+src_strideq+1] -%endif - movh m1, [dstq] - movh m3, [dstq+dst_strideq] - pavgb m0, m4 - punpcklbw m3, m5 - pavgb m0, [secq] - punpcklbw m1, m5 - punpckhbw m2, m0, m5 - punpcklbw m0, m5 -%else ; !avg - movh m2, [srcq+src_strideq] - movh m1, [dstq] - pavgb m0, m4 - movh m4, [srcq+src_strideq+1] - movh m3, [dstq+dst_strideq] - pavgb m2, m4 - punpcklbw m0, m5 - punpcklbw m2, m5 - punpcklbw m3, m5 - punpcklbw m1, m5 -%endif - SUM_SSE m0, m1, m2, m3, m6, m7 - - lea srcq, [srcq+src_strideq*2] - lea dstq, [dstq+dst_strideq*2] -%endif -%if %2 == 1 ; avg - add secq, sec_str -%endif - dec h - jg .x_half_y_zero_loop - STORE_AND_RET - -.x_half_y_nonzero: - cmp y_offsetd, 8 - jne .x_half_y_nonhalf - - ; x_offset == 0.5 && y_offset == 0.5 -%if %1 == 16 - movu m0, [srcq] - movu m3, [srcq+1] - add srcq, src_strideq - pavgb m0, m3 -.x_half_y_half_loop: - movu m4, [srcq] - movu m3, [srcq+1] - mova m1, [dstq] - pavgb m4, m3 - punpckhbw m3, m1, m5 - pavgb m0, m4 -%if %2 == 1 ; avg - punpcklbw m1, m5 - pavgb m0, [secq] - punpckhbw m2, m0, m5 - punpcklbw m0, m5 -%else - punpckhbw m2, m0, m5 - punpcklbw m0, m5 - punpcklbw m1, m5 -%endif - SUM_SSE m0, m1, m2, m3, m6, m7 - mova m0, m4 - - add srcq, src_strideq - add dstq, dst_strideq -%else ; %1 < 16 - movh m0, [srcq] - movh m3, [srcq+1] - add srcq, src_strideq - pavgb m0, m3 -.x_half_y_half_loop: - movh m2, [srcq] - movh m3, [srcq+1] -%if %2 == 1 ; avg -%if mmsize == 16 - movhps m2, [srcq+src_strideq] - movhps m3, [srcq+src_strideq+1] -%else -%if %1 == 4 - movh m1, [srcq+src_strideq] - punpckldq m2, m1 - movh m1, [srcq+src_strideq+1] - punpckldq m3, m1 -%else - punpckldq m2, [srcq+src_strideq] - punpckldq m3, [srcq+src_strideq+1] -%endif -%endif - pavgb m2, m3 -%if mmsize == 16 - movlhps m0, m2 - movhlps m4, m2 -%else ; mmsize == 8 - punpckldq m0, m2 - pshufw m4, m2, 0xe -%endif - movh m1, [dstq] - pavgb m0, m2 - movh m3, [dstq+dst_strideq] - pavgb m0, [secq] - punpcklbw m3, m5 - punpcklbw m1, m5 - punpckhbw m2, m0, m5 - punpcklbw m0, m5 -%else ; !avg - movh m4, [srcq+src_strideq] - movh m1, [srcq+src_strideq+1] - pavgb m2, m3 - pavgb m4, m1 - pavgb m0, m2 - pavgb m2, m4 - movh m1, [dstq] - movh m3, [dstq+dst_strideq] - punpcklbw m0, m5 - punpcklbw m2, m5 - punpcklbw m3, m5 - punpcklbw m1, m5 -%endif - SUM_SSE m0, m1, m2, m3, m6, m7 - mova m0, m4 - - lea srcq, [srcq+src_strideq*2] - lea dstq, [dstq+dst_strideq*2] -%endif -%if %2 == 1 ; avg - add secq, sec_str -%endif - dec h - jg .x_half_y_half_loop - STORE_AND_RET - -.x_half_y_nonhalf: - ; x_offset == 0.5 && y_offset == bilin interpolation -%ifdef PIC - lea bilin_filter, [bilin_filter_m] -%endif - shl y_offsetd, filter_idx_shift -%if ARCH_X86_64 && mmsize == 16 - mova m8, [bilin_filter+y_offsetq] -%if notcpuflag(ssse3) ; FIXME(rbultje) don't scatter registers on x86-64 - mova m9, [bilin_filter+y_offsetq+16] -%endif - mova m10, [pw_8] -%define filter_y_a m8 -%define filter_y_b m9 -%define filter_rnd m10 -%else ;x86_32 -%if ARCH_X86=1 && CONFIG_PIC=1 -; x_offset == 0.5. We can reuse x_offset reg -%define tempq x_offsetq - add y_offsetq, g_bilin_filterm -%define filter_y_a [y_offsetq] -%define filter_y_b [y_offsetq+16] - mov tempq, g_pw_8m -%define filter_rnd [tempq] -%else - add y_offsetq, bilin_filter -%define filter_y_a [y_offsetq] -%define filter_y_b [y_offsetq+16] -%define filter_rnd [pw_8] -%endif -%endif - -%if %1 == 16 - movu m0, [srcq] - movu m3, [srcq+1] - add srcq, src_strideq - pavgb m0, m3 -.x_half_y_other_loop: - movu m4, [srcq] - movu m2, [srcq+1] - mova m1, [dstq] - pavgb m4, m2 -%if cpuflag(ssse3) - punpckhbw m2, m0, m4 - punpcklbw m0, m4 - pmaddubsw m2, filter_y_a - pmaddubsw m0, filter_y_a - paddw m2, filter_rnd - paddw m0, filter_rnd - psraw m2, 4 -%else - punpckhbw m2, m0, m5 - punpckhbw m3, m4, m5 - pmullw m2, filter_y_a - pmullw m3, filter_y_b - paddw m2, filter_rnd - punpcklbw m0, m5 - paddw m2, m3 - punpcklbw m3, m4, m5 - pmullw m0, filter_y_a - pmullw m3, filter_y_b - paddw m0, filter_rnd - psraw m2, 4 - paddw m0, m3 -%endif - punpckhbw m3, m1, m5 - psraw m0, 4 -%if %2 == 1 ; avg - ; FIXME(rbultje) pipeline - packuswb m0, m2 - pavgb m0, [secq] - punpckhbw m2, m0, m5 - punpcklbw m0, m5 -%endif - punpcklbw m1, m5 - SUM_SSE m0, m1, m2, m3, m6, m7 - mova m0, m4 - - add srcq, src_strideq - add dstq, dst_strideq -%else ; %1 < 16 - movh m0, [srcq] - movh m3, [srcq+1] - add srcq, src_strideq - pavgb m0, m3 -%if notcpuflag(ssse3) - punpcklbw m0, m5 -%endif -.x_half_y_other_loop: - movh m2, [srcq] - movh m1, [srcq+1] - movh m4, [srcq+src_strideq] - movh m3, [srcq+src_strideq+1] - pavgb m2, m1 - pavgb m4, m3 - movh m3, [dstq+dst_strideq] -%if cpuflag(ssse3) - movh m1, [dstq] - punpcklbw m0, m2 - punpcklbw m2, m4 - pmaddubsw m0, filter_y_a - pmaddubsw m2, filter_y_a - punpcklbw m3, m5 - paddw m0, filter_rnd - paddw m2, filter_rnd -%else - punpcklbw m2, m5 - punpcklbw m4, m5 - pmullw m0, filter_y_a - pmullw m1, m2, filter_y_b - punpcklbw m3, m5 - paddw m0, filter_rnd - pmullw m2, filter_y_a - paddw m0, m1 - pmullw m1, m4, filter_y_b - paddw m2, filter_rnd - paddw m2, m1 - movh m1, [dstq] -%endif - psraw m0, 4 - psraw m2, 4 -%if %2 == 1 ; avg - ; FIXME(rbultje) pipeline - packuswb m0, m2 - pavgb m0, [secq] - punpckhbw m2, m0, m5 - punpcklbw m0, m5 -%endif - punpcklbw m1, m5 - SUM_SSE m0, m1, m2, m3, m6, m7 - mova m0, m4 - - lea srcq, [srcq+src_strideq*2] - lea dstq, [dstq+dst_strideq*2] -%endif -%if %2 == 1 ; avg - add secq, sec_str -%endif - dec h - jg .x_half_y_other_loop -%undef filter_y_a -%undef filter_y_b -%undef filter_rnd - STORE_AND_RET - -.x_nonhalf: - test y_offsetd, y_offsetd - jnz .x_nonhalf_y_nonzero - - ; x_offset == bilin interpolation && y_offset == 0 -%ifdef PIC - lea bilin_filter, [bilin_filter_m] -%endif - shl x_offsetd, filter_idx_shift -%if ARCH_X86_64 && mmsize == 16 - mova m8, [bilin_filter+x_offsetq] -%if notcpuflag(ssse3) ; FIXME(rbultje) don't scatter registers on x86-64 - mova m9, [bilin_filter+x_offsetq+16] -%endif - mova m10, [pw_8] -%define filter_x_a m8 -%define filter_x_b m9 -%define filter_rnd m10 -%else ; x86-32 -%if ARCH_X86=1 && CONFIG_PIC=1 -;y_offset == 0. We can reuse y_offset reg. -%define tempq y_offsetq - add x_offsetq, g_bilin_filterm -%define filter_x_a [x_offsetq] -%define filter_x_b [x_offsetq+16] - mov tempq, g_pw_8m -%define filter_rnd [tempq] -%else - add x_offsetq, bilin_filter -%define filter_x_a [x_offsetq] -%define filter_x_b [x_offsetq+16] -%define filter_rnd [pw_8] -%endif -%endif - -.x_other_y_zero_loop: -%if %1 == 16 - movu m0, [srcq] - movu m4, [srcq+1] - mova m1, [dstq] -%if cpuflag(ssse3) - punpckhbw m2, m0, m4 - punpcklbw m0, m4 - pmaddubsw m2, filter_x_a - pmaddubsw m0, filter_x_a - paddw m2, filter_rnd - paddw m0, filter_rnd -%else - punpckhbw m2, m0, m5 - punpckhbw m3, m4, m5 - punpcklbw m0, m5 - punpcklbw m4, m5 - pmullw m2, filter_x_a - pmullw m3, filter_x_b - paddw m2, filter_rnd - pmullw m0, filter_x_a - pmullw m4, filter_x_b - paddw m0, filter_rnd - paddw m2, m3 - paddw m0, m4 -%endif - psraw m2, 4 - psraw m0, 4 -%if %2 == 1 ; avg - ; FIXME(rbultje) pipeline - packuswb m0, m2 - pavgb m0, [secq] - punpckhbw m2, m0, m5 - punpcklbw m0, m5 -%endif - punpckhbw m3, m1, m5 - punpcklbw m1, m5 - SUM_SSE m0, m1, m2, m3, m6, m7 - - add srcq, src_strideq - add dstq, dst_strideq -%else ; %1 < 16 - movh m0, [srcq] - movh m1, [srcq+1] - movh m2, [srcq+src_strideq] - movh m4, [srcq+src_strideq+1] - movh m3, [dstq+dst_strideq] -%if cpuflag(ssse3) - punpcklbw m0, m1 - movh m1, [dstq] - punpcklbw m2, m4 - pmaddubsw m0, filter_x_a - pmaddubsw m2, filter_x_a - punpcklbw m3, m5 - paddw m0, filter_rnd - paddw m2, filter_rnd -%else - punpcklbw m0, m5 - punpcklbw m1, m5 - punpcklbw m2, m5 - punpcklbw m4, m5 - pmullw m0, filter_x_a - pmullw m1, filter_x_b - punpcklbw m3, m5 - paddw m0, filter_rnd - pmullw m2, filter_x_a - pmullw m4, filter_x_b - paddw m0, m1 - paddw m2, filter_rnd - movh m1, [dstq] - paddw m2, m4 -%endif - psraw m0, 4 - psraw m2, 4 -%if %2 == 1 ; avg - ; FIXME(rbultje) pipeline - packuswb m0, m2 - pavgb m0, [secq] - punpckhbw m2, m0, m5 - punpcklbw m0, m5 -%endif - punpcklbw m1, m5 - SUM_SSE m0, m1, m2, m3, m6, m7 - - lea srcq, [srcq+src_strideq*2] - lea dstq, [dstq+dst_strideq*2] -%endif -%if %2 == 1 ; avg - add secq, sec_str -%endif - dec h - jg .x_other_y_zero_loop -%undef filter_x_a -%undef filter_x_b -%undef filter_rnd - STORE_AND_RET - -.x_nonhalf_y_nonzero: - cmp y_offsetd, 8 - jne .x_nonhalf_y_nonhalf - - ; x_offset == bilin interpolation && y_offset == 0.5 -%ifdef PIC - lea bilin_filter, [bilin_filter_m] -%endif - shl x_offsetd, filter_idx_shift -%if ARCH_X86_64 && mmsize == 16 - mova m8, [bilin_filter+x_offsetq] -%if notcpuflag(ssse3) ; FIXME(rbultje) don't scatter registers on x86-64 - mova m9, [bilin_filter+x_offsetq+16] -%endif - mova m10, [pw_8] -%define filter_x_a m8 -%define filter_x_b m9 -%define filter_rnd m10 -%else ; x86-32 -%if ARCH_X86=1 && CONFIG_PIC=1 -; y_offset == 0.5. We can reuse y_offset reg. -%define tempq y_offsetq - add x_offsetq, g_bilin_filterm -%define filter_x_a [x_offsetq] -%define filter_x_b [x_offsetq+16] - mov tempq, g_pw_8m -%define filter_rnd [tempq] -%else - add x_offsetq, bilin_filter -%define filter_x_a [x_offsetq] -%define filter_x_b [x_offsetq+16] -%define filter_rnd [pw_8] -%endif -%endif - -%if %1 == 16 - movu m0, [srcq] - movu m1, [srcq+1] -%if cpuflag(ssse3) - punpckhbw m2, m0, m1 - punpcklbw m0, m1 - pmaddubsw m2, filter_x_a - pmaddubsw m0, filter_x_a - paddw m2, filter_rnd - paddw m0, filter_rnd -%else - punpckhbw m2, m0, m5 - punpckhbw m3, m1, m5 - punpcklbw m0, m5 - punpcklbw m1, m5 - pmullw m0, filter_x_a - pmullw m1, filter_x_b - paddw m0, filter_rnd - pmullw m2, filter_x_a - pmullw m3, filter_x_b - paddw m2, filter_rnd - paddw m0, m1 - paddw m2, m3 -%endif - psraw m0, 4 - psraw m2, 4 - add srcq, src_strideq - packuswb m0, m2 -.x_other_y_half_loop: - movu m4, [srcq] - movu m3, [srcq+1] -%if cpuflag(ssse3) - mova m1, [dstq] - punpckhbw m2, m4, m3 - punpcklbw m4, m3 - pmaddubsw m2, filter_x_a - pmaddubsw m4, filter_x_a - paddw m2, filter_rnd - paddw m4, filter_rnd - psraw m2, 4 - psraw m4, 4 - packuswb m4, m2 - pavgb m0, m4 - punpckhbw m3, m1, m5 - punpcklbw m1, m5 -%else - punpckhbw m2, m4, m5 - punpckhbw m1, m3, m5 - punpcklbw m4, m5 - punpcklbw m3, m5 - pmullw m4, filter_x_a - pmullw m3, filter_x_b - paddw m4, filter_rnd - pmullw m2, filter_x_a - pmullw m1, filter_x_b - paddw m2, filter_rnd - paddw m4, m3 - paddw m2, m1 - mova m1, [dstq] - psraw m4, 4 - psraw m2, 4 - punpckhbw m3, m1, m5 - ; FIXME(rbultje) the repeated pack/unpack here around m0/m2 is because we - ; have a 1-register shortage to be able to store the backup of the bilin - ; filtered second line as words as cache for the next line. Packing into - ; a byte costs 1 pack and 2 unpacks, but saves a register. - packuswb m4, m2 - punpcklbw m1, m5 - pavgb m0, m4 -%endif -%if %2 == 1 ; avg - ; FIXME(rbultje) pipeline - pavgb m0, [secq] -%endif - punpckhbw m2, m0, m5 - punpcklbw m0, m5 - SUM_SSE m0, m1, m2, m3, m6, m7 - mova m0, m4 - - add srcq, src_strideq - add dstq, dst_strideq -%else ; %1 < 16 - movh m0, [srcq] - movh m1, [srcq+1] -%if cpuflag(ssse3) - punpcklbw m0, m1 - pmaddubsw m0, filter_x_a - paddw m0, filter_rnd -%else - punpcklbw m0, m5 - punpcklbw m1, m5 - pmullw m0, filter_x_a - pmullw m1, filter_x_b - paddw m0, filter_rnd - paddw m0, m1 -%endif - add srcq, src_strideq - psraw m0, 4 -.x_other_y_half_loop: - movh m2, [srcq] - movh m1, [srcq+1] - movh m4, [srcq+src_strideq] - movh m3, [srcq+src_strideq+1] -%if cpuflag(ssse3) - punpcklbw m2, m1 - punpcklbw m4, m3 - pmaddubsw m2, filter_x_a - pmaddubsw m4, filter_x_a - movh m1, [dstq] - movh m3, [dstq+dst_strideq] - paddw m2, filter_rnd - paddw m4, filter_rnd -%else - punpcklbw m2, m5 - punpcklbw m1, m5 - punpcklbw m4, m5 - punpcklbw m3, m5 - pmullw m2, filter_x_a - pmullw m1, filter_x_b - paddw m2, filter_rnd - pmullw m4, filter_x_a - pmullw m3, filter_x_b - paddw m4, filter_rnd - paddw m2, m1 - movh m1, [dstq] - paddw m4, m3 - movh m3, [dstq+dst_strideq] -%endif - psraw m2, 4 - psraw m4, 4 - pavgw m0, m2 - pavgw m2, m4 -%if %2 == 1 ; avg - ; FIXME(rbultje) pipeline - also consider going to bytes here - packuswb m0, m2 - pavgb m0, [secq] - punpckhbw m2, m0, m5 - punpcklbw m0, m5 -%endif - punpcklbw m3, m5 - punpcklbw m1, m5 - SUM_SSE m0, m1, m2, m3, m6, m7 - mova m0, m4 - - lea srcq, [srcq+src_strideq*2] - lea dstq, [dstq+dst_strideq*2] -%endif -%if %2 == 1 ; avg - add secq, sec_str -%endif - dec h - jg .x_other_y_half_loop -%undef filter_x_a -%undef filter_x_b -%undef filter_rnd - STORE_AND_RET - -.x_nonhalf_y_nonhalf: -%ifdef PIC - lea bilin_filter, [bilin_filter_m] -%endif - shl x_offsetd, filter_idx_shift - shl y_offsetd, filter_idx_shift -%if ARCH_X86_64 && mmsize == 16 - mova m8, [bilin_filter+x_offsetq] -%if notcpuflag(ssse3) ; FIXME(rbultje) don't scatter registers on x86-64 - mova m9, [bilin_filter+x_offsetq+16] -%endif - mova m10, [bilin_filter+y_offsetq] -%if notcpuflag(ssse3) ; FIXME(rbultje) don't scatter registers on x86-64 - mova m11, [bilin_filter+y_offsetq+16] -%endif - mova m12, [pw_8] -%define filter_x_a m8 -%define filter_x_b m9 -%define filter_y_a m10 -%define filter_y_b m11 -%define filter_rnd m12 -%else ; x86-32 -%if ARCH_X86=1 && CONFIG_PIC=1 -; In this case, there is NO unused register. Used src_stride register. Later, -; src_stride has to be loaded from stack when it is needed. -%define tempq src_strideq - mov tempq, g_bilin_filterm - add x_offsetq, tempq - add y_offsetq, tempq -%define filter_x_a [x_offsetq] -%define filter_x_b [x_offsetq+16] -%define filter_y_a [y_offsetq] -%define filter_y_b [y_offsetq+16] - - mov tempq, g_pw_8m -%define filter_rnd [tempq] -%else - add x_offsetq, bilin_filter - add y_offsetq, bilin_filter -%define filter_x_a [x_offsetq] -%define filter_x_b [x_offsetq+16] -%define filter_y_a [y_offsetq] -%define filter_y_b [y_offsetq+16] -%define filter_rnd [pw_8] -%endif -%endif - - ; x_offset == bilin interpolation && y_offset == bilin interpolation -%if %1 == 16 - movu m0, [srcq] - movu m1, [srcq+1] -%if cpuflag(ssse3) - punpckhbw m2, m0, m1 - punpcklbw m0, m1 - pmaddubsw m2, filter_x_a - pmaddubsw m0, filter_x_a - paddw m2, filter_rnd - paddw m0, filter_rnd -%else - punpckhbw m2, m0, m5 - punpckhbw m3, m1, m5 - punpcklbw m0, m5 - punpcklbw m1, m5 - pmullw m0, filter_x_a - pmullw m1, filter_x_b - paddw m0, filter_rnd - pmullw m2, filter_x_a - pmullw m3, filter_x_b - paddw m2, filter_rnd - paddw m0, m1 - paddw m2, m3 -%endif - psraw m0, 4 - psraw m2, 4 - - INC_SRC_BY_SRC_STRIDE - - packuswb m0, m2 -.x_other_y_other_loop: -%if cpuflag(ssse3) - movu m4, [srcq] - movu m3, [srcq+1] - mova m1, [dstq] - punpckhbw m2, m4, m3 - punpcklbw m4, m3 - pmaddubsw m2, filter_x_a - pmaddubsw m4, filter_x_a - punpckhbw m3, m1, m5 - paddw m2, filter_rnd - paddw m4, filter_rnd - psraw m2, 4 - psraw m4, 4 - packuswb m4, m2 - punpckhbw m2, m0, m4 - punpcklbw m0, m4 - pmaddubsw m2, filter_y_a - pmaddubsw m0, filter_y_a - punpcklbw m1, m5 - paddw m2, filter_rnd - paddw m0, filter_rnd - psraw m2, 4 - psraw m0, 4 -%else - movu m3, [srcq] - movu m4, [srcq+1] - punpckhbw m1, m3, m5 - punpckhbw m2, m4, m5 - punpcklbw m3, m5 - punpcklbw m4, m5 - pmullw m3, filter_x_a - pmullw m4, filter_x_b - paddw m3, filter_rnd - pmullw m1, filter_x_a - pmullw m2, filter_x_b - paddw m1, filter_rnd - paddw m3, m4 - paddw m1, m2 - psraw m3, 4 - psraw m1, 4 - packuswb m4, m3, m1 - punpckhbw m2, m0, m5 - punpcklbw m0, m5 - pmullw m2, filter_y_a - pmullw m1, filter_y_b - paddw m2, filter_rnd - pmullw m0, filter_y_a - pmullw m3, filter_y_b - paddw m2, m1 - mova m1, [dstq] - paddw m0, filter_rnd - psraw m2, 4 - paddw m0, m3 - punpckhbw m3, m1, m5 - psraw m0, 4 - punpcklbw m1, m5 -%endif -%if %2 == 1 ; avg - ; FIXME(rbultje) pipeline - packuswb m0, m2 - pavgb m0, [secq] - punpckhbw m2, m0, m5 - punpcklbw m0, m5 -%endif - SUM_SSE m0, m1, m2, m3, m6, m7 - mova m0, m4 - - INC_SRC_BY_SRC_STRIDE - add dstq, dst_strideq -%else ; %1 < 16 - movh m0, [srcq] - movh m1, [srcq+1] -%if cpuflag(ssse3) - punpcklbw m0, m1 - pmaddubsw m0, filter_x_a - paddw m0, filter_rnd -%else - punpcklbw m0, m5 - punpcklbw m1, m5 - pmullw m0, filter_x_a - pmullw m1, filter_x_b - paddw m0, filter_rnd - paddw m0, m1 -%endif - psraw m0, 4 -%if cpuflag(ssse3) - packuswb m0, m0 -%endif - - INC_SRC_BY_SRC_STRIDE - -.x_other_y_other_loop: - movh m2, [srcq] - movh m1, [srcq+1] - - INC_SRC_BY_SRC_STRIDE - movh m4, [srcq] - movh m3, [srcq+1] - -%if cpuflag(ssse3) - punpcklbw m2, m1 - punpcklbw m4, m3 - pmaddubsw m2, filter_x_a - pmaddubsw m4, filter_x_a - movh m3, [dstq+dst_strideq] - movh m1, [dstq] - paddw m2, filter_rnd - paddw m4, filter_rnd - psraw m2, 4 - psraw m4, 4 - packuswb m2, m2 - packuswb m4, m4 - punpcklbw m0, m2 - punpcklbw m2, m4 - pmaddubsw m0, filter_y_a - pmaddubsw m2, filter_y_a - punpcklbw m3, m5 - paddw m0, filter_rnd - paddw m2, filter_rnd - psraw m0, 4 - psraw m2, 4 - punpcklbw m1, m5 -%else - punpcklbw m2, m5 - punpcklbw m1, m5 - punpcklbw m4, m5 - punpcklbw m3, m5 - pmullw m2, filter_x_a - pmullw m1, filter_x_b - paddw m2, filter_rnd - pmullw m4, filter_x_a - pmullw m3, filter_x_b - paddw m4, filter_rnd - paddw m2, m1 - paddw m4, m3 - psraw m2, 4 - psraw m4, 4 - pmullw m0, filter_y_a - pmullw m3, m2, filter_y_b - paddw m0, filter_rnd - pmullw m2, filter_y_a - pmullw m1, m4, filter_y_b - paddw m2, filter_rnd - paddw m0, m3 - movh m3, [dstq+dst_strideq] - paddw m2, m1 - movh m1, [dstq] - psraw m0, 4 - psraw m2, 4 - punpcklbw m3, m5 - punpcklbw m1, m5 -%endif -%if %2 == 1 ; avg - ; FIXME(rbultje) pipeline - packuswb m0, m2 - pavgb m0, [secq] - punpckhbw m2, m0, m5 - punpcklbw m0, m5 -%endif - SUM_SSE m0, m1, m2, m3, m6, m7 - mova m0, m4 - - INC_SRC_BY_SRC_STRIDE - lea dstq, [dstq+dst_strideq*2] -%endif -%if %2 == 1 ; avg - add secq, sec_str -%endif - dec h - jg .x_other_y_other_loop -%undef filter_x_a -%undef filter_x_b -%undef filter_y_a -%undef filter_y_b -%undef filter_rnd - STORE_AND_RET -%endmacro - -; FIXME(rbultje) the non-bilinear versions (i.e. x=0,8&&y=0,8) are identical -; between the ssse3 and non-ssse3 version. It may make sense to merge their -; code in the sense that the ssse3 version would jump to the appropriate -; location in the sse/2 version, rather than duplicating that code in the -; binary. - -INIT_MMX sse -SUBPEL_VARIANCE 4 -INIT_XMM sse2 -SUBPEL_VARIANCE 8 -SUBPEL_VARIANCE 16 - -INIT_MMX ssse3 -SUBPEL_VARIANCE 4 -INIT_XMM ssse3 -SUBPEL_VARIANCE 8 -SUBPEL_VARIANCE 16 - -INIT_MMX sse -SUBPEL_VARIANCE 4, 1 -INIT_XMM sse2 -SUBPEL_VARIANCE 8, 1 -SUBPEL_VARIANCE 16, 1 - -INIT_MMX ssse3 -SUBPEL_VARIANCE 4, 1 -INIT_XMM ssse3 -SUBPEL_VARIANCE 8, 1 -SUBPEL_VARIANCE 16, 1 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_subpel_variance_impl_intrin_avx2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_subpel_variance_impl_intrin_avx2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_subpel_variance_impl_intrin_avx2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_subpel_variance_impl_intrin_avx2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,539 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include // AVX2 -#include "vpx_ports/mem.h" -#include "vp9/encoder/vp9_variance.h" - -DECLARE_ALIGNED(32, static const uint8_t, bilinear_filters_avx2[512]) = { - 16, 0, 16, 0, 16, 0, 16, 0, 16, 0, 16, 0, 16, 0, 16, 0, - 16, 0, 16, 0, 16, 0, 16, 0, 16, 0, 16, 0, 16, 0, 16, 0, - 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, - 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, - 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, - 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, - 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, - 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, - 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, - 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, - 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, - 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, - 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, - 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, - 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, - 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, - 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, - 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, - 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, - 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, - 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, - 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, - 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, - 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, - 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, - 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, - 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, - 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, - 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15 -}; - -#define FILTER_SRC(filter) \ - /* filter the source */ \ - exp_src_lo = _mm256_maddubs_epi16(exp_src_lo, filter); \ - exp_src_hi = _mm256_maddubs_epi16(exp_src_hi, filter); \ - \ - /* add 8 to source */ \ - exp_src_lo = _mm256_add_epi16(exp_src_lo, pw8); \ - exp_src_hi = _mm256_add_epi16(exp_src_hi, pw8); \ - \ - /* divide source by 16 */ \ - exp_src_lo = _mm256_srai_epi16(exp_src_lo, 4); \ - exp_src_hi = _mm256_srai_epi16(exp_src_hi, 4); - -#define MERGE_WITH_SRC(src_reg, reg) \ - exp_src_lo = _mm256_unpacklo_epi8(src_reg, reg); \ - exp_src_hi = _mm256_unpackhi_epi8(src_reg, reg); - -#define LOAD_SRC_DST \ - /* load source and destination */ \ - src_reg = _mm256_loadu_si256((__m256i const *) (src)); \ - dst_reg = _mm256_loadu_si256((__m256i const *) (dst)); - -#define AVG_NEXT_SRC(src_reg, size_stride) \ - src_next_reg = _mm256_loadu_si256((__m256i const *) \ - (src + size_stride)); \ - /* average between current and next stride source */ \ - src_reg = _mm256_avg_epu8(src_reg, src_next_reg); - -#define MERGE_NEXT_SRC(src_reg, size_stride) \ - src_next_reg = _mm256_loadu_si256((__m256i const *) \ - (src + size_stride)); \ - MERGE_WITH_SRC(src_reg, src_next_reg) - -#define CALC_SUM_SSE_INSIDE_LOOP \ - /* expand each byte to 2 bytes */ \ - exp_dst_lo = _mm256_unpacklo_epi8(dst_reg, zero_reg); \ - exp_dst_hi = _mm256_unpackhi_epi8(dst_reg, zero_reg); \ - /* source - dest */ \ - exp_src_lo = _mm256_sub_epi16(exp_src_lo, exp_dst_lo); \ - exp_src_hi = _mm256_sub_epi16(exp_src_hi, exp_dst_hi); \ - /* caculate sum */ \ - sum_reg = _mm256_add_epi16(sum_reg, exp_src_lo); \ - exp_src_lo = _mm256_madd_epi16(exp_src_lo, exp_src_lo); \ - sum_reg = _mm256_add_epi16(sum_reg, exp_src_hi); \ - exp_src_hi = _mm256_madd_epi16(exp_src_hi, exp_src_hi); \ - /* calculate sse */ \ - sse_reg = _mm256_add_epi32(sse_reg, exp_src_lo); \ - sse_reg = _mm256_add_epi32(sse_reg, exp_src_hi); - -// final calculation to sum and sse -#define CALC_SUM_AND_SSE \ - res_cmp = _mm256_cmpgt_epi16(zero_reg, sum_reg); \ - sse_reg_hi = _mm256_srli_si256(sse_reg, 8); \ - sum_reg_lo = _mm256_unpacklo_epi16(sum_reg, res_cmp); \ - sum_reg_hi = _mm256_unpackhi_epi16(sum_reg, res_cmp); \ - sse_reg = _mm256_add_epi32(sse_reg, sse_reg_hi); \ - sum_reg = _mm256_add_epi32(sum_reg_lo, sum_reg_hi); \ - \ - sse_reg_hi = _mm256_srli_si256(sse_reg, 4); \ - sum_reg_hi = _mm256_srli_si256(sum_reg, 8); \ - \ - sse_reg = _mm256_add_epi32(sse_reg, sse_reg_hi); \ - sum_reg = _mm256_add_epi32(sum_reg, sum_reg_hi); \ - *((int*)sse)= _mm_cvtsi128_si32(_mm256_castsi256_si128(sse_reg)) + \ - _mm_cvtsi128_si32(_mm256_extractf128_si256(sse_reg, 1)); \ - sum_reg_hi = _mm256_srli_si256(sum_reg, 4); \ - sum_reg = _mm256_add_epi32(sum_reg, sum_reg_hi); \ - sum = _mm_cvtsi128_si32(_mm256_castsi256_si128(sum_reg)) + \ - _mm_cvtsi128_si32(_mm256_extractf128_si256(sum_reg, 1)); - - -unsigned int vp9_sub_pixel_variance32xh_avx2(const uint8_t *src, - int src_stride, - int x_offset, - int y_offset, - const uint8_t *dst, - int dst_stride, - int height, - unsigned int *sse) { - __m256i src_reg, dst_reg, exp_src_lo, exp_src_hi, exp_dst_lo, exp_dst_hi; - __m256i sse_reg, sum_reg, sse_reg_hi, res_cmp, sum_reg_lo, sum_reg_hi; - __m256i zero_reg; - int i, sum; - sum_reg = _mm256_set1_epi16(0); - sse_reg = _mm256_set1_epi16(0); - zero_reg = _mm256_set1_epi16(0); - - // x_offset = 0 and y_offset = 0 - if (x_offset == 0) { - if (y_offset == 0) { - for (i = 0; i < height ; i++) { - LOAD_SRC_DST - // expend each byte to 2 bytes - MERGE_WITH_SRC(src_reg, zero_reg) - CALC_SUM_SSE_INSIDE_LOOP - src+= src_stride; - dst+= dst_stride; - } - // x_offset = 0 and y_offset = 8 - } else if (y_offset == 8) { - __m256i src_next_reg; - for (i = 0; i < height ; i++) { - LOAD_SRC_DST - AVG_NEXT_SRC(src_reg, src_stride) - // expend each byte to 2 bytes - MERGE_WITH_SRC(src_reg, zero_reg) - CALC_SUM_SSE_INSIDE_LOOP - src+= src_stride; - dst+= dst_stride; - } - // x_offset = 0 and y_offset = bilin interpolation - } else { - __m256i filter, pw8, src_next_reg; - - y_offset <<= 5; - filter = _mm256_load_si256((__m256i const *) - (bilinear_filters_avx2 + y_offset)); - pw8 = _mm256_set1_epi16(8); - for (i = 0; i < height ; i++) { - LOAD_SRC_DST - MERGE_NEXT_SRC(src_reg, src_stride) - FILTER_SRC(filter) - CALC_SUM_SSE_INSIDE_LOOP - src+= src_stride; - dst+= dst_stride; - } - } - // x_offset = 8 and y_offset = 0 - } else if (x_offset == 8) { - if (y_offset == 0) { - __m256i src_next_reg; - for (i = 0; i < height ; i++) { - LOAD_SRC_DST - AVG_NEXT_SRC(src_reg, 1) - // expand each byte to 2 bytes - MERGE_WITH_SRC(src_reg, zero_reg) - CALC_SUM_SSE_INSIDE_LOOP - src+= src_stride; - dst+= dst_stride; - } - // x_offset = 8 and y_offset = 8 - } else if (y_offset == 8) { - __m256i src_next_reg, src_avg; - // load source and another source starting from the next - // following byte - src_reg = _mm256_loadu_si256((__m256i const *) (src)); - AVG_NEXT_SRC(src_reg, 1) - for (i = 0; i < height ; i++) { - src_avg = src_reg; - src+= src_stride; - LOAD_SRC_DST - AVG_NEXT_SRC(src_reg, 1) - // average between previous average to current average - src_avg = _mm256_avg_epu8(src_avg, src_reg); - // expand each byte to 2 bytes - MERGE_WITH_SRC(src_avg, zero_reg) - // save current source average - CALC_SUM_SSE_INSIDE_LOOP - dst+= dst_stride; - } - // x_offset = 8 and y_offset = bilin interpolation - } else { - __m256i filter, pw8, src_next_reg, src_avg; - y_offset <<= 5; - filter = _mm256_load_si256((__m256i const *) - (bilinear_filters_avx2 + y_offset)); - pw8 = _mm256_set1_epi16(8); - // load source and another source starting from the next - // following byte - src_reg = _mm256_loadu_si256((__m256i const *) (src)); - AVG_NEXT_SRC(src_reg, 1) - for (i = 0; i < height ; i++) { - // save current source average - src_avg = src_reg; - src+= src_stride; - LOAD_SRC_DST - AVG_NEXT_SRC(src_reg, 1) - MERGE_WITH_SRC(src_avg, src_reg) - FILTER_SRC(filter) - CALC_SUM_SSE_INSIDE_LOOP - dst+= dst_stride; - } - } - // x_offset = bilin interpolation and y_offset = 0 - } else { - if (y_offset == 0) { - __m256i filter, pw8, src_next_reg; - x_offset <<= 5; - filter = _mm256_load_si256((__m256i const *) - (bilinear_filters_avx2 + x_offset)); - pw8 = _mm256_set1_epi16(8); - for (i = 0; i < height ; i++) { - LOAD_SRC_DST - MERGE_NEXT_SRC(src_reg, 1) - FILTER_SRC(filter) - CALC_SUM_SSE_INSIDE_LOOP - src+= src_stride; - dst+= dst_stride; - } - // x_offset = bilin interpolation and y_offset = 8 - } else if (y_offset == 8) { - __m256i filter, pw8, src_next_reg, src_pack; - x_offset <<= 5; - filter = _mm256_load_si256((__m256i const *) - (bilinear_filters_avx2 + x_offset)); - pw8 = _mm256_set1_epi16(8); - src_reg = _mm256_loadu_si256((__m256i const *) (src)); - MERGE_NEXT_SRC(src_reg, 1) - FILTER_SRC(filter) - // convert each 16 bit to 8 bit to each low and high lane source - src_pack = _mm256_packus_epi16(exp_src_lo, exp_src_hi); - for (i = 0; i < height ; i++) { - src+= src_stride; - LOAD_SRC_DST - MERGE_NEXT_SRC(src_reg, 1) - FILTER_SRC(filter) - src_reg = _mm256_packus_epi16(exp_src_lo, exp_src_hi); - // average between previous pack to the current - src_pack = _mm256_avg_epu8(src_pack, src_reg); - MERGE_WITH_SRC(src_pack, zero_reg) - CALC_SUM_SSE_INSIDE_LOOP - src_pack = src_reg; - dst+= dst_stride; - } - // x_offset = bilin interpolation and y_offset = bilin interpolation - } else { - __m256i xfilter, yfilter, pw8, src_next_reg, src_pack; - x_offset <<= 5; - xfilter = _mm256_load_si256((__m256i const *) - (bilinear_filters_avx2 + x_offset)); - y_offset <<= 5; - yfilter = _mm256_load_si256((__m256i const *) - (bilinear_filters_avx2 + y_offset)); - pw8 = _mm256_set1_epi16(8); - // load source and another source starting from the next - // following byte - src_reg = _mm256_loadu_si256((__m256i const *) (src)); - MERGE_NEXT_SRC(src_reg, 1) - - FILTER_SRC(xfilter) - // convert each 16 bit to 8 bit to each low and high lane source - src_pack = _mm256_packus_epi16(exp_src_lo, exp_src_hi); - for (i = 0; i < height ; i++) { - src+= src_stride; - LOAD_SRC_DST - MERGE_NEXT_SRC(src_reg, 1) - FILTER_SRC(xfilter) - src_reg = _mm256_packus_epi16(exp_src_lo, exp_src_hi); - // merge previous pack to current pack source - MERGE_WITH_SRC(src_pack, src_reg) - // filter the source - FILTER_SRC(yfilter) - src_pack = src_reg; - CALC_SUM_SSE_INSIDE_LOOP - dst+= dst_stride; - } - } - } - CALC_SUM_AND_SSE - return sum; -} - -unsigned int vp9_sub_pixel_avg_variance32xh_avx2(const uint8_t *src, - int src_stride, - int x_offset, - int y_offset, - const uint8_t *dst, - int dst_stride, - const uint8_t *sec, - int sec_stride, - int height, - unsigned int *sse) { - __m256i sec_reg; - __m256i src_reg, dst_reg, exp_src_lo, exp_src_hi, exp_dst_lo, exp_dst_hi; - __m256i sse_reg, sum_reg, sse_reg_hi, res_cmp, sum_reg_lo, sum_reg_hi; - __m256i zero_reg; - int i, sum; - sum_reg = _mm256_set1_epi16(0); - sse_reg = _mm256_set1_epi16(0); - zero_reg = _mm256_set1_epi16(0); - - // x_offset = 0 and y_offset = 0 - if (x_offset == 0) { - if (y_offset == 0) { - for (i = 0; i < height ; i++) { - LOAD_SRC_DST - sec_reg = _mm256_loadu_si256((__m256i const *) (sec)); - src_reg = _mm256_avg_epu8(src_reg, sec_reg); - sec+= sec_stride; - // expend each byte to 2 bytes - MERGE_WITH_SRC(src_reg, zero_reg) - CALC_SUM_SSE_INSIDE_LOOP - src+= src_stride; - dst+= dst_stride; - } - } else if (y_offset == 8) { - __m256i src_next_reg; - for (i = 0; i < height ; i++) { - LOAD_SRC_DST - AVG_NEXT_SRC(src_reg, src_stride) - sec_reg = _mm256_loadu_si256((__m256i const *) (sec)); - src_reg = _mm256_avg_epu8(src_reg, sec_reg); - sec+= sec_stride; - // expend each byte to 2 bytes - MERGE_WITH_SRC(src_reg, zero_reg) - CALC_SUM_SSE_INSIDE_LOOP - src+= src_stride; - dst+= dst_stride; - } - // x_offset = 0 and y_offset = bilin interpolation - } else { - __m256i filter, pw8, src_next_reg; - - y_offset <<= 5; - filter = _mm256_load_si256((__m256i const *) - (bilinear_filters_avx2 + y_offset)); - pw8 = _mm256_set1_epi16(8); - for (i = 0; i < height ; i++) { - LOAD_SRC_DST - MERGE_NEXT_SRC(src_reg, src_stride) - FILTER_SRC(filter) - src_reg = _mm256_packus_epi16(exp_src_lo, exp_src_hi); - sec_reg = _mm256_loadu_si256((__m256i const *) (sec)); - src_reg = _mm256_avg_epu8(src_reg, sec_reg); - sec+= sec_stride; - MERGE_WITH_SRC(src_reg, zero_reg) - CALC_SUM_SSE_INSIDE_LOOP - src+= src_stride; - dst+= dst_stride; - } - } - // x_offset = 8 and y_offset = 0 - } else if (x_offset == 8) { - if (y_offset == 0) { - __m256i src_next_reg; - for (i = 0; i < height ; i++) { - LOAD_SRC_DST - AVG_NEXT_SRC(src_reg, 1) - sec_reg = _mm256_loadu_si256((__m256i const *) (sec)); - src_reg = _mm256_avg_epu8(src_reg, sec_reg); - sec+= sec_stride; - // expand each byte to 2 bytes - MERGE_WITH_SRC(src_reg, zero_reg) - CALC_SUM_SSE_INSIDE_LOOP - src+= src_stride; - dst+= dst_stride; - } - // x_offset = 8 and y_offset = 8 - } else if (y_offset == 8) { - __m256i src_next_reg, src_avg; - // load source and another source starting from the next - // following byte - src_reg = _mm256_loadu_si256((__m256i const *) (src)); - AVG_NEXT_SRC(src_reg, 1) - for (i = 0; i < height ; i++) { - // save current source average - src_avg = src_reg; - src+= src_stride; - LOAD_SRC_DST - AVG_NEXT_SRC(src_reg, 1) - // average between previous average to current average - src_avg = _mm256_avg_epu8(src_avg, src_reg); - sec_reg = _mm256_loadu_si256((__m256i const *) (sec)); - src_avg = _mm256_avg_epu8(src_avg, sec_reg); - sec+= sec_stride; - // expand each byte to 2 bytes - MERGE_WITH_SRC(src_avg, zero_reg) - CALC_SUM_SSE_INSIDE_LOOP - dst+= dst_stride; - } - // x_offset = 8 and y_offset = bilin interpolation - } else { - __m256i filter, pw8, src_next_reg, src_avg; - y_offset <<= 5; - filter = _mm256_load_si256((__m256i const *) - (bilinear_filters_avx2 + y_offset)); - pw8 = _mm256_set1_epi16(8); - // load source and another source starting from the next - // following byte - src_reg = _mm256_loadu_si256((__m256i const *) (src)); - AVG_NEXT_SRC(src_reg, 1) - for (i = 0; i < height ; i++) { - // save current source average - src_avg = src_reg; - src+= src_stride; - LOAD_SRC_DST - AVG_NEXT_SRC(src_reg, 1) - MERGE_WITH_SRC(src_avg, src_reg) - FILTER_SRC(filter) - src_avg = _mm256_packus_epi16(exp_src_lo, exp_src_hi); - sec_reg = _mm256_loadu_si256((__m256i const *) (sec)); - src_avg = _mm256_avg_epu8(src_avg, sec_reg); - // expand each byte to 2 bytes - MERGE_WITH_SRC(src_avg, zero_reg) - sec+= sec_stride; - CALC_SUM_SSE_INSIDE_LOOP - dst+= dst_stride; - } - } - // x_offset = bilin interpolation and y_offset = 0 - } else { - if (y_offset == 0) { - __m256i filter, pw8, src_next_reg; - x_offset <<= 5; - filter = _mm256_load_si256((__m256i const *) - (bilinear_filters_avx2 + x_offset)); - pw8 = _mm256_set1_epi16(8); - for (i = 0; i < height ; i++) { - LOAD_SRC_DST - MERGE_NEXT_SRC(src_reg, 1) - FILTER_SRC(filter) - src_reg = _mm256_packus_epi16(exp_src_lo, exp_src_hi); - sec_reg = _mm256_loadu_si256((__m256i const *) (sec)); - src_reg = _mm256_avg_epu8(src_reg, sec_reg); - MERGE_WITH_SRC(src_reg, zero_reg) - sec+= sec_stride; - CALC_SUM_SSE_INSIDE_LOOP - src+= src_stride; - dst+= dst_stride; - } - // x_offset = bilin interpolation and y_offset = 8 - } else if (y_offset == 8) { - __m256i filter, pw8, src_next_reg, src_pack; - x_offset <<= 5; - filter = _mm256_load_si256((__m256i const *) - (bilinear_filters_avx2 + x_offset)); - pw8 = _mm256_set1_epi16(8); - src_reg = _mm256_loadu_si256((__m256i const *) (src)); - MERGE_NEXT_SRC(src_reg, 1) - FILTER_SRC(filter) - // convert each 16 bit to 8 bit to each low and high lane source - src_pack = _mm256_packus_epi16(exp_src_lo, exp_src_hi); - for (i = 0; i < height ; i++) { - src+= src_stride; - LOAD_SRC_DST - MERGE_NEXT_SRC(src_reg, 1) - FILTER_SRC(filter) - src_reg = _mm256_packus_epi16(exp_src_lo, exp_src_hi); - // average between previous pack to the current - src_pack = _mm256_avg_epu8(src_pack, src_reg); - sec_reg = _mm256_loadu_si256((__m256i const *) (sec)); - src_pack = _mm256_avg_epu8(src_pack, sec_reg); - sec+= sec_stride; - MERGE_WITH_SRC(src_pack, zero_reg) - src_pack = src_reg; - CALC_SUM_SSE_INSIDE_LOOP - dst+= dst_stride; - } - // x_offset = bilin interpolation and y_offset = bilin interpolation - } else { - __m256i xfilter, yfilter, pw8, src_next_reg, src_pack; - x_offset <<= 5; - xfilter = _mm256_load_si256((__m256i const *) - (bilinear_filters_avx2 + x_offset)); - y_offset <<= 5; - yfilter = _mm256_load_si256((__m256i const *) - (bilinear_filters_avx2 + y_offset)); - pw8 = _mm256_set1_epi16(8); - // load source and another source starting from the next - // following byte - src_reg = _mm256_loadu_si256((__m256i const *) (src)); - MERGE_NEXT_SRC(src_reg, 1) - - FILTER_SRC(xfilter) - // convert each 16 bit to 8 bit to each low and high lane source - src_pack = _mm256_packus_epi16(exp_src_lo, exp_src_hi); - for (i = 0; i < height ; i++) { - src+= src_stride; - LOAD_SRC_DST - MERGE_NEXT_SRC(src_reg, 1) - FILTER_SRC(xfilter) - src_reg = _mm256_packus_epi16(exp_src_lo, exp_src_hi); - // merge previous pack to current pack source - MERGE_WITH_SRC(src_pack, src_reg) - // filter the source - FILTER_SRC(yfilter) - src_pack = _mm256_packus_epi16(exp_src_lo, exp_src_hi); - sec_reg = _mm256_loadu_si256((__m256i const *) (sec)); - src_pack = _mm256_avg_epu8(src_pack, sec_reg); - MERGE_WITH_SRC(src_pack, zero_reg) - src_pack = src_reg; - sec+= sec_stride; - CALC_SUM_SSE_INSIDE_LOOP - dst+= dst_stride; - } - } - } - CALC_SUM_AND_SSE - return sum; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_subtract_sse2.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_subtract_sse2.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_subtract_sse2.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_subtract_sse2.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,127 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - -%include "third_party/x86inc/x86inc.asm" - -SECTION .text - -; void vp9_subtract_block(int rows, int cols, -; int16_t *diff, ptrdiff_t diff_stride, -; const uint8_t *src, ptrdiff_t src_stride, -; const uint8_t *pred, ptrdiff_t pred_stride) - -INIT_XMM sse2 -cglobal subtract_block, 7, 7, 8, \ - rows, cols, diff, diff_stride, src, src_stride, \ - pred, pred_stride -%define pred_str colsq - pxor m7, m7 ; dedicated zero register - cmp colsd, 4 - je .case_4 - cmp colsd, 8 - je .case_8 - cmp colsd, 16 - je .case_16 - cmp colsd, 32 - je .case_32 - -%macro loop16 6 - mova m0, [srcq+%1] - mova m4, [srcq+%2] - mova m1, [predq+%3] - mova m5, [predq+%4] - punpckhbw m2, m0, m7 - punpckhbw m3, m1, m7 - punpcklbw m0, m7 - punpcklbw m1, m7 - psubw m2, m3 - psubw m0, m1 - punpckhbw m1, m4, m7 - punpckhbw m3, m5, m7 - punpcklbw m4, m7 - punpcklbw m5, m7 - psubw m1, m3 - psubw m4, m5 - mova [diffq+mmsize*0+%5], m0 - mova [diffq+mmsize*1+%5], m2 - mova [diffq+mmsize*0+%6], m4 - mova [diffq+mmsize*1+%6], m1 -%endmacro - - mov pred_str, pred_stridemp -.loop_64: - loop16 0*mmsize, 1*mmsize, 0*mmsize, 1*mmsize, 0*mmsize, 2*mmsize - loop16 2*mmsize, 3*mmsize, 2*mmsize, 3*mmsize, 4*mmsize, 6*mmsize - lea diffq, [diffq+diff_strideq*2] - add predq, pred_str - add srcq, src_strideq - dec rowsd - jg .loop_64 - RET - -.case_32: - mov pred_str, pred_stridemp -.loop_32: - loop16 0, mmsize, 0, mmsize, 0, 2*mmsize - lea diffq, [diffq+diff_strideq*2] - add predq, pred_str - add srcq, src_strideq - dec rowsd - jg .loop_32 - RET - -.case_16: - mov pred_str, pred_stridemp -.loop_16: - loop16 0, src_strideq, 0, pred_str, 0, diff_strideq*2 - lea diffq, [diffq+diff_strideq*4] - lea predq, [predq+pred_str*2] - lea srcq, [srcq+src_strideq*2] - sub rowsd, 2 - jg .loop_16 - RET - -%macro loop_h 0 - movh m0, [srcq] - movh m2, [srcq+src_strideq] - movh m1, [predq] - movh m3, [predq+pred_str] - punpcklbw m0, m7 - punpcklbw m1, m7 - punpcklbw m2, m7 - punpcklbw m3, m7 - psubw m0, m1 - psubw m2, m3 - mova [diffq], m0 - mova [diffq+diff_strideq*2], m2 -%endmacro - -.case_8: - mov pred_str, pred_stridemp -.loop_8: - loop_h - lea diffq, [diffq+diff_strideq*4] - lea srcq, [srcq+src_strideq*2] - lea predq, [predq+pred_str*2] - sub rowsd, 2 - jg .loop_8 - RET - -INIT_MMX -.case_4: - mov pred_str, pred_stridemp -.loop_4: - loop_h - lea diffq, [diffq+diff_strideq*4] - lea srcq, [srcq+src_strideq*2] - lea predq, [predq+pred_str*2] - sub rowsd, 2 - jg .loop_4 - RET diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_temporal_filter_apply_sse2.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_temporal_filter_apply_sse2.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_temporal_filter_apply_sse2.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_temporal_filter_apply_sse2.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,212 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -; void vp9_temporal_filter_apply_sse2 | arg -; (unsigned char *frame1, | 0 -; unsigned int stride, | 1 -; unsigned char *frame2, | 2 -; unsigned int block_width, | 3 -; unsigned int block_height, | 4 -; int strength, | 5 -; int filter_weight, | 6 -; unsigned int *accumulator, | 7 -; unsigned short *count) | 8 -global sym(vp9_temporal_filter_apply_sse2) PRIVATE -sym(vp9_temporal_filter_apply_sse2): - - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 9 - SAVE_XMM 7 - GET_GOT rbx - push rsi - push rdi - ALIGN_STACK 16, rax - %define block_width 0 - %define block_height 16 - %define strength 32 - %define filter_weight 48 - %define rounding_bit 64 - %define rbp_backup 80 - %define stack_size 96 - sub rsp, stack_size - mov [rsp + rbp_backup], rbp - ; end prolog - - mov edx, arg(3) - mov [rsp + block_width], rdx - mov edx, arg(4) - mov [rsp + block_height], rdx - movd xmm6, arg(5) - movdqa [rsp + strength], xmm6 ; where strength is used, all 16 bytes are read - - ; calculate the rounding bit outside the loop - ; 0x8000 >> (16 - strength) - mov rdx, 16 - sub rdx, arg(5) ; 16 - strength - movq xmm4, rdx ; can't use rdx w/ shift - movdqa xmm5, [GLOBAL(_const_top_bit)] - psrlw xmm5, xmm4 - movdqa [rsp + rounding_bit], xmm5 - - mov rsi, arg(0) ; src/frame1 - mov rdx, arg(2) ; predictor frame - mov rdi, arg(7) ; accumulator - mov rax, arg(8) ; count - - ; dup the filter weight and store for later - movd xmm0, arg(6) ; filter_weight - pshuflw xmm0, xmm0, 0 - punpcklwd xmm0, xmm0 - movdqa [rsp + filter_weight], xmm0 - - mov rbp, arg(1) ; stride - pxor xmm7, xmm7 ; zero for extraction - - mov rcx, [rsp + block_width] - imul rcx, [rsp + block_height] - add rcx, rdx - cmp dword ptr [rsp + block_width], 8 - jne .temporal_filter_apply_load_16 - -.temporal_filter_apply_load_8: - movq xmm0, [rsi] ; first row - lea rsi, [rsi + rbp] ; += stride - punpcklbw xmm0, xmm7 ; src[ 0- 7] - movq xmm1, [rsi] ; second row - lea rsi, [rsi + rbp] ; += stride - punpcklbw xmm1, xmm7 ; src[ 8-15] - jmp .temporal_filter_apply_load_finished - -.temporal_filter_apply_load_16: - movdqa xmm0, [rsi] ; src (frame1) - lea rsi, [rsi + rbp] ; += stride - movdqa xmm1, xmm0 - punpcklbw xmm0, xmm7 ; src[ 0- 7] - punpckhbw xmm1, xmm7 ; src[ 8-15] - -.temporal_filter_apply_load_finished: - movdqa xmm2, [rdx] ; predictor (frame2) - movdqa xmm3, xmm2 - punpcklbw xmm2, xmm7 ; pred[ 0- 7] - punpckhbw xmm3, xmm7 ; pred[ 8-15] - - ; modifier = src_byte - pixel_value - psubw xmm0, xmm2 ; src - pred[ 0- 7] - psubw xmm1, xmm3 ; src - pred[ 8-15] - - ; modifier *= modifier - pmullw xmm0, xmm0 ; modifer[ 0- 7]^2 - pmullw xmm1, xmm1 ; modifer[ 8-15]^2 - - ; modifier *= 3 - pmullw xmm0, [GLOBAL(_const_3w)] - pmullw xmm1, [GLOBAL(_const_3w)] - - ; modifer += 0x8000 >> (16 - strength) - paddw xmm0, [rsp + rounding_bit] - paddw xmm1, [rsp + rounding_bit] - - ; modifier >>= strength - psrlw xmm0, [rsp + strength] - psrlw xmm1, [rsp + strength] - - ; modifier = 16 - modifier - ; saturation takes care of modifier > 16 - movdqa xmm3, [GLOBAL(_const_16w)] - movdqa xmm2, [GLOBAL(_const_16w)] - psubusw xmm3, xmm1 - psubusw xmm2, xmm0 - - ; modifier *= filter_weight - pmullw xmm2, [rsp + filter_weight] - pmullw xmm3, [rsp + filter_weight] - - ; count - movdqa xmm4, [rax] - movdqa xmm5, [rax+16] - ; += modifier - paddw xmm4, xmm2 - paddw xmm5, xmm3 - ; write back - movdqa [rax], xmm4 - movdqa [rax+16], xmm5 - lea rax, [rax + 16*2] ; count += 16*(sizeof(short)) - - ; load and extract the predictor up to shorts - pxor xmm7, xmm7 - movdqa xmm0, [rdx] - lea rdx, [rdx + 16*1] ; pred += 16*(sizeof(char)) - movdqa xmm1, xmm0 - punpcklbw xmm0, xmm7 ; pred[ 0- 7] - punpckhbw xmm1, xmm7 ; pred[ 8-15] - - ; modifier *= pixel_value - pmullw xmm0, xmm2 - pmullw xmm1, xmm3 - - ; expand to double words - movdqa xmm2, xmm0 - punpcklwd xmm0, xmm7 ; [ 0- 3] - punpckhwd xmm2, xmm7 ; [ 4- 7] - movdqa xmm3, xmm1 - punpcklwd xmm1, xmm7 ; [ 8-11] - punpckhwd xmm3, xmm7 ; [12-15] - - ; accumulator - movdqa xmm4, [rdi] - movdqa xmm5, [rdi+16] - movdqa xmm6, [rdi+32] - movdqa xmm7, [rdi+48] - ; += modifier - paddd xmm4, xmm0 - paddd xmm5, xmm2 - paddd xmm6, xmm1 - paddd xmm7, xmm3 - ; write back - movdqa [rdi], xmm4 - movdqa [rdi+16], xmm5 - movdqa [rdi+32], xmm6 - movdqa [rdi+48], xmm7 - lea rdi, [rdi + 16*4] ; accumulator += 16*(sizeof(int)) - - cmp rdx, rcx - je .temporal_filter_apply_epilog - pxor xmm7, xmm7 ; zero for extraction - cmp dword ptr [rsp + block_width], 16 - je .temporal_filter_apply_load_16 - jmp .temporal_filter_apply_load_8 - -.temporal_filter_apply_epilog: - ; begin epilog - mov rbp, [rsp + rbp_backup] - add rsp, stack_size - pop rsp - pop rdi - pop rsi - RESTORE_GOT - RESTORE_XMM - UNSHADOW_ARGS - pop rbp - ret - -SECTION_RODATA -align 16 -_const_3w: - times 8 dw 3 -align 16 -_const_top_bit: - times 8 dw 1<<15 -align 16 -_const_16w - times 8 dw 16 diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_variance_avx2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_variance_avx2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_variance_avx2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_variance_avx2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#include "./vpx_config.h" - -#include "vp9/encoder/vp9_variance.h" -#include "vpx_ports/mem.h" - -typedef void (*get_var_avx2)(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse, int *sum); - -void vp9_get16x16var_avx2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse, int *sum); - -void vp9_get32x32var_avx2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse, int *sum); - -unsigned int vp9_sub_pixel_variance32xh_avx2(const uint8_t *src, int src_stride, - int x_offset, int y_offset, - const uint8_t *dst, int dst_stride, - int height, - unsigned int *sse); - -unsigned int vp9_sub_pixel_avg_variance32xh_avx2(const uint8_t *src, - int src_stride, - int x_offset, - int y_offset, - const uint8_t *dst, - int dst_stride, - const uint8_t *sec, - int sec_stride, - int height, - unsigned int *sseptr); - -static void variance_avx2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - int w, int h, unsigned int *sse, int *sum, - get_var_avx2 var_fn, int block_size) { - int i, j; - - *sse = 0; - *sum = 0; - - for (i = 0; i < h; i += 16) { - for (j = 0; j < w; j += block_size) { - unsigned int sse0; - int sum0; - var_fn(&src[src_stride * i + j], src_stride, - &ref[ref_stride * i + j], ref_stride, &sse0, &sum0); - *sse += sse0; - *sum += sum0; - } - } -} - - -unsigned int vp9_variance16x16_avx2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - int sum; - variance_avx2(src, src_stride, ref, ref_stride, 16, 16, - sse, &sum, vp9_get16x16var_avx2, 16); - return *sse - (((unsigned int)sum * sum) >> 8); -} - -unsigned int vp9_mse16x16_avx2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - int sum; - vp9_get16x16var_avx2(src, src_stride, ref, ref_stride, sse, &sum); - return *sse; -} - -unsigned int vp9_variance32x16_avx2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - int sum; - variance_avx2(src, src_stride, ref, ref_stride, 32, 16, - sse, &sum, vp9_get32x32var_avx2, 32); - return *sse - (((int64_t)sum * sum) >> 9); -} - -unsigned int vp9_variance32x32_avx2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - int sum; - variance_avx2(src, src_stride, ref, ref_stride, 32, 32, - sse, &sum, vp9_get32x32var_avx2, 32); - return *sse - (((int64_t)sum * sum) >> 10); -} - -unsigned int vp9_variance64x64_avx2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - int sum; - variance_avx2(src, src_stride, ref, ref_stride, 64, 64, - sse, &sum, vp9_get32x32var_avx2, 32); - return *sse - (((int64_t)sum * sum) >> 12); -} - -unsigned int vp9_variance64x32_avx2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - int sum; - variance_avx2(src, src_stride, ref, ref_stride, 64, 32, - sse, &sum, vp9_get32x32var_avx2, 32); - return *sse - (((int64_t)sum * sum) >> 11); -} - -unsigned int vp9_sub_pixel_variance64x64_avx2(const uint8_t *src, - int src_stride, - int x_offset, - int y_offset, - const uint8_t *dst, - int dst_stride, - unsigned int *sse) { - unsigned int sse1; - const int se1 = vp9_sub_pixel_variance32xh_avx2(src, src_stride, x_offset, - y_offset, dst, dst_stride, - 64, &sse1); - unsigned int sse2; - const int se2 = vp9_sub_pixel_variance32xh_avx2(src + 32, src_stride, - x_offset, y_offset, - dst + 32, dst_stride, - 64, &sse2); - const int se = se1 + se2; - *sse = sse1 + sse2; - return *sse - (((int64_t)se * se) >> 12); -} - -unsigned int vp9_sub_pixel_variance32x32_avx2(const uint8_t *src, - int src_stride, - int x_offset, - int y_offset, - const uint8_t *dst, - int dst_stride, - unsigned int *sse) { - const int se = vp9_sub_pixel_variance32xh_avx2(src, src_stride, x_offset, - y_offset, dst, dst_stride, - 32, sse); - return *sse - (((int64_t)se * se) >> 10); -} - -unsigned int vp9_sub_pixel_avg_variance64x64_avx2(const uint8_t *src, - int src_stride, - int x_offset, - int y_offset, - const uint8_t *dst, - int dst_stride, - unsigned int *sse, - const uint8_t *sec) { - unsigned int sse1; - const int se1 = vp9_sub_pixel_avg_variance32xh_avx2(src, src_stride, x_offset, - y_offset, dst, dst_stride, - sec, 64, 64, &sse1); - unsigned int sse2; - const int se2 = - vp9_sub_pixel_avg_variance32xh_avx2(src + 32, src_stride, x_offset, - y_offset, dst + 32, dst_stride, - sec + 32, 64, 64, &sse2); - const int se = se1 + se2; - - *sse = sse1 + sse2; - - return *sse - (((int64_t)se * se) >> 12); -} - -unsigned int vp9_sub_pixel_avg_variance32x32_avx2(const uint8_t *src, - int src_stride, - int x_offset, - int y_offset, - const uint8_t *dst, - int dst_stride, - unsigned int *sse, - const uint8_t *sec) { - // processing 32 element in parallel - const int se = vp9_sub_pixel_avg_variance32xh_avx2(src, src_stride, x_offset, - y_offset, dst, dst_stride, - sec, 32, 32, sse); - return *sse - (((int64_t)se * se) >> 10); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_variance_impl_intrin_avx2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_variance_impl_intrin_avx2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_variance_impl_intrin_avx2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_variance_impl_intrin_avx2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,213 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include // AVX2 - -void vp9_get16x16var_avx2(const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *SSE, - int *Sum) { - __m256i src, src_expand_low, src_expand_high, ref, ref_expand_low; - __m256i ref_expand_high, madd_low, madd_high; - unsigned int i, src_2strides, ref_2strides; - __m256i zero_reg = _mm256_set1_epi16(0); - __m256i sum_ref_src = _mm256_set1_epi16(0); - __m256i madd_ref_src = _mm256_set1_epi16(0); - - // processing two strides in a 256 bit register reducing the number - // of loop stride by half (comparing to the sse2 code) - src_2strides = source_stride << 1; - ref_2strides = recon_stride << 1; - for (i = 0; i < 8; i++) { - src = _mm256_castsi128_si256( - _mm_loadu_si128((__m128i const *) (src_ptr))); - src = _mm256_inserti128_si256(src, - _mm_loadu_si128((__m128i const *)(src_ptr+source_stride)), 1); - - ref =_mm256_castsi128_si256( - _mm_loadu_si128((__m128i const *) (ref_ptr))); - ref = _mm256_inserti128_si256(ref, - _mm_loadu_si128((__m128i const *)(ref_ptr+recon_stride)), 1); - - // expanding to 16 bit each lane - src_expand_low = _mm256_unpacklo_epi8(src, zero_reg); - src_expand_high = _mm256_unpackhi_epi8(src, zero_reg); - - ref_expand_low = _mm256_unpacklo_epi8(ref, zero_reg); - ref_expand_high = _mm256_unpackhi_epi8(ref, zero_reg); - - // src-ref - src_expand_low = _mm256_sub_epi16(src_expand_low, ref_expand_low); - src_expand_high = _mm256_sub_epi16(src_expand_high, ref_expand_high); - - // madd low (src - ref) - madd_low = _mm256_madd_epi16(src_expand_low, src_expand_low); - - // add high to low - src_expand_low = _mm256_add_epi16(src_expand_low, src_expand_high); - - // madd high (src - ref) - madd_high = _mm256_madd_epi16(src_expand_high, src_expand_high); - - sum_ref_src = _mm256_add_epi16(sum_ref_src, src_expand_low); - - // add high to low - madd_ref_src = _mm256_add_epi32(madd_ref_src, - _mm256_add_epi32(madd_low, madd_high)); - - src_ptr+= src_2strides; - ref_ptr+= ref_2strides; - } - - { - __m128i sum_res, madd_res; - __m128i expand_sum_low, expand_sum_high, expand_sum; - __m128i expand_madd_low, expand_madd_high, expand_madd; - __m128i ex_expand_sum_low, ex_expand_sum_high, ex_expand_sum; - - // extract the low lane and add it to the high lane - sum_res = _mm_add_epi16(_mm256_castsi256_si128(sum_ref_src), - _mm256_extractf128_si256(sum_ref_src, 1)); - - madd_res = _mm_add_epi32(_mm256_castsi256_si128(madd_ref_src), - _mm256_extractf128_si256(madd_ref_src, 1)); - - // padding each 2 bytes with another 2 zeroed bytes - expand_sum_low = _mm_unpacklo_epi16(_mm256_castsi256_si128(zero_reg), - sum_res); - expand_sum_high = _mm_unpackhi_epi16(_mm256_castsi256_si128(zero_reg), - sum_res); - - // shifting the sign 16 bits right - expand_sum_low = _mm_srai_epi32(expand_sum_low, 16); - expand_sum_high = _mm_srai_epi32(expand_sum_high, 16); - - expand_sum = _mm_add_epi32(expand_sum_low, expand_sum_high); - - // expand each 32 bits of the madd result to 64 bits - expand_madd_low = _mm_unpacklo_epi32(madd_res, - _mm256_castsi256_si128(zero_reg)); - expand_madd_high = _mm_unpackhi_epi32(madd_res, - _mm256_castsi256_si128(zero_reg)); - - expand_madd = _mm_add_epi32(expand_madd_low, expand_madd_high); - - ex_expand_sum_low = _mm_unpacklo_epi32(expand_sum, - _mm256_castsi256_si128(zero_reg)); - ex_expand_sum_high = _mm_unpackhi_epi32(expand_sum, - _mm256_castsi256_si128(zero_reg)); - - ex_expand_sum = _mm_add_epi32(ex_expand_sum_low, ex_expand_sum_high); - - // shift 8 bytes eight - madd_res = _mm_srli_si128(expand_madd, 8); - sum_res = _mm_srli_si128(ex_expand_sum, 8); - - madd_res = _mm_add_epi32(madd_res, expand_madd); - sum_res = _mm_add_epi32(sum_res, ex_expand_sum); - - *((int*)SSE)= _mm_cvtsi128_si32(madd_res); - - *((int*)Sum)= _mm_cvtsi128_si32(sum_res); - } -} - -void vp9_get32x32var_avx2(const unsigned char *src_ptr, - int source_stride, - const unsigned char *ref_ptr, - int recon_stride, - unsigned int *SSE, - int *Sum) { - __m256i src, src_expand_low, src_expand_high, ref, ref_expand_low; - __m256i ref_expand_high, madd_low, madd_high; - unsigned int i; - __m256i zero_reg = _mm256_set1_epi16(0); - __m256i sum_ref_src = _mm256_set1_epi16(0); - __m256i madd_ref_src = _mm256_set1_epi16(0); - - // processing 32 elements in parallel - for (i = 0; i < 16; i++) { - src = _mm256_loadu_si256((__m256i const *) (src_ptr)); - - ref = _mm256_loadu_si256((__m256i const *) (ref_ptr)); - - // expanding to 16 bit each lane - src_expand_low = _mm256_unpacklo_epi8(src, zero_reg); - src_expand_high = _mm256_unpackhi_epi8(src, zero_reg); - - ref_expand_low = _mm256_unpacklo_epi8(ref, zero_reg); - ref_expand_high = _mm256_unpackhi_epi8(ref, zero_reg); - - // src-ref - src_expand_low = _mm256_sub_epi16(src_expand_low, ref_expand_low); - src_expand_high = _mm256_sub_epi16(src_expand_high, ref_expand_high); - - // madd low (src - ref) - madd_low = _mm256_madd_epi16(src_expand_low, src_expand_low); - - // add high to low - src_expand_low = _mm256_add_epi16(src_expand_low, src_expand_high); - - // madd high (src - ref) - madd_high = _mm256_madd_epi16(src_expand_high, src_expand_high); - - sum_ref_src = _mm256_add_epi16(sum_ref_src, src_expand_low); - - // add high to low - madd_ref_src = _mm256_add_epi32(madd_ref_src, - _mm256_add_epi32(madd_low, madd_high)); - - src_ptr+= source_stride; - ref_ptr+= recon_stride; - } - - { - __m256i expand_sum_low, expand_sum_high, expand_sum; - __m256i expand_madd_low, expand_madd_high, expand_madd; - __m256i ex_expand_sum_low, ex_expand_sum_high, ex_expand_sum; - - // padding each 2 bytes with another 2 zeroed bytes - expand_sum_low = _mm256_unpacklo_epi16(zero_reg, sum_ref_src); - expand_sum_high = _mm256_unpackhi_epi16(zero_reg, sum_ref_src); - - // shifting the sign 16 bits right - expand_sum_low = _mm256_srai_epi32(expand_sum_low, 16); - expand_sum_high = _mm256_srai_epi32(expand_sum_high, 16); - - expand_sum = _mm256_add_epi32(expand_sum_low, expand_sum_high); - - // expand each 32 bits of the madd result to 64 bits - expand_madd_low = _mm256_unpacklo_epi32(madd_ref_src, zero_reg); - expand_madd_high = _mm256_unpackhi_epi32(madd_ref_src, zero_reg); - - expand_madd = _mm256_add_epi32(expand_madd_low, expand_madd_high); - - ex_expand_sum_low = _mm256_unpacklo_epi32(expand_sum, zero_reg); - ex_expand_sum_high = _mm256_unpackhi_epi32(expand_sum, zero_reg); - - ex_expand_sum = _mm256_add_epi32(ex_expand_sum_low, ex_expand_sum_high); - - // shift 8 bytes eight - madd_ref_src = _mm256_srli_si256(expand_madd, 8); - sum_ref_src = _mm256_srli_si256(ex_expand_sum, 8); - - madd_ref_src = _mm256_add_epi32(madd_ref_src, expand_madd); - sum_ref_src = _mm256_add_epi32(sum_ref_src, ex_expand_sum); - - // extract the low lane and the high lane and add the results - *((int*)SSE)= _mm_cvtsi128_si32(_mm256_castsi256_si128(madd_ref_src)) + - _mm_cvtsi128_si32(_mm256_extractf128_si256(madd_ref_src, 1)); - - *((int*)Sum)= _mm_cvtsi128_si32(_mm256_castsi256_si128(sum_ref_src)) + - _mm_cvtsi128_si32(_mm256_extractf128_si256(sum_ref_src, 1)); - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_variance_sse2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_variance_sse2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/encoder/x86/vp9_variance_sse2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/encoder/x86/vp9_variance_sse2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,480 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include // SSE2 - -#include "./vpx_config.h" - -#include "vp9/encoder/vp9_variance.h" -#include "vpx_ports/mem.h" - -typedef unsigned int (*variance_fn_t) (const unsigned char *src, int src_stride, - const unsigned char *ref, int ref_stride, - unsigned int *sse, int *sum); - -unsigned int vp9_get_mb_ss_sse2(const int16_t *src) { - __m128i vsum = _mm_setzero_si128(); - int i; - - for (i = 0; i < 32; ++i) { - const __m128i v = _mm_loadu_si128((const __m128i *)src); - vsum = _mm_add_epi32(vsum, _mm_madd_epi16(v, v)); - src += 8; - } - - vsum = _mm_add_epi32(vsum, _mm_srli_si128(vsum, 8)); - vsum = _mm_add_epi32(vsum, _mm_srli_si128(vsum, 4)); - return _mm_cvtsi128_si32(vsum); -} - -#define READ64(p, stride, i) \ - _mm_unpacklo_epi8(_mm_cvtsi32_si128(*(const uint32_t *)(p + i * stride)), \ - _mm_cvtsi32_si128(*(const uint32_t *)(p + (i + 1) * stride))) - -unsigned int vp9_get4x4var_sse2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse, int *sum) { - const __m128i zero = _mm_setzero_si128(); - const __m128i src0 = _mm_unpacklo_epi8(READ64(src, src_stride, 0), zero); - const __m128i src1 = _mm_unpacklo_epi8(READ64(src, src_stride, 2), zero); - const __m128i ref0 = _mm_unpacklo_epi8(READ64(ref, ref_stride, 0), zero); - const __m128i ref1 = _mm_unpacklo_epi8(READ64(ref, ref_stride, 2), zero); - const __m128i diff0 = _mm_sub_epi16(src0, ref0); - const __m128i diff1 = _mm_sub_epi16(src1, ref1); - - // sum - __m128i vsum = _mm_add_epi16(diff0, diff1); - vsum = _mm_add_epi16(vsum, _mm_srli_si128(vsum, 8)); - vsum = _mm_add_epi16(vsum, _mm_srli_si128(vsum, 4)); - vsum = _mm_add_epi16(vsum, _mm_srli_si128(vsum, 2)); - *sum = (int16_t)_mm_extract_epi16(vsum, 0); - - // sse - vsum = _mm_add_epi32(_mm_madd_epi16(diff0, diff0), - _mm_madd_epi16(diff1, diff1)); - vsum = _mm_add_epi32(vsum, _mm_srli_si128(vsum, 8)); - vsum = _mm_add_epi32(vsum, _mm_srli_si128(vsum, 4)); - *sse = _mm_cvtsi128_si32(vsum); - - return 0; -} - -unsigned int vp9_get8x8var_sse2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse, int *sum) { - const __m128i zero = _mm_setzero_si128(); - __m128i vsum = _mm_setzero_si128(); - __m128i vsse = _mm_setzero_si128(); - int i; - - for (i = 0; i < 8; i += 2) { - const __m128i src0 = _mm_unpacklo_epi8(_mm_loadl_epi64( - (const __m128i *)(src + i * src_stride)), zero); - const __m128i ref0 = _mm_unpacklo_epi8(_mm_loadl_epi64( - (const __m128i *)(ref + i * ref_stride)), zero); - const __m128i diff0 = _mm_sub_epi16(src0, ref0); - - const __m128i src1 = _mm_unpacklo_epi8(_mm_loadl_epi64( - (const __m128i *)(src + (i + 1) * src_stride)), zero); - const __m128i ref1 = _mm_unpacklo_epi8(_mm_loadl_epi64( - (const __m128i *)(ref + (i + 1) * ref_stride)), zero); - const __m128i diff1 = _mm_sub_epi16(src1, ref1); - - vsum = _mm_add_epi16(vsum, diff0); - vsum = _mm_add_epi16(vsum, diff1); - vsse = _mm_add_epi32(vsse, _mm_madd_epi16(diff0, diff0)); - vsse = _mm_add_epi32(vsse, _mm_madd_epi16(diff1, diff1)); - } - - // sum - vsum = _mm_add_epi16(vsum, _mm_srli_si128(vsum, 8)); - vsum = _mm_add_epi16(vsum, _mm_srli_si128(vsum, 4)); - vsum = _mm_add_epi16(vsum, _mm_srli_si128(vsum, 2)); - *sum = (int16_t)_mm_extract_epi16(vsum, 0); - - // sse - vsse = _mm_add_epi32(vsse, _mm_srli_si128(vsse, 8)); - vsse = _mm_add_epi32(vsse, _mm_srli_si128(vsse, 4)); - *sse = _mm_cvtsi128_si32(vsse); - - return 0; -} - -unsigned int vp9_get16x16var_sse2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse, int *sum) { - const __m128i zero = _mm_setzero_si128(); - __m128i vsum = _mm_setzero_si128(); - __m128i vsse = _mm_setzero_si128(); - int i; - - for (i = 0; i < 16; ++i) { - const __m128i s = _mm_loadu_si128((const __m128i *)src); - const __m128i r = _mm_loadu_si128((const __m128i *)ref); - - const __m128i src0 = _mm_unpacklo_epi8(s, zero); - const __m128i ref0 = _mm_unpacklo_epi8(r, zero); - const __m128i diff0 = _mm_sub_epi16(src0, ref0); - - const __m128i src1 = _mm_unpackhi_epi8(s, zero); - const __m128i ref1 = _mm_unpackhi_epi8(r, zero); - const __m128i diff1 = _mm_sub_epi16(src1, ref1); - - vsum = _mm_add_epi16(vsum, diff0); - vsum = _mm_add_epi16(vsum, diff1); - vsse = _mm_add_epi32(vsse, _mm_madd_epi16(diff0, diff0)); - vsse = _mm_add_epi32(vsse, _mm_madd_epi16(diff1, diff1)); - - src += src_stride; - ref += ref_stride; - } - - // sum - vsum = _mm_add_epi16(vsum, _mm_srli_si128(vsum, 8)); - vsum = _mm_add_epi16(vsum, _mm_srli_si128(vsum, 4)); - *sum = (int16_t)_mm_extract_epi16(vsum, 0) + - (int16_t)_mm_extract_epi16(vsum, 1); - - // sse - vsse = _mm_add_epi32(vsse, _mm_srli_si128(vsse, 8)); - vsse = _mm_add_epi32(vsse, _mm_srli_si128(vsse, 4)); - *sse = _mm_cvtsi128_si32(vsse); - - return 0; -} - - -static void variance_sse2(const unsigned char *src, int src_stride, - const unsigned char *ref, int ref_stride, - int w, int h, unsigned int *sse, int *sum, - variance_fn_t var_fn, int block_size) { - int i, j; - - *sse = 0; - *sum = 0; - - for (i = 0; i < h; i += block_size) { - for (j = 0; j < w; j += block_size) { - unsigned int sse0; - int sum0; - var_fn(src + src_stride * i + j, src_stride, - ref + ref_stride * i + j, ref_stride, &sse0, &sum0); - *sse += sse0; - *sum += sum0; - } - } -} - -unsigned int vp9_variance4x4_sse2(const unsigned char *src, int src_stride, - const unsigned char *ref, int ref_stride, - unsigned int *sse) { - int sum; - vp9_get4x4var_sse2(src, src_stride, ref, ref_stride, sse, &sum); - return *sse - (((unsigned int)sum * sum) >> 4); -} - -unsigned int vp9_variance8x4_sse2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - int sum; - variance_sse2(src, src_stride, ref, ref_stride, 8, 4, - sse, &sum, vp9_get4x4var_sse2, 4); - return *sse - (((unsigned int)sum * sum) >> 5); -} - -unsigned int vp9_variance4x8_sse2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - int sum; - variance_sse2(src, src_stride, ref, ref_stride, 4, 8, - sse, &sum, vp9_get4x4var_sse2, 4); - return *sse - (((unsigned int)sum * sum) >> 5); -} - -unsigned int vp9_variance8x8_sse2(const unsigned char *src, int src_stride, - const unsigned char *ref, int ref_stride, - unsigned int *sse) { - int sum; - vp9_get8x8var_sse2(src, src_stride, ref, ref_stride, sse, &sum); - return *sse - (((unsigned int)sum * sum) >> 6); -} - -unsigned int vp9_variance16x8_sse2(const unsigned char *src, int src_stride, - const unsigned char *ref, int ref_stride, - unsigned int *sse) { - int sum; - variance_sse2(src, src_stride, ref, ref_stride, 16, 8, - sse, &sum, vp9_get8x8var_sse2, 8); - return *sse - (((unsigned int)sum * sum) >> 7); -} - -unsigned int vp9_variance8x16_sse2(const unsigned char *src, int src_stride, - const unsigned char *ref, int ref_stride, - unsigned int *sse) { - int sum; - variance_sse2(src, src_stride, ref, ref_stride, 8, 16, - sse, &sum, vp9_get8x8var_sse2, 8); - return *sse - (((unsigned int)sum * sum) >> 7); -} - -unsigned int vp9_variance16x16_sse2(const unsigned char *src, int src_stride, - const unsigned char *ref, int ref_stride, - unsigned int *sse) { - int sum; - vp9_get16x16var_sse2(src, src_stride, ref, ref_stride, sse, &sum); - return *sse - (((unsigned int)sum * sum) >> 8); -} - -unsigned int vp9_variance32x32_sse2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - int sum; - variance_sse2(src, src_stride, ref, ref_stride, 32, 32, - sse, &sum, vp9_get16x16var_sse2, 16); - return *sse - (((int64_t)sum * sum) >> 10); -} - -unsigned int vp9_variance32x16_sse2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - int sum; - variance_sse2(src, src_stride, ref, ref_stride, 32, 16, - sse, &sum, vp9_get16x16var_sse2, 16); - return *sse - (((int64_t)sum * sum) >> 9); -} - -unsigned int vp9_variance16x32_sse2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - int sum; - variance_sse2(src, src_stride, ref, ref_stride, 16, 32, - sse, &sum, vp9_get16x16var_sse2, 16); - return *sse - (((int64_t)sum * sum) >> 9); -} - -unsigned int vp9_variance64x64_sse2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - int sum; - variance_sse2(src, src_stride, ref, ref_stride, 64, 64, - sse, &sum, vp9_get16x16var_sse2, 16); - return *sse - (((int64_t)sum * sum) >> 12); -} - -unsigned int vp9_variance64x32_sse2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - int sum; - variance_sse2(src, src_stride, ref, ref_stride, 64, 32, - sse, &sum, vp9_get16x16var_sse2, 16); - return *sse - (((int64_t)sum * sum) >> 11); -} - -unsigned int vp9_variance32x64_sse2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - int sum; - variance_sse2(src, src_stride, ref, ref_stride, 32, 64, - sse, &sum, vp9_get16x16var_sse2, 16); - return *sse - (((int64_t)sum * sum) >> 11); -} - -unsigned int vp9_mse8x8_sse2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - vp9_variance8x8_sse2(src, src_stride, ref, ref_stride, sse); - return *sse; -} - -unsigned int vp9_mse8x16_sse2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - vp9_variance8x16_sse2(src, src_stride, ref, ref_stride, sse); - return *sse; -} - -unsigned int vp9_mse16x8_sse2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - vp9_variance16x8_sse2(src, src_stride, ref, ref_stride, sse); - return *sse; -} - -unsigned int vp9_mse16x16_sse2(const uint8_t *src, int src_stride, - const uint8_t *ref, int ref_stride, - unsigned int *sse) { - vp9_variance16x16_sse2(src, src_stride, ref, ref_stride, sse); - return *sse; -} - -// The 2 unused parameters are place holders for PIC enabled build. -#define DECL(w, opt) \ -int vp9_sub_pixel_variance##w##xh_##opt(const uint8_t *src, \ - ptrdiff_t src_stride, \ - int x_offset, int y_offset, \ - const uint8_t *dst, \ - ptrdiff_t dst_stride, \ - int height, unsigned int *sse, \ - void *unused0, void *unused) -#define DECLS(opt1, opt2) \ -DECL(4, opt2); \ -DECL(8, opt1); \ -DECL(16, opt1) - -DECLS(sse2, sse); -DECLS(ssse3, ssse3); -#undef DECLS -#undef DECL - -#define FN(w, h, wf, wlog2, hlog2, opt, cast) \ -unsigned int vp9_sub_pixel_variance##w##x##h##_##opt(const uint8_t *src, \ - int src_stride, \ - int x_offset, \ - int y_offset, \ - const uint8_t *dst, \ - int dst_stride, \ - unsigned int *sse_ptr) { \ - unsigned int sse; \ - int se = vp9_sub_pixel_variance##wf##xh_##opt(src, src_stride, x_offset, \ - y_offset, dst, dst_stride, \ - h, &sse, NULL, NULL); \ - if (w > wf) { \ - unsigned int sse2; \ - int se2 = vp9_sub_pixel_variance##wf##xh_##opt(src + 16, src_stride, \ - x_offset, y_offset, \ - dst + 16, dst_stride, \ - h, &sse2, NULL, NULL); \ - se += se2; \ - sse += sse2; \ - if (w > wf * 2) { \ - se2 = vp9_sub_pixel_variance##wf##xh_##opt(src + 32, src_stride, \ - x_offset, y_offset, \ - dst + 32, dst_stride, \ - h, &sse2, NULL, NULL); \ - se += se2; \ - sse += sse2; \ - se2 = vp9_sub_pixel_variance##wf##xh_##opt(src + 48, src_stride, \ - x_offset, y_offset, \ - dst + 48, dst_stride, \ - h, &sse2, NULL, NULL); \ - se += se2; \ - sse += sse2; \ - } \ - } \ - *sse_ptr = sse; \ - return sse - ((cast se * se) >> (wlog2 + hlog2)); \ -} - -#define FNS(opt1, opt2) \ -FN(64, 64, 16, 6, 6, opt1, (int64_t)); \ -FN(64, 32, 16, 6, 5, opt1, (int64_t)); \ -FN(32, 64, 16, 5, 6, opt1, (int64_t)); \ -FN(32, 32, 16, 5, 5, opt1, (int64_t)); \ -FN(32, 16, 16, 5, 4, opt1, (int64_t)); \ -FN(16, 32, 16, 4, 5, opt1, (int64_t)); \ -FN(16, 16, 16, 4, 4, opt1, (unsigned int)); \ -FN(16, 8, 16, 4, 3, opt1, (unsigned int)); \ -FN(8, 16, 8, 3, 4, opt1, (unsigned int)); \ -FN(8, 8, 8, 3, 3, opt1, (unsigned int)); \ -FN(8, 4, 8, 3, 2, opt1, (unsigned int)); \ -FN(4, 8, 4, 2, 3, opt2, (unsigned int)); \ -FN(4, 4, 4, 2, 2, opt2, (unsigned int)) - -FNS(sse2, sse); -FNS(ssse3, ssse3); - -#undef FNS -#undef FN - -// The 2 unused parameters are place holders for PIC enabled build. -#define DECL(w, opt) \ -int vp9_sub_pixel_avg_variance##w##xh_##opt(const uint8_t *src, \ - ptrdiff_t src_stride, \ - int x_offset, int y_offset, \ - const uint8_t *dst, \ - ptrdiff_t dst_stride, \ - const uint8_t *sec, \ - ptrdiff_t sec_stride, \ - int height, unsigned int *sse, \ - void *unused0, void *unused) -#define DECLS(opt1, opt2) \ -DECL(4, opt2); \ -DECL(8, opt1); \ -DECL(16, opt1) - -DECLS(sse2, sse); -DECLS(ssse3, ssse3); -#undef DECL -#undef DECLS - -#define FN(w, h, wf, wlog2, hlog2, opt, cast) \ -unsigned int vp9_sub_pixel_avg_variance##w##x##h##_##opt(const uint8_t *src, \ - int src_stride, \ - int x_offset, \ - int y_offset, \ - const uint8_t *dst, \ - int dst_stride, \ - unsigned int *sseptr, \ - const uint8_t *sec) { \ - unsigned int sse; \ - int se = vp9_sub_pixel_avg_variance##wf##xh_##opt(src, src_stride, x_offset, \ - y_offset, dst, dst_stride, \ - sec, w, h, &sse, NULL, \ - NULL); \ - if (w > wf) { \ - unsigned int sse2; \ - int se2 = vp9_sub_pixel_avg_variance##wf##xh_##opt(src + 16, src_stride, \ - x_offset, y_offset, \ - dst + 16, dst_stride, \ - sec + 16, w, h, &sse2, \ - NULL, NULL); \ - se += se2; \ - sse += sse2; \ - if (w > wf * 2) { \ - se2 = vp9_sub_pixel_avg_variance##wf##xh_##opt(src + 32, src_stride, \ - x_offset, y_offset, \ - dst + 32, dst_stride, \ - sec + 32, w, h, &sse2, \ - NULL, NULL); \ - se += se2; \ - sse += sse2; \ - se2 = vp9_sub_pixel_avg_variance##wf##xh_##opt(src + 48, src_stride, \ - x_offset, y_offset, \ - dst + 48, dst_stride, \ - sec + 48, w, h, &sse2, \ - NULL, NULL); \ - se += se2; \ - sse += sse2; \ - } \ - } \ - *sseptr = sse; \ - return sse - ((cast se * se) >> (wlog2 + hlog2)); \ -} - -#define FNS(opt1, opt2) \ -FN(64, 64, 16, 6, 6, opt1, (int64_t)); \ -FN(64, 32, 16, 6, 5, opt1, (int64_t)); \ -FN(32, 64, 16, 5, 6, opt1, (int64_t)); \ -FN(32, 32, 16, 5, 5, opt1, (int64_t)); \ -FN(32, 16, 16, 5, 4, opt1, (int64_t)); \ -FN(16, 32, 16, 4, 5, opt1, (int64_t)); \ -FN(16, 16, 16, 4, 4, opt1, (unsigned int)); \ -FN(16, 8, 16, 4, 3, opt1, (unsigned int)); \ -FN(8, 16, 8, 3, 4, opt1, (unsigned int)); \ -FN(8, 8, 8, 3, 3, opt1, (unsigned int)); \ -FN(8, 4, 8, 3, 2, opt1, (unsigned int)); \ -FN(4, 8, 4, 2, 3, opt2, (unsigned int)); \ -FN(4, 4, 4, 2, 2, opt2, (unsigned int)) - -FNS(sse2, sse); -FNS(ssse3, ssse3); - -#undef FNS -#undef FN diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/vp9_common.mk gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/vp9_common.mk --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/vp9_common.mk 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/vp9_common.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,192 +0,0 @@ -## -## Copyright (c) 2010 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - -VP9_COMMON_SRCS-yes += vp9_common.mk -VP9_COMMON_SRCS-yes += vp9_iface_common.h -VP9_COMMON_SRCS-yes += common/vp9_ppflags.h -VP9_COMMON_SRCS-yes += common/vp9_alloccommon.c -VP9_COMMON_SRCS-yes += common/vp9_blockd.c -VP9_COMMON_SRCS-yes += common/vp9_convolve.c -VP9_COMMON_SRCS-yes += common/vp9_convolve.h -VP9_COMMON_SRCS-yes += common/vp9_debugmodes.c -VP9_COMMON_SRCS-yes += common/vp9_entropy.c -VP9_COMMON_SRCS-yes += common/vp9_entropymode.c -VP9_COMMON_SRCS-yes += common/vp9_entropymv.c -VP9_COMMON_SRCS-yes += common/vp9_filter.c -VP9_COMMON_SRCS-yes += common/vp9_filter.h -VP9_COMMON_SRCS-yes += common/vp9_frame_buffers.c -VP9_COMMON_SRCS-yes += common/vp9_frame_buffers.h -VP9_COMMON_SRCS-yes += common/vp9_idct.c -VP9_COMMON_SRCS-yes += common/vp9_alloccommon.h -VP9_COMMON_SRCS-yes += common/vp9_blockd.h -VP9_COMMON_SRCS-yes += common/vp9_common.h -VP9_COMMON_SRCS-yes += common/vp9_entropy.h -VP9_COMMON_SRCS-yes += common/vp9_entropymode.h -VP9_COMMON_SRCS-yes += common/vp9_entropymv.h -VP9_COMMON_SRCS-yes += common/vp9_enums.h -VP9_COMMON_SRCS-yes += common/vp9_idct.h -VP9_COMMON_SRCS-yes += common/vp9_loopfilter.h -VP9_COMMON_SRCS-yes += common/vp9_thread_common.h -VP9_COMMON_SRCS-yes += common/vp9_mv.h -VP9_COMMON_SRCS-yes += common/vp9_onyxc_int.h -VP9_COMMON_SRCS-yes += common/vp9_pred_common.h -VP9_COMMON_SRCS-yes += common/vp9_pred_common.c -VP9_COMMON_SRCS-yes += common/vp9_prob.h -VP9_COMMON_SRCS-yes += common/vp9_prob.c -VP9_COMMON_SRCS-yes += common/vp9_quant_common.h -VP9_COMMON_SRCS-yes += common/vp9_reconinter.h -VP9_COMMON_SRCS-yes += common/vp9_reconintra.h -VP9_COMMON_SRCS-yes += common/vp9_rtcd.c -VP9_COMMON_SRCS-yes += common/vp9_rtcd_defs.pl -VP9_COMMON_SRCS-yes += common/vp9_scale.h -VP9_COMMON_SRCS-yes += common/vp9_scale.c -VP9_COMMON_SRCS-yes += common/vp9_seg_common.h -VP9_COMMON_SRCS-yes += common/vp9_seg_common.c -VP9_COMMON_SRCS-yes += common/vp9_systemdependent.h -VP9_COMMON_SRCS-yes += common/vp9_textblit.h -VP9_COMMON_SRCS-yes += common/vp9_thread.h -VP9_COMMON_SRCS-yes += common/vp9_thread.c -VP9_COMMON_SRCS-yes += common/vp9_tile_common.h -VP9_COMMON_SRCS-yes += common/vp9_tile_common.c -VP9_COMMON_SRCS-yes += common/vp9_loopfilter.c -VP9_COMMON_SRCS-yes += common/vp9_loopfilter_filters.c -VP9_COMMON_SRCS-yes += common/vp9_thread_common.c -VP9_COMMON_SRCS-yes += common/vp9_mvref_common.c -VP9_COMMON_SRCS-yes += common/vp9_mvref_common.h -VP9_COMMON_SRCS-yes += common/vp9_quant_common.c -VP9_COMMON_SRCS-yes += common/vp9_reconinter.c -VP9_COMMON_SRCS-yes += common/vp9_reconintra.c -VP9_COMMON_SRCS-$(CONFIG_POSTPROC_VISUALIZER) += common/vp9_textblit.c -VP9_COMMON_SRCS-yes += common/vp9_common_data.c -VP9_COMMON_SRCS-yes += common/vp9_common_data.h -VP9_COMMON_SRCS-yes += common/vp9_scan.c -VP9_COMMON_SRCS-yes += common/vp9_scan.h - -VP9_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/vp9_asm_stubs.c -VP9_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/vp9_loopfilter_intrin_sse2.c -VP9_COMMON_SRCS-$(HAVE_AVX2) += common/x86/vp9_loopfilter_intrin_avx2.c -VP9_COMMON_SRCS-$(CONFIG_VP9_POSTPROC) += common/vp9_postproc.h -VP9_COMMON_SRCS-$(CONFIG_VP9_POSTPROC) += common/vp9_postproc.c -VP9_COMMON_SRCS-$(CONFIG_VP9_POSTPROC) += common/vp9_mfqe.h -VP9_COMMON_SRCS-$(CONFIG_VP9_POSTPROC) += common/vp9_mfqe.c -VP9_COMMON_SRCS-$(HAVE_MMX) += common/x86/vp9_loopfilter_mmx.asm -VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_subpixel_8t_sse2.asm -VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_subpixel_bilinear_sse2.asm -VP9_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/vp9_subpixel_8t_ssse3.asm -VP9_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/vp9_subpixel_bilinear_ssse3.asm -VP9_COMMON_SRCS-$(HAVE_AVX2) += common/x86/vp9_subpixel_8t_intrin_avx2.c -VP9_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/vp9_subpixel_8t_intrin_ssse3.c -ifeq ($(CONFIG_VP9_POSTPROC),yes) -VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_mfqe_sse2.asm -VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_postproc_sse2.asm -endif - -ifeq ($(CONFIG_USE_X86INC),yes) -VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_copy_sse2.asm -VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_intrapred_sse2.asm -VP9_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/vp9_intrapred_ssse3.asm -endif - -ifeq ($(CONFIG_VP9_HIGHBITDEPTH),yes) -VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_high_intrapred_sse2.asm -VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_high_subpixel_8t_sse2.asm -VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_high_subpixel_bilinear_sse2.asm -VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_high_loopfilter_intrin_sse2.c -endif - -# common (c) -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_common_dspr2.h -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve2_avg_dspr2.c -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve2_avg_horiz_dspr2.c -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve2_dspr2.c -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve2_horiz_dspr2.c -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve2_vert_dspr2.c -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve8_avg_dspr2.c -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve8_avg_horiz_dspr2.c -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve8_dspr2.c -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve8_horiz_dspr2.c -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve8_vert_dspr2.c -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_intrapred4_dspr2.c -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_intrapred8_dspr2.c -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_intrapred16_dspr2.c -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_itrans4_dspr2.c -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_itrans8_dspr2.c -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_itrans16_dspr2.c -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_itrans32_cols_dspr2.c -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_itrans32_dspr2.c -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_loopfilter_filters_dspr2.c -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_loopfilter_filters_dspr2.h -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_loopfilter_macros_dspr2.h -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_loopfilter_masks_dspr2.h -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_mbloop_loopfilter_dspr2.c -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_mblpf_horiz_loopfilter_dspr2.c -VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_mblpf_vert_loopfilter_dspr2.c - -VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_idct_intrin_sse2.c -VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_idct_intrin_sse2.h -VP9_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/vp9_idct_intrin_ssse3.c -ifeq ($(ARCH_X86_64), yes) -VP9_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/vp9_idct_ssse3_x86_64.asm -endif - -VP9_COMMON_SRCS-$(HAVE_NEON_ASM) += common/arm/neon/vp9_loopfilter_16_neon_asm$(ASM) -VP9_COMMON_SRCS-$(HAVE_NEON_ASM) += common/arm/neon/vp9_loopfilter_8_neon_asm$(ASM) -VP9_COMMON_SRCS-$(HAVE_NEON_ASM) += common/arm/neon/vp9_mb_lpf_neon$(ASM) -VP9_COMMON_SRCS-$(HAVE_NEON_ASM) += common/arm/neon/vp9_save_reg_neon$(ASM) - -VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_iht4x4_add_neon.c -VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_iht8x8_add_neon.c -VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_loopfilter_neon.c - -# neon with assembly and intrinsics implementations. If both are available -# prefer assembly. -ifeq ($(HAVE_NEON_ASM), yes) -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_avg_neon_asm$(ASM) -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_convolve8_avg_neon_asm$(ASM) -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_convolve8_neon_asm$(ASM) -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_convolve_neon.c -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_copy_neon_asm$(ASM) -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct16x16_1_add_neon_asm$(ASM) -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct16x16_add_neon_asm$(ASM) -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct16x16_neon.c -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct32x32_1_add_neon_asm$(ASM) -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct32x32_add_neon_asm$(ASM) -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct4x4_1_add_neon_asm$(ASM) -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct4x4_add_neon_asm$(ASM) -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct8x8_1_add_neon_asm$(ASM) -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct8x8_add_neon_asm$(ASM) -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_loopfilter_4_neon_asm$(ASM) -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_reconintra_neon_asm$(ASM) -else -ifeq ($(HAVE_NEON), yes) -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_avg_neon.c -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_convolve8_avg_neon.c -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_convolve8_neon.c -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_convolve_neon.c -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_copy_neon.c -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct16x16_1_add_neon.c -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct16x16_add_neon.c -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct16x16_neon.c -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct32x32_1_add_neon.c -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct32x32_add_neon.c -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct4x4_1_add_neon.c -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct4x4_add_neon.c -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct8x8_1_add_neon.c -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct8x8_add_neon.c -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_loopfilter_16_neon.c -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_loopfilter_4_neon.c -# TODO(johannkoenig): re-enable when chromium build is fixed -# # https://code.google.com/p/chromium/issues/detail?id=443839 -#VP9_COMMON_SRCS-yes += common/arm/neon/vp9_loopfilter_8_neon.c -VP9_COMMON_SRCS-yes += common/arm/neon/vp9_reconintra_neon.c -endif # HAVE_NEON -endif # HAVE_NEON_ASM - -$(eval $(call rtcd_h_template,vp9_rtcd,vp9/common/vp9_rtcd_defs.pl)) diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/vp9_cx_iface.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/vp9_cx_iface.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/vp9_cx_iface.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/vp9_cx_iface.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1516 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vpx_config.h" -#include "vpx/vpx_encoder.h" -#include "vpx_ports/vpx_once.h" -#include "vpx/internal/vpx_codec_internal.h" -#include "./vpx_version.h" -#include "vp9/encoder/vp9_encoder.h" -#include "vpx/vp8cx.h" -#include "vp9/encoder/vp9_firstpass.h" -#include "vp9/vp9_iface_common.h" - -struct vp9_extracfg { - int cpu_used; // available cpu percentage in 1/16 - unsigned int enable_auto_alt_ref; - unsigned int noise_sensitivity; - unsigned int sharpness; - unsigned int static_thresh; - unsigned int tile_columns; - unsigned int tile_rows; - unsigned int arnr_max_frames; - unsigned int arnr_strength; - vp8e_tuning tuning; - unsigned int cq_level; // constrained quality level - unsigned int rc_max_intra_bitrate_pct; - unsigned int rc_max_inter_bitrate_pct; - unsigned int gf_cbr_boost_pct; - unsigned int lossless; - unsigned int frame_parallel_decoding_mode; - AQ_MODE aq_mode; - unsigned int frame_periodic_boost; - vpx_bit_depth_t bit_depth; - vp9e_tune_content content; - vpx_color_space_t color_space; -}; - -static struct vp9_extracfg default_extra_cfg = { - 0, // cpu_used - 1, // enable_auto_alt_ref - 0, // noise_sensitivity - 0, // sharpness - 0, // static_thresh - 6, // tile_columns - 0, // tile_rows - 7, // arnr_max_frames - 5, // arnr_strength - VP8_TUNE_PSNR, // tuning - 10, // cq_level - 0, // rc_max_intra_bitrate_pct - 0, // rc_max_inter_bitrate_pct - 0, // gf_cbr_boost_pct - 0, // lossless - 1, // frame_parallel_decoding_mode - NO_AQ, // aq_mode - 0, // frame_periodic_delta_q - VPX_BITS_8, // Bit depth - VP9E_CONTENT_DEFAULT, // content - VPX_CS_UNKNOWN, // color space -}; - -struct vpx_codec_alg_priv { - vpx_codec_priv_t base; - vpx_codec_enc_cfg_t cfg; - struct vp9_extracfg extra_cfg; - VP9EncoderConfig oxcf; - VP9_COMP *cpi; - unsigned char *cx_data; - size_t cx_data_sz; - unsigned char *pending_cx_data; - size_t pending_cx_data_sz; - int pending_frame_count; - size_t pending_frame_sizes[8]; - size_t pending_frame_magnitude; - vpx_image_t preview_img; - vpx_enc_frame_flags_t next_frame_flags; - vp8_postproc_cfg_t preview_ppcfg; - vpx_codec_pkt_list_decl(256) pkt_list; - unsigned int fixed_kf_cntr; - vpx_codec_priv_output_cx_pkt_cb_pair_t output_cx_pkt_cb; - // BufferPool that holds all reference frames. - BufferPool *buffer_pool; -}; - -static VP9_REFFRAME ref_frame_to_vp9_reframe(vpx_ref_frame_type_t frame) { - switch (frame) { - case VP8_LAST_FRAME: - return VP9_LAST_FLAG; - case VP8_GOLD_FRAME: - return VP9_GOLD_FLAG; - case VP8_ALTR_FRAME: - return VP9_ALT_FLAG; - } - assert(0 && "Invalid Reference Frame"); - return VP9_LAST_FLAG; -} - -static vpx_codec_err_t update_error_state(vpx_codec_alg_priv_t *ctx, - const struct vpx_internal_error_info *error) { - const vpx_codec_err_t res = error->error_code; - - if (res != VPX_CODEC_OK) - ctx->base.err_detail = error->has_detail ? error->detail : NULL; - - return res; -} - - -#undef ERROR -#define ERROR(str) do {\ - ctx->base.err_detail = str;\ - return VPX_CODEC_INVALID_PARAM;\ - } while (0) - -#define RANGE_CHECK(p, memb, lo, hi) do {\ - if (!(((p)->memb == lo || (p)->memb > (lo)) && (p)->memb <= hi)) \ - ERROR(#memb " out of range ["#lo".."#hi"]");\ - } while (0) - -#define RANGE_CHECK_HI(p, memb, hi) do {\ - if (!((p)->memb <= (hi))) \ - ERROR(#memb " out of range [.."#hi"]");\ - } while (0) - -#define RANGE_CHECK_LO(p, memb, lo) do {\ - if (!((p)->memb >= (lo))) \ - ERROR(#memb " out of range ["#lo"..]");\ - } while (0) - -#define RANGE_CHECK_BOOL(p, memb) do {\ - if (!!((p)->memb) != (p)->memb) ERROR(#memb " expected boolean");\ - } while (0) - -static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx, - const vpx_codec_enc_cfg_t *cfg, - const struct vp9_extracfg *extra_cfg) { - RANGE_CHECK(cfg, g_w, 1, 65535); // 16 bits available - RANGE_CHECK(cfg, g_h, 1, 65535); // 16 bits available - RANGE_CHECK(cfg, g_timebase.den, 1, 1000000000); - RANGE_CHECK(cfg, g_timebase.num, 1, cfg->g_timebase.den); - RANGE_CHECK_HI(cfg, g_profile, 3); - - RANGE_CHECK_HI(cfg, rc_max_quantizer, 63); - RANGE_CHECK_HI(cfg, rc_min_quantizer, cfg->rc_max_quantizer); - RANGE_CHECK_BOOL(extra_cfg, lossless); - RANGE_CHECK(extra_cfg, aq_mode, 0, AQ_MODE_COUNT - 1); - RANGE_CHECK(extra_cfg, frame_periodic_boost, 0, 1); - RANGE_CHECK_HI(cfg, g_threads, 64); - RANGE_CHECK_HI(cfg, g_lag_in_frames, MAX_LAG_BUFFERS); - RANGE_CHECK(cfg, rc_end_usage, VPX_VBR, VPX_Q); - RANGE_CHECK_HI(cfg, rc_undershoot_pct, 100); - RANGE_CHECK_HI(cfg, rc_overshoot_pct, 100); - RANGE_CHECK_HI(cfg, rc_2pass_vbr_bias_pct, 100); - RANGE_CHECK(cfg, kf_mode, VPX_KF_DISABLED, VPX_KF_AUTO); - RANGE_CHECK_BOOL(cfg, rc_resize_allowed); - RANGE_CHECK_HI(cfg, rc_dropframe_thresh, 100); - RANGE_CHECK_HI(cfg, rc_resize_up_thresh, 100); - RANGE_CHECK_HI(cfg, rc_resize_down_thresh, 100); - RANGE_CHECK(cfg, g_pass, VPX_RC_ONE_PASS, VPX_RC_LAST_PASS); - - if (cfg->rc_resize_allowed == 1) { - RANGE_CHECK(cfg, rc_scaled_width, 0, cfg->g_w); - RANGE_CHECK(cfg, rc_scaled_height, 0, cfg->g_h); - } - - RANGE_CHECK(cfg, ss_number_layers, 1, VPX_SS_MAX_LAYERS); - RANGE_CHECK(cfg, ts_number_layers, 1, VPX_TS_MAX_LAYERS); - - if (cfg->ts_number_layers > 1) { - unsigned int i; - for (i = 1; i < cfg->ts_number_layers; ++i) - if (cfg->ts_target_bitrate[i] < cfg->ts_target_bitrate[i - 1]) - ERROR("ts_target_bitrate entries are not increasing"); - - RANGE_CHECK(cfg, ts_rate_decimator[cfg->ts_number_layers - 1], 1, 1); - for (i = cfg->ts_number_layers - 2; i > 0; --i) - if (cfg->ts_rate_decimator[i - 1] != 2 * cfg->ts_rate_decimator[i]) - ERROR("ts_rate_decimator factors are not powers of 2"); - } - -#if CONFIG_SPATIAL_SVC - - if ((cfg->ss_number_layers > 1 || cfg->ts_number_layers > 1) && - cfg->g_pass == VPX_RC_LAST_PASS) { - unsigned int i, alt_ref_sum = 0; - for (i = 0; i < cfg->ss_number_layers; ++i) { - if (cfg->ss_enable_auto_alt_ref[i]) - ++alt_ref_sum; - } - if (alt_ref_sum > REF_FRAMES - cfg->ss_number_layers) - ERROR("Not enough ref buffers for svc alt ref frames"); - if (cfg->ss_number_layers * cfg->ts_number_layers > 3 && - cfg->g_error_resilient == 0) - ERROR("Multiple frame context are not supported for more than 3 layers"); - } -#endif - - // VP9 does not support a lower bound on the keyframe interval in - // automatic keyframe placement mode. - if (cfg->kf_mode != VPX_KF_DISABLED && - cfg->kf_min_dist != cfg->kf_max_dist && - cfg->kf_min_dist > 0) - ERROR("kf_min_dist not supported in auto mode, use 0 " - "or kf_max_dist instead."); - - RANGE_CHECK(extra_cfg, enable_auto_alt_ref, 0, 2); - RANGE_CHECK(extra_cfg, cpu_used, -8, 8); - RANGE_CHECK_HI(extra_cfg, noise_sensitivity, 6); - RANGE_CHECK(extra_cfg, tile_columns, 0, 6); - RANGE_CHECK(extra_cfg, tile_rows, 0, 2); - RANGE_CHECK_HI(extra_cfg, sharpness, 7); - RANGE_CHECK(extra_cfg, arnr_max_frames, 0, 15); - RANGE_CHECK_HI(extra_cfg, arnr_strength, 6); - RANGE_CHECK(extra_cfg, cq_level, 0, 63); - RANGE_CHECK(cfg, g_bit_depth, VPX_BITS_8, VPX_BITS_12); - RANGE_CHECK(cfg, g_input_bit_depth, 8, 12); - RANGE_CHECK(extra_cfg, content, - VP9E_CONTENT_DEFAULT, VP9E_CONTENT_INVALID - 1); - - // TODO(yaowu): remove this when ssim tuning is implemented for vp9 - if (extra_cfg->tuning == VP8_TUNE_SSIM) - ERROR("Option --tune=ssim is not currently supported in VP9."); - - if (cfg->g_pass == VPX_RC_LAST_PASS) { - const size_t packet_sz = sizeof(FIRSTPASS_STATS); - const int n_packets = (int)(cfg->rc_twopass_stats_in.sz / packet_sz); - const FIRSTPASS_STATS *stats; - - if (cfg->rc_twopass_stats_in.buf == NULL) - ERROR("rc_twopass_stats_in.buf not set."); - - if (cfg->rc_twopass_stats_in.sz % packet_sz) - ERROR("rc_twopass_stats_in.sz indicates truncated packet."); - - if (cfg->ss_number_layers > 1 || cfg->ts_number_layers > 1) { - int i; - unsigned int n_packets_per_layer[VPX_SS_MAX_LAYERS] = {0}; - - stats = cfg->rc_twopass_stats_in.buf; - for (i = 0; i < n_packets; ++i) { - const int layer_id = (int)stats[i].spatial_layer_id; - if (layer_id >= 0 && layer_id < (int)cfg->ss_number_layers) { - ++n_packets_per_layer[layer_id]; - } - } - - for (i = 0; i < (int)cfg->ss_number_layers; ++i) { - unsigned int layer_id; - if (n_packets_per_layer[i] < 2) { - ERROR("rc_twopass_stats_in requires at least two packets for each " - "layer."); - } - - stats = (const FIRSTPASS_STATS *)cfg->rc_twopass_stats_in.buf + - n_packets - cfg->ss_number_layers + i; - layer_id = (int)stats->spatial_layer_id; - - if (layer_id >= cfg->ss_number_layers - ||(unsigned int)(stats->count + 0.5) != - n_packets_per_layer[layer_id] - 1) - ERROR("rc_twopass_stats_in missing EOS stats packet"); - } - } else { - if (cfg->rc_twopass_stats_in.sz < 2 * packet_sz) - ERROR("rc_twopass_stats_in requires at least two packets."); - - stats = - (const FIRSTPASS_STATS *)cfg->rc_twopass_stats_in.buf + n_packets - 1; - - if ((int)(stats->count + 0.5) != n_packets - 1) - ERROR("rc_twopass_stats_in missing EOS stats packet"); - } - } - -#if !CONFIG_VP9_HIGHBITDEPTH - if (cfg->g_profile > (unsigned int)PROFILE_1) { - ERROR("Profile > 1 not supported in this build configuration"); - } -#endif - if (cfg->g_profile <= (unsigned int)PROFILE_1 && - cfg->g_bit_depth > VPX_BITS_8) { - ERROR("Codec high bit-depth not supported in profile < 2"); - } - if (cfg->g_profile <= (unsigned int)PROFILE_1 && - cfg->g_input_bit_depth > 8) { - ERROR("Source high bit-depth not supported in profile < 2"); - } - if (cfg->g_profile > (unsigned int)PROFILE_1 && - cfg->g_bit_depth == VPX_BITS_8) { - ERROR("Codec bit-depth 8 not supported in profile > 1"); - } - RANGE_CHECK(extra_cfg, color_space, VPX_CS_UNKNOWN, VPX_CS_SRGB); - return VPX_CODEC_OK; -} - -static vpx_codec_err_t validate_img(vpx_codec_alg_priv_t *ctx, - const vpx_image_t *img) { - switch (img->fmt) { - case VPX_IMG_FMT_YV12: - case VPX_IMG_FMT_I420: - case VPX_IMG_FMT_I42016: - break; - case VPX_IMG_FMT_I422: - case VPX_IMG_FMT_I444: - case VPX_IMG_FMT_I440: - if (ctx->cfg.g_profile != (unsigned int)PROFILE_1) { - ERROR("Invalid image format. I422, I444, I440 images are " - "not supported in profile."); - } - break; - case VPX_IMG_FMT_I42216: - case VPX_IMG_FMT_I44416: - case VPX_IMG_FMT_I44016: - if (ctx->cfg.g_profile != (unsigned int)PROFILE_1 && - ctx->cfg.g_profile != (unsigned int)PROFILE_3) { - ERROR("Invalid image format. 16-bit I422, I444, I440 images are " - "not supported in profile."); - } - break; - default: - ERROR("Invalid image format. Only YV12, I420, I422, I444 images are " - "supported."); - break; - } - - if (img->d_w != ctx->cfg.g_w || img->d_h != ctx->cfg.g_h) - ERROR("Image size must match encoder init configuration size"); - - return VPX_CODEC_OK; -} - -static int get_image_bps(const vpx_image_t *img) { - switch (img->fmt) { - case VPX_IMG_FMT_YV12: - case VPX_IMG_FMT_I420: return 12; - case VPX_IMG_FMT_I422: return 16; - case VPX_IMG_FMT_I444: return 24; - case VPX_IMG_FMT_I440: return 16; - case VPX_IMG_FMT_I42016: return 24; - case VPX_IMG_FMT_I42216: return 32; - case VPX_IMG_FMT_I44416: return 48; - case VPX_IMG_FMT_I44016: return 32; - default: assert(0 && "Invalid image format"); break; - } - return 0; -} - -static vpx_codec_err_t set_encoder_config( - VP9EncoderConfig *oxcf, - const vpx_codec_enc_cfg_t *cfg, - const struct vp9_extracfg *extra_cfg) { - const int is_vbr = cfg->rc_end_usage == VPX_VBR; - oxcf->profile = cfg->g_profile; - oxcf->max_threads = (int)cfg->g_threads; - oxcf->width = cfg->g_w; - oxcf->height = cfg->g_h; - oxcf->bit_depth = cfg->g_bit_depth; - oxcf->input_bit_depth = cfg->g_input_bit_depth; - // guess a frame rate if out of whack, use 30 - oxcf->init_framerate = (double)cfg->g_timebase.den / cfg->g_timebase.num; - if (oxcf->init_framerate > 180) - oxcf->init_framerate = 30; - - oxcf->mode = GOOD; - - switch (cfg->g_pass) { - case VPX_RC_ONE_PASS: - oxcf->pass = 0; - break; - case VPX_RC_FIRST_PASS: - oxcf->pass = 1; - break; - case VPX_RC_LAST_PASS: - oxcf->pass = 2; - break; - } - - oxcf->lag_in_frames = cfg->g_pass == VPX_RC_FIRST_PASS ? 0 - : cfg->g_lag_in_frames; - oxcf->rc_mode = cfg->rc_end_usage; - - // Convert target bandwidth from Kbit/s to Bit/s - oxcf->target_bandwidth = 1000 * cfg->rc_target_bitrate; - oxcf->rc_max_intra_bitrate_pct = extra_cfg->rc_max_intra_bitrate_pct; - oxcf->rc_max_inter_bitrate_pct = extra_cfg->rc_max_inter_bitrate_pct; - oxcf->gf_cbr_boost_pct = extra_cfg->gf_cbr_boost_pct; - - oxcf->best_allowed_q = - extra_cfg->lossless ? 0 : vp9_quantizer_to_qindex(cfg->rc_min_quantizer); - oxcf->worst_allowed_q = - extra_cfg->lossless ? 0 : vp9_quantizer_to_qindex(cfg->rc_max_quantizer); - oxcf->cq_level = vp9_quantizer_to_qindex(extra_cfg->cq_level); - oxcf->fixed_q = -1; - - oxcf->under_shoot_pct = cfg->rc_undershoot_pct; - oxcf->over_shoot_pct = cfg->rc_overshoot_pct; - - oxcf->scaled_frame_width = cfg->rc_scaled_width; - oxcf->scaled_frame_height = cfg->rc_scaled_height; - if (cfg->rc_resize_allowed == 1) { - oxcf->resize_mode = - (oxcf->scaled_frame_width == 0 || oxcf->scaled_frame_height == 0) ? - RESIZE_DYNAMIC : RESIZE_FIXED; - } else { - oxcf->resize_mode = RESIZE_NONE; - } - - oxcf->maximum_buffer_size_ms = is_vbr ? 240000 : cfg->rc_buf_sz; - oxcf->starting_buffer_level_ms = is_vbr ? 60000 : cfg->rc_buf_initial_sz; - oxcf->optimal_buffer_level_ms = is_vbr ? 60000 : cfg->rc_buf_optimal_sz; - - oxcf->drop_frames_water_mark = cfg->rc_dropframe_thresh; - - oxcf->two_pass_vbrbias = cfg->rc_2pass_vbr_bias_pct; - oxcf->two_pass_vbrmin_section = cfg->rc_2pass_vbr_minsection_pct; - oxcf->two_pass_vbrmax_section = cfg->rc_2pass_vbr_maxsection_pct; - - oxcf->auto_key = cfg->kf_mode == VPX_KF_AUTO && - cfg->kf_min_dist != cfg->kf_max_dist; - - oxcf->key_freq = cfg->kf_max_dist; - - oxcf->speed = abs(extra_cfg->cpu_used); - oxcf->encode_breakout = extra_cfg->static_thresh; - oxcf->enable_auto_arf = extra_cfg->enable_auto_alt_ref; - oxcf->noise_sensitivity = extra_cfg->noise_sensitivity; - oxcf->sharpness = extra_cfg->sharpness; - - oxcf->two_pass_stats_in = cfg->rc_twopass_stats_in; - -#if CONFIG_FP_MB_STATS - oxcf->firstpass_mb_stats_in = cfg->rc_firstpass_mb_stats_in; -#endif - - oxcf->color_space = extra_cfg->color_space; - oxcf->arnr_max_frames = extra_cfg->arnr_max_frames; - oxcf->arnr_strength = extra_cfg->arnr_strength; - - oxcf->tuning = extra_cfg->tuning; - oxcf->content = extra_cfg->content; - - oxcf->tile_columns = extra_cfg->tile_columns; - oxcf->tile_rows = extra_cfg->tile_rows; - - oxcf->error_resilient_mode = cfg->g_error_resilient; - oxcf->frame_parallel_decoding_mode = extra_cfg->frame_parallel_decoding_mode; - - oxcf->aq_mode = extra_cfg->aq_mode; - - oxcf->frame_periodic_boost = extra_cfg->frame_periodic_boost; - - oxcf->ss_number_layers = cfg->ss_number_layers; - - if (oxcf->ss_number_layers > 1) { - int i; - for (i = 0; i < VPX_SS_MAX_LAYERS; ++i) { - oxcf->ss_target_bitrate[i] = 1000 * cfg->ss_target_bitrate[i]; -#if CONFIG_SPATIAL_SVC - oxcf->ss_enable_auto_arf[i] = cfg->ss_enable_auto_alt_ref[i]; -#endif - } - } else if (oxcf->ss_number_layers == 1) { - oxcf->ss_target_bitrate[0] = (int)oxcf->target_bandwidth; -#if CONFIG_SPATIAL_SVC - oxcf->ss_enable_auto_arf[0] = extra_cfg->enable_auto_alt_ref; -#endif - } - - oxcf->ts_number_layers = cfg->ts_number_layers; - - if (oxcf->ts_number_layers > 1) { - int i; - for (i = 0; i < VPX_TS_MAX_LAYERS; ++i) { - oxcf->ts_target_bitrate[i] = 1000 * cfg->ts_target_bitrate[i]; - oxcf->ts_rate_decimator[i] = cfg->ts_rate_decimator[i]; - } - } else if (oxcf->ts_number_layers == 1) { - oxcf->ts_target_bitrate[0] = (int)oxcf->target_bandwidth; - oxcf->ts_rate_decimator[0] = 1; - } - - /* - printf("Current VP9 Settings: \n"); - printf("target_bandwidth: %d\n", oxcf->target_bandwidth); - printf("noise_sensitivity: %d\n", oxcf->noise_sensitivity); - printf("sharpness: %d\n", oxcf->sharpness); - printf("cpu_used: %d\n", oxcf->cpu_used); - printf("Mode: %d\n", oxcf->mode); - printf("auto_key: %d\n", oxcf->auto_key); - printf("key_freq: %d\n", oxcf->key_freq); - printf("end_usage: %d\n", oxcf->end_usage); - printf("under_shoot_pct: %d\n", oxcf->under_shoot_pct); - printf("over_shoot_pct: %d\n", oxcf->over_shoot_pct); - printf("starting_buffer_level: %d\n", oxcf->starting_buffer_level); - printf("optimal_buffer_level: %d\n", oxcf->optimal_buffer_level); - printf("maximum_buffer_size: %d\n", oxcf->maximum_buffer_size); - printf("fixed_q: %d\n", oxcf->fixed_q); - printf("worst_allowed_q: %d\n", oxcf->worst_allowed_q); - printf("best_allowed_q: %d\n", oxcf->best_allowed_q); - printf("allow_spatial_resampling: %d\n", oxcf->allow_spatial_resampling); - printf("scaled_frame_width: %d\n", oxcf->scaled_frame_width); - printf("scaled_frame_height: %d\n", oxcf->scaled_frame_height); - printf("two_pass_vbrbias: %d\n", oxcf->two_pass_vbrbias); - printf("two_pass_vbrmin_section: %d\n", oxcf->two_pass_vbrmin_section); - printf("two_pass_vbrmax_section: %d\n", oxcf->two_pass_vbrmax_section); - printf("lag_in_frames: %d\n", oxcf->lag_in_frames); - printf("enable_auto_arf: %d\n", oxcf->enable_auto_arf); - printf("Version: %d\n", oxcf->Version); - printf("encode_breakout: %d\n", oxcf->encode_breakout); - printf("error resilient: %d\n", oxcf->error_resilient_mode); - printf("frame parallel detokenization: %d\n", - oxcf->frame_parallel_decoding_mode); - */ - return VPX_CODEC_OK; -} - -static vpx_codec_err_t encoder_set_config(vpx_codec_alg_priv_t *ctx, - const vpx_codec_enc_cfg_t *cfg) { - vpx_codec_err_t res; - int force_key = 0; - - if (cfg->g_w != ctx->cfg.g_w || cfg->g_h != ctx->cfg.g_h) { - if (cfg->g_lag_in_frames > 1 || cfg->g_pass != VPX_RC_ONE_PASS) - ERROR("Cannot change width or height after initialization"); - if (!valid_ref_frame_size(ctx->cfg.g_w, ctx->cfg.g_h, cfg->g_w, cfg->g_h) || - (ctx->cpi->initial_width && (int)cfg->g_w > ctx->cpi->initial_width) || - (ctx->cpi->initial_height && (int)cfg->g_h > ctx->cpi->initial_height)) - force_key = 1; - } - - // Prevent increasing lag_in_frames. This check is stricter than it needs - // to be -- the limit is not increasing past the first lag_in_frames - // value, but we don't track the initial config, only the last successful - // config. - if (cfg->g_lag_in_frames > ctx->cfg.g_lag_in_frames) - ERROR("Cannot increase lag_in_frames"); - - res = validate_config(ctx, cfg, &ctx->extra_cfg); - - if (res == VPX_CODEC_OK) { - ctx->cfg = *cfg; - set_encoder_config(&ctx->oxcf, &ctx->cfg, &ctx->extra_cfg); - // On profile change, request a key frame - force_key |= ctx->cpi->common.profile != ctx->oxcf.profile; - vp9_change_config(ctx->cpi, &ctx->oxcf); - } - - if (force_key) - ctx->next_frame_flags |= VPX_EFLAG_FORCE_KF; - - return res; -} - -static vpx_codec_err_t ctrl_get_quantizer(vpx_codec_alg_priv_t *ctx, - va_list args) { - int *const arg = va_arg(args, int *); - if (arg == NULL) - return VPX_CODEC_INVALID_PARAM; - *arg = vp9_get_quantizer(ctx->cpi); - return VPX_CODEC_OK; -} - -static vpx_codec_err_t ctrl_get_quantizer64(vpx_codec_alg_priv_t *ctx, - va_list args) { - int *const arg = va_arg(args, int *); - if (arg == NULL) - return VPX_CODEC_INVALID_PARAM; - *arg = vp9_qindex_to_quantizer(vp9_get_quantizer(ctx->cpi)); - return VPX_CODEC_OK; -} - -static vpx_codec_err_t update_extra_cfg(vpx_codec_alg_priv_t *ctx, - const struct vp9_extracfg *extra_cfg) { - const vpx_codec_err_t res = validate_config(ctx, &ctx->cfg, extra_cfg); - if (res == VPX_CODEC_OK) { - ctx->extra_cfg = *extra_cfg; - set_encoder_config(&ctx->oxcf, &ctx->cfg, &ctx->extra_cfg); - vp9_change_config(ctx->cpi, &ctx->oxcf); - } - return res; -} - -static vpx_codec_err_t ctrl_set_cpuused(vpx_codec_alg_priv_t *ctx, - va_list args) { - struct vp9_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.cpu_used = CAST(VP8E_SET_CPUUSED, args); - return update_extra_cfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t ctrl_set_enable_auto_alt_ref(vpx_codec_alg_priv_t *ctx, - va_list args) { - struct vp9_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.enable_auto_alt_ref = CAST(VP8E_SET_ENABLEAUTOALTREF, args); - return update_extra_cfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t ctrl_set_noise_sensitivity(vpx_codec_alg_priv_t *ctx, - va_list args) { - struct vp9_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.noise_sensitivity = CAST(VP9E_SET_NOISE_SENSITIVITY, args); - return update_extra_cfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t ctrl_set_sharpness(vpx_codec_alg_priv_t *ctx, - va_list args) { - struct vp9_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.sharpness = CAST(VP8E_SET_SHARPNESS, args); - return update_extra_cfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t ctrl_set_static_thresh(vpx_codec_alg_priv_t *ctx, - va_list args) { - struct vp9_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.static_thresh = CAST(VP8E_SET_STATIC_THRESHOLD, args); - return update_extra_cfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t ctrl_set_tile_columns(vpx_codec_alg_priv_t *ctx, - va_list args) { - struct vp9_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.tile_columns = CAST(VP9E_SET_TILE_COLUMNS, args); - return update_extra_cfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t ctrl_set_tile_rows(vpx_codec_alg_priv_t *ctx, - va_list args) { - struct vp9_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.tile_rows = CAST(VP9E_SET_TILE_ROWS, args); - return update_extra_cfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t ctrl_set_arnr_max_frames(vpx_codec_alg_priv_t *ctx, - va_list args) { - struct vp9_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.arnr_max_frames = CAST(VP8E_SET_ARNR_MAXFRAMES, args); - return update_extra_cfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t ctrl_set_arnr_strength(vpx_codec_alg_priv_t *ctx, - va_list args) { - struct vp9_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.arnr_strength = CAST(VP8E_SET_ARNR_STRENGTH, args); - return update_extra_cfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t ctrl_set_arnr_type(vpx_codec_alg_priv_t *ctx, - va_list args) { - (void)ctx; - (void)args; - return VPX_CODEC_OK; -} - -static vpx_codec_err_t ctrl_set_tuning(vpx_codec_alg_priv_t *ctx, - va_list args) { - struct vp9_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.tuning = CAST(VP8E_SET_TUNING, args); - return update_extra_cfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t ctrl_set_cq_level(vpx_codec_alg_priv_t *ctx, - va_list args) { - struct vp9_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.cq_level = CAST(VP8E_SET_CQ_LEVEL, args); - return update_extra_cfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t ctrl_set_rc_max_intra_bitrate_pct( - vpx_codec_alg_priv_t *ctx, va_list args) { - struct vp9_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.rc_max_intra_bitrate_pct = - CAST(VP8E_SET_MAX_INTRA_BITRATE_PCT, args); - return update_extra_cfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t ctrl_set_rc_max_inter_bitrate_pct( - vpx_codec_alg_priv_t *ctx, va_list args) { - struct vp9_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.rc_max_inter_bitrate_pct = - CAST(VP8E_SET_MAX_INTER_BITRATE_PCT, args); - return update_extra_cfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t ctrl_set_rc_gf_cbr_boost_pct( - vpx_codec_alg_priv_t *ctx, va_list args) { - struct vp9_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.gf_cbr_boost_pct = - CAST(VP9E_SET_GF_CBR_BOOST_PCT, args); - return update_extra_cfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t ctrl_set_lossless(vpx_codec_alg_priv_t *ctx, - va_list args) { - struct vp9_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.lossless = CAST(VP9E_SET_LOSSLESS, args); - return update_extra_cfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t ctrl_set_frame_parallel_decoding_mode( - vpx_codec_alg_priv_t *ctx, va_list args) { - struct vp9_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.frame_parallel_decoding_mode = - CAST(VP9E_SET_FRAME_PARALLEL_DECODING, args); - return update_extra_cfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t ctrl_set_aq_mode(vpx_codec_alg_priv_t *ctx, - va_list args) { - struct vp9_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.aq_mode = CAST(VP9E_SET_AQ_MODE, args); - return update_extra_cfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t ctrl_set_frame_periodic_boost(vpx_codec_alg_priv_t *ctx, - va_list args) { - struct vp9_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.frame_periodic_boost = CAST(VP9E_SET_FRAME_PERIODIC_BOOST, args); - return update_extra_cfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t encoder_init(vpx_codec_ctx_t *ctx, - vpx_codec_priv_enc_mr_cfg_t *data) { - vpx_codec_err_t res = VPX_CODEC_OK; - (void)data; - - if (ctx->priv == NULL) { - vpx_codec_alg_priv_t *const priv = vpx_calloc(1, sizeof(*priv)); - if (priv == NULL) - return VPX_CODEC_MEM_ERROR; - - ctx->priv = (vpx_codec_priv_t *)priv; - ctx->priv->init_flags = ctx->init_flags; - ctx->priv->enc.total_encoders = 1; - priv->buffer_pool = - (BufferPool *)vpx_calloc(1, sizeof(BufferPool)); - if (priv->buffer_pool == NULL) - return VPX_CODEC_MEM_ERROR; - -#if CONFIG_MULTITHREAD - if (pthread_mutex_init(&priv->buffer_pool->pool_mutex, NULL)) { - return VPX_CODEC_MEM_ERROR; - } -#endif - - if (ctx->config.enc) { - // Update the reference to the config structure to an internal copy. - priv->cfg = *ctx->config.enc; - ctx->config.enc = &priv->cfg; - } - - priv->extra_cfg = default_extra_cfg; - once(vp9_initialize_enc); - - res = validate_config(priv, &priv->cfg, &priv->extra_cfg); - - if (res == VPX_CODEC_OK) { - set_encoder_config(&priv->oxcf, &priv->cfg, &priv->extra_cfg); -#if CONFIG_VP9_HIGHBITDEPTH - priv->oxcf.use_highbitdepth = - (ctx->init_flags & VPX_CODEC_USE_HIGHBITDEPTH) ? 1 : 0; -#endif - priv->cpi = vp9_create_compressor(&priv->oxcf, priv->buffer_pool); - if (priv->cpi == NULL) - res = VPX_CODEC_MEM_ERROR; - else - priv->cpi->output_pkt_list = &priv->pkt_list.head; - } - } - - return res; -} - -static vpx_codec_err_t encoder_destroy(vpx_codec_alg_priv_t *ctx) { - free(ctx->cx_data); - vp9_remove_compressor(ctx->cpi); -#if CONFIG_MULTITHREAD - pthread_mutex_destroy(&ctx->buffer_pool->pool_mutex); -#endif - vpx_free(ctx->buffer_pool); - vpx_free(ctx); - return VPX_CODEC_OK; -} - -static void pick_quickcompress_mode(vpx_codec_alg_priv_t *ctx, - unsigned long duration, - unsigned long deadline) { - MODE new_mode = BEST; - - switch (ctx->cfg.g_pass) { - case VPX_RC_ONE_PASS: - if (deadline > 0) { - const vpx_codec_enc_cfg_t *const cfg = &ctx->cfg; - - // Convert duration parameter from stream timebase to microseconds. - const uint64_t duration_us = (uint64_t)duration * 1000000 * - (uint64_t)cfg->g_timebase.num /(uint64_t)cfg->g_timebase.den; - - // If the deadline is more that the duration this frame is to be shown, - // use good quality mode. Otherwise use realtime mode. - new_mode = (deadline > duration_us) ? GOOD : REALTIME; - } else { - new_mode = BEST; - } - break; - case VPX_RC_FIRST_PASS: - break; - case VPX_RC_LAST_PASS: - new_mode = deadline > 0 ? GOOD : BEST; - break; - } - - if (ctx->oxcf.mode != new_mode) { - ctx->oxcf.mode = new_mode; - vp9_change_config(ctx->cpi, &ctx->oxcf); - } -} - -// Turn on to test if supplemental superframe data breaks decoding -// #define TEST_SUPPLEMENTAL_SUPERFRAME_DATA -static int write_superframe_index(vpx_codec_alg_priv_t *ctx) { - uint8_t marker = 0xc0; - unsigned int mask; - int mag, index_sz; - - assert(ctx->pending_frame_count); - assert(ctx->pending_frame_count <= 8); - - // Add the number of frames to the marker byte - marker |= ctx->pending_frame_count - 1; - - // Choose the magnitude - for (mag = 0, mask = 0xff; mag < 4; mag++) { - if (ctx->pending_frame_magnitude < mask) - break; - mask <<= 8; - mask |= 0xff; - } - marker |= mag << 3; - - // Write the index - index_sz = 2 + (mag + 1) * ctx->pending_frame_count; - if (ctx->pending_cx_data_sz + index_sz < ctx->cx_data_sz) { - uint8_t *x = ctx->pending_cx_data + ctx->pending_cx_data_sz; - int i, j; -#ifdef TEST_SUPPLEMENTAL_SUPERFRAME_DATA - uint8_t marker_test = 0xc0; - int mag_test = 2; // 1 - 4 - int frames_test = 4; // 1 - 8 - int index_sz_test = 2 + mag_test * frames_test; - marker_test |= frames_test - 1; - marker_test |= (mag_test - 1) << 3; - *x++ = marker_test; - for (i = 0; i < mag_test * frames_test; ++i) - *x++ = 0; // fill up with arbitrary data - *x++ = marker_test; - ctx->pending_cx_data_sz += index_sz_test; - printf("Added supplemental superframe data\n"); -#endif - - *x++ = marker; - for (i = 0; i < ctx->pending_frame_count; i++) { - unsigned int this_sz = (unsigned int)ctx->pending_frame_sizes[i]; - - for (j = 0; j <= mag; j++) { - *x++ = this_sz & 0xff; - this_sz >>= 8; - } - } - *x++ = marker; - ctx->pending_cx_data_sz += index_sz; -#ifdef TEST_SUPPLEMENTAL_SUPERFRAME_DATA - index_sz += index_sz_test; -#endif - } - return index_sz; -} - -// vp9 uses 10,000,000 ticks/second as time stamp -#define TICKS_PER_SEC 10000000LL - -static int64_t timebase_units_to_ticks(const vpx_rational_t *timebase, - int64_t n) { - return n * TICKS_PER_SEC * timebase->num / timebase->den; -} - -static int64_t ticks_to_timebase_units(const vpx_rational_t *timebase, - int64_t n) { - const int64_t round = TICKS_PER_SEC * timebase->num / 2 - 1; - return (n * timebase->den + round) / timebase->num / TICKS_PER_SEC; -} - -static vpx_codec_frame_flags_t get_frame_pkt_flags(const VP9_COMP *cpi, - unsigned int lib_flags) { - vpx_codec_frame_flags_t flags = lib_flags << 16; - - if (lib_flags & FRAMEFLAGS_KEY -#if CONFIG_SPATIAL_SVC - || (is_two_pass_svc(cpi) && cpi->svc.layer_context[0].is_key_frame) -#endif - ) - flags |= VPX_FRAME_IS_KEY; - - if (cpi->droppable) - flags |= VPX_FRAME_IS_DROPPABLE; - - return flags; -} - -static vpx_codec_err_t encoder_encode(vpx_codec_alg_priv_t *ctx, - const vpx_image_t *img, - vpx_codec_pts_t pts, - unsigned long duration, - vpx_enc_frame_flags_t flags, - unsigned long deadline) { - vpx_codec_err_t res = VPX_CODEC_OK; - VP9_COMP *const cpi = ctx->cpi; - const vpx_rational_t *const timebase = &ctx->cfg.g_timebase; - size_t data_sz; - - if (img != NULL) { - res = validate_img(ctx, img); - // TODO(jzern) the checks related to cpi's validity should be treated as a - // failure condition, encoder setup is done fully in init() currently. - if (res == VPX_CODEC_OK && cpi != NULL) { - // There's no codec control for multiple alt-refs so check the encoder - // instance for its status to determine the compressed data size. - data_sz = ctx->cfg.g_w * ctx->cfg.g_h * get_image_bps(img) / 8 * - (cpi->multi_arf_allowed ? 8 : 2); - if (data_sz < 4096) - data_sz = 4096; - if (ctx->cx_data == NULL || ctx->cx_data_sz < data_sz) { - ctx->cx_data_sz = data_sz; - free(ctx->cx_data); - ctx->cx_data = (unsigned char*)malloc(ctx->cx_data_sz); - if (ctx->cx_data == NULL) { - return VPX_CODEC_MEM_ERROR; - } - } - } - } - - pick_quickcompress_mode(ctx, duration, deadline); - vpx_codec_pkt_list_init(&ctx->pkt_list); - - // Handle Flags - if (((flags & VP8_EFLAG_NO_UPD_GF) && (flags & VP8_EFLAG_FORCE_GF)) || - ((flags & VP8_EFLAG_NO_UPD_ARF) && (flags & VP8_EFLAG_FORCE_ARF))) { - ctx->base.err_detail = "Conflicting flags."; - return VPX_CODEC_INVALID_PARAM; - } - - vp9_apply_encoding_flags(cpi, flags); - - // Handle fixed keyframe intervals - if (ctx->cfg.kf_mode == VPX_KF_AUTO && - ctx->cfg.kf_min_dist == ctx->cfg.kf_max_dist) { - if (++ctx->fixed_kf_cntr > ctx->cfg.kf_min_dist) { - flags |= VPX_EFLAG_FORCE_KF; - ctx->fixed_kf_cntr = 1; - } - } - - // Initialize the encoder instance on the first frame. - if (res == VPX_CODEC_OK && cpi != NULL) { - unsigned int lib_flags = 0; - YV12_BUFFER_CONFIG sd; - int64_t dst_time_stamp = timebase_units_to_ticks(timebase, pts); - int64_t dst_end_time_stamp = - timebase_units_to_ticks(timebase, pts + duration); - size_t size, cx_data_sz; - unsigned char *cx_data; - - // Set up internal flags - if (ctx->base.init_flags & VPX_CODEC_USE_PSNR) - cpi->b_calculate_psnr = 1; - - if (img != NULL) { - res = image2yuvconfig(img, &sd); - - // Store the original flags in to the frame buffer. Will extract the - // key frame flag when we actually encode this frame. - if (vp9_receive_raw_frame(cpi, flags | ctx->next_frame_flags, - &sd, dst_time_stamp, dst_end_time_stamp)) { - res = update_error_state(ctx, &cpi->common.error); - } - ctx->next_frame_flags = 0; - } - - cx_data = ctx->cx_data; - cx_data_sz = ctx->cx_data_sz; - - /* Any pending invisible frames? */ - if (ctx->pending_cx_data) { - memmove(cx_data, ctx->pending_cx_data, ctx->pending_cx_data_sz); - ctx->pending_cx_data = cx_data; - cx_data += ctx->pending_cx_data_sz; - cx_data_sz -= ctx->pending_cx_data_sz; - - /* TODO: this is a minimal check, the underlying codec doesn't respect - * the buffer size anyway. - */ - if (cx_data_sz < ctx->cx_data_sz / 2) { - ctx->base.err_detail = "Compressed data buffer too small"; - return VPX_CODEC_ERROR; - } - } - - while (cx_data_sz >= ctx->cx_data_sz / 2 && - -1 != vp9_get_compressed_data(cpi, &lib_flags, &size, - cx_data, &dst_time_stamp, - &dst_end_time_stamp, !img)) { - if (size) { - vpx_codec_cx_pkt_t pkt; - -#if CONFIG_SPATIAL_SVC - if (is_two_pass_svc(cpi)) - cpi->svc.layer_context[cpi->svc.spatial_layer_id].layer_size += size; -#endif - - // Pack invisible frames with the next visible frame - if (!cpi->common.show_frame -#if CONFIG_SPATIAL_SVC - || (is_two_pass_svc(cpi) && - cpi->svc.spatial_layer_id < cpi->svc.number_spatial_layers - 1) -#endif - ) { - if (ctx->pending_cx_data == 0) - ctx->pending_cx_data = cx_data; - ctx->pending_cx_data_sz += size; - ctx->pending_frame_sizes[ctx->pending_frame_count++] = size; - ctx->pending_frame_magnitude |= size; - cx_data += size; - cx_data_sz -= size; - - if (ctx->output_cx_pkt_cb.output_cx_pkt) { - pkt.kind = VPX_CODEC_CX_FRAME_PKT; - pkt.data.frame.pts = ticks_to_timebase_units(timebase, - dst_time_stamp); - pkt.data.frame.duration = - (unsigned long)ticks_to_timebase_units(timebase, - dst_end_time_stamp - dst_time_stamp); - pkt.data.frame.flags = get_frame_pkt_flags(cpi, lib_flags); - pkt.data.frame.buf = ctx->pending_cx_data; - pkt.data.frame.sz = size; - ctx->pending_cx_data = NULL; - ctx->pending_cx_data_sz = 0; - ctx->pending_frame_count = 0; - ctx->pending_frame_magnitude = 0; - ctx->output_cx_pkt_cb.output_cx_pkt( - &pkt, ctx->output_cx_pkt_cb.user_priv); - } - continue; - } - - // Add the frame packet to the list of returned packets. - pkt.kind = VPX_CODEC_CX_FRAME_PKT; - pkt.data.frame.pts = ticks_to_timebase_units(timebase, dst_time_stamp); - pkt.data.frame.duration = - (unsigned long)ticks_to_timebase_units(timebase, - dst_end_time_stamp - dst_time_stamp); - pkt.data.frame.flags = get_frame_pkt_flags(cpi, lib_flags); - - if (ctx->pending_cx_data) { - ctx->pending_frame_sizes[ctx->pending_frame_count++] = size; - ctx->pending_frame_magnitude |= size; - ctx->pending_cx_data_sz += size; - // write the superframe only for the case when - if (!ctx->output_cx_pkt_cb.output_cx_pkt) - size += write_superframe_index(ctx); - pkt.data.frame.buf = ctx->pending_cx_data; - pkt.data.frame.sz = ctx->pending_cx_data_sz; - ctx->pending_cx_data = NULL; - ctx->pending_cx_data_sz = 0; - ctx->pending_frame_count = 0; - ctx->pending_frame_magnitude = 0; - } else { - pkt.data.frame.buf = cx_data; - pkt.data.frame.sz = size; - } - pkt.data.frame.partition_id = -1; - - if(ctx->output_cx_pkt_cb.output_cx_pkt) - ctx->output_cx_pkt_cb.output_cx_pkt(&pkt, ctx->output_cx_pkt_cb.user_priv); - else - vpx_codec_pkt_list_add(&ctx->pkt_list.head, &pkt); - - cx_data += size; - cx_data_sz -= size; -#if CONFIG_SPATIAL_SVC - if (is_two_pass_svc(cpi) && !ctx->output_cx_pkt_cb.output_cx_pkt) { - vpx_codec_cx_pkt_t pkt_sizes, pkt_psnr; - int i; - vp9_zero(pkt_sizes); - vp9_zero(pkt_psnr); - pkt_sizes.kind = VPX_CODEC_SPATIAL_SVC_LAYER_SIZES; - pkt_psnr.kind = VPX_CODEC_SPATIAL_SVC_LAYER_PSNR; - for (i = 0; i < cpi->svc.number_spatial_layers; ++i) { - LAYER_CONTEXT *lc = &cpi->svc.layer_context[i]; - pkt_sizes.data.layer_sizes[i] = lc->layer_size; - pkt_psnr.data.layer_psnr[i] = lc->psnr_pkt; - lc->layer_size = 0; - } - - vpx_codec_pkt_list_add(&ctx->pkt_list.head, &pkt_sizes); - - vpx_codec_pkt_list_add(&ctx->pkt_list.head, &pkt_psnr); - } -#endif - } - } - } - - return res; -} - -static const vpx_codec_cx_pkt_t *encoder_get_cxdata(vpx_codec_alg_priv_t *ctx, - vpx_codec_iter_t *iter) { - return vpx_codec_pkt_list_get(&ctx->pkt_list.head, iter); -} - -static vpx_codec_err_t ctrl_set_reference(vpx_codec_alg_priv_t *ctx, - va_list args) { - vpx_ref_frame_t *const frame = va_arg(args, vpx_ref_frame_t *); - - if (frame != NULL) { - YV12_BUFFER_CONFIG sd; - - image2yuvconfig(&frame->img, &sd); - vp9_set_reference_enc(ctx->cpi, ref_frame_to_vp9_reframe(frame->frame_type), - &sd); - return VPX_CODEC_OK; - } else { - return VPX_CODEC_INVALID_PARAM; - } -} - -static vpx_codec_err_t ctrl_copy_reference(vpx_codec_alg_priv_t *ctx, - va_list args) { - vpx_ref_frame_t *const frame = va_arg(args, vpx_ref_frame_t *); - - if (frame != NULL) { - YV12_BUFFER_CONFIG sd; - - image2yuvconfig(&frame->img, &sd); - vp9_copy_reference_enc(ctx->cpi, - ref_frame_to_vp9_reframe(frame->frame_type), &sd); - return VPX_CODEC_OK; - } else { - return VPX_CODEC_INVALID_PARAM; - } -} - -static vpx_codec_err_t ctrl_get_reference(vpx_codec_alg_priv_t *ctx, - va_list args) { - vp9_ref_frame_t *const frame = va_arg(args, vp9_ref_frame_t *); - - if (frame != NULL) { - YV12_BUFFER_CONFIG *fb = get_ref_frame(&ctx->cpi->common, frame->idx); - if (fb == NULL) return VPX_CODEC_ERROR; - - yuvconfig2image(&frame->img, fb, NULL); - return VPX_CODEC_OK; - } else { - return VPX_CODEC_INVALID_PARAM; - } -} - -static vpx_codec_err_t ctrl_set_previewpp(vpx_codec_alg_priv_t *ctx, - va_list args) { -#if CONFIG_VP9_POSTPROC - vp8_postproc_cfg_t *config = va_arg(args, vp8_postproc_cfg_t *); - if (config != NULL) { - ctx->preview_ppcfg = *config; - return VPX_CODEC_OK; - } else { - return VPX_CODEC_INVALID_PARAM; - } -#else - (void)ctx; - (void)args; - return VPX_CODEC_INCAPABLE; -#endif -} - - -static vpx_image_t *encoder_get_preview(vpx_codec_alg_priv_t *ctx) { - YV12_BUFFER_CONFIG sd; - vp9_ppflags_t flags; - vp9_zero(flags); - - if (ctx->preview_ppcfg.post_proc_flag) { - flags.post_proc_flag = ctx->preview_ppcfg.post_proc_flag; - flags.deblocking_level = ctx->preview_ppcfg.deblocking_level; - flags.noise_level = ctx->preview_ppcfg.noise_level; - } - - if (vp9_get_preview_raw_frame(ctx->cpi, &sd, &flags) == 0) { - yuvconfig2image(&ctx->preview_img, &sd, NULL); - return &ctx->preview_img; - } else { - return NULL; - } -} - -static vpx_codec_err_t ctrl_update_entropy(vpx_codec_alg_priv_t *ctx, - va_list args) { - const int update = va_arg(args, int); - - vp9_update_entropy(ctx->cpi, update); - return VPX_CODEC_OK; -} - -static vpx_codec_err_t ctrl_update_reference(vpx_codec_alg_priv_t *ctx, - va_list args) { - const int ref_frame_flags = va_arg(args, int); - - vp9_update_reference(ctx->cpi, ref_frame_flags); - return VPX_CODEC_OK; -} - -static vpx_codec_err_t ctrl_use_reference(vpx_codec_alg_priv_t *ctx, - va_list args) { - const int reference_flag = va_arg(args, int); - - vp9_use_as_reference(ctx->cpi, reference_flag); - return VPX_CODEC_OK; -} - -static vpx_codec_err_t ctrl_set_roi_map(vpx_codec_alg_priv_t *ctx, - va_list args) { - (void)ctx; - (void)args; - - // TODO(yaowu): Need to re-implement and test for VP9. - return VPX_CODEC_INVALID_PARAM; -} - - -static vpx_codec_err_t ctrl_set_active_map(vpx_codec_alg_priv_t *ctx, - va_list args) { - vpx_active_map_t *const map = va_arg(args, vpx_active_map_t *); - - if (map) { - if (!vp9_set_active_map(ctx->cpi, map->active_map, - (int)map->rows, (int)map->cols)) - return VPX_CODEC_OK; - else - return VPX_CODEC_INVALID_PARAM; - } else { - return VPX_CODEC_INVALID_PARAM; - } -} - -static vpx_codec_err_t ctrl_set_scale_mode(vpx_codec_alg_priv_t *ctx, - va_list args) { - vpx_scaling_mode_t *const mode = va_arg(args, vpx_scaling_mode_t *); - - if (mode) { - const int res = vp9_set_internal_size(ctx->cpi, - (VPX_SCALING)mode->h_scaling_mode, - (VPX_SCALING)mode->v_scaling_mode); - return (res == 0) ? VPX_CODEC_OK : VPX_CODEC_INVALID_PARAM; - } else { - return VPX_CODEC_INVALID_PARAM; - } -} - -static vpx_codec_err_t ctrl_set_svc(vpx_codec_alg_priv_t *ctx, va_list args) { - int data = va_arg(args, int); - const vpx_codec_enc_cfg_t *cfg = &ctx->cfg; - - vp9_set_svc(ctx->cpi, data); - // CBR or two pass mode for SVC with both temporal and spatial layers - // not yet supported. - if (data == 1 && - (cfg->rc_end_usage == VPX_CBR || - cfg->g_pass == VPX_RC_FIRST_PASS || - cfg->g_pass == VPX_RC_LAST_PASS) && - cfg->ss_number_layers > 1 && - cfg->ts_number_layers > 1) { - return VPX_CODEC_INVALID_PARAM; - } - return VPX_CODEC_OK; -} - -static vpx_codec_err_t ctrl_set_svc_layer_id(vpx_codec_alg_priv_t *ctx, - va_list args) { - vpx_svc_layer_id_t *const data = va_arg(args, vpx_svc_layer_id_t *); - VP9_COMP *const cpi = (VP9_COMP *)ctx->cpi; - SVC *const svc = &cpi->svc; - -#if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION) - svc->spatial_layer_id = data->spatial_layer_id; -#endif - svc->temporal_layer_id = data->temporal_layer_id; - // Checks on valid layer_id input. - if (svc->temporal_layer_id < 0 || - svc->temporal_layer_id >= (int)ctx->cfg.ts_number_layers) { - return VPX_CODEC_INVALID_PARAM; - } - if (svc->spatial_layer_id < 0 || - svc->spatial_layer_id >= (int)ctx->cfg.ss_number_layers) { - return VPX_CODEC_INVALID_PARAM; - } - return VPX_CODEC_OK; -} - -static vpx_codec_err_t ctrl_get_svc_layer_id(vpx_codec_alg_priv_t *ctx, - va_list args) { - vpx_svc_layer_id_t *data = va_arg(args, vpx_svc_layer_id_t *); - VP9_COMP *const cpi = (VP9_COMP *)ctx->cpi; - SVC *const svc = &cpi->svc; - -#if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION) - data->spatial_layer_id = svc->spatial_layer_id; -#endif - data->temporal_layer_id = svc->temporal_layer_id; - - return VPX_CODEC_OK; -} - -static vpx_codec_err_t ctrl_set_svc_parameters(vpx_codec_alg_priv_t *ctx, - va_list args) { - VP9_COMP *const cpi = ctx->cpi; - vpx_svc_extra_cfg_t *const params = va_arg(args, vpx_svc_extra_cfg_t *); - int i; - - for (i = 0; i < cpi->svc.number_spatial_layers; ++i) { - LAYER_CONTEXT *lc = &cpi->svc.layer_context[i]; - - lc->max_q = params->max_quantizers[i]; - lc->min_q = params->min_quantizers[i]; - lc->scaling_factor_num = params->scaling_factor_num[i]; - lc->scaling_factor_den = params->scaling_factor_den[i]; - } - - return VPX_CODEC_OK; -} - -static vpx_codec_err_t ctrl_register_cx_callback(vpx_codec_alg_priv_t *ctx, - va_list args) { - vpx_codec_priv_output_cx_pkt_cb_pair_t *cbp = - (vpx_codec_priv_output_cx_pkt_cb_pair_t *)va_arg(args, void *); - ctx->output_cx_pkt_cb.output_cx_pkt = cbp->output_cx_pkt; - ctx->output_cx_pkt_cb.user_priv = cbp->user_priv; - - return VPX_CODEC_OK; -} - -static vpx_codec_err_t ctrl_set_tune_content(vpx_codec_alg_priv_t *ctx, - va_list args) { - struct vp9_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.content = CAST(VP9E_SET_TUNE_CONTENT, args); - return update_extra_cfg(ctx, &extra_cfg); -} - -static vpx_codec_err_t ctrl_set_color_space(vpx_codec_alg_priv_t *ctx, - va_list args) { - struct vp9_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.color_space = CAST(VP9E_SET_COLOR_SPACE, args); - return update_extra_cfg(ctx, &extra_cfg); -} - -static vpx_codec_ctrl_fn_map_t encoder_ctrl_maps[] = { - {VP8_COPY_REFERENCE, ctrl_copy_reference}, - {VP8E_UPD_ENTROPY, ctrl_update_entropy}, - {VP8E_UPD_REFERENCE, ctrl_update_reference}, - {VP8E_USE_REFERENCE, ctrl_use_reference}, - - // Setters - {VP8_SET_REFERENCE, ctrl_set_reference}, - {VP8_SET_POSTPROC, ctrl_set_previewpp}, - {VP8E_SET_ROI_MAP, ctrl_set_roi_map}, - {VP8E_SET_ACTIVEMAP, ctrl_set_active_map}, - {VP8E_SET_SCALEMODE, ctrl_set_scale_mode}, - {VP8E_SET_CPUUSED, ctrl_set_cpuused}, - {VP8E_SET_ENABLEAUTOALTREF, ctrl_set_enable_auto_alt_ref}, - {VP8E_SET_SHARPNESS, ctrl_set_sharpness}, - {VP8E_SET_STATIC_THRESHOLD, ctrl_set_static_thresh}, - {VP9E_SET_TILE_COLUMNS, ctrl_set_tile_columns}, - {VP9E_SET_TILE_ROWS, ctrl_set_tile_rows}, - {VP8E_SET_ARNR_MAXFRAMES, ctrl_set_arnr_max_frames}, - {VP8E_SET_ARNR_STRENGTH, ctrl_set_arnr_strength}, - {VP8E_SET_ARNR_TYPE, ctrl_set_arnr_type}, - {VP8E_SET_TUNING, ctrl_set_tuning}, - {VP8E_SET_CQ_LEVEL, ctrl_set_cq_level}, - {VP8E_SET_MAX_INTRA_BITRATE_PCT, ctrl_set_rc_max_intra_bitrate_pct}, - {VP9E_SET_MAX_INTER_BITRATE_PCT, ctrl_set_rc_max_inter_bitrate_pct}, - {VP9E_SET_GF_CBR_BOOST_PCT, ctrl_set_rc_gf_cbr_boost_pct}, - {VP9E_SET_LOSSLESS, ctrl_set_lossless}, - {VP9E_SET_FRAME_PARALLEL_DECODING, ctrl_set_frame_parallel_decoding_mode}, - {VP9E_SET_AQ_MODE, ctrl_set_aq_mode}, - {VP9E_SET_FRAME_PERIODIC_BOOST, ctrl_set_frame_periodic_boost}, - {VP9E_SET_SVC, ctrl_set_svc}, -#if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION) - {VP9E_SET_SVC_PARAMETERS, ctrl_set_svc_parameters}, - {VP9E_REGISTER_CX_CALLBACK, ctrl_register_cx_callback}, -#endif - {VP9E_SET_SVC_LAYER_ID, ctrl_set_svc_layer_id}, - {VP9E_SET_TUNE_CONTENT, ctrl_set_tune_content}, - {VP9E_SET_COLOR_SPACE, ctrl_set_color_space}, - {VP9E_SET_NOISE_SENSITIVITY, ctrl_set_noise_sensitivity}, - - // Getters - {VP8E_GET_LAST_QUANTIZER, ctrl_get_quantizer}, - {VP8E_GET_LAST_QUANTIZER_64, ctrl_get_quantizer64}, - {VP9_GET_REFERENCE, ctrl_get_reference}, -#if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION) - {VP9E_GET_SVC_LAYER_ID, ctrl_get_svc_layer_id}, -#endif - - { -1, NULL}, -}; - -static vpx_codec_enc_cfg_map_t encoder_usage_cfg_map[] = { - { - 0, - { // NOLINT - 0, // g_usage - 8, // g_threads - 0, // g_profile - - 320, // g_width - 240, // g_height - VPX_BITS_8, // g_bit_depth - 8, // g_input_bit_depth - - {1, 30}, // g_timebase - - 0, // g_error_resilient - - VPX_RC_ONE_PASS, // g_pass - - 25, // g_lag_in_frames - - 0, // rc_dropframe_thresh - 0, // rc_resize_allowed - 0, // rc_scaled_width - 0, // rc_scaled_height - 60, // rc_resize_down_thresold - 30, // rc_resize_up_thresold - - VPX_VBR, // rc_end_usage - {NULL, 0}, // rc_twopass_stats_in - {NULL, 0}, // rc_firstpass_mb_stats_in - 256, // rc_target_bandwidth - 0, // rc_min_quantizer - 63, // rc_max_quantizer - 25, // rc_undershoot_pct - 25, // rc_overshoot_pct - - 6000, // rc_max_buffer_size - 4000, // rc_buffer_initial_size - 5000, // rc_buffer_optimal_size - - 50, // rc_two_pass_vbrbias - 0, // rc_two_pass_vbrmin_section - 2000, // rc_two_pass_vbrmax_section - - // keyframing settings (kf) - VPX_KF_AUTO, // g_kfmode - 0, // kf_min_dist - 9999, // kf_max_dist - - VPX_SS_DEFAULT_LAYERS, // ss_number_layers - {0}, - {0}, // ss_target_bitrate - 1, // ts_number_layers - {0}, // ts_target_bitrate - {0}, // ts_rate_decimator - 0, // ts_periodicity - {0}, // ts_layer_id - } - }, -}; - -#ifndef VERSION_STRING -#define VERSION_STRING -#endif -CODEC_INTERFACE(vpx_codec_vp9_cx) = { - "WebM Project VP9 Encoder" VERSION_STRING, - VPX_CODEC_INTERNAL_ABI_VERSION, -#if CONFIG_VP9_HIGHBITDEPTH - VPX_CODEC_CAP_HIGHBITDEPTH | -#endif - VPX_CODEC_CAP_ENCODER | VPX_CODEC_CAP_PSNR, // vpx_codec_caps_t - encoder_init, // vpx_codec_init_fn_t - encoder_destroy, // vpx_codec_destroy_fn_t - encoder_ctrl_maps, // vpx_codec_ctrl_fn_map_t - { // NOLINT - NULL, // vpx_codec_peek_si_fn_t - NULL, // vpx_codec_get_si_fn_t - NULL, // vpx_codec_decode_fn_t - NULL, // vpx_codec_frame_get_fn_t - NULL // vpx_codec_set_fb_fn_t - }, - { // NOLINT - 1, // 1 cfg map - encoder_usage_cfg_map, // vpx_codec_enc_cfg_map_t - encoder_encode, // vpx_codec_encode_fn_t - encoder_get_cxdata, // vpx_codec_get_cx_data_fn_t - encoder_set_config, // vpx_codec_enc_config_set_fn_t - NULL, // vpx_codec_get_global_headers_fn_t - encoder_get_preview, // vpx_codec_get_preview_frame_fn_t - NULL // vpx_codec_enc_mr_get_mem_loc_fn_t - } -}; diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/vp9cx.mk gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/vp9cx.mk --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/vp9cx.mk 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/vp9cx.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,163 +0,0 @@ -## -## Copyright (c) 2010 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - -VP9_CX_EXPORTS += exports_enc - -VP9_CX_SRCS-yes += $(VP9_COMMON_SRCS-yes) -VP9_CX_SRCS-no += $(VP9_COMMON_SRCS-no) -VP9_CX_SRCS_REMOVE-yes += $(VP9_COMMON_SRCS_REMOVE-yes) -VP9_CX_SRCS_REMOVE-no += $(VP9_COMMON_SRCS_REMOVE-no) - -VP9_CX_SRCS-yes += vp9_cx_iface.c - -VP9_CX_SRCS-yes += encoder/vp9_avg.c -VP9_CX_SRCS-yes += encoder/vp9_bitstream.c -VP9_CX_SRCS-yes += encoder/vp9_context_tree.c -VP9_CX_SRCS-yes += encoder/vp9_context_tree.h -VP9_CX_SRCS-yes += encoder/vp9_cost.h -VP9_CX_SRCS-yes += encoder/vp9_cost.c -VP9_CX_SRCS-yes += encoder/vp9_dct.c -VP9_CX_SRCS-yes += encoder/vp9_dct.h -VP9_CX_SRCS-$(CONFIG_VP9_TEMPORAL_DENOISING) += encoder/vp9_denoiser.c -VP9_CX_SRCS-$(CONFIG_VP9_TEMPORAL_DENOISING) += encoder/vp9_denoiser.h -VP9_CX_SRCS-yes += encoder/vp9_encodeframe.c -VP9_CX_SRCS-yes += encoder/vp9_encodeframe.h -VP9_CX_SRCS-yes += encoder/vp9_encodemb.c -VP9_CX_SRCS-yes += encoder/vp9_encodemv.c -VP9_CX_SRCS-yes += encoder/vp9_ethread.h -VP9_CX_SRCS-yes += encoder/vp9_ethread.c -VP9_CX_SRCS-yes += encoder/vp9_extend.c -VP9_CX_SRCS-yes += encoder/vp9_firstpass.c -VP9_CX_SRCS-yes += encoder/vp9_block.h -VP9_CX_SRCS-yes += encoder/vp9_writer.h -VP9_CX_SRCS-yes += encoder/vp9_writer.c -VP9_CX_SRCS-yes += encoder/vp9_write_bit_buffer.c -VP9_CX_SRCS-yes += encoder/vp9_write_bit_buffer.h -VP9_CX_SRCS-yes += encoder/vp9_bitstream.h -VP9_CX_SRCS-yes += encoder/vp9_encodemb.h -VP9_CX_SRCS-yes += encoder/vp9_encodemv.h -VP9_CX_SRCS-yes += encoder/vp9_extend.h -VP9_CX_SRCS-yes += encoder/vp9_firstpass.h -VP9_CX_SRCS-yes += encoder/vp9_lookahead.c -VP9_CX_SRCS-yes += encoder/vp9_lookahead.h -VP9_CX_SRCS-yes += encoder/vp9_mcomp.h -VP9_CX_SRCS-yes += encoder/vp9_encoder.h -VP9_CX_SRCS-yes += encoder/vp9_quantize.h -VP9_CX_SRCS-yes += encoder/vp9_ratectrl.h -VP9_CX_SRCS-yes += encoder/vp9_rd.h -VP9_CX_SRCS-yes += encoder/vp9_rdopt.h -VP9_CX_SRCS-yes += encoder/vp9_pickmode.h -VP9_CX_SRCS-yes += encoder/vp9_svc_layercontext.h -VP9_CX_SRCS-yes += encoder/vp9_tokenize.h -VP9_CX_SRCS-yes += encoder/vp9_treewriter.h -VP9_CX_SRCS-yes += encoder/vp9_variance.h -VP9_CX_SRCS-yes += encoder/vp9_mcomp.c -VP9_CX_SRCS-yes += encoder/vp9_encoder.c -VP9_CX_SRCS-yes += encoder/vp9_picklpf.c -VP9_CX_SRCS-yes += encoder/vp9_picklpf.h -VP9_CX_SRCS-yes += encoder/vp9_quantize.c -VP9_CX_SRCS-yes += encoder/vp9_ratectrl.c -VP9_CX_SRCS-yes += encoder/vp9_rd.c -VP9_CX_SRCS-yes += encoder/vp9_rdopt.c -VP9_CX_SRCS-yes += encoder/vp9_pickmode.c -VP9_CX_SRCS-yes += encoder/vp9_sad.c -VP9_CX_SRCS-yes += encoder/vp9_segmentation.c -VP9_CX_SRCS-yes += encoder/vp9_segmentation.h -VP9_CX_SRCS-yes += encoder/vp9_speed_features.c -VP9_CX_SRCS-yes += encoder/vp9_speed_features.h -VP9_CX_SRCS-yes += encoder/vp9_subexp.c -VP9_CX_SRCS-yes += encoder/vp9_subexp.h -VP9_CX_SRCS-yes += encoder/vp9_svc_layercontext.c -VP9_CX_SRCS-yes += encoder/vp9_resize.c -VP9_CX_SRCS-yes += encoder/vp9_resize.h -VP9_CX_SRCS-$(CONFIG_INTERNAL_STATS) += encoder/vp9_ssim.c -VP9_CX_SRCS-$(CONFIG_INTERNAL_STATS) += encoder/vp9_ssim.h -VP9_CX_SRCS-yes += encoder/vp9_tokenize.c -VP9_CX_SRCS-yes += encoder/vp9_treewriter.c -VP9_CX_SRCS-yes += encoder/vp9_variance.c -VP9_CX_SRCS-yes += encoder/vp9_aq_variance.c -VP9_CX_SRCS-yes += encoder/vp9_aq_variance.h -VP9_CX_SRCS-yes += encoder/vp9_aq_cyclicrefresh.c -VP9_CX_SRCS-yes += encoder/vp9_aq_cyclicrefresh.h -VP9_CX_SRCS-yes += encoder/vp9_aq_complexity.c -VP9_CX_SRCS-yes += encoder/vp9_aq_complexity.h -VP9_CX_SRCS-yes += encoder/vp9_skin_detection.c -VP9_CX_SRCS-yes += encoder/vp9_skin_detection.h -ifeq ($(CONFIG_VP9_POSTPROC),yes) -VP9_CX_SRCS-$(CONFIG_INTERNAL_STATS) += common/vp9_postproc.h -VP9_CX_SRCS-$(CONFIG_INTERNAL_STATS) += common/vp9_postproc.c -endif -VP9_CX_SRCS-yes += encoder/vp9_temporal_filter.c -VP9_CX_SRCS-yes += encoder/vp9_temporal_filter.h -VP9_CX_SRCS-yes += encoder/vp9_mbgraph.c -VP9_CX_SRCS-yes += encoder/vp9_mbgraph.h - -VP9_CX_SRCS-$(HAVE_AVX2) += encoder/x86/vp9_variance_impl_intrin_avx2.c -VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_sad4d_sse2.asm -VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_avg_intrin_sse2.c -VP9_CX_SRCS-$(HAVE_AVX2) += encoder/x86/vp9_sad4d_intrin_avx2.c -VP9_CX_SRCS-$(HAVE_AVX2) += encoder/x86/vp9_subpel_variance_impl_intrin_avx2.c -VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_temporal_filter_apply_sse2.asm -VP9_CX_SRCS-$(HAVE_SSE3) += encoder/x86/vp9_sad_sse3.asm -VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_quantize_sse2.c -ifeq ($(CONFIG_VP9_HIGHBITDEPTH),yes) -VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_highbd_sad4d_sse2.asm -VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_highbd_variance_impl_sse2.asm -VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_highbd_quantize_intrin_sse2.c -VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_highbd_block_error_intrin_sse2.c -endif - -ifeq ($(CONFIG_USE_X86INC),yes) -VP9_CX_SRCS-$(HAVE_MMX) += encoder/x86/vp9_dct_mmx.asm -VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_error_sse2.asm -VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_sad_sse2.asm -VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_subtract_sse2.asm -VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_variance_sse2.c -VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_subpel_variance.asm -ifeq ($(CONFIG_VP9_HIGHBITDEPTH),yes) -VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_highbd_sad_sse2.asm -VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_highbd_variance_sse2.c -VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_highbd_subpel_variance.asm -endif -endif - -ifeq ($(ARCH_X86_64),yes) -VP9_CX_SRCS-$(HAVE_SSSE3) += encoder/x86/vp9_quantize_ssse3_x86_64.asm -VP9_CX_SRCS-$(HAVE_SSSE3) += encoder/x86/vp9_dct_ssse3_x86_64.asm -endif -VP9_CX_SRCS-$(HAVE_SSSE3) += encoder/x86/vp9_sad_ssse3.asm -VP9_CX_SRCS-$(HAVE_SSE4_1) += encoder/x86/vp9_sad_sse4.asm -VP9_CX_SRCS-$(HAVE_AVX2) += encoder/x86/vp9_sad_intrin_avx2.c -VP9_CX_SRCS-$(ARCH_X86_64) += encoder/x86/vp9_ssim_opt_x86_64.asm - -VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_dct_sse2.c -VP9_CX_SRCS-$(HAVE_SSSE3) += encoder/x86/vp9_dct_ssse3.c -VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_dct_sse2.h -VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_dct32x32_sse2.c -VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_dct_impl_sse2.c - -ifeq ($(CONFIG_VP9_TEMPORAL_DENOISING),yes) -VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_denoiser_sse2.c -endif - -VP9_CX_SRCS-$(HAVE_AVX2) += encoder/x86/vp9_dct32x32_avx2.c -VP9_CX_SRCS-$(HAVE_AVX2) += encoder/x86/vp9_dct_avx2.c -VP9_CX_SRCS-$(HAVE_AVX2) += encoder/x86/vp9_error_intrin_avx2.c -VP9_CX_SRCS-$(HAVE_AVX2) += encoder/x86/vp9_variance_avx2.c - -VP9_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/vp9_avg_neon.c -VP9_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/vp9_sad_neon.c -VP9_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/vp9_sad4d_neon.c -VP9_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/vp9_dct_neon.c -VP9_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/vp9_variance_neon.c -VP9_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/vp9_quantize_neon.c -VP9_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/vp9_subtract_neon.c - -VP9_CX_SRCS-yes := $(filter-out $(VP9_CX_SRCS_REMOVE-yes),$(VP9_CX_SRCS-yes)) diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/vp9_dx_iface.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/vp9_dx_iface.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/vp9_dx_iface.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/vp9_dx_iface.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1111 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "./vpx_config.h" -#include "./vpx_version.h" - -#include "vpx/internal/vpx_codec_internal.h" -#include "vpx/vp8dx.h" -#include "vpx/vpx_decoder.h" - -#include "vp9/common/vp9_alloccommon.h" -#include "vp9/common/vp9_frame_buffers.h" -#include "vp9/common/vp9_thread.h" - -#include "vp9/decoder/vp9_decoder.h" -#include "vp9/decoder/vp9_decodeframe.h" -#include "vp9/decoder/vp9_read_bit_buffer.h" - -#include "vp9/vp9_iface_common.h" - -#define VP9_CAP_POSTPROC (CONFIG_VP9_POSTPROC ? VPX_CODEC_CAP_POSTPROC : 0) - -typedef vpx_codec_stream_info_t vp9_stream_info_t; - -// This limit is due to framebuffer numbers. -// TODO(hkuang): Remove this limit after implementing ondemand framebuffers. -#define FRAME_CACHE_SIZE 6 // Cache maximum 6 decoded frames. - -typedef struct cache_frame { - int fb_idx; - vpx_image_t img; -} cache_frame; - -struct vpx_codec_alg_priv { - vpx_codec_priv_t base; - vpx_codec_dec_cfg_t cfg; - vp9_stream_info_t si; - int postproc_cfg_set; - vp8_postproc_cfg_t postproc_cfg; - vpx_decrypt_cb decrypt_cb; - void *decrypt_state; - vpx_image_t img; - int img_avail; - int flushed; - int invert_tile_order; - int last_show_frame; // Index of last output frame. - int byte_alignment; - - // Frame parallel related. - int frame_parallel_decode; // frame-based threading. - VP9Worker *frame_workers; - int num_frame_workers; - int next_submit_worker_id; - int last_submit_worker_id; - int next_output_worker_id; - int available_threads; - cache_frame frame_cache[FRAME_CACHE_SIZE]; - int frame_cache_write; - int frame_cache_read; - int num_cache_frames; - int need_resync; // wait for key/intra-only frame - // BufferPool that holds all reference frames. Shared by all the FrameWorkers. - BufferPool *buffer_pool; - - // External frame buffer info to save for VP9 common. - void *ext_priv; // Private data associated with the external frame buffers. - vpx_get_frame_buffer_cb_fn_t get_ext_fb_cb; - vpx_release_frame_buffer_cb_fn_t release_ext_fb_cb; -}; - -static vpx_codec_err_t decoder_init(vpx_codec_ctx_t *ctx, - vpx_codec_priv_enc_mr_cfg_t *data) { - // This function only allocates space for the vpx_codec_alg_priv_t - // structure. More memory may be required at the time the stream - // information becomes known. - (void)data; - - if (!ctx->priv) { - vpx_codec_alg_priv_t *const priv = vpx_calloc(1, sizeof(*priv)); - if (priv == NULL) - return VPX_CODEC_MEM_ERROR; - - ctx->priv = (vpx_codec_priv_t *)priv; - ctx->priv->init_flags = ctx->init_flags; - priv->si.sz = sizeof(priv->si); - priv->flushed = 0; - // Only do frame parallel decode when threads > 1. - priv->frame_parallel_decode = - (ctx->config.dec && (ctx->config.dec->threads > 1) && - (ctx->init_flags & VPX_CODEC_USE_FRAME_THREADING)) ? 1 : 0; - if (ctx->config.dec) { - priv->cfg = *ctx->config.dec; - ctx->config.dec = &priv->cfg; - } - } - - return VPX_CODEC_OK; -} - -static vpx_codec_err_t decoder_destroy(vpx_codec_alg_priv_t *ctx) { - if (ctx->frame_workers != NULL) { - int i; - for (i = 0; i < ctx->num_frame_workers; ++i) { - VP9Worker *const worker = &ctx->frame_workers[i]; - FrameWorkerData *const frame_worker_data = - (FrameWorkerData *)worker->data1; - vp9_get_worker_interface()->end(worker); - vp9_remove_common(&frame_worker_data->pbi->common); - vp9_decoder_remove(frame_worker_data->pbi); - vpx_free(frame_worker_data->scratch_buffer); -#if CONFIG_MULTITHREAD - pthread_mutex_destroy(&frame_worker_data->stats_mutex); - pthread_cond_destroy(&frame_worker_data->stats_cond); -#endif - vpx_free(frame_worker_data); - } -#if CONFIG_MULTITHREAD - pthread_mutex_destroy(&ctx->buffer_pool->pool_mutex); -#endif - } - - if (ctx->buffer_pool) - vp9_free_internal_frame_buffers(&ctx->buffer_pool->int_frame_buffers); - - vpx_free(ctx->frame_workers); - vpx_free(ctx->buffer_pool); - vpx_free(ctx); - return VPX_CODEC_OK; -} - -static int parse_bitdepth_colorspace_sampling( - BITSTREAM_PROFILE profile, struct vp9_read_bit_buffer *rb) { - vpx_color_space_t color_space; - if (profile >= PROFILE_2) - rb->bit_offset += 1; // Bit-depth 10 or 12. - color_space = (vpx_color_space_t)vp9_rb_read_literal(rb, 3); - if (color_space != VPX_CS_SRGB) { - rb->bit_offset += 1; // [16,235] (including xvycc) vs [0,255] range. - if (profile == PROFILE_1 || profile == PROFILE_3) { - rb->bit_offset += 2; // subsampling x/y. - rb->bit_offset += 1; // unused. - } - } else { - if (profile == PROFILE_1 || profile == PROFILE_3) { - rb->bit_offset += 1; // unused - } else { - // RGB is only available in version 1. - return 0; - } - } - return 1; -} - -static vpx_codec_err_t decoder_peek_si_internal(const uint8_t *data, - unsigned int data_sz, - vpx_codec_stream_info_t *si, - int *is_intra_only, - vpx_decrypt_cb decrypt_cb, - void *decrypt_state) { - int intra_only_flag = 0; - uint8_t clear_buffer[9]; - - if (data + data_sz <= data) - return VPX_CODEC_INVALID_PARAM; - - si->is_kf = 0; - si->w = si->h = 0; - - if (decrypt_cb) { - data_sz = MIN(sizeof(clear_buffer), data_sz); - decrypt_cb(decrypt_state, data, clear_buffer, data_sz); - data = clear_buffer; - } - - { - int show_frame; - int error_resilient; - struct vp9_read_bit_buffer rb = { data, data + data_sz, 0, NULL, NULL }; - const int frame_marker = vp9_rb_read_literal(&rb, 2); - const BITSTREAM_PROFILE profile = vp9_read_profile(&rb); - - if (frame_marker != VP9_FRAME_MARKER) - return VPX_CODEC_UNSUP_BITSTREAM; - - if (profile >= MAX_PROFILES) - return VPX_CODEC_UNSUP_BITSTREAM; - - if ((profile >= 2 && data_sz <= 1) || data_sz < 1) - return VPX_CODEC_UNSUP_BITSTREAM; - - if (vp9_rb_read_bit(&rb)) { // show an existing frame - vp9_rb_read_literal(&rb, 3); // Frame buffer to show. - return VPX_CODEC_OK; - } - - if (data_sz <= 8) - return VPX_CODEC_UNSUP_BITSTREAM; - - si->is_kf = !vp9_rb_read_bit(&rb); - show_frame = vp9_rb_read_bit(&rb); - error_resilient = vp9_rb_read_bit(&rb); - - if (si->is_kf) { - if (!vp9_read_sync_code(&rb)) - return VPX_CODEC_UNSUP_BITSTREAM; - - if (!parse_bitdepth_colorspace_sampling(profile, &rb)) - return VPX_CODEC_UNSUP_BITSTREAM; - vp9_read_frame_size(&rb, (int *)&si->w, (int *)&si->h); - } else { - intra_only_flag = show_frame ? 0 : vp9_rb_read_bit(&rb); - - rb.bit_offset += error_resilient ? 0 : 2; // reset_frame_context - - if (intra_only_flag) { - if (!vp9_read_sync_code(&rb)) - return VPX_CODEC_UNSUP_BITSTREAM; - if (profile > PROFILE_0) { - if (!parse_bitdepth_colorspace_sampling(profile, &rb)) - return VPX_CODEC_UNSUP_BITSTREAM; - } - rb.bit_offset += REF_FRAMES; // refresh_frame_flags - vp9_read_frame_size(&rb, (int *)&si->w, (int *)&si->h); - } - } - } - if (is_intra_only != NULL) - *is_intra_only = intra_only_flag; - return VPX_CODEC_OK; -} - -static vpx_codec_err_t decoder_peek_si(const uint8_t *data, - unsigned int data_sz, - vpx_codec_stream_info_t *si) { - return decoder_peek_si_internal(data, data_sz, si, NULL, NULL, NULL); -} - -static vpx_codec_err_t decoder_get_si(vpx_codec_alg_priv_t *ctx, - vpx_codec_stream_info_t *si) { - const size_t sz = (si->sz >= sizeof(vp9_stream_info_t)) - ? sizeof(vp9_stream_info_t) - : sizeof(vpx_codec_stream_info_t); - memcpy(si, &ctx->si, sz); - si->sz = (unsigned int)sz; - - return VPX_CODEC_OK; -} - -static void set_error_detail(vpx_codec_alg_priv_t *ctx, - const char *const error) { - ctx->base.err_detail = error; -} - -static vpx_codec_err_t update_error_state(vpx_codec_alg_priv_t *ctx, - const struct vpx_internal_error_info *error) { - if (error->error_code) - set_error_detail(ctx, error->has_detail ? error->detail : NULL); - - return error->error_code; -} - -static void init_buffer_callbacks(vpx_codec_alg_priv_t *ctx) { - int i; - - for (i = 0; i < ctx->num_frame_workers; ++i) { - VP9Worker *const worker = &ctx->frame_workers[i]; - FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1; - VP9_COMMON *const cm = &frame_worker_data->pbi->common; - BufferPool *const pool = cm->buffer_pool; - - cm->new_fb_idx = INVALID_IDX; - cm->byte_alignment = ctx->byte_alignment; - - if (ctx->get_ext_fb_cb != NULL && ctx->release_ext_fb_cb != NULL) { - pool->get_fb_cb = ctx->get_ext_fb_cb; - pool->release_fb_cb = ctx->release_ext_fb_cb; - pool->cb_priv = ctx->ext_priv; - } else { - pool->get_fb_cb = vp9_get_frame_buffer; - pool->release_fb_cb = vp9_release_frame_buffer; - - if (vp9_alloc_internal_frame_buffers(&pool->int_frame_buffers)) - vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR, - "Failed to initialize internal frame buffers"); - - pool->cb_priv = &pool->int_frame_buffers; - } - } -} - -static void set_default_ppflags(vp8_postproc_cfg_t *cfg) { - cfg->post_proc_flag = VP8_DEBLOCK | VP8_DEMACROBLOCK; - cfg->deblocking_level = 4; - cfg->noise_level = 0; -} - -static void set_ppflags(const vpx_codec_alg_priv_t *ctx, - vp9_ppflags_t *flags) { - flags->post_proc_flag = - ctx->postproc_cfg.post_proc_flag; - - flags->deblocking_level = ctx->postproc_cfg.deblocking_level; - flags->noise_level = ctx->postproc_cfg.noise_level; -} - -static int frame_worker_hook(void *arg1, void *arg2) { - FrameWorkerData *const frame_worker_data = (FrameWorkerData *)arg1; - const uint8_t *data = frame_worker_data->data; - (void)arg2; - - frame_worker_data->result = - vp9_receive_compressed_data(frame_worker_data->pbi, - frame_worker_data->data_size, - &data); - frame_worker_data->data_end = data; - - if (frame_worker_data->pbi->frame_parallel_decode) { - // In frame parallel decoding, a worker thread must successfully decode all - // the compressed data. - if (frame_worker_data->result != 0 || - frame_worker_data->data + frame_worker_data->data_size - 1 > data) { - VP9Worker *const worker = frame_worker_data->pbi->frame_worker_owner; - BufferPool *const pool = frame_worker_data->pbi->common.buffer_pool; - // Signal all the other threads that are waiting for this frame. - vp9_frameworker_lock_stats(worker); - frame_worker_data->frame_context_ready = 1; - lock_buffer_pool(pool); - frame_worker_data->pbi->cur_buf->buf.corrupted = 1; - unlock_buffer_pool(pool); - frame_worker_data->pbi->need_resync = 1; - vp9_frameworker_signal_stats(worker); - vp9_frameworker_unlock_stats(worker); - return 0; - } - } else if (frame_worker_data->result != 0) { - // Check decode result in serial decode. - frame_worker_data->pbi->cur_buf->buf.corrupted = 1; - frame_worker_data->pbi->need_resync = 1; - } - return !frame_worker_data->result; -} - -static vpx_codec_err_t init_decoder(vpx_codec_alg_priv_t *ctx) { - int i; - const VP9WorkerInterface *const winterface = vp9_get_worker_interface(); - - ctx->last_show_frame = -1; - ctx->next_submit_worker_id = 0; - ctx->last_submit_worker_id = 0; - ctx->next_output_worker_id = 0; - ctx->frame_cache_read = 0; - ctx->frame_cache_write = 0; - ctx->num_cache_frames = 0; - ctx->need_resync = 1; - ctx->num_frame_workers = - (ctx->frame_parallel_decode == 1) ? ctx->cfg.threads: 1; - if (ctx->num_frame_workers > MAX_DECODE_THREADS) - ctx->num_frame_workers = MAX_DECODE_THREADS; - ctx->available_threads = ctx->num_frame_workers; - ctx->flushed = 0; - - ctx->buffer_pool = (BufferPool *)vpx_calloc(1, sizeof(BufferPool)); - if (ctx->buffer_pool == NULL) - return VPX_CODEC_MEM_ERROR; - -#if CONFIG_MULTITHREAD - if (pthread_mutex_init(&ctx->buffer_pool->pool_mutex, NULL)) { - set_error_detail(ctx, "Failed to allocate buffer pool mutex"); - return VPX_CODEC_MEM_ERROR; - } -#endif - - ctx->frame_workers = (VP9Worker *) - vpx_malloc(ctx->num_frame_workers * sizeof(*ctx->frame_workers)); - if (ctx->frame_workers == NULL) { - set_error_detail(ctx, "Failed to allocate frame_workers"); - return VPX_CODEC_MEM_ERROR; - } - - for (i = 0; i < ctx->num_frame_workers; ++i) { - VP9Worker *const worker = &ctx->frame_workers[i]; - FrameWorkerData *frame_worker_data = NULL; - winterface->init(worker); - worker->data1 = vpx_memalign(32, sizeof(FrameWorkerData)); - if (worker->data1 == NULL) { - set_error_detail(ctx, "Failed to allocate frame_worker_data"); - return VPX_CODEC_MEM_ERROR; - } - frame_worker_data = (FrameWorkerData *)worker->data1; - frame_worker_data->pbi = vp9_decoder_create(ctx->buffer_pool); - if (frame_worker_data->pbi == NULL) { - set_error_detail(ctx, "Failed to allocate frame_worker_data"); - return VPX_CODEC_MEM_ERROR; - } - frame_worker_data->pbi->frame_worker_owner = worker; - frame_worker_data->worker_id = i; - frame_worker_data->scratch_buffer = NULL; - frame_worker_data->scratch_buffer_size = 0; - frame_worker_data->frame_context_ready = 0; - frame_worker_data->received_frame = 0; -#if CONFIG_MULTITHREAD - if (pthread_mutex_init(&frame_worker_data->stats_mutex, NULL)) { - set_error_detail(ctx, "Failed to allocate frame_worker_data mutex"); - return VPX_CODEC_MEM_ERROR; - } - - if (pthread_cond_init(&frame_worker_data->stats_cond, NULL)) { - set_error_detail(ctx, "Failed to allocate frame_worker_data cond"); - return VPX_CODEC_MEM_ERROR; - } -#endif - // If decoding in serial mode, FrameWorker thread could create tile worker - // thread or loopfilter thread. - frame_worker_data->pbi->max_threads = - (ctx->frame_parallel_decode == 0) ? ctx->cfg.threads : 0; - - frame_worker_data->pbi->inv_tile_order = ctx->invert_tile_order; - frame_worker_data->pbi->frame_parallel_decode = ctx->frame_parallel_decode; - frame_worker_data->pbi->common.frame_parallel_decode = - ctx->frame_parallel_decode; - worker->hook = (VP9WorkerHook)frame_worker_hook; - if (!winterface->reset(worker)) { - set_error_detail(ctx, "Frame Worker thread creation failed"); - return VPX_CODEC_MEM_ERROR; - } - } - - // If postprocessing was enabled by the application and a - // configuration has not been provided, default it. - if (!ctx->postproc_cfg_set && - (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC)) - set_default_ppflags(&ctx->postproc_cfg); - - init_buffer_callbacks(ctx); - - return VPX_CODEC_OK; -} - -static INLINE void check_resync(vpx_codec_alg_priv_t *const ctx, - const VP9Decoder *const pbi) { - // Clear resync flag if worker got a key frame or intra only frame. - if (ctx->need_resync == 1 && pbi->need_resync == 0 && - (pbi->common.intra_only || pbi->common.frame_type == KEY_FRAME)) - ctx->need_resync = 0; -} - -static vpx_codec_err_t decode_one(vpx_codec_alg_priv_t *ctx, - const uint8_t **data, unsigned int data_sz, - void *user_priv, int64_t deadline) { - vp9_ppflags_t flags = {0, 0, 0}; - const VP9WorkerInterface *const winterface = vp9_get_worker_interface(); - (void)deadline; - - // Determine the stream parameters. Note that we rely on peek_si to - // validate that we have a buffer that does not wrap around the top - // of the heap. - if (!ctx->si.h) { - int is_intra_only = 0; - const vpx_codec_err_t res = - decoder_peek_si_internal(*data, data_sz, &ctx->si, &is_intra_only, - ctx->decrypt_cb, ctx->decrypt_state); - if (res != VPX_CODEC_OK) - return res; - - if (!ctx->si.is_kf && !is_intra_only) - return VPX_CODEC_ERROR; - } - - if (!ctx->frame_parallel_decode) { - VP9Worker *const worker = ctx->frame_workers; - FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1; - frame_worker_data->data = *data; - frame_worker_data->data_size = data_sz; - frame_worker_data->user_priv = user_priv; - frame_worker_data->received_frame = 1; - - // Set these even if already initialized. The caller may have changed the - // decrypt config between frames. - frame_worker_data->pbi->decrypt_cb = ctx->decrypt_cb; - frame_worker_data->pbi->decrypt_state = ctx->decrypt_state; - - worker->had_error = 0; - winterface->execute(worker); - - // Update data pointer after decode. - *data = frame_worker_data->data_end; - - if (worker->had_error) - return update_error_state(ctx, &frame_worker_data->pbi->common.error); - - check_resync(ctx, frame_worker_data->pbi); - } else { - VP9Worker *const worker = &ctx->frame_workers[ctx->next_submit_worker_id]; - FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1; - // Copy context from last worker thread to next worker thread. - if (ctx->next_submit_worker_id != ctx->last_submit_worker_id) - vp9_frameworker_copy_context( - &ctx->frame_workers[ctx->next_submit_worker_id], - &ctx->frame_workers[ctx->last_submit_worker_id]); - - frame_worker_data->pbi->ready_for_new_data = 0; - // Copy the compressed data into worker's internal buffer. - // TODO(hkuang): Will all the workers allocate the same size - // as the size of the first intra frame be better? This will - // avoid too many deallocate and allocate. - if (frame_worker_data->scratch_buffer_size < data_sz) { - frame_worker_data->scratch_buffer = - (uint8_t *)vpx_realloc(frame_worker_data->scratch_buffer, data_sz); - if (frame_worker_data->scratch_buffer == NULL) { - set_error_detail(ctx, "Failed to reallocate scratch buffer"); - return VPX_CODEC_MEM_ERROR; - } - frame_worker_data->scratch_buffer_size = data_sz; - } - frame_worker_data->data_size = data_sz; - vpx_memcpy(frame_worker_data->scratch_buffer, *data, data_sz); - - frame_worker_data->frame_decoded = 0; - frame_worker_data->frame_context_ready = 0; - frame_worker_data->received_frame = 1; - frame_worker_data->data = frame_worker_data->scratch_buffer; - frame_worker_data->user_priv = user_priv; - - if (ctx->next_submit_worker_id != ctx->last_submit_worker_id) - ctx->last_submit_worker_id = - (ctx->last_submit_worker_id + 1) % ctx->num_frame_workers; - - ctx->next_submit_worker_id = - (ctx->next_submit_worker_id + 1) % ctx->num_frame_workers; - --ctx->available_threads; - worker->had_error = 0; - winterface->launch(worker); - } - - if (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC) - set_ppflags(ctx, &flags); - - return VPX_CODEC_OK; -} - -static void wait_worker_and_cache_frame(vpx_codec_alg_priv_t *ctx) { - YV12_BUFFER_CONFIG sd; - vp9_ppflags_t flags = {0, 0, 0}; - const VP9WorkerInterface *const winterface = vp9_get_worker_interface(); - VP9Worker *const worker = &ctx->frame_workers[ctx->next_output_worker_id]; - FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1; - ctx->next_output_worker_id = - (ctx->next_output_worker_id + 1) % ctx->num_frame_workers; - // TODO(hkuang): Add worker error handling here. - winterface->sync(worker); - frame_worker_data->received_frame = 0; - ++ctx->available_threads; - - check_resync(ctx, frame_worker_data->pbi); - - if (vp9_get_raw_frame(frame_worker_data->pbi, &sd, &flags) == 0) { - VP9_COMMON *const cm = &frame_worker_data->pbi->common; - RefCntBuffer *const frame_bufs = cm->buffer_pool->frame_bufs; - ctx->frame_cache[ctx->frame_cache_write].fb_idx = cm->new_fb_idx; - yuvconfig2image(&ctx->frame_cache[ctx->frame_cache_write].img, &sd, - frame_worker_data->user_priv); - ctx->frame_cache[ctx->frame_cache_write].img.fb_priv = - frame_bufs[cm->new_fb_idx].raw_frame_buffer.priv; - ctx->frame_cache_write = - (ctx->frame_cache_write + 1) % FRAME_CACHE_SIZE; - ++ctx->num_cache_frames; - } -} - -static vpx_codec_err_t decoder_decode(vpx_codec_alg_priv_t *ctx, - const uint8_t *data, unsigned int data_sz, - void *user_priv, long deadline) { - const uint8_t *data_start = data; - const uint8_t * const data_end = data + data_sz; - vpx_codec_err_t res; - uint32_t frame_sizes[8]; - int frame_count; - - if (data == NULL && data_sz == 0) { - ctx->flushed = 1; - return VPX_CODEC_OK; - } - - // Reset flushed when receiving a valid frame. - ctx->flushed = 0; - - // Initialize the decoder workers on the first frame. - if (ctx->frame_workers == NULL) { - const vpx_codec_err_t res = init_decoder(ctx); - if (res != VPX_CODEC_OK) - return res; - } - - res = vp9_parse_superframe_index(data, data_sz, frame_sizes, &frame_count, - ctx->decrypt_cb, ctx->decrypt_state); - if (res != VPX_CODEC_OK) - return res; - - if (ctx->frame_parallel_decode) { - // Decode in frame parallel mode. When decoding in this mode, the frame - // passed to the decoder must be either a normal frame or a superframe with - // superframe index so the decoder could get each frame's start position - // in the superframe. - if (frame_count > 0) { - int i; - - for (i = 0; i < frame_count; ++i) { - const uint8_t *data_start_copy = data_start; - const uint32_t frame_size = frame_sizes[i]; - if (data_start < data - || frame_size > (uint32_t) (data_end - data_start)) { - set_error_detail(ctx, "Invalid frame size in index"); - return VPX_CODEC_CORRUPT_FRAME; - } - - if (ctx->available_threads == 0) { - // No more threads for decoding. Wait until the next output worker - // finishes decoding. Then copy the decoded frame into cache. - if (ctx->num_cache_frames < FRAME_CACHE_SIZE) { - wait_worker_and_cache_frame(ctx); - } else { - // TODO(hkuang): Add unit test to test this path. - set_error_detail(ctx, "Frame output cache is full."); - return VPX_CODEC_ERROR; - } - } - - res = decode_one(ctx, &data_start_copy, frame_size, user_priv, - deadline); - if (res != VPX_CODEC_OK) - return res; - data_start += frame_size; - } - } else { - if (ctx->available_threads == 0) { - // No more threads for decoding. Wait until the next output worker - // finishes decoding. Then copy the decoded frame into cache. - if (ctx->num_cache_frames < FRAME_CACHE_SIZE) { - wait_worker_and_cache_frame(ctx); - } else { - // TODO(hkuang): Add unit test to test this path. - set_error_detail(ctx, "Frame output cache is full."); - return VPX_CODEC_ERROR; - } - } - - res = decode_one(ctx, &data, data_sz, user_priv, deadline); - if (res != VPX_CODEC_OK) - return res; - } - } else { - // Decode in serial mode. - if (frame_count > 0) { - int i; - - for (i = 0; i < frame_count; ++i) { - const uint8_t *data_start_copy = data_start; - const uint32_t frame_size = frame_sizes[i]; - vpx_codec_err_t res; - if (data_start < data - || frame_size > (uint32_t) (data_end - data_start)) { - set_error_detail(ctx, "Invalid frame size in index"); - return VPX_CODEC_CORRUPT_FRAME; - } - - res = decode_one(ctx, &data_start_copy, frame_size, user_priv, - deadline); - if (res != VPX_CODEC_OK) - return res; - - data_start += frame_size; - } - } else { - while (data_start < data_end) { - const uint32_t frame_size = (uint32_t) (data_end - data_start); - const vpx_codec_err_t res = decode_one(ctx, &data_start, frame_size, - user_priv, deadline); - if (res != VPX_CODEC_OK) - return res; - - // Account for suboptimal termination by the encoder. - while (data_start < data_end) { - const uint8_t marker = read_marker(ctx->decrypt_cb, - ctx->decrypt_state, data_start); - if (marker) - break; - ++data_start; - } - } - } - } - - return res; -} - -static void release_last_output_frame(vpx_codec_alg_priv_t *ctx) { - RefCntBuffer *const frame_bufs = ctx->buffer_pool->frame_bufs; - // Decrease reference count of last output frame in frame parallel mode. - if (ctx->frame_parallel_decode && ctx->last_show_frame >= 0) { - BufferPool *const pool = ctx->buffer_pool; - lock_buffer_pool(pool); - decrease_ref_count(ctx->last_show_frame, frame_bufs, pool); - unlock_buffer_pool(pool); - } -} - -static vpx_image_t *decoder_get_frame(vpx_codec_alg_priv_t *ctx, - vpx_codec_iter_t *iter) { - vpx_image_t *img = NULL; - - // Only return frame when all the cpu are busy or - // application fluhsed the decoder in frame parallel decode. - if (ctx->frame_parallel_decode && ctx->available_threads > 0 && - !ctx->flushed) { - return NULL; - } - - // Output the frames in the cache first. - if (ctx->num_cache_frames > 0) { - release_last_output_frame(ctx); - ctx->last_show_frame = ctx->frame_cache[ctx->frame_cache_read].fb_idx; - if (ctx->need_resync) - return NULL; - img = &ctx->frame_cache[ctx->frame_cache_read].img; - ctx->frame_cache_read = (ctx->frame_cache_read + 1) % FRAME_CACHE_SIZE; - --ctx->num_cache_frames; - return img; - } - - // iter acts as a flip flop, so an image is only returned on the first - // call to get_frame. - if (*iter == NULL && ctx->frame_workers != NULL) { - do { - YV12_BUFFER_CONFIG sd; - vp9_ppflags_t flags = {0, 0, 0}; - const VP9WorkerInterface *const winterface = vp9_get_worker_interface(); - VP9Worker *const worker = - &ctx->frame_workers[ctx->next_output_worker_id]; - FrameWorkerData *const frame_worker_data = - (FrameWorkerData *)worker->data1; - ctx->next_output_worker_id = - (ctx->next_output_worker_id + 1) % ctx->num_frame_workers; - // Wait for the frame from worker thread. - if (winterface->sync(worker)) { - // Check if worker has received any frames. - if (frame_worker_data->received_frame == 1) { - ++ctx->available_threads; - frame_worker_data->received_frame = 0; - check_resync(ctx, frame_worker_data->pbi); - } - if (vp9_get_raw_frame(frame_worker_data->pbi, &sd, &flags) == 0) { - VP9_COMMON *const cm = &frame_worker_data->pbi->common; - RefCntBuffer *const frame_bufs = cm->buffer_pool->frame_bufs; - release_last_output_frame(ctx); - ctx->last_show_frame = frame_worker_data->pbi->common.new_fb_idx; - if (ctx->need_resync) - return NULL; - yuvconfig2image(&ctx->img, &sd, frame_worker_data->user_priv); - ctx->img.fb_priv = frame_bufs[cm->new_fb_idx].raw_frame_buffer.priv; - img = &ctx->img; - return img; - } - } else { - // Decoding failed. Release the worker thread. - frame_worker_data->received_frame = 0; - ++ctx->available_threads; - ctx->need_resync = 1; - if (ctx->flushed != 1) - return NULL; - } - } while (ctx->next_output_worker_id != ctx->next_submit_worker_id); - } - return NULL; -} - -static vpx_codec_err_t decoder_set_fb_fn( - vpx_codec_alg_priv_t *ctx, - vpx_get_frame_buffer_cb_fn_t cb_get, - vpx_release_frame_buffer_cb_fn_t cb_release, void *cb_priv) { - if (cb_get == NULL || cb_release == NULL) { - return VPX_CODEC_INVALID_PARAM; - } else if (ctx->frame_workers == NULL) { - // If the decoder has already been initialized, do not accept changes to - // the frame buffer functions. - ctx->get_ext_fb_cb = cb_get; - ctx->release_ext_fb_cb = cb_release; - ctx->ext_priv = cb_priv; - return VPX_CODEC_OK; - } - - return VPX_CODEC_ERROR; -} - -static vpx_codec_err_t ctrl_set_reference(vpx_codec_alg_priv_t *ctx, - va_list args) { - vpx_ref_frame_t *const data = va_arg(args, vpx_ref_frame_t *); - - // Only support this function in serial decode. - if (ctx->frame_parallel_decode) { - set_error_detail(ctx, "Not supported in frame parallel decode"); - return VPX_CODEC_INCAPABLE; - } - - if (data) { - vpx_ref_frame_t *const frame = (vpx_ref_frame_t *)data; - YV12_BUFFER_CONFIG sd; - VP9Worker *const worker = ctx->frame_workers; - FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1; - image2yuvconfig(&frame->img, &sd); - return vp9_set_reference_dec(&frame_worker_data->pbi->common, - (VP9_REFFRAME)frame->frame_type, &sd); - } else { - return VPX_CODEC_INVALID_PARAM; - } -} - -static vpx_codec_err_t ctrl_copy_reference(vpx_codec_alg_priv_t *ctx, - va_list args) { - vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *); - - // Only support this function in serial decode. - if (ctx->frame_parallel_decode) { - set_error_detail(ctx, "Not supported in frame parallel decode"); - return VPX_CODEC_INCAPABLE; - } - - if (data) { - vpx_ref_frame_t *frame = (vpx_ref_frame_t *) data; - YV12_BUFFER_CONFIG sd; - VP9Worker *const worker = ctx->frame_workers; - FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1; - image2yuvconfig(&frame->img, &sd); - return vp9_copy_reference_dec(frame_worker_data->pbi, - (VP9_REFFRAME)frame->frame_type, &sd); - } else { - return VPX_CODEC_INVALID_PARAM; - } -} - -static vpx_codec_err_t ctrl_get_reference(vpx_codec_alg_priv_t *ctx, - va_list args) { - vp9_ref_frame_t *data = va_arg(args, vp9_ref_frame_t *); - - // Only support this function in serial decode. - if (ctx->frame_parallel_decode) { - set_error_detail(ctx, "Not supported in frame parallel decode"); - return VPX_CODEC_INCAPABLE; - } - - if (data) { - YV12_BUFFER_CONFIG* fb; - VP9Worker *const worker = ctx->frame_workers; - FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1; - fb = get_ref_frame(&frame_worker_data->pbi->common, data->idx); - if (fb == NULL) return VPX_CODEC_ERROR; - yuvconfig2image(&data->img, fb, NULL); - return VPX_CODEC_OK; - } else { - return VPX_CODEC_INVALID_PARAM; - } -} - -static vpx_codec_err_t ctrl_set_postproc(vpx_codec_alg_priv_t *ctx, - va_list args) { -#if CONFIG_VP9_POSTPROC - vp8_postproc_cfg_t *data = va_arg(args, vp8_postproc_cfg_t *); - - if (data) { - ctx->postproc_cfg_set = 1; - ctx->postproc_cfg = *((vp8_postproc_cfg_t *)data); - return VPX_CODEC_OK; - } else { - return VPX_CODEC_INVALID_PARAM; - } -#else - (void)ctx; - (void)args; - return VPX_CODEC_INCAPABLE; -#endif -} - -static vpx_codec_err_t ctrl_set_dbg_options(vpx_codec_alg_priv_t *ctx, - va_list args) { - (void)ctx; - (void)args; - return VPX_CODEC_INCAPABLE; -} - -static vpx_codec_err_t ctrl_get_last_ref_updates(vpx_codec_alg_priv_t *ctx, - va_list args) { - int *const update_info = va_arg(args, int *); - - // Only support this function in serial decode. - if (ctx->frame_parallel_decode) { - set_error_detail(ctx, "Not supported in frame parallel decode"); - return VPX_CODEC_INCAPABLE; - } - - if (update_info) { - if (ctx->frame_workers) { - VP9Worker *const worker = ctx->frame_workers; - FrameWorkerData *const frame_worker_data = - (FrameWorkerData *)worker->data1; - *update_info = frame_worker_data->pbi->refresh_frame_flags; - return VPX_CODEC_OK; - } else { - return VPX_CODEC_ERROR; - } - } - - return VPX_CODEC_INVALID_PARAM; -} - -static vpx_codec_err_t ctrl_get_frame_corrupted(vpx_codec_alg_priv_t *ctx, - va_list args) { - int *corrupted = va_arg(args, int *); - - if (corrupted) { - if (ctx->frame_workers) { - VP9Worker *const worker = ctx->frame_workers; - FrameWorkerData *const frame_worker_data = - (FrameWorkerData *)worker->data1; - RefCntBuffer *const frame_bufs = - frame_worker_data->pbi->common.buffer_pool->frame_bufs; - if (frame_worker_data->pbi->common.frame_to_show == NULL) - return VPX_CODEC_ERROR; - *corrupted = frame_bufs[ctx->last_show_frame].buf.corrupted; - return VPX_CODEC_OK; - } else { - return VPX_CODEC_ERROR; - } - } - - return VPX_CODEC_INVALID_PARAM; -} - -static vpx_codec_err_t ctrl_get_frame_size(vpx_codec_alg_priv_t *ctx, - va_list args) { - int *const frame_size = va_arg(args, int *); - - // Only support this function in serial decode. - if (ctx->frame_parallel_decode) { - set_error_detail(ctx, "Not supported in frame parallel decode"); - return VPX_CODEC_INCAPABLE; - } - - if (frame_size) { - if (ctx->frame_workers) { - VP9Worker *const worker = ctx->frame_workers; - FrameWorkerData *const frame_worker_data = - (FrameWorkerData *)worker->data1; - const VP9_COMMON *const cm = &frame_worker_data->pbi->common; - frame_size[0] = cm->width; - frame_size[1] = cm->height; - return VPX_CODEC_OK; - } else { - return VPX_CODEC_ERROR; - } - } - - return VPX_CODEC_INVALID_PARAM; -} - -static vpx_codec_err_t ctrl_get_display_size(vpx_codec_alg_priv_t *ctx, - va_list args) { - int *const display_size = va_arg(args, int *); - - // Only support this function in serial decode. - if (ctx->frame_parallel_decode) { - set_error_detail(ctx, "Not supported in frame parallel decode"); - return VPX_CODEC_INCAPABLE; - } - - if (display_size) { - if (ctx->frame_workers) { - VP9Worker *const worker = ctx->frame_workers; - FrameWorkerData *const frame_worker_data = - (FrameWorkerData *)worker->data1; - const VP9_COMMON *const cm = &frame_worker_data->pbi->common; - display_size[0] = cm->display_width; - display_size[1] = cm->display_height; - return VPX_CODEC_OK; - } else { - return VPX_CODEC_ERROR; - } - } - - return VPX_CODEC_INVALID_PARAM; -} - -static vpx_codec_err_t ctrl_get_bit_depth(vpx_codec_alg_priv_t *ctx, - va_list args) { - unsigned int *const bit_depth = va_arg(args, unsigned int *); - VP9Worker *const worker = &ctx->frame_workers[ctx->next_output_worker_id]; - - if (bit_depth) { - if (worker) { - FrameWorkerData *const frame_worker_data = - (FrameWorkerData *)worker->data1; - const VP9_COMMON *const cm = &frame_worker_data->pbi->common; - *bit_depth = cm->bit_depth; - return VPX_CODEC_OK; - } else { - return VPX_CODEC_ERROR; - } - } - - return VPX_CODEC_INVALID_PARAM; -} - -static vpx_codec_err_t ctrl_set_invert_tile_order(vpx_codec_alg_priv_t *ctx, - va_list args) { - ctx->invert_tile_order = va_arg(args, int); - return VPX_CODEC_OK; -} - -static vpx_codec_err_t ctrl_set_decryptor(vpx_codec_alg_priv_t *ctx, - va_list args) { - vpx_decrypt_init *init = va_arg(args, vpx_decrypt_init *); - ctx->decrypt_cb = init ? init->decrypt_cb : NULL; - ctx->decrypt_state = init ? init->decrypt_state : NULL; - return VPX_CODEC_OK; -} - -static vpx_codec_err_t ctrl_set_byte_alignment(vpx_codec_alg_priv_t *ctx, - va_list args) { - const int legacy_byte_alignment = 0; - const int min_byte_alignment = 32; - const int max_byte_alignment = 1024; - const int byte_alignment = va_arg(args, int); - - if (byte_alignment != legacy_byte_alignment && - (byte_alignment < min_byte_alignment || - byte_alignment > max_byte_alignment || - (byte_alignment & (byte_alignment - 1)) != 0)) - return VPX_CODEC_INVALID_PARAM; - - ctx->byte_alignment = byte_alignment; - if (ctx->frame_workers) { - VP9Worker *const worker = ctx->frame_workers; - FrameWorkerData *const frame_worker_data = - (FrameWorkerData *)worker->data1; - frame_worker_data->pbi->common.byte_alignment = byte_alignment; - } - return VPX_CODEC_OK; -} - -static vpx_codec_ctrl_fn_map_t decoder_ctrl_maps[] = { - {VP8_COPY_REFERENCE, ctrl_copy_reference}, - - // Setters - {VP8_SET_REFERENCE, ctrl_set_reference}, - {VP8_SET_POSTPROC, ctrl_set_postproc}, - {VP8_SET_DBG_COLOR_REF_FRAME, ctrl_set_dbg_options}, - {VP8_SET_DBG_COLOR_MB_MODES, ctrl_set_dbg_options}, - {VP8_SET_DBG_COLOR_B_MODES, ctrl_set_dbg_options}, - {VP8_SET_DBG_DISPLAY_MV, ctrl_set_dbg_options}, - {VP9_INVERT_TILE_DECODE_ORDER, ctrl_set_invert_tile_order}, - {VPXD_SET_DECRYPTOR, ctrl_set_decryptor}, - {VP9_SET_BYTE_ALIGNMENT, ctrl_set_byte_alignment}, - - // Getters - {VP8D_GET_LAST_REF_UPDATES, ctrl_get_last_ref_updates}, - {VP8D_GET_FRAME_CORRUPTED, ctrl_get_frame_corrupted}, - {VP9_GET_REFERENCE, ctrl_get_reference}, - {VP9D_GET_DISPLAY_SIZE, ctrl_get_display_size}, - {VP9D_GET_BIT_DEPTH, ctrl_get_bit_depth}, - {VP9D_GET_FRAME_SIZE, ctrl_get_frame_size}, - - { -1, NULL}, -}; - -#ifndef VERSION_STRING -#define VERSION_STRING -#endif -CODEC_INTERFACE(vpx_codec_vp9_dx) = { - "WebM Project VP9 Decoder" VERSION_STRING, - VPX_CODEC_INTERNAL_ABI_VERSION, - VPX_CODEC_CAP_DECODER | VP9_CAP_POSTPROC | - VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER, // vpx_codec_caps_t - decoder_init, // vpx_codec_init_fn_t - decoder_destroy, // vpx_codec_destroy_fn_t - decoder_ctrl_maps, // vpx_codec_ctrl_fn_map_t - { // NOLINT - decoder_peek_si, // vpx_codec_peek_si_fn_t - decoder_get_si, // vpx_codec_get_si_fn_t - decoder_decode, // vpx_codec_decode_fn_t - decoder_get_frame, // vpx_codec_frame_get_fn_t - decoder_set_fb_fn, // vpx_codec_set_fb_fn_t - }, - { // NOLINT - 0, - NULL, // vpx_codec_enc_cfg_map_t - NULL, // vpx_codec_encode_fn_t - NULL, // vpx_codec_get_cx_data_fn_t - NULL, // vpx_codec_enc_config_set_fn_t - NULL, // vpx_codec_get_global_headers_fn_t - NULL, // vpx_codec_get_preview_frame_fn_t - NULL // vpx_codec_enc_mr_get_mem_loc_fn_t - } -}; diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/vp9dx.mk gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/vp9dx.mk --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/vp9dx.mk 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/vp9dx.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -## -## Copyright (c) 2010 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - -VP9_DX_EXPORTS += exports_dec - -VP9_DX_SRCS-yes += $(VP9_COMMON_SRCS-yes) -VP9_DX_SRCS-no += $(VP9_COMMON_SRCS-no) -VP9_DX_SRCS_REMOVE-yes += $(VP9_COMMON_SRCS_REMOVE-yes) -VP9_DX_SRCS_REMOVE-no += $(VP9_COMMON_SRCS_REMOVE-no) - -VP9_DX_SRCS-yes += vp9_dx_iface.c - -VP9_DX_SRCS-yes += decoder/vp9_decodemv.c -VP9_DX_SRCS-yes += decoder/vp9_decodeframe.c -VP9_DX_SRCS-yes += decoder/vp9_decodeframe.h -VP9_DX_SRCS-yes += decoder/vp9_detokenize.c -VP9_DX_SRCS-yes += decoder/vp9_reader.h -VP9_DX_SRCS-yes += decoder/vp9_reader.c -VP9_DX_SRCS-yes += decoder/vp9_read_bit_buffer.c -VP9_DX_SRCS-yes += decoder/vp9_read_bit_buffer.h -VP9_DX_SRCS-yes += decoder/vp9_decodemv.h -VP9_DX_SRCS-yes += decoder/vp9_detokenize.h -VP9_DX_SRCS-yes += decoder/vp9_dthread.c -VP9_DX_SRCS-yes += decoder/vp9_dthread.h -VP9_DX_SRCS-yes += decoder/vp9_decoder.c -VP9_DX_SRCS-yes += decoder/vp9_decoder.h -VP9_DX_SRCS-yes += decoder/vp9_dsubexp.c -VP9_DX_SRCS-yes += decoder/vp9_dsubexp.h - -VP9_DX_SRCS-yes := $(filter-out $(VP9_DX_SRCS_REMOVE-yes),$(VP9_DX_SRCS-yes)) diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/vp9_iface_common.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/vp9_iface_common.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vp9/vp9_iface_common.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vp9/vp9_iface_common.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef VP9_VP9_IFACE_COMMON_H_ -#define VP9_VP9_IFACE_COMMON_H_ - -static void yuvconfig2image(vpx_image_t *img, const YV12_BUFFER_CONFIG *yv12, - void *user_priv) { - /** vpx_img_wrap() doesn't allow specifying independent strides for - * the Y, U, and V planes, nor other alignment adjustments that - * might be representable by a YV12_BUFFER_CONFIG, so we just - * initialize all the fields.*/ - int bps; - if (!yv12->subsampling_y) { - if (!yv12->subsampling_x) { - img->fmt = VPX_IMG_FMT_I444; - bps = 24; - } else { - img->fmt = VPX_IMG_FMT_I422; - bps = 16; - } - } else { - if (!yv12->subsampling_x) { - img->fmt = VPX_IMG_FMT_I440; - bps = 16; - } else { - img->fmt = VPX_IMG_FMT_I420; - bps = 12; - } - } - img->cs = yv12->color_space; - img->bit_depth = 8; - img->w = yv12->y_stride; - img->h = ALIGN_POWER_OF_TWO(yv12->y_height + 2 * VP9_ENC_BORDER_IN_PIXELS, 3); - img->d_w = yv12->y_crop_width; - img->d_h = yv12->y_crop_height; - img->x_chroma_shift = yv12->subsampling_x; - img->y_chroma_shift = yv12->subsampling_y; - img->planes[VPX_PLANE_Y] = yv12->y_buffer; - img->planes[VPX_PLANE_U] = yv12->u_buffer; - img->planes[VPX_PLANE_V] = yv12->v_buffer; - img->planes[VPX_PLANE_ALPHA] = NULL; - img->stride[VPX_PLANE_Y] = yv12->y_stride; - img->stride[VPX_PLANE_U] = yv12->uv_stride; - img->stride[VPX_PLANE_V] = yv12->uv_stride; - img->stride[VPX_PLANE_ALPHA] = yv12->y_stride; -#if CONFIG_VP9_HIGHBITDEPTH - if (yv12->flags & YV12_FLAG_HIGHBITDEPTH) { - // vpx_image_t uses byte strides and a pointer to the first byte - // of the image. - img->fmt |= VPX_IMG_FMT_HIGHBITDEPTH; - img->bit_depth = yv12->bit_depth; - img->planes[VPX_PLANE_Y] = (uint8_t*)CONVERT_TO_SHORTPTR(yv12->y_buffer); - img->planes[VPX_PLANE_U] = (uint8_t*)CONVERT_TO_SHORTPTR(yv12->u_buffer); - img->planes[VPX_PLANE_V] = (uint8_t*)CONVERT_TO_SHORTPTR(yv12->v_buffer); - img->planes[VPX_PLANE_ALPHA] = NULL; - img->stride[VPX_PLANE_Y] = 2 * yv12->y_stride; - img->stride[VPX_PLANE_U] = 2 * yv12->uv_stride; - img->stride[VPX_PLANE_V] = 2 * yv12->uv_stride; - img->stride[VPX_PLANE_ALPHA] = 2 * yv12->y_stride; - } -#endif // CONFIG_VP9_HIGHBITDEPTH - img->bps = bps; - img->user_priv = user_priv; - img->img_data = yv12->buffer_alloc; - img->img_data_owner = 0; - img->self_allocd = 0; -} - -static vpx_codec_err_t image2yuvconfig(const vpx_image_t *img, - YV12_BUFFER_CONFIG *yv12) { - yv12->y_buffer = img->planes[VPX_PLANE_Y]; - yv12->u_buffer = img->planes[VPX_PLANE_U]; - yv12->v_buffer = img->planes[VPX_PLANE_V]; - - yv12->y_crop_width = img->d_w; - yv12->y_crop_height = img->d_h; - yv12->y_width = img->d_w; - yv12->y_height = img->d_h; - - yv12->uv_width = img->x_chroma_shift == 1 ? (1 + yv12->y_width) / 2 - : yv12->y_width; - yv12->uv_height = img->y_chroma_shift == 1 ? (1 + yv12->y_height) / 2 - : yv12->y_height; - yv12->uv_crop_width = yv12->uv_width; - yv12->uv_crop_height = yv12->uv_height; - - yv12->y_stride = img->stride[VPX_PLANE_Y]; - yv12->uv_stride = img->stride[VPX_PLANE_U]; - yv12->color_space = img->cs; - -#if CONFIG_VP9_HIGHBITDEPTH - if (img->fmt & VPX_IMG_FMT_HIGHBITDEPTH) { - // In vpx_image_t - // planes point to uint8 address of start of data - // stride counts uint8s to reach next row - // In YV12_BUFFER_CONFIG - // y_buffer, u_buffer, v_buffer point to uint16 address of data - // stride and border counts in uint16s - // This means that all the address calculations in the main body of code - // should work correctly. - // However, before we do any pixel operations we need to cast the address - // to a uint16 ponter and double its value. - yv12->y_buffer = CONVERT_TO_BYTEPTR(yv12->y_buffer); - yv12->u_buffer = CONVERT_TO_BYTEPTR(yv12->u_buffer); - yv12->v_buffer = CONVERT_TO_BYTEPTR(yv12->v_buffer); - yv12->y_stride >>= 1; - yv12->uv_stride >>= 1; - yv12->flags = YV12_FLAG_HIGHBITDEPTH; - } else { - yv12->flags = 0; - } - yv12->border = (yv12->y_stride - img->w) / 2; -#else - yv12->border = (img->stride[VPX_PLANE_Y] - img->w) / 2; -#endif // CONFIG_VP9_HIGHBITDEPTH - yv12->subsampling_x = img->x_chroma_shift; - yv12->subsampling_y = img->y_chroma_shift; - return VPX_CODEC_OK; -} - -#endif // VP9_VP9_IFACE_COMMON_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/internal/vpx_codec_internal.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/internal/vpx_codec_internal.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/internal/vpx_codec_internal.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/internal/vpx_codec_internal.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,437 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/*!\file - * \brief Describes the decoder algorithm interface for algorithm - * implementations. - * - * This file defines the private structures and data types that are only - * relevant to implementing an algorithm, as opposed to using it. - * - * To create a decoder algorithm class, an interface structure is put - * into the global namespace: - *
- *     my_codec.c:
- *       vpx_codec_iface_t my_codec = {
- *           "My Codec v1.0",
- *           VPX_CODEC_ALG_ABI_VERSION,
- *           ...
- *       };
- *     
- * - * An application instantiates a specific decoder instance by using - * vpx_codec_init() and a pointer to the algorithm's interface structure: - *
- *     my_app.c:
- *       extern vpx_codec_iface_t my_codec;
- *       {
- *           vpx_codec_ctx_t algo;
- *           res = vpx_codec_init(&algo, &my_codec);
- *       }
- *     
- * - * Once initialized, the instance is manged using other functions from - * the vpx_codec_* family. - */ -#ifndef VPX_INTERNAL_VPX_CODEC_INTERNAL_H_ -#define VPX_INTERNAL_VPX_CODEC_INTERNAL_H_ -#include "../vpx_decoder.h" -#include "../vpx_encoder.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/*!\brief Current ABI version number - * - * \internal - * If this file is altered in any way that changes the ABI, this value - * must be bumped. Examples include, but are not limited to, changing - * types, removing or reassigning enums, adding/removing/rearranging - * fields to structures - */ -#define VPX_CODEC_INTERNAL_ABI_VERSION (5) /**<\hideinitializer*/ - -typedef struct vpx_codec_alg_priv vpx_codec_alg_priv_t; -typedef struct vpx_codec_priv_enc_mr_cfg vpx_codec_priv_enc_mr_cfg_t; - -/*!\brief init function pointer prototype - * - * Performs algorithm-specific initialization of the decoder context. This - * function is called by the generic vpx_codec_init() wrapper function, so - * plugins implementing this interface may trust the input parameters to be - * properly initialized. - * - * \param[in] ctx Pointer to this instance's context - * \retval #VPX_CODEC_OK - * The input stream was recognized and decoder initialized. - * \retval #VPX_CODEC_MEM_ERROR - * Memory operation failed. - */ -typedef vpx_codec_err_t (*vpx_codec_init_fn_t)(vpx_codec_ctx_t *ctx, - vpx_codec_priv_enc_mr_cfg_t *data); - -/*!\brief destroy function pointer prototype - * - * Performs algorithm-specific destruction of the decoder context. This - * function is called by the generic vpx_codec_destroy() wrapper function, - * so plugins implementing this interface may trust the input parameters - * to be properly initialized. - * - * \param[in] ctx Pointer to this instance's context - * \retval #VPX_CODEC_OK - * The input stream was recognized and decoder initialized. - * \retval #VPX_CODEC_MEM_ERROR - * Memory operation failed. - */ -typedef vpx_codec_err_t (*vpx_codec_destroy_fn_t)(vpx_codec_alg_priv_t *ctx); - -/*!\brief parse stream info function pointer prototype - * - * Performs high level parsing of the bitstream. This function is called by the - * generic vpx_codec_peek_stream_info() wrapper function, so plugins - * implementing this interface may trust the input parameters to be properly - * initialized. - * - * \param[in] data Pointer to a block of data to parse - * \param[in] data_sz Size of the data buffer - * \param[in,out] si Pointer to stream info to update. The size member - * \ref MUST be properly initialized, but \ref MAY be - * clobbered by the algorithm. This parameter \ref MAY - * be NULL. - * - * \retval #VPX_CODEC_OK - * Bitstream is parsable and stream information updated - */ -typedef vpx_codec_err_t (*vpx_codec_peek_si_fn_t)(const uint8_t *data, - unsigned int data_sz, - vpx_codec_stream_info_t *si); - -/*!\brief Return information about the current stream. - * - * Returns information about the stream that has been parsed during decoding. - * - * \param[in] ctx Pointer to this instance's context - * \param[in,out] si Pointer to stream info to update. The size member - * \ref MUST be properly initialized, but \ref MAY be - * clobbered by the algorithm. This parameter \ref MAY - * be NULL. - * - * \retval #VPX_CODEC_OK - * Bitstream is parsable and stream information updated - */ -typedef vpx_codec_err_t (*vpx_codec_get_si_fn_t)(vpx_codec_alg_priv_t *ctx, - vpx_codec_stream_info_t *si); - -/*!\brief control function pointer prototype - * - * This function is used to exchange algorithm specific data with the decoder - * instance. This can be used to implement features specific to a particular - * algorithm. - * - * This function is called by the generic vpx_codec_control() wrapper - * function, so plugins implementing this interface may trust the input - * parameters to be properly initialized. However, this interface does not - * provide type safety for the exchanged data or assign meanings to the - * control codes. Those details should be specified in the algorithm's - * header file. In particular, the ctrl_id parameter is guaranteed to exist - * in the algorithm's control mapping table, and the data parameter may be NULL. - * - * - * \param[in] ctx Pointer to this instance's context - * \param[in] ctrl_id Algorithm specific control identifier - * \param[in,out] data Data to exchange with algorithm instance. - * - * \retval #VPX_CODEC_OK - * The internal state data was deserialized. - */ -typedef vpx_codec_err_t (*vpx_codec_control_fn_t)(vpx_codec_alg_priv_t *ctx, - va_list ap); - -/*!\brief control function pointer mapping - * - * This structure stores the mapping between control identifiers and - * implementing functions. Each algorithm provides a list of these - * mappings. This list is searched by the vpx_codec_control() wrapper - * function to determine which function to invoke. The special - * value {0, NULL} is used to indicate end-of-list, and must be - * present. The special value {0, } can be used as a catch-all - * mapping. This implies that ctrl_id values chosen by the algorithm - * \ref MUST be non-zero. - */ -typedef const struct vpx_codec_ctrl_fn_map { - int ctrl_id; - vpx_codec_control_fn_t fn; -} vpx_codec_ctrl_fn_map_t; - -/*!\brief decode data function pointer prototype - * - * Processes a buffer of coded data. If the processing results in a new - * decoded frame becoming available, #VPX_CODEC_CB_PUT_SLICE and - * #VPX_CODEC_CB_PUT_FRAME events are generated as appropriate. This - * function is called by the generic vpx_codec_decode() wrapper function, - * so plugins implementing this interface may trust the input parameters - * to be properly initialized. - * - * \param[in] ctx Pointer to this instance's context - * \param[in] data Pointer to this block of new coded data. If - * NULL, a #VPX_CODEC_CB_PUT_FRAME event is posted - * for the previously decoded frame. - * \param[in] data_sz Size of the coded data, in bytes. - * - * \return Returns #VPX_CODEC_OK if the coded data was processed completely - * and future pictures can be decoded without error. Otherwise, - * see the descriptions of the other error codes in ::vpx_codec_err_t - * for recoverability capabilities. - */ -typedef vpx_codec_err_t (*vpx_codec_decode_fn_t)(vpx_codec_alg_priv_t *ctx, - const uint8_t *data, - unsigned int data_sz, - void *user_priv, - long deadline); - -/*!\brief Decoded frames iterator - * - * Iterates over a list of the frames available for display. The iterator - * storage should be initialized to NULL to start the iteration. Iteration is - * complete when this function returns NULL. - * - * The list of available frames becomes valid upon completion of the - * vpx_codec_decode call, and remains valid until the next call to vpx_codec_decode. - * - * \param[in] ctx Pointer to this instance's context - * \param[in out] iter Iterator storage, initialized to NULL - * - * \return Returns a pointer to an image, if one is ready for display. Frames - * produced will always be in PTS (presentation time stamp) order. - */ -typedef vpx_image_t *(*vpx_codec_get_frame_fn_t)(vpx_codec_alg_priv_t *ctx, - vpx_codec_iter_t *iter); - -/*!\brief Pass in external frame buffers for the decoder to use. - * - * Registers functions to be called when libvpx needs a frame buffer - * to decode the current frame and a function to be called when libvpx does - * not internally reference the frame buffer. This set function must - * be called before the first call to decode or libvpx will assume the - * default behavior of allocating frame buffers internally. - * - * \param[in] ctx Pointer to this instance's context - * \param[in] cb_get Pointer to the get callback function - * \param[in] cb_release Pointer to the release callback function - * \param[in] cb_priv Callback's private data - * - * \retval #VPX_CODEC_OK - * External frame buffers will be used by libvpx. - * \retval #VPX_CODEC_INVALID_PARAM - * One or more of the callbacks were NULL. - * \retval #VPX_CODEC_ERROR - * Decoder context not initialized, or algorithm not capable of - * using external frame buffers. - * - * \note - * When decoding VP9, the application may be required to pass in at least - * #VP9_MAXIMUM_REF_BUFFERS + #VPX_MAXIMUM_WORK_BUFFERS external frame - * buffers. - */ -typedef vpx_codec_err_t (*vpx_codec_set_fb_fn_t)( - vpx_codec_alg_priv_t *ctx, - vpx_get_frame_buffer_cb_fn_t cb_get, - vpx_release_frame_buffer_cb_fn_t cb_release, void *cb_priv); - - -typedef vpx_codec_err_t (*vpx_codec_encode_fn_t)(vpx_codec_alg_priv_t *ctx, - const vpx_image_t *img, - vpx_codec_pts_t pts, - unsigned long duration, - vpx_enc_frame_flags_t flags, - unsigned long deadline); -typedef const vpx_codec_cx_pkt_t *(*vpx_codec_get_cx_data_fn_t)(vpx_codec_alg_priv_t *ctx, - vpx_codec_iter_t *iter); - -typedef vpx_codec_err_t -(*vpx_codec_enc_config_set_fn_t)(vpx_codec_alg_priv_t *ctx, - const vpx_codec_enc_cfg_t *cfg); -typedef vpx_fixed_buf_t * -(*vpx_codec_get_global_headers_fn_t)(vpx_codec_alg_priv_t *ctx); - -typedef vpx_image_t * -(*vpx_codec_get_preview_frame_fn_t)(vpx_codec_alg_priv_t *ctx); - -typedef vpx_codec_err_t -(*vpx_codec_enc_mr_get_mem_loc_fn_t)(const vpx_codec_enc_cfg_t *cfg, - void **mem_loc); - -/*!\brief usage configuration mapping - * - * This structure stores the mapping between usage identifiers and - * configuration structures. Each algorithm provides a list of these - * mappings. This list is searched by the vpx_codec_enc_config_default() - * wrapper function to determine which config to return. The special value - * {-1, {0}} is used to indicate end-of-list, and must be present. At least - * one mapping must be present, in addition to the end-of-list. - * - */ -typedef const struct vpx_codec_enc_cfg_map { - int usage; - vpx_codec_enc_cfg_t cfg; -} vpx_codec_enc_cfg_map_t; - -/*!\brief Decoder algorithm interface interface - * - * All decoders \ref MUST expose a variable of this type. - */ -struct vpx_codec_iface { - const char *name; /**< Identification String */ - int abi_version; /**< Implemented ABI version */ - vpx_codec_caps_t caps; /**< Decoder capabilities */ - vpx_codec_init_fn_t init; /**< \copydoc ::vpx_codec_init_fn_t */ - vpx_codec_destroy_fn_t destroy; /**< \copydoc ::vpx_codec_destroy_fn_t */ - vpx_codec_ctrl_fn_map_t *ctrl_maps; /**< \copydoc ::vpx_codec_ctrl_fn_map_t */ - struct vpx_codec_dec_iface { - vpx_codec_peek_si_fn_t peek_si; /**< \copydoc ::vpx_codec_peek_si_fn_t */ - vpx_codec_get_si_fn_t get_si; /**< \copydoc ::vpx_codec_get_si_fn_t */ - vpx_codec_decode_fn_t decode; /**< \copydoc ::vpx_codec_decode_fn_t */ - vpx_codec_get_frame_fn_t get_frame; /**< \copydoc ::vpx_codec_get_frame_fn_t */ - vpx_codec_set_fb_fn_t set_fb_fn; /**< \copydoc ::vpx_codec_set_fb_fn_t */ - } dec; - struct vpx_codec_enc_iface { - int cfg_map_count; - vpx_codec_enc_cfg_map_t *cfg_maps; /**< \copydoc ::vpx_codec_enc_cfg_map_t */ - vpx_codec_encode_fn_t encode; /**< \copydoc ::vpx_codec_encode_fn_t */ - vpx_codec_get_cx_data_fn_t get_cx_data; /**< \copydoc ::vpx_codec_get_cx_data_fn_t */ - vpx_codec_enc_config_set_fn_t cfg_set; /**< \copydoc ::vpx_codec_enc_config_set_fn_t */ - vpx_codec_get_global_headers_fn_t get_glob_hdrs; /**< \copydoc ::vpx_codec_get_global_headers_fn_t */ - vpx_codec_get_preview_frame_fn_t get_preview; /**< \copydoc ::vpx_codec_get_preview_frame_fn_t */ - vpx_codec_enc_mr_get_mem_loc_fn_t mr_get_mem_loc; /**< \copydoc ::vpx_codec_enc_mr_get_mem_loc_fn_t */ - } enc; -}; - -/*!\brief Callback function pointer / user data pair storage */ -typedef struct vpx_codec_priv_cb_pair { - union { - vpx_codec_put_frame_cb_fn_t put_frame; - vpx_codec_put_slice_cb_fn_t put_slice; - } u; - void *user_priv; -} vpx_codec_priv_cb_pair_t; - - -/*!\brief Instance private storage - * - * This structure is allocated by the algorithm's init function. It can be - * extended in one of two ways. First, a second, algorithm specific structure - * can be allocated and the priv member pointed to it. Alternatively, this - * structure can be made the first member of the algorithm specific structure, - * and the pointer cast to the proper type. - */ -struct vpx_codec_priv { - const char *err_detail; - vpx_codec_flags_t init_flags; - struct { - vpx_codec_priv_cb_pair_t put_frame_cb; - vpx_codec_priv_cb_pair_t put_slice_cb; - } dec; - struct { - vpx_fixed_buf_t cx_data_dst_buf; - unsigned int cx_data_pad_before; - unsigned int cx_data_pad_after; - vpx_codec_cx_pkt_t cx_data_pkt; - unsigned int total_encoders; - } enc; -}; - -/* - * Multi-resolution encoding internal configuration - */ -struct vpx_codec_priv_enc_mr_cfg -{ - unsigned int mr_total_resolutions; - unsigned int mr_encoder_id; - struct vpx_rational mr_down_sampling_factor; - void* mr_low_res_mode_info; -}; - -#undef VPX_CTRL_USE_TYPE -#define VPX_CTRL_USE_TYPE(id, typ) \ - static VPX_INLINE typ id##__value(va_list args) {return va_arg(args, typ);} - -#undef VPX_CTRL_USE_TYPE_DEPRECATED -#define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ) \ - static VPX_INLINE typ id##__value(va_list args) {return va_arg(args, typ);} - -#define CAST(id, arg) id##__value(arg) - -/* CODEC_INTERFACE convenience macro - * - * By convention, each codec interface is a struct with extern linkage, where - * the symbol is suffixed with _algo. A getter function is also defined to - * return a pointer to the struct, since in some cases it's easier to work - * with text symbols than data symbols (see issue #169). This function has - * the same name as the struct, less the _algo suffix. The CODEC_INTERFACE - * macro is provided to define this getter function automatically. - */ -#define CODEC_INTERFACE(id)\ - vpx_codec_iface_t* id(void) { return &id##_algo; }\ - vpx_codec_iface_t id##_algo - - -/* Internal Utility Functions - * - * The following functions are intended to be used inside algorithms as - * utilities for manipulating vpx_codec_* data structures. - */ -struct vpx_codec_pkt_list { - unsigned int cnt; - unsigned int max; - struct vpx_codec_cx_pkt pkts[1]; -}; - -#define vpx_codec_pkt_list_decl(n)\ - union {struct vpx_codec_pkt_list head;\ - struct {struct vpx_codec_pkt_list head;\ - struct vpx_codec_cx_pkt pkts[n];} alloc;} - -#define vpx_codec_pkt_list_init(m)\ - (m)->alloc.head.cnt = 0,\ - (m)->alloc.head.max = sizeof((m)->alloc.pkts) / sizeof((m)->alloc.pkts[0]) - -int -vpx_codec_pkt_list_add(struct vpx_codec_pkt_list *, - const struct vpx_codec_cx_pkt *); - -const vpx_codec_cx_pkt_t * -vpx_codec_pkt_list_get(struct vpx_codec_pkt_list *list, - vpx_codec_iter_t *iter); - - -#include -#include - -struct vpx_internal_error_info { - vpx_codec_err_t error_code; - int has_detail; - char detail[80]; - int setjmp; - jmp_buf jmp; -}; - -void vpx_internal_error(struct vpx_internal_error_info *info, - vpx_codec_err_t error, - const char *fmt, - ...); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VPX_INTERNAL_VPX_CODEC_INTERNAL_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/internal/vpx_psnr.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/internal/vpx_psnr.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/internal/vpx_psnr.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/internal/vpx_psnr.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VPX_INTERNAL_VPX_PSNR_H_ -#define VPX_INTERNAL_VPX_PSNR_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -// TODO(dkovalev) change vpx_sse_to_psnr signature: double -> int64_t - -/*!\brief Converts SSE to PSNR - * - * Converts sum of squared errros (SSE) to peak signal-to-noise ratio (PNSR). - * - * \param[in] samples Number of samples - * \param[in] peak Max sample value - * \param[in] sse Sum of squared errors - */ -double vpx_sse_to_psnr(double samples, double peak, double sse); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VPX_INTERNAL_VPX_PSNR_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/src/svc_encodeframe.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/src/svc_encodeframe.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/src/svc_encodeframe.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/src/svc_encodeframe.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,583 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -/** - * @file - * VP9 SVC encoding support via libvpx - */ - -#include -#include -#include -#include -#include -#include -#include -#define VPX_DISABLE_CTRL_TYPECHECKS 1 -#include "./vpx_config.h" -#include "vpx/svc_context.h" -#include "vpx/vp8cx.h" -#include "vpx/vpx_encoder.h" -#include "vpx_mem/vpx_mem.h" -#include "vp9/common/vp9_onyxc_int.h" - -#ifdef __MINGW32__ -#define strtok_r strtok_s -#ifndef MINGW_HAS_SECURE_API -// proto from /usr/x86_64-w64-mingw32/include/sec_api/string_s.h -_CRTIMP char *__cdecl strtok_s(char *str, const char *delim, char **context); -#endif /* MINGW_HAS_SECURE_API */ -#endif /* __MINGW32__ */ - -#ifdef _MSC_VER -#define strdup _strdup -#define strtok_r strtok_s -#endif - -#define SVC_REFERENCE_FRAMES 8 -#define SUPERFRAME_SLOTS (8) -#define SUPERFRAME_BUFFER_SIZE (SUPERFRAME_SLOTS * sizeof(uint32_t) + 2) - -#define MAX_QUANTIZER 63 - -static const int DEFAULT_SCALE_FACTORS_NUM[VPX_SS_MAX_LAYERS] = { - 4, 5, 7, 11, 16 -}; - -static const int DEFAULT_SCALE_FACTORS_DEN[VPX_SS_MAX_LAYERS] = { - 16, 16, 16, 16, 16 -}; - -typedef enum { - QUANTIZER = 0, - BITRATE, - SCALE_FACTOR, - AUTO_ALT_REF, - ALL_OPTION_TYPES -} LAYER_OPTION_TYPE; - -static const int option_max_values[ALL_OPTION_TYPES] = { - 63, INT_MAX, INT_MAX, 1 -}; - -static const int option_min_values[ALL_OPTION_TYPES] = { - 0, 0, 1, 0 -}; - -// One encoded frame -typedef struct FrameData { - void *buf; // compressed data buffer - size_t size; // length of compressed data - vpx_codec_frame_flags_t flags; /**< flags for this frame */ - struct FrameData *next; -} FrameData; - -static SvcInternal_t *get_svc_internal(SvcContext *svc_ctx) { - if (svc_ctx == NULL) return NULL; - if (svc_ctx->internal == NULL) { - SvcInternal_t *const si = (SvcInternal_t *)malloc(sizeof(*si)); - if (si != NULL) { - memset(si, 0, sizeof(*si)); - } - svc_ctx->internal = si; - } - return (SvcInternal_t *)svc_ctx->internal; -} - -static const SvcInternal_t *get_const_svc_internal( - const SvcContext *svc_ctx) { - if (svc_ctx == NULL) return NULL; - return (const SvcInternal_t *)svc_ctx->internal; -} - -static void svc_log_reset(SvcContext *svc_ctx) { - SvcInternal_t *const si = (SvcInternal_t *)svc_ctx->internal; - si->message_buffer[0] = '\0'; -} - -static int svc_log(SvcContext *svc_ctx, SVC_LOG_LEVEL level, - const char *fmt, ...) { - char buf[512]; - int retval = 0; - va_list ap; - SvcInternal_t *const si = get_svc_internal(svc_ctx); - - if (level > svc_ctx->log_level) { - return retval; - } - - va_start(ap, fmt); - retval = vsnprintf(buf, sizeof(buf), fmt, ap); - va_end(ap); - - if (svc_ctx->log_print) { - printf("%s", buf); - } else { - strncat(si->message_buffer, buf, - sizeof(si->message_buffer) - strlen(si->message_buffer) - 1); - } - - if (level == SVC_LOG_ERROR) { - si->codec_ctx->err_detail = si->message_buffer; - } - return retval; -} - -static vpx_codec_err_t extract_option(LAYER_OPTION_TYPE type, - char *input, - int *value0, - int *value1) { - if (type == SCALE_FACTOR) { - *value0 = strtol(input, &input, 10); - if (*input++ != '/') - return VPX_CODEC_INVALID_PARAM; - *value1 = strtol(input, &input, 10); - - if (*value0 < option_min_values[SCALE_FACTOR] || - *value1 < option_min_values[SCALE_FACTOR] || - *value0 > option_max_values[SCALE_FACTOR] || - *value1 > option_max_values[SCALE_FACTOR] || - *value0 > *value1) // num shouldn't be greater than den - return VPX_CODEC_INVALID_PARAM; - } else { - *value0 = atoi(input); - if (*value0 < option_min_values[type] || - *value0 > option_max_values[type]) - return VPX_CODEC_INVALID_PARAM; - } - return VPX_CODEC_OK; -} - -static vpx_codec_err_t parse_layer_options_from_string(SvcContext *svc_ctx, - LAYER_OPTION_TYPE type, - const char *input, - int *option0, - int *option1) { - int i; - vpx_codec_err_t res = VPX_CODEC_OK; - char *input_string; - char *token; - const char *delim = ","; - char *save_ptr; - - if (input == NULL || option0 == NULL || - (option1 == NULL && type == SCALE_FACTOR)) - return VPX_CODEC_INVALID_PARAM; - - input_string = strdup(input); - token = strtok_r(input_string, delim, &save_ptr); - for (i = 0; i < svc_ctx->spatial_layers; ++i) { - if (token != NULL) { - res = extract_option(type, token, option0 + i, option1 + i); - if (res != VPX_CODEC_OK) - break; - token = strtok_r(NULL, delim, &save_ptr); - } else { - break; - } - } - if (res == VPX_CODEC_OK && i != svc_ctx->spatial_layers) { - svc_log(svc_ctx, SVC_LOG_ERROR, - "svc: layer params type: %d %d values required, " - "but only %d specified\n", type, svc_ctx->spatial_layers, i); - res = VPX_CODEC_INVALID_PARAM; - } - free(input_string); - return res; -} - -/** - * Parse SVC encoding options - * Format: encoding-mode=,layers= - * scale-factors=/,/,... - * quantizers=,,... - * svc_mode = [i|ip|alt_ip|gf] - */ -static vpx_codec_err_t parse_options(SvcContext *svc_ctx, const char *options) { - char *input_string; - char *option_name; - char *option_value; - char *input_ptr; - SvcInternal_t *const si = get_svc_internal(svc_ctx); - vpx_codec_err_t res = VPX_CODEC_OK; - int i, alt_ref_enabled = 0; - - if (options == NULL) return VPX_CODEC_OK; - input_string = strdup(options); - - // parse option name - option_name = strtok_r(input_string, "=", &input_ptr); - while (option_name != NULL) { - // parse option value - option_value = strtok_r(NULL, " ", &input_ptr); - if (option_value == NULL) { - svc_log(svc_ctx, SVC_LOG_ERROR, "option missing value: %s\n", - option_name); - res = VPX_CODEC_INVALID_PARAM; - break; - } - if (strcmp("spatial-layers", option_name) == 0) { - svc_ctx->spatial_layers = atoi(option_value); - } else if (strcmp("temporal-layers", option_name) == 0) { - svc_ctx->temporal_layers = atoi(option_value); - } else if (strcmp("scale-factors", option_name) == 0) { - res = parse_layer_options_from_string(svc_ctx, SCALE_FACTOR, option_value, - si->svc_params.scaling_factor_num, - si->svc_params.scaling_factor_den); - if (res != VPX_CODEC_OK) break; - } else if (strcmp("max-quantizers", option_name) == 0) { - res = parse_layer_options_from_string(svc_ctx, QUANTIZER, option_value, - si->svc_params.max_quantizers, - NULL); - if (res != VPX_CODEC_OK) break; - } else if (strcmp("min-quantizers", option_name) == 0) { - res = parse_layer_options_from_string(svc_ctx, QUANTIZER, option_value, - si->svc_params.min_quantizers, - NULL); - if (res != VPX_CODEC_OK) break; - } else if (strcmp("auto-alt-refs", option_name) == 0) { - res = parse_layer_options_from_string(svc_ctx, AUTO_ALT_REF, option_value, - si->enable_auto_alt_ref, NULL); - if (res != VPX_CODEC_OK) break; - } else if (strcmp("bitrates", option_name) == 0) { - res = parse_layer_options_from_string(svc_ctx, BITRATE, option_value, - si->bitrates, NULL); - if (res != VPX_CODEC_OK) break; - } else if (strcmp("multi-frame-contexts", option_name) == 0) { - si->use_multiple_frame_contexts = atoi(option_value); - } else { - svc_log(svc_ctx, SVC_LOG_ERROR, "invalid option: %s\n", option_name); - res = VPX_CODEC_INVALID_PARAM; - break; - } - option_name = strtok_r(NULL, "=", &input_ptr); - } - free(input_string); - - for (i = 0; i < svc_ctx->spatial_layers; ++i) { - if (si->svc_params.max_quantizers[i] > MAX_QUANTIZER || - si->svc_params.max_quantizers[i] < 0 || - si->svc_params.min_quantizers[i] > si->svc_params.max_quantizers[i] || - si->svc_params.min_quantizers[i] < 0) - res = VPX_CODEC_INVALID_PARAM; - } - - if (si->use_multiple_frame_contexts && - (svc_ctx->spatial_layers > 3 || - svc_ctx->spatial_layers * svc_ctx->temporal_layers > 4)) - res = VPX_CODEC_INVALID_PARAM; - - for (i = 0; i < svc_ctx->spatial_layers; ++i) - alt_ref_enabled += si->enable_auto_alt_ref[i]; - if (alt_ref_enabled > REF_FRAMES - svc_ctx->spatial_layers) { - svc_log(svc_ctx, SVC_LOG_ERROR, - "svc: auto alt ref: Maxinum %d(REF_FRAMES - layers) layers could" - "enabled auto alt reference frame, but % layers are enabled\n", - REF_FRAMES - svc_ctx->spatial_layers, alt_ref_enabled); - res = VPX_CODEC_INVALID_PARAM; - } - - return res; -} - -vpx_codec_err_t vpx_svc_set_options(SvcContext *svc_ctx, - const char *options) { - SvcInternal_t *const si = get_svc_internal(svc_ctx); - if (svc_ctx == NULL || options == NULL || si == NULL) { - return VPX_CODEC_INVALID_PARAM; - } - strncpy(si->options, options, sizeof(si->options)); - si->options[sizeof(si->options) - 1] = '\0'; - return VPX_CODEC_OK; -} - -void assign_layer_bitrates(const SvcContext *svc_ctx, - vpx_codec_enc_cfg_t *const enc_cfg) { - int i; - const SvcInternal_t *const si = get_const_svc_internal(svc_ctx); - - if (si->bitrates[0] != 0) { - enc_cfg->rc_target_bitrate = 0; - for (i = 0; i < svc_ctx->spatial_layers; ++i) { - enc_cfg->ss_target_bitrate[i] = (unsigned int)si->bitrates[i]; - enc_cfg->rc_target_bitrate += si->bitrates[i]; - } - } else { - float total = 0; - float alloc_ratio[VPX_SS_MAX_LAYERS] = {0}; - - for (i = 0; i < svc_ctx->spatial_layers; ++i) { - if (si->svc_params.scaling_factor_den[i] > 0) { - alloc_ratio[i] = (float)(si->svc_params.scaling_factor_num[i] * 1.0 / - si->svc_params.scaling_factor_den[i]); - - alloc_ratio[i] *= alloc_ratio[i]; - total += alloc_ratio[i]; - } - } - - for (i = 0; i < VPX_SS_MAX_LAYERS; ++i) { - if (total > 0) { - enc_cfg->ss_target_bitrate[i] = (unsigned int) - (enc_cfg->rc_target_bitrate * alloc_ratio[i] / total); - } - } - } -} - -vpx_codec_err_t vpx_svc_init(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx, - vpx_codec_iface_t *iface, - vpx_codec_enc_cfg_t *enc_cfg) { - vpx_codec_err_t res; - int i; - SvcInternal_t *const si = get_svc_internal(svc_ctx); - if (svc_ctx == NULL || codec_ctx == NULL || iface == NULL || - enc_cfg == NULL) { - return VPX_CODEC_INVALID_PARAM; - } - if (si == NULL) return VPX_CODEC_MEM_ERROR; - - si->codec_ctx = codec_ctx; - - si->width = enc_cfg->g_w; - si->height = enc_cfg->g_h; - - if (enc_cfg->kf_max_dist < 2) { - svc_log(svc_ctx, SVC_LOG_ERROR, "key frame distance too small: %d\n", - enc_cfg->kf_max_dist); - return VPX_CODEC_INVALID_PARAM; - } - si->kf_dist = enc_cfg->kf_max_dist; - - if (svc_ctx->spatial_layers == 0) - svc_ctx->spatial_layers = VPX_SS_DEFAULT_LAYERS; - if (svc_ctx->spatial_layers < 1 || - svc_ctx->spatial_layers > VPX_SS_MAX_LAYERS) { - svc_log(svc_ctx, SVC_LOG_ERROR, "spatial layers: invalid value: %d\n", - svc_ctx->spatial_layers); - return VPX_CODEC_INVALID_PARAM; - } - - for (i = 0; i < VPX_SS_MAX_LAYERS; ++i) { - si->svc_params.max_quantizers[i] = MAX_QUANTIZER; - si->svc_params.min_quantizers[i] = 0; - si->svc_params.scaling_factor_num[i] = DEFAULT_SCALE_FACTORS_NUM[i]; - si->svc_params.scaling_factor_den[i] = DEFAULT_SCALE_FACTORS_DEN[i]; - } - - // Parse aggregate command line options. Options must start with - // "layers=xx" then followed by other options - res = parse_options(svc_ctx, si->options); - if (res != VPX_CODEC_OK) return res; - - if (svc_ctx->spatial_layers < 1) - svc_ctx->spatial_layers = 1; - if (svc_ctx->spatial_layers > VPX_SS_MAX_LAYERS) - svc_ctx->spatial_layers = VPX_SS_MAX_LAYERS; - - if (svc_ctx->temporal_layers < 1) - svc_ctx->temporal_layers = 1; - if (svc_ctx->temporal_layers > VPX_TS_MAX_LAYERS) - svc_ctx->temporal_layers = VPX_TS_MAX_LAYERS; - - assign_layer_bitrates(svc_ctx, enc_cfg); - -#if CONFIG_SPATIAL_SVC - for (i = 0; i < svc_ctx->spatial_layers; ++i) - enc_cfg->ss_enable_auto_alt_ref[i] = si->enable_auto_alt_ref[i]; -#endif - - if (svc_ctx->temporal_layers > 1) { - int i; - for (i = 0; i < svc_ctx->temporal_layers; ++i) { - enc_cfg->ts_target_bitrate[i] = enc_cfg->rc_target_bitrate / - svc_ctx->temporal_layers; - enc_cfg->ts_rate_decimator[i] = 1 << (svc_ctx->temporal_layers - 1 - i); - } - } - - // modify encoder configuration - enc_cfg->ss_number_layers = svc_ctx->spatial_layers; - enc_cfg->ts_number_layers = svc_ctx->temporal_layers; - - if (enc_cfg->g_error_resilient == 0 && si->use_multiple_frame_contexts == 0) - enc_cfg->g_error_resilient = 1; - - // Initialize codec - res = vpx_codec_enc_init(codec_ctx, iface, enc_cfg, VPX_CODEC_USE_PSNR); - if (res != VPX_CODEC_OK) { - svc_log(svc_ctx, SVC_LOG_ERROR, "svc_enc_init error\n"); - return res; - } - - vpx_codec_control(codec_ctx, VP9E_SET_SVC, 1); - vpx_codec_control(codec_ctx, VP9E_SET_SVC_PARAMETERS, &si->svc_params); - - return VPX_CODEC_OK; -} - -/** - * Encode a frame into multiple layers - * Create a superframe containing the individual layers - */ -vpx_codec_err_t vpx_svc_encode(SvcContext *svc_ctx, - vpx_codec_ctx_t *codec_ctx, - struct vpx_image *rawimg, - vpx_codec_pts_t pts, - int64_t duration, int deadline) { - vpx_codec_err_t res; - vpx_codec_iter_t iter; - const vpx_codec_cx_pkt_t *cx_pkt; - SvcInternal_t *const si = get_svc_internal(svc_ctx); - if (svc_ctx == NULL || codec_ctx == NULL || si == NULL) { - return VPX_CODEC_INVALID_PARAM; - } - - svc_log_reset(svc_ctx); - - res = vpx_codec_encode(codec_ctx, rawimg, pts, (uint32_t)duration, 0, - deadline); - if (res != VPX_CODEC_OK) { - return res; - } - // save compressed data - iter = NULL; - while ((cx_pkt = vpx_codec_get_cx_data(codec_ctx, &iter))) { - switch (cx_pkt->kind) { -#if CONFIG_SPATIAL_SVC - case VPX_CODEC_SPATIAL_SVC_LAYER_PSNR: { - int i; - for (i = 0; i < svc_ctx->spatial_layers; ++i) { - int j; - svc_log(svc_ctx, SVC_LOG_DEBUG, - "SVC frame: %d, layer: %d, PSNR(Total/Y/U/V): " - "%2.3f %2.3f %2.3f %2.3f \n", - si->psnr_pkt_received, i, - cx_pkt->data.layer_psnr[i].psnr[0], - cx_pkt->data.layer_psnr[i].psnr[1], - cx_pkt->data.layer_psnr[i].psnr[2], - cx_pkt->data.layer_psnr[i].psnr[3]); - svc_log(svc_ctx, SVC_LOG_DEBUG, - "SVC frame: %d, layer: %d, SSE(Total/Y/U/V): " - "%2.3f %2.3f %2.3f %2.3f \n", - si->psnr_pkt_received, i, - cx_pkt->data.layer_psnr[i].sse[0], - cx_pkt->data.layer_psnr[i].sse[1], - cx_pkt->data.layer_psnr[i].sse[2], - cx_pkt->data.layer_psnr[i].sse[3]); - - for (j = 0; j < COMPONENTS; ++j) { - si->psnr_sum[i][j] += - cx_pkt->data.layer_psnr[i].psnr[j]; - si->sse_sum[i][j] += cx_pkt->data.layer_psnr[i].sse[j]; - } - } - ++si->psnr_pkt_received; - break; - } - case VPX_CODEC_SPATIAL_SVC_LAYER_SIZES: { - int i; - for (i = 0; i < svc_ctx->spatial_layers; ++i) - si->bytes_sum[i] += cx_pkt->data.layer_sizes[i]; - break; - } -#endif - default: { - break; - } - } - } - - return VPX_CODEC_OK; -} - -const char *vpx_svc_get_message(const SvcContext *svc_ctx) { - const SvcInternal_t *const si = get_const_svc_internal(svc_ctx); - if (svc_ctx == NULL || si == NULL) return NULL; - return si->message_buffer; -} - -static double calc_psnr(double d) { - if (d == 0) return 100; - return -10.0 * log(d) / log(10.0); -} - -// dump accumulated statistics and reset accumulated values -const char *vpx_svc_dump_statistics(SvcContext *svc_ctx) { - int number_of_frames; - int i, j; - uint32_t bytes_total = 0; - double scale[COMPONENTS]; - double psnr[COMPONENTS]; - double mse[COMPONENTS]; - double y_scale; - - SvcInternal_t *const si = get_svc_internal(svc_ctx); - if (svc_ctx == NULL || si == NULL) return NULL; - - svc_log_reset(svc_ctx); - - number_of_frames = si->psnr_pkt_received; - if (number_of_frames <= 0) return vpx_svc_get_message(svc_ctx); - - svc_log(svc_ctx, SVC_LOG_INFO, "\n"); - for (i = 0; i < svc_ctx->spatial_layers; ++i) { - - svc_log(svc_ctx, SVC_LOG_INFO, - "Layer %d Average PSNR=[%2.3f, %2.3f, %2.3f, %2.3f], Bytes=[%u]\n", - i, (double)si->psnr_sum[i][0] / number_of_frames, - (double)si->psnr_sum[i][1] / number_of_frames, - (double)si->psnr_sum[i][2] / number_of_frames, - (double)si->psnr_sum[i][3] / number_of_frames, si->bytes_sum[i]); - // the following psnr calculation is deduced from ffmpeg.c#print_report - y_scale = si->width * si->height * 255.0 * 255.0 * number_of_frames; - scale[1] = y_scale; - scale[2] = scale[3] = y_scale / 4; // U or V - scale[0] = y_scale * 1.5; // total - - for (j = 0; j < COMPONENTS; j++) { - psnr[j] = calc_psnr(si->sse_sum[i][j] / scale[j]); - mse[j] = si->sse_sum[i][j] * 255.0 * 255.0 / scale[j]; - } - svc_log(svc_ctx, SVC_LOG_INFO, - "Layer %d Overall PSNR=[%2.3f, %2.3f, %2.3f, %2.3f]\n", i, psnr[0], - psnr[1], psnr[2], psnr[3]); - svc_log(svc_ctx, SVC_LOG_INFO, - "Layer %d Overall MSE=[%2.3f, %2.3f, %2.3f, %2.3f]\n", i, mse[0], - mse[1], mse[2], mse[3]); - - bytes_total += si->bytes_sum[i]; - // clear sums for next time - si->bytes_sum[i] = 0; - for (j = 0; j < COMPONENTS; ++j) { - si->psnr_sum[i][j] = 0; - si->sse_sum[i][j] = 0; - } - } - - // only display statistics once - si->psnr_pkt_received = 0; - - svc_log(svc_ctx, SVC_LOG_INFO, "Total Bytes=[%u]\n", bytes_total); - return vpx_svc_get_message(svc_ctx); -} - -void vpx_svc_release(SvcContext *svc_ctx) { - SvcInternal_t *si; - if (svc_ctx == NULL) return; - // do not use get_svc_internal as it will unnecessarily allocate an - // SvcInternal_t if it was not already allocated - si = (SvcInternal_t *)svc_ctx->internal; - if (si != NULL) { - free(si); - svc_ctx->internal = NULL; - } -} - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/src/vpx_codec.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/src/vpx_codec.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/src/vpx_codec.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/src/vpx_codec.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/*!\file - * \brief Provides the high level interface to wrap decoder algorithms. - * - */ -#include -#include -#include "vpx/vpx_integer.h" -#include "vpx/internal/vpx_codec_internal.h" -#include "vpx_version.h" - -#define SAVE_STATUS(ctx,var) (ctx?(ctx->err = var):var) - -int vpx_codec_version(void) { - return VERSION_PACKED; -} - - -const char *vpx_codec_version_str(void) { - return VERSION_STRING_NOSP; -} - - -const char *vpx_codec_version_extra_str(void) { - return VERSION_EXTRA; -} - - -const char *vpx_codec_iface_name(vpx_codec_iface_t *iface) { - return iface ? iface->name : ""; -} - -const char *vpx_codec_err_to_string(vpx_codec_err_t err) { - switch (err) { - case VPX_CODEC_OK: - return "Success"; - case VPX_CODEC_ERROR: - return "Unspecified internal error"; - case VPX_CODEC_MEM_ERROR: - return "Memory allocation error"; - case VPX_CODEC_ABI_MISMATCH: - return "ABI version mismatch"; - case VPX_CODEC_INCAPABLE: - return "Codec does not implement requested capability"; - case VPX_CODEC_UNSUP_BITSTREAM: - return "Bitstream not supported by this decoder"; - case VPX_CODEC_UNSUP_FEATURE: - return "Bitstream required feature not supported by this decoder"; - case VPX_CODEC_CORRUPT_FRAME: - return "Corrupt frame detected"; - case VPX_CODEC_INVALID_PARAM: - return "Invalid parameter"; - case VPX_CODEC_LIST_END: - return "End of iterated list"; - } - - return "Unrecognized error code"; -} - -const char *vpx_codec_error(vpx_codec_ctx_t *ctx) { - return (ctx) ? vpx_codec_err_to_string(ctx->err) - : vpx_codec_err_to_string(VPX_CODEC_INVALID_PARAM); -} - -const char *vpx_codec_error_detail(vpx_codec_ctx_t *ctx) { - if (ctx && ctx->err) - return ctx->priv ? ctx->priv->err_detail : ctx->err_detail; - - return NULL; -} - - -vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx) { - vpx_codec_err_t res; - - if (!ctx) - res = VPX_CODEC_INVALID_PARAM; - else if (!ctx->iface || !ctx->priv) - res = VPX_CODEC_ERROR; - else { - ctx->iface->destroy((vpx_codec_alg_priv_t *)ctx->priv); - - ctx->iface = NULL; - ctx->name = NULL; - ctx->priv = NULL; - res = VPX_CODEC_OK; - } - - return SAVE_STATUS(ctx, res); -} - - -vpx_codec_caps_t vpx_codec_get_caps(vpx_codec_iface_t *iface) { - return (iface) ? iface->caps : 0; -} - - -vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx, - int ctrl_id, - ...) { - vpx_codec_err_t res; - - if (!ctx || !ctrl_id) - res = VPX_CODEC_INVALID_PARAM; - else if (!ctx->iface || !ctx->priv || !ctx->iface->ctrl_maps) - res = VPX_CODEC_ERROR; - else { - vpx_codec_ctrl_fn_map_t *entry; - - res = VPX_CODEC_ERROR; - - for (entry = ctx->iface->ctrl_maps; entry && entry->fn; entry++) { - if (!entry->ctrl_id || entry->ctrl_id == ctrl_id) { - va_list ap; - - va_start(ap, ctrl_id); - res = entry->fn((vpx_codec_alg_priv_t *)ctx->priv, ap); - va_end(ap); - break; - } - } - } - - return SAVE_STATUS(ctx, res); -} - -void vpx_internal_error(struct vpx_internal_error_info *info, - vpx_codec_err_t error, - const char *fmt, - ...) { - va_list ap; - - info->error_code = error; - info->has_detail = 0; - - if (fmt) { - size_t sz = sizeof(info->detail); - - info->has_detail = 1; - va_start(ap, fmt); - vsnprintf(info->detail, sz - 1, fmt, ap); - va_end(ap); - info->detail[sz - 1] = '\0'; - } - - if (info->setjmp) - longjmp(info->jmp, info->error_code); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/src/vpx_decoder.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/src/vpx_decoder.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/src/vpx_decoder.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/src/vpx_decoder.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,197 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/*!\file - * \brief Provides the high level interface to wrap decoder algorithms. - * - */ -#include -#include "vpx/internal/vpx_codec_internal.h" - -#define SAVE_STATUS(ctx,var) (ctx?(ctx->err = var):var) - -static vpx_codec_alg_priv_t *get_alg_priv(vpx_codec_ctx_t *ctx) { - return (vpx_codec_alg_priv_t *)ctx->priv; -} - -vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx, - vpx_codec_iface_t *iface, - const vpx_codec_dec_cfg_t *cfg, - vpx_codec_flags_t flags, - int ver) { - vpx_codec_err_t res; - - if (ver != VPX_DECODER_ABI_VERSION) - res = VPX_CODEC_ABI_MISMATCH; - else if (!ctx || !iface) - res = VPX_CODEC_INVALID_PARAM; - else if (iface->abi_version != VPX_CODEC_INTERNAL_ABI_VERSION) - res = VPX_CODEC_ABI_MISMATCH; - else if ((flags & VPX_CODEC_USE_POSTPROC) && !(iface->caps & VPX_CODEC_CAP_POSTPROC)) - res = VPX_CODEC_INCAPABLE; - else if ((flags & VPX_CODEC_USE_ERROR_CONCEALMENT) && - !(iface->caps & VPX_CODEC_CAP_ERROR_CONCEALMENT)) - res = VPX_CODEC_INCAPABLE; - else if ((flags & VPX_CODEC_USE_INPUT_FRAGMENTS) && - !(iface->caps & VPX_CODEC_CAP_INPUT_FRAGMENTS)) - res = VPX_CODEC_INCAPABLE; - else if (!(iface->caps & VPX_CODEC_CAP_DECODER)) - res = VPX_CODEC_INCAPABLE; - else { - memset(ctx, 0, sizeof(*ctx)); - ctx->iface = iface; - ctx->name = iface->name; - ctx->priv = NULL; - ctx->init_flags = flags; - ctx->config.dec = cfg; - - res = ctx->iface->init(ctx, NULL); - if (res) { - ctx->err_detail = ctx->priv ? ctx->priv->err_detail : NULL; - vpx_codec_destroy(ctx); - } - } - - return SAVE_STATUS(ctx, res); -} - - -vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface, - const uint8_t *data, - unsigned int data_sz, - vpx_codec_stream_info_t *si) { - vpx_codec_err_t res; - - if (!iface || !data || !data_sz || !si - || si->sz < sizeof(vpx_codec_stream_info_t)) - res = VPX_CODEC_INVALID_PARAM; - else { - /* Set default/unknown values */ - si->w = 0; - si->h = 0; - - res = iface->dec.peek_si(data, data_sz, si); - } - - return res; -} - - -vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx, - vpx_codec_stream_info_t *si) { - vpx_codec_err_t res; - - if (!ctx || !si || si->sz < sizeof(vpx_codec_stream_info_t)) - res = VPX_CODEC_INVALID_PARAM; - else if (!ctx->iface || !ctx->priv) - res = VPX_CODEC_ERROR; - else { - /* Set default/unknown values */ - si->w = 0; - si->h = 0; - - res = ctx->iface->dec.get_si(get_alg_priv(ctx), si); - } - - return SAVE_STATUS(ctx, res); -} - - -vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx, - const uint8_t *data, - unsigned int data_sz, - void *user_priv, - long deadline) { - vpx_codec_err_t res; - - /* Sanity checks */ - /* NULL data ptr allowed if data_sz is 0 too */ - if (!ctx || (!data && data_sz) || (data && !data_sz)) - res = VPX_CODEC_INVALID_PARAM; - else if (!ctx->iface || !ctx->priv) - res = VPX_CODEC_ERROR; - else { - res = ctx->iface->dec.decode(get_alg_priv(ctx), data, data_sz, user_priv, - deadline); - } - - return SAVE_STATUS(ctx, res); -} - -vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx, - vpx_codec_iter_t *iter) { - vpx_image_t *img; - - if (!ctx || !iter || !ctx->iface || !ctx->priv) - img = NULL; - else - img = ctx->iface->dec.get_frame(get_alg_priv(ctx), iter); - - return img; -} - - -vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx, - vpx_codec_put_frame_cb_fn_t cb, - void *user_priv) { - vpx_codec_err_t res; - - if (!ctx || !cb) - res = VPX_CODEC_INVALID_PARAM; - else if (!ctx->iface || !ctx->priv - || !(ctx->iface->caps & VPX_CODEC_CAP_PUT_FRAME)) - res = VPX_CODEC_ERROR; - else { - ctx->priv->dec.put_frame_cb.u.put_frame = cb; - ctx->priv->dec.put_frame_cb.user_priv = user_priv; - res = VPX_CODEC_OK; - } - - return SAVE_STATUS(ctx, res); -} - - -vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx, - vpx_codec_put_slice_cb_fn_t cb, - void *user_priv) { - vpx_codec_err_t res; - - if (!ctx || !cb) - res = VPX_CODEC_INVALID_PARAM; - else if (!ctx->iface || !ctx->priv - || !(ctx->iface->caps & VPX_CODEC_CAP_PUT_SLICE)) - res = VPX_CODEC_ERROR; - else { - ctx->priv->dec.put_slice_cb.u.put_slice = cb; - ctx->priv->dec.put_slice_cb.user_priv = user_priv; - res = VPX_CODEC_OK; - } - - return SAVE_STATUS(ctx, res); -} - -vpx_codec_err_t vpx_codec_set_frame_buffer_functions( - vpx_codec_ctx_t *ctx, vpx_get_frame_buffer_cb_fn_t cb_get, - vpx_release_frame_buffer_cb_fn_t cb_release, void *cb_priv) { - vpx_codec_err_t res; - - if (!ctx || !cb_get || !cb_release) { - res = VPX_CODEC_INVALID_PARAM; - } else if (!ctx->iface || !ctx->priv || - !(ctx->iface->caps & VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER)) { - res = VPX_CODEC_ERROR; - } else { - res = ctx->iface->dec.set_fb_fn(get_alg_priv(ctx), cb_get, cb_release, - cb_priv); - } - - return SAVE_STATUS(ctx, res); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/src/vpx_encoder.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/src/vpx_encoder.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/src/vpx_encoder.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/src/vpx_encoder.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,401 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/*!\file - * \brief Provides the high level interface to wrap encoder algorithms. - * - */ -#include -#include -#include "vpx_config.h" -#include "vpx/internal/vpx_codec_internal.h" - -#define SAVE_STATUS(ctx,var) (ctx?(ctx->err = var):var) - -static vpx_codec_alg_priv_t *get_alg_priv(vpx_codec_ctx_t *ctx) { - return (vpx_codec_alg_priv_t *)ctx->priv; -} - -vpx_codec_err_t vpx_codec_enc_init_ver(vpx_codec_ctx_t *ctx, - vpx_codec_iface_t *iface, - const vpx_codec_enc_cfg_t *cfg, - vpx_codec_flags_t flags, - int ver) { - vpx_codec_err_t res; - - if (ver != VPX_ENCODER_ABI_VERSION) - res = VPX_CODEC_ABI_MISMATCH; - else if (!ctx || !iface || !cfg) - res = VPX_CODEC_INVALID_PARAM; - else if (iface->abi_version != VPX_CODEC_INTERNAL_ABI_VERSION) - res = VPX_CODEC_ABI_MISMATCH; - else if (!(iface->caps & VPX_CODEC_CAP_ENCODER)) - res = VPX_CODEC_INCAPABLE; - else if ((flags & VPX_CODEC_USE_PSNR) - && !(iface->caps & VPX_CODEC_CAP_PSNR)) - res = VPX_CODEC_INCAPABLE; - else if ((flags & VPX_CODEC_USE_OUTPUT_PARTITION) - && !(iface->caps & VPX_CODEC_CAP_OUTPUT_PARTITION)) - res = VPX_CODEC_INCAPABLE; - else { - ctx->iface = iface; - ctx->name = iface->name; - ctx->priv = NULL; - ctx->init_flags = flags; - ctx->config.enc = cfg; - res = ctx->iface->init(ctx, NULL); - - if (res) { - ctx->err_detail = ctx->priv ? ctx->priv->err_detail : NULL; - vpx_codec_destroy(ctx); - } - } - - return SAVE_STATUS(ctx, res); -} - -vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx, - vpx_codec_iface_t *iface, - vpx_codec_enc_cfg_t *cfg, - int num_enc, - vpx_codec_flags_t flags, - vpx_rational_t *dsf, - int ver) { - vpx_codec_err_t res = VPX_CODEC_OK; - - if (ver != VPX_ENCODER_ABI_VERSION) - res = VPX_CODEC_ABI_MISMATCH; - else if (!ctx || !iface || !cfg || (num_enc > 16 || num_enc < 1)) - res = VPX_CODEC_INVALID_PARAM; - else if (iface->abi_version != VPX_CODEC_INTERNAL_ABI_VERSION) - res = VPX_CODEC_ABI_MISMATCH; - else if (!(iface->caps & VPX_CODEC_CAP_ENCODER)) - res = VPX_CODEC_INCAPABLE; - else if ((flags & VPX_CODEC_USE_PSNR) - && !(iface->caps & VPX_CODEC_CAP_PSNR)) - res = VPX_CODEC_INCAPABLE; - else if ((flags & VPX_CODEC_USE_OUTPUT_PARTITION) - && !(iface->caps & VPX_CODEC_CAP_OUTPUT_PARTITION)) - res = VPX_CODEC_INCAPABLE; - else { - int i; - void *mem_loc = NULL; - - if (!(res = iface->enc.mr_get_mem_loc(cfg, &mem_loc))) { - for (i = 0; i < num_enc; i++) { - vpx_codec_priv_enc_mr_cfg_t mr_cfg; - - /* Validate down-sampling factor. */ - if (dsf->num < 1 || dsf->num > 4096 || dsf->den < 1 || - dsf->den > dsf->num) { - res = VPX_CODEC_INVALID_PARAM; - break; - } - - mr_cfg.mr_low_res_mode_info = mem_loc; - mr_cfg.mr_total_resolutions = num_enc; - mr_cfg.mr_encoder_id = num_enc - 1 - i; - mr_cfg.mr_down_sampling_factor.num = dsf->num; - mr_cfg.mr_down_sampling_factor.den = dsf->den; - - /* Force Key-frame synchronization. Namely, encoder at higher - * resolution always use the same frame_type chosen by the - * lowest-resolution encoder. - */ - if (mr_cfg.mr_encoder_id) - cfg->kf_mode = VPX_KF_DISABLED; - - ctx->iface = iface; - ctx->name = iface->name; - ctx->priv = NULL; - ctx->init_flags = flags; - ctx->config.enc = cfg; - res = ctx->iface->init(ctx, &mr_cfg); - - if (res) { - const char *error_detail = - ctx->priv ? ctx->priv->err_detail : NULL; - /* Destroy current ctx */ - ctx->err_detail = error_detail; - vpx_codec_destroy(ctx); - - /* Destroy already allocated high-level ctx */ - while (i) { - ctx--; - ctx->err_detail = error_detail; - vpx_codec_destroy(ctx); - i--; - } - } - - if (res) - break; - - ctx++; - cfg++; - dsf++; - } - ctx--; - } - } - - return SAVE_STATUS(ctx, res); -} - - -vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface, - vpx_codec_enc_cfg_t *cfg, - unsigned int usage) { - vpx_codec_err_t res; - vpx_codec_enc_cfg_map_t *map; - int i; - - if (!iface || !cfg || usage > INT_MAX) - res = VPX_CODEC_INVALID_PARAM; - else if (!(iface->caps & VPX_CODEC_CAP_ENCODER)) - res = VPX_CODEC_INCAPABLE; - else { - res = VPX_CODEC_INVALID_PARAM; - - for (i = 0; i < iface->enc.cfg_map_count; ++i) { - map = iface->enc.cfg_maps + i; - if (map->usage == (int)usage) { - *cfg = map->cfg; - cfg->g_usage = usage; - res = VPX_CODEC_OK; - break; - } - } - } - - return res; -} - - -#if ARCH_X86 || ARCH_X86_64 -/* On X86, disable the x87 unit's internal 80 bit precision for better - * consistency with the SSE unit's 64 bit precision. - */ -#include "vpx_ports/x86.h" -#define FLOATING_POINT_INIT() do {\ - unsigned short x87_orig_mode = x87_set_double_precision(); -#define FLOATING_POINT_RESTORE() \ - x87_set_control_word(x87_orig_mode); }while(0) - - -#else -static void FLOATING_POINT_INIT() {} -static void FLOATING_POINT_RESTORE() {} -#endif - - -vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx, - const vpx_image_t *img, - vpx_codec_pts_t pts, - unsigned long duration, - vpx_enc_frame_flags_t flags, - unsigned long deadline) { - vpx_codec_err_t res = VPX_CODEC_OK; - - if (!ctx || (img && !duration)) - res = VPX_CODEC_INVALID_PARAM; - else if (!ctx->iface || !ctx->priv) - res = VPX_CODEC_ERROR; - else if (!(ctx->iface->caps & VPX_CODEC_CAP_ENCODER)) - res = VPX_CODEC_INCAPABLE; - else { - unsigned int num_enc = ctx->priv->enc.total_encoders; - - /* Execute in a normalized floating point environment, if the platform - * requires it. - */ - FLOATING_POINT_INIT(); - - if (num_enc == 1) - res = ctx->iface->enc.encode(get_alg_priv(ctx), img, pts, - duration, flags, deadline); - else { - /* Multi-resolution encoding: - * Encode multi-levels in reverse order. For example, - * if mr_total_resolutions = 3, first encode level 2, - * then encode level 1, and finally encode level 0. - */ - int i; - - ctx += num_enc - 1; - if (img) img += num_enc - 1; - - for (i = num_enc - 1; i >= 0; i--) { - if ((res = ctx->iface->enc.encode(get_alg_priv(ctx), img, pts, - duration, flags, deadline))) - break; - - ctx--; - if (img) img--; - } - ctx++; - } - - FLOATING_POINT_RESTORE(); - } - - return SAVE_STATUS(ctx, res); -} - - -const vpx_codec_cx_pkt_t *vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx, - vpx_codec_iter_t *iter) { - const vpx_codec_cx_pkt_t *pkt = NULL; - - if (ctx) { - if (!iter) - ctx->err = VPX_CODEC_INVALID_PARAM; - else if (!ctx->iface || !ctx->priv) - ctx->err = VPX_CODEC_ERROR; - else if (!(ctx->iface->caps & VPX_CODEC_CAP_ENCODER)) - ctx->err = VPX_CODEC_INCAPABLE; - else - pkt = ctx->iface->enc.get_cx_data(get_alg_priv(ctx), iter); - } - - if (pkt && pkt->kind == VPX_CODEC_CX_FRAME_PKT) { - // If the application has specified a destination area for the - // compressed data, and the codec has not placed the data there, - // and it fits, copy it. - vpx_codec_priv_t *const priv = ctx->priv; - char *const dst_buf = (char *)priv->enc.cx_data_dst_buf.buf; - - if (dst_buf && - pkt->data.raw.buf != dst_buf && - pkt->data.raw.sz + priv->enc.cx_data_pad_before + - priv->enc.cx_data_pad_after <= priv->enc.cx_data_dst_buf.sz) { - vpx_codec_cx_pkt_t *modified_pkt = &priv->enc.cx_data_pkt; - - memcpy(dst_buf + priv->enc.cx_data_pad_before, pkt->data.raw.buf, - pkt->data.raw.sz); - *modified_pkt = *pkt; - modified_pkt->data.raw.buf = dst_buf; - modified_pkt->data.raw.sz += priv->enc.cx_data_pad_before + - priv->enc.cx_data_pad_after; - pkt = modified_pkt; - } - - if (dst_buf == pkt->data.raw.buf) { - priv->enc.cx_data_dst_buf.buf = dst_buf + pkt->data.raw.sz; - priv->enc.cx_data_dst_buf.sz -= pkt->data.raw.sz; - } - } - - return pkt; -} - - -vpx_codec_err_t vpx_codec_set_cx_data_buf(vpx_codec_ctx_t *ctx, - const vpx_fixed_buf_t *buf, - unsigned int pad_before, - unsigned int pad_after) { - if (!ctx || !ctx->priv) - return VPX_CODEC_INVALID_PARAM; - - if (buf) { - ctx->priv->enc.cx_data_dst_buf = *buf; - ctx->priv->enc.cx_data_pad_before = pad_before; - ctx->priv->enc.cx_data_pad_after = pad_after; - } else { - ctx->priv->enc.cx_data_dst_buf.buf = NULL; - ctx->priv->enc.cx_data_dst_buf.sz = 0; - ctx->priv->enc.cx_data_pad_before = 0; - ctx->priv->enc.cx_data_pad_after = 0; - } - - return VPX_CODEC_OK; -} - - -const vpx_image_t *vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx) { - vpx_image_t *img = NULL; - - if (ctx) { - if (!ctx->iface || !ctx->priv) - ctx->err = VPX_CODEC_ERROR; - else if (!(ctx->iface->caps & VPX_CODEC_CAP_ENCODER)) - ctx->err = VPX_CODEC_INCAPABLE; - else if (!ctx->iface->enc.get_preview) - ctx->err = VPX_CODEC_INCAPABLE; - else - img = ctx->iface->enc.get_preview(get_alg_priv(ctx)); - } - - return img; -} - - -vpx_fixed_buf_t *vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx) { - vpx_fixed_buf_t *buf = NULL; - - if (ctx) { - if (!ctx->iface || !ctx->priv) - ctx->err = VPX_CODEC_ERROR; - else if (!(ctx->iface->caps & VPX_CODEC_CAP_ENCODER)) - ctx->err = VPX_CODEC_INCAPABLE; - else if (!ctx->iface->enc.get_glob_hdrs) - ctx->err = VPX_CODEC_INCAPABLE; - else - buf = ctx->iface->enc.get_glob_hdrs(get_alg_priv(ctx)); - } - - return buf; -} - - -vpx_codec_err_t vpx_codec_enc_config_set(vpx_codec_ctx_t *ctx, - const vpx_codec_enc_cfg_t *cfg) { - vpx_codec_err_t res; - - if (!ctx || !ctx->iface || !ctx->priv || !cfg) - res = VPX_CODEC_INVALID_PARAM; - else if (!(ctx->iface->caps & VPX_CODEC_CAP_ENCODER)) - res = VPX_CODEC_INCAPABLE; - else - res = ctx->iface->enc.cfg_set(get_alg_priv(ctx), cfg); - - return SAVE_STATUS(ctx, res); -} - - -int vpx_codec_pkt_list_add(struct vpx_codec_pkt_list *list, - const struct vpx_codec_cx_pkt *pkt) { - if (list->cnt < list->max) { - list->pkts[list->cnt++] = *pkt; - return 0; - } - - return 1; -} - - -const vpx_codec_cx_pkt_t *vpx_codec_pkt_list_get(struct vpx_codec_pkt_list *list, - vpx_codec_iter_t *iter) { - const vpx_codec_cx_pkt_t *pkt; - - if (!(*iter)) { - *iter = list->pkts; - } - - pkt = (const vpx_codec_cx_pkt_t *)*iter; - - if ((size_t)(pkt - list->pkts) < list->cnt) - *iter = pkt + 1; - else - pkt = NULL; - - return pkt; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/src/vpx_image.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/src/vpx_image.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/src/vpx_image.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/src/vpx_image.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,285 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "vpx/vpx_image.h" -#include "vpx/vpx_integer.h" -#include "vpx_mem/vpx_mem.h" - -static vpx_image_t *img_alloc_helper(vpx_image_t *img, - vpx_img_fmt_t fmt, - unsigned int d_w, - unsigned int d_h, - unsigned int buf_align, - unsigned int stride_align, - unsigned char *img_data) { - unsigned int h, w, s, xcs, ycs, bps; - unsigned int stride_in_bytes; - int align; - - /* Treat align==0 like align==1 */ - if (!buf_align) - buf_align = 1; - - /* Validate alignment (must be power of 2) */ - if (buf_align & (buf_align - 1)) - goto fail; - - /* Treat align==0 like align==1 */ - if (!stride_align) - stride_align = 1; - - /* Validate alignment (must be power of 2) */ - if (stride_align & (stride_align - 1)) - goto fail; - - /* Get sample size for this format */ - switch (fmt) { - case VPX_IMG_FMT_RGB32: - case VPX_IMG_FMT_RGB32_LE: - case VPX_IMG_FMT_ARGB: - case VPX_IMG_FMT_ARGB_LE: - bps = 32; - break; - case VPX_IMG_FMT_RGB24: - case VPX_IMG_FMT_BGR24: - bps = 24; - break; - case VPX_IMG_FMT_RGB565: - case VPX_IMG_FMT_RGB565_LE: - case VPX_IMG_FMT_RGB555: - case VPX_IMG_FMT_RGB555_LE: - case VPX_IMG_FMT_UYVY: - case VPX_IMG_FMT_YUY2: - case VPX_IMG_FMT_YVYU: - bps = 16; - break; - case VPX_IMG_FMT_I420: - case VPX_IMG_FMT_YV12: - case VPX_IMG_FMT_VPXI420: - case VPX_IMG_FMT_VPXYV12: - bps = 12; - break; - case VPX_IMG_FMT_I422: - case VPX_IMG_FMT_I440: - bps = 16; - break; - case VPX_IMG_FMT_I444: - bps = 24; - break; - case VPX_IMG_FMT_I42016: - bps = 24; - break; - case VPX_IMG_FMT_I42216: - case VPX_IMG_FMT_I44016: - bps = 32; - break; - case VPX_IMG_FMT_I44416: - bps = 48; - break; - default: - bps = 16; - break; - } - - /* Get chroma shift values for this format */ - switch (fmt) { - case VPX_IMG_FMT_I420: - case VPX_IMG_FMT_YV12: - case VPX_IMG_FMT_VPXI420: - case VPX_IMG_FMT_VPXYV12: - case VPX_IMG_FMT_I422: - case VPX_IMG_FMT_I42016: - case VPX_IMG_FMT_I42216: - xcs = 1; - break; - default: - xcs = 0; - break; - } - - switch (fmt) { - case VPX_IMG_FMT_I420: - case VPX_IMG_FMT_I440: - case VPX_IMG_FMT_YV12: - case VPX_IMG_FMT_VPXI420: - case VPX_IMG_FMT_VPXYV12: - case VPX_IMG_FMT_I42016: - case VPX_IMG_FMT_I44016: - ycs = 1; - break; - default: - ycs = 0; - break; - } - - /* Calculate storage sizes given the chroma subsampling */ - align = (1 << xcs) - 1; - w = (d_w + align) & ~align; - align = (1 << ycs) - 1; - h = (d_h + align) & ~align; - s = (fmt & VPX_IMG_FMT_PLANAR) ? w : bps * w / 8; - s = (s + stride_align - 1) & ~(stride_align - 1); - stride_in_bytes = (fmt & VPX_IMG_FMT_HIGHBITDEPTH) ? s * 2 : s; - - /* Allocate the new image */ - if (!img) { - img = (vpx_image_t *)calloc(1, sizeof(vpx_image_t)); - - if (!img) - goto fail; - - img->self_allocd = 1; - } else { - memset(img, 0, sizeof(vpx_image_t)); - } - - img->img_data = img_data; - - if (!img_data) { - const uint64_t alloc_size = (fmt & VPX_IMG_FMT_PLANAR) ? - (uint64_t)h * s * bps / 8 : (uint64_t)h * s; - - if (alloc_size != (size_t)alloc_size) - goto fail; - - img->img_data = (uint8_t *)vpx_memalign(buf_align, (size_t)alloc_size); - img->img_data_owner = 1; - } - - if (!img->img_data) - goto fail; - - img->fmt = fmt; - img->bit_depth = (fmt & VPX_IMG_FMT_HIGHBITDEPTH) ? 16 : 8; - img->w = w; - img->h = h; - img->x_chroma_shift = xcs; - img->y_chroma_shift = ycs; - img->bps = bps; - - /* Calculate strides */ - img->stride[VPX_PLANE_Y] = img->stride[VPX_PLANE_ALPHA] = stride_in_bytes; - img->stride[VPX_PLANE_U] = img->stride[VPX_PLANE_V] = stride_in_bytes >> xcs; - - /* Default viewport to entire image */ - if (!vpx_img_set_rect(img, 0, 0, d_w, d_h)) - return img; - -fail: - vpx_img_free(img); - return NULL; -} - -vpx_image_t *vpx_img_alloc(vpx_image_t *img, - vpx_img_fmt_t fmt, - unsigned int d_w, - unsigned int d_h, - unsigned int align) { - return img_alloc_helper(img, fmt, d_w, d_h, align, align, NULL); -} - -vpx_image_t *vpx_img_wrap(vpx_image_t *img, - vpx_img_fmt_t fmt, - unsigned int d_w, - unsigned int d_h, - unsigned int stride_align, - unsigned char *img_data) { - /* By setting buf_align = 1, we don't change buffer alignment in this - * function. */ - return img_alloc_helper(img, fmt, d_w, d_h, 1, stride_align, img_data); -} - -int vpx_img_set_rect(vpx_image_t *img, - unsigned int x, - unsigned int y, - unsigned int w, - unsigned int h) { - unsigned char *data; - - if (x + w <= img->w && y + h <= img->h) { - img->d_w = w; - img->d_h = h; - - /* Calculate plane pointers */ - if (!(img->fmt & VPX_IMG_FMT_PLANAR)) { - img->planes[VPX_PLANE_PACKED] = - img->img_data + x * img->bps / 8 + y * img->stride[VPX_PLANE_PACKED]; - } else { - const int bytes_per_sample = - (img->fmt & VPX_IMG_FMT_HIGHBITDEPTH) ? 2 : 1; - data = img->img_data; - - if (img->fmt & VPX_IMG_FMT_HAS_ALPHA) { - img->planes[VPX_PLANE_ALPHA] = - data + x * bytes_per_sample + y * img->stride[VPX_PLANE_ALPHA]; - data += img->h * img->stride[VPX_PLANE_ALPHA]; - } - - img->planes[VPX_PLANE_Y] = data + x * bytes_per_sample + - y * img->stride[VPX_PLANE_Y]; - data += img->h * img->stride[VPX_PLANE_Y]; - - if (!(img->fmt & VPX_IMG_FMT_UV_FLIP)) { - img->planes[VPX_PLANE_U] = - data + (x >> img->x_chroma_shift) * bytes_per_sample + - (y >> img->y_chroma_shift) * img->stride[VPX_PLANE_U]; - data += (img->h >> img->y_chroma_shift) * img->stride[VPX_PLANE_U]; - img->planes[VPX_PLANE_V] = - data + (x >> img->x_chroma_shift) * bytes_per_sample + - (y >> img->y_chroma_shift) * img->stride[VPX_PLANE_V]; - } else { - img->planes[VPX_PLANE_V] = - data + (x >> img->x_chroma_shift) * bytes_per_sample + - (y >> img->y_chroma_shift) * img->stride[VPX_PLANE_V]; - data += (img->h >> img->y_chroma_shift) * img->stride[VPX_PLANE_V]; - img->planes[VPX_PLANE_U] = - data + (x >> img->x_chroma_shift) * bytes_per_sample + - (y >> img->y_chroma_shift) * img->stride[VPX_PLANE_U]; - } - } - return 0; - } - return -1; -} - -void vpx_img_flip(vpx_image_t *img) { - /* Note: In the calculation pointer adjustment calculation, we want the - * rhs to be promoted to a signed type. Section 6.3.1.8 of the ISO C99 - * standard indicates that if the adjustment parameter is unsigned, the - * stride parameter will be promoted to unsigned, causing errors when - * the lhs is a larger type than the rhs. - */ - img->planes[VPX_PLANE_Y] += (signed)(img->d_h - 1) * img->stride[VPX_PLANE_Y]; - img->stride[VPX_PLANE_Y] = -img->stride[VPX_PLANE_Y]; - - img->planes[VPX_PLANE_U] += (signed)((img->d_h >> img->y_chroma_shift) - 1) - * img->stride[VPX_PLANE_U]; - img->stride[VPX_PLANE_U] = -img->stride[VPX_PLANE_U]; - - img->planes[VPX_PLANE_V] += (signed)((img->d_h >> img->y_chroma_shift) - 1) - * img->stride[VPX_PLANE_V]; - img->stride[VPX_PLANE_V] = -img->stride[VPX_PLANE_V]; - - img->planes[VPX_PLANE_ALPHA] += (signed)(img->d_h - 1) * img->stride[VPX_PLANE_ALPHA]; - img->stride[VPX_PLANE_ALPHA] = -img->stride[VPX_PLANE_ALPHA]; -} - -void vpx_img_free(vpx_image_t *img) { - if (img) { - if (img->img_data && img->img_data_owner) - vpx_free(img->img_data); - - if (img->self_allocd) - free(img); - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/src/vpx_psnr.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/src/vpx_psnr.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/src/vpx_psnr.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/src/vpx_psnr.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "vpx/internal/vpx_psnr.h" - -#define MAX_PSNR 100.0 - -double vpx_sse_to_psnr(double samples, double peak, double sse) { - if (sse > 0.0) { - const double psnr = 10.0 * log10(samples * peak * peak / sse); - return psnr > MAX_PSNR ? MAX_PSNR : psnr; - } else { - return MAX_PSNR; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/svc_context.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/svc_context.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/svc_context.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/svc_context.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -/** - * SvcContext - input parameters and state to encode a multi-layered - * spatial SVC frame - */ - -#ifndef VPX_SVC_CONTEXT_H_ -#define VPX_SVC_CONTEXT_H_ - -#include "./vp8cx.h" -#include "./vpx_encoder.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum SVC_LOG_LEVEL { - SVC_LOG_ERROR, - SVC_LOG_INFO, - SVC_LOG_DEBUG -} SVC_LOG_LEVEL; - -typedef struct { - // public interface to svc_command options - int spatial_layers; // number of spatial layers - int temporal_layers; // number of temporal layers - SVC_LOG_LEVEL log_level; // amount of information to display - int log_print; // when set, printf log messages instead of returning the - // message with svc_get_message - - // private storage for vpx_svc_encode - void *internal; -} SvcContext; - -#define OPTION_BUFFER_SIZE 1024 -#define COMPONENTS 4 // psnr & sse statistics maintained for total, y, u, v - -typedef struct SvcInternal { - char options[OPTION_BUFFER_SIZE]; // set by vpx_svc_set_options - - // values extracted from option, quantizers - vpx_svc_extra_cfg_t svc_params; - int enable_auto_alt_ref[VPX_SS_MAX_LAYERS]; - int bitrates[VPX_SS_MAX_LAYERS]; - - // accumulated statistics - double psnr_sum[VPX_SS_MAX_LAYERS][COMPONENTS]; // total/Y/U/V - uint64_t sse_sum[VPX_SS_MAX_LAYERS][COMPONENTS]; - uint32_t bytes_sum[VPX_SS_MAX_LAYERS]; - - // codec encoding values - int width; // width of highest layer - int height; // height of highest layer - int kf_dist; // distance between keyframes - - // state variables - int psnr_pkt_received; - int layer; - int use_multiple_frame_contexts; - - char message_buffer[2048]; - vpx_codec_ctx_t *codec_ctx; -} SvcInternal_t; - -/** - * Set SVC options - * options are supplied as a single string separated by spaces - * Format: encoding-mode= - * layers= - * scaling-factors=/,/,... - * quantizers=,,... - */ -vpx_codec_err_t vpx_svc_set_options(SvcContext *svc_ctx, const char *options); - -/** - * initialize SVC encoding - */ -vpx_codec_err_t vpx_svc_init(SvcContext *svc_ctx, - vpx_codec_ctx_t *codec_ctx, - vpx_codec_iface_t *iface, - vpx_codec_enc_cfg_t *cfg); -/** - * encode a frame of video with multiple layers - */ -vpx_codec_err_t vpx_svc_encode(SvcContext *svc_ctx, - vpx_codec_ctx_t *codec_ctx, - struct vpx_image *rawimg, - vpx_codec_pts_t pts, - int64_t duration, int deadline); - -/** - * finished with svc encoding, release allocated resources - */ -void vpx_svc_release(SvcContext *svc_ctx); - -/** - * dump accumulated statistics and reset accumulated values - */ -const char *vpx_svc_dump_statistics(SvcContext *svc_ctx); - -/** - * get status message from previous encode - */ -const char *vpx_svc_get_message(const SvcContext *svc_ctx); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VPX_SVC_CONTEXT_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/vp8cx.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/vp8cx.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/vp8cx.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/vp8cx.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,699 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef VPX_VP8CX_H_ -#define VPX_VP8CX_H_ - -/*!\defgroup vp8_encoder WebM VP8/VP9 Encoder - * \ingroup vp8 - * - * @{ - */ -#include "./vp8.h" -#include "./vpx_encoder.h" - -/*!\file - * \brief Provides definitions for using VP8 or VP9 encoder algorithm within the - * vpx Codec Interface. - */ - -#ifdef __cplusplus -extern "C" { -#endif - -/*!\name Algorithm interface for VP8 - * - * This interface provides the capability to encode raw VP8 streams. - * @{ - */ -extern vpx_codec_iface_t vpx_codec_vp8_cx_algo; -extern vpx_codec_iface_t *vpx_codec_vp8_cx(void); -/*!@} - end algorithm interface member group*/ - -/*!\name Algorithm interface for VP9 - * - * This interface provides the capability to encode raw VP9 streams. - * @{ - */ -extern vpx_codec_iface_t vpx_codec_vp9_cx_algo; -extern vpx_codec_iface_t *vpx_codec_vp9_cx(void); -/*!@} - end algorithm interface member group*/ - - -/* - * Algorithm Flags - */ - -/*!\brief Don't reference the last frame - * - * When this flag is set, the encoder will not use the last frame as a - * predictor. When not set, the encoder will choose whether to use the - * last frame or not automatically. - */ -#define VP8_EFLAG_NO_REF_LAST (1<<16) - - -/*!\brief Don't reference the golden frame - * - * When this flag is set, the encoder will not use the golden frame as a - * predictor. When not set, the encoder will choose whether to use the - * golden frame or not automatically. - */ -#define VP8_EFLAG_NO_REF_GF (1<<17) - - -/*!\brief Don't reference the alternate reference frame - * - * When this flag is set, the encoder will not use the alt ref frame as a - * predictor. When not set, the encoder will choose whether to use the - * alt ref frame or not automatically. - */ -#define VP8_EFLAG_NO_REF_ARF (1<<21) - - -/*!\brief Don't update the last frame - * - * When this flag is set, the encoder will not update the last frame with - * the contents of the current frame. - */ -#define VP8_EFLAG_NO_UPD_LAST (1<<18) - - -/*!\brief Don't update the golden frame - * - * When this flag is set, the encoder will not update the golden frame with - * the contents of the current frame. - */ -#define VP8_EFLAG_NO_UPD_GF (1<<22) - - -/*!\brief Don't update the alternate reference frame - * - * When this flag is set, the encoder will not update the alt ref frame with - * the contents of the current frame. - */ -#define VP8_EFLAG_NO_UPD_ARF (1<<23) - - -/*!\brief Force golden frame update - * - * When this flag is set, the encoder copy the contents of the current frame - * to the golden frame buffer. - */ -#define VP8_EFLAG_FORCE_GF (1<<19) - - -/*!\brief Force alternate reference frame update - * - * When this flag is set, the encoder copy the contents of the current frame - * to the alternate reference frame buffer. - */ -#define VP8_EFLAG_FORCE_ARF (1<<24) - - -/*!\brief Disable entropy update - * - * When this flag is set, the encoder will not update its internal entropy - * model based on the entropy of this frame. - */ -#define VP8_EFLAG_NO_UPD_ENTROPY (1<<20) - - -/*!\brief VPx encoder control functions - * - * This set of macros define the control functions available for VPx - * encoder interface. - * - * \sa #vpx_codec_control - */ -enum vp8e_enc_control_id { - /*!\brief Codec control function to set mode of entropy update in encoder. - * - * Supported in codecs: VP8, VP9 - */ - VP8E_UPD_ENTROPY = 5, - - /*!\brief Codec control function to set reference update mode in encoder. - * - * Supported in codecs: VP8, VP9 - */ - VP8E_UPD_REFERENCE, - - /*!\brief Codec control function to set which reference frame encoder can use. - * - * Supported in codecs: VP8, VP9 - */ - VP8E_USE_REFERENCE, - - /*!\brief Codec control function to pass an ROI map to encoder. - * - * Supported in codecs: VP8, VP9 - */ - VP8E_SET_ROI_MAP, - - /*!\brief Codec control function to pass an Active map to encoder. - * - * Supported in codecs: VP8, VP9 - */ - VP8E_SET_ACTIVEMAP, - - /*!\brief Codec control function to set encoder scaling mode. - * - * Supported in codecs: VP8, VP9 - */ - VP8E_SET_SCALEMODE = 11, - - /*!\brief Codec control function to set encoder internal speed settings. - * - * Changes in this value influences, among others, the encoder's selection - * of motion estimation methods. Values greater than 0 will increase encoder - * speed at the expense of quality. - * - * \note Valid range for VP8: -16..16 - * \note Valid range for VP9: -8..8 - * - * Supported in codecs: VP8, VP9 - */ - VP8E_SET_CPUUSED = 13, - - /*!\brief Codec control function to enable automatic set and use alf frames. - * - * Supported in codecs: VP8, VP9 - */ - VP8E_SET_ENABLEAUTOALTREF, - - /*!\brief control function to set noise sensitivity - * - * 0: off, 1: OnYOnly, 2: OnYUV, - * 3: OnYUVAggressive, 4: Adaptive - * - * Supported in codecs: VP8 - */ - VP8E_SET_NOISE_SENSITIVITY, - - /*!\brief Codec control function to set sharpness. - * - * Supported in codecs: VP8, VP9 - */ - VP8E_SET_SHARPNESS, - - /*!\brief Codec control function to set the threshold for MBs treated static. - * - * Supported in codecs: VP8, VP9 - */ - VP8E_SET_STATIC_THRESHOLD, - - /*!\brief Codec control function to set the number of token partitions. - * - * Supported in codecs: VP8 - */ - VP8E_SET_TOKEN_PARTITIONS, - - /*!\brief Codec control function to get last quantizer chosen by the encoder. - * - * Return value uses internal quantizer scale defined by the codec. - * - * Supported in codecs: VP8, VP9 - */ - VP8E_GET_LAST_QUANTIZER, - - /*!\brief Codec control function to get last quantizer chosen by the encoder. - * - * Return value uses the 0..63 scale as used by the rc_*_quantizer config - * parameters. - * - * Supported in codecs: VP8, VP9 - */ - VP8E_GET_LAST_QUANTIZER_64, - - /*!\brief Codec control function to set the max no of frames to create arf. - * - * Supported in codecs: VP8, VP9 - */ - VP8E_SET_ARNR_MAXFRAMES, - - /*!\brief Codec control function to set the filter strength for the arf. - * - * Supported in codecs: VP8, VP9 - */ - VP8E_SET_ARNR_STRENGTH, - - /*!\deprecated control function to set the filter type to use for the arf. */ - VP8E_SET_ARNR_TYPE, - - /*!\brief Codec control function to set visual tuning. - * - * Supported in codecs: VP8, VP9 - */ - VP8E_SET_TUNING, - - /*!\brief Codec control function to set constrained quality level. - * - * \attention For this value to be used vpx_codec_enc_cfg_t::g_usage must be - * set to #VPX_CQ. - * \note Valid range: 0..63 - * - * Supported in codecs: VP8, VP9 - */ - VP8E_SET_CQ_LEVEL, - - /*!\brief Codec control function to set Max data rate for Intra frames. - * - * This value controls additional clamping on the maximum size of a - * keyframe. It is expressed as a percentage of the average - * per-frame bitrate, with the special (and default) value 0 meaning - * unlimited, or no additional clamping beyond the codec's built-in - * algorithm. - * - * For example, to allocate no more than 4.5 frames worth of bitrate - * to a keyframe, set this to 450. - * - * Supported in codecs: VP8, VP9 - */ - VP8E_SET_MAX_INTRA_BITRATE_PCT, - - /*!\brief Codec control function to set reference and update frame flags. - * - * Supported in codecs: VP8 - */ - VP8E_SET_FRAME_FLAGS, - - /*!\brief Codec control function to set max data rate for Inter frames. - * - * This value controls additional clamping on the maximum size of an - * inter frame. It is expressed as a percentage of the average - * per-frame bitrate, with the special (and default) value 0 meaning - * unlimited, or no additional clamping beyond the codec's built-in - * algorithm. - * - * For example, to allow no more than 4.5 frames worth of bitrate - * to an inter frame, set this to 450. - * - * Supported in codecs: VP9 - */ - VP9E_SET_MAX_INTER_BITRATE_PCT, - - /*!\brief Boost percentage for Golden Frame in CBR mode. - * - * This value controls the amount of boost given to Golden Frame in - * CBR mode. It is expressed as a percentage of the average - * per-frame bitrate, with the special (and default) value 0 meaning - * the feature is off, i.e., no golden frame boost in CBR mode and - * average bitrate target is used. - * - * For example, to allow 100% more bits, i.e, 2X, in a golden frame - * than average frame, set this to 100. - * - * Supported in codecs: VP9 - */ - VP9E_SET_GF_CBR_BOOST_PCT, - - /*!\brief Codec control function to set the temporal layer id. - * - * For temporal scalability: this control allows the application to set the - * layer id for each frame to be encoded. Note that this control must be set - * for every frame prior to encoding. The usage of this control function - * supersedes the internal temporal pattern counter, which is now deprecated. - * - * Supported in codecs: VP8 - */ - VP8E_SET_TEMPORAL_LAYER_ID, - - /*!\brief Codec control function to set encoder screen content mode. - * - * Supported in codecs: VP8 - */ - VP8E_SET_SCREEN_CONTENT_MODE, - - /*!\brief Codec control function to set lossless encoding mode. - * - * VP9 can operate in lossless encoding mode, in which the bitstream - * produced will be able to decode and reconstruct a perfect copy of - * input source. This control function provides a mean to switch encoder - * into lossless coding mode(1) or normal coding mode(0) that may be lossy. - * 0 = lossy coding mode - * 1 = lossless coding mode - * - * By default, encoder operates in normal coding mode (maybe lossy). - * - * Supported in codecs: VP9 - */ - VP9E_SET_LOSSLESS, - - /*!\brief Codec control function to set number of tile columns. - * - * In encoding and decoding, VP9 allows an input image frame be partitioned - * into separated vertical tile columns, which can be encoded or decoded - * independently. This enables easy implementation of parallel encoding and - * decoding. This control requests the encoder to use column tiles in - * encoding an input frame, with number of tile columns (in Log2 unit) as - * the parameter: - * 0 = 1 tile column - * 1 = 2 tile columns - * 2 = 4 tile columns - * ..... - * n = 2**n tile columns - * The requested tile columns will be capped by encoder based on image size - * limitation (The minimum width of a tile column is 256 pixel, the maximum - * is 4096). - * - * By default, the value is 0, i.e. one single column tile for entire image. - * - * Supported in codecs: VP9 - */ - VP9E_SET_TILE_COLUMNS, - - /*!\brief Codec control function to set number of tile rows. - * - * In encoding and decoding, VP9 allows an input image frame be partitioned - * into separated horizontal tile rows. Tile rows are encoded or decoded - * sequentially. Even though encoding/decoding of later tile rows depends on - * earlier ones, this allows the encoder to output data packets for tile rows - * prior to completely processing all tile rows in a frame, thereby reducing - * the latency in processing between input and output. The parameter - * for this control describes the number of tile rows, which has a valid - * range [0, 2]: - * 0 = 1 tile row - * 1 = 2 tile rows - * 2 = 4 tile rows - * - * By default, the value is 0, i.e. one single row tile for entire image. - * - * Supported in codecs: VP9 - */ - VP9E_SET_TILE_ROWS, - - /*!\brief Codec control function to enable frame parallel decoding feature. - * - * VP9 has a bitstream feature to reduce decoding dependency between frames - * by turning off backward update of probability context used in encoding - * and decoding. This allows staged parallel processing of more than one - * video frames in the decoder. This control function provides a mean to - * turn this feature on or off for bitstreams produced by encoder. - * - * By default, this feature is off. - * - * Supported in codecs: VP9 - */ - VP9E_SET_FRAME_PARALLEL_DECODING, - - /*!\brief Codec control function to set adaptive quantization mode. - * - * VP9 has a segment based feature that allows encoder to adaptively change - * quantization parameter for each segment within a frame to improve the - * subjective quality. This control makes encoder operate in one of the - * several AQ_modes supported. - * - * By default, encoder operates with AQ_Mode 0(adaptive quantization off). - * - * Supported in codecs: VP9 - */ - VP9E_SET_AQ_MODE, - - /*!\brief Codec control function to enable/disable periodic Q boost. - * - * One VP9 encoder speed feature is to enable quality boost by lowering - * frame level Q periodically. This control function provides a mean to - * turn on/off this feature. - * 0 = off - * 1 = on - * - * By default, the encoder is allowed to use this feature for appropriate - * encoding modes. - * - * Supported in codecs: VP9 - */ - VP9E_SET_FRAME_PERIODIC_BOOST, - - /*!\brief Codec control function to set noise sensitivity. - * - * 0: off, 1: On(YOnly) - * - * Supported in codecs: VP9 - */ - VP9E_SET_NOISE_SENSITIVITY, - - /*!\brief Codec control function to turn on/off SVC in encoder. - * \note Return value is VPX_CODEC_INVALID_PARAM if the encoder does not - * support SVC in its current encoding mode - * 0: off, 1: on - * - * Supported in codecs: VP9 - */ - VP9E_SET_SVC, - -#if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION) - /*!\brief Codec control function to set parameters for SVC. - * \note Parameters contain min_q, max_q, scaling factor for each of the - * SVC layers. - * - * Supported in codecs: VP9 - */ - VP9E_SET_SVC_PARAMETERS, -#endif - - /*!\brief Codec control function to set svc layer for spatial and temporal. - * \note Valid ranges: 0..#vpx_codec_enc_cfg::ss_number_layers for spatial - * layer and 0..#vpx_codec_enc_cfg::ts_number_layers for - * temporal layer. - * - * Supported in codecs: VP9 - */ - VP9E_SET_SVC_LAYER_ID, - - /*!\brief Codec control function to set content type. - * \note Valid parameter range: - * VP9E_CONTENT_DEFAULT = Regular video content (Default) - * VP9E_CONTENT_SCREEN = Screen capture content - * - * Supported in codecs: VP9 - */ - VP9E_SET_TUNE_CONTENT, - -#if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION) - /*!\brief Codec control function to get svc layer ID. - * \note The layer ID returned is for the data packet from the registered - * callback function. - * - * Supported in codecs: VP9 - */ - VP9E_GET_SVC_LAYER_ID, - - /*!\brief Codec control function to register callback to get per layer packet. - * \note Parameter for this control function is a structure with a callback - * function and a pointer to private data used by the callback. - * - * Supported in codecs: VP9 - */ - VP9E_REGISTER_CX_CALLBACK, -#endif - - /*!\brief Codec control function to set color space info. - * \note Valid ranges: 0..7, default is "UNKNOWN". - * 0 = UNKNOWN, - * 1 = BT_601 - * 2 = BT_709 - * 3 = SMPTE_170 - * 4 = SMPTE_240 - * 5 = BT_2020 - * 6 = RESERVED - * 7 = SRGB - * - * Supported in codecs: VP9 - */ - VP9E_SET_COLOR_SPACE, -}; - -/*!\brief vpx 1-D scaling mode - * - * This set of constants define 1-D vpx scaling modes - */ -typedef enum vpx_scaling_mode_1d { - VP8E_NORMAL = 0, - VP8E_FOURFIVE = 1, - VP8E_THREEFIVE = 2, - VP8E_ONETWO = 3 -} VPX_SCALING_MODE; - - -/*!\brief vpx region of interest map - * - * These defines the data structures for the region of interest map - * - */ - -typedef struct vpx_roi_map { - /*! An id between 0 and 3 for each 16x16 region within a frame. */ - unsigned char *roi_map; - unsigned int rows; /**< Number of rows. */ - unsigned int cols; /**< Number of columns. */ - // TODO(paulwilkins): broken for VP9 which has 8 segments - // q and loop filter deltas for each segment - // (see MAX_MB_SEGMENTS) - int delta_q[4]; /**< Quantizer deltas. */ - int delta_lf[4]; /**< Loop filter deltas. */ - /*! Static breakout threshold for each segment. */ - unsigned int static_threshold[4]; -} vpx_roi_map_t; - -/*!\brief vpx active region map - * - * These defines the data structures for active region map - * - */ - - -typedef struct vpx_active_map { - unsigned char *active_map; /**< specify an on (1) or off (0) each 16x16 region within a frame */ - unsigned int rows; /**< number of rows */ - unsigned int cols; /**< number of cols */ -} vpx_active_map_t; - -/*!\brief vpx image scaling mode - * - * This defines the data structure for image scaling mode - * - */ -typedef struct vpx_scaling_mode { - VPX_SCALING_MODE h_scaling_mode; /**< horizontal scaling mode */ - VPX_SCALING_MODE v_scaling_mode; /**< vertical scaling mode */ -} vpx_scaling_mode_t; - -/*!\brief VP8 token partition mode - * - * This defines VP8 partitioning mode for compressed data, i.e., the number of - * sub-streams in the bitstream. Used for parallelized decoding. - * - */ - -typedef enum { - VP8_ONE_TOKENPARTITION = 0, - VP8_TWO_TOKENPARTITION = 1, - VP8_FOUR_TOKENPARTITION = 2, - VP8_EIGHT_TOKENPARTITION = 3 -} vp8e_token_partitions; - -/*!brief VP9 encoder content type */ -typedef enum { - VP9E_CONTENT_DEFAULT, - VP9E_CONTENT_SCREEN, - VP9E_CONTENT_INVALID -} vp9e_tune_content; - -/*!\brief VP8 model tuning parameters - * - * Changes the encoder to tune for certain types of input material. - * - */ -typedef enum { - VP8_TUNE_PSNR, - VP8_TUNE_SSIM -} vp8e_tuning; - -#if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION) -/*!\brief vp9 svc layer parameters - * - * This defines the spatial and temporal layer id numbers for svc encoding. - * This is used with the #VP9E_SET_SVC_LAYER_ID control to set the spatial and - * temporal layer id for the current frame. - * - */ -typedef struct vpx_svc_layer_id { - int spatial_layer_id; /**< Spatial layer id number. */ - int temporal_layer_id; /**< Temporal layer id number. */ -} vpx_svc_layer_id_t; -#else -/*!\brief vp9 svc layer parameters - * - * This defines the temporal layer id numbers for svc encoding. - * This is used with the #VP9E_SET_SVC_LAYER_ID control to set the - * temporal layer id for the current frame. - * - */ -typedef struct vpx_svc_layer_id { - int temporal_layer_id; /**< Temporal layer id number. */ -} vpx_svc_layer_id_t; -#endif - -/*!\brief VP8 encoder control function parameter type - * - * Defines the data types that VP8E control functions take. Note that - * additional common controls are defined in vp8.h - * - */ - - -/* These controls have been deprecated in favor of the flags parameter to - * vpx_codec_encode(). See the definition of VP8_EFLAG_* above. - */ -VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_UPD_ENTROPY, int) -VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_UPD_REFERENCE, int) -VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_USE_REFERENCE, int) - -VPX_CTRL_USE_TYPE(VP8E_SET_FRAME_FLAGS, int) -VPX_CTRL_USE_TYPE(VP8E_SET_TEMPORAL_LAYER_ID, int) -VPX_CTRL_USE_TYPE(VP8E_SET_ROI_MAP, vpx_roi_map_t *) -VPX_CTRL_USE_TYPE(VP8E_SET_ACTIVEMAP, vpx_active_map_t *) -VPX_CTRL_USE_TYPE(VP8E_SET_SCALEMODE, vpx_scaling_mode_t *) - -VPX_CTRL_USE_TYPE(VP9E_SET_SVC, int) -#if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION) -VPX_CTRL_USE_TYPE(VP9E_SET_SVC_PARAMETERS, void *) -VPX_CTRL_USE_TYPE(VP9E_REGISTER_CX_CALLBACK, void *) -#endif -VPX_CTRL_USE_TYPE(VP9E_SET_SVC_LAYER_ID, vpx_svc_layer_id_t *) - -VPX_CTRL_USE_TYPE(VP8E_SET_CPUUSED, int) -VPX_CTRL_USE_TYPE(VP8E_SET_ENABLEAUTOALTREF, unsigned int) -VPX_CTRL_USE_TYPE(VP8E_SET_NOISE_SENSITIVITY, unsigned int) -VPX_CTRL_USE_TYPE(VP8E_SET_SHARPNESS, unsigned int) -VPX_CTRL_USE_TYPE(VP8E_SET_STATIC_THRESHOLD, unsigned int) -VPX_CTRL_USE_TYPE(VP8E_SET_TOKEN_PARTITIONS, int) /* vp8e_token_partitions */ - -VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_MAXFRAMES, unsigned int) -VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_STRENGTH, unsigned int) -VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_SET_ARNR_TYPE, unsigned int) -VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vp8e_tuning */ -VPX_CTRL_USE_TYPE(VP8E_SET_CQ_LEVEL, unsigned int) - -VPX_CTRL_USE_TYPE(VP9E_SET_TILE_COLUMNS, int) -VPX_CTRL_USE_TYPE(VP9E_SET_TILE_ROWS, int) - -VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER, int *) -VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER_64, int *) -#if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION) -VPX_CTRL_USE_TYPE(VP9E_GET_SVC_LAYER_ID, vpx_svc_layer_id_t *) -#endif - -VPX_CTRL_USE_TYPE(VP8E_SET_MAX_INTRA_BITRATE_PCT, unsigned int) -VPX_CTRL_USE_TYPE(VP8E_SET_MAX_INTER_BITRATE_PCT, unsigned int) - -VPX_CTRL_USE_TYPE(VP8E_SET_SCREEN_CONTENT_MODE, unsigned int) - -VPX_CTRL_USE_TYPE(VP9E_SET_GF_CBR_BOOST_PCT, unsigned int) - -VPX_CTRL_USE_TYPE(VP9E_SET_LOSSLESS, unsigned int) - -VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PARALLEL_DECODING, unsigned int) - -VPX_CTRL_USE_TYPE(VP9E_SET_AQ_MODE, unsigned int) - -VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PERIODIC_BOOST, unsigned int) - -VPX_CTRL_USE_TYPE(VP9E_SET_NOISE_SENSITIVITY, unsigned int) - -VPX_CTRL_USE_TYPE(VP9E_SET_TUNE_CONTENT, int) /* vp9e_tune_content */ - -VPX_CTRL_USE_TYPE(VP9E_SET_COLOR_SPACE, int) -/*! @} - end defgroup vp8_encoder */ -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VPX_VP8CX_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/vp8dx.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/vp8dx.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/vp8dx.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/vp8dx.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/*!\defgroup vp8_decoder WebM VP8/VP9 Decoder - * \ingroup vp8 - * - * @{ - */ -/*!\file - * \brief Provides definitions for using VP8 or VP9 within the vpx Decoder - * interface. - */ -#ifndef VPX_VP8DX_H_ -#define VPX_VP8DX_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Include controls common to both the encoder and decoder */ -#include "./vp8.h" - -/*!\name Algorithm interface for VP8 - * - * This interface provides the capability to decode VP8 streams. - * @{ - */ -extern vpx_codec_iface_t vpx_codec_vp8_dx_algo; -extern vpx_codec_iface_t *vpx_codec_vp8_dx(void); -/*!@} - end algorithm interface member group*/ - -/*!\name Algorithm interface for VP9 - * - * This interface provides the capability to decode VP9 streams. - * @{ - */ -extern vpx_codec_iface_t vpx_codec_vp9_dx_algo; -extern vpx_codec_iface_t *vpx_codec_vp9_dx(void); -/*!@} - end algorithm interface member group*/ - - -/*!\enum vp8_dec_control_id - * \brief VP8 decoder control functions - * - * This set of macros define the control functions available for the VP8 - * decoder interface. - * - * \sa #vpx_codec_control - */ -enum vp8_dec_control_id { - /** control function to get info on which reference frames were updated - * by the last decode - */ - VP8D_GET_LAST_REF_UPDATES = VP8_DECODER_CTRL_ID_START, - - /** check if the indicated frame is corrupted */ - VP8D_GET_FRAME_CORRUPTED, - - /** control function to get info on which reference frames were used - * by the last decode - */ - VP8D_GET_LAST_REF_USED, - - /** decryption function to decrypt encoded buffer data immediately - * before decoding. Takes a vpx_decrypt_init, which contains - * a callback function and opaque context pointer. - */ - VPXD_SET_DECRYPTOR, - VP8D_SET_DECRYPTOR = VPXD_SET_DECRYPTOR, - - /** control function to get the dimensions that the current frame is decoded - * at. This may be different to the intended display size for the frame as - * specified in the wrapper or frame header (see VP9D_GET_DISPLAY_SIZE). */ - VP9D_GET_FRAME_SIZE, - - /** control function to get the current frame's intended display dimensions - * (as specified in the wrapper or frame header). This may be different to - * the decoded dimensions of this frame (see VP9D_GET_FRAME_SIZE). */ - VP9D_GET_DISPLAY_SIZE, - - /** control function to get the bit depth of the stream. */ - VP9D_GET_BIT_DEPTH, - - /** control function to set the byte alignment of the planes in the reference - * buffers. Valid values are power of 2, from 32 to 1024. A value of 0 sets - * legacy alignment. I.e. Y plane is aligned to 32 bytes, U plane directly - * follows Y plane, and V plane directly follows U plane. Default value is 0. - */ - VP9_SET_BYTE_ALIGNMENT, - - /** control function to invert the decoding order to from right to left. The - * function is used in a test to confirm the decoding independence of tile - * columns. The function may be used in application where this order - * of decoding is desired. - * - * TODO(yaowu): Rework the unit test that uses this control, and in a future - * release, this test-only control shall be removed. - */ - VP9_INVERT_TILE_DECODE_ORDER, - - VP8_DECODER_CTRL_ID_MAX -}; - -/** Decrypt n bytes of data from input -> output, using the decrypt_state - * passed in VPXD_SET_DECRYPTOR. - */ -typedef void (*vpx_decrypt_cb)(void *decrypt_state, const unsigned char *input, - unsigned char *output, int count); - -/*!\brief Structure to hold decryption state - * - * Defines a structure to hold the decryption state and access function. - */ -typedef struct vpx_decrypt_init { - /*! Decrypt callback. */ - vpx_decrypt_cb decrypt_cb; - - /*! Decryption state. */ - void *decrypt_state; -} vpx_decrypt_init; - -/*!\brief A deprecated alias for vpx_decrypt_init. - */ -typedef vpx_decrypt_init vp8_decrypt_init; - - -/*!\brief VP8 decoder control function parameter type - * - * Defines the data types that VP8D control functions take. Note that - * additional common controls are defined in vp8.h - * - */ - - -VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_UPDATES, int *) -VPX_CTRL_USE_TYPE(VP8D_GET_FRAME_CORRUPTED, int *) -VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_USED, int *) -VPX_CTRL_USE_TYPE(VPXD_SET_DECRYPTOR, vpx_decrypt_init *) -VPX_CTRL_USE_TYPE(VP8D_SET_DECRYPTOR, vpx_decrypt_init *) -VPX_CTRL_USE_TYPE(VP9D_GET_DISPLAY_SIZE, int *) -VPX_CTRL_USE_TYPE(VP9D_GET_BIT_DEPTH, unsigned int *) -VPX_CTRL_USE_TYPE(VP9D_GET_FRAME_SIZE, int *) -VPX_CTRL_USE_TYPE(VP9_INVERT_TILE_DECODE_ORDER, int) - -/*! @} - end defgroup vp8_decoder */ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VPX_VP8DX_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/vp8.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/vp8.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/vp8.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/vp8.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,138 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -/*!\defgroup vp8 VP8 - * \ingroup codecs - * VP8 is vpx's newest video compression algorithm that uses motion - * compensated prediction, Discrete Cosine Transform (DCT) coding of the - * prediction error signal and context dependent entropy coding techniques - * based on arithmetic principles. It features: - * - YUV 4:2:0 image format - * - Macro-block based coding (16x16 luma plus two 8x8 chroma) - * - 1/4 (1/8) pixel accuracy motion compensated prediction - * - 4x4 DCT transform - * - 128 level linear quantizer - * - In loop deblocking filter - * - Context-based entropy coding - * - * @{ - */ -/*!\file - * \brief Provides controls common to both the VP8 encoder and decoder. - */ -#ifndef VPX_VP8_H_ -#define VPX_VP8_H_ - -#include "./vpx_codec.h" -#include "./vpx_image.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/*!\brief Control functions - * - * The set of macros define the control functions of VP8 interface - */ -enum vp8_com_control_id { - VP8_SET_REFERENCE = 1, /**< pass in an external frame into decoder to be used as reference frame */ - VP8_COPY_REFERENCE = 2, /**< get a copy of reference frame from the decoder */ - VP8_SET_POSTPROC = 3, /**< set the decoder's post processing settings */ - VP8_SET_DBG_COLOR_REF_FRAME = 4, /**< set the reference frames to color for each macroblock */ - VP8_SET_DBG_COLOR_MB_MODES = 5, /**< set which macro block modes to color */ - VP8_SET_DBG_COLOR_B_MODES = 6, /**< set which blocks modes to color */ - VP8_SET_DBG_DISPLAY_MV = 7, /**< set which motion vector modes to draw */ - - /* TODO(jkoleszar): The encoder incorrectly reuses some of these values (5+) - * for its control ids. These should be migrated to something like the - * VP8_DECODER_CTRL_ID_START range next time we're ready to break the ABI. - */ - VP9_GET_REFERENCE = 128, /**< get a pointer to a reference frame */ - VP8_COMMON_CTRL_ID_MAX, - VP8_DECODER_CTRL_ID_START = 256 -}; - -/*!\brief post process flags - * - * The set of macros define VP8 decoder post processing flags - */ -enum vp8_postproc_level { - VP8_NOFILTERING = 0, - VP8_DEBLOCK = 1 << 0, - VP8_DEMACROBLOCK = 1 << 1, - VP8_ADDNOISE = 1 << 2, - VP8_DEBUG_TXT_FRAME_INFO = 1 << 3, /**< print frame information */ - VP8_DEBUG_TXT_MBLK_MODES = 1 << 4, /**< print macro block modes over each macro block */ - VP8_DEBUG_TXT_DC_DIFF = 1 << 5, /**< print dc diff for each macro block */ - VP8_DEBUG_TXT_RATE_INFO = 1 << 6, /**< print video rate info (encoder only) */ - VP8_MFQE = 1 << 10 -}; - -/*!\brief post process flags - * - * This define a structure that describe the post processing settings. For - * the best objective measure (using the PSNR metric) set post_proc_flag - * to VP8_DEBLOCK and deblocking_level to 1. - */ - -typedef struct vp8_postproc_cfg { - int post_proc_flag; /**< the types of post processing to be done, should be combination of "vp8_postproc_level" */ - int deblocking_level; /**< the strength of deblocking, valid range [0, 16] */ - int noise_level; /**< the strength of additive noise, valid range [0, 16] */ -} vp8_postproc_cfg_t; - -/*!\brief reference frame type - * - * The set of macros define the type of VP8 reference frames - */ -typedef enum vpx_ref_frame_type { - VP8_LAST_FRAME = 1, - VP8_GOLD_FRAME = 2, - VP8_ALTR_FRAME = 4 -} vpx_ref_frame_type_t; - -/*!\brief reference frame data struct - * - * Define the data struct to access vp8 reference frames. - */ -typedef struct vpx_ref_frame { - vpx_ref_frame_type_t frame_type; /**< which reference frame */ - vpx_image_t img; /**< reference frame data in image format */ -} vpx_ref_frame_t; - -/*!\brief VP9 specific reference frame data struct - * - * Define the data struct to access vp9 reference frames. - */ -typedef struct vp9_ref_frame { - int idx; /**< frame index to get (input) */ - vpx_image_t img; /**< img structure to populate (output) */ -} vp9_ref_frame_t; - -/*!\brief vp8 decoder control function parameter type - * - * defines the data type for each of VP8 decoder control function requires - */ -VPX_CTRL_USE_TYPE(VP8_SET_REFERENCE, vpx_ref_frame_t *) -VPX_CTRL_USE_TYPE(VP8_COPY_REFERENCE, vpx_ref_frame_t *) -VPX_CTRL_USE_TYPE(VP8_SET_POSTPROC, vp8_postproc_cfg_t *) -VPX_CTRL_USE_TYPE(VP8_SET_DBG_COLOR_REF_FRAME, int) -VPX_CTRL_USE_TYPE(VP8_SET_DBG_COLOR_MB_MODES, int) -VPX_CTRL_USE_TYPE(VP8_SET_DBG_COLOR_B_MODES, int) -VPX_CTRL_USE_TYPE(VP8_SET_DBG_DISPLAY_MV, int) -VPX_CTRL_USE_TYPE(VP9_GET_REFERENCE, vp9_ref_frame_t *) - -/*! @} - end defgroup vp8 */ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VPX_VP8_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/vpx_codec.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/vpx_codec.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/vpx_codec.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/vpx_codec.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,479 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/*!\defgroup codec Common Algorithm Interface - * This abstraction allows applications to easily support multiple video - * formats with minimal code duplication. This section describes the interface - * common to all codecs (both encoders and decoders). - * @{ - */ - -/*!\file - * \brief Describes the codec algorithm interface to applications. - * - * This file describes the interface between an application and a - * video codec algorithm. - * - * An application instantiates a specific codec instance by using - * vpx_codec_init() and a pointer to the algorithm's interface structure: - *
- *     my_app.c:
- *       extern vpx_codec_iface_t my_codec;
- *       {
- *           vpx_codec_ctx_t algo;
- *           res = vpx_codec_init(&algo, &my_codec);
- *       }
- *     
- * - * Once initialized, the instance is manged using other functions from - * the vpx_codec_* family. - */ -#ifndef VPX_VPX_CODEC_H_ -#define VPX_VPX_CODEC_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "./vpx_integer.h" -#include "./vpx_image.h" - - /*!\brief Decorator indicating a function is deprecated */ -#ifndef DEPRECATED -#if defined(__GNUC__) && __GNUC__ -#define DEPRECATED __attribute__ ((deprecated)) -#elif defined(_MSC_VER) -#define DEPRECATED -#else -#define DEPRECATED -#endif -#endif /* DEPRECATED */ - -#ifndef DECLSPEC_DEPRECATED -#if defined(__GNUC__) && __GNUC__ -#define DECLSPEC_DEPRECATED /**< \copydoc #DEPRECATED */ -#elif defined(_MSC_VER) -#define DECLSPEC_DEPRECATED __declspec(deprecated) /**< \copydoc #DEPRECATED */ -#else -#define DECLSPEC_DEPRECATED /**< \copydoc #DEPRECATED */ -#endif -#endif /* DECLSPEC_DEPRECATED */ - - /*!\brief Decorator indicating a function is potentially unused */ -#ifdef UNUSED -#elif __GNUC__ -#define UNUSED __attribute__ ((unused)) -#else -#define UNUSED -#endif - - /*!\brief Current ABI version number - * - * \internal - * If this file is altered in any way that changes the ABI, this value - * must be bumped. Examples include, but are not limited to, changing - * types, removing or reassigning enums, adding/removing/rearranging - * fields to structures - */ -#define VPX_CODEC_ABI_VERSION (3 + VPX_IMAGE_ABI_VERSION) /**<\hideinitializer*/ - - /*!\brief Algorithm return codes */ - typedef enum { - /*!\brief Operation completed without error */ - VPX_CODEC_OK, - - /*!\brief Unspecified error */ - VPX_CODEC_ERROR, - - /*!\brief Memory operation failed */ - VPX_CODEC_MEM_ERROR, - - /*!\brief ABI version mismatch */ - VPX_CODEC_ABI_MISMATCH, - - /*!\brief Algorithm does not have required capability */ - VPX_CODEC_INCAPABLE, - - /*!\brief The given bitstream is not supported. - * - * The bitstream was unable to be parsed at the highest level. The decoder - * is unable to proceed. This error \ref SHOULD be treated as fatal to the - * stream. */ - VPX_CODEC_UNSUP_BITSTREAM, - - /*!\brief Encoded bitstream uses an unsupported feature - * - * The decoder does not implement a feature required by the encoder. This - * return code should only be used for features that prevent future - * pictures from being properly decoded. This error \ref MAY be treated as - * fatal to the stream or \ref MAY be treated as fatal to the current GOP. - */ - VPX_CODEC_UNSUP_FEATURE, - - /*!\brief The coded data for this stream is corrupt or incomplete - * - * There was a problem decoding the current frame. This return code - * should only be used for failures that prevent future pictures from - * being properly decoded. This error \ref MAY be treated as fatal to the - * stream or \ref MAY be treated as fatal to the current GOP. If decoding - * is continued for the current GOP, artifacts may be present. - */ - VPX_CODEC_CORRUPT_FRAME, - - /*!\brief An application-supplied parameter is not valid. - * - */ - VPX_CODEC_INVALID_PARAM, - - /*!\brief An iterator reached the end of list. - * - */ - VPX_CODEC_LIST_END - - } - vpx_codec_err_t; - - - /*! \brief Codec capabilities bitfield - * - * Each codec advertises the capabilities it supports as part of its - * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces - * or functionality, and are not required to be supported. - * - * The available flags are specified by VPX_CODEC_CAP_* defines. - */ - typedef long vpx_codec_caps_t; -#define VPX_CODEC_CAP_DECODER 0x1 /**< Is a decoder */ -#define VPX_CODEC_CAP_ENCODER 0x2 /**< Is an encoder */ - - - /*! \brief Initialization-time Feature Enabling - * - * Certain codec features must be known at initialization time, to allow for - * proper memory allocation. - * - * The available flags are specified by VPX_CODEC_USE_* defines. - */ - typedef long vpx_codec_flags_t; - - - /*!\brief Codec interface structure. - * - * Contains function pointers and other data private to the codec - * implementation. This structure is opaque to the application. - */ - typedef const struct vpx_codec_iface vpx_codec_iface_t; - - - /*!\brief Codec private data structure. - * - * Contains data private to the codec implementation. This structure is opaque - * to the application. - */ - typedef struct vpx_codec_priv vpx_codec_priv_t; - - - /*!\brief Iterator - * - * Opaque storage used for iterating over lists. - */ - typedef const void *vpx_codec_iter_t; - - - /*!\brief Codec context structure - * - * All codecs \ref MUST support this context structure fully. In general, - * this data should be considered private to the codec algorithm, and - * not be manipulated or examined by the calling application. Applications - * may reference the 'name' member to get a printable description of the - * algorithm. - */ - typedef struct vpx_codec_ctx { - const char *name; /**< Printable interface name */ - vpx_codec_iface_t *iface; /**< Interface pointers */ - vpx_codec_err_t err; /**< Last returned error */ - const char *err_detail; /**< Detailed info, if available */ - vpx_codec_flags_t init_flags; /**< Flags passed at init time */ - union { - /**< Decoder Configuration Pointer */ - const struct vpx_codec_dec_cfg *dec; - /**< Encoder Configuration Pointer */ - const struct vpx_codec_enc_cfg *enc; - const void *raw; - } config; /**< Configuration pointer aliasing union */ - vpx_codec_priv_t *priv; /**< Algorithm private storage */ - } vpx_codec_ctx_t; - - /*!\brief Bit depth for codec - * * - * This enumeration determines the bit depth of the codec. - */ - typedef enum vpx_bit_depth { - VPX_BITS_8 = 8, /**< 8 bits */ - VPX_BITS_10 = 10, /**< 10 bits */ - VPX_BITS_12 = 12, /**< 12 bits */ - } vpx_bit_depth_t; - - /* - * Library Version Number Interface - * - * For example, see the following sample return values: - * vpx_codec_version() (1<<16 | 2<<8 | 3) - * vpx_codec_version_str() "v1.2.3-rc1-16-gec6a1ba" - * vpx_codec_version_extra_str() "rc1-16-gec6a1ba" - */ - - /*!\brief Return the version information (as an integer) - * - * Returns a packed encoding of the library version number. This will only include - * the major.minor.patch component of the version number. Note that this encoded - * value should be accessed through the macros provided, as the encoding may change - * in the future. - * - */ - int vpx_codec_version(void); -#define VPX_VERSION_MAJOR(v) ((v>>16)&0xff) /**< extract major from packed version */ -#define VPX_VERSION_MINOR(v) ((v>>8)&0xff) /**< extract minor from packed version */ -#define VPX_VERSION_PATCH(v) ((v>>0)&0xff) /**< extract patch from packed version */ - - /*!\brief Return the version major number */ -#define vpx_codec_version_major() ((vpx_codec_version()>>16)&0xff) - - /*!\brief Return the version minor number */ -#define vpx_codec_version_minor() ((vpx_codec_version()>>8)&0xff) - - /*!\brief Return the version patch number */ -#define vpx_codec_version_patch() ((vpx_codec_version()>>0)&0xff) - - - /*!\brief Return the version information (as a string) - * - * Returns a printable string containing the full library version number. This may - * contain additional text following the three digit version number, as to indicate - * release candidates, prerelease versions, etc. - * - */ - const char *vpx_codec_version_str(void); - - - /*!\brief Return the version information (as a string) - * - * Returns a printable "extra string". This is the component of the string returned - * by vpx_codec_version_str() following the three digit version number. - * - */ - const char *vpx_codec_version_extra_str(void); - - - /*!\brief Return the build configuration - * - * Returns a printable string containing an encoded version of the build - * configuration. This may be useful to vpx support. - * - */ - const char *vpx_codec_build_config(void); - - - /*!\brief Return the name for a given interface - * - * Returns a human readable string for name of the given codec interface. - * - * \param[in] iface Interface pointer - * - */ - const char *vpx_codec_iface_name(vpx_codec_iface_t *iface); - - - /*!\brief Convert error number to printable string - * - * Returns a human readable string for the last error returned by the - * algorithm. The returned error will be one line and will not contain - * any newline characters. - * - * - * \param[in] err Error number. - * - */ - const char *vpx_codec_err_to_string(vpx_codec_err_t err); - - - /*!\brief Retrieve error synopsis for codec context - * - * Returns a human readable string for the last error returned by the - * algorithm. The returned error will be one line and will not contain - * any newline characters. - * - * - * \param[in] ctx Pointer to this instance's context. - * - */ - const char *vpx_codec_error(vpx_codec_ctx_t *ctx); - - - /*!\brief Retrieve detailed error information for codec context - * - * Returns a human readable string providing detailed information about - * the last error. - * - * \param[in] ctx Pointer to this instance's context. - * - * \retval NULL - * No detailed information is available. - */ - const char *vpx_codec_error_detail(vpx_codec_ctx_t *ctx); - - - /* REQUIRED FUNCTIONS - * - * The following functions are required to be implemented for all codecs. - * They represent the base case functionality expected of all codecs. - */ - - /*!\brief Destroy a codec instance - * - * Destroys a codec context, freeing any associated memory buffers. - * - * \param[in] ctx Pointer to this instance's context - * - * \retval #VPX_CODEC_OK - * The codec algorithm initialized. - * \retval #VPX_CODEC_MEM_ERROR - * Memory allocation failed. - */ - vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx); - - - /*!\brief Get the capabilities of an algorithm. - * - * Retrieves the capabilities bitfield from the algorithm's interface. - * - * \param[in] iface Pointer to the algorithm interface - * - */ - vpx_codec_caps_t vpx_codec_get_caps(vpx_codec_iface_t *iface); - - - /*!\brief Control algorithm - * - * This function is used to exchange algorithm specific data with the codec - * instance. This can be used to implement features specific to a particular - * algorithm. - * - * This wrapper function dispatches the request to the helper function - * associated with the given ctrl_id. It tries to call this function - * transparently, but will return #VPX_CODEC_ERROR if the request could not - * be dispatched. - * - * Note that this function should not be used directly. Call the - * #vpx_codec_control wrapper macro instead. - * - * \param[in] ctx Pointer to this instance's context - * \param[in] ctrl_id Algorithm specific control identifier - * - * \retval #VPX_CODEC_OK - * The control request was processed. - * \retval #VPX_CODEC_ERROR - * The control request was not processed. - * \retval #VPX_CODEC_INVALID_PARAM - * The data was not valid. - */ - vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx, - int ctrl_id, - ...); -#if defined(VPX_DISABLE_CTRL_TYPECHECKS) && VPX_DISABLE_CTRL_TYPECHECKS -# define vpx_codec_control(ctx,id,data) vpx_codec_control_(ctx,id,data) -# define VPX_CTRL_USE_TYPE(id, typ) -# define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ) -# define VPX_CTRL_VOID(id, typ) - -#else - /*!\brief vpx_codec_control wrapper macro - * - * This macro allows for type safe conversions across the variadic parameter - * to vpx_codec_control_(). - * - * \internal - * It works by dispatching the call to the control function through a wrapper - * function named with the id parameter. - */ -# define vpx_codec_control(ctx,id,data) vpx_codec_control_##id(ctx,id,data)\ - /**<\hideinitializer*/ - - - /*!\brief vpx_codec_control type definition macro - * - * This macro allows for type safe conversions across the variadic parameter - * to vpx_codec_control_(). It defines the type of the argument for a given - * control identifier. - * - * \internal - * It defines a static function with - * the correctly typed arguments as a wrapper to the type-unsafe internal - * function. - */ -# define VPX_CTRL_USE_TYPE(id, typ) \ - static vpx_codec_err_t \ - vpx_codec_control_##id(vpx_codec_ctx_t*, int, typ) UNUSED;\ - \ - static vpx_codec_err_t \ - vpx_codec_control_##id(vpx_codec_ctx_t *ctx, int ctrl_id, typ data) {\ - return vpx_codec_control_(ctx, ctrl_id, data);\ - } /**<\hideinitializer*/ - - - /*!\brief vpx_codec_control deprecated type definition macro - * - * Like #VPX_CTRL_USE_TYPE, but indicates that the specified control is - * deprecated and should not be used. Consult the documentation for your - * codec for more information. - * - * \internal - * It defines a static function with the correctly typed arguments as a - * wrapper to the type-unsafe internal function. - */ -# define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ) \ - DECLSPEC_DEPRECATED static vpx_codec_err_t \ - vpx_codec_control_##id(vpx_codec_ctx_t*, int, typ) DEPRECATED UNUSED;\ - \ - DECLSPEC_DEPRECATED static vpx_codec_err_t \ - vpx_codec_control_##id(vpx_codec_ctx_t *ctx, int ctrl_id, typ data) {\ - return vpx_codec_control_(ctx, ctrl_id, data);\ - } /**<\hideinitializer*/ - - - /*!\brief vpx_codec_control void type definition macro - * - * This macro allows for type safe conversions across the variadic parameter - * to vpx_codec_control_(). It indicates that a given control identifier takes - * no argument. - * - * \internal - * It defines a static function without a data argument as a wrapper to the - * type-unsafe internal function. - */ -# define VPX_CTRL_VOID(id) \ - static vpx_codec_err_t \ - vpx_codec_control_##id(vpx_codec_ctx_t*, int) UNUSED;\ - \ - static vpx_codec_err_t \ - vpx_codec_control_##id(vpx_codec_ctx_t *ctx, int ctrl_id) {\ - return vpx_codec_control_(ctx, ctrl_id);\ - } /**<\hideinitializer*/ - - -#endif - - /*!@} - end defgroup codec*/ -#ifdef __cplusplus -} -#endif -#endif // VPX_VPX_CODEC_H_ - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/vpx_codec.mk gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/vpx_codec.mk --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/vpx_codec.mk 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/vpx_codec.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -## -## Copyright (c) 2010 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - - -API_EXPORTS += exports - -API_SRCS-$(CONFIG_VP8_ENCODER) += vp8.h -API_SRCS-$(CONFIG_VP8_ENCODER) += vp8cx.h -API_DOC_SRCS-$(CONFIG_VP8_ENCODER) += vp8.h -API_DOC_SRCS-$(CONFIG_VP8_ENCODER) += vp8cx.h -ifeq ($(CONFIG_VP9_ENCODER),yes) - API_SRCS-$(CONFIG_SPATIAL_SVC) += src/svc_encodeframe.c - API_SRCS-$(CONFIG_SPATIAL_SVC) += svc_context.h -endif - -API_SRCS-$(CONFIG_VP8_DECODER) += vp8.h -API_SRCS-$(CONFIG_VP8_DECODER) += vp8dx.h -API_DOC_SRCS-$(CONFIG_VP8_DECODER) += vp8.h -API_DOC_SRCS-$(CONFIG_VP8_DECODER) += vp8dx.h - -API_DOC_SRCS-yes += vpx_codec.h -API_DOC_SRCS-yes += vpx_decoder.h -API_DOC_SRCS-yes += vpx_encoder.h -API_DOC_SRCS-yes += vpx_frame_buffer.h -API_DOC_SRCS-yes += vpx_image.h - -API_SRCS-yes += src/vpx_decoder.c -API_SRCS-yes += vpx_decoder.h -API_SRCS-yes += src/vpx_encoder.c -API_SRCS-yes += vpx_encoder.h -API_SRCS-yes += internal/vpx_codec_internal.h -API_SRCS-yes += internal/vpx_psnr.h -API_SRCS-yes += src/vpx_codec.c -API_SRCS-yes += src/vpx_image.c -API_SRCS-yes += src/vpx_psnr.c -API_SRCS-yes += vpx_codec.h -API_SRCS-yes += vpx_codec.mk -API_SRCS-yes += vpx_frame_buffer.h -API_SRCS-yes += vpx_image.h -API_SRCS-$(BUILD_LIBVPX) += vpx_integer.h diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/vpx_decoder.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/vpx_decoder.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/vpx_decoder.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/vpx_decoder.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,378 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef VPX_VPX_DECODER_H_ -#define VPX_VPX_DECODER_H_ - -/*!\defgroup decoder Decoder Algorithm Interface - * \ingroup codec - * This abstraction allows applications using this decoder to easily support - * multiple video formats with minimal code duplication. This section describes - * the interface common to all decoders. - * @{ - */ - -/*!\file - * \brief Describes the decoder algorithm interface to applications. - * - * This file describes the interface between an application and a - * video decoder algorithm. - * - */ -#ifdef __cplusplus -extern "C" { -#endif - -#include "./vpx_codec.h" -#include "./vpx_frame_buffer.h" - - /*!\brief Current ABI version number - * - * \internal - * If this file is altered in any way that changes the ABI, this value - * must be bumped. Examples include, but are not limited to, changing - * types, removing or reassigning enums, adding/removing/rearranging - * fields to structures - */ -#define VPX_DECODER_ABI_VERSION (3 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer*/ - - /*! \brief Decoder capabilities bitfield - * - * Each decoder advertises the capabilities it supports as part of its - * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces - * or functionality, and are not required to be supported by a decoder. - * - * The available flags are specified by VPX_CODEC_CAP_* defines. - */ -#define VPX_CODEC_CAP_PUT_SLICE 0x10000 /**< Will issue put_slice callbacks */ -#define VPX_CODEC_CAP_PUT_FRAME 0x20000 /**< Will issue put_frame callbacks */ -#define VPX_CODEC_CAP_POSTPROC 0x40000 /**< Can postprocess decoded frame */ -#define VPX_CODEC_CAP_ERROR_CONCEALMENT 0x80000 /**< Can conceal errors due to - packet loss */ -#define VPX_CODEC_CAP_INPUT_FRAGMENTS 0x100000 /**< Can receive encoded frames - one fragment at a time */ - - /*! \brief Initialization-time Feature Enabling - * - * Certain codec features must be known at initialization time, to allow for - * proper memory allocation. - * - * The available flags are specified by VPX_CODEC_USE_* defines. - */ -#define VPX_CODEC_CAP_FRAME_THREADING 0x200000 /**< Can support frame-based - multi-threading */ -#define VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER 0x400000 /**< Can support external - frame buffers */ - -#define VPX_CODEC_USE_POSTPROC 0x10000 /**< Postprocess decoded frame */ -#define VPX_CODEC_USE_ERROR_CONCEALMENT 0x20000 /**< Conceal errors in decoded - frames */ -#define VPX_CODEC_USE_INPUT_FRAGMENTS 0x40000 /**< The input frame should be - passed to the decoder one - fragment at a time */ -#define VPX_CODEC_USE_FRAME_THREADING 0x80000 /**< Enable frame-based - multi-threading */ - - /*!\brief Stream properties - * - * This structure is used to query or set properties of the decoded - * stream. Algorithms may extend this structure with data specific - * to their bitstream by setting the sz member appropriately. - */ - typedef struct vpx_codec_stream_info { - unsigned int sz; /**< Size of this structure */ - unsigned int w; /**< Width (or 0 for unknown/default) */ - unsigned int h; /**< Height (or 0 for unknown/default) */ - unsigned int is_kf; /**< Current frame is a keyframe */ - } vpx_codec_stream_info_t; - - /* REQUIRED FUNCTIONS - * - * The following functions are required to be implemented for all decoders. - * They represent the base case functionality expected of all decoders. - */ - - - /*!\brief Initialization Configurations - * - * This structure is used to pass init time configuration options to the - * decoder. - */ - typedef struct vpx_codec_dec_cfg { - unsigned int threads; /**< Maximum number of threads to use, default 1 */ - unsigned int w; /**< Width */ - unsigned int h; /**< Height */ - } vpx_codec_dec_cfg_t; /**< alias for struct vpx_codec_dec_cfg */ - - - /*!\brief Initialize a decoder instance - * - * Initializes a decoder context using the given interface. Applications - * should call the vpx_codec_dec_init convenience macro instead of this - * function directly, to ensure that the ABI version number parameter - * is properly initialized. - * - * If the library was configured with --disable-multithread, this call - * is not thread safe and should be guarded with a lock if being used - * in a multithreaded context. - * - * \param[in] ctx Pointer to this instance's context. - * \param[in] iface Pointer to the algorithm interface to use. - * \param[in] cfg Configuration to use, if known. May be NULL. - * \param[in] flags Bitfield of VPX_CODEC_USE_* flags - * \param[in] ver ABI version number. Must be set to - * VPX_DECODER_ABI_VERSION - * \retval #VPX_CODEC_OK - * The decoder algorithm initialized. - * \retval #VPX_CODEC_MEM_ERROR - * Memory allocation failed. - */ - vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx, - vpx_codec_iface_t *iface, - const vpx_codec_dec_cfg_t *cfg, - vpx_codec_flags_t flags, - int ver); - - /*!\brief Convenience macro for vpx_codec_dec_init_ver() - * - * Ensures the ABI version parameter is properly set. - */ -#define vpx_codec_dec_init(ctx, iface, cfg, flags) \ - vpx_codec_dec_init_ver(ctx, iface, cfg, flags, VPX_DECODER_ABI_VERSION) - - - /*!\brief Parse stream info from a buffer - * - * Performs high level parsing of the bitstream. Construction of a decoder - * context is not necessary. Can be used to determine if the bitstream is - * of the proper format, and to extract information from the stream. - * - * \param[in] iface Pointer to the algorithm interface - * \param[in] data Pointer to a block of data to parse - * \param[in] data_sz Size of the data buffer - * \param[in,out] si Pointer to stream info to update. The size member - * \ref MUST be properly initialized, but \ref MAY be - * clobbered by the algorithm. This parameter \ref MAY - * be NULL. - * - * \retval #VPX_CODEC_OK - * Bitstream is parsable and stream information updated - */ - vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface, - const uint8_t *data, - unsigned int data_sz, - vpx_codec_stream_info_t *si); - - - /*!\brief Return information about the current stream. - * - * Returns information about the stream that has been parsed during decoding. - * - * \param[in] ctx Pointer to this instance's context - * \param[in,out] si Pointer to stream info to update. The size member - * \ref MUST be properly initialized, but \ref MAY be - * clobbered by the algorithm. This parameter \ref MAY - * be NULL. - * - * \retval #VPX_CODEC_OK - * Bitstream is parsable and stream information updated - */ - vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx, - vpx_codec_stream_info_t *si); - - - /*!\brief Decode data - * - * Processes a buffer of coded data. If the processing results in a new - * decoded frame becoming available, PUT_SLICE and PUT_FRAME events may be - * generated, as appropriate. Encoded data \ref MUST be passed in DTS (decode - * time stamp) order. Frames produced will always be in PTS (presentation - * time stamp) order. - * If the decoder is configured with VPX_CODEC_USE_INPUT_FRAGMENTS enabled, - * data and data_sz can contain a fragment of the encoded frame. Fragment - * \#n must contain at least partition \#n, but can also contain subsequent - * partitions (\#n+1 - \#n+i), and if so, fragments \#n+1, .., \#n+i must - * be empty. When no more data is available, this function should be called - * with NULL as data and 0 as data_sz. The memory passed to this function - * must be available until the frame has been decoded. - * - * \param[in] ctx Pointer to this instance's context - * \param[in] data Pointer to this block of new coded data. If - * NULL, a VPX_CODEC_CB_PUT_FRAME event is posted - * for the previously decoded frame. - * \param[in] data_sz Size of the coded data, in bytes. - * \param[in] user_priv Application specific data to associate with - * this frame. - * \param[in] deadline Soft deadline the decoder should attempt to meet, - * in us. Set to zero for unlimited. - * - * \return Returns #VPX_CODEC_OK if the coded data was processed completely - * and future pictures can be decoded without error. Otherwise, - * see the descriptions of the other error codes in ::vpx_codec_err_t - * for recoverability capabilities. - */ - vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx, - const uint8_t *data, - unsigned int data_sz, - void *user_priv, - long deadline); - - - /*!\brief Decoded frames iterator - * - * Iterates over a list of the frames available for display. The iterator - * storage should be initialized to NULL to start the iteration. Iteration is - * complete when this function returns NULL. - * - * The list of available frames becomes valid upon completion of the - * vpx_codec_decode call, and remains valid until the next call to vpx_codec_decode. - * - * \param[in] ctx Pointer to this instance's context - * \param[in,out] iter Iterator storage, initialized to NULL - * - * \return Returns a pointer to an image, if one is ready for display. Frames - * produced will always be in PTS (presentation time stamp) order. - */ - vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx, - vpx_codec_iter_t *iter); - - - /*!\defgroup cap_put_frame Frame-Based Decoding Functions - * - * The following functions are required to be implemented for all decoders - * that advertise the VPX_CODEC_CAP_PUT_FRAME capability. Calling these functions - * for codecs that don't advertise this capability will result in an error - * code being returned, usually VPX_CODEC_ERROR - * @{ - */ - - /*!\brief put frame callback prototype - * - * This callback is invoked by the decoder to notify the application of - * the availability of decoded image data. - */ - typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv, - const vpx_image_t *img); - - - /*!\brief Register for notification of frame completion. - * - * Registers a given function to be called when a decoded frame is - * available. - * - * \param[in] ctx Pointer to this instance's context - * \param[in] cb Pointer to the callback function - * \param[in] user_priv User's private data - * - * \retval #VPX_CODEC_OK - * Callback successfully registered. - * \retval #VPX_CODEC_ERROR - * Decoder context not initialized, or algorithm not capable of - * posting slice completion. - */ - vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx, - vpx_codec_put_frame_cb_fn_t cb, - void *user_priv); - - - /*!@} - end defgroup cap_put_frame */ - - /*!\defgroup cap_put_slice Slice-Based Decoding Functions - * - * The following functions are required to be implemented for all decoders - * that advertise the VPX_CODEC_CAP_PUT_SLICE capability. Calling these functions - * for codecs that don't advertise this capability will result in an error - * code being returned, usually VPX_CODEC_ERROR - * @{ - */ - - /*!\brief put slice callback prototype - * - * This callback is invoked by the decoder to notify the application of - * the availability of partially decoded image data. The - */ - typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv, - const vpx_image_t *img, - const vpx_image_rect_t *valid, - const vpx_image_rect_t *update); - - - /*!\brief Register for notification of slice completion. - * - * Registers a given function to be called when a decoded slice is - * available. - * - * \param[in] ctx Pointer to this instance's context - * \param[in] cb Pointer to the callback function - * \param[in] user_priv User's private data - * - * \retval #VPX_CODEC_OK - * Callback successfully registered. - * \retval #VPX_CODEC_ERROR - * Decoder context not initialized, or algorithm not capable of - * posting slice completion. - */ - vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx, - vpx_codec_put_slice_cb_fn_t cb, - void *user_priv); - - - /*!@} - end defgroup cap_put_slice*/ - - /*!\defgroup cap_external_frame_buffer External Frame Buffer Functions - * - * The following section is required to be implemented for all decoders - * that advertise the VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER capability. - * Calling this function for codecs that don't advertise this capability - * will result in an error code being returned, usually VPX_CODEC_ERROR. - * - * \note - * Currently this only works with VP9. - * @{ - */ - - /*!\brief Pass in external frame buffers for the decoder to use. - * - * Registers functions to be called when libvpx needs a frame buffer - * to decode the current frame and a function to be called when libvpx does - * not internally reference the frame buffer. This set function must - * be called before the first call to decode or libvpx will assume the - * default behavior of allocating frame buffers internally. - * - * \param[in] ctx Pointer to this instance's context - * \param[in] cb_get Pointer to the get callback function - * \param[in] cb_release Pointer to the release callback function - * \param[in] cb_priv Callback's private data - * - * \retval #VPX_CODEC_OK - * External frame buffers will be used by libvpx. - * \retval #VPX_CODEC_INVALID_PARAM - * One or more of the callbacks were NULL. - * \retval #VPX_CODEC_ERROR - * Decoder context not initialized, or algorithm not capable of - * using external frame buffers. - * - * \note - * When decoding VP9, the application may be required to pass in at least - * #VP9_MAXIMUM_REF_BUFFERS + #VPX_MAXIMUM_WORK_BUFFERS external frame - * buffers. - */ - vpx_codec_err_t vpx_codec_set_frame_buffer_functions( - vpx_codec_ctx_t *ctx, - vpx_get_frame_buffer_cb_fn_t cb_get, - vpx_release_frame_buffer_cb_fn_t cb_release, void *cb_priv); - - /*!@} - end defgroup cap_external_frame_buffer */ - - /*!@} - end defgroup decoder*/ -#ifdef __cplusplus -} -#endif -#endif // VPX_VPX_DECODER_H_ - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/vpx_encoder.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/vpx_encoder.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/vpx_encoder.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/vpx_encoder.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,1023 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef VPX_VPX_ENCODER_H_ -#define VPX_VPX_ENCODER_H_ - -/*!\defgroup encoder Encoder Algorithm Interface - * \ingroup codec - * This abstraction allows applications using this encoder to easily support - * multiple video formats with minimal code duplication. This section describes - * the interface common to all encoders. - * @{ - */ - -/*!\file - * \brief Describes the encoder algorithm interface to applications. - * - * This file describes the interface between an application and a - * video encoder algorithm. - * - */ -#ifdef __cplusplus -extern "C" { -#endif - -#include "./vpx_codec.h" - - /*! Temporal Scalability: Maximum length of the sequence defining frame - * layer membership - */ -#define VPX_TS_MAX_PERIODICITY 16 - - /*! Temporal Scalability: Maximum number of coding layers */ -#define VPX_TS_MAX_LAYERS 5 - - /*!\deprecated Use #VPX_TS_MAX_PERIODICITY instead. */ -#define MAX_PERIODICITY VPX_TS_MAX_PERIODICITY - - /*!\deprecated Use #VPX_TS_MAX_LAYERS instead. */ -#define MAX_LAYERS VPX_TS_MAX_LAYERS - -/*! Spatial Scalability: Maximum number of coding layers */ -#define VPX_SS_MAX_LAYERS 5 - -/*! Spatial Scalability: Default number of coding layers */ -#define VPX_SS_DEFAULT_LAYERS 1 - - /*!\brief Current ABI version number - * - * \internal - * If this file is altered in any way that changes the ABI, this value - * must be bumped. Examples include, but are not limited to, changing - * types, removing or reassigning enums, adding/removing/rearranging - * fields to structures - */ -#define VPX_ENCODER_ABI_VERSION (4 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer*/ - - - /*! \brief Encoder capabilities bitfield - * - * Each encoder advertises the capabilities it supports as part of its - * ::vpx_codec_iface_t interface structure. Capabilities are extra - * interfaces or functionality, and are not required to be supported - * by an encoder. - * - * The available flags are specified by VPX_CODEC_CAP_* defines. - */ -#define VPX_CODEC_CAP_PSNR 0x10000 /**< Can issue PSNR packets */ - - /*! Can output one partition at a time. Each partition is returned in its - * own VPX_CODEC_CX_FRAME_PKT, with the FRAME_IS_FRAGMENT flag set for - * every partition but the last. In this mode all frames are always - * returned partition by partition. - */ -#define VPX_CODEC_CAP_OUTPUT_PARTITION 0x20000 - -/*! Can support input images at greater than 8 bitdepth. - */ -#define VPX_CODEC_CAP_HIGHBITDEPTH 0x40000 - - /*! \brief Initialization-time Feature Enabling - * - * Certain codec features must be known at initialization time, to allow - * for proper memory allocation. - * - * The available flags are specified by VPX_CODEC_USE_* defines. - */ -#define VPX_CODEC_USE_PSNR 0x10000 /**< Calculate PSNR on each frame */ -#define VPX_CODEC_USE_OUTPUT_PARTITION 0x20000 /**< Make the encoder output one - partition at a time. */ -#define VPX_CODEC_USE_HIGHBITDEPTH 0x40000 /**< Use high bitdepth */ - - - /*!\brief Generic fixed size buffer structure - * - * This structure is able to hold a reference to any fixed size buffer. - */ - typedef struct vpx_fixed_buf { - void *buf; /**< Pointer to the data */ - size_t sz; /**< Length of the buffer, in chars */ - } vpx_fixed_buf_t; /**< alias for struct vpx_fixed_buf */ - - - /*!\brief Time Stamp Type - * - * An integer, which when multiplied by the stream's time base, provides - * the absolute time of a sample. - */ - typedef int64_t vpx_codec_pts_t; - - - /*!\brief Compressed Frame Flags - * - * This type represents a bitfield containing information about a compressed - * frame that may be useful to an application. The most significant 16 bits - * can be used by an algorithm to provide additional detail, for example to - * support frame types that are codec specific (MPEG-1 D-frames for example) - */ - typedef uint32_t vpx_codec_frame_flags_t; -#define VPX_FRAME_IS_KEY 0x1 /**< frame is the start of a GOP */ -#define VPX_FRAME_IS_DROPPABLE 0x2 /**< frame can be dropped without affecting - the stream (no future frame depends on - this one) */ -#define VPX_FRAME_IS_INVISIBLE 0x4 /**< frame should be decoded but will not - be shown */ -#define VPX_FRAME_IS_FRAGMENT 0x8 /**< this is a fragment of the encoded - frame */ - - /*!\brief Error Resilient flags - * - * These flags define which error resilient features to enable in the - * encoder. The flags are specified through the - * vpx_codec_enc_cfg::g_error_resilient variable. - */ - typedef uint32_t vpx_codec_er_flags_t; -#define VPX_ERROR_RESILIENT_DEFAULT 0x1 /**< Improve resiliency against - losses of whole frames */ -#define VPX_ERROR_RESILIENT_PARTITIONS 0x2 /**< The frame partitions are - independently decodable by the - bool decoder, meaning that - partitions can be decoded even - though earlier partitions have - been lost. Note that intra - predicition is still done over - the partition boundary. */ - - /*!\brief Encoder output packet variants - * - * This enumeration lists the different kinds of data packets that can be - * returned by calls to vpx_codec_get_cx_data(). Algorithms \ref MAY - * extend this list to provide additional functionality. - */ - enum vpx_codec_cx_pkt_kind { - VPX_CODEC_CX_FRAME_PKT, /**< Compressed video frame */ - VPX_CODEC_STATS_PKT, /**< Two-pass statistics for this frame */ - VPX_CODEC_FPMB_STATS_PKT, /**< first pass mb statistics for this frame */ - VPX_CODEC_PSNR_PKT, /**< PSNR statistics for this frame */ - // Spatial SVC is still experimental and may be removed before the next ABI - // bump. -#if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION) - VPX_CODEC_SPATIAL_SVC_LAYER_SIZES, /**< Sizes for each layer in this frame*/ - VPX_CODEC_SPATIAL_SVC_LAYER_PSNR, /**< PSNR for each layer in this frame*/ -#endif - VPX_CODEC_CUSTOM_PKT = 256 /**< Algorithm extensions */ - }; - - - /*!\brief Encoder output packet - * - * This structure contains the different kinds of output data the encoder - * may produce while compressing a frame. - */ - typedef struct vpx_codec_cx_pkt { - enum vpx_codec_cx_pkt_kind kind; /**< packet variant */ - union { - struct { - void *buf; /**< compressed data buffer */ - size_t sz; /**< length of compressed data */ - vpx_codec_pts_t pts; /**< time stamp to show frame - (in timebase units) */ - unsigned long duration; /**< duration to show frame - (in timebase units) */ - vpx_codec_frame_flags_t flags; /**< flags for this frame */ - int partition_id; /**< the partition id - defines the decoding order - of the partitions. Only - applicable when "output partition" - mode is enabled. First partition - has id 0.*/ - - } frame; /**< data for compressed frame packet */ - vpx_fixed_buf_t twopass_stats; /**< data for two-pass packet */ - vpx_fixed_buf_t firstpass_mb_stats; /**< first pass mb packet */ - struct vpx_psnr_pkt { - unsigned int samples[4]; /**< Number of samples, total/y/u/v */ - uint64_t sse[4]; /**< sum squared error, total/y/u/v */ - double psnr[4]; /**< PSNR, total/y/u/v */ - } psnr; /**< data for PSNR packet */ - vpx_fixed_buf_t raw; /**< data for arbitrary packets */ - // Spatial SVC is still experimental and may be removed before the next - // ABI bump. -#if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION) - size_t layer_sizes[VPX_SS_MAX_LAYERS]; - struct vpx_psnr_pkt layer_psnr[VPX_SS_MAX_LAYERS]; -#endif - - /* This packet size is fixed to allow codecs to extend this - * interface without having to manage storage for raw packets, - * i.e., if it's smaller than 128 bytes, you can store in the - * packet list directly. - */ - char pad[128 - sizeof(enum vpx_codec_cx_pkt_kind)]; /**< fixed sz */ - } data; /**< packet data */ - } vpx_codec_cx_pkt_t; /**< alias for struct vpx_codec_cx_pkt */ - - - /*!\brief Encoder return output buffer callback - * - * This callback function, when registered, returns with packets when each - * spatial layer is encoded. - */ - // putting the definitions here for now. (agrange: find if there - // is a better place for this) - typedef void (* vpx_codec_enc_output_cx_pkt_cb_fn_t)(vpx_codec_cx_pkt_t *pkt, - void *user_data); - - /*!\brief Callback function pointer / user data pair storage */ - typedef struct vpx_codec_enc_output_cx_cb_pair { - vpx_codec_enc_output_cx_pkt_cb_fn_t output_cx_pkt; /**< Callback function */ - void *user_priv; /**< Pointer to private data */ - } vpx_codec_priv_output_cx_pkt_cb_pair_t; - - /*!\brief Rational Number - * - * This structure holds a fractional value. - */ - typedef struct vpx_rational { - int num; /**< fraction numerator */ - int den; /**< fraction denominator */ - } vpx_rational_t; /**< alias for struct vpx_rational */ - - - /*!\brief Multi-pass Encoding Pass */ - enum vpx_enc_pass { - VPX_RC_ONE_PASS, /**< Single pass mode */ - VPX_RC_FIRST_PASS, /**< First pass of multi-pass mode */ - VPX_RC_LAST_PASS /**< Final pass of multi-pass mode */ - }; - - - /*!\brief Rate control mode */ - enum vpx_rc_mode { - VPX_VBR, /**< Variable Bit Rate (VBR) mode */ - VPX_CBR, /**< Constant Bit Rate (CBR) mode */ - VPX_CQ, /**< Constrained Quality (CQ) mode */ - VPX_Q, /**< Constant Quality (Q) mode */ - }; - - - /*!\brief Keyframe placement mode. - * - * This enumeration determines whether keyframes are placed automatically by - * the encoder or whether this behavior is disabled. Older releases of this - * SDK were implemented such that VPX_KF_FIXED meant keyframes were disabled. - * This name is confusing for this behavior, so the new symbols to be used - * are VPX_KF_AUTO and VPX_KF_DISABLED. - */ - enum vpx_kf_mode { - VPX_KF_FIXED, /**< deprecated, implies VPX_KF_DISABLED */ - VPX_KF_AUTO, /**< Encoder determines optimal placement automatically */ - VPX_KF_DISABLED = 0 /**< Encoder does not place keyframes. */ - }; - - - /*!\brief Encoded Frame Flags - * - * This type indicates a bitfield to be passed to vpx_codec_encode(), defining - * per-frame boolean values. By convention, bits common to all codecs will be - * named VPX_EFLAG_*, and bits specific to an algorithm will be named - * /algo/_eflag_*. The lower order 16 bits are reserved for common use. - */ - typedef long vpx_enc_frame_flags_t; -#define VPX_EFLAG_FORCE_KF (1<<0) /**< Force this frame to be a keyframe */ - - - /*!\brief Encoder configuration structure - * - * This structure contains the encoder settings that have common representations - * across all codecs. This doesn't imply that all codecs support all features, - * however. - */ - typedef struct vpx_codec_enc_cfg { - /* - * generic settings (g) - */ - - /*!\brief Algorithm specific "usage" value - * - * Algorithms may define multiple values for usage, which may convey the - * intent of how the application intends to use the stream. If this value - * is non-zero, consult the documentation for the codec to determine its - * meaning. - */ - unsigned int g_usage; - - - /*!\brief Maximum number of threads to use - * - * For multi-threaded implementations, use no more than this number of - * threads. The codec may use fewer threads than allowed. The value - * 0 is equivalent to the value 1. - */ - unsigned int g_threads; - - - /*!\brief Bitstream profile to use - * - * Some codecs support a notion of multiple bitstream profiles. Typically - * this maps to a set of features that are turned on or off. Often the - * profile to use is determined by the features of the intended decoder. - * Consult the documentation for the codec to determine the valid values - * for this parameter, or set to zero for a sane default. - */ - unsigned int g_profile; /**< profile of bitstream to use */ - - - - /*!\brief Width of the frame - * - * This value identifies the presentation resolution of the frame, - * in pixels. Note that the frames passed as input to the encoder must - * have this resolution. Frames will be presented by the decoder in this - * resolution, independent of any spatial resampling the encoder may do. - */ - unsigned int g_w; - - - /*!\brief Height of the frame - * - * This value identifies the presentation resolution of the frame, - * in pixels. Note that the frames passed as input to the encoder must - * have this resolution. Frames will be presented by the decoder in this - * resolution, independent of any spatial resampling the encoder may do. - */ - unsigned int g_h; - - /*!\brief Bit-depth of the codec - * - * This value identifies the bit_depth of the codec, - * Only certain bit-depths are supported as identified in the - * vpx_bit_depth_t enum. - */ - vpx_bit_depth_t g_bit_depth; - - /*!\brief Bit-depth of the input frames - * - * This value identifies the bit_depth of the input frames in bits. - * Note that the frames passed as input to the encoder must have - * this bit-depth. - */ - unsigned int g_input_bit_depth; - - /*!\brief Stream timebase units - * - * Indicates the smallest interval of time, in seconds, used by the stream. - * For fixed frame rate material, or variable frame rate material where - * frames are timed at a multiple of a given clock (ex: video capture), - * the \ref RECOMMENDED method is to set the timebase to the reciprocal - * of the frame rate (ex: 1001/30000 for 29.970 Hz NTSC). This allows the - * pts to correspond to the frame number, which can be handy. For - * re-encoding video from containers with absolute time timestamps, the - * \ref RECOMMENDED method is to set the timebase to that of the parent - * container or multimedia framework (ex: 1/1000 for ms, as in FLV). - */ - struct vpx_rational g_timebase; - - - /*!\brief Enable error resilient modes. - * - * The error resilient bitfield indicates to the encoder which features - * it should enable to take measures for streaming over lossy or noisy - * links. - */ - vpx_codec_er_flags_t g_error_resilient; - - - /*!\brief Multi-pass Encoding Mode - * - * This value should be set to the current phase for multi-pass encoding. - * For single pass, set to #VPX_RC_ONE_PASS. - */ - enum vpx_enc_pass g_pass; - - - /*!\brief Allow lagged encoding - * - * If set, this value allows the encoder to consume a number of input - * frames before producing output frames. This allows the encoder to - * base decisions for the current frame on future frames. This does - * increase the latency of the encoding pipeline, so it is not appropriate - * in all situations (ex: realtime encoding). - * - * Note that this is a maximum value -- the encoder may produce frames - * sooner than the given limit. Set this value to 0 to disable this - * feature. - */ - unsigned int g_lag_in_frames; - - - /* - * rate control settings (rc) - */ - - /*!\brief Temporal resampling configuration, if supported by the codec. - * - * Temporal resampling allows the codec to "drop" frames as a strategy to - * meet its target data rate. This can cause temporal discontinuities in - * the encoded video, which may appear as stuttering during playback. This - * trade-off is often acceptable, but for many applications is not. It can - * be disabled in these cases. - * - * Note that not all codecs support this feature. All vpx VPx codecs do. - * For other codecs, consult the documentation for that algorithm. - * - * This threshold is described as a percentage of the target data buffer. - * When the data buffer falls below this percentage of fullness, a - * dropped frame is indicated. Set the threshold to zero (0) to disable - * this feature. - */ - unsigned int rc_dropframe_thresh; - - - /*!\brief Enable/disable spatial resampling, if supported by the codec. - * - * Spatial resampling allows the codec to compress a lower resolution - * version of the frame, which is then upscaled by the encoder to the - * correct presentation resolution. This increases visual quality at - * low data rates, at the expense of CPU time on the encoder/decoder. - */ - unsigned int rc_resize_allowed; - - /*!\brief Internal coded frame width. - * - * If spatial resampling is enabled this specifies the width of the - * encoded frame. - */ - unsigned int rc_scaled_width; - - /*!\brief Internal coded frame height. - * - * If spatial resampling is enabled this specifies the height of the - * encoded frame. - */ - unsigned int rc_scaled_height; - - /*!\brief Spatial resampling up watermark. - * - * This threshold is described as a percentage of the target data buffer. - * When the data buffer rises above this percentage of fullness, the - * encoder will step up to a higher resolution version of the frame. - */ - unsigned int rc_resize_up_thresh; - - - /*!\brief Spatial resampling down watermark. - * - * This threshold is described as a percentage of the target data buffer. - * When the data buffer falls below this percentage of fullness, the - * encoder will step down to a lower resolution version of the frame. - */ - unsigned int rc_resize_down_thresh; - - - /*!\brief Rate control algorithm to use. - * - * Indicates whether the end usage of this stream is to be streamed over - * a bandwidth constrained link, indicating that Constant Bit Rate (CBR) - * mode should be used, or whether it will be played back on a high - * bandwidth link, as from a local disk, where higher variations in - * bitrate are acceptable. - */ - enum vpx_rc_mode rc_end_usage; - - - /*!\brief Two-pass stats buffer. - * - * A buffer containing all of the stats packets produced in the first - * pass, concatenated. - */ - vpx_fixed_buf_t rc_twopass_stats_in; - - /*!\brief first pass mb stats buffer. - * - * A buffer containing all of the first pass mb stats packets produced - * in the first pass, concatenated. - */ - vpx_fixed_buf_t rc_firstpass_mb_stats_in; - - /*!\brief Target data rate - * - * Target bandwidth to use for this stream, in kilobits per second. - */ - unsigned int rc_target_bitrate; - - - /* - * quantizer settings - */ - - - /*!\brief Minimum (Best Quality) Quantizer - * - * The quantizer is the most direct control over the quality of the - * encoded image. The range of valid values for the quantizer is codec - * specific. Consult the documentation for the codec to determine the - * values to use. To determine the range programmatically, call - * vpx_codec_enc_config_default() with a usage value of 0. - */ - unsigned int rc_min_quantizer; - - - /*!\brief Maximum (Worst Quality) Quantizer - * - * The quantizer is the most direct control over the quality of the - * encoded image. The range of valid values for the quantizer is codec - * specific. Consult the documentation for the codec to determine the - * values to use. To determine the range programmatically, call - * vpx_codec_enc_config_default() with a usage value of 0. - */ - unsigned int rc_max_quantizer; - - - /* - * bitrate tolerance - */ - - - /*!\brief Rate control adaptation undershoot control - * - * This value, expressed as a percentage of the target bitrate, - * controls the maximum allowed adaptation speed of the codec. - * This factor controls the maximum amount of bits that can - * be subtracted from the target bitrate in order to compensate - * for prior overshoot. - * - * Valid values in the range 0-1000. - */ - unsigned int rc_undershoot_pct; - - - /*!\brief Rate control adaptation overshoot control - * - * This value, expressed as a percentage of the target bitrate, - * controls the maximum allowed adaptation speed of the codec. - * This factor controls the maximum amount of bits that can - * be added to the target bitrate in order to compensate for - * prior undershoot. - * - * Valid values in the range 0-1000. - */ - unsigned int rc_overshoot_pct; - - - /* - * decoder buffer model parameters - */ - - - /*!\brief Decoder Buffer Size - * - * This value indicates the amount of data that may be buffered by the - * decoding application. Note that this value is expressed in units of - * time (milliseconds). For example, a value of 5000 indicates that the - * client will buffer (at least) 5000ms worth of encoded data. Use the - * target bitrate (#rc_target_bitrate) to convert to bits/bytes, if - * necessary. - */ - unsigned int rc_buf_sz; - - - /*!\brief Decoder Buffer Initial Size - * - * This value indicates the amount of data that will be buffered by the - * decoding application prior to beginning playback. This value is - * expressed in units of time (milliseconds). Use the target bitrate - * (#rc_target_bitrate) to convert to bits/bytes, if necessary. - */ - unsigned int rc_buf_initial_sz; - - - /*!\brief Decoder Buffer Optimal Size - * - * This value indicates the amount of data that the encoder should try - * to maintain in the decoder's buffer. This value is expressed in units - * of time (milliseconds). Use the target bitrate (#rc_target_bitrate) - * to convert to bits/bytes, if necessary. - */ - unsigned int rc_buf_optimal_sz; - - - /* - * 2 pass rate control parameters - */ - - - /*!\brief Two-pass mode CBR/VBR bias - * - * Bias, expressed on a scale of 0 to 100, for determining target size - * for the current frame. The value 0 indicates the optimal CBR mode - * value should be used. The value 100 indicates the optimal VBR mode - * value should be used. Values in between indicate which way the - * encoder should "lean." - */ - unsigned int rc_2pass_vbr_bias_pct; /**< RC mode bias between CBR and VBR(0-100: 0->CBR, 100->VBR) */ - - - /*!\brief Two-pass mode per-GOP minimum bitrate - * - * This value, expressed as a percentage of the target bitrate, indicates - * the minimum bitrate to be used for a single GOP (aka "section") - */ - unsigned int rc_2pass_vbr_minsection_pct; - - - /*!\brief Two-pass mode per-GOP maximum bitrate - * - * This value, expressed as a percentage of the target bitrate, indicates - * the maximum bitrate to be used for a single GOP (aka "section") - */ - unsigned int rc_2pass_vbr_maxsection_pct; - - - /* - * keyframing settings (kf) - */ - - /*!\brief Keyframe placement mode - * - * This value indicates whether the encoder should place keyframes at a - * fixed interval, or determine the optimal placement automatically - * (as governed by the #kf_min_dist and #kf_max_dist parameters) - */ - enum vpx_kf_mode kf_mode; - - - /*!\brief Keyframe minimum interval - * - * This value, expressed as a number of frames, prevents the encoder from - * placing a keyframe nearer than kf_min_dist to the previous keyframe. At - * least kf_min_dist frames non-keyframes will be coded before the next - * keyframe. Set kf_min_dist equal to kf_max_dist for a fixed interval. - */ - unsigned int kf_min_dist; - - - /*!\brief Keyframe maximum interval - * - * This value, expressed as a number of frames, forces the encoder to code - * a keyframe if one has not been coded in the last kf_max_dist frames. - * A value of 0 implies all frames will be keyframes. Set kf_min_dist - * equal to kf_max_dist for a fixed interval. - */ - unsigned int kf_max_dist; - - /* - * Spatial scalability settings (ss) - */ - - /*!\brief Number of spatial coding layers. - * - * This value specifies the number of spatial coding layers to be used. - */ - unsigned int ss_number_layers; - - /*!\brief Enable auto alt reference flags for each spatial layer. - * - * These values specify if auto alt reference frame is enabled for each - * spatial layer. - */ - int ss_enable_auto_alt_ref[VPX_SS_MAX_LAYERS]; - - /*!\brief Target bitrate for each spatial layer. - * - * These values specify the target coding bitrate to be used for each - * spatial layer. - */ - unsigned int ss_target_bitrate[VPX_SS_MAX_LAYERS]; - - /*!\brief Number of temporal coding layers. - * - * This value specifies the number of temporal layers to be used. - */ - unsigned int ts_number_layers; - - /*!\brief Target bitrate for each temporal layer. - * - * These values specify the target coding bitrate to be used for each - * temporal layer. - */ - unsigned int ts_target_bitrate[VPX_TS_MAX_LAYERS]; - - /*!\brief Frame rate decimation factor for each temporal layer. - * - * These values specify the frame rate decimation factors to apply - * to each temporal layer. - */ - unsigned int ts_rate_decimator[VPX_TS_MAX_LAYERS]; - - /*!\brief Length of the sequence defining frame temporal layer membership. - * - * This value specifies the length of the sequence that defines the - * membership of frames to temporal layers. For example, if the - * ts_periodicity = 8, then the frames are assigned to coding layers with a - * repeated sequence of length 8. - */ - unsigned int ts_periodicity; - - /*!\brief Template defining the membership of frames to temporal layers. - * - * This array defines the membership of frames to temporal coding layers. - * For a 2-layer encoding that assigns even numbered frames to one temporal - * layer (0) and odd numbered frames to a second temporal layer (1) with - * ts_periodicity=8, then ts_layer_id = (0,1,0,1,0,1,0,1). - */ - unsigned int ts_layer_id[VPX_TS_MAX_PERIODICITY]; - } vpx_codec_enc_cfg_t; /**< alias for struct vpx_codec_enc_cfg */ - - /*!\brief vp9 svc extra configure parameters - * - * This defines max/min quantizers and scale factors for each layer - * - */ - typedef struct vpx_svc_parameters { - int max_quantizers[VPX_SS_MAX_LAYERS]; /**< Max Q for each layer */ - int min_quantizers[VPX_SS_MAX_LAYERS]; /**< Min Q for each layer */ - int scaling_factor_num[VPX_SS_MAX_LAYERS]; /**< Scaling factor-numerator*/ - int scaling_factor_den[VPX_SS_MAX_LAYERS]; /**< Scaling factor-denominator*/ - } vpx_svc_extra_cfg_t; - - - /*!\brief Initialize an encoder instance - * - * Initializes a encoder context using the given interface. Applications - * should call the vpx_codec_enc_init convenience macro instead of this - * function directly, to ensure that the ABI version number parameter - * is properly initialized. - * - * If the library was configured with --disable-multithread, this call - * is not thread safe and should be guarded with a lock if being used - * in a multithreaded context. - * - * \param[in] ctx Pointer to this instance's context. - * \param[in] iface Pointer to the algorithm interface to use. - * \param[in] cfg Configuration to use, if known. May be NULL. - * \param[in] flags Bitfield of VPX_CODEC_USE_* flags - * \param[in] ver ABI version number. Must be set to - * VPX_ENCODER_ABI_VERSION - * \retval #VPX_CODEC_OK - * The decoder algorithm initialized. - * \retval #VPX_CODEC_MEM_ERROR - * Memory allocation failed. - */ - vpx_codec_err_t vpx_codec_enc_init_ver(vpx_codec_ctx_t *ctx, - vpx_codec_iface_t *iface, - const vpx_codec_enc_cfg_t *cfg, - vpx_codec_flags_t flags, - int ver); - - - /*!\brief Convenience macro for vpx_codec_enc_init_ver() - * - * Ensures the ABI version parameter is properly set. - */ -#define vpx_codec_enc_init(ctx, iface, cfg, flags) \ - vpx_codec_enc_init_ver(ctx, iface, cfg, flags, VPX_ENCODER_ABI_VERSION) - - - /*!\brief Initialize multi-encoder instance - * - * Initializes multi-encoder context using the given interface. - * Applications should call the vpx_codec_enc_init_multi convenience macro - * instead of this function directly, to ensure that the ABI version number - * parameter is properly initialized. - * - * \param[in] ctx Pointer to this instance's context. - * \param[in] iface Pointer to the algorithm interface to use. - * \param[in] cfg Configuration to use, if known. May be NULL. - * \param[in] num_enc Total number of encoders. - * \param[in] flags Bitfield of VPX_CODEC_USE_* flags - * \param[in] dsf Pointer to down-sampling factors. - * \param[in] ver ABI version number. Must be set to - * VPX_ENCODER_ABI_VERSION - * \retval #VPX_CODEC_OK - * The decoder algorithm initialized. - * \retval #VPX_CODEC_MEM_ERROR - * Memory allocation failed. - */ - vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx, - vpx_codec_iface_t *iface, - vpx_codec_enc_cfg_t *cfg, - int num_enc, - vpx_codec_flags_t flags, - vpx_rational_t *dsf, - int ver); - - - /*!\brief Convenience macro for vpx_codec_enc_init_multi_ver() - * - * Ensures the ABI version parameter is properly set. - */ -#define vpx_codec_enc_init_multi(ctx, iface, cfg, num_enc, flags, dsf) \ - vpx_codec_enc_init_multi_ver(ctx, iface, cfg, num_enc, flags, dsf, \ - VPX_ENCODER_ABI_VERSION) - - - /*!\brief Get a default configuration - * - * Initializes a encoder configuration structure with default values. Supports - * the notion of "usages" so that an algorithm may offer different default - * settings depending on the user's intended goal. This function \ref SHOULD - * be called by all applications to initialize the configuration structure - * before specializing the configuration with application specific values. - * - * \param[in] iface Pointer to the algorithm interface to use. - * \param[out] cfg Configuration buffer to populate. - * \param[in] reserved Must set to 0 for VP8 and VP9. - * - * \retval #VPX_CODEC_OK - * The configuration was populated. - * \retval #VPX_CODEC_INCAPABLE - * Interface is not an encoder interface. - * \retval #VPX_CODEC_INVALID_PARAM - * A parameter was NULL, or the usage value was not recognized. - */ - vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface, - vpx_codec_enc_cfg_t *cfg, - unsigned int reserved); - - - /*!\brief Set or change configuration - * - * Reconfigures an encoder instance according to the given configuration. - * - * \param[in] ctx Pointer to this instance's context - * \param[in] cfg Configuration buffer to use - * - * \retval #VPX_CODEC_OK - * The configuration was populated. - * \retval #VPX_CODEC_INCAPABLE - * Interface is not an encoder interface. - * \retval #VPX_CODEC_INVALID_PARAM - * A parameter was NULL, or the usage value was not recognized. - */ - vpx_codec_err_t vpx_codec_enc_config_set(vpx_codec_ctx_t *ctx, - const vpx_codec_enc_cfg_t *cfg); - - - /*!\brief Get global stream headers - * - * Retrieves a stream level global header packet, if supported by the codec. - * - * \param[in] ctx Pointer to this instance's context - * - * \retval NULL - * Encoder does not support global header - * \retval Non-NULL - * Pointer to buffer containing global header packet - */ - vpx_fixed_buf_t *vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx); - - -#define VPX_DL_REALTIME (1) /**< deadline parameter analogous to - * VPx REALTIME mode. */ -#define VPX_DL_GOOD_QUALITY (1000000) /**< deadline parameter analogous to - * VPx GOOD QUALITY mode. */ -#define VPX_DL_BEST_QUALITY (0) /**< deadline parameter analogous to - * VPx BEST QUALITY mode. */ - /*!\brief Encode a frame - * - * Encodes a video frame at the given "presentation time." The presentation - * time stamp (PTS) \ref MUST be strictly increasing. - * - * The encoder supports the notion of a soft real-time deadline. Given a - * non-zero value to the deadline parameter, the encoder will make a "best - * effort" guarantee to return before the given time slice expires. It is - * implicit that limiting the available time to encode will degrade the - * output quality. The encoder can be given an unlimited time to produce the - * best possible frame by specifying a deadline of '0'. This deadline - * supercedes the VPx notion of "best quality, good quality, realtime". - * Applications that wish to map these former settings to the new deadline - * based system can use the symbols #VPX_DL_REALTIME, #VPX_DL_GOOD_QUALITY, - * and #VPX_DL_BEST_QUALITY. - * - * When the last frame has been passed to the encoder, this function should - * continue to be called, with the img parameter set to NULL. This will - * signal the end-of-stream condition to the encoder and allow it to encode - * any held buffers. Encoding is complete when vpx_codec_encode() is called - * and vpx_codec_get_cx_data() returns no data. - * - * \param[in] ctx Pointer to this instance's context - * \param[in] img Image data to encode, NULL to flush. - * \param[in] pts Presentation time stamp, in timebase units. - * \param[in] duration Duration to show frame, in timebase units. - * \param[in] flags Flags to use for encoding this frame. - * \param[in] deadline Time to spend encoding, in microseconds. (0=infinite) - * - * \retval #VPX_CODEC_OK - * The configuration was populated. - * \retval #VPX_CODEC_INCAPABLE - * Interface is not an encoder interface. - * \retval #VPX_CODEC_INVALID_PARAM - * A parameter was NULL, the image format is unsupported, etc. - */ - vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx, - const vpx_image_t *img, - vpx_codec_pts_t pts, - unsigned long duration, - vpx_enc_frame_flags_t flags, - unsigned long deadline); - - /*!\brief Set compressed data output buffer - * - * Sets the buffer that the codec should output the compressed data - * into. This call effectively sets the buffer pointer returned in the - * next VPX_CODEC_CX_FRAME_PKT packet. Subsequent packets will be - * appended into this buffer. The buffer is preserved across frames, - * so applications must periodically call this function after flushing - * the accumulated compressed data to disk or to the network to reset - * the pointer to the buffer's head. - * - * `pad_before` bytes will be skipped before writing the compressed - * data, and `pad_after` bytes will be appended to the packet. The size - * of the packet will be the sum of the size of the actual compressed - * data, pad_before, and pad_after. The padding bytes will be preserved - * (not overwritten). - * - * Note that calling this function does not guarantee that the returned - * compressed data will be placed into the specified buffer. In the - * event that the encoded data will not fit into the buffer provided, - * the returned packet \ref MAY point to an internal buffer, as it would - * if this call were never used. In this event, the output packet will - * NOT have any padding, and the application must free space and copy it - * to the proper place. This is of particular note in configurations - * that may output multiple packets for a single encoded frame (e.g., lagged - * encoding) or if the application does not reset the buffer periodically. - * - * Applications may restore the default behavior of the codec providing - * the compressed data buffer by calling this function with a NULL - * buffer. - * - * Applications \ref MUSTNOT call this function during iteration of - * vpx_codec_get_cx_data(). - * - * \param[in] ctx Pointer to this instance's context - * \param[in] buf Buffer to store compressed data into - * \param[in] pad_before Bytes to skip before writing compressed data - * \param[in] pad_after Bytes to skip after writing compressed data - * - * \retval #VPX_CODEC_OK - * The buffer was set successfully. - * \retval #VPX_CODEC_INVALID_PARAM - * A parameter was NULL, the image format is unsupported, etc. - */ - vpx_codec_err_t vpx_codec_set_cx_data_buf(vpx_codec_ctx_t *ctx, - const vpx_fixed_buf_t *buf, - unsigned int pad_before, - unsigned int pad_after); - - - /*!\brief Encoded data iterator - * - * Iterates over a list of data packets to be passed from the encoder to the - * application. The different kinds of packets available are enumerated in - * #vpx_codec_cx_pkt_kind. - * - * #VPX_CODEC_CX_FRAME_PKT packets should be passed to the application's - * muxer. Multiple compressed frames may be in the list. - * #VPX_CODEC_STATS_PKT packets should be appended to a global buffer. - * - * The application \ref MUST silently ignore any packet kinds that it does - * not recognize or support. - * - * The data buffers returned from this function are only guaranteed to be - * valid until the application makes another call to any vpx_codec_* function. - * - * \param[in] ctx Pointer to this instance's context - * \param[in,out] iter Iterator storage, initialized to NULL - * - * \return Returns a pointer to an output data packet (compressed frame data, - * two-pass statistics, etc.) or NULL to signal end-of-list. - * - */ - const vpx_codec_cx_pkt_t *vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx, - vpx_codec_iter_t *iter); - - - /*!\brief Get Preview Frame - * - * Returns an image that can be used as a preview. Shows the image as it would - * exist at the decompressor. The application \ref MUST NOT write into this - * image buffer. - * - * \param[in] ctx Pointer to this instance's context - * - * \return Returns a pointer to a preview image, or NULL if no image is - * available. - * - */ - const vpx_image_t *vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx); - - - /*!@} - end defgroup encoder*/ -#ifdef __cplusplus -} -#endif -#endif // VPX_VPX_ENCODER_H_ - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/vpx_frame_buffer.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/vpx_frame_buffer.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/vpx_frame_buffer.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/vpx_frame_buffer.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VPX_VPX_FRAME_BUFFER_H_ -#define VPX_VPX_FRAME_BUFFER_H_ - -/*!\file - * \brief Describes the decoder external frame buffer interface. - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "./vpx_integer.h" - -/*!\brief The maximum number of work buffers used by libvpx. - * Support maximum 4 threads to decode video in parallel. - * Each thread will use one work buffer. - * TODO(hkuang): Add support to set number of worker threads dynamically. - */ -#define VPX_MAXIMUM_WORK_BUFFERS 8 - -/*!\brief The maximum number of reference buffers that a VP9 encoder may use. - */ -#define VP9_MAXIMUM_REF_BUFFERS 8 - -/*!\brief External frame buffer - * - * This structure holds allocated frame buffers used by the decoder. - */ -typedef struct vpx_codec_frame_buffer { - uint8_t *data; /**< Pointer to the data buffer */ - size_t size; /**< Size of data in bytes */ - void *priv; /**< Frame's private data */ -} vpx_codec_frame_buffer_t; - -/*!\brief get frame buffer callback prototype - * - * This callback is invoked by the decoder to retrieve data for the frame - * buffer in order for the decode call to complete. The callback must - * allocate at least min_size in bytes and assign it to fb->data. The callback - * must zero out all the data allocated. Then the callback must set fb->size - * to the allocated size. The application does not need to align the allocated - * data. The callback is triggered when the decoder needs a frame buffer to - * decode a compressed image into. This function may be called more than once - * for every call to vpx_codec_decode. The application may set fb->priv to - * some data which will be passed back in the ximage and the release function - * call. |fb| is guaranteed to not be NULL. On success the callback must - * return 0. Any failure the callback must return a value less than 0. - * - * \param[in] priv Callback's private data - * \param[in] new_size Size in bytes needed by the buffer - * \param[in,out] fb Pointer to vpx_codec_frame_buffer_t - */ -typedef int (*vpx_get_frame_buffer_cb_fn_t)( - void *priv, size_t min_size, vpx_codec_frame_buffer_t *fb); - -/*!\brief release frame buffer callback prototype - * - * This callback is invoked by the decoder when the frame buffer is not - * referenced by any other buffers. |fb| is guaranteed to not be NULL. On - * success the callback must return 0. Any failure the callback must return - * a value less than 0. - * - * \param[in] priv Callback's private data - * \param[in] fb Pointer to vpx_codec_frame_buffer_t - */ -typedef int (*vpx_release_frame_buffer_cb_fn_t)( - void *priv, vpx_codec_frame_buffer_t *fb); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VPX_VPX_FRAME_BUFFER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/vpx_image.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/vpx_image.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/vpx_image.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/vpx_image.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,224 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/*!\file - * \brief Describes the vpx image descriptor and associated operations - * - */ -#ifndef VPX_VPX_IMAGE_H_ -#define VPX_VPX_IMAGE_H_ - -#ifdef __cplusplus -extern "C" { -#endif - - /*!\brief Current ABI version number - * - * \internal - * If this file is altered in any way that changes the ABI, this value - * must be bumped. Examples include, but are not limited to, changing - * types, removing or reassigning enums, adding/removing/rearranging - * fields to structures - */ -#define VPX_IMAGE_ABI_VERSION (3) /**<\hideinitializer*/ - - -#define VPX_IMG_FMT_PLANAR 0x100 /**< Image is a planar format. */ -#define VPX_IMG_FMT_UV_FLIP 0x200 /**< V plane precedes U in memory. */ -#define VPX_IMG_FMT_HAS_ALPHA 0x400 /**< Image has an alpha channel. */ -#define VPX_IMG_FMT_HIGHBITDEPTH 0x800 /**< Image uses 16bit framebuffer. */ - - /*!\brief List of supported image formats */ - typedef enum vpx_img_fmt { - VPX_IMG_FMT_NONE, - VPX_IMG_FMT_RGB24, /**< 24 bit per pixel packed RGB */ - VPX_IMG_FMT_RGB32, /**< 32 bit per pixel packed 0RGB */ - VPX_IMG_FMT_RGB565, /**< 16 bit per pixel, 565 */ - VPX_IMG_FMT_RGB555, /**< 16 bit per pixel, 555 */ - VPX_IMG_FMT_UYVY, /**< UYVY packed YUV */ - VPX_IMG_FMT_YUY2, /**< YUYV packed YUV */ - VPX_IMG_FMT_YVYU, /**< YVYU packed YUV */ - VPX_IMG_FMT_BGR24, /**< 24 bit per pixel packed BGR */ - VPX_IMG_FMT_RGB32_LE, /**< 32 bit packed BGR0 */ - VPX_IMG_FMT_ARGB, /**< 32 bit packed ARGB, alpha=255 */ - VPX_IMG_FMT_ARGB_LE, /**< 32 bit packed BGRA, alpha=255 */ - VPX_IMG_FMT_RGB565_LE, /**< 16 bit per pixel, gggbbbbb rrrrrggg */ - VPX_IMG_FMT_RGB555_LE, /**< 16 bit per pixel, gggbbbbb 0rrrrrgg */ - VPX_IMG_FMT_YV12 = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_UV_FLIP | 1, /**< planar YVU */ - VPX_IMG_FMT_I420 = VPX_IMG_FMT_PLANAR | 2, - VPX_IMG_FMT_VPXYV12 = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_UV_FLIP | 3, /** < planar 4:2:0 format with vpx color space */ - VPX_IMG_FMT_VPXI420 = VPX_IMG_FMT_PLANAR | 4, - VPX_IMG_FMT_I422 = VPX_IMG_FMT_PLANAR | 5, - VPX_IMG_FMT_I444 = VPX_IMG_FMT_PLANAR | 6, - VPX_IMG_FMT_I440 = VPX_IMG_FMT_PLANAR | 7, - VPX_IMG_FMT_444A = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_HAS_ALPHA | 6, - VPX_IMG_FMT_I42016 = VPX_IMG_FMT_I420 | VPX_IMG_FMT_HIGHBITDEPTH, - VPX_IMG_FMT_I42216 = VPX_IMG_FMT_I422 | VPX_IMG_FMT_HIGHBITDEPTH, - VPX_IMG_FMT_I44416 = VPX_IMG_FMT_I444 | VPX_IMG_FMT_HIGHBITDEPTH, - VPX_IMG_FMT_I44016 = VPX_IMG_FMT_I440 | VPX_IMG_FMT_HIGHBITDEPTH - } vpx_img_fmt_t; /**< alias for enum vpx_img_fmt */ - - /*!\brief List of supported color spaces */ - typedef enum vpx_color_space { - VPX_CS_UNKNOWN = 0, /**< Unknown */ - VPX_CS_BT_601 = 1, /**< BT.601 */ - VPX_CS_BT_709 = 2, /**< BT.709 */ - VPX_CS_SMPTE_170 = 3, /**< SMPTE.170 */ - VPX_CS_SMPTE_240 = 4, /**< SMPTE.240 */ - VPX_CS_BT_2020 = 5, /**< BT.2020 */ - VPX_CS_RESERVED = 6, /**< Reserved */ - VPX_CS_SRGB = 7 /**< sRGB */ - } vpx_color_space_t; /**< alias for enum vpx_color_space */ - - /**\brief Image Descriptor */ - typedef struct vpx_image { - vpx_img_fmt_t fmt; /**< Image Format */ - vpx_color_space_t cs; /**< Color Space */ - - /* Image storage dimensions */ - unsigned int w; /**< Stored image width */ - unsigned int h; /**< Stored image height */ - unsigned int bit_depth; /**< Stored image bit-depth */ - - /* Image display dimensions */ - unsigned int d_w; /**< Displayed image width */ - unsigned int d_h; /**< Displayed image height */ - - /* Chroma subsampling info */ - unsigned int x_chroma_shift; /**< subsampling order, X */ - unsigned int y_chroma_shift; /**< subsampling order, Y */ - - /* Image data pointers. */ -#define VPX_PLANE_PACKED 0 /**< To be used for all packed formats */ -#define VPX_PLANE_Y 0 /**< Y (Luminance) plane */ -#define VPX_PLANE_U 1 /**< U (Chroma) plane */ -#define VPX_PLANE_V 2 /**< V (Chroma) plane */ -#define VPX_PLANE_ALPHA 3 /**< A (Transparency) plane */ - unsigned char *planes[4]; /**< pointer to the top left pixel for each plane */ - int stride[4]; /**< stride between rows for each plane */ - - int bps; /**< bits per sample (for packed formats) */ - - /* The following member may be set by the application to associate data - * with this image. - */ - void *user_priv; /**< may be set by the application to associate data - * with this image. */ - - /* The following members should be treated as private. */ - unsigned char *img_data; /**< private */ - int img_data_owner; /**< private */ - int self_allocd; /**< private */ - - void *fb_priv; /**< Frame buffer data associated with the image. */ - } vpx_image_t; /**< alias for struct vpx_image */ - - /**\brief Representation of a rectangle on a surface */ - typedef struct vpx_image_rect { - unsigned int x; /**< leftmost column */ - unsigned int y; /**< topmost row */ - unsigned int w; /**< width */ - unsigned int h; /**< height */ - } vpx_image_rect_t; /**< alias for struct vpx_image_rect */ - - /*!\brief Open a descriptor, allocating storage for the underlying image - * - * Returns a descriptor for storing an image of the given format. The - * storage for the descriptor is allocated on the heap. - * - * \param[in] img Pointer to storage for descriptor. If this parameter - * is NULL, the storage for the descriptor will be - * allocated on the heap. - * \param[in] fmt Format for the image - * \param[in] d_w Width of the image - * \param[in] d_h Height of the image - * \param[in] align Alignment, in bytes, of the image buffer and - * each row in the image(stride). - * - * \return Returns a pointer to the initialized image descriptor. If the img - * parameter is non-null, the value of the img parameter will be - * returned. - */ - vpx_image_t *vpx_img_alloc(vpx_image_t *img, - vpx_img_fmt_t fmt, - unsigned int d_w, - unsigned int d_h, - unsigned int align); - - /*!\brief Open a descriptor, using existing storage for the underlying image - * - * Returns a descriptor for storing an image of the given format. The - * storage for descriptor has been allocated elsewhere, and a descriptor is - * desired to "wrap" that storage. - * - * \param[in] img Pointer to storage for descriptor. If this parameter - * is NULL, the storage for the descriptor will be - * allocated on the heap. - * \param[in] fmt Format for the image - * \param[in] d_w Width of the image - * \param[in] d_h Height of the image - * \param[in] align Alignment, in bytes, of each row in the image. - * \param[in] img_data Storage to use for the image - * - * \return Returns a pointer to the initialized image descriptor. If the img - * parameter is non-null, the value of the img parameter will be - * returned. - */ - vpx_image_t *vpx_img_wrap(vpx_image_t *img, - vpx_img_fmt_t fmt, - unsigned int d_w, - unsigned int d_h, - unsigned int align, - unsigned char *img_data); - - - /*!\brief Set the rectangle identifying the displayed portion of the image - * - * Updates the displayed rectangle (aka viewport) on the image surface to - * match the specified coordinates and size. - * - * \param[in] img Image descriptor - * \param[in] x leftmost column - * \param[in] y topmost row - * \param[in] w width - * \param[in] h height - * - * \return 0 if the requested rectangle is valid, nonzero otherwise. - */ - int vpx_img_set_rect(vpx_image_t *img, - unsigned int x, - unsigned int y, - unsigned int w, - unsigned int h); - - - /*!\brief Flip the image vertically (top for bottom) - * - * Adjusts the image descriptor's pointers and strides to make the image - * be referenced upside-down. - * - * \param[in] img Image descriptor - */ - void vpx_img_flip(vpx_image_t *img); - - /*!\brief Close an image descriptor - * - * Frees all allocated storage associated with an image descriptor. - * - * \param[in] img Image descriptor - */ - void vpx_img_free(vpx_image_t *img); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VPX_VPX_IMAGE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/vpx_integer.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/vpx_integer.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx/vpx_integer.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx/vpx_integer.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VPX_VPX_INTEGER_H_ -#define VPX_VPX_INTEGER_H_ - -/* get ptrdiff_t, size_t, wchar_t, NULL */ -#include - -#if defined(_MSC_VER) -#define VPX_FORCE_INLINE __forceinline -#define VPX_INLINE __inline -#else -#define VPX_FORCE_INLINE __inline__ __attribute__(always_inline) -// TODO(jbb): Allow a way to force inline off for older compilers. -#define VPX_INLINE inline -#endif - -#if (defined(_MSC_VER) && (_MSC_VER < 1600)) || defined(VPX_EMULATE_INTTYPES) -typedef signed char int8_t; -typedef signed short int16_t; -typedef signed int int32_t; - -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; - -#if (defined(_MSC_VER) && (_MSC_VER < 1600)) -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; -#define INT64_MAX _I64_MAX -#define INT32_MAX _I32_MAX -#define INT32_MIN _I32_MIN -#define INT16_MAX _I16_MAX -#define INT16_MIN _I16_MIN -#endif - -#ifndef _UINTPTR_T_DEFINED -typedef size_t uintptr_t; -#endif - -#else - -/* Most platforms have the C99 standard integer types. */ - -#if defined(__cplusplus) -# if !defined(__STDC_FORMAT_MACROS) -# define __STDC_FORMAT_MACROS -# endif -# if !defined(__STDC_LIMIT_MACROS) -# define __STDC_LIMIT_MACROS -# endif -#endif // __cplusplus - -#include - -#endif - -/* VS2010 defines stdint.h, but not inttypes.h */ -#if defined(_MSC_VER) && _MSC_VER < 1800 -#define PRId64 "I64d" -#else -#include -#endif - -#endif // VPX_VPX_INTEGER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpxdec.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpxdec.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpxdec.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpxdec.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1157 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include -#include -#include -#include - -#include "./vpx_config.h" - -#if CONFIG_LIBYUV -#include "third_party/libyuv/include/libyuv/scale.h" -#endif - -#include "./args.h" -#include "./ivfdec.h" - -#include "vpx/vpx_decoder.h" -#include "vpx_ports/mem_ops.h" -#include "vpx_ports/vpx_timer.h" - -#if CONFIG_VP8_DECODER || CONFIG_VP9_DECODER -#include "vpx/vp8dx.h" -#endif - -#include "./md5_utils.h" - -#include "./tools_common.h" -#if CONFIG_WEBM_IO -#include "./webmdec.h" -#endif -#include "./y4menc.h" - -static const char *exec_name; - -struct VpxDecInputContext { - struct VpxInputContext *vpx_input_ctx; - struct WebmInputContext *webm_ctx; -}; - -static const arg_def_t looparg = ARG_DEF( - NULL, "loops", 1, "Number of times to decode the file"); -static const arg_def_t codecarg = ARG_DEF( - NULL, "codec", 1, "Codec to use"); -static const arg_def_t use_yv12 = ARG_DEF( - NULL, "yv12", 0, "Output raw YV12 frames"); -static const arg_def_t use_i420 = ARG_DEF( - NULL, "i420", 0, "Output raw I420 frames"); -static const arg_def_t flipuvarg = ARG_DEF( - NULL, "flipuv", 0, "Flip the chroma planes in the output"); -static const arg_def_t rawvideo = ARG_DEF( - NULL, "rawvideo", 0, "Output raw YUV frames"); -static const arg_def_t noblitarg = ARG_DEF( - NULL, "noblit", 0, "Don't process the decoded frames"); -static const arg_def_t progressarg = ARG_DEF( - NULL, "progress", 0, "Show progress after each frame decodes"); -static const arg_def_t limitarg = ARG_DEF( - NULL, "limit", 1, "Stop decoding after n frames"); -static const arg_def_t skiparg = ARG_DEF( - NULL, "skip", 1, "Skip the first n input frames"); -static const arg_def_t postprocarg = ARG_DEF( - NULL, "postproc", 0, "Postprocess decoded frames"); -static const arg_def_t summaryarg = ARG_DEF( - NULL, "summary", 0, "Show timing summary"); -static const arg_def_t outputfile = ARG_DEF( - "o", "output", 1, "Output file name pattern (see below)"); -static const arg_def_t threadsarg = ARG_DEF( - "t", "threads", 1, "Max threads to use"); -static const arg_def_t frameparallelarg = ARG_DEF( - NULL, "frame-parallel", 0, "Frame parallel decode"); -static const arg_def_t verbosearg = ARG_DEF( - "v", "verbose", 0, "Show version string"); -static const arg_def_t error_concealment = ARG_DEF( - NULL, "error-concealment", 0, "Enable decoder error-concealment"); -static const arg_def_t scalearg = ARG_DEF( - "S", "scale", 0, "Scale output frames uniformly"); -static const arg_def_t continuearg = ARG_DEF( - "k", "keep-going", 0, "(debug) Continue decoding after error"); -static const arg_def_t fb_arg = ARG_DEF( - NULL, "frame-buffers", 1, "Number of frame buffers to use"); -static const arg_def_t md5arg = ARG_DEF( - NULL, "md5", 0, "Compute the MD5 sum of the decoded frame"); -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH -static const arg_def_t outbitdeptharg = ARG_DEF( - NULL, "output-bit-depth", 1, "Output bit-depth for decoded frames"); -#endif - -static const arg_def_t *all_args[] = { - &codecarg, &use_yv12, &use_i420, &flipuvarg, &rawvideo, &noblitarg, - &progressarg, &limitarg, &skiparg, &postprocarg, &summaryarg, &outputfile, - &threadsarg, &frameparallelarg, &verbosearg, &scalearg, &fb_arg, - &md5arg, &error_concealment, &continuearg, -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - &outbitdeptharg, -#endif - NULL -}; - -#if CONFIG_VP8_DECODER -static const arg_def_t addnoise_level = ARG_DEF(NULL, "noise-level", 1, - "Enable VP8 postproc add noise"); -static const arg_def_t deblock = ARG_DEF(NULL, "deblock", 0, - "Enable VP8 deblocking"); -static const arg_def_t demacroblock_level = ARG_DEF(NULL, "demacroblock-level", 1, - "Enable VP8 demacroblocking, w/ level"); -static const arg_def_t pp_debug_info = ARG_DEF(NULL, "pp-debug-info", 1, - "Enable VP8 visible debug info"); -static const arg_def_t pp_disp_ref_frame = ARG_DEF(NULL, "pp-dbg-ref-frame", 1, - "Display only selected reference frame per macro block"); -static const arg_def_t pp_disp_mb_modes = ARG_DEF(NULL, "pp-dbg-mb-modes", 1, - "Display only selected macro block modes"); -static const arg_def_t pp_disp_b_modes = ARG_DEF(NULL, "pp-dbg-b-modes", 1, - "Display only selected block modes"); -static const arg_def_t pp_disp_mvs = ARG_DEF(NULL, "pp-dbg-mvs", 1, - "Draw only selected motion vectors"); -static const arg_def_t mfqe = ARG_DEF(NULL, "mfqe", 0, - "Enable multiframe quality enhancement"); - -static const arg_def_t *vp8_pp_args[] = { - &addnoise_level, &deblock, &demacroblock_level, &pp_debug_info, - &pp_disp_ref_frame, &pp_disp_mb_modes, &pp_disp_b_modes, &pp_disp_mvs, &mfqe, - NULL -}; -#endif - -#if CONFIG_LIBYUV -static INLINE int libyuv_scale(vpx_image_t *src, vpx_image_t *dst, - FilterModeEnum mode) { -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - if (src->fmt == VPX_IMG_FMT_I42016) { - assert(dst->fmt == VPX_IMG_FMT_I42016); - return I420Scale_16((uint16_t*)src->planes[VPX_PLANE_Y], - src->stride[VPX_PLANE_Y]/2, - (uint16_t*)src->planes[VPX_PLANE_U], - src->stride[VPX_PLANE_U]/2, - (uint16_t*)src->planes[VPX_PLANE_V], - src->stride[VPX_PLANE_V]/2, - src->d_w, src->d_h, - (uint16_t*)dst->planes[VPX_PLANE_Y], - dst->stride[VPX_PLANE_Y]/2, - (uint16_t*)dst->planes[VPX_PLANE_U], - dst->stride[VPX_PLANE_U]/2, - (uint16_t*)dst->planes[VPX_PLANE_V], - dst->stride[VPX_PLANE_V]/2, - dst->d_w, dst->d_h, - mode); - } -#endif - assert(src->fmt == VPX_IMG_FMT_I420); - assert(dst->fmt == VPX_IMG_FMT_I420); - return I420Scale(src->planes[VPX_PLANE_Y], src->stride[VPX_PLANE_Y], - src->planes[VPX_PLANE_U], src->stride[VPX_PLANE_U], - src->planes[VPX_PLANE_V], src->stride[VPX_PLANE_V], - src->d_w, src->d_h, - dst->planes[VPX_PLANE_Y], dst->stride[VPX_PLANE_Y], - dst->planes[VPX_PLANE_U], dst->stride[VPX_PLANE_U], - dst->planes[VPX_PLANE_V], dst->stride[VPX_PLANE_V], - dst->d_w, dst->d_h, - mode); -} -#endif - -void usage_exit() { - int i; - - fprintf(stderr, "Usage: %s filename\n\n" - "Options:\n", exec_name); - arg_show_usage(stderr, all_args); -#if CONFIG_VP8_DECODER - fprintf(stderr, "\nVP8 Postprocessing Options:\n"); - arg_show_usage(stderr, vp8_pp_args); -#endif - fprintf(stderr, - "\nOutput File Patterns:\n\n" - " The -o argument specifies the name of the file(s) to " - "write to. If the\n argument does not include any escape " - "characters, the output will be\n written to a single file. " - "Otherwise, the filename will be calculated by\n expanding " - "the following escape characters:\n"); - fprintf(stderr, - "\n\t%%w - Frame width" - "\n\t%%h - Frame height" - "\n\t%% - Frame number, zero padded to places (1..9)" - "\n\n Pattern arguments are only supported in conjunction " - "with the --yv12 and\n --i420 options. If the -o option is " - "not specified, the output will be\n directed to stdout.\n" - ); - fprintf(stderr, "\nIncluded decoders:\n\n"); - - for (i = 0; i < get_vpx_decoder_count(); ++i) { - const VpxInterface *const decoder = get_vpx_decoder_by_index(i); - fprintf(stderr, " %-6s - %s\n", - decoder->name, vpx_codec_iface_name(decoder->codec_interface())); - } - - exit(EXIT_FAILURE); -} - -static int raw_read_frame(FILE *infile, uint8_t **buffer, - size_t *bytes_read, size_t *buffer_size) { - char raw_hdr[RAW_FRAME_HDR_SZ]; - size_t frame_size = 0; - - if (fread(raw_hdr, RAW_FRAME_HDR_SZ, 1, infile) != 1) { - if (!feof(infile)) - warn("Failed to read RAW frame size\n"); - } else { - const size_t kCorruptFrameThreshold = 256 * 1024 * 1024; - const size_t kFrameTooSmallThreshold = 256 * 1024; - frame_size = mem_get_le32(raw_hdr); - - if (frame_size > kCorruptFrameThreshold) { - warn("Read invalid frame size (%u)\n", (unsigned int)frame_size); - frame_size = 0; - } - - if (frame_size < kFrameTooSmallThreshold) { - warn("Warning: Read invalid frame size (%u) - not a raw file?\n", - (unsigned int)frame_size); - } - - if (frame_size > *buffer_size) { - uint8_t *new_buf = realloc(*buffer, 2 * frame_size); - if (new_buf) { - *buffer = new_buf; - *buffer_size = 2 * frame_size; - } else { - warn("Failed to allocate compressed data buffer\n"); - frame_size = 0; - } - } - } - - if (!feof(infile)) { - if (fread(*buffer, 1, frame_size, infile) != frame_size) { - warn("Failed to read full frame\n"); - return 1; - } - *bytes_read = frame_size; - } - - return 0; -} - -static int read_frame(struct VpxDecInputContext *input, uint8_t **buf, - size_t *bytes_in_buffer, size_t *buffer_size) { - switch (input->vpx_input_ctx->file_type) { -#if CONFIG_WEBM_IO - case FILE_TYPE_WEBM: - return webm_read_frame(input->webm_ctx, - buf, bytes_in_buffer, buffer_size); -#endif - case FILE_TYPE_RAW: - return raw_read_frame(input->vpx_input_ctx->file, - buf, bytes_in_buffer, buffer_size); - case FILE_TYPE_IVF: - return ivf_read_frame(input->vpx_input_ctx->file, - buf, bytes_in_buffer, buffer_size); - default: - return 1; - } -} - -static void update_image_md5(const vpx_image_t *img, const int planes[3], - MD5Context *md5) { - int i, y; - - for (i = 0; i < 3; ++i) { - const int plane = planes[i]; - const unsigned char *buf = img->planes[plane]; - const int stride = img->stride[plane]; - const int w = vpx_img_plane_width(img, plane) * - ((img->fmt & VPX_IMG_FMT_HIGHBITDEPTH) ? 2 : 1); - const int h = vpx_img_plane_height(img, plane); - - for (y = 0; y < h; ++y) { - MD5Update(md5, buf, w); - buf += stride; - } - } -} - -static void write_image_file(const vpx_image_t *img, const int planes[3], - FILE *file) { - int i, y; -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - const int bytes_per_sample = ((img->fmt & VPX_IMG_FMT_HIGHBITDEPTH) ? 2 : 1); -#else - const int bytes_per_sample = 1; -#endif - - for (i = 0; i < 3; ++i) { - const int plane = planes[i]; - const unsigned char *buf = img->planes[plane]; - const int stride = img->stride[plane]; - const int w = vpx_img_plane_width(img, plane); - const int h = vpx_img_plane_height(img, plane); - - for (y = 0; y < h; ++y) { - fwrite(buf, bytes_per_sample, w, file); - buf += stride; - } - } -} - -int file_is_raw(struct VpxInputContext *input) { - uint8_t buf[32]; - int is_raw = 0; - vpx_codec_stream_info_t si; - - si.sz = sizeof(si); - - if (fread(buf, 1, 32, input->file) == 32) { - int i; - - if (mem_get_le32(buf) < 256 * 1024 * 1024) { - for (i = 0; i < get_vpx_decoder_count(); ++i) { - const VpxInterface *const decoder = get_vpx_decoder_by_index(i); - if (!vpx_codec_peek_stream_info(decoder->codec_interface(), - buf + 4, 32 - 4, &si)) { - is_raw = 1; - input->fourcc = decoder->fourcc; - input->width = si.w; - input->height = si.h; - input->framerate.numerator = 30; - input->framerate.denominator = 1; - break; - } - } - } - } - - rewind(input->file); - return is_raw; -} - -void show_progress(int frame_in, int frame_out, uint64_t dx_time) { - fprintf(stderr, - "%d decoded frames/%d showed frames in %"PRId64" us (%.2f fps)\r", - frame_in, frame_out, dx_time, - (double)frame_out * 1000000.0 / (double)dx_time); -} - -struct ExternalFrameBuffer { - uint8_t* data; - size_t size; - int in_use; -}; - -struct ExternalFrameBufferList { - int num_external_frame_buffers; - struct ExternalFrameBuffer *ext_fb; -}; - -// Callback used by libvpx to request an external frame buffer. |cb_priv| -// Application private data passed into the set function. |min_size| is the -// minimum size in bytes needed to decode the next frame. |fb| pointer to the -// frame buffer. -int get_vp9_frame_buffer(void *cb_priv, size_t min_size, - vpx_codec_frame_buffer_t *fb) { - int i; - struct ExternalFrameBufferList *const ext_fb_list = - (struct ExternalFrameBufferList *)cb_priv; - if (ext_fb_list == NULL) - return -1; - - // Find a free frame buffer. - for (i = 0; i < ext_fb_list->num_external_frame_buffers; ++i) { - if (!ext_fb_list->ext_fb[i].in_use) - break; - } - - if (i == ext_fb_list->num_external_frame_buffers) - return -1; - - if (ext_fb_list->ext_fb[i].size < min_size) { - free(ext_fb_list->ext_fb[i].data); - ext_fb_list->ext_fb[i].data = (uint8_t *)calloc(min_size, sizeof(uint8_t)); - if (!ext_fb_list->ext_fb[i].data) - return -1; - - ext_fb_list->ext_fb[i].size = min_size; - } - - fb->data = ext_fb_list->ext_fb[i].data; - fb->size = ext_fb_list->ext_fb[i].size; - ext_fb_list->ext_fb[i].in_use = 1; - - // Set the frame buffer's private data to point at the external frame buffer. - fb->priv = &ext_fb_list->ext_fb[i]; - return 0; -} - -// Callback used by libvpx when there are no references to the frame buffer. -// |cb_priv| user private data passed into the set function. |fb| pointer -// to the frame buffer. -int release_vp9_frame_buffer(void *cb_priv, - vpx_codec_frame_buffer_t *fb) { - struct ExternalFrameBuffer *const ext_fb = - (struct ExternalFrameBuffer *)fb->priv; - (void)cb_priv; - ext_fb->in_use = 0; - return 0; -} - -void generate_filename(const char *pattern, char *out, size_t q_len, - unsigned int d_w, unsigned int d_h, - unsigned int frame_in) { - const char *p = pattern; - char *q = out; - - do { - char *next_pat = strchr(p, '%'); - - if (p == next_pat) { - size_t pat_len; - - /* parse the pattern */ - q[q_len - 1] = '\0'; - switch (p[1]) { - case 'w': - snprintf(q, q_len - 1, "%d", d_w); - break; - case 'h': - snprintf(q, q_len - 1, "%d", d_h); - break; - case '1': - snprintf(q, q_len - 1, "%d", frame_in); - break; - case '2': - snprintf(q, q_len - 1, "%02d", frame_in); - break; - case '3': - snprintf(q, q_len - 1, "%03d", frame_in); - break; - case '4': - snprintf(q, q_len - 1, "%04d", frame_in); - break; - case '5': - snprintf(q, q_len - 1, "%05d", frame_in); - break; - case '6': - snprintf(q, q_len - 1, "%06d", frame_in); - break; - case '7': - snprintf(q, q_len - 1, "%07d", frame_in); - break; - case '8': - snprintf(q, q_len - 1, "%08d", frame_in); - break; - case '9': - snprintf(q, q_len - 1, "%09d", frame_in); - break; - default: - die("Unrecognized pattern %%%c\n", p[1]); - break; - } - - pat_len = strlen(q); - if (pat_len >= q_len - 1) - die("Output filename too long.\n"); - q += pat_len; - p += 2; - q_len -= pat_len; - } else { - size_t copy_len; - - /* copy the next segment */ - if (!next_pat) - copy_len = strlen(p); - else - copy_len = next_pat - p; - - if (copy_len >= q_len - 1) - die("Output filename too long.\n"); - - memcpy(q, p, copy_len); - q[copy_len] = '\0'; - q += copy_len; - p += copy_len; - q_len -= copy_len; - } - } while (*p); -} - -static int is_single_file(const char *outfile_pattern) { - const char *p = outfile_pattern; - - do { - p = strchr(p, '%'); - if (p && p[1] >= '1' && p[1] <= '9') - return 0; // pattern contains sequence number, so it's not unique - if (p) - p++; - } while (p); - - return 1; -} - -static void print_md5(unsigned char digest[16], const char *filename) { - int i; - - for (i = 0; i < 16; ++i) - printf("%02x", digest[i]); - printf(" %s\n", filename); -} - -static FILE *open_outfile(const char *name) { - if (strcmp("-", name) == 0) { - set_binary_mode(stdout); - return stdout; - } else { - FILE *file = fopen(name, "wb"); - if (!file) - fatal("Failed to open output file '%s'", name); - return file; - } -} - -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH -static int img_shifted_realloc_required(const vpx_image_t *img, - const vpx_image_t *shifted, - vpx_img_fmt_t required_fmt) { - return img->d_w != shifted->d_w || - img->d_h != shifted->d_h || - required_fmt != shifted->fmt; -} -#endif - -int main_loop(int argc, const char **argv_) { - vpx_codec_ctx_t decoder; - char *fn = NULL; - int i; - uint8_t *buf = NULL; - size_t bytes_in_buffer = 0, buffer_size = 0; - FILE *infile; - int frame_in = 0, frame_out = 0, flipuv = 0, noblit = 0; - int do_md5 = 0, progress = 0, frame_parallel = 0; - int stop_after = 0, postproc = 0, summary = 0, quiet = 1; - int arg_skip = 0; - int ec_enabled = 0; - int keep_going = 0; - const VpxInterface *interface = NULL; - const VpxInterface *fourcc_interface = NULL; - uint64_t dx_time = 0; - struct arg arg; - char **argv, **argi, **argj; - - int single_file; - int use_y4m = 1; - int opt_yv12 = 0; - int opt_i420 = 0; - vpx_codec_dec_cfg_t cfg = {0, 0, 0}; -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - int output_bit_depth = 0; -#endif -#if CONFIG_VP8_DECODER - vp8_postproc_cfg_t vp8_pp_cfg = {0}; - int vp8_dbg_color_ref_frame = 0; - int vp8_dbg_color_mb_modes = 0; - int vp8_dbg_color_b_modes = 0; - int vp8_dbg_display_mv = 0; -#endif - int frames_corrupted = 0; - int dec_flags = 0; - int do_scale = 0; - vpx_image_t *scaled_img = NULL; -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - vpx_image_t *img_shifted = NULL; -#endif - int frame_avail, got_data, flush_decoder = 0; - int num_external_frame_buffers = 0; - struct ExternalFrameBufferList ext_fb_list = {0, NULL}; - - const char *outfile_pattern = NULL; - char outfile_name[PATH_MAX] = {0}; - FILE *outfile = NULL; - - MD5Context md5_ctx; - unsigned char md5_digest[16]; - - struct VpxDecInputContext input = {NULL, NULL}; - struct VpxInputContext vpx_input_ctx; -#if CONFIG_WEBM_IO - struct WebmInputContext webm_ctx; - memset(&(webm_ctx), 0, sizeof(webm_ctx)); - input.webm_ctx = &webm_ctx; -#endif - input.vpx_input_ctx = &vpx_input_ctx; - - /* Parse command line */ - exec_name = argv_[0]; - argv = argv_dup(argc - 1, argv_ + 1); - - for (argi = argj = argv; (*argj = *argi); argi += arg.argv_step) { - memset(&arg, 0, sizeof(arg)); - arg.argv_step = 1; - - if (arg_match(&arg, &codecarg, argi)) { - interface = get_vpx_decoder_by_name(arg.val); - if (!interface) - die("Error: Unrecognized argument (%s) to --codec\n", arg.val); - } else if (arg_match(&arg, &looparg, argi)) { - // no-op - } else if (arg_match(&arg, &outputfile, argi)) - outfile_pattern = arg.val; - else if (arg_match(&arg, &use_yv12, argi)) { - use_y4m = 0; - flipuv = 1; - opt_yv12 = 1; -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - output_bit_depth = 8; // For yv12 8-bit depth output is assumed -#endif - } else if (arg_match(&arg, &use_i420, argi)) { - use_y4m = 0; - flipuv = 0; - opt_i420 = 1; - } else if (arg_match(&arg, &rawvideo, argi)) { - use_y4m = 0; - } else if (arg_match(&arg, &flipuvarg, argi)) - flipuv = 1; - else if (arg_match(&arg, &noblitarg, argi)) - noblit = 1; - else if (arg_match(&arg, &progressarg, argi)) - progress = 1; - else if (arg_match(&arg, &limitarg, argi)) - stop_after = arg_parse_uint(&arg); - else if (arg_match(&arg, &skiparg, argi)) - arg_skip = arg_parse_uint(&arg); - else if (arg_match(&arg, &postprocarg, argi)) - postproc = 1; - else if (arg_match(&arg, &md5arg, argi)) - do_md5 = 1; - else if (arg_match(&arg, &summaryarg, argi)) - summary = 1; - else if (arg_match(&arg, &threadsarg, argi)) - cfg.threads = arg_parse_uint(&arg); -#if CONFIG_VP9_DECODER - else if (arg_match(&arg, &frameparallelarg, argi)) - frame_parallel = 1; -#endif - else if (arg_match(&arg, &verbosearg, argi)) - quiet = 0; - else if (arg_match(&arg, &scalearg, argi)) - do_scale = 1; - else if (arg_match(&arg, &fb_arg, argi)) - num_external_frame_buffers = arg_parse_uint(&arg); - else if (arg_match(&arg, &continuearg, argi)) - keep_going = 1; -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - else if (arg_match(&arg, &outbitdeptharg, argi)) { - output_bit_depth = arg_parse_uint(&arg); - } -#endif -#if CONFIG_VP8_DECODER - else if (arg_match(&arg, &addnoise_level, argi)) { - postproc = 1; - vp8_pp_cfg.post_proc_flag |= VP8_ADDNOISE; - vp8_pp_cfg.noise_level = arg_parse_uint(&arg); - } else if (arg_match(&arg, &demacroblock_level, argi)) { - postproc = 1; - vp8_pp_cfg.post_proc_flag |= VP8_DEMACROBLOCK; - vp8_pp_cfg.deblocking_level = arg_parse_uint(&arg); - } else if (arg_match(&arg, &deblock, argi)) { - postproc = 1; - vp8_pp_cfg.post_proc_flag |= VP8_DEBLOCK; - } else if (arg_match(&arg, &mfqe, argi)) { - postproc = 1; - vp8_pp_cfg.post_proc_flag |= VP8_MFQE; - } else if (arg_match(&arg, &pp_debug_info, argi)) { - unsigned int level = arg_parse_uint(&arg); - - postproc = 1; - vp8_pp_cfg.post_proc_flag &= ~0x7; - - if (level) - vp8_pp_cfg.post_proc_flag |= level; - } else if (arg_match(&arg, &pp_disp_ref_frame, argi)) { - unsigned int flags = arg_parse_int(&arg); - if (flags) { - postproc = 1; - vp8_dbg_color_ref_frame = flags; - } - } else if (arg_match(&arg, &pp_disp_mb_modes, argi)) { - unsigned int flags = arg_parse_int(&arg); - if (flags) { - postproc = 1; - vp8_dbg_color_mb_modes = flags; - } - } else if (arg_match(&arg, &pp_disp_b_modes, argi)) { - unsigned int flags = arg_parse_int(&arg); - if (flags) { - postproc = 1; - vp8_dbg_color_b_modes = flags; - } - } else if (arg_match(&arg, &pp_disp_mvs, argi)) { - unsigned int flags = arg_parse_int(&arg); - if (flags) { - postproc = 1; - vp8_dbg_display_mv = flags; - } - } else if (arg_match(&arg, &error_concealment, argi)) { - ec_enabled = 1; - } -#endif // CONFIG_VP8_DECODER - else - argj++; - } - - /* Check for unrecognized options */ - for (argi = argv; *argi; argi++) - if (argi[0][0] == '-' && strlen(argi[0]) > 1) - die("Error: Unrecognized option %s\n", *argi); - - /* Handle non-option arguments */ - fn = argv[0]; - - if (!fn) { - free(argv); - usage_exit(); - } - /* Open file */ - infile = strcmp(fn, "-") ? fopen(fn, "rb") : set_binary_mode(stdin); - - if (!infile) { - fatal("Failed to open input file '%s'", strcmp(fn, "-") ? fn : "stdin"); - } -#if CONFIG_OS_SUPPORT - /* Make sure we don't dump to the terminal, unless forced to with -o - */ - if (!outfile_pattern && isatty(fileno(stdout)) && !do_md5 && !noblit) { - fprintf(stderr, - "Not dumping raw video to your terminal. Use '-o -' to " - "override.\n"); - return EXIT_FAILURE; - } -#endif - input.vpx_input_ctx->file = infile; - if (file_is_ivf(input.vpx_input_ctx)) - input.vpx_input_ctx->file_type = FILE_TYPE_IVF; -#if CONFIG_WEBM_IO - else if (file_is_webm(input.webm_ctx, input.vpx_input_ctx)) - input.vpx_input_ctx->file_type = FILE_TYPE_WEBM; -#endif - else if (file_is_raw(input.vpx_input_ctx)) - input.vpx_input_ctx->file_type = FILE_TYPE_RAW; - else { - fprintf(stderr, "Unrecognized input file type.\n"); -#if !CONFIG_WEBM_IO - fprintf(stderr, "vpxdec was built without WebM container support.\n"); -#endif - return EXIT_FAILURE; - } - - outfile_pattern = outfile_pattern ? outfile_pattern : "-"; - single_file = is_single_file(outfile_pattern); - - if (!noblit && single_file) { - generate_filename(outfile_pattern, outfile_name, PATH_MAX, - vpx_input_ctx.width, vpx_input_ctx.height, 0); - if (do_md5) - MD5Init(&md5_ctx); - else - outfile = open_outfile(outfile_name); - } - - if (use_y4m && !noblit) { - if (!single_file) { - fprintf(stderr, "YUV4MPEG2 not supported with output patterns," - " try --i420 or --yv12 or --rawvideo.\n"); - return EXIT_FAILURE; - } - -#if CONFIG_WEBM_IO - if (vpx_input_ctx.file_type == FILE_TYPE_WEBM) { - if (webm_guess_framerate(input.webm_ctx, input.vpx_input_ctx)) { - fprintf(stderr, "Failed to guess framerate -- error parsing " - "webm file?\n"); - return EXIT_FAILURE; - } - } -#endif - } - - fourcc_interface = get_vpx_decoder_by_fourcc(vpx_input_ctx.fourcc); - if (interface && fourcc_interface && interface != fourcc_interface) - warn("Header indicates codec: %s\n", fourcc_interface->name); - else - interface = fourcc_interface; - - if (!interface) - interface = get_vpx_decoder_by_index(0); - - dec_flags = (postproc ? VPX_CODEC_USE_POSTPROC : 0) | - (ec_enabled ? VPX_CODEC_USE_ERROR_CONCEALMENT : 0) | - (frame_parallel ? VPX_CODEC_USE_FRAME_THREADING : 0); - if (vpx_codec_dec_init(&decoder, interface->codec_interface(), - &cfg, dec_flags)) { - fprintf(stderr, "Failed to initialize decoder: %s\n", - vpx_codec_error(&decoder)); - return EXIT_FAILURE; - } - - if (!quiet) - fprintf(stderr, "%s\n", decoder.name); - -#if CONFIG_VP8_DECODER - - if (vp8_pp_cfg.post_proc_flag - && vpx_codec_control(&decoder, VP8_SET_POSTPROC, &vp8_pp_cfg)) { - fprintf(stderr, "Failed to configure postproc: %s\n", vpx_codec_error(&decoder)); - return EXIT_FAILURE; - } - - if (vp8_dbg_color_ref_frame - && vpx_codec_control(&decoder, VP8_SET_DBG_COLOR_REF_FRAME, vp8_dbg_color_ref_frame)) { - fprintf(stderr, "Failed to configure reference block visualizer: %s\n", vpx_codec_error(&decoder)); - return EXIT_FAILURE; - } - - if (vp8_dbg_color_mb_modes - && vpx_codec_control(&decoder, VP8_SET_DBG_COLOR_MB_MODES, vp8_dbg_color_mb_modes)) { - fprintf(stderr, "Failed to configure macro block visualizer: %s\n", vpx_codec_error(&decoder)); - return EXIT_FAILURE; - } - - if (vp8_dbg_color_b_modes - && vpx_codec_control(&decoder, VP8_SET_DBG_COLOR_B_MODES, vp8_dbg_color_b_modes)) { - fprintf(stderr, "Failed to configure block visualizer: %s\n", vpx_codec_error(&decoder)); - return EXIT_FAILURE; - } - - if (vp8_dbg_display_mv - && vpx_codec_control(&decoder, VP8_SET_DBG_DISPLAY_MV, vp8_dbg_display_mv)) { - fprintf(stderr, "Failed to configure motion vector visualizer: %s\n", vpx_codec_error(&decoder)); - return EXIT_FAILURE; - } -#endif - - - if (arg_skip) - fprintf(stderr, "Skipping first %d frames.\n", arg_skip); - while (arg_skip) { - if (read_frame(&input, &buf, &bytes_in_buffer, &buffer_size)) - break; - arg_skip--; - } - - if (num_external_frame_buffers > 0) { - ext_fb_list.num_external_frame_buffers = num_external_frame_buffers; - ext_fb_list.ext_fb = (struct ExternalFrameBuffer *)calloc( - num_external_frame_buffers, sizeof(*ext_fb_list.ext_fb)); - if (vpx_codec_set_frame_buffer_functions( - &decoder, get_vp9_frame_buffer, release_vp9_frame_buffer, - &ext_fb_list)) { - fprintf(stderr, "Failed to configure external frame buffers: %s\n", - vpx_codec_error(&decoder)); - return EXIT_FAILURE; - } - } - - frame_avail = 1; - got_data = 0; - - /* Decode file */ - while (frame_avail || got_data) { - vpx_codec_iter_t iter = NULL; - vpx_image_t *img; - struct vpx_usec_timer timer; - int corrupted = 0; - - frame_avail = 0; - if (!stop_after || frame_in < stop_after) { - if (!read_frame(&input, &buf, &bytes_in_buffer, &buffer_size)) { - frame_avail = 1; - frame_in++; - - vpx_usec_timer_start(&timer); - - if (vpx_codec_decode(&decoder, buf, (unsigned int)bytes_in_buffer, - NULL, 0)) { - const char *detail = vpx_codec_error_detail(&decoder); - warn("Failed to decode frame %d: %s", - frame_in, vpx_codec_error(&decoder)); - - if (detail) - warn("Additional information: %s", detail); - if (!keep_going) - goto fail; - } - - vpx_usec_timer_mark(&timer); - dx_time += vpx_usec_timer_elapsed(&timer); - } else { - flush_decoder = 1; - } - } else { - flush_decoder = 1; - } - - vpx_usec_timer_start(&timer); - - if (flush_decoder) { - // Flush the decoder in frame parallel decode. - if (vpx_codec_decode(&decoder, NULL, 0, NULL, 0)) { - warn("Failed to flush decoder: %s", vpx_codec_error(&decoder)); - } - } - - got_data = 0; - if ((img = vpx_codec_get_frame(&decoder, &iter))) { - ++frame_out; - got_data = 1; - } - - vpx_usec_timer_mark(&timer); - dx_time += (unsigned int)vpx_usec_timer_elapsed(&timer); - - if (!frame_parallel && - vpx_codec_control(&decoder, VP8D_GET_FRAME_CORRUPTED, &corrupted)) { - warn("Failed VP8_GET_FRAME_CORRUPTED: %s", vpx_codec_error(&decoder)); - if (!keep_going) - goto fail; - } - frames_corrupted += corrupted; - - if (progress) - show_progress(frame_in, frame_out, dx_time); - - if (!noblit && img) { - const int PLANES_YUV[] = {VPX_PLANE_Y, VPX_PLANE_U, VPX_PLANE_V}; - const int PLANES_YVU[] = {VPX_PLANE_Y, VPX_PLANE_V, VPX_PLANE_U}; - const int *planes = flipuv ? PLANES_YVU : PLANES_YUV; - - if (do_scale) { - if (frame_out == 1) { - // If the output frames are to be scaled to a fixed display size then - // use the width and height specified in the container. If either of - // these is set to 0, use the display size set in the first frame - // header. If that is unavailable, use the raw decoded size of the - // first decoded frame. - int display_width = vpx_input_ctx.width; - int display_height = vpx_input_ctx.height; - if (!display_width || !display_height) { - int display_size[2]; - if (vpx_codec_control(&decoder, VP9D_GET_DISPLAY_SIZE, - display_size)) { - // As last resort use size of first frame as display size. - display_width = img->d_w; - display_height = img->d_h; - } else { - display_width = display_size[0]; - display_height = display_size[1]; - } - } - scaled_img = vpx_img_alloc(NULL, img->fmt, display_width, - display_height, 16); - scaled_img->bit_depth = img->bit_depth; - } - - if (img->d_w != scaled_img->d_w || img->d_h != scaled_img->d_h) { -#if CONFIG_LIBYUV - libyuv_scale(img, scaled_img, kFilterBox); - img = scaled_img; -#else - fprintf(stderr, "Failed to scale output frame: %s.\n" - "Scaling is disabled in this configuration. " - "To enable scaling, configure with --enable-libyuv\n", - vpx_codec_error(&decoder)); - return EXIT_FAILURE; -#endif - } - } -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - // Default to codec bit depth if output bit depth not set - if (!output_bit_depth) { - output_bit_depth = img->bit_depth; - } - // Shift up or down if necessary - if (output_bit_depth != img->bit_depth) { - const vpx_img_fmt_t shifted_fmt = output_bit_depth == 8 ? - img->fmt ^ (img->fmt & VPX_IMG_FMT_HIGHBITDEPTH) : - img->fmt | VPX_IMG_FMT_HIGHBITDEPTH; - if (img_shifted && - img_shifted_realloc_required(img, img_shifted, shifted_fmt)) { - vpx_img_free(img_shifted); - img_shifted = NULL; - } - if (!img_shifted) { - img_shifted = vpx_img_alloc(NULL, shifted_fmt, - img->d_w, img->d_h, 16); - img_shifted->bit_depth = output_bit_depth; - } - if (output_bit_depth > img->bit_depth) { - vpx_img_upshift(img_shifted, img, - output_bit_depth - img->bit_depth); - } else { - vpx_img_downshift(img_shifted, img, - img->bit_depth - output_bit_depth); - } - img = img_shifted; - } -#endif - - if (single_file) { - if (use_y4m) { - char buf[Y4M_BUFFER_SIZE] = {0}; - size_t len = 0; - if (img->fmt == VPX_IMG_FMT_I440 || img->fmt == VPX_IMG_FMT_I44016) { - fprintf(stderr, "Cannot produce y4m output for 440 sampling.\n"); - goto fail; - } - if (frame_out == 1) { - // Y4M file header - len = y4m_write_file_header(buf, sizeof(buf), - vpx_input_ctx.width, - vpx_input_ctx.height, - &vpx_input_ctx.framerate, - img->fmt, img->bit_depth); - if (do_md5) { - MD5Update(&md5_ctx, (md5byte *)buf, (unsigned int)len); - } else { - fputs(buf, outfile); - } - } - - // Y4M frame header - len = y4m_write_frame_header(buf, sizeof(buf)); - if (do_md5) { - MD5Update(&md5_ctx, (md5byte *)buf, (unsigned int)len); - } else { - fputs(buf, outfile); - } - } else { - if (frame_out == 1) { - // Check if --yv12 or --i420 options are consistent with the - // bit-stream decoded - if (opt_i420) { - if (img->fmt != VPX_IMG_FMT_I420 && - img->fmt != VPX_IMG_FMT_I42016) { - fprintf(stderr, "Cannot produce i420 output for bit-stream.\n"); - goto fail; - } - } - if (opt_yv12) { - if ((img->fmt != VPX_IMG_FMT_I420 && - img->fmt != VPX_IMG_FMT_YV12) || img->bit_depth != 8) { - fprintf(stderr, "Cannot produce yv12 output for bit-stream.\n"); - goto fail; - } - } - } - } - - if (do_md5) { - update_image_md5(img, planes, &md5_ctx); - } else { - write_image_file(img, planes, outfile); - } - } else { - generate_filename(outfile_pattern, outfile_name, PATH_MAX, - img->d_w, img->d_h, frame_in); - if (do_md5) { - MD5Init(&md5_ctx); - update_image_md5(img, planes, &md5_ctx); - MD5Final(md5_digest, &md5_ctx); - print_md5(md5_digest, outfile_name); - } else { - outfile = open_outfile(outfile_name); - write_image_file(img, planes, outfile); - fclose(outfile); - } - } - } - - if (stop_after && frame_in >= stop_after) - break; - } - - if (summary || progress) { - show_progress(frame_in, frame_out, dx_time); - fprintf(stderr, "\n"); - } - - if (frames_corrupted) - fprintf(stderr, "WARNING: %d frames corrupted.\n", frames_corrupted); - -fail: - - if (vpx_codec_destroy(&decoder)) { - fprintf(stderr, "Failed to destroy decoder: %s\n", - vpx_codec_error(&decoder)); - return EXIT_FAILURE; - } - - if (!noblit && single_file) { - if (do_md5) { - MD5Final(md5_digest, &md5_ctx); - print_md5(md5_digest, outfile_name); - } else { - fclose(outfile); - } - } - -#if CONFIG_WEBM_IO - if (input.vpx_input_ctx->file_type == FILE_TYPE_WEBM) - webm_free(input.webm_ctx); -#endif - - if (input.vpx_input_ctx->file_type != FILE_TYPE_WEBM) - free(buf); - - if (scaled_img) vpx_img_free(scaled_img); -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - if (img_shifted) vpx_img_free(img_shifted); -#endif - - for (i = 0; i < ext_fb_list.num_external_frame_buffers; ++i) { - free(ext_fb_list.ext_fb[i].data); - } - free(ext_fb_list.ext_fb); - - fclose(infile); - free(argv); - - return frames_corrupted ? EXIT_FAILURE : EXIT_SUCCESS; -} - -int main(int argc, const char **argv_) { - unsigned int loops = 1, i; - char **argv, **argi, **argj; - struct arg arg; - int error = 0; - - argv = argv_dup(argc - 1, argv_ + 1); - for (argi = argj = argv; (*argj = *argi); argi += arg.argv_step) { - memset(&arg, 0, sizeof(arg)); - arg.argv_step = 1; - - if (arg_match(&arg, &looparg, argi)) { - loops = arg_parse_uint(&arg); - break; - } - } - free(argv); - for (i = 0; !error && i < loops; i++) - error = main_loop(argc, argv_); - return error; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpxenc.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpxenc.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpxenc.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpxenc.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2266 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "./vpxenc.h" -#include "./vpx_config.h" - -#include -#include -#include -#include -#include -#include -#include - -#if CONFIG_LIBYUV -#include "third_party/libyuv/include/libyuv/scale.h" -#endif - -#include "vpx/vpx_encoder.h" -#if CONFIG_DECODERS -#include "vpx/vpx_decoder.h" -#endif - -#include "./args.h" -#include "./ivfenc.h" -#include "./tools_common.h" - -#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER -#include "vpx/vp8cx.h" -#endif -#if CONFIG_VP8_DECODER || CONFIG_VP9_DECODER -#include "vpx/vp8dx.h" -#endif - -#include "vpx/vpx_integer.h" -#include "vpx_ports/mem_ops.h" -#include "vpx_ports/vpx_timer.h" -#include "./rate_hist.h" -#include "./vpxstats.h" -#include "./warnings.h" -#if CONFIG_WEBM_IO -#include "./webmenc.h" -#endif -#include "./y4minput.h" - -/* Swallow warnings about unused results of fread/fwrite */ -static size_t wrap_fread(void *ptr, size_t size, size_t nmemb, - FILE *stream) { - return fread(ptr, size, nmemb, stream); -} -#define fread wrap_fread - -static size_t wrap_fwrite(const void *ptr, size_t size, size_t nmemb, - FILE *stream) { - return fwrite(ptr, size, nmemb, stream); -} -#define fwrite wrap_fwrite - - -static const char *exec_name; - -static void warn_or_exit_on_errorv(vpx_codec_ctx_t *ctx, int fatal, - const char *s, va_list ap) { - if (ctx->err) { - const char *detail = vpx_codec_error_detail(ctx); - - vfprintf(stderr, s, ap); - fprintf(stderr, ": %s\n", vpx_codec_error(ctx)); - - if (detail) - fprintf(stderr, " %s\n", detail); - - if (fatal) - exit(EXIT_FAILURE); - } -} - -static void ctx_exit_on_error(vpx_codec_ctx_t *ctx, const char *s, ...) { - va_list ap; - - va_start(ap, s); - warn_or_exit_on_errorv(ctx, 1, s, ap); - va_end(ap); -} - -static void warn_or_exit_on_error(vpx_codec_ctx_t *ctx, int fatal, - const char *s, ...) { - va_list ap; - - va_start(ap, s); - warn_or_exit_on_errorv(ctx, fatal, s, ap); - va_end(ap); -} - -int read_frame(struct VpxInputContext *input_ctx, vpx_image_t *img) { - FILE *f = input_ctx->file; - y4m_input *y4m = &input_ctx->y4m; - int shortread = 0; - - if (input_ctx->file_type == FILE_TYPE_Y4M) { - if (y4m_input_fetch_frame(y4m, f, img) < 1) - return 0; - } else { - shortread = read_yuv_frame(input_ctx, img); - } - - return !shortread; -} - -int file_is_y4m(const char detect[4]) { - if (memcmp(detect, "YUV4", 4) == 0) { - return 1; - } - return 0; -} - -int fourcc_is_ivf(const char detect[4]) { - if (memcmp(detect, "DKIF", 4) == 0) { - return 1; - } - return 0; -} - -static const arg_def_t debugmode = ARG_DEF( - "D", "debug", 0, "Debug mode (makes output deterministic)"); -static const arg_def_t outputfile = ARG_DEF( - "o", "output", 1, "Output filename"); -static const arg_def_t use_yv12 = ARG_DEF( - NULL, "yv12", 0, "Input file is YV12 "); -static const arg_def_t use_i420 = ARG_DEF( - NULL, "i420", 0, "Input file is I420 (default)"); -static const arg_def_t use_i422 = ARG_DEF( - NULL, "i422", 0, "Input file is I422"); -static const arg_def_t use_i444 = ARG_DEF( - NULL, "i444", 0, "Input file is I444"); -static const arg_def_t use_i440 = ARG_DEF( - NULL, "i440", 0, "Input file is I440"); -static const arg_def_t codecarg = ARG_DEF( - NULL, "codec", 1, "Codec to use"); -static const arg_def_t passes = ARG_DEF( - "p", "passes", 1, "Number of passes (1/2)"); -static const arg_def_t pass_arg = ARG_DEF( - NULL, "pass", 1, "Pass to execute (1/2)"); -static const arg_def_t fpf_name = ARG_DEF( - NULL, "fpf", 1, "First pass statistics file name"); -#if CONFIG_FP_MB_STATS -static const arg_def_t fpmbf_name = ARG_DEF( - NULL, "fpmbf", 1, "First pass block statistics file name"); -#endif -static const arg_def_t limit = ARG_DEF( - NULL, "limit", 1, "Stop encoding after n input frames"); -static const arg_def_t skip = ARG_DEF( - NULL, "skip", 1, "Skip the first n input frames"); -static const arg_def_t deadline = ARG_DEF( - "d", "deadline", 1, "Deadline per frame (usec)"); -static const arg_def_t best_dl = ARG_DEF( - NULL, "best", 0, "Use Best Quality Deadline"); -static const arg_def_t good_dl = ARG_DEF( - NULL, "good", 0, "Use Good Quality Deadline"); -static const arg_def_t rt_dl = ARG_DEF( - NULL, "rt", 0, "Use Realtime Quality Deadline"); -static const arg_def_t quietarg = ARG_DEF( - "q", "quiet", 0, "Do not print encode progress"); -static const arg_def_t verbosearg = ARG_DEF( - "v", "verbose", 0, "Show encoder parameters"); -static const arg_def_t psnrarg = ARG_DEF( - NULL, "psnr", 0, "Show PSNR in status line"); - -static const struct arg_enum_list test_decode_enum[] = { - {"off", TEST_DECODE_OFF}, - {"fatal", TEST_DECODE_FATAL}, - {"warn", TEST_DECODE_WARN}, - {NULL, 0} -}; -static const arg_def_t recontest = ARG_DEF_ENUM( - NULL, "test-decode", 1, "Test encode/decode mismatch", test_decode_enum); -static const arg_def_t framerate = ARG_DEF( - NULL, "fps", 1, "Stream frame rate (rate/scale)"); -static const arg_def_t use_webm = ARG_DEF( - NULL, "webm", 0, "Output WebM (default when WebM IO is enabled)"); -static const arg_def_t use_ivf = ARG_DEF( - NULL, "ivf", 0, "Output IVF"); -static const arg_def_t out_part = ARG_DEF( - "P", "output-partitions", 0, - "Makes encoder output partitions. Requires IVF output!"); -static const arg_def_t q_hist_n = ARG_DEF( - NULL, "q-hist", 1, "Show quantizer histogram (n-buckets)"); -static const arg_def_t rate_hist_n = ARG_DEF( - NULL, "rate-hist", 1, "Show rate histogram (n-buckets)"); -static const arg_def_t disable_warnings = ARG_DEF( - NULL, "disable-warnings", 0, - "Disable warnings about potentially incorrect encode settings."); -static const arg_def_t disable_warning_prompt = ARG_DEF( - "y", "disable-warning-prompt", 0, - "Display warnings, but do not prompt user to continue."); - -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH -static const arg_def_t test16bitinternalarg = ARG_DEF( - NULL, "test-16bit-internal", 0, "Force use of 16 bit internal buffer"); -#endif - -static const arg_def_t *main_args[] = { - &debugmode, - &outputfile, &codecarg, &passes, &pass_arg, &fpf_name, &limit, &skip, - &deadline, &best_dl, &good_dl, &rt_dl, - &quietarg, &verbosearg, &psnrarg, &use_webm, &use_ivf, &out_part, &q_hist_n, - &rate_hist_n, &disable_warnings, &disable_warning_prompt, - NULL -}; - -static const arg_def_t usage = ARG_DEF( - "u", "usage", 1, "Usage profile number to use"); -static const arg_def_t threads = ARG_DEF( - "t", "threads", 1, "Max number of threads to use"); -static const arg_def_t profile = ARG_DEF( - NULL, "profile", 1, "Bitstream profile number to use"); -static const arg_def_t width = ARG_DEF("w", "width", 1, "Frame width"); -static const arg_def_t height = ARG_DEF("h", "height", 1, "Frame height"); -#if CONFIG_WEBM_IO -static const struct arg_enum_list stereo_mode_enum[] = { - {"mono", STEREO_FORMAT_MONO}, - {"left-right", STEREO_FORMAT_LEFT_RIGHT}, - {"bottom-top", STEREO_FORMAT_BOTTOM_TOP}, - {"top-bottom", STEREO_FORMAT_TOP_BOTTOM}, - {"right-left", STEREO_FORMAT_RIGHT_LEFT}, - {NULL, 0} -}; -static const arg_def_t stereo_mode = ARG_DEF_ENUM( - NULL, "stereo-mode", 1, "Stereo 3D video format", stereo_mode_enum); -#endif -static const arg_def_t timebase = ARG_DEF( - NULL, "timebase", 1, "Output timestamp precision (fractional seconds)"); -static const arg_def_t error_resilient = ARG_DEF( - NULL, "error-resilient", 1, "Enable error resiliency features"); -static const arg_def_t lag_in_frames = ARG_DEF( - NULL, "lag-in-frames", 1, "Max number of frames to lag"); - -static const arg_def_t *global_args[] = { - &use_yv12, &use_i420, &use_i422, &use_i444, &use_i440, - &usage, &threads, &profile, - &width, &height, -#if CONFIG_WEBM_IO - &stereo_mode, -#endif - &timebase, &framerate, - &error_resilient, -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - &test16bitinternalarg, -#endif - &lag_in_frames, NULL -}; - -static const arg_def_t dropframe_thresh = ARG_DEF( - NULL, "drop-frame", 1, "Temporal resampling threshold (buf %)"); -static const arg_def_t resize_allowed = ARG_DEF( - NULL, "resize-allowed", 1, "Spatial resampling enabled (bool)"); -static const arg_def_t resize_width = ARG_DEF( - NULL, "resize-width", 1, "Width of encoded frame"); -static const arg_def_t resize_height = ARG_DEF( - NULL, "resize-height", 1, "Height of encoded frame"); -static const arg_def_t resize_up_thresh = ARG_DEF( - NULL, "resize-up", 1, "Upscale threshold (buf %)"); -static const arg_def_t resize_down_thresh = ARG_DEF( - NULL, "resize-down", 1, "Downscale threshold (buf %)"); -static const struct arg_enum_list end_usage_enum[] = { - {"vbr", VPX_VBR}, - {"cbr", VPX_CBR}, - {"cq", VPX_CQ}, - {"q", VPX_Q}, - {NULL, 0} -}; -static const arg_def_t end_usage = ARG_DEF_ENUM( - NULL, "end-usage", 1, "Rate control mode", end_usage_enum); -static const arg_def_t target_bitrate = ARG_DEF( - NULL, "target-bitrate", 1, "Bitrate (kbps)"); -static const arg_def_t min_quantizer = ARG_DEF( - NULL, "min-q", 1, "Minimum (best) quantizer"); -static const arg_def_t max_quantizer = ARG_DEF( - NULL, "max-q", 1, "Maximum (worst) quantizer"); -static const arg_def_t undershoot_pct = ARG_DEF( - NULL, "undershoot-pct", 1, "Datarate undershoot (min) target (%)"); -static const arg_def_t overshoot_pct = ARG_DEF( - NULL, "overshoot-pct", 1, "Datarate overshoot (max) target (%)"); -static const arg_def_t buf_sz = ARG_DEF( - NULL, "buf-sz", 1, "Client buffer size (ms)"); -static const arg_def_t buf_initial_sz = ARG_DEF( - NULL, "buf-initial-sz", 1, "Client initial buffer size (ms)"); -static const arg_def_t buf_optimal_sz = ARG_DEF( - NULL, "buf-optimal-sz", 1, "Client optimal buffer size (ms)"); -static const arg_def_t *rc_args[] = { - &dropframe_thresh, &resize_allowed, &resize_width, &resize_height, - &resize_up_thresh, &resize_down_thresh, &end_usage, &target_bitrate, - &min_quantizer, &max_quantizer, &undershoot_pct, &overshoot_pct, &buf_sz, - &buf_initial_sz, &buf_optimal_sz, NULL -}; - - -static const arg_def_t bias_pct = ARG_DEF( - NULL, "bias-pct", 1, "CBR/VBR bias (0=CBR, 100=VBR)"); -static const arg_def_t minsection_pct = ARG_DEF( - NULL, "minsection-pct", 1, "GOP min bitrate (% of target)"); -static const arg_def_t maxsection_pct = ARG_DEF( - NULL, "maxsection-pct", 1, "GOP max bitrate (% of target)"); -static const arg_def_t *rc_twopass_args[] = { - &bias_pct, &minsection_pct, &maxsection_pct, NULL -}; - - -static const arg_def_t kf_min_dist = ARG_DEF( - NULL, "kf-min-dist", 1, "Minimum keyframe interval (frames)"); -static const arg_def_t kf_max_dist = ARG_DEF( - NULL, "kf-max-dist", 1, "Maximum keyframe interval (frames)"); -static const arg_def_t kf_disabled = ARG_DEF( - NULL, "disable-kf", 0, "Disable keyframe placement"); -static const arg_def_t *kf_args[] = { - &kf_min_dist, &kf_max_dist, &kf_disabled, NULL -}; - - -static const arg_def_t noise_sens = ARG_DEF( - NULL, "noise-sensitivity", 1, "Noise sensitivity (frames to blur)"); -static const arg_def_t sharpness = ARG_DEF( - NULL, "sharpness", 1, "Loop filter sharpness (0..7)"); -static const arg_def_t static_thresh = ARG_DEF( - NULL, "static-thresh", 1, "Motion detection threshold"); -static const arg_def_t cpu_used_vp8 = ARG_DEF( - NULL, "cpu-used", 1, "CPU Used (-16..16)"); -static const arg_def_t cpu_used_vp9 = ARG_DEF( - NULL, "cpu-used", 1, "CPU Used (-8..8)"); -static const arg_def_t auto_altref = ARG_DEF( - NULL, "auto-alt-ref", 1, "Enable automatic alt reference frames"); -static const arg_def_t arnr_maxframes = ARG_DEF( - NULL, "arnr-maxframes", 1, "AltRef max frames (0..15)"); -static const arg_def_t arnr_strength = ARG_DEF( - NULL, "arnr-strength", 1, "AltRef filter strength (0..6)"); -static const arg_def_t arnr_type = ARG_DEF( - NULL, "arnr-type", 1, "AltRef type"); -static const struct arg_enum_list tuning_enum[] = { - {"psnr", VP8_TUNE_PSNR}, - {"ssim", VP8_TUNE_SSIM}, - {NULL, 0} -}; -static const arg_def_t tune_ssim = ARG_DEF_ENUM( - NULL, "tune", 1, "Material to favor", tuning_enum); -static const arg_def_t cq_level = ARG_DEF( - NULL, "cq-level", 1, "Constant/Constrained Quality level"); -static const arg_def_t max_intra_rate_pct = ARG_DEF( - NULL, "max-intra-rate", 1, "Max I-frame bitrate (pct)"); -static const arg_def_t max_inter_rate_pct = ARG_DEF( - NULL, "max-inter-rate", 1, "Max P-frame bitrate (pct)"); -static const arg_def_t gf_cbr_boost_pct = ARG_DEF( - NULL, "gf-cbr-boost", 1, "Boost for Golden Frame in CBR mode (pct)"); - -static const arg_def_t screen_content_mode = ARG_DEF(NULL, "screen-content-mode", 1, - "Screen content mode"); - -#if CONFIG_VP8_ENCODER -static const arg_def_t token_parts = ARG_DEF( - NULL, "token-parts", 1, "Number of token partitions to use, log2"); -static const arg_def_t *vp8_args[] = { - &cpu_used_vp8, &auto_altref, &noise_sens, &sharpness, &static_thresh, - &token_parts, &arnr_maxframes, &arnr_strength, &arnr_type, - &tune_ssim, &cq_level, &max_intra_rate_pct, &screen_content_mode, - NULL -}; -static const int vp8_arg_ctrl_map[] = { - VP8E_SET_CPUUSED, VP8E_SET_ENABLEAUTOALTREF, - VP8E_SET_NOISE_SENSITIVITY, VP8E_SET_SHARPNESS, VP8E_SET_STATIC_THRESHOLD, - VP8E_SET_TOKEN_PARTITIONS, - VP8E_SET_ARNR_MAXFRAMES, VP8E_SET_ARNR_STRENGTH, VP8E_SET_ARNR_TYPE, - VP8E_SET_TUNING, VP8E_SET_CQ_LEVEL, VP8E_SET_MAX_INTRA_BITRATE_PCT, - VP8E_SET_SCREEN_CONTENT_MODE, - 0 -}; -#endif - -#if CONFIG_VP9_ENCODER -static const arg_def_t tile_cols = ARG_DEF( - NULL, "tile-columns", 1, "Number of tile columns to use, log2"); -static const arg_def_t tile_rows = ARG_DEF( - NULL, "tile-rows", 1, "Number of tile rows to use, log2"); -static const arg_def_t lossless = ARG_DEF( - NULL, "lossless", 1, "Lossless mode"); -static const arg_def_t frame_parallel_decoding = ARG_DEF( - NULL, "frame-parallel", 1, "Enable frame parallel decodability features"); -static const arg_def_t aq_mode = ARG_DEF( - NULL, "aq-mode", 1, - "Adaptive quantization mode (0: off (default), 1: variance 2: complexity, " - "3: cyclic refresh)"); -static const arg_def_t frame_periodic_boost = ARG_DEF( - NULL, "frame-boost", 1, - "Enable frame periodic boost (0: off (default), 1: on)"); - -static const struct arg_enum_list color_space_enum[] = { - { "unknown", VPX_CS_UNKNOWN }, - { "bt601", VPX_CS_BT_601 }, - { "bt709", VPX_CS_BT_709 }, - { "smpte170", VPX_CS_SMPTE_170 }, - { "smpte240", VPX_CS_SMPTE_240 }, - { "bt2020", VPX_CS_BT_2020 }, - { "reserved", VPX_CS_RESERVED }, - { "sRGB", VPX_CS_SRGB }, - { NULL, 0 } -}; - -static const arg_def_t input_color_space = ARG_DEF_ENUM( - NULL, "color-space", 1, - "The color space of input content:", color_space_enum); - -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH -static const struct arg_enum_list bitdepth_enum[] = { - {"8", VPX_BITS_8}, - {"10", VPX_BITS_10}, - {"12", VPX_BITS_12}, - {NULL, 0} -}; - -static const arg_def_t bitdeptharg = ARG_DEF_ENUM( - "b", "bit-depth", 1, - "Bit depth for codec (8 for version <=1, 10 or 12 for version 2)", - bitdepth_enum); -static const arg_def_t inbitdeptharg = ARG_DEF( - NULL, "input-bit-depth", 1, "Bit depth of input"); -#endif - -static const struct arg_enum_list tune_content_enum[] = { - {"default", VP9E_CONTENT_DEFAULT}, - {"screen", VP9E_CONTENT_SCREEN}, - {NULL, 0} -}; - -static const arg_def_t tune_content = ARG_DEF_ENUM( - NULL, "tune-content", 1, "Tune content type", tune_content_enum); - -static const arg_def_t *vp9_args[] = { - &cpu_used_vp9, &auto_altref, &sharpness, &static_thresh, - &tile_cols, &tile_rows, &arnr_maxframes, &arnr_strength, &arnr_type, - &tune_ssim, &cq_level, &max_intra_rate_pct, &max_inter_rate_pct, - &gf_cbr_boost_pct, &lossless, - &frame_parallel_decoding, &aq_mode, &frame_periodic_boost, - &noise_sens, &tune_content, &input_color_space, -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - &bitdeptharg, &inbitdeptharg, -#endif - NULL -}; -static const int vp9_arg_ctrl_map[] = { - VP8E_SET_CPUUSED, VP8E_SET_ENABLEAUTOALTREF, - VP8E_SET_SHARPNESS, VP8E_SET_STATIC_THRESHOLD, - VP9E_SET_TILE_COLUMNS, VP9E_SET_TILE_ROWS, - VP8E_SET_ARNR_MAXFRAMES, VP8E_SET_ARNR_STRENGTH, VP8E_SET_ARNR_TYPE, - VP8E_SET_TUNING, VP8E_SET_CQ_LEVEL, VP8E_SET_MAX_INTRA_BITRATE_PCT, - VP9E_SET_MAX_INTER_BITRATE_PCT, VP9E_SET_GF_CBR_BOOST_PCT, - VP9E_SET_LOSSLESS, VP9E_SET_FRAME_PARALLEL_DECODING, VP9E_SET_AQ_MODE, - VP9E_SET_FRAME_PERIODIC_BOOST, VP9E_SET_NOISE_SENSITIVITY, - VP9E_SET_TUNE_CONTENT, VP9E_SET_COLOR_SPACE, - 0 -}; -#endif - -static const arg_def_t *no_args[] = { NULL }; - -void usage_exit() { - int i; - - fprintf(stderr, "Usage: %s -o dst_filename src_filename \n", - exec_name); - - fprintf(stderr, "\nOptions:\n"); - arg_show_usage(stderr, main_args); - fprintf(stderr, "\nEncoder Global Options:\n"); - arg_show_usage(stderr, global_args); - fprintf(stderr, "\nRate Control Options:\n"); - arg_show_usage(stderr, rc_args); - fprintf(stderr, "\nTwopass Rate Control Options:\n"); - arg_show_usage(stderr, rc_twopass_args); - fprintf(stderr, "\nKeyframe Placement Options:\n"); - arg_show_usage(stderr, kf_args); -#if CONFIG_VP8_ENCODER - fprintf(stderr, "\nVP8 Specific Options:\n"); - arg_show_usage(stderr, vp8_args); -#endif -#if CONFIG_VP9_ENCODER - fprintf(stderr, "\nVP9 Specific Options:\n"); - arg_show_usage(stderr, vp9_args); -#endif - fprintf(stderr, "\nStream timebase (--timebase):\n" - " The desired precision of timestamps in the output, expressed\n" - " in fractional seconds. Default is 1/1000.\n"); - fprintf(stderr, "\nIncluded encoders:\n\n"); - - for (i = 0; i < get_vpx_encoder_count(); ++i) { - const VpxInterface *const encoder = get_vpx_encoder_by_index(i); - fprintf(stderr, " %-6s - %s\n", - encoder->name, vpx_codec_iface_name(encoder->codec_interface())); - } - - exit(EXIT_FAILURE); -} - -#define mmin(a, b) ((a) < (b) ? (a) : (b)) - -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH -static void find_mismatch_high(const vpx_image_t *const img1, - const vpx_image_t *const img2, - int yloc[4], int uloc[4], int vloc[4]) { - uint16_t *plane1, *plane2; - uint32_t stride1, stride2; - const uint32_t bsize = 64; - const uint32_t bsizey = bsize >> img1->y_chroma_shift; - const uint32_t bsizex = bsize >> img1->x_chroma_shift; - const uint32_t c_w = - (img1->d_w + img1->x_chroma_shift) >> img1->x_chroma_shift; - const uint32_t c_h = - (img1->d_h + img1->y_chroma_shift) >> img1->y_chroma_shift; - int match = 1; - uint32_t i, j; - yloc[0] = yloc[1] = yloc[2] = yloc[3] = -1; - plane1 = (uint16_t*)img1->planes[VPX_PLANE_Y]; - plane2 = (uint16_t*)img2->planes[VPX_PLANE_Y]; - stride1 = img1->stride[VPX_PLANE_Y]/2; - stride2 = img2->stride[VPX_PLANE_Y]/2; - for (i = 0, match = 1; match && i < img1->d_h; i += bsize) { - for (j = 0; match && j < img1->d_w; j += bsize) { - int k, l; - const int si = mmin(i + bsize, img1->d_h) - i; - const int sj = mmin(j + bsize, img1->d_w) - j; - for (k = 0; match && k < si; ++k) { - for (l = 0; match && l < sj; ++l) { - if (*(plane1 + (i + k) * stride1 + j + l) != - *(plane2 + (i + k) * stride2 + j + l)) { - yloc[0] = i + k; - yloc[1] = j + l; - yloc[2] = *(plane1 + (i + k) * stride1 + j + l); - yloc[3] = *(plane2 + (i + k) * stride2 + j + l); - match = 0; - break; - } - } - } - } - } - - uloc[0] = uloc[1] = uloc[2] = uloc[3] = -1; - plane1 = (uint16_t*)img1->planes[VPX_PLANE_U]; - plane2 = (uint16_t*)img2->planes[VPX_PLANE_U]; - stride1 = img1->stride[VPX_PLANE_U]/2; - stride2 = img2->stride[VPX_PLANE_U]/2; - for (i = 0, match = 1; match && i < c_h; i += bsizey) { - for (j = 0; match && j < c_w; j += bsizex) { - int k, l; - const int si = mmin(i + bsizey, c_h - i); - const int sj = mmin(j + bsizex, c_w - j); - for (k = 0; match && k < si; ++k) { - for (l = 0; match && l < sj; ++l) { - if (*(plane1 + (i + k) * stride1 + j + l) != - *(plane2 + (i + k) * stride2 + j + l)) { - uloc[0] = i + k; - uloc[1] = j + l; - uloc[2] = *(plane1 + (i + k) * stride1 + j + l); - uloc[3] = *(plane2 + (i + k) * stride2 + j + l); - match = 0; - break; - } - } - } - } - } - - vloc[0] = vloc[1] = vloc[2] = vloc[3] = -1; - plane1 = (uint16_t*)img1->planes[VPX_PLANE_V]; - plane2 = (uint16_t*)img2->planes[VPX_PLANE_V]; - stride1 = img1->stride[VPX_PLANE_V]/2; - stride2 = img2->stride[VPX_PLANE_V]/2; - for (i = 0, match = 1; match && i < c_h; i += bsizey) { - for (j = 0; match && j < c_w; j += bsizex) { - int k, l; - const int si = mmin(i + bsizey, c_h - i); - const int sj = mmin(j + bsizex, c_w - j); - for (k = 0; match && k < si; ++k) { - for (l = 0; match && l < sj; ++l) { - if (*(plane1 + (i + k) * stride1 + j + l) != - *(plane2 + (i + k) * stride2 + j + l)) { - vloc[0] = i + k; - vloc[1] = j + l; - vloc[2] = *(plane1 + (i + k) * stride1 + j + l); - vloc[3] = *(plane2 + (i + k) * stride2 + j + l); - match = 0; - break; - } - } - } - } - } -} -#endif - -static void find_mismatch(const vpx_image_t *const img1, - const vpx_image_t *const img2, - int yloc[4], int uloc[4], int vloc[4]) { - const uint32_t bsize = 64; - const uint32_t bsizey = bsize >> img1->y_chroma_shift; - const uint32_t bsizex = bsize >> img1->x_chroma_shift; - const uint32_t c_w = - (img1->d_w + img1->x_chroma_shift) >> img1->x_chroma_shift; - const uint32_t c_h = - (img1->d_h + img1->y_chroma_shift) >> img1->y_chroma_shift; - int match = 1; - uint32_t i, j; - yloc[0] = yloc[1] = yloc[2] = yloc[3] = -1; - for (i = 0, match = 1; match && i < img1->d_h; i += bsize) { - for (j = 0; match && j < img1->d_w; j += bsize) { - int k, l; - const int si = mmin(i + bsize, img1->d_h) - i; - const int sj = mmin(j + bsize, img1->d_w) - j; - for (k = 0; match && k < si; ++k) { - for (l = 0; match && l < sj; ++l) { - if (*(img1->planes[VPX_PLANE_Y] + - (i + k) * img1->stride[VPX_PLANE_Y] + j + l) != - *(img2->planes[VPX_PLANE_Y] + - (i + k) * img2->stride[VPX_PLANE_Y] + j + l)) { - yloc[0] = i + k; - yloc[1] = j + l; - yloc[2] = *(img1->planes[VPX_PLANE_Y] + - (i + k) * img1->stride[VPX_PLANE_Y] + j + l); - yloc[3] = *(img2->planes[VPX_PLANE_Y] + - (i + k) * img2->stride[VPX_PLANE_Y] + j + l); - match = 0; - break; - } - } - } - } - } - - uloc[0] = uloc[1] = uloc[2] = uloc[3] = -1; - for (i = 0, match = 1; match && i < c_h; i += bsizey) { - for (j = 0; match && j < c_w; j += bsizex) { - int k, l; - const int si = mmin(i + bsizey, c_h - i); - const int sj = mmin(j + bsizex, c_w - j); - for (k = 0; match && k < si; ++k) { - for (l = 0; match && l < sj; ++l) { - if (*(img1->planes[VPX_PLANE_U] + - (i + k) * img1->stride[VPX_PLANE_U] + j + l) != - *(img2->planes[VPX_PLANE_U] + - (i + k) * img2->stride[VPX_PLANE_U] + j + l)) { - uloc[0] = i + k; - uloc[1] = j + l; - uloc[2] = *(img1->planes[VPX_PLANE_U] + - (i + k) * img1->stride[VPX_PLANE_U] + j + l); - uloc[3] = *(img2->planes[VPX_PLANE_U] + - (i + k) * img2->stride[VPX_PLANE_U] + j + l); - match = 0; - break; - } - } - } - } - } - vloc[0] = vloc[1] = vloc[2] = vloc[3] = -1; - for (i = 0, match = 1; match && i < c_h; i += bsizey) { - for (j = 0; match && j < c_w; j += bsizex) { - int k, l; - const int si = mmin(i + bsizey, c_h - i); - const int sj = mmin(j + bsizex, c_w - j); - for (k = 0; match && k < si; ++k) { - for (l = 0; match && l < sj; ++l) { - if (*(img1->planes[VPX_PLANE_V] + - (i + k) * img1->stride[VPX_PLANE_V] + j + l) != - *(img2->planes[VPX_PLANE_V] + - (i + k) * img2->stride[VPX_PLANE_V] + j + l)) { - vloc[0] = i + k; - vloc[1] = j + l; - vloc[2] = *(img1->planes[VPX_PLANE_V] + - (i + k) * img1->stride[VPX_PLANE_V] + j + l); - vloc[3] = *(img2->planes[VPX_PLANE_V] + - (i + k) * img2->stride[VPX_PLANE_V] + j + l); - match = 0; - break; - } - } - } - } - } -} - -static int compare_img(const vpx_image_t *const img1, - const vpx_image_t *const img2) { - uint32_t l_w = img1->d_w; - uint32_t c_w = - (img1->d_w + img1->x_chroma_shift) >> img1->x_chroma_shift; - const uint32_t c_h = - (img1->d_h + img1->y_chroma_shift) >> img1->y_chroma_shift; - uint32_t i; - int match = 1; - - match &= (img1->fmt == img2->fmt); - match &= (img1->d_w == img2->d_w); - match &= (img1->d_h == img2->d_h); -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - if (img1->fmt & VPX_IMG_FMT_HIGHBITDEPTH) { - l_w *= 2; - c_w *= 2; - } -#endif - - for (i = 0; i < img1->d_h; ++i) - match &= (memcmp(img1->planes[VPX_PLANE_Y] + i * img1->stride[VPX_PLANE_Y], - img2->planes[VPX_PLANE_Y] + i * img2->stride[VPX_PLANE_Y], - l_w) == 0); - - for (i = 0; i < c_h; ++i) - match &= (memcmp(img1->planes[VPX_PLANE_U] + i * img1->stride[VPX_PLANE_U], - img2->planes[VPX_PLANE_U] + i * img2->stride[VPX_PLANE_U], - c_w) == 0); - - for (i = 0; i < c_h; ++i) - match &= (memcmp(img1->planes[VPX_PLANE_V] + i * img1->stride[VPX_PLANE_V], - img2->planes[VPX_PLANE_V] + i * img2->stride[VPX_PLANE_V], - c_w) == 0); - - return match; -} - - -#define NELEMENTS(x) (sizeof(x)/sizeof(x[0])) -#define MAX(x,y) ((x)>(y)?(x):(y)) -#if CONFIG_VP8_ENCODER && !CONFIG_VP9_ENCODER -#define ARG_CTRL_CNT_MAX NELEMENTS(vp8_arg_ctrl_map) -#elif !CONFIG_VP8_ENCODER && CONFIG_VP9_ENCODER -#define ARG_CTRL_CNT_MAX NELEMENTS(vp9_arg_ctrl_map) -#else -#define ARG_CTRL_CNT_MAX MAX(NELEMENTS(vp8_arg_ctrl_map), \ - NELEMENTS(vp9_arg_ctrl_map)) -#endif - -#if !CONFIG_WEBM_IO -typedef int stereo_format_t; -struct EbmlGlobal { int debug; }; -#endif - -/* Per-stream configuration */ -struct stream_config { - struct vpx_codec_enc_cfg cfg; - const char *out_fn; - const char *stats_fn; -#if CONFIG_FP_MB_STATS - const char *fpmb_stats_fn; -#endif - stereo_format_t stereo_fmt; - int arg_ctrls[ARG_CTRL_CNT_MAX][2]; - int arg_ctrl_cnt; - int write_webm; - int have_kf_max_dist; -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - // whether to use 16bit internal buffers - int use_16bit_internal; -#endif -}; - - -struct stream_state { - int index; - struct stream_state *next; - struct stream_config config; - FILE *file; - struct rate_hist *rate_hist; - struct EbmlGlobal ebml; - uint64_t psnr_sse_total; - uint64_t psnr_samples_total; - double psnr_totals[4]; - int psnr_count; - int counts[64]; - vpx_codec_ctx_t encoder; - unsigned int frames_out; - uint64_t cx_time; - size_t nbytes; - stats_io_t stats; -#if CONFIG_FP_MB_STATS - stats_io_t fpmb_stats; -#endif - struct vpx_image *img; - vpx_codec_ctx_t decoder; - int mismatch_seen; -}; - - -void validate_positive_rational(const char *msg, - struct vpx_rational *rat) { - if (rat->den < 0) { - rat->num *= -1; - rat->den *= -1; - } - - if (rat->num < 0) - die("Error: %s must be positive\n", msg); - - if (!rat->den) - die("Error: %s has zero denominator\n", msg); -} - - -static void parse_global_config(struct VpxEncoderConfig *global, char **argv) { - char **argi, **argj; - struct arg arg; - - /* Initialize default parameters */ - memset(global, 0, sizeof(*global)); - global->codec = get_vpx_encoder_by_index(0); - global->passes = 0; - global->color_type = I420; - /* Assign default deadline to good quality */ - global->deadline = VPX_DL_GOOD_QUALITY; - - for (argi = argj = argv; (*argj = *argi); argi += arg.argv_step) { - arg.argv_step = 1; - - if (arg_match(&arg, &codecarg, argi)) { - global->codec = get_vpx_encoder_by_name(arg.val); - if (!global->codec) - die("Error: Unrecognized argument (%s) to --codec\n", arg.val); - } else if (arg_match(&arg, &passes, argi)) { - global->passes = arg_parse_uint(&arg); - - if (global->passes < 1 || global->passes > 2) - die("Error: Invalid number of passes (%d)\n", global->passes); - } else if (arg_match(&arg, &pass_arg, argi)) { - global->pass = arg_parse_uint(&arg); - - if (global->pass < 1 || global->pass > 2) - die("Error: Invalid pass selected (%d)\n", - global->pass); - } else if (arg_match(&arg, &usage, argi)) - global->usage = arg_parse_uint(&arg); - else if (arg_match(&arg, &deadline, argi)) - global->deadline = arg_parse_uint(&arg); - else if (arg_match(&arg, &best_dl, argi)) - global->deadline = VPX_DL_BEST_QUALITY; - else if (arg_match(&arg, &good_dl, argi)) - global->deadline = VPX_DL_GOOD_QUALITY; - else if (arg_match(&arg, &rt_dl, argi)) - global->deadline = VPX_DL_REALTIME; - else if (arg_match(&arg, &use_yv12, argi)) - global->color_type = YV12; - else if (arg_match(&arg, &use_i420, argi)) - global->color_type = I420; - else if (arg_match(&arg, &use_i422, argi)) - global->color_type = I422; - else if (arg_match(&arg, &use_i444, argi)) - global->color_type = I444; - else if (arg_match(&arg, &use_i440, argi)) - global->color_type = I440; - else if (arg_match(&arg, &quietarg, argi)) - global->quiet = 1; - else if (arg_match(&arg, &verbosearg, argi)) - global->verbose = 1; - else if (arg_match(&arg, &limit, argi)) - global->limit = arg_parse_uint(&arg); - else if (arg_match(&arg, &skip, argi)) - global->skip_frames = arg_parse_uint(&arg); - else if (arg_match(&arg, &psnrarg, argi)) - global->show_psnr = 1; - else if (arg_match(&arg, &recontest, argi)) - global->test_decode = arg_parse_enum_or_int(&arg); - else if (arg_match(&arg, &framerate, argi)) { - global->framerate = arg_parse_rational(&arg); - validate_positive_rational(arg.name, &global->framerate); - global->have_framerate = 1; - } else if (arg_match(&arg, &out_part, argi)) - global->out_part = 1; - else if (arg_match(&arg, &debugmode, argi)) - global->debug = 1; - else if (arg_match(&arg, &q_hist_n, argi)) - global->show_q_hist_buckets = arg_parse_uint(&arg); - else if (arg_match(&arg, &rate_hist_n, argi)) - global->show_rate_hist_buckets = arg_parse_uint(&arg); - else if (arg_match(&arg, &disable_warnings, argi)) - global->disable_warnings = 1; - else if (arg_match(&arg, &disable_warning_prompt, argi)) - global->disable_warning_prompt = 1; - else - argj++; - } - - if (global->pass) { - /* DWIM: Assume the user meant passes=2 if pass=2 is specified */ - if (global->pass > global->passes) { - warn("Assuming --pass=%d implies --passes=%d\n", - global->pass, global->pass); - global->passes = global->pass; - } - } - /* Validate global config */ - if (global->passes == 0) { -#if CONFIG_VP9_ENCODER - // Make default VP9 passes = 2 until there is a better quality 1-pass - // encoder - if (global->codec != NULL && global->codec->name != NULL) - global->passes = (strcmp(global->codec->name, "vp9") == 0 && - global->deadline != VPX_DL_REALTIME) ? 2 : 1; -#else - global->passes = 1; -#endif - } - - if (global->deadline == VPX_DL_REALTIME && - global->passes > 1) { - warn("Enforcing one-pass encoding in realtime mode\n"); - global->passes = 1; - } -} - - -void open_input_file(struct VpxInputContext *input) { - /* Parse certain options from the input file, if possible */ - input->file = strcmp(input->filename, "-") - ? fopen(input->filename, "rb") : set_binary_mode(stdin); - - if (!input->file) - fatal("Failed to open input file"); - - if (!fseeko(input->file, 0, SEEK_END)) { - /* Input file is seekable. Figure out how long it is, so we can get - * progress info. - */ - input->length = ftello(input->file); - rewind(input->file); - } - - /* For RAW input sources, these bytes will applied on the first frame - * in read_frame(). - */ - input->detect.buf_read = fread(input->detect.buf, 1, 4, input->file); - input->detect.position = 0; - - if (input->detect.buf_read == 4 - && file_is_y4m(input->detect.buf)) { - if (y4m_input_open(&input->y4m, input->file, input->detect.buf, 4, - input->only_i420) >= 0) { - input->file_type = FILE_TYPE_Y4M; - input->width = input->y4m.pic_w; - input->height = input->y4m.pic_h; - input->framerate.numerator = input->y4m.fps_n; - input->framerate.denominator = input->y4m.fps_d; - input->fmt = input->y4m.vpx_fmt; - input->bit_depth = input->y4m.bit_depth; - } else - fatal("Unsupported Y4M stream."); - } else if (input->detect.buf_read == 4 && fourcc_is_ivf(input->detect.buf)) { - fatal("IVF is not supported as input."); - } else { - input->file_type = FILE_TYPE_RAW; - } -} - - -static void close_input_file(struct VpxInputContext *input) { - fclose(input->file); - if (input->file_type == FILE_TYPE_Y4M) - y4m_input_close(&input->y4m); -} - -static struct stream_state *new_stream(struct VpxEncoderConfig *global, - struct stream_state *prev) { - struct stream_state *stream; - - stream = calloc(1, sizeof(*stream)); - if (stream == NULL) { - fatal("Failed to allocate new stream."); - } - - if (prev) { - memcpy(stream, prev, sizeof(*stream)); - stream->index++; - prev->next = stream; - } else { - vpx_codec_err_t res; - - /* Populate encoder configuration */ - res = vpx_codec_enc_config_default(global->codec->codec_interface(), - &stream->config.cfg, - global->usage); - if (res) - fatal("Failed to get config: %s\n", vpx_codec_err_to_string(res)); - - /* Change the default timebase to a high enough value so that the - * encoder will always create strictly increasing timestamps. - */ - stream->config.cfg.g_timebase.den = 1000; - - /* Never use the library's default resolution, require it be parsed - * from the file or set on the command line. - */ - stream->config.cfg.g_w = 0; - stream->config.cfg.g_h = 0; - - /* Initialize remaining stream parameters */ - stream->config.write_webm = 1; -#if CONFIG_WEBM_IO - stream->config.stereo_fmt = STEREO_FORMAT_MONO; - stream->ebml.last_pts_ns = -1; - stream->ebml.writer = NULL; - stream->ebml.segment = NULL; -#endif - - /* Allows removal of the application version from the EBML tags */ - stream->ebml.debug = global->debug; - - /* Default lag_in_frames is 0 in realtime mode */ - if (global->deadline == VPX_DL_REALTIME) - stream->config.cfg.g_lag_in_frames = 0; - } - - /* Output files must be specified for each stream */ - stream->config.out_fn = NULL; - - stream->next = NULL; - return stream; -} - - -static int parse_stream_params(struct VpxEncoderConfig *global, - struct stream_state *stream, - char **argv) { - char **argi, **argj; - struct arg arg; - static const arg_def_t **ctrl_args = no_args; - static const int *ctrl_args_map = NULL; - struct stream_config *config = &stream->config; - int eos_mark_found = 0; -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - int test_16bit_internal = 0; -#endif - - // Handle codec specific options - if (0) { -#if CONFIG_VP8_ENCODER - } else if (strcmp(global->codec->name, "vp8") == 0) { - ctrl_args = vp8_args; - ctrl_args_map = vp8_arg_ctrl_map; -#endif -#if CONFIG_VP9_ENCODER - } else if (strcmp(global->codec->name, "vp9") == 0) { - ctrl_args = vp9_args; - ctrl_args_map = vp9_arg_ctrl_map; -#endif - } - - for (argi = argj = argv; (*argj = *argi); argi += arg.argv_step) { - arg.argv_step = 1; - - /* Once we've found an end-of-stream marker (--) we want to continue - * shifting arguments but not consuming them. - */ - if (eos_mark_found) { - argj++; - continue; - } else if (!strcmp(*argj, "--")) { - eos_mark_found = 1; - continue; - } - - if (arg_match(&arg, &outputfile, argi)) { - config->out_fn = arg.val; - } else if (arg_match(&arg, &fpf_name, argi)) { - config->stats_fn = arg.val; -#if CONFIG_FP_MB_STATS - } else if (arg_match(&arg, &fpmbf_name, argi)) { - config->fpmb_stats_fn = arg.val; -#endif - } else if (arg_match(&arg, &use_webm, argi)) { -#if CONFIG_WEBM_IO - config->write_webm = 1; -#else - die("Error: --webm specified but webm is disabled."); -#endif - } else if (arg_match(&arg, &use_ivf, argi)) { - config->write_webm = 0; - } else if (arg_match(&arg, &threads, argi)) { - config->cfg.g_threads = arg_parse_uint(&arg); - } else if (arg_match(&arg, &profile, argi)) { - config->cfg.g_profile = arg_parse_uint(&arg); - } else if (arg_match(&arg, &width, argi)) { - config->cfg.g_w = arg_parse_uint(&arg); - } else if (arg_match(&arg, &height, argi)) { - config->cfg.g_h = arg_parse_uint(&arg); -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - } else if (arg_match(&arg, &bitdeptharg, argi)) { - config->cfg.g_bit_depth = arg_parse_enum_or_int(&arg); - } else if (arg_match(&arg, &inbitdeptharg, argi)) { - config->cfg.g_input_bit_depth = arg_parse_uint(&arg); -#endif -#if CONFIG_WEBM_IO - } else if (arg_match(&arg, &stereo_mode, argi)) { - config->stereo_fmt = arg_parse_enum_or_int(&arg); -#endif - } else if (arg_match(&arg, &timebase, argi)) { - config->cfg.g_timebase = arg_parse_rational(&arg); - validate_positive_rational(arg.name, &config->cfg.g_timebase); - } else if (arg_match(&arg, &error_resilient, argi)) { - config->cfg.g_error_resilient = arg_parse_uint(&arg); - } else if (arg_match(&arg, &lag_in_frames, argi)) { - config->cfg.g_lag_in_frames = arg_parse_uint(&arg); - if (global->deadline == VPX_DL_REALTIME && - config->cfg.g_lag_in_frames != 0) { - warn("non-zero %s option ignored in realtime mode.\n", arg.name); - config->cfg.g_lag_in_frames = 0; - } - } else if (arg_match(&arg, &dropframe_thresh, argi)) { - config->cfg.rc_dropframe_thresh = arg_parse_uint(&arg); - } else if (arg_match(&arg, &resize_allowed, argi)) { - config->cfg.rc_resize_allowed = arg_parse_uint(&arg); - } else if (arg_match(&arg, &resize_width, argi)) { - config->cfg.rc_scaled_width = arg_parse_uint(&arg); - } else if (arg_match(&arg, &resize_height, argi)) { - config->cfg.rc_scaled_height = arg_parse_uint(&arg); - } else if (arg_match(&arg, &resize_up_thresh, argi)) { - config->cfg.rc_resize_up_thresh = arg_parse_uint(&arg); - } else if (arg_match(&arg, &resize_down_thresh, argi)) { - config->cfg.rc_resize_down_thresh = arg_parse_uint(&arg); - } else if (arg_match(&arg, &end_usage, argi)) { - config->cfg.rc_end_usage = arg_parse_enum_or_int(&arg); - } else if (arg_match(&arg, &target_bitrate, argi)) { - config->cfg.rc_target_bitrate = arg_parse_uint(&arg); - } else if (arg_match(&arg, &min_quantizer, argi)) { - config->cfg.rc_min_quantizer = arg_parse_uint(&arg); - } else if (arg_match(&arg, &max_quantizer, argi)) { - config->cfg.rc_max_quantizer = arg_parse_uint(&arg); - } else if (arg_match(&arg, &undershoot_pct, argi)) { - config->cfg.rc_undershoot_pct = arg_parse_uint(&arg); - } else if (arg_match(&arg, &overshoot_pct, argi)) { - config->cfg.rc_overshoot_pct = arg_parse_uint(&arg); - } else if (arg_match(&arg, &buf_sz, argi)) { - config->cfg.rc_buf_sz = arg_parse_uint(&arg); - } else if (arg_match(&arg, &buf_initial_sz, argi)) { - config->cfg.rc_buf_initial_sz = arg_parse_uint(&arg); - } else if (arg_match(&arg, &buf_optimal_sz, argi)) { - config->cfg.rc_buf_optimal_sz = arg_parse_uint(&arg); - } else if (arg_match(&arg, &bias_pct, argi)) { - config->cfg.rc_2pass_vbr_bias_pct = arg_parse_uint(&arg); - if (global->passes < 2) - warn("option %s ignored in one-pass mode.\n", arg.name); - } else if (arg_match(&arg, &minsection_pct, argi)) { - config->cfg.rc_2pass_vbr_minsection_pct = arg_parse_uint(&arg); - - if (global->passes < 2) - warn("option %s ignored in one-pass mode.\n", arg.name); - } else if (arg_match(&arg, &maxsection_pct, argi)) { - config->cfg.rc_2pass_vbr_maxsection_pct = arg_parse_uint(&arg); - - if (global->passes < 2) - warn("option %s ignored in one-pass mode.\n", arg.name); - } else if (arg_match(&arg, &kf_min_dist, argi)) { - config->cfg.kf_min_dist = arg_parse_uint(&arg); - } else if (arg_match(&arg, &kf_max_dist, argi)) { - config->cfg.kf_max_dist = arg_parse_uint(&arg); - config->have_kf_max_dist = 1; - } else if (arg_match(&arg, &kf_disabled, argi)) { - config->cfg.kf_mode = VPX_KF_DISABLED; -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - } else if (arg_match(&arg, &test16bitinternalarg, argi)) { - if (strcmp(global->codec->name, "vp9") == 0) { - test_16bit_internal = 1; - } -#endif - } else { - int i, match = 0; - for (i = 0; ctrl_args[i]; i++) { - if (arg_match(&arg, ctrl_args[i], argi)) { - int j; - match = 1; - - /* Point either to the next free element or the first - * instance of this control. - */ - for (j = 0; j < config->arg_ctrl_cnt; j++) - if (ctrl_args_map != NULL && - config->arg_ctrls[j][0] == ctrl_args_map[i]) - break; - - /* Update/insert */ - assert(j < (int)ARG_CTRL_CNT_MAX); - if (ctrl_args_map != NULL && j < (int)ARG_CTRL_CNT_MAX) { - config->arg_ctrls[j][0] = ctrl_args_map[i]; - config->arg_ctrls[j][1] = arg_parse_enum_or_int(&arg); - if (j == config->arg_ctrl_cnt) - config->arg_ctrl_cnt++; - } - } - } - if (!match) - argj++; - } - } -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - if (strcmp(global->codec->name, "vp9") == 0) { - config->use_16bit_internal = test_16bit_internal | - (config->cfg.g_profile > 1); - } -#endif - return eos_mark_found; -} - - -#define FOREACH_STREAM(func) \ - do { \ - struct stream_state *stream; \ - for (stream = streams; stream; stream = stream->next) { \ - func; \ - } \ - } while (0) - - -static void validate_stream_config(const struct stream_state *stream, - const struct VpxEncoderConfig *global) { - const struct stream_state *streami; - (void)global; - - if (!stream->config.cfg.g_w || !stream->config.cfg.g_h) - fatal("Stream %d: Specify stream dimensions with --width (-w) " - " and --height (-h)", stream->index); - - // Check that the codec bit depth is greater than the input bit depth. - if (stream->config.cfg.g_input_bit_depth > - (unsigned int)stream->config.cfg.g_bit_depth) { - fatal("Stream %d: codec bit depth (%d) less than input bit depth (%d)", - stream->index, (int)stream->config.cfg.g_bit_depth, - stream->config.cfg.g_input_bit_depth); - } - - for (streami = stream; streami; streami = streami->next) { - /* All streams require output files */ - if (!streami->config.out_fn) - fatal("Stream %d: Output file is required (specify with -o)", - streami->index); - - /* Check for two streams outputting to the same file */ - if (streami != stream) { - const char *a = stream->config.out_fn; - const char *b = streami->config.out_fn; - if (!strcmp(a, b) && strcmp(a, "/dev/null") && strcmp(a, ":nul")) - fatal("Stream %d: duplicate output file (from stream %d)", - streami->index, stream->index); - } - - /* Check for two streams sharing a stats file. */ - if (streami != stream) { - const char *a = stream->config.stats_fn; - const char *b = streami->config.stats_fn; - if (a && b && !strcmp(a, b)) - fatal("Stream %d: duplicate stats file (from stream %d)", - streami->index, stream->index); - } - -#if CONFIG_FP_MB_STATS - /* Check for two streams sharing a mb stats file. */ - if (streami != stream) { - const char *a = stream->config.fpmb_stats_fn; - const char *b = streami->config.fpmb_stats_fn; - if (a && b && !strcmp(a, b)) - fatal("Stream %d: duplicate mb stats file (from stream %d)", - streami->index, stream->index); - } -#endif - } -} - - -static void set_stream_dimensions(struct stream_state *stream, - unsigned int w, - unsigned int h) { - if (!stream->config.cfg.g_w) { - if (!stream->config.cfg.g_h) - stream->config.cfg.g_w = w; - else - stream->config.cfg.g_w = w * stream->config.cfg.g_h / h; - } - if (!stream->config.cfg.g_h) { - stream->config.cfg.g_h = h * stream->config.cfg.g_w / w; - } -} - - -static void set_default_kf_interval(struct stream_state *stream, - struct VpxEncoderConfig *global) { - /* Use a max keyframe interval of 5 seconds, if none was - * specified on the command line. - */ - if (!stream->config.have_kf_max_dist) { - double framerate = (double)global->framerate.num / global->framerate.den; - if (framerate > 0.0) - stream->config.cfg.kf_max_dist = (unsigned int)(5.0 * framerate); - } -} - -static const char* file_type_to_string(enum VideoFileType t) { - switch (t) { - case FILE_TYPE_RAW: return "RAW"; - case FILE_TYPE_Y4M: return "Y4M"; - default: return "Other"; - } -} - -static const char* image_format_to_string(vpx_img_fmt_t f) { - switch (f) { - case VPX_IMG_FMT_I420: return "I420"; - case VPX_IMG_FMT_I422: return "I422"; - case VPX_IMG_FMT_I444: return "I444"; - case VPX_IMG_FMT_I440: return "I440"; - case VPX_IMG_FMT_YV12: return "YV12"; - case VPX_IMG_FMT_I42016: return "I42016"; - case VPX_IMG_FMT_I42216: return "I42216"; - case VPX_IMG_FMT_I44416: return "I44416"; - case VPX_IMG_FMT_I44016: return "I44016"; - default: return "Other"; - } -} - -static void show_stream_config(struct stream_state *stream, - struct VpxEncoderConfig *global, - struct VpxInputContext *input) { - -#define SHOW(field) \ - fprintf(stderr, " %-28s = %d\n", #field, stream->config.cfg.field) - - if (stream->index == 0) { - fprintf(stderr, "Codec: %s\n", - vpx_codec_iface_name(global->codec->codec_interface())); - fprintf(stderr, "Source file: %s File Type: %s Format: %s\n", - input->filename, - file_type_to_string(input->file_type), - image_format_to_string(input->fmt)); - } - if (stream->next || stream->index) - fprintf(stderr, "\nStream Index: %d\n", stream->index); - fprintf(stderr, "Destination file: %s\n", stream->config.out_fn); - fprintf(stderr, "Encoder parameters:\n"); - - SHOW(g_usage); - SHOW(g_threads); - SHOW(g_profile); - SHOW(g_w); - SHOW(g_h); - SHOW(g_bit_depth); - SHOW(g_input_bit_depth); - SHOW(g_timebase.num); - SHOW(g_timebase.den); - SHOW(g_error_resilient); - SHOW(g_pass); - SHOW(g_lag_in_frames); - SHOW(rc_dropframe_thresh); - SHOW(rc_resize_allowed); - SHOW(rc_scaled_width); - SHOW(rc_scaled_height); - SHOW(rc_resize_up_thresh); - SHOW(rc_resize_down_thresh); - SHOW(rc_end_usage); - SHOW(rc_target_bitrate); - SHOW(rc_min_quantizer); - SHOW(rc_max_quantizer); - SHOW(rc_undershoot_pct); - SHOW(rc_overshoot_pct); - SHOW(rc_buf_sz); - SHOW(rc_buf_initial_sz); - SHOW(rc_buf_optimal_sz); - SHOW(rc_2pass_vbr_bias_pct); - SHOW(rc_2pass_vbr_minsection_pct); - SHOW(rc_2pass_vbr_maxsection_pct); - SHOW(kf_mode); - SHOW(kf_min_dist); - SHOW(kf_max_dist); -} - - -static void open_output_file(struct stream_state *stream, - struct VpxEncoderConfig *global) { - const char *fn = stream->config.out_fn; - const struct vpx_codec_enc_cfg *const cfg = &stream->config.cfg; - - if (cfg->g_pass == VPX_RC_FIRST_PASS) - return; - - stream->file = strcmp(fn, "-") ? fopen(fn, "wb") : set_binary_mode(stdout); - - if (!stream->file) - fatal("Failed to open output file"); - - if (stream->config.write_webm && fseek(stream->file, 0, SEEK_CUR)) - fatal("WebM output to pipes not supported."); - -#if CONFIG_WEBM_IO - if (stream->config.write_webm) { - stream->ebml.stream = stream->file; - write_webm_file_header(&stream->ebml, cfg, - &global->framerate, - stream->config.stereo_fmt, - global->codec->fourcc); - } -#endif - - if (!stream->config.write_webm) { - ivf_write_file_header(stream->file, cfg, global->codec->fourcc, 0); - } -} - - -static void close_output_file(struct stream_state *stream, - unsigned int fourcc) { - const struct vpx_codec_enc_cfg *const cfg = &stream->config.cfg; - - if (cfg->g_pass == VPX_RC_FIRST_PASS) - return; - -#if CONFIG_WEBM_IO - if (stream->config.write_webm) { - write_webm_file_footer(&stream->ebml); - } -#endif - - if (!stream->config.write_webm) { - if (!fseek(stream->file, 0, SEEK_SET)) - ivf_write_file_header(stream->file, &stream->config.cfg, - fourcc, - stream->frames_out); - } - - fclose(stream->file); -} - - -static void setup_pass(struct stream_state *stream, - struct VpxEncoderConfig *global, - int pass) { - if (stream->config.stats_fn) { - if (!stats_open_file(&stream->stats, stream->config.stats_fn, - pass)) - fatal("Failed to open statistics store"); - } else { - if (!stats_open_mem(&stream->stats, pass)) - fatal("Failed to open statistics store"); - } - -#if CONFIG_FP_MB_STATS - if (stream->config.fpmb_stats_fn) { - if (!stats_open_file(&stream->fpmb_stats, - stream->config.fpmb_stats_fn, pass)) - fatal("Failed to open mb statistics store"); - } else { - if (!stats_open_mem(&stream->fpmb_stats, pass)) - fatal("Failed to open mb statistics store"); - } -#endif - - stream->config.cfg.g_pass = global->passes == 2 - ? pass ? VPX_RC_LAST_PASS : VPX_RC_FIRST_PASS - : VPX_RC_ONE_PASS; - if (pass) { - stream->config.cfg.rc_twopass_stats_in = stats_get(&stream->stats); -#if CONFIG_FP_MB_STATS - stream->config.cfg.rc_firstpass_mb_stats_in = - stats_get(&stream->fpmb_stats); -#endif - } - - stream->cx_time = 0; - stream->nbytes = 0; - stream->frames_out = 0; -} - - -static void initialize_encoder(struct stream_state *stream, - struct VpxEncoderConfig *global) { - int i; - int flags = 0; - - flags |= global->show_psnr ? VPX_CODEC_USE_PSNR : 0; - flags |= global->out_part ? VPX_CODEC_USE_OUTPUT_PARTITION : 0; -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - flags |= stream->config.use_16bit_internal ? VPX_CODEC_USE_HIGHBITDEPTH : 0; -#endif - - /* Construct Encoder Context */ - vpx_codec_enc_init(&stream->encoder, global->codec->codec_interface(), - &stream->config.cfg, flags); - ctx_exit_on_error(&stream->encoder, "Failed to initialize encoder"); - - /* Note that we bypass the vpx_codec_control wrapper macro because - * we're being clever to store the control IDs in an array. Real - * applications will want to make use of the enumerations directly - */ - for (i = 0; i < stream->config.arg_ctrl_cnt; i++) { - int ctrl = stream->config.arg_ctrls[i][0]; - int value = stream->config.arg_ctrls[i][1]; - if (vpx_codec_control_(&stream->encoder, ctrl, value)) - fprintf(stderr, "Error: Tried to set control %d = %d\n", - ctrl, value); - - ctx_exit_on_error(&stream->encoder, "Failed to control codec"); - } - -#if CONFIG_DECODERS - if (global->test_decode != TEST_DECODE_OFF) { - const VpxInterface *decoder = get_vpx_decoder_by_name(global->codec->name); - vpx_codec_dec_init(&stream->decoder, decoder->codec_interface(), NULL, 0); - } -#endif -} - - -static void encode_frame(struct stream_state *stream, - struct VpxEncoderConfig *global, - struct vpx_image *img, - unsigned int frames_in) { - vpx_codec_pts_t frame_start, next_frame_start; - struct vpx_codec_enc_cfg *cfg = &stream->config.cfg; - struct vpx_usec_timer timer; - - frame_start = (cfg->g_timebase.den * (int64_t)(frames_in - 1) - * global->framerate.den) - / cfg->g_timebase.num / global->framerate.num; - next_frame_start = (cfg->g_timebase.den * (int64_t)(frames_in) - * global->framerate.den) - / cfg->g_timebase.num / global->framerate.num; - - /* Scale if necessary */ -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - if (img) { - if ((img->fmt & VPX_IMG_FMT_HIGHBITDEPTH) && - (img->d_w != cfg->g_w || img->d_h != cfg->g_h)) { - if (img->fmt != VPX_IMG_FMT_I42016) { - fprintf(stderr, "%s can only scale 4:2:0 inputs\n", exec_name); - exit(EXIT_FAILURE); - } -#if CONFIG_LIBYUV - if (!stream->img) { - stream->img = vpx_img_alloc(NULL, VPX_IMG_FMT_I42016, - cfg->g_w, cfg->g_h, 16); - } - I420Scale_16((uint16*)img->planes[VPX_PLANE_Y], - img->stride[VPX_PLANE_Y]/2, - (uint16*)img->planes[VPX_PLANE_U], - img->stride[VPX_PLANE_U]/2, - (uint16*)img->planes[VPX_PLANE_V], - img->stride[VPX_PLANE_V]/2, - img->d_w, img->d_h, - (uint16*)stream->img->planes[VPX_PLANE_Y], - stream->img->stride[VPX_PLANE_Y]/2, - (uint16*)stream->img->planes[VPX_PLANE_U], - stream->img->stride[VPX_PLANE_U]/2, - (uint16*)stream->img->planes[VPX_PLANE_V], - stream->img->stride[VPX_PLANE_V]/2, - stream->img->d_w, stream->img->d_h, - kFilterBox); - img = stream->img; -#else - stream->encoder.err = 1; - ctx_exit_on_error(&stream->encoder, - "Stream %d: Failed to encode frame.\n" - "Scaling disabled in this configuration. \n" - "To enable, configure with --enable-libyuv\n", - stream->index); -#endif - } - } -#endif - if (img && (img->d_w != cfg->g_w || img->d_h != cfg->g_h)) { - if (img->fmt != VPX_IMG_FMT_I420 && img->fmt != VPX_IMG_FMT_YV12) { - fprintf(stderr, "%s can only scale 4:2:0 8bpp inputs\n", exec_name); - exit(EXIT_FAILURE); - } -#if CONFIG_LIBYUV - if (!stream->img) - stream->img = vpx_img_alloc(NULL, VPX_IMG_FMT_I420, - cfg->g_w, cfg->g_h, 16); - I420Scale(img->planes[VPX_PLANE_Y], img->stride[VPX_PLANE_Y], - img->planes[VPX_PLANE_U], img->stride[VPX_PLANE_U], - img->planes[VPX_PLANE_V], img->stride[VPX_PLANE_V], - img->d_w, img->d_h, - stream->img->planes[VPX_PLANE_Y], - stream->img->stride[VPX_PLANE_Y], - stream->img->planes[VPX_PLANE_U], - stream->img->stride[VPX_PLANE_U], - stream->img->planes[VPX_PLANE_V], - stream->img->stride[VPX_PLANE_V], - stream->img->d_w, stream->img->d_h, - kFilterBox); - img = stream->img; -#else - stream->encoder.err = 1; - ctx_exit_on_error(&stream->encoder, - "Stream %d: Failed to encode frame.\n" - "Scaling disabled in this configuration. \n" - "To enable, configure with --enable-libyuv\n", - stream->index); -#endif - } - - vpx_usec_timer_start(&timer); - vpx_codec_encode(&stream->encoder, img, frame_start, - (unsigned long)(next_frame_start - frame_start), - 0, global->deadline); - vpx_usec_timer_mark(&timer); - stream->cx_time += vpx_usec_timer_elapsed(&timer); - ctx_exit_on_error(&stream->encoder, "Stream %d: Failed to encode frame", - stream->index); -} - - -static void update_quantizer_histogram(struct stream_state *stream) { - if (stream->config.cfg.g_pass != VPX_RC_FIRST_PASS) { - int q; - - vpx_codec_control(&stream->encoder, VP8E_GET_LAST_QUANTIZER_64, &q); - ctx_exit_on_error(&stream->encoder, "Failed to read quantizer"); - stream->counts[q]++; - } -} - - -static void get_cx_data(struct stream_state *stream, - struct VpxEncoderConfig *global, - int *got_data) { - const vpx_codec_cx_pkt_t *pkt; - const struct vpx_codec_enc_cfg *cfg = &stream->config.cfg; - vpx_codec_iter_t iter = NULL; - - *got_data = 0; - while ((pkt = vpx_codec_get_cx_data(&stream->encoder, &iter))) { - static size_t fsize = 0; - static int64_t ivf_header_pos = 0; - - switch (pkt->kind) { - case VPX_CODEC_CX_FRAME_PKT: - if (!(pkt->data.frame.flags & VPX_FRAME_IS_FRAGMENT)) { - stream->frames_out++; - } - if (!global->quiet) - fprintf(stderr, " %6luF", (unsigned long)pkt->data.frame.sz); - - update_rate_histogram(stream->rate_hist, cfg, pkt); -#if CONFIG_WEBM_IO - if (stream->config.write_webm) { - write_webm_block(&stream->ebml, cfg, pkt); - } -#endif - if (!stream->config.write_webm) { - if (pkt->data.frame.partition_id <= 0) { - ivf_header_pos = ftello(stream->file); - fsize = pkt->data.frame.sz; - - ivf_write_frame_header(stream->file, pkt->data.frame.pts, fsize); - } else { - fsize += pkt->data.frame.sz; - - if (!(pkt->data.frame.flags & VPX_FRAME_IS_FRAGMENT)) { - const int64_t currpos = ftello(stream->file); - fseeko(stream->file, ivf_header_pos, SEEK_SET); - ivf_write_frame_size(stream->file, fsize); - fseeko(stream->file, currpos, SEEK_SET); - } - } - - (void) fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz, - stream->file); - } - stream->nbytes += pkt->data.raw.sz; - - *got_data = 1; -#if CONFIG_DECODERS - if (global->test_decode != TEST_DECODE_OFF && !stream->mismatch_seen) { - vpx_codec_decode(&stream->decoder, pkt->data.frame.buf, - (unsigned int)pkt->data.frame.sz, NULL, 0); - if (stream->decoder.err) { - warn_or_exit_on_error(&stream->decoder, - global->test_decode == TEST_DECODE_FATAL, - "Failed to decode frame %d in stream %d", - stream->frames_out + 1, stream->index); - stream->mismatch_seen = stream->frames_out + 1; - } - } -#endif - break; - case VPX_CODEC_STATS_PKT: - stream->frames_out++; - stats_write(&stream->stats, - pkt->data.twopass_stats.buf, - pkt->data.twopass_stats.sz); - stream->nbytes += pkt->data.raw.sz; - break; -#if CONFIG_FP_MB_STATS - case VPX_CODEC_FPMB_STATS_PKT: - stats_write(&stream->fpmb_stats, - pkt->data.firstpass_mb_stats.buf, - pkt->data.firstpass_mb_stats.sz); - stream->nbytes += pkt->data.raw.sz; - break; -#endif - case VPX_CODEC_PSNR_PKT: - - if (global->show_psnr) { - int i; - - stream->psnr_sse_total += pkt->data.psnr.sse[0]; - stream->psnr_samples_total += pkt->data.psnr.samples[0]; - for (i = 0; i < 4; i++) { - if (!global->quiet) - fprintf(stderr, "%.3f ", pkt->data.psnr.psnr[i]); - stream->psnr_totals[i] += pkt->data.psnr.psnr[i]; - } - stream->psnr_count++; - } - - break; - default: - break; - } - } -} - - -static void show_psnr(struct stream_state *stream, double peak) { - int i; - double ovpsnr; - - if (!stream->psnr_count) - return; - - fprintf(stderr, "Stream %d PSNR (Overall/Avg/Y/U/V)", stream->index); - ovpsnr = sse_to_psnr((double)stream->psnr_samples_total, peak, - (double)stream->psnr_sse_total); - fprintf(stderr, " %.3f", ovpsnr); - - for (i = 0; i < 4; i++) { - fprintf(stderr, " %.3f", stream->psnr_totals[i] / stream->psnr_count); - } - fprintf(stderr, "\n"); -} - - -static float usec_to_fps(uint64_t usec, unsigned int frames) { - return (float)(usec > 0 ? frames * 1000000.0 / (float)usec : 0); -} - -static void test_decode(struct stream_state *stream, - enum TestDecodeFatality fatal, - const VpxInterface *codec) { - vpx_image_t enc_img, dec_img; - - if (stream->mismatch_seen) - return; - - /* Get the internal reference frame */ - if (strcmp(codec->name, "vp8") == 0) { - struct vpx_ref_frame ref_enc, ref_dec; - int width, height; - - width = (stream->config.cfg.g_w + 15) & ~15; - height = (stream->config.cfg.g_h + 15) & ~15; - vpx_img_alloc(&ref_enc.img, VPX_IMG_FMT_I420, width, height, 1); - enc_img = ref_enc.img; - vpx_img_alloc(&ref_dec.img, VPX_IMG_FMT_I420, width, height, 1); - dec_img = ref_dec.img; - - ref_enc.frame_type = VP8_LAST_FRAME; - ref_dec.frame_type = VP8_LAST_FRAME; - vpx_codec_control(&stream->encoder, VP8_COPY_REFERENCE, &ref_enc); - vpx_codec_control(&stream->decoder, VP8_COPY_REFERENCE, &ref_dec); - } else { - struct vp9_ref_frame ref_enc, ref_dec; - - ref_enc.idx = 0; - ref_dec.idx = 0; - vpx_codec_control(&stream->encoder, VP9_GET_REFERENCE, &ref_enc); - enc_img = ref_enc.img; - vpx_codec_control(&stream->decoder, VP9_GET_REFERENCE, &ref_dec); - dec_img = ref_dec.img; -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - if ((enc_img.fmt & VPX_IMG_FMT_HIGHBITDEPTH) != - (dec_img.fmt & VPX_IMG_FMT_HIGHBITDEPTH)) { - if (enc_img.fmt & VPX_IMG_FMT_HIGHBITDEPTH) { - vpx_img_alloc(&enc_img, enc_img.fmt - VPX_IMG_FMT_HIGHBITDEPTH, - enc_img.d_w, enc_img.d_h, 16); - vpx_img_truncate_16_to_8(&enc_img, &ref_enc.img); - } - if (dec_img.fmt & VPX_IMG_FMT_HIGHBITDEPTH) { - vpx_img_alloc(&dec_img, dec_img.fmt - VPX_IMG_FMT_HIGHBITDEPTH, - dec_img.d_w, dec_img.d_h, 16); - vpx_img_truncate_16_to_8(&dec_img, &ref_dec.img); - } - } -#endif - } - ctx_exit_on_error(&stream->encoder, "Failed to get encoder reference frame"); - ctx_exit_on_error(&stream->decoder, "Failed to get decoder reference frame"); - - if (!compare_img(&enc_img, &dec_img)) { - int y[4], u[4], v[4]; -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - if (enc_img.fmt & VPX_IMG_FMT_HIGHBITDEPTH) { - find_mismatch_high(&enc_img, &dec_img, y, u, v); - } else { - find_mismatch(&enc_img, &dec_img, y, u, v); - } -#else - find_mismatch(&enc_img, &dec_img, y, u, v); -#endif - stream->decoder.err = 1; - warn_or_exit_on_error(&stream->decoder, fatal == TEST_DECODE_FATAL, - "Stream %d: Encode/decode mismatch on frame %d at" - " Y[%d, %d] {%d/%d}," - " U[%d, %d] {%d/%d}," - " V[%d, %d] {%d/%d}", - stream->index, stream->frames_out, - y[0], y[1], y[2], y[3], - u[0], u[1], u[2], u[3], - v[0], v[1], v[2], v[3]); - stream->mismatch_seen = stream->frames_out; - } - - vpx_img_free(&enc_img); - vpx_img_free(&dec_img); -} - - -static void print_time(const char *label, int64_t etl) { - int64_t hours; - int64_t mins; - int64_t secs; - - if (etl >= 0) { - hours = etl / 3600; - etl -= hours * 3600; - mins = etl / 60; - etl -= mins * 60; - secs = etl; - - fprintf(stderr, "[%3s %2"PRId64":%02"PRId64":%02"PRId64"] ", - label, hours, mins, secs); - } else { - fprintf(stderr, "[%3s unknown] ", label); - } -} - - -int main(int argc, const char **argv_) { - int pass; - vpx_image_t raw; -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - vpx_image_t raw_shift; - int allocated_raw_shift = 0; - int use_16bit_internal = 0; - int input_shift = 0; -#endif - int frame_avail, got_data; - - struct VpxInputContext input; - struct VpxEncoderConfig global; - struct stream_state *streams = NULL; - char **argv, **argi; - uint64_t cx_time = 0; - int stream_cnt = 0; - int res = 0; - - memset(&input, 0, sizeof(input)); - exec_name = argv_[0]; - - if (argc < 3) - usage_exit(); - - /* Setup default input stream settings */ - input.framerate.numerator = 30; - input.framerate.denominator = 1; - input.only_i420 = 1; - input.bit_depth = 0; - - /* First parse the global configuration values, because we want to apply - * other parameters on top of the default configuration provided by the - * codec. - */ - argv = argv_dup(argc - 1, argv_ + 1); - parse_global_config(&global, argv); - - switch (global.color_type) { - case I420: - input.fmt = VPX_IMG_FMT_I420; - break; - case I422: - input.fmt = VPX_IMG_FMT_I422; - break; - case I444: - input.fmt = VPX_IMG_FMT_I444; - break; - case I440: - input.fmt = VPX_IMG_FMT_I440; - break; - case YV12: - input.fmt = VPX_IMG_FMT_YV12; - break; - } - - { - /* Now parse each stream's parameters. Using a local scope here - * due to the use of 'stream' as loop variable in FOREACH_STREAM - * loops - */ - struct stream_state *stream = NULL; - - do { - stream = new_stream(&global, stream); - stream_cnt++; - if (!streams) - streams = stream; - } while (parse_stream_params(&global, stream, argv)); - } - - /* Check for unrecognized options */ - for (argi = argv; *argi; argi++) - if (argi[0][0] == '-' && argi[0][1]) - die("Error: Unrecognized option %s\n", *argi); - - FOREACH_STREAM(check_encoder_config(global.disable_warning_prompt, - &global, &stream->config.cfg);); - - /* Handle non-option arguments */ - input.filename = argv[0]; - - if (!input.filename) - usage_exit(); - - /* Decide if other chroma subsamplings than 4:2:0 are supported */ - if (global.codec->fourcc == VP9_FOURCC) - input.only_i420 = 0; - - for (pass = global.pass ? global.pass - 1 : 0; pass < global.passes; pass++) { - int frames_in = 0, seen_frames = 0; - int64_t estimated_time_left = -1; - int64_t average_rate = -1; - int64_t lagged_count = 0; - - open_input_file(&input); - - /* If the input file doesn't specify its w/h (raw files), try to get - * the data from the first stream's configuration. - */ - if (!input.width || !input.height) { - FOREACH_STREAM({ - if (stream->config.cfg.g_w && stream->config.cfg.g_h) { - input.width = stream->config.cfg.g_w; - input.height = stream->config.cfg.g_h; - break; - } - }); - } - - /* Update stream configurations from the input file's parameters */ - if (!input.width || !input.height) - fatal("Specify stream dimensions with --width (-w) " - " and --height (-h)"); - - /* If input file does not specify bit-depth but input-bit-depth parameter - * exists, assume that to be the input bit-depth. However, if the - * input-bit-depth paramter does not exist, assume the input bit-depth - * to be the same as the codec bit-depth. - */ - if (!input.bit_depth) { - FOREACH_STREAM({ - if (stream->config.cfg.g_input_bit_depth) - input.bit_depth = stream->config.cfg.g_input_bit_depth; - else - input.bit_depth = stream->config.cfg.g_input_bit_depth = - (int)stream->config.cfg.g_bit_depth; - }); - if (input.bit_depth > 8) input.fmt |= VPX_IMG_FMT_HIGHBITDEPTH; - } else { - FOREACH_STREAM({ - stream->config.cfg.g_input_bit_depth = input.bit_depth; - }); - } - - FOREACH_STREAM(set_stream_dimensions(stream, input.width, input.height)); - FOREACH_STREAM(validate_stream_config(stream, &global)); - - /* Ensure that --passes and --pass are consistent. If --pass is set and - * --passes=2, ensure --fpf was set. - */ - if (global.pass && global.passes == 2) - FOREACH_STREAM( { - if (!stream->config.stats_fn) - die("Stream %d: Must specify --fpf when --pass=%d" - " and --passes=2\n", stream->index, global.pass); - }); - -#if !CONFIG_WEBM_IO - FOREACH_STREAM({ - stream->config.write_webm = 0; - warn("vpxenc was compiled without WebM container support." - "Producing IVF output"); - }); -#endif - - /* Use the frame rate from the file only if none was specified - * on the command-line. - */ - if (!global.have_framerate) { - global.framerate.num = input.framerate.numerator; - global.framerate.den = input.framerate.denominator; - } - - FOREACH_STREAM(set_default_kf_interval(stream, &global)); - - /* Show configuration */ - if (global.verbose && pass == 0) - FOREACH_STREAM(show_stream_config(stream, &global, &input)); - - if (pass == (global.pass ? global.pass - 1 : 0)) { - if (input.file_type == FILE_TYPE_Y4M) - /*The Y4M reader does its own allocation. - Just initialize this here to avoid problems if we never read any - frames.*/ - memset(&raw, 0, sizeof(raw)); - else - vpx_img_alloc(&raw, input.fmt, input.width, input.height, 32); - - FOREACH_STREAM(stream->rate_hist = - init_rate_histogram(&stream->config.cfg, - &global.framerate)); - } - - FOREACH_STREAM(setup_pass(stream, &global, pass)); - FOREACH_STREAM(open_output_file(stream, &global)); - FOREACH_STREAM(initialize_encoder(stream, &global)); - -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - if (strcmp(global.codec->name, "vp9") == 0) { - // Check to see if at least one stream uses 16 bit internal. - // Currently assume that the bit_depths for all streams using - // highbitdepth are the same. - FOREACH_STREAM({ - if (stream->config.use_16bit_internal) { - use_16bit_internal = 1; - } - if (stream->config.cfg.g_profile == 0) { - input_shift = 0; - } else { - input_shift = (int)stream->config.cfg.g_bit_depth - - stream->config.cfg.g_input_bit_depth; - } - }); - } -#endif - - frame_avail = 1; - got_data = 0; - - while (frame_avail || got_data) { - struct vpx_usec_timer timer; - - if (!global.limit || frames_in < global.limit) { - frame_avail = read_frame(&input, &raw); - - if (frame_avail) - frames_in++; - seen_frames = frames_in > global.skip_frames ? - frames_in - global.skip_frames : 0; - - if (!global.quiet) { - float fps = usec_to_fps(cx_time, seen_frames); - fprintf(stderr, "\rPass %d/%d ", pass + 1, global.passes); - - if (stream_cnt == 1) - fprintf(stderr, - "frame %4d/%-4d %7"PRId64"B ", - frames_in, streams->frames_out, (int64_t)streams->nbytes); - else - fprintf(stderr, "frame %4d ", frames_in); - - fprintf(stderr, "%7"PRId64" %s %.2f %s ", - cx_time > 9999999 ? cx_time / 1000 : cx_time, - cx_time > 9999999 ? "ms" : "us", - fps >= 1.0 ? fps : fps * 60, - fps >= 1.0 ? "fps" : "fpm"); - print_time("ETA", estimated_time_left); - } - - } else - frame_avail = 0; - - if (frames_in > global.skip_frames) { -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - vpx_image_t *frame_to_encode; - if (input_shift || (use_16bit_internal && input.bit_depth == 8)) { - assert(use_16bit_internal); - // Input bit depth and stream bit depth do not match, so up - // shift frame to stream bit depth - if (!allocated_raw_shift) { - vpx_img_alloc(&raw_shift, raw.fmt | VPX_IMG_FMT_HIGHBITDEPTH, - input.width, input.height, 32); - allocated_raw_shift = 1; - } - vpx_img_upshift(&raw_shift, &raw, input_shift); - frame_to_encode = &raw_shift; - } else { - frame_to_encode = &raw; - } - vpx_usec_timer_start(&timer); - if (use_16bit_internal) { - assert(frame_to_encode->fmt & VPX_IMG_FMT_HIGHBITDEPTH); - FOREACH_STREAM({ - if (stream->config.use_16bit_internal) - encode_frame(stream, &global, - frame_avail ? frame_to_encode : NULL, - frames_in); - else - assert(0); - }); - } else { - assert((frame_to_encode->fmt & VPX_IMG_FMT_HIGHBITDEPTH) == 0); - FOREACH_STREAM(encode_frame(stream, &global, - frame_avail ? frame_to_encode : NULL, - frames_in)); - } -#else - vpx_usec_timer_start(&timer); - FOREACH_STREAM(encode_frame(stream, &global, - frame_avail ? &raw : NULL, - frames_in)); -#endif - vpx_usec_timer_mark(&timer); - cx_time += vpx_usec_timer_elapsed(&timer); - - FOREACH_STREAM(update_quantizer_histogram(stream)); - - got_data = 0; - FOREACH_STREAM(get_cx_data(stream, &global, &got_data)); - - if (!got_data && input.length && streams != NULL && - !streams->frames_out) { - lagged_count = global.limit ? seen_frames : ftello(input.file); - } else if (input.length) { - int64_t remaining; - int64_t rate; - - if (global.limit) { - const int64_t frame_in_lagged = (seen_frames - lagged_count) * 1000; - - rate = cx_time ? frame_in_lagged * (int64_t)1000000 / cx_time : 0; - remaining = 1000 * (global.limit - global.skip_frames - - seen_frames + lagged_count); - } else { - const int64_t input_pos = ftello(input.file); - const int64_t input_pos_lagged = input_pos - lagged_count; - const int64_t limit = input.length; - - rate = cx_time ? input_pos_lagged * (int64_t)1000000 / cx_time : 0; - remaining = limit - input_pos + lagged_count; - } - - average_rate = (average_rate <= 0) - ? rate - : (average_rate * 7 + rate) / 8; - estimated_time_left = average_rate ? remaining / average_rate : -1; - } - - if (got_data && global.test_decode != TEST_DECODE_OFF) - FOREACH_STREAM(test_decode(stream, global.test_decode, global.codec)); - } - - fflush(stdout); - if (!global.quiet) - fprintf(stderr, "\033[K"); - } - - if (stream_cnt > 1) - fprintf(stderr, "\n"); - - if (!global.quiet) { - FOREACH_STREAM(fprintf(stderr, - "\rPass %d/%d frame %4d/%-4d %7"PRId64"B %7"PRId64"b/f %7"PRId64"b/s" - " %7"PRId64" %s (%.2f fps)\033[K\n", - pass + 1, - global.passes, frames_in, stream->frames_out, (int64_t)stream->nbytes, - seen_frames ? (int64_t)(stream->nbytes * 8 / seen_frames) : 0, - seen_frames ? (int64_t)stream->nbytes * 8 * - (int64_t)global.framerate.num / global.framerate.den / - seen_frames : 0, - stream->cx_time > 9999999 ? stream->cx_time / 1000 : stream->cx_time, - stream->cx_time > 9999999 ? "ms" : "us", - usec_to_fps(stream->cx_time, seen_frames))); - } - - if (global.show_psnr) { - if (global.codec->fourcc == VP9_FOURCC) { - FOREACH_STREAM( - show_psnr(stream, (1 << stream->config.cfg.g_input_bit_depth) - 1)); - } else { - FOREACH_STREAM(show_psnr(stream, 255.0)); - } - } - - FOREACH_STREAM(vpx_codec_destroy(&stream->encoder)); - - if (global.test_decode != TEST_DECODE_OFF) { - FOREACH_STREAM(vpx_codec_destroy(&stream->decoder)); - } - - close_input_file(&input); - - if (global.test_decode == TEST_DECODE_FATAL) { - FOREACH_STREAM(res |= stream->mismatch_seen); - } - FOREACH_STREAM(close_output_file(stream, global.codec->fourcc)); - - FOREACH_STREAM(stats_close(&stream->stats, global.passes - 1)); - -#if CONFIG_FP_MB_STATS - FOREACH_STREAM(stats_close(&stream->fpmb_stats, global.passes - 1)); -#endif - - if (global.pass) - break; - } - - if (global.show_q_hist_buckets) - FOREACH_STREAM(show_q_histogram(stream->counts, - global.show_q_hist_buckets)); - - if (global.show_rate_hist_buckets) - FOREACH_STREAM(show_rate_histogram(stream->rate_hist, - &stream->config.cfg, - global.show_rate_hist_buckets)); - FOREACH_STREAM(destroy_rate_histogram(stream->rate_hist)); - -#if CONFIG_INTERNAL_STATS - /* TODO(jkoleszar): This doesn't belong in this executable. Do it for now, - * to match some existing utilities. - */ - if (!(global.pass == 1 && global.passes == 2)) - FOREACH_STREAM({ - FILE *f = fopen("opsnr.stt", "a"); - if (stream->mismatch_seen) { - fprintf(f, "First mismatch occurred in frame %d\n", - stream->mismatch_seen); - } else { - fprintf(f, "No mismatch detected in recon buffers\n"); - } - fclose(f); - }); -#endif - -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - if (allocated_raw_shift) - vpx_img_free(&raw_shift); -#endif - vpx_img_free(&raw); - free(argv); - free(streams); - return res ? EXIT_FAILURE : EXIT_SUCCESS; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpxenc.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpxenc.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpxenc.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpxenc.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef VPXENC_H_ -#define VPXENC_H_ - -#include "vpx/vpx_encoder.h" - -#ifdef __cplusplus -extern "C" { -#endif - -enum TestDecodeFatality { - TEST_DECODE_OFF, - TEST_DECODE_FATAL, - TEST_DECODE_WARN, -}; - -typedef enum { - I420, // 4:2:0 8+ bit-depth - I422, // 4:2:2 8+ bit-depth - I444, // 4:4:4 8+ bit-depth - I440, // 4:4:0 8+ bit-depth - YV12, // 4:2:0 with uv flipped, only 8-bit depth -} ColorInputType; - -struct VpxInterface; - -/* Configuration elements common to all streams. */ -struct VpxEncoderConfig { - const struct VpxInterface *codec; - int passes; - int pass; - int usage; - int deadline; - ColorInputType color_type; - int quiet; - int verbose; - int limit; - int skip_frames; - int show_psnr; - enum TestDecodeFatality test_decode; - int have_framerate; - struct vpx_rational framerate; - int out_part; - int debug; - int show_q_hist_buckets; - int show_rate_hist_buckets; - int disable_warnings; - int disable_warning_prompt; - int experimental_bitstream; -}; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VPXENC_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/include/vpx_mem_intrnl.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/include/vpx_mem_intrnl.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/include/vpx_mem_intrnl.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/include/vpx_mem_intrnl.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VPX_MEM_INCLUDE_VPX_MEM_INTRNL_H_ -#define VPX_MEM_INCLUDE_VPX_MEM_INTRNL_H_ -#include "./vpx_config.h" - -#ifndef CONFIG_MEM_MANAGER -# if defined(VXWORKS) -# define CONFIG_MEM_MANAGER 1 /*include heap manager functionality,*/ -/*default: enabled on vxworks*/ -# else -# define CONFIG_MEM_MANAGER 0 /*include heap manager functionality*/ -# endif -#endif /*CONFIG_MEM_MANAGER*/ - -#ifndef CONFIG_MEM_TRACKER -# define CONFIG_MEM_TRACKER 1 /*include xvpx_* calls in the lib*/ -#endif - -#ifndef CONFIG_MEM_CHECKS -# define CONFIG_MEM_CHECKS 0 /*include some basic safety checks in -vpx_memcpy, _memset, and _memmove*/ -#endif - -#ifndef USE_GLOBAL_FUNCTION_POINTERS -# define USE_GLOBAL_FUNCTION_POINTERS 0 /*use function pointers instead of compiled functions.*/ -#endif - -#if CONFIG_MEM_TRACKER -# include "vpx_mem_tracker.h" -# if VPX_MEM_TRACKER_VERSION_CHIEF != 2 || VPX_MEM_TRACKER_VERSION_MAJOR != 5 -# error "vpx_mem requires memory tracker version 2.5 to track memory usage" -# endif -#endif - -#define ADDRESS_STORAGE_SIZE sizeof(size_t) - -#ifndef DEFAULT_ALIGNMENT -# if defined(VXWORKS) -# define DEFAULT_ALIGNMENT 32 /*default addr alignment to use in -calls to vpx_* functions other -than vpx_memalign*/ -# else -# define DEFAULT_ALIGNMENT (2 * sizeof(void*)) /* NOLINT */ -# endif -#endif - -#if CONFIG_MEM_TRACKER -# define TRY_BOUNDS_CHECK 1 /*when set to 1 pads each allocation, -integrity can be checked using -vpx_memory_tracker_check_integrity -or on free by defining*/ -/*TRY_BOUNDS_CHECK_ON_FREE*/ -#else -# define TRY_BOUNDS_CHECK 0 -#endif /*CONFIG_MEM_TRACKER*/ - -#if TRY_BOUNDS_CHECK -# define TRY_BOUNDS_CHECK_ON_FREE 0 /*checks mem integrity on every -free, very expensive*/ -# define BOUNDS_CHECK_VALUE 0xdeadbeef /*value stored before/after ea. -mem addr for bounds checking*/ -# define BOUNDS_CHECK_PAD_SIZE 32 /*size of the padding before and -after ea allocation to be filled -with BOUNDS_CHECK_VALUE. -this should be a multiple of 4*/ -#else -# define BOUNDS_CHECK_VALUE 0 -# define BOUNDS_CHECK_PAD_SIZE 0 -#endif /*TRY_BOUNDS_CHECK*/ - -#ifndef REMOVE_PRINTFS -# define REMOVE_PRINTFS 0 -#endif - -/* Should probably use a vpx_mem logger function. */ -#if REMOVE_PRINTFS -# define _P(x) -#else -# define _P(x) x -#endif - -/*returns an addr aligned to the byte boundary specified by align*/ -#define align_addr(addr,align) (void*)(((size_t)(addr) + ((align) - 1)) & (size_t)-(align)) - -#endif // VPX_MEM_INCLUDE_VPX_MEM_INTRNL_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/include/vpx_mem_tracker.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/include/vpx_mem_tracker.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/include/vpx_mem_tracker.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/include/vpx_mem_tracker.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,179 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VPX_MEM_INCLUDE_VPX_MEM_TRACKER_H_ -#define VPX_MEM_INCLUDE_VPX_MEM_TRACKER_H_ - -/* vpx_mem_tracker version info */ -#define vpx_mem_tracker_version "2.5.1.1" - -#define VPX_MEM_TRACKER_VERSION_CHIEF 2 -#define VPX_MEM_TRACKER_VERSION_MAJOR 5 -#define VPX_MEM_TRACKER_VERSION_MINOR 1 -#define VPX_MEM_TRACKER_VERSION_PATCH 1 -/* END - vpx_mem_tracker version info */ - -#include - -struct mem_block { - size_t addr; - unsigned int size, - line; - char *file; - struct mem_block *prev, - * next; - - int padded; // This mem_block has padding for integrity checks. - // As of right now, this should only be 0 if - // using vpx_mem_alloc to allocate cache memory. - // 2005-01-11 tjf -}; - -#if defined(__cplusplus) -extern "C" { -#endif - - /* - vpx_memory_tracker_init(int padding_size, int pad_value) - padding_size - the size of the padding before and after each mem addr. - Values > 0 indicate that integrity checks can be performed - by inspecting these areas. - pad_value - the initial value within the padding area before and after - each mem addr. - - Initializes the memory tracker interface. Should be called before any - other calls to the memory tracker. - */ - int vpx_memory_tracker_init(int padding_size, int pad_value); - - /* - vpx_memory_tracker_destroy() - Deinitializes the memory tracker interface - */ - void vpx_memory_tracker_destroy(); - - /* - vpx_memory_tracker_add(size_t addr, unsigned int size, - char * file, unsigned int line) - addr - memory address to be added to list - size - size of addr - file - the file addr was referenced from - line - the line in file addr was referenced from - Adds memory address addr, it's size, file and line it came from - to the memory tracker allocation table - */ - void vpx_memory_tracker_add(size_t addr, unsigned int size, - char *file, unsigned int line, - int padded); - - /* - vpx_memory_tracker_add(size_t addr, unsigned int size, char * file, unsigned int line) - addr - memory address to be added to be removed - padded - if 0, disables bounds checking on this memory block even if bounds - checking is enabled. (for example, when allocating cache memory, we still want - to check for memory leaks, but we do not waste cache space for bounds check padding) - Removes the specified address from the memory tracker's allocation - table - Return: - 0: on success - -1: if memory allocation table's mutex could not be locked - -2: if the addr was not found in the list - */ - int vpx_memory_tracker_remove(size_t addr); - - /* - vpx_memory_tracker_find(unsigned int addr) - addr - address to be found in the memory tracker's - allocation table - Return: - If found, pointer to the memory block that matches addr - NULL otherwise - */ - struct mem_block *vpx_memory_tracker_find(size_t addr); - - /* - vpx_memory_tracker_dump() - Dumps the current contents of the memory - tracker allocation table - */ - void vpx_memory_tracker_dump(); - - /* - vpx_memory_tracker_check_integrity() - If a padding_size was provided to vpx_memory_tracker_init() - This function will verify that the region before and after each - memory address contains the specified pad_value. Should the check - fail, the filename and line of the check will be printed out. - */ - void vpx_memory_tracker_check_integrity(char *file, unsigned int line); - - /* - vpx_memory_tracker_set_log_type - type - value representing the logging type to use - option - type specific option. This will be interpreted differently - based on the type. - Sets the logging type for the memory tracker. - Values currently supported: - 0: if option is NULL, log to stderr, otherwise interpret option as a - filename and attempt to open it. - 1: Use output_debug_string (WIN32 only), option ignored - Return: - 0: on success - -1: if the logging type could not be set, because the value was invalid - or because a file could not be opened - */ - int vpx_memory_tracker_set_log_type(int type, char *option); - - /* - vpx_memory_tracker_set_log_func - userdata - ptr to be passed to the supplied logfunc, can be NULL - logfunc - the logging function to be used to output data from - vpx_memory_track_dump/check_integrity - Sets a logging function to be used by the memory tracker. - Return: - 0: on success - -1: if the logging type could not be set because logfunc was NULL - */ - int vpx_memory_tracker_set_log_func(void *userdata, - void(*logfunc)(void *userdata, - const char *fmt, va_list args)); - - /* Wrappers to standard library functions. */ - typedef void *(* mem_track_malloc_func)(size_t); - typedef void *(* mem_track_calloc_func)(size_t, size_t); - typedef void *(* mem_track_realloc_func)(void *, size_t); - typedef void (* mem_track_free_func)(void *); - typedef void *(* mem_track_memcpy_func)(void *, const void *, size_t); - typedef void *(* mem_track_memset_func)(void *, int, size_t); - typedef void *(* mem_track_memmove_func)(void *, const void *, size_t); - - /* - vpx_memory_tracker_set_functions - - Sets the function pointers for the standard library functions. - - Return: - 0: on success - -1: if the use global function pointers is not set. - */ - int vpx_memory_tracker_set_functions(mem_track_malloc_func g_malloc_l -, mem_track_calloc_func g_calloc_l -, mem_track_realloc_func g_realloc_l -, mem_track_free_func g_free_l -, mem_track_memcpy_func g_memcpy_l -, mem_track_memset_func g_memset_l -, mem_track_memmove_func g_memmove_l); - -#if defined(__cplusplus) -} -#endif - -#endif // VPX_MEM_INCLUDE_VPX_MEM_TRACKER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_alloc.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_alloc.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_alloc.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_alloc.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/* This code is in the public domain. -** Version: 1.1 Author: Walt Karas -*/ - -#include "hmm_intrnl.h" - -void *U(alloc)(U(descriptor) *desc, U(size_aau) n) { -#ifdef HMM_AUDIT_FAIL - - if (desc->avl_tree_root) - AUDIT_BLOCK(PTR_REC_TO_HEAD(desc->avl_tree_root)) -#endif - - if (desc->last_freed) { -#ifdef HMM_AUDIT_FAIL - AUDIT_BLOCK(desc->last_freed) -#endif - - U(into_free_collection)(desc, (head_record *)(desc->last_freed)); - - desc->last_freed = 0; - } - - /* Add space for block header. */ - n += HEAD_AAUS; - - /* Convert n from number of address alignment units to block alignment - ** units. */ - n = DIV_ROUND_UP(n, HMM_BLOCK_ALIGN_UNIT); - - if (n < MIN_BLOCK_BAUS) - n = MIN_BLOCK_BAUS; - - { - /* Search for the first node of the bin containing the smallest - ** block big enough to satisfy request. */ - ptr_record *ptr_rec_ptr = - U(avl_search)( - (U(avl_avl) *) & (desc->avl_tree_root), (U(size_bau)) n, - AVL_GREATER_EQUAL); - - /* If an approprate bin is found, satisfy the allocation request, - ** otherwise return null pointer. */ - return(ptr_rec_ptr ? - U(alloc_from_bin)(desc, ptr_rec_ptr, (U(size_bau)) n) : 0); - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_base.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_base.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_base.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_base.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,405 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/* This code is in the public domain. -** Version: 1.1 Author: Walt Karas -*/ - -#include "hmm_intrnl.h" - -void U(init)(U(descriptor) *desc) { - desc->avl_tree_root = 0; - desc->last_freed = 0; -} - -/* Remove a free block from a bin's doubly-linked list when it is not, -** the first block in the bin. -*/ -void U(dll_remove)( - /* Pointer to pointer record in the block to be removed. */ - ptr_record *to_remove) { - to_remove->prev->next = to_remove->next; - - if (to_remove->next) - to_remove->next->prev = to_remove->prev; -} - -/* Put a block into the free collection of a heap. -*/ -void U(into_free_collection)( - /* Pointer to heap descriptor. */ - U(descriptor) *desc, - /* Pointer to head record of block. */ - head_record *head_ptr) { - ptr_record *ptr_rec_ptr = HEAD_TO_PTR_REC(head_ptr); - - ptr_record *bin_front_ptr = - U(avl_insert)((U(avl_avl) *) & (desc->avl_tree_root), ptr_rec_ptr); - - if (bin_front_ptr != ptr_rec_ptr) { - /* The block was not inserted into the AVL tree because there is - ** already a bin for the size of the block. */ - - MARK_SUCCESSIVE_BLOCK_IN_FREE_BIN(head_ptr) - ptr_rec_ptr->self = ptr_rec_ptr; - - /* Make the block the new second block in the bin's doubly-linked - ** list. */ - ptr_rec_ptr->prev = bin_front_ptr; - ptr_rec_ptr->next = bin_front_ptr->next; - bin_front_ptr->next = ptr_rec_ptr; - - if (ptr_rec_ptr->next) - ptr_rec_ptr->next->prev = ptr_rec_ptr; - } else - /* Block is first block in new bin. */ - ptr_rec_ptr->next = 0; -} - -/* Allocate a block from a given bin. Returns a pointer to the payload -** of the removed block. The "last freed" pointer must be null prior -** to calling this function. -*/ -void *U(alloc_from_bin)( - /* Pointer to heap descriptor. */ - U(descriptor) *desc, - /* Pointer to pointer record of first block in bin. */ - ptr_record *bin_front_ptr, - /* Number of BAUs needed in the allocated block. If the block taken - ** from the bin is significantly larger than the number of BAUs needed, - ** the "extra" BAUs are split off to form a new free block. */ - U(size_bau) n_baus) { - head_record *head_ptr; - U(size_bau) rem_baus; - - if (bin_front_ptr->next) { - /* There are multiple blocks in this bin. Use the 2nd block in - ** the bin to avoid needless change to the AVL tree. - */ - - ptr_record *ptr_rec_ptr = bin_front_ptr->next; - head_ptr = PTR_REC_TO_HEAD(ptr_rec_ptr); - -#ifdef AUDIT_FAIL - AUDIT_BLOCK(head_ptr) -#endif - - U(dll_remove)(ptr_rec_ptr); - } else { - /* There is only one block in the bin, so it has to be removed - ** from the AVL tree. - */ - - head_ptr = PTR_REC_TO_HEAD(bin_front_ptr); - - U(avl_remove)( - (U(avl_avl) *) & (desc->avl_tree_root), BLOCK_BAUS(head_ptr)); - } - - MARK_BLOCK_ALLOCATED(head_ptr) - - rem_baus = BLOCK_BAUS(head_ptr) - n_baus; - - if (rem_baus >= MIN_BLOCK_BAUS) { - /* Since there are enough "extra" BAUs, split them off to form - ** a new free block. - */ - - head_record *rem_head_ptr = - (head_record *) BAUS_FORWARD(head_ptr, n_baus); - - /* Change the next block's header to reflect the fact that the - ** block preceeding it is now smaller. - */ - SET_PREV_BLOCK_BAUS( - BAUS_FORWARD(head_ptr, head_ptr->block_size), rem_baus) - - head_ptr->block_size = n_baus; - - rem_head_ptr->previous_block_size = n_baus; - rem_head_ptr->block_size = rem_baus; - - desc->last_freed = rem_head_ptr; - } - - return(HEAD_TO_PTR_REC(head_ptr)); -} - -/* Take a block out of the free collection. -*/ -void U(out_of_free_collection)( - /* Descriptor of heap that block is in. */ - U(descriptor) *desc, - /* Pointer to head of block to take out of free collection. */ - head_record *head_ptr) { - ptr_record *ptr_rec_ptr = HEAD_TO_PTR_REC(head_ptr); - - if (ptr_rec_ptr->self == ptr_rec_ptr) - /* Block is not the front block in its bin, so all we have to - ** do is take it out of the bin's doubly-linked list. */ - U(dll_remove)(ptr_rec_ptr); - else { - ptr_record *next = ptr_rec_ptr->next; - - if (next) - /* Block is the front block in its bin, and there is at least - ** one other block in the bin. Substitute the next block for - ** the front block. */ - U(avl_subst)((U(avl_avl) *) & (desc->avl_tree_root), next); - else - /* Block is the front block in its bin, but there is no other - ** block in the bin. Eliminate the bin. */ - U(avl_remove)( - (U(avl_avl) *) & (desc->avl_tree_root), BLOCK_BAUS(head_ptr)); - } -} - -void U(free)(U(descriptor) *desc, void *payload_ptr) { - /* Flags if coalesce with adjacent block. */ - int coalesce; - - head_record *fwd_head_ptr; - head_record *free_head_ptr = PTR_REC_TO_HEAD(payload_ptr); - - desc->num_baus_can_shrink = 0; - -#ifdef HMM_AUDIT_FAIL - - AUDIT_BLOCK(free_head_ptr) - - /* Make sure not freeing an already free block. */ - if (!IS_BLOCK_ALLOCATED(free_head_ptr)) - HMM_AUDIT_FAIL - - if (desc->avl_tree_root) - /* Audit root block in AVL tree. */ - AUDIT_BLOCK(PTR_REC_TO_HEAD(desc->avl_tree_root)) - -#endif - - fwd_head_ptr = - (head_record *) BAUS_FORWARD(free_head_ptr, free_head_ptr->block_size); - - if (free_head_ptr->previous_block_size) { - /* Coalesce with backward block if possible. */ - - head_record *bkwd_head_ptr = - (head_record *) BAUS_BACKWARD( - free_head_ptr, free_head_ptr->previous_block_size); - -#ifdef HMM_AUDIT_FAIL - AUDIT_BLOCK(bkwd_head_ptr) -#endif - - if (bkwd_head_ptr == (head_record *)(desc->last_freed)) { - desc->last_freed = 0; - coalesce = 1; - } else if (IS_BLOCK_ALLOCATED(bkwd_head_ptr)) - coalesce = 0; - else { - U(out_of_free_collection)(desc, bkwd_head_ptr); - coalesce = 1; - } - - if (coalesce) { - bkwd_head_ptr->block_size += free_head_ptr->block_size; - SET_PREV_BLOCK_BAUS(fwd_head_ptr, BLOCK_BAUS(bkwd_head_ptr)) - free_head_ptr = bkwd_head_ptr; - } - } - - if (fwd_head_ptr->block_size == 0) { - /* Block to be freed is last block before dummy end-of-chunk block. */ - desc->end_of_shrinkable_chunk = - BAUS_FORWARD(fwd_head_ptr, DUMMY_END_BLOCK_BAUS); - desc->num_baus_can_shrink = BLOCK_BAUS(free_head_ptr); - - if (PREV_BLOCK_BAUS(free_head_ptr) == 0) - /* Free block is the entire chunk, so shrinking can eliminate - ** entire chunk including dummy end block. */ - desc->num_baus_can_shrink += DUMMY_END_BLOCK_BAUS; - } else { - /* Coalesce with forward block if possible. */ - -#ifdef HMM_AUDIT_FAIL - AUDIT_BLOCK(fwd_head_ptr) -#endif - - if (fwd_head_ptr == (head_record *)(desc->last_freed)) { - desc->last_freed = 0; - coalesce = 1; - } else if (IS_BLOCK_ALLOCATED(fwd_head_ptr)) - coalesce = 0; - else { - U(out_of_free_collection)(desc, fwd_head_ptr); - coalesce = 1; - } - - if (coalesce) { - free_head_ptr->block_size += fwd_head_ptr->block_size; - - fwd_head_ptr = - (head_record *) BAUS_FORWARD( - fwd_head_ptr, BLOCK_BAUS(fwd_head_ptr)); - - SET_PREV_BLOCK_BAUS(fwd_head_ptr, BLOCK_BAUS(free_head_ptr)) - - if (fwd_head_ptr->block_size == 0) { - /* Coalesced block to be freed is last block before dummy - ** end-of-chunk block. */ - desc->end_of_shrinkable_chunk = - BAUS_FORWARD(fwd_head_ptr, DUMMY_END_BLOCK_BAUS); - desc->num_baus_can_shrink = BLOCK_BAUS(free_head_ptr); - - if (PREV_BLOCK_BAUS(free_head_ptr) == 0) - /* Free block is the entire chunk, so shrinking can - ** eliminate entire chunk including dummy end block. */ - desc->num_baus_can_shrink += DUMMY_END_BLOCK_BAUS; - } - } - } - - if (desc->last_freed) { - /* There is a last freed block, but it is not adjacent to the - ** block being freed by this call to free, so put the last - ** freed block into the free collection. - */ - -#ifdef HMM_AUDIT_FAIL - AUDIT_BLOCK(desc->last_freed) -#endif - - U(into_free_collection)(desc, (head_record *)(desc->last_freed)); - } - - desc->last_freed = free_head_ptr; -} - -void U(new_chunk)(U(descriptor) *desc, void *start, U(size_bau) n_baus) { -#ifdef HMM_AUDIT_FAIL - - if (desc->avl_tree_root) - /* Audit root block in AVL tree. */ - AUDIT_BLOCK(PTR_REC_TO_HEAD(desc->avl_tree_root)) -#endif - -#undef HEAD_PTR -#define HEAD_PTR ((head_record *) start) - - /* Make the chunk one big free block followed by a dummy end block. - */ - - n_baus -= DUMMY_END_BLOCK_BAUS; - - HEAD_PTR->previous_block_size = 0; - HEAD_PTR->block_size = n_baus; - - U(into_free_collection)(desc, HEAD_PTR); - - /* Set up the dummy end block. */ - start = BAUS_FORWARD(start, n_baus); - HEAD_PTR->previous_block_size = n_baus; - HEAD_PTR->block_size = 0; - -#undef HEAD_PTR -} - -#ifdef HMM_AUDIT_FAIL - -/* Function that does audit fail actions defined my preprocessor symbol, -** and returns a dummy integer value. -*/ -int U(audit_block_fail_dummy_return)(void) { - HMM_AUDIT_FAIL - - /* Dummy return. */ - return(0); -} - -#endif - -/* AVL Tree instantiation. */ - -#ifdef HMM_AUDIT_FAIL - -/* The AVL tree generic package passes an ACCESS of 1 when it "touches" -** a child node for the first time during a particular operation. I use -** this feature to audit only one time (per operation) the free blocks -** that are tree nodes. Since the root node is not a child node, it has -** to be audited directly. -*/ - -/* The pain you feel while reading these macros will not be in vain. It -** will remove all doubt from you mind that C++ inline functions are -** a very good thing. -*/ - -#define AVL_GET_LESS(H, ACCESS) \ - (((ACCESS) ? AUDIT_BLOCK_AS_EXPR(PTR_REC_TO_HEAD(H)) : 0), (H)->self) -#define AVL_GET_GREATER(H, ACCESS) \ - (((ACCESS) ? AUDIT_BLOCK_AS_EXPR(PTR_REC_TO_HEAD(H)) : 0), (H)->prev) - -#else - -#define AVL_GET_LESS(H, ACCESS) ((H)->self) -#define AVL_GET_GREATER(H, ACCESS) ((H)->prev) - -#endif - -#define AVL_SET_LESS(H, LH) (H)->self = (LH); -#define AVL_SET_GREATER(H, GH) (H)->prev = (GH); - -/* high bit of high bit of -** block_size previous_block_size balance factor -** ----------- ------------------- -------------- -** 0 0 n/a (block allocated) -** 0 1 1 -** 1 0 -1 -** 1 1 0 -*/ - -#define AVL_GET_BALANCE_FACTOR(H) \ - ((((head_record *) (PTR_REC_TO_HEAD(H)))->block_size & \ - HIGH_BIT_BAU_SIZE) ? \ - (((head_record *) (PTR_REC_TO_HEAD(H)))->previous_block_size & \ - HIGH_BIT_BAU_SIZE ? 0 : -1) : 1) - -#define AVL_SET_BALANCE_FACTOR(H, BF) \ - { \ - register head_record *p = \ - (head_record *) PTR_REC_TO_HEAD(H); \ - register int bal_f = (BF); \ - \ - if (bal_f <= 0) \ - p->block_size |= HIGH_BIT_BAU_SIZE; \ - else \ - p->block_size &= ~HIGH_BIT_BAU_SIZE; \ - if (bal_f >= 0) \ - p->previous_block_size |= HIGH_BIT_BAU_SIZE; \ - else \ - p->previous_block_size &= ~HIGH_BIT_BAU_SIZE; \ - } - -#define COMPARE_KEY_KEY(K1, K2) ((K1) == (K2) ? 0 : ((K1) > (K2) ? 1 : -1)) - -#define AVL_COMPARE_KEY_NODE(K, H) \ - COMPARE_KEY_KEY(K, BLOCK_BAUS(PTR_REC_TO_HEAD(H))) - -#define AVL_COMPARE_NODE_NODE(H1, H2) \ - COMPARE_KEY_KEY(BLOCK_BAUS(PTR_REC_TO_HEAD(H1)), \ - BLOCK_BAUS(PTR_REC_TO_HEAD(H2))) - -#define AVL_NULL ((ptr_record *) 0) - -#define AVL_IMPL_MASK \ - ( AVL_IMPL_INSERT | AVL_IMPL_SEARCH | AVL_IMPL_REMOVE | AVL_IMPL_SUBST ) - -#include "cavl_impl.h" diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_dflt_abort.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_dflt_abort.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_dflt_abort.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_dflt_abort.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/* This code is in the public domain. -** Version: 1.1 Author: Walt Karas -*/ - -/* The function in this file performs default actions if self-auditing -** finds heap corruption. Don't rely on this code to handle the -** case where HMM is being used to implement the malloc and free standard -** library functions. Rewrite the function if necessary to avoid using -** I/O and execution termination functions that call malloc or free. -** In Unix, for example, you would replace the fputs calls with calls -** to the write system call using file handle number 2. -*/ -#include "hmm_intrnl.h" -#include -#include - -static int entered = 0; - -/* Print abort message, file and line. Terminate execution. -*/ -void hmm_dflt_abort(const char *file, const char *line) { - /* Avoid use of printf(), which is more likely to use heap. */ - - if (entered) - - /* The standard I/O functions called a heap function and caused - ** an indirect recursive call to this function. So we'll have - ** to just exit without printing a message. */ - while (1); - - entered = 1; - - fputs("\n_abort - Heap corruption\n" "File: ", stderr); - fputs(file, stderr); - fputs(" Line: ", stderr); - fputs(line, stderr); - fputs("\n\n", stderr); - fputs("hmm_dflt_abort: while(1)!!!\n", stderr); - fflush(stderr); - - while (1); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_grow.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_grow.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_grow.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_grow.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/* This code is in the public domain. -** Version: 1.1 Author: Walt Karas -*/ - -#include "hmm_intrnl.h" - -void U(grow_chunk)(U(descriptor) *desc, void *end, U(size_bau) n_baus) { -#undef HEAD_PTR -#define HEAD_PTR ((head_record *) end) - - end = BAUS_BACKWARD(end, DUMMY_END_BLOCK_BAUS); - -#ifdef HMM_AUDIT_FAIL - - if (HEAD_PTR->block_size != 0) - /* Chunk does not have valid dummy end block. */ - HMM_AUDIT_FAIL - -#endif - - /* Create a new block that absorbs the old dummy end block. */ - HEAD_PTR->block_size = n_baus; - - /* Set up the new dummy end block. */ - { - head_record *dummy = (head_record *) BAUS_FORWARD(end, n_baus); - dummy->previous_block_size = n_baus; - dummy->block_size = 0; - } - - /* Simply free the new block, allowing it to coalesce with any - ** free block at that was the last block in the chunk prior to - ** growth. - */ - U(free)(desc, HEAD_TO_PTR_REC(end)); - -#undef HEAD_PTR -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_largest.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_largest.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_largest.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_largest.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/* This code is in the public domain. -** Version: 1.1 Author: Walt Karas -*/ - -#include "hmm_intrnl.h" - -U(size_aau) U(largest_available)(U(descriptor) *desc) { - U(size_bau) largest; - - if (!(desc->avl_tree_root)) - largest = 0; - else { -#ifdef HMM_AUDIT_FAIL - /* Audit root block in AVL tree. */ - AUDIT_BLOCK(PTR_REC_TO_HEAD(desc->avl_tree_root)) -#endif - - largest = - BLOCK_BAUS( - PTR_REC_TO_HEAD( - U(avl_search)( - (U(avl_avl) *) & (desc->avl_tree_root), - (U(size_bau)) ~(U(size_bau)) 0, AVL_LESS))); - } - - if (desc->last_freed) { - /* Size of last freed block. */ - register U(size_bau) lf_size; - -#ifdef HMM_AUDIT_FAIL - AUDIT_BLOCK(desc->last_freed) -#endif - - lf_size = BLOCK_BAUS(desc->last_freed); - - if (lf_size > largest) - largest = lf_size; - } - - /* Convert largest size to AAUs and subract head size leaving payload - ** size. - */ - return(largest ? - ((largest * ((U(size_aau)) HMM_BLOCK_ALIGN_UNIT)) - HEAD_AAUS) : - 0); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_resize.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_resize.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_resize.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_resize.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,114 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/* This code is in the public domain. -** Version: 1.1 Author: Walt Karas -*/ - -#include "hmm_intrnl.h" - -int U(resize)(U(descriptor) *desc, void *mem, U(size_aau) n) { - U(size_aau) i; - head_record *next_head_ptr; - head_record *head_ptr = PTR_REC_TO_HEAD(mem); - - /* Flag. */ - int next_block_free; - - /* Convert n from desired block size in AAUs to BAUs. */ - n += HEAD_AAUS; - n = DIV_ROUND_UP(n, HMM_BLOCK_ALIGN_UNIT); - - if (n < MIN_BLOCK_BAUS) - n = MIN_BLOCK_BAUS; - -#ifdef HMM_AUDIT_FAIL - - AUDIT_BLOCK(head_ptr) - - if (!IS_BLOCK_ALLOCATED(head_ptr)) - HMM_AUDIT_FAIL - - if (desc->avl_tree_root) - AUDIT_BLOCK(PTR_REC_TO_HEAD(desc->avl_tree_root)) - -#endif - - i = head_ptr->block_size; - - next_head_ptr = - (head_record *) BAUS_FORWARD(head_ptr, head_ptr->block_size); - - next_block_free = - (next_head_ptr == desc->last_freed) || - !IS_BLOCK_ALLOCATED(next_head_ptr); - - if (next_block_free) - /* Block can expand into next free block. */ - i += BLOCK_BAUS(next_head_ptr); - - if (n > i) - /* Not enough room for block to expand. */ - return(-1); - - if (next_block_free) { -#ifdef HMM_AUDIT_FAIL - AUDIT_BLOCK(next_head_ptr) -#endif - - if (next_head_ptr == desc->last_freed) - desc->last_freed = 0; - else - U(out_of_free_collection)(desc, next_head_ptr); - - next_head_ptr = - (head_record *) BAUS_FORWARD(head_ptr, (U(size_bau)) i); - } - - /* Set i to number of "extra" BAUs. */ - i -= n; - - if (i < MIN_BLOCK_BAUS) - /* Not enough extra BAUs to be a block on their own, so just keep them - ** in the block being resized. - */ - { - n += i; - i = n; - } else { - /* There are enough "leftover" BAUs in the next block to - ** form a remainder block. */ - - head_record *rem_head_ptr; - - rem_head_ptr = (head_record *) BAUS_FORWARD(head_ptr, n); - - rem_head_ptr->previous_block_size = (U(size_bau)) n; - rem_head_ptr->block_size = (U(size_bau)) i; - - if (desc->last_freed) { -#ifdef HMM_AUDIT_FAIL - AUDIT_BLOCK(desc->last_freed) -#endif - - U(into_free_collection)(desc, (head_record *)(desc->last_freed)); - - desc->last_freed = 0; - } - - desc->last_freed = rem_head_ptr; - } - - head_ptr->block_size = (U(size_bau)) n; - next_head_ptr->previous_block_size = (U(size_bau)) i; - - return(0); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_shrink.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_shrink.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_shrink.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_shrink.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/* This code is in the public domain. -** Version: 1.1 Author: Walt Karas -*/ - -#include "hmm_intrnl.h" - -void U(shrink_chunk)(U(descriptor) *desc, U(size_bau) n_baus_to_shrink) { - head_record *dummy_end_block = (head_record *) - BAUS_BACKWARD(desc->end_of_shrinkable_chunk, DUMMY_END_BLOCK_BAUS); - -#ifdef HMM_AUDIT_FAIL - - if (dummy_end_block->block_size != 0) - /* Chunk does not have valid dummy end block. */ - HMM_AUDIT_FAIL - -#endif - - if (n_baus_to_shrink) { - head_record *last_block = (head_record *) - BAUS_BACKWARD( - dummy_end_block, dummy_end_block->previous_block_size); - -#ifdef HMM_AUDIT_FAIL - AUDIT_BLOCK(last_block) -#endif - - if (last_block == desc->last_freed) { - U(size_bau) bs = BLOCK_BAUS(last_block); - - /* Chunk will not be shrunk out of existence if - ** 1. There is at least one allocated block in the chunk - ** and the amount to shrink is exactly the size of the - ** last block, OR - ** 2. After the last block is shrunk, there will be enough - ** BAUs left in it to form a minimal size block. */ - int chunk_will_survive = - (PREV_BLOCK_BAUS(last_block) && (n_baus_to_shrink == bs)) || - (n_baus_to_shrink <= (U(size_bau))(bs - MIN_BLOCK_BAUS)); - - if (chunk_will_survive || - (!PREV_BLOCK_BAUS(last_block) && - (n_baus_to_shrink == - (U(size_bau))(bs + DUMMY_END_BLOCK_BAUS)))) { - desc->last_freed = 0; - - if (chunk_will_survive) { - bs -= n_baus_to_shrink; - - if (bs) { - /* The last (non-dummy) block was not completely - ** eliminated by the shrink. */ - - last_block->block_size = bs; - - /* Create new dummy end record. - */ - dummy_end_block = - (head_record *) BAUS_FORWARD(last_block, bs); - dummy_end_block->previous_block_size = bs; - dummy_end_block->block_size = 0; - -#ifdef HMM_AUDIT_FAIL - - if (desc->avl_tree_root) - AUDIT_BLOCK(PTR_REC_TO_HEAD(desc->avl_tree_root)) -#endif - - U(into_free_collection)(desc, last_block); - } else { - /* The last (non-dummy) block was completely - ** eliminated by the shrink. Make its head - ** the new dummy end block. - */ - last_block->block_size = 0; - last_block->previous_block_size &= ~HIGH_BIT_BAU_SIZE; - } - } - } - -#ifdef HMM_AUDIT_FAIL - else - HMM_AUDIT_FAIL -#endif - } - -#ifdef HMM_AUDIT_FAIL - else - HMM_AUDIT_FAIL -#endif - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_true.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_true.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_true.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/hmm_true.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/* This code is in the public domain. -** Version: 1.1 Author: Walt Karas -*/ - -#include "hmm_intrnl.h" - -U(size_aau) U(true_size)(void *payload_ptr) { - register head_record *head_ptr = PTR_REC_TO_HEAD(payload_ptr); - -#ifdef HMM_AUDIT_FAIL - AUDIT_BLOCK(head_ptr) -#endif - - /* Convert block size from BAUs to AAUs. Subtract head size, leaving - ** payload size. - */ - return( - (BLOCK_BAUS(head_ptr) * ((U(size_aau)) HMM_BLOCK_ALIGN_UNIT)) - - HEAD_AAUS); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/include/cavl_if.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/include/cavl_if.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/include/cavl_if.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/include/cavl_if.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,228 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VPX_MEM_MEMORY_MANAGER_INCLUDE_CAVL_IF_H_ -#define VPX_MEM_MEMORY_MANAGER_INCLUDE_CAVL_IF_H_ - -/* Abstract AVL Tree Generic C Package. -** Interface generation header file. -** -** This code is in the public domain. See cavl_tree.html for interface -** documentation. -** -** Version: 1.5 Author: Walt Karas -*/ - -/* This header contains the definition of CHAR_BIT (number of bits in a -** char). */ -#include - -#undef L_ -#undef L_EST_LONG_BIT -#undef L_SIZE -#undef L_SC -#undef L_LONG_BIT -#undef L_BIT_ARR_DEFN - -#ifndef AVL_SEARCH_TYPE_DEFINED_ -#define AVL_SEARCH_TYPE_DEFINED_ - -typedef enum { - AVL_EQUAL = 1, - AVL_LESS = 2, - AVL_GREATER = 4, - AVL_LESS_EQUAL = AVL_EQUAL | AVL_LESS, - AVL_GREATER_EQUAL = AVL_EQUAL | AVL_GREATER -} -avl_search_type; - -#endif - -#ifdef AVL_UNIQUE - -#define L_ AVL_UNIQUE - -#else - -#define L_(X) X - -#endif - -/* Determine storage class for function prototypes. */ -#ifdef AVL_PRIVATE - -#define L_SC static - -#else - -#define L_SC extern - -#endif - -#ifdef AVL_SIZE - -#define L_SIZE AVL_SIZE - -#else - -#define L_SIZE unsigned long - -#endif - -typedef struct { -#ifdef AVL_INSIDE_STRUCT - - AVL_INSIDE_STRUCT - -#endif - - AVL_HANDLE root; -} -L_(avl); - -/* Function prototypes. */ - -L_SC void L_(init)(L_(avl) *tree); - -L_SC int L_(is_empty)(L_(avl) *tree); - -L_SC AVL_HANDLE L_(insert)(L_(avl) *tree, AVL_HANDLE h); - -L_SC AVL_HANDLE L_(search)(L_(avl) *tree, AVL_KEY k, avl_search_type st); - -L_SC AVL_HANDLE L_(search_least)(L_(avl) *tree); - -L_SC AVL_HANDLE L_(search_greatest)(L_(avl) *tree); - -L_SC AVL_HANDLE L_(remove)(L_(avl) *tree, AVL_KEY k); - -L_SC AVL_HANDLE L_(subst)(L_(avl) *tree, AVL_HANDLE new_node); - -#ifdef AVL_BUILD_ITER_TYPE - -L_SC int L_(build)( - L_(avl) *tree, AVL_BUILD_ITER_TYPE p, L_SIZE num_nodes); - -#endif - -/* ANSI C/ISO C++ require that a long have at least 32 bits. Set -** L_EST_LONG_BIT to be the greatest multiple of 8 in the range -** 32 - 64 (inclusive) that is less than or equal to the number of -** bits in a long. -*/ - -#if (((LONG_MAX >> 31) >> 7) == 0) - -#define L_EST_LONG_BIT 32 - -#elif (((LONG_MAX >> 31) >> 15) == 0) - -#define L_EST_LONG_BIT 40 - -#elif (((LONG_MAX >> 31) >> 23) == 0) - -#define L_EST_LONG_BIT 48 - -#elif (((LONG_MAX >> 31) >> 31) == 0) - -#define L_EST_LONG_BIT 56 - -#else - -#define L_EST_LONG_BIT 64 - -#endif - -/* Number of bits in a long. */ -#define L_LONG_BIT (sizeof(long) * CHAR_BIT) - -/* The macro L_BIT_ARR_DEFN defines a bit array whose index is a (0-based) -** node depth. The definition depends on whether the maximum depth is more -** or less than the number of bits in a single long. -*/ - -#if ((AVL_MAX_DEPTH) > L_EST_LONG_BIT) - -/* Maximum depth may be more than number of bits in a long. */ - -#define L_BIT_ARR_DEFN(NAME) \ - unsigned long NAME[((AVL_MAX_DEPTH) + L_LONG_BIT - 1) / L_LONG_BIT]; - -#else - -/* Maximum depth is definitely less than number of bits in a long. */ - -#define L_BIT_ARR_DEFN(NAME) unsigned long NAME; - -#endif - -/* Iterator structure. */ -typedef struct { - /* Tree being iterated over. */ - L_(avl) *tree_; - - /* Records a path into the tree. If bit n is true, indicates - ** take greater branch from the nth node in the path, otherwise - ** take the less branch. bit 0 gives branch from root, and - ** so on. */ - L_BIT_ARR_DEFN(branch) - - /* Zero-based depth of path into tree. */ - unsigned depth; - - /* Handles of nodes in path from root to current node (returned by *). */ - AVL_HANDLE path_h[(AVL_MAX_DEPTH) - 1]; -} -L_(iter); - -/* Iterator function prototypes. */ - -L_SC void L_(start_iter)( - L_(avl) *tree, L_(iter) *iter, AVL_KEY k, avl_search_type st); - -L_SC void L_(start_iter_least)(L_(avl) *tree, L_(iter) *iter); - -L_SC void L_(start_iter_greatest)(L_(avl) *tree, L_(iter) *iter); - -L_SC AVL_HANDLE L_(get_iter)(L_(iter) *iter); - -L_SC void L_(incr_iter)(L_(iter) *iter); - -L_SC void L_(decr_iter)(L_(iter) *iter); - -L_SC void L_(init_iter)(L_(iter) *iter); - -#define AVL_IMPL_INIT 1 -#define AVL_IMPL_IS_EMPTY (1 << 1) -#define AVL_IMPL_INSERT (1 << 2) -#define AVL_IMPL_SEARCH (1 << 3) -#define AVL_IMPL_SEARCH_LEAST (1 << 4) -#define AVL_IMPL_SEARCH_GREATEST (1 << 5) -#define AVL_IMPL_REMOVE (1 << 6) -#define AVL_IMPL_BUILD (1 << 7) -#define AVL_IMPL_START_ITER (1 << 8) -#define AVL_IMPL_START_ITER_LEAST (1 << 9) -#define AVL_IMPL_START_ITER_GREATEST (1 << 10) -#define AVL_IMPL_GET_ITER (1 << 11) -#define AVL_IMPL_INCR_ITER (1 << 12) -#define AVL_IMPL_DECR_ITER (1 << 13) -#define AVL_IMPL_INIT_ITER (1 << 14) -#define AVL_IMPL_SUBST (1 << 15) - -#define AVL_IMPL_ALL (~0) - -#undef L_ -#undef L_EST_LONG_BIT -#undef L_SIZE -#undef L_SC -#undef L_LONG_BIT -#undef L_BIT_ARR_DEFN - -#endif // VPX_MEM_MEMORY_MANAGER_INCLUDE_CAVL_IF_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/include/cavl_impl.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/include/cavl_impl.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/include/cavl_impl.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/include/cavl_impl.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,1152 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VPX_MEM_MEMORY_MANAGER_INCLUDE_CAVL_IMPL_H_ -#define VPX_MEM_MEMORY_MANAGER_INCLUDE_CAVL_IMPL_H_ - -/* Abstract AVL Tree Generic C Package. -** Implementation generation header file. -** -** This code is in the public domain. See cavl_tree.html for interface -** documentation. -** -** Version: 1.5 Author: Walt Karas -*/ - -#undef L_ -#undef L_EST_LONG_BIT -#undef L_SIZE -#undef l_tree -#undef L_MASK_HIGH_BIT -#undef L_LONG_BIT -#undef L_BIT_ARR_DEFN -#undef L_BIT_ARR_VAL -#undef L_BIT_ARR_0 -#undef L_BIT_ARR_1 -#undef L_BIT_ARR_ALL -#undef L_BIT_ARR_LONGS -#undef L_IMPL_MASK -#undef L_CHECK_READ_ERROR -#undef L_CHECK_READ_ERROR_INV_DEPTH -#undef L_SC -#undef L_BALANCE_PARAM_PREFIX - -#ifdef AVL_UNIQUE - -#define L_ AVL_UNIQUE - -#else - -#define L_(X) X - -#endif - -/* Determine correct storage class for functions */ -#ifdef AVL_PRIVATE - -#define L_SC static - -#else - -#define L_SC - -#endif - -#ifdef AVL_SIZE - -#define L_SIZE AVL_SIZE - -#else - -#define L_SIZE unsigned long - -#endif - -#define L_MASK_HIGH_BIT ((int) ~ ((~ (unsigned) 0) >> 1)) - -/* ANSI C/ISO C++ require that a long have at least 32 bits. Set -** L_EST_LONG_BIT to be the greatest multiple of 8 in the range -** 32 - 64 (inclusive) that is less than or equal to the number of -** bits in a long. -*/ - -#if (((LONG_MAX >> 31) >> 7) == 0) - -#define L_EST_LONG_BIT 32 - -#elif (((LONG_MAX >> 31) >> 15) == 0) - -#define L_EST_LONG_BIT 40 - -#elif (((LONG_MAX >> 31) >> 23) == 0) - -#define L_EST_LONG_BIT 48 - -#elif (((LONG_MAX >> 31) >> 31) == 0) - -#define L_EST_LONG_BIT 56 - -#else - -#define L_EST_LONG_BIT 64 - -#endif - -#define L_LONG_BIT (sizeof(long) * CHAR_BIT) - -#if ((AVL_MAX_DEPTH) > L_EST_LONG_BIT) - -/* The maximum depth may be greater than the number of bits in a long, -** so multiple longs are needed to hold a bit array indexed by node -** depth. */ - -#define L_BIT_ARR_LONGS (((AVL_MAX_DEPTH) + L_LONG_BIT - 1) / L_LONG_BIT) - -#define L_BIT_ARR_DEFN(NAME) unsigned long NAME[L_BIT_ARR_LONGS]; - -#define L_BIT_ARR_VAL(BIT_ARR, BIT_NUM) \ - ((BIT_ARR)[(BIT_NUM) / L_LONG_BIT] & (1L << ((BIT_NUM) % L_LONG_BIT))) - -#define L_BIT_ARR_0(BIT_ARR, BIT_NUM) \ - (BIT_ARR)[(BIT_NUM) / L_LONG_BIT] &= ~(1L << ((BIT_NUM) % L_LONG_BIT)); - -#define L_BIT_ARR_1(BIT_ARR, BIT_NUM) \ - (BIT_ARR)[(BIT_NUM) / L_LONG_BIT] |= 1L << ((BIT_NUM) % L_LONG_BIT); - -#define L_BIT_ARR_ALL(BIT_ARR, BIT_VAL) \ - { int i = L_BIT_ARR_LONGS; do (BIT_ARR)[--i] = 0L - (BIT_VAL); while(i); } - -#else /* The bit array can definitely fit in one long */ - -#define L_BIT_ARR_DEFN(NAME) unsigned long NAME; - -#define L_BIT_ARR_VAL(BIT_ARR, BIT_NUM) ((BIT_ARR) & (1L << (BIT_NUM))) - -#define L_BIT_ARR_0(BIT_ARR, BIT_NUM) (BIT_ARR) &= ~(1L << (BIT_NUM)); - -#define L_BIT_ARR_1(BIT_ARR, BIT_NUM) (BIT_ARR) |= 1L << (BIT_NUM); - -#define L_BIT_ARR_ALL(BIT_ARR, BIT_VAL) (BIT_ARR) = 0L - (BIT_VAL); - -#endif - -#ifdef AVL_READ_ERRORS_HAPPEN - -#define L_CHECK_READ_ERROR(ERROR_RETURN) \ - { if (AVL_READ_ERROR) return(ERROR_RETURN); } - -#else - -#define L_CHECK_READ_ERROR(ERROR_RETURN) - -#endif - -/* The presumed reason that an instantiation places additional fields -** inside the AVL tree structure is that the SET_ and GET_ macros -** need these fields. The "balance" function does not explicitly use -** any fields in the AVL tree structure, so only pass an AVL tree -** structure pointer to "balance" if it has instantiation-specific -** fields that are (presumably) needed by the SET_/GET_ calls within -** "balance". -*/ -#ifdef AVL_INSIDE_STRUCT - -#define L_BALANCE_PARAM_CALL_PREFIX l_tree, -#define L_BALANCE_PARAM_DECL_PREFIX L_(avl) *l_tree, - -#else - -#define L_BALANCE_PARAM_CALL_PREFIX -#define L_BALANCE_PARAM_DECL_PREFIX - -#endif - -#ifdef AVL_IMPL_MASK - -#define L_IMPL_MASK (AVL_IMPL_MASK) - -#else - -/* Define all functions. */ -#define L_IMPL_MASK AVL_IMPL_ALL - -#endif - -#if (L_IMPL_MASK & AVL_IMPL_INIT) - -L_SC void L_(init)(L_(avl) *l_tree) { - l_tree->root = AVL_NULL; -} - -#endif - -#if (L_IMPL_MASK & AVL_IMPL_IS_EMPTY) - -L_SC int L_(is_empty)(L_(avl) *l_tree) { - return(l_tree->root == AVL_NULL); -} - -#endif - -/* Put the private balance function in the same compilation module as -** the insert function. */ -#if (L_IMPL_MASK & AVL_IMPL_INSERT) - -/* Balances subtree, returns handle of root node of subtree after balancing. -*/ -L_SC AVL_HANDLE L_(balance)(L_BALANCE_PARAM_DECL_PREFIX AVL_HANDLE bal_h) { - AVL_HANDLE deep_h; - - /* Either the "greater than" or the "less than" subtree of - ** this node has to be 2 levels deeper (or else it wouldn't - ** need balancing). - */ - if (AVL_GET_BALANCE_FACTOR(bal_h) > 0) { - /* "Greater than" subtree is deeper. */ - - deep_h = AVL_GET_GREATER(bal_h, 1); - - L_CHECK_READ_ERROR(AVL_NULL) - - if (AVL_GET_BALANCE_FACTOR(deep_h) < 0) { - int bf; - - AVL_HANDLE old_h = bal_h; - bal_h = AVL_GET_LESS(deep_h, 1); - L_CHECK_READ_ERROR(AVL_NULL) - AVL_SET_GREATER(old_h, AVL_GET_LESS(bal_h, 1)) - AVL_SET_LESS(deep_h, AVL_GET_GREATER(bal_h, 1)) - AVL_SET_LESS(bal_h, old_h) - AVL_SET_GREATER(bal_h, deep_h) - - bf = AVL_GET_BALANCE_FACTOR(bal_h); - - if (bf != 0) { - if (bf > 0) { - AVL_SET_BALANCE_FACTOR(old_h, -1) - AVL_SET_BALANCE_FACTOR(deep_h, 0) - } else { - AVL_SET_BALANCE_FACTOR(deep_h, 1) - AVL_SET_BALANCE_FACTOR(old_h, 0) - } - - AVL_SET_BALANCE_FACTOR(bal_h, 0) - } else { - AVL_SET_BALANCE_FACTOR(old_h, 0) - AVL_SET_BALANCE_FACTOR(deep_h, 0) - } - } else { - AVL_SET_GREATER(bal_h, AVL_GET_LESS(deep_h, 0)) - AVL_SET_LESS(deep_h, bal_h) - - if (AVL_GET_BALANCE_FACTOR(deep_h) == 0) { - AVL_SET_BALANCE_FACTOR(deep_h, -1) - AVL_SET_BALANCE_FACTOR(bal_h, 1) - } else { - AVL_SET_BALANCE_FACTOR(deep_h, 0) - AVL_SET_BALANCE_FACTOR(bal_h, 0) - } - - bal_h = deep_h; - } - } else { - /* "Less than" subtree is deeper. */ - - deep_h = AVL_GET_LESS(bal_h, 1); - L_CHECK_READ_ERROR(AVL_NULL) - - if (AVL_GET_BALANCE_FACTOR(deep_h) > 0) { - int bf; - AVL_HANDLE old_h = bal_h; - bal_h = AVL_GET_GREATER(deep_h, 1); - L_CHECK_READ_ERROR(AVL_NULL) - AVL_SET_LESS(old_h, AVL_GET_GREATER(bal_h, 0)) - AVL_SET_GREATER(deep_h, AVL_GET_LESS(bal_h, 0)) - AVL_SET_GREATER(bal_h, old_h) - AVL_SET_LESS(bal_h, deep_h) - - bf = AVL_GET_BALANCE_FACTOR(bal_h); - - if (bf != 0) { - if (bf < 0) { - AVL_SET_BALANCE_FACTOR(old_h, 1) - AVL_SET_BALANCE_FACTOR(deep_h, 0) - } else { - AVL_SET_BALANCE_FACTOR(deep_h, -1) - AVL_SET_BALANCE_FACTOR(old_h, 0) - } - - AVL_SET_BALANCE_FACTOR(bal_h, 0) - } else { - AVL_SET_BALANCE_FACTOR(old_h, 0) - AVL_SET_BALANCE_FACTOR(deep_h, 0) - } - } else { - AVL_SET_LESS(bal_h, AVL_GET_GREATER(deep_h, 0)) - AVL_SET_GREATER(deep_h, bal_h) - - if (AVL_GET_BALANCE_FACTOR(deep_h) == 0) { - AVL_SET_BALANCE_FACTOR(deep_h, 1) - AVL_SET_BALANCE_FACTOR(bal_h, -1) - } else { - AVL_SET_BALANCE_FACTOR(deep_h, 0) - AVL_SET_BALANCE_FACTOR(bal_h, 0) - } - - bal_h = deep_h; - } - } - - return(bal_h); -} - -L_SC AVL_HANDLE L_(insert)(L_(avl) *l_tree, AVL_HANDLE h) { - AVL_SET_LESS(h, AVL_NULL) - AVL_SET_GREATER(h, AVL_NULL) - AVL_SET_BALANCE_FACTOR(h, 0) - - if (l_tree->root == AVL_NULL) - l_tree->root = h; - else { - /* Last unbalanced node encountered in search for insertion point. */ - AVL_HANDLE unbal = AVL_NULL; - /* Parent of last unbalanced node. */ - AVL_HANDLE parent_unbal = AVL_NULL; - /* Balance factor of last unbalanced node. */ - int unbal_bf; - - /* Zero-based depth in tree. */ - unsigned depth = 0, unbal_depth = 0; - - /* Records a path into the tree. If bit n is true, indicates - ** take greater branch from the nth node in the path, otherwise - ** take the less branch. bit 0 gives branch from root, and - ** so on. */ - L_BIT_ARR_DEFN(branch) - - AVL_HANDLE hh = l_tree->root; - AVL_HANDLE parent = AVL_NULL; - int cmp; - - do { - if (AVL_GET_BALANCE_FACTOR(hh) != 0) { - unbal = hh; - parent_unbal = parent; - unbal_depth = depth; - } - - cmp = AVL_COMPARE_NODE_NODE(h, hh); - - if (cmp == 0) - /* Duplicate key. */ - return(hh); - - parent = hh; - - if (cmp > 0) { - hh = AVL_GET_GREATER(hh, 1); - L_BIT_ARR_1(branch, depth) - } else { - hh = AVL_GET_LESS(hh, 1); - L_BIT_ARR_0(branch, depth) - } - - L_CHECK_READ_ERROR(AVL_NULL) - depth++; - } while (hh != AVL_NULL); - - /* Add node to insert as leaf of tree. */ - if (cmp < 0) - AVL_SET_LESS(parent, h) - else - AVL_SET_GREATER(parent, h) - - depth = unbal_depth; - - if (unbal == AVL_NULL) - hh = l_tree->root; - else { - cmp = L_BIT_ARR_VAL(branch, depth) ? 1 : -1; - depth++; - unbal_bf = AVL_GET_BALANCE_FACTOR(unbal); - - if (cmp < 0) - unbal_bf--; - else /* cmp > 0 */ - unbal_bf++; - - hh = cmp < 0 ? AVL_GET_LESS(unbal, 1) : AVL_GET_GREATER(unbal, 1); - L_CHECK_READ_ERROR(AVL_NULL) - - if ((unbal_bf != -2) && (unbal_bf != 2)) { - /* No rebalancing of tree is necessary. */ - AVL_SET_BALANCE_FACTOR(unbal, unbal_bf) - unbal = AVL_NULL; - } - } - - if (hh != AVL_NULL) - while (h != hh) { - cmp = L_BIT_ARR_VAL(branch, depth) ? 1 : -1; - depth++; - - if (cmp < 0) { - AVL_SET_BALANCE_FACTOR(hh, -1) - hh = AVL_GET_LESS(hh, 1); - } else { /* cmp > 0 */ - AVL_SET_BALANCE_FACTOR(hh, 1) - hh = AVL_GET_GREATER(hh, 1); - } - - L_CHECK_READ_ERROR(AVL_NULL) - } - - if (unbal != AVL_NULL) { - unbal = L_(balance)(L_BALANCE_PARAM_CALL_PREFIX unbal); - L_CHECK_READ_ERROR(AVL_NULL) - - if (parent_unbal == AVL_NULL) - l_tree->root = unbal; - else { - depth = unbal_depth - 1; - cmp = L_BIT_ARR_VAL(branch, depth) ? 1 : -1; - - if (cmp < 0) - AVL_SET_LESS(parent_unbal, unbal) - else /* cmp > 0 */ - AVL_SET_GREATER(parent_unbal, unbal) - } - } - - } - - return(h); -} - -#endif - -#if (L_IMPL_MASK & AVL_IMPL_SEARCH) - -L_SC AVL_HANDLE L_(search)(L_(avl) *l_tree, AVL_KEY k, avl_search_type st) { - int cmp, target_cmp; - AVL_HANDLE match_h = AVL_NULL; - AVL_HANDLE h = l_tree->root; - - if (st & AVL_LESS) - target_cmp = 1; - else if (st & AVL_GREATER) - target_cmp = -1; - else - target_cmp = 0; - - while (h != AVL_NULL) { - cmp = AVL_COMPARE_KEY_NODE(k, h); - - if (cmp == 0) { - if (st & AVL_EQUAL) { - match_h = h; - break; - } - - cmp = -target_cmp; - } else if (target_cmp != 0) - if (!((cmp ^ target_cmp) & L_MASK_HIGH_BIT)) - /* cmp and target_cmp are both positive or both negative. */ - match_h = h; - - h = cmp < 0 ? AVL_GET_LESS(h, 1) : AVL_GET_GREATER(h, 1); - L_CHECK_READ_ERROR(AVL_NULL) - } - - return(match_h); -} - -#endif - -#if (L_IMPL_MASK & AVL_IMPL_SEARCH_LEAST) - -L_SC AVL_HANDLE L_(search_least)(L_(avl) *l_tree) { - AVL_HANDLE h = l_tree->root; - AVL_HANDLE parent = AVL_NULL; - - while (h != AVL_NULL) { - parent = h; - h = AVL_GET_LESS(h, 1); - L_CHECK_READ_ERROR(AVL_NULL) - } - - return(parent); -} - -#endif - -#if (L_IMPL_MASK & AVL_IMPL_SEARCH_GREATEST) - -L_SC AVL_HANDLE L_(search_greatest)(L_(avl) *l_tree) { - AVL_HANDLE h = l_tree->root; - AVL_HANDLE parent = AVL_NULL; - - while (h != AVL_NULL) { - parent = h; - h = AVL_GET_GREATER(h, 1); - L_CHECK_READ_ERROR(AVL_NULL) - } - - return(parent); -} - -#endif - -#if (L_IMPL_MASK & AVL_IMPL_REMOVE) - -/* Prototype of balance function (called by remove) in case not in -** same compilation unit. -*/ -L_SC AVL_HANDLE L_(balance)(L_BALANCE_PARAM_DECL_PREFIX AVL_HANDLE bal_h); - -L_SC AVL_HANDLE L_(remove)(L_(avl) *l_tree, AVL_KEY k) { - /* Zero-based depth in tree. */ - unsigned depth = 0, rm_depth; - - /* Records a path into the tree. If bit n is true, indicates - ** take greater branch from the nth node in the path, otherwise - ** take the less branch. bit 0 gives branch from root, and - ** so on. */ - L_BIT_ARR_DEFN(branch) - - AVL_HANDLE h = l_tree->root; - AVL_HANDLE parent = AVL_NULL; - AVL_HANDLE child; - AVL_HANDLE path; - int cmp, cmp_shortened_sub_with_path; - int reduced_depth; - int bf; - AVL_HANDLE rm; - AVL_HANDLE parent_rm; - - for (;;) { - if (h == AVL_NULL) - /* No node in tree with given key. */ - return(AVL_NULL); - - cmp = AVL_COMPARE_KEY_NODE(k, h); - - if (cmp == 0) - /* Found node to remove. */ - break; - - parent = h; - - if (cmp > 0) { - h = AVL_GET_GREATER(h, 1); - L_BIT_ARR_1(branch, depth) - } else { - h = AVL_GET_LESS(h, 1); - L_BIT_ARR_0(branch, depth) - } - - L_CHECK_READ_ERROR(AVL_NULL) - depth++; - cmp_shortened_sub_with_path = cmp; - } - - rm = h; - parent_rm = parent; - rm_depth = depth; - - /* If the node to remove is not a leaf node, we need to get a - ** leaf node, or a node with a single leaf as its child, to put - ** in the place of the node to remove. We will get the greatest - ** node in the less subtree (of the node to remove), or the least - ** node in the greater subtree. We take the leaf node from the - ** deeper subtree, if there is one. */ - - if (AVL_GET_BALANCE_FACTOR(h) < 0) { - child = AVL_GET_LESS(h, 1); - L_BIT_ARR_0(branch, depth) - cmp = -1; - } else { - child = AVL_GET_GREATER(h, 1); - L_BIT_ARR_1(branch, depth) - cmp = 1; - } - - L_CHECK_READ_ERROR(AVL_NULL) - depth++; - - if (child != AVL_NULL) { - cmp = -cmp; - - do { - parent = h; - h = child; - - if (cmp < 0) { - child = AVL_GET_LESS(h, 1); - L_BIT_ARR_0(branch, depth) - } else { - child = AVL_GET_GREATER(h, 1); - L_BIT_ARR_1(branch, depth) - } - - L_CHECK_READ_ERROR(AVL_NULL) - depth++; - } while (child != AVL_NULL); - - if (parent == rm) - /* Only went through do loop once. Deleted node will be replaced - ** in the tree structure by one of its immediate children. */ - cmp_shortened_sub_with_path = -cmp; - else - cmp_shortened_sub_with_path = cmp; - - /* Get the handle of the opposite child, which may not be null. */ - child = cmp > 0 ? AVL_GET_LESS(h, 0) : AVL_GET_GREATER(h, 0); - } - - if (parent == AVL_NULL) - /* There were only 1 or 2 nodes in this tree. */ - l_tree->root = child; - else if (cmp_shortened_sub_with_path < 0) - AVL_SET_LESS(parent, child) - else - AVL_SET_GREATER(parent, child) - - /* "path" is the parent of the subtree being eliminated or reduced - ** from a depth of 2 to 1. If "path" is the node to be removed, we - ** set path to the node we're about to poke into the position of the - ** node to be removed. */ - path = parent == rm ? h : parent; - - if (h != rm) { - /* Poke in the replacement for the node to be removed. */ - AVL_SET_LESS(h, AVL_GET_LESS(rm, 0)) - AVL_SET_GREATER(h, AVL_GET_GREATER(rm, 0)) - AVL_SET_BALANCE_FACTOR(h, AVL_GET_BALANCE_FACTOR(rm)) - - if (parent_rm == AVL_NULL) - l_tree->root = h; - else { - depth = rm_depth - 1; - - if (L_BIT_ARR_VAL(branch, depth)) - AVL_SET_GREATER(parent_rm, h) - else - AVL_SET_LESS(parent_rm, h) - } - } - - if (path != AVL_NULL) { - /* Create a temporary linked list from the parent of the path node - ** to the root node. */ - h = l_tree->root; - parent = AVL_NULL; - depth = 0; - - while (h != path) { - if (L_BIT_ARR_VAL(branch, depth)) { - child = AVL_GET_GREATER(h, 1); - AVL_SET_GREATER(h, parent) - } else { - child = AVL_GET_LESS(h, 1); - AVL_SET_LESS(h, parent) - } - - L_CHECK_READ_ERROR(AVL_NULL) - depth++; - parent = h; - h = child; - } - - /* Climb from the path node to the root node using the linked - ** list, restoring the tree structure and rebalancing as necessary. - */ - reduced_depth = 1; - cmp = cmp_shortened_sub_with_path; - - for (;;) { - if (reduced_depth) { - bf = AVL_GET_BALANCE_FACTOR(h); - - if (cmp < 0) - bf++; - else /* cmp > 0 */ - bf--; - - if ((bf == -2) || (bf == 2)) { - h = L_(balance)(L_BALANCE_PARAM_CALL_PREFIX h); - L_CHECK_READ_ERROR(AVL_NULL) - bf = AVL_GET_BALANCE_FACTOR(h); - } else - AVL_SET_BALANCE_FACTOR(h, bf) - reduced_depth = (bf == 0); - } - - if (parent == AVL_NULL) - break; - - child = h; - h = parent; - depth--; - cmp = L_BIT_ARR_VAL(branch, depth) ? 1 : -1; - - if (cmp < 0) { - parent = AVL_GET_LESS(h, 1); - AVL_SET_LESS(h, child) - } else { - parent = AVL_GET_GREATER(h, 1); - AVL_SET_GREATER(h, child) - } - - L_CHECK_READ_ERROR(AVL_NULL) - } - - l_tree->root = h; - } - - return(rm); -} - -#endif - -#if (L_IMPL_MASK & AVL_IMPL_SUBST) - -L_SC AVL_HANDLE L_(subst)(L_(avl) *l_tree, AVL_HANDLE new_node) { - AVL_HANDLE h = l_tree->root; - AVL_HANDLE parent = AVL_NULL; - int cmp, last_cmp; - - /* Search for node already in tree with same key. */ - for (;;) { - if (h == AVL_NULL) - /* No node in tree with same key as new node. */ - return(AVL_NULL); - - cmp = AVL_COMPARE_NODE_NODE(new_node, h); - - if (cmp == 0) - /* Found the node to substitute new one for. */ - break; - - last_cmp = cmp; - parent = h; - h = cmp < 0 ? AVL_GET_LESS(h, 1) : AVL_GET_GREATER(h, 1); - L_CHECK_READ_ERROR(AVL_NULL) - } - - /* Copy tree housekeeping fields from node in tree to new node. */ - AVL_SET_LESS(new_node, AVL_GET_LESS(h, 0)) - AVL_SET_GREATER(new_node, AVL_GET_GREATER(h, 0)) - AVL_SET_BALANCE_FACTOR(new_node, AVL_GET_BALANCE_FACTOR(h)) - - if (parent == AVL_NULL) - /* New node is also new root. */ - l_tree->root = new_node; - else { - /* Make parent point to new node. */ - if (last_cmp < 0) - AVL_SET_LESS(parent, new_node) - else - AVL_SET_GREATER(parent, new_node) - } - - return(h); -} - -#endif - -#ifdef AVL_BUILD_ITER_TYPE - -#if (L_IMPL_MASK & AVL_IMPL_BUILD) - -L_SC int L_(build)( - L_(avl) *l_tree, AVL_BUILD_ITER_TYPE p, L_SIZE num_nodes) { - /* Gives path to subtree being built. If bit n is false, branch - ** less from the node at depth n, if true branch greater. */ - L_BIT_ARR_DEFN(branch) - - /* If bit n is true, then for the current subtree at depth n, its - ** greater subtree has one more node than its less subtree. */ - L_BIT_ARR_DEFN(rem) - - /* Depth of root node of current subtree. */ - unsigned depth = 0; - - /* Number of nodes in current subtree. */ - L_SIZE num_sub = num_nodes; - - /* The algorithm relies on a stack of nodes whose less subtree has - ** been built, but whose greater subtree has not yet been built. - ** The stack is implemented as linked list. The nodes are linked - ** together by having the "greater" handle of a node set to the - ** next node in the list. "less_parent" is the handle of the first - ** node in the list. */ - AVL_HANDLE less_parent = AVL_NULL; - - /* h is root of current subtree, child is one of its children. */ - AVL_HANDLE h; - AVL_HANDLE child; - - if (num_nodes == 0) { - l_tree->root = AVL_NULL; - return(1); - } - - for (;;) { - while (num_sub > 2) { - /* Subtract one for root of subtree. */ - num_sub--; - - if (num_sub & 1) - L_BIT_ARR_1(rem, depth) - else - L_BIT_ARR_0(rem, depth) - L_BIT_ARR_0(branch, depth) - depth++; - - num_sub >>= 1; - } - - if (num_sub == 2) { - /* Build a subtree with two nodes, slanting to greater. - ** I arbitrarily chose to always have the extra node in the - ** greater subtree when there is an odd number of nodes to - ** split between the two subtrees. */ - - h = AVL_BUILD_ITER_VAL(p); - L_CHECK_READ_ERROR(0) - AVL_BUILD_ITER_INCR(p) - child = AVL_BUILD_ITER_VAL(p); - L_CHECK_READ_ERROR(0) - AVL_BUILD_ITER_INCR(p) - AVL_SET_LESS(child, AVL_NULL) - AVL_SET_GREATER(child, AVL_NULL) - AVL_SET_BALANCE_FACTOR(child, 0) - AVL_SET_GREATER(h, child) - AVL_SET_LESS(h, AVL_NULL) - AVL_SET_BALANCE_FACTOR(h, 1) - } else { /* num_sub == 1 */ - /* Build a subtree with one node. */ - - h = AVL_BUILD_ITER_VAL(p); - L_CHECK_READ_ERROR(0) - AVL_BUILD_ITER_INCR(p) - AVL_SET_LESS(h, AVL_NULL) - AVL_SET_GREATER(h, AVL_NULL) - AVL_SET_BALANCE_FACTOR(h, 0) - } - - while (depth) { - depth--; - - if (!L_BIT_ARR_VAL(branch, depth)) - /* We've completed a less subtree. */ - break; - - /* We've completed a greater subtree, so attach it to - ** its parent (that is less than it). We pop the parent - ** off the stack of less parents. */ - child = h; - h = less_parent; - less_parent = AVL_GET_GREATER(h, 1); - L_CHECK_READ_ERROR(0) - AVL_SET_GREATER(h, child) - /* num_sub = 2 * (num_sub - rem[depth]) + rem[depth] + 1 */ - num_sub <<= 1; - num_sub += L_BIT_ARR_VAL(rem, depth) ? 0 : 1; - - if (num_sub & (num_sub - 1)) - /* num_sub is not a power of 2. */ - AVL_SET_BALANCE_FACTOR(h, 0) - else - /* num_sub is a power of 2. */ - AVL_SET_BALANCE_FACTOR(h, 1) - } - - if (num_sub == num_nodes) - /* We've completed the full tree. */ - break; - - /* The subtree we've completed is the less subtree of the - ** next node in the sequence. */ - - child = h; - h = AVL_BUILD_ITER_VAL(p); - L_CHECK_READ_ERROR(0) - AVL_BUILD_ITER_INCR(p) - AVL_SET_LESS(h, child) - - /* Put h into stack of less parents. */ - AVL_SET_GREATER(h, less_parent) - less_parent = h; - - /* Proceed to creating greater than subtree of h. */ - L_BIT_ARR_1(branch, depth) - num_sub += L_BIT_ARR_VAL(rem, depth) ? 1 : 0; - depth++; - - } /* end for (;; ) */ - - l_tree->root = h; - - return(1); -} - -#endif - -#endif - -#if (L_IMPL_MASK & AVL_IMPL_INIT_ITER) - -/* Initialize depth to invalid value, to indicate iterator is -** invalid. (Depth is zero-base.) It's not necessary to initialize -** iterators prior to passing them to the "start" function. -*/ -L_SC void L_(init_iter)(L_(iter) *iter) { - iter->depth = ~0; -} - -#endif - -#ifdef AVL_READ_ERRORS_HAPPEN - -#define L_CHECK_READ_ERROR_INV_DEPTH \ - { if (AVL_READ_ERROR) { iter->depth = ~0; return; } } - -#else - -#define L_CHECK_READ_ERROR_INV_DEPTH - -#endif - -#if (L_IMPL_MASK & AVL_IMPL_START_ITER) - -L_SC void L_(start_iter)( - L_(avl) *l_tree, L_(iter) *iter, AVL_KEY k, avl_search_type st) { - AVL_HANDLE h = l_tree->root; - unsigned d = 0; - int cmp, target_cmp; - - /* Save the tree that we're going to iterate through in a - ** member variable. */ - iter->tree_ = l_tree; - - iter->depth = ~0; - - if (h == AVL_NULL) - /* Tree is empty. */ - return; - - if (st & AVL_LESS) - /* Key can be greater than key of starting node. */ - target_cmp = 1; - else if (st & AVL_GREATER) - /* Key can be less than key of starting node. */ - target_cmp = -1; - else - /* Key must be same as key of starting node. */ - target_cmp = 0; - - for (;;) { - cmp = AVL_COMPARE_KEY_NODE(k, h); - - if (cmp == 0) { - if (st & AVL_EQUAL) { - /* Equal node was sought and found as starting node. */ - iter->depth = d; - break; - } - - cmp = -target_cmp; - } else if (target_cmp != 0) - if (!((cmp ^ target_cmp) & L_MASK_HIGH_BIT)) - /* cmp and target_cmp are both negative or both positive. */ - iter->depth = d; - - h = cmp < 0 ? AVL_GET_LESS(h, 1) : AVL_GET_GREATER(h, 1); - L_CHECK_READ_ERROR_INV_DEPTH - - if (h == AVL_NULL) - break; - - if (cmp > 0) - L_BIT_ARR_1(iter->branch, d) - else - L_BIT_ARR_0(iter->branch, d) - iter->path_h[d++] = h; - } -} - -#endif - -#if (L_IMPL_MASK & AVL_IMPL_START_ITER_LEAST) - -L_SC void L_(start_iter_least)(L_(avl) *l_tree, L_(iter) *iter) { - AVL_HANDLE h = l_tree->root; - - iter->tree_ = l_tree; - - iter->depth = ~0; - - L_BIT_ARR_ALL(iter->branch, 0) - - while (h != AVL_NULL) { - if (iter->depth != ~0) - iter->path_h[iter->depth] = h; - - iter->depth++; - h = AVL_GET_LESS(h, 1); - L_CHECK_READ_ERROR_INV_DEPTH - } -} - -#endif - -#if (L_IMPL_MASK & AVL_IMPL_START_ITER_GREATEST) - -L_SC void L_(start_iter_greatest)(L_(avl) *l_tree, L_(iter) *iter) { - AVL_HANDLE h = l_tree->root; - - iter->tree_ = l_tree; - - iter->depth = ~0; - - L_BIT_ARR_ALL(iter->branch, 1) - - while (h != AVL_NULL) { - if (iter->depth != ~0) - iter->path_h[iter->depth] = h; - - iter->depth++; - h = AVL_GET_GREATER(h, 1); - L_CHECK_READ_ERROR_INV_DEPTH - } -} - -#endif - -#if (L_IMPL_MASK & AVL_IMPL_GET_ITER) - -L_SC AVL_HANDLE L_(get_iter)(L_(iter) *iter) { - if (iter->depth == ~0) - return(AVL_NULL); - - return(iter->depth == 0 ? - iter->tree_->root : iter->path_h[iter->depth - 1]); -} - -#endif - -#if (L_IMPL_MASK & AVL_IMPL_INCR_ITER) - -L_SC void L_(incr_iter)(L_(iter) *iter) { -#define l_tree (iter->tree_) - - if (iter->depth != ~0) { - AVL_HANDLE h = - AVL_GET_GREATER((iter->depth == 0 ? - iter->tree_->root : iter->path_h[iter->depth - 1]), 1); - L_CHECK_READ_ERROR_INV_DEPTH - - if (h == AVL_NULL) - do { - if (iter->depth == 0) { - iter->depth = ~0; - break; - } - - iter->depth--; - } while (L_BIT_ARR_VAL(iter->branch, iter->depth)); - else { - L_BIT_ARR_1(iter->branch, iter->depth) - iter->path_h[iter->depth++] = h; - - for (;;) { - h = AVL_GET_LESS(h, 1); - L_CHECK_READ_ERROR_INV_DEPTH - - if (h == AVL_NULL) - break; - - L_BIT_ARR_0(iter->branch, iter->depth) - iter->path_h[iter->depth++] = h; - } - } - } - -#undef l_tree -} - -#endif - -#if (L_IMPL_MASK & AVL_IMPL_DECR_ITER) - -L_SC void L_(decr_iter)(L_(iter) *iter) { -#define l_tree (iter->tree_) - - if (iter->depth != ~0) { - AVL_HANDLE h = - AVL_GET_LESS((iter->depth == 0 ? - iter->tree_->root : iter->path_h[iter->depth - 1]), 1); - L_CHECK_READ_ERROR_INV_DEPTH - - if (h == AVL_NULL) - do { - if (iter->depth == 0) { - iter->depth = ~0; - break; - } - - iter->depth--; - } while (!L_BIT_ARR_VAL(iter->branch, iter->depth)); - else { - L_BIT_ARR_0(iter->branch, iter->depth) - iter->path_h[iter->depth++] = h; - - for (;;) { - h = AVL_GET_GREATER(h, 1); - L_CHECK_READ_ERROR_INV_DEPTH - - if (h == AVL_NULL) - break; - - L_BIT_ARR_1(iter->branch, iter->depth) - iter->path_h[iter->depth++] = h; - } - } - } - -#undef l_tree -} - -#endif - -/* Tidy up the preprocessor symbol name space. */ -#undef L_ -#undef L_EST_LONG_BIT -#undef L_SIZE -#undef L_MASK_HIGH_BIT -#undef L_LONG_BIT -#undef L_BIT_ARR_DEFN -#undef L_BIT_ARR_VAL -#undef L_BIT_ARR_0 -#undef L_BIT_ARR_1 -#undef L_BIT_ARR_ALL -#undef L_CHECK_READ_ERROR -#undef L_CHECK_READ_ERROR_INV_DEPTH -#undef L_BIT_ARR_LONGS -#undef L_IMPL_MASK -#undef L_CHECK_READ_ERROR -#undef L_CHECK_READ_ERROR_INV_DEPTH -#undef L_SC -#undef L_BALANCE_PARAM_CALL_PREFIX -#undef L_BALANCE_PARAM_DECL_PREFIX - -#endif // VPX_MEM_MEMORY_MANAGER_INCLUDE_CAVL_IMPL_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/include/heapmm.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/include/heapmm.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/include/heapmm.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/include/heapmm.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VPX_MEM_MEMORY_MANAGER_INCLUDE_HEAPMM_H_ -#define VPX_MEM_MEMORY_MANAGER_INCLUDE_HEAPMM_H_ - -/* This code is in the public domain. -** Version: 1.1 Author: Walt Karas -*/ - -/* External header file for Heap Memory Manager. See documentation in -** heapmm.html. -*/ - -#undef HMM_PROCESS - -/* Include once per configuration in a particular translation unit. */ - -#ifndef HMM_CNFG_NUM - -/* Default configuration. */ - -#ifndef HMM_INC_CNFG_DFLT -#define HMM_INC_CNFG_DFLT -#define HMM_PROCESS -#endif - -#elif HMM_CNFG_NUM == 0 - -/* Test configuration. */ - -#ifndef HMM_INC_CNFG_0 -#define HMM_INC_CNFG_0 -#define HMM_PROCESS -#endif - -#elif HMM_CNFG_NUM == 1 - -#ifndef HMM_INC_CNFG_1 -#define HMM_INC_CNFG_1 -#define HMM_PROCESS -#endif - -#elif HMM_CNFG_NUM == 2 - -#ifndef HMM_INC_CNFG_2 -#define HMM_INC_CNFG_2 -#define HMM_PROCESS -#endif - -#elif HMM_CNFG_NUM == 3 - -#ifndef HMM_INC_CNFG_3 -#define HMM_INC_CNFG_3 -#define HMM_PROCESS -#endif - -#elif HMM_CNFG_NUM == 4 - -#ifndef HMM_INC_CNFG_4 -#define HMM_INC_CNFG_4 -#define HMM_PROCESS -#endif - -#elif HMM_CNFG_NUM == 5 - -#ifndef HMM_INC_CNFG_5 -#define HMM_INC_CNFG_5 -#define HMM_PROCESS -#endif - -#endif - -#ifdef HMM_PROCESS - -#include "hmm_cnfg.h" - -/* Heap descriptor. */ -typedef struct HMM_UNIQUE(structure) { - /* private: */ - - /* Pointer to (payload of) root node in AVL tree. This field should - ** really be the AVL tree descriptor (type avl_avl). But (in the - ** instantiation of the AVL tree generic package used in package) the - ** AVL tree descriptor simply contains a pointer to the root. So, - ** whenever a pointer to the AVL tree descriptor is needed, I use the - ** cast: - ** - ** (avl_avl *) &(heap_desc->avl_tree_root) - ** - ** (where heap_desc is a pointer to a heap descriptor). This trick - ** allows me to avoid including cavl_if.h in this external header. */ - void *avl_tree_root; - - /* Pointer to first byte of last block freed, after any coalescing. */ - void *last_freed; - - /* public: */ - - HMM_UNIQUE(size_bau) num_baus_can_shrink; - void *end_of_shrinkable_chunk; -} -HMM_UNIQUE(descriptor); - -/* Prototypes for externally-callable functions. */ - -void HMM_UNIQUE(init)(HMM_UNIQUE(descriptor) *desc); - -void *HMM_UNIQUE(alloc)( - HMM_UNIQUE(descriptor) *desc, HMM_UNIQUE(size_aau) num_addr_align_units); - -/* NOT YET IMPLEMENTED */ -void *HMM_UNIQUE(greedy_alloc)( - HMM_UNIQUE(descriptor) *desc, HMM_UNIQUE(size_aau) needed_addr_align_units, - HMM_UNIQUE(size_aau) coveted_addr_align_units); - -int HMM_UNIQUE(resize)( - HMM_UNIQUE(descriptor) *desc, void *mem, - HMM_UNIQUE(size_aau) num_addr_align_units); - -/* NOT YET IMPLEMENTED */ -int HMM_UNIQUE(greedy_resize)( - HMM_UNIQUE(descriptor) *desc, void *mem, - HMM_UNIQUE(size_aau) needed_addr_align_units, - HMM_UNIQUE(size_aau) coveted_addr_align_units); - -void HMM_UNIQUE(free)(HMM_UNIQUE(descriptor) *desc, void *mem); - -HMM_UNIQUE(size_aau) HMM_UNIQUE(true_size)(void *mem); - -HMM_UNIQUE(size_aau) HMM_UNIQUE(largest_available)( - HMM_UNIQUE(descriptor) *desc); - -void HMM_UNIQUE(new_chunk)( - HMM_UNIQUE(descriptor) *desc, void *start_of_chunk, - HMM_UNIQUE(size_bau) num_block_align_units); - -void HMM_UNIQUE(grow_chunk)( - HMM_UNIQUE(descriptor) *desc, void *end_of_chunk, - HMM_UNIQUE(size_bau) num_block_align_units); - -/* NOT YET IMPLEMENTED */ -void HMM_UNIQUE(shrink_chunk)( - HMM_UNIQUE(descriptor) *desc, - HMM_UNIQUE(size_bau) num_block_align_units); - -#endif /* defined HMM_PROCESS */ -#endif // VPX_MEM_MEMORY_MANAGER_INCLUDE_HEAPMM_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/include/hmm_cnfg.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/include/hmm_cnfg.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/include/hmm_cnfg.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/include/hmm_cnfg.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VPX_MEM_MEMORY_MANAGER_INCLUDE_HMM_CNFG_H_ -#define VPX_MEM_MEMORY_MANAGER_INCLUDE_HMM_CNFG_H_ - -/* This code is in the public domain. -** Version: 1.1 Author: Walt Karas -*/ - -/* Configure Heap Memory Manager for processor architecture, compiler, -** and desired performance characteristics. This file is included -** by heapmm.h, so these definitions can be used by code external to -** HMM. You can change the default configuration, and/or create alternate -** configuration(s). -*/ - -/* To allow for multiple configurations of HMM to be used in the same -** compilation unit, undefine all preprocessor symbols that will be -** defined below. -*/ -#undef HMM_ADDR_ALIGN_UNIT -#undef HMM_BLOCK_ALIGN_UNIT -#undef HMM_UNIQUE -#undef HMM_DESC_PARAM -#undef HMM_SYM_TO_STRING -#undef HMM_SYM_TO_STRING -#undef HMM_AUDIT_FAIL - -/* Turn X into a string after one macro expansion pass of X. This trick -** works with both GCC and Visual C++. */ -#define HMM_SYM_TO_STRING(X) HMM_SYM_TO_STRING(X) -#define HMM_SYM_TO_STRING(X) #X - -#ifndef HMM_CNFG_NUM - -/* Default configuration. */ - -/* Use hmm_ prefix to avoid identifier conflicts. */ -#define HMM_UNIQUE(BASE) hmm_ ## BASE - -/* Number of bytes in an Address Alignment Unit (AAU). */ -// fwg -// #define HMM_ADDR_ALIGN_UNIT sizeof(int) -#define HMM_ADDR_ALIGN_UNIT 32 - -/* Number of AAUs in a Block Alignment Unit (BAU). */ -#define HMM_BLOCK_ALIGN_UNIT 1 - -/* Type of unsigned integer big enough to hold the size of a Block in AAUs. */ -typedef unsigned long HMM_UNIQUE(size_aau); - -/* Type of unsigned integer big enough to hold the size of a Block/Chunk -** in BAUs. The high bit will be robbed. */ -typedef unsigned long HMM_UNIQUE(size_bau); - -void hmm_dflt_abort(const char *, const char *); - -/* Actions upon a self-audit failure. Must expand to a single complete -** statement. If you remove the definition of this macro, no self-auditing -** will be performed. */ -#define HMM_AUDIT_FAIL \ - hmm_dflt_abort(__FILE__, HMM_SYM_TO_STRING(__LINE__)); - -#elif HMM_CNFG_NUM == 0 - -/* Definitions for testing. */ - -#define HMM_UNIQUE(BASE) thmm_ ## BASE - -#define HMM_ADDR_ALIGN_UNIT sizeof(int) - -#define HMM_BLOCK_ALIGN_UNIT 3 - -typedef unsigned HMM_UNIQUE(size_aau); - -typedef unsigned short HMM_UNIQUE(size_bau); - -/* Under this test setup, a long jump is done if there is a self-audit -** failure. -*/ - -extern jmp_buf HMM_UNIQUE(jmp_buf); -extern const char *HMM_UNIQUE(fail_file); -extern unsigned HMM_UNIQUE(fail_line); - -#define HMM_AUDIT_FAIL \ - { HMM_UNIQUE(fail_file) = __FILE__; HMM_UNIQUE(fail_line) = __LINE__; \ - longjmp(HMM_UNIQUE(jmp_buf), 1); } - -#elif HMM_CNFG_NUM == 1 - -/* Put configuration 1 definitions here (if there is a configuration 1). */ - -#elif HMM_CNFG_NUM == 2 - -/* Put configuration 2 definitions here. */ - -#elif HMM_CNFG_NUM == 3 - -/* Put configuration 3 definitions here. */ - -#elif HMM_CNFG_NUM == 4 - -/* Put configuration 4 definitions here. */ - -#elif HMM_CNFG_NUM == 5 - -/* Put configuration 5 definitions here. */ - -#endif - -#endif // VPX_MEM_MEMORY_MANAGER_INCLUDE_HMM_CNFG_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/include/hmm_intrnl.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/include/hmm_intrnl.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/memory_manager/include/hmm_intrnl.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/memory_manager/include/hmm_intrnl.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/* This code is in the public domain. -** Version: 1.1 Author: Walt Karas -*/ - -#ifndef VPX_MEM_MEMORY_MANAGER_INCLUDE_HMM_INTRNL_H_ -#define VPX_MEM_MEMORY_MANAGER_INCLUDE_HMM_INTRNL_H_ - -#ifdef __uClinux__ -# include -#endif - -#include "heapmm.h" - -#define U(BASE) HMM_UNIQUE(BASE) - -/* Mask of high bit of variable of size_bau type. */ -#define HIGH_BIT_BAU_SIZE \ - ((U(size_bau)) ~ (((U(size_bau)) ~ (U(size_bau)) 0) >> 1)) - -/* Add a given number of AAUs to pointer. */ -#define AAUS_FORWARD(PTR, AAU_OFFSET) \ - (((char *) (PTR)) + ((AAU_OFFSET) * ((U(size_aau)) HMM_ADDR_ALIGN_UNIT))) - -/* Subtract a given number of AAUs from pointer. */ -#define AAUS_BACKWARD(PTR, AAU_OFFSET) \ - (((char *) (PTR)) - ((AAU_OFFSET) * ((U(size_aau)) HMM_ADDR_ALIGN_UNIT))) - -/* Add a given number of BAUs to a pointer. */ -#define BAUS_FORWARD(PTR, BAU_OFFSET) \ - AAUS_FORWARD((PTR), (BAU_OFFSET) * ((U(size_aau)) HMM_BLOCK_ALIGN_UNIT)) - -/* Subtract a given number of BAUs to a pointer. */ -#define BAUS_BACKWARD(PTR, BAU_OFFSET) \ - AAUS_BACKWARD((PTR), (BAU_OFFSET) * ((U(size_aau)) HMM_BLOCK_ALIGN_UNIT)) - -typedef struct head_struct { - /* Sizes in Block Alignment Units. */ - HMM_UNIQUE(size_bau) previous_block_size, block_size; -} -head_record; - -typedef struct ptr_struct { - struct ptr_struct *self, *prev, *next; -} -ptr_record; - -/* Divide and round up any fraction to the next whole number. */ -#define DIV_ROUND_UP(NUMER, DENOM) (((NUMER) + (DENOM) - 1) / (DENOM)) - -/* Number of AAUs in a block head. */ -#define HEAD_AAUS DIV_ROUND_UP(sizeof(head_record), HMM_ADDR_ALIGN_UNIT) - -/* Number of AAUs in a block pointer record. */ -#define PTR_RECORD_AAUS DIV_ROUND_UP(sizeof(ptr_record), HMM_ADDR_ALIGN_UNIT) - -/* Number of BAUs in a dummy end record (at end of chunk). */ -#define DUMMY_END_BLOCK_BAUS DIV_ROUND_UP(HEAD_AAUS, HMM_BLOCK_ALIGN_UNIT) - -/* Minimum number of BAUs in a block (allowing room for the pointer record. */ -#define MIN_BLOCK_BAUS \ - DIV_ROUND_UP(HEAD_AAUS + PTR_RECORD_AAUS, HMM_BLOCK_ALIGN_UNIT) - -/* Return number of BAUs in block (masking off high bit containing block -** status). */ -#define BLOCK_BAUS(HEAD_PTR) \ - (((head_record *) (HEAD_PTR))->block_size & ~HIGH_BIT_BAU_SIZE) - -/* Return number of BAUs in previous block (masking off high bit containing -** block status). */ -#define PREV_BLOCK_BAUS(HEAD_PTR) \ - (((head_record *) (HEAD_PTR))->previous_block_size & ~HIGH_BIT_BAU_SIZE) - -/* Set number of BAUs in previous block, preserving high bit containing -** block status. */ -#define SET_PREV_BLOCK_BAUS(HEAD_PTR, N_BAUS) \ - { register head_record *h_ptr = (head_record *) (HEAD_PTR); \ - h_ptr->previous_block_size &= HIGH_BIT_BAU_SIZE; \ - h_ptr->previous_block_size |= (N_BAUS); } - -/* Convert pointer to pointer record of block to pointer to block's head -** record. */ -#define PTR_REC_TO_HEAD(PTR_REC_PTR) \ - ((head_record *) AAUS_BACKWARD(PTR_REC_PTR, HEAD_AAUS)) - -/* Convert pointer to block head to pointer to block's pointer record. */ -#define HEAD_TO_PTR_REC(HEAD_PTR) \ - ((ptr_record *) AAUS_FORWARD(HEAD_PTR, HEAD_AAUS)) - -/* Returns non-zero if block is allocated. */ -#define IS_BLOCK_ALLOCATED(HEAD_PTR) \ - (((((head_record *) (HEAD_PTR))->block_size | \ - ((head_record *) (HEAD_PTR))->previous_block_size) & \ - HIGH_BIT_BAU_SIZE) == 0) - -#define MARK_BLOCK_ALLOCATED(HEAD_PTR) \ - { register head_record *h_ptr = (head_record *) (HEAD_PTR); \ - h_ptr->block_size &= ~HIGH_BIT_BAU_SIZE; \ - h_ptr->previous_block_size &= ~HIGH_BIT_BAU_SIZE; } - -/* Mark a block as free when it is not the first block in a bin (and -** therefore not a node in the AVL tree). */ -#define MARK_SUCCESSIVE_BLOCK_IN_FREE_BIN(HEAD_PTR) \ - { register head_record *h_ptr = (head_record *) (HEAD_PTR); \ - h_ptr->block_size |= HIGH_BIT_BAU_SIZE; } - -/* Prototypes for internal functions implemented in one file and called in -** another. -*/ - -void U(into_free_collection)(U(descriptor) *desc, head_record *head_ptr); - -void U(out_of_free_collection)(U(descriptor) *desc, head_record *head_ptr); - -void *U(alloc_from_bin)( - U(descriptor) *desc, ptr_record *bin_front_ptr, U(size_bau) n_baus); - -#ifdef HMM_AUDIT_FAIL - -/* Simply contains a reference to the HMM_AUDIT_FAIL macro and a -** dummy return. */ -int U(audit_block_fail_dummy_return)(void); - - -/* Auditing a block consists of checking that the size in its head -** matches the previous block size in the head of the next block. */ -#define AUDIT_BLOCK_AS_EXPR(HEAD_PTR) \ - ((BLOCK_BAUS(HEAD_PTR) == \ - PREV_BLOCK_BAUS(BAUS_FORWARD(HEAD_PTR, BLOCK_BAUS(HEAD_PTR)))) ? \ - 0 : U(audit_block_fail_dummy_return)()) - -#define AUDIT_BLOCK(HEAD_PTR) \ - { void *h_ptr = (HEAD_PTR); AUDIT_BLOCK_AS_EXPR(h_ptr); } - -#endif - -/* Interface to AVL tree generic package instantiation. */ - -#define AVL_UNIQUE(BASE) U(avl_ ## BASE) - -#define AVL_HANDLE ptr_record * - -#define AVL_KEY U(size_bau) - -#define AVL_MAX_DEPTH 64 - -#include "cavl_if.h" - -#endif // VPX_MEM_MEMORY_MANAGER_INCLUDE_HMM_INTRNL_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/vpx_mem.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/vpx_mem.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/vpx_mem.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/vpx_mem.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,681 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#define __VPX_MEM_C__ - -#include "vpx_mem.h" -#include -#include -#include -#include "include/vpx_mem_intrnl.h" -#include "vpx/vpx_integer.h" - -#if CONFIG_MEM_TRACKER -#ifndef VPX_NO_GLOBALS -static unsigned long g_alloc_count = 0; -#else -#include "vpx_global_handling.h" -#define g_alloc_count vpxglobalm(vpxmem,g_alloc_count) -#endif -#endif - -#if CONFIG_MEM_MANAGER -# include "heapmm.h" -# include "hmm_intrnl.h" - -# define SHIFT_HMM_ADDR_ALIGN_UNIT 5 -# define TOTAL_MEMORY_TO_ALLOCATE 20971520 /* 20 * 1024 * 1024 */ - -# define MM_DYNAMIC_MEMORY 1 -# if MM_DYNAMIC_MEMORY -static unsigned char *g_p_mng_memory_raw = NULL; -static unsigned char *g_p_mng_memory = NULL; -# else -static unsigned char g_p_mng_memory[TOTAL_MEMORY_TO_ALLOCATE]; -# endif - -static size_t g_mm_memory_size = TOTAL_MEMORY_TO_ALLOCATE; - -static hmm_descriptor hmm_d; -static int g_mng_memory_allocated = 0; - -static int vpx_mm_create_heap_memory(); -static void *vpx_mm_realloc(void *memblk, size_t size); -#endif /*CONFIG_MEM_MANAGER*/ - -#if USE_GLOBAL_FUNCTION_POINTERS -struct GLOBAL_FUNC_POINTERS { - g_malloc_func g_malloc; - g_calloc_func g_calloc; - g_realloc_func g_realloc; - g_free_func g_free; - g_memcpy_func g_memcpy; - g_memset_func g_memset; - g_memmove_func g_memmove; -} *g_func = NULL; - -# define VPX_MALLOC_L g_func->g_malloc -# define VPX_REALLOC_L g_func->g_realloc -# define VPX_FREE_L g_func->g_free -# define VPX_MEMCPY_L g_func->g_memcpy -# define VPX_MEMSET_L g_func->g_memset -# define VPX_MEMMOVE_L g_func->g_memmove -#else -# define VPX_MALLOC_L malloc -# define VPX_REALLOC_L realloc -# define VPX_FREE_L free -# define VPX_MEMCPY_L memcpy -# define VPX_MEMSET_L memset -# define VPX_MEMMOVE_L memmove -#endif /* USE_GLOBAL_FUNCTION_POINTERS */ - -unsigned int vpx_mem_get_version() { - unsigned int ver = ((unsigned int)(unsigned char)VPX_MEM_VERSION_CHIEF << 24 | - (unsigned int)(unsigned char)VPX_MEM_VERSION_MAJOR << 16 | - (unsigned int)(unsigned char)VPX_MEM_VERSION_MINOR << 8 | - (unsigned int)(unsigned char)VPX_MEM_VERSION_PATCH); - return ver; -} - -int vpx_mem_set_heap_size(size_t size) { - int ret = -1; - -#if CONFIG_MEM_MANAGER -#if MM_DYNAMIC_MEMORY - - if (!g_mng_memory_allocated && size) { - g_mm_memory_size = size; - ret = 0; - } else - ret = -3; - -#else - ret = -2; -#endif -#else - (void)size; -#endif - - return ret; -} - -void *vpx_memalign(size_t align, size_t size) { - void *addr, - * x = NULL; - -#if CONFIG_MEM_MANAGER - int number_aau; - - if (vpx_mm_create_heap_memory() < 0) { - _P(printf("[vpx][mm] ERROR vpx_memalign() Couldn't create memory for Heap.\n");) - } - - number_aau = ((size + align - 1 + ADDRESS_STORAGE_SIZE) >> - SHIFT_HMM_ADDR_ALIGN_UNIT) + 1; - - addr = hmm_alloc(&hmm_d, number_aau); -#else - addr = VPX_MALLOC_L(size + align - 1 + ADDRESS_STORAGE_SIZE); -#endif /*CONFIG_MEM_MANAGER*/ - - if (addr) { - x = align_addr((unsigned char *)addr + ADDRESS_STORAGE_SIZE, (int)align); - /* save the actual malloc address */ - ((size_t *)x)[-1] = (size_t)addr; - } - - return x; -} - -void *vpx_malloc(size_t size) { - return vpx_memalign(DEFAULT_ALIGNMENT, size); -} - -void *vpx_calloc(size_t num, size_t size) { - void *x; - - x = vpx_memalign(DEFAULT_ALIGNMENT, num * size); - - if (x) - VPX_MEMSET_L(x, 0, num * size); - - return x; -} - -void *vpx_realloc(void *memblk, size_t size) { - void *addr, - * new_addr = NULL; - int align = DEFAULT_ALIGNMENT; - - /* - The realloc() function changes the size of the object pointed to by - ptr to the size specified by size, and returns a pointer to the - possibly moved block. The contents are unchanged up to the lesser - of the new and old sizes. If ptr is null, realloc() behaves like - malloc() for the specified size. If size is zero (0) and ptr is - not a null pointer, the object pointed to is freed. - */ - if (!memblk) - new_addr = vpx_malloc(size); - else if (!size) - vpx_free(memblk); - else { - addr = (void *)(((size_t *)memblk)[-1]); - memblk = NULL; - -#if CONFIG_MEM_MANAGER - new_addr = vpx_mm_realloc(addr, size + align + ADDRESS_STORAGE_SIZE); -#else - new_addr = VPX_REALLOC_L(addr, size + align + ADDRESS_STORAGE_SIZE); -#endif - - if (new_addr) { - addr = new_addr; - new_addr = (void *)(((size_t) - ((unsigned char *)new_addr + ADDRESS_STORAGE_SIZE) + (align - 1)) & - (size_t) - align); - /* save the actual malloc address */ - ((size_t *)new_addr)[-1] = (size_t)addr; - } - } - - return new_addr; -} - -void vpx_free(void *memblk) { - if (memblk) { - void *addr = (void *)(((size_t *)memblk)[-1]); -#if CONFIG_MEM_MANAGER - hmm_free(&hmm_d, addr); -#else - VPX_FREE_L(addr); -#endif - } -} - -#if CONFIG_MEM_TRACKER -void *xvpx_memalign(size_t align, size_t size, char *file, int line) { -#if TRY_BOUNDS_CHECK - unsigned char *x_bounds; -#endif - - void *x; - - if (g_alloc_count == 0) { -#if TRY_BOUNDS_CHECK - int i_rv = vpx_memory_tracker_init(BOUNDS_CHECK_PAD_SIZE, BOUNDS_CHECK_VALUE); -#else - int i_rv = vpx_memory_tracker_init(0, 0); -#endif - - if (i_rv < 0) { - _P(printf("ERROR xvpx_malloc MEM_TRACK_USAGE error vpx_memory_tracker_init().\n");) - } - } - -#if TRY_BOUNDS_CHECK - { - int i; - unsigned int tempme = BOUNDS_CHECK_VALUE; - - x_bounds = vpx_memalign(align, size + (BOUNDS_CHECK_PAD_SIZE * 2)); - - if (x_bounds) { - /*we're aligning the address twice here but to keep things - consistent we want to have the padding come before the stored - address so no matter what free function gets called we will - attempt to free the correct address*/ - x_bounds = (unsigned char *)(((size_t *)x_bounds)[-1]); - x = align_addr(x_bounds + BOUNDS_CHECK_PAD_SIZE + ADDRESS_STORAGE_SIZE, - (int)align); - /* save the actual malloc address */ - ((size_t *)x)[-1] = (size_t)x_bounds; - - for (i = 0; i < BOUNDS_CHECK_PAD_SIZE; i += sizeof(unsigned int)) { - VPX_MEMCPY_L(x_bounds + i, &tempme, sizeof(unsigned int)); - VPX_MEMCPY_L((unsigned char *)x + size + i, - &tempme, sizeof(unsigned int)); - } - } else - x = NULL; - } -#else - x = vpx_memalign(align, size); -#endif /*TRY_BOUNDS_CHECK*/ - - g_alloc_count++; - - vpx_memory_tracker_add((size_t)x, (unsigned int)size, file, line, 1); - - return x; -} - -void *xvpx_malloc(size_t size, char *file, int line) { - return xvpx_memalign(DEFAULT_ALIGNMENT, size, file, line); -} - -void *xvpx_calloc(size_t num, size_t size, char *file, int line) { - void *x = xvpx_memalign(DEFAULT_ALIGNMENT, num * size, file, line); - - if (x) - VPX_MEMSET_L(x, 0, num * size); - - return x; -} - -void *xvpx_realloc(void *memblk, size_t size, char *file, int line) { - struct mem_block *p = NULL; - int orig_size = 0, - orig_line = 0; - char *orig_file = NULL; - -#if TRY_BOUNDS_CHECK - unsigned char *x_bounds = memblk ? - (unsigned char *)(((size_t *)memblk)[-1]) : - NULL; -#endif - - void *x; - - if (g_alloc_count == 0) { -#if TRY_BOUNDS_CHECK - - if (!vpx_memory_tracker_init(BOUNDS_CHECK_PAD_SIZE, BOUNDS_CHECK_VALUE)) -#else - if (!vpx_memory_tracker_init(0, 0)) -#endif - { - _P(printf("ERROR xvpx_malloc MEM_TRACK_USAGE error vpx_memory_tracker_init().\n");) - } - } - - if ((p = vpx_memory_tracker_find((size_t)memblk))) { - orig_size = p->size; - orig_file = p->file; - orig_line = p->line; - } - -#if TRY_BOUNDS_CHECK_ON_FREE - vpx_memory_tracker_check_integrity(file, line); -#endif - - /* have to do this regardless of success, because - * the memory that does get realloc'd may change - * the bounds values of this block - */ - vpx_memory_tracker_remove((size_t)memblk); - -#if TRY_BOUNDS_CHECK - { - int i; - unsigned int tempme = BOUNDS_CHECK_VALUE; - - x_bounds = vpx_realloc(memblk, size + (BOUNDS_CHECK_PAD_SIZE * 2)); - - if (x_bounds) { - x_bounds = (unsigned char *)(((size_t *)x_bounds)[-1]); - x = align_addr(x_bounds + BOUNDS_CHECK_PAD_SIZE + ADDRESS_STORAGE_SIZE, - (int)DEFAULT_ALIGNMENT); - /* save the actual malloc address */ - ((size_t *)x)[-1] = (size_t)x_bounds; - - for (i = 0; i < BOUNDS_CHECK_PAD_SIZE; i += sizeof(unsigned int)) { - VPX_MEMCPY_L(x_bounds + i, &tempme, sizeof(unsigned int)); - VPX_MEMCPY_L((unsigned char *)x + size + i, - &tempme, sizeof(unsigned int)); - } - } else - x = NULL; - } -#else - x = vpx_realloc(memblk, size); -#endif /*TRY_BOUNDS_CHECK*/ - - if (!memblk) ++g_alloc_count; - - if (x) - vpx_memory_tracker_add((size_t)x, (unsigned int)size, file, line, 1); - else - vpx_memory_tracker_add((size_t)memblk, orig_size, orig_file, orig_line, 1); - - return x; -} - -void xvpx_free(void *p_address, char *file, int line) { -#if TRY_BOUNDS_CHECK - unsigned char *p_bounds_address = (unsigned char *)p_address; - /*p_bounds_address -= BOUNDS_CHECK_PAD_SIZE;*/ -#endif - -#if !TRY_BOUNDS_CHECK_ON_FREE - (void)file; - (void)line; -#endif - - if (p_address) { -#if TRY_BOUNDS_CHECK_ON_FREE - vpx_memory_tracker_check_integrity(file, line); -#endif - - /* if the addr isn't found in the list, assume it was allocated via - * vpx_ calls not xvpx_, therefore it does not contain any padding - */ - if (vpx_memory_tracker_remove((size_t)p_address) == -2) { - p_bounds_address = p_address; - _P(fprintf(stderr, "[vpx_mem][xvpx_free] addr: %p not found in" - " list; freed from file:%s" - " line:%d\n", p_address, file, line)); - } else - --g_alloc_count; - -#if TRY_BOUNDS_CHECK - vpx_free(p_bounds_address); -#else - vpx_free(p_address); -#endif - - if (!g_alloc_count) - vpx_memory_tracker_destroy(); - } -} - -#endif /*CONFIG_MEM_TRACKER*/ - -#if CONFIG_MEM_CHECKS -#if defined(VXWORKS) -#include /*for task_delay()*/ -/* This function is only used to get a stack trace of the player -object so we can se where we are having a problem. */ -static int get_my_tt(int task) { - tt(task); - - return 0; -} - -static void vx_sleep(int msec) { - int ticks_to_sleep = 0; - - if (msec) { - int msec_per_tick = 1000 / sys_clk_rate_get(); - - if (msec < msec_per_tick) - ticks_to_sleep++; - else - ticks_to_sleep = msec / msec_per_tick; - } - - task_delay(ticks_to_sleep); -} -#endif -#endif - -void *vpx_memcpy(void *dest, const void *source, size_t length) { -#if CONFIG_MEM_CHECKS - - if (((int)dest < 0x4000) || ((int)source < 0x4000)) { - _P(printf("WARNING: vpx_memcpy dest:0x%x source:0x%x len:%d\n", (int)dest, (int)source, length);) - -#if defined(VXWORKS) - sp(get_my_tt, task_id_self(), 0, 0, 0, 0, 0, 0, 0, 0); - - vx_sleep(10000); -#endif - } - -#endif - - return VPX_MEMCPY_L(dest, source, length); -} - -void *vpx_memset(void *dest, int val, size_t length) { -#if CONFIG_MEM_CHECKS - - if ((int)dest < 0x4000) { - _P(printf("WARNING: vpx_memset dest:0x%x val:%d len:%d\n", (int)dest, val, length);) - -#if defined(VXWORKS) - sp(get_my_tt, task_id_self(), 0, 0, 0, 0, 0, 0, 0, 0); - - vx_sleep(10000); -#endif - } - -#endif - - return VPX_MEMSET_L(dest, val, length); -} - -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH -void *vpx_memset16(void *dest, int val, size_t length) { -#if CONFIG_MEM_CHECKS - if ((int)dest < 0x4000) { - _P(printf("WARNING: vpx_memset dest:0x%x val:%d len:%d\n", - (int)dest, val, length);) - -#if defined(VXWORKS) - sp(get_my_tt, task_id_self(), 0, 0, 0, 0, 0, 0, 0, 0); - - vx_sleep(10000); -#endif - } -#endif - int i; - void *orig = dest; - uint16_t *dest16 = dest; - for (i = 0; i < length; i++) - *dest16++ = val; - return orig; -} -#endif // CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - -void *vpx_memmove(void *dest, const void *src, size_t count) { -#if CONFIG_MEM_CHECKS - - if (((int)dest < 0x4000) || ((int)src < 0x4000)) { - _P(printf("WARNING: vpx_memmove dest:0x%x src:0x%x count:%d\n", (int)dest, (int)src, count);) - -#if defined(VXWORKS) - sp(get_my_tt, task_id_self(), 0, 0, 0, 0, 0, 0, 0, 0); - - vx_sleep(10000); -#endif - } - -#endif - - return VPX_MEMMOVE_L(dest, src, count); -} - -#if CONFIG_MEM_MANAGER - -static int vpx_mm_create_heap_memory() { - int i_rv = 0; - - if (!g_mng_memory_allocated) { -#if MM_DYNAMIC_MEMORY - g_p_mng_memory_raw = - (unsigned char *)malloc(g_mm_memory_size + HMM_ADDR_ALIGN_UNIT); - - if (g_p_mng_memory_raw) { - g_p_mng_memory = (unsigned char *)((((unsigned int)g_p_mng_memory_raw) + - HMM_ADDR_ALIGN_UNIT - 1) & - -(int)HMM_ADDR_ALIGN_UNIT); - - _P(printf("[vpx][mm] total memory size:%d g_p_mng_memory_raw:0x%x g_p_mng_memory:0x%x\n" -, g_mm_memory_size + HMM_ADDR_ALIGN_UNIT -, (unsigned int)g_p_mng_memory_raw -, (unsigned int)g_p_mng_memory);) - } else { - _P(printf("[vpx][mm] Couldn't allocate memory:%d for vpx memory manager.\n" -, g_mm_memory_size);) - - i_rv = -1; - } - - if (g_p_mng_memory) -#endif - { - int chunk_size = 0; - - g_mng_memory_allocated = 1; - - hmm_init(&hmm_d); - - chunk_size = g_mm_memory_size >> SHIFT_HMM_ADDR_ALIGN_UNIT; - - chunk_size -= DUMMY_END_BLOCK_BAUS; - - _P(printf("[vpx][mm] memory size:%d for vpx memory manager. g_p_mng_memory:0x%x chunk_size:%d\n" -, g_mm_memory_size -, (unsigned int)g_p_mng_memory -, chunk_size);) - - hmm_new_chunk(&hmm_d, (void *)g_p_mng_memory, chunk_size); - } - -#if MM_DYNAMIC_MEMORY - else { - _P(printf("[vpx][mm] Couldn't allocate memory:%d for vpx memory manager.\n" -, g_mm_memory_size);) - - i_rv = -1; - } - -#endif - } - - return i_rv; -} - -static void *vpx_mm_realloc(void *memblk, size_t size) { - void *p_ret = NULL; - - if (vpx_mm_create_heap_memory() < 0) { - _P(printf("[vpx][mm] ERROR vpx_mm_realloc() Couldn't create memory for Heap.\n");) - } else { - int i_rv = 0; - int old_num_aaus; - int new_num_aaus; - - old_num_aaus = hmm_true_size(memblk); - new_num_aaus = (size >> SHIFT_HMM_ADDR_ALIGN_UNIT) + 1; - - if (old_num_aaus == new_num_aaus) { - p_ret = memblk; - } else { - i_rv = hmm_resize(&hmm_d, memblk, new_num_aaus); - - if (i_rv == 0) { - p_ret = memblk; - } else { - /* Error. Try to malloc and then copy data. */ - void *p_from_malloc; - - new_num_aaus = (size >> SHIFT_HMM_ADDR_ALIGN_UNIT) + 1; - p_from_malloc = hmm_alloc(&hmm_d, new_num_aaus); - - if (p_from_malloc) { - vpx_memcpy(p_from_malloc, memblk, size); - hmm_free(&hmm_d, memblk); - - p_ret = p_from_malloc; - } - } - } - } - - return p_ret; -} -#endif /*CONFIG_MEM_MANAGER*/ - -#if USE_GLOBAL_FUNCTION_POINTERS -# if CONFIG_MEM_TRACKER -extern int vpx_memory_tracker_set_functions(g_malloc_func g_malloc_l -, g_calloc_func g_calloc_l -, g_realloc_func g_realloc_l -, g_free_func g_free_l -, g_memcpy_func g_memcpy_l -, g_memset_func g_memset_l -, g_memmove_func g_memmove_l); -# endif -#endif /*USE_GLOBAL_FUNCTION_POINTERS*/ -int vpx_mem_set_functions(g_malloc_func g_malloc_l -, g_calloc_func g_calloc_l -, g_realloc_func g_realloc_l -, g_free_func g_free_l -, g_memcpy_func g_memcpy_l -, g_memset_func g_memset_l -, g_memmove_func g_memmove_l) { -#if USE_GLOBAL_FUNCTION_POINTERS - - /* If use global functions is turned on then the - application must set the global functions before - it does anything else or vpx_mem will have - unpredictable results. */ - if (!g_func) { - g_func = (struct GLOBAL_FUNC_POINTERS *) - g_malloc_l(sizeof(struct GLOBAL_FUNC_POINTERS)); - - if (!g_func) { - return -1; - } - } - -#if CONFIG_MEM_TRACKER - { - int rv = 0; - rv = vpx_memory_tracker_set_functions(g_malloc_l -, g_calloc_l -, g_realloc_l -, g_free_l -, g_memcpy_l -, g_memset_l -, g_memmove_l); - - if (rv < 0) { - return rv; - } - } -#endif - - g_func->g_malloc = g_malloc_l; - g_func->g_calloc = g_calloc_l; - g_func->g_realloc = g_realloc_l; - g_func->g_free = g_free_l; - g_func->g_memcpy = g_memcpy_l; - g_func->g_memset = g_memset_l; - g_func->g_memmove = g_memmove_l; - - return 0; -#else - (void)g_malloc_l; - (void)g_calloc_l; - (void)g_realloc_l; - (void)g_free_l; - (void)g_memcpy_l; - (void)g_memset_l; - (void)g_memmove_l; - return -1; -#endif -} - -int vpx_mem_unset_functions() { -#if USE_GLOBAL_FUNCTION_POINTERS - - if (g_func) { - g_free_func temp_free = g_func->g_free; - temp_free(g_func); - g_func = NULL; - } - -#endif - return 0; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/vpx_mem.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/vpx_mem.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/vpx_mem.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/vpx_mem.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,176 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VPX_MEM_VPX_MEM_H_ -#define VPX_MEM_VPX_MEM_H_ - -#include "vpx_config.h" -#if defined(__uClinux__) -# include -#endif - -/* vpx_mem version info */ -#define vpx_mem_version "2.2.1.5" - -#define VPX_MEM_VERSION_CHIEF 2 -#define VPX_MEM_VERSION_MAJOR 2 -#define VPX_MEM_VERSION_MINOR 1 -#define VPX_MEM_VERSION_PATCH 5 -/* end - vpx_mem version info */ - -#ifndef VPX_TRACK_MEM_USAGE -# define VPX_TRACK_MEM_USAGE 0 /* enable memory tracking/integrity checks */ -#endif -#ifndef VPX_CHECK_MEM_FUNCTIONS -# define VPX_CHECK_MEM_FUNCTIONS 0 /* enable basic safety checks in _memcpy, -_memset, and _memmove */ -#endif -#ifndef REPLACE_BUILTIN_FUNCTIONS -# define REPLACE_BUILTIN_FUNCTIONS 0 /* replace builtin functions with their -vpx_ equivalents */ -#endif - -#include -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - /* - vpx_mem_get_version() - provided for runtime version checking. Returns an unsigned int of the form - CHIEF | MAJOR | MINOR | PATCH, where the chief version number is the high - order byte. - */ - unsigned int vpx_mem_get_version(void); - - /* - vpx_mem_set_heap_size(size_t size) - size - size in bytes for the memory manager to allocate for its heap - Sets the memory manager's initial heap size - Return: - 0: on success - -1: if memory manager calls have not been included in the vpx_mem lib - -2: if the memory manager has been compiled to use static memory - -3: if the memory manager has already allocated its heap - */ - int vpx_mem_set_heap_size(size_t size); - - void *vpx_memalign(size_t align, size_t size); - void *vpx_malloc(size_t size); - void *vpx_calloc(size_t num, size_t size); - void *vpx_realloc(void *memblk, size_t size); - void vpx_free(void *memblk); - - void *vpx_memcpy(void *dest, const void *src, size_t length); - void *vpx_memset(void *dest, int val, size_t length); -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - void *vpx_memset16(void *dest, int val, size_t length); -#endif - void *vpx_memmove(void *dest, const void *src, size_t count); - - /* special memory functions */ - void *vpx_mem_alloc(int id, size_t size, size_t align); - void vpx_mem_free(int id, void *mem, size_t size); - - /* Wrappers to standard library functions. */ - typedef void *(* g_malloc_func)(size_t); - typedef void *(* g_calloc_func)(size_t, size_t); - typedef void *(* g_realloc_func)(void *, size_t); - typedef void (* g_free_func)(void *); - typedef void *(* g_memcpy_func)(void *, const void *, size_t); - typedef void *(* g_memset_func)(void *, int, size_t); - typedef void *(* g_memmove_func)(void *, const void *, size_t); - - int vpx_mem_set_functions(g_malloc_func g_malloc_l -, g_calloc_func g_calloc_l -, g_realloc_func g_realloc_l -, g_free_func g_free_l -, g_memcpy_func g_memcpy_l -, g_memset_func g_memset_l -, g_memmove_func g_memmove_l); - int vpx_mem_unset_functions(void); - - - /* some defines for backward compatibility */ -#define DMEM_GENERAL 0 - -// (*)< - -#if REPLACE_BUILTIN_FUNCTIONS -# ifndef __VPX_MEM_C__ -# define memalign vpx_memalign -# define malloc vpx_malloc -# define calloc vpx_calloc -# define realloc vpx_realloc -# define free vpx_free -# define memcpy vpx_memcpy -# define memmove vpx_memmove -# define memset vpx_memset -# endif -#endif - -#if CONFIG_MEM_TRACKER -#include - /*from vpx_mem/vpx_mem_tracker.c*/ - extern void vpx_memory_tracker_dump(); - extern void vpx_memory_tracker_check_integrity(char *file, unsigned int line); - extern int vpx_memory_tracker_set_log_type(int type, char *option); - extern int vpx_memory_tracker_set_log_func(void *userdata, - void(*logfunc)(void *userdata, - const char *fmt, va_list args)); -# ifndef __VPX_MEM_C__ -# define vpx_memalign(align, size) xvpx_memalign((align), (size), __FILE__, __LINE__) -# define vpx_malloc(size) xvpx_malloc((size), __FILE__, __LINE__) -# define vpx_calloc(num, size) xvpx_calloc(num, size, __FILE__, __LINE__) -# define vpx_realloc(addr, size) xvpx_realloc(addr, size, __FILE__, __LINE__) -# define vpx_free(addr) xvpx_free(addr, __FILE__, __LINE__) -# define vpx_memory_tracker_check_integrity() vpx_memory_tracker_check_integrity(__FILE__, __LINE__) -# define vpx_mem_alloc(id,size,align) xvpx_mem_alloc(id, size, align, __FILE__, __LINE__) -# define vpx_mem_free(id,mem,size) xvpx_mem_free(id, mem, size, __FILE__, __LINE__) -# endif - - void *xvpx_memalign(size_t align, size_t size, char *file, int line); - void *xvpx_malloc(size_t size, char *file, int line); - void *xvpx_calloc(size_t num, size_t size, char *file, int line); - void *xvpx_realloc(void *memblk, size_t size, char *file, int line); - void xvpx_free(void *memblk, char *file, int line); - void *xvpx_mem_alloc(int id, size_t size, size_t align, char *file, int line); - void xvpx_mem_free(int id, void *mem, size_t size, char *file, int line); - -#else -# ifndef __VPX_MEM_C__ -# define vpx_memory_tracker_dump() -# define vpx_memory_tracker_check_integrity() -# define vpx_memory_tracker_set_log_type(t,o) 0 -# define vpx_memory_tracker_set_log_func(u,f) 0 -# endif -#endif - -#if !VPX_CHECK_MEM_FUNCTIONS -# ifndef __VPX_MEM_C__ -# include -# define vpx_memcpy memcpy -# define vpx_memset memset -# define vpx_memmove memmove -# endif -#endif - -#ifdef VPX_MEM_PLTFRM -# include VPX_MEM_PLTFRM -#endif - -#if defined(__cplusplus) -} -#endif - -#endif // VPX_MEM_VPX_MEM_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/vpx_mem.mk gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/vpx_mem.mk --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/vpx_mem.mk 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/vpx_mem.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -MEM_SRCS-yes += vpx_mem.mk -MEM_SRCS-yes += vpx_mem.c -MEM_SRCS-yes += vpx_mem.h -MEM_SRCS-yes += include/vpx_mem_intrnl.h - -MEM_SRCS-$(CONFIG_MEM_TRACKER) += vpx_mem_tracker.c -MEM_SRCS-$(CONFIG_MEM_TRACKER) += include/vpx_mem_tracker.h - -MEM_SRCS-$(CONFIG_MEM_MANAGER) += memory_manager/hmm_true.c -MEM_SRCS-$(CONFIG_MEM_MANAGER) += memory_manager/hmm_resize.c -MEM_SRCS-$(CONFIG_MEM_MANAGER) += memory_manager/hmm_shrink.c -MEM_SRCS-$(CONFIG_MEM_MANAGER) += memory_manager/hmm_largest.c -MEM_SRCS-$(CONFIG_MEM_MANAGER) += memory_manager/hmm_dflt_abort.c -MEM_SRCS-$(CONFIG_MEM_MANAGER) += memory_manager/hmm_base.c -MEM_SRCS-$(CONFIG_MEM_MANAGER) += memory_manager/include -MEM_SRCS-$(CONFIG_MEM_MANAGER) += memory_manager/include/hmm_intrnl.h -MEM_SRCS-$(CONFIG_MEM_MANAGER) += memory_manager/include/cavl_if.h -MEM_SRCS-$(CONFIG_MEM_MANAGER) += memory_manager/include/hmm_cnfg.h -MEM_SRCS-$(CONFIG_MEM_MANAGER) += memory_manager/include/heapmm.h -MEM_SRCS-$(CONFIG_MEM_MANAGER) += memory_manager/include/cavl_impl.h -MEM_SRCS-$(CONFIG_MEM_MANAGER) += memory_manager/hmm_grow.c -MEM_SRCS-$(CONFIG_MEM_MANAGER) += memory_manager/hmm_alloc.c diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/vpx_mem_tracker.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/vpx_mem_tracker.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_mem/vpx_mem_tracker.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_mem/vpx_mem_tracker.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,740 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/* - vpx_mem_tracker.c - - jwz 2003-09-30: - Stores a list of addreses, their size, and file and line they came from. - All exposed lib functions are prefaced by vpx_ and allow the global list - to be thread safe. - Current supported platforms are: - Linux, Win32, win_ce and vx_works - Further support can be added by defining the platform specific mutex - in the memory_tracker struct as well as calls to create/destroy/lock/unlock - the mutex in vpx_memory_tracker_init/Destroy and memory_tracker_lock_mutex/unlock_mutex -*/ -#include "./vpx_config.h" - -#if defined(__uClinux__) -# include -#endif - -#if HAVE_PTHREAD_H -# include -#elif defined(WIN32) || defined(_WIN32_WCE) -# define WIN32_LEAN_AND_MEAN -# include -# include -#elif defined(VXWORKS) -# include -#endif - -#include -#include -#include // VXWORKS doesn't have a malloc/memory.h file, -// this should pull in malloc,free,etc. -#include - -#include "include/vpx_mem_tracker.h" - -#undef vpx_malloc // undefine any vpx_mem macros that may affect calls to -#undef vpx_free // memory functions in this file -#undef vpx_memcpy -#undef vpx_memset - - -#ifndef USE_GLOBAL_FUNCTION_POINTERS -# define USE_GLOBAL_FUNCTION_POINTERS 0 // use function pointers instead of compiled functions. -#endif - -#if USE_GLOBAL_FUNCTION_POINTERS -static mem_track_malloc_func g_malloc = malloc; -static mem_track_calloc_func g_calloc = calloc; -static mem_track_realloc_func g_realloc = realloc; -static mem_track_free_func g_free = free; -static mem_track_memcpy_func g_memcpy = memcpy; -static mem_track_memset_func g_memset = memset; -static mem_track_memmove_func g_memmove = memmove; -# define MEM_TRACK_MALLOC g_malloc -# define MEM_TRACK_FREE g_free -# define MEM_TRACK_MEMCPY g_memcpy -# define MEM_TRACK_MEMSET g_memset -#else -# define MEM_TRACK_MALLOC vpx_malloc -# define MEM_TRACK_FREE vpx_free -# define MEM_TRACK_MEMCPY vpx_memcpy -# define MEM_TRACK_MEMSET vpx_memset -#endif // USE_GLOBAL_FUNCTION_POINTERS - -/* prototypes for internal library functions */ -static void memtrack_log(const char *fmt, ...); -static void memory_tracker_dump(); -static void memory_tracker_check_integrity(char *file, unsigned int line); -static void memory_tracker_add(size_t addr, unsigned int size, - char *file, unsigned int line, - int padded); -static int memory_tracker_remove(size_t addr); -static struct mem_block *memory_tracker_find(size_t addr); - -#if defined(NO_MUTEX) -# define memory_tracker_lock_mutex() (!g_b_mem_tracker_inited) -# define memory_tracker_unlock_mutex() -#else -static int memory_tracker_lock_mutex(); -static int memory_tracker_unlock_mutex(); -#endif - -#ifndef VPX_NO_GLOBALS -struct memory_tracker { - struct mem_block *head, - * tail; - int len, - totalsize; - unsigned int current_allocated, - max_allocated; - -#if HAVE_PTHREAD_H - pthread_mutex_t mutex; -#elif defined(WIN32) || defined(_WIN32_WCE) - HANDLE mutex; -#elif defined(VXWORKS) - SEM_ID mutex; -#elif defined(NO_MUTEX) -#else -#error "No mutex type defined for this platform!" -#endif - - int padding_size, - pad_value; -}; - -static struct memory_tracker memtrack; // our global memory allocation list -static int g_b_mem_tracker_inited = 0; // indicates whether the global list has -// been initialized (1:yes/0:no) -static struct { - FILE *file; - int type; - void (*func)(void *userdata, const char *fmt, va_list args); - void *userdata; -} g_logging = {NULL, 0, NULL, NULL}; -#else -# include "vpx_global_handling.h" -#define g_b_mem_tracker_inited vpxglobalm(vpxmem,g_b_mem_tracker_inited) -#define g_logging vpxglobalm(vpxmem,g_logging) -#define memtrack vpxglobalm(vpxmem,memtrack) -#endif // #ifndef VPX_NO_GLOBALS - -extern void *vpx_malloc(size_t size); -extern void vpx_free(void *memblk); -extern void *vpx_memcpy(void *dest, const void *src, size_t length); -extern void *vpx_memset(void *dest, int val, size_t length); - -/* - * - * Exposed library functions - * -*/ - -/* - vpx_memory_tracker_init(int padding_size, int pad_value) - padding_size - the size of the padding before and after each mem addr. - Values > 0 indicate that integrity checks can be performed - by inspecting these areas. - pad_value - the initial value within the padding area before and after - each mem addr. - - Initializes global memory tracker structure - Allocates the head of the list -*/ -int vpx_memory_tracker_init(int padding_size, int pad_value) { - if (!g_b_mem_tracker_inited) { - if ((memtrack.head = (struct mem_block *) - MEM_TRACK_MALLOC(sizeof(struct mem_block)))) { - int ret; - - MEM_TRACK_MEMSET(memtrack.head, 0, sizeof(struct mem_block)); - - memtrack.tail = memtrack.head; - - memtrack.current_allocated = 0; - memtrack.max_allocated = 0; - - memtrack.padding_size = padding_size; - memtrack.pad_value = pad_value; - -#if HAVE_PTHREAD_H - ret = pthread_mutex_init(&memtrack.mutex, - NULL); /*mutex attributes (NULL=default)*/ -#elif defined(WIN32) || defined(_WIN32_WCE) - memtrack.mutex = CreateMutex(NULL, /*security attributes*/ - FALSE, /*we don't want initial ownership*/ - NULL); /*mutex name*/ - ret = !memtrack.mutex; -#elif defined(VXWORKS) - memtrack.mutex = sem_bcreate(SEM_Q_FIFO, /*SEM_Q_FIFO non-priority based mutex*/ - SEM_FULL); /*SEM_FULL initial state is unlocked*/ - ret = !memtrack.mutex; -#elif defined(NO_MUTEX) - ret = 0; -#endif - - if (ret) { - memtrack_log("vpx_memory_tracker_init: Error creating mutex!\n"); - - MEM_TRACK_FREE(memtrack.head); - memtrack.head = NULL; - } else { - memtrack_log("Memory Tracker init'd, v."vpx_mem_tracker_version" pad_size:%d pad_val:0x%x %d\n" -, padding_size -, pad_value -, pad_value); - g_b_mem_tracker_inited = 1; - } - } - } - - return g_b_mem_tracker_inited; -} - -/* - vpx_memory_tracker_destroy() - If our global struct was initialized zeros out all its members, - frees memory and destroys it's mutex -*/ -void vpx_memory_tracker_destroy() { - if (!memory_tracker_lock_mutex()) { - struct mem_block *p = memtrack.head, - * p2 = memtrack.head; - - memory_tracker_dump(); - - while (p) { - p2 = p; - p = p->next; - - MEM_TRACK_FREE(p2); - } - - memtrack.head = NULL; - memtrack.tail = NULL; - memtrack.len = 0; - memtrack.current_allocated = 0; - memtrack.max_allocated = 0; - - if (!g_logging.type && g_logging.file && g_logging.file != stderr) { - fclose(g_logging.file); - g_logging.file = NULL; - } - - memory_tracker_unlock_mutex(); - - g_b_mem_tracker_inited = 0; - } -} - -/* - vpx_memory_tracker_add(size_t addr, unsigned int size, - char * file, unsigned int line) - addr - memory address to be added to list - size - size of addr - file - the file addr was referenced from - line - the line in file addr was referenced from - Adds memory address addr, it's size, file and line it came from - to the global list via the thread safe internal library function -*/ -void vpx_memory_tracker_add(size_t addr, unsigned int size, - char *file, unsigned int line, - int padded) { - memory_tracker_add(addr, size, file, line, padded); -} - -/* - vpx_memory_tracker_remove(size_t addr) - addr - memory address to be removed from list - Removes addr from the global list via the thread safe - internal remove function - Return: - Same as described for memory_tracker_remove -*/ -int vpx_memory_tracker_remove(size_t addr) { - return memory_tracker_remove(addr); -} - -/* - vpx_memory_tracker_find(size_t addr) - addr - address to be found in list - Return: - If found, pointer to the memory block that matches addr - NULL otherwise -*/ -struct mem_block *vpx_memory_tracker_find(size_t addr) { - struct mem_block *p = NULL; - - if (!memory_tracker_lock_mutex()) { - p = memory_tracker_find(addr); - memory_tracker_unlock_mutex(); - } - - return p; -} - -/* - vpx_memory_tracker_dump() - Locks the memory tracker's mutex and calls the internal - library function to dump the current contents of the - global memory allocation list -*/ -void vpx_memory_tracker_dump() { - if (!memory_tracker_lock_mutex()) { - memory_tracker_dump(); - memory_tracker_unlock_mutex(); - } -} - -/* - vpx_memory_tracker_check_integrity(char* file, unsigned int line) - file - The file name where the check was placed - line - The line in file where the check was placed - Locks the memory tracker's mutex and calls the internal - integrity check function to inspect every address in the global - memory allocation list -*/ -void vpx_memory_tracker_check_integrity(char *file, unsigned int line) { - if (!memory_tracker_lock_mutex()) { - memory_tracker_check_integrity(file, line); - memory_tracker_unlock_mutex(); - } -} - -/* - vpx_memory_tracker_set_log_type - Sets the logging type for the memory tracker. Based on the value it will - direct its output to the appropriate place. - Return: - 0: on success - -1: if the logging type could not be set, because the value was invalid - or because a file could not be opened -*/ -int vpx_memory_tracker_set_log_type(int type, char *option) { - int ret = -1; - - switch (type) { - case 0: - g_logging.type = 0; - - if (!option) { - g_logging.file = stderr; - ret = 0; - } else { - if ((g_logging.file = fopen((char *)option, "w"))) - ret = 0; - } - - break; -#if defined(WIN32) && !defined(_WIN32_WCE) - case 1: - g_logging.type = type; - ret = 0; - break; -#endif - default: - break; - } - - // output the version to the new logging destination - if (!ret) - memtrack_log("Memory Tracker logging initialized, " - "Memory Tracker v."vpx_mem_tracker_version"\n"); - - return ret; -} - -/* - vpx_memory_tracker_set_log_func - Sets a logging function to be used by the memory tracker. - Return: - 0: on success - -1: if the logging type could not be set because logfunc was NULL -*/ -int vpx_memory_tracker_set_log_func(void *userdata, - void(*logfunc)(void *userdata, - const char *fmt, va_list args)) { - int ret = -1; - - if (logfunc) { - g_logging.type = -1; - g_logging.userdata = userdata; - g_logging.func = logfunc; - ret = 0; - } - - // output the version to the new logging destination - if (!ret) - memtrack_log("Memory Tracker logging initialized, " - "Memory Tracker v."vpx_mem_tracker_version"\n"); - - return ret; -} - -/* - * - * END - Exposed library functions - * -*/ - - -/* - * - * Internal library functions - * -*/ - -static void memtrack_log(const char *fmt, ...) { - va_list list; - - va_start(list, fmt); - - switch (g_logging.type) { - case -1: - - if (g_logging.func) - g_logging.func(g_logging.userdata, fmt, list); - - break; - case 0: - - if (g_logging.file) { - vfprintf(g_logging.file, fmt, list); - fflush(g_logging.file); - } - - break; -#if defined(WIN32) && !defined(_WIN32_WCE) - case 1: { - char temp[1024]; - _vsnprintf(temp, sizeof(temp) / sizeof(char) - 1, fmt, list); - OutputDebugString(temp); - } - break; -#endif - default: - break; - } - - va_end(list); -} - -/* - memory_tracker_dump() - Dumps the current contents of the global memory allocation list -*/ -static void memory_tracker_dump() { - int i = 0; - struct mem_block *p = (memtrack.head ? memtrack.head->next : NULL); - - memtrack_log("\n_currently Allocated= %d; Max allocated= %d\n", - memtrack.current_allocated, memtrack.max_allocated); - - while (p) { -#if defined(WIN32) && !defined(_WIN32_WCE) - - /*when using outputdebugstring, output filenames so they - can be clicked to be opened in visual studio*/ - if (g_logging.type == 1) - memtrack_log("memblocks[%d].addr= 0x%.8x, memblocks[%d].size= %d, file:\n" - " %s(%d):\n", i, - p->addr, i, p->size, - p->file, p->line); - else -#endif - memtrack_log("memblocks[%d].addr= 0x%.8x, memblocks[%d].size= %d, file: %s, line: %d\n", i, - p->addr, i, p->size, - p->file, p->line); - - p = p->next; - ++i; - } - - memtrack_log("\n"); -} - -/* - memory_tracker_check_integrity(char* file, unsigned int file) - file - the file name where the check was placed - line - the line in file where the check was placed - If a padding_size was supplied to vpx_memory_tracker_init() - this function will check ea. addr in the list verifying that - addr-padding_size and addr+padding_size is filled with pad_value -*/ -static void memory_tracker_check_integrity(char *file, unsigned int line) { - if (memtrack.padding_size) { - int i, - index = 0; - unsigned char *p_show_me, - * p_show_me2; - unsigned int tempme = memtrack.pad_value, - dead1, - dead2; - unsigned char *x_bounds; - struct mem_block *p = memtrack.head->next; - - while (p) { - // x_bounds = (unsigned char*)p->addr; - // back up VPX_BYTE_ALIGNMENT - // x_bounds -= memtrack.padding_size; - - if (p->padded) { // can the bounds be checked? - /*yes, move to the address that was actually allocated - by the vpx_* calls*/ - x_bounds = (unsigned char *)(((size_t *)p->addr)[-1]); - - for (i = 0; i < memtrack.padding_size; i += sizeof(unsigned int)) { - p_show_me = (x_bounds + i); - p_show_me2 = (unsigned char *)(p->addr + p->size + i); - - MEM_TRACK_MEMCPY(&dead1, p_show_me, sizeof(unsigned int)); - MEM_TRACK_MEMCPY(&dead2, p_show_me2, sizeof(unsigned int)); - - if ((dead1 != tempme) || (dead2 != tempme)) { - memtrack_log("\n[vpx_mem integrity check failed]:\n" - " index[%d,%d] {%s:%d} addr=0x%x, size=%d," - " file: %s, line: %d c0:0x%x c1:0x%x\n", - index, i, file, line, p->addr, p->size, p->file, - p->line, dead1, dead2); - } - } - } - - ++index; - p = p->next; - } - } -} - -/* - memory_tracker_add(size_t addr, unsigned int size, - char * file, unsigned int line) - Adds an address (addr), it's size, file and line number to our list. - Adjusts the total bytes allocated and max bytes allocated if necessary. - If memory cannot be allocated the list will be destroyed. -*/ -void memory_tracker_add(size_t addr, unsigned int size, - char *file, unsigned int line, - int padded) { - if (!memory_tracker_lock_mutex()) { - struct mem_block *p; - - p = MEM_TRACK_MALLOC(sizeof(struct mem_block)); - - if (p) { - p->prev = memtrack.tail; - p->prev->next = p; - p->addr = addr; - p->size = size; - p->line = line; - p->file = file; - p->padded = padded; - p->next = NULL; - - memtrack.tail = p; - - memtrack.current_allocated += size; - - if (memtrack.current_allocated > memtrack.max_allocated) - memtrack.max_allocated = memtrack.current_allocated; - - // memtrack_log("memory_tracker_add: added addr=0x%.8x\n", addr); - - memory_tracker_unlock_mutex(); - } else { - memtrack_log("memory_tracker_add: error allocating memory!\n"); - memory_tracker_unlock_mutex(); - vpx_memory_tracker_destroy(); - } - } -} - -/* - memory_tracker_remove(size_t addr) - Removes an address and its corresponding size (if they exist) - from the memory tracker list and adjusts the current number - of bytes allocated. - Return: - 0: on success - -1: if the mutex could not be locked - -2: if the addr was not found in the list -*/ -int memory_tracker_remove(size_t addr) { - int ret = -1; - - if (!memory_tracker_lock_mutex()) { - struct mem_block *p; - - if ((p = memory_tracker_find(addr))) { - memtrack.current_allocated -= p->size; - - p->prev->next = p->next; - - if (p->next) - p->next->prev = p->prev; - else - memtrack.tail = p->prev; - - ret = 0; - MEM_TRACK_FREE(p); - } else { - if (addr) - memtrack_log("memory_tracker_remove(): addr not found in list," - " 0x%.8x\n", addr); - - ret = -2; - } - - memory_tracker_unlock_mutex(); - } - - return ret; -} - -/* - memory_tracker_find(size_t addr) - Finds an address in our addrs list - NOTE: the mutex MUST be locked in the other internal - functions before calling this one. This avoids - the need for repeated locking and unlocking as in Remove - Returns: pointer to the mem block if found, NULL otherwise -*/ -static struct mem_block *memory_tracker_find(size_t addr) { - struct mem_block *p = NULL; - - if (memtrack.head) { - p = memtrack.head->next; - - while (p && (p->addr != addr)) - p = p->next; - } - - return p; -} - - -#if !defined(NO_MUTEX) -/* - memory_tracker_lock_mutex() - Locks the memory tracker mutex with a platform specific call - Returns: - 0: Success - <0: Failure, either the mutex was not initialized - or the call to lock the mutex failed -*/ -static int memory_tracker_lock_mutex() { - int ret = -1; - - if (g_b_mem_tracker_inited) { - -#if HAVE_PTHREAD_H - ret = pthread_mutex_lock(&memtrack.mutex); -#elif defined(WIN32) || defined(_WIN32_WCE) - ret = WaitForSingleObject(memtrack.mutex, INFINITE); -#elif defined(VXWORKS) - ret = sem_take(memtrack.mutex, WAIT_FOREVER); -#endif - - if (ret) { - memtrack_log("memory_tracker_lock_mutex: mutex lock failed\n"); - } - } - - return ret; -} - -/* - memory_tracker_unlock_mutex() - Unlocks the memory tracker mutex with a platform specific call - Returns: - 0: Success - <0: Failure, either the mutex was not initialized - or the call to unlock the mutex failed -*/ -static int memory_tracker_unlock_mutex() { - int ret = -1; - - if (g_b_mem_tracker_inited) { - -#if HAVE_PTHREAD_H - ret = pthread_mutex_unlock(&memtrack.mutex); -#elif defined(WIN32) || defined(_WIN32_WCE) - ret = !ReleaseMutex(memtrack.mutex); -#elif defined(VXWORKS) - ret = sem_give(memtrack.mutex); -#endif - - if (ret) { - memtrack_log("memory_tracker_unlock_mutex: mutex unlock failed\n"); - } - } - - return ret; -} -#endif - -/* - vpx_memory_tracker_set_functions - - Sets the function pointers for the standard library functions. - - Return: - 0: on success - -1: if the use global function pointers is not set. -*/ -int vpx_memory_tracker_set_functions(mem_track_malloc_func g_malloc_l -, mem_track_calloc_func g_calloc_l -, mem_track_realloc_func g_realloc_l -, mem_track_free_func g_free_l -, mem_track_memcpy_func g_memcpy_l -, mem_track_memset_func g_memset_l -, mem_track_memmove_func g_memmove_l) { -#if USE_GLOBAL_FUNCTION_POINTERS - - if (g_malloc_l) - g_malloc = g_malloc_l; - - if (g_calloc_l) - g_calloc = g_calloc_l; - - if (g_realloc_l) - g_realloc = g_realloc_l; - - if (g_free_l) - g_free = g_free_l; - - if (g_memcpy_l) - g_memcpy = g_memcpy_l; - - if (g_memset_l) - g_memset = g_memset_l; - - if (g_memmove_l) - g_memmove = g_memmove_l; - - return 0; -#else - (void)g_malloc_l; - (void)g_calloc_l; - (void)g_realloc_l; - (void)g_free_l; - (void)g_memcpy_l; - (void)g_memset_l; - (void)g_memmove_l; - return -1; -#endif -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/arm_cpudetect.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/arm_cpudetect.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/arm_cpudetect.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/arm_cpudetect.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,175 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include "vpx_ports/arm.h" -#include "./vpx_config.h" - -#ifdef WINAPI_FAMILY -#include -#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) -#define getenv(x) NULL -#endif -#endif - -static int arm_cpu_env_flags(int *flags) { - char *env; - env = getenv("VPX_SIMD_CAPS"); - if (env && *env) { - *flags = (int)strtol(env, NULL, 0); - return 0; - } - *flags = 0; - return -1; -} - -static int arm_cpu_env_mask(void) { - char *env; - env = getenv("VPX_SIMD_CAPS_MASK"); - return env && *env ? (int)strtol(env, NULL, 0) : ~0; -} - -#if !CONFIG_RUNTIME_CPU_DETECT - -int arm_cpu_caps(void) { - /* This function should actually be a no-op. There is no way to adjust any of - * these because the RTCD tables do not exist: the functions are called - * statically */ - int flags; - int mask; - if (!arm_cpu_env_flags(&flags)) { - return flags; - } - mask = arm_cpu_env_mask(); -#if HAVE_MEDIA - flags |= HAS_MEDIA; -#endif /* HAVE_MEDIA */ -#if HAVE_NEON || HAVE_NEON_ASM - flags |= HAS_NEON; -#endif /* HAVE_NEON || HAVE_NEON_ASM */ - return flags & mask; -} - -#elif defined(_MSC_VER) /* end !CONFIG_RUNTIME_CPU_DETECT */ -/*For GetExceptionCode() and EXCEPTION_ILLEGAL_INSTRUCTION.*/ -#define WIN32_LEAN_AND_MEAN -#define WIN32_EXTRA_LEAN -#include - -int arm_cpu_caps(void) { - int flags; - int mask; - if (!arm_cpu_env_flags(&flags)) { - return flags; - } - mask = arm_cpu_env_mask(); - /* MSVC has no inline __asm support for ARM, but it does let you __emit - * instructions via their assembled hex code. - * All of these instructions should be essentially nops. - */ -#if HAVE_MEDIA - if (mask & HAS_MEDIA) - __try { - /*SHADD8 r3,r3,r3*/ - __emit(0xE6333F93); - flags |= HAS_MEDIA; - } __except (GetExceptionCode() == EXCEPTION_ILLEGAL_INSTRUCTION) { - /*Ignore exception.*/ - } -} -#endif /* HAVE_MEDIA */ -#if HAVE_NEON || HAVE_NEON_ASM -if (mask &HAS_NEON) { - __try { - /*VORR q0,q0,q0*/ - __emit(0xF2200150); - flags |= HAS_NEON; - } __except (GetExceptionCode() == EXCEPTION_ILLEGAL_INSTRUCTION) { - /*Ignore exception.*/ - } -} -#endif /* HAVE_NEON || HAVE_NEON_ASM */ -return flags & mask; -} - -#elif defined(__ANDROID__) /* end _MSC_VER */ -#include - -int arm_cpu_caps(void) { - int flags; - int mask; - uint64_t features; - if (!arm_cpu_env_flags(&flags)) { - return flags; - } - mask = arm_cpu_env_mask(); - features = android_getCpuFeatures(); - -#if HAVE_MEDIA - flags |= HAS_MEDIA; -#endif /* HAVE_MEDIA */ -#if HAVE_NEON || HAVE_NEON_ASM - if (features & ANDROID_CPU_ARM_FEATURE_NEON) - flags |= HAS_NEON; -#endif /* HAVE_NEON || HAVE_NEON_ASM */ - return flags & mask; -} - -#elif defined(__linux__) /* end __ANDROID__ */ - -#include - -int arm_cpu_caps(void) { - FILE *fin; - int flags; - int mask; - if (!arm_cpu_env_flags(&flags)) { - return flags; - } - mask = arm_cpu_env_mask(); - /* Reading /proc/self/auxv would be easier, but that doesn't work reliably - * on Android. - * This also means that detection will fail in Scratchbox. - */ - fin = fopen("/proc/cpuinfo", "r"); - if (fin != NULL) { - /* 512 should be enough for anybody (it's even enough for all the flags - * that x86 has accumulated... so far). - */ - char buf[512]; - while (fgets(buf, 511, fin) != NULL) { -#if HAVE_NEON || HAVE_NEON_ASM - if (memcmp(buf, "Features", 8) == 0) { - char *p; - p = strstr(buf, " neon"); - if (p != NULL && (p[5] == ' ' || p[5] == '\n')) { - flags |= HAS_NEON; - } - } -#endif /* HAVE_NEON || HAVE_NEON_ASM */ -#if HAVE_MEDIA - if (memcmp(buf, "CPU architecture:", 17) == 0) { - int version; - version = atoi(buf + 17); - if (version >= 6) { - flags |= HAS_MEDIA; - } - } -#endif /* HAVE_MEDIA */ - } - fclose(fin); - } - return flags & mask; -} -#else /* end __linux__ */ -#error "--enable-runtime-cpu-detect selected, but no CPU detection method " \ -"available for your platform. Reconfigure with --disable-runtime-cpu-detect." -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/arm.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/arm.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/arm.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/arm.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VPX_PORTS_ARM_H_ -#define VPX_PORTS_ARM_H_ -#include -#include "vpx_config.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/*ARMv5TE "Enhanced DSP" instructions.*/ -#define HAS_EDSP 0x01 -/*ARMv6 "Parallel" or "Media" instructions.*/ -#define HAS_MEDIA 0x02 -/*ARMv7 optional NEON instructions.*/ -#define HAS_NEON 0x04 - -int arm_cpu_caps(void); - -// Earlier gcc compilers have issues with some neon intrinsics -#if !defined(__clang__) && defined(__GNUC__) && \ - __GNUC__ == 4 && __GNUC_MINOR__ <= 6 -#define VPX_INCOMPATIBLE_GCC -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VPX_PORTS_ARM_H_ - diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/config.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/config.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/config.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/config.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VPX_PORTS_CONFIG_H_ -#define VPX_PORTS_CONFIG_H_ - -#include "vpx_config.h" - -#endif // VPX_PORTS_CONFIG_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/emmintrin_compat.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/emmintrin_compat.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/emmintrin_compat.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/emmintrin_compat.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2012 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VPX_PORTS_EMMINTRIN_COMPAT_H_ -#define VPX_PORTS_EMMINTRIN_COMPAT_H_ - -#if defined(__GNUC__) && __GNUC__ < 4 -/* From emmintrin.h (gcc 4.5.3) */ -/* Casts between various SP, DP, INT vector types. Note that these do no - conversion of values, they just change the type. */ -extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) -_mm_castpd_ps(__m128d __A) -{ - return (__m128) __A; -} - -extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) -_mm_castpd_si128(__m128d __A) -{ - return (__m128i) __A; -} - -extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) -_mm_castps_pd(__m128 __A) -{ - return (__m128d) __A; -} - -extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) -_mm_castps_si128(__m128 __A) -{ - return (__m128i) __A; -} - -extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) -_mm_castsi128_ps(__m128i __A) -{ - return (__m128) __A; -} - -extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) -_mm_castsi128_pd(__m128i __A) -{ - return (__m128d) __A; -} -#endif - -#endif // VPX_PORTS_EMMINTRIN_COMPAT_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/emms.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/emms.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/emms.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/emms.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_ports/x86_abi_support.asm" - -section .text -global sym(vpx_reset_mmx_state) PRIVATE -sym(vpx_reset_mmx_state): - emms - ret - - -%if LIBVPX_YASM_WIN64 -global sym(vpx_winx64_fldcw) PRIVATE -sym(vpx_winx64_fldcw): - sub rsp, 8 - mov [rsp], rcx ; win x64 specific - fldcw [rsp] - add rsp, 8 - ret - - -global sym(vpx_winx64_fstcw) PRIVATE -sym(vpx_winx64_fstcw): - sub rsp, 8 - fstcw [rsp] - mov rax, [rsp] - add rsp, 8 - ret -%endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/mem.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/mem.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/mem.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/mem.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VPX_PORTS_MEM_H_ -#define VPX_PORTS_MEM_H_ - -#include "vpx_config.h" -#include "vpx/vpx_integer.h" - -#if (defined(__GNUC__) && __GNUC__) || defined(__SUNPRO_C) -#define DECLARE_ALIGNED(n,typ,val) typ val __attribute__ ((aligned (n))) -#elif defined(_MSC_VER) -#define DECLARE_ALIGNED(n,typ,val) __declspec(align(n)) typ val -#else -#warning No alignment directives known for this compiler. -#define DECLARE_ALIGNED(n,typ,val) typ val -#endif - - -/* Declare an aligned array on the stack, for situations where the stack - * pointer may not have the alignment we expect. Creates an array with a - * modified name, then defines val to be a pointer, and aligns that pointer - * within the array. - */ -#define DECLARE_ALIGNED_ARRAY(a,typ,val,n)\ - typ val##_[(n)+(a)/sizeof(typ)+1];\ - typ *val = (typ*)((((intptr_t)val##_)+(a)-1)&((intptr_t)-(a))) - - -/* Indicates that the usage of the specified variable has been audited to assure - * that it's safe to use uninitialized. Silences 'may be used uninitialized' - * warnings on gcc. - */ -#if defined(__GNUC__) && __GNUC__ -#define UNINITIALIZED_IS_SAFE(x) x=x -#else -#define UNINITIALIZED_IS_SAFE(x) x -#endif - -#if HAVE_NEON && defined(_MSC_VER) -#define __builtin_prefetch(x) -#endif - -#endif // VPX_PORTS_MEM_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/mem_ops_aligned.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/mem_ops_aligned.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/mem_ops_aligned.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/mem_ops_aligned.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,169 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VPX_PORTS_MEM_OPS_ALIGNED_H_ -#define VPX_PORTS_MEM_OPS_ALIGNED_H_ - -#include "vpx/vpx_integer.h" - -/* \file - * \brief Provides portable memory access primitives for operating on aligned - * data - * - * This file is split from mem_ops.h for easier maintenance. See mem_ops.h - * for a more detailed description of these primitives. - */ -#ifndef INCLUDED_BY_MEM_OPS_H -#error Include mem_ops.h, not mem_ops_aligned.h directly. -#endif - -/* Architectures that provide instructions for doing this byte swapping - * could redefine these macros. - */ -#define swap_endian_16(val,raw) do {\ - val = ((raw>>8) & 0x00ff) \ - | ((raw<<8) & 0xff00);\ - } while(0) -#define swap_endian_32(val,raw) do {\ - val = ((raw>>24) & 0x000000ff) \ - | ((raw>>8) & 0x0000ff00) \ - | ((raw<<8) & 0x00ff0000) \ - | ((raw<<24) & 0xff000000); \ - } while(0) -#define swap_endian_16_se(val,raw) do {\ - swap_endian_16(val,raw);\ - val = ((val << 16) >> 16);\ - } while(0) -#define swap_endian_32_se(val,raw) swap_endian_32(val,raw) - -#define mem_get_ne_aligned_generic(end,sz) \ - static VPX_INLINE unsigned MEM_VALUE_T \ - mem_get_##end##sz##_aligned(const void *vmem) {\ - const uint##sz##_t *mem = (const uint##sz##_t *)vmem;\ - return *mem;\ - } - -#define mem_get_sne_aligned_generic(end,sz) \ - static VPX_INLINE signed MEM_VALUE_T \ - mem_get_s##end##sz##_aligned(const void *vmem) {\ - const int##sz##_t *mem = (const int##sz##_t *)vmem;\ - return *mem;\ - } - -#define mem_get_se_aligned_generic(end,sz) \ - static VPX_INLINE unsigned MEM_VALUE_T \ - mem_get_##end##sz##_aligned(const void *vmem) {\ - const uint##sz##_t *mem = (const uint##sz##_t *)vmem;\ - unsigned MEM_VALUE_T val, raw = *mem;\ - swap_endian_##sz(val,raw);\ - return val;\ - } - -#define mem_get_sse_aligned_generic(end,sz) \ - static VPX_INLINE signed MEM_VALUE_T \ - mem_get_s##end##sz##_aligned(const void *vmem) {\ - const int##sz##_t *mem = (const int##sz##_t *)vmem;\ - unsigned MEM_VALUE_T val, raw = *mem;\ - swap_endian_##sz##_se(val,raw);\ - return val;\ - } - -#define mem_put_ne_aligned_generic(end,sz) \ - static VPX_INLINE void \ - mem_put_##end##sz##_aligned(void *vmem, MEM_VALUE_T val) {\ - uint##sz##_t *mem = (uint##sz##_t *)vmem;\ - *mem = (uint##sz##_t)val;\ - } - -#define mem_put_se_aligned_generic(end,sz) \ - static VPX_INLINE void \ - mem_put_##end##sz##_aligned(void *vmem, MEM_VALUE_T val) {\ - uint##sz##_t *mem = (uint##sz##_t *)vmem, raw;\ - swap_endian_##sz(raw,val);\ - *mem = (uint##sz##_t)raw;\ - } - -#include "vpx_config.h" -#if CONFIG_BIG_ENDIAN -#define mem_get_be_aligned_generic(sz) mem_get_ne_aligned_generic(be,sz) -#define mem_get_sbe_aligned_generic(sz) mem_get_sne_aligned_generic(be,sz) -#define mem_get_le_aligned_generic(sz) mem_get_se_aligned_generic(le,sz) -#define mem_get_sle_aligned_generic(sz) mem_get_sse_aligned_generic(le,sz) -#define mem_put_be_aligned_generic(sz) mem_put_ne_aligned_generic(be,sz) -#define mem_put_le_aligned_generic(sz) mem_put_se_aligned_generic(le,sz) -#else -#define mem_get_be_aligned_generic(sz) mem_get_se_aligned_generic(be,sz) -#define mem_get_sbe_aligned_generic(sz) mem_get_sse_aligned_generic(be,sz) -#define mem_get_le_aligned_generic(sz) mem_get_ne_aligned_generic(le,sz) -#define mem_get_sle_aligned_generic(sz) mem_get_sne_aligned_generic(le,sz) -#define mem_put_be_aligned_generic(sz) mem_put_se_aligned_generic(be,sz) -#define mem_put_le_aligned_generic(sz) mem_put_ne_aligned_generic(le,sz) -#endif - -#undef mem_get_be16_aligned -#define mem_get_be16_aligned mem_ops_wrap_symbol(mem_get_be16_aligned) -mem_get_be_aligned_generic(16) - -#undef mem_get_be32_aligned -#define mem_get_be32_aligned mem_ops_wrap_symbol(mem_get_be32_aligned) -mem_get_be_aligned_generic(32) - -#undef mem_get_le16_aligned -#define mem_get_le16_aligned mem_ops_wrap_symbol(mem_get_le16_aligned) -mem_get_le_aligned_generic(16) - -#undef mem_get_le32_aligned -#define mem_get_le32_aligned mem_ops_wrap_symbol(mem_get_le32_aligned) -mem_get_le_aligned_generic(32) - -#undef mem_get_sbe16_aligned -#define mem_get_sbe16_aligned mem_ops_wrap_symbol(mem_get_sbe16_aligned) -mem_get_sbe_aligned_generic(16) - -#undef mem_get_sbe32_aligned -#define mem_get_sbe32_aligned mem_ops_wrap_symbol(mem_get_sbe32_aligned) -mem_get_sbe_aligned_generic(32) - -#undef mem_get_sle16_aligned -#define mem_get_sle16_aligned mem_ops_wrap_symbol(mem_get_sle16_aligned) -mem_get_sle_aligned_generic(16) - -#undef mem_get_sle32_aligned -#define mem_get_sle32_aligned mem_ops_wrap_symbol(mem_get_sle32_aligned) -mem_get_sle_aligned_generic(32) - -#undef mem_put_be16_aligned -#define mem_put_be16_aligned mem_ops_wrap_symbol(mem_put_be16_aligned) -mem_put_be_aligned_generic(16) - -#undef mem_put_be32_aligned -#define mem_put_be32_aligned mem_ops_wrap_symbol(mem_put_be32_aligned) -mem_put_be_aligned_generic(32) - -#undef mem_put_le16_aligned -#define mem_put_le16_aligned mem_ops_wrap_symbol(mem_put_le16_aligned) -mem_put_le_aligned_generic(16) - -#undef mem_put_le32_aligned -#define mem_put_le32_aligned mem_ops_wrap_symbol(mem_put_le32_aligned) -mem_put_le_aligned_generic(32) - -#undef mem_get_ne_aligned_generic -#undef mem_get_se_aligned_generic -#undef mem_get_sne_aligned_generic -#undef mem_get_sse_aligned_generic -#undef mem_put_ne_aligned_generic -#undef mem_put_se_aligned_generic -#undef swap_endian_16 -#undef swap_endian_32 -#undef swap_endian_16_se -#undef swap_endian_32_se - -#endif // VPX_PORTS_MEM_OPS_ALIGNED_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/mem_ops.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/mem_ops.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/mem_ops.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/mem_ops.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,226 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VPX_PORTS_MEM_OPS_H_ -#define VPX_PORTS_MEM_OPS_H_ - -/* \file - * \brief Provides portable memory access primitives - * - * This function provides portable primitives for getting and setting of - * signed and unsigned integers in 16, 24, and 32 bit sizes. The operations - * can be performed on unaligned data regardless of hardware support for - * unaligned accesses. - * - * The type used to pass the integral values may be changed by defining - * MEM_VALUE_T with the appropriate type. The type given must be an integral - * numeric type. - * - * The actual functions instantiated have the MEM_VALUE_T type name pasted - * on to the symbol name. This allows the developer to instantiate these - * operations for multiple types within the same translation unit. This is - * of somewhat questionable utility, but the capability exists nonetheless. - * Users not making use of this functionality should call the functions - * without the type name appended, and the preprocessor will take care of - * it. - * - * NOTE: This code is not supported on platforms where char > 1 octet ATM. - */ - -#ifndef MAU_T -/* Minimum Access Unit for this target */ -#define MAU_T unsigned char -#endif - -#ifndef MEM_VALUE_T -#define MEM_VALUE_T int -#endif - -#undef MEM_VALUE_T_SZ_BITS -#define MEM_VALUE_T_SZ_BITS (sizeof(MEM_VALUE_T) << 3) - -#undef mem_ops_wrap_symbol -#define mem_ops_wrap_symbol(fn) mem_ops_wrap_symbol2(fn, MEM_VALUE_T) -#undef mem_ops_wrap_symbol2 -#define mem_ops_wrap_symbol2(fn,typ) mem_ops_wrap_symbol3(fn,typ) -#undef mem_ops_wrap_symbol3 -#define mem_ops_wrap_symbol3(fn,typ) fn##_as_##typ - -/* - * Include aligned access routines - */ -#define INCLUDED_BY_MEM_OPS_H -#include "mem_ops_aligned.h" -#undef INCLUDED_BY_MEM_OPS_H - -#undef mem_get_be16 -#define mem_get_be16 mem_ops_wrap_symbol(mem_get_be16) -static unsigned MEM_VALUE_T mem_get_be16(const void *vmem) { - unsigned MEM_VALUE_T val; - const MAU_T *mem = (const MAU_T *)vmem; - - val = mem[0] << 8; - val |= mem[1]; - return val; -} - -#undef mem_get_be24 -#define mem_get_be24 mem_ops_wrap_symbol(mem_get_be24) -static unsigned MEM_VALUE_T mem_get_be24(const void *vmem) { - unsigned MEM_VALUE_T val; - const MAU_T *mem = (const MAU_T *)vmem; - - val = mem[0] << 16; - val |= mem[1] << 8; - val |= mem[2]; - return val; -} - -#undef mem_get_be32 -#define mem_get_be32 mem_ops_wrap_symbol(mem_get_be32) -static unsigned MEM_VALUE_T mem_get_be32(const void *vmem) { - unsigned MEM_VALUE_T val; - const MAU_T *mem = (const MAU_T *)vmem; - - val = mem[0] << 24; - val |= mem[1] << 16; - val |= mem[2] << 8; - val |= mem[3]; - return val; -} - -#undef mem_get_le16 -#define mem_get_le16 mem_ops_wrap_symbol(mem_get_le16) -static unsigned MEM_VALUE_T mem_get_le16(const void *vmem) { - unsigned MEM_VALUE_T val; - const MAU_T *mem = (const MAU_T *)vmem; - - val = mem[1] << 8; - val |= mem[0]; - return val; -} - -#undef mem_get_le24 -#define mem_get_le24 mem_ops_wrap_symbol(mem_get_le24) -static unsigned MEM_VALUE_T mem_get_le24(const void *vmem) { - unsigned MEM_VALUE_T val; - const MAU_T *mem = (const MAU_T *)vmem; - - val = mem[2] << 16; - val |= mem[1] << 8; - val |= mem[0]; - return val; -} - -#undef mem_get_le32 -#define mem_get_le32 mem_ops_wrap_symbol(mem_get_le32) -static unsigned MEM_VALUE_T mem_get_le32(const void *vmem) { - unsigned MEM_VALUE_T val; - const MAU_T *mem = (const MAU_T *)vmem; - - val = mem[3] << 24; - val |= mem[2] << 16; - val |= mem[1] << 8; - val |= mem[0]; - return val; -} - -#define mem_get_s_generic(end,sz) \ - static VPX_INLINE signed MEM_VALUE_T mem_get_s##end##sz(const void *vmem) {\ - const MAU_T *mem = (const MAU_T*)vmem;\ - signed MEM_VALUE_T val = mem_get_##end##sz(mem);\ - return (val << (MEM_VALUE_T_SZ_BITS - sz)) >> (MEM_VALUE_T_SZ_BITS - sz);\ - } - -#undef mem_get_sbe16 -#define mem_get_sbe16 mem_ops_wrap_symbol(mem_get_sbe16) -mem_get_s_generic(be, 16) - -#undef mem_get_sbe24 -#define mem_get_sbe24 mem_ops_wrap_symbol(mem_get_sbe24) -mem_get_s_generic(be, 24) - -#undef mem_get_sbe32 -#define mem_get_sbe32 mem_ops_wrap_symbol(mem_get_sbe32) -mem_get_s_generic(be, 32) - -#undef mem_get_sle16 -#define mem_get_sle16 mem_ops_wrap_symbol(mem_get_sle16) -mem_get_s_generic(le, 16) - -#undef mem_get_sle24 -#define mem_get_sle24 mem_ops_wrap_symbol(mem_get_sle24) -mem_get_s_generic(le, 24) - -#undef mem_get_sle32 -#define mem_get_sle32 mem_ops_wrap_symbol(mem_get_sle32) -mem_get_s_generic(le, 32) - -#undef mem_put_be16 -#define mem_put_be16 mem_ops_wrap_symbol(mem_put_be16) -static VPX_INLINE void mem_put_be16(void *vmem, MEM_VALUE_T val) { - MAU_T *mem = (MAU_T *)vmem; - - mem[0] = (val >> 8) & 0xff; - mem[1] = (val >> 0) & 0xff; -} - -#undef mem_put_be24 -#define mem_put_be24 mem_ops_wrap_symbol(mem_put_be24) -static VPX_INLINE void mem_put_be24(void *vmem, MEM_VALUE_T val) { - MAU_T *mem = (MAU_T *)vmem; - - mem[0] = (val >> 16) & 0xff; - mem[1] = (val >> 8) & 0xff; - mem[2] = (val >> 0) & 0xff; -} - -#undef mem_put_be32 -#define mem_put_be32 mem_ops_wrap_symbol(mem_put_be32) -static VPX_INLINE void mem_put_be32(void *vmem, MEM_VALUE_T val) { - MAU_T *mem = (MAU_T *)vmem; - - mem[0] = (val >> 24) & 0xff; - mem[1] = (val >> 16) & 0xff; - mem[2] = (val >> 8) & 0xff; - mem[3] = (val >> 0) & 0xff; -} - -#undef mem_put_le16 -#define mem_put_le16 mem_ops_wrap_symbol(mem_put_le16) -static VPX_INLINE void mem_put_le16(void *vmem, MEM_VALUE_T val) { - MAU_T *mem = (MAU_T *)vmem; - - mem[0] = (val >> 0) & 0xff; - mem[1] = (val >> 8) & 0xff; -} - -#undef mem_put_le24 -#define mem_put_le24 mem_ops_wrap_symbol(mem_put_le24) -static VPX_INLINE void mem_put_le24(void *vmem, MEM_VALUE_T val) { - MAU_T *mem = (MAU_T *)vmem; - - mem[0] = (val >> 0) & 0xff; - mem[1] = (val >> 8) & 0xff; - mem[2] = (val >> 16) & 0xff; -} - -#undef mem_put_le32 -#define mem_put_le32 mem_ops_wrap_symbol(mem_put_le32) -static VPX_INLINE void mem_put_le32(void *vmem, MEM_VALUE_T val) { - MAU_T *mem = (MAU_T *)vmem; - - mem[0] = (val >> 0) & 0xff; - mem[1] = (val >> 8) & 0xff; - mem[2] = (val >> 16) & 0xff; - mem[3] = (val >> 24) & 0xff; -} - -#endif // VPX_PORTS_MEM_OPS_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/vpx_once.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/vpx_once.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/vpx_once.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/vpx_once.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2011 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VPX_PORTS_VPX_ONCE_H_ -#define VPX_PORTS_VPX_ONCE_H_ - -#include "vpx_config.h" - -#if CONFIG_MULTITHREAD && defined(_WIN32) -#include -#include -static void once(void (*func)(void)) -{ - static CRITICAL_SECTION *lock; - static LONG waiters; - static int done; - void *lock_ptr = &lock; - - /* If the initialization is complete, return early. This isn't just an - * optimization, it prevents races on the destruction of the global - * lock. - */ - if(done) - return; - - InterlockedIncrement(&waiters); - - /* Get a lock. We create one and try to make it the one-true-lock, - * throwing it away if we lost the race. - */ - - { - /* Scope to protect access to new_lock */ - CRITICAL_SECTION *new_lock = malloc(sizeof(CRITICAL_SECTION)); - InitializeCriticalSection(new_lock); - if (InterlockedCompareExchangePointer(lock_ptr, new_lock, NULL) != NULL) - { - DeleteCriticalSection(new_lock); - free(new_lock); - } - } - - /* At this point, we have a lock that can be synchronized on. We don't - * care which thread actually performed the allocation. - */ - - EnterCriticalSection(lock); - - if (!done) - { - func(); - done = 1; - } - - LeaveCriticalSection(lock); - - /* Last one out should free resources. The destructed objects are - * protected by checking if(done) above. - */ - if(!InterlockedDecrement(&waiters)) - { - DeleteCriticalSection(lock); - free(lock); - lock = NULL; - } -} - - -#elif CONFIG_MULTITHREAD && defined(__OS2__) -#define INCL_DOS -#include -static void once(void (*func)(void)) -{ - static int done; - - /* If the initialization is complete, return early. */ - if(done) - return; - - /* Causes all other threads in the process to block themselves - * and give up their time slice. - */ - DosEnterCritSec(); - - if (!done) - { - func(); - done = 1; - } - - /* Restores normal thread dispatching for the current process. */ - DosExitCritSec(); -} - - -#elif CONFIG_MULTITHREAD && HAVE_PTHREAD_H -#include -static void once(void (*func)(void)) -{ - static pthread_once_t lock = PTHREAD_ONCE_INIT; - pthread_once(&lock, func); -} - - -#else -/* No-op version that performs no synchronization. vp8_rtcd() is idempotent, - * so as long as your platform provides atomic loads/stores of pointers - * no synchronization is strictly necessary. - */ - -static void once(void (*func)(void)) -{ - static int done; - - if(!done) - { - func(); - done = 1; - } -} -#endif - -#endif // VPX_PORTS_VPX_ONCE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/vpx_ports.mk gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/vpx_ports.mk --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/vpx_ports.mk 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/vpx_ports.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -## -## Copyright (c) 2012 The WebM project authors. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license -## that can be found in the LICENSE file in the root of the source -## tree. An additional intellectual property rights grant can be found -## in the file PATENTS. All contributing project authors may -## be found in the AUTHORS file in the root of the source tree. -## - - -PORTS_SRCS-yes += vpx_ports.mk - -PORTS_SRCS-$(BUILD_LIBVPX) += mem.h -PORTS_SRCS-$(BUILD_LIBVPX) += vpx_timer.h - -ifeq ($(ARCH_X86)$(ARCH_X86_64),yes) -PORTS_SRCS-$(BUILD_LIBVPX) += emms.asm -PORTS_SRCS-$(BUILD_LIBVPX) += x86.h -PORTS_SRCS-$(BUILD_LIBVPX) += x86_abi_support.asm -endif - -PORTS_SRCS-$(ARCH_ARM) += arm_cpudetect.c -PORTS_SRCS-$(ARCH_ARM) += arm.h diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/vpx_timer.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/vpx_timer.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/vpx_timer.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/vpx_timer.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VPX_PORTS_VPX_TIMER_H_ -#define VPX_PORTS_VPX_TIMER_H_ - -#include "./vpx_config.h" - -#include "vpx/vpx_integer.h" - -#if CONFIG_OS_SUPPORT - -#if defined(_WIN32) -/* - * Win32 specific includes - */ -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -/* - * POSIX specific includes - */ -#include - -/* timersub is not provided by msys at this time. */ -#ifndef timersub -#define timersub(a, b, result) \ - do { \ - (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ - (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ - if ((result)->tv_usec < 0) { \ - --(result)->tv_sec; \ - (result)->tv_usec += 1000000; \ - } \ - } while (0) -#endif -#endif - - -struct vpx_usec_timer { -#if defined(_WIN32) - LARGE_INTEGER begin, end; -#else - struct timeval begin, end; -#endif -}; - - -static INLINE void -vpx_usec_timer_start(struct vpx_usec_timer *t) { -#if defined(_WIN32) - QueryPerformanceCounter(&t->begin); -#else - gettimeofday(&t->begin, NULL); -#endif -} - - -static INLINE void -vpx_usec_timer_mark(struct vpx_usec_timer *t) { -#if defined(_WIN32) - QueryPerformanceCounter(&t->end); -#else - gettimeofday(&t->end, NULL); -#endif -} - - -static INLINE int64_t -vpx_usec_timer_elapsed(struct vpx_usec_timer *t) { -#if defined(_WIN32) - LARGE_INTEGER freq, diff; - - diff.QuadPart = t->end.QuadPart - t->begin.QuadPart; - - QueryPerformanceFrequency(&freq); - return diff.QuadPart * 1000000 / freq.QuadPart; -#else - struct timeval diff; - - timersub(&t->end, &t->begin, &diff); - return diff.tv_sec * 1000000 + diff.tv_usec; -#endif -} - -#else /* CONFIG_OS_SUPPORT = 0*/ - -/* Empty timer functions if CONFIG_OS_SUPPORT = 0 */ -#ifndef timersub -#define timersub(a, b, result) -#endif - -struct vpx_usec_timer { - void *dummy; -}; - -static INLINE void -vpx_usec_timer_start(struct vpx_usec_timer *t) { } - -static INLINE void -vpx_usec_timer_mark(struct vpx_usec_timer *t) { } - -static INLINE int -vpx_usec_timer_elapsed(struct vpx_usec_timer *t) { - return 0; -} - -#endif /* CONFIG_OS_SUPPORT */ - -#endif // VPX_PORTS_VPX_TIMER_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/x86_abi_support.asm gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/x86_abi_support.asm --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/x86_abi_support.asm 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/x86_abi_support.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,406 +0,0 @@ -; -; Copyright (c) 2010 The WebM project authors. All Rights Reserved. -; -; Use of this source code is governed by a BSD-style license -; that can be found in the LICENSE file in the root of the source -; tree. An additional intellectual property rights grant can be found -; in the file PATENTS. All contributing project authors may -; be found in the AUTHORS file in the root of the source tree. -; - - -%include "vpx_config.asm" - -; 32/64 bit compatibility macros -; -; In general, we make the source use 64 bit syntax, then twiddle with it using -; the preprocessor to get the 32 bit syntax on 32 bit platforms. -; -%ifidn __OUTPUT_FORMAT__,elf32 -%define ABI_IS_32BIT 1 -%elifidn __OUTPUT_FORMAT__,macho32 -%define ABI_IS_32BIT 1 -%elifidn __OUTPUT_FORMAT__,win32 -%define ABI_IS_32BIT 1 -%elifidn __OUTPUT_FORMAT__,aout -%define ABI_IS_32BIT 1 -%else -%define ABI_IS_32BIT 0 -%endif - -%if ABI_IS_32BIT -%define rax eax -%define rbx ebx -%define rcx ecx -%define rdx edx -%define rsi esi -%define rdi edi -%define rsp esp -%define rbp ebp -%define movsxd mov -%macro movq 2 - %ifidn %1,eax - movd %1,%2 - %elifidn %2,eax - movd %1,%2 - %elifidn %1,ebx - movd %1,%2 - %elifidn %2,ebx - movd %1,%2 - %elifidn %1,ecx - movd %1,%2 - %elifidn %2,ecx - movd %1,%2 - %elifidn %1,edx - movd %1,%2 - %elifidn %2,edx - movd %1,%2 - %elifidn %1,esi - movd %1,%2 - %elifidn %2,esi - movd %1,%2 - %elifidn %1,edi - movd %1,%2 - %elifidn %2,edi - movd %1,%2 - %elifidn %1,esp - movd %1,%2 - %elifidn %2,esp - movd %1,%2 - %elifidn %1,ebp - movd %1,%2 - %elifidn %2,ebp - movd %1,%2 - %else - movq %1,%2 - %endif -%endmacro -%endif - - -; LIBVPX_YASM_WIN64 -; Set LIBVPX_YASM_WIN64 if output is Windows 64bit so the code will work if x64 -; or win64 is defined on the Yasm command line. -%ifidn __OUTPUT_FORMAT__,win64 -%define LIBVPX_YASM_WIN64 1 -%elifidn __OUTPUT_FORMAT__,x64 -%define LIBVPX_YASM_WIN64 1 -%else -%define LIBVPX_YASM_WIN64 0 -%endif - -; sym() -; Return the proper symbol name for the target ABI. -; -; Certain ABIs, notably MS COFF and Darwin MACH-O, require that symbols -; with C linkage be prefixed with an underscore. -; -%ifidn __OUTPUT_FORMAT__,elf32 -%define sym(x) x -%elifidn __OUTPUT_FORMAT__,elf64 -%define sym(x) x -%elifidn __OUTPUT_FORMAT__,elfx32 -%define sym(x) x -%elif LIBVPX_YASM_WIN64 -%define sym(x) x -%else -%define sym(x) _ %+ x -%endif - -; PRIVATE -; Macro for the attribute to hide a global symbol for the target ABI. -; This is only active if CHROMIUM is defined. -; -; Chromium doesn't like exported global symbols due to symbol clashing with -; plugins among other things. -; -; Requires Chromium's patched copy of yasm: -; http://src.chromium.org/viewvc/chrome?view=rev&revision=73761 -; http://www.tortall.net/projects/yasm/ticket/236 -; -%ifdef CHROMIUM - %ifidn __OUTPUT_FORMAT__,elf32 - %define PRIVATE :hidden - %elifidn __OUTPUT_FORMAT__,elf64 - %define PRIVATE :hidden - %elifidn __OUTPUT_FORMAT__,elfx32 - %define PRIVATE :hidden - %elif LIBVPX_YASM_WIN64 - %define PRIVATE - %else - %define PRIVATE :private_extern - %endif -%else - %define PRIVATE -%endif - -; arg() -; Return the address specification of the given argument -; -%if ABI_IS_32BIT - %define arg(x) [ebp+8+4*x] -%else - ; 64 bit ABI passes arguments in registers. This is a workaround to get up - ; and running quickly. Relies on SHADOW_ARGS_TO_STACK - %if LIBVPX_YASM_WIN64 - %define arg(x) [rbp+16+8*x] - %else - %define arg(x) [rbp-8-8*x] - %endif -%endif - -; REG_SZ_BYTES, REG_SZ_BITS -; Size of a register -%if ABI_IS_32BIT -%define REG_SZ_BYTES 4 -%define REG_SZ_BITS 32 -%else -%define REG_SZ_BYTES 8 -%define REG_SZ_BITS 64 -%endif - - -; ALIGN_STACK -; This macro aligns the stack to the given alignment (in bytes). The stack -; is left such that the previous value of the stack pointer is the first -; argument on the stack (ie, the inverse of this macro is 'pop rsp.') -; This macro uses one temporary register, which is not preserved, and thus -; must be specified as an argument. -%macro ALIGN_STACK 2 - mov %2, rsp - and rsp, -%1 - lea rsp, [rsp - (%1 - REG_SZ_BYTES)] - push %2 -%endmacro - - -; -; The Microsoft assembler tries to impose a certain amount of type safety in -; its register usage. YASM doesn't recognize these directives, so we just -; %define them away to maintain as much compatibility as possible with the -; original inline assembler we're porting from. -; -%idefine PTR -%idefine XMMWORD -%idefine MMWORD - -; PIC macros -; -%if ABI_IS_32BIT - %if CONFIG_PIC=1 - %ifidn __OUTPUT_FORMAT__,elf32 - %define GET_GOT_SAVE_ARG 1 - %define WRT_PLT wrt ..plt - %macro GET_GOT 1 - extern _GLOBAL_OFFSET_TABLE_ - push %1 - call %%get_got - %%sub_offset: - jmp %%exitGG - %%get_got: - mov %1, [esp] - add %1, _GLOBAL_OFFSET_TABLE_ + $$ - %%sub_offset wrt ..gotpc - ret - %%exitGG: - %undef GLOBAL - %define GLOBAL(x) x + %1 wrt ..gotoff - %undef RESTORE_GOT - %define RESTORE_GOT pop %1 - %endmacro - %elifidn __OUTPUT_FORMAT__,macho32 - %define GET_GOT_SAVE_ARG 1 - %macro GET_GOT 1 - push %1 - call %%get_got - %%get_got: - pop %1 - %undef GLOBAL - %define GLOBAL(x) x + %1 - %%get_got - %undef RESTORE_GOT - %define RESTORE_GOT pop %1 - %endmacro - %endif - %endif - - %ifdef CHROMIUM - %ifidn __OUTPUT_FORMAT__,macho32 - %define HIDDEN_DATA(x) x:private_extern - %else - %define HIDDEN_DATA(x) x - %endif - %else - %define HIDDEN_DATA(x) x - %endif -%else - %macro GET_GOT 1 - %endmacro - %define GLOBAL(x) rel x - %ifidn __OUTPUT_FORMAT__,elf64 - %define WRT_PLT wrt ..plt - %define HIDDEN_DATA(x) x:data hidden - %elifidn __OUTPUT_FORMAT__,elfx32 - %define WRT_PLT wrt ..plt - %define HIDDEN_DATA(x) x:data hidden - %elifidn __OUTPUT_FORMAT__,macho64 - %ifdef CHROMIUM - %define HIDDEN_DATA(x) x:private_extern - %else - %define HIDDEN_DATA(x) x - %endif - %else - %define HIDDEN_DATA(x) x - %endif -%endif -%ifnmacro GET_GOT - %macro GET_GOT 1 - %endmacro - %define GLOBAL(x) x -%endif -%ifndef RESTORE_GOT -%define RESTORE_GOT -%endif -%ifndef WRT_PLT -%define WRT_PLT -%endif - -%if ABI_IS_32BIT - %macro SHADOW_ARGS_TO_STACK 1 - %endm - %define UNSHADOW_ARGS -%else -%if LIBVPX_YASM_WIN64 - %macro SHADOW_ARGS_TO_STACK 1 ; argc - %if %1 > 0 - mov arg(0),rcx - %endif - %if %1 > 1 - mov arg(1),rdx - %endif - %if %1 > 2 - mov arg(2),r8 - %endif - %if %1 > 3 - mov arg(3),r9 - %endif - %endm -%else - %macro SHADOW_ARGS_TO_STACK 1 ; argc - %if %1 > 0 - push rdi - %endif - %if %1 > 1 - push rsi - %endif - %if %1 > 2 - push rdx - %endif - %if %1 > 3 - push rcx - %endif - %if %1 > 4 - push r8 - %endif - %if %1 > 5 - push r9 - %endif - %if %1 > 6 - %assign i %1-6 - %assign off 16 - %rep i - mov rax,[rbp+off] - push rax - %assign off off+8 - %endrep - %endif - %endm -%endif - %define UNSHADOW_ARGS mov rsp, rbp -%endif - -; Win64 ABI requires that XMM6:XMM15 are callee saved -; SAVE_XMM n, [u] -; store registers 6-n on the stack -; if u is specified, use unaligned movs. -; Win64 ABI requires 16 byte stack alignment, but then pushes an 8 byte return -; value. Typically we follow this up with 'push rbp' - re-aligning the stack - -; but in some cases this is not done and unaligned movs must be used. -%if LIBVPX_YASM_WIN64 -%macro SAVE_XMM 1-2 a - %if %1 < 6 - %error Only xmm registers 6-15 must be preserved - %else - %assign last_xmm %1 - %define movxmm movdq %+ %2 - %assign xmm_stack_space ((last_xmm - 5) * 16) - sub rsp, xmm_stack_space - %assign i 6 - %rep (last_xmm - 5) - movxmm [rsp + ((i - 6) * 16)], xmm %+ i - %assign i i+1 - %endrep - %endif -%endmacro -%macro RESTORE_XMM 0 - %ifndef last_xmm - %error RESTORE_XMM must be paired with SAVE_XMM n - %else - %assign i last_xmm - %rep (last_xmm - 5) - movxmm xmm %+ i, [rsp +((i - 6) * 16)] - %assign i i-1 - %endrep - add rsp, xmm_stack_space - ; there are a couple functions which return from multiple places. - ; otherwise, we could uncomment these: - ; %undef last_xmm - ; %undef xmm_stack_space - ; %undef movxmm - %endif -%endmacro -%else -%macro SAVE_XMM 1-2 -%endmacro -%macro RESTORE_XMM 0 -%endmacro -%endif - -; Name of the rodata section -; -; .rodata seems to be an elf-ism, as it doesn't work on OSX. -; -%ifidn __OUTPUT_FORMAT__,macho64 -%define SECTION_RODATA section .text -%elifidn __OUTPUT_FORMAT__,macho32 -%macro SECTION_RODATA 0 -section .text -%endmacro -%elifidn __OUTPUT_FORMAT__,aout -%define SECTION_RODATA section .data -%else -%define SECTION_RODATA section .rodata -%endif - - -; Tell GNU ld that we don't require an executable stack. -%ifidn __OUTPUT_FORMAT__,elf32 -section .note.GNU-stack noalloc noexec nowrite progbits -section .text -%elifidn __OUTPUT_FORMAT__,elf64 -section .note.GNU-stack noalloc noexec nowrite progbits -section .text -%elifidn __OUTPUT_FORMAT__,elfx32 -section .note.GNU-stack noalloc noexec nowrite progbits -section .text -%endif - -; On Android platforms use lrand48 when building postproc routines. Prior to L -; rand() was not available. -%if CONFIG_POSTPROC=1 || CONFIG_VP9_POSTPROC=1 -%ifdef __ANDROID__ -extern sym(lrand48) -%define LIBVPX_RAND lrand48 -%else -extern sym(rand) -%define LIBVPX_RAND rand -%endif -%endif ; CONFIG_POSTPROC || CONFIG_VP9_POSTPROC diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/x86.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/x86.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_ports/x86.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_ports/x86.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,301 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VPX_PORTS_X86_H_ -#define VPX_PORTS_X86_H_ -#include -#include "vpx_config.h" -#include "vpx/vpx_integer.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - VPX_CPU_UNKNOWN = -1, - VPX_CPU_AMD, - VPX_CPU_AMD_OLD, - VPX_CPU_CENTAUR, - VPX_CPU_CYRIX, - VPX_CPU_INTEL, - VPX_CPU_NEXGEN, - VPX_CPU_NSC, - VPX_CPU_RISE, - VPX_CPU_SIS, - VPX_CPU_TRANSMETA, - VPX_CPU_TRANSMETA_OLD, - VPX_CPU_UMC, - VPX_CPU_VIA, - - VPX_CPU_LAST -} vpx_cpu_t; - -#if defined(__GNUC__) && __GNUC__ || defined(__ANDROID__) -#if ARCH_X86_64 -#define cpuid(func, func2, ax, bx, cx, dx)\ - __asm__ __volatile__ (\ - "cpuid \n\t" \ - : "=a" (ax), "=b" (bx), "=c" (cx), "=d" (dx) \ - : "a" (func), "c" (func2)); -#else -#define cpuid(func, func2, ax, bx, cx, dx)\ - __asm__ __volatile__ (\ - "mov %%ebx, %%edi \n\t" \ - "cpuid \n\t" \ - "xchg %%edi, %%ebx \n\t" \ - : "=a" (ax), "=D" (bx), "=c" (cx), "=d" (dx) \ - : "a" (func), "c" (func2)); -#endif -#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* end __GNUC__ or __ANDROID__*/ -#if ARCH_X86_64 -#define cpuid(func, func2, ax, bx, cx, dx)\ - asm volatile (\ - "xchg %rsi, %rbx \n\t" \ - "cpuid \n\t" \ - "movl %ebx, %edi \n\t" \ - "xchg %rsi, %rbx \n\t" \ - : "=a" (ax), "=D" (bx), "=c" (cx), "=d" (dx) \ - : "a" (func), "c" (func2)); -#else -#define cpuid(func, func2, ax, bx, cx, dx)\ - asm volatile (\ - "pushl %ebx \n\t" \ - "cpuid \n\t" \ - "movl %ebx, %edi \n\t" \ - "popl %ebx \n\t" \ - : "=a" (ax), "=D" (bx), "=c" (cx), "=d" (dx) \ - : "a" (func), "c" (func2)); -#endif -#else /* end __SUNPRO__ */ -#if ARCH_X86_64 -#if defined(_MSC_VER) && _MSC_VER > 1500 -void __cpuidex(int CPUInfo[4], int info_type, int ecxvalue); -#pragma intrinsic(__cpuidex) -#define cpuid(func, func2, a, b, c, d) do {\ - int regs[4];\ - __cpuidex(regs, func, func2); \ - a = regs[0]; b = regs[1]; c = regs[2]; d = regs[3];\ - } while(0) -#else -void __cpuid(int CPUInfo[4], int info_type); -#pragma intrinsic(__cpuid) -#define cpuid(func, func2, a, b, c, d) do {\ - int regs[4];\ - __cpuid(regs, func); \ - a = regs[0]; b = regs[1]; c = regs[2]; d = regs[3];\ - } while (0) -#endif -#else -#define cpuid(func, func2, a, b, c, d)\ - __asm mov eax, func\ - __asm mov ecx, func2\ - __asm cpuid\ - __asm mov a, eax\ - __asm mov b, ebx\ - __asm mov c, ecx\ - __asm mov d, edx -#endif -#endif /* end others */ - -// NaCl has no support for xgetbv or the raw opcode. -#if !defined(__native_client__) && (defined(__i386__) || defined(__x86_64__)) -static INLINE uint64_t xgetbv(void) { - const uint32_t ecx = 0; - uint32_t eax, edx; - // Use the raw opcode for xgetbv for compatibility with older toolchains. - __asm__ volatile ( - ".byte 0x0f, 0x01, 0xd0\n" - : "=a"(eax), "=d"(edx) : "c" (ecx)); - return ((uint64_t)edx << 32) | eax; -} -#elif (defined(_M_X64) || defined(_M_IX86)) && \ - defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 160040219 // >= VS2010 SP1 -#include -#define xgetbv() _xgetbv(0) -#elif defined(_MSC_VER) && defined(_M_IX86) -static INLINE uint64_t xgetbv(void) { - uint32_t eax_, edx_; - __asm { - xor ecx, ecx // ecx = 0 - // Use the raw opcode for xgetbv for compatibility with older toolchains. - __asm _emit 0x0f __asm _emit 0x01 __asm _emit 0xd0 - mov eax_, eax - mov edx_, edx - } - return ((uint64_t)edx_ << 32) | eax_; -} -#else -#define xgetbv() 0U // no AVX for older x64 or unrecognized toolchains. -#endif - -#define HAS_MMX 0x01 -#define HAS_SSE 0x02 -#define HAS_SSE2 0x04 -#define HAS_SSE3 0x08 -#define HAS_SSSE3 0x10 -#define HAS_SSE4_1 0x20 -#define HAS_AVX 0x40 -#define HAS_AVX2 0x80 -#ifndef BIT -#define BIT(n) (1<> 8); - des[2] = (unsigned char)((c * 128 + d * 128 + 128) >> 8); - des[3] = (unsigned char)((d * 64 + e * 192 + 128) >> 8); - - src += 5; - des += 4; - } -} - - - - -void vp8_vertical_band_5_4_scale_c(unsigned char *source, - unsigned int src_pitch, - unsigned char *dest, - unsigned int dest_pitch, - unsigned int dest_width) { - unsigned int i; - unsigned int a, b, c, d, e; - unsigned char *des = dest; - unsigned char *src = source; - - for (i = 0; i < dest_width; i++) { - - a = src[0 * src_pitch]; - b = src[1 * src_pitch]; - c = src[2 * src_pitch]; - d = src[3 * src_pitch]; - e = src[4 * src_pitch]; - - des[0 * dest_pitch] = (unsigned char) a; - des[1 * dest_pitch] = (unsigned char)((b * 192 + c * 64 + 128) >> 8); - des[2 * dest_pitch] = (unsigned char)((c * 128 + d * 128 + 128) >> 8); - des[3 * dest_pitch] = (unsigned char)((d * 64 + e * 192 + 128) >> 8); - - src++; - des++; - - } -} - - -/*7*************************************************************************** - * - * ROUTINE : vp8_horizontal_line_3_5_scale_c - * - * INPUTS : const unsigned char *source : Pointer to source data. - * unsigned int source_width : Stride of source. - * unsigned char *dest : Pointer to destination data. - * unsigned int dest_width : Stride of destination (NOT USED). - * - * OUTPUTS : None. - * - * RETURNS : void - * - * FUNCTION : Copies horizontal line of pixels from source to - * destination scaling up by 3 to 5. - * - * SPECIAL NOTES : None. - * - * - ****************************************************************************/ -void vp8_horizontal_line_5_3_scale_c(const unsigned char *source, - unsigned int source_width, - unsigned char *dest, - unsigned int dest_width) { - unsigned int i; - unsigned int a, b, c, d, e; - unsigned char *des = dest; - const unsigned char *src = source; - - (void) dest_width; - - for (i = 0; i < source_width; i += 5) { - a = src[0]; - b = src[1]; - c = src[2]; - d = src[3]; - e = src[4]; - - des[0] = (unsigned char) a; - des[1] = (unsigned char)((b * 85 + c * 171 + 128) >> 8); - des[2] = (unsigned char)((d * 171 + e * 85 + 128) >> 8); - - src += 5; - des += 3; - } - -} - -void vp8_vertical_band_5_3_scale_c(unsigned char *source, - unsigned int src_pitch, - unsigned char *dest, - unsigned int dest_pitch, - unsigned int dest_width) { - unsigned int i; - unsigned int a, b, c, d, e; - unsigned char *des = dest; - unsigned char *src = source; - - for (i = 0; i < dest_width; i++) { - - a = src[0 * src_pitch]; - b = src[1 * src_pitch]; - c = src[2 * src_pitch]; - d = src[3 * src_pitch]; - e = src[4 * src_pitch]; - - des[0 * dest_pitch] = (unsigned char) a; - des[1 * dest_pitch] = (unsigned char)((b * 85 + c * 171 + 128) >> 8); - des[2 * dest_pitch] = (unsigned char)((d * 171 + e * 85 + 128) >> 8); - - src++; - des++; - - } -} - -/**************************************************************************** - * - * ROUTINE : vp8_horizontal_line_1_2_scale_c - * - * INPUTS : const unsigned char *source : Pointer to source data. - * unsigned int source_width : Stride of source. - * unsigned char *dest : Pointer to destination data. - * unsigned int dest_width : Stride of destination (NOT USED). - * - * OUTPUTS : None. - * - * RETURNS : void - * - * FUNCTION : Copies horizontal line of pixels from source to - * destination scaling up by 1 to 2. - * - * SPECIAL NOTES : None. - * - ****************************************************************************/ -void vp8_horizontal_line_2_1_scale_c(const unsigned char *source, - unsigned int source_width, - unsigned char *dest, - unsigned int dest_width) { - unsigned int i; - unsigned int a; - unsigned char *des = dest; - const unsigned char *src = source; - - (void) dest_width; - - for (i = 0; i < source_width; i += 2) { - a = src[0]; - des [0] = (unsigned char)(a); - src += 2; - des += 1; - } -} - -void vp8_vertical_band_2_1_scale_c(unsigned char *source, - unsigned int src_pitch, - unsigned char *dest, - unsigned int dest_pitch, - unsigned int dest_width) { - (void) dest_pitch; - (void) src_pitch; - vpx_memcpy(dest, source, dest_width); -} - -void vp8_vertical_band_2_1_scale_i_c(unsigned char *source, - unsigned int src_pitch, - unsigned char *dest, - unsigned int dest_pitch, - unsigned int dest_width) { - int i; - int temp; - int width = dest_width; - - (void) dest_pitch; - - for (i = 0; i < width; i++) { - temp = 8; - temp += source[i - (int)src_pitch] * 3; - temp += source[i] * 10; - temp += source[i + src_pitch] * 3; - temp >>= 4; - dest[i] = (unsigned char)(temp); - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_scale/generic/vpx_scale.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_scale/generic/vpx_scale.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_scale/generic/vpx_scale.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_scale/generic/vpx_scale.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,530 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/**************************************************************************** - * - * Module Title : scale.c - * - * Description : Image scaling functions. - * - ***************************************************************************/ - -/**************************************************************************** -* Header Files -****************************************************************************/ -#include "./vpx_scale_rtcd.h" -#include "vpx_mem/vpx_mem.h" -#include "vpx_scale/yv12config.h" - -typedef struct { - int expanded_frame_width; - int expanded_frame_height; - - int HScale; - int HRatio; - int VScale; - int VRatio; - - YV12_BUFFER_CONFIG *src_yuv_config; - YV12_BUFFER_CONFIG *dst_yuv_config; - -} SCALE_VARS; - -/**************************************************************************** - * - * ROUTINE : scale1d_2t1_i - * - * INPUTS : const unsigned char *source : Pointer to data to be scaled. - * int source_step : Number of pixels to step on in source. - * unsigned int source_scale : Scale for source (UNUSED). - * unsigned int source_length : Length of source (UNUSED). - * unsigned char *dest : Pointer to output data array. - * int dest_step : Number of pixels to step on in destination. - * unsigned int dest_scale : Scale for destination (UNUSED). - * unsigned int dest_length : Length of destination. - * - * OUTPUTS : None. - * - * RETURNS : void - * - * FUNCTION : Performs 2-to-1 interpolated scaling. - * - * SPECIAL NOTES : None. - * - ****************************************************************************/ -static -void scale1d_2t1_i -( - const unsigned char *source, - int source_step, - unsigned int source_scale, - unsigned int source_length, - unsigned char *dest, - int dest_step, - unsigned int dest_scale, - unsigned int dest_length -) { - unsigned int i, j; - unsigned int temp; - int source_pitch = source_step; - (void) source_length; - (void) source_scale; - (void) dest_scale; - - source_step *= 2; - dest[0] = source[0]; - - for (i = dest_step, j = source_step; i < dest_length * dest_step; i += dest_step, j += source_step) { - temp = 8; - temp += 3 * source[j - source_pitch]; - temp += 10 * source[j]; - temp += 3 * source[j + source_pitch]; - temp >>= 4; - dest[i] = (char)(temp); - } -} - -/**************************************************************************** - * - * ROUTINE : scale1d_2t1_ps - * - * INPUTS : const unsigned char *source : Pointer to data to be scaled. - * int source_step : Number of pixels to step on in source. - * unsigned int source_scale : Scale for source (UNUSED). - * unsigned int source_length : Length of source (UNUSED). - * unsigned char *dest : Pointer to output data array. - * int dest_step : Number of pixels to step on in destination. - * unsigned int dest_scale : Scale for destination (UNUSED). - * unsigned int dest_length : Length of destination. - * - * OUTPUTS : None. - * - * RETURNS : void - * - * FUNCTION : Performs 2-to-1 point subsampled scaling. - * - * SPECIAL NOTES : None. - * - ****************************************************************************/ -static -void scale1d_2t1_ps -( - const unsigned char *source, - int source_step, - unsigned int source_scale, - unsigned int source_length, - unsigned char *dest, - int dest_step, - unsigned int dest_scale, - unsigned int dest_length -) { - unsigned int i, j; - - (void) source_length; - (void) source_scale; - (void) dest_scale; - - source_step *= 2; - j = 0; - - for (i = 0; i < dest_length * dest_step; i += dest_step, j += source_step) - dest[i] = source[j]; -} -/**************************************************************************** - * - * ROUTINE : scale1d_c - * - * INPUTS : const unsigned char *source : Pointer to data to be scaled. - * int source_step : Number of pixels to step on in source. - * unsigned int source_scale : Scale for source. - * unsigned int source_length : Length of source (UNUSED). - * unsigned char *dest : Pointer to output data array. - * int dest_step : Number of pixels to step on in destination. - * unsigned int dest_scale : Scale for destination. - * unsigned int dest_length : Length of destination. - * - * OUTPUTS : None. - * - * RETURNS : void - * - * FUNCTION : Performs linear interpolation in one dimension. - * - * SPECIAL NOTES : None. - * - ****************************************************************************/ -static -void scale1d_c -( - const unsigned char *source, - int source_step, - unsigned int source_scale, - unsigned int source_length, - unsigned char *dest, - int dest_step, - unsigned int dest_scale, - unsigned int dest_length -) { - unsigned int i; - unsigned int round_value = dest_scale / 2; - unsigned int left_modifier = dest_scale; - unsigned int right_modifier = 0; - unsigned char left_pixel = *source; - unsigned char right_pixel = *(source + source_step); - - (void) source_length; - - /* These asserts are needed if there are boundary issues... */ - /*assert ( dest_scale > source_scale );*/ - /*assert ( (source_length-1) * dest_scale >= (dest_length-1) * source_scale );*/ - - for (i = 0; i < dest_length * dest_step; i += dest_step) { - dest[i] = (char)((left_modifier * left_pixel + right_modifier * right_pixel + round_value) / dest_scale); - - right_modifier += source_scale; - - while (right_modifier > dest_scale) { - right_modifier -= dest_scale; - source += source_step; - left_pixel = *source; - right_pixel = *(source + source_step); - } - - left_modifier = dest_scale - right_modifier; - } -} - -/**************************************************************************** - * - * ROUTINE : Scale2D - * - * INPUTS : const unsigned char *source : Pointer to data to be scaled. - * int source_pitch : Stride of source image. - * unsigned int source_width : Width of input image. - * unsigned int source_height : Height of input image. - * unsigned char *dest : Pointer to output data array. - * int dest_pitch : Stride of destination image. - * unsigned int dest_width : Width of destination image. - * unsigned int dest_height : Height of destination image. - * unsigned char *temp_area : Pointer to temp work area. - * unsigned char temp_area_height : Height of temp work area. - * unsigned int hscale : Horizontal scale factor numerator. - * unsigned int hratio : Horizontal scale factor denominator. - * unsigned int vscale : Vertical scale factor numerator. - * unsigned int vratio : Vertical scale factor denominator. - * unsigned int interlaced : Interlace flag. - * - * OUTPUTS : None. - * - * RETURNS : void - * - * FUNCTION : Performs 2-tap linear interpolation in two dimensions. - * - * SPECIAL NOTES : Expansion is performed one band at a time to help with - * caching. - * - ****************************************************************************/ -static -void Scale2D -( - /*const*/ - unsigned char *source, - int source_pitch, - unsigned int source_width, - unsigned int source_height, - unsigned char *dest, - int dest_pitch, - unsigned int dest_width, - unsigned int dest_height, - unsigned char *temp_area, - unsigned char temp_area_height, - unsigned int hscale, - unsigned int hratio, - unsigned int vscale, - unsigned int vratio, - unsigned int interlaced -) { - /*unsigned*/ - int i, j, k; - int bands; - int dest_band_height; - int source_band_height; - - typedef void (*Scale1D)(const unsigned char * source, int source_step, unsigned int source_scale, unsigned int source_length, - unsigned char * dest, int dest_step, unsigned int dest_scale, unsigned int dest_length); - - Scale1D Scale1Dv = scale1d_c; - Scale1D Scale1Dh = scale1d_c; - - void (*horiz_line_scale)(const unsigned char *, unsigned int, unsigned char *, unsigned int) = NULL; - void (*vert_band_scale)(unsigned char *, unsigned int, unsigned char *, unsigned int, unsigned int) = NULL; - - int ratio_scalable = 1; - int interpolation = 0; - - unsigned char *source_base; /* = (unsigned char *) ((source_pitch >= 0) ? source : (source + ((source_height-1) * source_pitch))); */ - unsigned char *line_src; - - - source_base = (unsigned char *)source; - - if (source_pitch < 0) { - int offset; - - offset = (source_height - 1); - offset *= source_pitch; - - source_base += offset; - } - - /* find out the ratio for each direction */ - switch (hratio * 10 / hscale) { - case 8: - /* 4-5 Scale in Width direction */ - horiz_line_scale = vp8_horizontal_line_5_4_scale; - break; - case 6: - /* 3-5 Scale in Width direction */ - horiz_line_scale = vp8_horizontal_line_5_3_scale; - break; - case 5: - /* 1-2 Scale in Width direction */ - horiz_line_scale = vp8_horizontal_line_2_1_scale; - break; - default: - /* The ratio is not acceptable now */ - /* throw("The ratio is not acceptable for now!"); */ - ratio_scalable = 0; - break; - } - - switch (vratio * 10 / vscale) { - case 8: - /* 4-5 Scale in vertical direction */ - vert_band_scale = vp8_vertical_band_5_4_scale; - source_band_height = 5; - dest_band_height = 4; - break; - case 6: - /* 3-5 Scale in vertical direction */ - vert_band_scale = vp8_vertical_band_5_3_scale; - source_band_height = 5; - dest_band_height = 3; - break; - case 5: - /* 1-2 Scale in vertical direction */ - - if (interlaced) { - /* if the content is interlaced, point sampling is used */ - vert_band_scale = vp8_vertical_band_2_1_scale; - } else { - - interpolation = 1; - /* if the content is progressive, interplo */ - vert_band_scale = vp8_vertical_band_2_1_scale_i; - - } - - source_band_height = 2; - dest_band_height = 1; - break; - default: - /* The ratio is not acceptable now */ - /* throw("The ratio is not acceptable for now!"); */ - ratio_scalable = 0; - break; - } - - if (ratio_scalable) { - if (source_height == dest_height) { - /* for each band of the image */ - for (k = 0; k < (int)dest_height; k++) { - horiz_line_scale(source, source_width, dest, dest_width); - source += source_pitch; - dest += dest_pitch; - } - - return; - } - - if (interpolation) { - if (source < source_base) - source = source_base; - - horiz_line_scale(source, source_width, temp_area, dest_width); - } - - for (k = 0; k < (int)(dest_height + dest_band_height - 1) / dest_band_height; k++) { - /* scale one band horizontally */ - for (i = 0; i < source_band_height; i++) { - /* Trap case where we could read off the base of the source buffer */ - - line_src = (unsigned char *)source + i * source_pitch; - - if (line_src < source_base) - line_src = source_base; - - horiz_line_scale(line_src, source_width, - temp_area + (i + 1)*dest_pitch, dest_width); - } - - /* Vertical scaling is in place */ - vert_band_scale(temp_area + dest_pitch, dest_pitch, dest, dest_pitch, dest_width); - - if (interpolation) - vpx_memcpy(temp_area, temp_area + source_band_height * dest_pitch, dest_width); - - /* Next band... */ - source += (unsigned long) source_band_height * source_pitch; - dest += (unsigned long) dest_band_height * dest_pitch; - } - - return; - } - - if (hscale == 2 && hratio == 1) - Scale1Dh = scale1d_2t1_ps; - - if (vscale == 2 && vratio == 1) { - if (interlaced) - Scale1Dv = scale1d_2t1_ps; - else - Scale1Dv = scale1d_2t1_i; - } - - if (source_height == dest_height) { - /* for each band of the image */ - for (k = 0; k < (int)dest_height; k++) { - Scale1Dh(source, 1, hscale, source_width + 1, dest, 1, hratio, dest_width); - source += source_pitch; - dest += dest_pitch; - } - - return; - } - - if (dest_height > source_height) { - dest_band_height = temp_area_height - 1; - source_band_height = dest_band_height * source_height / dest_height; - } else { - source_band_height = temp_area_height - 1; - dest_band_height = source_band_height * vratio / vscale; - } - - /* first row needs to be done so that we can stay one row ahead for vertical zoom */ - Scale1Dh(source, 1, hscale, source_width + 1, temp_area, 1, hratio, dest_width); - - /* for each band of the image */ - bands = (dest_height + dest_band_height - 1) / dest_band_height; - - for (k = 0; k < bands; k++) { - /* scale one band horizontally */ - for (i = 1; i < source_band_height + 1; i++) { - if (k * source_band_height + i < (int) source_height) { - Scale1Dh(source + i * source_pitch, 1, hscale, source_width + 1, - temp_area + i * dest_pitch, 1, hratio, dest_width); - } else { /* Duplicate the last row */ - /* copy temp_area row 0 over from last row in the past */ - vpx_memcpy(temp_area + i * dest_pitch, temp_area + (i - 1)*dest_pitch, dest_pitch); - } - } - - /* scale one band vertically */ - for (j = 0; j < (int)dest_width; j++) { - Scale1Dv(&temp_area[j], dest_pitch, vscale, source_band_height + 1, - &dest[j], dest_pitch, vratio, dest_band_height); - } - - /* copy temp_area row 0 over from last row in the past */ - vpx_memcpy(temp_area, temp_area + source_band_height * dest_pitch, dest_pitch); - - /* move to the next band */ - source += source_band_height * source_pitch; - dest += dest_band_height * dest_pitch; - } -} - -/**************************************************************************** - * - * ROUTINE : vpx_scale_frame - * - * INPUTS : YV12_BUFFER_CONFIG *src : Pointer to frame to be scaled. - * YV12_BUFFER_CONFIG *dst : Pointer to buffer to hold scaled frame. - * unsigned char *temp_area : Pointer to temp work area. - * unsigned char temp_area_height : Height of temp work area. - * unsigned int hscale : Horizontal scale factor numerator. - * unsigned int hratio : Horizontal scale factor denominator. - * unsigned int vscale : Vertical scale factor numerator. - * unsigned int vratio : Vertical scale factor denominator. - * unsigned int interlaced : Interlace flag. - * - * OUTPUTS : None. - * - * RETURNS : void - * - * FUNCTION : Performs 2-tap linear interpolation in two dimensions. - * - * SPECIAL NOTES : Expansion is performed one band at a time to help with - * caching. - * - ****************************************************************************/ -void vpx_scale_frame -( - YV12_BUFFER_CONFIG *src, - YV12_BUFFER_CONFIG *dst, - unsigned char *temp_area, - unsigned char temp_height, - unsigned int hscale, - unsigned int hratio, - unsigned int vscale, - unsigned int vratio, - unsigned int interlaced -) { - int i; - int dw = (hscale - 1 + src->y_width * hratio) / hscale; - int dh = (vscale - 1 + src->y_height * vratio) / vscale; - - /* call our internal scaling routines!! */ - Scale2D((unsigned char *) src->y_buffer, src->y_stride, src->y_width, src->y_height, - (unsigned char *) dst->y_buffer, dst->y_stride, dw, dh, - temp_area, temp_height, hscale, hratio, vscale, vratio, interlaced); - - if (dw < (int)dst->y_width) - for (i = 0; i < dh; i++) - vpx_memset(dst->y_buffer + i * dst->y_stride + dw - 1, dst->y_buffer[i * dst->y_stride + dw - 2], dst->y_width - dw + 1); - - if (dh < (int)dst->y_height) - for (i = dh - 1; i < (int)dst->y_height; i++) - vpx_memcpy(dst->y_buffer + i * dst->y_stride, dst->y_buffer + (dh - 2) * dst->y_stride, dst->y_width + 1); - - Scale2D((unsigned char *) src->u_buffer, src->uv_stride, src->uv_width, src->uv_height, - (unsigned char *) dst->u_buffer, dst->uv_stride, dw / 2, dh / 2, - temp_area, temp_height, hscale, hratio, vscale, vratio, interlaced); - - if (dw / 2 < (int)dst->uv_width) - for (i = 0; i < dst->uv_height; i++) - vpx_memset(dst->u_buffer + i * dst->uv_stride + dw / 2 - 1, dst->u_buffer[i * dst->uv_stride + dw / 2 - 2], dst->uv_width - dw / 2 + 1); - - if (dh / 2 < (int)dst->uv_height) - for (i = dh / 2 - 1; i < (int)dst->y_height / 2; i++) - vpx_memcpy(dst->u_buffer + i * dst->uv_stride, dst->u_buffer + (dh / 2 - 2)*dst->uv_stride, dst->uv_width); - - Scale2D((unsigned char *) src->v_buffer, src->uv_stride, src->uv_width, src->uv_height, - (unsigned char *) dst->v_buffer, dst->uv_stride, dw / 2, dh / 2, - temp_area, temp_height, hscale, hratio, vscale, vratio, interlaced); - - if (dw / 2 < (int)dst->uv_width) - for (i = 0; i < dst->uv_height; i++) - vpx_memset(dst->v_buffer + i * dst->uv_stride + dw / 2 - 1, dst->v_buffer[i * dst->uv_stride + dw / 2 - 2], dst->uv_width - dw / 2 + 1); - - if (dh / 2 < (int) dst->uv_height) - for (i = dh / 2 - 1; i < (int)dst->y_height / 2; i++) - vpx_memcpy(dst->v_buffer + i * dst->uv_stride, dst->v_buffer + (dh / 2 - 2)*dst->uv_stride, dst->uv_width); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_scale/generic/yv12config.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_scale/generic/yv12config.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_scale/generic/yv12config.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_scale/generic/yv12config.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,305 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "vpx_scale/yv12config.h" -#include "vpx_mem/vpx_mem.h" -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH -#include "vp9/common/vp9_common.h" -#endif - -/**************************************************************************** -* Exports -****************************************************************************/ - -/**************************************************************************** - * - ****************************************************************************/ -#define yv12_align_addr(addr, align) \ - (void*)(((size_t)(addr) + ((align) - 1)) & (size_t)-(align)) - -int -vp8_yv12_de_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf) { - if (ybf) { - // If libvpx is using frame buffer callbacks then buffer_alloc_sz must - // not be set. - if (ybf->buffer_alloc_sz > 0) { - vpx_free(ybf->buffer_alloc); - } - - /* buffer_alloc isn't accessed by most functions. Rather y_buffer, - u_buffer and v_buffer point to buffer_alloc and are used. Clear out - all of this so that a freed pointer isn't inadvertently used */ - vpx_memset(ybf, 0, sizeof(YV12_BUFFER_CONFIG)); - } else { - return -1; - } - - return 0; -} - -int vp8_yv12_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, - int width, int height, int border) { - if (ybf) { - int aligned_width = (width + 15) & ~15; - int aligned_height = (height + 15) & ~15; - int y_stride = ((aligned_width + 2 * border) + 31) & ~31; - int yplane_size = (aligned_height + 2 * border) * y_stride; - int uv_width = aligned_width >> 1; - int uv_height = aligned_height >> 1; - /** There is currently a bunch of code which assumes - * uv_stride == y_stride/2, so enforce this here. */ - int uv_stride = y_stride >> 1; - int uvplane_size = (uv_height + border) * uv_stride; - const int frame_size = yplane_size + 2 * uvplane_size; - - if (!ybf->buffer_alloc) { - ybf->buffer_alloc = (uint8_t *)vpx_memalign(32, frame_size); - ybf->buffer_alloc_sz = frame_size; - } - - if (!ybf->buffer_alloc || ybf->buffer_alloc_sz < frame_size) - return -1; - - /* Only support allocating buffers that have a border that's a multiple - * of 32. The border restriction is required to get 16-byte alignment of - * the start of the chroma rows without introducing an arbitrary gap - * between planes, which would break the semantics of things like - * vpx_img_set_rect(). */ - if (border & 0x1f) - return -3; - - ybf->y_crop_width = width; - ybf->y_crop_height = height; - ybf->y_width = aligned_width; - ybf->y_height = aligned_height; - ybf->y_stride = y_stride; - - ybf->uv_crop_width = (width + 1) / 2; - ybf->uv_crop_height = (height + 1) / 2; - ybf->uv_width = uv_width; - ybf->uv_height = uv_height; - ybf->uv_stride = uv_stride; - - ybf->alpha_width = 0; - ybf->alpha_height = 0; - ybf->alpha_stride = 0; - - ybf->border = border; - ybf->frame_size = frame_size; - - ybf->y_buffer = ybf->buffer_alloc + (border * y_stride) + border; - ybf->u_buffer = ybf->buffer_alloc + yplane_size + (border / 2 * uv_stride) + border / 2; - ybf->v_buffer = ybf->buffer_alloc + yplane_size + uvplane_size + (border / 2 * uv_stride) + border / 2; - ybf->alpha_buffer = NULL; - - ybf->corrupted = 0; /* assume not currupted by errors */ - return 0; - } - return -2; -} - -int vp8_yv12_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, - int width, int height, int border) { - if (ybf) { - vp8_yv12_de_alloc_frame_buffer(ybf); - return vp8_yv12_realloc_frame_buffer(ybf, width, height, border); - } - return -2; -} - -#if CONFIG_VP9 -// TODO(jkoleszar): Maybe replace this with struct vpx_image - -int vp9_free_frame_buffer(YV12_BUFFER_CONFIG *ybf) { - if (ybf) { - if (ybf->buffer_alloc_sz > 0) { - vpx_free(ybf->buffer_alloc); - } - - /* buffer_alloc isn't accessed by most functions. Rather y_buffer, - u_buffer and v_buffer point to buffer_alloc and are used. Clear out - all of this so that a freed pointer isn't inadvertently used */ - vpx_memset(ybf, 0, sizeof(YV12_BUFFER_CONFIG)); - } else { - return -1; - } - - return 0; -} - -int vp9_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, - int width, int height, - int ss_x, int ss_y, -#if CONFIG_VP9_HIGHBITDEPTH - int use_highbitdepth, -#endif - int border, - int byte_alignment, - vpx_codec_frame_buffer_t *fb, - vpx_get_frame_buffer_cb_fn_t cb, - void *cb_priv) { - if (ybf) { - const int vp9_byte_align = (byte_alignment == 0) ? 1 : byte_alignment; - const int aligned_width = (width + 7) & ~7; - const int aligned_height = (height + 7) & ~7; - const int y_stride = ((aligned_width + 2 * border) + 31) & ~31; - const uint64_t yplane_size = (aligned_height + 2 * border) * - (uint64_t)y_stride + byte_alignment; - const int uv_width = aligned_width >> ss_x; - const int uv_height = aligned_height >> ss_y; - const int uv_stride = y_stride >> ss_x; - const int uv_border_w = border >> ss_x; - const int uv_border_h = border >> ss_y; - const uint64_t uvplane_size = (uv_height + 2 * uv_border_h) * - (uint64_t)uv_stride + byte_alignment; - -#if CONFIG_ALPHA - const int alpha_width = aligned_width; - const int alpha_height = aligned_height; - const int alpha_stride = y_stride; - const int alpha_border_w = border; - const int alpha_border_h = border; - const uint64_t alpha_plane_size = (alpha_height + 2 * alpha_border_h) * - (uint64_t)alpha_stride + byte_alignment; -#if CONFIG_VP9_HIGHBITDEPTH - const uint64_t frame_size = (1 + use_highbitdepth) * - (yplane_size + 2 * uvplane_size + alpha_plane_size); -#else - const uint64_t frame_size = yplane_size + 2 * uvplane_size + - alpha_plane_size; -#endif // CONFIG_VP9_HIGHBITDEPTH -#else -#if CONFIG_VP9_HIGHBITDEPTH - const uint64_t frame_size = - (1 + use_highbitdepth) * (yplane_size + 2 * uvplane_size); -#else - const uint64_t frame_size = yplane_size + 2 * uvplane_size; -#endif // CONFIG_VP9_HIGHBITDEPTH -#endif // CONFIG_ALPHA - - uint8_t *buf = NULL; - - if (cb != NULL) { - const int align_addr_extra_size = 31; - const uint64_t external_frame_size = frame_size + align_addr_extra_size; - - assert(fb != NULL); - - if (external_frame_size != (size_t)external_frame_size) - return -1; - - // Allocation to hold larger frame, or first allocation. - if (cb(cb_priv, (size_t)external_frame_size, fb) < 0) - return -1; - - if (fb->data == NULL || fb->size < external_frame_size) - return -1; - - ybf->buffer_alloc = (uint8_t *)yv12_align_addr(fb->data, 32); - } else if (frame_size > (size_t)ybf->buffer_alloc_sz) { - // Allocation to hold larger frame, or first allocation. - vpx_free(ybf->buffer_alloc); - ybf->buffer_alloc = NULL; - - if (frame_size != (size_t)frame_size) - return -1; - - ybf->buffer_alloc = (uint8_t *)vpx_memalign(32, (size_t)frame_size); - if (!ybf->buffer_alloc) - return -1; - - ybf->buffer_alloc_sz = (int)frame_size; - - // This memset is needed for fixing valgrind error from C loop filter - // due to access uninitialized memory in frame border. It could be - // removed if border is totally removed. - vpx_memset(ybf->buffer_alloc, 0, ybf->buffer_alloc_sz); - } - - /* Only support allocating buffers that have a border that's a multiple - * of 32. The border restriction is required to get 16-byte alignment of - * the start of the chroma rows without introducing an arbitrary gap - * between planes, which would break the semantics of things like - * vpx_img_set_rect(). */ - if (border & 0x1f) - return -3; - - ybf->y_crop_width = width; - ybf->y_crop_height = height; - ybf->y_width = aligned_width; - ybf->y_height = aligned_height; - ybf->y_stride = y_stride; - - ybf->uv_crop_width = (width + ss_x) >> ss_x; - ybf->uv_crop_height = (height + ss_y) >> ss_y; - ybf->uv_width = uv_width; - ybf->uv_height = uv_height; - ybf->uv_stride = uv_stride; - - ybf->border = border; - ybf->frame_size = (int)frame_size; - ybf->subsampling_x = ss_x; - ybf->subsampling_y = ss_y; - - buf = ybf->buffer_alloc; -#if CONFIG_VP9_HIGHBITDEPTH - if (use_highbitdepth) { - // Store uint16 addresses when using 16bit framebuffers - buf = CONVERT_TO_BYTEPTR(ybf->buffer_alloc); - ybf->flags = YV12_FLAG_HIGHBITDEPTH; - } else { - ybf->flags = 0; - } -#endif // CONFIG_VP9_HIGHBITDEPTH - - ybf->y_buffer = (uint8_t *)yv12_align_addr( - buf + (border * y_stride) + border, vp9_byte_align); - ybf->u_buffer = (uint8_t *)yv12_align_addr( - buf + yplane_size + (uv_border_h * uv_stride) + uv_border_w, - vp9_byte_align); - ybf->v_buffer = (uint8_t *)yv12_align_addr( - buf + yplane_size + uvplane_size + (uv_border_h * uv_stride) + - uv_border_w, vp9_byte_align); - -#if CONFIG_ALPHA - ybf->alpha_width = alpha_width; - ybf->alpha_height = alpha_height; - ybf->alpha_stride = alpha_stride; - ybf->alpha_buffer = (uint8_t *)yv12_align_addr( - buf + yplane_size + 2 * uvplane_size + - (alpha_border_h * alpha_stride) + alpha_border_w, vp9_byte_align); -#endif - ybf->corrupted = 0; /* assume not corrupted by errors */ - return 0; - } - return -2; -} - -int vp9_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, - int width, int height, - int ss_x, int ss_y, -#if CONFIG_VP9_HIGHBITDEPTH - int use_highbitdepth, -#endif - int border, - int byte_alignment) { - if (ybf) { - vp9_free_frame_buffer(ybf); - return vp9_realloc_frame_buffer(ybf, width, height, ss_x, ss_y, -#if CONFIG_VP9_HIGHBITDEPTH - use_highbitdepth, -#endif - border, byte_alignment, NULL, NULL, NULL); - } - return -2; -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_scale/generic/yv12extend.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_scale/generic/yv12extend.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_scale/generic/yv12extend.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_scale/generic/yv12extend.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,322 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "./vpx_config.h" -#include "vpx/vpx_integer.h" -#include "vpx_mem/vpx_mem.h" -#include "vpx_scale/yv12config.h" -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH -#include "vp9/common/vp9_common.h" -#endif - -static void extend_plane(uint8_t *const src, int src_stride, - int width, int height, - int extend_top, int extend_left, - int extend_bottom, int extend_right) { - int i; - const int linesize = extend_left + extend_right + width; - - /* copy the left and right most columns out */ - uint8_t *src_ptr1 = src; - uint8_t *src_ptr2 = src + width - 1; - uint8_t *dst_ptr1 = src - extend_left; - uint8_t *dst_ptr2 = src + width; - - for (i = 0; i < height; ++i) { - vpx_memset(dst_ptr1, src_ptr1[0], extend_left); - vpx_memset(dst_ptr2, src_ptr2[0], extend_right); - src_ptr1 += src_stride; - src_ptr2 += src_stride; - dst_ptr1 += src_stride; - dst_ptr2 += src_stride; - } - - /* Now copy the top and bottom lines into each line of the respective - * borders - */ - src_ptr1 = src - extend_left; - src_ptr2 = src + src_stride * (height - 1) - extend_left; - dst_ptr1 = src + src_stride * -extend_top - extend_left; - dst_ptr2 = src + src_stride * height - extend_left; - - for (i = 0; i < extend_top; ++i) { - vpx_memcpy(dst_ptr1, src_ptr1, linesize); - dst_ptr1 += src_stride; - } - - for (i = 0; i < extend_bottom; ++i) { - vpx_memcpy(dst_ptr2, src_ptr2, linesize); - dst_ptr2 += src_stride; - } -} - -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH -static void extend_plane_high(uint8_t *const src8, int src_stride, - int width, int height, - int extend_top, int extend_left, - int extend_bottom, int extend_right) { - int i; - const int linesize = extend_left + extend_right + width; - uint16_t *src = CONVERT_TO_SHORTPTR(src8); - - /* copy the left and right most columns out */ - uint16_t *src_ptr1 = src; - uint16_t *src_ptr2 = src + width - 1; - uint16_t *dst_ptr1 = src - extend_left; - uint16_t *dst_ptr2 = src + width; - - for (i = 0; i < height; ++i) { - vpx_memset16(dst_ptr1, src_ptr1[0], extend_left); - vpx_memset16(dst_ptr2, src_ptr2[0], extend_right); - src_ptr1 += src_stride; - src_ptr2 += src_stride; - dst_ptr1 += src_stride; - dst_ptr2 += src_stride; - } - - /* Now copy the top and bottom lines into each line of the respective - * borders - */ - src_ptr1 = src - extend_left; - src_ptr2 = src + src_stride * (height - 1) - extend_left; - dst_ptr1 = src + src_stride * -extend_top - extend_left; - dst_ptr2 = src + src_stride * height - extend_left; - - for (i = 0; i < extend_top; ++i) { - vpx_memcpy(dst_ptr1, src_ptr1, linesize * sizeof(uint16_t)); - dst_ptr1 += src_stride; - } - - for (i = 0; i < extend_bottom; ++i) { - vpx_memcpy(dst_ptr2, src_ptr2, linesize * sizeof(uint16_t)); - dst_ptr2 += src_stride; - } -} -#endif - -void vp8_yv12_extend_frame_borders_c(YV12_BUFFER_CONFIG *ybf) { - const int uv_border = ybf->border / 2; - - assert(ybf->border % 2 == 0); - assert(ybf->y_height - ybf->y_crop_height < 16); - assert(ybf->y_width - ybf->y_crop_width < 16); - assert(ybf->y_height - ybf->y_crop_height >= 0); - assert(ybf->y_width - ybf->y_crop_width >= 0); - -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - if (ybf->flags & YV12_FLAG_HIGHBITDEPTH) { - extend_plane_high( - ybf->y_buffer, ybf->y_stride, - ybf->y_crop_width, ybf->y_crop_height, - ybf->border, ybf->border, - ybf->border + ybf->y_height - ybf->y_crop_height, - ybf->border + ybf->y_width - ybf->y_crop_width); - - extend_plane_high( - ybf->u_buffer, ybf->uv_stride, - ybf->uv_crop_width, ybf->uv_crop_height, - uv_border, uv_border, - uv_border + ybf->uv_height - ybf->uv_crop_height, - uv_border + ybf->uv_width - ybf->uv_crop_width); - - extend_plane_high( - ybf->v_buffer, ybf->uv_stride, - ybf->uv_crop_width, ybf->uv_crop_height, - uv_border, uv_border, - uv_border + ybf->uv_height - ybf->uv_crop_height, - uv_border + ybf->uv_width - ybf->uv_crop_width); - return; - } -#endif - extend_plane(ybf->y_buffer, ybf->y_stride, - ybf->y_crop_width, ybf->y_crop_height, - ybf->border, ybf->border, - ybf->border + ybf->y_height - ybf->y_crop_height, - ybf->border + ybf->y_width - ybf->y_crop_width); - - extend_plane(ybf->u_buffer, ybf->uv_stride, - ybf->uv_crop_width, ybf->uv_crop_height, - uv_border, uv_border, - uv_border + ybf->uv_height - ybf->uv_crop_height, - uv_border + ybf->uv_width - ybf->uv_crop_width); - - extend_plane(ybf->v_buffer, ybf->uv_stride, - ybf->uv_crop_width, ybf->uv_crop_height, - uv_border, uv_border, - uv_border + ybf->uv_height - ybf->uv_crop_height, - uv_border + ybf->uv_width - ybf->uv_crop_width); -} - -#if CONFIG_VP9 -static void extend_frame(YV12_BUFFER_CONFIG *const ybf, int ext_size) { - const int c_w = ybf->uv_crop_width; - const int c_h = ybf->uv_crop_height; - const int ss_x = ybf->uv_width < ybf->y_width; - const int ss_y = ybf->uv_height < ybf->y_height; - const int c_et = ext_size >> ss_y; - const int c_el = ext_size >> ss_x; - const int c_eb = c_et + ybf->uv_height - ybf->uv_crop_height; - const int c_er = c_el + ybf->uv_width - ybf->uv_crop_width; - - assert(ybf->y_height - ybf->y_crop_height < 16); - assert(ybf->y_width - ybf->y_crop_width < 16); - assert(ybf->y_height - ybf->y_crop_height >= 0); - assert(ybf->y_width - ybf->y_crop_width >= 0); - -#if CONFIG_VP9_HIGHBITDEPTH - if (ybf->flags & YV12_FLAG_HIGHBITDEPTH) { - extend_plane_high(ybf->y_buffer, ybf->y_stride, - ybf->y_crop_width, ybf->y_crop_height, - ext_size, ext_size, - ext_size + ybf->y_height - ybf->y_crop_height, - ext_size + ybf->y_width - ybf->y_crop_width); - extend_plane_high(ybf->u_buffer, ybf->uv_stride, - c_w, c_h, c_et, c_el, c_eb, c_er); - extend_plane_high(ybf->v_buffer, ybf->uv_stride, - c_w, c_h, c_et, c_el, c_eb, c_er); - return; - } -#endif - extend_plane(ybf->y_buffer, ybf->y_stride, - ybf->y_crop_width, ybf->y_crop_height, - ext_size, ext_size, - ext_size + ybf->y_height - ybf->y_crop_height, - ext_size + ybf->y_width - ybf->y_crop_width); - - extend_plane(ybf->u_buffer, ybf->uv_stride, - c_w, c_h, c_et, c_el, c_eb, c_er); - - extend_plane(ybf->v_buffer, ybf->uv_stride, - c_w, c_h, c_et, c_el, c_eb, c_er); -} - -void vp9_extend_frame_borders_c(YV12_BUFFER_CONFIG *ybf) { - extend_frame(ybf, ybf->border); -} - -void vp9_extend_frame_inner_borders_c(YV12_BUFFER_CONFIG *ybf) { - const int inner_bw = (ybf->border > VP9INNERBORDERINPIXELS) ? - VP9INNERBORDERINPIXELS : ybf->border; - extend_frame(ybf, inner_bw); -} - -#if CONFIG_VP9_HIGHBITDEPTH -void memcpy_short_addr(uint8_t *dst8, const uint8_t *src8, int num) { - uint16_t *dst = CONVERT_TO_SHORTPTR(dst8); - uint16_t *src = CONVERT_TO_SHORTPTR(src8); - vpx_memcpy(dst, src, num * sizeof(uint16_t)); -} -#endif // CONFIG_VP9_HIGHBITDEPTH -#endif // CONFIG_VP9 - -// Copies the source image into the destination image and updates the -// destination's UMV borders. -// Note: The frames are assumed to be identical in size. -void vp8_yv12_copy_frame_c(const YV12_BUFFER_CONFIG *src_ybc, - YV12_BUFFER_CONFIG *dst_ybc) { - int row; - const uint8_t *src = src_ybc->y_buffer; - uint8_t *dst = dst_ybc->y_buffer; - -#if 0 - /* These assertions are valid in the codec, but the libvpx-tester uses - * this code slightly differently. - */ - assert(src_ybc->y_width == dst_ybc->y_width); - assert(src_ybc->y_height == dst_ybc->y_height); -#endif - -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - if (src_ybc->flags & YV12_FLAG_HIGHBITDEPTH) { - assert(dst_ybc->flags & YV12_FLAG_HIGHBITDEPTH); - for (row = 0; row < src_ybc->y_height; ++row) { - memcpy_short_addr(dst, src, src_ybc->y_width); - src += src_ybc->y_stride; - dst += dst_ybc->y_stride; - } - - src = src_ybc->u_buffer; - dst = dst_ybc->u_buffer; - - for (row = 0; row < src_ybc->uv_height; ++row) { - memcpy_short_addr(dst, src, src_ybc->uv_width); - src += src_ybc->uv_stride; - dst += dst_ybc->uv_stride; - } - - src = src_ybc->v_buffer; - dst = dst_ybc->v_buffer; - - for (row = 0; row < src_ybc->uv_height; ++row) { - memcpy_short_addr(dst, src, src_ybc->uv_width); - src += src_ybc->uv_stride; - dst += dst_ybc->uv_stride; - } - - vp8_yv12_extend_frame_borders_c(dst_ybc); - return; - } else { - assert(!(dst_ybc->flags & YV12_FLAG_HIGHBITDEPTH)); - } -#endif - - for (row = 0; row < src_ybc->y_height; ++row) { - vpx_memcpy(dst, src, src_ybc->y_width); - src += src_ybc->y_stride; - dst += dst_ybc->y_stride; - } - - src = src_ybc->u_buffer; - dst = dst_ybc->u_buffer; - - for (row = 0; row < src_ybc->uv_height; ++row) { - vpx_memcpy(dst, src, src_ybc->uv_width); - src += src_ybc->uv_stride; - dst += dst_ybc->uv_stride; - } - - src = src_ybc->v_buffer; - dst = dst_ybc->v_buffer; - - for (row = 0; row < src_ybc->uv_height; ++row) { - vpx_memcpy(dst, src, src_ybc->uv_width); - src += src_ybc->uv_stride; - dst += dst_ybc->uv_stride; - } - - vp8_yv12_extend_frame_borders_c(dst_ybc); -} - -void vpx_yv12_copy_y_c(const YV12_BUFFER_CONFIG *src_ybc, - YV12_BUFFER_CONFIG *dst_ybc) { - int row; - const uint8_t *src = src_ybc->y_buffer; - uint8_t *dst = dst_ybc->y_buffer; - -#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH - if (src_ybc->flags & YV12_FLAG_HIGHBITDEPTH) { - const uint16_t *src16 = CONVERT_TO_SHORTPTR(src); - uint16_t *dst16 = CONVERT_TO_SHORTPTR(dst); - for (row = 0; row < src_ybc->y_height; ++row) { - vpx_memcpy(dst16, src16, src_ybc->y_width * sizeof(uint16_t)); - src16 += src_ybc->y_stride; - dst16 += dst_ybc->y_stride; - } - return; - } -#endif - - for (row = 0; row < src_ybc->y_height; ++row) { - vpx_memcpy(dst, src, src_ybc->y_width); - src += src_ybc->y_stride; - dst += dst_ybc->y_stride; - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_scale/mips/dspr2/yv12extend_dspr2.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_scale/mips/dspr2/yv12extend_dspr2.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_scale/mips/dspr2/yv12extend_dspr2.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_scale/mips/dspr2/yv12extend_dspr2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,144 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "./vpx_config.h" -#include "vpx_scale/yv12config.h" -#include "vpx_mem/vpx_mem.h" -#include "vpx_scale/vpx_scale.h" - -#if HAVE_DSPR2 -static void extend_plane(uint8_t *const src, int src_stride, - int width, int height, - int extend_top, int extend_left, - int extend_bottom, int extend_right) { - int i, j; - uint8_t *left_src, *right_src; - uint8_t *left_dst_start, *right_dst_start; - uint8_t *left_dst, *right_dst; - uint8_t *top_src, *bot_src; - uint8_t *top_dst, *bot_dst; - uint32_t left_pix; - uint32_t right_pix; - uint32_t linesize; - - /* copy the left and right most columns out */ - left_src = src; - right_src = src + width - 1; - left_dst_start = src - extend_left; - right_dst_start = src + width; - - for (i = height; i--; ) { - left_dst = left_dst_start; - right_dst = right_dst_start; - - __asm__ __volatile__ ( - "lb %[left_pix], 0(%[left_src]) \n\t" - "lb %[right_pix], 0(%[right_src]) \n\t" - "replv.qb %[left_pix], %[left_pix] \n\t" - "replv.qb %[right_pix], %[right_pix] \n\t" - - : [left_pix] "=&r" (left_pix), [right_pix] "=&r" (right_pix) - : [left_src] "r" (left_src), [right_src] "r" (right_src) - ); - - for (j = extend_left/4; j--; ) { - __asm__ __volatile__ ( - "sw %[left_pix], 0(%[left_dst]) \n\t" - "sw %[right_pix], 0(%[right_dst]) \n\t" - - : - : [left_dst] "r" (left_dst), [left_pix] "r" (left_pix), - [right_dst] "r" (right_dst), [right_pix] "r" (right_pix) - ); - - left_dst += 4; - right_dst += 4; - } - - for (j = extend_left%4; j--; ) { - __asm__ __volatile__ ( - "sb %[left_pix], 0(%[left_dst]) \n\t" - "sb %[right_pix], 0(%[right_dst]) \n\t" - - : - : [left_dst] "r" (left_dst), [left_pix] "r" (left_pix), - [right_dst] "r" (right_dst), [right_pix] "r" (right_pix) - ); - - left_dst += 1; - right_dst += 1; - } - - left_src += src_stride; - right_src += src_stride; - left_dst_start += src_stride; - right_dst_start += src_stride; - } - - /* Now copy the top and bottom lines into each line of the respective - * borders - */ - top_src = src - extend_left; - bot_src = src + src_stride * (height - 1) - extend_left; - top_dst = src + src_stride * (-extend_top) - extend_left; - bot_dst = src + src_stride * (height) - extend_left; - linesize = extend_left + extend_right + width; - - for (i = 0; i < extend_top; i++) { - vpx_memcpy(top_dst, top_src, linesize); - top_dst += src_stride; - } - - for (i = 0; i < extend_bottom; i++) { - vpx_memcpy(bot_dst, bot_src, linesize); - bot_dst += src_stride; - } -} - -static void extend_frame(YV12_BUFFER_CONFIG *const ybf, int ext_size) { - const int c_w = ybf->uv_crop_width; - const int c_h = ybf->uv_crop_height; - const int ss_x = ybf->uv_width < ybf->y_width; - const int ss_y = ybf->uv_height < ybf->y_height; - const int c_et = ext_size >> ss_y; - const int c_el = ext_size >> ss_x; - const int c_eb = c_et + ybf->uv_height - ybf->uv_crop_height; - const int c_er = c_el + ybf->uv_width - ybf->uv_crop_width; - - assert(ybf->y_height - ybf->y_crop_height < 16); - assert(ybf->y_width - ybf->y_crop_width < 16); - assert(ybf->y_height - ybf->y_crop_height >= 0); - assert(ybf->y_width - ybf->y_crop_width >= 0); - - extend_plane(ybf->y_buffer, ybf->y_stride, - ybf->y_crop_width, ybf->y_crop_height, - ext_size, ext_size, - ext_size + ybf->y_height - ybf->y_crop_height, - ext_size + ybf->y_width - ybf->y_crop_width); - - extend_plane(ybf->u_buffer, ybf->uv_stride, - c_w, c_h, c_et, c_el, c_eb, c_er); - - extend_plane(ybf->v_buffer, ybf->uv_stride, - c_w, c_h, c_et, c_el, c_eb, c_er); -} - -void vp9_extend_frame_borders_dspr2(YV12_BUFFER_CONFIG *ybf) { - extend_frame(ybf, ybf->border); -} - -void vp9_extend_frame_inner_borders_dspr2(YV12_BUFFER_CONFIG *ybf) { - const int inner_bw = (ybf->border > VP9INNERBORDERINPIXELS) ? - VP9INNERBORDERINPIXELS : ybf->border; - extend_frame(ybf, inner_bw); -} -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_scale/vpx_scale.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_scale/vpx_scale.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_scale/vpx_scale.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_scale/vpx_scale.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef VPX_SCALE_VPX_SCALE_H_ -#define VPX_SCALE_VPX_SCALE_H_ - -#include "vpx_scale/yv12config.h" - -extern void vpx_scale_frame(YV12_BUFFER_CONFIG *src, - YV12_BUFFER_CONFIG *dst, - unsigned char *temp_area, - unsigned char temp_height, - unsigned int hscale, - unsigned int hratio, - unsigned int vscale, - unsigned int vratio, - unsigned int interlaced); - -#endif // VPX_SCALE_VPX_SCALE_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_scale/vpx_scale.mk gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_scale/vpx_scale.mk --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_scale/vpx_scale.mk 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_scale/vpx_scale.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -SCALE_SRCS-yes += vpx_scale.mk -SCALE_SRCS-yes += yv12config.h -SCALE_SRCS-$(CONFIG_SPATIAL_RESAMPLING) += vpx_scale.h -SCALE_SRCS-$(CONFIG_SPATIAL_RESAMPLING) += generic/vpx_scale.c -SCALE_SRCS-yes += generic/yv12config.c -SCALE_SRCS-yes += generic/yv12extend.c -SCALE_SRCS-$(CONFIG_SPATIAL_RESAMPLING) += generic/gen_scalers.c -SCALE_SRCS-yes += vpx_scale_rtcd.c -SCALE_SRCS-yes += vpx_scale_rtcd.pl - -#mips(dspr2) -SCALE_SRCS-$(HAVE_DSPR2) += mips/dspr2/yv12extend_dspr2.c - -SCALE_SRCS-no += $(SCALE_SRCS_REMOVE-yes) - -$(eval $(call rtcd_h_template,vpx_scale_rtcd,vpx_scale/vpx_scale_rtcd.pl)) diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_scale/vpx_scale_rtcd.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_scale/vpx_scale_rtcd.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_scale/vpx_scale_rtcd.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_scale/vpx_scale_rtcd.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2011 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#include "vpx_config.h" -#define RTCD_C -#include "vpx_scale_rtcd.h" -#include "vpx_ports/vpx_once.h" - -void vpx_scale_rtcd() -{ - once(setup_rtcd_internal); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_scale/win32/scaleopt.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_scale/win32/scaleopt.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_scale/win32/scaleopt.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_scale/win32/scaleopt.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,525 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/**************************************************************************** -* -* Module Title : scaleopt.cpp -* -* Description : Optimized scaling functions -* -****************************************************************************/ -#include "pragmas.h" - -/**************************************************************************** -* Module Statics -****************************************************************************/ -__declspec(align(16)) const static unsigned short round_values[] = { 128, 128, 128, 128 }; - -#include "vpx_scale/vpx_scale.h" -#include "vpx_mem/vpx_mem.h" - -__declspec(align(16)) const static unsigned short const54_2[] = { 0, 64, 128, 192 }; -__declspec(align(16)) const static unsigned short const54_1[] = {256, 192, 128, 64 }; - - -/**************************************************************************** - * - * ROUTINE : horizontal_line_5_4_scale_mmx - * - * INPUTS : const unsigned char *source : Pointer to source data. - * unsigned int source_width : Stride of source. - * unsigned char *dest : Pointer to destination data. - * unsigned int dest_width : Stride of destination (NOT USED). - * - * OUTPUTS : None. - * - * RETURNS : void - * - * FUNCTION : Copies horizontal line of pixels from source to - * destination scaling up by 4 to 5. - * - * SPECIAL NOTES : None. - * - ****************************************************************************/ -static -void horizontal_line_5_4_scale_mmx -( - const unsigned char *source, - unsigned int source_width, - unsigned char *dest, - unsigned int dest_width -) { - /* - unsigned i; - unsigned int a, b, c, d, e; - unsigned char *des = dest; - const unsigned char *src = source; - - (void) dest_width; - - for ( i=0; i>8); - des[2] = ((c*128 + d*128 + 128)>>8); - des[3] = ((d* 64 + e*192 + 128)>>8); - - src += 5; - des += 4; - } - */ - (void) dest_width; - - __asm { - - mov esi, source; - mov edi, dest; - - mov ecx, source_width; - movq mm5, const54_1; - - pxor mm7, mm7; - movq mm6, const54_2; - - movq mm4, round_values; - lea edx, [esi+ecx]; - horizontal_line_5_4_loop: - - movq mm0, QWORD PTR [esi]; - 00 01 02 03 04 05 06 07 - movq mm1, mm0; - 00 01 02 03 04 05 06 07 - - psrlq mm0, 8; - 01 02 03 04 05 06 07 xx - punpcklbw mm1, mm7; - xx 00 xx 01 xx 02 xx 03 - - punpcklbw mm0, mm7; - xx 01 xx 02 xx 03 xx 04 - pmullw mm1, mm5 - - pmullw mm0, mm6 - add esi, 5 - - add edi, 4 - paddw mm1, mm0 - - paddw mm1, mm4 - psrlw mm1, 8 - - cmp esi, edx - packuswb mm1, mm7 - - movd DWORD PTR [edi-4], mm1 - - jl horizontal_line_5_4_loop - - } - -} -__declspec(align(16)) const static unsigned short one_fourths[] = { 64, 64, 64, 64 }; -__declspec(align(16)) const static unsigned short two_fourths[] = { 128, 128, 128, 128 }; -__declspec(align(16)) const static unsigned short three_fourths[] = { 192, 192, 192, 192 }; - -static -void vertical_band_5_4_scale_mmx(unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width) { - - __asm { - push ebx - - mov esi, source // Get the source and destination pointer - mov ecx, src_pitch // Get the pitch size - - mov edi, dest // tow lines below - pxor mm7, mm7 // clear out mm7 - - mov edx, dest_pitch // Loop counter - mov ebx, dest_width - - vs_5_4_loop: - - movd mm0, DWORD ptr [esi] // src[0]; - movd mm1, DWORD ptr [esi+ecx] // src[1]; - - movd mm2, DWORD ptr [esi+ecx*2] - lea eax, [esi+ecx*2] // - - punpcklbw mm1, mm7 - punpcklbw mm2, mm7 - - movq mm3, mm2 - pmullw mm1, three_fourths - - pmullw mm2, one_fourths - movd mm4, [eax+ecx] - - pmullw mm3, two_fourths - punpcklbw mm4, mm7 - - movq mm5, mm4 - pmullw mm4, two_fourths - - paddw mm1, mm2 - movd mm6, [eax+ecx*2] - - pmullw mm5, one_fourths - paddw mm1, round_values; - - paddw mm3, mm4 - psrlw mm1, 8 - - punpcklbw mm6, mm7 - paddw mm3, round_values - - pmullw mm6, three_fourths - psrlw mm3, 8 - - packuswb mm1, mm7 - packuswb mm3, mm7 - - movd DWORD PTR [edi], mm0 - movd DWORD PTR [edi+edx], mm1 - - - paddw mm5, mm6 - movd DWORD PTR [edi+edx*2], mm3 - - lea eax, [edi+edx*2] - paddw mm5, round_values - - psrlw mm5, 8 - add edi, 4 - - packuswb mm5, mm7 - movd DWORD PTR [eax+edx], mm5 - - add esi, 4 - sub ebx, 4 - - jg vs_5_4_loop - - pop ebx - } -} - - -__declspec(align(16)) const static unsigned short const53_1[] = { 0, 85, 171, 0 }; -__declspec(align(16)) const static unsigned short const53_2[] = {256, 171, 85, 0 }; - - -static -void horizontal_line_5_3_scale_mmx -( - const unsigned char *source, - unsigned int source_width, - unsigned char *dest, - unsigned int dest_width -) { - - (void) dest_width; - __asm { - - mov esi, source; - mov edi, dest; - - mov ecx, source_width; - movq mm5, const53_1; - - pxor mm7, mm7; - movq mm6, const53_2; - - movq mm4, round_values; - lea edx, [esi+ecx-5]; - horizontal_line_5_3_loop: - - movq mm0, QWORD PTR [esi]; - 00 01 02 03 04 05 06 07 - movq mm1, mm0; - 00 01 02 03 04 05 06 07 - - psllw mm0, 8; - xx 00 xx 02 xx 04 xx 06 - psrlw mm1, 8; - 01 xx 03 xx 05 xx 07 xx - - psrlw mm0, 8; - 00 xx 02 xx 04 xx 06 xx - psllq mm1, 16; - xx xx 01 xx 03 xx 05 xx - - pmullw mm0, mm6 - - pmullw mm1, mm5 - add esi, 5 - - add edi, 3 - paddw mm1, mm0 - - paddw mm1, mm4 - psrlw mm1, 8 - - cmp esi, edx - packuswb mm1, mm7 - - movd DWORD PTR [edi-3], mm1 - jl horizontal_line_5_3_loop - -// exit condition - movq mm0, QWORD PTR [esi]; - 00 01 02 03 04 05 06 07 - movq mm1, mm0; - 00 01 02 03 04 05 06 07 - - psllw mm0, 8; - xx 00 xx 02 xx 04 xx 06 - psrlw mm1, 8; - 01 xx 03 xx 05 xx 07 xx - - psrlw mm0, 8; - 00 xx 02 xx 04 xx 06 xx - psllq mm1, 16; - xx xx 01 xx 03 xx 05 xx - - pmullw mm0, mm6 - - pmullw mm1, mm5 - paddw mm1, mm0 - - paddw mm1, mm4 - psrlw mm1, 8 - - packuswb mm1, mm7 - movd eax, mm1 - - mov edx, eax - shr edx, 16 - - mov WORD PTR[edi], ax - mov BYTE PTR[edi+2], dl - - } - -} - -__declspec(align(16)) const static unsigned short one_thirds[] = { 85, 85, 85, 85 }; -__declspec(align(16)) const static unsigned short two_thirds[] = { 171, 171, 171, 171 }; - -static -void vertical_band_5_3_scale_mmx(unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width) { - - __asm { - push ebx - - mov esi, source // Get the source and destination pointer - mov ecx, src_pitch // Get the pitch size - - mov edi, dest // tow lines below - pxor mm7, mm7 // clear out mm7 - - mov edx, dest_pitch // Loop counter - movq mm5, one_thirds - - movq mm6, two_thirds - mov ebx, dest_width; - - vs_5_3_loop: - - movd mm0, DWORD ptr [esi] // src[0]; - movd mm1, DWORD ptr [esi+ecx] // src[1]; - - movd mm2, DWORD ptr [esi+ecx*2] - lea eax, [esi+ecx*2] // - - punpcklbw mm1, mm7 - punpcklbw mm2, mm7 - - pmullw mm1, mm5 - pmullw mm2, mm6 - - movd mm3, DWORD ptr [eax+ecx] - movd mm4, DWORD ptr [eax+ecx*2] - - punpcklbw mm3, mm7 - punpcklbw mm4, mm7 - - pmullw mm3, mm6 - pmullw mm4, mm5 - - - movd DWORD PTR [edi], mm0 - paddw mm1, mm2 - - paddw mm1, round_values - psrlw mm1, 8 - - packuswb mm1, mm7 - paddw mm3, mm4 - - paddw mm3, round_values - movd DWORD PTR [edi+edx], mm1 - - psrlw mm3, 8 - packuswb mm3, mm7 - - movd DWORD PTR [edi+edx*2], mm3 - - - add edi, 4 - add esi, 4 - - sub ebx, 4 - jg vs_5_3_loop - - pop ebx - } -} - - - - -/**************************************************************************** - * - * ROUTINE : horizontal_line_2_1_scale - * - * INPUTS : const unsigned char *source : - * unsigned int source_width : - * unsigned char *dest : - * unsigned int dest_width : - * - * OUTPUTS : None. - * - * RETURNS : void - * - * FUNCTION : 1 to 2 up-scaling of a horizontal line of pixels. - * - * SPECIAL NOTES : None. - * - ****************************************************************************/ -static -void horizontal_line_2_1_scale_mmx -( - const unsigned char *source, - unsigned int source_width, - unsigned char *dest, - unsigned int dest_width -) { - (void) dest_width; - (void) source_width; - __asm { - mov esi, source - mov edi, dest - - pxor mm7, mm7 - mov ecx, dest_width - - xor edx, edx - hs_2_1_loop: - - movq mm0, [esi+edx*2] - psllw mm0, 8 - - psrlw mm0, 8 - packuswb mm0, mm7 - - movd DWORD Ptr [edi+edx], mm0; - add edx, 4 - - cmp edx, ecx - jl hs_2_1_loop - - } -} - - - -static -void vertical_band_2_1_scale_mmx(unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width) { - (void) dest_pitch; - (void) src_pitch; - vpx_memcpy(dest, source, dest_width); -} - - -__declspec(align(16)) const static unsigned short three_sixteenths[] = { 48, 48, 48, 48 }; -__declspec(align(16)) const static unsigned short ten_sixteenths[] = { 160, 160, 160, 160 }; - -static -void vertical_band_2_1_scale_i_mmx(unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width) { - - (void) dest_pitch; - __asm { - mov esi, source - mov edi, dest - - mov eax, src_pitch - mov edx, dest_width - - pxor mm7, mm7 - sub esi, eax // back one line - - - lea ecx, [esi+edx]; - movq mm6, round_values; - - movq mm5, three_sixteenths; - movq mm4, ten_sixteenths; - - vs_2_1_i_loop: - movd mm0, [esi] // - movd mm1, [esi+eax] // - - movd mm2, [esi+eax*2] // - punpcklbw mm0, mm7 - - pmullw mm0, mm5 - punpcklbw mm1, mm7 - - pmullw mm1, mm4 - punpcklbw mm2, mm7 - - pmullw mm2, mm5 - paddw mm0, round_values - - paddw mm1, mm2 - paddw mm0, mm1 - - psrlw mm0, 8 - packuswb mm0, mm7 - - movd DWORD PTR [edi], mm0 - add esi, 4 - - add edi, 4; - cmp esi, ecx - jl vs_2_1_i_loop - - } -} - - - -void -register_mmxscalers(void) { - vp8_vertical_band_5_4_scale = vertical_band_5_4_scale_mmx; - vp8_vertical_band_5_3_scale = vertical_band_5_3_scale_mmx; - vp8_vertical_band_2_1_scale = vertical_band_2_1_scale_mmx; - vp8_vertical_band_2_1_scale_i = vertical_band_2_1_scale_i_mmx; - vp8_horizontal_line_2_1_scale = horizontal_line_2_1_scale_mmx; - vp8_horizontal_line_5_3_scale = horizontal_line_5_3_scale_mmx; - vp8_horizontal_line_5_4_scale = horizontal_line_5_4_scale_mmx; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_scale/yv12config.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_scale/yv12config.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_scale/yv12config.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_scale/yv12config.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VPX_SCALE_YV12CONFIG_H_ -#define VPX_SCALE_YV12CONFIG_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "./vpx_config.h" -#include "vpx/vpx_codec.h" -#include "vpx/vpx_frame_buffer.h" -#include "vpx/vpx_integer.h" - -#define VP8BORDERINPIXELS 32 -#define VP9INNERBORDERINPIXELS 96 -#define VP9_INTERP_EXTEND 4 -#define VP9_ENC_BORDER_IN_PIXELS 160 -#define VP9_DEC_BORDER_IN_PIXELS 32 - -typedef struct yv12_buffer_config { - int y_width; - int y_height; - int y_crop_width; - int y_crop_height; - int y_stride; - - int uv_width; - int uv_height; - int uv_crop_width; - int uv_crop_height; - int uv_stride; - - int alpha_width; - int alpha_height; - int alpha_stride; - - uint8_t *y_buffer; - uint8_t *u_buffer; - uint8_t *v_buffer; - uint8_t *alpha_buffer; - - uint8_t *buffer_alloc; - int buffer_alloc_sz; - int border; - int frame_size; - int subsampling_x; - int subsampling_y; - unsigned int bit_depth; - vpx_color_space_t color_space; - - int corrupted; - int flags; -} YV12_BUFFER_CONFIG; - -#define YV12_FLAG_HIGHBITDEPTH 8 - -int vp8_yv12_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, - int width, int height, int border); -int vp8_yv12_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, - int width, int height, int border); -int vp8_yv12_de_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf); - -int vp9_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, - int width, int height, int ss_x, int ss_y, -#if CONFIG_VP9_HIGHBITDEPTH - int use_highbitdepth, -#endif - int border, int byte_alignment); - -// Updates the yv12 buffer config with the frame buffer. |byte_alignment| must -// be a power of 2, from 32 to 1024. 0 sets legacy alignment. If cb is not -// NULL, then libvpx is using the frame buffer callbacks to handle memory. -// If cb is not NULL, libvpx will call cb with minimum size in bytes needed -// to decode the current frame. If cb is NULL, libvpx will allocate memory -// internally to decode the current frame. Returns 0 on success. Returns < 0 -// on failure. -int vp9_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, - int width, int height, int ss_x, int ss_y, -#if CONFIG_VP9_HIGHBITDEPTH - int use_highbitdepth, -#endif - int border, - int byte_alignment, - vpx_codec_frame_buffer_t *fb, - vpx_get_frame_buffer_cb_fn_t cb, - void *cb_priv); -int vp9_free_frame_buffer(YV12_BUFFER_CONFIG *ybf); - -#ifdef __cplusplus -} -#endif - -#endif // VPX_SCALE_YV12CONFIG_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_scale_rtcd.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_scale_rtcd.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpx_scale_rtcd.h 2015-12-07 10:55:38.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpx_scale_rtcd.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -#ifndef VPX_SCALE_RTCD_H_ -#define VPX_SCALE_RTCD_H_ - -#ifdef RTCD_C -#define RTCD_EXTERN -#else -#define RTCD_EXTERN extern -#endif - -struct yv12_buffer_config; - -#ifdef __cplusplus -extern "C" { -#endif - -void vp8_horizontal_line_2_1_scale_c(const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width); -#define vp8_horizontal_line_2_1_scale vp8_horizontal_line_2_1_scale_c - -void vp8_horizontal_line_5_3_scale_c(const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width); -#define vp8_horizontal_line_5_3_scale vp8_horizontal_line_5_3_scale_c - -void vp8_horizontal_line_5_4_scale_c(const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width); -#define vp8_horizontal_line_5_4_scale vp8_horizontal_line_5_4_scale_c - -void vp8_vertical_band_2_1_scale_c(unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width); -#define vp8_vertical_band_2_1_scale vp8_vertical_band_2_1_scale_c - -void vp8_vertical_band_2_1_scale_i_c(unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width); -#define vp8_vertical_band_2_1_scale_i vp8_vertical_band_2_1_scale_i_c - -void vp8_vertical_band_5_3_scale_c(unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width); -#define vp8_vertical_band_5_3_scale vp8_vertical_band_5_3_scale_c - -void vp8_vertical_band_5_4_scale_c(unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width); -#define vp8_vertical_band_5_4_scale vp8_vertical_band_5_4_scale_c - -void vp8_yv12_copy_frame_c(const struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc); -#define vp8_yv12_copy_frame vp8_yv12_copy_frame_c - -void vp8_yv12_extend_frame_borders_c(struct yv12_buffer_config *ybf); -#define vp8_yv12_extend_frame_borders vp8_yv12_extend_frame_borders_c - -void vpx_yv12_copy_y_c(const struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc); -#define vpx_yv12_copy_y vpx_yv12_copy_y_c - -void vpx_scale_rtcd(void); - -#ifdef RTCD_C -#include "vpx_ports/x86.h" -static void setup_rtcd_internal(void) -{ - int flags = x86_simd_caps(); - - (void)flags; - -} -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpxstats.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpxstats.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpxstats.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpxstats.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "./vpxstats.h" - -#include -#include -#include - -#include "./tools_common.h" - -int stats_open_file(stats_io_t *stats, const char *fpf, int pass) { - int res; - stats->pass = pass; - - if (pass == 0) { - stats->file = fopen(fpf, "wb"); - stats->buf.sz = 0; - stats->buf.buf = NULL; - res = (stats->file != NULL); - } else { -#if USE_POSIX_MMAP - struct stat stat_buf; - int fd; - - fd = open(fpf, O_RDONLY); - stats->file = fdopen(fd, "rb"); - fstat(fd, &stat_buf); - stats->buf.sz = stat_buf.st_size; - stats->buf.buf = mmap(NULL, stats->buf.sz, PROT_READ, MAP_PRIVATE, fd, 0); - res = (stats->buf.buf != NULL); -#else - size_t nbytes; - - stats->file = fopen(fpf, "rb"); - - if (stats->file == NULL) - fatal("First-pass stats file does not exist!"); - - if (fseek(stats->file, 0, SEEK_END)) - fatal("First-pass stats file must be seekable!"); - - stats->buf.sz = stats->buf_alloc_sz = ftell(stats->file); - rewind(stats->file); - - stats->buf.buf = malloc(stats->buf_alloc_sz); - - if (!stats->buf.buf) - fatal("Failed to allocate first-pass stats buffer (%lu bytes)", - (unsigned int)stats->buf_alloc_sz); - - nbytes = fread(stats->buf.buf, 1, stats->buf.sz, stats->file); - res = (nbytes == stats->buf.sz); -#endif /* USE_POSIX_MMAP */ - } - - return res; -} - -int stats_open_mem(stats_io_t *stats, int pass) { - int res; - stats->pass = pass; - - if (!pass) { - stats->buf.sz = 0; - stats->buf_alloc_sz = 64 * 1024; - stats->buf.buf = malloc(stats->buf_alloc_sz); - } - - stats->buf_ptr = stats->buf.buf; - res = (stats->buf.buf != NULL); - return res; -} - -void stats_close(stats_io_t *stats, int last_pass) { - if (stats->file) { - if (stats->pass == last_pass) { -#if USE_POSIX_MMAP - munmap(stats->buf.buf, stats->buf.sz); -#else - free(stats->buf.buf); -#endif /* USE_POSIX_MMAP */ - } - - fclose(stats->file); - stats->file = NULL; - } else { - if (stats->pass == last_pass) - free(stats->buf.buf); - } -} - -void stats_write(stats_io_t *stats, const void *pkt, size_t len) { - if (stats->file) { - (void) fwrite(pkt, 1, len, stats->file); - } else { - if (stats->buf.sz + len > stats->buf_alloc_sz) { - size_t new_sz = stats->buf_alloc_sz + 64 * 1024; - char *new_ptr = realloc(stats->buf.buf, new_sz); - - if (new_ptr) { - stats->buf_ptr = new_ptr + (stats->buf_ptr - (char *)stats->buf.buf); - stats->buf.buf = new_ptr; - stats->buf_alloc_sz = new_sz; - } else { - fatal("Failed to realloc firstpass stats buffer."); - } - } - - memcpy(stats->buf_ptr, pkt, len); - stats->buf.sz += len; - stats->buf_ptr += len; - } -} - -vpx_fixed_buf_t stats_get(stats_io_t *stats) { - return stats->buf; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpxstats.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpxstats.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/vpxstats.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/vpxstats.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VPXSTATS_H_ -#define VPXSTATS_H_ - -#include - -#include "vpx/vpx_encoder.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* This structure is used to abstract the different ways of handling - * first pass statistics - */ -typedef struct { - vpx_fixed_buf_t buf; - int pass; - FILE *file; - char *buf_ptr; - size_t buf_alloc_sz; -} stats_io_t; - -int stats_open_file(stats_io_t *stats, const char *fpf, int pass); -int stats_open_mem(stats_io_t *stats, int pass); -void stats_close(stats_io_t *stats, int last_pass); -void stats_write(stats_io_t *stats, const void *pkt, size_t len); -vpx_fixed_buf_t stats_get(stats_io_t *stats); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // VPXSTATS_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/warnings.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/warnings.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/warnings.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/warnings.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "./warnings.h" - -#include -#include -#include -#include - -#include "vpx/vpx_encoder.h" - -#include "./tools_common.h" -#include "./vpxenc.h" - -static const char quantizer_warning_string[] = - "Bad quantizer values. Quantizer values should not be equal, and should " - "differ by at least 8."; -static const char lag_in_frames_with_realtime[] = - "Lag in frames is ignored when deadline is set to realtime."; - -struct WarningListNode { - const char *warning_string; - struct WarningListNode *next_warning; -}; - -struct WarningList { - struct WarningListNode *warning_node; -}; - -static void add_warning(const char *warning_string, - struct WarningList *warning_list) { - struct WarningListNode **node = &warning_list->warning_node; - - struct WarningListNode *new_node = malloc(sizeof(*new_node)); - if (new_node == NULL) { - fatal("Unable to allocate warning node."); - } - - new_node->warning_string = warning_string; - new_node->next_warning = NULL; - - while (*node != NULL) - node = &(*node)->next_warning; - - *node = new_node; -} - -static void free_warning_list(struct WarningList *warning_list) { - while (warning_list->warning_node != NULL) { - struct WarningListNode *const node = warning_list->warning_node; - warning_list->warning_node = node->next_warning; - free(node); - } -} - -static int continue_prompt(int num_warnings) { - int c; - fprintf(stderr, - "%d encoder configuration warning(s). Continue? (y to continue) ", - num_warnings); - c = getchar(); - return c == 'y'; -} - -static void check_quantizer(int min_q, int max_q, - struct WarningList *warning_list) { - const int lossless = min_q == 0 && max_q == 0; - if (!lossless && (min_q == max_q || abs(max_q - min_q) < 8)) - add_warning(quantizer_warning_string, warning_list); -} - -static void check_lag_in_frames_realtime_deadline( - int lag_in_frames, - int deadline, - struct WarningList *warning_list) { - if (deadline == VPX_DL_REALTIME && lag_in_frames != 0) - add_warning(lag_in_frames_with_realtime, warning_list); -} - -void check_encoder_config(int disable_prompt, - const struct VpxEncoderConfig *global_config, - const struct vpx_codec_enc_cfg *stream_config) { - int num_warnings = 0; - struct WarningListNode *warning = NULL; - struct WarningList warning_list = {0}; - - check_quantizer(stream_config->rc_min_quantizer, - stream_config->rc_max_quantizer, - &warning_list); - check_lag_in_frames_realtime_deadline(stream_config->g_lag_in_frames, - global_config->deadline, - &warning_list); - /* Count and print warnings. */ - for (warning = warning_list.warning_node; - warning != NULL; - warning = warning->next_warning, - ++num_warnings) { - warn(warning->warning_string); - } - - free_warning_list(&warning_list); - - if (num_warnings) { - if (!disable_prompt && !continue_prompt(num_warnings)) - exit(EXIT_FAILURE); - } -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/warnings.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/warnings.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/warnings.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/warnings.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef WARNINGS_H_ -#define WARNINGS_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -struct vpx_codec_enc_cfg; -struct VpxEncoderConfig; - -/* - * Checks config for improperly used settings. Warns user upon encountering - * settings that will lead to poor output quality. Prompts user to continue - * when warnings are issued. - */ -void check_encoder_config(int disable_prompt, - const struct VpxEncoderConfig *global_config, - const struct vpx_codec_enc_cfg *stream_config); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // WARNINGS_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/webmdec.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/webmdec.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/webmdec.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/webmdec.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef WEBMDEC_H_ -#define WEBMDEC_H_ - -#include "./tools_common.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct VpxInputContext; - -struct WebmInputContext { - void *reader; - void *segment; - uint8_t *buffer; - const void *cluster; - const void *block_entry; - const void *block; - int block_frame_index; - int video_track_index; - uint64_t timestamp_ns; - int is_key_frame; -}; - -// Checks if the input is a WebM file. If so, initializes WebMInputContext so -// that webm_read_frame can be called to retrieve a video frame. -// Returns 1 on success and 0 on failure or input is not WebM file. -// TODO(vigneshv): Refactor this function into two smaller functions specific -// to their task. -int file_is_webm(struct WebmInputContext *webm_ctx, - struct VpxInputContext *vpx_ctx); - -// Reads a WebM Video Frame. Memory for the buffer is created, owned and managed -// by this function. For the first call, |buffer| should be NULL and -// |*bytes_in_buffer| should be 0. Once all the frames are read and used, -// webm_free() should be called, otherwise there will be a leak. -// Parameters: -// webm_ctx - WebmInputContext object -// buffer - pointer where the frame data will be filled. -// bytes_in_buffer - pointer to buffer size. -// buffer_size - unused TODO(vigneshv): remove this -// Return values: -// 0 - Success -// 1 - End of Stream -// -1 - Error -// TODO(vigneshv): Make the return values consistent across all functions in -// this file. -int webm_read_frame(struct WebmInputContext *webm_ctx, - uint8_t **buffer, - size_t *bytes_in_buffer, - size_t *buffer_size); - -// Guesses the frame rate of the input file based on the container timestamps. -int webm_guess_framerate(struct WebmInputContext *webm_ctx, - struct VpxInputContext *vpx_ctx); - -// Resets the WebMInputContext. -void webm_free(struct WebmInputContext *webm_ctx); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // WEBMDEC_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/webmenc.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/webmenc.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/webmenc.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/webmenc.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2013 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef WEBMENC_H_ -#define WEBMENC_H_ - -#include -#include - -#include "tools_common.h" -#include "vpx/vpx_encoder.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* TODO(vigneshv): Rename this struct */ -struct EbmlGlobal { - int debug; - FILE *stream; - int64_t last_pts_ns; - void *writer; - void *segment; -}; - -/* Stereo 3D packed frame format */ -typedef enum stereo_format { - STEREO_FORMAT_MONO = 0, - STEREO_FORMAT_LEFT_RIGHT = 1, - STEREO_FORMAT_BOTTOM_TOP = 2, - STEREO_FORMAT_TOP_BOTTOM = 3, - STEREO_FORMAT_RIGHT_LEFT = 11 -} stereo_format_t; - -void write_webm_file_header(struct EbmlGlobal *glob, - const vpx_codec_enc_cfg_t *cfg, - const struct vpx_rational *fps, - stereo_format_t stereo_fmt, - unsigned int fourcc); - -void write_webm_block(struct EbmlGlobal *glob, - const vpx_codec_enc_cfg_t *cfg, - const vpx_codec_cx_pkt_t *pkt); - -void write_webm_file_footer(struct EbmlGlobal *glob); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // WEBMENC_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/y4menc.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/y4menc.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/y4menc.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/y4menc.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include "./y4menc.h" - -int y4m_write_file_header(char *buf, size_t len, int width, int height, - const struct VpxRational *framerate, - vpx_img_fmt_t fmt, unsigned int bit_depth) { - const char *color; - switch (bit_depth) { - case 8: - color = fmt == VPX_IMG_FMT_444A ? "C444alpha\n" : - fmt == VPX_IMG_FMT_I444 ? "C444\n" : - fmt == VPX_IMG_FMT_I422 ? "C422\n" : - "C420jpeg\n"; - break; - case 9: - color = fmt == VPX_IMG_FMT_I44416 ? "C444p9 XYSCSS=444P9\n" : - fmt == VPX_IMG_FMT_I42216 ? "C422p9 XYSCSS=422P9\n" : - "C420p9 XYSCSS=420P9\n"; - break; - case 10: - color = fmt == VPX_IMG_FMT_I44416 ? "C444p10 XYSCSS=444P10\n" : - fmt == VPX_IMG_FMT_I42216 ? "C422p10 XYSCSS=422P10\n" : - "C420p10 XYSCSS=420P10\n"; - break; - case 12: - color = fmt == VPX_IMG_FMT_I44416 ? "C444p12 XYSCSS=444P12\n" : - fmt == VPX_IMG_FMT_I42216 ? "C422p12 XYSCSS=422P12\n" : - "C420p12 XYSCSS=420P12\n"; - break; - case 14: - color = fmt == VPX_IMG_FMT_I44416 ? "C444p14 XYSCSS=444P14\n" : - fmt == VPX_IMG_FMT_I42216 ? "C422p14 XYSCSS=422P14\n" : - "C420p14 XYSCSS=420P14\n"; - break; - case 16: - color = fmt == VPX_IMG_FMT_I44416 ? "C444p16 XYSCSS=444P16\n" : - fmt == VPX_IMG_FMT_I42216 ? "C422p16 XYSCSS=422P16\n" : - "C420p16 XYSCSS=420P16\n"; - break; - default: - color = NULL; - assert(0); - } - return snprintf(buf, len, "YUV4MPEG2 W%u H%u F%u:%u I%c %s", width, height, - framerate->numerator, framerate->denominator, 'p', color); -} - -int y4m_write_frame_header(char *buf, size_t len) { - return snprintf(buf, len, "FRAME\n"); -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/y4menc.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/y4menc.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/y4menc.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/y4menc.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2014 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef Y4MENC_H_ -#define Y4MENC_H_ - -#include "./tools_common.h" - -#include "vpx/vpx_decoder.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define Y4M_BUFFER_SIZE 128 - -int y4m_write_file_header(char *buf, size_t len, int width, int height, - const struct VpxRational *framerate, - vpx_img_fmt_t fmt, unsigned int bit_depth); -int y4m_write_frame_header(char *buf, size_t len); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // Y4MENC_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/y4minput.c gstreamer-vaapi-1.8.2/ext/libvpx/upstream/y4minput.c --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/y4minput.c 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/y4minput.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1052 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - * - * Based on code from the OggTheora software codec source code, - * Copyright (C) 2002-2010 The Xiph.Org Foundation and contributors. - */ -#include -#include -#include - -#include "vpx/vpx_integer.h" -#include "y4minput.h" - -// Reads 'size' bytes from 'file' into 'buf' with some fault tolerance. -// Returns true on success. -static int file_read(void *buf, size_t size, FILE *file) { - const int kMaxRetries = 5; - int retry_count = 0; - int file_error; - size_t len = 0; - do { - const size_t n = fread((uint8_t*)buf + len, 1, size - len, file); - len += n; - file_error = ferror(file); - if (file_error) { - if (errno == EINTR || errno == EAGAIN) { - clearerr(file); - continue; - } else { - fprintf(stderr, "Error reading file: %u of %u bytes read, %d: %s\n", - (uint32_t)len, (uint32_t)size, errno, strerror(errno)); - return 0; - } - } - } while (!feof(file) && len < size && ++retry_count < kMaxRetries); - - if (!feof(file) && len != size) { - fprintf(stderr, "Error reading file: %u of %u bytes read," - " error: %d, retries: %d, %d: %s\n", - (uint32_t)len, (uint32_t)size, file_error, retry_count, - errno, strerror(errno)); - } - return len == size; -} - -static int y4m_parse_tags(y4m_input *_y4m, char *_tags) { - int got_w; - int got_h; - int got_fps; - int got_interlace; - int got_par; - int got_chroma; - char *p; - char *q; - got_w = got_h = got_fps = got_interlace = got_par = got_chroma = 0; - for (p = _tags;; p = q) { - /*Skip any leading spaces.*/ - while (*p == ' ')p++; - /*If that's all we have, stop.*/ - if (p[0] == '\0')break; - /*Find the end of this tag.*/ - for (q = p + 1; *q != '\0' && *q != ' '; q++); - /*Process the tag.*/ - switch (p[0]) { - case 'W': { - if (sscanf(p + 1, "%d", &_y4m->pic_w) != 1)return -1; - got_w = 1; - } - break; - case 'H': { - if (sscanf(p + 1, "%d", &_y4m->pic_h) != 1)return -1; - got_h = 1; - } - break; - case 'F': { - if (sscanf(p + 1, "%d:%d", &_y4m->fps_n, &_y4m->fps_d) != 2) { - return -1; - } - got_fps = 1; - } - break; - case 'I': { - _y4m->interlace = p[1]; - got_interlace = 1; - } - break; - case 'A': { - if (sscanf(p + 1, "%d:%d", &_y4m->par_n, &_y4m->par_d) != 2) { - return -1; - } - got_par = 1; - } - break; - case 'C': { - if (q - p > 16)return -1; - memcpy(_y4m->chroma_type, p + 1, q - p - 1); - _y4m->chroma_type[q - p - 1] = '\0'; - got_chroma = 1; - } - break; - /*Ignore unknown tags.*/ - } - } - if (!got_w || !got_h || !got_fps)return -1; - if (!got_interlace)_y4m->interlace = '?'; - if (!got_par)_y4m->par_n = _y4m->par_d = 0; - /*Chroma-type is not specified in older files, e.g., those generated by - mplayer.*/ - if (!got_chroma)strcpy(_y4m->chroma_type, "420"); - return 0; -} - - - -/*All anti-aliasing filters in the following conversion functions are based on - one of two window functions: - The 6-tap Lanczos window (for down-sampling and shifts): - sinc(\pi*t)*sinc(\pi*t/3), |t|<3 (sinc(t)==sin(t)/t) - 0, |t|>=3 - The 4-tap Mitchell window (for up-sampling): - 7|t|^3-12|t|^2+16/3, |t|<1 - -(7/3)|x|^3+12|x|^2-20|x|+32/3, |t|<2 - 0, |t|>=2 - The number of taps is intentionally kept small to reduce computational - overhead and limit ringing. - - The taps from these filters are scaled so that their sum is 1, and the result - is scaled by 128 and rounded to integers to create a filter whose - intermediate values fit inside 16 bits. - Coefficients are rounded in such a way as to ensure their sum is still 128, - which is usually equivalent to normal rounding. - - Conversions which require both horizontal and vertical filtering could - have these steps pipelined, for less memory consumption and better cache - performance, but we do them separately for simplicity.*/ - -#define OC_MINI(_a,_b) ((_a)>(_b)?(_b):(_a)) -#define OC_MAXI(_a,_b) ((_a)<(_b)?(_b):(_a)) -#define OC_CLAMPI(_a,_b,_c) (OC_MAXI(_a,OC_MINI(_b,_c))) - -/*420jpeg chroma samples are sited like: - Y-------Y-------Y-------Y------- - | | | | - | BR | | BR | - | | | | - Y-------Y-------Y-------Y------- - | | | | - | | | | - | | | | - Y-------Y-------Y-------Y------- - | | | | - | BR | | BR | - | | | | - Y-------Y-------Y-------Y------- - | | | | - | | | | - | | | | - - 420mpeg2 chroma samples are sited like: - Y-------Y-------Y-------Y------- - | | | | - BR | BR | - | | | | - Y-------Y-------Y-------Y------- - | | | | - | | | | - | | | | - Y-------Y-------Y-------Y------- - | | | | - BR | BR | - | | | | - Y-------Y-------Y-------Y------- - | | | | - | | | | - | | | | - - We use a resampling filter to shift the site locations one quarter pixel (at - the chroma plane's resolution) to the right. - The 4:2:2 modes look exactly the same, except there are twice as many chroma - lines, and they are vertically co-sited with the luma samples in both the - mpeg2 and jpeg cases (thus requiring no vertical resampling).*/ -static void y4m_42xmpeg2_42xjpeg_helper(unsigned char *_dst, - const unsigned char *_src, int _c_w, int _c_h) { - int y; - int x; - for (y = 0; y < _c_h; y++) { - /*Filter: [4 -17 114 35 -9 1]/128, derived from a 6-tap Lanczos - window.*/ - for (x = 0; x < OC_MINI(_c_w, 2); x++) { - _dst[x] = (unsigned char)OC_CLAMPI(0, (4 * _src[0] - 17 * _src[OC_MAXI(x - 1, 0)] + - 114 * _src[x] + 35 * _src[OC_MINI(x + 1, _c_w - 1)] - 9 * _src[OC_MINI(x + 2, _c_w - 1)] + - _src[OC_MINI(x + 3, _c_w - 1)] + 64) >> 7, 255); - } - for (; x < _c_w - 3; x++) { - _dst[x] = (unsigned char)OC_CLAMPI(0, (4 * _src[x - 2] - 17 * _src[x - 1] + - 114 * _src[x] + 35 * _src[x + 1] - 9 * _src[x + 2] + _src[x + 3] + 64) >> 7, 255); - } - for (; x < _c_w; x++) { - _dst[x] = (unsigned char)OC_CLAMPI(0, (4 * _src[x - 2] - 17 * _src[x - 1] + - 114 * _src[x] + 35 * _src[OC_MINI(x + 1, _c_w - 1)] - 9 * _src[OC_MINI(x + 2, _c_w - 1)] + - _src[_c_w - 1] + 64) >> 7, 255); - } - _dst += _c_w; - _src += _c_w; - } -} - -/*Handles both 422 and 420mpeg2 to 422jpeg and 420jpeg, respectively.*/ -static void y4m_convert_42xmpeg2_42xjpeg(y4m_input *_y4m, unsigned char *_dst, - unsigned char *_aux) { - int c_w; - int c_h; - int c_sz; - int pli; - /*Skip past the luma data.*/ - _dst += _y4m->pic_w * _y4m->pic_h; - /*Compute the size of each chroma plane.*/ - c_w = (_y4m->pic_w + _y4m->dst_c_dec_h - 1) / _y4m->dst_c_dec_h; - c_h = (_y4m->pic_h + _y4m->dst_c_dec_v - 1) / _y4m->dst_c_dec_v; - c_sz = c_w * c_h; - for (pli = 1; pli < 3; pli++) { - y4m_42xmpeg2_42xjpeg_helper(_dst, _aux, c_w, c_h); - _dst += c_sz; - _aux += c_sz; - } -} - -/*This format is only used for interlaced content, but is included for - completeness. - - 420jpeg chroma samples are sited like: - Y-------Y-------Y-------Y------- - | | | | - | BR | | BR | - | | | | - Y-------Y-------Y-------Y------- - | | | | - | | | | - | | | | - Y-------Y-------Y-------Y------- - | | | | - | BR | | BR | - | | | | - Y-------Y-------Y-------Y------- - | | | | - | | | | - | | | | - - 420paldv chroma samples are sited like: - YR------Y-------YR------Y------- - | | | | - | | | | - | | | | - YB------Y-------YB------Y------- - | | | | - | | | | - | | | | - YR------Y-------YR------Y------- - | | | | - | | | | - | | | | - YB------Y-------YB------Y------- - | | | | - | | | | - | | | | - - We use a resampling filter to shift the site locations one quarter pixel (at - the chroma plane's resolution) to the right. - Then we use another filter to move the C_r location down one quarter pixel, - and the C_b location up one quarter pixel.*/ -static void y4m_convert_42xpaldv_42xjpeg(y4m_input *_y4m, unsigned char *_dst, - unsigned char *_aux) { - unsigned char *tmp; - int c_w; - int c_h; - int c_sz; - int pli; - int y; - int x; - /*Skip past the luma data.*/ - _dst += _y4m->pic_w * _y4m->pic_h; - /*Compute the size of each chroma plane.*/ - c_w = (_y4m->pic_w + 1) / 2; - c_h = (_y4m->pic_h + _y4m->dst_c_dec_h - 1) / _y4m->dst_c_dec_h; - c_sz = c_w * c_h; - tmp = _aux + 2 * c_sz; - for (pli = 1; pli < 3; pli++) { - /*First do the horizontal re-sampling. - This is the same as the mpeg2 case, except that after the horizontal - case, we need to apply a second vertical filter.*/ - y4m_42xmpeg2_42xjpeg_helper(tmp, _aux, c_w, c_h); - _aux += c_sz; - switch (pli) { - case 1: { - /*Slide C_b up a quarter-pel. - This is the same filter used above, but in the other order.*/ - for (x = 0; x < c_w; x++) { - for (y = 0; y < OC_MINI(c_h, 3); y++) { - _dst[y * c_w] = (unsigned char)OC_CLAMPI(0, (tmp[0] - - 9 * tmp[OC_MAXI(y - 2, 0) * c_w] + 35 * tmp[OC_MAXI(y - 1, 0) * c_w] - + 114 * tmp[y * c_w] - 17 * tmp[OC_MINI(y + 1, c_h - 1) * c_w] - + 4 * tmp[OC_MINI(y + 2, c_h - 1) * c_w] + 64) >> 7, 255); - } - for (; y < c_h - 2; y++) { - _dst[y * c_w] = (unsigned char)OC_CLAMPI(0, (tmp[(y - 3) * c_w] - - 9 * tmp[(y - 2) * c_w] + 35 * tmp[(y - 1) * c_w] + 114 * tmp[y * c_w] - - 17 * tmp[(y + 1) * c_w] + 4 * tmp[(y + 2) * c_w] + 64) >> 7, 255); - } - for (; y < c_h; y++) { - _dst[y * c_w] = (unsigned char)OC_CLAMPI(0, (tmp[(y - 3) * c_w] - - 9 * tmp[(y - 2) * c_w] + 35 * tmp[(y - 1) * c_w] + 114 * tmp[y * c_w] - - 17 * tmp[OC_MINI(y + 1, c_h - 1) * c_w] + 4 * tmp[(c_h - 1) * c_w] + 64) >> 7, 255); - } - _dst++; - tmp++; - } - _dst += c_sz - c_w; - tmp -= c_w; - } - break; - case 2: { - /*Slide C_r down a quarter-pel. - This is the same as the horizontal filter.*/ - for (x = 0; x < c_w; x++) { - for (y = 0; y < OC_MINI(c_h, 2); y++) { - _dst[y * c_w] = (unsigned char)OC_CLAMPI(0, (4 * tmp[0] - - 17 * tmp[OC_MAXI(y - 1, 0) * c_w] + 114 * tmp[y * c_w] - + 35 * tmp[OC_MINI(y + 1, c_h - 1) * c_w] - 9 * tmp[OC_MINI(y + 2, c_h - 1) * c_w] - + tmp[OC_MINI(y + 3, c_h - 1) * c_w] + 64) >> 7, 255); - } - for (; y < c_h - 3; y++) { - _dst[y * c_w] = (unsigned char)OC_CLAMPI(0, (4 * tmp[(y - 2) * c_w] - - 17 * tmp[(y - 1) * c_w] + 114 * tmp[y * c_w] + 35 * tmp[(y + 1) * c_w] - - 9 * tmp[(y + 2) * c_w] + tmp[(y + 3) * c_w] + 64) >> 7, 255); - } - for (; y < c_h; y++) { - _dst[y * c_w] = (unsigned char)OC_CLAMPI(0, (4 * tmp[(y - 2) * c_w] - - 17 * tmp[(y - 1) * c_w] + 114 * tmp[y * c_w] + 35 * tmp[OC_MINI(y + 1, c_h - 1) * c_w] - - 9 * tmp[OC_MINI(y + 2, c_h - 1) * c_w] + tmp[(c_h - 1) * c_w] + 64) >> 7, 255); - } - _dst++; - tmp++; - } - } - break; - } - /*For actual interlaced material, this would have to be done separately on - each field, and the shift amounts would be different. - C_r moves down 1/8, C_b up 3/8 in the top field, and C_r moves down 3/8, - C_b up 1/8 in the bottom field. - The corresponding filters would be: - Down 1/8 (reverse order for up): [3 -11 125 15 -4 0]/128 - Down 3/8 (reverse order for up): [4 -19 98 56 -13 2]/128*/ - } -} - -/*Perform vertical filtering to reduce a single plane from 4:2:2 to 4:2:0. - This is used as a helper by several converation routines.*/ -static void y4m_422jpeg_420jpeg_helper(unsigned char *_dst, - const unsigned char *_src, int _c_w, int _c_h) { - int y; - int x; - /*Filter: [3 -17 78 78 -17 3]/128, derived from a 6-tap Lanczos window.*/ - for (x = 0; x < _c_w; x++) { - for (y = 0; y < OC_MINI(_c_h, 2); y += 2) { - _dst[(y >> 1)*_c_w] = OC_CLAMPI(0, (64 * _src[0] - + 78 * _src[OC_MINI(1, _c_h - 1) * _c_w] - - 17 * _src[OC_MINI(2, _c_h - 1) * _c_w] - + 3 * _src[OC_MINI(3, _c_h - 1) * _c_w] + 64) >> 7, 255); - } - for (; y < _c_h - 3; y += 2) { - _dst[(y >> 1)*_c_w] = OC_CLAMPI(0, (3 * (_src[(y - 2) * _c_w] + _src[(y + 3) * _c_w]) - - 17 * (_src[(y - 1) * _c_w] + _src[(y + 2) * _c_w]) - + 78 * (_src[y * _c_w] + _src[(y + 1) * _c_w]) + 64) >> 7, 255); - } - for (; y < _c_h; y += 2) { - _dst[(y >> 1)*_c_w] = OC_CLAMPI(0, (3 * (_src[(y - 2) * _c_w] - + _src[(_c_h - 1) * _c_w]) - 17 * (_src[(y - 1) * _c_w] - + _src[OC_MINI(y + 2, _c_h - 1) * _c_w]) - + 78 * (_src[y * _c_w] + _src[OC_MINI(y + 1, _c_h - 1) * _c_w]) + 64) >> 7, 255); - } - _src++; - _dst++; - } -} - -/*420jpeg chroma samples are sited like: - Y-------Y-------Y-------Y------- - | | | | - | BR | | BR | - | | | | - Y-------Y-------Y-------Y------- - | | | | - | | | | - | | | | - Y-------Y-------Y-------Y------- - | | | | - | BR | | BR | - | | | | - Y-------Y-------Y-------Y------- - | | | | - | | | | - | | | | - - 422jpeg chroma samples are sited like: - Y---BR--Y-------Y---BR--Y------- - | | | | - | | | | - | | | | - Y---BR--Y-------Y---BR--Y------- - | | | | - | | | | - | | | | - Y---BR--Y-------Y---BR--Y------- - | | | | - | | | | - | | | | - Y---BR--Y-------Y---BR--Y------- - | | | | - | | | | - | | | | - - We use a resampling filter to decimate the chroma planes by two in the - vertical direction.*/ -static void y4m_convert_422jpeg_420jpeg(y4m_input *_y4m, unsigned char *_dst, - unsigned char *_aux) { - int c_w; - int c_h; - int c_sz; - int dst_c_w; - int dst_c_h; - int dst_c_sz; - int pli; - /*Skip past the luma data.*/ - _dst += _y4m->pic_w * _y4m->pic_h; - /*Compute the size of each chroma plane.*/ - c_w = (_y4m->pic_w + _y4m->src_c_dec_h - 1) / _y4m->src_c_dec_h; - c_h = _y4m->pic_h; - dst_c_w = (_y4m->pic_w + _y4m->dst_c_dec_h - 1) / _y4m->dst_c_dec_h; - dst_c_h = (_y4m->pic_h + _y4m->dst_c_dec_v - 1) / _y4m->dst_c_dec_v; - c_sz = c_w * c_h; - dst_c_sz = dst_c_w * dst_c_h; - for (pli = 1; pli < 3; pli++) { - y4m_422jpeg_420jpeg_helper(_dst, _aux, c_w, c_h); - _aux += c_sz; - _dst += dst_c_sz; - } -} - -/*420jpeg chroma samples are sited like: - Y-------Y-------Y-------Y------- - | | | | - | BR | | BR | - | | | | - Y-------Y-------Y-------Y------- - | | | | - | | | | - | | | | - Y-------Y-------Y-------Y------- - | | | | - | BR | | BR | - | | | | - Y-------Y-------Y-------Y------- - | | | | - | | | | - | | | | - - 422 chroma samples are sited like: - YBR-----Y-------YBR-----Y------- - | | | | - | | | | - | | | | - YBR-----Y-------YBR-----Y------- - | | | | - | | | | - | | | | - YBR-----Y-------YBR-----Y------- - | | | | - | | | | - | | | | - YBR-----Y-------YBR-----Y------- - | | | | - | | | | - | | | | - - We use a resampling filter to shift the original site locations one quarter - pixel (at the original chroma resolution) to the right. - Then we use a second resampling filter to decimate the chroma planes by two - in the vertical direction.*/ -static void y4m_convert_422_420jpeg(y4m_input *_y4m, unsigned char *_dst, - unsigned char *_aux) { - unsigned char *tmp; - int c_w; - int c_h; - int c_sz; - int dst_c_h; - int dst_c_sz; - int pli; - /*Skip past the luma data.*/ - _dst += _y4m->pic_w * _y4m->pic_h; - /*Compute the size of each chroma plane.*/ - c_w = (_y4m->pic_w + _y4m->src_c_dec_h - 1) / _y4m->src_c_dec_h; - c_h = _y4m->pic_h; - dst_c_h = (_y4m->pic_h + _y4m->dst_c_dec_v - 1) / _y4m->dst_c_dec_v; - c_sz = c_w * c_h; - dst_c_sz = c_w * dst_c_h; - tmp = _aux + 2 * c_sz; - for (pli = 1; pli < 3; pli++) { - /*In reality, the horizontal and vertical steps could be pipelined, for - less memory consumption and better cache performance, but we do them - separately for simplicity.*/ - /*First do horizontal filtering (convert to 422jpeg)*/ - y4m_42xmpeg2_42xjpeg_helper(tmp, _aux, c_w, c_h); - /*Now do the vertical filtering.*/ - y4m_422jpeg_420jpeg_helper(_dst, tmp, c_w, c_h); - _aux += c_sz; - _dst += dst_c_sz; - } -} - -/*420jpeg chroma samples are sited like: - Y-------Y-------Y-------Y------- - | | | | - | BR | | BR | - | | | | - Y-------Y-------Y-------Y------- - | | | | - | | | | - | | | | - Y-------Y-------Y-------Y------- - | | | | - | BR | | BR | - | | | | - Y-------Y-------Y-------Y------- - | | | | - | | | | - | | | | - - 411 chroma samples are sited like: - YBR-----Y-------Y-------Y------- - | | | | - | | | | - | | | | - YBR-----Y-------Y-------Y------- - | | | | - | | | | - | | | | - YBR-----Y-------Y-------Y------- - | | | | - | | | | - | | | | - YBR-----Y-------Y-------Y------- - | | | | - | | | | - | | | | - - We use a filter to resample at site locations one eighth pixel (at the source - chroma plane's horizontal resolution) and five eighths of a pixel to the - right. - Then we use another filter to decimate the planes by 2 in the vertical - direction.*/ -static void y4m_convert_411_420jpeg(y4m_input *_y4m, unsigned char *_dst, - unsigned char *_aux) { - unsigned char *tmp; - int c_w; - int c_h; - int c_sz; - int dst_c_w; - int dst_c_h; - int dst_c_sz; - int tmp_sz; - int pli; - int y; - int x; - /*Skip past the luma data.*/ - _dst += _y4m->pic_w * _y4m->pic_h; - /*Compute the size of each chroma plane.*/ - c_w = (_y4m->pic_w + _y4m->src_c_dec_h - 1) / _y4m->src_c_dec_h; - c_h = _y4m->pic_h; - dst_c_w = (_y4m->pic_w + _y4m->dst_c_dec_h - 1) / _y4m->dst_c_dec_h; - dst_c_h = (_y4m->pic_h + _y4m->dst_c_dec_v - 1) / _y4m->dst_c_dec_v; - c_sz = c_w * c_h; - dst_c_sz = dst_c_w * dst_c_h; - tmp_sz = dst_c_w * c_h; - tmp = _aux + 2 * c_sz; - for (pli = 1; pli < 3; pli++) { - /*In reality, the horizontal and vertical steps could be pipelined, for - less memory consumption and better cache performance, but we do them - separately for simplicity.*/ - /*First do horizontal filtering (convert to 422jpeg)*/ - for (y = 0; y < c_h; y++) { - /*Filters: [1 110 18 -1]/128 and [-3 50 86 -5]/128, both derived from a - 4-tap Mitchell window.*/ - for (x = 0; x < OC_MINI(c_w, 1); x++) { - tmp[x << 1] = (unsigned char)OC_CLAMPI(0, (111 * _aux[0] - + 18 * _aux[OC_MINI(1, c_w - 1)] - _aux[OC_MINI(2, c_w - 1)] + 64) >> 7, 255); - tmp[x << 1 | 1] = (unsigned char)OC_CLAMPI(0, (47 * _aux[0] - + 86 * _aux[OC_MINI(1, c_w - 1)] - 5 * _aux[OC_MINI(2, c_w - 1)] + 64) >> 7, 255); - } - for (; x < c_w - 2; x++) { - tmp[x << 1] = (unsigned char)OC_CLAMPI(0, (_aux[x - 1] + 110 * _aux[x] - + 18 * _aux[x + 1] - _aux[x + 2] + 64) >> 7, 255); - tmp[x << 1 | 1] = (unsigned char)OC_CLAMPI(0, (-3 * _aux[x - 1] + 50 * _aux[x] - + 86 * _aux[x + 1] - 5 * _aux[x + 2] + 64) >> 7, 255); - } - for (; x < c_w; x++) { - tmp[x << 1] = (unsigned char)OC_CLAMPI(0, (_aux[x - 1] + 110 * _aux[x] - + 18 * _aux[OC_MINI(x + 1, c_w - 1)] - _aux[c_w - 1] + 64) >> 7, 255); - if ((x << 1 | 1) < dst_c_w) { - tmp[x << 1 | 1] = (unsigned char)OC_CLAMPI(0, (-3 * _aux[x - 1] + 50 * _aux[x] - + 86 * _aux[OC_MINI(x + 1, c_w - 1)] - 5 * _aux[c_w - 1] + 64) >> 7, 255); - } - } - tmp += dst_c_w; - _aux += c_w; - } - tmp -= tmp_sz; - /*Now do the vertical filtering.*/ - y4m_422jpeg_420jpeg_helper(_dst, tmp, dst_c_w, c_h); - _dst += dst_c_sz; - } -} - -/*Convert 444 to 420jpeg.*/ -static void y4m_convert_444_420jpeg(y4m_input *_y4m, unsigned char *_dst, - unsigned char *_aux) { - unsigned char *tmp; - int c_w; - int c_h; - int c_sz; - int dst_c_w; - int dst_c_h; - int dst_c_sz; - int tmp_sz; - int pli; - int y; - int x; - /*Skip past the luma data.*/ - _dst += _y4m->pic_w * _y4m->pic_h; - /*Compute the size of each chroma plane.*/ - c_w = (_y4m->pic_w + _y4m->src_c_dec_h - 1) / _y4m->src_c_dec_h; - c_h = _y4m->pic_h; - dst_c_w = (_y4m->pic_w + _y4m->dst_c_dec_h - 1) / _y4m->dst_c_dec_h; - dst_c_h = (_y4m->pic_h + _y4m->dst_c_dec_v - 1) / _y4m->dst_c_dec_v; - c_sz = c_w * c_h; - dst_c_sz = dst_c_w * dst_c_h; - tmp_sz = dst_c_w * c_h; - tmp = _aux + 2 * c_sz; - for (pli = 1; pli < 3; pli++) { - /*Filter: [3 -17 78 78 -17 3]/128, derived from a 6-tap Lanczos window.*/ - for (y = 0; y < c_h; y++) { - for (x = 0; x < OC_MINI(c_w, 2); x += 2) { - tmp[x >> 1] = OC_CLAMPI(0, (64 * _aux[0] + 78 * _aux[OC_MINI(1, c_w - 1)] - - 17 * _aux[OC_MINI(2, c_w - 1)] - + 3 * _aux[OC_MINI(3, c_w - 1)] + 64) >> 7, 255); - } - for (; x < c_w - 3; x += 2) { - tmp[x >> 1] = OC_CLAMPI(0, (3 * (_aux[x - 2] + _aux[x + 3]) - - 17 * (_aux[x - 1] + _aux[x + 2]) + 78 * (_aux[x] + _aux[x + 1]) + 64) >> 7, 255); - } - for (; x < c_w; x += 2) { - tmp[x >> 1] = OC_CLAMPI(0, (3 * (_aux[x - 2] + _aux[c_w - 1]) - - 17 * (_aux[x - 1] + _aux[OC_MINI(x + 2, c_w - 1)]) + - 78 * (_aux[x] + _aux[OC_MINI(x + 1, c_w - 1)]) + 64) >> 7, 255); - } - tmp += dst_c_w; - _aux += c_w; - } - tmp -= tmp_sz; - /*Now do the vertical filtering.*/ - y4m_422jpeg_420jpeg_helper(_dst, tmp, dst_c_w, c_h); - _dst += dst_c_sz; - } -} - -/*The image is padded with empty chroma components at 4:2:0.*/ -static void y4m_convert_mono_420jpeg(y4m_input *_y4m, unsigned char *_dst, - unsigned char *_aux) { - int c_sz; - (void)_aux; - _dst += _y4m->pic_w * _y4m->pic_h; - c_sz = ((_y4m->pic_w + _y4m->dst_c_dec_h - 1) / _y4m->dst_c_dec_h) * - ((_y4m->pic_h + _y4m->dst_c_dec_v - 1) / _y4m->dst_c_dec_v); - memset(_dst, 128, c_sz * 2); -} - -/*No conversion function needed.*/ -static void y4m_convert_null(y4m_input *_y4m, unsigned char *_dst, - unsigned char *_aux) { - (void)_y4m; - (void)_dst; - (void)_aux; -} - -int y4m_input_open(y4m_input *_y4m, FILE *_fin, char *_skip, int _nskip, - int only_420) { - char buffer[80] = {0}; - int ret; - int i; - /*Read until newline, or 80 cols, whichever happens first.*/ - for (i = 0; i < 79; i++) { - if (_nskip > 0) { - buffer[i] = *_skip++; - _nskip--; - } else { - if (!file_read(buffer + i, 1, _fin)) return -1; - } - if (buffer[i] == '\n')break; - } - /*We skipped too much header data.*/ - if (_nskip > 0)return -1; - if (i == 79) { - fprintf(stderr, "Error parsing header; not a YUV2MPEG2 file?\n"); - return -1; - } - buffer[i] = '\0'; - if (memcmp(buffer, "YUV4MPEG", 8)) { - fprintf(stderr, "Incomplete magic for YUV4MPEG file.\n"); - return -1; - } - if (buffer[8] != '2') { - fprintf(stderr, "Incorrect YUV input file version; YUV4MPEG2 required.\n"); - } - ret = y4m_parse_tags(_y4m, buffer + 5); - if (ret < 0) { - fprintf(stderr, "Error parsing YUV4MPEG2 header.\n"); - return ret; - } - if (_y4m->interlace == '?') { - fprintf(stderr, "Warning: Input video interlacing format unknown; " - "assuming progressive scan.\n"); - } else if (_y4m->interlace != 'p') { - fprintf(stderr, "Input video is interlaced; " - "Only progressive scan handled.\n"); - return -1; - } - _y4m->vpx_fmt = VPX_IMG_FMT_I420; - _y4m->bps = 12; - _y4m->bit_depth = 8; - if (strcmp(_y4m->chroma_type, "420") == 0 || - strcmp(_y4m->chroma_type, "420jpeg") == 0) { - _y4m->src_c_dec_h = _y4m->dst_c_dec_h = _y4m->src_c_dec_v = _y4m->dst_c_dec_v = 2; - _y4m->dst_buf_read_sz = _y4m->pic_w * _y4m->pic_h - + 2 * ((_y4m->pic_w + 1) / 2) * ((_y4m->pic_h + 1) / 2); - /* Natively supported: no conversion required. */ - _y4m->aux_buf_sz = _y4m->aux_buf_read_sz = 0; - _y4m->convert = y4m_convert_null; - } else if (strcmp(_y4m->chroma_type, "420p10") == 0) { - _y4m->src_c_dec_h = 2; - _y4m->dst_c_dec_h = 2; - _y4m->src_c_dec_v = 2; - _y4m->dst_c_dec_v = 2; - _y4m->dst_buf_read_sz = 2 * (_y4m->pic_w * _y4m->pic_h + - 2 * ((_y4m->pic_w + 1) / 2) * - ((_y4m->pic_h + 1) / 2)); - /* Natively supported: no conversion required. */ - _y4m->aux_buf_sz = _y4m->aux_buf_read_sz = 0; - _y4m->convert = y4m_convert_null; - _y4m->bit_depth = 10; - _y4m->bps = 15; - _y4m->vpx_fmt = VPX_IMG_FMT_I42016; - if (only_420) { - fprintf(stderr, "Unsupported conversion from 420p10 to 420jpeg\n"); - return -1; - } - } else if (strcmp(_y4m->chroma_type, "420p12") == 0) { - _y4m->src_c_dec_h = 2; - _y4m->dst_c_dec_h = 2; - _y4m->src_c_dec_v = 2; - _y4m->dst_c_dec_v = 2; - _y4m->dst_buf_read_sz = 2 * (_y4m->pic_w * _y4m->pic_h + - 2 * ((_y4m->pic_w + 1) / 2) * - ((_y4m->pic_h + 1) / 2)); - /* Natively supported: no conversion required. */ - _y4m->aux_buf_sz = _y4m->aux_buf_read_sz = 0; - _y4m->convert = y4m_convert_null; - _y4m->bit_depth = 12; - _y4m->bps = 18; - _y4m->vpx_fmt = VPX_IMG_FMT_I42016; - if (only_420) { - fprintf(stderr, "Unsupported conversion from 420p12 to 420jpeg\n"); - return -1; - } - } else if (strcmp(_y4m->chroma_type, "420mpeg2") == 0) { - _y4m->src_c_dec_h = _y4m->dst_c_dec_h = _y4m->src_c_dec_v = _y4m->dst_c_dec_v = 2; - _y4m->dst_buf_read_sz = _y4m->pic_w * _y4m->pic_h; - /*Chroma filter required: read into the aux buf first.*/ - _y4m->aux_buf_sz = _y4m->aux_buf_read_sz = - 2 * ((_y4m->pic_w + 1) / 2) * ((_y4m->pic_h + 1) / 2); - _y4m->convert = y4m_convert_42xmpeg2_42xjpeg; - } else if (strcmp(_y4m->chroma_type, "420paldv") == 0) { - _y4m->src_c_dec_h = _y4m->dst_c_dec_h = _y4m->src_c_dec_v = _y4m->dst_c_dec_v = 2; - _y4m->dst_buf_read_sz = _y4m->pic_w * _y4m->pic_h; - /*Chroma filter required: read into the aux buf first. - We need to make two filter passes, so we need some extra space in the - aux buffer.*/ - _y4m->aux_buf_sz = 3 * ((_y4m->pic_w + 1) / 2) * ((_y4m->pic_h + 1) / 2); - _y4m->aux_buf_read_sz = 2 * ((_y4m->pic_w + 1) / 2) * ((_y4m->pic_h + 1) / 2); - _y4m->convert = y4m_convert_42xpaldv_42xjpeg; - } else if (strcmp(_y4m->chroma_type, "422jpeg") == 0) { - _y4m->src_c_dec_h = _y4m->dst_c_dec_h = 2; - _y4m->src_c_dec_v = 1; - _y4m->dst_c_dec_v = 2; - _y4m->dst_buf_read_sz = _y4m->pic_w * _y4m->pic_h; - /*Chroma filter required: read into the aux buf first.*/ - _y4m->aux_buf_sz = _y4m->aux_buf_read_sz = 2 * ((_y4m->pic_w + 1) / 2) * _y4m->pic_h; - _y4m->convert = y4m_convert_422jpeg_420jpeg; - } else if (strcmp(_y4m->chroma_type, "422") == 0) { - _y4m->src_c_dec_h = 2; - _y4m->src_c_dec_v = 1; - if (only_420) { - _y4m->dst_c_dec_h = 2; - _y4m->dst_c_dec_v = 2; - _y4m->dst_buf_read_sz = _y4m->pic_w * _y4m->pic_h; - /*Chroma filter required: read into the aux buf first. - We need to make two filter passes, so we need some extra space in the - aux buffer.*/ - _y4m->aux_buf_read_sz = 2 * ((_y4m->pic_w + 1) / 2) * _y4m->pic_h; - _y4m->aux_buf_sz = _y4m->aux_buf_read_sz + - ((_y4m->pic_w + 1) / 2) * _y4m->pic_h; - _y4m->convert = y4m_convert_422_420jpeg; - } else { - _y4m->vpx_fmt = VPX_IMG_FMT_I422; - _y4m->bps = 16; - _y4m->dst_c_dec_h = _y4m->src_c_dec_h; - _y4m->dst_c_dec_v = _y4m->src_c_dec_v; - _y4m->dst_buf_read_sz = _y4m->pic_w * _y4m->pic_h - + 2 * ((_y4m->pic_w + 1) / 2) * _y4m->pic_h; - /*Natively supported: no conversion required.*/ - _y4m->aux_buf_sz = _y4m->aux_buf_read_sz = 0; - _y4m->convert = y4m_convert_null; - } - } else if (strcmp(_y4m->chroma_type, "422p10") == 0) { - _y4m->src_c_dec_h = 2; - _y4m->src_c_dec_v = 1; - _y4m->vpx_fmt = VPX_IMG_FMT_I42216; - _y4m->bps = 20; - _y4m->bit_depth = 10; - _y4m->dst_c_dec_h = _y4m->src_c_dec_h; - _y4m->dst_c_dec_v = _y4m->src_c_dec_v; - _y4m->dst_buf_read_sz = 2 * (_y4m->pic_w * _y4m->pic_h + - 2 * ((_y4m->pic_w + 1) / 2) * _y4m->pic_h); - _y4m->aux_buf_sz = _y4m->aux_buf_read_sz = 0; - _y4m->convert = y4m_convert_null; - if (only_420) { - fprintf(stderr, "Unsupported conversion from 422p10 to 420jpeg\n"); - return -1; - } - } else if (strcmp(_y4m->chroma_type, "422p12") == 0) { - _y4m->src_c_dec_h = 2; - _y4m->src_c_dec_v = 1; - _y4m->vpx_fmt = VPX_IMG_FMT_I42216; - _y4m->bps = 24; - _y4m->bit_depth = 12; - _y4m->dst_c_dec_h = _y4m->src_c_dec_h; - _y4m->dst_c_dec_v = _y4m->src_c_dec_v; - _y4m->dst_buf_read_sz = 2 * (_y4m->pic_w * _y4m->pic_h + - 2 * ((_y4m->pic_w + 1) / 2) * _y4m->pic_h); - _y4m->aux_buf_sz = _y4m->aux_buf_read_sz = 0; - _y4m->convert = y4m_convert_null; - if (only_420) { - fprintf(stderr, "Unsupported conversion from 422p12 to 420jpeg\n"); - return -1; - } - } else if (strcmp(_y4m->chroma_type, "411") == 0) { - _y4m->src_c_dec_h = 4; - _y4m->dst_c_dec_h = 2; - _y4m->src_c_dec_v = 1; - _y4m->dst_c_dec_v = 2; - _y4m->dst_buf_read_sz = _y4m->pic_w * _y4m->pic_h; - /*Chroma filter required: read into the aux buf first. - We need to make two filter passes, so we need some extra space in the - aux buffer.*/ - _y4m->aux_buf_read_sz = 2 * ((_y4m->pic_w + 3) / 4) * _y4m->pic_h; - _y4m->aux_buf_sz = _y4m->aux_buf_read_sz + ((_y4m->pic_w + 1) / 2) * _y4m->pic_h; - _y4m->convert = y4m_convert_411_420jpeg; - } else if (strcmp(_y4m->chroma_type, "444") == 0) { - _y4m->src_c_dec_h = 1; - _y4m->src_c_dec_v = 1; - if (only_420) { - _y4m->dst_c_dec_h = 2; - _y4m->dst_c_dec_v = 2; - _y4m->dst_buf_read_sz = _y4m->pic_w * _y4m->pic_h; - /*Chroma filter required: read into the aux buf first. - We need to make two filter passes, so we need some extra space in the - aux buffer.*/ - _y4m->aux_buf_read_sz = 2 * _y4m->pic_w * _y4m->pic_h; - _y4m->aux_buf_sz = _y4m->aux_buf_read_sz + - ((_y4m->pic_w + 1) / 2) * _y4m->pic_h; - _y4m->convert = y4m_convert_444_420jpeg; - } else { - _y4m->vpx_fmt = VPX_IMG_FMT_I444; - _y4m->bps = 24; - _y4m->dst_c_dec_h = _y4m->src_c_dec_h; - _y4m->dst_c_dec_v = _y4m->src_c_dec_v; - _y4m->dst_buf_read_sz = 3 * _y4m->pic_w * _y4m->pic_h; - /*Natively supported: no conversion required.*/ - _y4m->aux_buf_sz = _y4m->aux_buf_read_sz = 0; - _y4m->convert = y4m_convert_null; - } - } else if (strcmp(_y4m->chroma_type, "444p10") == 0) { - _y4m->src_c_dec_h = 1; - _y4m->src_c_dec_v = 1; - _y4m->vpx_fmt = VPX_IMG_FMT_I44416; - _y4m->bps = 30; - _y4m->bit_depth = 10; - _y4m->dst_c_dec_h = _y4m->src_c_dec_h; - _y4m->dst_c_dec_v = _y4m->src_c_dec_v; - _y4m->dst_buf_read_sz = 2 * 3 * _y4m->pic_w * _y4m->pic_h; - _y4m->aux_buf_sz = _y4m->aux_buf_read_sz = 0; - _y4m->convert = y4m_convert_null; - if (only_420) { - fprintf(stderr, "Unsupported conversion from 444p10 to 420jpeg\n"); - return -1; - } - } else if (strcmp(_y4m->chroma_type, "444p12") == 0) { - _y4m->src_c_dec_h = 1; - _y4m->src_c_dec_v = 1; - _y4m->vpx_fmt = VPX_IMG_FMT_I44416; - _y4m->bps = 36; - _y4m->bit_depth = 12; - _y4m->dst_c_dec_h = _y4m->src_c_dec_h; - _y4m->dst_c_dec_v = _y4m->src_c_dec_v; - _y4m->dst_buf_read_sz = 2 * 3 * _y4m->pic_w * _y4m->pic_h; - _y4m->aux_buf_sz = _y4m->aux_buf_read_sz = 0; - _y4m->convert = y4m_convert_null; - if (only_420) { - fprintf(stderr, "Unsupported conversion from 444p12 to 420jpeg\n"); - return -1; - } - } else if (strcmp(_y4m->chroma_type, "444alpha") == 0) { - _y4m->src_c_dec_h = 1; - _y4m->src_c_dec_v = 1; - if (only_420) { - _y4m->dst_c_dec_h = 2; - _y4m->dst_c_dec_v = 2; - _y4m->dst_buf_read_sz = _y4m->pic_w * _y4m->pic_h; - /*Chroma filter required: read into the aux buf first. - We need to make two filter passes, so we need some extra space in the - aux buffer. - The extra plane also gets read into the aux buf. - It will be discarded.*/ - _y4m->aux_buf_sz = _y4m->aux_buf_read_sz = 3 * _y4m->pic_w * _y4m->pic_h; - _y4m->convert = y4m_convert_444_420jpeg; - } else { - _y4m->vpx_fmt = VPX_IMG_FMT_444A; - _y4m->bps = 32; - _y4m->dst_c_dec_h = _y4m->src_c_dec_h; - _y4m->dst_c_dec_v = _y4m->src_c_dec_v; - _y4m->dst_buf_read_sz = 4 * _y4m->pic_w * _y4m->pic_h; - /*Natively supported: no conversion required.*/ - _y4m->aux_buf_sz = _y4m->aux_buf_read_sz = 0; - _y4m->convert = y4m_convert_null; - } - } else if (strcmp(_y4m->chroma_type, "mono") == 0) { - _y4m->src_c_dec_h = _y4m->src_c_dec_v = 0; - _y4m->dst_c_dec_h = _y4m->dst_c_dec_v = 2; - _y4m->dst_buf_read_sz = _y4m->pic_w * _y4m->pic_h; - /*No extra space required, but we need to clear the chroma planes.*/ - _y4m->aux_buf_sz = _y4m->aux_buf_read_sz = 0; - _y4m->convert = y4m_convert_mono_420jpeg; - } else { - fprintf(stderr, "Unknown chroma sampling type: %s\n", _y4m->chroma_type); - return -1; - } - /*The size of the final frame buffers is always computed from the - destination chroma decimation type.*/ - _y4m->dst_buf_sz = _y4m->pic_w * _y4m->pic_h - + 2 * ((_y4m->pic_w + _y4m->dst_c_dec_h - 1) / _y4m->dst_c_dec_h) * - ((_y4m->pic_h + _y4m->dst_c_dec_v - 1) / _y4m->dst_c_dec_v); - if (_y4m->bit_depth == 8) - _y4m->dst_buf = (unsigned char *)malloc(_y4m->dst_buf_sz); - else - _y4m->dst_buf = (unsigned char *)malloc(2 * _y4m->dst_buf_sz); - - if (_y4m->aux_buf_sz > 0) - _y4m->aux_buf = (unsigned char *)malloc(_y4m->aux_buf_sz); - return 0; -} - -void y4m_input_close(y4m_input *_y4m) { - free(_y4m->dst_buf); - free(_y4m->aux_buf); -} - -int y4m_input_fetch_frame(y4m_input *_y4m, FILE *_fin, vpx_image_t *_img) { - char frame[6]; - int pic_sz; - int c_w; - int c_h; - int c_sz; - int bytes_per_sample = _y4m->bit_depth > 8 ? 2 : 1; - /*Read and skip the frame header.*/ - if (!file_read(frame, 6, _fin)) return 0; - if (memcmp(frame, "FRAME", 5)) { - fprintf(stderr, "Loss of framing in Y4M input data\n"); - return -1; - } - if (frame[5] != '\n') { - char c; - int j; - for (j = 0; j < 79 && file_read(&c, 1, _fin) && c != '\n'; j++) {} - if (j == 79) { - fprintf(stderr, "Error parsing Y4M frame header\n"); - return -1; - } - } - /*Read the frame data that needs no conversion.*/ - if (!file_read(_y4m->dst_buf, _y4m->dst_buf_read_sz, _fin)) { - fprintf(stderr, "Error reading Y4M frame data.\n"); - return -1; - } - /*Read the frame data that does need conversion.*/ - if (!file_read(_y4m->aux_buf, _y4m->aux_buf_read_sz, _fin)) { - fprintf(stderr, "Error reading Y4M frame data.\n"); - return -1; - } - /*Now convert the just read frame.*/ - (*_y4m->convert)(_y4m, _y4m->dst_buf, _y4m->aux_buf); - /*Fill in the frame buffer pointers. - We don't use vpx_img_wrap() because it forces padding for odd picture - sizes, which would require a separate fread call for every row.*/ - memset(_img, 0, sizeof(*_img)); - /*Y4M has the planes in Y'CbCr order, which libvpx calls Y, U, and V.*/ - _img->fmt = _y4m->vpx_fmt; - _img->w = _img->d_w = _y4m->pic_w; - _img->h = _img->d_h = _y4m->pic_h; - _img->x_chroma_shift = _y4m->dst_c_dec_h >> 1; - _img->y_chroma_shift = _y4m->dst_c_dec_v >> 1; - _img->bps = _y4m->bps; - - /*Set up the buffer pointers.*/ - pic_sz = _y4m->pic_w * _y4m->pic_h * bytes_per_sample; - c_w = (_y4m->pic_w + _y4m->dst_c_dec_h - 1) / _y4m->dst_c_dec_h; - c_w *= bytes_per_sample; - c_h = (_y4m->pic_h + _y4m->dst_c_dec_v - 1) / _y4m->dst_c_dec_v; - c_sz = c_w * c_h; - _img->stride[VPX_PLANE_Y] = _img->stride[VPX_PLANE_ALPHA] = - _y4m->pic_w * bytes_per_sample; - _img->stride[VPX_PLANE_U] = _img->stride[VPX_PLANE_V] = c_w; - _img->planes[VPX_PLANE_Y] = _y4m->dst_buf; - _img->planes[VPX_PLANE_U] = _y4m->dst_buf + pic_sz; - _img->planes[VPX_PLANE_V] = _y4m->dst_buf + pic_sz + c_sz; - _img->planes[VPX_PLANE_ALPHA] = _y4m->dst_buf + pic_sz + 2 * c_sz; - return 1; -} diff -Nru gstreamer-vaapi-0.7.0/ext/libvpx/upstream/y4minput.h gstreamer-vaapi-1.8.2/ext/libvpx/upstream/y4minput.h --- gstreamer-vaapi-0.7.0/ext/libvpx/upstream/y4minput.h 2015-12-07 10:54:14.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/libvpx/upstream/y4minput.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - * - * Based on code from the OggTheora software codec source code, - * Copyright (C) 2002-2010 The Xiph.Org Foundation and contributors. - */ - -#ifndef Y4MINPUT_H_ -#define Y4MINPUT_H_ - -# include -# include "vpx/vpx_image.h" - -#ifdef __cplusplus -extern "C" { -#endif - - - -typedef struct y4m_input y4m_input; - - - -/*The function used to perform chroma conversion.*/ -typedef void (*y4m_convert_func)(y4m_input *_y4m, - unsigned char *_dst, unsigned char *_src); - - - -struct y4m_input { - int pic_w; - int pic_h; - int fps_n; - int fps_d; - int par_n; - int par_d; - char interlace; - int src_c_dec_h; - int src_c_dec_v; - int dst_c_dec_h; - int dst_c_dec_v; - char chroma_type[16]; - /*The size of each converted frame buffer.*/ - size_t dst_buf_sz; - /*The amount to read directly into the converted frame buffer.*/ - size_t dst_buf_read_sz; - /*The size of the auxilliary buffer.*/ - size_t aux_buf_sz; - /*The amount to read into the auxilliary buffer.*/ - size_t aux_buf_read_sz; - y4m_convert_func convert; - unsigned char *dst_buf; - unsigned char *aux_buf; - enum vpx_img_fmt vpx_fmt; - int bps; - unsigned int bit_depth; -}; - -int y4m_input_open(y4m_input *_y4m, FILE *_fin, char *_skip, int _nskip, - int only_420); -void y4m_input_close(y4m_input *_y4m); -int y4m_input_fetch_frame(y4m_input *_y4m, FILE *_fin, vpx_image_t *img); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // Y4MINPUT_H_ diff -Nru gstreamer-vaapi-0.7.0/ext/Makefile.am gstreamer-vaapi-1.8.2/ext/Makefile.am --- gstreamer-vaapi-0.7.0/ext/Makefile.am 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -SUBDIRS = libvpx - -EXTRA_DIST = - -codecparsers_srcdir = \ - $(top_srcdir)/ext/codecparsers/gst-libs/gst/codecparsers - -codecparsers_source_c = \ - dboolhuff.c \ - gsth264parser.c \ - gstjpegparser.c \ - gstmpeg4parser.c \ - gstmpegvideoparser.c \ - gstvc1parser.c \ - gstvp8parser.c \ - gstvp8rangedecoder.c \ - nalutils.c \ - parserutils.c \ - vp8utils.c \ - gsth265parser.c \ - gstvp9parser.c \ - vp9utils.c \ - $(NULL) - -EXTRA_DIST += $(codecparsers_source_c:%.c=$(codecparsers_srcdir)/%.c) - -codecparsers_source_h = \ - dboolhuff.h \ - gsth264parser.h \ - gstjpegparser.h \ - gstmpeg4parser.h \ - gstmpegvideoparser.h \ - gstvc1parser.h \ - gstvp8parser.h \ - gstvp8rangedecoder.h \ - nalutils.h \ - parserutils.h \ - vp8utils.h \ - gsth265parser.h \ - gstvp9parser.h \ - vp9utils.h \ - $(NULL) - -EXTRA_DIST += $(codecparsers_source_h:%.h=$(codecparsers_srcdir)/%.h) - -videoparsers_srcdir = \ - $(top_srcdir)/ext/codecparsers/gst/videoparsers - -videoparsers_source_c = \ - gsth264parse.c \ - gsth265parse.c \ - $(NULL) - -EXTRA_DIST += $(videoparsers_source_c:%.c=$(videoparsers_srcdir)/%.c) - -videoparsers_source_h = \ - gsth264parse.h \ - gsth265parse.h \ - $(NULL) - -EXTRA_DIST += $(videoparsers_source_h:%.h=$(videoparsers_srcdir)/%.h) - --include $(top_srcdir)/git.mk diff -Nru gstreamer-vaapi-0.7.0/ext/Makefile.in gstreamer-vaapi-1.8.2/ext/Makefile.in --- gstreamer-vaapi-0.7.0/ext/Makefile.in 2015-12-07 10:54:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/ext/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,760 +0,0 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2014 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -subdir = ext -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -am__recursive_targets = \ - $(RECURSIVE_TARGETS) \ - $(RECURSIVE_CLEAN_TARGETS) \ - $(am__extra_recursive_targets) -AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -am__DIST_COMMON = $(srcdir)/Makefile.in -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DLOPEN_LIBS = @DLOPEN_LIBS@ -DRM_CFLAGS = @DRM_CFLAGS@ -DRM_LIBS = @DRM_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGL_CFLAGS = @EGL_CFLAGS@ -EGL_LIBS = @EGL_LIBS@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GIT = @GIT@ -GLES2_CFLAGS = @GLES2_CFLAGS@ -GLES2_LIBS = @GLES2_LIBS@ -GLES3_CFLAGS = @GLES3_CFLAGS@ -GLES3_LIBS = @GLES3_LIBS@ -GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_LIBS = @GLIB_LIBS@ -GLIB_VERSION_REQUIRED = @GLIB_VERSION_REQUIRED@ -GL_CFLAGS = @GL_CFLAGS@ -GL_LIBS = @GL_LIBS@ -GMODULE_CFLAGS = @GMODULE_CFLAGS@ -GMODULE_LIBS = @GMODULE_LIBS@ -GMODULE_VERSION_REQUIRED = @GMODULE_VERSION_REQUIRED@ -GREP = @GREP@ -GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ -GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ -GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ -GST_API_VERSION = @GST_API_VERSION@ -GST_BASEVIDEO_CFLAGS = @GST_BASEVIDEO_CFLAGS@ -GST_BASEVIDEO_LIBS = @GST_BASEVIDEO_LIBS@ -GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ -GST_BASE_LIBS = @GST_BASE_LIBS@ -GST_CFLAGS = @GST_CFLAGS@ -GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ -GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ -GST_GL_CFLAGS = @GST_GL_CFLAGS@ -GST_GL_LIBS = @GST_GL_LIBS@ -GST_INTERFACES_CFLAGS = @GST_INTERFACES_CFLAGS@ -GST_INTERFACES_LIBS = @GST_INTERFACES_LIBS@ -GST_LIBS = @GST_LIBS@ -GST_PKG_VERSION = @GST_PKG_VERSION@ -GST_PLUGINS_BAD_VERSION_REQUIRED = @GST_PLUGINS_BAD_VERSION_REQUIRED@ -GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ -GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ -GST_PLUGINS_BASE_VERSION_REQUIRED = @GST_PLUGINS_BASE_VERSION_REQUIRED@ -GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ -GST_PLUGIN_PATH_1_0 = @GST_PLUGIN_PATH_1_0@ -GST_VAAPI_LT_LDFLAGS = @GST_VAAPI_LT_LDFLAGS@ -GST_VAAPI_LT_VERSION = @GST_VAAPI_LT_VERSION@ -GST_VAAPI_MAJOR_VERSION = @GST_VAAPI_MAJOR_VERSION@ -GST_VERSION_REQUIRED = @GST_VERSION_REQUIRED@ -GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ -GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ -GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ -GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ -GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ -GTKDOC_MKPDF = @GTKDOC_MKPDF@ -GTKDOC_REBASE = @GTKDOC_REBASE@ -GTKDOC_VERSION = @GTKDOC_VERSION@ -HTML_DIR = @HTML_DIR@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBVA_CFLAGS = @LIBVA_CFLAGS@ -LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ -LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ -LIBVA_LIBS = @LIBVA_LIBS@ -LIBVA_PACKAGE_VERSION = @LIBVA_PACKAGE_VERSION@ -LIBVA_PKGNAME = @LIBVA_PKGNAME@ -LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ -LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ -LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ -LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ -LIBVA_X11_PKGNAME = @LIBVA_X11_PKGNAME@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATCH = @PATCH@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TODAY = @TODAY@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ -VERSION = @VERSION@ -WAYLAND_API_VERSION = @WAYLAND_API_VERSION@ -WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ -WAYLAND_LIBS = @WAYLAND_LIBS@ -X11_CFLAGS = @X11_CFLAGS@ -X11_LIBS = @X11_LIBS@ -XRANDR_CFLAGS = @XRANDR_CFLAGS@ -XRANDR_LIBS = @XRANDR_LIBS@ -XRENDER_CFLAGS = @XRENDER_CFLAGS@ -XRENDER_LIBS = @XRENDER_LIBS@ -YASM = @YASM@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ -plugindir = @plugindir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -SUBDIRS = libvpx -EXTRA_DIST = $(codecparsers_source_c:%.c=$(codecparsers_srcdir)/%.c) \ - $(codecparsers_source_h:%.h=$(codecparsers_srcdir)/%.h) \ - $(videoparsers_source_c:%.c=$(videoparsers_srcdir)/%.c) \ - $(videoparsers_source_h:%.h=$(videoparsers_srcdir)/%.h) -codecparsers_srcdir = \ - $(top_srcdir)/ext/codecparsers/gst-libs/gst/codecparsers - -codecparsers_source_c = \ - dboolhuff.c \ - gsth264parser.c \ - gstjpegparser.c \ - gstmpeg4parser.c \ - gstmpegvideoparser.c \ - gstvc1parser.c \ - gstvp8parser.c \ - gstvp8rangedecoder.c \ - nalutils.c \ - parserutils.c \ - vp8utils.c \ - gsth265parser.c \ - gstvp9parser.c \ - vp9utils.c \ - $(NULL) - -codecparsers_source_h = \ - dboolhuff.h \ - gsth264parser.h \ - gstjpegparser.h \ - gstmpeg4parser.h \ - gstmpegvideoparser.h \ - gstvc1parser.h \ - gstvp8parser.h \ - gstvp8rangedecoder.h \ - nalutils.h \ - parserutils.h \ - vp8utils.h \ - gsth265parser.h \ - gstvp9parser.h \ - vp9utils.h \ - $(NULL) - -videoparsers_srcdir = \ - $(top_srcdir)/ext/codecparsers/gst/videoparsers - -videoparsers_source_c = \ - gsth264parse.c \ - gsth265parse.c \ - $(NULL) - -videoparsers_source_h = \ - gsth264parse.h \ - gsth265parse.h \ - $(NULL) - -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ext/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu ext/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(am__recursive_targets): - @fail=; \ - if $(am__make_keepgoing); then \ - failcom='fail=yes'; \ - else \ - failcom='exit 1'; \ - fi; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-recursive -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-recursive - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-recursive - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: - -.MAKE: $(am__recursive_targets) install-am install-strip - -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ - check-am clean clean-generic clean-libtool cscopelist-am ctags \ - ctags-am distclean distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-am uninstall uninstall-am - -.PRECIOUS: Makefile - - --include $(top_srcdir)/git.mk - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru gstreamer-vaapi-0.7.0/gst/Makefile.in gstreamer-vaapi-1.8.2/gst/Makefile.in --- gstreamer-vaapi-0.7.0/gst/Makefile.in 2015-12-07 10:54:25.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/Makefile.in 2016-06-09 07:27:12.000000000 +0000 @@ -90,10 +90,27 @@ target_triplet = @target@ subdir = gst ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-arch.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-platform.m4 \ + $(top_srcdir)/common/m4/gst-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -184,9 +201,11 @@ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ +AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -199,6 +218,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DRM_CFLAGS = @DRM_CFLAGS@ @@ -211,58 +231,64 @@ EGL_CFLAGS = @EGL_CFLAGS@ EGL_LIBS = @EGL_LIBS@ EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ GIT = @GIT@ GLES2_CFLAGS = @GLES2_CFLAGS@ GLES2_LIBS = @GLES2_LIBS@ GLES3_CFLAGS = @GLES3_CFLAGS@ GLES3_LIBS = @GLES3_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ -GLIB_VERSION_REQUIRED = @GLIB_VERSION_REQUIRED@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ -GMODULE_VERSION_REQUIRED = @GMODULE_VERSION_REQUIRED@ GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ GST_API_VERSION = @GST_API_VERSION@ -GST_BASEVIDEO_CFLAGS = @GST_BASEVIDEO_CFLAGS@ -GST_BASEVIDEO_LIBS = @GST_BASEVIDEO_LIBS@ GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ GST_BASE_LIBS = @GST_BASE_LIBS@ GST_CFLAGS = @GST_CFLAGS@ GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ +GST_CURRENT = @GST_CURRENT@ GST_GL_CFLAGS = @GST_GL_CFLAGS@ GST_GL_LIBS = @GST_GL_LIBS@ -GST_INTERFACES_CFLAGS = @GST_INTERFACES_CFLAGS@ -GST_INTERFACES_LIBS = @GST_INTERFACES_LIBS@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ GST_LIBS = @GST_LIBS@ -GST_PKG_VERSION = @GST_PKG_VERSION@ -GST_PLUGINS_BAD_VERSION_REQUIRED = @GST_PLUGINS_BAD_VERSION_REQUIRED@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PBUTILS_CFLAGS = @GST_PBUTILS_CFLAGS@ +GST_PBUTILS_LIBS = @GST_PBUTILS_LIBS@ GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ -GST_PLUGINS_BASE_VERSION_REQUIRED = @GST_PLUGINS_BASE_VERSION_REQUIRED@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ -GST_PLUGIN_PATH_1_0 = @GST_PLUGIN_PATH_1_0@ -GST_VAAPI_LT_LDFLAGS = @GST_VAAPI_LT_LDFLAGS@ -GST_VAAPI_LT_VERSION = @GST_VAAPI_LT_VERSION@ -GST_VAAPI_MAJOR_VERSION = @GST_VAAPI_MAJOR_VERSION@ -GST_VERSION_REQUIRED = @GST_VERSION_REQUIRED@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ -GTKDOC_VERSION = @GTKDOC_VERSION@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -271,6 +297,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -278,16 +305,15 @@ LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ LIBVA_LIBS = @LIBVA_LIBS@ -LIBVA_PACKAGE_VERSION = @LIBVA_PACKAGE_VERSION@ -LIBVA_PKGNAME = @LIBVA_PKGNAME@ LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ -LIBVA_X11_PKGNAME = @LIBVA_X11_PKGNAME@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -304,21 +330,27 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ -PATCH = @PATCH@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ -TODAY = @TODAY@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ VERSION = @VERSION@ -WAYLAND_API_VERSION = @WAYLAND_API_VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ WAYLAND_LIBS = @WAYLAND_LIBS@ X11_CFLAGS = @X11_CFLAGS@ @@ -327,7 +359,6 @@ XRANDR_LIBS = @XRANDR_LIBS@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ -YASM = @YASM@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -369,11 +400,15 @@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ plugindir = @plugindir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -390,7 +425,7 @@ all: all-recursive .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -414,9 +449,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/gstcompat.h gstreamer-vaapi-1.8.2/gst/vaapi/gstcompat.h --- gstreamer-vaapi-0.7.0/gst/vaapi/gstcompat.h 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/gstcompat.h 2016-03-24 11:36:59.000000000 +0000 @@ -25,27 +25,4 @@ #include "gst/vaapi/sysdeps.h" -#if !GST_CHECK_VERSION (1,5,0) -static inline GstBuffer * -gst_buffer_copy_deep (const GstBuffer * buffer) -{ - GstBuffer *copy; - - g_return_val_if_fail (buffer != NULL, NULL); - - copy = gst_buffer_new (); - - if (!gst_buffer_copy_into (copy, (GstBuffer *) buffer, - GST_BUFFER_COPY_ALL | GST_BUFFER_COPY_DEEP, 0, -1)) - gst_buffer_replace (©, NULL); - -#if GST_CHECK_VERSION (1,4,0) - if (copy) - GST_BUFFER_FLAG_UNSET (copy, GST_BUFFER_FLAG_TAG_MEMORY); -#endif - - return copy; -} -#endif - #endif /* GST_COMPAT_H */ diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapi.c gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapi.c --- gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapi.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapi.c 2016-03-24 11:36:59.000000000 +0000 @@ -53,36 +53,34 @@ static gboolean plugin_init (GstPlugin * plugin) { - gst_element_register (plugin, "vaapidecode", - GST_RANK_PRIMARY + 1, GST_TYPE_VAAPIDECODE); + gst_vaapidecode_register (plugin); + gst_element_register (plugin, "vaapipostproc", GST_RANK_PRIMARY, GST_TYPE_VAAPIPOSTPROC); gst_element_register (plugin, "vaapisink", GST_RANK_PRIMARY, GST_TYPE_VAAPISINK); #if USE_ENCODERS - gst_element_register (plugin, "vaapiencode_h264", + gst_element_register (plugin, "vaapih264enc", GST_RANK_PRIMARY, GST_TYPE_VAAPIENCODE_H264); - gst_element_register (plugin, "vaapiencode_mpeg2", + gst_element_register (plugin, "vaapimpeg2enc", GST_RANK_PRIMARY, GST_TYPE_VAAPIENCODE_MPEG2); #endif #if USE_JPEG_ENCODER - gst_element_register (plugin, "vaapiencode_jpeg", + gst_element_register (plugin, "vaapijpegenc", GST_RANK_PRIMARY, GST_TYPE_VAAPIENCODE_JPEG); #endif #if USE_VP8_ENCODER - gst_element_register (plugin, "vaapiencode_vp8", + gst_element_register (plugin, "vaapivp8enc", GST_RANK_PRIMARY, GST_TYPE_VAAPIENCODE_VP8); #endif #if USE_H265_ENCODER - gst_element_register (plugin, "vaapiencode_h265", + gst_element_register (plugin, "vaapih265enc", GST_RANK_PRIMARY, GST_TYPE_VAAPIENCODE_H265); #endif -#if GST_CHECK_VERSION(1,4,0) gst_element_register (plugin, "vaapidecodebin", GST_RANK_PRIMARY + 2, GST_TYPE_VAAPI_DECODE_BIN); -#endif return TRUE; } diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapidecodebin.c gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapidecodebin.c --- gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapidecodebin.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapidecodebin.c 2016-03-24 11:36:59.000000000 +0000 @@ -21,6 +21,26 @@ * Boston, MA 02110-1301 USA */ +/** + * SECTION:element-vaapidecodebin + * @short_description: A VA-API based video decoder with a + * post-processor + * + * vaapidecodebin is similar #GstVaapiDecode, but it is composed by + * the vaapidecode, a #GstQueue, and the #GstVaapiPostproc, if it is + * available and functional in the setup. + * + * It offers the functionality of #GstVaapiDecode and the many options + * of #GstVaapiPostproc. + * + * + * Example launch line + * |[ + * gst-launch-1.0 filesrc location=~/big_buck_bunny.mov ! qtdemux ! h264parse ! vaapidecodebin ! vaapisink + * ]| + * + */ + #include "gstcompat.h" #include #include @@ -32,7 +52,7 @@ #include "gstvaapipluginbase.h" #define GST_PLUGIN_NAME "vaapidecodebin" -#define GST_PLUGIN_DESC "A Bin of VA-API elements: vaapidecode ! queue ! vaapipostproc" +#define GST_PLUGIN_DESC "A VA-API based bin with a decoder and a postprocessor" GST_DEBUG_CATEGORY_STATIC (gst_debug_vaapi_decode_bin); #define GST_CAT_DEFAULT gst_debug_vaapi_decode_bin @@ -79,9 +99,6 @@ #if USE_VP8_DECODER GST_CAPS_CODEC("video/x-vp8") #endif -#if USE_JPEG_DECODER - GST_CAPS_CODEC("image/jpeg") -#endif ; /* *INDENT-ON* */ @@ -211,7 +228,7 @@ return FALSE; vaapidecbin->has_vpp = gst_vaapi_display_has_video_processing (display) ? - HAS_VPP_YES : HAS_VPP_NO; + HAS_VPP_YES : HAS_VPP_NO; gst_vaapi_display_unref (display); @@ -219,7 +236,7 @@ } static gboolean -gst_vaapi_decode_bin_reconfigure (GstVaapiDecodeBin* vaapidecbin) +gst_vaapi_decode_bin_reconfigure (GstVaapiDecodeBin * vaapidecbin) { if (!ensure_vpp (vaapidecbin)) return FALSE; @@ -325,7 +342,7 @@ goto bail; vaapidecbin->has_vpp = gst_vaapi_display_has_video_processing (display) ? - HAS_VPP_YES : HAS_VPP_NO; + HAS_VPP_YES : HAS_VPP_NO; /* the underlying VA driver implementation doesn't support video * post-processing, hence we have to disable it */ @@ -362,7 +379,7 @@ } ret = GST_ELEMENT_CLASS (gst_vaapi_decode_bin_parent_class)->change_state - (element, transition); + (element, transition); if (ret == GST_STATE_CHANGE_FAILURE) return ret; @@ -441,11 +458,16 @@ static gboolean gst_vaapi_decode_bin_configure (GstVaapiDecodeBin * vaapidecbin) { - gchar *missing_factory = NULL; + const gchar *missing_factory = NULL; GstPad *pad, *ghostpad; GstPadTemplate *tmpl; /* create the decoder */ + /* @FIXME: "vaapidecode" is going to be removed soon: (bug + * #734093). Instead there are going to be a set of elements + * "vaapi{codec}dec". We will need a mechanism to automatically + * select de correct decoder based on caps. + */ vaapidecbin->decoder = gst_element_factory_make ("vaapidecode", "vaapidecode"); if (!vaapidecbin->decoder) { diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapidecode.c gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapidecode.c --- gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapidecode.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapidecode.c 2016-03-24 11:36:59.000000000 +0000 @@ -23,11 +23,28 @@ */ /** - * SECTION:gstvaapidecode + * SECTION:element-vaapidecode * @short_description: A VA-API based video decoder * * vaapidecode decodes from raw bitstreams to surfaces suitable for - * the vaapisink element. + * the vaapisink or vaapipostproc elements using the installed VA-API + * back-end. + * + * In the case of OpenGL based elements, the buffers have the + * #GstVideoGLTextureUploadMeta meta, which efficiently copies the + * content of the VA-API surface into a GL texture. + * + * Also it can deliver normal video buffers that can be rendered or + * processed by other elements, but the performance would be rather + * bad. + * + * + * Example launch line + * |[ + * gst-launch-1.0 filesrc location=~/big_buck_bunny.mov ! qtdemux ! h264parse ! vaapidecode ! vaapisink + * ]| + * */ #include "gstcompat.h" @@ -59,6 +76,9 @@ GST_DEBUG_CATEGORY_STATIC (gst_debug_vaapidecode); #define GST_CAT_DEFAULT gst_debug_vaapidecode +#define GST_VAAPI_DECODE_PARAMS_QDATA \ + g_quark_from_static_string("vaapidec-params") + /* Default templates */ #define GST_CAPS_CODEC(CODEC) CODEC "; " @@ -77,9 +97,6 @@ #if USE_VP8_DECODER GST_CAPS_CODEC("video/x-vp8") #endif -#if USE_JPEG_DECODER - GST_CAPS_CODEC("image/jpeg") -#endif #if USE_VP9_DECODER GST_CAPS_CODEC("video/x-vp9") #endif @@ -90,39 +107,38 @@ GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS ";" GST_VIDEO_CAPS_MAKE("{ I420, YV12, NV12 }"); -static GstStaticPadTemplate gst_vaapidecode_sink_factory = - GST_STATIC_PAD_TEMPLATE( - "sink", - GST_PAD_SINK, - GST_PAD_ALWAYS, - GST_STATIC_CAPS(gst_vaapidecode_sink_caps_str)); - static GstStaticPadTemplate gst_vaapidecode_src_factory = GST_STATIC_PAD_TEMPLATE( "src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS(gst_vaapidecode_src_caps_str)); - -G_DEFINE_TYPE_WITH_CODE( - GstVaapiDecode, - gst_vaapidecode, - GST_TYPE_VIDEO_DECODER, - GST_VAAPI_PLUGIN_BASE_INIT_INTERFACES) /* *INDENT-ON* */ -static gboolean -gst_vaapidecode_update_sink_caps (GstVaapiDecode * decode, GstCaps * caps); -static gboolean gst_vaapidecode_update_src_caps (GstVaapiDecode * decode); +typedef struct _GstVaapiDecoderMap GstVaapiDecoderMap; +struct _GstVaapiDecoderMap +{ + guint codec; + guint rank; + const gchar *name; + const gchar *caps_str; +}; -static gboolean -gst_vaapi_decode_input_state_replace (GstVaapiDecode * decode, - const GstVideoCodecState * new_state); +static const GstVaapiDecoderMap vaapi_decode_map[] = { +#if USE_JPEG_DECODER + {GST_VAAPI_CODEC_JPEG, GST_RANK_MARGINAL, "jpeg", "image/jpeg"}, +#endif + {0 /* the rest */ , GST_RANK_PRIMARY + 1, NULL, + gst_vaapidecode_sink_caps_str}, +}; -static gboolean -gst_vaapidecode_sink_query (GstVideoDecoder * vdec, GstQuery * query); -static gboolean -gst_vaapidecode_src_query (GstVideoDecoder * vdec, GstQuery * query); +static GstElementClass *parent_class = NULL; + +static gboolean gst_vaapidecode_update_sink_caps (GstVaapiDecode * decode, + GstCaps * caps); +static gboolean gst_vaapi_decode_input_state_replace (GstVaapiDecode * decode, + const GstVideoCodecState * new_state); +static gboolean gst_vaapidecode_negotiate (GstVaapiDecode * decode); static void gst_vaapi_decoder_state_changed (GstVaapiDecoder * decoder, @@ -196,17 +212,18 @@ { GstVideoDecoder *const vdec = GST_VIDEO_DECODER (decode); GstVideoCodecState *state, *ref_state; + GstVaapiCapsFeature feature; + GstCapsFeatures *features = NULL; GstVideoInfo *vi; GstVideoFormat format = GST_VIDEO_FORMAT_I420; + GstClockTime latency; + gint fps_d, fps_n; if (!decode->input_state) return FALSE; ref_state = decode->input_state; - GstCapsFeatures *features = NULL; - GstVaapiCapsFeature feature; - feature = gst_vaapi_find_preferred_caps_feature (GST_VIDEO_DECODER_SRC_PAD (vdec), GST_VIDEO_INFO_FORMAT (&ref_state->info), &format); @@ -222,20 +239,23 @@ (GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META, NULL); break; #endif -#if GST_CHECK_VERSION(1,3,1) case GST_VAAPI_CAPS_FEATURE_VAAPI_SURFACE: features = gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE, NULL); break; -#endif default: break; } state = gst_video_decoder_set_output_state (vdec, format, ref_state->info.width, ref_state->info.height, ref_state); - if (!state || state->info.width == 0 || state->info.height == 0) + if (!state || state->info.width == 0 || state->info.height == 0) { + if (features) + gst_caps_features_free (features); + if (state) + gst_video_codec_state_unref (state); return FALSE; + } vi = &state->info; @@ -246,8 +266,8 @@ gst_caps_replace (&decode->srcpad_caps, state->caps); gst_video_codec_state_unref (state); - gint fps_n = GST_VIDEO_INFO_FPS_N (vi); - gint fps_d = GST_VIDEO_INFO_FPS_D (vi); + fps_n = GST_VIDEO_INFO_FPS_N (vi); + fps_d = GST_VIDEO_INFO_FPS_D (vi); if (fps_n <= 0 || fps_d <= 0) { GST_DEBUG_OBJECT (decode, "forcing 25/1 framerate for latency calculation"); fps_n = 25; @@ -258,7 +278,7 @@ * latency in general, with perfectly known unit boundaries (NALU, * AU), and up to 2 frames when we need to wait for the second frame * start to determine the first frame is complete */ - GstClockTime latency = gst_util_uint64_scale (2 * GST_SECOND, fps_d, fps_n); + latency = gst_util_uint64_scale (2 * GST_SECOND, fps_d, fps_n); gst_video_decoder_set_latency (vdec, latency, latency); return TRUE; @@ -273,6 +293,28 @@ gst_object_unref (decode); } +static gboolean +is_surface_resolution_changed (GstVideoDecoder * vdec, + GstVaapiSurface * surface) +{ + guint surface_width, surface_height; + guint configured_width, configured_height; + GstVideoCodecState *state; + gboolean ret = FALSE; + + gst_vaapi_surface_get_size (surface, &surface_width, &surface_height); + + state = gst_video_decoder_get_output_state (vdec); + configured_width = GST_VIDEO_INFO_WIDTH (&state->info); + configured_height = GST_VIDEO_INFO_HEIGHT (&state->info); + gst_video_codec_state_unref (state); + + if (surface_width != configured_width || surface_height != configured_height) + ret = TRUE; + + return ret; +} + static GstFlowReturn gst_vaapidecode_push_decoded_frame (GstVideoDecoder * vdec, GstVideoCodecFrame * out_frame) @@ -287,6 +329,11 @@ if (!GST_VIDEO_CODEC_FRAME_IS_DECODE_ONLY (out_frame)) { proxy = gst_video_codec_frame_get_user_data (out_frame); + /* reconfigure if un-cropped surface resolution changed */ + if (is_surface_resolution_changed (vdec, + GST_VAAPI_SURFACE_PROXY_SURFACE (proxy))) + gst_vaapidecode_negotiate (decode); + gst_vaapi_surface_proxy_set_destroy_notify (proxy, (GDestroyNotify) gst_vaapidecode_release, gst_object_ref (decode)); @@ -313,13 +360,10 @@ } GST_BUFFER_FLAG_SET (out_frame->output_buffer, out_flags); -#if GST_CHECK_VERSION(1,5,0) - /* First-in-bundle flag only appeared in 1.5 dev */ if (flags & GST_VAAPI_SURFACE_PROXY_FLAG_FFB) { GST_BUFFER_FLAG_SET (out_frame->output_buffer, GST_VIDEO_BUFFER_FLAG_FIRST_IN_BUNDLE); } -#endif crop_rect = gst_vaapi_surface_proxy_get_crop_rect (proxy); if (crop_rect) { @@ -442,6 +486,7 @@ { GstVaapiDecode *const decode = GST_VAAPIDECODE (vdec); GstVaapiDecoderStatus status; + GstVaapiPluginBase *plugin; GstFlowReturn ret; if (!decode->input_state) @@ -456,7 +501,7 @@ if (!gst_video_decoder_negotiate (vdec)) goto not_negotiated; - GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (vdec); + plugin = GST_VAAPI_PLUGIN_BASE (vdec); if (!gst_vaapi_plugin_base_set_caps (plugin, NULL, decode->srcpad_caps)) goto not_negotiated; @@ -523,7 +568,6 @@ } } -#if GST_CHECK_VERSION(1,5,0) static GstFlowReturn gst_vaapidecode_drain (GstVideoDecoder * vdec) { @@ -534,7 +578,6 @@ return gst_vaapidecode_push_all_decoded_frames (decode); } -#endif static gboolean gst_vaapidecode_internal_flush (GstVideoDecoder * vdec) @@ -778,7 +821,7 @@ g_mutex_clear (&decode->surface_ready_mutex); gst_vaapi_plugin_base_finalize (GST_VAAPI_PLUGIN_BASE (object)); - G_OBJECT_CLASS (gst_vaapidecode_parent_class)->finalize (object); + G_OBJECT_CLASS (parent_class)->finalize (object); } static gboolean @@ -901,56 +944,6 @@ return ret; } -static void -gst_vaapidecode_class_init (GstVaapiDecodeClass * klass) -{ - GObjectClass *const object_class = G_OBJECT_CLASS (klass); - GstElementClass *const element_class = GST_ELEMENT_CLASS (klass); - GstVideoDecoderClass *const vdec_class = GST_VIDEO_DECODER_CLASS (klass); - GstPadTemplate *pad_template; - - GST_DEBUG_CATEGORY_INIT (gst_debug_vaapidecode, - GST_PLUGIN_NAME, 0, GST_PLUGIN_DESC); - - gst_vaapi_plugin_base_class_init (GST_VAAPI_PLUGIN_BASE_CLASS (klass)); - - object_class->finalize = gst_vaapidecode_finalize; - - vdec_class->open = GST_DEBUG_FUNCPTR (gst_vaapidecode_open); - vdec_class->close = GST_DEBUG_FUNCPTR (gst_vaapidecode_close); - vdec_class->set_format = GST_DEBUG_FUNCPTR (gst_vaapidecode_set_format); - vdec_class->flush = GST_DEBUG_FUNCPTR (gst_vaapidecode_flush); - vdec_class->parse = GST_DEBUG_FUNCPTR (gst_vaapidecode_parse); - vdec_class->handle_frame = GST_DEBUG_FUNCPTR (gst_vaapidecode_handle_frame); - vdec_class->finish = GST_DEBUG_FUNCPTR (gst_vaapidecode_finish); -#if GST_CHECK_VERSION(1,5,0) - vdec_class->drain = GST_DEBUG_FUNCPTR (gst_vaapidecode_drain); -#endif - vdec_class->decide_allocation = - GST_DEBUG_FUNCPTR (gst_vaapidecode_decide_allocation); -#if GST_CHECK_VERSION(1,4,0) - vdec_class->src_query = GST_DEBUG_FUNCPTR (gst_vaapidecode_src_query); - vdec_class->sink_query = GST_DEBUG_FUNCPTR (gst_vaapidecode_sink_query); -#endif - - gst_element_class_set_static_metadata (element_class, - "VA-API decoder", - "Codec/Decoder/Video", - GST_PLUGIN_DESC, - "Gwenole Beauchesne , " - "Halley Zhao , " - "Sreerenj Balachandran , " - "Wind Yuan "); - - /* sink pad */ - pad_template = gst_static_pad_template_get (&gst_vaapidecode_sink_factory); - gst_element_class_add_pad_template (element_class, pad_template); - - /* src pad */ - pad_template = gst_static_pad_template_get (&gst_vaapidecode_src_factory); - gst_element_class_add_pad_template (element_class, pad_template); -} - static gboolean gst_vaapidecode_ensure_allowed_caps (GstVaapiDecode * decode) { @@ -1011,16 +1004,17 @@ } static GstCaps * -gst_vaapidecode_get_caps (GstPad * pad) +gst_vaapidecode_sink_getcaps (GstVideoDecoder * vdec, GstCaps * filter) { - GstVaapiDecode *const decode = GST_VAAPIDECODE (GST_OBJECT_PARENT (pad)); + GstVaapiDecode *const decode = GST_VAAPIDECODE (vdec); + GstCaps *result; if (decode->allowed_caps) goto bail; /* if we haven't a display yet, return our pad's template caps */ if (!GST_VAAPI_PLUGIN_BASE_DISPLAY (decode)) - return gst_pad_get_pad_template_caps (pad); + goto bail; /* if the allowed caps calculation fails, return an empty caps, so * the auto-plug can try other decoder */ @@ -1028,30 +1022,12 @@ return gst_caps_new_empty (); bail: - return gst_caps_ref (decode->allowed_caps); -} + result = gst_video_decoder_proxy_getcaps (vdec, decode->allowed_caps, filter); -#if !GST_CHECK_VERSION(1,4,0) -static gboolean -gst_vaapidecode_query (GstPad * pad, GstObject * parent, GstQuery * query) -{ - GstVaapiDecode *const decode = - GST_VAAPIDECODE (gst_pad_get_parent_element (pad)); - GstVideoDecoder *const vdec = GST_VIDEO_DECODER (decode); - gboolean res; + GST_DEBUG_OBJECT (decode, "Returning sink caps %" GST_PTR_FORMAT, result); - GST_INFO_OBJECT (decode, "query type %s on %s pad", - GST_QUERY_TYPE_NAME (query), GST_PAD_IS_SINK (pad) ? "sink" : "src"); - - if (GST_PAD_IS_SINK (pad)) - res = gst_vaapidecode_sink_query (vdec, query); - else - res = gst_vaapidecode_src_query (vdec, query); - - gst_object_unref (vdec); - return res; + return result; } -#endif static gboolean gst_vaapidecode_sink_query (GstVideoDecoder * vdec, GstQuery * query) @@ -1061,38 +1037,12 @@ GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (decode); switch (GST_QUERY_TYPE (query)) { - case GST_QUERY_CAPS:{ - GstCaps *caps, *filter = NULL; - GstPad *pad = GST_VIDEO_DECODER_SINK_PAD (vdec); - - gst_query_parse_caps (query, &filter); - caps = gst_vaapidecode_get_caps (pad); - - if (filter) { - GstCaps *tmp = caps; - caps = gst_caps_intersect_full (filter, tmp, GST_CAPS_INTERSECT_FIRST); - gst_caps_unref (tmp); - } - - gst_query_set_caps_result (query, caps); - gst_caps_unref (caps); - break; - } case GST_QUERY_CONTEXT:{ ret = gst_vaapi_handle_context_query (query, plugin->display); break; } default:{ -#if GST_CHECK_VERSION(1,4,0) - ret = GST_VIDEO_DECODER_CLASS (gst_vaapidecode_parent_class)->sink_query - (vdec, query); -#else - GstPad *pad = GST_VIDEO_DECODER_SINK_PAD (vdec); - GstObject *parent = gst_pad_get_parent (pad); - ret = plugin->sinkpad_query (pad, parent, query); - if (parent) - gst_object_unref (parent); -#endif + ret = GST_VIDEO_DECODER_CLASS (parent_class)->sink_query (vdec, query); break; } } @@ -1130,16 +1080,7 @@ break; } default:{ -#if GST_CHECK_VERSION(1,4,0) - ret = GST_VIDEO_DECODER_CLASS (gst_vaapidecode_parent_class)->src_query - (vdec, query); -#else - GstPad *pad = GST_VIDEO_DECODER_SRC_PAD (vdec); - GstObject *parent = gst_pad_get_parent (pad); - ret = plugin->srcpad_query (pad, parent, query); - if (parent) - gst_object_unref (parent); -#endif + ret = GST_VIDEO_DECODER_CLASS (parent_class)->src_query (vdec, query); break; } } @@ -1148,6 +1089,72 @@ } static void +gst_vaapidecode_class_init (GstVaapiDecodeClass * klass) +{ + GObjectClass *const object_class = G_OBJECT_CLASS (klass); + GstElementClass *const element_class = GST_ELEMENT_CLASS (klass); + GstVideoDecoderClass *const vdec_class = GST_VIDEO_DECODER_CLASS (klass); + GstPadTemplate *pad_template; + GstVaapiDecoderMap *map; + gchar *name, *longname; + GstCaps *caps; + + GST_DEBUG_CATEGORY_INIT (gst_debug_vaapidecode, + GST_PLUGIN_NAME, 0, GST_PLUGIN_DESC); + + parent_class = g_type_class_peek_parent (klass); + + gst_vaapi_plugin_base_class_init (GST_VAAPI_PLUGIN_BASE_CLASS (klass)); + + object_class->finalize = gst_vaapidecode_finalize; + + vdec_class->open = GST_DEBUG_FUNCPTR (gst_vaapidecode_open); + vdec_class->close = GST_DEBUG_FUNCPTR (gst_vaapidecode_close); + vdec_class->set_format = GST_DEBUG_FUNCPTR (gst_vaapidecode_set_format); + vdec_class->flush = GST_DEBUG_FUNCPTR (gst_vaapidecode_flush); + vdec_class->parse = GST_DEBUG_FUNCPTR (gst_vaapidecode_parse); + vdec_class->handle_frame = GST_DEBUG_FUNCPTR (gst_vaapidecode_handle_frame); + vdec_class->finish = GST_DEBUG_FUNCPTR (gst_vaapidecode_finish); + vdec_class->drain = GST_DEBUG_FUNCPTR (gst_vaapidecode_drain); + vdec_class->decide_allocation = + GST_DEBUG_FUNCPTR (gst_vaapidecode_decide_allocation); + vdec_class->src_query = GST_DEBUG_FUNCPTR (gst_vaapidecode_src_query); + vdec_class->sink_query = GST_DEBUG_FUNCPTR (gst_vaapidecode_sink_query); + vdec_class->getcaps = GST_DEBUG_FUNCPTR (gst_vaapidecode_sink_getcaps); + + map = (GstVaapiDecoderMap *) g_type_get_qdata (G_OBJECT_CLASS_TYPE (klass), + GST_VAAPI_DECODE_PARAMS_QDATA); + + if (map->codec) { + name = g_ascii_strup (map->name, -1); + longname = g_strdup_printf ("VA-API %s decoder", name); + g_free (name); + } else { + longname = g_strdup ("VA-API decoder"); + } + + gst_element_class_set_static_metadata (element_class, longname, + "Codec/Decoder/Video", GST_PLUGIN_DESC, + "Gwenole Beauchesne , " + "Halley Zhao , " + "Sreerenj Balachandran , " + "Wind Yuan "); + + g_free (longname); + + /* sink pad */ + caps = gst_caps_from_string (map->caps_str); + pad_template = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + caps); + gst_caps_unref (caps); + gst_element_class_add_pad_template (element_class, pad_template); + + /* src pad */ + pad_template = gst_static_pad_template_get (&gst_vaapidecode_src_factory); + gst_element_class_add_pad_template (element_class, pad_template); +} + +static void gst_vaapidecode_init (GstVaapiDecode * decode) { GstVideoDecoder *const vdec = GST_VIDEO_DECODER (decode); @@ -1162,14 +1169,56 @@ g_cond_init (&decode->surface_ready); gst_video_decoder_set_packetized (vdec, FALSE); +} -#if !GST_CHECK_VERSION(1,4,0) - /* Pad through which data comes in to the element */ - GstPad *pad = GST_VAAPI_PLUGIN_BASE_SINK_PAD (decode); - gst_pad_set_query_function (pad, GST_DEBUG_FUNCPTR (gst_vaapidecode_query)); - - /* Pad through which data goes out of the element */ - pad = GST_VAAPI_PLUGIN_BASE_SRC_PAD (decode); - gst_pad_set_query_function (pad, GST_DEBUG_FUNCPTR (gst_vaapidecode_query)); -#endif +gboolean +gst_vaapidecode_register (GstPlugin * plugin) +{ + gboolean ret = FALSE; + guint i, codec, rank; + gchar *type_name, *element_name; + const gchar *name; + GType type; + GTypeInfo typeinfo = { + sizeof (GstVaapiDecodeClass), + NULL, + NULL, + (GClassInitFunc) gst_vaapidecode_class_init, + NULL, + NULL, + sizeof (GstVaapiDecode), + 0, + (GInstanceInitFunc) gst_vaapidecode_init, + }; + + for (i = 0; i < G_N_ELEMENTS (vaapi_decode_map); i++) { + codec = vaapi_decode_map[i].codec; + rank = vaapi_decode_map[i].rank; + name = vaapi_decode_map[i].name; + + if (codec) { + type_name = g_strdup_printf ("GstVaapiDecode_%s", name); + element_name = g_strdup_printf ("vaapi%sdec", name); + } else { + type_name = g_strdup ("GstVaapiDecode"); + element_name = g_strdup_printf ("vaapidecode"); + } + + type = g_type_from_name (type_name); + if (!type) { + /* create the gtype now */ + type = g_type_register_static (GST_TYPE_VIDEO_DECODER, type_name, + &typeinfo, 0); + gst_vaapi_plugin_base_init_interfaces (type); + g_type_set_qdata (type, GST_VAAPI_DECODE_PARAMS_QDATA, + (gpointer) & vaapi_decode_map[i]); + } + + ret |= gst_element_register (plugin, element_name, rank, type); + + g_free (element_name); + g_free (type_name); + } + + return ret; } diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapidecode.h gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapidecode.h --- gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapidecode.h 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapidecode.h 2016-04-20 15:27:22.000000000 +0000 @@ -30,29 +30,7 @@ G_BEGIN_DECLS -#define GST_TYPE_VAAPIDECODE \ - (gst_vaapidecode_get_type()) - -#define GST_VAAPIDECODE(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), \ - GST_TYPE_VAAPIDECODE, \ - GstVaapiDecode)) - -#define GST_VAAPIDECODE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), \ - GST_TYPE_VAAPIDECODE, \ - GstVaapiDecodeClass)) - -#define GST_IS_VAAPIDECODE(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_VAAPIDECODE)) - -#define GST_IS_VAAPIDECODE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_VAAPIDECODE)) - -#define GST_VAAPIDECODE_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS((obj), \ - GST_TYPE_VAAPIDECODE, \ - GstVaapiDecodeClass)) +#define GST_VAAPIDECODE(obj) ((GstVaapiDecode *)(obj)) typedef struct _GstVaapiDecode GstVaapiDecode; typedef struct _GstVaapiDecodeClass GstVaapiDecodeClass; @@ -81,8 +59,7 @@ GstVaapiPluginBaseClass parent_class; }; -GType -gst_vaapidecode_get_type(void) G_GNUC_CONST; +gboolean gst_vaapidecode_register (GstPlugin * plugin); G_END_DECLS diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapiencode.c gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapiencode.c --- gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapiencode.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapiencode.c 2016-03-24 11:36:59.000000000 +0000 @@ -57,7 +57,6 @@ return gst_vaapi_plugin_base_ensure_display (GST_VAAPI_PLUGIN_BASE (encode)); } -#if GST_CHECK_VERSION(1,4,0) static gboolean gst_vaapiencode_sink_query (GstVideoEncoder * encoder, GstQuery * query) { @@ -95,27 +94,6 @@ return ret; } -#else -static gboolean -gst_vaapiencode_query (GstPad * pad, GstObject * parent, GstQuery * query) -{ - GstVaapiPluginBase *const plugin = - GST_VAAPI_PLUGIN_BASE (gst_pad_get_parent_element (pad)); - gboolean success; - - GST_INFO_OBJECT (plugin, "query type %s", GST_QUERY_TYPE_NAME (query)); - - if (GST_QUERY_TYPE (query) == GST_QUERY_CONTEXT) - success = gst_vaapi_handle_context_query (query, plugin->display); - else if (GST_PAD_IS_SINK (pad)) - success = plugin->sinkpad_query (plugin->sinkpad, parent, query); - else - success = plugin->srcpad_query (plugin->srcpad, parent, query); - - gst_object_unref (plugin); - return success; -} -#endif typedef struct { @@ -362,31 +340,16 @@ } static GstCaps * -gst_vaapiencode_get_caps_impl (GstVideoEncoder * venc) +gst_vaapiencode_get_caps (GstVideoEncoder * venc, GstCaps * filter) { GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (venc); - GstCaps *caps; + GstCaps *result; - if (plugin->sinkpad_caps) - caps = gst_caps_ref (plugin->sinkpad_caps); - else { - caps = gst_pad_get_pad_template_caps (plugin->sinkpad); - } - return caps; -} + result = gst_video_encoder_proxy_getcaps (venc, plugin->sinkpad_caps, filter); -static GstCaps * -gst_vaapiencode_get_caps (GstVideoEncoder * venc, GstCaps * filter) -{ - GstCaps *caps, *out_caps; + GST_DEBUG_OBJECT (venc, "Returning sink caps %" GST_PTR_FORMAT, result); - out_caps = gst_vaapiencode_get_caps_impl (venc); - if (out_caps && filter) { - caps = gst_caps_intersect_full (out_caps, filter, GST_CAPS_INTERSECT_FIRST); - gst_caps_unref (out_caps); - out_caps = caps; - } - return out_caps; + return result; } static gboolean @@ -649,11 +612,6 @@ GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (encode); gst_vaapi_plugin_base_init (GST_VAAPI_PLUGIN_BASE (encode), GST_CAT_DEFAULT); - -#if !GST_CHECK_VERSION(1,4,0) - gst_pad_set_query_function (plugin->sinkpad, gst_vaapiencode_query); - gst_pad_set_query_function (plugin->srcpad, gst_vaapiencode_query); -#endif gst_pad_use_fixed_caps (plugin->srcpad); } @@ -687,13 +645,8 @@ klass->set_property = gst_vaapiencode_default_set_property; klass->alloc_buffer = gst_vaapiencode_default_alloc_buffer; -#if GST_CHECK_VERSION(1,4,0) venc_class->src_query = GST_DEBUG_FUNCPTR (gst_vaapiencode_src_query); venc_class->sink_query = GST_DEBUG_FUNCPTR (gst_vaapiencode_sink_query); -#else - /* Registering debug symbols for function pointers */ - GST_DEBUG_REGISTER_FUNCPTR (gst_vaapiencode_query); -#endif } static inline GPtrArray * diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapiencode_h264.c gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapiencode_h264.c --- gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapiencode_h264.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapiencode_h264.c 2016-03-24 11:36:59.000000000 +0000 @@ -21,6 +21,20 @@ * Boston, MA 02110-1301 USA */ +/** + * SECTION:element-vaapih264enc + * @short_description: A VA-API based H.264 video encoder + * + * Encodes raw video streams into H.264 bitstreams. + * + * + * Example launch line + * |[ + * gst-launch-1.0 -ev videotestsrc num-buffers=60 ! timeoverlay ! vaapih264enc ! mp4mux ! filesink location=test.mp4 + * ]| + * + */ + #include "gstcompat.h" #include #include @@ -29,7 +43,7 @@ #include "gstvaapipluginutil.h" #include "gstvaapivideomemory.h" -#define GST_PLUGIN_NAME "vaapiencode_h264" +#define GST_PLUGIN_NAME "vaapih264enc" #define GST_PLUGIN_DESC "A VA-API based H.264 video encoder" GST_DEBUG_CATEGORY_STATIC (gst_vaapi_h264_encode_debug); diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapiencode_h265.c gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapiencode_h265.c --- gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapiencode_h265.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapiencode_h265.c 2016-03-24 11:36:59.000000000 +0000 @@ -20,6 +20,20 @@ * Boston, MA 02110-1301 USA */ +/** + * SECTION:element-vaapih265enc + * @short_description: A VA-API based HEVC video encoder + * + * Encodes raw video streams into HEVC bitstreams. + * + * + * Example launch line + * |[ + * gst-launch-1.0 -ev videotestsrc num-buffers=60 ! timeoverlay ! vaapih265enc ! matroskamux ! filesink location=test.mkv + * ]| + * + */ + #include "gstcompat.h" #include #include @@ -28,7 +42,7 @@ #include "gstvaapipluginutil.h" #include "gstvaapivideomemory.h" -#define GST_PLUGIN_NAME "vaapiencode_h265" +#define GST_PLUGIN_NAME "vaapih265enc" #define GST_PLUGIN_DESC "A VA-API based H.265 video encoder" GST_DEBUG_CATEGORY_STATIC (gst_vaapi_h265_encode_debug); diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapiencode_jpeg.c gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapiencode_jpeg.c --- gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapiencode_jpeg.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapiencode_jpeg.c 2016-03-24 11:36:59.000000000 +0000 @@ -20,6 +20,20 @@ * Boston, MA 02110-1301 USA */ +/** + * SECTION:element-vaapijpegenc + * @short_description: A VA-API based JPEG image encoder + * + * Encodes raw images into JPEG images. + * + * + * Example launch line + * |[ + * gst-launch-1.0 -ev videotestsrc num-buffers=1 ! timeoverlay ! vaapijpegenc ! filesink location=test.jpg + * ]| + * + */ + #include "gstcompat.h" #include #include @@ -27,7 +41,7 @@ #include "gstvaapipluginutil.h" #include "gstvaapivideomemory.h" -#define GST_PLUGIN_NAME "vaapiencode_jpeg" +#define GST_PLUGIN_NAME "vaapijpegenc" #define GST_PLUGIN_DESC "A VA-API based JPEG video encoder" GST_DEBUG_CATEGORY_STATIC (gst_vaapi_jpeg_encode_debug); diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapiencode_mpeg2.c gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapiencode_mpeg2.c --- gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapiencode_mpeg2.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapiencode_mpeg2.c 2016-03-24 11:36:59.000000000 +0000 @@ -21,6 +21,20 @@ * Boston, MA 02110-1301 USA */ +/** + * SECTION:element-vaapimpeg2enc + * @short_description: A VA-API based MPEG2 video encoder + * + * Encodes raw video streams into MPEG2 bitstreams. + * + * + * Example launch line + * |[ + * gst-launch-1.0 -ev videotestsrc num-buffers=60 ! timeoverlay ! vaapimpeg2enc ! matroskamux ! filesink location=test.mkv + * ]| + * + */ + #include "gstcompat.h" #include #include @@ -28,7 +42,7 @@ #include "gstvaapipluginutil.h" #include "gstvaapivideomemory.h" -#define GST_PLUGIN_NAME "vaapiencode_mpeg2" +#define GST_PLUGIN_NAME "vaapimpeg2enc" #define GST_PLUGIN_DESC "A VA-API based MPEG-2 video encoder" GST_DEBUG_CATEGORY_STATIC (gst_vaapi_mpeg2_encode_debug); diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapiencode_vp8.c gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapiencode_vp8.c --- gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapiencode_vp8.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapiencode_vp8.c 2016-03-24 11:36:59.000000000 +0000 @@ -20,6 +20,20 @@ * Boston, MA 02110-1301 USA */ +/** + * SECTION:element-vaapivp8enc + * @short_description: A VA-API based VP8 video encoder + * + * Encodes raw video streams into VP8 bitstreams. + * + * + * Example launch line + * |[ + * gst-launch-1.0 -ev videotestsrc num-buffers=60 ! timeoverlay ! vaapivp8enc ! matroskamux ! filesink location=test.mkv + * ]| + * + */ + #include "gstcompat.h" #include #include @@ -27,7 +41,7 @@ #include "gstvaapipluginutil.h" #include "gstvaapivideomemory.h" -#define GST_PLUGIN_NAME "vaapiencode_vp8" +#define GST_PLUGIN_NAME "vaapivp8enc" #define GST_PLUGIN_DESC "A VA-API based VP8 video encoder" GST_DEBUG_CATEGORY_STATIC (gst_vaapi_vp8_encode_debug); diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapiparse.c gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapiparse.c --- gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapiparse.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapiparse.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -/* - * gstvaapiparse.c - Recent enough GStreamer video parsers - * - * Copyright (C) 2011 Mark Nauwelaerts - * Copyright (C) 2009 Tim-Philipp Müller - * - * 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 "gstcompat.h" -#include -#include "gstvaapiparse.h" -#include "gsth264parse.h" - -#if GST_CHECK_VERSION(1,4,0) -#include "gsth265parse.h" -#endif - -#define PLUGIN_NAME "vaapiparse" -#define PLUGIN_DESC "VA-API based elements" -#define PLUGIN_LICENSE "LGPL" - -static gboolean -plugin_init (GstPlugin * plugin) -{ - gboolean failure = FALSE; - - failure |= !gst_element_register (plugin, "vaapiparse_h264", - GST_RANK_PRIMARY + 2, GST_TYPE_H264_PARSE); - -#if GST_CHECK_VERSION(1,4,0) - failure |= !gst_element_register (plugin, "vaapiparse_h265", - GST_RANK_PRIMARY + 2, GST_TYPE_H265_PARSE); -#endif - - return !failure; -} - -GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, - vaapiparse, PLUGIN_DESC, plugin_init, - PACKAGE_VERSION, PLUGIN_LICENSE, PACKAGE, PACKAGE_BUGREPORT) diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapiparse.h gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapiparse.h --- gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapiparse.h 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapiparse.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -/* - * gstvaapiparse.h - Recent enough GStreamer video parsers - * - * Copyright (C) 2014 Intel Corporation - * - * 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 - */ - -#ifndef GST_VAAPI_PARSE_H -#define GST_VAAPI_PARSE_H - -/* vaapiparse_h264 */ -#define _GstH264Parse _GstVaapiH264Parse -#define GstH264Parse GstVaapiH264Parse -#define _GstH264ParseClass _GstVaapiH264ParseClass -#define GstH264ParseClass GstVaapiH264ParseClass -#define gst_h264_parse gst_vaapi_h264_parse -#define gst_h264_parse_init gst_vaapi_h264_parse_init -#define gst_h264_parse_class_init gst_vaapi_h264_parse_class_init -#define gst_h264_parse_parent_class gst_vaapi_h264_parse_parent_class -#define gst_h264_parse_get_type gst_vaapi_h264_parse_get_type - -/* vaapiparse_h265 */ -#define _GstH265Parse _GstVaapiH265Parse -#define GstH265Parse GstVaapiH265Parse -#define _GstH265ParseClass _GstVaapiH265ParseClass -#define GstH265ParseClass GstVaapiH265ParseClass -#define gst_h265_parse gst_vaapi_h265_parse -#define gst_h265_parse_init gst_vaapi_h265_parse_init -#define gst_h265_parse_class_init gst_vaapi_h265_parse_class_init -#define gst_h265_parse_parent_class gst_vaapi_h265_parse_parent_class -#define gst_h265_parse_get_type gst_vaapi_h265_parse_get_type - -#endif /* GST_VAAPI_PARSE_H */ diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapipluginbase.c gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapipluginbase.c --- gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapipluginbase.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapipluginbase.c 2016-03-24 11:36:59.000000000 +0000 @@ -180,12 +180,13 @@ void gst_vaapi_plugin_base_class_init (GstVaapiPluginBaseClass * klass) { + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + klass->has_interface = default_has_interface; klass->display_changed = default_display_changed; plugin_parent_class = g_type_class_peek_parent (klass); - GstElementClass *const element_class = GST_ELEMENT_CLASS (klass); element_class->set_context = GST_DEBUG_FUNCPTR (plugin_set_context); } @@ -200,17 +201,10 @@ /* sink pad */ plugin->sinkpad = gst_element_get_static_pad (GST_ELEMENT (plugin), "sink"); gst_video_info_init (&plugin->sinkpad_info); -#if !GST_CHECK_VERSION(1,4,0) - plugin->sinkpad_query = GST_PAD_QUERYFUNC (plugin->sinkpad); -#endif /* src pad */ - if (!(GST_OBJECT_FLAGS (plugin) & GST_ELEMENT_FLAG_SINK)) { + if (!(GST_OBJECT_FLAGS (plugin) & GST_ELEMENT_FLAG_SINK)) plugin->srcpad = gst_element_get_static_pad (GST_ELEMENT (plugin), "src"); -#if !GST_CHECK_VERSION(1,4,0) - plugin->srcpad_query = GST_PAD_QUERYFUNC (plugin->srcpad); -#endif - } gst_video_info_init (&plugin->srcpad_info); } @@ -381,12 +375,19 @@ if (GST_IS_PUSH_SRC (element)) { element_name = gst_element_get_name (element); - if (!element_name || sscanf (element_name, "v4l2src%d", &v) != 1) + if (!element_name) + break; + + if ((sscanf (element_name, "v4l2src%d", &v) != 1) + && (sscanf (element_name, "camerasrc%d", &v) != 1)) break; v = 0; g_object_get (element, "io-mode", &v, NULL); - is_dmabuf_capable = v == 5; /* "dmabuf-import" enum value */ + if (strncmp (element_name, "camerasrc", 9) == 0) + is_dmabuf_capable = v == 3; + else + is_dmabuf_capable = v == 5; /* "dmabuf-import" enum value */ break; } else if (GST_IS_BASE_TRANSFORM (element)) { element_name = gst_element_get_name (element); @@ -569,8 +570,6 @@ } } -/* XXXX: GStreamer 1.2 doesn't check, in gst_buffer_pool_set_config() - if the config option is already set */ static inline gboolean gst_vaapi_plugin_base_set_pool_config (GstBufferPool * pool, const gchar * option) @@ -578,11 +577,8 @@ GstStructure *config; config = gst_buffer_pool_get_config (pool); - if (!gst_buffer_pool_config_has_option (config, option)) { - gst_buffer_pool_config_add_option (config, option); - return gst_buffer_pool_set_config (pool, config); - } - return TRUE; + gst_buffer_pool_config_add_option (config, option); + return gst_buffer_pool_set_config (pool, config); } /** diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapipluginbase.h gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapipluginbase.h --- gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapipluginbase.h 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapipluginbase.h 2016-06-09 07:08:12.000000000 +0000 @@ -31,7 +31,7 @@ #include #include -#ifdef HAVE_GST_GL_GL_H +#if USE_GST_GL_HELPERS # include #endif @@ -130,11 +130,6 @@ GstVideoInfo srcpad_info; GstBufferPool *srcpad_buffer_pool; -#if !GST_CHECK_VERSION(1,4,0) - GstPadQueryFunction srcpad_query; - GstPadQueryFunction sinkpad_query; -#endif - GstVaapiDisplay *display; GstVaapiDisplayType display_type; GstVaapiDisplayType display_type_req; diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapipluginutil.c gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapipluginutil.c --- gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapipluginutil.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapipluginutil.c 2016-04-20 15:27:22.000000000 +0000 @@ -103,6 +103,7 @@ return display; } +#if USE_GST_GL_HELPERS static GstVaapiDisplay * gst_vaapi_create_display_from_handle (GstVaapiDisplayType display_type, gpointer handle) @@ -122,6 +123,7 @@ } return NULL; } +#endif static GstVaapiDisplay * gst_vaapi_create_display_from_gl_context (GstObject * gl_context_object) @@ -174,14 +176,14 @@ display_type = GST_VAAPI_DISPLAY_TYPE_WAYLAND; #endif } + gst_object_unref (gl_window); break; } default: display_type = GST_VAAPI_DISPLAY_TYPE_ANY; break; } - if (!display_type) - return NULL; + gst_object_unref (gl_display); display = gst_vaapi_create_display_from_handle (display_type, native_display); if (!display) @@ -209,8 +211,10 @@ out_display = NULL; break; } - if (!out_display) + if (!out_display) { + gst_vaapi_display_unref (display); return NULL; + } gst_vaapi_display_egl_set_gl_context (GST_VAAPI_DISPLAY_EGL (out_display), GSIZE_TO_POINTER (gst_gl_context_get_gl_context (gl_context))); break; @@ -358,7 +362,7 @@ return TRUE; } -void +static void set_video_template_caps (GstCaps * caps) { GstStructure *const structure = gst_caps_get_structure (caps, 0); @@ -412,14 +416,14 @@ gst_vaapi_video_format_new_template_caps_with_features (GstVideoFormat format, const gchar * features_string) { + GstCapsFeatures *features; GstCaps *caps; caps = gst_vaapi_video_format_new_template_caps (format); if (!caps) return NULL; - GstCapsFeatures *const features = - gst_caps_features_new (features_string, NULL); + features = gst_caps_features_new (features_string, NULL); if (!features) { gst_caps_unref (caps); return NULL; @@ -482,11 +486,9 @@ GstCapsFeatures *const features = gst_caps_get_features (out_caps, i); GstStructure *const structure = gst_caps_get_structure (out_caps, i); -#if GST_CHECK_VERSION(1,3,0) /* Skip ANY features, we need an exact match for correct evaluation */ if (gst_caps_features_is_any (features)) continue; -#endif caps = gst_caps_new_full (gst_structure_copy (structure), NULL); if (!caps) @@ -504,12 +506,10 @@ feature = GST_VAAPI_CAPS_FEATURE_SYSTEM_MEMORY; gst_caps_replace (&caps, NULL); -#if GST_CHECK_VERSION(1,3,0) /* Stop at the first match, the caps should already be sorted out by preference order from downstream elements */ if (feature != GST_VAAPI_CAPS_FEATURE_SYSTEM_MEMORY) break; -#endif } if (out_format_ptr) { @@ -613,7 +613,8 @@ } gboolean -gst_vaapi_caps_feature_contains (const GstCaps * caps, GstVaapiCapsFeature feature) +gst_vaapi_caps_feature_contains (const GstCaps * caps, + GstVaapiCapsFeature feature) { const gchar *feature_str; @@ -651,12 +652,8 @@ vip->fps_n = vi.fps_n; vip->fps_d = vi.fps_d; -#if GST_CHECK_VERSION(1,5,0) - GST_VIDEO_INFO_MULTIVIEW_MODE (vip) = - GST_VIDEO_INFO_MULTIVIEW_MODE (&vi); - GST_VIDEO_INFO_MULTIVIEW_FLAGS (vip) = - GST_VIDEO_INFO_MULTIVIEW_FLAGS (&vi); -#endif + GST_VIDEO_INFO_MULTIVIEW_MODE (vip) = GST_VIDEO_INFO_MULTIVIEW_MODE (&vi); + GST_VIDEO_INFO_MULTIVIEW_FLAGS (vip) = GST_VIDEO_INFO_MULTIVIEW_FLAGS (&vi); } /** @@ -669,7 +666,7 @@ * gst_vaapi_display_unref () after use. **/ GstVaapiDisplay * -gst_vaapi_create_test_display () +gst_vaapi_create_test_display (void) { return gst_vaapi_create_display (GST_VAAPI_DISPLAY_TYPE_ANY, NULL); } diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapipostproc.c gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapipostproc.c --- gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapipostproc.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapipostproc.c 2016-03-24 11:36:59.000000000 +0000 @@ -21,12 +21,18 @@ */ /** - * SECTION:gstvaapipostproc - * @short_description: A video postprocessing filter + * SECTION:element-vaapipostproc + * @short_description: A VA-API base video postprocessing filter * * vaapipostproc consists in various postprocessing algorithms to be - * applied to VA surfaces. So far, only basic bob deinterlacing is - * implemented. + * applied to VA surfaces. + * + * + * Example launch line + * |[ + * gst-launch-1.0 videotestsrc ! vaapipostproc ! video/x-raw width=1920, height=1080 ! vaapisink + * ]| + * */ #include "gstcompat.h" @@ -39,7 +45,7 @@ #include "gstvaapivideomemory.h" #define GST_PLUGIN_NAME "vaapipostproc" -#define GST_PLUGIN_DESC "A video postprocessing filter" +#define GST_PLUGIN_DESC "A VA-API video postprocessing filter" GST_DEBUG_CATEGORY_STATIC (gst_debug_vaapipostproc); #define GST_CAT_DEFAULT gst_debug_vaapipostproc @@ -479,6 +485,7 @@ GstVaapiDeinterlaceMethod deint_method; guint flags, deint_flags; gboolean tff, deint, deint_refs, deint_changed; + const GstVideoCropMeta *crop_meta; GstVaapiRectangle *crop_rect = NULL; GstVaapiRectangle tmp_rect; @@ -527,7 +534,7 @@ goto error_invalid_buffer; inbuf_surface = gst_vaapi_video_meta_get_surface (inbuf_meta); - GstVideoCropMeta *const crop_meta = gst_buffer_get_video_crop_meta (inbuf); + crop_meta = gst_buffer_get_video_crop_meta (inbuf); if (crop_meta) { crop_rect = &tmp_rect; crop_rect->x = crop_meta->x; @@ -974,11 +981,13 @@ num_structures = gst_caps_get_size (caps); for (i = 0; i < num_structures; i++) { GstCapsFeatures *const features = gst_caps_get_features (caps, i); + GstStructure *structure; + if (gst_caps_features_contains (features, GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META)) continue; - GstStructure *const structure = gst_caps_get_structure (caps, i); + structure = gst_caps_get_structure (caps, i); if (!structure) continue; gst_structure_set_value (structure, "format", &value); @@ -1100,7 +1109,7 @@ peer_caps = gst_pad_peer_query_caps (GST_BASE_TRANSFORM_SRC_PAD (trans), postproc->allowed_srcpad_caps); - if (gst_caps_is_empty (peer_caps)) + if (gst_caps_is_any (peer_caps) || gst_caps_is_empty (peer_caps)) return peer_caps; if (!gst_caps_is_fixed (peer_caps)) peer_caps = gst_caps_fixate (peer_caps); diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapisink.c gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapisink.c --- gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapisink.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapisink.c 2016-03-24 11:36:59.000000000 +0000 @@ -23,12 +23,19 @@ */ /** - * SECTION:gstvaapisink - * @short_description: A VA-API based videosink + * SECTION:element-vaapisink + * @short_description: A VA-API based video sink * * vaapisink renders video frames to a drawable (X #Window) on a local * display using the Video Acceleration (VA) API. The element will * create its own internal window and render into it. + * + * + * Example launch line + * |[ + * gst-launch-1.0 videotestsrc ! vaapisink + * ]| + * */ #include "gstcompat.h" @@ -58,7 +65,6 @@ /* *INDENT-OFF* */ static const char gst_vaapisink_sink_caps_str[] = GST_VAAPI_MAKE_ENC_SURFACE_CAPS ";" -#if GST_CHECK_VERSION(1,3,1) GST_VIDEO_CAPS_MAKE_WITH_FEATURES ( GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE "," GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION, @@ -66,7 +72,6 @@ GST_VIDEO_CAPS_MAKE_WITH_FEATURES ( GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION, GST_VIDEO_FORMATS_ALL) ";" -#endif GST_VIDEO_CAPS_MAKE (GST_VIDEO_FORMATS_ALL); /* *INDENT-ON* */ @@ -831,6 +836,11 @@ GstVaapiSink *const sink = GST_VAAPISINK (navigation); GstPad *peer; + if (!sink->window) { + gst_structure_free (structure); + return; + } + if ((peer = gst_pad_get_peer (GST_VAAPI_PLUGIN_BASE_SINK_PAD (sink)))) { GstEvent *event; GstVaapiRectangle *disp_rect = &sink->display_rect; @@ -838,9 +848,6 @@ event = gst_event_new_navigation (structure); - if (!sink->window) - return; - /* We calculate scaling using the original video frames geometry to include pixel aspect ratio scaling. */ xscale = (gdouble) sink->video_width / disp_rect->width; @@ -860,7 +867,13 @@ (gdouble) y * yscale, NULL); } - gst_pad_send_event (peer, event); + if (!gst_pad_send_event (peer, gst_event_ref (event))) { + /* If upstream didn't handle the event we'll post a message with it + * for the application in case it wants to do something with it */ + gst_element_post_message (GST_ELEMENT_CAST (sink), + gst_navigation_message_new_event (GST_OBJECT_CAST (sink), event)); + } + gst_event_unref (event); gst_object_unref (peer); } } @@ -1201,16 +1214,31 @@ { GstVaapiSink *const sink = GST_VAAPISINK_CAST (base_sink); GstCaps *out_caps, *raw_caps; + static const char surface_caps_str[] = + GST_VAAPI_MAKE_ENC_SURFACE_CAPS ";" + GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE + "," GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION, + "{ ENCODED, NV12, I420, YV12 }"); - out_caps = gst_static_pad_template_get_caps (&gst_vaapisink_sink_factory); - if (!out_caps) - return NULL; + out_caps = gst_caps_from_string (surface_caps_str); if (GST_VAAPI_PLUGIN_BASE_DISPLAY (sink)) { - raw_caps = gst_vaapi_plugin_base_get_allowed_raw_caps (GST_VAAPI_PLUGIN_BASE (sink)); + raw_caps = + gst_vaapi_plugin_base_get_allowed_raw_caps (GST_VAAPI_PLUGIN_BASE + (sink)); if (raw_caps) { + GstCaps *feature_caps; + GstCapsFeatures *const features = + gst_caps_features_new + (GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION, NULL); + out_caps = gst_caps_make_writable (out_caps); + gst_caps_append (out_caps, gst_caps_copy (raw_caps)); + + feature_caps = gst_caps_copy (raw_caps); + gst_caps_set_features (feature_caps, 0, features); + gst_caps_append (out_caps, feature_caps); } } return out_caps; @@ -1333,7 +1361,9 @@ ret = gst_vaapi_plugin_base_get_input_buffer (GST_VAAPI_PLUGIN_BASE (sink), src_buffer, &buffer); - if (ret != GST_FLOW_OK && ret != GST_FLOW_NOT_SUPPORTED) + if (ret == GST_FLOW_NOT_SUPPORTED) + return GST_FLOW_OK; /* let's ignore the frame if it couldn't be uploaded */ + if (ret != GST_FLOW_OK) return ret; meta = gst_buffer_get_vaapi_video_meta (buffer); diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapivideomemory.c gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapivideomemory.c --- gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapivideomemory.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapivideomemory.c 2016-03-24 11:36:59.000000000 +0000 @@ -188,12 +188,13 @@ gst_video_meta_map_vaapi_memory (GstVideoMeta * meta, guint plane, GstMapInfo * info, gpointer * data, gint * stride, GstMapFlags flags) { + GstAllocator *allocator; GstVaapiVideoMemory *const mem = GST_VAAPI_VIDEO_MEMORY_CAST (gst_buffer_peek_memory (meta->buffer, 0)); - g_return_val_if_fail (mem, FALSE); - g_return_val_if_fail (GST_VAAPI_IS_VIDEO_ALLOCATOR (mem->parent_instance. - allocator), FALSE); + + allocator = GST_MEMORY_CAST (mem)->allocator; + g_return_val_if_fail (GST_VAAPI_IS_VIDEO_ALLOCATOR (allocator), FALSE); g_return_val_if_fail (mem->meta, FALSE); if (mem->map_type && mem->map_type != GST_VAAPI_VIDEO_MEMORY_MAP_TYPE_PLANAR) @@ -264,12 +265,13 @@ gst_video_meta_unmap_vaapi_memory (GstVideoMeta * meta, guint plane, GstMapInfo * info) { + GstAllocator *allocator; GstVaapiVideoMemory *const mem = GST_VAAPI_VIDEO_MEMORY_CAST (gst_buffer_peek_memory (meta->buffer, 0)); - g_return_val_if_fail (mem, FALSE); - g_return_val_if_fail (GST_VAAPI_IS_VIDEO_ALLOCATOR (mem->parent_instance. - allocator), FALSE); + + allocator = GST_MEMORY_CAST (mem)->allocator; + g_return_val_if_fail (GST_VAAPI_IS_VIDEO_ALLOCATOR (allocator), FALSE); g_return_val_if_fail (mem->meta, FALSE); g_return_val_if_fail (mem->surface, FALSE); g_return_val_if_fail (mem->image, FALSE); @@ -717,7 +719,7 @@ gst_video_info_set_format (&allocator->image_info, GST_VIDEO_FORMAT_I420, GST_VIDEO_INFO_WIDTH (vinfo), GST_VIDEO_INFO_HEIGHT (vinfo)); else - allocator->image_info = *vinfo; + allocator->image_info = *vinfo; image = new_image (display, &allocator->image_info); if (!image) diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapivideometa_texture.c gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapivideometa_texture.c --- gstreamer-vaapi-0.7.0/gst/vaapi/gstvaapivideometa_texture.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/gstvaapivideometa_texture.c 2016-04-20 15:27:22.000000000 +0000 @@ -40,7 +40,7 @@ struct _GstVaapiVideoMetaTexture { GstVaapiTexture *texture; - GstVideoGLTextureType texture_type; + GstVideoGLTextureType texture_type[4]; guint gl_format; guint width; guint height; @@ -73,15 +73,17 @@ meta_texture_ensure_format (GstVaapiVideoMetaTexture * meta, GstVideoFormat format) { + memset (meta->texture_type, 0, sizeof (meta->texture_type)); + switch (format) { case GST_VIDEO_FORMAT_RGBA: meta->gl_format = GL_RGBA; - meta->texture_type = GST_VIDEO_GL_TEXTURE_TYPE_RGBA; + meta->texture_type[0] = GST_VIDEO_GL_TEXTURE_TYPE_RGBA; break; case GST_VIDEO_FORMAT_BGRA: meta->gl_format = GL_BGRA_EXT; /* FIXME: add GST_VIDEO_GL_TEXTURE_TYPE_BGRA extension */ - meta->texture_type = GST_VIDEO_GL_TEXTURE_TYPE_RGBA; + meta->texture_type[0] = GST_VIDEO_GL_TEXTURE_TYPE_RGBA; break; default: goto error_unsupported_format; @@ -155,7 +157,7 @@ if (!copy) return NULL; - copy->texture_type = meta->texture_type; + memcpy (copy->texture_type, meta->texture_type, sizeof (meta->texture_type)); copy->gl_format = meta->gl_format; copy->width = meta->width; copy->height = meta->height; @@ -220,7 +222,7 @@ meta = gst_buffer_add_video_gl_texture_upload_meta (buffer, GST_VIDEO_GL_TEXTURE_ORIENTATION_X_NORMAL_Y_NORMAL, - 1, &meta_texture->texture_type, gst_vaapi_texture_upload, + 1, meta_texture->texture_type, gst_vaapi_texture_upload, meta_texture, (GBoxedCopyFunc) meta_texture_copy, (GBoxedFreeFunc) meta_texture_free); if (!meta) diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/Makefile.am gstreamer-vaapi-1.8.2/gst/vaapi/Makefile.am --- gstreamer-vaapi-0.7.0/gst/vaapi/Makefile.am 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/Makefile.am 2016-03-24 11:36:59.000000000 +0000 @@ -7,28 +7,24 @@ -I$(top_builddir)/gst-libs \ $(NULL) -libgstvaapi_LIBS = \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-$(GST_API_VERSION).la +libgstvaapi_LIBS = $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi.la if USE_DRM -libgstvaapi_LIBS += \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-drm-$(GST_API_VERSION).la +libgstvaapi_LIBS +=$(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-drm.la endif if USE_X11 libgstvaapi_LIBS += \ $(X11_LIBS) \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11-$(GST_API_VERSION).la + $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11.la endif if USE_GLX -libgstvaapi_LIBS += \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-glx-$(GST_API_VERSION).la +libgstvaapi_LIBS += $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-glx.la endif if USE_EGL -libgstvaapi_LIBS += \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-egl-$(GST_API_VERSION).la +libgstvaapi_LIBS += $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-egl.la endif if USE_WAYLAND @@ -36,8 +32,7 @@ $(WAYLAND_CFLAGS) \ $(NULL) -libgstvaapi_LIBS += \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-wayland-$(GST_API_VERSION).la +libgstvaapi_LIBS += $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-wayland.la endif if USE_GST_GL_HELPERS @@ -58,6 +53,7 @@ gstvaapidecodebin.c \ gstvaapivideobufferpool.c \ gstvaapivideomemory.c \ + gstvaapivideometa_texture.c \ $(NULL) libgstvaapi_source_h = \ @@ -73,6 +69,7 @@ gstvaapidecodebin.h \ gstvaapivideobufferpool.h \ gstvaapivideomemory.h \ + gstvaapivideometa_texture.h \ $(NULL) libgstvaapi_enc_source_c = \ @@ -114,29 +111,6 @@ libgstvaapi_source_h += $(libgstvaapi_h265enc_source_h) endif - - -libgstvaapi_egl_source_c = -libgstvaapi_egl_source_h = - -if USE_EGL -libgstvaapi_source_c += $(libgstvaapi_egl_source_c) -libgstvaapi_source_h += $(libgstvaapi_egl_source_h) -endif - -libgstvaapi_1_2p_source_c = \ - gstvaapivideometa_texture.c \ - $(NULL) - -libgstvaapi_1_2p_source_h = \ - gstvaapivideometa_texture.h \ - $(NULL) - -if USE_GST_API_1_2p -libgstvaapi_source_c += $(libgstvaapi_1_2p_source_c) -libgstvaapi_source_h += $(libgstvaapi_1_2p_source_h) -endif - libgstvaapi_la_SOURCES = $(libgstvaapi_source_c) noinst_HEADERS = $(libgstvaapi_source_h) @@ -145,6 +119,7 @@ $(GST_CFLAGS) \ $(GST_BASE_CFLAGS) \ $(GST_VIDEO_CFLAGS) \ + $(GST_PBUTILS_CFLAGS) \ $(GST_INTERFACES_CFLAGS) \ $(GST_BASEVIDEO_CFLAGS) \ $(GST_PLUGINS_BASE_CFLAGS) \ @@ -154,7 +129,8 @@ $(libgstvaapi_LIBS) \ $(GST_LIBS) \ $(GST_BASE_LIBS) \ - $(GST_VIDEO_LIBS) -lgstpbutils-$(GST_PKG_VERSION) \ + $(GST_VIDEO_LIBS) \ + $(GST_PBUTILS_LIBS) \ $(GST_INTERFACES_LIBS) \ $(GST_BASEVIDEO_LIBS) \ $(GST_PLUGINS_BASE_LIBS) \ @@ -163,98 +139,6 @@ libgstvaapi_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) libgstvaapi_la_LIBTOOLFLAGS = --tag=disable-static -BUILT_SOURCES = - -if USE_LOCAL_VIDEO_PARSERS -plugin_LTLIBRARIES += libgstvaapi_parse.la - -libgstvaapi_parse_gen_source_c = \ - gsth264parse.c \ - $(NULL) - -libgstvaapi_parse_gen_source_h = \ - gsth264parse.h \ - $(NULL) - -libgstvaapi_1_4p_parse_gen_source_c = \ - gsth265parse.c \ - $(NULL) - -libgstvaapi_1_4p_parse_gen_source_h = \ - gsth265parse.h \ - $(NULL) - -libgstvaapi_parse_gen_sources = \ - $(libgstvaapi_parse_gen_source_c) \ - $(libgstvaapi_parse_gen_source_h) \ - $(NULL) - -if USE_GST_API_1_4p -libgstvaapi_parse_gen_source_c += $(libgstvaapi_1_4p_parse_gen_source_c) -libgstvaapi_parse_gen_source_h += $(libgstvaapi_1_4p_parse_gen_source_h) -endif - -libgstvaapi_parse_la_SOURCES = gstvaapiparse.c gstvaapiparse.h -nodist_libgstvaapi_parse_la_SOURCES = \ - $(libgstvaapi_parse_gen_source_c) \ - $(libgstvaapi_parse_gen_source_h) \ - $(NULL) - -libgstvaapi_parse_la_CFLAGS = \ - -DGST_USE_UNSTABLE_API \ - -I$(top_srcdir)/gst-libs \ - -I$(top_builddir)/gst-libs \ - $(GST_CFLAGS) \ - $(GST_BASE_CFLAGS) \ - $(GST_PLUGINS_BASE_CFLAGS) \ - $(GST_VIDEO_CFLAGS) \ - $(GST_CODEC_PARSERS_CFLAGS) \ - $(NULL) - -libgstvaapi_parse_la_LIBADD = \ - $(top_builddir)/gst-libs/gst/codecparsers/libgstvaapi-codecparsers.la \ - $(GST_LIBS) \ - $(GST_BASE_LIBS) \ - $(GST_PLUGINS_BASE_LIBS) \ - $(GST_VIDEO_LIBS) -lgstpbutils-$(GST_PKG_VERSION) \ - $(GST_CODEC_PARSERS_LIBS) \ - $(NULL) - -libgstvaapi_parse_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) -libgstvaapi_parse_la_LIBTOOLFLAGS = --tag=disable-static - -videoparsers_sources_dir = \ - $(top_srcdir)/ext/codecparsers/gst/videoparsers -videoparsers_patches_dir = \ - $(top_srcdir)/patches/videoparsers -include $(videoparsers_patches_dir)/series.frag -videoparsers_patches = \ - $(videoparsers_patches_base:%=$(top_srcdir)/patches/videoparsers/%) -if USE_GST_API_1_4p -videoparsers_patches += \ - $(videoparsers_patches_1_4p:%=$(top_srcdir)/patches/videoparsers/%) -endif -videoparsers_orig_sources = \ - $(libgstvaapi_parse_gen_sources:%=$(videoparsers_sources_dir)/%) - -$(libgstvaapi_parse_gen_sources): $(videoparsers_orig_sources) - cp -f $(videoparsers_sources_dir)/$@ $@ - -videoparsers.prepare.stamp: $(videoparsers_patches) $(libgstvaapi_parse_gen_sources) - @for f in $(videoparsers_patches); do \ - patch -p3 < $$f; \ - done - @touch $@ - -BUILT_SOURCES += \ - $(libgstvaapi_parse_gen_sources) \ - videoparsers.prepare.stamp -endif - -CLEANFILES = \ - videoparsers.prepare.stamp \ - $(libgstvaapi_parse_gen_sources) - EXTRA_DIST = \ $(libgstvaapi_enc_source_c) \ $(libgstvaapi_enc_source_h) \ diff -Nru gstreamer-vaapi-0.7.0/gst/vaapi/Makefile.in gstreamer-vaapi-1.8.2/gst/vaapi/Makefile.in --- gstreamer-vaapi-0.7.0/gst/vaapi/Makefile.in 2015-12-07 10:54:25.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst/vaapi/Makefile.in 2016-06-09 07:27:12.000000000 +0000 @@ -90,26 +90,18 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -@USE_DRM_TRUE@am__append_1 = \ -@USE_DRM_TRUE@ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-drm-$(GST_API_VERSION).la - +@USE_DRM_TRUE@am__append_1 = $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-drm.la @USE_X11_TRUE@am__append_2 = \ @USE_X11_TRUE@ $(X11_LIBS) \ -@USE_X11_TRUE@ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11-$(GST_API_VERSION).la - -@USE_GLX_TRUE@am__append_3 = \ -@USE_GLX_TRUE@ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-glx-$(GST_API_VERSION).la - -@USE_EGL_TRUE@am__append_4 = \ -@USE_EGL_TRUE@ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-egl-$(GST_API_VERSION).la +@USE_X11_TRUE@ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11.la +@USE_GLX_TRUE@am__append_3 = $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-glx.la +@USE_EGL_TRUE@am__append_4 = $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-egl.la @USE_WAYLAND_TRUE@am__append_5 = \ @USE_WAYLAND_TRUE@ $(WAYLAND_CFLAGS) \ @USE_WAYLAND_TRUE@ $(NULL) -@USE_WAYLAND_TRUE@am__append_6 = \ -@USE_WAYLAND_TRUE@ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-wayland-$(GST_API_VERSION).la - +@USE_WAYLAND_TRUE@am__append_6 = $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-wayland.la @USE_GST_GL_HELPERS_TRUE@am__append_7 = $(GST_GL_CFLAGS) @USE_GST_GL_HELPERS_TRUE@am__append_8 = $(GST_GL_LIBS) @USE_ENCODERS_TRUE@am__append_9 = $(libgstvaapi_enc_source_c) @@ -120,26 +112,29 @@ @USE_VP8_ENCODER_TRUE@am__append_14 = $(libgstvaapi_vp8enc_source_h) @USE_H265_ENCODER_TRUE@am__append_15 = $(libgstvaapi_h265enc_source_c) @USE_H265_ENCODER_TRUE@am__append_16 = $(libgstvaapi_h265enc_source_h) -@USE_EGL_TRUE@am__append_17 = $(libgstvaapi_egl_source_c) -@USE_EGL_TRUE@am__append_18 = $(libgstvaapi_egl_source_h) -@USE_GST_API_1_2p_TRUE@am__append_19 = $(libgstvaapi_1_2p_source_c) -@USE_GST_API_1_2p_TRUE@am__append_20 = $(libgstvaapi_1_2p_source_h) -@USE_LOCAL_VIDEO_PARSERS_TRUE@am__append_21 = libgstvaapi_parse.la -@USE_GST_API_1_4p_TRUE@@USE_LOCAL_VIDEO_PARSERS_TRUE@am__append_22 = $(libgstvaapi_1_4p_parse_gen_source_c) -@USE_GST_API_1_4p_TRUE@@USE_LOCAL_VIDEO_PARSERS_TRUE@am__append_23 = $(libgstvaapi_1_4p_parse_gen_source_h) -@USE_GST_API_1_4p_TRUE@@USE_LOCAL_VIDEO_PARSERS_TRUE@am__append_24 = \ -@USE_GST_API_1_4p_TRUE@@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(videoparsers_patches_1_4p:%=$(top_srcdir)/patches/videoparsers/%) - -@USE_LOCAL_VIDEO_PARSERS_TRUE@am__append_25 = \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(libgstvaapi_parse_gen_sources) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ videoparsers.prepare.stamp - subdir = gst/vaapi ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-arch.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-platform.m4 \ + $(top_srcdir)/common/m4/gst-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__noinst_HEADERS_DIST) \ @@ -179,24 +174,25 @@ LTLIBRARIES = $(plugin_LTLIBRARIES) am__DEPENDENCIES_1 = @USE_X11_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) \ -@USE_X11_TRUE@ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11-$(GST_API_VERSION).la +@USE_X11_TRUE@ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11.la @USE_GST_GL_HELPERS_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) -am__DEPENDENCIES_4 = $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-$(GST_API_VERSION).la \ +am__DEPENDENCIES_4 = \ + $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi.la \ $(am__append_1) $(am__DEPENDENCIES_2) $(am__append_3) \ $(am__append_4) $(am__append_6) $(am__DEPENDENCIES_3) libgstvaapi_la_DEPENDENCIES = $(am__DEPENDENCIES_4) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__libgstvaapi_la_SOURCES_DIST = gstvaapi.c gstvaapidecode.c \ gstvaapipluginbase.c gstvaapipluginutil.c gstvaapipostproc.c \ gstvaapisink.c gstvaapivideobuffer.c gstvaapivideocontext.c \ gstvaapivideometa.c gstvaapidecodebin.c \ gstvaapivideobufferpool.c gstvaapivideomemory.c \ - gstvaapiencode.c gstvaapiencode_h264.c gstvaapiencode_mpeg2.c \ + gstvaapivideometa_texture.c gstvaapiencode.c \ + gstvaapiencode_h264.c gstvaapiencode_mpeg2.c \ gstvaapiencode_jpeg.c gstvaapiencode_vp8.c \ - gstvaapiencode_h265.c gstvaapivideometa_texture.c + gstvaapiencode_h265.c am__objects_1 = libgstvaapi_la-gstvaapiencode.lo \ libgstvaapi_la-gstvaapiencode_h264.lo \ libgstvaapi_la-gstvaapiencode_mpeg2.lo @@ -207,11 +203,7 @@ @USE_VP8_ENCODER_TRUE@am__objects_6 = $(am__objects_5) am__objects_7 = libgstvaapi_la-gstvaapiencode_h265.lo @USE_H265_ENCODER_TRUE@am__objects_8 = $(am__objects_7) -am__objects_9 = -@USE_EGL_TRUE@am__objects_10 = $(am__objects_9) -am__objects_11 = libgstvaapi_la-gstvaapivideometa_texture.lo -@USE_GST_API_1_2p_TRUE@am__objects_12 = $(am__objects_11) -am__objects_13 = libgstvaapi_la-gstvaapi.lo \ +am__objects_9 = libgstvaapi_la-gstvaapi.lo \ libgstvaapi_la-gstvaapidecode.lo \ libgstvaapi_la-gstvaapipluginbase.lo \ libgstvaapi_la-gstvaapipluginutil.lo \ @@ -222,10 +214,10 @@ libgstvaapi_la-gstvaapivideometa.lo \ libgstvaapi_la-gstvaapidecodebin.lo \ libgstvaapi_la-gstvaapivideobufferpool.lo \ - libgstvaapi_la-gstvaapivideomemory.lo $(am__objects_2) \ - $(am__objects_4) $(am__objects_6) $(am__objects_8) \ - $(am__objects_10) $(am__objects_12) -am_libgstvaapi_la_OBJECTS = $(am__objects_13) + libgstvaapi_la-gstvaapivideomemory.lo \ + libgstvaapi_la-gstvaapivideometa_texture.lo $(am__objects_2) \ + $(am__objects_4) $(am__objects_6) $(am__objects_8) +am_libgstvaapi_la_OBJECTS = $(am__objects_9) libgstvaapi_la_OBJECTS = $(am_libgstvaapi_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -235,32 +227,6 @@ $(libgstvaapi_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ $(CCLD) $(libgstvaapi_la_CFLAGS) $(CFLAGS) \ $(libgstvaapi_la_LDFLAGS) $(LDFLAGS) -o $@ -@USE_LOCAL_VIDEO_PARSERS_TRUE@libgstvaapi_parse_la_DEPENDENCIES = $(top_builddir)/gst-libs/gst/codecparsers/libgstvaapi-codecparsers.la \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(am__DEPENDENCIES_1) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(am__DEPENDENCIES_1) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(am__DEPENDENCIES_1) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(am__DEPENDENCIES_1) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(am__DEPENDENCIES_1) -am__libgstvaapi_parse_la_SOURCES_DIST = gstvaapiparse.c \ - gstvaapiparse.h -@USE_LOCAL_VIDEO_PARSERS_TRUE@am_libgstvaapi_parse_la_OBJECTS = libgstvaapi_parse_la-gstvaapiparse.lo -@USE_LOCAL_VIDEO_PARSERS_TRUE@am__objects_14 = libgstvaapi_parse_la-gsth265parse.lo -@USE_GST_API_1_4p_TRUE@@USE_LOCAL_VIDEO_PARSERS_TRUE@am__objects_15 = $(am__objects_14) -@USE_LOCAL_VIDEO_PARSERS_TRUE@am__objects_16 = libgstvaapi_parse_la-gsth264parse.lo \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(am__objects_15) -@USE_GST_API_1_4p_TRUE@@USE_LOCAL_VIDEO_PARSERS_TRUE@am__objects_17 = $(am__objects_9) -@USE_LOCAL_VIDEO_PARSERS_TRUE@am__objects_18 = $(am__objects_17) -@USE_LOCAL_VIDEO_PARSERS_TRUE@nodist_libgstvaapi_parse_la_OBJECTS = \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(am__objects_16) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(am__objects_18) -libgstvaapi_parse_la_OBJECTS = $(am_libgstvaapi_parse_la_OBJECTS) \ - $(nodist_libgstvaapi_parse_la_OBJECTS) -libgstvaapi_parse_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(libgstvaapi_parse_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(libgstvaapi_parse_la_CFLAGS) $(CFLAGS) \ - $(libgstvaapi_parse_la_LDFLAGS) $(LDFLAGS) -o $@ -@USE_LOCAL_VIDEO_PARSERS_TRUE@am_libgstvaapi_parse_la_rpath = -rpath \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(plugindir) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -295,10 +261,8 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libgstvaapi_la_SOURCES) $(libgstvaapi_parse_la_SOURCES) \ - $(nodist_libgstvaapi_parse_la_SOURCES) -DIST_SOURCES = $(am__libgstvaapi_la_SOURCES_DIST) \ - $(am__libgstvaapi_parse_la_SOURCES_DIST) +SOURCES = $(libgstvaapi_la_SOURCES) +DIST_SOURCES = $(am__libgstvaapi_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -309,9 +273,10 @@ gstvaapisink.h gstvaapivideobuffer.h gstvaapivideocontext.h \ gstvaapivideometa.h gstvaapidecodebin.h \ gstvaapivideobufferpool.h gstvaapivideomemory.h \ - gstvaapiencode.h gstvaapiencode_h264.h gstvaapiencode_mpeg2.h \ + gstvaapivideometa_texture.h gstvaapiencode.h \ + gstvaapiencode_h264.h gstvaapiencode_mpeg2.h \ gstvaapiencode_jpeg.h gstvaapiencode_vp8.h \ - gstvaapiencode_h265.h gstvaapivideometa_texture.h + gstvaapiencode_h265.h HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, @@ -336,9 +301,11 @@ $(top_srcdir)/build-aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ +AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -351,6 +318,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DRM_CFLAGS = @DRM_CFLAGS@ @@ -363,58 +331,64 @@ EGL_CFLAGS = @EGL_CFLAGS@ EGL_LIBS = @EGL_LIBS@ EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ GIT = @GIT@ GLES2_CFLAGS = @GLES2_CFLAGS@ GLES2_LIBS = @GLES2_LIBS@ GLES3_CFLAGS = @GLES3_CFLAGS@ GLES3_LIBS = @GLES3_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ -GLIB_VERSION_REQUIRED = @GLIB_VERSION_REQUIRED@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ -GMODULE_VERSION_REQUIRED = @GMODULE_VERSION_REQUIRED@ GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ GST_API_VERSION = @GST_API_VERSION@ -GST_BASEVIDEO_CFLAGS = @GST_BASEVIDEO_CFLAGS@ -GST_BASEVIDEO_LIBS = @GST_BASEVIDEO_LIBS@ GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ GST_BASE_LIBS = @GST_BASE_LIBS@ GST_CFLAGS = @GST_CFLAGS@ GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ +GST_CURRENT = @GST_CURRENT@ GST_GL_CFLAGS = @GST_GL_CFLAGS@ GST_GL_LIBS = @GST_GL_LIBS@ -GST_INTERFACES_CFLAGS = @GST_INTERFACES_CFLAGS@ -GST_INTERFACES_LIBS = @GST_INTERFACES_LIBS@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ GST_LIBS = @GST_LIBS@ -GST_PKG_VERSION = @GST_PKG_VERSION@ -GST_PLUGINS_BAD_VERSION_REQUIRED = @GST_PLUGINS_BAD_VERSION_REQUIRED@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PBUTILS_CFLAGS = @GST_PBUTILS_CFLAGS@ +GST_PBUTILS_LIBS = @GST_PBUTILS_LIBS@ GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ -GST_PLUGINS_BASE_VERSION_REQUIRED = @GST_PLUGINS_BASE_VERSION_REQUIRED@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ -GST_PLUGIN_PATH_1_0 = @GST_PLUGIN_PATH_1_0@ -GST_VAAPI_LT_LDFLAGS = @GST_VAAPI_LT_LDFLAGS@ -GST_VAAPI_LT_VERSION = @GST_VAAPI_LT_VERSION@ -GST_VAAPI_MAJOR_VERSION = @GST_VAAPI_MAJOR_VERSION@ -GST_VERSION_REQUIRED = @GST_VERSION_REQUIRED@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ -GTKDOC_VERSION = @GTKDOC_VERSION@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -423,6 +397,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -430,16 +405,15 @@ LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ LIBVA_LIBS = @LIBVA_LIBS@ -LIBVA_PACKAGE_VERSION = @LIBVA_PACKAGE_VERSION@ -LIBVA_PKGNAME = @LIBVA_PKGNAME@ LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ -LIBVA_X11_PKGNAME = @LIBVA_X11_PKGNAME@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -456,21 +430,27 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ -PATCH = @PATCH@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ -TODAY = @TODAY@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ VERSION = @VERSION@ -WAYLAND_API_VERSION = @WAYLAND_API_VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ WAYLAND_LIBS = @WAYLAND_LIBS@ X11_CFLAGS = @X11_CFLAGS@ @@ -479,7 +459,6 @@ XRANDR_LIBS = @XRANDR_LIBS@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ -YASM = @YASM@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -521,11 +500,15 @@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ plugindir = @plugindir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -538,27 +521,27 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -plugin_LTLIBRARIES = libgstvaapi.la $(am__append_21) +plugin_LTLIBRARIES = libgstvaapi.la libgstvaapi_CFLAGS = $(LIBVA_CFLAGS) -DGST_USE_UNSTABLE_API \ -I$(top_srcdir)/gst-libs -I$(top_builddir)/gst-libs $(NULL) \ $(am__append_5) $(am__append_7) -libgstvaapi_LIBS = $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-$(GST_API_VERSION).la \ +libgstvaapi_LIBS = $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi.la \ $(am__append_1) $(am__append_2) $(am__append_3) \ $(am__append_4) $(am__append_6) $(am__append_8) libgstvaapi_source_c = gstvaapi.c gstvaapidecode.c \ gstvaapipluginbase.c gstvaapipluginutil.c gstvaapipostproc.c \ gstvaapisink.c gstvaapivideobuffer.c gstvaapivideocontext.c \ gstvaapivideometa.c gstvaapidecodebin.c \ - gstvaapivideobufferpool.c gstvaapivideomemory.c $(NULL) \ - $(am__append_9) $(am__append_11) $(am__append_13) \ - $(am__append_15) $(am__append_17) $(am__append_19) + gstvaapivideobufferpool.c gstvaapivideomemory.c \ + gstvaapivideometa_texture.c $(NULL) $(am__append_9) \ + $(am__append_11) $(am__append_13) $(am__append_15) libgstvaapi_source_h = gstcompat.h gstvaapidecode.h \ gstvaapipluginbase.h gstvaapipluginutil.h gstvaapipostproc.h \ gstvaapisink.h gstvaapivideobuffer.h gstvaapivideocontext.h \ gstvaapivideometa.h gstvaapidecodebin.h \ - gstvaapivideobufferpool.h gstvaapivideomemory.h $(NULL) \ - $(am__append_10) $(am__append_12) $(am__append_14) \ - $(am__append_16) $(am__append_18) $(am__append_20) + gstvaapivideobufferpool.h gstvaapivideomemory.h \ + gstvaapivideometa_texture.h $(NULL) $(am__append_10) \ + $(am__append_12) $(am__append_14) $(am__append_16) libgstvaapi_enc_source_c = \ gstvaapiencode.c \ gstvaapiencode_h264.c \ @@ -577,16 +560,6 @@ libgstvaapi_vp8enc_source_h = gstvaapiencode_vp8.h libgstvaapi_h265enc_source_c = gstvaapiencode_h265.c libgstvaapi_h265enc_source_h = gstvaapiencode_h265.h -libgstvaapi_egl_source_c = -libgstvaapi_egl_source_h = -libgstvaapi_1_2p_source_c = \ - gstvaapivideometa_texture.c \ - $(NULL) - -libgstvaapi_1_2p_source_h = \ - gstvaapivideometa_texture.h \ - $(NULL) - libgstvaapi_la_SOURCES = $(libgstvaapi_source_c) noinst_HEADERS = $(libgstvaapi_source_h) libgstvaapi_la_CFLAGS = \ @@ -594,6 +567,7 @@ $(GST_CFLAGS) \ $(GST_BASE_CFLAGS) \ $(GST_VIDEO_CFLAGS) \ + $(GST_PBUTILS_CFLAGS) \ $(GST_INTERFACES_CFLAGS) \ $(GST_BASEVIDEO_CFLAGS) \ $(GST_PLUGINS_BASE_CFLAGS) \ @@ -603,7 +577,8 @@ $(libgstvaapi_LIBS) \ $(GST_LIBS) \ $(GST_BASE_LIBS) \ - $(GST_VIDEO_LIBS) -lgstpbutils-$(GST_PKG_VERSION) \ + $(GST_VIDEO_LIBS) \ + $(GST_PBUTILS_LIBS) \ $(GST_INTERFACES_LIBS) \ $(GST_BASEVIDEO_LIBS) \ $(GST_PLUGINS_BASE_LIBS) \ @@ -611,69 +586,6 @@ libgstvaapi_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) libgstvaapi_la_LIBTOOLFLAGS = --tag=disable-static -BUILT_SOURCES = $(am__append_25) -@USE_LOCAL_VIDEO_PARSERS_TRUE@libgstvaapi_parse_gen_source_c = \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ gsth264parse.c $(NULL) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(am__append_22) -@USE_LOCAL_VIDEO_PARSERS_TRUE@libgstvaapi_parse_gen_source_h = \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ gsth264parse.h $(NULL) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(am__append_23) -@USE_LOCAL_VIDEO_PARSERS_TRUE@libgstvaapi_1_4p_parse_gen_source_c = \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ gsth265parse.c \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(NULL) - -@USE_LOCAL_VIDEO_PARSERS_TRUE@libgstvaapi_1_4p_parse_gen_source_h = \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ gsth265parse.h \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(NULL) - -@USE_LOCAL_VIDEO_PARSERS_TRUE@libgstvaapi_parse_gen_sources = \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(libgstvaapi_parse_gen_source_c) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(libgstvaapi_parse_gen_source_h) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(NULL) - -@USE_LOCAL_VIDEO_PARSERS_TRUE@libgstvaapi_parse_la_SOURCES = gstvaapiparse.c gstvaapiparse.h -@USE_LOCAL_VIDEO_PARSERS_TRUE@nodist_libgstvaapi_parse_la_SOURCES = \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(libgstvaapi_parse_gen_source_c) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(libgstvaapi_parse_gen_source_h) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(NULL) - -@USE_LOCAL_VIDEO_PARSERS_TRUE@libgstvaapi_parse_la_CFLAGS = \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ -DGST_USE_UNSTABLE_API \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ -I$(top_srcdir)/gst-libs \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ -I$(top_builddir)/gst-libs \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(GST_CFLAGS) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(GST_BASE_CFLAGS) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(GST_PLUGINS_BASE_CFLAGS) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(GST_VIDEO_CFLAGS) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(GST_CODEC_PARSERS_CFLAGS) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(NULL) - -@USE_LOCAL_VIDEO_PARSERS_TRUE@libgstvaapi_parse_la_LIBADD = \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(top_builddir)/gst-libs/gst/codecparsers/libgstvaapi-codecparsers.la \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(GST_LIBS) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(GST_BASE_LIBS) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(GST_PLUGINS_BASE_LIBS) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(GST_VIDEO_LIBS) -lgstpbutils-$(GST_PKG_VERSION) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(GST_CODEC_PARSERS_LIBS) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(NULL) - -@USE_LOCAL_VIDEO_PARSERS_TRUE@libgstvaapi_parse_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) -@USE_LOCAL_VIDEO_PARSERS_TRUE@libgstvaapi_parse_la_LIBTOOLFLAGS = --tag=disable-static -@USE_LOCAL_VIDEO_PARSERS_TRUE@videoparsers_sources_dir = \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(top_srcdir)/ext/codecparsers/gst/videoparsers - -@USE_LOCAL_VIDEO_PARSERS_TRUE@videoparsers_patches_dir = \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(top_srcdir)/patches/videoparsers - -@USE_LOCAL_VIDEO_PARSERS_TRUE@videoparsers_patches = $(videoparsers_patches_base:%=$(top_srcdir)/patches/videoparsers/%) \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(am__append_24) -@USE_LOCAL_VIDEO_PARSERS_TRUE@videoparsers_orig_sources = \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ $(libgstvaapi_parse_gen_sources:%=$(videoparsers_sources_dir)/%) - -CLEANFILES = \ - videoparsers.prepare.stamp \ - $(libgstvaapi_parse_gen_sources) - EXTRA_DIST = \ $(libgstvaapi_enc_source_c) \ $(libgstvaapi_enc_source_h) \ @@ -689,12 +601,11 @@ $(libgstvaapi_1_2p_source_h) \ $(NULL) -all: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) all-am +all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -718,9 +629,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): @@ -762,9 +673,6 @@ libgstvaapi.la: $(libgstvaapi_la_OBJECTS) $(libgstvaapi_la_DEPENDENCIES) $(EXTRA_libgstvaapi_la_DEPENDENCIES) $(AM_V_CCLD)$(libgstvaapi_la_LINK) -rpath $(plugindir) $(libgstvaapi_la_OBJECTS) $(libgstvaapi_la_LIBADD) $(LIBS) -libgstvaapi_parse.la: $(libgstvaapi_parse_la_OBJECTS) $(libgstvaapi_parse_la_DEPENDENCIES) $(EXTRA_libgstvaapi_parse_la_DEPENDENCIES) - $(AM_V_CCLD)$(libgstvaapi_parse_la_LINK) $(am_libgstvaapi_parse_la_rpath) $(libgstvaapi_parse_la_OBJECTS) $(libgstvaapi_parse_la_LIBADD) $(LIBS) - mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -790,27 +698,27 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapivideomemory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapivideometa.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapivideometa_texture.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_parse_la-gsth264parse.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_parse_la-gsth265parse.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_parse_la-gstvaapiparse.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @@ -899,6 +807,13 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstvaapi_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapivideomemory.lo `test -f 'gstvaapivideomemory.c' || echo '$(srcdir)/'`gstvaapivideomemory.c +libgstvaapi_la-gstvaapivideometa_texture.lo: gstvaapivideometa_texture.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstvaapi_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapivideometa_texture.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapivideometa_texture.Tpo -c -o libgstvaapi_la-gstvaapivideometa_texture.lo `test -f 'gstvaapivideometa_texture.c' || echo '$(srcdir)/'`gstvaapivideometa_texture.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapivideometa_texture.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapivideometa_texture.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapivideometa_texture.c' object='libgstvaapi_la-gstvaapivideometa_texture.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstvaapi_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapivideometa_texture.lo `test -f 'gstvaapivideometa_texture.c' || echo '$(srcdir)/'`gstvaapivideometa_texture.c + libgstvaapi_la-gstvaapiencode.lo: gstvaapiencode.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstvaapi_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapiencode.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapiencode.Tpo -c -o libgstvaapi_la-gstvaapiencode.lo `test -f 'gstvaapiencode.c' || echo '$(srcdir)/'`gstvaapiencode.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapiencode.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapiencode.Plo @@ -941,34 +856,6 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstvaapi_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapiencode_h265.lo `test -f 'gstvaapiencode_h265.c' || echo '$(srcdir)/'`gstvaapiencode_h265.c -libgstvaapi_la-gstvaapivideometa_texture.lo: gstvaapivideometa_texture.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstvaapi_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapivideometa_texture.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapivideometa_texture.Tpo -c -o libgstvaapi_la-gstvaapivideometa_texture.lo `test -f 'gstvaapivideometa_texture.c' || echo '$(srcdir)/'`gstvaapivideometa_texture.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapivideometa_texture.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapivideometa_texture.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapivideometa_texture.c' object='libgstvaapi_la-gstvaapivideometa_texture.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstvaapi_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapivideometa_texture.lo `test -f 'gstvaapivideometa_texture.c' || echo '$(srcdir)/'`gstvaapivideometa_texture.c - -libgstvaapi_parse_la-gstvaapiparse.lo: gstvaapiparse.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstvaapi_parse_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_parse_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_parse_la-gstvaapiparse.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_parse_la-gstvaapiparse.Tpo -c -o libgstvaapi_parse_la-gstvaapiparse.lo `test -f 'gstvaapiparse.c' || echo '$(srcdir)/'`gstvaapiparse.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_parse_la-gstvaapiparse.Tpo $(DEPDIR)/libgstvaapi_parse_la-gstvaapiparse.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiparse.c' object='libgstvaapi_parse_la-gstvaapiparse.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstvaapi_parse_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_parse_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_parse_la-gstvaapiparse.lo `test -f 'gstvaapiparse.c' || echo '$(srcdir)/'`gstvaapiparse.c - -libgstvaapi_parse_la-gsth264parse.lo: gsth264parse.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstvaapi_parse_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_parse_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_parse_la-gsth264parse.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_parse_la-gsth264parse.Tpo -c -o libgstvaapi_parse_la-gsth264parse.lo `test -f 'gsth264parse.c' || echo '$(srcdir)/'`gsth264parse.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_parse_la-gsth264parse.Tpo $(DEPDIR)/libgstvaapi_parse_la-gsth264parse.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsth264parse.c' object='libgstvaapi_parse_la-gsth264parse.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstvaapi_parse_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_parse_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_parse_la-gsth264parse.lo `test -f 'gsth264parse.c' || echo '$(srcdir)/'`gsth264parse.c - -libgstvaapi_parse_la-gsth265parse.lo: gsth265parse.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstvaapi_parse_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_parse_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_parse_la-gsth265parse.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_parse_la-gsth265parse.Tpo -c -o libgstvaapi_parse_la-gsth265parse.lo `test -f 'gsth265parse.c' || echo '$(srcdir)/'`gsth265parse.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_parse_la-gsth265parse.Tpo $(DEPDIR)/libgstvaapi_parse_la-gsth265parse.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsth265parse.c' object='libgstvaapi_parse_la-gsth265parse.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstvaapi_parse_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_parse_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_parse_la-gsth265parse.lo `test -f 'gsth265parse.c' || echo '$(srcdir)/'`gsth265parse.c - mostlyclean-libtool: -rm -f *.lo @@ -1058,15 +945,13 @@ fi; \ done check-am: all-am -check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-am +check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(plugindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-am +install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -1088,7 +973,6 @@ mostlyclean-generic: clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -1097,7 +981,6 @@ maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool clean-pluginLTLIBRARIES \ @@ -1169,7 +1052,7 @@ uninstall-am: uninstall-pluginLTLIBRARIES -.MAKE: all check install install-am install-strip +.MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pluginLTLIBRARIES cscopelist-am ctags \ @@ -1188,16 +1071,6 @@ .PRECIOUS: Makefile -@USE_LOCAL_VIDEO_PARSERS_TRUE@include $(videoparsers_patches_dir)/series.frag - -@USE_LOCAL_VIDEO_PARSERS_TRUE@$(libgstvaapi_parse_gen_sources): $(videoparsers_orig_sources) -@USE_LOCAL_VIDEO_PARSERS_TRUE@ cp -f $(videoparsers_sources_dir)/$@ $@ - -@USE_LOCAL_VIDEO_PARSERS_TRUE@videoparsers.prepare.stamp: $(videoparsers_patches) $(libgstvaapi_parse_gen_sources) -@USE_LOCAL_VIDEO_PARSERS_TRUE@ @for f in $(videoparsers_patches); do \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ patch -p3 < $$f; \ -@USE_LOCAL_VIDEO_PARSERS_TRUE@ done -@USE_LOCAL_VIDEO_PARSERS_TRUE@ @touch $@ -include $(top_srcdir)/git.mk diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/base/Makefile.in gstreamer-vaapi-1.8.2/gst-libs/gst/base/Makefile.in --- gstreamer-vaapi-0.7.0/gst-libs/gst/base/Makefile.in 2015-12-07 10:54:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/base/Makefile.in 2016-06-09 07:27:12.000000000 +0000 @@ -91,10 +91,27 @@ target_triplet = @target@ subdir = gst-libs/gst/base ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-arch.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-platform.m4 \ + $(top_srcdir)/common/m4/gst-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -182,9 +199,11 @@ $(top_srcdir)/build-aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ +AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -197,6 +216,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DRM_CFLAGS = @DRM_CFLAGS@ @@ -209,58 +229,64 @@ EGL_CFLAGS = @EGL_CFLAGS@ EGL_LIBS = @EGL_LIBS@ EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ GIT = @GIT@ GLES2_CFLAGS = @GLES2_CFLAGS@ GLES2_LIBS = @GLES2_LIBS@ GLES3_CFLAGS = @GLES3_CFLAGS@ GLES3_LIBS = @GLES3_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ -GLIB_VERSION_REQUIRED = @GLIB_VERSION_REQUIRED@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ -GMODULE_VERSION_REQUIRED = @GMODULE_VERSION_REQUIRED@ GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ GST_API_VERSION = @GST_API_VERSION@ -GST_BASEVIDEO_CFLAGS = @GST_BASEVIDEO_CFLAGS@ -GST_BASEVIDEO_LIBS = @GST_BASEVIDEO_LIBS@ GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ GST_BASE_LIBS = @GST_BASE_LIBS@ GST_CFLAGS = @GST_CFLAGS@ GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ +GST_CURRENT = @GST_CURRENT@ GST_GL_CFLAGS = @GST_GL_CFLAGS@ GST_GL_LIBS = @GST_GL_LIBS@ -GST_INTERFACES_CFLAGS = @GST_INTERFACES_CFLAGS@ -GST_INTERFACES_LIBS = @GST_INTERFACES_LIBS@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ GST_LIBS = @GST_LIBS@ -GST_PKG_VERSION = @GST_PKG_VERSION@ -GST_PLUGINS_BAD_VERSION_REQUIRED = @GST_PLUGINS_BAD_VERSION_REQUIRED@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PBUTILS_CFLAGS = @GST_PBUTILS_CFLAGS@ +GST_PBUTILS_LIBS = @GST_PBUTILS_LIBS@ GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ -GST_PLUGINS_BASE_VERSION_REQUIRED = @GST_PLUGINS_BASE_VERSION_REQUIRED@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ -GST_PLUGIN_PATH_1_0 = @GST_PLUGIN_PATH_1_0@ -GST_VAAPI_LT_LDFLAGS = @GST_VAAPI_LT_LDFLAGS@ -GST_VAAPI_LT_VERSION = @GST_VAAPI_LT_VERSION@ -GST_VAAPI_MAJOR_VERSION = @GST_VAAPI_MAJOR_VERSION@ -GST_VERSION_REQUIRED = @GST_VERSION_REQUIRED@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ -GTKDOC_VERSION = @GTKDOC_VERSION@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -269,6 +295,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -276,16 +303,15 @@ LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ LIBVA_LIBS = @LIBVA_LIBS@ -LIBVA_PACKAGE_VERSION = @LIBVA_PACKAGE_VERSION@ -LIBVA_PKGNAME = @LIBVA_PKGNAME@ LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ -LIBVA_X11_PKGNAME = @LIBVA_X11_PKGNAME@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -302,21 +328,27 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ -PATCH = @PATCH@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ -TODAY = @TODAY@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ VERSION = @VERSION@ -WAYLAND_API_VERSION = @WAYLAND_API_VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ WAYLAND_LIBS = @WAYLAND_LIBS@ X11_CFLAGS = @X11_CFLAGS@ @@ -325,7 +357,6 @@ XRANDR_LIBS = @XRANDR_LIBS@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ -YASM = @YASM@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -367,11 +398,15 @@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ plugindir = @plugindir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -434,7 +469,7 @@ .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -458,9 +493,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): @@ -487,22 +522,25 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_baseutils_la-gstbitwriter.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/codecparsers/gstvaapilibvpx.c gstreamer-vaapi-1.8.2/gst-libs/gst/codecparsers/gstvaapilibvpx.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/codecparsers/gstvaapilibvpx.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/codecparsers/gstvaapilibvpx.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ -/* - * gstvaapilibvpx.c - libvpx wrapper for gstreamer-vaapi - * - * Copyright (C) 2014 Intel Corporation - * Author: Gwenole Beauchesne - * - * 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; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "gstvp8rangedecoder.h" -#include "vp8utils.h" -#include "gstlibvpx.h" - -#define BOOL_DECODER_CAST(rd) \ - ((vp8_bool_decoder *)(&(rd)->_gst_reserved[0])) - -#define BOOL_DECODER_STATE_CAST(s) \ - ((vp8_bool_decoder_state *)(s)) - -gboolean -gst_vp8_range_decoder_init (GstVp8RangeDecoder * rd, const guchar * buf, - guint buf_size) -{ - vp8_bool_decoder *const bd = BOOL_DECODER_CAST (rd); - - g_return_val_if_fail (sizeof (rd->_gst_reserved) >= sizeof (*bd), FALSE); - - rd->buf = buf; - rd->buf_size = buf_size; - return vp8_bool_decoder_init (bd, buf, buf_size); -} - -gint -gst_vp8_range_decoder_read (GstVp8RangeDecoder * rd, guint8 prob) -{ - return vp8_bool_decoder_read (BOOL_DECODER_CAST (rd), prob); -} - -gint -gst_vp8_range_decoder_read_literal (GstVp8RangeDecoder * rd, gint bits) -{ - return vp8_bool_decoder_read_literal (BOOL_DECODER_CAST (rd), bits); -} - -guint -gst_vp8_range_decoder_get_pos (GstVp8RangeDecoder * rd) -{ - return vp8_bool_decoder_get_pos (BOOL_DECODER_CAST (rd)); -} - -void -gst_vp8_range_decoder_get_state (GstVp8RangeDecoder * rd, - GstVp8RangeDecoderState * state) -{ - vp8_bool_decoder_get_state (BOOL_DECODER_CAST (rd), - BOOL_DECODER_STATE_CAST (state)); -} - -void -gst_vp8_token_update_probs_init (GstVp8TokenProbs * probs) -{ - vp8_init_token_update_probs (probs->prob); -} - -void -gst_vp8_token_probs_init_defaults (GstVp8TokenProbs * probs) -{ - vp8_init_default_token_probs (probs->prob); -} - -void -gst_vp8_mv_update_probs_init (GstVp8MvProbs * probs) -{ - vp8_init_mv_update_probs (probs->prob); -} - -void -gst_vp8_mv_probs_init_defaults (GstVp8MvProbs * probs) -{ - vp8_init_default_mv_probs (probs->prob); -} - -void -gst_vp8_mode_probs_init_defaults (GstVp8ModeProbs * probs, gboolean key_frame) -{ - if (key_frame) { - vp8_init_default_intra_mode_probs (probs->y_prob, probs->uv_prob); - } else { - vp8_init_default_inter_mode_probs (probs->y_prob, probs->uv_prob); - } -} diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/codecparsers/Makefile.am gstreamer-vaapi-1.8.2/gst-libs/gst/codecparsers/Makefile.am --- gstreamer-vaapi-0.7.0/gst-libs/gst/codecparsers/Makefile.am 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/codecparsers/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,115 +0,0 @@ -noinst_LTLIBRARIES = \ - libgstvaapi-codecparsers.la \ - $(NULL) - -local_codecparsers_srcdir = \ - $(top_srcdir)/ext/codecparsers/gst-libs/gst/codecparsers - -libgstvaapi_codecparsers_cflags = \ - -DGST_USE_UNSTABLE_API \ - -I$(top_srcdir)/gst-libs \ - -I$(top_builddir)/gst-libs \ - $(GST_BASE_CFLAGS) \ - $(GST_CFLAGS) \ - $(NULL) - -libgstvaapi_codecparsers_libs = \ - $(GST_BASE_LIBS) \ - $(GST_LIBS) \ - $(NULL) - -add_source_c = -add_source_h = -gen_source_c = parserutils.c nalutils.c -gen_source_h = parserutils.h nalutils.h - -# Always build VC-1 and MPEG-4 parsers for now -gen_source_c += gstvc1parser.c gstmpeg4parser.c -gen_source_h += gstvc1parser.h gstmpeg4parser.h - -if USE_LOCAL_CODEC_PARSERS_JPEG -gen_source_c += gstjpegparser.c -gen_source_h += gstjpegparser.h -endif - -if USE_LOCAL_CODEC_PARSERS_MPEG2 -gen_source_c += gstmpegvideoparser.c -gen_source_h += gstmpegvideoparser.h -endif - -if USE_LOCAL_CODEC_PARSERS_H264 -gen_source_c += gsth264parser.c -gen_source_h += gsth264parser.h -endif - -if USE_LOCAL_CODEC_PARSERS_VP8 -gen_source_c += gstvp8parser.c -gen_source_h += gstvp8parser.h gstvp8rangedecoder.h vp8utils.h - -if USE_BUILTIN_LIBVPX -add_source_c += gstvaapilibvpx.c - -libgstvaapi_codecparsers_cflags += \ - -I$(top_srcdir)/ext/libvpx \ - -I$(top_srcdir)/ext/libvpx/upstream \ - -I$(top_builddir)/ext/libvpx/upstream - -libgstvaapi_codecparsers_libs += \ - $(top_builddir)/ext/libvpx/libgstcodecparsers_vpx.la -else -gen_source_c += dboolhuff.c gstvp8rangedecoder.c vp8utils.c -gen_source_h += dboolhuff.h -endif -endif - -if USE_LOCAL_CODEC_PARSERS_VP9 -gen_source_c += gstvp9parser.c vp9utils.c -gen_source_h += gstvp9parser.h vp9utils.h -endif - -if USE_LOCAL_CODEC_PARSERS_H265 -gen_source_c += gsth265parser.c -gen_source_h += gsth265parser.h -endif - -GENFILES = \ - $(gen_source_c) \ - $(gen_source_h) \ - $(NULL) - -nodist_EXTRA_libgstvaapi_codecparsers_la_SOURCES = dummy.c - -nodist_libgstvaapi_codecparsers_la_SOURCES = \ - $(gen_source_c) \ - $(add_source_c) \ - $(NULL) - -libgstvaapi_codecparsers_la_CFLAGS = \ - $(libgstvaapi_codecparsers_cflags) \ - $(NULL) - -libgstvaapi_codecparsers_la_LIBADD = \ - $(libgstvaapi_codecparsers_libs) \ - $(NULL) - -libgstvaapi_codecparsers_la_LDFLAGS = \ - $(GST_ALL_LDFLAGS) \ - $(NULL) - -all-local: .timestamp.symlinks - -.timestamp.symlinks: $(GENFILES) - touch $@ - -$(gen_source_c): %.c: $(local_codecparsers_srcdir)/%.c $(gen_source_h) - $(LN_S) -f $< $@ -$(gen_source_h): %.h: $(local_codecparsers_srcdir)/%.h - $(LN_S) -f $< $@ -$(top_builddir)/ext/libvpx/libgstcodecparsers_vpx.la: - $(MAKE) -C $(top_builddir)/ext/libvpx - -EXTRA_DIST = gstvaapilibvpx.c - -DISTCLEANFILES = $(GENFILES) .timestamp.symlinks - --include $(top_srcdir)/git.mk diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/codecparsers/Makefile.in gstreamer-vaapi-1.8.2/gst-libs/gst/codecparsers/Makefile.in --- gstreamer-vaapi-0.7.0/gst-libs/gst/codecparsers/Makefile.in 2015-12-07 10:54:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/codecparsers/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,912 +0,0 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2014 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -@USE_LOCAL_CODEC_PARSERS_JPEG_TRUE@am__append_1 = gstjpegparser.c -@USE_LOCAL_CODEC_PARSERS_JPEG_TRUE@am__append_2 = gstjpegparser.h -@USE_LOCAL_CODEC_PARSERS_MPEG2_TRUE@am__append_3 = gstmpegvideoparser.c -@USE_LOCAL_CODEC_PARSERS_MPEG2_TRUE@am__append_4 = gstmpegvideoparser.h -@USE_LOCAL_CODEC_PARSERS_H264_TRUE@am__append_5 = gsth264parser.c -@USE_LOCAL_CODEC_PARSERS_H264_TRUE@am__append_6 = gsth264parser.h -@USE_LOCAL_CODEC_PARSERS_VP8_TRUE@am__append_7 = gstvp8parser.c -@USE_LOCAL_CODEC_PARSERS_VP8_TRUE@am__append_8 = gstvp8parser.h gstvp8rangedecoder.h vp8utils.h -@USE_BUILTIN_LIBVPX_TRUE@@USE_LOCAL_CODEC_PARSERS_VP8_TRUE@am__append_9 = gstvaapilibvpx.c -@USE_BUILTIN_LIBVPX_TRUE@@USE_LOCAL_CODEC_PARSERS_VP8_TRUE@am__append_10 = \ -@USE_BUILTIN_LIBVPX_TRUE@@USE_LOCAL_CODEC_PARSERS_VP8_TRUE@ -I$(top_srcdir)/ext/libvpx \ -@USE_BUILTIN_LIBVPX_TRUE@@USE_LOCAL_CODEC_PARSERS_VP8_TRUE@ -I$(top_srcdir)/ext/libvpx/upstream \ -@USE_BUILTIN_LIBVPX_TRUE@@USE_LOCAL_CODEC_PARSERS_VP8_TRUE@ -I$(top_builddir)/ext/libvpx/upstream - -@USE_BUILTIN_LIBVPX_TRUE@@USE_LOCAL_CODEC_PARSERS_VP8_TRUE@am__append_11 = \ -@USE_BUILTIN_LIBVPX_TRUE@@USE_LOCAL_CODEC_PARSERS_VP8_TRUE@ $(top_builddir)/ext/libvpx/libgstcodecparsers_vpx.la - -@USE_BUILTIN_LIBVPX_FALSE@@USE_LOCAL_CODEC_PARSERS_VP8_TRUE@am__append_12 = dboolhuff.c gstvp8rangedecoder.c vp8utils.c -@USE_BUILTIN_LIBVPX_FALSE@@USE_LOCAL_CODEC_PARSERS_VP8_TRUE@am__append_13 = dboolhuff.h -@USE_LOCAL_CODEC_PARSERS_VP9_TRUE@am__append_14 = gstvp9parser.c vp9utils.c -@USE_LOCAL_CODEC_PARSERS_VP9_TRUE@am__append_15 = gstvp9parser.h vp9utils.h -@USE_LOCAL_CODEC_PARSERS_H265_TRUE@am__append_16 = gsth265parser.c -@USE_LOCAL_CODEC_PARSERS_H265_TRUE@am__append_17 = gsth265parser.h -subdir = gst-libs/gst/codecparsers -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) -am__DEPENDENCIES_1 = -am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__append_11) -libgstvaapi_codecparsers_la_DEPENDENCIES = $(am__DEPENDENCIES_2) -@USE_LOCAL_CODEC_PARSERS_JPEG_TRUE@am__objects_1 = libgstvaapi_codecparsers_la-gstjpegparser.lo -@USE_LOCAL_CODEC_PARSERS_MPEG2_TRUE@am__objects_2 = libgstvaapi_codecparsers_la-gstmpegvideoparser.lo -@USE_LOCAL_CODEC_PARSERS_H264_TRUE@am__objects_3 = libgstvaapi_codecparsers_la-gsth264parser.lo -@USE_LOCAL_CODEC_PARSERS_VP8_TRUE@am__objects_4 = libgstvaapi_codecparsers_la-gstvp8parser.lo -@USE_BUILTIN_LIBVPX_FALSE@@USE_LOCAL_CODEC_PARSERS_VP8_TRUE@am__objects_5 = libgstvaapi_codecparsers_la-dboolhuff.lo \ -@USE_BUILTIN_LIBVPX_FALSE@@USE_LOCAL_CODEC_PARSERS_VP8_TRUE@ libgstvaapi_codecparsers_la-gstvp8rangedecoder.lo \ -@USE_BUILTIN_LIBVPX_FALSE@@USE_LOCAL_CODEC_PARSERS_VP8_TRUE@ libgstvaapi_codecparsers_la-vp8utils.lo -@USE_LOCAL_CODEC_PARSERS_VP9_TRUE@am__objects_6 = libgstvaapi_codecparsers_la-gstvp9parser.lo \ -@USE_LOCAL_CODEC_PARSERS_VP9_TRUE@ libgstvaapi_codecparsers_la-vp9utils.lo -@USE_LOCAL_CODEC_PARSERS_H265_TRUE@am__objects_7 = libgstvaapi_codecparsers_la-gsth265parser.lo -am__objects_8 = libgstvaapi_codecparsers_la-parserutils.lo \ - libgstvaapi_codecparsers_la-nalutils.lo \ - libgstvaapi_codecparsers_la-gstvc1parser.lo \ - libgstvaapi_codecparsers_la-gstmpeg4parser.lo $(am__objects_1) \ - $(am__objects_2) $(am__objects_3) $(am__objects_4) \ - $(am__objects_5) $(am__objects_6) $(am__objects_7) -@USE_BUILTIN_LIBVPX_TRUE@@USE_LOCAL_CODEC_PARSERS_VP8_TRUE@am__objects_9 = libgstvaapi_codecparsers_la-gstvaapilibvpx.lo -am__objects_10 = $(am__objects_9) -nodist_libgstvaapi_codecparsers_la_OBJECTS = $(am__objects_8) \ - $(am__objects_10) -libgstvaapi_codecparsers_la_OBJECTS = \ - $(nodist_libgstvaapi_codecparsers_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -libgstvaapi_codecparsers_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) \ - $(libgstvaapi_codecparsers_la_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(nodist_libgstvaapi_codecparsers_la_SOURCES) \ - $(nodist_EXTRA_libgstvaapi_codecparsers_la_SOURCES) -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -am__DIST_COMMON = $(srcdir)/Makefile.in \ - $(top_srcdir)/build-aux/depcomp -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DLOPEN_LIBS = @DLOPEN_LIBS@ -DRM_CFLAGS = @DRM_CFLAGS@ -DRM_LIBS = @DRM_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGL_CFLAGS = @EGL_CFLAGS@ -EGL_LIBS = @EGL_LIBS@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GIT = @GIT@ -GLES2_CFLAGS = @GLES2_CFLAGS@ -GLES2_LIBS = @GLES2_LIBS@ -GLES3_CFLAGS = @GLES3_CFLAGS@ -GLES3_LIBS = @GLES3_LIBS@ -GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_LIBS = @GLIB_LIBS@ -GLIB_VERSION_REQUIRED = @GLIB_VERSION_REQUIRED@ -GL_CFLAGS = @GL_CFLAGS@ -GL_LIBS = @GL_LIBS@ -GMODULE_CFLAGS = @GMODULE_CFLAGS@ -GMODULE_LIBS = @GMODULE_LIBS@ -GMODULE_VERSION_REQUIRED = @GMODULE_VERSION_REQUIRED@ -GREP = @GREP@ -GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ -GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ -GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ -GST_API_VERSION = @GST_API_VERSION@ -GST_BASEVIDEO_CFLAGS = @GST_BASEVIDEO_CFLAGS@ -GST_BASEVIDEO_LIBS = @GST_BASEVIDEO_LIBS@ -GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ -GST_BASE_LIBS = @GST_BASE_LIBS@ -GST_CFLAGS = @GST_CFLAGS@ -GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ -GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ -GST_GL_CFLAGS = @GST_GL_CFLAGS@ -GST_GL_LIBS = @GST_GL_LIBS@ -GST_INTERFACES_CFLAGS = @GST_INTERFACES_CFLAGS@ -GST_INTERFACES_LIBS = @GST_INTERFACES_LIBS@ -GST_LIBS = @GST_LIBS@ -GST_PKG_VERSION = @GST_PKG_VERSION@ -GST_PLUGINS_BAD_VERSION_REQUIRED = @GST_PLUGINS_BAD_VERSION_REQUIRED@ -GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ -GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ -GST_PLUGINS_BASE_VERSION_REQUIRED = @GST_PLUGINS_BASE_VERSION_REQUIRED@ -GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ -GST_PLUGIN_PATH_1_0 = @GST_PLUGIN_PATH_1_0@ -GST_VAAPI_LT_LDFLAGS = @GST_VAAPI_LT_LDFLAGS@ -GST_VAAPI_LT_VERSION = @GST_VAAPI_LT_VERSION@ -GST_VAAPI_MAJOR_VERSION = @GST_VAAPI_MAJOR_VERSION@ -GST_VERSION_REQUIRED = @GST_VERSION_REQUIRED@ -GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ -GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ -GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ -GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ -GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ -GTKDOC_MKPDF = @GTKDOC_MKPDF@ -GTKDOC_REBASE = @GTKDOC_REBASE@ -GTKDOC_VERSION = @GTKDOC_VERSION@ -HTML_DIR = @HTML_DIR@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBVA_CFLAGS = @LIBVA_CFLAGS@ -LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ -LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ -LIBVA_LIBS = @LIBVA_LIBS@ -LIBVA_PACKAGE_VERSION = @LIBVA_PACKAGE_VERSION@ -LIBVA_PKGNAME = @LIBVA_PKGNAME@ -LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ -LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ -LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ -LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ -LIBVA_X11_PKGNAME = @LIBVA_X11_PKGNAME@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATCH = @PATCH@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TODAY = @TODAY@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ -VERSION = @VERSION@ -WAYLAND_API_VERSION = @WAYLAND_API_VERSION@ -WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ -WAYLAND_LIBS = @WAYLAND_LIBS@ -X11_CFLAGS = @X11_CFLAGS@ -X11_LIBS = @X11_LIBS@ -XRANDR_CFLAGS = @XRANDR_CFLAGS@ -XRANDR_LIBS = @XRANDR_LIBS@ -XRENDER_CFLAGS = @XRENDER_CFLAGS@ -XRENDER_LIBS = @XRENDER_LIBS@ -YASM = @YASM@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ -plugindir = @plugindir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -noinst_LTLIBRARIES = \ - libgstvaapi-codecparsers.la \ - $(NULL) - -local_codecparsers_srcdir = \ - $(top_srcdir)/ext/codecparsers/gst-libs/gst/codecparsers - -libgstvaapi_codecparsers_cflags = -DGST_USE_UNSTABLE_API \ - -I$(top_srcdir)/gst-libs -I$(top_builddir)/gst-libs \ - $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(NULL) $(am__append_10) -libgstvaapi_codecparsers_libs = $(GST_BASE_LIBS) $(GST_LIBS) $(NULL) \ - $(am__append_11) -add_source_c = $(am__append_9) -add_source_h = - -# Always build VC-1 and MPEG-4 parsers for now -gen_source_c = parserutils.c nalutils.c gstvc1parser.c \ - gstmpeg4parser.c $(am__append_1) $(am__append_3) \ - $(am__append_5) $(am__append_7) $(am__append_12) \ - $(am__append_14) $(am__append_16) -gen_source_h = parserutils.h nalutils.h gstvc1parser.h \ - gstmpeg4parser.h $(am__append_2) $(am__append_4) \ - $(am__append_6) $(am__append_8) $(am__append_13) \ - $(am__append_15) $(am__append_17) -GENFILES = \ - $(gen_source_c) \ - $(gen_source_h) \ - $(NULL) - -nodist_EXTRA_libgstvaapi_codecparsers_la_SOURCES = dummy.c -nodist_libgstvaapi_codecparsers_la_SOURCES = \ - $(gen_source_c) \ - $(add_source_c) \ - $(NULL) - -libgstvaapi_codecparsers_la_CFLAGS = \ - $(libgstvaapi_codecparsers_cflags) \ - $(NULL) - -libgstvaapi_codecparsers_la_LIBADD = \ - $(libgstvaapi_codecparsers_libs) \ - $(NULL) - -libgstvaapi_codecparsers_la_LDFLAGS = \ - $(GST_ALL_LDFLAGS) \ - $(NULL) - -EXTRA_DIST = gstvaapilibvpx.c -DISTCLEANFILES = $(GENFILES) .timestamp.symlinks -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj .symlinks .timestamp -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gst-libs/gst/codecparsers/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu gst-libs/gst/codecparsers/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -libgstvaapi-codecparsers.la: $(libgstvaapi_codecparsers_la_OBJECTS) $(libgstvaapi_codecparsers_la_DEPENDENCIES) $(EXTRA_libgstvaapi_codecparsers_la_DEPENDENCIES) - $(AM_V_CCLD)$(libgstvaapi_codecparsers_la_LINK) $(libgstvaapi_codecparsers_la_OBJECTS) $(libgstvaapi_codecparsers_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_codecparsers_la-dboolhuff.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_codecparsers_la-dummy.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_codecparsers_la-gsth264parser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_codecparsers_la-gsth265parser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_codecparsers_la-gstjpegparser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_codecparsers_la-gstmpeg4parser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_codecparsers_la-gstmpegvideoparser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_codecparsers_la-gstvaapilibvpx.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_codecparsers_la-gstvc1parser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_codecparsers_la-gstvp8parser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_codecparsers_la-gstvp8rangedecoder.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_codecparsers_la-gstvp9parser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_codecparsers_la-nalutils.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_codecparsers_la-parserutils.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_codecparsers_la-vp8utils.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_codecparsers_la-vp9utils.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -libgstvaapi_codecparsers_la-parserutils.lo: parserutils.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_codecparsers_la-parserutils.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_codecparsers_la-parserutils.Tpo -c -o libgstvaapi_codecparsers_la-parserutils.lo `test -f 'parserutils.c' || echo '$(srcdir)/'`parserutils.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_codecparsers_la-parserutils.Tpo $(DEPDIR)/libgstvaapi_codecparsers_la-parserutils.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parserutils.c' object='libgstvaapi_codecparsers_la-parserutils.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_codecparsers_la-parserutils.lo `test -f 'parserutils.c' || echo '$(srcdir)/'`parserutils.c - -libgstvaapi_codecparsers_la-nalutils.lo: nalutils.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_codecparsers_la-nalutils.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_codecparsers_la-nalutils.Tpo -c -o libgstvaapi_codecparsers_la-nalutils.lo `test -f 'nalutils.c' || echo '$(srcdir)/'`nalutils.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_codecparsers_la-nalutils.Tpo $(DEPDIR)/libgstvaapi_codecparsers_la-nalutils.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nalutils.c' object='libgstvaapi_codecparsers_la-nalutils.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_codecparsers_la-nalutils.lo `test -f 'nalutils.c' || echo '$(srcdir)/'`nalutils.c - -libgstvaapi_codecparsers_la-gstvc1parser.lo: gstvc1parser.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_codecparsers_la-gstvc1parser.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_codecparsers_la-gstvc1parser.Tpo -c -o libgstvaapi_codecparsers_la-gstvc1parser.lo `test -f 'gstvc1parser.c' || echo '$(srcdir)/'`gstvc1parser.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_codecparsers_la-gstvc1parser.Tpo $(DEPDIR)/libgstvaapi_codecparsers_la-gstvc1parser.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvc1parser.c' object='libgstvaapi_codecparsers_la-gstvc1parser.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_codecparsers_la-gstvc1parser.lo `test -f 'gstvc1parser.c' || echo '$(srcdir)/'`gstvc1parser.c - -libgstvaapi_codecparsers_la-gstmpeg4parser.lo: gstmpeg4parser.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_codecparsers_la-gstmpeg4parser.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_codecparsers_la-gstmpeg4parser.Tpo -c -o libgstvaapi_codecparsers_la-gstmpeg4parser.lo `test -f 'gstmpeg4parser.c' || echo '$(srcdir)/'`gstmpeg4parser.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_codecparsers_la-gstmpeg4parser.Tpo $(DEPDIR)/libgstvaapi_codecparsers_la-gstmpeg4parser.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstmpeg4parser.c' object='libgstvaapi_codecparsers_la-gstmpeg4parser.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_codecparsers_la-gstmpeg4parser.lo `test -f 'gstmpeg4parser.c' || echo '$(srcdir)/'`gstmpeg4parser.c - -libgstvaapi_codecparsers_la-gstjpegparser.lo: gstjpegparser.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_codecparsers_la-gstjpegparser.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_codecparsers_la-gstjpegparser.Tpo -c -o libgstvaapi_codecparsers_la-gstjpegparser.lo `test -f 'gstjpegparser.c' || echo '$(srcdir)/'`gstjpegparser.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_codecparsers_la-gstjpegparser.Tpo $(DEPDIR)/libgstvaapi_codecparsers_la-gstjpegparser.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstjpegparser.c' object='libgstvaapi_codecparsers_la-gstjpegparser.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_codecparsers_la-gstjpegparser.lo `test -f 'gstjpegparser.c' || echo '$(srcdir)/'`gstjpegparser.c - -libgstvaapi_codecparsers_la-gstmpegvideoparser.lo: gstmpegvideoparser.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_codecparsers_la-gstmpegvideoparser.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_codecparsers_la-gstmpegvideoparser.Tpo -c -o libgstvaapi_codecparsers_la-gstmpegvideoparser.lo `test -f 'gstmpegvideoparser.c' || echo '$(srcdir)/'`gstmpegvideoparser.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_codecparsers_la-gstmpegvideoparser.Tpo $(DEPDIR)/libgstvaapi_codecparsers_la-gstmpegvideoparser.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstmpegvideoparser.c' object='libgstvaapi_codecparsers_la-gstmpegvideoparser.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_codecparsers_la-gstmpegvideoparser.lo `test -f 'gstmpegvideoparser.c' || echo '$(srcdir)/'`gstmpegvideoparser.c - -libgstvaapi_codecparsers_la-gsth264parser.lo: gsth264parser.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_codecparsers_la-gsth264parser.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_codecparsers_la-gsth264parser.Tpo -c -o libgstvaapi_codecparsers_la-gsth264parser.lo `test -f 'gsth264parser.c' || echo '$(srcdir)/'`gsth264parser.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_codecparsers_la-gsth264parser.Tpo $(DEPDIR)/libgstvaapi_codecparsers_la-gsth264parser.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsth264parser.c' object='libgstvaapi_codecparsers_la-gsth264parser.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_codecparsers_la-gsth264parser.lo `test -f 'gsth264parser.c' || echo '$(srcdir)/'`gsth264parser.c - -libgstvaapi_codecparsers_la-gstvp8parser.lo: gstvp8parser.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_codecparsers_la-gstvp8parser.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_codecparsers_la-gstvp8parser.Tpo -c -o libgstvaapi_codecparsers_la-gstvp8parser.lo `test -f 'gstvp8parser.c' || echo '$(srcdir)/'`gstvp8parser.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_codecparsers_la-gstvp8parser.Tpo $(DEPDIR)/libgstvaapi_codecparsers_la-gstvp8parser.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvp8parser.c' object='libgstvaapi_codecparsers_la-gstvp8parser.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_codecparsers_la-gstvp8parser.lo `test -f 'gstvp8parser.c' || echo '$(srcdir)/'`gstvp8parser.c - -libgstvaapi_codecparsers_la-dboolhuff.lo: dboolhuff.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_codecparsers_la-dboolhuff.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_codecparsers_la-dboolhuff.Tpo -c -o libgstvaapi_codecparsers_la-dboolhuff.lo `test -f 'dboolhuff.c' || echo '$(srcdir)/'`dboolhuff.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_codecparsers_la-dboolhuff.Tpo $(DEPDIR)/libgstvaapi_codecparsers_la-dboolhuff.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dboolhuff.c' object='libgstvaapi_codecparsers_la-dboolhuff.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_codecparsers_la-dboolhuff.lo `test -f 'dboolhuff.c' || echo '$(srcdir)/'`dboolhuff.c - -libgstvaapi_codecparsers_la-gstvp8rangedecoder.lo: gstvp8rangedecoder.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_codecparsers_la-gstvp8rangedecoder.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_codecparsers_la-gstvp8rangedecoder.Tpo -c -o libgstvaapi_codecparsers_la-gstvp8rangedecoder.lo `test -f 'gstvp8rangedecoder.c' || echo '$(srcdir)/'`gstvp8rangedecoder.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_codecparsers_la-gstvp8rangedecoder.Tpo $(DEPDIR)/libgstvaapi_codecparsers_la-gstvp8rangedecoder.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvp8rangedecoder.c' object='libgstvaapi_codecparsers_la-gstvp8rangedecoder.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_codecparsers_la-gstvp8rangedecoder.lo `test -f 'gstvp8rangedecoder.c' || echo '$(srcdir)/'`gstvp8rangedecoder.c - -libgstvaapi_codecparsers_la-vp8utils.lo: vp8utils.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_codecparsers_la-vp8utils.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_codecparsers_la-vp8utils.Tpo -c -o libgstvaapi_codecparsers_la-vp8utils.lo `test -f 'vp8utils.c' || echo '$(srcdir)/'`vp8utils.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_codecparsers_la-vp8utils.Tpo $(DEPDIR)/libgstvaapi_codecparsers_la-vp8utils.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vp8utils.c' object='libgstvaapi_codecparsers_la-vp8utils.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_codecparsers_la-vp8utils.lo `test -f 'vp8utils.c' || echo '$(srcdir)/'`vp8utils.c - -libgstvaapi_codecparsers_la-gstvp9parser.lo: gstvp9parser.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_codecparsers_la-gstvp9parser.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_codecparsers_la-gstvp9parser.Tpo -c -o libgstvaapi_codecparsers_la-gstvp9parser.lo `test -f 'gstvp9parser.c' || echo '$(srcdir)/'`gstvp9parser.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_codecparsers_la-gstvp9parser.Tpo $(DEPDIR)/libgstvaapi_codecparsers_la-gstvp9parser.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvp9parser.c' object='libgstvaapi_codecparsers_la-gstvp9parser.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_codecparsers_la-gstvp9parser.lo `test -f 'gstvp9parser.c' || echo '$(srcdir)/'`gstvp9parser.c - -libgstvaapi_codecparsers_la-vp9utils.lo: vp9utils.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_codecparsers_la-vp9utils.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_codecparsers_la-vp9utils.Tpo -c -o libgstvaapi_codecparsers_la-vp9utils.lo `test -f 'vp9utils.c' || echo '$(srcdir)/'`vp9utils.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_codecparsers_la-vp9utils.Tpo $(DEPDIR)/libgstvaapi_codecparsers_la-vp9utils.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vp9utils.c' object='libgstvaapi_codecparsers_la-vp9utils.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_codecparsers_la-vp9utils.lo `test -f 'vp9utils.c' || echo '$(srcdir)/'`vp9utils.c - -libgstvaapi_codecparsers_la-gsth265parser.lo: gsth265parser.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_codecparsers_la-gsth265parser.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_codecparsers_la-gsth265parser.Tpo -c -o libgstvaapi_codecparsers_la-gsth265parser.lo `test -f 'gsth265parser.c' || echo '$(srcdir)/'`gsth265parser.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_codecparsers_la-gsth265parser.Tpo $(DEPDIR)/libgstvaapi_codecparsers_la-gsth265parser.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsth265parser.c' object='libgstvaapi_codecparsers_la-gsth265parser.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_codecparsers_la-gsth265parser.lo `test -f 'gsth265parser.c' || echo '$(srcdir)/'`gsth265parser.c - -libgstvaapi_codecparsers_la-gstvaapilibvpx.lo: gstvaapilibvpx.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_codecparsers_la-gstvaapilibvpx.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_codecparsers_la-gstvaapilibvpx.Tpo -c -o libgstvaapi_codecparsers_la-gstvaapilibvpx.lo `test -f 'gstvaapilibvpx.c' || echo '$(srcdir)/'`gstvaapilibvpx.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_codecparsers_la-gstvaapilibvpx.Tpo $(DEPDIR)/libgstvaapi_codecparsers_la-gstvaapilibvpx.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapilibvpx.c' object='libgstvaapi_codecparsers_la-gstvaapilibvpx.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_codecparsers_la-gstvaapilibvpx.lo `test -f 'gstvaapilibvpx.c' || echo '$(srcdir)/'`gstvaapilibvpx.c - -libgstvaapi_codecparsers_la-dummy.lo: dummy.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_codecparsers_la-dummy.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_codecparsers_la-dummy.Tpo -c -o libgstvaapi_codecparsers_la-dummy.lo `test -f 'dummy.c' || echo '$(srcdir)/'`dummy.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_codecparsers_la-dummy.Tpo $(DEPDIR)/libgstvaapi_codecparsers_la-dummy.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dummy.c' object='libgstvaapi_codecparsers_la-dummy.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_codecparsers_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_codecparsers_la-dummy.lo `test -f 'dummy.c' || echo '$(srcdir)/'`dummy.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) all-local -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am clean \ - clean-generic clean-libtool clean-noinstLTLIBRARIES \ - cscopelist-am ctags ctags-am distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am - -.PRECIOUS: Makefile - - -all-local: .timestamp.symlinks - -.timestamp.symlinks: $(GENFILES) - touch $@ - -$(gen_source_c): %.c: $(local_codecparsers_srcdir)/%.c $(gen_source_h) - $(LN_S) -f $< $@ -$(gen_source_h): %.h: $(local_codecparsers_srcdir)/%.h - $(LN_S) -f $< $@ -$(top_builddir)/ext/libvpx/libgstcodecparsers_vpx.la: - $(MAKE) -C $(top_builddir)/ext/libvpx - --include $(top_srcdir)/git.mk - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/Makefile.am gstreamer-vaapi-1.8.2/gst-libs/gst/Makefile.am --- gstreamer-vaapi-0.7.0/gst-libs/gst/Makefile.am 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/Makefile.am 2016-03-24 11:36:59.000000000 +0000 @@ -1,3 +1,3 @@ -SUBDIRS = base codecparsers vaapi +SUBDIRS = base vaapi -include $(top_srcdir)/git.mk diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/Makefile.in gstreamer-vaapi-1.8.2/gst-libs/gst/Makefile.in --- gstreamer-vaapi-0.7.0/gst-libs/gst/Makefile.in 2015-12-07 10:54:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/Makefile.in 2016-06-09 07:27:12.000000000 +0000 @@ -90,10 +90,27 @@ target_triplet = @target@ subdir = gst-libs/gst ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-arch.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-platform.m4 \ + $(top_srcdir)/common/m4/gst-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -184,9 +201,11 @@ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ +AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -199,6 +218,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DRM_CFLAGS = @DRM_CFLAGS@ @@ -211,58 +231,64 @@ EGL_CFLAGS = @EGL_CFLAGS@ EGL_LIBS = @EGL_LIBS@ EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ GIT = @GIT@ GLES2_CFLAGS = @GLES2_CFLAGS@ GLES2_LIBS = @GLES2_LIBS@ GLES3_CFLAGS = @GLES3_CFLAGS@ GLES3_LIBS = @GLES3_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ -GLIB_VERSION_REQUIRED = @GLIB_VERSION_REQUIRED@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ -GMODULE_VERSION_REQUIRED = @GMODULE_VERSION_REQUIRED@ GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ GST_API_VERSION = @GST_API_VERSION@ -GST_BASEVIDEO_CFLAGS = @GST_BASEVIDEO_CFLAGS@ -GST_BASEVIDEO_LIBS = @GST_BASEVIDEO_LIBS@ GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ GST_BASE_LIBS = @GST_BASE_LIBS@ GST_CFLAGS = @GST_CFLAGS@ GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ +GST_CURRENT = @GST_CURRENT@ GST_GL_CFLAGS = @GST_GL_CFLAGS@ GST_GL_LIBS = @GST_GL_LIBS@ -GST_INTERFACES_CFLAGS = @GST_INTERFACES_CFLAGS@ -GST_INTERFACES_LIBS = @GST_INTERFACES_LIBS@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ GST_LIBS = @GST_LIBS@ -GST_PKG_VERSION = @GST_PKG_VERSION@ -GST_PLUGINS_BAD_VERSION_REQUIRED = @GST_PLUGINS_BAD_VERSION_REQUIRED@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PBUTILS_CFLAGS = @GST_PBUTILS_CFLAGS@ +GST_PBUTILS_LIBS = @GST_PBUTILS_LIBS@ GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ -GST_PLUGINS_BASE_VERSION_REQUIRED = @GST_PLUGINS_BASE_VERSION_REQUIRED@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ -GST_PLUGIN_PATH_1_0 = @GST_PLUGIN_PATH_1_0@ -GST_VAAPI_LT_LDFLAGS = @GST_VAAPI_LT_LDFLAGS@ -GST_VAAPI_LT_VERSION = @GST_VAAPI_LT_VERSION@ -GST_VAAPI_MAJOR_VERSION = @GST_VAAPI_MAJOR_VERSION@ -GST_VERSION_REQUIRED = @GST_VERSION_REQUIRED@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ -GTKDOC_VERSION = @GTKDOC_VERSION@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -271,6 +297,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -278,16 +305,15 @@ LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ LIBVA_LIBS = @LIBVA_LIBS@ -LIBVA_PACKAGE_VERSION = @LIBVA_PACKAGE_VERSION@ -LIBVA_PKGNAME = @LIBVA_PKGNAME@ LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ -LIBVA_X11_PKGNAME = @LIBVA_X11_PKGNAME@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -304,21 +330,27 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ -PATCH = @PATCH@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ -TODAY = @TODAY@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ VERSION = @VERSION@ -WAYLAND_API_VERSION = @WAYLAND_API_VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ WAYLAND_LIBS = @WAYLAND_LIBS@ X11_CFLAGS = @X11_CFLAGS@ @@ -327,7 +359,6 @@ XRANDR_LIBS = @XRANDR_LIBS@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ -YASM = @YASM@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -369,11 +400,15 @@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ plugindir = @plugindir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -386,11 +421,11 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = base codecparsers vaapi +SUBDIRS = base vaapi all: all-recursive .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -414,9 +449,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapibufferproxy.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapibufferproxy.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapibufferproxy.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapibufferproxy.c 2016-03-24 11:36:59.000000000 +0000 @@ -77,10 +77,10 @@ return type; } +#if VA_CHECK_VERSION (0,36,0) static gboolean gst_vaapi_buffer_proxy_acquire_handle (GstVaapiBufferProxy * proxy) { -#if VA_CHECK_VERSION (0,36,0) const guint mem_type = proxy->va_info.mem_type; VAStatus va_status; @@ -99,15 +99,12 @@ if (proxy->va_info.mem_type != mem_type) return FALSE; return TRUE; -#else - return FALSE; -#endif } +/* VA_CHECK_VERSION (0,36,0) */ static gboolean gst_vaapi_buffer_proxy_release_handle (GstVaapiBufferProxy * proxy) { -#if VA_CHECK_VERSION (0,36,0) VAStatus va_status; if (!proxy->va_info.handle) @@ -123,11 +120,9 @@ if (!vaapi_check_status (va_status, "vaReleaseBufferHandle()")) return FALSE; return TRUE; -#else - return FALSE; -#endif } +/* VA_CHECK_VERSION (0,36,0) */ static void gst_vaapi_buffer_proxy_finalize (GstVaapiBufferProxy * proxy) { @@ -140,6 +135,7 @@ gst_vaapi_object_replace (&proxy->parent, NULL); } +/* VA_CHECK_VERSION (0,36,0) */ static inline const GstVaapiMiniObjectClass * gst_vaapi_buffer_proxy_class (void) { @@ -149,6 +145,7 @@ }; return &GstVaapiBufferProxyClass; } +#endif GstVaapiBufferProxy * gst_vaapi_buffer_proxy_new (guintptr handle, guint type, gsize size, diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapicodec_objects.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapicodec_objects.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapicodec_objects.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapicodec_objects.c 2016-03-24 11:36:59.000000000 +0000 @@ -76,8 +76,7 @@ GstVaapiCodecObject *obj; GstVaapiCodecObjectConstructorArgs args; - obj = - (GstVaapiCodecObject *) + obj = (GstVaapiCodecObject *) gst_vaapi_mini_object_new0 (GST_VAAPI_MINI_OBJECT_CLASS (object_class)); if (!obj) return NULL; diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapicodedbuffer.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapicodedbuffer.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapicodedbuffer.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapicodedbuffer.c 2016-03-24 11:36:59.000000000 +0000 @@ -93,8 +93,10 @@ GST_VAAPI_OBJECT_UNLOCK_DISPLAY (buf); } +/* *INDENT-OFF* */ #define gst_vaapi_coded_buffer_finalize coded_buffer_destroy GST_VAAPI_OBJECT_DEFINE_CLASS (GstVaapiCodedBuffer, gst_vaapi_coded_buffer) +/* *INDENT-ON* */ /* * gst_vaapi_coded_buffer_new: diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapicodedbufferpool.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapicodedbufferpool.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapicodedbufferpool.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapicodedbufferpool.c 2016-04-20 15:27:22.000000000 +0000 @@ -36,7 +36,7 @@ */ struct _GstVaapiCodedBufferPool { - /*< private >*/ + /*< private > */ GstVaapiVideoPool parent_instance; GstVaapiContext *context; @@ -54,6 +54,7 @@ static void coded_buffer_pool_finalize (GstVaapiCodedBufferPool * pool) { + gst_vaapi_video_pool_finalize (GST_VAAPI_VIDEO_POOL (pool)); gst_vaapi_object_replace (&pool->context, NULL); } @@ -69,9 +70,9 @@ gst_vaapi_coded_buffer_pool_class (void) { static const GstVaapiVideoPoolClass GstVaapiCodedBufferPoolClass = { - { sizeof (GstVaapiCodedBufferPool), - (GDestroyNotify)coded_buffer_pool_finalize }, - + {sizeof (GstVaapiCodedBufferPool), + (GDestroyNotify) coded_buffer_pool_finalize} + , .alloc_object = coded_buffer_pool_alloc_object }; return GST_VAAPI_MINI_OBJECT_CLASS (&GstVaapiCodedBufferPoolClass); diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapicodedbufferproxy.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapicodedbufferproxy.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapicodedbufferproxy.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapicodedbufferproxy.c 2016-03-24 11:36:59.000000000 +0000 @@ -61,7 +61,7 @@ { static const GstVaapiMiniObjectClass GstVaapiCodedBufferProxyClass = { sizeof (GstVaapiCodedBufferProxy), - (GDestroyNotify)coded_buffer_proxy_finalize + (GDestroyNotify) coded_buffer_proxy_finalize }; return &GstVaapiCodedBufferProxyClass; } diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapicontext.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapicontext.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapicontext.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapicontext.c 2016-03-24 11:36:59.000000000 +0000 @@ -134,6 +134,7 @@ context_create_surfaces (GstVaapiContext * context) { const GstVaapiContextInfo *const cip = &context->info; + GstVaapiDisplay *const display = GST_VAAPI_OBJECT_DISPLAY (context); guint num_surfaces; if (!gst_vaapi_context_overlay_reset (context)) @@ -149,8 +150,9 @@ if (!context->surfaces_pool) { context->surfaces_pool = - gst_vaapi_surface_pool_new (GST_VAAPI_OBJECT_DISPLAY (context), - GST_VIDEO_FORMAT_ENCODED, cip->width, cip->height); + gst_vaapi_surface_pool_new_with_chroma_type (display, cip->chroma_type, + cip->width, cip->height); + if (!context->surfaces_pool) return FALSE; } diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder.c 2016-03-24 11:36:59.000000000 +0000 @@ -38,8 +38,7 @@ #define DEBUG 1 #include "gstvaapidebug.h" -static void -drop_frame (GstVaapiDecoder * decoder, GstVideoCodecFrame * frame); +static void drop_frame (GstVaapiDecoder * decoder, GstVideoCodecFrame * frame); static void parser_state_finalize (GstVaapiParserState * ps) @@ -332,8 +331,7 @@ input_size -= got_unit_size; if (gst_adapter_available (ps->output_adapter) == 0) { - ps->current_frame->pts = - gst_adapter_prev_timestamp (ps->input_adapter, NULL); + ps->current_frame->pts = gst_adapter_prev_pts (ps->input_adapter, NULL); } gst_adapter_push (ps->output_adapter, buffer); } @@ -924,7 +922,6 @@ GST_VIDEO_INTERLACE_MODE_PROGRESSIVE)); } -#if GST_CHECK_VERSION(1,5,0) void gst_vaapi_decoder_set_multiview_mode (GstVaapiDecoder * decoder, gint views, GstVideoMultiviewMode mv_mode, GstVideoMultiviewFlags mv_flags) @@ -935,7 +932,8 @@ if (GST_VIDEO_INFO_VIEWS (info) != views || GST_VIDEO_INFO_MULTIVIEW_MODE (info) != mv_mode || GST_VIDEO_INFO_MULTIVIEW_FLAGS (info) != mv_flags) { - const gchar *mv_mode_str = gst_video_multiview_mode_to_caps_string (mv_mode); + const gchar *mv_mode_str = + gst_video_multiview_mode_to_caps_string (mv_mode); GST_DEBUG ("Multiview mode changed to %s flags 0x%x views %d", mv_mode_str, mv_flags, views); @@ -951,7 +949,6 @@ notify_codec_state_changed (decoder); } } -#endif gboolean gst_vaapi_decoder_ensure_context (GstVaapiDecoder * decoder, diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_dpb.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_dpb.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_dpb.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_dpb.c 2016-03-24 11:36:59.000000000 +0000 @@ -37,14 +37,15 @@ * * A decoded picture buffer (DPB) object. */ -struct _GstVaapiDpb { - /*< private >*/ - GstVaapiMiniObject parent_instance; - - /*< protected >*/ - GstVaapiPicture **pictures; - guint num_pictures; - guint max_pictures; +struct _GstVaapiDpb +{ + /*< private > */ + GstVaapiMiniObject parent_instance; + + /*< protected > */ + GstVaapiPicture **pictures; + guint num_pictures; + guint max_pictures; }; /** @@ -52,124 +53,123 @@ * * The #GstVaapiDpb base class. */ -struct _GstVaapiDpbClass { - /*< private >*/ - GstVaapiMiniObjectClass parent_class; - - /*< protected >*/ - void (*flush) (GstVaapiDpb *dpb); - gboolean (*add) (GstVaapiDpb *dpb, GstVaapiPicture *picture); - void (*get_neighbours) (GstVaapiDpb *dpb, GstVaapiPicture *picture, - GstVaapiPicture **prev_picture_ptr, GstVaapiPicture **next_picture_ptr); +struct _GstVaapiDpbClass +{ + /*< private > */ + GstVaapiMiniObjectClass parent_class; + + /*< protected > */ + void (*flush) (GstVaapiDpb * dpb); + gboolean (*add) (GstVaapiDpb * dpb, GstVaapiPicture * picture); + void (*get_neighbours) (GstVaapiDpb * dpb, GstVaapiPicture * picture, + GstVaapiPicture ** prev_picture_ptr, GstVaapiPicture ** next_picture_ptr); }; -static const GstVaapiMiniObjectClass * -gst_vaapi_dpb_class(void); +static const GstVaapiMiniObjectClass *gst_vaapi_dpb_class (void); -static const GstVaapiMiniObjectClass * -gst_vaapi_dpb2_class(void); +static const GstVaapiMiniObjectClass *gst_vaapi_dpb2_class (void); /* ------------------------------------------------------------------------- */ /* --- Common utilities --- */ /* ------------------------------------------------------------------------- */ static inline GstVaapiDpb * -dpb_new(guint max_pictures) +dpb_new (guint max_pictures) { - GstVaapiDpb *dpb; + GstVaapiDpb *dpb; - g_return_val_if_fail(max_pictures > 0, NULL); + g_return_val_if_fail (max_pictures > 0, NULL); - dpb = (GstVaapiDpb *)gst_vaapi_mini_object_new( - max_pictures == 2 ? gst_vaapi_dpb2_class() : gst_vaapi_dpb_class()); - if (!dpb) - return NULL; + dpb = + (GstVaapiDpb *) gst_vaapi_mini_object_new (max_pictures == + 2 ? gst_vaapi_dpb2_class () : gst_vaapi_dpb_class ()); + if (!dpb) + return NULL; - dpb->num_pictures = 0; - dpb->max_pictures = max_pictures; + dpb->num_pictures = 0; + dpb->max_pictures = max_pictures; - dpb->pictures = g_new0(GstVaapiPicture *, max_pictures); - if (!dpb->pictures) - goto error; - return dpb; + dpb->pictures = g_new0 (GstVaapiPicture *, max_pictures); + if (!dpb->pictures) + goto error; + return dpb; error: - gst_vaapi_dpb_unref(dpb); - return NULL; + gst_vaapi_dpb_unref (dpb); + return NULL; } static gint -dpb_get_oldest(GstVaapiDpb *dpb, gboolean output) +dpb_get_oldest (GstVaapiDpb * dpb, gboolean output) { - gint i, lowest_pts_index; + gint i, lowest_pts_index; - for (i = 0; i < dpb->num_pictures; i++) { - if ((GST_VAAPI_PICTURE_IS_OUTPUT(dpb->pictures[i]) ^ output) == 0) - break; - } - if (i == dpb->num_pictures) - return -1; - - lowest_pts_index = i++; - for (; i < dpb->num_pictures; i++) { - GstVaapiPicture * const picture = dpb->pictures[i]; - if ((GST_VAAPI_PICTURE_IS_OUTPUT(picture) ^ output) != 0) - continue; - if (picture->poc < dpb->pictures[lowest_pts_index]->poc) - lowest_pts_index = i; - } - return lowest_pts_index; + for (i = 0; i < dpb->num_pictures; i++) { + if ((GST_VAAPI_PICTURE_IS_OUTPUT (dpb->pictures[i]) ^ output) == 0) + break; + } + if (i == dpb->num_pictures) + return -1; + + lowest_pts_index = i++; + for (; i < dpb->num_pictures; i++) { + GstVaapiPicture *const picture = dpb->pictures[i]; + if ((GST_VAAPI_PICTURE_IS_OUTPUT (picture) ^ output) != 0) + continue; + if (picture->poc < dpb->pictures[lowest_pts_index]->poc) + lowest_pts_index = i; + } + return lowest_pts_index; } static void -dpb_remove_index(GstVaapiDpb *dpb, guint index) +dpb_remove_index (GstVaapiDpb * dpb, guint index) { - GstVaapiPicture ** const pictures = dpb->pictures; - guint num_pictures = --dpb->num_pictures; + GstVaapiPicture **const pictures = dpb->pictures; + guint num_pictures = --dpb->num_pictures; - if (index != num_pictures) - gst_vaapi_picture_replace(&pictures[index], pictures[num_pictures]); - gst_vaapi_picture_replace(&pictures[num_pictures], NULL); + if (index != num_pictures) + gst_vaapi_picture_replace (&pictures[index], pictures[num_pictures]); + gst_vaapi_picture_replace (&pictures[num_pictures], NULL); } static inline gboolean -dpb_output(GstVaapiDpb *dpb, GstVaapiPicture *picture) +dpb_output (GstVaapiDpb * dpb, GstVaapiPicture * picture) { - return gst_vaapi_picture_output(picture); + return gst_vaapi_picture_output (picture); } static gboolean -dpb_bump(GstVaapiDpb *dpb) +dpb_bump (GstVaapiDpb * dpb) { - gint index; - gboolean success; + gint index; + gboolean success; - index = dpb_get_oldest(dpb, FALSE); - if (index < 0) - return FALSE; - - success = dpb_output(dpb, dpb->pictures[index]); - if (!GST_VAAPI_PICTURE_IS_REFERENCE(dpb->pictures[index])) - dpb_remove_index(dpb, index); - return success; + index = dpb_get_oldest (dpb, FALSE); + if (index < 0) + return FALSE; + + success = dpb_output (dpb, dpb->pictures[index]); + if (!GST_VAAPI_PICTURE_IS_REFERENCE (dpb->pictures[index])) + dpb_remove_index (dpb, index); + return success; } static void -dpb_clear(GstVaapiDpb *dpb) +dpb_clear (GstVaapiDpb * dpb) { - guint i; + guint i; - for (i = 0; i < dpb->num_pictures; i++) - gst_vaapi_picture_replace(&dpb->pictures[i], NULL); - dpb->num_pictures = 0; + for (i = 0; i < dpb->num_pictures; i++) + gst_vaapi_picture_replace (&dpb->pictures[i], NULL); + dpb->num_pictures = 0; } static void -dpb_flush(GstVaapiDpb *dpb) +dpb_flush (GstVaapiDpb * dpb) { - while (dpb_bump(dpb)) - ; - dpb_clear(dpb); + while (dpb_bump (dpb)); + dpb_clear (dpb); } /* ------------------------------------------------------------------------- */ @@ -177,82 +177,80 @@ /* ------------------------------------------------------------------------- */ static gboolean -dpb_add(GstVaapiDpb *dpb, GstVaapiPicture *picture) +dpb_add (GstVaapiDpb * dpb, GstVaapiPicture * picture) { - guint i; - - // Remove all unused pictures - i = 0; - while (i < dpb->num_pictures) { - GstVaapiPicture * const picture = dpb->pictures[i]; - if (GST_VAAPI_PICTURE_IS_OUTPUT(picture) && - !GST_VAAPI_PICTURE_IS_REFERENCE(picture)) - dpb_remove_index(dpb, i); - else - i++; - } + guint i; - // Store reference decoded picture into the DPB - if (GST_VAAPI_PICTURE_IS_REFERENCE(picture)) { - while (dpb->num_pictures == dpb->max_pictures) { - if (!dpb_bump(dpb)) - return FALSE; - } + // Remove all unused pictures + i = 0; + while (i < dpb->num_pictures) { + GstVaapiPicture *const picture = dpb->pictures[i]; + if (GST_VAAPI_PICTURE_IS_OUTPUT (picture) && + !GST_VAAPI_PICTURE_IS_REFERENCE (picture)) + dpb_remove_index (dpb, i); + else + i++; + } + + // Store reference decoded picture into the DPB + if (GST_VAAPI_PICTURE_IS_REFERENCE (picture)) { + while (dpb->num_pictures == dpb->max_pictures) { + if (!dpb_bump (dpb)) + return FALSE; } - - // Store non-reference decoded picture into the DPB - else { - if (GST_VAAPI_PICTURE_IS_SKIPPED(picture)) - return TRUE; - while (dpb->num_pictures == dpb->max_pictures) { - for (i = 0; i < dpb->num_pictures; i++) { - if (!GST_VAAPI_PICTURE_IS_OUTPUT(picture) && - dpb->pictures[i]->poc < picture->poc) - break; - } - if (i == dpb->num_pictures) - return dpb_output(dpb, picture); - if (!dpb_bump(dpb)) - return FALSE; - } + } + // Store non-reference decoded picture into the DPB + else { + if (GST_VAAPI_PICTURE_IS_SKIPPED (picture)) + return TRUE; + while (dpb->num_pictures == dpb->max_pictures) { + for (i = 0; i < dpb->num_pictures; i++) { + if (!GST_VAAPI_PICTURE_IS_OUTPUT (picture) && + dpb->pictures[i]->poc < picture->poc) + break; + } + if (i == dpb->num_pictures) + return dpb_output (dpb, picture); + if (!dpb_bump (dpb)) + return FALSE; } - gst_vaapi_picture_replace(&dpb->pictures[dpb->num_pictures++], picture); - return TRUE; + } + gst_vaapi_picture_replace (&dpb->pictures[dpb->num_pictures++], picture); + return TRUE; } static void -dpb_get_neighbours(GstVaapiDpb *dpb, GstVaapiPicture *picture, - GstVaapiPicture **prev_picture_ptr, GstVaapiPicture **next_picture_ptr) +dpb_get_neighbours (GstVaapiDpb * dpb, GstVaapiPicture * picture, + GstVaapiPicture ** prev_picture_ptr, GstVaapiPicture ** next_picture_ptr) { - GstVaapiPicture *prev_picture = NULL; - GstVaapiPicture *next_picture = NULL; - guint i; - - /* Find the first picture with POC > specified picture POC */ - for (i = 0; i < dpb->num_pictures; i++) { - GstVaapiPicture * const ref_picture = dpb->pictures[i]; - if (ref_picture->poc == picture->poc) { - if (i > 0) - prev_picture = dpb->pictures[i - 1]; - if (i + 1 < dpb->num_pictures) - next_picture = dpb->pictures[i + 1]; - break; - } - else if (ref_picture->poc > picture->poc) { - next_picture = ref_picture; - if (i > 0) - prev_picture = dpb->pictures[i - 1]; - break; - } + GstVaapiPicture *prev_picture = NULL; + GstVaapiPicture *next_picture = NULL; + guint i; + + /* Find the first picture with POC > specified picture POC */ + for (i = 0; i < dpb->num_pictures; i++) { + GstVaapiPicture *const ref_picture = dpb->pictures[i]; + if (ref_picture->poc == picture->poc) { + if (i > 0) + prev_picture = dpb->pictures[i - 1]; + if (i + 1 < dpb->num_pictures) + next_picture = dpb->pictures[i + 1]; + break; + } else if (ref_picture->poc > picture->poc) { + next_picture = ref_picture; + if (i > 0) + prev_picture = dpb->pictures[i - 1]; + break; } + } - g_assert(next_picture ? next_picture->poc > picture->poc : TRUE); - g_assert(prev_picture ? prev_picture->poc < picture->poc : TRUE); + g_assert (next_picture ? next_picture->poc > picture->poc : TRUE); + g_assert (prev_picture ? prev_picture->poc < picture->poc : TRUE); - if (prev_picture_ptr) - *prev_picture_ptr = prev_picture; - if (next_picture_ptr) - *next_picture_ptr = next_picture; + if (prev_picture_ptr) + *prev_picture_ptr = prev_picture; + if (next_picture_ptr) + *next_picture_ptr = next_picture; } /* ------------------------------------------------------------------------- */ @@ -260,66 +258,66 @@ /* ------------------------------------------------------------------------- */ static gboolean -dpb2_add(GstVaapiDpb *dpb, GstVaapiPicture *picture) +dpb2_add (GstVaapiDpb * dpb, GstVaapiPicture * picture) { - GstVaapiPicture *ref_picture; - gint index = -1; + GstVaapiPicture *ref_picture; + gint index = -1; - g_return_val_if_fail(GST_VAAPI_IS_DPB(dpb), FALSE); - g_return_val_if_fail(dpb->max_pictures == 2, FALSE); + g_return_val_if_fail (GST_VAAPI_IS_DPB (dpb), FALSE); + g_return_val_if_fail (dpb->max_pictures == 2, FALSE); - /* - * Purpose: only store reference decoded pictures into the DPB - * - * This means: - * - non-reference decoded pictures are output immediately - * - ... thus causing older reference pictures to be output, if not already - * - the oldest reference picture is replaced with the new reference picture - */ - if (G_LIKELY(dpb->num_pictures == 2)) { - index = (dpb->pictures[0]->poc > dpb->pictures[1]->poc); - ref_picture = dpb->pictures[index]; - if (!GST_VAAPI_PICTURE_IS_OUTPUT(ref_picture)) { - if (!dpb_output(dpb, ref_picture)) - return FALSE; - } + /* + * Purpose: only store reference decoded pictures into the DPB + * + * This means: + * - non-reference decoded pictures are output immediately + * - ... thus causing older reference pictures to be output, if not already + * - the oldest reference picture is replaced with the new reference picture + */ + if (G_LIKELY (dpb->num_pictures == 2)) { + index = (dpb->pictures[0]->poc > dpb->pictures[1]->poc); + ref_picture = dpb->pictures[index]; + if (!GST_VAAPI_PICTURE_IS_OUTPUT (ref_picture)) { + if (!dpb_output (dpb, ref_picture)) + return FALSE; } + } - if (!GST_VAAPI_PICTURE_IS_REFERENCE(picture)) - return dpb_output(dpb, picture); + if (!GST_VAAPI_PICTURE_IS_REFERENCE (picture)) + return dpb_output (dpb, picture); - if (index < 0) - index = dpb->num_pictures++; - gst_vaapi_picture_replace(&dpb->pictures[index], picture); - return TRUE; + if (index < 0) + index = dpb->num_pictures++; + gst_vaapi_picture_replace (&dpb->pictures[index], picture); + return TRUE; } static void -dpb2_get_neighbours(GstVaapiDpb *dpb, GstVaapiPicture *picture, - GstVaapiPicture **prev_picture_ptr, GstVaapiPicture **next_picture_ptr) +dpb2_get_neighbours (GstVaapiDpb * dpb, GstVaapiPicture * picture, + GstVaapiPicture ** prev_picture_ptr, GstVaapiPicture ** next_picture_ptr) { - GstVaapiPicture *ref_picture, *ref_pictures[2]; - GstVaapiPicture **picture_ptr; - guint i, index; - - g_return_if_fail(GST_VAAPI_IS_DPB(dpb)); - g_return_if_fail(dpb->max_pictures == 2); - g_return_if_fail(GST_VAAPI_IS_PICTURE(picture)); - - ref_pictures[0] = NULL; - ref_pictures[1] = NULL; - for (i = 0; i < dpb->num_pictures; i++) { - ref_picture = dpb->pictures[i]; - index = ref_picture->poc > picture->poc; - picture_ptr = &ref_pictures[index]; - if (!*picture_ptr || ((*picture_ptr)->poc > ref_picture->poc) == index) - *picture_ptr = ref_picture; - } - - if (prev_picture_ptr) - *prev_picture_ptr = ref_pictures[0]; - if (next_picture_ptr) - *next_picture_ptr = ref_pictures[1]; + GstVaapiPicture *ref_picture, *ref_pictures[2]; + GstVaapiPicture **picture_ptr; + guint i, index; + + g_return_if_fail (GST_VAAPI_IS_DPB (dpb)); + g_return_if_fail (dpb->max_pictures == 2); + g_return_if_fail (GST_VAAPI_IS_PICTURE (picture)); + + ref_pictures[0] = NULL; + ref_pictures[1] = NULL; + for (i = 0; i < dpb->num_pictures; i++) { + ref_picture = dpb->pictures[i]; + index = ref_picture->poc > picture->poc; + picture_ptr = &ref_pictures[index]; + if (!*picture_ptr || ((*picture_ptr)->poc > ref_picture->poc) == index) + *picture_ptr = ref_picture; + } + + if (prev_picture_ptr) + *prev_picture_ptr = ref_pictures[0]; + if (next_picture_ptr) + *next_picture_ptr = ref_pictures[1]; } /* ------------------------------------------------------------------------- */ @@ -327,92 +325,94 @@ /* ------------------------------------------------------------------------- */ static void -gst_vaapi_dpb_finalize(GstVaapiDpb *dpb) +gst_vaapi_dpb_finalize (GstVaapiDpb * dpb) { - dpb_clear(dpb); - g_free(dpb->pictures); + dpb_clear (dpb); + g_free (dpb->pictures); } static const GstVaapiMiniObjectClass * -gst_vaapi_dpb_class(void) +gst_vaapi_dpb_class (void) { - static const GstVaapiDpbClass GstVaapiDpbClass = { - { sizeof(GstVaapiDpb), - (GDestroyNotify)gst_vaapi_dpb_finalize }, - - dpb_flush, - dpb_add, - dpb_get_neighbours - }; - return &GstVaapiDpbClass.parent_class; + static const GstVaapiDpbClass GstVaapiDpbClass = { + {sizeof (GstVaapiDpb), + (GDestroyNotify) gst_vaapi_dpb_finalize} + , + + dpb_flush, + dpb_add, + dpb_get_neighbours + }; + return &GstVaapiDpbClass.parent_class; } static const GstVaapiMiniObjectClass * -gst_vaapi_dpb2_class(void) +gst_vaapi_dpb2_class (void) { - static const GstVaapiDpbClass GstVaapiDpb2Class = { - { sizeof(GstVaapiDpb), - (GDestroyNotify)gst_vaapi_dpb_finalize }, - - dpb_flush, - dpb2_add, - dpb2_get_neighbours - }; - return &GstVaapiDpb2Class.parent_class; + static const GstVaapiDpbClass GstVaapiDpb2Class = { + {sizeof (GstVaapiDpb), + (GDestroyNotify) gst_vaapi_dpb_finalize} + , + + dpb_flush, + dpb2_add, + dpb2_get_neighbours + }; + return &GstVaapiDpb2Class.parent_class; } GstVaapiDpb * -gst_vaapi_dpb_new(guint max_pictures) +gst_vaapi_dpb_new (guint max_pictures) { - return dpb_new(max_pictures); + return dpb_new (max_pictures); } void -gst_vaapi_dpb_flush(GstVaapiDpb *dpb) +gst_vaapi_dpb_flush (GstVaapiDpb * dpb) { - const GstVaapiDpbClass *klass; + const GstVaapiDpbClass *klass; - g_return_if_fail(GST_VAAPI_IS_DPB(dpb)); + g_return_if_fail (GST_VAAPI_IS_DPB (dpb)); - klass = GST_VAAPI_DPB_GET_CLASS(dpb); - if (G_UNLIKELY(!klass || !klass->add)) - return; - klass->flush(dpb); + klass = GST_VAAPI_DPB_GET_CLASS (dpb); + if (G_UNLIKELY (!klass || !klass->add)) + return; + klass->flush (dpb); } gboolean -gst_vaapi_dpb_add(GstVaapiDpb *dpb, GstVaapiPicture *picture) +gst_vaapi_dpb_add (GstVaapiDpb * dpb, GstVaapiPicture * picture) { - const GstVaapiDpbClass *klass; + const GstVaapiDpbClass *klass; - g_return_val_if_fail(GST_VAAPI_IS_DPB(dpb), FALSE); - g_return_val_if_fail(GST_VAAPI_IS_PICTURE(picture), FALSE); + g_return_val_if_fail (GST_VAAPI_IS_DPB (dpb), FALSE); + g_return_val_if_fail (GST_VAAPI_IS_PICTURE (picture), FALSE); - klass = GST_VAAPI_DPB_GET_CLASS(dpb); - if (G_UNLIKELY(!klass || !klass->add)) - return FALSE; - return klass->add(dpb, picture); + klass = GST_VAAPI_DPB_GET_CLASS (dpb); + if (G_UNLIKELY (!klass || !klass->add)) + return FALSE; + return klass->add (dpb, picture); } guint -gst_vaapi_dpb_size(GstVaapiDpb *dpb) +gst_vaapi_dpb_size (GstVaapiDpb * dpb) { - g_return_val_if_fail(GST_VAAPI_IS_DPB(dpb), 0); + g_return_val_if_fail (GST_VAAPI_IS_DPB (dpb), 0); - return dpb->num_pictures; + return dpb->num_pictures; } void -gst_vaapi_dpb_get_neighbours(GstVaapiDpb *dpb, GstVaapiPicture *picture, - GstVaapiPicture **prev_picture_ptr, GstVaapiPicture **next_picture_ptr) +gst_vaapi_dpb_get_neighbours (GstVaapiDpb * dpb, GstVaapiPicture * picture, + GstVaapiPicture ** prev_picture_ptr, GstVaapiPicture ** next_picture_ptr) { - const GstVaapiDpbClass *klass; + const GstVaapiDpbClass *klass; - g_return_if_fail(GST_VAAPI_IS_DPB(dpb)); - g_return_if_fail(GST_VAAPI_IS_PICTURE(picture)); + g_return_if_fail (GST_VAAPI_IS_DPB (dpb)); + g_return_if_fail (GST_VAAPI_IS_PICTURE (picture)); - klass = GST_VAAPI_DPB_GET_CLASS(dpb); - if (G_UNLIKELY(!klass || !klass->get_neighbours)) - return; - klass->get_neighbours(dpb, picture, prev_picture_ptr, next_picture_ptr); + klass = GST_VAAPI_DPB_GET_CLASS (dpb); + if (G_UNLIKELY (!klass || !klass->get_neighbours)) + return; + klass->get_neighbours (dpb, picture, prev_picture_ptr, next_picture_ptr); } diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_h264.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_h264.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_h264.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_h264.c 2016-03-24 11:36:59.000000000 +0000 @@ -42,12 +42,12 @@ /* Defined to 1 if strict ordering of DPB is needed. Only useful for debug */ #define USE_STRICT_DPB_ORDERING 0 -typedef struct _GstVaapiDecoderH264Private GstVaapiDecoderH264Private; -typedef struct _GstVaapiDecoderH264Class GstVaapiDecoderH264Class; -typedef struct _GstVaapiFrameStore GstVaapiFrameStore; -typedef struct _GstVaapiFrameStoreClass GstVaapiFrameStoreClass; -typedef struct _GstVaapiParserInfoH264 GstVaapiParserInfoH264; -typedef struct _GstVaapiPictureH264 GstVaapiPictureH264; +typedef struct _GstVaapiDecoderH264Private GstVaapiDecoderH264Private; +typedef struct _GstVaapiDecoderH264Class GstVaapiDecoderH264Class; +typedef struct _GstVaapiFrameStore GstVaapiFrameStore; +typedef struct _GstVaapiFrameStoreClass GstVaapiFrameStoreClass; +typedef struct _GstVaapiParserInfoH264 GstVaapiParserInfoH264; +typedef struct _GstVaapiPictureH264 GstVaapiPictureH264; // Used for field_poc[] #define TOP_FIELD 0 @@ -63,74 +63,75 @@ * @GST_VAAPI_DECODER_UNIT_AU_START: marks the start of an access unit. * @GST_VAAPI_DECODER_UNIT_AU_END: marks the end of an access unit. */ -enum { - /* This flag does not strictly follow the definitions (7.4.1.2.3) - for detecting the start of an access unit as we are only - interested in knowing if the current slice is the first one or - the last one in the current access unit */ - GST_VAAPI_DECODER_UNIT_FLAG_AU_START = ( - GST_VAAPI_DECODER_UNIT_FLAG_LAST << 0), - GST_VAAPI_DECODER_UNIT_FLAG_AU_END = ( - GST_VAAPI_DECODER_UNIT_FLAG_LAST << 1), - - GST_VAAPI_DECODER_UNIT_FLAGS_AU = ( - GST_VAAPI_DECODER_UNIT_FLAG_AU_START | - GST_VAAPI_DECODER_UNIT_FLAG_AU_END), +enum +{ + /* This flag does not strictly follow the definitions (7.4.1.2.3) + for detecting the start of an access unit as we are only + interested in knowing if the current slice is the first one or + the last one in the current access unit */ + GST_VAAPI_DECODER_UNIT_FLAG_AU_START = + (GST_VAAPI_DECODER_UNIT_FLAG_LAST << 0), + GST_VAAPI_DECODER_UNIT_FLAG_AU_END = (GST_VAAPI_DECODER_UNIT_FLAG_LAST << 1), + + GST_VAAPI_DECODER_UNIT_FLAGS_AU = (GST_VAAPI_DECODER_UNIT_FLAG_AU_START | + GST_VAAPI_DECODER_UNIT_FLAG_AU_END), }; #define GST_VAAPI_PARSER_INFO_H264(obj) \ ((GstVaapiParserInfoH264 *)(obj)) -struct _GstVaapiParserInfoH264 { - GstVaapiMiniObject parent_instance; - GstH264NalUnit nalu; - union { - GstH264SPS sps; - GstH264PPS pps; - GArray *sei; - GstH264SliceHdr slice_hdr; - } data; - guint state; - guint flags; // Same as decoder unit flags (persistent) - guint view_id; // View ID of slice - guint voc; // View order index (VOIdx) of slice +struct _GstVaapiParserInfoH264 +{ + GstVaapiMiniObject parent_instance; + GstH264NalUnit nalu; + union + { + GstH264SPS sps; + GstH264PPS pps; + GArray *sei; + GstH264SliceHdr slice_hdr; + } data; + guint state; + guint flags; // Same as decoder unit flags (persistent) + guint view_id; // View ID of slice + guint voc; // View order index (VOIdx) of slice }; static void -gst_vaapi_parser_info_h264_finalize(GstVaapiParserInfoH264 *pi) +gst_vaapi_parser_info_h264_finalize (GstVaapiParserInfoH264 * pi) { - switch (pi->nalu.type) { + switch (pi->nalu.type) { case GST_H264_NAL_SPS: case GST_H264_NAL_SUBSET_SPS: - gst_h264_sps_clear(&pi->data.sps); - break; + gst_h264_sps_clear (&pi->data.sps); + break; case GST_H264_NAL_PPS: - gst_h264_pps_clear(&pi->data.pps); - break; + gst_h264_pps_clear (&pi->data.pps); + break; case GST_H264_NAL_SEI: - if (pi->data.sei) { - g_array_unref(pi->data.sei); - pi->data.sei = NULL; - } - break; - } + if (pi->data.sei) { + g_array_unref (pi->data.sei); + pi->data.sei = NULL; + } + break; + } } static inline const GstVaapiMiniObjectClass * -gst_vaapi_parser_info_h264_class(void) +gst_vaapi_parser_info_h264_class (void) { - static const GstVaapiMiniObjectClass GstVaapiParserInfoH264Class = { - .size = sizeof(GstVaapiParserInfoH264), - .finalize = (GDestroyNotify)gst_vaapi_parser_info_h264_finalize - }; - return &GstVaapiParserInfoH264Class; + static const GstVaapiMiniObjectClass GstVaapiParserInfoH264Class = { + .size = sizeof (GstVaapiParserInfoH264), + .finalize = (GDestroyNotify) gst_vaapi_parser_info_h264_finalize + }; + return &GstVaapiParserInfoH264Class; } static inline GstVaapiParserInfoH264 * -gst_vaapi_parser_info_h264_new(void) +gst_vaapi_parser_info_h264_new (void) { - return (GstVaapiParserInfoH264 *) - gst_vaapi_mini_object_new(gst_vaapi_parser_info_h264_class()); + return (GstVaapiParserInfoH264 *) + gst_vaapi_mini_object_new (gst_vaapi_parser_info_h264_class ()); } #define gst_vaapi_parser_info_h264_ref(pi) \ @@ -170,22 +171,23 @@ * @GST_VAAPI_PICTURE_FLAGS_REFERENCE: mask covering any kind of * reference picture (short-term reference or long-term reference) */ -enum { - GST_VAAPI_PICTURE_FLAG_IDR = (GST_VAAPI_PICTURE_FLAG_LAST << 0), - GST_VAAPI_PICTURE_FLAG_REFERENCE2 = (GST_VAAPI_PICTURE_FLAG_LAST << 1), - GST_VAAPI_PICTURE_FLAG_INTER_VIEW = (GST_VAAPI_PICTURE_FLAG_LAST << 2), - GST_VAAPI_PICTURE_FLAG_ANCHOR = (GST_VAAPI_PICTURE_FLAG_LAST << 3), - GST_VAAPI_PICTURE_FLAG_AU_START = (GST_VAAPI_PICTURE_FLAG_LAST << 4), - GST_VAAPI_PICTURE_FLAG_AU_END = (GST_VAAPI_PICTURE_FLAG_LAST << 5), - GST_VAAPI_PICTURE_FLAG_GHOST = (GST_VAAPI_PICTURE_FLAG_LAST << 6), - - GST_VAAPI_PICTURE_FLAG_SHORT_TERM_REFERENCE = ( - GST_VAAPI_PICTURE_FLAG_REFERENCE), - GST_VAAPI_PICTURE_FLAG_LONG_TERM_REFERENCE = ( - GST_VAAPI_PICTURE_FLAG_REFERENCE | GST_VAAPI_PICTURE_FLAG_REFERENCE2), - GST_VAAPI_PICTURE_FLAGS_REFERENCE = ( - GST_VAAPI_PICTURE_FLAG_SHORT_TERM_REFERENCE | - GST_VAAPI_PICTURE_FLAG_LONG_TERM_REFERENCE), +enum +{ + GST_VAAPI_PICTURE_FLAG_IDR = (GST_VAAPI_PICTURE_FLAG_LAST << 0), + GST_VAAPI_PICTURE_FLAG_REFERENCE2 = (GST_VAAPI_PICTURE_FLAG_LAST << 1), + GST_VAAPI_PICTURE_FLAG_INTER_VIEW = (GST_VAAPI_PICTURE_FLAG_LAST << 2), + GST_VAAPI_PICTURE_FLAG_ANCHOR = (GST_VAAPI_PICTURE_FLAG_LAST << 3), + GST_VAAPI_PICTURE_FLAG_AU_START = (GST_VAAPI_PICTURE_FLAG_LAST << 4), + GST_VAAPI_PICTURE_FLAG_AU_END = (GST_VAAPI_PICTURE_FLAG_LAST << 5), + GST_VAAPI_PICTURE_FLAG_GHOST = (GST_VAAPI_PICTURE_FLAG_LAST << 6), + + GST_VAAPI_PICTURE_FLAG_SHORT_TERM_REFERENCE = + (GST_VAAPI_PICTURE_FLAG_REFERENCE), + GST_VAAPI_PICTURE_FLAG_LONG_TERM_REFERENCE = + (GST_VAAPI_PICTURE_FLAG_REFERENCE | GST_VAAPI_PICTURE_FLAG_REFERENCE2), + GST_VAAPI_PICTURE_FLAGS_REFERENCE = + (GST_VAAPI_PICTURE_FLAG_SHORT_TERM_REFERENCE | + GST_VAAPI_PICTURE_FLAG_LONG_TERM_REFERENCE), }; #define GST_VAAPI_PICTURE_IS_IDR(picture) \ @@ -210,237 +212,233 @@ #define GST_VAAPI_PICTURE_H264(picture) \ ((GstVaapiPictureH264 *)(picture)) -struct _GstVaapiPictureH264 { - GstVaapiPicture base; - GstH264SliceHdr *last_slice_hdr; - guint structure; - gint32 field_poc[2]; - gint32 frame_num; // Original frame_num from slice_header() - gint32 frame_num_wrap; // Temporary for ref pic marking: FrameNumWrap - gint32 long_term_frame_idx; // Temporary for ref pic marking: LongTermFrameIdx - gint32 pic_num; // Temporary for ref pic marking: PicNum - gint32 long_term_pic_num; // Temporary for ref pic marking: LongTermPicNum - GstVaapiPictureH264 *other_field; // Temporary for ref pic marking: other field in the same frame store - guint output_flag : 1; - guint output_needed : 1; +struct _GstVaapiPictureH264 +{ + GstVaapiPicture base; + GstH264SliceHdr *last_slice_hdr; + guint structure; + gint32 field_poc[2]; + gint32 frame_num; // Original frame_num from slice_header() + gint32 frame_num_wrap; // Temporary for ref pic marking: FrameNumWrap + gint32 long_term_frame_idx; // Temporary for ref pic marking: LongTermFrameIdx + gint32 pic_num; // Temporary for ref pic marking: PicNum + gint32 long_term_pic_num; // Temporary for ref pic marking: LongTermPicNum + GstVaapiPictureH264 *other_field; // Temporary for ref pic marking: other field in the same frame store + guint output_flag:1; + guint output_needed:1; }; -GST_VAAPI_CODEC_DEFINE_TYPE(GstVaapiPictureH264, gst_vaapi_picture_h264); +GST_VAAPI_CODEC_DEFINE_TYPE (GstVaapiPictureH264, gst_vaapi_picture_h264); void -gst_vaapi_picture_h264_destroy(GstVaapiPictureH264 *picture) +gst_vaapi_picture_h264_destroy (GstVaapiPictureH264 * picture) { - gst_vaapi_picture_destroy(GST_VAAPI_PICTURE(picture)); + gst_vaapi_picture_destroy (GST_VAAPI_PICTURE (picture)); } gboolean -gst_vaapi_picture_h264_create( - GstVaapiPictureH264 *picture, - const GstVaapiCodecObjectConstructorArgs *args -) +gst_vaapi_picture_h264_create (GstVaapiPictureH264 * picture, + const GstVaapiCodecObjectConstructorArgs * args) { - if (!gst_vaapi_picture_create(GST_VAAPI_PICTURE(picture), args)) - return FALSE; + if (!gst_vaapi_picture_create (GST_VAAPI_PICTURE (picture), args)) + return FALSE; - picture->structure = picture->base.structure; - picture->field_poc[0] = G_MAXINT32; - picture->field_poc[1] = G_MAXINT32; - picture->output_needed = FALSE; - return TRUE; + picture->structure = picture->base.structure; + picture->field_poc[0] = G_MAXINT32; + picture->field_poc[1] = G_MAXINT32; + picture->output_needed = FALSE; + return TRUE; } static inline GstVaapiPictureH264 * -gst_vaapi_picture_h264_new(GstVaapiDecoderH264 *decoder) +gst_vaapi_picture_h264_new (GstVaapiDecoderH264 * decoder) { - return (GstVaapiPictureH264 *)gst_vaapi_codec_object_new( - &GstVaapiPictureH264Class, - GST_VAAPI_CODEC_BASE(decoder), - NULL, sizeof(VAPictureParameterBufferH264), - NULL, 0, - 0); + return (GstVaapiPictureH264 *) + gst_vaapi_codec_object_new (&GstVaapiPictureH264Class, + GST_VAAPI_CODEC_BASE (decoder), NULL, + sizeof (VAPictureParameterBufferH264), NULL, 0, 0); } static inline void -gst_vaapi_picture_h264_set_reference( - GstVaapiPictureH264 *picture, - guint reference_flags, - gboolean other_field -) -{ - if (!picture) - return; - GST_VAAPI_PICTURE_FLAG_UNSET(picture, GST_VAAPI_PICTURE_FLAGS_REFERENCE); - GST_VAAPI_PICTURE_FLAG_SET(picture, reference_flags); - - if (!other_field || !(picture = picture->other_field)) - return; - GST_VAAPI_PICTURE_FLAG_UNSET(picture, GST_VAAPI_PICTURE_FLAGS_REFERENCE); - GST_VAAPI_PICTURE_FLAG_SET(picture, reference_flags); +gst_vaapi_picture_h264_set_reference (GstVaapiPictureH264 * picture, + guint reference_flags, gboolean other_field) +{ + if (!picture) + return; + GST_VAAPI_PICTURE_FLAG_UNSET (picture, GST_VAAPI_PICTURE_FLAGS_REFERENCE); + GST_VAAPI_PICTURE_FLAG_SET (picture, reference_flags); + + if (!other_field || !(picture = picture->other_field)) + return; + GST_VAAPI_PICTURE_FLAG_UNSET (picture, GST_VAAPI_PICTURE_FLAGS_REFERENCE); + GST_VAAPI_PICTURE_FLAG_SET (picture, reference_flags); } static inline GstVaapiPictureH264 * -gst_vaapi_picture_h264_new_field(GstVaapiPictureH264 *picture) +gst_vaapi_picture_h264_new_field (GstVaapiPictureH264 * picture) { - g_return_val_if_fail(picture, NULL); + g_return_val_if_fail (picture, NULL); - return (GstVaapiPictureH264 *)gst_vaapi_picture_new_field(&picture->base); + return (GstVaapiPictureH264 *) gst_vaapi_picture_new_field (&picture->base); } static inline GstVaapiPictureH264 * -gst_vaapi_picture_h264_new_clone(GstVaapiPictureH264 *picture) +gst_vaapi_picture_h264_new_clone (GstVaapiPictureH264 * picture) { - g_return_val_if_fail(picture, NULL); + g_return_val_if_fail (picture, NULL); - return (GstVaapiPictureH264 *)gst_vaapi_picture_new_clone(&picture->base); + return (GstVaapiPictureH264 *) gst_vaapi_picture_new_clone (&picture->base); } /* ------------------------------------------------------------------------- */ /* --- Frame Buffers (DPB) --- */ /* ------------------------------------------------------------------------- */ -struct _GstVaapiFrameStore { - /*< private >*/ - GstVaapiMiniObject parent_instance; - - guint view_id; - guint structure; - GstVaapiPictureH264 *buffers[2]; - guint num_buffers; - guint output_needed; - guint output_called; +struct _GstVaapiFrameStore +{ + /*< private > */ + GstVaapiMiniObject parent_instance; + + guint view_id; + guint structure; + GstVaapiPictureH264 *buffers[2]; + guint num_buffers; + guint output_needed; + guint output_called; }; static void -gst_vaapi_frame_store_finalize(gpointer object) +gst_vaapi_frame_store_finalize (gpointer object) { - GstVaapiFrameStore * const fs = object; - guint i; + GstVaapiFrameStore *const fs = object; + guint i; - for (i = 0; i < fs->num_buffers; i++) - gst_vaapi_picture_replace(&fs->buffers[i], NULL); + for (i = 0; i < fs->num_buffers; i++) + gst_vaapi_picture_replace (&fs->buffers[i], NULL); } static GstVaapiFrameStore * -gst_vaapi_frame_store_new(GstVaapiPictureH264 *picture) +gst_vaapi_frame_store_new (GstVaapiPictureH264 * picture) { - GstVaapiFrameStore *fs; + GstVaapiFrameStore *fs; - static const GstVaapiMiniObjectClass GstVaapiFrameStoreClass = { - sizeof(GstVaapiFrameStore), - gst_vaapi_frame_store_finalize - }; + static const GstVaapiMiniObjectClass GstVaapiFrameStoreClass = { + sizeof (GstVaapiFrameStore), + gst_vaapi_frame_store_finalize + }; + + fs = (GstVaapiFrameStore *) + gst_vaapi_mini_object_new (&GstVaapiFrameStoreClass); + if (!fs) + return NULL; - fs = (GstVaapiFrameStore *) - gst_vaapi_mini_object_new(&GstVaapiFrameStoreClass); - if (!fs) - return NULL; - - fs->view_id = picture->base.view_id; - fs->structure = picture->structure; - fs->buffers[0] = gst_vaapi_picture_ref(picture); - fs->buffers[1] = NULL; - fs->num_buffers = 1; - fs->output_needed = 0; - fs->output_called = 0; - - if (picture->output_flag) { - picture->output_needed = TRUE; - fs->output_needed++; - } - return fs; + fs->view_id = picture->base.view_id; + fs->structure = picture->structure; + fs->buffers[0] = gst_vaapi_picture_ref (picture); + fs->buffers[1] = NULL; + fs->num_buffers = 1; + fs->output_needed = 0; + fs->output_called = 0; + + if (picture->output_flag) { + picture->output_needed = TRUE; + fs->output_needed++; + } + return fs; } static gboolean -gst_vaapi_frame_store_add(GstVaapiFrameStore *fs, GstVaapiPictureH264 *picture) +gst_vaapi_frame_store_add (GstVaapiFrameStore * fs, + GstVaapiPictureH264 * picture) { - guint field; - - g_return_val_if_fail(fs->num_buffers == 1, FALSE); - g_return_val_if_fail(!GST_VAAPI_PICTURE_IS_FRAME(picture), FALSE); - g_return_val_if_fail(!GST_VAAPI_PICTURE_IS_FIRST_FIELD(picture), FALSE); - - gst_vaapi_picture_replace(&fs->buffers[fs->num_buffers++], picture); - if (picture->output_flag) { - picture->output_needed = TRUE; - fs->output_needed++; - } - - fs->structure = GST_VAAPI_PICTURE_STRUCTURE_FRAME; + guint field; - field = picture->structure == GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD ? - TOP_FIELD : BOTTOM_FIELD; - g_return_val_if_fail(fs->buffers[0]->field_poc[field] == G_MAXINT32, FALSE); - fs->buffers[0]->field_poc[field] = picture->field_poc[field]; - g_return_val_if_fail(picture->field_poc[!field] == G_MAXINT32, FALSE); - picture->field_poc[!field] = fs->buffers[0]->field_poc[!field]; - return TRUE; + g_return_val_if_fail (fs->num_buffers == 1, FALSE); + g_return_val_if_fail (!GST_VAAPI_PICTURE_IS_FRAME (picture), FALSE); + g_return_val_if_fail (!GST_VAAPI_PICTURE_IS_FIRST_FIELD (picture), FALSE); + + gst_vaapi_picture_replace (&fs->buffers[fs->num_buffers++], picture); + if (picture->output_flag) { + picture->output_needed = TRUE; + fs->output_needed++; + } + + fs->structure = GST_VAAPI_PICTURE_STRUCTURE_FRAME; + + field = picture->structure == GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD ? + TOP_FIELD : BOTTOM_FIELD; + g_return_val_if_fail (fs->buffers[0]->field_poc[field] == G_MAXINT32, FALSE); + fs->buffers[0]->field_poc[field] = picture->field_poc[field]; + g_return_val_if_fail (picture->field_poc[!field] == G_MAXINT32, FALSE); + picture->field_poc[!field] = fs->buffers[0]->field_poc[!field]; + return TRUE; } static gboolean -gst_vaapi_frame_store_split_fields(GstVaapiFrameStore *fs, gboolean tff) +gst_vaapi_frame_store_split_fields (GstVaapiFrameStore * fs, gboolean tff) { - GstVaapiPictureH264 * const first_field = fs->buffers[0]; - GstVaapiPictureH264 *second_field; + GstVaapiPictureH264 *const first_field = fs->buffers[0]; + GstVaapiPictureH264 *second_field; - g_return_val_if_fail(fs->num_buffers == 1, FALSE); + g_return_val_if_fail (fs->num_buffers == 1, FALSE); - first_field->base.structure = tff ? - GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD : - GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD; - GST_VAAPI_PICTURE_FLAG_SET(first_field, GST_VAAPI_PICTURE_FLAG_INTERLACED); + first_field->base.structure = tff ? + GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD : + GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD; + GST_VAAPI_PICTURE_FLAG_SET (first_field, GST_VAAPI_PICTURE_FLAG_INTERLACED); - second_field = gst_vaapi_picture_h264_new_field(first_field); - if (!second_field) - return FALSE; - gst_vaapi_picture_replace(&fs->buffers[fs->num_buffers++], second_field); - gst_vaapi_picture_unref(second_field); + second_field = gst_vaapi_picture_h264_new_field (first_field); + if (!second_field) + return FALSE; + gst_vaapi_picture_replace (&fs->buffers[fs->num_buffers++], second_field); + gst_vaapi_picture_unref (second_field); - second_field->frame_num = first_field->frame_num; - second_field->field_poc[0] = first_field->field_poc[0]; - second_field->field_poc[1] = first_field->field_poc[1]; - second_field->output_flag = first_field->output_flag; - if (second_field->output_flag) { - second_field->output_needed = TRUE; - fs->output_needed++; - } - return TRUE; + second_field->frame_num = first_field->frame_num; + second_field->field_poc[0] = first_field->field_poc[0]; + second_field->field_poc[1] = first_field->field_poc[1]; + second_field->output_flag = first_field->output_flag; + if (second_field->output_flag) { + second_field->output_needed = TRUE; + fs->output_needed++; + } + return TRUE; } static inline gboolean -gst_vaapi_frame_store_has_frame(GstVaapiFrameStore *fs) +gst_vaapi_frame_store_has_frame (GstVaapiFrameStore * fs) { - return fs->structure == GST_VAAPI_PICTURE_STRUCTURE_FRAME; + return fs->structure == GST_VAAPI_PICTURE_STRUCTURE_FRAME; } static inline gboolean -gst_vaapi_frame_store_is_complete(GstVaapiFrameStore *fs) +gst_vaapi_frame_store_is_complete (GstVaapiFrameStore * fs) { - return gst_vaapi_frame_store_has_frame(fs) || - GST_VAAPI_PICTURE_IS_ONEFIELD(fs->buffers[0]); + return gst_vaapi_frame_store_has_frame (fs) || + GST_VAAPI_PICTURE_IS_ONEFIELD (fs->buffers[0]); } static inline gboolean -gst_vaapi_frame_store_has_reference(GstVaapiFrameStore *fs) +gst_vaapi_frame_store_has_reference (GstVaapiFrameStore * fs) { - guint i; + guint i; - for (i = 0; i < fs->num_buffers; i++) { - if (GST_VAAPI_PICTURE_IS_REFERENCE(fs->buffers[i])) - return TRUE; - } - return FALSE; + for (i = 0; i < fs->num_buffers; i++) { + if (GST_VAAPI_PICTURE_IS_REFERENCE (fs->buffers[i])) + return TRUE; + } + return FALSE; } static gboolean -gst_vaapi_frame_store_has_inter_view(GstVaapiFrameStore *fs) +gst_vaapi_frame_store_has_inter_view (GstVaapiFrameStore * fs) { - guint i; + guint i; - for (i = 0; i < fs->num_buffers; i++) { - if (GST_VAAPI_PICTURE_IS_INTER_VIEW(fs->buffers[i])) - return TRUE; - } - return FALSE; + for (i = 0; i < fs->num_buffers; i++) { + if (GST_VAAPI_PICTURE_IS_INTER_VIEW (fs->buffers[i])) + return TRUE; + } + return FALSE; } #define gst_vaapi_frame_store_ref(fs) \ @@ -460,75 +458,76 @@ #define GST_VAAPI_DECODER_H264_CAST(decoder) \ ((GstVaapiDecoderH264 *)(decoder)) -typedef enum { - GST_H264_VIDEO_STATE_GOT_SPS = 1 << 0, - GST_H264_VIDEO_STATE_GOT_PPS = 1 << 1, - GST_H264_VIDEO_STATE_GOT_SLICE = 1 << 2, - GST_H264_VIDEO_STATE_GOT_I_FRAME = 1 << 3, // persistent across SPS - GST_H264_VIDEO_STATE_GOT_P_SLICE = 1 << 4, // predictive (all non-intra) - - GST_H264_VIDEO_STATE_VALID_PICTURE_HEADERS = ( - GST_H264_VIDEO_STATE_GOT_SPS | - GST_H264_VIDEO_STATE_GOT_PPS), - GST_H264_VIDEO_STATE_VALID_PICTURE = ( - GST_H264_VIDEO_STATE_VALID_PICTURE_HEADERS | - GST_H264_VIDEO_STATE_GOT_SLICE) +typedef enum +{ + GST_H264_VIDEO_STATE_GOT_SPS = 1 << 0, + GST_H264_VIDEO_STATE_GOT_PPS = 1 << 1, + GST_H264_VIDEO_STATE_GOT_SLICE = 1 << 2, + GST_H264_VIDEO_STATE_GOT_I_FRAME = 1 << 3, // persistent across SPS + GST_H264_VIDEO_STATE_GOT_P_SLICE = 1 << 4, // predictive (all non-intra) + + GST_H264_VIDEO_STATE_VALID_PICTURE_HEADERS = (GST_H264_VIDEO_STATE_GOT_SPS | + GST_H264_VIDEO_STATE_GOT_PPS), + GST_H264_VIDEO_STATE_VALID_PICTURE = + (GST_H264_VIDEO_STATE_VALID_PICTURE_HEADERS | + GST_H264_VIDEO_STATE_GOT_SLICE) } GstH264VideoState; -struct _GstVaapiDecoderH264Private { - GstH264NalParser *parser; - guint parser_state; - guint decoder_state; - GstVaapiStreamAlignH264 stream_alignment; - GstVaapiPictureH264 *current_picture; - GstVaapiPictureH264 *missing_picture; - GstVaapiParserInfoH264 *sps[GST_H264_MAX_SPS_COUNT]; - GstVaapiParserInfoH264 *active_sps; - GstVaapiParserInfoH264 *pps[GST_H264_MAX_PPS_COUNT]; - GstVaapiParserInfoH264 *active_pps; - GstVaapiParserInfoH264 *prev_pi; - GstVaapiParserInfoH264 *prev_slice_pi; - GstVaapiFrameStore **prev_ref_frames; - GstVaapiFrameStore **prev_frames; - guint prev_frames_alloc; - GstVaapiFrameStore **dpb; - guint dpb_count; - guint dpb_size; - guint dpb_size_max; - guint max_views; - GstVaapiProfile profile; - GstVaapiEntrypoint entrypoint; - GstVaapiChromaType chroma_type; - GPtrArray *inter_views; - GstVaapiPictureH264 *short_ref[32]; - guint short_ref_count; - GstVaapiPictureH264 *long_ref[32]; - guint long_ref_count; - GstVaapiPictureH264 *RefPicList0[32]; - guint RefPicList0_count; - GstVaapiPictureH264 *RefPicList1[32]; - guint RefPicList1_count; - guint nal_length_size; - guint mb_width; - guint mb_height; - guint pic_structure; // pic_struct (from SEI pic_timing() or inferred) - gint32 field_poc[2]; // 0:TopFieldOrderCnt / 1:BottomFieldOrderCnt - gint32 poc_msb; // PicOrderCntMsb - gint32 poc_lsb; // pic_order_cnt_lsb (from slice_header()) - gint32 prev_poc_msb; // prevPicOrderCntMsb - gint32 prev_poc_lsb; // prevPicOrderCntLsb - gint32 frame_num_offset; // FrameNumOffset - gint32 frame_num; // frame_num (from slice_header()) - gint32 prev_frame_num; // prevFrameNum - gint32 prev_ref_frame_num; // prevRefFrameNum - gboolean prev_pic_has_mmco5; // prevMmco5Pic - gboolean prev_pic_reference; // previous picture is a reference - guint prev_pic_structure; // previous picture structure - guint is_opened : 1; - guint is_avcC : 1; - guint has_context : 1; - guint progressive_sequence : 1; - guint top_field_first : 1; +struct _GstVaapiDecoderH264Private +{ + GstH264NalParser *parser; + guint parser_state; + guint decoder_state; + GstVaapiStreamAlignH264 stream_alignment; + GstVaapiPictureH264 *current_picture; + GstVaapiPictureH264 *missing_picture; + GstVaapiParserInfoH264 *sps[GST_H264_MAX_SPS_COUNT]; + GstVaapiParserInfoH264 *active_sps; + GstVaapiParserInfoH264 *pps[GST_H264_MAX_PPS_COUNT]; + GstVaapiParserInfoH264 *active_pps; + GstVaapiParserInfoH264 *prev_pi; + GstVaapiParserInfoH264 *prev_slice_pi; + GstVaapiFrameStore **prev_ref_frames; + GstVaapiFrameStore **prev_frames; + guint prev_frames_alloc; + GstVaapiFrameStore **dpb; + guint dpb_count; + guint dpb_size; + guint dpb_size_max; + guint max_views; + GstVaapiProfile profile; + GstVaapiEntrypoint entrypoint; + GstVaapiChromaType chroma_type; + GPtrArray *inter_views; + GstVaapiPictureH264 *short_ref[32]; + guint short_ref_count; + GstVaapiPictureH264 *long_ref[32]; + guint long_ref_count; + GstVaapiPictureH264 *RefPicList0[32]; + guint RefPicList0_count; + GstVaapiPictureH264 *RefPicList1[32]; + guint RefPicList1_count; + guint nal_length_size; + guint mb_width; + guint mb_height; + guint pic_structure; // pic_struct (from SEI pic_timing() or inferred) + gint32 field_poc[2]; // 0:TopFieldOrderCnt / 1:BottomFieldOrderCnt + gint32 poc_msb; // PicOrderCntMsb + gint32 poc_lsb; // pic_order_cnt_lsb (from slice_header()) + gint32 prev_poc_msb; // prevPicOrderCntMsb + gint32 prev_poc_lsb; // prevPicOrderCntLsb + gint32 frame_num_offset; // FrameNumOffset + gint32 frame_num; // frame_num (from slice_header()) + gint32 prev_frame_num; // prevFrameNum + gint32 prev_ref_frame_num; // prevRefFrameNum + gboolean prev_pic_has_mmco5; // prevMmco5Pic + gboolean prev_pic_reference; // previous picture is a reference + guint prev_pic_structure; // previous picture structure + guint is_opened:1; + guint is_avcC:1; + guint has_context:1; + guint progressive_sequence:1; + guint top_field_first:1; }; /** @@ -536,10 +535,11 @@ * * A decoder based on H264. */ -struct _GstVaapiDecoderH264 { - /*< private >*/ - GstVaapiDecoder parent_instance; - GstVaapiDecoderH264Private priv; +struct _GstVaapiDecoderH264 +{ + /*< private > */ + GstVaapiDecoder parent_instance; + GstVaapiDecoderH264Private priv; }; /** @@ -547,161 +547,162 @@ * * A decoder class based on H264. */ -struct _GstVaapiDecoderH264Class { - /*< private >*/ - GstVaapiDecoderClass parent_class; +struct _GstVaapiDecoderH264Class +{ + /*< private > */ + GstVaapiDecoderClass parent_class; }; static gboolean -exec_ref_pic_marking(GstVaapiDecoderH264 *decoder, GstVaapiPictureH264 *picture); +exec_ref_pic_marking (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture); static gboolean -exec_ref_pic_marking_sliding_window(GstVaapiDecoderH264 *decoder); +exec_ref_pic_marking_sliding_window (GstVaapiDecoderH264 * decoder); static gboolean -is_inter_view_reference_for_next_pictures(GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture); +is_inter_view_reference_for_next_pictures (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture); static inline gboolean -is_inter_view_reference_for_next_frames(GstVaapiDecoderH264 *decoder, - GstVaapiFrameStore *fs) +is_inter_view_reference_for_next_frames (GstVaapiDecoderH264 * decoder, + GstVaapiFrameStore * fs) { - return is_inter_view_reference_for_next_pictures(decoder, fs->buffers[0]); + return is_inter_view_reference_for_next_pictures (decoder, fs->buffers[0]); } /* Determines if the supplied profile is one of the MVC set */ static gboolean -is_mvc_profile(GstH264Profile profile) +is_mvc_profile (GstH264Profile profile) { - return profile == GST_H264_PROFILE_MULTIVIEW_HIGH || - profile == GST_H264_PROFILE_STEREO_HIGH; + return profile == GST_H264_PROFILE_MULTIVIEW_HIGH || + profile == GST_H264_PROFILE_STEREO_HIGH; } /* Determines the view_id from the supplied NAL unit */ static inline guint -get_view_id(GstH264NalUnit *nalu) +get_view_id (GstH264NalUnit * nalu) { - return GST_H264_IS_MVC_NALU(nalu) ? nalu->extension.mvc.view_id : 0; + return GST_H264_IS_MVC_NALU (nalu) ? nalu->extension.mvc.view_id : 0; } /* Determines the view order index (VOIdx) from the supplied view_id */ static gint -get_view_order_index(GstH264SPS *sps, guint16 view_id) +get_view_order_index (GstH264SPS * sps, guint16 view_id) { - GstH264SPSExtMVC *mvc; - gint i; + GstH264SPSExtMVC *mvc; + gint i; - if (!sps || sps->extension_type != GST_H264_NAL_EXTENSION_MVC) - return 0; + if (!sps || sps->extension_type != GST_H264_NAL_EXTENSION_MVC) + return 0; - mvc = &sps->extension.mvc; - for (i = 0; i <= mvc->num_views_minus1; i++) { - if (mvc->view[i].view_id == view_id) - return i; - } - GST_ERROR("failed to find VOIdx from view_id (%d)", view_id); - return -1; + mvc = &sps->extension.mvc; + for (i = 0; i <= mvc->num_views_minus1; i++) { + if (mvc->view[i].view_id == view_id) + return i; + } + GST_ERROR ("failed to find VOIdx from view_id (%d)", view_id); + return -1; } /* Determines NumViews */ static guint -get_num_views(GstH264SPS *sps) +get_num_views (GstH264SPS * sps) { - return 1 + (sps->extension_type == GST_H264_NAL_EXTENSION_MVC ? - sps->extension.mvc.num_views_minus1 : 0); + return 1 + (sps->extension_type == GST_H264_NAL_EXTENSION_MVC ? + sps->extension.mvc.num_views_minus1 : 0); } /* Get number of reference frames to use */ static guint -get_max_dec_frame_buffering(GstH264SPS *sps) +get_max_dec_frame_buffering (GstH264SPS * sps) { - guint num_views, max_dpb_frames; - guint max_dec_frame_buffering, PicSizeMbs; - GstVaapiLevelH264 level; - const GstVaapiH264LevelLimits *level_limits; - - /* Table A-1 - Level limits */ - if (G_UNLIKELY(sps->level_idc == 11 && sps->constraint_set3_flag)) - level = GST_VAAPI_LEVEL_H264_L1b; - else - level = gst_vaapi_utils_h264_get_level(sps->level_idc); - level_limits = gst_vaapi_utils_h264_get_level_limits(level); - if (G_UNLIKELY(!level_limits)) { - GST_FIXME("unsupported level_idc value (%d)", sps->level_idc); - max_dec_frame_buffering = 16; - } + guint num_views, max_dpb_frames; + guint max_dec_frame_buffering, PicSizeMbs; + GstVaapiLevelH264 level; + const GstVaapiH264LevelLimits *level_limits; + + /* Table A-1 - Level limits */ + if (G_UNLIKELY (sps->level_idc == 11 && sps->constraint_set3_flag)) + level = GST_VAAPI_LEVEL_H264_L1b; + else + level = gst_vaapi_utils_h264_get_level (sps->level_idc); + level_limits = gst_vaapi_utils_h264_get_level_limits (level); + if (G_UNLIKELY (!level_limits)) { + GST_FIXME ("unsupported level_idc value (%d)", sps->level_idc); + max_dec_frame_buffering = 16; + } else { + PicSizeMbs = ((sps->pic_width_in_mbs_minus1 + 1) * + (sps->pic_height_in_map_units_minus1 + 1) * + (sps->frame_mbs_only_flag ? 1 : 2)); + max_dec_frame_buffering = level_limits->MaxDpbMbs / PicSizeMbs; + } + if (is_mvc_profile (sps->profile_idc)) + max_dec_frame_buffering <<= 1; + + /* VUI parameters */ + if (sps->vui_parameters_present_flag) { + GstH264VUIParams *const vui_params = &sps->vui_parameters; + if (vui_params->bitstream_restriction_flag) + max_dec_frame_buffering = vui_params->max_dec_frame_buffering; else { - PicSizeMbs = ((sps->pic_width_in_mbs_minus1 + 1) * - (sps->pic_height_in_map_units_minus1 + 1) * - (sps->frame_mbs_only_flag ? 1 : 2)); - max_dec_frame_buffering = level_limits->MaxDpbMbs / PicSizeMbs; - } - if (is_mvc_profile(sps->profile_idc)) - max_dec_frame_buffering <<= 1; - - /* VUI parameters */ - if (sps->vui_parameters_present_flag) { - GstH264VUIParams * const vui_params = &sps->vui_parameters; - if (vui_params->bitstream_restriction_flag) - max_dec_frame_buffering = vui_params->max_dec_frame_buffering; - else { - switch (sps->profile_idc) { - case 44: // CAVLC 4:4:4 Intra profile - case GST_H264_PROFILE_SCALABLE_HIGH: - case GST_H264_PROFILE_HIGH: - case GST_H264_PROFILE_HIGH10: - case GST_H264_PROFILE_HIGH_422: - case GST_H264_PROFILE_HIGH_444: - if (sps->constraint_set3_flag) - max_dec_frame_buffering = 0; - break; - } - } - } - - num_views = get_num_views(sps); - max_dpb_frames = 16 * (num_views > 1 ? g_bit_storage(num_views - 1) : 1); - if (max_dec_frame_buffering > max_dpb_frames) - max_dec_frame_buffering = max_dpb_frames; - else if (max_dec_frame_buffering < sps->num_ref_frames) - max_dec_frame_buffering = sps->num_ref_frames; - return MAX(1, max_dec_frame_buffering); + switch (sps->profile_idc) { + case 44: // CAVLC 4:4:4 Intra profile + case GST_H264_PROFILE_SCALABLE_HIGH: + case GST_H264_PROFILE_HIGH: + case GST_H264_PROFILE_HIGH10: + case GST_H264_PROFILE_HIGH_422: + case GST_H264_PROFILE_HIGH_444: + if (sps->constraint_set3_flag) + max_dec_frame_buffering = 0; + break; + } + } + } + + num_views = get_num_views (sps); + max_dpb_frames = 16 * (num_views > 1 ? g_bit_storage (num_views - 1) : 1); + if (max_dec_frame_buffering > max_dpb_frames) + max_dec_frame_buffering = max_dpb_frames; + else if (max_dec_frame_buffering < sps->num_ref_frames) + max_dec_frame_buffering = sps->num_ref_frames; + return MAX (1, max_dec_frame_buffering); } static void -array_remove_index_fast(void *array, guint *array_length_ptr, guint index) +array_remove_index_fast (void *array, guint * array_length_ptr, guint index) { - gpointer * const entries = array; - guint num_entries = *array_length_ptr; + gpointer *const entries = array; + guint num_entries = *array_length_ptr; - g_return_if_fail(index < num_entries); + g_return_if_fail (index < num_entries); - if (index != --num_entries) - entries[index] = entries[num_entries]; - entries[num_entries] = NULL; - *array_length_ptr = num_entries; + if (index != --num_entries) + entries[index] = entries[num_entries]; + entries[num_entries] = NULL; + *array_length_ptr = num_entries; } #if 1 static inline void -array_remove_index(void *array, guint *array_length_ptr, guint index) +array_remove_index (void *array, guint * array_length_ptr, guint index) { - array_remove_index_fast(array, array_length_ptr, index); + array_remove_index_fast (array, array_length_ptr, index); } #else static void -array_remove_index(void *array, guint *array_length_ptr, guint index) +array_remove_index (void *array, guint * array_length_ptr, guint index) { - gpointer * const entries = array; - const guint num_entries = *array_length_ptr - 1; - guint i; - - g_return_if_fail(index <= num_entries); - - for (i = index; i < num_entries; i++) - entries[i] = entries[i + 1]; - entries[num_entries] = NULL; - *array_length_ptr = num_entries; + gpointer *const entries = array; + const guint num_entries = *array_length_ptr - 1; + guint i; + + g_return_if_fail (index <= num_entries); + + for (i = index; i < num_entries; i++) + entries[i] = entries[i + 1]; + entries[num_entries] = NULL; + *array_length_ptr = num_entries; } #endif @@ -709,1693 +710,1654 @@ array_remove_index(array, &array##_count, index) static void -dpb_remove_index(GstVaapiDecoderH264 *decoder, guint index) +dpb_remove_index (GstVaapiDecoderH264 * decoder, guint index) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - guint i, num_frames = --priv->dpb_count; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + guint i, num_frames = --priv->dpb_count; - if (USE_STRICT_DPB_ORDERING) { - for (i = index; i < num_frames; i++) - gst_vaapi_frame_store_replace(&priv->dpb[i], priv->dpb[i + 1]); - } - else if (index != num_frames) - gst_vaapi_frame_store_replace(&priv->dpb[index], priv->dpb[num_frames]); - gst_vaapi_frame_store_replace(&priv->dpb[num_frames], NULL); + if (USE_STRICT_DPB_ORDERING) { + for (i = index; i < num_frames; i++) + gst_vaapi_frame_store_replace (&priv->dpb[i], priv->dpb[i + 1]); + } else if (index != num_frames) + gst_vaapi_frame_store_replace (&priv->dpb[index], priv->dpb[num_frames]); + gst_vaapi_frame_store_replace (&priv->dpb[num_frames], NULL); } static gboolean -dpb_output(GstVaapiDecoderH264 *decoder, GstVaapiFrameStore *fs) +dpb_output (GstVaapiDecoderH264 * decoder, GstVaapiFrameStore * fs) { - GstVaapiPictureH264 *picture = NULL; - guint i; + GstVaapiPictureH264 *picture = NULL; + guint i; + + g_return_val_if_fail (fs != NULL, FALSE); - g_return_val_if_fail(fs != NULL, FALSE); + fs->output_called++; + if (!gst_vaapi_frame_store_is_complete (fs)) + return TRUE; - fs->output_called++; - if (!gst_vaapi_frame_store_is_complete(fs)) - return TRUE; - - for (i = 0; i < fs->num_buffers; i++) { - GstVaapiPictureH264 * const pic = fs->buffers[i]; - g_return_val_if_fail(pic != NULL, FALSE); - pic->output_needed = FALSE; - if (!GST_VAAPI_PICTURE_FLAG_IS_SET(pic, GST_VAAPI_PICTURE_FLAG_GHOST)) - picture = pic; - } - - fs->output_needed = 0; - fs->output_called = 0; - if (!picture) - return TRUE; - return gst_vaapi_picture_output(GST_VAAPI_PICTURE_CAST(picture)); + for (i = 0; i < fs->num_buffers; i++) { + GstVaapiPictureH264 *const pic = fs->buffers[i]; + g_return_val_if_fail (pic != NULL, FALSE); + pic->output_needed = FALSE; + if (!GST_VAAPI_PICTURE_FLAG_IS_SET (pic, GST_VAAPI_PICTURE_FLAG_GHOST)) + picture = pic; + } + + fs->output_needed = 0; + fs->output_called = 0; + if (!picture) + return TRUE; + return gst_vaapi_picture_output (GST_VAAPI_PICTURE_CAST (picture)); } static inline void -dpb_evict(GstVaapiDecoderH264 *decoder, GstVaapiPictureH264 *picture, guint i) +dpb_evict (GstVaapiDecoderH264 * decoder, GstVaapiPictureH264 * picture, + guint i) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiFrameStore * const fs = priv->dpb[i]; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiFrameStore *const fs = priv->dpb[i]; - if (!fs->output_needed && !gst_vaapi_frame_store_has_reference(fs)) - dpb_remove_index(decoder, i); + if (!fs->output_needed && !gst_vaapi_frame_store_has_reference (fs)) + dpb_remove_index (decoder, i); } /* Finds the picture with the nearest previous POC and same structure */ static gint -dpb_find_nearest_prev_poc(GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, guint picture_structure, - GstVaapiPictureH264 **found_picture_ptr) -{ - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiPictureH264 *found_picture = NULL; - guint i, j, found_index; - - g_return_val_if_fail(picture != NULL, -1); - - if (!picture_structure) - picture_structure = picture->base.structure; - - for (i = 0; i < priv->dpb_count; i++) { - GstVaapiFrameStore * const fs = priv->dpb[i]; - if (picture->base.view_id != fs->view_id) - continue; - for (j = 0; j < fs->num_buffers; j++) { - GstVaapiPictureH264 * const pic = fs->buffers[j]; - if (pic->base.structure != picture_structure) - continue; - if (pic->base.poc >= picture->base.poc) - continue; - if (!found_picture || found_picture->base.poc < pic->base.poc) - found_picture = pic, found_index = i; - } - } - - if (found_picture_ptr) - *found_picture_ptr = found_picture; - return found_picture ? found_index : -1; +dpb_find_nearest_prev_poc (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, guint picture_structure, + GstVaapiPictureH264 ** found_picture_ptr) +{ + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiPictureH264 *found_picture = NULL; + guint i, j, found_index; + + g_return_val_if_fail (picture != NULL, -1); + + if (!picture_structure) + picture_structure = picture->base.structure; + + for (i = 0; i < priv->dpb_count; i++) { + GstVaapiFrameStore *const fs = priv->dpb[i]; + if (picture->base.view_id != fs->view_id) + continue; + for (j = 0; j < fs->num_buffers; j++) { + GstVaapiPictureH264 *const pic = fs->buffers[j]; + if (pic->base.structure != picture_structure) + continue; + if (pic->base.poc >= picture->base.poc) + continue; + if (!found_picture || found_picture->base.poc < pic->base.poc) + found_picture = pic, found_index = i; + } + } + + if (found_picture_ptr) + *found_picture_ptr = found_picture; + return found_picture ? found_index : -1; } /* Finds the picture with the lowest POC that needs to be output */ static gint -dpb_find_lowest_poc(GstVaapiDecoderH264 *decoder, GstVaapiPictureH264 *picture, - GstVaapiPictureH264 **found_picture_ptr) +dpb_find_lowest_poc (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, GstVaapiPictureH264 ** found_picture_ptr) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiPictureH264 *found_picture = NULL; - guint i, j, found_index; - - for (i = 0; i < priv->dpb_count; i++) { - GstVaapiFrameStore * const fs = priv->dpb[i]; - if (!fs->output_needed) - continue; - if (picture && picture->base.view_id != fs->view_id) - continue; - for (j = 0; j < fs->num_buffers; j++) { - GstVaapiPictureH264 * const pic = fs->buffers[j]; - if (!pic->output_needed) - continue; - if (!found_picture || found_picture->base.poc > pic->base.poc || - (found_picture->base.poc == pic->base.poc && - found_picture->base.voc > pic->base.voc)) - found_picture = pic, found_index = i; - } - } - - if (found_picture_ptr) - *found_picture_ptr = found_picture; - return found_picture ? found_index : -1; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiPictureH264 *found_picture = NULL; + guint i, j, found_index; + + for (i = 0; i < priv->dpb_count; i++) { + GstVaapiFrameStore *const fs = priv->dpb[i]; + if (!fs->output_needed) + continue; + if (picture && picture->base.view_id != fs->view_id) + continue; + for (j = 0; j < fs->num_buffers; j++) { + GstVaapiPictureH264 *const pic = fs->buffers[j]; + if (!pic->output_needed) + continue; + if (!found_picture || found_picture->base.poc > pic->base.poc || + (found_picture->base.poc == pic->base.poc && + found_picture->base.voc > pic->base.voc)) + found_picture = pic, found_index = i; + } + } + + if (found_picture_ptr) + *found_picture_ptr = found_picture; + return found_picture ? found_index : -1; } /* Finds the picture with the lowest VOC that needs to be output */ static gint -dpb_find_lowest_voc(GstVaapiDecoderH264 *decoder, GstVaapiPictureH264 *picture, - GstVaapiPictureH264 **found_picture_ptr) +dpb_find_lowest_voc (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, GstVaapiPictureH264 ** found_picture_ptr) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiPictureH264 *found_picture = NULL; - guint i, j, found_index; - - for (i = 0; i < priv->dpb_count; i++) { - GstVaapiFrameStore * const fs = priv->dpb[i]; - if (!fs->output_needed || fs->view_id == picture->base.view_id) - continue; - for (j = 0; j < fs->num_buffers; j++) { - GstVaapiPictureH264 * const pic = fs->buffers[j]; - if (!pic->output_needed || pic->base.poc != picture->base.poc) - continue; - if (!found_picture || found_picture->base.voc > pic->base.voc) - found_picture = pic, found_index = i; - } - } - - if (found_picture_ptr) - *found_picture_ptr = found_picture; - return found_picture ? found_index : -1; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiPictureH264 *found_picture = NULL; + guint i, j, found_index; + + for (i = 0; i < priv->dpb_count; i++) { + GstVaapiFrameStore *const fs = priv->dpb[i]; + if (!fs->output_needed || fs->view_id == picture->base.view_id) + continue; + for (j = 0; j < fs->num_buffers; j++) { + GstVaapiPictureH264 *const pic = fs->buffers[j]; + if (!pic->output_needed || pic->base.poc != picture->base.poc) + continue; + if (!found_picture || found_picture->base.voc > pic->base.voc) + found_picture = pic, found_index = i; + } + } + + if (found_picture_ptr) + *found_picture_ptr = found_picture; + return found_picture ? found_index : -1; } static gboolean -dpb_output_other_views(GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, guint voc) +dpb_output_other_views (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, guint voc) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiPictureH264 *found_picture; - gint found_index; - gboolean success; - - if (priv->max_views == 1) - return TRUE; - - /* Emit all other view components that were in the same access - unit than the picture we have just found */ - found_picture = picture; - for (;;) { - found_index = dpb_find_lowest_voc(decoder, found_picture, - &found_picture); - if (found_index < 0 || found_picture->base.voc >= voc) - break; - success = dpb_output(decoder, priv->dpb[found_index]); - dpb_evict(decoder, found_picture, found_index); - if (!success) - return FALSE; - } + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiPictureH264 *found_picture; + gint found_index; + gboolean success; + + if (priv->max_views == 1) return TRUE; + + /* Emit all other view components that were in the same access + unit than the picture we have just found */ + found_picture = picture; + for (;;) { + found_index = dpb_find_lowest_voc (decoder, found_picture, &found_picture); + if (found_index < 0 || found_picture->base.voc >= voc) + break; + success = dpb_output (decoder, priv->dpb[found_index]); + dpb_evict (decoder, found_picture, found_index); + if (!success) + return FALSE; + } + return TRUE; } static gboolean -dpb_bump(GstVaapiDecoderH264 *decoder, GstVaapiPictureH264 *picture) +dpb_bump (GstVaapiDecoderH264 * decoder, GstVaapiPictureH264 * picture) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiPictureH264 *found_picture; - gint found_index; - gboolean success; - - found_index = dpb_find_lowest_poc(decoder, picture, &found_picture); - if (found_index < 0) - return FALSE; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiPictureH264 *found_picture; + gint found_index; + gboolean success; - if (picture && picture->base.poc != found_picture->base.poc) - dpb_output_other_views(decoder, found_picture, found_picture->base.voc); + found_index = dpb_find_lowest_poc (decoder, picture, &found_picture); + if (found_index < 0) + return FALSE; - success = dpb_output(decoder, priv->dpb[found_index]); - dpb_evict(decoder, found_picture, found_index); - if (priv->max_views == 1) - return success; + if (picture && picture->base.poc != found_picture->base.poc) + dpb_output_other_views (decoder, found_picture, found_picture->base.voc); - if (picture && picture->base.poc != found_picture->base.poc) - dpb_output_other_views(decoder, found_picture, G_MAXUINT32); + success = dpb_output (decoder, priv->dpb[found_index]); + dpb_evict (decoder, found_picture, found_index); + if (priv->max_views == 1) return success; + + if (picture && picture->base.poc != found_picture->base.poc) + dpb_output_other_views (decoder, found_picture, G_MAXUINT32); + return success; } static void -dpb_clear(GstVaapiDecoderH264 *decoder, GstVaapiPictureH264 *picture) +dpb_clear (GstVaapiDecoderH264 * decoder, GstVaapiPictureH264 * picture) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - guint i, n; - - for (i = 0; i < priv->dpb_count; i++) { - if (picture && picture->base.view_id != priv->dpb[i]->view_id) - continue; - gst_vaapi_frame_store_replace(&priv->dpb[i], NULL); - } - - /* Compact the resulting DPB, i.e. remove holes */ - for (i = 0, n = 0; i < priv->dpb_count; i++) { - if (priv->dpb[i]) { - if (i != n) { - priv->dpb[n] = priv->dpb[i]; - priv->dpb[i] = NULL; - } - n++; - } - } - priv->dpb_count = n; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + guint i, n; - /* Clear previous frame buffers only if this is a "flush-all" operation, - or if the picture is the first one in the access unit */ - if (priv->prev_frames && (!picture || - GST_VAAPI_PICTURE_FLAG_IS_SET(picture, - GST_VAAPI_PICTURE_FLAG_AU_START))) { - for (i = 0; i < priv->max_views; i++) - gst_vaapi_frame_store_replace(&priv->prev_frames[i], NULL); - } - - /* Clear previous reference frame buffers only if this is a "flush-all" - operation, or if the picture is part of an IDR NAL */ - if (priv->prev_ref_frames && (!picture || - GST_VAAPI_PICTURE_FLAG_IS_SET(picture, - GST_VAAPI_PICTURE_FLAG_IDR))) { - for (i = 0; i < priv->max_views; i++) - gst_vaapi_frame_store_replace(&priv->prev_ref_frames[i], NULL); - } + for (i = 0; i < priv->dpb_count; i++) { + if (picture && picture->base.view_id != priv->dpb[i]->view_id) + continue; + gst_vaapi_frame_store_replace (&priv->dpb[i], NULL); + } + + /* Compact the resulting DPB, i.e. remove holes */ + for (i = 0, n = 0; i < priv->dpb_count; i++) { + if (priv->dpb[i]) { + if (i != n) { + priv->dpb[n] = priv->dpb[i]; + priv->dpb[i] = NULL; + } + n++; + } + } + priv->dpb_count = n; + + /* Clear previous frame buffers only if this is a "flush-all" operation, + or if the picture is the first one in the access unit */ + if (priv->prev_frames && (!picture || + GST_VAAPI_PICTURE_FLAG_IS_SET (picture, + GST_VAAPI_PICTURE_FLAG_AU_START))) { + for (i = 0; i < priv->max_views; i++) + gst_vaapi_frame_store_replace (&priv->prev_frames[i], NULL); + } + + /* Clear previous reference frame buffers only if this is a "flush-all" + operation, or if the picture is part of an IDR NAL */ + if (priv->prev_ref_frames && (!picture || + GST_VAAPI_PICTURE_FLAG_IS_SET (picture, + GST_VAAPI_PICTURE_FLAG_IDR))) { + for (i = 0; i < priv->max_views; i++) + gst_vaapi_frame_store_replace (&priv->prev_ref_frames[i], NULL); + } } static void -dpb_flush(GstVaapiDecoderH264 *decoder, GstVaapiPictureH264 *picture) +dpb_flush (GstVaapiDecoderH264 * decoder, GstVaapiPictureH264 * picture) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - guint i; - - /* Detect broken frames and mark them as having a single field if - needed */ - for (i = 0; i < priv->dpb_count; i++) { - GstVaapiFrameStore * const fs = priv->dpb[i]; - if (!fs->output_needed || gst_vaapi_frame_store_is_complete(fs)) - continue; - GST_VAAPI_PICTURE_FLAG_SET(fs->buffers[0], - GST_VAAPI_PICTURE_FLAG_ONEFIELD); - } + GstVaapiDecoderH264Private *const priv = &decoder->priv; + guint i; - /* Output any frame remaining in DPB */ - while (dpb_bump(decoder, picture)) - ; - dpb_clear(decoder, picture); + /* Detect broken frames and mark them as having a single field if + needed */ + for (i = 0; i < priv->dpb_count; i++) { + GstVaapiFrameStore *const fs = priv->dpb[i]; + if (!fs->output_needed || gst_vaapi_frame_store_is_complete (fs)) + continue; + GST_VAAPI_PICTURE_FLAG_SET (fs->buffers[0], + GST_VAAPI_PICTURE_FLAG_ONEFIELD); + } + + /* Output any frame remaining in DPB */ + while (dpb_bump (decoder, picture)); + dpb_clear (decoder, picture); } static void -dpb_prune_mvc(GstVaapiDecoderH264 *decoder, GstVaapiPictureH264 *picture) +dpb_prune_mvc (GstVaapiDecoderH264 * decoder, GstVaapiPictureH264 * picture) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - const gboolean is_last_picture = /* in the access unit */ - GST_VAAPI_PICTURE_FLAG_IS_SET(picture, GST_VAAPI_PICTURE_FLAG_AU_END); - guint i; - - // Remove all unused inter-view only reference components of the current AU - i = 0; - while (i < priv->dpb_count) { - GstVaapiFrameStore * const fs = priv->dpb[i]; - if (fs->view_id != picture->base.view_id && - !fs->output_needed && !gst_vaapi_frame_store_has_reference(fs) && - (is_last_picture || - !is_inter_view_reference_for_next_frames(decoder, fs))) - dpb_remove_index(decoder, i); - else - i++; - } + GstVaapiDecoderH264Private *const priv = &decoder->priv; + const gboolean is_last_picture = /* in the access unit */ + GST_VAAPI_PICTURE_FLAG_IS_SET (picture, GST_VAAPI_PICTURE_FLAG_AU_END); + guint i; + + // Remove all unused inter-view only reference components of the current AU + i = 0; + while (i < priv->dpb_count) { + GstVaapiFrameStore *const fs = priv->dpb[i]; + if (fs->view_id != picture->base.view_id && + !fs->output_needed && !gst_vaapi_frame_store_has_reference (fs) && + (is_last_picture || + !is_inter_view_reference_for_next_frames (decoder, fs))) + dpb_remove_index (decoder, i); + else + i++; + } } static gboolean -dpb_add(GstVaapiDecoderH264 *decoder, GstVaapiPictureH264 *picture) +dpb_add (GstVaapiDecoderH264 * decoder, GstVaapiPictureH264 * picture) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiFrameStore *fs; - guint i; - - if (priv->max_views > 1) - dpb_prune_mvc(decoder, picture); - - // Remove all unused pictures - if (!GST_VAAPI_PICTURE_IS_IDR(picture)) { - i = 0; - while (i < priv->dpb_count) { - GstVaapiFrameStore * const fs = priv->dpb[i]; - if (fs->view_id == picture->base.view_id && - !fs->output_needed && !gst_vaapi_frame_store_has_reference(fs)) - dpb_remove_index(decoder, i); - else - i++; - } - } + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiFrameStore *fs; + guint i; - // Check if picture is the second field and the first field is still in DPB - if (GST_VAAPI_PICTURE_IS_INTERLACED(picture) && - !GST_VAAPI_PICTURE_IS_FIRST_FIELD(picture)) { - fs = priv->prev_frames[picture->base.voc]; - if (!fs || &fs->buffers[0]->base != picture->base.parent_picture) - return FALSE; - if (!gst_vaapi_frame_store_add(fs, picture)) - return FALSE; - - if (fs->output_called) - return dpb_output(decoder, fs); - return TRUE; - } + if (priv->max_views > 1) + dpb_prune_mvc (decoder, picture); - // Try to output the previous frame again if it was not submitted yet - // e.g. delayed while waiting for the next field, or a field gap was closed + // Remove all unused pictures + if (!GST_VAAPI_PICTURE_IS_IDR (picture)) { + i = 0; + while (i < priv->dpb_count) { + GstVaapiFrameStore *const fs = priv->dpb[i]; + if (fs->view_id == picture->base.view_id && + !fs->output_needed && !gst_vaapi_frame_store_has_reference (fs)) + dpb_remove_index (decoder, i); + else + i++; + } + } + // Check if picture is the second field and the first field is still in DPB + if (GST_VAAPI_PICTURE_IS_INTERLACED (picture) && + !GST_VAAPI_PICTURE_IS_FIRST_FIELD (picture)) { fs = priv->prev_frames[picture->base.voc]; - if (fs && fs->output_called) - dpb_output(decoder, fs); - - // Create new frame store, and split fields if necessary - fs = gst_vaapi_frame_store_new(picture); - if (!fs) - return FALSE; - gst_vaapi_frame_store_replace(&priv->prev_frames[picture->base.voc], fs); - gst_vaapi_frame_store_unref(fs); + if (!fs || &fs->buffers[0]->base != picture->base.parent_picture) + return FALSE; + if (!gst_vaapi_frame_store_add (fs, picture)) + return FALSE; - if (!priv->progressive_sequence && gst_vaapi_frame_store_has_frame(fs)) { - if (!gst_vaapi_frame_store_split_fields(fs, priv->top_field_first)) - return FALSE; - } + if (fs->output_called) + return dpb_output (decoder, fs); + return TRUE; + } + // Try to output the previous frame again if it was not submitted yet + // e.g. delayed while waiting for the next field, or a field gap was closed + fs = priv->prev_frames[picture->base.voc]; + if (fs && fs->output_called) + dpb_output (decoder, fs); + + // Create new frame store, and split fields if necessary + fs = gst_vaapi_frame_store_new (picture); + if (!fs) + return FALSE; + gst_vaapi_frame_store_replace (&priv->prev_frames[picture->base.voc], fs); + gst_vaapi_frame_store_unref (fs); - // C.4.5.1 - Storage and marking of a reference decoded picture into the DPB - if (GST_VAAPI_PICTURE_IS_REFERENCE(picture)) { - while (priv->dpb_count == priv->dpb_size) { - if (!dpb_bump(decoder, picture)) - return FALSE; - } - gst_vaapi_frame_store_replace(&priv->prev_ref_frames[picture->base.voc], - fs); + if (!priv->progressive_sequence && gst_vaapi_frame_store_has_frame (fs)) { + if (!gst_vaapi_frame_store_split_fields (fs, priv->top_field_first)) + return FALSE; + } + // C.4.5.1 - Storage and marking of a reference decoded picture into the DPB + if (GST_VAAPI_PICTURE_IS_REFERENCE (picture)) { + while (priv->dpb_count == priv->dpb_size) { + if (!dpb_bump (decoder, picture)) + return FALSE; } - - // C.4.5.2 - Storage and marking of a non-reference decoded picture into the DPB - else { - const gboolean StoreInterViewOnlyRefFlag = - !GST_VAAPI_PICTURE_FLAG_IS_SET(picture, - GST_VAAPI_PICTURE_FLAG_AU_END) && - GST_VAAPI_PICTURE_FLAG_IS_SET(picture, - GST_VAAPI_PICTURE_FLAG_INTER_VIEW); - if (!picture->output_flag && !StoreInterViewOnlyRefFlag) - return TRUE; - while (priv->dpb_count == priv->dpb_size) { - GstVaapiPictureH264 *found_picture; - if (!StoreInterViewOnlyRefFlag) { - if (dpb_find_lowest_poc(decoder, picture, &found_picture) < 0 || - found_picture->base.poc > picture->base.poc) - return dpb_output(decoder, fs); - } - if (!dpb_bump(decoder, picture)) - return FALSE; - } + gst_vaapi_frame_store_replace (&priv->prev_ref_frames[picture->base.voc], + fs); + } + // C.4.5.2 - Storage and marking of a non-reference decoded picture into the DPB + else { + const gboolean StoreInterViewOnlyRefFlag = + !GST_VAAPI_PICTURE_FLAG_IS_SET (picture, + GST_VAAPI_PICTURE_FLAG_AU_END) && + GST_VAAPI_PICTURE_FLAG_IS_SET (picture, + GST_VAAPI_PICTURE_FLAG_INTER_VIEW); + if (!picture->output_flag && !StoreInterViewOnlyRefFlag) + return TRUE; + while (priv->dpb_count == priv->dpb_size) { + GstVaapiPictureH264 *found_picture; + if (!StoreInterViewOnlyRefFlag) { + if (dpb_find_lowest_poc (decoder, picture, &found_picture) < 0 || + found_picture->base.poc > picture->base.poc) + return dpb_output (decoder, fs); + } + if (!dpb_bump (decoder, picture)) + return FALSE; } - gst_vaapi_frame_store_replace(&priv->dpb[priv->dpb_count++], fs); - return TRUE; + } + gst_vaapi_frame_store_replace (&priv->dpb[priv->dpb_count++], fs); + return TRUE; } static gboolean -dpb_reset(GstVaapiDecoderH264 *decoder, guint dpb_size) +dpb_reset (GstVaapiDecoderH264 * decoder, guint dpb_size) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; + GstVaapiDecoderH264Private *const priv = &decoder->priv; - if (dpb_size > priv->dpb_size_max) { - priv->dpb = g_try_realloc_n(priv->dpb, dpb_size, sizeof(*priv->dpb)); - if (!priv->dpb) - return FALSE; - memset(&priv->dpb[priv->dpb_size_max], 0, - (dpb_size - priv->dpb_size_max) * sizeof(*priv->dpb)); - priv->dpb_size_max = dpb_size; - } - priv->dpb_size = dpb_size; + if (dpb_size > priv->dpb_size_max) { + priv->dpb = g_try_realloc_n (priv->dpb, dpb_size, sizeof (*priv->dpb)); + if (!priv->dpb) + return FALSE; + memset (&priv->dpb[priv->dpb_size_max], 0, + (dpb_size - priv->dpb_size_max) * sizeof (*priv->dpb)); + priv->dpb_size_max = dpb_size; + } + priv->dpb_size = dpb_size; - GST_DEBUG("DPB size %u", priv->dpb_size); - return TRUE; + GST_DEBUG ("DPB size %u", priv->dpb_size); + return TRUE; } static void -unref_inter_view(GstVaapiPictureH264 *picture) +unref_inter_view (GstVaapiPictureH264 * picture) { - if (!picture) - return; - GST_VAAPI_PICTURE_FLAG_UNSET(picture, GST_VAAPI_PICTURE_FLAG_INTER_VIEW); - gst_vaapi_picture_unref(picture); + if (!picture) + return; + GST_VAAPI_PICTURE_FLAG_UNSET (picture, GST_VAAPI_PICTURE_FLAG_INTER_VIEW); + gst_vaapi_picture_unref (picture); } /* Resets MVC resources */ static gboolean -mvc_reset(GstVaapiDecoderH264 *decoder) +mvc_reset (GstVaapiDecoderH264 * decoder) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - guint i; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + guint i; - // Resize array of inter-view references - if (!priv->inter_views) { - priv->inter_views = g_ptr_array_new_full(priv->max_views, - (GDestroyNotify)unref_inter_view); - if (!priv->inter_views) - return FALSE; - } - - // Resize array of previous frame buffers - for (i = priv->max_views; i < priv->prev_frames_alloc; i++) { - gst_vaapi_frame_store_replace(&priv->prev_ref_frames[i], NULL); - gst_vaapi_frame_store_replace(&priv->prev_frames[i], NULL); - } - - priv->prev_ref_frames = g_try_realloc_n(priv->prev_ref_frames, - priv->max_views, sizeof(*priv->prev_ref_frames)); - if (!priv->prev_ref_frames) - goto error_allocate; - - priv->prev_frames = g_try_realloc_n(priv->prev_frames, priv->max_views, - sizeof(*priv->prev_frames)); - if (!priv->prev_frames) - goto error_allocate; - - for (i = priv->prev_frames_alloc; i < priv->max_views; i++) { - priv->prev_ref_frames[i] = NULL; - priv->prev_frames[i] = NULL; - } - priv->prev_frames_alloc = priv->max_views; - return TRUE; + // Resize array of inter-view references + if (!priv->inter_views) { + priv->inter_views = g_ptr_array_new_full (priv->max_views, + (GDestroyNotify) unref_inter_view); + if (!priv->inter_views) + return FALSE; + } + // Resize array of previous frame buffers + for (i = priv->max_views; i < priv->prev_frames_alloc; i++) { + gst_vaapi_frame_store_replace (&priv->prev_ref_frames[i], NULL); + gst_vaapi_frame_store_replace (&priv->prev_frames[i], NULL); + } + + priv->prev_ref_frames = g_try_realloc_n (priv->prev_ref_frames, + priv->max_views, sizeof (*priv->prev_ref_frames)); + if (!priv->prev_ref_frames) + goto error_allocate; + + priv->prev_frames = g_try_realloc_n (priv->prev_frames, priv->max_views, + sizeof (*priv->prev_frames)); + if (!priv->prev_frames) + goto error_allocate; + + for (i = priv->prev_frames_alloc; i < priv->max_views; i++) { + priv->prev_ref_frames[i] = NULL; + priv->prev_frames[i] = NULL; + } + priv->prev_frames_alloc = priv->max_views; + return TRUE; - /* ERRORS */ + /* ERRORS */ error_allocate: - g_free(priv->prev_ref_frames); - priv->prev_ref_frames = NULL; - g_free(priv->prev_frames); - priv->prev_frames = NULL; - priv->prev_frames_alloc = 0; - return FALSE; + g_free (priv->prev_ref_frames); + priv->prev_ref_frames = NULL; + g_free (priv->prev_frames); + priv->prev_frames = NULL; + priv->prev_frames_alloc = 0; + return FALSE; } static GstVaapiDecoderStatus -get_status(GstH264ParserResult result) +get_status (GstH264ParserResult result) { - GstVaapiDecoderStatus status; + GstVaapiDecoderStatus status; - switch (result) { + switch (result) { case GST_H264_PARSER_OK: - status = GST_VAAPI_DECODER_STATUS_SUCCESS; - break; + status = GST_VAAPI_DECODER_STATUS_SUCCESS; + break; case GST_H264_PARSER_NO_NAL_END: - status = GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - break; + status = GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + break; case GST_H264_PARSER_ERROR: - status = GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - break; + status = GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + break; default: - status = GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - break; - } - return status; + status = GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + break; + } + return status; } static void -gst_vaapi_decoder_h264_close(GstVaapiDecoderH264 *decoder) +gst_vaapi_decoder_h264_close (GstVaapiDecoderH264 * decoder) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; + GstVaapiDecoderH264Private *const priv = &decoder->priv; - gst_vaapi_picture_replace(&priv->current_picture, NULL); - gst_vaapi_picture_replace(&priv->missing_picture, NULL); - gst_vaapi_parser_info_h264_replace(&priv->prev_slice_pi, NULL); - gst_vaapi_parser_info_h264_replace(&priv->prev_pi, NULL); - - dpb_clear(decoder, NULL); - - if (priv->inter_views) { - g_ptr_array_unref(priv->inter_views); - priv->inter_views = NULL; - } - - if (priv->parser) { - gst_h264_nal_parser_free(priv->parser); - priv->parser = NULL; - } + gst_vaapi_picture_replace (&priv->current_picture, NULL); + gst_vaapi_picture_replace (&priv->missing_picture, NULL); + gst_vaapi_parser_info_h264_replace (&priv->prev_slice_pi, NULL); + gst_vaapi_parser_info_h264_replace (&priv->prev_pi, NULL); + + dpb_clear (decoder, NULL); + + if (priv->inter_views) { + g_ptr_array_unref (priv->inter_views); + priv->inter_views = NULL; + } + + if (priv->parser) { + gst_h264_nal_parser_free (priv->parser); + priv->parser = NULL; + } } static gboolean -gst_vaapi_decoder_h264_open(GstVaapiDecoderH264 *decoder) +gst_vaapi_decoder_h264_open (GstVaapiDecoderH264 * decoder) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; + GstVaapiDecoderH264Private *const priv = &decoder->priv; - gst_vaapi_decoder_h264_close(decoder); + gst_vaapi_decoder_h264_close (decoder); - priv->parser = gst_h264_nal_parser_new(); - if (!priv->parser) - return FALSE; - return TRUE; + priv->parser = gst_h264_nal_parser_new (); + if (!priv->parser) + return FALSE; + return TRUE; } static void -gst_vaapi_decoder_h264_destroy(GstVaapiDecoder *base_decoder) +gst_vaapi_decoder_h264_destroy (GstVaapiDecoder * base_decoder) { - GstVaapiDecoderH264 * const decoder = - GST_VAAPI_DECODER_H264_CAST(base_decoder); - GstVaapiDecoderH264Private * const priv = &decoder->priv; - guint i; - - gst_vaapi_decoder_h264_close(decoder); - - g_free(priv->dpb); - priv->dpb = NULL; - priv->dpb_size = 0; - - g_free(priv->prev_ref_frames); - priv->prev_ref_frames = NULL; - g_free(priv->prev_frames); - priv->prev_frames = NULL; - priv->prev_frames_alloc = 0; - - for (i = 0; i < G_N_ELEMENTS(priv->pps); i++) - gst_vaapi_parser_info_h264_replace(&priv->pps[i], NULL); - gst_vaapi_parser_info_h264_replace(&priv->active_pps, NULL); - - for (i = 0; i < G_N_ELEMENTS(priv->sps); i++) - gst_vaapi_parser_info_h264_replace(&priv->sps[i], NULL); - gst_vaapi_parser_info_h264_replace(&priv->active_sps, NULL); + GstVaapiDecoderH264 *const decoder = + GST_VAAPI_DECODER_H264_CAST (base_decoder); + GstVaapiDecoderH264Private *const priv = &decoder->priv; + guint i; + + gst_vaapi_decoder_h264_close (decoder); + + g_free (priv->dpb); + priv->dpb = NULL; + priv->dpb_size = 0; + + g_free (priv->prev_ref_frames); + priv->prev_ref_frames = NULL; + g_free (priv->prev_frames); + priv->prev_frames = NULL; + priv->prev_frames_alloc = 0; + + for (i = 0; i < G_N_ELEMENTS (priv->pps); i++) + gst_vaapi_parser_info_h264_replace (&priv->pps[i], NULL); + gst_vaapi_parser_info_h264_replace (&priv->active_pps, NULL); + + for (i = 0; i < G_N_ELEMENTS (priv->sps); i++) + gst_vaapi_parser_info_h264_replace (&priv->sps[i], NULL); + gst_vaapi_parser_info_h264_replace (&priv->active_sps, NULL); } static gboolean -gst_vaapi_decoder_h264_create(GstVaapiDecoder *base_decoder) +gst_vaapi_decoder_h264_create (GstVaapiDecoder * base_decoder) { - GstVaapiDecoderH264 * const decoder = - GST_VAAPI_DECODER_H264_CAST(base_decoder); - GstVaapiDecoderH264Private * const priv = &decoder->priv; - - priv->profile = GST_VAAPI_PROFILE_UNKNOWN; - priv->entrypoint = GST_VAAPI_ENTRYPOINT_VLD; - priv->chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420; - priv->prev_pic_structure = GST_VAAPI_PICTURE_STRUCTURE_FRAME; - priv->progressive_sequence = TRUE; - priv->top_field_first = FALSE; - return TRUE; + GstVaapiDecoderH264 *const decoder = + GST_VAAPI_DECODER_H264_CAST (base_decoder); + GstVaapiDecoderH264Private *const priv = &decoder->priv; + + priv->profile = GST_VAAPI_PROFILE_UNKNOWN; + priv->entrypoint = GST_VAAPI_ENTRYPOINT_VLD; + priv->chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420; + priv->prev_pic_structure = GST_VAAPI_PICTURE_STRUCTURE_FRAME; + priv->progressive_sequence = TRUE; + priv->top_field_first = FALSE; + return TRUE; } /* Activates the supplied PPS */ static GstH264PPS * -ensure_pps(GstVaapiDecoderH264 *decoder, GstH264PPS *pps) +ensure_pps (GstVaapiDecoderH264 * decoder, GstH264PPS * pps) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiParserInfoH264 * const pi = priv->pps[pps->id]; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiParserInfoH264 *const pi = priv->pps[pps->id]; - gst_vaapi_parser_info_h264_replace(&priv->active_pps, pi); - return pi ? &pi->data.pps : NULL; + gst_vaapi_parser_info_h264_replace (&priv->active_pps, pi); + return pi ? &pi->data.pps : NULL; } /* Returns the active PPS */ static inline GstH264PPS * -get_pps(GstVaapiDecoderH264 *decoder) +get_pps (GstVaapiDecoderH264 * decoder) { - GstVaapiParserInfoH264 * const pi = decoder->priv.active_pps; + GstVaapiParserInfoH264 *const pi = decoder->priv.active_pps; - return pi ? &pi->data.pps : NULL; + return pi ? &pi->data.pps : NULL; } /* Activate the supplied SPS */ static GstH264SPS * -ensure_sps(GstVaapiDecoderH264 *decoder, GstH264SPS *sps) +ensure_sps (GstVaapiDecoderH264 * decoder, GstH264SPS * sps) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiParserInfoH264 * const pi = priv->sps[sps->id]; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiParserInfoH264 *const pi = priv->sps[sps->id]; - /* Propagate "got I-frame" state to the next SPS unit if the - current sequence was not ended */ - if (pi && priv->active_sps) - pi->state |= (priv->active_sps->state & - GST_H264_VIDEO_STATE_GOT_I_FRAME); + /* Propagate "got I-frame" state to the next SPS unit if the + current sequence was not ended */ + if (pi && priv->active_sps) + pi->state |= (priv->active_sps->state & GST_H264_VIDEO_STATE_GOT_I_FRAME); - gst_vaapi_parser_info_h264_replace(&priv->active_sps, pi); - return pi ? &pi->data.sps : NULL; + gst_vaapi_parser_info_h264_replace (&priv->active_sps, pi); + return pi ? &pi->data.sps : NULL; } /* Returns the active SPS */ static inline GstH264SPS * -get_sps(GstVaapiDecoderH264 *decoder) +get_sps (GstVaapiDecoderH264 * decoder) { - GstVaapiParserInfoH264 * const pi = decoder->priv.active_sps; + GstVaapiParserInfoH264 *const pi = decoder->priv.active_sps; - return pi ? &pi->data.sps : NULL; + return pi ? &pi->data.sps : NULL; } static void -fill_profiles(GstVaapiProfile profiles[16], guint *n_profiles_ptr, +fill_profiles (GstVaapiProfile profiles[16], guint * n_profiles_ptr, GstVaapiProfile profile) { - guint n_profiles = *n_profiles_ptr; + guint n_profiles = *n_profiles_ptr; - profiles[n_profiles++] = profile; - switch (profile) { + profiles[n_profiles++] = profile; + switch (profile) { case GST_VAAPI_PROFILE_H264_MAIN: - profiles[n_profiles++] = GST_VAAPI_PROFILE_H264_HIGH; - break; + profiles[n_profiles++] = GST_VAAPI_PROFILE_H264_HIGH; + break; default: - break; - } - *n_profiles_ptr = n_profiles; + break; + } + *n_profiles_ptr = n_profiles; } /* Fills in compatible profiles for MVC decoding */ static void -fill_profiles_mvc(GstVaapiDecoderH264 *decoder, GstVaapiProfile profiles[16], - guint *n_profiles_ptr, guint dpb_size) +fill_profiles_mvc (GstVaapiDecoderH264 * decoder, GstVaapiProfile profiles[16], + guint * n_profiles_ptr, guint dpb_size) { - const gchar * const vendor_string = - gst_vaapi_display_get_vendor_string(GST_VAAPI_DECODER_DISPLAY(decoder)); + const gchar *const vendor_string = + gst_vaapi_display_get_vendor_string (GST_VAAPI_DECODER_DISPLAY (decoder)); - gboolean add_high_profile = FALSE; - struct map { - const gchar *str; - guint str_len; + gboolean add_high_profile = FALSE; + struct map + { + const gchar *str; + guint str_len; + }; + const struct map *m; + + // Drivers that support slice level decoding + if (vendor_string && dpb_size <= 16) { + static const struct map drv_names[] = { + {"Intel i965 driver", 17}, + {NULL, 0} }; - const struct map *m; - - // Drivers that support slice level decoding - if (vendor_string && dpb_size <= 16) { - static const struct map drv_names[] = { - { "Intel i965 driver", 17 }, - { NULL, 0 } - }; - for (m = drv_names; m->str != NULL && !add_high_profile; m++) { - if (g_ascii_strncasecmp(vendor_string, m->str, m->str_len) == 0) - add_high_profile = TRUE; - } + for (m = drv_names; m->str != NULL && !add_high_profile; m++) { + if (g_ascii_strncasecmp (vendor_string, m->str, m->str_len) == 0) + add_high_profile = TRUE; } + } - if (add_high_profile) - fill_profiles(profiles, n_profiles_ptr, GST_VAAPI_PROFILE_H264_HIGH); + if (add_high_profile) + fill_profiles (profiles, n_profiles_ptr, GST_VAAPI_PROFILE_H264_HIGH); } static GstVaapiProfile -get_profile(GstVaapiDecoderH264 *decoder, GstH264SPS *sps, guint dpb_size) +get_profile (GstVaapiDecoderH264 * decoder, GstH264SPS * sps, guint dpb_size) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiDisplay * const display = GST_VAAPI_DECODER_DISPLAY(decoder); - GstVaapiProfile profile, profiles[4]; - guint i, n_profiles = 0; - - profile = gst_vaapi_utils_h264_get_profile(sps->profile_idc); - if (!profile) - return GST_VAAPI_PROFILE_UNKNOWN; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiDisplay *const display = GST_VAAPI_DECODER_DISPLAY (decoder); + GstVaapiProfile profile, profiles[4]; + guint i, n_profiles = 0; + + profile = gst_vaapi_utils_h264_get_profile (sps->profile_idc); + if (!profile) + return GST_VAAPI_PROFILE_UNKNOWN; - fill_profiles(profiles, &n_profiles, profile); - switch (profile) { + fill_profiles (profiles, &n_profiles, profile); + switch (profile) { case GST_VAAPI_PROFILE_H264_BASELINE: - if (sps->constraint_set1_flag) { // A.2.2 (main profile) - fill_profiles(profiles, &n_profiles, - GST_VAAPI_PROFILE_H264_CONSTRAINED_BASELINE); - fill_profiles(profiles, &n_profiles, - GST_VAAPI_PROFILE_H264_MAIN); - } - break; + if (sps->constraint_set1_flag) { // A.2.2 (main profile) + fill_profiles (profiles, &n_profiles, + GST_VAAPI_PROFILE_H264_CONSTRAINED_BASELINE); + fill_profiles (profiles, &n_profiles, GST_VAAPI_PROFILE_H264_MAIN); + } + break; case GST_VAAPI_PROFILE_H264_EXTENDED: - if (sps->constraint_set1_flag) { // A.2.2 (main profile) - fill_profiles(profiles, &n_profiles, - GST_VAAPI_PROFILE_H264_MAIN); - } - break; + if (sps->constraint_set1_flag) { // A.2.2 (main profile) + fill_profiles (profiles, &n_profiles, GST_VAAPI_PROFILE_H264_MAIN); + } + break; case GST_VAAPI_PROFILE_H264_MULTIVIEW_HIGH: - if (priv->max_views == 2) { - fill_profiles(profiles, &n_profiles, - GST_VAAPI_PROFILE_H264_STEREO_HIGH); - } - fill_profiles_mvc(decoder, profiles, &n_profiles, dpb_size); - break; + if (priv->max_views == 2) { + fill_profiles (profiles, &n_profiles, + GST_VAAPI_PROFILE_H264_STEREO_HIGH); + } + fill_profiles_mvc (decoder, profiles, &n_profiles, dpb_size); + break; case GST_VAAPI_PROFILE_H264_STEREO_HIGH: - if (sps->frame_mbs_only_flag) { - fill_profiles(profiles, &n_profiles, - GST_VAAPI_PROFILE_H264_MULTIVIEW_HIGH); - } - fill_profiles_mvc(decoder, profiles, &n_profiles, dpb_size); - break; + if (sps->frame_mbs_only_flag) { + fill_profiles (profiles, &n_profiles, + GST_VAAPI_PROFILE_H264_MULTIVIEW_HIGH); + } + fill_profiles_mvc (decoder, profiles, &n_profiles, dpb_size); + break; default: - break; - } + break; + } - /* If the preferred profile (profiles[0]) matches one that we already - found, then just return it now instead of searching for it again */ - if (profiles[0] == priv->profile) - return priv->profile; - - for (i = 0; i < n_profiles; i++) { - if (gst_vaapi_display_has_decoder(display, profiles[i], priv->entrypoint)) - return profiles[i]; - } - return GST_VAAPI_PROFILE_UNKNOWN; + /* If the preferred profile (profiles[0]) matches one that we already + found, then just return it now instead of searching for it again */ + if (profiles[0] == priv->profile) + return priv->profile; + + for (i = 0; i < n_profiles; i++) { + if (gst_vaapi_display_has_decoder (display, profiles[i], priv->entrypoint)) + return profiles[i]; + } + return GST_VAAPI_PROFILE_UNKNOWN; } static GstVaapiDecoderStatus -ensure_context(GstVaapiDecoderH264 *decoder, GstH264SPS *sps) +ensure_context (GstVaapiDecoderH264 * decoder, GstH264SPS * sps) { - GstVaapiDecoder * const base_decoder = GST_VAAPI_DECODER_CAST(decoder); - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiContextInfo info; - GstVaapiProfile profile; - GstVaapiChromaType chroma_type; - gboolean reset_context = FALSE; - guint mb_width, mb_height, dpb_size, num_views; - - num_views = get_num_views(sps); - if (priv->max_views < num_views) { - priv->max_views = num_views; - GST_DEBUG("maximum number of views changed to %u", num_views); - } - - dpb_size = get_max_dec_frame_buffering(sps); - if (priv->dpb_size < dpb_size) { - GST_DEBUG("DPB size increased"); - reset_context = TRUE; - } - - profile = get_profile(decoder, sps, dpb_size); - if (!profile) { - GST_ERROR("unsupported profile_idc %u", sps->profile_idc); - return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; - } - - if (!priv->profile || (priv->profile != profile && priv->max_views == 1)) { - GST_DEBUG("profile changed to %x", profile); - reset_context = TRUE; - priv->profile = profile; - } - -#if GST_CHECK_VERSION(1,5,0) - /* Multiview flags only available in >= 1.5 */ - if (reset_context) { - switch (num_views) { - case 1: - /* Frame-packed mode details should be copied from the parser - * if we set NONE */ - gst_vaapi_decoder_set_multiview_mode (base_decoder, - num_views, GST_VIDEO_MULTIVIEW_MODE_NONE, - GST_VIDEO_MULTIVIEW_FLAGS_NONE); - break; - case 2: /* Assume stereo */ - if (profile == GST_VAAPI_PROFILE_H264_STEREO_HIGH) { - GST_DEBUG ("Stereo profile - frame-by-frame output, %d views", num_views); - gst_vaapi_decoder_set_multiview_mode (base_decoder, - num_views, GST_VIDEO_MULTIVIEW_MODE_FRAME_BY_FRAME, - GST_VIDEO_MULTIVIEW_FLAGS_NONE); - break; - } - /* non-stereo 2 views. Fall through */ - default: - GST_DEBUG ("Multiview profile - frame-by-frame output, %d views", num_views); - gst_vaapi_decoder_set_multiview_mode (base_decoder, - num_views, GST_VIDEO_MULTIVIEW_MODE_MULTIVIEW_FRAME_BY_FRAME, - GST_VIDEO_MULTIVIEW_FLAGS_NONE); - break; - } - } -#endif + GstVaapiDecoder *const base_decoder = GST_VAAPI_DECODER_CAST (decoder); + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiContextInfo info; + GstVaapiProfile profile; + GstVaapiChromaType chroma_type; + gboolean reset_context = FALSE; + guint mb_width, mb_height, dpb_size, num_views; + + num_views = get_num_views (sps); + if (priv->max_views < num_views) { + priv->max_views = num_views; + GST_DEBUG ("maximum number of views changed to %u", num_views); + } + + dpb_size = get_max_dec_frame_buffering (sps); + if (priv->dpb_size < dpb_size) { + GST_DEBUG ("DPB size increased"); + reset_context = TRUE; + } + + profile = get_profile (decoder, sps, dpb_size); + if (!profile) { + GST_ERROR ("unsupported profile_idc %u", sps->profile_idc); + return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; + } + + if (!priv->profile || (priv->profile != profile && priv->max_views == 1)) { + GST_DEBUG ("profile changed to %x", profile); + reset_context = TRUE; + priv->profile = profile; + } + + if (reset_context) { + switch (num_views) { + case 1: + /* Frame-packed mode details should be copied from the parser + * if we set NONE */ + gst_vaapi_decoder_set_multiview_mode (base_decoder, + num_views, GST_VIDEO_MULTIVIEW_MODE_NONE, + GST_VIDEO_MULTIVIEW_FLAGS_NONE); + break; + case 2: /* Assume stereo */ + if (profile == GST_VAAPI_PROFILE_H264_STEREO_HIGH) { + GST_DEBUG ("Stereo profile - frame-by-frame output, %d views", + num_views); + gst_vaapi_decoder_set_multiview_mode (base_decoder, num_views, + GST_VIDEO_MULTIVIEW_MODE_FRAME_BY_FRAME, + GST_VIDEO_MULTIVIEW_FLAGS_NONE); + break; + } + /* non-stereo 2 views. Fall through */ + default: + GST_DEBUG ("Multiview profile - frame-by-frame output, %d views", + num_views); + gst_vaapi_decoder_set_multiview_mode (base_decoder, num_views, + GST_VIDEO_MULTIVIEW_MODE_MULTIVIEW_FRAME_BY_FRAME, + GST_VIDEO_MULTIVIEW_FLAGS_NONE); + break; + } + } + + chroma_type = gst_vaapi_utils_h264_get_chroma_type (sps->chroma_format_idc); + if (!chroma_type) { + GST_ERROR ("unsupported chroma_format_idc %u", sps->chroma_format_idc); + return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT; + } + + if (priv->chroma_type != chroma_type) { + GST_DEBUG ("chroma format changed"); + reset_context = TRUE; + priv->chroma_type = chroma_type; + } + + mb_width = sps->pic_width_in_mbs_minus1 + 1; + mb_height = (sps->pic_height_in_map_units_minus1 + 1) << + !sps->frame_mbs_only_flag; + if (priv->mb_width != mb_width || priv->mb_height != mb_height) { + GST_DEBUG ("size changed"); + reset_context = TRUE; + priv->mb_width = mb_width; + priv->mb_height = mb_height; + } + + if (priv->progressive_sequence != sps->frame_mbs_only_flag) { + GST_DEBUG ("interlacing-mode changed"); + priv->progressive_sequence = sps->frame_mbs_only_flag; + gst_vaapi_decoder_set_interlaced (base_decoder, + !priv->progressive_sequence); + priv->top_field_first = FALSE; + } + + gst_vaapi_decoder_set_pixel_aspect_ratio (base_decoder, + sps->vui_parameters.par_n, sps->vui_parameters.par_d); - chroma_type = gst_vaapi_utils_h264_get_chroma_type(sps->chroma_format_idc); - if (!chroma_type) { - GST_ERROR("unsupported chroma_format_idc %u", sps->chroma_format_idc); - return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT; - } - - if (priv->chroma_type != chroma_type) { - GST_DEBUG("chroma format changed"); - reset_context = TRUE; - priv->chroma_type = chroma_type; - } - - mb_width = sps->pic_width_in_mbs_minus1 + 1; - mb_height = (sps->pic_height_in_map_units_minus1 + 1) << - !sps->frame_mbs_only_flag; - if (priv->mb_width != mb_width || priv->mb_height != mb_height) { - GST_DEBUG("size changed"); - reset_context = TRUE; - priv->mb_width = mb_width; - priv->mb_height = mb_height; - } - - if (priv->progressive_sequence != sps->frame_mbs_only_flag) { - GST_DEBUG("interlacing-mode changed"); - priv->progressive_sequence = sps->frame_mbs_only_flag; - gst_vaapi_decoder_set_interlaced(base_decoder, - !priv->progressive_sequence); - priv->top_field_first = FALSE; - } - - gst_vaapi_decoder_set_pixel_aspect_ratio( - base_decoder, - sps->vui_parameters.par_n, - sps->vui_parameters.par_d - ); - - if (!reset_context && priv->has_context) - return GST_VAAPI_DECODER_STATUS_SUCCESS; - - /* XXX: fix surface size when cropping is implemented */ - info.profile = priv->profile; - info.entrypoint = priv->entrypoint; - info.chroma_type = priv->chroma_type; - info.width = sps->width; - info.height = sps->height; - info.ref_frames = dpb_size; - - if (!gst_vaapi_decoder_ensure_context(GST_VAAPI_DECODER(decoder), &info)) - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - priv->has_context = TRUE; - - /* Reset DPB */ - if (!dpb_reset(decoder, dpb_size)) - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - - /* Reset MVC data */ - if (!mvc_reset(decoder)) - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + if (!reset_context && priv->has_context) return GST_VAAPI_DECODER_STATUS_SUCCESS; + + /* XXX: fix surface size when cropping is implemented */ + info.profile = priv->profile; + info.entrypoint = priv->entrypoint; + info.chroma_type = priv->chroma_type; + info.width = sps->width; + info.height = sps->height; + info.ref_frames = dpb_size; + + if (!gst_vaapi_decoder_ensure_context (GST_VAAPI_DECODER (decoder), &info)) + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + priv->has_context = TRUE; + + /* Reset DPB */ + if (!dpb_reset (decoder, dpb_size)) + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + + /* Reset MVC data */ + if (!mvc_reset (decoder)) + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static void -fill_iq_matrix_4x4(VAIQMatrixBufferH264 *iq_matrix, const GstH264PPS *pps, - const GstH264SPS *sps) +fill_iq_matrix_4x4 (VAIQMatrixBufferH264 * iq_matrix, const GstH264PPS * pps, + const GstH264SPS * sps) { - guint i; + guint i; - /* There are always 6 4x4 scaling lists */ - g_assert(G_N_ELEMENTS(iq_matrix->ScalingList4x4) == 6); - g_assert(G_N_ELEMENTS(iq_matrix->ScalingList4x4[0]) == 16); - - for (i = 0; i < G_N_ELEMENTS(iq_matrix->ScalingList4x4); i++) - gst_h264_quant_matrix_4x4_get_raster_from_zigzag( - iq_matrix->ScalingList4x4[i], pps->scaling_lists_4x4[i]); + /* There are always 6 4x4 scaling lists */ + g_assert (G_N_ELEMENTS (iq_matrix->ScalingList4x4) == 6); + g_assert (G_N_ELEMENTS (iq_matrix->ScalingList4x4[0]) == 16); + + for (i = 0; i < G_N_ELEMENTS (iq_matrix->ScalingList4x4); i++) + gst_h264_quant_matrix_4x4_get_raster_from_zigzag (iq_matrix->ScalingList4x4 + [i], pps->scaling_lists_4x4[i]); } static void -fill_iq_matrix_8x8(VAIQMatrixBufferH264 *iq_matrix, const GstH264PPS *pps, - const GstH264SPS *sps) +fill_iq_matrix_8x8 (VAIQMatrixBufferH264 * iq_matrix, const GstH264PPS * pps, + const GstH264SPS * sps) { - guint i, n; + guint i, n; - /* If chroma_format_idc != 3, there are up to 2 8x8 scaling lists */ - if (!pps->transform_8x8_mode_flag) - return; - - g_assert(G_N_ELEMENTS(iq_matrix->ScalingList8x8) >= 2); - g_assert(G_N_ELEMENTS(iq_matrix->ScalingList8x8[0]) == 64); - - n = (sps->chroma_format_idc != 3) ? 2 : 6; - for (i = 0; i < n; i++) { - gst_h264_quant_matrix_8x8_get_raster_from_zigzag( - iq_matrix->ScalingList8x8[i], pps->scaling_lists_8x8[i]); - } + /* If chroma_format_idc != 3, there are up to 2 8x8 scaling lists */ + if (!pps->transform_8x8_mode_flag) + return; + + g_assert (G_N_ELEMENTS (iq_matrix->ScalingList8x8) >= 2); + g_assert (G_N_ELEMENTS (iq_matrix->ScalingList8x8[0]) == 64); + + n = (sps->chroma_format_idc != 3) ? 2 : 6; + for (i = 0; i < n; i++) { + gst_h264_quant_matrix_8x8_get_raster_from_zigzag (iq_matrix->ScalingList8x8 + [i], pps->scaling_lists_8x8[i]); + } } static GstVaapiDecoderStatus -ensure_quant_matrix(GstVaapiDecoderH264 *decoder, GstVaapiPictureH264 *picture) +ensure_quant_matrix (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture) { - GstVaapiPicture * const base_picture = &picture->base; - GstH264PPS * const pps = get_pps(decoder); - GstH264SPS * const sps = get_sps(decoder); - VAIQMatrixBufferH264 *iq_matrix; - - base_picture->iq_matrix = GST_VAAPI_IQ_MATRIX_NEW(H264, decoder); - if (!base_picture->iq_matrix) { - GST_ERROR("failed to allocate IQ matrix"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } - iq_matrix = base_picture->iq_matrix->param; - - /* XXX: we can only support 4:2:0 or 4:2:2 since ScalingLists8x8[] - is not large enough to hold lists for 4:4:4 */ - if (sps->chroma_format_idc == 3) - return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT; + GstVaapiPicture *const base_picture = &picture->base; + GstH264PPS *const pps = get_pps (decoder); + GstH264SPS *const sps = get_sps (decoder); + VAIQMatrixBufferH264 *iq_matrix; + + base_picture->iq_matrix = GST_VAAPI_IQ_MATRIX_NEW (H264, decoder); + if (!base_picture->iq_matrix) { + GST_ERROR ("failed to allocate IQ matrix"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } + iq_matrix = base_picture->iq_matrix->param; + + /* XXX: we can only support 4:2:0 or 4:2:2 since ScalingLists8x8[] + is not large enough to hold lists for 4:4:4 */ + if (sps->chroma_format_idc == 3) + return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT; - fill_iq_matrix_4x4(iq_matrix, pps, sps); - fill_iq_matrix_8x8(iq_matrix, pps, sps); + fill_iq_matrix_4x4 (iq_matrix, pps, sps); + fill_iq_matrix_8x8 (iq_matrix, pps, sps); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static inline gboolean -is_valid_state(guint state, guint ref_state) +is_valid_state (guint state, guint ref_state) { - return (state & ref_state) == ref_state; + return (state & ref_state) == ref_state; } static GstVaapiDecoderStatus -decode_current_picture(GstVaapiDecoderH264 *decoder) +decode_current_picture (GstVaapiDecoderH264 * decoder) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiParserInfoH264 * const sps_pi = decoder->priv.active_sps; - GstVaapiPictureH264 * const picture = priv->current_picture; - - if (!is_valid_state(priv->decoder_state, - GST_H264_VIDEO_STATE_VALID_PICTURE)) - goto drop_frame; - - priv->decoder_state |= sps_pi->state; - if (!(priv->decoder_state & GST_H264_VIDEO_STATE_GOT_I_FRAME)) { - if (priv->decoder_state & GST_H264_VIDEO_STATE_GOT_P_SLICE) - goto drop_frame; - sps_pi->state |= GST_H264_VIDEO_STATE_GOT_I_FRAME; - } - - priv->decoder_state = 0; - priv->pic_structure = GST_H264_SEI_PIC_STRUCT_FRAME; - - if (!picture) - return GST_VAAPI_DECODER_STATUS_SUCCESS; - - if (!gst_vaapi_picture_decode(GST_VAAPI_PICTURE_CAST(picture))) - goto error; - if (!exec_ref_pic_marking(decoder, picture)) - goto error; - if (!dpb_add(decoder, picture)) - goto error; - gst_vaapi_picture_replace(&priv->current_picture, NULL); + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiParserInfoH264 *const sps_pi = decoder->priv.active_sps; + GstVaapiPictureH264 *const picture = priv->current_picture; + + if (!is_valid_state (priv->decoder_state, GST_H264_VIDEO_STATE_VALID_PICTURE)) + goto drop_frame; + + priv->decoder_state |= sps_pi->state; + if (!(priv->decoder_state & GST_H264_VIDEO_STATE_GOT_I_FRAME)) { + if (priv->decoder_state & GST_H264_VIDEO_STATE_GOT_P_SLICE) + goto drop_frame; + sps_pi->state |= GST_H264_VIDEO_STATE_GOT_I_FRAME; + } + + priv->decoder_state = 0; + priv->pic_structure = GST_H264_SEI_PIC_STRUCT_FRAME; + + if (!picture) return GST_VAAPI_DECODER_STATUS_SUCCESS; + if (!gst_vaapi_picture_decode (GST_VAAPI_PICTURE_CAST (picture))) + goto error; + if (!exec_ref_pic_marking (decoder, picture)) + goto error; + if (!dpb_add (decoder, picture)) + goto error; + gst_vaapi_picture_replace (&priv->current_picture, NULL); + return GST_VAAPI_DECODER_STATUS_SUCCESS; + error: - /* XXX: fix for cases where first field failed to be decoded */ - gst_vaapi_picture_replace(&priv->current_picture, NULL); - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + /* XXX: fix for cases where first field failed to be decoded */ + gst_vaapi_picture_replace (&priv->current_picture, NULL); + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; drop_frame: - priv->decoder_state = 0; - priv->pic_structure = GST_H264_SEI_PIC_STRUCT_FRAME; - return (GstVaapiDecoderStatus) GST_VAAPI_DECODER_STATUS_DROP_FRAME; + priv->decoder_state = 0; + priv->pic_structure = GST_H264_SEI_PIC_STRUCT_FRAME; + return (GstVaapiDecoderStatus) GST_VAAPI_DECODER_STATUS_DROP_FRAME; } static GstVaapiDecoderStatus -parse_sps(GstVaapiDecoderH264 *decoder, GstVaapiDecoderUnit *unit) +parse_sps (GstVaapiDecoderH264 * decoder, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiParserInfoH264 * const pi = unit->parsed_info; - GstH264SPS * const sps = &pi->data.sps; - GstH264ParserResult result; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiParserInfoH264 *const pi = unit->parsed_info; + GstH264SPS *const sps = &pi->data.sps; + GstH264ParserResult result; - GST_DEBUG("parse SPS"); + GST_DEBUG ("parse SPS"); - priv->parser_state = 0; + priv->parser_state = 0; - /* Variables that don't have inferred values per the H.264 - standard but that should get a default value anyway */ - sps->log2_max_pic_order_cnt_lsb_minus4 = 0; + /* Variables that don't have inferred values per the H.264 + standard but that should get a default value anyway */ + sps->log2_max_pic_order_cnt_lsb_minus4 = 0; - result = gst_h264_parser_parse_sps(priv->parser, &pi->nalu, sps, TRUE); - if (result != GST_H264_PARSER_OK) - return get_status(result); + result = gst_h264_parser_parse_sps (priv->parser, &pi->nalu, sps, TRUE); + if (result != GST_H264_PARSER_OK) + return get_status (result); - priv->parser_state |= GST_H264_VIDEO_STATE_GOT_SPS; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + priv->parser_state |= GST_H264_VIDEO_STATE_GOT_SPS; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -parse_subset_sps(GstVaapiDecoderH264 *decoder, GstVaapiDecoderUnit *unit) +parse_subset_sps (GstVaapiDecoderH264 * decoder, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiParserInfoH264 * const pi = unit->parsed_info; - GstH264SPS * const sps = &pi->data.sps; - GstH264ParserResult result; - - GST_DEBUG("parse subset SPS"); + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiParserInfoH264 *const pi = unit->parsed_info; + GstH264SPS *const sps = &pi->data.sps; + GstH264ParserResult result; + + GST_DEBUG ("parse subset SPS"); + + /* Variables that don't have inferred values per the H.264 + standard but that should get a default value anyway */ + sps->log2_max_pic_order_cnt_lsb_minus4 = 0; + + result = gst_h264_parser_parse_subset_sps (priv->parser, &pi->nalu, sps, + TRUE); + if (result != GST_H264_PARSER_OK) + return get_status (result); - /* Variables that don't have inferred values per the H.264 - standard but that should get a default value anyway */ - sps->log2_max_pic_order_cnt_lsb_minus4 = 0; - - result = gst_h264_parser_parse_subset_sps(priv->parser, &pi->nalu, sps, - TRUE); - if (result != GST_H264_PARSER_OK) - return get_status(result); - - priv->parser_state |= GST_H264_VIDEO_STATE_GOT_SPS; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + priv->parser_state |= GST_H264_VIDEO_STATE_GOT_SPS; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -parse_pps(GstVaapiDecoderH264 *decoder, GstVaapiDecoderUnit *unit) +parse_pps (GstVaapiDecoderH264 * decoder, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiParserInfoH264 * const pi = unit->parsed_info; - GstH264PPS * const pps = &pi->data.pps; - GstH264ParserResult result; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiParserInfoH264 *const pi = unit->parsed_info; + GstH264PPS *const pps = &pi->data.pps; + GstH264ParserResult result; - GST_DEBUG("parse PPS"); + GST_DEBUG ("parse PPS"); - priv->parser_state &= GST_H264_VIDEO_STATE_GOT_SPS; + priv->parser_state &= GST_H264_VIDEO_STATE_GOT_SPS; - /* Variables that don't have inferred values per the H.264 - standard but that should get a default value anyway */ - pps->slice_group_map_type = 0; - pps->slice_group_change_rate_minus1 = 0; - pps->slice_group_id = NULL; + /* Variables that don't have inferred values per the H.264 + standard but that should get a default value anyway */ + pps->slice_group_map_type = 0; + pps->slice_group_change_rate_minus1 = 0; + pps->slice_group_id = NULL; - result = gst_h264_parser_parse_pps(priv->parser, &pi->nalu, pps); - if (result != GST_H264_PARSER_OK) - return get_status(result); + result = gst_h264_parser_parse_pps (priv->parser, &pi->nalu, pps); + if (result != GST_H264_PARSER_OK) + return get_status (result); - priv->parser_state |= GST_H264_VIDEO_STATE_GOT_PPS; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + priv->parser_state |= GST_H264_VIDEO_STATE_GOT_PPS; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -parse_sei(GstVaapiDecoderH264 *decoder, GstVaapiDecoderUnit *unit) +parse_sei (GstVaapiDecoderH264 * decoder, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiParserInfoH264 * const pi = unit->parsed_info; - GArray ** const sei_ptr = &pi->data.sei; - GstH264ParserResult result; - - GST_DEBUG("parse SEI"); - - result = gst_h264_parser_parse_sei(priv->parser, &pi->nalu, sei_ptr); - if (result != GST_H264_PARSER_OK) { - GST_WARNING("failed to parse SEI messages"); - return get_status(result); - } - return GST_VAAPI_DECODER_STATUS_SUCCESS; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiParserInfoH264 *const pi = unit->parsed_info; + GArray **const sei_ptr = &pi->data.sei; + GstH264ParserResult result; + + GST_DEBUG ("parse SEI"); + + result = gst_h264_parser_parse_sei (priv->parser, &pi->nalu, sei_ptr); + if (result != GST_H264_PARSER_OK) { + GST_WARNING ("failed to parse SEI messages"); + return get_status (result); + } + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -parse_slice(GstVaapiDecoderH264 *decoder, GstVaapiDecoderUnit *unit) +parse_slice (GstVaapiDecoderH264 * decoder, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiParserInfoH264 * const pi = unit->parsed_info; - GstH264SliceHdr * const slice_hdr = &pi->data.slice_hdr; - GstH264NalUnit * const nalu = &pi->nalu; - GstH264SPS *sps; - GstH264ParserResult result; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiParserInfoH264 *const pi = unit->parsed_info; + GstH264SliceHdr *const slice_hdr = &pi->data.slice_hdr; + GstH264NalUnit *const nalu = &pi->nalu; + GstH264SPS *sps; + GstH264ParserResult result; - GST_DEBUG("parse slice"); + GST_DEBUG ("parse slice"); - priv->parser_state &= (GST_H264_VIDEO_STATE_GOT_SPS| - GST_H264_VIDEO_STATE_GOT_PPS); + priv->parser_state &= (GST_H264_VIDEO_STATE_GOT_SPS | + GST_H264_VIDEO_STATE_GOT_PPS); - /* Propagate Prefix NAL unit info, if necessary */ - switch (nalu->type) { + /* Propagate Prefix NAL unit info, if necessary */ + switch (nalu->type) { case GST_H264_NAL_SLICE: - case GST_H264_NAL_SLICE_IDR: { - GstVaapiParserInfoH264 * const prev_pi = priv->prev_pi; - if (prev_pi && prev_pi->nalu.type == GST_H264_NAL_PREFIX_UNIT) { - /* MVC sequences shall have a Prefix NAL unit immediately - preceding this NAL unit */ - pi->nalu.extension_type = prev_pi->nalu.extension_type; - pi->nalu.extension = prev_pi->nalu.extension; - } - else { - /* In the very unlikely case there is no Prefix NAL unit - immediately preceding this NAL unit, try to infer some - defaults (H.7.4.1.1) */ - GstH264NalUnitExtensionMVC * const mvc = &pi->nalu.extension.mvc; - mvc->non_idr_flag = !(nalu->type == GST_H264_NAL_SLICE_IDR); - nalu->idr_pic_flag = !mvc->non_idr_flag; - mvc->priority_id = 0; - mvc->view_id = 0; - mvc->temporal_id = 0; - mvc->anchor_pic_flag = 0; - mvc->inter_view_flag = 1; - } - break; - } - } - - /* Variables that don't have inferred values per the H.264 - standard but that should get a default value anyway */ - slice_hdr->cabac_init_idc = 0; - slice_hdr->direct_spatial_mv_pred_flag = 0; - - result = gst_h264_parser_parse_slice_hdr(priv->parser, &pi->nalu, - slice_hdr, TRUE, TRUE); - if (result != GST_H264_PARSER_OK) - return get_status(result); - - sps = slice_hdr->pps->sequence; - - /* Update MVC data */ - pi->view_id = get_view_id(&pi->nalu); - pi->voc = get_view_order_index(sps, pi->view_id); - - priv->parser_state |= GST_H264_VIDEO_STATE_GOT_SLICE; - if (!GST_H264_IS_I_SLICE(slice_hdr)) - priv->parser_state |= GST_H264_VIDEO_STATE_GOT_P_SLICE; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + case GST_H264_NAL_SLICE_IDR:{ + GstVaapiParserInfoH264 *const prev_pi = priv->prev_pi; + if (prev_pi && prev_pi->nalu.type == GST_H264_NAL_PREFIX_UNIT) { + /* MVC sequences shall have a Prefix NAL unit immediately + preceding this NAL unit */ + pi->nalu.extension_type = prev_pi->nalu.extension_type; + pi->nalu.extension = prev_pi->nalu.extension; + } else { + /* In the very unlikely case there is no Prefix NAL unit + immediately preceding this NAL unit, try to infer some + defaults (H.7.4.1.1) */ + GstH264NalUnitExtensionMVC *const mvc = &pi->nalu.extension.mvc; + mvc->non_idr_flag = !(nalu->type == GST_H264_NAL_SLICE_IDR); + nalu->idr_pic_flag = !mvc->non_idr_flag; + mvc->priority_id = 0; + mvc->view_id = 0; + mvc->temporal_id = 0; + mvc->anchor_pic_flag = 0; + mvc->inter_view_flag = 1; + } + break; + } + } + + /* Variables that don't have inferred values per the H.264 + standard but that should get a default value anyway */ + slice_hdr->cabac_init_idc = 0; + slice_hdr->direct_spatial_mv_pred_flag = 0; + + result = gst_h264_parser_parse_slice_hdr (priv->parser, &pi->nalu, + slice_hdr, TRUE, TRUE); + if (result != GST_H264_PARSER_OK) + return get_status (result); + + sps = slice_hdr->pps->sequence; + + /* Update MVC data */ + pi->view_id = get_view_id (&pi->nalu); + pi->voc = get_view_order_index (sps, pi->view_id); + + priv->parser_state |= GST_H264_VIDEO_STATE_GOT_SLICE; + if (!GST_H264_IS_I_SLICE (slice_hdr)) + priv->parser_state |= GST_H264_VIDEO_STATE_GOT_P_SLICE; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_sps(GstVaapiDecoderH264 *decoder, GstVaapiDecoderUnit *unit) +decode_sps (GstVaapiDecoderH264 * decoder, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiParserInfoH264 * const pi = unit->parsed_info; - GstH264SPS * const sps = &pi->data.sps; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiParserInfoH264 *const pi = unit->parsed_info; + GstH264SPS *const sps = &pi->data.sps; - GST_DEBUG("decode SPS"); + GST_DEBUG ("decode SPS"); - gst_vaapi_parser_info_h264_replace(&priv->sps[sps->id], pi); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + gst_vaapi_parser_info_h264_replace (&priv->sps[sps->id], pi); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_subset_sps(GstVaapiDecoderH264 *decoder, GstVaapiDecoderUnit *unit) +decode_subset_sps (GstVaapiDecoderH264 * decoder, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiParserInfoH264 * const pi = unit->parsed_info; - GstH264SPS * const sps = &pi->data.sps; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiParserInfoH264 *const pi = unit->parsed_info; + GstH264SPS *const sps = &pi->data.sps; - GST_DEBUG("decode subset SPS"); + GST_DEBUG ("decode subset SPS"); - gst_vaapi_parser_info_h264_replace(&priv->sps[sps->id], pi); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + gst_vaapi_parser_info_h264_replace (&priv->sps[sps->id], pi); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_pps(GstVaapiDecoderH264 *decoder, GstVaapiDecoderUnit *unit) +decode_pps (GstVaapiDecoderH264 * decoder, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiParserInfoH264 * const pi = unit->parsed_info; - GstH264PPS * const pps = &pi->data.pps; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiParserInfoH264 *const pi = unit->parsed_info; + GstH264PPS *const pps = &pi->data.pps; - GST_DEBUG("decode PPS"); + GST_DEBUG ("decode PPS"); - gst_vaapi_parser_info_h264_replace(&priv->pps[pps->id], pi); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + gst_vaapi_parser_info_h264_replace (&priv->pps[pps->id], pi); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_sei(GstVaapiDecoderH264 *decoder, GstVaapiDecoderUnit *unit) +decode_sei (GstVaapiDecoderH264 * decoder, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiParserInfoH264 * const pi = unit->parsed_info; - guint i; - - GST_DEBUG("decode SEI messages"); - - for (i = 0; i < pi->data.sei->len; i++) { - const GstH264SEIMessage * const sei = - &g_array_index(pi->data.sei, GstH264SEIMessage, i); - - switch (sei->payloadType) { - case GST_H264_SEI_PIC_TIMING: { - const GstH264PicTiming * const pic_timing = - &sei->payload.pic_timing; - if (pic_timing->pic_struct_present_flag) - priv->pic_structure = pic_timing->pic_struct; - break; - } - default: - break; - } + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiParserInfoH264 *const pi = unit->parsed_info; + guint i; + + GST_DEBUG ("decode SEI messages"); + + for (i = 0; i < pi->data.sei->len; i++) { + const GstH264SEIMessage *const sei = + &g_array_index (pi->data.sei, GstH264SEIMessage, i); + + switch (sei->payloadType) { + case GST_H264_SEI_PIC_TIMING:{ + const GstH264PicTiming *const pic_timing = &sei->payload.pic_timing; + if (pic_timing->pic_struct_present_flag) + priv->pic_structure = pic_timing->pic_struct; + break; + } + default: + break; } - return GST_VAAPI_DECODER_STATUS_SUCCESS; + } + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_sequence_end(GstVaapiDecoderH264 *decoder) +decode_sequence_end (GstVaapiDecoderH264 * decoder) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiParserInfoH264 * const sps_pi = decoder->priv.active_sps; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiParserInfoH264 *const sps_pi = decoder->priv.active_sps; - GST_DEBUG("decode sequence-end"); + GST_DEBUG ("decode sequence-end"); - /* Sequence ended, don't try to propagate "got I-frame" state - beyond this point */ - if (sps_pi) - sps_pi->state &= ~GST_H264_VIDEO_STATE_GOT_I_FRAME; + /* Sequence ended, don't try to propagate "got I-frame" state + beyond this point */ + if (sps_pi) + sps_pi->state &= ~GST_H264_VIDEO_STATE_GOT_I_FRAME; - dpb_flush(decoder, NULL); + dpb_flush (decoder, NULL); - /* Reset defaults, should there be a new sequence available next */ - priv->max_views = 1; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + /* Reset defaults, should there be a new sequence available next */ + priv->max_views = 1; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } /* 8.2.1.1 - Decoding process for picture order count type 0 */ static void -init_picture_poc_0( - GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, - GstH264SliceHdr *slice_hdr -) -{ - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstH264SPS * const sps = get_sps(decoder); - const gint32 MaxPicOrderCntLsb = 1 << (sps->log2_max_pic_order_cnt_lsb_minus4 + 4); - gint32 temp_poc; - - GST_DEBUG("decode picture order count type 0"); - - if (GST_VAAPI_PICTURE_IS_IDR(picture)) { - priv->prev_poc_msb = 0; - priv->prev_poc_lsb = 0; - } - else if (priv->prev_pic_has_mmco5) { - priv->prev_poc_msb = 0; - priv->prev_poc_lsb = - (priv->prev_pic_structure == GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD ? - 0 : priv->field_poc[TOP_FIELD]); - } - else { - priv->prev_poc_msb = priv->poc_msb; - priv->prev_poc_lsb = priv->poc_lsb; - } - - // (8-3) - priv->poc_lsb = slice_hdr->pic_order_cnt_lsb; - if (priv->poc_lsb < priv->prev_poc_lsb && - (priv->prev_poc_lsb - priv->poc_lsb) >= (MaxPicOrderCntLsb / 2)) - priv->poc_msb = priv->prev_poc_msb + MaxPicOrderCntLsb; - else if (priv->poc_lsb > priv->prev_poc_lsb && - (priv->poc_lsb - priv->prev_poc_lsb) > (MaxPicOrderCntLsb / 2)) - priv->poc_msb = priv->prev_poc_msb - MaxPicOrderCntLsb; - else - priv->poc_msb = priv->prev_poc_msb; +init_picture_poc_0 (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, GstH264SliceHdr * slice_hdr) +{ + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstH264SPS *const sps = get_sps (decoder); + const gint32 MaxPicOrderCntLsb = + 1 << (sps->log2_max_pic_order_cnt_lsb_minus4 + 4); + gint32 temp_poc; + + GST_DEBUG ("decode picture order count type 0"); + + if (GST_VAAPI_PICTURE_IS_IDR (picture)) { + priv->prev_poc_msb = 0; + priv->prev_poc_lsb = 0; + } else if (priv->prev_pic_has_mmco5) { + priv->prev_poc_msb = 0; + priv->prev_poc_lsb = + (priv->prev_pic_structure == GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD ? + 0 : priv->field_poc[TOP_FIELD]); + } else { + priv->prev_poc_msb = priv->poc_msb; + priv->prev_poc_lsb = priv->poc_lsb; + } + + // (8-3) + priv->poc_lsb = slice_hdr->pic_order_cnt_lsb; + if (priv->poc_lsb < priv->prev_poc_lsb && + (priv->prev_poc_lsb - priv->poc_lsb) >= (MaxPicOrderCntLsb / 2)) + priv->poc_msb = priv->prev_poc_msb + MaxPicOrderCntLsb; + else if (priv->poc_lsb > priv->prev_poc_lsb && + (priv->poc_lsb - priv->prev_poc_lsb) > (MaxPicOrderCntLsb / 2)) + priv->poc_msb = priv->prev_poc_msb - MaxPicOrderCntLsb; + else + priv->poc_msb = priv->prev_poc_msb; - temp_poc = priv->poc_msb + priv->poc_lsb; - switch (picture->structure) { + temp_poc = priv->poc_msb + priv->poc_lsb; + switch (picture->structure) { case GST_VAAPI_PICTURE_STRUCTURE_FRAME: - // (8-4, 8-5) - priv->field_poc[TOP_FIELD] = temp_poc; - priv->field_poc[BOTTOM_FIELD] = temp_poc + - slice_hdr->delta_pic_order_cnt_bottom; - break; + // (8-4, 8-5) + priv->field_poc[TOP_FIELD] = temp_poc; + priv->field_poc[BOTTOM_FIELD] = temp_poc + + slice_hdr->delta_pic_order_cnt_bottom; + break; case GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD: - // (8-4) - priv->field_poc[TOP_FIELD] = temp_poc; - break; + // (8-4) + priv->field_poc[TOP_FIELD] = temp_poc; + break; case GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD: - // (8-5) - priv->field_poc[BOTTOM_FIELD] = temp_poc; - break; - } + // (8-5) + priv->field_poc[BOTTOM_FIELD] = temp_poc; + break; + } } /* 8.2.1.2 - Decoding process for picture order count type 1 */ static void -init_picture_poc_1( - GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, - GstH264SliceHdr *slice_hdr -) -{ - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstH264SPS * const sps = get_sps(decoder); - const gint32 MaxFrameNum = 1 << (sps->log2_max_frame_num_minus4 + 4); - gint32 prev_frame_num_offset, abs_frame_num, expected_poc; - guint i; - - GST_DEBUG("decode picture order count type 1"); - - if (priv->prev_pic_has_mmco5) - prev_frame_num_offset = 0; - else - prev_frame_num_offset = priv->frame_num_offset; - - // (8-6) - if (GST_VAAPI_PICTURE_IS_IDR(picture)) - priv->frame_num_offset = 0; - else if (priv->prev_frame_num > priv->frame_num) - priv->frame_num_offset = prev_frame_num_offset + MaxFrameNum; - else - priv->frame_num_offset = prev_frame_num_offset; +init_picture_poc_1 (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, GstH264SliceHdr * slice_hdr) +{ + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstH264SPS *const sps = get_sps (decoder); + const gint32 MaxFrameNum = 1 << (sps->log2_max_frame_num_minus4 + 4); + gint32 prev_frame_num_offset, abs_frame_num, expected_poc; + guint i; + + GST_DEBUG ("decode picture order count type 1"); + + if (priv->prev_pic_has_mmco5) + prev_frame_num_offset = 0; + else + prev_frame_num_offset = priv->frame_num_offset; - // (8-7) - if (sps->num_ref_frames_in_pic_order_cnt_cycle != 0) - abs_frame_num = priv->frame_num_offset + priv->frame_num; - else - abs_frame_num = 0; - if (!GST_VAAPI_PICTURE_IS_REFERENCE(picture) && abs_frame_num > 0) - abs_frame_num = abs_frame_num - 1; - - if (abs_frame_num > 0) { - gint32 expected_delta_per_poc_cycle; - gint32 poc_cycle_cnt, frame_num_in_poc_cycle; - - expected_delta_per_poc_cycle = 0; - for (i = 0; i < sps->num_ref_frames_in_pic_order_cnt_cycle; i++) - expected_delta_per_poc_cycle += sps->offset_for_ref_frame[i]; - - // (8-8) - poc_cycle_cnt = (abs_frame_num - 1) / - sps->num_ref_frames_in_pic_order_cnt_cycle; - frame_num_in_poc_cycle = (abs_frame_num - 1) % - sps->num_ref_frames_in_pic_order_cnt_cycle; - - // (8-9) - expected_poc = poc_cycle_cnt * expected_delta_per_poc_cycle; - for (i = 0; i <= frame_num_in_poc_cycle; i++) - expected_poc += sps->offset_for_ref_frame[i]; - } - else - expected_poc = 0; - if (!GST_VAAPI_PICTURE_IS_REFERENCE(picture)) - expected_poc += sps->offset_for_non_ref_pic; + // (8-6) + if (GST_VAAPI_PICTURE_IS_IDR (picture)) + priv->frame_num_offset = 0; + else if (priv->prev_frame_num > priv->frame_num) + priv->frame_num_offset = prev_frame_num_offset + MaxFrameNum; + else + priv->frame_num_offset = prev_frame_num_offset; + + // (8-7) + if (sps->num_ref_frames_in_pic_order_cnt_cycle != 0) + abs_frame_num = priv->frame_num_offset + priv->frame_num; + else + abs_frame_num = 0; + if (!GST_VAAPI_PICTURE_IS_REFERENCE (picture) && abs_frame_num > 0) + abs_frame_num = abs_frame_num - 1; + + if (abs_frame_num > 0) { + gint32 expected_delta_per_poc_cycle; + gint32 poc_cycle_cnt, frame_num_in_poc_cycle; + + expected_delta_per_poc_cycle = 0; + for (i = 0; i < sps->num_ref_frames_in_pic_order_cnt_cycle; i++) + expected_delta_per_poc_cycle += sps->offset_for_ref_frame[i]; + + // (8-8) + poc_cycle_cnt = (abs_frame_num - 1) / + sps->num_ref_frames_in_pic_order_cnt_cycle; + frame_num_in_poc_cycle = (abs_frame_num - 1) % + sps->num_ref_frames_in_pic_order_cnt_cycle; + + // (8-9) + expected_poc = poc_cycle_cnt * expected_delta_per_poc_cycle; + for (i = 0; i <= frame_num_in_poc_cycle; i++) + expected_poc += sps->offset_for_ref_frame[i]; + } else + expected_poc = 0; + if (!GST_VAAPI_PICTURE_IS_REFERENCE (picture)) + expected_poc += sps->offset_for_non_ref_pic; - // (8-10) - switch (picture->structure) { + // (8-10) + switch (picture->structure) { case GST_VAAPI_PICTURE_STRUCTURE_FRAME: - priv->field_poc[TOP_FIELD] = expected_poc + - slice_hdr->delta_pic_order_cnt[0]; - priv->field_poc[BOTTOM_FIELD] = priv->field_poc[TOP_FIELD] + - sps->offset_for_top_to_bottom_field + - slice_hdr->delta_pic_order_cnt[1]; - break; + priv->field_poc[TOP_FIELD] = expected_poc + + slice_hdr->delta_pic_order_cnt[0]; + priv->field_poc[BOTTOM_FIELD] = priv->field_poc[TOP_FIELD] + + sps->offset_for_top_to_bottom_field + + slice_hdr->delta_pic_order_cnt[1]; + break; case GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD: - priv->field_poc[TOP_FIELD] = expected_poc + - slice_hdr->delta_pic_order_cnt[0]; - break; + priv->field_poc[TOP_FIELD] = expected_poc + + slice_hdr->delta_pic_order_cnt[0]; + break; case GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD: - priv->field_poc[BOTTOM_FIELD] = expected_poc + - sps->offset_for_top_to_bottom_field + - slice_hdr->delta_pic_order_cnt[0]; - break; - } + priv->field_poc[BOTTOM_FIELD] = expected_poc + + sps->offset_for_top_to_bottom_field + + slice_hdr->delta_pic_order_cnt[0]; + break; + } } /* 8.2.1.3 - Decoding process for picture order count type 2 */ static void -init_picture_poc_2( - GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, - GstH264SliceHdr *slice_hdr -) -{ - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstH264SPS * const sps = get_sps(decoder); - const gint32 MaxFrameNum = 1 << (sps->log2_max_frame_num_minus4 + 4); - gint32 prev_frame_num_offset, temp_poc; - - GST_DEBUG("decode picture order count type 2"); - - if (priv->prev_pic_has_mmco5) - prev_frame_num_offset = 0; - else - prev_frame_num_offset = priv->frame_num_offset; - - // (8-11) - if (GST_VAAPI_PICTURE_IS_IDR(picture)) - priv->frame_num_offset = 0; - else if (priv->prev_frame_num > priv->frame_num) - priv->frame_num_offset = prev_frame_num_offset + MaxFrameNum; - else - priv->frame_num_offset = prev_frame_num_offset; - - // (8-12) - if (GST_VAAPI_PICTURE_IS_IDR(picture)) - temp_poc = 0; - else if (!GST_VAAPI_PICTURE_IS_REFERENCE(picture)) - temp_poc = 2 * (priv->frame_num_offset + priv->frame_num) - 1; - else - temp_poc = 2 * (priv->frame_num_offset + priv->frame_num); +init_picture_poc_2 (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, GstH264SliceHdr * slice_hdr) +{ + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstH264SPS *const sps = get_sps (decoder); + const gint32 MaxFrameNum = 1 << (sps->log2_max_frame_num_minus4 + 4); + gint32 prev_frame_num_offset, temp_poc; + + GST_DEBUG ("decode picture order count type 2"); + + if (priv->prev_pic_has_mmco5) + prev_frame_num_offset = 0; + else + prev_frame_num_offset = priv->frame_num_offset; - // (8-13) - if (picture->structure != GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD) - priv->field_poc[TOP_FIELD] = temp_poc; - if (picture->structure != GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD) - priv->field_poc[BOTTOM_FIELD] = temp_poc; + // (8-11) + if (GST_VAAPI_PICTURE_IS_IDR (picture)) + priv->frame_num_offset = 0; + else if (priv->prev_frame_num > priv->frame_num) + priv->frame_num_offset = prev_frame_num_offset + MaxFrameNum; + else + priv->frame_num_offset = prev_frame_num_offset; + + // (8-12) + if (GST_VAAPI_PICTURE_IS_IDR (picture)) + temp_poc = 0; + else if (!GST_VAAPI_PICTURE_IS_REFERENCE (picture)) + temp_poc = 2 * (priv->frame_num_offset + priv->frame_num) - 1; + else + temp_poc = 2 * (priv->frame_num_offset + priv->frame_num); + + // (8-13) + if (picture->structure != GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD) + priv->field_poc[TOP_FIELD] = temp_poc; + if (picture->structure != GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD) + priv->field_poc[BOTTOM_FIELD] = temp_poc; } /* 8.2.1 - Decoding process for picture order count */ static void -init_picture_poc( - GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, - GstH264SliceHdr *slice_hdr -) +init_picture_poc (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, GstH264SliceHdr * slice_hdr) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstH264SPS * const sps = get_sps(decoder); + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstH264SPS *const sps = get_sps (decoder); - switch (sps->pic_order_cnt_type) { + switch (sps->pic_order_cnt_type) { case 0: - init_picture_poc_0(decoder, picture, slice_hdr); - break; + init_picture_poc_0 (decoder, picture, slice_hdr); + break; case 1: - init_picture_poc_1(decoder, picture, slice_hdr); - break; + init_picture_poc_1 (decoder, picture, slice_hdr); + break; case 2: - init_picture_poc_2(decoder, picture, slice_hdr); - break; - } - - if (picture->structure != GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD) - picture->field_poc[TOP_FIELD] = priv->field_poc[TOP_FIELD]; - if (picture->structure != GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD) - picture->field_poc[BOTTOM_FIELD] = priv->field_poc[BOTTOM_FIELD]; - picture->base.poc = MIN(picture->field_poc[0], picture->field_poc[1]); + init_picture_poc_2 (decoder, picture, slice_hdr); + break; + } + + if (picture->structure != GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD) + picture->field_poc[TOP_FIELD] = priv->field_poc[TOP_FIELD]; + if (picture->structure != GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD) + picture->field_poc[BOTTOM_FIELD] = priv->field_poc[BOTTOM_FIELD]; + picture->base.poc = MIN (picture->field_poc[0], picture->field_poc[1]); } static int -compare_picture_pic_num_dec(const void *a, const void *b) +compare_picture_pic_num_dec (const void *a, const void *b) { - const GstVaapiPictureH264 * const picA = *(GstVaapiPictureH264 **)a; - const GstVaapiPictureH264 * const picB = *(GstVaapiPictureH264 **)b; + const GstVaapiPictureH264 *const picA = *(GstVaapiPictureH264 **) a; + const GstVaapiPictureH264 *const picB = *(GstVaapiPictureH264 **) b; - return picB->pic_num - picA->pic_num; + return picB->pic_num - picA->pic_num; } static int -compare_picture_long_term_pic_num_inc(const void *a, const void *b) +compare_picture_long_term_pic_num_inc (const void *a, const void *b) { - const GstVaapiPictureH264 * const picA = *(GstVaapiPictureH264 **)a; - const GstVaapiPictureH264 * const picB = *(GstVaapiPictureH264 **)b; + const GstVaapiPictureH264 *const picA = *(GstVaapiPictureH264 **) a; + const GstVaapiPictureH264 *const picB = *(GstVaapiPictureH264 **) b; - return picA->long_term_pic_num - picB->long_term_pic_num; + return picA->long_term_pic_num - picB->long_term_pic_num; } static int -compare_picture_poc_dec(const void *a, const void *b) +compare_picture_poc_dec (const void *a, const void *b) { - const GstVaapiPictureH264 * const picA = *(GstVaapiPictureH264 **)a; - const GstVaapiPictureH264 * const picB = *(GstVaapiPictureH264 **)b; + const GstVaapiPictureH264 *const picA = *(GstVaapiPictureH264 **) a; + const GstVaapiPictureH264 *const picB = *(GstVaapiPictureH264 **) b; - return picB->base.poc - picA->base.poc; + return picB->base.poc - picA->base.poc; } static int -compare_picture_poc_inc(const void *a, const void *b) +compare_picture_poc_inc (const void *a, const void *b) { - const GstVaapiPictureH264 * const picA = *(GstVaapiPictureH264 **)a; - const GstVaapiPictureH264 * const picB = *(GstVaapiPictureH264 **)b; + const GstVaapiPictureH264 *const picA = *(GstVaapiPictureH264 **) a; + const GstVaapiPictureH264 *const picB = *(GstVaapiPictureH264 **) b; - return picA->base.poc - picB->base.poc; + return picA->base.poc - picB->base.poc; } static int -compare_picture_frame_num_wrap_dec(const void *a, const void *b) +compare_picture_frame_num_wrap_dec (const void *a, const void *b) { - const GstVaapiPictureH264 * const picA = *(GstVaapiPictureH264 **)a; - const GstVaapiPictureH264 * const picB = *(GstVaapiPictureH264 **)b; + const GstVaapiPictureH264 *const picA = *(GstVaapiPictureH264 **) a; + const GstVaapiPictureH264 *const picB = *(GstVaapiPictureH264 **) b; - return picB->frame_num_wrap - picA->frame_num_wrap; + return picB->frame_num_wrap - picA->frame_num_wrap; } static int -compare_picture_long_term_frame_idx_inc(const void *a, const void *b) +compare_picture_long_term_frame_idx_inc (const void *a, const void *b) { - const GstVaapiPictureH264 * const picA = *(GstVaapiPictureH264 **)a; - const GstVaapiPictureH264 * const picB = *(GstVaapiPictureH264 **)b; + const GstVaapiPictureH264 *const picA = *(GstVaapiPictureH264 **) a; + const GstVaapiPictureH264 *const picB = *(GstVaapiPictureH264 **) b; - return picA->long_term_frame_idx - picB->long_term_frame_idx; + return picA->long_term_frame_idx - picB->long_term_frame_idx; } /* 8.2.4.1 - Decoding process for picture numbers */ static void -init_picture_refs_pic_num( - GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, - GstH264SliceHdr *slice_hdr -) -{ - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstH264SPS * const sps = get_sps(decoder); - const gint32 MaxFrameNum = 1 << (sps->log2_max_frame_num_minus4 + 4); - guint i; - - GST_DEBUG("decode picture numbers"); - - for (i = 0; i < priv->short_ref_count; i++) { - GstVaapiPictureH264 * const pic = priv->short_ref[i]; - - // (H.8.2) - if (pic->base.view_id != picture->base.view_id) - continue; - - // (8-27) - if (pic->frame_num > priv->frame_num) - pic->frame_num_wrap = pic->frame_num - MaxFrameNum; - else - pic->frame_num_wrap = pic->frame_num; - - // (8-28, 8-30, 8-31) - if (GST_VAAPI_PICTURE_IS_FRAME(picture)) - pic->pic_num = pic->frame_num_wrap; - else { - if (pic->structure == picture->structure) - pic->pic_num = 2 * pic->frame_num_wrap + 1; - else - pic->pic_num = 2 * pic->frame_num_wrap; - } - } - - for (i = 0; i < priv->long_ref_count; i++) { - GstVaapiPictureH264 * const pic = priv->long_ref[i]; - - // (H.8.2) - if (pic->base.view_id != picture->base.view_id) - continue; +init_picture_refs_pic_num (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, GstH264SliceHdr * slice_hdr) +{ + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstH264SPS *const sps = get_sps (decoder); + const gint32 MaxFrameNum = 1 << (sps->log2_max_frame_num_minus4 + 4); + guint i; + + GST_DEBUG ("decode picture numbers"); + + for (i = 0; i < priv->short_ref_count; i++) { + GstVaapiPictureH264 *const pic = priv->short_ref[i]; + + // (H.8.2) + if (pic->base.view_id != picture->base.view_id) + continue; + + // (8-27) + if (pic->frame_num > priv->frame_num) + pic->frame_num_wrap = pic->frame_num - MaxFrameNum; + else + pic->frame_num_wrap = pic->frame_num; - // (8-29, 8-32, 8-33) - if (GST_VAAPI_PICTURE_IS_FRAME(picture)) - pic->long_term_pic_num = pic->long_term_frame_idx; - else { - if (pic->structure == picture->structure) - pic->long_term_pic_num = 2 * pic->long_term_frame_idx + 1; - else - pic->long_term_pic_num = 2 * pic->long_term_frame_idx; - } + // (8-28, 8-30, 8-31) + if (GST_VAAPI_PICTURE_IS_FRAME (picture)) + pic->pic_num = pic->frame_num_wrap; + else { + if (pic->structure == picture->structure) + pic->pic_num = 2 * pic->frame_num_wrap + 1; + else + pic->pic_num = 2 * pic->frame_num_wrap; + } + } + + for (i = 0; i < priv->long_ref_count; i++) { + GstVaapiPictureH264 *const pic = priv->long_ref[i]; + + // (H.8.2) + if (pic->base.view_id != picture->base.view_id) + continue; + + // (8-29, 8-32, 8-33) + if (GST_VAAPI_PICTURE_IS_FRAME (picture)) + pic->long_term_pic_num = pic->long_term_frame_idx; + else { + if (pic->structure == picture->structure) + pic->long_term_pic_num = 2 * pic->long_term_frame_idx + 1; + else + pic->long_term_pic_num = 2 * pic->long_term_frame_idx; } + } } #define SORT_REF_LIST(list, n, compare_func) \ qsort(list, n, sizeof(*(list)), compare_picture_##compare_func) static void -init_picture_refs_fields_1( - guint picture_structure, - GstVaapiPictureH264 *RefPicList[32], - guint *RefPicList_count, - GstVaapiPictureH264 *ref_list[32], - guint ref_list_count -) -{ - guint i, j, n; - - i = 0; - j = 0; - n = *RefPicList_count; - do { - g_assert(n < 32); - for (; i < ref_list_count; i++) { - if (ref_list[i]->structure == picture_structure) { - RefPicList[n++] = ref_list[i++]; - break; - } - } - for (; j < ref_list_count; j++) { - if (ref_list[j]->structure != picture_structure) { - RefPicList[n++] = ref_list[j++]; - break; - } - } - } while (i < ref_list_count || j < ref_list_count); - *RefPicList_count = n; +init_picture_refs_fields_1 (guint picture_structure, + GstVaapiPictureH264 * RefPicList[32], + guint * RefPicList_count, + GstVaapiPictureH264 * ref_list[32], guint ref_list_count) +{ + guint i, j, n; + + i = 0; + j = 0; + n = *RefPicList_count; + do { + g_assert (n < 32); + for (; i < ref_list_count; i++) { + if (ref_list[i]->structure == picture_structure) { + RefPicList[n++] = ref_list[i++]; + break; + } + } + for (; j < ref_list_count; j++) { + if (ref_list[j]->structure != picture_structure) { + RefPicList[n++] = ref_list[j++]; + break; + } + } + } while (i < ref_list_count || j < ref_list_count); + *RefPicList_count = n; } static inline void -init_picture_refs_fields( - GstVaapiPictureH264 *picture, - GstVaapiPictureH264 *RefPicList[32], - guint *RefPicList_count, - GstVaapiPictureH264 *short_ref[32], - guint short_ref_count, - GstVaapiPictureH264 *long_ref[32], - guint long_ref_count -) -{ - guint n = 0; - - /* 8.2.4.2.5 - reference picture lists in fields */ - init_picture_refs_fields_1(picture->structure, RefPicList, &n, - short_ref, short_ref_count); - init_picture_refs_fields_1(picture->structure, RefPicList, &n, - long_ref, long_ref_count); - *RefPicList_count = n; +init_picture_refs_fields (GstVaapiPictureH264 * picture, + GstVaapiPictureH264 * RefPicList[32], + guint * RefPicList_count, + GstVaapiPictureH264 * short_ref[32], + guint short_ref_count, + GstVaapiPictureH264 * long_ref[32], guint long_ref_count) +{ + guint n = 0; + + /* 8.2.4.2.5 - reference picture lists in fields */ + init_picture_refs_fields_1 (picture->structure, RefPicList, &n, + short_ref, short_ref_count); + init_picture_refs_fields_1 (picture->structure, RefPicList, &n, + long_ref, long_ref_count); + *RefPicList_count = n; } /* Finds the inter-view reference picture with the supplied view id */ static GstVaapiPictureH264 * -find_inter_view_reference(GstVaapiDecoderH264 *decoder, guint16 view_id) +find_inter_view_reference (GstVaapiDecoderH264 * decoder, guint16 view_id) { - GPtrArray * const inter_views = decoder->priv.inter_views; - guint i; - - for (i = 0; i < inter_views->len; i++) { - GstVaapiPictureH264 * const picture = g_ptr_array_index(inter_views, i); - if (picture->base.view_id == view_id) - return picture; - } + GPtrArray *const inter_views = decoder->priv.inter_views; + guint i; - GST_WARNING("failed to find inter-view reference picture for view_id: %d", - view_id); - return NULL; + for (i = 0; i < inter_views->len; i++) { + GstVaapiPictureH264 *const picture = g_ptr_array_index (inter_views, i); + if (picture->base.view_id == view_id) + return picture; + } + + GST_WARNING ("failed to find inter-view reference picture for view_id: %d", + view_id); + return NULL; } /* Checks whether the view id exists in the supplied list of view ids */ static gboolean -find_view_id(guint16 view_id, const guint16 *view_ids, guint num_view_ids) +find_view_id (guint16 view_id, const guint16 * view_ids, guint num_view_ids) { - guint i; + guint i; - for (i = 0; i < num_view_ids; i++) { - if (view_ids[i] == view_id) - return TRUE; - } - return FALSE; + for (i = 0; i < num_view_ids; i++) { + if (view_ids[i] == view_id) + return TRUE; + } + return FALSE; } static gboolean -find_view_id_in_view(guint16 view_id, const GstH264SPSExtMVCView *view, +find_view_id_in_view (guint16 view_id, const GstH264SPSExtMVCView * view, gboolean is_anchor) { - if (is_anchor) - return (find_view_id(view_id, view->anchor_ref_l0, - view->num_anchor_refs_l0) || - find_view_id(view_id, view->anchor_ref_l1, - view->num_anchor_refs_l1)); - - return (find_view_id(view_id, view->non_anchor_ref_l0, - view->num_non_anchor_refs_l0) || - find_view_id(view_id, view->non_anchor_ref_l1, - view->num_non_anchor_refs_l1)); + if (is_anchor) + return (find_view_id (view_id, view->anchor_ref_l0, + view->num_anchor_refs_l0) || + find_view_id (view_id, view->anchor_ref_l1, view->num_anchor_refs_l1)); + + return (find_view_id (view_id, view->non_anchor_ref_l0, + view->num_non_anchor_refs_l0) || + find_view_id (view_id, view->non_anchor_ref_l1, + view->num_non_anchor_refs_l1)); } /* Checks whether the inter-view reference picture with the supplied view id is used for decoding the current view component picture */ static gboolean -is_inter_view_reference_for_picture(GstVaapiDecoderH264 *decoder, - guint16 view_id, GstVaapiPictureH264 *picture) +is_inter_view_reference_for_picture (GstVaapiDecoderH264 * decoder, + guint16 view_id, GstVaapiPictureH264 * picture) { - const GstH264SPS * const sps = get_sps(decoder); - gboolean is_anchor; + const GstH264SPS *const sps = get_sps (decoder); + gboolean is_anchor; - if (!GST_VAAPI_PICTURE_IS_MVC(picture) || - sps->extension_type != GST_H264_NAL_EXTENSION_MVC) - return FALSE; + if (!GST_VAAPI_PICTURE_IS_MVC (picture) || + sps->extension_type != GST_H264_NAL_EXTENSION_MVC) + return FALSE; - is_anchor = GST_VAAPI_PICTURE_IS_ANCHOR(picture); - return find_view_id_in_view(view_id, - &sps->extension.mvc.view[picture->base.voc], is_anchor); + is_anchor = GST_VAAPI_PICTURE_IS_ANCHOR (picture); + return find_view_id_in_view (view_id, + &sps->extension.mvc.view[picture->base.voc], is_anchor); } /* Checks whether the supplied inter-view reference picture is used for decoding the next view component pictures */ static gboolean -is_inter_view_reference_for_next_pictures(GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture) +is_inter_view_reference_for_next_pictures (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture) { - const GstH264SPS * const sps = get_sps(decoder); - gboolean is_anchor; - guint i, num_views; - - if (!GST_VAAPI_PICTURE_IS_MVC(picture) || - sps->extension_type != GST_H264_NAL_EXTENSION_MVC) - return FALSE; + const GstH264SPS *const sps = get_sps (decoder); + gboolean is_anchor; + guint i, num_views; - is_anchor = GST_VAAPI_PICTURE_IS_ANCHOR(picture); - num_views = sps->extension.mvc.num_views_minus1 + 1; - for (i = picture->base.voc + 1; i < num_views; i++) { - const GstH264SPSExtMVCView * const view = &sps->extension.mvc.view[i]; - if (find_view_id_in_view(picture->base.view_id, view, is_anchor)) - return TRUE; - } + if (!GST_VAAPI_PICTURE_IS_MVC (picture) || + sps->extension_type != GST_H264_NAL_EXTENSION_MVC) return FALSE; + + is_anchor = GST_VAAPI_PICTURE_IS_ANCHOR (picture); + num_views = sps->extension.mvc.num_views_minus1 + 1; + for (i = picture->base.voc + 1; i < num_views; i++) { + const GstH264SPSExtMVCView *const view = &sps->extension.mvc.view[i]; + if (find_view_id_in_view (picture->base.view_id, view, is_anchor)) + return TRUE; + } + return FALSE; } /* H.8.2.1 - Initialization process for inter-view prediction references */ static void -init_picture_refs_mvc_1(GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 **ref_list, guint *ref_list_count_ptr, guint num_refs, - const guint16 *view_ids, guint num_view_ids) -{ - guint j, n; - - n = *ref_list_count_ptr; - for (j = 0; j < num_view_ids && n < num_refs; j++) { - GstVaapiPictureH264 * const pic = - find_inter_view_reference(decoder, view_ids[j]); - if (pic) - ref_list[n++] = pic; - } - *ref_list_count_ptr = n; +init_picture_refs_mvc_1 (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 ** ref_list, guint * ref_list_count_ptr, guint num_refs, + const guint16 * view_ids, guint num_view_ids) +{ + guint j, n; + + n = *ref_list_count_ptr; + for (j = 0; j < num_view_ids && n < num_refs; j++) { + GstVaapiPictureH264 *const pic = + find_inter_view_reference (decoder, view_ids[j]); + if (pic) + ref_list[n++] = pic; + } + *ref_list_count_ptr = n; } static inline void -init_picture_refs_mvc(GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, GstH264SliceHdr *slice_hdr, guint list) +init_picture_refs_mvc (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, GstH264SliceHdr * slice_hdr, guint list) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - const GstH264SPS * const sps = get_sps(decoder); - const GstH264SPSExtMVCView *view; - - GST_DEBUG("initialize reference picture list for inter-view prediction"); - - if (sps->extension_type != GST_H264_NAL_EXTENSION_MVC) - return; - view = &sps->extension.mvc.view[picture->base.voc]; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + const GstH264SPS *const sps = get_sps (decoder); + const GstH264SPSExtMVCView *view; + + GST_DEBUG ("initialize reference picture list for inter-view prediction"); + + if (sps->extension_type != GST_H264_NAL_EXTENSION_MVC) + return; + view = &sps->extension.mvc.view[picture->base.voc]; #define INVOKE_INIT_PICTURE_REFS_MVC(ref_list, view_list) do { \ init_picture_refs_mvc_1(decoder, \ @@ -2406,1384 +2368,1327 @@ view->num_##view_list##s_l##ref_list); \ } while (0) - if (list == 0) { - if (GST_VAAPI_PICTURE_IS_ANCHOR(picture)) - INVOKE_INIT_PICTURE_REFS_MVC(0, anchor_ref); - else - INVOKE_INIT_PICTURE_REFS_MVC(0, non_anchor_ref); - } - else { - if (GST_VAAPI_PICTURE_IS_ANCHOR(picture)) - INVOKE_INIT_PICTURE_REFS_MVC(1, anchor_ref); - else - INVOKE_INIT_PICTURE_REFS_MVC(1, non_anchor_ref); - } + if (list == 0) { + if (GST_VAAPI_PICTURE_IS_ANCHOR (picture)) + INVOKE_INIT_PICTURE_REFS_MVC (0, anchor_ref); + else + INVOKE_INIT_PICTURE_REFS_MVC (0, non_anchor_ref); + } else { + if (GST_VAAPI_PICTURE_IS_ANCHOR (picture)) + INVOKE_INIT_PICTURE_REFS_MVC (1, anchor_ref); + else + INVOKE_INIT_PICTURE_REFS_MVC (1, non_anchor_ref); + } #undef INVOKE_INIT_PICTURE_REFS_MVC } static void -init_picture_refs_p_slice( - GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, - GstH264SliceHdr *slice_hdr -) -{ - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiPictureH264 **ref_list; - guint i; - - GST_DEBUG("decode reference picture list for P and SP slices"); - - if (GST_VAAPI_PICTURE_IS_FRAME(picture)) { - /* 8.2.4.2.1 - P and SP slices in frames */ - if (priv->short_ref_count > 0) { - ref_list = priv->RefPicList0; - for (i = 0; i < priv->short_ref_count; i++) - ref_list[i] = priv->short_ref[i]; - SORT_REF_LIST(ref_list, i, pic_num_dec); - priv->RefPicList0_count += i; - } - - if (priv->long_ref_count > 0) { - ref_list = &priv->RefPicList0[priv->RefPicList0_count]; - for (i = 0; i < priv->long_ref_count; i++) - ref_list[i] = priv->long_ref[i]; - SORT_REF_LIST(ref_list, i, long_term_pic_num_inc); - priv->RefPicList0_count += i; - } - } - else { - /* 8.2.4.2.2 - P and SP slices in fields */ - GstVaapiPictureH264 *short_ref[32]; - guint short_ref_count = 0; - GstVaapiPictureH264 *long_ref[32]; - guint long_ref_count = 0; - - if (priv->short_ref_count > 0) { - for (i = 0; i < priv->short_ref_count; i++) - short_ref[i] = priv->short_ref[i]; - SORT_REF_LIST(short_ref, i, frame_num_wrap_dec); - short_ref_count = i; - } - - if (priv->long_ref_count > 0) { - for (i = 0; i < priv->long_ref_count; i++) - long_ref[i] = priv->long_ref[i]; - SORT_REF_LIST(long_ref, i, long_term_frame_idx_inc); - long_ref_count = i; - } - - init_picture_refs_fields( - picture, - priv->RefPicList0, &priv->RefPicList0_count, - short_ref, short_ref_count, - long_ref, long_ref_count - ); - } +init_picture_refs_p_slice (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, GstH264SliceHdr * slice_hdr) +{ + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiPictureH264 **ref_list; + guint i; + + GST_DEBUG ("decode reference picture list for P and SP slices"); + + if (GST_VAAPI_PICTURE_IS_FRAME (picture)) { + /* 8.2.4.2.1 - P and SP slices in frames */ + if (priv->short_ref_count > 0) { + ref_list = priv->RefPicList0; + for (i = 0; i < priv->short_ref_count; i++) + ref_list[i] = priv->short_ref[i]; + SORT_REF_LIST (ref_list, i, pic_num_dec); + priv->RefPicList0_count += i; + } + + if (priv->long_ref_count > 0) { + ref_list = &priv->RefPicList0[priv->RefPicList0_count]; + for (i = 0; i < priv->long_ref_count; i++) + ref_list[i] = priv->long_ref[i]; + SORT_REF_LIST (ref_list, i, long_term_pic_num_inc); + priv->RefPicList0_count += i; + } + } else { + /* 8.2.4.2.2 - P and SP slices in fields */ + GstVaapiPictureH264 *short_ref[32]; + guint short_ref_count = 0; + GstVaapiPictureH264 *long_ref[32]; + guint long_ref_count = 0; + + if (priv->short_ref_count > 0) { + for (i = 0; i < priv->short_ref_count; i++) + short_ref[i] = priv->short_ref[i]; + SORT_REF_LIST (short_ref, i, frame_num_wrap_dec); + short_ref_count = i; + } + + if (priv->long_ref_count > 0) { + for (i = 0; i < priv->long_ref_count; i++) + long_ref[i] = priv->long_ref[i]; + SORT_REF_LIST (long_ref, i, long_term_frame_idx_inc); + long_ref_count = i; + } + + init_picture_refs_fields (picture, + priv->RefPicList0, &priv->RefPicList0_count, + short_ref, short_ref_count, long_ref, long_ref_count); + } - if (GST_VAAPI_PICTURE_IS_MVC(picture)) { - /* RefPicList0 */ - init_picture_refs_mvc(decoder, picture, slice_hdr, 0); - } + if (GST_VAAPI_PICTURE_IS_MVC (picture)) { + /* RefPicList0 */ + init_picture_refs_mvc (decoder, picture, slice_hdr, 0); + } } static void -init_picture_refs_b_slice( - GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, - GstH264SliceHdr *slice_hdr -) -{ - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiPictureH264 **ref_list; - guint i, n; - - GST_DEBUG("decode reference picture list for B slices"); - - if (GST_VAAPI_PICTURE_IS_FRAME(picture)) { - /* 8.2.4.2.3 - B slices in frames */ - - /* RefPicList0 */ - if (priv->short_ref_count > 0) { - // 1. Short-term references - ref_list = priv->RefPicList0; - for (n = 0, i = 0; i < priv->short_ref_count; i++) { - if (priv->short_ref[i]->base.poc < picture->base.poc) - ref_list[n++] = priv->short_ref[i]; - } - SORT_REF_LIST(ref_list, n, poc_dec); - priv->RefPicList0_count += n; - - ref_list = &priv->RefPicList0[priv->RefPicList0_count]; - for (n = 0, i = 0; i < priv->short_ref_count; i++) { - if (priv->short_ref[i]->base.poc >= picture->base.poc) - ref_list[n++] = priv->short_ref[i]; - } - SORT_REF_LIST(ref_list, n, poc_inc); - priv->RefPicList0_count += n; - } +init_picture_refs_b_slice (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, GstH264SliceHdr * slice_hdr) +{ + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiPictureH264 **ref_list; + guint i, n; - if (priv->long_ref_count > 0) { - // 2. Long-term references - ref_list = &priv->RefPicList0[priv->RefPicList0_count]; - for (n = 0, i = 0; i < priv->long_ref_count; i++) - ref_list[n++] = priv->long_ref[i]; - SORT_REF_LIST(ref_list, n, long_term_pic_num_inc); - priv->RefPicList0_count += n; - } + GST_DEBUG ("decode reference picture list for B slices"); - /* RefPicList1 */ - if (priv->short_ref_count > 0) { - // 1. Short-term references - ref_list = priv->RefPicList1; - for (n = 0, i = 0; i < priv->short_ref_count; i++) { - if (priv->short_ref[i]->base.poc > picture->base.poc) - ref_list[n++] = priv->short_ref[i]; - } - SORT_REF_LIST(ref_list, n, poc_inc); - priv->RefPicList1_count += n; - - ref_list = &priv->RefPicList1[priv->RefPicList1_count]; - for (n = 0, i = 0; i < priv->short_ref_count; i++) { - if (priv->short_ref[i]->base.poc <= picture->base.poc) - ref_list[n++] = priv->short_ref[i]; - } - SORT_REF_LIST(ref_list, n, poc_dec); - priv->RefPicList1_count += n; - } + if (GST_VAAPI_PICTURE_IS_FRAME (picture)) { + /* 8.2.4.2.3 - B slices in frames */ - if (priv->long_ref_count > 0) { - // 2. Long-term references - ref_list = &priv->RefPicList1[priv->RefPicList1_count]; - for (n = 0, i = 0; i < priv->long_ref_count; i++) - ref_list[n++] = priv->long_ref[i]; - SORT_REF_LIST(ref_list, n, long_term_pic_num_inc); - priv->RefPicList1_count += n; - } + /* RefPicList0 */ + if (priv->short_ref_count > 0) { + // 1. Short-term references + ref_list = priv->RefPicList0; + for (n = 0, i = 0; i < priv->short_ref_count; i++) { + if (priv->short_ref[i]->base.poc < picture->base.poc) + ref_list[n++] = priv->short_ref[i]; + } + SORT_REF_LIST (ref_list, n, poc_dec); + priv->RefPicList0_count += n; + + ref_list = &priv->RefPicList0[priv->RefPicList0_count]; + for (n = 0, i = 0; i < priv->short_ref_count; i++) { + if (priv->short_ref[i]->base.poc >= picture->base.poc) + ref_list[n++] = priv->short_ref[i]; + } + SORT_REF_LIST (ref_list, n, poc_inc); + priv->RefPicList0_count += n; + } + + if (priv->long_ref_count > 0) { + // 2. Long-term references + ref_list = &priv->RefPicList0[priv->RefPicList0_count]; + for (n = 0, i = 0; i < priv->long_ref_count; i++) + ref_list[n++] = priv->long_ref[i]; + SORT_REF_LIST (ref_list, n, long_term_pic_num_inc); + priv->RefPicList0_count += n; } - else { - /* 8.2.4.2.4 - B slices in fields */ - GstVaapiPictureH264 *short_ref0[32]; - guint short_ref0_count = 0; - GstVaapiPictureH264 *short_ref1[32]; - guint short_ref1_count = 0; - GstVaapiPictureH264 *long_ref[32]; - guint long_ref_count = 0; - - /* refFrameList0ShortTerm */ - if (priv->short_ref_count > 0) { - ref_list = short_ref0; - for (n = 0, i = 0; i < priv->short_ref_count; i++) { - if (priv->short_ref[i]->base.poc <= picture->base.poc) - ref_list[n++] = priv->short_ref[i]; - } - SORT_REF_LIST(ref_list, n, poc_dec); - short_ref0_count += n; - - ref_list = &short_ref0[short_ref0_count]; - for (n = 0, i = 0; i < priv->short_ref_count; i++) { - if (priv->short_ref[i]->base.poc > picture->base.poc) - ref_list[n++] = priv->short_ref[i]; - } - SORT_REF_LIST(ref_list, n, poc_inc); - short_ref0_count += n; - } - - /* refFrameList1ShortTerm */ - if (priv->short_ref_count > 0) { - ref_list = short_ref1; - for (n = 0, i = 0; i < priv->short_ref_count; i++) { - if (priv->short_ref[i]->base.poc > picture->base.poc) - ref_list[n++] = priv->short_ref[i]; - } - SORT_REF_LIST(ref_list, n, poc_inc); - short_ref1_count += n; - - ref_list = &short_ref1[short_ref1_count]; - for (n = 0, i = 0; i < priv->short_ref_count; i++) { - if (priv->short_ref[i]->base.poc <= picture->base.poc) - ref_list[n++] = priv->short_ref[i]; - } - SORT_REF_LIST(ref_list, n, poc_dec); - short_ref1_count += n; - } - /* refFrameListLongTerm */ - if (priv->long_ref_count > 0) { - for (i = 0; i < priv->long_ref_count; i++) - long_ref[i] = priv->long_ref[i]; - SORT_REF_LIST(long_ref, i, long_term_frame_idx_inc); - long_ref_count = i; - } + /* RefPicList1 */ + if (priv->short_ref_count > 0) { + // 1. Short-term references + ref_list = priv->RefPicList1; + for (n = 0, i = 0; i < priv->short_ref_count; i++) { + if (priv->short_ref[i]->base.poc > picture->base.poc) + ref_list[n++] = priv->short_ref[i]; + } + SORT_REF_LIST (ref_list, n, poc_inc); + priv->RefPicList1_count += n; + + ref_list = &priv->RefPicList1[priv->RefPicList1_count]; + for (n = 0, i = 0; i < priv->short_ref_count; i++) { + if (priv->short_ref[i]->base.poc <= picture->base.poc) + ref_list[n++] = priv->short_ref[i]; + } + SORT_REF_LIST (ref_list, n, poc_dec); + priv->RefPicList1_count += n; + } + + if (priv->long_ref_count > 0) { + // 2. Long-term references + ref_list = &priv->RefPicList1[priv->RefPicList1_count]; + for (n = 0, i = 0; i < priv->long_ref_count; i++) + ref_list[n++] = priv->long_ref[i]; + SORT_REF_LIST (ref_list, n, long_term_pic_num_inc); + priv->RefPicList1_count += n; + } + } else { + /* 8.2.4.2.4 - B slices in fields */ + GstVaapiPictureH264 *short_ref0[32]; + guint short_ref0_count = 0; + GstVaapiPictureH264 *short_ref1[32]; + guint short_ref1_count = 0; + GstVaapiPictureH264 *long_ref[32]; + guint long_ref_count = 0; + + /* refFrameList0ShortTerm */ + if (priv->short_ref_count > 0) { + ref_list = short_ref0; + for (n = 0, i = 0; i < priv->short_ref_count; i++) { + if (priv->short_ref[i]->base.poc <= picture->base.poc) + ref_list[n++] = priv->short_ref[i]; + } + SORT_REF_LIST (ref_list, n, poc_dec); + short_ref0_count += n; + + ref_list = &short_ref0[short_ref0_count]; + for (n = 0, i = 0; i < priv->short_ref_count; i++) { + if (priv->short_ref[i]->base.poc > picture->base.poc) + ref_list[n++] = priv->short_ref[i]; + } + SORT_REF_LIST (ref_list, n, poc_inc); + short_ref0_count += n; + } + + /* refFrameList1ShortTerm */ + if (priv->short_ref_count > 0) { + ref_list = short_ref1; + for (n = 0, i = 0; i < priv->short_ref_count; i++) { + if (priv->short_ref[i]->base.poc > picture->base.poc) + ref_list[n++] = priv->short_ref[i]; + } + SORT_REF_LIST (ref_list, n, poc_inc); + short_ref1_count += n; + + ref_list = &short_ref1[short_ref1_count]; + for (n = 0, i = 0; i < priv->short_ref_count; i++) { + if (priv->short_ref[i]->base.poc <= picture->base.poc) + ref_list[n++] = priv->short_ref[i]; + } + SORT_REF_LIST (ref_list, n, poc_dec); + short_ref1_count += n; + } + + /* refFrameListLongTerm */ + if (priv->long_ref_count > 0) { + for (i = 0; i < priv->long_ref_count; i++) + long_ref[i] = priv->long_ref[i]; + SORT_REF_LIST (long_ref, i, long_term_frame_idx_inc); + long_ref_count = i; + } + + init_picture_refs_fields (picture, + priv->RefPicList0, &priv->RefPicList0_count, + short_ref0, short_ref0_count, long_ref, long_ref_count); + + init_picture_refs_fields (picture, + priv->RefPicList1, &priv->RefPicList1_count, + short_ref1, short_ref1_count, long_ref, long_ref_count); + } + + /* Check whether RefPicList1 is identical to RefPicList0, then + swap if necessary */ + if (priv->RefPicList1_count > 1 && + priv->RefPicList1_count == priv->RefPicList0_count && + memcmp (priv->RefPicList0, priv->RefPicList1, + priv->RefPicList0_count * sizeof (priv->RefPicList0[0])) == 0) { + GstVaapiPictureH264 *const tmp = priv->RefPicList1[0]; + priv->RefPicList1[0] = priv->RefPicList1[1]; + priv->RefPicList1[1] = tmp; + } - init_picture_refs_fields( - picture, - priv->RefPicList0, &priv->RefPicList0_count, - short_ref0, short_ref0_count, - long_ref, long_ref_count - ); - - init_picture_refs_fields( - picture, - priv->RefPicList1, &priv->RefPicList1_count, - short_ref1, short_ref1_count, - long_ref, long_ref_count - ); - } - - /* Check whether RefPicList1 is identical to RefPicList0, then - swap if necessary */ - if (priv->RefPicList1_count > 1 && - priv->RefPicList1_count == priv->RefPicList0_count && - memcmp(priv->RefPicList0, priv->RefPicList1, - priv->RefPicList0_count * sizeof(priv->RefPicList0[0])) == 0) { - GstVaapiPictureH264 * const tmp = priv->RefPicList1[0]; - priv->RefPicList1[0] = priv->RefPicList1[1]; - priv->RefPicList1[1] = tmp; - } - - if (GST_VAAPI_PICTURE_IS_MVC(picture)) { - /* RefPicList0 */ - init_picture_refs_mvc(decoder, picture, slice_hdr, 0); + if (GST_VAAPI_PICTURE_IS_MVC (picture)) { + /* RefPicList0 */ + init_picture_refs_mvc (decoder, picture, slice_hdr, 0); - /* RefPicList1 */ - init_picture_refs_mvc(decoder, picture, slice_hdr, 1); - } + /* RefPicList1 */ + init_picture_refs_mvc (decoder, picture, slice_hdr, 1); + } } #undef SORT_REF_LIST static gint -find_short_term_reference(GstVaapiDecoderH264 *decoder, gint32 pic_num) +find_short_term_reference (GstVaapiDecoderH264 * decoder, gint32 pic_num) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - guint i; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + guint i; - for (i = 0; i < priv->short_ref_count; i++) { - if (priv->short_ref[i]->pic_num == pic_num) - return i; - } - GST_ERROR("found no short-term reference picture with PicNum = %d", - pic_num); - return -1; + for (i = 0; i < priv->short_ref_count; i++) { + if (priv->short_ref[i]->pic_num == pic_num) + return i; + } + GST_ERROR ("found no short-term reference picture with PicNum = %d", pic_num); + return -1; } static gint -find_long_term_reference(GstVaapiDecoderH264 *decoder, gint32 long_term_pic_num) +find_long_term_reference (GstVaapiDecoderH264 * decoder, + gint32 long_term_pic_num) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - guint i; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + guint i; - for (i = 0; i < priv->long_ref_count; i++) { - if (priv->long_ref[i]->long_term_pic_num == long_term_pic_num) - return i; - } - GST_ERROR("found no long-term reference picture with LongTermPicNum = %d", - long_term_pic_num); - return -1; + for (i = 0; i < priv->long_ref_count; i++) { + if (priv->long_ref[i]->long_term_pic_num == long_term_pic_num) + return i; + } + GST_ERROR ("found no long-term reference picture with LongTermPicNum = %d", + long_term_pic_num); + return -1; } static void -exec_picture_refs_modification_1( - GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, - GstH264SliceHdr *slice_hdr, - guint list -) -{ - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstH264SPS * const sps = get_sps(decoder); - GstH264RefPicListModification *ref_pic_list_modification; - guint num_ref_pic_list_modifications; - GstVaapiPictureH264 **ref_list; - guint *ref_list_count_ptr, ref_list_idx = 0; - const guint16 *view_ids = NULL; - guint i, j, n, num_refs, num_view_ids = 0; - gint found_ref_idx; - gint32 MaxPicNum, CurrPicNum, picNumPred, picViewIdxPred; - - GST_DEBUG("modification process of reference picture list %u", list); - - if (list == 0) { - ref_pic_list_modification = slice_hdr->ref_pic_list_modification_l0; - num_ref_pic_list_modifications = slice_hdr->n_ref_pic_list_modification_l0; - ref_list = priv->RefPicList0; - ref_list_count_ptr = &priv->RefPicList0_count; - num_refs = slice_hdr->num_ref_idx_l0_active_minus1 + 1; - - if (GST_VAAPI_PICTURE_IS_MVC(picture) && - sps->extension_type == GST_H264_NAL_EXTENSION_MVC) { - const GstH264SPSExtMVCView * const view = - &sps->extension.mvc.view[picture->base.voc]; - if (GST_VAAPI_PICTURE_IS_ANCHOR(picture)) { - view_ids = view->anchor_ref_l0; - num_view_ids = view->num_anchor_refs_l0; - } - else { - view_ids = view->non_anchor_ref_l0; - num_view_ids = view->num_non_anchor_refs_l0; - } - } - } - else { - ref_pic_list_modification = slice_hdr->ref_pic_list_modification_l1; - num_ref_pic_list_modifications = slice_hdr->n_ref_pic_list_modification_l1; - ref_list = priv->RefPicList1; - ref_list_count_ptr = &priv->RefPicList1_count; - num_refs = slice_hdr->num_ref_idx_l1_active_minus1 + 1; - - if (GST_VAAPI_PICTURE_IS_MVC(picture) && - sps->extension_type == GST_H264_NAL_EXTENSION_MVC) { - const GstH264SPSExtMVCView * const view = - &sps->extension.mvc.view[picture->base.voc]; - if (GST_VAAPI_PICTURE_IS_ANCHOR(picture)) { - view_ids = view->anchor_ref_l1; - num_view_ids = view->num_anchor_refs_l1; - } - else { - view_ids = view->non_anchor_ref_l1; - num_view_ids = view->num_non_anchor_refs_l1; - } - } - } - - if (!GST_VAAPI_PICTURE_IS_FRAME(picture)) { - MaxPicNum = 1 << (sps->log2_max_frame_num_minus4 + 5); // 2 * MaxFrameNum - CurrPicNum = 2 * slice_hdr->frame_num + 1; // 2 * frame_num + 1 - } - else { - MaxPicNum = 1 << (sps->log2_max_frame_num_minus4 + 4); // MaxFrameNum - CurrPicNum = slice_hdr->frame_num; // frame_num - } - - picNumPred = CurrPicNum; - picViewIdxPred = -1; - - for (i = 0; i < num_ref_pic_list_modifications; i++) { - GstH264RefPicListModification * const l = &ref_pic_list_modification[i]; - if (l->modification_of_pic_nums_idc == 3) - break; - - /* 8.2.4.3.1 - Short-term reference pictures */ - if (l->modification_of_pic_nums_idc == 0 || l->modification_of_pic_nums_idc == 1) { - gint32 abs_diff_pic_num = l->value.abs_diff_pic_num_minus1 + 1; - gint32 picNum, picNumNoWrap; - - // (8-34) - if (l->modification_of_pic_nums_idc == 0) { - picNumNoWrap = picNumPred - abs_diff_pic_num; - if (picNumNoWrap < 0) - picNumNoWrap += MaxPicNum; - } - - // (8-35) - else { - picNumNoWrap = picNumPred + abs_diff_pic_num; - if (picNumNoWrap >= MaxPicNum) - picNumNoWrap -= MaxPicNum; - } - picNumPred = picNumNoWrap; - - // (8-36) - picNum = picNumNoWrap; - if (picNum > CurrPicNum) - picNum -= MaxPicNum; - - // (8-37) - for (j = num_refs; j > ref_list_idx; j--) - ref_list[j] = ref_list[j - 1]; - found_ref_idx = find_short_term_reference(decoder, picNum); - ref_list[ref_list_idx++] = - found_ref_idx >= 0 ? priv->short_ref[found_ref_idx] : NULL; - n = ref_list_idx; - for (j = ref_list_idx; j <= num_refs; j++) { - gint32 PicNumF; - if (!ref_list[j]) - continue; - PicNumF = - GST_VAAPI_PICTURE_IS_SHORT_TERM_REFERENCE(ref_list[j]) ? - ref_list[j]->pic_num : MaxPicNum; - if (PicNumF != picNum || - ref_list[j]->base.view_id != picture->base.view_id) - ref_list[n++] = ref_list[j]; - } - } - - /* 8.2.4.3.2 - Long-term reference pictures */ - else if (l->modification_of_pic_nums_idc == 2) { - - for (j = num_refs; j > ref_list_idx; j--) - ref_list[j] = ref_list[j - 1]; - found_ref_idx = - find_long_term_reference(decoder, l->value.long_term_pic_num); - ref_list[ref_list_idx++] = - found_ref_idx >= 0 ? priv->long_ref[found_ref_idx] : NULL; - n = ref_list_idx; - for (j = ref_list_idx; j <= num_refs; j++) { - gint32 LongTermPicNumF; - if (!ref_list[j]) - continue; - LongTermPicNumF = - GST_VAAPI_PICTURE_IS_LONG_TERM_REFERENCE(ref_list[j]) ? - ref_list[j]->long_term_pic_num : INT_MAX; - if (LongTermPicNumF != l->value.long_term_pic_num || - ref_list[j]->base.view_id != picture->base.view_id) - ref_list[n++] = ref_list[j]; - } - } - - /* H.8.2.2.3 - Inter-view prediction reference pictures */ - else if ((GST_VAAPI_PICTURE_IS_MVC(picture) && - sps->extension_type == GST_H264_NAL_EXTENSION_MVC) && - (l->modification_of_pic_nums_idc == 4 || - l->modification_of_pic_nums_idc == 5)) { - gint32 abs_diff_view_idx = l->value.abs_diff_view_idx_minus1 + 1; - gint32 picViewIdx, targetViewId; - - // (H-6) - if (l->modification_of_pic_nums_idc == 4) { - picViewIdx = picViewIdxPred - abs_diff_view_idx; - if (picViewIdx < 0) - picViewIdx += num_view_ids; - } - - // (H-7) - else { - picViewIdx = picViewIdxPred + abs_diff_view_idx; - if (picViewIdx >= num_view_ids) - picViewIdx -= num_view_ids; - } - picViewIdxPred = picViewIdx; - - // (H-8, H-9) - targetViewId = view_ids[picViewIdx]; - - // (H-10) - for (j = num_refs; j > ref_list_idx; j--) - ref_list[j] = ref_list[j - 1]; - ref_list[ref_list_idx++] = - find_inter_view_reference(decoder, targetViewId); - n = ref_list_idx; - for (j = ref_list_idx; j <= num_refs; j++) { - if (!ref_list[j]) - continue; - if (ref_list[j]->base.view_id != targetViewId || - ref_list[j]->base.poc != picture->base.poc) - ref_list[n++] = ref_list[j]; - } - } +exec_picture_refs_modification_1 (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, GstH264SliceHdr * slice_hdr, guint list) +{ + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstH264SPS *const sps = get_sps (decoder); + GstH264RefPicListModification *ref_pic_list_modification; + guint num_ref_pic_list_modifications; + GstVaapiPictureH264 **ref_list; + guint *ref_list_count_ptr, ref_list_idx = 0; + const guint16 *view_ids = NULL; + guint i, j, n, num_refs, num_view_ids = 0; + gint found_ref_idx; + gint32 MaxPicNum, CurrPicNum, picNumPred, picViewIdxPred; + + GST_DEBUG ("modification process of reference picture list %u", list); + + if (list == 0) { + ref_pic_list_modification = slice_hdr->ref_pic_list_modification_l0; + num_ref_pic_list_modifications = slice_hdr->n_ref_pic_list_modification_l0; + ref_list = priv->RefPicList0; + ref_list_count_ptr = &priv->RefPicList0_count; + num_refs = slice_hdr->num_ref_idx_l0_active_minus1 + 1; + + if (GST_VAAPI_PICTURE_IS_MVC (picture) && + sps->extension_type == GST_H264_NAL_EXTENSION_MVC) { + const GstH264SPSExtMVCView *const view = + &sps->extension.mvc.view[picture->base.voc]; + if (GST_VAAPI_PICTURE_IS_ANCHOR (picture)) { + view_ids = view->anchor_ref_l0; + num_view_ids = view->num_anchor_refs_l0; + } else { + view_ids = view->non_anchor_ref_l0; + num_view_ids = view->num_non_anchor_refs_l0; + } + } + } else { + ref_pic_list_modification = slice_hdr->ref_pic_list_modification_l1; + num_ref_pic_list_modifications = slice_hdr->n_ref_pic_list_modification_l1; + ref_list = priv->RefPicList1; + ref_list_count_ptr = &priv->RefPicList1_count; + num_refs = slice_hdr->num_ref_idx_l1_active_minus1 + 1; + + if (GST_VAAPI_PICTURE_IS_MVC (picture) && + sps->extension_type == GST_H264_NAL_EXTENSION_MVC) { + const GstH264SPSExtMVCView *const view = + &sps->extension.mvc.view[picture->base.voc]; + if (GST_VAAPI_PICTURE_IS_ANCHOR (picture)) { + view_ids = view->anchor_ref_l1; + num_view_ids = view->num_anchor_refs_l1; + } else { + view_ids = view->non_anchor_ref_l1; + num_view_ids = view->num_non_anchor_refs_l1; + } + } + } + + if (!GST_VAAPI_PICTURE_IS_FRAME (picture)) { + MaxPicNum = 1 << (sps->log2_max_frame_num_minus4 + 5); // 2 * MaxFrameNum + CurrPicNum = 2 * slice_hdr->frame_num + 1; // 2 * frame_num + 1 + } else { + MaxPicNum = 1 << (sps->log2_max_frame_num_minus4 + 4); // MaxFrameNum + CurrPicNum = slice_hdr->frame_num; // frame_num + } + + picNumPred = CurrPicNum; + picViewIdxPred = -1; + + for (i = 0; i < num_ref_pic_list_modifications; i++) { + GstH264RefPicListModification *const l = &ref_pic_list_modification[i]; + if (l->modification_of_pic_nums_idc == 3) + break; + + /* 8.2.4.3.1 - Short-term reference pictures */ + if (l->modification_of_pic_nums_idc == 0 + || l->modification_of_pic_nums_idc == 1) { + gint32 abs_diff_pic_num = l->value.abs_diff_pic_num_minus1 + 1; + gint32 picNum, picNumNoWrap; + + // (8-34) + if (l->modification_of_pic_nums_idc == 0) { + picNumNoWrap = picNumPred - abs_diff_pic_num; + if (picNumNoWrap < 0) + picNumNoWrap += MaxPicNum; + } + // (8-35) + else { + picNumNoWrap = picNumPred + abs_diff_pic_num; + if (picNumNoWrap >= MaxPicNum) + picNumNoWrap -= MaxPicNum; + } + picNumPred = picNumNoWrap; + + // (8-36) + picNum = picNumNoWrap; + if (picNum > CurrPicNum) + picNum -= MaxPicNum; + + // (8-37) + for (j = num_refs; j > ref_list_idx; j--) + ref_list[j] = ref_list[j - 1]; + found_ref_idx = find_short_term_reference (decoder, picNum); + ref_list[ref_list_idx++] = + found_ref_idx >= 0 ? priv->short_ref[found_ref_idx] : NULL; + n = ref_list_idx; + for (j = ref_list_idx; j <= num_refs; j++) { + gint32 PicNumF; + if (!ref_list[j]) + continue; + PicNumF = + GST_VAAPI_PICTURE_IS_SHORT_TERM_REFERENCE (ref_list[j]) ? + ref_list[j]->pic_num : MaxPicNum; + if (PicNumF != picNum || + ref_list[j]->base.view_id != picture->base.view_id) + ref_list[n++] = ref_list[j]; + } + } + + /* 8.2.4.3.2 - Long-term reference pictures */ + else if (l->modification_of_pic_nums_idc == 2) { + + for (j = num_refs; j > ref_list_idx; j--) + ref_list[j] = ref_list[j - 1]; + found_ref_idx = + find_long_term_reference (decoder, l->value.long_term_pic_num); + ref_list[ref_list_idx++] = + found_ref_idx >= 0 ? priv->long_ref[found_ref_idx] : NULL; + n = ref_list_idx; + for (j = ref_list_idx; j <= num_refs; j++) { + gint32 LongTermPicNumF; + if (!ref_list[j]) + continue; + LongTermPicNumF = + GST_VAAPI_PICTURE_IS_LONG_TERM_REFERENCE (ref_list[j]) ? + ref_list[j]->long_term_pic_num : INT_MAX; + if (LongTermPicNumF != l->value.long_term_pic_num || + ref_list[j]->base.view_id != picture->base.view_id) + ref_list[n++] = ref_list[j]; + } + } + + /* H.8.2.2.3 - Inter-view prediction reference pictures */ + else if ((GST_VAAPI_PICTURE_IS_MVC (picture) && + sps->extension_type == GST_H264_NAL_EXTENSION_MVC) && + (l->modification_of_pic_nums_idc == 4 || + l->modification_of_pic_nums_idc == 5)) { + gint32 abs_diff_view_idx = l->value.abs_diff_view_idx_minus1 + 1; + gint32 picViewIdx, targetViewId; + + // (H-6) + if (l->modification_of_pic_nums_idc == 4) { + picViewIdx = picViewIdxPred - abs_diff_view_idx; + if (picViewIdx < 0) + picViewIdx += num_view_ids; + } + // (H-7) + else { + picViewIdx = picViewIdxPred + abs_diff_view_idx; + if (picViewIdx >= num_view_ids) + picViewIdx -= num_view_ids; + } + picViewIdxPred = picViewIdx; + + // (H-8, H-9) + targetViewId = view_ids[picViewIdx]; + + // (H-10) + for (j = num_refs; j > ref_list_idx; j--) + ref_list[j] = ref_list[j - 1]; + ref_list[ref_list_idx++] = + find_inter_view_reference (decoder, targetViewId); + n = ref_list_idx; + for (j = ref_list_idx; j <= num_refs; j++) { + if (!ref_list[j]) + continue; + if (ref_list[j]->base.view_id != targetViewId || + ref_list[j]->base.poc != picture->base.poc) + ref_list[n++] = ref_list[j]; + } } + } #if DEBUG - for (i = 0; i < num_refs; i++) - if (!ref_list[i]) - GST_ERROR("list %u entry %u is empty", list, i); + for (i = 0; i < num_refs; i++) + if (!ref_list[i]) + GST_ERROR ("list %u entry %u is empty", list, i); #endif - *ref_list_count_ptr = num_refs; + *ref_list_count_ptr = num_refs; } /* 8.2.4.3 - Modification process for reference picture lists */ static void -exec_picture_refs_modification( - GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, - GstH264SliceHdr *slice_hdr -) +exec_picture_refs_modification (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, GstH264SliceHdr * slice_hdr) { - GST_DEBUG("execute ref_pic_list_modification()"); - - /* RefPicList0 */ - if (!GST_H264_IS_I_SLICE(slice_hdr) && !GST_H264_IS_SI_SLICE(slice_hdr) && - slice_hdr->ref_pic_list_modification_flag_l0) - exec_picture_refs_modification_1(decoder, picture, slice_hdr, 0); + GST_DEBUG ("execute ref_pic_list_modification()"); - /* RefPicList1 */ - if (GST_H264_IS_B_SLICE(slice_hdr) && - slice_hdr->ref_pic_list_modification_flag_l1) - exec_picture_refs_modification_1(decoder, picture, slice_hdr, 1); + /* RefPicList0 */ + if (!GST_H264_IS_I_SLICE (slice_hdr) && !GST_H264_IS_SI_SLICE (slice_hdr) && + slice_hdr->ref_pic_list_modification_flag_l0) + exec_picture_refs_modification_1 (decoder, picture, slice_hdr, 0); + + /* RefPicList1 */ + if (GST_H264_IS_B_SLICE (slice_hdr) && + slice_hdr->ref_pic_list_modification_flag_l1) + exec_picture_refs_modification_1 (decoder, picture, slice_hdr, 1); } static gboolean -check_picture_ref_corruption(GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *RefPicList[32], guint RefPicList_count) +check_picture_ref_corruption (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * RefPicList[32], guint RefPicList_count) { - const guint corrupted_flags = - GST_VAAPI_PICTURE_FLAG_CORRUPTED | GST_VAAPI_PICTURE_FLAG_GHOST; - guint i; - - for (i = 0; i < RefPicList_count; i++) { - GstVaapiPictureH264 * const picture = RefPicList[i]; - if (picture && (GST_VAAPI_PICTURE_FLAGS(picture) & corrupted_flags)) - return TRUE; - } - return FALSE; + const guint corrupted_flags = + GST_VAAPI_PICTURE_FLAG_CORRUPTED | GST_VAAPI_PICTURE_FLAG_GHOST; + guint i; + + for (i = 0; i < RefPicList_count; i++) { + GstVaapiPictureH264 *const picture = RefPicList[i]; + if (picture && (GST_VAAPI_PICTURE_FLAGS (picture) & corrupted_flags)) + return TRUE; + } + return FALSE; } static void -mark_picture_refs(GstVaapiDecoderH264 *decoder, GstVaapiPictureH264 *picture) +mark_picture_refs (GstVaapiDecoderH264 * decoder, GstVaapiPictureH264 * picture) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; + GstVaapiDecoderH264Private *const priv = &decoder->priv; - if (GST_VAAPI_PICTURE_IS_CORRUPTED(picture)) - return; + if (GST_VAAPI_PICTURE_IS_CORRUPTED (picture)) + return; - if (check_picture_ref_corruption(decoder, - priv->RefPicList0, priv->RefPicList0_count) || - check_picture_ref_corruption(decoder, - priv->RefPicList1, priv->RefPicList1_count)) - GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_CORRUPTED); + if (check_picture_ref_corruption (decoder, + priv->RefPicList0, priv->RefPicList0_count) || + check_picture_ref_corruption (decoder, + priv->RefPicList1, priv->RefPicList1_count)) + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_CORRUPTED); } static void -init_picture_ref_lists(GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture) +init_picture_ref_lists (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - guint i, j, short_ref_count, long_ref_count; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + guint i, j, short_ref_count, long_ref_count; - short_ref_count = 0; - long_ref_count = 0; - if (GST_VAAPI_PICTURE_IS_FRAME(picture)) { - for (i = 0; i < priv->dpb_count; i++) { - GstVaapiFrameStore * const fs = priv->dpb[i]; - GstVaapiPictureH264 *pic; - if (!gst_vaapi_frame_store_has_frame(fs)) - continue; - pic = fs->buffers[0]; - if (pic->base.view_id != picture->base.view_id) - continue; - if (GST_VAAPI_PICTURE_IS_SHORT_TERM_REFERENCE(pic)) - priv->short_ref[short_ref_count++] = pic; - else if (GST_VAAPI_PICTURE_IS_LONG_TERM_REFERENCE(pic)) - priv->long_ref[long_ref_count++] = pic; - pic->structure = GST_VAAPI_PICTURE_STRUCTURE_FRAME; - pic->other_field = fs->buffers[1]; - } - } - else { - for (i = 0; i < priv->dpb_count; i++) { - GstVaapiFrameStore * const fs = priv->dpb[i]; - for (j = 0; j < fs->num_buffers; j++) { - GstVaapiPictureH264 * const pic = fs->buffers[j]; - if (pic->base.view_id != picture->base.view_id) - continue; - if (GST_VAAPI_PICTURE_IS_SHORT_TERM_REFERENCE(pic)) - priv->short_ref[short_ref_count++] = pic; - else if (GST_VAAPI_PICTURE_IS_LONG_TERM_REFERENCE(pic)) - priv->long_ref[long_ref_count++] = pic; - pic->structure = pic->base.structure; - pic->other_field = fs->buffers[j ^ 1]; - } - } + short_ref_count = 0; + long_ref_count = 0; + if (GST_VAAPI_PICTURE_IS_FRAME (picture)) { + for (i = 0; i < priv->dpb_count; i++) { + GstVaapiFrameStore *const fs = priv->dpb[i]; + GstVaapiPictureH264 *pic; + if (!gst_vaapi_frame_store_has_frame (fs)) + continue; + pic = fs->buffers[0]; + if (pic->base.view_id != picture->base.view_id) + continue; + if (GST_VAAPI_PICTURE_IS_SHORT_TERM_REFERENCE (pic)) + priv->short_ref[short_ref_count++] = pic; + else if (GST_VAAPI_PICTURE_IS_LONG_TERM_REFERENCE (pic)) + priv->long_ref[long_ref_count++] = pic; + pic->structure = GST_VAAPI_PICTURE_STRUCTURE_FRAME; + pic->other_field = fs->buffers[1]; } - - for (i = short_ref_count; i < priv->short_ref_count; i++) - priv->short_ref[i] = NULL; - priv->short_ref_count = short_ref_count; - - for (i = long_ref_count; i < priv->long_ref_count; i++) - priv->long_ref[i] = NULL; - priv->long_ref_count = long_ref_count; + } else { + for (i = 0; i < priv->dpb_count; i++) { + GstVaapiFrameStore *const fs = priv->dpb[i]; + for (j = 0; j < fs->num_buffers; j++) { + GstVaapiPictureH264 *const pic = fs->buffers[j]; + if (pic->base.view_id != picture->base.view_id) + continue; + if (GST_VAAPI_PICTURE_IS_SHORT_TERM_REFERENCE (pic)) + priv->short_ref[short_ref_count++] = pic; + else if (GST_VAAPI_PICTURE_IS_LONG_TERM_REFERENCE (pic)) + priv->long_ref[long_ref_count++] = pic; + pic->structure = pic->base.structure; + pic->other_field = fs->buffers[j ^ 1]; + } + } + } + + for (i = short_ref_count; i < priv->short_ref_count; i++) + priv->short_ref[i] = NULL; + priv->short_ref_count = short_ref_count; + + for (i = long_ref_count; i < priv->long_ref_count; i++) + priv->long_ref[i] = NULL; + priv->long_ref_count = long_ref_count; } static void -init_picture_refs( - GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, - GstH264SliceHdr *slice_hdr -) -{ - GstVaapiDecoderH264Private * const priv = &decoder->priv; - guint i, num_refs; +init_picture_refs (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, GstH264SliceHdr * slice_hdr) +{ + GstVaapiDecoderH264Private *const priv = &decoder->priv; + guint i, num_refs; - init_picture_ref_lists(decoder, picture); - init_picture_refs_pic_num(decoder, picture, slice_hdr); + init_picture_ref_lists (decoder, picture); + init_picture_refs_pic_num (decoder, picture, slice_hdr); - priv->RefPicList0_count = 0; - priv->RefPicList1_count = 0; + priv->RefPicList0_count = 0; + priv->RefPicList1_count = 0; - switch (slice_hdr->type % 5) { + switch (slice_hdr->type % 5) { case GST_H264_P_SLICE: case GST_H264_SP_SLICE: - init_picture_refs_p_slice(decoder, picture, slice_hdr); - break; + init_picture_refs_p_slice (decoder, picture, slice_hdr); + break; case GST_H264_B_SLICE: - init_picture_refs_b_slice(decoder, picture, slice_hdr); - break; + init_picture_refs_b_slice (decoder, picture, slice_hdr); + break; default: - break; - } + break; + } - exec_picture_refs_modification(decoder, picture, slice_hdr); + exec_picture_refs_modification (decoder, picture, slice_hdr); - switch (slice_hdr->type % 5) { + switch (slice_hdr->type % 5) { case GST_H264_B_SLICE: - num_refs = 1 + slice_hdr->num_ref_idx_l1_active_minus1; - for (i = priv->RefPicList1_count; i < num_refs; i++) - priv->RefPicList1[i] = NULL; - priv->RefPicList1_count = num_refs; + num_refs = 1 + slice_hdr->num_ref_idx_l1_active_minus1; + for (i = priv->RefPicList1_count; i < num_refs; i++) + priv->RefPicList1[i] = NULL; + priv->RefPicList1_count = num_refs; - // fall-through + // fall-through case GST_H264_P_SLICE: case GST_H264_SP_SLICE: - num_refs = 1 + slice_hdr->num_ref_idx_l0_active_minus1; - for (i = priv->RefPicList0_count; i < num_refs; i++) - priv->RefPicList0[i] = NULL; - priv->RefPicList0_count = num_refs; - break; + num_refs = 1 + slice_hdr->num_ref_idx_l0_active_minus1; + for (i = priv->RefPicList0_count; i < num_refs; i++) + priv->RefPicList0[i] = NULL; + priv->RefPicList0_count = num_refs; + break; default: - break; - } + break; + } - mark_picture_refs(decoder, picture); + mark_picture_refs (decoder, picture); } static GstVaapiPictureH264 * -fill_picture_first_field_gap(GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *f0) +fill_picture_first_field_gap (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * f0) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiPictureH264 *f1; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiPictureH264 *f1; - f1 = gst_vaapi_picture_h264_new_clone(f0); - if (!f1) - goto error_allocate_field; + f1 = gst_vaapi_picture_h264_new_clone (f0); + if (!f1) + goto error_allocate_field; - gst_vaapi_picture_replace(&priv->missing_picture, f1); - gst_vaapi_picture_unref(f1); + gst_vaapi_picture_replace (&priv->missing_picture, f1); + gst_vaapi_picture_unref (f1); - GST_VAAPI_PICTURE_FLAG_SET(f1, - (GST_VAAPI_PICTURE_FLAG_ONEFIELD | - GST_VAAPI_PICTURE_FLAG_SKIPPED | - GST_VAAPI_PICTURE_FLAG_GHOST)); + GST_VAAPI_PICTURE_FLAG_SET (f1, + (GST_VAAPI_PICTURE_FLAG_ONEFIELD | + GST_VAAPI_PICTURE_FLAG_SKIPPED | GST_VAAPI_PICTURE_FLAG_GHOST)); - gst_vaapi_picture_h264_set_reference(f1, 0, FALSE); - return f1; + gst_vaapi_picture_h264_set_reference (f1, 0, FALSE); + return f1; - /* ERRORS */ + /* ERRORS */ error_allocate_field: - GST_ERROR("failed to allocate missing field for current frame store"); - return NULL; + GST_ERROR ("failed to allocate missing field for current frame store"); + return NULL; } static gboolean -fill_picture_first_field_gap_done(GstVaapiDecoderH264 *decoder, - GstH264SliceHdr *slice_hdr) +fill_picture_first_field_gap_done (GstVaapiDecoderH264 * decoder, + GstH264SliceHdr * slice_hdr) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiPictureH264 * const lost_field = priv->missing_picture; - GstH264SliceHdr lost_slice_hdr; - gboolean success = FALSE; - - g_return_val_if_fail(priv->current_picture != NULL, FALSE); - - if (!lost_field) - return TRUE; - - lost_field->frame_num = slice_hdr->frame_num; - lost_field->frame_num_wrap = slice_hdr->frame_num; - - gst_vaapi_picture_h264_set_reference(lost_field, - (GST_VAAPI_PICTURE_FLAGS(priv->current_picture) & - GST_VAAPI_PICTURE_FLAGS_REFERENCE), FALSE); - - lost_slice_hdr = *slice_hdr; - lost_slice_hdr.bottom_field_flag = !lost_slice_hdr.bottom_field_flag; - - init_picture_poc(decoder, lost_field, &lost_slice_hdr); - init_picture_ref_lists(decoder, lost_field); - init_picture_refs_pic_num(decoder, lost_field, &lost_slice_hdr); - if (!exec_ref_pic_marking_sliding_window(decoder)) - goto error_exec_ref_pic_marking; - if (!dpb_add(decoder, lost_field)) - goto error_dpb_add; - success = TRUE; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiPictureH264 *const lost_field = priv->missing_picture; + GstH264SliceHdr lost_slice_hdr; + gboolean success = FALSE; + + g_return_val_if_fail (priv->current_picture != NULL, FALSE); + + if (!lost_field) + return TRUE; + + lost_field->frame_num = slice_hdr->frame_num; + lost_field->frame_num_wrap = slice_hdr->frame_num; + + gst_vaapi_picture_h264_set_reference (lost_field, + (GST_VAAPI_PICTURE_FLAGS (priv->current_picture) & + GST_VAAPI_PICTURE_FLAGS_REFERENCE), FALSE); + + lost_slice_hdr = *slice_hdr; + lost_slice_hdr.bottom_field_flag = !lost_slice_hdr.bottom_field_flag; + + init_picture_poc (decoder, lost_field, &lost_slice_hdr); + init_picture_ref_lists (decoder, lost_field); + init_picture_refs_pic_num (decoder, lost_field, &lost_slice_hdr); + if (!exec_ref_pic_marking_sliding_window (decoder)) + goto error_exec_ref_pic_marking; + if (!dpb_add (decoder, lost_field)) + goto error_dpb_add; + success = TRUE; cleanup: - gst_vaapi_picture_replace(&priv->missing_picture, NULL); - return success; + gst_vaapi_picture_replace (&priv->missing_picture, NULL); + return success; - /* ERRORS */ + /* ERRORS */ error_exec_ref_pic_marking: - GST_ERROR("failed to execute reference picture marking process"); - goto cleanup; + GST_ERROR ("failed to execute reference picture marking process"); + goto cleanup; error_dpb_add: - GST_ERROR("failed to store lost picture into the DPB"); - goto cleanup; + GST_ERROR ("failed to store lost picture into the DPB"); + goto cleanup; } static GstVaapiPictureH264 * -fill_picture_other_field_gap(GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *f0) +fill_picture_other_field_gap (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * f0) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiPictureH264 *prev_picture, *f1; - gint prev_frame_index; - guint picture_structure; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiPictureH264 *prev_picture, *f1; + gint prev_frame_index; + guint picture_structure; - picture_structure = f0->base.structure; - switch (picture_structure) { + picture_structure = f0->base.structure; + switch (picture_structure) { case GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD: - picture_structure = GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD; - break; + picture_structure = GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD; + break; case GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD: - picture_structure = GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD; - break; + picture_structure = GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD; + break; default: - g_assert(0 && "unexpected picture structure"); - return NULL; - } - GST_VAAPI_PICTURE_FLAG_SET(f0, GST_VAAPI_PICTURE_FLAG_ONEFIELD); - - prev_frame_index = dpb_find_nearest_prev_poc(decoder, f0, - picture_structure, &prev_picture); - if (prev_frame_index < 0) - goto error_find_field; - - f1 = gst_vaapi_picture_h264_new_field(f0); - if (!f1) - goto error_allocate_field; - - gst_vaapi_surface_proxy_replace(&f1->base.proxy, prev_picture->base.proxy); - f1->base.surface = GST_VAAPI_SURFACE_PROXY_SURFACE(f1->base.proxy); - f1->base.surface_id = GST_VAAPI_SURFACE_PROXY_SURFACE_ID(f1->base.proxy); - f1->base.poc++; - f1->structure = f1->base.structure; - - /* XXX: clone other H.264 picture specific flags */ - GST_VAAPI_PICTURE_FLAG_SET(f1, - (GST_VAAPI_PICTURE_FLAG_SKIPPED | - GST_VAAPI_PICTURE_FLAG_GHOST)); - - gst_vaapi_picture_h264_set_reference(f1, 0, FALSE); - gst_vaapi_picture_replace(&priv->current_picture, f1); - gst_vaapi_picture_unref(f1); - - init_picture_ref_lists(decoder, f1); - init_picture_refs_pic_num(decoder, f1, NULL); - if (!exec_ref_pic_marking_sliding_window(decoder)) - goto error_exec_ref_pic_marking; - if (!dpb_add(decoder, f1)) - goto error_append_field; - return f1; + g_assert (0 && "unexpected picture structure"); + return NULL; + } + GST_VAAPI_PICTURE_FLAG_SET (f0, GST_VAAPI_PICTURE_FLAG_ONEFIELD); + + prev_frame_index = dpb_find_nearest_prev_poc (decoder, f0, + picture_structure, &prev_picture); + if (prev_frame_index < 0) + goto error_find_field; + + f1 = gst_vaapi_picture_h264_new_field (f0); + if (!f1) + goto error_allocate_field; + + gst_vaapi_surface_proxy_replace (&f1->base.proxy, prev_picture->base.proxy); + f1->base.surface = GST_VAAPI_SURFACE_PROXY_SURFACE (f1->base.proxy); + f1->base.surface_id = GST_VAAPI_SURFACE_PROXY_SURFACE_ID (f1->base.proxy); + f1->base.poc++; + f1->structure = f1->base.structure; + + /* XXX: clone other H.264 picture specific flags */ + GST_VAAPI_PICTURE_FLAG_SET (f1, + (GST_VAAPI_PICTURE_FLAG_SKIPPED | GST_VAAPI_PICTURE_FLAG_GHOST)); + + gst_vaapi_picture_h264_set_reference (f1, 0, FALSE); + gst_vaapi_picture_replace (&priv->current_picture, f1); + gst_vaapi_picture_unref (f1); + + init_picture_ref_lists (decoder, f1); + init_picture_refs_pic_num (decoder, f1, NULL); + if (!exec_ref_pic_marking_sliding_window (decoder)) + goto error_exec_ref_pic_marking; + if (!dpb_add (decoder, f1)) + goto error_append_field; + return f1; - /* ERRORS */ + /* ERRORS */ error_find_field: - GST_ERROR("failed to find field with POC nearest to %d", f0->base.poc); - return NULL; + GST_ERROR ("failed to find field with POC nearest to %d", f0->base.poc); + return NULL; error_allocate_field: - GST_ERROR("failed to allocate missing field for previous frame store"); - return NULL; + GST_ERROR ("failed to allocate missing field for previous frame store"); + return NULL; error_exec_ref_pic_marking: - GST_ERROR("failed to execute reference picture marking process"); - return NULL; + GST_ERROR ("failed to execute reference picture marking process"); + return NULL; error_append_field: - GST_ERROR("failed to add missing field into previous frame store"); - return NULL; + GST_ERROR ("failed to add missing field into previous frame store"); + return NULL; } static gboolean -fill_picture_gaps(GstVaapiDecoderH264 *decoder, GstVaapiPictureH264 *picture, - GstH264SliceHdr *slice_hdr) +fill_picture_gaps (GstVaapiDecoderH264 * decoder, GstVaapiPictureH264 * picture, + GstH264SliceHdr * slice_hdr) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstH264SPS * const sps = get_sps(decoder); - const gint32 MaxFrameNum = 1 << (sps->log2_max_frame_num_minus4 + 4); - GstVaapiFrameStore *prev_frame; - GstVaapiPicture *base_picture; - GstVaapiPictureH264 *lost_picture, *prev_picture; - GstH264SliceHdr lost_slice_hdr; - gboolean success = FALSE; - - if (priv->prev_ref_frame_num == priv->frame_num) - return TRUE; - if ((priv->prev_ref_frame_num + 1) % MaxFrameNum == priv->frame_num) - return TRUE; - if (priv->dpb_count == 0) - return TRUE; - - prev_frame = priv->prev_ref_frames[picture->base.voc]; - g_assert(prev_frame != NULL); - prev_picture = gst_vaapi_picture_ref(prev_frame->buffers[0]); - gst_vaapi_picture_ref(picture); - - lost_slice_hdr = *slice_hdr; - lost_slice_hdr.field_pic_flag = 0; - if (sps->pic_order_cnt_type == 1) { - lost_slice_hdr.delta_pic_order_cnt[0] = 0; - lost_slice_hdr.delta_pic_order_cnt[1] = 0; - } - lost_slice_hdr.dec_ref_pic_marking.adaptive_ref_pic_marking_mode_flag = 0; - - /* XXX: this process is incorrect for MVC */ - /* XXX: optimize to reduce the number of dummy pictures created */ - priv->frame_num = priv->prev_ref_frame_num; - for (;;) { - priv->prev_ref_frame_num = priv->frame_num; - priv->frame_num = (priv->prev_ref_frame_num + 1) % MaxFrameNum; - if (priv->frame_num == slice_hdr->frame_num) - break; - - /* Create new picture */ - if (prev_picture) - lost_picture = gst_vaapi_picture_h264_new_clone(prev_picture); - else - lost_picture = gst_vaapi_picture_h264_new(decoder); - if (!lost_picture) - goto error_allocate_picture; - - base_picture = &lost_picture->base; - base_picture->type = GST_VAAPI_PICTURE_TYPE_NONE; - base_picture->pts = GST_CLOCK_TIME_NONE; - base_picture->structure = GST_VAAPI_PICTURE_STRUCTURE_FRAME; - lost_picture->frame_num = priv->frame_num; - lost_picture->frame_num_wrap = priv->frame_num; - lost_picture->structure = base_picture->structure; - - GST_VAAPI_PICTURE_FLAG_SET(lost_picture, - (GST_VAAPI_PICTURE_FLAG_SKIPPED | - GST_VAAPI_PICTURE_FLAG_GHOST | - GST_VAAPI_PICTURE_FLAG_SHORT_TERM_REFERENCE)); - - if (sps->pic_order_cnt_type != 0) - init_picture_poc(decoder, lost_picture, &lost_slice_hdr); - else { - base_picture->poc = prev_picture->base.poc + 2; - if (prev_picture->field_poc[0] != G_MAXINT32) - lost_picture->field_poc[0] = prev_picture->field_poc[0] + 2; - if (prev_picture->field_poc[1] != G_MAXINT32) - lost_picture->field_poc[1] = prev_picture->field_poc[1] + 2; - } + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstH264SPS *const sps = get_sps (decoder); + const gint32 MaxFrameNum = 1 << (sps->log2_max_frame_num_minus4 + 4); + GstVaapiFrameStore *prev_frame; + GstVaapiPicture *base_picture; + GstVaapiPictureH264 *lost_picture, *prev_picture; + GstH264SliceHdr lost_slice_hdr; + gboolean success = FALSE; - gst_vaapi_picture_replace(&prev_picture, lost_picture); - gst_vaapi_picture_replace(&priv->current_picture, lost_picture); - gst_vaapi_picture_unref(lost_picture); - - init_picture_ref_lists(decoder, lost_picture); - init_picture_refs_pic_num(decoder, lost_picture, &lost_slice_hdr); - if (!exec_ref_pic_marking_sliding_window(decoder)) - goto error_exec_ref_pic_marking; - if (!dpb_add(decoder, lost_picture)) - goto error_dpb_add; - gst_vaapi_picture_replace(&priv->current_picture, NULL); - } - success = TRUE; + if (priv->prev_ref_frame_num == priv->frame_num) + return TRUE; + if ((priv->prev_ref_frame_num + 1) % MaxFrameNum == priv->frame_num) + return TRUE; + if (priv->dpb_count == 0) + return TRUE; + + prev_frame = priv->prev_ref_frames[picture->base.voc]; + g_assert (prev_frame != NULL); + prev_picture = gst_vaapi_picture_ref (prev_frame->buffers[0]); + gst_vaapi_picture_ref (picture); + + lost_slice_hdr = *slice_hdr; + lost_slice_hdr.field_pic_flag = 0; + if (sps->pic_order_cnt_type == 1) { + lost_slice_hdr.delta_pic_order_cnt[0] = 0; + lost_slice_hdr.delta_pic_order_cnt[1] = 0; + } + lost_slice_hdr.dec_ref_pic_marking.adaptive_ref_pic_marking_mode_flag = 0; + + /* XXX: this process is incorrect for MVC */ + /* XXX: optimize to reduce the number of dummy pictures created */ + priv->frame_num = priv->prev_ref_frame_num; + for (;;) { + priv->prev_ref_frame_num = priv->frame_num; + priv->frame_num = (priv->prev_ref_frame_num + 1) % MaxFrameNum; + if (priv->frame_num == slice_hdr->frame_num) + break; + + /* Create new picture */ + if (prev_picture) + lost_picture = gst_vaapi_picture_h264_new_clone (prev_picture); + else + lost_picture = gst_vaapi_picture_h264_new (decoder); + if (!lost_picture) + goto error_allocate_picture; + + base_picture = &lost_picture->base; + base_picture->type = GST_VAAPI_PICTURE_TYPE_NONE; + base_picture->pts = GST_CLOCK_TIME_NONE; + base_picture->structure = GST_VAAPI_PICTURE_STRUCTURE_FRAME; + lost_picture->frame_num = priv->frame_num; + lost_picture->frame_num_wrap = priv->frame_num; + lost_picture->structure = base_picture->structure; + + GST_VAAPI_PICTURE_FLAG_SET (lost_picture, + (GST_VAAPI_PICTURE_FLAG_SKIPPED | + GST_VAAPI_PICTURE_FLAG_GHOST | + GST_VAAPI_PICTURE_FLAG_SHORT_TERM_REFERENCE)); + + if (sps->pic_order_cnt_type != 0) + init_picture_poc (decoder, lost_picture, &lost_slice_hdr); + else { + base_picture->poc = prev_picture->base.poc + 2; + if (prev_picture->field_poc[0] != G_MAXINT32) + lost_picture->field_poc[0] = prev_picture->field_poc[0] + 2; + if (prev_picture->field_poc[1] != G_MAXINT32) + lost_picture->field_poc[1] = prev_picture->field_poc[1] + 2; + } + + gst_vaapi_picture_replace (&prev_picture, lost_picture); + gst_vaapi_picture_replace (&priv->current_picture, lost_picture); + gst_vaapi_picture_unref (lost_picture); + + init_picture_ref_lists (decoder, lost_picture); + init_picture_refs_pic_num (decoder, lost_picture, &lost_slice_hdr); + if (!exec_ref_pic_marking_sliding_window (decoder)) + goto error_exec_ref_pic_marking; + if (!dpb_add (decoder, lost_picture)) + goto error_dpb_add; + gst_vaapi_picture_replace (&priv->current_picture, NULL); + } + success = TRUE; cleanup: - priv->frame_num = slice_hdr->frame_num; - priv->prev_ref_frame_num = (priv->frame_num + MaxFrameNum - 1) % MaxFrameNum; - gst_vaapi_picture_replace(&prev_picture, NULL); - gst_vaapi_picture_replace(&priv->current_picture, picture); - gst_vaapi_picture_unref(picture); - return success; + priv->frame_num = slice_hdr->frame_num; + priv->prev_ref_frame_num = (priv->frame_num + MaxFrameNum - 1) % MaxFrameNum; + gst_vaapi_picture_replace (&prev_picture, NULL); + gst_vaapi_picture_replace (&priv->current_picture, picture); + gst_vaapi_picture_unref (picture); + return success; - /* ERRORS */ + /* ERRORS */ error_allocate_picture: - GST_ERROR("failed to allocate lost picture"); - goto cleanup; + GST_ERROR ("failed to allocate lost picture"); + goto cleanup; error_exec_ref_pic_marking: - GST_ERROR("failed to execute reference picture marking process"); - goto cleanup; + GST_ERROR ("failed to execute reference picture marking process"); + goto cleanup; error_dpb_add: - GST_ERROR("failed to store lost picture into the DPB"); - goto cleanup; + GST_ERROR ("failed to store lost picture into the DPB"); + goto cleanup; } static gboolean -init_picture( - GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, GstVaapiParserInfoH264 *pi) -{ - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiPicture * const base_picture = &picture->base; - GstH264SliceHdr * const slice_hdr = &pi->data.slice_hdr; - - if (priv->prev_pic_reference) - priv->prev_ref_frame_num = priv->frame_num; - priv->prev_frame_num = priv->frame_num; - priv->frame_num = slice_hdr->frame_num; - picture->frame_num = priv->frame_num; - picture->frame_num_wrap = priv->frame_num; - picture->output_flag = TRUE; /* XXX: conformant to Annex A only */ - base_picture->pts = GST_VAAPI_DECODER_CODEC_FRAME(decoder)->pts; - base_picture->type = GST_VAAPI_PICTURE_TYPE_NONE; - base_picture->view_id = pi->view_id; - base_picture->voc = pi->voc; - - /* Initialize extensions */ - switch (pi->nalu.extension_type) { - case GST_H264_NAL_EXTENSION_MVC: { - GstH264NalUnitExtensionMVC * const mvc = &pi->nalu.extension.mvc; - - GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_MVC); - if (mvc->inter_view_flag) - GST_VAAPI_PICTURE_FLAG_SET(picture, - GST_VAAPI_PICTURE_FLAG_INTER_VIEW); - if (mvc->anchor_pic_flag) - GST_VAAPI_PICTURE_FLAG_SET(picture, - GST_VAAPI_PICTURE_FLAG_ANCHOR); - break; - } - } - - /* Reset decoder state for IDR pictures */ - if (pi->nalu.idr_pic_flag) { - GST_DEBUG(""); - GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_IDR); - dpb_flush(decoder, picture); - } - else if (!fill_picture_gaps(decoder, picture, slice_hdr)) - return FALSE; +init_picture (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, GstVaapiParserInfoH264 * pi) +{ + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiPicture *const base_picture = &picture->base; + GstH264SliceHdr *const slice_hdr = &pi->data.slice_hdr; + + if (priv->prev_pic_reference) + priv->prev_ref_frame_num = priv->frame_num; + priv->prev_frame_num = priv->frame_num; + priv->frame_num = slice_hdr->frame_num; + picture->frame_num = priv->frame_num; + picture->frame_num_wrap = priv->frame_num; + picture->output_flag = TRUE; /* XXX: conformant to Annex A only */ + base_picture->pts = GST_VAAPI_DECODER_CODEC_FRAME (decoder)->pts; + base_picture->type = GST_VAAPI_PICTURE_TYPE_NONE; + base_picture->view_id = pi->view_id; + base_picture->voc = pi->voc; + + /* Initialize extensions */ + switch (pi->nalu.extension_type) { + case GST_H264_NAL_EXTENSION_MVC:{ + GstH264NalUnitExtensionMVC *const mvc = &pi->nalu.extension.mvc; + + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_MVC); + if (mvc->inter_view_flag) + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_INTER_VIEW); + if (mvc->anchor_pic_flag) + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_ANCHOR); + break; + } + } + + /* Reset decoder state for IDR pictures */ + if (pi->nalu.idr_pic_flag) { + GST_DEBUG (""); + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_IDR); + dpb_flush (decoder, picture); + } else if (!fill_picture_gaps (decoder, picture, slice_hdr)) + return FALSE; - /* Initialize picture structure */ - if (slice_hdr->field_pic_flag) { - GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_INTERLACED); - priv->pic_structure = slice_hdr->bottom_field_flag ? - GST_H264_SEI_PIC_STRUCT_BOTTOM_FIELD : - GST_H264_SEI_PIC_STRUCT_TOP_FIELD; - } + /* Initialize picture structure */ + if (slice_hdr->field_pic_flag) { + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_INTERLACED); + priv->pic_structure = slice_hdr->bottom_field_flag ? + GST_H264_SEI_PIC_STRUCT_BOTTOM_FIELD : + GST_H264_SEI_PIC_STRUCT_TOP_FIELD; + } - base_picture->structure = GST_VAAPI_PICTURE_STRUCTURE_FRAME; - switch (priv->pic_structure) { + base_picture->structure = GST_VAAPI_PICTURE_STRUCTURE_FRAME; + switch (priv->pic_structure) { case GST_H264_SEI_PIC_STRUCT_TOP_FIELD: - base_picture->structure = GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD; - if (GST_VAAPI_PICTURE_IS_FIRST_FIELD(picture)) - priv->top_field_first = TRUE; - break; + base_picture->structure = GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD; + if (GST_VAAPI_PICTURE_IS_FIRST_FIELD (picture)) + priv->top_field_first = TRUE; + break; case GST_H264_SEI_PIC_STRUCT_BOTTOM_FIELD: - base_picture->structure = GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD; - break; + base_picture->structure = GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD; + break; case GST_H264_SEI_PIC_STRUCT_TOP_BOTTOM_TOP: - GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_RFF); - // fall-through + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_RFF); + // fall-through case GST_H264_SEI_PIC_STRUCT_TOP_BOTTOM: - if (GST_VAAPI_PICTURE_IS_FIRST_FIELD(picture)) - priv->top_field_first = TRUE; - break; + if (GST_VAAPI_PICTURE_IS_FIRST_FIELD (picture)) + priv->top_field_first = TRUE; + break; case GST_H264_SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM: - GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_RFF); - break; + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_RFF); + break; case GST_H264_SEI_PIC_STRUCT_FRAME: - if (!priv->progressive_sequence && priv->dpb_count == 0) - priv->top_field_first = TRUE; - break; - } - picture->structure = base_picture->structure; - if (priv->top_field_first) - GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_TFF); - - /* Initialize reference flags */ - if (pi->nalu.ref_idc) { - GstH264DecRefPicMarking * const dec_ref_pic_marking = - &slice_hdr->dec_ref_pic_marking; - - if (GST_VAAPI_PICTURE_IS_IDR(picture) && - dec_ref_pic_marking->long_term_reference_flag) - GST_VAAPI_PICTURE_FLAG_SET(picture, - GST_VAAPI_PICTURE_FLAG_LONG_TERM_REFERENCE); - else - GST_VAAPI_PICTURE_FLAG_SET(picture, - GST_VAAPI_PICTURE_FLAG_SHORT_TERM_REFERENCE); - } - - fill_picture_first_field_gap_done(decoder, slice_hdr); - init_picture_poc(decoder, picture, slice_hdr); - return TRUE; + if (!priv->progressive_sequence && priv->dpb_count == 0) + priv->top_field_first = TRUE; + break; + } + picture->structure = base_picture->structure; + if (priv->top_field_first) + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_TFF); + + /* Initialize reference flags */ + if (pi->nalu.ref_idc) { + GstH264DecRefPicMarking *const dec_ref_pic_marking = + &slice_hdr->dec_ref_pic_marking; + + if (GST_VAAPI_PICTURE_IS_IDR (picture) && + dec_ref_pic_marking->long_term_reference_flag) + GST_VAAPI_PICTURE_FLAG_SET (picture, + GST_VAAPI_PICTURE_FLAG_LONG_TERM_REFERENCE); + else + GST_VAAPI_PICTURE_FLAG_SET (picture, + GST_VAAPI_PICTURE_FLAG_SHORT_TERM_REFERENCE); + } + + fill_picture_first_field_gap_done (decoder, slice_hdr); + init_picture_poc (decoder, picture, slice_hdr); + return TRUE; } /* 8.2.5.3 - Sliding window decoded reference picture marking process */ static gboolean -exec_ref_pic_marking_sliding_window(GstVaapiDecoderH264 *decoder) +exec_ref_pic_marking_sliding_window (GstVaapiDecoderH264 * decoder) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstH264SPS * const sps = get_sps(decoder); - GstVaapiPictureH264 *ref_picture; - guint i, m, max_num_ref_frames; - - GST_DEBUG("reference picture marking process (sliding window)"); - - if (!GST_VAAPI_PICTURE_IS_FIRST_FIELD(priv->current_picture)) - return TRUE; - - max_num_ref_frames = sps->num_ref_frames; - if (max_num_ref_frames == 0) - max_num_ref_frames = 1; - if (!GST_VAAPI_PICTURE_IS_FRAME(priv->current_picture)) - max_num_ref_frames <<= 1; - - if (priv->short_ref_count + priv->long_ref_count < max_num_ref_frames) - return TRUE; - if (priv->short_ref_count < 1) - return FALSE; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstH264SPS *const sps = get_sps (decoder); + GstVaapiPictureH264 *ref_picture; + guint i, m, max_num_ref_frames; - for (m = 0, i = 1; i < priv->short_ref_count; i++) { - GstVaapiPictureH264 * const picture = priv->short_ref[i]; - if (picture->frame_num_wrap < priv->short_ref[m]->frame_num_wrap) - m = i; - } - - ref_picture = priv->short_ref[m]; - gst_vaapi_picture_h264_set_reference(ref_picture, 0, TRUE); - ARRAY_REMOVE_INDEX(priv->short_ref, m); - - /* Both fields need to be marked as "unused for reference", so - remove the other field from the short_ref[] list as well */ - if (!GST_VAAPI_PICTURE_IS_FRAME(priv->current_picture) && ref_picture->other_field) { - for (i = 0; i < priv->short_ref_count; i++) { - if (priv->short_ref[i] == ref_picture->other_field) { - ARRAY_REMOVE_INDEX(priv->short_ref, i); - break; - } - } - } + GST_DEBUG ("reference picture marking process (sliding window)"); + + if (!GST_VAAPI_PICTURE_IS_FIRST_FIELD (priv->current_picture)) + return TRUE; + + max_num_ref_frames = sps->num_ref_frames; + if (max_num_ref_frames == 0) + max_num_ref_frames = 1; + if (!GST_VAAPI_PICTURE_IS_FRAME (priv->current_picture)) + max_num_ref_frames <<= 1; + + if (priv->short_ref_count + priv->long_ref_count < max_num_ref_frames) return TRUE; + if (priv->short_ref_count < 1) + return FALSE; + + for (m = 0, i = 1; i < priv->short_ref_count; i++) { + GstVaapiPictureH264 *const picture = priv->short_ref[i]; + if (picture->frame_num_wrap < priv->short_ref[m]->frame_num_wrap) + m = i; + } + + ref_picture = priv->short_ref[m]; + gst_vaapi_picture_h264_set_reference (ref_picture, 0, TRUE); + ARRAY_REMOVE_INDEX (priv->short_ref, m); + + /* Both fields need to be marked as "unused for reference", so + remove the other field from the short_ref[] list as well */ + if (!GST_VAAPI_PICTURE_IS_FRAME (priv->current_picture) + && ref_picture->other_field) { + for (i = 0; i < priv->short_ref_count; i++) { + if (priv->short_ref[i] == ref_picture->other_field) { + ARRAY_REMOVE_INDEX (priv->short_ref, i); + break; + } + } + } + return TRUE; } static inline gint32 -get_picNumX(GstVaapiPictureH264 *picture, GstH264RefPicMarking *ref_pic_marking) +get_picNumX (GstVaapiPictureH264 * picture, + GstH264RefPicMarking * ref_pic_marking) { - gint32 pic_num; + gint32 pic_num; - if (GST_VAAPI_PICTURE_IS_FRAME(picture)) - pic_num = picture->frame_num_wrap; - else - pic_num = 2 * picture->frame_num_wrap + 1; - pic_num -= ref_pic_marking->difference_of_pic_nums_minus1 + 1; - return pic_num; + if (GST_VAAPI_PICTURE_IS_FRAME (picture)) + pic_num = picture->frame_num_wrap; + else + pic_num = 2 * picture->frame_num_wrap + 1; + pic_num -= ref_pic_marking->difference_of_pic_nums_minus1 + 1; + return pic_num; } /* 8.2.5.4.1. Mark short-term reference picture as "unused for reference" */ static void -exec_ref_pic_marking_adaptive_mmco_1( - GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, - GstH264RefPicMarking *ref_pic_marking -) -{ - GstVaapiDecoderH264Private * const priv = &decoder->priv; - gint32 i, picNumX; - - picNumX = get_picNumX(picture, ref_pic_marking); - i = find_short_term_reference(decoder, picNumX); - if (i < 0) - return; - - gst_vaapi_picture_h264_set_reference(priv->short_ref[i], 0, - GST_VAAPI_PICTURE_IS_FRAME(picture)); - ARRAY_REMOVE_INDEX(priv->short_ref, i); +exec_ref_pic_marking_adaptive_mmco_1 (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, GstH264RefPicMarking * ref_pic_marking) +{ + GstVaapiDecoderH264Private *const priv = &decoder->priv; + gint32 i, picNumX; + + picNumX = get_picNumX (picture, ref_pic_marking); + i = find_short_term_reference (decoder, picNumX); + if (i < 0) + return; + + gst_vaapi_picture_h264_set_reference (priv->short_ref[i], 0, + GST_VAAPI_PICTURE_IS_FRAME (picture)); + ARRAY_REMOVE_INDEX (priv->short_ref, i); } /* 8.2.5.4.2. Mark long-term reference picture as "unused for reference" */ static void -exec_ref_pic_marking_adaptive_mmco_2( - GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, - GstH264RefPicMarking *ref_pic_marking -) -{ - GstVaapiDecoderH264Private * const priv = &decoder->priv; - gint32 i; - - i = find_long_term_reference(decoder, ref_pic_marking->long_term_pic_num); - if (i < 0) - return; - - gst_vaapi_picture_h264_set_reference(priv->long_ref[i], 0, - GST_VAAPI_PICTURE_IS_FRAME(picture)); - ARRAY_REMOVE_INDEX(priv->long_ref, i); +exec_ref_pic_marking_adaptive_mmco_2 (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, GstH264RefPicMarking * ref_pic_marking) +{ + GstVaapiDecoderH264Private *const priv = &decoder->priv; + gint32 i; + + i = find_long_term_reference (decoder, ref_pic_marking->long_term_pic_num); + if (i < 0) + return; + + gst_vaapi_picture_h264_set_reference (priv->long_ref[i], 0, + GST_VAAPI_PICTURE_IS_FRAME (picture)); + ARRAY_REMOVE_INDEX (priv->long_ref, i); } /* 8.2.5.4.3. Assign LongTermFrameIdx to a short-term reference picture */ static void -exec_ref_pic_marking_adaptive_mmco_3( - GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, - GstH264RefPicMarking *ref_pic_marking -) -{ - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiPictureH264 *ref_picture, *other_field; - gint32 i, picNumX; - - for (i = 0; i < priv->long_ref_count; i++) { - if (priv->long_ref[i]->long_term_frame_idx == ref_pic_marking->long_term_frame_idx) - break; - } - if (i != priv->long_ref_count) { - gst_vaapi_picture_h264_set_reference(priv->long_ref[i], 0, TRUE); - ARRAY_REMOVE_INDEX(priv->long_ref, i); - } - - picNumX = get_picNumX(picture, ref_pic_marking); - i = find_short_term_reference(decoder, picNumX); - if (i < 0) - return; - - ref_picture = priv->short_ref[i]; - ARRAY_REMOVE_INDEX(priv->short_ref, i); - priv->long_ref[priv->long_ref_count++] = ref_picture; - - ref_picture->long_term_frame_idx = ref_pic_marking->long_term_frame_idx; - gst_vaapi_picture_h264_set_reference(ref_picture, - GST_VAAPI_PICTURE_FLAG_LONG_TERM_REFERENCE, - GST_VAAPI_PICTURE_IS_COMPLETE(picture)); - - /* Assign LongTermFrameIdx to the other field if it was also - marked as "used for long-term reference */ - other_field = ref_picture->other_field; - if (other_field && GST_VAAPI_PICTURE_IS_LONG_TERM_REFERENCE(other_field)) - other_field->long_term_frame_idx = ref_pic_marking->long_term_frame_idx; +exec_ref_pic_marking_adaptive_mmco_3 (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, GstH264RefPicMarking * ref_pic_marking) +{ + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiPictureH264 *ref_picture, *other_field; + gint32 i, picNumX; + + for (i = 0; i < priv->long_ref_count; i++) { + if (priv->long_ref[i]->long_term_frame_idx == + ref_pic_marking->long_term_frame_idx) + break; + } + if (i != priv->long_ref_count) { + gst_vaapi_picture_h264_set_reference (priv->long_ref[i], 0, TRUE); + ARRAY_REMOVE_INDEX (priv->long_ref, i); + } + + picNumX = get_picNumX (picture, ref_pic_marking); + i = find_short_term_reference (decoder, picNumX); + if (i < 0) + return; + + ref_picture = priv->short_ref[i]; + ARRAY_REMOVE_INDEX (priv->short_ref, i); + priv->long_ref[priv->long_ref_count++] = ref_picture; + + ref_picture->long_term_frame_idx = ref_pic_marking->long_term_frame_idx; + gst_vaapi_picture_h264_set_reference (ref_picture, + GST_VAAPI_PICTURE_FLAG_LONG_TERM_REFERENCE, + GST_VAAPI_PICTURE_IS_COMPLETE (picture)); + + /* Assign LongTermFrameIdx to the other field if it was also + marked as "used for long-term reference */ + other_field = ref_picture->other_field; + if (other_field && GST_VAAPI_PICTURE_IS_LONG_TERM_REFERENCE (other_field)) + other_field->long_term_frame_idx = ref_pic_marking->long_term_frame_idx; } /* 8.2.5.4.4. Mark pictures with LongTermFramIdx > max_long_term_frame_idx * as "unused for reference" */ static void -exec_ref_pic_marking_adaptive_mmco_4( - GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, - GstH264RefPicMarking *ref_pic_marking -) -{ - GstVaapiDecoderH264Private * const priv = &decoder->priv; - gint32 i, long_term_frame_idx; - - long_term_frame_idx = ref_pic_marking->max_long_term_frame_idx_plus1 - 1; - - for (i = 0; i < priv->long_ref_count; i++) { - if (priv->long_ref[i]->long_term_frame_idx <= long_term_frame_idx) - continue; - gst_vaapi_picture_h264_set_reference(priv->long_ref[i], 0, FALSE); - ARRAY_REMOVE_INDEX(priv->long_ref, i); - i--; - } +exec_ref_pic_marking_adaptive_mmco_4 (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, GstH264RefPicMarking * ref_pic_marking) +{ + GstVaapiDecoderH264Private *const priv = &decoder->priv; + gint32 i, long_term_frame_idx; + + long_term_frame_idx = ref_pic_marking->max_long_term_frame_idx_plus1 - 1; + + for (i = 0; i < priv->long_ref_count; i++) { + if (priv->long_ref[i]->long_term_frame_idx <= long_term_frame_idx) + continue; + gst_vaapi_picture_h264_set_reference (priv->long_ref[i], 0, FALSE); + ARRAY_REMOVE_INDEX (priv->long_ref, i); + i--; + } } /* 8.2.5.4.5. Mark all reference pictures as "unused for reference" */ static void -exec_ref_pic_marking_adaptive_mmco_5( - GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, - GstH264RefPicMarking *ref_pic_marking -) +exec_ref_pic_marking_adaptive_mmco_5 (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, GstH264RefPicMarking * ref_pic_marking) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - - dpb_flush(decoder, picture); + GstVaapiDecoderH264Private *const priv = &decoder->priv; - priv->prev_pic_has_mmco5 = TRUE; + dpb_flush (decoder, picture); - /* The picture shall be inferred to have had frame_num equal to 0 (7.4.3) */ - priv->frame_num = 0; - priv->frame_num_offset = 0; - picture->frame_num = 0; + priv->prev_pic_has_mmco5 = TRUE; - /* Update TopFieldOrderCnt and BottomFieldOrderCnt (8.2.1) */ - if (picture->structure != GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD) - picture->field_poc[TOP_FIELD] -= picture->base.poc; - if (picture->structure != GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD) - picture->field_poc[BOTTOM_FIELD] -= picture->base.poc; - picture->base.poc = 0; + /* The picture shall be inferred to have had frame_num equal to 0 (7.4.3) */ + priv->frame_num = 0; + priv->frame_num_offset = 0; + picture->frame_num = 0; + + /* Update TopFieldOrderCnt and BottomFieldOrderCnt (8.2.1) */ + if (picture->structure != GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD) + picture->field_poc[TOP_FIELD] -= picture->base.poc; + if (picture->structure != GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD) + picture->field_poc[BOTTOM_FIELD] -= picture->base.poc; + picture->base.poc = 0; } /* 8.2.5.4.6. Assign a long-term frame index to the current picture */ static void -exec_ref_pic_marking_adaptive_mmco_6( - GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, - GstH264RefPicMarking *ref_pic_marking -) -{ - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiPictureH264 *other_field; - guint i; - - for (i = 0; i < priv->long_ref_count; i++) { - if (priv->long_ref[i]->long_term_frame_idx == ref_pic_marking->long_term_frame_idx) - break; - } - if (i != priv->long_ref_count) { - gst_vaapi_picture_h264_set_reference(priv->long_ref[i], 0, TRUE); - ARRAY_REMOVE_INDEX(priv->long_ref, i); - } - - picture->long_term_frame_idx = ref_pic_marking->long_term_frame_idx; - gst_vaapi_picture_h264_set_reference(picture, - GST_VAAPI_PICTURE_FLAG_LONG_TERM_REFERENCE, - GST_VAAPI_PICTURE_IS_COMPLETE(picture)); - - /* Assign LongTermFrameIdx to the other field if it was also - marked as "used for long-term reference */ - other_field = GST_VAAPI_PICTURE_H264(picture->base.parent_picture); - if (other_field && GST_VAAPI_PICTURE_IS_LONG_TERM_REFERENCE(other_field)) - other_field->long_term_frame_idx = ref_pic_marking->long_term_frame_idx; +exec_ref_pic_marking_adaptive_mmco_6 (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, GstH264RefPicMarking * ref_pic_marking) +{ + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiPictureH264 *other_field; + guint i; + + for (i = 0; i < priv->long_ref_count; i++) { + if (priv->long_ref[i]->long_term_frame_idx == + ref_pic_marking->long_term_frame_idx) + break; + } + if (i != priv->long_ref_count) { + gst_vaapi_picture_h264_set_reference (priv->long_ref[i], 0, TRUE); + ARRAY_REMOVE_INDEX (priv->long_ref, i); + } + + picture->long_term_frame_idx = ref_pic_marking->long_term_frame_idx; + gst_vaapi_picture_h264_set_reference (picture, + GST_VAAPI_PICTURE_FLAG_LONG_TERM_REFERENCE, + GST_VAAPI_PICTURE_IS_COMPLETE (picture)); + + /* Assign LongTermFrameIdx to the other field if it was also + marked as "used for long-term reference */ + other_field = GST_VAAPI_PICTURE_H264 (picture->base.parent_picture); + if (other_field && GST_VAAPI_PICTURE_IS_LONG_TERM_REFERENCE (other_field)) + other_field->long_term_frame_idx = ref_pic_marking->long_term_frame_idx; } /* 8.2.5.4. Adaptive memory control decoded reference picture marking process */ static gboolean -exec_ref_pic_marking_adaptive( - GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, - GstH264DecRefPicMarking *dec_ref_pic_marking -) -{ - guint i; - - GST_DEBUG("reference picture marking process (adaptive memory control)"); - - typedef void (*exec_ref_pic_marking_adaptive_mmco_func)( - GstVaapiDecoderH264 *decoder, - GstVaapiPictureH264 *picture, - GstH264RefPicMarking *ref_pic_marking - ); - - static const exec_ref_pic_marking_adaptive_mmco_func mmco_funcs[] = { - NULL, - exec_ref_pic_marking_adaptive_mmco_1, - exec_ref_pic_marking_adaptive_mmco_2, - exec_ref_pic_marking_adaptive_mmco_3, - exec_ref_pic_marking_adaptive_mmco_4, - exec_ref_pic_marking_adaptive_mmco_5, - exec_ref_pic_marking_adaptive_mmco_6, - }; - - for (i = 0; i < dec_ref_pic_marking->n_ref_pic_marking; i++) { - GstH264RefPicMarking * const ref_pic_marking = - &dec_ref_pic_marking->ref_pic_marking[i]; - - const guint mmco = ref_pic_marking->memory_management_control_operation; - if (mmco < G_N_ELEMENTS(mmco_funcs) && mmco_funcs[mmco]) - mmco_funcs[mmco](decoder, picture, ref_pic_marking); - else { - GST_ERROR("unhandled MMCO %u", mmco); - return FALSE; - } +exec_ref_pic_marking_adaptive (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture, + GstH264DecRefPicMarking * dec_ref_pic_marking) +{ + guint i; + + typedef void (*exec_ref_pic_marking_adaptive_mmco_func) (GstVaapiDecoderH264 * + decoder, GstVaapiPictureH264 * picture, + GstH264RefPicMarking * ref_pic_marking); + + static const exec_ref_pic_marking_adaptive_mmco_func mmco_funcs[] = { + NULL, + exec_ref_pic_marking_adaptive_mmco_1, + exec_ref_pic_marking_adaptive_mmco_2, + exec_ref_pic_marking_adaptive_mmco_3, + exec_ref_pic_marking_adaptive_mmco_4, + exec_ref_pic_marking_adaptive_mmco_5, + exec_ref_pic_marking_adaptive_mmco_6, + }; + + GST_DEBUG ("reference picture marking process (adaptive memory control)"); + + for (i = 0; i < dec_ref_pic_marking->n_ref_pic_marking; i++) { + GstH264RefPicMarking *const ref_pic_marking = + &dec_ref_pic_marking->ref_pic_marking[i]; + + const guint mmco = ref_pic_marking->memory_management_control_operation; + if (mmco < G_N_ELEMENTS (mmco_funcs) && mmco_funcs[mmco]) + mmco_funcs[mmco] (decoder, picture, ref_pic_marking); + else { + GST_ERROR ("unhandled MMCO %u", mmco); + return FALSE; } - return TRUE; + } + return TRUE; } /* 8.2.5 - Execute reference picture marking process */ static gboolean -exec_ref_pic_marking(GstVaapiDecoderH264 *decoder, GstVaapiPictureH264 *picture) +exec_ref_pic_marking (GstVaapiDecoderH264 * decoder, + GstVaapiPictureH264 * picture) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; + GstVaapiDecoderH264Private *const priv = &decoder->priv; - priv->prev_pic_reference = GST_VAAPI_PICTURE_IS_REFERENCE(picture); - priv->prev_pic_has_mmco5 = FALSE; - priv->prev_pic_structure = picture->structure; - - if (GST_VAAPI_PICTURE_IS_INTER_VIEW(picture)) - g_ptr_array_add(priv->inter_views, gst_vaapi_picture_ref(picture)); - - if (!priv->prev_pic_reference) - return TRUE; - - if (!GST_VAAPI_PICTURE_IS_IDR(picture)) { - GstH264DecRefPicMarking * const dec_ref_pic_marking = - &picture->last_slice_hdr->dec_ref_pic_marking; - if (dec_ref_pic_marking->adaptive_ref_pic_marking_mode_flag) { - if (!exec_ref_pic_marking_adaptive(decoder, picture, dec_ref_pic_marking)) - return FALSE; - } - else { - if (!exec_ref_pic_marking_sliding_window(decoder)) - return FALSE; - } - } + priv->prev_pic_reference = GST_VAAPI_PICTURE_IS_REFERENCE (picture); + priv->prev_pic_has_mmco5 = FALSE; + priv->prev_pic_structure = picture->structure; + + if (GST_VAAPI_PICTURE_IS_INTER_VIEW (picture)) + g_ptr_array_add (priv->inter_views, gst_vaapi_picture_ref (picture)); + + if (!priv->prev_pic_reference) return TRUE; + + if (!GST_VAAPI_PICTURE_IS_IDR (picture)) { + GstH264DecRefPicMarking *const dec_ref_pic_marking = + &picture->last_slice_hdr->dec_ref_pic_marking; + if (dec_ref_pic_marking->adaptive_ref_pic_marking_mode_flag) { + if (!exec_ref_pic_marking_adaptive (decoder, picture, + dec_ref_pic_marking)) + return FALSE; + } else { + if (!exec_ref_pic_marking_sliding_window (decoder)) + return FALSE; + } + } + return TRUE; } static void -vaapi_init_picture(VAPictureH264 *pic) +vaapi_init_picture (VAPictureH264 * pic) { - pic->picture_id = VA_INVALID_ID; - pic->frame_idx = 0; - pic->flags = VA_PICTURE_H264_INVALID; - pic->TopFieldOrderCnt = 0; - pic->BottomFieldOrderCnt = 0; + pic->picture_id = VA_INVALID_ID; + pic->frame_idx = 0; + pic->flags = VA_PICTURE_H264_INVALID; + pic->TopFieldOrderCnt = 0; + pic->BottomFieldOrderCnt = 0; } static void -vaapi_fill_picture(VAPictureH264 *pic, GstVaapiPictureH264 *picture, +vaapi_fill_picture (VAPictureH264 * pic, GstVaapiPictureH264 * picture, guint picture_structure) { - if (!picture_structure) - picture_structure = picture->structure; + if (!picture_structure) + picture_structure = picture->structure; - pic->picture_id = picture->base.surface_id; - pic->flags = 0; + pic->picture_id = picture->base.surface_id; + pic->flags = 0; - if (GST_VAAPI_PICTURE_IS_LONG_TERM_REFERENCE(picture)) { - pic->flags |= VA_PICTURE_H264_LONG_TERM_REFERENCE; - pic->frame_idx = picture->long_term_frame_idx; - } - else { - if (GST_VAAPI_PICTURE_IS_SHORT_TERM_REFERENCE(picture)) - pic->flags |= VA_PICTURE_H264_SHORT_TERM_REFERENCE; - pic->frame_idx = picture->frame_num; - } + if (GST_VAAPI_PICTURE_IS_LONG_TERM_REFERENCE (picture)) { + pic->flags |= VA_PICTURE_H264_LONG_TERM_REFERENCE; + pic->frame_idx = picture->long_term_frame_idx; + } else { + if (GST_VAAPI_PICTURE_IS_SHORT_TERM_REFERENCE (picture)) + pic->flags |= VA_PICTURE_H264_SHORT_TERM_REFERENCE; + pic->frame_idx = picture->frame_num; + } - switch (picture_structure) { + switch (picture_structure) { case GST_VAAPI_PICTURE_STRUCTURE_FRAME: - pic->TopFieldOrderCnt = picture->field_poc[TOP_FIELD]; - pic->BottomFieldOrderCnt = picture->field_poc[BOTTOM_FIELD]; - break; + pic->TopFieldOrderCnt = picture->field_poc[TOP_FIELD]; + pic->BottomFieldOrderCnt = picture->field_poc[BOTTOM_FIELD]; + break; case GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD: - pic->flags |= VA_PICTURE_H264_TOP_FIELD; - pic->TopFieldOrderCnt = picture->field_poc[TOP_FIELD]; - pic->BottomFieldOrderCnt = 0; - break; + pic->flags |= VA_PICTURE_H264_TOP_FIELD; + pic->TopFieldOrderCnt = picture->field_poc[TOP_FIELD]; + pic->BottomFieldOrderCnt = 0; + break; case GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD: - pic->flags |= VA_PICTURE_H264_BOTTOM_FIELD; - pic->BottomFieldOrderCnt = picture->field_poc[BOTTOM_FIELD]; - pic->TopFieldOrderCnt = 0; - break; - } + pic->flags |= VA_PICTURE_H264_BOTTOM_FIELD; + pic->BottomFieldOrderCnt = picture->field_poc[BOTTOM_FIELD]; + pic->TopFieldOrderCnt = 0; + break; + } } static void -vaapi_fill_picture_for_RefPicListX(VAPictureH264 *pic, - GstVaapiPictureH264 *picture) +vaapi_fill_picture_for_RefPicListX (VAPictureH264 * pic, + GstVaapiPictureH264 * picture) { - vaapi_fill_picture(pic, picture, 0); + vaapi_fill_picture (pic, picture, 0); - /* H.8.4 - MVC inter prediction and inter-view prediction process */ - if (GST_VAAPI_PICTURE_IS_INTER_VIEW(picture)) { - /* The inter-view reference components and inter-view only - reference components that are included in the reference - picture lists are considered as not being marked as "used for - short-term reference" or "used for long-term reference" */ - pic->flags &= ~(VA_PICTURE_H264_SHORT_TERM_REFERENCE| - VA_PICTURE_H264_LONG_TERM_REFERENCE); - } + /* H.8.4 - MVC inter prediction and inter-view prediction process */ + if (GST_VAAPI_PICTURE_IS_INTER_VIEW (picture)) { + /* The inter-view reference components and inter-view only + reference components that are included in the reference + picture lists are considered as not being marked as "used for + short-term reference" or "used for long-term reference" */ + pic->flags &= ~(VA_PICTURE_H264_SHORT_TERM_REFERENCE | + VA_PICTURE_H264_LONG_TERM_REFERENCE); + } } static gboolean -fill_picture(GstVaapiDecoderH264 *decoder, GstVaapiPictureH264 *picture) +fill_picture (GstVaapiDecoderH264 * decoder, GstVaapiPictureH264 * picture) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiPicture * const base_picture = &picture->base; - GstH264PPS * const pps = get_pps(decoder); - GstH264SPS * const sps = get_sps(decoder); - VAPictureParameterBufferH264 * const pic_param = base_picture->param; - guint i, n; - - /* Fill in VAPictureParameterBufferH264 */ - vaapi_fill_picture(&pic_param->CurrPic, picture, 0); - - for (i = 0, n = 0; i < priv->dpb_count; i++) { - GstVaapiFrameStore * const fs = priv->dpb[i]; - if ((gst_vaapi_frame_store_has_reference(fs) && - fs->view_id == picture->base.view_id) || - (gst_vaapi_frame_store_has_inter_view(fs) && - is_inter_view_reference_for_picture(decoder, fs->view_id, picture))) - vaapi_fill_picture(&pic_param->ReferenceFrames[n++], - fs->buffers[0], fs->structure); - if (n >= G_N_ELEMENTS(pic_param->ReferenceFrames)) - break; - } - for (; n < G_N_ELEMENTS(pic_param->ReferenceFrames); n++) - vaapi_init_picture(&pic_param->ReferenceFrames[n]); + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiPicture *const base_picture = &picture->base; + GstH264PPS *const pps = get_pps (decoder); + GstH264SPS *const sps = get_sps (decoder); + VAPictureParameterBufferH264 *const pic_param = base_picture->param; + guint i, n; + + /* Fill in VAPictureParameterBufferH264 */ + vaapi_fill_picture (&pic_param->CurrPic, picture, 0); + + for (i = 0, n = 0; i < priv->dpb_count; i++) { + GstVaapiFrameStore *const fs = priv->dpb[i]; + if ((gst_vaapi_frame_store_has_reference (fs) && + fs->view_id == picture->base.view_id) || + (gst_vaapi_frame_store_has_inter_view (fs) && + is_inter_view_reference_for_picture (decoder, fs->view_id, + picture))) + vaapi_fill_picture (&pic_param->ReferenceFrames[n++], fs->buffers[0], + fs->structure); + if (n >= G_N_ELEMENTS (pic_param->ReferenceFrames)) + break; + } + for (; n < G_N_ELEMENTS (pic_param->ReferenceFrames); n++) + vaapi_init_picture (&pic_param->ReferenceFrames[n]); #define COPY_FIELD(s, f) \ pic_param->f = (s)->f @@ -3791,62 +3696,65 @@ #define COPY_BFM(a, s, f) \ pic_param->a.bits.f = (s)->f - pic_param->picture_width_in_mbs_minus1 = priv->mb_width - 1; - pic_param->picture_height_in_mbs_minus1 = priv->mb_height - 1; - pic_param->frame_num = priv->frame_num; - - COPY_FIELD(sps, bit_depth_luma_minus8); - COPY_FIELD(sps, bit_depth_chroma_minus8); - COPY_FIELD(sps, num_ref_frames); - COPY_FIELD(pps, num_slice_groups_minus1); - COPY_FIELD(pps, slice_group_map_type); - COPY_FIELD(pps, slice_group_change_rate_minus1); - COPY_FIELD(pps, pic_init_qp_minus26); - COPY_FIELD(pps, pic_init_qs_minus26); - COPY_FIELD(pps, chroma_qp_index_offset); - COPY_FIELD(pps, second_chroma_qp_index_offset); - - pic_param->seq_fields.value = 0; /* reset all bits */ - pic_param->seq_fields.bits.residual_colour_transform_flag = sps->separate_colour_plane_flag; - pic_param->seq_fields.bits.MinLumaBiPredSize8x8 = sps->level_idc >= 31; /* A.3.3.2 */ - - COPY_BFM(seq_fields, sps, chroma_format_idc); - COPY_BFM(seq_fields, sps, gaps_in_frame_num_value_allowed_flag); - COPY_BFM(seq_fields, sps, frame_mbs_only_flag); - COPY_BFM(seq_fields, sps, mb_adaptive_frame_field_flag); - COPY_BFM(seq_fields, sps, direct_8x8_inference_flag); - COPY_BFM(seq_fields, sps, log2_max_frame_num_minus4); - COPY_BFM(seq_fields, sps, pic_order_cnt_type); - COPY_BFM(seq_fields, sps, log2_max_pic_order_cnt_lsb_minus4); - COPY_BFM(seq_fields, sps, delta_pic_order_always_zero_flag); - - pic_param->pic_fields.value = 0; /* reset all bits */ - pic_param->pic_fields.bits.field_pic_flag = GST_VAAPI_PICTURE_IS_INTERLACED(picture); - pic_param->pic_fields.bits.reference_pic_flag = GST_VAAPI_PICTURE_IS_REFERENCE(picture); - - COPY_BFM(pic_fields, pps, entropy_coding_mode_flag); - COPY_BFM(pic_fields, pps, weighted_pred_flag); - COPY_BFM(pic_fields, pps, weighted_bipred_idc); - COPY_BFM(pic_fields, pps, transform_8x8_mode_flag); - COPY_BFM(pic_fields, pps, constrained_intra_pred_flag); - COPY_BFM(pic_fields, pps, pic_order_present_flag); - COPY_BFM(pic_fields, pps, deblocking_filter_control_present_flag); - COPY_BFM(pic_fields, pps, redundant_pic_cnt_present_flag); - return TRUE; + pic_param->picture_width_in_mbs_minus1 = priv->mb_width - 1; + pic_param->picture_height_in_mbs_minus1 = priv->mb_height - 1; + pic_param->frame_num = priv->frame_num; + + COPY_FIELD (sps, bit_depth_luma_minus8); + COPY_FIELD (sps, bit_depth_chroma_minus8); + COPY_FIELD (sps, num_ref_frames); + COPY_FIELD (pps, num_slice_groups_minus1); + COPY_FIELD (pps, slice_group_map_type); + COPY_FIELD (pps, slice_group_change_rate_minus1); + COPY_FIELD (pps, pic_init_qp_minus26); + COPY_FIELD (pps, pic_init_qs_minus26); + COPY_FIELD (pps, chroma_qp_index_offset); + COPY_FIELD (pps, second_chroma_qp_index_offset); + + pic_param->seq_fields.value = 0; /* reset all bits */ + pic_param->seq_fields.bits.residual_colour_transform_flag = + sps->separate_colour_plane_flag; + pic_param->seq_fields.bits.MinLumaBiPredSize8x8 = sps->level_idc >= 31; /* A.3.3.2 */ + + COPY_BFM (seq_fields, sps, chroma_format_idc); + COPY_BFM (seq_fields, sps, gaps_in_frame_num_value_allowed_flag); + COPY_BFM (seq_fields, sps, frame_mbs_only_flag); + COPY_BFM (seq_fields, sps, mb_adaptive_frame_field_flag); + COPY_BFM (seq_fields, sps, direct_8x8_inference_flag); + COPY_BFM (seq_fields, sps, log2_max_frame_num_minus4); + COPY_BFM (seq_fields, sps, pic_order_cnt_type); + COPY_BFM (seq_fields, sps, log2_max_pic_order_cnt_lsb_minus4); + COPY_BFM (seq_fields, sps, delta_pic_order_always_zero_flag); + + pic_param->pic_fields.value = 0; /* reset all bits */ + pic_param->pic_fields.bits.field_pic_flag = + GST_VAAPI_PICTURE_IS_INTERLACED (picture); + pic_param->pic_fields.bits.reference_pic_flag = + GST_VAAPI_PICTURE_IS_REFERENCE (picture); + + COPY_BFM (pic_fields, pps, entropy_coding_mode_flag); + COPY_BFM (pic_fields, pps, weighted_pred_flag); + COPY_BFM (pic_fields, pps, weighted_bipred_idc); + COPY_BFM (pic_fields, pps, transform_8x8_mode_flag); + COPY_BFM (pic_fields, pps, constrained_intra_pred_flag); + COPY_BFM (pic_fields, pps, pic_order_present_flag); + COPY_BFM (pic_fields, pps, deblocking_filter_control_present_flag); + COPY_BFM (pic_fields, pps, redundant_pic_cnt_present_flag); + return TRUE; } /* Detection of the first VCL NAL unit of a primary coded picture (7.4.1.2.4) */ static gboolean -is_new_picture(GstVaapiParserInfoH264 *pi, GstVaapiParserInfoH264 *prev_pi) +is_new_picture (GstVaapiParserInfoH264 * pi, GstVaapiParserInfoH264 * prev_pi) { - GstH264SliceHdr * const slice_hdr = &pi->data.slice_hdr; - GstH264PPS * const pps = slice_hdr->pps; - GstH264SPS * const sps = pps->sequence; - GstH264SliceHdr *prev_slice_hdr; - - if (!prev_pi) - return TRUE; - prev_slice_hdr = &prev_pi->data.slice_hdr; + GstH264SliceHdr *const slice_hdr = &pi->data.slice_hdr; + GstH264PPS *const pps = slice_hdr->pps; + GstH264SPS *const sps = pps->sequence; + GstH264SliceHdr *prev_slice_hdr; + + if (!prev_pi) + return TRUE; + prev_slice_hdr = &prev_pi->data.slice_hdr; #define CHECK_EXPR(expr, field_name) do { \ if (!(expr)) { \ @@ -3858,868 +3766,866 @@ #define CHECK_VALUE(new_slice_hdr, old_slice_hdr, field) \ CHECK_EXPR(((new_slice_hdr)->field == (old_slice_hdr)->field), #field) - /* view_id differs in value and VOIdx of current slice_hdr is less - than the VOIdx of the prev_slice_hdr */ - CHECK_VALUE(pi, prev_pi, view_id); - - /* frame_num differs in value, regardless of inferred values to 0 */ - CHECK_VALUE(slice_hdr, prev_slice_hdr, frame_num); - - /* pic_parameter_set_id differs in value */ - CHECK_VALUE(slice_hdr, prev_slice_hdr, pps); - - /* field_pic_flag differs in value */ - CHECK_VALUE(slice_hdr, prev_slice_hdr, field_pic_flag); - - /* bottom_field_flag is present in both and differs in value */ - if (slice_hdr->field_pic_flag && prev_slice_hdr->field_pic_flag) - CHECK_VALUE(slice_hdr, prev_slice_hdr, bottom_field_flag); - - /* nal_ref_idc differs in value with one of the nal_ref_idc values is 0 */ - CHECK_EXPR((pi->nalu.ref_idc != 0) == - (prev_pi->nalu.ref_idc != 0), "nal_ref_idc"); - - /* POC type is 0 for both and either pic_order_cnt_lsb differs in - value or delta_pic_order_cnt_bottom differs in value */ - if (sps->pic_order_cnt_type == 0) { - CHECK_VALUE(slice_hdr, prev_slice_hdr, pic_order_cnt_lsb); - if (pps->pic_order_present_flag && !slice_hdr->field_pic_flag) - CHECK_VALUE(slice_hdr, prev_slice_hdr, delta_pic_order_cnt_bottom); - } - - /* POC type is 1 for both and either delta_pic_order_cnt[0] - differs in value or delta_pic_order_cnt[1] differs in value */ - else if (sps->pic_order_cnt_type == 1) { - CHECK_VALUE(slice_hdr, prev_slice_hdr, delta_pic_order_cnt[0]); - CHECK_VALUE(slice_hdr, prev_slice_hdr, delta_pic_order_cnt[1]); - } - - /* IdrPicFlag differs in value */ - CHECK_VALUE(&pi->nalu, &prev_pi->nalu, idr_pic_flag); - - /* IdrPicFlag is equal to 1 for both and idr_pic_id differs in value */ - if (pi->nalu.idr_pic_flag) - CHECK_VALUE(slice_hdr, prev_slice_hdr, idr_pic_id); + /* view_id differs in value and VOIdx of current slice_hdr is less + than the VOIdx of the prev_slice_hdr */ + CHECK_VALUE (pi, prev_pi, view_id); + + /* frame_num differs in value, regardless of inferred values to 0 */ + CHECK_VALUE (slice_hdr, prev_slice_hdr, frame_num); + + /* pic_parameter_set_id differs in value */ + CHECK_VALUE (slice_hdr, prev_slice_hdr, pps); + + /* field_pic_flag differs in value */ + CHECK_VALUE (slice_hdr, prev_slice_hdr, field_pic_flag); + + /* bottom_field_flag is present in both and differs in value */ + if (slice_hdr->field_pic_flag && prev_slice_hdr->field_pic_flag) + CHECK_VALUE (slice_hdr, prev_slice_hdr, bottom_field_flag); + + /* nal_ref_idc differs in value with one of the nal_ref_idc values is 0 */ + CHECK_EXPR ((pi->nalu.ref_idc != 0) == + (prev_pi->nalu.ref_idc != 0), "nal_ref_idc"); + + /* POC type is 0 for both and either pic_order_cnt_lsb differs in + value or delta_pic_order_cnt_bottom differs in value */ + if (sps->pic_order_cnt_type == 0) { + CHECK_VALUE (slice_hdr, prev_slice_hdr, pic_order_cnt_lsb); + if (pps->pic_order_present_flag && !slice_hdr->field_pic_flag) + CHECK_VALUE (slice_hdr, prev_slice_hdr, delta_pic_order_cnt_bottom); + } + + /* POC type is 1 for both and either delta_pic_order_cnt[0] + differs in value or delta_pic_order_cnt[1] differs in value */ + else if (sps->pic_order_cnt_type == 1) { + CHECK_VALUE (slice_hdr, prev_slice_hdr, delta_pic_order_cnt[0]); + CHECK_VALUE (slice_hdr, prev_slice_hdr, delta_pic_order_cnt[1]); + } + + /* IdrPicFlag differs in value */ + CHECK_VALUE (&pi->nalu, &prev_pi->nalu, idr_pic_flag); + + /* IdrPicFlag is equal to 1 for both and idr_pic_id differs in value */ + if (pi->nalu.idr_pic_flag) + CHECK_VALUE (slice_hdr, prev_slice_hdr, idr_pic_id); #undef CHECK_EXPR #undef CHECK_VALUE - return FALSE; + return FALSE; } /* Detection of a new access unit, assuming we are already in presence of a new picture */ static inline gboolean -is_new_access_unit(GstVaapiParserInfoH264 *pi, GstVaapiParserInfoH264 *prev_pi) +is_new_access_unit (GstVaapiParserInfoH264 * pi, + GstVaapiParserInfoH264 * prev_pi) { - if (!prev_pi || prev_pi->view_id == pi->view_id) - return TRUE; - return pi->voc < prev_pi->voc; + if (!prev_pi || prev_pi->view_id == pi->view_id) + return TRUE; + return pi->voc < prev_pi->voc; } /* Determines whether the supplied picture has the same field parity than a picture specified through the other slice header */ static inline gboolean -same_field_parity(GstVaapiPictureH264 *field, GstH264SliceHdr *slice_hdr) +same_field_parity (GstVaapiPictureH264 * field, GstH264SliceHdr * slice_hdr) { - g_return_val_if_fail(GST_VAAPI_PICTURE_IS_INTERLACED(field), FALSE); + g_return_val_if_fail (GST_VAAPI_PICTURE_IS_INTERLACED (field), FALSE); - return ((field->base.structure == GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD) ^ - slice_hdr->bottom_field_flag) == 0; + return ((field->base.structure == GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD) ^ + slice_hdr->bottom_field_flag) == 0; } /* Finds the first field picture corresponding to the supplied picture */ static GstVaapiPictureH264 * -find_first_field(GstVaapiDecoderH264 *decoder, GstVaapiParserInfoH264 *pi, +find_first_field (GstVaapiDecoderH264 * decoder, GstVaapiParserInfoH264 * pi, gboolean fill_gaps) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstH264SliceHdr * const slice_hdr = &pi->data.slice_hdr; - GstVaapiFrameStore *fs; - GstVaapiPictureH264 *f0, *f1; - - fs = priv->prev_frames[pi->voc]; - if (!fs) - return NULL; - - f0 = fs->buffers[0]; - if (!slice_hdr->field_pic_flag) { - if (fill_gaps && !gst_vaapi_frame_store_has_frame(fs)) - fill_picture_other_field_gap(decoder, f0); - return NULL; - } - - /* At this point, the current frame is known to be interlaced */ - if (gst_vaapi_frame_store_has_frame(fs)) { - f1 = NULL; - if (fill_gaps && !same_field_parity(f0, slice_hdr)) - f1 = fill_picture_first_field_gap(decoder, f0); - return f1; - } - - /* At this point, the previous frame is interlaced and contains a - single field */ - if (f0->frame_num == slice_hdr->frame_num) { - f1 = f0; - if (fill_gaps && same_field_parity(f0, slice_hdr)) { - fill_picture_other_field_gap(decoder, f0); - f1 = NULL; - } - return f1; - } + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstH264SliceHdr *const slice_hdr = &pi->data.slice_hdr; + GstVaapiFrameStore *fs; + GstVaapiPictureH264 *f0, *f1; + + fs = priv->prev_frames[pi->voc]; + if (!fs) + return NULL; + f0 = fs->buffers[0]; + if (!slice_hdr->field_pic_flag) { + if (fill_gaps && !gst_vaapi_frame_store_has_frame (fs)) + fill_picture_other_field_gap (decoder, f0); + return NULL; + } + + /* At this point, the current frame is known to be interlaced */ + if (gst_vaapi_frame_store_has_frame (fs)) { f1 = NULL; - if (fill_gaps) { - fill_picture_other_field_gap(decoder, f0); - if (!same_field_parity(f0, slice_hdr)) - f1 = fill_picture_first_field_gap(decoder, f0); + if (fill_gaps && !same_field_parity (f0, slice_hdr)) + f1 = fill_picture_first_field_gap (decoder, f0); + return f1; + } + + /* At this point, the previous frame is interlaced and contains a + single field */ + if (f0->frame_num == slice_hdr->frame_num) { + f1 = f0; + if (fill_gaps && same_field_parity (f0, slice_hdr)) { + fill_picture_other_field_gap (decoder, f0); + f1 = NULL; } return f1; + } + + f1 = NULL; + if (fill_gaps) { + fill_picture_other_field_gap (decoder, f0); + if (!same_field_parity (f0, slice_hdr)) + f1 = fill_picture_first_field_gap (decoder, f0); + } + return f1; } static GstVaapiDecoderStatus -decode_picture(GstVaapiDecoderH264 *decoder, GstVaapiDecoderUnit *unit) +decode_picture (GstVaapiDecoderH264 * decoder, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiParserInfoH264 * const pi = unit->parsed_info; - GstH264SliceHdr * const slice_hdr = &pi->data.slice_hdr; - GstH264PPS * const pps = ensure_pps(decoder, slice_hdr->pps); - GstH264SPS * const sps = ensure_sps(decoder, slice_hdr->pps->sequence); - GstVaapiPictureH264 *picture, *first_field; - GstVaapiDecoderStatus status; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiParserInfoH264 *const pi = unit->parsed_info; + GstH264SliceHdr *const slice_hdr = &pi->data.slice_hdr; + GstH264PPS *const pps = ensure_pps (decoder, slice_hdr->pps); + GstH264SPS *const sps = ensure_sps (decoder, slice_hdr->pps->sequence); + GstVaapiPictureH264 *picture, *first_field; + GstVaapiDecoderStatus status; - g_return_val_if_fail(pps != NULL, GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN); - g_return_val_if_fail(sps != NULL, GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN); + g_return_val_if_fail (pps != NULL, GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN); + g_return_val_if_fail (sps != NULL, GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN); - /* Only decode base stream for MVC */ - switch (sps->profile_idc) { + /* Only decode base stream for MVC */ + switch (sps->profile_idc) { case GST_H264_PROFILE_MULTIVIEW_HIGH: case GST_H264_PROFILE_STEREO_HIGH: - break; - } + break; + } - status = ensure_context(decoder, sps); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; + status = ensure_context (decoder, sps); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; - priv->decoder_state = 0; - gst_vaapi_picture_replace(&priv->missing_picture, NULL); + priv->decoder_state = 0; + gst_vaapi_picture_replace (&priv->missing_picture, NULL); - first_field = find_first_field(decoder, pi, TRUE); - if (first_field) { - /* Re-use current picture where the first field was decoded */ - picture = gst_vaapi_picture_h264_new_field(first_field); - if (!picture) { - GST_ERROR("failed to allocate field picture"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } - } - else { - /* Create new picture */ - picture = gst_vaapi_picture_h264_new(decoder); - if (!picture) { - GST_ERROR("failed to allocate picture"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } - } - gst_vaapi_picture_replace(&priv->current_picture, picture); - gst_vaapi_picture_unref(picture); + first_field = find_first_field (decoder, pi, TRUE); + if (first_field) { + /* Re-use current picture where the first field was decoded */ + picture = gst_vaapi_picture_h264_new_field (first_field); + if (!picture) { + GST_ERROR ("failed to allocate field picture"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } + } else { + /* Create new picture */ + picture = gst_vaapi_picture_h264_new (decoder); + if (!picture) { + GST_ERROR ("failed to allocate picture"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } + } + gst_vaapi_picture_replace (&priv->current_picture, picture); + gst_vaapi_picture_unref (picture); + + /* Clear inter-view references list if this is the primary coded + picture of the current access unit */ + if (pi->flags & GST_VAAPI_DECODER_UNIT_FLAG_AU_START) + g_ptr_array_set_size (priv->inter_views, 0); + + /* Update cropping rectangle */ + if (sps->frame_cropping_flag) { + GstVaapiRectangle crop_rect; + crop_rect.x = sps->crop_rect_x; + crop_rect.y = sps->crop_rect_y; + crop_rect.width = sps->crop_rect_width; + crop_rect.height = sps->crop_rect_height; + gst_vaapi_picture_set_crop_rect (&picture->base, &crop_rect); + } + + status = ensure_quant_matrix (decoder, picture); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) { + GST_ERROR ("failed to reset quantizer matrix"); + return status; + } - /* Clear inter-view references list if this is the primary coded - picture of the current access unit */ - if (pi->flags & GST_VAAPI_DECODER_UNIT_FLAG_AU_START) - g_ptr_array_set_size(priv->inter_views, 0); - - /* Update cropping rectangle */ - if (sps->frame_cropping_flag) { - GstVaapiRectangle crop_rect; - crop_rect.x = sps->crop_rect_x; - crop_rect.y = sps->crop_rect_y; - crop_rect.width = sps->crop_rect_width; - crop_rect.height = sps->crop_rect_height; - gst_vaapi_picture_set_crop_rect(&picture->base, &crop_rect); - } - - status = ensure_quant_matrix(decoder, picture); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) { - GST_ERROR("failed to reset quantizer matrix"); - return status; - } - - if (!init_picture(decoder, picture, pi)) - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - if (!fill_picture(decoder, picture)) - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + if (!init_picture (decoder, picture, pi)) + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + if (!fill_picture (decoder, picture)) + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - priv->decoder_state = pi->state; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + priv->decoder_state = pi->state; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static inline guint -get_slice_data_bit_offset(GstH264SliceHdr *slice_hdr, guint nal_header_bytes) +get_slice_data_bit_offset (GstH264SliceHdr * slice_hdr, guint nal_header_bytes) { - guint epb_count; + guint epb_count; - epb_count = slice_hdr->n_emulation_prevention_bytes; - return 8 * nal_header_bytes + slice_hdr->header_size - epb_count * 8; + epb_count = slice_hdr->n_emulation_prevention_bytes; + return 8 * nal_header_bytes + slice_hdr->header_size - epb_count * 8; } static gboolean -fill_pred_weight_table(GstVaapiDecoderH264 *decoder, - GstVaapiSlice *slice, GstH264SliceHdr *slice_hdr) +fill_pred_weight_table (GstVaapiDecoderH264 * decoder, + GstVaapiSlice * slice, GstH264SliceHdr * slice_hdr) { - VASliceParameterBufferH264 * const slice_param = slice->param; - GstH264PPS * const pps = get_pps(decoder); - GstH264SPS * const sps = get_sps(decoder); - GstH264PredWeightTable * const w = &slice_hdr->pred_weight_table; - guint num_weight_tables = 0; - gint i, j; - - if (pps->weighted_pred_flag && - (GST_H264_IS_P_SLICE(slice_hdr) || GST_H264_IS_SP_SLICE(slice_hdr))) - num_weight_tables = 1; - else if (pps->weighted_bipred_idc == 1 && GST_H264_IS_B_SLICE(slice_hdr)) - num_weight_tables = 2; - else - num_weight_tables = 0; + VASliceParameterBufferH264 *const slice_param = slice->param; + GstH264PPS *const pps = get_pps (decoder); + GstH264SPS *const sps = get_sps (decoder); + GstH264PredWeightTable *const w = &slice_hdr->pred_weight_table; + guint num_weight_tables = 0; + gint i, j; + + if (pps->weighted_pred_flag && + (GST_H264_IS_P_SLICE (slice_hdr) || GST_H264_IS_SP_SLICE (slice_hdr))) + num_weight_tables = 1; + else if (pps->weighted_bipred_idc == 1 && GST_H264_IS_B_SLICE (slice_hdr)) + num_weight_tables = 2; + else + num_weight_tables = 0; + + slice_param->luma_log2_weight_denom = 0; + slice_param->chroma_log2_weight_denom = 0; + slice_param->luma_weight_l0_flag = 0; + slice_param->chroma_weight_l0_flag = 0; + slice_param->luma_weight_l1_flag = 0; + slice_param->chroma_weight_l1_flag = 0; - slice_param->luma_log2_weight_denom = 0; - slice_param->chroma_log2_weight_denom = 0; - slice_param->luma_weight_l0_flag = 0; - slice_param->chroma_weight_l0_flag = 0; - slice_param->luma_weight_l1_flag = 0; - slice_param->chroma_weight_l1_flag = 0; + if (num_weight_tables < 1) + return TRUE; - if (num_weight_tables < 1) - return TRUE; + slice_param->luma_log2_weight_denom = w->luma_log2_weight_denom; + slice_param->chroma_log2_weight_denom = w->chroma_log2_weight_denom; - slice_param->luma_log2_weight_denom = w->luma_log2_weight_denom; - slice_param->chroma_log2_weight_denom = w->chroma_log2_weight_denom; + slice_param->luma_weight_l0_flag = 1; + for (i = 0; i <= slice_param->num_ref_idx_l0_active_minus1; i++) { + slice_param->luma_weight_l0[i] = w->luma_weight_l0[i]; + slice_param->luma_offset_l0[i] = w->luma_offset_l0[i]; + } - slice_param->luma_weight_l0_flag = 1; + slice_param->chroma_weight_l0_flag = sps->chroma_array_type != 0; + if (slice_param->chroma_weight_l0_flag) { for (i = 0; i <= slice_param->num_ref_idx_l0_active_minus1; i++) { - slice_param->luma_weight_l0[i] = w->luma_weight_l0[i]; - slice_param->luma_offset_l0[i] = w->luma_offset_l0[i]; + for (j = 0; j < 2; j++) { + slice_param->chroma_weight_l0[i][j] = w->chroma_weight_l0[i][j]; + slice_param->chroma_offset_l0[i][j] = w->chroma_offset_l0[i][j]; + } } + } - slice_param->chroma_weight_l0_flag = sps->chroma_array_type != 0; - if (slice_param->chroma_weight_l0_flag) { - for (i = 0; i <= slice_param->num_ref_idx_l0_active_minus1; i++) { - for (j = 0; j < 2; j++) { - slice_param->chroma_weight_l0[i][j] = w->chroma_weight_l0[i][j]; - slice_param->chroma_offset_l0[i][j] = w->chroma_offset_l0[i][j]; - } - } - } + if (num_weight_tables < 2) + return TRUE; - if (num_weight_tables < 2) - return TRUE; + slice_param->luma_weight_l1_flag = 1; + for (i = 0; i <= slice_param->num_ref_idx_l1_active_minus1; i++) { + slice_param->luma_weight_l1[i] = w->luma_weight_l1[i]; + slice_param->luma_offset_l1[i] = w->luma_offset_l1[i]; + } - slice_param->luma_weight_l1_flag = 1; + slice_param->chroma_weight_l1_flag = sps->chroma_array_type != 0; + if (slice_param->chroma_weight_l1_flag) { for (i = 0; i <= slice_param->num_ref_idx_l1_active_minus1; i++) { - slice_param->luma_weight_l1[i] = w->luma_weight_l1[i]; - slice_param->luma_offset_l1[i] = w->luma_offset_l1[i]; + for (j = 0; j < 2; j++) { + slice_param->chroma_weight_l1[i][j] = w->chroma_weight_l1[i][j]; + slice_param->chroma_offset_l1[i][j] = w->chroma_offset_l1[i][j]; + } } - - slice_param->chroma_weight_l1_flag = sps->chroma_array_type != 0; - if (slice_param->chroma_weight_l1_flag) { - for (i = 0; i <= slice_param->num_ref_idx_l1_active_minus1; i++) { - for (j = 0; j < 2; j++) { - slice_param->chroma_weight_l1[i][j] = w->chroma_weight_l1[i][j]; - slice_param->chroma_offset_l1[i][j] = w->chroma_offset_l1[i][j]; - } - } - } - return TRUE; + } + return TRUE; } static gboolean -fill_RefPicList(GstVaapiDecoderH264 *decoder, - GstVaapiSlice *slice, GstH264SliceHdr *slice_hdr) +fill_RefPicList (GstVaapiDecoderH264 * decoder, + GstVaapiSlice * slice, GstH264SliceHdr * slice_hdr) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - VASliceParameterBufferH264 * const slice_param = slice->param; - guint i, num_ref_lists = 0; - - slice_param->num_ref_idx_l0_active_minus1 = 0; - slice_param->num_ref_idx_l1_active_minus1 = 0; - - if (GST_H264_IS_B_SLICE(slice_hdr)) - num_ref_lists = 2; - else if (GST_H264_IS_I_SLICE(slice_hdr)) - num_ref_lists = 0; - else - num_ref_lists = 1; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + VASliceParameterBufferH264 *const slice_param = slice->param; + guint i, num_ref_lists = 0; + + slice_param->num_ref_idx_l0_active_minus1 = 0; + slice_param->num_ref_idx_l1_active_minus1 = 0; + + if (GST_H264_IS_B_SLICE (slice_hdr)) + num_ref_lists = 2; + else if (GST_H264_IS_I_SLICE (slice_hdr)) + num_ref_lists = 0; + else + num_ref_lists = 1; + + if (num_ref_lists < 1) + return TRUE; - if (num_ref_lists < 1) - return TRUE; + slice_param->num_ref_idx_l0_active_minus1 = + slice_hdr->num_ref_idx_l0_active_minus1; - slice_param->num_ref_idx_l0_active_minus1 = - slice_hdr->num_ref_idx_l0_active_minus1; + for (i = 0; i < priv->RefPicList0_count && priv->RefPicList0[i]; i++) + vaapi_fill_picture_for_RefPicListX (&slice_param->RefPicList0[i], + priv->RefPicList0[i]); + for (; i <= slice_param->num_ref_idx_l0_active_minus1; i++) + vaapi_init_picture (&slice_param->RefPicList0[i]); - for (i = 0; i < priv->RefPicList0_count && priv->RefPicList0[i]; i++) - vaapi_fill_picture_for_RefPicListX(&slice_param->RefPicList0[i], - priv->RefPicList0[i]); - for (; i <= slice_param->num_ref_idx_l0_active_minus1; i++) - vaapi_init_picture(&slice_param->RefPicList0[i]); - - if (num_ref_lists < 2) - return TRUE; - - slice_param->num_ref_idx_l1_active_minus1 = - slice_hdr->num_ref_idx_l1_active_minus1; - - for (i = 0; i < priv->RefPicList1_count && priv->RefPicList1[i]; i++) - vaapi_fill_picture_for_RefPicListX(&slice_param->RefPicList1[i], - priv->RefPicList1[i]); - for (; i <= slice_param->num_ref_idx_l1_active_minus1; i++) - vaapi_init_picture(&slice_param->RefPicList1[i]); + if (num_ref_lists < 2) return TRUE; + + slice_param->num_ref_idx_l1_active_minus1 = + slice_hdr->num_ref_idx_l1_active_minus1; + + for (i = 0; i < priv->RefPicList1_count && priv->RefPicList1[i]; i++) + vaapi_fill_picture_for_RefPicListX (&slice_param->RefPicList1[i], + priv->RefPicList1[i]); + for (; i <= slice_param->num_ref_idx_l1_active_minus1; i++) + vaapi_init_picture (&slice_param->RefPicList1[i]); + return TRUE; } static gboolean -fill_slice(GstVaapiDecoderH264 *decoder, - GstVaapiSlice *slice, GstVaapiParserInfoH264 *pi) +fill_slice (GstVaapiDecoderH264 * decoder, + GstVaapiSlice * slice, GstVaapiParserInfoH264 * pi) { - VASliceParameterBufferH264 * const slice_param = slice->param; - GstH264SliceHdr * const slice_hdr = &pi->data.slice_hdr; + VASliceParameterBufferH264 *const slice_param = slice->param; + GstH264SliceHdr *const slice_hdr = &pi->data.slice_hdr; - /* Fill in VASliceParameterBufferH264 */ - slice_param->slice_data_bit_offset = - get_slice_data_bit_offset(slice_hdr, pi->nalu.header_bytes); - slice_param->first_mb_in_slice = slice_hdr->first_mb_in_slice; - slice_param->slice_type = slice_hdr->type % 5; - slice_param->direct_spatial_mv_pred_flag = slice_hdr->direct_spatial_mv_pred_flag; - slice_param->cabac_init_idc = slice_hdr->cabac_init_idc; - slice_param->slice_qp_delta = slice_hdr->slice_qp_delta; - slice_param->disable_deblocking_filter_idc = slice_hdr->disable_deblocking_filter_idc; - slice_param->slice_alpha_c0_offset_div2 = slice_hdr->slice_alpha_c0_offset_div2; - slice_param->slice_beta_offset_div2 = slice_hdr->slice_beta_offset_div2; + /* Fill in VASliceParameterBufferH264 */ + slice_param->slice_data_bit_offset = + get_slice_data_bit_offset (slice_hdr, pi->nalu.header_bytes); + slice_param->first_mb_in_slice = slice_hdr->first_mb_in_slice; + slice_param->slice_type = slice_hdr->type % 5; + slice_param->direct_spatial_mv_pred_flag = + slice_hdr->direct_spatial_mv_pred_flag; + slice_param->cabac_init_idc = slice_hdr->cabac_init_idc; + slice_param->slice_qp_delta = slice_hdr->slice_qp_delta; + slice_param->disable_deblocking_filter_idc = + slice_hdr->disable_deblocking_filter_idc; + slice_param->slice_alpha_c0_offset_div2 = + slice_hdr->slice_alpha_c0_offset_div2; + slice_param->slice_beta_offset_div2 = slice_hdr->slice_beta_offset_div2; - if (!fill_RefPicList(decoder, slice, slice_hdr)) - return FALSE; - if (!fill_pred_weight_table(decoder, slice, slice_hdr)) - return FALSE; - return TRUE; + if (!fill_RefPicList (decoder, slice, slice_hdr)) + return FALSE; + if (!fill_pred_weight_table (decoder, slice, slice_hdr)) + return FALSE; + return TRUE; } static GstVaapiDecoderStatus -decode_slice(GstVaapiDecoderH264 *decoder, GstVaapiDecoderUnit *unit) +decode_slice (GstVaapiDecoderH264 * decoder, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiParserInfoH264 * const pi = unit->parsed_info; - GstVaapiPictureH264 * const picture = priv->current_picture; - GstH264SliceHdr * const slice_hdr = &pi->data.slice_hdr; - GstVaapiSlice *slice; - GstBuffer * const buffer = - GST_VAAPI_DECODER_CODEC_FRAME(decoder)->input_buffer; - GstMapInfo map_info; - - GST_DEBUG("slice (%u bytes)", pi->nalu.size); + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiParserInfoH264 *const pi = unit->parsed_info; + GstVaapiPictureH264 *const picture = priv->current_picture; + GstH264SliceHdr *const slice_hdr = &pi->data.slice_hdr; + GstVaapiSlice *slice; + GstBuffer *const buffer = + GST_VAAPI_DECODER_CODEC_FRAME (decoder)->input_buffer; + GstMapInfo map_info; - if (!is_valid_state(pi->state, - GST_H264_VIDEO_STATE_VALID_PICTURE_HEADERS)) { - GST_WARNING("failed to receive enough headers to decode slice"); - return GST_VAAPI_DECODER_STATUS_SUCCESS; - } - - if (!ensure_pps(decoder, slice_hdr->pps)) { - GST_ERROR("failed to activate PPS"); - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - } + GST_DEBUG ("slice (%u bytes)", pi->nalu.size); - if (!ensure_sps(decoder, slice_hdr->pps->sequence)) { - GST_ERROR("failed to activate SPS"); - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - } + if (!is_valid_state (pi->state, GST_H264_VIDEO_STATE_VALID_PICTURE_HEADERS)) { + GST_WARNING ("failed to receive enough headers to decode slice"); + return GST_VAAPI_DECODER_STATUS_SUCCESS; + } - if (!gst_buffer_map(buffer, &map_info, GST_MAP_READ)) { - GST_ERROR("failed to map buffer"); - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - } + if (!ensure_pps (decoder, slice_hdr->pps)) { + GST_ERROR ("failed to activate PPS"); + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + } - /* Check wether this is the first/last slice in the current access unit */ - if (pi->flags & GST_VAAPI_DECODER_UNIT_FLAG_AU_START) - GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_AU_START); - if (pi->flags & GST_VAAPI_DECODER_UNIT_FLAG_AU_END) - GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_AU_END); + if (!ensure_sps (decoder, slice_hdr->pps->sequence)) { + GST_ERROR ("failed to activate SPS"); + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + } - slice = GST_VAAPI_SLICE_NEW(H264, decoder, - (map_info.data + unit->offset + pi->nalu.offset), pi->nalu.size); - gst_buffer_unmap(buffer, &map_info); - if (!slice) { - GST_ERROR("failed to allocate slice"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } + if (!gst_buffer_map (buffer, &map_info, GST_MAP_READ)) { + GST_ERROR ("failed to map buffer"); + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + } - init_picture_refs(decoder, picture, slice_hdr); - if (!fill_slice(decoder, slice, pi)) { - gst_vaapi_mini_object_unref(GST_VAAPI_MINI_OBJECT(slice)); - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - } + /* Check wether this is the first/last slice in the current access unit */ + if (pi->flags & GST_VAAPI_DECODER_UNIT_FLAG_AU_START) + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_AU_START); + if (pi->flags & GST_VAAPI_DECODER_UNIT_FLAG_AU_END) + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_AU_END); + + slice = GST_VAAPI_SLICE_NEW (H264, decoder, + (map_info.data + unit->offset + pi->nalu.offset), pi->nalu.size); + gst_buffer_unmap (buffer, &map_info); + if (!slice) { + GST_ERROR ("failed to allocate slice"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } + + init_picture_refs (decoder, picture, slice_hdr); + if (!fill_slice (decoder, slice, pi)) { + gst_vaapi_mini_object_unref (GST_VAAPI_MINI_OBJECT (slice)); + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + } - gst_vaapi_picture_add_slice(GST_VAAPI_PICTURE_CAST(picture), slice); - picture->last_slice_hdr = slice_hdr; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + gst_vaapi_picture_add_slice (GST_VAAPI_PICTURE_CAST (picture), slice); + picture->last_slice_hdr = slice_hdr; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static inline gint -scan_for_start_code(GstAdapter *adapter, guint ofs, guint size, guint32 *scp) +scan_for_start_code (GstAdapter * adapter, guint ofs, guint size, guint32 * scp) { - return (gint)gst_adapter_masked_scan_uint32_peek(adapter, - 0xffffff00, 0x00000100, - ofs, size, - scp); + return (gint) gst_adapter_masked_scan_uint32_peek (adapter, + 0xffffff00, 0x00000100, ofs, size, scp); } static GstVaapiDecoderStatus -decode_unit(GstVaapiDecoderH264 *decoder, GstVaapiDecoderUnit *unit) +decode_unit (GstVaapiDecoderH264 * decoder, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiParserInfoH264 * const pi = unit->parsed_info; - GstVaapiDecoderStatus status; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiParserInfoH264 *const pi = unit->parsed_info; + GstVaapiDecoderStatus status; - priv->decoder_state |= pi->state; - switch (pi->nalu.type) { + priv->decoder_state |= pi->state; + switch (pi->nalu.type) { case GST_H264_NAL_SPS: - status = decode_sps(decoder, unit); - break; + status = decode_sps (decoder, unit); + break; case GST_H264_NAL_SUBSET_SPS: - status = decode_subset_sps(decoder, unit); - break; + status = decode_subset_sps (decoder, unit); + break; case GST_H264_NAL_PPS: - status = decode_pps(decoder, unit); - break; + status = decode_pps (decoder, unit); + break; case GST_H264_NAL_SLICE_EXT: case GST_H264_NAL_SLICE_IDR: - /* fall-through. IDR specifics are handled in init_picture() */ + /* fall-through. IDR specifics are handled in init_picture() */ case GST_H264_NAL_SLICE: - status = decode_slice(decoder, unit); - break; + status = decode_slice (decoder, unit); + break; case GST_H264_NAL_SEQ_END: case GST_H264_NAL_STREAM_END: - status = decode_sequence_end(decoder); - break; + status = decode_sequence_end (decoder); + break; case GST_H264_NAL_SEI: - status = decode_sei(decoder, unit); - break; + status = decode_sei (decoder, unit); + break; default: - GST_WARNING("unsupported NAL unit type %d", pi->nalu.type); - status = GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - break; - } - return status; + GST_WARNING ("unsupported NAL unit type %d", pi->nalu.type); + status = GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + break; + } + return status; } static GstVaapiDecoderStatus -gst_vaapi_decoder_h264_decode_codec_data(GstVaapiDecoder *base_decoder, - const guchar *buf, guint buf_size) +gst_vaapi_decoder_h264_decode_codec_data (GstVaapiDecoder * base_decoder, + const guchar * buf, guint buf_size) { - GstVaapiDecoderH264 * const decoder = - GST_VAAPI_DECODER_H264_CAST(base_decoder); - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiDecoderStatus status; - GstVaapiDecoderUnit unit; - GstVaapiParserInfoH264 *pi = NULL; - GstH264ParserResult result; - guint i, ofs, num_sps, num_pps; + GstVaapiDecoderH264 *const decoder = + GST_VAAPI_DECODER_H264_CAST (base_decoder); + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiDecoderStatus status; + GstVaapiDecoderUnit unit; + GstVaapiParserInfoH264 *pi = NULL; + GstH264ParserResult result; + guint i, ofs, num_sps, num_pps; + + unit.parsed_info = NULL; + + if (buf_size < 8) + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + + if (buf[0] != 1) { + GST_ERROR ("failed to decode codec-data, not in avcC format"); + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + } - unit.parsed_info = NULL; + priv->nal_length_size = (buf[4] & 0x03) + 1; - if (buf_size < 8) - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + num_sps = buf[5] & 0x1f; + ofs = 6; - if (buf[0] != 1) { - GST_ERROR("failed to decode codec-data, not in avcC format"); - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - } - - priv->nal_length_size = (buf[4] & 0x03) + 1; - - num_sps = buf[5] & 0x1f; - ofs = 6; - - for (i = 0; i < num_sps; i++) { - pi = gst_vaapi_parser_info_h264_new(); - if (!pi) - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - unit.parsed_info = pi; - - result = gst_h264_parser_identify_nalu_avc( - priv->parser, - buf, ofs, buf_size, 2, - &pi->nalu - ); - if (result != GST_H264_PARSER_OK) { - status = get_status(result); - goto cleanup; - } + for (i = 0; i < num_sps; i++) { + pi = gst_vaapi_parser_info_h264_new (); + if (!pi) + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + unit.parsed_info = pi; - status = parse_sps(decoder, &unit); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - goto cleanup; - ofs = pi->nalu.offset + pi->nalu.size; - - pi->state = priv->parser_state; - pi->flags = 0; - - status = decode_sps(decoder, &unit); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - goto cleanup; - gst_vaapi_parser_info_h264_replace(&pi, NULL); - } - - num_pps = buf[ofs]; - ofs++; - - for (i = 0; i < num_pps; i++) { - pi = gst_vaapi_parser_info_h264_new(); - if (!pi) - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - unit.parsed_info = pi; - - result = gst_h264_parser_identify_nalu_avc( - priv->parser, - buf, ofs, buf_size, 2, - &pi->nalu - ); - if (result != GST_H264_PARSER_OK) { - status = get_status(result); - goto cleanup; - } + result = gst_h264_parser_identify_nalu_avc (priv->parser, + buf, ofs, buf_size, 2, &pi->nalu); + if (result != GST_H264_PARSER_OK) { + status = get_status (result); + goto cleanup; + } + + status = parse_sps (decoder, &unit); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + goto cleanup; + ofs = pi->nalu.offset + pi->nalu.size; + + pi->state = priv->parser_state; + pi->flags = 0; + + status = decode_sps (decoder, &unit); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + goto cleanup; + gst_vaapi_parser_info_h264_replace (&pi, NULL); + } + + num_pps = buf[ofs]; + ofs++; + + for (i = 0; i < num_pps; i++) { + pi = gst_vaapi_parser_info_h264_new (); + if (!pi) + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + unit.parsed_info = pi; - status = parse_pps(decoder, &unit); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - goto cleanup; - ofs = pi->nalu.offset + pi->nalu.size; - - pi->state = priv->parser_state; - pi->flags = 0; - - status = decode_pps(decoder, &unit); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - goto cleanup; - gst_vaapi_parser_info_h264_replace(&pi, NULL); + result = gst_h264_parser_identify_nalu_avc (priv->parser, + buf, ofs, buf_size, 2, &pi->nalu); + if (result != GST_H264_PARSER_OK) { + status = get_status (result); + goto cleanup; } - priv->is_avcC = TRUE; - status = GST_VAAPI_DECODER_STATUS_SUCCESS; + status = parse_pps (decoder, &unit); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + goto cleanup; + ofs = pi->nalu.offset + pi->nalu.size; + + pi->state = priv->parser_state; + pi->flags = 0; + + status = decode_pps (decoder, &unit); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + goto cleanup; + gst_vaapi_parser_info_h264_replace (&pi, NULL); + } + + priv->is_avcC = TRUE; + status = GST_VAAPI_DECODER_STATUS_SUCCESS; cleanup: - gst_vaapi_parser_info_h264_replace(&pi, NULL); - return status; + gst_vaapi_parser_info_h264_replace (&pi, NULL); + return status; } static GstVaapiDecoderStatus -ensure_decoder(GstVaapiDecoderH264 *decoder) +ensure_decoder (GstVaapiDecoderH264 * decoder) { - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiDecoderStatus status; + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiDecoderStatus status; - if (!priv->is_opened) { - priv->is_opened = gst_vaapi_decoder_h264_open(decoder); - if (!priv->is_opened) - return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC; - - status = gst_vaapi_decoder_decode_codec_data( - GST_VAAPI_DECODER_CAST(decoder)); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - } - return GST_VAAPI_DECODER_STATUS_SUCCESS; + if (!priv->is_opened) { + priv->is_opened = gst_vaapi_decoder_h264_open (decoder); + if (!priv->is_opened) + return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC; + + status = + gst_vaapi_decoder_decode_codec_data (GST_VAAPI_DECODER_CAST (decoder)); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; + } + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -gst_vaapi_decoder_h264_parse(GstVaapiDecoder *base_decoder, - GstAdapter *adapter, gboolean at_eos, GstVaapiDecoderUnit *unit) +gst_vaapi_decoder_h264_parse (GstVaapiDecoder * base_decoder, + GstAdapter * adapter, gboolean at_eos, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderH264 * const decoder = - GST_VAAPI_DECODER_H264_CAST(base_decoder); - GstVaapiDecoderH264Private * const priv = &decoder->priv; - GstVaapiParserState * const ps = GST_VAAPI_PARSER_STATE(base_decoder); - GstVaapiParserInfoH264 *pi; - GstVaapiDecoderStatus status; - GstH264ParserResult result; - guchar *buf; - guint i, size, buf_size, nalu_size, flags; - guint32 start_code; - gint ofs, ofs2; - gboolean at_au_end = FALSE; + GstVaapiDecoderH264 *const decoder = + GST_VAAPI_DECODER_H264_CAST (base_decoder); + GstVaapiDecoderH264Private *const priv = &decoder->priv; + GstVaapiParserState *const ps = GST_VAAPI_PARSER_STATE (base_decoder); + GstVaapiParserInfoH264 *pi; + GstVaapiDecoderStatus status; + GstH264ParserResult result; + guchar *buf; + guint i, size, buf_size, nalu_size, flags; + guint32 start_code; + gint ofs, ofs2; + gboolean at_au_end = FALSE; - status = ensure_decoder(decoder); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; + status = ensure_decoder (decoder); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; - switch (priv->stream_alignment) { + switch (priv->stream_alignment) { case GST_VAAPI_STREAM_ALIGN_H264_NALU: case GST_VAAPI_STREAM_ALIGN_H264_AU: - size = gst_adapter_available_fast(adapter); - break; + size = gst_adapter_available_fast (adapter); + break; default: - size = gst_adapter_available(adapter); - break; - } - - if (priv->is_avcC) { - if (size < priv->nal_length_size) - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - - buf = (guchar *)&start_code; - g_assert(priv->nal_length_size <= sizeof(start_code)); - gst_adapter_copy(adapter, buf, 0, priv->nal_length_size); - - nalu_size = 0; - for (i = 0; i < priv->nal_length_size; i++) - nalu_size = (nalu_size << 8) | buf[i]; - - buf_size = priv->nal_length_size + nalu_size; - if (size < buf_size) - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - else if (priv->stream_alignment == GST_VAAPI_STREAM_ALIGN_H264_AU) - at_au_end = (buf_size == size); - } - else { - if (size < 4) - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - - if (priv->stream_alignment == GST_VAAPI_STREAM_ALIGN_H264_NALU) - buf_size = size; - else { - ofs = scan_for_start_code(adapter, 0, size, NULL); - if (ofs < 0) - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - - if (ofs > 0) { - gst_adapter_flush(adapter, ofs); - size -= ofs; - } - - ofs2 = ps->input_offset2 - ofs - 4; - if (ofs2 < 4) - ofs2 = 4; - - ofs = G_UNLIKELY(size < ofs2 + 4) ? -1 : - scan_for_start_code(adapter, ofs2, size - ofs2, NULL); - if (ofs < 0) { - // Assume the whole NAL unit is present if end-of-stream - // or stream buffers aligned on access unit boundaries - if (priv->stream_alignment == GST_VAAPI_STREAM_ALIGN_H264_AU) - at_au_end = TRUE; - else if (!at_eos) { - ps->input_offset2 = size; - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - } - ofs = size; - } - buf_size = ofs; - } - } - ps->input_offset2 = 0; - - buf = (guchar *)gst_adapter_map(adapter, buf_size); - if (!buf) + size = gst_adapter_available (adapter); + break; + } + + if (priv->is_avcC) { + if (size < priv->nal_length_size) + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + + buf = (guchar *) & start_code; + g_assert (priv->nal_length_size <= sizeof (start_code)); + gst_adapter_copy (adapter, buf, 0, priv->nal_length_size); + + nalu_size = 0; + for (i = 0; i < priv->nal_length_size; i++) + nalu_size = (nalu_size << 8) | buf[i]; + + buf_size = priv->nal_length_size + nalu_size; + if (size < buf_size) + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + else if (priv->stream_alignment == GST_VAAPI_STREAM_ALIGN_H264_AU) + at_au_end = (buf_size == size); + } else { + if (size < 4) + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + + if (priv->stream_alignment == GST_VAAPI_STREAM_ALIGN_H264_NALU) { + buf_size = size; + ofs = scan_for_start_code (adapter, 4, size - 4, NULL); + if (ofs > 0) + buf_size = ofs; + } else { + ofs = scan_for_start_code (adapter, 0, size, NULL); + if (ofs < 0) return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - unit->size = buf_size; + if (ofs > 0) { + gst_adapter_flush (adapter, ofs); + size -= ofs; + } + + ofs2 = ps->input_offset2 - ofs - 4; + if (ofs2 < 4) + ofs2 = 4; + + ofs = G_UNLIKELY (size < ofs2 + 4) ? -1 : + scan_for_start_code (adapter, ofs2, size - ofs2, NULL); + if (ofs < 0) { + // Assume the whole NAL unit is present if end-of-stream + // or stream buffers aligned on access unit boundaries + if (priv->stream_alignment == GST_VAAPI_STREAM_ALIGN_H264_AU) + at_au_end = TRUE; + else if (!at_eos) { + ps->input_offset2 = size; + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + } + ofs = size; + } + buf_size = ofs; + } + } + ps->input_offset2 = 0; + + buf = (guchar *) gst_adapter_map (adapter, buf_size); + if (!buf) + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + + unit->size = buf_size; + + pi = gst_vaapi_parser_info_h264_new (); + if (!pi) + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + + gst_vaapi_decoder_unit_set_parsed_info (unit, + pi, (GDestroyNotify) gst_vaapi_mini_object_unref); + + if (priv->is_avcC) + result = gst_h264_parser_identify_nalu_avc (priv->parser, + buf, 0, buf_size, priv->nal_length_size, &pi->nalu); + else + result = gst_h264_parser_identify_nalu_unchecked (priv->parser, + buf, 0, buf_size, &pi->nalu); + status = get_status (result); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + goto exit; - pi = gst_vaapi_parser_info_h264_new(); - if (!pi) - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - - gst_vaapi_decoder_unit_set_parsed_info(unit, - pi, (GDestroyNotify)gst_vaapi_mini_object_unref); - - if (priv->is_avcC) - result = gst_h264_parser_identify_nalu_avc(priv->parser, - buf, 0, buf_size, priv->nal_length_size, &pi->nalu); - else - result = gst_h264_parser_identify_nalu_unchecked(priv->parser, - buf, 0, buf_size, &pi->nalu); - status = get_status(result); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - - switch (pi->nalu.type) { + switch (pi->nalu.type) { case GST_H264_NAL_SPS: - status = parse_sps(decoder, unit); - break; + status = parse_sps (decoder, unit); + break; case GST_H264_NAL_SUBSET_SPS: - status = parse_subset_sps(decoder, unit); - break; + status = parse_subset_sps (decoder, unit); + break; case GST_H264_NAL_PPS: - status = parse_pps(decoder, unit); - break; + status = parse_pps (decoder, unit); + break; case GST_H264_NAL_SEI: - status = parse_sei(decoder, unit); - break; + status = parse_sei (decoder, unit); + break; case GST_H264_NAL_SLICE_EXT: - if (!GST_H264_IS_MVC_NALU(&pi->nalu)) { - status = GST_VAAPI_DECODER_STATUS_SUCCESS; - break; - } - /* fall-through */ + if (!GST_H264_IS_MVC_NALU (&pi->nalu)) { + status = GST_VAAPI_DECODER_STATUS_SUCCESS; + break; + } + /* fall-through */ case GST_H264_NAL_SLICE_IDR: case GST_H264_NAL_SLICE: - status = parse_slice(decoder, unit); - break; + status = parse_slice (decoder, unit); + break; default: - status = GST_VAAPI_DECODER_STATUS_SUCCESS; - break; - } - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - - flags = 0; - if (at_au_end) { - flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_END | - GST_VAAPI_DECODER_UNIT_FLAG_AU_END; - } - switch (pi->nalu.type) { + status = GST_VAAPI_DECODER_STATUS_SUCCESS; + break; + } + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + goto exit; + + flags = 0; + if (at_au_end) { + flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_END | + GST_VAAPI_DECODER_UNIT_FLAG_AU_END; + } + switch (pi->nalu.type) { case GST_H264_NAL_AU_DELIMITER: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_AU_START; - flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; - /* fall-through */ + flags |= GST_VAAPI_DECODER_UNIT_FLAG_AU_START; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; + /* fall-through */ case GST_H264_NAL_FILLER_DATA: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP; - break; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP; + break; case GST_H264_NAL_STREAM_END: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_STREAM_END; - /* fall-through */ + flags |= GST_VAAPI_DECODER_UNIT_FLAG_STREAM_END; + /* fall-through */ case GST_H264_NAL_SEQ_END: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_END; - flags |= GST_VAAPI_DECODER_UNIT_FLAG_AU_END; - break; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_END; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_AU_END; + break; case GST_H264_NAL_SPS: case GST_H264_NAL_SUBSET_SPS: case GST_H264_NAL_PPS: case GST_H264_NAL_SEI: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_AU_START; - flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; - break; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_AU_START; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; + break; case GST_H264_NAL_SLICE_EXT: - if (!GST_H264_IS_MVC_NALU(&pi->nalu)) { - flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP; - break; - } - /* fall-through */ + if (!GST_H264_IS_MVC_NALU (&pi->nalu)) { + flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP; + break; + } + /* fall-through */ case GST_H264_NAL_SLICE_IDR: case GST_H264_NAL_SLICE: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_SLICE; - if (priv->prev_pi && - (priv->prev_pi->flags & GST_VAAPI_DECODER_UNIT_FLAG_AU_END)) { - flags |= GST_VAAPI_DECODER_UNIT_FLAG_AU_START | - GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; - } - else if (is_new_picture(pi, priv->prev_slice_pi)) { - flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; - if (is_new_access_unit(pi, priv->prev_slice_pi)) - flags |= GST_VAAPI_DECODER_UNIT_FLAG_AU_START; - } - gst_vaapi_parser_info_h264_replace(&priv->prev_slice_pi, pi); - break; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_SLICE; + if (priv->prev_pi && + (priv->prev_pi->flags & GST_VAAPI_DECODER_UNIT_FLAG_AU_END)) { + flags |= GST_VAAPI_DECODER_UNIT_FLAG_AU_START | + GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; + } else if (is_new_picture (pi, priv->prev_slice_pi)) { + flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; + if (is_new_access_unit (pi, priv->prev_slice_pi)) + flags |= GST_VAAPI_DECODER_UNIT_FLAG_AU_START; + } + gst_vaapi_parser_info_h264_replace (&priv->prev_slice_pi, pi); + break; case GST_H264_NAL_SPS_EXT: case GST_H264_NAL_SLICE_AUX: - /* skip SPS extension and auxiliary slice for now */ - flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP; - break; + /* skip SPS extension and auxiliary slice for now */ + flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP; + break; case GST_H264_NAL_PREFIX_UNIT: - /* skip Prefix NAL units for now */ - flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP | - GST_VAAPI_DECODER_UNIT_FLAG_AU_START | - GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; - break; + /* skip Prefix NAL units for now */ + flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP | + GST_VAAPI_DECODER_UNIT_FLAG_AU_START | + GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; + break; default: - if (pi->nalu.type >= 14 && pi->nalu.type <= 18) - flags |= GST_VAAPI_DECODER_UNIT_FLAG_AU_START | - GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; - break; - } - if ((flags & GST_VAAPI_DECODER_UNIT_FLAGS_AU) && priv->prev_slice_pi) - priv->prev_slice_pi->flags |= GST_VAAPI_DECODER_UNIT_FLAG_AU_END; - GST_VAAPI_DECODER_UNIT_FLAG_SET(unit, flags); - - pi->nalu.data = NULL; - pi->state = priv->parser_state; - pi->flags = flags; - gst_vaapi_parser_info_h264_replace(&priv->prev_pi, pi); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + if (pi->nalu.type >= 14 && pi->nalu.type <= 18) + flags |= GST_VAAPI_DECODER_UNIT_FLAG_AU_START | + GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; + break; + } + if ((flags & GST_VAAPI_DECODER_UNIT_FLAGS_AU) && priv->prev_slice_pi) + priv->prev_slice_pi->flags |= GST_VAAPI_DECODER_UNIT_FLAG_AU_END; + GST_VAAPI_DECODER_UNIT_FLAG_SET (unit, flags); + + pi->nalu.data = NULL; + pi->state = priv->parser_state; + pi->flags = flags; + gst_vaapi_parser_info_h264_replace (&priv->prev_pi, pi); + return GST_VAAPI_DECODER_STATUS_SUCCESS; + +exit: + gst_vaapi_parser_info_h264_unref (pi); + return status; } static GstVaapiDecoderStatus -gst_vaapi_decoder_h264_decode(GstVaapiDecoder *base_decoder, - GstVaapiDecoderUnit *unit) +gst_vaapi_decoder_h264_decode (GstVaapiDecoder * base_decoder, + GstVaapiDecoderUnit * unit) { - GstVaapiDecoderH264 * const decoder = - GST_VAAPI_DECODER_H264_CAST(base_decoder); - GstVaapiDecoderStatus status; + GstVaapiDecoderH264 *const decoder = + GST_VAAPI_DECODER_H264_CAST (base_decoder); + GstVaapiDecoderStatus status; - status = ensure_decoder(decoder); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - return decode_unit(decoder, unit); + status = ensure_decoder (decoder); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; + return decode_unit (decoder, unit); } static GstVaapiDecoderStatus -gst_vaapi_decoder_h264_start_frame(GstVaapiDecoder *base_decoder, - GstVaapiDecoderUnit *unit) +gst_vaapi_decoder_h264_start_frame (GstVaapiDecoder * base_decoder, + GstVaapiDecoderUnit * unit) { - GstVaapiDecoderH264 * const decoder = - GST_VAAPI_DECODER_H264_CAST(base_decoder); + GstVaapiDecoderH264 *const decoder = + GST_VAAPI_DECODER_H264_CAST (base_decoder); - return decode_picture(decoder, unit); + return decode_picture (decoder, unit); } static GstVaapiDecoderStatus -gst_vaapi_decoder_h264_end_frame(GstVaapiDecoder *base_decoder) +gst_vaapi_decoder_h264_end_frame (GstVaapiDecoder * base_decoder) { - GstVaapiDecoderH264 * const decoder = - GST_VAAPI_DECODER_H264_CAST(base_decoder); + GstVaapiDecoderH264 *const decoder = + GST_VAAPI_DECODER_H264_CAST (base_decoder); - return decode_current_picture(decoder); + return decode_current_picture (decoder); } static GstVaapiDecoderStatus -gst_vaapi_decoder_h264_flush(GstVaapiDecoder *base_decoder) +gst_vaapi_decoder_h264_flush (GstVaapiDecoder * base_decoder) { - GstVaapiDecoderH264 * const decoder = - GST_VAAPI_DECODER_H264_CAST(base_decoder); + GstVaapiDecoderH264 *const decoder = + GST_VAAPI_DECODER_H264_CAST (base_decoder); - dpb_flush(decoder, NULL); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + dpb_flush (decoder, NULL); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static void -gst_vaapi_decoder_h264_class_init(GstVaapiDecoderH264Class *klass) +gst_vaapi_decoder_h264_class_init (GstVaapiDecoderH264Class * klass) { - GstVaapiMiniObjectClass * const object_class = - GST_VAAPI_MINI_OBJECT_CLASS(klass); - GstVaapiDecoderClass * const decoder_class = GST_VAAPI_DECODER_CLASS(klass); - - object_class->size = sizeof(GstVaapiDecoderH264); - object_class->finalize = (GDestroyNotify)gst_vaapi_decoder_finalize; - - decoder_class->create = gst_vaapi_decoder_h264_create; - decoder_class->destroy = gst_vaapi_decoder_h264_destroy; - decoder_class->parse = gst_vaapi_decoder_h264_parse; - decoder_class->decode = gst_vaapi_decoder_h264_decode; - decoder_class->start_frame = gst_vaapi_decoder_h264_start_frame; - decoder_class->end_frame = gst_vaapi_decoder_h264_end_frame; - decoder_class->flush = gst_vaapi_decoder_h264_flush; + GstVaapiMiniObjectClass *const object_class = + GST_VAAPI_MINI_OBJECT_CLASS (klass); + GstVaapiDecoderClass *const decoder_class = GST_VAAPI_DECODER_CLASS (klass); + + object_class->size = sizeof (GstVaapiDecoderH264); + object_class->finalize = (GDestroyNotify) gst_vaapi_decoder_finalize; + + decoder_class->create = gst_vaapi_decoder_h264_create; + decoder_class->destroy = gst_vaapi_decoder_h264_destroy; + decoder_class->parse = gst_vaapi_decoder_h264_parse; + decoder_class->decode = gst_vaapi_decoder_h264_decode; + decoder_class->start_frame = gst_vaapi_decoder_h264_start_frame; + decoder_class->end_frame = gst_vaapi_decoder_h264_end_frame; + decoder_class->flush = gst_vaapi_decoder_h264_flush; - decoder_class->decode_codec_data = - gst_vaapi_decoder_h264_decode_codec_data; + decoder_class->decode_codec_data = gst_vaapi_decoder_h264_decode_codec_data; } static inline const GstVaapiDecoderClass * -gst_vaapi_decoder_h264_class(void) +gst_vaapi_decoder_h264_class (void) { - static GstVaapiDecoderH264Class g_class; - static gsize g_class_init = FALSE; + static GstVaapiDecoderH264Class g_class; + static gsize g_class_init = FALSE; - if (g_once_init_enter(&g_class_init)) { - gst_vaapi_decoder_h264_class_init(&g_class); - g_once_init_leave(&g_class_init, TRUE); - } - return GST_VAAPI_DECODER_CLASS(&g_class); + if (g_once_init_enter (&g_class_init)) { + gst_vaapi_decoder_h264_class_init (&g_class); + g_once_init_leave (&g_class_init, TRUE); + } + return GST_VAAPI_DECODER_CLASS (&g_class); } /** @@ -4732,12 +4638,12 @@ * specific alignment, NAL unit boundaries, or access unit boundaries. */ void -gst_vaapi_decoder_h264_set_alignment(GstVaapiDecoderH264 *decoder, +gst_vaapi_decoder_h264_set_alignment (GstVaapiDecoderH264 * decoder, GstVaapiStreamAlignH264 alignment) { - g_return_if_fail(decoder != NULL); + g_return_if_fail (decoder != NULL); - decoder->priv.stream_alignment = alignment; + decoder->priv.stream_alignment = alignment; } /** @@ -4751,7 +4657,7 @@ * Return value: the newly allocated #GstVaapiDecoder object */ GstVaapiDecoder * -gst_vaapi_decoder_h264_new(GstVaapiDisplay *display, GstCaps *caps) +gst_vaapi_decoder_h264_new (GstVaapiDisplay * display, GstCaps * caps) { - return gst_vaapi_decoder_new(gst_vaapi_decoder_h264_class(), display, caps); + return gst_vaapi_decoder_new (gst_vaapi_decoder_h264_class (), display, caps); } diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_h265.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_h265.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_h265.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_h265.c 2016-04-20 15:27:22.000000000 +0000 @@ -603,7 +603,7 @@ static guint get_max_dec_frame_buffering (GstH265SPS * sps) { - guint max_dec_frame_buffering; + G_GNUC_UNUSED guint max_dec_frame_buffering; /* FIXME */ GstVaapiLevelH265 level; const GstVaapiH265LevelLimits *level_limits; @@ -1102,7 +1102,9 @@ priv->profile = profile; } - chroma_type = gst_vaapi_utils_h265_get_chroma_type (sps->chroma_format_idc); + chroma_type = + gst_vaapi_utils_h265_get_chroma_type (sps->chroma_format_idc, + sps->bit_depth_luma_minus8 + 8); if (!chroma_type) { GST_ERROR ("unsupported chroma_format_idc %u", sps->chroma_format_idc); return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT; @@ -1599,18 +1601,10 @@ memset (priv->RefPicList1, 0, sizeof (GstVaapiPictureH265 *) * 16); priv->RefPicList0_count = priv->RefPicList1_count = 0; - if (slice_hdr->dependent_slice_segment_flag) { - GstH265SliceHdr *tmp = &priv->prev_independent_slice_pi->data.slice_hdr; - num_ref_idx_l0_active_minus1 = tmp->num_ref_idx_l0_active_minus1; - num_ref_idx_l1_active_minus1 = tmp->num_ref_idx_l1_active_minus1; - ref_pic_list_modification = &tmp->ref_pic_list_modification; - type = tmp->type; - } else { - num_ref_idx_l0_active_minus1 = slice_hdr->num_ref_idx_l0_active_minus1; - num_ref_idx_l1_active_minus1 = slice_hdr->num_ref_idx_l1_active_minus1; - ref_pic_list_modification = &slice_hdr->ref_pic_list_modification; - type = slice_hdr->type; - } + num_ref_idx_l0_active_minus1 = slice_hdr->num_ref_idx_l0_active_minus1; + num_ref_idx_l1_active_minus1 = slice_hdr->num_ref_idx_l1_active_minus1; + ref_pic_list_modification = &slice_hdr->ref_pic_list_modification; + type = slice_hdr->type; /* decoding process for reference picture list construction needs to be * invoked only for P and B slice */ @@ -1885,8 +1879,8 @@ COPY_BFM (slice_parsing_fields, pps, cabac_init_present_flag); COPY_BFM (slice_parsing_fields, pps, output_flag_present_flag); COPY_BFM (slice_parsing_fields, pps, dependent_slice_segments_enabled_flag); - pic_param->slice_parsing_fields. - bits.pps_slice_chroma_qp_offsets_present_flag = + pic_param->slice_parsing_fields.bits. + pps_slice_chroma_qp_offsets_present_flag = pps->slice_chroma_qp_offsets_present_flag; COPY_BFM (slice_parsing_fields, sps, sample_adaptive_offset_enabled_flag); COPY_BFM (slice_parsing_fields, pps, deblocking_filter_override_enabled_flag); @@ -2432,7 +2426,6 @@ GstVaapiPictureH265 * picture, GstVaapiSlice * slice, GstVaapiParserInfoH265 * pi, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderH265Private *const priv = &decoder->priv; VASliceParameterBufferHEVC *const slice_param = slice->param; GstH265SliceHdr *slice_hdr = &pi->data.slice_hdr; @@ -2453,11 +2446,6 @@ COPY_LFF (dependent_slice_segment_flag); - /* use most recent independent slice segment header syntax elements - * for filling the missing fields in dependent slice segment header */ - if (slice_hdr->dependent_slice_segment_flag) - slice_hdr = &priv->prev_independent_slice_pi->data.slice_hdr; - COPY_LFF (mvd_l1_zero_flag); COPY_LFF (cabac_init_flag); COPY_LFF (collocated_from_l0_flag); @@ -2472,8 +2460,8 @@ slice_hdr->temporal_mvp_enabled_flag; slice_param->LongSliceFlags.fields.slice_deblocking_filter_disabled_flag = slice_hdr->deblocking_filter_disabled_flag; - slice_param->LongSliceFlags. - fields.slice_loop_filter_across_slices_enabled_flag = + slice_param->LongSliceFlags.fields. + slice_loop_filter_across_slices_enabled_flag = slice_hdr->loop_filter_across_slices_enabled_flag; if (!slice_hdr->temporal_mvp_enabled_flag) @@ -2662,13 +2650,15 @@ ofs = 23; for (i = 0; i < num_nal_arrays; i++) { num_nals = GST_READ_UINT16_BE (buf + ofs + 1); + ofs += 3; + for (j = 0; j < num_nals; j++) { pi = gst_vaapi_parser_info_h265_new (); if (!pi) return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; unit.parsed_info = pi; result = gst_h265_parser_identify_nalu_hevc (priv->parser, - buf, ofs + 3, buf_size, 2, &pi->nalu); + buf, ofs, buf_size, 2, &pi->nalu); if (result != GST_H265_PARSER_OK) { status = get_status (result); goto cleanup; @@ -2700,6 +2690,7 @@ goto cleanup; break; } + ofs = pi->nalu.offset + pi->nalu.size; gst_vaapi_parser_info_h265_replace (&pi, NULL); } } @@ -2729,6 +2720,18 @@ return GST_VAAPI_DECODER_STATUS_SUCCESS; } +static void +populate_dependent_slice_hdr (GstVaapiParserInfoH265 * pi, + GstVaapiParserInfoH265 * indep_pi) +{ + GstH265SliceHdr *slice_hdr = &pi->data.slice_hdr; + GstH265SliceHdr *indep_slice_hdr = &indep_pi->data.slice_hdr; + + memcpy (&slice_hdr->type, &indep_slice_hdr->type, + offsetof (GstH265SliceHdr, num_entry_point_offsets) - + offsetof (GstH265SliceHdr, type)); +} + static GstVaapiDecoderStatus gst_vaapi_decoder_h265_parse (GstVaapiDecoder * base_decoder, GstAdapter * adapter, gboolean at_eos, GstVaapiDecoderUnit * unit) @@ -2777,9 +2780,12 @@ } else { if (size < 4) return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - if (priv->stream_alignment == GST_VAAPI_STREAM_ALIGN_H265_NALU) + if (priv->stream_alignment == GST_VAAPI_STREAM_ALIGN_H265_NALU) { buf_size = size; - else { + ofs = scan_for_start_code (adapter, 4, size - 4, NULL); + if (ofs > 0) + buf_size = ofs; + } else { ofs = scan_for_start_code (adapter, 0, size, NULL); if (ofs < 0) return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; @@ -2825,7 +2831,7 @@ buf, 0, buf_size, &pi->nalu); status = get_status (result); if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; + goto exit; switch (pi->nalu.type) { case GST_H265_NAL_VPS: status = parse_vps (decoder, unit); @@ -2863,7 +2869,7 @@ break; } if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; + goto exit; flags = 0; if (at_au_end) { flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_END | @@ -2923,6 +2929,8 @@ if (!pi->data.slice_hdr.dependent_slice_segment_flag) gst_vaapi_parser_info_h265_replace (&priv->prev_independent_slice_pi, pi); + else + populate_dependent_slice_hdr (pi, priv->prev_independent_slice_pi); break; default: /* Fix */ @@ -2936,6 +2944,10 @@ pi->flags = flags; gst_vaapi_parser_info_h265_replace (&priv->prev_pi, pi); return GST_VAAPI_DECODER_STATUS_SUCCESS; + +exit: + gst_vaapi_parser_info_h265_unref (pi); + return status; } static GstVaapiDecoderStatus diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c 2016-03-24 11:36:59.000000000 +0000 @@ -46,35 +46,35 @@ #define GST_VAAPI_DECODER_JPEG_CAST(decoder) \ ((GstVaapiDecoderJpeg *)(decoder)) -typedef struct _GstVaapiDecoderJpegPrivate GstVaapiDecoderJpegPrivate; -typedef struct _GstVaapiDecoderJpegClass GstVaapiDecoderJpegClass; +typedef struct _GstVaapiDecoderJpegPrivate GstVaapiDecoderJpegPrivate; +typedef struct _GstVaapiDecoderJpegClass GstVaapiDecoderJpegClass; -typedef enum { - GST_JPEG_VIDEO_STATE_GOT_SOI = 1 << 0, - GST_JPEG_VIDEO_STATE_GOT_SOF = 1 << 1, - GST_JPEG_VIDEO_STATE_GOT_SOS = 1 << 2, - GST_JPEG_VIDEO_STATE_GOT_HUF_TABLE = 1 << 3, - GST_JPEG_VIDEO_STATE_GOT_IQ_TABLE = 1 << 4, - - GST_JPEG_VIDEO_STATE_VALID_PICTURE = ( - GST_JPEG_VIDEO_STATE_GOT_SOI | - GST_JPEG_VIDEO_STATE_GOT_SOF | - GST_JPEG_VIDEO_STATE_GOT_SOS), +typedef enum +{ + GST_JPEG_VIDEO_STATE_GOT_SOI = 1 << 0, + GST_JPEG_VIDEO_STATE_GOT_SOF = 1 << 1, + GST_JPEG_VIDEO_STATE_GOT_SOS = 1 << 2, + GST_JPEG_VIDEO_STATE_GOT_HUF_TABLE = 1 << 3, + GST_JPEG_VIDEO_STATE_GOT_IQ_TABLE = 1 << 4, + + GST_JPEG_VIDEO_STATE_VALID_PICTURE = (GST_JPEG_VIDEO_STATE_GOT_SOI | + GST_JPEG_VIDEO_STATE_GOT_SOF | GST_JPEG_VIDEO_STATE_GOT_SOS), } GstJpegVideoState; -struct _GstVaapiDecoderJpegPrivate { - GstVaapiProfile profile; - guint width; - guint height; - GstVaapiPicture *current_picture; - GstJpegFrameHdr frame_hdr; - GstJpegHuffmanTables huf_tables; - GstJpegQuantTables quant_tables; - guint mcu_restart; - guint parser_state; - guint decoder_state; - guint is_opened : 1; - guint profile_changed : 1; +struct _GstVaapiDecoderJpegPrivate +{ + GstVaapiProfile profile; + guint width; + guint height; + GstVaapiPicture *current_picture; + GstJpegFrameHdr frame_hdr; + GstJpegHuffmanTables huf_tables; + GstJpegQuantTables quant_tables; + guint mcu_restart; + guint parser_state; + guint decoder_state; + guint is_opened:1; + guint profile_changed:1; }; /** @@ -82,10 +82,11 @@ * * A decoder based on Jpeg. */ -struct _GstVaapiDecoderJpeg { - /*< private >*/ - GstVaapiDecoder parent_instance; - GstVaapiDecoderJpegPrivate priv; +struct _GstVaapiDecoderJpeg +{ + /*< private > */ + GstVaapiDecoder parent_instance; + GstVaapiDecoderJpegPrivate priv; }; /** @@ -93,122 +94,121 @@ * * A decoder class based on Jpeg. */ -struct _GstVaapiDecoderJpegClass { - /*< private >*/ - GstVaapiDecoderClass parent_class; +struct _GstVaapiDecoderJpegClass +{ + /*< private > */ + GstVaapiDecoderClass parent_class; }; static inline void -unit_set_marker_code(GstVaapiDecoderUnit *unit, GstJpegMarker marker) +unit_set_marker_code (GstVaapiDecoderUnit * unit, GstJpegMarker marker) { - unit->parsed_info = GSIZE_TO_POINTER(marker); + unit->parsed_info = GSIZE_TO_POINTER (marker); } static inline GstJpegMarker -unit_get_marker_code(GstVaapiDecoderUnit *unit) +unit_get_marker_code (GstVaapiDecoderUnit * unit) { - return GPOINTER_TO_SIZE(unit->parsed_info); + return GPOINTER_TO_SIZE (unit->parsed_info); } static void -gst_vaapi_decoder_jpeg_close(GstVaapiDecoderJpeg *decoder) +gst_vaapi_decoder_jpeg_close (GstVaapiDecoderJpeg * decoder) { - GstVaapiDecoderJpegPrivate * const priv = &decoder->priv; + GstVaapiDecoderJpegPrivate *const priv = &decoder->priv; - gst_vaapi_picture_replace(&priv->current_picture, NULL); + gst_vaapi_picture_replace (&priv->current_picture, NULL); - /* Reset all */ - priv->profile = GST_VAAPI_PROFILE_JPEG_BASELINE; - priv->width = 0; - priv->height = 0; - priv->is_opened = FALSE; - priv->profile_changed = TRUE; + /* Reset all */ + priv->profile = GST_VAAPI_PROFILE_JPEG_BASELINE; + priv->width = 0; + priv->height = 0; + priv->is_opened = FALSE; + priv->profile_changed = TRUE; } static gboolean -gst_vaapi_decoder_jpeg_open(GstVaapiDecoderJpeg *decoder) +gst_vaapi_decoder_jpeg_open (GstVaapiDecoderJpeg * decoder) { - GstVaapiDecoderJpegPrivate * const priv = &decoder->priv; + GstVaapiDecoderJpegPrivate *const priv = &decoder->priv; - gst_vaapi_decoder_jpeg_close(decoder); + gst_vaapi_decoder_jpeg_close (decoder); - priv->parser_state = 0; - priv->decoder_state = 0; - return TRUE; + priv->parser_state = 0; + priv->decoder_state = 0; + return TRUE; } static void -gst_vaapi_decoder_jpeg_destroy(GstVaapiDecoder *base_decoder) +gst_vaapi_decoder_jpeg_destroy (GstVaapiDecoder * base_decoder) { - GstVaapiDecoderJpeg * const decoder = - GST_VAAPI_DECODER_JPEG_CAST(base_decoder); + GstVaapiDecoderJpeg *const decoder = + GST_VAAPI_DECODER_JPEG_CAST (base_decoder); - gst_vaapi_decoder_jpeg_close(decoder); + gst_vaapi_decoder_jpeg_close (decoder); } static gboolean -gst_vaapi_decoder_jpeg_create(GstVaapiDecoder *base_decoder) +gst_vaapi_decoder_jpeg_create (GstVaapiDecoder * base_decoder) { - GstVaapiDecoderJpeg * const decoder = - GST_VAAPI_DECODER_JPEG_CAST(base_decoder); - GstVaapiDecoderJpegPrivate * const priv = &decoder->priv; - - priv->profile = GST_VAAPI_PROFILE_JPEG_BASELINE; - priv->profile_changed = TRUE; - return TRUE; + GstVaapiDecoderJpeg *const decoder = + GST_VAAPI_DECODER_JPEG_CAST (base_decoder); + GstVaapiDecoderJpegPrivate *const priv = &decoder->priv; + + priv->profile = GST_VAAPI_PROFILE_JPEG_BASELINE; + priv->profile_changed = TRUE; + return TRUE; } static GstVaapiDecoderStatus -ensure_context(GstVaapiDecoderJpeg *decoder) -{ - GstVaapiDecoderJpegPrivate * const priv = &decoder->priv; - GstVaapiProfile profiles[2]; - GstVaapiEntrypoint entrypoint = GST_VAAPI_ENTRYPOINT_VLD; - guint i, n_profiles = 0; - gboolean reset_context = FALSE; - - if (priv->profile_changed) { - GST_DEBUG("profile changed"); - priv->profile_changed = FALSE; - reset_context = TRUE; - - profiles[n_profiles++] = priv->profile; - //if (priv->profile == GST_VAAPI_PROFILE_JPEG_EXTENDED) - // profiles[n_profiles++] = GST_VAAPI_PROFILE_JPEG_BASELINE; - - for (i = 0; i < n_profiles; i++) { - if (gst_vaapi_display_has_decoder(GST_VAAPI_DECODER_DISPLAY(decoder), - profiles[i], entrypoint)) - break; - } - if (i == n_profiles) - return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; - priv->profile = profiles[i]; - } - - if (reset_context) { - GstVaapiContextInfo info; - - info.profile = priv->profile; - info.entrypoint = entrypoint; - info.chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420; - info.width = priv->width; - info.height = priv->height; - info.ref_frames = 2; - reset_context = gst_vaapi_decoder_ensure_context( - GST_VAAPI_DECODER(decoder), - &info - ); - if (!reset_context) - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - } - return GST_VAAPI_DECODER_STATUS_SUCCESS; +ensure_context (GstVaapiDecoderJpeg * decoder) +{ + GstVaapiDecoderJpegPrivate *const priv = &decoder->priv; + GstVaapiProfile profiles[2]; + GstVaapiEntrypoint entrypoint = GST_VAAPI_ENTRYPOINT_VLD; + guint i, n_profiles = 0; + gboolean reset_context = FALSE; + + if (priv->profile_changed) { + GST_DEBUG ("profile changed"); + priv->profile_changed = FALSE; + reset_context = TRUE; + + profiles[n_profiles++] = priv->profile; + //if (priv->profile == GST_VAAPI_PROFILE_JPEG_EXTENDED) + // profiles[n_profiles++] = GST_VAAPI_PROFILE_JPEG_BASELINE; + + for (i = 0; i < n_profiles; i++) { + if (gst_vaapi_display_has_decoder (GST_VAAPI_DECODER_DISPLAY (decoder), + profiles[i], entrypoint)) + break; + } + if (i == n_profiles) + return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; + priv->profile = profiles[i]; + } + + if (reset_context) { + GstVaapiContextInfo info; + + info.profile = priv->profile; + info.entrypoint = entrypoint; + info.chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420; + info.width = priv->width; + info.height = priv->height; + info.ref_frames = 2; + reset_context = + gst_vaapi_decoder_ensure_context (GST_VAAPI_DECODER (decoder), &info); + if (!reset_context) + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + } + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static inline gboolean -is_valid_state(guint state, guint ref_state) +is_valid_state (guint state, guint ref_state) { - return (state & ref_state) == ref_state; + return (state & ref_state) == ref_state; } #define VALID_STATE(TYPE, STATE) \ @@ -216,677 +216,662 @@ G_PASTE(GST_JPEG_VIDEO_STATE_,STATE)) static GstVaapiDecoderStatus -decode_current_picture(GstVaapiDecoderJpeg *decoder) +decode_current_picture (GstVaapiDecoderJpeg * decoder) { - GstVaapiDecoderJpegPrivate * const priv = &decoder->priv; - GstVaapiPicture * const picture = priv->current_picture; + GstVaapiDecoderJpegPrivate *const priv = &decoder->priv; + GstVaapiPicture *const picture = priv->current_picture; - if (!VALID_STATE(decoder, VALID_PICTURE)) - goto drop_frame; - priv->decoder_state = 0; - - if (!picture) - return GST_VAAPI_DECODER_STATUS_SUCCESS; - - if (!gst_vaapi_picture_decode(picture)) - goto error; - if (!gst_vaapi_picture_output(picture)) - goto error; - gst_vaapi_picture_replace(&priv->current_picture, NULL); + if (!VALID_STATE (decoder, VALID_PICTURE)) + goto drop_frame; + priv->decoder_state = 0; + + if (!picture) return GST_VAAPI_DECODER_STATUS_SUCCESS; + if (!gst_vaapi_picture_decode (picture)) + goto error; + if (!gst_vaapi_picture_output (picture)) + goto error; + gst_vaapi_picture_replace (&priv->current_picture, NULL); + return GST_VAAPI_DECODER_STATUS_SUCCESS; + error: - gst_vaapi_picture_replace(&priv->current_picture, NULL); - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + gst_vaapi_picture_replace (&priv->current_picture, NULL); + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; drop_frame: - priv->decoder_state = 0; - return (GstVaapiDecoderStatus) GST_VAAPI_DECODER_STATUS_DROP_FRAME; + priv->decoder_state = 0; + return (GstVaapiDecoderStatus) GST_VAAPI_DECODER_STATUS_DROP_FRAME; } static gboolean -fill_picture( - GstVaapiDecoderJpeg *decoder, - GstVaapiPicture *picture, - GstJpegFrameHdr *frame_hdr -) -{ - VAPictureParameterBufferJPEGBaseline * const pic_param = picture->param; - guint i; - - memset(pic_param, 0, sizeof(VAPictureParameterBufferJPEGBaseline)); - pic_param->picture_width = frame_hdr->width; - pic_param->picture_height = frame_hdr->height; - - pic_param->num_components = frame_hdr->num_components; - if (frame_hdr->num_components > 4) - return FALSE; - for (i = 0; i < pic_param->num_components; i++) { - pic_param->components[i].component_id = - frame_hdr->components[i].identifier; - pic_param->components[i].h_sampling_factor = - frame_hdr->components[i].horizontal_factor; - pic_param->components[i].v_sampling_factor = - frame_hdr->components[i].vertical_factor; - pic_param->components[i].quantiser_table_selector = - frame_hdr->components[i].quant_table_selector; - } - return TRUE; -} - -static GstVaapiDecoderStatus -fill_quantization_table(GstVaapiDecoderJpeg *decoder, GstVaapiPicture *picture) +fill_picture (GstVaapiDecoderJpeg * decoder, + GstVaapiPicture * picture, GstJpegFrameHdr * frame_hdr) { - GstVaapiDecoderJpegPrivate * const priv = &decoder->priv; - VAIQMatrixBufferJPEGBaseline *iq_matrix; - guint i, j, num_tables; - - if (!VALID_STATE(decoder, GOT_IQ_TABLE)) - gst_jpeg_get_default_quantization_tables(&priv->quant_tables); - - picture->iq_matrix = GST_VAAPI_IQ_MATRIX_NEW(JPEGBaseline, decoder); - if (!picture->iq_matrix) { - GST_ERROR("failed to allocate quantiser table"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } - iq_matrix = picture->iq_matrix->param; + VAPictureParameterBufferJPEGBaseline *const pic_param = picture->param; + guint i; - num_tables = MIN(G_N_ELEMENTS(iq_matrix->quantiser_table), - GST_JPEG_MAX_QUANT_ELEMENTS); + memset (pic_param, 0, sizeof (VAPictureParameterBufferJPEGBaseline)); + pic_param->picture_width = frame_hdr->width; + pic_param->picture_height = frame_hdr->height; - for (i = 0; i < num_tables; i++) { - GstJpegQuantTable * const quant_table = - &priv->quant_tables.quant_tables[i]; - - iq_matrix->load_quantiser_table[i] = quant_table->valid; - if (!iq_matrix->load_quantiser_table[i]) - continue; - - if (quant_table->quant_precision != 0) { - // Only Baseline profile is supported, thus 8-bit Qk values - GST_ERROR("unsupported quantization table element precision"); - return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT; - } + pic_param->num_components = frame_hdr->num_components; + if (frame_hdr->num_components > 4) + return FALSE; + for (i = 0; i < pic_param->num_components; i++) { + pic_param->components[i].component_id = frame_hdr->components[i].identifier; + pic_param->components[i].h_sampling_factor = + frame_hdr->components[i].horizontal_factor; + pic_param->components[i].v_sampling_factor = + frame_hdr->components[i].vertical_factor; + pic_param->components[i].quantiser_table_selector = + frame_hdr->components[i].quant_table_selector; + } + return TRUE; +} - for (j = 0; j < GST_JPEG_MAX_QUANT_ELEMENTS; j++) - iq_matrix->quantiser_table[i][j] = quant_table->quant_table[j]; - iq_matrix->load_quantiser_table[i] = 1; - quant_table->valid = FALSE; - } - return GST_VAAPI_DECODER_STATUS_SUCCESS; +static GstVaapiDecoderStatus +fill_quantization_table (GstVaapiDecoderJpeg * decoder, + GstVaapiPicture * picture) +{ + GstVaapiDecoderJpegPrivate *const priv = &decoder->priv; + VAIQMatrixBufferJPEGBaseline *iq_matrix; + guint i, j, num_tables; + + if (!VALID_STATE (decoder, GOT_IQ_TABLE)) + gst_jpeg_get_default_quantization_tables (&priv->quant_tables); + + picture->iq_matrix = GST_VAAPI_IQ_MATRIX_NEW (JPEGBaseline, decoder); + if (!picture->iq_matrix) { + GST_ERROR ("failed to allocate quantiser table"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } + iq_matrix = picture->iq_matrix->param; + + num_tables = MIN (G_N_ELEMENTS (iq_matrix->quantiser_table), + GST_JPEG_MAX_QUANT_ELEMENTS); + + for (i = 0; i < num_tables; i++) { + GstJpegQuantTable *const quant_table = &priv->quant_tables.quant_tables[i]; + + iq_matrix->load_quantiser_table[i] = quant_table->valid; + if (!iq_matrix->load_quantiser_table[i]) + continue; + + if (quant_table->quant_precision != 0) { + // Only Baseline profile is supported, thus 8-bit Qk values + GST_ERROR ("unsupported quantization table element precision"); + return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT; + } + + for (j = 0; j < GST_JPEG_MAX_QUANT_ELEMENTS; j++) + iq_matrix->quantiser_table[i][j] = quant_table->quant_table[j]; + iq_matrix->load_quantiser_table[i] = 1; + quant_table->valid = FALSE; + } + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static gboolean -huffman_tables_updated(const GstJpegHuffmanTables *huf_tables) +huffman_tables_updated (const GstJpegHuffmanTables * huf_tables) { - guint i; + guint i; - for (i = 0; i < G_N_ELEMENTS(huf_tables->dc_tables); i++) - if (huf_tables->dc_tables[i].valid) - return TRUE; - for (i = 0; i < G_N_ELEMENTS(huf_tables->ac_tables); i++) - if (huf_tables->ac_tables[i].valid) - return TRUE; - return FALSE; + for (i = 0; i < G_N_ELEMENTS (huf_tables->dc_tables); i++) + if (huf_tables->dc_tables[i].valid) + return TRUE; + for (i = 0; i < G_N_ELEMENTS (huf_tables->ac_tables); i++) + if (huf_tables->ac_tables[i].valid) + return TRUE; + return FALSE; } static void -huffman_tables_reset(GstJpegHuffmanTables *huf_tables) +huffman_tables_reset (GstJpegHuffmanTables * huf_tables) { - guint i; + guint i; - for (i = 0; i < G_N_ELEMENTS(huf_tables->dc_tables); i++) - huf_tables->dc_tables[i].valid = FALSE; - for (i = 0; i < G_N_ELEMENTS(huf_tables->ac_tables); i++) - huf_tables->ac_tables[i].valid = FALSE; + for (i = 0; i < G_N_ELEMENTS (huf_tables->dc_tables); i++) + huf_tables->dc_tables[i].valid = FALSE; + for (i = 0; i < G_N_ELEMENTS (huf_tables->ac_tables); i++) + huf_tables->ac_tables[i].valid = FALSE; } static void -fill_huffman_table(GstVaapiHuffmanTable *huf_table, - const GstJpegHuffmanTables *huf_tables) +fill_huffman_table (GstVaapiHuffmanTable * huf_table, + const GstJpegHuffmanTables * huf_tables) { - VAHuffmanTableBufferJPEGBaseline * const huffman_table = huf_table->param; - guint i, num_tables; + VAHuffmanTableBufferJPEGBaseline *const huffman_table = huf_table->param; + guint i, num_tables; - num_tables = MIN(G_N_ELEMENTS(huffman_table->huffman_table), - GST_JPEG_MAX_SCAN_COMPONENTS); + num_tables = MIN (G_N_ELEMENTS (huffman_table->huffman_table), + GST_JPEG_MAX_SCAN_COMPONENTS); - for (i = 0; i < num_tables; i++) { - huffman_table->load_huffman_table[i] = - huf_tables->dc_tables[i].valid && huf_tables->ac_tables[i].valid; - if (!huffman_table->load_huffman_table[i]) - continue; - - memcpy(huffman_table->huffman_table[i].num_dc_codes, - huf_tables->dc_tables[i].huf_bits, - sizeof(huffman_table->huffman_table[i].num_dc_codes)); - memcpy(huffman_table->huffman_table[i].dc_values, - huf_tables->dc_tables[i].huf_values, - sizeof(huffman_table->huffman_table[i].dc_values)); - memcpy(huffman_table->huffman_table[i].num_ac_codes, - huf_tables->ac_tables[i].huf_bits, - sizeof(huffman_table->huffman_table[i].num_ac_codes)); - memcpy(huffman_table->huffman_table[i].ac_values, - huf_tables->ac_tables[i].huf_values, - sizeof(huffman_table->huffman_table[i].ac_values)); - memset(huffman_table->huffman_table[i].pad, - 0, - sizeof(huffman_table->huffman_table[i].pad)); - } + for (i = 0; i < num_tables; i++) { + huffman_table->load_huffman_table[i] = + huf_tables->dc_tables[i].valid && huf_tables->ac_tables[i].valid; + if (!huffman_table->load_huffman_table[i]) + continue; + + memcpy (huffman_table->huffman_table[i].num_dc_codes, + huf_tables->dc_tables[i].huf_bits, + sizeof (huffman_table->huffman_table[i].num_dc_codes)); + memcpy (huffman_table->huffman_table[i].dc_values, + huf_tables->dc_tables[i].huf_values, + sizeof (huffman_table->huffman_table[i].dc_values)); + memcpy (huffman_table->huffman_table[i].num_ac_codes, + huf_tables->ac_tables[i].huf_bits, + sizeof (huffman_table->huffman_table[i].num_ac_codes)); + memcpy (huffman_table->huffman_table[i].ac_values, + huf_tables->ac_tables[i].huf_values, + sizeof (huffman_table->huffman_table[i].ac_values)); + memset (huffman_table->huffman_table[i].pad, + 0, sizeof (huffman_table->huffman_table[i].pad)); + } } static void -get_max_sampling_factors(const GstJpegFrameHdr *frame_hdr, - guint *h_max_ptr, guint *v_max_ptr) +get_max_sampling_factors (const GstJpegFrameHdr * frame_hdr, + guint * h_max_ptr, guint * v_max_ptr) { - guint h_max = frame_hdr->components[0].horizontal_factor; - guint v_max = frame_hdr->components[0].vertical_factor; - guint i; - - for (i = 1; i < frame_hdr->num_components; i++) { - const GstJpegFrameComponent * const fcp = &frame_hdr->components[i]; - if (h_max < fcp->horizontal_factor) - h_max = fcp->horizontal_factor; - if (v_max < fcp->vertical_factor) - v_max = fcp->vertical_factor; - } - - if (h_max_ptr) - *h_max_ptr = h_max; - if (v_max_ptr) - *v_max_ptr = v_max; + guint h_max = frame_hdr->components[0].horizontal_factor; + guint v_max = frame_hdr->components[0].vertical_factor; + guint i; + + for (i = 1; i < frame_hdr->num_components; i++) { + const GstJpegFrameComponent *const fcp = &frame_hdr->components[i]; + if (h_max < fcp->horizontal_factor) + h_max = fcp->horizontal_factor; + if (v_max < fcp->vertical_factor) + v_max = fcp->vertical_factor; + } + + if (h_max_ptr) + *h_max_ptr = h_max; + if (v_max_ptr) + *v_max_ptr = v_max; } static const GstJpegFrameComponent * -get_component(const GstJpegFrameHdr *frame_hdr, guint selector) +get_component (const GstJpegFrameHdr * frame_hdr, guint selector) { - guint i; + guint i; - for (i = 0; i < frame_hdr->num_components; i++) { - const GstJpegFrameComponent * const fcp = &frame_hdr->components[i]; - if (fcp->identifier == selector) - return fcp; - } - return NULL; + for (i = 0; i < frame_hdr->num_components; i++) { + const GstJpegFrameComponent *const fcp = &frame_hdr->components[i]; + if (fcp->identifier == selector) + return fcp; + } + return NULL; } static GstVaapiDecoderStatus -decode_picture(GstVaapiDecoderJpeg *decoder, GstJpegSegment *seg) +decode_picture (GstVaapiDecoderJpeg * decoder, GstJpegSegment * seg) { - GstVaapiDecoderJpegPrivate * const priv = &decoder->priv; - GstJpegFrameHdr * const frame_hdr = &priv->frame_hdr; + GstVaapiDecoderJpegPrivate *const priv = &decoder->priv; + GstJpegFrameHdr *const frame_hdr = &priv->frame_hdr; - if (!VALID_STATE(decoder, GOT_SOI)) - return GST_VAAPI_DECODER_STATUS_SUCCESS; + if (!VALID_STATE (decoder, GOT_SOI)) + return GST_VAAPI_DECODER_STATUS_SUCCESS; - switch (seg->marker) { + switch (seg->marker) { case GST_JPEG_MARKER_SOF_MIN: - priv->profile = GST_VAAPI_PROFILE_JPEG_BASELINE; - break; + priv->profile = GST_VAAPI_PROFILE_JPEG_BASELINE; + break; default: - GST_ERROR("unsupported profile %d", seg->marker); - return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; - } + GST_ERROR ("unsupported profile %d", seg->marker); + return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; + } - memset(frame_hdr, 0, sizeof(*frame_hdr)); - if (!gst_jpeg_segment_parse_frame_header(seg, frame_hdr)) { - GST_ERROR("failed to parse image"); - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - } - priv->height = frame_hdr->height; - priv->width = frame_hdr->width; + memset (frame_hdr, 0, sizeof (*frame_hdr)); + if (!gst_jpeg_segment_parse_frame_header (seg, frame_hdr)) { + GST_ERROR ("failed to parse image"); + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + } + priv->height = frame_hdr->height; + priv->width = frame_hdr->width; - priv->decoder_state |= GST_JPEG_VIDEO_STATE_GOT_SOF; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + priv->decoder_state |= GST_JPEG_VIDEO_STATE_GOT_SOF; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_huffman_table( - GstVaapiDecoderJpeg *decoder, - GstJpegSegment *seg -) -{ - GstVaapiDecoderJpegPrivate * const priv = &decoder->priv; - - if (!VALID_STATE(decoder, GOT_SOI)) - return GST_VAAPI_DECODER_STATUS_SUCCESS; - - if (!gst_jpeg_segment_parse_huffman_table(seg, &priv->huf_tables)) { - GST_ERROR("failed to parse Huffman table"); - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - } +decode_huffman_table (GstVaapiDecoderJpeg * decoder, GstJpegSegment * seg) +{ + GstVaapiDecoderJpegPrivate *const priv = &decoder->priv; - priv->decoder_state |= GST_JPEG_VIDEO_STATE_GOT_HUF_TABLE; + if (!VALID_STATE (decoder, GOT_SOI)) return GST_VAAPI_DECODER_STATUS_SUCCESS; + + if (!gst_jpeg_segment_parse_huffman_table (seg, &priv->huf_tables)) { + GST_ERROR ("failed to parse Huffman table"); + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + } + + priv->decoder_state |= GST_JPEG_VIDEO_STATE_GOT_HUF_TABLE; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_quant_table( - GstVaapiDecoderJpeg *decoder, - GstJpegSegment *seg -) -{ - GstVaapiDecoderJpegPrivate * const priv = &decoder->priv; - - if (!VALID_STATE(decoder, GOT_SOI)) - return GST_VAAPI_DECODER_STATUS_SUCCESS; - - if (!gst_jpeg_segment_parse_quantization_table(seg, &priv->quant_tables)) { - GST_ERROR("failed to parse quantization table"); - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - } +decode_quant_table (GstVaapiDecoderJpeg * decoder, GstJpegSegment * seg) +{ + GstVaapiDecoderJpegPrivate *const priv = &decoder->priv; - priv->decoder_state |= GST_JPEG_VIDEO_STATE_GOT_IQ_TABLE; + if (!VALID_STATE (decoder, GOT_SOI)) return GST_VAAPI_DECODER_STATUS_SUCCESS; + + if (!gst_jpeg_segment_parse_quantization_table (seg, &priv->quant_tables)) { + GST_ERROR ("failed to parse quantization table"); + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + } + + priv->decoder_state |= GST_JPEG_VIDEO_STATE_GOT_IQ_TABLE; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_restart_interval( - GstVaapiDecoderJpeg *decoder, - GstJpegSegment *seg -) -{ - GstVaapiDecoderJpegPrivate * const priv = &decoder->priv; - - if (!VALID_STATE(decoder, GOT_SOI)) - return GST_VAAPI_DECODER_STATUS_SUCCESS; - - if (!gst_jpeg_segment_parse_restart_interval(seg, &priv->mcu_restart)) { - GST_ERROR("failed to parse restart interval"); - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - } +decode_restart_interval (GstVaapiDecoderJpeg * decoder, GstJpegSegment * seg) +{ + GstVaapiDecoderJpegPrivate *const priv = &decoder->priv; + + if (!VALID_STATE (decoder, GOT_SOI)) return GST_VAAPI_DECODER_STATUS_SUCCESS; + + if (!gst_jpeg_segment_parse_restart_interval (seg, &priv->mcu_restart)) { + GST_ERROR ("failed to parse restart interval"); + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + } + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_scan(GstVaapiDecoderJpeg *decoder, GstJpegSegment *seg) +decode_scan (GstVaapiDecoderJpeg * decoder, GstJpegSegment * seg) { - GstVaapiDecoderJpegPrivate * const priv = &decoder->priv; - GstVaapiPicture * const picture = priv->current_picture; - GstVaapiSlice *slice; - VASliceParameterBufferJPEGBaseline *slice_param; - GstJpegScanHdr scan_hdr; - guint scan_hdr_size, scan_data_size; - guint i, h_max, v_max, mcu_width, mcu_height; - - if (!VALID_STATE(decoder, GOT_SOF)) - return GST_VAAPI_DECODER_STATUS_SUCCESS; - - scan_hdr_size = (seg->data[seg->offset] << 8) | seg->data[seg->offset + 1]; - scan_data_size = seg->size - scan_hdr_size; - - memset(&scan_hdr, 0, sizeof(scan_hdr)); - if (!gst_jpeg_segment_parse_scan_header(seg, &scan_hdr)) { - GST_ERROR("failed to parse scan header"); - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - } + GstVaapiDecoderJpegPrivate *const priv = &decoder->priv; + GstVaapiPicture *const picture = priv->current_picture; + GstVaapiSlice *slice; + VASliceParameterBufferJPEGBaseline *slice_param; + GstJpegScanHdr scan_hdr; + guint scan_hdr_size, scan_data_size; + guint i, h_max, v_max, mcu_width, mcu_height; - slice = GST_VAAPI_SLICE_NEW(JPEGBaseline, decoder, - seg->data + seg->offset + scan_hdr_size, scan_data_size); - if (!slice) { - GST_ERROR("failed to allocate slice"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } - gst_vaapi_picture_add_slice(picture, slice); + if (!VALID_STATE (decoder, GOT_SOF)) + return GST_VAAPI_DECODER_STATUS_SUCCESS; - if (!VALID_STATE(decoder, GOT_HUF_TABLE)) - gst_jpeg_get_default_huffman_tables(&priv->huf_tables); + scan_hdr_size = (seg->data[seg->offset] << 8) | seg->data[seg->offset + 1]; + scan_data_size = seg->size - scan_hdr_size; - // Update VA Huffman table if it changed for this scan - if (huffman_tables_updated(&priv->huf_tables)) { - slice->huf_table = GST_VAAPI_HUFFMAN_TABLE_NEW(JPEGBaseline, decoder); - if (!slice->huf_table) { - GST_ERROR("failed to allocate Huffman tables"); - huffman_tables_reset(&priv->huf_tables); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } - fill_huffman_table(slice->huf_table, &priv->huf_tables); - huffman_tables_reset(&priv->huf_tables); - } + memset (&scan_hdr, 0, sizeof (scan_hdr)); + if (!gst_jpeg_segment_parse_scan_header (seg, &scan_hdr)) { + GST_ERROR ("failed to parse scan header"); + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + } + + slice = GST_VAAPI_SLICE_NEW (JPEGBaseline, decoder, + seg->data + seg->offset + scan_hdr_size, scan_data_size); + if (!slice) { + GST_ERROR ("failed to allocate slice"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } + gst_vaapi_picture_add_slice (picture, slice); + + if (!VALID_STATE (decoder, GOT_HUF_TABLE)) + gst_jpeg_get_default_huffman_tables (&priv->huf_tables); - slice_param = slice->param; - slice_param->num_components = scan_hdr.num_components; - for (i = 0; i < scan_hdr.num_components; i++) { - slice_param->components[i].component_selector = - scan_hdr.components[i].component_selector; - slice_param->components[i].dc_table_selector = - scan_hdr.components[i].dc_selector; - slice_param->components[i].ac_table_selector = - scan_hdr.components[i].ac_selector; + // Update VA Huffman table if it changed for this scan + if (huffman_tables_updated (&priv->huf_tables)) { + slice->huf_table = GST_VAAPI_HUFFMAN_TABLE_NEW (JPEGBaseline, decoder); + if (!slice->huf_table) { + GST_ERROR ("failed to allocate Huffman tables"); + huffman_tables_reset (&priv->huf_tables); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; } - slice_param->restart_interval = priv->mcu_restart; - slice_param->slice_horizontal_position = 0; - slice_param->slice_vertical_position = 0; - - get_max_sampling_factors(&priv->frame_hdr, &h_max, &v_max); - mcu_width = 8 * h_max; - mcu_height = 8 * v_max; - - if (scan_hdr.num_components == 1) { // Non-interleaved - const guint Csj = slice_param->components[0].component_selector; - const GstJpegFrameComponent * const fcp = - get_component(&priv->frame_hdr, Csj); - - if (!fcp || fcp->horizontal_factor == 0 || fcp->vertical_factor == 0) { - GST_ERROR("failed to validate image component %u", Csj); - return GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER; - } - mcu_width /= fcp->horizontal_factor; - mcu_height /= fcp->vertical_factor; + fill_huffman_table (slice->huf_table, &priv->huf_tables); + huffman_tables_reset (&priv->huf_tables); + } + + slice_param = slice->param; + slice_param->num_components = scan_hdr.num_components; + for (i = 0; i < scan_hdr.num_components; i++) { + slice_param->components[i].component_selector = + scan_hdr.components[i].component_selector; + slice_param->components[i].dc_table_selector = + scan_hdr.components[i].dc_selector; + slice_param->components[i].ac_table_selector = + scan_hdr.components[i].ac_selector; + } + slice_param->restart_interval = priv->mcu_restart; + slice_param->slice_horizontal_position = 0; + slice_param->slice_vertical_position = 0; + + get_max_sampling_factors (&priv->frame_hdr, &h_max, &v_max); + mcu_width = 8 * h_max; + mcu_height = 8 * v_max; + + if (scan_hdr.num_components == 1) { // Non-interleaved + const guint Csj = slice_param->components[0].component_selector; + const GstJpegFrameComponent *const fcp = + get_component (&priv->frame_hdr, Csj); + + if (!fcp || fcp->horizontal_factor == 0 || fcp->vertical_factor == 0) { + GST_ERROR ("failed to validate image component %u", Csj); + return GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER; } - slice_param->num_mcus = - ((priv->frame_hdr.width + mcu_width - 1) / mcu_width) * - ((priv->frame_hdr.height + mcu_height - 1) / mcu_height); + mcu_width /= fcp->horizontal_factor; + mcu_height /= fcp->vertical_factor; + } + slice_param->num_mcus = + ((priv->frame_hdr.width + mcu_width - 1) / mcu_width) * + ((priv->frame_hdr.height + mcu_height - 1) / mcu_height); - priv->decoder_state |= GST_JPEG_VIDEO_STATE_GOT_SOS; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + priv->decoder_state |= GST_JPEG_VIDEO_STATE_GOT_SOS; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_segment(GstVaapiDecoderJpeg *decoder, GstJpegSegment *seg) +decode_segment (GstVaapiDecoderJpeg * decoder, GstJpegSegment * seg) { - GstVaapiDecoderJpegPrivate * const priv = &decoder->priv; - GstVaapiDecoderStatus status; + GstVaapiDecoderJpegPrivate *const priv = &decoder->priv; + GstVaapiDecoderStatus status; - // Decode segment - status = GST_VAAPI_DECODER_STATUS_SUCCESS; - switch (seg->marker) { + // Decode segment + status = GST_VAAPI_DECODER_STATUS_SUCCESS; + switch (seg->marker) { case GST_JPEG_MARKER_SOI: - priv->mcu_restart = 0; - priv->decoder_state |= GST_JPEG_VIDEO_STATE_GOT_SOI; - break; + priv->mcu_restart = 0; + priv->decoder_state |= GST_JPEG_VIDEO_STATE_GOT_SOI; + break; case GST_JPEG_MARKER_EOI: - priv->decoder_state = 0; - break; + priv->decoder_state = 0; + break; case GST_JPEG_MARKER_DAC: - GST_ERROR("unsupported arithmetic coding mode"); - status = GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; - break; + GST_ERROR ("unsupported arithmetic coding mode"); + status = GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; + break; case GST_JPEG_MARKER_DHT: - status = decode_huffman_table(decoder, seg); - break; + status = decode_huffman_table (decoder, seg); + break; case GST_JPEG_MARKER_DQT: - status = decode_quant_table(decoder, seg); - break; + status = decode_quant_table (decoder, seg); + break; case GST_JPEG_MARKER_DRI: - status = decode_restart_interval(decoder, seg); - break; + status = decode_restart_interval (decoder, seg); + break; case GST_JPEG_MARKER_SOS: - status = decode_scan(decoder, seg); - break; + status = decode_scan (decoder, seg); + break; default: - // SOFn segments - if (seg->marker >= GST_JPEG_MARKER_SOF_MIN && - seg->marker <= GST_JPEG_MARKER_SOF_MAX) - status = decode_picture(decoder, seg); - break; - } - return status; + // SOFn segments + if (seg->marker >= GST_JPEG_MARKER_SOF_MIN && + seg->marker <= GST_JPEG_MARKER_SOF_MAX) + status = decode_picture (decoder, seg); + break; + } + return status; } static GstVaapiDecoderStatus -ensure_decoder(GstVaapiDecoderJpeg *decoder) -{ - GstVaapiDecoderJpegPrivate * const priv = &decoder->priv; - - if (!priv->is_opened) { - priv->is_opened = gst_vaapi_decoder_jpeg_open(decoder); - if (!priv->is_opened) - return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC; - } - return GST_VAAPI_DECODER_STATUS_SUCCESS; +ensure_decoder (GstVaapiDecoderJpeg * decoder) +{ + GstVaapiDecoderJpegPrivate *const priv = &decoder->priv; + + if (!priv->is_opened) { + priv->is_opened = gst_vaapi_decoder_jpeg_open (decoder); + if (!priv->is_opened) + return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC; + } + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static gboolean -is_scan_complete(GstJpegMarker marker) +is_scan_complete (GstJpegMarker marker) { - // Scan is assumed to be complete when the new segment is not RSTi - return marker < GST_JPEG_MARKER_RST_MIN || marker > GST_JPEG_MARKER_RST_MAX; + // Scan is assumed to be complete when the new segment is not RSTi + return marker < GST_JPEG_MARKER_RST_MIN || marker > GST_JPEG_MARKER_RST_MAX; } static GstVaapiDecoderStatus -gst_vaapi_decoder_jpeg_parse(GstVaapiDecoder *base_decoder, - GstAdapter *adapter, gboolean at_eos, GstVaapiDecoderUnit *unit) -{ - GstVaapiDecoderJpeg * const decoder = - GST_VAAPI_DECODER_JPEG_CAST(base_decoder); - GstVaapiDecoderJpegPrivate * const priv = &decoder->priv; - GstVaapiParserState * const ps = GST_VAAPI_PARSER_STATE(base_decoder); - GstVaapiDecoderStatus status; - GstJpegMarker marker; - GstJpegSegment seg; - const guchar *buf; - guint buf_size, flags; - gint ofs1, ofs2; - - status = ensure_decoder(decoder); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - - /* Expect at least 2 bytes for the marker */ - buf_size = gst_adapter_available(adapter); - if (buf_size < 2) - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; +gst_vaapi_decoder_jpeg_parse (GstVaapiDecoder * base_decoder, + GstAdapter * adapter, gboolean at_eos, GstVaapiDecoderUnit * unit) +{ + GstVaapiDecoderJpeg *const decoder = + GST_VAAPI_DECODER_JPEG_CAST (base_decoder); + GstVaapiDecoderJpegPrivate *const priv = &decoder->priv; + GstVaapiParserState *const ps = GST_VAAPI_PARSER_STATE (base_decoder); + GstVaapiDecoderStatus status; + GstJpegMarker marker; + GstJpegSegment seg; + const guchar *buf; + guint buf_size, flags; + gint ofs1, ofs2; - buf = gst_adapter_map(adapter, buf_size); - if (!buf) - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + status = ensure_decoder (decoder); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; - ofs1 = ps->input_offset1 - 2; - if (ofs1 < 0) - ofs1 = 0; - - for (;;) { - // Skip any garbage until we reach SOI, if needed - if (!gst_jpeg_parse(&seg, buf, buf_size, ofs1)) { - gst_adapter_unmap(adapter); - ps->input_offset1 = buf_size; - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + /* Expect at least 2 bytes for the marker */ + buf_size = gst_adapter_available (adapter); + if (buf_size < 2) + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + + buf = gst_adapter_map (adapter, buf_size); + if (!buf) + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + + ofs1 = ps->input_offset1 - 2; + if (ofs1 < 0) + ofs1 = 0; + + for (;;) { + // Skip any garbage until we reach SOI, if needed + if (!gst_jpeg_parse (&seg, buf, buf_size, ofs1)) { + gst_adapter_unmap (adapter); + ps->input_offset1 = buf_size; + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + } + ofs1 = seg.offset; + + marker = seg.marker; + if (!VALID_STATE (parser, GOT_SOI) && marker != GST_JPEG_MARKER_SOI) + continue; + if (marker == GST_JPEG_MARKER_SOS) { + ofs2 = ps->input_offset2 - 2; + if (ofs2 < ofs1 + seg.size) + ofs2 = ofs1 + seg.size; + + // Parse the whole scan + ECSs, including RSTi + for (;;) { + if (!gst_jpeg_parse (&seg, buf, buf_size, ofs2)) { + gst_adapter_unmap (adapter); + ps->input_offset1 = ofs1; + ps->input_offset2 = buf_size; + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; } - ofs1 = seg.offset; - marker = seg.marker; - if (!VALID_STATE(parser, GOT_SOI) && marker != GST_JPEG_MARKER_SOI) - continue; - if (marker == GST_JPEG_MARKER_SOS) { - ofs2 = ps->input_offset2 - 2; - if (ofs2 < ofs1 + seg.size) - ofs2 = ofs1 + seg.size; - - // Parse the whole scan + ECSs, including RSTi - for (;;) { - if (!gst_jpeg_parse(&seg, buf, buf_size, ofs2)) { - gst_adapter_unmap(adapter); - ps->input_offset1 = ofs1; - ps->input_offset2 = buf_size; - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - } - - if (is_scan_complete(seg.marker)) - break; - ofs2 = seg.offset + seg.size; - } - ofs2 = seg.offset - 2; - } - else { - // Check that the whole segment is actually available (in buffer) - ofs2 = ofs1 + seg.size; - if (ofs2 > buf_size) { - gst_adapter_unmap(adapter); - ps->input_offset1 = ofs1; - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - } - } - break; + if (is_scan_complete (seg.marker)) + break; + ofs2 = seg.offset + seg.size; + } + ofs2 = seg.offset - 2; + } else { + // Check that the whole segment is actually available (in buffer) + ofs2 = ofs1 + seg.size; + if (ofs2 > buf_size) { + gst_adapter_unmap (adapter); + ps->input_offset1 = ofs1; + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + } } - gst_adapter_unmap(adapter); - - unit->size = ofs2 - ofs1; - unit_set_marker_code(unit, marker); - gst_adapter_flush(adapter, ofs1); - ps->input_offset1 = 2; - ps->input_offset2 = 2; + break; + } + gst_adapter_unmap (adapter); + + unit->size = ofs2 - ofs1; + unit_set_marker_code (unit, marker); + gst_adapter_flush (adapter, ofs1); + ps->input_offset1 = 2; + ps->input_offset2 = 2; - flags = 0; - switch (marker) { + flags = 0; + switch (marker) { case GST_JPEG_MARKER_SOI: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; - priv->parser_state |= GST_JPEG_VIDEO_STATE_GOT_SOI; - break; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; + priv->parser_state |= GST_JPEG_VIDEO_STATE_GOT_SOI; + break; case GST_JPEG_MARKER_EOI: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_END; - priv->parser_state = 0; - break; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_END; + priv->parser_state = 0; + break; case GST_JPEG_MARKER_SOS: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_SLICE; - priv->parser_state |= GST_JPEG_VIDEO_STATE_GOT_SOS; - break; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_SLICE; + priv->parser_state |= GST_JPEG_VIDEO_STATE_GOT_SOS; + break; case GST_JPEG_MARKER_DAC: case GST_JPEG_MARKER_DHT: case GST_JPEG_MARKER_DQT: - if (priv->parser_state & GST_JPEG_VIDEO_STATE_GOT_SOF) - flags |= GST_VAAPI_DECODER_UNIT_FLAG_SLICE; - break; + if (priv->parser_state & GST_JPEG_VIDEO_STATE_GOT_SOF) + flags |= GST_VAAPI_DECODER_UNIT_FLAG_SLICE; + break; case GST_JPEG_MARKER_DRI: - if (priv->parser_state & GST_JPEG_VIDEO_STATE_GOT_SOS) - flags |= GST_VAAPI_DECODER_UNIT_FLAG_SLICE; - break; - case GST_JPEG_MARKER_DNL: + if (priv->parser_state & GST_JPEG_VIDEO_STATE_GOT_SOS) flags |= GST_VAAPI_DECODER_UNIT_FLAG_SLICE; - break; + break; + case GST_JPEG_MARKER_DNL: + flags |= GST_VAAPI_DECODER_UNIT_FLAG_SLICE; + break; case GST_JPEG_MARKER_COM: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP; - break; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP; + break; default: - /* SOFn segments */ - if (marker >= GST_JPEG_MARKER_SOF_MIN && - marker <= GST_JPEG_MARKER_SOF_MAX) - priv->parser_state |= GST_JPEG_VIDEO_STATE_GOT_SOF; - - /* Application segments */ - else if (marker >= GST_JPEG_MARKER_APP_MIN && - marker <= GST_JPEG_MARKER_APP_MAX) - flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP; - - /* Reserved */ - else if (marker >= 0x02 && marker <= 0xbf) - flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP; - break; - } - GST_VAAPI_DECODER_UNIT_FLAG_SET(unit, flags); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + /* SOFn segments */ + if (marker >= GST_JPEG_MARKER_SOF_MIN && + marker <= GST_JPEG_MARKER_SOF_MAX) + priv->parser_state |= GST_JPEG_VIDEO_STATE_GOT_SOF; + + /* Application segments */ + else if (marker >= GST_JPEG_MARKER_APP_MIN && + marker <= GST_JPEG_MARKER_APP_MAX) + flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP; + + /* Reserved */ + else if (marker >= 0x02 && marker <= 0xbf) + flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP; + break; + } + GST_VAAPI_DECODER_UNIT_FLAG_SET (unit, flags); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -gst_vaapi_decoder_jpeg_decode(GstVaapiDecoder *base_decoder, - GstVaapiDecoderUnit *unit) -{ - GstVaapiDecoderJpeg * const decoder = - GST_VAAPI_DECODER_JPEG_CAST(base_decoder); - GstVaapiDecoderStatus status; - GstJpegSegment seg; - GstBuffer * const buffer = - GST_VAAPI_DECODER_CODEC_FRAME(decoder)->input_buffer; - GstMapInfo map_info; - - status = ensure_decoder(decoder); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - - if (!gst_buffer_map(buffer, &map_info, GST_MAP_READ)) { - GST_ERROR("failed to map buffer"); - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - } +gst_vaapi_decoder_jpeg_decode (GstVaapiDecoder * base_decoder, + GstVaapiDecoderUnit * unit) +{ + GstVaapiDecoderJpeg *const decoder = + GST_VAAPI_DECODER_JPEG_CAST (base_decoder); + GstVaapiDecoderStatus status; + GstJpegSegment seg; + GstBuffer *const buffer = + GST_VAAPI_DECODER_CODEC_FRAME (decoder)->input_buffer; + GstMapInfo map_info; - seg.marker = unit_get_marker_code(unit); - seg.data = map_info.data; - seg.offset = unit->offset; - seg.size = unit->size; - - status = decode_segment(decoder, &seg); - gst_buffer_unmap(buffer, &map_info); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + status = ensure_decoder (decoder); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; + + if (!gst_buffer_map (buffer, &map_info, GST_MAP_READ)) { + GST_ERROR ("failed to map buffer"); + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + } + + seg.marker = unit_get_marker_code (unit); + seg.data = map_info.data; + seg.offset = unit->offset; + seg.size = unit->size; + + status = decode_segment (decoder, &seg); + gst_buffer_unmap (buffer, &map_info); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -gst_vaapi_decoder_jpeg_start_frame(GstVaapiDecoder *base_decoder, - GstVaapiDecoderUnit *base_unit) +gst_vaapi_decoder_jpeg_start_frame (GstVaapiDecoder * base_decoder, + GstVaapiDecoderUnit * base_unit) { - GstVaapiDecoderJpeg * const decoder = - GST_VAAPI_DECODER_JPEG_CAST(base_decoder); - GstVaapiDecoderJpegPrivate * const priv = &decoder->priv; - GstVaapiPicture *picture; - GstVaapiDecoderStatus status; - - if (!VALID_STATE(decoder, GOT_SOF)) - return GST_VAAPI_DECODER_STATUS_SUCCESS; - - status = ensure_context(decoder); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) { - GST_ERROR("failed to reset context"); - return status; - } + GstVaapiDecoderJpeg *const decoder = + GST_VAAPI_DECODER_JPEG_CAST (base_decoder); + GstVaapiDecoderJpegPrivate *const priv = &decoder->priv; + GstVaapiPicture *picture; + GstVaapiDecoderStatus status; - picture = GST_VAAPI_PICTURE_NEW(JPEGBaseline, decoder); - if (!picture) { - GST_ERROR("failed to allocate picture"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } - gst_vaapi_picture_replace(&priv->current_picture, picture); - gst_vaapi_picture_unref(picture); + if (!VALID_STATE (decoder, GOT_SOF)) + return GST_VAAPI_DECODER_STATUS_SUCCESS; - if (!fill_picture(decoder, picture, &priv->frame_hdr)) - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + status = ensure_context (decoder); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) { + GST_ERROR ("failed to reset context"); + return status; + } - status = fill_quantization_table(decoder, picture); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; + picture = GST_VAAPI_PICTURE_NEW (JPEGBaseline, decoder); + if (!picture) { + GST_ERROR ("failed to allocate picture"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } + gst_vaapi_picture_replace (&priv->current_picture, picture); + gst_vaapi_picture_unref (picture); - /* Update presentation time */ - picture->pts = GST_VAAPI_DECODER_CODEC_FRAME(decoder)->pts; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + if (!fill_picture (decoder, picture, &priv->frame_hdr)) + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + + status = fill_quantization_table (decoder, picture); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; + + /* Update presentation time */ + picture->pts = GST_VAAPI_DECODER_CODEC_FRAME (decoder)->pts; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -gst_vaapi_decoder_jpeg_end_frame(GstVaapiDecoder *base_decoder) +gst_vaapi_decoder_jpeg_end_frame (GstVaapiDecoder * base_decoder) { - GstVaapiDecoderJpeg * const decoder = - GST_VAAPI_DECODER_JPEG_CAST(base_decoder); + GstVaapiDecoderJpeg *const decoder = + GST_VAAPI_DECODER_JPEG_CAST (base_decoder); - return decode_current_picture(decoder); + return decode_current_picture (decoder); } static void -gst_vaapi_decoder_jpeg_class_init(GstVaapiDecoderJpegClass *klass) +gst_vaapi_decoder_jpeg_class_init (GstVaapiDecoderJpegClass * klass) { - GstVaapiMiniObjectClass * const object_class = - GST_VAAPI_MINI_OBJECT_CLASS(klass); - GstVaapiDecoderClass * const decoder_class = GST_VAAPI_DECODER_CLASS(klass); - - object_class->size = sizeof(GstVaapiDecoderJpeg); - object_class->finalize = (GDestroyNotify)gst_vaapi_decoder_finalize; - - decoder_class->create = gst_vaapi_decoder_jpeg_create; - decoder_class->destroy = gst_vaapi_decoder_jpeg_destroy; - decoder_class->parse = gst_vaapi_decoder_jpeg_parse; - decoder_class->decode = gst_vaapi_decoder_jpeg_decode; - decoder_class->start_frame = gst_vaapi_decoder_jpeg_start_frame; - decoder_class->end_frame = gst_vaapi_decoder_jpeg_end_frame; + GstVaapiMiniObjectClass *const object_class = + GST_VAAPI_MINI_OBJECT_CLASS (klass); + GstVaapiDecoderClass *const decoder_class = GST_VAAPI_DECODER_CLASS (klass); + + object_class->size = sizeof (GstVaapiDecoderJpeg); + object_class->finalize = (GDestroyNotify) gst_vaapi_decoder_finalize; + + decoder_class->create = gst_vaapi_decoder_jpeg_create; + decoder_class->destroy = gst_vaapi_decoder_jpeg_destroy; + decoder_class->parse = gst_vaapi_decoder_jpeg_parse; + decoder_class->decode = gst_vaapi_decoder_jpeg_decode; + decoder_class->start_frame = gst_vaapi_decoder_jpeg_start_frame; + decoder_class->end_frame = gst_vaapi_decoder_jpeg_end_frame; } static inline const GstVaapiDecoderClass * -gst_vaapi_decoder_jpeg_class(void) +gst_vaapi_decoder_jpeg_class (void) { - static GstVaapiDecoderJpegClass g_class; - static gsize g_class_init = FALSE; + static GstVaapiDecoderJpegClass g_class; + static gsize g_class_init = FALSE; - if (g_once_init_enter(&g_class_init)) { - gst_vaapi_decoder_jpeg_class_init(&g_class); - g_once_init_leave(&g_class_init, TRUE); - } - return GST_VAAPI_DECODER_CLASS(&g_class); + if (g_once_init_enter (&g_class_init)) { + gst_vaapi_decoder_jpeg_class_init (&g_class); + g_once_init_leave (&g_class_init, TRUE); + } + return GST_VAAPI_DECODER_CLASS (&g_class); } /** @@ -900,7 +885,7 @@ * Return value: the newly allocated #GstVaapiDecoder object */ GstVaapiDecoder * -gst_vaapi_decoder_jpeg_new(GstVaapiDisplay *display, GstCaps *caps) +gst_vaapi_decoder_jpeg_new (GstVaapiDisplay * display, GstCaps * caps) { - return gst_vaapi_decoder_new(gst_vaapi_decoder_jpeg_class(), display, caps); + return gst_vaapi_decoder_new (gst_vaapi_decoder_jpeg_class (), display, caps); } diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c 2016-03-24 11:36:59.000000000 +0000 @@ -44,113 +44,112 @@ /* ------------------------------------------------------------------------- */ typedef struct _PTSGenerator PTSGenerator; -struct _PTSGenerator { - GstClockTime gop_pts; // Current GOP PTS - GstClockTime max_pts; // Max picture PTS - guint gop_tsn; // Absolute GOP TSN - guint max_tsn; // Max picture TSN, relative to last GOP TSN - guint ovl_tsn; // How many times TSN overflowed since GOP - guint lst_tsn; // Last picture TSN - guint fps_n; - guint fps_d; +struct _PTSGenerator +{ + GstClockTime gop_pts; // Current GOP PTS + GstClockTime max_pts; // Max picture PTS + guint gop_tsn; // Absolute GOP TSN + guint max_tsn; // Max picture TSN, relative to last GOP TSN + guint ovl_tsn; // How many times TSN overflowed since GOP + guint lst_tsn; // Last picture TSN + guint fps_n; + guint fps_d; }; static void -pts_init(PTSGenerator *tsg) +pts_init (PTSGenerator * tsg) { - tsg->gop_pts = GST_CLOCK_TIME_NONE; - tsg->max_pts = GST_CLOCK_TIME_NONE; - tsg->gop_tsn = 0; - tsg->max_tsn = 0; - tsg->ovl_tsn = 0; - tsg->lst_tsn = 0; - tsg->fps_n = 0; - tsg->fps_d = 0; + tsg->gop_pts = GST_CLOCK_TIME_NONE; + tsg->max_pts = GST_CLOCK_TIME_NONE; + tsg->gop_tsn = 0; + tsg->max_tsn = 0; + tsg->ovl_tsn = 0; + tsg->lst_tsn = 0; + tsg->fps_n = 0; + tsg->fps_d = 0; } static inline GstClockTime -pts_get_duration(PTSGenerator *tsg, guint num_frames) +pts_get_duration (PTSGenerator * tsg, guint num_frames) { - return gst_util_uint64_scale(num_frames, - GST_SECOND * tsg->fps_d, tsg->fps_n); + return gst_util_uint64_scale (num_frames, + GST_SECOND * tsg->fps_d, tsg->fps_n); } static inline guint -pts_get_poc(PTSGenerator *tsg) +pts_get_poc (PTSGenerator * tsg) { - return tsg->gop_tsn + tsg->ovl_tsn * 1024 + tsg->lst_tsn; + return tsg->gop_tsn + tsg->ovl_tsn * 1024 + tsg->lst_tsn; } static void -pts_set_framerate(PTSGenerator *tsg, guint fps_n, guint fps_d) +pts_set_framerate (PTSGenerator * tsg, guint fps_n, guint fps_d) { - tsg->fps_n = fps_n; - tsg->fps_d = fps_d; + tsg->fps_n = fps_n; + tsg->fps_d = fps_d; } static void -pts_sync(PTSGenerator *tsg, GstClockTime gop_pts) +pts_sync (PTSGenerator * tsg, GstClockTime gop_pts) { - guint gop_tsn; - - if (!GST_CLOCK_TIME_IS_VALID(gop_pts) || - (GST_CLOCK_TIME_IS_VALID(tsg->max_pts) && tsg->max_pts >= gop_pts)) { - /* Invalid GOP PTS, interpolate from the last known picture PTS */ - if (GST_CLOCK_TIME_IS_VALID(tsg->max_pts)) { - gop_pts = tsg->max_pts + pts_get_duration(tsg, 1); - gop_tsn = tsg->gop_tsn + tsg->ovl_tsn * 1024 + tsg->max_tsn + 1; - } - else { - gop_pts = 0; - gop_tsn = 0; - } - } - else { - /* Interpolate GOP TSN from this valid PTS */ - if (GST_CLOCK_TIME_IS_VALID(tsg->gop_pts)) - gop_tsn = tsg->gop_tsn + gst_util_uint64_scale( - gop_pts - tsg->gop_pts + pts_get_duration(tsg, 1) - 1, - tsg->fps_n, GST_SECOND * tsg->fps_d); - else - gop_tsn = 0; - } + guint gop_tsn; - tsg->gop_pts = gop_pts; - tsg->gop_tsn = gop_tsn; - tsg->max_tsn = 0; - tsg->ovl_tsn = 0; - tsg->lst_tsn = 0; + if (!GST_CLOCK_TIME_IS_VALID (gop_pts) || + (GST_CLOCK_TIME_IS_VALID (tsg->max_pts) && tsg->max_pts >= gop_pts)) { + /* Invalid GOP PTS, interpolate from the last known picture PTS */ + if (GST_CLOCK_TIME_IS_VALID (tsg->max_pts)) { + gop_pts = tsg->max_pts + pts_get_duration (tsg, 1); + gop_tsn = tsg->gop_tsn + tsg->ovl_tsn * 1024 + tsg->max_tsn + 1; + } else { + gop_pts = 0; + gop_tsn = 0; + } + } else { + /* Interpolate GOP TSN from this valid PTS */ + if (GST_CLOCK_TIME_IS_VALID (tsg->gop_pts)) + gop_tsn = + tsg->gop_tsn + gst_util_uint64_scale (gop_pts - tsg->gop_pts + + pts_get_duration (tsg, 1) - 1, tsg->fps_n, GST_SECOND * tsg->fps_d); + else + gop_tsn = 0; + } + + tsg->gop_pts = gop_pts; + tsg->gop_tsn = gop_tsn; + tsg->max_tsn = 0; + tsg->ovl_tsn = 0; + tsg->lst_tsn = 0; } static GstClockTime -pts_eval(PTSGenerator *tsg, GstClockTime pic_pts, guint pic_tsn) +pts_eval (PTSGenerator * tsg, GstClockTime pic_pts, guint pic_tsn) { - GstClockTime pts; + GstClockTime pts; - if (!GST_CLOCK_TIME_IS_VALID(tsg->gop_pts)) - tsg->gop_pts = pts_get_duration(tsg, pic_tsn); - - pts = pic_pts; - if (!GST_CLOCK_TIME_IS_VALID (pts)) - pts = tsg->gop_pts + pts_get_duration(tsg, tsg->ovl_tsn * 1024 + pic_tsn); - else if (pts == tsg->gop_pts) { - /* The picture following the GOP header shall be an I-frame. - So we can compensate for the GOP start time from here */ - tsg->gop_pts -= pts_get_duration(tsg, pic_tsn); - } + if (!GST_CLOCK_TIME_IS_VALID (tsg->gop_pts)) + tsg->gop_pts = pts_get_duration (tsg, pic_tsn); - if (!GST_CLOCK_TIME_IS_VALID(tsg->max_pts) || tsg->max_pts < pts) - tsg->max_pts = pts; + pts = pic_pts; + if (!GST_CLOCK_TIME_IS_VALID (pts)) + pts = tsg->gop_pts + pts_get_duration (tsg, tsg->ovl_tsn * 1024 + pic_tsn); + else if (pts == tsg->gop_pts) { + /* The picture following the GOP header shall be an I-frame. + So we can compensate for the GOP start time from here */ + tsg->gop_pts -= pts_get_duration (tsg, pic_tsn); + } + + if (!GST_CLOCK_TIME_IS_VALID (tsg->max_pts) || tsg->max_pts < pts) + tsg->max_pts = pts; + + if (tsg->max_tsn < pic_tsn) + tsg->max_tsn = pic_tsn; + else if (tsg->max_tsn == 1023 && pic_tsn < tsg->lst_tsn) { /* TSN wrapped */ + tsg->max_tsn = pic_tsn; + tsg->ovl_tsn++; + } + tsg->lst_tsn = pic_tsn; - if (tsg->max_tsn < pic_tsn) - tsg->max_tsn = pic_tsn; - else if (tsg->max_tsn == 1023 && pic_tsn < tsg->lst_tsn) { /* TSN wrapped */ - tsg->max_tsn = pic_tsn; - tsg->ovl_tsn++; - } - tsg->lst_tsn = pic_tsn; - - return pts; + return pts; } /* ------------------------------------------------------------------------- */ @@ -158,50 +157,52 @@ /* ------------------------------------------------------------------------- */ typedef struct _GstVaapiParserInfoMpeg2 GstVaapiParserInfoMpeg2; -struct _GstVaapiParserInfoMpeg2 { - GstVaapiMiniObject parent_instance; - GstMpegVideoPacket packet; - guint8 extension_type; /* for Extension packets */ - union { - GstMpegVideoSequenceHdr seq_hdr; - GstMpegVideoSequenceExt seq_ext; - GstMpegVideoSequenceDisplayExt seq_display_ext; - GstMpegVideoSequenceScalableExt seq_scalable_ext; - GstMpegVideoGop gop; - GstMpegVideoQuantMatrixExt quant_matrix; - GstMpegVideoPictureHdr pic_hdr; - GstMpegVideoPictureExt pic_ext; - GstMpegVideoSliceHdr slice_hdr; - } data; +struct _GstVaapiParserInfoMpeg2 +{ + GstVaapiMiniObject parent_instance; + GstMpegVideoPacket packet; + guint8 extension_type; /* for Extension packets */ + union + { + GstMpegVideoSequenceHdr seq_hdr; + GstMpegVideoSequenceExt seq_ext; + GstMpegVideoSequenceDisplayExt seq_display_ext; + GstMpegVideoSequenceScalableExt seq_scalable_ext; + GstMpegVideoGop gop; + GstMpegVideoQuantMatrixExt quant_matrix; + GstMpegVideoPictureHdr pic_hdr; + GstMpegVideoPictureExt pic_ext; + GstMpegVideoSliceHdr slice_hdr; + } data; }; static inline const GstVaapiMiniObjectClass * -gst_vaapi_parser_info_mpeg2_class(void) +gst_vaapi_parser_info_mpeg2_class (void) { - static const GstVaapiMiniObjectClass GstVaapiParserInfoMpeg2Class = { - sizeof(GstVaapiParserInfoMpeg2), - NULL - }; - return &GstVaapiParserInfoMpeg2Class; + static const GstVaapiMiniObjectClass GstVaapiParserInfoMpeg2Class = { + sizeof (GstVaapiParserInfoMpeg2), + NULL + }; + return &GstVaapiParserInfoMpeg2Class; } static inline GstVaapiParserInfoMpeg2 * -gst_vaapi_parser_info_mpeg2_new(void) +gst_vaapi_parser_info_mpeg2_new (void) { - return (GstVaapiParserInfoMpeg2 *) - gst_vaapi_mini_object_new(gst_vaapi_parser_info_mpeg2_class()); + return (GstVaapiParserInfoMpeg2 *) + gst_vaapi_mini_object_new (gst_vaapi_parser_info_mpeg2_class ()); } static inline GstVaapiParserInfoMpeg2 * -gst_vaapi_parser_info_mpeg2_ensure(GstVaapiParserInfoMpeg2 **pi_ptr) +gst_vaapi_parser_info_mpeg2_ensure (GstVaapiParserInfoMpeg2 ** pi_ptr) { - GstVaapiParserInfoMpeg2 *pi = *pi_ptr; - - if (G_LIKELY(pi != NULL)) - return pi; + GstVaapiParserInfoMpeg2 *pi = *pi_ptr; - *pi_ptr = pi = gst_vaapi_parser_info_mpeg2_new(); + if (G_LIKELY (pi != NULL)) return pi; + + *pi_ptr = pi = gst_vaapi_parser_info_mpeg2_new (); + return pi; } #define gst_vaapi_parser_info_mpeg2_ref(pi) \ @@ -221,57 +222,55 @@ #define GST_VAAPI_DECODER_MPEG2_CAST(decoder) \ ((GstVaapiDecoderMpeg2 *)(decoder)) -typedef struct _GstVaapiDecoderMpeg2Private GstVaapiDecoderMpeg2Private; -typedef struct _GstVaapiDecoderMpeg2Class GstVaapiDecoderMpeg2Class; +typedef struct _GstVaapiDecoderMpeg2Private GstVaapiDecoderMpeg2Private; +typedef struct _GstVaapiDecoderMpeg2Class GstVaapiDecoderMpeg2Class; -typedef enum { - GST_MPEG_VIDEO_STATE_GOT_SEQ_HDR = 1 << 0, - GST_MPEG_VIDEO_STATE_GOT_SEQ_EXT = 1 << 1, - GST_MPEG_VIDEO_STATE_GOT_PIC_HDR = 1 << 2, - GST_MPEG_VIDEO_STATE_GOT_PIC_EXT = 1 << 3, - GST_MPEG_VIDEO_STATE_GOT_SLICE = 1 << 4, - - GST_MPEG_VIDEO_STATE_VALID_SEQ_HEADERS = ( - GST_MPEG_VIDEO_STATE_GOT_SEQ_HDR| - GST_MPEG_VIDEO_STATE_GOT_SEQ_EXT), - GST_MPEG_VIDEO_STATE_VALID_PIC_HEADERS = ( - GST_MPEG_VIDEO_STATE_GOT_PIC_HDR| - GST_MPEG_VIDEO_STATE_GOT_PIC_EXT), - GST_MPEG_VIDEO_STATE_VALID_PICTURE = ( - GST_MPEG_VIDEO_STATE_VALID_SEQ_HEADERS| - GST_MPEG_VIDEO_STATE_VALID_PIC_HEADERS| - GST_MPEG_VIDEO_STATE_GOT_SLICE) +typedef enum +{ + GST_MPEG_VIDEO_STATE_GOT_SEQ_HDR = 1 << 0, + GST_MPEG_VIDEO_STATE_GOT_SEQ_EXT = 1 << 1, + GST_MPEG_VIDEO_STATE_GOT_PIC_HDR = 1 << 2, + GST_MPEG_VIDEO_STATE_GOT_PIC_EXT = 1 << 3, + GST_MPEG_VIDEO_STATE_GOT_SLICE = 1 << 4, + + GST_MPEG_VIDEO_STATE_VALID_SEQ_HEADERS = (GST_MPEG_VIDEO_STATE_GOT_SEQ_HDR | + GST_MPEG_VIDEO_STATE_GOT_SEQ_EXT), + GST_MPEG_VIDEO_STATE_VALID_PIC_HEADERS = (GST_MPEG_VIDEO_STATE_GOT_PIC_HDR | + GST_MPEG_VIDEO_STATE_GOT_PIC_EXT), + GST_MPEG_VIDEO_STATE_VALID_PICTURE = (GST_MPEG_VIDEO_STATE_VALID_SEQ_HEADERS | + GST_MPEG_VIDEO_STATE_VALID_PIC_HEADERS | GST_MPEG_VIDEO_STATE_GOT_SLICE) } GstMpegVideoState; -struct _GstVaapiDecoderMpeg2Private { - GstVaapiProfile profile; - GstVaapiProfile hw_profile; - guint width; - guint height; - guint fps_n; - guint fps_d; - guint state; - GstVaapiRectangle crop_rect; - GstVaapiParserInfoMpeg2 *seq_hdr; - GstVaapiParserInfoMpeg2 *seq_ext; - GstVaapiParserInfoMpeg2 *seq_display_ext; - GstVaapiParserInfoMpeg2 *seq_scalable_ext; - GstVaapiParserInfoMpeg2 *gop; - GstVaapiParserInfoMpeg2 *pic_hdr; - GstVaapiParserInfoMpeg2 *pic_ext; - GstVaapiParserInfoMpeg2 *pic_display_ext; - GstVaapiParserInfoMpeg2 *quant_matrix; - GstVaapiParserInfoMpeg2 *slice_hdr; - GstVaapiPicture *current_picture; - GstVaapiDpb *dpb; - PTSGenerator tsg; - guint is_opened : 1; - guint size_changed : 1; - guint profile_changed : 1; - guint quant_matrix_changed : 1; - guint progressive_sequence : 1; - guint closed_gop : 1; - guint broken_link : 1; +struct _GstVaapiDecoderMpeg2Private +{ + GstVaapiProfile profile; + GstVaapiProfile hw_profile; + guint width; + guint height; + guint fps_n; + guint fps_d; + guint state; + GstVaapiRectangle crop_rect; + GstVaapiParserInfoMpeg2 *seq_hdr; + GstVaapiParserInfoMpeg2 *seq_ext; + GstVaapiParserInfoMpeg2 *seq_display_ext; + GstVaapiParserInfoMpeg2 *seq_scalable_ext; + GstVaapiParserInfoMpeg2 *gop; + GstVaapiParserInfoMpeg2 *pic_hdr; + GstVaapiParserInfoMpeg2 *pic_ext; + GstVaapiParserInfoMpeg2 *pic_display_ext; + GstVaapiParserInfoMpeg2 *quant_matrix; + GstVaapiParserInfoMpeg2 *slice_hdr; + GstVaapiPicture *current_picture; + GstVaapiDpb *dpb; + PTSGenerator tsg; + guint is_opened:1; + guint size_changed:1; + guint profile_changed:1; + guint quant_matrix_changed:1; + guint progressive_sequence:1; + guint closed_gop:1; + guint broken_link:1; }; /** @@ -279,10 +278,11 @@ * * A decoder based on Mpeg2. */ -struct _GstVaapiDecoderMpeg2 { - /*< private >*/ - GstVaapiDecoder parent_instance; - GstVaapiDecoderMpeg2Private priv; +struct _GstVaapiDecoderMpeg2 +{ + /*< private > */ + GstVaapiDecoder parent_instance; + GstVaapiDecoderMpeg2Private priv; }; /** @@ -290,1299 +290,1303 @@ * * A decoder class based on Mpeg2. */ -struct _GstVaapiDecoderMpeg2Class { - /*< private >*/ - GstVaapiDecoderClass parent_class; +struct _GstVaapiDecoderMpeg2Class +{ + /*< private > */ + GstVaapiDecoderClass parent_class; }; static void -gst_vaapi_decoder_mpeg2_close(GstVaapiDecoderMpeg2 *decoder) +gst_vaapi_decoder_mpeg2_close (GstVaapiDecoderMpeg2 * decoder) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; - gst_vaapi_picture_replace(&priv->current_picture, NULL); + gst_vaapi_picture_replace (&priv->current_picture, NULL); - gst_vaapi_parser_info_mpeg2_replace(&priv->seq_hdr, NULL); - gst_vaapi_parser_info_mpeg2_replace(&priv->seq_ext, NULL); - gst_vaapi_parser_info_mpeg2_replace(&priv->seq_display_ext, NULL); - gst_vaapi_parser_info_mpeg2_replace(&priv->seq_scalable_ext, NULL); - gst_vaapi_parser_info_mpeg2_replace(&priv->gop, NULL); - gst_vaapi_parser_info_mpeg2_replace(&priv->pic_hdr, NULL); - gst_vaapi_parser_info_mpeg2_replace(&priv->pic_ext, NULL); - gst_vaapi_parser_info_mpeg2_replace(&priv->pic_display_ext, NULL); - gst_vaapi_parser_info_mpeg2_replace(&priv->quant_matrix, NULL); - gst_vaapi_parser_info_mpeg2_replace(&priv->slice_hdr, NULL); + gst_vaapi_parser_info_mpeg2_replace (&priv->seq_hdr, NULL); + gst_vaapi_parser_info_mpeg2_replace (&priv->seq_ext, NULL); + gst_vaapi_parser_info_mpeg2_replace (&priv->seq_display_ext, NULL); + gst_vaapi_parser_info_mpeg2_replace (&priv->seq_scalable_ext, NULL); + gst_vaapi_parser_info_mpeg2_replace (&priv->gop, NULL); + gst_vaapi_parser_info_mpeg2_replace (&priv->pic_hdr, NULL); + gst_vaapi_parser_info_mpeg2_replace (&priv->pic_ext, NULL); + gst_vaapi_parser_info_mpeg2_replace (&priv->pic_display_ext, NULL); + gst_vaapi_parser_info_mpeg2_replace (&priv->quant_matrix, NULL); + gst_vaapi_parser_info_mpeg2_replace (&priv->slice_hdr, NULL); - priv->state = 0; + priv->state = 0; - gst_vaapi_dpb_replace(&priv->dpb, NULL); + gst_vaapi_dpb_replace (&priv->dpb, NULL); } static gboolean -gst_vaapi_decoder_mpeg2_open(GstVaapiDecoderMpeg2 *decoder) +gst_vaapi_decoder_mpeg2_open (GstVaapiDecoderMpeg2 * decoder) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; - gst_vaapi_decoder_mpeg2_close(decoder); + gst_vaapi_decoder_mpeg2_close (decoder); - priv->dpb = gst_vaapi_dpb_new(2); - if (!priv->dpb) - return FALSE; + priv->dpb = gst_vaapi_dpb_new (2); + if (!priv->dpb) + return FALSE; - pts_init(&priv->tsg); - return TRUE; + pts_init (&priv->tsg); + return TRUE; } static void -gst_vaapi_decoder_mpeg2_destroy(GstVaapiDecoder *base_decoder) +gst_vaapi_decoder_mpeg2_destroy (GstVaapiDecoder * base_decoder) { - GstVaapiDecoderMpeg2 * const decoder = - GST_VAAPI_DECODER_MPEG2_CAST(base_decoder); + GstVaapiDecoderMpeg2 *const decoder = + GST_VAAPI_DECODER_MPEG2_CAST (base_decoder); - gst_vaapi_decoder_mpeg2_close(decoder); + gst_vaapi_decoder_mpeg2_close (decoder); } static gboolean -gst_vaapi_decoder_mpeg2_create(GstVaapiDecoder *base_decoder) +gst_vaapi_decoder_mpeg2_create (GstVaapiDecoder * base_decoder) { - GstVaapiDecoderMpeg2 * const decoder = - GST_VAAPI_DECODER_MPEG2_CAST(base_decoder); - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - - priv->hw_profile = GST_VAAPI_PROFILE_UNKNOWN; - priv->profile = GST_VAAPI_PROFILE_MPEG2_SIMPLE; - priv->profile_changed = TRUE; /* Allow fallbacks to work */ - return TRUE; + GstVaapiDecoderMpeg2 *const decoder = + GST_VAAPI_DECODER_MPEG2_CAST (base_decoder); + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + + priv->hw_profile = GST_VAAPI_PROFILE_UNKNOWN; + priv->profile = GST_VAAPI_PROFILE_MPEG2_SIMPLE; + priv->profile_changed = TRUE; /* Allow fallbacks to work */ + return TRUE; } static inline void -copy_quant_matrix(guint8 dst[64], const guint8 src[64]) +copy_quant_matrix (guint8 dst[64], const guint8 src[64]) { - memcpy(dst, src, 64); + memcpy (dst, src, 64); } static const char * -get_profile_str(GstVaapiProfile profile) +get_profile_str (GstVaapiProfile profile) { - char *str; + const char *str; - switch (profile) { - case GST_VAAPI_PROFILE_MPEG2_SIMPLE: str = "simple"; break; - case GST_VAAPI_PROFILE_MPEG2_MAIN: str = "main"; break; - case GST_VAAPI_PROFILE_MPEG2_HIGH: str = "high"; break; - default: str = ""; break; - } - return str; + switch (profile) { + case GST_VAAPI_PROFILE_MPEG2_SIMPLE: + str = "simple"; + break; + case GST_VAAPI_PROFILE_MPEG2_MAIN: + str = "main"; + break; + case GST_VAAPI_PROFILE_MPEG2_HIGH: + str = "high"; + break; + default: + str = ""; + break; + } + return str; } static GstVaapiProfile -get_profile(GstVaapiDecoderMpeg2 *decoder, GstVaapiEntrypoint entrypoint) +get_profile (GstVaapiDecoderMpeg2 * decoder, GstVaapiEntrypoint entrypoint) { - GstVaapiDisplay * const va_display = GST_VAAPI_DECODER_DISPLAY(decoder); - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - GstVaapiProfile profile = priv->profile; - - do { - /* Return immediately if the exact same profile was found */ - if (gst_vaapi_display_has_decoder(va_display, profile, entrypoint)) - break; + GstVaapiDisplay *const va_display = GST_VAAPI_DECODER_DISPLAY (decoder); + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + GstVaapiProfile profile = priv->profile; + + do { + /* Return immediately if the exact same profile was found */ + if (gst_vaapi_display_has_decoder (va_display, profile, entrypoint)) + break; - /* Otherwise, try to map to a higher profile */ - switch (profile) { - case GST_VAAPI_PROFILE_MPEG2_SIMPLE: - profile = GST_VAAPI_PROFILE_MPEG2_MAIN; - break; - case GST_VAAPI_PROFILE_MPEG2_MAIN: - profile = GST_VAAPI_PROFILE_MPEG2_HIGH; - break; - case GST_VAAPI_PROFILE_MPEG2_HIGH: - // Try to map to main profile if no high profile specific bits used - if (priv->profile == profile && - !priv->seq_scalable_ext && - (priv->seq_ext && - priv->seq_ext->data.seq_ext.chroma_format == 1)) { - profile = GST_VAAPI_PROFILE_MPEG2_MAIN; - break; - } - // fall-through - default: - profile = GST_VAAPI_PROFILE_UNKNOWN; - break; + /* Otherwise, try to map to a higher profile */ + switch (profile) { + case GST_VAAPI_PROFILE_MPEG2_SIMPLE: + profile = GST_VAAPI_PROFILE_MPEG2_MAIN; + break; + case GST_VAAPI_PROFILE_MPEG2_MAIN: + profile = GST_VAAPI_PROFILE_MPEG2_HIGH; + break; + case GST_VAAPI_PROFILE_MPEG2_HIGH: + // Try to map to main profile if no high profile specific bits used + if (priv->profile == profile && + !priv->seq_scalable_ext && + (priv->seq_ext && priv->seq_ext->data.seq_ext.chroma_format == 1)) { + profile = GST_VAAPI_PROFILE_MPEG2_MAIN; + break; } - } while (profile != GST_VAAPI_PROFILE_UNKNOWN); + // fall-through + default: + profile = GST_VAAPI_PROFILE_UNKNOWN; + break; + } + } while (profile != GST_VAAPI_PROFILE_UNKNOWN); + + if (profile != priv->profile) + GST_INFO ("forced %s profile to %s profile", + get_profile_str (priv->profile), get_profile_str (profile)); + return profile; +} + +static GstVaapiDecoderStatus +ensure_context (GstVaapiDecoderMpeg2 * decoder) +{ + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + GstVaapiEntrypoint entrypoint = GST_VAAPI_ENTRYPOINT_VLD; + gboolean reset_context = FALSE; + + if (priv->profile_changed) { + GST_DEBUG ("profile changed"); + priv->profile_changed = FALSE; + reset_context = TRUE; + + priv->hw_profile = get_profile (decoder, entrypoint); + if (priv->hw_profile == GST_VAAPI_PROFILE_UNKNOWN) + return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; + } + + if (priv->size_changed) { + GST_DEBUG ("size changed"); + priv->size_changed = FALSE; + reset_context = TRUE; + } + + if (reset_context) { + GstVaapiContextInfo info; + + info.profile = priv->hw_profile; + info.entrypoint = entrypoint; + info.chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420; + info.width = priv->width; + info.height = priv->height; + info.ref_frames = 2; + reset_context = + gst_vaapi_decoder_ensure_context (GST_VAAPI_DECODER_CAST (decoder), + &info); + if (!reset_context) + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + } + return GST_VAAPI_DECODER_STATUS_SUCCESS; +} + +static GstVaapiDecoderStatus +ensure_quant_matrix (GstVaapiDecoderMpeg2 * decoder, GstVaapiPicture * picture) +{ + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + GstMpegVideoSequenceHdr *const seq_hdr = &priv->seq_hdr->data.seq_hdr; + VAIQMatrixBufferMPEG2 *iq_matrix; + guint8 *intra_quant_matrix = NULL; + guint8 *non_intra_quant_matrix = NULL; + guint8 *chroma_intra_quant_matrix = NULL; + guint8 *chroma_non_intra_quant_matrix = NULL; + + if (!priv->quant_matrix_changed) + return GST_VAAPI_DECODER_STATUS_SUCCESS; + + priv->quant_matrix_changed = FALSE; + + picture->iq_matrix = GST_VAAPI_IQ_MATRIX_NEW (MPEG2, decoder); + if (!picture->iq_matrix) { + GST_ERROR ("failed to allocate IQ matrix"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } + iq_matrix = picture->iq_matrix->param; + + intra_quant_matrix = seq_hdr->intra_quantizer_matrix; + non_intra_quant_matrix = seq_hdr->non_intra_quantizer_matrix; + + if (priv->quant_matrix) { + GstMpegVideoQuantMatrixExt *const quant_matrix = + &priv->quant_matrix->data.quant_matrix; + if (quant_matrix->load_intra_quantiser_matrix) + intra_quant_matrix = quant_matrix->intra_quantiser_matrix; + if (quant_matrix->load_non_intra_quantiser_matrix) + non_intra_quant_matrix = quant_matrix->non_intra_quantiser_matrix; + if (quant_matrix->load_chroma_intra_quantiser_matrix) + chroma_intra_quant_matrix = quant_matrix->chroma_intra_quantiser_matrix; + if (quant_matrix->load_chroma_non_intra_quantiser_matrix) + chroma_non_intra_quant_matrix = + quant_matrix->chroma_non_intra_quantiser_matrix; + } + + iq_matrix->load_intra_quantiser_matrix = intra_quant_matrix != NULL; + if (intra_quant_matrix) + copy_quant_matrix (iq_matrix->intra_quantiser_matrix, intra_quant_matrix); + + iq_matrix->load_non_intra_quantiser_matrix = non_intra_quant_matrix != NULL; + if (non_intra_quant_matrix) + copy_quant_matrix (iq_matrix->non_intra_quantiser_matrix, + non_intra_quant_matrix); + + iq_matrix->load_chroma_intra_quantiser_matrix = + chroma_intra_quant_matrix != NULL; + if (chroma_intra_quant_matrix) + copy_quant_matrix (iq_matrix->chroma_intra_quantiser_matrix, + chroma_intra_quant_matrix); + + iq_matrix->load_chroma_non_intra_quantiser_matrix = + chroma_non_intra_quant_matrix != NULL; + if (chroma_non_intra_quant_matrix) + copy_quant_matrix (iq_matrix->chroma_non_intra_quantiser_matrix, + chroma_non_intra_quant_matrix); + return GST_VAAPI_DECODER_STATUS_SUCCESS; +} + +static inline gboolean +is_valid_state (GstVaapiDecoderMpeg2 * decoder, guint state) +{ + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; - if (profile != priv->profile) - GST_INFO("forced %s profile to %s profile", - get_profile_str(priv->profile), get_profile_str(profile)); - return profile; + return (priv->state & state) == state; } static GstVaapiDecoderStatus -ensure_context(GstVaapiDecoderMpeg2 *decoder) +decode_current_picture (GstVaapiDecoderMpeg2 * decoder) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - GstVaapiEntrypoint entrypoint = GST_VAAPI_ENTRYPOINT_VLD; - gboolean reset_context = FALSE; + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + GstVaapiPicture *const picture = priv->current_picture; - if (priv->profile_changed) { - GST_DEBUG("profile changed"); - priv->profile_changed = FALSE; - reset_context = TRUE; + if (!is_valid_state (decoder, GST_MPEG_VIDEO_STATE_VALID_PICTURE)) + goto drop_frame; + priv->state &= GST_MPEG_VIDEO_STATE_VALID_SEQ_HEADERS; - priv->hw_profile = get_profile(decoder, entrypoint); - if (priv->hw_profile == GST_VAAPI_PROFILE_UNKNOWN) - return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; - } + if (!picture) + return GST_VAAPI_DECODER_STATUS_SUCCESS; - if (priv->size_changed) { - GST_DEBUG("size changed"); - priv->size_changed = FALSE; - reset_context = TRUE; - } + if (!gst_vaapi_picture_decode (picture)) + goto error; + if (GST_VAAPI_PICTURE_IS_COMPLETE (picture)) { + if (!gst_vaapi_dpb_add (priv->dpb, picture)) + goto error; + gst_vaapi_picture_replace (&priv->current_picture, NULL); + } + return GST_VAAPI_DECODER_STATUS_SUCCESS; - if (reset_context) { - GstVaapiContextInfo info; +error: + /* XXX: fix for cases where first field failed to be decoded */ + gst_vaapi_picture_replace (&priv->current_picture, NULL); + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - info.profile = priv->hw_profile; - info.entrypoint = entrypoint; - info.chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420; - info.width = priv->width; - info.height = priv->height; - info.ref_frames = 2; - reset_context = gst_vaapi_decoder_ensure_context( - GST_VAAPI_DECODER_CAST(decoder), - &info - ); - if (!reset_context) - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - } - return GST_VAAPI_DECODER_STATUS_SUCCESS; +drop_frame: + priv->state &= GST_MPEG_VIDEO_STATE_VALID_SEQ_HEADERS; + return (GstVaapiDecoderStatus) GST_VAAPI_DECODER_STATUS_DROP_FRAME; } static GstVaapiDecoderStatus -ensure_quant_matrix(GstVaapiDecoderMpeg2 *decoder, GstVaapiPicture *picture) +parse_sequence (GstVaapiDecoderMpeg2 * decoder, + GstVaapiDecoderUnit * unit, const GstMpegVideoPacket * packet) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - GstMpegVideoSequenceHdr * const seq_hdr = &priv->seq_hdr->data.seq_hdr; - VAIQMatrixBufferMPEG2 *iq_matrix; - guint8 *intra_quant_matrix = NULL; - guint8 *non_intra_quant_matrix = NULL; - guint8 *chroma_intra_quant_matrix = NULL; - guint8 *chroma_non_intra_quant_matrix = NULL; - - if (!priv->quant_matrix_changed) - return GST_VAAPI_DECODER_STATUS_SUCCESS; - - priv->quant_matrix_changed = FALSE; - - picture->iq_matrix = GST_VAAPI_IQ_MATRIX_NEW(MPEG2, decoder); - if (!picture->iq_matrix) { - GST_ERROR("failed to allocate IQ matrix"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } - iq_matrix = picture->iq_matrix->param; + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + GstMpegVideoSequenceHdr *seq_hdr; - intra_quant_matrix = seq_hdr->intra_quantizer_matrix; - non_intra_quant_matrix = seq_hdr->non_intra_quantizer_matrix; + priv->state = 0; - if (priv->quant_matrix) { - GstMpegVideoQuantMatrixExt * const quant_matrix = - &priv->quant_matrix->data.quant_matrix; - if (quant_matrix->load_intra_quantiser_matrix) - intra_quant_matrix = quant_matrix->intra_quantiser_matrix; - if (quant_matrix->load_non_intra_quantiser_matrix) - non_intra_quant_matrix = quant_matrix->non_intra_quantiser_matrix; - if (quant_matrix->load_chroma_intra_quantiser_matrix) - chroma_intra_quant_matrix = quant_matrix->chroma_intra_quantiser_matrix; - if (quant_matrix->load_chroma_non_intra_quantiser_matrix) - chroma_non_intra_quant_matrix = quant_matrix->chroma_non_intra_quantiser_matrix; - } + if (!gst_vaapi_parser_info_mpeg2_ensure (&priv->seq_hdr)) { + GST_ERROR ("failed to allocate parser info for sequence header"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } - iq_matrix->load_intra_quantiser_matrix = intra_quant_matrix != NULL; - if (intra_quant_matrix) - copy_quant_matrix(iq_matrix->intra_quantiser_matrix, - intra_quant_matrix); - - iq_matrix->load_non_intra_quantiser_matrix = non_intra_quant_matrix != NULL; - if (non_intra_quant_matrix) - copy_quant_matrix(iq_matrix->non_intra_quantiser_matrix, - non_intra_quant_matrix); - - iq_matrix->load_chroma_intra_quantiser_matrix = chroma_intra_quant_matrix != NULL; - if (chroma_intra_quant_matrix) - copy_quant_matrix(iq_matrix->chroma_intra_quantiser_matrix, - chroma_intra_quant_matrix); - - iq_matrix->load_chroma_non_intra_quantiser_matrix = chroma_non_intra_quant_matrix != NULL; - if (chroma_non_intra_quant_matrix) - copy_quant_matrix(iq_matrix->chroma_non_intra_quantiser_matrix, - chroma_non_intra_quant_matrix); - return GST_VAAPI_DECODER_STATUS_SUCCESS; -} + seq_hdr = &priv->seq_hdr->data.seq_hdr; -static inline gboolean -is_valid_state(GstVaapiDecoderMpeg2 *decoder, guint state) -{ - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; + if (!gst_mpeg_video_packet_parse_sequence_header (packet, seq_hdr)) { + GST_ERROR ("failed to parse sequence header"); + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + } - return (priv->state & state) == state; + gst_vaapi_decoder_unit_set_parsed_info (unit, seq_hdr, NULL); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_current_picture(GstVaapiDecoderMpeg2 *decoder) +decode_sequence (GstVaapiDecoderMpeg2 * decoder, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - GstVaapiPicture * const picture = priv->current_picture; + GstVaapiDecoder *const base_decoder = GST_VAAPI_DECODER_CAST (decoder); + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + GstMpegVideoSequenceHdr *const seq_hdr = unit->parsed_info; - if (!is_valid_state(decoder, GST_MPEG_VIDEO_STATE_VALID_PICTURE)) - goto drop_frame; - priv->state &= GST_MPEG_VIDEO_STATE_VALID_SEQ_HEADERS; + gst_vaapi_parser_info_mpeg2_replace (&priv->seq_ext, NULL); + gst_vaapi_parser_info_mpeg2_replace (&priv->seq_display_ext, NULL); + gst_vaapi_parser_info_mpeg2_replace (&priv->seq_scalable_ext, NULL); + gst_vaapi_parser_info_mpeg2_replace (&priv->quant_matrix, NULL); + gst_vaapi_parser_info_mpeg2_replace (&priv->pic_display_ext, NULL); - if (!picture) - return GST_VAAPI_DECODER_STATUS_SUCCESS; - - if (!gst_vaapi_picture_decode(picture)) - goto error; - if (GST_VAAPI_PICTURE_IS_COMPLETE(picture)) { - if (!gst_vaapi_dpb_add(priv->dpb, picture)) - goto error; - gst_vaapi_picture_replace(&priv->current_picture, NULL); - } - return GST_VAAPI_DECODER_STATUS_SUCCESS; + priv->fps_n = seq_hdr->fps_n; + priv->fps_d = seq_hdr->fps_d; + pts_set_framerate (&priv->tsg, priv->fps_n, priv->fps_d); + gst_vaapi_decoder_set_framerate (base_decoder, priv->fps_n, priv->fps_d); -error: - /* XXX: fix for cases where first field failed to be decoded */ - gst_vaapi_picture_replace(&priv->current_picture, NULL); - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + priv->width = seq_hdr->width; + priv->height = seq_hdr->height; + priv->size_changed = TRUE; + priv->quant_matrix_changed = TRUE; + priv->progressive_sequence = TRUE; -drop_frame: - priv->state &= GST_MPEG_VIDEO_STATE_VALID_SEQ_HEADERS; - return (GstVaapiDecoderStatus) GST_VAAPI_DECODER_STATUS_DROP_FRAME; + priv->state |= GST_MPEG_VIDEO_STATE_GOT_SEQ_HDR; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -parse_sequence(GstVaapiDecoderMpeg2 *decoder, - GstVaapiDecoderUnit *unit, const GstMpegVideoPacket *packet) +parse_sequence_ext (GstVaapiDecoderMpeg2 * decoder, + GstVaapiDecoderUnit * unit, const GstMpegVideoPacket * packet) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - GstMpegVideoSequenceHdr *seq_hdr; + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + GstMpegVideoSequenceExt *seq_ext; - priv->state = 0; + priv->state &= GST_MPEG_VIDEO_STATE_GOT_SEQ_HDR; - if (!gst_vaapi_parser_info_mpeg2_ensure(&priv->seq_hdr)) { - GST_ERROR("failed to allocate parser info for sequence header"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } + if (!gst_vaapi_parser_info_mpeg2_ensure (&priv->seq_ext)) { + GST_ERROR ("failed to allocate parser info for sequence extension"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } - seq_hdr = &priv->seq_hdr->data.seq_hdr; + seq_ext = &priv->seq_ext->data.seq_ext; - if (!gst_mpeg_video_packet_parse_sequence_header(packet, seq_hdr)) { - GST_ERROR("failed to parse sequence header"); - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - } + if (!gst_mpeg_video_packet_parse_sequence_extension (packet, seq_ext)) { + GST_ERROR ("failed to parse sequence-extension"); + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + } - gst_vaapi_decoder_unit_set_parsed_info(unit, seq_hdr, NULL); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + gst_vaapi_decoder_unit_set_parsed_info (unit, seq_ext, NULL); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_sequence(GstVaapiDecoderMpeg2 *decoder, GstVaapiDecoderUnit *unit) +decode_sequence_ext (GstVaapiDecoderMpeg2 * decoder, GstVaapiDecoderUnit * unit) { - GstVaapiDecoder * const base_decoder = GST_VAAPI_DECODER_CAST(decoder); - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - GstMpegVideoSequenceHdr * const seq_hdr = unit->parsed_info; - - gst_vaapi_parser_info_mpeg2_replace(&priv->seq_ext, NULL); - gst_vaapi_parser_info_mpeg2_replace(&priv->seq_display_ext, NULL); - gst_vaapi_parser_info_mpeg2_replace(&priv->seq_scalable_ext, NULL); - gst_vaapi_parser_info_mpeg2_replace(&priv->quant_matrix, NULL); - gst_vaapi_parser_info_mpeg2_replace(&priv->pic_display_ext, NULL); - - priv->fps_n = seq_hdr->fps_n; - priv->fps_d = seq_hdr->fps_d; - pts_set_framerate(&priv->tsg, priv->fps_n, priv->fps_d); - gst_vaapi_decoder_set_framerate(base_decoder, priv->fps_n, priv->fps_d); - - priv->width = seq_hdr->width; - priv->height = seq_hdr->height; - priv->size_changed = TRUE; - priv->quant_matrix_changed = TRUE; - priv->progressive_sequence = TRUE; + GstVaapiDecoder *const base_decoder = GST_VAAPI_DECODER_CAST (decoder); + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + GstMpegVideoSequenceExt *const seq_ext = unit->parsed_info; + GstVaapiProfile profile; + guint width, height; - priv->state |= GST_MPEG_VIDEO_STATE_GOT_SEQ_HDR; + if (!is_valid_state (decoder, GST_MPEG_VIDEO_STATE_GOT_SEQ_HDR)) return GST_VAAPI_DECODER_STATUS_SUCCESS; -} - -static GstVaapiDecoderStatus -parse_sequence_ext(GstVaapiDecoderMpeg2 *decoder, - GstVaapiDecoderUnit *unit, const GstMpegVideoPacket *packet) -{ - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - GstMpegVideoSequenceExt *seq_ext; - priv->state &= GST_MPEG_VIDEO_STATE_GOT_SEQ_HDR; + priv->progressive_sequence = seq_ext->progressive; + gst_vaapi_decoder_set_interlaced (base_decoder, !priv->progressive_sequence); - if (!gst_vaapi_parser_info_mpeg2_ensure(&priv->seq_ext)) { - GST_ERROR("failed to allocate parser info for sequence extension"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } + width = (priv->width & 0x0fff) | ((guint32) seq_ext->horiz_size_ext << 12); + height = (priv->height & 0x0fff) | ((guint32) seq_ext->vert_size_ext << 12); + GST_DEBUG ("video resolution %ux%u", width, height); - seq_ext = &priv->seq_ext->data.seq_ext; + if (seq_ext->fps_n_ext && seq_ext->fps_d_ext) { + priv->fps_n *= seq_ext->fps_n_ext + 1; + priv->fps_d *= seq_ext->fps_d_ext + 1; + pts_set_framerate (&priv->tsg, priv->fps_n, priv->fps_d); + gst_vaapi_decoder_set_framerate (base_decoder, priv->fps_n, priv->fps_d); + } - if (!gst_mpeg_video_packet_parse_sequence_extension(packet, seq_ext)) { - GST_ERROR("failed to parse sequence-extension"); - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - } + if (priv->width != width) { + priv->width = width; + priv->size_changed = TRUE; + } - gst_vaapi_decoder_unit_set_parsed_info(unit, seq_ext, NULL); - return GST_VAAPI_DECODER_STATUS_SUCCESS; -} - -static GstVaapiDecoderStatus -decode_sequence_ext(GstVaapiDecoderMpeg2 *decoder, GstVaapiDecoderUnit *unit) -{ - GstVaapiDecoder * const base_decoder = GST_VAAPI_DECODER_CAST(decoder); - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - GstMpegVideoSequenceExt * const seq_ext = unit->parsed_info; - GstVaapiProfile profile; - guint width, height; - - if (!is_valid_state(decoder, GST_MPEG_VIDEO_STATE_GOT_SEQ_HDR)) - return GST_VAAPI_DECODER_STATUS_SUCCESS; - - priv->progressive_sequence = seq_ext->progressive; - gst_vaapi_decoder_set_interlaced(base_decoder, !priv->progressive_sequence); - - width = (priv->width & 0x0fff) | ((guint32)seq_ext->horiz_size_ext << 12); - height = (priv->height & 0x0fff) | ((guint32)seq_ext->vert_size_ext << 12); - GST_DEBUG("video resolution %ux%u", width, height); - - if (seq_ext->fps_n_ext && seq_ext->fps_d_ext) { - priv->fps_n *= seq_ext->fps_n_ext + 1; - priv->fps_d *= seq_ext->fps_d_ext + 1; - pts_set_framerate(&priv->tsg, priv->fps_n, priv->fps_d); - gst_vaapi_decoder_set_framerate(base_decoder, priv->fps_n, priv->fps_d); - } - - if (priv->width != width) { - priv->width = width; - priv->size_changed = TRUE; - } + if (priv->height != height) { + priv->height = height; + priv->size_changed = TRUE; + } - if (priv->height != height) { - priv->height = height; - priv->size_changed = TRUE; - } - - switch (seq_ext->profile) { + switch (seq_ext->profile) { case GST_MPEG_VIDEO_PROFILE_SIMPLE: - profile = GST_VAAPI_PROFILE_MPEG2_SIMPLE; - break; + profile = GST_VAAPI_PROFILE_MPEG2_SIMPLE; + break; case GST_MPEG_VIDEO_PROFILE_MAIN: - profile = GST_VAAPI_PROFILE_MPEG2_MAIN; - break; + profile = GST_VAAPI_PROFILE_MPEG2_MAIN; + break; case GST_MPEG_VIDEO_PROFILE_HIGH: - profile = GST_VAAPI_PROFILE_MPEG2_HIGH; - break; + profile = GST_VAAPI_PROFILE_MPEG2_HIGH; + break; default: - GST_ERROR("unsupported profile %d", seq_ext->profile); - return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; - } - if (priv->profile != profile) { - priv->profile = profile; - priv->profile_changed = TRUE; - } + GST_ERROR ("unsupported profile %d", seq_ext->profile); + return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; + } + if (priv->profile != profile) { + priv->profile = profile; + priv->profile_changed = TRUE; + } - priv->state |= GST_MPEG_VIDEO_STATE_GOT_SEQ_EXT; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + priv->state |= GST_MPEG_VIDEO_STATE_GOT_SEQ_EXT; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -parse_sequence_display_ext(GstVaapiDecoderMpeg2 *decoder, - GstVaapiDecoderUnit *unit, const GstMpegVideoPacket *packet) +parse_sequence_display_ext (GstVaapiDecoderMpeg2 * decoder, + GstVaapiDecoderUnit * unit, const GstMpegVideoPacket * packet) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - GstMpegVideoSequenceDisplayExt *seq_display_ext; + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + GstMpegVideoSequenceDisplayExt *seq_display_ext; - if (!gst_vaapi_parser_info_mpeg2_ensure(&priv->seq_display_ext)) { - GST_ERROR("failed to allocate parser info for sequence display extension"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } + if (!gst_vaapi_parser_info_mpeg2_ensure (&priv->seq_display_ext)) { + GST_ERROR ("failed to allocate parser info for sequence display extension"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } - seq_display_ext = &priv->seq_display_ext->data.seq_display_ext; + seq_display_ext = &priv->seq_display_ext->data.seq_display_ext; - if (!gst_mpeg_video_packet_parse_sequence_display_extension(packet, - seq_display_ext)) { - GST_ERROR("failed to parse sequence-display-extension"); - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - } + if (!gst_mpeg_video_packet_parse_sequence_display_extension (packet, + seq_display_ext)) { + GST_ERROR ("failed to parse sequence-display-extension"); + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + } - gst_vaapi_decoder_unit_set_parsed_info(unit, seq_display_ext, NULL); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + gst_vaapi_decoder_unit_set_parsed_info (unit, seq_display_ext, NULL); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_sequence_display_ext(GstVaapiDecoderMpeg2 *decoder, - GstVaapiDecoderUnit *unit) +decode_sequence_display_ext (GstVaapiDecoderMpeg2 * decoder, + GstVaapiDecoderUnit * unit) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - GstMpegVideoSequenceDisplayExt *seq_display_ext; + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + GstMpegVideoSequenceDisplayExt *seq_display_ext; - seq_display_ext = priv->seq_display_ext ? - &priv->seq_display_ext->data.seq_display_ext : NULL; + seq_display_ext = priv->seq_display_ext ? + &priv->seq_display_ext->data.seq_display_ext : NULL; - /* Update cropping rectangle */ - if (seq_display_ext) { - GstVaapiRectangle * const crop_rect = &priv->crop_rect; - crop_rect->x = 0; - crop_rect->y = 0; - crop_rect->width = seq_display_ext->display_horizontal_size; - crop_rect->height = seq_display_ext->display_vertical_size; - } + /* Update cropping rectangle */ + if (seq_display_ext) { + GstVaapiRectangle *const crop_rect = &priv->crop_rect; + crop_rect->x = 0; + crop_rect->y = 0; + crop_rect->width = seq_display_ext->display_horizontal_size; + crop_rect->height = seq_display_ext->display_vertical_size; + } - /* XXX: handle color primaries */ - return GST_VAAPI_DECODER_STATUS_SUCCESS; + /* XXX: handle color primaries */ + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -parse_sequence_scalable_ext(GstVaapiDecoderMpeg2 *decoder, - GstVaapiDecoderUnit *unit, const GstMpegVideoPacket *packet) +parse_sequence_scalable_ext (GstVaapiDecoderMpeg2 * decoder, + GstVaapiDecoderUnit * unit, const GstMpegVideoPacket * packet) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - GstMpegVideoSequenceScalableExt *seq_scalable_ext; + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + GstMpegVideoSequenceScalableExt *seq_scalable_ext; - if (!gst_vaapi_parser_info_mpeg2_ensure(&priv->seq_scalable_ext)) { - GST_ERROR("failed to allocate parser info for sequence scalable extension"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } + if (!gst_vaapi_parser_info_mpeg2_ensure (&priv->seq_scalable_ext)) { + GST_ERROR + ("failed to allocate parser info for sequence scalable extension"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } - seq_scalable_ext = &priv->seq_scalable_ext->data.seq_scalable_ext; + seq_scalable_ext = &priv->seq_scalable_ext->data.seq_scalable_ext; - if (!gst_mpeg_video_packet_parse_sequence_scalable_extension(packet, - seq_scalable_ext)) { - GST_ERROR("failed to parse sequence-scalable-extension"); - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - } + if (!gst_mpeg_video_packet_parse_sequence_scalable_extension (packet, + seq_scalable_ext)) { + GST_ERROR ("failed to parse sequence-scalable-extension"); + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + } - gst_vaapi_decoder_unit_set_parsed_info(unit, seq_scalable_ext, NULL); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + gst_vaapi_decoder_unit_set_parsed_info (unit, seq_scalable_ext, NULL); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_sequence_scalable_ext(GstVaapiDecoderMpeg2 *decoder, - GstVaapiDecoderUnit *unit) +decode_sequence_scalable_ext (GstVaapiDecoderMpeg2 * decoder, + GstVaapiDecoderUnit * unit) { - /* XXX: unsupported header -- ignore */ - return GST_VAAPI_DECODER_STATUS_SUCCESS; + /* XXX: unsupported header -- ignore */ + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_sequence_end(GstVaapiDecoderMpeg2 *decoder) +decode_sequence_end (GstVaapiDecoderMpeg2 * decoder) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; - if (priv->dpb) - gst_vaapi_dpb_flush(priv->dpb); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + if (priv->dpb) + gst_vaapi_dpb_flush (priv->dpb); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -parse_quant_matrix_ext(GstVaapiDecoderMpeg2 *decoder, - GstVaapiDecoderUnit *unit, const GstMpegVideoPacket *packet) +parse_quant_matrix_ext (GstVaapiDecoderMpeg2 * decoder, + GstVaapiDecoderUnit * unit, const GstMpegVideoPacket * packet) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - GstMpegVideoQuantMatrixExt *quant_matrix; + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + GstMpegVideoQuantMatrixExt *quant_matrix; - if (!gst_vaapi_parser_info_mpeg2_ensure(&priv->quant_matrix)) { - GST_ERROR("failed to allocate parser info for quantization matrix"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } + if (!gst_vaapi_parser_info_mpeg2_ensure (&priv->quant_matrix)) { + GST_ERROR ("failed to allocate parser info for quantization matrix"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } - quant_matrix = &priv->quant_matrix->data.quant_matrix; + quant_matrix = &priv->quant_matrix->data.quant_matrix; - if (!gst_mpeg_video_packet_parse_quant_matrix_extension(packet, - quant_matrix)) { - GST_ERROR("failed to parse quant-matrix-extension"); - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - } + if (!gst_mpeg_video_packet_parse_quant_matrix_extension (packet, + quant_matrix)) { + GST_ERROR ("failed to parse quant-matrix-extension"); + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + } - gst_vaapi_decoder_unit_set_parsed_info(unit, quant_matrix, NULL); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + gst_vaapi_decoder_unit_set_parsed_info (unit, quant_matrix, NULL); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_quant_matrix_ext(GstVaapiDecoderMpeg2 *decoder, - GstVaapiDecoderUnit *unit) +decode_quant_matrix_ext (GstVaapiDecoderMpeg2 * decoder, + GstVaapiDecoderUnit * unit) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; - priv->quant_matrix_changed = TRUE; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + priv->quant_matrix_changed = TRUE; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -parse_gop(GstVaapiDecoderMpeg2 *decoder, - GstVaapiDecoderUnit *unit, const GstMpegVideoPacket *packet) +parse_gop (GstVaapiDecoderMpeg2 * decoder, + GstVaapiDecoderUnit * unit, const GstMpegVideoPacket * packet) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - GstMpegVideoGop *gop; + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + GstMpegVideoGop *gop; - if (!gst_vaapi_parser_info_mpeg2_ensure(&priv->gop)) { - GST_ERROR("failed to allocate parser info for GOP"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } + if (!gst_vaapi_parser_info_mpeg2_ensure (&priv->gop)) { + GST_ERROR ("failed to allocate parser info for GOP"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } - gop = &priv->gop->data.gop; + gop = &priv->gop->data.gop; - if (!gst_mpeg_video_packet_parse_gop(packet, gop)) { - GST_ERROR("failed to parse GOP"); - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - } + if (!gst_mpeg_video_packet_parse_gop (packet, gop)) { + GST_ERROR ("failed to parse GOP"); + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + } - gst_vaapi_decoder_unit_set_parsed_info(unit, gop, NULL); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + gst_vaapi_decoder_unit_set_parsed_info (unit, gop, NULL); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_gop(GstVaapiDecoderMpeg2 *decoder, GstVaapiDecoderUnit *unit) +decode_gop (GstVaapiDecoderMpeg2 * decoder, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - GstMpegVideoGop * const gop = unit->parsed_info; + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + GstMpegVideoGop *const gop = unit->parsed_info; - priv->closed_gop = gop->closed_gop; - priv->broken_link = gop->broken_link; + priv->closed_gop = gop->closed_gop; + priv->broken_link = gop->broken_link; - GST_DEBUG("GOP %02u:%02u:%02u:%02u (closed_gop %d, broken_link %d)", - gop->hour, gop->minute, gop->second, gop->frame, - priv->closed_gop, priv->broken_link); + GST_DEBUG ("GOP %02u:%02u:%02u:%02u (closed_gop %d, broken_link %d)", + gop->hour, gop->minute, gop->second, gop->frame, + priv->closed_gop, priv->broken_link); - pts_sync(&priv->tsg, GST_VAAPI_DECODER_CODEC_FRAME(decoder)->pts); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + pts_sync (&priv->tsg, GST_VAAPI_DECODER_CODEC_FRAME (decoder)->pts); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -parse_picture(GstVaapiDecoderMpeg2 *decoder, - GstVaapiDecoderUnit *unit, const GstMpegVideoPacket *packet) +parse_picture (GstVaapiDecoderMpeg2 * decoder, + GstVaapiDecoderUnit * unit, const GstMpegVideoPacket * packet) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - GstMpegVideoPictureHdr *pic_hdr; + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + GstMpegVideoPictureHdr *pic_hdr; - priv->state &= (GST_MPEG_VIDEO_STATE_GOT_SEQ_HDR| - GST_MPEG_VIDEO_STATE_GOT_SEQ_EXT); + priv->state &= (GST_MPEG_VIDEO_STATE_GOT_SEQ_HDR | + GST_MPEG_VIDEO_STATE_GOT_SEQ_EXT); - if (!gst_vaapi_parser_info_mpeg2_ensure(&priv->pic_hdr)) { - GST_ERROR("failed to allocate parser info for picture header"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } + if (!gst_vaapi_parser_info_mpeg2_ensure (&priv->pic_hdr)) { + GST_ERROR ("failed to allocate parser info for picture header"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } - pic_hdr = &priv->pic_hdr->data.pic_hdr; + pic_hdr = &priv->pic_hdr->data.pic_hdr; - if (!gst_mpeg_video_packet_parse_picture_header(packet, pic_hdr)) { - GST_ERROR("failed to parse picture header"); - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - } + if (!gst_mpeg_video_packet_parse_picture_header (packet, pic_hdr)) { + GST_ERROR ("failed to parse picture header"); + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + } - gst_vaapi_decoder_unit_set_parsed_info(unit, pic_hdr, NULL); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + gst_vaapi_decoder_unit_set_parsed_info (unit, pic_hdr, NULL); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_picture(GstVaapiDecoderMpeg2 *decoder, GstVaapiDecoderUnit *unit) +decode_picture (GstVaapiDecoderMpeg2 * decoder, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; - if (!is_valid_state(decoder, GST_MPEG_VIDEO_STATE_VALID_SEQ_HEADERS)) - return GST_VAAPI_DECODER_STATUS_SUCCESS; + if (!is_valid_state (decoder, GST_MPEG_VIDEO_STATE_VALID_SEQ_HEADERS)) + return GST_VAAPI_DECODER_STATUS_SUCCESS; - gst_vaapi_parser_info_mpeg2_replace(&priv->pic_ext, NULL); + gst_vaapi_parser_info_mpeg2_replace (&priv->pic_ext, NULL); - priv->state |= GST_MPEG_VIDEO_STATE_GOT_PIC_HDR; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + priv->state |= GST_MPEG_VIDEO_STATE_GOT_PIC_HDR; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -parse_picture_ext(GstVaapiDecoderMpeg2 *decoder, - GstVaapiDecoderUnit *unit, const GstMpegVideoPacket *packet) +parse_picture_ext (GstVaapiDecoderMpeg2 * decoder, + GstVaapiDecoderUnit * unit, const GstMpegVideoPacket * packet) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - GstMpegVideoPictureExt *pic_ext; + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + GstMpegVideoPictureExt *pic_ext; - priv->state &= (GST_MPEG_VIDEO_STATE_GOT_SEQ_HDR| - GST_MPEG_VIDEO_STATE_GOT_SEQ_EXT| - GST_MPEG_VIDEO_STATE_GOT_PIC_HDR); - - if (!gst_vaapi_parser_info_mpeg2_ensure(&priv->pic_ext)) { - GST_ERROR("failed to allocate parser info for picture extension"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } + priv->state &= (GST_MPEG_VIDEO_STATE_GOT_SEQ_HDR | + GST_MPEG_VIDEO_STATE_GOT_SEQ_EXT | GST_MPEG_VIDEO_STATE_GOT_PIC_HDR); - pic_ext = &priv->pic_ext->data.pic_ext; + if (!gst_vaapi_parser_info_mpeg2_ensure (&priv->pic_ext)) { + GST_ERROR ("failed to allocate parser info for picture extension"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } - if (!gst_mpeg_video_packet_parse_picture_extension(packet, pic_ext)) { - GST_ERROR("failed to parse picture-extension"); - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - } + pic_ext = &priv->pic_ext->data.pic_ext; - gst_vaapi_decoder_unit_set_parsed_info(unit, pic_ext, NULL); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + if (!gst_mpeg_video_packet_parse_picture_extension (packet, pic_ext)) { + GST_ERROR ("failed to parse picture-extension"); + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + } + + gst_vaapi_decoder_unit_set_parsed_info (unit, pic_ext, NULL); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_picture_ext(GstVaapiDecoderMpeg2 *decoder, GstVaapiDecoderUnit *unit) +decode_picture_ext (GstVaapiDecoderMpeg2 * decoder, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - GstMpegVideoPictureExt * const pic_ext = unit->parsed_info; + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + GstMpegVideoPictureExt *const pic_ext = unit->parsed_info; - if (!is_valid_state(decoder, GST_MPEG_VIDEO_STATE_GOT_PIC_HDR)) - return GST_VAAPI_DECODER_STATUS_SUCCESS; + if (!is_valid_state (decoder, GST_MPEG_VIDEO_STATE_GOT_PIC_HDR)) + return GST_VAAPI_DECODER_STATUS_SUCCESS; - if (priv->progressive_sequence && !pic_ext->progressive_frame) { - GST_WARNING("invalid interlaced frame in progressive sequence, fixing"); - pic_ext->progressive_frame = 1; - } + if (priv->progressive_sequence && !pic_ext->progressive_frame) { + GST_WARNING ("invalid interlaced frame in progressive sequence, fixing"); + pic_ext->progressive_frame = 1; + } - if (pic_ext->picture_structure == 0 || - (pic_ext->progressive_frame && - pic_ext->picture_structure != GST_MPEG_VIDEO_PICTURE_STRUCTURE_FRAME)) { - GST_WARNING("invalid picture_structure %d, replacing with \"frame\"", - pic_ext->picture_structure); - pic_ext->picture_structure = GST_MPEG_VIDEO_PICTURE_STRUCTURE_FRAME; - } + if (pic_ext->picture_structure == 0 || + (pic_ext->progressive_frame && + pic_ext->picture_structure != + GST_MPEG_VIDEO_PICTURE_STRUCTURE_FRAME)) { + GST_WARNING ("invalid picture_structure %d, replacing with \"frame\"", + pic_ext->picture_structure); + pic_ext->picture_structure = GST_MPEG_VIDEO_PICTURE_STRUCTURE_FRAME; + } - priv->state |= GST_MPEG_VIDEO_STATE_GOT_PIC_EXT; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + priv->state |= GST_MPEG_VIDEO_STATE_GOT_PIC_EXT; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static inline guint32 -pack_f_code(guint8 f_code[2][2]) +pack_f_code (guint8 f_code[2][2]) { - return (((guint32)f_code[0][0] << 12) | - ((guint32)f_code[0][1] << 8) | - ((guint32)f_code[1][0] << 4) | - ( f_code[1][1] )); + return (((guint32) f_code[0][0] << 12) | + ((guint32) f_code[0][1] << 8) | + ((guint32) f_code[1][0] << 4) | (f_code[1][1])); } static GstVaapiDecoderStatus -init_picture(GstVaapiDecoderMpeg2 *decoder, GstVaapiPicture *picture) +init_picture (GstVaapiDecoderMpeg2 * decoder, GstVaapiPicture * picture) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - GstMpegVideoPictureHdr * const pic_hdr = &priv->pic_hdr->data.pic_hdr; - GstMpegVideoPictureExt * const pic_ext = &priv->pic_ext->data.pic_ext; + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + GstMpegVideoPictureHdr *const pic_hdr = &priv->pic_hdr->data.pic_hdr; + GstMpegVideoPictureExt *const pic_ext = &priv->pic_ext->data.pic_ext; - switch (pic_hdr->pic_type) { + switch (pic_hdr->pic_type) { case GST_MPEG_VIDEO_PICTURE_TYPE_I: - GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_REFERENCE); - picture->type = GST_VAAPI_PICTURE_TYPE_I; - break; + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_REFERENCE); + picture->type = GST_VAAPI_PICTURE_TYPE_I; + break; case GST_MPEG_VIDEO_PICTURE_TYPE_P: - GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_REFERENCE); - picture->type = GST_VAAPI_PICTURE_TYPE_P; - break; + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_REFERENCE); + picture->type = GST_VAAPI_PICTURE_TYPE_P; + break; case GST_MPEG_VIDEO_PICTURE_TYPE_B: - picture->type = GST_VAAPI_PICTURE_TYPE_B; - break; + picture->type = GST_VAAPI_PICTURE_TYPE_B; + break; default: - GST_ERROR("unsupported picture type %d", pic_hdr->pic_type); - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - } - - if (!priv->progressive_sequence && !pic_ext->progressive_frame) { - GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_INTERLACED); - if (pic_ext->top_field_first) - GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_TFF); - } + GST_ERROR ("unsupported picture type %d", pic_hdr->pic_type); + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + } + + if (!priv->progressive_sequence && !pic_ext->progressive_frame) { + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_INTERLACED); + if (pic_ext->top_field_first) + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_TFF); + } - switch (pic_ext->picture_structure) { + switch (pic_ext->picture_structure) { case GST_MPEG_VIDEO_PICTURE_STRUCTURE_TOP_FIELD: - picture->structure = GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD; - break; + picture->structure = GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD; + break; case GST_MPEG_VIDEO_PICTURE_STRUCTURE_BOTTOM_FIELD: - picture->structure = GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD; - break; + picture->structure = GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD; + break; case GST_MPEG_VIDEO_PICTURE_STRUCTURE_FRAME: - picture->structure = GST_VAAPI_PICTURE_STRUCTURE_FRAME; - break; - } - - /* Allocate dummy picture for first field based I-frame */ - if (picture->type == GST_VAAPI_PICTURE_TYPE_I && - !GST_VAAPI_PICTURE_IS_FRAME(picture) && - gst_vaapi_dpb_size(priv->dpb) == 0) { - GstVaapiPicture *dummy_picture; - gboolean success; - - dummy_picture = GST_VAAPI_PICTURE_NEW(MPEG2, decoder); - if (!dummy_picture) { - GST_ERROR("failed to allocate dummy picture"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } - - dummy_picture->type = GST_VAAPI_PICTURE_TYPE_I; - dummy_picture->pts = GST_CLOCK_TIME_NONE; - dummy_picture->poc = -1; - dummy_picture->structure = GST_VAAPI_PICTURE_STRUCTURE_FRAME; - - GST_VAAPI_PICTURE_FLAG_SET( - dummy_picture, - (GST_VAAPI_PICTURE_FLAG_SKIPPED | - GST_VAAPI_PICTURE_FLAG_OUTPUT | - GST_VAAPI_PICTURE_FLAG_REFERENCE) + picture->structure = GST_VAAPI_PICTURE_STRUCTURE_FRAME; + break; + } + + /* Allocate dummy picture for first field based I-frame */ + if (picture->type == GST_VAAPI_PICTURE_TYPE_I && + !GST_VAAPI_PICTURE_IS_FRAME (picture) && + gst_vaapi_dpb_size (priv->dpb) == 0) { + GstVaapiPicture *dummy_picture; + gboolean success; + + dummy_picture = GST_VAAPI_PICTURE_NEW (MPEG2, decoder); + if (!dummy_picture) { + GST_ERROR ("failed to allocate dummy picture"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } + + dummy_picture->type = GST_VAAPI_PICTURE_TYPE_I; + dummy_picture->pts = GST_CLOCK_TIME_NONE; + dummy_picture->poc = -1; + dummy_picture->structure = GST_VAAPI_PICTURE_STRUCTURE_FRAME; + + GST_VAAPI_PICTURE_FLAG_SET (dummy_picture, + (GST_VAAPI_PICTURE_FLAG_SKIPPED | + GST_VAAPI_PICTURE_FLAG_OUTPUT | GST_VAAPI_PICTURE_FLAG_REFERENCE) ); - success = gst_vaapi_dpb_add(priv->dpb, dummy_picture); - gst_vaapi_picture_unref(dummy_picture); - if (!success) { - GST_ERROR("failed to add dummy picture into DPB"); - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - } - GST_INFO("allocated dummy picture for first field based I-frame"); - } - - /* Update presentation time */ - picture->pts = pts_eval(&priv->tsg, - GST_VAAPI_DECODER_CODEC_FRAME(decoder)->pts, pic_hdr->tsn); - picture->poc = pts_get_poc(&priv->tsg); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + success = gst_vaapi_dpb_add (priv->dpb, dummy_picture); + gst_vaapi_picture_unref (dummy_picture); + if (!success) { + GST_ERROR ("failed to add dummy picture into DPB"); + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + } + GST_INFO ("allocated dummy picture for first field based I-frame"); + } + + /* Update presentation time */ + picture->pts = pts_eval (&priv->tsg, + GST_VAAPI_DECODER_CODEC_FRAME (decoder)->pts, pic_hdr->tsn); + picture->poc = pts_get_poc (&priv->tsg); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static void -fill_picture(GstVaapiDecoderMpeg2 *decoder, GstVaapiPicture *picture) +fill_picture (GstVaapiDecoderMpeg2 * decoder, GstVaapiPicture * picture) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - VAPictureParameterBufferMPEG2 * const pic_param = picture->param; - GstMpegVideoPictureHdr * const pic_hdr = &priv->pic_hdr->data.pic_hdr; - GstMpegVideoPictureExt * const pic_ext = &priv->pic_ext->data.pic_ext; - GstVaapiPicture *prev_picture, *next_picture; - - /* Fill in VAPictureParameterBufferMPEG2 */ - pic_param->horizontal_size = priv->width; - pic_param->vertical_size = priv->height; - pic_param->forward_reference_picture = VA_INVALID_ID; - pic_param->backward_reference_picture = VA_INVALID_ID; - pic_param->picture_coding_type = pic_hdr->pic_type; - pic_param->f_code = pack_f_code(pic_ext->f_code); + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + VAPictureParameterBufferMPEG2 *const pic_param = picture->param; + GstMpegVideoPictureHdr *const pic_hdr = &priv->pic_hdr->data.pic_hdr; + GstMpegVideoPictureExt *const pic_ext = &priv->pic_ext->data.pic_ext; + GstVaapiPicture *prev_picture, *next_picture; + + /* Fill in VAPictureParameterBufferMPEG2 */ + pic_param->horizontal_size = priv->width; + pic_param->vertical_size = priv->height; + pic_param->forward_reference_picture = VA_INVALID_ID; + pic_param->backward_reference_picture = VA_INVALID_ID; + pic_param->picture_coding_type = pic_hdr->pic_type; + pic_param->f_code = pack_f_code (pic_ext->f_code); #define COPY_FIELD(a, b, f) \ pic_param->a.b.f = pic_ext->f - pic_param->picture_coding_extension.value = 0; - pic_param->picture_coding_extension.bits.is_first_field = - GST_VAAPI_PICTURE_IS_FIRST_FIELD(picture); - COPY_FIELD(picture_coding_extension, bits, intra_dc_precision); - COPY_FIELD(picture_coding_extension, bits, picture_structure); - COPY_FIELD(picture_coding_extension, bits, top_field_first); - COPY_FIELD(picture_coding_extension, bits, frame_pred_frame_dct); - COPY_FIELD(picture_coding_extension, bits, concealment_motion_vectors); - COPY_FIELD(picture_coding_extension, bits, q_scale_type); - COPY_FIELD(picture_coding_extension, bits, intra_vlc_format); - COPY_FIELD(picture_coding_extension, bits, alternate_scan); - COPY_FIELD(picture_coding_extension, bits, repeat_first_field); - COPY_FIELD(picture_coding_extension, bits, progressive_frame); + pic_param->picture_coding_extension.value = 0; + pic_param->picture_coding_extension.bits.is_first_field = + GST_VAAPI_PICTURE_IS_FIRST_FIELD (picture); + COPY_FIELD (picture_coding_extension, bits, intra_dc_precision); + COPY_FIELD (picture_coding_extension, bits, picture_structure); + COPY_FIELD (picture_coding_extension, bits, top_field_first); + COPY_FIELD (picture_coding_extension, bits, frame_pred_frame_dct); + COPY_FIELD (picture_coding_extension, bits, concealment_motion_vectors); + COPY_FIELD (picture_coding_extension, bits, q_scale_type); + COPY_FIELD (picture_coding_extension, bits, intra_vlc_format); + COPY_FIELD (picture_coding_extension, bits, alternate_scan); + COPY_FIELD (picture_coding_extension, bits, repeat_first_field); + COPY_FIELD (picture_coding_extension, bits, progressive_frame); - gst_vaapi_dpb_get_neighbours(priv->dpb, picture, - &prev_picture, &next_picture); + gst_vaapi_dpb_get_neighbours (priv->dpb, picture, + &prev_picture, &next_picture); - switch (pic_hdr->pic_type) { + switch (pic_hdr->pic_type) { case GST_MPEG_VIDEO_PICTURE_TYPE_B: - if (next_picture) - pic_param->backward_reference_picture = next_picture->surface_id; - if (prev_picture) - pic_param->forward_reference_picture = prev_picture->surface_id; - else if (!priv->closed_gop) - GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_SKIPPED); - break; + if (next_picture) + pic_param->backward_reference_picture = next_picture->surface_id; + if (prev_picture) + pic_param->forward_reference_picture = prev_picture->surface_id; + else if (!priv->closed_gop) + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_SKIPPED); + break; case GST_MPEG_VIDEO_PICTURE_TYPE_P: - if (prev_picture) - pic_param->forward_reference_picture = prev_picture->surface_id; - break; - } + if (prev_picture) + pic_param->forward_reference_picture = prev_picture->surface_id; + break; + } } static GstVaapiDecoderStatus -parse_slice(GstVaapiDecoderMpeg2 *decoder, - GstVaapiDecoderUnit *unit, const GstMpegVideoPacket *packet) +parse_slice (GstVaapiDecoderMpeg2 * decoder, + GstVaapiDecoderUnit * unit, const GstMpegVideoPacket * packet) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - GstMpegVideoSliceHdr *slice_hdr; - GstMpegVideoSequenceHdr *seq_hdr; - GstMpegVideoSequenceScalableExt *seq_scalable_ext; - - priv->state &= (GST_MPEG_VIDEO_STATE_GOT_SEQ_HDR| - GST_MPEG_VIDEO_STATE_GOT_SEQ_EXT| - GST_MPEG_VIDEO_STATE_GOT_PIC_HDR| - GST_MPEG_VIDEO_STATE_GOT_PIC_EXT); - - if (!is_valid_state(decoder, GST_MPEG_VIDEO_STATE_VALID_PIC_HEADERS)) - return GST_VAAPI_DECODER_STATUS_SUCCESS; - - if (!gst_vaapi_parser_info_mpeg2_ensure(&priv->slice_hdr)) { - GST_ERROR("failed to allocate parser info for slice header"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + GstMpegVideoSliceHdr *slice_hdr; + GstMpegVideoSequenceHdr *seq_hdr; + GstMpegVideoSequenceScalableExt *seq_scalable_ext; - slice_hdr = &priv->slice_hdr->data.slice_hdr; - seq_hdr = &priv->seq_hdr->data.seq_hdr; - seq_scalable_ext = priv->seq_scalable_ext ? - &priv->seq_scalable_ext->data.seq_scalable_ext : NULL; - - if (!gst_mpeg_video_packet_parse_slice_header(packet, slice_hdr, - seq_hdr, seq_scalable_ext)) { - GST_ERROR("failed to parse slice header"); - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - } + priv->state &= (GST_MPEG_VIDEO_STATE_GOT_SEQ_HDR | + GST_MPEG_VIDEO_STATE_GOT_SEQ_EXT | + GST_MPEG_VIDEO_STATE_GOT_PIC_HDR | GST_MPEG_VIDEO_STATE_GOT_PIC_EXT); - gst_vaapi_decoder_unit_set_parsed_info(unit, slice_hdr, NULL); + if (!is_valid_state (decoder, GST_MPEG_VIDEO_STATE_VALID_PIC_HEADERS)) return GST_VAAPI_DECODER_STATUS_SUCCESS; + + if (!gst_vaapi_parser_info_mpeg2_ensure (&priv->slice_hdr)) { + GST_ERROR ("failed to allocate parser info for slice header"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } + + slice_hdr = &priv->slice_hdr->data.slice_hdr; + seq_hdr = &priv->seq_hdr->data.seq_hdr; + seq_scalable_ext = priv->seq_scalable_ext ? + &priv->seq_scalable_ext->data.seq_scalable_ext : NULL; + + if (!gst_mpeg_video_packet_parse_slice_header (packet, slice_hdr, + seq_hdr, seq_scalable_ext)) { + GST_ERROR ("failed to parse slice header"); + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + } + + gst_vaapi_decoder_unit_set_parsed_info (unit, slice_hdr, NULL); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_slice(GstVaapiDecoderMpeg2 *decoder, GstVaapiDecoderUnit *unit) +decode_slice (GstVaapiDecoderMpeg2 * decoder, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - GstVaapiPicture * const picture = priv->current_picture; - GstVaapiSlice *slice; - VASliceParameterBufferMPEG2 *slice_param; - GstMpegVideoSliceHdr * const slice_hdr = unit->parsed_info; - GstBuffer * const buffer = - GST_VAAPI_DECODER_CODEC_FRAME(decoder)->input_buffer; - GstMapInfo map_info; - - if (!is_valid_state(decoder, GST_MPEG_VIDEO_STATE_VALID_PIC_HEADERS)) - return GST_VAAPI_DECODER_STATUS_SUCCESS; - - if (!gst_buffer_map(buffer, &map_info, GST_MAP_READ)) { - GST_ERROR("failed to map buffer"); - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - } + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + GstVaapiPicture *const picture = priv->current_picture; + GstVaapiSlice *slice; + VASliceParameterBufferMPEG2 *slice_param; + GstMpegVideoSliceHdr *const slice_hdr = unit->parsed_info; + GstBuffer *const buffer = + GST_VAAPI_DECODER_CODEC_FRAME (decoder)->input_buffer; + GstMapInfo map_info; - GST_DEBUG("slice %d (%u bytes)", slice_hdr->mb_row, unit->size); + if (!is_valid_state (decoder, GST_MPEG_VIDEO_STATE_VALID_PIC_HEADERS)) + return GST_VAAPI_DECODER_STATUS_SUCCESS; - slice = GST_VAAPI_SLICE_NEW(MPEG2, decoder, - (map_info.data + unit->offset), unit->size); - gst_buffer_unmap(buffer, &map_info); - if (!slice) { - GST_ERROR("failed to allocate slice"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } - gst_vaapi_picture_add_slice(picture, slice); + if (!gst_buffer_map (buffer, &map_info, GST_MAP_READ)) { + GST_ERROR ("failed to map buffer"); + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + } - /* Fill in VASliceParameterBufferMPEG2 */ - slice_param = slice->param; - slice_param->macroblock_offset = slice_hdr->header_size + 32; - slice_param->slice_horizontal_position = slice_hdr->mb_column; - slice_param->slice_vertical_position = slice_hdr->mb_row; - slice_param->quantiser_scale_code = slice_hdr->quantiser_scale_code; - slice_param->intra_slice_flag = slice_hdr->intra_slice; + GST_DEBUG ("slice %d (%u bytes)", slice_hdr->mb_row, unit->size); - priv->state |= GST_MPEG_VIDEO_STATE_GOT_SLICE; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + slice = GST_VAAPI_SLICE_NEW (MPEG2, decoder, + (map_info.data + unit->offset), unit->size); + gst_buffer_unmap (buffer, &map_info); + if (!slice) { + GST_ERROR ("failed to allocate slice"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } + gst_vaapi_picture_add_slice (picture, slice); + + /* Fill in VASliceParameterBufferMPEG2 */ + slice_param = slice->param; + slice_param->macroblock_offset = slice_hdr->header_size + 32; + slice_param->slice_horizontal_position = slice_hdr->mb_column; + slice_param->slice_vertical_position = slice_hdr->mb_row; + slice_param->quantiser_scale_code = slice_hdr->quantiser_scale_code; + slice_param->intra_slice_flag = slice_hdr->intra_slice; + + priv->state |= GST_MPEG_VIDEO_STATE_GOT_SLICE; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static inline gint -scan_for_start_code(const guchar *buf, guint buf_size, - GstMpegVideoPacketTypeCode *type_ptr) +scan_for_start_code (const guchar * buf, guint buf_size, + GstMpegVideoPacketTypeCode * type_ptr) { - guint i = 0; - - while (i <= (buf_size - 4)) { - if (buf[i + 2] > 1) - i += 3; - else if (buf[i + 1]) - i += 2; - else if (buf[i] || buf[i + 2] != 1) - i++; - else - break; - } + guint i = 0; - if (i <= (buf_size - 4)) { - if (type_ptr) - *type_ptr = buf[i + 3]; - return i; - } - return -1; + while (i <= (buf_size - 4)) { + if (buf[i + 2] > 1) + i += 3; + else if (buf[i + 1]) + i += 2; + else if (buf[i] || buf[i + 2] != 1) + i++; + else + break; + } + + if (i <= (buf_size - 4)) { + if (type_ptr) + *type_ptr = buf[i + 3]; + return i; + } + return -1; } static GstVaapiDecoderStatus -parse_unit(GstVaapiDecoderMpeg2 *decoder, GstVaapiDecoderUnit *unit, - GstMpegVideoPacket *packet) -{ - GstMpegVideoPacketTypeCode type; - GstMpegVideoPacketExtensionCode ext_type; - GstVaapiDecoderStatus status; +parse_unit (GstVaapiDecoderMpeg2 * decoder, GstVaapiDecoderUnit * unit, + GstMpegVideoPacket * packet) +{ + GstMpegVideoPacketTypeCode type; + GstMpegVideoPacketExtensionCode ext_type; + GstVaapiDecoderStatus status; - type = packet->type; - switch (type) { + type = packet->type; + switch (type) { case GST_MPEG_VIDEO_PACKET_PICTURE: - status = parse_picture(decoder, unit, packet); - break; + status = parse_picture (decoder, unit, packet); + break; case GST_MPEG_VIDEO_PACKET_SEQUENCE: - status = parse_sequence(decoder, unit, packet); - break; + status = parse_sequence (decoder, unit, packet); + break; case GST_MPEG_VIDEO_PACKET_EXTENSION: - ext_type = packet->data[4] >> 4; - switch (ext_type) { + ext_type = packet->data[4] >> 4; + switch (ext_type) { case GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE: - status = parse_sequence_ext(decoder, unit, packet); - break; + status = parse_sequence_ext (decoder, unit, packet); + break; case GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE_DISPLAY: - status = parse_sequence_display_ext(decoder, unit, packet); - break; + status = parse_sequence_display_ext (decoder, unit, packet); + break; case GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE_SCALABLE: - status = parse_sequence_scalable_ext(decoder, unit, packet); - break; + status = parse_sequence_scalable_ext (decoder, unit, packet); + break; case GST_MPEG_VIDEO_PACKET_EXT_QUANT_MATRIX: - status = parse_quant_matrix_ext(decoder, unit, packet); - break; + status = parse_quant_matrix_ext (decoder, unit, packet); + break; case GST_MPEG_VIDEO_PACKET_EXT_PICTURE: - status = parse_picture_ext(decoder, unit, packet); - break; + status = parse_picture_ext (decoder, unit, packet); + break; default: - status = GST_VAAPI_DECODER_STATUS_SUCCESS; - break; - } - break; + status = GST_VAAPI_DECODER_STATUS_SUCCESS; + break; + } + break; case GST_MPEG_VIDEO_PACKET_GOP: - status = parse_gop(decoder, unit, packet); - break; + status = parse_gop (decoder, unit, packet); + break; default: - if (type >= GST_MPEG_VIDEO_PACKET_SLICE_MIN && - type <= GST_MPEG_VIDEO_PACKET_SLICE_MAX) { - status = parse_slice(decoder, unit, packet); - break; - } - status = GST_VAAPI_DECODER_STATUS_SUCCESS; + if (type >= GST_MPEG_VIDEO_PACKET_SLICE_MIN && + type <= GST_MPEG_VIDEO_PACKET_SLICE_MAX) { + status = parse_slice (decoder, unit, packet); break; - } - return status; + } + status = GST_VAAPI_DECODER_STATUS_SUCCESS; + break; + } + return status; } static GstVaapiDecoderStatus -decode_unit(GstVaapiDecoderMpeg2 *decoder, GstVaapiDecoderUnit *unit, - GstMpegVideoPacket *packet) +decode_unit (GstVaapiDecoderMpeg2 * decoder, GstVaapiDecoderUnit * unit, + GstMpegVideoPacket * packet) { - GstMpegVideoPacketTypeCode type; - GstMpegVideoPacketExtensionCode ext_type; - GstVaapiDecoderStatus status; + GstMpegVideoPacketTypeCode type; + GstMpegVideoPacketExtensionCode ext_type; + GstVaapiDecoderStatus status; - type = packet->type; - switch (type) { + type = packet->type; + switch (type) { case GST_MPEG_VIDEO_PACKET_PICTURE: - status = decode_picture(decoder, unit); - break; + status = decode_picture (decoder, unit); + break; case GST_MPEG_VIDEO_PACKET_SEQUENCE: - status = decode_sequence(decoder, unit); - break; + status = decode_sequence (decoder, unit); + break; case GST_MPEG_VIDEO_PACKET_EXTENSION: - ext_type = packet->data[4] >> 4; - switch (ext_type) { + ext_type = packet->data[4] >> 4; + switch (ext_type) { case GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE: - status = decode_sequence_ext(decoder, unit); - break; + status = decode_sequence_ext (decoder, unit); + break; case GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE_DISPLAY: - status = decode_sequence_display_ext(decoder, unit); - break; + status = decode_sequence_display_ext (decoder, unit); + break; case GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE_SCALABLE: - status = decode_sequence_scalable_ext(decoder, unit); - break; + status = decode_sequence_scalable_ext (decoder, unit); + break; case GST_MPEG_VIDEO_PACKET_EXT_QUANT_MATRIX: - status = decode_quant_matrix_ext(decoder, unit); - break; + status = decode_quant_matrix_ext (decoder, unit); + break; case GST_MPEG_VIDEO_PACKET_EXT_PICTURE: - status = decode_picture_ext(decoder, unit); - break; + status = decode_picture_ext (decoder, unit); + break; default: - // Ignore unknown start-code extensions - GST_WARNING("unsupported packet extension type 0x%02x", ext_type); - status = GST_VAAPI_DECODER_STATUS_SUCCESS; - break; - } - break; + // Ignore unknown start-code extensions + GST_WARNING ("unsupported packet extension type 0x%02x", ext_type); + status = GST_VAAPI_DECODER_STATUS_SUCCESS; + break; + } + break; case GST_MPEG_VIDEO_PACKET_SEQUENCE_END: - status = decode_sequence_end(decoder); - break; + status = decode_sequence_end (decoder); + break; case GST_MPEG_VIDEO_PACKET_GOP: - status = decode_gop(decoder, unit); - break; + status = decode_gop (decoder, unit); + break; default: - if (type >= GST_MPEG_VIDEO_PACKET_SLICE_MIN && - type <= GST_MPEG_VIDEO_PACKET_SLICE_MAX) { - status = decode_slice(decoder, unit); - break; - } - GST_WARNING("unsupported packet type 0x%02x", type); - status = GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + if (type >= GST_MPEG_VIDEO_PACKET_SLICE_MIN && + type <= GST_MPEG_VIDEO_PACKET_SLICE_MAX) { + status = decode_slice (decoder, unit); break; - } - return status; + } + GST_WARNING ("unsupported packet type 0x%02x", type); + status = GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + break; + } + return status; } static GstVaapiDecoderStatus -ensure_decoder(GstVaapiDecoderMpeg2 *decoder) +ensure_decoder (GstVaapiDecoderMpeg2 * decoder) { - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; - if (!priv->is_opened) { - priv->is_opened = gst_vaapi_decoder_mpeg2_open(decoder); - if (!priv->is_opened) - return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC; - } - return GST_VAAPI_DECODER_STATUS_SUCCESS; + if (!priv->is_opened) { + priv->is_opened = gst_vaapi_decoder_mpeg2_open (decoder); + if (!priv->is_opened) + return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC; + } + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -gst_vaapi_decoder_mpeg2_parse(GstVaapiDecoder *base_decoder, - GstAdapter *adapter, gboolean at_eos, GstVaapiDecoderUnit *unit) +gst_vaapi_decoder_mpeg2_parse (GstVaapiDecoder * base_decoder, + GstAdapter * adapter, gboolean at_eos, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderMpeg2 * const decoder = - GST_VAAPI_DECODER_MPEG2_CAST(base_decoder); - GstVaapiParserState * const ps = GST_VAAPI_PARSER_STATE(base_decoder); - GstVaapiDecoderStatus status; - GstMpegVideoPacketTypeCode type, type2 = GST_MPEG_VIDEO_PACKET_NONE; - const guchar *buf; - guint buf_size, flags; - gint ofs, ofs1, ofs2; - - status = ensure_decoder(decoder); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - - buf_size = gst_adapter_available(adapter); - if (buf_size < 4) - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - - buf = gst_adapter_map(adapter, buf_size); - if (!buf) - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - - ofs = scan_for_start_code(buf, buf_size, &type); - if (ofs < 0) - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - ofs1 = ofs; - - ofs2 = ps->input_offset2 - 4; - if (ofs2 < ofs1 + 4) - ofs2 = ofs1 + 4; - - ofs = G_UNLIKELY(buf_size < ofs2 + 4) ? -1 : - scan_for_start_code(&buf[ofs2], buf_size - ofs2, &type2); - if (ofs < 0) { - // Assume the whole packet is present if end-of-stream - if (!at_eos) { - ps->input_offset2 = buf_size; - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - } - ofs = buf_size - ofs2; - } - ofs2 += ofs; + GstVaapiDecoderMpeg2 *const decoder = + GST_VAAPI_DECODER_MPEG2_CAST (base_decoder); + GstVaapiParserState *const ps = GST_VAAPI_PARSER_STATE (base_decoder); + GstVaapiDecoderStatus status; + GstMpegVideoPacketTypeCode type, type2 = GST_MPEG_VIDEO_PACKET_NONE; + const guchar *buf; + guint buf_size, flags; + gint ofs, ofs1, ofs2; + + status = ensure_decoder (decoder); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; - unit->size = ofs2 - ofs1; - gst_adapter_flush(adapter, ofs1); - ps->input_offset2 = 4; - - /* Check for start of new picture */ - flags = 0; - switch (type) { + buf_size = gst_adapter_available (adapter); + if (buf_size < 4) + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + + buf = gst_adapter_map (adapter, buf_size); + if (!buf) + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + + ofs = scan_for_start_code (buf, buf_size, &type); + if (ofs < 0) + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + ofs1 = ofs; + + ofs2 = ps->input_offset2 - 4; + if (ofs2 < ofs1 + 4) + ofs2 = ofs1 + 4; + + ofs = G_UNLIKELY (buf_size < ofs2 + 4) ? -1 : + scan_for_start_code (&buf[ofs2], buf_size - ofs2, &type2); + if (ofs < 0) { + // Assume the whole packet is present if end-of-stream + if (!at_eos) { + ps->input_offset2 = buf_size; + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + } + ofs = buf_size - ofs2; + } + ofs2 += ofs; + + unit->size = ofs2 - ofs1; + gst_adapter_flush (adapter, ofs1); + ps->input_offset2 = 4; + + /* Check for start of new picture */ + flags = 0; + switch (type) { case GST_MPEG_VIDEO_PACKET_SEQUENCE_END: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_END; - flags |= GST_VAAPI_DECODER_UNIT_FLAG_STREAM_END; - break; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_END; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_STREAM_END; + break; case GST_MPEG_VIDEO_PACKET_USER_DATA: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP; - /* fall-through */ + flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP; + /* fall-through */ case GST_MPEG_VIDEO_PACKET_SEQUENCE: case GST_MPEG_VIDEO_PACKET_GOP: case GST_MPEG_VIDEO_PACKET_PICTURE: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; - break; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; + break; case GST_MPEG_VIDEO_PACKET_EXTENSION: - if (G_UNLIKELY(unit->size < 5)) - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - break; + if (G_UNLIKELY (unit->size < 5)) + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + break; default: - if (type >= GST_MPEG_VIDEO_PACKET_SLICE_MIN && - type <= GST_MPEG_VIDEO_PACKET_SLICE_MAX) { - flags |= GST_VAAPI_DECODER_UNIT_FLAG_SLICE; - switch (type2) { - case GST_MPEG_VIDEO_PACKET_USER_DATA: - case GST_MPEG_VIDEO_PACKET_SEQUENCE: - case GST_MPEG_VIDEO_PACKET_GOP: - case GST_MPEG_VIDEO_PACKET_PICTURE: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_END; - break; - default: - break; - } + if (type >= GST_MPEG_VIDEO_PACKET_SLICE_MIN && + type <= GST_MPEG_VIDEO_PACKET_SLICE_MAX) { + flags |= GST_VAAPI_DECODER_UNIT_FLAG_SLICE; + switch (type2) { + case GST_MPEG_VIDEO_PACKET_USER_DATA: + case GST_MPEG_VIDEO_PACKET_SEQUENCE: + case GST_MPEG_VIDEO_PACKET_GOP: + case GST_MPEG_VIDEO_PACKET_PICTURE: + flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_END; + break; + default: + break; } - - // Ignore system start codes (PES headers) - else if (type >= 0xb9 && type <= 0xff) - flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP; - break; - } - GST_VAAPI_DECODER_UNIT_FLAG_SET(unit, flags); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + } + // Ignore system start codes (PES headers) + else if (type >= 0xb9 && type <= 0xff) + flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP; + break; + } + GST_VAAPI_DECODER_UNIT_FLAG_SET (unit, flags); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -gst_vaapi_decoder_mpeg2_decode(GstVaapiDecoder *base_decoder, - GstVaapiDecoderUnit *unit) -{ - GstVaapiDecoderMpeg2 * const decoder = - GST_VAAPI_DECODER_MPEG2_CAST(base_decoder); - GstVaapiDecoderStatus status; - GstMpegVideoPacket packet; - GstBuffer * const buffer = - GST_VAAPI_DECODER_CODEC_FRAME(decoder)->input_buffer; - GstMapInfo map_info; - - status = ensure_decoder(decoder); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - - if (!gst_buffer_map(buffer, &map_info, GST_MAP_READ)) { - GST_ERROR("failed to map buffer"); - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - } +gst_vaapi_decoder_mpeg2_decode (GstVaapiDecoder * base_decoder, + GstVaapiDecoderUnit * unit) +{ + GstVaapiDecoderMpeg2 *const decoder = + GST_VAAPI_DECODER_MPEG2_CAST (base_decoder); + GstVaapiDecoderStatus status; + GstMpegVideoPacket packet; + GstBuffer *const buffer = + GST_VAAPI_DECODER_CODEC_FRAME (decoder)->input_buffer; + GstMapInfo map_info; - packet.data = map_info.data + unit->offset; - packet.size = unit->size; - packet.type = packet.data[3]; - packet.offset = 4; - - status = parse_unit(decoder, unit, &packet); - gst_buffer_unmap(buffer, &map_info); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - return decode_unit(decoder, unit, &packet); -} + status = ensure_decoder (decoder); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; -static GstVaapiDecoderStatus -gst_vaapi_decoder_mpeg2_start_frame(GstVaapiDecoder *base_decoder, - GstVaapiDecoderUnit *base_unit) -{ - GstVaapiDecoderMpeg2 * const decoder = - GST_VAAPI_DECODER_MPEG2_CAST(base_decoder); - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; - GstMpegVideoSequenceHdr *seq_hdr; - GstMpegVideoSequenceExt *seq_ext; - GstMpegVideoSequenceDisplayExt *seq_display_ext; - GstVaapiPicture *picture; - GstVaapiDecoderStatus status; - - if (!is_valid_state(decoder, GST_MPEG_VIDEO_STATE_VALID_PIC_HEADERS)) - return GST_VAAPI_DECODER_STATUS_SUCCESS; - priv->state &= ~GST_MPEG_VIDEO_STATE_VALID_PIC_HEADERS; - - seq_hdr = &priv->seq_hdr->data.seq_hdr; - seq_ext = priv->seq_ext ? &priv->seq_ext->data.seq_ext : NULL; - seq_display_ext = priv->seq_display_ext ? - &priv->seq_display_ext->data.seq_display_ext : NULL; - if (gst_mpeg_video_finalise_mpeg2_sequence_header(seq_hdr, seq_ext, - seq_display_ext)) - gst_vaapi_decoder_set_pixel_aspect_ratio(base_decoder, - seq_hdr->par_w, seq_hdr->par_h); - - status = ensure_context(decoder); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) { - GST_ERROR("failed to reset context"); - return status; - } + if (!gst_buffer_map (buffer, &map_info, GST_MAP_READ)) { + GST_ERROR ("failed to map buffer"); + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + } - if (priv->current_picture) { - /* Re-use current picture where the first field was decoded */ - picture = gst_vaapi_picture_new_field(priv->current_picture); - if (!picture) { - GST_ERROR("failed to allocate field picture"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } - } - else { - /* Create new picture */ - picture = GST_VAAPI_PICTURE_NEW(MPEG2, decoder); - if (!picture) { - GST_ERROR("failed to allocate picture"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } - } - gst_vaapi_picture_replace(&priv->current_picture, picture); - gst_vaapi_picture_unref(picture); + packet.data = map_info.data + unit->offset; + packet.size = unit->size; + packet.type = packet.data[3]; + packet.offset = 4; + + status = parse_unit (decoder, unit, &packet); + gst_buffer_unmap (buffer, &map_info); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; + return decode_unit (decoder, unit, &packet); +} - /* Update cropping rectangle */ - /* XXX: handle picture_display_extension() */ - if (seq_display_ext && priv->pic_display_ext) { - GstVaapiRectangle * const crop_rect = &priv->crop_rect; - if (crop_rect->x + crop_rect->width <= priv->width && - crop_rect->y + crop_rect->height <= priv->height) - gst_vaapi_picture_set_crop_rect(picture, crop_rect); - } +static GstVaapiDecoderStatus +gst_vaapi_decoder_mpeg2_start_frame (GstVaapiDecoder * base_decoder, + GstVaapiDecoderUnit * base_unit) +{ + GstVaapiDecoderMpeg2 *const decoder = + GST_VAAPI_DECODER_MPEG2_CAST (base_decoder); + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; + GstMpegVideoSequenceHdr *seq_hdr; + GstMpegVideoSequenceExt *seq_ext; + GstMpegVideoSequenceDisplayExt *seq_display_ext; + GstVaapiPicture *picture; + GstVaapiDecoderStatus status; + + if (!is_valid_state (decoder, GST_MPEG_VIDEO_STATE_VALID_PIC_HEADERS)) + return GST_VAAPI_DECODER_STATUS_SUCCESS; + priv->state &= ~GST_MPEG_VIDEO_STATE_VALID_PIC_HEADERS; + + seq_hdr = &priv->seq_hdr->data.seq_hdr; + seq_ext = priv->seq_ext ? &priv->seq_ext->data.seq_ext : NULL; + seq_display_ext = priv->seq_display_ext ? + &priv->seq_display_ext->data.seq_display_ext : NULL; + if (gst_mpeg_video_finalise_mpeg2_sequence_header (seq_hdr, seq_ext, + seq_display_ext)) + gst_vaapi_decoder_set_pixel_aspect_ratio (base_decoder, + seq_hdr->par_w, seq_hdr->par_h); + + status = ensure_context (decoder); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) { + GST_ERROR ("failed to reset context"); + return status; + } - status = ensure_quant_matrix(decoder, picture); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) { - GST_ERROR("failed to reset quantizer matrix"); - return status; - } + if (priv->current_picture) { + /* Re-use current picture where the first field was decoded */ + picture = gst_vaapi_picture_new_field (priv->current_picture); + if (!picture) { + GST_ERROR ("failed to allocate field picture"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } + } else { + /* Create new picture */ + picture = GST_VAAPI_PICTURE_NEW (MPEG2, decoder); + if (!picture) { + GST_ERROR ("failed to allocate picture"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } + } + gst_vaapi_picture_replace (&priv->current_picture, picture); + gst_vaapi_picture_unref (picture); + + /* Update cropping rectangle */ + /* XXX: handle picture_display_extension() */ + if (seq_display_ext && priv->pic_display_ext) { + GstVaapiRectangle *const crop_rect = &priv->crop_rect; + if (crop_rect->x + crop_rect->width <= priv->width && + crop_rect->y + crop_rect->height <= priv->height) + gst_vaapi_picture_set_crop_rect (picture, crop_rect); + } + + status = ensure_quant_matrix (decoder, picture); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) { + GST_ERROR ("failed to reset quantizer matrix"); + return status; + } - status = init_picture(decoder, picture); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; + status = init_picture (decoder, picture); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; - fill_picture(decoder, picture); + fill_picture (decoder, picture); - priv->state |= GST_MPEG_VIDEO_STATE_VALID_PIC_HEADERS; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + priv->state |= GST_MPEG_VIDEO_STATE_VALID_PIC_HEADERS; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -gst_vaapi_decoder_mpeg2_end_frame(GstVaapiDecoder *base_decoder) +gst_vaapi_decoder_mpeg2_end_frame (GstVaapiDecoder * base_decoder) { - GstVaapiDecoderMpeg2 * const decoder = - GST_VAAPI_DECODER_MPEG2_CAST(base_decoder); + GstVaapiDecoderMpeg2 *const decoder = + GST_VAAPI_DECODER_MPEG2_CAST (base_decoder); - return decode_current_picture(decoder); + return decode_current_picture (decoder); } static GstVaapiDecoderStatus -gst_vaapi_decoder_mpeg2_flush(GstVaapiDecoder *base_decoder) +gst_vaapi_decoder_mpeg2_flush (GstVaapiDecoder * base_decoder) { - GstVaapiDecoderMpeg2 * const decoder = - GST_VAAPI_DECODER_MPEG2_CAST(base_decoder); - GstVaapiDecoderMpeg2Private * const priv = &decoder->priv; + GstVaapiDecoderMpeg2 *const decoder = + GST_VAAPI_DECODER_MPEG2_CAST (base_decoder); + GstVaapiDecoderMpeg2Private *const priv = &decoder->priv; - if (priv->dpb) - gst_vaapi_dpb_flush(priv->dpb); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + if (priv->dpb) + gst_vaapi_dpb_flush (priv->dpb); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static void -gst_vaapi_decoder_mpeg2_class_init(GstVaapiDecoderMpeg2Class *klass) +gst_vaapi_decoder_mpeg2_class_init (GstVaapiDecoderMpeg2Class * klass) { - GstVaapiMiniObjectClass * const object_class = - GST_VAAPI_MINI_OBJECT_CLASS(klass); - GstVaapiDecoderClass * const decoder_class = GST_VAAPI_DECODER_CLASS(klass); - - object_class->size = sizeof(GstVaapiDecoderMpeg2); - object_class->finalize = (GDestroyNotify)gst_vaapi_decoder_finalize; - - decoder_class->create = gst_vaapi_decoder_mpeg2_create; - decoder_class->destroy = gst_vaapi_decoder_mpeg2_destroy; - decoder_class->parse = gst_vaapi_decoder_mpeg2_parse; - decoder_class->decode = gst_vaapi_decoder_mpeg2_decode; - decoder_class->start_frame = gst_vaapi_decoder_mpeg2_start_frame; - decoder_class->end_frame = gst_vaapi_decoder_mpeg2_end_frame; - decoder_class->flush = gst_vaapi_decoder_mpeg2_flush; + GstVaapiMiniObjectClass *const object_class = + GST_VAAPI_MINI_OBJECT_CLASS (klass); + GstVaapiDecoderClass *const decoder_class = GST_VAAPI_DECODER_CLASS (klass); + + object_class->size = sizeof (GstVaapiDecoderMpeg2); + object_class->finalize = (GDestroyNotify) gst_vaapi_decoder_finalize; + + decoder_class->create = gst_vaapi_decoder_mpeg2_create; + decoder_class->destroy = gst_vaapi_decoder_mpeg2_destroy; + decoder_class->parse = gst_vaapi_decoder_mpeg2_parse; + decoder_class->decode = gst_vaapi_decoder_mpeg2_decode; + decoder_class->start_frame = gst_vaapi_decoder_mpeg2_start_frame; + decoder_class->end_frame = gst_vaapi_decoder_mpeg2_end_frame; + decoder_class->flush = gst_vaapi_decoder_mpeg2_flush; } static inline const GstVaapiDecoderClass * -gst_vaapi_decoder_mpeg2_class(void) +gst_vaapi_decoder_mpeg2_class (void) { - static GstVaapiDecoderMpeg2Class g_class; - static gsize g_class_init = FALSE; + static GstVaapiDecoderMpeg2Class g_class; + static gsize g_class_init = FALSE; - if (g_once_init_enter(&g_class_init)) { - gst_vaapi_decoder_mpeg2_class_init(&g_class); - g_once_init_leave(&g_class_init, TRUE); - } - return GST_VAAPI_DECODER_CLASS(&g_class); + if (g_once_init_enter (&g_class_init)) { + gst_vaapi_decoder_mpeg2_class_init (&g_class); + g_once_init_leave (&g_class_init, TRUE); + } + return GST_VAAPI_DECODER_CLASS (&g_class); } /** @@ -1596,8 +1600,8 @@ * Return value: the newly allocated #GstVaapiDecoder object */ GstVaapiDecoder * -gst_vaapi_decoder_mpeg2_new(GstVaapiDisplay *display, GstCaps *caps) +gst_vaapi_decoder_mpeg2_new (GstVaapiDisplay * display, GstCaps * caps) { - return gst_vaapi_decoder_new(gst_vaapi_decoder_mpeg2_class(), - display, caps); + return gst_vaapi_decoder_new (gst_vaapi_decoder_mpeg2_class (), + display, caps); } diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c 2016-03-24 11:36:59.000000000 +0000 @@ -41,58 +41,59 @@ #define GST_VAAPI_DECODER_MPEG4_CAST(decoder) \ ((GstVaapiDecoderMpeg4 *)(decoder)) -typedef struct _GstVaapiDecoderMpeg4Private GstVaapiDecoderMpeg4Private; -typedef struct _GstVaapiDecoderMpeg4Class GstVaapiDecoderMpeg4Class; +typedef struct _GstVaapiDecoderMpeg4Private GstVaapiDecoderMpeg4Private; +typedef struct _GstVaapiDecoderMpeg4Class GstVaapiDecoderMpeg4Class; -struct _GstVaapiDecoderMpeg4Private { - GstVaapiProfile profile; - guint level; - guint width; - guint height; - guint fps_n; - guint fps_d; - guint coding_type; - GstMpeg4VisualObjectSequence vos_hdr; - GstMpeg4VisualObject vo_hdr; - GstMpeg4VideoSignalType signal_type; - GstMpeg4VideoObjectLayer vol_hdr; - GstMpeg4VideoObjectPlane vop_hdr; - GstMpeg4VideoPlaneShortHdr svh_hdr; - GstMpeg4VideoPacketHdr packet_hdr; - GstMpeg4SpriteTrajectory sprite_trajectory; - VAIQMatrixBufferMPEG4 iq_matrix; - GstVaapiPicture *curr_picture; - // forward reference pic - GstVaapiPicture *next_picture; - // backward reference pic - GstVaapiPicture *prev_picture; - GstClockTime seq_pts; - GstClockTime gop_pts; - GstClockTime pts_diff; - GstClockTime max_pts; - // anchor sync time base for any picture type, - // it is time base of backward reference frame - GstClockTime last_sync_time; - // time base for recent I/P/S frame, - // it is time base of forward reference frame for B frame - GstClockTime sync_time; - - /* last non-b-frame time by resolution */ - GstClockTime last_non_b_scale_time; - GstClockTime non_b_scale_time; - GstClockTime trb; - GstClockTime trd; - // temporal_reference of previous frame of svh - guint8 prev_t_ref; - guint is_opened : 1; - guint is_first_field : 1; - guint size_changed : 1; - guint profile_changed : 1; - guint progressive_sequence : 1; - guint closed_gop : 1; - guint broken_link : 1; - guint calculate_pts_diff : 1; - guint is_svh : 1; +struct _GstVaapiDecoderMpeg4Private +{ + GstVaapiProfile profile; + guint level; + guint width; + guint height; + guint fps_n; + guint fps_d; + guint coding_type; + GstMpeg4VisualObjectSequence vos_hdr; + GstMpeg4VisualObject vo_hdr; + GstMpeg4VideoSignalType signal_type; + GstMpeg4VideoObjectLayer vol_hdr; + GstMpeg4VideoObjectPlane vop_hdr; + GstMpeg4VideoPlaneShortHdr svh_hdr; + GstMpeg4VideoPacketHdr packet_hdr; + GstMpeg4SpriteTrajectory sprite_trajectory; + VAIQMatrixBufferMPEG4 iq_matrix; + GstVaapiPicture *curr_picture; + // forward reference pic + GstVaapiPicture *next_picture; + // backward reference pic + GstVaapiPicture *prev_picture; + GstClockTime seq_pts; + GstClockTime gop_pts; + GstClockTime pts_diff; + GstClockTime max_pts; + // anchor sync time base for any picture type, + // it is time base of backward reference frame + GstClockTime last_sync_time; + // time base for recent I/P/S frame, + // it is time base of forward reference frame for B frame + GstClockTime sync_time; + + /* last non-b-frame time by resolution */ + GstClockTime last_non_b_scale_time; + GstClockTime non_b_scale_time; + GstClockTime trb; + GstClockTime trd; + // temporal_reference of previous frame of svh + guint8 prev_t_ref; + guint is_opened:1; + guint is_first_field:1; + guint size_changed:1; + guint profile_changed:1; + guint progressive_sequence:1; + guint closed_gop:1; + guint broken_link:1; + guint calculate_pts_diff:1; + guint is_svh:1; }; /** @@ -100,10 +101,11 @@ * * A decoder based on Mpeg4. */ -struct _GstVaapiDecoderMpeg4 { - /*< private >*/ - GstVaapiDecoder parent_instance; - GstVaapiDecoderMpeg4Private priv; +struct _GstVaapiDecoderMpeg4 +{ + /*< private > */ + GstVaapiDecoder parent_instance; + GstVaapiDecoderMpeg4Private priv; }; /** @@ -111,943 +113,966 @@ * * A decoder class based on Mpeg4. */ -struct _GstVaapiDecoderMpeg4Class { - /*< private >*/ - GstVaapiDecoderClass parent_class; +struct _GstVaapiDecoderMpeg4Class +{ + /*< private > */ + GstVaapiDecoderClass parent_class; }; static void -gst_vaapi_decoder_mpeg4_close(GstVaapiDecoderMpeg4 *decoder) +gst_vaapi_decoder_mpeg4_close (GstVaapiDecoderMpeg4 * decoder) { - GstVaapiDecoderMpeg4Private * const priv = &decoder->priv; + GstVaapiDecoderMpeg4Private *const priv = &decoder->priv; - gst_vaapi_picture_replace(&priv->curr_picture, NULL); - gst_vaapi_picture_replace(&priv->next_picture, NULL); - gst_vaapi_picture_replace(&priv->prev_picture, NULL); + gst_vaapi_picture_replace (&priv->curr_picture, NULL); + gst_vaapi_picture_replace (&priv->next_picture, NULL); + gst_vaapi_picture_replace (&priv->prev_picture, NULL); } static gboolean -gst_vaapi_decoder_mpeg4_open(GstVaapiDecoderMpeg4 *decoder) +gst_vaapi_decoder_mpeg4_open (GstVaapiDecoderMpeg4 * decoder) { - GstVaapiDecoder *const base_decoder = GST_VAAPI_DECODER(decoder); - GstVaapiDecoderMpeg4Private * const priv = &decoder->priv; - GstCaps *caps = NULL; - GstStructure *structure = NULL; - - gst_vaapi_decoder_mpeg4_close(decoder); - - priv->is_svh = 0; - caps = gst_vaapi_decoder_get_caps(base_decoder); - if (caps) { - structure = gst_caps_get_structure(caps, 0); - if (structure) { - if (gst_structure_has_name(structure, "video/x-h263")) { - priv->is_svh = 1; - priv->profile = GST_VAAPI_PROFILE_MPEG4_SIMPLE; - priv->prev_t_ref = -1; - } - } + GstVaapiDecoder *const base_decoder = GST_VAAPI_DECODER (decoder); + GstVaapiDecoderMpeg4Private *const priv = &decoder->priv; + GstCaps *caps = NULL; + GstStructure *structure = NULL; + + gst_vaapi_decoder_mpeg4_close (decoder); + + priv->is_svh = 0; + caps = gst_vaapi_decoder_get_caps (base_decoder); + if (caps) { + structure = gst_caps_get_structure (caps, 0); + if (structure) { + if (gst_structure_has_name (structure, "video/x-h263")) { + priv->is_svh = 1; + priv->profile = GST_VAAPI_PROFILE_MPEG4_SIMPLE; + priv->prev_t_ref = -1; + } } - return TRUE; + } + return TRUE; } static void -gst_vaapi_decoder_mpeg4_destroy(GstVaapiDecoder *base_decoder) +gst_vaapi_decoder_mpeg4_destroy (GstVaapiDecoder * base_decoder) { - GstVaapiDecoderMpeg4 * const decoder = - GST_VAAPI_DECODER_MPEG4_CAST(base_decoder); + GstVaapiDecoderMpeg4 *const decoder = + GST_VAAPI_DECODER_MPEG4_CAST (base_decoder); - gst_vaapi_decoder_mpeg4_close(decoder); + gst_vaapi_decoder_mpeg4_close (decoder); } static gboolean -gst_vaapi_decoder_mpeg4_create(GstVaapiDecoder *base_decoder) +gst_vaapi_decoder_mpeg4_create (GstVaapiDecoder * base_decoder) { - GstVaapiDecoderMpeg4 * const decoder = - GST_VAAPI_DECODER_MPEG4_CAST(base_decoder); - GstVaapiDecoderMpeg4Private * const priv = &decoder->priv; - - priv->profile = GST_VAAPI_PROFILE_MPEG4_SIMPLE; - priv->seq_pts = GST_CLOCK_TIME_NONE; - priv->gop_pts = GST_CLOCK_TIME_NONE; - priv->max_pts = GST_CLOCK_TIME_NONE; - priv->calculate_pts_diff = TRUE; - priv->size_changed = TRUE; - priv->profile_changed = TRUE; - return TRUE; + GstVaapiDecoderMpeg4 *const decoder = + GST_VAAPI_DECODER_MPEG4_CAST (base_decoder); + GstVaapiDecoderMpeg4Private *const priv = &decoder->priv; + + priv->profile = GST_VAAPI_PROFILE_MPEG4_SIMPLE; + priv->seq_pts = GST_CLOCK_TIME_NONE; + priv->gop_pts = GST_CLOCK_TIME_NONE; + priv->max_pts = GST_CLOCK_TIME_NONE; + priv->calculate_pts_diff = TRUE; + priv->size_changed = TRUE; + priv->profile_changed = TRUE; + return TRUE; } static inline void -copy_quant_matrix(guint8 dst[64], const guint8 src[64]) +copy_quant_matrix (guint8 dst[64], const guint8 src[64]) { - memcpy(dst, src, 64); + memcpy (dst, src, 64); } static GstVaapiDecoderStatus -ensure_context(GstVaapiDecoderMpeg4 *decoder) +ensure_context (GstVaapiDecoderMpeg4 * decoder) { - GstVaapiDecoderMpeg4Private * const priv = &decoder->priv; - GstVaapiProfile profiles[2]; - GstVaapiEntrypoint entrypoint = GST_VAAPI_ENTRYPOINT_VLD; - guint i, n_profiles = 0; - gboolean reset_context = FALSE; - - if (priv->profile_changed) { - GST_DEBUG("profile changed"); - priv->profile_changed = FALSE; - reset_context = TRUE; - - profiles[n_profiles++] = priv->profile; - if (priv->profile == GST_VAAPI_PROFILE_MPEG4_SIMPLE) - profiles[n_profiles++] = GST_VAAPI_PROFILE_MPEG4_ADVANCED_SIMPLE; - - for (i = 0; i < n_profiles; i++) { - if (gst_vaapi_display_has_decoder(GST_VAAPI_DECODER_DISPLAY(decoder), - profiles[i], entrypoint)) - break; - } - if (i == n_profiles) - return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; - priv->profile = profiles[i]; - } - - if (priv->size_changed) { - GST_DEBUG("size changed"); - priv->size_changed = FALSE; - reset_context = TRUE; - } - - if (reset_context) { - GstVaapiContextInfo info; - - info.profile = priv->profile; - info.entrypoint = entrypoint; - info.chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420; - info.width = priv->width; - info.height = priv->height; - info.ref_frames = 2; - reset_context = gst_vaapi_decoder_ensure_context( - GST_VAAPI_DECODER(decoder), - &info - ); - if (!reset_context) - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + GstVaapiDecoderMpeg4Private *const priv = &decoder->priv; + GstVaapiProfile profiles[2]; + GstVaapiEntrypoint entrypoint = GST_VAAPI_ENTRYPOINT_VLD; + guint i, n_profiles = 0; + gboolean reset_context = FALSE; + + if (priv->profile_changed) { + GST_DEBUG ("profile changed"); + priv->profile_changed = FALSE; + reset_context = TRUE; + + profiles[n_profiles++] = priv->profile; + if (priv->profile == GST_VAAPI_PROFILE_MPEG4_SIMPLE) + profiles[n_profiles++] = GST_VAAPI_PROFILE_MPEG4_ADVANCED_SIMPLE; + + for (i = 0; i < n_profiles; i++) { + if (gst_vaapi_display_has_decoder (GST_VAAPI_DECODER_DISPLAY (decoder), + profiles[i], entrypoint)) + break; } - return GST_VAAPI_DECODER_STATUS_SUCCESS; + if (i == n_profiles) + return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; + priv->profile = profiles[i]; + } + + if (priv->size_changed) { + GST_DEBUG ("size changed"); + priv->size_changed = FALSE; + reset_context = TRUE; + } + + if (reset_context) { + GstVaapiContextInfo info; + + info.profile = priv->profile; + info.entrypoint = entrypoint; + info.chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420; + info.width = priv->width; + info.height = priv->height; + info.ref_frames = 2; + reset_context = + gst_vaapi_decoder_ensure_context (GST_VAAPI_DECODER (decoder), &info); + if (!reset_context) + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + } + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -ensure_quant_matrix(GstVaapiDecoderMpeg4 *decoder, GstVaapiPicture *picture) +ensure_quant_matrix (GstVaapiDecoderMpeg4 * decoder, GstVaapiPicture * picture) { - GstVaapiDecoderMpeg4Private * const priv = &decoder->priv; - VAIQMatrixBufferMPEG4 *iq_matrix; + GstVaapiDecoderMpeg4Private *const priv = &decoder->priv; + VAIQMatrixBufferMPEG4 *iq_matrix; - if (!priv->vol_hdr.load_intra_quant_mat && !priv->vol_hdr.load_non_intra_quant_mat) { - return GST_VAAPI_DECODER_STATUS_SUCCESS; - } - - picture->iq_matrix = GST_VAAPI_IQ_MATRIX_NEW(MPEG4, decoder); - if (!picture->iq_matrix) { - GST_DEBUG("failed to allocate IQ matrix"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } - iq_matrix = picture->iq_matrix->param; + if (!priv->vol_hdr.load_intra_quant_mat + && !priv->vol_hdr.load_non_intra_quant_mat) { + return GST_VAAPI_DECODER_STATUS_SUCCESS; + } - if (priv->vol_hdr.load_intra_quant_mat) { - iq_matrix->load_intra_quant_mat = 1; - copy_quant_matrix(iq_matrix->intra_quant_mat, - priv->vol_hdr.intra_quant_mat); - } - else - iq_matrix->load_intra_quant_mat = 0; + picture->iq_matrix = GST_VAAPI_IQ_MATRIX_NEW (MPEG4, decoder); + if (!picture->iq_matrix) { + GST_DEBUG ("failed to allocate IQ matrix"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } + iq_matrix = picture->iq_matrix->param; + + if (priv->vol_hdr.load_intra_quant_mat) { + iq_matrix->load_intra_quant_mat = 1; + copy_quant_matrix (iq_matrix->intra_quant_mat, + priv->vol_hdr.intra_quant_mat); + } else + iq_matrix->load_intra_quant_mat = 0; + + if (priv->vol_hdr.load_non_intra_quant_mat) { + iq_matrix->load_non_intra_quant_mat = 1; + copy_quant_matrix (iq_matrix->non_intra_quant_mat, + priv->vol_hdr.non_intra_quant_mat); + } else + iq_matrix->load_non_intra_quant_mat = 0; - if (priv->vol_hdr.load_non_intra_quant_mat) { - iq_matrix->load_non_intra_quant_mat = 1; - copy_quant_matrix(iq_matrix->non_intra_quant_mat, - priv->vol_hdr.non_intra_quant_mat); - } - else - iq_matrix->load_non_intra_quant_mat = 0; - - return GST_VAAPI_DECODER_STATUS_SUCCESS; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static inline GstVaapiDecoderStatus -render_picture(GstVaapiDecoderMpeg4 *decoder, GstVaapiPicture *picture) +render_picture (GstVaapiDecoderMpeg4 * decoder, GstVaapiPicture * picture) { - if (!gst_vaapi_picture_output(picture)) - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + if (!gst_vaapi_picture_output (picture)) + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } /* decode_picture() start to decode a frame/picture - * decode_current_picture() finishe decoding a frame/picture + * decode_current_picture() finishe decoding a frame/picture * (commit buffer to driver for decoding) */ static GstVaapiDecoderStatus -decode_current_picture(GstVaapiDecoderMpeg4 *decoder) +decode_current_picture (GstVaapiDecoderMpeg4 * decoder) { - GstVaapiDecoderMpeg4Private * const priv = &decoder->priv; - GstVaapiPicture * const picture = priv->curr_picture; - GstVaapiDecoderStatus status = GST_VAAPI_DECODER_STATUS_SUCCESS; - - if (picture) { - if (!gst_vaapi_picture_decode(picture)) - status = GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - if (!GST_VAAPI_PICTURE_IS_REFERENCE(picture)) { - if ((priv->prev_picture && priv->next_picture) || - (priv->closed_gop && priv->next_picture)) - status = render_picture(decoder, picture); - } - gst_vaapi_picture_replace(&priv->curr_picture, NULL); - } - return status; + GstVaapiDecoderMpeg4Private *const priv = &decoder->priv; + GstVaapiPicture *const picture = priv->curr_picture; + GstVaapiDecoderStatus status = GST_VAAPI_DECODER_STATUS_SUCCESS; + + if (picture) { + if (!gst_vaapi_picture_decode (picture)) + status = GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + if (!GST_VAAPI_PICTURE_IS_REFERENCE (picture)) { + if ((priv->prev_picture && priv->next_picture) || + (priv->closed_gop && priv->next_picture)) + status = render_picture (decoder, picture); + } + gst_vaapi_picture_replace (&priv->curr_picture, NULL); + } + return status; } static GstVaapiDecoderStatus -decode_sequence(GstVaapiDecoderMpeg4 *decoder, const guint8 *buf, guint buf_size) +decode_sequence (GstVaapiDecoderMpeg4 * decoder, const guint8 * buf, + guint buf_size) { - GstVaapiDecoderMpeg4Private * const priv = &decoder->priv; - GstMpeg4VisualObjectSequence * const vos_hdr = &priv->vos_hdr; - GstVaapiProfile profile; - - if (gst_mpeg4_parse_visual_object_sequence(vos_hdr, buf, buf_size) != GST_MPEG4_PARSER_OK) { - GST_DEBUG("failed to parse sequence header"); - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - } + GstVaapiDecoderMpeg4Private *const priv = &decoder->priv; + GstMpeg4VisualObjectSequence *const vos_hdr = &priv->vos_hdr; + GstVaapiProfile profile; + + if (gst_mpeg4_parse_visual_object_sequence (vos_hdr, buf, + buf_size) != GST_MPEG4_PARSER_OK) { + GST_DEBUG ("failed to parse sequence header"); + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + } - priv->level = vos_hdr->level; - switch (vos_hdr->profile) { + priv->level = vos_hdr->level; + switch (vos_hdr->profile) { case GST_MPEG4_PROFILE_SIMPLE: - profile = GST_VAAPI_PROFILE_MPEG4_SIMPLE; - break; + profile = GST_VAAPI_PROFILE_MPEG4_SIMPLE; + break; case GST_MPEG4_PROFILE_ADVANCED_SIMPLE: - case GST_MPEG4_PROFILE_SIMPLE_SCALABLE: /* shared profile with ADVANCED_SIMPLE */ - profile = GST_VAAPI_PROFILE_MPEG4_ADVANCED_SIMPLE; - break; + case GST_MPEG4_PROFILE_SIMPLE_SCALABLE: /* shared profile with ADVANCED_SIMPLE */ + profile = GST_VAAPI_PROFILE_MPEG4_ADVANCED_SIMPLE; + break; default: - GST_DEBUG("unsupported profile %d", vos_hdr->profile); - return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; - } - if (priv->profile != profile) { - priv->profile = profile; - priv->profile_changed = TRUE; - } - priv->seq_pts = GST_VAAPI_DECODER_CODEC_FRAME(decoder)->pts; - priv->size_changed = TRUE; + GST_DEBUG ("unsupported profile %d", vos_hdr->profile); + return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; + } + if (priv->profile != profile) { + priv->profile = profile; + priv->profile_changed = TRUE; + } + priv->seq_pts = GST_VAAPI_DECODER_CODEC_FRAME (decoder)->pts; + priv->size_changed = TRUE; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_sequence_end(GstVaapiDecoderMpeg4 *decoder) +decode_sequence_end (GstVaapiDecoderMpeg4 * decoder) { - GstVaapiDecoderMpeg4Private * const priv = &decoder->priv; - GstVaapiDecoderStatus status; + GstVaapiDecoderMpeg4Private *const priv = &decoder->priv; + GstVaapiDecoderStatus status; - if (priv->curr_picture) { - status = decode_current_picture(decoder); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - status = render_picture(decoder, priv->curr_picture); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - } + if (priv->curr_picture) { + status = decode_current_picture (decoder); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; + status = render_picture (decoder, priv->curr_picture); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; + } - if (priv->next_picture) { - status = render_picture(decoder, priv->next_picture); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - } - return GST_VAAPI_DECODER_STATUS_END_OF_STREAM; + if (priv->next_picture) { + status = render_picture (decoder, priv->next_picture); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; + } + return GST_VAAPI_DECODER_STATUS_END_OF_STREAM; } static GstVaapiDecoderStatus -decode_visual_object(GstVaapiDecoderMpeg4 *decoder, const guint8 *buf, guint buf_size) +decode_visual_object (GstVaapiDecoderMpeg4 * decoder, const guint8 * buf, + guint buf_size) { - GstVaapiDecoderMpeg4Private * const priv = &decoder->priv; - GstMpeg4VisualObject * vo_hdr = &priv->vo_hdr; - GstMpeg4VideoSignalType * signal_type = &priv->signal_type; - - if (gst_mpeg4_parse_visual_object (vo_hdr, signal_type, buf, buf_size) != GST_MPEG4_PARSER_OK) { - GST_DEBUG("failed to parse visual object"); - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - } + GstVaapiDecoderMpeg4Private *const priv = &decoder->priv; + GstMpeg4VisualObject *vo_hdr = &priv->vo_hdr; + GstMpeg4VideoSignalType *signal_type = &priv->signal_type; + + if (gst_mpeg4_parse_visual_object (vo_hdr, signal_type, buf, + buf_size) != GST_MPEG4_PARSER_OK) { + GST_DEBUG ("failed to parse visual object"); + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + } - /* XXX: video_signal_type isn't used for decoding */ - return GST_VAAPI_DECODER_STATUS_SUCCESS; + /* XXX: video_signal_type isn't used for decoding */ + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_video_object_layer(GstVaapiDecoderMpeg4 *decoder, const guint8 *buf, guint buf_size) +decode_video_object_layer (GstVaapiDecoderMpeg4 * decoder, const guint8 * buf, + guint buf_size) { - GstVaapiDecoder * const base_decoder = GST_VAAPI_DECODER(decoder); - GstVaapiDecoderMpeg4Private * const priv = &decoder->priv; - GstMpeg4VisualObject * vo_hdr = &priv->vo_hdr; - GstMpeg4VideoObjectLayer * vol_hdr = &priv->vol_hdr; - - if (gst_mpeg4_parse_video_object_layer (vol_hdr, vo_hdr, buf, buf_size) != GST_MPEG4_PARSER_OK) { - GST_DEBUG("failed to parse video object layer"); - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - } + GstVaapiDecoder *const base_decoder = GST_VAAPI_DECODER (decoder); + GstVaapiDecoderMpeg4Private *const priv = &decoder->priv; + GstMpeg4VisualObject *vo_hdr = &priv->vo_hdr; + GstMpeg4VideoObjectLayer *vol_hdr = &priv->vol_hdr; + + if (gst_mpeg4_parse_video_object_layer (vol_hdr, vo_hdr, buf, + buf_size) != GST_MPEG4_PARSER_OK) { + GST_DEBUG ("failed to parse video object layer"); + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + } + + priv->width = vol_hdr->width; + priv->height = vol_hdr->height; + + priv->progressive_sequence = !vol_hdr->interlaced; + + if (vol_hdr->fixed_vop_rate) { + priv->fps_n = vol_hdr->vop_time_increment_resolution; + priv->fps_d = vol_hdr->fixed_vop_time_increment; + gst_vaapi_decoder_set_framerate (base_decoder, priv->fps_n, priv->fps_d); + } + + gst_vaapi_decoder_set_pixel_aspect_ratio (base_decoder, + priv->vol_hdr.par_width, priv->vol_hdr.par_height); + gst_vaapi_decoder_set_picture_size (base_decoder, priv->width, priv->height); - priv->width = vol_hdr->width; - priv->height = vol_hdr->height; - - priv->progressive_sequence = !vol_hdr->interlaced; - - if (vol_hdr->fixed_vop_rate) { - priv->fps_n = vol_hdr->vop_time_increment_resolution; - priv->fps_d = vol_hdr->fixed_vop_time_increment; - gst_vaapi_decoder_set_framerate(base_decoder, priv->fps_n, priv->fps_d); - } - - gst_vaapi_decoder_set_pixel_aspect_ratio(base_decoder, priv->vol_hdr.par_width, priv->vol_hdr.par_height); - gst_vaapi_decoder_set_picture_size(base_decoder, priv->width, priv->height); - - return GST_VAAPI_DECODER_STATUS_SUCCESS; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_gop(GstVaapiDecoderMpeg4 *decoder, const guint8 *buf, guint buf_size) +decode_gop (GstVaapiDecoderMpeg4 * decoder, const guint8 * buf, guint buf_size) { - GstVaapiDecoderMpeg4Private * const priv = &decoder->priv; - GstMpeg4GroupOfVOP gop; - GstClockTime gop_time; - - if (buf_size >4) { - if (gst_mpeg4_parse_group_of_vop(&gop, buf, buf_size) != GST_MPEG4_PARSER_OK) { - GST_DEBUG("failed to parse GOP"); - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - } - } - else { - gop.closed = 1; - gop.broken_link = 0; - gop.hours = 0; - gop.minutes = 0; - gop.seconds = 0; - } - - priv->closed_gop = gop.closed; - priv->broken_link = gop.broken_link; - - GST_DEBUG("GOP %02u:%02u:%02u (closed_gop %d, broken_link %d)", - gop.hours, gop.minutes, gop.seconds, - priv->closed_gop, priv->broken_link); - - gop_time = gop.hours * 3600 + gop.minutes * 60 + gop.seconds; - priv->last_sync_time = gop_time; - priv->sync_time = gop_time; - - if (priv->gop_pts != GST_CLOCK_TIME_NONE) - priv->pts_diff += gop_time * GST_SECOND - priv->gop_pts; - priv->gop_pts = gop_time * GST_SECOND; - priv->calculate_pts_diff = TRUE; - priv->is_first_field = TRUE; + GstVaapiDecoderMpeg4Private *const priv = &decoder->priv; + GstMpeg4GroupOfVOP gop; + GstClockTime gop_time; + + if (buf_size > 4) { + if (gst_mpeg4_parse_group_of_vop (&gop, buf, + buf_size) != GST_MPEG4_PARSER_OK) { + GST_DEBUG ("failed to parse GOP"); + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + } + } else { + gop.closed = 1; + gop.broken_link = 0; + gop.hours = 0; + gop.minutes = 0; + gop.seconds = 0; + } + + priv->closed_gop = gop.closed; + priv->broken_link = gop.broken_link; + + GST_DEBUG ("GOP %02u:%02u:%02u (closed_gop %d, broken_link %d)", + gop.hours, gop.minutes, gop.seconds, priv->closed_gop, priv->broken_link); + + gop_time = gop.hours * 3600 + gop.minutes * 60 + gop.seconds; + priv->last_sync_time = gop_time; + priv->sync_time = gop_time; + + if (priv->gop_pts != GST_CLOCK_TIME_NONE) + priv->pts_diff += gop_time * GST_SECOND - priv->gop_pts; + priv->gop_pts = gop_time * GST_SECOND; + priv->calculate_pts_diff = TRUE; + priv->is_first_field = TRUE; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } -void -calculate_pts_diff(GstVaapiDecoderMpeg4 *decoder, - GstMpeg4VideoObjectLayer *vol_hdr, - GstMpeg4VideoObjectPlane *vop_hdr) -{ - GstVaapiDecoderMpeg4Private * const priv = &decoder->priv; - GstClockTime frame_timestamp; - - frame_timestamp = GST_VAAPI_DECODER_CODEC_FRAME(decoder)->pts; - if (frame_timestamp && frame_timestamp != GST_CLOCK_TIME_NONE) { - /* Buffer with timestamp */ - if (priv->max_pts != GST_CLOCK_TIME_NONE && - frame_timestamp < priv->max_pts) { - frame_timestamp = priv->max_pts + - gst_util_uint64_scale((vol_hdr->fixed_vop_rate ? - vol_hdr->fixed_vop_time_increment : 1), - GST_SECOND, - vol_hdr->vop_time_increment_resolution); - } - } else { - /* Buffer without timestamp set */ - if (priv->max_pts == GST_CLOCK_TIME_NONE) /* first buffer */ - frame_timestamp = 0; - else { - GstClockTime tmp_pts; - tmp_pts = priv->pts_diff + priv->gop_pts + - vop_hdr->modulo_time_base * GST_SECOND + - gst_util_uint64_scale(vop_hdr->time_increment, - GST_SECOND, - vol_hdr->vop_time_increment_resolution); - if (tmp_pts > priv->max_pts) - frame_timestamp = tmp_pts; - else - frame_timestamp = priv->max_pts + - gst_util_uint64_scale((vol_hdr->fixed_vop_rate ? - vol_hdr->fixed_vop_time_increment : 1), - GST_SECOND, - vol_hdr->vop_time_increment_resolution); - } - } - - priv->pts_diff = frame_timestamp - - (priv->gop_pts + vop_hdr->modulo_time_base * GST_SECOND + - gst_util_uint64_scale(vop_hdr->time_increment, GST_SECOND, - vol_hdr->vop_time_increment_resolution)); -} - -static GstVaapiDecoderStatus -decode_picture(GstVaapiDecoderMpeg4 *decoder, const guint8 *buf, guint buf_size) +static void +calculate_pts_diff (GstVaapiDecoderMpeg4 * decoder, + GstMpeg4VideoObjectLayer * vol_hdr, GstMpeg4VideoObjectPlane * vop_hdr) { - GstMpeg4ParseResult parser_result = GST_MPEG4_PARSER_OK; - GstVaapiDecoderMpeg4Private * const priv = &decoder->priv; - GstMpeg4VideoObjectPlane * const vop_hdr = &priv->vop_hdr; - GstMpeg4VideoObjectLayer * const vol_hdr = &priv->vol_hdr; - GstMpeg4SpriteTrajectory * const sprite_trajectory = &priv->sprite_trajectory; - GstVaapiPicture *picture; - GstVaapiDecoderStatus status; - GstClockTime pts; - - // context depends on priv->width and priv->height, so we move parse_vop a little earlier - if (priv->is_svh) { - parser_result = gst_mpeg4_parse_video_plane_short_header(&priv->svh_hdr, buf, buf_size); - - } - else { - parser_result = gst_mpeg4_parse_video_object_plane(vop_hdr, sprite_trajectory, vol_hdr, buf, buf_size); - /* Need to skip this frame if VOP was not coded */ - if (GST_MPEG4_PARSER_OK == parser_result && !vop_hdr->coded) - return (GstVaapiDecoderStatus) GST_VAAPI_DECODER_STATUS_DROP_FRAME; - } - - if (parser_result != GST_MPEG4_PARSER_OK) { - GST_DEBUG("failed to parse picture header"); - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - } + GstVaapiDecoderMpeg4Private *const priv = &decoder->priv; + GstClockTime frame_timestamp; - if (priv->is_svh) { - priv->width = priv->svh_hdr.vop_width; - priv->height = priv->svh_hdr.vop_height; - } + frame_timestamp = GST_VAAPI_DECODER_CODEC_FRAME (decoder)->pts; + if (frame_timestamp && frame_timestamp != GST_CLOCK_TIME_NONE) { + /* Buffer with timestamp */ + if (priv->max_pts != GST_CLOCK_TIME_NONE && frame_timestamp < priv->max_pts) { + frame_timestamp = priv->max_pts + + gst_util_uint64_scale ((vol_hdr->fixed_vop_rate ? + vol_hdr->fixed_vop_time_increment : 1), + GST_SECOND, vol_hdr->vop_time_increment_resolution); + } + } else { + /* Buffer without timestamp set */ + if (priv->max_pts == GST_CLOCK_TIME_NONE) /* first buffer */ + frame_timestamp = 0; else { - if (!vop_hdr->width && !vop_hdr->height) { - vop_hdr->width = vol_hdr->width; - vop_hdr->height = vol_hdr->height; - } - priv->width = vop_hdr->width; - priv->height = vop_hdr->height; - } - - status = ensure_context(decoder); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) { - GST_DEBUG("failed to reset context"); - return status; - } + GstClockTime tmp_pts; + tmp_pts = priv->pts_diff + priv->gop_pts + + vop_hdr->modulo_time_base * GST_SECOND + + gst_util_uint64_scale (vop_hdr->time_increment, + GST_SECOND, vol_hdr->vop_time_increment_resolution); + if (tmp_pts > priv->max_pts) + frame_timestamp = tmp_pts; + else + frame_timestamp = priv->max_pts + + gst_util_uint64_scale ((vol_hdr->fixed_vop_rate ? + vol_hdr->fixed_vop_time_increment : 1), + GST_SECOND, vol_hdr->vop_time_increment_resolution); + } + } + + priv->pts_diff = frame_timestamp - + (priv->gop_pts + vop_hdr->modulo_time_base * GST_SECOND + + gst_util_uint64_scale (vop_hdr->time_increment, GST_SECOND, + vol_hdr->vop_time_increment_resolution)); +} - if (priv->curr_picture) { - status = decode_current_picture(decoder); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - } +static GstVaapiDecoderStatus +decode_picture (GstVaapiDecoderMpeg4 * decoder, const guint8 * buf, + guint buf_size) +{ + GstMpeg4ParseResult parser_result = GST_MPEG4_PARSER_OK; + GstVaapiDecoderMpeg4Private *const priv = &decoder->priv; + GstMpeg4VideoObjectPlane *const vop_hdr = &priv->vop_hdr; + GstMpeg4VideoObjectLayer *const vol_hdr = &priv->vol_hdr; + GstMpeg4SpriteTrajectory *const sprite_trajectory = &priv->sprite_trajectory; + GstVaapiPicture *picture; + GstVaapiDecoderStatus status; + GstClockTime pts; + + // context depends on priv->width and priv->height, so we move parse_vop a little earlier + if (priv->is_svh) { + parser_result = + gst_mpeg4_parse_video_plane_short_header (&priv->svh_hdr, buf, + buf_size); + + } else { + parser_result = + gst_mpeg4_parse_video_object_plane (vop_hdr, sprite_trajectory, vol_hdr, + buf, buf_size); + /* Need to skip this frame if VOP was not coded */ + if (GST_MPEG4_PARSER_OK == parser_result && !vop_hdr->coded) + return (GstVaapiDecoderStatus) GST_VAAPI_DECODER_STATUS_DROP_FRAME; + } + + if (parser_result != GST_MPEG4_PARSER_OK) { + GST_DEBUG ("failed to parse picture header"); + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + } + + if (priv->is_svh) { + priv->width = priv->svh_hdr.vop_width; + priv->height = priv->svh_hdr.vop_height; + } else { + if (!vop_hdr->width && !vop_hdr->height) { + vop_hdr->width = vol_hdr->width; + vop_hdr->height = vol_hdr->height; + } + priv->width = vop_hdr->width; + priv->height = vop_hdr->height; + } + + status = ensure_context (decoder); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) { + GST_DEBUG ("failed to reset context"); + return status; + } - priv->curr_picture = GST_VAAPI_PICTURE_NEW(MPEG4, decoder); - if (!priv->curr_picture) { - GST_DEBUG("failed to allocate picture"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } - picture = priv->curr_picture; + if (priv->curr_picture) { + status = decode_current_picture (decoder); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; + } - status = ensure_quant_matrix(decoder, picture); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) { - GST_DEBUG("failed to reset quantizer matrix"); - return status; - } + priv->curr_picture = GST_VAAPI_PICTURE_NEW (MPEG4, decoder); + if (!priv->curr_picture) { + GST_DEBUG ("failed to allocate picture"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } + picture = priv->curr_picture; + + status = ensure_quant_matrix (decoder, picture); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) { + GST_DEBUG ("failed to reset quantizer matrix"); + return status; + } - /* 7.6.7 Temporal prediction structure - * forward reference frame B B B B B B backward reference frame - * | | - * nearest I/P/S in the past with vop_coded ==1 | - * nearest I/P/S in the future with any vop_coded - * fixme, it said that B frame shouldn't use backward reference frame - * when backward reference frame coded is 0 - */ - if (priv->is_svh) { - priv->coding_type = priv->svh_hdr.picture_coding_type; - } - else { - priv->coding_type = priv->vop_hdr.coding_type; - } - switch (priv->coding_type) { + /* 7.6.7 Temporal prediction structure + * forward reference frame B B B B B B backward reference frame + * | | + * nearest I/P/S in the past with vop_coded ==1 | + * nearest I/P/S in the future with any vop_coded + * fixme, it said that B frame shouldn't use backward reference frame + * when backward reference frame coded is 0 + */ + if (priv->is_svh) { + priv->coding_type = priv->svh_hdr.picture_coding_type; + } else { + priv->coding_type = priv->vop_hdr.coding_type; + } + switch (priv->coding_type) { case GST_MPEG4_I_VOP: - picture->type = GST_VAAPI_PICTURE_TYPE_I; - if (priv->is_svh || vop_hdr->coded) - GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_REFERENCE); - break; + picture->type = GST_VAAPI_PICTURE_TYPE_I; + if (priv->is_svh || vop_hdr->coded) + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_REFERENCE); + break; case GST_MPEG4_P_VOP: - picture->type = GST_VAAPI_PICTURE_TYPE_P; - if (priv->is_svh || vop_hdr->coded) - GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_REFERENCE); - break; + picture->type = GST_VAAPI_PICTURE_TYPE_P; + if (priv->is_svh || vop_hdr->coded) + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_REFERENCE); + break; case GST_MPEG4_B_VOP: - picture->type = GST_VAAPI_PICTURE_TYPE_B; - break; + picture->type = GST_VAAPI_PICTURE_TYPE_B; + break; case GST_MPEG4_S_VOP: - picture->type = GST_VAAPI_PICTURE_TYPE_S; - // see 3.175 reference VOP - if (vop_hdr->coded) - GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_REFERENCE); - break; + picture->type = GST_VAAPI_PICTURE_TYPE_S; + // see 3.175 reference VOP + if (vop_hdr->coded) + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_REFERENCE); + break; default: - GST_DEBUG("unsupported picture type %d", priv->coding_type); - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - } - - if (!priv->is_svh && !vop_hdr->coded) { - status = render_picture(decoder, priv->prev_picture); - return status; - } - - if (priv->is_svh) { - guint temp_ref = priv->svh_hdr.temporal_reference; - if (temp_ref < priv->prev_t_ref) { - temp_ref += 256; - } - guint delta_ref = temp_ref - priv->prev_t_ref; - - pts = priv->sync_time; - // see temporal_reference definition in spec, 30000/1001Hz - pts += gst_util_uint64_scale(delta_ref, GST_SECOND*1001, 30000); - priv->sync_time = pts; - priv->prev_t_ref = priv->svh_hdr.temporal_reference; - } - else { - /* Update priv->pts_diff */ - if (priv->calculate_pts_diff) { - calculate_pts_diff(decoder, vol_hdr, vop_hdr); - priv->calculate_pts_diff = FALSE; - } + GST_DEBUG ("unsupported picture type %d", priv->coding_type); + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + } - /* Update presentation time, 6.3.5 */ - if(vop_hdr->coding_type != GST_MPEG4_B_VOP) { - // increment basing on decoding order - priv->last_sync_time = priv->sync_time; - priv->sync_time = priv->last_sync_time + vop_hdr->modulo_time_base; - pts = priv->sync_time * GST_SECOND; - pts += gst_util_uint64_scale(vop_hdr->time_increment, GST_SECOND, vol_hdr->vop_time_increment_resolution); - priv->last_non_b_scale_time = priv->non_b_scale_time; - priv->non_b_scale_time = priv->sync_time * vol_hdr->vop_time_increment_resolution + vop_hdr->time_increment; - priv->trd = priv->non_b_scale_time - priv->last_non_b_scale_time; - } - else { - // increment basing on display oder - pts = (priv->last_sync_time + vop_hdr->modulo_time_base) * GST_SECOND; - pts += gst_util_uint64_scale(vop_hdr->time_increment, GST_SECOND, vol_hdr->vop_time_increment_resolution); - priv->trb = (priv->last_sync_time + vop_hdr->modulo_time_base) * vol_hdr->vop_time_increment_resolution + - vop_hdr->time_increment - priv->last_non_b_scale_time; - } - } - picture->pts = pts + priv->pts_diff; - if (priv->max_pts == GST_CLOCK_TIME_NONE || priv->max_pts < picture->pts) - priv->max_pts = picture->pts; - - /* Update reference pictures */ - /* XXX: consider priv->vol_hdr.low_delay, consider packed video frames for DivX/XviD */ - if (GST_VAAPI_PICTURE_IS_REFERENCE(picture)) { - if (priv->next_picture) - status = render_picture(decoder, priv->next_picture); - gst_vaapi_picture_replace(&priv->prev_picture, priv->next_picture); - gst_vaapi_picture_replace(&priv->next_picture, picture); - } + if (!priv->is_svh && !vop_hdr->coded) { + status = render_picture (decoder, priv->prev_picture); return status; + } + + if (priv->is_svh) { + guint temp_ref = priv->svh_hdr.temporal_reference; + guint delta_ref; + + if (temp_ref < priv->prev_t_ref) { + temp_ref += 256; + } + delta_ref = temp_ref - priv->prev_t_ref; + + pts = priv->sync_time; + // see temporal_reference definition in spec, 30000/1001Hz + pts += gst_util_uint64_scale (delta_ref, GST_SECOND * 1001, 30000); + priv->sync_time = pts; + priv->prev_t_ref = priv->svh_hdr.temporal_reference; + } else { + /* Update priv->pts_diff */ + if (priv->calculate_pts_diff) { + calculate_pts_diff (decoder, vol_hdr, vop_hdr); + priv->calculate_pts_diff = FALSE; + } + + /* Update presentation time, 6.3.5 */ + if (vop_hdr->coding_type != GST_MPEG4_B_VOP) { + // increment basing on decoding order + priv->last_sync_time = priv->sync_time; + priv->sync_time = priv->last_sync_time + vop_hdr->modulo_time_base; + pts = priv->sync_time * GST_SECOND; + pts += + gst_util_uint64_scale (vop_hdr->time_increment, GST_SECOND, + vol_hdr->vop_time_increment_resolution); + priv->last_non_b_scale_time = priv->non_b_scale_time; + priv->non_b_scale_time = + priv->sync_time * vol_hdr->vop_time_increment_resolution + + vop_hdr->time_increment; + priv->trd = priv->non_b_scale_time - priv->last_non_b_scale_time; + } else { + // increment basing on display oder + pts = (priv->last_sync_time + vop_hdr->modulo_time_base) * GST_SECOND; + pts += + gst_util_uint64_scale (vop_hdr->time_increment, GST_SECOND, + vol_hdr->vop_time_increment_resolution); + priv->trb = + (priv->last_sync_time + + vop_hdr->modulo_time_base) * vol_hdr->vop_time_increment_resolution + + vop_hdr->time_increment - priv->last_non_b_scale_time; + } + } + picture->pts = pts + priv->pts_diff; + if (priv->max_pts == GST_CLOCK_TIME_NONE || priv->max_pts < picture->pts) + priv->max_pts = picture->pts; + + /* Update reference pictures */ + /* XXX: consider priv->vol_hdr.low_delay, consider packed video frames for DivX/XviD */ + if (GST_VAAPI_PICTURE_IS_REFERENCE (picture)) { + if (priv->next_picture) + status = render_picture (decoder, priv->next_picture); + gst_vaapi_picture_replace (&priv->prev_picture, priv->next_picture); + gst_vaapi_picture_replace (&priv->next_picture, picture); + } + return status; } static inline guint -get_vop_coding_type(GstVaapiPicture *picture) +get_vop_coding_type (GstVaapiPicture * picture) { - return picture->type - GST_VAAPI_PICTURE_TYPE_I; + return picture->type - GST_VAAPI_PICTURE_TYPE_I; } static gboolean -fill_picture(GstVaapiDecoderMpeg4 *decoder, GstVaapiPicture *picture) +fill_picture (GstVaapiDecoderMpeg4 * decoder, GstVaapiPicture * picture) { - GstVaapiDecoderMpeg4Private * const priv = &decoder->priv; - VAPictureParameterBufferMPEG4 * const pic_param = picture->param; - GstMpeg4VideoObjectPlane * const vop_hdr = &priv->vop_hdr; - - /* Fill in VAPictureParameterBufferMPEG4 */ - pic_param->forward_reference_picture = VA_INVALID_ID; - pic_param->backward_reference_picture = VA_INVALID_ID; - - pic_param->vol_fields.value = 0; - pic_param->vop_fields.value = 0; - if(priv->is_svh) { - // vol_hdr Parameters - pic_param->vol_fields.bits.short_video_header = 1; - // does the following vol_hdr parameters matter for short video header? - pic_param->vol_fields.bits.chroma_format = 1; // I420, see table 6-15. - pic_param->vol_fields.bits.interlaced = 0; - pic_param->vol_fields.bits.obmc_disable = 1; - pic_param->vol_fields.bits.sprite_enable = 0; - pic_param->vol_fields.bits.sprite_warping_accuracy = 0; - pic_param->vol_fields.bits.quant_type = 0; //method 1; $7.4.4 - pic_param->vol_fields.bits.quarter_sample = 0; - pic_param->vol_fields.bits.data_partitioned = 0; - pic_param->vol_fields.bits.reversible_vlc = 0; - pic_param->vol_fields.bits.resync_marker_disable = 1; - pic_param->no_of_sprite_warping_points = 0; - pic_param->quant_precision = 5; - // VOP parameters - pic_param->vop_width = priv->svh_hdr.vop_width; - pic_param->vop_height = priv->svh_hdr.vop_height; - pic_param->vop_fields.bits.vop_coding_type = priv->svh_hdr.picture_coding_type; - pic_param->vop_time_increment_resolution = priv->vol_hdr.vop_time_increment_resolution; - - pic_param->num_gobs_in_vop = priv->svh_hdr.num_gobs_in_vop; - pic_param->num_macroblocks_in_gob = priv->svh_hdr.num_macroblocks_in_gob; - } - else { - // VOL parameters - pic_param->vol_fields.bits.short_video_header = 0; - pic_param->vol_fields.bits.chroma_format = priv->vol_hdr.chroma_format; - pic_param->vol_fields.bits.interlaced = priv->vol_hdr.interlaced; - pic_param->vol_fields.bits.obmc_disable = priv->vol_hdr.obmc_disable; - pic_param->vol_fields.bits.sprite_enable = priv->vol_hdr.sprite_enable; - pic_param->vol_fields.bits.sprite_warping_accuracy = priv->vol_hdr.sprite_warping_accuracy; - pic_param->vol_fields.bits.quant_type = priv->vol_hdr.quant_type; - pic_param->vol_fields.bits.quarter_sample = priv->vol_hdr.quarter_sample; - pic_param->vol_fields.bits.data_partitioned = priv->vol_hdr.data_partitioned; - pic_param->vol_fields.bits.reversible_vlc = priv->vol_hdr.reversible_vlc; - pic_param->vol_fields.bits.resync_marker_disable = priv->vol_hdr.resync_marker_disable; - pic_param->no_of_sprite_warping_points = priv->vol_hdr.no_of_sprite_warping_points; - int i =0; - for (i=0; i<3 && ivol_hdr.no_of_sprite_warping_points ; i++) { - pic_param->sprite_trajectory_du[i] = priv->sprite_trajectory.vop_ref_points[i]; - pic_param->sprite_trajectory_dv[i] = priv->sprite_trajectory.sprite_ref_points[i]; - } - pic_param->quant_precision = priv->vol_hdr.quant_precision; - - // VOP parameters - pic_param->vop_width = vop_hdr->width; - pic_param->vop_height = vop_hdr->height; - pic_param->vop_fields.bits.vop_coding_type = vop_hdr->coding_type; - pic_param->vop_fields.bits.vop_rounding_type = vop_hdr->rounding_type; - pic_param->vop_fields.bits.intra_dc_vlc_thr = vop_hdr->intra_dc_vlc_thr; - pic_param->vop_fields.bits.top_field_first = vop_hdr->top_field_first; - pic_param->vop_fields.bits.alternate_vertical_scan_flag = vop_hdr->alternate_vertical_scan_flag; - - pic_param->vop_fcode_forward = vop_hdr->fcode_forward; - pic_param->vop_fcode_backward = vop_hdr->fcode_backward; - pic_param->vop_time_increment_resolution = priv->vol_hdr.vop_time_increment_resolution; - } - - pic_param->TRB = 0; - pic_param->TRD = 0; - switch (priv->coding_type) { + GstVaapiDecoderMpeg4Private *const priv = &decoder->priv; + VAPictureParameterBufferMPEG4 *const pic_param = picture->param; + GstMpeg4VideoObjectPlane *const vop_hdr = &priv->vop_hdr; + + /* Fill in VAPictureParameterBufferMPEG4 */ + pic_param->forward_reference_picture = VA_INVALID_ID; + pic_param->backward_reference_picture = VA_INVALID_ID; + + pic_param->vol_fields.value = 0; + pic_param->vop_fields.value = 0; + if (priv->is_svh) { + // vol_hdr Parameters + pic_param->vol_fields.bits.short_video_header = 1; + // does the following vol_hdr parameters matter for short video header? + pic_param->vol_fields.bits.chroma_format = 1; // I420, see table 6-15. + pic_param->vol_fields.bits.interlaced = 0; + pic_param->vol_fields.bits.obmc_disable = 1; + pic_param->vol_fields.bits.sprite_enable = 0; + pic_param->vol_fields.bits.sprite_warping_accuracy = 0; + pic_param->vol_fields.bits.quant_type = 0; //method 1; $7.4.4 + pic_param->vol_fields.bits.quarter_sample = 0; + pic_param->vol_fields.bits.data_partitioned = 0; + pic_param->vol_fields.bits.reversible_vlc = 0; + pic_param->vol_fields.bits.resync_marker_disable = 1; + pic_param->no_of_sprite_warping_points = 0; + pic_param->quant_precision = 5; + // VOP parameters + pic_param->vop_width = priv->svh_hdr.vop_width; + pic_param->vop_height = priv->svh_hdr.vop_height; + pic_param->vop_fields.bits.vop_coding_type = + priv->svh_hdr.picture_coding_type; + pic_param->vop_time_increment_resolution = + priv->vol_hdr.vop_time_increment_resolution; + + pic_param->num_gobs_in_vop = priv->svh_hdr.num_gobs_in_vop; + pic_param->num_macroblocks_in_gob = priv->svh_hdr.num_macroblocks_in_gob; + } else { + int i; + + // VOL parameters + pic_param->vol_fields.bits.short_video_header = 0; + pic_param->vol_fields.bits.chroma_format = priv->vol_hdr.chroma_format; + pic_param->vol_fields.bits.interlaced = priv->vol_hdr.interlaced; + pic_param->vol_fields.bits.obmc_disable = priv->vol_hdr.obmc_disable; + pic_param->vol_fields.bits.sprite_enable = priv->vol_hdr.sprite_enable; + pic_param->vol_fields.bits.sprite_warping_accuracy = + priv->vol_hdr.sprite_warping_accuracy; + pic_param->vol_fields.bits.quant_type = priv->vol_hdr.quant_type; + pic_param->vol_fields.bits.quarter_sample = priv->vol_hdr.quarter_sample; + pic_param->vol_fields.bits.data_partitioned = + priv->vol_hdr.data_partitioned; + pic_param->vol_fields.bits.reversible_vlc = priv->vol_hdr.reversible_vlc; + pic_param->vol_fields.bits.resync_marker_disable = + priv->vol_hdr.resync_marker_disable; + pic_param->no_of_sprite_warping_points = + priv->vol_hdr.no_of_sprite_warping_points; + + for (i = 0; i < 3 && i < priv->vol_hdr.no_of_sprite_warping_points; i++) { + pic_param->sprite_trajectory_du[i] = + priv->sprite_trajectory.vop_ref_points[i]; + pic_param->sprite_trajectory_dv[i] = + priv->sprite_trajectory.sprite_ref_points[i]; + } + pic_param->quant_precision = priv->vol_hdr.quant_precision; + + // VOP parameters + pic_param->vop_width = vop_hdr->width; + pic_param->vop_height = vop_hdr->height; + pic_param->vop_fields.bits.vop_coding_type = vop_hdr->coding_type; + pic_param->vop_fields.bits.vop_rounding_type = vop_hdr->rounding_type; + pic_param->vop_fields.bits.intra_dc_vlc_thr = vop_hdr->intra_dc_vlc_thr; + pic_param->vop_fields.bits.top_field_first = vop_hdr->top_field_first; + pic_param->vop_fields.bits.alternate_vertical_scan_flag = + vop_hdr->alternate_vertical_scan_flag; + + pic_param->vop_fcode_forward = vop_hdr->fcode_forward; + pic_param->vop_fcode_backward = vop_hdr->fcode_backward; + pic_param->vop_time_increment_resolution = + priv->vol_hdr.vop_time_increment_resolution; + } + + pic_param->TRB = 0; + pic_param->TRD = 0; + switch (priv->coding_type) { case GST_MPEG4_B_VOP: - pic_param->TRB = priv->trb; - pic_param->backward_reference_picture = priv->next_picture->surface_id; - pic_param->vop_fields.bits.backward_reference_vop_coding_type = get_vop_coding_type(priv->next_picture); - // fall-through + pic_param->TRB = priv->trb; + pic_param->backward_reference_picture = priv->next_picture->surface_id; + pic_param->vop_fields.bits.backward_reference_vop_coding_type = + get_vop_coding_type (priv->next_picture); + // fall-through case GST_MPEG4_P_VOP: - pic_param->TRD = priv->trd; - if (priv->prev_picture) - pic_param->forward_reference_picture = priv->prev_picture->surface_id; - break; - } - - if (priv->vol_hdr.interlaced) { - priv->is_first_field ^= 1; - } - return TRUE; + pic_param->TRD = priv->trd; + if (priv->prev_picture) + pic_param->forward_reference_picture = priv->prev_picture->surface_id; + break; + } + + if (priv->vol_hdr.interlaced) { + priv->is_first_field ^= 1; + } + return TRUE; } static GstVaapiDecoderStatus -decode_slice( - GstVaapiDecoderMpeg4 *decoder, - const guint8 *buf, - guint buf_size, - gboolean has_packet_header -) -{ - GstVaapiDecoderMpeg4Private * const priv = &decoder->priv; - GstVaapiPicture * const picture = priv->curr_picture; - GstVaapiSlice *slice; - VASliceParameterBufferMPEG4 *slice_param; - - GST_DEBUG("decoder silce: %p, %u bytes)", buf, buf_size); - - // has_packet_header is ture for the 2+ slice - if (!has_packet_header && !fill_picture(decoder, picture)) - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - - slice = GST_VAAPI_SLICE_NEW(MPEG4, decoder, buf, buf_size); - if (!slice) { - GST_DEBUG("failed to allocate slice"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } - gst_vaapi_picture_add_slice(picture, slice); - - /* Fill in VASliceParameterBufferMPEG4 */ - slice_param = slice->param; - if (priv->is_svh) { - slice_param->macroblock_offset = (priv->svh_hdr.size)%8; - slice_param->macroblock_number = 0; - // the header of first gob_layer is empty (gob_header_empty=1), use vop_quant - slice_param->quant_scale = priv->svh_hdr.vop_quant; - } - else { - if (has_packet_header) { - slice_param->macroblock_offset = priv->packet_hdr.size % 8; - slice_param->macroblock_number = priv->packet_hdr.macroblock_number; - slice_param->quant_scale = priv->packet_hdr.quant_scale; - } - else { - slice_param->macroblock_offset = priv->vop_hdr.size % 8; - slice_param->macroblock_number = 0; - slice_param->quant_scale = priv->vop_hdr.quant; - } +decode_slice (GstVaapiDecoderMpeg4 * decoder, + const guint8 * buf, guint buf_size, gboolean has_packet_header) +{ + GstVaapiDecoderMpeg4Private *const priv = &decoder->priv; + GstVaapiPicture *const picture = priv->curr_picture; + GstVaapiSlice *slice; + VASliceParameterBufferMPEG4 *slice_param; + + GST_DEBUG ("decoder silce: %p, %u bytes)", buf, buf_size); + + // has_packet_header is ture for the 2+ slice + if (!has_packet_header && !fill_picture (decoder, picture)) + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + + slice = GST_VAAPI_SLICE_NEW (MPEG4, decoder, buf, buf_size); + if (!slice) { + GST_DEBUG ("failed to allocate slice"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } + gst_vaapi_picture_add_slice (picture, slice); + + /* Fill in VASliceParameterBufferMPEG4 */ + slice_param = slice->param; + if (priv->is_svh) { + slice_param->macroblock_offset = (priv->svh_hdr.size) % 8; + slice_param->macroblock_number = 0; + // the header of first gob_layer is empty (gob_header_empty=1), use vop_quant + slice_param->quant_scale = priv->svh_hdr.vop_quant; + } else { + if (has_packet_header) { + slice_param->macroblock_offset = priv->packet_hdr.size % 8; + slice_param->macroblock_number = priv->packet_hdr.macroblock_number; + slice_param->quant_scale = priv->packet_hdr.quant_scale; + } else { + slice_param->macroblock_offset = priv->vop_hdr.size % 8; + slice_param->macroblock_number = 0; + slice_param->quant_scale = priv->vop_hdr.quant; } - return GST_VAAPI_DECODER_STATUS_SUCCESS; + } + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_packet(GstVaapiDecoderMpeg4 *decoder, GstMpeg4Packet packet) +decode_packet (GstVaapiDecoderMpeg4 * decoder, GstMpeg4Packet packet) { - GstVaapiDecoderMpeg4Private * const priv = &decoder->priv; - GstMpeg4Packet *tos = &packet; - GstVaapiDecoderStatus status; - - // packet.size is the size from current marker to the next. - if (tos->type == GST_MPEG4_VISUAL_OBJ_SEQ_START) { - status = decode_sequence(decoder, packet.data + packet.offset, packet.size); - } - else if (tos->type == GST_MPEG4_VISUAL_OBJ_SEQ_END) { - status = decode_sequence_end(decoder); - } - else if (tos->type == GST_MPEG4_VISUAL_OBJ) { - status = decode_visual_object(decoder, packet.data + packet.offset, packet.size); - } - else if (tos->type >= GST_MPEG4_VIDEO_OBJ_FIRST && tos->type <= GST_MPEG4_VIDEO_OBJ_LAST) { - GST_WARNING("unexpected marker: (GST_MPEG4_VIDEO_OBJ_FIRST, GST_MPEG4_VIDEO_OBJ_LAST)"); - status = GST_VAAPI_DECODER_STATUS_SUCCESS; - } - else if (tos->type >= GST_MPEG4_VIDEO_LAYER_FIRST && tos->type <= GST_MPEG4_VIDEO_LAYER_LAST) { - status = decode_video_object_layer(decoder, packet.data + packet.offset, packet.size); - } - else if (tos->type == GST_MPEG4_GROUP_OF_VOP) { - status = decode_gop(decoder, packet.data + packet.offset, packet.size); - } - else if (tos->type == GST_MPEG4_VIDEO_OBJ_PLANE) { - status = decode_picture(decoder, packet.data + packet.offset, packet.size); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - - /* decode slice - * A resync marker shall only be located immediately before a macroblock - * (or video packet header if exists) and aligned with a byte - * either start_code or resync_marker are scaned/measured by byte, - * while the header itself are parsed/measured in bit - * it means: resync_marker(video_packet_header) start from byte boundary, - * while MB doesn't start from byte boundary -- it is what 'macroblock_offset' - * in slice refer to - */ - const guint8 *_data = packet.data + packet.offset + priv->vop_hdr.size/8; - gint _data_size = packet.size - (priv->vop_hdr.size/8); - GstMpeg4Packet video_packet; - - if (priv->vol_hdr.resync_marker_disable) { - status = decode_slice(decoder, _data, _data_size, FALSE); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - } - else { - // next start_code is required to determine the end of last slice - _data_size += 4; - GstMpeg4ParseResult ret = GST_MPEG4_PARSER_OK; - - gboolean first_slice = TRUE; - while (_data_size > 0) { - // we can skip user data here - ret = gst_mpeg4_parse(&video_packet, TRUE, &priv->vop_hdr, _data, 0, _data_size); - if(ret != GST_MPEG4_PARSER_OK) { - break; - } - - if (first_slice) { - status = decode_slice(decoder, _data, video_packet.size, FALSE); - first_slice = FALSE; - } - else { - _data += video_packet.offset; - _data_size -= video_packet.offset; - - ret = gst_mpeg4_parse_video_packet_header (&priv->packet_hdr, &priv->vol_hdr, &priv->vop_hdr, &priv->sprite_trajectory, _data, _data_size); - status = decode_slice(decoder,_data + priv->packet_hdr.size/8, video_packet.size - priv->packet_hdr.size/8, TRUE); - } - - _data += video_packet.size; - _data_size -= video_packet.size; - } - } - status = decode_current_picture(decoder); - } - else if (tos->type == GST_MPEG4_USER_DATA - || tos->type == GST_MPEG4_VIDEO_SESSION_ERR - || tos->type == GST_MPEG4_FBA - || tos->type == GST_MPEG4_FBA_PLAN - || tos->type == GST_MPEG4_MESH - || tos->type == GST_MPEG4_MESH_PLAN - || tos->type == GST_MPEG4_STILL_TEXTURE_OBJ - || tos->type == GST_MPEG4_TEXTURE_SPATIAL - || tos->type == GST_MPEG4_TEXTURE_SNR_LAYER - || tos->type == GST_MPEG4_TEXTURE_TILE - || tos->type == GST_MPEG4_SHAPE_LAYER - || tos->type == GST_MPEG4_STUFFING - || tos->type == GST_MPEG4_SYSTEM_FIRST - || tos->type == GST_MPEG4_SYSTEM_LAST) { - GST_WARNING("Ignore marker: %x\n", tos->type); - status = GST_VAAPI_DECODER_STATUS_SUCCESS; - } - else { - GST_ERROR("unsupported start code %x\n", tos->type); - status = GST_VAAPI_DECODER_STATUS_SUCCESS; - } - - return status; + GstVaapiDecoderMpeg4Private *const priv = &decoder->priv; + GstMpeg4Packet *tos = &packet; + GstVaapiDecoderStatus status; + + // packet.size is the size from current marker to the next. + if (tos->type == GST_MPEG4_VISUAL_OBJ_SEQ_START) { + status = + decode_sequence (decoder, packet.data + packet.offset, packet.size); + } else if (tos->type == GST_MPEG4_VISUAL_OBJ_SEQ_END) { + status = decode_sequence_end (decoder); + } else if (tos->type == GST_MPEG4_VISUAL_OBJ) { + status = + decode_visual_object (decoder, packet.data + packet.offset, + packet.size); + } else if (tos->type >= GST_MPEG4_VIDEO_OBJ_FIRST + && tos->type <= GST_MPEG4_VIDEO_OBJ_LAST) { + GST_WARNING + ("unexpected marker: (GST_MPEG4_VIDEO_OBJ_FIRST, GST_MPEG4_VIDEO_OBJ_LAST)"); + status = GST_VAAPI_DECODER_STATUS_SUCCESS; + } else if (tos->type >= GST_MPEG4_VIDEO_LAYER_FIRST + && tos->type <= GST_MPEG4_VIDEO_LAYER_LAST) { + status = + decode_video_object_layer (decoder, packet.data + packet.offset, + packet.size); + } else if (tos->type == GST_MPEG4_GROUP_OF_VOP) { + status = decode_gop (decoder, packet.data + packet.offset, packet.size); + } else if (tos->type == GST_MPEG4_VIDEO_OBJ_PLANE) { + GstMpeg4Packet video_packet; + const guint8 *_data; + gint _data_size; + + status = decode_picture (decoder, packet.data + packet.offset, packet.size); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; + + /* decode slice + * A resync marker shall only be located immediately before a macroblock + * (or video packet header if exists) and aligned with a byte + * either start_code or resync_marker are scaned/measured by byte, + * while the header itself are parsed/measured in bit + * it means: resync_marker(video_packet_header) start from byte boundary, + * while MB doesn't start from byte boundary -- it is what 'macroblock_offset' + * in slice refer to + */ + _data = packet.data + packet.offset + priv->vop_hdr.size / 8; + _data_size = packet.size - (priv->vop_hdr.size / 8); + + if (priv->vol_hdr.resync_marker_disable) { + status = decode_slice (decoder, _data, _data_size, FALSE); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; + } else { + GstMpeg4ParseResult ret = GST_MPEG4_PARSER_OK; + gboolean first_slice = TRUE; + + // next start_code is required to determine the end of last slice + _data_size += 4; + + while (_data_size > 0) { + // we can skip user data here + ret = + gst_mpeg4_parse (&video_packet, TRUE, &priv->vop_hdr, _data, 0, + _data_size); + if (ret != GST_MPEG4_PARSER_OK) { + break; + } + + if (first_slice) { + status = decode_slice (decoder, _data, video_packet.size, FALSE); + first_slice = FALSE; + } else { + _data += video_packet.offset; + _data_size -= video_packet.offset; + + ret = + gst_mpeg4_parse_video_packet_header (&priv->packet_hdr, + &priv->vol_hdr, &priv->vop_hdr, &priv->sprite_trajectory, _data, + _data_size); + status = + decode_slice (decoder, _data + priv->packet_hdr.size / 8, + video_packet.size - priv->packet_hdr.size / 8, TRUE); + } + + _data += video_packet.size; + _data_size -= video_packet.size; + } + } + status = decode_current_picture (decoder); + } else if (tos->type == GST_MPEG4_USER_DATA + || tos->type == GST_MPEG4_VIDEO_SESSION_ERR + || tos->type == GST_MPEG4_FBA + || tos->type == GST_MPEG4_FBA_PLAN + || tos->type == GST_MPEG4_MESH + || tos->type == GST_MPEG4_MESH_PLAN + || tos->type == GST_MPEG4_STILL_TEXTURE_OBJ + || tos->type == GST_MPEG4_TEXTURE_SPATIAL + || tos->type == GST_MPEG4_TEXTURE_SNR_LAYER + || tos->type == GST_MPEG4_TEXTURE_TILE + || tos->type == GST_MPEG4_SHAPE_LAYER + || tos->type == GST_MPEG4_STUFFING + || tos->type == GST_MPEG4_SYSTEM_FIRST + || tos->type == GST_MPEG4_SYSTEM_LAST) { + GST_WARNING ("Ignore marker: %x\n", tos->type); + status = GST_VAAPI_DECODER_STATUS_SUCCESS; + } else { + GST_ERROR ("unsupported start code %x\n", tos->type); + status = GST_VAAPI_DECODER_STATUS_SUCCESS; + } + + return status; } static GstVaapiDecoderStatus -decode_buffer(GstVaapiDecoderMpeg4 *decoder, const guchar *buf, guint buf_size) +decode_buffer (GstVaapiDecoderMpeg4 * decoder, const guchar * buf, + guint buf_size) { - GstVaapiDecoderMpeg4Private * const priv = &decoder->priv; - GstVaapiDecoderStatus status; - GstMpeg4Packet packet; - guint ofs; - - if (priv->is_svh) { - status = decode_picture(decoder, buf, buf_size); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - - ofs = priv->svh_hdr.size / 8; - status = decode_slice(decoder, buf + ofs, buf_size - ofs, FALSE); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - } - else { - packet.data = buf; - packet.offset = 0; - packet.size = buf_size; - packet.type = (GstMpeg4StartCode)packet.data[0]; - - status = decode_packet(decoder, packet); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - } - return GST_VAAPI_DECODER_STATUS_SUCCESS; + GstVaapiDecoderMpeg4Private *const priv = &decoder->priv; + GstVaapiDecoderStatus status; + GstMpeg4Packet packet; + guint ofs; + + if (priv->is_svh) { + status = decode_picture (decoder, buf, buf_size); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; + + ofs = priv->svh_hdr.size / 8; + status = decode_slice (decoder, buf + ofs, buf_size - ofs, FALSE); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; + } else { + packet.data = buf; + packet.offset = 0; + packet.size = buf_size; + packet.type = (GstMpeg4StartCode) packet.data[0]; + + status = decode_packet (decoder, packet); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; + } + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -gst_vaapi_decoder_mpeg4_decode_codec_data(GstVaapiDecoder *base_decoder, - const guchar *_buf, guint _buf_size) +gst_vaapi_decoder_mpeg4_decode_codec_data (GstVaapiDecoder * base_decoder, + const guchar * _buf, guint _buf_size) { - GstVaapiDecoderMpeg4 * const decoder = - GST_VAAPI_DECODER_MPEG4_CAST(base_decoder); - GstVaapiDecoderStatus status = GST_VAAPI_DECODER_STATUS_SUCCESS; - guchar *buf; - guint pos, buf_size; - - // add additional 0x000001b2 to enclose the last header - buf_size = _buf_size + 4; - buf = malloc(buf_size); - memcpy(buf, _buf, buf_size); - buf[buf_size-4] = 0; - buf[buf_size-3] = 0; - buf[buf_size-2] = 1; - buf[buf_size-1] = 0xb2; - - pos = 0; - GstMpeg4Packet packet; - GstMpeg4ParseResult result = GST_MPEG4_PARSER_OK; - - while (result == GST_MPEG4_PARSER_OK && pos < buf_size) { - result = gst_mpeg4_parse(&packet, FALSE, NULL, buf, pos, buf_size); - if (result != GST_MPEG4_PARSER_OK) { - break; - } - status = decode_packet(decoder, packet); - if (GST_VAAPI_DECODER_STATUS_SUCCESS == status) { - pos = packet.offset + packet.size; - } - else { - GST_WARNING("decode mp4 packet failed when decoding codec data\n"); - break; - } + GstVaapiDecoderMpeg4 *const decoder = + GST_VAAPI_DECODER_MPEG4_CAST (base_decoder); + GstVaapiDecoderStatus status = GST_VAAPI_DECODER_STATUS_SUCCESS; + GstMpeg4ParseResult result = GST_MPEG4_PARSER_OK; + GstMpeg4Packet packet; + guchar *buf; + guint pos, buf_size; + + // add additional 0x000001b2 to enclose the last header + buf_size = _buf_size + 4; + buf = malloc (buf_size); + memcpy (buf, _buf, buf_size); + buf[buf_size - 4] = 0; + buf[buf_size - 3] = 0; + buf[buf_size - 2] = 1; + buf[buf_size - 1] = 0xb2; + + pos = 0; + + while (result == GST_MPEG4_PARSER_OK && pos < buf_size) { + result = gst_mpeg4_parse (&packet, FALSE, NULL, buf, pos, buf_size); + if (result != GST_MPEG4_PARSER_OK) { + break; + } + status = decode_packet (decoder, packet); + if (GST_VAAPI_DECODER_STATUS_SUCCESS == status) { + pos = packet.offset + packet.size; + } else { + GST_WARNING ("decode mp4 packet failed when decoding codec data\n"); + break; } - free(buf); - return status; + } + free (buf); + return status; } static GstVaapiDecoderStatus -ensure_decoder(GstVaapiDecoderMpeg4 *decoder) +ensure_decoder (GstVaapiDecoderMpeg4 * decoder) { - GstVaapiDecoderMpeg4Private * const priv = &decoder->priv; - GstVaapiDecoderStatus status; + GstVaapiDecoderMpeg4Private *const priv = &decoder->priv; + GstVaapiDecoderStatus status; - if (!priv->is_opened) { - priv->is_opened = gst_vaapi_decoder_mpeg4_open(decoder); - if (!priv->is_opened) - return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC; - - status = gst_vaapi_decoder_decode_codec_data( - GST_VAAPI_DECODER_CAST(decoder)); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - } - return GST_VAAPI_DECODER_STATUS_SUCCESS; + if (!priv->is_opened) { + priv->is_opened = gst_vaapi_decoder_mpeg4_open (decoder); + if (!priv->is_opened) + return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC; + + status = + gst_vaapi_decoder_decode_codec_data (GST_VAAPI_DECODER_CAST (decoder)); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; + } + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -gst_vaapi_decoder_mpeg4_parse(GstVaapiDecoder *base_decoder, - GstAdapter *adapter, gboolean at_eos, GstVaapiDecoderUnit *unit) +gst_vaapi_decoder_mpeg4_parse (GstVaapiDecoder * base_decoder, + GstAdapter * adapter, gboolean at_eos, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderMpeg4 * const decoder = - GST_VAAPI_DECODER_MPEG4_CAST(base_decoder); - GstVaapiDecoderMpeg4Private * const priv = &decoder->priv; - GstVaapiDecoderStatus status; - GstMpeg4Packet packet; - GstMpeg4ParseResult result; - const guchar *buf; - guint size, buf_size, flags = 0; - - status = ensure_decoder(decoder); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; + GstVaapiDecoderMpeg4 *const decoder = + GST_VAAPI_DECODER_MPEG4_CAST (base_decoder); + GstVaapiDecoderMpeg4Private *const priv = &decoder->priv; + GstVaapiDecoderStatus status; + GstMpeg4Packet packet; + GstMpeg4ParseResult result; + const guchar *buf; + guint size, buf_size, flags = 0; - size = gst_adapter_available(adapter); - buf = gst_adapter_map(adapter, size); - if (!buf) - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - - packet.type = GST_MPEG4_USER_DATA; - if (priv->is_svh) - result = gst_h263_parse(&packet, buf, 0, size); - else - result = gst_mpeg4_parse(&packet, FALSE, NULL, buf, 0, size); - if (result == GST_MPEG4_PARSER_NO_PACKET_END && at_eos) - packet.size = size - packet.offset; - else if (result == GST_MPEG4_PARSER_ERROR) - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - else if (result != GST_MPEG4_PARSER_OK) - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + status = ensure_decoder (decoder); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; - buf_size = packet.size; - gst_adapter_flush(adapter, packet.offset); - unit->size = buf_size; + size = gst_adapter_available (adapter); + buf = gst_adapter_map (adapter, size); + if (!buf) + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + + packet.type = GST_MPEG4_USER_DATA; + if (priv->is_svh) + result = gst_h263_parse (&packet, buf, 0, size); + else + result = gst_mpeg4_parse (&packet, FALSE, NULL, buf, 0, size); + if (result == GST_MPEG4_PARSER_NO_PACKET_END && at_eos) + packet.size = size - packet.offset; + else if (result == GST_MPEG4_PARSER_ERROR) + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + else if (result != GST_MPEG4_PARSER_OK) + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + + buf_size = packet.size; + gst_adapter_flush (adapter, packet.offset); + unit->size = buf_size; - /* Check for start of new picture */ - switch (packet.type) { + /* Check for start of new picture */ + switch (packet.type) { case GST_MPEG4_VIDEO_SESSION_ERR: case GST_MPEG4_FBA: case GST_MPEG4_FBA_PLAN: @@ -1059,103 +1084,102 @@ case GST_MPEG4_TEXTURE_TILE: case GST_MPEG4_SHAPE_LAYER: case GST_MPEG4_STUFFING: - gst_adapter_flush(adapter, packet.size); - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + gst_adapter_flush (adapter, packet.size); + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; case GST_MPEG4_USER_DATA: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP; - break; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP; + break; case GST_MPEG4_VISUAL_OBJ_SEQ_END: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_END; - flags |= GST_VAAPI_DECODER_UNIT_FLAG_STREAM_END; - break; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_END; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_STREAM_END; + break; case GST_MPEG4_VIDEO_OBJ_PLANE: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_SLICE; - flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_END; - /* fall-through */ + flags |= GST_VAAPI_DECODER_UNIT_FLAG_SLICE; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_END; + /* fall-through */ case GST_MPEG4_VISUAL_OBJ_SEQ_START: case GST_MPEG4_VISUAL_OBJ: case GST_MPEG4_GROUP_OF_VOP: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; - break; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; + break; default: - if (packet.type >= GST_MPEG4_VIDEO_OBJ_FIRST && - packet.type <= GST_MPEG4_VIDEO_OBJ_LAST) { - gst_adapter_flush(adapter, packet.size); - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - } - if (packet.type >= GST_MPEG4_VIDEO_LAYER_FIRST && - packet.type <= GST_MPEG4_VIDEO_LAYER_LAST) { - break; - } - if (packet.type >= GST_MPEG4_SYSTEM_FIRST && - packet.type <= GST_MPEG4_SYSTEM_LAST) { - flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP; - break; - } - GST_WARNING("unsupported start code (0x%02x)", packet.type); - return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - } - GST_VAAPI_DECODER_UNIT_FLAG_SET(unit, flags); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + if (packet.type >= GST_MPEG4_VIDEO_OBJ_FIRST && + packet.type <= GST_MPEG4_VIDEO_OBJ_LAST) { + gst_adapter_flush (adapter, packet.size); + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + } + if (packet.type >= GST_MPEG4_VIDEO_LAYER_FIRST && + packet.type <= GST_MPEG4_VIDEO_LAYER_LAST) { + break; + } + if (packet.type >= GST_MPEG4_SYSTEM_FIRST && + packet.type <= GST_MPEG4_SYSTEM_LAST) { + flags |= GST_VAAPI_DECODER_UNIT_FLAG_SKIP; + break; + } + GST_WARNING ("unsupported start code (0x%02x)", packet.type); + return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + } + GST_VAAPI_DECODER_UNIT_FLAG_SET (unit, flags); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -gst_vaapi_decoder_mpeg4_decode(GstVaapiDecoder *base_decoder, - GstVaapiDecoderUnit *unit) +gst_vaapi_decoder_mpeg4_decode (GstVaapiDecoder * base_decoder, + GstVaapiDecoderUnit * unit) { - GstVaapiDecoderMpeg4 * const decoder = - GST_VAAPI_DECODER_MPEG4_CAST(base_decoder); - GstVaapiDecoderStatus status; - GstBuffer * const buffer = - GST_VAAPI_DECODER_CODEC_FRAME(decoder)->input_buffer; - GstMapInfo map_info; + GstVaapiDecoderMpeg4 *const decoder = + GST_VAAPI_DECODER_MPEG4_CAST (base_decoder); + GstVaapiDecoderStatus status; + GstBuffer *const buffer = + GST_VAAPI_DECODER_CODEC_FRAME (decoder)->input_buffer; + GstMapInfo map_info; - status = ensure_decoder(decoder); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - - if (!gst_buffer_map(buffer, &map_info, GST_MAP_READ)) { - GST_ERROR("failed to map buffer"); - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - } + status = ensure_decoder (decoder); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; - status = decode_buffer(decoder, map_info.data + unit->offset, unit->size); - gst_buffer_unmap(buffer, &map_info); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + if (!gst_buffer_map (buffer, &map_info, GST_MAP_READ)) { + GST_ERROR ("failed to map buffer"); + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + } + + status = decode_buffer (decoder, map_info.data + unit->offset, unit->size); + gst_buffer_unmap (buffer, &map_info); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static void -gst_vaapi_decoder_mpeg4_class_init(GstVaapiDecoderMpeg4Class *klass) +gst_vaapi_decoder_mpeg4_class_init (GstVaapiDecoderMpeg4Class * klass) { - GstVaapiMiniObjectClass * const object_class = - GST_VAAPI_MINI_OBJECT_CLASS(klass); - GstVaapiDecoderClass * const decoder_class = GST_VAAPI_DECODER_CLASS(klass); - - object_class->size = sizeof(GstVaapiDecoderMpeg4); - object_class->finalize = (GDestroyNotify)gst_vaapi_decoder_finalize; - - decoder_class->create = gst_vaapi_decoder_mpeg4_create; - decoder_class->destroy = gst_vaapi_decoder_mpeg4_destroy; - decoder_class->parse = gst_vaapi_decoder_mpeg4_parse; - decoder_class->decode = gst_vaapi_decoder_mpeg4_decode; + GstVaapiMiniObjectClass *const object_class = + GST_VAAPI_MINI_OBJECT_CLASS (klass); + GstVaapiDecoderClass *const decoder_class = GST_VAAPI_DECODER_CLASS (klass); - decoder_class->decode_codec_data = - gst_vaapi_decoder_mpeg4_decode_codec_data; + object_class->size = sizeof (GstVaapiDecoderMpeg4); + object_class->finalize = (GDestroyNotify) gst_vaapi_decoder_finalize; + + decoder_class->create = gst_vaapi_decoder_mpeg4_create; + decoder_class->destroy = gst_vaapi_decoder_mpeg4_destroy; + decoder_class->parse = gst_vaapi_decoder_mpeg4_parse; + decoder_class->decode = gst_vaapi_decoder_mpeg4_decode; + + decoder_class->decode_codec_data = gst_vaapi_decoder_mpeg4_decode_codec_data; } static inline const GstVaapiDecoderClass * -gst_vaapi_decoder_mpeg4_class(void) +gst_vaapi_decoder_mpeg4_class (void) { - static GstVaapiDecoderMpeg4Class g_class; - static gsize g_class_init = FALSE; + static GstVaapiDecoderMpeg4Class g_class; + static gsize g_class_init = FALSE; - if (g_once_init_enter(&g_class_init)) { - gst_vaapi_decoder_mpeg4_class_init(&g_class); - g_once_init_leave(&g_class_init, TRUE); - } - return GST_VAAPI_DECODER_CLASS(&g_class); + if (g_once_init_enter (&g_class_init)) { + gst_vaapi_decoder_mpeg4_class_init (&g_class); + g_once_init_leave (&g_class_init, TRUE); + } + return GST_VAAPI_DECODER_CLASS (&g_class); } /** @@ -1169,8 +1193,8 @@ * Return value: the newly allocated #GstVaapiDecoder object */ GstVaapiDecoder * -gst_vaapi_decoder_mpeg4_new(GstVaapiDisplay *display, GstCaps *caps) +gst_vaapi_decoder_mpeg4_new (GstVaapiDisplay * display, GstCaps * caps) { - return gst_vaapi_decoder_new(gst_vaapi_decoder_mpeg4_class(), - display, caps); + return gst_vaapi_decoder_new (gst_vaapi_decoder_mpeg4_class (), + display, caps); } diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_objects.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_objects.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_objects.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_objects.c 2016-03-24 11:36:59.000000000 +0000 @@ -211,8 +211,7 @@ object = gst_vaapi_codec_object_new (gst_vaapi_codec_object_get_class (&picture->parent_instance), GST_VAAPI_CODEC_BASE (decoder), NULL, - picture->param_size, picture, 0, - GST_VAAPI_CREATE_PICTURE_FLAG_CLONE); + picture->param_size, picture, 0, GST_VAAPI_CREATE_PICTURE_FLAG_CLONE); if (!object) return NULL; return GST_VAAPI_PICTURE_CAST (object); diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_priv.h gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_priv.h --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_priv.h 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_priv.h 2016-03-24 11:36:59.000000000 +0000 @@ -263,12 +263,10 @@ gst_vaapi_decoder_set_interlaced (GstVaapiDecoder * decoder, gboolean interlaced); -#if GST_CHECK_VERSION(1,5,0) G_GNUC_INTERNAL void gst_vaapi_decoder_set_multiview_mode (GstVaapiDecoder * decoder, gint views, GstVideoMultiviewMode mv_mode, GstVideoMultiviewFlags mv_flags); -#endif G_GNUC_INTERNAL gboolean diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_unit.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_unit.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_unit.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_unit.c 2016-03-24 11:36:59.000000000 +0000 @@ -38,14 +38,14 @@ * sub-classes. */ void -gst_vaapi_decoder_unit_init(GstVaapiDecoderUnit *unit) +gst_vaapi_decoder_unit_init (GstVaapiDecoderUnit * unit) { - unit->flags = 0; - unit->size = 0; - unit->offset = 0; + unit->flags = 0; + unit->size = 0; + unit->offset = 0; - unit->parsed_info = NULL; - unit->parsed_info_destroy_notify = NULL; + unit->parsed_info = NULL; + unit->parsed_info_destroy_notify = NULL; } /** @@ -59,9 +59,9 @@ * sub-classes. */ void -gst_vaapi_decoder_unit_clear(GstVaapiDecoderUnit *unit) +gst_vaapi_decoder_unit_clear (GstVaapiDecoderUnit * unit) { - gst_vaapi_decoder_unit_set_parsed_info(unit, NULL, NULL); + gst_vaapi_decoder_unit_set_parsed_info (unit, NULL, NULL); } /** @@ -77,13 +77,13 @@ * function will be called before the @parsed_info is replaced. */ void -gst_vaapi_decoder_unit_set_parsed_info(GstVaapiDecoderUnit *unit, +gst_vaapi_decoder_unit_set_parsed_info (GstVaapiDecoderUnit * unit, gpointer parsed_info, GDestroyNotify destroy_notify) { - g_return_if_fail(GST_VAAPI_IS_DECODER_UNIT(unit)); + g_return_if_fail (GST_VAAPI_IS_DECODER_UNIT (unit)); - if (unit->parsed_info && unit->parsed_info_destroy_notify) - unit->parsed_info_destroy_notify(unit->parsed_info); - unit->parsed_info = parsed_info; - unit->parsed_info_destroy_notify = destroy_notify; + if (unit->parsed_info && unit->parsed_info_destroy_notify) + unit->parsed_info_destroy_notify (unit->parsed_info); + unit->parsed_info = parsed_info; + unit->parsed_info_destroy_notify = destroy_notify; } diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c 2016-03-24 11:36:59.000000000 +0000 @@ -42,37 +42,38 @@ #define GST_VAAPI_DECODER_VC1_CAST(decoder) \ ((GstVaapiDecoderVC1 *)(decoder)) -typedef struct _GstVaapiDecoderVC1Private GstVaapiDecoderVC1Private; -typedef struct _GstVaapiDecoderVC1Class GstVaapiDecoderVC1Class; +typedef struct _GstVaapiDecoderVC1Private GstVaapiDecoderVC1Private; +typedef struct _GstVaapiDecoderVC1Class GstVaapiDecoderVC1Class; /** * GstVaapiDecoderVC1: * * A decoder based on VC1. */ -struct _GstVaapiDecoderVC1Private { - GstVaapiProfile profile; - guint width; - guint height; - GstVC1SeqHdr seq_hdr; - GstVC1EntryPointHdr entrypoint_hdr; - GstVC1FrameHdr frame_hdr; - GstVC1BitPlanes *bitplanes; - GstVaapiPicture *current_picture; - GstVaapiPicture *last_non_b_picture; - GstVaapiDpb *dpb; - gint32 next_poc; - guint8 *rbdu_buffer; - guint8 rndctrl; - guint rbdu_buffer_size; - guint is_opened : 1; - guint is_first_field : 1; - guint has_codec_data : 1; - guint has_entrypoint : 1; - guint size_changed : 1; - guint profile_changed : 1; - guint closed_entry : 1; - guint broken_link : 1; +struct _GstVaapiDecoderVC1Private +{ + GstVaapiProfile profile; + guint width; + guint height; + GstVC1SeqHdr seq_hdr; + GstVC1EntryPointHdr entrypoint_hdr; + GstVC1FrameHdr frame_hdr; + GstVC1BitPlanes *bitplanes; + GstVaapiPicture *current_picture; + GstVaapiPicture *last_non_b_picture; + GstVaapiDpb *dpb; + gint32 next_poc; + guint8 *rbdu_buffer; + guint8 rndctrl; + guint rbdu_buffer_size; + guint is_opened:1; + guint is_first_field:1; + guint has_codec_data:1; + guint has_entrypoint:1; + guint size_changed:1; + guint profile_changed:1; + guint closed_entry:1; + guint broken_link:1; }; /** @@ -80,10 +81,11 @@ * * A decoder based on VC1. */ -struct _GstVaapiDecoderVC1 { - /*< private >*/ - GstVaapiDecoder parent_instance; - GstVaapiDecoderVC1Private priv; +struct _GstVaapiDecoderVC1 +{ + /*< private > */ + GstVaapiDecoder parent_instance; + GstVaapiDecoderVC1Private priv; }; /** @@ -91,1339 +93,1342 @@ * * A decoder class based on VC1. */ -struct _GstVaapiDecoderVC1Class { - /*< private >*/ - GstVaapiDecoderClass parent_class; +struct _GstVaapiDecoderVC1Class +{ + /*< private > */ + GstVaapiDecoderClass parent_class; }; static GstVaapiDecoderStatus -get_status(GstVC1ParserResult result) +get_status (GstVC1ParserResult result) { - GstVaapiDecoderStatus status; + GstVaapiDecoderStatus status; - switch (result) { + switch (result) { case GST_VC1_PARSER_OK: - status = GST_VAAPI_DECODER_STATUS_SUCCESS; - break; + status = GST_VAAPI_DECODER_STATUS_SUCCESS; + break; case GST_VC1_PARSER_NO_BDU_END: - status = GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - break; + status = GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + break; case GST_VC1_PARSER_ERROR: - status = GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - break; + status = GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + break; default: - status = GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - break; - } - return status; + status = GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + break; + } + return status; } static void -gst_vaapi_decoder_vc1_close(GstVaapiDecoderVC1 *decoder) +gst_vaapi_decoder_vc1_close (GstVaapiDecoderVC1 * decoder) { - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - - gst_vaapi_picture_replace(&priv->last_non_b_picture, NULL); - gst_vaapi_picture_replace(&priv->current_picture, NULL); - gst_vaapi_dpb_replace(&priv->dpb, NULL); + GstVaapiDecoderVC1Private *const priv = &decoder->priv; - if (priv->bitplanes) { - gst_vc1_bitplanes_free(priv->bitplanes); - priv->bitplanes = NULL; - } + gst_vaapi_picture_replace (&priv->last_non_b_picture, NULL); + gst_vaapi_picture_replace (&priv->current_picture, NULL); + gst_vaapi_dpb_replace (&priv->dpb, NULL); + + if (priv->bitplanes) { + gst_vc1_bitplanes_free (priv->bitplanes); + priv->bitplanes = NULL; + } } static gboolean -gst_vaapi_decoder_vc1_open(GstVaapiDecoderVC1 *decoder) +gst_vaapi_decoder_vc1_open (GstVaapiDecoderVC1 * decoder) { - GstVaapiDecoderVC1Private * const priv = &decoder->priv; + GstVaapiDecoderVC1Private *const priv = &decoder->priv; - gst_vaapi_decoder_vc1_close(decoder); + gst_vaapi_decoder_vc1_close (decoder); - priv->dpb = gst_vaapi_dpb_new(2); - if (!priv->dpb) - return FALSE; + priv->dpb = gst_vaapi_dpb_new (2); + if (!priv->dpb) + return FALSE; - priv->bitplanes = gst_vc1_bitplanes_new(); - if (!priv->bitplanes) - return FALSE; - return TRUE; + priv->bitplanes = gst_vc1_bitplanes_new (); + if (!priv->bitplanes) + return FALSE; + return TRUE; } static void -gst_vaapi_decoder_vc1_destroy(GstVaapiDecoder *base_decoder) +gst_vaapi_decoder_vc1_destroy (GstVaapiDecoder * base_decoder) { - GstVaapiDecoderVC1 * const decoder = - GST_VAAPI_DECODER_VC1_CAST(base_decoder); - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - - gst_vaapi_decoder_vc1_close(decoder); - - if (priv->rbdu_buffer) { - g_free(priv->rbdu_buffer); - priv->rbdu_buffer = NULL; - priv->rbdu_buffer_size = 0; - } + GstVaapiDecoderVC1 *const decoder = GST_VAAPI_DECODER_VC1_CAST (base_decoder); + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + + gst_vaapi_decoder_vc1_close (decoder); + + if (priv->rbdu_buffer) { + g_free (priv->rbdu_buffer); + priv->rbdu_buffer = NULL; + priv->rbdu_buffer_size = 0; + } } static gboolean -gst_vaapi_decoder_vc1_create(GstVaapiDecoder *base_decoder) +gst_vaapi_decoder_vc1_create (GstVaapiDecoder * base_decoder) { - GstVaapiDecoderVC1 * const decoder = - GST_VAAPI_DECODER_VC1_CAST(base_decoder); - GstVaapiDecoderVC1Private * const priv = &decoder->priv; + GstVaapiDecoderVC1 *const decoder = GST_VAAPI_DECODER_VC1_CAST (base_decoder); + GstVaapiDecoderVC1Private *const priv = &decoder->priv; - priv->profile = (GstVaapiProfile)0; - priv->rndctrl = 0; - return TRUE; + priv->profile = (GstVaapiProfile) 0; + priv->rndctrl = 0; + return TRUE; } static GstVaapiDecoderStatus -ensure_context(GstVaapiDecoderVC1 *decoder) +ensure_context (GstVaapiDecoderVC1 * decoder) { - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - GstVaapiProfile profiles[2]; - GstVaapiEntrypoint entrypoint = GST_VAAPI_ENTRYPOINT_VLD; - guint i, n_profiles = 0; - gboolean reset_context = FALSE; - - if (priv->profile_changed) { - GST_DEBUG("profile changed"); - priv->profile_changed = FALSE; - reset_context = TRUE; - - profiles[n_profiles++] = priv->profile; - if (priv->profile == GST_VAAPI_PROFILE_VC1_SIMPLE) - profiles[n_profiles++] = GST_VAAPI_PROFILE_VC1_MAIN; - - for (i = 0; i < n_profiles; i++) { - if (gst_vaapi_display_has_decoder(GST_VAAPI_DECODER_DISPLAY(decoder), - profiles[i], entrypoint)) - break; - } - if (i == n_profiles) - return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; - priv->profile = profiles[i]; - } - - if (priv->size_changed) { - GST_DEBUG("size changed"); - priv->size_changed = FALSE; - reset_context = TRUE; - } - - if (reset_context) { - GstVaapiContextInfo info; - - info.profile = priv->profile; - info.entrypoint = entrypoint; - info.chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420; - info.width = priv->width; - info.height = priv->height; - info.ref_frames = 2; - reset_context = gst_vaapi_decoder_ensure_context( - GST_VAAPI_DECODER(decoder), - &info - ); - if (!reset_context) - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - } - return GST_VAAPI_DECODER_STATUS_SUCCESS; + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + GstVaapiProfile profiles[2]; + GstVaapiEntrypoint entrypoint = GST_VAAPI_ENTRYPOINT_VLD; + guint i, n_profiles = 0; + gboolean reset_context = FALSE; + + if (priv->profile_changed) { + GST_DEBUG ("profile changed"); + priv->profile_changed = FALSE; + reset_context = TRUE; + + profiles[n_profiles++] = priv->profile; + if (priv->profile == GST_VAAPI_PROFILE_VC1_SIMPLE) + profiles[n_profiles++] = GST_VAAPI_PROFILE_VC1_MAIN; + + for (i = 0; i < n_profiles; i++) { + if (gst_vaapi_display_has_decoder (GST_VAAPI_DECODER_DISPLAY (decoder), + profiles[i], entrypoint)) + break; + } + if (i == n_profiles) + return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; + priv->profile = profiles[i]; + } + + if (priv->size_changed) { + GST_DEBUG ("size changed"); + priv->size_changed = FALSE; + reset_context = TRUE; + } + + if (reset_context) { + GstVaapiContextInfo info; + + info.profile = priv->profile; + info.entrypoint = entrypoint; + info.chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420; + info.width = priv->width; + info.height = priv->height; + info.ref_frames = 2; + reset_context = + gst_vaapi_decoder_ensure_context (GST_VAAPI_DECODER (decoder), &info); + if (!reset_context) + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + } + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_current_picture(GstVaapiDecoderVC1 *decoder) +decode_current_picture (GstVaapiDecoderVC1 * decoder) { - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - GstVaapiPicture * const picture = priv->current_picture; - - if (!picture) - return GST_VAAPI_DECODER_STATUS_SUCCESS; + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + GstVaapiPicture *const picture = priv->current_picture; - if (!gst_vaapi_picture_decode(picture)) - goto error; - if (GST_VAAPI_PICTURE_IS_COMPLETE(picture)) { - if (!gst_vaapi_dpb_add(priv->dpb, picture)) - goto error; - gst_vaapi_picture_replace(&priv->current_picture, NULL); - } + if (!picture) return GST_VAAPI_DECODER_STATUS_SUCCESS; + if (!gst_vaapi_picture_decode (picture)) + goto error; + if (GST_VAAPI_PICTURE_IS_COMPLETE (picture)) { + if (!gst_vaapi_dpb_add (priv->dpb, picture)) + goto error; + gst_vaapi_picture_replace (&priv->current_picture, NULL); + } + return GST_VAAPI_DECODER_STATUS_SUCCESS; + error: - /* XXX: fix for cases where first field failed to be decoded */ - gst_vaapi_picture_replace(&priv->current_picture, NULL); - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + /* XXX: fix for cases where first field failed to be decoded */ + gst_vaapi_picture_replace (&priv->current_picture, NULL); + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; } static GstVaapiDecoderStatus -decode_sequence(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu) +decode_sequence (GstVaapiDecoderVC1 * decoder, GstVC1BDU * rbdu, + GstVC1BDU * ebdu) { - GstVaapiDecoder * const base_decoder = GST_VAAPI_DECODER(decoder); - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - GstVC1SeqHdr * const seq_hdr = &priv->seq_hdr; - GstVC1AdvancedSeqHdr * const adv_hdr = &seq_hdr->advanced; - GstVC1SeqStructC * const structc = &seq_hdr->struct_c; - GstVC1ParserResult result; - GstVaapiProfile profile; - guint width, height, fps_n, fps_d, par_n, par_d; - - result = gst_vc1_parse_sequence_header( - rbdu->data + rbdu->offset, - rbdu->size, - seq_hdr - ); - if (result != GST_VC1_PARSER_OK) { - GST_ERROR("failed to parse sequence layer"); - return get_status(result); - } + GstVaapiDecoder *const base_decoder = GST_VAAPI_DECODER (decoder); + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + GstVC1SeqHdr *const seq_hdr = &priv->seq_hdr; + GstVC1AdvancedSeqHdr *const adv_hdr = &seq_hdr->advanced; + GstVC1SeqStructC *const structc = &seq_hdr->struct_c; + GstVC1ParserResult result; + GstVaapiProfile profile; + guint width, height, fps_n, fps_d, par_n, par_d; + + result = gst_vc1_parse_sequence_header (rbdu->data + rbdu->offset, + rbdu->size, seq_hdr); + if (result != GST_VC1_PARSER_OK) { + GST_ERROR ("failed to parse sequence layer"); + return get_status (result); + } + + priv->has_entrypoint = FALSE; + + /* Reset POC */ + if (priv->last_non_b_picture) { + if (priv->last_non_b_picture->poc == priv->next_poc) + priv->next_poc++; + gst_vaapi_picture_replace (&priv->last_non_b_picture, NULL); + } - priv->has_entrypoint = FALSE; - - /* Reset POC */ - if (priv->last_non_b_picture) { - if (priv->last_non_b_picture->poc == priv->next_poc) - priv->next_poc++; - gst_vaapi_picture_replace(&priv->last_non_b_picture, NULL); - } - - /* Validate profile */ - switch (seq_hdr->profile) { + /* Validate profile */ + switch (seq_hdr->profile) { case GST_VC1_PROFILE_SIMPLE: case GST_VC1_PROFILE_MAIN: case GST_VC1_PROFILE_ADVANCED: - break; + break; default: - GST_ERROR("unsupported profile %d", seq_hdr->profile); - return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; - } - - fps_n = 0; - fps_d = 0; - par_n = 0; - par_d = 0; - switch (seq_hdr->profile) { + GST_ERROR ("unsupported profile %d", seq_hdr->profile); + return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; + } + + fps_n = 0; + fps_d = 0; + par_n = 0; + par_d = 0; + switch (seq_hdr->profile) { case GST_VC1_PROFILE_SIMPLE: case GST_VC1_PROFILE_MAIN: - if (structc->wmvp) { - fps_n = structc->framerate; - fps_d = 1; - } - break; + if (structc->wmvp) { + fps_n = structc->framerate; + fps_d = 1; + } + break; case GST_VC1_PROFILE_ADVANCED: - fps_n = adv_hdr->fps_n; - fps_d = adv_hdr->fps_d; - par_n = adv_hdr->par_n; - par_d = adv_hdr->par_d; - break; + fps_n = adv_hdr->fps_n; + fps_d = adv_hdr->fps_d; + par_n = adv_hdr->par_n; + par_d = adv_hdr->par_d; + break; default: - g_assert(0 && "XXX: we already validated the profile above"); - break; - } - - if (fps_n && fps_d) - gst_vaapi_decoder_set_framerate(base_decoder, fps_n, fps_d); - - if (par_n > 0 && par_d > 0) - gst_vaapi_decoder_set_pixel_aspect_ratio(base_decoder, par_n, par_d); - - switch (seq_hdr->profile) { + g_assert (0 && "XXX: we already validated the profile above"); + break; + } + + if (fps_n && fps_d) + gst_vaapi_decoder_set_framerate (base_decoder, fps_n, fps_d); + + if (par_n > 0 && par_d > 0) + gst_vaapi_decoder_set_pixel_aspect_ratio (base_decoder, par_n, par_d); + + width = 0; + height = 0; + switch (seq_hdr->profile) { case GST_VC1_PROFILE_SIMPLE: case GST_VC1_PROFILE_MAIN: - width = seq_hdr->struct_c.coded_width; - height = seq_hdr->struct_c.coded_height; - break; + width = seq_hdr->struct_c.coded_width; + height = seq_hdr->struct_c.coded_height; + break; case GST_VC1_PROFILE_ADVANCED: - width = seq_hdr->advanced.max_coded_width; - height = seq_hdr->advanced.max_coded_height; - break; + width = seq_hdr->advanced.max_coded_width; + height = seq_hdr->advanced.max_coded_height; + break; default: - g_assert(0 && "XXX: we already validated the profile above"); - break; - } - - if (priv->width != width) { - priv->width = width; - priv->size_changed = TRUE; - } + g_assert (0 && "XXX: we already validated the profile above"); + break; + } + + if (priv->width != width) { + priv->width = width; + priv->size_changed = TRUE; + } + + if (priv->height != height) { + priv->height = height; + priv->size_changed = TRUE; + } - if (priv->height != height) { - priv->height = height; - priv->size_changed = TRUE; - } - - switch (seq_hdr->profile) { + profile = GST_VAAPI_PROFILE_UNKNOWN; + switch (seq_hdr->profile) { case GST_VC1_PROFILE_SIMPLE: - profile = GST_VAAPI_PROFILE_VC1_SIMPLE; - break; + profile = GST_VAAPI_PROFILE_VC1_SIMPLE; + break; case GST_VC1_PROFILE_MAIN: - profile = GST_VAAPI_PROFILE_VC1_MAIN; - break; + profile = GST_VAAPI_PROFILE_VC1_MAIN; + break; case GST_VC1_PROFILE_ADVANCED: - profile = GST_VAAPI_PROFILE_VC1_ADVANCED; - break; + profile = GST_VAAPI_PROFILE_VC1_ADVANCED; + break; default: - g_assert(0 && "XXX: we already validated the profile above"); - break; - } - if (priv->profile != profile) { - priv->profile = profile; - priv->profile_changed = TRUE; - } - return GST_VAAPI_DECODER_STATUS_SUCCESS; + g_assert (0 && "XXX: we already validated the profile above"); + break; + } + if (priv->profile != profile) { + priv->profile = profile; + priv->profile_changed = TRUE; + } + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_sequence_end(GstVaapiDecoderVC1 *decoder) +decode_sequence_end (GstVaapiDecoderVC1 * decoder) { - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - GstVaapiDecoderStatus status; + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + GstVaapiDecoderStatus status; - status = decode_current_picture(decoder); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; + status = decode_current_picture (decoder); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; - gst_vaapi_dpb_flush(priv->dpb); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + gst_vaapi_dpb_flush (priv->dpb); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_entry_point(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu) +decode_entry_point (GstVaapiDecoderVC1 * decoder, GstVC1BDU * rbdu, + GstVC1BDU * ebdu) { - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - GstVC1SeqHdr * const seq_hdr = &priv->seq_hdr; - GstVC1EntryPointHdr * const entrypoint_hdr = &priv->entrypoint_hdr; - GstVC1ParserResult result; - - result = gst_vc1_parse_entry_point_header( - rbdu->data + rbdu->offset, - rbdu->size, - entrypoint_hdr, - seq_hdr - ); - if (result != GST_VC1_PARSER_OK) { - GST_ERROR("failed to parse entrypoint layer"); - return get_status(result); - } - - if (entrypoint_hdr->coded_size_flag) { - priv->width = entrypoint_hdr->coded_width; - priv->height = entrypoint_hdr->coded_height; - priv->size_changed = TRUE; - } - - priv->has_entrypoint = TRUE; - priv->closed_entry = entrypoint_hdr->closed_entry; - priv->broken_link = entrypoint_hdr->broken_link; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + GstVC1SeqHdr *const seq_hdr = &priv->seq_hdr; + GstVC1EntryPointHdr *const entrypoint_hdr = &priv->entrypoint_hdr; + GstVC1ParserResult result; + + result = gst_vc1_parse_entry_point_header (rbdu->data + rbdu->offset, + rbdu->size, entrypoint_hdr, seq_hdr); + if (result != GST_VC1_PARSER_OK) { + GST_ERROR ("failed to parse entrypoint layer"); + return get_status (result); + } + + if (entrypoint_hdr->coded_size_flag) { + priv->width = entrypoint_hdr->coded_width; + priv->height = entrypoint_hdr->coded_height; + priv->size_changed = TRUE; + } + + priv->has_entrypoint = TRUE; + priv->closed_entry = entrypoint_hdr->closed_entry; + priv->broken_link = entrypoint_hdr->broken_link; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } /* Reconstruct bitstream PTYPE (7.1.1.4, index into Table-35) */ static guint -get_PTYPE(guint ptype) +get_PTYPE (guint ptype) { - switch (ptype) { - case GST_VC1_PICTURE_TYPE_I: return 0; - case GST_VC1_PICTURE_TYPE_P: return 1; - case GST_VC1_PICTURE_TYPE_B: return 2; - case GST_VC1_PICTURE_TYPE_BI: return 3; - } - return 4; /* skipped P-frame */ + switch (ptype) { + case GST_VC1_PICTURE_TYPE_I: + return 0; + case GST_VC1_PICTURE_TYPE_P: + return 1; + case GST_VC1_PICTURE_TYPE_B: + return 2; + case GST_VC1_PICTURE_TYPE_BI: + return 3; + } + return 4; /* skipped P-frame */ } /* Reconstruct bitstream BFRACTION (7.1.1.14, index into Table-40) */ static guint -get_BFRACTION(guint bfraction) +get_BFRACTION (guint bfraction) { - guint i; + guint i; - static const struct { - guint16 index; - guint16 value; - } - bfraction_map[] = { - { 0, GST_VC1_BFRACTION_BASIS / 2 }, - { 1, GST_VC1_BFRACTION_BASIS / 3 }, - { 2, (GST_VC1_BFRACTION_BASIS * 2) / 3 }, - { 3, GST_VC1_BFRACTION_BASIS / 4 }, - { 4, (GST_VC1_BFRACTION_BASIS * 3) / 4 }, - { 5, GST_VC1_BFRACTION_BASIS / 5 }, - { 6, (GST_VC1_BFRACTION_BASIS * 2) / 5 }, - { 7, (GST_VC1_BFRACTION_BASIS * 3) / 5 }, - { 8, (GST_VC1_BFRACTION_BASIS * 4) / 5 }, - { 9, GST_VC1_BFRACTION_BASIS / 6 }, - { 10, (GST_VC1_BFRACTION_BASIS * 5) / 6 }, - { 11, GST_VC1_BFRACTION_BASIS / 7 }, - { 12, (GST_VC1_BFRACTION_BASIS * 2) / 7 }, - { 13, (GST_VC1_BFRACTION_BASIS * 3) / 7 }, - { 14, (GST_VC1_BFRACTION_BASIS * 4) / 7 }, - { 15, (GST_VC1_BFRACTION_BASIS * 5) / 7 }, - { 16, (GST_VC1_BFRACTION_BASIS * 6) / 7 }, - { 17, GST_VC1_BFRACTION_BASIS / 8 }, - { 18, (GST_VC1_BFRACTION_BASIS * 3) / 8 }, - { 19, (GST_VC1_BFRACTION_BASIS * 5) / 8 }, - { 20, (GST_VC1_BFRACTION_BASIS * 7) / 8 }, - { 21, GST_VC1_BFRACTION_RESERVED }, - { 22, GST_VC1_BFRACTION_PTYPE_BI } - }; - - if (!bfraction) - return 0; - - for (i = 0; i < G_N_ELEMENTS(bfraction_map); i++) { - if (bfraction_map[i].value == bfraction) - return bfraction_map[i].index; - } - return 21; /* RESERVED */ + static const struct + { + guint16 index; + guint16 value; + } + bfraction_map[] = { + { + 0, GST_VC1_BFRACTION_BASIS / 2}, { + 1, GST_VC1_BFRACTION_BASIS / 3}, { + 2, (GST_VC1_BFRACTION_BASIS * 2) / 3}, { + 3, GST_VC1_BFRACTION_BASIS / 4}, { + 4, (GST_VC1_BFRACTION_BASIS * 3) / 4}, { + 5, GST_VC1_BFRACTION_BASIS / 5}, { + 6, (GST_VC1_BFRACTION_BASIS * 2) / 5}, { + 7, (GST_VC1_BFRACTION_BASIS * 3) / 5}, { + 8, (GST_VC1_BFRACTION_BASIS * 4) / 5}, { + 9, GST_VC1_BFRACTION_BASIS / 6}, { + 10, (GST_VC1_BFRACTION_BASIS * 5) / 6}, { + 11, GST_VC1_BFRACTION_BASIS / 7}, { + 12, (GST_VC1_BFRACTION_BASIS * 2) / 7}, { + 13, (GST_VC1_BFRACTION_BASIS * 3) / 7}, { + 14, (GST_VC1_BFRACTION_BASIS * 4) / 7}, { + 15, (GST_VC1_BFRACTION_BASIS * 5) / 7}, { + 16, (GST_VC1_BFRACTION_BASIS * 6) / 7}, { + 17, GST_VC1_BFRACTION_BASIS / 8}, { + 18, (GST_VC1_BFRACTION_BASIS * 3) / 8}, { + 19, (GST_VC1_BFRACTION_BASIS * 5) / 8}, { + 20, (GST_VC1_BFRACTION_BASIS * 7) / 8}, { + 21, GST_VC1_BFRACTION_RESERVED}, { + 22, GST_VC1_BFRACTION_PTYPE_BI} + }; + + if (!bfraction) + return 0; + + for (i = 0; i < G_N_ELEMENTS (bfraction_map); i++) { + if (bfraction_map[i].value == bfraction) + return bfraction_map[i].index; + } + return 21; /* RESERVED */ } /* Translate GStreamer MV modes to VA-API */ static guint -get_VAMvModeVC1(guint mvmode) +get_VAMvModeVC1 (guint mvmode) { - switch (mvmode) { - case GST_VC1_MVMODE_1MV_HPEL_BILINEAR: return VAMvMode1MvHalfPelBilinear; - case GST_VC1_MVMODE_1MV: return VAMvMode1Mv; - case GST_VC1_MVMODE_1MV_HPEL: return VAMvMode1MvHalfPel; - case GST_VC1_MVMODE_MIXED_MV: return VAMvModeMixedMv; - case GST_VC1_MVMODE_INTENSITY_COMP: return VAMvModeIntensityCompensation; - } - return 0; + switch (mvmode) { + case GST_VC1_MVMODE_1MV_HPEL_BILINEAR: + return VAMvMode1MvHalfPelBilinear; + case GST_VC1_MVMODE_1MV: + return VAMvMode1Mv; + case GST_VC1_MVMODE_1MV_HPEL: + return VAMvMode1MvHalfPel; + case GST_VC1_MVMODE_MIXED_MV: + return VAMvModeMixedMv; + case GST_VC1_MVMODE_INTENSITY_COMP: + return VAMvModeIntensityCompensation; + } + return 0; } /* Reconstruct bitstream MVMODE (7.1.1.32) */ static guint -get_MVMODE(GstVC1FrameHdr *frame_hdr) +get_MVMODE (GstVC1FrameHdr * frame_hdr) { - guint mvmode; - - if (frame_hdr->profile == GST_VC1_PROFILE_ADVANCED) - mvmode = frame_hdr->pic.advanced.mvmode; - else - mvmode = frame_hdr->pic.simple.mvmode; + guint mvmode; - if (frame_hdr->ptype == GST_VC1_PICTURE_TYPE_P || - frame_hdr->ptype == GST_VC1_PICTURE_TYPE_B) - return get_VAMvModeVC1(mvmode); - return 0; + if (frame_hdr->profile == GST_VC1_PROFILE_ADVANCED) + mvmode = frame_hdr->pic.advanced.mvmode; + else + mvmode = frame_hdr->pic.simple.mvmode; + + if (frame_hdr->ptype == GST_VC1_PICTURE_TYPE_P || + frame_hdr->ptype == GST_VC1_PICTURE_TYPE_B) + return get_VAMvModeVC1 (mvmode); + return 0; } /* Reconstruct bitstream MVMODE2 (7.1.1.33) */ static guint -get_MVMODE2(GstVC1FrameHdr *frame_hdr) +get_MVMODE2 (GstVC1FrameHdr * frame_hdr) { - guint mvmode, mvmode2; - - if (frame_hdr->profile == GST_VC1_PROFILE_ADVANCED) { - mvmode = frame_hdr->pic.advanced.mvmode; - mvmode2 = frame_hdr->pic.advanced.mvmode2; - } - else { - mvmode = frame_hdr->pic.simple.mvmode; - mvmode2 = frame_hdr->pic.simple.mvmode2; - } + guint mvmode, mvmode2; - if (frame_hdr->ptype == GST_VC1_PICTURE_TYPE_P && - mvmode == GST_VC1_MVMODE_INTENSITY_COMP) - return get_VAMvModeVC1(mvmode2); - return 0; + if (frame_hdr->profile == GST_VC1_PROFILE_ADVANCED) { + mvmode = frame_hdr->pic.advanced.mvmode; + mvmode2 = frame_hdr->pic.advanced.mvmode2; + } else { + mvmode = frame_hdr->pic.simple.mvmode; + mvmode2 = frame_hdr->pic.simple.mvmode2; + } + + if (frame_hdr->ptype == GST_VC1_PICTURE_TYPE_P && + mvmode == GST_VC1_MVMODE_INTENSITY_COMP) + return get_VAMvModeVC1 (mvmode2); + return 0; } static inline int -has_MVTYPEMB_bitplane(GstVaapiDecoderVC1 *decoder) +has_MVTYPEMB_bitplane (GstVaapiDecoderVC1 * decoder) { - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - GstVC1SeqHdr * const seq_hdr = &priv->seq_hdr; - GstVC1FrameHdr * const frame_hdr = &priv->frame_hdr; - guint mvmode, mvmode2; - - if (seq_hdr->profile == GST_VC1_PROFILE_ADVANCED) { - GstVC1PicAdvanced * const pic = &frame_hdr->pic.advanced; - if (pic->mvtypemb) - return 0; - mvmode = pic->mvmode; - mvmode2 = pic->mvmode2; - } - else { - GstVC1PicSimpleMain * const pic = &frame_hdr->pic.simple; - if (pic->mvtypemb) - return 0; - mvmode = pic->mvmode; - mvmode2 = pic->mvmode2; - } - return (frame_hdr->ptype == GST_VC1_PICTURE_TYPE_P && - (mvmode == GST_VC1_MVMODE_MIXED_MV || - (mvmode == GST_VC1_MVMODE_INTENSITY_COMP && + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + GstVC1SeqHdr *const seq_hdr = &priv->seq_hdr; + GstVC1FrameHdr *const frame_hdr = &priv->frame_hdr; + guint mvmode, mvmode2; + + if (seq_hdr->profile == GST_VC1_PROFILE_ADVANCED) { + GstVC1PicAdvanced *const pic = &frame_hdr->pic.advanced; + if (pic->mvtypemb) + return 0; + mvmode = pic->mvmode; + mvmode2 = pic->mvmode2; + } else { + GstVC1PicSimpleMain *const pic = &frame_hdr->pic.simple; + if (pic->mvtypemb) + return 0; + mvmode = pic->mvmode; + mvmode2 = pic->mvmode2; + } + return (frame_hdr->ptype == GST_VC1_PICTURE_TYPE_P && + (mvmode == GST_VC1_MVMODE_MIXED_MV || + (mvmode == GST_VC1_MVMODE_INTENSITY_COMP && mvmode2 == GST_VC1_MVMODE_MIXED_MV))); } static inline int -has_SKIPMB_bitplane(GstVaapiDecoderVC1 *decoder) +has_SKIPMB_bitplane (GstVaapiDecoderVC1 * decoder) { - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - GstVC1SeqHdr * const seq_hdr = &priv->seq_hdr; - GstVC1FrameHdr * const frame_hdr = &priv->frame_hdr; - - if (seq_hdr->profile == GST_VC1_PROFILE_ADVANCED) { - GstVC1PicAdvanced * const pic = &frame_hdr->pic.advanced; - if (pic->skipmb) - return 0; - } - else { - GstVC1PicSimpleMain * const pic = &frame_hdr->pic.simple; - if (pic->skipmb) - return 0; - } - return (frame_hdr->ptype == GST_VC1_PICTURE_TYPE_P || - frame_hdr->ptype == GST_VC1_PICTURE_TYPE_B); + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + GstVC1SeqHdr *const seq_hdr = &priv->seq_hdr; + GstVC1FrameHdr *const frame_hdr = &priv->frame_hdr; + + if (seq_hdr->profile == GST_VC1_PROFILE_ADVANCED) { + GstVC1PicAdvanced *const pic = &frame_hdr->pic.advanced; + if (pic->skipmb) + return 0; + } else { + GstVC1PicSimpleMain *const pic = &frame_hdr->pic.simple; + if (pic->skipmb) + return 0; + } + return (frame_hdr->ptype == GST_VC1_PICTURE_TYPE_P || + frame_hdr->ptype == GST_VC1_PICTURE_TYPE_B); } static inline int -has_DIRECTMB_bitplane(GstVaapiDecoderVC1 *decoder) +has_DIRECTMB_bitplane (GstVaapiDecoderVC1 * decoder) { - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - GstVC1SeqHdr * const seq_hdr = &priv->seq_hdr; - GstVC1FrameHdr * const frame_hdr = &priv->frame_hdr; - - if (seq_hdr->profile == GST_VC1_PROFILE_ADVANCED) { - GstVC1PicAdvanced * const pic = &frame_hdr->pic.advanced; - if (pic->directmb) - return 0; - } - else { - GstVC1PicSimpleMain * const pic = &frame_hdr->pic.simple; - if (pic->directmb) - return 0; - } - return frame_hdr->ptype == GST_VC1_PICTURE_TYPE_B; + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + GstVC1SeqHdr *const seq_hdr = &priv->seq_hdr; + GstVC1FrameHdr *const frame_hdr = &priv->frame_hdr; + + if (seq_hdr->profile == GST_VC1_PROFILE_ADVANCED) { + GstVC1PicAdvanced *const pic = &frame_hdr->pic.advanced; + if (pic->directmb) + return 0; + } else { + GstVC1PicSimpleMain *const pic = &frame_hdr->pic.simple; + if (pic->directmb) + return 0; + } + return frame_hdr->ptype == GST_VC1_PICTURE_TYPE_B; } static inline int -has_ACPRED_bitplane(GstVaapiDecoderVC1 *decoder) +has_ACPRED_bitplane (GstVaapiDecoderVC1 * decoder) { - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - GstVC1SeqHdr * const seq_hdr = &priv->seq_hdr; - GstVC1FrameHdr * const frame_hdr = &priv->frame_hdr; - GstVC1PicAdvanced * const pic = &frame_hdr->pic.advanced; - - if (seq_hdr->profile != GST_VC1_PROFILE_ADVANCED) - return 0; - if (pic->acpred) - return 0; - return (frame_hdr->ptype == GST_VC1_PICTURE_TYPE_I || - frame_hdr->ptype == GST_VC1_PICTURE_TYPE_BI); + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + GstVC1SeqHdr *const seq_hdr = &priv->seq_hdr; + GstVC1FrameHdr *const frame_hdr = &priv->frame_hdr; + GstVC1PicAdvanced *const pic = &frame_hdr->pic.advanced; + + if (seq_hdr->profile != GST_VC1_PROFILE_ADVANCED) + return 0; + if (pic->acpred) + return 0; + return (frame_hdr->ptype == GST_VC1_PICTURE_TYPE_I || + frame_hdr->ptype == GST_VC1_PICTURE_TYPE_BI); } static inline int -has_OVERFLAGS_bitplane(GstVaapiDecoderVC1 *decoder) +has_OVERFLAGS_bitplane (GstVaapiDecoderVC1 * decoder) { - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - GstVC1SeqHdr * const seq_hdr = &priv->seq_hdr; - GstVC1EntryPointHdr * const entrypoint_hdr = &priv->entrypoint_hdr; - GstVC1FrameHdr * const frame_hdr = &priv->frame_hdr; - GstVC1PicAdvanced * const pic = &frame_hdr->pic.advanced; - - if (seq_hdr->profile != GST_VC1_PROFILE_ADVANCED) - return 0; - if (pic->overflags) - return 0; - return ((frame_hdr->ptype == GST_VC1_PICTURE_TYPE_I || - frame_hdr->ptype == GST_VC1_PICTURE_TYPE_BI) && - (entrypoint_hdr->overlap && frame_hdr->pquant <= 8) && - pic->condover == GST_VC1_CONDOVER_SELECT); + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + GstVC1SeqHdr *const seq_hdr = &priv->seq_hdr; + GstVC1EntryPointHdr *const entrypoint_hdr = &priv->entrypoint_hdr; + GstVC1FrameHdr *const frame_hdr = &priv->frame_hdr; + GstVC1PicAdvanced *const pic = &frame_hdr->pic.advanced; + + if (seq_hdr->profile != GST_VC1_PROFILE_ADVANCED) + return 0; + if (pic->overflags) + return 0; + return ((frame_hdr->ptype == GST_VC1_PICTURE_TYPE_I || + frame_hdr->ptype == GST_VC1_PICTURE_TYPE_BI) && + (entrypoint_hdr->overlap && frame_hdr->pquant <= 8) && + pic->condover == GST_VC1_CONDOVER_SELECT); } static inline void -pack_bitplanes(GstVaapiBitPlane *bitplane, guint n, const guint8 *bitplanes[3], guint x, guint y, guint stride) +pack_bitplanes (GstVaapiBitPlane * bitplane, guint n, + const guint8 * bitplanes[3], guint x, guint y, guint stride) { - const guint dst_index = n / 2; - const guint src_index = y * stride + x; - guint8 v = 0; - - if (bitplanes[0]) - v |= bitplanes[0][src_index]; - if (bitplanes[1]) - v |= bitplanes[1][src_index] << 1; - if (bitplanes[2]) - v |= bitplanes[2][src_index] << 2; - bitplane->data[dst_index] = (bitplane->data[dst_index] << 4) | v; + const guint dst_index = n / 2; + const guint src_index = y * stride + x; + guint8 v = 0; + + if (bitplanes[0]) + v |= bitplanes[0][src_index]; + if (bitplanes[1]) + v |= bitplanes[1][src_index] << 1; + if (bitplanes[2]) + v |= bitplanes[2][src_index] << 2; + bitplane->data[dst_index] = (bitplane->data[dst_index] << 4) | v; } static gboolean -fill_picture_structc(GstVaapiDecoderVC1 *decoder, GstVaapiPicture *picture) +fill_picture_structc (GstVaapiDecoderVC1 * decoder, GstVaapiPicture * picture) { - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - VAPictureParameterBufferVC1 * const pic_param = picture->param; - GstVC1SeqStructC * const structc = &priv->seq_hdr.struct_c; - GstVC1FrameHdr * const frame_hdr = &priv->frame_hdr; - GstVC1PicSimpleMain * const pic = &frame_hdr->pic.simple; - - /* Fill in VAPictureParameterBufferVC1 (simple/main profile bits) */ - pic_param->sequence_fields.bits.finterpflag = structc->finterpflag; - pic_param->sequence_fields.bits.multires = structc->multires; - pic_param->sequence_fields.bits.overlap = structc->overlap; - pic_param->sequence_fields.bits.syncmarker = structc->syncmarker; - pic_param->sequence_fields.bits.rangered = structc->rangered; - pic_param->sequence_fields.bits.max_b_frames = structc->maxbframes; - pic_param->conditional_overlap_flag = 0; /* advanced profile only */ - pic_param->fast_uvmc_flag = structc->fastuvmc; - pic_param->b_picture_fraction = get_BFRACTION(pic->bfraction); - pic_param->cbp_table = pic->cbptab; - pic_param->mb_mode_table = 0; /* XXX: interlaced frame */ - pic_param->range_reduction_frame = pic->rangeredfrm; - pic_param->post_processing = 0; /* advanced profile only */ - pic_param->picture_resolution_index = pic->respic; - pic_param->luma_scale = pic->lumscale; - pic_param->luma_shift = pic->lumshift; - pic_param->raw_coding.flags.mv_type_mb = pic->mvtypemb; - pic_param->raw_coding.flags.direct_mb = pic->directmb; - pic_param->raw_coding.flags.skip_mb = pic->skipmb; - pic_param->bitplane_present.flags.bp_mv_type_mb = has_MVTYPEMB_bitplane(decoder); - pic_param->bitplane_present.flags.bp_direct_mb = has_DIRECTMB_bitplane(decoder); - pic_param->bitplane_present.flags.bp_skip_mb = has_SKIPMB_bitplane(decoder); - pic_param->mv_fields.bits.mv_table = pic->mvtab; - pic_param->mv_fields.bits.extended_mv_flag = structc->extended_mv; - pic_param->mv_fields.bits.extended_mv_range = pic->mvrange; - pic_param->transform_fields.bits.variable_sized_transform_flag = structc->vstransform; - pic_param->transform_fields.bits.mb_level_transform_type_flag = pic->ttmbf; - pic_param->transform_fields.bits.frame_level_transform_type = pic->ttfrm; - pic_param->transform_fields.bits.transform_ac_codingset_idx2 = pic->transacfrm2; - - /* Refer to 8.3.7 Rounding control for Simple and Main Profile */ - if (frame_hdr->ptype == GST_VC1_PICTURE_TYPE_I || - frame_hdr->ptype == GST_VC1_PICTURE_TYPE_BI) - priv->rndctrl = 1; - else if (frame_hdr->ptype == GST_VC1_PICTURE_TYPE_P) - priv->rndctrl ^= 1; + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + VAPictureParameterBufferVC1 *const pic_param = picture->param; + GstVC1SeqStructC *const structc = &priv->seq_hdr.struct_c; + GstVC1FrameHdr *const frame_hdr = &priv->frame_hdr; + GstVC1PicSimpleMain *const pic = &frame_hdr->pic.simple; + + /* Fill in VAPictureParameterBufferVC1 (simple/main profile bits) */ + pic_param->sequence_fields.bits.finterpflag = structc->finterpflag; + pic_param->sequence_fields.bits.multires = structc->multires; + pic_param->sequence_fields.bits.overlap = structc->overlap; + pic_param->sequence_fields.bits.syncmarker = structc->syncmarker; + pic_param->sequence_fields.bits.rangered = structc->rangered; + pic_param->sequence_fields.bits.max_b_frames = structc->maxbframes; + pic_param->conditional_overlap_flag = 0; /* advanced profile only */ + pic_param->fast_uvmc_flag = structc->fastuvmc; + pic_param->b_picture_fraction = get_BFRACTION (pic->bfraction); + pic_param->cbp_table = pic->cbptab; + pic_param->mb_mode_table = 0; /* XXX: interlaced frame */ + pic_param->range_reduction_frame = pic->rangeredfrm; + pic_param->post_processing = 0; /* advanced profile only */ + pic_param->picture_resolution_index = pic->respic; + pic_param->luma_scale = pic->lumscale; + pic_param->luma_shift = pic->lumshift; + pic_param->raw_coding.flags.mv_type_mb = pic->mvtypemb; + pic_param->raw_coding.flags.direct_mb = pic->directmb; + pic_param->raw_coding.flags.skip_mb = pic->skipmb; + pic_param->bitplane_present.flags.bp_mv_type_mb = + has_MVTYPEMB_bitplane (decoder); + pic_param->bitplane_present.flags.bp_direct_mb = + has_DIRECTMB_bitplane (decoder); + pic_param->bitplane_present.flags.bp_skip_mb = has_SKIPMB_bitplane (decoder); + pic_param->mv_fields.bits.mv_table = pic->mvtab; + pic_param->mv_fields.bits.extended_mv_flag = structc->extended_mv; + pic_param->mv_fields.bits.extended_mv_range = pic->mvrange; + pic_param->transform_fields.bits.variable_sized_transform_flag = + structc->vstransform; + pic_param->transform_fields.bits.mb_level_transform_type_flag = pic->ttmbf; + pic_param->transform_fields.bits.frame_level_transform_type = pic->ttfrm; + pic_param->transform_fields.bits.transform_ac_codingset_idx2 = + pic->transacfrm2; + + /* Refer to 8.3.7 Rounding control for Simple and Main Profile */ + if (frame_hdr->ptype == GST_VC1_PICTURE_TYPE_I || + frame_hdr->ptype == GST_VC1_PICTURE_TYPE_BI) + priv->rndctrl = 1; + else if (frame_hdr->ptype == GST_VC1_PICTURE_TYPE_P) + priv->rndctrl ^= 1; - pic_param->rounding_control = priv->rndctrl; + pic_param->rounding_control = priv->rndctrl; - return TRUE; + return TRUE; } static gboolean -fill_picture_advanced(GstVaapiDecoderVC1 *decoder, GstVaapiPicture *picture) +fill_picture_advanced (GstVaapiDecoderVC1 * decoder, GstVaapiPicture * picture) { - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - VAPictureParameterBufferVC1 * const pic_param = picture->param; - GstVC1AdvancedSeqHdr * const adv_hdr = &priv->seq_hdr.advanced; - GstVC1EntryPointHdr * const entrypoint_hdr = &priv->entrypoint_hdr; - GstVC1FrameHdr * const frame_hdr = &priv->frame_hdr; - GstVC1PicAdvanced * const pic = &frame_hdr->pic.advanced; - - if (!priv->has_entrypoint) - return FALSE; - - /* Fill in VAPictureParameterBufferVC1 (advanced profile bits) */ - pic_param->sequence_fields.bits.pulldown = adv_hdr->pulldown; - pic_param->sequence_fields.bits.interlace = adv_hdr->interlace; - pic_param->sequence_fields.bits.tfcntrflag = adv_hdr->tfcntrflag; - pic_param->sequence_fields.bits.finterpflag = adv_hdr->finterpflag; - pic_param->sequence_fields.bits.psf = adv_hdr->psf; - pic_param->sequence_fields.bits.overlap = entrypoint_hdr->overlap; - pic_param->entrypoint_fields.bits.broken_link = entrypoint_hdr->broken_link; - pic_param->entrypoint_fields.bits.closed_entry = entrypoint_hdr->closed_entry; - pic_param->entrypoint_fields.bits.panscan_flag = entrypoint_hdr->panscan_flag; - pic_param->entrypoint_fields.bits.loopfilter = entrypoint_hdr->loopfilter; - pic_param->conditional_overlap_flag = pic->condover; - pic_param->fast_uvmc_flag = entrypoint_hdr->fastuvmc; - pic_param->range_mapping_fields.bits.luma_flag = entrypoint_hdr->range_mapy_flag; - pic_param->range_mapping_fields.bits.luma = entrypoint_hdr->range_mapy; - pic_param->range_mapping_fields.bits.chroma_flag = entrypoint_hdr->range_mapuv_flag; - pic_param->range_mapping_fields.bits.chroma = entrypoint_hdr->range_mapuv; - pic_param->b_picture_fraction = get_BFRACTION(pic->bfraction); - pic_param->cbp_table = pic->cbptab; - pic_param->mb_mode_table = 0; /* XXX: interlaced frame */ - pic_param->range_reduction_frame = 0; /* simple/main profile only */ - pic_param->rounding_control = pic->rndctrl; - pic_param->post_processing = pic->postproc; - pic_param->picture_resolution_index = 0; /* simple/main profile only */ - pic_param->luma_scale = pic->lumscale; - pic_param->luma_shift = pic->lumshift; - pic_param->picture_fields.bits.frame_coding_mode = pic->fcm; - pic_param->picture_fields.bits.top_field_first = pic->tff; - pic_param->picture_fields.bits.is_first_field = pic->fcm == 0; /* XXX: interlaced frame */ - pic_param->picture_fields.bits.intensity_compensation = pic->mvmode == GST_VC1_MVMODE_INTENSITY_COMP; - pic_param->raw_coding.flags.mv_type_mb = pic->mvtypemb; - pic_param->raw_coding.flags.direct_mb = pic->directmb; - pic_param->raw_coding.flags.skip_mb = pic->skipmb; - pic_param->raw_coding.flags.ac_pred = pic->acpred; - pic_param->raw_coding.flags.overflags = pic->overflags; - pic_param->bitplane_present.flags.bp_mv_type_mb = has_MVTYPEMB_bitplane(decoder); - pic_param->bitplane_present.flags.bp_direct_mb = has_DIRECTMB_bitplane(decoder); - pic_param->bitplane_present.flags.bp_skip_mb = has_SKIPMB_bitplane(decoder); - pic_param->bitplane_present.flags.bp_ac_pred = has_ACPRED_bitplane(decoder); - pic_param->bitplane_present.flags.bp_overflags = has_OVERFLAGS_bitplane(decoder); - pic_param->reference_fields.bits.reference_distance_flag = entrypoint_hdr->refdist_flag; - pic_param->mv_fields.bits.mv_table = pic->mvtab; - pic_param->mv_fields.bits.extended_mv_flag = entrypoint_hdr->extended_mv; - pic_param->mv_fields.bits.extended_mv_range = pic->mvrange; - pic_param->mv_fields.bits.extended_dmv_flag = entrypoint_hdr->extended_dmv; - pic_param->pic_quantizer_fields.bits.dquant = entrypoint_hdr->dquant; - pic_param->pic_quantizer_fields.bits.quantizer = entrypoint_hdr->quantizer; - pic_param->transform_fields.bits.variable_sized_transform_flag = entrypoint_hdr->vstransform; - pic_param->transform_fields.bits.mb_level_transform_type_flag = pic->ttmbf; - pic_param->transform_fields.bits.frame_level_transform_type = pic->ttfrm; - pic_param->transform_fields.bits.transform_ac_codingset_idx2 = pic->transacfrm2; - return TRUE; + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + VAPictureParameterBufferVC1 *const pic_param = picture->param; + GstVC1AdvancedSeqHdr *const adv_hdr = &priv->seq_hdr.advanced; + GstVC1EntryPointHdr *const entrypoint_hdr = &priv->entrypoint_hdr; + GstVC1FrameHdr *const frame_hdr = &priv->frame_hdr; + GstVC1PicAdvanced *const pic = &frame_hdr->pic.advanced; + + if (!priv->has_entrypoint) + return FALSE; + + /* Fill in VAPictureParameterBufferVC1 (advanced profile bits) */ + pic_param->sequence_fields.bits.pulldown = adv_hdr->pulldown; + pic_param->sequence_fields.bits.interlace = adv_hdr->interlace; + pic_param->sequence_fields.bits.tfcntrflag = adv_hdr->tfcntrflag; + pic_param->sequence_fields.bits.finterpflag = adv_hdr->finterpflag; + pic_param->sequence_fields.bits.psf = adv_hdr->psf; + pic_param->sequence_fields.bits.overlap = entrypoint_hdr->overlap; + pic_param->entrypoint_fields.bits.broken_link = entrypoint_hdr->broken_link; + pic_param->entrypoint_fields.bits.closed_entry = entrypoint_hdr->closed_entry; + pic_param->entrypoint_fields.bits.panscan_flag = entrypoint_hdr->panscan_flag; + pic_param->entrypoint_fields.bits.loopfilter = entrypoint_hdr->loopfilter; + pic_param->conditional_overlap_flag = pic->condover; + pic_param->fast_uvmc_flag = entrypoint_hdr->fastuvmc; + pic_param->range_mapping_fields.bits.luma_flag = + entrypoint_hdr->range_mapy_flag; + pic_param->range_mapping_fields.bits.luma = entrypoint_hdr->range_mapy; + pic_param->range_mapping_fields.bits.chroma_flag = + entrypoint_hdr->range_mapuv_flag; + pic_param->range_mapping_fields.bits.chroma = entrypoint_hdr->range_mapuv; + pic_param->b_picture_fraction = get_BFRACTION (pic->bfraction); + pic_param->cbp_table = pic->cbptab; + pic_param->mb_mode_table = 0; /* XXX: interlaced frame */ + pic_param->range_reduction_frame = 0; /* simple/main profile only */ + pic_param->rounding_control = pic->rndctrl; + pic_param->post_processing = pic->postproc; + pic_param->picture_resolution_index = 0; /* simple/main profile only */ + pic_param->luma_scale = pic->lumscale; + pic_param->luma_shift = pic->lumshift; + pic_param->picture_fields.bits.frame_coding_mode = pic->fcm; + pic_param->picture_fields.bits.top_field_first = pic->tff; + pic_param->picture_fields.bits.is_first_field = pic->fcm == 0; /* XXX: interlaced frame */ + pic_param->picture_fields.bits.intensity_compensation = + pic->mvmode == GST_VC1_MVMODE_INTENSITY_COMP; + pic_param->raw_coding.flags.mv_type_mb = pic->mvtypemb; + pic_param->raw_coding.flags.direct_mb = pic->directmb; + pic_param->raw_coding.flags.skip_mb = pic->skipmb; + pic_param->raw_coding.flags.ac_pred = pic->acpred; + pic_param->raw_coding.flags.overflags = pic->overflags; + pic_param->bitplane_present.flags.bp_mv_type_mb = + has_MVTYPEMB_bitplane (decoder); + pic_param->bitplane_present.flags.bp_direct_mb = + has_DIRECTMB_bitplane (decoder); + pic_param->bitplane_present.flags.bp_skip_mb = has_SKIPMB_bitplane (decoder); + pic_param->bitplane_present.flags.bp_ac_pred = has_ACPRED_bitplane (decoder); + pic_param->bitplane_present.flags.bp_overflags = + has_OVERFLAGS_bitplane (decoder); + pic_param->reference_fields.bits.reference_distance_flag = + entrypoint_hdr->refdist_flag; + pic_param->mv_fields.bits.mv_table = pic->mvtab; + pic_param->mv_fields.bits.extended_mv_flag = entrypoint_hdr->extended_mv; + pic_param->mv_fields.bits.extended_mv_range = pic->mvrange; + pic_param->mv_fields.bits.extended_dmv_flag = entrypoint_hdr->extended_dmv; + pic_param->pic_quantizer_fields.bits.dquant = entrypoint_hdr->dquant; + pic_param->pic_quantizer_fields.bits.quantizer = entrypoint_hdr->quantizer; + pic_param->transform_fields.bits.variable_sized_transform_flag = + entrypoint_hdr->vstransform; + pic_param->transform_fields.bits.mb_level_transform_type_flag = pic->ttmbf; + pic_param->transform_fields.bits.frame_level_transform_type = pic->ttfrm; + pic_param->transform_fields.bits.transform_ac_codingset_idx2 = + pic->transacfrm2; + return TRUE; } static gboolean -fill_picture(GstVaapiDecoderVC1 *decoder, GstVaapiPicture *picture) +fill_picture (GstVaapiDecoderVC1 * decoder, GstVaapiPicture * picture) { - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - VAPictureParameterBufferVC1 * const pic_param = picture->param; - GstVC1SeqHdr * const seq_hdr = &priv->seq_hdr; - GstVC1FrameHdr * const frame_hdr = &priv->frame_hdr; - GstVC1VopDquant * const vopdquant = &frame_hdr->vopdquant; - GstVaapiPicture *prev_picture, *next_picture; - - /* Fill in VAPictureParameterBufferVC1 (common fields) */ - pic_param->forward_reference_picture = VA_INVALID_ID; - pic_param->backward_reference_picture = VA_INVALID_ID; - pic_param->inloop_decoded_picture = VA_INVALID_ID; - pic_param->sequence_fields.value = 0; + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + VAPictureParameterBufferVC1 *const pic_param = picture->param; + GstVC1SeqHdr *const seq_hdr = &priv->seq_hdr; + GstVC1FrameHdr *const frame_hdr = &priv->frame_hdr; + GstVC1VopDquant *const vopdquant = &frame_hdr->vopdquant; + GstVaapiPicture *prev_picture, *next_picture; + + /* Fill in VAPictureParameterBufferVC1 (common fields) */ + pic_param->forward_reference_picture = VA_INVALID_ID; + pic_param->backward_reference_picture = VA_INVALID_ID; + pic_param->inloop_decoded_picture = VA_INVALID_ID; + pic_param->sequence_fields.value = 0; #if VA_CHECK_VERSION(0,32,0) - pic_param->sequence_fields.bits.profile = seq_hdr->profile; + pic_param->sequence_fields.bits.profile = seq_hdr->profile; #endif - pic_param->coded_width = priv->width; - pic_param->coded_height = priv->height; - pic_param->entrypoint_fields.value = 0; - pic_param->range_mapping_fields.value = 0; - pic_param->picture_fields.value = 0; - pic_param->picture_fields.bits.picture_type = get_PTYPE(frame_hdr->ptype); - pic_param->raw_coding.value = 0; - pic_param->bitplane_present.value = 0; - pic_param->reference_fields.value = 0; - pic_param->mv_fields.value = 0; - pic_param->mv_fields.bits.mv_mode = get_MVMODE(frame_hdr); - pic_param->mv_fields.bits.mv_mode2 = get_MVMODE2(frame_hdr); - pic_param->pic_quantizer_fields.value = 0; - pic_param->pic_quantizer_fields.bits.half_qp = frame_hdr->halfqp; - pic_param->pic_quantizer_fields.bits.pic_quantizer_scale = frame_hdr->pquant; - pic_param->pic_quantizer_fields.bits.pic_quantizer_type = frame_hdr->pquantizer; - pic_param->pic_quantizer_fields.bits.dq_frame = vopdquant->dquantfrm; - pic_param->pic_quantizer_fields.bits.dq_profile = vopdquant->dqprofile; - pic_param->pic_quantizer_fields.bits.dq_sb_edge = vopdquant->dqprofile == GST_VC1_DQPROFILE_SINGLE_EDGE ? vopdquant->dqbedge : 0; - pic_param->pic_quantizer_fields.bits.dq_db_edge = vopdquant->dqprofile == GST_VC1_DQPROFILE_DOUBLE_EDGES ? vopdquant->dqbedge : 0; - pic_param->pic_quantizer_fields.bits.dq_binary_level = vopdquant->dqbilevel; - pic_param->pic_quantizer_fields.bits.alt_pic_quantizer = vopdquant->altpquant; - pic_param->transform_fields.value = 0; - pic_param->transform_fields.bits.transform_ac_codingset_idx1 = frame_hdr->transacfrm; - pic_param->transform_fields.bits.intra_transform_dc_table = frame_hdr->transdctab; - - if (seq_hdr->profile == GST_VC1_PROFILE_ADVANCED) { - if (!fill_picture_advanced(decoder, picture)) - return FALSE; - } - else { - if (!fill_picture_structc(decoder, picture)) - return FALSE; - } + pic_param->coded_width = priv->width; + pic_param->coded_height = priv->height; + pic_param->entrypoint_fields.value = 0; + pic_param->range_mapping_fields.value = 0; + pic_param->picture_fields.value = 0; + pic_param->picture_fields.bits.picture_type = get_PTYPE (frame_hdr->ptype); + pic_param->raw_coding.value = 0; + pic_param->bitplane_present.value = 0; + pic_param->reference_fields.value = 0; + pic_param->mv_fields.value = 0; + pic_param->mv_fields.bits.mv_mode = get_MVMODE (frame_hdr); + pic_param->mv_fields.bits.mv_mode2 = get_MVMODE2 (frame_hdr); + pic_param->pic_quantizer_fields.value = 0; + pic_param->pic_quantizer_fields.bits.half_qp = frame_hdr->halfqp; + pic_param->pic_quantizer_fields.bits.pic_quantizer_scale = frame_hdr->pquant; + pic_param->pic_quantizer_fields.bits.pic_quantizer_type = + frame_hdr->pquantizer; + pic_param->pic_quantizer_fields.bits.dq_frame = vopdquant->dquantfrm; + pic_param->pic_quantizer_fields.bits.dq_profile = vopdquant->dqprofile; + pic_param->pic_quantizer_fields.bits.dq_sb_edge = + vopdquant->dqprofile == + GST_VC1_DQPROFILE_SINGLE_EDGE ? vopdquant->dqbedge : 0; + pic_param->pic_quantizer_fields.bits.dq_db_edge = + vopdquant->dqprofile == + GST_VC1_DQPROFILE_DOUBLE_EDGES ? vopdquant->dqbedge : 0; + pic_param->pic_quantizer_fields.bits.dq_binary_level = vopdquant->dqbilevel; + pic_param->pic_quantizer_fields.bits.alt_pic_quantizer = vopdquant->altpquant; + pic_param->transform_fields.value = 0; + pic_param->transform_fields.bits.transform_ac_codingset_idx1 = + frame_hdr->transacfrm; + pic_param->transform_fields.bits.intra_transform_dc_table = + frame_hdr->transdctab; + + if (seq_hdr->profile == GST_VC1_PROFILE_ADVANCED) { + if (!fill_picture_advanced (decoder, picture)) + return FALSE; + } else { + if (!fill_picture_structc (decoder, picture)) + return FALSE; + } - gst_vaapi_dpb_get_neighbours(priv->dpb, picture, - &prev_picture, &next_picture); + gst_vaapi_dpb_get_neighbours (priv->dpb, picture, + &prev_picture, &next_picture); - switch (picture->type) { + switch (picture->type) { case GST_VAAPI_PICTURE_TYPE_B: - if (next_picture) - pic_param->backward_reference_picture = next_picture->surface_id; - if (prev_picture) - pic_param->forward_reference_picture = prev_picture->surface_id; - else if (!priv->closed_entry) - GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_SKIPPED); - break; + if (next_picture) + pic_param->backward_reference_picture = next_picture->surface_id; + if (prev_picture) + pic_param->forward_reference_picture = prev_picture->surface_id; + else if (!priv->closed_entry) + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_SKIPPED); + break; case GST_VAAPI_PICTURE_TYPE_P: - if (prev_picture) - pic_param->forward_reference_picture = prev_picture->surface_id; - break; + if (prev_picture) + pic_param->forward_reference_picture = prev_picture->surface_id; + break; default: + break; + } + + if (pic_param->bitplane_present.value) { + const guint8 *bitplanes[3]; + guint x, y, n; + + switch (picture->type) { + case GST_VAAPI_PICTURE_TYPE_P: + bitplanes[0] = pic_param->bitplane_present.flags.bp_direct_mb ? + priv->bitplanes->directmb : NULL; + bitplanes[1] = pic_param->bitplane_present.flags.bp_skip_mb ? + priv->bitplanes->skipmb : NULL; + bitplanes[2] = pic_param->bitplane_present.flags.bp_mv_type_mb ? + priv->bitplanes->mvtypemb : NULL; + break; + case GST_VAAPI_PICTURE_TYPE_B: + bitplanes[0] = pic_param->bitplane_present.flags.bp_direct_mb ? + priv->bitplanes->directmb : NULL; + bitplanes[1] = pic_param->bitplane_present.flags.bp_skip_mb ? + priv->bitplanes->skipmb : NULL; + bitplanes[2] = NULL; /* XXX: interlaced frame (FORWARD plane) */ + break; + case GST_VAAPI_PICTURE_TYPE_BI: + case GST_VAAPI_PICTURE_TYPE_I: + bitplanes[0] = NULL; /* XXX: interlaced frame (FIELDTX plane) */ + bitplanes[1] = pic_param->bitplane_present.flags.bp_ac_pred ? + priv->bitplanes->acpred : NULL; + bitplanes[2] = pic_param->bitplane_present.flags.bp_overflags ? + priv->bitplanes->overflags : NULL; + break; + default: + bitplanes[0] = NULL; + bitplanes[1] = NULL; + bitplanes[2] = NULL; break; } - if (pic_param->bitplane_present.value) { - const guint8 *bitplanes[3]; - guint x, y, n; - - switch (picture->type) { - case GST_VAAPI_PICTURE_TYPE_P: - bitplanes[0] = pic_param->bitplane_present.flags.bp_direct_mb ? priv->bitplanes->directmb : NULL; - bitplanes[1] = pic_param->bitplane_present.flags.bp_skip_mb ? priv->bitplanes->skipmb : NULL; - bitplanes[2] = pic_param->bitplane_present.flags.bp_mv_type_mb ? priv->bitplanes->mvtypemb : NULL; - break; - case GST_VAAPI_PICTURE_TYPE_B: - bitplanes[0] = pic_param->bitplane_present.flags.bp_direct_mb ? priv->bitplanes->directmb : NULL; - bitplanes[1] = pic_param->bitplane_present.flags.bp_skip_mb ? priv->bitplanes->skipmb : NULL; - bitplanes[2] = NULL; /* XXX: interlaced frame (FORWARD plane) */ - break; - case GST_VAAPI_PICTURE_TYPE_BI: - case GST_VAAPI_PICTURE_TYPE_I: - bitplanes[0] = NULL; /* XXX: interlaced frame (FIELDTX plane) */ - bitplanes[1] = pic_param->bitplane_present.flags.bp_ac_pred ? priv->bitplanes->acpred : NULL; - bitplanes[2] = pic_param->bitplane_present.flags.bp_overflags ? priv->bitplanes->overflags : NULL; - break; - default: - bitplanes[0] = NULL; - bitplanes[1] = NULL; - bitplanes[2] = NULL; - break; - } - - picture->bitplane = GST_VAAPI_BITPLANE_NEW( - decoder, - (seq_hdr->mb_width * seq_hdr->mb_height + 1) / 2 - ); - if (!picture->bitplane) - return FALSE; - - n = 0; - for (y = 0; y < seq_hdr->mb_height; y++) - for (x = 0; x < seq_hdr->mb_width; x++, n++) - pack_bitplanes(picture->bitplane, n, bitplanes, x, y, seq_hdr->mb_stride); - if (n & 1) /* move last nibble to the high order */ - picture->bitplane->data[n/2] <<= 4; - } - return TRUE; + picture->bitplane = GST_VAAPI_BITPLANE_NEW (decoder, + (seq_hdr->mb_width * seq_hdr->mb_height + 1) / 2); + if (!picture->bitplane) + return FALSE; + + n = 0; + for (y = 0; y < seq_hdr->mb_height; y++) + for (x = 0; x < seq_hdr->mb_width; x++, n++) + pack_bitplanes (picture->bitplane, n, bitplanes, x, y, + seq_hdr->mb_stride); + if (n & 1) /* move last nibble to the high order */ + picture->bitplane->data[n / 2] <<= 4; + } + return TRUE; } static GstVaapiDecoderStatus -decode_slice_chunk(GstVaapiDecoderVC1 *decoder, GstVC1BDU *ebdu, +decode_slice_chunk (GstVaapiDecoderVC1 * decoder, GstVC1BDU * ebdu, guint slice_addr, guint header_size) { - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - GstVaapiPicture * const picture = priv->current_picture; - GstVaapiSlice *slice; - VASliceParameterBufferVC1 *slice_param; - - slice = GST_VAAPI_SLICE_NEW(VC1, decoder, - ebdu->data + ebdu->sc_offset, - ebdu->size + ebdu->offset - ebdu->sc_offset); - if (!slice) { - GST_ERROR("failed to allocate slice"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } - gst_vaapi_picture_add_slice(picture, slice); - - /* Fill in VASliceParameterBufferVC1 */ - slice_param = slice->param; - slice_param->macroblock_offset = 8 * (ebdu->offset - ebdu->sc_offset) + - header_size; - slice_param->slice_vertical_position = slice_addr; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + GstVaapiPicture *const picture = priv->current_picture; + GstVaapiSlice *slice; + VASliceParameterBufferVC1 *slice_param; + + slice = GST_VAAPI_SLICE_NEW (VC1, decoder, + ebdu->data + ebdu->sc_offset, + ebdu->size + ebdu->offset - ebdu->sc_offset); + if (!slice) { + GST_ERROR ("failed to allocate slice"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } + gst_vaapi_picture_add_slice (picture, slice); + + /* Fill in VASliceParameterBufferVC1 */ + slice_param = slice->param; + slice_param->macroblock_offset = 8 * (ebdu->offset - ebdu->sc_offset) + + header_size; + slice_param->slice_vertical_position = slice_addr; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -decode_frame(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu) +decode_frame (GstVaapiDecoderVC1 * decoder, GstVC1BDU * rbdu, GstVC1BDU * ebdu) { - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - GstVC1FrameHdr * const frame_hdr = &priv->frame_hdr; - GstVC1ParserResult result; - GstVaapiPicture * const picture = priv->current_picture; - - memset(frame_hdr, 0, sizeof(*frame_hdr)); - result = gst_vc1_parse_frame_header( - rbdu->data + rbdu->offset, - rbdu->size, - frame_hdr, - &priv->seq_hdr, - priv->bitplanes - ); - if (result != GST_VC1_PARSER_OK) { - GST_ERROR("failed to parse frame layer"); - return get_status(result); - } + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + GstVC1FrameHdr *const frame_hdr = &priv->frame_hdr; + GstVC1ParserResult result; + GstVaapiPicture *const picture = priv->current_picture; + + memset (frame_hdr, 0, sizeof (*frame_hdr)); + result = gst_vc1_parse_frame_header (rbdu->data + rbdu->offset, + rbdu->size, frame_hdr, &priv->seq_hdr, priv->bitplanes); + if (result != GST_VC1_PARSER_OK) { + GST_ERROR ("failed to parse frame layer"); + return get_status (result); + } - switch (frame_hdr->ptype) { + switch (frame_hdr->ptype) { case GST_VC1_PICTURE_TYPE_I: - picture->type = GST_VAAPI_PICTURE_TYPE_I; - GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_REFERENCE); - break; + picture->type = GST_VAAPI_PICTURE_TYPE_I; + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_REFERENCE); + break; case GST_VC1_PICTURE_TYPE_SKIPPED: case GST_VC1_PICTURE_TYPE_P: - picture->type = GST_VAAPI_PICTURE_TYPE_P; - GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_REFERENCE); - break; + picture->type = GST_VAAPI_PICTURE_TYPE_P; + GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_REFERENCE); + break; case GST_VC1_PICTURE_TYPE_B: - picture->type = GST_VAAPI_PICTURE_TYPE_B; - break; + picture->type = GST_VAAPI_PICTURE_TYPE_B; + break; case GST_VC1_PICTURE_TYPE_BI: - picture->type = GST_VAAPI_PICTURE_TYPE_BI; - break; + picture->type = GST_VAAPI_PICTURE_TYPE_BI; + break; default: - GST_ERROR("unsupported picture type %d", frame_hdr->ptype); - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - } + GST_ERROR ("unsupported picture type %d", frame_hdr->ptype); + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + } + + /* Update presentation time */ + if (GST_VAAPI_PICTURE_IS_REFERENCE (picture)) { + picture->poc = priv->last_non_b_picture ? + (priv->last_non_b_picture->poc + 1) : priv->next_poc; + priv->next_poc = picture->poc + 1; + gst_vaapi_picture_replace (&priv->last_non_b_picture, picture); + } else if (!priv->last_non_b_picture) + picture->poc = priv->next_poc++; + else { /* B or BI */ + picture->poc = priv->last_non_b_picture->poc++; + priv->next_poc = priv->last_non_b_picture->poc + 1; + } + picture->pts = GST_VAAPI_DECODER_CODEC_FRAME (decoder)->pts; - /* Update presentation time */ - if (GST_VAAPI_PICTURE_IS_REFERENCE(picture)) { - picture->poc = priv->last_non_b_picture ? - (priv->last_non_b_picture->poc + 1) : priv->next_poc; - priv->next_poc = picture->poc + 1; - gst_vaapi_picture_replace(&priv->last_non_b_picture, picture); - } - else if (!priv->last_non_b_picture) - picture->poc = priv->next_poc++; - else { /* B or BI */ - picture->poc = priv->last_non_b_picture->poc++; - priv->next_poc = priv->last_non_b_picture->poc + 1; - } - picture->pts = GST_VAAPI_DECODER_CODEC_FRAME(decoder)->pts; - - if (!fill_picture(decoder, picture)) - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - return decode_slice_chunk(decoder, ebdu, 0, frame_hdr->header_size); + if (!fill_picture (decoder, picture)) + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + return decode_slice_chunk (decoder, ebdu, 0, frame_hdr->header_size); } static GstVaapiDecoderStatus -decode_slice(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu) +decode_slice (GstVaapiDecoderVC1 * decoder, GstVC1BDU * rbdu, GstVC1BDU * ebdu) { - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - GstVC1SliceHdr slice_hdr; - GstVC1ParserResult result; - - memset(&slice_hdr, 0, sizeof(slice_hdr)); - result = gst_vc1_parse_slice_header( - rbdu->data + rbdu->offset, - rbdu->size, - &slice_hdr, - &priv->seq_hdr - ); - if (result != GST_VC1_PARSER_OK) { - GST_ERROR("failed to parse slice layer"); - return get_status(result); - } - return decode_slice_chunk(decoder, ebdu, slice_hdr.slice_addr, - slice_hdr.header_size); + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + GstVC1SliceHdr slice_hdr; + GstVC1ParserResult result; + + memset (&slice_hdr, 0, sizeof (slice_hdr)); + result = gst_vc1_parse_slice_header (rbdu->data + rbdu->offset, + rbdu->size, &slice_hdr, &priv->seq_hdr); + if (result != GST_VC1_PARSER_OK) { + GST_ERROR ("failed to parse slice layer"); + return get_status (result); + } + return decode_slice_chunk (decoder, ebdu, slice_hdr.slice_addr, + slice_hdr.header_size); } static gboolean -decode_rbdu(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu) +decode_rbdu (GstVaapiDecoderVC1 * decoder, GstVC1BDU * rbdu, GstVC1BDU * ebdu) { - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - guint8 *rbdu_buffer; - guint i, j, rbdu_buffer_size; - - /* BDU are encapsulated in advanced profile mode only */ - if (priv->profile != GST_VAAPI_PROFILE_VC1_ADVANCED) { - memcpy(rbdu, ebdu, sizeof(*rbdu)); - return TRUE; - } - - /* Reallocate unescaped bitstream buffer */ - rbdu_buffer = priv->rbdu_buffer; - if (!rbdu_buffer || ebdu->size > priv->rbdu_buffer_size) { - rbdu_buffer = g_realloc(priv->rbdu_buffer, ebdu->size); - if (!rbdu_buffer) - return FALSE; - priv->rbdu_buffer = rbdu_buffer; - priv->rbdu_buffer_size = ebdu->size; - } - - /* Unescape bitstream buffer */ - if (ebdu->size < 4) { - memcpy(rbdu_buffer, ebdu->data + ebdu->offset, ebdu->size); - rbdu_buffer_size = ebdu->size; - } - else { - guint8 * const bdu_buffer = ebdu->data + ebdu->offset; - for (i = 0, j = 0; i < ebdu->size; i++) { - if (i >= 2 && i < ebdu->size - 1 && - bdu_buffer[i - 1] == 0x00 && - bdu_buffer[i - 2] == 0x00 && - bdu_buffer[i ] == 0x03 && - bdu_buffer[i + 1] <= 0x03) - i++; - rbdu_buffer[j++] = bdu_buffer[i]; - } - rbdu_buffer_size = j; - } - - /* Reconstruct RBDU */ - rbdu->type = ebdu->type; - rbdu->size = rbdu_buffer_size; - rbdu->sc_offset = 0; - rbdu->offset = 0; - rbdu->data = rbdu_buffer; + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + guint8 *rbdu_buffer; + guint i, j, rbdu_buffer_size; + + /* BDU are encapsulated in advanced profile mode only */ + if (priv->profile != GST_VAAPI_PROFILE_VC1_ADVANCED) { + memcpy (rbdu, ebdu, sizeof (*rbdu)); return TRUE; + } + + /* Reallocate unescaped bitstream buffer */ + rbdu_buffer = priv->rbdu_buffer; + if (!rbdu_buffer || ebdu->size > priv->rbdu_buffer_size) { + rbdu_buffer = g_realloc (priv->rbdu_buffer, ebdu->size); + if (!rbdu_buffer) + return FALSE; + priv->rbdu_buffer = rbdu_buffer; + priv->rbdu_buffer_size = ebdu->size; + } + + /* Unescape bitstream buffer */ + if (ebdu->size < 4) { + memcpy (rbdu_buffer, ebdu->data + ebdu->offset, ebdu->size); + rbdu_buffer_size = ebdu->size; + } else { + guint8 *const bdu_buffer = ebdu->data + ebdu->offset; + for (i = 0, j = 0; i < ebdu->size; i++) { + if (i >= 2 && i < ebdu->size - 1 && + bdu_buffer[i - 1] == 0x00 && + bdu_buffer[i - 2] == 0x00 && + bdu_buffer[i] == 0x03 && bdu_buffer[i + 1] <= 0x03) + i++; + rbdu_buffer[j++] = bdu_buffer[i]; + } + rbdu_buffer_size = j; + } + + /* Reconstruct RBDU */ + rbdu->type = ebdu->type; + rbdu->size = rbdu_buffer_size; + rbdu->sc_offset = 0; + rbdu->offset = 0; + rbdu->data = rbdu_buffer; + return TRUE; } static GstVaapiDecoderStatus -decode_ebdu(GstVaapiDecoderVC1 *decoder, GstVC1BDU *ebdu) +decode_ebdu (GstVaapiDecoderVC1 * decoder, GstVC1BDU * ebdu) { - GstVaapiDecoderStatus status; - GstVC1BDU rbdu; + GstVaapiDecoderStatus status; + GstVC1BDU rbdu; - if (!decode_rbdu(decoder, &rbdu, ebdu)) - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + if (!decode_rbdu (decoder, &rbdu, ebdu)) + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - switch (ebdu->type) { + switch (ebdu->type) { case GST_VC1_SEQUENCE: - status = decode_sequence(decoder, &rbdu, ebdu); - break; + status = decode_sequence (decoder, &rbdu, ebdu); + break; case GST_VC1_ENTRYPOINT: - status = decode_entry_point(decoder, &rbdu, ebdu); - break; + status = decode_entry_point (decoder, &rbdu, ebdu); + break; case GST_VC1_FRAME: - status = decode_frame(decoder, &rbdu, ebdu); - break; + status = decode_frame (decoder, &rbdu, ebdu); + break; case GST_VC1_SLICE: - status = decode_slice(decoder, &rbdu, ebdu); - break; + status = decode_slice (decoder, &rbdu, ebdu); + break; case GST_VC1_END_OF_SEQ: - status = decode_sequence_end(decoder); - break; + status = decode_sequence_end (decoder); + break; case GST_VC1_FIELD_USER: case GST_VC1_FRAME_USER: case GST_VC1_ENTRY_POINT_USER: case GST_VC1_SEQUENCE_USER: - /* Let's just ignore them */ - status = GST_VAAPI_DECODER_STATUS_SUCCESS; - break; + /* Let's just ignore them */ + status = GST_VAAPI_DECODER_STATUS_SUCCESS; + break; default: - GST_WARNING("unsupported BDU type %d", ebdu->type); - status = GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; - break; - } - return status; + GST_WARNING ("unsupported BDU type %d", ebdu->type); + status = GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; + break; + } + return status; } static GstVaapiDecoderStatus -decode_buffer(GstVaapiDecoderVC1 *decoder, guchar *buf, guint buf_size) +decode_buffer (GstVaapiDecoderVC1 * decoder, guchar * buf, guint buf_size) { - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - GstVC1BDU ebdu; + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + GstVC1BDU ebdu; - if (priv->has_codec_data) { - ebdu.type = GST_VC1_FRAME; - ebdu.sc_offset = 0; - ebdu.offset = 0; - } - else { - ebdu.type = buf[3]; - ebdu.sc_offset = 0; - ebdu.offset = 4; - } - ebdu.data = buf; - ebdu.size = buf_size - ebdu.offset; - return decode_ebdu(decoder, &ebdu); + if (priv->has_codec_data) { + ebdu.type = GST_VC1_FRAME; + ebdu.sc_offset = 0; + ebdu.offset = 0; + } else { + ebdu.type = buf[3]; + ebdu.sc_offset = 0; + ebdu.offset = 4; + } + ebdu.data = buf; + ebdu.size = buf_size - ebdu.offset; + return decode_ebdu (decoder, &ebdu); } static GstVaapiDecoderStatus -gst_vaapi_decoder_vc1_decode_codec_data(GstVaapiDecoder *base_decoder, - const guchar *buf, guint buf_size) +gst_vaapi_decoder_vc1_decode_codec_data (GstVaapiDecoder * base_decoder, + const guchar * buf, guint buf_size) { - GstVaapiDecoderVC1 * const decoder = - GST_VAAPI_DECODER_VC1_CAST(base_decoder); - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - GstVC1SeqHdr * const seq_hdr = &priv->seq_hdr; - GstVaapiDecoderStatus status; - GstVC1ParserResult result; - GstVC1BDU ebdu; - GstCaps *caps; - GstStructure *structure; - guint ofs; - gint width, height; - guint32 format; - gint version; - const gchar *s; - - priv->has_codec_data = TRUE; - - width = GST_VAAPI_DECODER_WIDTH(decoder); - height = GST_VAAPI_DECODER_HEIGHT(decoder); - if (!width || !height) { - GST_ERROR("failed to parse size from codec-data"); - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - } + GstVaapiDecoderVC1 *const decoder = GST_VAAPI_DECODER_VC1_CAST (base_decoder); + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + GstVC1SeqHdr *const seq_hdr = &priv->seq_hdr; + GstVaapiDecoderStatus status; + GstVC1ParserResult result; + GstVC1BDU ebdu; + GstCaps *caps; + GstStructure *structure; + guint ofs; + gint width, height; + guint32 format; + gint version; + const gchar *s; + + priv->has_codec_data = TRUE; + + width = GST_VAAPI_DECODER_WIDTH (decoder); + height = GST_VAAPI_DECODER_HEIGHT (decoder); + if (!width || !height) { + GST_ERROR ("failed to parse size from codec-data"); + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + } - caps = GST_VAAPI_DECODER_CODEC_STATE(decoder)->caps; - structure = gst_caps_get_structure(caps, 0); - s = gst_structure_get_string(structure, "format"); - if (s && strlen(s) == 4) { - format = GST_MAKE_FOURCC(s[0], s[1], s[2], s[3]); - } else { - /* Try to determine format from "wmvversion" property */ - if (gst_structure_get_int(structure, "wmvversion", &version)) - format = (version >= 1 && version <= 3) ? - GST_MAKE_FOURCC('W','M','V',('0'+version)) : 0; - else - format = 0; - } - if (!format) { - GST_ERROR("failed to parse profile from codec-data"); - return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC; - } + caps = GST_VAAPI_DECODER_CODEC_STATE (decoder)->caps; + structure = gst_caps_get_structure (caps, 0); + s = gst_structure_get_string (structure, "format"); + if (s && strlen (s) == 4) { + format = GST_MAKE_FOURCC (s[0], s[1], s[2], s[3]); + } else { + /* Try to determine format from "wmvversion" property */ + if (gst_structure_get_int (structure, "wmvversion", &version)) + format = (version >= 1 && version <= 3) ? + GST_MAKE_FOURCC ('W', 'M', 'V', ('0' + version)) : 0; + else + format = 0; + } + if (!format) { + GST_ERROR ("failed to parse profile from codec-data"); + return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC; + } + + /* WMV3 -- expecting sequence header */ + if (format == GST_MAKE_FOURCC ('W', 'M', 'V', '3')) { + seq_hdr->struct_c.coded_width = width; + seq_hdr->struct_c.coded_height = height; + ebdu.type = GST_VC1_SEQUENCE; + ebdu.size = buf_size; + ebdu.sc_offset = 0; + ebdu.offset = 0; + ebdu.data = (guint8 *) buf; + return decode_ebdu (decoder, &ebdu); + } + + /* WVC1 -- expecting bitstream data units */ + if (format != GST_MAKE_FOURCC ('W', 'V', 'C', '1')) + return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; + seq_hdr->advanced.max_coded_width = width; + seq_hdr->advanced.max_coded_height = height; + + ofs = 0; + do { + result = gst_vc1_identify_next_bdu (buf + ofs, buf_size - ofs, &ebdu); - /* WMV3 -- expecting sequence header */ - if (format == GST_MAKE_FOURCC('W','M','V','3')) { - seq_hdr->struct_c.coded_width = width; - seq_hdr->struct_c.coded_height = height; - ebdu.type = GST_VC1_SEQUENCE; - ebdu.size = buf_size; - ebdu.sc_offset = 0; - ebdu.offset = 0; - ebdu.data = (guint8 *)buf; - return decode_ebdu(decoder, &ebdu); + switch (result) { + case GST_VC1_PARSER_NO_BDU_END: + /* Assume the EBDU is complete within codec-data bounds */ + ebdu.size = buf_size - ofs - ebdu.offset; + // fall-through + case GST_VC1_PARSER_OK: + status = decode_ebdu (decoder, &ebdu); + ofs += ebdu.offset + ebdu.size; + break; + default: + status = get_status (result); + break; } - - /* WVC1 -- expecting bitstream data units */ - if (format != GST_MAKE_FOURCC('W','V','C','1')) - return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; - seq_hdr->advanced.max_coded_width = width; - seq_hdr->advanced.max_coded_height = height; - - ofs = 0; - do { - result = gst_vc1_identify_next_bdu( - buf + ofs, - buf_size - ofs, - &ebdu - ); - - switch (result) { - case GST_VC1_PARSER_NO_BDU_END: - /* Assume the EBDU is complete within codec-data bounds */ - ebdu.size = buf_size - ofs - ebdu.offset; - // fall-through - case GST_VC1_PARSER_OK: - status = decode_ebdu(decoder, &ebdu); - ofs += ebdu.offset + ebdu.size; - break; - default: - status = get_status(result); - break; - } - } while (status == GST_VAAPI_DECODER_STATUS_SUCCESS && ofs < buf_size); - return status; + } while (status == GST_VAAPI_DECODER_STATUS_SUCCESS && ofs < buf_size); + return status; } static GstVaapiDecoderStatus -ensure_decoder(GstVaapiDecoderVC1 *decoder) +ensure_decoder (GstVaapiDecoderVC1 * decoder) { - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - GstVaapiDecoderStatus status; + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + GstVaapiDecoderStatus status; - if (!priv->is_opened) { - priv->is_opened = gst_vaapi_decoder_vc1_open(decoder); - if (!priv->is_opened) - return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC; - - status = gst_vaapi_decoder_decode_codec_data( - GST_VAAPI_DECODER_CAST(decoder)); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - } - return GST_VAAPI_DECODER_STATUS_SUCCESS; + if (!priv->is_opened) { + priv->is_opened = gst_vaapi_decoder_vc1_open (decoder); + if (!priv->is_opened) + return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC; + + status = + gst_vaapi_decoder_decode_codec_data (GST_VAAPI_DECODER_CAST (decoder)); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; + } + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static inline gint -scan_for_start_code(GstAdapter *adapter, guint ofs, guint size, guint32 *scp) +scan_for_start_code (GstAdapter * adapter, guint ofs, guint size, guint32 * scp) { - return (gint)gst_adapter_masked_scan_uint32_peek(adapter, - 0xffffff00, 0x00000100, ofs, size, scp); + return (gint) gst_adapter_masked_scan_uint32_peek (adapter, + 0xffffff00, 0x00000100, ofs, size, scp); } static GstVaapiDecoderStatus -gst_vaapi_decoder_vc1_parse(GstVaapiDecoder *base_decoder, - GstAdapter *adapter, gboolean at_eos, GstVaapiDecoderUnit *unit) +gst_vaapi_decoder_vc1_parse (GstVaapiDecoder * base_decoder, + GstAdapter * adapter, gboolean at_eos, GstVaapiDecoderUnit * unit) { - GstVaapiDecoderVC1 * const decoder = - GST_VAAPI_DECODER_VC1_CAST(base_decoder); - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - GstVaapiDecoderStatus status; - guint8 bdu_type; - guint size, buf_size, flags = 0; - gint ofs; + GstVaapiDecoderVC1 *const decoder = GST_VAAPI_DECODER_VC1_CAST (base_decoder); + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + GstVaapiDecoderStatus status; + guint8 bdu_type; + guint size, buf_size, flags = 0; + gint ofs; - status = ensure_decoder(decoder); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; + status = ensure_decoder (decoder); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; - size = gst_adapter_available(adapter); + size = gst_adapter_available (adapter); - if (priv->has_codec_data) { - // Assume demuxer sends out plain frames - if (size < 1) - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - buf_size = size; - bdu_type = GST_VC1_FRAME; - } - else { - if (size < 4) - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - - ofs = scan_for_start_code(adapter, 0, size, NULL); - if (ofs < 0) - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - gst_adapter_flush(adapter, ofs); - size -= ofs; - - ofs = G_UNLIKELY(size < 8) ? -1 : - scan_for_start_code(adapter, 4, size - 4, NULL); - if (ofs < 0) { - // Assume the whole packet is present if end-of-stream - if (!at_eos) - return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - ofs = size; - } - buf_size = ofs; - gst_adapter_copy(adapter, &bdu_type, 3, 1); - } + if (priv->has_codec_data) { + // Assume demuxer sends out plain frames + if (size < 1) + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + buf_size = size; + bdu_type = GST_VC1_FRAME; + } else { + if (size < 4) + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + + ofs = scan_for_start_code (adapter, 0, size, NULL); + if (ofs < 0) + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + gst_adapter_flush (adapter, ofs); + size -= ofs; + + ofs = G_UNLIKELY (size < 8) ? -1 : + scan_for_start_code (adapter, 4, size - 4, NULL); + if (ofs < 0) { + // Assume the whole packet is present if end-of-stream + if (!at_eos) + return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; + ofs = size; + } + buf_size = ofs; + gst_adapter_copy (adapter, &bdu_type, 3, 1); + } - unit->size = buf_size; + unit->size = buf_size; - /* Check for new picture layer */ - switch (bdu_type) { + /* Check for new picture layer */ + switch (bdu_type) { case GST_VC1_END_OF_SEQ: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_END; - flags |= GST_VAAPI_DECODER_UNIT_FLAG_STREAM_END; - break; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_END; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_STREAM_END; + break; case GST_VC1_SEQUENCE: case GST_VC1_ENTRYPOINT: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; - break; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; + break; case GST_VC1_FRAME: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; - flags |= GST_VAAPI_DECODER_UNIT_FLAG_SLICE; - break; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_SLICE; + break; case GST_VC1_SLICE: - flags |= GST_VAAPI_DECODER_UNIT_FLAG_SLICE; - break; - } - GST_VAAPI_DECODER_UNIT_FLAG_SET(unit, flags); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + flags |= GST_VAAPI_DECODER_UNIT_FLAG_SLICE; + break; + } + GST_VAAPI_DECODER_UNIT_FLAG_SET (unit, flags); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -gst_vaapi_decoder_vc1_decode(GstVaapiDecoder *base_decoder, - GstVaapiDecoderUnit *unit) +gst_vaapi_decoder_vc1_decode (GstVaapiDecoder * base_decoder, + GstVaapiDecoderUnit * unit) { - GstVaapiDecoderVC1 * const decoder = - GST_VAAPI_DECODER_VC1_CAST(base_decoder); - GstVaapiDecoderStatus status; - GstBuffer * const buffer = - GST_VAAPI_DECODER_CODEC_FRAME(decoder)->input_buffer; - GstMapInfo map_info; + GstVaapiDecoderVC1 *const decoder = GST_VAAPI_DECODER_VC1_CAST (base_decoder); + GstVaapiDecoderStatus status; + GstBuffer *const buffer = + GST_VAAPI_DECODER_CODEC_FRAME (decoder)->input_buffer; + GstMapInfo map_info; - status = ensure_decoder(decoder); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; + status = ensure_decoder (decoder); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; - if (!gst_buffer_map(buffer, &map_info, GST_MAP_READ)) { - GST_ERROR("failed to map buffer"); - return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - } + if (!gst_buffer_map (buffer, &map_info, GST_MAP_READ)) { + GST_ERROR ("failed to map buffer"); + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + } - status = decode_buffer(decoder, map_info.data + unit->offset, unit->size); - gst_buffer_unmap(buffer, &map_info); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - return GST_VAAPI_DECODER_STATUS_SUCCESS; + status = decode_buffer (decoder, map_info.data + unit->offset, unit->size); + gst_buffer_unmap (buffer, &map_info); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + return status; + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -gst_vaapi_decoder_vc1_start_frame(GstVaapiDecoder *base_decoder, - GstVaapiDecoderUnit *unit) +gst_vaapi_decoder_vc1_start_frame (GstVaapiDecoder * base_decoder, + GstVaapiDecoderUnit * unit) { - GstVaapiDecoderVC1 * const decoder = - GST_VAAPI_DECODER_VC1_CAST(base_decoder); - GstVaapiDecoderVC1Private * const priv = &decoder->priv; - GstVaapiDecoderStatus status; - GstVaapiPicture *picture; - - status = ensure_context(decoder); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) { - GST_ERROR("failed to reset context"); - return status; - } - - picture = GST_VAAPI_PICTURE_NEW(VC1, decoder); - if (!picture) { - GST_ERROR("failed to allocate picture"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } - gst_vaapi_picture_replace(&priv->current_picture, picture); - gst_vaapi_picture_unref(picture); + GstVaapiDecoderVC1 *const decoder = GST_VAAPI_DECODER_VC1_CAST (base_decoder); + GstVaapiDecoderVC1Private *const priv = &decoder->priv; + GstVaapiDecoderStatus status; + GstVaapiPicture *picture; + + status = ensure_context (decoder); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) { + GST_ERROR ("failed to reset context"); + return status; + } - /* Update cropping rectangle */ - do { - GstVC1AdvancedSeqHdr *adv_hdr; - GstVaapiRectangle crop_rect; - - if (priv->profile != GST_VAAPI_PROFILE_VC1_ADVANCED) - break; - - adv_hdr = &priv->seq_hdr.advanced; - if (!adv_hdr->display_ext) - break; - - crop_rect.x = 0; - crop_rect.y = 0; - crop_rect.width = adv_hdr->disp_horiz_size; - crop_rect.height = adv_hdr->disp_vert_size; - if (crop_rect.width <= priv->width && crop_rect.height <= priv->height) - gst_vaapi_picture_set_crop_rect(picture, &crop_rect); - } while (0); - - if (!gst_vc1_bitplanes_ensure_size(priv->bitplanes, &priv->seq_hdr)) { - GST_ERROR("failed to allocate bitplanes"); - return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; - } - return GST_VAAPI_DECODER_STATUS_SUCCESS; + picture = GST_VAAPI_PICTURE_NEW (VC1, decoder); + if (!picture) { + GST_ERROR ("failed to allocate picture"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } + gst_vaapi_picture_replace (&priv->current_picture, picture); + gst_vaapi_picture_unref (picture); + + /* Update cropping rectangle */ + do { + GstVC1AdvancedSeqHdr *adv_hdr; + GstVaapiRectangle crop_rect; + + if (priv->profile != GST_VAAPI_PROFILE_VC1_ADVANCED) + break; + + adv_hdr = &priv->seq_hdr.advanced; + if (!adv_hdr->display_ext) + break; + + crop_rect.x = 0; + crop_rect.y = 0; + crop_rect.width = adv_hdr->disp_horiz_size; + crop_rect.height = adv_hdr->disp_vert_size; + if (crop_rect.width <= priv->width && crop_rect.height <= priv->height) + gst_vaapi_picture_set_crop_rect (picture, &crop_rect); + } while (0); + + if (!gst_vc1_bitplanes_ensure_size (priv->bitplanes, &priv->seq_hdr)) { + GST_ERROR ("failed to allocate bitplanes"); + return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; + } + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static GstVaapiDecoderStatus -gst_vaapi_decoder_vc1_end_frame(GstVaapiDecoder *base_decoder) +gst_vaapi_decoder_vc1_end_frame (GstVaapiDecoder * base_decoder) { - GstVaapiDecoderVC1 * const decoder = - GST_VAAPI_DECODER_VC1_CAST(base_decoder); + GstVaapiDecoderVC1 *const decoder = GST_VAAPI_DECODER_VC1_CAST (base_decoder); - return decode_current_picture(decoder); + return decode_current_picture (decoder); } static GstVaapiDecoderStatus -gst_vaapi_decoder_vc1_flush(GstVaapiDecoder *base_decoder) +gst_vaapi_decoder_vc1_flush (GstVaapiDecoder * base_decoder) { - GstVaapiDecoderVC1 * const decoder = - GST_VAAPI_DECODER_VC1_CAST(base_decoder); - GstVaapiDecoderVC1Private * const priv = &decoder->priv; + GstVaapiDecoderVC1 *const decoder = GST_VAAPI_DECODER_VC1_CAST (base_decoder); + GstVaapiDecoderVC1Private *const priv = &decoder->priv; - gst_vaapi_dpb_flush(priv->dpb); - return GST_VAAPI_DECODER_STATUS_SUCCESS; + gst_vaapi_dpb_flush (priv->dpb); + return GST_VAAPI_DECODER_STATUS_SUCCESS; } static void -gst_vaapi_decoder_vc1_class_init(GstVaapiDecoderVC1Class *klass) +gst_vaapi_decoder_vc1_class_init (GstVaapiDecoderVC1Class * klass) { - GstVaapiMiniObjectClass * const object_class = - GST_VAAPI_MINI_OBJECT_CLASS(klass); - GstVaapiDecoderClass * const decoder_class = GST_VAAPI_DECODER_CLASS(klass); - - object_class->size = sizeof(GstVaapiDecoderVC1); - object_class->finalize = (GDestroyNotify)gst_vaapi_decoder_finalize; - - decoder_class->create = gst_vaapi_decoder_vc1_create; - decoder_class->destroy = gst_vaapi_decoder_vc1_destroy; - decoder_class->parse = gst_vaapi_decoder_vc1_parse; - decoder_class->decode = gst_vaapi_decoder_vc1_decode; - decoder_class->start_frame = gst_vaapi_decoder_vc1_start_frame; - decoder_class->end_frame = gst_vaapi_decoder_vc1_end_frame; - decoder_class->flush = gst_vaapi_decoder_vc1_flush; + GstVaapiMiniObjectClass *const object_class = + GST_VAAPI_MINI_OBJECT_CLASS (klass); + GstVaapiDecoderClass *const decoder_class = GST_VAAPI_DECODER_CLASS (klass); + + object_class->size = sizeof (GstVaapiDecoderVC1); + object_class->finalize = (GDestroyNotify) gst_vaapi_decoder_finalize; + + decoder_class->create = gst_vaapi_decoder_vc1_create; + decoder_class->destroy = gst_vaapi_decoder_vc1_destroy; + decoder_class->parse = gst_vaapi_decoder_vc1_parse; + decoder_class->decode = gst_vaapi_decoder_vc1_decode; + decoder_class->start_frame = gst_vaapi_decoder_vc1_start_frame; + decoder_class->end_frame = gst_vaapi_decoder_vc1_end_frame; + decoder_class->flush = gst_vaapi_decoder_vc1_flush; - decoder_class->decode_codec_data = - gst_vaapi_decoder_vc1_decode_codec_data; + decoder_class->decode_codec_data = gst_vaapi_decoder_vc1_decode_codec_data; } static inline const GstVaapiDecoderClass * -gst_vaapi_decoder_vc1_class(void) +gst_vaapi_decoder_vc1_class (void) { - static GstVaapiDecoderVC1Class g_class; - static gsize g_class_init = FALSE; + static GstVaapiDecoderVC1Class g_class; + static gsize g_class_init = FALSE; - if (g_once_init_enter(&g_class_init)) { - gst_vaapi_decoder_vc1_class_init(&g_class); - g_once_init_leave(&g_class_init, TRUE); - } - return GST_VAAPI_DECODER_CLASS(&g_class); + if (g_once_init_enter (&g_class_init)) { + gst_vaapi_decoder_vc1_class_init (&g_class); + g_once_init_leave (&g_class_init, TRUE); + } + return GST_VAAPI_DECODER_CLASS (&g_class); } /** @@ -1437,7 +1442,7 @@ * Return value: the newly allocated #GstVaapiDecoder object */ GstVaapiDecoder * -gst_vaapi_decoder_vc1_new(GstVaapiDisplay *display, GstCaps *caps) +gst_vaapi_decoder_vc1_new (GstVaapiDisplay * display, GstCaps * caps) { - return gst_vaapi_decoder_new(gst_vaapi_decoder_vc1_class(), display, caps); + return gst_vaapi_decoder_new (gst_vaapi_decoder_vc1_class (), display, caps); } diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_vp8.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_vp8.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_vp8.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_vp8.c 2016-03-24 11:36:59.000000000 +0000 @@ -69,7 +69,7 @@ */ struct _GstVaapiDecoderVp8 { - /*< private >*/ + /*< private > */ GstVaapiDecoder parent_instance; GstVaapiDecoderVp8Private priv; @@ -82,7 +82,7 @@ */ struct _GstVaapiDecoderVp8Class { - /*< private >*/ + /*< private > */ GstVaapiDecoderClass parent_class; }; @@ -262,7 +262,7 @@ picture->structure = GST_VAAPI_PICTURE_STRUCTURE_FRAME; picture->type = frame_hdr->key_frame ? GST_VAAPI_PICTURE_TYPE_I : GST_VAAPI_PICTURE_TYPE_P; - picture->pts = GST_VAAPI_DECODER_CODEC_FRAME(decoder)->pts; + picture->pts = GST_VAAPI_DECODER_CODEC_FRAME (decoder)->pts; if (!frame_hdr->show_frame) GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_SKIPPED); @@ -572,7 +572,7 @@ return decode_picture (decoder, buf, buf_size); } -GstVaapiDecoderStatus +static GstVaapiDecoderStatus gst_vaapi_decoder_vp8_decode (GstVaapiDecoder * base_decoder, GstVaapiDecoderUnit * unit) { diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_vp9.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_vp9.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidecoder_vp9.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidecoder_vp9.c 2016-03-24 11:36:59.000000000 +0000 @@ -236,9 +236,8 @@ frame_hdr->ref_frame_sign_bias[GST_VP9_REF_FRAME_ALTREF - 1]; } for (i = 0; i < G_N_ELEMENTS (priv->ref_frames); i++) { - pic_param->reference_frames[i] = - priv->ref_frames[i] ? priv-> - ref_frames[i]->surface_id : VA_INVALID_SURFACE; + pic_param->reference_frames[i] = priv->ref_frames[i] ? + priv->ref_frames[i]->surface_id : VA_INVALID_SURFACE; } } @@ -289,7 +288,10 @@ COPY_FIELD (frame_hdr, log2_tile_columns); COPY_FIELD (frame_hdr, frame_header_length_in_bytes); COPY_FIELD (frame_hdr, first_partition_size); - + COPY_FIELD (frame_hdr, profile); +#if VA_CHECK_VERSION (0, 39, 0) + COPY_FIELD (frame_hdr, bit_depth); +#endif g_assert (G_N_ELEMENTS (pic_param->mb_segment_tree_probs) == G_N_ELEMENTS (parser->mb_segment_tree_probs)); g_assert (G_N_ELEMENTS (pic_param->segment_pred_probs) == @@ -442,13 +444,16 @@ if (is_clone_pic) return GST_VAAPI_DECODER_STATUS_SUCCESS; - if (frame_hdr->display_size_enabled) { - crop_width = frame_hdr->display_width; - crop_height = frame_hdr->display_height; - } else if (priv->width > frame_hdr->width || priv->height > frame_hdr->height) { + if (priv->width > frame_hdr->width || priv->height > frame_hdr->height) { crop_width = frame_hdr->width; crop_height = frame_hdr->height; } + if (frame_hdr->display_size_enabled && + (frame_hdr->width > frame_hdr->display_width + || frame_hdr->height > frame_hdr->display_height)) { + crop_width = frame_hdr->display_width; + crop_height = frame_hdr->display_height; + } if (crop_width || crop_height) { GstVaapiRectangle crop_rect; crop_rect.x = 0; @@ -645,7 +650,7 @@ return decode_picture (decoder, buf, size); } -GstVaapiDecoderStatus +static GstVaapiDecoderStatus gst_vaapi_decoder_vp9_decode (GstVaapiDecoder * base_decoder, GstVaapiDecoderUnit * unit) { diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidisplay.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidisplay.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidisplay.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidisplay.c 2016-03-24 11:36:59.000000000 +0000 @@ -1627,8 +1627,8 @@ if (!ensure_subpicture_formats (display)) return NULL; - return get_formats (GST_VAAPI_DISPLAY_GET_PRIVATE (display)-> - subpicture_formats); + return + get_formats (GST_VAAPI_DISPLAY_GET_PRIVATE (display)->subpicture_formats); } /** @@ -1798,7 +1798,7 @@ gint * value) { GstVaapiDisplayPrivate *const priv = GST_VAAPI_DISPLAY_GET_PRIVATE (display); - VADisplayAttribute attr; + VADisplayAttribute attr = { 0, }; VAStatus status; attr.type = type; @@ -1814,7 +1814,7 @@ set_attribute (GstVaapiDisplay * display, VADisplayAttribType type, gint value) { GstVaapiDisplayPrivate *const priv = GST_VAAPI_DISPLAY_GET_PRIVATE (display); - VADisplayAttribute attr; + VADisplayAttribute attr = { 0, }; VAStatus status; attr.type = type; @@ -2146,5 +2146,5 @@ klass = GST_VAAPI_DISPLAY_GET_CLASS (display); return (klass->display_type == GST_VAAPI_DISPLAY_TYPE_GLX || - klass->display_type == GST_VAAPI_DISPLAY_TYPE_EGL); + klass->display_type == GST_VAAPI_DISPLAY_TYPE_EGL); } diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidisplay_egl.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidisplay_egl.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidisplay_egl.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidisplay_egl.c 2016-03-24 11:36:59.000000000 +0000 @@ -464,10 +464,10 @@ gst_vaapi_display_egl_create_texture (GstVaapiDisplay * display, GstVaapiID id, guint target, guint format, guint width, guint height) { - return id != GST_VAAPI_ID_INVALID ? - gst_vaapi_texture_egl_new_wrapped (display, id, target, format, - width, height) : - gst_vaapi_texture_egl_new (display, target, format, width, height); + if (id != GST_VAAPI_ID_INVALID) + return gst_vaapi_texture_egl_new_wrapped (display, id, target, format, + width, height); + return gst_vaapi_texture_egl_new (display, target, format, width, height); } static void diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidisplay_wayland.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidisplay_wayland.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapidisplay_wayland.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapidisplay_wayland.c 2016-03-24 11:36:59.000000000 +0000 @@ -330,9 +330,9 @@ gst_vaapi_display_wayland_create_window (GstVaapiDisplay * display, GstVaapiID id, guint width, guint height) { - return id != GST_VAAPI_ID_INVALID ? - NULL : - gst_vaapi_window_wayland_new (display, width, height); + if (id != GST_VAAPI_ID_INVALID) + return NULL; + return gst_vaapi_window_wayland_new (display, width, height); } static void diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiencoder.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiencoder.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiencoder.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiencoder.c 2016-03-24 11:36:59.000000000 +0000 @@ -551,8 +551,9 @@ if (cdata->codec == GST_VAAPI_CODEC_JPEG) { #if !VA_CHECK_VERSION(0,37,1) encoder->packed_headers = VA_ENC_PACKED_HEADER_RAW_DATA; - GST_DEBUG ("Hard coding the packed header flag value to VA_ENC_PACKED_HEADER_RAW_DATA," - "This is a work around for the driver bug"); + GST_DEBUG ("Hard coding the packed header flag value to " + "VA_ENC_PACKED_HEADER_RAW_DATA. This is a work around for the driver " + "bug"); #endif } @@ -564,7 +565,7 @@ { GstVaapiContextInfo *const cip = &encoder->context_info; const GstVideoFormat fmt = - GST_VIDEO_INFO_FORMAT (GST_VAAPI_ENCODER_VIDEO_INFO (encoder)); + GST_VIDEO_INFO_FORMAT (GST_VAAPI_ENCODER_VIDEO_INFO (encoder)); guint format = 0; if (fmt == GST_VIDEO_FORMAT_ENCODED) @@ -597,7 +598,7 @@ GstVaapiContextInfo *const cip = &encoder->context_info; GstVaapiConfigInfoEncoder *const config = &cip->config.encoder; const GstVideoFormat format = - GST_VIDEO_INFO_FORMAT (GST_VAAPI_ENCODER_VIDEO_INFO (encoder)); + GST_VIDEO_INFO_FORMAT (GST_VAAPI_ENCODER_VIDEO_INFO (encoder)); const GstVaapiEncoderClassData *const cdata = GST_VAAPI_ENCODER_GET_CLASS (encoder)->class_data; diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiencoder_h264.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiencoder_h264.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiencoder_h264.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiencoder_h264.c 2016-03-24 11:36:59.000000000 +0000 @@ -124,7 +124,7 @@ GQueue reorder_frame_list; guint reorder_state; guint frame_index; - guint frame_count; /* monotonically increasing with in every idr period */ + guint frame_count; /* monotonically increasing with in every idr period */ guint cur_frame_num; guint cur_present_index; } GstVaapiH264ViewReorderPool; @@ -567,7 +567,8 @@ static gboolean bs_write_subset_sps (GstBitWriter * bs, const VAEncSequenceParameterBufferH264 * seq_param, GstVaapiProfile profile, - guint num_views, guint16 *view_ids, const VAEncMiscParameterHRD * hrd_params) + guint num_views, guint16 * view_ids, + const VAEncMiscParameterHRD * hrd_params) { guint32 i, j, k; @@ -591,11 +592,12 @@ for (i = 1; i <= num_views_minus1; i++) { guint32 num_anchor_refs_l0 = 0; + guint32 num_anchor_refs_l1 = 0; + WRITE_UE (bs, num_anchor_refs_l0); for (j = 0; j < num_anchor_refs_l0; j++) WRITE_UE (bs, 0); - guint32 num_anchor_refs_l1 = 0; WRITE_UE (bs, num_anchor_refs_l1); for (j = 0; j < num_anchor_refs_l1; j++) WRITE_UE (bs, 0); @@ -603,11 +605,12 @@ for (i = 1; i <= num_views_minus1; i++) { guint32 num_non_anchor_refs_l0 = 0; + guint32 num_non_anchor_refs_l1 = 0; + WRITE_UE (bs, num_non_anchor_refs_l0); for (j = 0; j < num_non_anchor_refs_l0; j++) WRITE_UE (bs, 0); - guint32 num_non_anchor_refs_l1 = 0; WRITE_UE (bs, num_non_anchor_refs_l1); for (j = 0; j < num_non_anchor_refs_l1; j++) WRITE_UE (bs, 0); @@ -777,7 +780,7 @@ /* MVC */ gboolean is_mvc; - guint32 view_idx; /* View Order Index (VOIdx) */ + guint32 view_idx; /* View Order Index (VOIdx) */ guint32 num_views; guint16 view_ids[MAX_NUM_VIEWS]; GstVaapiH264ViewRefPool ref_pools[MAX_NUM_VIEWS]; @@ -803,11 +806,12 @@ initial_cpb_removal_delay = encoder->cpb_length * 45; /* initial_cpb_remvoal_dealy */ - WRITE_UINT32 (bs, initial_cpb_removal_delay, initial_cpb_removal_delay_length); + WRITE_UINT32 (bs, initial_cpb_removal_delay, + initial_cpb_removal_delay_length); /* initial_cpb_removal_delay_offset */ WRITE_UINT32 (bs, initial_cpb_removal_delay_offset, - initial_cpb_removal_delay_length); + initial_cpb_removal_delay_length); /* VclHrdBpPresentFlag == FALSE */ return TRUE; @@ -996,7 +1000,7 @@ const guint8 * nal, guint32 size) { guint8 nal_type; - gsize ret; + G_GNUC_UNUSED gsize ret; /* FIXME */ gboolean has_subset_sps; g_assert (size); @@ -1419,8 +1423,8 @@ WRITE_UINT32 (&bs, 0x00000001, 32); /* start code */ bs_write_nal_header (&bs, GST_H264_NAL_REF_IDC_HIGH, GST_H264_NAL_SUBSET_SPS); - bs_write_subset_sps (&bs, seq_param, encoder->profile, encoder->num_views, encoder->view_ids, - &hrd_params); + bs_write_subset_sps (&bs, seq_param, encoder->profile, encoder->num_views, + encoder->view_ids, &hrd_params); g_assert (GST_BIT_WRITER_BIT_SIZE (&bs) % 8 == 0); data_bit_size = GST_BIT_WRITER_BIT_SIZE (&bs); @@ -1501,15 +1505,14 @@ static gboolean add_packed_sei_header (GstVaapiEncoderH264 * encoder, - GstVaapiEncPicture * picture, - GstVaapiH264SeiPayloadType payloadtype) + GstVaapiEncPicture * picture, GstVaapiH264SeiPayloadType payloadtype) { GstVaapiEncPackedHeader *packed_sei; GstBitWriter bs, bs_buf_period, bs_pic_timing; VAEncPackedHeaderParameterBuffer packed_sei_param = { 0 }; guint32 data_bit_size; guint8 buf_period_payload_size = 0, pic_timing_payload_size = 0; - guint8 *data, *buf_period_payload, *pic_timing_payload; + guint8 *data, *buf_period_payload = NULL, *pic_timing_payload = NULL; gboolean need_buf_period, need_pic_timing; gst_bit_writer_init (&bs_buf_period, 128 * 8); @@ -1524,9 +1527,8 @@ bs_write_sei_buf_period (&bs_buf_period, encoder, picture); /* Write byte alignment bits */ if (GST_BIT_WRITER_BIT_SIZE (&bs_buf_period) % 8 != 0) - bs_write_trailing_bits(&bs_buf_period); - buf_period_payload_size = - (GST_BIT_WRITER_BIT_SIZE (&bs_buf_period)) / 8; + bs_write_trailing_bits (&bs_buf_period); + buf_period_payload_size = (GST_BIT_WRITER_BIT_SIZE (&bs_buf_period)) / 8; buf_period_payload = GST_BIT_WRITER_DATA (&bs_buf_period); } @@ -1536,9 +1538,8 @@ bs_write_sei_pic_timing (&bs_pic_timing, encoder, picture); /* Write byte alignment bits */ if (GST_BIT_WRITER_BIT_SIZE (&bs_pic_timing) % 8 != 0) - bs_write_trailing_bits(&bs_pic_timing); - pic_timing_payload_size = - (GST_BIT_WRITER_BIT_SIZE (&bs_pic_timing)) / 8; + bs_write_trailing_bits (&bs_pic_timing); + pic_timing_payload_size = (GST_BIT_WRITER_BIT_SIZE (&bs_pic_timing)) / 8; pic_timing_payload = GST_BIT_WRITER_DATA (&bs_pic_timing); } @@ -1695,7 +1696,8 @@ /* pack nal_unit_header_mvc_extension() for the non base view */ if (encoder->is_mvc && encoder->view_idx) { bs_write_nal_header (&bs, nal_ref_idc, GST_H264_NAL_SLICE_EXT); - bs_write_nal_header_mvc_extension (&bs, picture, encoder->view_ids[encoder->view_idx]); + bs_write_nal_header_mvc_extension (&bs, picture, + encoder->view_ids[encoder->view_idx]); } else bs_write_nal_header (&bs, nal_ref_idc, nal_unit_type); @@ -2163,11 +2165,13 @@ /* add subset sps for non-base view and sps for base view */ if (encoder->is_mvc && encoder->view_idx) { - if ((GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) & VA_ENC_PACKED_HEADER_SEQUENCE) + if ((GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) & + VA_ENC_PACKED_HEADER_SEQUENCE) && !add_packed_sequence_header_mvc (encoder, picture, sequence)) goto error_create_packed_seq_hdr; } else { - if ((GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) & VA_ENC_PACKED_HEADER_SEQUENCE) + if ((GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) & + VA_ENC_PACKED_HEADER_SEQUENCE) && !add_packed_sequence_header (encoder, picture, sequence)) goto error_create_packed_seq_hdr; } @@ -2234,15 +2238,15 @@ if ((GST_VAAPI_ENC_PICTURE_IS_IDR (picture)) && (GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) & VA_ENC_PACKED_HEADER_MISC) && - !add_packed_sei_header (encoder, picture, + !add_packed_sei_header (encoder, picture, GST_VAAPI_H264_SEI_BUF_PERIOD | GST_VAAPI_H264_SEI_PIC_TIMING)) goto error_create_packed_sei_hdr; else if (!GST_VAAPI_ENC_PICTURE_IS_IDR (picture) && - (GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) & - VA_ENC_PACKED_HEADER_MISC) && - !add_packed_sei_header (encoder, picture, - GST_VAAPI_H264_SEI_PIC_TIMING)) + (GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) & + VA_ENC_PACKED_HEADER_MISC) && + !add_packed_sei_header (encoder, picture, + GST_VAAPI_H264_SEI_PIC_TIMING)) goto error_create_packed_sei_hdr; } @@ -2271,7 +2275,8 @@ return FALSE; if (picture->type == GST_VAAPI_PICTURE_TYPE_I && - (GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) & VA_ENC_PACKED_HEADER_PICTURE) + (GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) & + VA_ENC_PACKED_HEADER_PICTURE) && !add_packed_picture_header (encoder, picture)) { GST_ERROR ("set picture packed header failed"); return FALSE; @@ -2452,13 +2457,14 @@ for (i = 0; i < encoder->num_views; i++) { GstVaapiH264ViewRefPool *const ref_pool = &encoder->ref_pools[i]; + GstVaapiH264ViewReorderPool *const reorder_pool = + &encoder->reorder_pools[i]; + ref_pool->max_reflist0_count = 1; ref_pool->max_reflist1_count = encoder->num_bframes > 0; ref_pool->max_ref_frames = ref_pool->max_reflist0_count + ref_pool->max_reflist1_count; - GstVaapiH264ViewReorderPool *const reorder_pool = - &encoder->reorder_pools[i]; reorder_pool->frame_index = 0; } } @@ -2793,12 +2799,12 @@ encoder->config_changed = TRUE; } -#if GST_CHECK_VERSION(1,5,0) /* Take number of MVC views from input caps if provided */ - if (GST_VIDEO_INFO_MULTIVIEW_MODE (vip) == GST_VIDEO_MULTIVIEW_MODE_FRAME_BY_FRAME || - GST_VIDEO_INFO_MULTIVIEW_MODE (vip) == GST_VIDEO_MULTIVIEW_MODE_MULTIVIEW_FRAME_BY_FRAME) + if (GST_VIDEO_INFO_MULTIVIEW_MODE (vip) == + GST_VIDEO_MULTIVIEW_MODE_FRAME_BY_FRAME + || GST_VIDEO_INFO_MULTIVIEW_MODE (vip) == + GST_VIDEO_MULTIVIEW_MODE_MULTIVIEW_FRAME_BY_FRAME) encoder->num_views = GST_VIDEO_INFO_VIEWS (vip); -#endif encoder->is_mvc = encoder->num_views > 1; @@ -2915,23 +2921,21 @@ case GST_VAAPI_ENCODER_H264_PROP_NUM_VIEWS: encoder->num_views = g_value_get_uint (value); break; - case GST_VAAPI_ENCODER_H264_PROP_VIEW_IDS: - { - guint i; - GValueArray *view_ids = g_value_get_boxed (value); - - if (view_ids == NULL) { - for (i = 0; i < encoder->num_views; i++) - encoder->view_ids[i] = i; - } - else { - g_assert (view_ids->n_values <= encoder->num_views); - - for (i = 0; i < encoder->num_views; i++) { - GValue *val = g_value_array_get_nth (view_ids, i); - encoder->view_ids[i] = g_value_get_uint (val); - } + case GST_VAAPI_ENCODER_H264_PROP_VIEW_IDS:{ + guint i; + GValueArray *view_ids = g_value_get_boxed (value); + + if (view_ids == NULL) { + for (i = 0; i < encoder->num_views; i++) + encoder->view_ids[i] = i; + } else { + g_assert (view_ids->n_values <= encoder->num_views); + + for (i = 0; i < encoder->num_views; i++) { + GValue *val = g_value_array_get_nth (view_ids, i); + encoder->view_ids[i] = g_value_get_uint (val); } + } break; } default: diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiencoder_h265.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiencoder_h265.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiencoder_h265.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiencoder_h265.c 2016-03-24 11:36:59.000000000 +0000 @@ -805,9 +805,8 @@ (slice_param->slice_fields.bits.slice_sao_luma_flag || slice_param->slice_fields.bits.slice_sao_chroma_flag || !slice_deblocking_filter_disabled_flag)) - WRITE_UINT32 (bs, - slice_param->slice_fields. - bits.slice_loop_filter_across_slices_enabled_flag, 1); + WRITE_UINT32 (bs, slice_param->slice_fields.bits. + slice_loop_filter_across_slices_enabled_flag, 1); } @@ -836,7 +835,7 @@ const guint8 * nal, guint32 size) { guint8 nal_type; - gsize ret; + G_GNUC_UNUSED gsize ret; /* FIXME */ g_assert (size); if (encoder->vps_data && encoder->sps_data && encoder->pps_data) @@ -1677,8 +1676,8 @@ slice_param->slice_fields.value = 0; - slice_param->slice_fields. - bits.slice_loop_filter_across_slices_enabled_flag = TRUE; + slice_param->slice_fields.bits. + slice_loop_filter_across_slices_enabled_flag = TRUE; /* set calculation for next slice */ last_ctu_index += cur_slice_ctus; @@ -1725,7 +1724,8 @@ goto error_create_seq_param; /* add packed vps and sps headers */ - if ((GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) & VA_ENC_PACKED_HEADER_SEQUENCE) + if ((GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) & + VA_ENC_PACKED_HEADER_SEQUENCE) && !(add_packed_vps_header (encoder, picture, sequence) && add_packed_sequence_header (encoder, picture, sequence))) { goto error_create_packed_seq_hdr; @@ -1769,7 +1769,8 @@ return FALSE; if (picture->type == GST_VAAPI_PICTURE_TYPE_I && - (GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) & VA_ENC_PACKED_HEADER_PICTURE) + (GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) & + VA_ENC_PACKED_HEADER_PICTURE) && !add_packed_picture_header (encoder, picture)) { GST_ERROR ("set picture packed header failed"); return FALSE; @@ -2276,7 +2277,7 @@ /* Only YUV 4:2:0 formats are supported for now. */ base_encoder->codedbuf_size += GST_ROUND_UP_32 (vip->width) * - GST_ROUND_UP_32 (vip->height) * 3 / 2; + GST_ROUND_UP_32 (vip->height) * 3 / 2; return GST_VAAPI_ENCODER_STATUS_SUCCESS; } diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiencoder_jpeg.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiencoder_jpeg.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiencoder_jpeg.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiencoder_jpeg.c 2016-03-24 11:36:59.000000000 +0000 @@ -393,6 +393,8 @@ g_assert (slice && slice->param_id != VA_INVALID_ID); slice_param = slice->param; + memset (slice_param, 0, sizeof (VAEncSliceParameterBufferJPEG)); + slice_param->restart_interval = 0; slice_param->num_components = pic_param->num_components; diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c 2016-03-24 11:36:59.000000000 +0000 @@ -880,17 +880,18 @@ static int find_frame_rate_code (const VAEncSequenceParameterBufferMPEG2 * seq_param) { - unsigned int delta = -1; + unsigned int ndelta, delta = -1; int code = 1, i; float frame_rate_value = seq_param->frame_rate * (seq_param->sequence_extension.bits.frame_rate_extension_d + 1) / (seq_param->sequence_extension.bits.frame_rate_extension_n + 1); - for (i = 0; i < sizeof (frame_rate_tab) / sizeof (frame_rate_tab[0]); i++) { + for (i = 0; i < G_N_ELEMENTS (frame_rate_tab); i++) { - if (fabsf (1000 * frame_rate_tab[i].value - 1000 * frame_rate_value) < delta) { + ndelta = fabsf (1000 * frame_rate_tab[i].value - 1000 * frame_rate_value); + if (ndelta < delta) { code = frame_rate_tab[i].code; - delta = fabsf (1000 * frame_rate_tab[i].value - 1000 * frame_rate_value); + delta = ndelta; } } return code; diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiencoder_objects.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiencoder_objects.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiencoder_objects.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiencoder_objects.c 2016-03-24 11:36:59.000000000 +0000 @@ -290,7 +290,8 @@ /* ------------------------------------------------------------------------- */ #if USE_JPEG_ENCODER -GST_VAAPI_CODEC_DEFINE_TYPE (GstVaapiEncHuffmanTable, gst_vaapi_enc_huffman_table); +GST_VAAPI_CODEC_DEFINE_TYPE (GstVaapiEncHuffmanTable, + gst_vaapi_enc_huffman_table); void gst_vaapi_enc_huffman_table_destroy (GstVaapiEncHuffmanTable * huf_table) diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapifilter.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapifilter.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapifilter.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapifilter.c 2016-03-24 11:36:59.000000000 +0000 @@ -79,7 +79,7 @@ /* --- VPP Types --- */ /* ------------------------------------------------------------------------- */ -GType +static GType gst_vaapi_scale_method_get_type (void) { static gsize g_type = 0; @@ -596,11 +596,12 @@ ensure_properties (); for (i = 0; i < N_PROPERTIES; i++) { + GstVaapiFilterOpData *op_data; GParamSpec *const pspec = g_properties[i]; if (!pspec) continue; - GstVaapiFilterOpData *const op_data = op_data_new (i, pspec); + op_data = op_data_new (i, pspec); if (!op_data) goto error; g_ptr_array_add (ops, op_data); @@ -647,7 +648,7 @@ if (op_data->va_type != va_type) continue; - if (op_data->va_cap_size == 0) { /* no caps, like skintone */ + if (op_data->va_cap_size == 0) { /* no caps, like skintone */ g_ptr_array_add (ops, op_data_ref (op_data)); continue; } @@ -724,7 +725,7 @@ } /* Find whether the VPP operation is supported or not */ -GstVaapiFilterOpData * +static GstVaapiFilterOpData * find_operation (GstVaapiFilter * filter, GstVaapiFilterOp op) { guint i; @@ -904,9 +905,9 @@ /* Update skin tone enhancement */ #if USE_VA_VPP -gboolean +static gboolean op_set_skintone_unlocked (GstVaapiFilter * filter, - GstVaapiFilterOpData * op_data, gboolean value) + GstVaapiFilterOpData * op_data, gboolean value) { VAProcFilterParameterBuffer *buf; @@ -929,7 +930,7 @@ static inline gboolean op_set_skintone (GstVaapiFilter * filter, GstVaapiFilterOpData * op_data, - gboolean enhance) + gboolean enhance) { gboolean success = FALSE; @@ -1869,8 +1870,7 @@ * otherwise. **/ gboolean -gst_vaapi_filter_set_skintone (GstVaapiFilter * filter, - gboolean enhance) +gst_vaapi_filter_set_skintone (GstVaapiFilter * filter, gboolean enhance) { g_return_val_if_fail (filter != NULL, FALSE); diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiimage.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiimage.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiimage.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiimage.c 2016-03-24 11:36:59.000000000 +0000 @@ -45,192 +45,184 @@ } while (0) static gboolean -_gst_vaapi_image_map(GstVaapiImage *image, GstVaapiImageRaw *raw_image); +_gst_vaapi_image_map (GstVaapiImage * image, GstVaapiImageRaw * raw_image); -static gboolean -_gst_vaapi_image_unmap(GstVaapiImage *image); +static gboolean _gst_vaapi_image_unmap (GstVaapiImage * image); static gboolean -_gst_vaapi_image_set_image(GstVaapiImage *image, const VAImage *va_image); +_gst_vaapi_image_set_image (GstVaapiImage * image, const VAImage * va_image); /* * VAImage wrapper */ static gboolean -vaapi_image_is_linear(const VAImage *va_image) +vaapi_image_is_linear (const VAImage * va_image) { - guint i, width, height, width2, height2, data_size; + guint i, width, height, width2, height2, data_size; - for (i = 1; i < va_image->num_planes; i++) - if (va_image->offsets[i] < va_image->offsets[i - 1]) - return FALSE; - - width = va_image->width; - height = va_image->height; - width2 = (width + 1) / 2; - height2 = (height + 1) / 2; - - switch (va_image->format.fourcc) { - case VA_FOURCC('N','V','1','2'): - case VA_FOURCC('Y','V','1','2'): - case VA_FOURCC('I','4','2','0'): - data_size = width * height + 2 * width2 * height2; - break; - case VA_FOURCC('Y','U','Y','2'): - case VA_FOURCC('U','Y','V','Y'): - data_size = 2 * width * height; - break; - case VA_FOURCC('Y','8','0','0'): - data_size = width * height; - break; - case VA_FOURCC('A','Y','U','V'): - case VA_FOURCC('A','R','G','B'): - case VA_FOURCC('R','G','B','A'): - case VA_FOURCC('A','B','G','R'): - case VA_FOURCC('B','G','R','A'): - case VA_FOURCC('X','R','G','B'): - case VA_FOURCC('R','G','B','X'): - case VA_FOURCC('X','B','G','R'): - case VA_FOURCC('B','G','R','X'): - data_size = 4 * width * height; - break; + for (i = 1; i < va_image->num_planes; i++) + if (va_image->offsets[i] < va_image->offsets[i - 1]) + return FALSE; + + width = va_image->width; + height = va_image->height; + width2 = (width + 1) / 2; + height2 = (height + 1) / 2; + + switch (va_image->format.fourcc) { + case VA_FOURCC ('N', 'V', '1', '2'): + case VA_FOURCC ('Y', 'V', '1', '2'): + case VA_FOURCC ('I', '4', '2', '0'): + data_size = width * height + 2 * width2 * height2; + break; + case VA_FOURCC ('Y', 'U', 'Y', '2'): + case VA_FOURCC ('U', 'Y', 'V', 'Y'): + data_size = 2 * width * height; + break; + case VA_FOURCC ('Y', '8', '0', '0'): + data_size = width * height; + break; + case VA_FOURCC ('A', 'Y', 'U', 'V'): + case VA_FOURCC ('A', 'R', 'G', 'B'): + case VA_FOURCC ('R', 'G', 'B', 'A'): + case VA_FOURCC ('A', 'B', 'G', 'R'): + case VA_FOURCC ('B', 'G', 'R', 'A'): + case VA_FOURCC ('X', 'R', 'G', 'B'): + case VA_FOURCC ('R', 'G', 'B', 'X'): + case VA_FOURCC ('X', 'B', 'G', 'R'): + case VA_FOURCC ('B', 'G', 'R', 'X'): + data_size = 4 * width * height; + break; default: - g_error("FIXME: incomplete formats %" GST_FOURCC_FORMAT, - GST_FOURCC_ARGS(va_image->format.fourcc)); - break; - } - return va_image->data_size == data_size; + g_error ("FIXME: incomplete formats %" GST_FOURCC_FORMAT, + GST_FOURCC_ARGS (va_image->format.fourcc)); + break; + } + return va_image->data_size == data_size; } static void -gst_vaapi_image_destroy(GstVaapiImage *image) +gst_vaapi_image_destroy (GstVaapiImage * image) { - GstVaapiDisplay * const display = GST_VAAPI_OBJECT_DISPLAY(image); - VAImageID image_id; - VAStatus status; - - _gst_vaapi_image_unmap(image); - - image_id = GST_VAAPI_OBJECT_ID(image); - GST_DEBUG("image %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS(image_id)); - - if (image_id != VA_INVALID_ID) { - GST_VAAPI_DISPLAY_LOCK(display); - status = vaDestroyImage(GST_VAAPI_DISPLAY_VADISPLAY(display), image_id); - GST_VAAPI_DISPLAY_UNLOCK(display); - if (!vaapi_check_status(status, "vaDestroyImage()")) - g_warning("failed to destroy image %" GST_VAAPI_ID_FORMAT, - GST_VAAPI_ID_ARGS(image_id)); - GST_VAAPI_OBJECT_ID(image) = VA_INVALID_ID; - } + GstVaapiDisplay *const display = GST_VAAPI_OBJECT_DISPLAY (image); + VAImageID image_id; + VAStatus status; + + _gst_vaapi_image_unmap (image); + + image_id = GST_VAAPI_OBJECT_ID (image); + GST_DEBUG ("image %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS (image_id)); + + if (image_id != VA_INVALID_ID) { + GST_VAAPI_DISPLAY_LOCK (display); + status = vaDestroyImage (GST_VAAPI_DISPLAY_VADISPLAY (display), image_id); + GST_VAAPI_DISPLAY_UNLOCK (display); + if (!vaapi_check_status (status, "vaDestroyImage()")) + g_warning ("failed to destroy image %" GST_VAAPI_ID_FORMAT, + GST_VAAPI_ID_ARGS (image_id)); + GST_VAAPI_OBJECT_ID (image) = VA_INVALID_ID; + } } static gboolean -_gst_vaapi_image_create(GstVaapiImage *image, GstVideoFormat format) +_gst_vaapi_image_create (GstVaapiImage * image, GstVideoFormat format) { - GstVaapiDisplay * const display = GST_VAAPI_OBJECT_DISPLAY(image); - const VAImageFormat *va_format; - VAStatus status; - - if (!gst_vaapi_display_has_image_format(display, format)) - return FALSE; - - va_format = gst_vaapi_video_format_to_va_format(format); - if (!va_format) - return FALSE; - - GST_VAAPI_DISPLAY_LOCK(display); - status = vaCreateImage( - GST_VAAPI_DISPLAY_VADISPLAY(display), - (VAImageFormat *)va_format, - image->width, - image->height, - &image->internal_image - ); - GST_VAAPI_DISPLAY_UNLOCK(display); - if (status != VA_STATUS_SUCCESS || - image->internal_image.format.fourcc != va_format->fourcc) - return FALSE; + GstVaapiDisplay *const display = GST_VAAPI_OBJECT_DISPLAY (image); + const VAImageFormat *va_format; + VAStatus status; - image->internal_format = format; - return TRUE; + if (!gst_vaapi_display_has_image_format (display, format)) + return FALSE; + + va_format = gst_vaapi_video_format_to_va_format (format); + if (!va_format) + return FALSE; + + GST_VAAPI_DISPLAY_LOCK (display); + status = vaCreateImage (GST_VAAPI_DISPLAY_VADISPLAY (display), + (VAImageFormat *) va_format, + image->width, image->height, &image->internal_image); + GST_VAAPI_DISPLAY_UNLOCK (display); + if (status != VA_STATUS_SUCCESS || + image->internal_image.format.fourcc != va_format->fourcc) + return FALSE; + + image->internal_format = format; + return TRUE; } static gboolean -gst_vaapi_image_create(GstVaapiImage *image, GstVideoFormat format, +gst_vaapi_image_create (GstVaapiImage * image, GstVideoFormat format, guint width, guint height) { - const VAImageFormat *va_format; - VAImageID image_id; + const VAImageFormat *va_format; + VAImageID image_id; - image->format = format; - image->width = width; - image->height = height; - - if (!_gst_vaapi_image_create(image, format)) { - switch (format) { - case GST_VIDEO_FORMAT_I420: - format = GST_VIDEO_FORMAT_YV12; - break; - case GST_VIDEO_FORMAT_YV12: - format = GST_VIDEO_FORMAT_I420; - break; - default: - format = 0; - break; - } - if (!format || !_gst_vaapi_image_create(image, format)) - return FALSE; + image->format = format; + image->width = width; + image->height = height; + + if (!_gst_vaapi_image_create (image, format)) { + switch (format) { + case GST_VIDEO_FORMAT_I420: + format = GST_VIDEO_FORMAT_YV12; + break; + case GST_VIDEO_FORMAT_YV12: + format = GST_VIDEO_FORMAT_I420; + break; + default: + format = 0; + break; } - image->image = image->internal_image; - image_id = image->image.image_id; - - if (image->format != image->internal_format) { - switch (image->format) { - case GST_VIDEO_FORMAT_YV12: - case GST_VIDEO_FORMAT_I420: - va_format = gst_vaapi_video_format_to_va_format(image->format); - if (!va_format) - return FALSE; - image->image.format = *va_format; - SWAP_UINT(image->image.offsets[1], image->image.offsets[2]); - SWAP_UINT(image->image.pitches[1], image->image.pitches[2]); - break; - default: - break; - } + if (!format || !_gst_vaapi_image_create (image, format)) + return FALSE; + } + image->image = image->internal_image; + image_id = image->image.image_id; + + if (image->format != image->internal_format) { + switch (image->format) { + case GST_VIDEO_FORMAT_YV12: + case GST_VIDEO_FORMAT_I420: + va_format = gst_vaapi_video_format_to_va_format (image->format); + if (!va_format) + return FALSE; + image->image.format = *va_format; + SWAP_UINT (image->image.offsets[1], image->image.offsets[2]); + SWAP_UINT (image->image.pitches[1], image->image.pitches[2]); + break; + default: + break; } - image->is_linear = vaapi_image_is_linear(&image->image); + } + image->is_linear = vaapi_image_is_linear (&image->image); - GST_DEBUG("image %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS(image_id)); - GST_VAAPI_OBJECT_ID(image) = image_id; - return TRUE; + GST_DEBUG ("image %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS (image_id)); + GST_VAAPI_OBJECT_ID (image) = image_id; + return TRUE; } static void -gst_vaapi_image_init(GstVaapiImage *image) +gst_vaapi_image_init (GstVaapiImage * image) { - image->internal_image.image_id = VA_INVALID_ID; - image->internal_image.buf = VA_INVALID_ID; - image->image.image_id = VA_INVALID_ID; - image->image.buf = VA_INVALID_ID; + image->internal_image.image_id = VA_INVALID_ID; + image->internal_image.buf = VA_INVALID_ID; + image->image.image_id = VA_INVALID_ID; + image->image.buf = VA_INVALID_ID; } static void -gst_vaapi_image_class_init(GstVaapiImageClass *klass) +gst_vaapi_image_class_init (GstVaapiImageClass * klass) { - GstVaapiObjectClass * const object_class = - GST_VAAPI_OBJECT_CLASS(klass); + GstVaapiObjectClass *const object_class = GST_VAAPI_OBJECT_CLASS (klass); - object_class->init = (GstVaapiObjectInitFunc)gst_vaapi_image_init; + object_class->init = (GstVaapiObjectInitFunc) gst_vaapi_image_init; } #define gst_vaapi_image_finalize gst_vaapi_image_destroy -GST_VAAPI_OBJECT_DEFINE_CLASS_WITH_CODE( - GstVaapiImage, - gst_vaapi_image, - gst_vaapi_image_class_init(&g_class)) +GST_VAAPI_OBJECT_DEFINE_CLASS_WITH_CODE (GstVaapiImage, + gst_vaapi_image, gst_vaapi_image_class_init (&g_class)) /** * gst_vaapi_image_new: @@ -244,33 +236,28 @@ * * Return value: the newly allocated #GstVaapiImage object */ -GstVaapiImage * -gst_vaapi_image_new( - GstVaapiDisplay *display, - GstVideoFormat format, - guint width, - guint height -) -{ - GstVaapiImage *image; - - g_return_val_if_fail(width > 0, NULL); - g_return_val_if_fail(height > 0, NULL); - - GST_DEBUG("format %s, size %ux%u", gst_vaapi_video_format_to_string(format), - width, height); - - image = gst_vaapi_object_new(gst_vaapi_image_class(), display); - if (!image) - return NULL; - - if (!gst_vaapi_image_create(image, format, width, height)) - goto error; - return image; + GstVaapiImage *gst_vaapi_image_new (GstVaapiDisplay * display, + GstVideoFormat format, guint width, guint height) +{ + GstVaapiImage *image; -error: - gst_vaapi_object_unref(image); + g_return_val_if_fail (width > 0, NULL); + g_return_val_if_fail (height > 0, NULL); + + GST_DEBUG ("format %s, size %ux%u", gst_vaapi_video_format_to_string (format), + width, height); + + image = gst_vaapi_object_new (gst_vaapi_image_class (), display); + if (!image) return NULL; + + if (!gst_vaapi_image_create (image, format, width, height)) + goto error; + return image; + +error: + gst_vaapi_object_unref (image); + return NULL; } /** @@ -286,30 +273,30 @@ * Return value: the newly allocated #GstVaapiImage object */ GstVaapiImage * -gst_vaapi_image_new_with_image(GstVaapiDisplay *display, VAImage *va_image) +gst_vaapi_image_new_with_image (GstVaapiDisplay * display, VAImage * va_image) { - GstVaapiImage *image; + GstVaapiImage *image; - g_return_val_if_fail(va_image, NULL); - g_return_val_if_fail(va_image->image_id != VA_INVALID_ID, NULL); - g_return_val_if_fail(va_image->buf != VA_INVALID_ID, NULL); - - GST_DEBUG("VA image 0x%08x, format %" GST_FOURCC_FORMAT ", size %ux%u", - va_image->image_id, - GST_FOURCC_ARGS(va_image->format.fourcc), - va_image->width, va_image->height); - - image = gst_vaapi_object_new(gst_vaapi_image_class(), display); - if (!image) - return NULL; - - if (!_gst_vaapi_image_set_image(image, va_image)) - goto error; - return image; + g_return_val_if_fail (va_image, NULL); + g_return_val_if_fail (va_image->image_id != VA_INVALID_ID, NULL); + g_return_val_if_fail (va_image->buf != VA_INVALID_ID, NULL); -error: - gst_vaapi_object_unref(image); + GST_DEBUG ("VA image 0x%08x, format %" GST_FOURCC_FORMAT ", size %ux%u", + va_image->image_id, + GST_FOURCC_ARGS (va_image->format.fourcc), + va_image->width, va_image->height); + + image = gst_vaapi_object_new (gst_vaapi_image_class (), display); + if (!image) return NULL; + + if (!_gst_vaapi_image_set_image (image, va_image)) + goto error; + return image; + +error: + gst_vaapi_object_unref (image); + return NULL; } /** @@ -321,11 +308,11 @@ * Return value: the underlying VA image id */ GstVaapiID -gst_vaapi_image_get_id(GstVaapiImage *image) +gst_vaapi_image_get_id (GstVaapiImage * image) { - g_return_val_if_fail(image != NULL, VA_INVALID_ID); + g_return_val_if_fail (image != NULL, VA_INVALID_ID); - return GST_VAAPI_OBJECT_ID(image); + return GST_VAAPI_OBJECT_ID (image); } /** @@ -338,14 +325,14 @@ * Return value: %TRUE on success */ gboolean -gst_vaapi_image_get_image(GstVaapiImage *image, VAImage *va_image) +gst_vaapi_image_get_image (GstVaapiImage * image, VAImage * va_image) { - g_return_val_if_fail(image != NULL, FALSE); + g_return_val_if_fail (image != NULL, FALSE); - if (va_image) - *va_image = image->image; + if (va_image) + *va_image = image->image; - return TRUE; + return TRUE; } /* @@ -363,55 +350,55 @@ * Return value: %TRUE on success */ gboolean -_gst_vaapi_image_set_image(GstVaapiImage *image, const VAImage *va_image) +_gst_vaapi_image_set_image (GstVaapiImage * image, const VAImage * va_image) { - GstVideoFormat format; - VAImage alt_va_image; - const VAImageFormat *alt_va_format; - - format = gst_vaapi_video_format_from_va_format(&va_image->format); - if (format == GST_VIDEO_FORMAT_UNKNOWN) - return FALSE; - - image->internal_image = *va_image; - image->internal_format = format; - image->is_linear = vaapi_image_is_linear(va_image); - image->image = *va_image; - image->format = format; - image->width = va_image->width; - image->height = va_image->height; - - GST_VAAPI_OBJECT_ID(image) = va_image->image_id; - - /* Try to linearize image */ - if (!image->is_linear) { - switch (format) { - case GST_VIDEO_FORMAT_I420: - format = GST_VIDEO_FORMAT_YV12; - break; - case GST_VIDEO_FORMAT_YV12: - format = GST_VIDEO_FORMAT_I420; - break; - default: - format = 0; - break; - } - if (format && - (alt_va_format = gst_vaapi_video_format_to_va_format(format))) { - alt_va_image = *va_image; - alt_va_image.format = *alt_va_format; - SWAP_UINT(alt_va_image.offsets[1], alt_va_image.offsets[2]); - SWAP_UINT(alt_va_image.pitches[1], alt_va_image.pitches[2]); - if (vaapi_image_is_linear(&alt_va_image)) { - image->image = alt_va_image; - image->format = format; - image->is_linear = TRUE; - GST_DEBUG("linearized image to %s format", - gst_vaapi_video_format_to_string(format)); - } - } + GstVideoFormat format; + VAImage alt_va_image; + const VAImageFormat *alt_va_format; + + format = gst_vaapi_video_format_from_va_format (&va_image->format); + if (format == GST_VIDEO_FORMAT_UNKNOWN) + return FALSE; + + image->internal_image = *va_image; + image->internal_format = format; + image->is_linear = vaapi_image_is_linear (va_image); + image->image = *va_image; + image->format = format; + image->width = va_image->width; + image->height = va_image->height; + + GST_VAAPI_OBJECT_ID (image) = va_image->image_id; + + /* Try to linearize image */ + if (!image->is_linear) { + switch (format) { + case GST_VIDEO_FORMAT_I420: + format = GST_VIDEO_FORMAT_YV12; + break; + case GST_VIDEO_FORMAT_YV12: + format = GST_VIDEO_FORMAT_I420; + break; + default: + format = 0; + break; } - return TRUE; + if (format && + (alt_va_format = gst_vaapi_video_format_to_va_format (format))) { + alt_va_image = *va_image; + alt_va_image.format = *alt_va_format; + SWAP_UINT (alt_va_image.offsets[1], alt_va_image.offsets[2]); + SWAP_UINT (alt_va_image.pitches[1], alt_va_image.pitches[2]); + if (vaapi_image_is_linear (&alt_va_image)) { + image->image = alt_va_image; + image->format = format; + image->is_linear = TRUE; + GST_DEBUG ("linearized image to %s format", + gst_vaapi_video_format_to_string (format)); + } + } + } + return TRUE; } /** @@ -423,11 +410,11 @@ * Return value: the #GstVideoFormat */ GstVideoFormat -gst_vaapi_image_get_format(GstVaapiImage *image) +gst_vaapi_image_get_format (GstVaapiImage * image) { - g_return_val_if_fail(image != NULL, 0); + g_return_val_if_fail (image != NULL, 0); - return image->format; + return image->format; } /** @@ -439,11 +426,11 @@ * Return value: the image width, in pixels */ guint -gst_vaapi_image_get_width(GstVaapiImage *image) +gst_vaapi_image_get_width (GstVaapiImage * image) { - g_return_val_if_fail(image != NULL, 0); + g_return_val_if_fail (image != NULL, 0); - return image->width; + return image->width; } /** @@ -455,11 +442,11 @@ * Return value: the image height, in pixels. */ guint -gst_vaapi_image_get_height(GstVaapiImage *image) +gst_vaapi_image_get_height (GstVaapiImage * image) { - g_return_val_if_fail(image != NULL, 0); + g_return_val_if_fail (image != NULL, 0); - return image->height; + return image->height; } /** @@ -471,15 +458,16 @@ * Retrieves the dimensions of a #GstVaapiImage. */ void -gst_vaapi_image_get_size(GstVaapiImage *image, guint *pwidth, guint *pheight) +gst_vaapi_image_get_size (GstVaapiImage * image, guint * pwidth, + guint * pheight) { - g_return_if_fail(image != NULL); + g_return_if_fail (image != NULL); - if (pwidth) - *pwidth = image->width; + if (pwidth) + *pwidth = image->width; - if (pheight) - *pheight = image->height; + if (pheight) + *pheight = image->height; } /** @@ -493,11 +481,11 @@ * Return value: %TRUE if image data planes are allocated from a single buffer */ gboolean -gst_vaapi_image_is_linear(GstVaapiImage *image) +gst_vaapi_image_is_linear (GstVaapiImage * image) { - g_return_val_if_fail(image != NULL, FALSE); + g_return_val_if_fail (image != NULL, FALSE); - return image->is_linear; + return image->is_linear; } /** @@ -509,17 +497,17 @@ * Return value: %TRUE if the @image is mapped */ static inline gboolean -_gst_vaapi_image_is_mapped(GstVaapiImage *image) +_gst_vaapi_image_is_mapped (GstVaapiImage * image) { - return image->image_data != NULL; + return image->image_data != NULL; } gboolean -gst_vaapi_image_is_mapped(GstVaapiImage *image) +gst_vaapi_image_is_mapped (GstVaapiImage * image) { - g_return_val_if_fail(image != NULL, FALSE); + g_return_val_if_fail (image != NULL, FALSE); - return _gst_vaapi_image_is_mapped(image); + return _gst_vaapi_image_is_mapped (image); } /** @@ -532,51 +520,48 @@ * Return value: %TRUE on success */ gboolean -gst_vaapi_image_map(GstVaapiImage *image) +gst_vaapi_image_map (GstVaapiImage * image) { - g_return_val_if_fail(image != NULL, FALSE); + g_return_val_if_fail (image != NULL, FALSE); - return _gst_vaapi_image_map(image, NULL); + return _gst_vaapi_image_map (image, NULL); } gboolean -_gst_vaapi_image_map(GstVaapiImage *image, GstVaapiImageRaw *raw_image) +_gst_vaapi_image_map (GstVaapiImage * image, GstVaapiImageRaw * raw_image) { - GstVaapiDisplay *display; - VAStatus status; - guint i; - - if (_gst_vaapi_image_is_mapped(image)) - goto map_success; - - display = GST_VAAPI_OBJECT_DISPLAY(image); - if (!display) - return FALSE; - - GST_VAAPI_DISPLAY_LOCK(display); - status = vaMapBuffer( - GST_VAAPI_DISPLAY_VADISPLAY(display), - image->image.buf, - (void **)&image->image_data - ); - GST_VAAPI_DISPLAY_UNLOCK(display); - if (!vaapi_check_status(status, "vaMapBuffer()")) - return FALSE; + GstVaapiDisplay *display; + VAStatus status; + guint i; + + if (_gst_vaapi_image_is_mapped (image)) + goto map_success; + + display = GST_VAAPI_OBJECT_DISPLAY (image); + if (!display) + return FALSE; + + GST_VAAPI_DISPLAY_LOCK (display); + status = vaMapBuffer (GST_VAAPI_DISPLAY_VADISPLAY (display), + image->image.buf, (void **) &image->image_data); + GST_VAAPI_DISPLAY_UNLOCK (display); + if (!vaapi_check_status (status, "vaMapBuffer()")) + return FALSE; map_success: - if (raw_image) { - const VAImage * const va_image = &image->image; - raw_image->format = image->format; - raw_image->width = va_image->width; - raw_image->height = va_image->height; - raw_image->num_planes = va_image->num_planes; - for (i = 0; i < raw_image->num_planes; i++) { - raw_image->pixels[i] = (guchar *)image->image_data + - va_image->offsets[i]; - raw_image->stride[i] = va_image->pitches[i]; - } + if (raw_image) { + const VAImage *const va_image = &image->image; + raw_image->format = image->format; + raw_image->width = va_image->width; + raw_image->height = va_image->height; + raw_image->num_planes = va_image->num_planes; + for (i = 0; i < raw_image->num_planes; i++) { + raw_image->pixels[i] = (guchar *) image->image_data + + va_image->offsets[i]; + raw_image->stride[i] = va_image->pitches[i]; } - return TRUE; + } + return TRUE; } /** @@ -589,37 +574,35 @@ * Return value: %TRUE on success */ gboolean -gst_vaapi_image_unmap(GstVaapiImage *image) +gst_vaapi_image_unmap (GstVaapiImage * image) { - g_return_val_if_fail(image != NULL, FALSE); + g_return_val_if_fail (image != NULL, FALSE); - return _gst_vaapi_image_unmap(image); + return _gst_vaapi_image_unmap (image); } gboolean -_gst_vaapi_image_unmap(GstVaapiImage *image) +_gst_vaapi_image_unmap (GstVaapiImage * image) { - GstVaapiDisplay *display; - VAStatus status; + GstVaapiDisplay *display; + VAStatus status; - if (!_gst_vaapi_image_is_mapped(image)) - return TRUE; + if (!_gst_vaapi_image_is_mapped (image)) + return TRUE; - display = GST_VAAPI_OBJECT_DISPLAY(image); - if (!display) - return FALSE; - - GST_VAAPI_DISPLAY_LOCK(display); - status = vaUnmapBuffer( - GST_VAAPI_DISPLAY_VADISPLAY(display), - image->image.buf - ); - GST_VAAPI_DISPLAY_UNLOCK(display); - if (!vaapi_check_status(status, "vaUnmapBuffer()")) - return FALSE; + display = GST_VAAPI_OBJECT_DISPLAY (image); + if (!display) + return FALSE; - image->image_data = NULL; - return TRUE; + GST_VAAPI_DISPLAY_LOCK (display); + status = vaUnmapBuffer (GST_VAAPI_DISPLAY_VADISPLAY (display), + image->image.buf); + GST_VAAPI_DISPLAY_UNLOCK (display); + if (!vaapi_check_status (status, "vaUnmapBuffer()")) + return FALSE; + + image->image_data = NULL; + return TRUE; } /** @@ -632,12 +615,12 @@ * Return value: the number of planes available in the @image */ guint -gst_vaapi_image_get_plane_count(GstVaapiImage *image) +gst_vaapi_image_get_plane_count (GstVaapiImage * image) { - g_return_val_if_fail(image != NULL, 0); - g_return_val_if_fail(_gst_vaapi_image_is_mapped(image), 0); + g_return_val_if_fail (image != NULL, 0); + g_return_val_if_fail (_gst_vaapi_image_is_mapped (image), 0); - return image->image.num_planes; + return image->image.num_planes; } /** @@ -651,13 +634,13 @@ * Return value: the pixels data of the specified @plane */ guchar * -gst_vaapi_image_get_plane(GstVaapiImage *image, guint plane) +gst_vaapi_image_get_plane (GstVaapiImage * image, guint plane) { - g_return_val_if_fail(image != NULL, NULL); - g_return_val_if_fail(_gst_vaapi_image_is_mapped(image), NULL); - g_return_val_if_fail(plane < image->image.num_planes, NULL); + g_return_val_if_fail (image != NULL, NULL); + g_return_val_if_fail (_gst_vaapi_image_is_mapped (image), NULL); + g_return_val_if_fail (plane < image->image.num_planes, NULL); - return image->image_data + image->image.offsets[plane]; + return image->image_data + image->image.offsets[plane]; } /** @@ -671,13 +654,13 @@ * Return value: the line size (stride) of the specified plane */ guint -gst_vaapi_image_get_pitch(GstVaapiImage *image, guint plane) +gst_vaapi_image_get_pitch (GstVaapiImage * image, guint plane) { - g_return_val_if_fail(image != NULL, 0); - g_return_val_if_fail(_gst_vaapi_image_is_mapped(image), 0); - g_return_val_if_fail(plane < image->image.num_planes, 0); + g_return_val_if_fail (image != NULL, 0); + g_return_val_if_fail (_gst_vaapi_image_is_mapped (image), 0); + g_return_val_if_fail (plane < image->image.num_planes, 0); - return image->image.pitches[plane]; + return image->image.pitches[plane]; } /** @@ -691,198 +674,177 @@ * Return value: the whole image data size of the @image */ guint -gst_vaapi_image_get_data_size(GstVaapiImage *image) +gst_vaapi_image_get_data_size (GstVaapiImage * image) { - g_return_val_if_fail(image != NULL, 0); + g_return_val_if_fail (image != NULL, 0); - return image->image.data_size; + return image->image.data_size; } #include static gboolean -init_image_from_video_meta(GstVaapiImageRaw *raw_image, GstVideoMeta *vmeta) +init_image_from_video_meta (GstVaapiImageRaw * raw_image, GstVideoMeta * vmeta) { - GST_FIXME("map from GstVideoMeta + add fini_image_from_buffer()"); - return FALSE; + GST_FIXME ("map from GstVideoMeta + add fini_image_from_buffer()"); + return FALSE; } static gboolean -init_image_from_buffer(GstVaapiImageRaw *raw_image, GstBuffer *buffer) +init_image_from_buffer (GstVaapiImageRaw * raw_image, GstBuffer * buffer) { - GstVideoMeta * const vmeta = gst_buffer_get_video_meta(buffer); + GstVideoMeta *const vmeta = gst_buffer_get_video_meta (buffer); - return vmeta ? init_image_from_video_meta(raw_image, vmeta) : FALSE; + return vmeta ? init_image_from_video_meta (raw_image, vmeta) : FALSE; } /* Copy N lines of an image */ static inline void -memcpy_pic( - guchar *dst, - guint dst_stride, - const guchar *src, - guint src_stride, - guint len, - guint height -) -{ - guint i; - - for (i = 0; i < height; i++) { - memcpy(dst, src, len); - dst += dst_stride; - src += src_stride; - } +memcpy_pic (guchar * dst, + guint dst_stride, + const guchar * src, guint src_stride, guint len, guint height) +{ + guint i; + + for (i = 0; i < height; i++) { + memcpy (dst, src, len); + dst += dst_stride; + src += src_stride; + } } /* Copy NV12 images */ static void -copy_image_NV12( - GstVaapiImageRaw *dst_image, - GstVaapiImageRaw *src_image, - const GstVaapiRectangle *rect -) -{ - guchar *dst, *src; - guint dst_stride, src_stride; - - /* Y plane */ - dst_stride = dst_image->stride[0]; - dst = dst_image->pixels[0] + rect->y * dst_stride + rect->x; - src_stride = src_image->stride[0]; - src = src_image->pixels[0] + rect->y * src_stride + rect->x; - memcpy_pic(dst, dst_stride, src, src_stride, rect->width, rect->height); - - /* UV plane */ - dst_stride = dst_image->stride[1]; - dst = dst_image->pixels[1] + (rect->y / 2) * dst_stride + (rect->x & -2); - src_stride = src_image->stride[1]; - src = src_image->pixels[1] + (rect->y / 2) * src_stride + (rect->x & -2); - memcpy_pic(dst, dst_stride, src, src_stride, rect->width, rect->height / 2); +copy_image_NV12 (GstVaapiImageRaw * dst_image, + GstVaapiImageRaw * src_image, const GstVaapiRectangle * rect) +{ + guchar *dst, *src; + guint dst_stride, src_stride; + + /* Y plane */ + dst_stride = dst_image->stride[0]; + dst = dst_image->pixels[0] + rect->y * dst_stride + rect->x; + src_stride = src_image->stride[0]; + src = src_image->pixels[0] + rect->y * src_stride + rect->x; + memcpy_pic (dst, dst_stride, src, src_stride, rect->width, rect->height); + + /* UV plane */ + dst_stride = dst_image->stride[1]; + dst = dst_image->pixels[1] + (rect->y / 2) * dst_stride + (rect->x & -2); + src_stride = src_image->stride[1]; + src = src_image->pixels[1] + (rect->y / 2) * src_stride + (rect->x & -2); + memcpy_pic (dst, dst_stride, src, src_stride, rect->width, rect->height / 2); } /* Copy YV12 images */ static void -copy_image_YV12( - GstVaapiImageRaw *dst_image, - GstVaapiImageRaw *src_image, - const GstVaapiRectangle *rect -) -{ - guchar *dst, *src; - guint dst_stride, src_stride; - guint i, x, y, w, h; - - /* Y plane */ - dst_stride = dst_image->stride[0]; - dst = dst_image->pixels[0] + rect->y * dst_stride + rect->x; - src_stride = src_image->stride[0]; - src = src_image->pixels[0] + rect->y * src_stride + rect->x; - memcpy_pic(dst, dst_stride, src, src_stride, rect->width, rect->height); - - /* U/V planes */ - x = rect->x / 2; - y = rect->y / 2; - w = rect->width / 2; - h = rect->height / 2; - for (i = 1; i < dst_image->num_planes; i++) { - dst_stride = dst_image->stride[i]; - dst = dst_image->pixels[i] + y * dst_stride + x; - src_stride = src_image->stride[i]; - src = src_image->pixels[i] + y * src_stride + x; - memcpy_pic(dst, dst_stride, src, src_stride, w, h); - } +copy_image_YV12 (GstVaapiImageRaw * dst_image, + GstVaapiImageRaw * src_image, const GstVaapiRectangle * rect) +{ + guchar *dst, *src; + guint dst_stride, src_stride; + guint i, x, y, w, h; + + /* Y plane */ + dst_stride = dst_image->stride[0]; + dst = dst_image->pixels[0] + rect->y * dst_stride + rect->x; + src_stride = src_image->stride[0]; + src = src_image->pixels[0] + rect->y * src_stride + rect->x; + memcpy_pic (dst, dst_stride, src, src_stride, rect->width, rect->height); + + /* U/V planes */ + x = rect->x / 2; + y = rect->y / 2; + w = rect->width / 2; + h = rect->height / 2; + for (i = 1; i < dst_image->num_planes; i++) { + dst_stride = dst_image->stride[i]; + dst = dst_image->pixels[i] + y * dst_stride + x; + src_stride = src_image->stride[i]; + src = src_image->pixels[i] + y * src_stride + x; + memcpy_pic (dst, dst_stride, src, src_stride, w, h); + } } /* Copy YUY2 images */ static void -copy_image_YUY2( - GstVaapiImageRaw *dst_image, - GstVaapiImageRaw *src_image, - const GstVaapiRectangle *rect -) -{ - guchar *dst, *src; - guint dst_stride, src_stride; - - /* YUV 4:2:2, full vertical resolution */ - dst_stride = dst_image->stride[0]; - dst = dst_image->pixels[0] + rect->y * dst_stride + rect->x * 2; - src_stride = src_image->stride[0]; - src = src_image->pixels[0] + rect->y * src_stride + rect->x * 2; - memcpy_pic(dst, dst_stride, src, src_stride, rect->width * 2, rect->height); +copy_image_YUY2 (GstVaapiImageRaw * dst_image, + GstVaapiImageRaw * src_image, const GstVaapiRectangle * rect) +{ + guchar *dst, *src; + guint dst_stride, src_stride; + + /* YUV 4:2:2, full vertical resolution */ + dst_stride = dst_image->stride[0]; + dst = dst_image->pixels[0] + rect->y * dst_stride + rect->x * 2; + src_stride = src_image->stride[0]; + src = src_image->pixels[0] + rect->y * src_stride + rect->x * 2; + memcpy_pic (dst, dst_stride, src, src_stride, rect->width * 2, rect->height); } /* Copy RGBA images */ static void -copy_image_RGBA( - GstVaapiImageRaw *dst_image, - GstVaapiImageRaw *src_image, - const GstVaapiRectangle *rect -) -{ - guchar *dst, *src; - guint dst_stride, src_stride; - - dst_stride = dst_image->stride[0]; - dst = dst_image->pixels[0] + rect->y * dst_stride + rect->x; - src_stride = src_image->stride[0]; - src = src_image->pixels[0] + rect->y * src_stride + rect->x; - memcpy_pic(dst, dst_stride, src, src_stride, 4 * rect->width, rect->height); +copy_image_RGBA (GstVaapiImageRaw * dst_image, + GstVaapiImageRaw * src_image, const GstVaapiRectangle * rect) +{ + guchar *dst, *src; + guint dst_stride, src_stride; + + dst_stride = dst_image->stride[0]; + dst = dst_image->pixels[0] + rect->y * dst_stride + rect->x; + src_stride = src_image->stride[0]; + src = src_image->pixels[0] + rect->y * src_stride + rect->x; + memcpy_pic (dst, dst_stride, src, src_stride, 4 * rect->width, rect->height); } static gboolean -copy_image( - GstVaapiImageRaw *dst_image, - GstVaapiImageRaw *src_image, - const GstVaapiRectangle *rect -) -{ - GstVaapiRectangle default_rect; - - if (dst_image->format != src_image->format || - dst_image->width != src_image->width || - dst_image->height != src_image->height) - return FALSE; - - if (rect) { - if (rect->x >= src_image->width || - rect->x + rect->width > src_image->width || - rect->y >= src_image->height || - rect->y + rect->height > src_image->height) - return FALSE; - } - else { - default_rect.x = 0; - default_rect.y = 0; - default_rect.width = src_image->width; - default_rect.height = src_image->height; - rect = &default_rect; - } +copy_image (GstVaapiImageRaw * dst_image, + GstVaapiImageRaw * src_image, const GstVaapiRectangle * rect) +{ + GstVaapiRectangle default_rect; + + if (dst_image->format != src_image->format || + dst_image->width != src_image->width || + dst_image->height != src_image->height) + return FALSE; + + if (rect) { + if (rect->x >= src_image->width || + rect->x + rect->width > src_image->width || + rect->y >= src_image->height || + rect->y + rect->height > src_image->height) + return FALSE; + } else { + default_rect.x = 0; + default_rect.y = 0; + default_rect.width = src_image->width; + default_rect.height = src_image->height; + rect = &default_rect; + } - switch (dst_image->format) { + switch (dst_image->format) { case GST_VIDEO_FORMAT_NV12: - copy_image_NV12(dst_image, src_image, rect); - break; + copy_image_NV12 (dst_image, src_image, rect); + break; case GST_VIDEO_FORMAT_YV12: case GST_VIDEO_FORMAT_I420: - copy_image_YV12(dst_image, src_image, rect); - break; + copy_image_YV12 (dst_image, src_image, rect); + break; case GST_VIDEO_FORMAT_YUY2: case GST_VIDEO_FORMAT_UYVY: - copy_image_YUY2(dst_image, src_image, rect); - break; + copy_image_YUY2 (dst_image, src_image, rect); + break; case GST_VIDEO_FORMAT_ARGB: case GST_VIDEO_FORMAT_RGBA: case GST_VIDEO_FORMAT_ABGR: case GST_VIDEO_FORMAT_BGRA: - copy_image_RGBA(dst_image, src_image, rect); - break; + copy_image_RGBA (dst_image, src_image, rect); + break; default: - GST_ERROR("unsupported image format for copy"); - return FALSE; - } - return TRUE; + GST_ERROR ("unsupported image format for copy"); + return FALSE; + } + return TRUE; } /** @@ -898,34 +860,31 @@ * Return value: %TRUE on success */ gboolean -gst_vaapi_image_get_buffer( - GstVaapiImage *image, - GstBuffer *buffer, - GstVaapiRectangle *rect -) -{ - GstVaapiImageRaw dst_image, src_image; - gboolean success; - - g_return_val_if_fail(image != NULL, FALSE); - g_return_val_if_fail(GST_IS_BUFFER(buffer), FALSE); - - if (!init_image_from_buffer(&dst_image, buffer)) - return FALSE; - if (dst_image.format != image->format) - return FALSE; - if (dst_image.width != image->width || dst_image.height != image->height) - return FALSE; - - if (!_gst_vaapi_image_map(image, &src_image)) - return FALSE; +gst_vaapi_image_get_buffer (GstVaapiImage * image, + GstBuffer * buffer, GstVaapiRectangle * rect) +{ + GstVaapiImageRaw dst_image, src_image; + gboolean success; + + g_return_val_if_fail (image != NULL, FALSE); + g_return_val_if_fail (GST_IS_BUFFER (buffer), FALSE); + + if (!init_image_from_buffer (&dst_image, buffer)) + return FALSE; + if (dst_image.format != image->format) + return FALSE; + if (dst_image.width != image->width || dst_image.height != image->height) + return FALSE; + + if (!_gst_vaapi_image_map (image, &src_image)) + return FALSE; - success = copy_image(&dst_image, &src_image, rect); + success = copy_image (&dst_image, &src_image, rect); - if (!_gst_vaapi_image_unmap(image)) - return FALSE; + if (!_gst_vaapi_image_unmap (image)) + return FALSE; - return success; + return success; } /** @@ -941,26 +900,23 @@ * Return value: %TRUE on success */ gboolean -gst_vaapi_image_get_raw( - GstVaapiImage *image, - GstVaapiImageRaw *dst_image, - GstVaapiRectangle *rect -) +gst_vaapi_image_get_raw (GstVaapiImage * image, + GstVaapiImageRaw * dst_image, GstVaapiRectangle * rect) { - GstVaapiImageRaw src_image; - gboolean success; + GstVaapiImageRaw src_image; + gboolean success; - g_return_val_if_fail(image != NULL, FALSE); + g_return_val_if_fail (image != NULL, FALSE); - if (!_gst_vaapi_image_map(image, &src_image)) - return FALSE; + if (!_gst_vaapi_image_map (image, &src_image)) + return FALSE; - success = copy_image(dst_image, &src_image, rect); + success = copy_image (dst_image, &src_image, rect); - if (!_gst_vaapi_image_unmap(image)) - return FALSE; + if (!_gst_vaapi_image_unmap (image)) + return FALSE; - return success; + return success; } /** @@ -976,34 +932,31 @@ * Return value: %TRUE on success */ gboolean -gst_vaapi_image_update_from_buffer( - GstVaapiImage *image, - GstBuffer *buffer, - GstVaapiRectangle *rect -) -{ - GstVaapiImageRaw dst_image, src_image; - gboolean success; - - g_return_val_if_fail(image != NULL, FALSE); - g_return_val_if_fail(GST_IS_BUFFER(buffer), FALSE); - - if (!init_image_from_buffer(&src_image, buffer)) - return FALSE; - if (src_image.format != image->format) - return FALSE; - if (src_image.width != image->width || src_image.height != image->height) - return FALSE; - - if (!_gst_vaapi_image_map(image, &dst_image)) - return FALSE; +gst_vaapi_image_update_from_buffer (GstVaapiImage * image, + GstBuffer * buffer, GstVaapiRectangle * rect) +{ + GstVaapiImageRaw dst_image, src_image; + gboolean success; + + g_return_val_if_fail (image != NULL, FALSE); + g_return_val_if_fail (GST_IS_BUFFER (buffer), FALSE); + + if (!init_image_from_buffer (&src_image, buffer)) + return FALSE; + if (src_image.format != image->format) + return FALSE; + if (src_image.width != image->width || src_image.height != image->height) + return FALSE; + + if (!_gst_vaapi_image_map (image, &dst_image)) + return FALSE; - success = copy_image(&dst_image, &src_image, rect); + success = copy_image (&dst_image, &src_image, rect); - if (!_gst_vaapi_image_unmap(image)) - return FALSE; + if (!_gst_vaapi_image_unmap (image)) + return FALSE; - return success; + return success; } /** @@ -1020,26 +973,23 @@ * Return value: %TRUE on success */ gboolean -gst_vaapi_image_update_from_raw( - GstVaapiImage *image, - GstVaapiImageRaw *src_image, - GstVaapiRectangle *rect -) +gst_vaapi_image_update_from_raw (GstVaapiImage * image, + GstVaapiImageRaw * src_image, GstVaapiRectangle * rect) { - GstVaapiImageRaw dst_image; - gboolean success; + GstVaapiImageRaw dst_image; + gboolean success; - g_return_val_if_fail(image != NULL, FALSE); + g_return_val_if_fail (image != NULL, FALSE); - if (!_gst_vaapi_image_map(image, &dst_image)) - return FALSE; + if (!_gst_vaapi_image_map (image, &dst_image)) + return FALSE; - success = copy_image(&dst_image, src_image, rect); + success = copy_image (&dst_image, src_image, rect); - if (!_gst_vaapi_image_unmap(image)) - return FALSE; + if (!_gst_vaapi_image_unmap (image)) + return FALSE; - return success; + return success; } /** @@ -1053,23 +1003,23 @@ * Return value: %TRUE on success */ gboolean -gst_vaapi_image_copy(GstVaapiImage *dst_image, GstVaapiImage *src_image) +gst_vaapi_image_copy (GstVaapiImage * dst_image, GstVaapiImage * src_image) { - GstVaapiImageRaw dst_image_raw, src_image_raw; - gboolean success = FALSE; + GstVaapiImageRaw dst_image_raw, src_image_raw; + gboolean success = FALSE; - g_return_val_if_fail(dst_image != NULL, FALSE); - g_return_val_if_fail(src_image != NULL, FALSE); + g_return_val_if_fail (dst_image != NULL, FALSE); + g_return_val_if_fail (src_image != NULL, FALSE); - if (!_gst_vaapi_image_map(dst_image, &dst_image_raw)) - goto end; - if (!_gst_vaapi_image_map(src_image, &src_image_raw)) - goto end; + if (!_gst_vaapi_image_map (dst_image, &dst_image_raw)) + goto end; + if (!_gst_vaapi_image_map (src_image, &src_image_raw)) + goto end; - success = copy_image(&dst_image_raw, &src_image_raw, NULL); + success = copy_image (&dst_image_raw, &src_image_raw, NULL); end: - _gst_vaapi_image_unmap(src_image); - _gst_vaapi_image_unmap(dst_image); - return success; + _gst_vaapi_image_unmap (src_image); + _gst_vaapi_image_unmap (dst_image); + return success; } diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiimagepool.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiimagepool.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiimagepool.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiimagepool.c 2016-03-24 11:36:59.000000000 +0000 @@ -41,7 +41,7 @@ */ struct _GstVaapiImagePool { - /*< private >*/ + /*< private > */ GstVaapiVideoPool parent_instance; GstVideoFormat format; @@ -74,7 +74,8 @@ { static const GstVaapiVideoPoolClass GstVaapiImagePoolClass = { {sizeof (GstVaapiImagePool), - (GDestroyNotify) gst_vaapi_video_pool_finalize}, + (GDestroyNotify) gst_vaapi_video_pool_finalize} + , .alloc_object = gst_vaapi_image_pool_alloc_object }; return GST_VAAPI_MINI_OBJECT_CLASS (&GstVaapiImagePoolClass); diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiparser_frame.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiparser_frame.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiparser_frame.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiparser_frame.c 2016-03-24 11:36:59.000000000 +0000 @@ -29,40 +29,40 @@ #include "gstvaapiparser_frame.h" static inline const GstVaapiMiniObjectClass * -gst_vaapi_parser_frame_class(void) +gst_vaapi_parser_frame_class (void) { - static const GstVaapiMiniObjectClass GstVaapiParserFrameClass = { - sizeof(GstVaapiParserFrame), - (GDestroyNotify)gst_vaapi_parser_frame_free - }; - return &GstVaapiParserFrameClass; + static const GstVaapiMiniObjectClass GstVaapiParserFrameClass = { + sizeof (GstVaapiParserFrame), + (GDestroyNotify) gst_vaapi_parser_frame_free + }; + return &GstVaapiParserFrameClass; } static inline gboolean -alloc_units(GArray **units_ptr, guint size) +alloc_units (GArray ** units_ptr, guint size) { - GArray *units; + GArray *units; - units = g_array_sized_new(FALSE, FALSE, sizeof(GstVaapiDecoderUnit), size); - *units_ptr = units; - return units != NULL; + units = g_array_sized_new (FALSE, FALSE, sizeof (GstVaapiDecoderUnit), size); + *units_ptr = units; + return units != NULL; } static inline void -free_units(GArray **units_ptr) +free_units (GArray ** units_ptr) { - GArray * const units = *units_ptr; - guint i; + GArray *const units = *units_ptr; + guint i; - if (units) { - for (i = 0; i < units->len; i++) { - GstVaapiDecoderUnit * const unit = - &g_array_index(units, GstVaapiDecoderUnit, i); - gst_vaapi_decoder_unit_clear(unit); - } - g_array_free(units, TRUE); - *units_ptr = NULL; + if (units) { + for (i = 0; i < units->len; i++) { + GstVaapiDecoderUnit *const unit = + &g_array_index (units, GstVaapiDecoderUnit, i); + gst_vaapi_decoder_unit_clear (unit); } + g_array_free (units, TRUE); + *units_ptr = NULL; + } } /** @@ -75,32 +75,32 @@ * Returns: The newly allocated #GstVaapiParserFrame */ GstVaapiParserFrame * -gst_vaapi_parser_frame_new(guint width, guint height) +gst_vaapi_parser_frame_new (guint width, guint height) { - GstVaapiParserFrame *frame; - guint num_slices; + GstVaapiParserFrame *frame; + guint num_slices; - frame = (GstVaapiParserFrame *) - gst_vaapi_mini_object_new(gst_vaapi_parser_frame_class()); - if (!frame) - return NULL; - - if (!height) - height = 1088; - num_slices = (height + 15) / 16; - - if (!alloc_units(&frame->pre_units, 16)) - goto error; - if (!alloc_units(&frame->units, num_slices)) - goto error; - if (!alloc_units(&frame->post_units, 1)) - goto error; - frame->output_offset = 0; - return frame; + frame = (GstVaapiParserFrame *) + gst_vaapi_mini_object_new (gst_vaapi_parser_frame_class ()); + if (!frame) + return NULL; + + if (!height) + height = 1088; + num_slices = (height + 15) / 16; + + if (!alloc_units (&frame->pre_units, 16)) + goto error; + if (!alloc_units (&frame->units, num_slices)) + goto error; + if (!alloc_units (&frame->post_units, 1)) + goto error; + frame->output_offset = 0; + return frame; error: - gst_vaapi_parser_frame_unref(frame); - return NULL; + gst_vaapi_parser_frame_unref (frame); + return NULL; } /** @@ -114,11 +114,11 @@ * sub-classes. */ void -gst_vaapi_parser_frame_free(GstVaapiParserFrame *frame) +gst_vaapi_parser_frame_free (GstVaapiParserFrame * frame) { - free_units(&frame->units); - free_units(&frame->pre_units); - free_units(&frame->post_units); + free_units (&frame->units); + free_units (&frame->pre_units); + free_units (&frame->post_units); } /** @@ -129,19 +129,19 @@ * Appends unit to the @frame. */ void -gst_vaapi_parser_frame_append_unit(GstVaapiParserFrame *frame, - GstVaapiDecoderUnit *unit) +gst_vaapi_parser_frame_append_unit (GstVaapiParserFrame * frame, + GstVaapiDecoderUnit * unit) { - GArray **unit_array_ptr; + GArray **unit_array_ptr; - unit->offset = frame->output_offset; - frame->output_offset += unit->size; + unit->offset = frame->output_offset; + frame->output_offset += unit->size; - if (GST_VAAPI_DECODER_UNIT_IS_SLICE(unit)) - unit_array_ptr = &frame->units; - else if (GST_VAAPI_DECODER_UNIT_IS_FRAME_END(unit)) - unit_array_ptr = &frame->post_units; - else - unit_array_ptr = &frame->pre_units; - g_array_append_val(*unit_array_ptr, *unit); + if (GST_VAAPI_DECODER_UNIT_IS_SLICE (unit)) + unit_array_ptr = &frame->units; + else if (GST_VAAPI_DECODER_UNIT_IS_FRAME_END (unit)) + unit_array_ptr = &frame->post_units; + else + unit_array_ptr = &frame->pre_units; + g_array_append_val (*unit_array_ptr, *unit); } diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapipixmap.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapipixmap.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapipixmap.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapipixmap.c 2016-03-24 11:36:59.000000000 +0000 @@ -39,61 +39,61 @@ #undef gst_vaapi_pixmap_replace static inline GstVaapiPixmap * -gst_vaapi_pixmap_new_internal(const GstVaapiPixmapClass *pixmap_class, - GstVaapiDisplay *display) +gst_vaapi_pixmap_new_internal (const GstVaapiPixmapClass * pixmap_class, + GstVaapiDisplay * display) { - g_assert(pixmap_class->create != NULL); - g_assert(pixmap_class->render != NULL); + g_assert (pixmap_class->create != NULL); + g_assert (pixmap_class->render != NULL); - return gst_vaapi_object_new(GST_VAAPI_OBJECT_CLASS(pixmap_class), display); + return gst_vaapi_object_new (GST_VAAPI_OBJECT_CLASS (pixmap_class), display); } GstVaapiPixmap * -gst_vaapi_pixmap_new(const GstVaapiPixmapClass *pixmap_class, - GstVaapiDisplay *display, GstVideoFormat format, guint width, guint height) +gst_vaapi_pixmap_new (const GstVaapiPixmapClass * pixmap_class, + GstVaapiDisplay * display, GstVideoFormat format, guint width, guint height) { - GstVaapiPixmap *pixmap; + GstVaapiPixmap *pixmap; - g_return_val_if_fail(format != GST_VIDEO_FORMAT_UNKNOWN && - format != GST_VIDEO_FORMAT_ENCODED, NULL); - g_return_val_if_fail(width > 0, NULL); - g_return_val_if_fail(height > 0, NULL); - - pixmap = gst_vaapi_pixmap_new_internal(pixmap_class, display); - if (!pixmap) - return NULL; - - pixmap->format = format; - pixmap->width = width; - pixmap->height = height; - if (!pixmap_class->create(pixmap)) - goto error; - return pixmap; + g_return_val_if_fail (format != GST_VIDEO_FORMAT_UNKNOWN && + format != GST_VIDEO_FORMAT_ENCODED, NULL); + g_return_val_if_fail (width > 0, NULL); + g_return_val_if_fail (height > 0, NULL); -error: - gst_vaapi_pixmap_unref_internal(pixmap); + pixmap = gst_vaapi_pixmap_new_internal (pixmap_class, display); + if (!pixmap) return NULL; + + pixmap->format = format; + pixmap->width = width; + pixmap->height = height; + if (!pixmap_class->create (pixmap)) + goto error; + return pixmap; + +error: + gst_vaapi_pixmap_unref_internal (pixmap); + return NULL; } GstVaapiPixmap * -gst_vaapi_pixmap_new_from_native(const GstVaapiPixmapClass *pixmap_class, - GstVaapiDisplay *display, gpointer native_pixmap) +gst_vaapi_pixmap_new_from_native (const GstVaapiPixmapClass * pixmap_class, + GstVaapiDisplay * display, gpointer native_pixmap) { - GstVaapiPixmap *pixmap; + GstVaapiPixmap *pixmap; - pixmap = gst_vaapi_pixmap_new_internal(pixmap_class, display); - if (!pixmap) - return NULL; - - GST_VAAPI_OBJECT_ID(pixmap) = GPOINTER_TO_SIZE(native_pixmap); - pixmap->use_foreign_pixmap = TRUE; - if (!pixmap_class->create(pixmap)) - goto error; - return pixmap; + pixmap = gst_vaapi_pixmap_new_internal (pixmap_class, display); + if (!pixmap) + return NULL; + + GST_VAAPI_OBJECT_ID (pixmap) = GPOINTER_TO_SIZE (native_pixmap); + pixmap->use_foreign_pixmap = TRUE; + if (!pixmap_class->create (pixmap)) + goto error; + return pixmap; error: - gst_vaapi_pixmap_unref_internal(pixmap); - return NULL; + gst_vaapi_pixmap_unref_internal (pixmap); + return NULL; } /** @@ -105,9 +105,9 @@ * Returns: The same @pixmap argument */ GstVaapiPixmap * -gst_vaapi_pixmap_ref(GstVaapiPixmap *pixmap) +gst_vaapi_pixmap_ref (GstVaapiPixmap * pixmap) { - return gst_vaapi_pixmap_ref_internal(pixmap); + return gst_vaapi_pixmap_ref_internal (pixmap); } /** @@ -118,9 +118,9 @@ * the reference count reaches zero, the pixmap will be free'd. */ void -gst_vaapi_pixmap_unref(GstVaapiPixmap *pixmap) +gst_vaapi_pixmap_unref (GstVaapiPixmap * pixmap) { - gst_vaapi_pixmap_unref_internal(pixmap); + gst_vaapi_pixmap_unref_internal (pixmap); } /** @@ -133,10 +133,10 @@ * valid pixmap. However, @new_pixmap can be NULL. */ void -gst_vaapi_pixmap_replace(GstVaapiPixmap **old_pixmap_ptr, - GstVaapiPixmap *new_pixmap) +gst_vaapi_pixmap_replace (GstVaapiPixmap ** old_pixmap_ptr, + GstVaapiPixmap * new_pixmap) { - gst_vaapi_pixmap_replace_internal(old_pixmap_ptr, new_pixmap); + gst_vaapi_pixmap_replace_internal (old_pixmap_ptr, new_pixmap); } /** @@ -148,11 +148,11 @@ * Return value: the parent #GstVaapiDisplay object */ GstVaapiDisplay * -gst_vaapi_pixmap_get_display(GstVaapiPixmap *pixmap) +gst_vaapi_pixmap_get_display (GstVaapiPixmap * pixmap) { - g_return_val_if_fail(pixmap != NULL, NULL); + g_return_val_if_fail (pixmap != NULL, NULL); - return GST_VAAPI_OBJECT_DISPLAY(pixmap); + return GST_VAAPI_OBJECT_DISPLAY (pixmap); } /** @@ -164,11 +164,11 @@ * Return value: the format of the @pixmap */ GstVideoFormat -gst_vaapi_pixmap_get_format(GstVaapiPixmap *pixmap) +gst_vaapi_pixmap_get_format (GstVaapiPixmap * pixmap) { - g_return_val_if_fail(pixmap != NULL, GST_VIDEO_FORMAT_UNKNOWN); + g_return_val_if_fail (pixmap != NULL, GST_VIDEO_FORMAT_UNKNOWN); - return GST_VAAPI_PIXMAP_FORMAT(pixmap); + return GST_VAAPI_PIXMAP_FORMAT (pixmap); } /** @@ -180,11 +180,11 @@ * Return value: the width of the @pixmap, in pixels */ guint -gst_vaapi_pixmap_get_width(GstVaapiPixmap *pixmap) +gst_vaapi_pixmap_get_width (GstVaapiPixmap * pixmap) { - g_return_val_if_fail(pixmap != NULL, 0); + g_return_val_if_fail (pixmap != NULL, 0); - return GST_VAAPI_PIXMAP_WIDTH(pixmap); + return GST_VAAPI_PIXMAP_WIDTH (pixmap); } /** @@ -196,11 +196,11 @@ * Return value: the height of the @pixmap, in pixels */ guint -gst_vaapi_pixmap_get_height(GstVaapiPixmap *pixmap) +gst_vaapi_pixmap_get_height (GstVaapiPixmap * pixmap) { - g_return_val_if_fail(pixmap != NULL, 0); + g_return_val_if_fail (pixmap != NULL, 0); - return GST_VAAPI_PIXMAP_HEIGHT(pixmap); + return GST_VAAPI_PIXMAP_HEIGHT (pixmap); } /** @@ -212,15 +212,16 @@ * Retrieves the dimensions of a #GstVaapiPixmap. */ void -gst_vaapi_pixmap_get_size(GstVaapiPixmap *pixmap, guint *width, guint *height) +gst_vaapi_pixmap_get_size (GstVaapiPixmap * pixmap, guint * width, + guint * height) { - g_return_if_fail(pixmap != NULL); + g_return_if_fail (pixmap != NULL); - if (width) - *width = GST_VAAPI_PIXMAP_WIDTH(pixmap); + if (width) + *width = GST_VAAPI_PIXMAP_WIDTH (pixmap); - if (height) - *height = GST_VAAPI_PIXMAP_HEIGHT(pixmap); + if (height) + *height = GST_VAAPI_PIXMAP_HEIGHT (pixmap); } /** @@ -240,21 +241,21 @@ * Return value: %TRUE on success */ gboolean -gst_vaapi_pixmap_put_surface(GstVaapiPixmap *pixmap, GstVaapiSurface *surface, - const GstVaapiRectangle *crop_rect, guint flags) +gst_vaapi_pixmap_put_surface (GstVaapiPixmap * pixmap, + GstVaapiSurface * surface, const GstVaapiRectangle * crop_rect, guint flags) { - GstVaapiRectangle src_rect; + GstVaapiRectangle src_rect; - g_return_val_if_fail(pixmap != NULL, FALSE); - g_return_val_if_fail(surface != NULL, FALSE); + g_return_val_if_fail (pixmap != NULL, FALSE); + g_return_val_if_fail (surface != NULL, FALSE); - if (!crop_rect) { - src_rect.x = 0; - src_rect.y = 0; - src_rect.width = GST_VAAPI_SURFACE_WIDTH(surface); - src_rect.height = GST_VAAPI_SURFACE_HEIGHT(surface); - crop_rect = &src_rect; - } - return GST_VAAPI_PIXMAP_GET_CLASS(pixmap)->render(pixmap, surface, - crop_rect, flags); + if (!crop_rect) { + src_rect.x = 0; + src_rect.y = 0; + src_rect.width = GST_VAAPI_SURFACE_WIDTH (surface); + src_rect.height = GST_VAAPI_SURFACE_HEIGHT (surface); + crop_rect = &src_rect; + } + return GST_VAAPI_PIXMAP_GET_CLASS (pixmap)->render (pixmap, surface, + crop_rect, flags); } diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapipixmap_x11.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapipixmap_x11.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapipixmap_x11.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapipixmap_x11.c 2016-03-24 11:36:59.000000000 +0000 @@ -38,134 +38,131 @@ #define DEBUG 1 #include "gstvaapidebug.h" -typedef struct _GstVaapiPixmapX11Class GstVaapiPixmapX11Class; +typedef struct _GstVaapiPixmapX11Class GstVaapiPixmapX11Class; -struct _GstVaapiPixmapX11 { - GstVaapiPixmap parent_instance; +struct _GstVaapiPixmapX11 +{ + GstVaapiPixmap parent_instance; }; -struct _GstVaapiPixmapX11Class { - GstVaapiPixmapClass parent_class; +struct _GstVaapiPixmapX11Class +{ + GstVaapiPixmapClass parent_class; }; static gboolean -gst_vaapi_pixmap_x11_create_from_xid(GstVaapiPixmap *pixmap, Pixmap xid) +gst_vaapi_pixmap_x11_create_from_xid (GstVaapiPixmap * pixmap, Pixmap xid) { - guint depth; - gboolean success; + guint depth; + gboolean success; - if (!xid) - return FALSE; + if (!xid) + return FALSE; - GST_VAAPI_OBJECT_LOCK_DISPLAY(pixmap); - success = x11_get_geometry(GST_VAAPI_OBJECT_NATIVE_DISPLAY(pixmap), xid, - NULL, NULL, &pixmap->width, &pixmap->height, &depth); - GST_VAAPI_OBJECT_UNLOCK_DISPLAY(pixmap); - if (!success) - return FALSE; - - pixmap->format = gst_vaapi_display_x11_get_pixmap_format( - GST_VAAPI_OBJECT_DISPLAY_X11(pixmap), depth); - if (pixmap->format == GST_VIDEO_FORMAT_UNKNOWN) - return FALSE; - return TRUE; + GST_VAAPI_OBJECT_LOCK_DISPLAY (pixmap); + success = x11_get_geometry (GST_VAAPI_OBJECT_NATIVE_DISPLAY (pixmap), xid, + NULL, NULL, &pixmap->width, &pixmap->height, &depth); + GST_VAAPI_OBJECT_UNLOCK_DISPLAY (pixmap); + if (!success) + return FALSE; + + pixmap->format = + gst_vaapi_display_x11_get_pixmap_format (GST_VAAPI_OBJECT_DISPLAY_X11 + (pixmap), depth); + if (pixmap->format == GST_VIDEO_FORMAT_UNKNOWN) + return FALSE; + return TRUE; } static gboolean -gst_vaapi_pixmap_x11_create(GstVaapiPixmap *pixmap) +gst_vaapi_pixmap_x11_create (GstVaapiPixmap * pixmap) { - GstVaapiDisplayX11 * const display = - GST_VAAPI_DISPLAY_X11(GST_VAAPI_OBJECT_DISPLAY(pixmap)); - Display * const dpy = GST_VAAPI_OBJECT_NATIVE_DISPLAY(display); - Window rootwin; - Pixmap xid; - guint depth; - - if (pixmap->use_foreign_pixmap) - return gst_vaapi_pixmap_x11_create_from_xid(pixmap, - GST_VAAPI_OBJECT_ID(pixmap)); - - depth = gst_vaapi_display_x11_get_pixmap_depth(display, pixmap->format); - if (!depth) - return FALSE; - - GST_VAAPI_OBJECT_LOCK_DISPLAY(pixmap); - rootwin = RootWindow(dpy, DefaultScreen(dpy)); - xid = XCreatePixmap(dpy, rootwin, pixmap->width, pixmap->height, depth); - GST_VAAPI_OBJECT_UNLOCK_DISPLAY(pixmap); - - GST_DEBUG("xid %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS(xid)); - GST_VAAPI_OBJECT_ID(pixmap) = xid; - return xid != None; + GstVaapiDisplayX11 *const display = + GST_VAAPI_DISPLAY_X11 (GST_VAAPI_OBJECT_DISPLAY (pixmap)); + Display *const dpy = GST_VAAPI_OBJECT_NATIVE_DISPLAY (display); + Window rootwin; + Pixmap xid; + guint depth; + + if (pixmap->use_foreign_pixmap) + return gst_vaapi_pixmap_x11_create_from_xid (pixmap, + GST_VAAPI_OBJECT_ID (pixmap)); + + depth = gst_vaapi_display_x11_get_pixmap_depth (display, pixmap->format); + if (!depth) + return FALSE; + + GST_VAAPI_OBJECT_LOCK_DISPLAY (pixmap); + rootwin = RootWindow (dpy, DefaultScreen (dpy)); + xid = XCreatePixmap (dpy, rootwin, pixmap->width, pixmap->height, depth); + GST_VAAPI_OBJECT_UNLOCK_DISPLAY (pixmap); + + GST_DEBUG ("xid %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS (xid)); + GST_VAAPI_OBJECT_ID (pixmap) = xid; + return xid != None; } static void -gst_vaapi_pixmap_x11_destroy(GstVaapiPixmap *pixmap) +gst_vaapi_pixmap_x11_destroy (GstVaapiPixmap * pixmap) { - const Pixmap xid = GST_VAAPI_OBJECT_ID(pixmap); + const Pixmap xid = GST_VAAPI_OBJECT_ID (pixmap); - if (xid) { - if (!pixmap->use_foreign_pixmap) { - GST_VAAPI_OBJECT_LOCK_DISPLAY(pixmap); - XFreePixmap(GST_VAAPI_OBJECT_NATIVE_DISPLAY(pixmap), xid); - GST_VAAPI_OBJECT_UNLOCK_DISPLAY(pixmap); - } - GST_VAAPI_OBJECT_ID(pixmap) = None; + if (xid) { + if (!pixmap->use_foreign_pixmap) { + GST_VAAPI_OBJECT_LOCK_DISPLAY (pixmap); + XFreePixmap (GST_VAAPI_OBJECT_NATIVE_DISPLAY (pixmap), xid); + GST_VAAPI_OBJECT_UNLOCK_DISPLAY (pixmap); } + GST_VAAPI_OBJECT_ID (pixmap) = None; + } } static gboolean -gst_vaapi_pixmap_x11_render(GstVaapiPixmap *pixmap, GstVaapiSurface *surface, - const GstVaapiRectangle *crop_rect, guint flags) +gst_vaapi_pixmap_x11_render (GstVaapiPixmap * pixmap, GstVaapiSurface * surface, + const GstVaapiRectangle * crop_rect, guint flags) { - VASurfaceID surface_id; - VAStatus status; + VASurfaceID surface_id; + VAStatus status; - surface_id = GST_VAAPI_OBJECT_ID(surface); - if (surface_id == VA_INVALID_ID) - return FALSE; - - GST_VAAPI_OBJECT_LOCK_DISPLAY(pixmap); - status = vaPutSurface( - GST_VAAPI_OBJECT_VADISPLAY(pixmap), - surface_id, - GST_VAAPI_OBJECT_ID(pixmap), - crop_rect->x, crop_rect->y, - crop_rect->width, crop_rect->height, - 0, 0, - GST_VAAPI_PIXMAP_WIDTH(pixmap), - GST_VAAPI_PIXMAP_HEIGHT(pixmap), - NULL, 0, - from_GstVaapiSurfaceRenderFlags(flags) - ); - GST_VAAPI_OBJECT_UNLOCK_DISPLAY(pixmap); - if (!vaapi_check_status(status, "vaPutSurface() [pixmap]")) - return FALSE; - return TRUE; + surface_id = GST_VAAPI_OBJECT_ID (surface); + if (surface_id == VA_INVALID_ID) + return FALSE; + + GST_VAAPI_OBJECT_LOCK_DISPLAY (pixmap); + status = vaPutSurface (GST_VAAPI_OBJECT_VADISPLAY (pixmap), + surface_id, + GST_VAAPI_OBJECT_ID (pixmap), + crop_rect->x, crop_rect->y, + crop_rect->width, crop_rect->height, + 0, 0, + GST_VAAPI_PIXMAP_WIDTH (pixmap), + GST_VAAPI_PIXMAP_HEIGHT (pixmap), + NULL, 0, from_GstVaapiSurfaceRenderFlags (flags) + ); + GST_VAAPI_OBJECT_UNLOCK_DISPLAY (pixmap); + if (!vaapi_check_status (status, "vaPutSurface() [pixmap]")) + return FALSE; + return TRUE; } void -gst_vaapi_pixmap_x11_class_init(GstVaapiPixmapX11Class *klass) +gst_vaapi_pixmap_x11_class_init (GstVaapiPixmapX11Class * klass) { - GstVaapiObjectClass * const object_class = - GST_VAAPI_OBJECT_CLASS(klass); - GstVaapiPixmapClass * const pixmap_class = - GST_VAAPI_PIXMAP_CLASS(klass); + GstVaapiObjectClass *const object_class = GST_VAAPI_OBJECT_CLASS (klass); + GstVaapiPixmapClass *const pixmap_class = GST_VAAPI_PIXMAP_CLASS (klass); - object_class->finalize = (GstVaapiObjectFinalizeFunc) - gst_vaapi_pixmap_x11_destroy; + object_class->finalize = (GstVaapiObjectFinalizeFunc) + gst_vaapi_pixmap_x11_destroy; - pixmap_class->create = gst_vaapi_pixmap_x11_create; - pixmap_class->render = gst_vaapi_pixmap_x11_render; + pixmap_class->create = gst_vaapi_pixmap_x11_create; + pixmap_class->render = gst_vaapi_pixmap_x11_render; } #define gst_vaapi_pixmap_x11_finalize \ gst_vaapi_pixmap_x11_destroy -GST_VAAPI_OBJECT_DEFINE_CLASS_WITH_CODE( - GstVaapiPixmapX11, - gst_vaapi_pixmap_x11, - gst_vaapi_pixmap_x11_class_init(&g_class)) +GST_VAAPI_OBJECT_DEFINE_CLASS_WITH_CODE (GstVaapiPixmapX11, + gst_vaapi_pixmap_x11, gst_vaapi_pixmap_x11_class_init (&g_class)) /** * gst_vaapi_pixmap_x11_new: @@ -179,17 +176,17 @@ * * Return value: the newly allocated #GstVaapiPixmap object */ -GstVaapiPixmap * -gst_vaapi_pixmap_x11_new(GstVaapiDisplay *display, GstVideoFormat format, - guint width, guint height) + GstVaapiPixmap *gst_vaapi_pixmap_x11_new (GstVaapiDisplay * display, + GstVideoFormat format, guint width, guint height) { - GST_DEBUG("new pixmap, format %s, size %ux%u", - gst_vaapi_video_format_to_string(format), width, height); + GST_DEBUG ("new pixmap, format %s, size %ux%u", + gst_vaapi_video_format_to_string (format), width, height); - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY_X11(display), NULL); + g_return_val_if_fail (GST_VAAPI_IS_DISPLAY_X11 (display), NULL); - return gst_vaapi_pixmap_new(GST_VAAPI_PIXMAP_CLASS( - gst_vaapi_pixmap_x11_class()), display, format, width, height); + return + gst_vaapi_pixmap_new (GST_VAAPI_PIXMAP_CLASS (gst_vaapi_pixmap_x11_class + ()), display, format, width, height); } /** @@ -205,15 +202,16 @@ * Return value: the newly allocated #GstVaapiPixmap object */ GstVaapiPixmap * -gst_vaapi_pixmap_x11_new_with_xid(GstVaapiDisplay *display, Pixmap xid) +gst_vaapi_pixmap_x11_new_with_xid (GstVaapiDisplay * display, Pixmap xid) { - GST_DEBUG("new pixmap from xid 0x%08x", (guint)xid); + GST_DEBUG ("new pixmap from xid 0x%08x", (guint) xid); - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY_X11(display), NULL); - g_return_val_if_fail(xid != None, NULL); + g_return_val_if_fail (GST_VAAPI_IS_DISPLAY_X11 (display), NULL); + g_return_val_if_fail (xid != None, NULL); - return gst_vaapi_pixmap_new_from_native(GST_VAAPI_PIXMAP_CLASS( - gst_vaapi_pixmap_x11_class()), display, GSIZE_TO_POINTER(xid)); + return + gst_vaapi_pixmap_new_from_native (GST_VAAPI_PIXMAP_CLASS + (gst_vaapi_pixmap_x11_class ()), display, GSIZE_TO_POINTER (xid)); } /** @@ -227,11 +225,11 @@ * Return value: the underlying X11 Pixmap bound to @pixmap. */ Pixmap -gst_vaapi_pixmap_x11_get_xid(GstVaapiPixmapX11 *pixmap) +gst_vaapi_pixmap_x11_get_xid (GstVaapiPixmapX11 * pixmap) { - g_return_val_if_fail(pixmap != NULL, None); + g_return_val_if_fail (pixmap != NULL, None); - return GST_VAAPI_OBJECT_ID(pixmap); + return GST_VAAPI_OBJECT_ID (pixmap); } /** @@ -245,9 +243,9 @@ * caller (foreign pixmap) */ gboolean -gst_vaapi_pixmap_x11_is_foreign_xid(GstVaapiPixmapX11 *pixmap) +gst_vaapi_pixmap_x11_is_foreign_xid (GstVaapiPixmapX11 * pixmap) { - g_return_val_if_fail(pixmap != NULL, FALSE); + g_return_val_if_fail (pixmap != NULL, FALSE); - return GST_VAAPI_PIXMAP(pixmap)->use_foreign_pixmap; + return GST_VAAPI_PIXMAP (pixmap)->use_foreign_pixmap; } diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiprofile.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiprofile.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiprofile.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiprofile.c 2016-03-24 11:36:59.000000000 +0000 @@ -34,184 +34,153 @@ #include "gstvaapiprofile.h" #include "gstvaapiworkarounds.h" -typedef struct _GstVaapiCodecMap GstVaapiCodecMap; -typedef struct _GstVaapiProfileMap GstVaapiProfileMap; -typedef struct _GstVaapiEntrypointMap GstVaapiEntrypointMap; - -struct _GstVaapiCodecMap { - GstVaapiCodec codec; - const gchar *name; +typedef struct _GstVaapiCodecMap GstVaapiCodecMap; +typedef struct _GstVaapiProfileMap GstVaapiProfileMap; +typedef struct _GstVaapiEntrypointMap GstVaapiEntrypointMap; + +struct _GstVaapiCodecMap +{ + GstVaapiCodec codec; + const gchar *name; }; -struct _GstVaapiProfileMap { - GstVaapiProfile profile; - VAProfile va_profile; - const char *media_str; - const gchar *profile_str; +struct _GstVaapiProfileMap +{ + GstVaapiProfile profile; + VAProfile va_profile; + const char *media_str; + const gchar *profile_str; }; -struct _GstVaapiEntrypointMap { - GstVaapiEntrypoint entrypoint; - VAEntrypoint va_entrypoint; +struct _GstVaapiEntrypointMap +{ + GstVaapiEntrypoint entrypoint; + VAEntrypoint va_entrypoint; }; /* Codecs */ static const GstVaapiCodecMap gst_vaapi_codecs[] = { - { GST_VAAPI_CODEC_MPEG1, "mpeg1" }, - { GST_VAAPI_CODEC_MPEG2, "mpeg2" }, - { GST_VAAPI_CODEC_MPEG4, "mpeg4" }, - { GST_VAAPI_CODEC_H263, "h263" }, - { GST_VAAPI_CODEC_H264, "h264" }, - { GST_VAAPI_CODEC_WMV3, "wmv3" }, - { GST_VAAPI_CODEC_VC1, "vc1" }, - { GST_VAAPI_CODEC_JPEG, "jpeg" }, - { GST_VAAPI_CODEC_VP8, "vp8" }, - { GST_VAAPI_CODEC_H265, "h265" }, - { GST_VAAPI_CODEC_VP9, "vp9" }, - { 0, } + {GST_VAAPI_CODEC_MPEG1, "mpeg1"}, + {GST_VAAPI_CODEC_MPEG2, "mpeg2"}, + {GST_VAAPI_CODEC_MPEG4, "mpeg4"}, + {GST_VAAPI_CODEC_H263, "h263"}, + {GST_VAAPI_CODEC_H264, "h264"}, + {GST_VAAPI_CODEC_WMV3, "wmv3"}, + {GST_VAAPI_CODEC_VC1, "vc1"}, + {GST_VAAPI_CODEC_JPEG, "jpeg"}, + {GST_VAAPI_CODEC_VP8, "vp8"}, + {GST_VAAPI_CODEC_H265, "h265"}, + {GST_VAAPI_CODEC_VP9, "vp9"}, + {0,} }; /* Profiles */ static const GstVaapiProfileMap gst_vaapi_profiles[] = { - { GST_VAAPI_PROFILE_MPEG2_SIMPLE, VAProfileMPEG2Simple, - "video/mpeg, mpegversion=2", "simple" - }, - { GST_VAAPI_PROFILE_MPEG2_MAIN, VAProfileMPEG2Main, - "video/mpeg, mpegversion=2", "main" - }, - { GST_VAAPI_PROFILE_MPEG4_SIMPLE, VAProfileMPEG4Simple, - "video/mpeg, mpegversion=4", "simple" - }, - { GST_VAAPI_PROFILE_MPEG4_ADVANCED_SIMPLE, VAProfileMPEG4AdvancedSimple, - "video/mpeg, mpegversion=4", "advanced-simple" - }, - { GST_VAAPI_PROFILE_MPEG4_MAIN, VAProfileMPEG4Main, - "video/mpeg, mpegversion=4", "main" - }, - { GST_VAAPI_PROFILE_MPEG4_ADVANCED_SIMPLE, VAProfileMPEG4AdvancedSimple, - "video/x-divx, divxversion=5", "advanced-simple" - }, - { GST_VAAPI_PROFILE_MPEG4_ADVANCED_SIMPLE, VAProfileMPEG4AdvancedSimple, - "video/x-xvid", "advanced-simple" - }, + {GST_VAAPI_PROFILE_MPEG2_SIMPLE, VAProfileMPEG2Simple, + "video/mpeg, mpegversion=2", "simple"}, + {GST_VAAPI_PROFILE_MPEG2_MAIN, VAProfileMPEG2Main, + "video/mpeg, mpegversion=2", "main"}, + {GST_VAAPI_PROFILE_MPEG4_SIMPLE, VAProfileMPEG4Simple, + "video/mpeg, mpegversion=4", "simple"}, + {GST_VAAPI_PROFILE_MPEG4_ADVANCED_SIMPLE, VAProfileMPEG4AdvancedSimple, + "video/mpeg, mpegversion=4", "advanced-simple"}, + {GST_VAAPI_PROFILE_MPEG4_MAIN, VAProfileMPEG4Main, + "video/mpeg, mpegversion=4", "main"}, + {GST_VAAPI_PROFILE_MPEG4_ADVANCED_SIMPLE, VAProfileMPEG4AdvancedSimple, + "video/x-divx, divxversion=5", "advanced-simple"}, + {GST_VAAPI_PROFILE_MPEG4_ADVANCED_SIMPLE, VAProfileMPEG4AdvancedSimple, + "video/x-xvid", "advanced-simple"}, #if VA_CHECK_VERSION(0,30,0) - { GST_VAAPI_PROFILE_H263_BASELINE, VAProfileH263Baseline, - "video/x-h263, variant=itu, h263version=h263", "baseline" - }, + {GST_VAAPI_PROFILE_H263_BASELINE, VAProfileH263Baseline, + "video/x-h263, variant=itu, h263version=h263", "baseline"}, #endif - { GST_VAAPI_PROFILE_H264_BASELINE, VAProfileH264Baseline, - "video/x-h264", "baseline" - }, + {GST_VAAPI_PROFILE_H264_BASELINE, VAProfileH264Baseline, + "video/x-h264", "baseline"}, #if VA_CHECK_VERSION(0,31,1) - { GST_VAAPI_PROFILE_H264_CONSTRAINED_BASELINE, - VAProfileH264ConstrainedBaseline, - "video/x-h264", "constrained-baseline" - }, + {GST_VAAPI_PROFILE_H264_CONSTRAINED_BASELINE, + VAProfileH264ConstrainedBaseline, + "video/x-h264", "constrained-baseline"}, #endif - { GST_VAAPI_PROFILE_H264_MAIN, VAProfileH264Main, - "video/x-h264", "main" - }, - { GST_VAAPI_PROFILE_H264_HIGH, VAProfileH264High, - "video/x-h264", "high" - }, + {GST_VAAPI_PROFILE_H264_MAIN, VAProfileH264Main, + "video/x-h264", "main"}, + {GST_VAAPI_PROFILE_H264_HIGH, VAProfileH264High, + "video/x-h264", "high"}, #if VA_CHECK_VERSION(0,35,2) - { GST_VAAPI_PROFILE_H264_MULTIVIEW_HIGH, VAProfileH264MultiviewHigh, - "video/x-h264", "multiview-high" - }, - { GST_VAAPI_PROFILE_H264_STEREO_HIGH, VAProfileH264StereoHigh, - "video/x-h264", "stereo-high" - }, -#endif -#if GST_CHECK_VERSION(1,5,0) - { GST_VAAPI_PROFILE_VC1_SIMPLE, VAProfileVC1Simple, - "video/x-wmv, wmvversion=3", "simple" - }, - { GST_VAAPI_PROFILE_VC1_MAIN, VAProfileVC1Main, - "video/x-wmv, wmvversion=3", "main" - }, - { GST_VAAPI_PROFILE_VC1_ADVANCED, VAProfileVC1Advanced, - "video/x-wmv, wmvversion=3, format=(string)WVC1", "advanced" - }, -#else - { GST_VAAPI_PROFILE_VC1_SIMPLE, VAProfileVC1Simple, - "video/x-wmv, wmvversion=3", NULL - }, - { GST_VAAPI_PROFILE_VC1_MAIN, VAProfileVC1Main, - "video/x-wmv, wmvversion=3", NULL - }, - { GST_VAAPI_PROFILE_VC1_ADVANCED, VAProfileVC1Advanced, - "video/x-wmv, wmvversion=3, format=(string)WVC1", NULL - }, + {GST_VAAPI_PROFILE_H264_MULTIVIEW_HIGH, VAProfileH264MultiviewHigh, + "video/x-h264", "multiview-high"}, + {GST_VAAPI_PROFILE_H264_STEREO_HIGH, VAProfileH264StereoHigh, + "video/x-h264", "stereo-high"}, #endif + {GST_VAAPI_PROFILE_VC1_SIMPLE, VAProfileVC1Simple, + "video/x-wmv, wmvversion=3", "simple"}, + {GST_VAAPI_PROFILE_VC1_MAIN, VAProfileVC1Main, + "video/x-wmv, wmvversion=3", "main"}, + {GST_VAAPI_PROFILE_VC1_ADVANCED, VAProfileVC1Advanced, + "video/x-wmv, wmvversion=3, format=(string)WVC1", "advanced"}, #if VA_CHECK_VERSION(0,32,0) - { GST_VAAPI_PROFILE_JPEG_BASELINE, VAProfileJPEGBaseline, - "image/jpeg", NULL - }, + {GST_VAAPI_PROFILE_JPEG_BASELINE, VAProfileJPEGBaseline, + "image/jpeg", NULL}, #endif #if VA_CHECK_VERSION(0,35,0) - { GST_VAAPI_PROFILE_VP8, VAProfileVP8Version0_3, - "video/x-vp8", NULL - }, + {GST_VAAPI_PROFILE_VP8, VAProfileVP8Version0_3, + "video/x-vp8", NULL}, #endif #if VA_CHECK_VERSION(0,37,0) - { GST_VAAPI_PROFILE_H265_MAIN, VAProfileHEVCMain, - "video/x-h265", "main" - }, - { GST_VAAPI_PROFILE_H265_MAIN10, VAProfileHEVCMain10, - "video/x-h265", "main10" - }, + {GST_VAAPI_PROFILE_H265_MAIN, VAProfileHEVCMain, + "video/x-h265", "main"}, + {GST_VAAPI_PROFILE_H265_MAIN10, VAProfileHEVCMain10, + "video/x-h265", "main-10"}, #endif #if VA_CHECK_VERSION(0,38,0) - { GST_VAAPI_PROFILE_VP9, VAProfileVP9Profile0, - "video/x-vp9", NULL - }, + {GST_VAAPI_PROFILE_VP9, VAProfileVP9Profile0, + "video/x-vp9", NULL}, #endif - { 0, } + {0,} }; /* Entry-points */ static const GstVaapiEntrypointMap gst_vaapi_entrypoints[] = { - { GST_VAAPI_ENTRYPOINT_VLD, VAEntrypointVLD }, - { GST_VAAPI_ENTRYPOINT_IDCT, VAEntrypointIDCT }, - { GST_VAAPI_ENTRYPOINT_MOCO, VAEntrypointMoComp }, + {GST_VAAPI_ENTRYPOINT_VLD, VAEntrypointVLD}, + {GST_VAAPI_ENTRYPOINT_IDCT, VAEntrypointIDCT}, + {GST_VAAPI_ENTRYPOINT_MOCO, VAEntrypointMoComp}, #if VA_CHECK_VERSION(0,30,0) - { GST_VAAPI_ENTRYPOINT_SLICE_ENCODE, VAEntrypointEncSlice }, - { GST_VAAPI_ENTRYPOINT_PICTURE_ENCODE, VAEntrypointEncPicture }, + {GST_VAAPI_ENTRYPOINT_SLICE_ENCODE, VAEntrypointEncSlice}, + {GST_VAAPI_ENTRYPOINT_PICTURE_ENCODE, VAEntrypointEncPicture}, #endif - { 0, } + {0,} }; static const GstVaapiCodecMap * -get_codecs_map(GstVaapiCodec codec) +get_codecs_map (GstVaapiCodec codec) { - const GstVaapiCodecMap *m; + const GstVaapiCodecMap *m; - for (m = gst_vaapi_codecs; m->codec; m++) - if (m->codec == codec) - return m; - return NULL; + for (m = gst_vaapi_codecs; m->codec; m++) + if (m->codec == codec) + return m; + return NULL; } static const GstVaapiProfileMap * -get_profiles_map(GstVaapiProfile profile) +get_profiles_map (GstVaapiProfile profile) { - const GstVaapiProfileMap *m; + const GstVaapiProfileMap *m; - for (m = gst_vaapi_profiles; m->profile; m++) - if (m->profile == profile) - return m; - return NULL; + for (m = gst_vaapi_profiles; m->profile; m++) + if (m->profile == profile) + return m; + return NULL; } static const GstVaapiEntrypointMap * -get_entrypoints_map(GstVaapiEntrypoint entrypoint) +get_entrypoints_map (GstVaapiEntrypoint entrypoint) { - const GstVaapiEntrypointMap *m; + const GstVaapiEntrypointMap *m; - for (m = gst_vaapi_entrypoints; m->entrypoint; m++) - if (m->entrypoint == entrypoint) - return m; - return NULL; + for (m = gst_vaapi_entrypoints; m->entrypoint; m++) + if (m->entrypoint == entrypoint) + return m; + return NULL; } /** @@ -223,11 +192,11 @@ * Return value: the statically allocated string representation of @codec */ const gchar * -gst_vaapi_codec_get_name(GstVaapiCodec codec) +gst_vaapi_codec_get_name (GstVaapiCodec codec) { - const GstVaapiCodecMap * const m = get_codecs_map(codec); + const GstVaapiCodecMap *const m = get_codecs_map (codec); - return m ? m->name : NULL; + return m ? m->name : NULL; } /** @@ -241,14 +210,14 @@ * Return value: the #GstVaapiProfile describing the @profile */ GstVaapiProfile -gst_vaapi_profile(VAProfile profile) +gst_vaapi_profile (VAProfile profile) { - const GstVaapiProfileMap *m; + const GstVaapiProfileMap *m; - for (m = gst_vaapi_profiles; m->profile; m++) - if (m->va_profile == profile) - return m->profile; - return 0; + for (m = gst_vaapi_profiles; m->profile; m++) + if (m->va_profile == profile) + return m->profile; + return 0; } /** @@ -260,11 +229,11 @@ * Return value: the statically allocated string representation of @profile */ const gchar * -gst_vaapi_profile_get_name(GstVaapiProfile profile) +gst_vaapi_profile_get_name (GstVaapiProfile profile) { - const GstVaapiProfileMap * const m = get_profiles_map(profile); + const GstVaapiProfileMap *const m = get_profiles_map (profile); - return m ? m->profile_str : NULL; + return m ? m->profile_str : NULL; } /** @@ -278,11 +247,11 @@ * @profile media type */ const gchar * -gst_vaapi_profile_get_media_type_name(GstVaapiProfile profile) +gst_vaapi_profile_get_media_type_name (GstVaapiProfile profile) { - const GstVaapiProfileMap * const m = get_profiles_map(profile); + const GstVaapiProfileMap *const m = get_profiles_map (profile); - return m ? m->media_str : NULL; + return m ? m->media_str : NULL; } /** @@ -295,73 +264,81 @@ * Return value: the #GstVaapiProfile described in @buffer */ static GstVaapiProfile -gst_vaapi_profile_from_codec_data_h264(GstBuffer *buffer) +gst_vaapi_profile_from_codec_data_h264 (GstBuffer * buffer) { - /* MPEG-4 Part 15: Advanced Video Coding (AVC) file format */ - guchar buf[3]; + /* MPEG-4 Part 15: Advanced Video Coding (AVC) file format */ + guchar buf[3]; - if (gst_buffer_extract(buffer, 0, buf, sizeof(buf)) != sizeof(buf)) - return 0; - - if (buf[0] != 1) /* configurationVersion = 1 */ - return 0; - - switch (buf[1]) { /* AVCProfileIndication */ - case 66: return ((buf[2] & 0x40) ? - GST_VAAPI_PROFILE_H264_CONSTRAINED_BASELINE : - GST_VAAPI_PROFILE_H264_BASELINE); - case 77: return GST_VAAPI_PROFILE_H264_MAIN; - case 100: return GST_VAAPI_PROFILE_H264_HIGH; - case 118: return GST_VAAPI_PROFILE_H264_MULTIVIEW_HIGH; - case 128: return GST_VAAPI_PROFILE_H264_STEREO_HIGH; + if (gst_buffer_extract (buffer, 0, buf, sizeof (buf)) != sizeof (buf)) + return 0; - } + if (buf[0] != 1) /* configurationVersion = 1 */ return 0; + + switch (buf[1]) { /* AVCProfileIndication */ + case 66: + return ((buf[2] & 0x40) ? + GST_VAAPI_PROFILE_H264_CONSTRAINED_BASELINE : + GST_VAAPI_PROFILE_H264_BASELINE); + case 77: + return GST_VAAPI_PROFILE_H264_MAIN; + case 100: + return GST_VAAPI_PROFILE_H264_HIGH; + case 118: + return GST_VAAPI_PROFILE_H264_MULTIVIEW_HIGH; + case 128: + return GST_VAAPI_PROFILE_H264_STEREO_HIGH; + + } + return 0; } static GstVaapiProfile -gst_vaapi_profile_from_codec_data_h265(GstBuffer *buffer) +gst_vaapi_profile_from_codec_data_h265 (GstBuffer * buffer) { - /* ISO/IEC 14496-15: HEVC file format */ - guchar buf[3]; - - if (gst_buffer_extract(buffer, 0, buf, sizeof(buf)) != sizeof(buf)) - return 0; + /* ISO/IEC 14496-15: HEVC file format */ + guchar buf[3]; - if (buf[0] != 1) /* configurationVersion = 1 */ - return 0; + if (gst_buffer_extract (buffer, 0, buf, sizeof (buf)) != sizeof (buf)) + return 0; - if (buf[1] & 0xc0) /* general_profile_space = 0 */ - return 0; + if (buf[0] != 1) /* configurationVersion = 1 */ + return 0; - switch (buf[1] & 0x1f) { /* HEVCProfileIndication */ - case 1: return GST_VAAPI_PROFILE_H265_MAIN; - case 2: return GST_VAAPI_PROFILE_H265_MAIN10; - case 3: return GST_VAAPI_PROFILE_H265_MAIN_STILL_PICTURE; - } + if (buf[1] & 0xc0) /* general_profile_space = 0 */ return 0; + + switch (buf[1] & 0x1f) { /* HEVCProfileIndication */ + case 1: + return GST_VAAPI_PROFILE_H265_MAIN; + case 2: + return GST_VAAPI_PROFILE_H265_MAIN10; + case 3: + return GST_VAAPI_PROFILE_H265_MAIN_STILL_PICTURE; + } + return 0; } static GstVaapiProfile -gst_vaapi_profile_from_codec_data(GstVaapiCodec codec, GstBuffer *buffer) +gst_vaapi_profile_from_codec_data (GstVaapiCodec codec, GstBuffer * buffer) { - GstVaapiProfile profile; + GstVaapiProfile profile; - if (!codec || !buffer) - return 0; + if (!codec || !buffer) + return 0; - switch (codec) { + switch (codec) { case GST_VAAPI_CODEC_H264: - profile = gst_vaapi_profile_from_codec_data_h264(buffer); - break; + profile = gst_vaapi_profile_from_codec_data_h264 (buffer); + break; case GST_VAAPI_CODEC_H265: - profile = gst_vaapi_profile_from_codec_data_h265(buffer); - break; + profile = gst_vaapi_profile_from_codec_data_h265 (buffer); + break; default: - profile = 0; - break; - } - return profile; + profile = 0; + break; + } + return profile; } /** @@ -375,62 +352,60 @@ * Return value: the #GstVaapiProfile describing the @caps */ GstVaapiProfile -gst_vaapi_profile_from_caps(const GstCaps *caps) +gst_vaapi_profile_from_caps (const GstCaps * caps) { - const GstVaapiProfileMap *m; - GstCaps *caps_test; - GstStructure *structure; - const gchar *profile_str; - GstVaapiProfile profile, best_profile; - GstBuffer *codec_data = NULL; - const gchar *name; - gsize namelen; + const GstVaapiProfileMap *m; + GstCaps *caps_test; + GstStructure *structure; + const gchar *profile_str; + GstVaapiProfile profile, best_profile; + GstBuffer *codec_data = NULL; + const gchar *name; + gsize namelen; - if (!caps) - return 0; + if (!caps) + return 0; - structure = gst_caps_get_structure(caps, 0); - if (!structure) - return 0; - - name = gst_structure_get_name(structure); - namelen = strlen(name); - - profile_str = gst_structure_get_string(structure, "profile"); - if (!profile_str) { - const GValue *v_codec_data; - v_codec_data = gst_structure_get_value(structure, "codec_data"); - if (v_codec_data) - codec_data = gst_value_get_buffer(v_codec_data); - } + structure = gst_caps_get_structure (caps, 0); + if (!structure) + return 0; - profile = 0; - best_profile = 0; - for (m = gst_vaapi_profiles; !profile && m->profile; m++) { - if (strncmp(name, m->media_str, namelen) != 0) - continue; - caps_test = gst_caps_from_string(m->media_str); - if (gst_caps_is_always_compatible(caps, caps_test)) { - best_profile = m->profile; - if (profile_str && m->profile_str && - strcmp(profile_str, m->profile_str) == 0) - profile = best_profile; - } - if (!profile) { - profile = gst_vaapi_profile_from_codec_data( - gst_vaapi_profile_get_codec(m->profile), - codec_data - ); - if (!profile && - WORKAROUND_QTDEMUX_NO_H263_PROFILES && - strncmp(name, "video/x-h263", namelen) == 0) { - /* HACK: qtdemux does not report profiles for h263 */ - profile = m->profile; - } - } - gst_caps_unref(caps_test); + name = gst_structure_get_name (structure); + namelen = strlen (name); + + profile_str = gst_structure_get_string (structure, "profile"); + if (!profile_str) { + const GValue *v_codec_data; + v_codec_data = gst_structure_get_value (structure, "codec_data"); + if (v_codec_data) + codec_data = gst_value_get_buffer (v_codec_data); + } + + profile = 0; + best_profile = 0; + for (m = gst_vaapi_profiles; !profile && m->profile; m++) { + if (strncmp (name, m->media_str, namelen) != 0) + continue; + caps_test = gst_caps_from_string (m->media_str); + if (gst_caps_is_always_compatible (caps, caps_test)) { + best_profile = m->profile; + if (profile_str && m->profile_str && + strcmp (profile_str, m->profile_str) == 0) + profile = best_profile; + } + if (!profile) { + profile = + gst_vaapi_profile_from_codec_data (gst_vaapi_profile_get_codec + (m->profile), codec_data); + if (!profile && WORKAROUND_QTDEMUX_NO_H263_PROFILES + && strncmp (name, "video/x-h263", namelen) == 0) { + /* HACK: qtdemux does not report profiles for h263 */ + profile = m->profile; + } } - return profile ? profile : best_profile; + gst_caps_unref (caps_test); + } + return profile ? profile : best_profile; } /** @@ -444,11 +419,11 @@ * Return value: the VA profile, or -1 if none was found */ VAProfile -gst_vaapi_profile_get_va_profile(GstVaapiProfile profile) +gst_vaapi_profile_get_va_profile (GstVaapiProfile profile) { - const GstVaapiProfileMap * const m = get_profiles_map(profile); + const GstVaapiProfileMap *const m = get_profiles_map (profile); - return m ? m->va_profile : (VAProfile)-1; + return m ? m->va_profile : (VAProfile) - 1; } /** @@ -461,29 +436,25 @@ * Return value: the newly allocated #GstCaps, or %NULL if none was found */ GstCaps * -gst_vaapi_profile_get_caps(GstVaapiProfile profile) +gst_vaapi_profile_get_caps (GstVaapiProfile profile) { - const GstVaapiProfileMap *m; - GstCaps *out_caps, *caps; + const GstVaapiProfileMap *m; + GstCaps *out_caps, *caps; - out_caps = gst_caps_new_empty(); - if (!out_caps) - return NULL; - - for (m = gst_vaapi_profiles; m->profile; m++) { - if (m->profile != profile) - continue; - caps = gst_caps_from_string(m->media_str); - if (!caps) - continue; - gst_caps_set_simple( - caps, - "profile", G_TYPE_STRING, m->profile_str, - NULL - ); - out_caps = gst_caps_merge(out_caps, caps); - } - return out_caps; + out_caps = gst_caps_new_empty (); + if (!out_caps) + return NULL; + + for (m = gst_vaapi_profiles; m->profile; m++) { + if (m->profile != profile) + continue; + caps = gst_caps_from_string (m->media_str); + if (!caps) + continue; + gst_caps_set_simple (caps, "profile", G_TYPE_STRING, m->profile_str, NULL); + out_caps = gst_caps_merge (out_caps, caps); + } + return out_caps; } /** @@ -495,26 +466,26 @@ * Return value: the #GstVaapiCodec from @profile */ GstVaapiCodec -gst_vaapi_profile_get_codec(GstVaapiProfile profile) +gst_vaapi_profile_get_codec (GstVaapiProfile profile) { - GstVaapiCodec codec; + GstVaapiCodec codec; - switch (profile) { + switch (profile) { case GST_VAAPI_PROFILE_VC1_SIMPLE: case GST_VAAPI_PROFILE_VC1_MAIN: - codec = GST_VAAPI_CODEC_WMV3; - break; + codec = GST_VAAPI_CODEC_WMV3; + break; case GST_VAAPI_PROFILE_VC1_ADVANCED: - codec = GST_VAAPI_CODEC_VC1; - break; + codec = GST_VAAPI_CODEC_VC1; + break; case GST_VAAPI_PROFILE_JPEG_BASELINE: - codec = GST_VAAPI_CODEC_JPEG; - break; + codec = GST_VAAPI_CODEC_JPEG; + break; default: - codec = (guint32)profile & GST_MAKE_FOURCC(0xff,0xff,0xff,0); - break; - } - return codec; + codec = (guint32) profile & GST_MAKE_FOURCC (0xff, 0xff, 0xff, 0); + break; + } + return codec; } /** @@ -528,14 +499,14 @@ * Return value: the #GstVaapiEntrypoint describing the @entrypoint */ GstVaapiEntrypoint -gst_vaapi_entrypoint(VAEntrypoint entrypoint) +gst_vaapi_entrypoint (VAEntrypoint entrypoint) { - const GstVaapiEntrypointMap *m; + const GstVaapiEntrypointMap *m; - for (m = gst_vaapi_entrypoints; m->entrypoint; m++) - if (m->va_entrypoint == entrypoint) - return m->entrypoint; - return 0; + for (m = gst_vaapi_entrypoints; m->entrypoint; m++) + if (m->va_entrypoint == entrypoint) + return m->entrypoint; + return 0; } /** @@ -549,9 +520,9 @@ * Return value: the VA entry-point, or -1 if none was found */ VAEntrypoint -gst_vaapi_entrypoint_get_va_entrypoint(GstVaapiEntrypoint entrypoint) +gst_vaapi_entrypoint_get_va_entrypoint (GstVaapiEntrypoint entrypoint) { - const GstVaapiEntrypointMap * const m = get_entrypoints_map(entrypoint); + const GstVaapiEntrypointMap *const m = get_entrypoints_map (entrypoint); - return m ? m->va_entrypoint : (VAEntrypoint)-1; + return m ? m->va_entrypoint : (VAEntrypoint) - 1; } diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapisubpicture.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapisubpicture.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapisubpicture.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapisubpicture.c 2016-03-24 11:36:59.000000000 +0000 @@ -38,20 +38,21 @@ #define DEBUG 1 #include "gstvaapidebug.h" -typedef struct _GstVaapiSubpictureClass GstVaapiSubpictureClass; +typedef struct _GstVaapiSubpictureClass GstVaapiSubpictureClass; /** * GstVaapiSubpicture: * * A VA subpicture wrapper */ -struct _GstVaapiSubpicture { - /*< private >*/ - GstVaapiObject parent_instance; - - GstVaapiImage *image; - guint flags; - gfloat global_alpha; +struct _GstVaapiSubpicture +{ + /*< private > */ + GstVaapiObject parent_instance; + + GstVaapiImage *image; + guint flags; + gfloat global_alpha; }; /** @@ -59,66 +60,62 @@ * * A VA subpicture wrapper class */ -struct _GstVaapiSubpictureClass { - /*< private >*/ - GstVaapiObjectClass parent_class; +struct _GstVaapiSubpictureClass +{ + /*< private > */ + GstVaapiObjectClass parent_class; }; static void -gst_vaapi_subpicture_destroy(GstVaapiSubpicture *subpicture) +gst_vaapi_subpicture_destroy (GstVaapiSubpicture * subpicture) { - GstVaapiDisplay * const display = GST_VAAPI_OBJECT_DISPLAY(subpicture); - VASubpictureID subpicture_id; - VAStatus status; - - subpicture_id = GST_VAAPI_OBJECT_ID(subpicture); - GST_DEBUG("subpicture %" GST_VAAPI_ID_FORMAT, - GST_VAAPI_ID_ARGS(subpicture_id)); - - if (subpicture_id != VA_INVALID_ID) { - if (display) { - GST_VAAPI_DISPLAY_LOCK(display); - status = vaDestroySubpicture( - GST_VAAPI_DISPLAY_VADISPLAY(display), - subpicture_id - ); - GST_VAAPI_DISPLAY_UNLOCK(display); - if (!vaapi_check_status(status, "vaDestroySubpicture()")) - g_warning("failed to destroy subpicture %" GST_VAAPI_ID_FORMAT, - GST_VAAPI_ID_ARGS(subpicture_id)); - } - GST_VAAPI_OBJECT_ID(subpicture) = VA_INVALID_ID; + GstVaapiDisplay *const display = GST_VAAPI_OBJECT_DISPLAY (subpicture); + VASubpictureID subpicture_id; + VAStatus status; + + subpicture_id = GST_VAAPI_OBJECT_ID (subpicture); + GST_DEBUG ("subpicture %" GST_VAAPI_ID_FORMAT, + GST_VAAPI_ID_ARGS (subpicture_id)); + + if (subpicture_id != VA_INVALID_ID) { + if (display) { + GST_VAAPI_DISPLAY_LOCK (display); + status = vaDestroySubpicture (GST_VAAPI_DISPLAY_VADISPLAY (display), + subpicture_id); + GST_VAAPI_DISPLAY_UNLOCK (display); + if (!vaapi_check_status (status, "vaDestroySubpicture()")) + g_warning ("failed to destroy subpicture %" GST_VAAPI_ID_FORMAT, + GST_VAAPI_ID_ARGS (subpicture_id)); } - gst_vaapi_object_replace(&subpicture->image, NULL); + GST_VAAPI_OBJECT_ID (subpicture) = VA_INVALID_ID; + } + gst_vaapi_object_replace (&subpicture->image, NULL); } static gboolean -gst_vaapi_subpicture_create(GstVaapiSubpicture *subpicture, - GstVaapiImage *image) +gst_vaapi_subpicture_create (GstVaapiSubpicture * subpicture, + GstVaapiImage * image) { - GstVaapiDisplay * const display = GST_VAAPI_OBJECT_DISPLAY(subpicture); - VASubpictureID subpicture_id; - VAStatus status; - - GST_VAAPI_DISPLAY_LOCK(display); - status = vaCreateSubpicture( - GST_VAAPI_DISPLAY_VADISPLAY(display), - GST_VAAPI_OBJECT_ID(image), - &subpicture_id - ); - GST_VAAPI_DISPLAY_UNLOCK(display); - if (!vaapi_check_status(status, "vaCreateSubpicture()")) - return FALSE; - - GST_DEBUG("subpicture %" GST_VAAPI_ID_FORMAT, - GST_VAAPI_ID_ARGS(subpicture_id)); - GST_VAAPI_OBJECT_ID(subpicture) = subpicture_id; - subpicture->image = gst_vaapi_object_ref(image); - return TRUE; + GstVaapiDisplay *const display = GST_VAAPI_OBJECT_DISPLAY (subpicture); + VASubpictureID subpicture_id; + VAStatus status; + + GST_VAAPI_DISPLAY_LOCK (display); + status = vaCreateSubpicture (GST_VAAPI_DISPLAY_VADISPLAY (display), + GST_VAAPI_OBJECT_ID (image), &subpicture_id); + GST_VAAPI_DISPLAY_UNLOCK (display); + if (!vaapi_check_status (status, "vaCreateSubpicture()")) + return FALSE; + + GST_DEBUG ("subpicture %" GST_VAAPI_ID_FORMAT, + GST_VAAPI_ID_ARGS (subpicture_id)); + GST_VAAPI_OBJECT_ID (subpicture) = subpicture_id; + subpicture->image = gst_vaapi_object_ref (image); + return TRUE; } #define gst_vaapi_subpicture_finalize gst_vaapi_subpicture_destroy -GST_VAAPI_OBJECT_DEFINE_CLASS(GstVaapiSubpicture, gst_vaapi_subpicture) +GST_VAAPI_OBJECT_DEFINE_CLASS (GstVaapiSubpicture, gst_vaapi_subpicture) /** * gst_vaapi_subpicture_new: @@ -130,38 +127,38 @@ * * Return value: the newly allocated #GstVaapiSubpicture object */ -GstVaapiSubpicture * -gst_vaapi_subpicture_new(GstVaapiImage *image, guint flags) + GstVaapiSubpicture *gst_vaapi_subpicture_new (GstVaapiImage * image, + guint flags) { - GstVaapiSubpicture *subpicture; - GstVaapiDisplay *display; - GstVideoFormat format; - guint va_flags; - - g_return_val_if_fail(image != NULL, NULL); - - GST_DEBUG("create from image %" GST_VAAPI_ID_FORMAT, - GST_VAAPI_ID_ARGS(GST_VAAPI_OBJECT_ID(image))); - - display = GST_VAAPI_OBJECT_DISPLAY(image); - format = GST_VAAPI_IMAGE_FORMAT(image); - if (!gst_vaapi_display_has_subpicture_format(display, format, &va_flags)) - return NULL; - if (flags & ~va_flags) - return NULL; - - subpicture = gst_vaapi_object_new(gst_vaapi_subpicture_class(), display); - if (!subpicture) - return NULL; - - subpicture->global_alpha = 1.0f; - if (!gst_vaapi_subpicture_set_image(subpicture, image)) - goto error; - return subpicture; + GstVaapiSubpicture *subpicture; + GstVaapiDisplay *display; + GstVideoFormat format; + guint va_flags; + + g_return_val_if_fail (image != NULL, NULL); + + GST_DEBUG ("create from image %" GST_VAAPI_ID_FORMAT, + GST_VAAPI_ID_ARGS (GST_VAAPI_OBJECT_ID (image))); + + display = GST_VAAPI_OBJECT_DISPLAY (image); + format = GST_VAAPI_IMAGE_FORMAT (image); + if (!gst_vaapi_display_has_subpicture_format (display, format, &va_flags)) + return NULL; + if (flags & ~va_flags) + return NULL; -error: - gst_vaapi_object_unref(subpicture); + subpicture = gst_vaapi_object_new (gst_vaapi_subpicture_class (), display); + if (!subpicture) return NULL; + + subpicture->global_alpha = 1.0f; + if (!gst_vaapi_subpicture_set_image (subpicture, image)) + goto error; + return subpicture; + +error: + gst_vaapi_object_unref (subpicture); + return NULL; } /** @@ -177,80 +174,80 @@ * Return value: the newly allocated #GstVaapiSubpicture object */ GstVaapiSubpicture * -gst_vaapi_subpicture_new_from_overlay_rectangle( - GstVaapiDisplay *display, - GstVideoOverlayRectangle *rect -) -{ - GstVaapiSubpicture *subpicture; - GstVideoFormat format; - GstVaapiImage *image; - GstVaapiImageRaw raw_image; - GstBuffer *buffer; - guint8 *data; - gfloat global_alpha; - guint width, height, stride; - guint hw_flags, flags; - GstVideoMeta *vmeta; - GstMapInfo map_info; +gst_vaapi_subpicture_new_from_overlay_rectangle (GstVaapiDisplay * display, + GstVideoOverlayRectangle * rect) +{ + GstVaapiSubpicture *subpicture; + GstVideoFormat format; + GstVaapiImage *image; + GstVaapiImageRaw raw_image; + GstBuffer *buffer; + guint8 *data; + gfloat global_alpha; + guint width, height, stride; + guint hw_flags, flags; + GstVideoMeta *vmeta; + GstMapInfo map_info; - g_return_val_if_fail(GST_IS_VIDEO_OVERLAY_RECTANGLE(rect), NULL); + g_return_val_if_fail (GST_IS_VIDEO_OVERLAY_RECTANGLE (rect), NULL); - /* XXX: use gst_vaapi_image_format_from_video() */ + /* XXX: use gst_vaapi_image_format_from_video() */ #if G_BYTE_ORDER == G_LITTLE_ENDIAN - format = GST_VIDEO_FORMAT_BGRA; + format = GST_VIDEO_FORMAT_BGRA; #else - format = GST_VIDEO_FORMAT_ARGB; + format = GST_VIDEO_FORMAT_ARGB; #endif - if (!gst_vaapi_display_has_subpicture_format(display, format, &hw_flags)) - return NULL; + if (!gst_vaapi_display_has_subpicture_format (display, format, &hw_flags)) + return NULL; - flags = hw_flags & from_GstVideoOverlayFormatFlags( - gst_video_overlay_rectangle_get_flags(rect)); + flags = + hw_flags & + from_GstVideoOverlayFormatFlags (gst_video_overlay_rectangle_get_flags + (rect)); + + buffer = gst_video_overlay_rectangle_get_pixels_unscaled_argb (rect, + to_GstVideoOverlayFormatFlags (flags)); + if (!buffer) + return NULL; - buffer = gst_video_overlay_rectangle_get_pixels_unscaled_argb(rect, - to_GstVideoOverlayFormatFlags(flags)); - if (!buffer) - return NULL; - - vmeta = gst_buffer_get_video_meta(buffer); - if (!vmeta) - return NULL; - width = vmeta->width; - height = vmeta->height; - - if (!gst_video_meta_map(vmeta, 0, &map_info, (gpointer *)&data, - (gint *)&stride, GST_MAP_READ)) - return NULL; - - image = gst_vaapi_image_new(display, format, width, height); - if (!image) - return NULL; - - raw_image.format = format; - raw_image.width = width; - raw_image.height = height; - raw_image.num_planes = 1; - raw_image.pixels[0] = data; - raw_image.stride[0] = stride; - if (!gst_vaapi_image_update_from_raw(image, &raw_image, NULL)) { - GST_WARNING("could not update VA image with subtitle data"); - gst_vaapi_object_unref(image); - return NULL; - } + vmeta = gst_buffer_get_video_meta (buffer); + if (!vmeta) + return NULL; + width = vmeta->width; + height = vmeta->height; - subpicture = gst_vaapi_subpicture_new(image, flags); - gst_vaapi_object_unref(image); - gst_video_meta_unmap(vmeta, 0, &map_info); - if (!subpicture) - return NULL; - - if (flags & GST_VAAPI_SUBPICTURE_FLAG_GLOBAL_ALPHA) { - global_alpha = gst_video_overlay_rectangle_get_global_alpha(rect); - if (!gst_vaapi_subpicture_set_global_alpha(subpicture, global_alpha)) - return NULL; - } - return subpicture; + if (!gst_video_meta_map (vmeta, 0, &map_info, (gpointer *) & data, + (gint *) & stride, GST_MAP_READ)) + return NULL; + + image = gst_vaapi_image_new (display, format, width, height); + if (!image) + return NULL; + + raw_image.format = format; + raw_image.width = width; + raw_image.height = height; + raw_image.num_planes = 1; + raw_image.pixels[0] = data; + raw_image.stride[0] = stride; + if (!gst_vaapi_image_update_from_raw (image, &raw_image, NULL)) { + GST_WARNING ("could not update VA image with subtitle data"); + gst_vaapi_object_unref (image); + return NULL; + } + + subpicture = gst_vaapi_subpicture_new (image, flags); + gst_vaapi_object_unref (image); + gst_video_meta_unmap (vmeta, 0, &map_info); + if (!subpicture) + return NULL; + + if (flags & GST_VAAPI_SUBPICTURE_FLAG_GLOBAL_ALPHA) { + global_alpha = gst_video_overlay_rectangle_get_global_alpha (rect); + if (!gst_vaapi_subpicture_set_global_alpha (subpicture, global_alpha)) + return NULL; + } + return subpicture; } /** @@ -262,11 +259,11 @@ * Return value: the underlying VA subpicture id */ GstVaapiID -gst_vaapi_subpicture_get_id(GstVaapiSubpicture *subpicture) +gst_vaapi_subpicture_get_id (GstVaapiSubpicture * subpicture) { - g_return_val_if_fail(subpicture != NULL, VA_INVALID_ID); + g_return_val_if_fail (subpicture != NULL, VA_INVALID_ID); - return GST_VAAPI_OBJECT_ID(subpicture); + return GST_VAAPI_OBJECT_ID (subpicture); } /** @@ -278,11 +275,11 @@ * Return value: the @subpicture flags */ guint -gst_vaapi_subpicture_get_flags(GstVaapiSubpicture *subpicture) +gst_vaapi_subpicture_get_flags (GstVaapiSubpicture * subpicture) { - g_return_val_if_fail(subpicture != NULL, 0); + g_return_val_if_fail (subpicture != NULL, 0); - return subpicture->flags; + return subpicture->flags; } /** @@ -294,11 +291,11 @@ * Return value: the #GstVaapiImage this @subpicture is bound to */ GstVaapiImage * -gst_vaapi_subpicture_get_image(GstVaapiSubpicture *subpicture) +gst_vaapi_subpicture_get_image (GstVaapiSubpicture * subpicture) { - g_return_val_if_fail(subpicture != NULL, NULL); + g_return_val_if_fail (subpicture != NULL, NULL); - return subpicture->image; + return subpicture->image; } /** @@ -312,14 +309,14 @@ * Return value: %TRUE on success */ gboolean -gst_vaapi_subpicture_set_image(GstVaapiSubpicture *subpicture, - GstVaapiImage *image) +gst_vaapi_subpicture_set_image (GstVaapiSubpicture * subpicture, + GstVaapiImage * image) { - g_return_val_if_fail(subpicture != NULL, FALSE); - g_return_val_if_fail(image != NULL, FALSE); + g_return_val_if_fail (subpicture != NULL, FALSE); + g_return_val_if_fail (image != NULL, FALSE); - gst_vaapi_subpicture_destroy(subpicture); - return gst_vaapi_subpicture_create(subpicture, image); + gst_vaapi_subpicture_destroy (subpicture); + return gst_vaapi_subpicture_create (subpicture, image); } /** @@ -331,11 +328,11 @@ * Return value: the global_alpha value of this @subpicture */ gfloat -gst_vaapi_subpicture_get_global_alpha(GstVaapiSubpicture *subpicture) +gst_vaapi_subpicture_get_global_alpha (GstVaapiSubpicture * subpicture) { - g_return_val_if_fail(subpicture != NULL, 1.0); + g_return_val_if_fail (subpicture != NULL, 1.0); - return subpicture->global_alpha; + return subpicture->global_alpha; } /** @@ -350,32 +347,29 @@ * Return value: %TRUE if global_alpha could be set, %FALSE otherwise */ gboolean -gst_vaapi_subpicture_set_global_alpha(GstVaapiSubpicture *subpicture, +gst_vaapi_subpicture_set_global_alpha (GstVaapiSubpicture * subpicture, gfloat global_alpha) { - GstVaapiDisplay *display; - VAStatus status; - - g_return_val_if_fail(subpicture != NULL, FALSE); + GstVaapiDisplay *display; + VAStatus status; - if (!(subpicture->flags & GST_VAAPI_SUBPICTURE_FLAG_GLOBAL_ALPHA)) - return FALSE; + g_return_val_if_fail (subpicture != NULL, FALSE); - if (subpicture->global_alpha == global_alpha) - return TRUE; - - display = GST_VAAPI_OBJECT_DISPLAY(subpicture); - - GST_VAAPI_DISPLAY_LOCK(display); - status = vaSetSubpictureGlobalAlpha( - GST_VAAPI_DISPLAY_VADISPLAY(display), - GST_VAAPI_OBJECT_ID(subpicture), - global_alpha - ); - GST_VAAPI_DISPLAY_UNLOCK(display); - if (!vaapi_check_status(status, "vaSetSubpictureGlobalAlpha()")) - return FALSE; + if (!(subpicture->flags & GST_VAAPI_SUBPICTURE_FLAG_GLOBAL_ALPHA)) + return FALSE; - subpicture->global_alpha = global_alpha; + if (subpicture->global_alpha == global_alpha) return TRUE; + + display = GST_VAAPI_OBJECT_DISPLAY (subpicture); + + GST_VAAPI_DISPLAY_LOCK (display); + status = vaSetSubpictureGlobalAlpha (GST_VAAPI_DISPLAY_VADISPLAY (display), + GST_VAAPI_OBJECT_ID (subpicture), global_alpha); + GST_VAAPI_DISPLAY_UNLOCK (display); + if (!vaapi_check_status (status, "vaSetSubpictureGlobalAlpha()")) + return FALSE; + + subpicture->global_alpha = global_alpha; + return TRUE; } diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapisurface.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapisurface.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapisurface.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapisurface.c 2016-04-20 15:27:22.000000000 +0000 @@ -159,7 +159,7 @@ extbuf.pixel_format = va_format->fourcc; extbuf.width = GST_VIDEO_INFO_WIDTH (vip); extbuf.height = GST_VIDEO_INFO_HEIGHT (vip); - extbuf_needed = !!(flags & GST_VAAPI_SURFACE_ALLOC_FLAG_LINEAR_STORAGE); + extbuf_needed = ! !(flags & GST_VAAPI_SURFACE_ALLOC_FLAG_LINEAR_STORAGE); extbuf.num_planes = GST_VIDEO_INFO_N_PLANES (vip); if (flags & GST_VAAPI_SURFACE_ALLOC_FLAG_FIXED_STRIDES) { @@ -624,6 +624,7 @@ GstVaapiDisplay *display; VAImage va_image; VAStatus status; + GstVaapiImage *image; g_return_val_if_fail (surface != NULL, NULL); @@ -640,7 +641,10 @@ if (va_image.image_id == VA_INVALID_ID || va_image.buf == VA_INVALID_ID) return NULL; - return gst_vaapi_image_new_with_image (display, &va_image); + image = gst_vaapi_image_new_with_image (display, &va_image); + if (!image) + vaDestroyImage (GST_VAAPI_DISPLAY_VADISPLAY (display), va_image.image_id); + return image; } /** diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapisurface.h gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapisurface.h --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapisurface.h 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapisurface.h 2016-03-24 11:36:59.000000000 +0000 @@ -65,6 +65,7 @@ * @GST_VAAPI_CHROMA_TYPE_YUV400: YUV 4:0:0 chroma format (grayscale) * @GST_VAAPI_CHROMA_TYPE_RGB32: 32-bit RGB chroma format * @GST_VAAPI_CHROMA_TYPE_RGB16: 16-bit RGB chroma format + * @GST_VAAPI_CHROMA_TYPE_YUV420_10BPP: YUV 4:2:0 chroma format, more than 8 bits per channel * * The set of all chroma types for #GstVaapiSurface. */ @@ -77,7 +78,8 @@ GST_VAAPI_CHROMA_TYPE_YUV410, GST_VAAPI_CHROMA_TYPE_YUV400, GST_VAAPI_CHROMA_TYPE_RGB32, - GST_VAAPI_CHROMA_TYPE_RGB16 + GST_VAAPI_CHROMA_TYPE_RGB16, + GST_VAAPI_CHROMA_TYPE_YUV420_10BPP } GstVaapiChromaType; /** diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapisurfacepool.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapisurfacepool.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapisurfacepool.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapisurfacepool.c 2016-03-24 11:36:59.000000000 +0000 @@ -41,7 +41,7 @@ */ struct _GstVaapiSurfacePool { - /*< private >*/ + /*< private > */ GstVaapiVideoPool parent_instance; GstVaapiChromaType chroma_type; @@ -95,7 +95,8 @@ { static const GstVaapiVideoPoolClass GstVaapiSurfacePoolClass = { {sizeof (GstVaapiSurfacePool), - (GDestroyNotify) gst_vaapi_video_pool_finalize}, + (GDestroyNotify) gst_vaapi_video_pool_finalize} + , .alloc_object = gst_vaapi_surface_pool_alloc_object }; return GST_VAAPI_MINI_OBJECT_CLASS (&GstVaapiSurfacePoolClass); @@ -164,3 +165,39 @@ gst_vaapi_mini_object_unref (GST_VAAPI_MINI_OBJECT (pool)); return NULL; } + +/** + * gst_vaapi_surface_pool_new_with_chroma_type: + * @display: a #GstVaapiDisplay + * @chroma_type: a #GstVaapiChromatype + * @width: the desired width, in pixels + * @height: the desired height, in pixels + * + * Creates a new #GstVaapiVideoPool of #GstVaapiSurface with the specified + * chroam type and dimensions. The underlying format of the surfaces is + * implementation (driver) defined. + * + * Return value: the newly allocated #GstVaapiVideoPool + */ +GstVaapiVideoPool * +gst_vaapi_surface_pool_new_with_chroma_type (GstVaapiDisplay * display, + GstVaapiChromaType chroma_type, guint width, guint height) +{ + GstVaapiVideoPool *pool; + GstVideoInfo vi; + + g_return_val_if_fail (display != NULL, NULL); + g_return_val_if_fail (chroma_type > 0, NULL); + g_return_val_if_fail (width > 0, NULL); + g_return_val_if_fail (height > 0, NULL); + + gst_video_info_set_format (&vi, GST_VIDEO_FORMAT_ENCODED, width, height); + + pool = gst_vaapi_surface_pool_new_full (display, &vi, 0); + if (!pool) + return NULL; + + GST_VAAPI_SURFACE_POOL (pool)->chroma_type = chroma_type; + + return pool; +} diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapisurfacepool.h gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapisurfacepool.h --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapisurfacepool.h 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapisurfacepool.h 2016-03-24 11:36:59.000000000 +0000 @@ -44,6 +44,10 @@ gst_vaapi_surface_pool_new_full (GstVaapiDisplay * display, const GstVideoInfo * vip, guint flags); +GstVaapiVideoPool * +gst_vaapi_surface_pool_new_with_chroma_type (GstVaapiDisplay * display, + GstVaapiChromaType chroma_type, guint width, guint height); + G_END_DECLS #endif /* GST_VAAPI_SURFACE_POOL_H */ diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapitexture_egl.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapitexture_egl.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapitexture_egl.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapitexture_egl.c 2016-03-24 11:36:59.000000000 +0000 @@ -50,7 +50,7 @@ */ struct _GstVaapiTextureEGL { - /*< private >*/ + /*< private > */ GstVaapiTexture parent_instance; EglContext *egl_context; @@ -66,7 +66,7 @@ */ struct _GstVaapiTextureEGLClass { - /*< private >*/ + /*< private > */ GstVaapiTextureClass parent_class; }; diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapitexture_glx.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapitexture_glx.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapitexture_glx.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapitexture_glx.c 2016-03-24 11:36:59.000000000 +0000 @@ -54,7 +54,7 @@ */ struct _GstVaapiTextureGLX { - /*< private >*/ + /*< private > */ GstVaapiTexture parent_instance; GLContextState *gl_context; @@ -69,7 +69,7 @@ */ struct _GstVaapiTextureGLXClass { - /*< private >*/ + /*< private > */ GstVaapiTextureClass parent_class; }; diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiutils.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiutils.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiutils.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiutils.c 2016-03-24 11:36:59.000000000 +0000 @@ -231,6 +231,9 @@ MAP (RGB32); MAP (RGBP); #endif +#if VA_CHECK_VERSION(0,38,1) + MAP (YUV420_10BPP); +#endif #undef MAP default: break; @@ -300,6 +303,11 @@ format = VA_RT_FORMAT_RGB16; break; #endif +#if VA_CHECK_VERSION(0,38,1) + case GST_VAAPI_CHROMA_TYPE_YUV420_10BPP: + format = VA_RT_FORMAT_YUV420_10BPP; + break; +#endif default: format = 0; break; diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiutils_egl.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiutils_egl.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiutils_egl.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiutils_egl.c 2016-03-24 11:36:59.000000000 +0000 @@ -840,8 +840,7 @@ /* ------------------------------------------------------------------------- */ // EGL Context -static void -egl_context_state_get_current (EglContextState * cs); +static void egl_context_state_get_current (EglContextState * cs); static gboolean egl_context_state_set_current (EglContextState * new_cs, @@ -1329,10 +1328,22 @@ egl_matrix_set_identity (gfloat m[16]) { #define MAT(m,r,c) (m)[(c) * 4 + (r)] - MAT(m,0,0) = 1.0; MAT(m,0,1) = 0.0; MAT(m,0,2) = 0.0; MAT(m,0,3) = 0.0; - MAT(m,1,0) = 0.0; MAT(m,1,1) = 1.0; MAT(m,1,2) = 0.0; MAT(m,1,3) = 0.0; - MAT(m,2,0) = 0.0; MAT(m,2,1) = 0.0; MAT(m,2,2) = 1.0; MAT(m,2,3) = 0.0; - MAT(m,3,0) = 0.0; MAT(m,3,1) = 0.0; MAT(m,3,2) = 0.0; MAT(m,3,3) = 1.0; + MAT (m, 0, 0) = 1.0; + MAT (m, 0, 1) = 0.0; + MAT (m, 0, 2) = 0.0; + MAT (m, 0, 3) = 0.0; + MAT (m, 1, 0) = 0.0; + MAT (m, 1, 1) = 1.0; + MAT (m, 1, 2) = 0.0; + MAT (m, 1, 3) = 0.0; + MAT (m, 2, 0) = 0.0; + MAT (m, 2, 1) = 0.0; + MAT (m, 2, 2) = 1.0; + MAT (m, 2, 3) = 0.0; + MAT (m, 3, 0) = 0.0; + MAT (m, 3, 1) = 0.0; + MAT (m, 3, 2) = 0.0; + MAT (m, 3, 3) = 1.0; #undef MAT } diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiutils_glx.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiutils_glx.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiutils_glx.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiutils_glx.c 2016-03-24 11:36:59.000000000 +0000 @@ -35,7 +35,7 @@ /** Lookup for substring NAME in string EXT using SEP as separators */ static gboolean -find_string (const gchar *name, const gchar *ext, const gchar *sep) +find_string (const gchar * name, const gchar * ext, const gchar * sep) { const gchar *end; int name_len, n; @@ -635,7 +635,7 @@ typedef GLFuncPtr (*GLXGetProcAddressProc) (const gchar *); static GLFuncPtr -get_proc_address_default (const gchar *name) +get_proc_address_default (const gchar * name) { return NULL; } @@ -658,7 +658,7 @@ } static inline GLFuncPtr -get_proc_address (const gchar *name) +get_proc_address (const gchar * name) { static GLXGetProcAddressProc get_proc_func = NULL; if (!get_proc_func) diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiutils_h265.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiutils_h265.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiutils_h265.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiutils_h265.c 2016-03-24 11:36:59.000000000 +0000 @@ -281,16 +281,20 @@ /** Returns GstVaapiChromaType from H.265 chroma_format_idc value */ GstVaapiChromaType -gst_vaapi_utils_h265_get_chroma_type (guint chroma_format_idc) +gst_vaapi_utils_h265_get_chroma_type (guint chroma_format_idc, + guint luma_bit_depth) { - GstVaapiChromaType chroma_type; + GstVaapiChromaType chroma_type = (GstVaapiChromaType) 0; switch (chroma_format_idc) { case 0: chroma_type = GST_VAAPI_CHROMA_TYPE_YUV400; break; case 1: - chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420; + if (luma_bit_depth == 8) + chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420; + else if (luma_bit_depth > 8) + chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420_10BPP; break; case 2: chroma_type = GST_VAAPI_CHROMA_TYPE_YUV422; @@ -317,6 +321,7 @@ chroma_format_idc = 0; break; case GST_VAAPI_CHROMA_TYPE_YUV420: + case GST_VAAPI_CHROMA_TYPE_YUV420_10BPP: chroma_format_idc = 1; break; case GST_VAAPI_CHROMA_TYPE_YUV422: @@ -346,8 +351,7 @@ const gchar * gst_vaapi_utils_h265_get_tier_string (GstVaapiTierH265 tier) { - const struct map *const m = - map_lookup_value (gst_vaapi_h265_tier_map, tier); + const struct map *const m = map_lookup_value (gst_vaapi_h265_tier_map, tier); return m ? m->name : NULL; } diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiutils_h265_priv.h gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiutils_h265_priv.h --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiutils_h265_priv.h 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiutils_h265_priv.h 2016-03-24 11:36:59.000000000 +0000 @@ -93,7 +93,7 @@ /* Returns GstVaapiChromaType from H.265 chroma_format_idc value */ G_GNUC_INTERNAL GstVaapiChromaType -gst_vaapi_utils_h265_get_chroma_type (guint chroma_format_idc); +gst_vaapi_utils_h265_get_chroma_type (guint chroma_format_idc, guint luma_bit_depth); /* Returns H.265 chroma_format_idc value from GstVaapiChromaType */ G_GNUC_INTERNAL diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiutils_x11.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiutils_x11.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiutils_x11.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiutils_x11.c 2016-03-24 11:36:59.000000000 +0000 @@ -53,15 +53,9 @@ } // X window management -static const int x11_event_mask = - (KeyPressMask | - KeyReleaseMask | - ButtonPressMask | - ButtonReleaseMask | - PointerMotionMask | - EnterWindowMask | - ExposureMask | - StructureNotifyMask); +static const int x11_event_mask = (KeyPressMask | KeyReleaseMask + | ButtonPressMask | ButtonReleaseMask | PointerMotionMask + | EnterWindowMask | ExposureMask | StructureNotifyMask); /** * x11_create_window: diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiversion.h gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiversion.h --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiversion.h 2015-12-07 10:56:02.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiversion.h 2016-06-09 08:37:50.000000000 +0000 @@ -28,6 +28,6 @@ * The full version identifier of gstreamer-vaapi, in string form * (suitable for string concatenation). */ -#define GST_VAAPI_VERSION_ID "0.7.0" +#define GST_VAAPI_VERSION_ID "" #endif /* GST_VAAPI_VERSION_H */ diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiwindow.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiwindow.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiwindow.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiwindow.c 2016-03-24 11:36:59.000000000 +0000 @@ -126,7 +126,8 @@ dpy_class = GST_VAAPI_DISPLAY_GET_CLASS (display); if (G_UNLIKELY (!dpy_class->create_window)) return NULL; - return dpy_class->create_window (display, GST_VAAPI_ID_INVALID, width, height); + return dpy_class->create_window (display, GST_VAAPI_ID_INVALID, width, + height); } /** diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiwindow_drm.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiwindow_drm.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiwindow_drm.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiwindow_drm.c 2016-03-24 11:36:59.000000000 +0000 @@ -42,7 +42,7 @@ */ struct _GstVaapiWindowDRM { - /*< private >*/ + /*< private > */ GstVaapiWindow parent_instance; }; @@ -53,7 +53,7 @@ */ struct _GstVaapiWindowDRMClass { - /*< private >*/ + /*< private > */ GstVaapiWindowClass parent_instance; }; diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiwindow_egl.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiwindow_egl.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiwindow_egl.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiwindow_egl.c 2016-03-24 11:36:59.000000000 +0000 @@ -96,34 +96,32 @@ gboolean success; /* result */ } UploadSurfaceArgs; +/* *IDENT-OFF* */ static const gchar *vert_shader_text = - "#ifdef GL_ES\n" - "precision mediump float;\n" - "#endif\n" - "\n" - "uniform mat4 proj;\n" - "\n" - "attribute vec2 position;\n" - "attribute vec2 texcoord;\n" - "varying vec2 v_texcoord;\n" - "\n" - "void main () {\n" - " gl_Position = proj * vec4 (position, 0.0, 1.0);\n" - " v_texcoord = texcoord;\n" - "}\n"; + "#ifdef GL_ES \n" + "precision mediump float; \n" + "#endif \n" + "uniform mat4 proj; \n" + "attribute vec2 position; \n" + "attribute vec2 texcoord; \n" + "varying vec2 v_texcoord; \n" + "void main () \n" + "{ \n" + " gl_Position = proj * vec4 (position, 0.0, 1.0); \n" + " v_texcoord = texcoord; \n" + "} \n"; static const gchar *frag_shader_text_rgba = - "#ifdef GL_ES\n" - "precision mediump float;\n" - "#endif\n" - "\n" - "uniform sampler2D tex0;\n" - "\n" - "varying vec2 v_texcoord;\n" - "\n" - "void main () {\n" - " gl_FragColor = texture2D (tex0, v_texcoord);\n" - "}\n"; + "#ifdef GL_ES \n" + "precision mediump float; \n" + "#endif \n" + "uniform sampler2D tex0; \n" + "varying vec2 v_texcoord; \n" + "void main () \n" + "{ \n" + " gl_FragColor = texture2D (tex0, v_texcoord); \n" + "} \n"; +/* *IDENT-ON* */ static gboolean ensure_texture (GstVaapiWindowEGL * window, guint width, guint height) @@ -399,9 +397,9 @@ texcoords[3][1] = y0; // Target coords in EGL surface - x0 = 2.0f * ((GLfloat) rect->x / tex_width) - 1.0f; + x0 = 2.0f * ((GLfloat) rect->x / tex_width) - 1.0f; y1 = -2.0f * ((GLfloat) rect->y / tex_height) + 1.0f; - x1 = 2.0f * ((GLfloat) (rect->x + rect->width) / tex_width) - 1.0f; + x1 = 2.0f * ((GLfloat) (rect->x + rect->width) / tex_width) - 1.0f; y0 = -2.0f * ((GLfloat) (rect->y + rect->height) / tex_height) + 1.0f; positions[0][0] = x0; positions[0][1] = y0; diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiwindow_glx.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiwindow_glx.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiwindow_glx.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiwindow_glx.c 2016-03-24 11:36:59.000000000 +0000 @@ -64,7 +64,7 @@ */ struct _GstVaapiWindowGLX { - /*< private >*/ + /*< private > */ GstVaapiWindowX11 parent_instance; GstVaapiWindowGLXPrivate priv; @@ -77,7 +77,7 @@ */ struct _GstVaapiWindowGLXClass { - /*< private >*/ + /*< private > */ GstVaapiWindowX11Class parent_class; GstVaapiObjectFinalizeFunc parent_finalize; diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c 2016-03-24 11:36:59.000000000 +0000 @@ -120,7 +120,7 @@ */ struct _GstVaapiWindowWayland { - /*< private >*/ + /*< private > */ GstVaapiWindow parent_instance; GstVaapiWindowWaylandPrivate priv; @@ -133,7 +133,7 @@ */ struct _GstVaapiWindowWaylandClass { - /*< private >*/ + /*< private > */ GstVaapiWindowClass parent_class; }; @@ -368,7 +368,6 @@ GST_VAAPI_WINDOW_WAYLAND_GET_PRIVATE (frame->window); g_atomic_pointer_compare_and_exchange (&priv->last_frame, frame, NULL); - frame_state_free (frame); g_atomic_int_dec_and_test (&priv->num_frames_pending); } @@ -380,6 +379,7 @@ frame_release_callback (void *data, struct wl_buffer *wl_buffer) { wl_buffer_destroy (wl_buffer); + frame_state_free (data); } static const struct wl_buffer_listener frame_buffer_listener = { @@ -542,11 +542,8 @@ priv->opaque_region = NULL; } - /* @TODO: It is not OK to use internal event_queue here, since there - * may still be a WL_BUFFER_RELEASE event when we destroy the - * event_queue in gst_vaapi_window_wayland_destroy (). */ wl_proxy_set_queue ((struct wl_proxy *) buffer, priv->event_queue); - wl_buffer_add_listener (buffer, &frame_buffer_listener, NULL); + wl_buffer_add_listener (buffer, &frame_buffer_listener, frame); frame->callback = wl_surface_frame (priv->surface); wl_callback_add_listener (frame->callback, &frame_callback_listener, frame); diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/Makefile.am gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/Makefile.am --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/Makefile.am 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/Makefile.am 2016-03-24 11:36:59.000000000 +0000 @@ -1,28 +1,25 @@ -lib_LTLIBRARIES = libgstvaapi-@GST_API_VERSION@.la +noinst_LTLIBRARIES = libgstvaapi.la if USE_DRM -lib_LTLIBRARIES += libgstvaapi-drm-@GST_API_VERSION@.la +noinst_LTLIBRARIES += libgstvaapi-drm.la endif if USE_X11 -lib_LTLIBRARIES += libgstvaapi-x11-@GST_API_VERSION@.la +noinst_LTLIBRARIES += libgstvaapi-x11.la endif if USE_GLX -lib_LTLIBRARIES += libgstvaapi-glx-@GST_API_VERSION@.la +noinst_LTLIBRARIES += libgstvaapi-glx.la endif if USE_EGL -lib_LTLIBRARIES += libgstvaapi-egl-@GST_API_VERSION@.la +noinst_LTLIBRARIES += libgstvaapi-egl.la endif if USE_WAYLAND -lib_LTLIBRARIES += libgstvaapi-wayland-@GST_API_VERSION@.la +noinst_LTLIBRARIES += libgstvaapi-wayland.la endif -libgstvaapi_includedir = \ - $(includedir)/gstreamer-$(GST_PKG_VERSION)/gst/vaapi - libgstvaapi_cflags = \ -DIN_LIBGSTVAAPI \ -DIN_LIBGSTVAAPI_CORE \ @@ -45,7 +42,7 @@ $(GST_CODEC_PARSERS_LIBS) \ $(LIBVA_LIBS) \ $(top_builddir)/gst-libs/gst/base/libgstvaapi-baseutils.la \ - $(top_builddir)/gst-libs/gst/codecparsers/libgstvaapi-codecparsers.la + $(NULL) libgstvaapi_source_c = \ gstvaapibufferproxy.c \ @@ -79,6 +76,7 @@ gstvaapiutils.c \ gstvaapiutils_core.c \ gstvaapiutils_h264.c \ + gstvaapiutils_h265.c \ gstvaapiutils_mpeg2.c \ gstvaapivalue.c \ gstvaapivideopool.c \ @@ -109,6 +107,7 @@ gstvaapitexture.h \ gstvaapitypes.h \ gstvaapiutils_h264.h \ + gstvaapiutils_h265.h \ gstvaapiutils_mpeg2.h \ gstvaapivalue.h \ gstvaapivideopool.h \ @@ -141,6 +140,7 @@ gstvaapiutils.h \ gstvaapiutils_core.h \ gstvaapiutils_h264_priv.h \ + gstvaapiutils_h265_priv.h \ gstvaapiutils_mpeg2_priv.h \ gstvaapiversion.h \ gstvaapivideopool_priv.h \ @@ -164,15 +164,11 @@ libgstvaapi_source_h += $(libgstvaapi_vp8dec_source_h) endif -libgstvaapi_hevcdec_source_c = \ - gstvaapidecoder_h265.c \ - gstvaapiutils_h265.c -libgstvaapi_hevcdec_source_h = gstvaapiutils_h265.h -libgstvaapi_hevcdec_source_priv_h = gstvaapiutils_h265_priv.h +libgstvaapi_hevcdec_source_c = gstvaapidecoder_h265.c +libgstvaapi_hevcdec_source_h = gstvaapidecoder_h265.h if USE_HEVC_DECODER libgstvaapi_source_c += $(libgstvaapi_hevcdec_source_c) libgstvaapi_source_h += $(libgstvaapi_hevcdec_source_h) -libgstvaapi_source_priv_h += $(libgstvaapi_hevcdec_source_priv_h) endif libgstvaapi_vp9dec_source_c = gstvaapidecoder_vp9.c @@ -239,7 +235,6 @@ libgstvaapi_drm_source_c = \ gstvaapidisplay_drm.c \ gstvaapiwindow_drm.c \ - gstvaapiutils.c \ $(NULL) libgstvaapi_drm_source_h = \ @@ -250,13 +245,11 @@ libgstvaapi_drm_source_priv_h = \ gstvaapicompat.h \ gstvaapidisplay_drm_priv.h \ - gstvaapiutils.h \ $(NULL) libgstvaapi_x11_source_c = \ gstvaapidisplay_x11.c \ gstvaapipixmap_x11.c \ - gstvaapiutils.c \ gstvaapiutils_x11.c \ gstvaapiwindow_x11.c \ $(NULL) @@ -270,7 +263,6 @@ libgstvaapi_x11_source_priv_h = \ gstvaapicompat.h \ gstvaapidisplay_x11_priv.h \ - gstvaapiutils.h \ gstvaapiutils_x11.h \ gstvaapiwindow_x11_priv.h \ $(NULL) @@ -278,9 +270,7 @@ libgstvaapi_glx_source_c = \ gstvaapidisplay_glx.c \ gstvaapitexture_glx.c \ - gstvaapiutils.c \ gstvaapiutils_glx.c \ - gstvaapiutils_x11.c \ gstvaapiwindow_glx.c \ $(NULL) @@ -296,7 +286,6 @@ gstvaapidisplay_glx_priv.h \ gstvaapiutils.h \ gstvaapiutils_glx.h \ - gstvaapiutils_x11.h \ $(NULL) libgstvaapi_egl_source_c = \ @@ -324,7 +313,6 @@ libgstvaapi_wayland_source_c = \ gstvaapidisplay_wayland.c \ - gstvaapiutils.c \ gstvaapiwindow_wayland.c \ $(NULL) @@ -336,48 +324,33 @@ libgstvaapi_wayland_source_priv_h = \ gstvaapicompat.h \ gstvaapidisplay_wayland_priv.h \ - gstvaapiutils.h \ $(NULL) -libgstvaapi_@GST_API_VERSION@_la_SOURCES = \ +libgstvaapi_la_SOURCES = \ $(libgstvaapi_source_c) \ $(libgstvaapi_source_priv_h) \ - $(NULL) - -libgstvaapi_@GST_API_VERSION@include_HEADERS = \ $(libgstvaapi_source_h) \ $(NULL) -libgstvaapi_@GST_API_VERSION@includedir = \ - $(libgstvaapi_includedir) - -libgstvaapi_@GST_API_VERSION@_la_CFLAGS = \ +libgstvaapi_la_CFLAGS = \ $(libgstvaapi_cflags) \ $(NULL) -libgstvaapi_@GST_API_VERSION@_la_LIBADD = \ +libgstvaapi_la_LIBADD = \ $(libgstvaapi_libs) \ $(NULL) -libgstvaapi_@GST_API_VERSION@_la_LDFLAGS = \ +libgstvaapi_la_LDFLAGS = \ $(GST_ALL_LDFLAGS) \ - $(GST_VAAPI_LT_LDFLAGS) \ - -export-symbols-regex "^gst_.*vaapi.*" \ $(NULL) -libgstvaapi_drm_@GST_API_VERSION@_la_SOURCES = \ +libgstvaapi_drm_la_SOURCES = \ $(libgstvaapi_drm_source_c) \ $(libgstvaapi_drm_source_priv_h) \ - $(NULL) - -libgstvaapi_drm_@GST_API_VERSION@include_HEADERS = \ $(libgstvaapi_drm_source_h) \ $(NULL) -libgstvaapi_drm_@GST_API_VERSION@includedir = \ - $(libgstvaapi_includedir) - -libgstvaapi_drm_@GST_API_VERSION@_la_CFLAGS = \ +libgstvaapi_drm_la_CFLAGS = \ -DIN_LIBGSTVAAPI \ -DGST_USE_UNSTABLE_API \ -I$(top_srcdir)/gst-libs \ @@ -389,33 +362,25 @@ $(LIBVA_DRM_CFLAGS) \ $(NULL) -libgstvaapi_drm_@GST_API_VERSION@_la_LIBADD = \ +libgstvaapi_drm_la_LIBADD = \ $(GLIB_LIBS) \ $(GST_LIBS) \ $(UDEV_LIBS) \ $(DRM_LIBS) \ $(LIBVA_DRM_LIBS) \ - libgstvaapi-$(GST_API_VERSION).la \ $(NULL) -libgstvaapi_drm_@GST_API_VERSION@_la_LDFLAGS = \ +libgstvaapi_drm_la_LDFLAGS = \ $(GST_ALL_LDFLAGS) \ - $(GST_VAAPI_LT_LDFLAGS) \ $(NULL) -libgstvaapi_x11_@GST_API_VERSION@_la_SOURCES = \ +libgstvaapi_x11_la_SOURCES = \ $(libgstvaapi_x11_source_c) \ $(libgstvaapi_x11_source_priv_h) \ - $(NULL) - -libgstvaapi_x11_@GST_API_VERSION@include_HEADERS = \ $(libgstvaapi_x11_source_h) \ $(NULL) -libgstvaapi_x11_@GST_API_VERSION@includedir = \ - $(libgstvaapi_includedir) - -libgstvaapi_x11_@GST_API_VERSION@_la_CFLAGS = \ +libgstvaapi_x11_la_CFLAGS = \ -DIN_LIBGSTVAAPI \ -DGST_USE_UNSTABLE_API \ -I$(top_srcdir)/gst-libs \ @@ -428,34 +393,26 @@ $(LIBVA_X11_CFLAGS) \ $(NULL) -libgstvaapi_x11_@GST_API_VERSION@_la_LIBADD = \ +libgstvaapi_x11_la_LIBADD = \ $(GLIB_LIBS) \ $(GST_LIBS) \ $(X11_LIBS) \ $(XRANDR_LIBS) \ $(XRENDER_LIBS) \ $(LIBVA_X11_LIBS) \ - libgstvaapi-$(GST_API_VERSION).la \ $(NULL) -libgstvaapi_x11_@GST_API_VERSION@_la_LDFLAGS = \ +libgstvaapi_x11_la_LDFLAGS = \ $(GST_ALL_LDFLAGS) \ - $(GST_VAAPI_LT_LDFLAGS) \ $(NULL) -libgstvaapi_glx_@GST_API_VERSION@_la_SOURCES = \ +libgstvaapi_glx_la_SOURCES = \ $(libgstvaapi_glx_source_c) \ $(libgstvaapi_glx_source_priv_h) \ - $(NULL) - -libgstvaapi_glx_@GST_API_VERSION@include_HEADERS = \ $(libgstvaapi_glx_source_h) \ $(NULL) -libgstvaapi_glx_@GST_API_VERSION@includedir = \ - $(libgstvaapi_includedir) - -libgstvaapi_glx_@GST_API_VERSION@_la_CFLAGS = \ +libgstvaapi_glx_la_CFLAGS = \ -DIN_LIBGSTVAAPI \ -DGST_USE_UNSTABLE_API \ -I$(top_srcdir)/gst-libs \ @@ -466,7 +423,7 @@ $(LIBVA_X11_CFLAGS) \ $(NULL) -libgstvaapi_glx_@GST_API_VERSION@_la_LIBADD = \ +libgstvaapi_glx_la_LIBADD = \ $(GLIB_LIBS) \ $(GST_LIBS) \ $(GST_BASE_LIBS) \ @@ -474,29 +431,20 @@ $(X11_LIBS) \ $(GL_LIBS) \ $(LIBVA_X11_LIBS) \ - libgstvaapi-x11-$(GST_API_VERSION).la \ - libgstvaapi-$(GST_API_VERSION).la \ $(DLOPEN_LIBS) \ $(NULL) -libgstvaapi_glx_@GST_API_VERSION@_la_LDFLAGS = \ +libgstvaapi_glx_la_LDFLAGS = \ $(GST_ALL_LDFLAGS) \ - $(GST_VAAPI_LT_LDFLAGS) \ $(NULL) -libgstvaapi_egl_@GST_API_VERSION@_la_SOURCES = \ +libgstvaapi_egl_la_SOURCES = \ $(libgstvaapi_egl_source_c) \ $(libgstvaapi_egl_source_priv_h) \ - $(NULL) - -libgstvaapi_egl_@GST_API_VERSION@include_HEADERS = \ $(libgstvaapi_egl_source_h) \ $(NULL) -libgstvaapi_egl_@GST_API_VERSION@includedir = \ - $(libgstvaapi_includedir) - -libgstvaapi_egl_@GST_API_VERSION@_la_CFLAGS = \ +libgstvaapi_egl_la_CFLAGS = \ -DIN_LIBGSTVAAPI \ -DGST_USE_UNSTABLE_API \ -I$(top_srcdir)/gst-libs \ @@ -508,35 +456,27 @@ $(EGL_CFLAGS) \ $(NULL) -libgstvaapi_egl_@GST_API_VERSION@_la_LIBADD = \ +libgstvaapi_egl_la_LIBADD = \ $(GLIB_LIBS) \ $(GMODULE_LIBS) \ $(GST_LIBS) \ $(GST_BASE_LIBS) \ $(GST_VIDEO_LIBS) \ - libgstvaapi-$(GST_API_VERSION).la \ $(EGL_LIBS) \ $(DLOPEN_LIBS) \ $(NULL) -libgstvaapi_egl_@GST_API_VERSION@_la_LDFLAGS = \ +libgstvaapi_egl_la_LDFLAGS = \ $(GST_ALL_LDFLAGS) \ - $(GST_VAAPI_LT_LDFLAGS) \ $(NULL) -libgstvaapi_wayland_@GST_API_VERSION@_la_SOURCES = \ +libgstvaapi_wayland_la_SOURCES = \ $(libgstvaapi_wayland_source_c) \ $(libgstvaapi_wayland_source_priv_h) \ - $(NULL) - -libgstvaapi_wayland_@GST_API_VERSION@include_HEADERS = \ $(libgstvaapi_wayland_source_h) \ $(NULL) -libgstvaapi_wayland_@GST_API_VERSION@includedir = \ - $(libgstvaapi_includedir) - -libgstvaapi_wayland_@GST_API_VERSION@_la_CFLAGS = \ +libgstvaapi_wayland_la_CFLAGS = \ -DIN_LIBGSTVAAPI \ -DGST_USE_UNSTABLE_API \ -I$(top_srcdir)/gst-libs \ @@ -547,18 +487,16 @@ $(LIBVA_WAYLAND_CFLAGS) \ $(NULL) -libgstvaapi_wayland_@GST_API_VERSION@_la_LIBADD = \ +libgstvaapi_wayland_la_LIBADD = \ $(GLIB_LIBS) \ $(GST_LIBS) \ $(GST_VIDEO_LIBS) \ $(WAYLAND_LIBS) \ $(LIBVA_WAYLAND_LIBS) \ - libgstvaapi-$(GST_API_VERSION).la \ $(NULL) -libgstvaapi_wayland_@GST_API_VERSION@_la_LDFLAGS = \ +libgstvaapi_wayland_la_LDFLAGS = \ $(GST_ALL_LDFLAGS) \ - $(GST_VAAPI_LT_LDFLAGS) \ $(NULL) VERSION_FILE = .VERSION diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/Makefile.in gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/Makefile.in --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/Makefile.in 2015-12-07 10:54:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/Makefile.in 2016-06-09 07:27:12.000000000 +0000 @@ -14,7 +14,6 @@ @SET_MAKE@ - VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ @@ -90,94 +89,149 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -@USE_DRM_TRUE@am__append_1 = libgstvaapi-drm-@GST_API_VERSION@.la -@USE_X11_TRUE@am__append_2 = libgstvaapi-x11-@GST_API_VERSION@.la -@USE_GLX_TRUE@am__append_3 = libgstvaapi-glx-@GST_API_VERSION@.la -@USE_EGL_TRUE@am__append_4 = libgstvaapi-egl-@GST_API_VERSION@.la -@USE_WAYLAND_TRUE@am__append_5 = libgstvaapi-wayland-@GST_API_VERSION@.la +@USE_DRM_TRUE@am__append_1 = libgstvaapi-drm.la +@USE_X11_TRUE@am__append_2 = libgstvaapi-x11.la +@USE_GLX_TRUE@am__append_3 = libgstvaapi-glx.la +@USE_EGL_TRUE@am__append_4 = libgstvaapi-egl.la +@USE_WAYLAND_TRUE@am__append_5 = libgstvaapi-wayland.la @USE_JPEG_DECODER_TRUE@am__append_6 = $(libgstvaapi_jpegdec_source_c) @USE_JPEG_DECODER_TRUE@am__append_7 = $(libgstvaapi_jpegdec_source_h) @USE_VP8_DECODER_TRUE@am__append_8 = $(libgstvaapi_vp8dec_source_c) @USE_VP8_DECODER_TRUE@am__append_9 = $(libgstvaapi_vp8dec_source_h) @USE_HEVC_DECODER_TRUE@am__append_10 = $(libgstvaapi_hevcdec_source_c) @USE_HEVC_DECODER_TRUE@am__append_11 = $(libgstvaapi_hevcdec_source_h) -@USE_HEVC_DECODER_TRUE@am__append_12 = $(libgstvaapi_hevcdec_source_priv_h) -@USE_VP9_DECODER_TRUE@am__append_13 = $(libgstvaapi_vp9dec_source_c) -@USE_VP9_DECODER_TRUE@am__append_14 = $(libgstvaapi_vp9dec_source_h) -@USE_ENCODERS_TRUE@am__append_15 = $(libgstvaapi_enc_source_c) -@USE_ENCODERS_TRUE@am__append_16 = $(libgstvaapi_enc_source_h) -@USE_ENCODERS_TRUE@am__append_17 = $(libgstvaapi_enc_source_priv_h) -@USE_JPEG_ENCODER_TRUE@am__append_18 = $(libgstvaapi_jpegenc_source_c) -@USE_JPEG_ENCODER_TRUE@am__append_19 = $(libgstvaapi_jpegenc_source_h) -@USE_VP8_ENCODER_TRUE@am__append_20 = $(libgstvaapi_vp8enc_source_c) -@USE_VP8_ENCODER_TRUE@am__append_21 = $(libgstvaapi_vp8enc_source_h) -@USE_H265_ENCODER_TRUE@am__append_22 = $(libgstvaapi_h265enc_source_c) -@USE_H265_ENCODER_TRUE@am__append_23 = $(libgstvaapi_h265enc_source_h) +@USE_VP9_DECODER_TRUE@am__append_12 = $(libgstvaapi_vp9dec_source_c) +@USE_VP9_DECODER_TRUE@am__append_13 = $(libgstvaapi_vp9dec_source_h) +@USE_ENCODERS_TRUE@am__append_14 = $(libgstvaapi_enc_source_c) +@USE_ENCODERS_TRUE@am__append_15 = $(libgstvaapi_enc_source_h) +@USE_ENCODERS_TRUE@am__append_16 = $(libgstvaapi_enc_source_priv_h) +@USE_JPEG_ENCODER_TRUE@am__append_17 = $(libgstvaapi_jpegenc_source_c) +@USE_JPEG_ENCODER_TRUE@am__append_18 = $(libgstvaapi_jpegenc_source_h) +@USE_VP8_ENCODER_TRUE@am__append_19 = $(libgstvaapi_vp8enc_source_c) +@USE_VP8_ENCODER_TRUE@am__append_20 = $(libgstvaapi_vp8enc_source_h) +@USE_H265_ENCODER_TRUE@am__append_21 = $(libgstvaapi_h265enc_source_c) +@USE_H265_ENCODER_TRUE@am__append_22 = $(libgstvaapi_h265enc_source_h) subdir = gst-libs/gst/vaapi ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-arch.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-platform.m4 \ + $(top_srcdir)/common/m4/gst-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am \ - $(am__libgstvaapi_@GST_API_VERSION@include_HEADERS_DIST) \ - $(libgstvaapi_drm_@GST_API_VERSION@include_HEADERS) \ - $(libgstvaapi_egl_@GST_API_VERSION@include_HEADERS) \ - $(libgstvaapi_glx_@GST_API_VERSION@include_HEADERS) \ - $(libgstvaapi_wayland_@GST_API_VERSION@include_HEADERS) \ - $(libgstvaapi_x11_@GST_API_VERSION@include_HEADERS) \ - $(am__DIST_COMMON) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(libdir)" \ - "$(DESTDIR)$(libgstvaapi_@GST_API_VERSION@includedir)" \ - "$(DESTDIR)$(libgstvaapi_drm_@GST_API_VERSION@includedir)" \ - "$(DESTDIR)$(libgstvaapi_egl_@GST_API_VERSION@includedir)" \ - "$(DESTDIR)$(libgstvaapi_glx_@GST_API_VERSION@includedir)" \ - "$(DESTDIR)$(libgstvaapi_wayland_@GST_API_VERSION@includedir)" \ - "$(DESTDIR)$(libgstvaapi_x11_@GST_API_VERSION@includedir)" -LTLIBRARIES = $(lib_LTLIBRARIES) +LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = -am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ +libgstvaapi_drm_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am__objects_1 = libgstvaapi_drm_la-gstvaapidisplay_drm.lo \ + libgstvaapi_drm_la-gstvaapiwindow_drm.lo +am__objects_2 = +am_libgstvaapi_drm_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ + $(am__objects_2) +libgstvaapi_drm_la_OBJECTS = $(am_libgstvaapi_drm_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libgstvaapi_drm_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(libgstvaapi_drm_la_CFLAGS) $(CFLAGS) \ + $(libgstvaapi_drm_la_LDFLAGS) $(LDFLAGS) -o $@ +@USE_DRM_TRUE@am_libgstvaapi_drm_la_rpath = +libgstvaapi_egl_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(top_builddir)/gst-libs/gst/base/libgstvaapi-baseutils.la \ - $(top_builddir)/gst-libs/gst/codecparsers/libgstvaapi-codecparsers.la -libgstvaapi_@GST_API_VERSION@_la_DEPENDENCIES = $(am__DEPENDENCIES_2) -am__libgstvaapi_@GST_API_VERSION@_la_SOURCES_DIST = \ - gstvaapibufferproxy.c gstvaapicodec_objects.c \ - gstvaapicontext.c gstvaapicontext_overlay.c gstvaapidecoder.c \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am__objects_3 = libgstvaapi_egl_la-gstvaapidisplay_egl.lo \ + libgstvaapi_egl_la-gstvaapisurface_egl.lo \ + libgstvaapi_egl_la-gstvaapitexture_egl.lo \ + libgstvaapi_egl_la-gstvaapiutils_egl.lo \ + libgstvaapi_egl_la-gstvaapiwindow_egl.lo +am_libgstvaapi_egl_la_OBJECTS = $(am__objects_3) $(am__objects_2) \ + $(am__objects_2) +libgstvaapi_egl_la_OBJECTS = $(am_libgstvaapi_egl_la_OBJECTS) +libgstvaapi_egl_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(libgstvaapi_egl_la_CFLAGS) $(CFLAGS) \ + $(libgstvaapi_egl_la_LDFLAGS) $(LDFLAGS) -o $@ +@USE_EGL_TRUE@am_libgstvaapi_egl_la_rpath = +libgstvaapi_glx_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am__objects_4 = libgstvaapi_glx_la-gstvaapidisplay_glx.lo \ + libgstvaapi_glx_la-gstvaapitexture_glx.lo \ + libgstvaapi_glx_la-gstvaapiutils_glx.lo \ + libgstvaapi_glx_la-gstvaapiwindow_glx.lo +am_libgstvaapi_glx_la_OBJECTS = $(am__objects_4) $(am__objects_2) \ + $(am__objects_2) +libgstvaapi_glx_la_OBJECTS = $(am_libgstvaapi_glx_la_OBJECTS) +libgstvaapi_glx_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(libgstvaapi_glx_la_CFLAGS) $(CFLAGS) \ + $(libgstvaapi_glx_la_LDFLAGS) $(LDFLAGS) -o $@ +@USE_GLX_TRUE@am_libgstvaapi_glx_la_rpath = +libgstvaapi_wayland_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am__objects_5 = libgstvaapi_wayland_la-gstvaapidisplay_wayland.lo \ + libgstvaapi_wayland_la-gstvaapiwindow_wayland.lo +am_libgstvaapi_wayland_la_OBJECTS = $(am__objects_5) $(am__objects_2) \ + $(am__objects_2) +libgstvaapi_wayland_la_OBJECTS = $(am_libgstvaapi_wayland_la_OBJECTS) +libgstvaapi_wayland_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(libgstvaapi_wayland_la_CFLAGS) $(CFLAGS) \ + $(libgstvaapi_wayland_la_LDFLAGS) $(LDFLAGS) -o $@ +@USE_WAYLAND_TRUE@am_libgstvaapi_wayland_la_rpath = +libgstvaapi_x11_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am__objects_6 = libgstvaapi_x11_la-gstvaapidisplay_x11.lo \ + libgstvaapi_x11_la-gstvaapipixmap_x11.lo \ + libgstvaapi_x11_la-gstvaapiutils_x11.lo \ + libgstvaapi_x11_la-gstvaapiwindow_x11.lo +am_libgstvaapi_x11_la_OBJECTS = $(am__objects_6) $(am__objects_2) \ + $(am__objects_2) +libgstvaapi_x11_la_OBJECTS = $(am_libgstvaapi_x11_la_OBJECTS) +libgstvaapi_x11_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(libgstvaapi_x11_la_CFLAGS) $(CFLAGS) \ + $(libgstvaapi_x11_la_LDFLAGS) $(LDFLAGS) -o $@ +@USE_X11_TRUE@am_libgstvaapi_x11_la_rpath = +am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) \ + $(top_builddir)/gst-libs/gst/base/libgstvaapi-baseutils.la +libgstvaapi_la_DEPENDENCIES = $(am__DEPENDENCIES_2) +am__libgstvaapi_la_SOURCES_DIST = gstvaapibufferproxy.c \ + gstvaapicodec_objects.c gstvaapicontext.c \ + gstvaapicontext_overlay.c gstvaapidecoder.c \ gstvaapidecoder_dpb.c gstvaapidecoder_h264.c \ gstvaapidecoder_mpeg2.c gstvaapidecoder_mpeg4.c \ gstvaapidecoder_objects.c gstvaapidecoder_unit.c \ @@ -187,225 +241,130 @@ gstvaapipixmap.c gstvaapiprofile.c gstvaapisubpicture.c \ gstvaapisurface.c gstvaapisurface_drm.c gstvaapisurfacepool.c \ gstvaapisurfaceproxy.c gstvaapitexture.c gstvaapiutils.c \ - gstvaapiutils_core.c gstvaapiutils_h264.c \ + gstvaapiutils_core.c gstvaapiutils_h264.c gstvaapiutils_h265.c \ gstvaapiutils_mpeg2.c gstvaapivalue.c gstvaapivideopool.c \ gstvaapiwindow.c video-format.c gstvaapidecoder_jpeg.c \ gstvaapidecoder_vp8.c gstvaapidecoder_h265.c \ - gstvaapiutils_h265.c gstvaapidecoder_vp9.c \ - gstvaapicodedbuffer.c gstvaapicodedbufferpool.c \ - gstvaapicodedbufferproxy.c gstvaapiencoder.c \ - gstvaapiencoder_h264.c gstvaapiencoder_mpeg2.c \ - gstvaapiencoder_objects.c gstvaapiencoder_jpeg.c \ - gstvaapiencoder_vp8.c gstvaapiencoder_h265.c glibcompat.h \ - gstvaapibufferproxy_priv.h gstvaapicodec_objects.h \ - gstvaapicompat.h gstvaapicontext.h gstvaapicontext_overlay.h \ - gstvaapidebug.h gstvaapidecoder_dpb.h \ - gstvaapidecoder_objects.h gstvaapidecoder_priv.h \ - gstvaapidecoder_unit.h gstvaapidisplay_priv.h \ - gstvaapidisplaycache.h gstvaapiimage_priv.h \ - gstvaapiminiobject.h gstvaapiobject_priv.h \ - gstvaapiparser_frame.h gstvaapipixmap_priv.h \ - gstvaapisurface_priv.h gstvaapisurfaceproxy_priv.h \ - gstvaapitexture_priv.h gstvaapiutils.h gstvaapiutils_core.h \ - gstvaapiutils_h264_priv.h gstvaapiutils_mpeg2_priv.h \ + gstvaapidecoder_vp9.c gstvaapicodedbuffer.c \ + gstvaapicodedbufferpool.c gstvaapicodedbufferproxy.c \ + gstvaapiencoder.c gstvaapiencoder_h264.c \ + gstvaapiencoder_mpeg2.c gstvaapiencoder_objects.c \ + gstvaapiencoder_jpeg.c gstvaapiencoder_vp8.c \ + gstvaapiencoder_h265.c glibcompat.h gstvaapibufferproxy_priv.h \ + gstvaapicodec_objects.h gstvaapicompat.h gstvaapicontext.h \ + gstvaapicontext_overlay.h gstvaapidebug.h \ + gstvaapidecoder_dpb.h gstvaapidecoder_objects.h \ + gstvaapidecoder_priv.h gstvaapidecoder_unit.h \ + gstvaapidisplay_priv.h gstvaapidisplaycache.h \ + gstvaapiimage_priv.h gstvaapiminiobject.h \ + gstvaapiobject_priv.h gstvaapiparser_frame.h \ + gstvaapipixmap_priv.h gstvaapisurface_priv.h \ + gstvaapisurfaceproxy_priv.h gstvaapitexture_priv.h \ + gstvaapiutils.h gstvaapiutils_core.h gstvaapiutils_h264_priv.h \ + gstvaapiutils_h265_priv.h gstvaapiutils_mpeg2_priv.h \ gstvaapiversion.h gstvaapivideopool_priv.h \ gstvaapiwindow_priv.h gstvaapiworkarounds.h \ - libgstvaapi_priv_check.h sysdeps.h gstvaapiutils_h265_priv.h \ - gstvaapicodedbuffer_priv.h gstvaapicodedbufferproxy_priv.h \ - gstvaapiencoder_mpeg2_priv.h gstvaapiencoder_objects.h \ - gstvaapiencoder_priv.h -am__objects_1 = \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_jpeg.lo -@USE_JPEG_DECODER_TRUE@am__objects_2 = $(am__objects_1) -am__objects_3 = \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vp8.lo -@USE_VP8_DECODER_TRUE@am__objects_4 = $(am__objects_3) -am__objects_5 = \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_h265.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_h265.lo -@USE_HEVC_DECODER_TRUE@am__objects_6 = $(am__objects_5) -am__objects_7 = \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vp9.lo -@USE_VP9_DECODER_TRUE@am__objects_8 = $(am__objects_7) -am__objects_9 = \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbuffer.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbufferpool.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbufferproxy.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_h264.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_mpeg2.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_objects.lo -@USE_ENCODERS_TRUE@am__objects_10 = $(am__objects_9) -am__objects_11 = \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_jpeg.lo -@USE_JPEG_ENCODER_TRUE@am__objects_12 = $(am__objects_11) -am__objects_13 = \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_vp8.lo -@USE_VP8_ENCODER_TRUE@am__objects_14 = $(am__objects_13) -am__objects_15 = \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_h265.lo -@USE_H265_ENCODER_TRUE@am__objects_16 = $(am__objects_15) -am__objects_17 = \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapibufferproxy.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapicodec_objects.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapicontext.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapicontext_overlay.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_dpb.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_h264.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_mpeg2.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_mpeg4.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_objects.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_unit.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vc1.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapidisplay.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapidisplaycache.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapifilter.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapiimage.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapiimagepool.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapiminiobject.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapiobject.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapiparser_frame.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapipixmap.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapiprofile.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapisubpicture.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapisurface.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapisurface_drm.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapisurfacepool.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapisurfaceproxy.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapitexture.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_core.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_h264.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_mpeg2.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapivalue.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapivideopool.lo \ - libgstvaapi_@GST_API_VERSION@_la-gstvaapiwindow.lo \ - libgstvaapi_@GST_API_VERSION@_la-video-format.lo \ - $(am__objects_2) $(am__objects_4) $(am__objects_6) \ - $(am__objects_8) $(am__objects_10) $(am__objects_12) \ - $(am__objects_14) $(am__objects_16) -am__objects_18 = -@USE_HEVC_DECODER_TRUE@am__objects_19 = $(am__objects_18) -@USE_ENCODERS_TRUE@am__objects_20 = $(am__objects_18) -am__objects_21 = $(am__objects_19) $(am__objects_20) -am_libgstvaapi_@GST_API_VERSION@_la_OBJECTS = $(am__objects_17) \ - $(am__objects_21) -libgstvaapi_@GST_API_VERSION@_la_OBJECTS = \ - $(am_libgstvaapi_@GST_API_VERSION@_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -libgstvaapi_@GST_API_VERSION@_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + libgstvaapi_priv_check.h sysdeps.h gstvaapicodedbuffer_priv.h \ + gstvaapicodedbufferproxy_priv.h gstvaapiencoder_mpeg2_priv.h \ + gstvaapiencoder_objects.h gstvaapiencoder_priv.h \ + gstvaapibufferproxy.h gstvaapidecoder.h gstvaapidecoder_h264.h \ + gstvaapidecoder_h265.h gstvaapidecoder_mpeg2.h \ + gstvaapidecoder_mpeg4.h gstvaapidecoder_vc1.h \ + gstvaapidisplay.h gstvaapifilter.h gstvaapiimage.h \ + gstvaapiimagepool.h gstvaapiobject.h gstvaapipixmap.h \ + gstvaapiprofile.h gstvaapisubpicture.h gstvaapisurface.h \ + gstvaapisurface_drm.h gstvaapisurfacepool.h \ + gstvaapisurfaceproxy.h gstvaapitexture.h gstvaapitypes.h \ + gstvaapiutils_h264.h gstvaapiutils_h265.h \ + gstvaapiutils_mpeg2.h gstvaapivalue.h gstvaapivideopool.h \ + gstvaapiwindow.h video-format.h gstvaapidecoder_jpeg.h \ + gstvaapidecoder_vp8.h gstvaapidecoder_vp9.h \ + gstvaapicodedbuffer.h gstvaapicodedbufferpool.h \ + gstvaapicodedbufferproxy.h gstvaapiencoder.h \ + gstvaapiencoder_h264.h gstvaapiencoder_mpeg2.h \ + gstvaapiencoder_jpeg.h gstvaapiencoder_vp8.h \ + gstvaapiencoder_h265.h +am__objects_7 = libgstvaapi_la-gstvaapidecoder_jpeg.lo +@USE_JPEG_DECODER_TRUE@am__objects_8 = $(am__objects_7) +am__objects_9 = libgstvaapi_la-gstvaapidecoder_vp8.lo +@USE_VP8_DECODER_TRUE@am__objects_10 = $(am__objects_9) +am__objects_11 = libgstvaapi_la-gstvaapidecoder_h265.lo +@USE_HEVC_DECODER_TRUE@am__objects_12 = $(am__objects_11) +am__objects_13 = libgstvaapi_la-gstvaapidecoder_vp9.lo +@USE_VP9_DECODER_TRUE@am__objects_14 = $(am__objects_13) +am__objects_15 = libgstvaapi_la-gstvaapicodedbuffer.lo \ + libgstvaapi_la-gstvaapicodedbufferpool.lo \ + libgstvaapi_la-gstvaapicodedbufferproxy.lo \ + libgstvaapi_la-gstvaapiencoder.lo \ + libgstvaapi_la-gstvaapiencoder_h264.lo \ + libgstvaapi_la-gstvaapiencoder_mpeg2.lo \ + libgstvaapi_la-gstvaapiencoder_objects.lo +@USE_ENCODERS_TRUE@am__objects_16 = $(am__objects_15) +am__objects_17 = libgstvaapi_la-gstvaapiencoder_jpeg.lo +@USE_JPEG_ENCODER_TRUE@am__objects_18 = $(am__objects_17) +am__objects_19 = libgstvaapi_la-gstvaapiencoder_vp8.lo +@USE_VP8_ENCODER_TRUE@am__objects_20 = $(am__objects_19) +am__objects_21 = libgstvaapi_la-gstvaapiencoder_h265.lo +@USE_H265_ENCODER_TRUE@am__objects_22 = $(am__objects_21) +am__objects_23 = libgstvaapi_la-gstvaapibufferproxy.lo \ + libgstvaapi_la-gstvaapicodec_objects.lo \ + libgstvaapi_la-gstvaapicontext.lo \ + libgstvaapi_la-gstvaapicontext_overlay.lo \ + libgstvaapi_la-gstvaapidecoder.lo \ + libgstvaapi_la-gstvaapidecoder_dpb.lo \ + libgstvaapi_la-gstvaapidecoder_h264.lo \ + libgstvaapi_la-gstvaapidecoder_mpeg2.lo \ + libgstvaapi_la-gstvaapidecoder_mpeg4.lo \ + libgstvaapi_la-gstvaapidecoder_objects.lo \ + libgstvaapi_la-gstvaapidecoder_unit.lo \ + libgstvaapi_la-gstvaapidecoder_vc1.lo \ + libgstvaapi_la-gstvaapidisplay.lo \ + libgstvaapi_la-gstvaapidisplaycache.lo \ + libgstvaapi_la-gstvaapifilter.lo \ + libgstvaapi_la-gstvaapiimage.lo \ + libgstvaapi_la-gstvaapiimagepool.lo \ + libgstvaapi_la-gstvaapiminiobject.lo \ + libgstvaapi_la-gstvaapiobject.lo \ + libgstvaapi_la-gstvaapiparser_frame.lo \ + libgstvaapi_la-gstvaapipixmap.lo \ + libgstvaapi_la-gstvaapiprofile.lo \ + libgstvaapi_la-gstvaapisubpicture.lo \ + libgstvaapi_la-gstvaapisurface.lo \ + libgstvaapi_la-gstvaapisurface_drm.lo \ + libgstvaapi_la-gstvaapisurfacepool.lo \ + libgstvaapi_la-gstvaapisurfaceproxy.lo \ + libgstvaapi_la-gstvaapitexture.lo \ + libgstvaapi_la-gstvaapiutils.lo \ + libgstvaapi_la-gstvaapiutils_core.lo \ + libgstvaapi_la-gstvaapiutils_h264.lo \ + libgstvaapi_la-gstvaapiutils_h265.lo \ + libgstvaapi_la-gstvaapiutils_mpeg2.lo \ + libgstvaapi_la-gstvaapivalue.lo \ + libgstvaapi_la-gstvaapivideopool.lo \ + libgstvaapi_la-gstvaapiwindow.lo \ + libgstvaapi_la-video-format.lo $(am__objects_8) \ + $(am__objects_10) $(am__objects_12) $(am__objects_14) \ + $(am__objects_16) $(am__objects_18) $(am__objects_20) \ + $(am__objects_22) +@USE_ENCODERS_TRUE@am__objects_24 = $(am__objects_2) +am__objects_25 = $(am__objects_24) +@USE_JPEG_DECODER_TRUE@am__objects_26 = $(am__objects_2) +@USE_VP8_DECODER_TRUE@am__objects_27 = $(am__objects_2) +@USE_HEVC_DECODER_TRUE@am__objects_28 = $(am__objects_2) +@USE_VP9_DECODER_TRUE@am__objects_29 = $(am__objects_2) +@USE_JPEG_ENCODER_TRUE@am__objects_30 = $(am__objects_2) +@USE_VP8_ENCODER_TRUE@am__objects_31 = $(am__objects_2) +@USE_H265_ENCODER_TRUE@am__objects_32 = $(am__objects_2) +am__objects_33 = $(am__objects_26) $(am__objects_27) $(am__objects_28) \ + $(am__objects_29) $(am__objects_24) $(am__objects_30) \ + $(am__objects_31) $(am__objects_32) +am_libgstvaapi_la_OBJECTS = $(am__objects_23) $(am__objects_25) \ + $(am__objects_33) +libgstvaapi_la_OBJECTS = $(am_libgstvaapi_la_OBJECTS) +libgstvaapi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) \ - $(libgstvaapi_@GST_API_VERSION@_la_LDFLAGS) $(LDFLAGS) -o $@ -libgstvaapi_drm_@GST_API_VERSION@_la_DEPENDENCIES = \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) libgstvaapi-$(GST_API_VERSION).la -am__objects_22 = \ - libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapidisplay_drm.lo \ - libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapiwindow_drm.lo \ - libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapiutils.lo -am_libgstvaapi_drm_@GST_API_VERSION@_la_OBJECTS = $(am__objects_22) \ - $(am__objects_18) -libgstvaapi_drm_@GST_API_VERSION@_la_OBJECTS = \ - $(am_libgstvaapi_drm_@GST_API_VERSION@_la_OBJECTS) -libgstvaapi_drm_@GST_API_VERSION@_la_LINK = $(LIBTOOL) $(AM_V_lt) \ - --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ - $(CCLD) $(libgstvaapi_drm_@GST_API_VERSION@_la_CFLAGS) \ - $(CFLAGS) $(libgstvaapi_drm_@GST_API_VERSION@_la_LDFLAGS) \ + $(libgstvaapi_la_CFLAGS) $(CFLAGS) $(libgstvaapi_la_LDFLAGS) \ $(LDFLAGS) -o $@ -@USE_DRM_TRUE@am_libgstvaapi_drm_@GST_API_VERSION@_la_rpath = -rpath \ -@USE_DRM_TRUE@ $(libdir) -libgstvaapi_egl_@GST_API_VERSION@_la_DEPENDENCIES = \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) libgstvaapi-$(GST_API_VERSION).la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) -am__objects_23 = \ - libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapidisplay_egl.lo \ - libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapisurface_egl.lo \ - libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapitexture_egl.lo \ - libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapiutils_egl.lo \ - libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapiwindow_egl.lo -am_libgstvaapi_egl_@GST_API_VERSION@_la_OBJECTS = $(am__objects_23) \ - $(am__objects_18) -libgstvaapi_egl_@GST_API_VERSION@_la_OBJECTS = \ - $(am_libgstvaapi_egl_@GST_API_VERSION@_la_OBJECTS) -libgstvaapi_egl_@GST_API_VERSION@_la_LINK = $(LIBTOOL) $(AM_V_lt) \ - --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ - $(CCLD) $(libgstvaapi_egl_@GST_API_VERSION@_la_CFLAGS) \ - $(CFLAGS) $(libgstvaapi_egl_@GST_API_VERSION@_la_LDFLAGS) \ - $(LDFLAGS) -o $@ -@USE_EGL_TRUE@am_libgstvaapi_egl_@GST_API_VERSION@_la_rpath = -rpath \ -@USE_EGL_TRUE@ $(libdir) -libgstvaapi_glx_@GST_API_VERSION@_la_DEPENDENCIES = \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) libgstvaapi-x11-$(GST_API_VERSION).la \ - libgstvaapi-$(GST_API_VERSION).la $(am__DEPENDENCIES_1) -am__objects_24 = \ - libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapidisplay_glx.lo \ - libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapitexture_glx.lo \ - libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils.lo \ - libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils_glx.lo \ - libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils_x11.lo \ - libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiwindow_glx.lo -am_libgstvaapi_glx_@GST_API_VERSION@_la_OBJECTS = $(am__objects_24) \ - $(am__objects_18) -libgstvaapi_glx_@GST_API_VERSION@_la_OBJECTS = \ - $(am_libgstvaapi_glx_@GST_API_VERSION@_la_OBJECTS) -libgstvaapi_glx_@GST_API_VERSION@_la_LINK = $(LIBTOOL) $(AM_V_lt) \ - --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ - $(CCLD) $(libgstvaapi_glx_@GST_API_VERSION@_la_CFLAGS) \ - $(CFLAGS) $(libgstvaapi_glx_@GST_API_VERSION@_la_LDFLAGS) \ - $(LDFLAGS) -o $@ -@USE_GLX_TRUE@am_libgstvaapi_glx_@GST_API_VERSION@_la_rpath = -rpath \ -@USE_GLX_TRUE@ $(libdir) -libgstvaapi_wayland_@GST_API_VERSION@_la_DEPENDENCIES = \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) libgstvaapi-$(GST_API_VERSION).la -am__objects_25 = libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapidisplay_wayland.lo \ - libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapiutils.lo \ - libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapiwindow_wayland.lo -am_libgstvaapi_wayland_@GST_API_VERSION@_la_OBJECTS = \ - $(am__objects_25) $(am__objects_18) -libgstvaapi_wayland_@GST_API_VERSION@_la_OBJECTS = \ - $(am_libgstvaapi_wayland_@GST_API_VERSION@_la_OBJECTS) -libgstvaapi_wayland_@GST_API_VERSION@_la_LINK = $(LIBTOOL) $(AM_V_lt) \ - --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ - $(CCLD) $(libgstvaapi_wayland_@GST_API_VERSION@_la_CFLAGS) \ - $(CFLAGS) $(libgstvaapi_wayland_@GST_API_VERSION@_la_LDFLAGS) \ - $(LDFLAGS) -o $@ -@USE_WAYLAND_TRUE@am_libgstvaapi_wayland_@GST_API_VERSION@_la_rpath = \ -@USE_WAYLAND_TRUE@ -rpath $(libdir) -libgstvaapi_x11_@GST_API_VERSION@_la_DEPENDENCIES = \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - libgstvaapi-$(GST_API_VERSION).la -am__objects_26 = \ - libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapidisplay_x11.lo \ - libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapipixmap_x11.lo \ - libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiutils.lo \ - libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiutils_x11.lo \ - libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiwindow_x11.lo -am_libgstvaapi_x11_@GST_API_VERSION@_la_OBJECTS = $(am__objects_26) \ - $(am__objects_18) -libgstvaapi_x11_@GST_API_VERSION@_la_OBJECTS = \ - $(am_libgstvaapi_x11_@GST_API_VERSION@_la_OBJECTS) -libgstvaapi_x11_@GST_API_VERSION@_la_LINK = $(LIBTOOL) $(AM_V_lt) \ - --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ - $(CCLD) $(libgstvaapi_x11_@GST_API_VERSION@_la_CFLAGS) \ - $(CFLAGS) $(libgstvaapi_x11_@GST_API_VERSION@_la_LDFLAGS) \ - $(LDFLAGS) -o $@ -@USE_X11_TRUE@am_libgstvaapi_x11_@GST_API_VERSION@_la_rpath = -rpath \ -@USE_X11_TRUE@ $(libdir) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -440,55 +399,48 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libgstvaapi_@GST_API_VERSION@_la_SOURCES) \ - $(libgstvaapi_drm_@GST_API_VERSION@_la_SOURCES) \ - $(libgstvaapi_egl_@GST_API_VERSION@_la_SOURCES) \ - $(libgstvaapi_glx_@GST_API_VERSION@_la_SOURCES) \ - $(libgstvaapi_wayland_@GST_API_VERSION@_la_SOURCES) \ - $(libgstvaapi_x11_@GST_API_VERSION@_la_SOURCES) -DIST_SOURCES = $(am__libgstvaapi_@GST_API_VERSION@_la_SOURCES_DIST) \ - $(libgstvaapi_drm_@GST_API_VERSION@_la_SOURCES) \ - $(libgstvaapi_egl_@GST_API_VERSION@_la_SOURCES) \ - $(libgstvaapi_glx_@GST_API_VERSION@_la_SOURCES) \ - $(libgstvaapi_wayland_@GST_API_VERSION@_la_SOURCES) \ - $(libgstvaapi_x11_@GST_API_VERSION@_la_SOURCES) +SOURCES = $(libgstvaapi_drm_la_SOURCES) $(libgstvaapi_egl_la_SOURCES) \ + $(libgstvaapi_glx_la_SOURCES) \ + $(libgstvaapi_wayland_la_SOURCES) \ + $(libgstvaapi_x11_la_SOURCES) $(libgstvaapi_la_SOURCES) +DIST_SOURCES = $(libgstvaapi_drm_la_SOURCES) \ + $(libgstvaapi_egl_la_SOURCES) $(libgstvaapi_glx_la_SOURCES) \ + $(libgstvaapi_wayland_la_SOURCES) \ + $(libgstvaapi_x11_la_SOURCES) \ + $(am__libgstvaapi_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac -am__libgstvaapi_@GST_API_VERSION@include_HEADERS_DIST = \ - gstvaapibufferproxy.h gstvaapidecoder.h gstvaapidecoder_h264.h \ - gstvaapidecoder_h265.h gstvaapidecoder_mpeg2.h \ - gstvaapidecoder_mpeg4.h gstvaapidecoder_vc1.h \ - gstvaapidisplay.h gstvaapifilter.h gstvaapiimage.h \ - gstvaapiimagepool.h gstvaapiobject.h gstvaapipixmap.h \ - gstvaapiprofile.h gstvaapisubpicture.h gstvaapisurface.h \ - gstvaapisurface_drm.h gstvaapisurfacepool.h \ - gstvaapisurfaceproxy.h gstvaapitexture.h gstvaapitypes.h \ - gstvaapiutils_h264.h gstvaapiutils_mpeg2.h gstvaapivalue.h \ - gstvaapivideopool.h gstvaapiwindow.h video-format.h \ - gstvaapidecoder_jpeg.h gstvaapidecoder_vp8.h \ - gstvaapiutils_h265.h gstvaapidecoder_vp9.h \ - gstvaapicodedbuffer.h gstvaapicodedbufferpool.h \ - gstvaapicodedbufferproxy.h gstvaapiencoder.h \ - gstvaapiencoder_h264.h gstvaapiencoder_mpeg2.h \ - gstvaapiencoder_jpeg.h gstvaapiencoder_vp8.h \ - gstvaapiencoder_h265.h -HEADERS = $(libgstvaapi_@GST_API_VERSION@include_HEADERS) \ - $(libgstvaapi_drm_@GST_API_VERSION@include_HEADERS) \ - $(libgstvaapi_egl_@GST_API_VERSION@include_HEADERS) \ - $(libgstvaapi_glx_@GST_API_VERSION@include_HEADERS) \ - $(libgstvaapi_wayland_@GST_API_VERSION@include_HEADERS) \ - $(libgstvaapi_x11_@GST_API_VERSION@include_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ +AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -501,6 +453,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DRM_CFLAGS = @DRM_CFLAGS@ @@ -513,58 +466,64 @@ EGL_CFLAGS = @EGL_CFLAGS@ EGL_LIBS = @EGL_LIBS@ EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ GIT = @GIT@ GLES2_CFLAGS = @GLES2_CFLAGS@ GLES2_LIBS = @GLES2_LIBS@ GLES3_CFLAGS = @GLES3_CFLAGS@ GLES3_LIBS = @GLES3_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ -GLIB_VERSION_REQUIRED = @GLIB_VERSION_REQUIRED@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ -GMODULE_VERSION_REQUIRED = @GMODULE_VERSION_REQUIRED@ GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ GST_API_VERSION = @GST_API_VERSION@ -GST_BASEVIDEO_CFLAGS = @GST_BASEVIDEO_CFLAGS@ -GST_BASEVIDEO_LIBS = @GST_BASEVIDEO_LIBS@ GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ GST_BASE_LIBS = @GST_BASE_LIBS@ GST_CFLAGS = @GST_CFLAGS@ GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ +GST_CURRENT = @GST_CURRENT@ GST_GL_CFLAGS = @GST_GL_CFLAGS@ GST_GL_LIBS = @GST_GL_LIBS@ -GST_INTERFACES_CFLAGS = @GST_INTERFACES_CFLAGS@ -GST_INTERFACES_LIBS = @GST_INTERFACES_LIBS@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ GST_LIBS = @GST_LIBS@ -GST_PKG_VERSION = @GST_PKG_VERSION@ -GST_PLUGINS_BAD_VERSION_REQUIRED = @GST_PLUGINS_BAD_VERSION_REQUIRED@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PBUTILS_CFLAGS = @GST_PBUTILS_CFLAGS@ +GST_PBUTILS_LIBS = @GST_PBUTILS_LIBS@ GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ -GST_PLUGINS_BASE_VERSION_REQUIRED = @GST_PLUGINS_BASE_VERSION_REQUIRED@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ -GST_PLUGIN_PATH_1_0 = @GST_PLUGIN_PATH_1_0@ -GST_VAAPI_LT_LDFLAGS = @GST_VAAPI_LT_LDFLAGS@ -GST_VAAPI_LT_VERSION = @GST_VAAPI_LT_VERSION@ -GST_VAAPI_MAJOR_VERSION = @GST_VAAPI_MAJOR_VERSION@ -GST_VERSION_REQUIRED = @GST_VERSION_REQUIRED@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ -GTKDOC_VERSION = @GTKDOC_VERSION@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -573,6 +532,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -580,16 +540,15 @@ LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ LIBVA_LIBS = @LIBVA_LIBS@ -LIBVA_PACKAGE_VERSION = @LIBVA_PACKAGE_VERSION@ -LIBVA_PKGNAME = @LIBVA_PKGNAME@ LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ -LIBVA_X11_PKGNAME = @LIBVA_X11_PKGNAME@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -606,21 +565,27 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ -PATCH = @PATCH@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ -TODAY = @TODAY@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ VERSION = @VERSION@ -WAYLAND_API_VERSION = @WAYLAND_API_VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ WAYLAND_LIBS = @WAYLAND_LIBS@ X11_CFLAGS = @X11_CFLAGS@ @@ -629,7 +594,6 @@ XRANDR_LIBS = @XRANDR_LIBS@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ -YASM = @YASM@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -671,11 +635,15 @@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ plugindir = @plugindir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -688,12 +656,8 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -lib_LTLIBRARIES = libgstvaapi-@GST_API_VERSION@.la $(am__append_1) \ - $(am__append_2) $(am__append_3) $(am__append_4) \ - $(am__append_5) -libgstvaapi_includedir = \ - $(includedir)/gstreamer-$(GST_PKG_VERSION)/gst/vaapi - +noinst_LTLIBRARIES = libgstvaapi.la $(am__append_1) $(am__append_2) \ + $(am__append_3) $(am__append_4) $(am__append_5) libgstvaapi_cflags = \ -DIN_LIBGSTVAAPI \ -DIN_LIBGSTVAAPI_CORE \ @@ -716,7 +680,7 @@ $(GST_CODEC_PARSERS_LIBS) \ $(LIBVA_LIBS) \ $(top_builddir)/gst-libs/gst/base/libgstvaapi-baseutils.la \ - $(top_builddir)/gst-libs/gst/codecparsers/libgstvaapi-codecparsers.la + $(NULL) libgstvaapi_source_c = gstvaapibufferproxy.c gstvaapicodec_objects.c \ gstvaapicontext.c gstvaapicontext_overlay.c gstvaapidecoder.c \ @@ -729,12 +693,12 @@ gstvaapipixmap.c gstvaapiprofile.c gstvaapisubpicture.c \ gstvaapisurface.c gstvaapisurface_drm.c gstvaapisurfacepool.c \ gstvaapisurfaceproxy.c gstvaapitexture.c gstvaapiutils.c \ - gstvaapiutils_core.c gstvaapiutils_h264.c \ + gstvaapiutils_core.c gstvaapiutils_h264.c gstvaapiutils_h265.c \ gstvaapiutils_mpeg2.c gstvaapivalue.c gstvaapivideopool.c \ gstvaapiwindow.c video-format.c $(NULL) $(am__append_6) \ - $(am__append_8) $(am__append_10) $(am__append_13) \ - $(am__append_15) $(am__append_18) $(am__append_20) \ - $(am__append_22) + $(am__append_8) $(am__append_10) $(am__append_12) \ + $(am__append_14) $(am__append_17) $(am__append_19) \ + $(am__append_21) libgstvaapi_source_h = gstvaapibufferproxy.h gstvaapidecoder.h \ gstvaapidecoder_h264.h gstvaapidecoder_h265.h \ gstvaapidecoder_mpeg2.h gstvaapidecoder_mpeg4.h \ @@ -743,11 +707,12 @@ gstvaapipixmap.h gstvaapiprofile.h gstvaapisubpicture.h \ gstvaapisurface.h gstvaapisurface_drm.h gstvaapisurfacepool.h \ gstvaapisurfaceproxy.h gstvaapitexture.h gstvaapitypes.h \ - gstvaapiutils_h264.h gstvaapiutils_mpeg2.h gstvaapivalue.h \ - gstvaapivideopool.h gstvaapiwindow.h video-format.h $(NULL) \ - $(am__append_7) $(am__append_9) $(am__append_11) \ - $(am__append_14) $(am__append_16) $(am__append_19) \ - $(am__append_21) $(am__append_23) + gstvaapiutils_h264.h gstvaapiutils_h265.h \ + gstvaapiutils_mpeg2.h gstvaapivalue.h gstvaapivideopool.h \ + gstvaapiwindow.h video-format.h $(NULL) $(am__append_7) \ + $(am__append_9) $(am__append_11) $(am__append_13) \ + $(am__append_15) $(am__append_18) $(am__append_20) \ + $(am__append_22) libgstvaapi_source_priv_h = glibcompat.h gstvaapibufferproxy_priv.h \ gstvaapicodec_objects.h gstvaapicompat.h gstvaapicontext.h \ gstvaapicontext_overlay.h gstvaapidebug.h \ @@ -759,20 +724,16 @@ gstvaapipixmap_priv.h gstvaapisurface_priv.h \ gstvaapisurfaceproxy_priv.h gstvaapitexture_priv.h \ gstvaapiutils.h gstvaapiutils_core.h gstvaapiutils_h264_priv.h \ - gstvaapiutils_mpeg2_priv.h gstvaapiversion.h \ - gstvaapivideopool_priv.h gstvaapiwindow_priv.h \ - gstvaapiworkarounds.h libgstvaapi_priv_check.h sysdeps.h \ - $(NULL) $(am__append_12) $(am__append_17) + gstvaapiutils_h265_priv.h gstvaapiutils_mpeg2_priv.h \ + gstvaapiversion.h gstvaapivideopool_priv.h \ + gstvaapiwindow_priv.h gstvaapiworkarounds.h \ + libgstvaapi_priv_check.h sysdeps.h $(NULL) $(am__append_16) libgstvaapi_jpegdec_source_c = gstvaapidecoder_jpeg.c libgstvaapi_jpegdec_source_h = gstvaapidecoder_jpeg.h libgstvaapi_vp8dec_source_c = gstvaapidecoder_vp8.c libgstvaapi_vp8dec_source_h = gstvaapidecoder_vp8.h -libgstvaapi_hevcdec_source_c = \ - gstvaapidecoder_h265.c \ - gstvaapiutils_h265.c - -libgstvaapi_hevcdec_source_h = gstvaapiutils_h265.h -libgstvaapi_hevcdec_source_priv_h = gstvaapiutils_h265_priv.h +libgstvaapi_hevcdec_source_c = gstvaapidecoder_h265.c +libgstvaapi_hevcdec_source_h = gstvaapidecoder_h265.h libgstvaapi_vp9dec_source_c = gstvaapidecoder_vp9.c libgstvaapi_vp9dec_source_h = gstvaapidecoder_vp9.h libgstvaapi_enc_source_c = \ @@ -811,7 +772,6 @@ libgstvaapi_drm_source_c = \ gstvaapidisplay_drm.c \ gstvaapiwindow_drm.c \ - gstvaapiutils.c \ $(NULL) libgstvaapi_drm_source_h = \ @@ -822,13 +782,11 @@ libgstvaapi_drm_source_priv_h = \ gstvaapicompat.h \ gstvaapidisplay_drm_priv.h \ - gstvaapiutils.h \ $(NULL) libgstvaapi_x11_source_c = \ gstvaapidisplay_x11.c \ gstvaapipixmap_x11.c \ - gstvaapiutils.c \ gstvaapiutils_x11.c \ gstvaapiwindow_x11.c \ $(NULL) @@ -842,7 +800,6 @@ libgstvaapi_x11_source_priv_h = \ gstvaapicompat.h \ gstvaapidisplay_x11_priv.h \ - gstvaapiutils.h \ gstvaapiutils_x11.h \ gstvaapiwindow_x11_priv.h \ $(NULL) @@ -850,9 +807,7 @@ libgstvaapi_glx_source_c = \ gstvaapidisplay_glx.c \ gstvaapitexture_glx.c \ - gstvaapiutils.c \ gstvaapiutils_glx.c \ - gstvaapiutils_x11.c \ gstvaapiwindow_glx.c \ $(NULL) @@ -868,7 +823,6 @@ gstvaapidisplay_glx_priv.h \ gstvaapiutils.h \ gstvaapiutils_glx.h \ - gstvaapiutils_x11.h \ $(NULL) libgstvaapi_egl_source_c = \ @@ -896,7 +850,6 @@ libgstvaapi_wayland_source_c = \ gstvaapidisplay_wayland.c \ - gstvaapiutils.c \ gstvaapiwindow_wayland.c \ $(NULL) @@ -908,48 +861,33 @@ libgstvaapi_wayland_source_priv_h = \ gstvaapicompat.h \ gstvaapidisplay_wayland_priv.h \ - gstvaapiutils.h \ $(NULL) -libgstvaapi_@GST_API_VERSION@_la_SOURCES = \ +libgstvaapi_la_SOURCES = \ $(libgstvaapi_source_c) \ $(libgstvaapi_source_priv_h) \ - $(NULL) - -libgstvaapi_@GST_API_VERSION@include_HEADERS = \ $(libgstvaapi_source_h) \ $(NULL) -libgstvaapi_@GST_API_VERSION@includedir = \ - $(libgstvaapi_includedir) - -libgstvaapi_@GST_API_VERSION@_la_CFLAGS = \ +libgstvaapi_la_CFLAGS = \ $(libgstvaapi_cflags) \ $(NULL) -libgstvaapi_@GST_API_VERSION@_la_LIBADD = \ +libgstvaapi_la_LIBADD = \ $(libgstvaapi_libs) \ $(NULL) -libgstvaapi_@GST_API_VERSION@_la_LDFLAGS = \ +libgstvaapi_la_LDFLAGS = \ $(GST_ALL_LDFLAGS) \ - $(GST_VAAPI_LT_LDFLAGS) \ - -export-symbols-regex "^gst_.*vaapi.*" \ $(NULL) -libgstvaapi_drm_@GST_API_VERSION@_la_SOURCES = \ +libgstvaapi_drm_la_SOURCES = \ $(libgstvaapi_drm_source_c) \ $(libgstvaapi_drm_source_priv_h) \ - $(NULL) - -libgstvaapi_drm_@GST_API_VERSION@include_HEADERS = \ $(libgstvaapi_drm_source_h) \ $(NULL) -libgstvaapi_drm_@GST_API_VERSION@includedir = \ - $(libgstvaapi_includedir) - -libgstvaapi_drm_@GST_API_VERSION@_la_CFLAGS = \ +libgstvaapi_drm_la_CFLAGS = \ -DIN_LIBGSTVAAPI \ -DGST_USE_UNSTABLE_API \ -I$(top_srcdir)/gst-libs \ @@ -961,33 +899,25 @@ $(LIBVA_DRM_CFLAGS) \ $(NULL) -libgstvaapi_drm_@GST_API_VERSION@_la_LIBADD = \ +libgstvaapi_drm_la_LIBADD = \ $(GLIB_LIBS) \ $(GST_LIBS) \ $(UDEV_LIBS) \ $(DRM_LIBS) \ $(LIBVA_DRM_LIBS) \ - libgstvaapi-$(GST_API_VERSION).la \ $(NULL) -libgstvaapi_drm_@GST_API_VERSION@_la_LDFLAGS = \ +libgstvaapi_drm_la_LDFLAGS = \ $(GST_ALL_LDFLAGS) \ - $(GST_VAAPI_LT_LDFLAGS) \ $(NULL) -libgstvaapi_x11_@GST_API_VERSION@_la_SOURCES = \ +libgstvaapi_x11_la_SOURCES = \ $(libgstvaapi_x11_source_c) \ $(libgstvaapi_x11_source_priv_h) \ - $(NULL) - -libgstvaapi_x11_@GST_API_VERSION@include_HEADERS = \ $(libgstvaapi_x11_source_h) \ $(NULL) -libgstvaapi_x11_@GST_API_VERSION@includedir = \ - $(libgstvaapi_includedir) - -libgstvaapi_x11_@GST_API_VERSION@_la_CFLAGS = \ +libgstvaapi_x11_la_CFLAGS = \ -DIN_LIBGSTVAAPI \ -DGST_USE_UNSTABLE_API \ -I$(top_srcdir)/gst-libs \ @@ -1000,34 +930,26 @@ $(LIBVA_X11_CFLAGS) \ $(NULL) -libgstvaapi_x11_@GST_API_VERSION@_la_LIBADD = \ +libgstvaapi_x11_la_LIBADD = \ $(GLIB_LIBS) \ $(GST_LIBS) \ $(X11_LIBS) \ $(XRANDR_LIBS) \ $(XRENDER_LIBS) \ $(LIBVA_X11_LIBS) \ - libgstvaapi-$(GST_API_VERSION).la \ $(NULL) -libgstvaapi_x11_@GST_API_VERSION@_la_LDFLAGS = \ +libgstvaapi_x11_la_LDFLAGS = \ $(GST_ALL_LDFLAGS) \ - $(GST_VAAPI_LT_LDFLAGS) \ $(NULL) -libgstvaapi_glx_@GST_API_VERSION@_la_SOURCES = \ +libgstvaapi_glx_la_SOURCES = \ $(libgstvaapi_glx_source_c) \ $(libgstvaapi_glx_source_priv_h) \ - $(NULL) - -libgstvaapi_glx_@GST_API_VERSION@include_HEADERS = \ $(libgstvaapi_glx_source_h) \ $(NULL) -libgstvaapi_glx_@GST_API_VERSION@includedir = \ - $(libgstvaapi_includedir) - -libgstvaapi_glx_@GST_API_VERSION@_la_CFLAGS = \ +libgstvaapi_glx_la_CFLAGS = \ -DIN_LIBGSTVAAPI \ -DGST_USE_UNSTABLE_API \ -I$(top_srcdir)/gst-libs \ @@ -1038,7 +960,7 @@ $(LIBVA_X11_CFLAGS) \ $(NULL) -libgstvaapi_glx_@GST_API_VERSION@_la_LIBADD = \ +libgstvaapi_glx_la_LIBADD = \ $(GLIB_LIBS) \ $(GST_LIBS) \ $(GST_BASE_LIBS) \ @@ -1046,29 +968,20 @@ $(X11_LIBS) \ $(GL_LIBS) \ $(LIBVA_X11_LIBS) \ - libgstvaapi-x11-$(GST_API_VERSION).la \ - libgstvaapi-$(GST_API_VERSION).la \ $(DLOPEN_LIBS) \ $(NULL) -libgstvaapi_glx_@GST_API_VERSION@_la_LDFLAGS = \ +libgstvaapi_glx_la_LDFLAGS = \ $(GST_ALL_LDFLAGS) \ - $(GST_VAAPI_LT_LDFLAGS) \ $(NULL) -libgstvaapi_egl_@GST_API_VERSION@_la_SOURCES = \ +libgstvaapi_egl_la_SOURCES = \ $(libgstvaapi_egl_source_c) \ $(libgstvaapi_egl_source_priv_h) \ - $(NULL) - -libgstvaapi_egl_@GST_API_VERSION@include_HEADERS = \ $(libgstvaapi_egl_source_h) \ $(NULL) -libgstvaapi_egl_@GST_API_VERSION@includedir = \ - $(libgstvaapi_includedir) - -libgstvaapi_egl_@GST_API_VERSION@_la_CFLAGS = \ +libgstvaapi_egl_la_CFLAGS = \ -DIN_LIBGSTVAAPI \ -DGST_USE_UNSTABLE_API \ -I$(top_srcdir)/gst-libs \ @@ -1080,35 +993,27 @@ $(EGL_CFLAGS) \ $(NULL) -libgstvaapi_egl_@GST_API_VERSION@_la_LIBADD = \ +libgstvaapi_egl_la_LIBADD = \ $(GLIB_LIBS) \ $(GMODULE_LIBS) \ $(GST_LIBS) \ $(GST_BASE_LIBS) \ $(GST_VIDEO_LIBS) \ - libgstvaapi-$(GST_API_VERSION).la \ $(EGL_LIBS) \ $(DLOPEN_LIBS) \ $(NULL) -libgstvaapi_egl_@GST_API_VERSION@_la_LDFLAGS = \ +libgstvaapi_egl_la_LDFLAGS = \ $(GST_ALL_LDFLAGS) \ - $(GST_VAAPI_LT_LDFLAGS) \ $(NULL) -libgstvaapi_wayland_@GST_API_VERSION@_la_SOURCES = \ +libgstvaapi_wayland_la_SOURCES = \ $(libgstvaapi_wayland_source_c) \ $(libgstvaapi_wayland_source_priv_h) \ - $(NULL) - -libgstvaapi_wayland_@GST_API_VERSION@include_HEADERS = \ $(libgstvaapi_wayland_source_h) \ $(NULL) -libgstvaapi_wayland_@GST_API_VERSION@includedir = \ - $(libgstvaapi_includedir) - -libgstvaapi_wayland_@GST_API_VERSION@_la_CFLAGS = \ +libgstvaapi_wayland_la_CFLAGS = \ -DIN_LIBGSTVAAPI \ -DGST_USE_UNSTABLE_API \ -I$(top_srcdir)/gst-libs \ @@ -1119,18 +1024,16 @@ $(LIBVA_WAYLAND_CFLAGS) \ $(NULL) -libgstvaapi_wayland_@GST_API_VERSION@_la_LIBADD = \ +libgstvaapi_wayland_la_LIBADD = \ $(GLIB_LIBS) \ $(GST_LIBS) \ $(GST_VIDEO_LIBS) \ $(WAYLAND_LIBS) \ $(LIBVA_WAYLAND_LIBS) \ - libgstvaapi-$(GST_API_VERSION).la \ $(NULL) -libgstvaapi_wayland_@GST_API_VERSION@_la_LDFLAGS = \ +libgstvaapi_wayland_la_LDFLAGS = \ $(GST_ALL_LDFLAGS) \ - $(GST_VAAPI_LT_LDFLAGS) \ $(NULL) VERSION_FILE = .VERSION @@ -1165,7 +1068,7 @@ .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -1189,39 +1092,15 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; \ +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ @@ -1230,23 +1109,23 @@ rm -f $${locs}; \ } -libgstvaapi-@GST_API_VERSION@.la: $(libgstvaapi_@GST_API_VERSION@_la_OBJECTS) $(libgstvaapi_@GST_API_VERSION@_la_DEPENDENCIES) $(EXTRA_libgstvaapi_@GST_API_VERSION@_la_DEPENDENCIES) - $(AM_V_CCLD)$(libgstvaapi_@GST_API_VERSION@_la_LINK) -rpath $(libdir) $(libgstvaapi_@GST_API_VERSION@_la_OBJECTS) $(libgstvaapi_@GST_API_VERSION@_la_LIBADD) $(LIBS) +libgstvaapi-drm.la: $(libgstvaapi_drm_la_OBJECTS) $(libgstvaapi_drm_la_DEPENDENCIES) $(EXTRA_libgstvaapi_drm_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgstvaapi_drm_la_LINK) $(am_libgstvaapi_drm_la_rpath) $(libgstvaapi_drm_la_OBJECTS) $(libgstvaapi_drm_la_LIBADD) $(LIBS) -libgstvaapi-drm-@GST_API_VERSION@.la: $(libgstvaapi_drm_@GST_API_VERSION@_la_OBJECTS) $(libgstvaapi_drm_@GST_API_VERSION@_la_DEPENDENCIES) $(EXTRA_libgstvaapi_drm_@GST_API_VERSION@_la_DEPENDENCIES) - $(AM_V_CCLD)$(libgstvaapi_drm_@GST_API_VERSION@_la_LINK) $(am_libgstvaapi_drm_@GST_API_VERSION@_la_rpath) $(libgstvaapi_drm_@GST_API_VERSION@_la_OBJECTS) $(libgstvaapi_drm_@GST_API_VERSION@_la_LIBADD) $(LIBS) +libgstvaapi-egl.la: $(libgstvaapi_egl_la_OBJECTS) $(libgstvaapi_egl_la_DEPENDENCIES) $(EXTRA_libgstvaapi_egl_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgstvaapi_egl_la_LINK) $(am_libgstvaapi_egl_la_rpath) $(libgstvaapi_egl_la_OBJECTS) $(libgstvaapi_egl_la_LIBADD) $(LIBS) -libgstvaapi-egl-@GST_API_VERSION@.la: $(libgstvaapi_egl_@GST_API_VERSION@_la_OBJECTS) $(libgstvaapi_egl_@GST_API_VERSION@_la_DEPENDENCIES) $(EXTRA_libgstvaapi_egl_@GST_API_VERSION@_la_DEPENDENCIES) - $(AM_V_CCLD)$(libgstvaapi_egl_@GST_API_VERSION@_la_LINK) $(am_libgstvaapi_egl_@GST_API_VERSION@_la_rpath) $(libgstvaapi_egl_@GST_API_VERSION@_la_OBJECTS) $(libgstvaapi_egl_@GST_API_VERSION@_la_LIBADD) $(LIBS) +libgstvaapi-glx.la: $(libgstvaapi_glx_la_OBJECTS) $(libgstvaapi_glx_la_DEPENDENCIES) $(EXTRA_libgstvaapi_glx_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgstvaapi_glx_la_LINK) $(am_libgstvaapi_glx_la_rpath) $(libgstvaapi_glx_la_OBJECTS) $(libgstvaapi_glx_la_LIBADD) $(LIBS) -libgstvaapi-glx-@GST_API_VERSION@.la: $(libgstvaapi_glx_@GST_API_VERSION@_la_OBJECTS) $(libgstvaapi_glx_@GST_API_VERSION@_la_DEPENDENCIES) $(EXTRA_libgstvaapi_glx_@GST_API_VERSION@_la_DEPENDENCIES) - $(AM_V_CCLD)$(libgstvaapi_glx_@GST_API_VERSION@_la_LINK) $(am_libgstvaapi_glx_@GST_API_VERSION@_la_rpath) $(libgstvaapi_glx_@GST_API_VERSION@_la_OBJECTS) $(libgstvaapi_glx_@GST_API_VERSION@_la_LIBADD) $(LIBS) +libgstvaapi-wayland.la: $(libgstvaapi_wayland_la_OBJECTS) $(libgstvaapi_wayland_la_DEPENDENCIES) $(EXTRA_libgstvaapi_wayland_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgstvaapi_wayland_la_LINK) $(am_libgstvaapi_wayland_la_rpath) $(libgstvaapi_wayland_la_OBJECTS) $(libgstvaapi_wayland_la_LIBADD) $(LIBS) -libgstvaapi-wayland-@GST_API_VERSION@.la: $(libgstvaapi_wayland_@GST_API_VERSION@_la_OBJECTS) $(libgstvaapi_wayland_@GST_API_VERSION@_la_DEPENDENCIES) $(EXTRA_libgstvaapi_wayland_@GST_API_VERSION@_la_DEPENDENCIES) - $(AM_V_CCLD)$(libgstvaapi_wayland_@GST_API_VERSION@_la_LINK) $(am_libgstvaapi_wayland_@GST_API_VERSION@_la_rpath) $(libgstvaapi_wayland_@GST_API_VERSION@_la_OBJECTS) $(libgstvaapi_wayland_@GST_API_VERSION@_la_LIBADD) $(LIBS) +libgstvaapi-x11.la: $(libgstvaapi_x11_la_OBJECTS) $(libgstvaapi_x11_la_DEPENDENCIES) $(EXTRA_libgstvaapi_x11_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgstvaapi_x11_la_LINK) $(am_libgstvaapi_x11_la_rpath) $(libgstvaapi_x11_la_OBJECTS) $(libgstvaapi_x11_la_LIBADD) $(LIBS) -libgstvaapi-x11-@GST_API_VERSION@.la: $(libgstvaapi_x11_@GST_API_VERSION@_la_OBJECTS) $(libgstvaapi_x11_@GST_API_VERSION@_la_DEPENDENCIES) $(EXTRA_libgstvaapi_x11_@GST_API_VERSION@_la_DEPENDENCIES) - $(AM_V_CCLD)$(libgstvaapi_x11_@GST_API_VERSION@_la_LINK) $(am_libgstvaapi_x11_@GST_API_VERSION@_la_rpath) $(libgstvaapi_x11_@GST_API_VERSION@_la_OBJECTS) $(libgstvaapi_x11_@GST_API_VERSION@_la_LIBADD) $(LIBS) +libgstvaapi.la: $(libgstvaapi_la_OBJECTS) $(libgstvaapi_la_DEPENDENCIES) $(EXTRA_libgstvaapi_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgstvaapi_la_LINK) $(libgstvaapi_la_OBJECTS) $(libgstvaapi_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -1254,749 +1133,632 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapibufferproxy.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicodec_objects.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbuffer.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbufferpool.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbufferproxy.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicontext.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicontext_overlay.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_dpb.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_h264.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_h265.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_jpeg.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_mpeg2.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_mpeg4.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_objects.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_unit.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vc1.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vp8.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vp9.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidisplay.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidisplaycache.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_h264.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_h265.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_jpeg.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_mpeg2.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_objects.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_vp8.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapifilter.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiimage.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiimagepool.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiminiobject.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiobject.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiparser_frame.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapipixmap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiprofile.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapisubpicture.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapisurface.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapisurface_drm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapisurfacepool.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapisurfaceproxy.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapitexture.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_core.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_h264.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_h265.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_mpeg2.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapivalue.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapivideopool.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiwindow.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-video-format.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapidisplay_drm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapiutils.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapiwindow_drm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapidisplay_egl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapisurface_egl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapitexture_egl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapiutils_egl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapiwindow_egl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapidisplay_glx.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapitexture_glx.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils_glx.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils_x11.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiwindow_glx.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapidisplay_wayland.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapiutils.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapiwindow_wayland.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapidisplay_x11.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapipixmap_x11.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiutils.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiutils_x11.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiwindow_x11.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_drm_la-gstvaapidisplay_drm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_drm_la-gstvaapiwindow_drm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_egl_la-gstvaapidisplay_egl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_egl_la-gstvaapisurface_egl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_egl_la-gstvaapitexture_egl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_egl_la-gstvaapiutils_egl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_egl_la-gstvaapiwindow_egl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_glx_la-gstvaapidisplay_glx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_glx_la-gstvaapitexture_glx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_glx_la-gstvaapiutils_glx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_glx_la-gstvaapiwindow_glx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapibufferproxy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapicodec_objects.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapicodedbuffer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapicodedbufferpool.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapicodedbufferproxy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapicontext.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapicontext_overlay.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapidecoder.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapidecoder_dpb.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapidecoder_h264.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapidecoder_h265.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapidecoder_jpeg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapidecoder_mpeg2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapidecoder_mpeg4.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapidecoder_objects.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapidecoder_unit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapidecoder_vc1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapidecoder_vp8.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapidecoder_vp9.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapidisplay.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapidisplaycache.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapiencoder.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapiencoder_h264.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapiencoder_h265.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapiencoder_jpeg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapiencoder_mpeg2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapiencoder_objects.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapiencoder_vp8.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapifilter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapiimage.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapiimagepool.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapiminiobject.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapiobject.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapiparser_frame.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapipixmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapiprofile.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapisubpicture.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapisurface.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapisurface_drm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapisurfacepool.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapisurfaceproxy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapitexture.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapiutils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapiutils_core.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapiutils_h264.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapiutils_h265.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapiutils_mpeg2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapivalue.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapivideopool.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-gstvaapiwindow.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_la-video-format.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_wayland_la-gstvaapidisplay_wayland.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_wayland_la-gstvaapiwindow_wayland.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_x11_la-gstvaapidisplay_x11.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_x11_la-gstvaapipixmap_x11.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_x11_la-gstvaapiutils_x11.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstvaapi_x11_la-gstvaapiwindow_x11.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< -libgstvaapi_@GST_API_VERSION@_la-gstvaapibufferproxy.lo: gstvaapibufferproxy.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapibufferproxy.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapibufferproxy.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapibufferproxy.lo `test -f 'gstvaapibufferproxy.c' || echo '$(srcdir)/'`gstvaapibufferproxy.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapibufferproxy.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapibufferproxy.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapibufferproxy.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapibufferproxy.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapibufferproxy.lo `test -f 'gstvaapibufferproxy.c' || echo '$(srcdir)/'`gstvaapibufferproxy.c - -libgstvaapi_@GST_API_VERSION@_la-gstvaapicodec_objects.lo: gstvaapicodec_objects.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapicodec_objects.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicodec_objects.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapicodec_objects.lo `test -f 'gstvaapicodec_objects.c' || echo '$(srcdir)/'`gstvaapicodec_objects.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicodec_objects.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicodec_objects.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapicodec_objects.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapicodec_objects.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_drm_la-gstvaapidisplay_drm.lo: gstvaapidisplay_drm.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_drm_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_drm_la-gstvaapidisplay_drm.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_drm_la-gstvaapidisplay_drm.Tpo -c -o libgstvaapi_drm_la-gstvaapidisplay_drm.lo `test -f 'gstvaapidisplay_drm.c' || echo '$(srcdir)/'`gstvaapidisplay_drm.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_drm_la-gstvaapidisplay_drm.Tpo $(DEPDIR)/libgstvaapi_drm_la-gstvaapidisplay_drm.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidisplay_drm.c' object='libgstvaapi_drm_la-gstvaapidisplay_drm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapicodec_objects.lo `test -f 'gstvaapicodec_objects.c' || echo '$(srcdir)/'`gstvaapicodec_objects.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_drm_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_drm_la-gstvaapidisplay_drm.lo `test -f 'gstvaapidisplay_drm.c' || echo '$(srcdir)/'`gstvaapidisplay_drm.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapicontext.lo: gstvaapicontext.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapicontext.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicontext.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapicontext.lo `test -f 'gstvaapicontext.c' || echo '$(srcdir)/'`gstvaapicontext.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicontext.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicontext.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapicontext.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapicontext.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_drm_la-gstvaapiwindow_drm.lo: gstvaapiwindow_drm.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_drm_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_drm_la-gstvaapiwindow_drm.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_drm_la-gstvaapiwindow_drm.Tpo -c -o libgstvaapi_drm_la-gstvaapiwindow_drm.lo `test -f 'gstvaapiwindow_drm.c' || echo '$(srcdir)/'`gstvaapiwindow_drm.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_drm_la-gstvaapiwindow_drm.Tpo $(DEPDIR)/libgstvaapi_drm_la-gstvaapiwindow_drm.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiwindow_drm.c' object='libgstvaapi_drm_la-gstvaapiwindow_drm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapicontext.lo `test -f 'gstvaapicontext.c' || echo '$(srcdir)/'`gstvaapicontext.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_drm_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_drm_la-gstvaapiwindow_drm.lo `test -f 'gstvaapiwindow_drm.c' || echo '$(srcdir)/'`gstvaapiwindow_drm.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapicontext_overlay.lo: gstvaapicontext_overlay.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapicontext_overlay.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicontext_overlay.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapicontext_overlay.lo `test -f 'gstvaapicontext_overlay.c' || echo '$(srcdir)/'`gstvaapicontext_overlay.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicontext_overlay.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicontext_overlay.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapicontext_overlay.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapicontext_overlay.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_egl_la-gstvaapidisplay_egl.lo: gstvaapidisplay_egl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_egl_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_egl_la-gstvaapidisplay_egl.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_egl_la-gstvaapidisplay_egl.Tpo -c -o libgstvaapi_egl_la-gstvaapidisplay_egl.lo `test -f 'gstvaapidisplay_egl.c' || echo '$(srcdir)/'`gstvaapidisplay_egl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_egl_la-gstvaapidisplay_egl.Tpo $(DEPDIR)/libgstvaapi_egl_la-gstvaapidisplay_egl.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidisplay_egl.c' object='libgstvaapi_egl_la-gstvaapidisplay_egl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapicontext_overlay.lo `test -f 'gstvaapicontext_overlay.c' || echo '$(srcdir)/'`gstvaapicontext_overlay.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_egl_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_egl_la-gstvaapidisplay_egl.lo `test -f 'gstvaapidisplay_egl.c' || echo '$(srcdir)/'`gstvaapidisplay_egl.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder.lo: gstvaapidecoder.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder.lo `test -f 'gstvaapidecoder.c' || echo '$(srcdir)/'`gstvaapidecoder.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_egl_la-gstvaapisurface_egl.lo: gstvaapisurface_egl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_egl_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_egl_la-gstvaapisurface_egl.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_egl_la-gstvaapisurface_egl.Tpo -c -o libgstvaapi_egl_la-gstvaapisurface_egl.lo `test -f 'gstvaapisurface_egl.c' || echo '$(srcdir)/'`gstvaapisurface_egl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_egl_la-gstvaapisurface_egl.Tpo $(DEPDIR)/libgstvaapi_egl_la-gstvaapisurface_egl.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapisurface_egl.c' object='libgstvaapi_egl_la-gstvaapisurface_egl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder.lo `test -f 'gstvaapidecoder.c' || echo '$(srcdir)/'`gstvaapidecoder.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_egl_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_egl_la-gstvaapisurface_egl.lo `test -f 'gstvaapisurface_egl.c' || echo '$(srcdir)/'`gstvaapisurface_egl.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_dpb.lo: gstvaapidecoder_dpb.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_dpb.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_dpb.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_dpb.lo `test -f 'gstvaapidecoder_dpb.c' || echo '$(srcdir)/'`gstvaapidecoder_dpb.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_dpb.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_dpb.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_dpb.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_dpb.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_egl_la-gstvaapitexture_egl.lo: gstvaapitexture_egl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_egl_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_egl_la-gstvaapitexture_egl.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_egl_la-gstvaapitexture_egl.Tpo -c -o libgstvaapi_egl_la-gstvaapitexture_egl.lo `test -f 'gstvaapitexture_egl.c' || echo '$(srcdir)/'`gstvaapitexture_egl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_egl_la-gstvaapitexture_egl.Tpo $(DEPDIR)/libgstvaapi_egl_la-gstvaapitexture_egl.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapitexture_egl.c' object='libgstvaapi_egl_la-gstvaapitexture_egl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_dpb.lo `test -f 'gstvaapidecoder_dpb.c' || echo '$(srcdir)/'`gstvaapidecoder_dpb.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_egl_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_egl_la-gstvaapitexture_egl.lo `test -f 'gstvaapitexture_egl.c' || echo '$(srcdir)/'`gstvaapitexture_egl.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_h264.lo: gstvaapidecoder_h264.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_h264.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_h264.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_h264.lo `test -f 'gstvaapidecoder_h264.c' || echo '$(srcdir)/'`gstvaapidecoder_h264.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_h264.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_h264.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_h264.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_h264.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_egl_la-gstvaapiutils_egl.lo: gstvaapiutils_egl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_egl_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_egl_la-gstvaapiutils_egl.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_egl_la-gstvaapiutils_egl.Tpo -c -o libgstvaapi_egl_la-gstvaapiutils_egl.lo `test -f 'gstvaapiutils_egl.c' || echo '$(srcdir)/'`gstvaapiutils_egl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_egl_la-gstvaapiutils_egl.Tpo $(DEPDIR)/libgstvaapi_egl_la-gstvaapiutils_egl.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiutils_egl.c' object='libgstvaapi_egl_la-gstvaapiutils_egl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_h264.lo `test -f 'gstvaapidecoder_h264.c' || echo '$(srcdir)/'`gstvaapidecoder_h264.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_egl_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_egl_la-gstvaapiutils_egl.lo `test -f 'gstvaapiutils_egl.c' || echo '$(srcdir)/'`gstvaapiutils_egl.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_mpeg2.lo: gstvaapidecoder_mpeg2.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_mpeg2.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_mpeg2.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_mpeg2.lo `test -f 'gstvaapidecoder_mpeg2.c' || echo '$(srcdir)/'`gstvaapidecoder_mpeg2.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_mpeg2.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_mpeg2.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_mpeg2.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_mpeg2.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_egl_la-gstvaapiwindow_egl.lo: gstvaapiwindow_egl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_egl_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_egl_la-gstvaapiwindow_egl.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_egl_la-gstvaapiwindow_egl.Tpo -c -o libgstvaapi_egl_la-gstvaapiwindow_egl.lo `test -f 'gstvaapiwindow_egl.c' || echo '$(srcdir)/'`gstvaapiwindow_egl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_egl_la-gstvaapiwindow_egl.Tpo $(DEPDIR)/libgstvaapi_egl_la-gstvaapiwindow_egl.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiwindow_egl.c' object='libgstvaapi_egl_la-gstvaapiwindow_egl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_mpeg2.lo `test -f 'gstvaapidecoder_mpeg2.c' || echo '$(srcdir)/'`gstvaapidecoder_mpeg2.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_egl_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_egl_la-gstvaapiwindow_egl.lo `test -f 'gstvaapiwindow_egl.c' || echo '$(srcdir)/'`gstvaapiwindow_egl.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_mpeg4.lo: gstvaapidecoder_mpeg4.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_mpeg4.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_mpeg4.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_mpeg4.lo `test -f 'gstvaapidecoder_mpeg4.c' || echo '$(srcdir)/'`gstvaapidecoder_mpeg4.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_mpeg4.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_mpeg4.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_mpeg4.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_mpeg4.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_glx_la-gstvaapidisplay_glx.lo: gstvaapidisplay_glx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_glx_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_glx_la-gstvaapidisplay_glx.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_glx_la-gstvaapidisplay_glx.Tpo -c -o libgstvaapi_glx_la-gstvaapidisplay_glx.lo `test -f 'gstvaapidisplay_glx.c' || echo '$(srcdir)/'`gstvaapidisplay_glx.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_glx_la-gstvaapidisplay_glx.Tpo $(DEPDIR)/libgstvaapi_glx_la-gstvaapidisplay_glx.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidisplay_glx.c' object='libgstvaapi_glx_la-gstvaapidisplay_glx.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_mpeg4.lo `test -f 'gstvaapidecoder_mpeg4.c' || echo '$(srcdir)/'`gstvaapidecoder_mpeg4.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_glx_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_glx_la-gstvaapidisplay_glx.lo `test -f 'gstvaapidisplay_glx.c' || echo '$(srcdir)/'`gstvaapidisplay_glx.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_objects.lo: gstvaapidecoder_objects.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_objects.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_objects.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_objects.lo `test -f 'gstvaapidecoder_objects.c' || echo '$(srcdir)/'`gstvaapidecoder_objects.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_objects.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_objects.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_objects.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_objects.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_glx_la-gstvaapitexture_glx.lo: gstvaapitexture_glx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_glx_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_glx_la-gstvaapitexture_glx.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_glx_la-gstvaapitexture_glx.Tpo -c -o libgstvaapi_glx_la-gstvaapitexture_glx.lo `test -f 'gstvaapitexture_glx.c' || echo '$(srcdir)/'`gstvaapitexture_glx.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_glx_la-gstvaapitexture_glx.Tpo $(DEPDIR)/libgstvaapi_glx_la-gstvaapitexture_glx.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapitexture_glx.c' object='libgstvaapi_glx_la-gstvaapitexture_glx.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_objects.lo `test -f 'gstvaapidecoder_objects.c' || echo '$(srcdir)/'`gstvaapidecoder_objects.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_glx_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_glx_la-gstvaapitexture_glx.lo `test -f 'gstvaapitexture_glx.c' || echo '$(srcdir)/'`gstvaapitexture_glx.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_unit.lo: gstvaapidecoder_unit.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_unit.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_unit.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_unit.lo `test -f 'gstvaapidecoder_unit.c' || echo '$(srcdir)/'`gstvaapidecoder_unit.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_unit.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_unit.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_unit.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_unit.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_glx_la-gstvaapiutils_glx.lo: gstvaapiutils_glx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_glx_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_glx_la-gstvaapiutils_glx.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_glx_la-gstvaapiutils_glx.Tpo -c -o libgstvaapi_glx_la-gstvaapiutils_glx.lo `test -f 'gstvaapiutils_glx.c' || echo '$(srcdir)/'`gstvaapiutils_glx.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_glx_la-gstvaapiutils_glx.Tpo $(DEPDIR)/libgstvaapi_glx_la-gstvaapiutils_glx.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiutils_glx.c' object='libgstvaapi_glx_la-gstvaapiutils_glx.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_unit.lo `test -f 'gstvaapidecoder_unit.c' || echo '$(srcdir)/'`gstvaapidecoder_unit.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_glx_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_glx_la-gstvaapiutils_glx.lo `test -f 'gstvaapiutils_glx.c' || echo '$(srcdir)/'`gstvaapiutils_glx.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vc1.lo: gstvaapidecoder_vc1.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vc1.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vc1.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vc1.lo `test -f 'gstvaapidecoder_vc1.c' || echo '$(srcdir)/'`gstvaapidecoder_vc1.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vc1.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vc1.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_vc1.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vc1.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_glx_la-gstvaapiwindow_glx.lo: gstvaapiwindow_glx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_glx_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_glx_la-gstvaapiwindow_glx.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_glx_la-gstvaapiwindow_glx.Tpo -c -o libgstvaapi_glx_la-gstvaapiwindow_glx.lo `test -f 'gstvaapiwindow_glx.c' || echo '$(srcdir)/'`gstvaapiwindow_glx.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_glx_la-gstvaapiwindow_glx.Tpo $(DEPDIR)/libgstvaapi_glx_la-gstvaapiwindow_glx.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiwindow_glx.c' object='libgstvaapi_glx_la-gstvaapiwindow_glx.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vc1.lo `test -f 'gstvaapidecoder_vc1.c' || echo '$(srcdir)/'`gstvaapidecoder_vc1.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_glx_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_glx_la-gstvaapiwindow_glx.lo `test -f 'gstvaapiwindow_glx.c' || echo '$(srcdir)/'`gstvaapiwindow_glx.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapidisplay.lo: gstvaapidisplay.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapidisplay.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidisplay.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidisplay.lo `test -f 'gstvaapidisplay.c' || echo '$(srcdir)/'`gstvaapidisplay.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidisplay.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidisplay.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidisplay.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapidisplay.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_wayland_la-gstvaapidisplay_wayland.lo: gstvaapidisplay_wayland.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_wayland_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_wayland_la-gstvaapidisplay_wayland.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_wayland_la-gstvaapidisplay_wayland.Tpo -c -o libgstvaapi_wayland_la-gstvaapidisplay_wayland.lo `test -f 'gstvaapidisplay_wayland.c' || echo '$(srcdir)/'`gstvaapidisplay_wayland.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_wayland_la-gstvaapidisplay_wayland.Tpo $(DEPDIR)/libgstvaapi_wayland_la-gstvaapidisplay_wayland.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidisplay_wayland.c' object='libgstvaapi_wayland_la-gstvaapidisplay_wayland.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidisplay.lo `test -f 'gstvaapidisplay.c' || echo '$(srcdir)/'`gstvaapidisplay.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_wayland_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_wayland_la-gstvaapidisplay_wayland.lo `test -f 'gstvaapidisplay_wayland.c' || echo '$(srcdir)/'`gstvaapidisplay_wayland.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapidisplaycache.lo: gstvaapidisplaycache.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapidisplaycache.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidisplaycache.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidisplaycache.lo `test -f 'gstvaapidisplaycache.c' || echo '$(srcdir)/'`gstvaapidisplaycache.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidisplaycache.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidisplaycache.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidisplaycache.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapidisplaycache.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_wayland_la-gstvaapiwindow_wayland.lo: gstvaapiwindow_wayland.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_wayland_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_wayland_la-gstvaapiwindow_wayland.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_wayland_la-gstvaapiwindow_wayland.Tpo -c -o libgstvaapi_wayland_la-gstvaapiwindow_wayland.lo `test -f 'gstvaapiwindow_wayland.c' || echo '$(srcdir)/'`gstvaapiwindow_wayland.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_wayland_la-gstvaapiwindow_wayland.Tpo $(DEPDIR)/libgstvaapi_wayland_la-gstvaapiwindow_wayland.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiwindow_wayland.c' object='libgstvaapi_wayland_la-gstvaapiwindow_wayland.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidisplaycache.lo `test -f 'gstvaapidisplaycache.c' || echo '$(srcdir)/'`gstvaapidisplaycache.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_wayland_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_wayland_la-gstvaapiwindow_wayland.lo `test -f 'gstvaapiwindow_wayland.c' || echo '$(srcdir)/'`gstvaapiwindow_wayland.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapifilter.lo: gstvaapifilter.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapifilter.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapifilter.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapifilter.lo `test -f 'gstvaapifilter.c' || echo '$(srcdir)/'`gstvaapifilter.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapifilter.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapifilter.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapifilter.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapifilter.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_x11_la-gstvaapidisplay_x11.lo: gstvaapidisplay_x11.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_x11_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_x11_la-gstvaapidisplay_x11.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_x11_la-gstvaapidisplay_x11.Tpo -c -o libgstvaapi_x11_la-gstvaapidisplay_x11.lo `test -f 'gstvaapidisplay_x11.c' || echo '$(srcdir)/'`gstvaapidisplay_x11.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_x11_la-gstvaapidisplay_x11.Tpo $(DEPDIR)/libgstvaapi_x11_la-gstvaapidisplay_x11.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidisplay_x11.c' object='libgstvaapi_x11_la-gstvaapidisplay_x11.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapifilter.lo `test -f 'gstvaapifilter.c' || echo '$(srcdir)/'`gstvaapifilter.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_x11_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_x11_la-gstvaapidisplay_x11.lo `test -f 'gstvaapidisplay_x11.c' || echo '$(srcdir)/'`gstvaapidisplay_x11.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapiimage.lo: gstvaapiimage.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapiimage.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiimage.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiimage.lo `test -f 'gstvaapiimage.c' || echo '$(srcdir)/'`gstvaapiimage.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiimage.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiimage.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiimage.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapiimage.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_x11_la-gstvaapipixmap_x11.lo: gstvaapipixmap_x11.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_x11_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_x11_la-gstvaapipixmap_x11.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_x11_la-gstvaapipixmap_x11.Tpo -c -o libgstvaapi_x11_la-gstvaapipixmap_x11.lo `test -f 'gstvaapipixmap_x11.c' || echo '$(srcdir)/'`gstvaapipixmap_x11.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_x11_la-gstvaapipixmap_x11.Tpo $(DEPDIR)/libgstvaapi_x11_la-gstvaapipixmap_x11.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapipixmap_x11.c' object='libgstvaapi_x11_la-gstvaapipixmap_x11.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiimage.lo `test -f 'gstvaapiimage.c' || echo '$(srcdir)/'`gstvaapiimage.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_x11_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_x11_la-gstvaapipixmap_x11.lo `test -f 'gstvaapipixmap_x11.c' || echo '$(srcdir)/'`gstvaapipixmap_x11.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapiimagepool.lo: gstvaapiimagepool.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapiimagepool.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiimagepool.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiimagepool.lo `test -f 'gstvaapiimagepool.c' || echo '$(srcdir)/'`gstvaapiimagepool.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiimagepool.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiimagepool.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiimagepool.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapiimagepool.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_x11_la-gstvaapiutils_x11.lo: gstvaapiutils_x11.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_x11_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_x11_la-gstvaapiutils_x11.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_x11_la-gstvaapiutils_x11.Tpo -c -o libgstvaapi_x11_la-gstvaapiutils_x11.lo `test -f 'gstvaapiutils_x11.c' || echo '$(srcdir)/'`gstvaapiutils_x11.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_x11_la-gstvaapiutils_x11.Tpo $(DEPDIR)/libgstvaapi_x11_la-gstvaapiutils_x11.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiutils_x11.c' object='libgstvaapi_x11_la-gstvaapiutils_x11.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiimagepool.lo `test -f 'gstvaapiimagepool.c' || echo '$(srcdir)/'`gstvaapiimagepool.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_x11_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_x11_la-gstvaapiutils_x11.lo `test -f 'gstvaapiutils_x11.c' || echo '$(srcdir)/'`gstvaapiutils_x11.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapiminiobject.lo: gstvaapiminiobject.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapiminiobject.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiminiobject.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiminiobject.lo `test -f 'gstvaapiminiobject.c' || echo '$(srcdir)/'`gstvaapiminiobject.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiminiobject.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiminiobject.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiminiobject.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapiminiobject.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_x11_la-gstvaapiwindow_x11.lo: gstvaapiwindow_x11.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_x11_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_x11_la-gstvaapiwindow_x11.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_x11_la-gstvaapiwindow_x11.Tpo -c -o libgstvaapi_x11_la-gstvaapiwindow_x11.lo `test -f 'gstvaapiwindow_x11.c' || echo '$(srcdir)/'`gstvaapiwindow_x11.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_x11_la-gstvaapiwindow_x11.Tpo $(DEPDIR)/libgstvaapi_x11_la-gstvaapiwindow_x11.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiwindow_x11.c' object='libgstvaapi_x11_la-gstvaapiwindow_x11.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiminiobject.lo `test -f 'gstvaapiminiobject.c' || echo '$(srcdir)/'`gstvaapiminiobject.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_x11_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_x11_la-gstvaapiwindow_x11.lo `test -f 'gstvaapiwindow_x11.c' || echo '$(srcdir)/'`gstvaapiwindow_x11.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapiobject.lo: gstvaapiobject.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapiobject.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiobject.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiobject.lo `test -f 'gstvaapiobject.c' || echo '$(srcdir)/'`gstvaapiobject.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiobject.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiobject.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiobject.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapiobject.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapibufferproxy.lo: gstvaapibufferproxy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapibufferproxy.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapibufferproxy.Tpo -c -o libgstvaapi_la-gstvaapibufferproxy.lo `test -f 'gstvaapibufferproxy.c' || echo '$(srcdir)/'`gstvaapibufferproxy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapibufferproxy.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapibufferproxy.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapibufferproxy.c' object='libgstvaapi_la-gstvaapibufferproxy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiobject.lo `test -f 'gstvaapiobject.c' || echo '$(srcdir)/'`gstvaapiobject.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapibufferproxy.lo `test -f 'gstvaapibufferproxy.c' || echo '$(srcdir)/'`gstvaapibufferproxy.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapiparser_frame.lo: gstvaapiparser_frame.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapiparser_frame.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiparser_frame.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiparser_frame.lo `test -f 'gstvaapiparser_frame.c' || echo '$(srcdir)/'`gstvaapiparser_frame.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiparser_frame.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiparser_frame.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiparser_frame.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapiparser_frame.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapicodec_objects.lo: gstvaapicodec_objects.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapicodec_objects.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapicodec_objects.Tpo -c -o libgstvaapi_la-gstvaapicodec_objects.lo `test -f 'gstvaapicodec_objects.c' || echo '$(srcdir)/'`gstvaapicodec_objects.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapicodec_objects.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapicodec_objects.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapicodec_objects.c' object='libgstvaapi_la-gstvaapicodec_objects.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiparser_frame.lo `test -f 'gstvaapiparser_frame.c' || echo '$(srcdir)/'`gstvaapiparser_frame.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapicodec_objects.lo `test -f 'gstvaapicodec_objects.c' || echo '$(srcdir)/'`gstvaapicodec_objects.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapipixmap.lo: gstvaapipixmap.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapipixmap.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapipixmap.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapipixmap.lo `test -f 'gstvaapipixmap.c' || echo '$(srcdir)/'`gstvaapipixmap.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapipixmap.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapipixmap.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapipixmap.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapipixmap.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapicontext.lo: gstvaapicontext.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapicontext.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapicontext.Tpo -c -o libgstvaapi_la-gstvaapicontext.lo `test -f 'gstvaapicontext.c' || echo '$(srcdir)/'`gstvaapicontext.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapicontext.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapicontext.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapicontext.c' object='libgstvaapi_la-gstvaapicontext.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapipixmap.lo `test -f 'gstvaapipixmap.c' || echo '$(srcdir)/'`gstvaapipixmap.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapicontext.lo `test -f 'gstvaapicontext.c' || echo '$(srcdir)/'`gstvaapicontext.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapiprofile.lo: gstvaapiprofile.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapiprofile.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiprofile.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiprofile.lo `test -f 'gstvaapiprofile.c' || echo '$(srcdir)/'`gstvaapiprofile.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiprofile.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiprofile.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiprofile.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapiprofile.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapicontext_overlay.lo: gstvaapicontext_overlay.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapicontext_overlay.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapicontext_overlay.Tpo -c -o libgstvaapi_la-gstvaapicontext_overlay.lo `test -f 'gstvaapicontext_overlay.c' || echo '$(srcdir)/'`gstvaapicontext_overlay.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapicontext_overlay.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapicontext_overlay.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapicontext_overlay.c' object='libgstvaapi_la-gstvaapicontext_overlay.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiprofile.lo `test -f 'gstvaapiprofile.c' || echo '$(srcdir)/'`gstvaapiprofile.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapicontext_overlay.lo `test -f 'gstvaapicontext_overlay.c' || echo '$(srcdir)/'`gstvaapicontext_overlay.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapisubpicture.lo: gstvaapisubpicture.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapisubpicture.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapisubpicture.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapisubpicture.lo `test -f 'gstvaapisubpicture.c' || echo '$(srcdir)/'`gstvaapisubpicture.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapisubpicture.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapisubpicture.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapisubpicture.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapisubpicture.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapidecoder.lo: gstvaapidecoder.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapidecoder.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapidecoder.Tpo -c -o libgstvaapi_la-gstvaapidecoder.lo `test -f 'gstvaapidecoder.c' || echo '$(srcdir)/'`gstvaapidecoder.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapidecoder.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapidecoder.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder.c' object='libgstvaapi_la-gstvaapidecoder.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapisubpicture.lo `test -f 'gstvaapisubpicture.c' || echo '$(srcdir)/'`gstvaapisubpicture.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapidecoder.lo `test -f 'gstvaapidecoder.c' || echo '$(srcdir)/'`gstvaapidecoder.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapisurface.lo: gstvaapisurface.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapisurface.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapisurface.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapisurface.lo `test -f 'gstvaapisurface.c' || echo '$(srcdir)/'`gstvaapisurface.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapisurface.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapisurface.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapisurface.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapisurface.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapidecoder_dpb.lo: gstvaapidecoder_dpb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapidecoder_dpb.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_dpb.Tpo -c -o libgstvaapi_la-gstvaapidecoder_dpb.lo `test -f 'gstvaapidecoder_dpb.c' || echo '$(srcdir)/'`gstvaapidecoder_dpb.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_dpb.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_dpb.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_dpb.c' object='libgstvaapi_la-gstvaapidecoder_dpb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapisurface.lo `test -f 'gstvaapisurface.c' || echo '$(srcdir)/'`gstvaapisurface.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapidecoder_dpb.lo `test -f 'gstvaapidecoder_dpb.c' || echo '$(srcdir)/'`gstvaapidecoder_dpb.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapisurface_drm.lo: gstvaapisurface_drm.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapisurface_drm.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapisurface_drm.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapisurface_drm.lo `test -f 'gstvaapisurface_drm.c' || echo '$(srcdir)/'`gstvaapisurface_drm.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapisurface_drm.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapisurface_drm.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapisurface_drm.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapisurface_drm.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapidecoder_h264.lo: gstvaapidecoder_h264.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapidecoder_h264.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_h264.Tpo -c -o libgstvaapi_la-gstvaapidecoder_h264.lo `test -f 'gstvaapidecoder_h264.c' || echo '$(srcdir)/'`gstvaapidecoder_h264.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_h264.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_h264.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_h264.c' object='libgstvaapi_la-gstvaapidecoder_h264.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapisurface_drm.lo `test -f 'gstvaapisurface_drm.c' || echo '$(srcdir)/'`gstvaapisurface_drm.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapidecoder_h264.lo `test -f 'gstvaapidecoder_h264.c' || echo '$(srcdir)/'`gstvaapidecoder_h264.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapisurfacepool.lo: gstvaapisurfacepool.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapisurfacepool.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapisurfacepool.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapisurfacepool.lo `test -f 'gstvaapisurfacepool.c' || echo '$(srcdir)/'`gstvaapisurfacepool.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapisurfacepool.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapisurfacepool.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapisurfacepool.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapisurfacepool.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapidecoder_mpeg2.lo: gstvaapidecoder_mpeg2.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapidecoder_mpeg2.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_mpeg2.Tpo -c -o libgstvaapi_la-gstvaapidecoder_mpeg2.lo `test -f 'gstvaapidecoder_mpeg2.c' || echo '$(srcdir)/'`gstvaapidecoder_mpeg2.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_mpeg2.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_mpeg2.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_mpeg2.c' object='libgstvaapi_la-gstvaapidecoder_mpeg2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapisurfacepool.lo `test -f 'gstvaapisurfacepool.c' || echo '$(srcdir)/'`gstvaapisurfacepool.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapidecoder_mpeg2.lo `test -f 'gstvaapidecoder_mpeg2.c' || echo '$(srcdir)/'`gstvaapidecoder_mpeg2.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapisurfaceproxy.lo: gstvaapisurfaceproxy.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapisurfaceproxy.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapisurfaceproxy.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapisurfaceproxy.lo `test -f 'gstvaapisurfaceproxy.c' || echo '$(srcdir)/'`gstvaapisurfaceproxy.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapisurfaceproxy.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapisurfaceproxy.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapisurfaceproxy.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapisurfaceproxy.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapidecoder_mpeg4.lo: gstvaapidecoder_mpeg4.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapidecoder_mpeg4.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_mpeg4.Tpo -c -o libgstvaapi_la-gstvaapidecoder_mpeg4.lo `test -f 'gstvaapidecoder_mpeg4.c' || echo '$(srcdir)/'`gstvaapidecoder_mpeg4.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_mpeg4.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_mpeg4.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_mpeg4.c' object='libgstvaapi_la-gstvaapidecoder_mpeg4.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapisurfaceproxy.lo `test -f 'gstvaapisurfaceproxy.c' || echo '$(srcdir)/'`gstvaapisurfaceproxy.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapidecoder_mpeg4.lo `test -f 'gstvaapidecoder_mpeg4.c' || echo '$(srcdir)/'`gstvaapidecoder_mpeg4.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapitexture.lo: gstvaapitexture.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapitexture.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapitexture.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapitexture.lo `test -f 'gstvaapitexture.c' || echo '$(srcdir)/'`gstvaapitexture.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapitexture.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapitexture.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapitexture.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapitexture.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapidecoder_objects.lo: gstvaapidecoder_objects.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapidecoder_objects.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_objects.Tpo -c -o libgstvaapi_la-gstvaapidecoder_objects.lo `test -f 'gstvaapidecoder_objects.c' || echo '$(srcdir)/'`gstvaapidecoder_objects.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_objects.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_objects.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_objects.c' object='libgstvaapi_la-gstvaapidecoder_objects.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapitexture.lo `test -f 'gstvaapitexture.c' || echo '$(srcdir)/'`gstvaapitexture.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapidecoder_objects.lo `test -f 'gstvaapidecoder_objects.c' || echo '$(srcdir)/'`gstvaapidecoder_objects.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils.lo: gstvaapiutils.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils.lo `test -f 'gstvaapiutils.c' || echo '$(srcdir)/'`gstvaapiutils.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiutils.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapidecoder_unit.lo: gstvaapidecoder_unit.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapidecoder_unit.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_unit.Tpo -c -o libgstvaapi_la-gstvaapidecoder_unit.lo `test -f 'gstvaapidecoder_unit.c' || echo '$(srcdir)/'`gstvaapidecoder_unit.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_unit.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_unit.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_unit.c' object='libgstvaapi_la-gstvaapidecoder_unit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils.lo `test -f 'gstvaapiutils.c' || echo '$(srcdir)/'`gstvaapiutils.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapidecoder_unit.lo `test -f 'gstvaapidecoder_unit.c' || echo '$(srcdir)/'`gstvaapidecoder_unit.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_core.lo: gstvaapiutils_core.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_core.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_core.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_core.lo `test -f 'gstvaapiutils_core.c' || echo '$(srcdir)/'`gstvaapiutils_core.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_core.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_core.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiutils_core.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_core.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapidecoder_vc1.lo: gstvaapidecoder_vc1.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapidecoder_vc1.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_vc1.Tpo -c -o libgstvaapi_la-gstvaapidecoder_vc1.lo `test -f 'gstvaapidecoder_vc1.c' || echo '$(srcdir)/'`gstvaapidecoder_vc1.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_vc1.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_vc1.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_vc1.c' object='libgstvaapi_la-gstvaapidecoder_vc1.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_core.lo `test -f 'gstvaapiutils_core.c' || echo '$(srcdir)/'`gstvaapiutils_core.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapidecoder_vc1.lo `test -f 'gstvaapidecoder_vc1.c' || echo '$(srcdir)/'`gstvaapidecoder_vc1.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_h264.lo: gstvaapiutils_h264.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_h264.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_h264.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_h264.lo `test -f 'gstvaapiutils_h264.c' || echo '$(srcdir)/'`gstvaapiutils_h264.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_h264.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_h264.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiutils_h264.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_h264.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapidisplay.lo: gstvaapidisplay.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapidisplay.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapidisplay.Tpo -c -o libgstvaapi_la-gstvaapidisplay.lo `test -f 'gstvaapidisplay.c' || echo '$(srcdir)/'`gstvaapidisplay.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapidisplay.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapidisplay.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidisplay.c' object='libgstvaapi_la-gstvaapidisplay.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_h264.lo `test -f 'gstvaapiutils_h264.c' || echo '$(srcdir)/'`gstvaapiutils_h264.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapidisplay.lo `test -f 'gstvaapidisplay.c' || echo '$(srcdir)/'`gstvaapidisplay.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_mpeg2.lo: gstvaapiutils_mpeg2.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_mpeg2.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_mpeg2.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_mpeg2.lo `test -f 'gstvaapiutils_mpeg2.c' || echo '$(srcdir)/'`gstvaapiutils_mpeg2.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_mpeg2.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_mpeg2.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiutils_mpeg2.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_mpeg2.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapidisplaycache.lo: gstvaapidisplaycache.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapidisplaycache.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapidisplaycache.Tpo -c -o libgstvaapi_la-gstvaapidisplaycache.lo `test -f 'gstvaapidisplaycache.c' || echo '$(srcdir)/'`gstvaapidisplaycache.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapidisplaycache.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapidisplaycache.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidisplaycache.c' object='libgstvaapi_la-gstvaapidisplaycache.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_mpeg2.lo `test -f 'gstvaapiutils_mpeg2.c' || echo '$(srcdir)/'`gstvaapiutils_mpeg2.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapidisplaycache.lo `test -f 'gstvaapidisplaycache.c' || echo '$(srcdir)/'`gstvaapidisplaycache.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapivalue.lo: gstvaapivalue.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapivalue.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapivalue.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapivalue.lo `test -f 'gstvaapivalue.c' || echo '$(srcdir)/'`gstvaapivalue.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapivalue.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapivalue.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapivalue.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapivalue.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapifilter.lo: gstvaapifilter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapifilter.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapifilter.Tpo -c -o libgstvaapi_la-gstvaapifilter.lo `test -f 'gstvaapifilter.c' || echo '$(srcdir)/'`gstvaapifilter.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapifilter.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapifilter.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapifilter.c' object='libgstvaapi_la-gstvaapifilter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapivalue.lo `test -f 'gstvaapivalue.c' || echo '$(srcdir)/'`gstvaapivalue.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapifilter.lo `test -f 'gstvaapifilter.c' || echo '$(srcdir)/'`gstvaapifilter.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapivideopool.lo: gstvaapivideopool.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapivideopool.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapivideopool.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapivideopool.lo `test -f 'gstvaapivideopool.c' || echo '$(srcdir)/'`gstvaapivideopool.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapivideopool.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapivideopool.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapivideopool.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapivideopool.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapiimage.lo: gstvaapiimage.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapiimage.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapiimage.Tpo -c -o libgstvaapi_la-gstvaapiimage.lo `test -f 'gstvaapiimage.c' || echo '$(srcdir)/'`gstvaapiimage.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapiimage.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapiimage.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiimage.c' object='libgstvaapi_la-gstvaapiimage.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapivideopool.lo `test -f 'gstvaapivideopool.c' || echo '$(srcdir)/'`gstvaapivideopool.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapiimage.lo `test -f 'gstvaapiimage.c' || echo '$(srcdir)/'`gstvaapiimage.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapiwindow.lo: gstvaapiwindow.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapiwindow.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiwindow.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiwindow.lo `test -f 'gstvaapiwindow.c' || echo '$(srcdir)/'`gstvaapiwindow.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiwindow.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiwindow.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiwindow.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapiwindow.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapiimagepool.lo: gstvaapiimagepool.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapiimagepool.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapiimagepool.Tpo -c -o libgstvaapi_la-gstvaapiimagepool.lo `test -f 'gstvaapiimagepool.c' || echo '$(srcdir)/'`gstvaapiimagepool.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapiimagepool.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapiimagepool.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiimagepool.c' object='libgstvaapi_la-gstvaapiimagepool.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiwindow.lo `test -f 'gstvaapiwindow.c' || echo '$(srcdir)/'`gstvaapiwindow.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapiimagepool.lo `test -f 'gstvaapiimagepool.c' || echo '$(srcdir)/'`gstvaapiimagepool.c -libgstvaapi_@GST_API_VERSION@_la-video-format.lo: video-format.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-video-format.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-video-format.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-video-format.lo `test -f 'video-format.c' || echo '$(srcdir)/'`video-format.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-video-format.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-video-format.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='video-format.c' object='libgstvaapi_@GST_API_VERSION@_la-video-format.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapiminiobject.lo: gstvaapiminiobject.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapiminiobject.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapiminiobject.Tpo -c -o libgstvaapi_la-gstvaapiminiobject.lo `test -f 'gstvaapiminiobject.c' || echo '$(srcdir)/'`gstvaapiminiobject.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapiminiobject.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapiminiobject.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiminiobject.c' object='libgstvaapi_la-gstvaapiminiobject.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-video-format.lo `test -f 'video-format.c' || echo '$(srcdir)/'`video-format.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapiminiobject.lo `test -f 'gstvaapiminiobject.c' || echo '$(srcdir)/'`gstvaapiminiobject.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_jpeg.lo: gstvaapidecoder_jpeg.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_jpeg.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_jpeg.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_jpeg.lo `test -f 'gstvaapidecoder_jpeg.c' || echo '$(srcdir)/'`gstvaapidecoder_jpeg.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_jpeg.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_jpeg.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_jpeg.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_jpeg.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapiobject.lo: gstvaapiobject.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapiobject.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapiobject.Tpo -c -o libgstvaapi_la-gstvaapiobject.lo `test -f 'gstvaapiobject.c' || echo '$(srcdir)/'`gstvaapiobject.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapiobject.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapiobject.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiobject.c' object='libgstvaapi_la-gstvaapiobject.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_jpeg.lo `test -f 'gstvaapidecoder_jpeg.c' || echo '$(srcdir)/'`gstvaapidecoder_jpeg.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapiobject.lo `test -f 'gstvaapiobject.c' || echo '$(srcdir)/'`gstvaapiobject.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vp8.lo: gstvaapidecoder_vp8.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vp8.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vp8.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vp8.lo `test -f 'gstvaapidecoder_vp8.c' || echo '$(srcdir)/'`gstvaapidecoder_vp8.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vp8.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vp8.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_vp8.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vp8.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapiparser_frame.lo: gstvaapiparser_frame.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapiparser_frame.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapiparser_frame.Tpo -c -o libgstvaapi_la-gstvaapiparser_frame.lo `test -f 'gstvaapiparser_frame.c' || echo '$(srcdir)/'`gstvaapiparser_frame.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapiparser_frame.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapiparser_frame.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiparser_frame.c' object='libgstvaapi_la-gstvaapiparser_frame.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vp8.lo `test -f 'gstvaapidecoder_vp8.c' || echo '$(srcdir)/'`gstvaapidecoder_vp8.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapiparser_frame.lo `test -f 'gstvaapiparser_frame.c' || echo '$(srcdir)/'`gstvaapiparser_frame.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_h265.lo: gstvaapidecoder_h265.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_h265.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_h265.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_h265.lo `test -f 'gstvaapidecoder_h265.c' || echo '$(srcdir)/'`gstvaapidecoder_h265.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_h265.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_h265.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_h265.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_h265.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapipixmap.lo: gstvaapipixmap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapipixmap.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapipixmap.Tpo -c -o libgstvaapi_la-gstvaapipixmap.lo `test -f 'gstvaapipixmap.c' || echo '$(srcdir)/'`gstvaapipixmap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapipixmap.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapipixmap.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapipixmap.c' object='libgstvaapi_la-gstvaapipixmap.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_h265.lo `test -f 'gstvaapidecoder_h265.c' || echo '$(srcdir)/'`gstvaapidecoder_h265.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapipixmap.lo `test -f 'gstvaapipixmap.c' || echo '$(srcdir)/'`gstvaapipixmap.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_h265.lo: gstvaapiutils_h265.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_h265.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_h265.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_h265.lo `test -f 'gstvaapiutils_h265.c' || echo '$(srcdir)/'`gstvaapiutils_h265.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_h265.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_h265.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiutils_h265.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_h265.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapiprofile.lo: gstvaapiprofile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapiprofile.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapiprofile.Tpo -c -o libgstvaapi_la-gstvaapiprofile.lo `test -f 'gstvaapiprofile.c' || echo '$(srcdir)/'`gstvaapiprofile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapiprofile.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapiprofile.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiprofile.c' object='libgstvaapi_la-gstvaapiprofile.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiutils_h265.lo `test -f 'gstvaapiutils_h265.c' || echo '$(srcdir)/'`gstvaapiutils_h265.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapiprofile.lo `test -f 'gstvaapiprofile.c' || echo '$(srcdir)/'`gstvaapiprofile.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vp9.lo: gstvaapidecoder_vp9.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vp9.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vp9.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vp9.lo `test -f 'gstvaapidecoder_vp9.c' || echo '$(srcdir)/'`gstvaapidecoder_vp9.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vp9.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vp9.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_vp9.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vp9.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapisubpicture.lo: gstvaapisubpicture.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapisubpicture.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapisubpicture.Tpo -c -o libgstvaapi_la-gstvaapisubpicture.lo `test -f 'gstvaapisubpicture.c' || echo '$(srcdir)/'`gstvaapisubpicture.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapisubpicture.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapisubpicture.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapisubpicture.c' object='libgstvaapi_la-gstvaapisubpicture.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapidecoder_vp9.lo `test -f 'gstvaapidecoder_vp9.c' || echo '$(srcdir)/'`gstvaapidecoder_vp9.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapisubpicture.lo `test -f 'gstvaapisubpicture.c' || echo '$(srcdir)/'`gstvaapisubpicture.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbuffer.lo: gstvaapicodedbuffer.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbuffer.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbuffer.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbuffer.lo `test -f 'gstvaapicodedbuffer.c' || echo '$(srcdir)/'`gstvaapicodedbuffer.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbuffer.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbuffer.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapicodedbuffer.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbuffer.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapisurface.lo: gstvaapisurface.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapisurface.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapisurface.Tpo -c -o libgstvaapi_la-gstvaapisurface.lo `test -f 'gstvaapisurface.c' || echo '$(srcdir)/'`gstvaapisurface.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapisurface.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapisurface.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapisurface.c' object='libgstvaapi_la-gstvaapisurface.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbuffer.lo `test -f 'gstvaapicodedbuffer.c' || echo '$(srcdir)/'`gstvaapicodedbuffer.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapisurface.lo `test -f 'gstvaapisurface.c' || echo '$(srcdir)/'`gstvaapisurface.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbufferpool.lo: gstvaapicodedbufferpool.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbufferpool.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbufferpool.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbufferpool.lo `test -f 'gstvaapicodedbufferpool.c' || echo '$(srcdir)/'`gstvaapicodedbufferpool.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbufferpool.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbufferpool.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapicodedbufferpool.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbufferpool.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapisurface_drm.lo: gstvaapisurface_drm.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapisurface_drm.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapisurface_drm.Tpo -c -o libgstvaapi_la-gstvaapisurface_drm.lo `test -f 'gstvaapisurface_drm.c' || echo '$(srcdir)/'`gstvaapisurface_drm.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapisurface_drm.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapisurface_drm.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapisurface_drm.c' object='libgstvaapi_la-gstvaapisurface_drm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbufferpool.lo `test -f 'gstvaapicodedbufferpool.c' || echo '$(srcdir)/'`gstvaapicodedbufferpool.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapisurface_drm.lo `test -f 'gstvaapisurface_drm.c' || echo '$(srcdir)/'`gstvaapisurface_drm.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbufferproxy.lo: gstvaapicodedbufferproxy.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbufferproxy.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbufferproxy.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbufferproxy.lo `test -f 'gstvaapicodedbufferproxy.c' || echo '$(srcdir)/'`gstvaapicodedbufferproxy.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbufferproxy.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbufferproxy.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapicodedbufferproxy.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbufferproxy.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapisurfacepool.lo: gstvaapisurfacepool.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapisurfacepool.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapisurfacepool.Tpo -c -o libgstvaapi_la-gstvaapisurfacepool.lo `test -f 'gstvaapisurfacepool.c' || echo '$(srcdir)/'`gstvaapisurfacepool.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapisurfacepool.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapisurfacepool.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapisurfacepool.c' object='libgstvaapi_la-gstvaapisurfacepool.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapicodedbufferproxy.lo `test -f 'gstvaapicodedbufferproxy.c' || echo '$(srcdir)/'`gstvaapicodedbufferproxy.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapisurfacepool.lo `test -f 'gstvaapisurfacepool.c' || echo '$(srcdir)/'`gstvaapisurfacepool.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder.lo: gstvaapiencoder.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder.lo `test -f 'gstvaapiencoder.c' || echo '$(srcdir)/'`gstvaapiencoder.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiencoder.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapisurfaceproxy.lo: gstvaapisurfaceproxy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapisurfaceproxy.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapisurfaceproxy.Tpo -c -o libgstvaapi_la-gstvaapisurfaceproxy.lo `test -f 'gstvaapisurfaceproxy.c' || echo '$(srcdir)/'`gstvaapisurfaceproxy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapisurfaceproxy.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapisurfaceproxy.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapisurfaceproxy.c' object='libgstvaapi_la-gstvaapisurfaceproxy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder.lo `test -f 'gstvaapiencoder.c' || echo '$(srcdir)/'`gstvaapiencoder.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapisurfaceproxy.lo `test -f 'gstvaapisurfaceproxy.c' || echo '$(srcdir)/'`gstvaapisurfaceproxy.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_h264.lo: gstvaapiencoder_h264.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_h264.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_h264.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_h264.lo `test -f 'gstvaapiencoder_h264.c' || echo '$(srcdir)/'`gstvaapiencoder_h264.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_h264.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_h264.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiencoder_h264.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_h264.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapitexture.lo: gstvaapitexture.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapitexture.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapitexture.Tpo -c -o libgstvaapi_la-gstvaapitexture.lo `test -f 'gstvaapitexture.c' || echo '$(srcdir)/'`gstvaapitexture.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapitexture.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapitexture.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapitexture.c' object='libgstvaapi_la-gstvaapitexture.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_h264.lo `test -f 'gstvaapiencoder_h264.c' || echo '$(srcdir)/'`gstvaapiencoder_h264.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapitexture.lo `test -f 'gstvaapitexture.c' || echo '$(srcdir)/'`gstvaapitexture.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_mpeg2.lo: gstvaapiencoder_mpeg2.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_mpeg2.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_mpeg2.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_mpeg2.lo `test -f 'gstvaapiencoder_mpeg2.c' || echo '$(srcdir)/'`gstvaapiencoder_mpeg2.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_mpeg2.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_mpeg2.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiencoder_mpeg2.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_mpeg2.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapiutils.lo: gstvaapiutils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapiutils.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapiutils.Tpo -c -o libgstvaapi_la-gstvaapiutils.lo `test -f 'gstvaapiutils.c' || echo '$(srcdir)/'`gstvaapiutils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapiutils.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapiutils.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiutils.c' object='libgstvaapi_la-gstvaapiutils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_mpeg2.lo `test -f 'gstvaapiencoder_mpeg2.c' || echo '$(srcdir)/'`gstvaapiencoder_mpeg2.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapiutils.lo `test -f 'gstvaapiutils.c' || echo '$(srcdir)/'`gstvaapiutils.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_objects.lo: gstvaapiencoder_objects.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_objects.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_objects.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_objects.lo `test -f 'gstvaapiencoder_objects.c' || echo '$(srcdir)/'`gstvaapiencoder_objects.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_objects.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_objects.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiencoder_objects.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_objects.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapiutils_core.lo: gstvaapiutils_core.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapiutils_core.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapiutils_core.Tpo -c -o libgstvaapi_la-gstvaapiutils_core.lo `test -f 'gstvaapiutils_core.c' || echo '$(srcdir)/'`gstvaapiutils_core.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapiutils_core.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapiutils_core.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiutils_core.c' object='libgstvaapi_la-gstvaapiutils_core.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_objects.lo `test -f 'gstvaapiencoder_objects.c' || echo '$(srcdir)/'`gstvaapiencoder_objects.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapiutils_core.lo `test -f 'gstvaapiutils_core.c' || echo '$(srcdir)/'`gstvaapiutils_core.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_jpeg.lo: gstvaapiencoder_jpeg.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_jpeg.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_jpeg.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_jpeg.lo `test -f 'gstvaapiencoder_jpeg.c' || echo '$(srcdir)/'`gstvaapiencoder_jpeg.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_jpeg.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_jpeg.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiencoder_jpeg.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_jpeg.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapiutils_h264.lo: gstvaapiutils_h264.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapiutils_h264.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapiutils_h264.Tpo -c -o libgstvaapi_la-gstvaapiutils_h264.lo `test -f 'gstvaapiutils_h264.c' || echo '$(srcdir)/'`gstvaapiutils_h264.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapiutils_h264.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapiutils_h264.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiutils_h264.c' object='libgstvaapi_la-gstvaapiutils_h264.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_jpeg.lo `test -f 'gstvaapiencoder_jpeg.c' || echo '$(srcdir)/'`gstvaapiencoder_jpeg.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapiutils_h264.lo `test -f 'gstvaapiutils_h264.c' || echo '$(srcdir)/'`gstvaapiutils_h264.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_vp8.lo: gstvaapiencoder_vp8.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_vp8.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_vp8.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_vp8.lo `test -f 'gstvaapiencoder_vp8.c' || echo '$(srcdir)/'`gstvaapiencoder_vp8.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_vp8.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_vp8.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiencoder_vp8.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_vp8.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapiutils_h265.lo: gstvaapiutils_h265.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapiutils_h265.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapiutils_h265.Tpo -c -o libgstvaapi_la-gstvaapiutils_h265.lo `test -f 'gstvaapiutils_h265.c' || echo '$(srcdir)/'`gstvaapiutils_h265.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapiutils_h265.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapiutils_h265.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiutils_h265.c' object='libgstvaapi_la-gstvaapiutils_h265.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_vp8.lo `test -f 'gstvaapiencoder_vp8.c' || echo '$(srcdir)/'`gstvaapiencoder_vp8.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapiutils_h265.lo `test -f 'gstvaapiutils_h265.c' || echo '$(srcdir)/'`gstvaapiutils_h265.c -libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_h265.lo: gstvaapiencoder_h265.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_h265.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_h265.Tpo -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_h265.lo `test -f 'gstvaapiencoder_h265.c' || echo '$(srcdir)/'`gstvaapiencoder_h265.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_h265.Tpo $(DEPDIR)/libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_h265.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiencoder_h265.c' object='libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_h265.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapiutils_mpeg2.lo: gstvaapiutils_mpeg2.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapiutils_mpeg2.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapiutils_mpeg2.Tpo -c -o libgstvaapi_la-gstvaapiutils_mpeg2.lo `test -f 'gstvaapiutils_mpeg2.c' || echo '$(srcdir)/'`gstvaapiutils_mpeg2.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapiutils_mpeg2.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapiutils_mpeg2.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiutils_mpeg2.c' object='libgstvaapi_la-gstvaapiutils_mpeg2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_@GST_API_VERSION@_la-gstvaapiencoder_h265.lo `test -f 'gstvaapiencoder_h265.c' || echo '$(srcdir)/'`gstvaapiencoder_h265.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapiutils_mpeg2.lo `test -f 'gstvaapiutils_mpeg2.c' || echo '$(srcdir)/'`gstvaapiutils_mpeg2.c -libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapidisplay_drm.lo: gstvaapidisplay_drm.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_drm_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapidisplay_drm.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapidisplay_drm.Tpo -c -o libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapidisplay_drm.lo `test -f 'gstvaapidisplay_drm.c' || echo '$(srcdir)/'`gstvaapidisplay_drm.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapidisplay_drm.Tpo $(DEPDIR)/libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapidisplay_drm.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidisplay_drm.c' object='libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapidisplay_drm.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapivalue.lo: gstvaapivalue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapivalue.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapivalue.Tpo -c -o libgstvaapi_la-gstvaapivalue.lo `test -f 'gstvaapivalue.c' || echo '$(srcdir)/'`gstvaapivalue.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapivalue.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapivalue.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapivalue.c' object='libgstvaapi_la-gstvaapivalue.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_drm_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapidisplay_drm.lo `test -f 'gstvaapidisplay_drm.c' || echo '$(srcdir)/'`gstvaapidisplay_drm.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapivalue.lo `test -f 'gstvaapivalue.c' || echo '$(srcdir)/'`gstvaapivalue.c -libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapiwindow_drm.lo: gstvaapiwindow_drm.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_drm_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapiwindow_drm.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapiwindow_drm.Tpo -c -o libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapiwindow_drm.lo `test -f 'gstvaapiwindow_drm.c' || echo '$(srcdir)/'`gstvaapiwindow_drm.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapiwindow_drm.Tpo $(DEPDIR)/libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapiwindow_drm.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiwindow_drm.c' object='libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapiwindow_drm.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapivideopool.lo: gstvaapivideopool.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapivideopool.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapivideopool.Tpo -c -o libgstvaapi_la-gstvaapivideopool.lo `test -f 'gstvaapivideopool.c' || echo '$(srcdir)/'`gstvaapivideopool.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapivideopool.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapivideopool.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapivideopool.c' object='libgstvaapi_la-gstvaapivideopool.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_drm_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapiwindow_drm.lo `test -f 'gstvaapiwindow_drm.c' || echo '$(srcdir)/'`gstvaapiwindow_drm.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapivideopool.lo `test -f 'gstvaapivideopool.c' || echo '$(srcdir)/'`gstvaapivideopool.c -libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapiutils.lo: gstvaapiutils.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_drm_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapiutils.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapiutils.Tpo -c -o libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapiutils.lo `test -f 'gstvaapiutils.c' || echo '$(srcdir)/'`gstvaapiutils.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapiutils.Tpo $(DEPDIR)/libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapiutils.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiutils.c' object='libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapiutils.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapiwindow.lo: gstvaapiwindow.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapiwindow.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapiwindow.Tpo -c -o libgstvaapi_la-gstvaapiwindow.lo `test -f 'gstvaapiwindow.c' || echo '$(srcdir)/'`gstvaapiwindow.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapiwindow.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapiwindow.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiwindow.c' object='libgstvaapi_la-gstvaapiwindow.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_drm_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_drm_@GST_API_VERSION@_la-gstvaapiutils.lo `test -f 'gstvaapiutils.c' || echo '$(srcdir)/'`gstvaapiutils.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapiwindow.lo `test -f 'gstvaapiwindow.c' || echo '$(srcdir)/'`gstvaapiwindow.c -libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapidisplay_egl.lo: gstvaapidisplay_egl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_egl_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapidisplay_egl.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapidisplay_egl.Tpo -c -o libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapidisplay_egl.lo `test -f 'gstvaapidisplay_egl.c' || echo '$(srcdir)/'`gstvaapidisplay_egl.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapidisplay_egl.Tpo $(DEPDIR)/libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapidisplay_egl.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidisplay_egl.c' object='libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapidisplay_egl.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-video-format.lo: video-format.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-video-format.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-video-format.Tpo -c -o libgstvaapi_la-video-format.lo `test -f 'video-format.c' || echo '$(srcdir)/'`video-format.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-video-format.Tpo $(DEPDIR)/libgstvaapi_la-video-format.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='video-format.c' object='libgstvaapi_la-video-format.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_egl_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapidisplay_egl.lo `test -f 'gstvaapidisplay_egl.c' || echo '$(srcdir)/'`gstvaapidisplay_egl.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-video-format.lo `test -f 'video-format.c' || echo '$(srcdir)/'`video-format.c -libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapisurface_egl.lo: gstvaapisurface_egl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_egl_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapisurface_egl.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapisurface_egl.Tpo -c -o libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapisurface_egl.lo `test -f 'gstvaapisurface_egl.c' || echo '$(srcdir)/'`gstvaapisurface_egl.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapisurface_egl.Tpo $(DEPDIR)/libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapisurface_egl.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapisurface_egl.c' object='libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapisurface_egl.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapidecoder_jpeg.lo: gstvaapidecoder_jpeg.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapidecoder_jpeg.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_jpeg.Tpo -c -o libgstvaapi_la-gstvaapidecoder_jpeg.lo `test -f 'gstvaapidecoder_jpeg.c' || echo '$(srcdir)/'`gstvaapidecoder_jpeg.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_jpeg.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_jpeg.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_jpeg.c' object='libgstvaapi_la-gstvaapidecoder_jpeg.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_egl_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapisurface_egl.lo `test -f 'gstvaapisurface_egl.c' || echo '$(srcdir)/'`gstvaapisurface_egl.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapidecoder_jpeg.lo `test -f 'gstvaapidecoder_jpeg.c' || echo '$(srcdir)/'`gstvaapidecoder_jpeg.c -libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapitexture_egl.lo: gstvaapitexture_egl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_egl_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapitexture_egl.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapitexture_egl.Tpo -c -o libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapitexture_egl.lo `test -f 'gstvaapitexture_egl.c' || echo '$(srcdir)/'`gstvaapitexture_egl.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapitexture_egl.Tpo $(DEPDIR)/libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapitexture_egl.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapitexture_egl.c' object='libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapitexture_egl.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapidecoder_vp8.lo: gstvaapidecoder_vp8.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapidecoder_vp8.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_vp8.Tpo -c -o libgstvaapi_la-gstvaapidecoder_vp8.lo `test -f 'gstvaapidecoder_vp8.c' || echo '$(srcdir)/'`gstvaapidecoder_vp8.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_vp8.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_vp8.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_vp8.c' object='libgstvaapi_la-gstvaapidecoder_vp8.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_egl_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapitexture_egl.lo `test -f 'gstvaapitexture_egl.c' || echo '$(srcdir)/'`gstvaapitexture_egl.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapidecoder_vp8.lo `test -f 'gstvaapidecoder_vp8.c' || echo '$(srcdir)/'`gstvaapidecoder_vp8.c -libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapiutils_egl.lo: gstvaapiutils_egl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_egl_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapiutils_egl.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapiutils_egl.Tpo -c -o libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapiutils_egl.lo `test -f 'gstvaapiutils_egl.c' || echo '$(srcdir)/'`gstvaapiutils_egl.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapiutils_egl.Tpo $(DEPDIR)/libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapiutils_egl.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiutils_egl.c' object='libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapiutils_egl.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapidecoder_h265.lo: gstvaapidecoder_h265.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapidecoder_h265.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_h265.Tpo -c -o libgstvaapi_la-gstvaapidecoder_h265.lo `test -f 'gstvaapidecoder_h265.c' || echo '$(srcdir)/'`gstvaapidecoder_h265.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_h265.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_h265.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_h265.c' object='libgstvaapi_la-gstvaapidecoder_h265.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_egl_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapiutils_egl.lo `test -f 'gstvaapiutils_egl.c' || echo '$(srcdir)/'`gstvaapiutils_egl.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapidecoder_h265.lo `test -f 'gstvaapidecoder_h265.c' || echo '$(srcdir)/'`gstvaapidecoder_h265.c -libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapiwindow_egl.lo: gstvaapiwindow_egl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_egl_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapiwindow_egl.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapiwindow_egl.Tpo -c -o libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapiwindow_egl.lo `test -f 'gstvaapiwindow_egl.c' || echo '$(srcdir)/'`gstvaapiwindow_egl.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapiwindow_egl.Tpo $(DEPDIR)/libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapiwindow_egl.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiwindow_egl.c' object='libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapiwindow_egl.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapidecoder_vp9.lo: gstvaapidecoder_vp9.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapidecoder_vp9.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_vp9.Tpo -c -o libgstvaapi_la-gstvaapidecoder_vp9.lo `test -f 'gstvaapidecoder_vp9.c' || echo '$(srcdir)/'`gstvaapidecoder_vp9.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_vp9.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapidecoder_vp9.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidecoder_vp9.c' object='libgstvaapi_la-gstvaapidecoder_vp9.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_egl_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_egl_@GST_API_VERSION@_la-gstvaapiwindow_egl.lo `test -f 'gstvaapiwindow_egl.c' || echo '$(srcdir)/'`gstvaapiwindow_egl.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapidecoder_vp9.lo `test -f 'gstvaapidecoder_vp9.c' || echo '$(srcdir)/'`gstvaapidecoder_vp9.c -libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapidisplay_glx.lo: gstvaapidisplay_glx.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_glx_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapidisplay_glx.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapidisplay_glx.Tpo -c -o libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapidisplay_glx.lo `test -f 'gstvaapidisplay_glx.c' || echo '$(srcdir)/'`gstvaapidisplay_glx.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapidisplay_glx.Tpo $(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapidisplay_glx.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidisplay_glx.c' object='libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapidisplay_glx.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapicodedbuffer.lo: gstvaapicodedbuffer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapicodedbuffer.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapicodedbuffer.Tpo -c -o libgstvaapi_la-gstvaapicodedbuffer.lo `test -f 'gstvaapicodedbuffer.c' || echo '$(srcdir)/'`gstvaapicodedbuffer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapicodedbuffer.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapicodedbuffer.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapicodedbuffer.c' object='libgstvaapi_la-gstvaapicodedbuffer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_glx_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapidisplay_glx.lo `test -f 'gstvaapidisplay_glx.c' || echo '$(srcdir)/'`gstvaapidisplay_glx.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapicodedbuffer.lo `test -f 'gstvaapicodedbuffer.c' || echo '$(srcdir)/'`gstvaapicodedbuffer.c -libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapitexture_glx.lo: gstvaapitexture_glx.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_glx_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapitexture_glx.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapitexture_glx.Tpo -c -o libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapitexture_glx.lo `test -f 'gstvaapitexture_glx.c' || echo '$(srcdir)/'`gstvaapitexture_glx.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapitexture_glx.Tpo $(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapitexture_glx.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapitexture_glx.c' object='libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapitexture_glx.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapicodedbufferpool.lo: gstvaapicodedbufferpool.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapicodedbufferpool.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapicodedbufferpool.Tpo -c -o libgstvaapi_la-gstvaapicodedbufferpool.lo `test -f 'gstvaapicodedbufferpool.c' || echo '$(srcdir)/'`gstvaapicodedbufferpool.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapicodedbufferpool.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapicodedbufferpool.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapicodedbufferpool.c' object='libgstvaapi_la-gstvaapicodedbufferpool.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_glx_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapitexture_glx.lo `test -f 'gstvaapitexture_glx.c' || echo '$(srcdir)/'`gstvaapitexture_glx.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapicodedbufferpool.lo `test -f 'gstvaapicodedbufferpool.c' || echo '$(srcdir)/'`gstvaapicodedbufferpool.c -libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils.lo: gstvaapiutils.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_glx_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils.Tpo -c -o libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils.lo `test -f 'gstvaapiutils.c' || echo '$(srcdir)/'`gstvaapiutils.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils.Tpo $(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiutils.c' object='libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapicodedbufferproxy.lo: gstvaapicodedbufferproxy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapicodedbufferproxy.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapicodedbufferproxy.Tpo -c -o libgstvaapi_la-gstvaapicodedbufferproxy.lo `test -f 'gstvaapicodedbufferproxy.c' || echo '$(srcdir)/'`gstvaapicodedbufferproxy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapicodedbufferproxy.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapicodedbufferproxy.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapicodedbufferproxy.c' object='libgstvaapi_la-gstvaapicodedbufferproxy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_glx_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils.lo `test -f 'gstvaapiutils.c' || echo '$(srcdir)/'`gstvaapiutils.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapicodedbufferproxy.lo `test -f 'gstvaapicodedbufferproxy.c' || echo '$(srcdir)/'`gstvaapicodedbufferproxy.c -libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils_glx.lo: gstvaapiutils_glx.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_glx_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils_glx.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils_glx.Tpo -c -o libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils_glx.lo `test -f 'gstvaapiutils_glx.c' || echo '$(srcdir)/'`gstvaapiutils_glx.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils_glx.Tpo $(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils_glx.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiutils_glx.c' object='libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils_glx.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapiencoder.lo: gstvaapiencoder.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapiencoder.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapiencoder.Tpo -c -o libgstvaapi_la-gstvaapiencoder.lo `test -f 'gstvaapiencoder.c' || echo '$(srcdir)/'`gstvaapiencoder.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapiencoder.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapiencoder.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiencoder.c' object='libgstvaapi_la-gstvaapiencoder.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_glx_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils_glx.lo `test -f 'gstvaapiutils_glx.c' || echo '$(srcdir)/'`gstvaapiutils_glx.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapiencoder.lo `test -f 'gstvaapiencoder.c' || echo '$(srcdir)/'`gstvaapiencoder.c -libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils_x11.lo: gstvaapiutils_x11.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_glx_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils_x11.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils_x11.Tpo -c -o libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils_x11.lo `test -f 'gstvaapiutils_x11.c' || echo '$(srcdir)/'`gstvaapiutils_x11.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils_x11.Tpo $(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils_x11.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiutils_x11.c' object='libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils_x11.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapiencoder_h264.lo: gstvaapiencoder_h264.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapiencoder_h264.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapiencoder_h264.Tpo -c -o libgstvaapi_la-gstvaapiencoder_h264.lo `test -f 'gstvaapiencoder_h264.c' || echo '$(srcdir)/'`gstvaapiencoder_h264.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapiencoder_h264.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapiencoder_h264.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiencoder_h264.c' object='libgstvaapi_la-gstvaapiencoder_h264.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_glx_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiutils_x11.lo `test -f 'gstvaapiutils_x11.c' || echo '$(srcdir)/'`gstvaapiutils_x11.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapiencoder_h264.lo `test -f 'gstvaapiencoder_h264.c' || echo '$(srcdir)/'`gstvaapiencoder_h264.c -libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiwindow_glx.lo: gstvaapiwindow_glx.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_glx_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiwindow_glx.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiwindow_glx.Tpo -c -o libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiwindow_glx.lo `test -f 'gstvaapiwindow_glx.c' || echo '$(srcdir)/'`gstvaapiwindow_glx.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiwindow_glx.Tpo $(DEPDIR)/libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiwindow_glx.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiwindow_glx.c' object='libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiwindow_glx.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapiencoder_mpeg2.lo: gstvaapiencoder_mpeg2.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapiencoder_mpeg2.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapiencoder_mpeg2.Tpo -c -o libgstvaapi_la-gstvaapiencoder_mpeg2.lo `test -f 'gstvaapiencoder_mpeg2.c' || echo '$(srcdir)/'`gstvaapiencoder_mpeg2.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapiencoder_mpeg2.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapiencoder_mpeg2.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiencoder_mpeg2.c' object='libgstvaapi_la-gstvaapiencoder_mpeg2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_glx_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_glx_@GST_API_VERSION@_la-gstvaapiwindow_glx.lo `test -f 'gstvaapiwindow_glx.c' || echo '$(srcdir)/'`gstvaapiwindow_glx.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapiencoder_mpeg2.lo `test -f 'gstvaapiencoder_mpeg2.c' || echo '$(srcdir)/'`gstvaapiencoder_mpeg2.c -libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapidisplay_wayland.lo: gstvaapidisplay_wayland.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_wayland_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapidisplay_wayland.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapidisplay_wayland.Tpo -c -o libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapidisplay_wayland.lo `test -f 'gstvaapidisplay_wayland.c' || echo '$(srcdir)/'`gstvaapidisplay_wayland.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapidisplay_wayland.Tpo $(DEPDIR)/libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapidisplay_wayland.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidisplay_wayland.c' object='libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapidisplay_wayland.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapiencoder_objects.lo: gstvaapiencoder_objects.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapiencoder_objects.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapiencoder_objects.Tpo -c -o libgstvaapi_la-gstvaapiencoder_objects.lo `test -f 'gstvaapiencoder_objects.c' || echo '$(srcdir)/'`gstvaapiencoder_objects.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapiencoder_objects.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapiencoder_objects.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiencoder_objects.c' object='libgstvaapi_la-gstvaapiencoder_objects.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_wayland_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapidisplay_wayland.lo `test -f 'gstvaapidisplay_wayland.c' || echo '$(srcdir)/'`gstvaapidisplay_wayland.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapiencoder_objects.lo `test -f 'gstvaapiencoder_objects.c' || echo '$(srcdir)/'`gstvaapiencoder_objects.c -libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapiutils.lo: gstvaapiutils.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_wayland_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapiutils.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapiutils.Tpo -c -o libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapiutils.lo `test -f 'gstvaapiutils.c' || echo '$(srcdir)/'`gstvaapiutils.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapiutils.Tpo $(DEPDIR)/libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapiutils.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiutils.c' object='libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapiutils.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapiencoder_jpeg.lo: gstvaapiencoder_jpeg.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapiencoder_jpeg.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapiencoder_jpeg.Tpo -c -o libgstvaapi_la-gstvaapiencoder_jpeg.lo `test -f 'gstvaapiencoder_jpeg.c' || echo '$(srcdir)/'`gstvaapiencoder_jpeg.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapiencoder_jpeg.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapiencoder_jpeg.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiencoder_jpeg.c' object='libgstvaapi_la-gstvaapiencoder_jpeg.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_wayland_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapiutils.lo `test -f 'gstvaapiutils.c' || echo '$(srcdir)/'`gstvaapiutils.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapiencoder_jpeg.lo `test -f 'gstvaapiencoder_jpeg.c' || echo '$(srcdir)/'`gstvaapiencoder_jpeg.c -libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapiwindow_wayland.lo: gstvaapiwindow_wayland.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_wayland_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapiwindow_wayland.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapiwindow_wayland.Tpo -c -o libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapiwindow_wayland.lo `test -f 'gstvaapiwindow_wayland.c' || echo '$(srcdir)/'`gstvaapiwindow_wayland.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapiwindow_wayland.Tpo $(DEPDIR)/libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapiwindow_wayland.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiwindow_wayland.c' object='libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapiwindow_wayland.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapiencoder_vp8.lo: gstvaapiencoder_vp8.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapiencoder_vp8.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapiencoder_vp8.Tpo -c -o libgstvaapi_la-gstvaapiencoder_vp8.lo `test -f 'gstvaapiencoder_vp8.c' || echo '$(srcdir)/'`gstvaapiencoder_vp8.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapiencoder_vp8.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapiencoder_vp8.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiencoder_vp8.c' object='libgstvaapi_la-gstvaapiencoder_vp8.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_wayland_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_wayland_@GST_API_VERSION@_la-gstvaapiwindow_wayland.lo `test -f 'gstvaapiwindow_wayland.c' || echo '$(srcdir)/'`gstvaapiwindow_wayland.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapiencoder_vp8.lo `test -f 'gstvaapiencoder_vp8.c' || echo '$(srcdir)/'`gstvaapiencoder_vp8.c -libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapidisplay_x11.lo: gstvaapidisplay_x11.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_x11_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapidisplay_x11.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapidisplay_x11.Tpo -c -o libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapidisplay_x11.lo `test -f 'gstvaapidisplay_x11.c' || echo '$(srcdir)/'`gstvaapidisplay_x11.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapidisplay_x11.Tpo $(DEPDIR)/libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapidisplay_x11.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapidisplay_x11.c' object='libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapidisplay_x11.lo' libtool=yes @AMDEPBACKSLASH@ +libgstvaapi_la-gstvaapiencoder_h265.lo: gstvaapiencoder_h265.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_la-gstvaapiencoder_h265.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_la-gstvaapiencoder_h265.Tpo -c -o libgstvaapi_la-gstvaapiencoder_h265.lo `test -f 'gstvaapiencoder_h265.c' || echo '$(srcdir)/'`gstvaapiencoder_h265.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_la-gstvaapiencoder_h265.Tpo $(DEPDIR)/libgstvaapi_la-gstvaapiencoder_h265.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiencoder_h265.c' object='libgstvaapi_la-gstvaapiencoder_h265.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_x11_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapidisplay_x11.lo `test -f 'gstvaapidisplay_x11.c' || echo '$(srcdir)/'`gstvaapidisplay_x11.c - -libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapipixmap_x11.lo: gstvaapipixmap_x11.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_x11_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapipixmap_x11.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapipixmap_x11.Tpo -c -o libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapipixmap_x11.lo `test -f 'gstvaapipixmap_x11.c' || echo '$(srcdir)/'`gstvaapipixmap_x11.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapipixmap_x11.Tpo $(DEPDIR)/libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapipixmap_x11.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapipixmap_x11.c' object='libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapipixmap_x11.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_x11_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapipixmap_x11.lo `test -f 'gstvaapipixmap_x11.c' || echo '$(srcdir)/'`gstvaapipixmap_x11.c - -libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiutils.lo: gstvaapiutils.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_x11_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiutils.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiutils.Tpo -c -o libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiutils.lo `test -f 'gstvaapiutils.c' || echo '$(srcdir)/'`gstvaapiutils.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiutils.Tpo $(DEPDIR)/libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiutils.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiutils.c' object='libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiutils.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_x11_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiutils.lo `test -f 'gstvaapiutils.c' || echo '$(srcdir)/'`gstvaapiutils.c - -libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiutils_x11.lo: gstvaapiutils_x11.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_x11_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiutils_x11.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiutils_x11.Tpo -c -o libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiutils_x11.lo `test -f 'gstvaapiutils_x11.c' || echo '$(srcdir)/'`gstvaapiutils_x11.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiutils_x11.Tpo $(DEPDIR)/libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiutils_x11.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiutils_x11.c' object='libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiutils_x11.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_x11_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiutils_x11.lo `test -f 'gstvaapiutils_x11.c' || echo '$(srcdir)/'`gstvaapiutils_x11.c - -libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiwindow_x11.lo: gstvaapiwindow_x11.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_x11_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiwindow_x11.lo -MD -MP -MF $(DEPDIR)/libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiwindow_x11.Tpo -c -o libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiwindow_x11.lo `test -f 'gstvaapiwindow_x11.c' || echo '$(srcdir)/'`gstvaapiwindow_x11.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiwindow_x11.Tpo $(DEPDIR)/libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiwindow_x11.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstvaapiwindow_x11.c' object='libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiwindow_x11.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_x11_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_x11_@GST_API_VERSION@_la-gstvaapiwindow_x11.lo `test -f 'gstvaapiwindow_x11.c' || echo '$(srcdir)/'`gstvaapiwindow_x11.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstvaapi_la_CFLAGS) $(CFLAGS) -c -o libgstvaapi_la-gstvaapiencoder_h265.lo `test -f 'gstvaapiencoder_h265.c' || echo '$(srcdir)/'`gstvaapiencoder_h265.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -install-libgstvaapi_@GST_API_VERSION@includeHEADERS: $(libgstvaapi_@GST_API_VERSION@include_HEADERS) - @$(NORMAL_INSTALL) - @list='$(libgstvaapi_@GST_API_VERSION@include_HEADERS)'; test -n "$(libgstvaapi_@GST_API_VERSION@includedir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(libgstvaapi_@GST_API_VERSION@includedir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libgstvaapi_@GST_API_VERSION@includedir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libgstvaapi_@GST_API_VERSION@includedir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgstvaapi_@GST_API_VERSION@includedir)" || exit $$?; \ - done -uninstall-libgstvaapi_@GST_API_VERSION@includeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(libgstvaapi_@GST_API_VERSION@include_HEADERS)'; test -n "$(libgstvaapi_@GST_API_VERSION@includedir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(libgstvaapi_@GST_API_VERSION@includedir)'; $(am__uninstall_files_from_dir) -install-libgstvaapi_drm_@GST_API_VERSION@includeHEADERS: $(libgstvaapi_drm_@GST_API_VERSION@include_HEADERS) - @$(NORMAL_INSTALL) - @list='$(libgstvaapi_drm_@GST_API_VERSION@include_HEADERS)'; test -n "$(libgstvaapi_drm_@GST_API_VERSION@includedir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(libgstvaapi_drm_@GST_API_VERSION@includedir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libgstvaapi_drm_@GST_API_VERSION@includedir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libgstvaapi_drm_@GST_API_VERSION@includedir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgstvaapi_drm_@GST_API_VERSION@includedir)" || exit $$?; \ - done - -uninstall-libgstvaapi_drm_@GST_API_VERSION@includeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(libgstvaapi_drm_@GST_API_VERSION@include_HEADERS)'; test -n "$(libgstvaapi_drm_@GST_API_VERSION@includedir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(libgstvaapi_drm_@GST_API_VERSION@includedir)'; $(am__uninstall_files_from_dir) -install-libgstvaapi_egl_@GST_API_VERSION@includeHEADERS: $(libgstvaapi_egl_@GST_API_VERSION@include_HEADERS) - @$(NORMAL_INSTALL) - @list='$(libgstvaapi_egl_@GST_API_VERSION@include_HEADERS)'; test -n "$(libgstvaapi_egl_@GST_API_VERSION@includedir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(libgstvaapi_egl_@GST_API_VERSION@includedir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libgstvaapi_egl_@GST_API_VERSION@includedir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libgstvaapi_egl_@GST_API_VERSION@includedir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgstvaapi_egl_@GST_API_VERSION@includedir)" || exit $$?; \ - done - -uninstall-libgstvaapi_egl_@GST_API_VERSION@includeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(libgstvaapi_egl_@GST_API_VERSION@include_HEADERS)'; test -n "$(libgstvaapi_egl_@GST_API_VERSION@includedir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(libgstvaapi_egl_@GST_API_VERSION@includedir)'; $(am__uninstall_files_from_dir) -install-libgstvaapi_glx_@GST_API_VERSION@includeHEADERS: $(libgstvaapi_glx_@GST_API_VERSION@include_HEADERS) - @$(NORMAL_INSTALL) - @list='$(libgstvaapi_glx_@GST_API_VERSION@include_HEADERS)'; test -n "$(libgstvaapi_glx_@GST_API_VERSION@includedir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(libgstvaapi_glx_@GST_API_VERSION@includedir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libgstvaapi_glx_@GST_API_VERSION@includedir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libgstvaapi_glx_@GST_API_VERSION@includedir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgstvaapi_glx_@GST_API_VERSION@includedir)" || exit $$?; \ - done - -uninstall-libgstvaapi_glx_@GST_API_VERSION@includeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(libgstvaapi_glx_@GST_API_VERSION@include_HEADERS)'; test -n "$(libgstvaapi_glx_@GST_API_VERSION@includedir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(libgstvaapi_glx_@GST_API_VERSION@includedir)'; $(am__uninstall_files_from_dir) -install-libgstvaapi_wayland_@GST_API_VERSION@includeHEADERS: $(libgstvaapi_wayland_@GST_API_VERSION@include_HEADERS) - @$(NORMAL_INSTALL) - @list='$(libgstvaapi_wayland_@GST_API_VERSION@include_HEADERS)'; test -n "$(libgstvaapi_wayland_@GST_API_VERSION@includedir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(libgstvaapi_wayland_@GST_API_VERSION@includedir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libgstvaapi_wayland_@GST_API_VERSION@includedir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libgstvaapi_wayland_@GST_API_VERSION@includedir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgstvaapi_wayland_@GST_API_VERSION@includedir)" || exit $$?; \ - done - -uninstall-libgstvaapi_wayland_@GST_API_VERSION@includeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(libgstvaapi_wayland_@GST_API_VERSION@include_HEADERS)'; test -n "$(libgstvaapi_wayland_@GST_API_VERSION@includedir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(libgstvaapi_wayland_@GST_API_VERSION@includedir)'; $(am__uninstall_files_from_dir) -install-libgstvaapi_x11_@GST_API_VERSION@includeHEADERS: $(libgstvaapi_x11_@GST_API_VERSION@include_HEADERS) - @$(NORMAL_INSTALL) - @list='$(libgstvaapi_x11_@GST_API_VERSION@include_HEADERS)'; test -n "$(libgstvaapi_x11_@GST_API_VERSION@includedir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(libgstvaapi_x11_@GST_API_VERSION@includedir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libgstvaapi_x11_@GST_API_VERSION@includedir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libgstvaapi_x11_@GST_API_VERSION@includedir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgstvaapi_x11_@GST_API_VERSION@includedir)" || exit $$?; \ - done - -uninstall-libgstvaapi_x11_@GST_API_VERSION@includeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(libgstvaapi_x11_@GST_API_VERSION@include_HEADERS)'; test -n "$(libgstvaapi_x11_@GST_API_VERSION@includedir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(libgstvaapi_x11_@GST_API_VERSION@includedir)'; $(am__uninstall_files_from_dir) -tags TAGS: - -ctags CTAGS: +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am -cscope cscopelist: +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -2031,11 +1793,8 @@ check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am -all-am: Makefile $(LTLIBRARIES) $(HEADERS) +all-am: Makefile $(LTLIBRARIES) installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libgstvaapi_@GST_API_VERSION@includedir)" "$(DESTDIR)$(libgstvaapi_drm_@GST_API_VERSION@includedir)" "$(DESTDIR)$(libgstvaapi_egl_@GST_API_VERSION@includedir)" "$(DESTDIR)$(libgstvaapi_glx_@GST_API_VERSION@includedir)" "$(DESTDIR)$(libgstvaapi_wayland_@GST_API_VERSION@includedir)" "$(DESTDIR)$(libgstvaapi_x11_@GST_API_VERSION@includedir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am @@ -2072,13 +1831,14 @@ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags dvi: dvi-am @@ -2092,18 +1852,13 @@ info-am: -install-data-am: install-libgstvaapi_@GST_API_VERSION@includeHEADERS \ - install-libgstvaapi_drm_@GST_API_VERSION@includeHEADERS \ - install-libgstvaapi_egl_@GST_API_VERSION@includeHEADERS \ - install-libgstvaapi_glx_@GST_API_VERSION@includeHEADERS \ - install-libgstvaapi_wayland_@GST_API_VERSION@includeHEADERS \ - install-libgstvaapi_x11_@GST_API_VERSION@includeHEADERS +install-data-am: install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-libLTLIBRARIES +install-exec-am: install-html: install-html-am @@ -2143,42 +1898,23 @@ ps-am: -uninstall-am: uninstall-libLTLIBRARIES \ - uninstall-libgstvaapi_@GST_API_VERSION@includeHEADERS \ - uninstall-libgstvaapi_drm_@GST_API_VERSION@includeHEADERS \ - uninstall-libgstvaapi_egl_@GST_API_VERSION@includeHEADERS \ - uninstall-libgstvaapi_glx_@GST_API_VERSION@includeHEADERS \ - uninstall-libgstvaapi_wayland_@GST_API_VERSION@includeHEADERS \ - uninstall-libgstvaapi_x11_@GST_API_VERSION@includeHEADERS +uninstall-am: .MAKE: all check install install-am install-strip -.PHONY: all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool cscopelist-am ctags-am \ - distclean distclean-compile distclean-generic \ - distclean-libtool distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am \ - install-libLTLIBRARIES \ - install-libgstvaapi_@GST_API_VERSION@includeHEADERS \ - install-libgstvaapi_drm_@GST_API_VERSION@includeHEADERS \ - install-libgstvaapi_egl_@GST_API_VERSION@includeHEADERS \ - install-libgstvaapi_glx_@GST_API_VERSION@includeHEADERS \ - install-libgstvaapi_wayland_@GST_API_VERSION@includeHEADERS \ - install-libgstvaapi_x11_@GST_API_VERSION@includeHEADERS \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ - uninstall-am uninstall-libLTLIBRARIES \ - uninstall-libgstvaapi_@GST_API_VERSION@includeHEADERS \ - uninstall-libgstvaapi_drm_@GST_API_VERSION@includeHEADERS \ - uninstall-libgstvaapi_egl_@GST_API_VERSION@includeHEADERS \ - uninstall-libgstvaapi_glx_@GST_API_VERSION@includeHEADERS \ - uninstall-libgstvaapi_wayland_@GST_API_VERSION@includeHEADERS \ - uninstall-libgstvaapi_x11_@GST_API_VERSION@includeHEADERS +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am .PRECIOUS: Makefile diff -Nru gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/.VERSION.pkg gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/.VERSION.pkg --- gstreamer-vaapi-0.7.0/gst-libs/gst/vaapi/.VERSION.pkg 2015-12-07 11:01:18.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/gst/vaapi/.VERSION.pkg 2016-06-09 08:37:50.000000000 +0000 @@ -1 +0,0 @@ -0.7.0 diff -Nru gstreamer-vaapi-0.7.0/gst-libs/Makefile.in gstreamer-vaapi-1.8.2/gst-libs/Makefile.in --- gstreamer-vaapi-0.7.0/gst-libs/Makefile.in 2015-12-07 10:54:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gst-libs/Makefile.in 2016-06-09 07:27:12.000000000 +0000 @@ -90,10 +90,27 @@ target_triplet = @target@ subdir = gst-libs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-arch.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-platform.m4 \ + $(top_srcdir)/common/m4/gst-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -184,9 +201,11 @@ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ +AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -199,6 +218,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DRM_CFLAGS = @DRM_CFLAGS@ @@ -211,58 +231,64 @@ EGL_CFLAGS = @EGL_CFLAGS@ EGL_LIBS = @EGL_LIBS@ EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ GIT = @GIT@ GLES2_CFLAGS = @GLES2_CFLAGS@ GLES2_LIBS = @GLES2_LIBS@ GLES3_CFLAGS = @GLES3_CFLAGS@ GLES3_LIBS = @GLES3_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ -GLIB_VERSION_REQUIRED = @GLIB_VERSION_REQUIRED@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ -GMODULE_VERSION_REQUIRED = @GMODULE_VERSION_REQUIRED@ GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ GST_API_VERSION = @GST_API_VERSION@ -GST_BASEVIDEO_CFLAGS = @GST_BASEVIDEO_CFLAGS@ -GST_BASEVIDEO_LIBS = @GST_BASEVIDEO_LIBS@ GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ GST_BASE_LIBS = @GST_BASE_LIBS@ GST_CFLAGS = @GST_CFLAGS@ GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ +GST_CURRENT = @GST_CURRENT@ GST_GL_CFLAGS = @GST_GL_CFLAGS@ GST_GL_LIBS = @GST_GL_LIBS@ -GST_INTERFACES_CFLAGS = @GST_INTERFACES_CFLAGS@ -GST_INTERFACES_LIBS = @GST_INTERFACES_LIBS@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ GST_LIBS = @GST_LIBS@ -GST_PKG_VERSION = @GST_PKG_VERSION@ -GST_PLUGINS_BAD_VERSION_REQUIRED = @GST_PLUGINS_BAD_VERSION_REQUIRED@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PBUTILS_CFLAGS = @GST_PBUTILS_CFLAGS@ +GST_PBUTILS_LIBS = @GST_PBUTILS_LIBS@ GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ -GST_PLUGINS_BASE_VERSION_REQUIRED = @GST_PLUGINS_BASE_VERSION_REQUIRED@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ -GST_PLUGIN_PATH_1_0 = @GST_PLUGIN_PATH_1_0@ -GST_VAAPI_LT_LDFLAGS = @GST_VAAPI_LT_LDFLAGS@ -GST_VAAPI_LT_VERSION = @GST_VAAPI_LT_VERSION@ -GST_VAAPI_MAJOR_VERSION = @GST_VAAPI_MAJOR_VERSION@ -GST_VERSION_REQUIRED = @GST_VERSION_REQUIRED@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ -GTKDOC_VERSION = @GTKDOC_VERSION@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -271,6 +297,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -278,16 +305,15 @@ LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ LIBVA_LIBS = @LIBVA_LIBS@ -LIBVA_PACKAGE_VERSION = @LIBVA_PACKAGE_VERSION@ -LIBVA_PKGNAME = @LIBVA_PKGNAME@ LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ -LIBVA_X11_PKGNAME = @LIBVA_X11_PKGNAME@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -304,21 +330,27 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ -PATCH = @PATCH@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ -TODAY = @TODAY@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ VERSION = @VERSION@ -WAYLAND_API_VERSION = @WAYLAND_API_VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ WAYLAND_LIBS = @WAYLAND_LIBS@ X11_CFLAGS = @X11_CFLAGS@ @@ -327,7 +359,6 @@ XRANDR_LIBS = @XRANDR_LIBS@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ -YASM = @YASM@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -369,11 +400,15 @@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ plugindir = @plugindir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -390,7 +425,7 @@ all: all-recursive .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -414,9 +449,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff -Nru gstreamer-vaapi-0.7.0/gstreamer-vaapi.doap gstreamer-vaapi-1.8.2/gstreamer-vaapi.doap --- gstreamer-vaapi-0.7.0/gstreamer-vaapi.doap 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gstreamer-vaapi.doap 2016-06-09 07:13:38.000000000 +0000 @@ -0,0 +1,93 @@ + + + GStreamer VA-API + gstreamer-vaapi + a set of VA-API based elements for GStreamer + + GStreamer VA-API is a collection of VA-API based plugin with video + processing elements for GStreamer. + + + + + C + + + + + + + + + + + + 1.8.2 + 1.8 + 2016-06-09 + + + + + + + 1.8.1 + 1.8 + 2016-04-20 + + + + + + + 1.8.0 + master + 2016-03-24 + + + + + + + 1.7.91 + master + 2016-03-15 + + + + + + + 1.7.90 + master + 2016-03-01 + + + + + + + 1.6.0 + master + 2016-02-14 + + + + + + + Sreerenj Balachandran + + + + + Victor Jaquez + + > + + diff -Nru gstreamer-vaapi-0.7.0/gtk-doc.make gstreamer-vaapi-1.8.2/gtk-doc.make --- gstreamer-vaapi-0.7.0/gtk-doc.make 2015-06-08 17:17:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/gtk-doc.make 1970-01-01 00:00:00.000000000 +0000 @@ -1,293 +0,0 @@ -# -*- mode: makefile -*- - -#################################### -# Everything below here is generic # -#################################### - -if GTK_DOC_USE_LIBTOOL -GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -GTKDOC_RUN = $(LIBTOOL) --mode=execute -else -GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -GTKDOC_RUN = -endif - -# We set GPATH here; this gives us semantics for GNU make -# which are more like other make's VPATH, when it comes to -# whether a source that is a target of one rule is then -# searched for in VPATH/GPATH. -# -GPATH = $(srcdir) - -TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) - -SETUP_FILES = \ - $(content_files) \ - $(expand_content_files) \ - $(DOC_MAIN_SGML_FILE) \ - $(DOC_MODULE)-sections.txt \ - $(DOC_MODULE)-overrides.txt - -EXTRA_DIST = \ - $(HTML_IMAGES) \ - $(SETUP_FILES) - -DOC_STAMPS=setup-build.stamp scan-build.stamp sgml-build.stamp \ - html-build.stamp pdf-build.stamp \ - sgml.stamp html.stamp pdf.stamp - -SCANOBJ_FILES = \ - $(DOC_MODULE).args \ - $(DOC_MODULE).hierarchy \ - $(DOC_MODULE).interfaces \ - $(DOC_MODULE).prerequisites \ - $(DOC_MODULE).signals - -REPORT_FILES = \ - $(DOC_MODULE)-undocumented.txt \ - $(DOC_MODULE)-undeclared.txt \ - $(DOC_MODULE)-unused.txt - -gtkdoc-check.test: Makefile - $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ - echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ - chmod +x $@ - -CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test - -if GTK_DOC_BUILD_HTML -HTML_BUILD_STAMP=html-build.stamp -else -HTML_BUILD_STAMP= -endif -if GTK_DOC_BUILD_PDF -PDF_BUILD_STAMP=pdf-build.stamp -else -PDF_BUILD_STAMP= -endif - -all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) -.PHONY: all-gtk-doc - -if ENABLE_GTK_DOC -all-local: all-gtk-doc -endif - -docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) - -$(REPORT_FILES): sgml-build.stamp - -#### setup #### - -GTK_DOC_V_SETUP=$(GTK_DOC_V_SETUP_$(V)) -GTK_DOC_V_SETUP_=$(GTK_DOC_V_SETUP_$(AM_DEFAULT_VERBOSITY)) -GTK_DOC_V_SETUP_0=@echo " DOC Preparing build"; - -setup-build.stamp: - -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ - files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ - if test "x$$files" != "x" ; then \ - for file in $$files ; do \ - destdir=`dirname $(abs_builddir)/$$file`; \ - test -d "$$destdir" || mkdir -p "$$destdir"; \ - test -f $(abs_srcdir)/$$file && \ - cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ - done; \ - fi; \ - fi - $(AM_V_at)touch setup-build.stamp - - -#### scan #### - -GTK_DOC_V_SCAN=$(GTK_DOC_V_SCAN_$(V)) -GTK_DOC_V_SCAN_=$(GTK_DOC_V_SCAN_$(AM_DEFAULT_VERBOSITY)) -GTK_DOC_V_SCAN_0=@echo " DOC Scanning header files"; - -GTK_DOC_V_INTROSPECT=$(GTK_DOC_V_INTROSPECT_$(V)) -GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY)) -GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects"; - -scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) - $(GTK_DOC_V_SCAN)_source_dir='' ; \ - for i in $(DOC_SOURCE_DIR) ; do \ - _source_dir="$${_source_dir} --source-dir=$$i" ; \ - done ; \ - gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) - $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ - scanobj_options=""; \ - gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ - if test "$$?" = "0"; then \ - if test "x$(V)" = "x1"; then \ - scanobj_options="--verbose"; \ - fi; \ - fi; \ - CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ - gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ - else \ - for i in $(SCANOBJ_FILES) ; do \ - test -f $$i || touch $$i ; \ - done \ - fi - $(AM_V_at)touch scan-build.stamp - -$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp - @true - -#### xml #### - -GTK_DOC_V_XML=$(GTK_DOC_V_XML_$(V)) -GTK_DOC_V_XML_=$(GTK_DOC_V_XML_$(AM_DEFAULT_VERBOSITY)) -GTK_DOC_V_XML_0=@echo " DOC Building XML"; - -sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) - $(GTK_DOC_V_XML)_source_dir='' ; \ - for i in $(DOC_SOURCE_DIR) ; do \ - _source_dir="$${_source_dir} --source-dir=$$i" ; \ - done ; \ - gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) - $(AM_V_at)touch sgml-build.stamp - -sgml.stamp: sgml-build.stamp - @true - -#### html #### - -GTK_DOC_V_HTML=$(GTK_DOC_V_HTML_$(V)) -GTK_DOC_V_HTML_=$(GTK_DOC_V_HTML_$(AM_DEFAULT_VERBOSITY)) -GTK_DOC_V_HTML_0=@echo " DOC Building HTML"; - -GTK_DOC_V_XREF=$(GTK_DOC_V_XREF_$(V)) -GTK_DOC_V_XREF_=$(GTK_DOC_V_XREF_$(AM_DEFAULT_VERBOSITY)) -GTK_DOC_V_XREF_0=@echo " DOC Fixing cross-references"; - -html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) - $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ - mkhtml_options=""; \ - gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ - if test "$$?" = "0"; then \ - if test "x$(V)" = "x1"; then \ - mkhtml_options="$$mkhtml_options --verbose"; \ - fi; \ - fi; \ - gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ - if test "$$?" = "0"; then \ - mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ - fi; \ - cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) - -@test "x$(HTML_IMAGES)" = "x" || \ - for file in $(HTML_IMAGES) ; do \ - if test -f $(abs_srcdir)/$$file ; then \ - cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ - fi; \ - if test -f $(abs_builddir)/$$file ; then \ - cp $(abs_builddir)/$$file $(abs_builddir)/html; \ - fi; \ - done; - $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) - $(AM_V_at)touch html-build.stamp - -#### pdf #### - -GTK_DOC_V_PDF=$(GTK_DOC_V_PDF_$(V)) -GTK_DOC_V_PDF_=$(GTK_DOC_V_PDF_$(AM_DEFAULT_VERBOSITY)) -GTK_DOC_V_PDF_0=@echo " DOC Building PDF"; - -pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) - $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ - mkpdf_options=""; \ - gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ - if test "$$?" = "0"; then \ - if test "x$(V)" = "x1"; then \ - mkpdf_options="$$mkpdf_options --verbose"; \ - fi; \ - fi; \ - if test "x$(HTML_IMAGES)" != "x"; then \ - for img in $(HTML_IMAGES); do \ - part=`dirname $$img`; \ - echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ - if test $$? != 0; then \ - mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ - fi; \ - done; \ - fi; \ - gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) - $(AM_V_at)touch pdf-build.stamp - -############## - -clean-local: - @rm -f *~ *.bak - @rm -rf .libs - @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \ - rm -f $(DOC_MODULE).types; \ - fi - @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-sections" ; then \ - rm -f $(DOC_MODULE)-sections.txt; \ - fi - -distclean-local: - @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ - $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt - @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ - rm -f $(SETUP_FILES) $(DOC_MODULE).types; \ - fi - -maintainer-clean-local: - @rm -rf xml html - -install-data-local: - @installfiles=`echo $(builddir)/html/*`; \ - if test "$$installfiles" = '$(builddir)/html/*'; \ - then echo 1>&2 'Nothing to install' ; \ - else \ - if test -n "$(DOC_MODULE_VERSION)"; then \ - installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ - else \ - installdir="$(DESTDIR)$(TARGET_DIR)"; \ - fi; \ - $(mkinstalldirs) $${installdir} ; \ - for i in $$installfiles; do \ - echo ' $(INSTALL_DATA) '$$i ; \ - $(INSTALL_DATA) $$i $${installdir}; \ - done; \ - if test -n "$(DOC_MODULE_VERSION)"; then \ - mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ - $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ - fi; \ - $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ - fi - -uninstall-local: - @if test -n "$(DOC_MODULE_VERSION)"; then \ - installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ - else \ - installdir="$(DESTDIR)$(TARGET_DIR)"; \ - fi; \ - rm -rf $${installdir} - -# -# Require gtk-doc when making dist -# -if HAVE_GTK_DOC -dist-check-gtkdoc: docs -else -dist-check-gtkdoc: - @echo "*** gtk-doc is needed to run 'make dist'. ***" - @echo "*** gtk-doc was not found when 'configure' ran. ***" - @echo "*** please install gtk-doc and rerun 'configure'. ***" - @false -endif - -dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local - @mkdir $(distdir)/html - @cp ./html/* $(distdir)/html - @-cp ./$(DOC_MODULE).pdf $(distdir)/ - @-cp ./$(DOC_MODULE).types $(distdir)/ - @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ - @cd $(distdir) && rm -f $(DISTCLEANFILES) - @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html - -.PHONY : dist-hook-local docs diff -Nru gstreamer-vaapi-0.7.0/INSTALL gstreamer-vaapi-1.8.2/INSTALL --- gstreamer-vaapi-0.7.0/INSTALL 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/INSTALL 2016-06-09 07:27:12.000000000 +0000 @@ -0,0 +1,370 @@ +Installation Instructions +************************* + +Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, +Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell command `./configure && make && make install' +should configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + + The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type `make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + HP-UX `make' updates targets which have the same time stamps as +their prerequisites, which makes it generally unusable when shipped +generated files such as `configure' are involved. Use GNU `make' +instead. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf limitation. Until the limitation is lifted, you can use +this workaround: + + CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. diff -Nru gstreamer-vaapi-0.7.0/m4/gtk-doc.m4 gstreamer-vaapi-1.8.2/m4/gtk-doc.m4 --- gstreamer-vaapi-0.7.0/m4/gtk-doc.m4 2015-06-08 17:17:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/m4/gtk-doc.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -dnl -*- mode: autoconf -*- - -# serial 2 - -dnl Usage: -dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) -AC_DEFUN([GTK_DOC_CHECK], -[ - AC_REQUIRE([PKG_PROG_PKG_CONFIG]) - AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first - AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first - - ifelse([$1],[],[gtk_doc_requires="gtk-doc"],[gtk_doc_requires="gtk-doc >= $1"]) - AC_MSG_CHECKING([for gtk-doc]) - PKG_CHECK_EXISTS([$gtk_doc_requires],[have_gtk_doc=yes],[have_gtk_doc=no]) - AC_MSG_RESULT($have_gtk_doc) - - if test "$have_gtk_doc" = "no"; then - AC_MSG_WARN([ - You will not be able to create source packages with 'make dist' - because $gtk_doc_requires is not found.]) - fi - - dnl check for tools we added during development - dnl Use AC_CHECK_PROG to avoid the check target using an absolute path that - dnl may not be writable by the user. Currently, automake requires that the - dnl test name must end in '.test'. - dnl https://bugzilla.gnome.org/show_bug.cgi?id=701638 - AC_CHECK_PROG([GTKDOC_CHECK],[gtkdoc-check],[gtkdoc-check.test]) - AC_PATH_PROG([GTKDOC_CHECK_PATH],[gtkdoc-check]) - AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) - AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) - - dnl for overriding the documentation installation directory - AC_ARG_WITH([html-dir], - AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, - [with_html_dir='${datadir}/gtk-doc/html']) - HTML_DIR="$with_html_dir" - AC_SUBST([HTML_DIR]) - - dnl enable/disable documentation building - AC_ARG_ENABLE([gtk-doc], - AS_HELP_STRING([--enable-gtk-doc], - [use gtk-doc to build documentation [[default=no]]]),, - [enable_gtk_doc=no]) - - AC_MSG_CHECKING([whether to build gtk-doc documentation]) - AC_MSG_RESULT($enable_gtk_doc) - - if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then - AC_MSG_ERROR([ - You must have $gtk_doc_requires installed to build documentation for - $PACKAGE_NAME. Please install gtk-doc or disable building the - documentation by adding '--disable-gtk-doc' to '[$]0'.]) - fi - - dnl don't check for glib if we build glib - if test "x$PACKAGE_NAME" != "xglib"; then - dnl don't fail if someone does not have glib - PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,[:]) - fi - - dnl enable/disable output formats - AC_ARG_ENABLE([gtk-doc-html], - AS_HELP_STRING([--enable-gtk-doc-html], - [build documentation in html format [[default=yes]]]),, - [enable_gtk_doc_html=yes]) - AC_ARG_ENABLE([gtk-doc-pdf], - AS_HELP_STRING([--enable-gtk-doc-pdf], - [build documentation in pdf format [[default=no]]]),, - [enable_gtk_doc_pdf=no]) - - if test -z "$GTKDOC_MKPDF"; then - enable_gtk_doc_pdf=no - fi - - if test -z "$AM_DEFAULT_VERBOSITY"; then - AM_DEFAULT_VERBOSITY=1 - fi - AC_SUBST([AM_DEFAULT_VERBOSITY]) - - AM_CONDITIONAL([HAVE_GTK_DOC], [test x$have_gtk_doc = xyes]) - AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) - AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) - AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) - AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) - AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"]) -]) diff -Nru gstreamer-vaapi-0.7.0/m4/libtool.m4 gstreamer-vaapi-1.8.2/m4/libtool.m4 --- gstreamer-vaapi-0.7.0/m4/libtool.m4 2015-12-07 10:54:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/m4/libtool.m4 2016-06-09 07:27:08.000000000 +0000 @@ -1,8 +1,6 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -10,36 +8,30 @@ # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool 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. +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool 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 of the License, or +# (at your option) any later version. # -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. # -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of +# GNU Libtool is distributed in the hope that 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 GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . ]) -# serial 57 LT_INIT +# serial 58 LT_INIT # LT_PREREQ(VERSION) @@ -67,7 +59,7 @@ # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl @@ -91,7 +83,7 @@ _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" +LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -111,26 +103,43 @@ dnl AC_DEFUN([AM_PROG_LIBTOOL], []) +# _LT_PREPARE_CC_BASENAME +# ----------------------- +m4_defun([_LT_PREPARE_CC_BASENAME], [ +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in @S|@*""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} +])# _LT_PREPARE_CC_BASENAME + + # _LT_CC_BASENAME(CC) # ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, +# but that macro is also expanded into generated libtool script, which +# arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +[m4_require([_LT_PREPARE_CC_BASENAME])dnl +AC_REQUIRE([_LT_DECL_SED])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +func_cc_basename $1 +cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set -# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} @@ -177,15 +186,16 @@ m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl +m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ -# See if we are running on zsh, and set the options which allow our +# See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then +if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) -if test -n "${ZSH_VERSION+set}" ; then +if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi @@ -198,7 +208,7 @@ # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then + if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -209,14 +219,14 @@ ofile=libtool can_build_shared=yes -# All known linkers require a `.a' archive for static linking (except MSVC, +# All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a -with_gnu_ld="$lt_cv_prog_gnu_ld" +with_gnu_ld=$lt_cv_prog_gnu_ld -old_CC="$CC" -old_CFLAGS="$CFLAGS" +old_CC=$CC +old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc @@ -269,14 +279,14 @@ # _LT_PROG_LTMAIN # --------------- -# Note that this code is called both from `configure', and `config.status' +# Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# `config.status' has no value for ac_aux_dir unless we are using Automake, +# 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -ltmain="$ac_aux_dir/ltmain.sh" +ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN @@ -286,7 +296,7 @@ # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS -# in macros and then make a single call at the end using the `libtool' +# in macros and then make a single call at the end using the 'libtool' # label. @@ -421,8 +431,8 @@ # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ -# Quote a variable value, and forward it to `config.status' so that its -# declaration there will have the same value as in `configure'. VARNAME +# Quote a variable value, and forward it to 'config.status' so that its +# declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) @@ -446,7 +456,7 @@ # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl -available_tags="_LT_TAGS"dnl +available_tags='_LT_TAGS'dnl ]) @@ -474,7 +484,7 @@ # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables -# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], @@ -500,8 +510,8 @@ # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations -# into `config.status', and then the shell code to quote escape them in -# for loops in `config.status'. Finally, any additional code accumulated +# into 'config.status', and then the shell code to quote escape them in +# for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], @@ -547,7 +557,7 @@ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -560,7 +570,7 @@ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -576,7 +586,7 @@ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the -# `#!' sequence but before initialization text begins. After this +# '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). @@ -598,7 +608,7 @@ _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF -test $lt_write_fail = 0 && chmod +x $1[]dnl +test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT @@ -621,7 +631,7 @@ } >&AS_MESSAGE_LOG_FD lt_cl_help="\ -\`$as_me' creates a local libtool stub from the current configuration, +'$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. @@ -643,7 +653,7 @@ This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." -while test $[#] != 0 +while test 0 != $[#] do case $[1] in --version | --v* | -V ) @@ -656,10 +666,10 @@ lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] -Try \`$[0] --help' for more information.]) ;; +Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] -Try \`$[0] --help' for more information.]) ;; +Try '$[0] --help' for more information.]) ;; esac shift done @@ -685,7 +695,7 @@ # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: -test "$silent" = yes && +test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false @@ -705,27 +715,31 @@ _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ - # See if we are running on zsh, and set the options which allow our + # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then + if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi - cfgfile="${ofile}T" + cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. -# + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + _LT_COPYING _LT_LIBTOOL_TAGS +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS @@ -733,13 +747,24 @@ _LT_EOF + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +_LT_PREPARE_MUNGE_PATH_LIST +_LT_PREPARE_CC_BASENAME + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then +if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -756,8 +781,6 @@ sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) - _LT_PROG_REPLACE_SHELLFNS - mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" @@ -775,7 +798,6 @@ [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS @@ -974,7 +996,7 @@ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then + if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the @@ -992,7 +1014,7 @@ cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. - elif test -f libconftest.dylib && test $_lt_result -eq 0; then + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1010,7 +1032,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], @@ -1032,7 +1054,7 @@ _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD - elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1042,32 +1064,32 @@ ]) case $host_os in rhapsody* | darwin1.[[012]]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[[012]]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[[012]][[,.]]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then + if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -1087,29 +1109,29 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + if test yes = "$lt_cv_ld_force_load"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; + ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac - if test "$_lt_dar_can_shared" = "yes"; then + if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all - _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], -[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then - _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" +[ if test yes != "$lt_cv_apple_cc_single_mod"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else @@ -1129,7 +1151,7 @@ # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl -if test "${lt_cv_aix_libpath+set}" = set; then +if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], @@ -1147,7 +1169,7 @@ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) @@ -1167,8 +1189,8 @@ # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start -# of the generated configure script which will find a shell with a builtin -# printf (which we can use as an echo command). +# of the generated configure script that will find a shell with a builtin +# printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO @@ -1196,10 +1218,10 @@ # Invoke $ECHO with all args, space-separated. func_echo_all () { - $ECHO "$*" + $ECHO "$*" } -case "$ECHO" in +case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; @@ -1225,16 +1247,17 @@ AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], -[ --with-sysroot[=DIR] Search for dependent libraries within DIR - (or the compiler's sysroot if not specified).], +[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], + [Search for dependent libraries within DIR (or the compiler's sysroot + if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= -case ${with_sysroot} in #( +case $with_sysroot in #( yes) - if test "$GCC" = yes; then + if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( @@ -1244,14 +1267,14 @@ no|'') ;; #( *) - AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl -[dependent libraries, and in which our libraries should be installed.])]) +[dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- @@ -1259,31 +1282,33 @@ [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes +test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) - HPUX_IA64_MODE="32" + HPUX_IA64_MODE=32 ;; *ELF-64*) - HPUX_IA64_MODE="64" + HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then + if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" @@ -1312,9 +1337,46 @@ rm -rf conftest* ;; +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in @@ -1333,10 +1395,10 @@ ;; esac ;; - powerpc64le-*) + powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; - powerpc64-*) + powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -1355,10 +1417,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - powerpcle-*) + powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; - powerpc-*) + powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -1376,19 +1438,20 @@ *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" + SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then + if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" + CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in @@ -1396,7 +1459,7 @@ case $lt_cv_prog_gnu_ld in yes*) case $host in - i?86-*-solaris*) + i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) @@ -1405,7 +1468,7 @@ esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD="${LD-ld}_sol2" + LD=${LD-ld}_sol2 fi ;; *) @@ -1421,7 +1484,7 @@ ;; esac -need_locks="$enable_libtool_lock" +need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK @@ -1440,11 +1503,11 @@ [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) - if test "$ac_status" -eq 0; then + if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) - if test "$ac_status" -ne 0; then + if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi @@ -1452,7 +1515,7 @@ ]) ]) -if test "x$lt_cv_ar_at_file" = xno; then +if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file @@ -1483,7 +1546,7 @@ if test -n "$RANLIB"; then case $host_os in - openbsd*) + bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) @@ -1519,7 +1582,7 @@ [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" + lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -1546,7 +1609,7 @@ $RM conftest* ]) -if test x"[$]$2" = xyes; then +if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) @@ -1568,7 +1631,7 @@ m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then @@ -1587,10 +1650,10 @@ fi fi $RM -r conftest* - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS ]) -if test x"[$]$2" = xyes; then +if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) @@ -1611,7 +1674,7 @@ AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 - teststring="ABCD" + teststring=ABCD case $build_os in msdosdjgpp*) @@ -1651,7 +1714,7 @@ lt_cv_sys_max_cmd_len=8192; ;; - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -1702,22 +1765,22 @@ *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do + for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough + test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring @@ -1733,7 +1796,7 @@ ;; esac ]) -if test -n $lt_cv_sys_max_cmd_len ; then +if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) @@ -1761,7 +1824,7 @@ # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl -if test "$cross_compiling" = yes; then : +if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -1808,9 +1871,9 @@ # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated +/* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif @@ -1836,7 +1899,7 @@ return status; }] _LT_EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in @@ -1857,7 +1920,7 @@ # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then +if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown @@ -1867,44 +1930,52 @@ case $host_os in beos*) - lt_cv_dlopen="load_add_on" + lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) - lt_cv_dlopen="dlopen" + lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) - # if libdl is installed we need to link against it + # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ + lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + *) AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], + [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], + [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) @@ -1913,21 +1984,21 @@ ;; esac - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else + if test no = "$lt_cv_dlopen"; then enable_dlopen=no + else + enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - save_LIBS="$LIBS" + save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], @@ -1937,7 +2008,7 @@ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) - if test "x$lt_cv_dlopen_self" = xyes; then + if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl @@ -1947,9 +2018,9 @@ ]) fi - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS ;; esac @@ -2041,8 +2112,8 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) -hard_links="nottested" -if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then +hard_links=nottested +if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes @@ -2052,8 +2123,8 @@ ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + if test no = "$hard_links"; then + AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else @@ -2080,8 +2151,8 @@ _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl -AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", - [Define to the sub-directory in which libtool stores uninstalled libraries.]) +AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", + [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR @@ -2093,15 +2164,15 @@ _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || - test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. - if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && + test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else @@ -2115,12 +2186,12 @@ fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) -if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || - test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then +if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || + test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi @@ -2144,7 +2215,7 @@ # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) - if test -n "$STRIP" ; then + if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) @@ -2162,6 +2233,47 @@ ])# _LT_CMD_STRIPLIB +# _LT_PREPARE_MUNGE_PATH_LIST +# --------------------------- +# Make sure func_munge_path_list() is defined correctly. +m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], +[[# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x@S|@2 in + x) + ;; + *:) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" + ;; + x:*) + eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" + ;; + *) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + esac +} +]])# _LT_PREPARE_PATH_LIST + + # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics @@ -2172,17 +2284,18 @@ m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ -if test "$GCC" = yes; then +if test yes = "$GCC"; then case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; + mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in @@ -2198,28 +2311,35 @@ ;; esac # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. + # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; + lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } @@ -2233,7 +2353,7 @@ # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else @@ -2242,7 +2362,7 @@ library_names_spec= libname_spec='lib$name' soname_spec= -shrext_cmds=".so" +shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= @@ -2259,14 +2379,17 @@ # flags to be left without arguments need_version=unknown +AC_ARG_VAR([LT_SYS_LIBRARY_PATH], +[User-defined run-time library search path.]) + case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' + soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) @@ -2274,41 +2397,91 @@ need_lib_prefix=no need_version=no hardcode_into_libs=yes - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac shlibpath_var=LIBPATH fi ;; @@ -2318,18 +2491,18 @@ powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) - library_names_spec='${libname}${shared_ext}' + library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; @@ -2337,8 +2510,8 @@ bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" @@ -2350,7 +2523,7 @@ cygwin* | mingw* | pw32* | cegcc*) version_type=windows - shrext_cmds=".dll" + shrext_cmds=.dll need_version=no need_lib_prefix=no @@ -2359,8 +2532,8 @@ # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ @@ -2376,17 +2549,17 @@ case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' @@ -2395,8 +2568,8 @@ *,cl*) # Native MSVC libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' case $build_os in mingw*) @@ -2423,7 +2596,7 @@ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) - sys_lib_search_path_spec="$LIB" + sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` @@ -2436,8 +2609,8 @@ esac # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' @@ -2450,7 +2623,7 @@ *) # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac @@ -2463,8 +2636,8 @@ version_type=darwin need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' @@ -2477,8 +2650,8 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -2496,12 +2669,13 @@ version_type=freebsd-$objformat case $version_type in freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac @@ -2531,10 +2705,10 @@ need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes + shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -2552,14 +2726,15 @@ dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' @@ -2567,8 +2742,8 @@ dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; @@ -2577,8 +2752,8 @@ dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... @@ -2591,8 +2766,8 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -2603,7 +2778,7 @@ case $host_os in nonstopux*) version_type=nonstopux ;; *) - if test "$lt_cv_prog_gnu_ld" = yes; then + if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix @@ -2611,8 +2786,8 @@ esac need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= @@ -2631,8 +2806,8 @@ esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; @@ -2641,13 +2816,33 @@ dynamic_linker=no ;; +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; + # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -2672,7 +2867,12 @@ # before this can be enabled. hardcode_into_libs=yes - # Append ld.so.conf contents to the search path + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" @@ -2704,12 +2904,12 @@ need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH @@ -2719,7 +2919,7 @@ newsos6) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; @@ -2728,58 +2928,68 @@ version_type=qnx need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; -openbsd*) +openbsd* | bitrig*) version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" + sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no else - shlibpath_overrides_runpath=yes + need_version=yes fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' - shrext_cmds=".dll" + version_type=windows + shrext_cmds=.dll + need_version=no need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) @@ -2790,8 +3000,8 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes @@ -2801,11 +3011,11 @@ sunos4*) version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes @@ -2813,8 +3023,8 @@ sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) @@ -2835,24 +3045,24 @@ ;; sysv4*MP*) - if test -d /usr/nec ;then + if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf + version_type=sco need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' @@ -2870,7 +3080,7 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes @@ -2878,8 +3088,8 @@ uts4*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -2888,20 +3098,30 @@ ;; esac AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no +test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then +if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) @@ -2934,39 +3154,41 @@ [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) -_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], - [Run-time system search path for libraries]) +_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], + [Detected run-time system search path for libraries]) +_LT_DECL([], [configure_time_lt_sys_library_path], [2], + [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- -# find a file program which can recognize shared library +# find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -f "$ac_dir/$1"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : @@ -2989,11 +3211,11 @@ break fi done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else @@ -3011,7 +3233,7 @@ # _LT_PATH_MAGIC # -------------- -# find a file program which can recognize a shared library +# find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then @@ -3038,16 +3260,16 @@ AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], + [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld -if test "$GCC" = yes; then +if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw + # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; @@ -3061,7 +3283,7 @@ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done - test -z "$LD" && LD="$ac_prog" + test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. @@ -3072,37 +3294,37 @@ with_gnu_ld=unknown ;; esac -elif test "$with_gnu_ld" = yes; then +elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" + lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], +[if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi]) +rm -f conftest.i conftest2.i conftest.out]) +])# _LT_PATH_DD + + +# _LT_CMD_TRUNCATE +# ---------------- +# find command to truncate a binary pipe +m4_defun([_LT_CMD_TRUNCATE], +[m4_require([_LT_PATH_DD]) +AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], +[printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) +_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], + [Command to truncate a binary pipe]) +])# _LT_CMD_TRUNCATE + + # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies @@ -3188,13 +3447,13 @@ # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. +# 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) @@ -3221,8 +3480,7 @@ # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else @@ -3318,8 +3576,8 @@ lt_cv_deplibs_check_method=pass_all ;; -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' @@ -3372,6 +3630,9 @@ tpf*) lt_cv_deplibs_check_method=pass_all ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; esac ]) @@ -3412,33 +3673,38 @@ AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. - lt_cv_path_NM="$NM" + lt_cv_path_NM=$NM else - lt_nm_to_check="${ac_tool_prefix}nm" + lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" - break + break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" - break + break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but @@ -3449,21 +3715,21 @@ esac fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) - DUMPBIN="$DUMPBIN -symbols" + DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: @@ -3471,8 +3737,8 @@ esac fi AC_SUBST([DUMPBIN]) - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" + if test : != "$DUMPBIN"; then + NM=$DUMPBIN fi fi test -z "$NM" && NM=nm @@ -3518,8 +3784,8 @@ case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib @@ -3531,7 +3797,7 @@ ;; *) # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" + lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) @@ -3558,13 +3824,28 @@ lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) -if test "x$lt_cv_path_mainfest_tool" != xyes; then +if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL +# _LT_DLL_DEF_P([FILE]) +# --------------------- +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with func_dll_def_p in the libtool script +AC_DEFUN([_LT_DLL_DEF_P], +[dnl + test DEF = "`$SED -n dnl + -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace + -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments + -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl + -e q dnl Only consider the first "real" line + $1`" dnl +])# _LT_DLL_DEF_P + + # LT_LIB_M # -------- # check for math library @@ -3576,11 +3857,11 @@ # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) - AC_CHECK_LIB(m, cos, LIBM="-lm") + AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) @@ -3599,7 +3880,7 @@ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -if test "$GCC" = yes; then +if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; @@ -3651,7 +3932,7 @@ symcode='[[ABCDGISTW]]' ;; hpux*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; @@ -3684,14 +3965,44 @@ symcode='[[ABCDGIRSTW]]' ;; esac +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -3709,21 +4020,24 @@ # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" @@ -3763,11 +4077,11 @@ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST -#elif defined(__osf__) +#elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else @@ -3793,7 +4107,7 @@ { { "@PROGRAM@", (void *) 0 }, _LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; @@ -3813,9 +4127,9 @@ mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" + LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS @@ -3836,7 +4150,7 @@ rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then + if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= @@ -3863,12 +4177,16 @@ [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], + [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([nm_interface], [lt_cv_nm_interface], [1], + [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS @@ -3884,17 +4202,18 @@ m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then + if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) @@ -3905,8 +4224,8 @@ ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac @@ -3922,6 +4241,11 @@ # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac ;; darwin* | rhapsody*) # PIC is the default on this platform @@ -3971,7 +4295,7 @@ case $host_os in aix[[4-9]]*) # All AIX code is PIC. - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else @@ -4012,14 +4336,14 @@ case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default @@ -4056,7 +4380,7 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) - # old Intel C++ for x86_64 which still supported -KPIC. + # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' @@ -4201,17 +4525,18 @@ fi ], [ - if test "$GCC" = yes; then + if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) @@ -4222,8 +4547,8 @@ ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac @@ -4240,6 +4565,11 @@ # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac ;; darwin* | rhapsody*) @@ -4310,7 +4640,7 @@ case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else @@ -4318,11 +4648,30 @@ fi ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac ;; hpux9* | hpux10* | hpux11*) @@ -4338,7 +4687,7 @@ ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) @@ -4349,7 +4698,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. + # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4374,6 +4723,12 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) @@ -4471,7 +4826,7 @@ ;; sysv4*MP*) - if test -d /usr/nec ;then + if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi @@ -4500,7 +4855,7 @@ fi ]) case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: + # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; @@ -4566,17 +4921,21 @@ case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global defined - # symbols, whereas GNU nm marks them as "W". + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) - _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in @@ -4625,9 +4984,9 @@ # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if @@ -4643,7 +5002,7 @@ # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. - if test "$GCC" != yes; then + if test yes != "$GCC"; then with_gnu_ld=no fi ;; @@ -4651,7 +5010,7 @@ # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; - openbsd*) + openbsd* | bitrig*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) @@ -4664,7 +5023,7 @@ # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility @@ -4686,24 +5045,24 @@ esac fi - if test "$lt_use_gnu_ld_interface" = yes; then + if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' + wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no - case `$LD -v 2>&1` in + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -4716,7 +5075,7 @@ case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then + if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 @@ -4735,7 +5094,7 @@ case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) @@ -4751,7 +5110,7 @@ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4761,7 +5120,7 @@ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes @@ -4769,61 +5128,89 @@ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no - if test "$host_os" = linux-dietlibc; then + if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no + && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -4834,42 +5221,47 @@ lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac - _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then + if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in + tcc*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' + ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then + if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -4883,8 +5275,8 @@ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -4902,8 +5294,8 @@ _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4915,7 +5307,7 @@ _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify @@ -4930,9 +5322,9 @@ # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4949,15 +5341,15 @@ *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac - if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= @@ -4973,7 +5365,7 @@ # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported @@ -4981,34 +5373,57 @@ ;; aix[[4-9]]*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag="" + no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi ;; esac @@ -5027,13 +5442,21 @@ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac - if test "$GCC" = yes; then + if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` + collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -5052,62 +5475,80 @@ ;; esac shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' fi - _LT_TAGVAR(link_all_deplibs, $1)=no + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' else # not using gcc - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' else - shared_flag='${wl}-bM:SRE' + shared_flag='$wl-bM:SRE' fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' fi fi - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; @@ -5116,7 +5557,7 @@ case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) @@ -5146,16 +5587,17 @@ # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes @@ -5164,18 +5606,18 @@ # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' ;; *) # Assume MSVC wrapper @@ -5184,7 +5626,7 @@ # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. @@ -5234,33 +5676,33 @@ ;; hpux9*) - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test yes,no = "$GCC,$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes @@ -5268,25 +5710,25 @@ ;; hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then + if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ @@ -5294,14 +5736,14 @@ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in @@ -5312,7 +5754,7 @@ *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. @@ -5323,16 +5765,16 @@ ;; irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], - [save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + [save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], @@ -5345,21 +5787,32 @@ end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) - LDFLAGS="$save_LDFLAGS"]) - if test "$lt_cv_irix_exported_symbol" = yes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + LDFLAGS=$save_LDFLAGS]) + if test yes = "$lt_cv_irix_exported_symbol"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi + _LT_TAGVAR(link_all_deplibs, $1)=no else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(ld_shlibs, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out @@ -5374,7 +5827,7 @@ newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; @@ -5382,27 +5835,19 @@ *nto* | *qnx*) ;; - openbsd*) + openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no @@ -5413,33 +5858,53 @@ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -5450,24 +5915,24 @@ solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' - _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) - wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi @@ -5477,11 +5942,11 @@ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', + # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + if test yes = "$GCC"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi @@ -5491,10 +5956,10 @@ ;; sunos4*) - if test "x$host_vendor" = xsequent; then + if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi @@ -5543,43 +6008,43 @@ ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not + # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; @@ -5594,17 +6059,17 @@ ;; esac - if test x$host_vendor = xsni; then + if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) -test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no +test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld @@ -5621,7 +6086,7 @@ # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - if test "$enable_shared" = yes && test "$GCC" = yes; then + if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. @@ -5701,12 +6166,12 @@ _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is - "absolute", i.e impossible to change by setting ${shlibpath_var} if the + "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR @@ -5747,10 +6212,10 @@ # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. +# the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl -lt_save_CC="$CC" +lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. @@ -5790,18 +6255,18 @@ LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB - # Report which library types will actually be built + # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no + test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test "$enable_shared" = yes && enable_static=no + test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' @@ -5809,8 +6274,12 @@ ;; aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -5818,13 +6287,13 @@ AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes + test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP -CC="$lt_save_CC" +CC=$lt_save_CC ])# _LT_LANG_C_CONFIG @@ -5832,14 +6301,14 @@ # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. +# the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then +if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes @@ -5881,7 +6350,7 @@ # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_caught_CXX_error" != yes; then +if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" @@ -5923,35 +6392,35 @@ if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately - if test "$GXX" = yes; then + if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi - if test "$GXX" = yes; then + if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + if test yes = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) - wlarc='${wl}' + wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi @@ -5987,18 +6456,30 @@ _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag="" + no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in @@ -6008,6 +6489,13 @@ ;; esac done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi ;; esac @@ -6026,13 +6514,21 @@ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac - if test "$GXX" = yes; then + if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` + collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -6050,64 +6546,84 @@ fi esac shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' else # not using gcc - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' else - shared_flag='${wl}-bM:SRE' + shared_flag='$wl-bM:SRE' fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' fi fi - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # The "-G" linker flag allows undefined symbols. + _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared - # libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; @@ -6117,7 +6633,7 @@ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6145,57 +6661,58 @@ # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6206,6 +6723,34 @@ _LT_DARWIN_LINKER_FEATURES($1) ;; + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + dgux*) case $cc_basename in ec++*) @@ -6241,14 +6786,14 @@ ;; haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default @@ -6260,7 +6805,7 @@ _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -6269,11 +6814,11 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test "$GXX" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + if test yes = "$GXX"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no @@ -6283,15 +6828,15 @@ ;; hpux10*|hpux11*) - if test $with_gnu_ld = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi @@ -6317,13 +6862,13 @@ aCC*) case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists @@ -6334,20 +6879,20 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -6362,22 +6907,22 @@ interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -6386,17 +6931,17 @@ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; @@ -6409,8 +6954,8 @@ # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -6419,10 +6964,10 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. @@ -6436,59 +6981,59 @@ # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac - _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -6502,18 +7047,18 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) @@ -6521,10 +7066,10 @@ *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on @@ -6582,22 +7127,17 @@ _LT_TAGVAR(ld_shlibs, $1)=yes ;; - openbsd2*) - # C++ shared libraries are fairly broken - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - openbsd*) + openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else @@ -6613,9 +7153,9 @@ # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using @@ -6633,17 +7173,17 @@ cxx*) case $host in osf3*) - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ - $RM $lib.exp' + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ + $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac @@ -6658,21 +7198,21 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists @@ -6718,9 +7258,9 @@ # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -6728,7 +7268,7 @@ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. + # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; @@ -6745,30 +7285,30 @@ ;; gcx*) # Green Hills C++ Compiler - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else - # g++ 2.7 appears to require `-G' NOT `-shared' on this + # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. - _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when @@ -6776,11 +7316,11 @@ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi @@ -6789,52 +7329,52 @@ ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not + # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ - '"$_LT_TAGVAR(old_archive_cmds, $1)" + '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ - '"$_LT_TAGVAR(reload_cmds, $1)" + '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; @@ -6865,10 +7405,10 @@ esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) - test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no - _LT_TAGVAR(GCC, $1)="$GXX" - _LT_TAGVAR(LD, $1)="$LD" + _LT_TAGVAR(GCC, $1)=$GXX + _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -6895,7 +7435,7 @@ lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test "$_lt_caught_CXX_error" != yes +fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG @@ -6917,13 +7457,14 @@ AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + case @S|@2 in + .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; + *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF + # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose @@ -7007,13 +7548,13 @@ pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in + case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. - if test $p = "-L" || - test $p = "-R"; then + if test x-L = "$p" || + test x-R = "$p"; then prev=$p continue fi @@ -7029,16 +7570,16 @@ case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac - if test "$pre_test_object_deps_done" = no; then - case ${prev} in + if test no = "$pre_test_object_deps_done"; then + case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else - _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being @@ -7046,9 +7587,9 @@ esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then - _LT_TAGVAR(postdeps, $1)="${prev}${p}" + _LT_TAGVAR(postdeps, $1)=$prev$p else - _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= @@ -7063,15 +7604,15 @@ continue fi - if test "$pre_test_object_deps_done" = no; then + if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then - _LT_TAGVAR(predep_objects, $1)="$p" + _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then - _LT_TAGVAR(postdep_objects, $1)="$p" + _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi @@ -7102,51 +7643,6 @@ _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; - -linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - if test "$solaris_use_stlport4" != yes; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; - -solaris*) - case $cc_basename in - CC* | sunCC*) - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - if test "$solaris_use_stlport4" != yes; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; esac ]) @@ -7155,7 +7651,7 @@ esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then - _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) @@ -7175,10 +7671,10 @@ # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) -if test -z "$F77" || test "X$F77" = "Xno"; then +if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi @@ -7215,7 +7711,7 @@ # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_F77" != yes; then +if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t @@ -7237,7 +7733,7 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. - lt_save_CC="$CC" + lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} @@ -7251,21 +7747,25 @@ AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no + test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test "$enable_shared" = yes && enable_static=no + test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -7273,11 +7773,11 @@ AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes + test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) - _LT_TAGVAR(GCC, $1)="$G77" - _LT_TAGVAR(LD, $1)="$LD" + _LT_TAGVAR(GCC, $1)=$G77 + _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -7294,9 +7794,9 @@ fi # test -n "$compiler" GCC=$lt_save_GCC - CC="$lt_save_CC" - CFLAGS="$lt_save_CFLAGS" -fi # test "$_lt_disable_F77" != yes + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG @@ -7306,11 +7806,11 @@ # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) -if test -z "$FC" || test "X$FC" = "Xno"; then +if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi @@ -7347,7 +7847,7 @@ # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_FC" != yes; then +if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t @@ -7369,7 +7869,7 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. - lt_save_CC="$CC" + lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} @@ -7385,21 +7885,25 @@ AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no + test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test "$enable_shared" = yes && enable_static=no + test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -7407,11 +7911,11 @@ AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes + test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) - _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" - _LT_TAGVAR(LD, $1)="$LD" + _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu + _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -7431,7 +7935,7 @@ GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS -fi # test "$_lt_disable_FC" != yes +fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG @@ -7441,7 +7945,7 @@ # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE @@ -7475,7 +7979,7 @@ CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)="$LD" +_LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. @@ -7512,7 +8016,7 @@ # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE @@ -7546,7 +8050,7 @@ CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)="$LD" +_LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. @@ -7583,7 +8087,7 @@ # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE @@ -7599,7 +8103,7 @@ lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" +lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER @@ -7609,7 +8113,7 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. -lt_save_CC="$CC" +lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= @@ -7638,7 +8142,7 @@ [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) @@ -7749,7 +8253,7 @@ # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue + test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in @@ -7766,9 +8270,9 @@ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break + test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then + if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi @@ -7792,27 +8296,7 @@ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], -[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -AC_MSG_RESULT([$xsi_shell]) -_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) - -AC_MSG_CHECKING([whether the shell understands "+="]) -lt_shell_append=no -( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -AC_MSG_RESULT([$lt_shell_append]) -_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then +[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false @@ -7836,102 +8320,9 @@ ])# _LT_CHECK_SHELL_FEATURES -# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) -# ------------------------------------------------------ -# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and -# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. -m4_defun([_LT_PROG_FUNCTION_REPLACE], -[dnl { -sed -e '/^$1 ()$/,/^} # $1 /c\ -$1 ()\ -{\ -m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) -} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: -]) - - -# _LT_PROG_REPLACE_SHELLFNS -# ------------------------- -# Replace existing portable implementations of several shell functions with -# equivalent extended shell implementations where those features are available.. -m4_defun([_LT_PROG_REPLACE_SHELLFNS], -[if test x"$xsi_shell" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac]) - - _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl - func_basename_result="${1##*/}"]) - - _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}"]) - - _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"}]) - - _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl - func_split_long_opt_name=${1%%=*} - func_split_long_opt_arg=${1#*=}]) - - _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl - func_split_short_opt_arg=${1#??} - func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) - - _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac]) - - _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) - - _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) - - _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) -fi - -if test x"$lt_shell_append" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) - - _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl - func_quote_for_eval "${2}" -dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ - eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) -fi -]) - # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- -# Determine which file name conversion functions should be used by +# Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], diff -Nru gstreamer-vaapi-0.7.0/m4/lt~obsolete.m4 gstreamer-vaapi-1.8.2/m4/lt~obsolete.m4 --- gstreamer-vaapi-0.7.0/m4/lt~obsolete.m4 2015-12-07 10:54:20.000000000 +0000 +++ gstreamer-vaapi-1.8.2/m4/lt~obsolete.m4 2016-06-09 07:27:08.000000000 +0000 @@ -1,6 +1,7 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software +# Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives @@ -11,7 +12,7 @@ # These exist entirely to fool aclocal when bootstrapping libtool. # -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # @@ -25,7 +26,7 @@ # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until diff -Nru gstreamer-vaapi-0.7.0/m4/ltoptions.m4 gstreamer-vaapi-1.8.2/m4/ltoptions.m4 --- gstreamer-vaapi-0.7.0/m4/ltoptions.m4 2015-12-07 10:54:19.000000000 +0000 +++ gstreamer-vaapi-1.8.2/m4/ltoptions.m4 2016-06-09 07:27:08.000000000 +0000 @@ -1,14 +1,14 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software +# Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 7 ltoptions.m4 +# serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) @@ -29,7 +29,7 @@ [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), - [m4_warning([Unknown $1 option `$2'])])[]dnl + [m4_warning([Unknown $1 option '$2'])])[]dnl ]) @@ -75,13 +75,15 @@ dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither - dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], - [_LT_ENABLE_FAST_INSTALL]) + [_LT_ENABLE_FAST_INSTALL]) + _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], + [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS @@ -112,7 +114,7 @@ [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `dlopen' option into LT_INIT's first parameter.]) +put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -148,7 +150,7 @@ _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `win32-dll' option into LT_INIT's first parameter.]) +put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -157,9 +159,9 @@ # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- -# implement the --enable-shared flag, and supports the `shared' and -# `disable-shared' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +# implement the --enable-shared flag, and supports the 'shared' and +# 'disable-shared' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], @@ -172,14 +174,14 @@ *) enable_shared=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) @@ -211,9 +213,9 @@ # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- -# implement the --enable-static flag, and support the `static' and -# `disable-static' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +# implement the --enable-static flag, and support the 'static' and +# 'disable-static' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], @@ -226,14 +228,14 @@ *) enable_static=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) @@ -265,9 +267,9 @@ # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- -# implement the --enable-fast-install flag, and support the `fast-install' -# and `disable-fast-install' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +# implement the --enable-fast-install flag, and support the 'fast-install' +# and 'disable-fast-install' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], @@ -280,14 +282,14 @@ *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) @@ -304,14 +306,14 @@ [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `fast-install' option into LT_INIT's first parameter.]) +the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `disable-fast-install' option into LT_INIT's first parameter.]) +the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -319,11 +321,64 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) +# _LT_WITH_AIX_SONAME([DEFAULT]) +# ---------------------------------- +# implement the --with-aix-soname flag, and support the `aix-soname=aix' +# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT +# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. +m4_define([_LT_WITH_AIX_SONAME], +[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl +shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[[5-9]]*,yes) + AC_MSG_CHECKING([which variant of shared library versioning to provide]) + AC_ARG_WITH([aix-soname], + [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], + [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], + [case $withval in + aix|svr4|both) + ;; + *) + AC_MSG_ERROR([Unknown argument to --with-aix-soname]) + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname], + [AC_CACHE_VAL([lt_cv_with_aix_soname], + [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) + with_aix_soname=$lt_cv_with_aix_soname]) + AC_MSG_RESULT([$with_aix_soname]) + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + +_LT_DECL([], [shared_archive_member_spec], [0], + [Shared archive member basename, for filename based shared library versioning on AIX])dnl +])# _LT_WITH_AIX_SONAME + +LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) + + # _LT_WITH_PIC([MODE]) # -------------------- -# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], @@ -334,19 +389,17 @@ *) pic_mode=default # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], - [pic_mode=default]) - -test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC @@ -359,7 +412,7 @@ [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `pic-only' option into LT_INIT's first parameter.]) +put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: diff -Nru gstreamer-vaapi-0.7.0/m4/ltsugar.m4 gstreamer-vaapi-1.8.2/m4/ltsugar.m4 --- gstreamer-vaapi-0.7.0/m4/ltsugar.m4 2015-12-07 10:54:20.000000000 +0000 +++ gstreamer-vaapi-1.8.2/m4/ltsugar.m4 2016-06-09 07:27:08.000000000 +0000 @@ -1,6 +1,7 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives @@ -33,7 +34,7 @@ # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support -# Autoconf-2.59 which quotes differently. +# Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], @@ -44,7 +45,7 @@ # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different diff -Nru gstreamer-vaapi-0.7.0/m4/ltversion.m4 gstreamer-vaapi-1.8.2/m4/ltversion.m4 --- gstreamer-vaapi-0.7.0/m4/ltversion.m4 2015-12-07 10:54:20.000000000 +0000 +++ gstreamer-vaapi-1.8.2/m4/ltversion.m4 2016-06-09 07:27:08.000000000 +0000 @@ -1,6 +1,6 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -9,15 +9,15 @@ # @configure_input@ -# serial 3337 ltversion.m4 +# serial 4179 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.2]) -m4_define([LT_PACKAGE_REVISION], [1.3337]) +m4_define([LT_PACKAGE_VERSION], [2.4.6]) +m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.2' -macro_revision='1.3337' +[macro_version='2.4.6' +macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff -Nru gstreamer-vaapi-0.7.0/m4/Makefile.am gstreamer-vaapi-1.8.2/m4/Makefile.am --- gstreamer-vaapi-0.7.0/m4/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/m4/Makefile.am 2016-03-24 11:36:59.000000000 +0000 @@ -0,0 +1,3 @@ +EXTRA_DIST = $(wildcard *.m4) + +-include $(top_srcdir)/git.mk diff -Nru gstreamer-vaapi-0.7.0/m4/Makefile.in gstreamer-vaapi-1.8.2/m4/Makefile.in --- gstreamer-vaapi-0.7.0/m4/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer-vaapi-1.8.2/m4/Makefile.in 2016-06-09 07:27:12.000000000 +0000 @@ -0,0 +1,561 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = m4 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-arch.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-platform.m4 \ + $(top_srcdir)/common/m4/gst-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ +DLLTOOL = @DLLTOOL@ +DLOPEN_LIBS = @DLOPEN_LIBS@ +DRM_CFLAGS = @DRM_CFLAGS@ +DRM_LIBS = @DRM_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGL_CFLAGS = @EGL_CFLAGS@ +EGL_LIBS = @EGL_LIBS@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GIT = @GIT@ +GLES2_CFLAGS = @GLES2_CFLAGS@ +GLES2_LIBS = @GLES2_LIBS@ +GLES3_CFLAGS = @GLES3_CFLAGS@ +GLES3_LIBS = @GLES3_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ +GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ +GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ +GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ +GST_API_VERSION = @GST_API_VERSION@ +GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ +GST_BASE_LIBS = @GST_BASE_LIBS@ +GST_CFLAGS = @GST_CFLAGS@ +GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ +GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ +GST_CURRENT = @GST_CURRENT@ +GST_GL_CFLAGS = @GST_GL_CFLAGS@ +GST_GL_LIBS = @GST_GL_LIBS@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ +GST_LIBS = @GST_LIBS@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PBUTILS_CFLAGS = @GST_PBUTILS_CFLAGS@ +GST_PBUTILS_LIBS = @GST_PBUTILS_LIBS@ +GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ +GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ +GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ +GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ +GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVA_CFLAGS = @LIBVA_CFLAGS@ +LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ +LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ +LIBVA_LIBS = @LIBVA_LIBS@ +LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ +LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ +LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ +LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ +WAYLAND_LIBS = @WAYLAND_LIBS@ +X11_CFLAGS = @X11_CFLAGS@ +X11_LIBS = @X11_LIBS@ +XRANDR_CFLAGS = @XRANDR_CFLAGS@ +XRANDR_LIBS = @XRANDR_LIBS@ +XRENDER_CFLAGS = @XRENDER_CFLAGS@ +XRENDER_LIBS = @XRENDER_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = $(wildcard *.m4) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu m4/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +-include $(top_srcdir)/git.mk + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru gstreamer-vaapi-0.7.0/Makefile.am gstreamer-vaapi-1.8.2/Makefile.am --- gstreamer-vaapi-0.7.0/Makefile.am 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/Makefile.am 2016-03-24 11:36:59.000000000 +0000 @@ -1,29 +1,19 @@ -ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} +ACLOCAL_AMFLAGS = -I m4 -I common/m4 -AUTOMAKE_OPTIONS = foreign +SUBDIRS = gst-libs gst tests m4 common docs -SUBDIRS = debian.upstream ext gst-libs gst pkgconfig tests docs patches +DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc # Extra clean files so that maintainer-clean removes *everything* MAINTAINERCLEANFILES = \ $(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \ $(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN) \ $(GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL) \ - $(srcdir)/gtk-doc.make $(srcdir)/m4/gtk-doc.m4 \ + $(srcdir)/autoregen.sh $(srcdir)/INSTALL \ $(NULL) -DEB_BUILDDIR = debian.build - -deb: - dpkg-buildpackage -rfakeroot -uc -us - -deb.upstream: dist-bzip2 - -mkdir -p $(DEB_BUILDDIR) - cd $(DEB_BUILDDIR) && \ - rm -rf $(PACKAGE)-$(VERSION) && \ - tar jxvf ../$(PACKAGE)-$(VERSION).tar.bz2 && \ - cd $(PACKAGE)-$(VERSION) && \ - $(LN_S) debian.upstream debian && \ - $(MAKE) deb -f Makefile.am +EXTRA_DIST = \ + configure.ac autogen.sh \ + gstreamer-vaapi.doap -include $(top_srcdir)/git.mk diff -Nru gstreamer-vaapi-0.7.0/Makefile.in gstreamer-vaapi-1.8.2/Makefile.in --- gstreamer-vaapi-0.7.0/Makefile.in 2015-12-07 10:54:24.000000000 +0000 +++ gstreamer-vaapi-1.8.2/Makefile.in 2016-06-09 07:27:12.000000000 +0000 @@ -90,10 +90,27 @@ target_triplet = @target@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-arch.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-platform.m4 \ + $(top_srcdir)/common/m4/gst-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ @@ -167,8 +184,8 @@ $(top_srcdir)/build-aux/config.sub \ $(top_srcdir)/build-aux/install-sh \ $(top_srcdir)/build-aux/ltmain.sh \ - $(top_srcdir)/build-aux/missing AUTHORS COPYING.LIB NEWS \ - README build-aux/compile build-aux/config.guess \ + $(top_srcdir)/build-aux/missing AUTHORS COPYING.LIB ChangeLog \ + INSTALL NEWS README build-aux/compile build-aux/config.guess \ build-aux/config.sub build-aux/install-sh build-aux/ltmain.sh \ build-aux/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -207,16 +224,18 @@ done; \ reldir="$$dir2" GZIP_ENV = --best -DIST_ARCHIVES = $(distdir).tar.bz2 -DIST_TARGETS = dist-bzip2 +DIST_ARCHIVES = $(distdir).tar.xz +DIST_TARGETS = dist-xz distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = -I m4 -I common/m4 AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ +AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -229,6 +248,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DRM_CFLAGS = @DRM_CFLAGS@ @@ -241,58 +261,64 @@ EGL_CFLAGS = @EGL_CFLAGS@ EGL_LIBS = @EGL_LIBS@ EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ GIT = @GIT@ GLES2_CFLAGS = @GLES2_CFLAGS@ GLES2_LIBS = @GLES2_LIBS@ GLES3_CFLAGS = @GLES3_CFLAGS@ GLES3_LIBS = @GLES3_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ -GLIB_VERSION_REQUIRED = @GLIB_VERSION_REQUIRED@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ -GMODULE_VERSION_REQUIRED = @GMODULE_VERSION_REQUIRED@ GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ GST_API_VERSION = @GST_API_VERSION@ -GST_BASEVIDEO_CFLAGS = @GST_BASEVIDEO_CFLAGS@ -GST_BASEVIDEO_LIBS = @GST_BASEVIDEO_LIBS@ GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ GST_BASE_LIBS = @GST_BASE_LIBS@ GST_CFLAGS = @GST_CFLAGS@ GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ +GST_CURRENT = @GST_CURRENT@ GST_GL_CFLAGS = @GST_GL_CFLAGS@ GST_GL_LIBS = @GST_GL_LIBS@ -GST_INTERFACES_CFLAGS = @GST_INTERFACES_CFLAGS@ -GST_INTERFACES_LIBS = @GST_INTERFACES_LIBS@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ GST_LIBS = @GST_LIBS@ -GST_PKG_VERSION = @GST_PKG_VERSION@ -GST_PLUGINS_BAD_VERSION_REQUIRED = @GST_PLUGINS_BAD_VERSION_REQUIRED@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PBUTILS_CFLAGS = @GST_PBUTILS_CFLAGS@ +GST_PBUTILS_LIBS = @GST_PBUTILS_LIBS@ GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ -GST_PLUGINS_BASE_VERSION_REQUIRED = @GST_PLUGINS_BASE_VERSION_REQUIRED@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ -GST_PLUGIN_PATH_1_0 = @GST_PLUGIN_PATH_1_0@ -GST_VAAPI_LT_LDFLAGS = @GST_VAAPI_LT_LDFLAGS@ -GST_VAAPI_LT_VERSION = @GST_VAAPI_LT_VERSION@ -GST_VAAPI_MAJOR_VERSION = @GST_VAAPI_MAJOR_VERSION@ -GST_VERSION_REQUIRED = @GST_VERSION_REQUIRED@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ -GTKDOC_VERSION = @GTKDOC_VERSION@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -301,6 +327,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -308,16 +335,15 @@ LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ LIBVA_LIBS = @LIBVA_LIBS@ -LIBVA_PACKAGE_VERSION = @LIBVA_PACKAGE_VERSION@ -LIBVA_PKGNAME = @LIBVA_PKGNAME@ LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ -LIBVA_X11_PKGNAME = @LIBVA_X11_PKGNAME@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -334,21 +360,27 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ -PATCH = @PATCH@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ -TODAY = @TODAY@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ VERSION = @VERSION@ -WAYLAND_API_VERSION = @WAYLAND_API_VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ WAYLAND_LIBS = @WAYLAND_LIBS@ X11_CFLAGS = @X11_CFLAGS@ @@ -357,7 +389,6 @@ XRANDR_LIBS = @XRANDR_LIBS@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ -YASM = @YASM@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -399,11 +430,15 @@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ plugindir = @plugindir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -416,38 +451,40 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} -AUTOMAKE_OPTIONS = foreign -SUBDIRS = debian.upstream ext gst-libs gst pkgconfig tests docs patches +SUBDIRS = gst-libs gst tests m4 common docs +DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc # Extra clean files so that maintainer-clean removes *everything* MAINTAINERCLEANFILES = \ $(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \ $(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN) \ $(GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL) \ - $(srcdir)/gtk-doc.make $(srcdir)/m4/gtk-doc.m4 \ + $(srcdir)/autoregen.sh $(srcdir)/INSTALL \ $(NULL) -DEB_BUILDDIR = debian.build +EXTRA_DIST = \ + configure.ac autogen.sh \ + gstreamer-vaapi.doap + all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile + $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -461,9 +498,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): @@ -474,7 +511,7 @@ stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: $(am__configure_deps) +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ @@ -664,6 +701,7 @@ dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) + dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) @@ -671,7 +709,6 @@ dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) - dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) @@ -912,18 +949,6 @@ .PRECIOUS: Makefile -deb: - dpkg-buildpackage -rfakeroot -uc -us - -deb.upstream: dist-bzip2 - -mkdir -p $(DEB_BUILDDIR) - cd $(DEB_BUILDDIR) && \ - rm -rf $(PACKAGE)-$(VERSION) && \ - tar jxvf ../$(PACKAGE)-$(VERSION).tar.bz2 && \ - cd $(PACKAGE)-$(VERSION) && \ - $(LN_S) debian.upstream debian && \ - $(MAKE) deb -f Makefile.am - -include $(top_srcdir)/git.mk # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nru gstreamer-vaapi-0.7.0/NEWS gstreamer-vaapi-1.8.2/NEWS --- gstreamer-vaapi-0.7.0/NEWS 2015-12-07 10:48:50.000000000 +0000 +++ gstreamer-vaapi-1.8.2/NEWS 2016-06-09 08:37:00.000000000 +0000 @@ -1,386 +1,26 @@ -gst-vaapi NEWS -- summary of changes. 2015-12-07 -Copyright (C) 2010-2011 Splitted-Desktop Systems -Copyright (C) 2011-2015 Intel Corporation -Copyright (C) 2011 Collabora +### 1.8.2 -Version 0.7 - 07.Dec.2015 -* Add VP9 Decoder -* Improvements to HEVC(H265) decoder - + Fix the decoding of dependent slice segment - + Fix decoding of stream when it has temporal sublayers - + Added Workaround to recognize wrongly encoded main profile streams - + Add SEI Header parsing - + Fix the value assigning for delta_chroma_log2_weight_denom - + Fix default value assignment of pred_weight_table - + Fix ChromaOffsetL0/ChromaOffsetL1 calculation - + Add calculation of WpOffsetHalfRangeC - + Fix the scaling list scan order - + Fix the picture addition in dpb() based on spec H265 v3 (04/2015) - + Fix the dpb_add() based on C.5.2.3 - + Fix flushing of dpb for EOS/EOB nal -* Added infrastructure for handling corrupted pictures in h264 decoder [#703921, #751434] -* Add number of fixes and optimizations to GstContext sharing [#757598] -* Add API for dynamic detection of OpenGL API in use [#753099] -* Make vaapidecode + glimagesink combination work with opengl3 [#753099] -* Fix segfault in vaapipostproc [#752558] -* Fix seeking while using GLTextureUpload for rendering [#752929] -* Ported JPEG decoder to new API/ABI changes in codecparser -* Removed gstvaapiuploader [#752777] -* Fix 0/1 frame-rate handling in encoder [#744042] -* Validate chroma sampling according to the VA's RT format in Encoder [#744042] -* Number of improvements in vaapi video memory handling [#744042] -* Stabilization of vaapidecodebin [#749554, #757957] -* Wayland fixes: Don't return GST_FLOW_ERROR on flushing [#753598] -* Add yasm as build dependency -* Remvoved custom(non-official) debian parallel compilation option -* Fix multi-resolution video handling in vaapidecode [#753914] -* Adding stereoscopic/multiview upstream API support [#750835] -* Fixed fps calculation for for forced latency framerate [#755040] -* Fix build issues while disabling built-in codecparsers [#754845] -* Mark support for GStreamer 1.2 as obsolete -* Update libvpx submodule to 1.4.0 -* Fix caps negotiation for meta:GstVideoGLTextureUploadMeta [#756686] -* Fixed leaked display instance in vaapidecodebin [#757595] +The first 1.8 bug-fix release (1.8.2) was released on 9 June 2016. +This release only contains bugfixes and it should be safe to update from 1.8.0. -Version 0.6 - 15.Jul.2015 -* Add HEVC(H265) Decoder -* Add HEVC(H265) Encoder -* Add VP8 Encoder -* Add JPEG Encoder -* Add support for EGL [#743846, #743847, #741079] -* Add a vaapidecodebin(vaapidecode->queue->vaapipostproc) element [#745216] -* Add skin-tone-enhancement feature in vaapipostproc [#744088] -* Add support for H.264 MVC Multiview High profile encoding with more than 2 views [#732453] -* Add support for GstVideoGLTextureOrientation in plugins -* Add support for BGRA textures in plugins -* Removed all GStreamer 0.10 and 1.0 specific code sections [#745728,#732666] -* Add support for loss of picturers in h264 decoder [#745048,#703921] -* Add a simple-encoder test program that uses libgstvaapi for video encoding [#719528] -* Add finer wayland frame control and many other optimizations [#719528, #749078, #747492#] -* Add scaling of quality factor and Qantization tables for JPEG encoder [#748335] -* Add GstColorBalance interface in vaapipostproc [#720376] -* Add a handoff signal to vaapisink [#747905] -* Add rounding control handling for VC1 simple and Main profile [#743958] -* Record glconext supplied by downstream to enable run-time compatibility check [#725643] -* Switch back to single thread implementation in vaapidecode [#742605] -* Set decoding latency in vaapidecode by assuming realtime performance fo the HW decoding [#740419] -* Allow vaapidecode to connect with glimagesink, mark x11 display as compatible with EGL [#745902] -* Allow decoding of VC1 streams which contain user BDUs [#741237] -* Use git.mk, a small Makefile to autogenerate .gitignore files -* Expose the overlay capability in vaapisink for compatibility with dvbsuboverlay [#750095] -* Enable VPP element in vaapidecodebin only if there is HW support [#749554] -* Fix autoplugging of vaapidecode in playbin for wmv/asf streams -* Fix multi-slice hevc encoding [#749854] -* Fix ABBA deadlock between vaapisink and vaapipostproc if running in different threds [#738249] -* Fix Seeking failure while using navseek in pipeline [#738677] -* Fix PTS cache for MPEG2 GOP start [#748676] -* Fix the wrong selection of passthrough mode in vaapipostproc [#748184] -* Fix GstVaapiVideoPool related dead-lock [#747944] -* Fix the race condition while setting drm device type [#747914] -* Fix crash in vaapidecode if buffer outlives the decoder [#745189] -* Fix memory leak in vaapidecode [#743226] -* Fix multiple caps negotiation issues with vaapi elements [#744618] -* Improve check for upstream element that requires DMABUF buffer pool -* Fix vaapisink memory leak in debug mode -* Fix crash when seeking mpeg2 strems -* Fix support for Wayland/EGL running alongside X11 +#### Major bugfixes in 1.8.2 -Version 0.5.10 - 3.Feb.2015 -* Add support for DRM Render-Nodes for headless operation -* Add support for VA surface buffer sharing with DMABUF and GEM handles -* Add support for v4l2src with io-mode={dmabuf,dmabuf-import} -* Drop support for VA/GLX specific APIs in libgstvaapi and vaapisink [#736711] -* Improvements to H.264 codecs - + Fix profile limits for encoding - + Fix pixel-aspect-ratio in the encoded stream - + Add decoding support for interlaced streams with repeat-first-field (RFF) - + Fix decoding of interlaced streams in top-field-first order (TFF) [#739291] - + Fix decoding of UK DVB-T2 streams [#739291] -* Improvements to plugin elements - + Add support for dma_buf imports (Wind Yuan) [#735362] - + Allow for SW decoding fallbacks with unsupported profiles [#730997] - + Make vaapipostproc work with SW elements (+Victor Jaquez) [#720174, #704078] - + Allow vaapipostproc to integrate with GL downstream elements [#735231] - + Add support for high-quality scaling to vaapipostproc ("scale-method=hq") - + Fix advanced deinterlacing when it is the unique filter applied - + Add GstColorBalance interface to vaapisink (Changzhi Wei) [#722390] - + Implement the GstNavigation interface into vaapisink [#711479] - + Allow rescaling of X11 window for vaapisink (Holger Kaelberer) [#711478] - + Optimizations to vaapidecode thread handling (Sebastian Dröge) [#734616] - + Fix deinterlacing from non VA memory buffers (Simon Farnsworth) [#726270] - + Fix clearing of subtitle overlay (Simon Farnsworth) - + Fix clearing of vaapipostproc state during restart (Michael Olbrich) + - Fix vp8enc and flacenc segmentation faults on Windows + - Fix Android build failure due to BSD sed on OS X + - Fix Android build failure with applications targetting API > 20 + - Fix playback of live MS SmoothStreaming streams + - Fix various issues with vtdec and caopengllayersink on OS X + - Fix severe performance degradation in various image decoders + - Fix sample rate negotiation in opusdec + - Fix regression in typefind, causing deadlocks in some situations + - Fix mpegtsmux to set PTS on all output buffers again + - Fix extraction of frame dimensions from SDP in RTP JPEG depayloader + - Fix failure in v4l2videodec when setting of format fails after starting + - ... and many, many more! + +For a full list of bugfixes see [Bugzilla][buglist-1.8.2]. Note that this is +not the full list of changes. For the full list of changes please refer to the +GIT logs or ChangeLogs of the particular modules. -Version 0.5.9 - 29.Jul.2014 -* Add VP8 decoder (+Halley Zhao) -* Add H.264 MVC decoder and encoder (+Sreerenj Balachandran, Xiaowei Li) -* Fix support for Firefox >= 30 when built with GStreamer 1.0 APIs -* Fix MPEG-4:2 decoder hang on skipped frames (Fabrice Bellet) [#733324] -* Fix MPEG-2 decoder to propagate PTS from demuxer (Jan Schmidt) [#732719] -* Improvements to H.264 decoder - + Add support for grayscale encoded clips - + Add minor optimizations to the parsing process - + Make support for interlaced streams more robust [#701340] - + Fix multiple slices decoding with varying slice types [#724518] - + Fix parsing of multiple SEI messages in single NAL units (Aurelien Zanelli) -* Improvements to plugin elements - + Add download capability to vaapidecode [#733243] - + Add support for crop regions in VPP mode [#720730] - + Allow selection of a particular "display-name" for vaapisink [#722247] - + Fix support for headless pipelines, e.g. vaapisink display="drm" mode - + Fix creation of output surface pool for vaapipostproc (Simon Farnsworth) - + Fix vaapipostproc "deinterlace-mode" semantics (Simon Farnsworth) [#726361] - + Fix memory leak in vaapidecode ! {glimagesink,cluttersink} (Matthew Waters) - + Fix vaapidecode hang when downstream errors out (Matthew Waters) [#733897] +[buglist-1.8.2]: https://bugzilla.gnome.org/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&classification=Platform&limit=0&list_id=130196&order=bug_id&product=GStreamer&query_format=advanced&resolution=FIXED&target_milestone=1.8.2 -Version 0.5.8 - 23.Jan.2014 -* Add H.264 video encoding (+Feng Yuan) -* Add MPEG-2 video encoding (+Guangxin Xu) -* Add initial support for GStreamer 1.3 (Matthieu Bouron) -* Add support for H.264 Constrained Baseline profile (Feng Yuan) -* Add support for colorbalance adjustment in vaapipostproc (Halley Zhao) -* Add color space conversion in vaapisink (Holger Kaelberer) [#722255] -* Fix OpenGL interop with clutter-gst and glimagesink elements (Matthieu Bouron) -* Fix decoding of H.264 quantization matrices (+Cong Zhong) [#706406] -* Fix robustness of H.264 decoder when packets are missing -* Fix hang in vaapidecode on SIGINT [+C] (Fen Yuan) [#720584] -* Fix vaapisink initialization with foreign window (Holger Kaelberer) [#722244] -* Fix Sharpening filter in vaapipostproc (Halley Zhao) [#720375] - -Version 0.5.7 - 21.Nov.2013 -* Add support for GStreamer 1.2 (+Victor Jaquez, Sreerenj Balachandran) -* Add support for video processing (VA/VPP) (+Halley Zhao) - + Scaling and color conversion - + Image enhancement filters: Sharpening, Noise Reduction - + Advanced deinterlacing: Motion-Adaptive, Motion-Compensated -* Fix vaapidecode pause/resume/seek capabilities (+Guangxin Xu) -* JPEG decoder bug fixes and improvements - + Add support for multiscan images - + Improve overall performance by +12% - + Fix robustness and tolerance to missing packets - + Fix detection of image boundaries (Junfeng Xu) - + Fix decoding from Logitech Pro C920 cameras (Junfeng Xu) - -Version 0.5.6 - 29.Aug.2013 -* Add render-to-pixmap API to bypass VA/GLX in clutter-gst -* Add initial support for video-processing APIs (+Halley Zhao) -* Add support for video cropping and deinterlacing to the Wayland backend -* Add "force-aspect-ratio" property to vaapisink (Simon Farnsworth) -* Fix support for clutter-gst in GStreamer 0.10 builds -* Fix HW accelerated rendering with SW decoded pipelines -* Fix videotestsrc ! vaapisink pipelines (Guangxin Xu) -* Fix memory leak of raw video uploader objects (Feng Yuan) -* Fix decoding without a video parser element before `vaapidecde' -* Fix regression in MPEG-2 decoder due to incomplete video cropping support -* Fix dead-lock condition on Wayland when the end-of-stream is reached - -Version 0.5.5 - 15.Jul.2013 -* Allow creation of video surfaces with an explicit pixel format -* Allocate VA/GLX capable buffers by default on X11 servers (Victor Jaquez) -* Add support for video cropping in MPEG-2, VC-1 and H.264 codecs (+Sreerenj) -* Fix memory leak when processing interlaced pictures -* Fix creation of VA/GLX textures when video cropping is used -* Fix raw image copies in vaapidownload / vaapiupload (Feng Yuan) -* Fix MPEG-2 quantization matrices reset on new sequence headers (Cong Zhong) -* Fix direct linking of vaapidownload element to xvimagesink (Feng Yuan) -* Fix memory corruption in video pool implementation, e.g. for clutter-gst - -Version 0.5.4 - 14.Jun.2013 -* Streamline core libgstvaapi decoding library (API/ABI changes) -* Use built-in codecparsers by default (or --disable-builtin-codecparsers) -* Fix default Huffman tables generation (Feng Yuan) -* Fix destruction of Wayland display resources -* Fix explicit specification of display type to vaapisink -* Fix memory leak in vaapiupload in GStreamer 0.10 builds (Halley Zhao) -* Fix performance regression caused by improper use of GstTask callback -* Fix raw decoding mode to transfer ownership of surface proxy to caller - -Version 0.5.3 - 18.Apr.2013 -* Add support for GStreamer 1.0.x API (+Sreerenj Balachandran) -* Fix build on Fedora 17 (Víctor Manuel Jáquez) -* Fix vaapidecode heuristics to detect decode timeouts -* Fix fallback to sofware decoding if no hardware decoder is available -* Fix regression in raw decoding mode whereby PTS or picture flags were lost - -Version 0.5.2 - 28.Mar.2013 -* Add support for video seek/reset (+Sreerenj Balachandran) -* Improve MPEG-2 decoder robustness when packets are missing -* Fix support for raw YUV buffers in vaapisink -* Fix build on older Linux distributions with glib < 2.32 -* Fix decoding of MPEG-2 videos with height > 2800 pixels -* Fix MPEG-2 decoding with explicit quantization matrices set (Cong Zhong) -* Fix illegal write in vaapiupload for NV12 surfaces (Holger Kaelberer) - -Version 0.5.1 - 29.Jan.2013 -* Add simple decoder demo that only uses libgstvaapi -* Fix thread-safety issues in the Wayland renderer -* Fix VC-1 decoding bugs #692461, #692312, #692271, #692270, #692267 -* Fix decoding of VC-1 videos in AVI containers (Feng Yuan) -* Fix H.264 parser to zero-initialize key syntax elements -* Fix MPEG-2, H.264 and VC-1 decoders to submit all decoded frames on - -Version 0.5.0 - 15.Jan.2013 -* Optimize MPEG-2 and H.264 decoders -* Use GstVideoDecoder API for vaapidecode (+Sreerenj Balachandran) -* Add support for raw YUV buffers in vaapisink (+Halley Zhao) -* Add support for global-alpha subpictures/overlay (+Holger Kaelberer) -* Fix calculation of the vaapidecode time-out for a surface to get released - -Version 0.4.2 - 18.Dec.2012 -* Fix H.264 decoding on Cedar Trail platforms -* Fix MPEG-4 decoding at end-of-stream (Feng Yuan) -* Fix MPEG-4 decoding when a buffer contains multiple packets (Feng Yuan) -* Fix memory leak in GstVaapiVideoBuffer for images and surfaces (Feng Yuan) -* Fix symbols collision between built-in codecparsers/ and system library -* Use GST_PLUGIN_PATH, if set, to install plugin elements (Halley Zhao) - -Version 0.4.1 - 27.Nov.2012 -* Add support for H.264 interlaced streams -* Add support for Wayland 1.0 protocol (Robert Bradford) -* Add upstream bitstream parsers library (codecparsers) -* Fix build with the GNU gold linker -* Fix detection of H.264 picture boundaries -* Fix memory leak in MPEG-2 decoder for empty user-data packets -* Fix H.264 decoder with MMCO-based reference picture marking process -* Decode pending packets when an end-of-stream is received (+Feng Yuan) -* Use pixel-aspect-ratio from bitstream parsers (Simon Farnsworth) - -Version 0.4.0 - 05.Oct.2012 -* Add support for video rotation -* Add new video display APIs: Wayland and raw DRM for headless pipelines -* Drop FFmpeg-based decoders, only use codecparsers-based ones -* Only reset decoder if meaningful caps changed, e.g. size -* Allocate the minimal number of video surfaces useful for decoding -* Fix vaapisink to scale video down to fit the screen dimensions -* Fix vaapidecode crash when trying to release inexistent lock (Philip Lorenz) - -Version 0.3.8 - 20.Sep.2012 -* Disable FFmpeg-based decoders by default -* Add JPEG decoder (based on codecparsers) -* Fix crash when destroying GstVaapiDisplay objects early -* Fix GLX rendering with FBO + texture-from-pixmap (fallback for VA/GLX) -* Fix rendering with EMGD driver when overlay mode is used -* Fix MPEG-2 decoding on Intel Atom platforms with EMGD driver -* Fix release of dangling proxy surfaces when decoder is reset (Philip Lorenz) - -Version 0.3.7 - 26.Jun.2012 -* Fix vaapidecode to report unsupported codec profiles -* Fix MPEG-2 decoding of streams with extra slice() information -* Map MPEG-2 compatible High profile streams to Main profile -* Map MPEG-4 Simple Scalable profile streams to Advanced Simple (Feng Yuan) -* Fix various MPEG-4 decoding bugs (timestamps, reference frames) (Feng Yuan) -* Don't forcibly resize user provided X windows (Holger Kaelberer) -* Recalculate render rect only if caps are negotiated (Holger Kaelberer) - -Version 0.3.6 - 02.Apr.2012 -* Add support for decoding MPEG-2 interlaced streams -* Add support for interlaced streams with FFmpeg decoders (Holger Kaelberer) -* Add vaapipostproc element for video postprocessing (e.g. deinterlacing) -* Skip all H.264 Filler Data NALs -* Fix crashes in MPEG-4 decoder (Feng Yuan) -* Fix fallback from MPEG-2 Simple to Main profile -* Improve decoding of misformed MPEG-2 streams (+Feng Yuan) -* Avoid a hang in playbin2 for some MPEG-2 TS streams (Feng Yuan) - -Version 0.3.5 - 02.Mar.2012 -* Fix H.264 decoding when emulation prevention bytes are detected -* Skip all H.264 Access Unit (AU) NALs (Feng Yuan) -* Fix modification process of H.264 reference picture lists (Feng Yuan) -* Fix MPEG-2 stream size calculation (Sreerenj Balachandran) -* Fix MPEG-2 decoding on Intel Gen with multiple slices per MB line -* Fix crash when downloading/uploading VA images on PowerVR (Cedar Trail) -* Fix double buffer free issues with some VA drivers -* Fix crash when there is no free surface available for decoding -* Skip profiles which have no entrypoints (Halley Zhao) -* Fix minor memory leaks in plug-in elements - -Version 0.3.4 - 01.Feb.2012 -* Add H.264 decoder (based on codecparsers) -* Add workaround for qtdemux not exposing H.263 profiles (Halley Zhao) -* Alias H.263 Baseline profile to MPEG-4:2 Simple profile (Halley Zhao) -* Use optimized path to submit slice data buffers -* Fix possible memory leak in MPEG-2 decoder -* Fix vaapisink to cap window size to the maximum display size -* Fix MPEG-2, MPEG-4 and VC-1 decoders to refcount reference surfaces properly - -Version 0.3.3 - 16.Jan.2012 -* Add MPEG-2, MPEG-4 and VC-1 decoders (based on codecparsers) -* Add support for GstXOverlay::set_render_rectangle() in vaapisink -* Fix memory leak of GL texture (Nicolas Dufresne) -* Fix vaapisink to automatically fit video to window -* Fix vaapiupload to only set caps on newly created buffers (Nicolas Dufresne) -* Fix gst_vaapi_ensure_display() to honour DISPLAY environment variable - -Version 0.3.2 - 06.Jan.2012 -* Rename vaapiconvert element to vaapiupload -* Fix vaapiupload from NV12 buffers -* Fix possible leaks of VA surfaces in FFmpeg decoder -* Fix memory leak in vaapiupload initialization function -* Fix possible crash in vaapidecode deinitialization code -* Add vaapidownload element to convert from VA surfaces to YUV pixels - -Version 0.3.1 - 16.Dec.2011 -* Fix check for supported VA images -* Add support for partial VA image updates -* Add support for new subtitle/overlay infrastructure (Thibault Saunier) -* Add missing video context queries in vaapisink/vaapiconvert (Nicolas Dufresne) - -Version 0.3.0 - 09.Dec.2011 -* Group all plugins into the same bundle -* Use new XOverlay API (Sreerenj Balachandran) -* Use new GstVideoContext and GstSurfaceBuffer API (Nicolas Dufresne) -* Fix vaapidecode sink caps if decoder is in NULL state (Sreerenj Balachandran) -* Fix auto-plugging and downstream buffer allocation (Nicolas Dufresne) -* Fix crash in VA display init if no VA configs were found (Nicolas Dufresne) - -Version 0.2.7 - 07.Dec.2011 -* Relicense plugins and tests to LGPL v2.1 (SDS) -* Fix MPEG-2 decoding from TS & PS streams -* Fix build with newer versions of FFmpeg -* Fix vaapiconvert direct-rendering modes -* Fix use of invalid data at the end-of-stream - -Version 0.2.6 - 14.Jun.2011 -* Fix licensing terms (LGPL v2.1) - -Version 0.2.5 - 20.Jul.2010 -* Fix build with older VA-API 0.29-sds -* Fix decoding of some H.264 streams. e.g. Ice Age 2 trailer -* Fix VA/GLX support with texture-from-pixmap and GLX version < 1.3 - -Version 0.2.4 - 18.May.2010 -* Fix video rendering rect within an embedder window (Totem) -* Disable GLX rendering when vaapisink uses a foreign X window - -Version 0.2.3 - 16.May.2010 -* Fix memory leak of encoded buffers -* Fix decoder caps to report codec aliases -* Fix VC-1 decoding through the playbin2 pipeline - -Version 0.2.2 - 14.May.2010 -* Fix packaging dependencies -* Fix a crash in the FFmpeg decoder on close -* Fix OpenGL texture internal format (Clutter) -* Fix foreign window size for embedding (Totem) - -Version 0.2.1 - 12.May.2010 -* Fix integration within the playbin2 pipeline -* Fix vaapidecode to expose the HW supported caps only -* Add GstXOverlay interface to vaapisink (Totem media player) - -Version 0.2.0 - 05.May.2010 -* Relicense gst-libs/ code to LGPL v2.1+ -* Add FFmpeg/VAAPI decoder for the new `vaapidecode' element - -Version 0.1.2 - 30.Mar.2010 -* Add AYUV image format -* Add compatibility with the original VA-API 0.29 -* Add OpenGL support through VA/GLX extensions or TFP+FBO fallback - -Version 0.1.1 - 23.Mar.2010 -* Document public API for libgstvaapi-*.so.* -* Optimize `vaapiconvert' pipeline (direct-rendering) -* Allow `vaapisink` to render videos in fullscreen mode - -Version 0.1.0 - 16.Mar.2010 -* Initial release diff -Nru gstreamer-vaapi-0.7.0/patches/Makefile.am gstreamer-vaapi-1.8.2/patches/Makefile.am --- gstreamer-vaapi-0.7.0/patches/Makefile.am 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/patches/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -SUBDIRS = videoparsers - --include $(top_srcdir)/git.mk diff -Nru gstreamer-vaapi-0.7.0/patches/Makefile.in gstreamer-vaapi-1.8.2/patches/Makefile.in --- gstreamer-vaapi-0.7.0/patches/Makefile.in 2015-12-07 10:54:25.000000000 +0000 +++ gstreamer-vaapi-1.8.2/patches/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,706 +0,0 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2014 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -subdir = patches -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -am__recursive_targets = \ - $(RECURSIVE_TARGETS) \ - $(RECURSIVE_CLEAN_TARGETS) \ - $(am__extra_recursive_targets) -AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -am__DIST_COMMON = $(srcdir)/Makefile.in -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DLOPEN_LIBS = @DLOPEN_LIBS@ -DRM_CFLAGS = @DRM_CFLAGS@ -DRM_LIBS = @DRM_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGL_CFLAGS = @EGL_CFLAGS@ -EGL_LIBS = @EGL_LIBS@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GIT = @GIT@ -GLES2_CFLAGS = @GLES2_CFLAGS@ -GLES2_LIBS = @GLES2_LIBS@ -GLES3_CFLAGS = @GLES3_CFLAGS@ -GLES3_LIBS = @GLES3_LIBS@ -GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_LIBS = @GLIB_LIBS@ -GLIB_VERSION_REQUIRED = @GLIB_VERSION_REQUIRED@ -GL_CFLAGS = @GL_CFLAGS@ -GL_LIBS = @GL_LIBS@ -GMODULE_CFLAGS = @GMODULE_CFLAGS@ -GMODULE_LIBS = @GMODULE_LIBS@ -GMODULE_VERSION_REQUIRED = @GMODULE_VERSION_REQUIRED@ -GREP = @GREP@ -GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ -GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ -GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ -GST_API_VERSION = @GST_API_VERSION@ -GST_BASEVIDEO_CFLAGS = @GST_BASEVIDEO_CFLAGS@ -GST_BASEVIDEO_LIBS = @GST_BASEVIDEO_LIBS@ -GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ -GST_BASE_LIBS = @GST_BASE_LIBS@ -GST_CFLAGS = @GST_CFLAGS@ -GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ -GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ -GST_GL_CFLAGS = @GST_GL_CFLAGS@ -GST_GL_LIBS = @GST_GL_LIBS@ -GST_INTERFACES_CFLAGS = @GST_INTERFACES_CFLAGS@ -GST_INTERFACES_LIBS = @GST_INTERFACES_LIBS@ -GST_LIBS = @GST_LIBS@ -GST_PKG_VERSION = @GST_PKG_VERSION@ -GST_PLUGINS_BAD_VERSION_REQUIRED = @GST_PLUGINS_BAD_VERSION_REQUIRED@ -GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ -GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ -GST_PLUGINS_BASE_VERSION_REQUIRED = @GST_PLUGINS_BASE_VERSION_REQUIRED@ -GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ -GST_PLUGIN_PATH_1_0 = @GST_PLUGIN_PATH_1_0@ -GST_VAAPI_LT_LDFLAGS = @GST_VAAPI_LT_LDFLAGS@ -GST_VAAPI_LT_VERSION = @GST_VAAPI_LT_VERSION@ -GST_VAAPI_MAJOR_VERSION = @GST_VAAPI_MAJOR_VERSION@ -GST_VERSION_REQUIRED = @GST_VERSION_REQUIRED@ -GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ -GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ -GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ -GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ -GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ -GTKDOC_MKPDF = @GTKDOC_MKPDF@ -GTKDOC_REBASE = @GTKDOC_REBASE@ -GTKDOC_VERSION = @GTKDOC_VERSION@ -HTML_DIR = @HTML_DIR@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBVA_CFLAGS = @LIBVA_CFLAGS@ -LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ -LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ -LIBVA_LIBS = @LIBVA_LIBS@ -LIBVA_PACKAGE_VERSION = @LIBVA_PACKAGE_VERSION@ -LIBVA_PKGNAME = @LIBVA_PKGNAME@ -LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ -LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ -LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ -LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ -LIBVA_X11_PKGNAME = @LIBVA_X11_PKGNAME@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATCH = @PATCH@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TODAY = @TODAY@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ -VERSION = @VERSION@ -WAYLAND_API_VERSION = @WAYLAND_API_VERSION@ -WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ -WAYLAND_LIBS = @WAYLAND_LIBS@ -X11_CFLAGS = @X11_CFLAGS@ -X11_LIBS = @X11_LIBS@ -XRANDR_CFLAGS = @XRANDR_CFLAGS@ -XRANDR_LIBS = @XRANDR_LIBS@ -XRENDER_CFLAGS = @XRENDER_CFLAGS@ -XRENDER_LIBS = @XRENDER_LIBS@ -YASM = @YASM@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ -plugindir = @plugindir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -SUBDIRS = videoparsers -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu patches/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu patches/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(am__recursive_targets): - @fail=; \ - if $(am__make_keepgoing); then \ - failcom='fail=yes'; \ - else \ - failcom='exit 1'; \ - fi; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-recursive -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-recursive - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-recursive - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: - -.MAKE: $(am__recursive_targets) install-am install-strip - -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ - check-am clean clean-generic clean-libtool cscopelist-am ctags \ - ctags-am distclean distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-am uninstall uninstall-am - -.PRECIOUS: Makefile - - --include $(top_srcdir)/git.mk - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru gstreamer-vaapi-0.7.0/patches/videoparsers/0001-plugins-compile-the-built-in-video-parsers-as-vaapip.patch gstreamer-vaapi-1.8.2/patches/videoparsers/0001-plugins-compile-the-built-in-video-parsers-as-vaapip.patch --- gstreamer-vaapi-0.7.0/patches/videoparsers/0001-plugins-compile-the-built-in-video-parsers-as-vaapip.patch 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/patches/videoparsers/0001-plugins-compile-the-built-in-video-parsers-as-vaapip.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -From e412ece68af9b1a4ce7309774b38ec548a2d709f Mon Sep 17 00:00:00 2001 -From: Gwenole Beauchesne -Date: Mon, 28 Apr 2014 17:44:03 +0200 -Subject: [PATCH 1/6] plugins: compile the built-in video parsers as - "vaapiparse" element. - -The built-in video parsers elements are built into a single DSO named -libgstvaapi_parse.so. The various video parsers could be accessed as -vaapiparse_CODEC. ---- - gst/vaapi/gsth264parse.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/gst/vaapi/gsth264parse.c b/gst/vaapi/gsth264parse.c -index 915c2d7..96901e0 100644 ---- a/gst/vaapi/gsth264parse.c -+++ b/gst/vaapi/gsth264parse.c -@@ -26,6 +26,7 @@ - # include "config.h" - #endif - -+#include "gstvaapiparse.h" - #include - #include - #include -@@ -122,7 +123,8 @@ gst_h264_parse_class_init (GstH264ParseClass * klass) - GstBaseParseClass *parse_class = GST_BASE_PARSE_CLASS (klass); - GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); - -- GST_DEBUG_CATEGORY_INIT (h264_parse_debug, "h264parse", 0, "h264 parser"); -+ GST_DEBUG_CATEGORY_INIT (h264_parse_debug, "vaapiparse_h264", 0, -+ "h264 parser"); - - gobject_class->finalize = gst_h264_parse_finalize; - gobject_class->set_property = gst_h264_parse_set_property; --- -2.5.1 - diff -Nru gstreamer-vaapi-0.7.0/patches/videoparsers/0002-h264parse-fix-build-with-older-GStreamer-1.x-stacks.patch gstreamer-vaapi-1.8.2/patches/videoparsers/0002-h264parse-fix-build-with-older-GStreamer-1.x-stacks.patch --- gstreamer-vaapi-0.7.0/patches/videoparsers/0002-h264parse-fix-build-with-older-GStreamer-1.x-stacks.patch 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/patches/videoparsers/0002-h264parse-fix-build-with-older-GStreamer-1.x-stacks.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -From 48233a9eeb20d19fbc3f5550d8fecb4271be1822 Mon Sep 17 00:00:00 2001 -From: Gwenole Beauchesne -Date: Wed, 26 Aug 2015 06:50:41 +0300 -Subject: [PATCH 2/6] h264parse: fix build with older GStreamer 1.x stacks - ---- - gst/vaapi/gsth264parse.c | 9 +++++++++ - gst/vaapi/gsth264parse.h | 1 + - 2 files changed, 10 insertions(+) - -diff --git a/gst/vaapi/gsth264parse.c b/gst/vaapi/gsth264parse.c -index 96901e0..f472a5e 100644 ---- a/gst/vaapi/gsth264parse.c -+++ b/gst/vaapi/gsth264parse.c -@@ -165,8 +165,12 @@ gst_h264_parse_init (GstH264Parse * h264parse) - { - h264parse->frame_out = gst_adapter_new (); - gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (h264parse), FALSE); -+#if GST_CHECK_VERSION(1,3,0) - GST_PAD_SET_ACCEPT_INTERSECT (GST_BASE_PARSE_SINK_PAD (h264parse)); -+#endif -+#if GST_CHECK_VERSION(1,5,0) - GST_PAD_SET_ACCEPT_TEMPLATE (GST_BASE_PARSE_SINK_PAD (h264parse)); -+#endif - } - - -@@ -2216,8 +2220,13 @@ gst_h264_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) - GST_TAG_VIDEO_CODEC, caps); - gst_caps_unref (caps); - -+#if GST_CHECK_VERSION(1,5,0) - gst_base_parse_merge_tags (parse, taglist, GST_TAG_MERGE_REPLACE); - gst_tag_list_unref (taglist); -+#else -+ gst_pad_push_event (GST_BASE_PARSE_SRC_PAD (h264parse), -+ gst_event_new_tag (taglist)); -+#endif - - /* also signals the end of first-frame processing */ - h264parse->sent_codec_tag = TRUE; -diff --git a/gst/vaapi/gsth264parse.h b/gst/vaapi/gsth264parse.h -index 58d818c..617e616 100644 ---- a/gst/vaapi/gsth264parse.h -+++ b/gst/vaapi/gsth264parse.h -@@ -27,6 +27,7 @@ - - #include - #include -+#include - #include - #include - --- -2.5.1 diff -Nru gstreamer-vaapi-0.7.0/patches/videoparsers/0003-h264parse-default-to-byte-stream-nalu-format-Annex-B.patch gstreamer-vaapi-1.8.2/patches/videoparsers/0003-h264parse-default-to-byte-stream-nalu-format-Annex-B.patch --- gstreamer-vaapi-0.7.0/patches/videoparsers/0003-h264parse-default-to-byte-stream-nalu-format-Annex-B.patch 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/patches/videoparsers/0003-h264parse-default-to-byte-stream-nalu-format-Annex-B.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -From 56df8be6dff017d32218bb3111e6ae6ff1316dec Mon Sep 17 00:00:00 2001 -From: Gwenole Beauchesne -Date: Tue, 26 May 2015 09:33:57 +0300 -Subject: [PATCH 3/6] h264parse: default to byte-stream/nalu format (Annex B). - -Always default to stream-format=byte-stream,alignment=nalu if avcC -format was not detected. This is the natural stream format specified -in the standard (Annex.B): a series of NAL units prefixed with the -usual start code. - -https://bugzilla.gnome.org/show_bug.cgi?id=732167 - -Signed-off-by: Gwenole Beauchesne -Signed-off-by: Sreerenj Balachandran ---- - gst/vaapi/gsth264parse.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/gst/vaapi/gsth264parse.c b/gst/vaapi/gsth264parse.c -index f472a5e..f1ed269 100644 ---- a/gst/vaapi/gsth264parse.c -+++ b/gst/vaapi/gsth264parse.c -@@ -405,7 +405,8 @@ gst_h264_parse_negotiate (GstH264Parse * h264parse, gint in_format, - if (!format) - format = GST_H264_PARSE_FORMAT_BYTE; - if (!align) -- align = GST_H264_PARSE_ALIGN_AU; -+ align = format == GST_H264_PARSE_FORMAT_BYTE ? GST_H264_PARSE_ALIGN_NAL : -+ GST_H264_PARSE_ALIGN_AU; - - GST_DEBUG_OBJECT (h264parse, "selected format %s, alignment %s", - gst_h264_parse_get_string (h264parse, TRUE, format), -@@ -2452,6 +2453,8 @@ gst_h264_parse_set_caps (GstBaseParse * parse, GstCaps * caps) - - /* bytestream caps sanity checks */ - if (format == GST_H264_PARSE_FORMAT_BYTE) { -+ if (align == GST_H264_PARSE_ALIGN_NONE) -+ align = GST_H264_PARSE_ALIGN_NAL; - /* should have SPS/PSS in-band (and/or oob in streamheader field) */ - if (codec_data_value != NULL) - goto bytestream_caps_with_codec_data; --- -2.5.1 - diff -Nru gstreamer-vaapi-0.7.0/patches/videoparsers/0004-h264parse-Disable-3D-video-support-for-GStreamer-1.5.patch gstreamer-vaapi-1.8.2/patches/videoparsers/0004-h264parse-Disable-3D-video-support-for-GStreamer-1.5.patch --- gstreamer-vaapi-0.7.0/patches/videoparsers/0004-h264parse-Disable-3D-video-support-for-GStreamer-1.5.patch 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/patches/videoparsers/0004-h264parse-Disable-3D-video-support-for-GStreamer-1.5.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,106 +0,0 @@ -From dbdc05803a63c4d530ea0c2932af2b35df5467b3 Mon Sep 17 00:00:00 2001 -From: Sreerenj Balachandran -Date: Tue, 21 Jul 2015 12:13:18 +0300 -Subject: [PATCH 4/6] h264parse: Disable 3D video support for GStreamer < 1.5 - -All API/ABI changes for S3D/MVC are added in 1.5, backporting -them to older verison is not recommended. - -Signed-off-by: Sreerenj Balachandran ---- - gst/vaapi/gsth264parse.c | 11 ++++++++++- - gst/vaapi/gsth264parse.h | 2 ++ - 2 files changed, 12 insertions(+), 1 deletion(-) - -diff --git a/gst/vaapi/gsth264parse.c b/gst/vaapi/gsth264parse.c -index f1ed269..7ed6db8 100644 ---- a/gst/vaapi/gsth264parse.c -+++ b/gst/vaapi/gsth264parse.c -@@ -218,9 +218,11 @@ gst_h264_parse_reset_stream_info (GstH264Parse * h264parse) - h264parse->have_pps = FALSE; - h264parse->have_sps = FALSE; - -+#if GST_CHECK_VERSION(1,5,0) - h264parse->multiview_mode = GST_VIDEO_MULTIVIEW_MODE_NONE; - h264parse->multiview_flags = GST_VIDEO_MULTIVIEW_FLAGS_NONE; - h264parse->first_in_bundle = TRUE; -+#endif - - h264parse->align = GST_H264_PARSE_ALIGN_NONE; - h264parse->format = GST_H264_PARSE_FORMAT_NONE; -@@ -571,6 +573,7 @@ gst_h264_parse_process_sei (GstH264Parse * h264parse, GstH264NalUnit * nalu) - /* Additional messages that are not innerly useful to the - * element but for debugging purposes */ - case GST_H264_SEI_STEREO_VIDEO_INFO:{ -+#if GST_CHECK_VERSION(1,5,0) - GstVideoMultiviewMode mview_mode = GST_VIDEO_MULTIVIEW_MODE_NONE; - GstVideoMultiviewFlags mview_flags = GST_VIDEO_MULTIVIEW_FLAGS_NONE; - -@@ -602,9 +605,11 @@ gst_h264_parse_process_sei (GstH264Parse * h264parse, GstH264NalUnit * nalu) - /* output caps need to be changed */ - gst_h264_parse_update_src_caps (h264parse, NULL); - } -+#endif - break; - } - case GST_H264_SEI_FRAME_PACKING:{ -+#if GST_CHECK_VERSION(1,5,0) - GstVideoMultiviewMode mview_mode = GST_VIDEO_MULTIVIEW_MODE_NONE; - GstVideoMultiviewFlags mview_flags = GST_VIDEO_MULTIVIEW_FLAGS_NONE; - -@@ -693,6 +698,7 @@ gst_h264_parse_process_sei (GstH264Parse * h264parse, GstH264NalUnit * nalu) - /* output caps need to be changed */ - gst_h264_parse_update_src_caps (h264parse, NULL); - } -+#endif - break; - } - } -@@ -1762,9 +1768,11 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps) - gint width, height; - GstClockTime latency; - -+#if GST_CHECK_VERSION(1,5,0) - const gchar *caps_mview_mode = NULL; - GstVideoMultiviewMode mview_mode = h264parse->multiview_mode; - GstVideoMultiviewFlags mview_flags = h264parse->multiview_flags; -+#endif - - fps_num = h264parse->fps_num; - fps_den = h264parse->fps_den; -@@ -1796,6 +1804,7 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps) - } - } - -+#if GST_CHECK_VERSION(1,5,0) - /* Pass through or set output stereo/multiview config */ - if (s && gst_structure_has_field (s, "multiview-mode")) { - caps_mview_mode = gst_structure_get_string (s, "multiview-mode"); -@@ -1814,7 +1823,7 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps) - GST_TYPE_VIDEO_MULTIVIEW_FLAGSET, mview_flags, - GST_FLAG_SET_MASK_EXACT, NULL); - } -- -+#endif - gst_caps_set_simple (caps, "width", G_TYPE_INT, width, - "height", G_TYPE_INT, height, NULL); - -diff --git a/gst/vaapi/gsth264parse.h b/gst/vaapi/gsth264parse.h -index 617e616..1b89d31 100644 ---- a/gst/vaapi/gsth264parse.h -+++ b/gst/vaapi/gsth264parse.h -@@ -124,10 +124,12 @@ struct _GstH264Parse - GstClockTime pending_key_unit_ts; - GstEvent *force_key_unit_event; - -+#if GST_CHECK_VERSION(1,5,0) - /* Stereo / multiview info */ - GstVideoMultiviewMode multiview_mode; - GstVideoMultiviewFlags multiview_flags; - gboolean first_in_bundle; -+#endif - }; - - struct _GstH264ParseClass --- -2.5.1 diff -Nru gstreamer-vaapi-0.7.0/patches/videoparsers/0005-videoparsers-h264-Disable-passthorugh-mode-enabling.patch gstreamer-vaapi-1.8.2/patches/videoparsers/0005-videoparsers-h264-Disable-passthorugh-mode-enabling.patch --- gstreamer-vaapi-0.7.0/patches/videoparsers/0005-videoparsers-h264-Disable-passthorugh-mode-enabling.patch 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/patches/videoparsers/0005-videoparsers-h264-Disable-passthorugh-mode-enabling.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -From 90251ef253564e7e53c754205cb506e863a93a6c Mon Sep 17 00:00:00 2001 -From: Sreerenj Balachandran -Date: Thu, 26 Nov 2015 19:13:43 +0200 -Subject: [PATCH] videoparsers: h264: Disable passthorugh mode enabling - -Enabling passthorugh mode for optimization is cauing multiple -issues while parsing MVC streams. Specifically if streams have -two separate layers (base-view and non-base-view). - -Proper fixes needed in many places: -(handle prefix nal unit, handle non-base-view slice nal extension, -fix the picture_start detection for multi-layer-mvc streams etc) - -https://bugzilla.gnome.org/show_bug.cgi?id=758656 ---- - gst/vaapi/gsth264parse.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/gst/vaapi/gsth264parse.c b/gst/vaapi/gsth264parse.c -index 915c2d7..445a791 100644 ---- a/gst/vaapi/gsth264parse.c -+++ b/gst/vaapi/gsth264parse.c -@@ -2356,6 +2356,9 @@ gst_h264_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) - } - } - -+ /* Fixme: setting passthrough mode for MVC streams causing multiple -+ * issues. Disabing passthourgh mode for now */ -+#if 0 - /* If SPS/PPS and a keyframe have been parsed, and we're not converting, - * we might switch to passthrough mode now on the basis that we've seen - * the SEI packets and know optional caps params (such as multiview). -@@ -2367,6 +2370,7 @@ gst_h264_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) - gst_base_parse_set_passthrough (parse, TRUE); - } - } -+#endif - - gst_h264_parse_reset_frame (h264parse); - --- -2.5.0 - diff -Nru gstreamer-vaapi-0.7.0/patches/videoparsers/0006-h265parse-include-gstvaapiparse.h.patch gstreamer-vaapi-1.8.2/patches/videoparsers/0006-h265parse-include-gstvaapiparse.h.patch --- gstreamer-vaapi-0.7.0/patches/videoparsers/0006-h265parse-include-gstvaapiparse.h.patch 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/patches/videoparsers/0006-h265parse-include-gstvaapiparse.h.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -From 06ab8f433c02590b63e8afdf394a2a1caf570fad Mon Sep 17 00:00:00 2001 -From: Sreerenj Balachandran -Date: Thu, 16 Apr 2015 18:04:53 +0300 -Subject: [PATCH 5/6] h265parse: include gstvaapiparse.h - ---- - gst/vaapi/gsth265parse.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/gst/vaapi/gsth265parse.c b/gst/vaapi/gsth265parse.c -index d649681..5f65ab6 100644 ---- a/gst/vaapi/gsth265parse.c -+++ b/gst/vaapi/gsth265parse.c -@@ -22,6 +22,7 @@ - # include "config.h" - #endif - -+#include "gstvaapiparse.h" - #include - #include - #include -@@ -100,7 +101,7 @@ gst_h265_parse_class_init (GstH265ParseClass * klass) - GstBaseParseClass *parse_class = GST_BASE_PARSE_CLASS (klass); - GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); - -- GST_DEBUG_CATEGORY_INIT (h265_parse_debug, "h265parse", 0, "h265 parser"); -+ GST_DEBUG_CATEGORY_INIT (h265_parse_debug, "vaapiparse_h265", 0, "h265 parser"); - - gobject_class->finalize = gst_h265_parse_finalize; - gobject_class->set_property = gst_h265_parse_set_property; --- -2.5.1 diff -Nru gstreamer-vaapi-0.7.0/patches/videoparsers/0007-h265parse-fix-build-with-GStreamer-1.5.patch gstreamer-vaapi-1.8.2/patches/videoparsers/0007-h265parse-fix-build-with-GStreamer-1.5.patch --- gstreamer-vaapi-0.7.0/patches/videoparsers/0007-h265parse-fix-build-with-GStreamer-1.5.patch 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/patches/videoparsers/0007-h265parse-fix-build-with-GStreamer-1.5.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -From aaf9569d096392d73f45bcf9973d58b90a7ecd27 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= - -Date: Mon, 14 Sep 2015 19:11:59 +0200 -Subject: [PATCH 6/6] h265parse: fix build with GStreamer < 1.5 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Víctor Manuel Jáquez Leal ---- - gst/vaapi/gsth265parse.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/gst/vaapi/gsth265parse.c b/gst/vaapi/gsth265parse.c -index 5f65ab6..35b0812 100644 ---- a/gst/vaapi/gsth265parse.c -+++ b/gst/vaapi/gsth265parse.c -@@ -141,8 +141,12 @@ gst_h265_parse_init (GstH265Parse * h265parse) - { - h265parse->frame_out = gst_adapter_new (); - gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (h265parse), FALSE); -+#if GST_CHECK_VERSION(1,3,0) - GST_PAD_SET_ACCEPT_INTERSECT (GST_BASE_PARSE_SINK_PAD (h265parse)); -+#endif -+#if GST_CHECK_VERSION(1,5,0) - GST_PAD_SET_ACCEPT_TEMPLATE (GST_BASE_PARSE_SINK_PAD (h265parse)); -+#endif - } - - -@@ -1774,8 +1778,14 @@ gst_h265_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) - GST_TAG_VIDEO_CODEC, caps); - gst_caps_unref (caps); - -+#if GST_CHECK_VERSION(1,5,0) - gst_base_parse_merge_tags (parse, taglist, GST_TAG_MERGE_REPLACE); - gst_tag_list_unref (taglist); -+#else -+ gst_pad_push_event (GST_BASE_PARSE_SRC_PAD (h265parse), -+ gst_event_new_tag (taglist)); -+#endif -+ - - /* also signals the end of first-frame processing */ - h265parse->sent_codec_tag = TRUE; --- -2.5.1 diff -Nru gstreamer-vaapi-0.7.0/patches/videoparsers/Makefile.am gstreamer-vaapi-1.8.2/patches/videoparsers/Makefile.am --- gstreamer-vaapi-0.7.0/patches/videoparsers/Makefile.am 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/patches/videoparsers/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -include series.frag - -EXTRA_DIST = \ - series.frag \ - $(videoparsers_patches_base) \ - $(videoparsers_patches_1_4p) \ - $(NULL) - --include $(top_srcdir)/git.mk diff -Nru gstreamer-vaapi-0.7.0/patches/videoparsers/Makefile.in gstreamer-vaapi-1.8.2/patches/videoparsers/Makefile.in --- gstreamer-vaapi-0.7.0/patches/videoparsers/Makefile.in 2015-12-07 10:54:25.000000000 +0000 +++ gstreamer-vaapi-1.8.2/patches/videoparsers/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,547 +0,0 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2014 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# sources.frag - Generated list of patches for videoparsers (-*- makefile -*-) -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -subdir = patches/videoparsers -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/series.frag -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DLOPEN_LIBS = @DLOPEN_LIBS@ -DRM_CFLAGS = @DRM_CFLAGS@ -DRM_LIBS = @DRM_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGL_CFLAGS = @EGL_CFLAGS@ -EGL_LIBS = @EGL_LIBS@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GIT = @GIT@ -GLES2_CFLAGS = @GLES2_CFLAGS@ -GLES2_LIBS = @GLES2_LIBS@ -GLES3_CFLAGS = @GLES3_CFLAGS@ -GLES3_LIBS = @GLES3_LIBS@ -GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_LIBS = @GLIB_LIBS@ -GLIB_VERSION_REQUIRED = @GLIB_VERSION_REQUIRED@ -GL_CFLAGS = @GL_CFLAGS@ -GL_LIBS = @GL_LIBS@ -GMODULE_CFLAGS = @GMODULE_CFLAGS@ -GMODULE_LIBS = @GMODULE_LIBS@ -GMODULE_VERSION_REQUIRED = @GMODULE_VERSION_REQUIRED@ -GREP = @GREP@ -GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ -GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ -GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ -GST_API_VERSION = @GST_API_VERSION@ -GST_BASEVIDEO_CFLAGS = @GST_BASEVIDEO_CFLAGS@ -GST_BASEVIDEO_LIBS = @GST_BASEVIDEO_LIBS@ -GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ -GST_BASE_LIBS = @GST_BASE_LIBS@ -GST_CFLAGS = @GST_CFLAGS@ -GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ -GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ -GST_GL_CFLAGS = @GST_GL_CFLAGS@ -GST_GL_LIBS = @GST_GL_LIBS@ -GST_INTERFACES_CFLAGS = @GST_INTERFACES_CFLAGS@ -GST_INTERFACES_LIBS = @GST_INTERFACES_LIBS@ -GST_LIBS = @GST_LIBS@ -GST_PKG_VERSION = @GST_PKG_VERSION@ -GST_PLUGINS_BAD_VERSION_REQUIRED = @GST_PLUGINS_BAD_VERSION_REQUIRED@ -GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ -GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ -GST_PLUGINS_BASE_VERSION_REQUIRED = @GST_PLUGINS_BASE_VERSION_REQUIRED@ -GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ -GST_PLUGIN_PATH_1_0 = @GST_PLUGIN_PATH_1_0@ -GST_VAAPI_LT_LDFLAGS = @GST_VAAPI_LT_LDFLAGS@ -GST_VAAPI_LT_VERSION = @GST_VAAPI_LT_VERSION@ -GST_VAAPI_MAJOR_VERSION = @GST_VAAPI_MAJOR_VERSION@ -GST_VERSION_REQUIRED = @GST_VERSION_REQUIRED@ -GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ -GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ -GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ -GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ -GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ -GTKDOC_MKPDF = @GTKDOC_MKPDF@ -GTKDOC_REBASE = @GTKDOC_REBASE@ -GTKDOC_VERSION = @GTKDOC_VERSION@ -HTML_DIR = @HTML_DIR@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBVA_CFLAGS = @LIBVA_CFLAGS@ -LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ -LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ -LIBVA_LIBS = @LIBVA_LIBS@ -LIBVA_PACKAGE_VERSION = @LIBVA_PACKAGE_VERSION@ -LIBVA_PKGNAME = @LIBVA_PKGNAME@ -LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ -LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ -LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ -LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ -LIBVA_X11_PKGNAME = @LIBVA_X11_PKGNAME@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATCH = @PATCH@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TODAY = @TODAY@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ -VERSION = @VERSION@ -WAYLAND_API_VERSION = @WAYLAND_API_VERSION@ -WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ -WAYLAND_LIBS = @WAYLAND_LIBS@ -X11_CFLAGS = @X11_CFLAGS@ -X11_LIBS = @X11_LIBS@ -XRANDR_CFLAGS = @XRANDR_CFLAGS@ -XRANDR_LIBS = @XRANDR_LIBS@ -XRENDER_CFLAGS = @XRENDER_CFLAGS@ -XRENDER_LIBS = @XRENDER_LIBS@ -YASM = @YASM@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ -plugindir = @plugindir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -videoparsers_patches_base = \ - 0001-plugins-compile-the-built-in-video-parsers-as-vaapip.patch \ - 0002-h264parse-fix-build-with-older-GStreamer-1.x-stacks.patch \ - 0003-h264parse-default-to-byte-stream-nalu-format-Annex-B.patch \ - 0004-h264parse-Disable-3D-video-support-for-GStreamer-1.5.patch \ - 0005-videoparsers-h264-Disable-passthorugh-mode-enabling.patch \ - $(NULL) - -videoparsers_patches_1_4p = \ - 0006-h265parse-include-gstvaapiparse.h.patch \ - 0007-h265parse-fix-build-with-GStreamer-1.5.patch \ - $(NULL) - -EXTRA_DIST = \ - series.frag \ - $(videoparsers_patches_base) \ - $(videoparsers_patches_1_4p) \ - $(NULL) - -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/series.frag $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu patches/videoparsers/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu patches/videoparsers/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; -$(srcdir)/series.frag $(am__empty): - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -tags TAGS: - -ctags CTAGS: - -cscope cscopelist: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: install-am install-strip - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - cscopelist-am ctags-am distclean distclean-generic \ - distclean-libtool distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags-am uninstall uninstall-am - -.PRECIOUS: Makefile - - --include $(top_srcdir)/git.mk - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru gstreamer-vaapi-0.7.0/patches/videoparsers/series.frag gstreamer-vaapi-1.8.2/patches/videoparsers/series.frag --- gstreamer-vaapi-0.7.0/patches/videoparsers/series.frag 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/patches/videoparsers/series.frag 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -# sources.frag - Generated list of patches for videoparsers (-*- makefile -*-) - -videoparsers_patches_base = \ - 0001-plugins-compile-the-built-in-video-parsers-as-vaapip.patch \ - 0002-h264parse-fix-build-with-older-GStreamer-1.x-stacks.patch \ - 0003-h264parse-default-to-byte-stream-nalu-format-Annex-B.patch \ - 0004-h264parse-Disable-3D-video-support-for-GStreamer-1.5.patch \ - 0005-videoparsers-h264-Disable-passthorugh-mode-enabling.patch \ - $(NULL) - -videoparsers_patches_1_4p = \ - 0006-h265parse-include-gstvaapiparse.h.patch \ - 0007-h265parse-fix-build-with-GStreamer-1.5.patch \ - $(NULL) diff -Nru gstreamer-vaapi-0.7.0/pkgconfig/gstreamer-vaapi-drm.pc.in gstreamer-vaapi-1.8.2/pkgconfig/gstreamer-vaapi-drm.pc.in --- gstreamer-vaapi-0.7.0/pkgconfig/gstreamer-vaapi-drm.pc.in 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/pkgconfig/gstreamer-vaapi-drm.pc.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@/gstreamer-@GST_PKG_VERSION@ -pluginsdir=@libdir@/gstreamer-@GST_PKG_VERSION@ - -Name: GStreamer VA-API (DRM) Plugins Libraries -Description: Streaming media framework, VA-API (DRM) plugins libraries -Requires: gstreamer-vaapi-@GST_PKG_VERSION@ libva-drm -Version: @VERSION@ -Libs: -L${libdir} -lgstvaapi-drm-@GST_API_VERSION@ -Cflags: -I${includedir} diff -Nru gstreamer-vaapi-0.7.0/pkgconfig/gstreamer-vaapi-glx.pc.in gstreamer-vaapi-1.8.2/pkgconfig/gstreamer-vaapi-glx.pc.in --- gstreamer-vaapi-0.7.0/pkgconfig/gstreamer-vaapi-glx.pc.in 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/pkgconfig/gstreamer-vaapi-glx.pc.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@/gstreamer-@GST_PKG_VERSION@ -pluginsdir=@libdir@/gstreamer-@GST_PKG_VERSION@ - -Name: GStreamer VA-API (GLX) Plugins Libraries -Description: Streaming media framework, VA-API (GLX) plugins libraries -Requires: gstreamer-vaapi-@GST_PKG_VERSION@ @LIBVA_GLX_PKGNAME@ -Version: @VERSION@ -Libs: -L${libdir} -lgstvaapi-glx-@GST_API_VERSION@ -Cflags: -I${includedir} diff -Nru gstreamer-vaapi-0.7.0/pkgconfig/gstreamer-vaapi.pc.in gstreamer-vaapi-1.8.2/pkgconfig/gstreamer-vaapi.pc.in --- gstreamer-vaapi-0.7.0/pkgconfig/gstreamer-vaapi.pc.in 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/pkgconfig/gstreamer-vaapi.pc.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@/gstreamer-@GST_PKG_VERSION@ -pluginsdir=@libdir@/gstreamer-@GST_PKG_VERSION@ - -Name: GStreamer VA-API Plugins Libraries -Description: Streaming media framework, VA-API plugins libraries -Requires: gstreamer-@GST_PKG_VERSION@ >= @GST_VERSION_REQUIRED@ gstreamer-base-@GST_PKG_VERSION@ >= @GST_PLUGINS_BASE_VERSION_REQUIRED@ @LIBVA_PKGNAME@ -Version: @VERSION@ -Libs: -L${libdir} -lgstvaapi-@GST_API_VERSION@ -Cflags: -I${includedir} diff -Nru gstreamer-vaapi-0.7.0/pkgconfig/gstreamer-vaapi-wayland.pc.in gstreamer-vaapi-1.8.2/pkgconfig/gstreamer-vaapi-wayland.pc.in --- gstreamer-vaapi-0.7.0/pkgconfig/gstreamer-vaapi-wayland.pc.in 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/pkgconfig/gstreamer-vaapi-wayland.pc.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@/gstreamer-@GST_PKG_VERSION@ -pluginsdir=@libdir@/gstreamer-@GST_PKG_VERSION@ - -Name: GStreamer VA-API (Wayland) Plugins Libraries -Description: Streaming media framework, VA-API (Wayland) plugins libraries -Requires: gstreamer-vaapi-@GST_PKG_VERSION@ libva-wayland -Version: @VERSION@ -Libs: -L${libdir} -lgstvaapi-wayland-@GST_API_VERSION@ -Cflags: -I${includedir} diff -Nru gstreamer-vaapi-0.7.0/pkgconfig/gstreamer-vaapi-x11.pc.in gstreamer-vaapi-1.8.2/pkgconfig/gstreamer-vaapi-x11.pc.in --- gstreamer-vaapi-0.7.0/pkgconfig/gstreamer-vaapi-x11.pc.in 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/pkgconfig/gstreamer-vaapi-x11.pc.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@/gstreamer-@GST_PKG_VERSION@ -pluginsdir=@libdir@/gstreamer-@GST_PKG_VERSION@ - -Name: GStreamer VA-API (X11) Plugins Libraries -Description: Streaming media framework, VA-API (X11) plugins libraries -Requires: gstreamer-vaapi-@GST_PKG_VERSION@ @LIBVA_X11_PKGNAME@ -Version: @VERSION@ -Libs: -L${libdir} -lgstvaapi-x11-@GST_API_VERSION@ -Cflags: -I${includedir} diff -Nru gstreamer-vaapi-0.7.0/pkgconfig/Makefile.am gstreamer-vaapi-1.8.2/pkgconfig/Makefile.am --- gstreamer-vaapi-0.7.0/pkgconfig/Makefile.am 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/pkgconfig/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -pcfiles_in = gstreamer-vaapi.pc.in -if USE_DRM -pcfiles_in += gstreamer-vaapi-drm.pc.in -endif -if USE_X11 -pcfiles_in += gstreamer-vaapi-x11.pc.in -endif -if USE_GLX -pcfiles_in += gstreamer-vaapi-glx.pc.in -endif -if USE_WAYLAND -pcfiles_in += gstreamer-vaapi-wayland.pc.in -endif - -pcfiles = $(pcfiles_in:%.pc.in=%-$(GST_PKG_VERSION).pc) - -all_pcfiles_in = gstreamer-vaapi.pc.in -all_pcfiles_in += gstreamer-vaapi-drm.pc.in -all_pcfiles_in += gstreamer-vaapi-x11.pc.in -all_pcfiles_in += gstreamer-vaapi-glx.pc.in -all_pcfiles_in += gstreamer-vaapi-wayland.pc.in - -all_pcfiles = $(all_pcfiles_in:%.pc.in=%-$(GST_PKG_VERSION).pc) - -pkgconfigdir = @pkgconfigdir@ -pkgconfig_DATA = $(pcfiles) - -EXTRA_DIST = $(all_pcfiles_in) - -DISTCLEANFILES = $(all_pcfiles) - --include $(top_srcdir)/git.mk diff -Nru gstreamer-vaapi-0.7.0/pkgconfig/Makefile.in gstreamer-vaapi-1.8.2/pkgconfig/Makefile.in --- gstreamer-vaapi-0.7.0/pkgconfig/Makefile.in 2015-12-07 10:54:25.000000000 +0000 +++ gstreamer-vaapi-1.8.2/pkgconfig/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,600 +0,0 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2014 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -@USE_DRM_TRUE@am__append_1 = gstreamer-vaapi-drm.pc.in -@USE_X11_TRUE@am__append_2 = gstreamer-vaapi-x11.pc.in -@USE_GLX_TRUE@am__append_3 = gstreamer-vaapi-glx.pc.in -@USE_WAYLAND_TRUE@am__append_4 = gstreamer-vaapi-wayland.pc.in -subdir = pkgconfig -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkgconfigdir)" -DATA = $(pkgconfig_DATA) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in \ - $(srcdir)/gstreamer-vaapi-drm.pc.in \ - $(srcdir)/gstreamer-vaapi-glx.pc.in \ - $(srcdir)/gstreamer-vaapi-wayland.pc.in \ - $(srcdir)/gstreamer-vaapi-x11.pc.in \ - $(srcdir)/gstreamer-vaapi.pc.in -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DLOPEN_LIBS = @DLOPEN_LIBS@ -DRM_CFLAGS = @DRM_CFLAGS@ -DRM_LIBS = @DRM_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGL_CFLAGS = @EGL_CFLAGS@ -EGL_LIBS = @EGL_LIBS@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GIT = @GIT@ -GLES2_CFLAGS = @GLES2_CFLAGS@ -GLES2_LIBS = @GLES2_LIBS@ -GLES3_CFLAGS = @GLES3_CFLAGS@ -GLES3_LIBS = @GLES3_LIBS@ -GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_LIBS = @GLIB_LIBS@ -GLIB_VERSION_REQUIRED = @GLIB_VERSION_REQUIRED@ -GL_CFLAGS = @GL_CFLAGS@ -GL_LIBS = @GL_LIBS@ -GMODULE_CFLAGS = @GMODULE_CFLAGS@ -GMODULE_LIBS = @GMODULE_LIBS@ -GMODULE_VERSION_REQUIRED = @GMODULE_VERSION_REQUIRED@ -GREP = @GREP@ -GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ -GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ -GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ -GST_API_VERSION = @GST_API_VERSION@ -GST_BASEVIDEO_CFLAGS = @GST_BASEVIDEO_CFLAGS@ -GST_BASEVIDEO_LIBS = @GST_BASEVIDEO_LIBS@ -GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ -GST_BASE_LIBS = @GST_BASE_LIBS@ -GST_CFLAGS = @GST_CFLAGS@ -GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ -GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ -GST_GL_CFLAGS = @GST_GL_CFLAGS@ -GST_GL_LIBS = @GST_GL_LIBS@ -GST_INTERFACES_CFLAGS = @GST_INTERFACES_CFLAGS@ -GST_INTERFACES_LIBS = @GST_INTERFACES_LIBS@ -GST_LIBS = @GST_LIBS@ -GST_PKG_VERSION = @GST_PKG_VERSION@ -GST_PLUGINS_BAD_VERSION_REQUIRED = @GST_PLUGINS_BAD_VERSION_REQUIRED@ -GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ -GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ -GST_PLUGINS_BASE_VERSION_REQUIRED = @GST_PLUGINS_BASE_VERSION_REQUIRED@ -GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ -GST_PLUGIN_PATH_1_0 = @GST_PLUGIN_PATH_1_0@ -GST_VAAPI_LT_LDFLAGS = @GST_VAAPI_LT_LDFLAGS@ -GST_VAAPI_LT_VERSION = @GST_VAAPI_LT_VERSION@ -GST_VAAPI_MAJOR_VERSION = @GST_VAAPI_MAJOR_VERSION@ -GST_VERSION_REQUIRED = @GST_VERSION_REQUIRED@ -GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ -GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ -GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ -GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ -GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ -GTKDOC_MKPDF = @GTKDOC_MKPDF@ -GTKDOC_REBASE = @GTKDOC_REBASE@ -GTKDOC_VERSION = @GTKDOC_VERSION@ -HTML_DIR = @HTML_DIR@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBVA_CFLAGS = @LIBVA_CFLAGS@ -LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ -LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ -LIBVA_LIBS = @LIBVA_LIBS@ -LIBVA_PACKAGE_VERSION = @LIBVA_PACKAGE_VERSION@ -LIBVA_PKGNAME = @LIBVA_PKGNAME@ -LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ -LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ -LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ -LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ -LIBVA_X11_PKGNAME = @LIBVA_X11_PKGNAME@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATCH = @PATCH@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TODAY = @TODAY@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ -VERSION = @VERSION@ -WAYLAND_API_VERSION = @WAYLAND_API_VERSION@ -WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ -WAYLAND_LIBS = @WAYLAND_LIBS@ -X11_CFLAGS = @X11_CFLAGS@ -X11_LIBS = @X11_LIBS@ -XRANDR_CFLAGS = @XRANDR_CFLAGS@ -XRANDR_LIBS = @XRANDR_LIBS@ -XRENDER_CFLAGS = @XRENDER_CFLAGS@ -XRENDER_LIBS = @XRENDER_LIBS@ -YASM = @YASM@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ -plugindir = @plugindir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -pcfiles_in = gstreamer-vaapi.pc.in $(am__append_1) $(am__append_2) \ - $(am__append_3) $(am__append_4) -pcfiles = $(pcfiles_in:%.pc.in=%-$(GST_PKG_VERSION).pc) -all_pcfiles_in = gstreamer-vaapi.pc.in gstreamer-vaapi-drm.pc.in \ - gstreamer-vaapi-x11.pc.in gstreamer-vaapi-glx.pc.in \ - gstreamer-vaapi-wayland.pc.in -all_pcfiles = $(all_pcfiles_in:%.pc.in=%-$(GST_PKG_VERSION).pc) -pkgconfig_DATA = $(pcfiles) -EXTRA_DIST = $(all_pcfiles_in) -DISTCLEANFILES = $(all_pcfiles) -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu pkgconfig/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu pkgconfig/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-pkgconfigDATA: $(pkgconfig_DATA) - @$(NORMAL_INSTALL) - @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ - done - -uninstall-pkgconfigDATA: - @$(NORMAL_UNINSTALL) - @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) -tags TAGS: - -ctags CTAGS: - -cscope cscopelist: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(DATA) -installdirs: - for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-pkgconfigDATA - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkgconfigDATA - -.MAKE: install-am install-strip - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - cscopelist-am ctags-am distclean distclean-generic \ - distclean-libtool distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkgconfigDATA install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags-am uninstall uninstall-am \ - uninstall-pkgconfigDATA - -.PRECIOUS: Makefile - - --include $(top_srcdir)/git.mk - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru gstreamer-vaapi-0.7.0/tests/Makefile.am gstreamer-vaapi-1.8.2/tests/Makefile.am --- gstreamer-vaapi-0.7.0/tests/Makefile.am 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/tests/Makefile.am 2016-03-24 11:36:59.000000000 +0000 @@ -29,49 +29,53 @@ $(GST_VIDEO_CFLAGS) \ $(NULL) +GST_VAAPI_LIBS = $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi.la TEST_LIBS = \ $(LIBVA_LIBS) \ $(GST_LIBS) \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-$(GST_API_VERSION).la + $(NULL) if USE_DRM +GST_VAAPI_LIBS += $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-drm.la TEST_CFLAGS += $(LIBVA_DRM_CFLAGS) -TEST_LIBS += \ - $(LIBVA_DRM_LIBS) \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-drm-$(GST_API_VERSION).la +TEST_LIBS += $(LIBVA_DRM_LIBS) endif if USE_X11 +GST_VAAPI_LIBS += $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11.la TEST_CFLAGS += $(X11_CFLAGS) TEST_LIBS += \ $(LIBVA_X11_LIBS) \ $(X11_LIBS) \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11-$(GST_API_VERSION).la + $(NULL) endif if USE_GLX +GST_VAAPI_LIBS += $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-glx.la TEST_CFLAGS += $(X11_CFLAGS) $(GL_CFLAGS) TEST_LIBS += \ $(LIBVA_GLX_LIBS) \ $(X11_LIBS) \ $(GL_LIBS) \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-glx-$(GST_API_VERSION).la + $(NULL) endif if USE_EGL +GST_VAAPI_LIBS += $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-egl.la TEST_CFLAGS += $(EGL_CFLAGS) TEST_LIBS += \ $(LIBVA_EGL_LIBS) \ $(EGL_LIBS) \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-egl-$(GST_API_VERSION).la + $(NULL) endif if USE_WAYLAND +GST_VAAPI_LIBS += $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-wayland.la TEST_CFLAGS += $(WAYLAND_CFLAGS) TEST_LIBS += \ $(LIBVA_WAYLAND_LIBS) \ $(WAYLAND_LIBS) \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-wayland-$(GST_API_VERSION).la + $(NULL) endif test_utils_dec_source_c = \ @@ -88,10 +92,14 @@ test_utils_source_h = codec.h image.h output.h noinst_LTLIBRARIES = libutils.la libutils_dec.la + libutils_la_SOURCES = $(test_utils_source_c) libutils_la_CFLAGS = $(TEST_CFLAGS) +libutils_la_LDFLAGS = $(GST_VAAPI_LIBS) + libutils_dec_la_SOURCES = $(test_utils_dec_source_c) libutils_dec_la_CFLAGS = $(TEST_CFLAGS) +libutils_dec_la_LDFLAGS = $(GST_VAAPI_LIBS) test_decode_SOURCES = test-decode.c test_decode_CFLAGS = $(TEST_CFLAGS) @@ -99,39 +107,47 @@ test_display_SOURCES = test-display.c test_display_CFLAGS = $(TEST_CFLAGS) +test_display_LDFLAGS = $(GST_VAAPI_LIBS) test_display_LDADD = libutils.la $(TEST_LIBS) test_filter_SOURCES = test-filter.c test_filter_CFLAGS = $(TEST_CFLAGS) +test_filter_LDFLAGS = $(GST_VAAPI_LIBS) test_filter_LDADD = libutils.la $(TEST_LIBS) $(GST_VIDEO_LIBS) test_surfaces_SOURCES = test-surfaces.c test_surfaces_CFLAGS = $(TEST_CFLAGS) $(GST_VIDEO_CFLAGS) +test_surfaces_LDFLAGS = $(GST_VAAPI_LIBS) test_surfaces_LDADD = libutils.la $(TEST_LIBS) $(GST_VIDEO_LIBS) test_subpicture_SOURCES = test-subpicture.c test-subpicture-data.c test_subpicture_CFLAGS = $(TEST_CFLAGS) $(GST_VIDEO_CFLAGS) test_subpicture_LDADD = libutils.la libutils_dec.la $(TEST_LIBS) \ $(GST_VIDEO_LIBS) +test_subpicture_LDFLAGS = $(GST_VAAPI_LIBS) test_windows_SOURCES = test-windows.c test_windows_CFLAGS = $(TEST_CFLAGS) +test_windows_LDFLAGS = $(GST_VAAPI_LIBS) test_windows_LDADD = libutils.la $(TEST_LIBS) test_textures_SOURCES = test-textures.c test_textures_CFLAGS = $(TEST_CFLAGS) +test_textures_LDFLAGS = $(GST_VAAPI_LIBS) test_textures_LDADD = libutils.la $(TEST_LIBS) simple_decoder_source_c = simple-decoder.c simple_decoder_source_h = simple_decoder_SOURCES = $(simple_decoder_source_c) simple_decoder_CFLAGS = $(TEST_CFLAGS) $(GST_VIDEO_CFLAGS) +simple_decoder_LDFLAGS = $(GST_VAAPI_LIBS) simple_decoder_LDADD = libutils.la $(TEST_LIBS) $(GST_VIDEO_LIBS) simple_encoder_source_c = simple-encoder.c y4mreader.c simple_encoder_source_h = y4mreader.h simple_encoder_SOURCES = $(simple_encoder_source_c) simple_encoder_CFLAGS = $(TEST_CFLAGS) $(GST_VIDEO_CFLAGS) +simple_encoder_LDFLAGS = $(GST_VAAPI_LIBS) simple_encoder_LDADD = libutils.la $(TEST_LIBS) $(GST_VIDEO_LIBS) EXTRA_DIST = \ diff -Nru gstreamer-vaapi-0.7.0/tests/Makefile.in gstreamer-vaapi-1.8.2/tests/Makefile.in --- gstreamer-vaapi-0.7.0/tests/Makefile.in 2015-12-07 10:54:25.000000000 +0000 +++ gstreamer-vaapi-1.8.2/tests/Makefile.in 2016-06-09 07:27:12.000000000 +0000 @@ -102,42 +102,61 @@ @USE_GLX_TRUE@ test-textures \ @USE_GLX_TRUE@ $(NULL) -@USE_DRM_TRUE@am__append_3 = $(LIBVA_DRM_CFLAGS) -@USE_DRM_TRUE@am__append_4 = \ -@USE_DRM_TRUE@ $(LIBVA_DRM_LIBS) \ -@USE_DRM_TRUE@ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-drm-$(GST_API_VERSION).la - -@USE_X11_TRUE@am__append_5 = $(X11_CFLAGS) -@USE_X11_TRUE@am__append_6 = \ +@USE_DRM_TRUE@am__append_3 = $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-drm.la +@USE_DRM_TRUE@am__append_4 = $(LIBVA_DRM_CFLAGS) +@USE_DRM_TRUE@am__append_5 = $(LIBVA_DRM_LIBS) +@USE_X11_TRUE@am__append_6 = $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11.la +@USE_X11_TRUE@am__append_7 = $(X11_CFLAGS) +@USE_X11_TRUE@am__append_8 = \ @USE_X11_TRUE@ $(LIBVA_X11_LIBS) \ @USE_X11_TRUE@ $(X11_LIBS) \ -@USE_X11_TRUE@ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11-$(GST_API_VERSION).la +@USE_X11_TRUE@ $(NULL) -@USE_GLX_TRUE@am__append_7 = $(X11_CFLAGS) $(GL_CFLAGS) -@USE_GLX_TRUE@am__append_8 = \ +@USE_GLX_TRUE@am__append_9 = $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-glx.la +@USE_GLX_TRUE@am__append_10 = $(X11_CFLAGS) $(GL_CFLAGS) +@USE_GLX_TRUE@am__append_11 = \ @USE_GLX_TRUE@ $(LIBVA_GLX_LIBS) \ @USE_GLX_TRUE@ $(X11_LIBS) \ @USE_GLX_TRUE@ $(GL_LIBS) \ -@USE_GLX_TRUE@ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-glx-$(GST_API_VERSION).la +@USE_GLX_TRUE@ $(NULL) -@USE_EGL_TRUE@am__append_9 = $(EGL_CFLAGS) -@USE_EGL_TRUE@am__append_10 = \ +@USE_EGL_TRUE@am__append_12 = $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-egl.la +@USE_EGL_TRUE@am__append_13 = $(EGL_CFLAGS) +@USE_EGL_TRUE@am__append_14 = \ @USE_EGL_TRUE@ $(LIBVA_EGL_LIBS) \ @USE_EGL_TRUE@ $(EGL_LIBS) \ -@USE_EGL_TRUE@ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-egl-$(GST_API_VERSION).la +@USE_EGL_TRUE@ $(NULL) -@USE_WAYLAND_TRUE@am__append_11 = $(WAYLAND_CFLAGS) -@USE_WAYLAND_TRUE@am__append_12 = \ +@USE_WAYLAND_TRUE@am__append_15 = $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-wayland.la +@USE_WAYLAND_TRUE@am__append_16 = $(WAYLAND_CFLAGS) +@USE_WAYLAND_TRUE@am__append_17 = \ @USE_WAYLAND_TRUE@ $(LIBVA_WAYLAND_LIBS) \ @USE_WAYLAND_TRUE@ $(WAYLAND_LIBS) \ -@USE_WAYLAND_TRUE@ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-wayland-$(GST_API_VERSION).la +@USE_WAYLAND_TRUE@ $(NULL) subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-arch.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-platform.m4 \ + $(top_srcdir)/common/m4/gst-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -157,7 +176,7 @@ am__v_lt_1 = libutils_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libutils_la_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ + $(CFLAGS) $(libutils_la_LDFLAGS) $(LDFLAGS) -o $@ libutils_dec_la_LIBADD = am__objects_2 = libutils_dec_la-decoder.lo \ libutils_dec_la-test-h264.lo libutils_dec_la-test-jpeg.lo \ @@ -167,8 +186,8 @@ libutils_dec_la_OBJECTS = $(am_libutils_dec_la_OBJECTS) libutils_dec_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(libutils_dec_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ - -o $@ + $(libutils_dec_la_CFLAGS) $(CFLAGS) $(libutils_dec_la_LDFLAGS) \ + $(LDFLAGS) -o $@ @USE_ENCODERS_TRUE@am__EXEEXT_1 = simple-encoder$(EXEEXT) @USE_GLX_TRUE@am__EXEEXT_2 = test-textures$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) @@ -176,21 +195,15 @@ am_simple_decoder_OBJECTS = $(am__objects_3) simple_decoder_OBJECTS = $(am_simple_decoder_OBJECTS) am__DEPENDENCIES_1 = -@USE_DRM_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) \ -@USE_DRM_TRUE@ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-drm-$(GST_API_VERSION).la +@USE_DRM_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) @USE_X11_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) \ -@USE_X11_TRUE@ $(am__DEPENDENCIES_1) \ -@USE_X11_TRUE@ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11-$(GST_API_VERSION).la +@USE_X11_TRUE@ $(am__DEPENDENCIES_1) @USE_GLX_TRUE@am__DEPENDENCIES_4 = $(am__DEPENDENCIES_1) \ -@USE_GLX_TRUE@ $(am__DEPENDENCIES_1) \ -@USE_GLX_TRUE@ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-glx-$(GST_API_VERSION).la -@USE_EGL_TRUE@am__DEPENDENCIES_5 = $(am__DEPENDENCIES_1) \ -@USE_EGL_TRUE@ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-egl-$(GST_API_VERSION).la +@USE_GLX_TRUE@ $(am__DEPENDENCIES_1) +@USE_EGL_TRUE@am__DEPENDENCIES_5 = $(am__DEPENDENCIES_1) @USE_WAYLAND_TRUE@am__DEPENDENCIES_6 = $(am__DEPENDENCIES_1) \ -@USE_WAYLAND_TRUE@ $(am__DEPENDENCIES_1) \ -@USE_WAYLAND_TRUE@ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-wayland-$(GST_API_VERSION).la +@USE_WAYLAND_TRUE@ $(am__DEPENDENCIES_1) am__DEPENDENCIES_7 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-$(GST_API_VERSION).la \ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \ $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \ $(am__DEPENDENCIES_6) @@ -198,8 +211,8 @@ $(am__DEPENDENCIES_1) simple_decoder_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(simple_decoder_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ - $@ + $(simple_decoder_CFLAGS) $(CFLAGS) $(simple_decoder_LDFLAGS) \ + $(LDFLAGS) -o $@ am__objects_4 = simple_encoder-simple-encoder.$(OBJEXT) \ simple_encoder-y4mreader.$(OBJEXT) am_simple_encoder_OBJECTS = $(am__objects_4) @@ -208,8 +221,8 @@ $(am__DEPENDENCIES_1) simple_encoder_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(simple_encoder_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ - $@ + $(simple_encoder_CFLAGS) $(CFLAGS) $(simple_encoder_LDFLAGS) \ + $(LDFLAGS) -o $@ am_test_decode_OBJECTS = test_decode-test-decode.$(OBJEXT) test_decode_OBJECTS = $(am_test_decode_OBJECTS) test_decode_DEPENDENCIES = libutils.la libutils_dec.la \ @@ -222,14 +235,14 @@ test_display_DEPENDENCIES = libutils.la $(am__DEPENDENCIES_7) test_display_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_display_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ + $(CFLAGS) $(test_display_LDFLAGS) $(LDFLAGS) -o $@ am_test_filter_OBJECTS = test_filter-test-filter.$(OBJEXT) test_filter_OBJECTS = $(am_test_filter_OBJECTS) test_filter_DEPENDENCIES = libutils.la $(am__DEPENDENCIES_7) \ $(am__DEPENDENCIES_1) test_filter_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_filter_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ + $(CFLAGS) $(test_filter_LDFLAGS) $(LDFLAGS) -o $@ am_test_subpicture_OBJECTS = \ test_subpicture-test-subpicture.$(OBJEXT) \ test_subpicture-test-subpicture-data.$(OBJEXT) @@ -238,27 +251,27 @@ $(am__DEPENDENCIES_7) $(am__DEPENDENCIES_1) test_subpicture_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(test_subpicture_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ - -o $@ + $(test_subpicture_CFLAGS) $(CFLAGS) $(test_subpicture_LDFLAGS) \ + $(LDFLAGS) -o $@ am_test_surfaces_OBJECTS = test_surfaces-test-surfaces.$(OBJEXT) test_surfaces_OBJECTS = $(am_test_surfaces_OBJECTS) test_surfaces_DEPENDENCIES = libutils.la $(am__DEPENDENCIES_7) \ $(am__DEPENDENCIES_1) test_surfaces_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_surfaces_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ + $(CFLAGS) $(test_surfaces_LDFLAGS) $(LDFLAGS) -o $@ am_test_textures_OBJECTS = test_textures-test-textures.$(OBJEXT) test_textures_OBJECTS = $(am_test_textures_OBJECTS) test_textures_DEPENDENCIES = libutils.la $(am__DEPENDENCIES_7) test_textures_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_textures_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ + $(CFLAGS) $(test_textures_LDFLAGS) $(LDFLAGS) -o $@ am_test_windows_OBJECTS = test_windows-test-windows.$(OBJEXT) test_windows_OBJECTS = $(am_test_windows_OBJECTS) test_windows_DEPENDENCIES = libutils.la $(am__DEPENDENCIES_7) test_windows_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_windows_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ + $(CFLAGS) $(test_windows_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -333,9 +346,11 @@ $(top_srcdir)/build-aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ +AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -348,6 +363,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DRM_CFLAGS = @DRM_CFLAGS@ @@ -360,58 +376,64 @@ EGL_CFLAGS = @EGL_CFLAGS@ EGL_LIBS = @EGL_LIBS@ EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ GIT = @GIT@ GLES2_CFLAGS = @GLES2_CFLAGS@ GLES2_LIBS = @GLES2_LIBS@ GLES3_CFLAGS = @GLES3_CFLAGS@ GLES3_LIBS = @GLES3_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ -GLIB_VERSION_REQUIRED = @GLIB_VERSION_REQUIRED@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ -GMODULE_VERSION_REQUIRED = @GMODULE_VERSION_REQUIRED@ GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ GST_ALLOCATORS_CFLAGS = @GST_ALLOCATORS_CFLAGS@ GST_ALLOCATORS_LIBS = @GST_ALLOCATORS_LIBS@ GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ GST_API_VERSION = @GST_API_VERSION@ -GST_BASEVIDEO_CFLAGS = @GST_BASEVIDEO_CFLAGS@ -GST_BASEVIDEO_LIBS = @GST_BASEVIDEO_LIBS@ GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ GST_BASE_LIBS = @GST_BASE_LIBS@ GST_CFLAGS = @GST_CFLAGS@ GST_CODEC_PARSERS_CFLAGS = @GST_CODEC_PARSERS_CFLAGS@ GST_CODEC_PARSERS_LIBS = @GST_CODEC_PARSERS_LIBS@ +GST_CURRENT = @GST_CURRENT@ GST_GL_CFLAGS = @GST_GL_CFLAGS@ GST_GL_LIBS = @GST_GL_LIBS@ -GST_INTERFACES_CFLAGS = @GST_INTERFACES_CFLAGS@ -GST_INTERFACES_LIBS = @GST_INTERFACES_LIBS@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ GST_LIBS = @GST_LIBS@ -GST_PKG_VERSION = @GST_PKG_VERSION@ -GST_PLUGINS_BAD_VERSION_REQUIRED = @GST_PLUGINS_BAD_VERSION_REQUIRED@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PBUTILS_CFLAGS = @GST_PBUTILS_CFLAGS@ +GST_PBUTILS_LIBS = @GST_PBUTILS_LIBS@ GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ -GST_PLUGINS_BASE_VERSION_REQUIRED = @GST_PLUGINS_BASE_VERSION_REQUIRED@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ -GST_PLUGIN_PATH_1_0 = @GST_PLUGIN_PATH_1_0@ -GST_VAAPI_LT_LDFLAGS = @GST_VAAPI_LT_LDFLAGS@ -GST_VAAPI_LT_VERSION = @GST_VAAPI_LT_VERSION@ -GST_VAAPI_MAJOR_VERSION = @GST_VAAPI_MAJOR_VERSION@ -GST_VERSION_REQUIRED = @GST_VERSION_REQUIRED@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ GST_VIDEO_CFLAGS = @GST_VIDEO_CFLAGS@ GST_VIDEO_LIBS = @GST_VIDEO_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ -GTKDOC_VERSION = @GTKDOC_VERSION@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -420,6 +442,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -427,16 +450,15 @@ LIBVA_DRM_CFLAGS = @LIBVA_DRM_CFLAGS@ LIBVA_DRM_LIBS = @LIBVA_DRM_LIBS@ LIBVA_LIBS = @LIBVA_LIBS@ -LIBVA_PACKAGE_VERSION = @LIBVA_PACKAGE_VERSION@ -LIBVA_PKGNAME = @LIBVA_PKGNAME@ LIBVA_WAYLAND_CFLAGS = @LIBVA_WAYLAND_CFLAGS@ LIBVA_WAYLAND_LIBS = @LIBVA_WAYLAND_LIBS@ LIBVA_X11_CFLAGS = @LIBVA_X11_CFLAGS@ LIBVA_X11_LIBS = @LIBVA_X11_LIBS@ -LIBVA_X11_PKGNAME = @LIBVA_X11_PKGNAME@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -453,21 +475,27 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ -PATCH = @PATCH@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ -TODAY = @TODAY@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ VERSION = @VERSION@ -WAYLAND_API_VERSION = @WAYLAND_API_VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ WAYLAND_LIBS = @WAYLAND_LIBS@ X11_CFLAGS = @X11_CFLAGS@ @@ -476,7 +504,6 @@ XRANDR_LIBS = @XRANDR_LIBS@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ -YASM = @YASM@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -518,11 +545,15 @@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ plugindir = @plugindir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -537,12 +568,14 @@ top_srcdir = @top_srcdir@ TEST_CFLAGS = -DGST_USE_UNSTABLE_API -I$(top_srcdir)/gst-libs \ -I$(top_builddir)/gst-libs $(LIBVA_CFLAGS) $(GST_CFLAGS) \ - $(GST_VIDEO_CFLAGS) $(NULL) $(am__append_3) $(am__append_5) \ - $(am__append_7) $(am__append_9) $(am__append_11) -TEST_LIBS = $(LIBVA_LIBS) $(GST_LIBS) \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-$(GST_API_VERSION).la \ - $(am__append_4) $(am__append_6) $(am__append_8) \ - $(am__append_10) $(am__append_12) + $(GST_VIDEO_CFLAGS) $(NULL) $(am__append_4) $(am__append_7) \ + $(am__append_10) $(am__append_13) $(am__append_16) +GST_VAAPI_LIBS = $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi.la \ + $(am__append_3) $(am__append_6) $(am__append_9) \ + $(am__append_12) $(am__append_15) +TEST_LIBS = $(LIBVA_LIBS) $(GST_LIBS) $(NULL) $(am__append_5) \ + $(am__append_8) $(am__append_11) $(am__append_14) \ + $(am__append_17) test_utils_dec_source_c = \ decoder.c \ test-h264.c \ @@ -558,40 +591,50 @@ noinst_LTLIBRARIES = libutils.la libutils_dec.la libutils_la_SOURCES = $(test_utils_source_c) libutils_la_CFLAGS = $(TEST_CFLAGS) +libutils_la_LDFLAGS = $(GST_VAAPI_LIBS) libutils_dec_la_SOURCES = $(test_utils_dec_source_c) libutils_dec_la_CFLAGS = $(TEST_CFLAGS) +libutils_dec_la_LDFLAGS = $(GST_VAAPI_LIBS) test_decode_SOURCES = test-decode.c test_decode_CFLAGS = $(TEST_CFLAGS) test_decode_LDADD = libutils.la libutils_dec.la $(TEST_LIBS) test_display_SOURCES = test-display.c test_display_CFLAGS = $(TEST_CFLAGS) +test_display_LDFLAGS = $(GST_VAAPI_LIBS) test_display_LDADD = libutils.la $(TEST_LIBS) test_filter_SOURCES = test-filter.c test_filter_CFLAGS = $(TEST_CFLAGS) +test_filter_LDFLAGS = $(GST_VAAPI_LIBS) test_filter_LDADD = libutils.la $(TEST_LIBS) $(GST_VIDEO_LIBS) test_surfaces_SOURCES = test-surfaces.c test_surfaces_CFLAGS = $(TEST_CFLAGS) $(GST_VIDEO_CFLAGS) +test_surfaces_LDFLAGS = $(GST_VAAPI_LIBS) test_surfaces_LDADD = libutils.la $(TEST_LIBS) $(GST_VIDEO_LIBS) test_subpicture_SOURCES = test-subpicture.c test-subpicture-data.c test_subpicture_CFLAGS = $(TEST_CFLAGS) $(GST_VIDEO_CFLAGS) test_subpicture_LDADD = libutils.la libutils_dec.la $(TEST_LIBS) \ $(GST_VIDEO_LIBS) +test_subpicture_LDFLAGS = $(GST_VAAPI_LIBS) test_windows_SOURCES = test-windows.c test_windows_CFLAGS = $(TEST_CFLAGS) +test_windows_LDFLAGS = $(GST_VAAPI_LIBS) test_windows_LDADD = libutils.la $(TEST_LIBS) test_textures_SOURCES = test-textures.c test_textures_CFLAGS = $(TEST_CFLAGS) +test_textures_LDFLAGS = $(GST_VAAPI_LIBS) test_textures_LDADD = libutils.la $(TEST_LIBS) simple_decoder_source_c = simple-decoder.c simple_decoder_source_h = simple_decoder_SOURCES = $(simple_decoder_source_c) simple_decoder_CFLAGS = $(TEST_CFLAGS) $(GST_VIDEO_CFLAGS) +simple_decoder_LDFLAGS = $(GST_VAAPI_LIBS) simple_decoder_LDADD = libutils.la $(TEST_LIBS) $(GST_VIDEO_LIBS) simple_encoder_source_c = simple-encoder.c y4mreader.c simple_encoder_source_h = y4mreader.h simple_encoder_SOURCES = $(simple_encoder_source_c) simple_encoder_CFLAGS = $(TEST_CFLAGS) $(GST_VIDEO_CFLAGS) +simple_encoder_LDFLAGS = $(GST_VAAPI_LIBS) simple_encoder_LDADD = libutils.la $(TEST_LIBS) $(GST_VIDEO_LIBS) EXTRA_DIST = \ test-subpicture-data.h \ @@ -605,7 +648,7 @@ .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -629,9 +672,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): @@ -725,22 +768,25 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_windows-test-windows.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< diff -Nru gstreamer-vaapi-0.7.0/tests/simple-encoder.c gstreamer-vaapi-1.8.2/tests/simple-encoder.c --- gstreamer-vaapi-0.7.0/tests/simple-encoder.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/tests/simple-encoder.c 2016-03-24 11:36:59.000000000 +0000 @@ -409,19 +409,22 @@ buffer_thread = g_thread_new ("get buffer thread", get_buffer_thread, app); while (1) { + GstVaapiSurfaceProxy *proxy; + GstVaapiSurface *surface; + if (!load_frame (app, image)) break; if (!gst_vaapi_image_unmap (image)) break; - GstVaapiSurfaceProxy *proxy = + proxy = gst_vaapi_surface_proxy_new_from_pool (GST_VAAPI_SURFACE_POOL (pool)); if (!proxy) { g_warning ("Could not get surface proxy from pool."); break; } - GstVaapiSurface *surface = gst_vaapi_surface_proxy_get_surface (proxy); + surface = gst_vaapi_surface_proxy_get_surface (proxy); if (!surface) { g_warning ("Could not get surface from proxy."); break; @@ -439,7 +442,8 @@ app->read_frames++; id = gst_vaapi_surface_get_id (surface); - g_debug ("input frame %d, surface id = %lu", app->read_frames, id); + g_debug ("input frame %d, surface id = %" G_GSIZE_FORMAT, app->read_frames, + id); gst_vaapi_surface_proxy_unref (proxy); } diff -Nru gstreamer-vaapi-0.7.0/tests/test-display.c gstreamer-vaapi-1.8.2/tests/test-display.c --- gstreamer-vaapi-0.7.0/tests/test-display.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/tests/test-display.c 2016-06-09 07:08:12.000000000 +0000 @@ -269,8 +269,14 @@ int main(int argc, char *argv[]) { - GstVaapiDisplay *display, *display2; - guint width, height, par_n, par_d; + GstVaapiDisplay *display; +#if USE_X11 + GstVaapiDisplay *display2; +#endif +#if USE_X11 || USE_WAYLAND + guint width, height; + guint par_n, par_d; +#endif gst_init(&argc, &argv); diff -Nru gstreamer-vaapi-0.7.0/tests/test-filter.c gstreamer-vaapi-1.8.2/tests/test-filter.c --- gstreamer-vaapi-0.7.0/tests/test-filter.c 2015-12-07 10:36:41.000000000 +0000 +++ gstreamer-vaapi-1.8.2/tests/test-filter.c 2016-03-24 11:36:59.000000000 +0000 @@ -246,12 +246,13 @@ g_return_val_if_fail(out_value_ptr != NULL, FALSE); if (str) { + const GEnumValue *enum_value; GEnumClass * const enum_class = g_type_class_ref(type); + if (!enum_class) return FALSE; - const GEnumValue * const enum_value = - g_enum_get_value_by_nick(enum_class, str); + enum_value = g_enum_get_value_by_nick(enum_class, str); if (enum_value) out_value = enum_value->value; g_type_class_unref(enum_class);